{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\n// Configurations\n$access_token = null;\n$app_id = null;\n$app_secret = null;\n// should begin with \"act_\" (eg: $account_id = 'act_1234567890';)\n$account_id = null;\ndefine('SDK_DIR', __DIR__ . '/..'); // Path to the SDK directory\n$loader = include SDK_DIR.'/vendor/autoload.php';\ndate_default_timezone_set('America/Los_Angeles');\n// Configurations - End\n\nif(is_null($access_token) || is_null($app_id) || is_null($app_secret)) {\n  throw new \\Exception(\n    'You must set your access token, app id and app secret before executing'\n  );\n}\n\nif (is_null($account_id)) {\n  throw new \\Exception(\n    'You must set your account id before executing');\n}\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\nApi::init($app_id, $app_secret, $access_token);\n$api = Api::instance();\n$api->setLogger(new CurlLogger());\n\n/**\n * Step 1 Read the AdAccount (optional)\n */\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\Fields\\AdAccountFields;\n\n\n$account = (new AdAccount($account_id))->read(array(\n  AdAccountFields::ID,\n  AdAccountFields::NAME,\n  AdAccountFields::ACCOUNT_STATUS,\n));\n\necho \"\\nUsing this account: \";\necho $account->id.\"\\n\";\n\n// Check the account is active\nif($account->{AdAccountFields::ACCOUNT_STATUS} !== 1) {\n  throw new \\Exception(\n    'This account is not active');\n}\n\n/**\n * Step 2 Create the Campaign\n */\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\Fields\\CampaignFields;\nuse FacebookAds\\Object\\Values\\CampaignObjectiveValues;\n\n$campaign = $account->createCampaign(\n  $fields = array(),\n  $params = array(\n    CampaignFields::NAME => 'My First Campaign',\n    CampaignFields::OBJECTIVE => CampaignObjectiveValues::LINK_CLICKS,\n    Campaign::STATUS_PARAM_NAME => Campaign::STATUS_PAUSED,\n  )\n);\n\n\necho \"Campaign ID:\" . $campaign->id . \"\\n\";\n\n/**\n * Step 3 Search Targeting\n */\nuse FacebookAds\\Object\\TargetingSearch;\nuse FacebookAds\\Object\\Search\\TargetingSearchTypes;\nuse FacebookAds\\Object\\Targeting;\nuse FacebookAds\\Object\\Fields\\TargetingFields;\n\n$results = TargetingSearch::search(\n  $type = TargetingSearchTypes::INTEREST,\n  $class = null,\n  $query = 'facebook');\n\n// we'll take the top result for now\n$target = (count($results)) ? $results->current() : null;\n\necho \"Using target: \".$target->name.\"\\n\";\n\n$targeting = new Targeting();\n$targeting->{TargetingFields::GEO_LOCATIONS}\n  = array('countries' => array('GB'));\n$targeting->{TargetingFields::INTERESTS} = array(\n    array(\n        'id' => $target->id,\n        'name' => $target->name,\n    ),\n);\n\n/**\n * Step 4 Create the AdSet\n */\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Object\\Fields\\AdSetFields;\nuse FacebookAds\\Object\\Values\\AdSetOptimizationGoalValues;\nuse FacebookAds\\Object\\Values\\AdSetBillingEventValues;\nuse FacebookAds\\Object\\Values\\AdSetStatusValues;\n\n$adset = $account->createAdSet(\n  $fields = array(),\n  $params = array(\n    AdSetFields::NAME => 'My First AdSet',\n    AdSetFields::CAMPAIGN_ID => 6121920447142,//$campaign->id,\n    AdSetFields::DAILY_BUDGET => '150',\n    AdSetFields::TARGETING => $targeting,\n    AdSetFields::OPTIMIZATION_GOAL => AdSetOptimizationGoalValues::REACH,\n    AdSetFields::BILLING_EVENT => AdSetBillingEventValues::IMPRESSIONS,\n    AdSetFields::BID_AMOUNT => 100,\n    AdSetFields::START_TIME =>\n      (new \\DateTime(\"+1 week\"))->format(\\DateTime::ISO8601),\n    AdSetFields::END_TIME =>\n      (new \\DateTime(\"+2 week\"))->format(\\DateTime::ISO8601),\n    AdSetFields::STATUS => AdSetStatusValues::ACTIVE,\n  )\n);\n\n\necho 'AdSet  ID: '. $adset->id . \"\\n\";\n\n/**\n * Step 5 Create an AdImage\n */\nuse FacebookAds\\Object\\AdImage;\nuse FacebookAds\\Object\\Fields\\AdImageFields;\n\n$image = $account->createAdImage(\n  array(),\n  array(\n    AdImageFields::FILENAME => SDK_DIR.'/test/misc/image.png',\n  )\n);\necho 'Image Hash: '.$image->hash . \"\\n\";\n\n/**\n * Step 6 Create an AdCreative\n */\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\Fields\\AdCreativeFields;\n\n$creative = $account->createAdCreative(\n  array(),\n  array(\n    AdCreativeFields::NAME => 'Sample Creative',\n    AdCreativeFields::TITLE => 'Welcome to the Jungle',\n    AdCreativeFields::BODY => 'We\\'ve got fun \\'n\\' games',\n    AdCreativeFields::IMAGE_HASH => $image->hash,\n    AdCreativeFields::OBJECT_URL => 'http://www.example.com/',\n  )\n);\n\necho 'Creative ID: '.$creative->id . \"\\n\";\n\n/**\n * Step 7 Create an Ad\n */\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Object\\Fields\\AdFields;\n\n$account->createAd(\n  array(),\n  array(\n    AdFields::CREATIVE => array('creative_id' => $creative->id),\n    AdFields::NAME => 'My First Ad',\n    AdFields::ADSET_ID => $adset->id,\n  )\n);\n\necho 'Ad ID:' . $ad->id . \"\\n\";\n", "num_lines": 202}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\n// Configurations\n$access_token = null;\n$app_id = null;\n$app_secret = null;\n// should begin with \"act_\" (eg: $account_id = 'act_1234567890';)\n$account_id = null;\ndefine('SDK_DIR', __DIR__ . '/..'); // Path to the SDK directory\n$loader = include SDK_DIR.'/vendor/autoload.php';\n// Configurations - End\n\nif (is_null($access_token) || is_null($app_id) || is_null($app_secret)) {\n  throw new \\Exception(\n    'You must set your access token, app id and app secret before executing'\n  );\n}\n\nif (is_null($account_id)) {\n  throw new \\Exception(\n    'You must set your account id before executing');\n}\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\nApi::init($app_id, $app_secret, $access_token);\n\n// Create the CurlLogger\n$logger = new CurlLogger();\n\n// To write to a file pass in a file handler\n// $logger = new CurlLogger(fopen('test','w'));\n\n// Attach the logger to the Api instance\nApi::instance()->setLogger($logger);\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\Fields\\AdAccountFields;\n\n$account = (new AdAccount($account_id))->read(array(\n  AdAccountFields::ID,\n  AdAccountFields::NAME,\n  AdAccountFields::ACCOUNT_STATUS,\n));\n", "num_lines": 68}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\n// Configurations\n$access_token = null;\n$app_id = null;\n$app_secret = null;\n// should begin with \"act_\" (eg: $account_id = 'act_1234567890';)\n$account_id = null;\n// Configurations - End\n\nif (is_null($access_token) || is_null($app_id) || is_null($app_secret)) {\n  throw new \\Exception(\n    'You must set your access token, app id and app secret before executing'\n  );\n}\n\nif (is_null($account_id)) {\n  throw new \\Exception(\n    'You must set your account id before executing');\n}\n\ndefine('SDK_DIR', __DIR__ . '/..'); // Path to the SDK directory\n$loader = include SDK_DIR.'/vendor/autoload.php';\n\nuse FacebookAds\\Api;\n\nApi::init($app_id, $app_secret, $access_token);\n\n// use the namespace for Custom Audiences and Fields\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Object\\Fields\\CustomAudienceFields;\nuse FacebookAds\\Object\\Values\\CustomAudienceTypes;\nuse FacebookAds\\Object\\Values\\CustomAudienceSubtypes;\n\n// Create a custom audience object, setting the parent to be the account id\n$audience = new CustomAudience(null, $account_id);\n$audience->setData(array(\n  CustomAudienceFields::NAME => 'My Custom Audiece',\n  CustomAudienceFields::DESCRIPTION => 'Lots of people',\n  CustomAudienceFields::SUBTYPE => CustomAudienceSubtypes::CUSTOM,\n));\n// Create the audience\n$audience->create();\necho \"Audience ID: \" . $audience->id.\"\\n\";\n\n// Assuming you have an array of emails:\n// NOTE: The SDK will hash (SHA-2) your data before submitting\n// it to Facebook servers\n$emails = array(\n  'paul@example.com',\n  'luca@example.com',\n  'bruce@example.com',\n  'peihua@example.com',\n);\n\n$audience->addUsers($emails, CustomAudienceTypes::EMAIL);\n$audience->read(array(CustomAudienceFields::APPROXIMATE_COUNT));\necho \"Estimated Size:\"\n  . $audience->{CustomAudienceFields::APPROXIMATE_COUNT}.\"\\n\";\n", "num_lines": 82}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\ndefine('SDK_DIR', __DIR__ . '/..'); // Path to the SDK directory\n$loader = include SDK_DIR . '/vendor/autoload.php';\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Object\\ServerSide\\Content;\nuse FacebookAds\\Object\\ServerSide\\CustomData;\nuse FacebookAds\\Object\\ServerSide\\Event;\nuse FacebookAds\\Object\\ServerSide\\EventRequest;\nuse FacebookAds\\Object\\ServerSide\\Gender;\nuse FacebookAds\\Object\\ServerSide\\UserData;\n\n// Configuration.\n// Should fill in value before running this script\n$access_token = null;\n$pixel_id = null;\n\nif (is_null($access_token) || is_null($pixel_id)) {\n  throw new Exception(\n    'You must set your access token and pixel id before executing'\n  );\n}\n\n// Initialize\nApi::init(null, null, $access_token);\n$api = Api::instance();\n\n// Create Server Side Event Object\n$event = new Event();\n$event\n  ->setEventName('Purchase')\n  ->setEventTime(time());\n\n$user_data = new UserData();\n$user_data\n  ->setEmail('joe@eg.com')\n  ->setPhone('16505551212')\n  ->setCountryCode('us')\n  ->setGender(Gender::FEMALE);\n\n$custom_content = new Content();\n$custom_content\n  ->setItemPrice(3.5)\n  ->setProductId(\"XYZ789\")\n  ->setQuantity(4);\n\n$custom_contents = array();\narray_push($custom_contents, $custom_content);\n\n$custom_data = new CustomData();\n$custom_data\n  ->setCurrency('USD')\n  ->setValue(14.0)\n  ->setContents($custom_contents);\n\n$event->setUserData($user_data);\n$event->setCustomData($custom_data);\n\n$events = array();\narray_push($events, $event);\narray_push($events, $event);\n\n// Create event request\n$request = new EventRequest($pixel_id);\n$request->setEvents($events);\n// Execute the request\n$response = $request->execute();\n\nprint_r($response);\n", "num_lines": 93}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\nuse FacebookAds\\Object\\AbstractObject;\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\Fields\\AdAccountFields;\nuse FacebookAds\\Object\\Fields\\CampaignFields;\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Object\\Targeting;\nuse FacebookAds\\Object\\Fields\\TargetingFields;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Object\\Fields\\AdSetFields;\nuse FacebookAds\\Object\\Values\\AdSetBillingEventValues;\nuse FacebookAds\\Object\\Values\\AdSetOptimizationGoalValues;\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Object\\Fields\\AdFields;\nuse FacebookAds\\Object\\AdImage;\nuse FacebookAds\\Object\\Fields\\AdImageFields;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\Values\\AdCreativeCallToActionTypeValues;\nuse FacebookAds\\Object\\AdCreativeLinkData;\nuse FacebookAds\\Object\\Fields\\AdCreativeLinkDataCallToActionValueFields;\nuse FacebookAds\\Object\\Fields\\AdCreativeLinkDataFields;\nuse FacebookAds\\Object\\AdCreativeObjectStorySpec;\nuse FacebookAds\\Object\\Fields\\AdCreativeObjectStorySpecFields;\nuse FacebookAds\\Object\\Fields\\AdCreativeFields;\nuse FacebookAds\\Object\\Values\\PageCallToActionWebDestinationTypeValues;\n\nuse FacebookAds\\Object\\Business;\nuse FacebookAds\\Object\\Fields\\BusinessFields;\nuse FacebookAds\\Object\\ExtendedCredit;\n\n// Run with command: php -S localhost:8000\n\n// *** Replace the constants below ***\n// Aggregator Info:\n$app_id = '';\n$app_secret = '';\n$aggregator_access_token = '';\n$aggregator_bm_id = 0;\n$bm_loc_id = 0;\n// Clients Info\n$page_id = 0;\n\ndefine('SDK_DIR', __DIR__); // Path to the SDK directory\n$loader = include SDK_DIR.'/vendor/autoload.php';\n// Configurations - End\nif (\n  is_null($aggregator_access_token) || is_null($app_id) || is_null($app_secret)\n) {\n  throw new Exception(\n    'You must set your access token, app id and app secret before executing'\n  );\n}\n\n// Initialize a new Session and instanciate an Api object\nApi::init($app_id, $app_secret, $aggregator_access_token);\n\n// The Api object is now available through singleton\n$api = Api::instance();\n$logger = new CurlLogger();\n$api->setLogger($logger);\n\nfunction getEdges($api, $params, $fields, $node_id, $edge) {\n  if ($fields) {\n    $fields = implode(',', $fields);\n    $params['fields'] = $fields;\n  }\n  $response =\n    $api->call('/'.$node_id.'/'.$edge, RequestInterface::METHOD_GET, $params);\n  return $response->getContent();\n}\n\nfunction postEdges($api, $params, $node_id, $edge) {\n  $response =\n    $api->call('/'.$node_id.'/'.$edge, RequestInterface::METHOD_POST, $params);\n  return $response->getContent();\n}\n\nfunction setAccessToken($access_token) {\n  global $app_secret, $app_id;\n  Api::init($app_id, $app_secret, $access_token);\n  $api = Api::instance();\n  $logger = new CurlLogger();\n  $api->setLogger($logger);\n  return $api;\n}\n\nfunction create_client_business($access_token) {\n  global\n    $app_id,\n    $app_secret,\n    $aggregator_bm_id,\n    $page_id,\n    $bm_loc_id,\n    $aggregator_access_token;\n\n  $api = setAccessToken($access_token);\n  $me = getEdges($api, array(), array(), 'me', '');\n  $app_scoped_user_id = $me['id'];\n\n  $api = setAccessToken($aggregator_access_token);\n  $child_business = (new Business($aggregator_bm_id))->getOwnedBusinesses(\n    array(),\n    array(\n      'client_user_id' => $app_scoped_user_id,\n    ),\n  );\n\n  if (!is_null($child_business) && !is_null($child_business[0])) {\n    $child_business_id = $child_business[0]->id;\n    // A partner can only create one child business manager on behalf\n    // of the user. Exit to avoid erroring.\n    $accounts =\n      (new Business($child_business_id))->getOwnedAdAccounts(array(), array());\n    $existing_account = '';\n    if (!is_null($accounts) && !is_null($accounts[0])) {\n      $existing_account = $accounts[0]->id;\n    }\n    return $child_business_id.','.$existing_account;\n  }\n\n  /**\n   * Step 1 Create the child BM under the Aggregator BM\n   */\n  $child_business = (new Business($aggregator_bm_id))->createOwnedBusiness(\n    array(),\n    array(\n      'id' => $aggregator_bm_id,\n      BusinessFields::NAME => 'Advertisers Name Child BM',\n      BusinessFields::VERTICAL => 'OTHER',\n      'shared_page_id' => $page_id,\n      'page_permitted_roles' => ['ADVERTISER'],\n      'timezone_id' => 1,\n    ),\n  );\n  $child_business_id = $child_business->id;\n\n  /**\n   * Step 2 Share credit line from Aggregator BM to client BM.\n   * This uses the Aggregators access token.\n   */\n  $api = setAccessToken($aggregator_access_token);\n  (new ExtendedCredit($bm_loc_id))->createOwningCreditAllocationConfig(\n    array(),\n    array(\n      'receiving_business_id' => $child_business_id,\n      'amount' => 10,\n    ),\n  );\n\n  /**\n   * Step 3 Create access token System user under child BM.\n   * This uses the Aggregators access token.\n   */\n  $api = setAccessToken($aggregator_access_token);\n  $child_business_token = (new Business($child_business_id))->createAccessToken(\n    array(),\n    array(\n      'id' => $child_business_id,\n      'app_id' => $app_id,\n      'scope' => 'manage_pages,ads_management,business_management',\n    ),\n  );\n  $child_bm_system_user_access_token = $child_business_token->access_token;\n\n  /**\n   * Step 4 Fetch funding source shared with BM\n   * This uses the Child BMs access token.\n   */\n  $api = setAccessToken($child_bm_system_user_access_token);\n  $params = array();\n  $fields = array();\n  $response =\n    getEdges($api, $params, $fields, $child_business_id, 'extendedcredits');\n  $child_bm_payment_method_id = $response['data'][0]['id'];\n\n  /**\n   * Step 5 Create Ad Account\n   * This uses the Child BMs access token. The Admin System user for their\n   * child BM is the owner of the Ad Account.\n   */\n  $api = setAccessToken($child_bm_system_user_access_token);\n  $account = (new Business($child_business_id))->createAdAccount(\n    array(),\n    array(\n      'name' => 'MyAdAccount',\n      'currency' => 'USD',\n      'timezone_id' => 1,\n      'end_advertiser' => $page_id,\n      'media_agency' => 'NONE',\n      'partner' => 'NONE',\n      'funding_id' => $child_bm_payment_method_id,\n    ),\n  );\n  $account_id = $account->id;\n\n  /**\n   * Step 6 Fetch the System user for the client business.\n   * This uses the Child BMs access token. This system user id is used in the api calls below.\n   */\n  $api = setAccessToken($child_bm_system_user_access_token);\n  $system_user_id =\n    (new Business($child_business_id))->getSystemUsers(array(), array())[0]->id;\n\n  /**\n   * Step 7 Add System user as Admin to Ad Account.\n   * This uses the Child BMs access token.\n   */\n  $api = setAccessToken($child_bm_system_user_access_token);\n  (new AdAccount($account_id))->createAssignedUser(\n    array(),\n    array(\n      'user' => $system_user_id,\n      'role' => 'ADMIN',\n      'business' => $child_business_id,\n    ),\n  );\n\n  return $child_business_id.','.$account_id;\n}\n\nfunction create_click_to_messenger_ad(\n  $account_id,\n  $bmid,\n  $ad_message,\n  $page_welcome_message,\n) {\n  global $aggregator_access_token, $app_id, $page_id;\n  $api = setAccessToken($aggregator_access_token);\n  $child_business_token = (new Business($bmid))->createAccessToken(\n    array(),\n    array(\n      'app_id' => $app_id,\n      'scope' => 'manage_pages,ads_management,business_management',\n    ),\n  );\n  $child_bm_system_user_access_token = $child_business_token->access_token;\n  $api = setAccessToken($child_bm_system_user_access_token);\n  $account = new AdAccount($account_id);\n  $campaign = $account->createCampaign(\n    array(),\n    array(\n      CampaignFields::NAME => 'First test Campaign',\n      CampaignFields::OBJECTIVE => 'MESSAGES',\n    ),\n  );\n\n  /**\n   * Step 2 Search Targeting\n   */\n  $targeting = new Targeting();\n  $targeting->setData(array(\n    TargetingFields::GEO_LOCATIONS => array(\n      'countries' => array('JP'),\n      'regions' => array(array('key' => '3886')),\n      'cities' => array(\n        array(\n          'key' => '2420605',\n          'radius' => 10,\n          'distance_unit' => 'mile',\n        ),\n      ),\n    ),\n  ));\n\n  /**\n   * Step 3 Create the AdSet\n   */\n  $start_time = (new \\DateTime(\"+1 week\"))->format(DateTime::ISO8601);\n  $end_time = (new \\DateTime(\"+2 week\"))->format(DateTime::ISO8601);\n  $fields = array();\n  $params = array(\n    AdSetFields::NAME => 'First Ad Set',\n    AdSetFields::OPTIMIZATION_GOAL => AdSetOptimizationGoalValues::REPLIES,\n    AdSetFields::BILLING_EVENT => AdSetBillingEventValues::IMPRESSIONS,\n    AdSetFields::BID_AMOUNT => 2,\n    AdSetFields::DAILY_BUDGET => 1000,\n    AdSetFields::CAMPAIGN_ID => $campaign->id,\n    AdSetFields::TARGETING => $targeting,\n    AdSetFields::START_TIME => $start_time,\n    AdSetFields::END_TIME => $end_time,\n  );\n  $ad_set = $account->createAdSet($fields, $params);\n  $ad_set_id = $ad_set->id;\n\n  /**\n   * Step 4 Create an AdImage\n   */\n\n  $image = new AdImage();\n  $image->setParentId($account->id);\n  $image->{AdImageFields::FILENAME} = SDK_DIR.'<YOUR-IMAGE-PATH>';\n\n  $image->create();\n  $image_hash = $image->hash;\n\n  /**\n   * Step 5 Create an AdCreative\n   */\n\n  $link_data = new AdCreativeLinkData();\n  $link_data->setData(array(\n    AdCreativeLinkDataFields::CALL_TO_ACTION => array(\n      'type' => AdCreativeCallToActionTypeValues::LEARN_MORE,\n      'value' => array(\n        AdCreativeLinkDataCallToActionValueFields::APP_DESTINATION =>\n          PageCallToActionWebDestinationTypeValues::MESSENGER,\n      ),\n    ),\n    AdCreativeLinkDataFields::LINK => '<YOUR-LINK>',\n    AdCreativeLinkDataFields::IMAGE_HASH => $image->hash,\n    AdCreativeLinkDataFields::MESSAGE => $ad_message,\n    AdCreativeLinkDataFields::PAGE_WELCOME_MESSAGE => $page_welcome_message,\n  ));\n\n  $object_story_spec = new AdCreativeObjectStorySpec();\n  $object_story_spec->setData(array(\n    AdCreativeObjectStorySpecFields::PAGE_ID => $page_id,\n    AdCreativeObjectStorySpecFields::LINK_DATA => $link_data,\n  ));\n\n  $creative = $account->createAdCreative(\n    array(),\n    array(\n      AdCreativeFields::NAME => 'Sample Creative',\n      AdCreativeFields::OBJECT_STORY_SPEC => $object_story_spec,\n    ),\n  );\n\n  $ad = $account->createAd(\n    array(),\n    array(\n      'status' => 'ACTIVE',\n      'adset_id' => $ad_set_id,\n      'name' => 'My Ad',\n      'creative' => array('creative_id' => $creative->id),\n    ),\n  );\n  $ad_id = $ad->id;\n  return 'Ad ID: '.$ad_id;\n}\n\n$possible_url = array(\"create_client_business\", \"create_click_to_messenger_ad\");\n\n$value = \"An error has occurred\";\n\nif (isset($_GET[\"action\"]) && in_array($_GET[\"action\"], $possible_url)) {\n  switch ($_GET[\"action\"]) {\n    case \"create_client_business\":\n      if (isset($_GET[\"access_token\"]))\n        $value = create_client_business($_GET[\"access_token\"]);\n      else\n        $value = \"Missing argument\";\n      break;\n    case \"create_click_to_messenger_ad\":\n      if (\n        isset($_GET[\"adaccount\"]) &&\n        isset($_GET[\"bmid\"]) &&\n        isset($_GET[\"ad_message\"]) &&\n        isset($_GET[\"page_welcome_message\"])\n      )\n        $value = create_click_to_messenger_ad(\n          $_GET[\"adaccount\"],\n          $_GET[\"bmid\"],\n          $_GET[\"ad_message\"],\n          $_GET[\"page_welcome_message\"],\n        );\n      else\n        $value = \"Missing argument\";\n      break;\n  }\n}\n\n//return JSON array\nexit(json_encode($value));\n?>\n", "num_lines": 404}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds;\n\nclass AnonymousSession implements SessionInterface {\n\n  /**\n   * @return array\n   */\n  public function getRequestParameters() {\n    return array();\n  }\n}\n", "num_lines": 36}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds;\n\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\nuse FacebookAds\\Logger\\LoggerInterface;\nuse FacebookAds\\Logger\\NullLogger;\nuse FacebookAds\\CrashReporter;\n\nclass Api {\n\n  /**\n   * @var string\n   */\n  const VERSION = ApiConfig::APIVersion;\n\n  /**\n   * @var Api\n   */\n  protected static $instance;\n\n  /**\n   * @var SessionInterface\n   */\n  private $session;\n\n  /**\n   * @var LoggerInterface\n   */\n  protected $logger;\n\n  /**\n   * @var Client\n   */\n  protected $httpClient;\n\n  /**\n   * @var string\n   */\n  protected $defaultGraphVersion;\n\n  /**\n   * @param Client $http_client\n   * @param SessionInterface $session A Facebook API session\n   */\n  public function __construct(\n    Client $http_client,\n    SessionInterface $session) {\n    $this->httpClient = $http_client;\n    $this->session = $session;\n  }\n\n  /**\n   * @param string $app_id\n   * @param string $app_secret\n   * @param string $access_token\n   * @return static\n   */\n  public static function init($app_id, $app_secret, $access_token, $log_crash=true) {\n    $session = new Session($app_id, $app_secret, $access_token);\n    $api = new static(new Client(), $session);\n    static::setInstance($api);\n    if ($log_crash) {\n      CrashReporter::enable();\n    }\n    return $api;\n  }\n\n  /**\n   * @return Api|null\n   */\n  public static function instance() {\n    return static::$instance;\n  }\n\n  /**\n   * @param Api $instance\n   */\n  public static function setInstance(Api $instance) {\n    static::$instance = $instance;\n  }\n\n  /**\n   * @param SessionInterface $session\n   * @return Api\n   */\n  public function getCopyWithSession(SessionInterface $session) {\n    $api = new self($this->getHttpClient(), $session);\n    $api->setDefaultGraphVersion($this->getDefaultGraphVersion());\n    $api->setLogger($this->getLogger());\n    return $api;\n  }\n\n  /**\n   * @param string $string\n   * @return string\n   */\n  public static function base64UrlEncode($string) {\n    $str = strtr(base64_encode($string), '+/', '-_');\n    $str = str_replace('=', '', $str);\n    return $str;\n  }\n\n  /**\n   * @param string $path\n   * @param string $method\n   * @param array $params\n   * @return RequestInterface\n   */\n  public function prepareRequest(\n    $path,\n    $method = RequestInterface::METHOD_GET,\n    array $params = array()) {\n\n    $request = $this->getHttpClient()->createRequest();\n    $request->setMethod($method);\n    $request->setGraphVersion($this->getDefaultGraphVersion());\n    $request->setPath($path);\n\n    if ($method === RequestInterface::METHOD_GET) {\n      $params_ref = $request->getQueryParams();\n    } else {\n      $params_ref = $request->getBodyParams();\n    }\n\n    if (!empty($params)) {\n      $params_ref->enhance($params);\n    }\n\n    $params_ref->enhance($this->getSession()->getRequestParameters());\n\n    return $request;\n  }\n\n  /**\n   * @param RequestInterface $request\n   * @return ResponseInterface\n   */\n  public function executeRequest(RequestInterface $request) {\n    $this->getLogger()->logRequest('debug', $request);\n    $response = $request->execute();\n    $this->getLogger()->logResponse('debug', $response);\n\n    return $response;\n  }\n\n  /**\n   * @return string\n   */\n  public function getDefaultGraphVersion() {\n    if ($this->defaultGraphVersion === null) {\n      $match = array();\n      if (preg_match(\"/^\\d+\\.\\d+/\", static::VERSION, $match)) {\n        $this->defaultGraphVersion = $match[0];\n      }\n    }\n\n    return $this->defaultGraphVersion;\n  }\n\n  /**\n   * @param string $version\n   */\n  public function setDefaultGraphVersion($version) {\n    $this->defaultGraphVersion = $version;\n  }\n\n  /**\n   * Make graph api calls\n   *\n   * @param string $path Ads API endpoint\n   * @param string $method Ads API request type\n   * @param array $params Assoc of request parameters\n   * @return ResponseInterface Graph API responses\n   */\n  public function call(\n    $path,\n    $method = RequestInterface::METHOD_GET,\n    array $params = array(),\n    array $file_params = array()) {\n\n    $request = $this->prepareRequest($path, $method, $params);\n\n    if (!empty($file_params)) {\n      foreach($file_params as $key => $value) {\n        $request->getFileParams()->offsetSet($key, $value);\n      }\n    }\n\n    return $this->executeRequest($request);\n  }\n\n  /**\n   * @return SessionInterface\n   */\n  public function getSession() {\n    return $this->session;\n  }\n\n  /**\n   * @param LoggerInterface $logger\n   */\n  public function setLogger(LoggerInterface $logger) {\n    $this->logger = $logger;\n  }\n\n  /**\n   * @return LoggerInterface\n   */\n  public function getLogger() {\n    if ($this->logger === null) {\n      $this->logger = new NullLogger();\n    }\n    return $this->logger;\n  }\n\n  /**\n   * @return Client\n   */\n  public function getHttpClient() {\n    return $this->httpClient;\n  }\n}\n", "num_lines": 248}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds;\n\nuse FacebookAds\\Cursor;\nuse FacebookAds\\AbstractObject;\n\nclass ApiRequest {\n  protected $api;\n  protected $id;\n  protected $method;\n  protected $endpoint;\n  protected $return_prototype;\n  protected $accepted_fields;\n  protected $param_checker;\n  protected $api_type;\n  protected $use_graph_video_endpoint;\n  private $fields;\n  private $params;\n  private $file_params;\n  private $allow_file_upload;\n  private $file_counter;\n\n  public function __construct(\n    Api $api,\n    $id,\n    $method,\n    $endpoint,\n    $return_prototype = null,\n    $api_type = null,\n    $accepted_fields = array(),\n    TypeChecker $param_checker = null,\n    $allow_file_upload = false,\n    $use_graph_video_endpoint = false) {\n    $this->fields = [];\n    $this->params = [];\n    $this->file_params = [];\n    $this->file_counter = 0;\n    $this->api = $api;\n    $this->id = $id;\n    $this->method = $method;\n    $this->endpoint = $endpoint;\n    $this->return_prototype = $return_prototype;\n    $this->api_type = $api_type;\n    $this->accepted_fields = $accepted_fields;\n    $this->param_checker = $param_checker;\n    $this->allow_file_upload = $allow_file_upload;\n    $this->use_graph_video_endpoint = $use_graph_video_endpoint;\n  }\n\n  public function addParam($param, $value) {\n    $extracted_value = $this->extractValue($value);\n    if (!ApiConfig::TYPE_CHECKER_STRICT_MODE\n      || !$this->param_checker->isValidParam($param)\n    ) {\n      if ($this->param_checker->isFileParam($param)) {\n          $this->file_params[$param] = $extracted_value;\n      } else {\n        $this->params[$param] = $extracted_value;\n      }\n    } else {\n      if ($this->param_checker->isValidParamPair($param, $value)) {\n        if ($this->param_checker->isFileParam($param)) {\n          $this->file_params[$param] = $extracted_value;\n        } else {\n          $this->params[$param] = $extracted_value;\n        }\n      } elseif ($this->param_checker->isPrimitiveType($param)) {\n        $param_type = $this->param_checker->getType($param);\n        $this->params[$param] = $this->param_checker->convertStringToPrimType(\n          $param_type, $value);\n      } else {\n        throw new \\LogicException('The value for '.$param.' is not compatible');\n      }\n    }\n    return $this;\n  }\n\n  public function addParams($params) {\n    foreach ($params as $key => $value) {\n      $this->addParam($key, $value);\n    }\n    return $this;\n  }\n\n  public function removeParam($param) {\n    if (array_key_exists($param, $this->params)) {\n      unset($this->params[$param]);\n    } elseif (array_key_exists($param, $this->params)) {\n      unset($this->file_params[$param]);\n    }\n    return $this;\n  }\n\n  public function clearParams() {\n    $this->params = [];\n    $this->file_params = [];\n    return $this;\n  }\n\n  public function getParams() {\n    $all_params = array_merge($this->params, $this->file_params);\n    return $all_params;\n  }\n\n  public function addField($field) {\n    if (ApiConfig::TYPE_CHECKER_STRICT_MODE\n      && !in_array($field, $this->accepted_fields)\n    ) {\n      throw new \\LogicException('Field '.$field.' is not supported');\n    }\n    if (!(in_array($field, $this->fields))) {\n      $this->fields[] = $field;\n    }\n    return $this;\n  }\n\n  public function addFields($fields) {\n    foreach ($fields as $field) {\n      $this->addField($field);\n    }\n    return $this;\n  }\n\n  public function removeField($field) {\n    if (in_array($field, $this->fields)) {\n      $index_to_remove = array_search($field, $this->fields);\n      unset($this->fields[$index_to_remove]);\n    }\n    return $this;\n  }\n\n  public function clearFields() {\n    $this->fields = [];\n    return $this;\n  }\n\n  public function getFields() {\n    return $this->fields;\n  }\n\n  public function addFile($filename) {\n    if (ApiConfig::TYPE_CHECKER_STRICT_MODE && !$this->allow_file_upload) {\n      throw new \\LogicException(\"This api cannot upload files\");\n    }\n    $file_key = 'source'.$this->file_counter;\n    if (file_exists($filename)) {\n      $this->file_params[$file_key] = $filename;\n      $this->file_counter++;\n    }\n    return $this;\n  }\n\n  /**\n   * Execute the request\n   */\n  public function execute() {\n    $url_path = '/'.$this->id.$this->endpoint;\n    $updated_params = $this->params;\n    if (!empty($this->fields)) {\n      $fields = implode(',', $this->fields);\n      $updated_params['fields'] = $fields;\n    }\n    $response = $this->api->call(\n      $url_path, $this->method, $updated_params, $this->file_params);\n    if ($this->api_type === \"EDGE\" && $this->method === \"GET\") {\n      return new Cursor($response, $this->return_prototype, $this->api);\n    } else if ($this->method === \"DELETE\") {\n      return $response;\n    } else {\n      return $this->createObject($response->getContent());\n    }\n  }\n\n  protected function extractValue($value) {\n    if ($this->param_checker->isAbstractObject($value)) {\n      return $value->exportAllData();\n    } else if (is_array($value)) {\n      $extracted_value = [];\n      foreach ($value as $key => $sub_value) {\n        $extracted_value[$key] = $this->extractValue($sub_value);\n      }\n      return $extracted_value;\n    } else {\n      return $value;\n    }\n  }\n\n  protected function createObject(array $object_data) {\n    $object = clone $this->return_prototype;\n    $object->setDataWithoutValidation($object_data);\n    if ($object instanceof AbstractCrudObject) {\n      $object->setApi($this->api);\n    }\n    return $object;\n  }\n}\n", "num_lines": 220}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds;\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Exception\\Exception;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\Exception\\RequestException;\n\n/**\n * Class CrashReasons\n * @package FacebookAds\n */\nclass CrashReasons {\n    const SDK = 'SDK';\n    const API = 'API';\n}\n\n/**\n * Class CrashReporter\n * @package FacebookAds\n */\nclass CrashReporter {\n    const E_FATAL =\n      E_ERROR |\n      E_USER_ERROR |\n      E_PARSE |\n      E_CORE_ERROR |\n      E_COMPILE_ERROR |\n      E_RECOVERABLE_ERROR;\n\n    /**\n     * @var CrashReporter\n     */\n    private static $instance;\n\n    /**\n     * @var resource\n     */\n    private static $handle;\n\n    /**\n     * @var int\n     */\n    private $app_id;\n\n    /**\n     * CrashReporter constructor.\n     * @param int $app_id\n     * @return void\n     */\n    private function __construct(\n      $app_id\n    ) {\n        $this->app_id = $app_id;\n    }\n\n    /**\n     * @return void\n     */\n    public static function enable() {\n        if (!static::$handle) {\n          static::$handle = fopen('php://stdout', 'w');\n        }\n        if (!static::$instance) {\n            $api = Api::instance();\n            if ($api == null) {\n              self::log('Could not initialize API' . PHP_EOL);\n            }\n            static::$instance = new static($api->getSession()->getAppId());\n            static::$instance->registerExceptionHandler();\n            self::log('Enabled' . PHP_EOL);\n        }\n    }\n\n    /**\n     * @return void\n     */\n    public static function disable() {\n        if (static::$instance) {\n            static::$instance = null;\n            restore_exception_handler();\n            restore_error_handler();\n            self::log('Disabled');\n        }\n    }\n\n    /**\n     * @param $handle\n     */\n    public static function setLogger($handle) {\n        if(is_resource($handle)) {\n          static::$handle  = $handle;\n        }\n    }\n\n    /**\n     * @return void\n     */\n    private function registerExceptionHandler() {\n        $lastHandler = set_exception_handler(\n            function (\\Throwable $e) use (&$lastHandler) {\n                self::log('Exception detected!');\n                $params = $this->buildParamsFromException($e);\n                if ($params != null) {\n                    $this->sendReport(array(\n                        'bizsdk_crash_report' => $params\n                    ));\n                }\n                // restore the previous exception\n                if (is_callable($lastHandler)) {\n                    return call_user_func_array($lastHandler, [$e]);\n                } else {\n                    throw $e;\n                }\n            }\n        );\n\n        $lastError = set_error_handler(\n            function ($errno, $errstr, $errfile, $errline) use (&$lastError) {\n                if (($errno & self::E_FATAL) && strpos($errfile, 'FacebookAds') != false) {\n                    self::log('Error detected!');\n                    $e = new \\ErrorException($errstr, 0, $errno, $errfile, $errline);\n                    $params = $this->buildParamsFromException($e);\n                    if ($params != null) {\n                        $this->sendReport(array(\n                            'bizsdk_crash_report' => $params\n                        ));\n                    }\n                }\n                if (is_callable($lastError)) {\n                    return call_user_func_array($lastError, [$errno, $errstr, $errfile, $errline]);\n                } else {\n                    // fall through to the standard PHP error handler\n                    return false;\n                }\n            }\n        );\n    }\n\n    /**\n     * @param \\Throwable $e\n     * @return array|null\n     */\n    private function buildParamsFromException(\\Throwable $e) {\n        if (!($e instanceof Exception || $e instanceof \\ErrorException)) {\n            return NULL;\n        }\n        $reason = CrashReasons::SDK;\n        if ($e instanceof RequestException) {\n            $reason = CrashReasons::API;\n        }\n        $reason .= ' : ' . $e->getMessage();\n        $callstack = explode(PHP_EOL, $e->getTraceAsString());\n        return array(\n            'reason' => $reason,\n            'callstack' => $callstack,\n            'platform' => phpversion()\n        );\n    }\n\n    /**\n     * @param $params\n     */\n    private function sendReport($params) {\n        try {\n            $session = new AnonymousSession();\n            $api = new Api(Api::instance()->getHttpClient(), $session);\n            $request = $api->prepareRequest(\n                '/' . $this->app_id . '/instruments',\n                RequestInterface::METHOD_POST,\n                $params\n            );\n\n            $response = $api->executeRequest($request);\n            $data = $response->getContent();\n            if ($data && $data['success']) {\n                self::log('Successfully sent report' . PHP_EOL);\n            } else {\n                self::log('Failed to send report' . PHP_EOL);\n            }\n        } catch (\\Exception $e) {\n            self::log('Exception on sending report' . PHP_EOL);\n        }\n    }\n\n    /**\n     * @param $message\n     */\n    private static function log($message) {\n      $content = sprintf(\"%s : %s%s\",static::class, $message, PHP_EOL);\n      fwrite(static::$handle, $content);\n    }\n}\n", "num_lines": 217}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds;\n\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\nuse FacebookAds\\Http\\Util;\nuse FacebookAds\\Object\\AbstractObject;\n\nclass Cursor implements \\Iterator, \\Countable, \\ArrayAccess {\n  /**\n   * @var ResponseInterface\n   */\n  protected $response;\n\n  /**\n   * @var Api\n   */\n  protected $api;\n\n  /**\n   * @var AbstractObject[]\n   */\n  protected $objects = array();\n\n  /**\n   * @var int|null\n   */\n  protected $indexLeft;\n\n  /**\n   * @var int|null\n   */\n  protected $indexRight;\n\n  /**\n   * @var int|null\n   */\n  protected $position;\n\n  /**\n   * @var AbstractObject\n   */\n  protected $objectPrototype;\n\n  /**\n   * @var bool\n   */\n  protected static $defaultUseImplicitFetch = false;\n\n  /**\n   * @var bool\n   */\n  protected $useImplicitFetch;\n\n  public function __construct(\n    ResponseInterface $response,\n    AbstractObject $object_prototype,\n    Api $api = null) {\n    $this->response = $response;\n    $this->objectPrototype = $object_prototype;\n    $this->api = $api !== null ? $api : Api::instance();\n    $this->appendResponse($response);\n  }\n\n  /**\n   * @param array $object_data\n   * @return AbstractObject\n   */\n  protected function createObject(array $object_data) {\n    $object = clone $this->objectPrototype;\n    $object->setDataWithoutValidation($object_data);\n    if ($object instanceof AbstractCrudObject) {\n      $object->setApi($this->api);\n    }\n    return $object;\n  }\n\n  /**\n   * @param ResponseInterface $response\n   * @return array\n   * @throws \\InvalidArgumentException\n   */\n  protected function assureResponseData(ResponseInterface $response) {\n    $content = $response->getContent();\n\n    // First, check if the content contains data\n    if (isset($content['data']) && is_array($content['data'])) {\n      $data = $content['data'];\n\n      // If data is an object wrap the object into an array\n      if ($this->isJsonObject($data)) {\n        $data = array($data);\n      }\n      return $data;\n    }\n\n    // Second, check if the content contains special entries\n    if (isset($content['targetingsentencelines'])) {\n      return $content['targetingsentencelines'];\n    }\n    if (isset($content['adaccounts'])) {\n      return $content['adaccounts'];\n    }\n    if (isset($content['users'])) {\n      return $content['users'];\n    }\n\n    // Third, check if the content is an array of objects indexed by id\n    $is_id_indexed_array = true;\n    $objects = array();\n    if (is_array($content) && count($content) >= 1) {\n      foreach ($content as $key => $value) {\n        if ($key === '__fb_trace_id__') {\n          continue;\n        }\n\n        if ($value !== null &&\n            $this->isJsonObject($value) &&\n            isset($value['id']) &&\n            $value['id'] !== null &&\n            $value['id'] === $key) {\n          $objects[] = $value;\n        } else {\n          $is_id_indexed_array = false;\n          break;\n        }\n      }\n    } else {\n      $is_id_indexed_array = false;\n    }\n    if ($is_id_indexed_array) {\n      return $objects;\n    }\n\n    throw new \\InvalidArgumentException(\"Malformed response data\");\n  }\n\n  private function isJsonObject($object) {\n    if (!is_array($object)) {\n      return false;\n    }\n\n    // Consider an empty array as not object\n    if (empty($object)) {\n      return false;\n    }\n\n    // A json object is represented by a map instead of a pure list\n    return array_keys($object) !== range(0, count($object) - 1);\n  }\n\n  /**\n   * @param ResponseInterface $response\n   */\n  protected function prependResponse(ResponseInterface $response) {\n    $this->response = $response;\n    $data = $this->assureResponseData($response);\n    if (empty($data)) {\n      return;\n    }\n\n    $left_index = $this->indexLeft;\n    $count = count($data);\n    $position = $count - 1;\n    for ($i = $left_index - 1; $i >= $left_index - $count; $i--) {\n      $this->objects[$i] = $this->createObject($data[$position--]);\n      --$this->indexLeft;\n    }\n  }\n\n  /**\n   * @param ResponseInterface $response\n   */\n  protected function appendResponse(ResponseInterface $response) {\n    $this->response = $response;\n    $data = $this->assureResponseData($response);\n    if (empty($data)) {\n      return;\n    }\n\n    if ($this->indexRight === null) {\n      $this->indexLeft = 0;\n      $this->indexRight = -1;\n      $this->position = 0;\n    }\n\n    $this->indexRight += count($data);\n\n    foreach ($data as $object_data) {\n      $this->objects[] = $this->createObject($object_data);\n    }\n  }\n\n  /**\n   * @return bool\n   */\n  public static function getDefaultUseImplicitFetch() {\n    return static::$defaultUseImplicitFetch;\n  }\n\n  /**\n   * @param bool $use_implicit_fetch\n   */\n  public static function setDefaultUseImplicitFetch($use_implicit_fetch) {\n    static::$defaultUseImplicitFetch = $use_implicit_fetch;\n  }\n\n  /**\n   * @return bool\n   */\n  public function getUseImplicitFetch() {\n    return $this->useImplicitFetch !== null\n      ? $this->useImplicitFetch\n      : static::$defaultUseImplicitFetch;\n  }\n\n  /**\n   * @param bool $use_implicit_fetch\n   */\n  public function setUseImplicitFetch($use_implicit_fetch) {\n    $this->useImplicitFetch = $use_implicit_fetch;\n  }\n\n  /**\n   * @return string|null\n   */\n  public function getBefore() {\n    $content = $this->getLastResponse()->getContent();\n    return isset($content['paging']['cursors']['before'])\n      ? $content['paging']['cursors']['before']\n      : null;\n  }\n\n  /**\n   * @return string|null\n   */\n  public function getAfter() {\n    $content = $this->getLastResponse()->getContent();\n    return isset($content['paging']['cursors']['after'])\n      ? $content['paging']['cursors']['after']\n      : null;\n  }\n\n  /**\n   * @return RequestInterface\n   */\n  protected function createUndirectionalizedRequest() {\n    $request = $this->getLastResponse()->getRequest()->createClone();\n    $params = $request->getQueryParams();\n    if (isset($params['before'])) {\n      unset($params['before']);\n    }\n    if (isset($params['after'])) {\n      unset($params['after']);\n    }\n\n    return $request;\n  }\n\n  /**\n   * @return string|null\n   */\n  public function getPrevious() {\n    $content = $this->getLastResponse()->getContent();\n    if (isset($content['paging']['previous'])) {\n      return $content['paging']['previous'];\n    }\n\n    $before = $this->getBefore();\n    if ($before !== null) {\n      $request = $this->createUndirectionalizedRequest();\n      $request->getQueryParams()->offsetSet('before', $before);\n      return $request->getUrl();\n    }\n\n    return null;\n  }\n\n  /**\n   * @return string|null\n   */\n  public function getNext() {\n    $content = $this->getLastResponse()->getContent();\n    if (isset($content['paging']['next'])) {\n      return $content['paging']['next'];\n    }\n\n    $after = $this->getAfter();\n    if ($after !== null) {\n      $request = $this->createUndirectionalizedRequest();\n      $request->getQueryParams()->offsetSet('after', $after);\n      return $request->getUrl();\n    }\n\n    return null;\n  }\n\n  /**\n   * @param string $url\n   * @return RequestInterface\n   */\n  protected function createRequestFromUrl($url) {\n    $components = parse_url($url);\n    $request = $this->getLastResponse()->getRequest()->createClone();\n    $request->setDomain($components['host']);\n    $query = isset($components['query'])\n      ? Util::parseUrlQuery($components['query'])\n      : array();\n    $request->getQueryParams()->enhance($query);\n\n    return $request;\n  }\n\n  /**\n   * @return RequestInterface|null\n   */\n  public function createBeforeRequest() {\n    $url = $this->getPrevious();\n    return $url !== null ? $this->createRequestFromUrl($url) : null;\n  }\n\n  /**\n   * @return RequestInterface|null\n   */\n  public function createAfterRequest() {\n    $url = $this->getNext();\n    return $url !== null ? $this->createRequestFromUrl($url) : null;\n  }\n\n  public function fetchBefore() {\n    $request = $this->createBeforeRequest();\n    if (!$request) {\n      return;\n    }\n\n    $this->prependResponse($request->execute());\n  }\n\n  public function fetchAfter() {\n    $request = $this->createAfterRequest();\n    if (!$request) {\n      return;\n    }\n\n    $this->appendResponse($request->execute());\n  }\n\n  /**\n   * @deprecated Use getArrayCopy()\n   * @return AbstractObject[]\n   */\n  public function getObjects() {\n    return $this->objects;\n  }\n\n  /**\n   * @param bool $ksort\n   * @return AbstractObject[]\n   */\n  public function getArrayCopy($ksort = false) {\n    if ($ksort) {\n      // Sort the main array to improve best case performance in future\n      // invocations\n      ksort($this->objects);\n    }\n\n    return $this->objects;\n  }\n\n  /**\n   * @deprecated Use getLastResponse()\n   * @return ResponseInterface\n   */\n  public function getResponse() {\n    return $this->response;\n  }\n\n  /**\n   * @return ResponseInterface\n   */\n  public function getLastResponse() {\n    return $this->response;\n  }\n\n  /**\n   * @return int\n   */\n  public function getIndexLeft() {\n    return $this->indexLeft;\n  }\n\n  /**\n   * @return int\n   */\n  public function getIndexRight() {\n    return $this->indexRight;\n  }\n\n  public function rewind() : void {\n    $this->position = $this->indexLeft;\n  }\n\n  public function end() {\n    $this->position = $this->indexRight;\n  }\n\n  /**\n   * @param int $position\n   */\n  public function seekTo($position) {\n    $position = array_key_exists($position, $this->objects) ? $position : null;\n    $this->position = $position;\n  }\n\n  public function current() : AbstractObject|bool {\n    return isset($this->objects[$this->position])\n      ? $this->objects[$this->position]\n      : false;\n  }\n\n  public function key() : ?int {\n    return $this->position;\n  }\n\n  public function prev() {\n    if ($this->position == $this->getIndexLeft()) {\n      if ($this->getUseImplicitFetch()) {\n        $this->fetchBefore();\n        if ($this->position == $this->getIndexLeft()) {\n          $this->position = null;\n        } else {\n          --$this->position;\n        }\n      } else {\n        $this->position = null;\n      }\n    } else {\n      --$this->position;\n    }\n  }\n\n  public function next() : void {\n    if ($this->position == $this->getIndexRight()) {\n      if ($this->getUseImplicitFetch()) {\n        $this->fetchAfter();\n        if ($this->position == $this->getIndexRight()) {\n          $this->position = null;\n        } else {\n          ++$this->position;\n        }\n      } else {\n        $this->position = null;\n      }\n    } else {\n      ++$this->position;\n    }\n  }\n\n  public function valid() : bool {\n    return isset($this->objects[$this->position]);\n  }\n\n  public function count() : int {\n    return count($this->objects);\n  }\n\n  /**\n   * @param mixed $offset\n   * @param mixed $value\n   */\n  public function offsetSet($offset, $value) : void {\n    if ($offset === null) {\n      $this->objects[] = $value;\n    } else {\n      $this->objects[$offset] = $value;\n    }\n  }\n\n  /**\n   * @param mixed $offset\n   * @return bool\n   */\n  public function offsetExists($offset) : bool {\n    return isset($this->objects[$offset]);\n  }\n\n  /**\n   * @param mixed $offset\n   */\n  public function offsetUnset($offset) : void {\n    unset($this->objects[$offset]);\n  }\n\n  /**\n   * @param mixed $offset\n   * @return mixed\n   */\n  public function offsetGet($offset) : mixed {\n    return isset($this->objects[$offset]) ? $this->objects[$offset] : null;\n  }\n}\n", "num_lines": 525}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds;\n\nclass Session implements SessionInterface {\n\n  /**\n   * @var string\n   */\n  protected $appId;\n\n  /**\n   * @var string\n   */\n  protected $appSecret;\n\n  /**\n   * @var string\n   */\n  protected $accessToken;\n\n  /**\n   * @var string\n   */\n  protected $appSecretProof;\n\n  /**\n   * @param string $app_id\n   * @param string $app_secret\n   * @param string $access_token\n   */\n  public function __construct($app_id, $app_secret, $access_token) {\n    $this->appId = $app_id;\n    $this->appSecret = $app_secret;\n    $this->accessToken = $access_token;\n  }\n\n  /**\n   * @return string\n   */\n  public function getAppId() {\n    return $this->appId;\n  }\n\n  /**\n   * @return string\n   */\n  public function getAppSecret() {\n    return $this->appSecret;\n  }\n\n  /**\n   * @return string\n   */\n  public function getAccessToken() {\n    return $this->accessToken;\n  }\n\n  /**\n   * @return string\n   */\n  public function getAppSecretProof() {\n    if ($this->getAppSecret() === null) {\n      return null;\n    }\n    if ($this->appSecretProof === null) {\n      $this->appSecretProof\n        = hash_hmac('sha256', $this->getAccessToken(), $this->getAppSecret());\n    }\n    return $this->appSecretProof;\n  }\n\n  /**\n   * @return array\n   */\n  public function getRequestParameters() {\n    if ($this->getAppSecretProof() !== null) {\n      return array(\n        'access_token' => $this->getAccessToken(),\n        'appsecret_proof' => $this->getAppSecretProof(),\n      );\n    } else {\n      return array(\n        'access_token' => $this->getAccessToken(),\n      );\n    }\n  }\n}\n", "num_lines": 111}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds;\n\ninterface SessionInterface {\n\n  /**\n   * @return array\n   */\n  public function getRequestParameters();\n}\n", "num_lines": 34}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds;\n\nclass TypeChecker {\n\n  const ABSTRACT_OBJECT_PREFIX = \"FacebookAds\\\\Object\\\\\";\n  private $type_data;\n  private $enum_data;\n  private $primitive_types = [\"unsigned int\", \"int\", \"bool\", \"string\",\n    \"Object\", \"datetime\", \"float\"];\n\n  public function __construct($type_check_info, $type_check_enum) {\n    $this->type_data = $type_check_info;\n    $this->enum_data = $type_check_enum;\n  }\n\n  public function isPrimitiveType($param) {\n    return (in_array($param, $this->primitive_types) ||\n      array_key_exists($param, $this->enum_data));\n  }\n\n  public function convertStringToPrimType($primitive_type, $value) {\n    if (array_key_exists($primitive_type, $this->enum_data)) {\n      return $value;\n    } elseif (in_array($primitive_type, array(\"unsigned int\", \"int\"))) {\n      return intval($value);\n    } elseif ($primitive_type === \"bool\") {\n      return boolval($value);\n    } elseif ($primitive_type === \"float\") {\n      return floatval($value);\n    } elseif ($primitive_type === \"datetime\") {\n      return $value;\n    } elseif ($primitive_type === \"string\") {\n      return $value;\n    } elseif ($primitive_type === \"Object\") {\n      return $value;\n    } else {\n      if (ApiConfig::TYPE_CHECKER_STRICT_MODE) {\n        throw new \\Exception(\"Not a primitive type\");\n      } else {\n        return $value;\n      }\n    }\n  }\n\n  public function getType($param) {\n    if (array_key_exists($param, $this->type_data)) {\n      return $this->type_data[$param];\n    } else {\n      return null;\n    }\n  }\n\n  public function isValidParam($param) {\n    return array_key_exists($param, $this->type_data);\n  }\n\n  public function isValidParamPair($param, $value) {\n    if ($this->isValidParam($param)) {\n      $type = $this->type_data[$param];\n      return $this->checkType($type, $value);\n    }\n    return false;\n  }\n\n  public function checkType($type, $value, $allow_array_for_obj = true) {\n    if ($value === null || $type === null || $type === \"Object\") {\n      return true;\n    } else if (array_key_exists($type, $this->enum_data)) {\n      return in_array($value, $this->enum_data[$type]);\n    } else if ($type === \"file\") {\n      return file_exists($value);\n    } else if ($type === \"list\" || $type === \"map\") {\n      return is_array($value);\n    } else if ($type === \"bool\") {\n      return is_bool($value);\n    } else if ($type === \"int\" || $type === \"unsigned int\" || $type === \"float\") {\n      return is_numeric($value);\n    } else if ($type === \"string\" || $type === \"datetime\") {\n      return is_string($value) || is_numeric($value) || is_bool($value);\n    } else if ($this->isTypeCollection($type, \"list\")) {\n      $sub_types = $this->getTypeFromCollection($type, \"list\");\n      $sub_type = $sub_types[0];\n      if (is_array($value)) {\n        if (empty($value)) {\n          return true;\n        }\n        $all_object_same_type = true;\n        foreach ($value as $key => $sub_value) {\n          $all_object_same_type = ($all_object_same_type &&\n            $this->checkType($sub_type, $sub_value));\n        }\n        return $all_object_same_type;\n      } else {\n        return $this->checkType($sub_type, $value);\n      }\n    } else if ($this->isTypeCollection($type, \"map\")) {\n      if (is_array($value)) {\n        $sub_types = $this->getTypeFromCollection($type, \"map\");\n        if (count($sub_types) === 1) {\n          $sub_key_type = 'string';\n          $sub_value_type = $sub_types[0];\n        } else {\n          $sub_key_type = $sub_types[0];\n          $sub_value_type = $sub_types[1];\n        }\n        $all_object_same_type = true;\n        foreach ($value as $key => $sub_value) {\n          $all_object_same_type = ($all_object_same_type &&\n            $this->checkType($sub_key_type, $key) &&\n            $this->checkType($sub_value_type, $sub_value));\n        }\n        return $all_object_same_type;\n      }\n    } else {\n      // the type is an object\n      if ($allow_array_for_obj && is_array($value)) {\n        return true;\n      }\n      if (!$this->startsWith($type, self::ABSTRACT_OBJECT_PREFIX)) {\n        $type = self::ABSTRACT_OBJECT_PREFIX.$type;\n      }\n      return is_a($value, $type);\n    }\n    return false;\n  }\n\n  public function isAbstractObject($value) {\n    if (is_object($value)) {\n      $cls_name = get_class($value);\n      return $this->startsWith($cls_name, self::ABSTRACT_OBJECT_PREFIX);\n    }\n    return false;\n  }\n\n  private function startsWith($string, $prefix) {\n    return $prefix === \"\" ||\n      strrpos($string, $prefix, -strlen($string)) !== false;\n  }\n\n  public function isListParam($param) {\n    if ($this->isValidParam($param)) {\n      return $this->isTypeCollection($this->type_data[$param], \"list\");\n    }\n    return false;\n  }\n\n  public function isMapParam($param) {\n    if ($this->isValidParam($param)) {\n      return $this->isTypeCollection($this->type_data[$param], \"map\");\n    }\n    return false;\n  }\n\n  public function isFileParam($param) {\n    if ($this->isValidParam($param)) {\n      return ($this->type_data[$param] === \"file\");\n    }\n    return false;\n  }\n\n  public function isTypeCollection($type, $collection) {\n    $len_of_collection = strlen($collection);\n    $typeCollection = substr($type, 0, $len_of_collection);\n    return ($collection === $typeCollection);\n  }\n\n  public function getTypeFromCollection($type, $collection) {\n    return explode(\",\", trim(substr($type, strlen($collection)), \"<>\"));\n  }\n}\n", "num_lines": 195}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Enum;\n\nabstract class AbstractEnum implements EnumInstanceInterface {\n\n  /**\n   * @var array|null\n   */\n  protected $map = null;\n\n  /**\n   * @var array|null\n   */\n  protected $names = null;\n\n  /**\n   * @var array|null\n   */\n  protected $values = null;\n\n  /**\n   * @var array|null\n   */\n  protected $valuesMap = null;\n\n  /**\n   * @var AbstractEnum[]\n   */\n  protected static $instances = array();\n\n  /**\n   * @return string\n   */\n  static function className() {\n    return get_called_class();\n  }\n\n  /**\n   * @return AbstractEnum\n   */\n  public static function getInstance() {\n    $fqn = get_called_class();\n    if (!array_key_exists($fqn, static::$instances)) {\n      static::$instances[$fqn] = new static();\n    }\n\n    return static::$instances[$fqn];\n  }\n\n  /**\n   * @return array\n   */\n  public function getArrayCopy() {\n    if ($this->map === null) {\n      $this->map = (new \\ReflectionClass(get_called_class()))\n        ->getConstants();\n    }\n\n    return $this->map;\n  }\n\n  /**\n   * @return array\n   */\n  public function getNames() {\n    if ($this->names === null) {\n      $this->names = array_keys($this->getArrayCopy());\n    }\n\n    return $this->names;\n  }\n\n  /**\n   * @return array\n   */\n  public function getValues() {\n    if ($this->values === null) {\n      $this->values = array_values($this->getArrayCopy());\n    }\n\n    return $this->values;\n  }\n\n  /**\n   * @return array\n   */\n  public function getValuesMap() {\n    if ($this->valuesMap === null) {\n      $this->valuesMap = array_fill_keys($this->getValues(), null);\n    }\n\n    return $this->valuesMap;\n  }\n\n  /**\n   * @param string|int|float $name\n   * @return mixed\n   */\n  public function getValueForName($name) {\n    $copy = $this->getArrayCopy();\n    return array_key_exists($name, $copy)\n      ? $copy[$name]\n      : null;\n  }\n\n  /**\n   * @param string|int|float $name\n   * @return mixed\n   * @throws \\InvalidArgumentException\n   */\n  public function assureValueForName($name) {\n    $value = $this->getValueForName($name);\n    if ($value === null) {\n      throw new \\InvalidArgumentException(\n        'Unknown name \"'.$name.'\" in '.static::className());\n    }\n\n    return $value;\n  }\n\n  /**\n   * @param string|int|float $name\n   * @return bool\n   */\n  public function isValid($name) {\n    return array_key_exists($name, $this->getArrayCopy());\n  }\n\n  /**\n   * @param string|int|float $name\n   * @throws \\InvalidArgumentException\n   */\n  public function assureIsValid($name) {\n    if (!array_key_exists($name, $this->getArrayCopy())) {\n      throw new \\InvalidArgumentException(\n        'Unknown name \"'.$name.'\" in '.static::className());\n    }\n  }\n\n  /**\n   * @param string|int|float $value\n   * @return bool\n   */\n  public function isValidValue($value) {\n    return array_key_exists($value, $this->getValuesMap());\n  }\n\n  /**\n   * @param mixed $value\n   * @throws \\InvalidArgumentException\n   */\n  public function assureIsValidValue($value) {\n    if (!$this->isValidValue($value)) {\n      throw new \\InvalidArgumentException(\n        '\"'.$value.'\", not a valid value in '.static::className());\n    }\n  }\n}\n", "num_lines": 182}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Enum;\n\nclass EmptyEnum extends AbstractEnum {\n\n  /**\n   * @return array\n   */\n  public function getArrayCopy() {\n    return array();\n  }\n\n  /**\n   * @return array\n   */\n  public function getNames() {\n    return array();\n  }\n\n  /**\n   * @return array\n   */\n  public function getValues() {\n    return array();\n  }\n\n  /**\n   * @return array\n   */\n  public function getValuesMap() {\n    return array();\n  }\n}\n", "num_lines": 57}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Enum;\n\ninterface EnumInstanceInterface {\n\n  /**\n   * @return EnumInstanceInterface\n   */\n  public static function getInstance();\n\n  /**\n   * @return array\n   */\n  public function getArrayCopy();\n\n  /**\n   * @return array\n   */\n  public function getNames();\n\n  /**\n   * @return array\n   */\n  public function getValues();\n\n  /**\n   * @return array\n   */\n  public function getValuesMap();\n\n  /**\n   * @param string|int|float $name\n   * @return mixed\n   */\n  public function getValueForName($name);\n\n  /**\n   * @param string|int|float $name\n   * @return mixed\n   * @throws \\InvalidArgumentException\n   */\n  public function assureValueForName($name);\n\n  /**\n   * @param string|int|float $name\n   * @return bool\n   */\n  public function isValid($name);\n\n  /**\n   * @param string|int|float $name\n   * @return void\n   * @throws \\InvalidArgumentException\n   */\n  public function assureIsValid($name);\n\n  /**\n   * @param mixed $value\n   * @return bool\n   */\n  public function isValidValue($value);\n\n  /**\n   * @param mixed $value\n   * @throws \\InvalidArgumentException\n   */\n  public function assureIsValidValue($value);\n}\n", "num_lines": 92}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Exception;\n\nclass Exception extends \\Exception {\n\n}\n", "num_lines": 30}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\nuse FacebookAds\\ApiConfig;\nuse FacebookAds\\Http\\Adapter\\AdapterInterface;\nuse FacebookAds\\Http\\Adapter\\CurlAdapter;\nuse FacebookAds\\Http\\Exception\\EmptyResponseException;\nuse FacebookAds\\Http\\Exception\\RequestException;\n\nclass Client {\n\n  /**\n   * @var string\n   */\n  const DEFAULT_GRAPH_BASE_DOMAIN = 'facebook.com';\n\n  /**\n   * @var string\n   */\n  const DEFAULT_LAST_LEVEL_DOMAIN = 'graph';\n\n  /**\n   * @var RequestInterface\n   */\n  protected $requestPrototype;\n\n  /**\n   * @var ResponseInterface\n   */\n  protected $responsePrototype;\n\n  /**\n   * @var Headers\n   */\n  protected $defaultRequestHeaders;\n\n  /**\n   * @var AdapterInterface\n   */\n  protected $adapter;\n\n  /**\n   * @var string\n   */\n  protected $caBundlePath;\n\n  /**\n   * @var string\n   */\n  protected $defaultGraphBaseDomain = self::DEFAULT_GRAPH_BASE_DOMAIN;\n\n  /**\n   * @return RequestInterface\n   */\n  public function getRequestPrototype() {\n    if ($this->requestPrototype === null) {\n      $this->requestPrototype = new Request($this);\n    }\n\n    return $this->requestPrototype;\n  }\n\n  /**\n   * @param RequestInterface $prototype\n   */\n  public function setRequestPrototype(RequestInterface $prototype) {\n    $this->requestPrototype = $prototype;\n  }\n\n  /**\n   * @return RequestInterface\n   */\n  public function createRequest() {\n    return $this->getRequestPrototype()->createClone();\n  }\n\n  /**\n   * @return ResponseInterface\n   */\n  public function getResponsePrototype() {\n    if ($this->responsePrototype === null) {\n      $this->responsePrototype = new Response();\n    }\n\n    return $this->responsePrototype;\n  }\n\n  /**\n   * @param ResponseInterface $prototype\n   */\n  public function setResponsePrototype(ResponseInterface $prototype) {\n    $this->responsePrototype = $prototype;\n  }\n\n  /**\n   * @return ResponseInterface\n   */\n  public function createResponse() {\n    return clone $this->getResponsePrototype();\n  }\n\n  /**\n   * @return Headers\n   */\n  public function getDefaultRequestHeaders() {\n    if ($this->defaultRequestHeaders === null) {\n      $this->defaultRequestHeaders = new Headers(array(\n        'User-Agent' => 'fbbizsdk-php-v'.ApiConfig::SDKVersion,\n        'Accept-Encoding' => '*',\n      ));\n    }\n\n    return $this->defaultRequestHeaders;\n  }\n\n  /**\n   * @deprecated use getDefaultRequestHeaders() instead\n   *\n   * @return Headers\n   */\n  public function getDefaultRequestHeaderds() {\n    @trigger_error(sprintf('%s deprecated, use getDefaultRequestHeaders() instead.', __METHOD__), \\E_USER_DEPRECATED);\n\n    return $this->getDefaultRequestHeaders();\n  }\n\n  /**\n   * @param Headers $headers\n   */\n  public function setDefaultRequestHeaders(Headers $headers) {\n    $this->defaultRequestHeaders = $headers;\n  }\n\n  /**\n   * @return string\n   */\n  public function getDefaultGraphBaseDomain() {\n    return $this->defaultGraphBaseDomain;\n  }\n\n  /**\n   * @param string $domain\n   */\n  public function setDefaultGraphBaseDomain($domain) {\n    $this->defaultGraphBaseDomain = $domain;\n  }\n\n  /**\n   * @return AdapterInterface\n   */\n  public function getAdapter() {\n    if ($this->adapter === null) {\n      $this->adapter = new CurlAdapter($this);\n    }\n\n    return $this->adapter;\n  }\n\n  /**\n   * @param AdapterInterface $adapter\n   */\n  public function setAdapter(AdapterInterface $adapter) {\n    $this->adapter = $adapter;\n  }\n\n  /**\n   * @return string\n   */\n  public function getCaBundlePath() {\n    if ($this->caBundlePath === null) {\n      $this->caBundlePath = __DIR__.DIRECTORY_SEPARATOR\n        .str_repeat('..'.DIRECTORY_SEPARATOR, 3)\n        .'fb_ca_chain_bundle.crt';\n    }\n\n    return $this->caBundlePath;\n  }\n\n  /**\n   * @param string $path\n   */\n  public function setCaBundlePath($path) {\n    $this->caBundlePath = $path;\n  }\n\n  /**\n   * @param RequestInterface $request\n   * @return ResponseInterface\n   * @throws RequestException\n   */\n  public function sendRequest(RequestInterface $request) {\n    $response = $this->getAdapter()->sendRequest($request);\n    $response->setRequest($request);\n    $response_content = $response->getContent();\n\n    if ($response_content === null) {\n      throw new EmptyResponseException($response);\n    }\n\n    if (is_array($response_content)\n      && array_key_exists('error', $response_content)) {\n\n      throw RequestException::create($response);\n    }\n\n    return $response;\n  }\n}\n", "num_lines": 232}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\nclass FileParameter {\n\n  /**\n   * @var string\n   */\n  protected $path;\n\n  /**\n   * @var string|null\n   */\n  protected $mimeType;\n\n  /**\n   * @var string|null\n   */\n  protected $name;\n\n  /**\n   * @param string $path\n   */\n  public function __construct($path) {\n    $this->path = $path;\n  }\n\n  /**\n   * @return string\n   */\n  public function getPath() {\n    return $this->path;\n  }\n\n  /**\n   * @return null|string\n   */\n  public function getMimeType() {\n    return $this->mimeType;\n  }\n\n  /**\n   * @param null|string $mime_type\n   * @return $this\n   */\n  public function setMimeType($mime_type) {\n    $this->mimeType = $mime_type;\n    return $this;\n  }\n\n  /**\n   * @return null|string\n   */\n  public function getName() {\n    return $this->name;\n  }\n\n  /**\n   * @param null|string $name\n   * @return $this\n   */\n  public function setName($name) {\n    $this->name = $name;\n    return $this;\n  }\n}\n", "num_lines": 90}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\nclass Headers extends \\ArrayObject {\n\n  /**\n   * @return array\n   */\n  public function export() {\n    $data = array();\n    foreach ($this as $key => $value) {\n      $data[$key] = is_null($value) || is_scalar($value)\n        ? $value\n        : $this->exportNonScalar($value);\n    }\n\n    return $data;\n  }\n}\n", "num_lines": 43}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\nclass Parameters extends \\ArrayObject {\n\n  /**\n   * @param array $data\n   */\n  public function enhance(array $data) {\n    foreach ($data as $key => $value) {\n      $this[$key] = $value;\n    }\n  }\n\n  /**\n   * @param mixed $value\n   * @return string\n   */\n  protected function exportNonScalar($value) {\n    return json_encode($value);\n  }\n\n  /**\n   * @return array\n   */\n  public function export() {\n    $data = array();\n    foreach ($this as $key => $value) {\n      $data[$key] = is_null($value) || is_scalar($value)\n        ? $value\n        : $this->exportNonScalar($value);\n    }\n\n    return $data;\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\nclass Request implements RequestInterface {\n\n  /**\n   * @var string\n   */\n  const PROTOCOL_HTTP = 'http://';\n\n  /**\n   * @var string\n   */\n  const PROTOCOL_HTTPS = 'https://';\n\n  /**\n   * @var Client\n   */\n  protected $client;\n\n  /**\n   * @var Headers\n   */\n  protected $headers;\n\n  /**\n   * @var string\n   */\n  protected $method = self::METHOD_GET;\n\n  /**\n   * @var string\n   */\n  protected $protocol = self::PROTOCOL_HTTPS;\n\n  /**\n   * @var string\n   */\n  protected $domain;\n\n  /**\n   * @var string\n   */\n  protected $path;\n\n  /**\n   * @var string\n   */\n  protected $graphVersion;\n\n  /**\n   * @var Parameters\n   */\n  protected $queryParams;\n\n  /**\n   * @var Parameters\n   */\n  protected $bodyParams;\n\n  /**\n   * @var Parameters\n   */\n  protected $fileParams;\n\n  /**\n   * @param Client $client\n   */\n  public function __construct(Client $client) {\n    $this->client = $client;\n  }\n\n  public function __clone() {\n    $this->queryParams && $this->queryParams = clone $this->queryParams;\n    $this->bodyParams && $this->bodyParams = clone $this->bodyParams;\n    $this->fileParams && $this->fileParams = clone $this->fileParams;\n  }\n\n  /**\n   * @return Client\n   */\n  public function getClient() {\n    return $this->client;\n  }\n\n  /**\n   * @return string\n   */\n  public function getProtocol() {\n    return $this->protocol;\n  }\n\n  /**\n   * @param string $protocol\n   */\n  public function setProtocol($protocol) {\n    $this->protocol = $protocol;\n  }\n\n  /**\n   * @return string\n   */\n  public function getDomain() {\n    if ($this->domain === null) {\n      $this->domain = sprintf(\n        \"%s.%s\",\n        Client::DEFAULT_LAST_LEVEL_DOMAIN,\n        $this->client->getDefaultGraphBaseDomain());\n    }\n\n    return $this->domain;\n  }\n\n  /**\n   * @param string $domain\n   */\n  public function setDomain($domain) {\n    $this->domain = $domain;\n  }\n\n  /**\n   * @param string $last_level_domain\n   */\n  public function setLastLevelDomain($last_level_domain) {\n    $this->domain = sprintf(\n      \"%s.%s\",\n      $last_level_domain,\n      $this->client->getDefaultGraphBaseDomain());\n  }\n\n  /**\n   * @return Headers\n   */\n  public function getHeaders() {\n    if ($this->headers === null) {\n      $this->headers = clone $this->getClient()->getDefaultRequestHeaders();\n    }\n\n    return $this->headers;\n  }\n\n  /**\n   * @param Headers $headers\n   */\n  public function setHeaders(Headers $headers) {\n    $this->headers = $headers;\n  }\n\n  /**\n   * @return string\n   */\n  public function getMethod() {\n    return $this->method;\n  }\n\n  /**\n   * @param string $method\n   */\n  public function setMethod($method) {\n    $this->method = $method;\n  }\n\n  /**\n   * @return string\n   */\n  public function getPath() {\n    return $this->path;\n  }\n\n  /**\n   * @param string $path\n   */\n  public function setPath($path) {\n    $this->path = $path;\n  }\n\n  /**\n   * @return string\n   */\n  public function getGraphVersion() {\n    return $this->graphVersion;\n  }\n\n  /**\n   * @param string $version\n   */\n  public function setGraphVersion($version) {\n    $this->graphVersion = $version;\n  }\n\n  /**\n   * @return Parameters\n   */\n  public function getQueryParams() {\n    if ($this->queryParams === null) {\n      $this->queryParams = new Parameters();\n    }\n\n    return $this->queryParams;\n  }\n\n  /**\n   * @param Parameters $params\n   */\n  public function setQueryParams(Parameters $params) {\n    $this->queryParams = $params;\n  }\n\n  /**\n   * @return string\n   */\n  public function getUrl() {\n    $delimiter = null;\n    if ($this->getQueryParams()->count() ) {\n      $delimiter = strpos($this->getPath(), '?') ? '&' : '?';\n    }\n    return $this->getProtocol().$this->getDomain()\n      .'/v'.$this->getGraphVersion().$this->getPath()\n      .$delimiter\n      .http_build_query($this->getQueryParams()->export(), '', '&');\n  }\n\n  /**\n   * @return Parameters\n   */\n  public function getBodyParams() {\n    if ($this->bodyParams === null) {\n      $this->bodyParams = new Parameters();\n    }\n\n    return $this->bodyParams;\n  }\n\n  /**\n   * @param Parameters $params\n   */\n  public function setBodyParams(Parameters $params) {\n    $this->bodyParams = $params;\n  }\n\n  /**\n   * @return Parameters\n   */\n  public function getFileParams() {\n    if ($this->fileParams === null) {\n      $this->fileParams = new Parameters();\n    }\n\n    return $this->fileParams;\n  }\n\n  /**\n   * @param Parameters $params\n   */\n  public function setFileParams(Parameters $params) {\n    $this->fileParams = $params;\n  }\n\n  /**\n   * @return ResponseInterface\n   */\n  public function execute() {\n    return $this->getClient()->sendRequest($this);\n  }\n\n  /**\n   * @return Request\n   * @see RequestInterface::createClone()\n   */\n  public function createClone() {\n    return clone $this;\n  }\n}\n", "num_lines": 297}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\ninterface RequestInterface {\n\n  /**\n   * @var string\n   */\n  const METHOD_DELETE = 'DELETE';\n\n  /**\n   * @var string\n   */\n  const METHOD_GET = 'GET';\n\n  /**\n   * @var string\n   */\n  const METHOD_POST = 'POST';\n\n  /**\n   * @var string\n   */\n  const METHOD_PUT = 'PUT';\n\n  /**\n   * @param Client $client\n   */\n  public function __construct(Client $client);\n\n  /**\n   * @return Client\n   */\n  public function getClient();\n\n  /**\n   * @return Headers\n   */\n  public function getHeaders();\n\n  /**\n   * @param Headers $headers\n   */\n  public function setHeaders(Headers $headers);\n\n  /**\n   * @return string\n   */\n  public function getProtocol();\n\n  /**\n   * @param string $protocol\n   */\n  public function setProtocol($protocol);\n\n  /**\n   * @return string\n   */\n  public function getDomain();\n\n  /**\n   * @param string $domain\n   */\n  public function setDomain($domain);\n\n  /**\n   * @param string $last_level_domain\n   */\n  public function setLastLevelDomain($last_level_domain);\n\n  /**\n   * @return string\n   */\n  public function getMethod();\n\n  /**\n   * @param string $method\n   */\n  public function setMethod($method);\n\n  /**\n   * @return string\n   */\n  public function getPath();\n\n  /**\n   * @param string $version\n   */\n  public function setGraphVersion($version);\n\n  /**\n   * @return mixed\n   */\n  public function getGraphVersion();\n\n  /**\n   * @param string $path\n   */\n  public function setPath($path);\n\n  /**\n   * @return Parameters\n   */\n  public function getQueryParams();\n\n  /**\n   * @param Parameters $params\n   */\n  public function setQueryParams(Parameters $params);\n\n  /**\n   * @return string\n   */\n  public function getUrl();\n\n  /**\n   * @return Parameters\n   */\n  public function getBodyParams();\n\n  /**\n   * @param Parameters $params\n   */\n  public function setBodyParams(Parameters $params);\n\n  /**\n   * @return Parameters\n   */\n  public function getFileParams();\n\n  /**\n   * @param Parameters $params\n   */\n  public function setFileParams(Parameters $params);\n\n  /**\n   * @return ResponseInterface\n   */\n  public function execute();\n\n  /**\n   * Required for Mocking request/response chaining\n   * @return RequestInterface\n   */\n  public function createClone();\n}\n", "num_lines": 170}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\nclass Response implements ResponseInterface {\n\n  /**\n   * @var RequestInterface\n   */\n  protected $request;\n\n  /**\n   * @var int\n   */\n  protected $statusCode;\n\n  /**\n   * @var Headers\n   */\n  protected $headers;\n\n  /**\n   * @var string\n   */\n  protected $body;\n\n  /**\n   * @var mixed\n   */\n  protected $content;\n\n  /**\n   * @return RequestInterface\n   */\n  public function getRequest() {\n    return $this->request;\n  }\n\n  /**\n   * @param RequestInterface $request\n   */\n  public function setRequest(RequestInterface $request) {\n    $this->request = $request;\n  }\n\n  /**\n   * @return int\n   */\n  public function getStatusCode() {\n    return $this->statusCode;\n  }\n\n  /**\n   * @param int $status_code\n   */\n  public function setStatusCode($status_code) {\n    $this->statusCode = $status_code;\n  }\n\n  /**\n   * @return Headers\n   */\n  public function getHeaders() {\n    if ($this->headers === null) {\n      $this->headers = new Headers();\n    }\n\n    return $this->headers;\n  }\n\n  /**\n   * @param Headers $headers\n   */\n  public function setHeaders(Headers $headers) {\n    $this->headers = $headers;\n  }\n\n  /**\n   * @return string\n   */\n  public function getBody() {\n    return $this->body;\n  }\n\n  /**\n   * @param string $body\n   */\n  public function setBody($body) {\n    $this->body = $body;\n    $this->content = null;\n  }\n\n  /**\n   * @return array|null\n   */\n  public function getContent() {\n    if ($this->content === null) {\n      $this->content = json_decode($this->getBody(), true);\n    }\n\n    return $this->content;\n  }\n}\n", "num_lines": 126}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\ninterface ResponseInterface {\n\n  /**\n   * @return RequestInterface\n   */\n  public function getRequest();\n\n  /**\n   * @param RequestInterface $request\n   */\n  public function setRequest(RequestInterface $request);\n\n  /**\n   * @return int\n   */\n  public function getStatusCode();\n\n  /**\n   * @param int $status_code\n   */\n  public function setStatusCode($status_code);\n\n  /**\n   * @return Headers\n   */\n  public function getHeaders();\n\n  /**\n   * @param Headers $headers\n   */\n  public function setHeaders(Headers $headers);\n\n  /**\n   * @return string\n   */\n  public function getBody();\n\n  /**\n   * @param string $body\n   */\n  public function setBody($body);\n\n  /**\n   * @return array|null\n   */\n  public function getContent();\n}\n", "num_lines": 74}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\nclass SimpleRequest extends Request{\n\n  /**\n   * @var string\n   */\n  const DEFAULT_WWWW_BASE_DOMAIN = 'connect.facebook.net';\n\n  /**\n   * @param Client $client\n   */\n  public function __construct(Client $client) {\n    parent::__construct($client);\n    //Setting the curl options inside the client to avoid SSL certificates usage\n    $client -> getAdapter()->setOpts( new \\ArrayObject(array(\n        CURLOPT_CONNECTTIMEOUT => 10,\n        CURLOPT_TIMEOUT => 60,\n        CURLOPT_RETURNTRANSFER => true,\n        CURLOPT_HEADER => true,\n        CURLOPT_SSL_VERIFYPEER => 0)));\n  }\n\n  /**\n   * @return string\n   */\n  public function getDomain() {\n    if ($this->domain === null) {\n      $this->domain = sprintf(\n        \"%s\",\n        self::DEFAULT_WWWW_BASE_DOMAIN);\n    }\n\n    return $this->domain;\n  }\n\n  /**\n   * @return string\n   */\n  public function getUrl() {\n    $delimiter = null;\n    if ($this->getQueryParams()->count() ) {\n      $delimiter = strpos($this->getPath(), '?') ? '&' : '?';\n    }\n    return $this->getProtocol().$this->getDomain()\n        .'/'.$this->getPath()\n        .$delimiter\n        .http_build_query($this->getQueryParams()->export(), '', '&');\n  }\n}\n", "num_lines": 75}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\nabstract class Util {\n\n  /**\n   * Avoid parse_str() for HHVM compatibility\n   * This implementation is not a complete sobstitute, but covers all the\n   * requirements of the Facebook Graph Cursor.\n   *\n   * @see hhvm.hack.disallow_dynamic_var_env_funcs\n   * @param $query_string\n   * @return array\n   */\n  public static function parseUrlQuery($query_string) {\n    $query = array();\n    $pairs = explode('&', $query_string);\n    foreach ($pairs as $pair) {\n      list($key, $value) = explode('=', $pair);\n      $query[$key] = urldecode($value);\n    }\n\n    return $query;\n  }\n}\n", "num_lines": 49}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Adapter;\n\nuse FacebookAds\\Http\\Client;\n\nabstract class AbstractAdapter implements AdapterInterface {\n\n  /**\n   * @var Client\n   */\n  protected $client;\n\n  /**\n   * @param Client $client\n   */\n  public function __construct(Client $client) {\n    $this->client = $client;\n  }\n\n  /**\n   * @return Client\n   */\n  public function getClient() {\n    return $this->client;\n  }\n\n  /**\n   * @return string\n   */\n  public function getCaBundlePath() {\n    return $this->getClient()->getCaBundlePath();\n  }\n}\n", "num_lines": 57}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Adapter;\n\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\n\ninterface AdapterInterface {\n\n  /**\n   * @param Client $client\n   */\n  public function __construct(Client $client);\n\n  /**\n   * @return Client\n   */\n  public function getClient();\n\n  /**\n   * @return string\n   */\n  public function getCaBundlePath();\n\n  /**\n   * @return \\ArrayObject\n   */\n  public function getOpts();\n\n  /**\n   * @param \\ArrayObject $opts\n   * @return void\n   */\n  public function setOpts(\\ArrayObject $opts);\n\n  /**\n   * @param RequestInterface $request\n   * @return ResponseInterface\n   */\n  public function sendRequest(RequestInterface $request);\n}\n", "num_lines": 65}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Adapter;\n\nuse FacebookAds\\Exception\\Exception;\nuse FacebookAds\\Http\\Adapter\\Curl\\AbstractCurl;\nuse FacebookAds\\Http\\Adapter\\Curl\\Curl;\nuse FacebookAds\\Http\\Adapter\\Curl\\CurlInterface;\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\Headers;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\n\nclass CurlAdapter extends AbstractAdapter {\n\n  /**\n   * @var CurlInterface\n   */\n  protected $curl;\n\n  /**\n   * @var \\ArrayObject\n   */\n  protected $opts;\n\n  /**\n   * @param Client $client\n   * @param CurlInterface $curl\n   */\n  public function __construct(Client $client, CurlInterface $curl = null) {\n    parent::__construct($client);\n    $this->curl = $curl ?: AbstractCurl::createOptimalVersion();\n    $this->curl->init();\n  }\n\n  /**\n   * @return Curl\n   */\n  public function getCurl() {\n    return $this->curl;\n  }\n\n  /**\n   * @return \\ArrayObject\n   */\n  public function getOpts() {\n    if ($this->opts === null) {\n      $this->opts = new \\ArrayObject(array(\n        CURLOPT_CONNECTTIMEOUT => 10,\n        CURLOPT_TIMEOUT => 60,\n        CURLOPT_RETURNTRANSFER => true,\n        CURLOPT_HEADER => true,\n        CURLOPT_CAINFO => $this->getCaBundlePath(),\n      ));\n    }\n\n    return $this->opts;\n  }\n\n  /**\n   * @param \\ArrayObject $opts\n   */\n  public function setOpts(\\ArrayObject $opts) {\n    $this->opts = $opts;\n  }\n\n  /**\n   * @return int\n   */\n  protected function getheaderSize() {\n    return $this->getCurl()->getInfo(CURLINFO_HEADER_SIZE);\n  }\n\n  /**\n   * Extracts the headers and the body into a two-part array\n   * @param string $raw_response\n   * @return array\n   */\n  protected function extractResponseHeadersAndBody($raw_response) {\n    $header_size = $this->getheaderSize();\n\n    $raw_headers = mb_substr($raw_response, 0, $header_size);\n    $raw_body = mb_substr($raw_response, $header_size);\n\n    return array(trim($raw_headers), trim($raw_body));\n  }\n\n  /**\n   * @param Headers $headers\n   * @param string $raw_headers\n   */\n  protected function parseHeaders(Headers $headers, $raw_headers) {\n    $raw_headers = str_replace(\"\\r\\n\", \"\\n\", $raw_headers);\n\n    // There will be multiple headers if a 301 was followed\n    // or a proxy was followed, etc\n    $header_collection = explode(\"\\n\\n\", trim($raw_headers));\n    // We just want the last response (at the end)\n    $raw_headers = array_pop($header_collection);\n\n    $header_components = explode(\"\\n\", $raw_headers);\n    foreach ($header_components as $line) {\n      if (strpos($line, ': ') === false) {\n        $headers['http_code'] = $line;\n      } else {\n        list ($key, $value) = explode(': ', $line, 2);\n        $headers[$key] = $value;\n      }\n    }\n  }\n\n  /**\n   * @param RequestInterface $request\n   * @return ResponseInterface\n   * @throws Exception\n   */\n  public function sendRequest(RequestInterface $request) {\n    $response = $this->getClient()->createResponse();\n    $this->getCurl()->reset();\n    $curlopts = array(\n      CURLOPT_URL => $request->getUrl(),\n    );\n\n    $method = $request->getMethod();\n    if ($method !== RequestInterface::METHOD_GET\n      && $method !== RequestInterface::METHOD_POST) {\n      $curlopts[CURLOPT_CUSTOMREQUEST] = $method;\n    }\n\n    $curlopts = $this->getOpts()->getArrayCopy() + $curlopts;\n\n    if ($request->getHeaders()->count()) {\n      $headers = array();\n      foreach ($request->getHeaders() as $header => $value) {\n        $headers[] = \"{$header}: {$value}\";\n      }\n      $curlopts[CURLOPT_HTTPHEADER] = $headers;\n    }\n\n    $postfields = array();\n    if ($method === RequestInterface::METHOD_POST\n      && $request->getFileParams()->count()\n    ) {\n      $postfields = array_merge(\n        $postfields,\n        array_map(\n          array($this->getCurl(), 'preparePostFileField'),\n          $request->getFileParams()->getArrayCopy()));\n    }\n    if ($method !== RequestInterface::METHOD_GET\n      && $request->getBodyParams()->count()) {\n      $postfields\n        = array_merge($postfields, $request->getBodyParams()->export());\n    }\n\n    if (!empty($postfields)) {\n      $curlopts[CURLOPT_POSTFIELDS] = $postfields;\n    }\n\n    $this->getCurl()->setoptArray($curlopts);\n    $raw_response = $this->getCurl()->exec();\n\n    $status_code = $this->getCurl()->getInfo(CURLINFO_HTTP_CODE);\n    $curl_errno = $this->getCurl()->errno();\n    $curl_error = $curl_errno ? $this->getCurl()->error() : null;\n\n    $response_parts = $this->extractResponseHeadersAndBody($raw_response);\n\n    $response->setStatusCode($status_code);\n    $this->parseHeaders($response->getHeaders(), $response_parts[0]);\n    $response->setBody($response_parts[1]);\n\n    if ($curl_errno) {\n      throw new Exception($curl_error, $curl_errno);\n    }\n\n    return $response;\n  }\n}\n", "num_lines": 202}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Adapter\\Curl;\n\nabstract class AbstractCurl implements CurlInterface {\n\n  /**\n   * @var resource\n   */\n  protected $handle;\n\n  /**\n   * @throws \\RuntimeException\n   */\n  public function __construct() {\n    if (!extension_loaded('curl')) {\n      throw new \\RuntimeException(\"Extension curl not loaded\");\n    }\n  }\n\n  public function __clone() {\n    $this->handle = curl_copy_handle($this->handle);\n  }\n\n  public function __destruct() {\n    if (is_resource($this->handle)) {\n      curl_close($this->handle);\n    }\n  }\n\n  /**\n   * @return CurlInterface\n   */\n  public static function createOptimalVersion() {\n    if (version_compare(PHP_VERSION, '5.5.0') >= 0) {\n      return new Curl55();\n    } else {\n      return new Curl();\n    }\n  }\n\n  /**\n   * @return resource\n   */\n  public function getHandle() {\n    return $this->handle;\n  }\n\n  /**\n   * @return int\n   */\n  public function errno() {\n    return curl_errno($this->handle);\n  }\n\n  /**\n   * @return string\n   */\n  public function error() {\n    return curl_error($this->handle);\n  }\n\n  /**\n   * @return mixed\n   */\n  public function exec() {\n    return curl_exec($this->handle);\n  }\n\n  /**\n   * @param int $opt\n   * @return mixed\n   */\n  public function getInfo($opt = 0) {\n    return curl_getinfo($this->handle, $opt);\n  }\n\n  /**\n   * @return void\n   */\n  public function init() {\n    $this->handle = $this->handle ?: curl_init();\n  }\n\n  /**\n   * @param array $opts\n   */\n  public function setoptArray(array $opts) {\n    curl_setopt_array($this->handle, $opts);\n  }\n\n  /**\n   * @param int $option\n   * @param mixed $value\n   * @return bool\n   */\n  public function setopt($option, $value) {\n    return curl_setopt($this->handle, $option, $value);\n  }\n\n  /**\n   * @param int $age\n   * @return array\n   */\n  public static function version($age) {\n    return curl_version($age);\n  }\n}\n", "num_lines": 131}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Adapter\\Curl;\n\nuse FacebookAds\\Http\\FileParameter;\n\nclass Curl extends AbstractCurl {\n\n  /**\n   * @throws \\RuntimeException\n   */\n  public function __construct() {\n    parent::__construct();\n    if (version_compare(PHP_VERSION, '5.5.0') >= 0) {\n      throw new \\RuntimeException(\"Unsupported Curl version\");\n    }\n  }\n\n  /**\n   * @param string $string\n   * @return string\n   */\n  public function escape($string) {\n    return rawurlencode($string);\n  }\n\n  /**\n   * @param int $bitmask\n   * @return int\n   */\n  public function pause($bitmask) {\n    return 0;\n  }\n\n  /**\n   * FIXME should introduce v2.10 breaking change:\n   * implement abstract support for FileParameter in AdapterInterface\n   *\n   * @param string|FileParameter $filepath\n   * @return string\n   */\n  public function preparePostFileField($filepath) {\n    $mime_type = $name = '';\n    if ($filepath instanceof FileParameter) {\n      $mime_type = $filepath->getMimeType() !== null\n        ? sprintf(';type=%s', $filepath->getMimeType())\n        : '';\n      $name = $filepath->getName() !== null\n        ? sprintf(';filename=%s', $filepath->getName())\n        : '';\n      $filepath = $filepath->getPath();\n    }\n    return sprintf('@%s%s%s', $filepath, $mime_type, $name);\n  }\n\n  /**\n   * @return void\n   */\n  public function reset() {\n    $this->handle && curl_close($this->handle);\n    $this->handle = curl_init();\n  }\n\n  /**\n   * @param int $errornum\n   * @return NULL|string\n   */\n  public static function strerror($errornum) {\n    return curl_strerror($errornum);\n  }\n\n  /**\n   * @param string $string\n   * @return bool|string\n   */\n  public function unescape($string) {\n    return curl_unescape($this->handle, $string);\n  }\n}\n", "num_lines": 102}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Adapter\\Curl;\n\nuse FacebookAds\\Http\\FileParameter;\n\nclass Curl55 extends AbstractCurl {\n\n  /**\n   * @throws \\RuntimeException\n   */\n  public function __construct() {\n    parent::__construct();\n    if (version_compare(PHP_VERSION, '5.5.0') < 0) {\n      throw new \\RuntimeException(\"Unsupported Curl version\");\n    }\n  }\n\n  /**\n   * @param string $string\n   * @return bool|string\n   */\n  public function escape($string) {\n    return curl_escape($this->handle, $string);\n  }\n\n  /**\n   * @param int $bitmask\n   * @return int\n   */\n  public function pause($bitmask) {\n    return curl_pause($this->handle, $bitmask);\n  }\n\n  /**\n   * FIXME should introduce v2.10 breaking change:\n   * implement abstract support for FileParameter in AdapterInterface\n   *\n   * @param string|FileParameter $filepath\n   * @return \\CURLFile\n   */\n  public function preparePostFileField($filepath) {\n    $mime_type = $name = ''; // can't be null in HHVM\n    if ($filepath instanceof FileParameter) {\n      $mime_type = $filepath->getMimeType() ?: '';\n      $name = $filepath->getName() ?: '';\n      $filepath = $filepath->getPath();\n    }\n    return new \\CURLFile($filepath, $mime_type, $name);\n  }\n\n  /**\n   * @return void\n   */\n  public function reset() {\n    $this->handle && curl_reset($this->handle);\n  }\n\n  /**\n   * @param int $errornum\n   * @return NULL|string\n   */\n  public static function strerror($errornum) {\n    return curl_strerror($errornum);\n  }\n\n  /**\n   * @param string $string\n   * @return bool|string\n   */\n  public function unescape($string) {\n    return curl_unescape($this->handle, $string);\n  }\n}\n", "num_lines": 97}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Adapter\\Curl;\n\ninterface CurlInterface {\n\n  /**\n   * @return resource\n   */\n  public function getHandle();\n\n  /**\n   * @return int\n   */\n  public function errno();\n\n  /**\n   * @return string\n   */\n  public function error();\n\n  /**\n   * @param string $string\n   * @return bool|string\n   */\n  public function escape($string);\n\n  /**\n   * @return mixed\n   */\n  public function exec();\n\n  /**\n   * @param int $opt\n   * @return mixed\n   */\n  public function getInfo($opt = 0);\n\n  /**\n   * @return void\n   */\n  public function init();\n\n  /**\n   * @param int $bitmask\n   * @return int\n   */\n  public function pause($bitmask);\n\n  /**\n   * @param $filepath\n   * @return string|\\CurlFile\n   */\n  public function preparePostFileField($filepath);\n\n  /**\n   * @return void\n   */\n  public function reset();\n\n  /**\n   * @param array $opts\n   */\n  public function setoptArray(array $opts);\n\n  /**\n   * @param int $option\n   * @param mixed $value\n   * @return bool\n   */\n  public function setopt($option, $value);\n\n  /**\n   * @param $string\n   * @return string\n   */\n  public function unescape($string);\n\n  /**\n   * @param int $age\n   * @return array\n   */\n  public static function version($age);\n}\n", "num_lines": 107}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Exception;\n\nclass AuthorizationException extends RequestException {\n\n}\n", "num_lines": 30}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Exception;\n\nclass ClientException extends RequestException {\n\n}\n", "num_lines": 30}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Exception;\n\nuse FacebookAds\\Http\\ResponseInterface;\n\nclass EmptyResponseException extends RequestException {\n\n  /**\n   * @param ResponseInterface $response\n   */\n  public function __construct(ResponseInterface $response) {\n    $content = array(\n      'error' => array(\n        'message' => 'Empty Response',\n      ));\n    $response->setBody(json_encode($content));\n    parent::__construct($response);\n  }\n}\n", "num_lines": 43}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Exception;\n\nclass PermissionException extends RequestException {\n\n}\n", "num_lines": 30}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Exception;\n\nuse FacebookAds\\Exception\\Exception;\nuse FacebookAds\\Http\\ResponseInterface;\n\nclass RequestException extends Exception {\n\n  /**\n   * @var ResponseInterface|null\n   */\n  protected $response;\n\n  /**\n   * @var Headers\n   */\n  protected $headers;\n\n  /**\n   * @var int|null\n   */\n  protected $errorCode;\n\n  /**\n   * @var int|null\n   */\n  protected $errorSubcode;\n\n  /**\n   * @var string|null\n   */\n  protected $errorMessage;\n\n  /**\n   * @var string|null\n   */\n  protected $errorUserTitle;\n\n  /**\n   * @var string|null\n   */\n  protected $errorUserMessage;\n\n  /**\n   * @var int|null\n   */\n  protected $errorType;\n\n  /**\n   * @var array|null\n   */\n  protected $errorBlameFieldSpecs;\n\n  /**\n   * @var string|null\n   */\n  protected $facebookTraceId;\n\n  /**\n   * @param ResponseInterface $response\n   */\n  public function __construct(ResponseInterface $response) {\n    $this->headers = $response->getHeaders();\n    $this->response = $response;\n    $error_data = static::getErrorData($response);\n\n    parent::__construct($error_data['message'], $error_data['code'] ?? 0);\n\n    $this->errorSubcode = $error_data['error_subcode'];\n    $this->errorUserTitle = $error_data['error_user_title'];\n    $this->errorUserMessage = $error_data['error_user_msg'];\n    $this->errorBlameFieldSpecs = $error_data['error_blame_field_specs'];\n    $this->facebookTraceId = $error_data['fbtrace_id'];\n  }\n\n  /**\n   * @return ResponseInterface|null\n   */\n  public function getResponse() {\n    return $this->response;\n  }\n\n  /**\n   * @param array|string $array\n   * @param string|int $key\n   * @param mixed $default\n   * @return mixed\n   */\n  protected static function idx($array, $key, $default = null) {\n    if (is_string($array)) {\n      $array = json_decode($array, true);\n    }\n\n    if (is_null($array)) {\n      return null;\n    }\n\n    return array_key_exists($key, $array)\n      ? $array[$key]\n      : $default;\n  }\n\n  /**\n   * @param ResponseInterface $response\n   * @return array\n   */\n  protected static function getErrorData(ResponseInterface $response) {\n    $response_data = $response->getContent();\n    if (is_null($response_data)) {\n      $response_data = array();\n    }\n    $error_data = static::idx($response_data, 'error', array());\n\n    if (is_string(static::idx($error_data, 'error_data'))) {\n      $error_data[\"error_data\"] =\n        json_decode(stripslashes(static::idx($error_data, 'error_data')), true);\n    }\n\n    if (is_null(static::idx($error_data, 'error_data'))) {\n      $error_data[\"error_data\"] = array();\n    }\n\n    return array(\n      'code' =>\n        static::idx($error_data, 'code', static::idx($response_data, 'code')),\n      'error_subcode' => static::idx($error_data, 'error_subcode'),\n      'message' => static::idx($error_data, 'message'),\n      'error_user_title' => static::idx($error_data, 'error_user_title'),\n      'error_user_msg' => static::idx($error_data, 'error_user_msg'),\n      'error_blame_field_specs' =>\n        static::idx(static::idx($error_data, 'error_data', array()),\n          'blame_field_specs'),\n      'fbtrace_id' => static::idx($error_data, 'fbtrace_id'),\n      'type' => static::idx($error_data, 'type'),\n    );\n  }\n\n  /**\n   * Process an error payload from the Graph API and return the appropriate\n   * exception subclass.\n   * @param ResponseInterface $response\n   * @return RequestException\n   */\n  public static function create(ResponseInterface $response) {\n    $error_data = static::getErrorData($response);\n    if (in_array(\n      $error_data['error_subcode'], array(458, 459, 460, 463, 464, 467))\n      || in_array($error_data['code'], array(100, 102, 190))\n      || $error_data['type'] === 'OAuthException') {\n\n      return new AuthorizationException($response);\n    } elseif (in_array($error_data['code'], array(1, 2))) {\n\n      return new ServerException($response);\n    } elseif (in_array($error_data['code'], array(4, 17, 341))) {\n\n      return new ThrottleException($response);\n    } elseif ($error_data['code'] == 506) {\n\n      return new ClientException($response);\n    } elseif ($error_data['code'] == 10\n      || ($error_data['code'] >= 200 && $error_data['code'] <= 299)) {\n\n      return new PermissionException($response);\n    } else {\n\n      return new self($response);\n    }\n  }\n\n  /**\n   * @return int\n   */\n  public function getHttpStatusCode() {\n    return $this->response->getStatusCode();\n  }\n\n  /**\n   * @return int|null\n   */\n  public function getErrorSubcode() {\n    return $this->errorSubcode;\n  }\n\n  /**\n   * @return string|null\n   */\n  public function getErrorUserTitle() {\n    return $this->errorUserTitle;\n  }\n\n  /**\n   * @return string|null\n   */\n  public function getErrorUserMessage() {\n    return $this->errorUserMessage;\n  }\n\n  /**\n   * @return array|null\n   */\n  public function getErrorBlameFieldSpecs() {\n    return $this->errorBlameFieldSpecs;\n  }\n\n  /**\n   * @return string|null\n   */\n  public function getFacebookTraceId() {\n    return $this->facebookTraceId;\n  }\n\n  /**\n   * @return bool\n   */\n  public function isTransient() {\n    if ($this->getResponse() !== null) {\n      return false;\n    }\n\n    $body = $this->getResponse()->getBody();\n\n    return array_key_exists('error', $body)\n      && array_key_exists('is_transient', $body['error'])\n      && $body['error']['is_transient'];\n  }\n\n  /**\n   * @return Headers\n   */\n  public function getHeaders() {\n    return $this->headers;\n  }\n}\n", "num_lines": 258}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Exception;\n\nclass ServerException extends RequestException {\n\n}\n", "num_lines": 30}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Exception;\n\nclass ThrottleException extends RequestException {\n\n}\n", "num_lines": 30}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Logger;\n\nuse FacebookAds\\Http\\FileParameter;\nuse FacebookAds\\Http\\Parameters;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\nuse FacebookAds\\Logger\\CurlLogger\\JsonAwareParameters;\n\nclass CurlLogger implements LoggerInterface {\n\n  /**\n   * @var string\n   */\n  const PARAM_DEFAULT_FLAG = 'd';\n\n  /**\n   * @var string\n   */\n  const PARAM_URLENCODE_FLAG = '-data-urlencode';\n\n  /**\n   * @var string\n   */\n  const PARAM_POST_FLAG = 'F';\n\n  /**\n   * @var string\n   */\n  const METHOD_DEFAULT_FLAG = '';\n\n  /**\n   * @var string\n   */\n  const METHOD_GET_FLAG = 'G';\n\n  /**\n   * @var string\n   */\n  const METHOD_PUT_FLAG = 'X PUT';\n\n  /**\n   * @var string\n   */\n  const METHOD_DELETE_FLAG = 'X DELETE';\n\n  /**\n   * @var resource\n   */\n  protected $handle;\n\n  /**\n   * @var bool\n   */\n  protected $jsonPrettyPrint = false;\n\n  /**\n   * @param resource $handle\n   */\n  public function __construct($handle = null) {\n    if (!defined('STDOUT')) {\n      define('STDOUT', fopen('php://stdout', 'w'));\n    }\n    $this->handle = is_resource($handle) ? $handle : STDOUT;\n  }\n\n  /**\n   * @return bool\n   */\n  public function isJsonPrettyPrint() {\n    return $this->jsonPrettyPrint;\n  }\n\n  /**\n   * @param bool $json_pretty_print\n   * @return $this\n   */\n  public function setJsonPrettyPrint($json_pretty_print) {\n    $this->jsonPrettyPrint = $json_pretty_print;\n    return $this;\n  }\n\n  /**\n   * @param string $method\n   * @return string\n   */\n  public static function getMethodFlag($method) {\n    switch ($method) {\n      case RequestInterface::METHOD_GET:\n        return static::METHOD_GET_FLAG;\n      case RequestInterface::METHOD_PUT:\n        return static::METHOD_PUT_FLAG;\n      case RequestInterface::METHOD_DELETE:\n        return static::METHOD_DELETE_FLAG;\n    }\n\n    return static::METHOD_DEFAULT_FLAG;\n  }\n\n  /**\n   * @param string $method\n   * @param string $value\n   * @return string\n   */\n  public static function getParamFlag($method, $value) {\n    return $method === RequestInterface::METHOD_POST\n      ? static::PARAM_POST_FLAG\n      : (strstr($value, \"\\n\")\n        ? static::PARAM_URLENCODE_FLAG\n        : static::PARAM_DEFAULT_FLAG);\n  }\n\n  /**\n   * @param string $string\n   * @param int $indent\n   * @return string\n   */\n  protected function indent($string, $indent) {\n    return str_replace(\"\\n\", \" \\n\".str_repeat(' ', $indent), $string);\n  }\n\n  /**\n   * @param Parameters $params\n   * @param string $method\n   * @param bool $is_file\n   * @return string\n   */\n  protected function processParams(Parameters $params, $method, $is_file) {\n    $chunks = array();\n    if ($this->isJsonPrettyPrint()) {\n      $params = new JsonAwareParameters($params);\n    }\n    foreach ($params->export() as $name => $value) {\n      if ($is_file && $params->offsetGet($name) instanceof FileParameter) {\n        $value = \"@\" . $this->normalizeFileParam($params->offsetGet($name));\n      } else {\n        $value = addcslashes(\n          strpos($value, \"\\n\") !== false\n            ? $this->indent($value, 2)\n            : $value,\n          '\\'');\n      }\n      $chunks[$name] = sprintf(\n        '-%s \\'%s=%s\\'',\n        $this->getParamFlag($method, $value),\n        $name,\n        $value);\n    }\n\n    return $chunks;\n  }\n\n  /**\n   * @param FileParameter $file_param\n   * @return string\n   */\n  protected function normalizeFileParam(FileParameter $file_param) {\n    return sprintf('%s%s%s%s%s',\n      $file_param->getPath(),\n      $file_param->getMimeType() != null ? \";type=\" : \"\",\n      $file_param->getMimeType(),\n      $file_param->getName() != null ? \";name=\" : \"\",\n      $file_param->getName());\n  }\n\n  /**\n   * @param RequestInterface $request\n   * @return string\n   */\n  protected function processUrl(RequestInterface $request) {\n    return $request->getProtocol().$request->getDomain()\n      .'/v'.$request->getGraphVersion().$request->getPath();\n  }\n\n  /**\n   * @param string $buffer\n   */\n  protected function flush($buffer) {\n    fwrite($this->handle, $buffer.PHP_EOL.PHP_EOL);\n  }\n\n  /**\n   * @param mixed $level\n   * @param string $message\n   * @param array $context\n   */\n  public function log($level, $message, array $context = array()) {\n    // We only care about requests\n  }\n\n  /**\n   * @param array $array\n   * @param mixed $key\n   * @return mixed\n   */\n  protected function removeArrayKey(array &$array, $key) {\n    if (array_key_exists($key, $array)) {\n      $value = $array[$key];\n      unset($array[$key]);\n      return $value;\n    } else {\n      return null;\n    }\n  }\n\n  /**\n   * @param array $params\n   * @return array\n   */\n  protected function sortParams(array $params) {\n    $access_token = $this->removeArrayKey($params, 'access_token');\n    $appsecret_proof = $this->removeArrayKey($params, 'appsecret_proof');\n    $access_token !== null && $params['access_token'] = $access_token;\n    $appsecret_proof !== null && $params['appsecret_proof'] = $appsecret_proof;\n\n    return $params;\n  }\n\n  /**\n   * @param string $level\n   * @param RequestInterface $request\n   * @param array $context\n   */\n  public function logRequest(\n    $level, RequestInterface $request, array $context = array()) {\n\n    $new_line = ' \\\\'.PHP_EOL.'  ';\n    $method = $request->getMethod();\n    $method_flag = static::getMethodFlag($method);\n    $params = $this->sortParams(array_merge(\n      $this->processParams($request->getQueryParams(), $method, false),\n      $this->processParams($request->getBodyParams(), $method, false),\n      $this->processParams($request->getFileParams(), $method, true)));\n\n    $buffer = 'curl'.($method_flag ? ' -'.$method_flag : '');\n    foreach ($params as $param) {\n      $buffer .= $new_line.$param;\n    }\n    $buffer .= $new_line.$this->processUrl($request);\n\n    $this->flush($buffer);\n  }\n\n  /**\n   * @param string $level\n   * @param ResponseInterface $response\n   * @param array $context\n   */\n  public function logResponse(\n    $level, ResponseInterface $response, array $context = array()) {\n    // We only care about requests\n  }\n}\n", "num_lines": 277}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Logger;\n\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\n\ninterface LoggerInterface {\n\n  /**\n   * @param string $level\n   * @param string $message\n   * @param array $context\n   */\n  public function log($level, $message, array $context = array());\n\n  /**\n   * @param string $level\n   * @param RequestInterface $request\n   * @param array $context\n   */\n  public function logRequest(\n    $level, RequestInterface $request, array $context = array());\n\n  /**\n   * @param string $level\n   * @param ResponseInterface $response\n   * @param array $context\n   */\n  public function logResponse(\n    $level, ResponseInterface $response, array $context = array());\n}\n", "num_lines": 55}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Logger;\n\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\n\nclass NullLogger implements LoggerInterface {\n\n  /**\n   * @param string $level\n   * @param string $message\n   * @param array $context\n   */\n  public function log($level, $message, array $context = array()) {\n\n  }\n\n  /**\n   * @param string $level\n   * @param RequestInterface $request\n   * @param array $context\n   */\n  public function logRequest(\n    $level, RequestInterface $request, array $context = array()) {\n\n  }\n\n  /**\n   * @param string $level\n   * @param ResponseInterface $response\n   * @param array $context\n   */\n  public function logResponse(\n    $level, ResponseInterface $response, array $context = array()) {\n\n  }\n}\n", "num_lines": 61}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Logger\\CurlLogger;\n\nuse FacebookAds\\Http\\Parameters;\n\nclass JsonAwareParameters extends Parameters {\n\n  /**\n   * @param mixed $value\n   * @return string\n   */\n  protected function exportNonScalar($value) {\n    return JsonNode::factory($value)->encode();\n  }\n}\n", "num_lines": 39}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Logger\\CurlLogger;\n\nfinal class JsonNode {\n\n  /**\n   * @var int\n   */\n  const INDENT_UNIT = 2;\n\n  /**\n   * @var int\n   */\n  const EXPLOSION_THRESHOLD = 78;\n\n  /**\n   * @var mixed\n   */\n  protected $value;\n\n  /**\n   * @var \\ArrayObject\n   */\n  protected $children;\n\n  /**\n   * @param mixed $value\n   * @return $this\n   * @throws \\InvalidArgumentException\n   */\n  public static function factory($value) {\n    $object = new self();\n    switch (true) {\n      case is_object($value):\n        $value = (array) $value;\n        // fallthrough\n      case is_array($value):\n        foreach ($value as $key => $sub) {\n          $object->getChildren()->offsetSet($key, self::factory($sub));\n        }\n        // fallthrough\n      case is_null($value) || is_scalar($value):\n        $object->setValue($value);\n        break;\n      default:\n        throw new \\InvalidArgumentException(\n          gettype($value).' can\\'t be encoded');\n    }\n\n    return $object;\n  }\n\n  public function __construct() {\n    $this->children = new \\ArrayObject();\n  }\n\n  /**\n   * @return mixed\n   */\n  public function getValue() {\n    return $this->value;\n  }\n\n  /**\n   * @param mixed $value\n   * @return $this\n   */\n  public function setValue($value) {\n    $this->value = $value;\n\n    return $this;\n  }\n\n  /**\n   * @return \\ArrayObject\n   */\n  public function getChildren() {\n    return $this->children;\n  }\n\n  /**\n   * @return int\n   */\n  public function getMaxTreeChildrenCount() {\n    $max = $this->getChildren()->count();\n\n    /** @var JsonNode $child */\n    foreach ($this->getChildren() as $child) {\n      $ith = $child->getMaxTreeChildrenCount();\n      $max = $ith > $max ? $ith : $max;\n    }\n\n    return $max;\n  }\n\n  /**\n   * @param int $indent\n   * @return string\n   */\n  protected function getPadding($indent) {\n    return str_repeat(' ', $indent * self::INDENT_UNIT);\n  }\n\n  /**\n   * @return mixed\n   */\n  protected function getLastChildKey() {\n    if ($this->getChildren()->count() === 0) {\n      return null;\n    }\n\n    $copy = $this->getChildren()->getArrayCopy();\n    end($copy);\n\n    return key($copy);\n  }\n\n  /**\n   * @param int $indent\n   * @return string\n   */\n  protected function encodeList($indent) {\n    $value = $this->getValue();\n    if (empty($value) || (array_keys($value) === range(0, count($value) - 1))) {\n      $is_map = false;\n    } else {\n      $is_map = true;\n    }\n\n    ++$indent;\n    $last_key = $this->getLastChildKey();\n\n    $buffer = ($is_map ? '{' : '[').\"\\n\";\n\n    /** @var JsonNode $child */\n    foreach ($this->getChildren() as $key => $child) {\n      $buffer .= sprintf(\n        \"%s%s%s%s\\n\",\n        $this->getPadding($indent),\n        $is_map ? sprintf(\"%s: \", json_encode($key)) : '',\n        $child->encode($indent),\n        $key === $last_key ? '' : ',');\n    }\n\n    --$indent;\n    $buffer .= $this->getPadding($indent).($is_map ? '}' : ']');\n\n    return $buffer;\n  }\n\n  /**\n   * @param int $indent\n   * @return string\n   */\n  public function encode($indent = 0) {\n    $value = $this->getValue();\n    if (is_array($value) || is_object($value)) {\n      if ($this->getMaxTreeChildrenCount() > 2) {\n        return $this->encodeList($indent);\n      }\n\n      $ugly = json_encode($value);\n      $output_prediction = $this->getPadding($indent).$ugly;\n      if (strlen($output_prediction) > self::EXPLOSION_THRESHOLD) {\n        return $this->encodeList($indent);\n      }\n\n      return $ugly;\n    }\n\n    return json_encode($value);\n  }\n}\n", "num_lines": 197}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\Http\\RequestInterface;\n\nabstract class AbstractArchivableCrudObject extends AbstractCrudObject {\n\n  /**\n   * @var string\n   */\n  const STATUS_PARAM_NAME = 'status';\n\n  /**\n   * @var string\n   */\n  const STATUS_ACTIVE = 'ACTIVE';\n\n  /**\n   * @var string\n   */\n  const STATUS_PAUSED = 'PAUSED';\n\n  /**\n   * @var string\n   */\n  const STATUS_DELETED = 'DELETED';\n\n  /**\n   * @var string\n   */\n  const STATUS_ARCHIVED = 'ARCHIVED';\n\n  /**\n   * @return string\n   */\n  public function getStatusParamName() {\n    return self::STATUS_PARAM_NAME;\n  }\n\n  /**\n   * Archive this object\n   *\n   * @deprecated use api_update instead\n   * @param array $params\n   * @return void\n   */\n  public function archive(array $params = array()) {\n    $this->getApi()->call(\n      $this->getNodePath(),\n      RequestInterface::METHOD_POST,\n      array_merge($params, array(\n        $this->getStatusParamName() => static::STATUS_ARCHIVED)));\n  }\n\n  /**\n   * Delete this object\n   *\n   * @deprecated use api_update instead\n   * @param array $params\n   * @return void\n   */\n  public function delete(array $params = array()) {\n    $this->getApi()->call(\n      $this->getNodePath(),\n      RequestInterface::METHOD_POST,\n      array_merge($params, array(\n        $this->getStatusParamName() => static::STATUS_DELETED)));\n  }\n}\n", "num_lines": 93}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\nnamespace FacebookAds\\Object;\nuse FacebookAds\\ApiConfig;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Enum\\EmptyEnum;\nclass AbstractObject {\n  /**\n   * @var mixed[] set of key value pairs representing data\n   */\n  protected $data = array();\n  protected $_type_checker;\n\n  public function __construct() {\n    $this->data = static::getFieldsEnum()->getValuesMap();\n    $this->_type_checker = new TypeChecker(\n      static::getFieldTypes(), static::getReferencedEnums());\n  }\n\n  protected static function getFieldTypes() {\n    $fields_enum = static::getFieldsEnum();\n    if (method_exists($fields_enum, 'getFieldTypes')) {\n      return $fields_enum->getFieldTypes();\n    } else {\n      return array();\n    }\n  }\n\n  protected static function getReferencedEnums() {\n    return array();\n  }\n\n  /**\n   * @param string $name\n   * @param mixed $value\n   */\n  public function __set($name, $value) {\n    if (ApiConfig::TYPE_CHECKER_STRICT_MODE\n      && $this->_type_checker->isValidParam($name)\n    ) {\n      if ($this->_type_checker->isValidParamPair($name, $value)) {\n        $this->data[$name] = $value;\n      } else {\n        throw new \\InvalidArgumentException(\n          $name.\" and \".$this->exportValue($value)\n          .\" are not a valid type value pair\");\n      }\n    } else {\n      $this->data[$name] = $value;\n    }\n    return $this;\n  }\n\n  /**\n   * @param string $name\n   * @return mixed\n   * @throws \\InvalidArgumentException\n   */\n  public function __get($name) {\n    if (array_key_exists($name, $this->data)) {\n      return $this->data[$name];\n    } else {\n      throw new \\InvalidArgumentException(\n        $name.' is not a field of '.get_class($this));\n    }\n  }\n  /**\n   * @param string $name\n   * @return boolean\n   */\n  public function __isset($name) {\n    return array_key_exists($name, $this->data);\n  }\n  /**\n   * @param array\n   * @return $this\n   */\n  public function setData(array $data) {\n    foreach ($data as $key => $value) {\n      $this->{$key} = $value;\n    }\n    // Handle class-specific situations\n    if (method_exists($this, 'setDataTrigger')) {\n      $this->setDataTrigger($data);\n    }\n\n    return $this;\n  }\n  /**\n   * Like setData but will skip field validation\n   *\n   * @param array\n   * @return $this\n   */\n  public function setDataWithoutValidation(array $data) {\n    foreach ($data as $key => $value) {\n      $this->data[$key] = $value;\n    }\n    // Handle class-specific situations\n    if (method_exists($this, 'setDataTrigger')) {\n      $this->setDataTrigger($data);\n    }\n    return $this;\n  }\n  /**\n   * @return array\n   */\n  public function getData() {\n    return $this->data;\n  }\n  /**\n   * @param mixed $value\n   * @return mixed\n   */\n  protected function exportValue($value) {\n    $result = $value;\n    switch (true) {\n      case $value === null:\n        break;\n      case $value instanceof AbstractObject:\n        $result = $value->exportData();\n        break;\n      case is_array($value):\n        $result = array();\n        foreach ($value as $key => $sub_value) {\n          if ($sub_value !== null) {\n            $result[$key] = $this->exportValue($sub_value);\n          }\n        }\n        break;\n    }\n    return $result;\n  }\n  /**\n   * @return array\n   */\n  public function exportData() {\n    return $this->exportValue($this->data);\n  }\n  /**\n   * @return array\n   */\n  public function exportAllData() {\n    return $this->exportValue($this->data);\n  }\n  /**\n   * @return EmptyEnum\n   */\n  public static function getFieldsEnum() {\n    return EmptyEnum::getInstance();\n  }\n  /**\n   * @return array\n   */\n  public static function getFields() {\n    return static::getFieldsEnum()->getValues();\n  }\n  /**\n   * @return string\n   */\n  public static function className() {\n    return get_called_class();\n  }\n}\n", "num_lines": 186}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\ninterface CanRedownloadInterface {\n\n  /**\n   * @string\n   */\n  const PARAM_REDOWNLOAD = 'redownload';\n}\n", "num_lines": 34}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\Object\\Fields\\ClickTrackingTagFields;\nuse FacebookAds\\Http\\RequestInterface;\n\nclass ClickTrackingTag extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   * @return string\n   */\n  protected function getEndpoint() {\n    return 'trackingtag';\n  }\n\n  /**\n   * @return ClickTrackingTagFields\n   */\n  public static function getFieldsEnum() {\n    return ClickTrackingTagFields::getInstance();\n  }\n\n  public function deleteSelf(array $params = array()) {\n    $this->getApi()->call(\n      '/'.$this->parentId.'/'.$this->getEndpoint(),\n      RequestInterface::METHOD_DELETE,\n      $params);\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\Object\\Fields\\AdCreativeObjectStorySpecFields;\nuse FacebookAds\\Object\\Traits\\FieldValidation;\n\n/**\n * @deprecated use AdCreativeObjectStorySpec instead\n */\nclass ObjectStorySpec extends AdCreativeObjectStorySpec {\n  use FieldValidation;\n\n  /**\n   * @return AdCreativeObjectStorySpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeObjectStorySpecFields::getInstance();\n  }\n}\n", "num_lines": 43}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Object\\Fields\\SystemUserFields;\n\nclass SystemUser extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   * @return string\n   */\n  protected function getEndpoint() {\n    return 'system_users';\n  }\n\n  /**\n   * @return SystemUserFields\n   */\n  public static function getFieldsEnum() {\n    return SystemUserFields::getInstance();\n  }\n\n  public function invalidateAccessTokens() {\n    $this->getApi()->call(\n      '/'.$this->assureId().'/access_tokens',\n      RequestInterface::METHOD_DELETE);\n  }\n}\n", "num_lines": 53}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\n\nclass TargetingSearch extends AbstractObject {\n\n  /**\n   * @param string $query\n   * @param string $type\n   * @param string $class\n   * @param array $params\n   * @param Api $api\n   * @return Cursor\n   * @throws \\InvalidArgumentException\n   */\n  public static function search(\n    $type,\n    $class=null,\n    $query=null,\n    array $params = array(),\n    Api $api = null) {\n\n    $api = $api ?: Api::instance();\n    if (!$api) {\n      throw new \\InvalidArgumentException(\n        'An Api instance must be provided as argument or '.\n        'set as instance in the \\FacebookAds\\Api');\n    }\n\n    $params['type'] = $type;\n    $params = array_merge($params, array_filter(array(\n      'class' => $class,\n      'q' => $query,\n    )));\n\n    $response = $api->call('/search', RequestInterface::METHOD_GET, $params);\n    return new Cursor($response, new TargetingSearch());\n  }\n}\n", "num_lines": 66}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass BirthYearNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::BIRTH_YEAR;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return preg_replace('/[^0-9]/', '', $key_value);\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass CityNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::CITY;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return preg_replace('/[^a-z]/', '', strtolower(trim($key_value)));\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass CountryNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::COUNTRY;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return substr(\n      preg_replace('/[^a-z]/', '', strtolower(trim($key_value))),\n      0,\n      2);\n  }\n}\n", "num_lines": 53}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass DateNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return in_array($key, array(\n      CustomAudienceMultikeySchemaFields::BIRTH_DATE,\n      CustomAudienceMultikeySchemaFields::BIRTH_MONTH\n    ));\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return str_pad(\n      preg_replace('/[^0-9]/', '', $key_value),\n      2,\n      '0',\n      STR_PAD_LEFT);\n  }\n}\n", "num_lines": 57}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass EmailNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::EMAIL;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return trim(strtolower($key_value), \" \\t\\r\\n\\0\\x0B.\");\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass FirstNameInitialNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::FIRST_NAME_INITIAL;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return preg_replace(\n      '/[^a-z]/',\n      '',\n      strtolower(trim($key_value)))[0];\n  }\n}\n", "num_lines": 53}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass FirstNameNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::FIRST_NAME;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return preg_replace('/[^a-z]/', '', strtolower(trim($key_value)));\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass GenderNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::GENDER;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return substr($key_value, 0, 1);\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\n\nclass HashNormalizer implements ValueNormalizerInterface {\n\n    /**\n     *  @var string\n     */\n    const HASH_TYPE_SHA256 = 'sha256';\n\n    /**\n     * @param string $key\n     * @param string $key_value\n     * @return boolean\n     */\n    public function shouldNormalize($key, $key_value) {\n        return $key !== CustomAudienceMultikeySchemaFields::LOOKALIKE_VALUE;\n    }\n\n    /**\n     * @param string $key\n     * @param string $key_value\n     * @return string\n     */\n    public function normalize($key, $key_value) {\n        return hash(self::HASH_TYPE_SHA256, $key_value);\n    }\n}\n", "num_lines": 55}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass LastNameNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::LAST_NAME;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return preg_replace('/[^a-z]/', '', strtolower(trim($key_value)));\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass MadidNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::MADID;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return strtolower(trim($key_value));\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass PhoneNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::PHONE;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return preg_replace('/[^0-9]/', '', trim($key_value));\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass StateNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::STATE;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return preg_replace('/[^a-z]/', '', strtolower(trim($key_value)));\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\ninterface ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $val);\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $val);\n}\n", "num_lines": 43}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass ZipNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::ZIP;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return explode(\n      '-',\n      preg_replace('/[ ]/', '', strtolower(trim($key_value))))[0];\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\nabstract class AbstractArchivableCrudObjectFields extends AbstractEnum {\n\n  const CONFIGURED_STATUS = 'configured_status';\n  const EFFECTIVE_STATUS = 'effective_status';\n}\n", "num_lines": 34}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static AdVideoFields getInstance()\n */\nclass AdVideoFields extends AbstractEnum {\n\n  const CREATED_TIME = 'created_time';\n  const DESCRIPTION = 'description';\n  const EMBED_HTML = 'embed_html';\n  const EMBEDDABLE = 'embeddable';\n  const FILE_URL = 'file_url';\n  const FORMAT = 'format';\n  const FROM = 'from';\n  const ICON = 'icon';\n  const ID = 'id';\n  const IS_INSTAGRAM_ELIGIBLE = 'is_instagram_eligible';\n  const NAME = 'name';\n  const PICTURE = 'picture';\n  const PUBLISHED = 'published';\n  const SLIDESHOW_SPEC = 'slideshow_spec';\n  const SOURCE = 'source';\n  const THUMBNAILS = 'thumbnails';\n  const UPDATED_TIME = 'updated_time';\n}\n", "num_lines": 52}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static ClickTrackingTagFields getInstance()\n */\nclass ClickTrackingTagFields extends AbstractEnum {\n\n  const ID = 'id';\n  const ADD_TEMPLATE_PARAM = 'add_template_param';\n  const URL = 'url';\n  const ADGROUP_ID = 'adgroup_id';\n}\n", "num_lines": 39}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static CustomAudienceMultikeySchemaFields getInstance()\n */\nclass CustomAudienceMultikeySchemaFields extends AbstractEnum {\n\n  const EXTERN_ID = 'EXTERN_ID';\n  const EMAIL = 'EMAIL';\n  const PHONE = 'PHONE';\n  const GENDER = 'GEN';\n  const BIRTH_YEAR = 'DOBY';\n  const BIRTH_MONTH = 'DOBM';\n  const BIRTH_DATE = 'DOBD';\n  const LAST_NAME = 'LN';\n  const FIRST_NAME = 'FN';\n  const FIRST_NAME_INITIAL = 'FI';\n  const CITY = 'CT';\n  const STATE = 'ST';\n  const ZIP = 'ZIP';\n  const MADID = 'MADID';\n  const COUNTRY = 'COUNTRY';\n  const FB_USER_ID = 'APPUID';\n  const LOOKALIKE_VALUE = 'LOOKALIKE_VALUE';\n}\n", "num_lines": 52}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static SystemUserFields getInstance()\n */\nclass SystemUserFields extends AbstractEnum {\n\n  const ID = 'id';\n  const NAME = 'name';\n  const PERMISSIONS = 'permissions';\n  const ROLE = 'role';\n}\n", "num_lines": 39}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Search;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static DemographicSearchClasses getInstance()\n */\nclass DemographicSearchClasses extends AbstractEnum {\n\n  const LIFE_EVENTS = 'life_events';\n  const POLITICS = 'politics';\n  const MARKETS = 'markets';\n  const INDUSTRIES = 'industries';\n  const INCOME = 'income';\n  const NET_WORTH = 'net_worth';\n  const HOME_TYPE = 'home_type';\n  const HOME_OWNERSHIP = 'home_ownership';\n  const HOME_VALUE = 'home_value';\n  const ETHNIC_AFFINITY = 'ethnic_affinity';\n  const GENERATION = 'generation';\n  const HOUSEHOLD_COMPOSITION = 'household_composition';\n  const MOMS = 'moms';\n  const OFFICE_TYPE = 'office_type';\n  const FAMILY_STATUSES = 'family_statuses';\n  const DEMOGRAPHICS = 'demographics';\n}\n", "num_lines": 51}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Search;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static TargetingSearchTypes getInstance()\n */\nclass TargetingSearchTypes extends AbstractEnum {\n\n  const COUNTRY = 'adcountry';\n  const EDUCATION = 'adeducationschool';\n  const EMPLOYER = 'adworkemployer';\n  const GEOLOCATION = 'adgeolocation';\n  const GEOLOCATIONMETA = 'adgeolocationmeta';\n  const INTEREST = 'adinterest';\n  const INTEREST_SUGGESTION = 'adinterestsuggestion';\n  const INTEREST_VALIDATE = 'adinterestvalid';\n  const KEYWORD = 'adkeyword';\n  const LOCALE = 'adlocale';\n  const MAJOR = 'adeducationmajor';\n  const POSITION = 'adworkposition';\n  const RADIUS_SUGGESTION = 'adradiussuggestion';\n  const TARGETING_CATEGORY = 'adTargetingCategory';\n  const ZIPCODE = 'adzipcode';\n}\n", "num_lines": 50}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Traits;\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Http\\RequestInterface;\n\n/**\n * @method Api getApi()\n * @method string assureId()\n */\ntrait AdLabelAwareCrudObjectTrait {\n\n  /**\n   * Take ad label ids and format them correctly for the request\n   * @param array $adlabel_ids\n   * @return array\n   */\n  protected function formatParams(array $adlabel_ids) {\n    foreach ($adlabel_ids as &$adlabel_id) {\n      $adlabel_id = array('id' => $adlabel_id);\n    }\n\n    return array('adlabels' => $adlabel_ids);\n  }\n\n  /**\n   * @deprecated use createAdLabel instead\n   * @param array $ad_label_ids\n   */\n  public function addAdLabels(array $ad_label_ids) {\n    $this->getApi()->call(\n      '/'.$this->assureId().'/adlabels',\n      RequestInterface::METHOD_POST,\n      $this->formatParams($ad_label_ids));\n  }\n\n  /**\n   * @deprecated use deleteAdLabels instead\n   * @param array $ad_label_ids\n   */\n  public function removeAdLabels(array $ad_label_ids) {\n    $this->getApi()->call(\n      '/'.$this->assureId().'/adlabels',\n      RequestInterface::METHOD_DELETE,\n      $this->formatParams($ad_label_ids));\n  }\n}\n", "num_lines": 71}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Traits;\n\nuse FacebookAds\\Enum\\EnumInstanceInterface;\n\n/**\n * @method static EnumInstanceInterface getFieldsEnum()\n */\ntrait FieldValidation {\n\n  /**\n   * @param string $name\n   * @param mixed $value\n   * @throws \\InvalidArgumentException\n   * @staticvar array $fields\n   */\n  public function __set($name, $value) {\n    if (static::getFieldsEnum()->isValidValue($name)) {\n      parent::__set($name, $value);\n    } else {\n      throw new \\InvalidArgumentException(\n        $name.' is not a field of '.get_class($this));\n    }\n  }\n}\n", "num_lines": 49}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static AppRoles getInstance()\n */\nclass AppRoles extends AbstractEnum {\n\n  const ADMINISTRATOR  = 'ADMINISTRATOR';\n  const DEVELOPER = 'DEVELOPER';\n  const TESTER = 'TESTER';\n  const INSIGHTS_USER = 'INSIGHTS_USER';\n  const TEST_USER = 'TEST_USER';\n\n}\n", "num_lines": 41}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\nclass ArchivableCrudObjectEffectiveStatuses extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const AD_PAUSED = 'AD_PAUSED';\n  const ADSET_PAUSED = 'ADSET_PAUSED';\n  const ARCHIVED = 'ARCHIVED';\n  const ARCHIVED_IN_DRAFT = 'ARCHIVED_IN_DRAFT';\n  const CAMPAIGN_PAUSED = 'CAMPAIGN_PAUSED';\n  const DELETED = 'DELETED';\n  const DISAPPROVED = 'DISAPPROVED';\n  const PAUSED = 'PAUSED';\n  const PENDING = 'PENDING';\n  const PENDING_BILLING_INFO = 'PENDING_BILLING_INFO';\n  const PENDING_REVIEW = 'PENDING_REVIEW';\n  const PREAPPROVED = 'PREAPPROVED';\n}\n", "num_lines": 45}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\n/**\n * @deprecated use AdSetBillingEventValues instead\n *\n * @method static BillingEvents getInstance()\n */\nclass BillingEvents extends AdSetBillingEventValues {}\n", "num_lines": 33}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static BusinessRoles getInstance()\n */\nclass BusinessRoles extends AbstractEnum {\n\n  const ADMIN  = 'ADMIN';\n  const EMPLOYEE = 'EMPLOYEE';\n  const OWNER = 'OWNER';\n  const AGENCY = 'AGENCY';\n\n}\n", "num_lines": 40}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static CampaignBuyingTypeValues getInstance()\n */\nclass CampaignBuyingTypeValues extends AbstractEnum {\n\n  const AUCTION  = 'AUCTION';\n  const RESERVED = 'RESERVED';\n}\n", "num_lines": 37}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static ConnectionObjectTypes getInstance()\n */\nclass ConnectionObjectTypes extends AbstractEnum {\n\n  const PAGE = 1;\n  const APPLICATION = 2;\n  const EVENT = 3;\n  const PLACE = 6;\n  const DOMAIN = 7;\n}\n", "num_lines": 40}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static CustomAudienceSubtypes getInstance()\n */\nclass CustomAudienceSubtypes extends AbstractEnum {\n\n  const APP = 'APP';\n  const APP_COMBINATION = 'APP_COMBINATION';\n  const CUSTOM = 'CUSTOM';\n  const LOOKALIKE = 'LOOKALIKE';\n  const MANAGED = 'MANAGED';\n  const PARTNER = 'PARTNER';\n  const VIDEO = 'VIDEO';\n  const WEBSITE = 'WEBSITE';\n}\n", "num_lines": 43}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static CustomAudienceTypes getInstance()\n */\nclass CustomAudienceTypes extends AbstractEnum {\n\n  /**\n   * @var string\n   */\n  const ID = 'UID';\n\n  /**\n   * @var string\n   */\n  const CLAIM = 'CLAIM';\n\n  /**\n   * @var string\n   */\n  const EMAIL = 'EMAIL_SHA256';\n\n  /**\n   * @var string\n   */\n  const PHONE = 'PHONE_SHA256';\n\n  /**\n   * @var string\n   */\n  const MOBILE_ADVERTISER_ID = 'MOBILE_ADVERTISER_ID';\n}\n", "num_lines": 59}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static FeedEncoding getInstance()\n */\nclass FeedEncoding extends AbstractEnum {\n\n  const AUTODETECT  = 'AUTODETECT';\n  const ASCII = 'ASCII';\n  const UTF_8 = 'UTF_8';\n  const UTF_16 = 'UTF_16';\n  const LATIN_1 = 'LATIN_1';\n}\n", "num_lines": 40}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static InsightsIncrements getInstance()\n */\nclass InsightsIncrements extends AbstractEnum {\n\n  const MONTHLY = 'monthly';\n  const ALL_DAYS = 'all_days';\n}\n", "num_lines": 37}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static InsightsOperators getInstance()\n */\nclass InsightsOperators extends AbstractEnum {\n\n  const ALL = 'ALL';\n  const ANY = 'ANY';\n  const CONTAIN = 'CONTAIN';\n  const EQUAL = 'EQUAL';\n  const GREATER_THAN = 'GREATER_THAN';\n  const GREATER_THAN_OR_EQUAL = 'GREATER_THAN_OR_EQUAL';\n  const IN = 'IN';\n  const IN_RANGE = 'IN_RANGE';\n  const LESS_THAN = 'LESS_THAN';\n  const LESS_THAN_OR_EQUAL = 'LESS_THAN_OR_EQUAL';\n  const NONE = 'NONE';\n  const NOT_CONTAIN = 'NOT_CONTAIN';\n  const NOT_EQUAL = 'NOT_EQUAL';\n  const NOT_IN = 'NOT_IN';\n  const NOT_IN_RANGE = 'NOT_IN_RANGE';\n}\n", "num_lines": 50}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static PageRoles getInstance()\n */\nclass PageRoles extends AbstractEnum {\n\n  const ADVERTISER  = 'ADVERTISER';\n  const CONTENT_CREATOR = 'CONTENT_CREATOR';\n  const MANAGER = 'MANAGER';\n  const MODERATOR = 'MODERATOR';\n  const INSIGHTS_ANALYST = 'INSIGHTS_ANALYST';\n}\n", "num_lines": 40}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @deprecated page_types are read-only in v2.7 and to be removed in v2.8\n * @method static PageTypes getInstance()\n */\nclass PageTypes extends AbstractEnum {\n\n  const DESKTOP_FEED = 'desktopfeed';\n  const HOME = 'home';\n  const INSTAGRAM_STREAM = 'instagramstream';\n  const LEGACY_EXTERNAL = 'legacyexternal';\n  const LOGOUT = 'logout';\n  const MOBILE_EXTERNAL = 'mobileexternal';\n  const MOBILE_FEED = 'mobilefeed';\n  const RIGHT_COLUMN = 'rightcolumn';\n}\n", "num_lines": 44}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static ReachFrequencyPredictionStatuses getInstance()\n */\nclass ReachFrequencyPredictionStatuses extends AbstractEnum {\n\n  const SUCCESS = 1;\n  const PENDING = 2;\n  const UNREACHABLE_AUDIENCE = 3;\n  const CONFIG_INVALID = 4;\n  const TARGET_SPEC_INVALID = 5;\n  const BUDGET_TOO_LOW = 6;\n  const TOO_SHORT_AD_SET_LENGTH = 7;\n  const TOO_LONG_AD_SET_LENGTH = 8;\n  const END_DATE_TOO_FAR = 9;\n  const FREQUENCY_CAP_NOT_SPECIFIED = 10;\n  const UNSUPPORTED_PLACEMENT = 11;\n  const DATE_ERROR = 12;\n  const COUNTRY_NOT_SUPPORTED = 13;\n  const BLACKOUT_DAYS = 14;\n  const INSUFFICIENT_INVENTORY = 15;\n  const REACH_BELOW_1_MILLION = 16;\n  const MINIMUM_REACH_NOT_AVAILABLE = 17;\n  const INVENTORY_CHANGED = 21;\n}\n", "num_lines": 53}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static TermsOfService getInstance()\n */\nclass TermsOfService extends AbstractEnum {\n\n  const CUSTOM_AUDIENCE  = 'custom_audience';\n  const WEBSITE_CUSTOM_AUDIENCE = 'website_custom_audience';\n  const MOBILE_APP_CUSTOM_AUDIENCE = 'mobile_app_custom_audience';\n}\n", "num_lines": 38}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static UserPermissionRoles getInstance()\n */\nclass UserPermissionRoles extends AbstractEnum {\n\n  const ADMIN  = 'ADMIN';\n  const EMPLOYEE  = 'EMPLOYEE';\n}\n", "num_lines": 37}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nreturn array(\n\n  /**\n   * @var string Numeric Facebook app id, espressed as string\n   */\n  'app_id' => '',\n\n  /**\n   * @var string App Secret\n   * @see https://developers.facebook.com/apps/<APP_ID>/dashboard/\n   */\n  'app_secret' => '',\n\n  /**\n   * @var string User Access Token\n   * @see https://developers.facebook.com/docs/facebook-login/access-tokens/\n   */\n  'access_token' => '',\n\n  /**\n   * @var string Numeric Facebook Business Manager id, espressed as string\n   */\n  'business_id' => '',\n\n  /**\n   * @var string Numeric Facebook id, preceded by 'act_', espressed as string\n   * @see https://www.facebook.com/ads/manage/home/\n   */\n  'act_id' => '',\n\n  /**\n   * @var string PHP timezone compatible with the AdAccount timezone, override php.ini config\n   * @see http://php.net/manual/en/timezones.php\n   */\n  'act_timezone' => '',\n\n  /**\n   * @var string Numeric Facebook id, espressed as string\n   * @see https://www.facebook.com/ads/manage/home/\n   */\n  'page_id' => '',\n\n  /**\n   * @var string Url of your app [Stream post URL security]\n   *             Example: 'http://my.domain.com/'\n   * @see https://developers.facebook.com/docs/facebook-login/security/#surfacearea\n   */\n  'app_url' => '',\n\n  /**\n   * @var string Numeric Instagram actor id, espressed as string\n   */\n  'instagram_actor_id' => '',\n\n  // OPTIONAL INTEGRATION TESTS\n\n  'skip_if' => array(\n\n    /**\n     * @var bool Skip tests that require an business manager\n     * @see https://developers.facebook.com/docs/marketing-api/businessmanager/\n     */\n    'no_business_manager' => true,\n\n    /**\n     * @var bool Skip tests that require an account with a valid payment method\n     * @see https://secure.facebook.com/ads/manage/funding.php\n     */\n    'no_payment_method' => true,\n\n    /**\n     * @var bool Skip tests that require parnet categories whitelisting\n     * @see https://developers.facebook.com/docs/reference/ads-api/partnercategories\n     */\n    'no_partner_categories' => true,\n\n    /**\n     * @var bool Skip tests that require video upload\n     */\n    'no_video_upload' => true,\n\n    /**\n     * @var bool Skip tests that require reach and frequency whitelisting\n     */\n    'no_reach_and_frequency_whitelist' => true,\n\n    /**\n     * @var bool Skip tests that require polling for async jobs execution\n     */\n    'no_async_jobs' => true,\n\n    /**\n     * @var bool Skip tests that require an instagram actor\n     */\n    'no_instagram' => true,\n  ),\n\n  // OPTIONAL CONFIGURATIONS\n\n  /**\n   * @var string Override Facebook graph domain\n   *             Example: try hitting beta.facebook.com\n   */\n  'graph_base_domain' => '',\n\n  /**\n   * @var string Disable SSL verification between CA and host\n   *             [Security] Do not change this unless you trust your network\n   */\n  'skip_ssl_verification' => false,\n\n  /**\n   * @var string Filepath to which cUrl shell equivalents will be dumped\n   *             Tip: access std streams with 'php://stdout' or 'php://stderr'\n   */\n  'curl_logger' => '',\n\n  // OPTIONAL SECONDARY ENTITIES\n  // Do not set the same as primary. May incurr in lost permissions.\n\n  /**\n   * @var string Ausiliary Business ID for permissions and sharing testing\n   */\n  'secondary_business_id' => '',\n\n  /**\n   * @var string Ausiliary Account ID for permissions and sharing testing\n   */\n  'secondary_account_id' => '',\n\n  /**\n   * @var string Ausiliary Page ID for permissions and sharing testing\n   */\n  'secondary_page_id' => '',\n\n  /**\n   * @var string Ausiliary Page ID for permissions and sharing testing\n   */\n  'secondary_app_id' => '',\n);\n", "num_lines": 165}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Bootstrap;\n\nerror_reporting(E_ALL | E_STRICT);\nif (!ini_get('date.timezone')) {\n  ini_set('date.timezone', 'UTC');\n}\n\nrequire_once __DIR__.'/FacebookAdsTest/Bootstrap/Bootstrap.php';\nrequire_once __DIR__.'/FacebookAdsTest/Bootstrap/IntegrationBootstrap.php';\n\n$bootstrap = new IntegrationBootstrap();\n$bootstrap->init();\n\nreturn $bootstrap;\n", "num_lines": 39}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Bootstrap;\n\nerror_reporting(E_ALL | E_STRICT);\nif (!ini_get('date.timezone')) {\n  ini_set('date.timezone', 'UTC');\n}\nrequire_once __DIR__.'/FacebookAdsTest/Bootstrap/Bootstrap.php';\n\n$bootstrap = new Bootstrap();\n$bootstrap->init();\n\nreturn $bootstrap;\n", "num_lines": 37}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest;\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Http\\Adapter\\CurlAdapter;\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\Exception\\RequestException;\nuse FacebookAds\\Logger\\CurlLogger;\nuse FacebookAds\\Logger\\LoggerInterface;\nuse FacebookAds\\Logger\\NullLogger;\nuse FacebookAds\\Session;\nuse FacebookAdsTest\\Exception\\PHPUnitRequestExceptionWrapper;\n\n/**\n * Base class for the integration test cases.\n * Provide Network services.\n */\nclass AbstractIntegrationTestCase extends AbstractTestCase {\n\n  /**\n   * @var LoggerInterface\n   */\n  protected $logger;\n\n  /**\n   * @var Client\n   */\n  protected $httpClient;\n\n  /**\n   * @var Session\n   */\n  protected $session;\n\n  /**\n   * @var Api\n   */\n  protected $api;\n\n  /**\n   * @return LoggerInterface\n   */\n  public function getLogger() {\n    return $this->logger;\n  }\n\n  /**\n   * @return Session\n   */\n  public function getSession() {\n    return $this->session;\n  }\n\n  /**\n   * @return Client\n   */\n  public function getHttpClient() {\n    return $this->httpClient;\n  }\n\n  /**\n   * @return Api\n   */\n  public function getApi() {\n    return $this->api;\n  }\n\n  protected function setupSession() {\n    $this->session = new Session(\n      $this->getConfig()->appId,\n      $this->getConfig()->appSecret,\n      $this->getConfig()->accessToken);\n  }\n\n  protected function setupHttpClient() {\n    $this->httpClient = new Client();\n    if ($this->getConfig()->graphBaseDomain) {\n      $this->httpClient->setDefaultGraphBaseDomain(\n        $this->getConfig()->graphBaseDomain);\n    }\n    if ($this->getConfig()->skipSslVerification) {\n      /** @var CurlAdapter $adapter */\n      $adapter = $this->httpClient->getAdapter();\n      $adapter->getOpts()->offsetSet(CURLOPT_SSL_VERIFYHOST, false);\n      $adapter->getOpts()->offsetSet(CURLOPT_SSL_VERIFYPEER, false);\n    }\n  }\n\n  protected function setupLogger() {\n    $this->logger = $this->getConfig()->curlLogger\n      ? new CurlLogger(fopen($this->getConfig()->curlLogger, \"a\"))\n      : new NullLogger();\n  }\n\n  protected function setupApi() {\n    $this->api = new Api(\n      $this->getHttpClient(),\n      $this->getSession());\n\n    $this->api->setLogger($this->getLogger());\n\n    Api::setInstance($this->api);\n  }\n\n  public function setup() : void {\n    parent::setup();\n\n    $this->getSkippableFeaturesManager()->enforceSkipTest($this);\n\n    $this->setupLogger();\n    $this->setupSession();\n    $this->setupHttpClient();\n    $this->setupApi();\n  }\n\n  public function tearDown() : void {\n    $this->api = null;\n    $this->httpClient = null;\n    $this->session = null;\n    $this->logger = null;\n\n    parent::tearDown();\n  }\n\n  /**\n   * This method is called when a test method did not execute successfully.\n   *\n   * @param \\Throwable $e\n   * @throws \\Throwable\n   */\n  protected function onNotSuccessfulTest(\\Throwable $e) : void {\n    if ($e instanceof RequestException) {\n      throw new PHPUnitRequestExceptionWrapper($e);\n    } else {\n      throw $e;\n    }\n  }\n}\n", "num_lines": 162}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest;\n\nuse FacebookAdsTest\\Config\\Config;\nuse FacebookAdsTest\\Config\\SkippableFeaturesManager;\nuse \\PHPUnit_Framework_MockObject_Builder_InvocationMocker as Mock;\nuse PHPUnit\\Framework\\TestCase;\n\n/**\n * Base class for the unit test cases, providing the functions for AdsAPI\n * initialization etc.\n */\nclass AbstractTestCase extends TestCase {\n\n  /**\n   * @return SkippableFeaturesManager\n   */\n  public function getSkippableFeaturesManager() {\n    return SkippableFeaturesManager::instance();\n  }\n\n  /**\n   * @param string $key\n   * @return bool\n   */\n  public function shouldSkipTest($key) {\n    return $this->getSkippableFeaturesManager()->isSkipKey($key);\n  }\n\n  public function skipIf($key) {\n    if ($this->shouldSkipTest($key)) {\n      $this->markTestSkipped();\n    }\n  }\n\n  /**\n   * @return Config\n   */\n  public function getConfig() {\n    return Config::instance();\n  }\n\n  /**\n   * @return string\n   * @deprecated use getConfig()\n   */\n  public function getTestRunId() {\n    return $this->getConfig()->testRunId;\n  }\n\n  /**\n   * @return string\n   * @deprecated use getConfig()\n   */\n  public function getTestImagePath() {\n    return $this->getConfig()->testImagePath;\n  }\n\n  /**\n   * @return string\n   * @deprecated use getConfig()\n   */\n  public function getTestZippedImagesPath() {\n    return $this->getConfig()->testZippedImagesPath;\n  }\n\n  /**\n   * @return string\n   * @deprecated use getConfig()\n   */\n  public function getTestVideoPath() {\n    return $this->getConfig()->testVideoPath;\n  }\n\n  /**\n   * @param mixed $mock\n   * @param array $data\n   */\n  protected function makeMockIterable(\n    $mock, array $data = array()) {\n\n    /** @var Mock $mock */\n    $mock->method('count')->willReturn(count($data));\n    $mock->method('getIterator')->willReturn(new \\ArrayIterator($data));\n    $mock->method('getArrayCopy')->willReturn($data);\n    $mock->method('export')->willReturn($data);\n  }\n\n  /**\n   * @param \\Closure $closure\n   * @param string $fqn\n   */\n  protected function assertWillThrow(\n    \\Closure $closure,\n    $fqn = 'Exception') {\n\n    try {\n      call_user_func($closure);\n    } catch (\\Exception $e) {\n      $this->assertTrue(\n        is_a($e, $fqn),\n        'Expected exception of type '.$fqn.': '.get_class($e).' received');\n\n      return;\n    }\n\n    $this->fail('Expected exception didn\\'t throw: '.$fqn);\n  }\n}\n", "num_lines": 133}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest;\n\nuse FacebookAds\\Http\\Adapter\\AdapterInterface;\nuse FacebookAds\\Http\\Adapter\\Curl\\CurlInterface;\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\Headers;\nuse FacebookAds\\Http\\Parameters;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\nuse FacebookAds\\Logger\\LoggerInterface;\nuse FacebookAds\\Session;\nuse PHPUnit_Framework_MockObject_Builder_InvocationMocker as Mocker;\nuse PHPUnit_Framework_MockObject_MockObject as Mock;\n\n/**\n * @method Mocker|Mock getMock($fqn, $methods = array(), $arguments = array())\n */\nabstract class AbstractUnitTestCase extends AbstractTestCase {\n\n  /**\n   * @var string\n   */\n  const FQN_ADAPTER_INTERFACE = '\\FacebookAds\\Http\\Adapter\\AdapterInterface';\n\n  /**\n   * @var string\n   */\n  const FQN_CLIENT = '\\FacebookAds\\Http\\Client';\n\n  /**\n   * @var string\n   */\n  const FQN_CURL_INTERFACE = '\\FacebookAds\\Http\\Adapter\\Curl\\CurlInterface';\n\n  /**\n   * @var string\n   */\n  const FQN_HEADERS = '\\FacebookAds\\Http\\Headers';\n\n  /**\n   * @var string\n   */\n  const FQN_LOGGER_INTERFACE = '\\FacebookAds\\Logger\\LoggerInterface';\n\n  /**\n   * @var string\n   */\n  const FQN_PARAMETERS = '\\FacebookAds\\Http\\Parameters';\n\n  /**\n   * @var string\n   */\n  const FQN_JSON_AWARE_PARAMETERS\n    = '\\FacebookAds\\Logger\\CurlLogger\\JsonAwareParameters';\n\n  /**\n   * @var string\n   */\n  const FQN_REQUEST_INTERFACE = '\\FacebookAds\\Http\\RequestInterface';\n\n  /**\n   * @var string\n   */\n  const FQN_RESPONSE_INTERFACE = '\\FacebookAds\\Http\\ResponseInterface';\n\n  /**\n   * @var string\n   */\n  const FQN_SESSION = '\\FacebookAds\\Session';\n\n  /**\n   * @var string\n   */\n  const VALUE_SESSION_APP_ID = '<APP_ID>';\n\n  /**\n   * @var string\n   */\n  const VALUE_SESSION_APP_SECRET = '<APP_SECRET>';\n\n  /**\n   * @var string\n   */\n  const VALUE_SESSION_ACCESS_TOKEN = '<ACCESS_TOKEN>';\n\n  /**\n   * @return Mocker|Mock|ResponseInterface\n   */\n  protected function createResponseMock() {\n    return $this->createMock(static::FQN_RESPONSE_INTERFACE);\n  }\n\n  /**\n   * @return Mocker|Mock|Client\n   */\n  protected function createClientMock() {\n    return $this->createMock(static::FQN_CLIENT);\n  }\n\n  /**\n   * @return Mocker|Mock|CurlInterface\n   */\n  protected function createCurlMock() {\n    return $this->createMock(static::FQN_CURL_INTERFACE);\n  }\n\n  /**\n   * @return Mocker|Mock|Headers\n   */\n  protected function createHeadersMock() {\n    return $this->createMock(static::FQN_HEADERS);\n  }\n\n  /**\n   * @return Mocker|Mock|LoggerInterface\n   */\n  protected function createLoggerMock() {\n    return $this->createMock(static::FQN_LOGGER_INTERFACE);\n  }\n\n  /**\n   * @return Mocker|Mock|Parameters\n   */\n  protected function createParametersMock() {\n    return $this->createMock(static::FQN_PARAMETERS);\n  }\n\n  /**\n   * @return Mocker|Mock|Parameters\n   */\n  protected function createJsonAwareParametersMock() {\n    return $this->createMock(static::FQN_JSON_AWARE_PARAMETERS);\n  }\n\n  /**\n   * @return Mocker|Mock|RequestInterface\n   */\n  protected function createRequestMock() {\n    return $this->createMock(static::FQN_REQUEST_INTERFACE);\n  }\n\n  /**\n   * @return Mocker|Mock|AdapterInterface\n   */\n  protected function createAdapterMock() {\n    return $this->createMock(static::FQN_ADAPTER_INTERFACE);\n  }\n\n  /**\n   * @return Mocker|Mock|Session\n   */\n  protected function createSessionMock() {\n    return $this->getMockBuilder(static::FQN_SESSION)\n                ->setConstructorArgs(array(\n                  static::VALUE_SESSION_APP_ID,\n                  static::VALUE_SESSION_APP_SECRET,\n                  static::VALUE_SESSION_ACCESS_TOKEN,\n                ))\n                ->getMock();\n  }\n}\n", "num_lines": 186}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest;\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\nuse FacebookAds\\Logger\\NullLogger;\n\nclass ApiTest extends AbstractUnitTestCase {\n\n  /**\n   * @return Api\n   */\n  protected function createApi() {\n    return new Api($this->createClientMock(), $this->createSessionMock());\n  }\n\n  public function testInstance() {\n    $this->assertNull(Api::instance());\n\n    $api = $this->createApi();\n    Api::setInstance($api);\n    $this->assertTrue($api === Api::instance());\n\n    $newApi = $this->createApi();\n    Api::setInstance($newApi);\n    $this->assertTrue($newApi === Api::instance());\n    $this->assertFalse($api === Api::instance());\n  }\n\n  public function testInit() {\n    $api = Api::init(\n      static::VALUE_SESSION_APP_ID,\n      static::VALUE_SESSION_APP_SECRET,\n      static::VALUE_SESSION_ACCESS_TOKEN,\n      false\n    );\n    $this->assertTrue($api instanceof Api);\n    $this->assertTrue($api === Api::instance());\n    $this->assertEquals(\n      static::VALUE_SESSION_APP_ID, $api->getSession()->getAppId());\n    $this->assertEquals(\n      static::VALUE_SESSION_APP_SECRET, $api->getSession()->getAppSecret());\n    $this->assertEquals(\n      static::VALUE_SESSION_ACCESS_TOKEN, $api->getSession()->getAccessToken());\n  }\n\n  public function testGetters() {\n    $client = $this->createClientMock();\n    $session = $this->createSessionMock();\n    $api = new Api($client, $session);\n    $this->assertTrue($api->getHttpClient() === $client);\n    $this->assertTrue($api->getSession() === $session);\n  }\n\n  public function testLogger() {\n    $api = $this->createApi();\n    $logger = $this->createLoggerMock();\n    $api->setLogger($logger);\n    $this->assertTrue($logger === $api->getLogger());\n\n    // Test default\n    $api = $this->createApi();\n    $this->assertTrue($api->getLogger() instanceof NullLogger);\n  }\n\n  public function testDefaultGraphVersion() {\n    $api = $this->createApi();\n    $api->setDefaultGraphVersion('<VERSION>');\n    $this->assertEquals('<VERSION>', $api->getDefaultGraphVersion());\n\n    // Test default\n    $api = $this->createApi();\n    $this->assertTrue(is_string($api->getDefaultGraphVersion()));\n    $this->assertRegExp('/^\\d+\\.\\d+$/', $api->getDefaultGraphVersion());\n  }\n\n  public function testCall() {\n    $request = $this->createRequestMock();\n    $request->method('execute')->willReturn($this->createResponseMock());\n    $request->method('getQueryParams')\n      ->willReturn($this->createParametersMock());\n    $request->method('getBodyParams')\n      ->willReturn($this->createParametersMock());\n    $request->expects($this->exactly(2))->method('setMethod')\n      ->with($this->logicalOr(\n        RequestInterface::METHOD_GET,\n        RequestInterface::METHOD_POST));\n    $request->expects($this->exactly(2))->method('setGraphVersion')\n      ->with($this->equalTo($this->createApi()->getDefaultGraphVersion()));\n    $request->expects($this->exactly(2))->method('setPath')\n      ->with($this->equalTo('/<PATH>'));\n\n    $client = $this->createClientMock();\n    $client->method('createRequest')->willReturn($request);\n\n    $session = $this->createSessionMock();\n    $session->method('getAppSecretProof')->willReturn('<APP_SECRET_PROOF>');\n    $session->method('getRequestParameters')->willReturn([]);\n\n    $logger = $this->createLoggerMock();\n    $logger->expects($this->exactly(2))->method('logRequest');\n    $logger->expects($this->exactly(2))->method('logResponse');\n\n    $api = new Api($client, $session);\n    $api->setLogger($logger);\n\n    // HTTP GET request\n    $request->expects($this->exactly(1))->method('getQueryParams');\n\n    $response = $api->call('/<PATH>');\n    $this->assertTrue($response instanceof ResponseInterface);\n\n    // HTTP POST request\n    $request->expects($this->exactly(1))->method('getBodyParams');\n\n    $api->call(\n      '/<PATH>', RequestInterface::METHOD_POST, array('param' => 'value'));\n    $this->assertTrue($response instanceof ResponseInterface);\n  }\n\n  public function testBase64UrlEncode() {\n    $this->assertEquals('MTIzNDU', Api::base64UrlEncode('12345'));\n  }\n}\n", "num_lines": 149}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest;\n\nuse FacebookAds\\Cursor;\n\nclass CursorDegradationTest extends CursorTest {\n\n  /**\n   * @return string\n   */\n  protected function getUniquePageId() {\n    return (string) (microtime(true) * 1000000);\n  }\n\n  /**\n   * @return array\n   */\n  protected function createSampleResponseContent() {\n    $url_fmt = $this->createUnparameterizedUrl()\n      .'?offset=%s';\n\n    $content = parent::createSampleResponseContent();\n    $content['paging'] = array(\n      'next' => sprintf($url_fmt, $this->getUniquePageId()),\n      'previous' => sprintf($url_fmt, $this->getUniquePageId()),\n    );\n\n    return $content;\n  }\n\n  public function testRequestParamReset() {\n    $response = $this->createResponseChainMock(1);\n    $cursor = new Cursor($response, $this->objectPrototype);\n    $params = $cursor->getLastResponse()->getRequest()->getQueryParams();\n    $params->offsetSet('offset', $this->getUniquePageId());\n\n    $cursor->fetchAfter();\n    $params2 = $cursor->getLastResponse()->getRequest()->getQueryParams();\n\n    $this->assertNotEquals(\n      $params->offsetGet('offset'), $params2->offsetGet('offset'));\n  }\n\n  public function testGetters() {\n    $response = $this->createResponseChainMock(1);\n    $cursor = new Cursor($response, $this->objectPrototype);\n\n    $this->assertTrue($response === $cursor->getResponse());\n    $this->assertTrue($response === $cursor->getLastResponse());\n    $this->assertNull($cursor->getAfter());\n    $this->assertNull($cursor->getBefore());\n  }\n}\n", "num_lines": 77}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest;\n\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\Parameters;\nuse FacebookAds\\Http\\Request;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAds\\Object\\AbstractObject;\nuse FacebookAds\\Cursor;\nuse FacebookAdsTest\\Object\\EmptyObject;\nuse \\PHPUnit_Framework_MockObject_Builder_InvocationMocker as Mock;\n\nclass CursorTest extends AbstractUnitTestCase {\n  /**\n   * @var EmptyObject\n   */\n  protected $objectPrototype;\n\n  /**\n   * @return array\n   */\n  protected function createEmptyResponseContent() {\n    return array('data' => array());\n  }\n\n\n  /**\n   * @return string\n   */\n  protected function getUniquePageId() {\n    return uniqid();\n  }\n\n  /**\n   * @return array\n   */\n  protected function createSampleResponseContent() {\n    $content = array(\n      'paging' => array(\n        'cursors' => array(\n          'after' => $this->getUniquePageId(),\n          'before' => $this->getUniquePageId(),\n        ),\n      ),\n    ) + $this->createEmptyResponseContent();\n\n    $count = rand(2, 5);\n    for ($i = 0; $i < $count; $i++) {\n      $content['data'][] = array(\n        AbstractCrudObject::FIELD_ID => $i,\n      );\n    }\n\n    return $content;\n  }\n\n  /**\n   * @return string\n   */\n  protected function createUnparameterizedUrl() {\n    return Request::PROTOCOL_HTTPS\n      .Client::DEFAULT_LAST_LEVEL_DOMAIN\n      .'.'.Client::DEFAULT_GRAPH_BASE_DOMAIN\n      .'/node/edge';\n  }\n\n  /**\n   * @param int $num_pages\n   * @param RequestInterface|null $prev\n   * @return Mock|ResponseInterface\n   */\n  protected function createResponseChainMock(\n    $num_pages, RequestInterface $prev = null) {\n\n    $query_params = $prev ? clone $prev->getQueryParams() : new Parameters();\n    $sample_content = $this->createSampleResponseContent();\n\n    $request = $this->createRequestMock();\n    $request->method('getMethod')->willReturn(RequestInterface::METHOD_GET);\n    $request->method('getQueryParams')->willReturn($query_params);\n\n    $response = $this->createResponseMock();\n    $response->method('getRequest')->willReturn($request);\n\n    $request->method('execute')->willReturn($response);\n\n    $callback = function() use ($num_pages, $sample_content) {\n      return $num_pages > 0\n        ? $sample_content\n        : $this->createEmptyResponseContent();\n    };\n\n    $clone_callback = function() use ($num_pages, $request) {\n      return $this->createResponseChainMock(\n        $num_pages - 1, $request)->getRequest();\n    };\n\n    $url_callback = function() use ($query_params) {\n      return $this->createUnparameterizedUrl().'?'\n        .http_build_query($query_params->getArrayCopy());\n    };\n\n    $response->method('getContent')->willReturnCallback($callback);\n    $request->method('createClone')->willReturnCallback($clone_callback);\n    $request->method('getUrl')->willReturnCallback($url_callback);\n\n    return $response;\n  }\n\n  /**\n   * @return Mock|ResponseInterface\n   */\n  protected function createEmptyResponseMock() {\n    $response = $this->createResponseMock();\n    $response->method('getContent')->willReturn(array(\n      'data' => array(),\n    ));\n\n    return $response;\n  }\n\n  public function setup(): void {\n    parent::setup();\n    $this->objectPrototype = new EmptyObject();\n  }\n\n  public function tearDown(): void {\n    $this->objectPrototype = null;\n    parent::tearDown();\n  }\n\n  public function testGetters() {\n    $response = $this->createResponseChainMock(1);\n    $cursor = new Cursor($response, $this->objectPrototype);\n\n    $this->assertTrue($response === $cursor->getResponse());\n    $this->assertTrue($response === $cursor->getLastResponse());\n    $this->assertTrue(is_string($cursor->getAfter()));\n    $this->assertTrue(is_string($cursor->getBefore()));\n    $this->assertNotEquals($cursor->getBefore(), $cursor->getAfter());\n  }\n\n  /**\n   * @return array\n   */\n  public function responseDataStructureProvider() {\n    return array(\n      array(array()),\n      array(array('data' => null)),\n      array(array('data' => 1)),\n    );\n  }\n\n  /**\n   * @dataProvider responseDataStructureProvider\n   * @param mixed $content\n   */\n  public function testResponseDataStructure($content) {\n    $response = $this->createResponseMock();\n    $response->method('getContent')->willReturn($content);\n\n    $this->expectException(\\InvalidArgumentException::class);\n\n    new Cursor($response, $this->objectPrototype);\n  }\n\n  public function testIterator() {\n    $cursor = new Cursor(\n      $this->createResponseChainMock(1), $this->objectPrototype);\n\n    $this->assertTrue($cursor instanceof \\Iterator);\n\n    $k = 0;\n\n    foreach ($cursor as $key => $value) {\n      if ($key != $k) {\n        $this->fail('iteration count missmatch $key');\n      }\n      ++$k;\n    }\n\n    $this->assertEquals($k, count($cursor));\n\n    $cursor->rewind();\n\n    $this->assertEquals(0, $cursor->key());\n    $cursor->next();\n    $this->assertEquals(1, $cursor->key());\n    $cursor->prev();\n    $this->assertEquals(0, $cursor->key());\n\n    $this->assertEquals($cursor->getIndexLeft(), 0);\n    $this->assertEquals($cursor->getIndexRight(), count($cursor) - 1);\n  }\n\n  public function testCountable() {\n    $response = $this->createResponseChainMock(1);\n    $cursor = new Cursor($response, $this->objectPrototype);\n\n    $this->assertTrue($cursor instanceof \\Countable);\n    $this->assertEquals($cursor->count(), count($cursor));\n    $this->assertEquals(\n      $cursor->count(), count($response->getContent()['data']));\n  }\n\n  public function testArrayAccess() {\n    $response = $this->createResponseChainMock(1);\n    $test_index = rand(1, count($response->getContent()) - 1);\n\n    $cursor = new Cursor($response, $this->objectPrototype);\n\n    $this->assertTrue($cursor instanceof \\arrayaccess);\n\n    $subject = new EmptyObject();\n    $subject->setData($response->getContent()['data'][$test_index]);\n\n    // Checking offsetGet\n    $this->assertEquals($cursor[$test_index]->getData(), $subject->getData());\n    // Checking offsetExists\n    $this->assertFalse(isset($cursor[count($cursor)]));\n    // Checking offsetUnset\n    unset($cursor[$test_index]);\n    $this->assertNull($cursor[$test_index]);\n    // Checking offsetSet\n    $cursor->offsetSet($test_index, $subject);\n    $this->assertEquals($cursor[$test_index]->getData(), $subject->getData());\n    // Checking offsetSet - append\n    $count = count($cursor);\n    $cursor->offsetSet(null, new EmptyObject());\n    $this->assertEquals(count($cursor), $count + 1);\n  }\n\n  public function testUnneededFetch() {\n    $response = $this->createEmptyResponseMock();\n    $cursor = new Cursor($response, $this->objectPrototype);\n    $this->assertNull($cursor->createBeforeRequest());\n    $this->assertNull($cursor->createAfterRequest());\n\n    // Reset for proper fetching\n    $response = $this->createEmptyResponseMock();\n    $cursor = new Cursor($response, $this->objectPrototype);\n    $length = $cursor->count();\n    $cursor->fetchBefore();\n    $this->assertEquals($length, $cursor->count());\n    $cursor->fetchAfter();\n    $this->assertEquals($length, $cursor->count());\n  }\n\n  public function testIterability() {\n    $response = $this->createResponseChainMock(1);\n    $cursor = new Cursor($response, $this->objectPrototype);\n\n    $cursor->next();\n    $cursor->rewind();\n    $this->assertEquals($cursor->getIndexLeft(), $cursor->key());\n\n    $cursor->end();\n    $this->assertEquals($cursor->getIndexRight(), $cursor->key());\n\n    $index = rand($cursor->getIndexLeft(), $cursor->getIndexRight());\n    $cursor->seekTo($index);\n    $this->assertEquals($index, $cursor->key());\n\n    // Fetch after\n    $cursor = new Cursor($response, $this->objectPrototype);\n    $cursor->fetchAfter();\n    $this->assertFalse($response === $cursor->getLastResponse());\n  }\n\n  public function testRequestParamReset() {\n    $response = $this->createResponseChainMock(1);\n    $cursor = new Cursor($response, $this->objectPrototype);\n    $params = $cursor->getLastResponse()->getRequest()->getQueryParams();\n    $params->offsetSet('after', $this->getUniquePageId());\n    $params->offsetSet('before', $this->getUniquePageId());\n\n    $cursor->fetchAfter();\n    $params2 = $cursor->getLastResponse()->getRequest()->getQueryParams();\n    $this->assertNotEquals(\n      $params->offsetGet('after'), $params2->offsetGet('after'));\n  }\n\n  public function testImplicitFetch() {\n    // Test setters/getters\n    $response = $this->createEmptyResponseMock();\n    $cursor = new Cursor($response, $this->objectPrototype);\n\n    $this->assertFalse(Cursor::getDefaultUseImplicitFetch());\n    $this->assertFalse($cursor->getUseImplicitFetch());\n    $cursor->setUseImplicitFetch(true);\n    $this->assertTrue($cursor->getUseImplicitFetch());\n\n    Cursor::setDefaultUseImplicitFetch(true);\n\n    $response = $this->createEmptyResponseMock();\n    $cursor = new Cursor($response, $this->objectPrototype);\n    $this->assertTrue(Cursor::getDefaultUseImplicitFetch());\n    $this->assertTrue($cursor->getUseImplicitFetch());\n\n    // Test ordered iteration\n    // f() lower interval * min repetition > upper interval\n    // Min repetition > upper interval / lower interval -> f(x): x > 5 / 2 -> 3\n    $response = $this->createResponseChainMock(3);\n    $cursor = new Cursor($response, $this->objectPrototype);\n    while ($cursor->valid()) {\n      $cursor->next();\n    }\n\n    // Min upper boundary = upper interval + 1 = 5 + 1 = 6\n    $this->assertGreaterThanOrEqual(6, $cursor->count());\n\n    // Test rervese iteration\n    // same f()\n    $response = $this->createResponseChainMock(3);\n    $cursor = new Cursor($response, $this->objectPrototype);\n\n    $count = 0;\n    while ($cursor->valid()) {\n      $cursor->prev();\n    }\n\n    $this->assertGreaterThanOrEqual(6, $cursor->count());\n\n    // Force the array out of boundaries\n    $response = $this->createResponseChainMock(1);\n    $cursor = new Cursor($response, $this->objectPrototype);\n    $cursor->setUseImplicitFetch(false);\n    $cursor->prev();\n\n    // Restore static behaviour\n    Cursor::setDefaultUseImplicitFetch(false);\n  }\n\n  public function testExportability() {\n    $response = $this->createResponseChainMock(1);\n    $cursor = new Cursor($response, $this->objectPrototype);\n    $array_copy = $cursor->getArrayCopy();\n\n    $this->assertTrue(is_array($array_copy));\n    $this->assertEquals($cursor->getArrayCopy(), $cursor->getObjects());\n    $this->assertEquals(\n      count($array_copy), count($response->getContent()['data']));\n\n    foreach ($array_copy as $object) {\n      if (!$object instanceof AbstractObject) {\n        $this->fail(\"Wrong instance in array copy\");\n      }\n    }\n\n    $cursor->fetchAfter();\n    $cursor->fetchBefore();\n\n    $index = $cursor->getIndexLeft();\n    // Test in-memory order while exporting\n    foreach ($cursor->getArrayCopy(true) as $key => $object) {\n      if ($key < $index) {\n        $this->fail(\"Wrong order in sorted array copy\");\n      }\n    }\n  }\n}\n", "num_lines": 387}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest;\n\nuse FacebookAds\\Session;\n\nclass SessionTest extends AbstractUnitTestCase {\n\n  /**\n   * @return Session\n   */\n  protected function createSession() {\n    return new Session(\n      static::VALUE_SESSION_APP_ID,\n      static::VALUE_SESSION_APP_SECRET,\n      static::VALUE_SESSION_ACCESS_TOKEN);\n  }\n\n  public function testGetters() {\n    $session = $this->createSession();\n\n    $this->assertEquals(\n      static::VALUE_SESSION_APP_ID, $session->getAppId());\n    $this->assertEquals(\n      static::VALUE_SESSION_APP_SECRET, $session->getAppSecret());\n    $this->assertEquals(\n      static::VALUE_SESSION_ACCESS_TOKEN, $session->getAccessToken());\n  }\n\n  public function testAppSecretProof() {\n    $session = $this->createSession();\n    $proof = $session->getAppSecretProof();\n\n    // Assert SHA-2 > 256 bits > 64 chars\n    $this->assertTrue(strlen($proof) == 64);\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Bootstrap;\n\nuse FacebookAdsTest\\Config\\Config;\n\nclass Bootstrap {\n\n  /**\n   * @var self\n   */\n  private static $instance;\n\n  /**\n   * @var bool\n   */\n  private $isIntialized = false;\n\n  /**\n   * @var array|null\n   */\n  protected $configData;\n\n  /**\n   * @var Config|null\n   */\n  protected $config;\n\n  /**\n   * @var mixed\n   */\n  protected $autoloader;\n\n  /**\n   * @throws \\LogicException\n   */\n  final public function __construct() {\n    if (self::$instance !== null) {\n      throw new \\LogicException(\"Bootstrap already instanciated\");\n    }\n\n    self::$instance = $this;\n  }\n\n  /**\n   * @return string\n   */\n  protected function getComposerAutoloadPath() {\n    return __DIR__.'/../../../vendor/autoload.php';\n  }\n\n  /**\n   * @return mixed\n   */\n  public function getAutoloader() {\n    if ($this->autoloader === null) {\n      $autoload_path = $this->getComposerAutoloadPath();\n      if (!is_readable($autoload_path)) {\n        throw new \\RuntimeException(\"Could not read \".$autoload_path);\n      }\n      $this->autoloader = include $autoload_path;\n      $this->autoloader->addPsr4('FacebookAdsTest\\\\', __DIR__.'/../');\n    }\n\n    return $this->autoloader;\n  }\n\n  /**\n   * Simplifies the common pattern of checking for an index in an array\n   * and selecting a default value if it does not exist\n   *\n   * @param array $array\n   * @param string|int $key\n   * @param mixed $default\n   * @return mixed\n   */\n  protected function idx(array $array, $key, $default = null) {\n    return array_key_exists($key, $array) && $array[$key] !== ''\n      ? $array[$key]\n      : $default;\n  }\n\n  /**\n   * Simplifies the common pattern of checking for an index in an array\n   * and throw an exception if not\n   *\n   * @param array $array\n   * @param string|int $key\n   * @return mixed\n   * @throws \\Exception\n   */\n  protected function idxt(array $array, $key) {\n    if (!array_key_exists($key, $array) || !$array[$key]) {\n      throw new \\Exception(\"Missing mandatory config '{$key}'\");\n    }\n\n    return $array[$key];\n  }\n\n  /**\n   * @return Config\n   */\n  public function getConfig() {\n    if ($this->config === null) {\n      $this->config = new Config();\n      $this->config->testRunId\n        = md5($this->idx($_SERVER, 'LOGNAME', uniqid(true)).microtime(true));\n      $this->config->testImagePath = __DIR__.'/../../misc/image.png';\n      $this->config->testZippedImagesPath = __DIR__.'/../../misc/images.zip';\n      $this->config->testVideoPath = __DIR__.'/../../misc/video.mp4';\n    }\n\n    return $this->config;\n  }\n\n  /**\n   * @throws \\LogicException\n   */\n  public function init() {\n    if ($this->isIntialized) {\n      throw new \\LogicException(\"Bootstrap already initialized\");\n    }\n\n    $this->getAutoloader();\n    Config::setInstance($this->getConfig());\n  }\n}\n", "num_lines": 150}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Bootstrap;\n\nuse FacebookAdsTest\\Config\\Config;\nuse FacebookAdsTest\\Config\\SkippableFeaturesManager;\n\nclass IntegrationBootstrap extends Bootstrap {\n\n  /**\n   * @param string $file_path\n   * @return array\n   * @throws \\RuntimeException\n   */\n  protected function loadConfigData($file_path) {\n    if (!is_readable($file_path)) {\n      throw new \\RuntimeException(\"Could not read {$file_path}\");\n    }\n\n    $data = require $file_path;\n    if (!is_array($data)) {\n      throw new \\RuntimeException(\"Invalid config structure\");\n    }\n\n    return $data;\n  }\n\n  /**\n   * @return array\n   */\n  protected function getConfigData() {\n    if ($this->configData === null) {\n      $this->configData = $this->loadConfigData(__DIR__.'/../../config.php');\n    }\n\n    return $this->configData;\n  }\n\n  /**\n   * @param string|int $key\n   * @param mixed $default\n   * @return mixed\n   */\n  protected function confx($key, $default = null) {\n    return $this->idx($this->getConfigData(), $key, $default);\n  }\n\n  /**\n   * @param string|int $key\n   * @return mixed\n   * @throws \\Exception\n   */\n  protected function confxt($key) {\n    return $this->idxt($this->getConfigData(), $key);\n  }\n\n  /**\n   * @return Config\n   */\n  protected function getUnitConfig() {\n    return parent::getConfig();\n  }\n\n  /**\n   * @return Config\n   */\n  public function getConfig() {\n    if ($this->config === null) {\n      $this->config = parent::getConfig();\n      $this->config->appId = $this->confx('app_id');\n      $this->config->appSecret = $this->confx('app_secret');\n      $this->config->accessToken = $this->confx('access_token');\n      $this->config->accountId = $this->confx('act_id');\n      $this->config->pageId = $this->confx('page_id');\n      $this->config->appUrl = $this->confx('app_url');\n      $this->config->businessId = $this->confx('business_id');\n      $this->config->instagramActorId = $this->confx('instagram_actor_id');\n\n      // Optionals: Override unit config\n      $this->config->testRunId = $this->confx(\n        'test_run_id', $this->config->testRunId);\n      $this->config->testImagePath = $this->confx(\n        'test_image_path', $this->config->testImagePath);\n      $this->config->testZippedImagesPath = $this->confx(\n        'test_zipped_images_path', $this->config->testZippedImagesPath);\n      $this->config->testVideoPath = $this->confx(\n        'test_video_path', $this->config->testVideoPath);\n\n      // Optionals\n      $this->config->secondaryBusinessId\n        = $this->confx('secondary_business_id', '');\n      $this->config->secondaryAccountId\n        = $this->confx('secondary_account_id', '');\n      $this->config->secondaryPageId = $this->confx('secondary_page_id', '');\n      $this->config->secondaryAppId = $this->confx('secondary_app_id', '');\n      $this->config->graphBaseDomain = $this->confx('graph_base_domain');\n      $this->config->skipSslVerification\n        = $this->confx('skip_ssl_verification', false);\n      $this->config->curlLogger = $this->confx('curl_logger');\n\n      SkippableFeaturesManager::setInstance(\n        new SkippableFeaturesManager($this->confx('skip_if', array())));\n    }\n\n    return $this->config;\n  }\n}\n", "num_lines": 130}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Config;\n\nfinal class Config {\n\n  /**\n   * @var self\n   */\n  protected static $instance;\n\n  /**\n   * @var string\n   */\n  public $testRunId;\n\n  /**\n   * @var string\n   */\n  public $testImagePath;\n\n  /**\n   * @var string\n   */\n  public $testZippedImagesPath;\n\n  /**\n   * @var string\n   */\n  public $testVideoPath;\n\n  /**\n   * @var string\n   */\n  public $curlLogger;\n\n  /**\n   * @var string\n   */\n  public $appId;\n\n  /**\n   * @var string\n   */\n  public $appSecret;\n\n  /**\n   * @var string\n   */\n  public $accessToken;\n\n  /**\n   * @var string\n   */\n  public $businessId;\n\n  /**\n   * @var string\n   */\n  public $accountId;\n\n  /**\n   * @var string\n   */\n  public $pageId;\n\n  /**\n   * @var string\n   */\n  public $appUrl;\n\n  /**\n   * @var string\n   */\n  public $instagramActorId;\n\n  /**\n   * @var string\n   */\n  public $secondaryBusinessId;\n\n  /**\n   * @var string\n   */\n  public $secondaryPageId;\n\n  /**\n   * @var string\n   */\n  public $secondaryAccountId;\n\n  /**\n   * @var string\n   */\n  public $secondaryAppId;\n\n  /**\n   * @var string\n   */\n  public $graphBaseDomain;\n\n  /**\n   * @var bool\n   */\n  public $skipSslVerification;\n\n  /**\n   * @return Config\n   */\n  public static function instance() {\n    return self::$instance ?: (self::$instance = new self());\n  }\n\n  /**\n   * @param Config $config\n   */\n  public static function setInstance(Config $config) {\n    self::$instance = $config;\n  }\n\n  /**\n   * @param string $key\n   * @param string $value\n   */\n  public function __set($key, $value) {\n    throw new \\RuntimeException(\"Unsupported key: {$key}\");\n  }\n}\n", "num_lines": 151}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Config;\n\nuse FacebookAdsTest\\AbstractTestCase;\n\nfinal class SkippableFeaturesManager {\n\n  /**\n   * @var SkippableFeaturesManager\n   */\n  private static $instance;\n\n  /**\n   * @var array\n   */\n  protected $data = array();\n\n  /**\n   * @return SkippableFeaturesManager\n   */\n  public static function instance() {\n    return self::$instance ?: (self::$instance = new self());\n  }\n\n  /**\n   * @param SkippableFeaturesManager $manager\n   */\n  public static function setInstance(SkippableFeaturesManager $manager) {\n    self::$instance = $manager;\n  }\n\n  /**\n   * @param array $data\n   */\n  public function __construct(array $data = array()) {\n    $this->setData($data);\n  }\n\n  public function setData(array $data = array()) {\n    $this->data = $data;\n  }\n\n  /**\n   * @return array\n   */\n  public function getData() {\n    return $this->data;\n  }\n\n  /**\n   * @param $key\n   * @return bool\n   */\n  public function isSkipKey($key) {\n    return array_key_exists($key, $this->data) && $this->data[$key];\n  }\n\n  /**\n   * @param AbstractTestCase $test\n   * @return bool\n   */\n  public function enforceSkipTest(AbstractTestCase $test) {\n    if ($test instanceof SkippableFeatureTestInterface) {\n      foreach ($test->skipIfAny() as $key) {\n        if ($this->isSkipKey($key)) {\n          /** @var AbstractTestCase $test */\n          $test->markTestSkipped(\"Reason: skipped by config '{$key}'\");\n        }\n      }\n    }\n  }\n}\n", "num_lines": 96}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Config;\n\ninterface SkippableFeatureTestInterface {\n\n  /**\n   * @return array\n   */\n  public function skipIfAny();\n}\n", "num_lines": 34}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Enum;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\nclass DummyEnum extends AbstractEnum {\n\n  const NAME_1 = 'VALUE_1';\n  const NAME_2 = 'VALUE_2';\n}\n", "num_lines": 34}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Enum;\n\nuse FacebookAds\\Enum\\EmptyEnum;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass EnumTest extends AbstractUnitTestCase {\n\n  public function testSingleton() {\n    $this->assertTrue(DummyEnum::getInstance() === DummyEnum::getInstance());\n  }\n\n  public function testAccess() {\n    $this->assertEquals(DummyEnum::className(), get_class(new DummyEnum()));\n\n    $enum = DummyEnum::getInstance();\n    $copy = $enum->getArrayCopy();\n    $names = $enum->getNames();\n    $values = $enum->getValues();\n    $values_map = $enum->getValuesMap();\n\n    $this->assertEquals(2, count($copy));\n    $this->assertArrayHasKey('NAME_1', $copy);\n    $this->assertEquals(DummyEnum::NAME_1, $copy['NAME_1']);\n\n    $this->assertEquals(2, count($names));\n    $this->assertTrue(in_array('NAME_1', $names));\n\n    $this->assertEquals(2, count($values));\n    $this->assertTrue(in_array(DummyEnum::NAME_1, $values));\n\n    $this->assertEquals(2, count($values_map));\n    $this->assertArrayHasKey(DummyEnum::NAME_1, $values_map);\n\n    $this->assertEquals(DummyEnum::NAME_1, $enum->getValueForName('NAME_1'));\n  }\n\n  public function testLazyLoading() {\n    $enum = DummyEnum::getInstance();\n\n    $this->assertTrue($enum->getArrayCopy() === $enum->getArrayCopy());\n    $this->assertTrue($enum->getNames() === $enum->getNames());\n    $this->assertTrue($enum->getValues() === $enum->getValues());\n    $this->assertTrue($enum->getValuesMap() === $enum->getValuesMap());\n  }\n\n  public function testValidation() {\n    $enum = DummyEnum::getInstance();\n\n    $this->assertTrue($enum->isValid('NAME_1'));\n    $this->assertFalse($enum->isValid('NAME_ND'));\n    $this->assertTrue($enum->isValidValue(DummyEnum::NAME_1));\n    $this->assertFalse($enum->isValidValue('VALUE_ND'));\n  }\n\n\n  public function testAssurance() {\n    $enum = DummyEnum::getInstance();\n\n    $this->assertEquals(DummyEnum::NAME_1, $enum->assureValueForName('NAME_1'));\n    $this->assertWillThrow(function() use ($enum) {\n      $enum->assureValueForName('NAME_ND');\n    }, 'InvalidArgumentException');\n\n    $enum->assureIsValid('NAME_1');\n    $this->assertWillThrow(function() use ($enum) {\n      $enum->assureIsValid('NAME_ND');\n    }, 'InvalidArgumentException');\n\n    $enum->assureIsValidValue(DummyEnum::NAME_1);\n    $this->assertWillThrow(function() use ($enum) {\n      $enum->assureIsValidValue('VALUE_ND');\n    }, 'InvalidArgumentException');\n  }\n\n  public function testEmptyEnum() {\n    $enum = EmptyEnum::getInstance();\n\n    $this->assertEquals(array(), $enum->getArrayCopy());\n    $this->assertEquals(array(), $enum->getNames());\n    $this->assertEquals(array(), $enum->getValues());\n    $this->assertEquals(array(), $enum->getValuesMap());\n  }\n}\n", "num_lines": 108}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Exception;\n\nuse FacebookAds\\Http\\Exception\\RequestException;\n\nclass PHPUnitRequestExceptionWrapper\n  extends \\PHPUnit_Framework_ExceptionWrapper {\n\n  /**\n   * @var RequestException\n   */\n  protected $wrappedException;\n\n  /**\n   * @param RequestException $e\n   */\n  public function __construct(RequestException $e) {\n    $this->wrappedException = $e;\n    parent::__construct($e);\n  }\n\n  /**\n   * @return RequestException\n   */\n  public function getWrappedException() {\n    return $this->wrappedException;\n  }\n\n  protected function requestToString(RequestException $e) {\n    if ($e->getResponse() === null) {\n      return '-';\n    }\n\n    $request = $e->getResponse()->getRequest();\n\n    return sprintf(\n      \"%s %s\\n%s\",\n      $request->getMethod(),\n      $request->getUrl(),\n      \"    \".str_replace(\"\\n\", \"\\n    \", json_encode(\n        $request->getFileParams()->getArrayCopy()\n          + $request->getBodyParams()->getArrayCopy(),\n        JSON_PRETTY_PRINT)));\n  }\n\n  /**\n   * @return string\n   */\n  protected function blameFieldSpecsToString() {\n    return implode(\", \", array_map(function($value) {\n      return $value[0];\n    }, $this->getWrappedException()->getErrorBlameFieldSpecs()));\n  }\n\n  /**\n   * @return string\n   */\n  public function __toString() {\n    $string = \\PHPUnit_Framework_TestFailure::exceptionToString($this);\n\n    $e = $this->getWrappedException();\n\n    $string .= \"\\n  Request: \".$this->requestToString($e).\"\\n\"\n      .\"  HTTP status Code: \".$e->getHttpStatusCode().\"\\n\"\n      .\"  Is transient: \".($e->isTransient() ? 'true' : 'false').\"\\n\"\n      .\"  Code: \".$e->getCode().\"\\n\"\n      .\"  Error Subcode: \".$e->getErrorSubcode().\"\\n\"\n      .\"  Error User Title: \".$e->getErrorUserTitle().\"\\n\"\n      .\"  Error User Message: \".$e->getErrorUserMessage().\"\\n\";\n\n    if ($e->getErrorBlameFieldSpecs()) {\n      $string .= \"  Error Blame Fields: \".$this->blameFieldSpecsToString().\"\\n\";\n    }\n\n    if ($trace = \\PHPUnit_Util_Filter::getFilteredStacktrace($this)) {\n      $string .= \"\\n\" . $trace;\n    }\n\n    if ($this->previous) {\n      $string .= \"\\nCaused by\\n\" . $this->previous;\n    }\n\n    return $string;\n  }\n}\n", "num_lines": 109}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Http;\n\nuse FacebookAds\\ApiConfig;\nuse FacebookAds\\Http\\Adapter\\AdapterInterface;\nuse FacebookAds\\Http\\Adapter\\CurlAdapter;\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\Exception\\EmptyResponseException;\nuse FacebookAds\\Http\\Exception\\RequestException;\nuse FacebookAds\\Http\\Headers;\nuse FacebookAds\\Http\\Request;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\Response;\nuse FacebookAds\\Http\\ResponseInterface;\nuse FacebookAdsTest\\AbstractUnitTestCase;\nuse \\PHPUnit_Framework_MockObject_Builder_InvocationMocker as Mock;\n\nclass ClientTest extends AbstractUnitTestCase {\n\n  /**\n   * @param mixed $response_content\n   * @return Mock|AdapterInterface\n   */\n  protected function createMockChain($response_content) {\n    $adapter = $this->createAdapterMock();\n    $response = $this->createResponseMock();\n    $response->method('getContent')->willReturn($response_content);\n    $adapter->method('sendRequest')->willReturn($response);\n\n    return $adapter;\n  }\n\n  public function testPrototypes() {\n    $client = new Client();\n\n    $request_proto = $this->createRequestMock();\n    $request_proto->method('createClone')->willReturnSelf();\n    $client->setRequestPrototype($request_proto);\n    $this->assertTrue($request_proto === $client->getRequestPrototype());\n    $this->assertTrue($client->createRequest() instanceof RequestInterface);\n\n    $response_proto = $this->createResponseMock();\n    $client->setResponsePrototype($response_proto);\n    $this->assertTrue($response_proto === $client->getResponsePrototype());\n    $this->assertTrue($client->createResponse() instanceof ResponseInterface);\n\n    // Default initialization\n    $client = new Client();\n    $this->assertTrue($client->getRequestPrototype() instanceof Request);\n    $this->assertTrue($client->getResponsePrototype() instanceof Response);\n  }\n\n  public function testHeaders() {\n    $headers = new Headers();\n    $this->assertTrue($headers instanceof \\IteratorAggregate);\n    $this->assertTrue($headers instanceof \\Traversable);\n    $this->assertTrue($headers instanceof \\ArrayAccess);\n    $this->assertTrue($headers instanceof \\Serializable);\n    $this->assertTrue($headers instanceof \\Countable);\n\n    $client = new Client();\n    $client->setDefaultRequestHeaders($headers);\n    $this->assertTrue($headers === $client->getDefaultRequestHeaders());\n\n    // Default initialization\n    $client = new Client();\n    $headers = $client->getDefaultRequestHeaders();\n    $this->assertTrue($headers instanceof Headers);\n    $this->assertTrue($headers === $client->getDefaultRequestHeaders());\n    $this->assertArrayHasKey('User-Agent', $headers);\n    $this->assertEquals('fbbizsdk-php-v'.ApiConfig::SDKVersion, $headers['User-Agent']);\n  }\n\n  public function testDomain() {\n    $client = new Client();\n    $this->assertEquals(\n      Client::DEFAULT_GRAPH_BASE_DOMAIN, $client->getDefaultGraphBaseDomain());\n\n    $domain = 'not.facebook.com';\n    $client->setDefaultGraphBaseDomain($domain);\n    $this->assertEquals($domain, $client->getDefaultGraphBaseDomain());\n  }\n\n  public function testAdapter() {\n    $client = new Client();\n\n    $adapter = $this->createAdapterMock();\n    $client->setAdapter($adapter);\n    $this->assertTrue($client->getAdapter() instanceof AdapterInterface);\n    $this->assertTrue($adapter === $client->getAdapter());\n\n    // Default initialization\n    $client = new Client();\n    $this->assertTrue($client->getAdapter() instanceof CurlAdapter);\n  }\n\n  public function testCaBundlePath() {\n    $client = new Client();\n    $path = '/tmp/dont_care_if_exists';\n    $client->setCaBundlePath($path);\n    $this->assertEquals($path, $client->getCaBundlePath());\n\n    // Default initialization\n    $client = new Client();\n    $this->assertFalse(!$client->getCaBundlePath());\n    $this->assertFileExists($client->getCaBundlePath());\n  }\n\n  public function testSendRequest() {\n    $client = new Client();\n\n    // Empty response > json_decode('') = null\n    $client->setAdapter($this->createMockChain(null));\n\n    $exception_catched = false;\n    try {\n      $client->sendRequest($this->createRequestMock());\n    } catch (EmptyResponseException $e) {\n      $exception_catched = true;\n    }\n    $this->assertTrue($exception_catched);\n\n    // Error payload\n    $client->setAdapter($this->createMockChain(array(\n      'error' => array(\n        'message' => 'Stub Server Error Message',\n        'type' => 'FacebookApiException',\n        'code' => 1,\n      ),\n    )));\n\n    $exception_catched = false;\n    try {\n      $client->sendRequest($this->createRequestMock());\n    } catch (EmptyResponseException $e) {\n      $this->fail(\"Catched wrong RequestException\");\n    } catch (RequestException $e) {\n      $exception_catched = true;\n    }\n    $this->assertTrue($exception_catched);\n\n    // Success\n    $client->setAdapter($this->createMockChain(array(\n      'id' => 4,\n    )));\n\n    $response = $client->sendRequest($this->createRequestMock());\n    $this->assertTrue($response instanceof ResponseInterface);\n    $content = $response->getContent();\n    $this->assertArrayHasKey('id', $content);\n    $this->assertEquals($content['id'], 4);\n  }\n}\n", "num_lines": 177}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Http;\n\nuse FacebookAds\\Http\\FileParameter;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass FileParameterTest extends AbstractUnitTestCase {\n\n  public function testGetters() {\n    $path = 'PATH';\n    $name = 'NAME';\n    $mime_type = 'MIME_TYPE';\n    $param = (new FileParameter($path))\n      ->setName($name)\n      ->setMimeType($mime_type);\n\n    $this->assertEquals($param->getPath(), $path);\n    $this->assertEquals($param->getName(), $name);\n    $this->assertEquals($param->getMimeType(), $mime_type);\n  }\n}\n", "num_lines": 45}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Http;\n\nuse FacebookAds\\Http\\Parameters;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass ParametersTest extends AbstractUnitTestCase {\n\n  public function testInterfaces() {\n    $parameters = new Parameters();\n    $this->assertTrue($parameters instanceof \\IteratorAggregate);\n    $this->assertTrue($parameters instanceof \\Traversable);\n    $this->assertTrue($parameters instanceof \\ArrayAccess);\n    $this->assertTrue($parameters instanceof \\Serializable);\n    $this->assertTrue($parameters instanceof \\Countable);\n  }\n\n  public function testEnhance() {\n    $parameters = new Parameters();\n    $copy = $parameters->getArrayCopy();\n\n    $data = array(\n      'foo' => 0,\n      'bar' => 1,\n    );\n\n    $copy = array_merge($copy, $data);\n    $parameters->enhance($data);\n    $this->assertEquals($copy, $parameters->getArrayCopy());\n\n    $data = array(\n      'bar' => -1,\n      'baz' => 2,\n    );\n\n    $copy = array_merge($copy, $data);\n    $parameters->enhance($data);\n    $this->assertEquals($copy, $parameters->getArrayCopy());\n  }\n\n  public function testExport() {\n    $parameters = new Parameters();\n    $parameters['scalar'] = 1;\n    $parameters['non_scalar'] = array(0, '1', true);\n    $data = $parameters->export();\n    $this->assertArrayHasKey('scalar', $data);\n    $this->assertEquals(1, $data['scalar']);\n    $this->assertArrayHasKey('non_scalar', $data);\n    $this->assertEquals('[0,\"1\",true]', $data['non_scalar']);\n  }\n}\n", "num_lines": 75}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Http;\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\Headers;\nuse FacebookAds\\Http\\Parameters;\nuse FacebookAds\\Http\\Request;\nuse FacebookAds\\Http\\ResponseInterface;\nuse FacebookAds\\Http\\Util;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass RequestTest extends AbstractUnitTestCase {\n\n  /**\n   * @return Request\n   */\n  protected function createRequest() {\n    return new Request($this->createClientMock());\n  }\n\n  public function testGetters() {\n    $client = $this->createClientMock();\n    $request = new Request($client);\n\n    $this->assertTrue($request->getClient() instanceof Client);\n    $this->assertTrue($client === $request->getClient());\n  }\n\n  public function testProtocol() {\n    $request = $this->createRequest();\n    $protocol = Request::PROTOCOL_HTTP;\n    $request->setProtocol($protocol);\n    $this->assertEquals($protocol, $request->getProtocol());\n  }\n\n  public function testDomain() {\n    $request = $this->createRequest();\n    $domain = 'not.facebook.com';\n    $request->setDomain($domain);\n    $this->assertEquals($domain, $request->getDomain());\n\n    // Default initialization\n    $client = $this->createClientMock();\n    $client->method('getDefaultGraphBaseDomain')\n      ->willReturn('not.facebook.com');\n    $request = new Request($client);\n    $domain = $request->getDomain();\n    $this->assertRegExp('/.+\\.not\\.facebook\\.com/', $domain);\n    $this->assertEquals($domain, $request->getDomain());\n\n    // Partially set\n    $client = $this->createClientMock();\n    $client->method('getDefaultGraphBaseDomain')\n      ->willReturn('probably.not.facebook.com');\n    $request = new Request($client);\n    $request->setLastLevelDomain('most');\n    $domain = $request->getDomain();\n    $this->assertEquals('most.probably.not.facebook.com', $domain);\n    $this->assertEquals($domain, $request->getDomain());\n  }\n\n  public function testHeaders() {\n    $client = $this->createClientMock();\n    $request = new Request($client);\n    $headers = $this->createHeadersMock();\n    $client->setDefaultRequestHeaders($headers);\n    $request->setHeaders($headers);\n    $headers_mirror = $request->getHeaders();\n    $this->assertTrue($headers_mirror instanceof Headers);\n    $this->assertTrue($headers_mirror === $request->getHeaders());\n\n    // Default initialization\n    $headers = new Headers();\n    $client = $this->createClientMock();\n    $client->method('getDefaultRequestHeaders')->willReturn($headers);\n    $request = new Request($client);\n    $headers_mirror = $request->getHeaders();\n    $this->assertTrue($headers_mirror instanceof Headers);\n    $this->assertFalse($headers === $request->getHeaders());\n    $this->assertTrue($headers_mirror === $request->getHeaders());\n  }\n\n  public function testMethod() {\n    $request = $this->createRequest();\n    $method = Request::METHOD_GET;\n    $request->setMethod($method);\n    $this->assertEquals($method, $request->getMethod());\n  }\n\n  public function testPath() {\n    $request = $this->createRequest();\n    $path = '/node/edge';\n    $request->setPath($path);\n    $this->assertEquals($path, $request->getPath());\n  }\n\n  public function testGraphVersion() {\n    $request = $this->createRequest();\n    $graph_version = Api::VERSION;\n    $request->setGraphVersion($graph_version);\n    $this->assertEquals($graph_version, $request->getGraphVersion());\n  }\n\n  public function testQueryParams() {\n    $request = $this->createRequest();\n    $parameters = $this->createParametersMock();\n    $request->setQueryParams($parameters);\n    $this->assertTrue($request->getQueryParams() instanceof Parameters);\n    $this->assertTrue($parameters === $request->getQueryParams());\n\n    // Default initialization\n    $request = $this->createRequest();\n    $parameters = $request->getQueryParams();\n    $this->assertTrue($parameters instanceof Parameters);\n    $this->assertTrue($parameters === $request->getQueryParams());\n  }\n\n  public function testBodyParams() {\n    $request = $this->createRequest();\n    $parameters = $this->createParametersMock();\n    $request->setBodyParams($parameters);\n    $this->assertTrue($request->getBodyParams() instanceof Parameters);\n    $this->assertTrue($parameters === $request->getBodyParams());\n\n    // Default initialization\n    $request = $this->createRequest();\n    $parameters = $request->getBodyParams();\n    $this->assertTrue($parameters instanceof Parameters);\n    $this->assertTrue($parameters === $request->getBodyParams());\n  }\n\n  public function testFileParams() {\n    $request = $this->createRequest();\n    $parameters = $this->createParametersMock();\n    $request->setFileParams($parameters);\n    $this->assertTrue($request->getFileParams() instanceof Parameters);\n    $this->assertTrue($parameters === $request->getFileParams());\n\n    // Default initialization\n    $request = $this->createRequest();\n    $parameters = $request->getFileParams();\n    $this->assertTrue($parameters instanceof Parameters);\n    $this->assertTrue($parameters === $request->getFileParams());\n  }\n\n  public function testClone() {\n    $request = $this->createRequest();\n    $query_params = $this->createParametersMock();\n    $request->setFileParams($query_params);\n    $body_params = $this->createParametersMock();\n    $request->setBodyParams($body_params);\n    $file_params = $this->createParametersMock();\n    $request->setFileParams($file_params);\n\n    $clone = $request->createClone();\n    $this->assertFalse($query_params === $clone->getQueryParams());\n    $this->assertFalse($body_params === $clone->getBodyParams());\n    $this->assertFalse($file_params === $clone->getFileParams());\n  }\n\n  public function testUrlCustomArgSeparator(){\n      $separator = ini_get('arg_separator.output');\n      ini_set('arg_separator.output', '&amp;');\n      $this->testUrl();\n      ini_set('arg_separator.output', $separator);\n  }\n\n  /**\n   * @depends testProtocol\n   * @depends testDomain\n   * @depends testGraphVersion\n   * @depends testPath\n   * @depends testQueryParams\n   */\n  public function testUrl() {\n    $client = $this->createClientMock();\n    $client->method('getDefaultGraphBaseDomain')\n      ->willReturn(Client::DEFAULT_GRAPH_BASE_DOMAIN);\n    $request = new Request($client);\n    $request->setGraphVersion('2.2');\n    $request->setPath('/node/edge');\n    $url = $request->getUrl();\n    $this->assertEquals(\n      parse_url($url, PHP_URL_SCHEME).'://', $request->getProtocol());\n    $this->assertEquals(parse_url($url, PHP_URL_HOST), $request->getDomain());\n    $this->assertEquals(\n      parse_url($url, PHP_URL_PATH),\n      sprintf(\"/v%s%s\", $request->getGraphVersion(), $request->getPath()));\n    $this->assertNull(parse_url($url, PHP_URL_QUERY));\n\n    // With query\n    $params = array(\n      'sdk' => 'PHP',\n      'names' => 'abc,def',\n    );\n    $request->setQueryParams(new Parameters($params));\n    $url = $request->getUrl();\n    $parsed_query = Util::parseUrlQuery(parse_url($url, PHP_URL_QUERY));\n    $this->assertEquals(\n      $parsed_query, $request->getQueryParams()->getArrayCopy());\n  }\n\n  public function testExecute() {\n    $response = $this->createResponseMock();\n    $client = $this->createClientMock();\n    $client->method('sendRequest')->willReturn($response);\n    $request = new Request($client);\n    $response_mirror = $request->execute();\n    $this->assertTrue($response_mirror instanceof ResponseInterface);\n    $this->assertTrue($response_mirror === $response);\n  }\n}\n", "num_lines": 237}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Http;\n\nuse FacebookAds\\Http\\Headers;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\Response;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass ResponseTest extends AbstractUnitTestCase {\n\n  /**\n   * @return Response\n   */\n  protected function createResponse() {\n    return new Response();\n  }\n\n  public function testRequest() {\n    $response = $this->createResponse();\n    $request = $this->createRequestMock();\n    $response->setRequest($request);\n    $request_mirror = $response->getRequest();\n    $this->assertTrue($request_mirror instanceof RequestInterface);\n    $this->assertTrue($request_mirror === $request);\n  }\n\n  public function testStatusCode() {\n    $response = $this->createResponse();\n    $response->setStatusCode(200);\n    $this->assertEquals(200, $response->getStatusCode());\n  }\n\n  public function testHeaders() {\n    $response = $this->createResponse();\n    $headers = $this->createHeadersMock();\n    $response->setHeaders($headers);\n    $headers_mirror = $response->getHeaders();\n    $this->assertTrue($headers_mirror instanceof Headers);\n    $this->assertTrue($headers_mirror === $response->getHeaders());\n\n    // Default initialization\n    $response = $this->createResponse();\n    $headers_mirror = $response->getHeaders();\n    $this->assertTrue($headers instanceof Headers);\n    $this->assertTrue($headers_mirror === $response->getHeaders());\n  }\n\n  public function testBodyContent() {\n    $response = $this->createResponse();\n    $body = '{\"data\":[]}';\n    $response->setBody($body);\n    $this->assertEquals($body, $response->getBody());\n    $this->assertEquals(array('data' => array()), $response->getContent());\n  }\n}\n", "num_lines": 79}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Http\\Adapter;\n\nuse FacebookAds\\Http\\Adapter\\AdapterInterface;\nuse FacebookAds\\Http\\Client;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nabstract class AbstractAdapterTest extends AbstractUnitTestCase {\n\n  /**\n   * @param Client $client\n   * @return AdapterInterface\n   */\n  abstract protected function createAdapter($client = null);\n\n  public function testGetters() {\n    $client = new Client();\n    $adapter = $this->createAdapter($client);\n    $this->assertTrue($client === $adapter->getClient());\n    $this->assertEquals(\n      $client->getCaBundlePath(), $adapter->getCaBundlePath());\n  }\n\n  public function testOpts() {\n    $adapter = $this->createAdapter();\n    $opts = new \\ArrayObject();\n    $adapter->setOpts($opts);\n    $this->assertTrue($opts === $adapter->getOpts());\n\n    // Default initialization\n    $adapter = $this->createAdapter();\n    $this->assertTrue($adapter->getOpts() instanceof \\ArrayObject);\n  }\n\n  abstract public function testRequest();\n}\n", "num_lines": 60}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Http\\Adapter;\n\nuse FacebookAds\\Exception\\Exception;\nuse FacebookAds\\Http\\Adapter\\Curl\\CurlInterface;\nuse FacebookAds\\Http\\Adapter\\CurlAdapter;\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\nuse \\PHPUnit_Framework_MockObject_Builder_InvocationMocker as Mock;\n\nclass CurlAdapterTest extends AbstractAdapterTest {\n\n  /**\n   * @param Client $client\n   * @return CurlAdapter\n   */\n  protected function createAdapter($client = null) {\n    return new CurlAdapter($client ?: new Client(), $this->createCurlMock());\n  }\n\n  public function testGetters() {\n    parent::testGetters();\n    $this->assertTrue(\n      $this->createAdapter()->getCurl() instanceof CurlInterface);\n  }\n\n  public function testRequest() {\n    $adapter = $this->createAdapter();\n\n    /** @var Mock|CurlInterface $curl */\n    $curl = $adapter->getCurl();\n    $curl->method('preparePostFileField')->willReturn('file');\n    $curl->method('exec')->willReturn(\"HTTP/1.1 200 OK\\nX-header: value\");\n\n    $headers = $this->createHeadersMock();\n    $this->makeMockIterable($headers, array(\n      'X-custom-header' => 'header value',\n    ));\n\n    $query = $this->createParametersMock(array(\n      'param' => 'value',\n    ));\n\n    // HTTP_GET\n    $body = $this->createParametersMock();\n    $this->makeMockIterable($body);\n\n    $files = $this->createParametersMock();\n    $this->makeMockIterable($files);\n\n    $request = $this->createRequestMock();\n    $request->method('getMethod')->willReturn(RequestInterface::METHOD_GET);\n    $request->method('getHeaders')->willReturn($headers);\n    $request->method('getQueryParams')->willReturn($query);\n    $request->method('getBodyParams')->willReturn($body);\n    $request->method('getFileParams')->willReturn($files);\n    $response = $adapter->sendRequest($request);\n    $this->assertTrue($response instanceof ResponseInterface);\n\n    // HTTP_POST with files\n    $body = $this->createParametersMock();\n    $this->makeMockIterable($body, array(\n      'file' => './filepath',\n    ));\n\n    $files = $this->createParametersMock();\n    $this->makeMockIterable($files, array(\n      'field' => 'value',\n    ));\n\n    $request = $this->createRequestMock();\n    $request->method('getMethod')->willReturn(RequestInterface::METHOD_POST);\n    $request->method('getHeaders')->willReturn($headers);\n    $request->method('getQueryParams')->willReturn($query);\n    $request->method('getBodyParams')->willReturn($body);\n    $request->method('getFileParams')->willReturn($files);\n\n    $response = $adapter->sendRequest($request);\n    $this->assertTrue($response instanceof ResponseInterface);\n\n    // HTTP_DELETE\n    $body = $this->createParametersMock();\n    $this->makeMockIterable($body);\n\n    $files = $this->createParametersMock();\n    $this->makeMockIterable($files);\n\n    $request = $this->createRequestMock();\n    $request->method('getMethod')->willReturn(RequestInterface::METHOD_DELETE);\n    $request->method('getHeaders')->willReturn($headers);\n    $request->method('getQueryParams')->willReturn($query);\n    $request->method('getBodyParams')->willReturn($body);\n    $request->method('getFileParams')->willReturn($files);\n\n    $response = $adapter->sendRequest($request);\n    $this->assertTrue($response instanceof ResponseInterface);\n\n    // Force Curl Error\n    /** @var CurlInterface|Mock $curl */\n    $curl = $adapter->getCurl();\n    $curl->method('errno')->willReturn(CURLE_SSL_CONNECT_ERROR);\n    $curl->method('error')->willReturn('Mocked Curl Error');\n    $body = $this->createParametersMock();\n    $this->makeMockIterable($body);\n\n    $files = $this->createParametersMock();\n    $this->makeMockIterable($files);\n\n    $request = $this->createRequestMock();\n    $request->method('getMethod')->willReturn(RequestInterface::METHOD_DELETE);\n    $request->method('getHeaders')->willReturn($headers);\n    $request->method('getQueryParams')->willReturn($query);\n    $request->method('getBodyParams')->willReturn($body);\n    $request->method('getFileParams')->willReturn($files);\n\n    $e = null;\n    try {\n      $adapter->sendRequest($request);\n    } catch (Exception $e) {}\n    $this->assertTrue($e !== null);\n  }\n}\n", "num_lines": 147}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Http\\Exception;\n\nuse FacebookAds\\Http\\Exception\\RequestException;\nuse FacebookAds\\Http\\Response;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass RequestExceptionTest extends AbstractUnitTestCase {\n\n  public function testGetters() {\n    $data = array(\n      'error' => array(\n        'message' => 'Stub Server Error Message',\n        'type' => 'FacebookApiException',\n        'code' => 1,\n        'error_data' => array(\n          'blame_field_specs' => array(\n            array('mandatory_field'),\n            array('field_with_malformed_value'),\n          ),\n        ),\n        'error_subcode' => 1,\n        'is_transient' => false,\n        'error_user_title' => 'Just a test',\n        'error_user_msg' => 'Let\\'s avoid alarmism',\n      ),\n    );\n    $status_code = 400;\n    $response = new Response();\n    $response->setBody(json_encode($data));\n    $response->setStatusCode($status_code);\n    $e = new RequestException($response);\n    $this->assertEquals($status_code, $e->getHttpStatusCode());\n    $this->assertEquals(\n      $data['error']['error_subcode'], $e->getErrorSubcode());\n    $this->assertEquals(\n      $data['error']['error_user_title'], $e->getErrorUserTitle());\n    $this->assertEquals(\n      $data['error']['error_user_msg'], $e->getErrorUserMessage());\n    $this->assertEquals(\n      $data['error']['error_data']['blame_field_specs'],\n      $e->getErrorBlameFieldSpecs());\n  }\n\n  public function testGetFacebookTraceIdReturnsValueFromResponseErrorData() {\n    $data = array(\n      'error' => array(\n        'fbtrace_id' => 'abc123',\n      ),\n    );\n\n    $response = new Response();\n    $response->setBody(json_encode($data));\n    $e = new RequestException($response);\n\n    $this->assertSame('abc123', $e->getFacebookTraceId());\n  }\n\n  public function testGetErrorBlameFieldSpecsReturnsNullWithNullErrorData() {\n    $data = array(\n      'error' => array(\n          'error_data' => null,\n      ),\n    );\n\n    $response = new Response();\n    $response->setBody(json_encode($data));\n    $e = new RequestException($response);\n\n    $this->assertNull($e->getErrorBlameFieldSpecs());\n  }\n\n  /**\n   * @return array\n   */\n  public function createConcreteProvider() {\n    return array(\n      array(array('type' => 'OAuthException'), 'AuthorizationException'),\n      array(array('code' => 1), 'ServerException'),\n      array(array('code' => 4), 'ThrottleException'),\n      array(array('code' => 506), 'ClientException'),\n      array(array('code' => 10), 'PermissionException'),\n      array(array(), 'RequestException'),\n    );\n  }\n\n  /**\n   * @param array $data\n   * @param string $expected_class\n   * @dataProvider createConcreteProvider\n   */\n  public function testCreateConcrete($data, $expected_class) {\n    $response = new Response();\n    $response->setBody(json_encode(array('error' => $data)));\n    $response->setStatusCode(400);\n    $e = RequestException::create($response);\n    $fqn = '\\FacebookAds\\Http\\Exception\\\\'.$expected_class;\n    $this->assertTrue(is_a($e, $fqn));\n  }\n}\n", "num_lines": 124}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Logger;\n\nuse FacebookAds\\Logger\\LoggerInterface;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nabstract class AbstractLoggerTest extends AbstractUnitTestCase {\n\n  /**\n   * @var string\n   */\n  const VALUE_LOG_LEVEL = '<LEVEL>';\n\n  /**\n   * @var string\n   */\n  const VALUE_LOG_MESSAGE = '<MESSAGE>';\n\n  /**\n   * @return LoggerInterface\n   */\n  abstract protected function createLogger();\n}\n", "num_lines": 47}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Logger;\n\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Logger\\CurlLogger;\nuse FacebookAds\\Logger\\CurlLogger\\JsonAwareParameters;\n\nclass CurlLoggerTest extends AbstractLoggerTest {\n\n  /**\n   * @var resource\n   */\n  protected $handle;\n\n  public function setup(): void {\n    $this->handle = fopen('php://temp', 'w+');\n  }\n\n  public function tearDown(): void {\n    fclose($this->handle);\n  }\n\n  /**\n   * @return resource\n   */\n  protected function getHandle() {\n    return $this->handle;\n  }\n\n  /**\n   * @return CurlLogger\n   */\n  protected function createLogger() {\n    return new CurlLogger($this->getHandle());\n  }\n\n  protected function createRequestMock() {\n    $query = $this->createParametersMock();\n    $query->method('export')->willReturn(array(\n      'appsecret_proof' => '<APPSECRET_PROOF>',\n      'access_token' => '<ACCESS_TOKEN>',\n      'query_field' => 'query_value',\n    ));\n\n    $body = $this->createParametersMock();\n    $body->method('export')->willReturn(array(\n      'body_field' => 'body_value',\n    ));\n\n    $files = $this->createParametersMock();\n    $files->method('export')->willReturn(array(\n      'file_field' => 'filepath',\n    ));\n\n    $request = parent::createRequestMock();\n    $request->method('getQueryParams')->willReturn($query);\n    $request->method('getBodyParams')->willReturn($body);\n    $request->method('getFileParams')->willReturn($files);\n\n    return $request;\n  }\n\n  public function testLog() {\n    $this->createLogger()->log(\n      static::VALUE_LOG_LEVEL, static::VALUE_LOG_MESSAGE);\n  }\n\n  /**\n   * @return array\n   */\n  public function logRequestProvider() {\n    return array(\n      array(RequestInterface::METHOD_GET),\n      array(RequestInterface::METHOD_POST),\n      array(RequestInterface::METHOD_PUT),\n      array(RequestInterface::METHOD_DELETE),\n    );\n  }\n\n  /**\n   * @dataProvider logRequestProvider\n   * @param string $http_method\n   */\n  public function testLogRequest($http_method) {\n    $request = $this->createRequestMock();\n    $request->method('getMethod')->willReturn($http_method);\n\n    $logger = $this->createLogger();\n    $logger->logRequest(static::VALUE_LOG_LEVEL, $request);\n  }\n\n  public function testLogResponse() {\n    $this->createLogger()->logResponse(\n      static::VALUE_LOG_LEVEL, $this->createResponseMock());\n  }\n\n  public function testJsonPrettyPrint() {\n    $logger = $this->createLogger();\n    $this->assertFalse($logger->isJsonPrettyPrint());\n    $logger->setJsonPrettyPrint(true);\n    $this->assertTrue($logger->isJsonPrettyPrint());\n\n    $query = new JsonAwareParameters(array(\n      'json_field' => array_fill(0, 3, 'json_value'),\n    ));\n    $body = $files = $this->createParametersMock();\n\n    $request = parent::createRequestMock();\n    $request->method('getQueryParams')->willReturn($query);\n    $request->method('getBodyParams')->willReturn($body);\n    $request->method('getFileParams')->willReturn($files);\n\n    $logger->logRequest(static::VALUE_LOG_LEVEL, $request);\n\n    $logger->setJsonPrettyPrint(false);\n    $this->assertFalse($logger->isJsonPrettyPrint());\n  }\n}\n", "num_lines": 142}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Logger;\n\nuse FacebookAds\\Logger\\NullLogger;\n\nclass NullLoggerTest extends AbstractLoggerTest {\n\n  protected function createLogger() {\n    return new NullLogger();\n  }\n\n  public function testLog() {\n    $this->createLogger()->log(\n      static::VALUE_LOG_LEVEL, static::VALUE_LOG_MESSAGE);\n  }\n\n  public function testLogRequest() {\n    $this->createLogger()->logRequest(\n      static::VALUE_LOG_LEVEL, $this->createRequestMock());\n  }\n\n  public function testLogResponse() {\n    $this->createLogger()->logResponse(\n      static::VALUE_LOG_LEVEL, $this->createResponseMock());\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Logger\\CurlLogger;\n\nuse FacebookAds\\Logger\\CurlLogger\\JsonAwareParameters;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass JsonAwareParametersTest extends AbstractUnitTestCase {\n  use JsonAwareTestTrait;\n\n  /**\n   * @dataProvider parameterProvider\n   * @param mixed $param_data\n   */\n  public function testExtract($param_data) {\n    foreach ((new JsonAwareParameters($param_data))->export() as $param) {\n      $this->assertTrue(is_scalar($param) || is_null($param));\n    }\n  }\n}\n", "num_lines": 43}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Logger\\CurlLogger;\n\nuse FacebookAds\\Logger\\CurlLogger\\JsonNode;\n\ntrait JsonAwareTestTrait {\n\n  /**\n   * @return array\n   */\n  public function parameterProvider() {\n    $base = array(\n      'appsecret_proof' => '<APPSECRET_PROOF>',\n      'access_token' => '<ACCESS_TOKEN>',\n      'query_field' => 'query_value',\n    );\n\n    return array(\n      array(\n        $base + array(\n          'json_field' => array(\n            'query_field' => 'query_value',\n          ),\n        )\n      ),\n      array(\n        $base + array(\n          'json_field' => array(\n            'query_field' => 'query_value',\n            'query_field_1' => 'query_value_1',\n            'query_field_2' => 'query_value_2',\n          ),\n        )\n      ),\n      array(\n        $base + array(\n          'json_field' => array(\n            'query_field' => str_repeat('x', JsonNode::EXPLOSION_THRESHOLD + 1),\n          ),\n        ),\n      ),\n      array(\n        $base + array(\n          'json_field' => array(),\n        ),\n      ),\n      array(\n        $base + array(\n          'json_field' => array(\n            'vector_value_1',\n            'vector_value_2',\n            'vector_value_3',\n          ),\n        ),\n      ),\n      array(\n        array(),\n      ),\n      array(\n        new \\StdClass(),\n      )\n    );\n  }\n}\n", "num_lines": 88}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Logger\\CurlLogger;\n\nuse FacebookAds\\Logger\\CurlLogger\\JsonNode;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass JsonNodeTest extends AbstractUnitTestCase {\n  use JsonAwareTestTrait;\n\n  /**\n   * @dataProvider parameterProvider\n   * @param mixed $param_data\n   */\n  public function testEncoding($param_data) {\n    JsonNode::factory($param_data)->encode();\n  }\n\n  public function testInvalidType() {\n    $this->expectException(\\InvalidArgumentException::class);\n    JsonNode::factory(fopen('php://memory', 'r'))->encode();\n  }\n\n  /**\n   * Test the sanity check for behaviour on empty children list\n   * which should never happen as this is protected method\n   */\n  public function testGetLastChildKey() {\n    $object = JsonNode::factory(array());\n    $method = new \\ReflectionMethod($object, 'getLastChildKey');\n    $method->setAccessible(true);\n\n    $this->assertNull($method->invoke($object));\n\n    $method->setAccessible(false);\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAdsTest\\Config\\SkippableFeatureTestInterface;\n\nabstract class AbstractAsyncJobTestCase extends AbstractCrudObjectTestCase\n  implements SkippableFeatureTestInterface {\n\n  /**\n   * @return array\n   */\n  public function skipIfAny() {\n    return array('no_async_jobs');\n  }\n\n  /**\n   * @param AbstractCrudObject $job\n   * @param int $timeout\n   * @param int $interval\n   */\n  protected function waitTillJobComplete(\n    AbstractCrudObject $job, $timeout = 60, $interval = 2) {\n\n    $end = time() + $timeout;\n    do {\n      if ($job->getSelf()->isComplete()) {\n        return;\n      }\n      sleep($interval);\n    } while (time() <= $end);\n\n    $this->markTestSkipped(\n      \"Async Job timed out. Timeout: {$timeout}, Interval: {$interval}\");\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAdsTest\\Object\\EmptyCrudObject;\nuse FacebookAds\\Object\\AbstractCrudObject;\n\nclass AbstractCrudObjectTest extends AbstractCrudObjectTestCase {\n\n  public function testCreationWithNull() {\n    $this->checkCreationSuccessWithID(null);\n  }\n\n  public function testCreationWithNegativeId() {\n    $this->checkCreationFailureWithID(-1234123);\n  }\n\n  public function testCreationWithPositiveId() {\n    $this->checkCreationSuccessWithID(100007309086878);\n  }\n\n  public function testCreationWithCorrectStringId() {\n    $this->checkCreationSuccessWithID('100007309086878');\n  }\n\n  public function testCreationWithIncorrectNegativeStringId() {\n    $this->checkCreationFailureWithID('-1234123');\n  }\n\n  public function testCreationWithIncorrectStringId() {\n    $this->checkCreationFailureWithID('1.234e10');\n  }\n\n  public function testCreationSuccessWithAct_() {\n    $this->checkCreationSuccessWithID('act_12341521352312');\n  }\n\n  public function testCreationFailureWithAct_() {\n    $this->checkCreationFailureWithID('act_1.1234e10');\n  }\n\n  public function testCreationWithOverFlowInt() {\n    $this->checkCreationFailureWithID(PHP_INT_MAX+1);\n  }\n  private function checkCreationSuccessWithID($id) {\n    new EmptyCrudObject($id);\n  }\n\n  private function checkCreationFailureWithID($id) {\n    $this->assertInvalidArgumentException($id);\n  }\n\n  /**\n   * @param mixed $id\n   */\n  public function assertInvalidArgumentException(mixed $id) {\n    $has_throw_exception = false;\n    try {\n      new EmptyCrudObject($id);\n    } catch (\\InvalidArgumentException $e) {\n      $has_throw_exception = true;\n    }\n    $this->assertTrue($has_throw_exception);\n  }\n\n}\n", "num_lines": 89}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAds\\Object\\AbstractObject;\nuse FacebookAds\\Object\\AbstractArchivableCrudObject;\nuse FacebookAds\\Object\\AdLabel;\nuse FacebookAds\\Object\\CanRedownloadInterface;\nuse FacebookAds\\Object\\Fields\\AbstractArchivableCrudObjectFields;\nuse FacebookAds\\Object\\Fields\\AdLabelFields;\nuse FacebookAds\\Object\\Traits\\AdLabelAwareCrudObjectTrait;\nuse FacebookAdsTest\\AbstractIntegrationTestCase;\n\nabstract class AbstractCrudObjectTestCase extends AbstractIntegrationTestCase {\n\n  /**\n   * @param AbstractCrudObject $subject\n   * @param array $params\n   */\n  public function assertCanCreate(\n    AbstractCrudObject $subject, array $params = array()) {\n\n    if ($subject instanceof CanRedownloadInterface) {\n      $params[CanRedownloadInterface::PARAM_REDOWNLOAD] = true;\n    }\n\n    $this->assertEmpty($subject->{AbstractCrudObject::FIELD_ID});\n    $subject->create($params);\n    $this->assertNotEmpty($subject->{AbstractCrudObject::FIELD_ID});\n\n    /** @var AbstractCrudObject $subject */\n    if ($subject instanceof CanRedownloadInterface) {\n      $non_null_count = 0;\n      foreach ($subject->getData() as $key => $value) {\n        if ($key !== AbstractCrudObject::FIELD_ID && $value !== null) {\n          ++$non_null_count;\n          // Normalize assert function behaviour with non-redownloadable objects\n          $subject->{$key} = null;\n        }\n      }\n\n      $this->assertGreaterThan(0, $non_null_count);\n    }\n  }\n\n  /**\n   * @param AbstractCrudObject $object\n   * @return AbstractCrudObject\n   */\n  protected function getEmptyClone(AbstractCrudObject $object) {\n    $fqn = get_class($object);\n    return new $fqn(\n      $object->{AbstractCrudObject::FIELD_ID},\n      $object->getParentId());\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   */\n  public function assertCannotCreate(AbstractCrudObject $subject) {\n    $has_throw_exception = false;\n    try {\n      $subject->create();\n    } catch (\\Exception $e) {\n      $has_throw_exception = true;\n    }\n    $this->assertTrue($has_throw_exception);\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   */\n  public function assertCanRead(AbstractCrudObject $subject) {\n    $this->assertNotEmpty($subject->{AbstractCrudObject::FIELD_ID});\n    $mirror = $this->getEmptyClone($subject);\n    $mirror->read();\n    $this->assertEquals(\n      $subject->{AbstractCrudObject::FIELD_ID},\n      $mirror->{AbstractCrudObject::FIELD_ID});\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   * @param string $connection_name\n   * @param array $fields\n   * @param array $params\n   * @return mixed\n   */\n  protected function fetchConnection(\n    AbstractCrudObject $subject,\n    $connection_name,\n    array $fields = array(),\n    array $params = array()) {\n\n    $this->assertNotEmpty($subject->{AbstractCrudObject::FIELD_ID});\n    $mirror = $this->getEmptyClone($subject);\n    return call_user_func(array($mirror, $connection_name), $fields, $params);\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   * @param string $connection_name\n   * @param array $fields\n   * @param array $params\n   */\n  public function assertCanFetchConnection(\n    AbstractCrudObject $subject,\n    $connection_name,\n    array $fields = array(),\n    array $params = array()) {\n\n    $result = $this->fetchConnection(\n      $subject, $connection_name, $fields, $params);\n\n    $this->assertTrue(\n      $result instanceof Cursor\n      || $result instanceof AbstractObject);\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   * @param string $connection_name\n   * @param array $fields\n   * @param array $params\n   */\n  public function assertCanFetchConnectionAsArray(\n    AbstractCrudObject $subject,\n    $connection_name,\n    array $fields = array(),\n    array $params = array()) {\n\n    $result = $this->fetchConnection(\n      $subject, $connection_name, $fields, $params);\n\n    $this->assertTrue(is_array($result));\n\n    foreach ($result as $object) {\n      if (!$object instanceof AbstractObject) {\n        $this->fail(\"Not an instance of AbstractObject\");\n      }\n    }\n  }\n\n  /**\n   * @param AbstractCrudObject $object\n   * @param array $diff\n   * @return array\n   */\n  private function extractDiffFromObject(\n    AbstractCrudObject $object,\n    array $diff) {\n\n    $sub_diff = array();\n    foreach ($object->getData() as $key => $val) {\n      if (array_key_exists($key, $diff)) {\n        $sub_diff[$key] = $val;\n      }\n    }\n\n    return $sub_diff + array_combine(\n      array_keys($diff),\n      array_fill(0, count($diff), null));\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   * @param array $diff Data to be changed in the object\n   */\n  public function assertCanUpdate(\n    AbstractCrudObject $subject,\n    array $diff) {\n\n    $this->assertNotEmpty($subject->{AbstractCrudObject::FIELD_ID});\n    $mirror = $this->getEmptyClone($subject);\n    $mirror->read();\n    $mirror->setData($diff);\n    $mirror->update();\n    $this->assertNotEmpty($subject->id);\n    $mirror2 = $this->getEmptyClone($subject);\n    $mirror2->read(array_keys($diff));\n    $this->assertEquals(\n      $this->extractDiffFromObject($mirror, $diff),\n      $this->extractDiffFromObject($mirror2, $diff));\n\n    $subject->read(array_keys($diff));\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   */\n  public function assertCannotUpdate(AbstractCrudObject $subject) {\n    $has_throw_exception = false;\n    try {\n      $subject->update();\n    } catch (\\Exception $e) {\n      $has_throw_exception = true;\n    }\n    $this->assertTrue($has_throw_exception);\n  }\n\n  /**\n   * @param AbstractArchivableCrudObject $subject\n   * @param string $status\n   */\n  private function assertArchivableCrudObjectStatus(\n    AbstractArchivableCrudObject $subject, $status) {\n\n    $fields = array(\n      AbstractArchivableCrudObjectFields::CONFIGURED_STATUS,\n      AbstractArchivableCrudObjectFields::EFFECTIVE_STATUS,\n    );\n\n    $mirror = $this->getEmptyClone($subject);\n    $mirror->read($fields);\n\n    foreach ($fields as $field) {\n      $this->assertEquals($mirror->{$field}, $status);\n      $subject->{$field} = $status;\n    }\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   */\n  public function assertCanDelete(AbstractCrudObject $subject) {\n    $this->assertNotEmpty($subject->{AbstractCrudObject::FIELD_ID});\n    $subject->deleteSelf();\n    if ($subject instanceof AbstractArchivableCrudObject) {\n      $this->assertArchivableCrudObjectStatus(\n        $subject, AbstractArchivableCrudObject::STATUS_DELETED);\n    }\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   */\n  public function assertCannotDelete(AbstractCrudObject $subject) {\n    $has_throw_exception = false;\n    try {\n      $subject->deleteSelf();\n    } catch (\\Exception $e) {\n      $has_throw_exception = true;\n    }\n    $this->assertTrue($has_throw_exception);\n  }\n\n  /**\n   * @param AbstractArchivableCrudObject $subject\n   */\n  public function assertCanArchive(AbstractArchivableCrudObject $subject) {\n    $this->assertNotEmpty($subject->{AbstractCrudObject::FIELD_ID});\n    $subject->archiveSelf();\n    if ($subject instanceof AbstractArchivableCrudObject) {\n      $this->assertArchivableCrudObjectStatus(\n        $subject, AbstractArchivableCrudObject::STATUS_ARCHIVED);\n    }\n  }\n\n  /**\n   * @param array $response_content\n   */\n  public function assertSuccessResponse(array $response_content) {\n    $this->assertTrue(is_array($response_content));\n    $this->assertArrayHasKey('success', $response_content);\n    $this->assertTrue($response_content['success']);\n  }\n\n  /**\n   * @param AdLabelAwareCrudObjectTrait|AbstractCrudObject $object\n   */\n  public function assertCanBeLabeled(AbstractCrudObject $object) {\n    $label = new AdLabel(null, $this->getConfig()->accountId);\n    $label->{AdLabelFields::NAME} = $this->getConfig()->testRunId;\n    $label->create();\n\n    /** @var AdLabelAwareCrudObjectTrait|AbstractCrudObject $mirror */\n    $mirror = $this->getEmptyClone($object);\n    $mirror->addAdLabels(array($label->{AdLabelFields::ID}));\n\n    $mirror = $this->getEmptyClone($object);\n    $mirror->read(array('adlabels'));\n    $this->assertCount(1, $mirror->{'adlabels'});\n\n    $mirror = $this->getEmptyClone($object);\n    $mirror->removeAdLabels(array($label->{AdLabelFields::ID}));\n    $mirror->read(array('adlabels'));\n    $this->assertNull($mirror->{'adlabels'});\n\n    $label->deleteSelf();\n  }\n}\n", "num_lines": 316}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdAccountGroup;\nuse FacebookAds\\Object\\Fields\\AdAccountGroupFields;\n\nclass AdAccountGroupTest extends AbstractCrudObjectTestCase {\n\n  public function testCrudAccess() {\n    $group = new AdAccountGroup();\n    $group->{AdAccountGroupFields::NAME} = $this->getConfig()->testRunId;\n    $this->assertCanCreate($group);\n    $this->assertCanRead($group);\n    $this->assertCanUpdate($group, array(\n      AdAccountGroupFields::NAME => $this->getConfig()->testRunId.' updated'));\n\n    $this->assertCanFetchConnectionAsArray($group, 'getUsers');\n    $this->assertCanFetchConnectionAsArray($group, 'getAdAccounts');\n\n    $this->assertCanDelete($group);\n  }\n}\n", "num_lines": 46}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\AdLabel;\nuse FacebookAds\\Object\\Fields\\AdAccountFields;\nuse FacebookAds\\Object\\Fields\\AdCreativeFields;\nuse FacebookAds\\Object\\Fields\\AdLabelFields;\nuse FacebookAds\\Object\\Values\\AdAccountRoles;\nuse FacebookAds\\Object\\Fields\\TargetingSpecsFields;\nuse FacebookAds\\Object\\TargetingSpecs;\nuse FacebookAds\\Object\\Values\\AdFormats;\nuse FacebookAds\\Object\\Values\\OptimizationGoals;\n\nclass AdAccountTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * @var AdLabel\n   */\n  protected $adLabel;\n\n  public function setup() {\n    parent::setup();\n\n    $this->adLabel = new AdLabel(null, $this->getConfig()->accountId);\n    $this->adLabel->{AdLabelFields::NAME} = $this->getConfig()->testRunId;\n    $this->adLabel->create();\n  }\n\n  public function tearDown() {\n    if ($this->adLabel !== null) {\n      $this->adLabel->deleteSelf();\n      $this->adLabel = null;\n    }\n\n    parent::tearDown();\n  }\n\n  public function testCrud() {\n    $account = new AdAccount($this->getConfig()->accountId);\n\n    $this->assertCanRead($account);\n    $name = $account->read(array(AdAccountFields::NAME))\n      ->{AdAccountFields::NAME};\n    $this->assertCanUpdate(\n      $account,\n      array(AdAccountFields::NAME => $this->getConfig()->testRunId));\n\n    // Restore original account name\n    $account->{AdAccountFields::NAME} = $name;\n    $account->save();\n\n    $this->assertCannotDelete($account);\n\n    $targeting = new TargetingSpecs();\n    $targeting->setData(array(\n      TargetingSpecsFields::GEO_LOCATIONS =>\n        array('countries' => array('US', 'JP')),\n      TargetingSpecsFields::GENDERS => array(1),\n      TargetingSpecsFields::AGE_MIN => 20,\n      TargetingSpecsFields::AGE_MAX => 24,\n    ));\n\n    $creative = (new AdCreative())->setData(array(\n      AdCreativeFields::TITLE => 'My Test Creative',\n      AdCreativeFields::BODY => 'My Test Ad Creative Body',\n      AdCreativeFields::OBJECT_URL => 'https://www.facebook.com/facebook',\n    ));\n\n    $targeting_params = array(\n      'targeting_spec' => $targeting->exportData(),\n    );\n\n    $label_params = array(\n      'ad_label_ids' => array(\n        $this->adLabel->{AdLabelFields::ID},\n      ),\n    );\n\n    $this->assertCanFetchConnection($account, 'getActivities');\n    $this->assertCanFetchConnection($account, 'getAdUsers');\n    $this->assertCanFetchConnection($account, 'getCampaigns');\n    $this->assertCanFetchConnection($account, 'getAdSets');\n    $this->assertCanFetchConnection($account, 'getAds');\n    $this->assertCanFetchConnection($account, 'getAdCreatives');\n    $this->assertCanFetchConnection($account, 'getAdImages');\n    $this->assertCanFetchConnection($account, 'getAdsPixels');\n    $this->assertCanFetchConnection($account, 'getAdVideos');\n    $this->assertCanFetchConnection($account, 'getBroadCategoryTargeting');\n    $this->assertCanFetchConnection($account, 'getCustomAudiences');\n    $this->assertCanFetchConnection($account, 'getConversionPixels');\n    $this->assertCanFetchConnection($account, 'getPartnerCategories');\n    $this->assertCanFetchConnection($account, 'getRateCards');\n    $this->assertCanFetchConnection(\n      $account,\n      'getReachEstimate',\n      array(),\n      array_merge(\n        $targeting_params,\n        array(\n          'optimize_for' => OptimizationGoals::OFFSITE_CONVERSIONS,\n        )));\n\n    if (!$this->shouldSkipTest('no_reach_and_frequency')) {\n      $this->assertCanFetchConnection($account, 'getReachFrequencyPredictions');\n    }\n\n    $this->assertCanFetchConnection(\n      $account, 'getTargetingDescription', array(), $targeting_params);\n\n    $this->assertCanFetchConnection($account, 'getTransactions');\n    $this->assertCanFetchConnection($account, 'getAdPreviews', array(), array(\n      'ad_format' => AdFormats::DESKTOP_FEED_STANDARD,\n      'creative' => $creative->exportData(),\n    ));\n    $this->assertCanFetchConnection($account, 'getInsights');\n    $this->assertCanFetchConnection($account, 'getInsightsAsync');\n    $this->assertCanFetchConnection($account, 'getAgencies');\n    $this->assertCanFetchConnection($account, 'getMinimumBudgets');\n    $this->assertCanFetchConnection($account, 'getAdLabels');\n    $this->assertCanFetchConnection(\n      $account, 'getCampaignsByLabel', array(), $label_params);\n    $this->assertCanFetchConnection(\n      $account, 'getAdSetsByLabel', array(), $label_params);\n    $this->assertCanFetchConnection(\n      $account, 'getAdsByLabel', array(), $label_params);\n    $this->assertCanFetchConnection(\n      $account, 'getAdCreativesByLabel', array(), $label_params);\n\n\n    if (!$this->getSkippableFeaturesManager()\n      ->isSkipKey('no_business_manager')) {\n\n      $account->grantAgencyAcccess(\n        $this->getConfig()->secondaryBusinessId,\n        array(AdAccountRoles::GENERAL_USER));\n\n      $account->revokeAgencyAccess($this->getConfig()->secondaryBusinessId);\n    }\n  }\n}\n", "num_lines": 166}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdConversionPixel;\nuse FacebookAds\\Object\\Fields\\AdConversionPixelFields;\n\nclass AdConversionPixelTest extends AbstractCrudObjectTestCase {\n\n  public function testCrud() {\n    $conversionPixel = new AdConversionPixel(\n      null, $this->getConfig()->accountId);\n    $conversionPixel->{AdConversionPixelFields::NAME}\n      = $this->getConfig()->testRunId;\n    $conversionPixel->{AdConversionPixelFields::TAG} = 'checkout';\n\n    $this->assertCanCreate($conversionPixel);\n    $this->assertCanRead($conversionPixel);\n    $this->assertCanUpdate(\n      $conversionPixel,\n      array(\n        AdConversionPixelFields::TAG => 'add_to_cart',\n      ));\n    $this->assertCanDelete($conversionPixel);\n  }\n}\n", "num_lines": 49}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\AdImage;\nuse FacebookAds\\Object\\ObjectStorySpec;\nuse FacebookAds\\Object\\ObjectStory\\LinkData;\nuse FacebookAds\\Object\\ObjectStory\\AttachmentData;\nuse FacebookAds\\Object\\Fields\\AdCreativeFields;\nuse FacebookAds\\Object\\Fields\\AdImageFields;\nuse FacebookAds\\Object\\Fields\\ObjectStorySpecFields;\nuse FacebookAds\\Object\\Fields\\ObjectStory\\LinkDataFields;\nuse FacebookAds\\Object\\Fields\\ObjectStory\\AttachmentDataFields;\n\nclass AdCreativeTest extends AbstractCrudObjectTestCase {\n\n  public function testCrud() {\n    $creative = new AdCreative(null, $this->getConfig()->accountId);\n    $creative->{AdCreativeFields::TITLE} = 'My Test Ad';\n    $creative->{AdCreativeFields::NAME} = 'My Test Ad';\n    $creative->{AdCreativeFields::BODY} = 'My Test Ad Body';\n    $creative->{AdCreativeFields::OBJECT_ID} = $this->getConfig()->pageId;\n    $this->assertCanCreate($creative);\n    $this->assertCanRead($creative);\n    $this->assertCanUpdate(\n      $creative,\n      array(\n        AdCreativeFields::NAME => 'My Test Ad '. $this->getConfig()->testRunId,\n      ));\n    $this->assertCanBeLabeled($creative);\n    $this->assertCanDelete($creative);\n  }\n\n  public function testMultiProductObjectSpec() {\n    // Create a new AdCreative\n    $creative = new AdCreative(null, $this->getConfig()->accountId);\n    $creative->{AdCreativeFields::NAME} = 'Multi Product Ad Creative';\n\n    // Create a new ObjectStorySpec to create an unpublished post\n    $story = new ObjectStorySpec();\n    $story->{ObjectStorySpecFields::PAGE_ID} = $this->getConfig()->pageId;\n\n    // Create LinkData object representing data for a link page post\n    $link = new LinkData();\n    $link->{LinkDataFields::LINK} = $this->getConfig()->appUrl;\n    $link->{LinkDataFields::CAPTION} = 'My Caption';\n\n    // Upload a test image to use in Attachments\n    $adImage = new AdImage(null, $this->getConfig()->accountId);\n    $adImage->{AdImageFields::FILENAME} = $this->getConfig()->testImagePath;\n    $adImage->save();\n\n    // Create 3 products as this will be a multi-product ad\n    $product1 = (new AttachmentData())->setData(array(\n      AttachmentDataFields::LINK => $this->getConfig()->appUrl.'p1',\n      AttachmentDataFields::IMAGE_HASH => $adImage->hash,\n      AttachmentDataFields::NAME => 'Product 1',\n      AttachmentDataFields::DESCRIPTION => '$100',\n    ));\n\n    $product2 = (new AttachmentData())->setData(array(\n      AttachmentDataFields::LINK => $this->getConfig()->appUrl.'p2',\n      AttachmentDataFields::IMAGE_HASH => $adImage->hash,\n      AttachmentDataFields::NAME => 'Product 2',\n      AttachmentDataFields::DESCRIPTION => '$200',\n    ));\n\n    $product3 = (new AttachmentData())->setData(array(\n      AttachmentDataFields::LINK => $this->getConfig()->appUrl.'p3',\n      AttachmentDataFields::IMAGE_HASH => $adImage->hash,\n      AttachmentDataFields::NAME => 'Product 3',\n      AttachmentDataFields::DESCRIPTION => '$300',\n    ));\n\n    // Add the products into the child attachments\n    $link->{LinkDataFields::CHILD_ATTACHMENTS} = array(\n      $product1,\n      $product2,\n      $product3,\n    );\n\n    $story->{ObjectStorySpecFields::LINK_DATA} = $link;\n    $creative->{AdCreativeFields::OBJECT_STORY_SPEC} = $story;\n\n    $this->assertCanCreate($creative);\n    $this->assertCanDelete($creative);\n  }\n}\n", "num_lines": 112}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdImage;\nuse FacebookAds\\Object\\Fields\\AdImageFields;\n\nclass AdImageTest extends AbstractCrudObjectTestCase {\n\n  public function testCrud() {\n    $image = new AdImage(null, $this->getConfig()->accountId);\n    $image->{AdImageFields::FILENAME} = $this->getConfig()->testImagePath;\n    $this->assertCanCreate($image);\n    $this->assertCanRead($image);\n    $this->assertCannotUpdate($image);\n    $this->assertCanDelete($image);\n  }\n\n  /**\n   * @expectedException \\Exception\n   */\n  public function testZipFileInNormalCreate() {\n    $image = new AdImage(null, $this->getConfig()->accountId);\n    $image->{AdImageFields::FILENAME}\n      = $this->getConfig()->testZippedImagesPath;\n    $image->create();\n  }\n\n  public function testBulkZipUpload() {\n    $images = AdImage::createFromZip(\n       $this->getConfig()->testZippedImagesPath,\n       $this->getConfig()->accountId);\n    $this->assertTrue(is_array($images));\n\n    foreach ($images as $image) {\n      $this->assertCanDelete($image);\n    }\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdLabel;\nuse FacebookAds\\Object\\Fields\\AdLabelFields;\n\nclass AdLabelTest extends AbstractCrudObjectTestCase {\n\n  public function testCrudAccess() {\n    $label = new AdLabel(null, $this->getConfig()->accountId);\n    $label->{AdLabelFields::NAME} = $this->getConfig()->testRunId;\n\n    $this->assertCanCreate($label);\n    $this->assertCanRead($label);\n    $this->assertCanUpdate(\n      $label,\n      array(AdLabelFields::NAME => $this->getConfig()->testRunId . ' updated'));\n\n    $this->assertCanDelete($label);\n  }\n}\n", "num_lines": 45}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdImage;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\Fields\\AdImageFields;\nuse FacebookAds\\Object\\TargetingSpecs;\nuse FacebookAds\\Object\\Fields\\AdPreviewFields;\nuse FacebookAds\\Object\\Fields\\AdCreativeFields;\nuse FacebookAds\\Object\\Fields\\AdFields;\nuse FacebookAds\\Object\\Fields\\AdSetFields;\nuse FacebookAds\\Object\\Fields\\CampaignFields;\nuse FacebookAds\\Object\\Fields\\TargetingSpecsFields;\nuse FacebookAds\\Object\\Values\\AdFormats;\nuse FacebookAds\\Object\\Values\\BillingEvents;\nuse FacebookAds\\Object\\Values\\OptimizationGoals;\nuse FacebookAdsTest\\Config\\SkippableFeatureTestInterface;\n\nclass AdPreviewTest extends AbstractCrudObjectTestCase\n  implements SkippableFeatureTestInterface {\n\n  /**\n   * @var Campaign\n   */\n  protected $campaign;\n\n  /**\n   * @var AdSet\n   */\n  protected $adSet;\n\n  /**\n   * @var Ad\n   */\n  protected $ad;\n\n  /**\n   * @var AdImage\n   */\n  protected $adImage;\n\n  /**\n   * @var AdCreative\n   */\n  protected $adCreative;\n\n  /**\n   * @return array\n   */\n  public function skipIfAny() {\n    return array('no_payment_method');\n  }\n\n  public function setup() {\n    parent::setup();\n\n    $targeting = new TargetingSpecs();\n    $targeting->{TargetingSpecsFields::GEO_LOCATIONS}\n      = array('countries' => array('US'));\n\n    $this->campaign = new Campaign(null, $this->getConfig()->accountId);\n    $this->campaign->{CampaignFields::NAME} = $this->getConfig()->testRunId;\n    $this->campaign->create();\n\n    $this->adSet = new AdSet(null, $this->getConfig()->accountId);\n    $this->adSet->{AdSetFields::CAMPAIGN_ID}\n      = (int) $this->campaign->{AdSetFields::ID};\n    $this->adSet->{AdSetFields::NAME} = $this->getConfig()->testRunId;\n    $this->adSet->{AdSetFields::DAILY_BUDGET} = '150';\n    $this->adSet->{AdSetFields::START_TIME}\n      = (new \\DateTime(\"+1 week\"))->format(\\DateTime::ISO8601);\n    $this->adSet->{AdSetFields::END_TIME}\n      = (new \\DateTime(\"+2 week\"))->format(\\DateTime::ISO8601);\n    $this->adSet->{AdFields::TARGETING} = $targeting;\n    $this->adSet->{AdSetFields::OPTIMIZATION_GOAL} = OptimizationGoals::REACH;\n    $this->adSet->{AdSetFields::BILLING_EVENT} = BillingEvents::IMPRESSIONS;\n    $this->adSet->{AdSetFields::BID_AMOUNT} = 2;\n    $this->adSet->create(array(\n      AdSet::STATUS_PARAM_NAME => AdSet::STATUS_PAUSED,\n    ));\n\n    $this->adImage = new AdImage(null, $this->getConfig()->accountId);\n    $this->adImage->{AdImageFields::FILENAME}\n      = $this->getConfig()->testImagePath;\n    $this->adImage->save();\n\n    $this->adCreative = new AdCreative(null, $this->getConfig()->accountId);\n    $this->adCreative->{AdCreativeFields::TITLE} = 'My Test Ad';\n    $this->adCreative->{AdCreativeFields::BODY} = 'My Test Ad Body';\n    $this->adCreative->{AdCreativeFields::OBJECT_ID}\n      = $this->getConfig()->pageId;\n    $this->adCreative->{AdCreativeFields::IMAGE_HASH}\n      = $this->adImage->{AdImageFields::HASH};\n    $this->adCreative->create();\n\n    $this->ad = new Ad(null, $this->getConfig()->accountId);\n    $this->ad->{AdFields::NAME} = $this->getConfig()->testRunId;\n    $this->ad->{AdFields::ADSET_ID}\n      = (int) $this->adSet->{AdSetFields::ID};\n    $this->ad->{AdFields::CREATIVE}\n      = array('creative_id' => $this->adCreative->{AdCreativeFields::ID});\n    $this->ad->create(array(\n      Ad::STATUS_PARAM_NAME => Ad::STATUS_PAUSED,\n    ));\n  }\n\n  public function tearDown() {\n\n    if ($this->ad) {\n      $this->ad->deleteSelf();\n      $this->ad = null;\n    }\n\n    if ($this->adSet) {\n      $this->adSet->deleteSelf();\n      $this->adSet = null;\n    }\n\n    if ($this->campaign) {\n      $this->campaign->deleteSelf();\n      $this->campaign = null;\n    }\n\n    if ($this->adCreative) {\n      $this->adCreative->deleteSelf();\n      $this->adCreative = null;\n    }\n\n    if ($this->adImage) {\n      $this->adImage->deleteSelf();\n      $this->adImage = null;\n    }\n\n    parent::tearDown();\n  }\n\n  public function testAdPreviews() {\n    // Preview with actual creative\n    $previews = $this->adCreative->getAdPreviews(\n      array(),\n      array(\n        AdPreviewFields::AD_FORMAT => AdFormats::RIGHT_COLUMN_STANDARD\n      )\n    );\n    $this->assertNotEquals(0, $previews->count());\n    $preview = $previews->offsetGet(0);\n    $this->assertRegExp(\n      '/iframe/',\n      $preview->{AdPreviewFields::BODY}\n    );\n\n    // Preview with actual adgroup\n    $previews = $this->ad->getAdPreviews(\n      array(),\n      array(\n        AdPreviewFields::AD_FORMAT => AdFormats::RIGHT_COLUMN_STANDARD\n      )\n    );\n    $this->assertNotEquals(0, $previews->count());\n    $preview = $previews->offsetGet(0);\n    $this->assertRegExp(\n      '/iframe/',\n      $preview->{AdPreviewFields::BODY}\n    );\n\n    // Preview with creative specs\n    $account = new AdAccount($this->getConfig()->accountId);\n    $previews = $account->getAdPreviews(\n      array(),\n      array(\n        AdPreviewFields::CREATIVE => array(\n          AdCreativeFields::BODY => 'Testing the creative preview',\n          AdCreativeFields::OBJECT_ID => $this->getConfig()->pageId,\n        ),\n        AdPreviewFields::AD_FORMAT => AdFormats::RIGHT_COLUMN_STANDARD,\n      )\n    );\n    $this->assertNotEquals(0, $previews->count());\n    $preview = $previews->offsetGet(0);\n    $this->assertRegExp(\n      '/iframe/',\n      $preview->{AdPreviewFields::BODY}\n    );\n  }\n}\n", "num_lines": 213}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Object\\Fields\\CampaignFields;\nuse FacebookAds\\Object\\Fields\\AdSetFields;\nuse FacebookAds\\Object\\Fields\\TargetingSpecsFields;\nuse FacebookAds\\Object\\TargetingSpecs;\nuse FacebookAds\\Object\\Values\\BillingEvents;\nuse FacebookAds\\Object\\Values\\OptimizationGoals;\n\nclass AdSetTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * @var Campaign\n   */\n  protected $campaign;\n\n  public function setup() {\n    parent::setup();\n    $this->campaign = new Campaign(null, $this->getConfig()->accountId);\n    $this->campaign->{CampaignFields::NAME}\n      = $this->getConfig()->testRunId;\n    $this->campaign->create();\n  }\n\n  public function tearDown() {\n    $this->campaign->deleteSelf();\n    $this->campaign = null;\n    parent::tearDown();\n  }\n\n  public function testCrud() {\n    $targeting = new TargetingSpecs();\n    $targeting->{TargetingSpecsFields::GEO_LOCATIONS}\n      = array('countries' => array('US'));\n\n    $set = new AdSet(null, $this->getConfig()->accountId);\n    $set->{AdSetFields::CAMPAIGN_ID}\n      = $this->campaign->{CampaignFields::ID};\n    $set->{AdSetFields::NAME} = $this->getConfig()->testRunId;\n    $set->{AdSetFields::OPTIMIZATION_GOAL} = OptimizationGoals::REACH;\n    $set->{AdSetFields::BILLING_EVENT} = BillingEvents::IMPRESSIONS;\n    $set->{AdSetFields::BID_AMOUNT} = 2;\n    $set->{AdSetFields::DAILY_BUDGET} = '150';\n    $set->{AdSetFields::TARGETING} = $targeting;\n    $set->{AdSetFields::START_TIME}\n      = (new \\DateTime(\"+1 week\"))->format(\\DateTime::ISO8601);\n    $set->{AdSetFields::END_TIME}\n      = (new \\DateTime(\"+2 week\"))->format(\\DateTime::ISO8601);\n\n    $this->assertCanCreate($set, array(\n      AdSet::STATUS_PARAM_NAME => AdSet::STATUS_PAUSED,\n    ));\n    $this->assertCanRead($set);\n    $this->assertCanUpdate($set, array(\n      AdSetFields::NAME => $this->getConfig()->testRunId.' updated',\n    ));\n    $this->assertCanFetchConnection($set, 'getAds');\n    $this->assertCanFetchConnection($set, 'getAdCreatives');\n    $this->assertCanFetchConnection($set, 'getInsights');\n    $this->assertCanFetchConnection($set, 'getInsightsAsync');\n\n    $this->assertCanBeLabeled($set);\n    $this->assertCanArchive($set);\n\n    $this->assertCanDelete($set);\n  }\n}\n", "num_lines": 94}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdsPixel;\nuse FacebookAds\\Object\\Business;\nuse FacebookAds\\Object\\Fields\\AdsPixelsFields;\nuse FacebookAds\\Object\\Values\\AdsPixelStatAggregations;\n\nclass AdsPixelTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * AdsPixels can be created but only one per account can exist\n   */\n  public function testCreate() {\n    // make sure there's at least one pixel\n    $account = new AdAccount($this->getConfig()->accountId);\n    $pixels = $account->getAdsPixels();\n    $pixel = null;\n\n    if (!$pixels->count()) {\n      $pixel = new AdsPixel(null, $this->getConfig()->accountId);\n      $pixel->{AdsPixelsFields::NAME} = 'WCA Pixel';\n      $this->assertCanCreate($pixel);\n    } else {\n      $pixel = $pixels->current();\n    }\n\n    $pixel = new AdsPixel(null, $this->getConfig()->accountId);\n    $pixel->{AdsPixelsFields::NAME} = $this->getConfig()->testRunId;\n    $this->assertCannotCreate($pixel);\n  }\n\n  /**\n   * @return AdsPixel\n   */\n  protected function getAccountPixel() {\n    $cursor = (new AdAccount($this->getConfig()->accountId))->getAdsPixels();\n    $this->assertGreaterThanOrEqual(1, $cursor->count());\n\n    return $cursor->current();\n  }\n\n  /**\n   * @depends testCreate\n   */\n  public function testCrud() {\n    $pixel = $this->getAccountPixel();\n\n    $this->assertCanRead($pixel, array(\n      AdsPixelsFields::NAME,\n    ));\n\n    $name = $pixel->{AdsPixelsFields::NAME};\n\n    $this->assertCanUpdate(\n      $pixel,\n      array(\n        AdsPixelsFields::NAME => $this->getConfig()->testRunId.' updated',\n      ));\n\n    $pixel->{AdsPixelsFields::NAME} = $name;\n    $pixel->update();\n\n    $this->assertCanFetchConnection($pixel, 'getAdAccounts', array(), array(\n      'business' => $this->getConfig()->businessId,\n    ));\n    $this->assertCanFetchConnection($pixel, 'getAgencies');\n    $this->assertCanFetchConnection($pixel, 'getStats', array(), array(\n      'aggregation' => AdsPixelStatAggregations::EVENT,\n    ));\n\n    $this->assertCannotDelete($pixel);\n  }\n\n  /**\n   * @depends testCreate\n   */\n  public function testShareWithAdAccount() {\n    $this->skipIf('no_business_manager');\n\n    if (!$this->getConfig()->secondaryBusinessId) {\n      $this->markTestSkipped('No secondary business provided in config');\n    }\n\n    if (!$this->getConfig()->secondaryAccountId) {\n      $this->markTestSkipped('No secondary ad account provided in config');\n    }\n\n    $account_id_int = (int) substr($this->getConfig()->secondaryAccountId, 4);\n\n    $pixel = $this->getAccountPixel();\n\n    $pixel->sharePixelWithAdAccount(\n      $this->getConfig()->secondaryBusinessId,\n      $account_id_int);\n\n    $pixel->unsharePixelWithAdAccount(\n      $this->getConfig()->secondaryBusinessId,\n      $account_id_int);\n\n  }\n\n  /**\n   * @depends testCreate\n   */\n  public function testShareWithAgency() {\n    $this->skipIf('no_business_manager');\n\n    if (!$this->getConfig()->secondaryAccountId) {\n      $this->markTestSkipped('No secondary business provided in config');\n    }\n\n    $pixel = $this->getAccountPixel();\n\n    $business = new Business($this->getConfig()->businessId);\n    $cursor = $business->getAgencies();\n    $cursor->setUseImplicitFetch(true);\n\n    $agency_id = null;\n    foreach ($cursor as $agency) {\n      if (\n        $agency->{AbstractCrudObject::FIELD_ID}\n        == $this->getConfig()->secondaryBusinessId\n      ) {\n        $agency_id = $agency->{AbstractCrudObject::FIELD_ID};\n      }\n    }\n\n    if ($agency_id === null) {\n      $this->markTestSkipped(\"Secondary business is not a valid agency\");\n    }\n\n    $pixel->sharePixelWithAgency(\n      $this->getConfig()->businessId,\n      $this->getConfig()->secondaryBusinessId);\n\n    $pixel->unsharePixelWithAgency(\n      $this->getConfig()->businessId,\n      $this->getConfig()->secondaryBusinessId);\n  }\n}\n", "num_lines": 167}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Object\\AdImage;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Object\\Fields\\CampaignFields;\nuse FacebookAds\\Object\\Fields\\AdCreativeFields;\nuse FacebookAds\\Object\\Fields\\AdFields;\nuse FacebookAds\\Object\\Fields\\AdImageFields;\nuse FacebookAds\\Object\\Fields\\AdSetFields;\nuse FacebookAds\\Object\\Fields\\ObjectStory\\LinkDataFields;\nuse FacebookAds\\Object\\Fields\\ObjectStorySpecFields;\nuse FacebookAds\\Object\\ObjectStory\\LinkData;\nuse FacebookAds\\Object\\ObjectStorySpec;\nuse FacebookAds\\Object\\TargetingSpecs;\nuse FacebookAds\\Object\\Fields\\TargetingSpecsFields;\nuse FacebookAds\\Object\\Values\\BillingEvents;\nuse FacebookAds\\Object\\Values\\OptimizationGoals;\nuse FacebookAdsTest\\Config\\SkippableFeatureTestInterface;\n\nclass AdTest extends AbstractCrudObjectTestCase\n  implements SkippableFeatureTestInterface {\n\n  /**\n   * @var Campaign\n   */\n  protected $campaign;\n\n  /**\n   * @var AdSet\n   */\n  protected $adSet;\n\n  /**\n   * @var AdCreative\n   */\n  protected $adCreative;\n\n  /**\n   * @var AdImage\n   */\n  protected $adImage;\n\n  /**\n   * @return array\n   */\n  public function skipIfAny() {\n    return array('no_payment_method');\n  }\n\n  public function setup() {\n    parent::setup();\n\n    $targeting = new TargetingSpecs();\n    $targeting->{TargetingSpecsFields::GEO_LOCATIONS} = array(\n      'countries' => array('US'),\n    );\n\n    $this->campaign = new Campaign(null, $this->getConfig()->accountId);\n    $this->campaign->{CampaignFields::NAME} = $this->getConfig()->testRunId;\n    $this->campaign->create();\n\n    $this->adSet = new AdSet(null, $this->getConfig()->accountId);\n    $this->adSet->{AdSetFields::CAMPAIGN_ID}\n      = (int) $this->campaign->{AdSetFields::ID};\n    $this->adSet->{AdSetFields::NAME} = $this->getConfig()->testRunId;\n    $this->adSet->{AdSetFields::DAILY_BUDGET} = '150';\n    $this->adSet->{AdSetFields::START_TIME}\n      = (new \\DateTime(\"+1 week\"))->format(\\DateTime::ISO8601);\n    $this->adSet->{AdSetFields::END_TIME}\n      = (new \\DateTime(\"+2 week\"))->format(\\DateTime::ISO8601);\n    $this->adSet->{AdSetFields::TARGETING} = $targeting;\n    $this->adSet->{AdSetFields::OPTIMIZATION_GOAL} = OptimizationGoals::REACH;\n    $this->adSet->{AdSetFields::BILLING_EVENT} = BillingEvents::IMPRESSIONS;\n    $this->adSet->{AdSetFields::BID_AMOUNT} = 2;\n    $this->adSet->save(array(\n      AdSet::STATUS_PARAM_NAME => AdSet::STATUS_PAUSED,\n    ));\n\n    $this->adImage = new AdImage(null, $this->getConfig()->accountId);\n    $this->adImage->{AdImageFields::FILENAME}\n      = $this->getConfig()->testImagePath;\n    $this->adImage->save();\n\n    $link = new LinkData();\n    $link->{LinkDataFields::MESSAGE} = 'Message';\n    $link->{LinkDataFields::IMAGE_HASH} = $this->adImage->{AdImageFields::HASH};\n    $link->{LinkDataFields::LINK} = $this->getConfig()->appUrl;\n\n    $story = new ObjectStorySpec();\n    $story->{ObjectStorySpecFields::PAGE_ID} = $this->getConfig()->pageId;\n    $story->{ObjectStorySpecFields::LINK_DATA} = $link;\n\n    $this->adCreative = new AdCreative(null, $this->getConfig()->accountId);\n    $this->adCreative->{AdCreativeFields::OBJECT_STORY_SPEC} = $story;\n    $this->adCreative->create();\n  }\n\n  public function tearDown() {\n    if ($this->adSet) {\n      $this->adSet->deleteSelf();\n      $this->adSet = null;\n    }\n\n    if ($this->campaign) {\n      $this->campaign->deleteSelf();\n      $this->campaign = null;\n    }\n\n    if ($this->adCreative) {\n      $this->adCreative->deleteSelf();\n      $this->adCreative = null;\n    }\n\n    if ($this->adImage) {\n      $this->adImage->deleteSelf();\n      $this->adImage = null;\n    }\n\n    parent::tearDown();\n  }\n\n  public function testCrudAccess() {\n\n    $group = new Ad(null, $this->getConfig()->accountId);\n    $group->{AdFields::NAME} = $this->getConfig()->testRunId;\n    $group->{AdFields::ADSET_ID}\n      = (int) $this->adSet->{AdSetFields::ID};\n    $group->{AdFields::CREATIVE}\n      = array('creative_id' => $this->adCreative->{AdCreativeFields::ID});\n\n    $this->assertCanCreate($group, array(\n      Ad::STATUS_PARAM_NAME => Ad::STATUS_PAUSED,\n    ));\n    $this->assertCanRead($group);\n    $this->assertCanUpdate($group, array(\n      AdFields::NAME => $this->getConfig()->testRunId.' updated',\n    ));\n\n    $this->assertCanFetchConnection($group, 'getAdCreatives');\n    $this->assertCanFetchConnection($group, 'getLeads');\n    $this->assertCanFetchConnection($group, 'getTargetingDescription');\n    $this->assertCanFetchConnection($group, 'getAdPreviews',\n      array(),\n      array('ad_format' => 'RIGHT_COLUMN_STANDARD'));\n\n    if (!$this->shouldSkipTest('no_reach_and_frequency')) {\n      $this->assertCanFetchConnection($group, 'getReachEstimate');\n    }\n    $this->assertCanFetchConnection($group, 'getClickTrackingTag');\n    $this->assertCanFetchConnection($group, 'getInsights');\n    $this->assertCanFetchConnection($group, 'getInsightsAsync');\n\n    $this->assertCanBeLabeled($group);\n    $this->assertCanArchive($group);\n\n    $this->assertCanDelete($group);\n  }\n}\n", "num_lines": 186}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdUser;\nuse FacebookAds\\Object\\Fields\\AdUserFields;\n\nclass AdUserTest extends AbstractCrudObjectTestCase {\n\n  public function testCrudAccess() {\n    $ad_account = new AdAccount($this->getConfig()->accountId);\n    $ad_users = $ad_account->getAdUsers();\n\n    $this->assertGreaterThan(0, $ad_users->count());\n\n    $uid = (new AdUser('me'))->read()->{AdUserFields::ID};\n    $found = false;\n    foreach ($ad_users as $ad_user) {\n      if ($ad_user->id === $uid) {\n        $this->assertCanFetchConnection($ad_user, 'getAdAccounts');\n        $this->assertCanFetchConnection($ad_user, 'getAdAccountGroups');\n        $found = true;\n        break;\n      }\n    }\n\n    $this->assertTrue($found);\n  }\n}\n", "num_lines": 53}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdVideo;\nuse FacebookAds\\Object\\Fields\\AdVideoFields;\nuse FacebookAdsTest\\Config\\SkippableFeatureTestInterface;\n\nclass AdVideoTest extends AbstractCrudObjectTestCase\n  implements SkippableFeatureTestInterface {\n\n  /**\n   * @return array\n   */\n  public function skipIfAny() {\n    return array('no_video_upload');\n  }\n\n  public function testCrud() {\n    $video = new AdVideo(null, $this->getConfig()->accountId);\n    $video->{AdVideoFields::NAME} = $this->getConfig()->testRunId;\n    $video->{AdVideoFields::SOURCE} = $this->getConfig()->testVideoPath;\n    $this->assertCanCreate($video);\n    $this->assertCanRead($video);\n    $this->assertCanUpdate($video, array(\n      AdVideoFields::NAME => $this->getConfig()->testRunId.' updated',\n    ));\n    $this->assertCanDelete($video);\n  }\n}\n", "num_lines": 53}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\n namespace FacebookAdsTest\\Object;\n\n use FacebookAds\\Object\\AdAccount;\n use FacebookAds\\Object\\Fields\\AdAccountFields;\n use FacebookAds\\Object\\AdReportRun;\n use FacebookAds\\Object\\Fields\\AdsInsightsFields;\n use FacebookAds\\Api;\n\n class AsyncJobInsightsTest extends AbstractAsyncJobTestCase {\n\n   public function testCrud() {\n     $account = new AdAccount($this->getConfig()->accountId);\n     $job = $account->getInsightsAsync();\n     $this->assertTrue($job instanceof AdReportRun);\n     $this->waitTillJobComplete($job);\n     $job->getInsights();\n   }\n\n   public function testFields() {\n     $account = new AdAccount($this->getConfig()->accountId);\n     $fields = array(AdAccountFields::ACCOUNT_ID);\n     $account->{AdAccountFields::ACCOUNT_ID} = $account->getSelf($fields)->{AdAccountFields::ACCOUNT_ID};\n     $fields = array(AdsInsightsFields::ACCOUNT_ID);\n     $job = $account->getInsightsAsync($fields);\n     $this->assertTrue($job instanceof AdReportRun);\n     $this->waitTillJobComplete($job);\n     $result = $job->getInsights();\n     $this->assertEquals(\n       $result[0]->{AdsInsightsFields::ACCOUNT_ID},\n       $account->{AdAccountFields::ACCOUNT_ID});\n   }\n }\n", "num_lines": 57}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdUser;\nuse FacebookAds\\Object\\Business;\nuse FacebookAds\\Object\\Fields\\AdUserFields;\nuse FacebookAds\\Object\\Fields\\BusinessFields;\nuse FacebookAds\\Object\\Values\\AdAccountRoles;\nuse FacebookAdsTest\\Config\\SkippableFeatureTestInterface;\nuse FacebookAds\\Object\\Values\\BusinessRoles;\n\nclass BusinessTest extends AbstractCrudObjectTestCase\n  implements SkippableFeatureTestInterface {\n\n  /**\n   * @return array\n   */\n  public function skipIfAny() {\n    return array('no_business_manager');\n  }\n\n  public function testCrud() {\n    $business = new Business($this->getConfig()->businessId);\n    $this->assertCanRead($business);\n    $this->assertCannotDelete($business);\n\n\n    $name = $business->read(array(BusinessFields::NAME))\n      ->{BusinessFields::NAME};\n\n    $this->assertCanUpdate($business, array(\n      BusinessFields::NAME => \"My Awesome Business\"\n    ));\n\n    $business->{BusinessFields::NAME} = $name;\n    $business->save();\n\n\n    if ($this->getConfig()->secondaryPageId) {\n      $business->claimPage(\n        $this->getConfig()->secondaryPageId,\n        BusinessRoles::OWNER);\n      $business->deletePage($this->getConfig()->secondaryPageId);\n    }\n\n    $business->inviteUserByEmail('test@example.com', BusinessRoles::EMPLOYEE);\n    $business->deleteUserByEmail('test@example.com');\n\n    $user = (new AdUser('me'))->read(array('id'));\n    $business->addUserPermissionById(\n      $user->{AdUserFields::ID},\n      BusinessRoles::ADMIN);\n\n    if ($this->getConfig()->secondaryAccountId) {\n      $business->claimAdAccount(\n        $this->getConfig()->secondaryAccountId,\n        BusinessRoles::AGENCY,\n        array(AdAccountRoles::ADMIN));\n      $business->deleteAdAccount(\n        $this->getConfig()->secondaryAccountId);\n    }\n\n    if ($this->getConfig()->secondaryAppId) {\n      $business->claimApp(\n        $this->getConfig()->secondaryAppId,\n        BusinessRoles::OWNER);\n      $business->deleteApp($this->getConfig()->secondaryAppId);\n    }\n  }\n\n  public function testConnections() {\n    $business = new Business($this->getConfig()->businessId);\n    $this->assertCanFetchConnection($business, 'getAdAccounts');\n    $this->assertCanFetchConnection($business, 'getUserPermissions');\n    $this->assertCanFetchConnection($business, 'getProjects');\n    $this->assertCanFetchConnection($business, 'getPages');\n    $this->assertCanFetchConnection($business, 'getApps');\n    $this->assertCanFetchConnection($business, 'getClients');\n    $this->assertCanFetchConnection($business, 'getAgencies');\n    $this->assertCanFetchConnection($business, 'getCreditCards');\n    $this->assertCanFetchConnection($business, 'getExtendedCredits');\n    $this->assertCanFetchConnection($business, 'getProductCatalogues');\n    $this->assertCanFetchConnection($business, 'getSystemUsers');\n    $this->assertCanFetchConnection($business, 'getAdsPixels');\n  }\n}\n", "num_lines": 110}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\Fields\\CampaignFields;\n\nclass CampaignTest extends AbstractCrudObjectTestCase {\n\n  public function testCrud() {\n    $campaign = new Campaign(null, $this->getConfig()->accountId);\n    $campaign->{CampaignFields::NAME} = $this->getConfig()->testRunId;\n    \n    $this->assertCanCreate($campaign);\n    $this->assertCanRead($campaign);\n    $this->assertCanUpdate(\n      $campaign,\n      array(\n        CampaignFields::NAME => $this->getConfig()->testRunId.' updated',\n      ));\n    $this->assertCanFetchConnection($campaign, 'getAdSets');\n    $this->assertCanFetchConnection($campaign, 'getAds');\n    $this->assertCanFetchConnection($campaign, 'getInsights');\n    $this->assertCanFetchConnection($campaign, 'getInsightsAsync');\n\n    $this->assertCanBeLabeled($campaign);\n    $this->assertCanArchive($campaign);\n\n    $this->assertCanDelete($campaign);\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Object\\Fields\\CustomAudienceFields;\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\Values\\CustomAudienceSubtypes;\nuse FacebookAds\\Object\\Values\\CustomAudienceTypes;\n\nclass CustomAudienceMultikeyTest extends AbstractCrudObjectTestCase {\n\n  /**\n  * @var CustomAudience\n  */\n  protected $customaudience;\n\n  public function setup() {\n    parent::setup();\n    $adaccount = new AdAccount($this->getConfig()->accountId);\n    $params = array(\n      CustomAudienceFields::NAME => $this->getConfig()->testRunId,\n      CustomAudienceFields::SUBTYPE => CustomAudienceSubtypes::CUSTOM,\n    );\n    $this->customaudience = $adaccount->createCustomAudience(\n      array(),\n      $params\n    );\n  }\n\n  public function tearDown() {\n    if ($this->customaudience) {\n      $this->customaudience->deleteSelf();\n    }\n  }\n\n  private function checkServerResponse(\n    CustomAudience $ca,\n    array $users,\n    array $schema,\n    $is_hashed,\n    $is_normalized) {\n    $add = $ca->addUsersMultiKey($users, $schema, $is_hashed, $is_normalized);\n    $this->assertClusterChangesResponse($ca, $users, $add);\n    $remove = $ca->removeUsersMultiKey($users, $schema, $is_hashed, $is_normalized);\n    $this->assertClusterChangesResponse($ca, $users, $remove);\n  }\n\n\n  protected function assertClusterChangesResponse(\n    CustomAudience $ca, array $users, $response) {\n\n    $this->assertTrue(is_array($response));\n\n    $this->assertArrayHasKey('audience_id', $response);\n    $this->assertEquals(\n      $response['audience_id'], $ca->{CustomAudienceFields::ID});\n    $this->assertArrayHasKey('num_received', $response);\n    $this->assertEquals($response['num_received'], count($users));\n    $this->assertArrayHasKey('num_invalid_entries', $response);\n    $this->assertEquals($response['num_invalid_entries'], 0);\n  }\n\n  public function testMultikeyCustomAudiences() {\n    $users = array(\n      array('abc123def', 'fname', 'lname', 'someone@example.com'),\n      array('abc234def', 'fname_new', 'lname_new', 'someone_new@example.com'),\n    );\n    $schema = array(\n      CustomAudienceMultikeySchemaFields::EXTERN_ID,\n      CustomAudienceMultikeySchemaFields::FIRST_NAME,\n      CustomAudienceMultikeySchemaFields::LAST_NAME,\n      CustomAudienceMultikeySchemaFields::EMAIL,\n    );\n    $is_hashed = false;\n    $is_normalized = false;\n    $this->checkServerResponse(\n      $this->customaudience,\n      $users,\n      $schema,\n      $is_hashed,\n      $is_normalized);\n  }\n\n  public function testSinglekeyExternIDCustomAudiences() {\n    $users = array(\n      array('abc123def'),\n      array('abc234def'),\n      array('abc345def'),\n      array('abc456def'),\n    );\n    $schema = array(\n      CustomAudienceMultikeySchemaFields::EXTERN_ID,\n    );\n    $is_hashed = false;\n    $is_normalized = false;\n    $this->checkServerResponse(\n      $this->customaudience,\n      $users,\n      $schema,\n      $is_hashed,\n      $is_normalized);\n  }\n\n}\n", "num_lines": 128}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Object\\Fields\\CustomAudienceFields;\nuse FacebookAds\\Object\\Values\\CustomAudienceSubtypes;\nuse FacebookAds\\Object\\Values\\CustomAudienceTypes;\n\nclass CustomAudienceTest extends AbstractCrudObjectTestCase {\n\n  protected function assertClusterChangesResponse(\n    CustomAudience $ca, array $users, $response) {\n\n    $this->assertTrue(is_array($response));\n\n    $this->assertArrayHasKey('audience_id', $response);\n    $this->assertEquals(\n      $response['audience_id'], $ca->{CustomAudienceFields::ID});\n    $this->assertArrayHasKey('num_received', $response);\n    $this->assertEquals($response['num_received'], count($users));\n    $this->assertArrayHasKey('num_invalid_entries', $response);\n    $this->assertEquals($response['num_invalid_entries'], 0);\n  }\n\n  public function testCustomAudiences() {\n    $ca = new CustomAudience(null, $this->getConfig()->accountId);\n    $ca->{CustomAudienceFields::NAME} = $this->getConfig()->testRunId;\n    $ca->{CustomAudienceFields::SUBTYPE} = CustomAudienceSubtypes::CUSTOM;\n\n    $this->assertCanCreate($ca);\n\n    $this->assertCanRead($ca);\n    $this->assertCanUpdate(\n      $ca,\n      array(\n        CustomAudienceFields::NAME => $this->getConfig()->testRunId.' updated',\n      ));\n\n    $users = array('someone@example.com');\n\n    $add = $ca->addUsers($users, CustomAudienceTypes::EMAIL);\n    $this->assertClusterChangesResponse($ca, $users, $add);\n\n    $remove = $ca->removeUsers($users, CustomAudienceTypes::EMAIL);\n    $this->assertClusterChangesResponse($ca, $users, $remove);\n\n    $optout = $ca->optOutUsers($users, CustomAudienceTypes::EMAIL);\n    $this->assertSuccessResponse($optout);\n\n    $this->assertCanDelete($ca);\n  }\n\n  /**\n   * @depends testCustomAudiences\n   */\n  public function testAppIdsPayload() {\n    $ca = new CustomAudience(null, $this->getConfig()->accountId);\n    $ca->{CustomAudienceFields::NAME} = $this->getConfig()->testRunId;\n    $ca->{CustomAudienceFields::SUBTYPE} = CustomAudienceSubtypes::CUSTOM;\n    $ca->create();\n\n    $users = array($this->getApi()->call('/me')->getContent()['id']);\n\n    $add = $ca->addUsers(\n      $users, CustomAudienceTypes::ID, array($this->getConfig()->appId));\n    $this->assertClusterChangesResponse($ca, $users, $add);\n\n    $remove = $ca->removeUsers(\n      $users, CustomAudienceTypes::ID, array($this->getConfig()->appId));\n    $this->assertClusterChangesResponse($ca, $users, $remove);\n\n    $optout = $ca->optOutUsers(\n      $users, CustomAudienceTypes::ID, array($this->getConfig()->appId));\n    $this->assertSuccessResponse($optout);\n\n    $ca->deleteSelf();\n  }\n}\n", "num_lines": 102}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Object\\AdsPixel;\nuse FacebookAds\\Object\\ObjectStorySpec;\nuse FacebookAds\\Object\\ProductAudience;\nuse FacebookAds\\Object\\ProductCatalog;\nuse FacebookAds\\Object\\ProductSet;\nuse FacebookAds\\Object\\TargetingSpecs;\nuse FacebookAds\\Object\\ObjectStory\\TemplateData;\nuse FacebookAds\\Object\\Fields\\CampaignFields;\nuse FacebookAds\\Object\\Fields\\AdCreativeFields;\nuse FacebookAds\\Object\\Fields\\AdFields;\nuse FacebookAds\\Object\\Fields\\AdSetFields;\nuse FacebookAds\\Object\\Fields\\AdsPixelsFields;\nuse FacebookAds\\Object\\Fields\\ObjectStory\\TemplateDataFields;\nuse FacebookAds\\Object\\Fields\\ObjectStorySpecFields;\nuse FacebookAds\\Object\\Fields\\ProductAudienceFields;\nuse FacebookAds\\Object\\Fields\\ProductCatalogFields;\nuse FacebookAds\\Object\\Fields\\ProductSetFields;\nuse FacebookAds\\Object\\Fields\\TargetingSpecsFields;\nuse FacebookAds\\Object\\Values\\AdObjectives;\nuse FacebookAds\\Object\\Values\\BillingEvents;\nuse FacebookAds\\Object\\Values\\CallToActionTypes;\nuse FacebookAds\\Object\\Values\\OptimizationGoals;\n\nclass DynamicProductAdsAdvertTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * @var ProductSet\n   */\n  protected $productSet;\n\n  /**\n   * @var ProductCatalog\n   */\n  protected $productCatalog;\n\n  /**\n   * @var AdsPixel\n   */\n  protected $adsPixel;\n\n  /**\n   * @var ProductAudience\n   */\n  protected $productAudience;\n\n  /**\n   * @var Campaign\n   */\n  protected $campaign;\n\n  /**\n   * @var AdSet\n   */\n  protected $adSet;\n\n  /**\n   * @var Ad\n   */\n  protected $ad;\n\n  /**\n   * @var AdCreative\n   */\n  protected $creative;\n\n  public function setup() {\n    parent::setup();\n\n    $account = new AdAccount($this->getConfig()->accountId);\n    $this->adsPixel = $account->getAdsPixels()->current();\n    if ($this->adsPixel === null) {\n      throw new \\Exception('Ads Pixel is null');\n    }\n\n    $this->productCatalog =\n      new ProductCatalog(null, $this->getConfig()->businessId);\n    $this->productCatalog->setData(array(\n      ProductCatalogFields::NAME => $this->getConfig()->testRunId,\n    ));\n    $this->productCatalog->create();\n\n    $this->productSet =\n      new ProductSet(null, $this->productCatalog->{ProductCatalogFields::ID});\n    $this->productSet->setData(array(\n      ProductSetFields::NAME => $this->getConfig()->testRunId,\n      ProductSetFields::FILTER => array(\n        'retailer_id' => array(\n          'is_any' => array('pid1', 'pid2')\n        )\n      )\n    ));\n    $this->productSet->create();\n\n    $this->productAudience\n      = new ProductAudience(null, $this->getConfig()->accountId);\n    $this->productAudience->setData(array(\n      ProductAudienceFields::NAME => $this->getConfig()->testRunId,\n      ProductAudienceFields::PRODUCT_SET_ID =>\n        $this->productSet->{ProductSetFields::ID},\n      ProductAudienceFields::PIXEL_ID =>\n        $this->adsPixel->{AdsPixelsFields::ID},\n      ProductAudienceFields::INCLUSIONS => array(array(\n        'retention_seconds' => 86400,\n        'rule' => array(\n          'and' => array(\n            array('event' => array('eq'=>'ViewContent')),\n            array('userAgent' => array('i_contains'=>'iPhone'))\n          )\n        )\n      )),\n    ));\n\n    $this->productAudience->create();\n  }\n\n  public function tearDown() {\n    if ($this->productSet) {\n      $this->productSet->deleteSelf();\n      $this->productSet = null;\n    }\n\n    if ($this->productCatalog) {\n      $this->productCatalog->deleteSelf();\n      $this->productCatalog = null;\n    }\n\n    if ($this->productAudience) {\n      $this->productAudience->deleteSelf();\n      $this->productAudience = null;\n    }\n\n    if ($this->campaign) {\n      $this->campaign->deleteSelf();\n      $this->campaign = null;\n    }\n\n    if ($this->adSet) {\n      $this->adSet->deleteSelf();\n      $this->adSet = null;\n    }\n\n    if ($this->ad) {\n      $this->ad->deleteSelf();\n      $this->ad = null;\n    }\n\n    if ($this->creative) {\n      $this->creative->deleteSelf();\n      $this->creative = null;\n    }\n\n    parent::tearDown();\n  }\n\n  public function testDynamicProductAdsCreation() {\n    $this->campaign = new Campaign(null, $this->getConfig()->accountId);\n    $this->campaign->setData(array(\n      CampaignFields::NAME => $this->getConfig()->testRunId,\n      CampaignFields::OBJECTIVE => AdObjectives::PRODUCT_CATALOG_SALES,\n      CampaignFields::PROMOTED_OBJECT =>\n        array('product_catalog_id' =>\n          $this->productCatalog->{ProductCatalogFields::ID})\n     ));\n    $this->assertCanCreate($this->campaign);\n\n    $targeting = new TargetingSpecs();\n    $targeting->{TargetingSpecsFields::GEO_LOCATIONS} =\n      array('countries' => array('US'));\n    $targeting->{TargetingSpecsFields::DYNAMIC_AUDIENCE_IDS} =\n      array($this->productAudience->{ProductAudienceFields::ID});\n\n    $this->adSet = new AdSet(null, $this->getConfig()->accountId);\n    $this->adSet->setData(array(\n      AdSetFields::NAME => $this->getConfig()->testRunId,\n      AdSetFields::OPTIMIZATION_GOAL => OptimizationGoals::LINK_CLICKS,\n      AdSetFields::BILLING_EVENT => BillingEvents::IMPRESSIONS,\n      AdSetFields::BID_AMOUNT => 2,\n      AdSetFields::DAILY_BUDGET => 2000,\n      AdSetFields::CAMPAIGN_ID =>\n        $this->campaign->{CampaignFields::ID},\n      AdSetFields::TARGETING => $targeting,\n      AdsetFields::PROMOTED_OBJECT =>\n        array(\n          'product_set_id' => $this->productSet->{ProductSetFields::ID},\n        ),\n    ));\n    $this->assertCanCreate($this->adSet);\n\n    $template = new TemplateData();\n    $template->setData(array(\n      TemplateDataFields::DESCRIPTION => '{{product.description}}',\n      TemplateDataFields::LINK => 'http://www.example.com/',\n      TemplateDataFields::MESSAGE => 'Test DPA Ad Message',\n      TemplateDataFields::NAME => '{{product.name | titleize}}',\n      TemplateDataFields::CALL_TO_ACTION => array(\n        'type' => CallToActionTypes::SHOP_NOW\n      ),\n    ));\n\n    $story = new ObjectStorySpec();\n    $story->setData(array(\n      ObjectStorySpecFields::PAGE_ID => $this->getConfig()->pageId,\n      ObjectStorySpecFields::TEMPLATE_DATA => $template,\n    ));\n\n    $this->creative = new AdCreative(null, $this->getConfig()->accountId);\n    $this->creative->setData(array(\n      AdCreativeFields::NAME => $this->getConfig()->testRunId,\n      AdCreativeFields::OBJECT_STORY_SPEC => $story,\n      AdCreativeFields::PRODUCT_SET_ID =>\n        $this->productSet->{ProductSetFields::ID},\n    ));\n    $this->assertCanCreate($this->creative);\n\n    $this->ad = new Ad(null, $this->getConfig()->accountId);\n    $this->ad->setData(array(\n      AdFields::NAME => 'DPA Test Ad 1 '.$this->getConfig()->testRunId,\n      AdFields::ADSET_ID => $this->adSet->{AdSetFields::ID},\n      AdFields::CREATIVE =>\n        array('creative_id' => $this->creative->{AdCreativeFields::ID}),\n    ));\n    $this->assertCanCreate($this->ad);\n  }\n}\n", "num_lines": 256}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AbstractCrudObject;\n\nclass EmptyCrudObject extends AbstractCrudObject {\n}\n", "num_lines": 31}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAds\\Object\\AbstractObject;\n\nclass EmptyObject extends AbstractObject {\n\n  /**\n   * @var array\n   */\n  protected static $fields = array(\n    AbstractCrudObject::FIELD_ID,\n  );\n}\n", "num_lines": 39}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\Fields\\LeadgenFormFields;\nuse FacebookAds\\Object\\LeadgenForm;\nuse FacebookAds\\Object\\Page;\n\nclass LeadgenFormTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * @var int\n   */\n  protected $leadgenFormId;\n\n  public function setup() {\n    parent::setup();\n\n    $page = new Page($this->getConfig()->pageId);\n    $forms = $page->getLeadgenForms();\n\n    if ($forms->count() === 0) {\n      $this->markTestSkipped(sprintf(\n        'LeadgenForms can\\'t be created through the API.'\n          .' Page %s has no leadgen forms',\n        (string)$this->getConfig()->pageId));\n    }\n\n    $this->leadgenFormId = $forms->current()->{LeadgenFormFields::ID};\n  }\n\n  public function tearDown() {\n    $this->leadgenFormId = null;\n\n    parent::tearDown();\n  }\n\n  public function testCrud() {\n    $form = new LeadgenForm($this->leadgenFormId);\n\n    $this->assertCannotCreate($form);\n    $this->assertCanRead($form);\n    $this->assertCannotUpdate($form);\n    $this->assertCanFetchConnection($form, 'getLeads');\n    $this->assertCannotDelete($form);\n  }\n}\n", "num_lines": 70}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\Fields\\LeadFields;\nuse FacebookAds\\Object\\Fields\\LeadgenFormFields;\nuse FacebookAds\\Object\\Lead;\nuse FacebookAds\\Object\\LeadgenForm;\nuse FacebookAds\\Object\\Page;\n\nclass LeadTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * @var int\n   */\n  protected $leadId;\n\n  public function setup() {\n    parent::setup();\n\n    $limit = 25;\n    $page = new Page($this->getConfig()->pageId);\n    $forms = $page->getLeadgenForms(\n      array(LeadgenFormFields::ID),\n      array('limit' => $limit));\n\n    $forms->setUseImplicitFetch(false); // Force-disable pagination\n\n    /** @var LeadgenForm $form */\n    foreach ($forms as $form) {\n      $leads = $form->getLeads();\n      if ($leads->count() > 0) {\n        $this->leadId = $leads->current()->{LeadFields::ID};\n        break;\n      }\n    }\n\n    if ($this->leadId === null) {\n      $this->markTestSkipped(sprintf(\n        'Leads can\\'t be created through the API.'\n          .' The first %d leadgen forms of Page %s have no leads',\n        $limit,\n        (string)$this->getConfig()->pageId));\n    }\n  }\n\n  public function tearDown() {\n    $this->leadId = null;\n\n    parent::tearDown();\n  }\n\n  public function testCrud() {\n    $lead = new Lead($this->leadId);\n\n    $this->assertCannotCreate($lead);\n    $this->assertCanRead($lead);\n    $this->assertCannotUpdate($lead);\n    $this->assertCannotDelete($lead);\n  }\n}\n", "num_lines": 84}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\Page;\n\nclass PageTest extends AbstractCrudObjectTestCase {\n\n  public function testConnections() {\n    $page = new Page($this->getConfig()->pageId);\n\n    $this->assertCannotCreate($page);\n    $this->assertCanRead($page);\n    $this->assertCanFetchConnection($page, 'getLeadgenForms');\n\n    // Page editing is currently not supported in the SDK\n  }\n}\n", "num_lines": 41}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\PartnerCategory;\nuse FacebookAdsTest\\Config\\SkippableFeatureTestInterface;\n\nclass PartnerCategoryTest extends AbstractCrudObjectTestCase\n  implements SkippableFeatureTestInterface {\n\n  /**\n   * @return array\n   */\n  public function skipIfAny() {\n    return array('no_partner_categories');\n  }\n\n  public function testCrudAccess() {\n    $account = new AdAccount($this->getConfig()->accountId);\n    $cursor = $account->getPartnerCategories();\n    if (!$cursor->count()) {\n      $this->markTestSkipped();\n    }\n\n    /* @var $category AbstractCrudObject */\n    $category = $cursor->current();\n\n    $this->assertTrue($category instanceof PartnerCategory);\n    $this->assertCanRead($category);\n    $this->assertCannotUpdate($category);\n    $this->assertCannotDelete($category);\n    $this->assertCannotCreate(\n      new PartnerCategory(null, $this->getConfig()->accountId));\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdsPixel;\nuse FacebookAds\\Object\\ProductAudience;\nuse FacebookAds\\Object\\ProductCatalog;\nuse FacebookAds\\Object\\ProductSet;\nuse FacebookAds\\Object\\Fields\\AdsPixelsFields;\nuse FacebookAds\\Object\\Fields\\ProductAudienceFields;\nuse FacebookAds\\Object\\Fields\\ProductCatalogFields;\nuse FacebookAds\\Object\\Fields\\ProductSetFields;\n\nclass ProductAudienceTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * @var ProductSet\n   */\n  protected $productSet;\n\n  /**\n   * @var ProductCatalog\n   */\n  protected $productCatalog;\n\n  /**\n   * @var AdAccount\n   */\n  protected $account;\n\n  /**\n   * @var AdsPixel\n   */\n  protected $adsPixel;\n\n  public function setup() {\n    parent::setup();\n\n    $this->account = new AdAccount($this->getConfig()->accountId);\n\n    $cursor = $this->account->getAdsPixels();\n    $this->adsPixel = $cursor->current();\n\n    $this->productCatalog =\n      new ProductCatalog(null, $this->getConfig()->businessId);\n    $this->productCatalog->setData(array(\n      ProductCatalogFields::NAME => $this->getConfig()->testRunId,\n    ));\n    $this->productCatalog->create();\n\n    $this->productSet =\n      new ProductSet(null, $this->productCatalog->{ProductCatalogFields::ID});\n    $this->productSet->setData(array(\n      ProductSetFields::NAME => $this->getConfig()->testRunId,\n      ProductSetFields::FILTER => array(\n        'retailer_id' => array(\n          'is_any' => array('pid1', 'pid2')\n        )\n      )\n    ));\n    $this->productSet->create();\n  }\n\n  public function tearDown() {\n    if ($this->productSet) {\n      $this->productSet->deleteSelf();\n      $this->productSet = null;\n    }\n\n    if ($this->productCatalog) {\n      $this->productCatalog->deleteSelf();\n      $this->productCatalog = null;\n    }\n\n    parent::tearDown();\n  }\n\n  public function testCrudAccess() {\n    $audience_name = $this->getConfig()->testRunId;\n    $this->adsPixel->{AdsPixelsFields::ID};\n\n    $audience = new ProductAudience(null, $this->getConfig()->accountId);\n    $audience->setData(array(\n      ProductAudienceFields::NAME => $audience_name,\n      ProductAudienceFields::PRODUCT_SET_ID =>\n        $this->productSet->{ProductSetFields::ID},\n      ProductAudienceFields::PIXEL_ID =>\n        $this->adsPixel->{AdsPixelsFields::ID},\n      ProductAudienceFields::INCLUSIONS => array(array(\n        'retention_seconds' => 86400,\n        'rule' => array(\n          'and' => array(\n            array('event' => array('eq'=>'ViewContent')),\n            array('userAgent' => array('i_contains'=>'iPhone'))\n          )\n        )\n      )),\n    ));\n\n    $this->assertCanCreate($audience);\n    $this->assertCanRead($audience);\n    $this->assertCanUpdate($audience, array(\n      ProductAudienceFields::NAME => $audience_name.' updated',\n    ));\n    $this->assertCanDelete($audience);\n  }\n}\n", "num_lines": 131}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\ProductCatalog;\nuse FacebookAds\\Object\\Fields\\ProductCatalogFields;\n\nclass ProductCatalogTest extends AbstractCrudObjectTestCase {\n\n  public function testCrud() {\n    $catalog_name = $this->getConfig()->testRunId;\n    $catalog = new ProductCatalog(null, $this->getConfig()->businessId);\n    $catalog->setData(array(\n      ProductCatalogFields::NAME => $catalog_name,\n    ));\n\n    $this->assertCanCreate($catalog);\n    $this->assertCanRead($catalog);\n    $this->assertCanUpdate($catalog, array(\n      ProductCatalogFields::NAME => $catalog_name.' updated',\n    ));\n    $this->assertCanFetchConnectionAsArray($catalog, 'getExternalEventSources');\n    $this->assertCanFetchConnection($catalog, 'getProductSets');\n    $this->assertCanFetchConnection($catalog, 'getProductFeeds');\n    $this->assertCanDelete($catalog);\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\ProductCatalog;\nuse FacebookAds\\Object\\ProductFeed;\nuse FacebookAds\\Object\\Fields\\ProductCatalogFields;\nuse FacebookAds\\Object\\Fields\\ProductFeedFields;\n\nclass ProductFeedTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * @var ProductCatalog\n   */\n  protected $productCatalog;\n\n  public function setup() {\n    parent::setup();\n\n    $this->productCatalog\n      = new ProductCatalog(null, $this->getConfig()->businessId);\n    $this->productCatalog->setData(array(\n      ProductCatalogFields::NAME => $this->getConfig()->testRunId,\n    ));\n    $this->productCatalog->create();\n  }\n\n  public function tearDown() {\n    if ($this->productCatalog) {\n      $this->productCatalog->deleteSelf();\n      $this->productCatalog = null;\n    }\n\n    parent::tearDown();\n  }\n\n  public function testCrudAccess() {\n    $feed_name = $this->getConfig()->testRunId;\n    $feed = new ProductFeed(null, $this->productCatalog->id);\n    $feed->setData(array(\n      ProductFeedFields::FILE_NAME => 'my_product_feed.tsv',\n      ProductFeedFields::NAME => $feed_name,\n    ));\n\n    $this->assertCanCreate($feed);\n    $this->assertCanRead($feed);\n    $this->assertCanUpdate($feed, array(\n      ProductFeedFields::NAME => $feed_name.' updated',\n    ));\n    $this->assertCanFetchConnection($feed, 'getProducts');\n    $this->assertCanFetchConnection($feed, 'getUploads');\n    $this->assertCanDelete($feed);\n  }\n}\n", "num_lines": 77}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\ProductCatalog;\nuse FacebookAds\\Object\\ProductSet;\nuse FacebookAds\\Object\\Fields\\ProductCatalogFields;\nuse FacebookAds\\Object\\Fields\\ProductSetFields;\n\nclass ProductSetTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * @var ProductCatalog\n   */\n  protected $productCatalog;\n\n  public function setup() {\n    parent::setup();\n\n    $this->productCatalog\n      = new ProductCatalog(null, $this->getConfig()->businessId);\n    $this->productCatalog->setData(array(\n      ProductCatalogFields::NAME => $this->getConfig()->testRunId,\n    ));\n    $this->productCatalog->create();\n  }\n\n  public function tearDown() {\n    if ($this->productCatalog) {\n      $this->productCatalog->deleteSelf();\n      $this->productCatalog = null;\n    }\n\n    parent::tearDown();\n  }\n\n  public function testCrudAccess() {\n    $feed_name = $this->getConfig()->testRunId;\n    $product_set = new ProductSet(null, $this->productCatalog->id);\n    $product_set->setData(array(\n      ProductSetFields::NAME => $feed_name,\n      ProductSetFields::FILTER => array(\n        'retailer_id' => array(\n          'is_any' => array('pid1', 'pid2')\n        )\n      )\n    ));\n\n    $this->assertCanCreate($product_set);\n    $this->assertCanRead($product_set);\n    $this->assertCanUpdate($product_set, array(\n      ProductSetFields::NAME => $feed_name.' updated',\n    ));\n    $this->assertCanFetchConnection($product_set, 'getProductGroups');\n    $this->assertCanDelete($product_set);\n  }\n}\n", "num_lines": 80}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\Project;\nuse FacebookAds\\Object\\Fields\\ProjectFields;\nuse FacebookAdsTest\\Config\\SkippableFeatureTestInterface;\n\nclass ProjectTest extends AbstractCrudObjectTestCase\n  implements SkippableFeatureTestInterface {\n\n  /**\n   * @return array\n   */\n  public function skipIfAny() {\n    return array('no_business_manager');\n  }\n\n  public function testCrud() {\n    $project = new Project(null, $this->getConfig()->businessId);\n    $project->{ProjectFields::NAME} = 'Test Project';\n\n    $this->assertCanCreate($project);\n    $this->assertCanRead($project);\n    $this->assertCanUpdate($project, array(\n      ProjectFields::NAME => 'Updated Test Project Name'\n    ));\n\n    $this->assertCanFetchConnection($project, 'getPages');\n    $this->assertCanFetchConnection($project, 'getAdAccounts');\n    $this->assertCanFetchConnection($project, 'getApps');\n\n    $project->addPage($this->getConfig()->pageId);\n    $project->deletePage($this->getConfig()->pageId);\n\n    $project->adAdAccount($this->getConfig()->accountId);\n    $project->deleteAdAccount($this->getConfig()->accountId);\n\n    $project->addApp($this->getConfig()->appId);\n    $project->deleteApp($this->getConfig()->appId);\n\n    $this->assertCanDelete($project);\n  }\n}\n", "num_lines": 67}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAdsTest\\AbstractTestCase;\nuse FacebookAds\\Object\\ReachEstimate;\nuse FacebookAds\\Object\\Fields\\ReachEstimateFields;\n\nclass ReachEstimateTest extends AbstractTestCase {\n\n  public function testOnlyInnerData() {\n    $reach_estimate = new ReachEstimate();\n    $reach_estimate->setData(array(\n      'data' => array(\n        ReachEstimateFields::ESTIMATE_READY => true,\n      ),\n    ));\n    $this->assertTrue($reach_estimate->{ReachEstimateFields::ESTIMATE_READY});\n  }\n\n  public function testOnlyOuterData() {\n    $reach_estimate = new ReachEstimate();\n    $reach_estimate->setData(array(\n      ReachEstimateFields::ESTIMATE_READY => true,\n    ));\n    $this->assertTrue($reach_estimate->{ReachEstimateFields::ESTIMATE_READY});\n  }\n\n  public function testInnerDataTakesPrecedenceOverOuterData() {\n    $reach_estimate = new ReachEstimate();\n    $reach_estimate->setData(array(\n      ReachEstimateFields::ESTIMATE_READY => false,\n      'data' => array(\n        ReachEstimateFields::ESTIMATE_READY => true,\n      ),\n     ));\n    $this->assertTrue($reach_estimate->{ReachEstimateFields::ESTIMATE_READY});\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\Fields\\TargetingFields;\nuse FacebookAds\\Object\\ReachFrequencyPrediction;\nuse FacebookAds\\Object\\Fields\\ReachFrequencyPredictionFields as RF;\nuse FacebookAds\\Object\\TargetingSpecs;\nuse FacebookAds\\Object\\Values\\AdObjectives;\nuse FacebookAdsTest\\Config\\SkippableFeatureTestInterface;\n\nclass ReachFrequencyPredictionTest extends AbstractCrudObjectTestCase\n  implements SkippableFeatureTestInterface {\n\n  /**\n   * @return array\n   */\n  public function skipIfAny() {\n    return array('no_reach_and_frequency');\n  }\n\n  public function testCrudAccess() {\n\n    $prediction\n      = new ReachFrequencyPrediction(null, $this->getConfig()->accountId);\n\n    $targeting = new TargetingSpecs();\n    $targeting->{TargetingSpecsFields::GEO_LOCATIONS}\n      = array('countries' => array('US'));\n    $targeting->{TargetingFields::AGE_MAX} = 35;\n    $targeting->{TargetingFields::AGE_MIN} = 20;\n    $targeting->{TargetingFields::GENDERS} = array(2);\n    $targeting->{TargetingFields::PUBLISHER_PLATFORMS} = array('facebook');\n    $targeting->{TargetingFields::DEVICE_PLATFORMS} = array('desktop');\n    $targeting->{TargetingFields::FACEBOOK_POSITIONS} = array('feed');\n\n    $prediction->setData(array(\n      RF::BUDGET => 3000000,\n      RF::TARGET_SPEC => $targeting,\n      RF::START_TIME => strtotime('midnight + 2 weeks'),\n      RF::END_TIME => strtotime('midnight + 3 weeks'),\n      RF::FREQUENCY_CAP => 4,\n      RF::DESTINATION_ID => $this->getConfig()->pageId,\n      RF::PREDICTION_MODE => ReachFrequencyPrediction::PREDICTION_MODE_REACH,\n      RF::OBJECTIVE => AdObjectives::POST_ENGAGEMENT,\n      RF::STORY_EVENT_TYPE => 128,\n    ));\n\n    $this->assertCanCreate($prediction);\n    $this->assertCanDelete($prediction);\n  }\n\n}\n", "num_lines": 76}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAds\\Object\\TargetingSearch;\nuse FacebookAds\\Object\\Search\\TargetingSearchTypes;\n\nclass TargetingSearchTest extends AbstractCrudObjectTestCase {\n\n  public function testCrudAccess() {\n    $cursor = TargetingSearch::search(\n      TargetingSearchTypes::GEOLOCATION, null, 'Lon');\n\n    /* @var $category AbstractCrudObject */\n    $result = $cursor->current();\n    $this->assertTrue($result instanceof TargetingSearch);\n    $this->assertNotEmpty($result->key);\n  }\n}\n", "num_lines": 43}
{"repo_name": "facebook-business-sdk-codegen", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAdsTest\\AbstractUnitTestCase;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\EmailNormalizer;\n\nclass EmailNormalizerTest extends AbstractUnitTestCase {\n\n    /**\n     * @var EmailNormalizer\n     */\n    protected $emailNormalizer;\n\n    public function setUp() {\n        $this->emailNormalizer = new EmailNormalizer();\n    }\n\n    public function testNormalizeData() {\n        return array(\n            array(\n                \"foo@fb.com\\t\\r\\n\\0\\x0B.\",\n                'foo@fb.com',\n            ),\n        );\n    }\n\n    /**\n     * @dataProvider testNormalizeData\n     */\n    public function testNormalize($input, $expected) {\n        $this->assertEquals(\n            $expected,\n            $this->emailNormalizer->normalize('email', $input));\n    }\n}\n", "num_lines": 59}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "#!/usr/bin/env php\n<?php\n/*\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Logger\\CurlLogger;\nuse FacebookAdsTest\\Bootstrap\\IntegrationBootstrap;\n\nchdir(__DIR__);\n\n/** @var IntegrationBootstrap $bootstrap */\nif (in_array('--docsmith-bootstrap', $_SERVER['argv'])) {\n  $bootstrap = require_once __DIR__.'/../docsmith/init_integration.php';\n} else {\n  $bootstrap = require_once __DIR__.'/../test/init_integration.php';\n}\n\n$config = $bootstrap->getConfig();\n\nApi::init($config->appId, $config->appSecret, $config->accessToken);\n\nif (in_array('--dump', $_SERVER['argv'])) {\n  Api::instance()->setLogger(new CurlLogger(STDERR));\n}\n\n$get_class_name = function($object) {\n  return (new ReflectionClass($object))->getShortName();\n};\n\n$delete_object = function(AbstractCrudObject $object) use ($get_class_name) {\n  echo sprintf(\n    ' > Deleting %s %d',\n    $get_class_name($object),\n    $object->{AbstractCrudObject::FIELD_ID}).PHP_EOL;\n\n  try {\n    $object->deleteSelf();\n  } catch (Exception $e) {\n    echo sprintf(\" > Deletion failed with %s: %s\",\n      $get_class_name($e),\n      $e->getMessage()).PHP_EOL;\n  }\n};\n\n$clean_edge = function($cursor_provider) use ($get_class_name, $delete_object) {\n  try {\n    $cursor = call_user_func($cursor_provider);\n    if (!$cursor instanceof Cursor) {\n      throw new ErrorException(sprintf(\n        \"Provider returned instance of %s\",\n        $get_class_name($cursor)));\n    }\n    $cursor->setUseImplicitFetch(true);\n    foreach ($cursor as $object) {\n      if (!$object instanceof AbstractCrudObject) {\n        throw new ErrorException(sprintf(\n          \"Provider returned instance of %s, not a CRUD object\",\n          $get_class_name($object)));\n      }\n\n      $trait = 'FacebookAds\\Object\\Traits\\CannotDelete';\n      if (in_array($trait, (new ReflectionClass($object))->getTraitNames())) {\n        break;\n      }\n      $delete_object($object);\n    }\n  } catch (Exception $e) {\n    echo sprintf(\" > Edge iteration failed with %s: %s\",\n      $get_class_name($e),\n      $e->getMessage()).PHP_EOL;\n  }\n};\n\n$account = new AdAccount($config->accountId);\n$reflection = new ReflectionClass($account);\n\nforeach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {\n  if (\n    strncasecmp($method->getName(), 'get', 3) !== 0\n    || preg_match('/@return\\s+Cursor/', $method->getDocComment()) !== 1\n  ) {\n    continue;\n  }\n\n  echo sprintf(' > Fetching AdAccount::%s', $method->getName()).PHP_EOL;\n  $clean_edge($method->getClosure($account));\n}\n", "num_lines": 112}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsBin;\n\nuse Symfony\\Component\\Finder\\Finder;\n\nchdir(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR);\n\nrequire_once 'vendor'.DIRECTORY_SEPARATOR.'autoload.php';\n\n// Options\n$include_autoloader = !in_array('--no-autoloader', $_SERVER['argv']);\n$compress_gzip = !in_array('--no-gzip', $_SERVER['argv']);\n\n$alias = 'facebook-php-ads-sdk.phar';\n$build_dir = '.'.DIRECTORY_SEPARATOR.'builds'.DIRECTORY_SEPARATOR;\n$out = $build_dir.$alias;\n\nif (!is_dir($build_dir)) {\n  mkdir($build_dir);\n} else if (file_exists($out)) {\n  unlink($out);\n}\n\n$phar = new \\Phar($out, 0, $alias);\n$phar->setSignatureAlgorithm(\\Phar::SHA1);\nif ($compress_gzip) {\n  $phar->compressFiles(\\Phar::GZ);\n}\n$phar->startBuffering();\n$phar->addFile('LICENSE');\n\n$finder = (new Finder())->files()\n  ->ignoreVCS(true)\n  ->name('*.php')\n  ->in('src');\n\nforeach ($finder->getIterator() as $file) {\n  $phar->addFile($file);\n}\n\n$stub = <<<'EOF'\n<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\nPhar::mapPhar('%s');\n\nif (%d) {\n  spl_autoload_register(function($class) {\n    $prefix = 'FacebookAds\\\\';\n    $base_dir = 'phar://%s/src/FacebookAds/';\n    $len = strlen($prefix);\n    if (strncmp($prefix, $class, $len) !== 0) {\n      return;\n    }\n    $relative_class = substr($class, $len);\n    $file = $base_dir.str_replace(\n      '\\\\', DIRECTORY_SEPARATOR, $relative_class).'.php';\n    if (file_exists($file)) {\n      require $file;\n    }\n  });\n}\n\n__HALT_COMPILER();\nEOF;\n\n\n$phar->setStub(sprintf($stub, $alias, $include_autoloader ? 1 : 0, $alias));\n$phar->stopBuffering();\n", "num_lines": 113}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "#!/usr/bin/env php\n<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nuse FacebookAdsTest\\Bootstrap;\nuse FacebookAdsDocsmith\\Runner;\nuse FacebookAdsDocsmith\\Runner\\ActionsEnum;\nuse FacebookAdsDocsmith\\Runner\\OptionsEnum;\nuse FacebookAdsTest\\Bootstrap\\IntegrationBootstrap;\n\n$relative_path = getcwd();\nchdir(__DIR__);\n\n/** @var IntegrationBootstrap $bootstrap */\n$bootstrap = require_once __DIR__.'/../docsmith/init_auto.php';\n\nif ($argc < 3) {\n  Runner::throwInvalidUsage(\"Insufficient number of arguments\");\n}\n\n$action = $argv[1];\nif (!ActionsEnum::getInstance()->isValidValue($action)) {\n  Runner::throwInvalidUsage(\"Unknown action {$action}\");\n}\n\n$doc_path = $argv[2][0] == '/'\n  ? $argv[2]\n  : realpath($relative_path.'/'.$argv[2]);\n\nif (!file_exists($doc_path)) {\n  Runner::throwInvalidUsage(\"Can't open {$doc_path} for reading\");\n}\n\n$opts = array_splice($argv, 3);\n$options = new ArrayObject(\n  array_fill_keys(OptionsEnum::getInstance()->getValues(), false));\n\nforeach ($opts as $opt) {\n  $opt = substr($opt, 1);\n  if (OptionsEnum::getInstance()->isValidValue($opt)) {\n    $options->offsetSet($opt, true);\n  }\n}\n\n$runner = new Runner($doc_path, $action, $options);\n\nexit($runner->run());\n", "num_lines": 69}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "#!/usr/bin/env php\n<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nuse \\FacebookAdsDocsmith\\Bootstrap\\IntegrationBootstrap;\nuse FacebookAds\\Api;\n\nchdir(__DIR__);\n\n/** @var IntegrationBootstrap $bootstrap */\n$bootstrap = require_once __DIR__.'/../docsmith/init_stub.php';\n\necho sprintf('v%s', Api::init('', '', '')->getDefaultGraphVersion()).PHP_EOL;\n", "num_lines": 35}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'name',\n);\n$params = array(\n);\necho json_encode((new AdAccount($id))->getAdCreatives(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'Sample Promoted Post',\n  'object_story_id' => '<pageID>_<postID>',\n);\necho json_encode((new AdAccount($id))->createAdCreative(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'object_story_id' => '<pageID>_<postID>',\n);\necho json_encode((new AdAccount($id))->createAdCreative(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'image_hash' => '<imageHash>',\n  'object_story_spec' => array('page_id' => '<pageID>','link_data' => array('image_hash' => '<imageHash>','link' => '<canvasURI>','name' => 'Creative message','call_to_action' => array('type' => 'LEARN_MORE'))),\n);\necho json_encode((new AdAccount($id))->createAdCreative(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'object_story_spec' => array('page_id' => '<pageID>','template_data' => array('format_option' => 'collection_video','link' => '<canvasURI>','name' => 'English Creative title','message' => 'English Creative message','call_to_action' => array('type' => 'LEARN_MORE'),'retailer_item_ids' => array(0,0,0,0),'customization_rules_spec' => array(array('customization_spec' => array('language' => 'en_XX')),array('customization_spec' => array('language' => 'fr_XX'),'link' => '<canvasURIFR>','name' => 'French Creative title','message' => 'French Creative message')))),\n  'product_set_id' => '<productSetID>',\n);\necho json_encode((new AdAccount($id))->createAdCreative(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'object_story_spec' => array('page_id' => '<pageID>','link_data' => array('picture' => '<imageURL>','link' => '<canvasURI>','name' => 'English Creative title','message' => 'English Creative message','call_to_action' => array('type' => 'LEARN_MORE'),'retailer_item_ids' => array(0,0,0,0),'customization_rules_spec' => array(array('customization_spec' => array('language' => 'en_XX')),array('customization_spec' => array('language' => 'fr_XX'),'picture' => '<imageURLFR>','link' => '<canvasURIFR>','name' => 'French Creative title','message' => 'French Creative message')))),\n  'product_set_id' => '<productSetID>',\n);\necho json_encode((new AdAccount($id))->createAdCreative(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'object_story_spec' => array('page_id' => '<pageID>','video_data' => array('video_id' => '<videoID>','image_url' => '<imageURL>','title' => 'English Creative title','message' => 'English Creative message','call_to_action' => array('type' => 'LEARN_MORE','value' => array('link' => '<canvasURI>')),'retailer_item_ids' => array(0,0,0,0),'customization_rules_spec' => array(array('customization_spec' => array('language' => 'en_XX')),array('customization_spec' => array('language' => 'fr_XX'),'video_id' => '<videoIDFR>','picture' => '<imageURLFR>','link' => '<canvasURIFR>','name' => 'French Creative title','message' => 'French Creative message')))),\n  'product_set_id' => '<productSetID>',\n);\necho json_encode((new AdAccount($id))->createAdCreative(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'Mobile App Installs Ad Set',\n  'daily_budget' => '1000',\n  'bid_amount' => '2',\n  'billing_event' => 'IMPRESSIONS',\n  'optimization_goal' => 'APP_INSTALLS',\n  'campaign_id' => '<adCampaignAppInstallsID>',\n  'promoted_object' => array('application_id' => '<appID>','object_store_url' => '<appLink>'),\n  'targeting' => array('device_platforms' => array('mobile'),'facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US')),'publisher_platforms' => array('facebook','audience_network'),'user_os' => array('IOS')),\n  'status' => 'PAUSED',\n);\necho json_encode((new AdAccount($id))->createAdSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'A CPA Ad Set',\n  'campaign_id' => '<adCampaignLinkClicksID>',\n  'daily_budget' => '5000',\n  'start_time' => '2023-04-24T09:25:05-0700',\n  'end_time' => '2023-05-01T09:25:05-0700',\n  'billing_event' => 'IMPRESSIONS',\n  'optimization_goal' => 'REACH',\n  'bid_amount' => '1000',\n  'promoted_object' => array('page_id' => '<pageID>'),\n  'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US'))),\n  'user_os' => 'iOS',\n  'publisher_platforms' => 'facebook',\n  'device_platforms' => 'mobile',\n);\necho json_encode((new AdAccount($id))->createAdSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'A CPA Ad Set optimized for App Events',\n  'campaign_id' => '<adCampaignAppInstallsID>',\n  'daily_budget' => '300',\n  'start_time' => '2023-04-24T09:25:55-0700',\n  'end_time' => '2023-05-01T09:25:55-0700',\n  'billing_event' => 'IMPRESSIONS',\n  'optimization_goal' => 'OFFSITE_CONVERSIONS',\n  'bid_amount' => '100',\n  'status' => 'PAUSED',\n  'promoted_object' => array('application_id' => '<appID>','object_store_url' => '<appLink>','custom_event_type' => 'PURCHASE'),\n  'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US')),'user_os' => array('iOS')),\n);\necho json_encode((new AdAccount($id))->createAdSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My AdSet',\n  'optimization_goal' => 'REACH',\n  'billing_event' => 'IMPRESSIONS',\n  'bid_amount' => '2',\n  'daily_budget' => '1000',\n  'campaign_id' => '<adCampaignConversionsID>',\n  'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US')),'behaviors' => array(array('id' => 6007101597783,'name' => 'Business Travelers'),array('id' => 6004386044572,'name' => 'Android Owners (All)'))),\n);\necho json_encode((new AdAccount($id))->createAdSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My Adset with bid multiplier',\n  'campaign_id' => '<adCampaignLinkClicksID>',\n  'daily_budget' => '3000',\n  'billing_event' => 'IMPRESSIONS',\n  'optimization_goal' => 'OFFSITE_CONVERSIONS',\n  'bid_amount' => '500',\n  'bid_adjustments' => array('user_groups' => array('gender' => array('male' => 0.8,'female' => 1))),\n  'promoted_object' => array('product_set_id' => '<productSetID>','custom_event_type' => 'ADD_TO_CART'),\n  'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US'))),\n  'status' => 'PAUSED',\n);\necho json_encode((new AdAccount($id))->createAdSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 57}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My First AdSet',\n  'lifetime_budget' => '20000',\n  'start_time' => '2023-04-24T09:24:18-0700',\n  'end_time' => '2023-05-01T09:24:18-0700',\n  'campaign_id' => '<adCampaignLinkClicksID>',\n  'bid_amount' => '500',\n  'billing_event' => 'IMPRESSIONS',\n  'optimization_goal' => 'POST_ENGAGEMENT',\n  'targeting' => array('age_min' => 20,'age_max' => 24,'behaviors' => array(array('id' => 6002714895372,'name' => 'All travelers')),'genders' => array(1),'geo_locations' => array('countries' => array('US'),'regions' => array(array('key' => '4081')),'cities' => array(array('key' => '777934','radius' => 10,'distance_unit' => 'mile'))),'interests' => array(array('id' => '<adsInterestID>','name' => '<adsInterestName>')),'life_events' => array(array('id' => 6002714398172,'name' => 'Newlywed (1 year)')),'facebook_positions' => array('feed'),'publisher_platforms' => array('facebook','audience_network')),\n  'status' => 'PAUSED',\n);\necho json_encode((new AdAccount($id))->createAdSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 57}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My Ad Set',\n  'optimization_goal' => 'LINK_CLICKS',\n  'billing_event' => 'LINK_CLICKS',\n  'bid_amount' => '2',\n  'daily_budget' => '1000',\n  'campaign_id' => '<adCampaignLinkClicksID>',\n  'targeting' => array('device_platforms' => array('mobile'),'geo_locations' => array('countries' => array('US')),'publisher_platforms' => array('facebook','audience_network'),'facebook_positions' => array('feed')),\n);\necho json_encode((new AdAccount($id))->createAdSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My First Adset',\n  'daily_budget' => '2000',\n  'start_time' => '2023-04-17T09:25:24-0700',\n  'end_time' => '2023-04-24T09:25:24-0700',\n  'campaign_id' => '<adCampaignLinkClicksID>',\n  'bid_amount' => '100',\n  'billing_event' => 'LINK_CLICKS',\n  'optimization_goal' => 'LINK_CLICKS',\n  'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US'))),\n  'status' => 'PAUSED',\n);\necho json_encode((new AdAccount($id))->createAdSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 57}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My First AdSet',\n  'daily_budget' => '10000',\n  'bid_amount' => '300',\n  'billing_event' => 'IMPRESSIONS',\n  'optimization_goal' => 'REACH',\n  'campaign_id' => '<adCampaignLinkClicksID>',\n  'promoted_object' => array('page_id' => '<pageID>'),\n  'targeting' => array('facebook_positions' => array('feed'),'age_max' => 24,'age_min' => 20,'behaviors' => array(array('id' => 6002714895372,'name' => 'All travelers')),'device_platforms' => array('mobile'),'genders' => array(1),'geo_locations' => array('countries' => array('US'),'regions' => array(array('key' => '4081')),'cities' => array(array('key' => 777934,'radius' => 10,'distance_unit' => 'mile'))),'interests' => array(array('id' => '<adsInterestID>','name' => '<adsInterestName>')),'life_events' => array(array('id' => 6002714398172,'name' => 'Newlywed (1 year)')),'publisher_platforms' => array('facebook','audience_network')),\n  'status' => 'PAUSED',\n);\necho json_encode((new AdAccount($id))->createAdSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My First AdSet',\n  'daily_budget' => '10000',\n  'bid_amount' => '300',\n  'billing_event' => 'IMPRESSIONS',\n  'optimization_goal' => 'REACH',\n  'campaign_id' => '<adCampaignLinkClicksID>',\n  'promoted_object' => array('page_id' => '<pageID>'),\n  'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US'),'regions' => array(array('key' => '4081')),'cities' => array(array('key' => 777934,'radius' => 10,'distance_unit' => 'mile'))),'genders' => array(1),'age_max' => 24,'age_min' => 20,'publisher_platforms' => array('facebook','audience_network'),'device_platforms' => array('mobile'),'flexible_spec' => array(array('interests' => array(array('id' => '<adsInterestID>','name' => '<adsInterestName>'))))),\n  'status' => 'PAUSED',\n);\necho json_encode((new AdAccount($id))->createAdSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My First Adset',\n  'lifetime_budget' => '20000',\n  'start_time' => '2023-04-17T09:25:36-0700',\n  'end_time' => '2023-04-27T09:25:36-0700',\n  'campaign_id' => '<adCampaignLinkClicksID>',\n  'bid_amount' => '100',\n  'billing_event' => 'LINK_CLICKS',\n  'optimization_goal' => 'LINK_CLICKS',\n  'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US')),'publisher_platforms' => array('facebook','audience_network')),\n  'status' => 'PAUSED',\n);\necho json_encode((new AdAccount($id))->createAdSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 57}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My First Adset',\n  'lifetime_budget' => '20000',\n  'start_time' => '2023-04-17T09:25:45-0700',\n  'end_time' => '2023-04-27T09:25:45-0700',\n  'campaign_id' => '<adCampaignLinkClicksID>',\n  'bid_amount' => '500',\n  'billing_event' => 'IMPRESSIONS',\n  'optimization_goal' => 'POST_ENGAGEMENT',\n  'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US'),'regions' => array(array('key' => '4081')),'cities' => array(array('key' => 777934,'radius' => 10,'distance_unit' => 'mile'))),'genders' => array(1),'age_max' => 24,'age_min' => 20,'behaviors' => array(array('id' => 6002714895372,'name' => 'All travelers')),'life_events' => array(array('id' => 6002714398172,'name' => 'Newlywed (1 year)')),'publisher_platforms' => array('facebook'),'device_platforms' => array('desktop')),\n  'status' => 'PAUSED',\n);\necho json_encode((new AdAccount($id))->createAdSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 57}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My Reach Ad Set',\n  'optimization_goal' => 'REACH',\n  'billing_event' => 'IMPRESSIONS',\n  'bid_amount' => '2',\n  'daily_budget' => '1000',\n  'campaign_id' => '<adCampaignLinkClicksID>',\n  'targeting' => array('geo_locations' => array('countries' => array('US')),'facebook_positions' => array('feed')),\n  'status' => 'PAUSED',\n  'promoted_object' => array('page_id' => '<pageID>'),\n);\necho json_encode((new AdAccount($id))->createAdSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My AdSet',\n  'optimization_goal' => 'REACH',\n  'billing_event' => 'IMPRESSIONS',\n  'bid_amount' => '2',\n  'daily_budget' => '1000',\n  'campaign_id' => '<adCampaignLinkClicksID>',\n  'targeting' => array('geo_locations' => array('countries' => array('US')),'publisher_platforms' => array('facebook'),'facebook_positions' => array('feed')),\n  'promoted_object' => array('page_id' => '<pageID>'),\n);\necho json_encode((new AdAccount($id))->createAdSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 55}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My Reach Ad Set',\n  'optimization_goal' => 'REACH',\n  'billing_event' => 'IMPRESSIONS',\n  'bid_amount' => '2',\n  'daily_budget' => '1000',\n  'campaign_id' => '<adCampaignLinkClicksID>',\n  'targeting' => array('excluded_geo_locations' => array('regions' => array(array('key' => '3847'))),'geo_locations' => array('countries' => array('US')),'facebook_positions' => array('feed')),\n  'status' => 'PAUSED',\n  'promoted_object' => array('page_id' => '<pageID>'),\n);\necho json_encode((new AdAccount($id))->createAdSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdsPixel;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<ADS_PIXEL_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'code',\n);\n$params = array(\n);\necho json_encode((new AdsPixel($id))->getSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdsPixel;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My WCA Pixel',\n);\necho json_encode((new AdAccount($id))->createAdsPixel(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My Ad',\n  'adset_id' => '<adSetID>',\n  'creative' => array('creative_id' => '<adCreativeID>'),\n  'status' => 'PAUSED',\n);\necho json_encode((new AdAccount($id))->createAd(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 51}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My AdGroup with Redownload',\n  'adset_id' => '<adSetID>',\n  'creative' => array('creative_id' => '<adCreativeID>'),\n  'redownload' => '1',\n  'status' => 'PAUSED',\n);\necho json_encode((new AdAccount($id))->createAd(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My First Ad',\n  'adset_id' => '<adSetID>',\n  'creative' => array('creative_id' => '<adCreativeID>'),\n  'tracking_specs' => array('action.type' => 'post_engagement','post' => '<postID>','page' => '<pageID>'),\n  'status' => 'PAUSED',\n);\necho json_encode((new AdAccount($id))->createAd(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdVideo;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'source' => '<videoPath>',\n);\necho json_encode((new AdAccount($id))->createAdVideo(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'name',\n  'objective',\n);\n$params = array(\n  'effective_status' => array('ACTIVE','PAUSED'),\n);\necho json_encode((new AdAccount($id))->getCampaigns(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My campaign',\n  'objective' => 'OUTCOME_TRAFFIC',\n  'status' => 'PAUSED',\n  'special_ad_categories' => array(),\n);\necho json_encode((new AdAccount($id))->createCampaign(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 51}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'id',\n);\n$params = array(\n);\necho json_encode((new AdAccount($id))->getCustomAudiences(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'data_source',\n  'subtype',\n);\n$params = array(\n);\necho json_encode((new AdAccount($id))->getCustomAudiences(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My new Custom Audience',\n  'subtype' => 'CUSTOM',\n  'description' => 'People who purchased on my website',\n  'customer_file_source' => 'USER_PROVIDED_ONLY',\n);\necho json_encode((new AdAccount($id))->createCustomAudience(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 51}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'Test Value-Based lookalike from Pixel',\n  'subtype' => 'LOOKALIKE',\n  'lookalike_spec' => array('origin_event_sources' => array(array('id' => '<sourceID>','event_names' => array('AddToCart'))),'type' => 'custom_ratio','ratio' => 0.01,'country' => 'US'),\n);\necho json_encode((new AdAccount($id))->createCustomAudience(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'Test Value-Based lookalike from Pixel',\n  'subtype' => 'LOOKALIKE',\n  'lookalike_spec' => array('origin_event_sources' => array(array('id' => '<sourceID>')),'type' => 'custom_ratio','ratio' => 0.01,'country' => 'US'),\n);\necho json_encode((new AdAccount($id))->createCustomAudience(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My Test Website Custom Audience',\n  'rule' => array('inclusions' => array('operator' => 'or','rules' => array(array('event_sources' => array(array('id' => '<appID>','type' => 'app')),'retention_seconds' => 8400,'filter' => array('operator' => 'and','filters' => array(array('field' => 'event','operator' => 'eq','value' => 'fb_mobile_purchase'))))))),\n  'prefill' => '1',\n);\necho json_encode((new AdAccount($id))->createCustomAudience(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My Test Engagement Custom Audience',\n  'rule' => array('inclusions' => array('operator' => 'or','rules' => array(array('event_sources' => array(array('id' => '<pageID>','type' => 'page')),'retention_seconds' => 31536000,'filter' => array('operator' => 'and','filters' => array(array('field' => 'event','operator' => 'eq','value' => 'page_engaged')))))),'exclusions' => array('operator' => 'or','rules' => array(array('event_sources' => array(array('id' => '<pageID>','type' => 'page')),'retention_seconds' => 31536000,'filter' => array('operator' => 'and','filters' => array(array('field' => 'event','operator' => 'eq','value' => 'page_cta_clicked'))))))),\n  'prefill' => '1',\n);\necho json_encode((new AdAccount($id))->createCustomAudience(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My Test Engagement Custom Audience',\n  'rule' => array('inclusions' => array('operator' => 'or','rules' => array(array('event_sources' => array(array('id' => '<pageID>','type' => 'page')),'retention_seconds' => 31536000,'filter' => array('operator' => 'and','filters' => array(array('field' => 'event','operator' => 'eq','value' => 'page_engaged'),array('field' => 'event','operator' => 'eq','value' => 'page_engaged'))))))),\n  'prefill' => '1',\n);\necho json_encode((new AdAccount($id))->createCustomAudience(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My Test Engagement Custom Audience',\n  'rule' => array('inclusions' => array('operator' => 'or','rules' => array(array('event_sources' => array(array('id' => '<pageID>','type' => 'page'),array('id' => '<pageID2>','type' => 'page')),'retention_seconds' => 31536000,'filter' => array('operator' => 'and','filters' => array(array('field' => 'event','operator' => 'eq','value' => 'page_engaged'))))))),\n  'prefill' => '1',\n);\necho json_encode((new AdAccount($id))->createCustomAudience(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My Test Engagement Custom Audience',\n  'rule' => array('inclusions' => array('operator' => 'or','rules' => array(array('event_sources' => array(array('id' => '<pageID>','type' => 'page')),'retention_seconds' => 31536000,'filter' => array('operator' => 'and','filters' => array(array('field' => 'event','operator' => 'eq','value' => 'page_engaged'))))))),\n  'prefill' => '1',\n);\necho json_encode((new AdAccount($id))->createCustomAudience(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My Test Website Custom Audience',\n  'rule' => array('inclusions' => array('operator' => 'or','rules' => array(array('event_sources' => array(array('id' => '<pixelID>','type' => 'pixel')),'retention_seconds' => 8400,'filter' => array('operator' => 'and','filters' => array(array('field' => 'url','operator' => 'i_contains','value' => 'shoes'))))))),\n  'prefill' => '1',\n);\necho json_encode((new AdAccount($id))->createCustomAudience(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'Value-Based Custom Audience',\n  'subtype' => 'CUSTOM',\n  'is_value_based' => '1',\n  'customer_file_source' => 'PARTNER_PROVIDED_ONLY',\n);\necho json_encode((new AdAccount($id))->createCustomAudience(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 51}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'Value-Based lookalike',\n  'subtype' => 'LOOKALIKE',\n  'origin_audience_id' => '<valueBasedCustomAudienceID>',\n  'lookalike_spec' => array('type' => 'custom_ratio','ratio' => 0.01,'country' => 'US'),\n);\necho json_encode((new AdAccount($id))->createCustomAudience(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 51}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdPreview;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'creative' => '<adCreativeSpec>',\n  'ad_format' => '<adFormat>',\n);\necho json_encode((new AdAccount($id))->getGeneratePreviews(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdPreview;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'creative' => array('object_story_id' => '<pageID>_<postID>'),\n  'ad_format' => 'DESKTOP_FEED_STANDARD',\n);\necho json_encode((new AdAccount($id))->getGeneratePreviews(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdPreview;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'creative' => array('instagram_actor_id' => '<instagramActorID>','object_story_spec' => array('link_data' => array('call_to_action' => array('type' => 'LEARN_MORE','value' => array('link' => '<url>')),'caption' => 'www.example.com','image_hash' => '<imageHash>','link' => '<url>','message' => 'Message'),'page_id' => '<pageID>')),\n  'ad_format' => 'INSTAGRAM_STANDARD',\n);\necho json_encode((new AdAccount($id))->getGeneratePreviews(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdPreview;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'creative' => array('object_story_spec' => array('link_data' => array('call_to_action' => array('type' => 'USE_APP','value' => array('link' => '<url>')),'description' => 'Description','link' => '<url>','message' => 'Message','name' => 'Name','picture' => '<imageURL>'),'page_id' => '<pageID>')),\n  'ad_format' => 'MOBILE_FEED_STANDARD',\n);\necho json_encode((new AdAccount($id))->getGeneratePreviews(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'name',\n);\n$params = array(\n);\necho json_encode((new AdAccount($id))->getSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'Test Iphone Product Audience',\n  'product_set_id' => '<productSetID>',\n  'inclusions' => array(array('retention_seconds' => 86400,'rule' => array('and' => array(array('event' => array('eq' => 'AddToCart')),array('userAgent' => array('i_contains' => 'iPhone')))))),\n  'exclusions' => array(array('retention_seconds' => 172800,'rule' => array('event' => array('eq' => 'Purchase')))),\n);\necho json_encode((new AdAccount($id))->createProductAudience(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 51}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'Test Product Audience',\n  'product_set_id' => '<productSetID>',\n  'inclusions' => array(array('retention_seconds' => 86400,'rule' => array('event' => array('eq' => 'AddToCart'))),array('retention_seconds' => 72000,'rule' => array('event' => array('eq' => 'ViewContent')))),\n  'exclusions' => array(array('retention_seconds' => 172800,'rule' => array('event' => array('eq' => 'Purchase')))),\n);\necho json_encode((new AdAccount($id))->createProductAudience(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 51}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdAccountReachEstimate;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_ACCOUNT_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'targeting_spec' => array('geo_locations' => array('countries' => array('US')),'age_min' => 20,'age_max' => 40),\n);\necho json_encode((new AdAccount($id))->getReachEstimate(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_CAMPAIGN_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'name',\n);\n$params = array(\n);\necho json_encode((new Campaign($id))->getAds(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_CAMPAIGN_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'name',\n);\n$params = array(\n  'effective_status' => array('ARCHIVED'),\n);\necho json_encode((new Campaign($id))->getAds(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_CAMPAIGN_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'name',\n  'start_time',\n  'end_time',\n  'daily_budget',\n  'lifetime_budget',\n);\n$params = array(\n);\necho json_encode((new Campaign($id))->getAdSets(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_SET_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'adset_schedule',\n);\n$params = array(\n);\necho json_encode((new AdSet($id))->getSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_SET_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'bid_adjustments' => array('user_groups' => array('user_bucket' => array('event_sources' => array('<pixelID>','<appID>'),'1' => 0.1,'2' => 0.2,'3' => 0.3,'default' => array('gender' => array('male' => 0.99,'female' => 0.12))))),\n);\necho json_encode((new AdSet($id))->updateSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_SET_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'billing_event' => 'IMPRESSIONS',\n  'optimization_goal' => 'LINK_CLICKS',\n  'bid_amount' => '200',\n  'targeting' => array('geo_locations' => array('countries' => array('US')),'facebook_positions' => array('feed')),\n);\necho json_encode((new AdSet($id))->updateSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_CREATIVE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'asset_feed_spec',\n);\n$params = array(\n);\necho json_encode((new AdCreative($id))->getSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_CREATIVE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'name',\n  'object_story_id',\n);\n$params = array(\n);\necho json_encode((new AdCreative($id))->getSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_CREATIVE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'instagram_permalink_url',\n);\n$params = array(\n);\necho json_encode((new AdCreative($id))->getSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\AdPreview;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_CREATIVE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'ad_format' => 'DESKTOP_FEED_STANDARD',\n  'product_item_ids' => array('<productItemID>'),\n);\necho json_encode((new AdCreative($id))->getPreviews(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\AdPreview;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_CREATIVE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'ad_format' => 'DESKTOP_FEED_STANDARD',\n);\necho json_encode((new AdCreative($id))->getPreviews(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\AdPreview;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_CREATIVE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'ad_format' => 'DESKTOP_FEED_STANDARD',\n  'product_item_ids' => array('<productItemID>'),\n);\necho json_encode((new AdCreative($id))->getPreviews(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\AdPreview;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_CREATIVE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'ad_format' => 'DESKTOP_FEED_STANDARD',\n  'product_item_ids' => array('<productItemID>'),\n  'dynamic_customization' => array('language' => 'fr_XX','country' => 'FR'),\n);\necho json_encode((new AdCreative($id))->getPreviews(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Object\\Lead;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_GROUP_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n);\necho json_encode((new Ad($id))->getLeads(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Object\\Lead;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_GROUP_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'field_data',\n  'retailer_item_id',\n);\n$params = array(\n);\necho json_encode((new Ad($id))->getLeads(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Object\\Lead;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_GROUP_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'filtering' => array(array('field' => 'time_created','operator' => 'GREATER_THAN','value' => 1681144509)),\n);\necho json_encode((new Ad($id))->getLeads(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<ADGROUP_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'My New Ad',\n);\necho json_encode((new Ad($id))->updateSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<ADGROUP_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'adgroup_status' => 'PAUSED',\n);\necho json_encode((new Ad($id))->updateSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\n// Configurations\n$access_token = null;\n$app_id = null;\n$app_secret = null;\n// should begin with \"act_\" (eg: $account_id = 'act_1234567890';)\n$account_id = null;\ndefine('SDK_DIR', __DIR__ . '/..'); // Path to the SDK directory\n$loader = include SDK_DIR.'/vendor/autoload.php';\ndate_default_timezone_set('America/Los_Angeles');\n// Configurations - End\n\nif(is_null($access_token) || is_null($app_id) || is_null($app_secret)) {\n  throw new \\Exception(\n    'You must set your access token, app id and app secret before executing'\n  );\n}\n\nif (is_null($account_id)) {\n  throw new \\Exception(\n    'You must set your account id before executing');\n}\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\nApi::init($app_id, $app_secret, $access_token);\n$api = Api::instance();\n$api->setLogger(new CurlLogger());\n\n/**\n * Step 1 Read the AdAccount (optional)\n */\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\Fields\\AdAccountFields;\n\n\n$account = (new AdAccount($account_id))->read(array(\n  AdAccountFields::ID,\n  AdAccountFields::NAME,\n  AdAccountFields::ACCOUNT_STATUS,\n));\n\necho \"\\nUsing this account: \";\necho $account->id.\"\\n\";\n\n// Check the account is active\nif($account->{AdAccountFields::ACCOUNT_STATUS} !== 1) {\n  throw new \\Exception(\n    'This account is not active');\n}\n\n/**\n * Step 2 Create the Campaign\n */\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\Fields\\CampaignFields;\nuse FacebookAds\\Object\\Values\\CampaignObjectiveValues;\n\n$campaign = $account->createCampaign(\n  $fields = array(),\n  $params = array(\n    CampaignFields::NAME => 'My First Campaign',\n    CampaignFields::OBJECTIVE => CampaignObjectiveValues::LINK_CLICKS,\n    Campaign::STATUS_PARAM_NAME => Campaign::STATUS_PAUSED,\n  )\n);\n\n\necho \"Campaign ID:\" . $campaign->id . \"\\n\";\n\n/**\n * Step 3 Search Targeting\n */\nuse FacebookAds\\Object\\TargetingSearch;\nuse FacebookAds\\Object\\Search\\TargetingSearchTypes;\nuse FacebookAds\\Object\\Targeting;\nuse FacebookAds\\Object\\Fields\\TargetingFields;\n\n$results = TargetingSearch::search(\n  $type = TargetingSearchTypes::INTEREST,\n  $class = null,\n  $query = 'facebook');\n\n// we'll take the top result for now\n$target = (count($results)) ? $results->current() : null;\n\necho \"Using target: \".$target->name.\"\\n\";\n\n$targeting = new Targeting();\n$targeting->{TargetingFields::GEO_LOCATIONS}\n  = array('countries' => array('GB'));\n$targeting->{TargetingFields::INTERESTS} = array(\n    array(\n        'id' => $target->id,\n        'name' => $target->name,\n    ),\n);\n\n/**\n * Step 4 Create the AdSet\n */\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Object\\Fields\\AdSetFields;\nuse FacebookAds\\Object\\Values\\AdSetOptimizationGoalValues;\nuse FacebookAds\\Object\\Values\\AdSetBillingEventValues;\nuse FacebookAds\\Object\\Values\\AdSetStatusValues;\n\n$adset = $account->createAdSet(\n  $fields = array(),\n  $params = array(\n    AdSetFields::NAME => 'My First AdSet',\n    AdSetFields::CAMPAIGN_ID => 6121920447142,//$campaign->id,\n    AdSetFields::DAILY_BUDGET => '150',\n    AdSetFields::TARGETING => $targeting,\n    AdSetFields::OPTIMIZATION_GOAL => AdSetOptimizationGoalValues::REACH,\n    AdSetFields::BILLING_EVENT => AdSetBillingEventValues::IMPRESSIONS,\n    AdSetFields::BID_AMOUNT => 100,\n    AdSetFields::START_TIME =>\n      (new \\DateTime(\"+1 week\"))->format(\\DateTime::ISO8601),\n    AdSetFields::END_TIME =>\n      (new \\DateTime(\"+2 week\"))->format(\\DateTime::ISO8601),\n    AdSetFields::STATUS => AdSetStatusValues::ACTIVE,\n  )\n);\n\n\necho 'AdSet  ID: '. $adset->id . \"\\n\";\n\n/**\n * Step 5 Create an AdImage\n */\nuse FacebookAds\\Object\\AdImage;\nuse FacebookAds\\Object\\Fields\\AdImageFields;\n\n$image = $account->createAdImage(\n  array(),\n  array(\n    AdImageFields::FILENAME => SDK_DIR.'/test/misc/image.png',\n  )\n);\necho 'Image Hash: '.$image->hash . \"\\n\";\n\n/**\n * Step 6 Create an AdCreative\n */\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\Fields\\AdCreativeFields;\n\n$creative = $account->createAdCreative(\n  array(),\n  array(\n    AdCreativeFields::NAME => 'Sample Creative',\n    AdCreativeFields::TITLE => 'Welcome to the Jungle',\n    AdCreativeFields::BODY => 'We\\'ve got fun \\'n\\' games',\n    AdCreativeFields::IMAGE_HASH => $image->hash,\n    AdCreativeFields::OBJECT_URL => 'http://www.example.com/',\n  )\n);\n\necho 'Creative ID: '.$creative->id . \"\\n\";\n\n/**\n * Step 7 Create an Ad\n */\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Object\\Fields\\AdFields;\n\n$account->createAd(\n  array(),\n  array(\n    AdFields::CREATIVE => array('creative_id' => $creative->id),\n    AdFields::NAME => 'My First Ad',\n    AdFields::ADSET_ID => $adset->id,\n  )\n);\n\necho 'Ad ID:' . $ad->id . \"\\n\";\n", "num_lines": 202}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Object\\AdsInsights;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<AD_SET_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'impressions',\n);\n$params = array(\n  'breakdown' => 'publisher_platform',\n);\necho json_encode((new AdSet($id))->getInsights(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdsPixel;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<ADS_PIXEL_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'data' => array(array('event_name' => 'PageView','event_time' => 1681748568,'user_data' => array('fbc' => 'fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890','fbp' => 'fb.1.1558571054389.1098115397','em' => '309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd'))),\n);\necho json_encode((new AdsPixel($id))->createEvent(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\nuse FacebookAds\\Object\\ServerSide\\ActionSource;\nuse FacebookAds\\Object\\ServerSide\\Content;\nuse FacebookAds\\Object\\ServerSide\\CustomData;\nuse FacebookAds\\Object\\ServerSide\\DeliveryCategory;\nuse FacebookAds\\Object\\ServerSide\\Event;\nuse FacebookAds\\Object\\ServerSide\\EventRequest;\nuse FacebookAds\\Object\\ServerSide\\UserData;\n\n$access_token = '<ACCESS_TOKEN>';\n$pixel_id = '<ADS_PIXEL_ID>';\n\n$api = Api::init(null, null, $access_token);\n$api->setLogger(new CurlLogger());\n\n$user_data = (new UserData())\n    ->setEmails(array('joe@eg.com'))\n    ->setPhones(array('12345678901', '14251234567'))\n    // It is recommended to send Client IP and User Agent for Conversions API Events.\n    ->setClientIpAddress($_SERVER['REMOTE_ADDR'])\n    ->setClientUserAgent($_SERVER['HTTP_USER_AGENT'])\n    ->setFbc('fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890')\n    ->setFbp('fb.1.1558571054389.1098115397');\n\n$content = (new Content())\n    ->setProductId('product123')\n    ->setQuantity(1)\n    ->setDeliveryCategory(DeliveryCategory::HOME_DELIVERY);\n\n$custom_data = (new CustomData())\n    ->setContents(array($content))\n    ->setCurrency('usd')\n    ->setValue(123.45);\n\n$event = (new Event())\n    ->setEventName('Purchase')\n    ->setEventTime(time())\n    ->setEventSourceUrl('http://jaspers-market.com/product/123')\n    ->setUserData($user_data)\n    ->setCustomData($custom_data)\n    ->setActionSource(ActionSource::WEBSITE);\n\n$events = array();\narray_push($events, $event);\n\n$request = (new EventRequest($pixel_id))\n    ->setEvents($events);\n$response = $request->execute();\nprint_r($response);", "num_lines": 76}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdsPixel;\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PIXEL_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'business' => '<businessID>',\n);\necho json_encode((new AdsPixel($id))->getSharedAccounts(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdsPixel;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PIXEL_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'account_id' => '<adAccountID>',\n  'business' => '<businessID>',\n);\necho json_encode((new AdsPixel($id))->createSharedAccount(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdsPixel;\nuse FacebookAds\\Object\\Business;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PIXEL_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n);\necho json_encode((new AdsPixel($id))->getSharedAgencies(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\n// Configurations\n$access_token = null;\n$app_id = null;\n$app_secret = null;\n// should begin with \"act_\" (eg: $account_id = 'act_1234567890';)\n$account_id = null;\ndefine('SDK_DIR', __DIR__ . '/..'); // Path to the SDK directory\n$loader = include SDK_DIR.'/vendor/autoload.php';\n// Configurations - End\n\nif (is_null($access_token) || is_null($app_id) || is_null($app_secret)) {\n  throw new \\Exception(\n    'You must set your access token, app id and app secret before executing'\n  );\n}\n\nif (is_null($account_id)) {\n  throw new \\Exception(\n    'You must set your account id before executing');\n}\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\nApi::init($app_id, $app_secret, $access_token);\n\n// Create the CurlLogger\n$logger = new CurlLogger();\n\n// To write to a file pass in a file handler\n// $logger = new CurlLogger(fopen('test','w'));\n\n// Attach the logger to the Api instance\nApi::instance()->setLogger($logger);\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\Fields\\AdAccountFields;\n\n$account = (new AdAccount($account_id))->read(array(\n  AdAccountFields::ID,\n  AdAccountFields::NAME,\n  AdAccountFields::ACCOUNT_STATUS,\n));\n", "num_lines": 68}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Object\\AbstractObject;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<CUSTOM_AUDIENCE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n);\necho json_encode((new CustomAudience($id))->deleteSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<CUSTOM_AUDIENCE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n);\necho json_encode((new CustomAudience($id))->getSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<CUSTOM_AUDIENCE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'name',\n  'rule',\n);\n$params = array(\n);\necho json_encode((new CustomAudience($id))->getSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<CUSTOM_AUDIENCE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'Updated Name for CA',\n);\necho json_encode((new CustomAudience($id))->updateSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<CUSTOM_AUDIENCE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'payload' => array('schema' => array('EMAIL','LOOKALIKE_VALUE'),'data' => array(array('9b431636bd164765d63c573c346708846af4f68fe3701a77a3bdd7e7e5166254',44.5),array('8cc62c145cd0c6dc444168eaeb1b61b351f9b1809a579cc9b4c9e9d7213a39ee',140),array('4eaf70b1f7a797962b9d2a533f122c8039012b31e0a52b34a426729319cb792a',0),array('98df8d46f118f8bef552b0ec0a3d729466a912577830212a844b73960777ac56',0.9))),\n);\necho json_encode((new CustomAudience($id))->createUser(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<CUSTOM_AUDIENCE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'payload' => array('schema' => array('EMAIL','MADID','APPUID','LOOKALIKE_VALUE'),'app_ids' => array('<appID>'),'data' => array(array('b36a83701f1c3191e19722d6f90274bc1b5501fe69ebf33313e440fe4b0fe210','6032d997-3ab0-4de0-aa16-8af0e5b482fb','1234567890','0.9'),array('2b3b2b9ce842ab8b6a6c614cb1f9604bb8a0d502d1af49c526b72b10894e95b5','B67385F8-9A82-4670-8C0A-6F9EA7513F5F','','0'),array('898628e28890f937bdf009391def42879c401a4bcf1b5fd24e738d9f5da8cbbb','','9876543210','0.4'))),\n);\necho json_encode((new CustomAudience($id))->createUser(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\n// Configurations\n$access_token = null;\n$app_id = null;\n$app_secret = null;\n// should begin with \"act_\" (eg: $account_id = 'act_1234567890';)\n$account_id = null;\n// Configurations - End\n\nif (is_null($access_token) || is_null($app_id) || is_null($app_secret)) {\n  throw new \\Exception(\n    'You must set your access token, app id and app secret before executing'\n  );\n}\n\nif (is_null($account_id)) {\n  throw new \\Exception(\n    'You must set your account id before executing');\n}\n\ndefine('SDK_DIR', __DIR__ . '/..'); // Path to the SDK directory\n$loader = include SDK_DIR.'/vendor/autoload.php';\n\nuse FacebookAds\\Api;\n\nApi::init($app_id, $app_secret, $access_token);\n\n// use the namespace for Custom Audiences and Fields\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Object\\Fields\\CustomAudienceFields;\nuse FacebookAds\\Object\\Values\\CustomAudienceTypes;\nuse FacebookAds\\Object\\Values\\CustomAudienceSubtypes;\n\n// Create a custom audience object, setting the parent to be the account id\n$audience = new CustomAudience(null, $account_id);\n$audience->setData(array(\n  CustomAudienceFields::NAME => 'My Custom Audiece',\n  CustomAudienceFields::DESCRIPTION => 'Lots of people',\n  CustomAudienceFields::SUBTYPE => CustomAudienceSubtypes::CUSTOM,\n));\n// Create the audience\n$audience->create();\necho \"Audience ID: \" . $audience->id.\"\\n\";\n\n// Assuming you have an array of emails:\n// NOTE: The SDK will hash (SHA-2) your data before submitting\n// it to Facebook servers\n$emails = array(\n  'paul@example.com',\n  'luca@example.com',\n  'bruce@example.com',\n  'peihua@example.com',\n);\n\n$audience->addUsers($emails, CustomAudienceTypes::EMAIL);\n$audience->read(array(CustomAudienceFields::APPROXIMATE_COUNT));\necho \"Estimated Size:\"\n  . $audience->{CustomAudienceFields::APPROXIMATE_COUNT}.\"\\n\";\n", "num_lines": 82}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Business;\nuse FacebookAds\\Object\\OfflineConversionDataSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<BUSINESS_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'offline_event_set',\n  'description' => 'conversion data used for superbowl campaign',\n);\necho json_encode((new Business($id))->createOfflineConversionDataSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Page;\nuse FacebookAds\\Object\\PagePost;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PAGE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n);\necho json_encode((new Page($id))->getFeed(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Page;\nuse FacebookAds\\Object\\PagePost;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PAGE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'message' => 'This is a test value',\n);\necho json_encode((new Page($id))->createFeed(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Page;\nuse FacebookAds\\Object\\PagePost;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PAGE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'message' => 'This is a test message',\n  'call_to_action' => array('type' => 'BUY_NOW','value' => array('link' => '<appLink>','app_link' => '<deepLinkURL>')),\n);\necho json_encode((new Page($id))->createFeed(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Page;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PAGE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n  'location{latitude',\n  'longitude}',\n  'is_permanently_closed',\n);\n$params = array(\n  'limit' => '30000',\n);\necho json_encode((new Page($id))->getLocations(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Page;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'type' => 'adradiussuggestion',\n  'latitude' => '51.5152253',\n  'longitude' => '-0.1423029',\n);\necho json_encode((new Page($id))->getSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Page;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PAGE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'whatsapp_number' => '123456789',\n  'verification_code' => '12345',\n);\necho json_encode((new Page($id))->createPageWhatsappNumberVerification(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Page;\nuse FacebookAds\\Object\\Photo;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PAGE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n);\necho json_encode((new Page($id))->getPhotos(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Page;\nuse FacebookAds\\Object\\Photo;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PAGE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'url' => 'https://www.facebook.com/images/fb_icon_325x325.png',\n  'published' => 'false',\n);\necho json_encode((new Page($id))->createPhoto(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Page;\nuse FacebookAds\\Object\\ProfilePictureSource;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PAGE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'redirect' => '0',\n);\necho json_encode((new Page($id))->getPicture(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\PagePost;\nuse FacebookAds\\Object\\Comment;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PAGE_POST_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'message' => 'This is a test value',\n);\necho json_encode((new PagePost($id))->createComment(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\PagePost;\nuse FacebookAds\\Object\\AbstractObject;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PAGE_POST_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n);\necho json_encode((new PagePost($id))->deleteSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\PagePost;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PAGE_POST_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n);\necho json_encode((new PagePost($id))->getSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\PagePost;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PAGE_POST_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'message' => 'This is a test value',\n);\necho json_encode((new PagePost($id))->updateSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Page;\nuse FacebookAds\\Object\\PagePost;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PAGE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n);\necho json_encode((new Page($id))->getPosts(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Page;\nuse FacebookAds\\Object\\PagePost;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PAGE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'message' => 'Browse our latest products',\n  'published' => '0',\n  'child_attachments' => array(array('link' => '<link>','name' => 'Product 1','description' => '$4.99','image_hash' => '<imageHash>'),array('link' => '<link>','name' => 'Product 2','description' => '$4.99','image_hash' => '<imageHash>'),array('link' => '<link>','name' => 'Product 3','description' => '$4.99','image_hash' => '<imageHash>'),array('link' => '<link>','name' => 'Product 4','description' => '$4.99','image_hash' => '<imageHash>')),\n  'caption' => 'WWW.EXAMPLE.COM',\n  'link' => 'http://www.example.com/products',\n);\necho json_encode((new Page($id))->getPosts(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Page;\nuse FacebookAds\\Object\\User;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PAGE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n);\necho json_encode((new Page($id))->getRoles(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Page;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PAGE_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'subscribed_fields' => 'leadgen',\n);\necho json_encode((new Page($id))->createSubscribedApp(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\ProductCatalog;\nuse FacebookAds\\Object\\ProductEventStat;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PRODUCT_CATALOG_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n);\necho json_encode((new ProductCatalog($id))->getEventStats(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\ProductCatalog;\nuse FacebookAds\\Object\\Hotel;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PRODUCT_CATALOG_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'hotel_id' => 'h_1',\n  'name' => 'Sample Hotel',\n  'description' => 'hotel description',\n  'brand' => 'hotel brand',\n  'url' => 'http://www.example.com/samplehotel',\n  'images' => array(array('image_url' => 'https://www.example.com/pic1.jpg','tags' => array('front view','balcony')),array('image_url' => 'http://www.example.com/pic2.jpg','tags' => array('lobby view'))),\n  'address' => array('street_address' => '1 Hacker Way','city' => 'Menlo Park','region' => 'California','country' => 'United States','postal_code' => '94025','neighborhoods' => array('Palo Alto','Menlo Park'),'latitude' => 37.484116,'longitude' => -122.148244),\n  'guest_ratings' => array(array('score' => 7.8,'max_score' => 10,'rating_system' => 'sample_rating','number_of_raters' => 780)),\n  'star_rating' => '4',\n  'phone' => '+351234123456',\n);\necho json_encode((new ProductCatalog($id))->createHotel(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 57}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\ProductCatalog;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PRODUCT_CATALOG_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'hotel_catalog_settings' => array('pull_config_id' => '<pullConfigID>'),\n);\necho json_encode((new ProductCatalog($id))->updateSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\ProductCatalog;\nuse FacebookAds\\Object\\ProductFeed;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PRODUCT_CATALOG_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'Test Feed',\n  'schedule' => array('interval' => 'DAILY','url' => 'http://www.example.com/sample_feed.tsv','hour' => '22'),\n);\necho json_encode((new ProductCatalog($id))->createProductFeed(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\ProductCatalog;\nuse FacebookAds\\Object\\ProductSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PRODUCT_CATALOG_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'Test Hotel Set',\n  'filter' => array('brand' => array('i_contains' => 'sample brand')),\n);\necho json_encode((new ProductCatalog($id))->createProductSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\ProductCatalog;\nuse FacebookAds\\Object\\ProductSet;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<PRODUCT_CATALOG_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n  'name' => 'Test Set',\n  'filter' => array('product_type' => array('i_contains' => 'shirt')),\n);\necho json_encode((new ProductCatalog($id))->createProductSet(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\ndefine('SDK_DIR', __DIR__ . '/..'); // Path to the SDK directory\n$loader = include SDK_DIR . '/vendor/autoload.php';\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Object\\ServerSide\\Content;\nuse FacebookAds\\Object\\ServerSide\\CustomData;\nuse FacebookAds\\Object\\ServerSide\\Event;\nuse FacebookAds\\Object\\ServerSide\\EventRequest;\nuse FacebookAds\\Object\\ServerSide\\Gender;\nuse FacebookAds\\Object\\ServerSide\\UserData;\n\n// Configuration.\n// Should fill in value before running this script\n$access_token = null;\n$pixel_id = null;\n\nif (is_null($access_token) || is_null($pixel_id)) {\n  throw new Exception(\n    'You must set your access token and pixel id before executing'\n  );\n}\n\n// Initialize\nApi::init(null, null, $access_token);\n$api = Api::instance();\n\n// Create Server Side Event Object\n$event = new Event();\n$event\n  ->setEventName('Purchase')\n  ->setEventTime(time());\n\n$user_data = new UserData();\n$user_data\n  ->setEmail('joe@eg.com')\n  ->setPhone('16505551212')\n  ->setCountryCode('us')\n  ->setGender(Gender::FEMALE);\n\n$custom_content = new Content();\n$custom_content\n  ->setItemPrice(3.5)\n  ->setProductId(\"XYZ789\")\n  ->setQuantity(4);\n\n$custom_contents = array();\narray_push($custom_contents, $custom_content);\n\n$custom_data = new CustomData();\n$custom_data\n  ->setCurrency('USD')\n  ->setValue(14.0)\n  ->setContents($custom_contents);\n\n$event->setUserData($user_data);\n$event->setCustomData($custom_data);\n\n$events = array();\narray_push($events, $event);\narray_push($events, $event);\n\n// Create event request\n$request = new EventRequest($pixel_id);\n$request->setEvents($events);\n// Execute the request\n$response = $request->execute();\n\nprint_r($response);\n", "num_lines": 93}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\User;\nuse FacebookAds\\Object\\Page;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<APP_SCOPED_USER_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n);\necho json_encode((new User($id))->getAccounts(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\User;\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<APP_SCOPED_USER_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n);\necho json_encode((new User($id))->getAdAccounts(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\Lead;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<LEAD_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n);\necho json_encode((new Lead($id))->getSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\User;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<USER_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n);\necho json_encode((new User($id))->getSelf(\n  $fields,\n  $params\n)->exportAllData(), JSON_PRETTY_PRINT);", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse FacebookAds\\Object\\AdVideo;\nuse FacebookAds\\Object\\VideoThumbnail;\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\n\n$access_token = '<ACCESS_TOKEN>';\n$app_secret = '<APP_SECRET>';\n$app_id = '<APP_ID>';\n$id = '<VIDEO_ID>';\n\n$api = Api::init($app_id, $app_secret, $access_token);\n$api->setLogger(new CurlLogger());\n\n$fields = array(\n);\n$params = array(\n);\necho json_encode((new AdVideo($id))->getThumbnails(\n  $fields,\n  $params\n)->getResponse()->getContent(), JSON_PRETTY_PRINT);", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Logger\\CurlLogger;\nuse FacebookAds\\Object\\AbstractObject;\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\Fields\\AdAccountFields;\nuse FacebookAds\\Object\\Fields\\CampaignFields;\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Object\\Targeting;\nuse FacebookAds\\Object\\Fields\\TargetingFields;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Object\\Fields\\AdSetFields;\nuse FacebookAds\\Object\\Values\\AdSetBillingEventValues;\nuse FacebookAds\\Object\\Values\\AdSetOptimizationGoalValues;\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Object\\Fields\\AdFields;\nuse FacebookAds\\Object\\AdImage;\nuse FacebookAds\\Object\\Fields\\AdImageFields;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\Values\\AdCreativeCallToActionTypeValues;\nuse FacebookAds\\Object\\AdCreativeLinkData;\nuse FacebookAds\\Object\\Fields\\AdCreativeLinkDataCallToActionValueFields;\nuse FacebookAds\\Object\\Fields\\AdCreativeLinkDataFields;\nuse FacebookAds\\Object\\AdCreativeObjectStorySpec;\nuse FacebookAds\\Object\\Fields\\AdCreativeObjectStorySpecFields;\nuse FacebookAds\\Object\\Fields\\AdCreativeFields;\nuse FacebookAds\\Object\\Values\\PageCallToActionWebDestinationTypeValues;\n\nuse FacebookAds\\Object\\Business;\nuse FacebookAds\\Object\\Fields\\BusinessFields;\nuse FacebookAds\\Object\\ExtendedCredit;\n\n// Run with command: php -S localhost:8000\n\n// *** Replace the constants below ***\n// Aggregator Info:\n$app_id = '';\n$app_secret = '';\n$aggregator_access_token = '';\n$aggregator_bm_id = 0;\n$bm_loc_id = 0;\n// Clients Info\n$page_id = 0;\n\ndefine('SDK_DIR', __DIR__); // Path to the SDK directory\n$loader = include SDK_DIR.'/vendor/autoload.php';\n// Configurations - End\nif (\n  is_null($aggregator_access_token) || is_null($app_id) || is_null($app_secret)\n) {\n  throw new Exception(\n    'You must set your access token, app id and app secret before executing'\n  );\n}\n\n// Initialize a new Session and instanciate an Api object\nApi::init($app_id, $app_secret, $aggregator_access_token);\n\n// The Api object is now available through singleton\n$api = Api::instance();\n$logger = new CurlLogger();\n$api->setLogger($logger);\n\nfunction getEdges($api, $params, $fields, $node_id, $edge) {\n  if ($fields) {\n    $fields = implode(',', $fields);\n    $params['fields'] = $fields;\n  }\n  $response =\n    $api->call('/'.$node_id.'/'.$edge, RequestInterface::METHOD_GET, $params);\n  return $response->getContent();\n}\n\nfunction postEdges($api, $params, $node_id, $edge) {\n  $response =\n    $api->call('/'.$node_id.'/'.$edge, RequestInterface::METHOD_POST, $params);\n  return $response->getContent();\n}\n\nfunction setAccessToken($access_token) {\n  global $app_secret, $app_id;\n  Api::init($app_id, $app_secret, $access_token);\n  $api = Api::instance();\n  $logger = new CurlLogger();\n  $api->setLogger($logger);\n  return $api;\n}\n\nfunction create_client_business($access_token) {\n  global\n    $app_id,\n    $app_secret,\n    $aggregator_bm_id,\n    $page_id,\n    $bm_loc_id,\n    $aggregator_access_token;\n\n  $api = setAccessToken($access_token);\n  $me = getEdges($api, array(), array(), 'me', '');\n  $app_scoped_user_id = $me['id'];\n\n  $api = setAccessToken($aggregator_access_token);\n  $child_business = (new Business($aggregator_bm_id))->getOwnedBusinesses(\n    array(),\n    array(\n      'client_user_id' => $app_scoped_user_id,\n    ),\n  );\n\n  if (!is_null($child_business) && !is_null($child_business[0])) {\n    $child_business_id = $child_business[0]->id;\n    // A partner can only create one child business manager on behalf\n    // of the user. Exit to avoid erroring.\n    $accounts =\n      (new Business($child_business_id))->getOwnedAdAccounts(array(), array());\n    $existing_account = '';\n    if (!is_null($accounts) && !is_null($accounts[0])) {\n      $existing_account = $accounts[0]->id;\n    }\n    return $child_business_id.','.$existing_account;\n  }\n\n  /**\n   * Step 1 Create the child BM under the Aggregator BM\n   */\n  $child_business = (new Business($aggregator_bm_id))->createOwnedBusiness(\n    array(),\n    array(\n      'id' => $aggregator_bm_id,\n      BusinessFields::NAME => 'Advertisers Name Child BM',\n      BusinessFields::VERTICAL => 'OTHER',\n      'shared_page_id' => $page_id,\n      'page_permitted_roles' => ['ADVERTISER'],\n      'timezone_id' => 1,\n    ),\n  );\n  $child_business_id = $child_business->id;\n\n  /**\n   * Step 2 Share credit line from Aggregator BM to client BM.\n   * This uses the Aggregators access token.\n   */\n  $api = setAccessToken($aggregator_access_token);\n  (new ExtendedCredit($bm_loc_id))->createOwningCreditAllocationConfig(\n    array(),\n    array(\n      'receiving_business_id' => $child_business_id,\n      'amount' => 10,\n    ),\n  );\n\n  /**\n   * Step 3 Create access token System user under child BM.\n   * This uses the Aggregators access token.\n   */\n  $api = setAccessToken($aggregator_access_token);\n  $child_business_token = (new Business($child_business_id))->createAccessToken(\n    array(),\n    array(\n      'id' => $child_business_id,\n      'app_id' => $app_id,\n      'scope' => 'manage_pages,ads_management,business_management',\n    ),\n  );\n  $child_bm_system_user_access_token = $child_business_token->access_token;\n\n  /**\n   * Step 4 Fetch funding source shared with BM\n   * This uses the Child BMs access token.\n   */\n  $api = setAccessToken($child_bm_system_user_access_token);\n  $params = array();\n  $fields = array();\n  $response =\n    getEdges($api, $params, $fields, $child_business_id, 'extendedcredits');\n  $child_bm_payment_method_id = $response['data'][0]['id'];\n\n  /**\n   * Step 5 Create Ad Account\n   * This uses the Child BMs access token. The Admin System user for their\n   * child BM is the owner of the Ad Account.\n   */\n  $api = setAccessToken($child_bm_system_user_access_token);\n  $account = (new Business($child_business_id))->createAdAccount(\n    array(),\n    array(\n      'name' => 'MyAdAccount',\n      'currency' => 'USD',\n      'timezone_id' => 1,\n      'end_advertiser' => $page_id,\n      'media_agency' => 'NONE',\n      'partner' => 'NONE',\n      'funding_id' => $child_bm_payment_method_id,\n    ),\n  );\n  $account_id = $account->id;\n\n  /**\n   * Step 6 Fetch the System user for the client business.\n   * This uses the Child BMs access token. This system user id is used in the api calls below.\n   */\n  $api = setAccessToken($child_bm_system_user_access_token);\n  $system_user_id =\n    (new Business($child_business_id))->getSystemUsers(array(), array())[0]->id;\n\n  /**\n   * Step 7 Add System user as Admin to Ad Account.\n   * This uses the Child BMs access token.\n   */\n  $api = setAccessToken($child_bm_system_user_access_token);\n  (new AdAccount($account_id))->createAssignedUser(\n    array(),\n    array(\n      'user' => $system_user_id,\n      'role' => 'ADMIN',\n      'business' => $child_business_id,\n    ),\n  );\n\n  return $child_business_id.','.$account_id;\n}\n\nfunction create_click_to_messenger_ad(\n  $account_id,\n  $bmid,\n  $ad_message,\n  $page_welcome_message,\n) {\n  global $aggregator_access_token, $app_id, $page_id;\n  $api = setAccessToken($aggregator_access_token);\n  $child_business_token = (new Business($bmid))->createAccessToken(\n    array(),\n    array(\n      'app_id' => $app_id,\n      'scope' => 'manage_pages,ads_management,business_management',\n    ),\n  );\n  $child_bm_system_user_access_token = $child_business_token->access_token;\n  $api = setAccessToken($child_bm_system_user_access_token);\n  $account = new AdAccount($account_id);\n  $campaign = $account->createCampaign(\n    array(),\n    array(\n      CampaignFields::NAME => 'First test Campaign',\n      CampaignFields::OBJECTIVE => 'MESSAGES',\n    ),\n  );\n\n  /**\n   * Step 2 Search Targeting\n   */\n  $targeting = new Targeting();\n  $targeting->setData(array(\n    TargetingFields::GEO_LOCATIONS => array(\n      'countries' => array('JP'),\n      'regions' => array(array('key' => '3886')),\n      'cities' => array(\n        array(\n          'key' => '2420605',\n          'radius' => 10,\n          'distance_unit' => 'mile',\n        ),\n      ),\n    ),\n  ));\n\n  /**\n   * Step 3 Create the AdSet\n   */\n  $start_time = (new \\DateTime(\"+1 week\"))->format(DateTime::ISO8601);\n  $end_time = (new \\DateTime(\"+2 week\"))->format(DateTime::ISO8601);\n  $fields = array();\n  $params = array(\n    AdSetFields::NAME => 'First Ad Set',\n    AdSetFields::OPTIMIZATION_GOAL => AdSetOptimizationGoalValues::REPLIES,\n    AdSetFields::BILLING_EVENT => AdSetBillingEventValues::IMPRESSIONS,\n    AdSetFields::BID_AMOUNT => 2,\n    AdSetFields::DAILY_BUDGET => 1000,\n    AdSetFields::CAMPAIGN_ID => $campaign->id,\n    AdSetFields::TARGETING => $targeting,\n    AdSetFields::START_TIME => $start_time,\n    AdSetFields::END_TIME => $end_time,\n  );\n  $ad_set = $account->createAdSet($fields, $params);\n  $ad_set_id = $ad_set->id;\n\n  /**\n   * Step 4 Create an AdImage\n   */\n\n  $image = new AdImage();\n  $image->setParentId($account->id);\n  $image->{AdImageFields::FILENAME} = SDK_DIR.'<YOUR-IMAGE-PATH>';\n\n  $image->create();\n  $image_hash = $image->hash;\n\n  /**\n   * Step 5 Create an AdCreative\n   */\n\n  $link_data = new AdCreativeLinkData();\n  $link_data->setData(array(\n    AdCreativeLinkDataFields::CALL_TO_ACTION => array(\n      'type' => AdCreativeCallToActionTypeValues::LEARN_MORE,\n      'value' => array(\n        AdCreativeLinkDataCallToActionValueFields::APP_DESTINATION =>\n          PageCallToActionWebDestinationTypeValues::MESSENGER,\n      ),\n    ),\n    AdCreativeLinkDataFields::LINK => '<YOUR-LINK>',\n    AdCreativeLinkDataFields::IMAGE_HASH => $image->hash,\n    AdCreativeLinkDataFields::MESSAGE => $ad_message,\n    AdCreativeLinkDataFields::PAGE_WELCOME_MESSAGE => $page_welcome_message,\n  ));\n\n  $object_story_spec = new AdCreativeObjectStorySpec();\n  $object_story_spec->setData(array(\n    AdCreativeObjectStorySpecFields::PAGE_ID => $page_id,\n    AdCreativeObjectStorySpecFields::LINK_DATA => $link_data,\n  ));\n\n  $creative = $account->createAdCreative(\n    array(),\n    array(\n      AdCreativeFields::NAME => 'Sample Creative',\n      AdCreativeFields::OBJECT_STORY_SPEC => $object_story_spec,\n    ),\n  );\n\n  $ad = $account->createAd(\n    array(),\n    array(\n      'status' => 'ACTIVE',\n      'adset_id' => $ad_set_id,\n      'name' => 'My Ad',\n      'creative' => array('creative_id' => $creative->id),\n    ),\n  );\n  $ad_id = $ad->id;\n  return 'Ad ID: '.$ad_id;\n}\n\n$possible_url = array(\"create_client_business\", \"create_click_to_messenger_ad\");\n\n$value = \"An error has occurred\";\n\nif (isset($_GET[\"action\"]) && in_array($_GET[\"action\"], $possible_url)) {\n  switch ($_GET[\"action\"]) {\n    case \"create_client_business\":\n      if (isset($_GET[\"access_token\"]))\n        $value = create_client_business($_GET[\"access_token\"]);\n      else\n        $value = \"Missing argument\";\n      break;\n    case \"create_click_to_messenger_ad\":\n      if (\n        isset($_GET[\"adaccount\"]) &&\n        isset($_GET[\"bmid\"]) &&\n        isset($_GET[\"ad_message\"]) &&\n        isset($_GET[\"page_welcome_message\"])\n      )\n        $value = create_click_to_messenger_ad(\n          $_GET[\"adaccount\"],\n          $_GET[\"bmid\"],\n          $_GET[\"ad_message\"],\n          $_GET[\"page_welcome_message\"],\n        );\n      else\n        $value = \"Missing argument\";\n      break;\n  }\n}\n\n//return JSON array\nexit(json_encode($value));\n?>\n", "num_lines": 404}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds;\n\nclass AnonymousSession implements SessionInterface {\n\n  /**\n   * @return array\n   */\n  public function getRequestParameters() {\n    return array();\n  }\n}\n", "num_lines": 36}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds;\n\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\nuse FacebookAds\\Logger\\LoggerInterface;\nuse FacebookAds\\Logger\\NullLogger;\nuse FacebookAds\\CrashReporter;\n\nclass Api {\n\n  /**\n   * @var string\n   */\n  const VERSION = ApiConfig::APIVersion;\n\n  /**\n   * @var Api\n   */\n  protected static $instance;\n\n  /**\n   * @var SessionInterface\n   */\n  private $session;\n\n  /**\n   * @var LoggerInterface\n   */\n  protected $logger;\n\n  /**\n   * @var Client\n   */\n  protected $httpClient;\n\n  /**\n   * @var string\n   */\n  protected $defaultGraphVersion;\n\n  /**\n   * @param Client $http_client\n   * @param SessionInterface $session A Facebook API session\n   */\n  public function __construct(\n    Client $http_client,\n    SessionInterface $session) {\n    $this->httpClient = $http_client;\n    $this->session = $session;\n  }\n\n  /**\n   * @param string $app_id\n   * @param string $app_secret\n   * @param string $access_token\n   * @return static\n   */\n  public static function init($app_id, $app_secret, $access_token, $log_crash=true) {\n    $session = new Session($app_id, $app_secret, $access_token);\n    $api = new static(new Client(), $session);\n    static::setInstance($api);\n    if ($log_crash) {\n      CrashReporter::enable();\n    }\n    return $api;\n  }\n\n  /**\n   * @return Api|null\n   */\n  public static function instance() {\n    return static::$instance;\n  }\n\n  /**\n   * @param Api $instance\n   */\n  public static function setInstance(Api $instance) {\n    static::$instance = $instance;\n  }\n\n  /**\n   * @param SessionInterface $session\n   * @return Api\n   */\n  public function getCopyWithSession(SessionInterface $session) {\n    $api = new self($this->getHttpClient(), $session);\n    $api->setDefaultGraphVersion($this->getDefaultGraphVersion());\n    $api->setLogger($this->getLogger());\n    return $api;\n  }\n\n  /**\n   * @param string $string\n   * @return string\n   */\n  public static function base64UrlEncode($string) {\n    $str = strtr(base64_encode($string), '+/', '-_');\n    $str = str_replace('=', '', $str);\n    return $str;\n  }\n\n  /**\n   * @param string $path\n   * @param string $method\n   * @param array $params\n   * @return RequestInterface\n   */\n  public function prepareRequest(\n    $path,\n    $method = RequestInterface::METHOD_GET,\n    array $params = array()) {\n\n    $request = $this->getHttpClient()->createRequest();\n    $request->setMethod($method);\n    $request->setGraphVersion($this->getDefaultGraphVersion());\n    $request->setPath($path);\n\n    if ($method === RequestInterface::METHOD_GET) {\n      $params_ref = $request->getQueryParams();\n    } else {\n      $params_ref = $request->getBodyParams();\n    }\n\n    if (!empty($params)) {\n      $params_ref->enhance($params);\n    }\n\n    $params_ref->enhance($this->getSession()->getRequestParameters());\n\n    return $request;\n  }\n\n  /**\n   * @param RequestInterface $request\n   * @return ResponseInterface\n   */\n  public function executeRequest(RequestInterface $request) {\n    $this->getLogger()->logRequest('debug', $request);\n    $response = $request->execute();\n    $this->getLogger()->logResponse('debug', $response);\n\n    return $response;\n  }\n\n  /**\n   * @return string\n   */\n  public function getDefaultGraphVersion() {\n    if ($this->defaultGraphVersion === null) {\n      $match = array();\n      if (preg_match(\"/^\\d+\\.\\d+/\", static::VERSION, $match)) {\n        $this->defaultGraphVersion = $match[0];\n      }\n    }\n\n    return $this->defaultGraphVersion;\n  }\n\n  /**\n   * @param string $version\n   */\n  public function setDefaultGraphVersion($version) {\n    $this->defaultGraphVersion = $version;\n  }\n\n  /**\n   * Make graph api calls\n   *\n   * @param string $path Ads API endpoint\n   * @param string $method Ads API request type\n   * @param array $params Assoc of request parameters\n   * @return ResponseInterface Graph API responses\n   */\n  public function call(\n    $path,\n    $method = RequestInterface::METHOD_GET,\n    array $params = array(),\n    array $file_params = array()) {\n\n    $request = $this->prepareRequest($path, $method, $params);\n\n    if (!empty($file_params)) {\n      foreach($file_params as $key => $value) {\n        $request->getFileParams()->offsetSet($key, $value);\n      }\n    }\n\n    return $this->executeRequest($request);\n  }\n\n  /**\n   * @return SessionInterface\n   */\n  public function getSession() {\n    return $this->session;\n  }\n\n  /**\n   * @param LoggerInterface $logger\n   */\n  public function setLogger(LoggerInterface $logger) {\n    $this->logger = $logger;\n  }\n\n  /**\n   * @return LoggerInterface\n   */\n  public function getLogger() {\n    if ($this->logger === null) {\n      $this->logger = new NullLogger();\n    }\n    return $this->logger;\n  }\n\n  /**\n   * @return Client\n   */\n  public function getHttpClient() {\n    return $this->httpClient;\n  }\n}\n", "num_lines": 248}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\nnamespace FacebookAds;\nclass ApiConfig {\n  const APIVersion = '17.0';\n  const SDKVersion = '17.0.1';\n  const TYPE_CHECKER_STRICT_MODE = false;\n}\n", "num_lines": 30}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds;\n\nuse FacebookAds\\Cursor;\nuse FacebookAds\\AbstractObject;\n\nclass ApiRequest {\n  protected $api;\n  protected $id;\n  protected $method;\n  protected $endpoint;\n  protected $return_prototype;\n  protected $accepted_fields;\n  protected $param_checker;\n  protected $api_type;\n  protected $use_graph_video_endpoint;\n  private $fields;\n  private $params;\n  private $file_params;\n  private $allow_file_upload;\n  private $file_counter;\n\n  public function __construct(\n    Api $api,\n    $id,\n    $method,\n    $endpoint,\n    $return_prototype = null,\n    $api_type = null,\n    $accepted_fields = array(),\n    TypeChecker $param_checker = null,\n    $allow_file_upload = false,\n    $use_graph_video_endpoint = false) {\n    $this->fields = [];\n    $this->params = [];\n    $this->file_params = [];\n    $this->file_counter = 0;\n    $this->api = $api;\n    $this->id = $id;\n    $this->method = $method;\n    $this->endpoint = $endpoint;\n    $this->return_prototype = $return_prototype;\n    $this->api_type = $api_type;\n    $this->accepted_fields = $accepted_fields;\n    $this->param_checker = $param_checker;\n    $this->allow_file_upload = $allow_file_upload;\n    $this->use_graph_video_endpoint = $use_graph_video_endpoint;\n  }\n\n  public function addParam($param, $value) {\n    $extracted_value = $this->extractValue($value);\n    if (!ApiConfig::TYPE_CHECKER_STRICT_MODE\n      || !$this->param_checker->isValidParam($param)\n    ) {\n      if ($this->param_checker->isFileParam($param)) {\n          $this->file_params[$param] = $extracted_value;\n      } else {\n        $this->params[$param] = $extracted_value;\n      }\n    } else {\n      if ($this->param_checker->isValidParamPair($param, $value)) {\n        if ($this->param_checker->isFileParam($param)) {\n          $this->file_params[$param] = $extracted_value;\n        } else {\n          $this->params[$param] = $extracted_value;\n        }\n      } elseif ($this->param_checker->isPrimitiveType($param)) {\n        $param_type = $this->param_checker->getType($param);\n        $this->params[$param] = $this->param_checker->convertStringToPrimType(\n          $param_type, $value);\n      } else {\n        throw new \\LogicException('The value for '.$param.' is not compatible');\n      }\n    }\n    return $this;\n  }\n\n  public function addParams($params) {\n    foreach ($params as $key => $value) {\n      $this->addParam($key, $value);\n    }\n    return $this;\n  }\n\n  public function removeParam($param) {\n    if (array_key_exists($param, $this->params)) {\n      unset($this->params[$param]);\n    } elseif (array_key_exists($param, $this->params)) {\n      unset($this->file_params[$param]);\n    }\n    return $this;\n  }\n\n  public function clearParams() {\n    $this->params = [];\n    $this->file_params = [];\n    return $this;\n  }\n\n  public function getParams() {\n    $all_params = array_merge($this->params, $this->file_params);\n    return $all_params;\n  }\n\n  public function addField($field) {\n    if (ApiConfig::TYPE_CHECKER_STRICT_MODE\n      && !in_array($field, $this->accepted_fields)\n    ) {\n      throw new \\LogicException('Field '.$field.' is not supported');\n    }\n    if (!(in_array($field, $this->fields))) {\n      $this->fields[] = $field;\n    }\n    return $this;\n  }\n\n  public function addFields($fields) {\n    foreach ($fields as $field) {\n      $this->addField($field);\n    }\n    return $this;\n  }\n\n  public function removeField($field) {\n    if (in_array($field, $this->fields)) {\n      $index_to_remove = array_search($field, $this->fields);\n      unset($this->fields[$index_to_remove]);\n    }\n    return $this;\n  }\n\n  public function clearFields() {\n    $this->fields = [];\n    return $this;\n  }\n\n  public function getFields() {\n    return $this->fields;\n  }\n\n  public function addFile($filename) {\n    if (ApiConfig::TYPE_CHECKER_STRICT_MODE && !$this->allow_file_upload) {\n      throw new \\LogicException(\"This api cannot upload files\");\n    }\n    $file_key = 'source'.$this->file_counter;\n    if (file_exists($filename)) {\n      $this->file_params[$file_key] = $filename;\n      $this->file_counter++;\n    }\n    return $this;\n  }\n\n  /**\n   * Execute the request\n   */\n  public function execute() {\n    $url_path = '/'.$this->id.$this->endpoint;\n    $updated_params = $this->params;\n    if (!empty($this->fields)) {\n      $fields = implode(',', $this->fields);\n      $updated_params['fields'] = $fields;\n    }\n    $response = $this->api->call(\n      $url_path, $this->method, $updated_params, $this->file_params);\n    if ($this->api_type === \"EDGE\" && $this->method === \"GET\") {\n      return new Cursor($response, $this->return_prototype, $this->api);\n    } else if ($this->method === \"DELETE\") {\n      return $response;\n    } else {\n      return $this->createObject($response->getContent());\n    }\n  }\n\n  protected function extractValue($value) {\n    if ($this->param_checker->isAbstractObject($value)) {\n      return $value->exportAllData();\n    } else if (is_array($value)) {\n      $extracted_value = [];\n      foreach ($value as $key => $sub_value) {\n        $extracted_value[$key] = $this->extractValue($sub_value);\n      }\n      return $extracted_value;\n    } else {\n      return $value;\n    }\n  }\n\n  protected function createObject(array $object_data) {\n    $object = clone $this->return_prototype;\n    $object->setDataWithoutValidation($object_data);\n    if ($object instanceof AbstractCrudObject) {\n      $object->setApi($this->api);\n    }\n    return $object;\n  }\n}\n", "num_lines": 220}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds;\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Exception\\Exception;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\Exception\\RequestException;\n\n/**\n * Class CrashReasons\n * @package FacebookAds\n */\nclass CrashReasons {\n    const SDK = 'SDK';\n    const API = 'API';\n}\n\n/**\n * Class CrashReporter\n * @package FacebookAds\n */\nclass CrashReporter {\n    const E_FATAL =\n      E_ERROR |\n      E_USER_ERROR |\n      E_PARSE |\n      E_CORE_ERROR |\n      E_COMPILE_ERROR |\n      E_RECOVERABLE_ERROR;\n\n    /**\n     * @var CrashReporter\n     */\n    private static $instance;\n\n    /**\n     * @var resource\n     */\n    private static $handle;\n\n    /**\n     * @var int\n     */\n    private $app_id;\n\n    /**\n     * CrashReporter constructor.\n     * @param int $app_id\n     * @return void\n     */\n    private function __construct(\n      $app_id\n    ) {\n        $this->app_id = $app_id;\n    }\n\n    /**\n     * @return void\n     */\n    public static function enable() {\n        if (!static::$handle) {\n          static::$handle = fopen('php://stdout', 'w');\n        }\n        if (!static::$instance) {\n            $api = Api::instance();\n            if ($api == null) {\n              self::log('Could not initialize API' . PHP_EOL);\n            }\n            static::$instance = new static($api->getSession()->getAppId());\n            static::$instance->registerExceptionHandler();\n            self::log('Enabled' . PHP_EOL);\n        }\n    }\n\n    /**\n     * @return void\n     */\n    public static function disable() {\n        if (static::$instance) {\n            static::$instance = null;\n            restore_exception_handler();\n            restore_error_handler();\n            self::log('Disabled');\n        }\n    }\n\n    /**\n     * @param $handle\n     */\n    public static function setLogger($handle) {\n        if(is_resource($handle)) {\n          static::$handle  = $handle;\n        }\n    }\n\n    /**\n     * @return void\n     */\n    private function registerExceptionHandler() {\n        $lastHandler = set_exception_handler(\n            function (\\Throwable $e) use (&$lastHandler) {\n                self::log('Exception detected!');\n                $params = $this->buildParamsFromException($e);\n                if ($params != null) {\n                    $this->sendReport(array(\n                        'bizsdk_crash_report' => $params\n                    ));\n                }\n                // restore the previous exception\n                if (is_callable($lastHandler)) {\n                    return call_user_func_array($lastHandler, [$e]);\n                } else {\n                    throw $e;\n                }\n            }\n        );\n\n        $lastError = set_error_handler(\n            function ($errno, $errstr, $errfile, $errline) use (&$lastError) {\n                if (($errno & self::E_FATAL) && strpos($errfile, 'FacebookAds') != false) {\n                    self::log('Error detected!');\n                    $e = new \\ErrorException($errstr, 0, $errno, $errfile, $errline);\n                    $params = $this->buildParamsFromException($e);\n                    if ($params != null) {\n                        $this->sendReport(array(\n                            'bizsdk_crash_report' => $params\n                        ));\n                    }\n                }\n                if (is_callable($lastError)) {\n                    return call_user_func_array($lastError, [$errno, $errstr, $errfile, $errline]);\n                } else {\n                    // fall through to the standard PHP error handler\n                    return false;\n                }\n            }\n        );\n    }\n\n    /**\n     * @param \\Throwable $e\n     * @return array|null\n     */\n    private function buildParamsFromException(\\Throwable $e) {\n        if (!($e instanceof Exception || $e instanceof \\ErrorException)) {\n            return NULL;\n        }\n        $reason = CrashReasons::SDK;\n        if ($e instanceof RequestException) {\n            $reason = CrashReasons::API;\n        }\n        $reason .= ' : ' . $e->getMessage();\n        $callstack = explode(PHP_EOL, $e->getTraceAsString());\n        return array(\n            'reason' => $reason,\n            'callstack' => $callstack,\n            'platform' => phpversion()\n        );\n    }\n\n    /**\n     * @param $params\n     */\n    private function sendReport($params) {\n        try {\n            $session = new AnonymousSession();\n            $api = new Api(Api::instance()->getHttpClient(), $session);\n            $request = $api->prepareRequest(\n                '/' . $this->app_id . '/instruments',\n                RequestInterface::METHOD_POST,\n                $params\n            );\n\n            $response = $api->executeRequest($request);\n            $data = $response->getContent();\n            if ($data && $data['success']) {\n                self::log('Successfully sent report' . PHP_EOL);\n            } else {\n                self::log('Failed to send report' . PHP_EOL);\n            }\n        } catch (\\Exception $e) {\n            self::log('Exception on sending report' . PHP_EOL);\n        }\n    }\n\n    /**\n     * @param $message\n     */\n    private static function log($message) {\n      $content = sprintf(\"%s : %s%s\",static::class, $message, PHP_EOL);\n      fwrite(static::$handle, $content);\n    }\n}\n", "num_lines": 217}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds;\n\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\nuse FacebookAds\\Http\\Util;\nuse FacebookAds\\Object\\AbstractObject;\n\nclass Cursor implements \\Iterator, \\Countable, \\ArrayAccess {\n  /**\n   * @var ResponseInterface\n   */\n  protected $response;\n\n  /**\n   * @var Api\n   */\n  protected $api;\n\n  /**\n   * @var AbstractObject[]\n   */\n  protected $objects = array();\n\n  /**\n   * @var int|null\n   */\n  protected $indexLeft;\n\n  /**\n   * @var int|null\n   */\n  protected $indexRight;\n\n  /**\n   * @var int|null\n   */\n  protected $position;\n\n  /**\n   * @var AbstractObject\n   */\n  protected $objectPrototype;\n\n  /**\n   * @var bool\n   */\n  protected static $defaultUseImplicitFetch = false;\n\n  /**\n   * @var bool\n   */\n  protected $useImplicitFetch;\n\n  public function __construct(\n    ResponseInterface $response,\n    AbstractObject $object_prototype,\n    Api $api = null) {\n    $this->response = $response;\n    $this->objectPrototype = $object_prototype;\n    $this->api = $api !== null ? $api : Api::instance();\n    $this->appendResponse($response);\n  }\n\n  /**\n   * @param array $object_data\n   * @return AbstractObject\n   */\n  protected function createObject(array $object_data) {\n    $object = clone $this->objectPrototype;\n    $object->setDataWithoutValidation($object_data);\n    if ($object instanceof AbstractCrudObject) {\n      $object->setApi($this->api);\n    }\n    return $object;\n  }\n\n  /**\n   * @param ResponseInterface $response\n   * @return array\n   * @throws \\InvalidArgumentException\n   */\n  protected function assureResponseData(ResponseInterface $response) {\n    $content = $response->getContent();\n\n    // First, check if the content contains data\n    if (isset($content['data']) && is_array($content['data'])) {\n      $data = $content['data'];\n\n      // If data is an object wrap the object into an array\n      if ($this->isJsonObject($data)) {\n        $data = array($data);\n      }\n      return $data;\n    }\n\n    // Second, check if the content contains special entries\n    if (isset($content['targetingsentencelines'])) {\n      return $content['targetingsentencelines'];\n    }\n    if (isset($content['adaccounts'])) {\n      return $content['adaccounts'];\n    }\n    if (isset($content['users'])) {\n      return $content['users'];\n    }\n\n    // Third, check if the content is an array of objects indexed by id\n    $is_id_indexed_array = true;\n    $objects = array();\n    if (is_array($content) && count($content) >= 1) {\n      foreach ($content as $key => $value) {\n        if ($key === '__fb_trace_id__') {\n          continue;\n        }\n\n        if ($value !== null &&\n            $this->isJsonObject($value) &&\n            isset($value['id']) &&\n            $value['id'] !== null &&\n            $value['id'] === $key) {\n          $objects[] = $value;\n        } else {\n          $is_id_indexed_array = false;\n          break;\n        }\n      }\n    } else {\n      $is_id_indexed_array = false;\n    }\n    if ($is_id_indexed_array) {\n      return $objects;\n    }\n\n    throw new \\InvalidArgumentException(\"Malformed response data\");\n  }\n\n  private function isJsonObject($object) {\n    if (!is_array($object)) {\n      return false;\n    }\n\n    // Consider an empty array as not object\n    if (empty($object)) {\n      return false;\n    }\n\n    // A json object is represented by a map instead of a pure list\n    return array_keys($object) !== range(0, count($object) - 1);\n  }\n\n  /**\n   * @param ResponseInterface $response\n   */\n  protected function prependResponse(ResponseInterface $response) {\n    $this->response = $response;\n    $data = $this->assureResponseData($response);\n    if (empty($data)) {\n      return;\n    }\n\n    $left_index = $this->indexLeft;\n    $count = count($data);\n    $position = $count - 1;\n    for ($i = $left_index - 1; $i >= $left_index - $count; $i--) {\n      $this->objects[$i] = $this->createObject($data[$position--]);\n      --$this->indexLeft;\n    }\n  }\n\n  /**\n   * @param ResponseInterface $response\n   */\n  protected function appendResponse(ResponseInterface $response) {\n    $this->response = $response;\n    $data = $this->assureResponseData($response);\n    if (empty($data)) {\n      return;\n    }\n\n    if ($this->indexRight === null) {\n      $this->indexLeft = 0;\n      $this->indexRight = -1;\n      $this->position = 0;\n    }\n\n    $this->indexRight += count($data);\n\n    foreach ($data as $object_data) {\n      $this->objects[] = $this->createObject($object_data);\n    }\n  }\n\n  /**\n   * @return bool\n   */\n  public static function getDefaultUseImplicitFetch() {\n    return static::$defaultUseImplicitFetch;\n  }\n\n  /**\n   * @param bool $use_implicit_fetch\n   */\n  public static function setDefaultUseImplicitFetch($use_implicit_fetch) {\n    static::$defaultUseImplicitFetch = $use_implicit_fetch;\n  }\n\n  /**\n   * @return bool\n   */\n  public function getUseImplicitFetch() {\n    return $this->useImplicitFetch !== null\n      ? $this->useImplicitFetch\n      : static::$defaultUseImplicitFetch;\n  }\n\n  /**\n   * @param bool $use_implicit_fetch\n   */\n  public function setUseImplicitFetch($use_implicit_fetch) {\n    $this->useImplicitFetch = $use_implicit_fetch;\n  }\n\n  /**\n   * @return string|null\n   */\n  public function getBefore() {\n    $content = $this->getLastResponse()->getContent();\n    return isset($content['paging']['cursors']['before'])\n      ? $content['paging']['cursors']['before']\n      : null;\n  }\n\n  /**\n   * @return string|null\n   */\n  public function getAfter() {\n    $content = $this->getLastResponse()->getContent();\n    return isset($content['paging']['cursors']['after'])\n      ? $content['paging']['cursors']['after']\n      : null;\n  }\n\n  /**\n   * @return RequestInterface\n   */\n  protected function createUndirectionalizedRequest() {\n    $request = $this->getLastResponse()->getRequest()->createClone();\n    $params = $request->getQueryParams();\n    if (isset($params['before'])) {\n      unset($params['before']);\n    }\n    if (isset($params['after'])) {\n      unset($params['after']);\n    }\n\n    return $request;\n  }\n\n  /**\n   * @return string|null\n   */\n  public function getPrevious() {\n    $content = $this->getLastResponse()->getContent();\n    if (isset($content['paging']['previous'])) {\n      return $content['paging']['previous'];\n    }\n\n    $before = $this->getBefore();\n    if ($before !== null) {\n      $request = $this->createUndirectionalizedRequest();\n      $request->getQueryParams()->offsetSet('before', $before);\n      return $request->getUrl();\n    }\n\n    return null;\n  }\n\n  /**\n   * @return string|null\n   */\n  public function getNext() {\n    $content = $this->getLastResponse()->getContent();\n    if (isset($content['paging']['next'])) {\n      return $content['paging']['next'];\n    }\n\n    $after = $this->getAfter();\n    if ($after !== null) {\n      $request = $this->createUndirectionalizedRequest();\n      $request->getQueryParams()->offsetSet('after', $after);\n      return $request->getUrl();\n    }\n\n    return null;\n  }\n\n  /**\n   * @param string $url\n   * @return RequestInterface\n   */\n  protected function createRequestFromUrl($url) {\n    $components = parse_url($url);\n    $request = $this->getLastResponse()->getRequest()->createClone();\n    $request->setDomain($components['host']);\n    $query = isset($components['query'])\n      ? Util::parseUrlQuery($components['query'])\n      : array();\n    $request->getQueryParams()->enhance($query);\n\n    return $request;\n  }\n\n  /**\n   * @return RequestInterface|null\n   */\n  public function createBeforeRequest() {\n    $url = $this->getPrevious();\n    return $url !== null ? $this->createRequestFromUrl($url) : null;\n  }\n\n  /**\n   * @return RequestInterface|null\n   */\n  public function createAfterRequest() {\n    $url = $this->getNext();\n    return $url !== null ? $this->createRequestFromUrl($url) : null;\n  }\n\n  public function fetchBefore() {\n    $request = $this->createBeforeRequest();\n    if (!$request) {\n      return;\n    }\n\n    $this->prependResponse($request->execute());\n  }\n\n  public function fetchAfter() {\n    $request = $this->createAfterRequest();\n    if (!$request) {\n      return;\n    }\n\n    $this->appendResponse($request->execute());\n  }\n\n  /**\n   * @deprecated Use getArrayCopy()\n   * @return AbstractObject[]\n   */\n  public function getObjects() {\n    return $this->objects;\n  }\n\n  /**\n   * @param bool $ksort\n   * @return AbstractObject[]\n   */\n  public function getArrayCopy($ksort = false) {\n    if ($ksort) {\n      // Sort the main array to improve best case performance in future\n      // invocations\n      ksort($this->objects);\n    }\n\n    return $this->objects;\n  }\n\n  /**\n   * @deprecated Use getLastResponse()\n   * @return ResponseInterface\n   */\n  public function getResponse() {\n    return $this->response;\n  }\n\n  /**\n   * @return ResponseInterface\n   */\n  public function getLastResponse() {\n    return $this->response;\n  }\n\n  /**\n   * @return int\n   */\n  public function getIndexLeft() {\n    return $this->indexLeft;\n  }\n\n  /**\n   * @return int\n   */\n  public function getIndexRight() {\n    return $this->indexRight;\n  }\n\n  public function rewind() : void {\n    $this->position = $this->indexLeft;\n  }\n\n  public function end() {\n    $this->position = $this->indexRight;\n  }\n\n  /**\n   * @param int $position\n   */\n  public function seekTo($position) {\n    $position = array_key_exists($position, $this->objects) ? $position : null;\n    $this->position = $position;\n  }\n\n  public function current() : AbstractObject|bool {\n    return isset($this->objects[$this->position])\n      ? $this->objects[$this->position]\n      : false;\n  }\n\n  public function key() : ?int {\n    return $this->position;\n  }\n\n  public function prev() {\n    if ($this->position == $this->getIndexLeft()) {\n      if ($this->getUseImplicitFetch()) {\n        $this->fetchBefore();\n        if ($this->position == $this->getIndexLeft()) {\n          $this->position = null;\n        } else {\n          --$this->position;\n        }\n      } else {\n        $this->position = null;\n      }\n    } else {\n      --$this->position;\n    }\n  }\n\n  public function next() : void {\n    if ($this->position == $this->getIndexRight()) {\n      if ($this->getUseImplicitFetch()) {\n        $this->fetchAfter();\n        if ($this->position == $this->getIndexRight()) {\n          $this->position = null;\n        } else {\n          ++$this->position;\n        }\n      } else {\n        $this->position = null;\n      }\n    } else {\n      ++$this->position;\n    }\n  }\n\n  public function valid() : bool {\n    return isset($this->objects[$this->position]);\n  }\n\n  public function count() : int {\n    return count($this->objects);\n  }\n\n  /**\n   * @param mixed $offset\n   * @param mixed $value\n   */\n  public function offsetSet($offset, $value) : void {\n    if ($offset === null) {\n      $this->objects[] = $value;\n    } else {\n      $this->objects[$offset] = $value;\n    }\n  }\n\n  /**\n   * @param mixed $offset\n   * @return bool\n   */\n  public function offsetExists($offset) : bool {\n    return isset($this->objects[$offset]);\n  }\n\n  /**\n   * @param mixed $offset\n   */\n  public function offsetUnset($offset) : void {\n    unset($this->objects[$offset]);\n  }\n\n  /**\n   * @param mixed $offset\n   * @return mixed\n   */\n  public function offsetGet($offset) : mixed {\n    return isset($this->objects[$offset]) ? $this->objects[$offset] : null;\n  }\n}\n", "num_lines": 525}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds;\n\nclass Session implements SessionInterface {\n\n  /**\n   * @var string\n   */\n  protected $appId;\n\n  /**\n   * @var string\n   */\n  protected $appSecret;\n\n  /**\n   * @var string\n   */\n  protected $accessToken;\n\n  /**\n   * @var string\n   */\n  protected $appSecretProof;\n\n  /**\n   * @param string $app_id\n   * @param string $app_secret\n   * @param string $access_token\n   */\n  public function __construct($app_id, $app_secret, $access_token) {\n    $this->appId = $app_id;\n    $this->appSecret = $app_secret;\n    $this->accessToken = $access_token;\n  }\n\n  /**\n   * @return string\n   */\n  public function getAppId() {\n    return $this->appId;\n  }\n\n  /**\n   * @return string\n   */\n  public function getAppSecret() {\n    return $this->appSecret;\n  }\n\n  /**\n   * @return string\n   */\n  public function getAccessToken() {\n    return $this->accessToken;\n  }\n\n  /**\n   * @return string\n   */\n  public function getAppSecretProof() {\n    if ($this->getAppSecret() === null) {\n      return null;\n    }\n    if ($this->appSecretProof === null) {\n      $this->appSecretProof\n        = hash_hmac('sha256', $this->getAccessToken(), $this->getAppSecret());\n    }\n    return $this->appSecretProof;\n  }\n\n  /**\n   * @return array\n   */\n  public function getRequestParameters() {\n    if ($this->getAppSecretProof() !== null) {\n      return array(\n        'access_token' => $this->getAccessToken(),\n        'appsecret_proof' => $this->getAppSecretProof(),\n      );\n    } else {\n      return array(\n        'access_token' => $this->getAccessToken(),\n      );\n    }\n  }\n}\n", "num_lines": 111}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds;\n\ninterface SessionInterface {\n\n  /**\n   * @return array\n   */\n  public function getRequestParameters();\n}\n", "num_lines": 34}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds;\n\nclass TypeChecker {\n\n  const ABSTRACT_OBJECT_PREFIX = \"FacebookAds\\\\Object\\\\\";\n  private $type_data;\n  private $enum_data;\n  private $primitive_types = [\"unsigned int\", \"int\", \"bool\", \"string\",\n    \"Object\", \"datetime\", \"float\"];\n\n  public function __construct($type_check_info, $type_check_enum) {\n    $this->type_data = $type_check_info;\n    $this->enum_data = $type_check_enum;\n  }\n\n  public function isPrimitiveType($param) {\n    return (in_array($param, $this->primitive_types) ||\n      array_key_exists($param, $this->enum_data));\n  }\n\n  public function convertStringToPrimType($primitive_type, $value) {\n    if (array_key_exists($primitive_type, $this->enum_data)) {\n      return $value;\n    } elseif (in_array($primitive_type, array(\"unsigned int\", \"int\"))) {\n      return intval($value);\n    } elseif ($primitive_type === \"bool\") {\n      return boolval($value);\n    } elseif ($primitive_type === \"float\") {\n      return floatval($value);\n    } elseif ($primitive_type === \"datetime\") {\n      return $value;\n    } elseif ($primitive_type === \"string\") {\n      return $value;\n    } elseif ($primitive_type === \"Object\") {\n      return $value;\n    } else {\n      if (ApiConfig::TYPE_CHECKER_STRICT_MODE) {\n        throw new \\Exception(\"Not a primitive type\");\n      } else {\n        return $value;\n      }\n    }\n  }\n\n  public function getType($param) {\n    if (array_key_exists($param, $this->type_data)) {\n      return $this->type_data[$param];\n    } else {\n      return null;\n    }\n  }\n\n  public function isValidParam($param) {\n    return array_key_exists($param, $this->type_data);\n  }\n\n  public function isValidParamPair($param, $value) {\n    if ($this->isValidParam($param)) {\n      $type = $this->type_data[$param];\n      return $this->checkType($type, $value);\n    }\n    return false;\n  }\n\n  public function checkType($type, $value, $allow_array_for_obj = true) {\n    if ($value === null || $type === null || $type === \"Object\") {\n      return true;\n    } else if (array_key_exists($type, $this->enum_data)) {\n      return in_array($value, $this->enum_data[$type]);\n    } else if ($type === \"file\") {\n      return file_exists($value);\n    } else if ($type === \"list\" || $type === \"map\") {\n      return is_array($value);\n    } else if ($type === \"bool\") {\n      return is_bool($value);\n    } else if ($type === \"int\" || $type === \"unsigned int\" || $type === \"float\") {\n      return is_numeric($value);\n    } else if ($type === \"string\" || $type === \"datetime\") {\n      return is_string($value) || is_numeric($value) || is_bool($value);\n    } else if ($this->isTypeCollection($type, \"list\")) {\n      $sub_types = $this->getTypeFromCollection($type, \"list\");\n      $sub_type = $sub_types[0];\n      if (is_array($value)) {\n        if (empty($value)) {\n          return true;\n        }\n        $all_object_same_type = true;\n        foreach ($value as $key => $sub_value) {\n          $all_object_same_type = ($all_object_same_type &&\n            $this->checkType($sub_type, $sub_value));\n        }\n        return $all_object_same_type;\n      } else {\n        return $this->checkType($sub_type, $value);\n      }\n    } else if ($this->isTypeCollection($type, \"map\")) {\n      if (is_array($value)) {\n        $sub_types = $this->getTypeFromCollection($type, \"map\");\n        if (count($sub_types) === 1) {\n          $sub_key_type = 'string';\n          $sub_value_type = $sub_types[0];\n        } else {\n          $sub_key_type = $sub_types[0];\n          $sub_value_type = $sub_types[1];\n        }\n        $all_object_same_type = true;\n        foreach ($value as $key => $sub_value) {\n          $all_object_same_type = ($all_object_same_type &&\n            $this->checkType($sub_key_type, $key) &&\n            $this->checkType($sub_value_type, $sub_value));\n        }\n        return $all_object_same_type;\n      }\n    } else {\n      // the type is an object\n      if ($allow_array_for_obj && is_array($value)) {\n        return true;\n      }\n      if (!$this->startsWith($type, self::ABSTRACT_OBJECT_PREFIX)) {\n        $type = self::ABSTRACT_OBJECT_PREFIX.$type;\n      }\n      return is_a($value, $type);\n    }\n    return false;\n  }\n\n  public function isAbstractObject($value) {\n    if (is_object($value)) {\n      $cls_name = get_class($value);\n      return $this->startsWith($cls_name, self::ABSTRACT_OBJECT_PREFIX);\n    }\n    return false;\n  }\n\n  private function startsWith($string, $prefix) {\n    return $prefix === \"\" ||\n      strrpos($string, $prefix, -strlen($string)) !== false;\n  }\n\n  public function isListParam($param) {\n    if ($this->isValidParam($param)) {\n      return $this->isTypeCollection($this->type_data[$param], \"list\");\n    }\n    return false;\n  }\n\n  public function isMapParam($param) {\n    if ($this->isValidParam($param)) {\n      return $this->isTypeCollection($this->type_data[$param], \"map\");\n    }\n    return false;\n  }\n\n  public function isFileParam($param) {\n    if ($this->isValidParam($param)) {\n      return ($this->type_data[$param] === \"file\");\n    }\n    return false;\n  }\n\n  public function isTypeCollection($type, $collection) {\n    $len_of_collection = strlen($collection);\n    $typeCollection = substr($type, 0, $len_of_collection);\n    return ($collection === $typeCollection);\n  }\n\n  public function getTypeFromCollection($type, $collection) {\n    return explode(\",\", trim(substr($type, strlen($collection)), \"<>\"));\n  }\n}\n", "num_lines": 195}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Enum;\n\nabstract class AbstractEnum implements EnumInstanceInterface {\n\n  /**\n   * @var array|null\n   */\n  protected $map = null;\n\n  /**\n   * @var array|null\n   */\n  protected $names = null;\n\n  /**\n   * @var array|null\n   */\n  protected $values = null;\n\n  /**\n   * @var array|null\n   */\n  protected $valuesMap = null;\n\n  /**\n   * @var AbstractEnum[]\n   */\n  protected static $instances = array();\n\n  /**\n   * @return string\n   */\n  static function className() {\n    return get_called_class();\n  }\n\n  /**\n   * @return AbstractEnum\n   */\n  public static function getInstance() {\n    $fqn = get_called_class();\n    if (!array_key_exists($fqn, static::$instances)) {\n      static::$instances[$fqn] = new static();\n    }\n\n    return static::$instances[$fqn];\n  }\n\n  /**\n   * @return array\n   */\n  public function getArrayCopy() {\n    if ($this->map === null) {\n      $this->map = (new \\ReflectionClass(get_called_class()))\n        ->getConstants();\n    }\n\n    return $this->map;\n  }\n\n  /**\n   * @return array\n   */\n  public function getNames() {\n    if ($this->names === null) {\n      $this->names = array_keys($this->getArrayCopy());\n    }\n\n    return $this->names;\n  }\n\n  /**\n   * @return array\n   */\n  public function getValues() {\n    if ($this->values === null) {\n      $this->values = array_values($this->getArrayCopy());\n    }\n\n    return $this->values;\n  }\n\n  /**\n   * @return array\n   */\n  public function getValuesMap() {\n    if ($this->valuesMap === null) {\n      $this->valuesMap = array_fill_keys($this->getValues(), null);\n    }\n\n    return $this->valuesMap;\n  }\n\n  /**\n   * @param string|int|float $name\n   * @return mixed\n   */\n  public function getValueForName($name) {\n    $copy = $this->getArrayCopy();\n    return array_key_exists($name, $copy)\n      ? $copy[$name]\n      : null;\n  }\n\n  /**\n   * @param string|int|float $name\n   * @return mixed\n   * @throws \\InvalidArgumentException\n   */\n  public function assureValueForName($name) {\n    $value = $this->getValueForName($name);\n    if ($value === null) {\n      throw new \\InvalidArgumentException(\n        'Unknown name \"'.$name.'\" in '.static::className());\n    }\n\n    return $value;\n  }\n\n  /**\n   * @param string|int|float $name\n   * @return bool\n   */\n  public function isValid($name) {\n    return array_key_exists($name, $this->getArrayCopy());\n  }\n\n  /**\n   * @param string|int|float $name\n   * @throws \\InvalidArgumentException\n   */\n  public function assureIsValid($name) {\n    if (!array_key_exists($name, $this->getArrayCopy())) {\n      throw new \\InvalidArgumentException(\n        'Unknown name \"'.$name.'\" in '.static::className());\n    }\n  }\n\n  /**\n   * @param string|int|float $value\n   * @return bool\n   */\n  public function isValidValue($value) {\n    return array_key_exists($value, $this->getValuesMap());\n  }\n\n  /**\n   * @param mixed $value\n   * @throws \\InvalidArgumentException\n   */\n  public function assureIsValidValue($value) {\n    if (!$this->isValidValue($value)) {\n      throw new \\InvalidArgumentException(\n        '\"'.$value.'\", not a valid value in '.static::className());\n    }\n  }\n}\n", "num_lines": 182}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Enum;\n\nclass EmptyEnum extends AbstractEnum {\n\n  /**\n   * @return array\n   */\n  public function getArrayCopy() {\n    return array();\n  }\n\n  /**\n   * @return array\n   */\n  public function getNames() {\n    return array();\n  }\n\n  /**\n   * @return array\n   */\n  public function getValues() {\n    return array();\n  }\n\n  /**\n   * @return array\n   */\n  public function getValuesMap() {\n    return array();\n  }\n}\n", "num_lines": 57}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Enum;\n\ninterface EnumInstanceInterface {\n\n  /**\n   * @return EnumInstanceInterface\n   */\n  public static function getInstance();\n\n  /**\n   * @return array\n   */\n  public function getArrayCopy();\n\n  /**\n   * @return array\n   */\n  public function getNames();\n\n  /**\n   * @return array\n   */\n  public function getValues();\n\n  /**\n   * @return array\n   */\n  public function getValuesMap();\n\n  /**\n   * @param string|int|float $name\n   * @return mixed\n   */\n  public function getValueForName($name);\n\n  /**\n   * @param string|int|float $name\n   * @return mixed\n   * @throws \\InvalidArgumentException\n   */\n  public function assureValueForName($name);\n\n  /**\n   * @param string|int|float $name\n   * @return bool\n   */\n  public function isValid($name);\n\n  /**\n   * @param string|int|float $name\n   * @return void\n   * @throws \\InvalidArgumentException\n   */\n  public function assureIsValid($name);\n\n  /**\n   * @param mixed $value\n   * @return bool\n   */\n  public function isValidValue($value);\n\n  /**\n   * @param mixed $value\n   * @throws \\InvalidArgumentException\n   */\n  public function assureIsValidValue($value);\n}\n", "num_lines": 92}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Exception;\n\nclass Exception extends \\Exception {\n\n}\n", "num_lines": 30}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\nuse FacebookAds\\ApiConfig;\nuse FacebookAds\\Http\\Adapter\\AdapterInterface;\nuse FacebookAds\\Http\\Adapter\\CurlAdapter;\nuse FacebookAds\\Http\\Exception\\EmptyResponseException;\nuse FacebookAds\\Http\\Exception\\RequestException;\n\nclass Client {\n\n  /**\n   * @var string\n   */\n  const DEFAULT_GRAPH_BASE_DOMAIN = 'facebook.com';\n\n  /**\n   * @var string\n   */\n  const DEFAULT_LAST_LEVEL_DOMAIN = 'graph';\n\n  /**\n   * @var RequestInterface\n   */\n  protected $requestPrototype;\n\n  /**\n   * @var ResponseInterface\n   */\n  protected $responsePrototype;\n\n  /**\n   * @var Headers\n   */\n  protected $defaultRequestHeaders;\n\n  /**\n   * @var AdapterInterface\n   */\n  protected $adapter;\n\n  /**\n   * @var string\n   */\n  protected $caBundlePath;\n\n  /**\n   * @var string\n   */\n  protected $defaultGraphBaseDomain = self::DEFAULT_GRAPH_BASE_DOMAIN;\n\n  /**\n   * @return RequestInterface\n   */\n  public function getRequestPrototype() {\n    if ($this->requestPrototype === null) {\n      $this->requestPrototype = new Request($this);\n    }\n\n    return $this->requestPrototype;\n  }\n\n  /**\n   * @param RequestInterface $prototype\n   */\n  public function setRequestPrototype(RequestInterface $prototype) {\n    $this->requestPrototype = $prototype;\n  }\n\n  /**\n   * @return RequestInterface\n   */\n  public function createRequest() {\n    return $this->getRequestPrototype()->createClone();\n  }\n\n  /**\n   * @return ResponseInterface\n   */\n  public function getResponsePrototype() {\n    if ($this->responsePrototype === null) {\n      $this->responsePrototype = new Response();\n    }\n\n    return $this->responsePrototype;\n  }\n\n  /**\n   * @param ResponseInterface $prototype\n   */\n  public function setResponsePrototype(ResponseInterface $prototype) {\n    $this->responsePrototype = $prototype;\n  }\n\n  /**\n   * @return ResponseInterface\n   */\n  public function createResponse() {\n    return clone $this->getResponsePrototype();\n  }\n\n  /**\n   * @return Headers\n   */\n  public function getDefaultRequestHeaders() {\n    if ($this->defaultRequestHeaders === null) {\n      $this->defaultRequestHeaders = new Headers(array(\n        'User-Agent' => 'fbbizsdk-php-v'.ApiConfig::SDKVersion,\n        'Accept-Encoding' => '*',\n      ));\n    }\n\n    return $this->defaultRequestHeaders;\n  }\n\n  /**\n   * @deprecated use getDefaultRequestHeaders() instead\n   *\n   * @return Headers\n   */\n  public function getDefaultRequestHeaderds() {\n    @trigger_error(sprintf('%s deprecated, use getDefaultRequestHeaders() instead.', __METHOD__), \\E_USER_DEPRECATED);\n\n    return $this->getDefaultRequestHeaders();\n  }\n\n  /**\n   * @param Headers $headers\n   */\n  public function setDefaultRequestHeaders(Headers $headers) {\n    $this->defaultRequestHeaders = $headers;\n  }\n\n  /**\n   * @return string\n   */\n  public function getDefaultGraphBaseDomain() {\n    return $this->defaultGraphBaseDomain;\n  }\n\n  /**\n   * @param string $domain\n   */\n  public function setDefaultGraphBaseDomain($domain) {\n    $this->defaultGraphBaseDomain = $domain;\n  }\n\n  /**\n   * @return AdapterInterface\n   */\n  public function getAdapter() {\n    if ($this->adapter === null) {\n      $this->adapter = new CurlAdapter($this);\n    }\n\n    return $this->adapter;\n  }\n\n  /**\n   * @param AdapterInterface $adapter\n   */\n  public function setAdapter(AdapterInterface $adapter) {\n    $this->adapter = $adapter;\n  }\n\n  /**\n   * @return string\n   */\n  public function getCaBundlePath() {\n    if ($this->caBundlePath === null) {\n      $this->caBundlePath = __DIR__.DIRECTORY_SEPARATOR\n        .str_repeat('..'.DIRECTORY_SEPARATOR, 3)\n        .'fb_ca_chain_bundle.crt';\n    }\n\n    return $this->caBundlePath;\n  }\n\n  /**\n   * @param string $path\n   */\n  public function setCaBundlePath($path) {\n    $this->caBundlePath = $path;\n  }\n\n  /**\n   * @param RequestInterface $request\n   * @return ResponseInterface\n   * @throws RequestException\n   */\n  public function sendRequest(RequestInterface $request) {\n    $response = $this->getAdapter()->sendRequest($request);\n    $response->setRequest($request);\n    $response_content = $response->getContent();\n\n    if ($response_content === null) {\n      throw new EmptyResponseException($response);\n    }\n\n    if (is_array($response_content)\n      && array_key_exists('error', $response_content)) {\n\n      throw RequestException::create($response);\n    }\n\n    return $response;\n  }\n}\n", "num_lines": 232}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\nclass FileParameter {\n\n  /**\n   * @var string\n   */\n  protected $path;\n\n  /**\n   * @var string|null\n   */\n  protected $mimeType;\n\n  /**\n   * @var string|null\n   */\n  protected $name;\n\n  /**\n   * @param string $path\n   */\n  public function __construct($path) {\n    $this->path = $path;\n  }\n\n  /**\n   * @return string\n   */\n  public function getPath() {\n    return $this->path;\n  }\n\n  /**\n   * @return null|string\n   */\n  public function getMimeType() {\n    return $this->mimeType;\n  }\n\n  /**\n   * @param null|string $mime_type\n   * @return $this\n   */\n  public function setMimeType($mime_type) {\n    $this->mimeType = $mime_type;\n    return $this;\n  }\n\n  /**\n   * @return null|string\n   */\n  public function getName() {\n    return $this->name;\n  }\n\n  /**\n   * @param null|string $name\n   * @return $this\n   */\n  public function setName($name) {\n    $this->name = $name;\n    return $this;\n  }\n}\n", "num_lines": 90}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\nclass Headers extends \\ArrayObject {\n\n  /**\n   * @return array\n   */\n  public function export() {\n    $data = array();\n    foreach ($this as $key => $value) {\n      $data[$key] = is_null($value) || is_scalar($value)\n        ? $value\n        : $this->exportNonScalar($value);\n    }\n\n    return $data;\n  }\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\nclass Parameters extends \\ArrayObject {\n\n  /**\n   * @param array $data\n   */\n  public function enhance(array $data) {\n    foreach ($data as $key => $value) {\n      $this[$key] = $value;\n    }\n  }\n\n  /**\n   * @param mixed $value\n   * @return string\n   */\n  protected function exportNonScalar($value) {\n    return json_encode($value);\n  }\n\n  /**\n   * @return array\n   */\n  public function export() {\n    $data = array();\n    foreach ($this as $key => $value) {\n      $data[$key] = is_null($value) || is_scalar($value)\n        ? $value\n        : $this->exportNonScalar($value);\n    }\n\n    return $data;\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\nclass Request implements RequestInterface {\n\n  /**\n   * @var string\n   */\n  const PROTOCOL_HTTP = 'http://';\n\n  /**\n   * @var string\n   */\n  const PROTOCOL_HTTPS = 'https://';\n\n  /**\n   * @var Client\n   */\n  protected $client;\n\n  /**\n   * @var Headers\n   */\n  protected $headers;\n\n  /**\n   * @var string\n   */\n  protected $method = self::METHOD_GET;\n\n  /**\n   * @var string\n   */\n  protected $protocol = self::PROTOCOL_HTTPS;\n\n  /**\n   * @var string\n   */\n  protected $domain;\n\n  /**\n   * @var string\n   */\n  protected $path;\n\n  /**\n   * @var string\n   */\n  protected $graphVersion;\n\n  /**\n   * @var Parameters\n   */\n  protected $queryParams;\n\n  /**\n   * @var Parameters\n   */\n  protected $bodyParams;\n\n  /**\n   * @var Parameters\n   */\n  protected $fileParams;\n\n  /**\n   * @param Client $client\n   */\n  public function __construct(Client $client) {\n    $this->client = $client;\n  }\n\n  public function __clone() {\n    $this->queryParams && $this->queryParams = clone $this->queryParams;\n    $this->bodyParams && $this->bodyParams = clone $this->bodyParams;\n    $this->fileParams && $this->fileParams = clone $this->fileParams;\n  }\n\n  /**\n   * @return Client\n   */\n  public function getClient() {\n    return $this->client;\n  }\n\n  /**\n   * @return string\n   */\n  public function getProtocol() {\n    return $this->protocol;\n  }\n\n  /**\n   * @param string $protocol\n   */\n  public function setProtocol($protocol) {\n    $this->protocol = $protocol;\n  }\n\n  /**\n   * @return string\n   */\n  public function getDomain() {\n    if ($this->domain === null) {\n      $this->domain = sprintf(\n        \"%s.%s\",\n        Client::DEFAULT_LAST_LEVEL_DOMAIN,\n        $this->client->getDefaultGraphBaseDomain());\n    }\n\n    return $this->domain;\n  }\n\n  /**\n   * @param string $domain\n   */\n  public function setDomain($domain) {\n    $this->domain = $domain;\n  }\n\n  /**\n   * @param string $last_level_domain\n   */\n  public function setLastLevelDomain($last_level_domain) {\n    $this->domain = sprintf(\n      \"%s.%s\",\n      $last_level_domain,\n      $this->client->getDefaultGraphBaseDomain());\n  }\n\n  /**\n   * @return Headers\n   */\n  public function getHeaders() {\n    if ($this->headers === null) {\n      $this->headers = clone $this->getClient()->getDefaultRequestHeaders();\n    }\n\n    return $this->headers;\n  }\n\n  /**\n   * @param Headers $headers\n   */\n  public function setHeaders(Headers $headers) {\n    $this->headers = $headers;\n  }\n\n  /**\n   * @return string\n   */\n  public function getMethod() {\n    return $this->method;\n  }\n\n  /**\n   * @param string $method\n   */\n  public function setMethod($method) {\n    $this->method = $method;\n  }\n\n  /**\n   * @return string\n   */\n  public function getPath() {\n    return $this->path;\n  }\n\n  /**\n   * @param string $path\n   */\n  public function setPath($path) {\n    $this->path = $path;\n  }\n\n  /**\n   * @return string\n   */\n  public function getGraphVersion() {\n    return $this->graphVersion;\n  }\n\n  /**\n   * @param string $version\n   */\n  public function setGraphVersion($version) {\n    $this->graphVersion = $version;\n  }\n\n  /**\n   * @return Parameters\n   */\n  public function getQueryParams() {\n    if ($this->queryParams === null) {\n      $this->queryParams = new Parameters();\n    }\n\n    return $this->queryParams;\n  }\n\n  /**\n   * @param Parameters $params\n   */\n  public function setQueryParams(Parameters $params) {\n    $this->queryParams = $params;\n  }\n\n  /**\n   * @return string\n   */\n  public function getUrl() {\n    $delimiter = null;\n    if ($this->getQueryParams()->count() ) {\n      $delimiter = strpos($this->getPath(), '?') ? '&' : '?';\n    }\n    return $this->getProtocol().$this->getDomain()\n      .'/v'.$this->getGraphVersion().$this->getPath()\n      .$delimiter\n      .http_build_query($this->getQueryParams()->export(), '', '&');\n  }\n\n  /**\n   * @return Parameters\n   */\n  public function getBodyParams() {\n    if ($this->bodyParams === null) {\n      $this->bodyParams = new Parameters();\n    }\n\n    return $this->bodyParams;\n  }\n\n  /**\n   * @param Parameters $params\n   */\n  public function setBodyParams(Parameters $params) {\n    $this->bodyParams = $params;\n  }\n\n  /**\n   * @return Parameters\n   */\n  public function getFileParams() {\n    if ($this->fileParams === null) {\n      $this->fileParams = new Parameters();\n    }\n\n    return $this->fileParams;\n  }\n\n  /**\n   * @param Parameters $params\n   */\n  public function setFileParams(Parameters $params) {\n    $this->fileParams = $params;\n  }\n\n  /**\n   * @return ResponseInterface\n   */\n  public function execute() {\n    return $this->getClient()->sendRequest($this);\n  }\n\n  /**\n   * @return Request\n   * @see RequestInterface::createClone()\n   */\n  public function createClone() {\n    return clone $this;\n  }\n}\n", "num_lines": 297}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\ninterface RequestInterface {\n\n  /**\n   * @var string\n   */\n  const METHOD_DELETE = 'DELETE';\n\n  /**\n   * @var string\n   */\n  const METHOD_GET = 'GET';\n\n  /**\n   * @var string\n   */\n  const METHOD_POST = 'POST';\n\n  /**\n   * @var string\n   */\n  const METHOD_PUT = 'PUT';\n\n  /**\n   * @param Client $client\n   */\n  public function __construct(Client $client);\n\n  /**\n   * @return Client\n   */\n  public function getClient();\n\n  /**\n   * @return Headers\n   */\n  public function getHeaders();\n\n  /**\n   * @param Headers $headers\n   */\n  public function setHeaders(Headers $headers);\n\n  /**\n   * @return string\n   */\n  public function getProtocol();\n\n  /**\n   * @param string $protocol\n   */\n  public function setProtocol($protocol);\n\n  /**\n   * @return string\n   */\n  public function getDomain();\n\n  /**\n   * @param string $domain\n   */\n  public function setDomain($domain);\n\n  /**\n   * @param string $last_level_domain\n   */\n  public function setLastLevelDomain($last_level_domain);\n\n  /**\n   * @return string\n   */\n  public function getMethod();\n\n  /**\n   * @param string $method\n   */\n  public function setMethod($method);\n\n  /**\n   * @return string\n   */\n  public function getPath();\n\n  /**\n   * @param string $version\n   */\n  public function setGraphVersion($version);\n\n  /**\n   * @return mixed\n   */\n  public function getGraphVersion();\n\n  /**\n   * @param string $path\n   */\n  public function setPath($path);\n\n  /**\n   * @return Parameters\n   */\n  public function getQueryParams();\n\n  /**\n   * @param Parameters $params\n   */\n  public function setQueryParams(Parameters $params);\n\n  /**\n   * @return string\n   */\n  public function getUrl();\n\n  /**\n   * @return Parameters\n   */\n  public function getBodyParams();\n\n  /**\n   * @param Parameters $params\n   */\n  public function setBodyParams(Parameters $params);\n\n  /**\n   * @return Parameters\n   */\n  public function getFileParams();\n\n  /**\n   * @param Parameters $params\n   */\n  public function setFileParams(Parameters $params);\n\n  /**\n   * @return ResponseInterface\n   */\n  public function execute();\n\n  /**\n   * Required for Mocking request/response chaining\n   * @return RequestInterface\n   */\n  public function createClone();\n}\n", "num_lines": 170}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\nclass Response implements ResponseInterface {\n\n  /**\n   * @var RequestInterface\n   */\n  protected $request;\n\n  /**\n   * @var int\n   */\n  protected $statusCode;\n\n  /**\n   * @var Headers\n   */\n  protected $headers;\n\n  /**\n   * @var string\n   */\n  protected $body;\n\n  /**\n   * @var mixed\n   */\n  protected $content;\n\n  /**\n   * @return RequestInterface\n   */\n  public function getRequest() {\n    return $this->request;\n  }\n\n  /**\n   * @param RequestInterface $request\n   */\n  public function setRequest(RequestInterface $request) {\n    $this->request = $request;\n  }\n\n  /**\n   * @return int\n   */\n  public function getStatusCode() {\n    return $this->statusCode;\n  }\n\n  /**\n   * @param int $status_code\n   */\n  public function setStatusCode($status_code) {\n    $this->statusCode = $status_code;\n  }\n\n  /**\n   * @return Headers\n   */\n  public function getHeaders() {\n    if ($this->headers === null) {\n      $this->headers = new Headers();\n    }\n\n    return $this->headers;\n  }\n\n  /**\n   * @param Headers $headers\n   */\n  public function setHeaders(Headers $headers) {\n    $this->headers = $headers;\n  }\n\n  /**\n   * @return string\n   */\n  public function getBody() {\n    return $this->body;\n  }\n\n  /**\n   * @param string $body\n   */\n  public function setBody($body) {\n    $this->body = $body;\n    $this->content = null;\n  }\n\n  /**\n   * @return array|null\n   */\n  public function getContent() {\n    if ($this->content === null) {\n      $this->content = json_decode($this->getBody(), true);\n    }\n\n    return $this->content;\n  }\n}\n", "num_lines": 126}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\ninterface ResponseInterface {\n\n  /**\n   * @return RequestInterface\n   */\n  public function getRequest();\n\n  /**\n   * @param RequestInterface $request\n   */\n  public function setRequest(RequestInterface $request);\n\n  /**\n   * @return int\n   */\n  public function getStatusCode();\n\n  /**\n   * @param int $status_code\n   */\n  public function setStatusCode($status_code);\n\n  /**\n   * @return Headers\n   */\n  public function getHeaders();\n\n  /**\n   * @param Headers $headers\n   */\n  public function setHeaders(Headers $headers);\n\n  /**\n   * @return string\n   */\n  public function getBody();\n\n  /**\n   * @param string $body\n   */\n  public function setBody($body);\n\n  /**\n   * @return array|null\n   */\n  public function getContent();\n}\n", "num_lines": 74}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\nclass SimpleRequest extends Request{\n\n  /**\n   * @var string\n   */\n  const DEFAULT_WWWW_BASE_DOMAIN = 'connect.facebook.net';\n\n  /**\n   * @param Client $client\n   */\n  public function __construct(Client $client) {\n    parent::__construct($client);\n    //Setting the curl options inside the client to avoid SSL certificates usage\n    $client -> getAdapter()->setOpts( new \\ArrayObject(array(\n        CURLOPT_CONNECTTIMEOUT => 10,\n        CURLOPT_TIMEOUT => 60,\n        CURLOPT_RETURNTRANSFER => true,\n        CURLOPT_HEADER => true,\n        CURLOPT_SSL_VERIFYPEER => 0)));\n  }\n\n  /**\n   * @return string\n   */\n  public function getDomain() {\n    if ($this->domain === null) {\n      $this->domain = sprintf(\n        \"%s\",\n        self::DEFAULT_WWWW_BASE_DOMAIN);\n    }\n\n    return $this->domain;\n  }\n\n  /**\n   * @return string\n   */\n  public function getUrl() {\n    $delimiter = null;\n    if ($this->getQueryParams()->count() ) {\n      $delimiter = strpos($this->getPath(), '?') ? '&' : '?';\n    }\n    return $this->getProtocol().$this->getDomain()\n        .'/'.$this->getPath()\n        .$delimiter\n        .http_build_query($this->getQueryParams()->export(), '', '&');\n  }\n}\n", "num_lines": 75}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http;\n\nabstract class Util {\n\n  /**\n   * Avoid parse_str() for HHVM compatibility\n   * This implementation is not a complete sobstitute, but covers all the\n   * requirements of the Facebook Graph Cursor.\n   *\n   * @see hhvm.hack.disallow_dynamic_var_env_funcs\n   * @param $query_string\n   * @return array\n   */\n  public static function parseUrlQuery($query_string) {\n    $query = array();\n    $pairs = explode('&', $query_string);\n    foreach ($pairs as $pair) {\n      list($key, $value) = explode('=', $pair);\n      $query[$key] = urldecode($value);\n    }\n\n    return $query;\n  }\n}\n", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Adapter;\n\nuse FacebookAds\\Http\\Client;\n\nabstract class AbstractAdapter implements AdapterInterface {\n\n  /**\n   * @var Client\n   */\n  protected $client;\n\n  /**\n   * @param Client $client\n   */\n  public function __construct(Client $client) {\n    $this->client = $client;\n  }\n\n  /**\n   * @return Client\n   */\n  public function getClient() {\n    return $this->client;\n  }\n\n  /**\n   * @return string\n   */\n  public function getCaBundlePath() {\n    return $this->getClient()->getCaBundlePath();\n  }\n}\n", "num_lines": 57}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Adapter;\n\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\n\ninterface AdapterInterface {\n\n  /**\n   * @param Client $client\n   */\n  public function __construct(Client $client);\n\n  /**\n   * @return Client\n   */\n  public function getClient();\n\n  /**\n   * @return string\n   */\n  public function getCaBundlePath();\n\n  /**\n   * @return \\ArrayObject\n   */\n  public function getOpts();\n\n  /**\n   * @param \\ArrayObject $opts\n   * @return void\n   */\n  public function setOpts(\\ArrayObject $opts);\n\n  /**\n   * @param RequestInterface $request\n   * @return ResponseInterface\n   */\n  public function sendRequest(RequestInterface $request);\n}\n", "num_lines": 65}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Adapter;\n\nuse FacebookAds\\Exception\\Exception;\nuse FacebookAds\\Http\\Adapter\\Curl\\AbstractCurl;\nuse FacebookAds\\Http\\Adapter\\Curl\\Curl;\nuse FacebookAds\\Http\\Adapter\\Curl\\CurlInterface;\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\Headers;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\n\nclass CurlAdapter extends AbstractAdapter {\n\n  /**\n   * @var CurlInterface\n   */\n  protected $curl;\n\n  /**\n   * @var \\ArrayObject\n   */\n  protected $opts;\n\n  /**\n   * @param Client $client\n   * @param CurlInterface $curl\n   */\n  public function __construct(Client $client, CurlInterface $curl = null) {\n    parent::__construct($client);\n    $this->curl = $curl ?: AbstractCurl::createOptimalVersion();\n    $this->curl->init();\n  }\n\n  /**\n   * @return Curl\n   */\n  public function getCurl() {\n    return $this->curl;\n  }\n\n  /**\n   * @return \\ArrayObject\n   */\n  public function getOpts() {\n    if ($this->opts === null) {\n      $this->opts = new \\ArrayObject(array(\n        CURLOPT_CONNECTTIMEOUT => 10,\n        CURLOPT_TIMEOUT => 60,\n        CURLOPT_RETURNTRANSFER => true,\n        CURLOPT_HEADER => true,\n        CURLOPT_CAINFO => $this->getCaBundlePath(),\n      ));\n    }\n\n    return $this->opts;\n  }\n\n  /**\n   * @param \\ArrayObject $opts\n   */\n  public function setOpts(\\ArrayObject $opts) {\n    $this->opts = $opts;\n  }\n\n  /**\n   * @return int\n   */\n  protected function getheaderSize() {\n    return $this->getCurl()->getInfo(CURLINFO_HEADER_SIZE);\n  }\n\n  /**\n   * Extracts the headers and the body into a two-part array\n   * @param string $raw_response\n   * @return array\n   */\n  protected function extractResponseHeadersAndBody($raw_response) {\n    $header_size = $this->getheaderSize();\n\n    $raw_headers = mb_substr($raw_response, 0, $header_size);\n    $raw_body = mb_substr($raw_response, $header_size);\n\n    return array(trim($raw_headers), trim($raw_body));\n  }\n\n  /**\n   * @param Headers $headers\n   * @param string $raw_headers\n   */\n  protected function parseHeaders(Headers $headers, $raw_headers) {\n    $raw_headers = str_replace(\"\\r\\n\", \"\\n\", $raw_headers);\n\n    // There will be multiple headers if a 301 was followed\n    // or a proxy was followed, etc\n    $header_collection = explode(\"\\n\\n\", trim($raw_headers));\n    // We just want the last response (at the end)\n    $raw_headers = array_pop($header_collection);\n\n    $header_components = explode(\"\\n\", $raw_headers);\n    foreach ($header_components as $line) {\n      if (strpos($line, ': ') === false) {\n        $headers['http_code'] = $line;\n      } else {\n        list ($key, $value) = explode(': ', $line, 2);\n        $headers[$key] = $value;\n      }\n    }\n  }\n\n  /**\n   * @param RequestInterface $request\n   * @return ResponseInterface\n   * @throws Exception\n   */\n  public function sendRequest(RequestInterface $request) {\n    $response = $this->getClient()->createResponse();\n    $this->getCurl()->reset();\n    $curlopts = array(\n      CURLOPT_URL => $request->getUrl(),\n    );\n\n    $method = $request->getMethod();\n    if ($method !== RequestInterface::METHOD_GET\n      && $method !== RequestInterface::METHOD_POST) {\n      $curlopts[CURLOPT_CUSTOMREQUEST] = $method;\n    }\n\n    $curlopts = $this->getOpts()->getArrayCopy() + $curlopts;\n\n    if ($request->getHeaders()->count()) {\n      $headers = array();\n      foreach ($request->getHeaders() as $header => $value) {\n        $headers[] = \"{$header}: {$value}\";\n      }\n      $curlopts[CURLOPT_HTTPHEADER] = $headers;\n    }\n\n    $postfields = array();\n    if ($method === RequestInterface::METHOD_POST\n      && $request->getFileParams()->count()\n    ) {\n      $postfields = array_merge(\n        $postfields,\n        array_map(\n          array($this->getCurl(), 'preparePostFileField'),\n          $request->getFileParams()->getArrayCopy()));\n    }\n    if ($method !== RequestInterface::METHOD_GET\n      && $request->getBodyParams()->count()) {\n      $postfields\n        = array_merge($postfields, $request->getBodyParams()->export());\n    }\n\n    if (!empty($postfields)) {\n      $curlopts[CURLOPT_POSTFIELDS] = $postfields;\n    }\n\n    $this->getCurl()->setoptArray($curlopts);\n    $raw_response = $this->getCurl()->exec();\n\n    $status_code = $this->getCurl()->getInfo(CURLINFO_HTTP_CODE);\n    $curl_errno = $this->getCurl()->errno();\n    $curl_error = $curl_errno ? $this->getCurl()->error() : null;\n\n    $response_parts = $this->extractResponseHeadersAndBody($raw_response);\n\n    $response->setStatusCode($status_code);\n    $this->parseHeaders($response->getHeaders(), $response_parts[0]);\n    $response->setBody($response_parts[1]);\n\n    if ($curl_errno) {\n      throw new Exception($curl_error, $curl_errno);\n    }\n\n    return $response;\n  }\n}\n", "num_lines": 202}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Adapter\\Curl;\n\nabstract class AbstractCurl implements CurlInterface {\n\n  /**\n   * @var resource\n   */\n  protected $handle;\n\n  /**\n   * @throws \\RuntimeException\n   */\n  public function __construct() {\n    if (!extension_loaded('curl')) {\n      throw new \\RuntimeException(\"Extension curl not loaded\");\n    }\n  }\n\n  public function __clone() {\n    $this->handle = curl_copy_handle($this->handle);\n  }\n\n  public function __destruct() {\n    if (is_resource($this->handle)) {\n      curl_close($this->handle);\n    }\n  }\n\n  /**\n   * @return CurlInterface\n   */\n  public static function createOptimalVersion() {\n    if (version_compare(PHP_VERSION, '5.5.0') >= 0) {\n      return new Curl55();\n    } else {\n      return new Curl();\n    }\n  }\n\n  /**\n   * @return resource\n   */\n  public function getHandle() {\n    return $this->handle;\n  }\n\n  /**\n   * @return int\n   */\n  public function errno() {\n    return curl_errno($this->handle);\n  }\n\n  /**\n   * @return string\n   */\n  public function error() {\n    return curl_error($this->handle);\n  }\n\n  /**\n   * @return mixed\n   */\n  public function exec() {\n    return curl_exec($this->handle);\n  }\n\n  /**\n   * @param int $opt\n   * @return mixed\n   */\n  public function getInfo($opt = 0) {\n    return curl_getinfo($this->handle, $opt);\n  }\n\n  /**\n   * @return void\n   */\n  public function init() {\n    $this->handle = $this->handle ?: curl_init();\n  }\n\n  /**\n   * @param array $opts\n   */\n  public function setoptArray(array $opts) {\n    curl_setopt_array($this->handle, $opts);\n  }\n\n  /**\n   * @param int $option\n   * @param mixed $value\n   * @return bool\n   */\n  public function setopt($option, $value) {\n    return curl_setopt($this->handle, $option, $value);\n  }\n\n  /**\n   * @param int $age\n   * @return array\n   */\n  public static function version($age) {\n    return curl_version($age);\n  }\n}\n", "num_lines": 131}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Adapter\\Curl;\n\nuse FacebookAds\\Http\\FileParameter;\n\nclass Curl extends AbstractCurl {\n\n  /**\n   * @throws \\RuntimeException\n   */\n  public function __construct() {\n    parent::__construct();\n    if (version_compare(PHP_VERSION, '5.5.0') >= 0) {\n      throw new \\RuntimeException(\"Unsupported Curl version\");\n    }\n  }\n\n  /**\n   * @param string $string\n   * @return string\n   */\n  public function escape($string) {\n    return rawurlencode($string);\n  }\n\n  /**\n   * @param int $bitmask\n   * @return int\n   */\n  public function pause($bitmask) {\n    return 0;\n  }\n\n  /**\n   * FIXME should introduce v2.10 breaking change:\n   * implement abstract support for FileParameter in AdapterInterface\n   *\n   * @param string|FileParameter $filepath\n   * @return string\n   */\n  public function preparePostFileField($filepath) {\n    $mime_type = $name = '';\n    if ($filepath instanceof FileParameter) {\n      $mime_type = $filepath->getMimeType() !== null\n        ? sprintf(';type=%s', $filepath->getMimeType())\n        : '';\n      $name = $filepath->getName() !== null\n        ? sprintf(';filename=%s', $filepath->getName())\n        : '';\n      $filepath = $filepath->getPath();\n    }\n    return sprintf('@%s%s%s', $filepath, $mime_type, $name);\n  }\n\n  /**\n   * @return void\n   */\n  public function reset() {\n    $this->handle && curl_close($this->handle);\n    $this->handle = curl_init();\n  }\n\n  /**\n   * @param int $errornum\n   * @return NULL|string\n   */\n  public static function strerror($errornum) {\n    return curl_strerror($errornum);\n  }\n\n  /**\n   * @param string $string\n   * @return bool|string\n   */\n  public function unescape($string) {\n    return curl_unescape($this->handle, $string);\n  }\n}\n", "num_lines": 102}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Adapter\\Curl;\n\nuse FacebookAds\\Http\\FileParameter;\n\nclass Curl55 extends AbstractCurl {\n\n  /**\n   * @throws \\RuntimeException\n   */\n  public function __construct() {\n    parent::__construct();\n    if (version_compare(PHP_VERSION, '5.5.0') < 0) {\n      throw new \\RuntimeException(\"Unsupported Curl version\");\n    }\n  }\n\n  /**\n   * @param string $string\n   * @return bool|string\n   */\n  public function escape($string) {\n    return curl_escape($this->handle, $string);\n  }\n\n  /**\n   * @param int $bitmask\n   * @return int\n   */\n  public function pause($bitmask) {\n    return curl_pause($this->handle, $bitmask);\n  }\n\n  /**\n   * FIXME should introduce v2.10 breaking change:\n   * implement abstract support for FileParameter in AdapterInterface\n   *\n   * @param string|FileParameter $filepath\n   * @return \\CURLFile\n   */\n  public function preparePostFileField($filepath) {\n    $mime_type = $name = ''; // can't be null in HHVM\n    if ($filepath instanceof FileParameter) {\n      $mime_type = $filepath->getMimeType() ?: '';\n      $name = $filepath->getName() ?: '';\n      $filepath = $filepath->getPath();\n    }\n    return new \\CURLFile($filepath, $mime_type, $name);\n  }\n\n  /**\n   * @return void\n   */\n  public function reset() {\n    $this->handle && curl_reset($this->handle);\n  }\n\n  /**\n   * @param int $errornum\n   * @return NULL|string\n   */\n  public static function strerror($errornum) {\n    return curl_strerror($errornum);\n  }\n\n  /**\n   * @param string $string\n   * @return bool|string\n   */\n  public function unescape($string) {\n    return curl_unescape($this->handle, $string);\n  }\n}\n", "num_lines": 97}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Adapter\\Curl;\n\ninterface CurlInterface {\n\n  /**\n   * @return resource\n   */\n  public function getHandle();\n\n  /**\n   * @return int\n   */\n  public function errno();\n\n  /**\n   * @return string\n   */\n  public function error();\n\n  /**\n   * @param string $string\n   * @return bool|string\n   */\n  public function escape($string);\n\n  /**\n   * @return mixed\n   */\n  public function exec();\n\n  /**\n   * @param int $opt\n   * @return mixed\n   */\n  public function getInfo($opt = 0);\n\n  /**\n   * @return void\n   */\n  public function init();\n\n  /**\n   * @param int $bitmask\n   * @return int\n   */\n  public function pause($bitmask);\n\n  /**\n   * @param $filepath\n   * @return string|\\CurlFile\n   */\n  public function preparePostFileField($filepath);\n\n  /**\n   * @return void\n   */\n  public function reset();\n\n  /**\n   * @param array $opts\n   */\n  public function setoptArray(array $opts);\n\n  /**\n   * @param int $option\n   * @param mixed $value\n   * @return bool\n   */\n  public function setopt($option, $value);\n\n  /**\n   * @param $string\n   * @return string\n   */\n  public function unescape($string);\n\n  /**\n   * @param int $age\n   * @return array\n   */\n  public static function version($age);\n}\n", "num_lines": 107}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Exception;\n\nclass AuthorizationException extends RequestException {\n\n}\n", "num_lines": 30}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Exception;\n\nclass ClientException extends RequestException {\n\n}\n", "num_lines": 30}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Exception;\n\nuse FacebookAds\\Http\\ResponseInterface;\n\nclass EmptyResponseException extends RequestException {\n\n  /**\n   * @param ResponseInterface $response\n   */\n  public function __construct(ResponseInterface $response) {\n    $content = array(\n      'error' => array(\n        'message' => 'Empty Response',\n      ));\n    $response->setBody(json_encode($content));\n    parent::__construct($response);\n  }\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Exception;\n\nclass PermissionException extends RequestException {\n\n}\n", "num_lines": 30}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Exception;\n\nuse FacebookAds\\Exception\\Exception;\nuse FacebookAds\\Http\\ResponseInterface;\n\nclass RequestException extends Exception {\n\n  /**\n   * @var ResponseInterface|null\n   */\n  protected $response;\n\n  /**\n   * @var Headers\n   */\n  protected $headers;\n\n  /**\n   * @var int|null\n   */\n  protected $errorCode;\n\n  /**\n   * @var int|null\n   */\n  protected $errorSubcode;\n\n  /**\n   * @var string|null\n   */\n  protected $errorMessage;\n\n  /**\n   * @var string|null\n   */\n  protected $errorUserTitle;\n\n  /**\n   * @var string|null\n   */\n  protected $errorUserMessage;\n\n  /**\n   * @var int|null\n   */\n  protected $errorType;\n\n  /**\n   * @var array|null\n   */\n  protected $errorBlameFieldSpecs;\n\n  /**\n   * @var string|null\n   */\n  protected $facebookTraceId;\n\n  /**\n   * @param ResponseInterface $response\n   */\n  public function __construct(ResponseInterface $response) {\n    $this->headers = $response->getHeaders();\n    $this->response = $response;\n    $error_data = static::getErrorData($response);\n\n    parent::__construct($error_data['message'], $error_data['code'] ?? 0);\n\n    $this->errorSubcode = $error_data['error_subcode'];\n    $this->errorUserTitle = $error_data['error_user_title'];\n    $this->errorUserMessage = $error_data['error_user_msg'];\n    $this->errorBlameFieldSpecs = $error_data['error_blame_field_specs'];\n    $this->facebookTraceId = $error_data['fbtrace_id'];\n  }\n\n  /**\n   * @return ResponseInterface|null\n   */\n  public function getResponse() {\n    return $this->response;\n  }\n\n  /**\n   * @param array|string $array\n   * @param string|int $key\n   * @param mixed $default\n   * @return mixed\n   */\n  protected static function idx($array, $key, $default = null) {\n    if (is_string($array)) {\n      $array = json_decode($array, true);\n    }\n\n    if (is_null($array)) {\n      return null;\n    }\n\n    return array_key_exists($key, $array)\n      ? $array[$key]\n      : $default;\n  }\n\n  /**\n   * @param ResponseInterface $response\n   * @return array\n   */\n  protected static function getErrorData(ResponseInterface $response) {\n    $response_data = $response->getContent();\n    if (is_null($response_data)) {\n      $response_data = array();\n    }\n    $error_data = static::idx($response_data, 'error', array());\n\n    if (is_string(static::idx($error_data, 'error_data'))) {\n      $error_data[\"error_data\"] =\n        json_decode(stripslashes(static::idx($error_data, 'error_data')), true);\n    }\n\n    if (is_null(static::idx($error_data, 'error_data'))) {\n      $error_data[\"error_data\"] = array();\n    }\n\n    return array(\n      'code' =>\n        static::idx($error_data, 'code', static::idx($response_data, 'code')),\n      'error_subcode' => static::idx($error_data, 'error_subcode'),\n      'message' => static::idx($error_data, 'message'),\n      'error_user_title' => static::idx($error_data, 'error_user_title'),\n      'error_user_msg' => static::idx($error_data, 'error_user_msg'),\n      'error_blame_field_specs' =>\n        static::idx(static::idx($error_data, 'error_data', array()),\n          'blame_field_specs'),\n      'fbtrace_id' => static::idx($error_data, 'fbtrace_id'),\n      'type' => static::idx($error_data, 'type'),\n    );\n  }\n\n  /**\n   * Process an error payload from the Graph API and return the appropriate\n   * exception subclass.\n   * @param ResponseInterface $response\n   * @return RequestException\n   */\n  public static function create(ResponseInterface $response) {\n    $error_data = static::getErrorData($response);\n    if (in_array(\n      $error_data['error_subcode'], array(458, 459, 460, 463, 464, 467))\n      || in_array($error_data['code'], array(100, 102, 190))\n      || $error_data['type'] === 'OAuthException') {\n\n      return new AuthorizationException($response);\n    } elseif (in_array($error_data['code'], array(1, 2))) {\n\n      return new ServerException($response);\n    } elseif (in_array($error_data['code'], array(4, 17, 341))) {\n\n      return new ThrottleException($response);\n    } elseif ($error_data['code'] == 506) {\n\n      return new ClientException($response);\n    } elseif ($error_data['code'] == 10\n      || ($error_data['code'] >= 200 && $error_data['code'] <= 299)) {\n\n      return new PermissionException($response);\n    } else {\n\n      return new self($response);\n    }\n  }\n\n  /**\n   * @return int\n   */\n  public function getHttpStatusCode() {\n    return $this->response->getStatusCode();\n  }\n\n  /**\n   * @return int|null\n   */\n  public function getErrorSubcode() {\n    return $this->errorSubcode;\n  }\n\n  /**\n   * @return string|null\n   */\n  public function getErrorUserTitle() {\n    return $this->errorUserTitle;\n  }\n\n  /**\n   * @return string|null\n   */\n  public function getErrorUserMessage() {\n    return $this->errorUserMessage;\n  }\n\n  /**\n   * @return array|null\n   */\n  public function getErrorBlameFieldSpecs() {\n    return $this->errorBlameFieldSpecs;\n  }\n\n  /**\n   * @return string|null\n   */\n  public function getFacebookTraceId() {\n    return $this->facebookTraceId;\n  }\n\n  /**\n   * @return bool\n   */\n  public function isTransient() {\n    if ($this->getResponse() !== null) {\n      return false;\n    }\n\n    $body = $this->getResponse()->getBody();\n\n    return array_key_exists('error', $body)\n      && array_key_exists('is_transient', $body['error'])\n      && $body['error']['is_transient'];\n  }\n\n  /**\n   * @return Headers\n   */\n  public function getHeaders() {\n    return $this->headers;\n  }\n}\n", "num_lines": 258}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Exception;\n\nclass ServerException extends RequestException {\n\n}\n", "num_lines": 30}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Http\\Exception;\n\nclass ThrottleException extends RequestException {\n\n}\n", "num_lines": 30}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Logger;\n\nuse FacebookAds\\Http\\FileParameter;\nuse FacebookAds\\Http\\Parameters;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\nuse FacebookAds\\Logger\\CurlLogger\\JsonAwareParameters;\n\nclass CurlLogger implements LoggerInterface {\n\n  /**\n   * @var string\n   */\n  const PARAM_DEFAULT_FLAG = 'd';\n\n  /**\n   * @var string\n   */\n  const PARAM_URLENCODE_FLAG = '-data-urlencode';\n\n  /**\n   * @var string\n   */\n  const PARAM_POST_FLAG = 'F';\n\n  /**\n   * @var string\n   */\n  const METHOD_DEFAULT_FLAG = '';\n\n  /**\n   * @var string\n   */\n  const METHOD_GET_FLAG = 'G';\n\n  /**\n   * @var string\n   */\n  const METHOD_PUT_FLAG = 'X PUT';\n\n  /**\n   * @var string\n   */\n  const METHOD_DELETE_FLAG = 'X DELETE';\n\n  /**\n   * @var resource\n   */\n  protected $handle;\n\n  /**\n   * @var bool\n   */\n  protected $jsonPrettyPrint = false;\n\n  /**\n   * @param resource $handle\n   */\n  public function __construct($handle = null) {\n    if (!defined('STDOUT')) {\n      define('STDOUT', fopen('php://stdout', 'w'));\n    }\n    $this->handle = is_resource($handle) ? $handle : STDOUT;\n  }\n\n  /**\n   * @return bool\n   */\n  public function isJsonPrettyPrint() {\n    return $this->jsonPrettyPrint;\n  }\n\n  /**\n   * @param bool $json_pretty_print\n   * @return $this\n   */\n  public function setJsonPrettyPrint($json_pretty_print) {\n    $this->jsonPrettyPrint = $json_pretty_print;\n    return $this;\n  }\n\n  /**\n   * @param string $method\n   * @return string\n   */\n  public static function getMethodFlag($method) {\n    switch ($method) {\n      case RequestInterface::METHOD_GET:\n        return static::METHOD_GET_FLAG;\n      case RequestInterface::METHOD_PUT:\n        return static::METHOD_PUT_FLAG;\n      case RequestInterface::METHOD_DELETE:\n        return static::METHOD_DELETE_FLAG;\n    }\n\n    return static::METHOD_DEFAULT_FLAG;\n  }\n\n  /**\n   * @param string $method\n   * @param string $value\n   * @return string\n   */\n  public static function getParamFlag($method, $value) {\n    return $method === RequestInterface::METHOD_POST\n      ? static::PARAM_POST_FLAG\n      : (strstr($value, \"\\n\")\n        ? static::PARAM_URLENCODE_FLAG\n        : static::PARAM_DEFAULT_FLAG);\n  }\n\n  /**\n   * @param string $string\n   * @param int $indent\n   * @return string\n   */\n  protected function indent($string, $indent) {\n    return str_replace(\"\\n\", \" \\n\".str_repeat(' ', $indent), $string);\n  }\n\n  /**\n   * @param Parameters $params\n   * @param string $method\n   * @param bool $is_file\n   * @return string\n   */\n  protected function processParams(Parameters $params, $method, $is_file) {\n    $chunks = array();\n    if ($this->isJsonPrettyPrint()) {\n      $params = new JsonAwareParameters($params);\n    }\n    foreach ($params->export() as $name => $value) {\n      if ($is_file && $params->offsetGet($name) instanceof FileParameter) {\n        $value = \"@\" . $this->normalizeFileParam($params->offsetGet($name));\n      } else {\n        $value = addcslashes(\n          strpos($value, \"\\n\") !== false\n            ? $this->indent($value, 2)\n            : $value,\n          '\\'');\n      }\n      $chunks[$name] = sprintf(\n        '-%s \\'%s=%s\\'',\n        $this->getParamFlag($method, $value),\n        $name,\n        $value);\n    }\n\n    return $chunks;\n  }\n\n  /**\n   * @param FileParameter $file_param\n   * @return string\n   */\n  protected function normalizeFileParam(FileParameter $file_param) {\n    return sprintf('%s%s%s%s%s',\n      $file_param->getPath(),\n      $file_param->getMimeType() != null ? \";type=\" : \"\",\n      $file_param->getMimeType(),\n      $file_param->getName() != null ? \";name=\" : \"\",\n      $file_param->getName());\n  }\n\n  /**\n   * @param RequestInterface $request\n   * @return string\n   */\n  protected function processUrl(RequestInterface $request) {\n    return $request->getProtocol().$request->getDomain()\n      .'/v'.$request->getGraphVersion().$request->getPath();\n  }\n\n  /**\n   * @param string $buffer\n   */\n  protected function flush($buffer) {\n    fwrite($this->handle, $buffer.PHP_EOL.PHP_EOL);\n  }\n\n  /**\n   * @param mixed $level\n   * @param string $message\n   * @param array $context\n   */\n  public function log($level, $message, array $context = array()) {\n    // We only care about requests\n  }\n\n  /**\n   * @param array $array\n   * @param mixed $key\n   * @return mixed\n   */\n  protected function removeArrayKey(array &$array, $key) {\n    if (array_key_exists($key, $array)) {\n      $value = $array[$key];\n      unset($array[$key]);\n      return $value;\n    } else {\n      return null;\n    }\n  }\n\n  /**\n   * @param array $params\n   * @return array\n   */\n  protected function sortParams(array $params) {\n    $access_token = $this->removeArrayKey($params, 'access_token');\n    $appsecret_proof = $this->removeArrayKey($params, 'appsecret_proof');\n    $access_token !== null && $params['access_token'] = $access_token;\n    $appsecret_proof !== null && $params['appsecret_proof'] = $appsecret_proof;\n\n    return $params;\n  }\n\n  /**\n   * @param string $level\n   * @param RequestInterface $request\n   * @param array $context\n   */\n  public function logRequest(\n    $level, RequestInterface $request, array $context = array()) {\n\n    $new_line = ' \\\\'.PHP_EOL.'  ';\n    $method = $request->getMethod();\n    $method_flag = static::getMethodFlag($method);\n    $params = $this->sortParams(array_merge(\n      $this->processParams($request->getQueryParams(), $method, false),\n      $this->processParams($request->getBodyParams(), $method, false),\n      $this->processParams($request->getFileParams(), $method, true)));\n\n    $buffer = 'curl'.($method_flag ? ' -'.$method_flag : '');\n    foreach ($params as $param) {\n      $buffer .= $new_line.$param;\n    }\n    $buffer .= $new_line.$this->processUrl($request);\n\n    $this->flush($buffer);\n  }\n\n  /**\n   * @param string $level\n   * @param ResponseInterface $response\n   * @param array $context\n   */\n  public function logResponse(\n    $level, ResponseInterface $response, array $context = array()) {\n    // We only care about requests\n  }\n}\n", "num_lines": 277}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Logger;\n\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\n\ninterface LoggerInterface {\n\n  /**\n   * @param string $level\n   * @param string $message\n   * @param array $context\n   */\n  public function log($level, $message, array $context = array());\n\n  /**\n   * @param string $level\n   * @param RequestInterface $request\n   * @param array $context\n   */\n  public function logRequest(\n    $level, RequestInterface $request, array $context = array());\n\n  /**\n   * @param string $level\n   * @param ResponseInterface $response\n   * @param array $context\n   */\n  public function logResponse(\n    $level, ResponseInterface $response, array $context = array());\n}\n", "num_lines": 55}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Logger;\n\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\n\nclass NullLogger implements LoggerInterface {\n\n  /**\n   * @param string $level\n   * @param string $message\n   * @param array $context\n   */\n  public function log($level, $message, array $context = array()) {\n\n  }\n\n  /**\n   * @param string $level\n   * @param RequestInterface $request\n   * @param array $context\n   */\n  public function logRequest(\n    $level, RequestInterface $request, array $context = array()) {\n\n  }\n\n  /**\n   * @param string $level\n   * @param ResponseInterface $response\n   * @param array $context\n   */\n  public function logResponse(\n    $level, ResponseInterface $response, array $context = array()) {\n\n  }\n}\n", "num_lines": 61}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Logger\\CurlLogger;\n\nuse FacebookAds\\Http\\Parameters;\n\nclass JsonAwareParameters extends Parameters {\n\n  /**\n   * @param mixed $value\n   * @return string\n   */\n  protected function exportNonScalar($value) {\n    return JsonNode::factory($value)->encode();\n  }\n}\n", "num_lines": 39}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Logger\\CurlLogger;\n\nfinal class JsonNode {\n\n  /**\n   * @var int\n   */\n  const INDENT_UNIT = 2;\n\n  /**\n   * @var int\n   */\n  const EXPLOSION_THRESHOLD = 78;\n\n  /**\n   * @var mixed\n   */\n  protected $value;\n\n  /**\n   * @var \\ArrayObject\n   */\n  protected $children;\n\n  /**\n   * @param mixed $value\n   * @return $this\n   * @throws \\InvalidArgumentException\n   */\n  public static function factory($value) {\n    $object = new self();\n    switch (true) {\n      case is_object($value):\n        $value = (array) $value;\n        // fallthrough\n      case is_array($value):\n        foreach ($value as $key => $sub) {\n          $object->getChildren()->offsetSet($key, self::factory($sub));\n        }\n        // fallthrough\n      case is_null($value) || is_scalar($value):\n        $object->setValue($value);\n        break;\n      default:\n        throw new \\InvalidArgumentException(\n          gettype($value).' can\\'t be encoded');\n    }\n\n    return $object;\n  }\n\n  public function __construct() {\n    $this->children = new \\ArrayObject();\n  }\n\n  /**\n   * @return mixed\n   */\n  public function getValue() {\n    return $this->value;\n  }\n\n  /**\n   * @param mixed $value\n   * @return $this\n   */\n  public function setValue($value) {\n    $this->value = $value;\n\n    return $this;\n  }\n\n  /**\n   * @return \\ArrayObject\n   */\n  public function getChildren() {\n    return $this->children;\n  }\n\n  /**\n   * @return int\n   */\n  public function getMaxTreeChildrenCount() {\n    $max = $this->getChildren()->count();\n\n    /** @var JsonNode $child */\n    foreach ($this->getChildren() as $child) {\n      $ith = $child->getMaxTreeChildrenCount();\n      $max = $ith > $max ? $ith : $max;\n    }\n\n    return $max;\n  }\n\n  /**\n   * @param int $indent\n   * @return string\n   */\n  protected function getPadding($indent) {\n    return str_repeat(' ', $indent * self::INDENT_UNIT);\n  }\n\n  /**\n   * @return mixed\n   */\n  protected function getLastChildKey() {\n    if ($this->getChildren()->count() === 0) {\n      return null;\n    }\n\n    $copy = $this->getChildren()->getArrayCopy();\n    end($copy);\n\n    return key($copy);\n  }\n\n  /**\n   * @param int $indent\n   * @return string\n   */\n  protected function encodeList($indent) {\n    $value = $this->getValue();\n    if (empty($value) || (array_keys($value) === range(0, count($value) - 1))) {\n      $is_map = false;\n    } else {\n      $is_map = true;\n    }\n\n    ++$indent;\n    $last_key = $this->getLastChildKey();\n\n    $buffer = ($is_map ? '{' : '[').\"\\n\";\n\n    /** @var JsonNode $child */\n    foreach ($this->getChildren() as $key => $child) {\n      $buffer .= sprintf(\n        \"%s%s%s%s\\n\",\n        $this->getPadding($indent),\n        $is_map ? sprintf(\"%s: \", json_encode($key)) : '',\n        $child->encode($indent),\n        $key === $last_key ? '' : ',');\n    }\n\n    --$indent;\n    $buffer .= $this->getPadding($indent).($is_map ? '}' : ']');\n\n    return $buffer;\n  }\n\n  /**\n   * @param int $indent\n   * @return string\n   */\n  public function encode($indent = 0) {\n    $value = $this->getValue();\n    if (is_array($value) || is_object($value)) {\n      if ($this->getMaxTreeChildrenCount() > 2) {\n        return $this->encodeList($indent);\n      }\n\n      $ugly = json_encode($value);\n      $output_prediction = $this->getPadding($indent).$ugly;\n      if (strlen($output_prediction) > self::EXPLOSION_THRESHOLD) {\n        return $this->encodeList($indent);\n      }\n\n      return $ugly;\n    }\n\n    return json_encode($value);\n  }\n}\n", "num_lines": 197}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\Http\\RequestInterface;\n\nabstract class AbstractArchivableCrudObject extends AbstractCrudObject {\n\n  /**\n   * @var string\n   */\n  const STATUS_PARAM_NAME = 'status';\n\n  /**\n   * @var string\n   */\n  const STATUS_ACTIVE = 'ACTIVE';\n\n  /**\n   * @var string\n   */\n  const STATUS_PAUSED = 'PAUSED';\n\n  /**\n   * @var string\n   */\n  const STATUS_DELETED = 'DELETED';\n\n  /**\n   * @var string\n   */\n  const STATUS_ARCHIVED = 'ARCHIVED';\n\n  /**\n   * @return string\n   */\n  public function getStatusParamName() {\n    return self::STATUS_PARAM_NAME;\n  }\n\n  /**\n   * Archive this object\n   *\n   * @deprecated use api_update instead\n   * @param array $params\n   * @return void\n   */\n  public function archive(array $params = array()) {\n    $this->getApi()->call(\n      $this->getNodePath(),\n      RequestInterface::METHOD_POST,\n      array_merge($params, array(\n        $this->getStatusParamName() => static::STATUS_ARCHIVED)));\n  }\n\n  /**\n   * Delete this object\n   *\n   * @deprecated use api_update instead\n   * @param array $params\n   * @return void\n   */\n  public function delete(array $params = array()) {\n    $this->getApi()->call(\n      $this->getNodePath(),\n      RequestInterface::METHOD_POST,\n      array_merge($params, array(\n        $this->getStatusParamName() => static::STATUS_DELETED)));\n  }\n}\n", "num_lines": 93}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\nnamespace FacebookAds\\Object;\nuse FacebookAds\\Api;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\nclass AbstractCrudObject extends AbstractObject {\n  /**\n   * @var string\n   */\n  const FIELD_ID = 'id';\n  /**\n   * @var string[] set of fields to read by default\n   */\n  protected static $defaultReadFields = array();\n  /**\n   * @var array set of fields that have been mutated\n   */\n  protected $changedFields = array();\n  /**\n   * @var Api instance of the Api used by this object\n   */\n  protected $api;\n  /**\n   * @var string ID of the adaccount this object belongs to\n   */\n  protected $parentId;\n\n  /**\n   * @deprecated deprecate constructor with null and parent_id\n   * @param string $id Optional (do not set for new objects)\n   * @param string $parent_id Optional, needed for creating new objects.\n   * @param Api $api The Api instance this object should use to make calls\n   */\n  public function __construct($id = null, $parent_id = null, Api $api = null) {\n    parent::__construct();\n\n    // check that $id is an integer or a string integer or a string of\n    // two integer connected by an underscore, like \"123_456\"\n\n    $int_id = $id;\n    if ($id !== null && strpos($id, 'act_') === 0) {\n      $int_id = substr($id, 4);\n    }\n    $split_by_underscore = explode('_', (string) $id);\n    $is_regular_id = sizeof($split_by_underscore) == 2 &&\n                     ctype_digit($split_by_underscore[0]) &&\n                     ctype_digit($split_by_underscore[1]);\n    if (!is_null($int_id) && !ctype_digit((string) $int_id) && !$is_regular_id) {\n      $extra_message = '';\n      if (is_numeric($int_id)) {\n        $extra_message = ' Please use an integer string'\n        .' to prevent integer overflow.';\n      }\n      throw new \\InvalidArgumentException(\n        'Object ID must be an integer or integer string but was passed \"'\n        .(string)$id.'\" ('.gettype($id).').'.(string)$extra_message);\n    }\n    $this->data[static::FIELD_ID] = $id;\n\n    if (!is_null($parent_id)) {\n      $warning_message = \"\\$parent_id as a parameter of constructor is being \" .\n        \"deprecated, please try not to use this in new code.\\n\";\n      trigger_error($warning_message, E_USER_DEPRECATED);\n    }\n    $this->parentId = $parent_id;\n\n    $this->api = static::assureApi($api);\n  }\n\n  /**\n   * @param string $id\n   */\n  public function setId($id) {\n    $this->data[static::FIELD_ID] = $id;\n    return $this;\n  }\n  /**\n   * @deprecated deprecate parent_id in AbstractCrudObject\n   * @param string $parent_id\n   */\n  public function setParentId($parent_id) {\n    $warning_message = sprintf('%s is being deprecated, please try not to use'.\n      ' this in new code.',__FUNCTION__);\n    trigger_error($warning_message, E_USER_DEPRECATED);\n    $this->parentId = $parent_id;\n    return $this;\n  }\n  /**\n   * @param Api $api The Api instance this object should use to make calls\n   */\n  public function setApi(Api $api) {\n    $this->api = static::assureApi($api);\n    return $this;\n  }\n  /**\n   * @deprecated getEndpoint function is deprecated\n   * @return string\n   */\n  protected function getEndpoint() {\n    return null;\n  }\n  /**\n   * @param Api|null $instance\n   * @return Api\n   * @throws \\InvalidArgumentException\n   */\n  protected static function assureApi(Api $instance = null) {\n    $instance = $instance ?: Api::instance();\n    if (!$instance) {\n      throw new \\InvalidArgumentException(\n        'An Api instance must be provided as argument or '.\n        'set as instance in the \\FacebookAds\\Api');\n    }\n    return $instance;\n  }\n  /**\n   * @deprecated deprecate parent_id in AbstractCrudObject\n   * @return string|null\n   */\n  public function getParentId() {\n    $warning_message = sprintf('%s is being deprecated, please try not to use'.\n      ' this in new code.',__FUNCTION__);\n    trigger_error($warning_message, E_USER_DEPRECATED);\n    return $this->parentId;\n  }\n  /**\n   * @deprecated deprecate parent_id in AbstractCrudObject\n   * @return string\n   * @throws \\Exception\n   */\n  protected function assureParentId() {\n    $warning_message = sprintf('%s is being deprecated, please try not to use'.\n      ' this in new code.',__FUNCTION__);\n    trigger_error($warning_message, E_USER_DEPRECATED);\n    if (!$this->parentId) {\n      throw new \\Exception(\"A parent ID is required.\");\n    }\n    return $this->parentId;\n  }\n  /**\n   * @return string\n   * @throws \\Exception\n   */\n  protected function assureId() {\n    if (!$this->data[static::FIELD_ID]) {\n      throw new \\Exception(\"field '\".static::FIELD_ID.\"' is required.\");\n    }\n    return (string) $this->data[static::FIELD_ID];\n  }\n  /**\n   * @return Api\n   */\n  public function getApi() {\n    return $this->api;\n  }\n  /**\n   * Get the values which have changed\n   *\n   * @return array Key value pairs of changed variables\n   */\n  public function getChangedValues() {\n    return $this->changedFields;\n  }\n  /**\n   * Get the name of the fields that have changed\n   *\n   * @return array Array of changed field names\n   */\n  public function getChangedFields() {\n    return array_keys($this->changedFields);\n  }\n  /**\n   * Get the values which have changed, converting them to scalars\n   */\n  public function exportData() {\n    $data = array();\n    foreach ($this->changedFields as $key => $val) {\n      $data[$key] = parent::exportValue($val);\n    }\n    return $data;\n  }\n  /**\n   * @return void\n   */\n  protected function clearHistory() {\n    $this->changedFields = array();\n  }\n  /**\n   * @param string $name\n   * @param mixed $value\n   */\n  public function __set($name, $value) {\n    if (!array_key_exists($name, $this->data)\n      || $this->data[$name] !== $value) {\n      $this->changedFields[$name] = $value;\n    }\n    parent::__set($name, $value);\n  }\n  /**\n   * @param string[] $fields\n   */\n  public static function setDefaultReadFields(array $fields = array()) {\n    static::$defaultReadFields = $fields;\n  }\n  /**\n   * @return string[]\n   */\n  public static function getDefaultReadFields() {\n    return static::$defaultReadFields;\n  }\n  /**\n   * @return string\n   */\n  protected function getNodePath() {\n    return '/'.$this->assureId();\n  }\n  /**\n   * @deprecated\n   * use (ParentObject)->creatXXX() instead\n   * Create function for the object.\n   *\n   * @param array $params Additional parameters to include in the request\n   * @return $this\n   * @throws \\Exception\n   */\n  public function create(array $params = array()) {\n    $warning_message = sprintf('%s is being deprecated, please try not to use'.\n      ' this in new code.',__FUNCTION__);\n    trigger_error($warning_message, E_USER_DEPRECATED);\n    if ($this->data[static::FIELD_ID]) {\n      throw new \\Exception(\"Object has already an ID\");\n    }\n    $response = $this->getApi()->call(\n      '/'.$this->assureParentId().'/'.$this->getEndpoint(),\n      RequestInterface::METHOD_POST,\n      array_merge($this->exportData(), $params));\n    $this->clearHistory();\n    $data = $response->getContent();\n    if (!isset($params['execution_options'])){\n      $id = is_string($data) ? $data : $data[static::FIELD_ID];\n    /** @var AbstractCrudObject $this */\n      if ($this instanceof CanRedownloadInterface\n        && isset($params[CanRedownloadInterface::PARAM_REDOWNLOAD])\n        && $params[CanRedownloadInterface::PARAM_REDOWNLOAD] === true\n        && isset($data['data'][$id])\n        && is_array($data['data'][$id])\n      ) {\n        $this->setDataWithoutValidation($data['data'][$id]);\n      }\n      $this->data[static::FIELD_ID] = (string) $id;\n    }\n    return $this;\n  }\n  /**\n   * @deprecated\n   * use getSelf() instead\n   * Read object data from the graph\n   *\n   * @param string[] $fields Fields to request\n   * @param array $params Additional request parameters\n   * @return $this\n   */\n  public function read(array $fields = array(), array $params = array()) {\n    $warning_message = sprintf('%s is being deprecated, please try not to use'.\n      ' this in new code.',__FUNCTION__);\n    trigger_error($warning_message, E_USER_DEPRECATED);\n    $fields = implode(',', $fields ?: static::getDefaultReadFields());\n    if ($fields) {\n      $params['fields'] = $fields;\n    }\n    $response = $this->getApi()->call(\n      $this->getNodePath(),\n      RequestInterface::METHOD_GET,\n      $params);\n    $this->setDataWithoutValidation($response->getContent());\n    $this->clearHistory();\n    return $this;\n  }\n  /**\n   * @deprecated\n   * use updateSelf() instead\n   * Update the object. Function parameters are similar with the create function\n   *\n   * @param array $params Update parameters in assoc\n   * @return $this\n   */\n  public function update(array $params = array()) {\n    $warning_message = sprintf('%s is being deprecated, please try not to use'.\n      ' this in new code.',__FUNCTION__);\n    trigger_error($warning_message, E_USER_DEPRECATED);\n    $this->getApi()->call(\n      $this->getNodePath(),\n      RequestInterface::METHOD_POST,\n      array_merge($this->exportData(), $params));\n    $this->clearHistory();\n    return $this;\n  }\n  /**\n   * @deprecated\n   * use deleteSelf() in each subclass\n   * Delete this object from the graph\n   *\n   * @param array $params\n   * @return void\n   */\n  public function deleteSelf(array $params = array()) {\n    $warning_message = sprintf('%s is being deprecated, please try not to use'.\n      ' this in new code.',__FUNCTION__);\n    trigger_error($warning_message, E_USER_DEPRECATED);\n    $this->getApi()->call(\n      $this->getNodePath(),\n      RequestInterface::METHOD_DELETE,\n      $params);\n  }\n  /**\n   * @deprecated\n   * deprecate with ObjectValidation\n   * Perform object upsert\n   *\n   * Helper function which determines whether an object should be created or\n   * updated\n   *\n   * @param array $params\n   * @return $this\n   */\n  public function save(array $params = array()) {\n    $warning_message = sprintf('%s is being deprecated, please try not to use'.\n      ' this in new code.',__FUNCTION__);\n    trigger_error($warning_message, E_USER_DEPRECATED);\n    if ($this->data[static::FIELD_ID]) {\n      return $this->update($params);\n    } else {\n      return $this->create($params);\n    }\n  }\n  /**\n   * @deprecated\n   * deprecate with getEndpoint\n   * @param string $prototype_class\n   * @param string $endpoint\n   * @return string\n   * @throws \\InvalidArgumentException\n   */\n  protected function assureEndpoint($prototype_class, $endpoint) {\n    $warning_message = sprintf('%s is being deprecated, please try not to use'.\n      ' this in new code.',__FUNCTION__);\n    trigger_error($warning_message, E_USER_DEPRECATED);\n    if (!$endpoint) {\n      $prototype = new $prototype_class(null, null, $this->getApi());\n      if (!$prototype instanceof AbstractCrudObject) {\n        throw new \\InvalidArgumentException('Either prototype must be instance\n          of AbstractCrudObject or $endpoint must be given');\n      }\n      $endpoint = $prototype->getEndpoint();\n    }\n    return $endpoint;\n  }\n  /**\n   * @param array $fields\n   * @param array $params\n   * @param string $prototype_class\n   * @param string|null $endpoint\n   * @return ResponseInterface\n   */\n  protected function fetchConnection(\n    array $fields = array(),\n    array $params = array(),\n    $prototype_class = '',\n    $endpoint = null) {\n    $fields = implode(',', $fields ?: static::getDefaultReadFields());\n    if ($fields) {\n      $params['fields'] = $fields;\n    }\n    $endpoint = $this->assureEndpoint($prototype_class, $endpoint);\n    return $this->getApi()->call(\n      '/'.$this->assureId().'/'.$endpoint,\n      RequestInterface::METHOD_GET,\n      $params);\n  }\n  /**\n   * Read a single connection object\n   *\n   * @param string $prototype_class\n   * @param array $fields Fields to request\n   * @param array $params Additional filters for the reading\n   * @param string|null $endpoint\n   * @return AbstractObject\n   */\n  protected function getOneByConnection(\n    $prototype_class,\n    array $fields = array(),\n    array $params = array(),\n    $endpoint = null) {\n    $response = $this->fetchConnection(\n      $fields, $params, $prototype_class, $endpoint);\n    if (!$response->getContent()) {\n      return null;\n    }\n    $object = new $prototype_class(\n      null, null, $this->getApi());\n    /** @var AbstractCrudObject $object */\n    $object->setDataWithoutValidation($response->getContent());\n    return $object;\n  }\n  /**\n   * Read objects from a connection\n   *\n   * @param string $prototype_class\n   * @param array $fields Fields to request\n   * @param array $params Additional filters for the reading\n   * @param string|null $endpoint\n   * @return Cursor\n   */\n  protected function getManyByConnection(\n    $prototype_class,\n    array $fields = array(),\n    array $params = array(),\n    $endpoint = null) {\n    $response = $this->fetchConnection(\n      $fields, $params, $prototype_class, $endpoint);\n    return new Cursor(\n      $response,\n      new $prototype_class(null, null, $this->getApi()));\n  }\n  /**\n   * @param string $job_class\n   * @param array $fields\n   * @param array $params\n   * @return AbstractAsyncJobObject\n   * @throws \\InvalidArgumentException\n   */\n  protected function createAsyncJob(\n    $job_class,\n    array $fields = array(),\n    array $params = array()) {\n    $object = new $job_class(null, $this->assureId(), $this->getApi());\n    if (!$object instanceof AbstractAsyncJobObject) {\n      throw new \\InvalidArgumentException(\n        \"Class {$job_class} is not of type \"\n        .AbstractAsyncJobObject::className());\n    }\n    $params['fields'] = $fields;\n    return $object->create($params);\n  }\n  /**\n   * Delete objects.\n   *\n   * Used batch API calls to delete multiple objects at once\n   *\n   * @param string[] $ids Array or single Object ID to delete\n   * @param Api $api Api Object to use\n   * @return bool Returns true on success\n   */\n  public static function deleteIds(array $ids, Api $api = null) {\n    $batch = array();\n    foreach ($ids as $id) {\n      $request = array(\n        'relative_url' => '/'.$id,\n        'method' => RequestInterface::METHOD_DELETE,\n      );\n      $batch[] = $request;\n    }\n    $api = static::assureApi($api);\n    $response = $api->call(\n      '/',\n      RequestInterface::METHOD_POST,\n      array('batch' => json_encode($batch)));\n    foreach ($response->getContent() as $result) {\n      if (200 != $result['code']) {\n        return false;\n      }\n    }\n    return true;\n  }\n  /**\n   * Read function for the object. Convert fields and filters into the query\n   * part of uri and return objects.\n   *\n   * @param mixed $ids Array or single object IDs\n   * @param array $fields Array of field names to read\n   * @param array $params Additional filters for the reading, in assoc\n   * @param Api $api Api Object to use\n   * @return Cursor\n   */\n  public static function readIds(\n    array $ids,\n    array $fields = array(),\n    array $params = array(),\n    Api $api = null) {\n    if (empty($fields)) {\n      $fields = static::getDefaultReadFields();\n    }\n    if (!empty($fields)) {\n      $params['fields'] = implode(',', $fields);\n    }\n    $params['ids'] = implode(',', $ids);\n    $api = static::assureApi($api);\n    $response = $api->call('/', RequestInterface::METHOD_GET, $params);\n    $result = array();\n    foreach ($response->getContent() as $data) {\n      /** @var AbstractObject $object */\n      $object = new static(null, null, $api);\n      $object->setDataWithoutValidation((array) $data);\n      $result[] = $object;\n    }\n    return $result;\n  }\n}\n", "num_lines": 532}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\nnamespace FacebookAds\\Object;\nuse FacebookAds\\ApiConfig;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Enum\\EmptyEnum;\nclass AbstractObject {\n  /**\n   * @var mixed[] set of key value pairs representing data\n   */\n  protected $data = array();\n  protected $_type_checker;\n\n  public function __construct() {\n    $this->data = static::getFieldsEnum()->getValuesMap();\n    $this->_type_checker = new TypeChecker(\n      static::getFieldTypes(), static::getReferencedEnums());\n  }\n\n  protected static function getFieldTypes() {\n    $fields_enum = static::getFieldsEnum();\n    if (method_exists($fields_enum, 'getFieldTypes')) {\n      return $fields_enum->getFieldTypes();\n    } else {\n      return array();\n    }\n  }\n\n  protected static function getReferencedEnums() {\n    return array();\n  }\n\n  /**\n   * @param string $name\n   * @param mixed $value\n   */\n  public function __set($name, $value) {\n    if (ApiConfig::TYPE_CHECKER_STRICT_MODE\n      && $this->_type_checker->isValidParam($name)\n    ) {\n      if ($this->_type_checker->isValidParamPair($name, $value)) {\n        $this->data[$name] = $value;\n      } else {\n        throw new \\InvalidArgumentException(\n          $name.\" and \".$this->exportValue($value)\n          .\" are not a valid type value pair\");\n      }\n    } else {\n      $this->data[$name] = $value;\n    }\n    return $this;\n  }\n\n  /**\n   * @param string $name\n   * @return mixed\n   * @throws \\InvalidArgumentException\n   */\n  public function __get($name) {\n    if (array_key_exists($name, $this->data)) {\n      return $this->data[$name];\n    } else {\n      throw new \\InvalidArgumentException(\n        $name.' is not a field of '.get_class($this));\n    }\n  }\n  /**\n   * @param string $name\n   * @return boolean\n   */\n  public function __isset($name) {\n    return array_key_exists($name, $this->data);\n  }\n  /**\n   * @param array\n   * @return $this\n   */\n  public function setData(array $data) {\n    foreach ($data as $key => $value) {\n      $this->{$key} = $value;\n    }\n    // Handle class-specific situations\n    if (method_exists($this, 'setDataTrigger')) {\n      $this->setDataTrigger($data);\n    }\n\n    return $this;\n  }\n  /**\n   * Like setData but will skip field validation\n   *\n   * @param array\n   * @return $this\n   */\n  public function setDataWithoutValidation(array $data) {\n    foreach ($data as $key => $value) {\n      $this->data[$key] = $value;\n    }\n    // Handle class-specific situations\n    if (method_exists($this, 'setDataTrigger')) {\n      $this->setDataTrigger($data);\n    }\n    return $this;\n  }\n  /**\n   * @return array\n   */\n  public function getData() {\n    return $this->data;\n  }\n  /**\n   * @param mixed $value\n   * @return mixed\n   */\n  protected function exportValue($value) {\n    $result = $value;\n    switch (true) {\n      case $value === null:\n        break;\n      case $value instanceof AbstractObject:\n        $result = $value->exportData();\n        break;\n      case is_array($value):\n        $result = array();\n        foreach ($value as $key => $sub_value) {\n          if ($sub_value !== null) {\n            $result[$key] = $this->exportValue($sub_value);\n          }\n        }\n        break;\n    }\n    return $result;\n  }\n  /**\n   * @return array\n   */\n  public function exportData() {\n    return $this->exportValue($this->data);\n  }\n  /**\n   * @return array\n   */\n  public function exportAllData() {\n    return $this->exportValue($this->data);\n  }\n  /**\n   * @return EmptyEnum\n   */\n  public static function getFieldsEnum() {\n    return EmptyEnum::getInstance();\n  }\n  /**\n   * @return array\n   */\n  public static function getFields() {\n    return static::getFieldsEnum()->getValues();\n  }\n  /**\n   * @return string\n   */\n  public static function className() {\n    return get_called_class();\n  }\n}\n", "num_lines": 186}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdFields;\nuse FacebookAds\\Object\\Values\\AdBidTypeValues;\nuse FacebookAds\\Object\\Values\\AdConfiguredStatusValues;\nuse FacebookAds\\Object\\Values\\AdDatePresetValues;\nuse FacebookAds\\Object\\Values\\AdEffectiveStatusValues;\nuse FacebookAds\\Object\\Values\\AdExecutionOptionsValues;\nuse FacebookAds\\Object\\Values\\AdMetaRewardAdgroupStatusValues;\nuse FacebookAds\\Object\\Values\\AdOperatorValues;\nuse FacebookAds\\Object\\Values\\AdPreviewAdFormatValues;\nuse FacebookAds\\Object\\Values\\AdPreviewCreativeFeatureValues;\nuse FacebookAds\\Object\\Values\\AdPreviewRenderTypeValues;\nuse FacebookAds\\Object\\Values\\AdStatusOptionValues;\nuse FacebookAds\\Object\\Values\\AdStatusValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsActionAttributionWindowsValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsActionBreakdownsValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsActionReportTimeValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsBreakdownsValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsDatePresetValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsLevelValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsSummaryActionBreakdownsValues;\nuse FacebookAds\\Object\\Traits\\AdLabelAwareCrudObjectTrait;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Ad extends AbstractArchivableCrudObject\n  implements CanRedownloadInterface {\n\n  use AdLabelAwareCrudObjectTrait;\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'ads';\n  }\n\n  /**\n   * @return AdFields\n   */\n  public static function getFieldsEnum() {\n    return AdFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['BidType'] = AdBidTypeValues::getInstance()->getValues();\n    $ref_enums['ConfiguredStatus'] = AdConfiguredStatusValues::getInstance()->getValues();\n    $ref_enums['EffectiveStatus'] = AdEffectiveStatusValues::getInstance()->getValues();\n    $ref_enums['Status'] = AdStatusValues::getInstance()->getValues();\n    $ref_enums['DatePreset'] = AdDatePresetValues::getInstance()->getValues();\n    $ref_enums['ExecutionOptions'] = AdExecutionOptionsValues::getInstance()->getValues();\n    $ref_enums['MetaRewardAdgroupStatus'] = AdMetaRewardAdgroupStatusValues::getInstance()->getValues();\n    $ref_enums['Operator'] = AdOperatorValues::getInstance()->getValues();\n    $ref_enums['StatusOption'] = AdStatusOptionValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAdCreatives(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adcreatives',\n      new AdCreative(),\n      'EDGE',\n      AdCreative::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdLabel(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adlabels' => 'list<Object>',\n      'execution_options' => 'list<execution_options_enum>',\n    );\n    $enums = array(\n      'execution_options_enum' => AdExecutionOptionsValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adlabels',\n      new Ad(),\n      'EDGE',\n      Ad::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdRulesGoverned(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'pass_evaluation' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adrules_governed',\n      new AdRule(),\n      'EDGE',\n      AdRule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCopies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'date_preset' => 'date_preset_enum',\n      'effective_status' => 'list<string>',\n      'time_range' => 'Object',\n      'updated_since' => 'int',\n    );\n    $enums = array(\n      'date_preset_enum' => AdDatePresetValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/copies',\n      new Ad(),\n      'EDGE',\n      Ad::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCopy(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adset_id' => 'string',\n      'rename_options' => 'Object',\n      'status_option' => 'status_option_enum',\n    );\n    $enums = array(\n      'status_option_enum' => AdStatusOptionValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/copies',\n      new Ad(),\n      'EDGE',\n      Ad::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInsights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action_attribution_windows' => 'list<action_attribution_windows_enum>',\n      'action_breakdowns' => 'list<action_breakdowns_enum>',\n      'action_report_time' => 'action_report_time_enum',\n      'breakdowns' => 'list<breakdowns_enum>',\n      'date_preset' => 'date_preset_enum',\n      'default_summary' => 'bool',\n      'export_columns' => 'list<string>',\n      'export_format' => 'string',\n      'export_name' => 'string',\n      'fields' => 'list<string>',\n      'filtering' => 'list<Object>',\n      'level' => 'level_enum',\n      'product_id_limit' => 'int',\n      'sort' => 'list<string>',\n      'summary' => 'list<string>',\n      'summary_action_breakdowns' => 'list<summary_action_breakdowns_enum>',\n      'time_increment' => 'string',\n      'time_range' => 'Object',\n      'time_ranges' => 'list<Object>',\n      'use_account_attribution_setting' => 'bool',\n      'use_unified_attribution_setting' => 'bool',\n    );\n    $enums = array(\n      'action_attribution_windows_enum' => AdsInsightsActionAttributionWindowsValues::getInstance()->getValues(),\n      'action_breakdowns_enum' => AdsInsightsActionBreakdownsValues::getInstance()->getValues(),\n      'action_report_time_enum' => AdsInsightsActionReportTimeValues::getInstance()->getValues(),\n      'breakdowns_enum' => AdsInsightsBreakdownsValues::getInstance()->getValues(),\n      'date_preset_enum' => AdsInsightsDatePresetValues::getInstance()->getValues(),\n      'level_enum' => AdsInsightsLevelValues::getInstance()->getValues(),\n      'summary_action_breakdowns_enum' => AdsInsightsSummaryActionBreakdownsValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/insights',\n      new AdsInsights(),\n      'EDGE',\n      AdsInsights::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInsightsAsync(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action_attribution_windows' => 'list<action_attribution_windows_enum>',\n      'action_breakdowns' => 'list<action_breakdowns_enum>',\n      'action_report_time' => 'action_report_time_enum',\n      'breakdowns' => 'list<breakdowns_enum>',\n      'date_preset' => 'date_preset_enum',\n      'default_summary' => 'bool',\n      'export_columns' => 'list<string>',\n      'export_format' => 'string',\n      'export_name' => 'string',\n      'fields' => 'list<string>',\n      'filtering' => 'list<Object>',\n      'level' => 'level_enum',\n      'product_id_limit' => 'int',\n      'sort' => 'list<string>',\n      'summary' => 'list<string>',\n      'summary_action_breakdowns' => 'list<summary_action_breakdowns_enum>',\n      'time_increment' => 'string',\n      'time_range' => 'Object',\n      'time_ranges' => 'list<Object>',\n      'use_account_attribution_setting' => 'bool',\n      'use_unified_attribution_setting' => 'bool',\n    );\n    $enums = array(\n      'action_attribution_windows_enum' => AdsInsightsActionAttributionWindowsValues::getInstance()->getValues(),\n      'action_breakdowns_enum' => AdsInsightsActionBreakdownsValues::getInstance()->getValues(),\n      'action_report_time_enum' => AdsInsightsActionReportTimeValues::getInstance()->getValues(),\n      'breakdowns_enum' => AdsInsightsBreakdownsValues::getInstance()->getValues(),\n      'date_preset_enum' => AdsInsightsDatePresetValues::getInstance()->getValues(),\n      'level_enum' => AdsInsightsLevelValues::getInstance()->getValues(),\n      'summary_action_breakdowns_enum' => AdsInsightsSummaryActionBreakdownsValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/insights',\n      new AdReportRun(),\n      'EDGE',\n      AdReportRun::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLeads(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/leads',\n      new Lead(),\n      'EDGE',\n      Lead::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPreViews(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_format' => 'ad_format_enum',\n      'creative_feature' => 'creative_feature_enum',\n      'dynamic_asset_label' => 'string',\n      'dynamic_creative_spec' => 'Object',\n      'dynamic_customization' => 'Object',\n      'end_date' => 'datetime',\n      'height' => 'unsigned int',\n      'locale' => 'string',\n      'place_page_id' => 'int',\n      'post' => 'Object',\n      'product_item_ids' => 'list<string>',\n      'render_type' => 'render_type_enum',\n      'start_date' => 'datetime',\n      'width' => 'unsigned int',\n    );\n    $enums = array(\n      'ad_format_enum' => AdPreviewAdFormatValues::getInstance()->getValues(),\n      'creative_feature_enum' => AdPreviewCreativeFeatureValues::getInstance()->getValues(),\n      'render_type_enum' => AdPreviewRenderTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/previews',\n      new AdPreview(),\n      'EDGE',\n      AdPreview::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTargetingSentenceLines(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/targetingsentencelines',\n      new TargetingSentenceLine(),\n      'EDGE',\n      TargetingSentenceLine::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'am_call_tags' => 'map',\n      'date_preset' => 'date_preset_enum',\n      'from_adtable' => 'bool',\n      'review_feedback_breakdown' => 'bool',\n      'time_range' => 'Object',\n    );\n    $enums = array(\n      'date_preset_enum' => array(\n        'data_maximum',\n        'last_14d',\n        'last_28d',\n        'last_30d',\n        'last_3d',\n        'last_7d',\n        'last_90d',\n        'last_month',\n        'last_quarter',\n        'last_week_mon_sun',\n        'last_week_sun_sat',\n        'last_year',\n        'maximum',\n        'this_month',\n        'this_quarter',\n        'this_week_mon_today',\n        'this_week_sun_today',\n        'this_year',\n        'today',\n        'yesterday',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Ad(),\n      'NODE',\n      Ad::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adlabels' => 'list<Object>',\n      'adset_spec' => 'AdSet',\n      'audience_id' => 'string',\n      'bid_amount' => 'int',\n      'conversion_domain' => 'string',\n      'creative' => 'AdCreative',\n      'display_sequence' => 'unsigned int',\n      'draft_adgroup_id' => 'string',\n      'engagement_audience' => 'bool',\n      'execution_options' => 'list<execution_options_enum>',\n      'include_demolink_hashes' => 'bool',\n      'meta_reward_adgroup_status' => 'meta_reward_adgroup_status_enum',\n      'name' => 'string',\n      'priority' => 'unsigned int',\n      'status' => 'status_enum',\n      'tracking_specs' => 'Object',\n    );\n    $enums = array(\n      'execution_options_enum' => AdExecutionOptionsValues::getInstance()->getValues(),\n      'meta_reward_adgroup_status_enum' => AdMetaRewardAdgroupStatusValues::getInstance()->getValues(),\n      'status_enum' => AdStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new Ad(),\n      'NODE',\n      Ad::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 528}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountFields;\nuse FacebookAds\\Object\\Values\\AdAccountActionSourceValues;\nuse FacebookAds\\Object\\Values\\AdAccountAdRulesHistoryActionValues;\nuse FacebookAds\\Object\\Values\\AdAccountAdRulesHistoryEvaluationTypeValues;\nuse FacebookAds\\Object\\Values\\AdAccountAdVolumeRecommendationTypeValues;\nuse FacebookAds\\Object\\Values\\AdAccountClaimObjectiveValues;\nuse FacebookAds\\Object\\Values\\AdAccountContentTypeValues;\nuse FacebookAds\\Object\\Values\\AdAccountCurrencyValues;\nuse FacebookAds\\Object\\Values\\AdAccountDeliveryEstimateOptimizationGoalValues;\nuse FacebookAds\\Object\\Values\\AdAccountMatchedSearchApplicationsEdgeDataAppStoreValues;\nuse FacebookAds\\Object\\Values\\AdAccountSubtypeValues;\nuse FacebookAds\\Object\\Values\\AdAccountTargetingUnifiedAppStoreValues;\nuse FacebookAds\\Object\\Values\\AdAccountTargetingUnifiedLimitTypeValues;\nuse FacebookAds\\Object\\Values\\AdAccountTargetingUnifiedModeValues;\nuse FacebookAds\\Object\\Values\\AdAccountTargetingUnifiedObjectiveValues;\nuse FacebookAds\\Object\\Values\\AdAccountTargetingUnifiedRegulatedCategoriesValues;\nuse FacebookAds\\Object\\Values\\AdAccountTargetingUnifiedRegulatedCountriesValues;\nuse FacebookAds\\Object\\Values\\AdAccountTargetingUnifiedWhitelistedTypesValues;\nuse FacebookAds\\Object\\Values\\AdAccountTasksValues;\nuse FacebookAds\\Object\\Values\\AdActivityCategoryValues;\nuse FacebookAds\\Object\\Values\\AdActivityDataSourceValues;\nuse FacebookAds\\Object\\Values\\AdAsyncRequestSetNotificationModeValues;\nuse FacebookAds\\Object\\Values\\AdCreativeApplinkTreatmentValues;\nuse FacebookAds\\Object\\Values\\AdCreativeAuthorizationCategoryValues;\nuse FacebookAds\\Object\\Values\\AdCreativeCategorizationCriteriaValues;\nuse FacebookAds\\Object\\Values\\AdCreativeCategoryMediaSourceValues;\nuse FacebookAds\\Object\\Values\\AdCreativeDynamicAdVoiceValues;\nuse FacebookAds\\Object\\Values\\AdCreativeOperatorValues;\nuse FacebookAds\\Object\\Values\\AdDatePresetValues;\nuse FacebookAds\\Object\\Values\\AdExecutionOptionsValues;\nuse FacebookAds\\Object\\Values\\AdMetaRewardAdgroupStatusValues;\nuse FacebookAds\\Object\\Values\\AdOperatorValues;\nuse FacebookAds\\Object\\Values\\AdPlacePageSetLocationTypesValues;\nuse FacebookAds\\Object\\Values\\AdPlacePageSetTargetedAreaTypeValues;\nuse FacebookAds\\Object\\Values\\AdPreviewAdFormatValues;\nuse FacebookAds\\Object\\Values\\AdPreviewCreativeFeatureValues;\nuse FacebookAds\\Object\\Values\\AdPreviewRenderTypeValues;\nuse FacebookAds\\Object\\Values\\AdRuleStatusValues;\nuse FacebookAds\\Object\\Values\\AdRuleUiCreationSourceValues;\nuse FacebookAds\\Object\\Values\\AdSetBidStrategyValues;\nuse FacebookAds\\Object\\Values\\AdSetBillingEventValues;\nuse FacebookAds\\Object\\Values\\AdSetDatePresetValues;\nuse FacebookAds\\Object\\Values\\AdSetDestinationTypeValues;\nuse FacebookAds\\Object\\Values\\AdSetEffectiveStatusValues;\nuse FacebookAds\\Object\\Values\\AdSetExecutionOptionsValues;\nuse FacebookAds\\Object\\Values\\AdSetFullFunnelExplorationModeValues;\nuse FacebookAds\\Object\\Values\\AdSetMultiOptimizationGoalWeightValues;\nuse FacebookAds\\Object\\Values\\AdSetOperatorValues;\nuse FacebookAds\\Object\\Values\\AdSetOptimizationGoalValues;\nuse FacebookAds\\Object\\Values\\AdSetOptimizationSubEventValues;\nuse FacebookAds\\Object\\Values\\AdSetStatusValues;\nuse FacebookAds\\Object\\Values\\AdSetTuneForCategoryValues;\nuse FacebookAds\\Object\\Values\\AdStatusValues;\nuse FacebookAds\\Object\\Values\\AdVideoContainerTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoContentCategoryValues;\nuse FacebookAds\\Object\\Values\\AdVideoFormattingValues;\nuse FacebookAds\\Object\\Values\\AdVideoOriginalProjectionTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoSwapModeValues;\nuse FacebookAds\\Object\\Values\\AdVideoUnpublishedContentTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoUploadPhaseValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsActionAttributionWindowsValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsActionBreakdownsValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsActionReportTimeValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsBreakdownsValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsDatePresetValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsLevelValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsSummaryActionBreakdownsValues;\nuse FacebookAds\\Object\\Values\\AdsPixelSortByValues;\nuse FacebookAds\\Object\\Values\\AsyncRequestStatusValues;\nuse FacebookAds\\Object\\Values\\AsyncRequestTypeValues;\nuse FacebookAds\\Object\\Values\\BusinessOwnedObjectOnBehalfOfRequestStatusValues;\nuse FacebookAds\\Object\\Values\\CampaignBidStrategyValues;\nuse FacebookAds\\Object\\Values\\CampaignDatePresetValues;\nuse FacebookAds\\Object\\Values\\CampaignEffectiveStatusValues;\nuse FacebookAds\\Object\\Values\\CampaignExecutionOptionsValues;\nuse FacebookAds\\Object\\Values\\CampaignObjectiveValues;\nuse FacebookAds\\Object\\Values\\CampaignOperatorValues;\nuse FacebookAds\\Object\\Values\\CampaignSmartPromotionTypeValues;\nuse FacebookAds\\Object\\Values\\CampaignSpecialAdCategoriesValues;\nuse FacebookAds\\Object\\Values\\CampaignSpecialAdCategoryCountryValues;\nuse FacebookAds\\Object\\Values\\CampaignStatusValues;\nuse FacebookAds\\Object\\Values\\CustomAudienceClaimObjectiveValues;\nuse FacebookAds\\Object\\Values\\CustomAudienceContentTypeValues;\nuse FacebookAds\\Object\\Values\\CustomAudienceCustomerFileSourceValues;\nuse FacebookAds\\Object\\Values\\CustomAudienceSubtypeValues;\nuse FacebookAds\\Object\\Values\\CustomConversionCustomEventTypeValues;\nuse FacebookAds\\Object\\Values\\ReachFrequencyPredictionActionValues;\nuse FacebookAds\\Object\\Values\\ReachFrequencyPredictionBuyingTypeValues;\nuse FacebookAds\\Object\\Values\\ReachFrequencyPredictionInstreamPackagesValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccount extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'adaccounts';\n  }\n\n  /**\n   * @return AdAccountFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Currency'] = AdAccountCurrencyValues::getInstance()->getValues();\n    $ref_enums['Tasks'] = AdAccountTasksValues::getInstance()->getValues();\n    $ref_enums['ClaimObjective'] = AdAccountClaimObjectiveValues::getInstance()->getValues();\n    $ref_enums['ContentType'] = AdAccountContentTypeValues::getInstance()->getValues();\n    $ref_enums['Subtype'] = AdAccountSubtypeValues::getInstance()->getValues();\n    $ref_enums['ActionSource'] = AdAccountActionSourceValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAccountControls(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/account_controls',\n      new AdAccountBusinessConstraints(),\n      'EDGE',\n      AdAccountBusinessConstraints::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAccountControl(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'audience_controls' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/account_controls',\n      new AdAccountBusinessConstraints(),\n      'EDGE',\n      AdAccountBusinessConstraints::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getActivities(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'add_children' => 'bool',\n      'after' => 'string',\n      'business_id' => 'string',\n      'category' => 'category_enum',\n      'data_source' => 'data_source_enum',\n      'extra_oids' => 'list<string>',\n      'limit' => 'int',\n      'oid' => 'string',\n      'since' => 'datetime',\n      'uid' => 'int',\n      'until' => 'datetime',\n    );\n    $enums = array(\n      'category_enum' => AdActivityCategoryValues::getInstance()->getValues(),\n      'data_source_enum' => AdActivityDataSourceValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/activities',\n      new AdActivity(),\n      'EDGE',\n      AdActivity::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdPlacePageSets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ad_place_page_sets',\n      new AdPlacePageSet(),\n      'EDGE',\n      AdPlacePageSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdPlacePageSet(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'location_types' => 'list<location_types_enum>',\n      'name' => 'string',\n      'parent_page' => 'string',\n      'targeted_area_type' => 'targeted_area_type_enum',\n    );\n    $enums = array(\n      'location_types_enum' => AdPlacePageSetLocationTypesValues::getInstance()->getValues(),\n      'targeted_area_type_enum' => AdPlacePageSetTargetedAreaTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/ad_place_page_sets',\n      new AdPlacePageSet(),\n      'EDGE',\n      AdPlacePageSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdPlacePageSetsAsync(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'location_types' => 'list<location_types_enum>',\n      'name' => 'string',\n      'parent_page' => 'string',\n      'targeted_area_type' => 'targeted_area_type_enum',\n    );\n    $enums = array(\n      'location_types_enum' => AdPlacePageSetLocationTypesValues::getInstance()->getValues(),\n      'targeted_area_type_enum' => AdPlacePageSetTargetedAreaTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/ad_place_page_sets_async',\n      new AdPlacePageSet(),\n      'EDGE',\n      AdPlacePageSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdSavedKeywords(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'fields' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ad_saved_keywords',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdStudies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ad_studies',\n      new AdStudy(),\n      'EDGE',\n      AdStudy::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdCloudPlayables(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adcloudplayables',\n      new CloudGame(),\n      'EDGE',\n      CloudGame::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdCreatives(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adcreatives',\n      new AdCreative(),\n      'EDGE',\n      AdCreative::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdCreative(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'actor_id' => 'unsigned int',\n      'adlabels' => 'list<Object>',\n      'applink_treatment' => 'applink_treatment_enum',\n      'asset_feed_spec' => 'Object',\n      'authorization_category' => 'authorization_category_enum',\n      'body' => 'string',\n      'branded_content' => 'map',\n      'branded_content_sponsor_page_id' => 'string',\n      'bundle_folder_id' => 'string',\n      'call_to_action' => 'Object',\n      'categorization_criteria' => 'categorization_criteria_enum',\n      'category_media_source' => 'category_media_source_enum',\n      'degrees_of_freedom_spec' => 'map',\n      'destination_set_id' => 'string',\n      'dynamic_ad_voice' => 'dynamic_ad_voice_enum',\n      'enable_launch_instant_app' => 'bool',\n      'facebook_branded_content' => 'map',\n      'image_crops' => 'map',\n      'image_file' => 'string',\n      'image_hash' => 'string',\n      'image_url' => 'string',\n      'instagram_actor_id' => 'string',\n      'instagram_branded_content' => 'map',\n      'instagram_permalink_url' => 'string',\n      'instagram_user_id' => 'string',\n      'interactive_components_spec' => 'map',\n      'is_dco_internal' => 'bool',\n      'link_og_id' => 'string',\n      'link_url' => 'string',\n      'messenger_sponsored_message' => 'string',\n      'name' => 'string',\n      'object_id' => 'unsigned int',\n      'object_story_id' => 'string',\n      'object_story_spec' => 'AdCreativeObjectStorySpec',\n      'object_type' => 'string',\n      'object_url' => 'string',\n      'omnichannel_link_spec' => 'map',\n      'place_page_set_id' => 'string',\n      'platform_customizations' => 'Object',\n      'playable_asset_id' => 'string',\n      'portrait_customizations' => 'map',\n      'product_set_id' => 'string',\n      'recommender_settings' => 'map',\n      'source_instagram_media_id' => 'string',\n      'template_url' => 'string',\n      'template_url_spec' => 'Object',\n      'thumbnail_url' => 'string',\n      'title' => 'string',\n      'url_tags' => 'string',\n      'use_page_actor_override' => 'bool',\n    );\n    $enums = array(\n      'applink_treatment_enum' => AdCreativeApplinkTreatmentValues::getInstance()->getValues(),\n      'authorization_category_enum' => AdCreativeAuthorizationCategoryValues::getInstance()->getValues(),\n      'categorization_criteria_enum' => AdCreativeCategorizationCriteriaValues::getInstance()->getValues(),\n      'category_media_source_enum' => AdCreativeCategoryMediaSourceValues::getInstance()->getValues(),\n      'dynamic_ad_voice_enum' => AdCreativeDynamicAdVoiceValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adcreatives',\n      new AdCreative(),\n      'EDGE',\n      AdCreative::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdCreativesByLabels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_label_ids' => 'list<string>',\n      'operator' => 'operator_enum',\n    );\n    $enums = array(\n      'operator_enum' => AdCreativeOperatorValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adcreativesbylabels',\n      new AdCreative(),\n      'EDGE',\n      AdCreative::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteAdImages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'hash' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/adimages',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdImages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'biz_tag_id' => 'unsigned int',\n      'business_id' => 'string',\n      'hashes' => 'list<string>',\n      'minheight' => 'unsigned int',\n      'minwidth' => 'unsigned int',\n      'name' => 'string',\n      'selected_hashes' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adimages',\n      new AdImage(),\n      'EDGE',\n      AdImage::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdImage(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bytes' => 'Object',\n      'copy_from' => 'Object',\n      'filename' => 'file'\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adimages',\n      new AdImage(),\n      'EDGE',\n      AdImage::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums),\n      true\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdLabels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adlabels',\n      new AdLabel(),\n      'EDGE',\n      AdLabel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdLabel(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adlabels',\n      new AdLabel(),\n      'EDGE',\n      AdLabel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdPlayables(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adplayables',\n      new PlayableContent(),\n      'EDGE',\n      PlayableContent::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdPlayable(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'app_id' => 'string',\n      'name' => 'string',\n      'session_id' => 'string',\n      'source' => 'file',\n      'source_url' => 'string',\n      'source_zip' => 'file',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adplayables',\n      new PlayableContent(),\n      'EDGE',\n      PlayableContent::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdRulesHistory(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action' => 'action_enum',\n      'evaluation_type' => 'evaluation_type_enum',\n      'hide_no_changes' => 'bool',\n      'object_id' => 'string',\n    );\n    $enums = array(\n      'action_enum' => AdAccountAdRulesHistoryActionValues::getInstance()->getValues(),\n      'evaluation_type_enum' => AdAccountAdRulesHistoryEvaluationTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adrules_history',\n      new AdAccountAdRulesHistory(),\n      'EDGE',\n      AdAccountAdRulesHistory::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdRulesLibrary(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adrules_library',\n      new AdRule(),\n      'EDGE',\n      AdRule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdRulesLibrary(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'account_id' => 'string',\n      'evaluation_spec' => 'Object',\n      'execution_spec' => 'Object',\n      'name' => 'string',\n      'schedule_spec' => 'Object',\n      'status' => 'status_enum',\n      'ui_creation_source' => 'ui_creation_source_enum',\n    );\n    $enums = array(\n      'status_enum' => AdRuleStatusValues::getInstance()->getValues(),\n      'ui_creation_source_enum' => AdRuleUiCreationSourceValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adrules_library',\n      new AdRule(),\n      'EDGE',\n      AdRule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAds(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'date_preset' => 'date_preset_enum',\n      'effective_status' => 'list<string>',\n      'time_range' => 'Object',\n      'updated_since' => 'int',\n    );\n    $enums = array(\n      'date_preset_enum' => AdDatePresetValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ads',\n      new Ad(),\n      'EDGE',\n      Ad::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAd(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adlabels' => 'list<Object>',\n      'adset_id' => 'unsigned int',\n      'adset_spec' => 'AdSet',\n      'audience_id' => 'string',\n      'bid_amount' => 'int',\n      'conversion_domain' => 'string',\n      'creative' => 'AdCreative',\n      'date_format' => 'string',\n      'display_sequence' => 'unsigned int',\n      'draft_adgroup_id' => 'string',\n      'engagement_audience' => 'bool',\n      'execution_options' => 'list<execution_options_enum>',\n      'include_demolink_hashes' => 'bool',\n      'meta_reward_adgroup_status' => 'meta_reward_adgroup_status_enum',\n      'name' => 'string',\n      'priority' => 'unsigned int',\n      'source_ad_id' => 'string',\n      'status' => 'status_enum',\n      'tracking_specs' => 'Object',\n    );\n    $enums = array(\n      'execution_options_enum' => AdExecutionOptionsValues::getInstance()->getValues(),\n      'meta_reward_adgroup_status_enum' => AdMetaRewardAdgroupStatusValues::getInstance()->getValues(),\n      'status_enum' => AdStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/ads',\n      new Ad(),\n      'EDGE',\n      Ad::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums),\n      true\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdsConversionGoal(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'description' => 'string',\n      'goal_name' => 'string',\n      'single_channel_conversion_events' => 'list<map>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/ads_conversion_goal',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdsReportingMmmReports(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'filtering' => 'list<map>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ads_reporting_mmm_reports',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdsReportingMmmSchedulers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ads_reporting_mmm_schedulers',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdsVolume(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'page_id' => 'int',\n      'recommendation_type' => 'recommendation_type_enum',\n      'show_breakdown_by_actor' => 'bool',\n    );\n    $enums = array(\n      'recommendation_type_enum' => AdAccountAdVolumeRecommendationTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ads_volume',\n      new AdAccountAdVolume(),\n      'EDGE',\n      AdAccountAdVolume::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdsByLabels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_label_ids' => 'list<string>',\n      'operator' => 'operator_enum',\n    );\n    $enums = array(\n      'operator_enum' => AdOperatorValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adsbylabels',\n      new Ad(),\n      'EDGE',\n      Ad::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdSets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'date_preset' => 'date_preset_enum',\n      'effective_status' => 'list<effective_status_enum>',\n      'is_completed' => 'bool',\n      'time_range' => 'Object',\n      'updated_since' => 'int',\n    );\n    $enums = array(\n      'date_preset_enum' => AdSetDatePresetValues::getInstance()->getValues(),\n      'effective_status_enum' => AdSetEffectiveStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adsets',\n      new AdSet(),\n      'EDGE',\n      AdSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdSet(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adlabels' => 'list<Object>',\n      'adset_schedule' => 'list<Object>',\n      'attribution_spec' => 'list<map>',\n      'bid_adjustments' => 'Object',\n      'bid_amount' => 'int',\n      'bid_constraints' => 'map<string, Object>',\n      'bid_strategy' => 'bid_strategy_enum',\n      'billing_event' => 'billing_event_enum',\n      'campaign_id' => 'string',\n      'campaign_spec' => 'Object',\n      'creative_sequence' => 'list<string>',\n      'daily_budget' => 'unsigned int',\n      'daily_imps' => 'unsigned int',\n      'daily_min_spend_target' => 'unsigned int',\n      'daily_spend_cap' => 'unsigned int',\n      'date_format' => 'string',\n      'destination_type' => 'destination_type_enum',\n      'dsa_beneficiary' => 'string',\n      'dsa_payor' => 'string',\n      'end_time' => 'datetime',\n      'execution_options' => 'list<execution_options_enum>',\n      'existing_customer_budget_percentage' => 'unsigned int',\n      'frequency_control_specs' => 'list<Object>',\n      'full_funnel_exploration_mode' => 'full_funnel_exploration_mode_enum',\n      'is_dynamic_creative' => 'bool',\n      'lifetime_budget' => 'unsigned int',\n      'lifetime_imps' => 'unsigned int',\n      'lifetime_min_spend_target' => 'unsigned int',\n      'lifetime_spend_cap' => 'unsigned int',\n      'line_number' => 'unsigned int',\n      'multi_optimization_goal_weight' => 'multi_optimization_goal_weight_enum',\n      'name' => 'string',\n      'optimization_goal' => 'optimization_goal_enum',\n      'optimization_sub_event' => 'optimization_sub_event_enum',\n      'pacing_type' => 'list<string>',\n      'promoted_object' => 'Object',\n      'rb_prediction_id' => 'string',\n      'rf_prediction_id' => 'string',\n      'source_adset_id' => 'string',\n      'start_time' => 'datetime',\n      'status' => 'status_enum',\n      'targeting' => 'Targeting',\n      'time_based_ad_rotation_id_blocks' => 'list<list<unsigned int>>',\n      'time_based_ad_rotation_intervals' => 'list<unsigned int>',\n      'time_start' => 'datetime',\n      'time_stop' => 'datetime',\n      'topline_id' => 'string',\n      'tune_for_category' => 'tune_for_category_enum',\n    );\n    $enums = array(\n      'bid_strategy_enum' => AdSetBidStrategyValues::getInstance()->getValues(),\n      'billing_event_enum' => AdSetBillingEventValues::getInstance()->getValues(),\n      'destination_type_enum' => AdSetDestinationTypeValues::getInstance()->getValues(),\n      'execution_options_enum' => AdSetExecutionOptionsValues::getInstance()->getValues(),\n      'full_funnel_exploration_mode_enum' => AdSetFullFunnelExplorationModeValues::getInstance()->getValues(),\n      'multi_optimization_goal_weight_enum' => AdSetMultiOptimizationGoalWeightValues::getInstance()->getValues(),\n      'optimization_goal_enum' => AdSetOptimizationGoalValues::getInstance()->getValues(),\n      'optimization_sub_event_enum' => AdSetOptimizationSubEventValues::getInstance()->getValues(),\n      'status_enum' => AdSetStatusValues::getInstance()->getValues(),\n      'tune_for_category_enum' => AdSetTuneForCategoryValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adsets',\n      new AdSet(),\n      'EDGE',\n      AdSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdSetsByLabels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_label_ids' => 'list<string>',\n      'operator' => 'operator_enum',\n    );\n    $enums = array(\n      'operator_enum' => AdSetOperatorValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adsetsbylabels',\n      new AdSet(),\n      'EDGE',\n      AdSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdsPixels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'sort_by' => 'sort_by_enum',\n    );\n    $enums = array(\n      'sort_by_enum' => AdsPixelSortByValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adspixels',\n      new AdsPixel(),\n      'EDGE',\n      AdsPixel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdsPixel(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adspixels',\n      new AdsPixel(),\n      'EDGE',\n      AdsPixel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdvertisableApplications(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'app_id' => 'string',\n      'business_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/advertisable_applications',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteAdVideos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'video_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/advideos',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdVideos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'max_aspect_ratio' => 'float',\n      'maxheight' => 'unsigned int',\n      'maxlength' => 'unsigned int',\n      'maxwidth' => 'unsigned int',\n      'min_aspect_ratio' => 'float',\n      'minheight' => 'unsigned int',\n      'minlength' => 'unsigned int',\n      'minwidth' => 'unsigned int',\n      'title' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/advideos',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdVideo(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adaptive_type' => 'string',\n      'animated_effect_id' => 'unsigned int',\n      'application_id' => 'string',\n      'asked_fun_fact_prompt_id' => 'unsigned int',\n      'audio_story_wave_animation_handle' => 'string',\n      'chunk_session_id' => 'string',\n      'composer_entry_picker' => 'string',\n      'composer_entry_point' => 'string',\n      'composer_entry_time' => 'unsigned int',\n      'composer_session_events_log' => 'string',\n      'composer_session_id' => 'string',\n      'composer_source_surface' => 'string',\n      'composer_type' => 'string',\n      'container_type' => 'container_type_enum',\n      'content_category' => 'content_category_enum',\n      'creative_tools' => 'string',\n      'description' => 'string',\n      'embeddable' => 'bool',\n      'end_offset' => 'unsigned int',\n      'fbuploader_video_file_chunk' => 'string',\n      'file_size' => 'unsigned int',\n      'file_url' => 'string',\n      'fisheye_video_cropped' => 'bool',\n      'formatting' => 'formatting_enum',\n      'fov' => 'unsigned int',\n      'front_z_rotation' => 'float',\n      'fun_fact_prompt_id' => 'unsigned int',\n      'fun_fact_toastee_id' => 'unsigned int',\n      'guide' => 'list<list<unsigned int>>',\n      'guide_enabled' => 'bool',\n      'has_nickname' => 'bool',\n      'holiday_card' => 'string',\n      'initial_heading' => 'unsigned int',\n      'initial_pitch' => 'unsigned int',\n      'instant_game_entry_point_data' => 'string',\n      'is_boost_intended' => 'bool',\n      'is_group_linking_post' => 'bool',\n      'is_voice_clip' => 'bool',\n      'location_source_id' => 'string',\n      'name' => 'string',\n      'offer_like_post_id' => 'unsigned int',\n      'og_action_type_id' => 'string',\n      'og_icon_id' => 'string',\n      'og_object_id' => 'string',\n      'og_phrase' => 'string',\n      'og_suggestion_mechanism' => 'string',\n      'original_fov' => 'unsigned int',\n      'original_projection_type' => 'original_projection_type_enum',\n      'publish_event_id' => 'unsigned int',\n      'react_mode_metadata' => 'string',\n      'referenced_sticker_id' => 'string',\n      'replace_video_id' => 'string',\n      'slideshow_spec' => 'map',\n      'source' => 'file',\n      'source_instagram_media_id' => 'string',\n      'spherical' => 'bool',\n      'start_offset' => 'unsigned int',\n      'swap_mode' => 'swap_mode_enum',\n      'text_format_metadata' => 'string',\n      'throwback_camera_roll_media' => 'string',\n      'thumb' => 'file',\n      'time_since_original_post' => 'unsigned int',\n      'title' => 'string',\n      'transcode_setting_properties' => 'string',\n      'unpublished_content_type' => 'unpublished_content_type_enum',\n      'upload_phase' => 'upload_phase_enum',\n      'upload_session_id' => 'string',\n      'upload_setting_properties' => 'string',\n      'video_file_chunk' => 'file',\n      'video_id_original' => 'string',\n      'video_start_time_ms' => 'unsigned int',\n      'waterfall_id' => 'string',\n    );\n    $enums = array(\n      'container_type_enum' => AdVideoContainerTypeValues::getInstance()->getValues(),\n      'content_category_enum' => AdVideoContentCategoryValues::getInstance()->getValues(),\n      'formatting_enum' => AdVideoFormattingValues::getInstance()->getValues(),\n      'original_projection_type_enum' => AdVideoOriginalProjectionTypeValues::getInstance()->getValues(),\n      'swap_mode_enum' => AdVideoSwapModeValues::getInstance()->getValues(),\n      'unpublished_content_type_enum' => AdVideoUnpublishedContentTypeValues::getInstance()->getValues(),\n      'upload_phase_enum' => AdVideoUploadPhaseValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/advideos',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums),\n      true,\n      true\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAffectedAdSets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/affectedadsets',\n      new AdSet(),\n      'EDGE',\n      AdSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteAgencies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/agencies',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAgencies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/agencies',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getApplications(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/applications',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteAssignedUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'user' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/assigned_users',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAssignedUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/assigned_users',\n      new AssignedUser(),\n      'EDGE',\n      AssignedUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAssignedUser(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'tasks' => 'list<tasks_enum>',\n      'user' => 'int',\n    );\n    $enums = array(\n      'tasks_enum' => AdAccountTasksValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/assigned_users',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAsyncBatchRequest(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adbatch' => 'list<Object>',\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/async_batch_requests',\n      new Campaign(),\n      'EDGE',\n      Campaign::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAsyncRequests(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'status' => 'status_enum',\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'status_enum' => AsyncRequestStatusValues::getInstance()->getValues(),\n      'type_enum' => AsyncRequestTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/async_requests',\n      new AsyncRequest(),\n      'EDGE',\n      AsyncRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAsyncAdRequestSets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'is_completed' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/asyncadrequestsets',\n      new AdAsyncRequestSet(),\n      'EDGE',\n      AdAsyncRequestSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAsyncAdRequestSet(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_specs' => 'list<map>',\n      'name' => 'string',\n      'notification_mode' => 'notification_mode_enum',\n      'notification_uri' => 'string',\n    );\n    $enums = array(\n      'notification_mode_enum' => AdAsyncRequestSetNotificationModeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/asyncadrequestsets',\n      new AdAsyncRequestSet(),\n      'EDGE',\n      AdAsyncRequestSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createBlockListDraft(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'publisher_urls_file' => 'file',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/block_list_drafts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getBroadTargetingCategories(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'custom_categories_only' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/broadtargetingcategories',\n      new BroadTargetingCategories(),\n      'EDGE',\n      BroadTargetingCategories::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getBusinessProjects(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/businessprojects',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteCampaigns(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'before_date' => 'datetime',\n      'delete_offset' => 'unsigned int',\n      'delete_strategy' => 'delete_strategy_enum',\n      'object_count' => 'int',\n    );\n    $enums = array(\n      'delete_strategy_enum' => array(\n        'DELETE_ANY',\n        'DELETE_ARCHIVED_BEFORE',\n        'DELETE_OLDEST',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/campaigns',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCampaigns(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'date_preset' => 'date_preset_enum',\n      'effective_status' => 'list<effective_status_enum>',\n      'is_completed' => 'bool',\n      'time_range' => 'Object',\n    );\n    $enums = array(\n      'date_preset_enum' => CampaignDatePresetValues::getInstance()->getValues(),\n      'effective_status_enum' => CampaignEffectiveStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/campaigns',\n      new Campaign(),\n      'EDGE',\n      Campaign::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCampaign(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adlabels' => 'list<Object>',\n      'bid_strategy' => 'bid_strategy_enum',\n      'buying_type' => 'string',\n      'daily_budget' => 'unsigned int',\n      'execution_options' => 'list<execution_options_enum>',\n      'is_skadnetwork_attribution' => 'bool',\n      'iterative_split_test_configs' => 'list<Object>',\n      'lifetime_budget' => 'unsigned int',\n      'name' => 'string',\n      'objective' => 'objective_enum',\n      'pacing_type' => 'list<string>',\n      'promoted_object' => 'Object',\n      'smart_promotion_type' => 'smart_promotion_type_enum',\n      'source_campaign_id' => 'string',\n      'special_ad_categories' => 'list<special_ad_categories_enum>',\n      'special_ad_category_country' => 'list<special_ad_category_country_enum>',\n      'spend_cap' => 'unsigned int',\n      'start_time' => 'datetime',\n      'status' => 'status_enum',\n      'stop_time' => 'datetime',\n      'topline_id' => 'string',\n    );\n    $enums = array(\n      'bid_strategy_enum' => CampaignBidStrategyValues::getInstance()->getValues(),\n      'execution_options_enum' => CampaignExecutionOptionsValues::getInstance()->getValues(),\n      'objective_enum' => CampaignObjectiveValues::getInstance()->getValues(),\n      'smart_promotion_type_enum' => CampaignSmartPromotionTypeValues::getInstance()->getValues(),\n      'special_ad_categories_enum' => CampaignSpecialAdCategoriesValues::getInstance()->getValues(),\n      'special_ad_category_country_enum' => CampaignSpecialAdCategoryCountryValues::getInstance()->getValues(),\n      'status_enum' => CampaignStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/campaigns',\n      new Campaign(),\n      'EDGE',\n      Campaign::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCampaignsByLabels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_label_ids' => 'list<string>',\n      'operator' => 'operator_enum',\n    );\n    $enums = array(\n      'operator_enum' => CampaignOperatorValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/campaignsbylabels',\n      new Campaign(),\n      'EDGE',\n      Campaign::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getConnectedInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/connected_instagram_accounts',\n      new IGUser(),\n      'EDGE',\n      IGUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getConversionGoals(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/conversion_goals',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCustomAudiences(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business_id' => 'string',\n      'fetch_primary_audience' => 'bool',\n      'fields' => 'list<string>',\n      'filtering' => 'list<Object>',\n      'pixel_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/customaudiences',\n      new CustomAudience(),\n      'EDGE',\n      CustomAudience::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCustomAudience(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'allowed_domains' => 'list<string>',\n      'associated_audience_id' => 'unsigned int',\n      'claim_objective' => 'claim_objective_enum',\n      'content_type' => 'content_type_enum',\n      'countries' => 'string',\n      'creation_params' => 'map',\n      'customer_file_source' => 'customer_file_source_enum',\n      'dataset_id' => 'string',\n      'description' => 'string',\n      'enable_fetch_or_create' => 'bool',\n      'event_source_group' => 'string',\n      'event_sources' => 'list<map>',\n      'exclusions' => 'list<Object>',\n      'inclusions' => 'list<Object>',\n      'is_snapshot' => 'bool',\n      'is_value_based' => 'bool',\n      'list_of_accounts' => 'list<unsigned int>',\n      'lookalike_spec' => 'string',\n      'name' => 'string',\n      'opt_out_link' => 'string',\n      'origin_audience_id' => 'string',\n      'parent_audience_id' => 'unsigned int',\n      'partner_reference_key' => 'string',\n      'pixel_id' => 'string',\n      'prefill' => 'bool',\n      'product_set_id' => 'string',\n      'regulated_audience_spec' => 'string',\n      'retention_days' => 'unsigned int',\n      'rev_share_policy_id' => 'unsigned int',\n      'rule' => 'string',\n      'rule_aggregation' => 'string',\n      'subtype' => 'subtype_enum',\n      'use_in_campaigns' => 'bool',\n      'video_group_ids' => 'list<string>',\n    );\n    $enums = array(\n      'claim_objective_enum' => CustomAudienceClaimObjectiveValues::getInstance()->getValues(),\n      'content_type_enum' => CustomAudienceContentTypeValues::getInstance()->getValues(),\n      'customer_file_source_enum' => CustomAudienceCustomerFileSourceValues::getInstance()->getValues(),\n      'subtype_enum' => CustomAudienceSubtypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/customaudiences',\n      new CustomAudience(),\n      'EDGE',\n      CustomAudience::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCustomAudiencesTos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/customaudiencestos',\n      new CustomAudiencesTOS(),\n      'EDGE',\n      CustomAudiencesTOS::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCustomAudiencesTo(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business_id' => 'string',\n      'tos_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/customaudiencestos',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCustomConversions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/customconversions',\n      new CustomConversion(),\n      'EDGE',\n      CustomConversion::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCustomConversion(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'advanced_rule' => 'string',\n      'custom_event_type' => 'custom_event_type_enum',\n      'default_conversion_value' => 'float',\n      'description' => 'string',\n      'event_source_id' => 'string',\n      'name' => 'string',\n      'rule' => 'string',\n    );\n    $enums = array(\n      'custom_event_type_enum' => CustomConversionCustomEventTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/customconversions',\n      new CustomConversion(),\n      'EDGE',\n      CustomConversion::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getDeliveryEstimate(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'optimization_goal' => 'optimization_goal_enum',\n      'promoted_object' => 'Object',\n      'targeting_spec' => 'Targeting',\n    );\n    $enums = array(\n      'optimization_goal_enum' => AdAccountDeliveryEstimateOptimizationGoalValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/delivery_estimate',\n      new AdAccountDeliveryEstimate(),\n      'EDGE',\n      AdAccountDeliveryEstimate::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getDeprecatedTargetingAdSets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'type' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/deprecatedtargetingadsets',\n      new AdSet(),\n      'EDGE',\n      AdSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getGeneratePreViews(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_format' => 'ad_format_enum',\n      'creative' => 'AdCreative',\n      'creative_feature' => 'creative_feature_enum',\n      'dynamic_asset_label' => 'string',\n      'dynamic_creative_spec' => 'Object',\n      'dynamic_customization' => 'Object',\n      'end_date' => 'datetime',\n      'height' => 'unsigned int',\n      'locale' => 'string',\n      'place_page_id' => 'int',\n      'post' => 'Object',\n      'product_item_ids' => 'list<string>',\n      'render_type' => 'render_type_enum',\n      'start_date' => 'datetime',\n      'width' => 'unsigned int',\n    );\n    $enums = array(\n      'ad_format_enum' => AdPreviewAdFormatValues::getInstance()->getValues(),\n      'creative_feature_enum' => AdPreviewCreativeFeatureValues::getInstance()->getValues(),\n      'render_type_enum' => AdPreviewRenderTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/generatepreviews',\n      new AdPreview(),\n      'EDGE',\n      AdPreview::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getImpactingAdStudies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/impacting_ad_studies',\n      new AdStudy(),\n      'EDGE',\n      AdStudy::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInsights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action_attribution_windows' => 'list<action_attribution_windows_enum>',\n      'action_breakdowns' => 'list<action_breakdowns_enum>',\n      'action_report_time' => 'action_report_time_enum',\n      'breakdowns' => 'list<breakdowns_enum>',\n      'date_preset' => 'date_preset_enum',\n      'default_summary' => 'bool',\n      'export_columns' => 'list<string>',\n      'export_format' => 'string',\n      'export_name' => 'string',\n      'fields' => 'list<string>',\n      'filtering' => 'list<Object>',\n      'level' => 'level_enum',\n      'product_id_limit' => 'int',\n      'sort' => 'list<string>',\n      'summary' => 'list<string>',\n      'summary_action_breakdowns' => 'list<summary_action_breakdowns_enum>',\n      'time_increment' => 'string',\n      'time_range' => 'Object',\n      'time_ranges' => 'list<Object>',\n      'use_account_attribution_setting' => 'bool',\n      'use_unified_attribution_setting' => 'bool',\n    );\n    $enums = array(\n      'action_attribution_windows_enum' => AdsInsightsActionAttributionWindowsValues::getInstance()->getValues(),\n      'action_breakdowns_enum' => AdsInsightsActionBreakdownsValues::getInstance()->getValues(),\n      'action_report_time_enum' => AdsInsightsActionReportTimeValues::getInstance()->getValues(),\n      'breakdowns_enum' => AdsInsightsBreakdownsValues::getInstance()->getValues(),\n      'date_preset_enum' => AdsInsightsDatePresetValues::getInstance()->getValues(),\n      'level_enum' => AdsInsightsLevelValues::getInstance()->getValues(),\n      'summary_action_breakdowns_enum' => AdsInsightsSummaryActionBreakdownsValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/insights',\n      new AdsInsights(),\n      'EDGE',\n      AdsInsights::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInsightsAsync(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action_attribution_windows' => 'list<action_attribution_windows_enum>',\n      'action_breakdowns' => 'list<action_breakdowns_enum>',\n      'action_report_time' => 'action_report_time_enum',\n      'breakdowns' => 'list<breakdowns_enum>',\n      'date_preset' => 'date_preset_enum',\n      'default_summary' => 'bool',\n      'export_columns' => 'list<string>',\n      'export_format' => 'string',\n      'export_name' => 'string',\n      'fields' => 'list<string>',\n      'filtering' => 'list<Object>',\n      'level' => 'level_enum',\n      'product_id_limit' => 'int',\n      'sort' => 'list<string>',\n      'summary' => 'list<string>',\n      'summary_action_breakdowns' => 'list<summary_action_breakdowns_enum>',\n      'time_increment' => 'string',\n      'time_range' => 'Object',\n      'time_ranges' => 'list<Object>',\n      'use_account_attribution_setting' => 'bool',\n      'use_unified_attribution_setting' => 'bool',\n    );\n    $enums = array(\n      'action_attribution_windows_enum' => AdsInsightsActionAttributionWindowsValues::getInstance()->getValues(),\n      'action_breakdowns_enum' => AdsInsightsActionBreakdownsValues::getInstance()->getValues(),\n      'action_report_time_enum' => AdsInsightsActionReportTimeValues::getInstance()->getValues(),\n      'breakdowns_enum' => AdsInsightsBreakdownsValues::getInstance()->getValues(),\n      'date_preset_enum' => AdsInsightsDatePresetValues::getInstance()->getValues(),\n      'level_enum' => AdsInsightsLevelValues::getInstance()->getValues(),\n      'summary_action_breakdowns_enum' => AdsInsightsSummaryActionBreakdownsValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/insights',\n      new AdReportRun(),\n      'EDGE',\n      AdReportRun::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/instagram_accounts',\n      new InstagramUser(),\n      'EDGE',\n      InstagramUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getIosFourteenCampaignLimits(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'app_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ios_fourteen_campaign_limits',\n      new AdAccountIosFourteenCampaignLimits(),\n      'EDGE',\n      AdAccountIosFourteenCampaignLimits::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createManagedPartnerAd(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'campaign_group_id' => 'unsigned int',\n      'campaign_group_status' => 'campaign_group_status_enum',\n      'conversion_domain' => 'string',\n      'custom_event_type' => 'custom_event_type_enum',\n      'end_time' => 'unsigned int',\n      'lifetime_budget' => 'unsigned int',\n      'override_creative_text' => 'string',\n      'override_targeting_countries' => 'list<string>',\n      'product_set_id' => 'string',\n      'start_time' => 'unsigned int',\n      'use_marketplace_template' => 'bool',\n      'use_seller_template' => 'bool',\n    );\n    $enums = array(\n      'campaign_group_status_enum' => array(\n        'ACTIVE',\n        'ADSET_PAUSED',\n        'ARCHIVED',\n        'CAMPAIGN_PAUSED',\n        'DELETED',\n        'DISAPPROVED',\n        'IN_PROCESS',\n        'PAUSED',\n        'PENDING_BILLING_INFO',\n        'PENDING_REVIEW',\n        'PREAPPROVED',\n        'WITH_ISSUES',\n      ),\n      'custom_event_type_enum' => array(\n        'ADD_TO_CART',\n        'CONTENT_VIEW',\n        'PURCHASE',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/managed_partner_ads',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getMatchedSearchApplications(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'allow_incomplete_app' => 'bool',\n      'app_store' => 'app_store_enum',\n      'app_store_country' => 'string',\n      'business_id' => 'string',\n      'is_skadnetwork_search' => 'bool',\n      'only_apps_with_permission' => 'bool',\n      'query_term' => 'string',\n    );\n    $enums = array(\n      'app_store_enum' => AdAccountMatchedSearchApplicationsEdgeDataAppStoreValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/matched_search_applications',\n      new AdAccountMatchedSearchApplicationsEdgeData(),\n      'EDGE',\n      AdAccountMatchedSearchApplicationsEdgeData::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getMaxBid(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/max_bid',\n      new AdAccountMaxBid(),\n      'EDGE',\n      AdAccountMaxBid::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getMinimumBudgets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bid_amount' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/minimum_budgets',\n      new MinimumBudget(),\n      'EDGE',\n      MinimumBudget::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOfflineConversionDataSets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/offline_conversion_data_sets',\n      new OfflineConversionDataSet(),\n      'EDGE',\n      OfflineConversionDataSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOnBehalfRequests(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'status' => 'status_enum',\n    );\n    $enums = array(\n      'status_enum' => BusinessOwnedObjectOnBehalfOfRequestStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/onbehalf_requests',\n      new BusinessOwnedObjectOnBehalfOfRequest(),\n      'EDGE',\n      BusinessOwnedObjectOnBehalfOfRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createProductAudience(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'allowed_domains' => 'list<string>',\n      'associated_audience_id' => 'unsigned int',\n      'claim_objective' => 'claim_objective_enum',\n      'content_type' => 'content_type_enum',\n      'creation_params' => 'map',\n      'description' => 'string',\n      'enable_fetch_or_create' => 'bool',\n      'event_source_group' => 'string',\n      'event_sources' => 'list<map>',\n      'exclusions' => 'list<Object>',\n      'inclusions' => 'list<Object>',\n      'is_snapshot' => 'bool',\n      'is_value_based' => 'bool',\n      'name' => 'string',\n      'opt_out_link' => 'string',\n      'parent_audience_id' => 'unsigned int',\n      'product_set_id' => 'string',\n      'rev_share_policy_id' => 'unsigned int',\n      'subtype' => 'subtype_enum',\n    );\n    $enums = array(\n      'claim_objective_enum' => AdAccountClaimObjectiveValues::getInstance()->getValues(),\n      'content_type_enum' => AdAccountContentTypeValues::getInstance()->getValues(),\n      'subtype_enum' => AdAccountSubtypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/product_audiences',\n      new CustomAudience(),\n      'EDGE',\n      CustomAudience::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPromotePages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/promote_pages',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPublisherBlockLists(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/publisher_block_lists',\n      new PublisherBlockList(),\n      'EDGE',\n      PublisherBlockList::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPublisherBlockList(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/publisher_block_lists',\n      new PublisherBlockList(),\n      'EDGE',\n      PublisherBlockList::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getReachEstimate(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adgroup_ids' => 'list<string>',\n      'caller_id' => 'string',\n      'concepts' => 'string',\n      'creative_action_spec' => 'string',\n      'is_debug' => 'bool',\n      'object_store_url' => 'string',\n      'targeting_spec' => 'Targeting',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/reachestimate',\n      new AdAccountReachEstimate(),\n      'EDGE',\n      AdAccountReachEstimate::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getReachFrequencyPredictions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/reachfrequencypredictions',\n      new ReachFrequencyPrediction(),\n      'EDGE',\n      ReachFrequencyPrediction::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createReachFrequencyPrediction(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action' => 'action_enum',\n      'ad_formats' => 'list<map>',\n      'auction_entry_option_index' => 'unsigned int',\n      'budget' => 'unsigned int',\n      'buying_type' => 'buying_type_enum',\n      'campaign_group_id' => 'string',\n      'day_parting_schedule' => 'list<Object>',\n      'deal_id' => 'string',\n      'destination_id' => 'unsigned int',\n      'destination_ids' => 'list<string>',\n      'end_time' => 'unsigned int',\n      'exceptions' => 'bool',\n      'existing_campaign_id' => 'string',\n      'expiration_time' => 'unsigned int',\n      'frequency_cap' => 'unsigned int',\n      'grp_buying' => 'bool',\n      'impression' => 'unsigned int',\n      'instream_packages' => 'list<instream_packages_enum>',\n      'interval_frequency_cap_reset_period' => 'unsigned int',\n      'is_bonus_media' => 'bool',\n      'is_conversion_goal' => 'bool',\n      'is_full_view' => 'bool',\n      'is_higher_average_frequency' => 'bool',\n      'is_reach_and_frequency_io_buying' => 'bool',\n      'is_reserved_buying' => 'bool',\n      'num_curve_points' => 'unsigned int',\n      'objective' => 'string',\n      'optimization_goal' => 'string',\n      'prediction_mode' => 'unsigned int',\n      'reach' => 'unsigned int',\n      'rf_prediction_id' => 'string',\n      'rf_prediction_id_to_release' => 'string',\n      'rf_prediction_id_to_share' => 'string',\n      'start_time' => 'unsigned int',\n      'stop_time' => 'unsigned int',\n      'story_event_type' => 'unsigned int',\n      'target_cpm' => 'unsigned int',\n      'target_spec' => 'Targeting',\n      'video_view_length_constraint' => 'unsigned int',\n    );\n    $enums = array(\n      'action_enum' => ReachFrequencyPredictionActionValues::getInstance()->getValues(),\n      'buying_type_enum' => ReachFrequencyPredictionBuyingTypeValues::getInstance()->getValues(),\n      'instream_packages_enum' => ReachFrequencyPredictionInstreamPackagesValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/reachfrequencypredictions',\n      new ReachFrequencyPrediction(),\n      'EDGE',\n      ReachFrequencyPrediction::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSavedAudiences(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business_id' => 'string',\n      'fields' => 'list<string>',\n      'filtering' => 'list<Object>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/saved_audiences',\n      new SavedAudience(),\n      'EDGE',\n      SavedAudience::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSubscribedApps(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'app_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/subscribed_apps',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSubscribedApps(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/subscribed_apps',\n      new AdAccountSubscribedApps(),\n      'EDGE',\n      AdAccountSubscribedApps::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createSubscribedApp(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'app_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/subscribed_apps',\n      new AdAccountSubscribedApps(),\n      'EDGE',\n      AdAccountSubscribedApps::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTargetingBrowse(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'excluded_category' => 'string',\n      'include_nodes' => 'bool',\n      'is_exclusion' => 'bool',\n      'limit_type' => 'limit_type_enum',\n      'regulated_categories' => 'list<regulated_categories_enum>',\n      'regulated_countries' => 'list<regulated_countries_enum>',\n      'whitelisted_types' => 'list<whitelisted_types_enum>',\n    );\n    $enums = array(\n      'limit_type_enum' => AdAccountTargetingUnifiedLimitTypeValues::getInstance()->getValues(),\n      'regulated_categories_enum' => AdAccountTargetingUnifiedRegulatedCategoriesValues::getInstance()->getValues(),\n      'regulated_countries_enum' => AdAccountTargetingUnifiedRegulatedCountriesValues::getInstance()->getValues(),\n      'whitelisted_types_enum' => AdAccountTargetingUnifiedWhitelistedTypesValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/targetingbrowse',\n      new AdAccountTargetingUnified(),\n      'EDGE',\n      AdAccountTargetingUnified::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTargetingSearch(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'allow_only_fat_head_interests' => 'bool',\n      'app_store' => 'app_store_enum',\n      'countries' => 'list<string>',\n      'is_exclusion' => 'bool',\n      'limit_type' => 'limit_type_enum',\n      'objective' => 'objective_enum',\n      'promoted_object' => 'Object',\n      'q' => 'string',\n      'regulated_categories' => 'list<regulated_categories_enum>',\n      'regulated_countries' => 'list<regulated_countries_enum>',\n      'session_id' => 'unsigned int',\n      'targeting_list' => 'list<Object>',\n      'whitelisted_types' => 'list<whitelisted_types_enum>',\n    );\n    $enums = array(\n      'app_store_enum' => AdAccountTargetingUnifiedAppStoreValues::getInstance()->getValues(),\n      'limit_type_enum' => AdAccountTargetingUnifiedLimitTypeValues::getInstance()->getValues(),\n      'objective_enum' => AdAccountTargetingUnifiedObjectiveValues::getInstance()->getValues(),\n      'regulated_categories_enum' => AdAccountTargetingUnifiedRegulatedCategoriesValues::getInstance()->getValues(),\n      'regulated_countries_enum' => AdAccountTargetingUnifiedRegulatedCountriesValues::getInstance()->getValues(),\n      'whitelisted_types_enum' => AdAccountTargetingUnifiedWhitelistedTypesValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/targetingsearch',\n      new AdAccountTargetingUnified(),\n      'EDGE',\n      AdAccountTargetingUnified::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTargetingSentenceLines(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'discard_ages' => 'bool',\n      'discard_placements' => 'bool',\n      'hide_targeting_spec_from_return' => 'bool',\n      'targeting_spec' => 'Targeting',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/targetingsentencelines',\n      new TargetingSentenceLine(),\n      'EDGE',\n      TargetingSentenceLine::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTargetingSuggestions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'app_store' => 'app_store_enum',\n      'countries' => 'list<string>',\n      'limit_type' => 'limit_type_enum',\n      'mode' => 'mode_enum',\n      'objective' => 'objective_enum',\n      'objects' => 'Object',\n      'regulated_categories' => 'list<regulated_categories_enum>',\n      'regulated_countries' => 'list<regulated_countries_enum>',\n      'session_id' => 'unsigned int',\n      'targeting_list' => 'list<Object>',\n      'whitelisted_types' => 'list<whitelisted_types_enum>',\n    );\n    $enums = array(\n      'app_store_enum' => AdAccountTargetingUnifiedAppStoreValues::getInstance()->getValues(),\n      'limit_type_enum' => AdAccountTargetingUnifiedLimitTypeValues::getInstance()->getValues(),\n      'mode_enum' => AdAccountTargetingUnifiedModeValues::getInstance()->getValues(),\n      'objective_enum' => AdAccountTargetingUnifiedObjectiveValues::getInstance()->getValues(),\n      'regulated_categories_enum' => AdAccountTargetingUnifiedRegulatedCategoriesValues::getInstance()->getValues(),\n      'regulated_countries_enum' => AdAccountTargetingUnifiedRegulatedCountriesValues::getInstance()->getValues(),\n      'whitelisted_types_enum' => AdAccountTargetingUnifiedWhitelistedTypesValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/targetingsuggestions',\n      new AdAccountTargetingUnified(),\n      'EDGE',\n      AdAccountTargetingUnified::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTargetingValidation(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'id_list' => 'list<unsigned int>',\n      'is_exclusion' => 'bool',\n      'name_list' => 'list<string>',\n      'targeting_list' => 'list<Object>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/targetingvalidation',\n      new AdAccountTargetingUnified(),\n      'EDGE',\n      AdAccountTargetingUnified::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTracking(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/tracking',\n      new AdAccountTrackingData(),\n      'EDGE',\n      AdAccountTrackingData::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createTracking(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'tracking_specs' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/tracking',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/users',\n      new AdAccountUser(),\n      'EDGE',\n      AdAccountUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteUsersOfAnyAudience(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'namespace' => 'string',\n      'payload' => 'Object',\n      'session' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/usersofanyaudience',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdAccount(),\n      'NODE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'agency_client_declaration' => 'map',\n      'attribution_spec' => 'list<Object>',\n      'business_info' => 'map',\n      'currency' => 'currency_enum',\n      'custom_audience_info' => 'map',\n      'end_advertiser' => 'string',\n      'existing_customers' => 'list<string>',\n      'is_notifications_enabled' => 'bool',\n      'media_agency' => 'string',\n      'name' => 'string',\n      'partner' => 'string',\n      'spend_cap' => 'float',\n      'spend_cap_action' => 'string',\n      'timezone_id' => 'unsigned int',\n      'tos_accepted' => 'map',\n    );\n    $enums = array(\n      'currency_enum' => AdAccountCurrencyValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new AdAccount(),\n      'NODE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 3176}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountAdRulesHistoryFields;\nuse FacebookAds\\Object\\Values\\AdAccountAdRulesHistoryActionValues;\nuse FacebookAds\\Object\\Values\\AdAccountAdRulesHistoryEvaluationTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountAdRulesHistory extends AbstractObject {\n\n  /**\n   * @return AdAccountAdRulesHistoryFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountAdRulesHistoryFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Action'] = AdAccountAdRulesHistoryActionValues::getInstance()->getValues();\n    $ref_enums['EvaluationType'] = AdAccountAdRulesHistoryEvaluationTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountAdVolumeFields;\nuse FacebookAds\\Object\\Values\\AdAccountAdVolumeRecommendationTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountAdVolume extends AbstractObject {\n\n  /**\n   * @return AdAccountAdVolumeFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountAdVolumeFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['RecommendationType'] = AdAccountAdVolumeRecommendationTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountBusinessConstraintsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountBusinessConstraints extends AbstractObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'account_controls';\n  }\n\n  /**\n   * @return AdAccountBusinessConstraintsFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountBusinessConstraintsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 65}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountDefaultDestinationFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountDefaultDestination extends AbstractObject {\n\n  /**\n   * @return AdAccountDefaultDestinationFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountDefaultDestinationFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountDefaultObjectiveFields;\nuse FacebookAds\\Object\\Values\\AdAccountDefaultObjectiveDefaultObjectiveForUserValues;\nuse FacebookAds\\Object\\Values\\AdAccountDefaultObjectiveObjectiveForLevelValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountDefaultObjective extends AbstractObject {\n\n  /**\n   * @return AdAccountDefaultObjectiveFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountDefaultObjectiveFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['DefaultObjectiveForUser'] = AdAccountDefaultObjectiveDefaultObjectiveForUserValues::getInstance()->getValues();\n    $ref_enums['ObjectiveForLevel'] = AdAccountDefaultObjectiveObjectiveForLevelValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountDeliveryEstimateFields;\nuse FacebookAds\\Object\\Values\\AdAccountDeliveryEstimateOptimizationGoalValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountDeliveryEstimate extends AbstractObject {\n\n  /**\n   * @return AdAccountDeliveryEstimateFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountDeliveryEstimateFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['OptimizationGoal'] = AdAccountDeliveryEstimateOptimizationGoalValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountIosFourteenCampaignLimitsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountIosFourteenCampaignLimits extends AbstractObject {\n\n  /**\n   * @return AdAccountIosFourteenCampaignLimitsFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountIosFourteenCampaignLimitsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountMatchedSearchApplicationsEdgeDataFields;\nuse FacebookAds\\Object\\Values\\AdAccountMatchedSearchApplicationsEdgeDataAppStoreValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountMatchedSearchApplicationsEdgeData extends AbstractObject {\n\n  /**\n   * @return AdAccountMatchedSearchApplicationsEdgeDataFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountMatchedSearchApplicationsEdgeDataFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['AppStore'] = AdAccountMatchedSearchApplicationsEdgeDataAppStoreValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountMaxBidFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountMaxBid extends AbstractObject {\n\n  /**\n   * @return AdAccountMaxBidFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountMaxBidFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountPromotableObjectsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountPromotableObjects extends AbstractObject {\n\n  /**\n   * @return AdAccountPromotableObjectsFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountPromotableObjectsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountReachEstimateFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountReachEstimate extends AbstractObject {\n\n  /**\n   * @return AdAccountReachEstimateFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountReachEstimateFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountRecommendedCamapaignBudgetFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountRecommendedCamapaignBudget extends AbstractObject {\n\n  /**\n   * @return AdAccountRecommendedCamapaignBudgetFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountRecommendedCamapaignBudgetFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountSubscribedAppsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountSubscribedApps extends AbstractObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'subscribed_apps';\n  }\n\n  /**\n   * @return AdAccountSubscribedAppsFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountSubscribedAppsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 65}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountTargetingUnifiedFields;\nuse FacebookAds\\Object\\Values\\AdAccountTargetingUnifiedAppStoreValues;\nuse FacebookAds\\Object\\Values\\AdAccountTargetingUnifiedLimitTypeValues;\nuse FacebookAds\\Object\\Values\\AdAccountTargetingUnifiedModeValues;\nuse FacebookAds\\Object\\Values\\AdAccountTargetingUnifiedObjectiveValues;\nuse FacebookAds\\Object\\Values\\AdAccountTargetingUnifiedRegulatedCategoriesValues;\nuse FacebookAds\\Object\\Values\\AdAccountTargetingUnifiedRegulatedCountriesValues;\nuse FacebookAds\\Object\\Values\\AdAccountTargetingUnifiedWhitelistedTypesValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountTargetingUnified extends AbstractCrudObject {\n\n  /**\n   * @return AdAccountTargetingUnifiedFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountTargetingUnifiedFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['LimitType'] = AdAccountTargetingUnifiedLimitTypeValues::getInstance()->getValues();\n    $ref_enums['RegulatedCategories'] = AdAccountTargetingUnifiedRegulatedCategoriesValues::getInstance()->getValues();\n    $ref_enums['RegulatedCountries'] = AdAccountTargetingUnifiedRegulatedCountriesValues::getInstance()->getValues();\n    $ref_enums['WhitelistedTypes'] = AdAccountTargetingUnifiedWhitelistedTypesValues::getInstance()->getValues();\n    $ref_enums['AppStore'] = AdAccountTargetingUnifiedAppStoreValues::getInstance()->getValues();\n    $ref_enums['Objective'] = AdAccountTargetingUnifiedObjectiveValues::getInstance()->getValues();\n    $ref_enums['Mode'] = AdAccountTargetingUnifiedModeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 72}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountTrackingDataFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountTrackingData extends AbstractObject {\n\n  /**\n   * @return AdAccountTrackingDataFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountTrackingDataFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAccountUserFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountUser extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'users';\n  }\n\n  /**\n   * @return AdAccountUserFields\n   */\n  public static function getFieldsEnum() {\n    return AdAccountUserFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getAdAccounts(\n    array $fields = array(), array $params = array()) {\n    return $this->getManyByConnection(AdAccount::className(), $fields, $params);\n  }\n\n  public function getAdAccountGroups(\n    array $fields = array(), array $params = array()) {\n    return $this->getManyByConnection(\n      AdAccountGroup::className(),\n      $fields,\n      $params);\n  }\n}\n", "num_lines": 77}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdActivityFields;\nuse FacebookAds\\Object\\Values\\AdActivityCategoryValues;\nuse FacebookAds\\Object\\Values\\AdActivityDataSourceValues;\nuse FacebookAds\\Object\\Values\\AdActivityEventTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdActivity extends AbstractObject {\n\n  /**\n   * @return AdActivityFields\n   */\n  public static function getFieldsEnum() {\n    return AdActivityFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['EventType'] = AdActivityEventTypeValues::getInstance()->getValues();\n    $ref_enums['Category'] = AdActivityCategoryValues::getInstance()->getValues();\n    $ref_enums['DataSource'] = AdActivityDataSourceValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAssetFeedSpecFields;\nuse FacebookAds\\Object\\Values\\AdAssetFeedSpecCallToActionTypesValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpec extends AbstractObject {\n\n  /**\n   * @return AdAssetFeedSpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdAssetFeedSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['CallToActionTypes'] = AdAssetFeedSpecCallToActionTypesValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAssetFeedSpecAssetLabelFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecAssetLabel extends AbstractCrudObject {\n\n  /**\n   * @return AdAssetFeedSpecAssetLabelFields\n   */\n  public static function getFieldsEnum() {\n    return AdAssetFeedSpecAssetLabelFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAssetFeedSpecBodyFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecBody extends AbstractObject {\n\n  /**\n   * @return AdAssetFeedSpecBodyFields\n   */\n  public static function getFieldsEnum() {\n    return AdAssetFeedSpecBodyFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAssetFeedSpecCaptionFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecCaption extends AbstractObject {\n\n  /**\n   * @return AdAssetFeedSpecCaptionFields\n   */\n  public static function getFieldsEnum() {\n    return AdAssetFeedSpecCaptionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAssetFeedSpecDescriptionFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecDescription extends AbstractObject {\n\n  /**\n   * @return AdAssetFeedSpecDescriptionFields\n   */\n  public static function getFieldsEnum() {\n    return AdAssetFeedSpecDescriptionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAssetFeedSpecGroupRuleFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecGroupRule extends AbstractObject {\n\n  /**\n   * @return AdAssetFeedSpecGroupRuleFields\n   */\n  public static function getFieldsEnum() {\n    return AdAssetFeedSpecGroupRuleFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAssetFeedSpecImageFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecImage extends AbstractObject {\n\n  /**\n   * @return AdAssetFeedSpecImageFields\n   */\n  public static function getFieldsEnum() {\n    return AdAssetFeedSpecImageFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAssetFeedSpecLinkURLFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecLinkURL extends AbstractObject {\n\n  /**\n   * @return AdAssetFeedSpecLinkURLFields\n   */\n  public static function getFieldsEnum() {\n    return AdAssetFeedSpecLinkURLFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAssetFeedSpecTitleFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecTitle extends AbstractObject {\n\n  /**\n   * @return AdAssetFeedSpecTitleFields\n   */\n  public static function getFieldsEnum() {\n    return AdAssetFeedSpecTitleFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAssetFeedSpecVideoFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecVideo extends AbstractObject {\n\n  /**\n   * @return AdAssetFeedSpecVideoFields\n   */\n  public static function getFieldsEnum() {\n    return AdAssetFeedSpecVideoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAsyncRequestFields;\nuse FacebookAds\\Object\\Values\\AdAsyncRequestStatusesValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAsyncRequest extends AbstractCrudObject {\n\n  /**\n   * @return AdAsyncRequestFields\n   */\n  public static function getFieldsEnum() {\n    return AdAsyncRequestFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Statuses'] = AdAsyncRequestStatusesValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdAsyncRequest(),\n      'NODE',\n      AdAsyncRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 106}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAsyncRequestSetFields;\nuse FacebookAds\\Object\\Values\\AdAsyncRequestSetNotificationModeValues;\nuse FacebookAds\\Object\\Values\\AdAsyncRequestStatusesValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAsyncRequestSet extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'asyncadrequestsets';\n  }\n\n  /**\n   * @return AdAsyncRequestSetFields\n   */\n  public static function getFieldsEnum() {\n    return AdAsyncRequestSetFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['NotificationMode'] = AdAsyncRequestSetNotificationModeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getRequests(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'statuses' => 'list<statuses_enum>',\n    );\n    $enums = array(\n      'statuses_enum' => AdAsyncRequestStatusesValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/requests',\n      new AdAsyncRequest(),\n      'EDGE',\n      AdAsyncRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdAsyncRequestSet(),\n      'NODE',\n      AdAsyncRequestSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'name' => 'string',\n      'notification_mode' => 'notification_mode_enum',\n      'notification_uri' => 'string',\n    );\n    $enums = array(\n      'notification_mode_enum' => AdAsyncRequestSetNotificationModeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new AdAsyncRequestSet(),\n      'NODE',\n      AdAsyncRequestSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 166}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdAsyncRequestSetNotificationResultFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAsyncRequestSetNotificationResult extends AbstractObject {\n\n  /**\n   * @return AdAsyncRequestSetNotificationResultFields\n   */\n  public static function getFieldsEnum() {\n    return AdAsyncRequestSetNotificationResultFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdBidAdjustmentsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdBidAdjustments extends AbstractObject {\n\n  /**\n   * @return AdBidAdjustmentsFields\n   */\n  public static function getFieldsEnum() {\n    return AdBidAdjustmentsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCampaignBidConstraintFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCampaignBidConstraint extends AbstractObject {\n\n  /**\n   * @return AdCampaignBidConstraintFields\n   */\n  public static function getFieldsEnum() {\n    return AdCampaignBidConstraintFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCampaignDeliveryEstimateFields;\nuse FacebookAds\\Object\\Values\\AdCampaignDeliveryEstimateOptimizationGoalValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCampaignDeliveryEstimate extends AbstractObject {\n\n  /**\n   * @return AdCampaignDeliveryEstimateFields\n   */\n  public static function getFieldsEnum() {\n    return AdCampaignDeliveryEstimateFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['OptimizationGoal'] = AdCampaignDeliveryEstimateOptimizationGoalValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCampaignDeliveryStatsUnsupportedReasonsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCampaignDeliveryStatsUnsupportedReasons extends AbstractObject {\n\n  /**\n   * @return AdCampaignDeliveryStatsUnsupportedReasonsFields\n   */\n  public static function getFieldsEnum() {\n    return AdCampaignDeliveryStatsUnsupportedReasonsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCampaignFrequencyControlSpecsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCampaignFrequencyControlSpecs extends AbstractObject {\n\n  /**\n   * @return AdCampaignFrequencyControlSpecsFields\n   */\n  public static function getFieldsEnum() {\n    return AdCampaignFrequencyControlSpecsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCampaignIssuesInfoFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCampaignIssuesInfo extends AbstractObject {\n\n  /**\n   * @return AdCampaignIssuesInfoFields\n   */\n  public static function getFieldsEnum() {\n    return AdCampaignIssuesInfoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCampaignLearningStageInfoFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCampaignLearningStageInfo extends AbstractObject {\n\n  /**\n   * @return AdCampaignLearningStageInfoFields\n   */\n  public static function getFieldsEnum() {\n    return AdCampaignLearningStageInfoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCampaignOptimizationEventFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCampaignOptimizationEvent extends AbstractObject {\n\n  /**\n   * @return AdCampaignOptimizationEventFields\n   */\n  public static function getFieldsEnum() {\n    return AdCampaignOptimizationEventFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCampaignPacedBidInfoFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCampaignPacedBidInfo extends AbstractObject {\n\n  /**\n   * @return AdCampaignPacedBidInfoFields\n   */\n  public static function getFieldsEnum() {\n    return AdCampaignPacedBidInfoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeFields;\nuse FacebookAds\\Object\\Values\\AdCreativeApplinkTreatmentValues;\nuse FacebookAds\\Object\\Values\\AdCreativeAuthorizationCategoryValues;\nuse FacebookAds\\Object\\Values\\AdCreativeCallToActionTypeValues;\nuse FacebookAds\\Object\\Values\\AdCreativeCategorizationCriteriaValues;\nuse FacebookAds\\Object\\Values\\AdCreativeCategoryMediaSourceValues;\nuse FacebookAds\\Object\\Values\\AdCreativeDynamicAdVoiceValues;\nuse FacebookAds\\Object\\Values\\AdCreativeObjectTypeValues;\nuse FacebookAds\\Object\\Values\\AdCreativeOperatorValues;\nuse FacebookAds\\Object\\Values\\AdCreativeStatusValues;\nuse FacebookAds\\Object\\Values\\AdPreviewAdFormatValues;\nuse FacebookAds\\Object\\Values\\AdPreviewCreativeFeatureValues;\nuse FacebookAds\\Object\\Values\\AdPreviewRenderTypeValues;\nuse FacebookAds\\Object\\Traits\\AdLabelAwareCrudObjectTrait;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreative extends AbstractCrudObject {\n\n  use AdLabelAwareCrudObjectTrait;\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'adcreatives';\n  }\n\n  /**\n   * @return AdCreativeFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['CallToActionType'] = AdCreativeCallToActionTypeValues::getInstance()->getValues();\n    $ref_enums['ObjectType'] = AdCreativeObjectTypeValues::getInstance()->getValues();\n    $ref_enums['Status'] = AdCreativeStatusValues::getInstance()->getValues();\n    $ref_enums['ApplinkTreatment'] = AdCreativeApplinkTreatmentValues::getInstance()->getValues();\n    $ref_enums['AuthorizationCategory'] = AdCreativeAuthorizationCategoryValues::getInstance()->getValues();\n    $ref_enums['CategorizationCriteria'] = AdCreativeCategorizationCriteriaValues::getInstance()->getValues();\n    $ref_enums['CategoryMediaSource'] = AdCreativeCategoryMediaSourceValues::getInstance()->getValues();\n    $ref_enums['DynamicAdVoice'] = AdCreativeDynamicAdVoiceValues::getInstance()->getValues();\n    $ref_enums['Operator'] = AdCreativeOperatorValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n  protected function setDataTrigger($data) {\n    if (array_key_exists('id', $data)) {\n      $this->data['creative_id'] = $data['id'];\n    }\n  }\n\n  public function createAdLabel(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adlabels' => 'list<Object>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adlabels',\n      new AdCreative(),\n      'EDGE',\n      AdCreative::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCreativeInsights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/creative_insights',\n      new AdCreativeInsights(),\n      'EDGE',\n      AdCreativeInsights::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPreViews(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_format' => 'ad_format_enum',\n      'creative_feature' => 'creative_feature_enum',\n      'dynamic_asset_label' => 'string',\n      'dynamic_creative_spec' => 'Object',\n      'dynamic_customization' => 'Object',\n      'end_date' => 'datetime',\n      'height' => 'unsigned int',\n      'locale' => 'string',\n      'place_page_id' => 'int',\n      'post' => 'Object',\n      'product_item_ids' => 'list<string>',\n      'render_type' => 'render_type_enum',\n      'start_date' => 'datetime',\n      'width' => 'unsigned int',\n    );\n    $enums = array(\n      'ad_format_enum' => AdPreviewAdFormatValues::getInstance()->getValues(),\n      'creative_feature_enum' => AdPreviewCreativeFeatureValues::getInstance()->getValues(),\n      'render_type_enum' => AdPreviewRenderTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/previews',\n      new AdPreview(),\n      'EDGE',\n      AdPreview::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'account_id' => 'string',\n      'adlabels' => 'list<Object>',\n      'name' => 'string',\n      'status' => 'status_enum',\n    );\n    $enums = array(\n      'status_enum' => AdCreativeStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'thumbnail_height' => 'unsigned int',\n      'thumbnail_width' => 'unsigned int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdCreative(),\n      'NODE',\n      AdCreative::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'account_id' => 'string',\n      'adlabels' => 'list<Object>',\n      'name' => 'string',\n      'status' => 'status_enum',\n    );\n    $enums = array(\n      'status_enum' => AdCreativeStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new AdCreative(),\n      'NODE',\n      AdCreative::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 262}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeAdDisclaimerFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeAdDisclaimer extends AbstractObject {\n\n  /**\n   * @return AdCreativeAdDisclaimerFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeAdDisclaimerFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeBrandedContentAdsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeBrandedContentAds extends AbstractObject {\n\n  /**\n   * @return AdCreativeBrandedContentAdsFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeBrandedContentAdsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeCollectionThumbnailInfoFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeCollectionThumbnailInfo extends AbstractObject {\n\n  /**\n   * @return AdCreativeCollectionThumbnailInfoFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeCollectionThumbnailInfoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeDegreesOfFreedomSpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeDegreesOfFreedomSpec extends AbstractObject {\n\n  /**\n   * @return AdCreativeDegreesOfFreedomSpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeDegreesOfFreedomSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeFacebookBrandedContentFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeFacebookBrandedContent extends AbstractObject {\n\n  /**\n   * @return AdCreativeFacebookBrandedContentFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeFacebookBrandedContentFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeInsightsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeInsights extends AbstractObject {\n\n  /**\n   * @return AdCreativeInsightsFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeInsightsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeInstagramBrandedContentFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeInstagramBrandedContent extends AbstractObject {\n\n  /**\n   * @return AdCreativeInstagramBrandedContentFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeInstagramBrandedContentFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeInteractiveComponentsSpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeInteractiveComponentsSpec extends AbstractObject {\n\n  /**\n   * @return AdCreativeInteractiveComponentsSpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeInteractiveComponentsSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeLinkDataFields;\nuse FacebookAds\\Object\\Values\\AdCreativeLinkDataAttachmentStyleValues;\nuse FacebookAds\\Object\\Values\\AdCreativeLinkDataFormatOptionValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkData extends AbstractObject {\n\n  /**\n   * @return AdCreativeLinkDataFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeLinkDataFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['AttachmentStyle'] = AdCreativeLinkDataAttachmentStyleValues::getInstance()->getValues();\n    $ref_enums['FormatOption'] = AdCreativeLinkDataFormatOptionValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeLinkDataAppLinkSpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataAppLinkSpec extends AbstractObject {\n\n  /**\n   * @return AdCreativeLinkDataAppLinkSpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeLinkDataAppLinkSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeLinkDataCallToActionFields;\nuse FacebookAds\\Object\\Values\\AdCreativeLinkDataCallToActionTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataCallToAction extends AbstractObject {\n\n  /**\n   * @return AdCreativeLinkDataCallToActionFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeLinkDataCallToActionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Type'] = AdCreativeLinkDataCallToActionTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeLinkDataCallToActionValueFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataCallToActionValue extends AbstractObject {\n\n  /**\n   * @return AdCreativeLinkDataCallToActionValueFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeLinkDataCallToActionValueFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeLinkDataChildAttachmentFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataChildAttachment extends AbstractObject {\n\n  /**\n   * @return AdCreativeLinkDataChildAttachmentFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeLinkDataChildAttachmentFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeLinkDataImageLayerSpecFields;\nuse FacebookAds\\Object\\Values\\AdCreativeLinkDataImageLayerSpecBlendingModeValues;\nuse FacebookAds\\Object\\Values\\AdCreativeLinkDataImageLayerSpecFrameSourceValues;\nuse FacebookAds\\Object\\Values\\AdCreativeLinkDataImageLayerSpecImageSourceValues;\nuse FacebookAds\\Object\\Values\\AdCreativeLinkDataImageLayerSpecLayerTypeValues;\nuse FacebookAds\\Object\\Values\\AdCreativeLinkDataImageLayerSpecOverlayPositionValues;\nuse FacebookAds\\Object\\Values\\AdCreativeLinkDataImageLayerSpecOverlayShapeValues;\nuse FacebookAds\\Object\\Values\\AdCreativeLinkDataImageLayerSpecTextFontValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataImageLayerSpec extends AbstractObject {\n\n  /**\n   * @return AdCreativeLinkDataImageLayerSpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeLinkDataImageLayerSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['BlendingMode'] = AdCreativeLinkDataImageLayerSpecBlendingModeValues::getInstance()->getValues();\n    $ref_enums['FrameSource'] = AdCreativeLinkDataImageLayerSpecFrameSourceValues::getInstance()->getValues();\n    $ref_enums['ImageSource'] = AdCreativeLinkDataImageLayerSpecImageSourceValues::getInstance()->getValues();\n    $ref_enums['LayerType'] = AdCreativeLinkDataImageLayerSpecLayerTypeValues::getInstance()->getValues();\n    $ref_enums['OverlayPosition'] = AdCreativeLinkDataImageLayerSpecOverlayPositionValues::getInstance()->getValues();\n    $ref_enums['OverlayShape'] = AdCreativeLinkDataImageLayerSpecOverlayShapeValues::getInstance()->getValues();\n    $ref_enums['TextFont'] = AdCreativeLinkDataImageLayerSpecTextFontValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 72}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeLinkDataImageOverlaySpecFields;\nuse FacebookAds\\Object\\Values\\AdCreativeLinkDataImageOverlaySpecCustomTextTypeValues;\nuse FacebookAds\\Object\\Values\\AdCreativeLinkDataImageOverlaySpecOverlayTemplateValues;\nuse FacebookAds\\Object\\Values\\AdCreativeLinkDataImageOverlaySpecPositionValues;\nuse FacebookAds\\Object\\Values\\AdCreativeLinkDataImageOverlaySpecTextFontValues;\nuse FacebookAds\\Object\\Values\\AdCreativeLinkDataImageOverlaySpecTextTypeValues;\nuse FacebookAds\\Object\\Values\\AdCreativeLinkDataImageOverlaySpecThemeColorValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataImageOverlaySpec extends AbstractObject {\n\n  /**\n   * @return AdCreativeLinkDataImageOverlaySpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeLinkDataImageOverlaySpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['CustomTextType'] = AdCreativeLinkDataImageOverlaySpecCustomTextTypeValues::getInstance()->getValues();\n    $ref_enums['OverlayTemplate'] = AdCreativeLinkDataImageOverlaySpecOverlayTemplateValues::getInstance()->getValues();\n    $ref_enums['Position'] = AdCreativeLinkDataImageOverlaySpecPositionValues::getInstance()->getValues();\n    $ref_enums['TextFont'] = AdCreativeLinkDataImageOverlaySpecTextFontValues::getInstance()->getValues();\n    $ref_enums['TextType'] = AdCreativeLinkDataImageOverlaySpecTextTypeValues::getInstance()->getValues();\n    $ref_enums['ThemeColor'] = AdCreativeLinkDataImageOverlaySpecThemeColorValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 70}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeLinkDataSponsorshipInfoSpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataSponsorshipInfoSpec extends AbstractObject {\n\n  /**\n   * @return AdCreativeLinkDataSponsorshipInfoSpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeLinkDataSponsorshipInfoSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeLinkDataTemplateVideoSpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataTemplateVideoSpec extends AbstractObject {\n\n  /**\n   * @return AdCreativeLinkDataTemplateVideoSpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeLinkDataTemplateVideoSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeObjectStorySpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeObjectStorySpec extends AbstractObject {\n\n  /**\n   * @return AdCreativeObjectStorySpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeObjectStorySpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeOmnichannelLinkSpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeOmnichannelLinkSpec extends AbstractObject {\n\n  /**\n   * @return AdCreativeOmnichannelLinkSpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeOmnichannelLinkSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativePhotoDataFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativePhotoData extends AbstractObject {\n\n  /**\n   * @return AdCreativePhotoDataFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativePhotoDataFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativePhotoDataMediaElementsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativePhotoDataMediaElements extends AbstractObject {\n\n  /**\n   * @return AdCreativePhotoDataMediaElementsFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativePhotoDataMediaElementsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativePlaceDataFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativePlaceData extends AbstractObject {\n\n  /**\n   * @return AdCreativePlaceDataFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativePlaceDataFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativePlatformCustomizationFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativePlatformCustomization extends AbstractObject {\n\n  /**\n   * @return AdCreativePlatformCustomizationFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativePlatformCustomizationFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativePortraitCustomizationsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativePortraitCustomizations extends AbstractObject {\n\n  /**\n   * @return AdCreativePortraitCustomizationsFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativePortraitCustomizationsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativePostClickConfigurationFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativePostClickConfiguration extends AbstractObject {\n\n  /**\n   * @return AdCreativePostClickConfigurationFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativePostClickConfigurationFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeRecommenderSettingsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeRecommenderSettings extends AbstractObject {\n\n  /**\n   * @return AdCreativeRecommenderSettingsFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeRecommenderSettingsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeStaticFallbackSpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeStaticFallbackSpec extends AbstractObject {\n\n  /**\n   * @return AdCreativeStaticFallbackSpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeStaticFallbackSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeTemplateURLSpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeTemplateURLSpec extends AbstractObject {\n\n  /**\n   * @return AdCreativeTemplateURLSpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeTemplateURLSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeTextDataFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeTextData extends AbstractObject {\n\n  /**\n   * @return AdCreativeTextDataFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeTextDataFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCreativeVideoDataFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeVideoData extends AbstractObject {\n\n  /**\n   * @return AdCreativeVideoDataFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeVideoDataFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdCustomizationRuleSpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCustomizationRuleSpec extends AbstractObject {\n\n  /**\n   * @return AdCustomizationRuleSpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdCustomizationRuleSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdDynamicCreativeFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdDynamicCreative extends AbstractObject {\n\n  /**\n   * @return AdDynamicCreativeFields\n   */\n  public static function getFieldsEnum() {\n    return AdDynamicCreativeFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdEntityTargetSpendFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdEntityTargetSpend extends AbstractObject {\n\n  /**\n   * @return AdEntityTargetSpendFields\n   */\n  public static function getFieldsEnum() {\n    return AdEntityTargetSpendFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdgroupIssuesInfoFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdgroupIssuesInfo extends AbstractObject {\n\n  /**\n   * @return AdgroupIssuesInfoFields\n   */\n  public static function getFieldsEnum() {\n    return AdgroupIssuesInfoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdgroupMetadataFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdgroupMetadata extends AbstractObject {\n\n  /**\n   * @return AdgroupMetadataFields\n   */\n  public static function getFieldsEnum() {\n    return AdgroupMetadataFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdgroupPlacementSpecificReviewFeedbackFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdgroupPlacementSpecificReviewFeedback extends AbstractObject {\n\n  /**\n   * @return AdgroupPlacementSpecificReviewFeedbackFields\n   */\n  public static function getFieldsEnum() {\n    return AdgroupPlacementSpecificReviewFeedbackFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdgroupReviewFeedbackFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdgroupReviewFeedback extends AbstractObject {\n\n  /**\n   * @return AdgroupReviewFeedbackFields\n   */\n  public static function getFieldsEnum() {\n    return AdgroupReviewFeedbackFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdImageFields;\nuse FacebookAds\\Object\\Values\\AdImageStatusValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdImage extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'adimages';\n  }\n\n  /**\n   * @return AdImageFields\n   */\n  public static function getFieldsEnum() {\n    return AdImageFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Status'] = AdImageStatusValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdImage(),\n      'NODE',\n      AdImage::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  /**\n   * Uploads images from a zip file and returns a cursor of results\n   *\n   * @param string $file_path\n   * @param string $account_id\n   * @param array $params\n   * @param Api $api\n   * @return array\n   */\n  public static function createFromZip(\n    $file_path, $account_id, array $params = array(), Api $api = null) {\n\n    $image = new AdImage(null, $account_id, $api);\n    $image->{AdImageFields::FILENAME} = $file_path;\n    return $image->arrayFromZip($params);\n  }\n\n  /**\n   * @return string\n   */\n  protected function getNodePath() {\n    return '/'.$this->assureParentId().'/'.$this->getEndpoint();\n  }\n\n  /**\n   * Create function for the object.\n   *\n   * @param array $params Additional parameters to include in the request\n   * @return $this\n   * @throws \\Exception\n   * @throws \\RuntimeException\n   */\n  public function create(array $params = array()) {\n    if ($this->data[static::FIELD_ID]) {\n      throw new \\Exception(\"Object has already an ID\");\n    }\n\n    if ($this->isZipFile($this->data[AdImageFields::FILENAME])) {\n      throw new \\RuntimeException(\n        \"use AdImage::createFromZip to create zip files\");\n    }\n\n    $data = $this->exportData();\n    $filename = $data[AdImageFields::FILENAME];\n    unset($data[AdImageFields::FILENAME]);\n    $params = array_merge($data, $params);\n\n    $request = $this->getApi()->prepareRequest(\n      '/'.$this->assureParentId().'/'.$this->getEndpoint(),\n      RequestInterface::METHOD_POST,\n      $params\n    );\n\n    $request->getFileParams()->offsetSet(AdImageFields::FILENAME, $filename);\n    $response = $this->getApi()->executeRequest($request);\n\n    $this->clearHistory();\n    $content = $response->getContent();\n    $data = $content['images'][basename($this->{AdImageFields::FILENAME})];\n\n    $this->data[AdImageFields::HASH] = $data[AdImageFields::HASH];\n\n    $this->data[static::FIELD_ID]\n      = substr($this->getParentId(), 4).':'.$this->data[AdImageFields::HASH];\n\n    return $this;\n  }\n\n  /**\n   * Uploads images from a zip file and returns a cursor of results\n   *\n   * @param array $params\n   * @return array\n   * @throws \\RuntimeException\n   */\n  protected function arrayFromZip($params = array()) {\n    if (!$this->isZipFile($this->data[AdImageFields::FILENAME])) {\n      throw new \\RuntimeException(\n        $this->data[AdImageFields::FILENAME].\" doesn't resolve to a zip file\");\n    }\n\n    $data = $this->exportData();\n    $filename = $data[AdImageFields::FILENAME];\n    unset($data[AdImageFields::FILENAME]);\n    $params = array_merge($data, $params);\n\n    $request = $this->getApi()->prepareRequest(\n      '/'.$this->assureParentId().'/'.$this->getEndpoint(),\n      RequestInterface::METHOD_POST,\n      $params\n    );\n\n    $request->getFileParams()->offsetSet(AdImageFields::FILENAME, $filename);\n    $response = $this->getApi()->executeRequest($request);\n\n    $result = array();\n    $content = $response->getContent();\n    foreach ($content['images'] as $image) {\n      $adimage = new AdImage(\n        substr($this->getParentId(), 4).':'.$image[AdImageFields::HASH],\n        $this->getParentId(),\n        $this->getApi());\n\n      $adimage->{AdImageFields::HASH} = $image[AdImageFields::HASH];\n\n      $result[] = $adimage;\n    }\n\n    return $result;\n  }\n\n  /**\n   * Checks if a given path is a zip file\n   *\n   * @param string $file_path\n   * @return bool\n   */\n  protected function isZipFile($file_path) {\n    $finfo = finfo_open(FILEINFO_MIME_TYPE);\n    $file_mime_type = finfo_file($finfo, $file_path);\n    return $file_mime_type == 'application/zip' ||\n      $file_mime_type == 'multipart/x-zip';\n  }\n\n  /**\n   * Read object data from the graph\n   *\n   * @param string[] $fields Fields to request\n   * @param array $params Additional request parameters\n   * @return $this\n   */\n  public function read(array $fields = array(), array $params = array()) {\n    $fields = implode(',', $fields ?: static::getDefaultReadFields());\n    if ($fields) {\n      $params['fields'] = $fields;\n    }\n    $params['hashes'] = array(explode(':', $this->assureId())[1]);\n\n    $response = $this->getApi()->call(\n      $this->getNodePath(),\n      RequestInterface::METHOD_GET,\n      $params);\n\n    $content = $response->getContent();\n    $data = $content['data'];\n    if ($data) {\n      $this->setDataWithoutValidation((array) $data[0]);\n    }\n\n    $this->clearHistory();\n\n    return $this;\n  }\n\n  /**\n   * Delete this object from the graph\n   *\n   * @param array $params\n   * @return void\n   * @throws \\Exception\n   */\n  public function deleteSelf(array $params = array()) {\n    if (!$this->data[AdImageFields::HASH]) {\n      throw new \\Exception(\"AdImage hash is required to delete\");\n    }\n\n    $params\n      = array_merge($params, array('hash' => $this->data[AdImageFields::HASH]));\n\n    $this->getApi()->call(\n      $this->getNodePath(),\n      RequestInterface::METHOD_DELETE,\n      $params\n    );\n  }\n}\n", "num_lines": 265}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdKeywordsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdKeywords extends AbstractObject {\n\n  /**\n   * @return AdKeywordsFields\n   */\n  public static function getFieldsEnum() {\n    return AdKeywordsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdLabelFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdLabel extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'adlabels';\n  }\n\n  /**\n   * @return AdLabelFields\n   */\n  public static function getFieldsEnum() {\n    return AdLabelFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getAdCreatives(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adcreatives',\n      new AdCreative(),\n      'EDGE',\n      AdCreative::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAds(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ads',\n      new Ad(),\n      'EDGE',\n      Ad::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdSets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adsets',\n      new AdSet(),\n      'EDGE',\n      AdSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCampaigns(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/campaigns',\n      new Campaign(),\n      'EDGE',\n      Campaign::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdLabel(),\n      'NODE',\n      AdLabel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new AdLabel(),\n      'NODE',\n      AdLabel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 227}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdMonetizationPropertyFields;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultAggregationPeriodValues;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultBreakdownsValues;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultMetricsValues;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultOrderingColumnValues;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultOrderingTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdMonetizationProperty extends AbstractCrudObject {\n\n  /**\n   * @return AdMonetizationPropertyFields\n   */\n  public static function getFieldsEnum() {\n    return AdMonetizationPropertyFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getAdNetworkAnalytics(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'aggregation_period' => 'aggregation_period_enum',\n      'breakdowns' => 'list<breakdowns_enum>',\n      'filters' => 'list<map>',\n      'limit' => 'unsigned int',\n      'metrics' => 'list<metrics_enum>',\n      'ordering_column' => 'ordering_column_enum',\n      'ordering_type' => 'ordering_type_enum',\n      'since' => 'datetime',\n      'until' => 'datetime',\n    );\n    $enums = array(\n      'aggregation_period_enum' => AdNetworkAnalyticsSyncQueryResultAggregationPeriodValues::getInstance()->getValues(),\n      'breakdowns_enum' => AdNetworkAnalyticsSyncQueryResultBreakdownsValues::getInstance()->getValues(),\n      'metrics_enum' => AdNetworkAnalyticsSyncQueryResultMetricsValues::getInstance()->getValues(),\n      'ordering_column_enum' => AdNetworkAnalyticsSyncQueryResultOrderingColumnValues::getInstance()->getValues(),\n      'ordering_type_enum' => AdNetworkAnalyticsSyncQueryResultOrderingTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adnetworkanalytics',\n      new AdNetworkAnalyticsSyncQueryResult(),\n      'EDGE',\n      AdNetworkAnalyticsSyncQueryResult::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdNetworkAnalytic(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'aggregation_period' => 'aggregation_period_enum',\n      'breakdowns' => 'list<breakdowns_enum>',\n      'filters' => 'list<Object>',\n      'limit' => 'int',\n      'metrics' => 'list<metrics_enum>',\n      'ordering_column' => 'ordering_column_enum',\n      'ordering_type' => 'ordering_type_enum',\n      'since' => 'datetime',\n      'until' => 'datetime',\n    );\n    $enums = array(\n      'aggregation_period_enum' => AdNetworkAnalyticsSyncQueryResultAggregationPeriodValues::getInstance()->getValues(),\n      'breakdowns_enum' => AdNetworkAnalyticsSyncQueryResultBreakdownsValues::getInstance()->getValues(),\n      'metrics_enum' => AdNetworkAnalyticsSyncQueryResultMetricsValues::getInstance()->getValues(),\n      'ordering_column_enum' => AdNetworkAnalyticsSyncQueryResultOrderingColumnValues::getInstance()->getValues(),\n      'ordering_type_enum' => AdNetworkAnalyticsSyncQueryResultOrderingTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adnetworkanalytics',\n      new AdMonetizationProperty(),\n      'EDGE',\n      AdMonetizationProperty::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdNetworkAnalyticsResults(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'query_ids' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adnetworkanalytics_results',\n      new AdNetworkAnalyticsAsyncQueryResult(),\n      'EDGE',\n      AdNetworkAnalyticsAsyncQueryResult::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdMonetizationProperty(),\n      'NODE',\n      AdMonetizationProperty::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 184}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdNetworkAnalyticsAsyncQueryResultFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdNetworkAnalyticsAsyncQueryResult extends AbstractObject {\n\n  /**\n   * @return AdNetworkAnalyticsAsyncQueryResultFields\n   */\n  public static function getFieldsEnum() {\n    return AdNetworkAnalyticsAsyncQueryResultFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdNetworkAnalyticsSyncQueryResultFields;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultAggregationPeriodValues;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultBreakdownsValues;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultMetricsValues;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultOrderingColumnValues;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultOrderingTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdNetworkAnalyticsSyncQueryResult extends AbstractObject {\n\n  /**\n   * @return AdNetworkAnalyticsSyncQueryResultFields\n   */\n  public static function getFieldsEnum() {\n    return AdNetworkAnalyticsSyncQueryResultFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['AggregationPeriod'] = AdNetworkAnalyticsSyncQueryResultAggregationPeriodValues::getInstance()->getValues();\n    $ref_enums['Breakdowns'] = AdNetworkAnalyticsSyncQueryResultBreakdownsValues::getInstance()->getValues();\n    $ref_enums['Metrics'] = AdNetworkAnalyticsSyncQueryResultMetricsValues::getInstance()->getValues();\n    $ref_enums['OrderingColumn'] = AdNetworkAnalyticsSyncQueryResultOrderingColumnValues::getInstance()->getValues();\n    $ref_enums['OrderingType'] = AdNetworkAnalyticsSyncQueryResultOrderingTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 68}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdPlacementFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdPlacement extends AbstractCrudObject {\n\n  /**\n   * @return AdPlacementFields\n   */\n  public static function getFieldsEnum() {\n    return AdPlacementFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdPlacement(),\n      'NODE',\n      AdPlacement::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdPlacePageSetFields;\nuse FacebookAds\\Object\\Values\\AdPlacePageSetLocationTypesValues;\nuse FacebookAds\\Object\\Values\\AdPlacePageSetTargetedAreaTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdPlacePageSet extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'ad_place_page_sets';\n  }\n\n  /**\n   * @return AdPlacePageSetFields\n   */\n  public static function getFieldsEnum() {\n    return AdPlacePageSetFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['LocationTypes'] = AdPlacePageSetLocationTypesValues::getInstance()->getValues();\n    $ref_enums['TargetedAreaType'] = AdPlacePageSetTargetedAreaTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdPlacePageSet(),\n      'NODE',\n      AdPlacePageSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 92}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdPlacePageSetMetadataFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdPlacePageSetMetadata extends AbstractObject {\n\n  /**\n   * @return AdPlacePageSetMetadataFields\n   */\n  public static function getFieldsEnum() {\n    return AdPlacePageSetMetadataFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdPreviewFields;\nuse FacebookAds\\Object\\Values\\AdPreviewAdFormatValues;\nuse FacebookAds\\Object\\Values\\AdPreviewCreativeFeatureValues;\nuse FacebookAds\\Object\\Values\\AdPreviewRenderTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdPreview extends AbstractObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'previews';\n  }\n\n  /**\n   * @return AdPreviewFields\n   */\n  public static function getFieldsEnum() {\n    return AdPreviewFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['AdFormat'] = AdPreviewAdFormatValues::getInstance()->getValues();\n    $ref_enums['CreativeFeature'] = AdPreviewCreativeFeatureValues::getInstance()->getValues();\n    $ref_enums['RenderType'] = AdPreviewRenderTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 71}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdPromotedObjectFields;\nuse FacebookAds\\Object\\Values\\AdPromotedObjectCustomEventTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdPromotedObject extends AbstractObject {\n\n  /**\n   * @return AdPromotedObjectFields\n   */\n  public static function getFieldsEnum() {\n    return AdPromotedObjectFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['CustomEventType'] = AdPromotedObjectCustomEventTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdRecommendationFields;\nuse FacebookAds\\Object\\Values\\AdRecommendationConfidenceValues;\nuse FacebookAds\\Object\\Values\\AdRecommendationImportanceValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRecommendation extends AbstractObject {\n\n  /**\n   * @return AdRecommendationFields\n   */\n  public static function getFieldsEnum() {\n    return AdRecommendationFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Confidence'] = AdRecommendationConfidenceValues::getInstance()->getValues();\n    $ref_enums['Importance'] = AdRecommendationImportanceValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdRecommendationDataFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRecommendationData extends AbstractObject {\n\n  /**\n   * @return AdRecommendationDataFields\n   */\n  public static function getFieldsEnum() {\n    return AdRecommendationDataFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdReportRunFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdReportRun extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'insights';\n  }\n\n  /**\n   * @return AdReportRunFields\n   */\n  public static function getFieldsEnum() {\n    return AdReportRunFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getInsights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/insights',\n      new AdsInsights(),\n      'EDGE',\n      AdsInsights::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdReportRun(),\n      'NODE',\n      AdReportRun::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function setDataTrigger(array $data) {\n    if (array_key_exists('report_run_id', $data)) {\n      $this->data['id'] = $data['report_run_id'];\n    }\n  }\n\n  public function isComplete() {\n    return $this->{AdReportRunFields::ASYNC_PERCENT_COMPLETION} === 100 &&\n      $this->{AdReportRunFields::ASYNC_STATUS} ===  'Job Completed';\n  }\n}\n", "num_lines": 121}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdRuleFields;\nuse FacebookAds\\Object\\Values\\AdRuleHistoryActionValues;\nuse FacebookAds\\Object\\Values\\AdRuleStatusValues;\nuse FacebookAds\\Object\\Values\\AdRuleUiCreationSourceValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRule extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'adrules_library';\n  }\n\n  /**\n   * @return AdRuleFields\n   */\n  public static function getFieldsEnum() {\n    return AdRuleFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Status'] = AdRuleStatusValues::getInstance()->getValues();\n    $ref_enums['UiCreationSource'] = AdRuleUiCreationSourceValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function createExecute(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/execute',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getHistory(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action' => 'action_enum',\n      'hide_no_changes' => 'bool',\n      'object_id' => 'string',\n    );\n    $enums = array(\n      'action_enum' => AdRuleHistoryActionValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/history',\n      new AdRuleHistory(),\n      'EDGE',\n      AdRuleHistory::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPreview(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/preview',\n      new AdRule(),\n      'EDGE',\n      AdRule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdRule(),\n      'NODE',\n      AdRule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'evaluation_spec' => 'Object',\n      'execution_spec' => 'Object',\n      'name' => 'string',\n      'schedule_spec' => 'Object',\n      'status' => 'status_enum',\n    );\n    $enums = array(\n      'status_enum' => AdRuleStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new AdRule(),\n      'NODE',\n      AdRule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 218}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdRuleEvaluationSpecFields;\nuse FacebookAds\\Object\\Values\\AdRuleEvaluationSpecEvaluationTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleEvaluationSpec extends AbstractCrudObject {\n\n  /**\n   * @return AdRuleEvaluationSpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdRuleEvaluationSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['EvaluationType'] = AdRuleEvaluationSpecEvaluationTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdRuleEvaluationSpec(),\n      'NODE',\n      AdRuleEvaluationSpec::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 83}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdRuleExecutionOptionsFields;\nuse FacebookAds\\Object\\Values\\AdRuleExecutionOptionsOperatorValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleExecutionOptions extends AbstractObject {\n\n  /**\n   * @return AdRuleExecutionOptionsFields\n   */\n  public static function getFieldsEnum() {\n    return AdRuleExecutionOptionsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Operator'] = AdRuleExecutionOptionsOperatorValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdRuleExecutionSpecFields;\nuse FacebookAds\\Object\\Values\\AdRuleExecutionSpecExecutionTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleExecutionSpec extends AbstractCrudObject {\n\n  /**\n   * @return AdRuleExecutionSpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdRuleExecutionSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ExecutionType'] = AdRuleExecutionSpecExecutionTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdRuleExecutionSpec(),\n      'NODE',\n      AdRuleExecutionSpec::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 83}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdRuleFiltersFields;\nuse FacebookAds\\Object\\Values\\AdRuleFiltersOperatorValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleFilters extends AbstractObject {\n\n  /**\n   * @return AdRuleFiltersFields\n   */\n  public static function getFieldsEnum() {\n    return AdRuleFiltersFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Operator'] = AdRuleFiltersOperatorValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdRuleHistoryFields;\nuse FacebookAds\\Object\\Values\\AdRuleHistoryActionValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleHistory extends AbstractObject {\n\n  /**\n   * @return AdRuleHistoryFields\n   */\n  public static function getFieldsEnum() {\n    return AdRuleHistoryFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Action'] = AdRuleHistoryActionValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdRuleHistoryResultFields;\nuse FacebookAds\\Object\\Values\\AdRuleHistoryResultObjectTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleHistoryResult extends AbstractObject {\n\n  /**\n   * @return AdRuleHistoryResultFields\n   */\n  public static function getFieldsEnum() {\n    return AdRuleHistoryResultFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ObjectType'] = AdRuleHistoryResultObjectTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdRuleHistoryResultActionFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleHistoryResultAction extends AbstractObject {\n\n  /**\n   * @return AdRuleHistoryResultActionFields\n   */\n  public static function getFieldsEnum() {\n    return AdRuleHistoryResultActionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdRuleScheduleFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleSchedule extends AbstractObject {\n\n  /**\n   * @return AdRuleScheduleFields\n   */\n  public static function getFieldsEnum() {\n    return AdRuleScheduleFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdRuleScheduleSpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleScheduleSpec extends AbstractObject {\n\n  /**\n   * @return AdRuleScheduleSpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdRuleScheduleSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdRuleTriggerFields;\nuse FacebookAds\\Object\\Values\\AdRuleTriggerOperatorValues;\nuse FacebookAds\\Object\\Values\\AdRuleTriggerTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleTrigger extends AbstractObject {\n\n  /**\n   * @return AdRuleTriggerFields\n   */\n  public static function getFieldsEnum() {\n    return AdRuleTriggerFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Operator'] = AdRuleTriggerOperatorValues::getInstance()->getValues();\n    $ref_enums['Type'] = AdRuleTriggerTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdsActionStatsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdsActionStats extends AbstractObject {\n\n  /**\n   * @return AdsActionStatsFields\n   */\n  public static function getFieldsEnum() {\n    return AdsActionStatsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdSetFields;\nuse FacebookAds\\Object\\Values\\AdActivityCategoryValues;\nuse FacebookAds\\Object\\Values\\AdAsyncRequestStatusesValues;\nuse FacebookAds\\Object\\Values\\AdCampaignDeliveryEstimateOptimizationGoalValues;\nuse FacebookAds\\Object\\Values\\AdDatePresetValues;\nuse FacebookAds\\Object\\Values\\AdSetBidStrategyValues;\nuse FacebookAds\\Object\\Values\\AdSetBillingEventValues;\nuse FacebookAds\\Object\\Values\\AdSetConfiguredStatusValues;\nuse FacebookAds\\Object\\Values\\AdSetDatePresetValues;\nuse FacebookAds\\Object\\Values\\AdSetDestinationTypeValues;\nuse FacebookAds\\Object\\Values\\AdSetEffectiveStatusValues;\nuse FacebookAds\\Object\\Values\\AdSetExecutionOptionsValues;\nuse FacebookAds\\Object\\Values\\AdSetFullFunnelExplorationModeValues;\nuse FacebookAds\\Object\\Values\\AdSetMultiOptimizationGoalWeightValues;\nuse FacebookAds\\Object\\Values\\AdSetOperatorValues;\nuse FacebookAds\\Object\\Values\\AdSetOptimizationGoalValues;\nuse FacebookAds\\Object\\Values\\AdSetOptimizationSubEventValues;\nuse FacebookAds\\Object\\Values\\AdSetStatusOptionValues;\nuse FacebookAds\\Object\\Values\\AdSetStatusValues;\nuse FacebookAds\\Object\\Values\\AdSetTuneForCategoryValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsActionAttributionWindowsValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsActionBreakdownsValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsActionReportTimeValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsBreakdownsValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsDatePresetValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsLevelValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsSummaryActionBreakdownsValues;\nuse FacebookAds\\Object\\Traits\\AdLabelAwareCrudObjectTrait;\nuse FacebookAds\\Object\\Traits\\ObjectValidation;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdSet extends AbstractArchivableCrudObject\n  implements CanRedownloadInterface {\n\n  use AdLabelAwareCrudObjectTrait;\n  use ObjectValidation;\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'adsets';\n  }\n\n  /**\n   * @return AdSetFields\n   */\n  public static function getFieldsEnum() {\n    return AdSetFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['BidStrategy'] = AdSetBidStrategyValues::getInstance()->getValues();\n    $ref_enums['BillingEvent'] = AdSetBillingEventValues::getInstance()->getValues();\n    $ref_enums['ConfiguredStatus'] = AdSetConfiguredStatusValues::getInstance()->getValues();\n    $ref_enums['EffectiveStatus'] = AdSetEffectiveStatusValues::getInstance()->getValues();\n    $ref_enums['OptimizationGoal'] = AdSetOptimizationGoalValues::getInstance()->getValues();\n    $ref_enums['Status'] = AdSetStatusValues::getInstance()->getValues();\n    $ref_enums['DatePreset'] = AdSetDatePresetValues::getInstance()->getValues();\n    $ref_enums['DestinationType'] = AdSetDestinationTypeValues::getInstance()->getValues();\n    $ref_enums['ExecutionOptions'] = AdSetExecutionOptionsValues::getInstance()->getValues();\n    $ref_enums['FullFunnelExplorationMode'] = AdSetFullFunnelExplorationModeValues::getInstance()->getValues();\n    $ref_enums['MultiOptimizationGoalWeight'] = AdSetMultiOptimizationGoalWeightValues::getInstance()->getValues();\n    $ref_enums['OptimizationSubEvent'] = AdSetOptimizationSubEventValues::getInstance()->getValues();\n    $ref_enums['TuneForCategory'] = AdSetTuneForCategoryValues::getInstance()->getValues();\n    $ref_enums['Operator'] = AdSetOperatorValues::getInstance()->getValues();\n    $ref_enums['StatusOption'] = AdSetStatusOptionValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getActivities(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'after' => 'string',\n      'business_id' => 'string',\n      'category' => 'category_enum',\n      'limit' => 'int',\n      'since' => 'datetime',\n      'uid' => 'int',\n      'until' => 'datetime',\n    );\n    $enums = array(\n      'category_enum' => AdActivityCategoryValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/activities',\n      new AdActivity(),\n      'EDGE',\n      AdActivity::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdStudies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ad_studies',\n      new AdStudy(),\n      'EDGE',\n      AdStudy::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdCreatives(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adcreatives',\n      new AdCreative(),\n      'EDGE',\n      AdCreative::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteAdLabels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adlabels' => 'list<Object>',\n      'execution_options' => 'list<execution_options_enum>',\n    );\n    $enums = array(\n      'execution_options_enum' => AdSetExecutionOptionsValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/adlabels',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdLabel(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adlabels' => 'list<Object>',\n      'execution_options' => 'list<execution_options_enum>',\n    );\n    $enums = array(\n      'execution_options_enum' => AdSetExecutionOptionsValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adlabels',\n      new AdSet(),\n      'EDGE',\n      AdSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdRulesGoverned(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'pass_evaluation' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adrules_governed',\n      new AdRule(),\n      'EDGE',\n      AdRule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAds(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'date_preset' => 'date_preset_enum',\n      'effective_status' => 'list<string>',\n      'time_range' => 'Object',\n      'updated_since' => 'int',\n    );\n    $enums = array(\n      'date_preset_enum' => AdDatePresetValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ads',\n      new Ad(),\n      'EDGE',\n      Ad::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAsyncAdRequests(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'statuses' => 'list<statuses_enum>',\n    );\n    $enums = array(\n      'statuses_enum' => AdAsyncRequestStatusesValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/asyncadrequests',\n      new AdAsyncRequest(),\n      'EDGE',\n      AdAsyncRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCopies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'date_preset' => 'date_preset_enum',\n      'effective_status' => 'list<effective_status_enum>',\n      'is_completed' => 'bool',\n      'time_range' => 'Object',\n    );\n    $enums = array(\n      'date_preset_enum' => AdSetDatePresetValues::getInstance()->getValues(),\n      'effective_status_enum' => AdSetEffectiveStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/copies',\n      new AdSet(),\n      'EDGE',\n      AdSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCopy(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'campaign_id' => 'string',\n      'create_dco_adset' => 'bool',\n      'deep_copy' => 'bool',\n      'end_time' => 'datetime',\n      'rename_options' => 'Object',\n      'start_time' => 'datetime',\n      'status_option' => 'status_option_enum',\n    );\n    $enums = array(\n      'status_option_enum' => AdSetStatusOptionValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/copies',\n      new AdSet(),\n      'EDGE',\n      AdSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getDeliveryEstimate(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'optimization_goal' => 'optimization_goal_enum',\n      'promoted_object' => 'Object',\n      'targeting_spec' => 'Targeting',\n    );\n    $enums = array(\n      'optimization_goal_enum' => AdCampaignDeliveryEstimateOptimizationGoalValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/delivery_estimate',\n      new AdCampaignDeliveryEstimate(),\n      'EDGE',\n      AdCampaignDeliveryEstimate::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInsights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action_attribution_windows' => 'list<action_attribution_windows_enum>',\n      'action_breakdowns' => 'list<action_breakdowns_enum>',\n      'action_report_time' => 'action_report_time_enum',\n      'breakdowns' => 'list<breakdowns_enum>',\n      'date_preset' => 'date_preset_enum',\n      'default_summary' => 'bool',\n      'export_columns' => 'list<string>',\n      'export_format' => 'string',\n      'export_name' => 'string',\n      'fields' => 'list<string>',\n      'filtering' => 'list<Object>',\n      'level' => 'level_enum',\n      'product_id_limit' => 'int',\n      'sort' => 'list<string>',\n      'summary' => 'list<string>',\n      'summary_action_breakdowns' => 'list<summary_action_breakdowns_enum>',\n      'time_increment' => 'string',\n      'time_range' => 'Object',\n      'time_ranges' => 'list<Object>',\n      'use_account_attribution_setting' => 'bool',\n      'use_unified_attribution_setting' => 'bool',\n    );\n    $enums = array(\n      'action_attribution_windows_enum' => AdsInsightsActionAttributionWindowsValues::getInstance()->getValues(),\n      'action_breakdowns_enum' => AdsInsightsActionBreakdownsValues::getInstance()->getValues(),\n      'action_report_time_enum' => AdsInsightsActionReportTimeValues::getInstance()->getValues(),\n      'breakdowns_enum' => AdsInsightsBreakdownsValues::getInstance()->getValues(),\n      'date_preset_enum' => AdsInsightsDatePresetValues::getInstance()->getValues(),\n      'level_enum' => AdsInsightsLevelValues::getInstance()->getValues(),\n      'summary_action_breakdowns_enum' => AdsInsightsSummaryActionBreakdownsValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/insights',\n      new AdsInsights(),\n      'EDGE',\n      AdsInsights::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInsightsAsync(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action_attribution_windows' => 'list<action_attribution_windows_enum>',\n      'action_breakdowns' => 'list<action_breakdowns_enum>',\n      'action_report_time' => 'action_report_time_enum',\n      'breakdowns' => 'list<breakdowns_enum>',\n      'date_preset' => 'date_preset_enum',\n      'default_summary' => 'bool',\n      'export_columns' => 'list<string>',\n      'export_format' => 'string',\n      'export_name' => 'string',\n      'fields' => 'list<string>',\n      'filtering' => 'list<Object>',\n      'level' => 'level_enum',\n      'product_id_limit' => 'int',\n      'sort' => 'list<string>',\n      'summary' => 'list<string>',\n      'summary_action_breakdowns' => 'list<summary_action_breakdowns_enum>',\n      'time_increment' => 'string',\n      'time_range' => 'Object',\n      'time_ranges' => 'list<Object>',\n      'use_account_attribution_setting' => 'bool',\n      'use_unified_attribution_setting' => 'bool',\n    );\n    $enums = array(\n      'action_attribution_windows_enum' => AdsInsightsActionAttributionWindowsValues::getInstance()->getValues(),\n      'action_breakdowns_enum' => AdsInsightsActionBreakdownsValues::getInstance()->getValues(),\n      'action_report_time_enum' => AdsInsightsActionReportTimeValues::getInstance()->getValues(),\n      'breakdowns_enum' => AdsInsightsBreakdownsValues::getInstance()->getValues(),\n      'date_preset_enum' => AdsInsightsDatePresetValues::getInstance()->getValues(),\n      'level_enum' => AdsInsightsLevelValues::getInstance()->getValues(),\n      'summary_action_breakdowns_enum' => AdsInsightsSummaryActionBreakdownsValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/insights',\n      new AdReportRun(),\n      'EDGE',\n      AdReportRun::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTargetingSentenceLines(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/targetingsentencelines',\n      new TargetingSentenceLine(),\n      'EDGE',\n      TargetingSentenceLine::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'am_call_tags' => 'map',\n      'date_preset' => 'date_preset_enum',\n      'from_adtable' => 'bool',\n      'time_range' => 'Object',\n    );\n    $enums = array(\n      'date_preset_enum' => array(\n        'data_maximum',\n        'last_14d',\n        'last_28d',\n        'last_30d',\n        'last_3d',\n        'last_7d',\n        'last_90d',\n        'last_month',\n        'last_quarter',\n        'last_week_mon_sun',\n        'last_week_sun_sat',\n        'last_year',\n        'maximum',\n        'this_month',\n        'this_quarter',\n        'this_week_mon_today',\n        'this_week_sun_today',\n        'this_year',\n        'today',\n        'yesterday',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdSet(),\n      'NODE',\n      AdSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'account_id' => 'string',\n      'adlabels' => 'list<Object>',\n      'adset_schedule' => 'list<Object>',\n      'attribution_spec' => 'list<map>',\n      'bid_adjustments' => 'Object',\n      'bid_amount' => 'int',\n      'bid_constraints' => 'map<string, Object>',\n      'bid_strategy' => 'bid_strategy_enum',\n      'billing_event' => 'billing_event_enum',\n      'campaign_spec' => 'Object',\n      'creative_sequence' => 'list<string>',\n      'daily_budget' => 'unsigned int',\n      'daily_imps' => 'unsigned int',\n      'daily_min_spend_target' => 'unsigned int',\n      'daily_spend_cap' => 'unsigned int',\n      'date_format' => 'string',\n      'destination_type' => 'destination_type_enum',\n      'dsa_beneficiary' => 'string',\n      'dsa_payor' => 'string',\n      'end_time' => 'datetime',\n      'execution_options' => 'list<execution_options_enum>',\n      'existing_customer_budget_percentage' => 'unsigned int',\n      'full_funnel_exploration_mode' => 'full_funnel_exploration_mode_enum',\n      'lifetime_budget' => 'unsigned int',\n      'lifetime_imps' => 'unsigned int',\n      'lifetime_min_spend_target' => 'unsigned int',\n      'lifetime_spend_cap' => 'unsigned int',\n      'multi_optimization_goal_weight' => 'multi_optimization_goal_weight_enum',\n      'name' => 'string',\n      'optimization_goal' => 'optimization_goal_enum',\n      'optimization_sub_event' => 'optimization_sub_event_enum',\n      'pacing_type' => 'list<string>',\n      'promoted_object' => 'Object',\n      'rb_prediction_id' => 'string',\n      'rf_prediction_id' => 'string',\n      'start_time' => 'datetime',\n      'status' => 'status_enum',\n      'targeting' => 'Targeting',\n      'time_based_ad_rotation_id_blocks' => 'list<list<unsigned int>>',\n      'time_based_ad_rotation_intervals' => 'list<unsigned int>',\n      'time_start' => 'datetime',\n      'time_stop' => 'datetime',\n      'tune_for_category' => 'tune_for_category_enum',\n    );\n    $enums = array(\n      'bid_strategy_enum' => AdSetBidStrategyValues::getInstance()->getValues(),\n      'billing_event_enum' => AdSetBillingEventValues::getInstance()->getValues(),\n      'destination_type_enum' => AdSetDestinationTypeValues::getInstance()->getValues(),\n      'execution_options_enum' => AdSetExecutionOptionsValues::getInstance()->getValues(),\n      'full_funnel_exploration_mode_enum' => AdSetFullFunnelExplorationModeValues::getInstance()->getValues(),\n      'multi_optimization_goal_weight_enum' => AdSetMultiOptimizationGoalWeightValues::getInstance()->getValues(),\n      'optimization_goal_enum' => AdSetOptimizationGoalValues::getInstance()->getValues(),\n      'optimization_sub_event_enum' => AdSetOptimizationSubEventValues::getInstance()->getValues(),\n      'status_enum' => AdSetStatusValues::getInstance()->getValues(),\n      'tune_for_category_enum' => AdSetTuneForCategoryValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new AdSet(),\n      'NODE',\n      AdSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 678}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdsImageCropsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdsImageCrops extends AbstractObject {\n\n  /**\n   * @return AdsImageCropsFields\n   */\n  public static function getFieldsEnum() {\n    return AdsImageCropsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdsInsightsFields;\nuse FacebookAds\\Object\\Values\\AdsInsightsActionAttributionWindowsValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsActionBreakdownsValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsActionReportTimeValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsBreakdownsValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsDatePresetValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsLevelValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsSummaryActionBreakdownsValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdsInsights extends AbstractObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'insights';\n  }\n\n  /**\n   * @return AdsInsightsFields\n   */\n  public static function getFieldsEnum() {\n    return AdsInsightsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ActionAttributionWindows'] = AdsInsightsActionAttributionWindowsValues::getInstance()->getValues();\n    $ref_enums['ActionBreakdowns'] = AdsInsightsActionBreakdownsValues::getInstance()->getValues();\n    $ref_enums['ActionReportTime'] = AdsInsightsActionReportTimeValues::getInstance()->getValues();\n    $ref_enums['Breakdowns'] = AdsInsightsBreakdownsValues::getInstance()->getValues();\n    $ref_enums['DatePreset'] = AdsInsightsDatePresetValues::getInstance()->getValues();\n    $ref_enums['Level'] = AdsInsightsLevelValues::getInstance()->getValues();\n    $ref_enums['SummaryActionBreakdowns'] = AdsInsightsSummaryActionBreakdownsValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 79}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdsOptimalDeliveryGrowthOpportunityFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdsOptimalDeliveryGrowthOpportunity extends AbstractObject {\n\n  /**\n   * @return AdsOptimalDeliveryGrowthOpportunityFields\n   */\n  public static function getFieldsEnum() {\n    return AdsOptimalDeliveryGrowthOpportunityFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdsPixelFields;\nuse FacebookAds\\Object\\Values\\AdsPixelAutomaticMatchingFieldsValues;\nuse FacebookAds\\Object\\Values\\AdsPixelDataUseSettingValues;\nuse FacebookAds\\Object\\Values\\AdsPixelFirstPartyCookieStatusValues;\nuse FacebookAds\\Object\\Values\\AdsPixelSortByValues;\nuse FacebookAds\\Object\\Values\\AdsPixelStatsResultAggregationValues;\nuse FacebookAds\\Object\\Values\\AdsPixelTasksValues;\nuse FacebookAds\\Object\\Values\\DACheckConnectionMethodValues;\nuse FacebookAds\\Object\\Values\\OfflineConversionDataSetUploadOrderValues;\nuse FacebookAds\\Object\\Values\\OfflineConversionDataSetUploadSortByValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdsPixel extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'adspixels';\n  }\n\n  /**\n   * @return AdsPixelFields\n   */\n  public static function getFieldsEnum() {\n    return AdsPixelFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['SortBy'] = AdsPixelSortByValues::getInstance()->getValues();\n    $ref_enums['AutomaticMatchingFields'] = AdsPixelAutomaticMatchingFieldsValues::getInstance()->getValues();\n    $ref_enums['DataUseSetting'] = AdsPixelDataUseSettingValues::getInstance()->getValues();\n    $ref_enums['FirstPartyCookieStatus'] = AdsPixelFirstPartyCookieStatusValues::getInstance()->getValues();\n    $ref_enums['Tasks'] = AdsPixelTasksValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adaccounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAgencies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/agencies',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAssignedUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/assigned_users',\n      new AssignedUser(),\n      'EDGE',\n      AssignedUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAssignedUser(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'tasks' => 'list<tasks_enum>',\n      'user' => 'int',\n    );\n    $enums = array(\n      'tasks_enum' => AdsPixelTasksValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/assigned_users',\n      new AdsPixel(),\n      'EDGE',\n      AdsPixel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getDaChecks(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'checks' => 'list<string>',\n      'connection_method' => 'connection_method_enum',\n    );\n    $enums = array(\n      'connection_method_enum' => DACheckConnectionMethodValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/da_checks',\n      new DACheck(),\n      'EDGE',\n      DACheck::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createEvent(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'data' => 'list<string>',\n      'namespace_id' => 'string',\n      'partner_agent' => 'string',\n      'platforms' => 'list<map>',\n      'test_event_code' => 'string',\n      'trace' => 'unsigned int',\n      'upload_id' => 'string',\n      'upload_source' => 'string',\n      'upload_tag' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/events',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createMeapitocapiconsolidationhelper(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/meapitocapiconsolidationhelper',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOfflineEventUploads(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'end_time' => 'datetime',\n      'order' => 'order_enum',\n      'sort_by' => 'sort_by_enum',\n      'start_time' => 'datetime',\n      'upload_tag' => 'string',\n    );\n    $enums = array(\n      'order_enum' => OfflineConversionDataSetUploadOrderValues::getInstance()->getValues(),\n      'sort_by_enum' => OfflineConversionDataSetUploadSortByValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/offline_event_uploads',\n      new OfflineConversionDataSetUpload(),\n      'EDGE',\n      OfflineConversionDataSetUpload::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOpenBridgeConfigurations(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/openbridge_configurations',\n      new OpenBridgeConfiguration(),\n      'EDGE',\n      OpenBridgeConfiguration::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createShadowTrafficHelper(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/shadowtraffichelper',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSharedAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'account_id' => 'string',\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/shared_accounts',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSharedAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/shared_accounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createSharedAccount(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'account_id' => 'string',\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/shared_accounts',\n      new AdsPixel(),\n      'EDGE',\n      AdsPixel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSharedAgencies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/shared_agencies',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getStats(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'aggregation' => 'aggregation_enum',\n      'end_time' => 'datetime',\n      'event' => 'string',\n      'event_source' => 'string',\n      'start_time' => 'datetime',\n    );\n    $enums = array(\n      'aggregation_enum' => AdsPixelStatsResultAggregationValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/stats',\n      new AdsPixelStatsResult(),\n      'EDGE',\n      AdsPixelStatsResult::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createTelemetry(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/telemetry',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdsPixel(),\n      'NODE',\n      AdsPixel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'automatic_matching_fields' => 'list<automatic_matching_fields_enum>',\n      'data_use_setting' => 'data_use_setting_enum',\n      'enable_automatic_matching' => 'bool',\n      'first_party_cookie_status' => 'first_party_cookie_status_enum',\n      'name' => 'string',\n      'server_events_business_ids' => 'list<string>',\n    );\n    $enums = array(\n      'automatic_matching_fields_enum' => AdsPixelAutomaticMatchingFieldsValues::getInstance()->getValues(),\n      'data_use_setting_enum' => AdsPixelDataUseSettingValues::getInstance()->getValues(),\n      'first_party_cookie_status_enum' => AdsPixelFirstPartyCookieStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new AdsPixel(),\n      'NODE',\n      AdsPixel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  /**\n   * @param int $business_id\n   * @param string $account_id\n   */\n  public function sharePixelWithAdAccount($business_id, $account_id) {\n    $this->getApi()->call(\n      '/'.$this->assureId().'/shared_accounts',\n      RequestInterface::METHOD_POST,\n      array(\n        'business' => $business_id,\n        'account_id' => $account_id,\n      ));\n  }\n\n  /**\n   * @param $business_id\n   * @param $account_id\n   */\n  public function unsharePixelWithAdAccount($business_id, $account_id) {\n    $this->getApi()->call(\n      '/'.$this->assureId().'/shared_accounts',\n      RequestInterface::METHOD_DELETE,\n      array(\n        'business' => $business_id,\n        'account_id' => $account_id,\n      ));\n  }\n\n  /**\n   * @param int $business_id\n   * @param int $agency_id\n   */\n  public function sharePixelWithAgency($business_id, $agency_id) {\n    $this->getApi()->call(\n      '/'.$this->assureId().'/shared_agencies',\n      'POST',\n      array(\n        'business' => $business_id,\n        'agency_id' => $agency_id,\n      ));\n  }\n\n  /**\n   * @param int $business_id\n   * @param int $agency_id\n   */\n  public function unsharePixelWithAgency($business_id, $agency_id) {\n    $this->getApi()->call(\n      '/'.$this->assureId().'/shared_agencies',\n      'DELETE',\n      array(\n        'business' => $business_id,\n        'agency_id' => $agency_id,\n      ));\n  }\n}\n", "num_lines": 592}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdsPixelStatsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdsPixelStats extends AbstractObject {\n\n  /**\n   * @return AdsPixelStatsFields\n   */\n  public static function getFieldsEnum() {\n    return AdsPixelStatsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdsPixelStatsResultFields;\nuse FacebookAds\\Object\\Values\\AdsPixelStatsResultAggregationValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdsPixelStatsResult extends AbstractObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'stats';\n  }\n\n  /**\n   * @return AdsPixelStatsResultFields\n   */\n  public static function getFieldsEnum() {\n    return AdsPixelStatsResultFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Aggregation'] = AdsPixelStatsResultAggregationValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 67}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdStudyFields;\nuse FacebookAds\\Object\\Values\\AdStudyTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdStudy extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'ad_studies';\n  }\n\n  /**\n   * @return AdStudyFields\n   */\n  public static function getFieldsEnum() {\n    return AdStudyFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Type'] = AdStudyTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getCells(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/cells',\n      new AdStudyCell(),\n      'EDGE',\n      AdStudyCell::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCheckPoint(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'checkpoint_data' => 'string',\n      'checkpoint_name' => 'string',\n      'component' => 'string',\n      'instance_id' => 'string',\n      'run_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/checkpoint',\n      new AdStudy(),\n      'EDGE',\n      AdStudy::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInstances(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/instances',\n      new PrivateLiftStudyInstance(),\n      'EDGE',\n      PrivateLiftStudyInstance::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createInstance(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'breakdown_key' => 'map',\n      'run_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/instances',\n      new PrivateLiftStudyInstance(),\n      'EDGE',\n      PrivateLiftStudyInstance::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getObjectives(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/objectives',\n      new AdStudyObjective(),\n      'EDGE',\n      AdStudyObjective::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdStudy(),\n      'NODE',\n      AdStudy::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'cells' => 'list<Object>',\n      'client_business' => 'string',\n      'confidence_level' => 'float',\n      'cooldown_start_time' => 'int',\n      'description' => 'string',\n      'end_time' => 'int',\n      'name' => 'string',\n      'objectives' => 'list<Object>',\n      'observation_end_time' => 'int',\n      'start_time' => 'int',\n      'type' => 'type_enum',\n      'viewers' => 'list<int>',\n    );\n    $enums = array(\n      'type_enum' => AdStudyTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new AdStudy(),\n      'NODE',\n      AdStudy::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 271}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdStudyCellFields;\nuse FacebookAds\\Object\\Values\\AdStudyCellCreationTemplateValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdStudyCell extends AbstractCrudObject {\n\n  /**\n   * @return AdStudyCellFields\n   */\n  public static function getFieldsEnum() {\n    return AdStudyCellFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['CreationTemplate'] = AdStudyCellCreationTemplateValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adaccounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdSets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adsets',\n      new AdSet(),\n      'EDGE',\n      AdSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCampaigns(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/campaigns',\n      new Campaign(),\n      'EDGE',\n      Campaign::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdStudyCell(),\n      'NODE',\n      AdStudyCell::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adaccounts' => 'list<unsigned int>',\n      'adsets' => 'list<string>',\n      'campaigns' => 'list<string>',\n      'creation_template' => 'creation_template_enum',\n      'description' => 'string',\n      'name' => 'string',\n    );\n    $enums = array(\n      'creation_template_enum' => AdStudyCellCreationTemplateValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new AdStudyCell(),\n      'NODE',\n      AdStudyCell::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 182}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdStudyObjectiveFields;\nuse FacebookAds\\Object\\Values\\AdStudyObjectiveTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdStudyObjective extends AbstractCrudObject {\n\n  /**\n   * @return AdStudyObjectiveFields\n   */\n  public static function getFieldsEnum() {\n    return AdStudyObjectiveFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Type'] = AdStudyObjectiveTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAdsPixels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adspixels',\n      new AdsPixel(),\n      'EDGE',\n      AdsPixel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getApplications(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/applications',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getBrandRequests(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/brand_requests',\n      new BrandRequest(),\n      'EDGE',\n      BrandRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCustomConversions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/customconversions',\n      new CustomConversion(),\n      'EDGE',\n      CustomConversion::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOfflineConversionDataSets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/offline_conversion_data_sets',\n      new OfflineConversionDataSet(),\n      'EDGE',\n      OfflineConversionDataSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPartnerPrivateStudies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/partner_private_studies',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPartnerStudies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/partnerstudies',\n      new PartnerStudy(),\n      'EDGE',\n      PartnerStudy::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'breakdowns' => 'list<breakdowns_enum>',\n      'ds' => 'string',\n    );\n    $enums = array(\n      'breakdowns_enum' => array(\n        'age',\n        'cell_id',\n        'country',\n        'gender',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdStudyObjective(),\n      'NODE',\n      AdStudyObjective::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adspixels' => 'list<Object>',\n      'applications' => 'list<Object>',\n      'customconversions' => 'list<Object>',\n      'is_primary' => 'bool',\n      'name' => 'string',\n      'offline_conversion_data_sets' => 'list<Object>',\n      'offsite_datasets' => 'list<Object>',\n      'product_catalogs' => 'list<Object>',\n      'product_sets' => 'list<Object>',\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'type_enum' => AdStudyObjectiveTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new AdStudyObjective(),\n      'NODE',\n      AdStudyObjective::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 286}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdStudyObjectiveIDFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdStudyObjectiveID extends AbstractCrudObject {\n\n  /**\n   * @return AdStudyObjectiveIDFields\n   */\n  public static function getFieldsEnum() {\n    return AdStudyObjectiveIDFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdStudyObjectiveOffsiteDatasetsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdStudyObjectiveOffsiteDatasets extends AbstractCrudObject {\n\n  /**\n   * @return AdStudyObjectiveOffsiteDatasetsFields\n   */\n  public static function getFieldsEnum() {\n    return AdStudyObjectiveOffsiteDatasetsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AdVideoFields;\nuse FacebookAds\\Object\\Values\\AdVideoBackdatedTimeGranularityValues;\nuse FacebookAds\\Object\\Values\\AdVideoContainerTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoContentCategoryValues;\nuse FacebookAds\\Object\\Values\\AdVideoFormattingValues;\nuse FacebookAds\\Object\\Values\\AdVideoOriginalProjectionTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoSwapModeValues;\nuse FacebookAds\\Object\\Values\\AdVideoTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoUnpublishedContentTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoUploadPhaseValues;\nuse FacebookAds\\Object\\Values\\AdVideoVideoStateValues;\nuse FacebookAds\\Object\\Values\\CommentCommentPrivacyValueValues;\nuse FacebookAds\\Object\\Values\\CommentFilterValues;\nuse FacebookAds\\Object\\Values\\CommentLiveFilterValues;\nuse FacebookAds\\Object\\Values\\CommentOrderValues;\nuse FacebookAds\\Object\\Values\\InsightsResultPeriodValues;\nuse FacebookAds\\Object\\Traits\\CannotDelete;\nuse FacebookAds\\Object\\Traits\\CannotUpdate;\nuse FacebookAds\\Object\\Traits\\FieldValidation;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdVideo extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'advideos';\n  }\n\n  /**\n   * @return AdVideoFields\n   */\n  public static function getFieldsEnum() {\n    return AdVideoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ContainerType'] = AdVideoContainerTypeValues::getInstance()->getValues();\n    $ref_enums['ContentCategory'] = AdVideoContentCategoryValues::getInstance()->getValues();\n    $ref_enums['Formatting'] = AdVideoFormattingValues::getInstance()->getValues();\n    $ref_enums['OriginalProjectionType'] = AdVideoOriginalProjectionTypeValues::getInstance()->getValues();\n    $ref_enums['SwapMode'] = AdVideoSwapModeValues::getInstance()->getValues();\n    $ref_enums['UnpublishedContentType'] = AdVideoUnpublishedContentTypeValues::getInstance()->getValues();\n    $ref_enums['UploadPhase'] = AdVideoUploadPhaseValues::getInstance()->getValues();\n    $ref_enums['Type'] = AdVideoTypeValues::getInstance()->getValues();\n    $ref_enums['VideoState'] = AdVideoVideoStateValues::getInstance()->getValues();\n    $ref_enums['BackdatedTimeGranularity'] = AdVideoBackdatedTimeGranularityValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getCaptions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/captions',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCaption(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'captions_file' => 'file',\n      'default_locale' => 'string',\n      'locales_to_delete' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/captions',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCollaborators(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/collaborators',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCollaborator(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'target_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/collaborators',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getComments(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'filter' => 'filter_enum',\n      'live_filter' => 'live_filter_enum',\n      'order' => 'order_enum',\n      'since' => 'datetime',\n    );\n    $enums = array(\n      'filter_enum' => CommentFilterValues::getInstance()->getValues(),\n      'live_filter_enum' => CommentLiveFilterValues::getInstance()->getValues(),\n      'order_enum' => CommentOrderValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/comments',\n      new Comment(),\n      'EDGE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createComment(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'attachment_id' => 'string',\n      'attachment_share_url' => 'string',\n      'attachment_url' => 'string',\n      'comment_privacy_value' => 'comment_privacy_value_enum',\n      'facepile_mentioned_ids' => 'list<string>',\n      'feedback_source' => 'string',\n      'is_offline' => 'bool',\n      'message' => 'string',\n      'nectar_module' => 'string',\n      'object_id' => 'string',\n      'parent_comment_id' => 'Object',\n      'text' => 'string',\n      'tracking' => 'string',\n    );\n    $enums = array(\n      'comment_privacy_value_enum' => CommentCommentPrivacyValueValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/comments',\n      new Comment(),\n      'EDGE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCrosspostSharedPages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/crosspost_shared_pages',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createGamingClipCreate(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'duration_seconds' => 'float',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/gaming_clip_create',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLikes(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/likes',\n      new Profile(),\n      'EDGE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createLike(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'feedback_source' => 'string',\n      'nectar_module' => 'string',\n      'notify' => 'bool',\n      'tracking' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/likes',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPollSettings(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/poll_settings',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPolls(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/polls',\n      new VideoPoll(),\n      'EDGE',\n      VideoPoll::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPoll(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'close_after_voting' => 'bool',\n      'correct_option' => 'unsigned int',\n      'default_open' => 'bool',\n      'options' => 'list<string>',\n      'question' => 'string',\n      'show_gradient' => 'bool',\n      'show_results' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/polls',\n      new VideoPoll(),\n      'EDGE',\n      VideoPoll::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSponsorTags(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/sponsor_tags',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTags(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/tags',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createTag(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'tag_uid' => 'int',\n      'uid' => 'int',\n      'vid' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/tags',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getThumbnails(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/thumbnails',\n      new VideoThumbnail(),\n      'EDGE',\n      VideoThumbnail::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createThumbnail(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'is_preferred' => 'bool',\n      'source' => 'file',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/thumbnails',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideoInsights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'metric' => 'list<Object>',\n      'period' => 'period_enum',\n      'since' => 'datetime',\n      'until' => 'datetime',\n    );\n    $enums = array(\n      'period_enum' => InsightsResultPeriodValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/video_insights',\n      new InsightsResult(),\n      'EDGE',\n      InsightsResult::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AdVideo(),\n      'NODE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_breaks' => 'list',\n      'allow_bm_crossposting' => 'bool',\n      'allow_crossposting_for_pages' => 'list<Object>',\n      'backdated_time' => 'datetime',\n      'backdated_time_granularity' => 'backdated_time_granularity_enum',\n      'call_to_action' => 'Object',\n      'content_category' => 'content_category_enum',\n      'content_tags' => 'list<string>',\n      'custom_labels' => 'list<string>',\n      'description' => 'string',\n      'direct_share_status' => 'unsigned int',\n      'embeddable' => 'bool',\n      'expiration' => 'Object',\n      'expire_now' => 'bool',\n      'increment_play_count' => 'bool',\n      'name' => 'string',\n      'preferred_thumbnail_id' => 'string',\n      'privacy' => 'string',\n      'publish_to_news_feed' => 'bool',\n      'publish_to_videos_tab' => 'bool',\n      'published' => 'bool',\n      'scheduled_publish_time' => 'unsigned int',\n      'social_actions' => 'bool',\n      'sponsor_id' => 'string',\n      'sponsor_relationship' => 'unsigned int',\n      'tags' => 'list<string>',\n      'target' => 'string',\n      'universal_video_id' => 'string',\n    );\n    $enums = array(\n      'backdated_time_granularity_enum' => AdVideoBackdatedTimeGranularityValues::getInstance()->getValues(),\n      'content_category_enum' => AdVideoContentCategoryValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new AdVideo(),\n      'NODE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  use FieldValidation;\n\n  public function create(array $params = array()) {\n    $data = $this->exportData();\n    $source = null;\n    if (array_key_exists(AdVideoFields::SOURCE, $data)) {\n      $source = $data[AdVideoFields::SOURCE];\n      unset($data[AdVideoFields::SOURCE]);\n    }\n    $params = array_merge($data, $params);\n\n    $request = $this->getApi()->prepareRequest(\n      '/'.$this->assureParentId().'/'.$this->getEndpoint(),\n      RequestInterface::METHOD_POST,\n      $params\n    );\n\n    $request->setLastLevelDomain('graph-video');\n    if ($source) {\n      $request->getFileParams()->offsetSet(AdVideoFields::SOURCE, $source);\n    }\n    $response = $this->getApi()->executeRequest($request);\n\n    $data = $response->getContent();\n    $this->data[static::FIELD_ID]\n      = is_string($data) ? $data : (string) $data[static::FIELD_ID];\n\n    return $this;\n  }\n\n  /**\n   * @param array $fields\n   * @param array $params\n   * @return Cursor\n   */\n  public function getVideoThumbnails(\n    array $fields = array(), array $params = array()) {\n    return $this->getManyByConnection(\n      VideoThumbnail::className(), $fields, $params, 'thumbnails');\n  }\n}\n", "num_lines": 716}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AgencyClientDeclarationFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AgencyClientDeclaration extends AbstractObject {\n\n  /**\n   * @return AgencyClientDeclarationFields\n   */\n  public static function getFieldsEnum() {\n    return AgencyClientDeclarationFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AgeRangeFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AgeRange extends AbstractObject {\n\n  /**\n   * @return AgeRangeFields\n   */\n  public static function getFieldsEnum() {\n    return AgeRangeFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AlbumFields;\nuse FacebookAds\\Object\\Values\\CommentCommentPrivacyValueValues;\nuse FacebookAds\\Object\\Values\\CommentFilterValues;\nuse FacebookAds\\Object\\Values\\CommentLiveFilterValues;\nuse FacebookAds\\Object\\Values\\CommentOrderValues;\nuse FacebookAds\\Object\\Values\\PhotoBackdatedTimeGranularityValues;\nuse FacebookAds\\Object\\Values\\PhotoUnpublishedContentTypeValues;\nuse FacebookAds\\Object\\Values\\ProfilePictureSourceTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Album extends AbstractCrudObject {\n\n  /**\n   * @return AlbumFields\n   */\n  public static function getFieldsEnum() {\n    return AlbumFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getComments(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'filter' => 'filter_enum',\n      'live_filter' => 'live_filter_enum',\n      'order' => 'order_enum',\n      'since' => 'datetime',\n    );\n    $enums = array(\n      'filter_enum' => CommentFilterValues::getInstance()->getValues(),\n      'live_filter_enum' => CommentLiveFilterValues::getInstance()->getValues(),\n      'order_enum' => CommentOrderValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/comments',\n      new Comment(),\n      'EDGE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createComment(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'attachment_id' => 'string',\n      'attachment_share_url' => 'string',\n      'attachment_url' => 'string',\n      'comment_privacy_value' => 'comment_privacy_value_enum',\n      'facepile_mentioned_ids' => 'list<string>',\n      'feedback_source' => 'string',\n      'is_offline' => 'bool',\n      'message' => 'string',\n      'nectar_module' => 'string',\n      'object_id' => 'string',\n      'parent_comment_id' => 'Object',\n      'text' => 'string',\n      'tracking' => 'string',\n    );\n    $enums = array(\n      'comment_privacy_value_enum' => CommentCommentPrivacyValueValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/comments',\n      new Comment(),\n      'EDGE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLikes(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/likes',\n      new Profile(),\n      'EDGE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createLike(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'feedback_source' => 'string',\n      'nectar_module' => 'string',\n      'notify' => 'bool',\n      'tracking' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/likes',\n      new Album(),\n      'EDGE',\n      Album::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPhotos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/photos',\n      new Photo(),\n      'EDGE',\n      Photo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPhoto(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'aid' => 'string',\n      'allow_spherical_photo' => 'bool',\n      'alt_text_custom' => 'string',\n      'android_key_hash' => 'string',\n      'application_id' => 'string',\n      'attempt' => 'unsigned int',\n      'audience_exp' => 'bool',\n      'backdated_time' => 'datetime',\n      'backdated_time_granularity' => 'backdated_time_granularity_enum',\n      'caption' => 'string',\n      'composer_session_id' => 'string',\n      'direct_share_status' => 'unsigned int',\n      'feed_targeting' => 'Object',\n      'filter_type' => 'unsigned int',\n      'full_res_is_coming_later' => 'bool',\n      'initial_view_heading_override_degrees' => 'unsigned int',\n      'initial_view_pitch_override_degrees' => 'unsigned int',\n      'initial_view_vertical_fov_override_degrees' => 'unsigned int',\n      'ios_bundle_id' => 'string',\n      'is_explicit_location' => 'bool',\n      'is_explicit_place' => 'bool',\n      'manual_privacy' => 'bool',\n      'message' => 'string',\n      'name' => 'string',\n      'no_story' => 'bool',\n      'offline_id' => 'unsigned int',\n      'og_action_type_id' => 'string',\n      'og_icon_id' => 'string',\n      'og_object_id' => 'string',\n      'og_phrase' => 'string',\n      'og_set_profile_badge' => 'bool',\n      'og_suggestion_mechanism' => 'string',\n      'place' => 'Object',\n      'privacy' => 'string',\n      'profile_id' => 'int',\n      'proxied_app_id' => 'string',\n      'published' => 'bool',\n      'qn' => 'string',\n      'scheduled_publish_time' => 'unsigned int',\n      'spherical_metadata' => 'map',\n      'sponsor_id' => 'string',\n      'sponsor_relationship' => 'unsigned int',\n      'tags' => 'list<Object>',\n      'target_id' => 'int',\n      'targeting' => 'Object',\n      'time_since_original_post' => 'unsigned int',\n      'uid' => 'int',\n      'unpublished_content_type' => 'unpublished_content_type_enum',\n      'url' => 'string',\n      'user_selected_tags' => 'bool',\n      'vault_image_id' => 'string',\n    );\n    $enums = array(\n      'backdated_time_granularity_enum' => PhotoBackdatedTimeGranularityValues::getInstance()->getValues(),\n      'unpublished_content_type_enum' => PhotoUnpublishedContentTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/photos',\n      new Photo(),\n      'EDGE',\n      Photo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPicture(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'redirect' => 'bool',\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/picture',\n      new ProfilePictureSource(),\n      'EDGE',\n      ProfilePictureSource::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Album(),\n      'NODE',\n      Album::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 330}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AndroidAppLinkFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AndroidAppLink extends AbstractObject {\n\n  /**\n   * @return AndroidAppLinkFields\n   */\n  public static function getFieldsEnum() {\n    return AndroidAppLinkFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ApplicationFields;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultAggregationPeriodValues;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultBreakdownsValues;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultMetricsValues;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultOrderingColumnValues;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultOrderingTypeValues;\nuse FacebookAds\\Object\\Values\\ApplicationAnPlatformsValues;\nuse FacebookAds\\Object\\Values\\ApplicationLoggingSourceValues;\nuse FacebookAds\\Object\\Values\\ApplicationLoggingTargetValues;\nuse FacebookAds\\Object\\Values\\ApplicationMutationMethodValues;\nuse FacebookAds\\Object\\Values\\ApplicationPlatformValues;\nuse FacebookAds\\Object\\Values\\ApplicationPostMethodValues;\nuse FacebookAds\\Object\\Values\\ApplicationRequestTypeValues;\nuse FacebookAds\\Object\\Values\\ApplicationSupportedPlatformsValues;\nuse FacebookAds\\Object\\Values\\DACheckConnectionMethodValues;\nuse FacebookAds\\Object\\Values\\EventTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Application extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'adnetwork_applications';\n  }\n\n  /**\n   * @return ApplicationFields\n   */\n  public static function getFieldsEnum() {\n    return ApplicationFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['SupportedPlatforms'] = ApplicationSupportedPlatformsValues::getInstance()->getValues();\n    $ref_enums['AnPlatforms'] = ApplicationAnPlatformsValues::getInstance()->getValues();\n    $ref_enums['Platform'] = ApplicationPlatformValues::getInstance()->getValues();\n    $ref_enums['RequestType'] = ApplicationRequestTypeValues::getInstance()->getValues();\n    $ref_enums['MutationMethod'] = ApplicationMutationMethodValues::getInstance()->getValues();\n    $ref_enums['PostMethod'] = ApplicationPostMethodValues::getInstance()->getValues();\n    $ref_enums['LoggingSource'] = ApplicationLoggingSourceValues::getInstance()->getValues();\n    $ref_enums['LoggingTarget'] = ApplicationLoggingTargetValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function deleteAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'type' => 'type_enum',\n      'uid' => 'int',\n    );\n    $enums = array(\n      'type_enum' => array(\n        'test-users',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/accounts',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'type_enum' => array(\n        'test-users',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/accounts',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAccount(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'installed' => 'bool',\n      'minor' => 'bool',\n      'name' => 'string',\n      'owner_access_token' => 'string',\n      'permissions' => 'list<Permission>',\n      'type' => 'type_enum',\n      'uid' => 'int',\n    );\n    $enums = array(\n      'type_enum' => array(\n        'test-users',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/accounts',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createActivity(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'advertiser_id' => 'string',\n      'advertiser_tracking_enabled' => 'bool',\n      'anon_id' => 'string',\n      'app_user_id' => 'string',\n      'application_tracking_enabled' => 'bool',\n      'attribution' => 'string',\n      'auto_publish' => 'bool',\n      'bundle_id' => 'string',\n      'bundle_short_version' => 'string',\n      'bundle_version' => 'string',\n      'campaign_ids' => 'string',\n      'click_id' => 'string',\n      'consider_views' => 'bool',\n      'custom_events' => 'list<Object>',\n      'custom_events_file' => 'file',\n      'data_processing_options' => 'list<string>',\n      'data_processing_options_country' => 'unsigned int',\n      'data_processing_options_state' => 'unsigned int',\n      'device_token' => 'string',\n      'event' => 'event_enum',\n      'extinfo' => 'Object',\n      'include_dwell_data' => 'bool',\n      'include_video_data' => 'bool',\n      'install_referrer' => 'string',\n      'install_timestamp' => 'unsigned int',\n      'installer_package' => 'string',\n      'limited_data_use' => 'bool',\n      'migration_bundle' => 'string',\n      'page_id' => 'unsigned int',\n      'page_scoped_user_id' => 'unsigned int',\n      'receipt_data' => 'string',\n      'ud' => 'map',\n      'url_schemes' => 'list<string>',\n      'user_id' => 'string',\n      'user_id_type' => 'user_id_type_enum',\n      'windows_attribution_id' => 'string',\n    );\n    $enums = array(\n      'event_enum' => array(\n        'CUSTOM_APP_EVENTS',\n        'DEFERRED_APP_LINK',\n        'MOBILE_APP_INSTALL',\n      ),\n      'user_id_type_enum' => array(\n        'INSTANT_GAMES_PLAYER_ID',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/activities',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdPlacementGroups(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ad_placement_groups',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdNetworkPlacements(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'request_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adnetwork_placements',\n      new AdPlacement(),\n      'EDGE',\n      AdPlacement::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdNetworkAnalytics(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'aggregation_period' => 'aggregation_period_enum',\n      'breakdowns' => 'list<breakdowns_enum>',\n      'filters' => 'list<map>',\n      'limit' => 'unsigned int',\n      'metrics' => 'list<metrics_enum>',\n      'ordering_column' => 'ordering_column_enum',\n      'ordering_type' => 'ordering_type_enum',\n      'since' => 'datetime',\n      'until' => 'datetime',\n    );\n    $enums = array(\n      'aggregation_period_enum' => AdNetworkAnalyticsSyncQueryResultAggregationPeriodValues::getInstance()->getValues(),\n      'breakdowns_enum' => AdNetworkAnalyticsSyncQueryResultBreakdownsValues::getInstance()->getValues(),\n      'metrics_enum' => AdNetworkAnalyticsSyncQueryResultMetricsValues::getInstance()->getValues(),\n      'ordering_column_enum' => AdNetworkAnalyticsSyncQueryResultOrderingColumnValues::getInstance()->getValues(),\n      'ordering_type_enum' => AdNetworkAnalyticsSyncQueryResultOrderingTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adnetworkanalytics',\n      new AdNetworkAnalyticsSyncQueryResult(),\n      'EDGE',\n      AdNetworkAnalyticsSyncQueryResult::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdNetworkAnalytic(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'aggregation_period' => 'aggregation_period_enum',\n      'breakdowns' => 'list<breakdowns_enum>',\n      'filters' => 'list<Object>',\n      'limit' => 'int',\n      'metrics' => 'list<metrics_enum>',\n      'ordering_column' => 'ordering_column_enum',\n      'ordering_type' => 'ordering_type_enum',\n      'since' => 'datetime',\n      'until' => 'datetime',\n    );\n    $enums = array(\n      'aggregation_period_enum' => AdNetworkAnalyticsSyncQueryResultAggregationPeriodValues::getInstance()->getValues(),\n      'breakdowns_enum' => AdNetworkAnalyticsSyncQueryResultBreakdownsValues::getInstance()->getValues(),\n      'metrics_enum' => AdNetworkAnalyticsSyncQueryResultMetricsValues::getInstance()->getValues(),\n      'ordering_column_enum' => AdNetworkAnalyticsSyncQueryResultOrderingColumnValues::getInstance()->getValues(),\n      'ordering_type_enum' => AdNetworkAnalyticsSyncQueryResultOrderingTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adnetworkanalytics',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdNetworkAnalyticsResults(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'query_ids' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adnetworkanalytics_results',\n      new AdNetworkAnalyticsAsyncQueryResult(),\n      'EDGE',\n      AdNetworkAnalyticsAsyncQueryResult::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAemAttribution(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'advertiser_ids' => 'list<string>',\n      'fb_content_data' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/aem_attribution',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAemConversionConfigs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'advertiser_ids' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/aem_conversion_configs',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAemConversionFilter(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'catalog_id' => 'string',\n      'fb_content_ids' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/aem_conversion_filter',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAemConversion(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'aem_conversions' => 'list<map>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/aem_conversions',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAemSkanReadiness(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'app_id' => 'int',\n      'is_aem_ready' => 'bool',\n      'is_app_aem_ready' => 'bool',\n      'is_skan_ready' => 'bool',\n      'message' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/aem_skan_readiness',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAgencies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/agencies',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAggregateRevenue(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ecpms' => 'list<string>',\n      'query_ids' => 'list<string>',\n      'request_id' => 'string',\n      'sync_api' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/aggregate_revenue',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAndroidDialogConfigs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/android_dialog_configs',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAppCapiSettings(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/app_capi_settings',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAppEventTypes(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/app_event_types',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAppIndexing(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'app_version' => 'string',\n      'device_session_id' => 'string',\n      'extra_info' => 'string',\n      'platform' => 'platform_enum',\n      'request_type' => 'request_type_enum',\n      'tree' => 'map',\n    );\n    $enums = array(\n      'platform_enum' => ApplicationPlatformValues::getInstance()->getValues(),\n      'request_type_enum' => ApplicationRequestTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/app_indexing',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAppIndexingSession(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'device_session_id' => 'string',\n      'extinfo' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/app_indexing_session',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAppInstalledGroups(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'group_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/app_installed_groups',\n      new Group(),\n      'EDGE',\n      Group::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAppPushDeviceToken(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'device_id' => 'string',\n      'device_token' => 'string',\n      'platform' => 'platform_enum',\n    );\n    $enums = array(\n      'platform_enum' => ApplicationPlatformValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/app_push_device_token',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAppAssets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/appassets',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAsset(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset' => 'file',\n      'comment' => 'string',\n      'type' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/assets',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAuthorizedAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/authorized_adaccounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getButtonAutoDetectionDeviceSelection(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'device_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/button_auto_detection_device_selection',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCloudbridgeSettings(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/cloudbridge_settings',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCodelessEventMapping(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'mappings' => 'list<map>',\n      'mutation_method' => 'mutation_method_enum',\n      'platform' => 'platform_enum',\n      'post_method' => 'post_method_enum',\n    );\n    $enums = array(\n      'mutation_method_enum' => ApplicationMutationMethodValues::getInstance()->getValues(),\n      'platform_enum' => ApplicationPlatformValues::getInstance()->getValues(),\n      'post_method_enum' => ApplicationPostMethodValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/codeless_event_mappings',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getDaChecks(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'checks' => 'list<string>',\n      'connection_method' => 'connection_method_enum',\n    );\n    $enums = array(\n      'connection_method_enum' => DACheckConnectionMethodValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/da_checks',\n      new DACheck(),\n      'EDGE',\n      DACheck::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getEvents(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'include_canceled' => 'bool',\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'type_enum' => EventTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/events',\n      new Event(),\n      'EDGE',\n      Event::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInsightsPushSchedule(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/insights_push_schedule',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getIosDialogConfigs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ios_dialog_configs',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLinkedDataset(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/linked_dataset',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createMmpAuditing(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'advertiser_id' => 'string',\n      'attribution' => 'string',\n      'attribution_model' => 'string',\n      'auditing_token' => 'string',\n      'click_attr_window' => 'unsigned int',\n      'custom_events' => 'list<Object>',\n      'decline_reason' => 'string',\n      'event' => 'string',\n      'event_reported_time' => 'unsigned int',\n      'fb_ad_id' => 'unsigned int',\n      'fb_click_time' => 'unsigned int',\n      'fb_view_time' => 'unsigned int',\n      'is_fb' => 'bool',\n      'used_install_referrer' => 'bool',\n      'view_attr_window' => 'unsigned int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/mmp_auditing',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getMobileSdkGk(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'device_id' => 'string',\n      'extinfo' => 'Object',\n      'os_version' => 'string',\n      'platform' => 'platform_enum',\n      'sdk_version' => 'string',\n    );\n    $enums = array(\n      'platform_enum' => array(\n        'ANDROID',\n        'IOS',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/mobile_sdk_gk',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getMonetizedDigitalStoreObjects(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/monetized_digital_store_objects',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createMonetizedDigitalStoreObject(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'content_id' => 'string',\n      'store' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/monetized_digital_store_objects',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getObjectTypes(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/object_types',\n      new NullNode(),\n      'EDGE',\n      NullNode::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createOccludesPopup(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'flash' => 'bool',\n      'unity' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/occludespopups',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPageActivity(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'advertiser_tracking_enabled' => 'bool',\n      'application_tracking_enabled' => 'bool',\n      'custom_events' => 'list<Object>',\n      'logging_source' => 'logging_source_enum',\n      'logging_target' => 'logging_target_enum',\n      'page_id' => 'unsigned int',\n      'page_scoped_user_id' => 'unsigned int',\n    );\n    $enums = array(\n      'logging_source_enum' => ApplicationLoggingSourceValues::getInstance()->getValues(),\n      'logging_target_enum' => ApplicationLoggingTargetValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/page_activities',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPaymentCurrency(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'currency_url' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/payment_currencies',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPermissions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'android_key_hash' => 'string',\n      'ios_bundle_id' => 'string',\n      'permission' => 'list<Permission>',\n      'proxied_app_id' => 'int',\n      'status' => 'list<status_enum>',\n    );\n    $enums = array(\n      'status_enum' => array(\n        'live',\n        'unapproved',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/permissions',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getProducts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'product_ids' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/products',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPurchases(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/purchases',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getRoles(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/roles',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSubscribedDomains(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/subscribed_domains',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createSubscribedDomain(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'subscribe' => 'list<string>',\n      'unsubscribe' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/subscribed_domains',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSubscribedDomainsPhishing(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/subscribed_domains_phishing',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createSubscribedDomainsPhishing(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'subscribe' => 'list<string>',\n      'unsubscribe' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/subscribed_domains_phishing',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSubscriptions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'fields' => 'list<string>',\n      'object' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/subscriptions',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createSubscription(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'callback_url' => 'string',\n      'fields' => 'list<string>',\n      'include_values' => 'bool',\n      'object' => 'string',\n      'verify_token' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/subscriptions',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createUpload(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'file_length' => 'unsigned int',\n      'file_name' => 'Object',\n      'file_type' => 'Object',\n      'session_type' => 'session_type_enum',\n    );\n    $enums = array(\n      'session_type_enum' => array(\n        'attachment',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/uploads',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'advertiser_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Application(),\n      'NODE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'allow_cycle_app_secret' => 'bool',\n      'an_platforms' => 'list<an_platforms_enum>',\n      'app_domains' => 'list<string>',\n      'app_name' => 'string',\n      'app_type' => 'bool',\n      'auth_dialog_headline' => 'string',\n      'auth_dialog_perms_explanation' => 'string',\n      'auth_referral_default_activity_privacy' => 'string',\n      'auth_referral_enabled' => 'bool',\n      'auth_referral_extended_perms' => 'list<string>',\n      'auth_referral_friend_perms' => 'list<string>',\n      'auth_referral_response_type' => 'string',\n      'auth_referral_user_perms' => 'list<string>',\n      'canvas_fluid_height' => 'bool',\n      'canvas_fluid_width' => 'bool',\n      'canvas_url' => 'string',\n      'contact_email' => 'string',\n      'deauth_callback_url' => 'string',\n      'mobile_web_url' => 'string',\n      'namespace' => 'string',\n      'page_tab_default_name' => 'string',\n      'privacy_policy_url' => 'string',\n      'restrictions' => 'string',\n      'secure_canvas_url' => 'string',\n      'secure_page_tab_url' => 'string',\n      'server_ip_whitelist' => 'list<string>',\n      'terms_of_service_url' => 'string',\n      'url_scheme_suffix' => 'string',\n      'user_support_email' => 'string',\n      'user_support_url' => 'string',\n      'website_url' => 'string',\n    );\n    $enums = array(\n      'an_platforms_enum' => ApplicationAnPlatformsValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new Application(),\n      'NODE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 1593}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AppRequestFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AppRequest extends AbstractCrudObject {\n\n  /**\n   * @return AppRequestFields\n   */\n  public static function getFieldsEnum() {\n    return AppRequestFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ids' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AppRequest(),\n      'NODE',\n      AppRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 105}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AppRequestFormerRecipientFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AppRequestFormerRecipient extends AbstractCrudObject {\n\n  /**\n   * @return AppRequestFormerRecipientFields\n   */\n  public static function getFieldsEnum() {\n    return AppRequestFormerRecipientFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AREffectsBatchStatusFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AREffectsBatchStatus extends AbstractObject {\n\n  /**\n   * @return AREffectsBatchStatusFields\n   */\n  public static function getFieldsEnum() {\n    return AREffectsBatchStatusFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AssignedUserFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AssignedUser extends AbstractCrudObject {\n\n  /**\n   * @return AssignedUserFields\n   */\n  public static function getFieldsEnum() {\n    return AssignedUserFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AsyncRequestFields;\nuse FacebookAds\\Object\\Values\\AsyncRequestStatusValues;\nuse FacebookAds\\Object\\Values\\AsyncRequestTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AsyncRequest extends AbstractCrudObject {\n\n  /**\n   * @return AsyncRequestFields\n   */\n  public static function getFieldsEnum() {\n    return AsyncRequestFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Status'] = AsyncRequestStatusValues::getInstance()->getValues();\n    $ref_enums['Type'] = AsyncRequestTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AsyncSessionFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AsyncSession extends AbstractCrudObject {\n\n  /**\n   * @return AsyncSessionFields\n   */\n  public static function getFieldsEnum() {\n    return AsyncSessionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AsyncSession(),\n      'NODE',\n      AsyncSession::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AttributionSpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AttributionSpec extends AbstractObject {\n\n  /**\n   * @return AttributionSpecFields\n   */\n  public static function getFieldsEnum() {\n    return AttributionSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AudiencePermissionForActionsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AudiencePermissionForActions extends AbstractObject {\n\n  /**\n   * @return AudiencePermissionForActionsFields\n   */\n  public static function getFieldsEnum() {\n    return AudiencePermissionForActionsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AudioCopyrightFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AudioCopyright extends AbstractCrudObject {\n\n  /**\n   * @return AudioCopyrightFields\n   */\n  public static function getFieldsEnum() {\n    return AudioCopyrightFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getUpdateRecords(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/update_records',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AudioCopyright(),\n      'NODE',\n      AudioCopyright::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 104}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\AutomotiveModelFields;\nuse FacebookAds\\Object\\Values\\AutomotiveModelImageFetchStatusValues;\nuse FacebookAds\\Object\\Values\\AutomotiveModelVisibilityValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AutomotiveModel extends AbstractCrudObject {\n\n  /**\n   * @return AutomotiveModelFields\n   */\n  public static function getFieldsEnum() {\n    return AutomotiveModelFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ImageFetchStatus'] = AutomotiveModelImageFetchStatusValues::getInstance()->getValues();\n    $ref_enums['Visibility'] = AutomotiveModelVisibilityValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAugmentedRealitiesMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/augmented_realities_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getChannelsToIntegrityStatus(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/channels_to_integrity_status',\n      new CatalogItemChannelsToIntegrityStatus(),\n      'EDGE',\n      CatalogItemChannelsToIntegrityStatus::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideosMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/videos_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new AutomotiveModel(),\n      'NODE',\n      AutomotiveModel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 154}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\BrandRequestFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BrandRequest extends AbstractCrudObject {\n\n  /**\n   * @return BrandRequestFields\n   */\n  public static function getFieldsEnum() {\n    return BrandRequestFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new BrandRequest(),\n      'NODE',\n      BrandRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\BrandSafetyBlockListUsageFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BrandSafetyBlockListUsage extends AbstractObject {\n\n  /**\n   * @return BrandSafetyBlockListUsageFields\n   */\n  public static function getFieldsEnum() {\n    return BrandSafetyBlockListUsageFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\BroadTargetingCategoriesFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BroadTargetingCategories extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'broadtargetingcategories';\n  }\n\n  /**\n   * @return BroadTargetingCategoriesFields\n   */\n  public static function getFieldsEnum() {\n    return BroadTargetingCategoriesFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 65}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\BusinessFields;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultAggregationPeriodValues;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultBreakdownsValues;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultMetricsValues;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultOrderingColumnValues;\nuse FacebookAds\\Object\\Values\\AdNetworkAnalyticsSyncQueryResultOrderingTypeValues;\nuse FacebookAds\\Object\\Values\\AdStudyTypeValues;\nuse FacebookAds\\Object\\Values\\AdsPixelSortByValues;\nuse FacebookAds\\Object\\Values\\BusinessActionSourceValues;\nuse FacebookAds\\Object\\Values\\BusinessAssetSharingAgreementRequestStatusValues;\nuse FacebookAds\\Object\\Values\\BusinessPagePermittedTasksValues;\nuse FacebookAds\\Object\\Values\\BusinessPermittedTasksValues;\nuse FacebookAds\\Object\\Values\\BusinessSubverticalV2Values;\nuse FacebookAds\\Object\\Values\\BusinessSurveyBusinessTypeValues;\nuse FacebookAds\\Object\\Values\\BusinessTwoFactorTypeValues;\nuse FacebookAds\\Object\\Values\\BusinessUserRoleValues;\nuse FacebookAds\\Object\\Values\\BusinessVerticalV2Values;\nuse FacebookAds\\Object\\Values\\BusinessVerticalValues;\nuse FacebookAds\\Object\\Values\\CPASCollaborationRequestRequesterAgencyOrBrandValues;\nuse FacebookAds\\Object\\Values\\CustomConversionCustomEventTypeValues;\nuse FacebookAds\\Object\\Values\\OmegaCustomerTrxTypeValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogVerticalValues;\nuse FacebookAds\\Object\\Values\\ProfilePictureSourceBreakingChangeValues;\nuse FacebookAds\\Object\\Values\\ProfilePictureSourceTypeValues;\nuse FacebookAds\\Object\\Values\\SystemUserRoleValues;\nuse FacebookAds\\Object\\Values\\WhatsAppBusinessPreVerifiedPhoneNumberCodeVerificationStatusValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Business extends AbstractCrudObject {\n\n  /**\n   * @return BusinessFields\n   */\n  public static function getFieldsEnum() {\n    return BusinessFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['TwoFactorType'] = BusinessTwoFactorTypeValues::getInstance()->getValues();\n    $ref_enums['Vertical'] = BusinessVerticalValues::getInstance()->getValues();\n    $ref_enums['PermittedTasks'] = BusinessPermittedTasksValues::getInstance()->getValues();\n    $ref_enums['SurveyBusinessType'] = BusinessSurveyBusinessTypeValues::getInstance()->getValues();\n    $ref_enums['PagePermittedTasks'] = BusinessPagePermittedTasksValues::getInstance()->getValues();\n    $ref_enums['SubverticalV2'] = BusinessSubverticalV2Values::getInstance()->getValues();\n    $ref_enums['VerticalV2'] = BusinessVerticalV2Values::getInstance()->getValues();\n    $ref_enums['ActionSource'] = BusinessActionSourceValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function createAccessToken(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'app_id' => 'string',\n      'fbe_external_business_id' => 'string',\n      'scope' => 'list<Permission>',\n      'system_user_name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/access_token',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adaccount_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/ad_accounts',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdStudies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ad_studies',\n      new AdStudy(),\n      'EDGE',\n      AdStudy::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdStudy(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'cells' => 'list<Object>',\n      'client_business' => 'string',\n      'confidence_level' => 'float',\n      'cooldown_start_time' => 'int',\n      'description' => 'string',\n      'end_time' => 'int',\n      'name' => 'string',\n      'objectives' => 'list<Object>',\n      'observation_end_time' => 'int',\n      'start_time' => 'int',\n      'type' => 'type_enum',\n      'viewers' => 'list<int>',\n    );\n    $enums = array(\n      'type_enum' => AdStudyTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/ad_studies',\n      new AdStudy(),\n      'EDGE',\n      AdStudy::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdAccount(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_account_created_from_bm_flag' => 'bool',\n      'currency' => 'string',\n      'end_advertiser' => 'Object',\n      'funding_id' => 'string',\n      'invoice' => 'bool',\n      'invoice_group_id' => 'string',\n      'invoicing_emails' => 'list<string>',\n      'io' => 'bool',\n      'media_agency' => 'string',\n      'name' => 'string',\n      'partner' => 'string',\n      'po_number' => 'string',\n      'timezone_id' => 'unsigned int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adaccount',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAddPhoneNumber(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'phone_number' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/add_phone_numbers',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdNetworkApplication(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adnetwork_applications',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdNetworkAnalytics(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'aggregation_period' => 'aggregation_period_enum',\n      'breakdowns' => 'list<breakdowns_enum>',\n      'filters' => 'list<map>',\n      'limit' => 'unsigned int',\n      'metrics' => 'list<metrics_enum>',\n      'ordering_column' => 'ordering_column_enum',\n      'ordering_type' => 'ordering_type_enum',\n      'since' => 'datetime',\n      'until' => 'datetime',\n    );\n    $enums = array(\n      'aggregation_period_enum' => AdNetworkAnalyticsSyncQueryResultAggregationPeriodValues::getInstance()->getValues(),\n      'breakdowns_enum' => AdNetworkAnalyticsSyncQueryResultBreakdownsValues::getInstance()->getValues(),\n      'metrics_enum' => AdNetworkAnalyticsSyncQueryResultMetricsValues::getInstance()->getValues(),\n      'ordering_column_enum' => AdNetworkAnalyticsSyncQueryResultOrderingColumnValues::getInstance()->getValues(),\n      'ordering_type_enum' => AdNetworkAnalyticsSyncQueryResultOrderingTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adnetworkanalytics',\n      new AdNetworkAnalyticsSyncQueryResult(),\n      'EDGE',\n      AdNetworkAnalyticsSyncQueryResult::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdNetworkAnalytic(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'aggregation_period' => 'aggregation_period_enum',\n      'breakdowns' => 'list<breakdowns_enum>',\n      'filters' => 'list<Object>',\n      'limit' => 'int',\n      'metrics' => 'list<metrics_enum>',\n      'ordering_column' => 'ordering_column_enum',\n      'ordering_type' => 'ordering_type_enum',\n      'since' => 'datetime',\n      'until' => 'datetime',\n    );\n    $enums = array(\n      'aggregation_period_enum' => AdNetworkAnalyticsSyncQueryResultAggregationPeriodValues::getInstance()->getValues(),\n      'breakdowns_enum' => AdNetworkAnalyticsSyncQueryResultBreakdownsValues::getInstance()->getValues(),\n      'metrics_enum' => AdNetworkAnalyticsSyncQueryResultMetricsValues::getInstance()->getValues(),\n      'ordering_column_enum' => AdNetworkAnalyticsSyncQueryResultOrderingColumnValues::getInstance()->getValues(),\n      'ordering_type_enum' => AdNetworkAnalyticsSyncQueryResultOrderingTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adnetworkanalytics',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdNetworkAnalyticsResults(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'query_ids' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adnetworkanalytics_results',\n      new AdNetworkAnalyticsAsyncQueryResult(),\n      'EDGE',\n      AdNetworkAnalyticsAsyncQueryResult::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdsReportingMmmReports(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'filtering' => 'list<map>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ads_reporting_mmm_reports',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdsReportingMmmSchedulers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ads_reporting_mmm_schedulers',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdsPixels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'id_filter' => 'string',\n      'name_filter' => 'string',\n      'sort_by' => 'sort_by_enum',\n    );\n    $enums = array(\n      'sort_by_enum' => AdsPixelSortByValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adspixels',\n      new AdsPixel(),\n      'EDGE',\n      AdsPixel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdsPixel(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'is_crm' => 'bool',\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adspixels',\n      new AdsPixel(),\n      'EDGE',\n      AdsPixel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteAgencies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/agencies',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAgencies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/agencies',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAnPlacements(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/an_placements',\n      new AdPlacement(),\n      'EDGE',\n      AdPlacement::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createBlockListDraft(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'publisher_urls_file' => 'file',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/block_list_drafts',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getBusinessAssetGroups(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/business_asset_groups',\n      new BusinessAssetGroup(),\n      'EDGE',\n      BusinessAssetGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getBusinessInvoices(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'end_date' => 'string',\n      'invoice_id' => 'string',\n      'issue_end_date' => 'string',\n      'issue_start_date' => 'string',\n      'root_id' => 'unsigned int',\n      'start_date' => 'string',\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'type_enum' => OmegaCustomerTrxTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/business_invoices',\n      new OmegaCustomerTrx(),\n      'EDGE',\n      OmegaCustomerTrx::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getBusinessUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/business_users',\n      new BusinessUser(),\n      'EDGE',\n      BusinessUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createBusinessUser(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'email' => 'string',\n      'role' => 'role_enum',\n    );\n    $enums = array(\n      'role_enum' => BusinessUserRoleValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/business_users',\n      new BusinessUser(),\n      'EDGE',\n      BusinessUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getBusinessProjects(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/businessprojects',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createClaimCustomConversion(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'custom_conversion_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/claim_custom_conversions',\n      new CustomConversion(),\n      'EDGE',\n      CustomConversion::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getClientAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'search_query' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/client_ad_accounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getClientApps(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/client_apps',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createClientApp(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'app_id' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/client_apps',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getClientOffsiteSignalContainerBusinessObjects(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/client_offsite_signal_container_business_objects',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getClientPages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/client_pages',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createClientPage(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'page_id' => 'int',\n      'permitted_tasks' => 'list<permitted_tasks_enum>',\n    );\n    $enums = array(\n      'permitted_tasks_enum' => BusinessPermittedTasksValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/client_pages',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getClientPixels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/client_pixels',\n      new AdsPixel(),\n      'EDGE',\n      AdsPixel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getClientProductCatalogs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/client_product_catalogs',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getClientWhatsAppBusinessAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/client_whatsapp_business_accounts',\n      new WhatsAppBusinessAccount(),\n      'EDGE',\n      WhatsAppBusinessAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteClients(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/clients',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getClients(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/clients',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCollaborativeAdsCollaborationRequests(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'status' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/collaborative_ads_collaboration_requests',\n      new CPASCollaborationRequest(),\n      'EDGE',\n      CPASCollaborationRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCollaborativeAdsCollaborationRequest(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'brands' => 'list<string>',\n      'contact_email' => 'string',\n      'contact_first_name' => 'string',\n      'contact_last_name' => 'string',\n      'phone_number' => 'string',\n      'receiver_business' => 'string',\n      'requester_agency_or_brand' => 'requester_agency_or_brand_enum',\n      'sender_client_business' => 'string',\n    );\n    $enums = array(\n      'requester_agency_or_brand_enum' => CPASCollaborationRequestRequesterAgencyOrBrandValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/collaborative_ads_collaboration_requests',\n      new CPASCollaborationRequest(),\n      'EDGE',\n      CPASCollaborationRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCollaborativeAdsSuggestedPartners(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/collaborative_ads_suggested_partners',\n      new CPASAdvertiserPartnershipRecommendation(),\n      'EDGE',\n      CPASAdvertiserPartnershipRecommendation::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCommerceMerchantSettings(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/commerce_merchant_settings',\n      new CommerceMerchantSettings(),\n      'EDGE',\n      CommerceMerchantSettings::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCpasBusinessSetupConfig(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/cpas_business_setup_config',\n      new CPASBusinessSetupConfig(),\n      'EDGE',\n      CPASBusinessSetupConfig::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCpasBusinessSetupConfig(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'accepted_collab_ads_tos' => 'bool',\n      'ad_accounts' => 'list<string>',\n      'business_capabilities_status' => 'map',\n      'capabilities_compliance_status' => 'map',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/cpas_business_setup_config',\n      new CPASBusinessSetupConfig(),\n      'EDGE',\n      CPASBusinessSetupConfig::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCpasMerchantConfig(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/cpas_merchant_config',\n      new CPASMerchantConfig(),\n      'EDGE',\n      CPASMerchantConfig::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCreditCards(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/creditcards',\n      new CreditCard(),\n      'EDGE',\n      CreditCard::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCustomConversion(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'advanced_rule' => 'string',\n      'custom_event_type' => 'custom_event_type_enum',\n      'default_conversion_value' => 'float',\n      'description' => 'string',\n      'event_source_id' => 'string',\n      'name' => 'string',\n      'rule' => 'string',\n    );\n    $enums = array(\n      'custom_event_type_enum' => CustomConversionCustomEventTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/customconversions',\n      new CustomConversion(),\n      'EDGE',\n      CustomConversion::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createDraftNegativeKeywordList(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'negative_keyword_list_file' => 'file',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/draft_negative_keyword_lists',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getEventSourceGroups(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/event_source_groups',\n      new EventSourceGroup(),\n      'EDGE',\n      EventSourceGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createEventSourceGroup(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'event_sources' => 'list<string>',\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/event_source_groups',\n      new EventSourceGroup(),\n      'EDGE',\n      EventSourceGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getExtendedCreditApplications(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'only_show_pending' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/extendedcreditapplications',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getExtendedCredits(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'order_by_is_owned_credential' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/extendedcredits',\n      new ExtendedCredit(),\n      'EDGE',\n      ExtendedCredit::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInitiatedAudienceSharingRequests(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'recipient_id' => 'string',\n      'request_status' => 'request_status_enum',\n    );\n    $enums = array(\n      'request_status_enum' => BusinessAssetSharingAgreementRequestStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/initiated_audience_sharing_requests',\n      new BusinessAssetSharingAgreement(),\n      'EDGE',\n      BusinessAssetSharingAgreement::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'instagram_account' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/instagram_accounts',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/instagram_accounts',\n      new InstagramUser(),\n      'EDGE',\n      InstagramUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInstagramBusinessAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/instagram_business_accounts',\n      new IGUser(),\n      'EDGE',\n      IGUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteManagedBusinesses(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'existing_client_business_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/managed_businesses',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createManagedBusiness(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'child_business_external_id' => 'string',\n      'existing_client_business_id' => 'string',\n      'name' => 'string',\n      'sales_rep_email' => 'string',\n      'survey_business_type' => 'survey_business_type_enum',\n      'survey_num_assets' => 'unsigned int',\n      'survey_num_people' => 'unsigned int',\n      'timezone_id' => 'unsigned int',\n      'vertical' => 'vertical_enum',\n    );\n    $enums = array(\n      'survey_business_type_enum' => BusinessSurveyBusinessTypeValues::getInstance()->getValues(),\n      'vertical_enum' => BusinessVerticalValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/managed_businesses',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createManagedPartnerBusinessSetup(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'active_ad_account_id' => 'string',\n      'active_page_id' => 'int',\n      'partner_facebook_page_url' => 'string',\n      'partner_registration_countries' => 'list<string>',\n      'seller_email_address' => 'string',\n      'seller_external_website_url' => 'string',\n      'template' => 'list<map>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/managed_partner_business_setup',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteManagedPartnerBusinesses(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'child_business_external_id' => 'string',\n      'child_business_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/managed_partner_businesses',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createManagedPartnerBusiness(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_account_currency' => 'string',\n      'catalog_id' => 'string',\n      'child_business_external_id' => 'string',\n      'credit_limit' => 'unsigned int',\n      'line_of_credit_id' => 'string',\n      'name' => 'string',\n      'no_ad_account' => 'bool',\n      'page_name' => 'string',\n      'page_profile_image_url' => 'string',\n      'partner_facebook_page_url' => 'string',\n      'partner_registration_countries' => 'list<string>',\n      'sales_rep_email' => 'string',\n      'seller_external_website_url' => 'string',\n      'seller_targeting_countries' => 'list<string>',\n      'survey_business_type' => 'survey_business_type_enum',\n      'survey_num_assets' => 'unsigned int',\n      'survey_num_people' => 'unsigned int',\n      'timezone_id' => 'unsigned int',\n      'vertical' => 'vertical_enum',\n    );\n    $enums = array(\n      'survey_business_type_enum' => array(\n        'ADVERTISER',\n        'AGENCY',\n        'APP_DEVELOPER',\n        'PUBLISHER',\n      ),\n      'vertical_enum' => array(\n        'ADVERTISING',\n        'AUTOMOTIVE',\n        'CONSUMER_PACKAGED_GOODS',\n        'ECOMMERCE',\n        'EDUCATION',\n        'ENERGY_AND_UTILITIES',\n        'ENTERTAINMENT_AND_MEDIA',\n        'FINANCIAL_SERVICES',\n        'GAMING',\n        'GOVERNMENT_AND_POLITICS',\n        'HEALTH',\n        'LUXURY',\n        'MARKETING',\n        'NON_PROFIT',\n        'ORGANIZATIONS_AND_ASSOCIATIONS',\n        'OTHER',\n        'PROFESSIONAL_SERVICES',\n        'RESTAURANT',\n        'RETAIL',\n        'TECHNOLOGY',\n        'TELECOM',\n        'TRAVEL',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/managed_partner_businesses',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getNegativeKeywordLists(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/negative_keyword_lists',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOfflineConversionDataSets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/offline_conversion_data_sets',\n      new OfflineConversionDataSet(),\n      'EDGE',\n      OfflineConversionDataSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createOfflineConversionDataSet(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'auto_assign_to_new_accounts_only' => 'bool',\n      'description' => 'string',\n      'enable_auto_assign_to_accounts' => 'bool',\n      'is_mta_use' => 'bool',\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/offline_conversion_data_sets',\n      new OfflineConversionDataSet(),\n      'EDGE',\n      OfflineConversionDataSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOpenBridgeConfigurations(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/openbridge_configurations',\n      new OpenBridgeConfiguration(),\n      'EDGE',\n      OpenBridgeConfiguration::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createOpenBridgeConfiguration(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'access_key' => 'string',\n      'active' => 'bool',\n      'endpoint' => 'string',\n      'host_business_id' => 'unsigned int',\n      'host_external_id' => 'string',\n      'pixel_id' => 'unsigned int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/openbridge_configurations',\n      new OpenBridgeConfiguration(),\n      'EDGE',\n      OpenBridgeConfiguration::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOwnedAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'search_query' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/owned_ad_accounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createOwnedAdAccount(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adaccount_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/owned_ad_accounts',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOwnedApps(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/owned_apps',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createOwnedApp(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'app_id' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/owned_apps',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteOwnedBusinesses(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'client_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/owned_businesses',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOwnedBusinesses(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'child_business_external_id' => 'string',\n      'client_user_id' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/owned_businesses',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createOwnedBusiness(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'child_business_external_id' => 'string',\n      'name' => 'string',\n      'page_permitted_tasks' => 'list<page_permitted_tasks_enum>',\n      'sales_rep_email' => 'string',\n      'shared_page_id' => 'string',\n      'survey_business_type' => 'survey_business_type_enum',\n      'survey_num_assets' => 'unsigned int',\n      'survey_num_people' => 'unsigned int',\n      'timezone_id' => 'unsigned int',\n      'vertical' => 'vertical_enum',\n    );\n    $enums = array(\n      'page_permitted_tasks_enum' => BusinessPagePermittedTasksValues::getInstance()->getValues(),\n      'survey_business_type_enum' => BusinessSurveyBusinessTypeValues::getInstance()->getValues(),\n      'vertical_enum' => BusinessVerticalValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/owned_businesses',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOwnedInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/owned_instagram_accounts',\n      new InstagramUser(),\n      'EDGE',\n      InstagramUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOwnedOffsiteSignalContainerBusinessObjects(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/owned_offsite_signal_container_business_objects',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOwnedPages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/owned_pages',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createOwnedPage(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'code' => 'string',\n      'page_id' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/owned_pages',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOwnedPixels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/owned_pixels',\n      new AdsPixel(),\n      'EDGE',\n      AdsPixel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOwnedProductCatalogs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/owned_product_catalogs',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createOwnedProductCatalog(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'catalog_segment_filter' => 'Object',\n      'catalog_segment_product_set_id' => 'string',\n      'da_display_settings' => 'Object',\n      'destination_catalog_settings' => 'map',\n      'flight_catalog_settings' => 'map',\n      'name' => 'string',\n      'parent_catalog_id' => 'string',\n      'partner_integration' => 'map',\n      'store_catalog_settings' => 'map',\n      'vertical' => 'vertical_enum',\n    );\n    $enums = array(\n      'vertical_enum' => ProductCatalogVerticalValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/owned_product_catalogs',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOwnedWhatsAppBusinessAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/owned_whatsapp_business_accounts',\n      new WhatsAppBusinessAccount(),\n      'EDGE',\n      WhatsAppBusinessAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deletePages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'page_id' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/pages',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPartnerPremiumOption(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'catalog_segment_id' => 'string',\n      'enable_basket_insight' => 'bool',\n      'enable_extended_audience_retargeting' => 'bool',\n      'partner_business_id' => 'string',\n      'retailer_custom_audience_config' => 'map',\n      'vendor_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/partner_premium_options',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPendingClientAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/pending_client_ad_accounts',\n      new BusinessAdAccountRequest(),\n      'EDGE',\n      BusinessAdAccountRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPendingClientApps(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/pending_client_apps',\n      new BusinessApplicationRequest(),\n      'EDGE',\n      BusinessApplicationRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPendingClientPages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/pending_client_pages',\n      new BusinessPageRequest(),\n      'EDGE',\n      BusinessPageRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPendingOwnedAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/pending_owned_ad_accounts',\n      new BusinessAdAccountRequest(),\n      'EDGE',\n      BusinessAdAccountRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPendingOwnedPages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/pending_owned_pages',\n      new BusinessPageRequest(),\n      'EDGE',\n      BusinessPageRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPendingSharedOffsiteSignalContainerBusinessObjects(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/pending_shared_offsite_signal_container_business_objects',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPendingUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'email' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/pending_users',\n      new BusinessRoleRequest(),\n      'EDGE',\n      BusinessRoleRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPicture(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'breaking_change' => 'breaking_change_enum',\n      'height' => 'int',\n      'redirect' => 'bool',\n      'type' => 'type_enum',\n      'width' => 'int',\n    );\n    $enums = array(\n      'breaking_change_enum' => ProfilePictureSourceBreakingChangeValues::getInstance()->getValues(),\n      'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/picture',\n      new ProfilePictureSource(),\n      'EDGE',\n      ProfilePictureSource::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPixelTo(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/pixel_tos',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPreVerifiedNumbers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'code_verification_status' => 'code_verification_status_enum',\n      'phone_number' => 'string',\n    );\n    $enums = array(\n      'code_verification_status_enum' => WhatsAppBusinessPreVerifiedPhoneNumberCodeVerificationStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/preverified_numbers',\n      new WhatsAppBusinessPreVerifiedPhoneNumber(),\n      'EDGE',\n      WhatsAppBusinessPreVerifiedPhoneNumber::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getReceivedAudienceSharingRequests(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'initiator_id' => 'string',\n      'request_status' => 'request_status_enum',\n    );\n    $enums = array(\n      'request_status_enum' => BusinessAssetSharingAgreementRequestStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/received_audience_sharing_requests',\n      new BusinessAssetSharingAgreement(),\n      'EDGE',\n      BusinessAssetSharingAgreement::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createSetupManagedPartnerAdAccount(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'credit_line_id' => 'string',\n      'marketplace_business_id' => 'string',\n      'subvertical_v2' => 'subvertical_v2_enum',\n      'vendor_id' => 'string',\n      'vertical_v2' => 'vertical_v2_enum',\n    );\n    $enums = array(\n      'subvertical_v2_enum' => BusinessSubverticalV2Values::getInstance()->getValues(),\n      'vertical_v2_enum' => BusinessVerticalV2Values::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/setup_managed_partner_adaccounts',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSystemUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/system_users',\n      new SystemUser(),\n      'EDGE',\n      SystemUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createSystemUser(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'name' => 'string',\n      'role' => 'role_enum',\n      'system_user_id' => 'int',\n    );\n    $enums = array(\n      'role_enum' => SystemUserRoleValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/system_users',\n      new SystemUser(),\n      'EDGE',\n      SystemUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getThirdPartyMeasurementReportDataset(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/third_party_measurement_report_dataset',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Business(),\n      'NODE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'name' => 'string',\n      'primary_page' => 'string',\n      'timezone_id' => 'unsigned int',\n      'two_factor_type' => 'two_factor_type_enum',\n      'vertical' => 'vertical_enum',\n    );\n    $enums = array(\n      'two_factor_type_enum' => BusinessTwoFactorTypeValues::getInstance()->getValues(),\n      'vertical_enum' => BusinessVerticalValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new Business(),\n      'NODE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 2594}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\BusinessAdAccountRequestFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessAdAccountRequest extends AbstractCrudObject {\n\n  /**\n   * @return BusinessAdAccountRequestFields\n   */\n  public static function getFieldsEnum() {\n    return BusinessAdAccountRequestFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\BusinessApplicationRequestFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessApplicationRequest extends AbstractCrudObject {\n\n  /**\n   * @return BusinessApplicationRequestFields\n   */\n  public static function getFieldsEnum() {\n    return BusinessApplicationRequestFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\BusinessAssetGroupFields;\nuse FacebookAds\\Object\\Values\\BusinessAssetGroupAdaccountTasksValues;\nuse FacebookAds\\Object\\Values\\BusinessAssetGroupOfflineConversionDataSetTasksValues;\nuse FacebookAds\\Object\\Values\\BusinessAssetGroupPageTasksValues;\nuse FacebookAds\\Object\\Values\\BusinessAssetGroupPixelTasksValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessAssetGroup extends AbstractCrudObject {\n\n  /**\n   * @return BusinessAssetGroupFields\n   */\n  public static function getFieldsEnum() {\n    return BusinessAssetGroupFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['AdaccountTasks'] = BusinessAssetGroupAdaccountTasksValues::getInstance()->getValues();\n    $ref_enums['OfflineConversionDataSetTasks'] = BusinessAssetGroupOfflineConversionDataSetTasksValues::getInstance()->getValues();\n    $ref_enums['PageTasks'] = BusinessAssetGroupPageTasksValues::getInstance()->getValues();\n    $ref_enums['PixelTasks'] = BusinessAssetGroupPixelTasksValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function deleteAssignedUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'user' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/assigned_users',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAssignedUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/assigned_users',\n      new AssignedUser(),\n      'EDGE',\n      AssignedUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAssignedUser(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adaccount_tasks' => 'list<adaccount_tasks_enum>',\n      'offline_conversion_data_set_tasks' => 'list<offline_conversion_data_set_tasks_enum>',\n      'page_tasks' => 'list<page_tasks_enum>',\n      'pixel_tasks' => 'list<pixel_tasks_enum>',\n      'user' => 'int',\n    );\n    $enums = array(\n      'adaccount_tasks_enum' => BusinessAssetGroupAdaccountTasksValues::getInstance()->getValues(),\n      'offline_conversion_data_set_tasks_enum' => BusinessAssetGroupOfflineConversionDataSetTasksValues::getInstance()->getValues(),\n      'page_tasks_enum' => BusinessAssetGroupPageTasksValues::getInstance()->getValues(),\n      'pixel_tasks_enum' => BusinessAssetGroupPixelTasksValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/assigned_users',\n      new BusinessAssetGroup(),\n      'EDGE',\n      BusinessAssetGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteContainedAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/contained_adaccounts',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getContainedAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/contained_adaccounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createContainedAdAccount(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/contained_adaccounts',\n      new BusinessAssetGroup(),\n      'EDGE',\n      BusinessAssetGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteContainedApplications(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/contained_applications',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getContainedApplications(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/contained_applications',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createContainedApplication(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/contained_applications',\n      new BusinessAssetGroup(),\n      'EDGE',\n      BusinessAssetGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteContainedCustomConversions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/contained_custom_conversions',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getContainedCustomConversions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/contained_custom_conversions',\n      new CustomConversion(),\n      'EDGE',\n      CustomConversion::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createContainedCustomConversion(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/contained_custom_conversions',\n      new BusinessAssetGroup(),\n      'EDGE',\n      BusinessAssetGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteContainedInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/contained_instagram_accounts',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getContainedInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/contained_instagram_accounts',\n      new InstagramUser(),\n      'EDGE',\n      InstagramUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createContainedInstagramAccount(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/contained_instagram_accounts',\n      new BusinessAssetGroup(),\n      'EDGE',\n      BusinessAssetGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteContainedOfflineConversionDataSets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/contained_offline_conversion_data_sets',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getContainedOfflineConversionDataSets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/contained_offline_conversion_data_sets',\n      new OfflineConversionDataSet(),\n      'EDGE',\n      OfflineConversionDataSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createContainedOfflineConversionDataSet(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/contained_offline_conversion_data_sets',\n      new BusinessAssetGroup(),\n      'EDGE',\n      BusinessAssetGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteContainedPages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/contained_pages',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getContainedPages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/contained_pages',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createContainedPage(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/contained_pages',\n      new BusinessAssetGroup(),\n      'EDGE',\n      BusinessAssetGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteContainedPixels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/contained_pixels',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getContainedPixels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/contained_pixels',\n      new AdsPixel(),\n      'EDGE',\n      AdsPixel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createContainedPixel(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/contained_pixels',\n      new BusinessAssetGroup(),\n      'EDGE',\n      BusinessAssetGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteContainedProductCatalogs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/contained_product_catalogs',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getContainedProductCatalogs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/contained_product_catalogs',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createContainedProductCatalog(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/contained_product_catalogs',\n      new BusinessAssetGroup(),\n      'EDGE',\n      BusinessAssetGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new BusinessAssetGroup(),\n      'NODE',\n      BusinessAssetGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new BusinessAssetGroup(),\n      'NODE',\n      BusinessAssetGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 761}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\BusinessAssetSharingAgreementFields;\nuse FacebookAds\\Object\\Values\\BusinessAssetSharingAgreementRequestStatusValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessAssetSharingAgreement extends AbstractCrudObject {\n\n  /**\n   * @return BusinessAssetSharingAgreementFields\n   */\n  public static function getFieldsEnum() {\n    return BusinessAssetSharingAgreementFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['RequestStatus'] = BusinessAssetSharingAgreementRequestStatusValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new BusinessAssetSharingAgreement(),\n      'NODE',\n      BusinessAssetSharingAgreement::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'request_response' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new BusinessAssetSharingAgreement(),\n      'NODE',\n      BusinessAssetSharingAgreement::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 107}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\BusinessImageFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessImage extends AbstractCrudObject {\n\n  /**\n   * @return BusinessImageFields\n   */\n  public static function getFieldsEnum() {\n    return BusinessImageFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new BusinessImage(),\n      'NODE',\n      BusinessImage::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\BusinessManagedPartnerEligibilityFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessManagedPartnerEligibility extends AbstractObject {\n\n  /**\n   * @return BusinessManagedPartnerEligibilityFields\n   */\n  public static function getFieldsEnum() {\n    return BusinessManagedPartnerEligibilityFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\BusinessOwnedObjectOnBehalfOfRequestFields;\nuse FacebookAds\\Object\\Values\\BusinessOwnedObjectOnBehalfOfRequestStatusValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessOwnedObjectOnBehalfOfRequest extends AbstractCrudObject {\n\n  /**\n   * @return BusinessOwnedObjectOnBehalfOfRequestFields\n   */\n  public static function getFieldsEnum() {\n    return BusinessOwnedObjectOnBehalfOfRequestFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Status'] = BusinessOwnedObjectOnBehalfOfRequestStatusValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new BusinessOwnedObjectOnBehalfOfRequest(),\n      'NODE',\n      BusinessOwnedObjectOnBehalfOfRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 83}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\BusinessPageRequestFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessPageRequest extends AbstractCrudObject {\n\n  /**\n   * @return BusinessPageRequestFields\n   */\n  public static function getFieldsEnum() {\n    return BusinessPageRequestFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\BusinessPartnerPremiumOptionsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessPartnerPremiumOptions extends AbstractObject {\n\n  /**\n   * @return BusinessPartnerPremiumOptionsFields\n   */\n  public static function getFieldsEnum() {\n    return BusinessPartnerPremiumOptionsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\BusinessRoleRequestFields;\nuse FacebookAds\\Object\\Values\\BusinessRoleRequestRoleValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessRoleRequest extends AbstractCrudObject {\n\n  /**\n   * @return BusinessRoleRequestFields\n   */\n  public static function getFieldsEnum() {\n    return BusinessRoleRequestFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Role'] = BusinessRoleRequestRoleValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new BusinessRoleRequest(),\n      'NODE',\n      BusinessRoleRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'role' => 'role_enum',\n    );\n    $enums = array(\n      'role_enum' => BusinessRoleRequestRoleValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new BusinessRoleRequest(),\n      'NODE',\n      BusinessRoleRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 131}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\BusinessUserFields;\nuse FacebookAds\\Object\\Values\\BusinessUserRoleValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessUser extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'business_users';\n  }\n\n  /**\n   * @return BusinessUserFields\n   */\n  public static function getFieldsEnum() {\n    return BusinessUserFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Role'] = BusinessUserRoleValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAssignedAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/assigned_ad_accounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAssignedBusinessAssetGroups(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'contained_asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/assigned_business_asset_groups',\n      new BusinessAssetGroup(),\n      'EDGE',\n      BusinessAssetGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAssignedPages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'pages' => 'list<unsigned int>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/assigned_pages',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAssignedProductCatalogs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/assigned_product_catalogs',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new BusinessUser(),\n      'NODE',\n      BusinessUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'clear_pending_email' => 'bool',\n      'email' => 'string',\n      'first_name' => 'string',\n      'last_name' => 'string',\n      'pending_email' => 'string',\n      'role' => 'role_enum',\n      'title' => 'string',\n    );\n    $enums = array(\n      'role_enum' => BusinessUserRoleValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new BusinessUser(),\n      'NODE',\n      BusinessUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 238}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CampaignFields;\nuse FacebookAds\\Object\\Values\\AdDatePresetValues;\nuse FacebookAds\\Object\\Values\\AdSetDatePresetValues;\nuse FacebookAds\\Object\\Values\\AdSetEffectiveStatusValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsActionAttributionWindowsValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsActionBreakdownsValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsActionReportTimeValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsBreakdownsValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsDatePresetValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsLevelValues;\nuse FacebookAds\\Object\\Values\\AdsInsightsSummaryActionBreakdownsValues;\nuse FacebookAds\\Object\\Values\\CampaignBidStrategyValues;\nuse FacebookAds\\Object\\Values\\CampaignConfiguredStatusValues;\nuse FacebookAds\\Object\\Values\\CampaignDatePresetValues;\nuse FacebookAds\\Object\\Values\\CampaignEffectiveStatusValues;\nuse FacebookAds\\Object\\Values\\CampaignExecutionOptionsValues;\nuse FacebookAds\\Object\\Values\\CampaignObjectiveValues;\nuse FacebookAds\\Object\\Values\\CampaignOperatorValues;\nuse FacebookAds\\Object\\Values\\CampaignSmartPromotionTypeValues;\nuse FacebookAds\\Object\\Values\\CampaignSpecialAdCategoriesValues;\nuse FacebookAds\\Object\\Values\\CampaignSpecialAdCategoryCountryValues;\nuse FacebookAds\\Object\\Values\\CampaignSpecialAdCategoryValues;\nuse FacebookAds\\Object\\Values\\CampaignStatusOptionValues;\nuse FacebookAds\\Object\\Values\\CampaignStatusValues;\nuse FacebookAds\\Object\\Traits\\AdLabelAwareCrudObjectTrait;\nuse FacebookAds\\Object\\Traits\\ObjectValidation;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Campaign extends AbstractArchivableCrudObject {\n\n  use AdLabelAwareCrudObjectTrait;\n  use ObjectValidation;\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'campaigns';\n  }\n\n  /**\n   * @return CampaignFields\n   */\n  public static function getFieldsEnum() {\n    return CampaignFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['BidStrategy'] = CampaignBidStrategyValues::getInstance()->getValues();\n    $ref_enums['ConfiguredStatus'] = CampaignConfiguredStatusValues::getInstance()->getValues();\n    $ref_enums['EffectiveStatus'] = CampaignEffectiveStatusValues::getInstance()->getValues();\n    $ref_enums['Status'] = CampaignStatusValues::getInstance()->getValues();\n    $ref_enums['DatePreset'] = CampaignDatePresetValues::getInstance()->getValues();\n    $ref_enums['ExecutionOptions'] = CampaignExecutionOptionsValues::getInstance()->getValues();\n    $ref_enums['Objective'] = CampaignObjectiveValues::getInstance()->getValues();\n    $ref_enums['SmartPromotionType'] = CampaignSmartPromotionTypeValues::getInstance()->getValues();\n    $ref_enums['SpecialAdCategories'] = CampaignSpecialAdCategoriesValues::getInstance()->getValues();\n    $ref_enums['SpecialAdCategoryCountry'] = CampaignSpecialAdCategoryCountryValues::getInstance()->getValues();\n    $ref_enums['Operator'] = CampaignOperatorValues::getInstance()->getValues();\n    $ref_enums['SpecialAdCategory'] = CampaignSpecialAdCategoryValues::getInstance()->getValues();\n    $ref_enums['StatusOption'] = CampaignStatusOptionValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAdStudies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ad_studies',\n      new AdStudy(),\n      'EDGE',\n      AdStudy::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdLabel(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adlabels' => 'list<Object>',\n      'execution_options' => 'list<execution_options_enum>',\n    );\n    $enums = array(\n      'execution_options_enum' => CampaignExecutionOptionsValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adlabels',\n      new Campaign(),\n      'EDGE',\n      Campaign::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdRulesGoverned(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'pass_evaluation' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adrules_governed',\n      new AdRule(),\n      'EDGE',\n      AdRule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAds(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'date_preset' => 'date_preset_enum',\n      'effective_status' => 'list<string>',\n      'time_range' => 'Object',\n      'updated_since' => 'int',\n    );\n    $enums = array(\n      'date_preset_enum' => AdDatePresetValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ads',\n      new Ad(),\n      'EDGE',\n      Ad::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdSets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'date_preset' => 'date_preset_enum',\n      'effective_status' => 'list<effective_status_enum>',\n      'is_completed' => 'bool',\n      'time_range' => 'Object',\n    );\n    $enums = array(\n      'date_preset_enum' => AdSetDatePresetValues::getInstance()->getValues(),\n      'effective_status_enum' => AdSetEffectiveStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adsets',\n      new AdSet(),\n      'EDGE',\n      AdSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCopies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'date_preset' => 'date_preset_enum',\n      'effective_status' => 'list<effective_status_enum>',\n      'is_completed' => 'bool',\n      'time_range' => 'Object',\n    );\n    $enums = array(\n      'date_preset_enum' => CampaignDatePresetValues::getInstance()->getValues(),\n      'effective_status_enum' => CampaignEffectiveStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/copies',\n      new Campaign(),\n      'EDGE',\n      Campaign::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCopy(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'deep_copy' => 'bool',\n      'end_time' => 'datetime',\n      'rename_options' => 'Object',\n      'start_time' => 'datetime',\n      'status_option' => 'status_option_enum',\n    );\n    $enums = array(\n      'status_option_enum' => CampaignStatusOptionValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/copies',\n      new Campaign(),\n      'EDGE',\n      Campaign::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInsights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action_attribution_windows' => 'list<action_attribution_windows_enum>',\n      'action_breakdowns' => 'list<action_breakdowns_enum>',\n      'action_report_time' => 'action_report_time_enum',\n      'breakdowns' => 'list<breakdowns_enum>',\n      'date_preset' => 'date_preset_enum',\n      'default_summary' => 'bool',\n      'export_columns' => 'list<string>',\n      'export_format' => 'string',\n      'export_name' => 'string',\n      'fields' => 'list<string>',\n      'filtering' => 'list<Object>',\n      'level' => 'level_enum',\n      'product_id_limit' => 'int',\n      'sort' => 'list<string>',\n      'summary' => 'list<string>',\n      'summary_action_breakdowns' => 'list<summary_action_breakdowns_enum>',\n      'time_increment' => 'string',\n      'time_range' => 'Object',\n      'time_ranges' => 'list<Object>',\n      'use_account_attribution_setting' => 'bool',\n      'use_unified_attribution_setting' => 'bool',\n    );\n    $enums = array(\n      'action_attribution_windows_enum' => AdsInsightsActionAttributionWindowsValues::getInstance()->getValues(),\n      'action_breakdowns_enum' => AdsInsightsActionBreakdownsValues::getInstance()->getValues(),\n      'action_report_time_enum' => AdsInsightsActionReportTimeValues::getInstance()->getValues(),\n      'breakdowns_enum' => AdsInsightsBreakdownsValues::getInstance()->getValues(),\n      'date_preset_enum' => AdsInsightsDatePresetValues::getInstance()->getValues(),\n      'level_enum' => AdsInsightsLevelValues::getInstance()->getValues(),\n      'summary_action_breakdowns_enum' => AdsInsightsSummaryActionBreakdownsValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/insights',\n      new AdsInsights(),\n      'EDGE',\n      AdsInsights::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInsightsAsync(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action_attribution_windows' => 'list<action_attribution_windows_enum>',\n      'action_breakdowns' => 'list<action_breakdowns_enum>',\n      'action_report_time' => 'action_report_time_enum',\n      'breakdowns' => 'list<breakdowns_enum>',\n      'date_preset' => 'date_preset_enum',\n      'default_summary' => 'bool',\n      'export_columns' => 'list<string>',\n      'export_format' => 'string',\n      'export_name' => 'string',\n      'fields' => 'list<string>',\n      'filtering' => 'list<Object>',\n      'level' => 'level_enum',\n      'product_id_limit' => 'int',\n      'sort' => 'list<string>',\n      'summary' => 'list<string>',\n      'summary_action_breakdowns' => 'list<summary_action_breakdowns_enum>',\n      'time_increment' => 'string',\n      'time_range' => 'Object',\n      'time_ranges' => 'list<Object>',\n      'use_account_attribution_setting' => 'bool',\n      'use_unified_attribution_setting' => 'bool',\n    );\n    $enums = array(\n      'action_attribution_windows_enum' => AdsInsightsActionAttributionWindowsValues::getInstance()->getValues(),\n      'action_breakdowns_enum' => AdsInsightsActionBreakdownsValues::getInstance()->getValues(),\n      'action_report_time_enum' => AdsInsightsActionReportTimeValues::getInstance()->getValues(),\n      'breakdowns_enum' => AdsInsightsBreakdownsValues::getInstance()->getValues(),\n      'date_preset_enum' => AdsInsightsDatePresetValues::getInstance()->getValues(),\n      'level_enum' => AdsInsightsLevelValues::getInstance()->getValues(),\n      'summary_action_breakdowns_enum' => AdsInsightsSummaryActionBreakdownsValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/insights',\n      new AdReportRun(),\n      'EDGE',\n      AdReportRun::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'am_call_tags' => 'map',\n      'date_preset' => 'date_preset_enum',\n      'from_adtable' => 'bool',\n      'time_range' => 'Object',\n    );\n    $enums = array(\n      'date_preset_enum' => array(\n        'data_maximum',\n        'last_14d',\n        'last_28d',\n        'last_30d',\n        'last_3d',\n        'last_7d',\n        'last_90d',\n        'last_month',\n        'last_quarter',\n        'last_week_mon_sun',\n        'last_week_sun_sat',\n        'last_year',\n        'maximum',\n        'this_month',\n        'this_quarter',\n        'this_week_mon_today',\n        'this_week_sun_today',\n        'this_year',\n        'today',\n        'yesterday',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Campaign(),\n      'NODE',\n      Campaign::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adlabels' => 'list<Object>',\n      'adset_bid_amounts' => 'map',\n      'adset_budgets' => 'list<map>',\n      'bid_strategy' => 'bid_strategy_enum',\n      'budget_rebalance_flag' => 'bool',\n      'daily_budget' => 'unsigned int',\n      'execution_options' => 'list<execution_options_enum>',\n      'is_skadnetwork_attribution' => 'bool',\n      'iterative_split_test_configs' => 'list<Object>',\n      'lifetime_budget' => 'unsigned int',\n      'name' => 'string',\n      'objective' => 'objective_enum',\n      'pacing_type' => 'list<string>',\n      'promoted_object' => 'Object',\n      'smart_promotion_type' => 'smart_promotion_type_enum',\n      'special_ad_categories' => 'list<special_ad_categories_enum>',\n      'special_ad_category' => 'special_ad_category_enum',\n      'special_ad_category_country' => 'list<special_ad_category_country_enum>',\n      'spend_cap' => 'unsigned int',\n      'start_time' => 'datetime',\n      'status' => 'status_enum',\n      'stop_time' => 'datetime',\n    );\n    $enums = array(\n      'bid_strategy_enum' => CampaignBidStrategyValues::getInstance()->getValues(),\n      'execution_options_enum' => CampaignExecutionOptionsValues::getInstance()->getValues(),\n      'objective_enum' => CampaignObjectiveValues::getInstance()->getValues(),\n      'smart_promotion_type_enum' => CampaignSmartPromotionTypeValues::getInstance()->getValues(),\n      'special_ad_categories_enum' => CampaignSpecialAdCategoriesValues::getInstance()->getValues(),\n      'special_ad_category_enum' => CampaignSpecialAdCategoryValues::getInstance()->getValues(),\n      'special_ad_category_country_enum' => CampaignSpecialAdCategoryCountryValues::getInstance()->getValues(),\n      'status_enum' => CampaignStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new Campaign(),\n      'NODE',\n      Campaign::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 521}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CampaignGroupBrandConfigurationFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CampaignGroupBrandConfiguration extends AbstractObject {\n\n  /**\n   * @return CampaignGroupBrandConfigurationFields\n   */\n  public static function getFieldsEnum() {\n    return CampaignGroupBrandConfigurationFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CampaignGroupCollaborativeAdsPartnerInfoFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CampaignGroupCollaborativeAdsPartnerInfo extends AbstractObject {\n\n  /**\n   * @return CampaignGroupCollaborativeAdsPartnerInfoFields\n   */\n  public static function getFieldsEnum() {\n    return CampaignGroupCollaborativeAdsPartnerInfoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\ninterface CanRedownloadInterface {\n\n  /**\n   * @string\n   */\n  const PARAM_REDOWNLOAD = 'redownload';\n}\n", "num_lines": 34}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CanvasFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Canvas extends AbstractCrudObject {\n\n  /**\n   * @return CanvasFields\n   */\n  public static function getFieldsEnum() {\n    return CanvasFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getPreViews(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'user_ids' => 'list<int>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/previews',\n      new TextWithEntities(),\n      'EDGE',\n      TextWithEntities::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Canvas(),\n      'NODE',\n      Canvas::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'background_color' => 'string',\n      'body_element_ids' => 'list<string>',\n      'enable_swipe_to_open' => 'bool',\n      'is_hidden' => 'bool',\n      'is_published' => 'bool',\n      'name' => 'string',\n      'source_template_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new Canvas(),\n      'NODE',\n      Canvas::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 135}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CanvasAdSettingsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CanvasAdSettings extends AbstractObject {\n\n  /**\n   * @return CanvasAdSettingsFields\n   */\n  public static function getFieldsEnum() {\n    return CanvasAdSettingsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CanvasBodyElementFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CanvasBodyElement extends AbstractObject {\n\n  /**\n   * @return CanvasBodyElementFields\n   */\n  public static function getFieldsEnum() {\n    return CanvasBodyElementFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CanvasCollectionThumbnailFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CanvasCollectionThumbnail extends AbstractObject {\n\n  /**\n   * @return CanvasCollectionThumbnailFields\n   */\n  public static function getFieldsEnum() {\n    return CanvasCollectionThumbnailFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CanvasDynamicSettingFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CanvasDynamicSetting extends AbstractCrudObject {\n\n  /**\n   * @return CanvasDynamicSettingFields\n   */\n  public static function getFieldsEnum() {\n    return CanvasDynamicSettingFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new CanvasDynamicSetting(),\n      'NODE',\n      CanvasDynamicSetting::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CatalogBasedTargetingFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CatalogBasedTargeting extends AbstractObject {\n\n  /**\n   * @return CatalogBasedTargetingFields\n   */\n  public static function getFieldsEnum() {\n    return CatalogBasedTargetingFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CatalogItemAppealStatusFields;\nuse FacebookAds\\Object\\Values\\CatalogItemAppealStatusStatusValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CatalogItemAppealStatus extends AbstractObject {\n\n  /**\n   * @return CatalogItemAppealStatusFields\n   */\n  public static function getFieldsEnum() {\n    return CatalogItemAppealStatusFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Status'] = CatalogItemAppealStatusStatusValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CatalogItemAppLinksFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CatalogItemAppLinks extends AbstractObject {\n\n  /**\n   * @return CatalogItemAppLinksFields\n   */\n  public static function getFieldsEnum() {\n    return CatalogItemAppLinksFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CatalogItemChannelsToIntegrityStatusFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CatalogItemChannelsToIntegrityStatus extends AbstractObject {\n\n  /**\n   * @return CatalogItemChannelsToIntegrityStatusFields\n   */\n  public static function getFieldsEnum() {\n    return CatalogItemChannelsToIntegrityStatusFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CatalogSegmentAllMatchCountLaserFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CatalogSegmentAllMatchCountLaser extends AbstractObject {\n\n  /**\n   * @return CatalogSegmentAllMatchCountLaserFields\n   */\n  public static function getFieldsEnum() {\n    return CatalogSegmentAllMatchCountLaserFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CatalogSubVerticalListFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CatalogSubVerticalList extends AbstractObject {\n\n  /**\n   * @return CatalogSubVerticalListFields\n   */\n  public static function getFieldsEnum() {\n    return CatalogSubVerticalListFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ChatPluginFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ChatPlugin extends AbstractObject {\n\n  /**\n   * @return ChatPluginFields\n   */\n  public static function getFieldsEnum() {\n    return ChatPluginFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CheckBatchRequestStatusFields;\nuse FacebookAds\\Object\\Values\\CheckBatchRequestStatusErrorPriorityValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CheckBatchRequestStatus extends AbstractObject {\n\n  /**\n   * @return CheckBatchRequestStatusFields\n   */\n  public static function getFieldsEnum() {\n    return CheckBatchRequestStatusFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ErrorPriority'] = CheckBatchRequestStatusErrorPriorityValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ChildEventFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ChildEvent extends AbstractCrudObject {\n\n  /**\n   * @return ChildEventFields\n   */\n  public static function getFieldsEnum() {\n    return ChildEventFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\Object\\Fields\\ClickTrackingTagFields;\nuse FacebookAds\\Http\\RequestInterface;\n\nclass ClickTrackingTag extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   * @return string\n   */\n  protected function getEndpoint() {\n    return 'trackingtag';\n  }\n\n  /**\n   * @return ClickTrackingTagFields\n   */\n  public static function getFieldsEnum() {\n    return ClickTrackingTagFields::getInstance();\n  }\n\n  public function deleteSelf(array $params = array()) {\n    $this->getApi()->call(\n      '/'.$this->parentId.'/'.$this->getEndpoint(),\n      RequestInterface::METHOD_DELETE,\n      $params);\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CloudGameFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CloudGame extends AbstractCrudObject {\n\n  /**\n   * @return CloudGameFields\n   */\n  public static function getFieldsEnum() {\n    return CloudGameFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new CloudGame(),\n      'NODE',\n      CloudGame::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CollaborativeAdsPartnerInfoListItemFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CollaborativeAdsPartnerInfoListItem extends AbstractObject {\n\n  /**\n   * @return CollaborativeAdsPartnerInfoListItemFields\n   */\n  public static function getFieldsEnum() {\n    return CollaborativeAdsPartnerInfoListItemFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CollaborativeAdsShareSettingsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CollaborativeAdsShareSettings extends AbstractCrudObject {\n\n  /**\n   * @return CollaborativeAdsShareSettingsFields\n   */\n  public static function getFieldsEnum() {\n    return CollaborativeAdsShareSettingsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new CollaborativeAdsShareSettings(),\n      'NODE',\n      CollaborativeAdsShareSettings::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CommentFields;\nuse FacebookAds\\Object\\Values\\CommentCommentPrivacyValueValues;\nuse FacebookAds\\Object\\Values\\CommentFilterValues;\nuse FacebookAds\\Object\\Values\\CommentLiveFilterValues;\nuse FacebookAds\\Object\\Values\\CommentOrderValues;\nuse FacebookAds\\Object\\Values\\ProfileTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Comment extends AbstractCrudObject {\n\n  /**\n   * @return CommentFields\n   */\n  public static function getFieldsEnum() {\n    return CommentFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['CommentPrivacyValue'] = CommentCommentPrivacyValueValues::getInstance()->getValues();\n    $ref_enums['Filter'] = CommentFilterValues::getInstance()->getValues();\n    $ref_enums['LiveFilter'] = CommentLiveFilterValues::getInstance()->getValues();\n    $ref_enums['Order'] = CommentOrderValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getComments(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'filter' => 'filter_enum',\n      'live_filter' => 'live_filter_enum',\n      'order' => 'order_enum',\n      'since' => 'datetime',\n    );\n    $enums = array(\n      'filter_enum' => CommentFilterValues::getInstance()->getValues(),\n      'live_filter_enum' => CommentLiveFilterValues::getInstance()->getValues(),\n      'order_enum' => CommentOrderValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/comments',\n      new Comment(),\n      'EDGE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createComment(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'attachment_id' => 'string',\n      'attachment_share_url' => 'string',\n      'attachment_url' => 'string',\n      'comment_privacy_value' => 'comment_privacy_value_enum',\n      'facepile_mentioned_ids' => 'list<string>',\n      'feedback_source' => 'string',\n      'is_offline' => 'bool',\n      'message' => 'string',\n      'nectar_module' => 'string',\n      'object_id' => 'string',\n      'parent_comment_id' => 'Object',\n      'text' => 'string',\n      'tracking' => 'string',\n    );\n    $enums = array(\n      'comment_privacy_value_enum' => CommentCommentPrivacyValueValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/comments',\n      new Comment(),\n      'EDGE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteLikes(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'feedback_source' => 'string',\n      'nectar_module' => 'string',\n      'tracking' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/likes',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLikes(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/likes',\n      new Profile(),\n      'EDGE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createLike(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'feedback_source' => 'string',\n      'nectar_module' => 'string',\n      'tracking' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/likes',\n      new Comment(),\n      'EDGE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getReactions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'type_enum' => ProfileTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/reactions',\n      new Profile(),\n      'EDGE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Comment(),\n      'NODE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'attachment_id' => 'string',\n      'attachment_share_url' => 'string',\n      'attachment_url' => 'string',\n      'is_hidden' => 'bool',\n      'message' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new Comment(),\n      'NODE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 308}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CommerceMerchantSettingsFields;\nuse FacebookAds\\Object\\Values\\CommerceOrderFiltersValues;\nuse FacebookAds\\Object\\Values\\CommerceOrderStateValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CommerceMerchantSettings extends AbstractCrudObject {\n\n  /**\n   * @return CommerceMerchantSettingsFields\n   */\n  public static function getFieldsEnum() {\n    return CommerceMerchantSettingsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function createAcknowledgeOrder(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'idempotency_key' => 'string',\n      'orders' => 'list<map>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/acknowledge_orders',\n      new CommerceMerchantSettings(),\n      'EDGE',\n      CommerceMerchantSettings::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCommerceOrders(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'filters' => 'list<filters_enum>',\n      'state' => 'list<state_enum>',\n      'updated_after' => 'datetime',\n      'updated_before' => 'datetime',\n    );\n    $enums = array(\n      'filters_enum' => CommerceOrderFiltersValues::getInstance()->getValues(),\n      'state_enum' => CommerceOrderStateValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/commerce_orders',\n      new CommerceOrder(),\n      'EDGE',\n      CommerceOrder::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCommercePayouts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'end_time' => 'datetime',\n      'start_time' => 'datetime',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/commerce_payouts',\n      new CommercePayout(),\n      'EDGE',\n      CommercePayout::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCommerceTransactions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'end_time' => 'datetime',\n      'payout_reference_id' => 'string',\n      'start_time' => 'datetime',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/commerce_transactions',\n      new CommerceOrderTransactionDetail(),\n      'EDGE',\n      CommerceOrderTransactionDetail::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOnsiteConversionEvents(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'created_after' => 'datetime',\n      'created_before' => 'datetime',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/onsite_conversion_events',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOrderManagementApps(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/order_management_apps',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createOrderManagementApp(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/order_management_apps',\n      new CommerceMerchantSettings(),\n      'EDGE',\n      CommerceMerchantSettings::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getProductCatalogs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/product_catalogs',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getReturns(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'end_time_created' => 'datetime',\n      'merchant_return_id' => 'string',\n      'start_time_created' => 'datetime',\n      'statuses' => 'list<statuses_enum>',\n    );\n    $enums = array(\n      'statuses_enum' => array(\n        'APPROVED',\n        'DISAPPROVED',\n        'MERCHANT_MARKED_COMPLETED',\n        'REFUNDED',\n        'REQUESTED',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/returns',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSellerIssues(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/seller_issues',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSetupStatus(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/setup_status',\n      new CommerceMerchantSettingsSetupStatus(),\n      'EDGE',\n      CommerceMerchantSettingsSetupStatus::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getShippingProfiles(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'reference_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/shipping_profiles',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createShippingProfile(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'handling_time' => 'map',\n      'is_default' => 'bool',\n      'is_default_shipping_profile' => 'bool',\n      'name' => 'string',\n      'reference_id' => 'string',\n      'shipping_destinations' => 'list<map>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/shipping_profiles',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getShops(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/shops',\n      new Shop(),\n      'EDGE',\n      Shop::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTaxSettings(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/tax_settings',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createWhatsappChannel(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'op' => 'op_enum',\n      'whatsapp_business_accounts' => 'list<string>',\n    );\n    $enums = array(\n      'op_enum' => array(\n        'ADD',\n        'REMOVE',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/whatsapp_channel',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new CommerceMerchantSettings(),\n      'NODE',\n      CommerceMerchantSettings::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 490}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CommerceMerchantSettingsSetupStatusFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CommerceMerchantSettingsSetupStatus extends AbstractObject {\n\n  /**\n   * @return CommerceMerchantSettingsSetupStatusFields\n   */\n  public static function getFieldsEnum() {\n    return CommerceMerchantSettingsSetupStatusFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CommerceOrderFields;\nuse FacebookAds\\Object\\Values\\CommerceOrderFiltersValues;\nuse FacebookAds\\Object\\Values\\CommerceOrderReasonCodeValues;\nuse FacebookAds\\Object\\Values\\CommerceOrderStateValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CommerceOrder extends AbstractCrudObject {\n\n  /**\n   * @return CommerceOrderFields\n   */\n  public static function getFieldsEnum() {\n    return CommerceOrderFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Filters'] = CommerceOrderFiltersValues::getInstance()->getValues();\n    $ref_enums['State'] = CommerceOrderStateValues::getInstance()->getValues();\n    $ref_enums['ReasonCode'] = CommerceOrderReasonCodeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function createAcknowledgeOrder(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'idempotency_key' => 'string',\n      'merchant_order_reference' => 'string',\n      'return_error_response' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/acknowledge_order',\n      new CommerceOrder(),\n      'EDGE',\n      CommerceOrder::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCancellations(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/cancellations',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCancellation(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'cancel_reason' => 'map',\n      'idempotency_key' => 'string',\n      'items' => 'list<map>',\n      'restock_items' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/cancellations',\n      new CommerceOrder(),\n      'EDGE',\n      CommerceOrder::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createFulfillOrder(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'idempotency_key' => 'string',\n      'items' => 'list<map>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/fulfill_order',\n      new CommerceOrder(),\n      'EDGE',\n      CommerceOrder::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getItems(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/items',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPayments(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/payments',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPromotionDetails(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/promotion_details',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPromotions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/promotions',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getRefunds(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/refunds',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createRefund(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'deductions' => 'list<map>',\n      'idempotency_key' => 'string',\n      'items' => 'list<map>',\n      'reason_code' => 'reason_code_enum',\n      'reason_text' => 'string',\n      'return_id' => 'string',\n      'shipping' => 'map',\n    );\n    $enums = array(\n      'reason_code_enum' => CommerceOrderReasonCodeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/refunds',\n      new CommerceOrder(),\n      'EDGE',\n      CommerceOrder::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getReturns(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'merchant_return_id' => 'string',\n      'statuses' => 'list<statuses_enum>',\n    );\n    $enums = array(\n      'statuses_enum' => array(\n        'APPROVED',\n        'DISAPPROVED',\n        'MERCHANT_MARKED_COMPLETED',\n        'REFUNDED',\n        'REQUESTED',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/returns',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createReturn(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'items' => 'list<map>',\n      'merchant_return_id' => 'string',\n      'return_message' => 'string',\n      'update' => 'map',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/returns',\n      new CommerceOrder(),\n      'EDGE',\n      CommerceOrder::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getShipments(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/shipments',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createShipment(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'external_redemption_link' => 'string',\n      'external_shipment_id' => 'string',\n      'fulfillment' => 'map',\n      'idempotency_key' => 'string',\n      'items' => 'list<map>',\n      'merchant_order_reference' => 'string',\n      'shipment_origin_postal_code' => 'string',\n      'shipping_tax_details' => 'map',\n      'should_use_default_fulfillment_location' => 'bool',\n      'tracking_info' => 'map',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/shipments',\n      new CommerceOrder(),\n      'EDGE',\n      CommerceOrder::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createUpdateShipment(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'external_shipment_id' => 'string',\n      'fulfillment_id' => 'string',\n      'idempotency_key' => 'string',\n      'shipment_id' => 'string',\n      'tracking_info' => 'map',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/update_shipment',\n      new CommerceOrder(),\n      'EDGE',\n      CommerceOrder::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new CommerceOrder(),\n      'NODE',\n      CommerceOrder::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 477}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CommerceOrderTransactionDetailFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CommerceOrderTransactionDetail extends AbstractCrudObject {\n\n  /**\n   * @return CommerceOrderTransactionDetailFields\n   */\n  public static function getFieldsEnum() {\n    return CommerceOrderTransactionDetailFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getItems(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/items',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTaxDetails(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/tax_details',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 104}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CommercePayoutFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CommercePayout extends AbstractObject {\n\n  /**\n   * @return CommercePayoutFields\n   */\n  public static function getFieldsEnum() {\n    return CommercePayoutFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CommerceSettingsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CommerceSettings extends AbstractObject {\n\n  /**\n   * @return CommerceSettingsFields\n   */\n  public static function getFieldsEnum() {\n    return CommerceSettingsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ConnectionsTargetingFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ConnectionsTargeting extends AbstractCrudObject {\n\n  /**\n   * @return ConnectionsTargetingFields\n   */\n  public static function getFieldsEnum() {\n    return ConnectionsTargetingFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ContextualBundlingSpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ContextualBundlingSpec extends AbstractObject {\n\n  /**\n   * @return ContextualBundlingSpecFields\n   */\n  public static function getFieldsEnum() {\n    return ContextualBundlingSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ConversionActionQueryFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ConversionActionQuery extends AbstractObject {\n\n  /**\n   * @return ConversionActionQueryFields\n   */\n  public static function getFieldsEnum() {\n    return ConversionActionQueryFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CopyrightReferenceContainerFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CopyrightReferenceContainer extends AbstractCrudObject {\n\n  /**\n   * @return CopyrightReferenceContainerFields\n   */\n  public static function getFieldsEnum() {\n    return CopyrightReferenceContainerFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CoverPhotoFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CoverPhoto extends AbstractCrudObject {\n\n  /**\n   * @return CoverPhotoFields\n   */\n  public static function getFieldsEnum() {\n    return CoverPhotoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CPASAdvertiserPartnershipRecommendationFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CPASAdvertiserPartnershipRecommendation extends AbstractCrudObject {\n\n  /**\n   * @return CPASAdvertiserPartnershipRecommendationFields\n   */\n  public static function getFieldsEnum() {\n    return CPASAdvertiserPartnershipRecommendationFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new CPASAdvertiserPartnershipRecommendation(),\n      'NODE',\n      CPASAdvertiserPartnershipRecommendation::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CPASBusinessSetupConfigFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CPASBusinessSetupConfig extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'cpas_business_setup_config';\n  }\n\n  /**\n   * @return CPASBusinessSetupConfigFields\n   */\n  public static function getFieldsEnum() {\n    return CPASBusinessSetupConfigFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ad_accounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new CPASBusinessSetupConfig(),\n      'NODE',\n      CPASBusinessSetupConfig::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 111}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CPASCollaborationRequestFields;\nuse FacebookAds\\Object\\Values\\CPASCollaborationRequestRequesterAgencyOrBrandValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CPASCollaborationRequest extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'collaborative_ads_collaboration_requests';\n  }\n\n  /**\n   * @return CPASCollaborationRequestFields\n   */\n  public static function getFieldsEnum() {\n    return CPASCollaborationRequestFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['RequesterAgencyOrBrand'] = CPASCollaborationRequestRequesterAgencyOrBrandValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new CPASCollaborationRequest(),\n      'NODE',\n      CPASCollaborationRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 90}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CPASMerchantConfigFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CPASMerchantConfig extends AbstractCrudObject {\n\n  /**\n   * @return CPASMerchantConfigFields\n   */\n  public static function getFieldsEnum() {\n    return CPASMerchantConfigFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new CPASMerchantConfig(),\n      'NODE',\n      CPASMerchantConfig::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CreativeHistoryFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CreativeHistory extends AbstractObject {\n\n  /**\n   * @return CreativeHistoryFields\n   */\n  public static function getFieldsEnum() {\n    return CreativeHistoryFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CreditCardFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CreditCard extends AbstractCrudObject {\n\n  /**\n   * @return CreditCardFields\n   */\n  public static function getFieldsEnum() {\n    return CreditCardFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new CreditCard(),\n      'NODE',\n      CreditCard::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CreditPartitionActionOptionsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CreditPartitionActionOptions extends AbstractObject {\n\n  /**\n   * @return CreditPartitionActionOptionsFields\n   */\n  public static function getFieldsEnum() {\n    return CreditPartitionActionOptionsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CRMAddressFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CRMAddress extends AbstractCrudObject {\n\n  /**\n   * @return CRMAddressFields\n   */\n  public static function getFieldsEnum() {\n    return CRMAddressFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new CRMAddress(),\n      'NODE',\n      CRMAddress::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CurrencyFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Currency extends AbstractObject {\n\n  /**\n   * @return CurrencyFields\n   */\n  public static function getFieldsEnum() {\n    return CurrencyFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CurrencyAmountFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CurrencyAmount extends AbstractObject {\n\n  /**\n   * @return CurrencyAmountFields\n   */\n  public static function getFieldsEnum() {\n    return CurrencyAmountFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CustomAudienceFields;\nuse FacebookAds\\Object\\Values\\CustomAudienceActionSourceValues;\nuse FacebookAds\\Object\\Values\\CustomAudienceClaimObjectiveValues;\nuse FacebookAds\\Object\\Values\\CustomAudienceContentTypeValues;\nuse FacebookAds\\Object\\Values\\CustomAudienceCustomerFileSourceValues;\nuse FacebookAds\\Object\\Values\\CustomAudienceSubtypeValues;\nuse FacebookAds\\Object\\Values\\CustomAudienceTypes;\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\EmailNormalizer;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\PhoneNormalizer;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\MadidNormalizer;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\GenderNormalizer;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\BirthYearNormalizer;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\DateNormalizer;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\FirstNameNormalizer;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\LastNameNormalizer;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\FirstNameInitialNormalizer;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\StateNormalizer;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\CityNormalizer;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ZipNormalizer;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\CountryNormalizer;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\HashNormalizer;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudience extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'customaudiences';\n  }\n\n  /**\n   * @return CustomAudienceFields\n   */\n  public static function getFieldsEnum() {\n    return CustomAudienceFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ClaimObjective'] = CustomAudienceClaimObjectiveValues::getInstance()->getValues();\n    $ref_enums['ContentType'] = CustomAudienceContentTypeValues::getInstance()->getValues();\n    $ref_enums['CustomerFileSource'] = CustomAudienceCustomerFileSourceValues::getInstance()->getValues();\n    $ref_enums['Subtype'] = CustomAudienceSubtypeValues::getInstance()->getValues();\n    $ref_enums['ActionSource'] = CustomAudienceActionSourceValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function deleteAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adaccounts' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/adaccounts',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'permissions' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adaccounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdAccount(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adaccounts' => 'list<string>',\n      'permissions' => 'string',\n      'relationship_type' => 'list<string>',\n      'replace' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adaccounts',\n      new CustomAudience(),\n      'EDGE',\n      CustomAudience::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAds(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'effective_status' => 'list<string>',\n      'status' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ads',\n      new Ad(),\n      'EDGE',\n      Ad::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSessions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'session_id' => 'unsigned int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/sessions',\n      new CustomAudienceSession(),\n      'EDGE',\n      CustomAudienceSession::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSharedAccountInfo(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/shared_account_info',\n      new CustomAudiencesharedAccountInfo(),\n      'EDGE',\n      CustomAudiencesharedAccountInfo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'namespace' => 'string',\n      'payload' => 'Object',\n      'session' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/users',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createUser(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'namespace' => 'string',\n      'payload' => 'Object',\n      'session' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/users',\n      new CustomAudience(),\n      'EDGE',\n      CustomAudience::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createUsersReplace(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'namespace' => 'string',\n      'payload' => 'Object',\n      'session' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/usersreplace',\n      new CustomAudience(),\n      'EDGE',\n      CustomAudience::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_account_id' => 'string',\n      'target_countries' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new CustomAudience(),\n      'NODE',\n      CustomAudience::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'allowed_domains' => 'list<string>',\n      'claim_objective' => 'claim_objective_enum',\n      'content_type' => 'content_type_enum',\n      'countries' => 'string',\n      'customer_file_source' => 'customer_file_source_enum',\n      'description' => 'string',\n      'enable_fetch_or_create' => 'bool',\n      'event_source_group' => 'string',\n      'event_sources' => 'list<map>',\n      'exclusions' => 'list<Object>',\n      'inclusions' => 'list<Object>',\n      'lookalike_spec' => 'string',\n      'name' => 'string',\n      'opt_out_link' => 'string',\n      'parent_audience_id' => 'unsigned int',\n      'product_set_id' => 'string',\n      'retention_days' => 'unsigned int',\n      'rev_share_policy_id' => 'unsigned int',\n      'rule' => 'string',\n      'rule_aggregation' => 'string',\n      'tags' => 'list<string>',\n      'use_in_campaigns' => 'bool',\n    );\n    $enums = array(\n      'claim_objective_enum' => CustomAudienceClaimObjectiveValues::getInstance()->getValues(),\n      'content_type_enum' => CustomAudienceContentTypeValues::getInstance()->getValues(),\n      'customer_file_source_enum' => CustomAudienceCustomerFileSourceValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new CustomAudience(),\n      'NODE',\n      CustomAudience::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function addUsers(\n    array $users,\n    $type,\n    array $app_ids = array(),\n    $is_hashed = false,\n    $pending = false) {\n\n    $params = $this->formatParams($users, $type, $app_ids, $is_hashed);\n    return $this->createUser(array(), $params, $pending);\n  }\n\n  public function removeUsers(\n    array $users,\n    $type,\n    array $app_ids = array(),\n    $is_hashed = false,\n    $pending = false) {\n\n    $params = $this->formatParams($users, $type, $app_ids, $is_hashed);\n    return $this->deleteUsers(array(), $params, $pending);\n  }\n\n\n  /**\n   * Take users and format them correctly for the request\n   *\n   * @param array $users\n   * @param string $type\n   * @param array $app_ids\n   * @param bool $is_hashed\n   * @return array\n   */\n  protected function formatParams(\n    array $users,\n    $type,\n    array $app_ids = array(),\n    $is_hashed = false) {\n\n    if ($type == CustomAudienceTypes::EMAIL\n      || $type == CustomAudienceTypes::PHONE) {\n      $normalizer = new EmailNormalizer();\n      $hash_normalizer = new HashNormalizer();\n      foreach ($users as &$user) {\n        if ($type == CustomAudienceTypes::EMAIL) {\n          $user = $normalizer->normalize(CustomAudienceTypes::EMAIL, $user);\n        }\n        if (!$is_hashed) {\n          $user = $hash_normalizer->normalize(\n            CustomAudienceTypes::EMAIL, $user);\n        }\n      }\n    }\n\n    $payload = array(\n      'schema' => $type,\n      'data' => $users,\n    );\n\n    if ($type === CustomAudienceTypes::ID) {\n      if (empty($app_ids)) {\n        throw new \\InvalidArgumentException(\n          \"Custom audiences with type \".CustomAudienceTypes::ID.\" require\"\n          .\"at least one app_id\");\n      }\n\n      $payload['app_ids'] = $app_ids;\n    }\n\n    return array('payload' => $payload);\n  }\n\n  /**\n  * @var \\ArrayObject\n  */\n  protected $normalizers;\n\n  /**\n   * @return \\ArrayObject\n   */\n  public function getNormalizers() {\n    if ($this->normalizers === null) {\n      $this->normalizers = new \\ArrayObject(array(\n        new CustomAudienceNormalizers\\EmailNormalizer(),\n        new CustomAudienceNormalizers\\PhoneNormalizer(),\n        new CustomAudienceNormalizers\\MadidNormalizer(),\n        new CustomAudienceNormalizers\\GenderNormalizer(),\n        new CustomAudienceNormalizers\\BirthYearNormalizer(),\n        new CustomAudienceNormalizers\\DateNormalizer(),\n        new CustomAudienceNormalizers\\FirstNameNormalizer(),\n        new CustomAudienceNormalizers\\LastNameNormalizer(),\n        new CustomAudienceNormalizers\\FirstNameInitialNormalizer(),\n        new CustomAudienceNormalizers\\StateNormalizer(),\n        new CustomAudienceNormalizers\\CityNormalizer(),\n        new CustomAudienceNormalizers\\ZipNormalizer(),\n        new CustomAudienceNormalizers\\CountryNormalizer(),\n      ));\n    }\n    return $this->normalizers;\n  }\n\n  /**\n   * Add users to the CustomAudiences with multiple keys. There is no max on the\n   * total number of users that can be added to an audience, but up to 10000\n   * users can be added at a given time.\n   *\n   * @param array $users\n   * @param array $types\n   * @param bool $is_hashed\n   * @param bool $is_normalized\n   * @return array\n   */\n  public function addUsersMultiKey(\n    array $users,\n    array $types,\n    $is_hashed = false,\n    $is_normalized = false) {\n    $params = $this->formatParamsMultiKey($users, $types, $is_hashed, $is_normalized);\n    return $this->getApi()->call(\n      '/'.$this->assureId().'/users',\n      RequestInterface::METHOD_POST,\n      $params)->getContent();\n  }\n\n\n  /**\n   * Delete users from AdCustomAudiences with multiple keys\n   *\n   * @param array $users\n   * @param array $types\n   * @param bool $is_hashed\n   * @param bool $is_normalized\n   * @return array\n   */\n  public function removeUsersMultiKey(\n    array $users,\n    array $types,\n    $is_hashed = false,\n    $is_normalized = false) {\n    $params = $this->formatParamsMultiKey($users, $types, $is_hashed, $is_normalized);\n    return $this->getApi()->call(\n      '/'.$this->assureId().'/users',\n      RequestInterface::METHOD_DELETE,\n      $params)->getContent();\n  }\n\n  /**\n   * Take users and format them correctly for the request\n   *\n   * @param array $users\n   * @param array $types\n   * @param bool $is_hashed\n   * @param bool $is_normalized\n   * @return array\n   */\n  protected function formatParamsMultiKey(\n    array $users,\n    array $types,\n    $is_hashed = false,\n    $is_normalized = false) {\n\n    if (!$is_hashed) {\n      if ($is_normalized) {\n        $normalizers = new \\ArrayObject(array(\n          new HashNormalizer()\n        ));\n      }\n      else {\n        $normalizers = clone $this->getNormalizers();\n        $normalizers->append(new HashNormalizer());\n      }\n      foreach ($users as &$user) {\n        if (count($types) != count($user)) {\n          throw new \\InvalidArgumentException(\n            \"Number of keys in each list in the data should \".\n            \"match the number of keys specified in scheme\");\n          break;\n        }\n        foreach ($user as $index => &$key_value) {\n          $key = $types[$index];\n          foreach ($normalizers as $normalizer) {\n            if ($key_value &&\n                $key !== CustomAudienceMultikeySchemaFields::EXTERN_ID &&\n                $normalizer->shouldNormalize($key, $key_value)) {\n              $key_value = $normalizer->normalize($key, $key_value);\n            }\n          }\n        }\n      }\n    }\n\n    $payload = array(\n      'schema' => $types,\n      'data' => $users,\n    );\n\n    return array('payload' => $payload);\n  }\n}\n", "num_lines": 609}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CustomAudienceAdAccountFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudienceAdAccount extends AbstractCrudObject {\n\n  /**\n   * @return CustomAudienceAdAccountFields\n   */\n  public static function getFieldsEnum() {\n    return CustomAudienceAdAccountFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CustomAudienceDataSourceFields;\nuse FacebookAds\\Object\\Values\\CustomAudienceDataSourceSubTypeValues;\nuse FacebookAds\\Object\\Values\\CustomAudienceDataSourceTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudienceDataSource extends AbstractObject {\n\n  /**\n   * @return CustomAudienceDataSourceFields\n   */\n  public static function getFieldsEnum() {\n    return CustomAudienceDataSourceFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['SubType'] = CustomAudienceDataSourceSubTypeValues::getInstance()->getValues();\n    $ref_enums['Type'] = CustomAudienceDataSourceTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CustomAudienceGroupFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudienceGroup extends AbstractObject {\n\n  /**\n   * @return CustomAudienceGroupFields\n   */\n  public static function getFieldsEnum() {\n    return CustomAudienceGroupFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Object\\Values\\CustomAudienceTypes;\nuse FacebookAds\\Object\\Fields\\CustomAudienceFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\HashNormalizer;\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\n\n/**\n * @deprecated\n * Please use class `CustomAudience` instead\n **/\nclass CustomAudienceMultiKey extends AbstractCrudObject {\n\n  /**\n   * @var string\n   */\n  const HASH_TYPE_SHA256 = 'sha256';\n\n  /**\n  * @var \\ArrayObject\n  */\n  protected $normalizers;\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   * @return string\n   */\n  protected function getEndpoint() {\n    return 'customaudiences';\n  }\n\n  /**\n   * @return CustomAudienceFields\n   */\n  public static function getFieldsEnum() {\n    return CustomAudienceFields::getInstance();\n  }\n\n  /**\n   * @return \\ArrayObject\n   */\n  public function getNormalizers() {\n    if ($this->normalizers === null) {\n      $this->normalizers = new \\ArrayObject(array(\n        new CustomAudienceNormalizers\\EmailNormalizer(),\n        new CustomAudienceNormalizers\\PhoneNormalizer(),\n        new CustomAudienceNormalizers\\MadidNormalizer(),\n        new CustomAudienceNormalizers\\GenderNormalizer(),\n        new CustomAudienceNormalizers\\BirthYearNormalizer(),\n        new CustomAudienceNormalizers\\DateNormalizer(),\n        new CustomAudienceNormalizers\\FirstNameNormalizer(),\n        new CustomAudienceNormalizers\\LastNameNormalizer(),\n        new CustomAudienceNormalizers\\FirstNameInitialNormalizer(),\n        new CustomAudienceNormalizers\\StateNormalizer(),\n        new CustomAudienceNormalizers\\CityNormalizer(),\n        new CustomAudienceNormalizers\\ZipNormalizer(),\n        new CustomAudienceNormalizers\\CountryNormalizer(),\n      ));\n    }\n    return $this->normalizers;\n  }\n\n  /**\n   * @deprecated\n   * Add users to the AdCustomAudiences. There is no max on the total number of\n   * users that can be added to an audience, but up to 10000 users can be added\n   * at a given time.\n   *\n   * @param array $users\n   * @param array $types\n   * @param bool $is_hashed\n   * @param bool $is_normalized\n   * @return array\n   */\n  public function addUsers(\n    array $users,\n    array $types,\n    $is_hashed = false,\n    $is_normalized = false) {\n    $warning_message = 'CustomAudienceMultiKey is being deprecated, please use'.\n      '`new CustomAudience(...)->addUsers(..)` instead';\n    trigger_error($warning_message, E_USER_DEPRECATED);\n\n    $params = $this->formatParams($users, $types, $is_hashed, $is_normalized);\n    return $this->getApi()->call(\n      '/'.$this->assureId().'/users',\n      RequestInterface::METHOD_POST,\n      $params)->getContent();\n  }\n\n  /**\n   * @deprecated\n   * Delete users from AdCustomAudiences\n   *\n   * @param array $users\n   * @param array $types\n   * @param bool $is_hashed\n   * @param bool $is_normalized\n   * @return array\n   */\n  public function removeUsers(\n    array $users,\n    array $types,\n    $is_hashed = false,\n    $is_normalized = false) {\n    $warning_message = 'CustomAudienceMultiKey is being deprecated, please use'.\n      '`new CustomAudience(...)->removeUsers(..)` instead';\n    trigger_error($warning_message, E_USER_DEPRECATED);\n    $params = $this->formatParams($users, $types, $is_hashed, $is_normalized);\n    return $this->getApi()->call(\n      '/'.$this->assureId().'/users',\n      RequestInterface::METHOD_DELETE,\n      $params)->getContent();\n  }\n\n  /**\n   * Take users and format them correctly for the request\n   *\n   * @param array $users\n   * @param array $types\n   * @param bool $is_hashed\n   * @param bool $is_normalized\n   * @return array\n   */\n  protected function formatParams(\n    array $users,\n    array $types,\n    $is_hashed = false,\n    $is_normalized = false) {\n\n    if (!$is_hashed) {\n      if ($is_normalized) {\n        $normalizers = new \\ArrayObject(array(\n          new HashNormalizer()\n        ));\n      }\n      else {\n        $normalizers = clone $this->getNormalizers();\n        $normalizers->append(new HashNormalizer());\n      }\n      foreach ($users as &$user) {\n        if (count($types) != count($user)) {\n          throw new \\InvalidArgumentException(\n            \"Number of keys in each list in the data should \".\n            \"match the number of keys specified in scheme\");\n          break;\n        }\n        foreach ($user as $index => &$key_value) {\n          $key = $types[$index];\n          foreach ($normalizers as $normalizer) {\n            if ($key_value &&\n                $key !== CustomAudienceMultikeySchemaFields::EXTERN_ID &&\n                $normalizer->shouldNormalize($key, $key_value)) {\n              $key_value = $normalizer->normalize($key, $key_value);\n            }\n          }\n        }\n      }\n    }\n\n    $payload = array(\n      'schema' => $types,\n      'data' => $users,\n    );\n\n    return array('payload' => $payload);\n  }\n}\n", "num_lines": 194}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CustomAudienceSessionFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudienceSession extends AbstractObject {\n\n  /**\n   * @return CustomAudienceSessionFields\n   */\n  public static function getFieldsEnum() {\n    return CustomAudienceSessionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CustomAudiencesharedAccountInfoFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudiencesharedAccountInfo extends AbstractObject {\n\n  /**\n   * @return CustomAudiencesharedAccountInfoFields\n   */\n  public static function getFieldsEnum() {\n    return CustomAudiencesharedAccountInfoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CustomAudienceSharingStatusFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudienceSharingStatus extends AbstractObject {\n\n  /**\n   * @return CustomAudienceSharingStatusFields\n   */\n  public static function getFieldsEnum() {\n    return CustomAudienceSharingStatusFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CustomAudienceStatusFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudienceStatus extends AbstractObject {\n\n  /**\n   * @return CustomAudienceStatusFields\n   */\n  public static function getFieldsEnum() {\n    return CustomAudienceStatusFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CustomAudiencesTOSFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudiencesTOS extends AbstractCrudObject {\n\n  /**\n   * @return CustomAudiencesTOSFields\n   */\n  public static function getFieldsEnum() {\n    return CustomAudiencesTOSFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CustomConversionFields;\nuse FacebookAds\\Object\\Values\\CustomConversionCustomEventTypeValues;\nuse FacebookAds\\Object\\Values\\CustomConversionStatsResultAggregationValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomConversion extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'customconversions';\n  }\n\n  /**\n   * @return CustomConversionFields\n   */\n  public static function getFieldsEnum() {\n    return CustomConversionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['CustomEventType'] = CustomConversionCustomEventTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getStats(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'aggregation' => 'aggregation_enum',\n      'end_time' => 'datetime',\n      'start_time' => 'datetime',\n    );\n    $enums = array(\n      'aggregation_enum' => CustomConversionStatsResultAggregationValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/stats',\n      new CustomConversionStatsResult(),\n      'EDGE',\n      CustomConversionStatsResult::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new CustomConversion(),\n      'NODE',\n      CustomConversion::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'default_conversion_value' => 'float',\n      'description' => 'string',\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new CustomConversion(),\n      'NODE',\n      CustomConversion::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 167}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CustomConversionStatsResultFields;\nuse FacebookAds\\Object\\Values\\CustomConversionStatsResultAggregationValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomConversionStatsResult extends AbstractObject {\n\n  /**\n   * @return CustomConversionStatsResultFields\n   */\n  public static function getFieldsEnum() {\n    return CustomConversionStatsResultFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Aggregation'] = CustomConversionStatsResultAggregationValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\CustomUserSettingsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomUserSettings extends AbstractObject {\n\n  /**\n   * @return CustomUserSettingsFields\n   */\n  public static function getFieldsEnum() {\n    return CustomUserSettingsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\DACheckFields;\nuse FacebookAds\\Object\\Values\\DACheckConnectionMethodValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DACheck extends AbstractObject {\n\n  /**\n   * @return DACheckFields\n   */\n  public static function getFieldsEnum() {\n    return DACheckFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ConnectionMethod'] = DACheckConnectionMethodValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\DayPartFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DayPart extends AbstractObject {\n\n  /**\n   * @return DayPartFields\n   */\n  public static function getFieldsEnum() {\n    return DayPartFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\DeliveryCheckFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DeliveryCheck extends AbstractObject {\n\n  /**\n   * @return DeliveryCheckFields\n   */\n  public static function getFieldsEnum() {\n    return DeliveryCheckFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\DeliveryCheckExtraInfoFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DeliveryCheckExtraInfo extends AbstractObject {\n\n  /**\n   * @return DeliveryCheckExtraInfoFields\n   */\n  public static function getFieldsEnum() {\n    return DeliveryCheckExtraInfoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\DeliveryWindowFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DeliveryWindow extends AbstractCrudObject {\n\n  /**\n   * @return DeliveryWindowFields\n   */\n  public static function getFieldsEnum() {\n    return DeliveryWindowFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\DestinationFields;\nuse FacebookAds\\Object\\Values\\DestinationImageFetchStatusValues;\nuse FacebookAds\\Object\\Values\\DestinationVisibilityValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Destination extends AbstractCrudObject {\n\n  /**\n   * @return DestinationFields\n   */\n  public static function getFieldsEnum() {\n    return DestinationFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ImageFetchStatus'] = DestinationImageFetchStatusValues::getInstance()->getValues();\n    $ref_enums['Visibility'] = DestinationVisibilityValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAugmentedRealitiesMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/augmented_realities_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getChannelsToIntegrityStatus(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/channels_to_integrity_status',\n      new CatalogItemChannelsToIntegrityStatus(),\n      'EDGE',\n      CatalogItemChannelsToIntegrityStatus::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideosMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/videos_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Destination(),\n      'NODE',\n      Destination::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 154}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\DestinationCatalogSettingsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DestinationCatalogSettings extends AbstractCrudObject {\n\n  /**\n   * @return DestinationCatalogSettingsFields\n   */\n  public static function getFieldsEnum() {\n    return DestinationCatalogSettingsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new DestinationCatalogSettings(),\n      'NODE',\n      DestinationCatalogSettings::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\DynamicPostChildAttachmentFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DynamicPostChildAttachment extends AbstractObject {\n\n  /**\n   * @return DynamicPostChildAttachmentFields\n   */\n  public static function getFieldsEnum() {\n    return DynamicPostChildAttachmentFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\DynamicPriceConfigByDateFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DynamicPriceConfigByDate extends AbstractCrudObject {\n\n  /**\n   * @return DynamicPriceConfigByDateFields\n   */\n  public static function getFieldsEnum() {\n    return DynamicPriceConfigByDateFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new DynamicPriceConfigByDate(),\n      'NODE',\n      DynamicPriceConfigByDate::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\EngagementFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Engagement extends AbstractObject {\n\n  /**\n   * @return EngagementFields\n   */\n  public static function getFieldsEnum() {\n    return EngagementFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\EntityAtTextRangeFields;\nuse FacebookAds\\Object\\Values\\EntityAtTextRangeTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass EntityAtTextRange extends AbstractCrudObject {\n\n  /**\n   * @return EntityAtTextRangeFields\n   */\n  public static function getFieldsEnum() {\n    return EntityAtTextRangeFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Type'] = EntityAtTextRangeTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\EventFields;\nuse FacebookAds\\Object\\Values\\EventCategoryValues;\nuse FacebookAds\\Object\\Values\\EventEventStateFilterValues;\nuse FacebookAds\\Object\\Values\\EventOnlineEventFormatValues;\nuse FacebookAds\\Object\\Values\\EventTimeFilterValues;\nuse FacebookAds\\Object\\Values\\EventTypeValues;\nuse FacebookAds\\Object\\Values\\LiveVideoProjectionValues;\nuse FacebookAds\\Object\\Values\\LiveVideoSpatialAudioFormatValues;\nuse FacebookAds\\Object\\Values\\LiveVideoStatusValues;\nuse FacebookAds\\Object\\Values\\LiveVideoStereoscopicModeValues;\nuse FacebookAds\\Object\\Values\\LiveVideoStreamTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Event extends AbstractCrudObject {\n\n  /**\n   * @return EventFields\n   */\n  public static function getFieldsEnum() {\n    return EventFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Category'] = EventCategoryValues::getInstance()->getValues();\n    $ref_enums['OnlineEventFormat'] = EventOnlineEventFormatValues::getInstance()->getValues();\n    $ref_enums['Type'] = EventTypeValues::getInstance()->getValues();\n    $ref_enums['EventStateFilter'] = EventEventStateFilterValues::getInstance()->getValues();\n    $ref_enums['TimeFilter'] = EventTimeFilterValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getComments(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/comments',\n      new NullNode(),\n      'EDGE',\n      NullNode::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getFeed(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/feed',\n      new NullNode(),\n      'EDGE',\n      NullNode::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLiveVideos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/live_videos',\n      new NullNode(),\n      'EDGE',\n      NullNode::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createLiveVideo(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'content_tags' => 'list<string>',\n      'description' => 'string',\n      'enable_backup_ingest' => 'bool',\n      'encoding_settings' => 'string',\n      'event_params' => 'Object',\n      'fisheye_video_cropped' => 'bool',\n      'front_z_rotation' => 'float',\n      'is_audio_only' => 'bool',\n      'is_spherical' => 'bool',\n      'original_fov' => 'unsigned int',\n      'privacy' => 'string',\n      'projection' => 'projection_enum',\n      'published' => 'bool',\n      'schedule_custom_profile_image' => 'file',\n      'spatial_audio_format' => 'spatial_audio_format_enum',\n      'status' => 'status_enum',\n      'stereoscopic_mode' => 'stereoscopic_mode_enum',\n      'stop_on_delete_stream' => 'bool',\n      'stream_type' => 'stream_type_enum',\n      'title' => 'string',\n    );\n    $enums = array(\n      'projection_enum' => LiveVideoProjectionValues::getInstance()->getValues(),\n      'spatial_audio_format_enum' => LiveVideoSpatialAudioFormatValues::getInstance()->getValues(),\n      'status_enum' => LiveVideoStatusValues::getInstance()->getValues(),\n      'stereoscopic_mode_enum' => LiveVideoStereoscopicModeValues::getInstance()->getValues(),\n      'stream_type_enum' => LiveVideoStreamTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/live_videos',\n      new LiveVideo(),\n      'EDGE',\n      LiveVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPhotos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/photos',\n      new NullNode(),\n      'EDGE',\n      NullNode::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPicture(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/picture',\n      new NullNode(),\n      'EDGE',\n      NullNode::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPosts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/posts',\n      new NullNode(),\n      'EDGE',\n      NullNode::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getRoles(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/roles',\n      new Profile(),\n      'EDGE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTicketTiers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ticket_tiers',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/videos',\n      new NullNode(),\n      'EDGE',\n      NullNode::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Event(),\n      'NODE',\n      Event::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 351}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\EventSourceGroupFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass EventSourceGroup extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'event_source_groups';\n  }\n\n  /**\n   * @return EventSourceGroupFields\n   */\n  public static function getFieldsEnum() {\n    return EventSourceGroupFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSharedAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/shared_accounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createSharedAccount(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'accounts' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/shared_accounts',\n      new EventSourceGroup(),\n      'EDGE',\n      EventSourceGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new EventSourceGroup(),\n      'NODE',\n      EventSourceGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'event_sources' => 'list<string>',\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new EventSourceGroup(),\n      'NODE',\n      EventSourceGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 160}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ExperienceFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Experience extends AbstractCrudObject {\n\n  /**\n   * @return ExperienceFields\n   */\n  public static function getFieldsEnum() {\n    return ExperienceFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ExtendedCreditFields;\nuse FacebookAds\\Object\\Values\\ExtendedCreditAllocationConfigLiabilityTypeValues;\nuse FacebookAds\\Object\\Values\\ExtendedCreditAllocationConfigPartitionTypeValues;\nuse FacebookAds\\Object\\Values\\ExtendedCreditAllocationConfigSendBillToValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ExtendedCredit extends AbstractCrudObject {\n\n  /**\n   * @return ExtendedCreditFields\n   */\n  public static function getFieldsEnum() {\n    return ExtendedCreditFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getExtendedCreditInvoiceGroups(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/extended_credit_invoice_groups',\n      new ExtendedCreditInvoiceGroup(),\n      'EDGE',\n      ExtendedCreditInvoiceGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createExtendedCreditInvoiceGroup(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'emails' => 'list<string>',\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/extended_credit_invoice_groups',\n      new ExtendedCreditInvoiceGroup(),\n      'EDGE',\n      ExtendedCreditInvoiceGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOwningCreditAllocationConfigs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'receiving_business_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/owning_credit_allocation_configs',\n      new ExtendedCreditAllocationConfig(),\n      'EDGE',\n      ExtendedCreditAllocationConfig::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createOwningCreditAllocationConfig(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'amount' => 'Object',\n      'liability_type' => 'liability_type_enum',\n      'partition_type' => 'partition_type_enum',\n      'receiving_business_id' => 'string',\n      'send_bill_to' => 'send_bill_to_enum',\n    );\n    $enums = array(\n      'liability_type_enum' => ExtendedCreditAllocationConfigLiabilityTypeValues::getInstance()->getValues(),\n      'partition_type_enum' => ExtendedCreditAllocationConfigPartitionTypeValues::getInstance()->getValues(),\n      'send_bill_to_enum' => ExtendedCreditAllocationConfigSendBillToValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/owning_credit_allocation_configs',\n      new ExtendedCreditAllocationConfig(),\n      'EDGE',\n      ExtendedCreditAllocationConfig::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createWhatsappCreditSharingAndAttach(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'waba_currency' => 'string',\n      'waba_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/whatsapp_credit_sharing_and_attach',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ExtendedCredit(),\n      'NODE',\n      ExtendedCredit::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 212}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ExtendedCreditAllocationConfigFields;\nuse FacebookAds\\Object\\Values\\ExtendedCreditAllocationConfigLiabilityTypeValues;\nuse FacebookAds\\Object\\Values\\ExtendedCreditAllocationConfigPartitionTypeValues;\nuse FacebookAds\\Object\\Values\\ExtendedCreditAllocationConfigSendBillToValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ExtendedCreditAllocationConfig extends AbstractCrudObject {\n\n  /**\n   * @return ExtendedCreditAllocationConfigFields\n   */\n  public static function getFieldsEnum() {\n    return ExtendedCreditAllocationConfigFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['LiabilityType'] = ExtendedCreditAllocationConfigLiabilityTypeValues::getInstance()->getValues();\n    $ref_enums['PartitionType'] = ExtendedCreditAllocationConfigPartitionTypeValues::getInstance()->getValues();\n    $ref_enums['SendBillTo'] = ExtendedCreditAllocationConfigSendBillToValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ExtendedCreditAllocationConfig(),\n      'NODE',\n      ExtendedCreditAllocationConfig::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'amount' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new ExtendedCreditAllocationConfig(),\n      'NODE',\n      ExtendedCreditAllocationConfig::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 134}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ExtendedCreditInvoiceGroupFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ExtendedCreditInvoiceGroup extends AbstractCrudObject {\n\n  /**\n   * @return ExtendedCreditInvoiceGroupFields\n   */\n  public static function getFieldsEnum() {\n    return ExtendedCreditInvoiceGroupFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function deleteAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_account_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/ad_accounts',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ad_accounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdAccount(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_account_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/ad_accounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ExtendedCreditInvoiceGroup(),\n      'NODE',\n      ExtendedCreditInvoiceGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'emails' => 'list<string>',\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new ExtendedCreditInvoiceGroup(),\n      'NODE',\n      ExtendedCreditInvoiceGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 200}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ExternalEventSourceFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ExternalEventSource extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'external_event_sources';\n  }\n\n  /**\n   * @return ExternalEventSourceFields\n   */\n  public static function getFieldsEnum() {\n    return ExternalEventSourceFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 65}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\FAMEExportConfigFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass FAMEExportConfig extends AbstractObject {\n\n  /**\n   * @return FAMEExportConfigFields\n   */\n  public static function getFieldsEnum() {\n    return FAMEExportConfigFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\FlexibleTargetingFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass FlexibleTargeting extends AbstractObject {\n\n  /**\n   * @return FlexibleTargetingFields\n   */\n  public static function getFieldsEnum() {\n    return FlexibleTargetingFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\FlightFields;\nuse FacebookAds\\Object\\Values\\FlightImageFetchStatusValues;\nuse FacebookAds\\Object\\Values\\FlightVisibilityValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Flight extends AbstractCrudObject {\n\n  /**\n   * @return FlightFields\n   */\n  public static function getFieldsEnum() {\n    return FlightFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ImageFetchStatus'] = FlightImageFetchStatusValues::getInstance()->getValues();\n    $ref_enums['Visibility'] = FlightVisibilityValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAugmentedRealitiesMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/augmented_realities_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getChannelsToIntegrityStatus(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/channels_to_integrity_status',\n      new CatalogItemChannelsToIntegrityStatus(),\n      'EDGE',\n      CatalogItemChannelsToIntegrityStatus::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideosMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/videos_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Flight(),\n      'NODE',\n      Flight::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'currency' => 'string',\n      'description' => 'string',\n      'destination_airport' => 'string',\n      'destination_city' => 'string',\n      'images' => 'list<Object>',\n      'origin_airport' => 'string',\n      'origin_city' => 'string',\n      'price' => 'unsigned int',\n      'url' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new Flight(),\n      'NODE',\n      Flight::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 186}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\FundingSourceDetailsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass FundingSourceDetails extends AbstractCrudObject {\n\n  /**\n   * @return FundingSourceDetailsFields\n   */\n  public static function getFieldsEnum() {\n    return FundingSourceDetailsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\FundingSourceDetailsCouponFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass FundingSourceDetailsCoupon extends AbstractObject {\n\n  /**\n   * @return FundingSourceDetailsCouponFields\n   */\n  public static function getFieldsEnum() {\n    return FundingSourceDetailsCouponFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\FundraiserPersonToCharityFields;\nuse FacebookAds\\Object\\Values\\FundraiserPersonToCharityFundraiserTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass FundraiserPersonToCharity extends AbstractCrudObject {\n\n  /**\n   * @return FundraiserPersonToCharityFields\n   */\n  public static function getFieldsEnum() {\n    return FundraiserPersonToCharityFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['FundraiserType'] = FundraiserPersonToCharityFundraiserTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getDonations(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/donations',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createEndFundraiser(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/end_fundraiser',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getExternalDonations(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/external_donations',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createExternalDonation(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'amount_received' => 'unsigned int',\n      'currency' => 'string',\n      'donation_id_hash' => 'string',\n      'donation_time' => 'unsigned int',\n      'donor_id_hash' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/external_donations',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new FundraiserPersonToCharity(),\n      'NODE',\n      FundraiserPersonToCharity::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'description' => 'string',\n      'end_time' => 'datetime',\n      'external_event_name' => 'string',\n      'external_event_start_time' => 'datetime',\n      'external_event_uri' => 'string',\n      'external_fundraiser_uri' => 'string',\n      'external_id' => 'string',\n      'goal_amount' => 'unsigned int',\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new FundraiserPersonToCharity(),\n      'NODE',\n      FundraiserPersonToCharity::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 212}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\GameItemFields;\nuse FacebookAds\\Object\\Values\\GameItemActionValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass GameItem extends AbstractCrudObject {\n\n  /**\n   * @return GameItemFields\n   */\n  public static function getFieldsEnum() {\n    return GameItemFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Action'] = GameItemActionValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new GameItem(),\n      'NODE',\n      GameItem::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 83}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\GroupFields;\nuse FacebookAds\\Object\\Values\\AdVideoContainerTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoContentCategoryValues;\nuse FacebookAds\\Object\\Values\\AdVideoFormattingValues;\nuse FacebookAds\\Object\\Values\\AdVideoOriginalProjectionTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoSwapModeValues;\nuse FacebookAds\\Object\\Values\\AdVideoTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoUnpublishedContentTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoUploadPhaseValues;\nuse FacebookAds\\Object\\Values\\GroupGroupTypeValues;\nuse FacebookAds\\Object\\Values\\GroupJoinSettingValues;\nuse FacebookAds\\Object\\Values\\GroupPostPermissionsValues;\nuse FacebookAds\\Object\\Values\\GroupPurposeValues;\nuse FacebookAds\\Object\\Values\\LiveVideoBroadcastStatusValues;\nuse FacebookAds\\Object\\Values\\LiveVideoProjectionValues;\nuse FacebookAds\\Object\\Values\\LiveVideoSourceValues;\nuse FacebookAds\\Object\\Values\\LiveVideoSpatialAudioFormatValues;\nuse FacebookAds\\Object\\Values\\LiveVideoStatusValues;\nuse FacebookAds\\Object\\Values\\LiveVideoStereoscopicModeValues;\nuse FacebookAds\\Object\\Values\\LiveVideoStreamTypeValues;\nuse FacebookAds\\Object\\Values\\PhotoBackdatedTimeGranularityValues;\nuse FacebookAds\\Object\\Values\\PhotoUnpublishedContentTypeValues;\nuse FacebookAds\\Object\\Values\\PostBackdatedTimeGranularityValues;\nuse FacebookAds\\Object\\Values\\PostCheckinEntryPointValues;\nuse FacebookAds\\Object\\Values\\PostFormattingValues;\nuse FacebookAds\\Object\\Values\\PostPlaceAttachmentSettingValues;\nuse FacebookAds\\Object\\Values\\PostPostSurfacesBlacklistValues;\nuse FacebookAds\\Object\\Values\\PostPostingToRedspaceValues;\nuse FacebookAds\\Object\\Values\\PostTargetSurfaceValues;\nuse FacebookAds\\Object\\Values\\PostUnpublishedContentTypeValues;\nuse FacebookAds\\Object\\Values\\ProfilePictureSourceBreakingChangeValues;\nuse FacebookAds\\Object\\Values\\ProfilePictureSourceTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Group extends AbstractCrudObject {\n\n  /**\n   * @return GroupFields\n   */\n  public static function getFieldsEnum() {\n    return GroupFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['JoinSetting'] = GroupJoinSettingValues::getInstance()->getValues();\n    $ref_enums['PostPermissions'] = GroupPostPermissionsValues::getInstance()->getValues();\n    $ref_enums['Purpose'] = GroupPurposeValues::getInstance()->getValues();\n    $ref_enums['GroupType'] = GroupGroupTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function deleteAdmins(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'uid' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/admins',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdmin(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'uid' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/admins',\n      new Group(),\n      'EDGE',\n      Group::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAlbums(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/albums',\n      new Album(),\n      'EDGE',\n      Album::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAlbum(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'contributors' => 'list<int>',\n      'description' => 'string',\n      'is_default' => 'bool',\n      'location' => 'string',\n      'make_shared_album' => 'bool',\n      'message' => 'string',\n      'name' => 'string',\n      'place' => 'Object',\n      'privacy' => 'string',\n      'tags' => 'list<int>',\n      'visible' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/albums',\n      new Album(),\n      'EDGE',\n      Album::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAttachmentSurfaces(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/attachment_surfaces',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAttachmentSurface(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'title' => 'map',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/attachment_surfaces',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getDocs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/docs',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getEvents(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/events',\n      new Event(),\n      'EDGE',\n      Event::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getFeed(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'include_hidden' => 'bool',\n      'q' => 'string',\n      'show_expired' => 'bool',\n      'since' => 'datetime',\n      'until' => 'datetime',\n      'with' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/feed',\n      new Post(),\n      'EDGE',\n      Post::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createFeed(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'actions' => 'Object',\n      'adaptive_type' => 'string',\n      'album_id' => 'string',\n      'android_key_hash' => 'string',\n      'animated_effect_id' => 'unsigned int',\n      'application_id' => 'string',\n      'asked_fun_fact_prompt_id' => 'unsigned int',\n      'asset3d_id' => 'unsigned int',\n      'associated_id' => 'string',\n      'attach_place_suggestion' => 'bool',\n      'attached_media' => 'list<Object>',\n      'audience_exp' => 'bool',\n      'backdated_time' => 'datetime',\n      'backdated_time_granularity' => 'backdated_time_granularity_enum',\n      'call_to_action' => 'Object',\n      'caption' => 'string',\n      'checkin_entry_point' => 'checkin_entry_point_enum',\n      'child_attachments' => 'list<Object>',\n      'client_mutation_id' => 'string',\n      'composer_entry_picker' => 'string',\n      'composer_entry_point' => 'string',\n      'composer_entry_time' => 'unsigned int',\n      'composer_session_events_log' => 'string',\n      'composer_session_id' => 'string',\n      'composer_source_surface' => 'string',\n      'composer_type' => 'string',\n      'connection_class' => 'string',\n      'content_attachment' => 'string',\n      'coordinates' => 'Object',\n      'cta_link' => 'string',\n      'cta_type' => 'string',\n      'description' => 'string',\n      'direct_share_status' => 'unsigned int',\n      'expanded_height' => 'unsigned int',\n      'expanded_width' => 'unsigned int',\n      'feed_targeting' => 'Object',\n      'formatting' => 'formatting_enum',\n      'fun_fact_prompt_id' => 'unsigned int',\n      'fun_fact_toastee_id' => 'unsigned int',\n      'has_nickname' => 'bool',\n      'height' => 'unsigned int',\n      'holiday_card' => 'string',\n      'home_checkin_city_id' => 'Object',\n      'image_crops' => 'map',\n      'implicit_with_tags' => 'list<int>',\n      'instant_game_entry_point_data' => 'string',\n      'ios_bundle_id' => 'string',\n      'is_backout_draft' => 'bool',\n      'is_boost_intended' => 'bool',\n      'is_explicit_location' => 'bool',\n      'is_explicit_share' => 'bool',\n      'is_group_linking_post' => 'bool',\n      'is_photo_container' => 'bool',\n      'link' => 'string',\n      'location_source_id' => 'string',\n      'manual_privacy' => 'bool',\n      'message' => 'string',\n      'multi_share_end_card' => 'bool',\n      'multi_share_optimized' => 'bool',\n      'name' => 'string',\n      'nectar_module' => 'string',\n      'object_attachment' => 'string',\n      'offer_like_post_id' => 'unsigned int',\n      'og_action_type_id' => 'string',\n      'og_hide_object_attachment' => 'bool',\n      'og_icon_id' => 'string',\n      'og_object_id' => 'string',\n      'og_phrase' => 'string',\n      'og_set_profile_badge' => 'bool',\n      'og_suggestion_mechanism' => 'string',\n      'page_recommendation' => 'string',\n      'picture' => 'string',\n      'place' => 'Object',\n      'place_attachment_setting' => 'place_attachment_setting_enum',\n      'place_list' => 'string',\n      'place_list_data' => 'list',\n      'post_surfaces_blacklist' => 'list<post_surfaces_blacklist_enum>',\n      'posting_to_redspace' => 'posting_to_redspace_enum',\n      'privacy' => 'string',\n      'prompt_id' => 'string',\n      'prompt_tracking_string' => 'string',\n      'properties' => 'Object',\n      'proxied_app_id' => 'string',\n      'publish_event_id' => 'unsigned int',\n      'published' => 'bool',\n      'quote' => 'string',\n      'react_mode_metadata' => 'string',\n      'ref' => 'list<string>',\n      'referenceable_image_ids' => 'list<string>',\n      'referral_id' => 'string',\n      'scheduled_publish_time' => 'datetime',\n      'source' => 'string',\n      'sponsor_id' => 'string',\n      'sponsor_relationship' => 'unsigned int',\n      'suggested_place_id' => 'Object',\n      'tags' => 'list<int>',\n      'target_surface' => 'target_surface_enum',\n      'targeting' => 'Object',\n      'text_format_metadata' => 'string',\n      'text_format_preset_id' => 'string',\n      'text_only_place' => 'string',\n      'throwback_camera_roll_media' => 'string',\n      'thumbnail' => 'file',\n      'time_since_original_post' => 'unsigned int',\n      'title' => 'string',\n      'tracking_info' => 'string',\n      'unpublished_content_type' => 'unpublished_content_type_enum',\n      'user_selected_tags' => 'bool',\n      'video_start_time_ms' => 'unsigned int',\n      'viewer_coordinates' => 'Object',\n      'width' => 'unsigned int',\n    );\n    $enums = array(\n      'backdated_time_granularity_enum' => PostBackdatedTimeGranularityValues::getInstance()->getValues(),\n      'checkin_entry_point_enum' => PostCheckinEntryPointValues::getInstance()->getValues(),\n      'formatting_enum' => PostFormattingValues::getInstance()->getValues(),\n      'place_attachment_setting_enum' => PostPlaceAttachmentSettingValues::getInstance()->getValues(),\n      'post_surfaces_blacklist_enum' => PostPostSurfacesBlacklistValues::getInstance()->getValues(),\n      'posting_to_redspace_enum' => PostPostingToRedspaceValues::getInstance()->getValues(),\n      'target_surface_enum' => PostTargetSurfaceValues::getInstance()->getValues(),\n      'unpublished_content_type_enum' => PostUnpublishedContentTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/feed',\n      new Post(),\n      'EDGE',\n      Post::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getFiles(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/files',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getGroups(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/groups',\n      new Group(),\n      'EDGE',\n      Group::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createGroup(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'admin' => 'int',\n      'description' => 'string',\n      'group_icon_id' => 'Object',\n      'group_type' => 'group_type_enum',\n      'join_setting' => 'join_setting_enum',\n      'name' => 'string',\n      'parent_id' => 'Object',\n      'post_permissions' => 'post_permissions_enum',\n      'post_requires_admin_approval' => 'bool',\n      'privacy' => 'string',\n      'ref' => 'string',\n    );\n    $enums = array(\n      'group_type_enum' => GroupGroupTypeValues::getInstance()->getValues(),\n      'join_setting_enum' => GroupJoinSettingValues::getInstance()->getValues(),\n      'post_permissions_enum' => GroupPostPermissionsValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/groups',\n      new Group(),\n      'EDGE',\n      Group::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLiveVideos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'broadcast_status' => 'list<broadcast_status_enum>',\n      'source' => 'source_enum',\n    );\n    $enums = array(\n      'broadcast_status_enum' => LiveVideoBroadcastStatusValues::getInstance()->getValues(),\n      'source_enum' => LiveVideoSourceValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/live_videos',\n      new LiveVideo(),\n      'EDGE',\n      LiveVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createLiveVideo(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'content_tags' => 'list<string>',\n      'description' => 'string',\n      'enable_backup_ingest' => 'bool',\n      'encoding_settings' => 'string',\n      'event_params' => 'Object',\n      'fisheye_video_cropped' => 'bool',\n      'front_z_rotation' => 'float',\n      'is_audio_only' => 'bool',\n      'is_spherical' => 'bool',\n      'original_fov' => 'unsigned int',\n      'privacy' => 'string',\n      'projection' => 'projection_enum',\n      'published' => 'bool',\n      'schedule_custom_profile_image' => 'file',\n      'spatial_audio_format' => 'spatial_audio_format_enum',\n      'status' => 'status_enum',\n      'stereoscopic_mode' => 'stereoscopic_mode_enum',\n      'stop_on_delete_stream' => 'bool',\n      'stream_type' => 'stream_type_enum',\n      'title' => 'string',\n    );\n    $enums = array(\n      'projection_enum' => LiveVideoProjectionValues::getInstance()->getValues(),\n      'spatial_audio_format_enum' => LiveVideoSpatialAudioFormatValues::getInstance()->getValues(),\n      'status_enum' => LiveVideoStatusValues::getInstance()->getValues(),\n      'stereoscopic_mode_enum' => LiveVideoStereoscopicModeValues::getInstance()->getValues(),\n      'stream_type_enum' => LiveVideoStreamTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/live_videos',\n      new LiveVideo(),\n      'EDGE',\n      LiveVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteMembers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'email' => 'string',\n      'member' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/members',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createMember(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'email' => 'string',\n      'from' => 'int',\n      'member' => 'int',\n      'rate' => 'unsigned int',\n      'source' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/members',\n      new Group(),\n      'EDGE',\n      Group::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getOptedInMembers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/opted_in_members',\n      new User(),\n      'EDGE',\n      User::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPhoto(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'aid' => 'string',\n      'allow_spherical_photo' => 'bool',\n      'alt_text_custom' => 'string',\n      'android_key_hash' => 'string',\n      'application_id' => 'string',\n      'attempt' => 'unsigned int',\n      'audience_exp' => 'bool',\n      'backdated_time' => 'datetime',\n      'backdated_time_granularity' => 'backdated_time_granularity_enum',\n      'caption' => 'string',\n      'composer_session_id' => 'string',\n      'direct_share_status' => 'unsigned int',\n      'feed_targeting' => 'Object',\n      'filter_type' => 'unsigned int',\n      'full_res_is_coming_later' => 'bool',\n      'initial_view_heading_override_degrees' => 'unsigned int',\n      'initial_view_pitch_override_degrees' => 'unsigned int',\n      'initial_view_vertical_fov_override_degrees' => 'unsigned int',\n      'ios_bundle_id' => 'string',\n      'is_explicit_location' => 'bool',\n      'is_explicit_place' => 'bool',\n      'manual_privacy' => 'bool',\n      'message' => 'string',\n      'name' => 'string',\n      'no_story' => 'bool',\n      'offline_id' => 'unsigned int',\n      'og_action_type_id' => 'string',\n      'og_icon_id' => 'string',\n      'og_object_id' => 'string',\n      'og_phrase' => 'string',\n      'og_set_profile_badge' => 'bool',\n      'og_suggestion_mechanism' => 'string',\n      'place' => 'Object',\n      'privacy' => 'string',\n      'profile_id' => 'int',\n      'proxied_app_id' => 'string',\n      'published' => 'bool',\n      'qn' => 'string',\n      'scheduled_publish_time' => 'unsigned int',\n      'spherical_metadata' => 'map',\n      'sponsor_id' => 'string',\n      'sponsor_relationship' => 'unsigned int',\n      'tags' => 'list<Object>',\n      'target_id' => 'int',\n      'targeting' => 'Object',\n      'time_since_original_post' => 'unsigned int',\n      'uid' => 'int',\n      'unpublished_content_type' => 'unpublished_content_type_enum',\n      'url' => 'string',\n      'user_selected_tags' => 'bool',\n      'vault_image_id' => 'string',\n    );\n    $enums = array(\n      'backdated_time_granularity_enum' => PhotoBackdatedTimeGranularityValues::getInstance()->getValues(),\n      'unpublished_content_type_enum' => PhotoUnpublishedContentTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/photos',\n      new Photo(),\n      'EDGE',\n      Photo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPicture(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'breaking_change' => 'breaking_change_enum',\n      'height' => 'int',\n      'redirect' => 'bool',\n      'type' => 'type_enum',\n      'width' => 'int',\n    );\n    $enums = array(\n      'breaking_change_enum' => ProfilePictureSourceBreakingChangeValues::getInstance()->getValues(),\n      'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/picture',\n      new ProfilePictureSource(),\n      'EDGE',\n      ProfilePictureSource::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'type_enum' => AdVideoTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/videos',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createVideo(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adaptive_type' => 'string',\n      'animated_effect_id' => 'unsigned int',\n      'application_id' => 'string',\n      'asked_fun_fact_prompt_id' => 'unsigned int',\n      'audio_story_wave_animation_handle' => 'string',\n      'composer_entry_picker' => 'string',\n      'composer_entry_point' => 'string',\n      'composer_entry_time' => 'unsigned int',\n      'composer_session_events_log' => 'string',\n      'composer_session_id' => 'string',\n      'composer_source_surface' => 'string',\n      'composer_type' => 'string',\n      'container_type' => 'container_type_enum',\n      'content_category' => 'content_category_enum',\n      'creative_tools' => 'string',\n      'description' => 'string',\n      'embeddable' => 'bool',\n      'end_offset' => 'unsigned int',\n      'fbuploader_video_file_chunk' => 'string',\n      'file_size' => 'unsigned int',\n      'file_url' => 'string',\n      'fisheye_video_cropped' => 'bool',\n      'formatting' => 'formatting_enum',\n      'fov' => 'unsigned int',\n      'front_z_rotation' => 'float',\n      'fun_fact_prompt_id' => 'unsigned int',\n      'fun_fact_toastee_id' => 'unsigned int',\n      'guide' => 'list<list<unsigned int>>',\n      'guide_enabled' => 'bool',\n      'has_nickname' => 'bool',\n      'holiday_card' => 'string',\n      'initial_heading' => 'unsigned int',\n      'initial_pitch' => 'unsigned int',\n      'instant_game_entry_point_data' => 'string',\n      'is_boost_intended' => 'bool',\n      'is_explicit_share' => 'bool',\n      'is_group_linking_post' => 'bool',\n      'is_voice_clip' => 'bool',\n      'location_source_id' => 'string',\n      'manual_privacy' => 'bool',\n      'offer_like_post_id' => 'unsigned int',\n      'og_action_type_id' => 'string',\n      'og_icon_id' => 'string',\n      'og_object_id' => 'string',\n      'og_phrase' => 'string',\n      'og_suggestion_mechanism' => 'string',\n      'original_fov' => 'unsigned int',\n      'original_projection_type' => 'original_projection_type_enum',\n      'publish_event_id' => 'unsigned int',\n      'published' => 'bool',\n      'react_mode_metadata' => 'string',\n      'referenced_sticker_id' => 'string',\n      'replace_video_id' => 'string',\n      'scheduled_publish_time' => 'unsigned int',\n      'slideshow_spec' => 'map',\n      'source' => 'string',\n      'source_instagram_media_id' => 'string',\n      'spherical' => 'bool',\n      'start_offset' => 'unsigned int',\n      'swap_mode' => 'swap_mode_enum',\n      'text_format_metadata' => 'string',\n      'throwback_camera_roll_media' => 'string',\n      'thumb' => 'file',\n      'time_since_original_post' => 'unsigned int',\n      'title' => 'string',\n      'transcode_setting_properties' => 'string',\n      'unpublished_content_type' => 'unpublished_content_type_enum',\n      'upload_phase' => 'upload_phase_enum',\n      'upload_session_id' => 'string',\n      'upload_setting_properties' => 'string',\n      'video_file_chunk' => 'string',\n      'video_id_original' => 'string',\n      'video_start_time_ms' => 'unsigned int',\n      'waterfall_id' => 'string',\n    );\n    $enums = array(\n      'container_type_enum' => AdVideoContainerTypeValues::getInstance()->getValues(),\n      'content_category_enum' => AdVideoContentCategoryValues::getInstance()->getValues(),\n      'formatting_enum' => AdVideoFormattingValues::getInstance()->getValues(),\n      'original_projection_type_enum' => AdVideoOriginalProjectionTypeValues::getInstance()->getValues(),\n      'swap_mode_enum' => AdVideoSwapModeValues::getInstance()->getValues(),\n      'unpublished_content_type_enum' => AdVideoUnpublishedContentTypeValues::getInstance()->getValues(),\n      'upload_phase_enum' => AdVideoUploadPhaseValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/videos',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'icon_size' => 'icon_size_enum',\n    );\n    $enums = array(\n      'icon_size_enum' => array(\n        '16',\n        '34',\n        '50',\n        '68',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Group(),\n      'NODE',\n      Group::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'cover' => 'string',\n      'cover_url' => 'string',\n      'description' => 'string',\n      'focus_x' => 'float',\n      'focus_y' => 'float',\n      'group_icon' => 'string',\n      'is_official_group' => 'bool',\n      'join_setting' => 'join_setting_enum',\n      'name' => 'string',\n      'no_feed_story' => 'bool',\n      'offset_y' => 'int',\n      'post_permissions' => 'post_permissions_enum',\n      'post_requires_admin_approval' => 'bool',\n      'privacy' => 'string',\n      'purpose' => 'purpose_enum',\n      'update_view_time' => 'bool',\n    );\n    $enums = array(\n      'join_setting_enum' => GroupJoinSettingValues::getInstance()->getValues(),\n      'post_permissions_enum' => GroupPostPermissionsValues::getInstance()->getValues(),\n      'purpose_enum' => GroupPurposeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new Group(),\n      'NODE',\n      Group::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 1003}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\HomeListingFields;\nuse FacebookAds\\Object\\Values\\HomeListingImageFetchStatusValues;\nuse FacebookAds\\Object\\Values\\HomeListingVisibilityValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass HomeListing extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'home_listings';\n  }\n\n  /**\n   * @return HomeListingFields\n   */\n  public static function getFieldsEnum() {\n    return HomeListingFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ImageFetchStatus'] = HomeListingImageFetchStatusValues::getInstance()->getValues();\n    $ref_enums['Visibility'] = HomeListingVisibilityValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAugmentedRealitiesMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/augmented_realities_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getChannelsToIntegrityStatus(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/channels_to_integrity_status',\n      new CatalogItemChannelsToIntegrityStatus(),\n      'EDGE',\n      CatalogItemChannelsToIntegrityStatus::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideosMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/videos_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new HomeListing(),\n      'NODE',\n      HomeListing::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'address' => 'Object',\n      'availability' => 'string',\n      'currency' => 'string',\n      'description' => 'string',\n      'images' => 'list<Object>',\n      'listing_type' => 'string',\n      'name' => 'string',\n      'num_baths' => 'float',\n      'num_beds' => 'float',\n      'num_units' => 'float',\n      'price' => 'float',\n      'property_type' => 'string',\n      'url' => 'string',\n      'year_built' => 'unsigned int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new HomeListing(),\n      'NODE',\n      HomeListing::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 221}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\HotelFields;\nuse FacebookAds\\Object\\Values\\HotelImageFetchStatusValues;\nuse FacebookAds\\Object\\Values\\HotelVisibilityValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Hotel extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'hotels';\n  }\n\n  /**\n   * @return HotelFields\n   */\n  public static function getFieldsEnum() {\n    return HotelFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ImageFetchStatus'] = HotelImageFetchStatusValues::getInstance()->getValues();\n    $ref_enums['Visibility'] = HotelVisibilityValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAugmentedRealitiesMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/augmented_realities_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getChannelsToIntegrityStatus(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/channels_to_integrity_status',\n      new CatalogItemChannelsToIntegrityStatus(),\n      'EDGE',\n      CatalogItemChannelsToIntegrityStatus::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getHotelRooms(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/hotel_rooms',\n      new HotelRoom(),\n      'EDGE',\n      HotelRoom::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideosMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/videos_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Hotel(),\n      'NODE',\n      Hotel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'address' => 'Object',\n      'applinks' => 'Object',\n      'base_price' => 'unsigned int',\n      'brand' => 'string',\n      'currency' => 'string',\n      'description' => 'string',\n      'guest_ratings' => 'list<Object>',\n      'images' => 'list<Object>',\n      'name' => 'string',\n      'phone' => 'string',\n      'star_rating' => 'float',\n      'url' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new Hotel(),\n      'NODE',\n      Hotel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 242}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\HotelRoomFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass HotelRoom extends AbstractCrudObject {\n\n  /**\n   * @return HotelRoomFields\n   */\n  public static function getFieldsEnum() {\n    return HotelRoomFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getPricingVariables(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/pricing_variables',\n      new DynamicPriceConfigByDate(),\n      'EDGE',\n      DynamicPriceConfigByDate::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new HotelRoom(),\n      'NODE',\n      HotelRoom::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 104}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\IDNameFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass IDName extends AbstractCrudObject {\n\n  /**\n   * @return IDNameFields\n   */\n  public static function getFieldsEnum() {\n    return IDNameFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\IGBCAdsPermissionFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass IGBCAdsPermission extends AbstractCrudObject {\n\n  /**\n   * @return IGBCAdsPermissionFields\n   */\n  public static function getFieldsEnum() {\n    return IGBCAdsPermissionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new IGBCAdsPermission(),\n      'NODE',\n      IGBCAdsPermission::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\IGCommentFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass IGComment extends AbstractCrudObject {\n\n  /**\n   * @return IGCommentFields\n   */\n  public static function getFieldsEnum() {\n    return IGCommentFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getReplies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/replies',\n      new IGComment(),\n      'EDGE',\n      IGComment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createReply(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'message' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/replies',\n      new IGComment(),\n      'EDGE',\n      IGComment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new IGComment(),\n      'NODE',\n      IGComment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'hide' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new IGComment(),\n      'NODE',\n      IGComment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 175}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\IGMediaFields;\nuse FacebookAds\\Object\\Values\\InstagramInsightsResultBreakdownValues;\nuse FacebookAds\\Object\\Values\\InstagramInsightsResultMetricValues;\nuse FacebookAds\\Object\\Values\\InstagramInsightsResultPeriodValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass IGMedia extends AbstractCrudObject {\n\n  /**\n   * @return IGMediaFields\n   */\n  public static function getFieldsEnum() {\n    return IGMediaFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getChildren(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/children',\n      new IGMedia(),\n      'EDGE',\n      IGMedia::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getComments(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/comments',\n      new IGComment(),\n      'EDGE',\n      IGComment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createComment(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'message' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/comments',\n      new IGComment(),\n      'EDGE',\n      IGComment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInsights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'breakdown' => 'list<breakdown_enum>',\n      'metric' => 'list<metric_enum>',\n      'period' => 'list<period_enum>',\n    );\n    $enums = array(\n      'breakdown_enum' => InstagramInsightsResultBreakdownValues::getInstance()->getValues(),\n      'metric_enum' => InstagramInsightsResultMetricValues::getInstance()->getValues(),\n      'period_enum' => InstagramInsightsResultPeriodValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/insights',\n      new InstagramInsightsResult(),\n      'EDGE',\n      InstagramInsightsResult::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteProductTags(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'child_index' => 'unsigned int',\n      'deleted_tags' => 'list<map>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/product_tags',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getProductTags(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/product_tags',\n      new ShadowIGMediaProductTags(),\n      'EDGE',\n      ShadowIGMediaProductTags::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createProductTag(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'child_index' => 'unsigned int',\n      'updated_tags' => 'list<map>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/product_tags',\n      new ShadowIGMediaProductTags(),\n      'EDGE',\n      ShadowIGMediaProductTags::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new IGMedia(),\n      'NODE',\n      IGMedia::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'comment_enabled' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new IGMedia(),\n      'NODE',\n      IGMedia::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 280}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\IGUserFields;\nuse FacebookAds\\Object\\Values\\InstagramInsightsResultBreakdownValues;\nuse FacebookAds\\Object\\Values\\InstagramInsightsResultMetricTypeValues;\nuse FacebookAds\\Object\\Values\\InstagramInsightsResultMetricValues;\nuse FacebookAds\\Object\\Values\\InstagramInsightsResultPeriodValues;\nuse FacebookAds\\Object\\Values\\InstagramInsightsResultTimeframeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass IGUser extends AbstractCrudObject {\n\n  /**\n   * @return IGUserFields\n   */\n  public static function getFieldsEnum() {\n    return IGUserFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getAvailableCatalogs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/available_catalogs',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCatalogProductSearch(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'catalog_id' => 'string',\n      'q' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/catalog_product_search',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getContentPublishingLimit(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'since' => 'datetime',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/content_publishing_limit',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInsights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'breakdown' => 'list<breakdown_enum>',\n      'metric' => 'list<metric_enum>',\n      'metric_type' => 'metric_type_enum',\n      'period' => 'list<period_enum>',\n      'since' => 'datetime',\n      'timeframe' => 'timeframe_enum',\n      'until' => 'datetime',\n    );\n    $enums = array(\n      'breakdown_enum' => InstagramInsightsResultBreakdownValues::getInstance()->getValues(),\n      'metric_enum' => InstagramInsightsResultMetricValues::getInstance()->getValues(),\n      'metric_type_enum' => InstagramInsightsResultMetricTypeValues::getInstance()->getValues(),\n      'period_enum' => InstagramInsightsResultPeriodValues::getInstance()->getValues(),\n      'timeframe_enum' => InstagramInsightsResultTimeframeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/insights',\n      new InstagramInsightsResult(),\n      'EDGE',\n      InstagramInsightsResult::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLiveMedia(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'since' => 'datetime',\n      'until' => 'datetime',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/live_media',\n      new IGMedia(),\n      'EDGE',\n      IGMedia::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getMedia(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'since' => 'datetime',\n      'until' => 'datetime',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/media',\n      new IGMedia(),\n      'EDGE',\n      IGMedia::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createMedia(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'audio_name' => 'string',\n      'caption' => 'string',\n      'children' => 'list<string>',\n      'cover_url' => 'string',\n      'image_url' => 'string',\n      'is_carousel_item' => 'bool',\n      'location_id' => 'string',\n      'media_type' => 'string',\n      'product_tags' => 'list<map>',\n      'share_to_feed' => 'bool',\n      'thumb_offset' => 'string',\n      'user_tags' => 'list<map>',\n      'video_url' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/media',\n      new IGMedia(),\n      'EDGE',\n      IGMedia::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createMediaPublish(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'creation_id' => 'unsigned int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/media_publish',\n      new IGMedia(),\n      'EDGE',\n      IGMedia::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createMention(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'comment_id' => 'string',\n      'media_id' => 'string',\n      'message' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/mentions',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getNotificationMessageTokens(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/notification_message_tokens',\n      new UserPageOneTimeOptInTokenSettings(),\n      'EDGE',\n      UserPageOneTimeOptInTokenSettings::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getProductAppeal(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'product_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/product_appeal',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createProductAppeal(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'appeal_reason' => 'string',\n      'product_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/product_appeal',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getRecentlySearchedHashtags(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/recently_searched_hashtags',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getStories(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/stories',\n      new IGMedia(),\n      'EDGE',\n      IGMedia::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTags(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/tags',\n      new IGMedia(),\n      'EDGE',\n      IGMedia::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adgroup_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new IGUser(),\n      'NODE',\n      IGUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 471}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ImageCopyrightFields;\nuse FacebookAds\\Object\\Values\\ImageCopyrightGeoOwnershipValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ImageCopyright extends AbstractCrudObject {\n\n  /**\n   * @return ImageCopyrightFields\n   */\n  public static function getFieldsEnum() {\n    return ImageCopyrightFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['GeoOwnership'] = ImageCopyrightGeoOwnershipValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ImageCopyright(),\n      'NODE',\n      ImageCopyright::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'artist' => 'string',\n      'creator' => 'string',\n      'custom_id' => 'string',\n      'description' => 'string',\n      'geo_ownership' => 'list<geo_ownership_enum>',\n      'original_content_creation_date' => 'unsigned int',\n      'title' => 'string',\n    );\n    $enums = array(\n      'geo_ownership_enum' => ImageCopyrightGeoOwnershipValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new ImageCopyright(),\n      'NODE',\n      ImageCopyright::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 114}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\InsightsResultFields;\nuse FacebookAds\\Object\\Values\\InsightsResultDatePresetValues;\nuse FacebookAds\\Object\\Values\\InsightsResultPeriodValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass InsightsResult extends AbstractCrudObject {\n\n  /**\n   * @return InsightsResultFields\n   */\n  public static function getFieldsEnum() {\n    return InsightsResultFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['DatePreset'] = InsightsResultDatePresetValues::getInstance()->getValues();\n    $ref_enums['Period'] = InsightsResultPeriodValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\InstagramInsightsResultFields;\nuse FacebookAds\\Object\\Values\\InstagramInsightsResultBreakdownValues;\nuse FacebookAds\\Object\\Values\\InstagramInsightsResultMetricTypeValues;\nuse FacebookAds\\Object\\Values\\InstagramInsightsResultMetricValues;\nuse FacebookAds\\Object\\Values\\InstagramInsightsResultPeriodValues;\nuse FacebookAds\\Object\\Values\\InstagramInsightsResultTimeframeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass InstagramInsightsResult extends AbstractCrudObject {\n\n  /**\n   * @return InstagramInsightsResultFields\n   */\n  public static function getFieldsEnum() {\n    return InstagramInsightsResultFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Breakdown'] = InstagramInsightsResultBreakdownValues::getInstance()->getValues();\n    $ref_enums['Metric'] = InstagramInsightsResultMetricValues::getInstance()->getValues();\n    $ref_enums['Period'] = InstagramInsightsResultPeriodValues::getInstance()->getValues();\n    $ref_enums['MetricType'] = InstagramInsightsResultMetricTypeValues::getInstance()->getValues();\n    $ref_enums['Timeframe'] = InstagramInsightsResultTimeframeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 68}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\InstagramInsightsValueFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass InstagramInsightsValue extends AbstractObject {\n\n  /**\n   * @return InstagramInsightsValueFields\n   */\n  public static function getFieldsEnum() {\n    return InstagramInsightsValueFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\InstagramUserFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass InstagramUser extends AbstractCrudObject {\n\n  /**\n   * @return InstagramUserFields\n   */\n  public static function getFieldsEnum() {\n    return InstagramUserFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getAgencies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/agencies',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAuthorizedAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/authorized_adaccounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAuthorizedAdAccount(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'account_id' => 'string',\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/authorized_adaccounts',\n      new InstagramUser(),\n      'EDGE',\n      InstagramUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adgroup_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new InstagramUser(),\n      'NODE',\n      InstagramUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 154}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\InstantArticlesStatsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass InstantArticlesStats extends AbstractObject {\n\n  /**\n   * @return InstantArticlesStatsFields\n   */\n  public static function getFieldsEnum() {\n    return InstantArticlesStatsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\IosAppLinkFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass IosAppLink extends AbstractObject {\n\n  /**\n   * @return IosAppLinkFields\n   */\n  public static function getFieldsEnum() {\n    return IosAppLinkFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\JobOpeningFields;\nuse FacebookAds\\Object\\Values\\JobOpeningJobStatusValues;\nuse FacebookAds\\Object\\Values\\JobOpeningPlatformReviewStatusValues;\nuse FacebookAds\\Object\\Values\\JobOpeningReviewRejectionReasonsValues;\nuse FacebookAds\\Object\\Values\\JobOpeningTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass JobOpening extends AbstractCrudObject {\n\n  /**\n   * @return JobOpeningFields\n   */\n  public static function getFieldsEnum() {\n    return JobOpeningFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['JobStatus'] = JobOpeningJobStatusValues::getInstance()->getValues();\n    $ref_enums['PlatformReviewStatus'] = JobOpeningPlatformReviewStatusValues::getInstance()->getValues();\n    $ref_enums['ReviewRejectionReasons'] = JobOpeningReviewRejectionReasonsValues::getInstance()->getValues();\n    $ref_enums['Type'] = JobOpeningTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new JobOpening(),\n      'NODE',\n      JobOpening::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 89}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\KeyValueFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass KeyValue extends AbstractObject {\n\n  /**\n   * @return KeyValueFields\n   */\n  public static function getFieldsEnum() {\n    return KeyValueFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LeadFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Lead extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'leads';\n  }\n\n  /**\n   * @return LeadFields\n   */\n  public static function getFieldsEnum() {\n    return LeadFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Lead(),\n      'NODE',\n      Lead::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 111}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LeadGenAppointmentBookingInfoFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadGenAppointmentBookingInfo extends AbstractObject {\n\n  /**\n   * @return LeadGenAppointmentBookingInfoFields\n   */\n  public static function getFieldsEnum() {\n    return LeadGenAppointmentBookingInfoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LeadGenConditionalQuestionsGroupChoicesFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadGenConditionalQuestionsGroupChoices extends AbstractObject {\n\n  /**\n   * @return LeadGenConditionalQuestionsGroupChoicesFields\n   */\n  public static function getFieldsEnum() {\n    return LeadGenConditionalQuestionsGroupChoicesFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LeadGenConditionalQuestionsGroupQuestionsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadGenConditionalQuestionsGroupQuestions extends AbstractObject {\n\n  /**\n   * @return LeadGenConditionalQuestionsGroupQuestionsFields\n   */\n  public static function getFieldsEnum() {\n    return LeadGenConditionalQuestionsGroupQuestionsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LeadGenDraftQuestionFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadGenDraftQuestion extends AbstractObject {\n\n  /**\n   * @return LeadGenDraftQuestionFields\n   */\n  public static function getFieldsEnum() {\n    return LeadGenDraftQuestionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LeadgenFormFields;\nuse FacebookAds\\Object\\Values\\LeadgenFormLocaleValues;\nuse FacebookAds\\Object\\Values\\LeadgenFormStatusValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadgenForm extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'leadgen_forms';\n  }\n\n  /**\n   * @return LeadgenFormFields\n   */\n  public static function getFieldsEnum() {\n    return LeadgenFormFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Status'] = LeadgenFormStatusValues::getInstance()->getValues();\n    $ref_enums['Locale'] = LeadgenFormLocaleValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getLeads(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/leads',\n      new Lead(),\n      'EDGE',\n      Lead::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTestLeads(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/test_leads',\n      new Lead(),\n      'EDGE',\n      Lead::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createTestLead(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'custom_disclaimer_responses' => 'list<Object>',\n      'field_data' => 'list<Object>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/test_leads',\n      new Lead(),\n      'EDGE',\n      Lead::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new LeadgenForm(),\n      'NODE',\n      LeadgenForm::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'status' => 'status_enum',\n    );\n    $enums = array(\n      'status_enum' => LeadgenFormStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new LeadgenForm(),\n      'NODE',\n      LeadgenForm::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 188}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LeadGenPostSubmissionCheckResultFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadGenPostSubmissionCheckResult extends AbstractObject {\n\n  /**\n   * @return LeadGenPostSubmissionCheckResultFields\n   */\n  public static function getFieldsEnum() {\n    return LeadGenPostSubmissionCheckResultFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LeadGenQuestionFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadGenQuestion extends AbstractCrudObject {\n\n  /**\n   * @return LeadGenQuestionFields\n   */\n  public static function getFieldsEnum() {\n    return LeadGenQuestionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LeadGenQuestionOptionFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadGenQuestionOption extends AbstractObject {\n\n  /**\n   * @return LeadGenQuestionOptionFields\n   */\n  public static function getFieldsEnum() {\n    return LeadGenQuestionOptionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LifeEventFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LifeEvent extends AbstractCrudObject {\n\n  /**\n   * @return LifeEventFields\n   */\n  public static function getFieldsEnum() {\n    return LifeEventFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getLikes(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/likes',\n      new Profile(),\n      'EDGE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new LifeEvent(),\n      'NODE',\n      LifeEvent::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 104}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LinkFields;\nuse FacebookAds\\Object\\Values\\CommentCommentPrivacyValueValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Link extends AbstractCrudObject {\n\n  /**\n   * @return LinkFields\n   */\n  public static function getFieldsEnum() {\n    return LinkFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function createComment(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'attachment_id' => 'string',\n      'attachment_share_url' => 'string',\n      'attachment_url' => 'string',\n      'comment_privacy_value' => 'comment_privacy_value_enum',\n      'facepile_mentioned_ids' => 'list<string>',\n      'feedback_source' => 'string',\n      'is_offline' => 'bool',\n      'message' => 'string',\n      'nectar_module' => 'string',\n      'object_id' => 'string',\n      'parent_comment_id' => 'Object',\n      'text' => 'string',\n      'tracking' => 'string',\n    );\n    $enums = array(\n      'comment_privacy_value_enum' => CommentCommentPrivacyValueValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/comments',\n      new Comment(),\n      'EDGE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLikes(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/likes',\n      new Profile(),\n      'EDGE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Link(),\n      'NODE',\n      Link::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 142}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LiveVideoFields;\nuse FacebookAds\\Object\\Values\\CommentFilterValues;\nuse FacebookAds\\Object\\Values\\CommentLiveFilterValues;\nuse FacebookAds\\Object\\Values\\CommentOrderValues;\nuse FacebookAds\\Object\\Values\\LiveVideoBroadcastStatusValues;\nuse FacebookAds\\Object\\Values\\LiveVideoLiveCommentModerationSettingValues;\nuse FacebookAds\\Object\\Values\\LiveVideoPersistentStreamKeyStatusValues;\nuse FacebookAds\\Object\\Values\\LiveVideoProjectionValues;\nuse FacebookAds\\Object\\Values\\LiveVideoSourceValues;\nuse FacebookAds\\Object\\Values\\LiveVideoSpatialAudioFormatValues;\nuse FacebookAds\\Object\\Values\\LiveVideoStatusValues;\nuse FacebookAds\\Object\\Values\\LiveVideoStereoscopicModeValues;\nuse FacebookAds\\Object\\Values\\LiveVideoStreamTypeValues;\nuse FacebookAds\\Object\\Values\\ProfileTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LiveVideo extends AbstractCrudObject {\n\n  /**\n   * @return LiveVideoFields\n   */\n  public static function getFieldsEnum() {\n    return LiveVideoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Projection'] = LiveVideoProjectionValues::getInstance()->getValues();\n    $ref_enums['SpatialAudioFormat'] = LiveVideoSpatialAudioFormatValues::getInstance()->getValues();\n    $ref_enums['Status'] = LiveVideoStatusValues::getInstance()->getValues();\n    $ref_enums['StereoscopicMode'] = LiveVideoStereoscopicModeValues::getInstance()->getValues();\n    $ref_enums['StreamType'] = LiveVideoStreamTypeValues::getInstance()->getValues();\n    $ref_enums['BroadcastStatus'] = LiveVideoBroadcastStatusValues::getInstance()->getValues();\n    $ref_enums['Source'] = LiveVideoSourceValues::getInstance()->getValues();\n    $ref_enums['LiveCommentModerationSetting'] = LiveVideoLiveCommentModerationSettingValues::getInstance()->getValues();\n    $ref_enums['PersistentStreamKeyStatus'] = LiveVideoPersistentStreamKeyStatusValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getBlockedUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'uid' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/blocked_users',\n      new User(),\n      'EDGE',\n      User::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getComments(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'filter' => 'filter_enum',\n      'live_filter' => 'live_filter_enum',\n      'order' => 'order_enum',\n      'since' => 'datetime',\n    );\n    $enums = array(\n      'filter_enum' => CommentFilterValues::getInstance()->getValues(),\n      'live_filter_enum' => CommentLiveFilterValues::getInstance()->getValues(),\n      'order_enum' => CommentOrderValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/comments',\n      new Comment(),\n      'EDGE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCrosspostSharedPages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/crosspost_shared_pages',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCrosspostedBroadcasts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/crossposted_broadcasts',\n      new LiveVideo(),\n      'EDGE',\n      LiveVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getErrors(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/errors',\n      new LiveVideoError(),\n      'EDGE',\n      LiveVideoError::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createInputStream(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/input_streams',\n      new LiveVideoInputStream(),\n      'EDGE',\n      LiveVideoInputStream::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPolls(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/polls',\n      new VideoPoll(),\n      'EDGE',\n      VideoPoll::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPoll(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'close_after_voting' => 'bool',\n      'correct_option' => 'unsigned int',\n      'default_open' => 'bool',\n      'options' => 'list<string>',\n      'question' => 'string',\n      'show_gradient' => 'bool',\n      'show_results' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/polls',\n      new VideoPoll(),\n      'EDGE',\n      VideoPoll::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getReactions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'type_enum' => ProfileTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/reactions',\n      new Profile(),\n      'EDGE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'target_token' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new LiveVideo(),\n      'NODE',\n      LiveVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'allow_bm_crossposting' => 'bool',\n      'content_tags' => 'list<string>',\n      'cross_share_to_group_ids' => 'list<string>',\n      'crossposting_actions' => 'list<map>',\n      'custom_labels' => 'list<string>',\n      'description' => 'string',\n      'direct_share_status' => 'unsigned int',\n      'embeddable' => 'bool',\n      'end_live_video' => 'bool',\n      'event_params' => 'Object',\n      'is_audio_only' => 'bool',\n      'is_manual_mode' => 'bool',\n      'live_comment_moderation_setting' => 'list<live_comment_moderation_setting_enum>',\n      'master_ingest_stream_id' => 'string',\n      'og_icon_id' => 'string',\n      'og_phrase' => 'string',\n      'persistent_stream_key_status' => 'persistent_stream_key_status_enum',\n      'place' => 'Object',\n      'planned_start_time' => 'datetime',\n      'privacy' => 'string',\n      'published' => 'bool',\n      'schedule_custom_profile_image' => 'file',\n      'schedule_feed_background_image' => 'file',\n      'sponsor_id' => 'string',\n      'sponsor_relationship' => 'unsigned int',\n      'status' => 'status_enum',\n      'stream_type' => 'stream_type_enum',\n      'tags' => 'list<int>',\n      'targeting' => 'Object',\n      'title' => 'string',\n    );\n    $enums = array(\n      'live_comment_moderation_setting_enum' => LiveVideoLiveCommentModerationSettingValues::getInstance()->getValues(),\n      'persistent_stream_key_status_enum' => LiveVideoPersistentStreamKeyStatusValues::getInstance()->getValues(),\n      'status_enum' => LiveVideoStatusValues::getInstance()->getValues(),\n      'stream_type_enum' => LiveVideoStreamTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new LiveVideo(),\n      'NODE',\n      LiveVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 408}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LiveVideoAdBreakConfigFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LiveVideoAdBreakConfig extends AbstractObject {\n\n  /**\n   * @return LiveVideoAdBreakConfigFields\n   */\n  public static function getFieldsEnum() {\n    return LiveVideoAdBreakConfigFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LiveVideoErrorFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LiveVideoError extends AbstractCrudObject {\n\n  /**\n   * @return LiveVideoErrorFields\n   */\n  public static function getFieldsEnum() {\n    return LiveVideoErrorFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new LiveVideoError(),\n      'NODE',\n      LiveVideoError::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LiveVideoInputStreamFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LiveVideoInputStream extends AbstractCrudObject {\n\n  /**\n   * @return LiveVideoInputStreamFields\n   */\n  public static function getFieldsEnum() {\n    return LiveVideoInputStreamFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'target_token' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new LiveVideoInputStream(),\n      'NODE',\n      LiveVideoInputStream::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 82}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LiveVideoRecommendedEncoderSettingsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LiveVideoRecommendedEncoderSettings extends AbstractObject {\n\n  /**\n   * @return LiveVideoRecommendedEncoderSettingsFields\n   */\n  public static function getFieldsEnum() {\n    return LiveVideoRecommendedEncoderSettingsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LiveVideoTargetingFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LiveVideoTargeting extends AbstractObject {\n\n  /**\n   * @return LiveVideoTargetingFields\n   */\n  public static function getFieldsEnum() {\n    return LiveVideoTargetingFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LocalServiceBusinessFields;\nuse FacebookAds\\Object\\Values\\LocalServiceBusinessAvailabilityValues;\nuse FacebookAds\\Object\\Values\\LocalServiceBusinessConditionValues;\nuse FacebookAds\\Object\\Values\\LocalServiceBusinessImageFetchStatusValues;\nuse FacebookAds\\Object\\Values\\LocalServiceBusinessVisibilityValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LocalServiceBusiness extends AbstractCrudObject {\n\n  /**\n   * @return LocalServiceBusinessFields\n   */\n  public static function getFieldsEnum() {\n    return LocalServiceBusinessFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Availability'] = LocalServiceBusinessAvailabilityValues::getInstance()->getValues();\n    $ref_enums['Condition'] = LocalServiceBusinessConditionValues::getInstance()->getValues();\n    $ref_enums['ImageFetchStatus'] = LocalServiceBusinessImageFetchStatusValues::getInstance()->getValues();\n    $ref_enums['Visibility'] = LocalServiceBusinessVisibilityValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getChannelsToIntegrityStatus(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/channels_to_integrity_status',\n      new CatalogItemChannelsToIntegrityStatus(),\n      'EDGE',\n      CatalogItemChannelsToIntegrityStatus::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new LocalServiceBusiness(),\n      'NODE',\n      LocalServiceBusiness::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 112}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LocationFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Location extends AbstractObject {\n\n  /**\n   * @return LocationFields\n   */\n  public static function getFieldsEnum() {\n    return LocationFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\LookalikeSpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LookalikeSpec extends AbstractObject {\n\n  /**\n   * @return LookalikeSpecFields\n   */\n  public static function getFieldsEnum() {\n    return LookalikeSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\MailingAddressFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MailingAddress extends AbstractCrudObject {\n\n  /**\n   * @return MailingAddressFields\n   */\n  public static function getFieldsEnum() {\n    return MailingAddressFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new MailingAddress(),\n      'NODE',\n      MailingAddress::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ManagedPartnerBusinessFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ManagedPartnerBusiness extends AbstractObject {\n\n  /**\n   * @return ManagedPartnerBusinessFields\n   */\n  public static function getFieldsEnum() {\n    return ManagedPartnerBusinessFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\MediaFingerprintFields;\nuse FacebookAds\\Object\\Values\\MediaFingerprintFingerprintContentTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MediaFingerprint extends AbstractCrudObject {\n\n  /**\n   * @return MediaFingerprintFields\n   */\n  public static function getFieldsEnum() {\n    return MediaFingerprintFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['FingerprintContentType'] = MediaFingerprintFingerprintContentTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new MediaFingerprint(),\n      'NODE',\n      MediaFingerprint::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'metadata' => 'list',\n      'source' => 'file',\n      'title' => 'string',\n      'universal_content_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new MediaFingerprint(),\n      'NODE',\n      MediaFingerprint::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 110}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\MediaTitleFields;\nuse FacebookAds\\Object\\Values\\MediaTitleContentCategoryValues;\nuse FacebookAds\\Object\\Values\\MediaTitleImageFetchStatusValues;\nuse FacebookAds\\Object\\Values\\MediaTitleVisibilityValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MediaTitle extends AbstractCrudObject {\n\n  /**\n   * @return MediaTitleFields\n   */\n  public static function getFieldsEnum() {\n    return MediaTitleFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ImageFetchStatus'] = MediaTitleImageFetchStatusValues::getInstance()->getValues();\n    $ref_enums['Visibility'] = MediaTitleVisibilityValues::getInstance()->getValues();\n    $ref_enums['ContentCategory'] = MediaTitleContentCategoryValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAugmentedRealitiesMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/augmented_realities_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getChannelsToIntegrityStatus(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/channels_to_integrity_status',\n      new CatalogItemChannelsToIntegrityStatus(),\n      'EDGE',\n      CatalogItemChannelsToIntegrityStatus::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideosMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/videos_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new MediaTitle(),\n      'NODE',\n      MediaTitle::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'applinks' => 'Object',\n      'content_category' => 'content_category_enum',\n      'currency' => 'string',\n      'description' => 'string',\n      'fb_page_id' => 'string',\n      'genres' => 'list<string>',\n      'images' => 'list<Object>',\n      'kg_fb_id' => 'string',\n      'price' => 'unsigned int',\n      'title' => 'string',\n      'title_display_name' => 'string',\n      'url' => 'string',\n    );\n    $enums = array(\n      'content_category_enum' => MediaTitleContentCategoryValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new MediaTitle(),\n      'NODE',\n      MediaTitle::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 215}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\MessagingFeatureReviewFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MessagingFeatureReview extends AbstractObject {\n\n  /**\n   * @return MessagingFeatureReviewFields\n   */\n  public static function getFieldsEnum() {\n    return MessagingFeatureReviewFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\MessagingFeatureStatusFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MessagingFeatureStatus extends AbstractObject {\n\n  /**\n   * @return MessagingFeatureStatusFields\n   */\n  public static function getFieldsEnum() {\n    return MessagingFeatureStatusFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\MessengerDestinationPageWelcomeMessageFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MessengerDestinationPageWelcomeMessage extends AbstractCrudObject {\n\n  /**\n   * @return MessengerDestinationPageWelcomeMessageFields\n   */\n  public static function getFieldsEnum() {\n    return MessengerDestinationPageWelcomeMessageFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\MessengerProfileFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MessengerProfile extends AbstractObject {\n\n  /**\n   * @return MessengerProfileFields\n   */\n  public static function getFieldsEnum() {\n    return MessengerProfileFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\MinimumBudgetFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MinimumBudget extends AbstractObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'minimum_budgets';\n  }\n\n  /**\n   * @return MinimumBudgetFields\n   */\n  public static function getFieldsEnum() {\n    return MinimumBudgetFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 65}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\MusicVideoCopyrightFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MusicVideoCopyright extends AbstractCrudObject {\n\n  /**\n   * @return MusicVideoCopyrightFields\n   */\n  public static function getFieldsEnum() {\n    return MusicVideoCopyrightFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new MusicVideoCopyright(),\n      'NODE',\n      MusicVideoCopyright::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\NullNodeFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass NullNode extends AbstractObject {\n\n  /**\n   * @return NullNodeFields\n   */\n  public static function getFieldsEnum() {\n    return NullNodeFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\Object\\Fields\\AdCreativeObjectStorySpecFields;\nuse FacebookAds\\Object\\Traits\\FieldValidation;\n\n/**\n * @deprecated use AdCreativeObjectStorySpec instead\n */\nclass ObjectStorySpec extends AdCreativeObjectStorySpec {\n  use FieldValidation;\n\n  /**\n   * @return AdCreativeObjectStorySpecFields\n   */\n  public static function getFieldsEnum() {\n    return AdCreativeObjectStorySpecFields::getInstance();\n  }\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\OfflineConversionDataSetFields;\nuse FacebookAds\\Object\\Values\\AdAccountActionSourceValues;\nuse FacebookAds\\Object\\Values\\BusinessActionSourceValues;\nuse FacebookAds\\Object\\Values\\CustomAudienceActionSourceValues;\nuse FacebookAds\\Object\\Values\\OfflineConversionDataSetPermittedRolesValues;\nuse FacebookAds\\Object\\Values\\OfflineConversionDataSetRelationshipTypeValues;\nuse FacebookAds\\Object\\Values\\OfflineConversionDataSetUploadOrderValues;\nuse FacebookAds\\Object\\Values\\OfflineConversionDataSetUploadSortByValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OfflineConversionDataSet extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'offline_conversion_data_sets';\n  }\n\n  /**\n   * @return OfflineConversionDataSetFields\n   */\n  public static function getFieldsEnum() {\n    return OfflineConversionDataSetFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['PermittedRoles'] = OfflineConversionDataSetPermittedRolesValues::getInstance()->getValues();\n    $ref_enums['RelationshipType'] = OfflineConversionDataSetRelationshipTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adaccounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdAccount(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'account_id' => 'string',\n      'auto_track_for_ads' => 'bool',\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/adaccounts',\n      new OfflineConversionDataSet(),\n      'EDGE',\n      OfflineConversionDataSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAgencies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/agencies',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAgency(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n      'other_relationship' => 'string',\n      'permitted_roles' => 'list<permitted_roles_enum>',\n      'relationship_type' => 'list<relationship_type_enum>',\n    );\n    $enums = array(\n      'permitted_roles_enum' => OfflineConversionDataSetPermittedRolesValues::getInstance()->getValues(),\n      'relationship_type_enum' => OfflineConversionDataSetRelationshipTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/agencies',\n      new OfflineConversionDataSet(),\n      'EDGE',\n      OfflineConversionDataSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAudiences(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action_source' => 'action_source_enum',\n      'ad_account' => 'string',\n    );\n    $enums = array(\n      'action_source_enum' => CustomAudienceActionSourceValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/audiences',\n      new CustomAudience(),\n      'EDGE',\n      CustomAudience::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCustomConversions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_account' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/customconversions',\n      new CustomConversion(),\n      'EDGE',\n      CustomConversion::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getServerEventsPermittedBusiness(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/server_events_permitted_business',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSharedAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action_source' => 'action_source_enum',\n      'business' => 'string',\n    );\n    $enums = array(\n      'action_source_enum' => AdAccountActionSourceValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/shared_accounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSharedAgencies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action_source' => 'action_source_enum',\n    );\n    $enums = array(\n      'action_source_enum' => BusinessActionSourceValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/shared_agencies',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getStats(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'aggr_time' => 'aggr_time_enum',\n      'end' => 'int',\n      'granularity' => 'granularity_enum',\n      'skip_empty_values' => 'bool',\n      'start' => 'int',\n      'user_timezone_id' => 'unsigned int',\n    );\n    $enums = array(\n      'aggr_time_enum' => array(\n        'event_time',\n        'upload_time',\n      ),\n      'granularity_enum' => array(\n        'daily',\n        'hourly',\n        'six_hourly',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/stats',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getUploads(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'end_time' => 'datetime',\n      'order' => 'order_enum',\n      'sort_by' => 'sort_by_enum',\n      'start_time' => 'datetime',\n      'upload_tag' => 'string',\n    );\n    $enums = array(\n      'order_enum' => OfflineConversionDataSetUploadOrderValues::getInstance()->getValues(),\n      'sort_by_enum' => OfflineConversionDataSetUploadSortByValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/uploads',\n      new OfflineConversionDataSetUpload(),\n      'EDGE',\n      OfflineConversionDataSetUpload::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createUpload(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'upload_tag' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/uploads',\n      new OfflineConversionDataSetUpload(),\n      'EDGE',\n      OfflineConversionDataSetUpload::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createValidate(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'data' => 'list<string>',\n      'namespace_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/validate',\n      new OfflineConversionDataSet(),\n      'EDGE',\n      OfflineConversionDataSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new OfflineConversionDataSet(),\n      'NODE',\n      OfflineConversionDataSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'auto_assign_to_new_accounts_only' => 'bool',\n      'description' => 'string',\n      'enable_auto_assign_to_accounts' => 'bool',\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new OfflineConversionDataSet(),\n      'NODE',\n      OfflineConversionDataSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 490}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\OfflineConversionDataSetPermissionsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OfflineConversionDataSetPermissions extends AbstractObject {\n\n  /**\n   * @return OfflineConversionDataSetPermissionsFields\n   */\n  public static function getFieldsEnum() {\n    return OfflineConversionDataSetPermissionsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\OfflineConversionDataSetUploadFields;\nuse FacebookAds\\Object\\Values\\OfflineConversionDataSetUploadOrderValues;\nuse FacebookAds\\Object\\Values\\OfflineConversionDataSetUploadSortByValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OfflineConversionDataSetUpload extends AbstractCrudObject {\n\n  /**\n   * @return OfflineConversionDataSetUploadFields\n   */\n  public static function getFieldsEnum() {\n    return OfflineConversionDataSetUploadFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Order'] = OfflineConversionDataSetUploadOrderValues::getInstance()->getValues();\n    $ref_enums['SortBy'] = OfflineConversionDataSetUploadSortByValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getProgress(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/progress',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPullSessions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/pull_sessions',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new OfflineConversionDataSetUpload(),\n      'NODE',\n      OfflineConversionDataSetUpload::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 131}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\OfflineConversionDataSetUsageFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OfflineConversionDataSetUsage extends AbstractObject {\n\n  /**\n   * @return OfflineConversionDataSetUsageFields\n   */\n  public static function getFieldsEnum() {\n    return OfflineConversionDataSetUsageFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\OffsitePixelFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OffsitePixel extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'offsitepixels';\n  }\n\n  /**\n   * @return OffsitePixelFields\n   */\n  public static function getFieldsEnum() {\n    return OffsitePixelFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'value' => 'unsigned int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new OffsitePixel(),\n      'NODE',\n      OffsitePixel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 89}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\OmegaCustomerTrxFields;\nuse FacebookAds\\Object\\Values\\OmegaCustomerTrxTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OmegaCustomerTrx extends AbstractCrudObject {\n\n  /**\n   * @return OmegaCustomerTrxFields\n   */\n  public static function getFieldsEnum() {\n    return OmegaCustomerTrxFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Type'] = OmegaCustomerTrxTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getCampaigns(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/campaigns',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new OmegaCustomerTrx(),\n      'NODE',\n      OmegaCustomerTrx::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 106}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\OpenBridgeConfigurationFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OpenBridgeConfiguration extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'openbridge_configurations';\n  }\n\n  /**\n   * @return OpenBridgeConfigurationFields\n   */\n  public static function getFieldsEnum() {\n    return OpenBridgeConfigurationFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new OpenBridgeConfiguration(),\n      'NODE',\n      OpenBridgeConfiguration::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'access_key' => 'string',\n      'active' => 'bool',\n      'endpoint' => 'string',\n      'host_business_id' => 'unsigned int',\n      'host_external_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new OpenBridgeConfiguration(),\n      'NODE',\n      OpenBridgeConfiguration::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 139}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\OpenGraphContextFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OpenGraphContext extends AbstractCrudObject {\n\n  /**\n   * @return OpenGraphContextFields\n   */\n  public static function getFieldsEnum() {\n    return OpenGraphContextFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new OpenGraphContext(),\n      'NODE',\n      OpenGraphContext::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\OutcomePredictionPointFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OutcomePredictionPoint extends AbstractObject {\n\n  /**\n   * @return OutcomePredictionPointFields\n   */\n  public static function getFieldsEnum() {\n    return OutcomePredictionPointFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PageFields;\nuse FacebookAds\\Object\\Values\\AdVideoContainerTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoContentCategoryValues;\nuse FacebookAds\\Object\\Values\\AdVideoFormattingValues;\nuse FacebookAds\\Object\\Values\\AdVideoOriginalProjectionTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoSwapModeValues;\nuse FacebookAds\\Object\\Values\\AdVideoTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoUnpublishedContentTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoUploadPhaseValues;\nuse FacebookAds\\Object\\Values\\AdVideoVideoStateValues;\nuse FacebookAds\\Object\\Values\\ApplicationPlatformValues;\nuse FacebookAds\\Object\\Values\\CommerceOrderFiltersValues;\nuse FacebookAds\\Object\\Values\\CommerceOrderStateValues;\nuse FacebookAds\\Object\\Values\\EventEventStateFilterValues;\nuse FacebookAds\\Object\\Values\\EventTimeFilterValues;\nuse FacebookAds\\Object\\Values\\EventTypeValues;\nuse FacebookAds\\Object\\Values\\ImageCopyrightGeoOwnershipValues;\nuse FacebookAds\\Object\\Values\\InsightsResultDatePresetValues;\nuse FacebookAds\\Object\\Values\\InsightsResultPeriodValues;\nuse FacebookAds\\Object\\Values\\LeadgenFormLocaleValues;\nuse FacebookAds\\Object\\Values\\LiveVideoBroadcastStatusValues;\nuse FacebookAds\\Object\\Values\\LiveVideoProjectionValues;\nuse FacebookAds\\Object\\Values\\LiveVideoSourceValues;\nuse FacebookAds\\Object\\Values\\LiveVideoSpatialAudioFormatValues;\nuse FacebookAds\\Object\\Values\\LiveVideoStatusValues;\nuse FacebookAds\\Object\\Values\\LiveVideoStereoscopicModeValues;\nuse FacebookAds\\Object\\Values\\LiveVideoStreamTypeValues;\nuse FacebookAds\\Object\\Values\\MediaFingerprintFingerprintContentTypeValues;\nuse FacebookAds\\Object\\Values\\PageAlignmentValues;\nuse FacebookAds\\Object\\Values\\PageAttireValues;\nuse FacebookAds\\Object\\Values\\PageBackdatedTimeGranularityValues;\nuse FacebookAds\\Object\\Values\\PageCheckinEntryPointValues;\nuse FacebookAds\\Object\\Values\\PageDeveloperActionValues;\nuse FacebookAds\\Object\\Values\\PageEntryPointIconValues;\nuse FacebookAds\\Object\\Values\\PageEntryPointLabelValues;\nuse FacebookAds\\Object\\Values\\PageFoodStylesValues;\nuse FacebookAds\\Object\\Values\\PageFormattingValues;\nuse FacebookAds\\Object\\Values\\PageGreetingDialogDisplayValues;\nuse FacebookAds\\Object\\Values\\PageGuestChatModeValues;\nuse FacebookAds\\Object\\Values\\PageMessagingTypeValues;\nuse FacebookAds\\Object\\Values\\PageMobileChatDisplayValues;\nuse FacebookAds\\Object\\Values\\PageModelValues;\nuse FacebookAds\\Object\\Values\\PageNotificationTypeValues;\nuse FacebookAds\\Object\\Values\\PagePermittedTasksValues;\nuse FacebookAds\\Object\\Values\\PagePickupOptionsValues;\nuse FacebookAds\\Object\\Values\\PagePlaceAttachmentSettingValues;\nuse FacebookAds\\Object\\Values\\PagePlatformValues;\nuse FacebookAds\\Object\\Values\\PagePostSurfacesBlacklistValues;\nuse FacebookAds\\Object\\Values\\PagePostWithValues;\nuse FacebookAds\\Object\\Values\\PagePostingToRedspaceValues;\nuse FacebookAds\\Object\\Values\\PageSenderActionValues;\nuse FacebookAds\\Object\\Values\\PageSubscribedFieldsValues;\nuse FacebookAds\\Object\\Values\\PageSuggestionActionValues;\nuse FacebookAds\\Object\\Values\\PageTargetSurfaceValues;\nuse FacebookAds\\Object\\Values\\PageTasksValues;\nuse FacebookAds\\Object\\Values\\PageTemporaryStatusValues;\nuse FacebookAds\\Object\\Values\\PageUnpublishedContentTypeValues;\nuse FacebookAds\\Object\\Values\\PhotoBackdatedTimeGranularityValues;\nuse FacebookAds\\Object\\Values\\PhotoTypeValues;\nuse FacebookAds\\Object\\Values\\PhotoUnpublishedContentTypeValues;\nuse FacebookAds\\Object\\Values\\ProfilePictureSourceBreakingChangeValues;\nuse FacebookAds\\Object\\Values\\ProfilePictureSourceTypeValues;\nuse FacebookAds\\Object\\Values\\UnifiedThreadPlatformValues;\nuse FacebookAds\\Object\\Values\\VideoCopyrightContentCategoryValues;\nuse FacebookAds\\Object\\Values\\VideoCopyrightMonitoringTypeValues;\nuse FacebookAds\\Object\\Values\\VideoCopyrightRuleSourceValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Page extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'accounts';\n  }\n\n  /**\n   * @return PageFields\n   */\n  public static function getFieldsEnum() {\n    return PageFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Attire'] = PageAttireValues::getInstance()->getValues();\n    $ref_enums['FoodStyles'] = PageFoodStylesValues::getInstance()->getValues();\n    $ref_enums['PickupOptions'] = PagePickupOptionsValues::getInstance()->getValues();\n    $ref_enums['TemporaryStatus'] = PageTemporaryStatusValues::getInstance()->getValues();\n    $ref_enums['PermittedTasks'] = PagePermittedTasksValues::getInstance()->getValues();\n    $ref_enums['Tasks'] = PageTasksValues::getInstance()->getValues();\n    $ref_enums['Alignment'] = PageAlignmentValues::getInstance()->getValues();\n    $ref_enums['EntryPointIcon'] = PageEntryPointIconValues::getInstance()->getValues();\n    $ref_enums['EntryPointLabel'] = PageEntryPointLabelValues::getInstance()->getValues();\n    $ref_enums['GreetingDialogDisplay'] = PageGreetingDialogDisplayValues::getInstance()->getValues();\n    $ref_enums['GuestChatMode'] = PageGuestChatModeValues::getInstance()->getValues();\n    $ref_enums['MobileChatDisplay'] = PageMobileChatDisplayValues::getInstance()->getValues();\n    $ref_enums['BackdatedTimeGranularity'] = PageBackdatedTimeGranularityValues::getInstance()->getValues();\n    $ref_enums['CheckinEntryPoint'] = PageCheckinEntryPointValues::getInstance()->getValues();\n    $ref_enums['Formatting'] = PageFormattingValues::getInstance()->getValues();\n    $ref_enums['PlaceAttachmentSetting'] = PagePlaceAttachmentSettingValues::getInstance()->getValues();\n    $ref_enums['PostSurfacesBlacklist'] = PagePostSurfacesBlacklistValues::getInstance()->getValues();\n    $ref_enums['PostingToRedspace'] = PagePostingToRedspaceValues::getInstance()->getValues();\n    $ref_enums['TargetSurface'] = PageTargetSurfaceValues::getInstance()->getValues();\n    $ref_enums['UnpublishedContentType'] = PageUnpublishedContentTypeValues::getInstance()->getValues();\n    $ref_enums['MessagingType'] = PageMessagingTypeValues::getInstance()->getValues();\n    $ref_enums['NotificationType'] = PageNotificationTypeValues::getInstance()->getValues();\n    $ref_enums['SenderAction'] = PageSenderActionValues::getInstance()->getValues();\n    $ref_enums['SuggestionAction'] = PageSuggestionActionValues::getInstance()->getValues();\n    $ref_enums['Platform'] = PagePlatformValues::getInstance()->getValues();\n    $ref_enums['Model'] = PageModelValues::getInstance()->getValues();\n    $ref_enums['DeveloperAction'] = PageDeveloperActionValues::getInstance()->getValues();\n    $ref_enums['SubscribedFields'] = PageSubscribedFieldsValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function createAcknowledgeOrder(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'idempotency_key' => 'string',\n      'orders' => 'list<map>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/acknowledge_orders',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdsPosts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'exclude_dynamic_ads' => 'bool',\n      'include_inline_create' => 'bool',\n      'since' => 'datetime',\n      'until' => 'datetime',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ads_posts',\n      new PagePost(),\n      'EDGE',\n      PagePost::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteAgencies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/agencies',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAgencies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/agencies',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAgency(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n      'permitted_tasks' => 'list<permitted_tasks_enum>',\n    );\n    $enums = array(\n      'permitted_tasks_enum' => PagePermittedTasksValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/agencies',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAlbums(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/albums',\n      new Album(),\n      'EDGE',\n      Album::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getArExperience(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ar_experience',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteAssignedUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'user' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/assigned_users',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAssignedUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/assigned_users',\n      new AssignedUser(),\n      'EDGE',\n      AssignedUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAssignedUser(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'tasks' => 'list<tasks_enum>',\n      'user' => 'int',\n    );\n    $enums = array(\n      'tasks_enum' => PageTasksValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/assigned_users',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteBlocked(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asid' => 'string',\n      'psid' => 'int',\n      'uid' => 'int',\n      'user' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/blocked',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getBlocked(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'uid' => 'int',\n      'user' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/blocked',\n      new Profile(),\n      'EDGE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createBlocked(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'asid' => 'list',\n      'psid' => 'list<int>',\n      'uid' => 'list',\n      'user' => 'list',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/blocked',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createBusinessDatum(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'data' => 'list<string>',\n      'partner_agent' => 'string',\n      'processing_type' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/business_data',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getBusinessProjects(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/businessprojects',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCallToActions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/call_to_actions',\n      new PageCallToAction(),\n      'EDGE',\n      PageCallToAction::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCanvasElements(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/canvas_elements',\n      new CanvasBodyElement(),\n      'EDGE',\n      CanvasBodyElement::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCanvasElement(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'canvas_button' => 'Object',\n      'canvas_carousel' => 'Object',\n      'canvas_footer' => 'Object',\n      'canvas_header' => 'Object',\n      'canvas_lead_form' => 'Object',\n      'canvas_photo' => 'Object',\n      'canvas_product_list' => 'Object',\n      'canvas_product_set' => 'Object',\n      'canvas_store_locator' => 'Object',\n      'canvas_template_video' => 'Object',\n      'canvas_text' => 'Object',\n      'canvas_video' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/canvas_elements',\n      new CanvasBodyElement(),\n      'EDGE',\n      CanvasBodyElement::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCanvases(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'is_hidden' => 'bool',\n      'is_published' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/canvases',\n      new Canvas(),\n      'EDGE',\n      Canvas::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCanvase(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'background_color' => 'string',\n      'body_element_ids' => 'list<string>',\n      'enable_swipe_to_open' => 'bool',\n      'is_hidden' => 'bool',\n      'is_published' => 'bool',\n      'name' => 'string',\n      'source_template_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/canvases',\n      new Canvas(),\n      'EDGE',\n      Canvas::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getChatPlugin(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/chat_plugin',\n      new ChatPlugin(),\n      'EDGE',\n      ChatPlugin::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createChatPlugin(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'alignment' => 'alignment_enum',\n      'desktop_bottom_spacing' => 'unsigned int',\n      'desktop_side_spacing' => 'unsigned int',\n      'entry_point_icon' => 'entry_point_icon_enum',\n      'entry_point_label' => 'entry_point_label_enum',\n      'greeting_dialog_display' => 'greeting_dialog_display_enum',\n      'guest_chat_mode' => 'guest_chat_mode_enum',\n      'mobile_bottom_spacing' => 'unsigned int',\n      'mobile_chat_display' => 'mobile_chat_display_enum',\n      'mobile_side_spacing' => 'unsigned int',\n      'theme_color' => 'string',\n      'welcome_screen_greeting' => 'string',\n    );\n    $enums = array(\n      'alignment_enum' => PageAlignmentValues::getInstance()->getValues(),\n      'entry_point_icon_enum' => PageEntryPointIconValues::getInstance()->getValues(),\n      'entry_point_label_enum' => PageEntryPointLabelValues::getInstance()->getValues(),\n      'greeting_dialog_display_enum' => PageGreetingDialogDisplayValues::getInstance()->getValues(),\n      'guest_chat_mode_enum' => PageGuestChatModeValues::getInstance()->getValues(),\n      'mobile_chat_display_enum' => PageMobileChatDisplayValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/chat_plugin',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCommerceEligibility(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/commerce_eligibility',\n      new PageCommerceEligibility(),\n      'EDGE',\n      PageCommerceEligibility::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCommerceMerchantSettings(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/commerce_merchant_settings',\n      new CommerceMerchantSettings(),\n      'EDGE',\n      CommerceMerchantSettings::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCommerceOrders(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'filters' => 'list<filters_enum>',\n      'state' => 'list<state_enum>',\n      'updated_after' => 'datetime',\n      'updated_before' => 'datetime',\n    );\n    $enums = array(\n      'filters_enum' => CommerceOrderFiltersValues::getInstance()->getValues(),\n      'state_enum' => CommerceOrderStateValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/commerce_orders',\n      new CommerceOrder(),\n      'EDGE',\n      CommerceOrder::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCommercePayouts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'end_time' => 'datetime',\n      'start_time' => 'datetime',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/commerce_payouts',\n      new CommercePayout(),\n      'EDGE',\n      CommercePayout::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCommerceTransactions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'end_time' => 'datetime',\n      'payout_reference_id' => 'string',\n      'start_time' => 'datetime',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/commerce_transactions',\n      new CommerceOrderTransactionDetail(),\n      'EDGE',\n      CommerceOrderTransactionDetail::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getConversations(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'folder' => 'string',\n      'platform' => 'platform_enum',\n      'tags' => 'list<string>',\n      'user_id' => 'string',\n    );\n    $enums = array(\n      'platform_enum' => UnifiedThreadPlatformValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/conversations',\n      new UnifiedThread(),\n      'EDGE',\n      UnifiedThread::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCopyrightManualClaim(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action' => 'action_enum',\n      'action_reason' => 'action_reason_enum',\n      'countries' => 'Object',\n      'match_content_type' => 'match_content_type_enum',\n      'matched_asset_id' => 'string',\n      'reference_asset_id' => 'string',\n    );\n    $enums = array(\n      'action_enum' => array(\n        'BLOCK',\n        'CLAIM_AD_EARNINGS',\n        'MANUAL_REVIEW',\n        'MONITOR',\n        'REQUEST_TAKEDOWN',\n      ),\n      'action_reason_enum' => array(\n        'ARTICLE_17_PREFLAGGING',\n        'ARTIST_OBJECTION',\n        'OBJECTIONABLE_CONTENT',\n        'PREMIUM_MUSIC_VIDEO',\n        'PRERELEASE_CONTENT',\n        'PRODUCT_PARAMETERS',\n        'RESTRICTED_CONTENT',\n        'UNAUTHORIZED_COMMERCIAL_USE',\n      ),\n      'match_content_type_enum' => array(\n        'AUDIO_ONLY',\n        'VIDEO_AND_AUDIO',\n        'VIDEO_ONLY',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/copyright_manual_claims',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCrosspostWhitelistedPages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/crosspost_whitelisted_pages',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCustomLabels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/custom_labels',\n      new PageUserMessageThreadLabel(),\n      'EDGE',\n      PageUserMessageThreadLabel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCustomLabel(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'name' => 'string',\n      'page_label_name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/custom_labels',\n      new PageUserMessageThreadLabel(),\n      'EDGE',\n      PageUserMessageThreadLabel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteCustomUserSettings(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'params' => 'list<params_enum>',\n      'psid' => 'string',\n    );\n    $enums = array(\n      'params_enum' => array(\n        'PERSISTENT_MENU',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/custom_user_settings',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCustomUserSettings(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'psid' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/custom_user_settings',\n      new CustomUserSettings(),\n      'EDGE',\n      CustomUserSettings::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCustomUserSetting(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'persistent_menu' => 'list<Object>',\n      'psid' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/custom_user_settings',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getEvents(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'event_state_filter' => 'list<event_state_filter_enum>',\n      'include_canceled' => 'bool',\n      'time_filter' => 'time_filter_enum',\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'event_state_filter_enum' => EventEventStateFilterValues::getInstance()->getValues(),\n      'time_filter_enum' => EventTimeFilterValues::getInstance()->getValues(),\n      'type_enum' => EventTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/events',\n      new Event(),\n      'EDGE',\n      Event::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createExtendThreadControl(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'duration' => 'unsigned int',\n      'recipient' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/extend_thread_control',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getFantasyGames(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/fantasy_games',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getFeed(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'include_hidden' => 'bool',\n      'limit' => 'unsigned int',\n      'show_expired' => 'bool',\n      'with' => 'with_enum',\n    );\n    $enums = array(\n      'with_enum' => PagePostWithValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/feed',\n      new PagePost(),\n      'EDGE',\n      PagePost::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createFeed(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'actions' => 'Object',\n      'adaptive_type' => 'string',\n      'album_id' => 'string',\n      'android_key_hash' => 'string',\n      'animated_effect_id' => 'unsigned int',\n      'application_id' => 'string',\n      'asked_fun_fact_prompt_id' => 'unsigned int',\n      'asset3d_id' => 'unsigned int',\n      'associated_id' => 'string',\n      'attach_place_suggestion' => 'bool',\n      'attached_media' => 'list<Object>',\n      'audience_exp' => 'bool',\n      'backdated_time' => 'datetime',\n      'backdated_time_granularity' => 'backdated_time_granularity_enum',\n      'call_to_action' => 'Object',\n      'caption' => 'string',\n      'checkin_entry_point' => 'checkin_entry_point_enum',\n      'child_attachments' => 'list<Object>',\n      'client_mutation_id' => 'string',\n      'composer_entry_picker' => 'string',\n      'composer_entry_point' => 'string',\n      'composer_entry_time' => 'unsigned int',\n      'composer_session_events_log' => 'string',\n      'composer_session_id' => 'string',\n      'composer_source_surface' => 'string',\n      'composer_type' => 'string',\n      'connection_class' => 'string',\n      'content_attachment' => 'string',\n      'coordinates' => 'Object',\n      'cta_link' => 'string',\n      'cta_type' => 'string',\n      'description' => 'string',\n      'direct_share_status' => 'unsigned int',\n      'enforce_link_ownership' => 'bool',\n      'expanded_height' => 'unsigned int',\n      'expanded_width' => 'unsigned int',\n      'feed_targeting' => 'Object',\n      'formatting' => 'formatting_enum',\n      'fun_fact_prompt_id' => 'unsigned int',\n      'fun_fact_toastee_id' => 'unsigned int',\n      'has_nickname' => 'bool',\n      'height' => 'unsigned int',\n      'holiday_card' => 'string',\n      'home_checkin_city_id' => 'Object',\n      'image_crops' => 'map',\n      'implicit_with_tags' => 'list<int>',\n      'instant_game_entry_point_data' => 'string',\n      'ios_bundle_id' => 'string',\n      'is_backout_draft' => 'bool',\n      'is_boost_intended' => 'bool',\n      'is_explicit_location' => 'bool',\n      'is_explicit_share' => 'bool',\n      'is_group_linking_post' => 'bool',\n      'is_photo_container' => 'bool',\n      'link' => 'string',\n      'location_source_id' => 'string',\n      'manual_privacy' => 'bool',\n      'message' => 'string',\n      'multi_share_end_card' => 'bool',\n      'multi_share_optimized' => 'bool',\n      'name' => 'string',\n      'nectar_module' => 'string',\n      'object_attachment' => 'string',\n      'offer_like_post_id' => 'unsigned int',\n      'og_action_type_id' => 'string',\n      'og_hide_object_attachment' => 'bool',\n      'og_icon_id' => 'string',\n      'og_object_id' => 'string',\n      'og_phrase' => 'string',\n      'og_set_profile_badge' => 'bool',\n      'og_suggestion_mechanism' => 'string',\n      'page_recommendation' => 'string',\n      'picture' => 'string',\n      'place' => 'Object',\n      'place_attachment_setting' => 'place_attachment_setting_enum',\n      'place_list' => 'string',\n      'place_list_data' => 'list',\n      'post_surfaces_blacklist' => 'list<post_surfaces_blacklist_enum>',\n      'posting_to_redspace' => 'posting_to_redspace_enum',\n      'privacy' => 'string',\n      'prompt_id' => 'string',\n      'prompt_tracking_string' => 'string',\n      'properties' => 'Object',\n      'proxied_app_id' => 'string',\n      'publish_event_id' => 'unsigned int',\n      'published' => 'bool',\n      'quote' => 'string',\n      'react_mode_metadata' => 'string',\n      'ref' => 'list<string>',\n      'referenceable_image_ids' => 'list<string>',\n      'referral_id' => 'string',\n      'scheduled_publish_time' => 'datetime',\n      'source' => 'string',\n      'sponsor_id' => 'string',\n      'sponsor_relationship' => 'unsigned int',\n      'suggested_place_id' => 'Object',\n      'tags' => 'list<int>',\n      'target_surface' => 'target_surface_enum',\n      'targeting' => 'Object',\n      'text_format_metadata' => 'string',\n      'text_format_preset_id' => 'string',\n      'text_only_place' => 'string',\n      'throwback_camera_roll_media' => 'string',\n      'thumbnail' => 'file',\n      'time_since_original_post' => 'unsigned int',\n      'title' => 'string',\n      'tracking_info' => 'string',\n      'unpublished_content_type' => 'unpublished_content_type_enum',\n      'user_selected_tags' => 'bool',\n      'video_start_time_ms' => 'unsigned int',\n      'viewer_coordinates' => 'Object',\n      'width' => 'unsigned int',\n    );\n    $enums = array(\n      'backdated_time_granularity_enum' => PageBackdatedTimeGranularityValues::getInstance()->getValues(),\n      'checkin_entry_point_enum' => PageCheckinEntryPointValues::getInstance()->getValues(),\n      'formatting_enum' => PageFormattingValues::getInstance()->getValues(),\n      'place_attachment_setting_enum' => PagePlaceAttachmentSettingValues::getInstance()->getValues(),\n      'post_surfaces_blacklist_enum' => PagePostSurfacesBlacklistValues::getInstance()->getValues(),\n      'posting_to_redspace_enum' => PagePostingToRedspaceValues::getInstance()->getValues(),\n      'target_surface_enum' => PageTargetSurfaceValues::getInstance()->getValues(),\n      'unpublished_content_type_enum' => PageUnpublishedContentTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/feed',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getGlobalBrandChildren(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/global_brand_children',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getGroups(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'admin_only' => 'bool',\n      'parent' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/groups',\n      new Group(),\n      'EDGE',\n      Group::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getImageCopyrights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/image_copyrights',\n      new ImageCopyright(),\n      'EDGE',\n      ImageCopyright::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createImageCopyright(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'artist' => 'string',\n      'creator' => 'string',\n      'custom_id' => 'string',\n      'description' => 'string',\n      'filename' => 'string',\n      'geo_ownership' => 'list<geo_ownership_enum>',\n      'original_content_creation_date' => 'unsigned int',\n      'reference_photo' => 'string',\n      'title' => 'string',\n    );\n    $enums = array(\n      'geo_ownership_enum' => ImageCopyrightGeoOwnershipValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/image_copyrights',\n      new ImageCopyright(),\n      'EDGE',\n      ImageCopyright::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getIndexedVideos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/indexed_videos',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInsights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'breakdown' => 'list<Object>',\n      'date_preset' => 'date_preset_enum',\n      'metric' => 'list<Object>',\n      'period' => 'period_enum',\n      'show_description_from_api_doc' => 'bool',\n      'since' => 'datetime',\n      'until' => 'datetime',\n    );\n    $enums = array(\n      'date_preset_enum' => InsightsResultDatePresetValues::getInstance()->getValues(),\n      'period_enum' => InsightsResultPeriodValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/insights',\n      new InsightsResult(),\n      'EDGE',\n      InsightsResult::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/instagram_accounts',\n      new InstagramUser(),\n      'EDGE',\n      InstagramUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInstantArticlesStats(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'metrics_list' => 'list<map>',\n      'page_list' => 'list<string>',\n      'since' => 'datetime',\n      'until' => 'datetime',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/instant_articles_stats',\n      new InstantArticlesStats(),\n      'EDGE',\n      InstantArticlesStats::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInvoiceAccessBankAccount(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/invoice_access_bank_account',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLeadGenForms(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/leadgen_forms',\n      new LeadgenForm(),\n      'EDGE',\n      LeadgenForm::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createLeadGenForm(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'allow_organic_lead_retrieval' => 'bool',\n      'block_display_for_non_targeted_viewer' => 'bool',\n      'context_card' => 'Object',\n      'cover_photo' => 'file',\n      'custom_disclaimer' => 'Object',\n      'follow_up_action_url' => 'string',\n      'is_for_canvas' => 'bool',\n      'is_optimized_for_quality' => 'bool',\n      'locale' => 'locale_enum',\n      'name' => 'string',\n      'privacy_policy' => 'Object',\n      'question_page_custom_headline' => 'string',\n      'questions' => 'list<Object>',\n      'thank_you_page' => 'Object',\n      'tracking_parameters' => 'map',\n    );\n    $enums = array(\n      'locale_enum' => LeadgenFormLocaleValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/leadgen_forms',\n      new LeadgenForm(),\n      'EDGE',\n      LeadgenForm::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLikes(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'target_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/likes',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLiveVideos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'broadcast_status' => 'list<broadcast_status_enum>',\n      'source' => 'source_enum',\n    );\n    $enums = array(\n      'broadcast_status_enum' => LiveVideoBroadcastStatusValues::getInstance()->getValues(),\n      'source_enum' => LiveVideoSourceValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/live_videos',\n      new LiveVideo(),\n      'EDGE',\n      LiveVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createLiveVideo(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'content_tags' => 'list<string>',\n      'crossposting_actions' => 'list<map>',\n      'custom_labels' => 'list<string>',\n      'description' => 'string',\n      'enable_backup_ingest' => 'bool',\n      'encoding_settings' => 'string',\n      'event_params' => 'Object',\n      'fisheye_video_cropped' => 'bool',\n      'front_z_rotation' => 'float',\n      'game_show' => 'map',\n      'is_audio_only' => 'bool',\n      'is_spherical' => 'bool',\n      'original_fov' => 'unsigned int',\n      'privacy' => 'string',\n      'projection' => 'projection_enum',\n      'published' => 'bool',\n      'schedule_custom_profile_image' => 'file',\n      'spatial_audio_format' => 'spatial_audio_format_enum',\n      'status' => 'status_enum',\n      'stereoscopic_mode' => 'stereoscopic_mode_enum',\n      'stop_on_delete_stream' => 'bool',\n      'stream_type' => 'stream_type_enum',\n      'targeting' => 'Object',\n      'title' => 'string',\n    );\n    $enums = array(\n      'projection_enum' => LiveVideoProjectionValues::getInstance()->getValues(),\n      'spatial_audio_format_enum' => LiveVideoSpatialAudioFormatValues::getInstance()->getValues(),\n      'status_enum' => LiveVideoStatusValues::getInstance()->getValues(),\n      'stereoscopic_mode_enum' => LiveVideoStereoscopicModeValues::getInstance()->getValues(),\n      'stream_type_enum' => LiveVideoStreamTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/live_videos',\n      new LiveVideo(),\n      'EDGE',\n      LiveVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteLocations(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'location_page_id' => 'string',\n      'store_number' => 'unsigned int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/locations',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLocations(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/locations',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createLocation(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'always_open' => 'bool',\n      'delivery_and_pickup_option_info' => 'list<string>',\n      'differently_open_offerings' => 'map',\n      'hours' => 'map',\n      'ignore_warnings' => 'bool',\n      'location' => 'Object',\n      'location_page_id' => 'string',\n      'old_store_number' => 'unsigned int',\n      'page_username' => 'string',\n      'permanently_closed' => 'bool',\n      'phone' => 'string',\n      'pickup_options' => 'list<pickup_options_enum>',\n      'place_topics' => 'list<string>',\n      'price_range' => 'string',\n      'store_code' => 'string',\n      'store_location_descriptor' => 'string',\n      'store_name' => 'string',\n      'store_number' => 'unsigned int',\n      'temporary_status' => 'temporary_status_enum',\n      'website' => 'string',\n    );\n    $enums = array(\n      'pickup_options_enum' => PagePickupOptionsValues::getInstance()->getValues(),\n      'temporary_status_enum' => PageTemporaryStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/locations',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getMediaFingerprints(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'universal_content_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/media_fingerprints',\n      new MediaFingerprint(),\n      'EDGE',\n      MediaFingerprint::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createMediaFingerprint(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'fingerprint_content_type' => 'fingerprint_content_type_enum',\n      'metadata' => 'list',\n      'source' => 'string',\n      'title' => 'string',\n      'universal_content_id' => 'string',\n    );\n    $enums = array(\n      'fingerprint_content_type_enum' => MediaFingerprintFingerprintContentTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/media_fingerprints',\n      new MediaFingerprint(),\n      'EDGE',\n      MediaFingerprint::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createMessageAttachment(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'message' => 'Object',\n      'platform' => 'platform_enum',\n    );\n    $enums = array(\n      'platform_enum' => array(\n        'INSTAGRAM',\n        'MESSENGER',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/message_attachments',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createMessage(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'message' => 'Object',\n      'messaging_type' => 'messaging_type_enum',\n      'notification_type' => 'notification_type_enum',\n      'payload' => 'string',\n      'persona_id' => 'string',\n      'recipient' => 'Object',\n      'sender_action' => 'sender_action_enum',\n      'suggestion_action' => 'suggestion_action_enum',\n      'tag' => 'Object',\n      'thread_control' => 'Object',\n    );\n    $enums = array(\n      'messaging_type_enum' => PageMessagingTypeValues::getInstance()->getValues(),\n      'notification_type_enum' => PageNotificationTypeValues::getInstance()->getValues(),\n      'sender_action_enum' => PageSenderActionValues::getInstance()->getValues(),\n      'suggestion_action_enum' => PageSuggestionActionValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/messages',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getMessagingFeatureReview(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/messaging_feature_review',\n      new MessagingFeatureReview(),\n      'EDGE',\n      MessagingFeatureReview::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteMessengerProfile(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'fields' => 'list<fields_enum>',\n      'platform' => 'platform_enum',\n    );\n    $enums = array(\n      'fields_enum' => array(\n        'ACCOUNT_LINKING_URL',\n        'GET_STARTED',\n        'GREETING',\n        'HOME_URL',\n        'ICE_BREAKERS',\n        'PAYMENT_SETTINGS',\n        'PERSISTENT_MENU',\n        'PLATFORM',\n        'SUBJECT_TO_NEW_EU_PRIVACY_RULES',\n        'TARGET_AUDIENCE',\n        'WHITELISTED_DOMAINS',\n      ),\n      'platform_enum' => PagePlatformValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/messenger_profile',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getMessengerProfile(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'platform' => 'platform_enum',\n    );\n    $enums = array(\n      'platform_enum' => PagePlatformValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/messenger_profile',\n      new MessengerProfile(),\n      'EDGE',\n      MessengerProfile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createMessengerProfile(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'account_linking_url' => 'string',\n      'get_started' => 'Object',\n      'greeting' => 'list<Object>',\n      'ice_breakers' => 'list<map>',\n      'payment_settings' => 'Object',\n      'persistent_menu' => 'list<Object>',\n      'platform' => 'platform_enum',\n      'target_audience' => 'Object',\n      'whitelisted_domains' => 'list<string>',\n    );\n    $enums = array(\n      'platform_enum' => PagePlatformValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/messenger_profile',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createNlpConfig(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'api_version' => 'Object',\n      'custom_token' => 'string',\n      'model' => 'model_enum',\n      'n_best' => 'unsigned int',\n      'nlp_enabled' => 'bool',\n      'other_language_support' => 'map',\n      'verbose' => 'bool',\n    );\n    $enums = array(\n      'model_enum' => PageModelValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/nlp_configs',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getNotificationMessageTokens(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/notification_message_tokens',\n      new UserPageOneTimeOptInTokenSettings(),\n      'EDGE',\n      UserPageOneTimeOptInTokenSettings::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createNotificationMessagesDevSupport(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'developer_action' => 'developer_action_enum',\n      'recipient' => 'Object',\n    );\n    $enums = array(\n      'developer_action_enum' => PageDeveloperActionValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/notification_messages_dev_support',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPageBackedInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/page_backed_instagram_accounts',\n      new InstagramUser(),\n      'EDGE',\n      InstagramUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPageBackedInstagramAccount(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/page_backed_instagram_accounts',\n      new InstagramUser(),\n      'EDGE',\n      InstagramUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPageWhatsappNumberVerification(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'verification_code' => 'string',\n      'whatsapp_number' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/page_whatsapp_number_verification',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPassThreadControl(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'metadata' => 'string',\n      'recipient' => 'Object',\n      'target_app_id' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/pass_thread_control',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPassThreadMetadatum(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'metadata' => 'string',\n      'recipient' => 'Object',\n      'target_app_id' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/pass_thread_metadata',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPersonas(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/personas',\n      new Persona(),\n      'EDGE',\n      Persona::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPersona(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'name' => 'string',\n      'profile_picture_url' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/personas',\n      new Persona(),\n      'EDGE',\n      Persona::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPhotos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'biz_tag_id' => 'unsigned int',\n      'business_id' => 'string',\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'type_enum' => PhotoTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/photos',\n      new Photo(),\n      'EDGE',\n      Photo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPhoto(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'aid' => 'string',\n      'allow_spherical_photo' => 'bool',\n      'alt_text_custom' => 'string',\n      'android_key_hash' => 'string',\n      'application_id' => 'string',\n      'attempt' => 'unsigned int',\n      'audience_exp' => 'bool',\n      'backdated_time' => 'datetime',\n      'backdated_time_granularity' => 'backdated_time_granularity_enum',\n      'caption' => 'string',\n      'composer_session_id' => 'string',\n      'direct_share_status' => 'unsigned int',\n      'feed_targeting' => 'Object',\n      'filter_type' => 'unsigned int',\n      'full_res_is_coming_later' => 'bool',\n      'initial_view_heading_override_degrees' => 'unsigned int',\n      'initial_view_pitch_override_degrees' => 'unsigned int',\n      'initial_view_vertical_fov_override_degrees' => 'unsigned int',\n      'ios_bundle_id' => 'string',\n      'is_explicit_location' => 'bool',\n      'is_explicit_place' => 'bool',\n      'location_source_id' => 'string',\n      'manual_privacy' => 'bool',\n      'message' => 'string',\n      'name' => 'string',\n      'nectar_module' => 'string',\n      'no_story' => 'bool',\n      'offline_id' => 'unsigned int',\n      'og_action_type_id' => 'string',\n      'og_icon_id' => 'string',\n      'og_object_id' => 'string',\n      'og_phrase' => 'string',\n      'og_set_profile_badge' => 'bool',\n      'og_suggestion_mechanism' => 'string',\n      'parent_media_id' => 'unsigned int',\n      'place' => 'Object',\n      'privacy' => 'string',\n      'profile_id' => 'int',\n      'proxied_app_id' => 'string',\n      'published' => 'bool',\n      'qn' => 'string',\n      'scheduled_publish_time' => 'unsigned int',\n      'spherical_metadata' => 'map',\n      'sponsor_id' => 'string',\n      'sponsor_relationship' => 'unsigned int',\n      'tags' => 'list<Object>',\n      'target_id' => 'int',\n      'targeting' => 'Object',\n      'temporary' => 'bool',\n      'time_since_original_post' => 'unsigned int',\n      'uid' => 'int',\n      'unpublished_content_type' => 'unpublished_content_type_enum',\n      'url' => 'string',\n      'user_selected_tags' => 'bool',\n      'vault_image_id' => 'string',\n    );\n    $enums = array(\n      'backdated_time_granularity_enum' => PhotoBackdatedTimeGranularityValues::getInstance()->getValues(),\n      'unpublished_content_type_enum' => PhotoUnpublishedContentTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/photos',\n      new Photo(),\n      'EDGE',\n      Photo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPicture(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'breaking_change' => 'breaking_change_enum',\n      'height' => 'int',\n      'redirect' => 'bool',\n      'type' => 'type_enum',\n      'width' => 'int',\n    );\n    $enums = array(\n      'breaking_change_enum' => ProfilePictureSourceBreakingChangeValues::getInstance()->getValues(),\n      'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/picture',\n      new ProfilePictureSource(),\n      'EDGE',\n      ProfilePictureSource::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPicture(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'android_key_hash' => 'string',\n      'burn_media_effect' => 'bool',\n      'caption' => 'string',\n      'composer_session_id' => 'string',\n      'frame_entrypoint' => 'string',\n      'has_umg' => 'bool',\n      'height' => 'unsigned int',\n      'ios_bundle_id' => 'string',\n      'media_effect_ids' => 'list<int>',\n      'media_effect_source_object_id' => 'int',\n      'msqrd_mask_id' => 'string',\n      'photo' => 'string',\n      'picture' => 'string',\n      'profile_pic_method' => 'string',\n      'profile_pic_source' => 'string',\n      'proxied_app_id' => 'int',\n      'qn' => 'string',\n      'reuse' => 'bool',\n      'scaled_crop_rect' => 'Object',\n      'set_profile_photo_shield' => 'string',\n      'sticker_id' => 'int',\n      'sticker_source_object_id' => 'int',\n      'suppress_stories' => 'bool',\n      'width' => 'unsigned int',\n      'x' => 'unsigned int',\n      'y' => 'unsigned int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/picture',\n      new ProfilePictureSource(),\n      'EDGE',\n      ProfilePictureSource::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPosts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'include_hidden' => 'bool',\n      'limit' => 'unsigned int',\n      'q' => 'string',\n      'show_expired' => 'bool',\n      'with' => 'with_enum',\n    );\n    $enums = array(\n      'with_enum' => PagePostWithValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/posts',\n      new PagePost(),\n      'EDGE',\n      PagePost::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getProductCatalogs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/product_catalogs',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPublishedPosts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'include_hidden' => 'bool',\n      'limit' => 'unsigned int',\n      'show_expired' => 'bool',\n      'with' => 'with_enum',\n    );\n    $enums = array(\n      'with_enum' => PagePostWithValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/published_posts',\n      new PagePost(),\n      'EDGE',\n      PagePost::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getRatings(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ratings',\n      new Recommendation(),\n      'EDGE',\n      Recommendation::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createReleaseThreadControl(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'recipient' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/release_thread_control',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createRequestThreadControl(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'metadata' => 'string',\n      'recipient' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/request_thread_control',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getRoles(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'include_deactivated' => 'bool',\n      'uid' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/roles',\n      new User(),\n      'EDGE',\n      User::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getRtbDynamicPosts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/rtb_dynamic_posts',\n      new RTBDynamicPost(),\n      'EDGE',\n      RTBDynamicPost::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getScheduledPosts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/scheduled_posts',\n      new PagePost(),\n      'EDGE',\n      PagePost::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSecondaryReceivers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'platform' => 'platform_enum',\n    );\n    $enums = array(\n      'platform_enum' => ApplicationPlatformValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/secondary_receivers',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSettings(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/settings',\n      new PageSettings(),\n      'EDGE',\n      PageSettings::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createSetting(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'option' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/settings',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getShopSetupStatus(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/shop_setup_status',\n      new CommerceMerchantSettingsSetupStatus(),\n      'EDGE',\n      CommerceMerchantSettingsSetupStatus::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSubscribedApps(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/subscribed_apps',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSubscribedApps(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/subscribed_apps',\n      new Application(),\n      'EDGE',\n      Application::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createSubscribedApp(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'subscribed_fields' => 'list<subscribed_fields_enum>',\n    );\n    $enums = array(\n      'subscribed_fields_enum' => PageSubscribedFieldsValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/subscribed_apps',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTabs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'tab' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/tabs',\n      new Tab(),\n      'EDGE',\n      Tab::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTagged(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/tagged',\n      new PagePost(),\n      'EDGE',\n      PagePost::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createTakeThreadControl(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'metadata' => 'string',\n      'recipient' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/take_thread_control',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getThreadOwner(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'recipient' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/thread_owner',\n      new PageThreadOwner(),\n      'EDGE',\n      PageThreadOwner::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getThreads(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'folder' => 'string',\n      'tags' => 'list<string>',\n      'user_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/threads',\n      new UnifiedThread(),\n      'EDGE',\n      UnifiedThread::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createUnlinkAccount(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'psid' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/unlink_accounts',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideoCopyrightRules(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'selected_rule_id' => 'string',\n      'source' => 'source_enum',\n    );\n    $enums = array(\n      'source_enum' => VideoCopyrightRuleSourceValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/video_copyright_rules',\n      new VideoCopyrightRule(),\n      'EDGE',\n      VideoCopyrightRule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createVideoCopyrightRule(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'condition_groups' => 'list<Object>',\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/video_copyright_rules',\n      new VideoCopyrightRule(),\n      'EDGE',\n      VideoCopyrightRule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createVideoCopyright(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'attribution_id' => 'string',\n      'content_category' => 'content_category_enum',\n      'copyright_content_id' => 'string',\n      'excluded_ownership_countries' => 'list<string>',\n      'excluded_ownership_segments' => 'list<Object>',\n      'is_reference_disabled' => 'bool',\n      'is_reference_video' => 'bool',\n      'monitoring_type' => 'monitoring_type_enum',\n      'ownership_countries' => 'list<string>',\n      'rule_id' => 'string',\n      'tags' => 'list<string>',\n      'whitelisted_ids' => 'list<string>',\n      'whitelisted_ig_user_ids' => 'list<string>',\n    );\n    $enums = array(\n      'content_category_enum' => VideoCopyrightContentCategoryValues::getInstance()->getValues(),\n      'monitoring_type_enum' => VideoCopyrightMonitoringTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/video_copyrights',\n      new VideoCopyright(),\n      'EDGE',\n      VideoCopyright::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideoLists(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/video_lists',\n      new VideoList(),\n      'EDGE',\n      VideoList::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideoReels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'since' => 'datetime',\n      'until' => 'datetime',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/video_reels',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createVideoReel(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'description' => 'string',\n      'feed_targeting' => 'Object',\n      'scheduled_publish_time' => 'datetime',\n      'targeting' => 'Object',\n      'title' => 'string',\n      'upload_phase' => 'upload_phase_enum',\n      'video_id' => 'Object',\n      'video_state' => 'video_state_enum',\n    );\n    $enums = array(\n      'upload_phase_enum' => AdVideoUploadPhaseValues::getInstance()->getValues(),\n      'video_state_enum' => AdVideoVideoStateValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/video_reels',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'type_enum' => AdVideoTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/videos',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createVideo(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_breaks' => 'list',\n      'adaptive_type' => 'string',\n      'animated_effect_id' => 'unsigned int',\n      'application_id' => 'string',\n      'asked_fun_fact_prompt_id' => 'unsigned int',\n      'audio_story_wave_animation_handle' => 'string',\n      'backdated_post' => 'list',\n      'call_to_action' => 'Object',\n      'composer_entry_picker' => 'string',\n      'composer_entry_point' => 'string',\n      'composer_entry_time' => 'unsigned int',\n      'composer_session_events_log' => 'string',\n      'composer_session_id' => 'string',\n      'composer_source_surface' => 'string',\n      'composer_type' => 'string',\n      'container_type' => 'container_type_enum',\n      'content_category' => 'content_category_enum',\n      'content_tags' => 'list<string>',\n      'creative_tools' => 'string',\n      'crossposted_video_id' => 'string',\n      'custom_labels' => 'list<string>',\n      'description' => 'string',\n      'direct_share_status' => 'unsigned int',\n      'embeddable' => 'bool',\n      'end_offset' => 'unsigned int',\n      'expiration' => 'Object',\n      'fbuploader_video_file_chunk' => 'string',\n      'feed_targeting' => 'Object',\n      'file_size' => 'unsigned int',\n      'file_url' => 'string',\n      'fisheye_video_cropped' => 'bool',\n      'formatting' => 'formatting_enum',\n      'fov' => 'unsigned int',\n      'front_z_rotation' => 'float',\n      'fun_fact_prompt_id' => 'unsigned int',\n      'fun_fact_toastee_id' => 'unsigned int',\n      'guide' => 'list<list<unsigned int>>',\n      'guide_enabled' => 'bool',\n      'has_nickname' => 'bool',\n      'holiday_card' => 'string',\n      'initial_heading' => 'unsigned int',\n      'initial_pitch' => 'unsigned int',\n      'instant_game_entry_point_data' => 'string',\n      'is_boost_intended' => 'bool',\n      'is_explicit_share' => 'bool',\n      'is_group_linking_post' => 'bool',\n      'is_voice_clip' => 'bool',\n      'location_source_id' => 'string',\n      'manual_privacy' => 'bool',\n      'multilingual_data' => 'list<Object>',\n      'no_story' => 'bool',\n      'offer_like_post_id' => 'unsigned int',\n      'og_action_type_id' => 'string',\n      'og_icon_id' => 'string',\n      'og_object_id' => 'string',\n      'og_phrase' => 'string',\n      'og_suggestion_mechanism' => 'string',\n      'original_fov' => 'unsigned int',\n      'original_projection_type' => 'original_projection_type_enum',\n      'publish_event_id' => 'unsigned int',\n      'published' => 'bool',\n      'react_mode_metadata' => 'string',\n      'reference_only' => 'bool',\n      'referenced_sticker_id' => 'string',\n      'replace_video_id' => 'string',\n      'scheduled_publish_time' => 'unsigned int',\n      'secret' => 'bool',\n      'slideshow_spec' => 'map',\n      'social_actions' => 'bool',\n      'source' => 'string',\n      'source_instagram_media_id' => 'string',\n      'specified_dialect' => 'string',\n      'spherical' => 'bool',\n      'sponsor_id' => 'string',\n      'sponsor_relationship' => 'unsigned int',\n      'start_offset' => 'unsigned int',\n      'swap_mode' => 'swap_mode_enum',\n      'targeting' => 'Object',\n      'text_format_metadata' => 'string',\n      'throwback_camera_roll_media' => 'string',\n      'thumb' => 'file',\n      'time_since_original_post' => 'unsigned int',\n      'title' => 'string',\n      'transcode_setting_properties' => 'string',\n      'universal_video_id' => 'string',\n      'unpublished_content_type' => 'unpublished_content_type_enum',\n      'upload_phase' => 'upload_phase_enum',\n      'upload_session_id' => 'string',\n      'upload_setting_properties' => 'string',\n      'video_asset_id' => 'string',\n      'video_file_chunk' => 'string',\n      'video_id_original' => 'string',\n      'video_start_time_ms' => 'unsigned int',\n      'waterfall_id' => 'string',\n    );\n    $enums = array(\n      'container_type_enum' => AdVideoContainerTypeValues::getInstance()->getValues(),\n      'content_category_enum' => AdVideoContentCategoryValues::getInstance()->getValues(),\n      'formatting_enum' => AdVideoFormattingValues::getInstance()->getValues(),\n      'original_projection_type_enum' => AdVideoOriginalProjectionTypeValues::getInstance()->getValues(),\n      'swap_mode_enum' => AdVideoSwapModeValues::getInstance()->getValues(),\n      'unpublished_content_type_enum' => AdVideoUnpublishedContentTypeValues::getInstance()->getValues(),\n      'upload_phase_enum' => AdVideoUploadPhaseValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/videos',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVisitorPosts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'include_hidden' => 'bool',\n      'limit' => 'unsigned int',\n      'show_expired' => 'bool',\n      'with' => 'with_enum',\n    );\n    $enums = array(\n      'with_enum' => PagePostWithValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/visitor_posts',\n      new PagePost(),\n      'EDGE',\n      PagePost::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getWelcomeMessageFlows(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'flow_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/welcome_message_flows',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'account_linking_token' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Page(),\n      'NODE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'about' => 'string',\n      'accept_crossposting_handshake' => 'list<map>',\n      'allow_spherical_photo' => 'bool',\n      'attire' => 'attire_enum',\n      'begin_crossposting_handshake' => 'list<map>',\n      'bio' => 'string',\n      'category_list' => 'list<string>',\n      'company_overview' => 'string',\n      'contact_address' => 'Object',\n      'cover' => 'string',\n      'culinary_team' => 'string',\n      'delivery_and_pickup_option_info' => 'list<string>',\n      'description' => 'string',\n      'differently_open_offerings' => 'map',\n      'directed_by' => 'string',\n      'displayed_message_response_time' => 'string',\n      'emails' => 'list<string>',\n      'focus_x' => 'float',\n      'focus_y' => 'float',\n      'food_styles' => 'list<food_styles_enum>',\n      'general_info' => 'string',\n      'general_manager' => 'string',\n      'genre' => 'string',\n      'hours' => 'map',\n      'ignore_coordinate_warnings' => 'bool',\n      'impressum' => 'string',\n      'is_always_open' => 'bool',\n      'is_permanently_closed' => 'bool',\n      'is_published' => 'bool',\n      'is_webhooks_subscribed' => 'bool',\n      'location' => 'Object',\n      'menu' => 'string',\n      'mission' => 'string',\n      'no_feed_story' => 'bool',\n      'no_notification' => 'bool',\n      'offset_x' => 'int',\n      'offset_y' => 'int',\n      'parking' => 'map',\n      'payment_options' => 'map',\n      'phone' => 'string',\n      'pickup_options' => 'list<pickup_options_enum>',\n      'plot_outline' => 'string',\n      'price_range' => 'string',\n      'public_transit' => 'string',\n      'restaurant_services' => 'map',\n      'restaurant_specialties' => 'map',\n      'scrape' => 'bool',\n      'service_details' => 'string',\n      'spherical_metadata' => 'map',\n      'start_info' => 'Object',\n      'store_location_descriptor' => 'string',\n      'temporary_status' => 'temporary_status_enum',\n      'website' => 'string',\n      'zoom_scale_x' => 'float',\n      'zoom_scale_y' => 'float',\n    );\n    $enums = array(\n      'attire_enum' => PageAttireValues::getInstance()->getValues(),\n      'food_styles_enum' => PageFoodStylesValues::getInstance()->getValues(),\n      'pickup_options_enum' => PagePickupOptionsValues::getInstance()->getValues(),\n      'temporary_status_enum' => PageTemporaryStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new Page(),\n      'NODE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 3512}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PageCallToActionFields;\nuse FacebookAds\\Object\\Values\\PageCallToActionAndroidDestinationTypeValues;\nuse FacebookAds\\Object\\Values\\PageCallToActionIphoneDestinationTypeValues;\nuse FacebookAds\\Object\\Values\\PageCallToActionTypeValues;\nuse FacebookAds\\Object\\Values\\PageCallToActionWebDestinationTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageCallToAction extends AbstractCrudObject {\n\n  /**\n   * @return PageCallToActionFields\n   */\n  public static function getFieldsEnum() {\n    return PageCallToActionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['AndroidDestinationType'] = PageCallToActionAndroidDestinationTypeValues::getInstance()->getValues();\n    $ref_enums['IphoneDestinationType'] = PageCallToActionIphoneDestinationTypeValues::getInstance()->getValues();\n    $ref_enums['Type'] = PageCallToActionTypeValues::getInstance()->getValues();\n    $ref_enums['WebDestinationType'] = PageCallToActionWebDestinationTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new PageCallToAction(),\n      'NODE',\n      PageCallToAction::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'android_app_id' => 'int',\n      'android_destination_type' => 'android_destination_type_enum',\n      'android_package_name' => 'string',\n      'android_url' => 'string',\n      'email_address' => 'string',\n      'intl_number_with_plus' => 'string',\n      'iphone_app_id' => 'int',\n      'iphone_destination_type' => 'iphone_destination_type_enum',\n      'iphone_url' => 'string',\n      'type' => 'type_enum',\n      'web_destination_type' => 'web_destination_type_enum',\n      'web_url' => 'string',\n    );\n    $enums = array(\n      'android_destination_type_enum' => PageCallToActionAndroidDestinationTypeValues::getInstance()->getValues(),\n      'iphone_destination_type_enum' => PageCallToActionIphoneDestinationTypeValues::getInstance()->getValues(),\n      'type_enum' => PageCallToActionTypeValues::getInstance()->getValues(),\n      'web_destination_type_enum' => PageCallToActionWebDestinationTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new PageCallToAction(),\n      'NODE',\n      PageCallToAction::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 151}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PageCategoryFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageCategory extends AbstractCrudObject {\n\n  /**\n   * @return PageCategoryFields\n   */\n  public static function getFieldsEnum() {\n    return PageCategoryFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PageChangeProposalFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageChangeProposal extends AbstractCrudObject {\n\n  /**\n   * @return PageChangeProposalFields\n   */\n  public static function getFieldsEnum() {\n    return PageChangeProposalFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PageCommerceEligibilityFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageCommerceEligibility extends AbstractObject {\n\n  /**\n   * @return PageCommerceEligibilityFields\n   */\n  public static function getFieldsEnum() {\n    return PageCommerceEligibilityFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PageParkingFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageParking extends AbstractObject {\n\n  /**\n   * @return PageParkingFields\n   */\n  public static function getFieldsEnum() {\n    return PageParkingFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PagePaymentOptionsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PagePaymentOptions extends AbstractObject {\n\n  /**\n   * @return PagePaymentOptionsFields\n   */\n  public static function getFieldsEnum() {\n    return PagePaymentOptionsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PagePostFields;\nuse FacebookAds\\Object\\Values\\CommentCommentPrivacyValueValues;\nuse FacebookAds\\Object\\Values\\CommentFilterValues;\nuse FacebookAds\\Object\\Values\\CommentLiveFilterValues;\nuse FacebookAds\\Object\\Values\\CommentOrderValues;\nuse FacebookAds\\Object\\Values\\InsightsResultDatePresetValues;\nuse FacebookAds\\Object\\Values\\InsightsResultPeriodValues;\nuse FacebookAds\\Object\\Values\\PagePostBackdatedTimeGranularityValues;\nuse FacebookAds\\Object\\Values\\PagePostFeedStoryVisibilityValues;\nuse FacebookAds\\Object\\Values\\PagePostTimelineVisibilityValues;\nuse FacebookAds\\Object\\Values\\PagePostWithValues;\nuse FacebookAds\\Object\\Values\\ProfileTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PagePost extends AbstractCrudObject {\n\n  /**\n   * @return PagePostFields\n   */\n  public static function getFieldsEnum() {\n    return PagePostFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['With'] = PagePostWithValues::getInstance()->getValues();\n    $ref_enums['BackdatedTimeGranularity'] = PagePostBackdatedTimeGranularityValues::getInstance()->getValues();\n    $ref_enums['FeedStoryVisibility'] = PagePostFeedStoryVisibilityValues::getInstance()->getValues();\n    $ref_enums['TimelineVisibility'] = PagePostTimelineVisibilityValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAttachments(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/attachments',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getComments(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'filter' => 'filter_enum',\n      'live_filter' => 'live_filter_enum',\n      'order' => 'order_enum',\n      'since' => 'datetime',\n    );\n    $enums = array(\n      'filter_enum' => CommentFilterValues::getInstance()->getValues(),\n      'live_filter_enum' => CommentLiveFilterValues::getInstance()->getValues(),\n      'order_enum' => CommentOrderValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/comments',\n      new Comment(),\n      'EDGE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createComment(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'attachment_id' => 'string',\n      'attachment_share_url' => 'string',\n      'attachment_url' => 'string',\n      'comment' => 'string',\n      'comment_privacy_value' => 'comment_privacy_value_enum',\n      'feedback_source' => 'string',\n      'message' => 'string',\n      'nectar_module' => 'string',\n      'parent_comment_id' => 'Object',\n      'post_id' => 'string',\n      'tracking' => 'string',\n    );\n    $enums = array(\n      'comment_privacy_value_enum' => CommentCommentPrivacyValueValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/comments',\n      new Comment(),\n      'EDGE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getDynamicPosts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/dynamic_posts',\n      new RTBDynamicPost(),\n      'EDGE',\n      RTBDynamicPost::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInsights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'date_preset' => 'date_preset_enum',\n      'metric' => 'list<Object>',\n      'period' => 'period_enum',\n      'since' => 'datetime',\n      'until' => 'datetime',\n    );\n    $enums = array(\n      'date_preset_enum' => InsightsResultDatePresetValues::getInstance()->getValues(),\n      'period_enum' => InsightsResultPeriodValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/insights',\n      new InsightsResult(),\n      'EDGE',\n      InsightsResult::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteLikes(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'nectar_module' => 'string',\n      'tracking' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/likes',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLikes(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/likes',\n      new Profile(),\n      'EDGE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createLike(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'feedback_source' => 'string',\n      'nectar_module' => 'string',\n      'tracking' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/likes',\n      new PagePost(),\n      'EDGE',\n      PagePost::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getReactions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'type_enum' => ProfileTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/reactions',\n      new Profile(),\n      'EDGE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSharedPosts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/sharedposts',\n      new Post(),\n      'EDGE',\n      Post::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSponsorTags(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/sponsor_tags',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTo(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/to',\n      new Profile(),\n      'EDGE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new PagePost(),\n      'NODE',\n      PagePost::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'attached_media' => 'list<Object>',\n      'backdated_time' => 'datetime',\n      'backdated_time_granularity' => 'backdated_time_granularity_enum',\n      'composer_session_id' => 'string',\n      'direct_share_status' => 'unsigned int',\n      'explicitly_added_mentionee_ids' => 'list<unsigned int>',\n      'feed_story_visibility' => 'feed_story_visibility_enum',\n      'is_explicit_location' => 'bool',\n      'is_hidden' => 'bool',\n      'is_pinned' => 'bool',\n      'is_published' => 'bool',\n      'message' => 'string',\n      'og_action_type_id' => 'string',\n      'og_hide_object_attachment' => 'bool',\n      'og_icon_id' => 'string',\n      'og_object_id' => 'string',\n      'og_phrase' => 'string',\n      'og_set_profile_badge' => 'bool',\n      'og_suggestion_mechanism' => 'string',\n      'place' => 'Object',\n      'privacy' => 'string',\n      'product_item' => 'Object',\n      'scheduled_publish_time' => 'unsigned int',\n      'should_sync_product_edit' => 'bool',\n      'source_type' => 'string',\n      'sponsor_id' => 'string',\n      'sponsor_relationship' => 'unsigned int',\n      'tags' => 'list<int>',\n      'text_format_preset_id' => 'string',\n      'timeline_visibility' => 'timeline_visibility_enum',\n      'tracking' => 'string',\n    );\n    $enums = array(\n      'backdated_time_granularity_enum' => PagePostBackdatedTimeGranularityValues::getInstance()->getValues(),\n      'feed_story_visibility_enum' => PagePostFeedStoryVisibilityValues::getInstance()->getValues(),\n      'timeline_visibility_enum' => PagePostTimelineVisibilityValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new PagePost(),\n      'NODE',\n      PagePost::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 485}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PagePostExperimentFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PagePostExperiment extends AbstractCrudObject {\n\n  /**\n   * @return PagePostExperimentFields\n   */\n  public static function getFieldsEnum() {\n    return PagePostExperimentFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new PagePostExperiment(),\n      'NODE',\n      PagePostExperiment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PageRestaurantServicesFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageRestaurantServices extends AbstractObject {\n\n  /**\n   * @return PageRestaurantServicesFields\n   */\n  public static function getFieldsEnum() {\n    return PageRestaurantServicesFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PageRestaurantSpecialtiesFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageRestaurantSpecialties extends AbstractObject {\n\n  /**\n   * @return PageRestaurantSpecialtiesFields\n   */\n  public static function getFieldsEnum() {\n    return PageRestaurantSpecialtiesFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PageSavedFilterFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageSavedFilter extends AbstractCrudObject {\n\n  /**\n   * @return PageSavedFilterFields\n   */\n  public static function getFieldsEnum() {\n    return PageSavedFilterFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new PageSavedFilter(),\n      'NODE',\n      PageSavedFilter::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PageSettingsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageSettings extends AbstractObject {\n\n  /**\n   * @return PageSettingsFields\n   */\n  public static function getFieldsEnum() {\n    return PageSettingsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PageStartInfoFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageStartInfo extends AbstractObject {\n\n  /**\n   * @return PageStartInfoFields\n   */\n  public static function getFieldsEnum() {\n    return PageStartInfoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PageThreadOwnerFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageThreadOwner extends AbstractObject {\n\n  /**\n   * @return PageThreadOwnerFields\n   */\n  public static function getFieldsEnum() {\n    return PageThreadOwnerFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PageUpcomingChangeFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageUpcomingChange extends AbstractCrudObject {\n\n  /**\n   * @return PageUpcomingChangeFields\n   */\n  public static function getFieldsEnum() {\n    return PageUpcomingChangeFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new PageUpcomingChange(),\n      'NODE',\n      PageUpcomingChange::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PageUserMessageThreadLabelFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageUserMessageThreadLabel extends AbstractCrudObject {\n\n  /**\n   * @return PageUserMessageThreadLabelFields\n   */\n  public static function getFieldsEnum() {\n    return PageUserMessageThreadLabelFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function deleteLabel(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'user' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/label',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createLabel(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'user' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/label',\n      new PageUserMessageThreadLabel(),\n      'EDGE',\n      PageUserMessageThreadLabel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new PageUserMessageThreadLabel(),\n      'NODE',\n      PageUserMessageThreadLabel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 152}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PartnerStudyFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PartnerStudy extends AbstractCrudObject {\n\n  /**\n   * @return PartnerStudyFields\n   */\n  public static function getFieldsEnum() {\n    return PartnerStudyFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new PartnerStudy(),\n      'NODE',\n      PartnerStudy::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PaymentEnginePaymentFields;\nuse FacebookAds\\Object\\Values\\PaymentEnginePaymentReasonValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PaymentEnginePayment extends AbstractCrudObject {\n\n  /**\n   * @return PaymentEnginePaymentFields\n   */\n  public static function getFieldsEnum() {\n    return PaymentEnginePaymentFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Reason'] = PaymentEnginePaymentReasonValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function createDispute(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'reason' => 'reason_enum',\n    );\n    $enums = array(\n      'reason_enum' => PaymentEnginePaymentReasonValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/dispute',\n      new PaymentEnginePayment(),\n      'EDGE',\n      PaymentEnginePayment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createRefund(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'amount' => 'float',\n      'currency' => 'string',\n      'reason' => 'reason_enum',\n    );\n    $enums = array(\n      'reason_enum' => PaymentEnginePaymentReasonValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/refunds',\n      new PaymentEnginePayment(),\n      'EDGE',\n      PaymentEnginePayment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new PaymentEnginePayment(),\n      'NODE',\n      PaymentEnginePayment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 135}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PaymentPricepointsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PaymentPricepoints extends AbstractObject {\n\n  /**\n   * @return PaymentPricepointsFields\n   */\n  public static function getFieldsEnum() {\n    return PaymentPricepointsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PaymentSubscriptionFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PaymentSubscription extends AbstractCrudObject {\n\n  /**\n   * @return PaymentSubscriptionFields\n   */\n  public static function getFieldsEnum() {\n    return PaymentSubscriptionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new PaymentSubscription(),\n      'NODE',\n      PaymentSubscription::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PermissionFields;\nuse FacebookAds\\Object\\Values\\PermissionStatusValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Permission extends AbstractObject {\n\n  /**\n   * @return PermissionFields\n   */\n  public static function getFieldsEnum() {\n    return PermissionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Status'] = PermissionStatusValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PersonaFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Persona extends AbstractCrudObject {\n\n  /**\n   * @return PersonaFields\n   */\n  public static function getFieldsEnum() {\n    return PersonaFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Persona(),\n      'NODE',\n      Persona::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 104}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PhotoFields;\nuse FacebookAds\\Object\\Values\\CommentCommentPrivacyValueValues;\nuse FacebookAds\\Object\\Values\\CommentFilterValues;\nuse FacebookAds\\Object\\Values\\CommentLiveFilterValues;\nuse FacebookAds\\Object\\Values\\CommentOrderValues;\nuse FacebookAds\\Object\\Values\\InsightsResultDatePresetValues;\nuse FacebookAds\\Object\\Values\\InsightsResultPeriodValues;\nuse FacebookAds\\Object\\Values\\PhotoBackdatedTimeGranularityValues;\nuse FacebookAds\\Object\\Values\\PhotoTypeValues;\nuse FacebookAds\\Object\\Values\\PhotoUnpublishedContentTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Photo extends AbstractCrudObject {\n\n  /**\n   * @return PhotoFields\n   */\n  public static function getFieldsEnum() {\n    return PhotoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['BackdatedTimeGranularity'] = PhotoBackdatedTimeGranularityValues::getInstance()->getValues();\n    $ref_enums['UnpublishedContentType'] = PhotoUnpublishedContentTypeValues::getInstance()->getValues();\n    $ref_enums['Type'] = PhotoTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getComments(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'filter' => 'filter_enum',\n      'live_filter' => 'live_filter_enum',\n      'order' => 'order_enum',\n      'since' => 'datetime',\n    );\n    $enums = array(\n      'filter_enum' => CommentFilterValues::getInstance()->getValues(),\n      'live_filter_enum' => CommentLiveFilterValues::getInstance()->getValues(),\n      'order_enum' => CommentOrderValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/comments',\n      new Comment(),\n      'EDGE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createComment(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'attachment_id' => 'string',\n      'attachment_share_url' => 'string',\n      'attachment_url' => 'string',\n      'comment_privacy_value' => 'comment_privacy_value_enum',\n      'facepile_mentioned_ids' => 'list<string>',\n      'feedback_source' => 'string',\n      'is_offline' => 'bool',\n      'message' => 'string',\n      'nectar_module' => 'string',\n      'object_id' => 'string',\n      'parent_comment_id' => 'Object',\n      'text' => 'string',\n      'tracking' => 'string',\n    );\n    $enums = array(\n      'comment_privacy_value_enum' => CommentCommentPrivacyValueValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/comments',\n      new Comment(),\n      'EDGE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInsights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'date_preset' => 'date_preset_enum',\n      'metric' => 'list<Object>',\n      'period' => 'period_enum',\n      'since' => 'datetime',\n      'until' => 'datetime',\n    );\n    $enums = array(\n      'date_preset_enum' => InsightsResultDatePresetValues::getInstance()->getValues(),\n      'period_enum' => InsightsResultPeriodValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/insights',\n      new InsightsResult(),\n      'EDGE',\n      InsightsResult::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLikes(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/likes',\n      new Profile(),\n      'EDGE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createLike(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'feedback_source' => 'string',\n      'nectar_module' => 'string',\n      'notify' => 'bool',\n      'tracking' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/likes',\n      new Photo(),\n      'EDGE',\n      Photo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSponsorTags(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/sponsor_tags',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Photo(),\n      'NODE',\n      Photo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 286}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PlaceFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Place extends AbstractCrudObject {\n\n  /**\n   * @return PlaceFields\n   */\n  public static function getFieldsEnum() {\n    return PlaceFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Place(),\n      'NODE',\n      Place::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PlaceTopicFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PlaceTopic extends AbstractCrudObject {\n\n  /**\n   * @return PlaceTopicFields\n   */\n  public static function getFieldsEnum() {\n    return PlaceTopicFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'icon_size' => 'icon_size_enum',\n    );\n    $enums = array(\n      'icon_size_enum' => array(\n        '24',\n        '36',\n        '48',\n        '72',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new PlaceTopic(),\n      'NODE',\n      PlaceTopic::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 88}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PlatformImageSourceFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PlatformImageSource extends AbstractObject {\n\n  /**\n   * @return PlatformImageSourceFields\n   */\n  public static function getFieldsEnum() {\n    return PlatformImageSourceFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PlayableContentFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PlayableContent extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'adplayables';\n  }\n\n  /**\n   * @return PlayableContentFields\n   */\n  public static function getFieldsEnum() {\n    return PlayableContentFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new PlayableContent(),\n      'NODE',\n      PlayableContent::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 88}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PostFields;\nuse FacebookAds\\Object\\Values\\CommentCommentPrivacyValueValues;\nuse FacebookAds\\Object\\Values\\CommentFilterValues;\nuse FacebookAds\\Object\\Values\\CommentLiveFilterValues;\nuse FacebookAds\\Object\\Values\\CommentOrderValues;\nuse FacebookAds\\Object\\Values\\InsightsResultDatePresetValues;\nuse FacebookAds\\Object\\Values\\InsightsResultPeriodValues;\nuse FacebookAds\\Object\\Values\\PostBackdatedTimeGranularityValues;\nuse FacebookAds\\Object\\Values\\PostCheckinEntryPointValues;\nuse FacebookAds\\Object\\Values\\PostFeedStoryVisibilityValues;\nuse FacebookAds\\Object\\Values\\PostFormattingValues;\nuse FacebookAds\\Object\\Values\\PostPlaceAttachmentSettingValues;\nuse FacebookAds\\Object\\Values\\PostPostSurfacesBlacklistValues;\nuse FacebookAds\\Object\\Values\\PostPostingToRedspaceValues;\nuse FacebookAds\\Object\\Values\\PostTargetSurfaceValues;\nuse FacebookAds\\Object\\Values\\PostTimelineVisibilityValues;\nuse FacebookAds\\Object\\Values\\PostUnpublishedContentTypeValues;\nuse FacebookAds\\Object\\Values\\ProfileTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Post extends AbstractCrudObject {\n\n  /**\n   * @return PostFields\n   */\n  public static function getFieldsEnum() {\n    return PostFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['BackdatedTimeGranularity'] = PostBackdatedTimeGranularityValues::getInstance()->getValues();\n    $ref_enums['CheckinEntryPoint'] = PostCheckinEntryPointValues::getInstance()->getValues();\n    $ref_enums['Formatting'] = PostFormattingValues::getInstance()->getValues();\n    $ref_enums['PlaceAttachmentSetting'] = PostPlaceAttachmentSettingValues::getInstance()->getValues();\n    $ref_enums['PostSurfacesBlacklist'] = PostPostSurfacesBlacklistValues::getInstance()->getValues();\n    $ref_enums['PostingToRedspace'] = PostPostingToRedspaceValues::getInstance()->getValues();\n    $ref_enums['TargetSurface'] = PostTargetSurfaceValues::getInstance()->getValues();\n    $ref_enums['UnpublishedContentType'] = PostUnpublishedContentTypeValues::getInstance()->getValues();\n    $ref_enums['FeedStoryVisibility'] = PostFeedStoryVisibilityValues::getInstance()->getValues();\n    $ref_enums['TimelineVisibility'] = PostTimelineVisibilityValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAttachments(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/attachments',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getComments(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'filter' => 'filter_enum',\n      'live_filter' => 'live_filter_enum',\n      'order' => 'order_enum',\n      'since' => 'datetime',\n    );\n    $enums = array(\n      'filter_enum' => CommentFilterValues::getInstance()->getValues(),\n      'live_filter_enum' => CommentLiveFilterValues::getInstance()->getValues(),\n      'order_enum' => CommentOrderValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/comments',\n      new Comment(),\n      'EDGE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createComment(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'attachment_id' => 'string',\n      'attachment_share_url' => 'string',\n      'attachment_url' => 'string',\n      'comment' => 'string',\n      'comment_privacy_value' => 'comment_privacy_value_enum',\n      'feedback_source' => 'string',\n      'message' => 'string',\n      'nectar_module' => 'string',\n      'parent_comment_id' => 'Object',\n      'post_id' => 'string',\n      'tracking' => 'string',\n    );\n    $enums = array(\n      'comment_privacy_value_enum' => CommentCommentPrivacyValueValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/comments',\n      new Comment(),\n      'EDGE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getDynamicPosts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/dynamic_posts',\n      new RTBDynamicPost(),\n      'EDGE',\n      RTBDynamicPost::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getInsights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'date_preset' => 'date_preset_enum',\n      'metric' => 'list<Object>',\n      'period' => 'period_enum',\n      'since' => 'datetime',\n      'until' => 'datetime',\n    );\n    $enums = array(\n      'date_preset_enum' => InsightsResultDatePresetValues::getInstance()->getValues(),\n      'period_enum' => InsightsResultPeriodValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/insights',\n      new InsightsResult(),\n      'EDGE',\n      InsightsResult::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteLikes(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'nectar_module' => 'string',\n      'tracking' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/likes',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createLike(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'feedback_source' => 'string',\n      'nectar_module' => 'string',\n      'tracking' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/likes',\n      new Post(),\n      'EDGE',\n      Post::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getReactions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'type_enum' => ProfileTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/reactions',\n      new Profile(),\n      'EDGE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSharedPosts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/sharedposts',\n      new Post(),\n      'EDGE',\n      Post::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSponsorTags(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/sponsor_tags',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTo(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/to',\n      new Profile(),\n      'EDGE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Post(),\n      'NODE',\n      Post::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'attached_media' => 'list<Object>',\n      'backdated_time' => 'datetime',\n      'backdated_time_granularity' => 'backdated_time_granularity_enum',\n      'composer_session_id' => 'string',\n      'direct_share_status' => 'unsigned int',\n      'explicitly_added_mentionee_ids' => 'list<unsigned int>',\n      'feed_story_visibility' => 'feed_story_visibility_enum',\n      'is_explicit_location' => 'bool',\n      'is_hidden' => 'bool',\n      'is_pinned' => 'bool',\n      'is_published' => 'bool',\n      'message' => 'string',\n      'og_action_type_id' => 'string',\n      'og_hide_object_attachment' => 'bool',\n      'og_icon_id' => 'string',\n      'og_object_id' => 'string',\n      'og_phrase' => 'string',\n      'og_set_profile_badge' => 'bool',\n      'og_suggestion_mechanism' => 'string',\n      'place' => 'Object',\n      'privacy' => 'string',\n      'product_item' => 'Object',\n      'scheduled_publish_time' => 'unsigned int',\n      'should_sync_product_edit' => 'bool',\n      'source_type' => 'string',\n      'sponsor_id' => 'string',\n      'sponsor_relationship' => 'unsigned int',\n      'tags' => 'list<int>',\n      'text_format_preset_id' => 'string',\n      'timeline_visibility' => 'timeline_visibility_enum',\n      'tracking' => 'string',\n    );\n    $enums = array(\n      'backdated_time_granularity_enum' => PostBackdatedTimeGranularityValues::getInstance()->getValues(),\n      'feed_story_visibility_enum' => PostFeedStoryVisibilityValues::getInstance()->getValues(),\n      'timeline_visibility_enum' => PostTimelineVisibilityValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new Post(),\n      'NODE',\n      Post::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 474}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PrivacyFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Privacy extends AbstractObject {\n\n  /**\n   * @return PrivacyFields\n   */\n  public static function getFieldsEnum() {\n    return PrivacyFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PrivateLiftStudyInstanceFields;\nuse FacebookAds\\Object\\Values\\PrivateLiftStudyInstanceOperationValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PrivateLiftStudyInstance extends AbstractCrudObject {\n\n  /**\n   * @return PrivateLiftStudyInstanceFields\n   */\n  public static function getFieldsEnum() {\n    return PrivateLiftStudyInstanceFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Operation'] = PrivateLiftStudyInstanceOperationValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new PrivateLiftStudyInstance(),\n      'NODE',\n      PrivateLiftStudyInstance::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'operation' => 'operation_enum',\n      'run_id' => 'string',\n    );\n    $enums = array(\n      'operation_enum' => PrivateLiftStudyInstanceOperationValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new PrivateLiftStudyInstance(),\n      'NODE',\n      PrivateLiftStudyInstance::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 109}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\Object\\Fields\\ProductAudienceFields;\n\nclass ProductAudience extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   * @return string\n   */\n  protected function getEndpoint() {\n    return 'product_audiences';\n  }\n\n  /**\n   * @return ProductAudienceFields\n   */\n  public static function getFieldsEnum() {\n    return ProductAudienceFields::getInstance();\n  }\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductCatalogFields;\nuse FacebookAds\\Object\\Values\\CheckBatchRequestStatusErrorPriorityValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogCategoryCategorizationCriteriaValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogDataSourceIngestionSourceTypeValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogDiagnosticGroupAffectedChannelsValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogDiagnosticGroupAffectedEntitiesValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogDiagnosticGroupAffectedFeaturesValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogDiagnosticGroupSeveritiesValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogDiagnosticGroupTypesValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogItemSubTypeValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogPermittedRolesValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogPermittedTasksValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogStandardValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogTasksValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogVerticalValues;\nuse FacebookAds\\Object\\Values\\ProductEventStatBreakdownsValues;\nuse FacebookAds\\Object\\Values\\ProductFeedDelimiterValues;\nuse FacebookAds\\Object\\Values\\ProductFeedEncodingValues;\nuse FacebookAds\\Object\\Values\\ProductFeedFeedTypeValues;\nuse FacebookAds\\Object\\Values\\ProductFeedIngestionSourceTypeValues;\nuse FacebookAds\\Object\\Values\\ProductFeedItemSubTypeValues;\nuse FacebookAds\\Object\\Values\\ProductFeedOverrideTypeValues;\nuse FacebookAds\\Object\\Values\\ProductFeedQuotedFieldsModeValues;\nuse FacebookAds\\Object\\Values\\ProductItemAvailabilityValues;\nuse FacebookAds\\Object\\Values\\ProductItemCommerceTaxCategoryValues;\nuse FacebookAds\\Object\\Values\\ProductItemConditionValues;\nuse FacebookAds\\Object\\Values\\ProductItemErrorPriorityValues;\nuse FacebookAds\\Object\\Values\\ProductItemErrorTypeValues;\nuse FacebookAds\\Object\\Values\\ProductItemGenderValues;\nuse FacebookAds\\Object\\Values\\ProductItemMarkedForProductLaunchValues;\nuse FacebookAds\\Object\\Values\\ProductItemOriginCountryValues;\nuse FacebookAds\\Object\\Values\\ProductItemVisibilityValues;\nuse FacebookAds\\Object\\Values\\ProductItemWaComplianceCategoryValues;\nuse FacebookAds\\Object\\Values\\VehicleAvailabilityValues;\nuse FacebookAds\\Object\\Values\\VehicleBodyStyleValues;\nuse FacebookAds\\Object\\Values\\VehicleConditionValues;\nuse FacebookAds\\Object\\Values\\VehicleDrivetrainValues;\nuse FacebookAds\\Object\\Values\\VehicleFuelTypeValues;\nuse FacebookAds\\Object\\Values\\VehicleStateOfVehicleValues;\nuse FacebookAds\\Object\\Values\\VehicleTransmissionValues;\nuse FacebookAds\\Object\\Values\\VehicleVehicleTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalog extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'owned_product_catalogs';\n  }\n\n  /**\n   * @return ProductCatalogFields\n   */\n  public static function getFieldsEnum() {\n    return ProductCatalogFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Vertical'] = ProductCatalogVerticalValues::getInstance()->getValues();\n    $ref_enums['PermittedRoles'] = ProductCatalogPermittedRolesValues::getInstance()->getValues();\n    $ref_enums['PermittedTasks'] = ProductCatalogPermittedTasksValues::getInstance()->getValues();\n    $ref_enums['Tasks'] = ProductCatalogTasksValues::getInstance()->getValues();\n    $ref_enums['Standard'] = ProductCatalogStandardValues::getInstance()->getValues();\n    $ref_enums['ItemSubType'] = ProductCatalogItemSubTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function deleteAgencies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/agencies',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAgencies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/agencies',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAgency(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n      'permitted_roles' => 'list<permitted_roles_enum>',\n      'permitted_tasks' => 'list<permitted_tasks_enum>',\n      'utm_settings' => 'map',\n    );\n    $enums = array(\n      'permitted_roles_enum' => ProductCatalogPermittedRolesValues::getInstance()->getValues(),\n      'permitted_tasks_enum' => ProductCatalogPermittedTasksValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/agencies',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getArEffectsBatchStatus(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'handle' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ar_effects_batch_status',\n      new AREffectsBatchStatus(),\n      'EDGE',\n      AREffectsBatchStatus::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteAssignedUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'user' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/assigned_users',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAssignedUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/assigned_users',\n      new AssignedUser(),\n      'EDGE',\n      AssignedUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAssignedUser(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'tasks' => 'list<tasks_enum>',\n      'user' => 'int',\n    );\n    $enums = array(\n      'tasks_enum' => ProductCatalogTasksValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/assigned_users',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAutomotiveModels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/automotive_models',\n      new AutomotiveModel(),\n      'EDGE',\n      AutomotiveModel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createBatch(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'allow_upsert' => 'bool',\n      'fbe_external_business_id' => 'string',\n      'requests' => 'list<map>',\n      'version' => 'unsigned int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/batch',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCatalogStore(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'page' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/catalog_store',\n      new StoreCatalogSettings(),\n      'EDGE',\n      StoreCatalogSettings::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCategories(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'categorization_criteria' => 'categorization_criteria_enum',\n      'filter' => 'Object',\n    );\n    $enums = array(\n      'categorization_criteria_enum' => ProductCatalogCategoryCategorizationCriteriaValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/categories',\n      new ProductCatalogCategory(),\n      'EDGE',\n      ProductCatalogCategory::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCategory(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'data' => 'list<map>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/categories',\n      new ProductCatalogCategory(),\n      'EDGE',\n      ProductCatalogCategory::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCheckBatchRequestStatus(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'error_priority' => 'error_priority_enum',\n      'handle' => 'string',\n      'load_ids_of_invalid_requests' => 'bool',\n    );\n    $enums = array(\n      'error_priority_enum' => CheckBatchRequestStatusErrorPriorityValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/check_batch_request_status',\n      new CheckBatchRequestStatus(),\n      'EDGE',\n      CheckBatchRequestStatus::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCollaborativeAdsEventStats(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/collaborative_ads_event_stats',\n      new CatalogSegmentAllMatchCountLaser(),\n      'EDGE',\n      CatalogSegmentAllMatchCountLaser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCollaborativeAdsLsbImageBank(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/collaborative_ads_lsb_image_bank',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCollaborativeAdsShareSettings(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/collaborative_ads_share_settings',\n      new CollaborativeAdsShareSettings(),\n      'EDGE',\n      CollaborativeAdsShareSettings::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createCpasLsbImageBank(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ad_group_id' => 'unsigned int',\n      'agency_business_id' => 'unsigned int',\n      'backup_image_urls' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/cpas_lsb_image_bank',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getDataSources(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ingestion_source_type' => 'ingestion_source_type_enum',\n    );\n    $enums = array(\n      'ingestion_source_type_enum' => ProductCatalogDataSourceIngestionSourceTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/data_sources',\n      new ProductCatalogDataSource(),\n      'EDGE',\n      ProductCatalogDataSource::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getDestinations(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/destinations',\n      new Destination(),\n      'EDGE',\n      Destination::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getDiagnostics(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'affected_channels' => 'list<affected_channels_enum>',\n      'affected_entities' => 'list<affected_entities_enum>',\n      'affected_features' => 'list<affected_features_enum>',\n      'severities' => 'list<severities_enum>',\n      'types' => 'list<types_enum>',\n    );\n    $enums = array(\n      'affected_channels_enum' => ProductCatalogDiagnosticGroupAffectedChannelsValues::getInstance()->getValues(),\n      'affected_entities_enum' => ProductCatalogDiagnosticGroupAffectedEntitiesValues::getInstance()->getValues(),\n      'affected_features_enum' => ProductCatalogDiagnosticGroupAffectedFeaturesValues::getInstance()->getValues(),\n      'severities_enum' => ProductCatalogDiagnosticGroupSeveritiesValues::getInstance()->getValues(),\n      'types_enum' => ProductCatalogDiagnosticGroupTypesValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/diagnostics',\n      new ProductCatalogDiagnosticGroup(),\n      'EDGE',\n      ProductCatalogDiagnosticGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getEventStats(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'breakdowns' => 'list<breakdowns_enum>',\n    );\n    $enums = array(\n      'breakdowns_enum' => ProductEventStatBreakdownsValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/event_stats',\n      new ProductEventStat(),\n      'EDGE',\n      ProductEventStat::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteExternalEventSources(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'external_event_sources' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/external_event_sources',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getExternalEventSources(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/external_event_sources',\n      new ExternalEventSource(),\n      'EDGE',\n      ExternalEventSource::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createExternalEventSource(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'external_event_sources' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/external_event_sources',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getFlights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/flights',\n      new Flight(),\n      'EDGE',\n      Flight::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getHomeListings(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/home_listings',\n      new HomeListing(),\n      'EDGE',\n      HomeListing::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createHomeListing(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'address' => 'Object',\n      'availability' => 'string',\n      'currency' => 'string',\n      'description' => 'string',\n      'home_listing_id' => 'string',\n      'images' => 'list<Object>',\n      'listing_type' => 'string',\n      'name' => 'string',\n      'num_baths' => 'float',\n      'num_beds' => 'float',\n      'num_units' => 'float',\n      'price' => 'float',\n      'property_type' => 'string',\n      'url' => 'string',\n      'year_built' => 'unsigned int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/home_listings',\n      new HomeListing(),\n      'EDGE',\n      HomeListing::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getHotelRoomsBatch(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'handle' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/hotel_rooms_batch',\n      new ProductCatalogHotelRoomsBatch(),\n      'EDGE',\n      ProductCatalogHotelRoomsBatch::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createHotelRoomsBatch(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'file' => 'file',\n      'password' => 'string',\n      'standard' => 'standard_enum',\n      'update_only' => 'bool',\n      'url' => 'string',\n      'username' => 'string',\n    );\n    $enums = array(\n      'standard_enum' => ProductCatalogStandardValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/hotel_rooms_batch',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getHotels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/hotels',\n      new Hotel(),\n      'EDGE',\n      Hotel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createHotel(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'address' => 'Object',\n      'applinks' => 'Object',\n      'base_price' => 'unsigned int',\n      'brand' => 'string',\n      'currency' => 'string',\n      'description' => 'string',\n      'guest_ratings' => 'list<Object>',\n      'hotel_id' => 'string',\n      'images' => 'list<Object>',\n      'name' => 'string',\n      'phone' => 'string',\n      'star_rating' => 'float',\n      'url' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/hotels',\n      new Hotel(),\n      'EDGE',\n      Hotel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createItemsBatch(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'allow_upsert' => 'bool',\n      'item_sub_type' => 'item_sub_type_enum',\n      'item_type' => 'string',\n      'requests' => 'map',\n      'version' => 'unsigned int',\n    );\n    $enums = array(\n      'item_sub_type_enum' => ProductCatalogItemSubTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/items_batch',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createLocalizedItemsBatch(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'allow_upsert' => 'bool',\n      'item_type' => 'string',\n      'requests' => 'map',\n      'version' => 'unsigned int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/localized_items_batch',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPricingVariablesBatch(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'handle' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/pricing_variables_batch',\n      new ProductCatalogPricingVariablesBatch(),\n      'EDGE',\n      ProductCatalogPricingVariablesBatch::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPricingVariablesBatch(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'file' => 'file',\n      'password' => 'string',\n      'standard' => 'standard_enum',\n      'update_only' => 'bool',\n      'url' => 'string',\n      'username' => 'string',\n    );\n    $enums = array(\n      'standard_enum' => ProductCatalogStandardValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/pricing_variables_batch',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getProductFeeds(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/product_feeds',\n      new ProductFeed(),\n      'EDGE',\n      ProductFeed::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createProductFeed(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'country' => 'string',\n      'default_currency' => 'string',\n      'deletion_enabled' => 'bool',\n      'delimiter' => 'delimiter_enum',\n      'encoding' => 'encoding_enum',\n      'feed_type' => 'feed_type_enum',\n      'file_name' => 'string',\n      'ingestion_source_type' => 'ingestion_source_type_enum',\n      'item_sub_type' => 'item_sub_type_enum',\n      'migrated_from_feed_id' => 'string',\n      'name' => 'string',\n      'override_type' => 'override_type_enum',\n      'override_value' => 'string',\n      'primary_feed_ids' => 'list<string>',\n      'quoted_fields_mode' => 'quoted_fields_mode_enum',\n      'rules' => 'list<string>',\n      'schedule' => 'string',\n      'selected_override_fields' => 'list<string>',\n      'update_schedule' => 'string',\n    );\n    $enums = array(\n      'delimiter_enum' => ProductFeedDelimiterValues::getInstance()->getValues(),\n      'encoding_enum' => ProductFeedEncodingValues::getInstance()->getValues(),\n      'feed_type_enum' => ProductFeedFeedTypeValues::getInstance()->getValues(),\n      'ingestion_source_type_enum' => ProductFeedIngestionSourceTypeValues::getInstance()->getValues(),\n      'item_sub_type_enum' => ProductFeedItemSubTypeValues::getInstance()->getValues(),\n      'override_type_enum' => ProductFeedOverrideTypeValues::getInstance()->getValues(),\n      'quoted_fields_mode_enum' => ProductFeedQuotedFieldsModeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/product_feeds',\n      new ProductFeed(),\n      'EDGE',\n      ProductFeed::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getProductGroups(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/product_groups',\n      new ProductGroup(),\n      'EDGE',\n      ProductGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createProductGroup(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'retailer_id' => 'string',\n      'variants' => 'list<Object>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/product_groups',\n      new ProductGroup(),\n      'EDGE',\n      ProductGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getProductSets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'ancestor_id' => 'string',\n      'has_children' => 'bool',\n      'parent_id' => 'string',\n      'retailer_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/product_sets',\n      new ProductSet(),\n      'EDGE',\n      ProductSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createProductSet(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'filter' => 'Object',\n      'metadata' => 'map',\n      'name' => 'string',\n      'ordering_info' => 'list<unsigned int>',\n      'publish_to_shops' => 'list<map>',\n      'retailer_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/product_sets',\n      new ProductSet(),\n      'EDGE',\n      ProductSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getProductSetsBatch(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'handle' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/product_sets_batch',\n      new ProductCatalogProductSetsBatch(),\n      'EDGE',\n      ProductCatalogProductSetsBatch::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getProducts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'error_priority' => 'error_priority_enum',\n      'error_type' => 'error_type_enum',\n      'filter' => 'Object',\n      'return_only_approved_products' => 'bool',\n    );\n    $enums = array(\n      'error_priority_enum' => ProductItemErrorPriorityValues::getInstance()->getValues(),\n      'error_type_enum' => ProductItemErrorTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/products',\n      new ProductItem(),\n      'EDGE',\n      ProductItem::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createProduct(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'additional_image_urls' => 'list<string>',\n      'additional_uploaded_image_ids' => 'list<string>',\n      'additional_variant_attributes' => 'map',\n      'android_app_name' => 'string',\n      'android_class' => 'string',\n      'android_package' => 'string',\n      'android_url' => 'string',\n      'availability' => 'availability_enum',\n      'brand' => 'string',\n      'category' => 'string',\n      'category_specific_fields' => 'map',\n      'checkout_url' => 'string',\n      'color' => 'string',\n      'commerce_tax_category' => 'commerce_tax_category_enum',\n      'condition' => 'condition_enum',\n      'currency' => 'string',\n      'custom_data' => 'map',\n      'custom_label_0' => 'string',\n      'custom_label_1' => 'string',\n      'custom_label_2' => 'string',\n      'custom_label_3' => 'string',\n      'custom_label_4' => 'string',\n      'custom_number_0' => 'unsigned int',\n      'custom_number_1' => 'unsigned int',\n      'custom_number_2' => 'unsigned int',\n      'custom_number_3' => 'unsigned int',\n      'custom_number_4' => 'unsigned int',\n      'description' => 'string',\n      'expiration_date' => 'string',\n      'fb_product_category' => 'string',\n      'gender' => 'gender_enum',\n      'gtin' => 'string',\n      'image_url' => 'string',\n      'importer_address' => 'map',\n      'importer_name' => 'string',\n      'inventory' => 'unsigned int',\n      'ios_app_name' => 'string',\n      'ios_app_store_id' => 'unsigned int',\n      'ios_url' => 'string',\n      'ipad_app_name' => 'string',\n      'ipad_app_store_id' => 'unsigned int',\n      'ipad_url' => 'string',\n      'iphone_app_name' => 'string',\n      'iphone_app_store_id' => 'unsigned int',\n      'iphone_url' => 'string',\n      'launch_date' => 'string',\n      'manufacturer_info' => 'string',\n      'manufacturer_part_number' => 'string',\n      'marked_for_product_launch' => 'marked_for_product_launch_enum',\n      'material' => 'string',\n      'mobile_link' => 'string',\n      'name' => 'string',\n      'offer_price_amount' => 'unsigned int',\n      'offer_price_end_date' => 'datetime',\n      'offer_price_start_date' => 'datetime',\n      'ordering_index' => 'unsigned int',\n      'origin_country' => 'origin_country_enum',\n      'pattern' => 'string',\n      'price' => 'unsigned int',\n      'product_type' => 'string',\n      'quantity_to_sell_on_facebook' => 'unsigned int',\n      'retailer_id' => 'string',\n      'retailer_product_group_id' => 'string',\n      'return_policy_days' => 'unsigned int',\n      'sale_price' => 'unsigned int',\n      'sale_price_end_date' => 'datetime',\n      'sale_price_start_date' => 'datetime',\n      'short_description' => 'string',\n      'size' => 'string',\n      'start_date' => 'string',\n      'url' => 'string',\n      'visibility' => 'visibility_enum',\n      'wa_compliance_category' => 'wa_compliance_category_enum',\n      'windows_phone_app_id' => 'string',\n      'windows_phone_app_name' => 'string',\n      'windows_phone_url' => 'string',\n    );\n    $enums = array(\n      'availability_enum' => ProductItemAvailabilityValues::getInstance()->getValues(),\n      'commerce_tax_category_enum' => ProductItemCommerceTaxCategoryValues::getInstance()->getValues(),\n      'condition_enum' => ProductItemConditionValues::getInstance()->getValues(),\n      'gender_enum' => ProductItemGenderValues::getInstance()->getValues(),\n      'marked_for_product_launch_enum' => ProductItemMarkedForProductLaunchValues::getInstance()->getValues(),\n      'origin_country_enum' => ProductItemOriginCountryValues::getInstance()->getValues(),\n      'visibility_enum' => ProductItemVisibilityValues::getInstance()->getValues(),\n      'wa_compliance_category_enum' => ProductItemWaComplianceCategoryValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/products',\n      new ProductItem(),\n      'EDGE',\n      ProductItem::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVehicleOffers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/vehicle_offers',\n      new VehicleOffer(),\n      'EDGE',\n      VehicleOffer::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVehicles(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/vehicles',\n      new Vehicle(),\n      'EDGE',\n      Vehicle::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createVehicle(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'address' => 'map',\n      'applinks' => 'Object',\n      'availability' => 'availability_enum',\n      'body_style' => 'body_style_enum',\n      'condition' => 'condition_enum',\n      'currency' => 'string',\n      'date_first_on_lot' => 'string',\n      'dealer_id' => 'string',\n      'dealer_name' => 'string',\n      'dealer_phone' => 'string',\n      'description' => 'string',\n      'drivetrain' => 'drivetrain_enum',\n      'exterior_color' => 'string',\n      'fb_page_id' => 'string',\n      'fuel_type' => 'fuel_type_enum',\n      'images' => 'list<Object>',\n      'interior_color' => 'string',\n      'make' => 'string',\n      'mileage' => 'map',\n      'model' => 'string',\n      'price' => 'unsigned int',\n      'state_of_vehicle' => 'state_of_vehicle_enum',\n      'title' => 'string',\n      'transmission' => 'transmission_enum',\n      'trim' => 'string',\n      'url' => 'string',\n      'vehicle_id' => 'string',\n      'vehicle_type' => 'vehicle_type_enum',\n      'vin' => 'string',\n      'year' => 'unsigned int',\n    );\n    $enums = array(\n      'availability_enum' => VehicleAvailabilityValues::getInstance()->getValues(),\n      'body_style_enum' => VehicleBodyStyleValues::getInstance()->getValues(),\n      'condition_enum' => VehicleConditionValues::getInstance()->getValues(),\n      'drivetrain_enum' => VehicleDrivetrainValues::getInstance()->getValues(),\n      'fuel_type_enum' => VehicleFuelTypeValues::getInstance()->getValues(),\n      'state_of_vehicle_enum' => VehicleStateOfVehicleValues::getInstance()->getValues(),\n      'transmission_enum' => VehicleTransmissionValues::getInstance()->getValues(),\n      'vehicle_type_enum' => VehicleVehicleTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/vehicles',\n      new Vehicle(),\n      'EDGE',\n      Vehicle::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'allow_delete_catalog_with_live_product_set' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'segment_use_cases' => 'list<segment_use_cases_enum>',\n    );\n    $enums = array(\n      'segment_use_cases_enum' => array(\n        'AFFILIATE_SELLER_STOREFRONT',\n        'AFFILIATE_TAGGED_ONLY_DEPRECATED',\n        'COLLAB_ADS',\n        'COLLAB_ADS_FOR_MARKETPLACE_PARTNER',\n        'COLLAB_ADS_SEGMENT_WITHOUT_SEGMENT_SYNCING',\n        'CREATORS_AS_SELLERS',\n        'DIGITAL_CIRCULARS',\n        'FB_LIVE_SHOPPING',\n        'IG_SHOPPING',\n        'IG_SHOPPING_SUGGESTED_PRODUCTS',\n        'MARKETPLACE_SHOPS',\n        'TEST',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ProductCatalog(),\n      'NODE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'da_display_settings' => 'Object',\n      'default_image_url' => 'string',\n      'destination_catalog_settings' => 'map',\n      'fallback_image_url' => 'string',\n      'flight_catalog_settings' => 'map',\n      'name' => 'string',\n      'partner_integration' => 'map',\n      'store_catalog_settings' => 'map',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new ProductCatalog(),\n      'NODE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  /**\n   * @param int $user_id\n   * @param string $role\n   */\n  public function addUserPermission($user_id, $role) {\n    $params = array(\n      'user' => $user_id,\n      'role' => $role,\n    );\n    $this->getApi()->call(\n      '/'.$this->assureId().'/userpermissions',\n      RequestInterface::METHOD_POST,\n      $params);\n  }\n\n  /**\n   * @param int $user_id\n   */\n  public function deleteUserPermission($user_id) {\n    $params = array(\n      'user' => $user_id,\n    );\n    $this->getApi()->call(\n      '/'.$this->assureId().'/userpermissions',\n      RequestInterface::METHOD_DELETE,\n      $params);\n  }\n}\n", "num_lines": 1593}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductCatalogCategoryFields;\nuse FacebookAds\\Object\\Values\\ProductCatalogCategoryCategorizationCriteriaValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogCategory extends AbstractObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'categories';\n  }\n\n  /**\n   * @return ProductCatalogCategoryFields\n   */\n  public static function getFieldsEnum() {\n    return ProductCatalogCategoryFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['CategorizationCriteria'] = ProductCatalogCategoryCategorizationCriteriaValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 67}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductCatalogDataSourceFields;\nuse FacebookAds\\Object\\Values\\ProductCatalogDataSourceIngestionSourceTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogDataSource extends AbstractCrudObject {\n\n  /**\n   * @return ProductCatalogDataSourceFields\n   */\n  public static function getFieldsEnum() {\n    return ProductCatalogDataSourceFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['IngestionSourceType'] = ProductCatalogDataSourceIngestionSourceTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductCatalogDiagnosticGroupFields;\nuse FacebookAds\\Object\\Values\\ProductCatalogDiagnosticGroupAffectedChannelsValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogDiagnosticGroupAffectedEntitiesValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogDiagnosticGroupAffectedEntityValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogDiagnosticGroupAffectedFeaturesValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogDiagnosticGroupSeveritiesValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogDiagnosticGroupSeverityValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogDiagnosticGroupTypeValues;\nuse FacebookAds\\Object\\Values\\ProductCatalogDiagnosticGroupTypesValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogDiagnosticGroup extends AbstractObject {\n\n  /**\n   * @return ProductCatalogDiagnosticGroupFields\n   */\n  public static function getFieldsEnum() {\n    return ProductCatalogDiagnosticGroupFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['AffectedChannels'] = ProductCatalogDiagnosticGroupAffectedChannelsValues::getInstance()->getValues();\n    $ref_enums['AffectedEntity'] = ProductCatalogDiagnosticGroupAffectedEntityValues::getInstance()->getValues();\n    $ref_enums['AffectedFeatures'] = ProductCatalogDiagnosticGroupAffectedFeaturesValues::getInstance()->getValues();\n    $ref_enums['Severity'] = ProductCatalogDiagnosticGroupSeverityValues::getInstance()->getValues();\n    $ref_enums['Type'] = ProductCatalogDiagnosticGroupTypeValues::getInstance()->getValues();\n    $ref_enums['AffectedEntities'] = ProductCatalogDiagnosticGroupAffectedEntitiesValues::getInstance()->getValues();\n    $ref_enums['Severities'] = ProductCatalogDiagnosticGroupSeveritiesValues::getInstance()->getValues();\n    $ref_enums['Types'] = ProductCatalogDiagnosticGroupTypesValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 74}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductCatalogHotelRoomsBatchFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogHotelRoomsBatch extends AbstractObject {\n\n  /**\n   * @return ProductCatalogHotelRoomsBatchFields\n   */\n  public static function getFieldsEnum() {\n    return ProductCatalogHotelRoomsBatchFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductCatalogImageSettingsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogImageSettings extends AbstractObject {\n\n  /**\n   * @return ProductCatalogImageSettingsFields\n   */\n  public static function getFieldsEnum() {\n    return ProductCatalogImageSettingsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductCatalogImageSettingsOperationFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogImageSettingsOperation extends AbstractObject {\n\n  /**\n   * @return ProductCatalogImageSettingsOperationFields\n   */\n  public static function getFieldsEnum() {\n    return ProductCatalogImageSettingsOperationFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductCatalogPricingVariablesBatchFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogPricingVariablesBatch extends AbstractObject {\n\n  /**\n   * @return ProductCatalogPricingVariablesBatchFields\n   */\n  public static function getFieldsEnum() {\n    return ProductCatalogPricingVariablesBatchFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductCatalogProductSetsBatchFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogProductSetsBatch extends AbstractObject {\n\n  /**\n   * @return ProductCatalogProductSetsBatchFields\n   */\n  public static function getFieldsEnum() {\n    return ProductCatalogProductSetsBatchFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductEventStatFields;\nuse FacebookAds\\Object\\Values\\ProductEventStatBreakdownsValues;\nuse FacebookAds\\Object\\Values\\ProductEventStatDeviceTypeValues;\nuse FacebookAds\\Object\\Values\\ProductEventStatEventValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductEventStat extends AbstractObject {\n\n  /**\n   * @return ProductEventStatFields\n   */\n  public static function getFieldsEnum() {\n    return ProductEventStatFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['DeviceType'] = ProductEventStatDeviceTypeValues::getInstance()->getValues();\n    $ref_enums['Event'] = ProductEventStatEventValues::getInstance()->getValues();\n    $ref_enums['Breakdowns'] = ProductEventStatBreakdownsValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductFeedFields;\nuse FacebookAds\\Object\\Values\\ProductFeedDelimiterValues;\nuse FacebookAds\\Object\\Values\\ProductFeedEncodingValues;\nuse FacebookAds\\Object\\Values\\ProductFeedFeedTypeValues;\nuse FacebookAds\\Object\\Values\\ProductFeedIngestionSourceTypeValues;\nuse FacebookAds\\Object\\Values\\ProductFeedItemSubTypeValues;\nuse FacebookAds\\Object\\Values\\ProductFeedOverrideTypeValues;\nuse FacebookAds\\Object\\Values\\ProductFeedQuotedFieldsModeValues;\nuse FacebookAds\\Object\\Values\\ProductFeedRuleRuleTypeValues;\nuse FacebookAds\\Object\\Values\\ProductItemErrorPriorityValues;\nuse FacebookAds\\Object\\Values\\ProductItemErrorTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeed extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'product_feeds';\n  }\n\n  /**\n   * @return ProductFeedFields\n   */\n  public static function getFieldsEnum() {\n    return ProductFeedFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Delimiter'] = ProductFeedDelimiterValues::getInstance()->getValues();\n    $ref_enums['IngestionSourceType'] = ProductFeedIngestionSourceTypeValues::getInstance()->getValues();\n    $ref_enums['QuotedFieldsMode'] = ProductFeedQuotedFieldsModeValues::getInstance()->getValues();\n    $ref_enums['Encoding'] = ProductFeedEncodingValues::getInstance()->getValues();\n    $ref_enums['FeedType'] = ProductFeedFeedTypeValues::getInstance()->getValues();\n    $ref_enums['ItemSubType'] = ProductFeedItemSubTypeValues::getInstance()->getValues();\n    $ref_enums['OverrideType'] = ProductFeedOverrideTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAutomotiveModels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/automotive_models',\n      new AutomotiveModel(),\n      'EDGE',\n      AutomotiveModel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getDestinations(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/destinations',\n      new Destination(),\n      'EDGE',\n      Destination::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getFlights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/flights',\n      new Flight(),\n      'EDGE',\n      Flight::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getHomeListings(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/home_listings',\n      new HomeListing(),\n      'EDGE',\n      HomeListing::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getHotels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/hotels',\n      new Hotel(),\n      'EDGE',\n      Hotel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getMediaTitles(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/media_titles',\n      new MediaTitle(),\n      'EDGE',\n      MediaTitle::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getProducts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'error_priority' => 'error_priority_enum',\n      'error_type' => 'error_type_enum',\n      'filter' => 'Object',\n    );\n    $enums = array(\n      'error_priority_enum' => ProductItemErrorPriorityValues::getInstance()->getValues(),\n      'error_type_enum' => ProductItemErrorTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/products',\n      new ProductItem(),\n      'EDGE',\n      ProductItem::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getRules(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/rules',\n      new ProductFeedRule(),\n      'EDGE',\n      ProductFeedRule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createRule(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'attribute' => 'string',\n      'params' => 'map',\n      'rule_type' => 'rule_type_enum',\n    );\n    $enums = array(\n      'rule_type_enum' => ProductFeedRuleRuleTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/rules',\n      new ProductFeedRule(),\n      'EDGE',\n      ProductFeedRule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createSupplementaryFeedAssoc(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'assoc_data' => 'list<map>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/supplementary_feed_assocs',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getUploadSchedules(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/upload_schedules',\n      new ProductFeedSchedule(),\n      'EDGE',\n      ProductFeedSchedule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createUploadSchedule(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'upload_schedule' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/upload_schedules',\n      new ProductFeed(),\n      'EDGE',\n      ProductFeed::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getUploads(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/uploads',\n      new ProductFeedUpload(),\n      'EDGE',\n      ProductFeedUpload::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createUpload(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'fbe_external_business_id' => 'string',\n      'file' => 'file',\n      'password' => 'string',\n      'update_only' => 'bool',\n      'url' => 'string',\n      'username' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/uploads',\n      new ProductFeedUpload(),\n      'EDGE',\n      ProductFeedUpload::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVehicleOffers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/vehicle_offers',\n      new VehicleOffer(),\n      'EDGE',\n      VehicleOffer::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVehicles(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/vehicles',\n      new Vehicle(),\n      'EDGE',\n      Vehicle::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ProductFeed(),\n      'NODE',\n      ProductFeed::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'default_currency' => 'string',\n      'deletion_enabled' => 'bool',\n      'delimiter' => 'delimiter_enum',\n      'encoding' => 'encoding_enum',\n      'migrated_from_feed_id' => 'string',\n      'name' => 'string',\n      'quoted_fields_mode' => 'quoted_fields_mode_enum',\n      'schedule' => 'string',\n      'update_schedule' => 'string',\n    );\n    $enums = array(\n      'delimiter_enum' => ProductFeedDelimiterValues::getInstance()->getValues(),\n      'encoding_enum' => ProductFeedEncodingValues::getInstance()->getValues(),\n      'quoted_fields_mode_enum' => ProductFeedQuotedFieldsModeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new ProductFeed(),\n      'NODE',\n      ProductFeed::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 565}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductFeedMissingFeedItemReplacementFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedMissingFeedItemReplacement extends AbstractObject {\n\n  /**\n   * @return ProductFeedMissingFeedItemReplacementFields\n   */\n  public static function getFieldsEnum() {\n    return ProductFeedMissingFeedItemReplacementFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductFeedRuleFields;\nuse FacebookAds\\Object\\Values\\ProductFeedRuleRuleTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedRule extends AbstractCrudObject {\n\n  /**\n   * @return ProductFeedRuleFields\n   */\n  public static function getFieldsEnum() {\n    return ProductFeedRuleFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['RuleType'] = ProductFeedRuleRuleTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ProductFeedRule(),\n      'NODE',\n      ProductFeedRule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'params' => 'map',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new ProductFeedRule(),\n      'NODE',\n      ProductFeedRule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 130}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductFeedRuleSuggestionFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedRuleSuggestion extends AbstractObject {\n\n  /**\n   * @return ProductFeedRuleSuggestionFields\n   */\n  public static function getFieldsEnum() {\n    return ProductFeedRuleSuggestionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductFeedScheduleFields;\nuse FacebookAds\\Object\\Values\\ProductFeedScheduleIntervalValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedSchedule extends AbstractCrudObject {\n\n  /**\n   * @return ProductFeedScheduleFields\n   */\n  public static function getFieldsEnum() {\n    return ProductFeedScheduleFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Interval'] = ProductFeedScheduleIntervalValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ProductFeedSchedule(),\n      'NODE',\n      ProductFeedSchedule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 83}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductFeedUploadFields;\nuse FacebookAds\\Object\\Values\\ProductFeedUploadErrorErrorPriorityValues;\nuse FacebookAds\\Object\\Values\\ProductFeedUploadInputMethodValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedUpload extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'uploads';\n  }\n\n  /**\n   * @return ProductFeedUploadFields\n   */\n  public static function getFieldsEnum() {\n    return ProductFeedUploadFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['InputMethod'] = ProductFeedUploadInputMethodValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function createErrorReport(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/error_report',\n      new ProductFeedUpload(),\n      'EDGE',\n      ProductFeedUpload::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getErrors(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'error_priority' => 'error_priority_enum',\n    );\n    $enums = array(\n      'error_priority_enum' => ProductFeedUploadErrorErrorPriorityValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/errors',\n      new ProductFeedUploadError(),\n      'EDGE',\n      ProductFeedUploadError::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ProductFeedUpload(),\n      'NODE',\n      ProductFeedUpload::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 139}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductFeedUploadErrorFields;\nuse FacebookAds\\Object\\Values\\ProductFeedUploadErrorAffectedSurfacesValues;\nuse FacebookAds\\Object\\Values\\ProductFeedUploadErrorErrorPriorityValues;\nuse FacebookAds\\Object\\Values\\ProductFeedUploadErrorSeverityValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedUploadError extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'errors';\n  }\n\n  /**\n   * @return ProductFeedUploadErrorFields\n   */\n  public static function getFieldsEnum() {\n    return ProductFeedUploadErrorFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['AffectedSurfaces'] = ProductFeedUploadErrorAffectedSurfacesValues::getInstance()->getValues();\n    $ref_enums['Severity'] = ProductFeedUploadErrorSeverityValues::getInstance()->getValues();\n    $ref_enums['ErrorPriority'] = ProductFeedUploadErrorErrorPriorityValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSamples(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/samples',\n      new ProductFeedUploadErrorSample(),\n      'EDGE',\n      ProductFeedUploadErrorSample::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSuggestedRules(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/suggested_rules',\n      new ProductFeedRuleSuggestion(),\n      'EDGE',\n      ProductFeedRuleSuggestion::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ProductFeedUploadError(),\n      'NODE',\n      ProductFeedUploadError::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 140}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductFeedUploadErrorReportFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedUploadErrorReport extends AbstractObject {\n\n  /**\n   * @return ProductFeedUploadErrorReportFields\n   */\n  public static function getFieldsEnum() {\n    return ProductFeedUploadErrorReportFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductFeedUploadErrorSampleFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedUploadErrorSample extends AbstractCrudObject {\n\n  /**\n   * @return ProductFeedUploadErrorSampleFields\n   */\n  public static function getFieldsEnum() {\n    return ProductFeedUploadErrorSampleFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ProductFeedUploadErrorSample(),\n      'NODE',\n      ProductFeedUploadErrorSample::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductGroupFields;\nuse FacebookAds\\Object\\Values\\ProductItemAvailabilityValues;\nuse FacebookAds\\Object\\Values\\ProductItemCommerceTaxCategoryValues;\nuse FacebookAds\\Object\\Values\\ProductItemConditionValues;\nuse FacebookAds\\Object\\Values\\ProductItemGenderValues;\nuse FacebookAds\\Object\\Values\\ProductItemMarkedForProductLaunchValues;\nuse FacebookAds\\Object\\Values\\ProductItemVisibilityValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductGroup extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'product_groups';\n  }\n\n  /**\n   * @return ProductGroupFields\n   */\n  public static function getFieldsEnum() {\n    return ProductGroupFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getProducts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/products',\n      new ProductItem(),\n      'EDGE',\n      ProductItem::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createProduct(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'additional_image_urls' => 'list<string>',\n      'additional_variant_attributes' => 'map',\n      'android_app_name' => 'string',\n      'android_class' => 'string',\n      'android_package' => 'string',\n      'android_url' => 'string',\n      'availability' => 'availability_enum',\n      'brand' => 'string',\n      'category' => 'string',\n      'checkout_url' => 'string',\n      'color' => 'string',\n      'commerce_tax_category' => 'commerce_tax_category_enum',\n      'condition' => 'condition_enum',\n      'currency' => 'string',\n      'custom_data' => 'map',\n      'custom_label_0' => 'string',\n      'custom_label_1' => 'string',\n      'custom_label_2' => 'string',\n      'custom_label_3' => 'string',\n      'custom_label_4' => 'string',\n      'custom_number_0' => 'unsigned int',\n      'custom_number_1' => 'unsigned int',\n      'custom_number_2' => 'unsigned int',\n      'custom_number_3' => 'unsigned int',\n      'custom_number_4' => 'unsigned int',\n      'description' => 'string',\n      'expiration_date' => 'string',\n      'fb_product_category' => 'string',\n      'gender' => 'gender_enum',\n      'gtin' => 'string',\n      'image_url' => 'string',\n      'inventory' => 'unsigned int',\n      'ios_app_name' => 'string',\n      'ios_app_store_id' => 'unsigned int',\n      'ios_url' => 'string',\n      'ipad_app_name' => 'string',\n      'ipad_app_store_id' => 'unsigned int',\n      'ipad_url' => 'string',\n      'iphone_app_name' => 'string',\n      'iphone_app_store_id' => 'unsigned int',\n      'iphone_url' => 'string',\n      'launch_date' => 'string',\n      'manufacturer_part_number' => 'string',\n      'marked_for_product_launch' => 'marked_for_product_launch_enum',\n      'material' => 'string',\n      'mobile_link' => 'string',\n      'name' => 'string',\n      'offer_price_amount' => 'unsigned int',\n      'offer_price_end_date' => 'datetime',\n      'offer_price_start_date' => 'datetime',\n      'ordering_index' => 'unsigned int',\n      'pattern' => 'string',\n      'price' => 'unsigned int',\n      'product_type' => 'string',\n      'quantity_to_sell_on_facebook' => 'unsigned int',\n      'retailer_id' => 'string',\n      'return_policy_days' => 'unsigned int',\n      'sale_price' => 'unsigned int',\n      'sale_price_end_date' => 'datetime',\n      'sale_price_start_date' => 'datetime',\n      'short_description' => 'string',\n      'size' => 'string',\n      'start_date' => 'string',\n      'url' => 'string',\n      'visibility' => 'visibility_enum',\n      'windows_phone_app_id' => 'string',\n      'windows_phone_app_name' => 'string',\n      'windows_phone_url' => 'string',\n    );\n    $enums = array(\n      'availability_enum' => ProductItemAvailabilityValues::getInstance()->getValues(),\n      'commerce_tax_category_enum' => ProductItemCommerceTaxCategoryValues::getInstance()->getValues(),\n      'condition_enum' => ProductItemConditionValues::getInstance()->getValues(),\n      'gender_enum' => ProductItemGenderValues::getInstance()->getValues(),\n      'marked_for_product_launch_enum' => ProductItemMarkedForProductLaunchValues::getInstance()->getValues(),\n      'visibility_enum' => ProductItemVisibilityValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/products',\n      new ProductItem(),\n      'EDGE',\n      ProductItem::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'deletion_method' => 'deletion_method_enum',\n    );\n    $enums = array(\n      'deletion_method_enum' => array(\n        'DELETE_ITEMS',\n        'ONLY_IF_EMPTY',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ProductGroup(),\n      'NODE',\n      ProductGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'default_product_id' => 'string',\n      'variants' => 'list<Object>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new ProductGroup(),\n      'NODE',\n      ProductGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 267}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductImageFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductImage extends AbstractCrudObject {\n\n  /**\n   * @return ProductImageFields\n   */\n  public static function getFieldsEnum() {\n    return ProductImageFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ProductImage(),\n      'NODE',\n      ProductImage::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductItemFields;\nuse FacebookAds\\Object\\Values\\ProductItemAgeGroupValues;\nuse FacebookAds\\Object\\Values\\ProductItemAvailabilityValues;\nuse FacebookAds\\Object\\Values\\ProductItemCommerceTaxCategoryValues;\nuse FacebookAds\\Object\\Values\\ProductItemConditionValues;\nuse FacebookAds\\Object\\Values\\ProductItemErrorPriorityValues;\nuse FacebookAds\\Object\\Values\\ProductItemErrorTypeValues;\nuse FacebookAds\\Object\\Values\\ProductItemGenderValues;\nuse FacebookAds\\Object\\Values\\ProductItemImageFetchStatusValues;\nuse FacebookAds\\Object\\Values\\ProductItemMarkedForProductLaunchValues;\nuse FacebookAds\\Object\\Values\\ProductItemOriginCountryValues;\nuse FacebookAds\\Object\\Values\\ProductItemReviewStatusValues;\nuse FacebookAds\\Object\\Values\\ProductItemShippingWeightUnitValues;\nuse FacebookAds\\Object\\Values\\ProductItemVisibilityValues;\nuse FacebookAds\\Object\\Values\\ProductItemWaComplianceCategoryValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductItem extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'products';\n  }\n\n  /**\n   * @return ProductItemFields\n   */\n  public static function getFieldsEnum() {\n    return ProductItemFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['AgeGroup'] = ProductItemAgeGroupValues::getInstance()->getValues();\n    $ref_enums['Availability'] = ProductItemAvailabilityValues::getInstance()->getValues();\n    $ref_enums['Condition'] = ProductItemConditionValues::getInstance()->getValues();\n    $ref_enums['Gender'] = ProductItemGenderValues::getInstance()->getValues();\n    $ref_enums['ImageFetchStatus'] = ProductItemImageFetchStatusValues::getInstance()->getValues();\n    $ref_enums['ReviewStatus'] = ProductItemReviewStatusValues::getInstance()->getValues();\n    $ref_enums['ShippingWeightUnit'] = ProductItemShippingWeightUnitValues::getInstance()->getValues();\n    $ref_enums['Visibility'] = ProductItemVisibilityValues::getInstance()->getValues();\n    $ref_enums['CommerceTaxCategory'] = ProductItemCommerceTaxCategoryValues::getInstance()->getValues();\n    $ref_enums['ErrorPriority'] = ProductItemErrorPriorityValues::getInstance()->getValues();\n    $ref_enums['ErrorType'] = ProductItemErrorTypeValues::getInstance()->getValues();\n    $ref_enums['MarkedForProductLaunch'] = ProductItemMarkedForProductLaunchValues::getInstance()->getValues();\n    $ref_enums['OriginCountry'] = ProductItemOriginCountryValues::getInstance()->getValues();\n    $ref_enums['WaComplianceCategory'] = ProductItemWaComplianceCategoryValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getChannelsToIntegrityStatus(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/channels_to_integrity_status',\n      new CatalogItemChannelsToIntegrityStatus(),\n      'EDGE',\n      CatalogItemChannelsToIntegrityStatus::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getProductSets(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/product_sets',\n      new ProductSet(),\n      'EDGE',\n      ProductSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideosMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/videos_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'catalog_id' => 'string',\n      'image_height' => 'unsigned int',\n      'image_width' => 'unsigned int',\n      'override_country' => 'string',\n      'override_language' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ProductItem(),\n      'NODE',\n      ProductItem::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'additional_image_urls' => 'list<string>',\n      'additional_uploaded_image_ids' => 'list<string>',\n      'additional_variant_attributes' => 'map',\n      'android_app_name' => 'string',\n      'android_class' => 'string',\n      'android_package' => 'string',\n      'android_url' => 'string',\n      'availability' => 'availability_enum',\n      'brand' => 'string',\n      'category' => 'string',\n      'category_specific_fields' => 'map',\n      'checkout_url' => 'string',\n      'color' => 'string',\n      'commerce_tax_category' => 'commerce_tax_category_enum',\n      'condition' => 'condition_enum',\n      'currency' => 'string',\n      'custom_data' => 'map',\n      'custom_label_0' => 'string',\n      'custom_label_1' => 'string',\n      'custom_label_2' => 'string',\n      'custom_label_3' => 'string',\n      'custom_label_4' => 'string',\n      'custom_number_0' => 'unsigned int',\n      'custom_number_1' => 'unsigned int',\n      'custom_number_2' => 'unsigned int',\n      'custom_number_3' => 'unsigned int',\n      'custom_number_4' => 'unsigned int',\n      'description' => 'string',\n      'expiration_date' => 'string',\n      'fb_product_category' => 'string',\n      'gender' => 'gender_enum',\n      'gtin' => 'string',\n      'image_url' => 'string',\n      'importer_address' => 'map',\n      'importer_name' => 'string',\n      'inventory' => 'unsigned int',\n      'ios_app_name' => 'string',\n      'ios_app_store_id' => 'unsigned int',\n      'ios_url' => 'string',\n      'ipad_app_name' => 'string',\n      'ipad_app_store_id' => 'unsigned int',\n      'ipad_url' => 'string',\n      'iphone_app_name' => 'string',\n      'iphone_app_store_id' => 'unsigned int',\n      'iphone_url' => 'string',\n      'launch_date' => 'string',\n      'manufacturer_info' => 'string',\n      'manufacturer_part_number' => 'string',\n      'marked_for_product_launch' => 'marked_for_product_launch_enum',\n      'material' => 'string',\n      'mobile_link' => 'string',\n      'name' => 'string',\n      'offer_price_amount' => 'unsigned int',\n      'offer_price_end_date' => 'datetime',\n      'offer_price_start_date' => 'datetime',\n      'ordering_index' => 'unsigned int',\n      'origin_country' => 'origin_country_enum',\n      'pattern' => 'string',\n      'price' => 'unsigned int',\n      'product_type' => 'string',\n      'quantity_to_sell_on_facebook' => 'unsigned int',\n      'retailer_id' => 'string',\n      'return_policy_days' => 'unsigned int',\n      'sale_price' => 'unsigned int',\n      'sale_price_end_date' => 'datetime',\n      'sale_price_start_date' => 'datetime',\n      'short_description' => 'string',\n      'size' => 'string',\n      'start_date' => 'string',\n      'url' => 'string',\n      'visibility' => 'visibility_enum',\n      'wa_compliance_category' => 'wa_compliance_category_enum',\n      'windows_phone_app_id' => 'string',\n      'windows_phone_app_name' => 'string',\n      'windows_phone_url' => 'string',\n    );\n    $enums = array(\n      'availability_enum' => ProductItemAvailabilityValues::getInstance()->getValues(),\n      'commerce_tax_category_enum' => ProductItemCommerceTaxCategoryValues::getInstance()->getValues(),\n      'condition_enum' => ProductItemConditionValues::getInstance()->getValues(),\n      'gender_enum' => ProductItemGenderValues::getInstance()->getValues(),\n      'marked_for_product_launch_enum' => ProductItemMarkedForProductLaunchValues::getInstance()->getValues(),\n      'origin_country_enum' => ProductItemOriginCountryValues::getInstance()->getValues(),\n      'visibility_enum' => ProductItemVisibilityValues::getInstance()->getValues(),\n      'wa_compliance_category_enum' => ProductItemWaComplianceCategoryValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new ProductItem(),\n      'NODE',\n      ProductItem::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 319}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductItemARDataFields;\nuse FacebookAds\\Object\\Values\\ProductItemARDataSurfacesValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductItemARData extends AbstractObject {\n\n  /**\n   * @return ProductItemARDataFields\n   */\n  public static function getFieldsEnum() {\n    return ProductItemARDataFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Surfaces'] = ProductItemARDataSurfacesValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductItemCommerceInsightsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductItemCommerceInsights extends AbstractObject {\n\n  /**\n   * @return ProductItemCommerceInsightsFields\n   */\n  public static function getFieldsEnum() {\n    return ProductItemCommerceInsightsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductItemErrorFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductItemError extends AbstractObject {\n\n  /**\n   * @return ProductItemErrorFields\n   */\n  public static function getFieldsEnum() {\n    return ProductItemErrorFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductItemImporterAddressFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductItemImporterAddress extends AbstractObject {\n\n  /**\n   * @return ProductItemImporterAddressFields\n   */\n  public static function getFieldsEnum() {\n    return ProductItemImporterAddressFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductSetFields;\nuse FacebookAds\\Object\\Values\\ProductItemErrorPriorityValues;\nuse FacebookAds\\Object\\Values\\ProductItemErrorTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductSet extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'product_sets';\n  }\n\n  /**\n   * @return ProductSetFields\n   */\n  public static function getFieldsEnum() {\n    return ProductSetFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getAutomotiveModels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/automotive_models',\n      new AutomotiveModel(),\n      'EDGE',\n      AutomotiveModel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getDestinations(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/destinations',\n      new Destination(),\n      'EDGE',\n      Destination::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getFlights(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/flights',\n      new Flight(),\n      'EDGE',\n      Flight::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getHomeListings(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/home_listings',\n      new HomeListing(),\n      'EDGE',\n      HomeListing::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getHotels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/hotels',\n      new Hotel(),\n      'EDGE',\n      Hotel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getMediaTitles(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/media_titles',\n      new MediaTitle(),\n      'EDGE',\n      MediaTitle::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getProducts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'error_priority' => 'error_priority_enum',\n      'error_type' => 'error_type_enum',\n      'filter' => 'Object',\n    );\n    $enums = array(\n      'error_priority_enum' => ProductItemErrorPriorityValues::getInstance()->getValues(),\n      'error_type_enum' => ProductItemErrorTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/products',\n      new ProductItem(),\n      'EDGE',\n      ProductItem::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVehicleOffers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/vehicle_offers',\n      new VehicleOffer(),\n      'EDGE',\n      VehicleOffer::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVehicles(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bulk_pagination' => 'bool',\n      'filter' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/vehicles',\n      new Vehicle(),\n      'EDGE',\n      Vehicle::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'allow_live_product_set_deletion' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ProductSet(),\n      'NODE',\n      ProductSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'filter' => 'Object',\n      'metadata' => 'map',\n      'name' => 'string',\n      'ordering_info' => 'list<unsigned int>',\n      'publish_to_shops' => 'list<map>',\n      'retailer_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new ProductSet(),\n      'NODE',\n      ProductSet::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 372}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductSetMetadataFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductSetMetadata extends AbstractObject {\n\n  /**\n   * @return ProductSetMetadataFields\n   */\n  public static function getFieldsEnum() {\n    return ProductSetMetadataFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProductVariantFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductVariant extends AbstractObject {\n\n  /**\n   * @return ProductVariantFields\n   */\n  public static function getFieldsEnum() {\n    return ProductVariantFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProfileFields;\nuse FacebookAds\\Object\\Values\\ProfilePictureSourceBreakingChangeValues;\nuse FacebookAds\\Object\\Values\\ProfilePictureSourceTypeValues;\nuse FacebookAds\\Object\\Values\\ProfileProfileTypeValues;\nuse FacebookAds\\Object\\Values\\ProfileTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Profile extends AbstractCrudObject {\n\n  /**\n   * @return ProfileFields\n   */\n  public static function getFieldsEnum() {\n    return ProfileFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ProfileType'] = ProfileProfileTypeValues::getInstance()->getValues();\n    $ref_enums['Type'] = ProfileTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getPicture(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'breaking_change' => 'breaking_change_enum',\n      'height' => 'int',\n      'redirect' => 'bool',\n      'type' => 'type_enum',\n      'width' => 'int',\n    );\n    $enums = array(\n      'breaking_change_enum' => ProfilePictureSourceBreakingChangeValues::getInstance()->getValues(),\n      'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/picture',\n      new ProfilePictureSource(),\n      'EDGE',\n      ProfilePictureSource::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Profile(),\n      'NODE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 117}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ProfilePictureSourceFields;\nuse FacebookAds\\Object\\Values\\ProfilePictureSourceBreakingChangeValues;\nuse FacebookAds\\Object\\Values\\ProfilePictureSourceTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProfilePictureSource extends AbstractObject {\n\n  /**\n   * @return ProfilePictureSourceFields\n   */\n  public static function getFieldsEnum() {\n    return ProfilePictureSourceFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Type'] = ProfilePictureSourceTypeValues::getInstance()->getValues();\n    $ref_enums['BreakingChange'] = ProfilePictureSourceBreakingChangeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\PublisherBlockListFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PublisherBlockList extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'publisher_block_lists';\n  }\n\n  /**\n   * @return PublisherBlockListFields\n   */\n  public static function getFieldsEnum() {\n    return PublisherBlockListFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function createAppEndPublisherUrl(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'publisher_urls' => 'list<string>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/append_publisher_urls',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPagedWebPublishers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'draft_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/paged_web_publishers',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'account_id' => 'unsigned int',\n      'business_id' => 'string',\n      'draft_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new PublisherBlockList(),\n      'NODE',\n      PublisherBlockList::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'spec' => 'Object',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new PublisherBlockList(),\n      'NODE',\n      PublisherBlockList::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 186}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\RawCustomAudienceFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass RawCustomAudience extends AbstractCrudObject {\n\n  /**\n   * @return RawCustomAudienceFields\n   */\n  public static function getFieldsEnum() {\n    return RawCustomAudienceFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ReachFrequencyActivityFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencyActivity extends AbstractObject {\n\n  /**\n   * @return ReachFrequencyActivityFields\n   */\n  public static function getFieldsEnum() {\n    return ReachFrequencyActivityFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ReachFrequencyAdFormatFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencyAdFormat extends AbstractObject {\n\n  /**\n   * @return ReachFrequencyAdFormatFields\n   */\n  public static function getFieldsEnum() {\n    return ReachFrequencyAdFormatFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ReachFrequencyCurveLowerConfidenceRangeFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencyCurveLowerConfidenceRange extends AbstractObject {\n\n  /**\n   * @return ReachFrequencyCurveLowerConfidenceRangeFields\n   */\n  public static function getFieldsEnum() {\n    return ReachFrequencyCurveLowerConfidenceRangeFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ReachFrequencyCurveUpperConfidenceRangeFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencyCurveUpperConfidenceRange extends AbstractObject {\n\n  /**\n   * @return ReachFrequencyCurveUpperConfidenceRangeFields\n   */\n  public static function getFieldsEnum() {\n    return ReachFrequencyCurveUpperConfidenceRangeFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ReachFrequencyDayPartFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencyDayPart extends AbstractObject {\n\n  /**\n   * @return ReachFrequencyDayPartFields\n   */\n  public static function getFieldsEnum() {\n    return ReachFrequencyDayPartFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ReachFrequencyEstimatesCurveFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencyEstimatesCurve extends AbstractObject {\n\n  /**\n   * @return ReachFrequencyEstimatesCurveFields\n   */\n  public static function getFieldsEnum() {\n    return ReachFrequencyEstimatesCurveFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ReachFrequencyEstimatesPlacementBreakdownFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencyEstimatesPlacementBreakdown extends AbstractObject {\n\n  /**\n   * @return ReachFrequencyEstimatesPlacementBreakdownFields\n   */\n  public static function getFieldsEnum() {\n    return ReachFrequencyEstimatesPlacementBreakdownFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ReachFrequencyPredictionFields;\nuse FacebookAds\\Object\\Values\\ReachFrequencyPredictionActionValues;\nuse FacebookAds\\Object\\Values\\ReachFrequencyPredictionBuyingTypeValues;\nuse FacebookAds\\Object\\Values\\ReachFrequencyPredictionInstreamPackagesValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencyPrediction extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'reachfrequencypredictions';\n  }\n\n  /**\n   * @return ReachFrequencyPredictionFields\n   */\n  public static function getFieldsEnum() {\n    return ReachFrequencyPredictionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Action'] = ReachFrequencyPredictionActionValues::getInstance()->getValues();\n    $ref_enums['BuyingType'] = ReachFrequencyPredictionBuyingTypeValues::getInstance()->getValues();\n    $ref_enums['InstreamPackages'] = ReachFrequencyPredictionInstreamPackagesValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ReachFrequencyPrediction(),\n      'NODE',\n      ReachFrequencyPrediction::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 94}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ReachFrequencySpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencySpec extends AbstractObject {\n\n  /**\n   * @return ReachFrequencySpecFields\n   */\n  public static function getFieldsEnum() {\n    return ReachFrequencySpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\RecommendationFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Recommendation extends AbstractObject {\n\n  /**\n   * @return RecommendationFields\n   */\n  public static function getFieldsEnum() {\n    return RecommendationFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\RevSharePolicyFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass RevSharePolicy extends AbstractObject {\n\n  /**\n   * @return RevSharePolicyFields\n   */\n  public static function getFieldsEnum() {\n    return RevSharePolicyFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\RichMediaElementFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass RichMediaElement extends AbstractObject {\n\n  /**\n   * @return RichMediaElementFields\n   */\n  public static function getFieldsEnum() {\n    return RichMediaElementFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\RTBDynamicPostFields;\nuse FacebookAds\\Object\\Values\\CommentFilterValues;\nuse FacebookAds\\Object\\Values\\CommentLiveFilterValues;\nuse FacebookAds\\Object\\Values\\CommentOrderValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass RTBDynamicPost extends AbstractCrudObject {\n\n  /**\n   * @return RTBDynamicPostFields\n   */\n  public static function getFieldsEnum() {\n    return RTBDynamicPostFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getComments(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'filter' => 'filter_enum',\n      'live_filter' => 'live_filter_enum',\n      'order' => 'order_enum',\n      'since' => 'datetime',\n    );\n    $enums = array(\n      'filter_enum' => CommentFilterValues::getInstance()->getValues(),\n      'live_filter_enum' => CommentLiveFilterValues::getInstance()->getValues(),\n      'order_enum' => CommentOrderValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/comments',\n      new Comment(),\n      'EDGE',\n      Comment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLikes(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/likes',\n      new Profile(),\n      'EDGE',\n      Profile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new RTBDynamicPost(),\n      'NODE',\n      RTBDynamicPost::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 137}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\SavedAudienceFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass SavedAudience extends AbstractCrudObject {\n\n  /**\n   * @return SavedAudienceFields\n   */\n  public static function getFieldsEnum() {\n    return SavedAudienceFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new SavedAudience(),\n      'NODE',\n      SavedAudience::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\SavedMessageResponseFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass SavedMessageResponse extends AbstractCrudObject {\n\n  /**\n   * @return SavedMessageResponseFields\n   */\n  public static function getFieldsEnum() {\n    return SavedMessageResponseFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new SavedMessageResponse(),\n      'NODE',\n      SavedMessageResponse::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\SecuritySettingsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass SecuritySettings extends AbstractObject {\n\n  /**\n   * @return SecuritySettingsFields\n   */\n  public static function getFieldsEnum() {\n    return SecuritySettingsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ShadowIGMediaProductTagsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ShadowIGMediaProductTags extends AbstractObject {\n\n  /**\n   * @return ShadowIGMediaProductTagsFields\n   */\n  public static function getFieldsEnum() {\n    return ShadowIGMediaProductTagsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ShopFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Shop extends AbstractCrudObject {\n\n  /**\n   * @return ShopFields\n   */\n  public static function getFieldsEnum() {\n    return ShopFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Shop(),\n      'NODE',\n      Shop::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ShopOrderFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ShopOrder extends AbstractCrudObject {\n\n  /**\n   * @return ShopOrderFields\n   */\n  public static function getFieldsEnum() {\n    return ShopOrderFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new ShopOrder(),\n      'NODE',\n      ShopOrder::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\SplitTestWinnerFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass SplitTestWinner extends AbstractObject {\n\n  /**\n   * @return SplitTestWinnerFields\n   */\n  public static function getFieldsEnum() {\n    return SplitTestWinnerFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\StoreCatalogSettingsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass StoreCatalogSettings extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'catalog_store';\n  }\n\n  /**\n   * @return StoreCatalogSettingsFields\n   */\n  public static function getFieldsEnum() {\n    return StoreCatalogSettingsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new StoreCatalogSettings(),\n      'NODE',\n      StoreCatalogSettings::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 111}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Object\\Fields\\SystemUserFields;\n\nclass SystemUser extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   * @return string\n   */\n  protected function getEndpoint() {\n    return 'system_users';\n  }\n\n  /**\n   * @return SystemUserFields\n   */\n  public static function getFieldsEnum() {\n    return SystemUserFields::getInstance();\n  }\n\n  public function invalidateAccessTokens() {\n    $this->getApi()->call(\n      '/'.$this->assureId().'/access_tokens',\n      RequestInterface::METHOD_DELETE);\n  }\n}\n", "num_lines": 53}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TabFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Tab extends AbstractCrudObject {\n\n  /**\n   * @return TabFields\n   */\n  public static function getFieldsEnum() {\n    return TabFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingFields;\nuse FacebookAds\\Object\\Values\\TargetingDevicePlatformsValues;\nuse FacebookAds\\Object\\Values\\TargetingEffectiveDevicePlatformsValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Targeting extends AbstractObject {\n\n  /**\n   * @return TargetingFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['DevicePlatforms'] = TargetingDevicePlatformsValues::getInstance()->getValues();\n    $ref_enums['EffectiveDevicePlatforms'] = TargetingEffectiveDevicePlatformsValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingDynamicRuleFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingDynamicRule extends AbstractObject {\n\n  /**\n   * @return TargetingDynamicRuleFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingDynamicRuleFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingGeoLocationFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocation extends AbstractObject {\n\n  /**\n   * @return TargetingGeoLocationFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingGeoLocationFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingGeoLocationCityFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationCity extends AbstractObject {\n\n  /**\n   * @return TargetingGeoLocationCityFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingGeoLocationCityFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingGeoLocationCustomLocationFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationCustomLocation extends AbstractObject {\n\n  /**\n   * @return TargetingGeoLocationCustomLocationFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingGeoLocationCustomLocationFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingGeoLocationElectoralDistrictFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationElectoralDistrict extends AbstractObject {\n\n  /**\n   * @return TargetingGeoLocationElectoralDistrictFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingGeoLocationElectoralDistrictFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingGeoLocationGeoEntitiesFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationGeoEntities extends AbstractObject {\n\n  /**\n   * @return TargetingGeoLocationGeoEntitiesFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingGeoLocationGeoEntitiesFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingGeoLocationLocationClusterFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationLocationCluster extends AbstractObject {\n\n  /**\n   * @return TargetingGeoLocationLocationClusterFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingGeoLocationLocationClusterFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingGeoLocationLocationExpansionFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationLocationExpansion extends AbstractObject {\n\n  /**\n   * @return TargetingGeoLocationLocationExpansionFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingGeoLocationLocationExpansionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingGeoLocationMarketFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationMarket extends AbstractObject {\n\n  /**\n   * @return TargetingGeoLocationMarketFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingGeoLocationMarketFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingGeoLocationPlaceFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationPlace extends AbstractObject {\n\n  /**\n   * @return TargetingGeoLocationPlaceFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingGeoLocationPlaceFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingGeoLocationPoliticalDistrictFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationPoliticalDistrict extends AbstractObject {\n\n  /**\n   * @return TargetingGeoLocationPoliticalDistrictFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingGeoLocationPoliticalDistrictFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingGeoLocationRegionFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationRegion extends AbstractObject {\n\n  /**\n   * @return TargetingGeoLocationRegionFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingGeoLocationRegionFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingGeoLocationZipFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationZip extends AbstractObject {\n\n  /**\n   * @return TargetingGeoLocationZipFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingGeoLocationZipFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingProductAudienceSpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingProductAudienceSpec extends AbstractObject {\n\n  /**\n   * @return TargetingProductAudienceSpecFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingProductAudienceSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingProductAudienceSubSpecFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingProductAudienceSubSpec extends AbstractObject {\n\n  /**\n   * @return TargetingProductAudienceSubSpecFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingProductAudienceSubSpecFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingProspectingAudienceFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingProspectingAudience extends AbstractObject {\n\n  /**\n   * @return TargetingProspectingAudienceFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingProspectingAudienceFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingRelaxationFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingRelaxation extends AbstractObject {\n\n  /**\n   * @return TargetingRelaxationFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingRelaxationFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\n\nclass TargetingSearch extends AbstractObject {\n\n  /**\n   * @param string $query\n   * @param string $type\n   * @param string $class\n   * @param array $params\n   * @param Api $api\n   * @return Cursor\n   * @throws \\InvalidArgumentException\n   */\n  public static function search(\n    $type,\n    $class=null,\n    $query=null,\n    array $params = array(),\n    Api $api = null) {\n\n    $api = $api ?: Api::instance();\n    if (!$api) {\n      throw new \\InvalidArgumentException(\n        'An Api instance must be provided as argument or '.\n        'set as instance in the \\FacebookAds\\Api');\n    }\n\n    $params['type'] = $type;\n    $params = array_merge($params, array_filter(array(\n      'class' => $class,\n      'q' => $query,\n    )));\n\n    $response = $api->call('/search', RequestInterface::METHOD_GET, $params);\n    return new Cursor($response, new TargetingSearch());\n  }\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TargetingSentenceLineFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingSentenceLine extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'targetingsentencelines';\n  }\n\n  /**\n   * @return TargetingSentenceLineFields\n   */\n  public static function getFieldsEnum() {\n    return TargetingSentenceLineFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 65}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TextWithEntitiesFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TextWithEntities extends AbstractObject {\n\n  /**\n   * @return TextWithEntitiesFields\n   */\n  public static function getFieldsEnum() {\n    return TextWithEntitiesFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\TrackingAndConversionWithDefaultsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TrackingAndConversionWithDefaults extends AbstractObject {\n\n  /**\n   * @return TrackingAndConversionWithDefaultsFields\n   */\n  public static function getFieldsEnum() {\n    return TrackingAndConversionWithDefaultsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\UnifiedThreadFields;\nuse FacebookAds\\Object\\Values\\UnifiedThreadPlatformValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UnifiedThread extends AbstractCrudObject {\n\n  /**\n   * @return UnifiedThreadFields\n   */\n  public static function getFieldsEnum() {\n    return UnifiedThreadFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Platform'] = UnifiedThreadPlatformValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getMessages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'source' => 'source_enum',\n    );\n    $enums = array(\n      'source_enum' => array(\n        'ALL',\n        'PARTICIPANTS',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/messages',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new UnifiedThread(),\n      'NODE',\n      UnifiedThread::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 111}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\URLFields;\nuse FacebookAds\\Object\\Values\\URLScopesValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass URL extends AbstractCrudObject {\n\n  /**\n   * @return URLFields\n   */\n  public static function getFieldsEnum() {\n    return URLFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Scopes'] = URLScopesValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new URL(),\n      'NODE',\n      URL::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'blacklist' => 'bool',\n      'denylist' => 'bool',\n      'hmac' => 'string',\n      'locale' => 'list<Object>',\n      'scopes' => 'list<scopes_enum>',\n      'ts' => 'datetime',\n    );\n    $enums = array(\n      'scopes_enum' => URLScopesValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new URL(),\n      'NODE',\n      URL::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 113}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\UserFields;\nuse FacebookAds\\Object\\Values\\AdStudyTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoContainerTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoContentCategoryValues;\nuse FacebookAds\\Object\\Values\\AdVideoFormattingValues;\nuse FacebookAds\\Object\\Values\\AdVideoOriginalProjectionTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoSwapModeValues;\nuse FacebookAds\\Object\\Values\\AdVideoTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoUnpublishedContentTypeValues;\nuse FacebookAds\\Object\\Values\\AdVideoUploadPhaseValues;\nuse FacebookAds\\Object\\Values\\BusinessSurveyBusinessTypeValues;\nuse FacebookAds\\Object\\Values\\BusinessVerticalValues;\nuse FacebookAds\\Object\\Values\\EventTypeValues;\nuse FacebookAds\\Object\\Values\\FundraiserPersonToCharityFundraiserTypeValues;\nuse FacebookAds\\Object\\Values\\GameItemActionValues;\nuse FacebookAds\\Object\\Values\\LiveVideoBroadcastStatusValues;\nuse FacebookAds\\Object\\Values\\LiveVideoProjectionValues;\nuse FacebookAds\\Object\\Values\\LiveVideoSourceValues;\nuse FacebookAds\\Object\\Values\\LiveVideoSpatialAudioFormatValues;\nuse FacebookAds\\Object\\Values\\LiveVideoStatusValues;\nuse FacebookAds\\Object\\Values\\LiveVideoStereoscopicModeValues;\nuse FacebookAds\\Object\\Values\\LiveVideoStreamTypeValues;\nuse FacebookAds\\Object\\Values\\PermissionStatusValues;\nuse FacebookAds\\Object\\Values\\PhotoBackdatedTimeGranularityValues;\nuse FacebookAds\\Object\\Values\\PhotoTypeValues;\nuse FacebookAds\\Object\\Values\\PhotoUnpublishedContentTypeValues;\nuse FacebookAds\\Object\\Values\\PostBackdatedTimeGranularityValues;\nuse FacebookAds\\Object\\Values\\PostCheckinEntryPointValues;\nuse FacebookAds\\Object\\Values\\PostFormattingValues;\nuse FacebookAds\\Object\\Values\\PostPlaceAttachmentSettingValues;\nuse FacebookAds\\Object\\Values\\PostPostSurfacesBlacklistValues;\nuse FacebookAds\\Object\\Values\\PostPostingToRedspaceValues;\nuse FacebookAds\\Object\\Values\\PostTargetSurfaceValues;\nuse FacebookAds\\Object\\Values\\PostUnpublishedContentTypeValues;\nuse FacebookAds\\Object\\Values\\ProfilePictureSourceBreakingChangeValues;\nuse FacebookAds\\Object\\Values\\ProfilePictureSourceTypeValues;\nuse FacebookAds\\Object\\Values\\UserFilteringValues;\nuse FacebookAds\\Object\\Values\\UserLocalNewsMegaphoneDismissStatusValues;\nuse FacebookAds\\Object\\Values\\UserLocalNewsSubscriptionStatusValues;\nuse FacebookAds\\Object\\Values\\UserTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass User extends AbstractCrudObject {\n\n  /**\n   * @return UserFields\n   */\n  public static function getFieldsEnum() {\n    return UserFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['LocalNewsMegaphoneDismissStatus'] = UserLocalNewsMegaphoneDismissStatusValues::getInstance()->getValues();\n    $ref_enums['LocalNewsSubscriptionStatus'] = UserLocalNewsSubscriptionStatusValues::getInstance()->getValues();\n    $ref_enums['Filtering'] = UserFilteringValues::getInstance()->getValues();\n    $ref_enums['Type'] = UserTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function deleteAccessTokens(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/access_tokens',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAccessToken(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business_app' => 'int',\n      'page_id' => 'string',\n      'scope' => 'list<Permission>',\n      'set_token_expires_in_60_days' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/access_tokens',\n      new User(),\n      'EDGE',\n      User::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'is_place' => 'bool',\n      'is_promotable' => 'bool',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/accounts',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAccount(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'about' => 'string',\n      'address' => 'string',\n      'category' => 'int',\n      'category_enum' => 'string',\n      'category_list' => 'list<string>',\n      'city_id' => 'string',\n      'coordinates' => 'Object',\n      'cover_photo' => 'Object',\n      'description' => 'string',\n      'ignore_coordinate_warnings' => 'bool',\n      'location' => 'Object',\n      'name' => 'string',\n      'phone' => 'string',\n      'picture' => 'string',\n      'website' => 'string',\n      'zip' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/accounts',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdStudies(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ad_studies',\n      new AdStudy(),\n      'EDGE',\n      AdStudy::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAdStudy(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'cells' => 'list<Object>',\n      'client_business' => 'string',\n      'confidence_level' => 'float',\n      'cooldown_start_time' => 'int',\n      'description' => 'string',\n      'end_time' => 'int',\n      'name' => 'string',\n      'objectives' => 'list<Object>',\n      'observation_end_time' => 'int',\n      'start_time' => 'int',\n      'type' => 'type_enum',\n      'viewers' => 'list<int>',\n    );\n    $enums = array(\n      'type_enum' => AdStudyTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/ad_studies',\n      new AdStudy(),\n      'EDGE',\n      AdStudy::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/adaccounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAlbums(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/albums',\n      new Album(),\n      'EDGE',\n      Album::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createApplication(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business_app' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/applications',\n      new User(),\n      'EDGE',\n      User::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAppRequestFormerRecipients(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/apprequestformerrecipients',\n      new AppRequestFormerRecipient(),\n      'EDGE',\n      AppRequestFormerRecipient::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAppRequests(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/apprequests',\n      new AppRequest(),\n      'EDGE',\n      AppRequest::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAssignedAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/assigned_ad_accounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAssignedBusinessAssetGroups(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'contained_asset_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/assigned_business_asset_groups',\n      new BusinessAssetGroup(),\n      'EDGE',\n      BusinessAssetGroup::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAssignedPages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'pages' => 'list<unsigned int>',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/assigned_pages',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAssignedProductCatalogs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/assigned_product_catalogs',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAvatars(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/avatars',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getBusinessUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/business_users',\n      new BusinessUser(),\n      'EDGE',\n      BusinessUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteBusinesses(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/businesses',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getBusinesses(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/businesses',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createBusiness(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'child_business_external_id' => 'string',\n      'email' => 'string',\n      'name' => 'string',\n      'primary_page' => 'string',\n      'sales_rep_email' => 'string',\n      'survey_business_type' => 'survey_business_type_enum',\n      'survey_num_assets' => 'unsigned int',\n      'survey_num_people' => 'unsigned int',\n      'timezone_id' => 'unsigned int',\n      'vertical' => 'vertical_enum',\n    );\n    $enums = array(\n      'survey_business_type_enum' => BusinessSurveyBusinessTypeValues::getInstance()->getValues(),\n      'vertical_enum' => BusinessVerticalValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/businesses',\n      new Business(),\n      'EDGE',\n      Business::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getConversations(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'folder' => 'string',\n      'tags' => 'list<string>',\n      'user_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/conversations',\n      new UnifiedThread(),\n      'EDGE',\n      UnifiedThread::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getCustomLabels(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/custom_labels',\n      new PageUserMessageThreadLabel(),\n      'EDGE',\n      PageUserMessageThreadLabel::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getEvents(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'include_canceled' => 'bool',\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'type_enum' => EventTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/events',\n      new Event(),\n      'EDGE',\n      Event::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getFeed(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'include_hidden' => 'bool',\n      'q' => 'string',\n      'show_expired' => 'bool',\n      'since' => 'datetime',\n      'until' => 'datetime',\n      'with' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/feed',\n      new Post(),\n      'EDGE',\n      Post::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createFeed(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'actions' => 'Object',\n      'adaptive_type' => 'string',\n      'album_id' => 'string',\n      'android_key_hash' => 'string',\n      'animated_effect_id' => 'unsigned int',\n      'application_id' => 'string',\n      'asked_fun_fact_prompt_id' => 'unsigned int',\n      'asset3d_id' => 'unsigned int',\n      'associated_id' => 'string',\n      'attach_place_suggestion' => 'bool',\n      'attached_media' => 'list<Object>',\n      'audience_exp' => 'bool',\n      'backdated_time' => 'datetime',\n      'backdated_time_granularity' => 'backdated_time_granularity_enum',\n      'call_to_action' => 'Object',\n      'caption' => 'string',\n      'checkin_entry_point' => 'checkin_entry_point_enum',\n      'child_attachments' => 'list<Object>',\n      'client_mutation_id' => 'string',\n      'composer_entry_picker' => 'string',\n      'composer_entry_point' => 'string',\n      'composer_entry_time' => 'unsigned int',\n      'composer_session_events_log' => 'string',\n      'composer_session_id' => 'string',\n      'composer_source_surface' => 'string',\n      'composer_type' => 'string',\n      'connection_class' => 'string',\n      'content_attachment' => 'string',\n      'coordinates' => 'Object',\n      'cta_link' => 'string',\n      'cta_type' => 'string',\n      'description' => 'string',\n      'direct_share_status' => 'unsigned int',\n      'expanded_height' => 'unsigned int',\n      'expanded_width' => 'unsigned int',\n      'feed_targeting' => 'Object',\n      'formatting' => 'formatting_enum',\n      'fun_fact_prompt_id' => 'unsigned int',\n      'fun_fact_toastee_id' => 'unsigned int',\n      'has_nickname' => 'bool',\n      'height' => 'unsigned int',\n      'holiday_card' => 'string',\n      'home_checkin_city_id' => 'Object',\n      'image_crops' => 'map',\n      'implicit_with_tags' => 'list<int>',\n      'instant_game_entry_point_data' => 'string',\n      'ios_bundle_id' => 'string',\n      'is_backout_draft' => 'bool',\n      'is_boost_intended' => 'bool',\n      'is_explicit_location' => 'bool',\n      'is_explicit_share' => 'bool',\n      'is_group_linking_post' => 'bool',\n      'is_photo_container' => 'bool',\n      'link' => 'string',\n      'location_source_id' => 'string',\n      'manual_privacy' => 'bool',\n      'message' => 'string',\n      'multi_share_end_card' => 'bool',\n      'multi_share_optimized' => 'bool',\n      'name' => 'string',\n      'nectar_module' => 'string',\n      'object_attachment' => 'string',\n      'offer_like_post_id' => 'unsigned int',\n      'og_action_type_id' => 'string',\n      'og_hide_object_attachment' => 'bool',\n      'og_icon_id' => 'string',\n      'og_object_id' => 'string',\n      'og_phrase' => 'string',\n      'og_set_profile_badge' => 'bool',\n      'og_suggestion_mechanism' => 'string',\n      'page_recommendation' => 'string',\n      'picture' => 'string',\n      'place' => 'Object',\n      'place_attachment_setting' => 'place_attachment_setting_enum',\n      'place_list' => 'string',\n      'place_list_data' => 'list',\n      'post_surfaces_blacklist' => 'list<post_surfaces_blacklist_enum>',\n      'posting_to_redspace' => 'posting_to_redspace_enum',\n      'privacy' => 'string',\n      'prompt_id' => 'string',\n      'prompt_tracking_string' => 'string',\n      'properties' => 'Object',\n      'proxied_app_id' => 'string',\n      'publish_event_id' => 'unsigned int',\n      'published' => 'bool',\n      'quote' => 'string',\n      'react_mode_metadata' => 'string',\n      'ref' => 'list<string>',\n      'referenceable_image_ids' => 'list<string>',\n      'referral_id' => 'string',\n      'scheduled_publish_time' => 'datetime',\n      'source' => 'string',\n      'sponsor_id' => 'string',\n      'sponsor_relationship' => 'unsigned int',\n      'suggested_place_id' => 'Object',\n      'tags' => 'list<int>',\n      'target_surface' => 'target_surface_enum',\n      'targeting' => 'Object',\n      'text_format_metadata' => 'string',\n      'text_format_preset_id' => 'string',\n      'text_only_place' => 'string',\n      'throwback_camera_roll_media' => 'string',\n      'thumbnail' => 'file',\n      'time_since_original_post' => 'unsigned int',\n      'title' => 'string',\n      'tracking_info' => 'string',\n      'unpublished_content_type' => 'unpublished_content_type_enum',\n      'user_selected_tags' => 'bool',\n      'video_start_time_ms' => 'unsigned int',\n      'viewer_coordinates' => 'Object',\n      'width' => 'unsigned int',\n    );\n    $enums = array(\n      'backdated_time_granularity_enum' => PostBackdatedTimeGranularityValues::getInstance()->getValues(),\n      'checkin_entry_point_enum' => PostCheckinEntryPointValues::getInstance()->getValues(),\n      'formatting_enum' => PostFormattingValues::getInstance()->getValues(),\n      'place_attachment_setting_enum' => PostPlaceAttachmentSettingValues::getInstance()->getValues(),\n      'post_surfaces_blacklist_enum' => PostPostSurfacesBlacklistValues::getInstance()->getValues(),\n      'posting_to_redspace_enum' => PostPostingToRedspaceValues::getInstance()->getValues(),\n      'target_surface_enum' => PostTargetSurfaceValues::getInstance()->getValues(),\n      'unpublished_content_type_enum' => PostUnpublishedContentTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/feed',\n      new Post(),\n      'EDGE',\n      Post::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getFriends(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'uid' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/friends',\n      new User(),\n      'EDGE',\n      User::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getFundraisers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/fundraisers',\n      new FundraiserPersonToCharity(),\n      'EDGE',\n      FundraiserPersonToCharity::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createFundraiser(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'charity_id' => 'string',\n      'cover_photo' => 'file',\n      'currency' => 'string',\n      'description' => 'string',\n      'end_time' => 'int',\n      'external_event_name' => 'string',\n      'external_event_start_time' => 'int',\n      'external_event_uri' => 'string',\n      'external_fundraiser_uri' => 'string',\n      'external_id' => 'string',\n      'fundraiser_type' => 'fundraiser_type_enum',\n      'goal_amount' => 'int',\n      'name' => 'string',\n      'page_id' => 'string',\n    );\n    $enums = array(\n      'fundraiser_type_enum' => FundraiserPersonToCharityFundraiserTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/fundraisers',\n      new FundraiserPersonToCharity(),\n      'EDGE',\n      FundraiserPersonToCharity::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createGameItem(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action' => 'action_enum',\n      'app_id' => 'string',\n      'drop_table_id' => 'string',\n      'ext_id' => 'string',\n      'item_id' => 'string',\n      'quantity' => 'unsigned int',\n    );\n    $enums = array(\n      'action_enum' => GameItemActionValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/game_items',\n      new GameItem(),\n      'EDGE',\n      GameItem::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createGameTime(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action' => 'action_enum',\n    );\n    $enums = array(\n      'action_enum' => array(\n        'END',\n        'HEARTBEAT',\n        'START',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/game_times',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getGroups(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'admin_only' => 'bool',\n      'parent' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/groups',\n      new Group(),\n      'EDGE',\n      Group::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getIdsForApps(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'app' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ids_for_apps',\n      new UserIDForApp(),\n      'EDGE',\n      UserIDForApp::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getIdsForBusiness(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'app' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ids_for_business',\n      new UserIDForApp(),\n      'EDGE',\n      UserIDForApp::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getIdsForPages(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'page' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/ids_for_pages',\n      new UserIDForPage(),\n      'EDGE',\n      UserIDForPage::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLikes(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'target_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/likes',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getLiveVideos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'broadcast_status' => 'list<broadcast_status_enum>',\n      'source' => 'source_enum',\n    );\n    $enums = array(\n      'broadcast_status_enum' => LiveVideoBroadcastStatusValues::getInstance()->getValues(),\n      'source_enum' => LiveVideoSourceValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/live_videos',\n      new LiveVideo(),\n      'EDGE',\n      LiveVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createLiveVideo(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'content_tags' => 'list<string>',\n      'description' => 'string',\n      'enable_backup_ingest' => 'bool',\n      'encoding_settings' => 'string',\n      'event_params' => 'Object',\n      'fisheye_video_cropped' => 'bool',\n      'front_z_rotation' => 'float',\n      'is_audio_only' => 'bool',\n      'is_spherical' => 'bool',\n      'original_fov' => 'unsigned int',\n      'privacy' => 'string',\n      'projection' => 'projection_enum',\n      'published' => 'bool',\n      'schedule_custom_profile_image' => 'file',\n      'spatial_audio_format' => 'spatial_audio_format_enum',\n      'status' => 'status_enum',\n      'stereoscopic_mode' => 'stereoscopic_mode_enum',\n      'stop_on_delete_stream' => 'bool',\n      'stream_type' => 'stream_type_enum',\n      'title' => 'string',\n    );\n    $enums = array(\n      'projection_enum' => LiveVideoProjectionValues::getInstance()->getValues(),\n      'spatial_audio_format_enum' => LiveVideoSpatialAudioFormatValues::getInstance()->getValues(),\n      'status_enum' => LiveVideoStatusValues::getInstance()->getValues(),\n      'stereoscopic_mode_enum' => LiveVideoStereoscopicModeValues::getInstance()->getValues(),\n      'stream_type_enum' => LiveVideoStreamTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/live_videos',\n      new LiveVideo(),\n      'EDGE',\n      LiveVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createMessengerDesktopPerformanceTrace(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/messenger_desktop_performance_traces',\n      new User(),\n      'EDGE',\n      User::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getMusic(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'target_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/music',\n      new Page(),\n      'EDGE',\n      Page::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createNotification(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'bot_message_payload_elements' => 'string',\n      'filtering' => 'list<filtering_enum>',\n      'href' => 'Object',\n      'label' => 'string',\n      'message' => 'map',\n      'notif_ids' => 'list<string>',\n      'payload' => 'string',\n      'read' => 'bool',\n      'ref' => 'string',\n      'schedule_interval' => 'unsigned int',\n      'seen' => 'bool',\n      'template' => 'Object',\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'filtering_enum' => UserFilteringValues::getInstance()->getValues(),\n      'type_enum' => UserTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/notifications',\n      new User(),\n      'EDGE',\n      User::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPaymentTransactions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/payment_transactions',\n      new PaymentEnginePayment(),\n      'EDGE',\n      PaymentEnginePayment::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deletePermissions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'permission' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/permissions',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPermissions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'permission' => 'string',\n      'status' => 'status_enum',\n    );\n    $enums = array(\n      'status_enum' => PermissionStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/permissions',\n      new Permission(),\n      'EDGE',\n      Permission::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPersonalAdAccounts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/personal_ad_accounts',\n      new AdAccount(),\n      'EDGE',\n      AdAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPhotos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'type_enum' => PhotoTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/photos',\n      new Photo(),\n      'EDGE',\n      Photo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPhoto(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'aid' => 'string',\n      'allow_spherical_photo' => 'bool',\n      'alt_text_custom' => 'string',\n      'android_key_hash' => 'string',\n      'application_id' => 'string',\n      'attempt' => 'unsigned int',\n      'audience_exp' => 'bool',\n      'backdated_time' => 'datetime',\n      'backdated_time_granularity' => 'backdated_time_granularity_enum',\n      'caption' => 'string',\n      'composer_session_id' => 'string',\n      'direct_share_status' => 'unsigned int',\n      'feed_targeting' => 'Object',\n      'filter_type' => 'unsigned int',\n      'full_res_is_coming_later' => 'bool',\n      'initial_view_heading_override_degrees' => 'unsigned int',\n      'initial_view_pitch_override_degrees' => 'unsigned int',\n      'initial_view_vertical_fov_override_degrees' => 'unsigned int',\n      'ios_bundle_id' => 'string',\n      'is_explicit_location' => 'bool',\n      'is_explicit_place' => 'bool',\n      'manual_privacy' => 'bool',\n      'message' => 'string',\n      'name' => 'string',\n      'no_story' => 'bool',\n      'offline_id' => 'unsigned int',\n      'og_action_type_id' => 'string',\n      'og_icon_id' => 'string',\n      'og_object_id' => 'string',\n      'og_phrase' => 'string',\n      'og_set_profile_badge' => 'bool',\n      'og_suggestion_mechanism' => 'string',\n      'place' => 'Object',\n      'privacy' => 'string',\n      'profile_id' => 'int',\n      'proxied_app_id' => 'string',\n      'published' => 'bool',\n      'qn' => 'string',\n      'scheduled_publish_time' => 'unsigned int',\n      'spherical_metadata' => 'map',\n      'sponsor_id' => 'string',\n      'sponsor_relationship' => 'unsigned int',\n      'tags' => 'list<Object>',\n      'target_id' => 'int',\n      'targeting' => 'Object',\n      'time_since_original_post' => 'unsigned int',\n      'uid' => 'int',\n      'unpublished_content_type' => 'unpublished_content_type_enum',\n      'url' => 'string',\n      'user_selected_tags' => 'bool',\n      'vault_image_id' => 'string',\n    );\n    $enums = array(\n      'backdated_time_granularity_enum' => PhotoBackdatedTimeGranularityValues::getInstance()->getValues(),\n      'unpublished_content_type_enum' => PhotoUnpublishedContentTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/photos',\n      new Photo(),\n      'EDGE',\n      Photo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPicture(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'breaking_change' => 'breaking_change_enum',\n      'height' => 'int',\n      'redirect' => 'bool',\n      'type' => 'type_enum',\n      'width' => 'int',\n    );\n    $enums = array(\n      'breaking_change_enum' => ProfilePictureSourceBreakingChangeValues::getInstance()->getValues(),\n      'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/picture',\n      new ProfilePictureSource(),\n      'EDGE',\n      ProfilePictureSource::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPosts(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'include_hidden' => 'bool',\n      'q' => 'string',\n      'show_expired' => 'bool',\n      'since' => 'datetime',\n      'until' => 'datetime',\n      'with' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/posts',\n      new Post(),\n      'EDGE',\n      Post::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getRichMediaDocuments(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'query' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/rich_media_documents',\n      new Canvas(),\n      'EDGE',\n      Canvas::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createStagingResource(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'file' => 'file',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/staging_resources',\n      new User(),\n      'EDGE',\n      User::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'type' => 'type_enum',\n    );\n    $enums = array(\n      'type_enum' => AdVideoTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/videos',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createVideo(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'adaptive_type' => 'string',\n      'animated_effect_id' => 'unsigned int',\n      'application_id' => 'string',\n      'asked_fun_fact_prompt_id' => 'unsigned int',\n      'audio_story_wave_animation_handle' => 'string',\n      'composer_entry_picker' => 'string',\n      'composer_entry_point' => 'string',\n      'composer_entry_time' => 'unsigned int',\n      'composer_session_events_log' => 'string',\n      'composer_session_id' => 'string',\n      'composer_source_surface' => 'string',\n      'composer_type' => 'string',\n      'container_type' => 'container_type_enum',\n      'content_category' => 'content_category_enum',\n      'creative_tools' => 'string',\n      'description' => 'string',\n      'direct_share_status' => 'unsigned int',\n      'embeddable' => 'bool',\n      'end_offset' => 'unsigned int',\n      'fbuploader_video_file_chunk' => 'string',\n      'file_size' => 'unsigned int',\n      'file_url' => 'string',\n      'fisheye_video_cropped' => 'bool',\n      'formatting' => 'formatting_enum',\n      'fov' => 'unsigned int',\n      'front_z_rotation' => 'float',\n      'fun_fact_prompt_id' => 'unsigned int',\n      'fun_fact_toastee_id' => 'unsigned int',\n      'guide' => 'list<list<unsigned int>>',\n      'guide_enabled' => 'bool',\n      'has_nickname' => 'bool',\n      'holiday_card' => 'string',\n      'initial_heading' => 'unsigned int',\n      'initial_pitch' => 'unsigned int',\n      'instant_game_entry_point_data' => 'string',\n      'is_boost_intended' => 'bool',\n      'is_explicit_share' => 'bool',\n      'is_group_linking_post' => 'bool',\n      'is_voice_clip' => 'bool',\n      'location_source_id' => 'string',\n      'manual_privacy' => 'bool',\n      'no_story' => 'bool',\n      'offer_like_post_id' => 'unsigned int',\n      'og_action_type_id' => 'string',\n      'og_icon_id' => 'string',\n      'og_object_id' => 'string',\n      'og_phrase' => 'string',\n      'og_suggestion_mechanism' => 'string',\n      'original_fov' => 'unsigned int',\n      'original_projection_type' => 'original_projection_type_enum',\n      'privacy' => 'string',\n      'publish_event_id' => 'unsigned int',\n      'react_mode_metadata' => 'string',\n      'referenced_sticker_id' => 'string',\n      'replace_video_id' => 'string',\n      'slideshow_spec' => 'map',\n      'source' => 'string',\n      'source_instagram_media_id' => 'string',\n      'spherical' => 'bool',\n      'sponsor_id' => 'string',\n      'start_offset' => 'unsigned int',\n      'swap_mode' => 'swap_mode_enum',\n      'text_format_metadata' => 'string',\n      'throwback_camera_roll_media' => 'string',\n      'thumb' => 'file',\n      'time_since_original_post' => 'unsigned int',\n      'title' => 'string',\n      'transcode_setting_properties' => 'string',\n      'unpublished_content_type' => 'unpublished_content_type_enum',\n      'upload_phase' => 'upload_phase_enum',\n      'upload_session_id' => 'string',\n      'upload_setting_properties' => 'string',\n      'video_file_chunk' => 'string',\n      'video_id_original' => 'string',\n      'video_start_time_ms' => 'unsigned int',\n      'waterfall_id' => 'string',\n    );\n    $enums = array(\n      'container_type_enum' => AdVideoContainerTypeValues::getInstance()->getValues(),\n      'content_category_enum' => AdVideoContentCategoryValues::getInstance()->getValues(),\n      'formatting_enum' => AdVideoFormattingValues::getInstance()->getValues(),\n      'original_projection_type_enum' => AdVideoOriginalProjectionTypeValues::getInstance()->getValues(),\n      'swap_mode_enum' => AdVideoSwapModeValues::getInstance()->getValues(),\n      'unpublished_content_type_enum' => AdVideoUnpublishedContentTypeValues::getInstance()->getValues(),\n      'upload_phase_enum' => AdVideoUploadPhaseValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/videos',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new User(),\n      'NODE',\n      User::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'emoji_color_pref' => 'unsigned int',\n      'firstname' => 'string',\n      'lastname' => 'string',\n      'local_news_megaphone_dismiss_status' => 'local_news_megaphone_dismiss_status_enum',\n      'local_news_subscription_status' => 'local_news_subscription_status_enum',\n      'name' => 'string',\n      'password' => 'string',\n    );\n    $enums = array(\n      'local_news_megaphone_dismiss_status_enum' => UserLocalNewsMegaphoneDismissStatusValues::getInstance()->getValues(),\n      'local_news_subscription_status_enum' => UserLocalNewsSubscriptionStatusValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new User(),\n      'NODE',\n      User::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 1796}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\UserCoverPhotoFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserCoverPhoto extends AbstractObject {\n\n  /**\n   * @return UserCoverPhotoFields\n   */\n  public static function getFieldsEnum() {\n    return UserCoverPhotoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\UserDeviceFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserDevice extends AbstractObject {\n\n  /**\n   * @return UserDeviceFields\n   */\n  public static function getFieldsEnum() {\n    return UserDeviceFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\UserIDForAppFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserIDForApp extends AbstractCrudObject {\n\n  /**\n   * @return UserIDForAppFields\n   */\n  public static function getFieldsEnum() {\n    return UserIDForAppFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\UserIDForPageFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserIDForPage extends AbstractCrudObject {\n\n  /**\n   * @return UserIDForPageFields\n   */\n  public static function getFieldsEnum() {\n    return UserIDForPageFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\UserLeadGenDisclaimerResponseFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserLeadGenDisclaimerResponse extends AbstractObject {\n\n  /**\n   * @return UserLeadGenDisclaimerResponseFields\n   */\n  public static function getFieldsEnum() {\n    return UserLeadGenDisclaimerResponseFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\UserLeadGenFieldDataFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserLeadGenFieldData extends AbstractObject {\n\n  /**\n   * @return UserLeadGenFieldDataFields\n   */\n  public static function getFieldsEnum() {\n    return UserLeadGenFieldDataFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\UserPageOneTimeOptInTokenSettingsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserPageOneTimeOptInTokenSettings extends AbstractCrudObject {\n\n  /**\n   * @return UserPageOneTimeOptInTokenSettingsFields\n   */\n  public static function getFieldsEnum() {\n    return UserPageOneTimeOptInTokenSettingsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new UserPageOneTimeOptInTokenSettings(),\n      'NODE',\n      UserPageOneTimeOptInTokenSettings::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\UserPaymentMobilePricepointsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserPaymentMobilePricepoints extends AbstractObject {\n\n  /**\n   * @return UserPaymentMobilePricepointsFields\n   */\n  public static function getFieldsEnum() {\n    return UserPaymentMobilePricepointsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\ValueBasedEligibleSourceFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ValueBasedEligibleSource extends AbstractCrudObject {\n\n  /**\n   * @return ValueBasedEligibleSourceFields\n   */\n  public static function getFieldsEnum() {\n    return ValueBasedEligibleSourceFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\VehicleFields;\nuse FacebookAds\\Object\\Values\\VehicleAvailabilityValues;\nuse FacebookAds\\Object\\Values\\VehicleBodyStyleValues;\nuse FacebookAds\\Object\\Values\\VehicleConditionValues;\nuse FacebookAds\\Object\\Values\\VehicleDrivetrainValues;\nuse FacebookAds\\Object\\Values\\VehicleFuelTypeValues;\nuse FacebookAds\\Object\\Values\\VehicleImageFetchStatusValues;\nuse FacebookAds\\Object\\Values\\VehicleStateOfVehicleValues;\nuse FacebookAds\\Object\\Values\\VehicleTransmissionValues;\nuse FacebookAds\\Object\\Values\\VehicleVehicleTypeValues;\nuse FacebookAds\\Object\\Values\\VehicleVisibilityValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass Vehicle extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'vehicles';\n  }\n\n  /**\n   * @return VehicleFields\n   */\n  public static function getFieldsEnum() {\n    return VehicleFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ImageFetchStatus'] = VehicleImageFetchStatusValues::getInstance()->getValues();\n    $ref_enums['Visibility'] = VehicleVisibilityValues::getInstance()->getValues();\n    $ref_enums['Availability'] = VehicleAvailabilityValues::getInstance()->getValues();\n    $ref_enums['BodyStyle'] = VehicleBodyStyleValues::getInstance()->getValues();\n    $ref_enums['Condition'] = VehicleConditionValues::getInstance()->getValues();\n    $ref_enums['Drivetrain'] = VehicleDrivetrainValues::getInstance()->getValues();\n    $ref_enums['FuelType'] = VehicleFuelTypeValues::getInstance()->getValues();\n    $ref_enums['StateOfVehicle'] = VehicleStateOfVehicleValues::getInstance()->getValues();\n    $ref_enums['Transmission'] = VehicleTransmissionValues::getInstance()->getValues();\n    $ref_enums['VehicleType'] = VehicleVehicleTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAugmentedRealitiesMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/augmented_realities_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getChannelsToIntegrityStatus(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/channels_to_integrity_status',\n      new CatalogItemChannelsToIntegrityStatus(),\n      'EDGE',\n      CatalogItemChannelsToIntegrityStatus::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideosMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/videos_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new Vehicle(),\n      'NODE',\n      Vehicle::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'address' => 'map',\n      'applinks' => 'Object',\n      'availability' => 'availability_enum',\n      'body_style' => 'body_style_enum',\n      'condition' => 'condition_enum',\n      'currency' => 'string',\n      'date_first_on_lot' => 'string',\n      'dealer_id' => 'string',\n      'dealer_name' => 'string',\n      'dealer_phone' => 'string',\n      'description' => 'string',\n      'drivetrain' => 'drivetrain_enum',\n      'exterior_color' => 'string',\n      'fb_page_id' => 'string',\n      'fuel_type' => 'fuel_type_enum',\n      'images' => 'list<Object>',\n      'interior_color' => 'string',\n      'make' => 'string',\n      'mileage' => 'map',\n      'model' => 'string',\n      'price' => 'unsigned int',\n      'state_of_vehicle' => 'state_of_vehicle_enum',\n      'title' => 'string',\n      'transmission' => 'transmission_enum',\n      'trim' => 'string',\n      'url' => 'string',\n      'vehicle_type' => 'vehicle_type_enum',\n      'vin' => 'string',\n      'year' => 'unsigned int',\n    );\n    $enums = array(\n      'availability_enum' => VehicleAvailabilityValues::getInstance()->getValues(),\n      'body_style_enum' => VehicleBodyStyleValues::getInstance()->getValues(),\n      'condition_enum' => VehicleConditionValues::getInstance()->getValues(),\n      'drivetrain_enum' => VehicleDrivetrainValues::getInstance()->getValues(),\n      'fuel_type_enum' => VehicleFuelTypeValues::getInstance()->getValues(),\n      'state_of_vehicle_enum' => VehicleStateOfVehicleValues::getInstance()->getValues(),\n      'transmission_enum' => VehicleTransmissionValues::getInstance()->getValues(),\n      'vehicle_type_enum' => VehicleVehicleTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new Vehicle(),\n      'NODE',\n      Vehicle::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 237}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\VehicleOfferFields;\nuse FacebookAds\\Object\\Values\\VehicleOfferImageFetchStatusValues;\nuse FacebookAds\\Object\\Values\\VehicleOfferVisibilityValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VehicleOffer extends AbstractCrudObject {\n\n  /**\n   * @return VehicleOfferFields\n   */\n  public static function getFieldsEnum() {\n    return VehicleOfferFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ImageFetchStatus'] = VehicleOfferImageFetchStatusValues::getInstance()->getValues();\n    $ref_enums['Visibility'] = VehicleOfferVisibilityValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getAugmentedRealitiesMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/augmented_realities_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getChannelsToIntegrityStatus(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/channels_to_integrity_status',\n      new CatalogItemChannelsToIntegrityStatus(),\n      'EDGE',\n      CatalogItemChannelsToIntegrityStatus::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getVideosMetadata(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/videos_metadata',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new VehicleOffer(),\n      'NODE',\n      VehicleOffer::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 154}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\VideoCopyrightFields;\nuse FacebookAds\\Object\\Values\\VideoCopyrightContentCategoryValues;\nuse FacebookAds\\Object\\Values\\VideoCopyrightMonitoringTypeValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoCopyright extends AbstractCrudObject {\n\n  /**\n   * @return VideoCopyrightFields\n   */\n  public static function getFieldsEnum() {\n    return VideoCopyrightFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['ContentCategory'] = VideoCopyrightContentCategoryValues::getInstance()->getValues();\n    $ref_enums['MonitoringType'] = VideoCopyrightMonitoringTypeValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getUpdateRecords(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/update_records',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new VideoCopyright(),\n      'NODE',\n      VideoCopyright::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'append_excluded_ownership_segments' => 'bool',\n      'attribution_id' => 'string',\n      'content_category' => 'content_category_enum',\n      'excluded_ownership_countries' => 'list<string>',\n      'excluded_ownership_segments' => 'list<Object>',\n      'is_reference_disabled' => 'bool',\n      'monitoring_type' => 'monitoring_type_enum',\n      'ownership_countries' => 'list<string>',\n      'rule_id' => 'string',\n      'whitelisted_ids' => 'list<string>',\n      'whitelisted_ig_user_ids' => 'list<string>',\n    );\n    $enums = array(\n      'content_category_enum' => VideoCopyrightContentCategoryValues::getInstance()->getValues(),\n      'monitoring_type_enum' => VideoCopyrightMonitoringTypeValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new VideoCopyright(),\n      'NODE',\n      VideoCopyright::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 144}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\VideoCopyrightConditionGroupFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoCopyrightConditionGroup extends AbstractObject {\n\n  /**\n   * @return VideoCopyrightConditionGroupFields\n   */\n  public static function getFieldsEnum() {\n    return VideoCopyrightConditionGroupFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\VideoCopyrightGeoGateFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoCopyrightGeoGate extends AbstractObject {\n\n  /**\n   * @return VideoCopyrightGeoGateFields\n   */\n  public static function getFieldsEnum() {\n    return VideoCopyrightGeoGateFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\VideoCopyrightRuleFields;\nuse FacebookAds\\Object\\Values\\VideoCopyrightRuleSourceValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoCopyrightRule extends AbstractCrudObject {\n\n  /**\n   * @return VideoCopyrightRuleFields\n   */\n  public static function getFieldsEnum() {\n    return VideoCopyrightRuleFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Source'] = VideoCopyrightRuleSourceValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new VideoCopyrightRule(),\n      'NODE',\n      VideoCopyrightRule::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 83}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\VideoCopyrightSegmentFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoCopyrightSegment extends AbstractObject {\n\n  /**\n   * @return VideoCopyrightSegmentFields\n   */\n  public static function getFieldsEnum() {\n    return VideoCopyrightSegmentFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\VideoListFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoList extends AbstractCrudObject {\n\n  /**\n   * @return VideoListFields\n   */\n  public static function getFieldsEnum() {\n    return VideoListFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getVideos(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/videos',\n      new AdVideo(),\n      'EDGE',\n      AdVideo::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new VideoList(),\n      'NODE',\n      VideoList::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 104}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\VideoPollFields;\nuse FacebookAds\\Object\\Values\\VideoPollActionValues;\nuse FacebookAds\\Object\\Values\\VideoPollStatusValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoPoll extends AbstractCrudObject {\n\n  /**\n   * @return VideoPollFields\n   */\n  public static function getFieldsEnum() {\n    return VideoPollFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Status'] = VideoPollStatusValues::getInstance()->getValues();\n    $ref_enums['Action'] = VideoPollActionValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function getPollOptions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/poll_options',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new VideoPoll(),\n      'NODE',\n      VideoPoll::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'action' => 'action_enum',\n      'close_after_voting' => 'bool',\n      'default_open' => 'bool',\n      'show_gradient' => 'bool',\n      'show_results' => 'bool',\n    );\n    $enums = array(\n      'action_enum' => VideoPollActionValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new VideoPoll(),\n      'NODE',\n      VideoPoll::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 137}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\VideoThumbnailFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoThumbnail extends AbstractCrudObject {\n\n  /**\n   * @deprecated getEndpoint function is deprecated\n   */\n  protected function getEndpoint() {\n    return 'thumbnails';\n  }\n\n  /**\n   * @return VideoThumbnailFields\n   */\n  public static function getFieldsEnum() {\n    return VideoThumbnailFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 65}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\VideoUploadLimitsFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoUploadLimits extends AbstractObject {\n\n  /**\n   * @return VideoUploadLimitsFields\n   */\n  public static function getFieldsEnum() {\n    return VideoUploadLimitsFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\VoipInfoFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VoipInfo extends AbstractObject {\n\n  /**\n   * @return VoipInfoFields\n   */\n  public static function getFieldsEnum() {\n    return VoipInfoFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\WebAppLinkFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass WebAppLink extends AbstractObject {\n\n  /**\n   * @return WebAppLinkFields\n   */\n  public static function getFieldsEnum() {\n    return WebAppLinkFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\WhatsAppBusinessAccountFields;\nuse FacebookAds\\Object\\Values\\WhatsAppBusinessAccountCategoryValues;\nuse FacebookAds\\Object\\Values\\WhatsAppBusinessAccountTasksValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass WhatsAppBusinessAccount extends AbstractCrudObject {\n\n  /**\n   * @return WhatsAppBusinessAccountFields\n   */\n  public static function getFieldsEnum() {\n    return WhatsAppBusinessAccountFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['Tasks'] = WhatsAppBusinessAccountTasksValues::getInstance()->getValues();\n    $ref_enums['Category'] = WhatsAppBusinessAccountCategoryValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function deleteAssignedUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'user' => 'int',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/assigned_users',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAssignedUsers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'business' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/assigned_users',\n      new AssignedUser(),\n      'EDGE',\n      AssignedUser::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createAssignedUser(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'tasks' => 'list<tasks_enum>',\n      'user' => 'int',\n    );\n    $enums = array(\n      'tasks_enum' => WhatsAppBusinessAccountTasksValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/assigned_users',\n      new WhatsAppBusinessAccount(),\n      'EDGE',\n      WhatsAppBusinessAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getAudiences(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/audiences',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getConversationAnalytics(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'conversation_categories' => 'list<conversation_categories_enum>',\n      'conversation_directions' => 'list<conversation_directions_enum>',\n      'conversation_types' => 'list<conversation_types_enum>',\n      'country_codes' => 'list<string>',\n      'dimensions' => 'list<dimensions_enum>',\n      'end' => 'unsigned int',\n      'granularity' => 'granularity_enum',\n      'metric_types' => 'list<metric_types_enum>',\n      'phone_numbers' => 'list<string>',\n      'start' => 'unsigned int',\n    );\n    $enums = array(\n      'conversation_categories_enum' => array(\n        'AUTHENTICATION',\n        'MARKETING',\n        'SERVICE',\n        'UNKNOWN',\n        'UTILITY',\n      ),\n      'conversation_directions_enum' => array(\n        'BUSINESS_INITIATED',\n        'UNKNOWN',\n        'USER_INITIATED',\n      ),\n      'conversation_types_enum' => array(\n        'FREE_ENTRY_POINT',\n        'FREE_TIER',\n        'REGULAR',\n        'UNKNOWN',\n      ),\n      'dimensions_enum' => array(\n        'CONVERSATION_CATEGORY',\n        'CONVERSATION_DIRECTION',\n        'CONVERSATION_TYPE',\n        'COUNTRY',\n        'PHONE',\n        'UNKNOWN',\n      ),\n      'granularity_enum' => array(\n        'DAILY',\n        'HALF_HOUR',\n        'MONTHLY',\n      ),\n      'metric_types_enum' => array(\n        'CONVERSATION',\n        'COST',\n        'UNKNOWN',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/conversation_analytics',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getExtensions(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/extensions',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getMessageCampaigns(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/message_campaigns',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteMessageTemplates(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'hsm_id' => 'string',\n      'name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/message_templates',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getMessageTemplates(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'category' => 'list<category_enum>',\n      'content' => 'string',\n      'language' => 'list<string>',\n      'name' => 'string',\n      'name_or_content' => 'string',\n      'quality_score' => 'list<quality_score_enum>',\n      'status' => 'list<status_enum>',\n    );\n    $enums = array(\n      'category_enum' => WhatsAppBusinessAccountCategoryValues::getInstance()->getValues(),\n      'quality_score_enum' => array(\n        'GREEN',\n        'RED',\n        'UNKNOWN',\n        'YELLOW',\n      ),\n      'status_enum' => array(\n        'APPROVED',\n        'DELETED',\n        'DISABLED',\n        'IN_APPEAL',\n        'LIMIT_EXCEEDED',\n        'PAUSED',\n        'PENDING',\n        'PENDING_DELETION',\n        'REJECTED',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/message_templates',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createMessageTemplate(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'allow_category_change' => 'bool',\n      'category' => 'category_enum',\n      'components' => 'list<map>',\n      'cta_url_link_tracking_opted_out' => 'bool',\n      'language' => 'string',\n      'name' => 'string',\n    );\n    $enums = array(\n      'category_enum' => WhatsAppBusinessAccountCategoryValues::getInstance()->getValues(),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/message_templates',\n      new WhatsAppBusinessAccount(),\n      'EDGE',\n      WhatsAppBusinessAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getPhoneNumbers(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/phone_numbers',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createPhoneNumber(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'cc' => 'string',\n      'migrate_phone_number' => 'bool',\n      'phone_number' => 'string',\n      'verified_name' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/phone_numbers',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteProductCatalogs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'catalog_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/product_catalogs',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getProductCatalogs(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/product_catalogs',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createProductCatalog(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'catalog_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/product_catalogs',\n      new ProductCatalog(),\n      'EDGE',\n      ProductCatalog::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSchedules(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/schedules',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSubscribedApps(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/subscribed_apps',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSubscribedApps(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/subscribed_apps',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createSubscribedApp(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'override_callback_uri' => 'string',\n      'verify_token' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/subscribed_apps',\n      new WhatsAppBusinessAccount(),\n      'EDGE',\n      WhatsAppBusinessAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getTemplatePerformanceMetrics(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'name' => 'string',\n      'template_id' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/template_performance_metrics',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new WhatsAppBusinessAccount(),\n      'NODE',\n      WhatsAppBusinessAccount::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 640}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\WhatsAppBusinessPreVerifiedPhoneNumberFields;\nuse FacebookAds\\Object\\Values\\WhatsAppBusinessPreVerifiedPhoneNumberCodeVerificationStatusValues;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass WhatsAppBusinessPreVerifiedPhoneNumber extends AbstractCrudObject {\n\n  /**\n   * @return WhatsAppBusinessPreVerifiedPhoneNumberFields\n   */\n  public static function getFieldsEnum() {\n    return WhatsAppBusinessPreVerifiedPhoneNumberFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    $ref_enums['CodeVerificationStatus'] = WhatsAppBusinessPreVerifiedPhoneNumberCodeVerificationStatusValues::getInstance()->getValues();\n    return $ref_enums;\n  }\n\n\n  public function createRequestCode(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'code_method' => 'code_method_enum',\n      'language' => 'Object',\n    );\n    $enums = array(\n      'code_method_enum' => array(\n        'SMS',\n        'VOICE',\n      ),\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/request_code',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function createVerifyCode(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n      'code' => 'string',\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/verify_code',\n      new AbstractCrudObject(),\n      'EDGE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_DELETE,\n      '/',\n      new AbstractCrudObject(),\n      'NODE',\n      array(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new WhatsAppBusinessPreVerifiedPhoneNumber(),\n      'NODE',\n      WhatsAppBusinessPreVerifiedPhoneNumber::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 159}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\WhatsAppBusinessProfileFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass WhatsAppBusinessProfile extends AbstractCrudObject {\n\n  /**\n   * @return WhatsAppBusinessProfileFields\n   */\n  public static function getFieldsEnum() {\n    return WhatsAppBusinessProfileFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new WhatsAppBusinessProfile(),\n      'NODE',\n      WhatsAppBusinessProfile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n  public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_POST,\n      '/',\n      new WhatsAppBusinessProfile(),\n      'NODE',\n      WhatsAppBusinessProfile::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 104}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\WindowsAppLinkFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass WindowsAppLink extends AbstractObject {\n\n  /**\n   * @return WindowsAppLinkFields\n   */\n  public static function getFieldsEnum() {\n    return WindowsAppLinkFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\WindowsPhoneAppLinkFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass WindowsPhoneAppLink extends AbstractObject {\n\n  /**\n   * @return WindowsPhoneAppLinkFields\n   */\n  public static function getFieldsEnum() {\n    return WindowsPhoneAppLinkFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\WoodhengePurchasedPAYGReceiptFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass WoodhengePurchasedPAYGReceipt extends AbstractCrudObject {\n\n  /**\n   * @return WoodhengePurchasedPAYGReceiptFields\n   */\n  public static function getFieldsEnum() {\n    return WoodhengePurchasedPAYGReceiptFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {\n    $this->assureId();\n\n    $param_types = array(\n    );\n    $enums = array(\n    );\n\n    $request = new ApiRequest(\n      $this->api,\n      $this->data['id'],\n      RequestInterface::METHOD_GET,\n      '/',\n      new WoodhengePurchasedPAYGReceipt(),\n      'NODE',\n      WoodhengePurchasedPAYGReceipt::getFieldsEnum()->getValues(),\n      new TypeChecker($param_types, $enums)\n    );\n    $request->addParams($params);\n    $request->addFields($fields);\n    return $pending ? $request : $request->execute();\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object;\n\nuse FacebookAds\\ApiRequest;\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\TypeChecker;\nuse FacebookAds\\Object\\Fields\\WorkUserFrontlineFields;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass WorkUserFrontline extends AbstractObject {\n\n  /**\n   * @return WorkUserFrontlineFields\n   */\n  public static function getFieldsEnum() {\n    return WorkUserFrontlineFields::getInstance();\n  }\n\n  protected static function getReferencedEnums() {\n    $ref_enums = array();\n    return $ref_enums;\n  }\n\n\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\BusinessDataAPI;\n\nclass Content {\n  /**\n   * Associative array for storing property values\n   * @var mixed[]\n   */\n  protected $container = array();\n\n  /**\n   * Constructor\n   * @param mixed[] $data Associated array of property value initializing the model\n   */\n  public function __construct(array $data = null) {\n    $this->container['product_id'] = isset($data['product_id']) ? $data['product_id'] : null;;\n    $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null;\n    $this->container['price'] = isset($data['price']) ? $data['price'] : null;\n    $this->container['title'] = isset($data['title']) ? $data['title'] : null;\n    $this->container['tax'] = isset($data['tax']) ? $data['tax'] : null;;\n    $this->container['external_content_id'] = isset($data['external_content_id']) ? $data['external_content_id'] : null;\n  }\n\n  /**\n   * Get Product Id.\n   * @return string Product Id\n   */\n  public function getProductId() {\n    return $this->container['product_id'];\n  }\n\n  /**\n   * Sets product id.\n   * @param string $product_id product id\n   * @return $this\n   */\n  public function setProductId($product_id) {\n    $this->container['product_id'] = $product_id;\n    return $this;\n  }\n\n  /**\n   * Get number of product.\n   * @return integer quantity\n   */\n  public function getQuantity() {\n    return $this->container['quantity'];\n  }\n\n  /**\n   * Set number of product.\n   * @param integer $quantity number of items\n   * @return $this\n   */\n  public function setQuantity($quantity) {\n    $this->container['quantity'] = $quantity;\n    return $this;\n  }\n\n  /**\n   * Get total price.\n   * @return float Price\n   */\n  public function getPrice() {\n    return $this->container['price'];\n  }\n\n  /**\n   * Set total price.\n   * @param float Price\n   * @return $this\n   */\n  public function setPrice($price) {\n    $this->container['price'] = $price;\n    return $this;\n  }\n\n  /**\n   * Get title.\n   * @return string title\n   */\n  public function getTitle() {\n    return $this->container['title'];\n  }\n\n  /**\n   * Sets title.\n   * @param string $title title\n   * @return $this\n   */\n  public function setTitle($title) {\n    $this->container['title'] = $title;\n    return $this;\n  }\n\n  /**\n   * Gets the string presentation of the object\n   * @return string\n   */\n  public function __toString() {\n    if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n      return json_encode($this, JSON_PRETTY_PRINT);\n    }\n\n    return json_encode($this);\n  }\n\n  /**\n   * convert to Json\n   * @return array\n   */\n  public function toJson() {\n    $request = array(\n      'id' => $this->container['product_id'],\n      'quantity' => $this->container['quantity'],\n      'price' => $this->container['price'],\n      'title' => $this->container['title'],\n      'tax' => $this->container['tax'],\n      'external_content_id' => $this->container['external_content_id'],\n    );\n\n    $request = array_filter($request);\n    return $request;\n  }\n}\n", "num_lines": 149}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\BusinessDataAPI;\n\nclass CustomData {\n\n  /**\n   * Associative array for storing property values\n   * @var mixed[]\n   */\n  protected $container = array();\n\n  /**\n   * Constructor\n   * @param mixed[] $data Associated array of property value initializing the model\n   */\n  public function __construct(array $data = null) {\n    $this->container['value'] = isset($data['value']) ? $data['value'] : null;\n    $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null;\n    $this->container['contents'] = isset($data['contents']) ? $data['contents'] : null;\n    $this->container['order_id'] = isset($data['order_id']) ? $data['order_id'] : null;\n    $this->container['status'] = isset($data['status']) ? $data['status'] : null;\n    $this->container['billing_contact'] = isset($data['billing_contact']) ? $data['billing_contact'] : null;\n    $this->container['shipping_contact'] = isset($data['shipping_contact']) ? $data['shipping_contact'] : null;\n    $this->container['external_order_id'] = isset($data['external_order_id']) ? $data['external_order_id'] : null;\n    $this->container['original_order_id'] = isset($data['original_order_id']) ? $data['original_order_id'] : null;\n    $this->container['message'] = isset($data['message']) ? $data['message'] : null;\n  }\n\n  /**\n   * Sets value\n   * @param float $value A numeric value associated with this event.\n   *         This could be a monetary value or a value in some other metric.\n   * @return $this\n   */\n  public function setValue($value) {\n    $this->container['value'] = $value;\n\n    return $this;\n  }\n\n  /**\n   * Sets currency\n   * @param string $currency The currency for the value specified, if applicable.\n   *          Currency must be a valid ISO 4217 three digit currency code.\n   * @return $this\n   */\n  public function setCurrency($currency) {\n    $this->container['currency'] = $currency;\n\n    return $this;\n  }\n\n  /**\n   * Sets contents\n   * @param Content[] $contents A list of Content objects that contain the product IDs associated with\n   *          the event plus information about the products.\n   * @return $this\n   */\n  public function setContents($contents) {\n    $this->container['contents'] = $contents;\n\n    return $this;\n  }\n\n  /**\n   * Sets order_id\n   * @param string $order_id The order ID for this transaction as a String.\n   * @return $this\n   */\n  public function setOrderId($order_id) {\n    $this->container['order_id'] = $order_id;\n\n    return $this;\n  }\n\n  /**\n   * Sets status\n   * @param status of the order\n   *\n   * @return $this\n   */\n  public function setStatus($status) {\n    $this->container['status'] = $status;\n\n    return $this;\n  }\n\n  /**\n   * Sets billing contact\n   * @param billing contact of the order\n   *\n   * @return $this\n   */\n  public function setBillingContact($billing_contact) {\n    $this->container['billing_contact'] = $billing_contact;\n\n    return $this;\n  }\n\n  /**\n   * Sets shipping contact\n   * @param shipping contact of the order\n   *\n   * @return $this\n   */\n  public function setShippingContact($shipping_contact) {\n    $this->container['shipping_contact'] = $shipping_contact;\n\n    return $this;\n  }\n\n  /**\n   * Sets external order id\n   * @param unique order id\n   *\n   * @return $this\n   */\n  public function setExternalOrderId($external_order_id) {\n    $this->container['external_order_id'] = $external_order_id;\n\n    return $this;\n  }\n\n  /**\n   * Sets original order id\n   * @param original order id for Refund event.\n   *\n   * @return $this\n   */\n  public function setOriginalOrderId($original_order_id) {\n    $this->container['original_order_id'] = $original_order_id;\n\n    return $this;\n  }\n\n  /**\n   * Sets message for Refund event\n   * @param message for Refund event\n   *\n   * @return $this\n   */\n  public function setMessage($message) {\n    $this->container['message'] = $message;\n\n    return $this;\n  }\n\n  public function toJson() {\n    $request = array();\n\n    $request['value'] = $this->getValue();\n    $request['currency'] = $this->getCurrency();\n    $request['order_id'] = $this->getOrderId();\n    $request['status'] = $this->getStatus();\n    $request['billing_contact'] = $this->getBillingContact()->toJson();\n    $request['shipping_contact'] = $this->getShippingContact()->toJson();\n    $request['original_order_id'] = $this->getOriginalOrderId();\n    $request['external_order_id'] = $this->getExternalOrderId();\n    $request['message'] = $this->getMessage();\n\n    if (isset($this->container['contents'])) {\n      $contents = [];\n      foreach ($this->getContents() as $content) {\n        array_push($contents, $content->toJson());\n      }\n      $request['contents'] = $contents;\n    }\n\n    $request = array_filter($request, function($val) {\n      if (is_array($val)) {\n        return true;\n      } else {\n        return strlen((string) $val);\n      }\n    });\n\n    return $request;\n  }\n\n  /**\n   * Gets a numeric value associated with this event.\n   * This could be a monetary value or a value in some other metric.\n   * @return float\n   */\n  public function getValue() {\n    return $this->container['value'];\n  }\n\n  /**\n   * Gets currency for the value specified, if applicable.\n   * @return string\n   */\n  public function getCurrency() {\n    return $this->container['currency'];\n  }\n\n  /**\n   * Gets a list of Content objects that contain the product IDs associated with\n   * the event plus information about the products.\n   * @return Content[]\n   */\n  public function getContents() {\n    return $this->container['contents'];\n  }\n\n  /**\n   * Gets the order ID for this transaction as a String.\n   * @return string\n   */\n  public function getOrderId() {\n    return $this->container['order_id'];\n  }\n\n  /**\n   * Gets the status of the registration event\n   * @return string\n   */\n  public function getStatus() {\n    return $this->container['status'];\n  }\n\n  /**\n   * Gets billing contact\n   *\n   * @return UserData\n   */\n  public function getBillingContact() {\n    return $this->container['billing_contact'];\n  }\n\n  /**\n   * Gets shipping contact\n   *\n   * @return UserData\n   */\n  public function getShippingContact() {\n    return $this->container['shipping_contact'];\n  }\n\n  /**\n   * Gets external order id\n   *\n   * @return string\n   */\n  public function getExternalOrderId() {\n    return $this->container['external_order_id'];\n  }\n\n  /**\n   * Gets original order id\n   *\n   * @return string\n   */\n  public function getOriginalOrderId() {\n    return $this->container['original_order_id'];\n  }\n\n  /**\n   * Gets message\n   *\n   * @return string\n   */\n  public function getMessage() {\n    return $this->container['message'];\n  }\n\n  /**\n   * Gets the string presentation of the object\n   * @return string\n   */\n  public function __toString() {\n    if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n      return json_encode($this, JSON_PRETTY_PRINT);\n    }\n\n    return json_encode($this);\n  }\n}\n", "num_lines": 302}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\BusinessDataAPI;\n\nclass Event {\n\n  /**\n   * Associative array for storing property values\n   * @var mixed[]\n   */\n  protected $container = array();\n\n  /**\n   * Constructor\n   * @param mixed[] $data Associated array of property value initalizing the model\n   */\n  public function __construct(array $data = null) {\n    $this->container['event_name'] = isset($data['event_name']) ? $data['event_name'] : null;\n    $this->container['event_time'] = isset($data['event_time']) ? $data['event_time'] : null;\n    $this->container['event_id'] = isset($data['event_id']) ? $data['event_id'] : null;\n    $this->container['user_data'] = isset($data['user_data']) ? $data['user_data'] : null;\n    $this->container['custom_data'] = isset($data['custom_data']) ? $data['custom_data'] : null;\n    $this->container['data_processing_options'] = isset($data['data_processing_options']) ? $data['data_processing_options'] : null;\n    $this->container['data_processing_options_country'] = isset($data['data_processing_options_country']) ? $data['data_processing_options_country'] : null;\n    $this->container['data_processing_options_state'] = isset($data['data_processing_options_state']) ? $data['data_processing_options_state'] : null;\n  }\n\n  /**\n   * Sets a Facebook pixel Standard Event or Custom Event name\n   * @param string $event_name A Facebook pixel Standard Event or Custom Event name.\n   * @return $this\n   */\n  public function setEventName($event_name) {\n    $this->container['event_name'] = $event_name;\n\n    return $this;\n  }\n\n  /**\n   * Sets a Unix timestamp in seconds indicating when the actual event occurred\n   * @param int $event_time A Unix timestamp in seconds indicating when the actual event occurred.\n   * @return $this\n   */\n  public function setEventTime($event_time) {\n    $this->container['event_time'] = $event_time;\n\n    return $this;\n  }\n\n  /**\n   * @param string $event_id This ID can be any unique string chosen by the advertiser.\n   * @return $this\n   */\n  public function setEventId($event_id) {\n    $this->container['event_id'] = $event_id;\n\n    return $this;\n  }\n\n  /**\n   * Sets UserData object that contains user data.\n   * @param FacebookAds\\Object\\BusinessDataAPI\\UserData $user_data\n   * @return $this\n   */\n  public function setUserData($user_data) {\n    $this->container['user_data'] = $user_data;\n\n    return $this;\n  }\n\n  /**\n   * Sets CustomData object that includes additional business data about the event.\n   * @param FacebookAds\\Object\\BusinessDataAPI\\CustomData $custom_data\n   * @return $this\n   */\n  public function setCustomData($custom_data) {\n    $this->container['custom_data'] = $custom_data;\n\n    return $this;\n  }\n\n  /**\n   * Sets the processing options you would like to enable for a specific event.\n   * For more details see: https://developers.facebook.com/docs/marketing-apis/data-processing-options\n   * @param string[], e.g. [] or ['LDU']\n   * @return $this\n   */\n  public function setDataProcessingOptions($data_processing_options) {\n    $this->container['data_processing_options'] = $data_processing_options;\n\n    return $this;\n  }\n\n  /**\n   * Sets a country that you want to associate to this data processing option. If you set a country, you must also set a state.\n   * For more details see: https://developers.facebook.com/docs/marketing-apis/data-processing-options\n   * @param int\n   * @return $this\n   */\n  public function setDataProcessingOptionsCountry($data_processing_options_country) {\n    $this->container['data_processing_options_country'] = $data_processing_options_country;\n\n    return $this;\n  }\n\n  /**\n   * Sets a state that you want to associate with this data processing option.\n   * For more details see: https://developers.facebook.com/docs/marketing-apis/data-processing-options\n   * @param int\n   * @return $this\n   *\n   */\n  public function setDataProcessingOptionsState($data_processing_options_state) {\n    $this->container['data_processing_options_state'] = $data_processing_options_state;\n\n    return $this;\n  }\n\n  /**\n   * convert to Json\n   * @return array\n   */\n  public function toJson() {\n    $request = array();\n\n    $request['event_name'] = $this->getEventName();\n    $request['event_time'] = $this->getEventTime();\n    $request['event_id'] = $this->getEventId();\n    $request['user_data'] = isset($this->container['user_data']) ? $this->getUserData()->toJson() : null;\n    $request['custom_data'] = isset($this->container['custom_data']) ? $this->getCustomData()->toJson() : null;\n\n    $request['data_processing_options'] = $this->getDataProcessingOptions();\n    $request['data_processing_options_country'] = $this->getDataProcessingOptionsCountry();\n    $request['data_processing_options_state'] = $this->getDataProcessingOptionsState();\n    $request = array_filter(\n      $request, function($val) {\n        if(is_array($val)) {\n          return true;\n        } else {\n          return strlen((string) $val);\n        }\n      });\n\n    return $request;\n  }\n\n  /**\n   * Gets Facebook pixel Standard Event or Custom Event name.\n   * @return string\n   */\n  public function getEventName() {\n    return $this->container['event_name'];\n  }\n\n  /**\n   * Gets Unix timestamp in seconds indicating when the actual event occurred.\n   * @return int\n   */\n  public function getEventTime() {\n    return $this->container['event_time'];\n  }\n\n  /**\n   * Gets Event ID can be any string chosen by the advertiser.\n   * @return string\n   */\n  public function getEventId() {\n    return $this->container['event_id'];\n  }\n\n  /**\n   * Gets UserData object that contains user data\n   * @return FacebookAds\\Object\\BusinessDataAPI\\UserData\n   */\n  public function getUserData() {\n    return $this->container['user_data'];\n  }\n\n  /**\n   * Gets customData object that includes additional business data about the event.\n   * @return FacebookAds\\Object\\BusinessDataAPI\\CustomData\n   */\n  public function getCustomData() {\n    return $this->container['custom_data'];\n  }\n\n  /**\n   * Gets DataProcessionOptions value of Processing options you would like to enable for a specific event.\n   * @return string[]\n   */\n  public function getDataProcessingOptions() {\n    return $this->container['data_processing_options'];\n  }\n\n  /**\n   * Gets DataProcessionOptionsState value that represents the state that you want to associate with this data processing option.\n   * @return int\n   */\n  public function getDataProcessingOptionsState() {\n    return $this->container['data_processing_options_state'];\n  }\n\n  /**\n   * Gets DataProcessionOptionsCountry value that represents the country that you want to associate to this data processing option.\n   * @return int\n   */\n  public function getDataProcessingOptionsCountry() {\n    return $this->container['data_processing_options_country'];\n  }\n\n  /**\n   * Gets the string representation of the object\n   * @return string\n   */\n  public function __toString() {\n    if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n      return json_encode($this, JSON_PRETTY_PRINT);\n    }\n\n    return json_encode($this);\n  }\n}\n", "num_lines": 245}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\BusinessDataAPI;\n\nuse FacebookAds\\Api;\nuse FacebookAds\\ApiConfig;\nuse FacebookAds\\Object\\Page;\n\n/**\n * Business Data API Event Request\n *\n * @category    Class\n */\nclass EventRequest {\n\n  /**\n   * Associative array for storing property values\n   * @var mixed[]\n   */\n  protected $container = array();\n\n  /**\n   * Constructor\n   * @param string $page_id page id\n   * @param mixed[] $data Associated array of property value initializing the model\n   */\n  public function __construct(string $page_id, array $data = null) {\n    $this->container['page_id'] = $page_id;\n    $this->container['events'] = isset($data['events']) ? $data['events'] : null;\n  }\n\n  /**\n   * Sets an array of Business Data Event objects\n   * @param FacebookAds\\Object\\BusinessDataAPI\\Event[] $events An array of Business Data Event objects\n   * @return $this\n   */\n  public function setEvents($events) {\n    $this->container['events'] = $events;\n    return $this;\n  }\n\n  /**\n   * Sets Partner Agent, which specifies who is sending the event.\n   * @param string $partner_agent The partner agent who is sending the event\n   * @return $this\n   */\n  public function setPartnerAgent($partner_agent) {\n    $this->container['partner_agent'] = $partner_agent;\n\n    return $this;\n  }\n\n  /**\n   * Execute the request\n   * @return EventResponse\n   */\n  public function execute() {\n    $fields = array();\n    $params = $this->toJson();\n    $page = new Page($this->container['page_id']);\n    $response = $page->createBusinessDatum(\n      $fields,\n      $params,\n    );\n    $event_response = new EventResponse($response->exportAllData());\n    return $event_response;\n  }\n\n  /**\n   * convert to JSON\n   * @return array\n   */\n  public function toJson() {\n    $data = array();\n    $events = $this->getEvents();\n    if (!is_null($events)) {\n      foreach ($events as $event) {\n        $event_data = $event->toJson();\n        array_push($data, $event_data);\n      }\n    }\n\n    $payload = array(\n      'data' => $data,\n      'partner_agent' => $this->container['partner_agent'],\n    );\n    $payload = array_filter($payload);\n\n    return $payload;\n  }\n\n  /**\n   * Gets an array of Event objects\n   * @return FacebookAds\\Object\\BusinessDataAPI\\Event[]\n   */\n  public function getEvents() {\n    return $this->container['events'];\n  }\n\n  /**\n   * Gets Partner Agent, which specifies who is sending the event.\n   * @return string\n   */\n  public function getPartnerAgent() {\n    return $this->container['partner_agent'];\n  }\n\n /**\n   * Gets the string presentation of the object\n   * @return string\n   */\n  public function __toString() {\n    if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n      return json_encode($this, JSON_PRETTY_PRINT);\n    }\n\n    return json_encode($this);\n  }\n}\n", "num_lines": 142}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\BusinessDataAPI;\n\n/**\n *  event response.\n *\n * @category    Class\n */\nclass EventResponse {\n\n  /**\n   * Associative array for storing property values\n   * @var mixed[]\n   */\n  protected $container = array();\n\n  /**\n   * Constructor\n   * @param mixed[] $data Associated array of property value initalizing the model\n   */\n  public function __construct(array $data = null) {\n    $this->container['events_received'] = isset($data['events_received']) ? $data['events_received'] : null;\n    $this->container['events_dropped'] = isset($data['events_dropped']) ? $data['events_dropped'] : null;\n    $this->container['message'] = isset($data['message']) ? $data['message'] : null;\n  }\n\n\n  /**\n   * Gets number of events received.\n   * @return int\n   */\n  public function getEventsReceived() {\n    return $this->container['events_received'];\n  }\n\n  /**\n   * Sets number of events received.\n   * @param int $events_received number of events received.\n   * @return $this\n   */\n  public function setEventsReceived($events_received) {\n    $this->container['events_received'] = $events_received;\n\n    return $this;\n  }\n\n  /**\n   * Gets number of events dropped.\n   * @return int\n   */\n  public function getEventsDropped() {\n    return $this->container['events_dropped'];\n  }\n\n  /**\n   * Sets number of events dropped.\n   * @param int $events_dropped number of events dropped.\n   * @return $this\n   */\n  public function setEventsDropped($events_dropped) {\n    $this->container['events_dropped'] = $events_dropped;\n\n    return $this;\n  }\n\n  /**\n   * Gets response message.\n   * @return array\n   */\n  public function getMessage() {\n    return $this->container['message'];\n  }\n\n  /**\n   * Sets response message.\n   * @param array $message response message.\n   * @return $this\n   */\n  public function setMessage($message) {\n    $this->container['message'] = $message;\n\n    return $this;\n  }\n\n /**\n   * Gets the string presentation of the object\n   * @return string\n   */\n  public function __toString() {\n    if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n      return json_encode($this, JSON_PRETTY_PRINT);\n    }\n    return json_encode($this);\n  }\n\n}\n", "num_lines": 120}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\BusinessDataAPI;\n\n/**\n * UserData is a set of identifiers Facebook can use for targeted attribution.\n *\n * @category    Class\n */\nclass UserData {\n\n  /**\n   * Associative array for storing property values\n   * @var mixed[]\n   */\n  protected $container = array();\n\n  /**\n   * Constructor\n   * @param mixed[] $data Associated array of property value initalizing the model\n   */\n  public function __construct(array $data = null) {\n    $this->container['email'] = isset($data['email']) ? $data['email'] : null;\n    $this->container['phone'] = isset($data['phone']) ? $data['phone'] : null;\n    $this->container['date_of_birth'] = isset($data['date_of_birth']) ? $data['date_of_birth'] : null;\n    $this->container['last_name'] = isset($data['last_name']) ? $data['last_name'] : null;\n    $this->container['first_name'] = isset($data['first_name']) ? $data['first_name'] : null;\n    $this->container['city'] = isset($data['city']) ? $data['city'] : null;\n    $this->container['state'] = isset($data['state']) ? $data['state'] : null;\n    $this->container['country_code'] = isset($data['country_code']) ? $data['country_code'] : null;\n    $this->container['zip_code'] = isset($data['zip_code']) ? $data['zip_code'] : null;\n    $this->container['external_id'] = isset($data['external_id']) ? $data['external_id'] : null;\n    $this->container['address'] = isset($data['address']) ? $data['address'] : null;\n  }\n\n\n  /**\n   * Sets an email address, in lowercase.\n   *\n   * Example: joe@eg.com\n   * @param string $email An email address, in lowercase.\n   * @return $this\n   */\n  public function setEmail($email) {\n    $this->container['email'] = $email;\n\n    return $this;\n  }\n\n  /**\n   * Sets a phone number. Include only digits with countryCode code, area code, and number.\n   *\n   * Example: 16505551212\n   * @param string $phone A phone number. Include only digits with country code, area code, and number.\n   * @return $this\n   */\n  public function setPhone($phone) {\n    $this->container['phone'] = $phone;\n\n    return $this;\n  }\n\n  /**\n   * Sets a date of birth given as year, month, and day.\n   *\n   * Example: 19971226 for December 26, 1997.\n   * @param string $date_of_birth A date of birth given as year, month, and day.\n   * @return $this\n   */\n  public function setDateOfBirth($date_of_birth) {\n    $this->container['date_of_birth'] = $date_of_birth;\n\n    return $this;\n  }\n\n  /**\n   * Sets a last name in lowercase.\n   *\n   * Example: smith\n   * @param string $last_name A last name in lowercase.\n   * @return $this\n   */\n  public function setLastName($last_name) {\n    $this->container['last_name'] = $last_name;\n\n    return $this;\n  }\n\n  /**\n   * Sets a first name in lowercase.\n   *\n   * Example: joe\n   * @param string $first_name A first name in lowercase.\n   * @return $this\n   */\n  public function setFirstName($first_name) {\n    $this->container['first_name'] = $first_name;\n\n    return $this;\n  }\n\n  /**\n   * Sets a city in lowercase without spaces or punctuation.\n   *\n   * Example: menlopark\n   * @param string $city A city in lowercase without spaces or punctuation.\n   * @return $this\n   */\n  public function setCity($city) {\n    $this->container['city'] = $city;\n\n    return $this;\n  }\n\n  /**\n   * Sets a two-letter state code in lowercase.\n   *\n   * Example: ca\n   * @param string $state A two-letter state code in lowercase.\n   * @return $this\n   */\n  public function setState($state) {\n    $this->container['state'] = $state;\n\n    return $this;\n  }\n\n  /**\n   * Sets a two-letter country code in lowercase.\n   *\n   * Example: us\n   * @param string $country_code two-letter country code in lowercase.\n   * @return $this\n   */\n  public function setCountryCode($country_code) {\n    $this->container['country_code'] = $country_code;\n\n    return $this;\n  }\n\n  /**\n   * Sets a five-digit zip code.\n   *\n   * Example: 94035\n   * @param string $zip_code A five-digit zip code.\n   * @return $this\n   */\n  public function setZipCode($zip_code) {\n    $this->container['zip_code'] = $zip_code;\n\n    return $this;\n  }\n\n  /**\n   * Sets any unique ID from the advertiser, such as loyalty membership IDs, user IDs, and external\n   * cookie IDs. In the Offline Conversions API, this is known as extern_id. For more information,\n   * see Offline Conversions, Providing External IDs. If External ID is being sent via other\n   * channels, then it should be sent in the same format via the server-side API.\n   * @param string $external_id Any unique ID from the advertiser, such as loyalty membership IDs,\n   *      user IDs, and external cookie IDs.\n   * @return $this\n   */\n  public function setExternalId($external_id) {\n    $this->container['external_id'] = $external_id;\n\n    return $this;\n  }\n\n  /**\n   * Sets physical address\n   * Example: 1001 Westlake Ave\n   * @param string $address Physical address\n   * @return $this\n   */\n  public function setAddress($address) {\n    $this->container['address'] = $address;\n\n    return $this;\n  }\n\n  public function toJson() {\n    $request = array();\n\n    $request['em'] = $this->getEmail();\n    $request['ph'] = $this->getPhone();\n    $request['db'] = $this->getDateOfBirth();\n    $request['ln'] = $this->getLastName();\n    $request['fn'] = $this->getFirstName();\n    $request['ct'] = $this->getCity();\n    $request['st'] = $this->getState();\n    $request['zp'] = $this->getZipCode();\n    $request['country'] = $this->getCountryCode();\n    $request['external_id'] = $this->getExternalId();\n    $request['addr'] = $this->getAddress();\n    $request = array_filter($request);\n    return $request;\n  }\n\n  /**\n   * Gets an email address, in lowercase.\n   * @return string\n   */\n  public function getEmail() {\n    return $this->container['email'];\n  }\n\n  /**\n   * Gets a phone number\n   * @return string\n   */\n  public function getPhone() {\n    return $this->container['phone'];\n  }\n\n  /**\n   * Gets Date Of Birth.\n   * @return string\n   */\n  public function getDateOfBirth() {\n    return $this->container['date_of_birth'];\n  }\n\n  /**\n   * Gets Last Name.\n   * @return string\n   */\n  public function getLastName() {\n    return $this->container['last_name'];\n  }\n\n  /**\n   * Gets First Name.\n   * @return string\n   */\n  public function getFirstName() {\n    return $this->container['first_name'];\n  }\n\n  /**\n   * Gets city.\n   * @return string\n   */\n  public function getCity() {\n    return $this->container['city'];\n  }\n\n  /**\n   * Gets state.\n   * @return string\n   */\n  public function getState() {\n    return $this->container['state'];\n  }\n\n  /**\n   * Gets zip code\n   * @return string\n   */\n  public function getZipCode() {\n    return $this->container['zip_code'];\n  }\n\n  /**\n   * Gets country code.\n   * @return string\n   */\n  public function getCountryCode() {\n    return $this->container['country_code'];\n  }\n\n  /**\n   * Gets Any unique ID from the advertiser, such as loyalty membership IDs, user IDs, and external cookie IDs.\n   * @return string\n   */\n  public function getExternalId() {\n    return $this->container['external_id'];\n  }\n\n  /**\n   * Gets physical address\n   * @return string\n   */\n  public function getAddress() {\n    return $this->container['address'];\n  }\n\n  /**\n   * Gets the string presentation of the object\n   * @return string\n   */\n  public function __toString() {\n    if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n      return json_encode($this, JSON_PRETTY_PRINT);\n    }\n\n    return json_encode($this);\n  }\n}\n", "num_lines": 321}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass BirthYearNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::BIRTH_YEAR;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return preg_replace('/[^0-9]/', '', $key_value);\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass CityNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::CITY;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return preg_replace('/[^a-z]/', '', strtolower(trim($key_value)));\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass CountryNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::COUNTRY;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return substr(\n      preg_replace('/[^a-z]/', '', strtolower(trim($key_value))),\n      0,\n      2);\n  }\n}\n", "num_lines": 53}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass DateNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return in_array($key, array(\n      CustomAudienceMultikeySchemaFields::BIRTH_DATE,\n      CustomAudienceMultikeySchemaFields::BIRTH_MONTH\n    ));\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return str_pad(\n      preg_replace('/[^0-9]/', '', $key_value),\n      2,\n      '0',\n      STR_PAD_LEFT);\n  }\n}\n", "num_lines": 57}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass EmailNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::EMAIL;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return trim(strtolower($key_value), \" \\t\\r\\n\\0\\x0B.\");\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass FirstNameInitialNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::FIRST_NAME_INITIAL;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return preg_replace(\n      '/[^a-z]/',\n      '',\n      strtolower(trim($key_value)))[0];\n  }\n}\n", "num_lines": 53}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass FirstNameNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::FIRST_NAME;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return preg_replace('/[^a-z]/', '', strtolower(trim($key_value)));\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass GenderNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::GENDER;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return substr($key_value, 0, 1);\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\n\nclass HashNormalizer implements ValueNormalizerInterface {\n\n    /**\n     *  @var string\n     */\n    const HASH_TYPE_SHA256 = 'sha256';\n\n    /**\n     * @param string $key\n     * @param string $key_value\n     * @return boolean\n     */\n    public function shouldNormalize($key, $key_value) {\n        return $key !== CustomAudienceMultikeySchemaFields::LOOKALIKE_VALUE;\n    }\n\n    /**\n     * @param string $key\n     * @param string $key_value\n     * @return string\n     */\n    public function normalize($key, $key_value) {\n        return hash(self::HASH_TYPE_SHA256, $key_value);\n    }\n}\n", "num_lines": 55}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass LastNameNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::LAST_NAME;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return preg_replace('/[^a-z]/', '', strtolower(trim($key_value)));\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass MadidNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::MADID;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return strtolower(trim($key_value));\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass PhoneNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::PHONE;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return preg_replace('/[^0-9]/', '', trim($key_value));\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass StateNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::STATE;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return preg_replace('/[^a-z]/', '', strtolower(trim($key_value)));\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\ninterface ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $val);\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $val);\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\ValueNormalizerInterface;\n\nclass ZipNormalizer implements ValueNormalizerInterface {\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return boolean\n   */\n  public function shouldNormalize($key, $key_value) {\n    return $key === CustomAudienceMultikeySchemaFields::ZIP;\n  }\n\n  /**\n   * @param string $key\n   * @param string $key_value\n   * @return string\n   */\n  public function normalize($key, $key_value) {\n    return explode(\n      '-',\n      preg_replace('/[ ]/', '', strtolower(trim($key_value))))[0];\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\nabstract class AbstractArchivableCrudObjectFields extends AbstractEnum {\n\n  const CONFIGURED_STATUS = 'configured_status';\n  const EFFECTIVE_STATUS = 'effective_status';\n}\n", "num_lines": 34}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountAdRulesHistoryFields extends AbstractEnum {\n\n  const EVALUATION_SPEC = 'evaluation_spec';\n  const EXCEPTION_CODE = 'exception_code';\n  const EXCEPTION_MESSAGE = 'exception_message';\n  const EXECUTION_SPEC = 'execution_spec';\n  const IS_MANUAL = 'is_manual';\n  const RESULTS = 'results';\n  const RULE_ID = 'rule_id';\n  const SCHEDULE_SPEC = 'schedule_spec';\n  const TIMESTAMP = 'timestamp';\n\n  public function getFieldTypes() {\n    return array(\n      'evaluation_spec' => 'AdRuleEvaluationSpec',\n      'exception_code' => 'int',\n      'exception_message' => 'string',\n      'execution_spec' => 'AdRuleExecutionSpec',\n      'is_manual' => 'bool',\n      'results' => 'list<AdRuleHistoryResult>',\n      'rule_id' => 'int',\n      'schedule_spec' => 'AdRuleScheduleSpec',\n      'timestamp' => 'datetime',\n    );\n  }\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountAdVolumeFields extends AbstractEnum {\n\n  const ACTOR_ID = 'actor_id';\n  const ACTOR_NAME = 'actor_name';\n  const AD_LIMIT_SCOPE_BUSINESS = 'ad_limit_scope_business';\n  const AD_LIMIT_SCOPE_BUSINESS_MANAGER_ID = 'ad_limit_scope_business_manager_id';\n  const AD_LIMIT_SET_BY_PAGE_ADMIN = 'ad_limit_set_by_page_admin';\n  const ADS_RUNNING_OR_IN_REVIEW_COUNT = 'ads_running_or_in_review_count';\n  const ADS_RUNNING_OR_IN_REVIEW_COUNT_SUBJECT_TO_LIMIT_SET_BY_PAGE = 'ads_running_or_in_review_count_subject_to_limit_set_by_page';\n  const CURRENT_ACCOUNT_ADS_RUNNING_OR_IN_REVIEW_COUNT = 'current_account_ads_running_or_in_review_count';\n  const FUTURE_LIMIT_ACTIVATION_DATE = 'future_limit_activation_date';\n  const FUTURE_LIMIT_ON_ADS_RUNNING_OR_IN_REVIEW = 'future_limit_on_ads_running_or_in_review';\n  const LIMIT_ON_ADS_RUNNING_OR_IN_REVIEW = 'limit_on_ads_running_or_in_review';\n  const RECOMMENDATIONS = 'recommendations';\n\n  public function getFieldTypes() {\n    return array(\n      'actor_id' => 'string',\n      'actor_name' => 'string',\n      'ad_limit_scope_business' => 'Business',\n      'ad_limit_scope_business_manager_id' => 'string',\n      'ad_limit_set_by_page_admin' => 'unsigned int',\n      'ads_running_or_in_review_count' => 'unsigned int',\n      'ads_running_or_in_review_count_subject_to_limit_set_by_page' => 'unsigned int',\n      'current_account_ads_running_or_in_review_count' => 'unsigned int',\n      'future_limit_activation_date' => 'string',\n      'future_limit_on_ads_running_or_in_review' => 'unsigned int',\n      'limit_on_ads_running_or_in_review' => 'unsigned int',\n      'recommendations' => 'list<Object>',\n    );\n  }\n}\n", "num_lines": 70}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountBusinessConstraintsFields extends AbstractEnum {\n\n  const AUDIENCE_CONTROLS = 'audience_controls';\n\n  public function getFieldTypes() {\n    return array(\n      'audience_controls' => 'Object',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountDefaultDestinationFields extends AbstractEnum {\n\n  const DESTINATION_ID = 'destination_id';\n  const DESTINATION_URL = 'destination_url';\n\n  public function getFieldTypes() {\n    return array(\n      'destination_id' => 'string',\n      'destination_url' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountDefaultObjectiveFields extends AbstractEnum {\n\n  const DEFAULT_OBJECTIVE_FOR_USER = 'default_objective_for_user';\n  const OBJECTIVE_FOR_LEVEL = 'objective_for_level';\n\n  public function getFieldTypes() {\n    return array(\n      'default_objective_for_user' => 'DefaultObjectiveForUser',\n      'objective_for_level' => 'ObjectiveForLevel',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountDeliveryEstimateFields extends AbstractEnum {\n\n  const DAILY_OUTCOMES_CURVE = 'daily_outcomes_curve';\n  const ESTIMATE_DAU = 'estimate_dau';\n  const ESTIMATE_MAU_LOWER_BOUND = 'estimate_mau_lower_bound';\n  const ESTIMATE_MAU_UPPER_BOUND = 'estimate_mau_upper_bound';\n  const ESTIMATE_READY = 'estimate_ready';\n  const TARGETING_OPTIMIZATION_TYPES = 'targeting_optimization_types';\n\n  public function getFieldTypes() {\n    return array(\n      'daily_outcomes_curve' => 'list<OutcomePredictionPoint>',\n      'estimate_dau' => 'int',\n      'estimate_mau_lower_bound' => 'int',\n      'estimate_mau_upper_bound' => 'int',\n      'estimate_ready' => 'bool',\n      'targeting_optimization_types' => 'list<map<string, int>>',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountFields extends AbstractEnum {\n\n  const ACCOUNT_ID = 'account_id';\n  const ACCOUNT_STATUS = 'account_status';\n  const AD_ACCOUNT_PROMOTABLE_OBJECTS = 'ad_account_promotable_objects';\n  const AGE = 'age';\n  const AGENCY_CLIENT_DECLARATION = 'agency_client_declaration';\n  const AMOUNT_SPENT = 'amount_spent';\n  const ATTRIBUTION_SPEC = 'attribution_spec';\n  const BALANCE = 'balance';\n  const BUSINESS = 'business';\n  const BUSINESS_CITY = 'business_city';\n  const BUSINESS_COUNTRY_CODE = 'business_country_code';\n  const BUSINESS_NAME = 'business_name';\n  const BUSINESS_STATE = 'business_state';\n  const BUSINESS_STREET = 'business_street';\n  const BUSINESS_STREET2 = 'business_street2';\n  const BUSINESS_ZIP = 'business_zip';\n  const CAPABILITIES = 'capabilities';\n  const CREATED_TIME = 'created_time';\n  const CURRENCY = 'currency';\n  const CUSTOM_AUDIENCE_INFO = 'custom_audience_info';\n  const DISABLE_REASON = 'disable_reason';\n  const END_ADVERTISER = 'end_advertiser';\n  const END_ADVERTISER_NAME = 'end_advertiser_name';\n  const EXISTING_CUSTOMERS = 'existing_customers';\n  const EXTENDED_CREDIT_INVOICE_GROUP = 'extended_credit_invoice_group';\n  const FAILED_DELIVERY_CHECKS = 'failed_delivery_checks';\n  const FB_ENTITY = 'fb_entity';\n  const FUNDING_SOURCE = 'funding_source';\n  const FUNDING_SOURCE_DETAILS = 'funding_source_details';\n  const HAS_MIGRATED_PERMISSIONS = 'has_migrated_permissions';\n  const HAS_PAGE_AUTHORIZED_ADACCOUNT = 'has_page_authorized_adaccount';\n  const ID = 'id';\n  const IO_NUMBER = 'io_number';\n  const IS_ATTRIBUTION_SPEC_SYSTEM_DEFAULT = 'is_attribution_spec_system_default';\n  const IS_DIRECT_DEALS_ENABLED = 'is_direct_deals_enabled';\n  const IS_IN_3DS_AUTHORIZATION_ENABLED_MARKET = 'is_in_3ds_authorization_enabled_market';\n  const IS_NOTIFICATIONS_ENABLED = 'is_notifications_enabled';\n  const IS_PERSONAL = 'is_personal';\n  const IS_PREPAY_ACCOUNT = 'is_prepay_account';\n  const IS_TAX_ID_REQUIRED = 'is_tax_id_required';\n  const LIABLE_ADDRESS = 'liable_address';\n  const LINE_NUMBERS = 'line_numbers';\n  const MEDIA_AGENCY = 'media_agency';\n  const MIN_CAMPAIGN_GROUP_SPEND_CAP = 'min_campaign_group_spend_cap';\n  const MIN_DAILY_BUDGET = 'min_daily_budget';\n  const NAME = 'name';\n  const OFFSITE_PIXELS_TOS_ACCEPTED = 'offsite_pixels_tos_accepted';\n  const OWNER = 'owner';\n  const OWNER_BUSINESS = 'owner_business';\n  const PARTNER = 'partner';\n  const RF_SPEC = 'rf_spec';\n  const SEND_BILL_TO_ADDRESS = 'send_bill_to_address';\n  const SHOW_CHECKOUT_EXPERIENCE = 'show_checkout_experience';\n  const SOLD_TO_ADDRESS = 'sold_to_address';\n  const SPEND_CAP = 'spend_cap';\n  const TAX_ID = 'tax_id';\n  const TAX_ID_STATUS = 'tax_id_status';\n  const TAX_ID_TYPE = 'tax_id_type';\n  const TIMEZONE_ID = 'timezone_id';\n  const TIMEZONE_NAME = 'timezone_name';\n  const TIMEZONE_OFFSET_HOURS_UTC = 'timezone_offset_hours_utc';\n  const TOS_ACCEPTED = 'tos_accepted';\n  const USER_TASKS = 'user_tasks';\n  const USER_TOS_ACCEPTED = 'user_tos_accepted';\n  const VIEWABLE_BUSINESS = 'viewable_business';\n\n  public function getFieldTypes() {\n    return array(\n      'account_id' => 'string',\n      'account_status' => 'unsigned int',\n      'ad_account_promotable_objects' => 'AdAccountPromotableObjects',\n      'age' => 'float',\n      'agency_client_declaration' => 'AgencyClientDeclaration',\n      'amount_spent' => 'string',\n      'attribution_spec' => 'list<AttributionSpec>',\n      'balance' => 'string',\n      'business' => 'Business',\n      'business_city' => 'string',\n      'business_country_code' => 'string',\n      'business_name' => 'string',\n      'business_state' => 'string',\n      'business_street' => 'string',\n      'business_street2' => 'string',\n      'business_zip' => 'string',\n      'capabilities' => 'list<string>',\n      'created_time' => 'datetime',\n      'currency' => 'string',\n      'custom_audience_info' => 'CustomAudienceGroup',\n      'disable_reason' => 'unsigned int',\n      'end_advertiser' => 'string',\n      'end_advertiser_name' => 'string',\n      'existing_customers' => 'list<string>',\n      'extended_credit_invoice_group' => 'ExtendedCreditInvoiceGroup',\n      'failed_delivery_checks' => 'list<DeliveryCheck>',\n      'fb_entity' => 'unsigned int',\n      'funding_source' => 'string',\n      'funding_source_details' => 'FundingSourceDetails',\n      'has_migrated_permissions' => 'bool',\n      'has_page_authorized_adaccount' => 'bool',\n      'id' => 'string',\n      'io_number' => 'string',\n      'is_attribution_spec_system_default' => 'bool',\n      'is_direct_deals_enabled' => 'bool',\n      'is_in_3ds_authorization_enabled_market' => 'bool',\n      'is_notifications_enabled' => 'bool',\n      'is_personal' => 'unsigned int',\n      'is_prepay_account' => 'bool',\n      'is_tax_id_required' => 'bool',\n      'liable_address' => 'CRMAddress',\n      'line_numbers' => 'list<int>',\n      'media_agency' => 'string',\n      'min_campaign_group_spend_cap' => 'string',\n      'min_daily_budget' => 'unsigned int',\n      'name' => 'string',\n      'offsite_pixels_tos_accepted' => 'bool',\n      'owner' => 'string',\n      'owner_business' => 'Business',\n      'partner' => 'string',\n      'rf_spec' => 'ReachFrequencySpec',\n      'send_bill_to_address' => 'CRMAddress',\n      'show_checkout_experience' => 'bool',\n      'sold_to_address' => 'CRMAddress',\n      'spend_cap' => 'string',\n      'tax_id' => 'string',\n      'tax_id_status' => 'unsigned int',\n      'tax_id_type' => 'string',\n      'timezone_id' => 'unsigned int',\n      'timezone_name' => 'string',\n      'timezone_offset_hours_utc' => 'float',\n      'tos_accepted' => 'map<string, int>',\n      'user_tasks' => 'list<string>',\n      'user_tos_accepted' => 'map<string, int>',\n      'viewable_business' => 'Business',\n    );\n  }\n}\n", "num_lines": 176}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountIosFourteenCampaignLimitsFields extends AbstractEnum {\n\n  const CAMPAIGN_GROUP_LIMIT = 'campaign_group_limit';\n  const CAMPAIGN_GROUP_LIMITS_DETAILS = 'campaign_group_limits_details';\n  const CAMPAIGN_LIMIT = 'campaign_limit';\n\n  public function getFieldTypes() {\n    return array(\n      'campaign_group_limit' => 'int',\n      'campaign_group_limits_details' => 'list<Object>',\n      'campaign_limit' => 'int',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountMatchedSearchApplicationsEdgeDataFields extends AbstractEnum {\n\n  const APP_ID = 'app_id';\n  const ARE_APP_EVENTS_UNAVAILABLE = 'are_app_events_unavailable';\n  const ICON_URL = 'icon_url';\n  const NAME = 'name';\n  const SEARCH_SOURCE_STORE = 'search_source_store';\n  const STORE = 'store';\n  const UNIQUE_ID = 'unique_id';\n  const URL = 'url';\n\n  public function getFieldTypes() {\n    return array(\n      'app_id' => 'string',\n      'are_app_events_unavailable' => 'bool',\n      'icon_url' => 'string',\n      'name' => 'string',\n      'search_source_store' => 'string',\n      'store' => 'string',\n      'unique_id' => 'string',\n      'url' => 'string',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountMaxBidFields extends AbstractEnum {\n\n  const MAX_BID = 'max_bid';\n\n  public function getFieldTypes() {\n    return array(\n      'max_bid' => 'int',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountPromotableObjectsFields extends AbstractEnum {\n\n  const PROMOTABLE_APP_IDS = 'promotable_app_ids';\n  const PROMOTABLE_PAGE_IDS = 'promotable_page_ids';\n  const PROMOTABLE_URLS = 'promotable_urls';\n\n  public function getFieldTypes() {\n    return array(\n      'promotable_app_ids' => 'list<string>',\n      'promotable_page_ids' => 'list<string>',\n      'promotable_urls' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountReachEstimateFields extends AbstractEnum {\n\n  const ESTIMATE_READY = 'estimate_ready';\n  const USERS_LOWER_BOUND = 'users_lower_bound';\n  const USERS_UPPER_BOUND = 'users_upper_bound';\n\n  public function getFieldTypes() {\n    return array(\n      'estimate_ready' => 'bool',\n      'users_lower_bound' => 'int',\n      'users_upper_bound' => 'int',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountRecommendedCamapaignBudgetFields extends AbstractEnum {\n\n  const DAILY = 'daily';\n  const LIFETIME = 'lifetime';\n  const OBJECTIVE = 'objective';\n\n  public function getFieldTypes() {\n    return array(\n      'daily' => 'string',\n      'lifetime' => 'string',\n      'objective' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountSubscribedAppsFields extends AbstractEnum {\n\n  const APP_ID = 'app_id';\n  const APP_NAME = 'app_name';\n\n  public function getFieldTypes() {\n    return array(\n      'app_id' => 'string',\n      'app_name' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountTargetingUnifiedFields extends AbstractEnum {\n\n  const AUDIENCE_SIZE_LOWER_BOUND = 'audience_size_lower_bound';\n  const AUDIENCE_SIZE_UPPER_BOUND = 'audience_size_upper_bound';\n  const CONVERSION_LIFT = 'conversion_lift';\n  const DESCRIPTION = 'description';\n  const ID = 'id';\n  const IMG = 'img';\n  const INFO = 'info';\n  const INFO_TITLE = 'info_title';\n  const IS_RECOMMENDATION = 'is_recommendation';\n  const KEY = 'key';\n  const LINK = 'link';\n  const NAME = 'name';\n  const PARENT = 'parent';\n  const PARTNER = 'partner';\n  const PATH = 'path';\n  const PERFORMANCE_RATING = 'performance_rating';\n  const RAW_NAME = 'raw_name';\n  const RECOMMENDATION_MODEL = 'recommendation_model';\n  const SEARCH_INTEREST_ID = 'search_interest_id';\n  const SOURCE = 'source';\n  const SPEND = 'spend';\n  const TYPE = 'type';\n  const VALID = 'valid';\n\n  public function getFieldTypes() {\n    return array(\n      'audience_size_lower_bound' => 'unsigned int',\n      'audience_size_upper_bound' => 'unsigned int',\n      'conversion_lift' => 'float',\n      'description' => 'string',\n      'id' => 'string',\n      'img' => 'string',\n      'info' => 'string',\n      'info_title' => 'string',\n      'is_recommendation' => 'bool',\n      'key' => 'string',\n      'link' => 'string',\n      'name' => 'string',\n      'parent' => 'string',\n      'partner' => 'string',\n      'path' => 'list<string>',\n      'performance_rating' => 'unsigned int',\n      'raw_name' => 'string',\n      'recommendation_model' => 'string',\n      'search_interest_id' => 'string',\n      'source' => 'string',\n      'spend' => 'float',\n      'type' => 'string',\n      'valid' => 'bool',\n    );\n  }\n}\n", "num_lines": 92}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountTrackingDataFields extends AbstractEnum {\n\n  const TRACKING_SPECS = 'tracking_specs';\n\n  public function getFieldTypes() {\n    return array(\n      'tracking_specs' => 'ConversionActionQuery',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAccountUserFields extends AbstractEnum {\n\n  const ID = 'id';\n  const NAME = 'name';\n  const TASKS = 'tasks';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'name' => 'string',\n      'tasks' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdActivityFields extends AbstractEnum {\n\n  const ACTOR_ID = 'actor_id';\n  const ACTOR_NAME = 'actor_name';\n  const APPLICATION_ID = 'application_id';\n  const APPLICATION_NAME = 'application_name';\n  const DATE_TIME_IN_TIMEZONE = 'date_time_in_timezone';\n  const EVENT_TIME = 'event_time';\n  const EVENT_TYPE = 'event_type';\n  const EXTRA_DATA = 'extra_data';\n  const OBJECT_ID = 'object_id';\n  const OBJECT_NAME = 'object_name';\n  const OBJECT_TYPE = 'object_type';\n  const TRANSLATED_EVENT_TYPE = 'translated_event_type';\n\n  public function getFieldTypes() {\n    return array(\n      'actor_id' => 'string',\n      'actor_name' => 'string',\n      'application_id' => 'string',\n      'application_name' => 'string',\n      'date_time_in_timezone' => 'string',\n      'event_time' => 'datetime',\n      'event_type' => 'EventType',\n      'extra_data' => 'string',\n      'object_id' => 'string',\n      'object_name' => 'string',\n      'object_type' => 'string',\n      'translated_event_type' => 'string',\n    );\n  }\n}\n", "num_lines": 70}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecAssetLabelFields extends AbstractEnum {\n\n  const ID = 'id';\n  const NAME = 'name';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'name' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecBodyFields extends AbstractEnum {\n\n  const ADLABELS = 'adlabels';\n  const TEXT = 'text';\n  const URL_TAGS = 'url_tags';\n\n  public function getFieldTypes() {\n    return array(\n      'adlabels' => 'list<AdAssetFeedSpecAssetLabel>',\n      'text' => 'string',\n      'url_tags' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecCaptionFields extends AbstractEnum {\n\n  const ADLABELS = 'adlabels';\n  const TEXT = 'text';\n  const URL_TAGS = 'url_tags';\n\n  public function getFieldTypes() {\n    return array(\n      'adlabels' => 'list<AdAssetFeedSpecAssetLabel>',\n      'text' => 'string',\n      'url_tags' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecDescriptionFields extends AbstractEnum {\n\n  const ADLABELS = 'adlabels';\n  const TEXT = 'text';\n  const URL_TAGS = 'url_tags';\n\n  public function getFieldTypes() {\n    return array(\n      'adlabels' => 'list<AdAssetFeedSpecAssetLabel>',\n      'text' => 'string',\n      'url_tags' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecFields extends AbstractEnum {\n\n  const AD_FORMATS = 'ad_formats';\n  const ADDITIONAL_DATA = 'additional_data';\n  const APP_PRODUCT_PAGE_ID = 'app_product_page_id';\n  const ASSET_CUSTOMIZATION_RULES = 'asset_customization_rules';\n  const AUTOTRANSLATE = 'autotranslate';\n  const BODIES = 'bodies';\n  const CALL_TO_ACTION_TYPES = 'call_to_action_types';\n  const CALL_TO_ACTIONS = 'call_to_actions';\n  const CAPTIONS = 'captions';\n  const CAROUSELS = 'carousels';\n  const DESCRIPTIONS = 'descriptions';\n  const EVENTS = 'events';\n  const GROUPS = 'groups';\n  const IMAGES = 'images';\n  const LINK_URLS = 'link_urls';\n  const OPTIMIZATION_TYPE = 'optimization_type';\n  const TITLES = 'titles';\n  const VIDEOS = 'videos';\n\n  public function getFieldTypes() {\n    return array(\n      'ad_formats' => 'list<string>',\n      'additional_data' => 'Object',\n      'app_product_page_id' => 'string',\n      'asset_customization_rules' => 'list<Object>',\n      'autotranslate' => 'list<string>',\n      'bodies' => 'list<AdAssetFeedSpecBody>',\n      'call_to_action_types' => 'list<CallToActionTypes>',\n      'call_to_actions' => 'list<Object>',\n      'captions' => 'list<AdAssetFeedSpecCaption>',\n      'carousels' => 'list<Object>',\n      'descriptions' => 'list<AdAssetFeedSpecDescription>',\n      'events' => 'list<Object>',\n      'groups' => 'list<AdAssetFeedSpecGroupRule>',\n      'images' => 'list<AdAssetFeedSpecImage>',\n      'link_urls' => 'list<AdAssetFeedSpecLinkURL>',\n      'optimization_type' => 'string',\n      'titles' => 'list<AdAssetFeedSpecTitle>',\n      'videos' => 'list<AdAssetFeedSpecVideo>',\n    );\n  }\n}\n", "num_lines": 82}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecGroupRuleFields extends AbstractEnum {\n\n  const BODY_LABEL = 'body_label';\n  const CAPTION_LABEL = 'caption_label';\n  const DESCRIPTION_LABEL = 'description_label';\n  const IMAGE_LABEL = 'image_label';\n  const LINK_URL_LABEL = 'link_url_label';\n  const TITLE_LABEL = 'title_label';\n  const VIDEO_LABEL = 'video_label';\n\n  public function getFieldTypes() {\n    return array(\n      'body_label' => 'AdAssetFeedSpecAssetLabel',\n      'caption_label' => 'AdAssetFeedSpecAssetLabel',\n      'description_label' => 'AdAssetFeedSpecAssetLabel',\n      'image_label' => 'AdAssetFeedSpecAssetLabel',\n      'link_url_label' => 'AdAssetFeedSpecAssetLabel',\n      'title_label' => 'AdAssetFeedSpecAssetLabel',\n      'video_label' => 'AdAssetFeedSpecAssetLabel',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecImageFields extends AbstractEnum {\n\n  const ADLABELS = 'adlabels';\n  const HASH = 'hash';\n  const IMAGE_CROPS = 'image_crops';\n  const URL = 'url';\n  const URL_TAGS = 'url_tags';\n\n  public function getFieldTypes() {\n    return array(\n      'adlabels' => 'list<AdAssetFeedSpecAssetLabel>',\n      'hash' => 'string',\n      'image_crops' => 'AdsImageCrops',\n      'url' => 'string',\n      'url_tags' => 'string',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecLinkURLFields extends AbstractEnum {\n\n  const ADLABELS = 'adlabels';\n  const CAROUSEL_SEE_MORE_URL = 'carousel_see_more_url';\n  const DEEPLINK_URL = 'deeplink_url';\n  const DISPLAY_URL = 'display_url';\n  const URL_TAGS = 'url_tags';\n  const WEBSITE_URL = 'website_url';\n\n  public function getFieldTypes() {\n    return array(\n      'adlabels' => 'list<AdAssetFeedSpecAssetLabel>',\n      'carousel_see_more_url' => 'string',\n      'deeplink_url' => 'string',\n      'display_url' => 'string',\n      'url_tags' => 'string',\n      'website_url' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecTitleFields extends AbstractEnum {\n\n  const ADLABELS = 'adlabels';\n  const TEXT = 'text';\n  const URL_TAGS = 'url_tags';\n\n  public function getFieldTypes() {\n    return array(\n      'adlabels' => 'list<AdAssetFeedSpecAssetLabel>',\n      'text' => 'string',\n      'url_tags' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAssetFeedSpecVideoFields extends AbstractEnum {\n\n  const ADLABELS = 'adlabels';\n  const CAPTION_IDS = 'caption_ids';\n  const THUMBNAIL_HASH = 'thumbnail_hash';\n  const THUMBNAIL_URL = 'thumbnail_url';\n  const URL_TAGS = 'url_tags';\n  const VIDEO_ID = 'video_id';\n\n  public function getFieldTypes() {\n    return array(\n      'adlabels' => 'list<AdAssetFeedSpecAssetLabel>',\n      'caption_ids' => 'list<string>',\n      'thumbnail_hash' => 'string',\n      'thumbnail_url' => 'string',\n      'url_tags' => 'string',\n      'video_id' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAsyncRequestFields extends AbstractEnum {\n\n  const ASYNC_REQUEST_SET = 'async_request_set';\n  const CREATED_TIME = 'created_time';\n  const ID = 'id';\n  const INPUT = 'input';\n  const RESULT = 'result';\n  const SCOPE_OBJECT_ID = 'scope_object_id';\n  const STATUS = 'status';\n  const TYPE = 'type';\n  const UPDATED_TIME = 'updated_time';\n\n  public function getFieldTypes() {\n    return array(\n      'async_request_set' => 'AdAsyncRequestSet',\n      'created_time' => 'datetime',\n      'id' => 'string',\n      'input' => 'map',\n      'result' => 'map',\n      'scope_object_id' => 'string',\n      'status' => 'string',\n      'type' => 'string',\n      'updated_time' => 'datetime',\n    );\n  }\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAsyncRequestSetFields extends AbstractEnum {\n\n  const CANCELED_COUNT = 'canceled_count';\n  const CREATED_TIME = 'created_time';\n  const ERROR_COUNT = 'error_count';\n  const ID = 'id';\n  const IN_PROGRESS_COUNT = 'in_progress_count';\n  const INITIAL_COUNT = 'initial_count';\n  const IS_COMPLETED = 'is_completed';\n  const NAME = 'name';\n  const NOTIFICATION_MODE = 'notification_mode';\n  const NOTIFICATION_RESULT = 'notification_result';\n  const NOTIFICATION_STATUS = 'notification_status';\n  const NOTIFICATION_URI = 'notification_uri';\n  const OWNER_ID = 'owner_id';\n  const SUCCESS_COUNT = 'success_count';\n  const TOTAL_COUNT = 'total_count';\n  const UPDATED_TIME = 'updated_time';\n  const AD_SPECS = 'ad_specs';\n\n  public function getFieldTypes() {\n    return array(\n      'canceled_count' => 'int',\n      'created_time' => 'datetime',\n      'error_count' => 'int',\n      'id' => 'string',\n      'in_progress_count' => 'int',\n      'initial_count' => 'unsigned int',\n      'is_completed' => 'bool',\n      'name' => 'string',\n      'notification_mode' => 'NotificationMode',\n      'notification_result' => 'AdAsyncRequestSetNotificationResult',\n      'notification_status' => 'string',\n      'notification_uri' => 'string',\n      'owner_id' => 'string',\n      'success_count' => 'int',\n      'total_count' => 'unsigned int',\n      'updated_time' => 'datetime',\n      'ad_specs' => 'list<map>',\n    );\n  }\n}\n", "num_lines": 80}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdAsyncRequestSetNotificationResultFields extends AbstractEnum {\n\n  const RESPONSE = 'response';\n  const STATUS = 'status';\n\n  public function getFieldTypes() {\n    return array(\n      'response' => 'string',\n      'status' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdBidAdjustmentsFields extends AbstractEnum {\n\n  const AGE_RANGE = 'age_range';\n  const PAGE_TYPES = 'page_types';\n  const USER_GROUPS = 'user_groups';\n\n  public function getFieldTypes() {\n    return array(\n      'age_range' => 'map<string, float>',\n      'page_types' => 'Object',\n      'user_groups' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCampaignBidConstraintFields extends AbstractEnum {\n\n  const ROAS_AVERAGE_FLOOR = 'roas_average_floor';\n\n  public function getFieldTypes() {\n    return array(\n      'roas_average_floor' => 'int',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCampaignDeliveryEstimateFields extends AbstractEnum {\n\n  const DAILY_OUTCOMES_CURVE = 'daily_outcomes_curve';\n  const ESTIMATE_DAU = 'estimate_dau';\n  const ESTIMATE_MAU_LOWER_BOUND = 'estimate_mau_lower_bound';\n  const ESTIMATE_MAU_UPPER_BOUND = 'estimate_mau_upper_bound';\n  const ESTIMATE_READY = 'estimate_ready';\n  const TARGETING_OPTIMIZATION_TYPES = 'targeting_optimization_types';\n\n  public function getFieldTypes() {\n    return array(\n      'daily_outcomes_curve' => 'list<OutcomePredictionPoint>',\n      'estimate_dau' => 'int',\n      'estimate_mau_lower_bound' => 'int',\n      'estimate_mau_upper_bound' => 'int',\n      'estimate_ready' => 'bool',\n      'targeting_optimization_types' => 'list<map<string, int>>',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCampaignDeliveryStatsUnsupportedReasonsFields extends AbstractEnum {\n\n  const REASON_DATA = 'reason_data';\n  const REASON_TYPE = 'reason_type';\n\n  public function getFieldTypes() {\n    return array(\n      'reason_data' => 'list<map<string, string>>',\n      'reason_type' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCampaignFrequencyControlSpecsFields extends AbstractEnum {\n\n  const EVENT = 'event';\n  const INTERVAL_DAYS = 'interval_days';\n  const MAX_FREQUENCY = 'max_frequency';\n\n  public function getFieldTypes() {\n    return array(\n      'event' => 'string',\n      'interval_days' => 'unsigned int',\n      'max_frequency' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCampaignIssuesInfoFields extends AbstractEnum {\n\n  const ERROR_CODE = 'error_code';\n  const ERROR_MESSAGE = 'error_message';\n  const ERROR_SUMMARY = 'error_summary';\n  const ERROR_TYPE = 'error_type';\n  const LEVEL = 'level';\n\n  public function getFieldTypes() {\n    return array(\n      'error_code' => 'int',\n      'error_message' => 'string',\n      'error_summary' => 'string',\n      'error_type' => 'string',\n      'level' => 'string',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCampaignLearningStageInfoFields extends AbstractEnum {\n\n  const ATTRIBUTION_WINDOWS = 'attribution_windows';\n  const CONVERSIONS = 'conversions';\n  const LAST_SIG_EDIT_TS = 'last_sig_edit_ts';\n  const STATUS = 'status';\n\n  public function getFieldTypes() {\n    return array(\n      'attribution_windows' => 'list<string>',\n      'conversions' => 'unsigned int',\n      'last_sig_edit_ts' => 'int',\n      'status' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCampaignOptimizationEventFields extends AbstractEnum {\n\n  const CUSTOM_CONVERSION_ID = 'custom_conversion_id';\n  const EVENT_SEQUENCE = 'event_sequence';\n  const EVENT_TYPE = 'event_type';\n\n  public function getFieldTypes() {\n    return array(\n      'custom_conversion_id' => 'string',\n      'event_sequence' => 'unsigned int',\n      'event_type' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCampaignPacedBidInfoFields extends AbstractEnum {\n\n  const BIDDING_STATUS = 'bidding_status';\n\n  public function getFieldTypes() {\n    return array(\n      'bidding_status' => 'string',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeAdDisclaimerFields extends AbstractEnum {\n\n  const TEXT = 'text';\n  const TITLE = 'title';\n  const URL = 'url';\n\n  public function getFieldTypes() {\n    return array(\n      'text' => 'string',\n      'title' => 'string',\n      'url' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeBrandedContentAdsFields extends AbstractEnum {\n\n  const AD_FORMAT = 'ad_format';\n  const CREATOR_AD_PERMISSION_TYPE = 'creator_ad_permission_type';\n  const INSTAGRAM_BOOST_POST_ACCESS_TOKEN = 'instagram_boost_post_access_token';\n  const PARTNERS = 'partners';\n  const UI_VERSION = 'ui_version';\n\n  public function getFieldTypes() {\n    return array(\n      'ad_format' => 'int',\n      'creator_ad_permission_type' => 'string',\n      'instagram_boost_post_access_token' => 'string',\n      'partners' => 'list<Object>',\n      'ui_version' => 'int',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeCollectionThumbnailInfoFields extends AbstractEnum {\n\n  const ELEMENT_CHILD_INDEX = 'element_child_index';\n  const ELEMENT_CROPS = 'element_crops';\n  const ELEMENT_ID = 'element_id';\n\n  public function getFieldTypes() {\n    return array(\n      'element_child_index' => 'int',\n      'element_crops' => 'AdsImageCrops',\n      'element_id' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeDegreesOfFreedomSpecFields extends AbstractEnum {\n\n  const AD_HANDLE_TYPE = 'ad_handle_type';\n  const CREATIVE_FEATURES_SPEC = 'creative_features_spec';\n  const DEGREES_OF_FREEDOM_TYPE = 'degrees_of_freedom_type';\n  const IMAGE_TRANSFORMATION_TYPES = 'image_transformation_types';\n  const MULTI_MEDIA_TRANSFORMATION_TYPE = 'multi_media_transformation_type';\n  const STORIES_TRANSFORMATION_TYPES = 'stories_transformation_types';\n  const TEXT_TRANSFORMATION_TYPES = 'text_transformation_types';\n  const VIDEO_TRANSFORMATION_TYPES = 'video_transformation_types';\n\n  public function getFieldTypes() {\n    return array(\n      'ad_handle_type' => 'string',\n      'creative_features_spec' => 'Object',\n      'degrees_of_freedom_type' => 'string',\n      'image_transformation_types' => 'list<string>',\n      'multi_media_transformation_type' => 'string',\n      'stories_transformation_types' => 'list<string>',\n      'text_transformation_types' => 'list<string>',\n      'video_transformation_types' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeFacebookBrandedContentFields extends AbstractEnum {\n\n  const SHARED_TO_SPONSOR_STATUS = 'shared_to_sponsor_status';\n  const SPONSOR_PAGE_ID = 'sponsor_page_id';\n  const SPONSOR_RELATIONSHIP = 'sponsor_relationship';\n\n  public function getFieldTypes() {\n    return array(\n      'shared_to_sponsor_status' => 'string',\n      'sponsor_page_id' => 'string',\n      'sponsor_relationship' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeFields extends AbstractEnum {\n\n  const ACCOUNT_ID = 'account_id';\n  const ACTOR_ID = 'actor_id';\n  const ADLABELS = 'adlabels';\n  const APPLINK_TREATMENT = 'applink_treatment';\n  const ASSET_FEED_SPEC = 'asset_feed_spec';\n  const AUTHORIZATION_CATEGORY = 'authorization_category';\n  const AUTO_UPDATE = 'auto_update';\n  const BODY = 'body';\n  const BRANDED_CONTENT = 'branded_content';\n  const BRANDED_CONTENT_SPONSOR_PAGE_ID = 'branded_content_sponsor_page_id';\n  const BUNDLE_FOLDER_ID = 'bundle_folder_id';\n  const CALL_TO_ACTION_TYPE = 'call_to_action_type';\n  const CATEGORIZATION_CRITERIA = 'categorization_criteria';\n  const CATEGORY_MEDIA_SOURCE = 'category_media_source';\n  const COLLABORATIVE_ADS_LSB_IMAGE_BANK_ID = 'collaborative_ads_lsb_image_bank_id';\n  const DEGREES_OF_FREEDOM_SPEC = 'degrees_of_freedom_spec';\n  const DESTINATION_SET_ID = 'destination_set_id';\n  const DYNAMIC_AD_VOICE = 'dynamic_ad_voice';\n  const EFFECTIVE_AUTHORIZATION_CATEGORY = 'effective_authorization_category';\n  const EFFECTIVE_INSTAGRAM_MEDIA_ID = 'effective_instagram_media_id';\n  const EFFECTIVE_INSTAGRAM_STORY_ID = 'effective_instagram_story_id';\n  const EFFECTIVE_OBJECT_STORY_ID = 'effective_object_story_id';\n  const ENABLE_DIRECT_INSTALL = 'enable_direct_install';\n  const ENABLE_LAUNCH_INSTANT_APP = 'enable_launch_instant_app';\n  const FACEBOOK_BRANDED_CONTENT = 'facebook_branded_content';\n  const ID = 'id';\n  const IMAGE_CROPS = 'image_crops';\n  const IMAGE_HASH = 'image_hash';\n  const IMAGE_URL = 'image_url';\n  const INSTAGRAM_ACTOR_ID = 'instagram_actor_id';\n  const INSTAGRAM_BRANDED_CONTENT = 'instagram_branded_content';\n  const INSTAGRAM_PERMALINK_URL = 'instagram_permalink_url';\n  const INSTAGRAM_STORY_ID = 'instagram_story_id';\n  const INSTAGRAM_USER_ID = 'instagram_user_id';\n  const INTERACTIVE_COMPONENTS_SPEC = 'interactive_components_spec';\n  const LINK_DEEP_LINK_URL = 'link_deep_link_url';\n  const LINK_DESTINATION_DISPLAY_URL = 'link_destination_display_url';\n  const LINK_OG_ID = 'link_og_id';\n  const LINK_URL = 'link_url';\n  const MESSENGER_SPONSORED_MESSAGE = 'messenger_sponsored_message';\n  const NAME = 'name';\n  const OBJECT_ID = 'object_id';\n  const OBJECT_STORE_URL = 'object_store_url';\n  const OBJECT_STORY_ID = 'object_story_id';\n  const OBJECT_STORY_SPEC = 'object_story_spec';\n  const OBJECT_TYPE = 'object_type';\n  const OBJECT_URL = 'object_url';\n  const OMNICHANNEL_LINK_SPEC = 'omnichannel_link_spec';\n  const PLACE_PAGE_SET_ID = 'place_page_set_id';\n  const PLATFORM_CUSTOMIZATIONS = 'platform_customizations';\n  const PLAYABLE_ASSET_ID = 'playable_asset_id';\n  const PORTRAIT_CUSTOMIZATIONS = 'portrait_customizations';\n  const PRODUCT_SET_ID = 'product_set_id';\n  const RECOMMENDER_SETTINGS = 'recommender_settings';\n  const SOURCE_INSTAGRAM_MEDIA_ID = 'source_instagram_media_id';\n  const STATUS = 'status';\n  const TEMPLATE_URL = 'template_url';\n  const TEMPLATE_URL_SPEC = 'template_url_spec';\n  const THUMBNAIL_ID = 'thumbnail_id';\n  const THUMBNAIL_URL = 'thumbnail_url';\n  const TITLE = 'title';\n  const URL_TAGS = 'url_tags';\n  const USE_PAGE_ACTOR_OVERRIDE = 'use_page_actor_override';\n  const VIDEO_ID = 'video_id';\n  const CALL_TO_ACTION = 'call_to_action';\n  const IMAGE_FILE = 'image_file';\n  const IS_DCO_INTERNAL = 'is_dco_internal';\n\n  public function getFieldTypes() {\n    return array(\n      'account_id' => 'string',\n      'actor_id' => 'string',\n      'adlabels' => 'list<AdLabel>',\n      'applink_treatment' => 'string',\n      'asset_feed_spec' => 'AdAssetFeedSpec',\n      'authorization_category' => 'string',\n      'auto_update' => 'bool',\n      'body' => 'string',\n      'branded_content' => 'AdCreativeBrandedContentAds',\n      'branded_content_sponsor_page_id' => 'string',\n      'bundle_folder_id' => 'string',\n      'call_to_action_type' => 'CallToActionType',\n      'categorization_criteria' => 'string',\n      'category_media_source' => 'string',\n      'collaborative_ads_lsb_image_bank_id' => 'string',\n      'degrees_of_freedom_spec' => 'AdCreativeDegreesOfFreedomSpec',\n      'destination_set_id' => 'string',\n      'dynamic_ad_voice' => 'string',\n      'effective_authorization_category' => 'string',\n      'effective_instagram_media_id' => 'string',\n      'effective_instagram_story_id' => 'string',\n      'effective_object_story_id' => 'string',\n      'enable_direct_install' => 'bool',\n      'enable_launch_instant_app' => 'bool',\n      'facebook_branded_content' => 'AdCreativeFacebookBrandedContent',\n      'id' => 'string',\n      'image_crops' => 'AdsImageCrops',\n      'image_hash' => 'string',\n      'image_url' => 'string',\n      'instagram_actor_id' => 'string',\n      'instagram_branded_content' => 'AdCreativeInstagramBrandedContent',\n      'instagram_permalink_url' => 'string',\n      'instagram_story_id' => 'string',\n      'instagram_user_id' => 'string',\n      'interactive_components_spec' => 'AdCreativeInteractiveComponentsSpec',\n      'link_deep_link_url' => 'string',\n      'link_destination_display_url' => 'string',\n      'link_og_id' => 'string',\n      'link_url' => 'string',\n      'messenger_sponsored_message' => 'string',\n      'name' => 'string',\n      'object_id' => 'string',\n      'object_store_url' => 'string',\n      'object_story_id' => 'string',\n      'object_story_spec' => 'AdCreativeObjectStorySpec',\n      'object_type' => 'ObjectType',\n      'object_url' => 'string',\n      'omnichannel_link_spec' => 'AdCreativeOmnichannelLinkSpec',\n      'place_page_set_id' => 'string',\n      'platform_customizations' => 'AdCreativePlatformCustomization',\n      'playable_asset_id' => 'string',\n      'portrait_customizations' => 'AdCreativePortraitCustomizations',\n      'product_set_id' => 'string',\n      'recommender_settings' => 'AdCreativeRecommenderSettings',\n      'source_instagram_media_id' => 'string',\n      'status' => 'Status',\n      'template_url' => 'string',\n      'template_url_spec' => 'AdCreativeTemplateURLSpec',\n      'thumbnail_id' => 'string',\n      'thumbnail_url' => 'string',\n      'title' => 'string',\n      'url_tags' => 'string',\n      'use_page_actor_override' => 'bool',\n      'video_id' => 'string',\n      'call_to_action' => 'Object',\n      'image_file' => 'string',\n      'is_dco_internal' => 'bool',\n    );\n  }\n}\n", "num_lines": 180}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeInsightsFields extends AbstractEnum {\n\n  const AESTHETICS = 'aesthetics';\n\n  public function getFieldTypes() {\n    return array(\n      'aesthetics' => 'list<map<string, string>>',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeInstagramBrandedContentFields extends AbstractEnum {\n\n  const SPONSOR_ID = 'sponsor_id';\n\n  public function getFieldTypes() {\n    return array(\n      'sponsor_id' => 'string',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeInteractiveComponentsSpecFields extends AbstractEnum {\n\n  const CHILD_ATTACHMENTS = 'child_attachments';\n  const COMPONENTS = 'components';\n\n  public function getFieldTypes() {\n    return array(\n      'child_attachments' => 'list<Object>',\n      'components' => 'list<Object>',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataAppLinkSpecFields extends AbstractEnum {\n\n  const ANDROID = 'android';\n  const IOS = 'ios';\n  const IPAD = 'ipad';\n  const IPHONE = 'iphone';\n\n  public function getFieldTypes() {\n    return array(\n      'android' => 'list<AndroidAppLink>',\n      'ios' => 'list<IosAppLink>',\n      'ipad' => 'list<IosAppLink>',\n      'iphone' => 'list<IosAppLink>',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataCallToActionFields extends AbstractEnum {\n\n  const TYPE = 'type';\n  const VALUE = 'value';\n\n  public function getFieldTypes() {\n    return array(\n      'type' => 'Type',\n      'value' => 'AdCreativeLinkDataCallToActionValue',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataCallToActionValueFields extends AbstractEnum {\n\n  const APP_DESTINATION = 'app_destination';\n  const APP_LINK = 'app_link';\n  const APPLICATION = 'application';\n  const EVENT_ID = 'event_id';\n  const LEAD_GEN_FORM_ID = 'lead_gen_form_id';\n  const LINK = 'link';\n  const LINK_CAPTION = 'link_caption';\n  const LINK_FORMAT = 'link_format';\n  const PAGE = 'page';\n  const PRODUCT_LINK = 'product_link';\n  const WHATSAPP_NUMBER = 'whatsapp_number';\n\n  public function getFieldTypes() {\n    return array(\n      'app_destination' => 'string',\n      'app_link' => 'string',\n      'application' => 'string',\n      'event_id' => 'string',\n      'lead_gen_form_id' => 'string',\n      'link' => 'string',\n      'link_caption' => 'string',\n      'link_format' => 'string',\n      'page' => 'string',\n      'product_link' => 'string',\n      'whatsapp_number' => 'string',\n    );\n  }\n}\n", "num_lines": 68}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataChildAttachmentFields extends AbstractEnum {\n\n  const CALL_TO_ACTION = 'call_to_action';\n  const CAPTION = 'caption';\n  const DESCRIPTION = 'description';\n  const IMAGE_CROPS = 'image_crops';\n  const IMAGE_HASH = 'image_hash';\n  const LINK = 'link';\n  const NAME = 'name';\n  const PICTURE = 'picture';\n  const PLACE_DATA = 'place_data';\n  const STATIC_CARD = 'static_card';\n  const VIDEO_ID = 'video_id';\n\n  public function getFieldTypes() {\n    return array(\n      'call_to_action' => 'AdCreativeLinkDataCallToAction',\n      'caption' => 'string',\n      'description' => 'string',\n      'image_crops' => 'AdsImageCrops',\n      'image_hash' => 'string',\n      'link' => 'string',\n      'name' => 'string',\n      'picture' => 'string',\n      'place_data' => 'AdCreativePlaceData',\n      'static_card' => 'bool',\n      'video_id' => 'string',\n    );\n  }\n}\n", "num_lines": 68}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataFields extends AbstractEnum {\n\n  const AD_CONTEXT = 'ad_context';\n  const ADDITIONAL_IMAGE_INDEX = 'additional_image_index';\n  const APP_LINK_SPEC = 'app_link_spec';\n  const ATTACHMENT_STYLE = 'attachment_style';\n  const BRANDED_CONTENT_SHARED_TO_SPONSOR_STATUS = 'branded_content_shared_to_sponsor_status';\n  const BRANDED_CONTENT_SPONSOR_PAGE_ID = 'branded_content_sponsor_page_id';\n  const CALL_TO_ACTION = 'call_to_action';\n  const CAPTION = 'caption';\n  const CHILD_ATTACHMENTS = 'child_attachments';\n  const COLLECTION_THUMBNAILS = 'collection_thumbnails';\n  const CUSTOMIZATION_RULES_SPEC = 'customization_rules_spec';\n  const DESCRIPTION = 'description';\n  const EVENT_ID = 'event_id';\n  const FORCE_SINGLE_LINK = 'force_single_link';\n  const FORMAT_OPTION = 'format_option';\n  const IMAGE_CROPS = 'image_crops';\n  const IMAGE_HASH = 'image_hash';\n  const IMAGE_LAYER_SPECS = 'image_layer_specs';\n  const IMAGE_OVERLAY_SPEC = 'image_overlay_spec';\n  const LINK = 'link';\n  const MESSAGE = 'message';\n  const MULTI_SHARE_END_CARD = 'multi_share_end_card';\n  const MULTI_SHARE_OPTIMIZED = 'multi_share_optimized';\n  const NAME = 'name';\n  const OFFER_ID = 'offer_id';\n  const PAGE_WELCOME_MESSAGE = 'page_welcome_message';\n  const PICTURE = 'picture';\n  const POST_CLICK_CONFIGURATION = 'post_click_configuration';\n  const PREFERRED_IMAGE_TAGS = 'preferred_image_tags';\n  const RETAILER_ITEM_IDS = 'retailer_item_ids';\n  const SHOW_MULTIPLE_IMAGES = 'show_multiple_images';\n  const STATIC_FALLBACK_SPEC = 'static_fallback_spec';\n  const USE_FLEXIBLE_IMAGE_ASPECT_RATIO = 'use_flexible_image_aspect_ratio';\n\n  public function getFieldTypes() {\n    return array(\n      'ad_context' => 'string',\n      'additional_image_index' => 'int',\n      'app_link_spec' => 'AdCreativeLinkDataAppLinkSpec',\n      'attachment_style' => 'AttachmentStyle',\n      'branded_content_shared_to_sponsor_status' => 'string',\n      'branded_content_sponsor_page_id' => 'string',\n      'call_to_action' => 'AdCreativeLinkDataCallToAction',\n      'caption' => 'string',\n      'child_attachments' => 'list<AdCreativeLinkDataChildAttachment>',\n      'collection_thumbnails' => 'list<AdCreativeCollectionThumbnailInfo>',\n      'customization_rules_spec' => 'list<AdCustomizationRuleSpec>',\n      'description' => 'string',\n      'event_id' => 'string',\n      'force_single_link' => 'bool',\n      'format_option' => 'FormatOption',\n      'image_crops' => 'AdsImageCrops',\n      'image_hash' => 'string',\n      'image_layer_specs' => 'list<AdCreativeLinkDataImageLayerSpec>',\n      'image_overlay_spec' => 'AdCreativeLinkDataImageOverlaySpec',\n      'link' => 'string',\n      'message' => 'string',\n      'multi_share_end_card' => 'bool',\n      'multi_share_optimized' => 'bool',\n      'name' => 'string',\n      'offer_id' => 'string',\n      'page_welcome_message' => 'string',\n      'picture' => 'string',\n      'post_click_configuration' => 'AdCreativePostClickConfiguration',\n      'preferred_image_tags' => 'list<string>',\n      'retailer_item_ids' => 'list<string>',\n      'show_multiple_images' => 'bool',\n      'static_fallback_spec' => 'AdCreativeStaticFallbackSpec',\n      'use_flexible_image_aspect_ratio' => 'bool',\n    );\n  }\n}\n", "num_lines": 112}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataImageLayerSpecFields extends AbstractEnum {\n\n  const BLENDING_MODE = 'blending_mode';\n  const CONTENT = 'content';\n  const FRAME_IMAGE_HASH = 'frame_image_hash';\n  const FRAME_SOURCE = 'frame_source';\n  const IMAGE_SOURCE = 'image_source';\n  const LAYER_TYPE = 'layer_type';\n  const OPACITY = 'opacity';\n  const OVERLAY_POSITION = 'overlay_position';\n  const OVERLAY_SHAPE = 'overlay_shape';\n  const SCALE = 'scale';\n  const SHAPE_COLOR = 'shape_color';\n  const TEXT_COLOR = 'text_color';\n  const TEXT_FONT = 'text_font';\n\n  public function getFieldTypes() {\n    return array(\n      'blending_mode' => 'BlendingMode',\n      'content' => 'Object',\n      'frame_image_hash' => 'string',\n      'frame_source' => 'FrameSource',\n      'image_source' => 'ImageSource',\n      'layer_type' => 'LayerType',\n      'opacity' => 'int',\n      'overlay_position' => 'OverlayPosition',\n      'overlay_shape' => 'OverlayShape',\n      'scale' => 'int',\n      'shape_color' => 'string',\n      'text_color' => 'string',\n      'text_font' => 'TextFont',\n    );\n  }\n}\n", "num_lines": 72}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataImageOverlaySpecFields extends AbstractEnum {\n\n  const CUSTOM_TEXT_TYPE = 'custom_text_type';\n  const FLOAT_WITH_MARGIN = 'float_with_margin';\n  const OVERLAY_TEMPLATE = 'overlay_template';\n  const POSITION = 'position';\n  const TEXT_FONT = 'text_font';\n  const TEXT_TEMPLATE_TAGS = 'text_template_tags';\n  const TEXT_TYPE = 'text_type';\n  const THEME_COLOR = 'theme_color';\n\n  public function getFieldTypes() {\n    return array(\n      'custom_text_type' => 'CustomTextType',\n      'float_with_margin' => 'bool',\n      'overlay_template' => 'OverlayTemplate',\n      'position' => 'Position',\n      'text_font' => 'TextFont',\n      'text_template_tags' => 'list<string>',\n      'text_type' => 'TextType',\n      'theme_color' => 'ThemeColor',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataSponsorshipInfoSpecFields extends AbstractEnum {\n\n  const SPONSOR_IMAGE_URL = 'sponsor_image_url';\n  const SPONSOR_NAME = 'sponsor_name';\n\n  public function getFieldTypes() {\n    return array(\n      'sponsor_image_url' => 'string',\n      'sponsor_name' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeLinkDataTemplateVideoSpecFields extends AbstractEnum {\n\n  const CATEGORIZATION_CRITERIA = 'categorization_criteria';\n  const CUSTOMIZATION = 'customization';\n  const TEMPLATE_ID = 'template_id';\n\n  public function getFieldTypes() {\n    return array(\n      'categorization_criteria' => 'string',\n      'customization' => 'list<map<string, string>>',\n      'template_id' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeObjectStorySpecFields extends AbstractEnum {\n\n  const INSTAGRAM_ACTOR_ID = 'instagram_actor_id';\n  const LINK_DATA = 'link_data';\n  const PAGE_ID = 'page_id';\n  const PHOTO_DATA = 'photo_data';\n  const TEMPLATE_DATA = 'template_data';\n  const TEXT_DATA = 'text_data';\n  const VIDEO_DATA = 'video_data';\n\n  public function getFieldTypes() {\n    return array(\n      'instagram_actor_id' => 'string',\n      'link_data' => 'AdCreativeLinkData',\n      'page_id' => 'string',\n      'photo_data' => 'AdCreativePhotoData',\n      'template_data' => 'AdCreativeLinkData',\n      'text_data' => 'AdCreativeTextData',\n      'video_data' => 'AdCreativeVideoData',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeOmnichannelLinkSpecFields extends AbstractEnum {\n\n  const APP = 'app';\n  const WEB = 'web';\n\n  public function getFieldTypes() {\n    return array(\n      'app' => 'Object',\n      'web' => 'Object',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativePhotoDataFields extends AbstractEnum {\n\n  const BRANDED_CONTENT_SHARED_TO_SPONSOR_STATUS = 'branded_content_shared_to_sponsor_status';\n  const BRANDED_CONTENT_SPONSOR_PAGE_ID = 'branded_content_sponsor_page_id';\n  const CAPTION = 'caption';\n  const IMAGE_HASH = 'image_hash';\n  const PAGE_WELCOME_MESSAGE = 'page_welcome_message';\n  const URL = 'url';\n\n  public function getFieldTypes() {\n    return array(\n      'branded_content_shared_to_sponsor_status' => 'string',\n      'branded_content_sponsor_page_id' => 'string',\n      'caption' => 'string',\n      'image_hash' => 'string',\n      'page_welcome_message' => 'string',\n      'url' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativePhotoDataMediaElementsFields extends AbstractEnum {\n\n  const ELEMENT_ID = 'element_id';\n  const ELEMENT_TYPE = 'element_type';\n  const X = 'x';\n  const Y = 'y';\n\n  public function getFieldTypes() {\n    return array(\n      'element_id' => 'string',\n      'element_type' => 'string',\n      'x' => 'float',\n      'y' => 'float',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativePlaceDataFields extends AbstractEnum {\n\n  const ADDRESS_STRING = 'address_string';\n  const LABEL = 'label';\n  const LATITUDE = 'latitude';\n  const LOCATION_SOURCE_ID = 'location_source_id';\n  const LONGITUDE = 'longitude';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'address_string' => 'string',\n      'label' => 'string',\n      'latitude' => 'float',\n      'location_source_id' => 'string',\n      'longitude' => 'float',\n      'type' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativePlatformCustomizationFields extends AbstractEnum {\n\n  const INSTAGRAM = 'instagram';\n\n  public function getFieldTypes() {\n    return array(\n      'instagram' => 'Object',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativePortraitCustomizationsFields extends AbstractEnum {\n\n  const CAROUSEL_DELIVERY_MODE = 'carousel_delivery_mode';\n  const SPECIFICATIONS = 'specifications';\n\n  public function getFieldTypes() {\n    return array(\n      'carousel_delivery_mode' => 'string',\n      'specifications' => 'list<Object>',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativePostClickConfigurationFields extends AbstractEnum {\n\n  const POST_CLICK_ITEM_DESCRIPTION = 'post_click_item_description';\n  const POST_CLICK_ITEM_HEADLINE = 'post_click_item_headline';\n\n  public function getFieldTypes() {\n    return array(\n      'post_click_item_description' => 'string',\n      'post_click_item_headline' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeRecommenderSettingsFields extends AbstractEnum {\n\n  const PREFERRED_EVENTS = 'preferred_events';\n  const PRODUCT_SALES_CHANNEL = 'product_sales_channel';\n\n  public function getFieldTypes() {\n    return array(\n      'preferred_events' => 'list<string>',\n      'product_sales_channel' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeStaticFallbackSpecFields extends AbstractEnum {\n\n  const CALL_TO_ACTION = 'call_to_action';\n  const DESCRIPTION = 'description';\n  const IMAGE_HASH = 'image_hash';\n  const LINK = 'link';\n  const MESSAGE = 'message';\n  const NAME = 'name';\n\n  public function getFieldTypes() {\n    return array(\n      'call_to_action' => 'AdCreativeLinkDataCallToAction',\n      'description' => 'string',\n      'image_hash' => 'string',\n      'link' => 'string',\n      'message' => 'string',\n      'name' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeTemplateURLSpecFields extends AbstractEnum {\n\n  const ANDROID = 'android';\n  const CONFIG = 'config';\n  const IOS = 'ios';\n  const IPAD = 'ipad';\n  const IPHONE = 'iphone';\n  const WEB = 'web';\n  const WINDOWS_PHONE = 'windows_phone';\n\n  public function getFieldTypes() {\n    return array(\n      'android' => 'Object',\n      'config' => 'Object',\n      'ios' => 'Object',\n      'ipad' => 'Object',\n      'iphone' => 'Object',\n      'web' => 'Object',\n      'windows_phone' => 'Object',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeTextDataFields extends AbstractEnum {\n\n  const MESSAGE = 'message';\n\n  public function getFieldTypes() {\n    return array(\n      'message' => 'string',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCreativeVideoDataFields extends AbstractEnum {\n\n  const ADDITIONAL_IMAGE_INDEX = 'additional_image_index';\n  const BRANDED_CONTENT_SHARED_TO_SPONSOR_STATUS = 'branded_content_shared_to_sponsor_status';\n  const BRANDED_CONTENT_SPONSOR_PAGE_ID = 'branded_content_sponsor_page_id';\n  const CALL_TO_ACTION = 'call_to_action';\n  const COLLECTION_THUMBNAILS = 'collection_thumbnails';\n  const CUSTOMIZATION_RULES_SPEC = 'customization_rules_spec';\n  const IMAGE_HASH = 'image_hash';\n  const IMAGE_URL = 'image_url';\n  const LINK_DESCRIPTION = 'link_description';\n  const MESSAGE = 'message';\n  const OFFER_ID = 'offer_id';\n  const PAGE_WELCOME_MESSAGE = 'page_welcome_message';\n  const POST_CLICK_CONFIGURATION = 'post_click_configuration';\n  const RETAILER_ITEM_IDS = 'retailer_item_ids';\n  const TARGETING = 'targeting';\n  const TITLE = 'title';\n  const VIDEO_ID = 'video_id';\n\n  public function getFieldTypes() {\n    return array(\n      'additional_image_index' => 'int',\n      'branded_content_shared_to_sponsor_status' => 'string',\n      'branded_content_sponsor_page_id' => 'string',\n      'call_to_action' => 'AdCreativeLinkDataCallToAction',\n      'collection_thumbnails' => 'list<AdCreativeCollectionThumbnailInfo>',\n      'customization_rules_spec' => 'list<AdCustomizationRuleSpec>',\n      'image_hash' => 'string',\n      'image_url' => 'string',\n      'link_description' => 'string',\n      'message' => 'string',\n      'offer_id' => 'string',\n      'page_welcome_message' => 'string',\n      'post_click_configuration' => 'AdCreativePostClickConfiguration',\n      'retailer_item_ids' => 'list<string>',\n      'targeting' => 'Targeting',\n      'title' => 'string',\n      'video_id' => 'string',\n    );\n  }\n}\n", "num_lines": 80}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdCustomizationRuleSpecFields extends AbstractEnum {\n\n  const CAPTION = 'caption';\n  const CUSTOMIZATION_SPEC = 'customization_spec';\n  const DESCRIPTION = 'description';\n  const IMAGE_HASH = 'image_hash';\n  const LINK = 'link';\n  const MESSAGE = 'message';\n  const NAME = 'name';\n  const PRIORITY = 'priority';\n  const TEMPLATE_URL_SPEC = 'template_url_spec';\n  const VIDEO_ID = 'video_id';\n\n  public function getFieldTypes() {\n    return array(\n      'caption' => 'string',\n      'customization_spec' => 'Object',\n      'description' => 'string',\n      'image_hash' => 'string',\n      'link' => 'string',\n      'message' => 'string',\n      'name' => 'string',\n      'priority' => 'int',\n      'template_url_spec' => 'AdCreativeTemplateURLSpec',\n      'video_id' => 'int',\n    );\n  }\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdDynamicCreativeFields extends AbstractEnum {\n\n  const PREVIEW_URL = 'preview_url';\n\n  public function getFieldTypes() {\n    return array(\n      'preview_url' => 'string',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdEntityTargetSpendFields extends AbstractEnum {\n\n  const AMOUNT = 'amount';\n  const HAS_ERROR = 'has_error';\n  const IS_ACCURATE = 'is_accurate';\n  const IS_PRORATED = 'is_prorated';\n  const IS_UPDATING = 'is_updating';\n\n  public function getFieldTypes() {\n    return array(\n      'amount' => 'string',\n      'has_error' => 'bool',\n      'is_accurate' => 'bool',\n      'is_prorated' => 'bool',\n      'is_updating' => 'bool',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdFields extends AbstractEnum {\n\n  const ACCOUNT_ID = 'account_id';\n  const AD_REVIEW_FEEDBACK = 'ad_review_feedback';\n  const ADLABELS = 'adlabels';\n  const ADSET = 'adset';\n  const ADSET_ID = 'adset_id';\n  const BID_AMOUNT = 'bid_amount';\n  const BID_INFO = 'bid_info';\n  const BID_TYPE = 'bid_type';\n  const CAMPAIGN = 'campaign';\n  const CAMPAIGN_ID = 'campaign_id';\n  const CONFIGURED_STATUS = 'configured_status';\n  const CONVERSION_DOMAIN = 'conversion_domain';\n  const CONVERSION_SPECS = 'conversion_specs';\n  const CREATED_TIME = 'created_time';\n  const CREATIVE = 'creative';\n  const DEMOLINK_HASH = 'demolink_hash';\n  const DISPLAY_SEQUENCE = 'display_sequence';\n  const EFFECTIVE_STATUS = 'effective_status';\n  const ENGAGEMENT_AUDIENCE = 'engagement_audience';\n  const FAILED_DELIVERY_CHECKS = 'failed_delivery_checks';\n  const ID = 'id';\n  const ISSUES_INFO = 'issues_info';\n  const LAST_UPDATED_BY_APP_ID = 'last_updated_by_app_id';\n  const META_REWARD_ADGROUP_STATUS = 'meta_reward_adgroup_status';\n  const NAME = 'name';\n  const PREVIEW_SHAREABLE_LINK = 'preview_shareable_link';\n  const PRIORITY = 'priority';\n  const RECOMMENDATIONS = 'recommendations';\n  const SOURCE_AD = 'source_ad';\n  const SOURCE_AD_ID = 'source_ad_id';\n  const STATUS = 'status';\n  const TARGETING = 'targeting';\n  const TRACKING_AND_CONVERSION_WITH_DEFAULTS = 'tracking_and_conversion_with_defaults';\n  const TRACKING_SPECS = 'tracking_specs';\n  const UPDATED_TIME = 'updated_time';\n  const ADSET_SPEC = 'adset_spec';\n  const AUDIENCE_ID = 'audience_id';\n  const DATE_FORMAT = 'date_format';\n  const DRAFT_ADGROUP_ID = 'draft_adgroup_id';\n  const EXECUTION_OPTIONS = 'execution_options';\n  const INCLUDE_DEMOLINK_HASHES = 'include_demolink_hashes';\n  const FILENAME = 'filename';\n\n  public function getFieldTypes() {\n    return array(\n      'account_id' => 'string',\n      'ad_review_feedback' => 'AdgroupReviewFeedback',\n      'adlabels' => 'list<AdLabel>',\n      'adset' => 'AdSet',\n      'adset_id' => 'string',\n      'bid_amount' => 'int',\n      'bid_info' => 'map<string, unsigned int>',\n      'bid_type' => 'BidType',\n      'campaign' => 'Campaign',\n      'campaign_id' => 'string',\n      'configured_status' => 'ConfiguredStatus',\n      'conversion_domain' => 'string',\n      'conversion_specs' => 'list<ConversionActionQuery>',\n      'created_time' => 'datetime',\n      'creative' => 'AdCreative',\n      'demolink_hash' => 'string',\n      'display_sequence' => 'int',\n      'effective_status' => 'EffectiveStatus',\n      'engagement_audience' => 'bool',\n      'failed_delivery_checks' => 'list<DeliveryCheck>',\n      'id' => 'string',\n      'issues_info' => 'list<AdgroupIssuesInfo>',\n      'last_updated_by_app_id' => 'string',\n      'meta_reward_adgroup_status' => 'string',\n      'name' => 'string',\n      'preview_shareable_link' => 'string',\n      'priority' => 'unsigned int',\n      'recommendations' => 'list<AdRecommendation>',\n      'source_ad' => 'Ad',\n      'source_ad_id' => 'string',\n      'status' => 'Status',\n      'targeting' => 'Targeting',\n      'tracking_and_conversion_with_defaults' => 'TrackingAndConversionWithDefaults',\n      'tracking_specs' => 'list<ConversionActionQuery>',\n      'updated_time' => 'datetime',\n      'adset_spec' => 'AdSet',\n      'audience_id' => 'string',\n      'date_format' => 'string',\n      'draft_adgroup_id' => 'string',\n      'execution_options' => 'list<ExecutionOptions>',\n      'include_demolink_hashes' => 'bool',\n      'filename' => 'file',\n    );\n  }\n}\n", "num_lines": 130}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdgroupIssuesInfoFields extends AbstractEnum {\n\n  const ERROR_CODE = 'error_code';\n  const ERROR_MESSAGE = 'error_message';\n  const ERROR_SUMMARY = 'error_summary';\n  const ERROR_TYPE = 'error_type';\n  const LEVEL = 'level';\n\n  public function getFieldTypes() {\n    return array(\n      'error_code' => 'int',\n      'error_message' => 'string',\n      'error_summary' => 'string',\n      'error_type' => 'string',\n      'level' => 'string',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdgroupMetadataFields extends AbstractEnum {\n\n  const AD_STANDARD_ENHANCEMENTS_EDIT_SOURCE = 'ad_standard_enhancements_edit_source';\n  const ADGROUP_CREATION_SOURCE = 'adgroup_creation_source';\n  const ADGROUP_EDIT_SOURCE = 'adgroup_edit_source';\n  const CAROUSEL_STYLE = 'carousel_style';\n  const CAROUSEL_WITH_STATIC_CARD_STYLE = 'carousel_with_static_card_style';\n\n  public function getFieldTypes() {\n    return array(\n      'ad_standard_enhancements_edit_source' => 'int',\n      'adgroup_creation_source' => 'string',\n      'adgroup_edit_source' => 'string',\n      'carousel_style' => 'string',\n      'carousel_with_static_card_style' => 'string',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdgroupPlacementSpecificReviewFeedbackFields extends AbstractEnum {\n\n  const ACCOUNT_ADMIN = 'account_admin';\n  const AD = 'ad';\n  const ADS_CONVERSION_EXPERIENCES = 'ads_conversion_experiences';\n  const B2C = 'b2c';\n  const B2C_COMMERCE_UNIFIED = 'b2c_commerce_unified';\n  const BSG = 'bsg';\n  const CITY_COMMUNITY = 'city_community';\n  const COMMERCE = 'commerce';\n  const DAILY_DEALS = 'daily_deals';\n  const DAILY_DEALS_LEGACY = 'daily_deals_legacy';\n  const DPA = 'dpa';\n  const DRI_COPYRIGHT = 'dri_copyright';\n  const DRI_COUNTERFEIT = 'dri_counterfeit';\n  const FACEBOOK = 'facebook';\n  const FACEBOOK_PAGES_LIVE_SHOPPING = 'facebook_pages_live_shopping';\n  const INDEPENDENT_WORK = 'independent_work';\n  const INSTAGRAM = 'instagram';\n  const INSTAGRAM_SHOP = 'instagram_shop';\n  const JOB_SEARCH = 'job_search';\n  const LEAD_GEN_HONEYPOT = 'lead_gen_honeypot';\n  const MARKETPLACE = 'marketplace';\n  const MARKETPLACE_HOME_RENTALS = 'marketplace_home_rentals';\n  const MARKETPLACE_HOME_SALES = 'marketplace_home_sales';\n  const MARKETPLACE_MOTORS = 'marketplace_motors';\n  const MARKETPLACE_SHOPS = 'marketplace_shops';\n  const MAX_REVIEW_PLACEMENTS = 'max_review_placements';\n  const NEIGHBORHOODS = 'neighborhoods';\n  const PAGE_ADMIN = 'page_admin';\n  const PRODUCT = 'product';\n  const PRODUCT_SERVICE = 'product_service';\n  const PROFILE = 'profile';\n  const SELLER = 'seller';\n  const SHOPS = 'shops';\n  const TRAFFIC_QUALITY = 'traffic_quality';\n  const UNIFIED_COMMERCE_CONTENT = 'unified_commerce_content';\n  const WHATSAPP = 'whatsapp';\n\n  public function getFieldTypes() {\n    return array(\n      'account_admin' => 'map<string, string>',\n      'ad' => 'map<string, string>',\n      'ads_conversion_experiences' => 'map<string, string>',\n      'b2c' => 'map<string, string>',\n      'b2c_commerce_unified' => 'map<string, string>',\n      'bsg' => 'map<string, string>',\n      'city_community' => 'map<string, string>',\n      'commerce' => 'map<string, string>',\n      'daily_deals' => 'map<string, string>',\n      'daily_deals_legacy' => 'map<string, string>',\n      'dpa' => 'map<string, string>',\n      'dri_copyright' => 'map<string, string>',\n      'dri_counterfeit' => 'map<string, string>',\n      'facebook' => 'map<string, string>',\n      'facebook_pages_live_shopping' => 'map<string, string>',\n      'independent_work' => 'map<string, string>',\n      'instagram' => 'map<string, string>',\n      'instagram_shop' => 'map<string, string>',\n      'job_search' => 'map<string, string>',\n      'lead_gen_honeypot' => 'map<string, string>',\n      'marketplace' => 'map<string, string>',\n      'marketplace_home_rentals' => 'map<string, string>',\n      'marketplace_home_sales' => 'map<string, string>',\n      'marketplace_motors' => 'map<string, string>',\n      'marketplace_shops' => 'map<string, string>',\n      'max_review_placements' => 'map<string, string>',\n      'neighborhoods' => 'map<string, string>',\n      'page_admin' => 'map<string, string>',\n      'product' => 'map<string, string>',\n      'product_service' => 'map<string, string>',\n      'profile' => 'map<string, string>',\n      'seller' => 'map<string, string>',\n      'shops' => 'map<string, string>',\n      'traffic_quality' => 'map<string, string>',\n      'unified_commerce_content' => 'map<string, string>',\n      'whatsapp' => 'map<string, string>',\n    );\n  }\n}\n", "num_lines": 118}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdgroupReviewFeedbackFields extends AbstractEnum {\n\n  const FIELD_GLOBAL = 'global';\n  const PLACEMENT_SPECIFIC = 'placement_specific';\n\n  public function getFieldTypes() {\n    return array(\n      'global' => 'map<string, string>',\n      'placement_specific' => 'AdgroupPlacementSpecificReviewFeedback',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdImageFields extends AbstractEnum {\n\n  const ACCOUNT_ID = 'account_id';\n  const CREATED_TIME = 'created_time';\n  const CREATIVES = 'creatives';\n  const HASH = 'hash';\n  const HEIGHT = 'height';\n  const ID = 'id';\n  const IS_ASSOCIATED_CREATIVES_IN_ADGROUPS = 'is_associated_creatives_in_adgroups';\n  const NAME = 'name';\n  const ORIGINAL_HEIGHT = 'original_height';\n  const ORIGINAL_WIDTH = 'original_width';\n  const OWNER_BUSINESS = 'owner_business';\n  const PERMALINK_URL = 'permalink_url';\n  const STATUS = 'status';\n  const UPDATED_TIME = 'updated_time';\n  const URL = 'url';\n  const URL_128 = 'url_128';\n  const WIDTH = 'width';\n  const BYTES = 'bytes';\n  const COPY_FROM = 'copy_from';\n  const FILENAME = 'filename';\n\n  public function getFieldTypes() {\n    return array(\n      'account_id' => 'string',\n      'created_time' => 'datetime',\n      'creatives' => 'list<string>',\n      'hash' => 'string',\n      'height' => 'unsigned int',\n      'id' => 'string',\n      'is_associated_creatives_in_adgroups' => 'bool',\n      'name' => 'string',\n      'original_height' => 'unsigned int',\n      'original_width' => 'unsigned int',\n      'owner_business' => 'Business',\n      'permalink_url' => 'string',\n      'status' => 'Status',\n      'updated_time' => 'datetime',\n      'url' => 'string',\n      'url_128' => 'string',\n      'width' => 'unsigned int',\n      'bytes' => 'Object',\n      'copy_from' => 'Object',\n      'filename' => 'file',\n    );\n  }\n}\n", "num_lines": 86}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdKeywordsFields extends AbstractEnum {\n\n  const BRANDS = 'brands';\n  const PRODUCT_CATEGORIES = 'product_categories';\n  const PRODUCT_NAMES = 'product_names';\n  const SEARCH_TERMS = 'search_terms';\n\n  public function getFieldTypes() {\n    return array(\n      'brands' => 'list<string>',\n      'product_categories' => 'list<string>',\n      'product_names' => 'list<string>',\n      'search_terms' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdLabelFields extends AbstractEnum {\n\n  const ACCOUNT = 'account';\n  const CREATED_TIME = 'created_time';\n  const ID = 'id';\n  const NAME = 'name';\n  const UPDATED_TIME = 'updated_time';\n\n  public function getFieldTypes() {\n    return array(\n      'account' => 'AdAccount',\n      'created_time' => 'datetime',\n      'id' => 'string',\n      'name' => 'string',\n      'updated_time' => 'datetime',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdMonetizationPropertyFields extends AbstractEnum {\n\n  const OWNER_BUSINESS = 'owner_business';\n  const ID = 'id';\n\n  public function getFieldTypes() {\n    return array(\n      'owner_business' => 'Business',\n      'id' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdNetworkAnalyticsAsyncQueryResultFields extends AbstractEnum {\n\n  const DATA = 'data';\n  const ERROR = 'error';\n  const OMITTED_RESULTS = 'omitted_results';\n  const QUERY_ID = 'query_id';\n  const RESULTS = 'results';\n  const STATUS = 'status';\n\n  public function getFieldTypes() {\n    return array(\n      'data' => 'Object',\n      'error' => 'Object',\n      'omitted_results' => 'list<Object>',\n      'query_id' => 'string',\n      'results' => 'list<Object>',\n      'status' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdNetworkAnalyticsSyncQueryResultFields extends AbstractEnum {\n\n  const OMITTED_RESULTS = 'omitted_results';\n  const QUERY_ID = 'query_id';\n  const RESULTS = 'results';\n\n  public function getFieldTypes() {\n    return array(\n      'omitted_results' => 'list<Object>',\n      'query_id' => 'string',\n      'results' => 'list<Object>',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdPlacementFields extends AbstractEnum {\n\n  const BUNDLE_ID = 'bundle_id';\n  const DISPLAY_FORMAT = 'display_format';\n  const EXTERNAL_PLACEMENT_ID = 'external_placement_id';\n  const GOOGLE_DISPLAY_FORMAT = 'google_display_format';\n  const ID = 'id';\n  const NAME = 'name';\n  const PLACEMENT_GROUP = 'placement_group';\n  const PLATFORM = 'platform';\n  const STATUS = 'status';\n\n  public function getFieldTypes() {\n    return array(\n      'bundle_id' => 'string',\n      'display_format' => 'string',\n      'external_placement_id' => 'string',\n      'google_display_format' => 'string',\n      'id' => 'string',\n      'name' => 'string',\n      'placement_group' => 'Object',\n      'platform' => 'string',\n      'status' => 'string',\n    );\n  }\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdPlacePageSetFields extends AbstractEnum {\n\n  const ACCOUNT_ID = 'account_id';\n  const ID = 'id';\n  const LOCATION_TYPES = 'location_types';\n  const NAME = 'name';\n  const PAGES_COUNT = 'pages_count';\n  const PARENT_PAGE = 'parent_page';\n  const TARGETED_AREA_TYPE = 'targeted_area_type';\n\n  public function getFieldTypes() {\n    return array(\n      'account_id' => 'string',\n      'id' => 'string',\n      'location_types' => 'list<string>',\n      'name' => 'string',\n      'pages_count' => 'int',\n      'parent_page' => 'Page',\n      'targeted_area_type' => 'TargetedAreaType',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdPlacePageSetMetadataFields extends AbstractEnum {\n\n  const AUDIENCE = 'audience';\n  const CUSTOM = 'custom';\n  const EXTRA_DATA = 'extra_data';\n  const FIXED_RADIUS = 'fixed_radius';\n\n  public function getFieldTypes() {\n    return array(\n      'audience' => 'Object',\n      'custom' => 'Object',\n      'extra_data' => 'string',\n      'fixed_radius' => 'Object',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdPreviewFields extends AbstractEnum {\n\n  const BODY = 'body';\n  const TRANSFORMATION_SPEC = 'transformation_spec';\n  const CREATIVE = 'creative';\n  const POST = 'post';\n  const AD_FORMAT = 'ad_format';\n  const PRODUCT_ITEM_IDS = 'product_item_ids';\n\n  public function getFieldTypes() {\n    return array(\n      'body' => 'string',\n      'transformation_spec' => 'Object',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdPromotedObjectFields extends AbstractEnum {\n\n  const APPLICATION_ID = 'application_id';\n  const CONVERSION_GOAL_ID = 'conversion_goal_id';\n  const CUSTOM_CONVERSION_ID = 'custom_conversion_id';\n  const CUSTOM_EVENT_STR = 'custom_event_str';\n  const CUSTOM_EVENT_TYPE = 'custom_event_type';\n  const EVENT_ID = 'event_id';\n  const FUNDRAISER_CAMPAIGN_ID = 'fundraiser_campaign_id';\n  const MCME_CONVERSION_ID = 'mcme_conversion_id';\n  const OBJECT_STORE_URL = 'object_store_url';\n  const OFFER_ID = 'offer_id';\n  const OFFLINE_CONVERSION_DATA_SET_ID = 'offline_conversion_data_set_id';\n  const OMNICHANNEL_OBJECT = 'omnichannel_object';\n  const PAGE_ID = 'page_id';\n  const PIXEL_AGGREGATION_RULE = 'pixel_aggregation_rule';\n  const PIXEL_ID = 'pixel_id';\n  const PIXEL_RULE = 'pixel_rule';\n  const PLACE_PAGE_SET = 'place_page_set';\n  const PLACE_PAGE_SET_ID = 'place_page_set_id';\n  const PRODUCT_CATALOG_ID = 'product_catalog_id';\n  const PRODUCT_ITEM_ID = 'product_item_id';\n  const PRODUCT_SET_ID = 'product_set_id';\n  const RETENTION_DAYS = 'retention_days';\n\n  public function getFieldTypes() {\n    return array(\n      'application_id' => 'string',\n      'conversion_goal_id' => 'string',\n      'custom_conversion_id' => 'string',\n      'custom_event_str' => 'string',\n      'custom_event_type' => 'CustomEventType',\n      'event_id' => 'string',\n      'fundraiser_campaign_id' => 'string',\n      'mcme_conversion_id' => 'string',\n      'object_store_url' => 'string',\n      'offer_id' => 'string',\n      'offline_conversion_data_set_id' => 'string',\n      'omnichannel_object' => 'Object',\n      'page_id' => 'string',\n      'pixel_aggregation_rule' => 'string',\n      'pixel_id' => 'string',\n      'pixel_rule' => 'string',\n      'place_page_set' => 'AdPlacePageSet',\n      'place_page_set_id' => 'string',\n      'product_catalog_id' => 'string',\n      'product_item_id' => 'string',\n      'product_set_id' => 'string',\n      'retention_days' => 'string',\n    );\n  }\n}\n", "num_lines": 90}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRecommendationDataFields extends AbstractEnum {\n\n  const LINK = 'link';\n\n  public function getFieldTypes() {\n    return array(\n      'link' => 'string',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRecommendationFields extends AbstractEnum {\n\n  const BLAME_FIELD = 'blame_field';\n  const CODE = 'code';\n  const CONFIDENCE = 'confidence';\n  const IMPORTANCE = 'importance';\n  const MESSAGE = 'message';\n  const RECOMMENDATION_DATA = 'recommendation_data';\n  const TITLE = 'title';\n\n  public function getFieldTypes() {\n    return array(\n      'blame_field' => 'string',\n      'code' => 'int',\n      'confidence' => 'Confidence',\n      'importance' => 'Importance',\n      'message' => 'string',\n      'recommendation_data' => 'AdRecommendationData',\n      'title' => 'string',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdReportRunFields extends AbstractEnum {\n\n  const ACCOUNT_ID = 'account_id';\n  const ASYNC_PERCENT_COMPLETION = 'async_percent_completion';\n  const ASYNC_STATUS = 'async_status';\n  const DATE_START = 'date_start';\n  const DATE_STOP = 'date_stop';\n  const EMAILS = 'emails';\n  const FRIENDLY_NAME = 'friendly_name';\n  const ID = 'id';\n  const IS_BOOKMARKED = 'is_bookmarked';\n  const IS_RUNNING = 'is_running';\n  const SCHEDULE_ID = 'schedule_id';\n  const TIME_COMPLETED = 'time_completed';\n  const TIME_REF = 'time_ref';\n  const ACTION_ATTRIBUTION_WINDOWS = 'action_attribution_windows';\n  const ACTION_BREAKDOWNS = 'action_breakdowns';\n  const ACTION_REPORT_TIME = 'action_report_time';\n  const BREAKDOWNS = 'breakdowns';\n  const DATE_PRESET = 'date_preset';\n  const DEFAULT_SUMMARY = 'default_summary';\n  const EXPORT_COLUMNS = 'export_columns';\n  const EXPORT_FORMAT = 'export_format';\n  const EXPORT_NAME = 'export_name';\n  const FIELDS = 'fields';\n  const FILTERING = 'filtering';\n  const LEVEL = 'level';\n  const PRODUCT_ID_LIMIT = 'product_id_limit';\n  const SORT = 'sort';\n  const SUMMARY = 'summary';\n  const SUMMARY_ACTION_BREAKDOWNS = 'summary_action_breakdowns';\n  const TIME_INCREMENT = 'time_increment';\n  const TIME_RANGE = 'time_range';\n  const TIME_RANGES = 'time_ranges';\n  const USE_ACCOUNT_ATTRIBUTION_SETTING = 'use_account_attribution_setting';\n  const USE_UNIFIED_ATTRIBUTION_SETTING = 'use_unified_attribution_setting';\n\n  public function getFieldTypes() {\n    return array(\n      'account_id' => 'string',\n      'async_percent_completion' => 'unsigned int',\n      'async_status' => 'string',\n      'date_start' => 'string',\n      'date_stop' => 'string',\n      'emails' => 'list<string>',\n      'friendly_name' => 'string',\n      'id' => 'string',\n      'is_bookmarked' => 'bool',\n      'is_running' => 'bool',\n      'schedule_id' => 'string',\n      'time_completed' => 'unsigned int',\n      'time_ref' => 'unsigned int',\n      'action_attribution_windows' => 'list<ActionAttributionWindows>',\n      'action_breakdowns' => 'list<ActionBreakdowns>',\n      'action_report_time' => 'ActionReportTime',\n      'breakdowns' => 'list<Breakdowns>',\n      'date_preset' => 'DatePreset',\n      'default_summary' => 'bool',\n      'export_columns' => 'list<string>',\n      'export_format' => 'string',\n      'export_name' => 'string',\n      'fields' => 'list<string>',\n      'filtering' => 'list<Object>',\n      'level' => 'Level',\n      'product_id_limit' => 'int',\n      'sort' => 'list<string>',\n      'summary' => 'list<string>',\n      'summary_action_breakdowns' => 'list<SummaryActionBreakdowns>',\n      'time_increment' => 'string',\n      'time_range' => 'Object',\n      'time_ranges' => 'list<Object>',\n      'use_account_attribution_setting' => 'bool',\n      'use_unified_attribution_setting' => 'bool',\n    );\n  }\n}\n", "num_lines": 114}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleEvaluationSpecFields extends AbstractEnum {\n\n  const EVALUATION_TYPE = 'evaluation_type';\n  const FILTERS = 'filters';\n  const TRIGGER = 'trigger';\n  const ID = 'id';\n\n  public function getFieldTypes() {\n    return array(\n      'evaluation_type' => 'EvaluationType',\n      'filters' => 'list<AdRuleFilters>',\n      'trigger' => 'AdRuleTrigger',\n      'id' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleExecutionOptionsFields extends AbstractEnum {\n\n  const FIELD = 'field';\n  const OPERATOR = 'operator';\n  const VALUE = 'value';\n\n  public function getFieldTypes() {\n    return array(\n      'field' => 'string',\n      'operator' => 'Operator',\n      'value' => 'Object',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleExecutionSpecFields extends AbstractEnum {\n\n  const EXECUTION_OPTIONS = 'execution_options';\n  const EXECUTION_TYPE = 'execution_type';\n  const ID = 'id';\n\n  public function getFieldTypes() {\n    return array(\n      'execution_options' => 'list<AdRuleExecutionOptions>',\n      'execution_type' => 'ExecutionType',\n      'id' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleFields extends AbstractEnum {\n\n  const ACCOUNT_ID = 'account_id';\n  const CREATED_BY = 'created_by';\n  const CREATED_TIME = 'created_time';\n  const EVALUATION_SPEC = 'evaluation_spec';\n  const EXECUTION_SPEC = 'execution_spec';\n  const ID = 'id';\n  const NAME = 'name';\n  const SCHEDULE_SPEC = 'schedule_spec';\n  const STATUS = 'status';\n  const UPDATED_TIME = 'updated_time';\n  const UI_CREATION_SOURCE = 'ui_creation_source';\n\n  public function getFieldTypes() {\n    return array(\n      'account_id' => 'string',\n      'created_by' => 'User',\n      'created_time' => 'datetime',\n      'evaluation_spec' => 'AdRuleEvaluationSpec',\n      'execution_spec' => 'AdRuleExecutionSpec',\n      'id' => 'string',\n      'name' => 'string',\n      'schedule_spec' => 'AdRuleScheduleSpec',\n      'status' => 'string',\n      'updated_time' => 'datetime',\n      'ui_creation_source' => 'UiCreationSource',\n    );\n  }\n}\n", "num_lines": 68}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleFiltersFields extends AbstractEnum {\n\n  const FIELD = 'field';\n  const OPERATOR = 'operator';\n  const VALUE = 'value';\n\n  public function getFieldTypes() {\n    return array(\n      'field' => 'string',\n      'operator' => 'Operator',\n      'value' => 'Object',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleHistoryFields extends AbstractEnum {\n\n  const EVALUATION_SPEC = 'evaluation_spec';\n  const EXCEPTION_CODE = 'exception_code';\n  const EXCEPTION_MESSAGE = 'exception_message';\n  const EXECUTION_SPEC = 'execution_spec';\n  const IS_MANUAL = 'is_manual';\n  const RESULTS = 'results';\n  const SCHEDULE_SPEC = 'schedule_spec';\n  const TIMESTAMP = 'timestamp';\n\n  public function getFieldTypes() {\n    return array(\n      'evaluation_spec' => 'AdRuleEvaluationSpec',\n      'exception_code' => 'int',\n      'exception_message' => 'string',\n      'execution_spec' => 'AdRuleExecutionSpec',\n      'is_manual' => 'bool',\n      'results' => 'list<AdRuleHistoryResult>',\n      'schedule_spec' => 'AdRuleScheduleSpec',\n      'timestamp' => 'datetime',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleHistoryResultActionFields extends AbstractEnum {\n\n  const ACTION = 'action';\n  const FIELD = 'field';\n  const NEW_VALUE = 'new_value';\n  const OLD_VALUE = 'old_value';\n\n  public function getFieldTypes() {\n    return array(\n      'action' => 'string',\n      'field' => 'string',\n      'new_value' => 'string',\n      'old_value' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleHistoryResultFields extends AbstractEnum {\n\n  const ACTIONS = 'actions';\n  const OBJECT_ID = 'object_id';\n  const OBJECT_TYPE = 'object_type';\n\n  public function getFieldTypes() {\n    return array(\n      'actions' => 'list<AdRuleHistoryResultAction>',\n      'object_id' => 'string',\n      'object_type' => 'ObjectType',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleScheduleFields extends AbstractEnum {\n\n  const DAYS = 'days';\n  const END_MINUTE = 'end_minute';\n  const START_MINUTE = 'start_minute';\n\n  public function getFieldTypes() {\n    return array(\n      'days' => 'list<int>',\n      'end_minute' => 'int',\n      'start_minute' => 'int',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleScheduleSpecFields extends AbstractEnum {\n\n  const SCHEDULE = 'schedule';\n  const SCHEDULE_TYPE = 'schedule_type';\n\n  public function getFieldTypes() {\n    return array(\n      'schedule' => 'list<AdRuleSchedule>',\n      'schedule_type' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdRuleTriggerFields extends AbstractEnum {\n\n  const FIELD = 'field';\n  const OPERATOR = 'operator';\n  const TYPE = 'type';\n  const VALUE = 'value';\n\n  public function getFieldTypes() {\n    return array(\n      'field' => 'string',\n      'operator' => 'Operator',\n      'type' => 'Type',\n      'value' => 'Object',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdsActionStatsFields extends AbstractEnum {\n\n  const FIELD_1D_CLICK = '1d_click';\n  const FIELD_1D_VIEW = '1d_view';\n  const FIELD_28D_CLICK = '28d_click';\n  const FIELD_28D_VIEW = '28d_view';\n  const FIELD_7D_CLICK = '7d_click';\n  const FIELD_7D_VIEW = '7d_view';\n  const ACTION_BRAND = 'action_brand';\n  const ACTION_CANVAS_COMPONENT_ID = 'action_canvas_component_id';\n  const ACTION_CANVAS_COMPONENT_NAME = 'action_canvas_component_name';\n  const ACTION_CAROUSEL_CARD_ID = 'action_carousel_card_id';\n  const ACTION_CAROUSEL_CARD_NAME = 'action_carousel_card_name';\n  const ACTION_CATEGORY = 'action_category';\n  const ACTION_CONVERTED_PRODUCT_ID = 'action_converted_product_id';\n  const ACTION_DESTINATION = 'action_destination';\n  const ACTION_DEVICE = 'action_device';\n  const ACTION_EVENT_CHANNEL = 'action_event_channel';\n  const ACTION_LINK_CLICK_DESTINATION = 'action_link_click_destination';\n  const ACTION_LOCATION_CODE = 'action_location_code';\n  const ACTION_REACTION = 'action_reaction';\n  const ACTION_TARGET_ID = 'action_target_id';\n  const ACTION_TYPE = 'action_type';\n  const ACTION_VIDEO_ASSET_ID = 'action_video_asset_id';\n  const ACTION_VIDEO_SOUND = 'action_video_sound';\n  const ACTION_VIDEO_TYPE = 'action_video_type';\n  const DDA = 'dda';\n  const INLINE = 'inline';\n  const INTERACTIVE_COMPONENT_STICKER_ID = 'interactive_component_sticker_id';\n  const INTERACTIVE_COMPONENT_STICKER_RESPONSE = 'interactive_component_sticker_response';\n  const SKAN_CLICK = 'skan_click';\n  const SKAN_VIEW = 'skan_view';\n  const VALUE = 'value';\n\n  public function getFieldTypes() {\n    return array(\n      '1d_click' => 'string',\n      '1d_view' => 'string',\n      '28d_click' => 'string',\n      '28d_view' => 'string',\n      '7d_click' => 'string',\n      '7d_view' => 'string',\n      'action_brand' => 'string',\n      'action_canvas_component_id' => 'string',\n      'action_canvas_component_name' => 'string',\n      'action_carousel_card_id' => 'string',\n      'action_carousel_card_name' => 'string',\n      'action_category' => 'string',\n      'action_converted_product_id' => 'string',\n      'action_destination' => 'string',\n      'action_device' => 'string',\n      'action_event_channel' => 'string',\n      'action_link_click_destination' => 'string',\n      'action_location_code' => 'string',\n      'action_reaction' => 'string',\n      'action_target_id' => 'string',\n      'action_type' => 'string',\n      'action_video_asset_id' => 'string',\n      'action_video_sound' => 'string',\n      'action_video_type' => 'string',\n      'dda' => 'string',\n      'inline' => 'string',\n      'interactive_component_sticker_id' => 'string',\n      'interactive_component_sticker_response' => 'string',\n      'skan_click' => 'string',\n      'skan_view' => 'string',\n      'value' => 'string',\n    );\n  }\n}\n", "num_lines": 108}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdSetFields extends AbstractEnum {\n\n  const ACCOUNT_ID = 'account_id';\n  const ADLABELS = 'adlabels';\n  const ADSET_SCHEDULE = 'adset_schedule';\n  const ASSET_FEED_ID = 'asset_feed_id';\n  const ATTRIBUTION_SPEC = 'attribution_spec';\n  const BID_ADJUSTMENTS = 'bid_adjustments';\n  const BID_AMOUNT = 'bid_amount';\n  const BID_CONSTRAINTS = 'bid_constraints';\n  const BID_INFO = 'bid_info';\n  const BID_STRATEGY = 'bid_strategy';\n  const BILLING_EVENT = 'billing_event';\n  const BUDGET_REMAINING = 'budget_remaining';\n  const CAMPAIGN = 'campaign';\n  const CAMPAIGN_ATTRIBUTION = 'campaign_attribution';\n  const CAMPAIGN_ID = 'campaign_id';\n  const CONFIGURED_STATUS = 'configured_status';\n  const CREATED_TIME = 'created_time';\n  const CREATIVE_SEQUENCE = 'creative_sequence';\n  const DAILY_BUDGET = 'daily_budget';\n  const DAILY_MIN_SPEND_TARGET = 'daily_min_spend_target';\n  const DAILY_SPEND_CAP = 'daily_spend_cap';\n  const DESTINATION_TYPE = 'destination_type';\n  const DSA_BENEFICIARY = 'dsa_beneficiary';\n  const DSA_PAYOR = 'dsa_payor';\n  const EFFECTIVE_STATUS = 'effective_status';\n  const END_TIME = 'end_time';\n  const EXISTING_CUSTOMER_BUDGET_PERCENTAGE = 'existing_customer_budget_percentage';\n  const FREQUENCY_CONTROL_SPECS = 'frequency_control_specs';\n  const FULL_FUNNEL_EXPLORATION_MODE = 'full_funnel_exploration_mode';\n  const ID = 'id';\n  const INSTAGRAM_ACTOR_ID = 'instagram_actor_id';\n  const IS_DYNAMIC_CREATIVE = 'is_dynamic_creative';\n  const ISSUES_INFO = 'issues_info';\n  const LEARNING_STAGE_INFO = 'learning_stage_info';\n  const LIFETIME_BUDGET = 'lifetime_budget';\n  const LIFETIME_IMPS = 'lifetime_imps';\n  const LIFETIME_MIN_SPEND_TARGET = 'lifetime_min_spend_target';\n  const LIFETIME_SPEND_CAP = 'lifetime_spend_cap';\n  const MULTI_OPTIMIZATION_GOAL_WEIGHT = 'multi_optimization_goal_weight';\n  const NAME = 'name';\n  const OPTIMIZATION_GOAL = 'optimization_goal';\n  const OPTIMIZATION_SUB_EVENT = 'optimization_sub_event';\n  const PACING_TYPE = 'pacing_type';\n  const PROMOTED_OBJECT = 'promoted_object';\n  const RECOMMENDATIONS = 'recommendations';\n  const RECURRING_BUDGET_SEMANTICS = 'recurring_budget_semantics';\n  const REVIEW_FEEDBACK = 'review_feedback';\n  const RF_PREDICTION_ID = 'rf_prediction_id';\n  const SOURCE_ADSET = 'source_adset';\n  const SOURCE_ADSET_ID = 'source_adset_id';\n  const START_TIME = 'start_time';\n  const STATUS = 'status';\n  const TARGETING = 'targeting';\n  const TARGETING_OPTIMIZATION_TYPES = 'targeting_optimization_types';\n  const TIME_BASED_AD_ROTATION_ID_BLOCKS = 'time_based_ad_rotation_id_blocks';\n  const TIME_BASED_AD_ROTATION_INTERVALS = 'time_based_ad_rotation_intervals';\n  const UPDATED_TIME = 'updated_time';\n  const USE_NEW_APP_CLICK = 'use_new_app_click';\n  const CAMPAIGN_SPEC = 'campaign_spec';\n  const DAILY_IMPS = 'daily_imps';\n  const DATE_FORMAT = 'date_format';\n  const EXECUTION_OPTIONS = 'execution_options';\n  const LINE_NUMBER = 'line_number';\n  const RB_PREDICTION_ID = 'rb_prediction_id';\n  const TIME_START = 'time_start';\n  const TIME_STOP = 'time_stop';\n  const TOPLINE_ID = 'topline_id';\n  const TUNE_FOR_CATEGORY = 'tune_for_category';\n\n  public function getFieldTypes() {\n    return array(\n      'account_id' => 'string',\n      'adlabels' => 'list<AdLabel>',\n      'adset_schedule' => 'list<DayPart>',\n      'asset_feed_id' => 'string',\n      'attribution_spec' => 'list<AttributionSpec>',\n      'bid_adjustments' => 'AdBidAdjustments',\n      'bid_amount' => 'unsigned int',\n      'bid_constraints' => 'AdCampaignBidConstraint',\n      'bid_info' => 'map<string, unsigned int>',\n      'bid_strategy' => 'BidStrategy',\n      'billing_event' => 'BillingEvent',\n      'budget_remaining' => 'string',\n      'campaign' => 'Campaign',\n      'campaign_attribution' => 'string',\n      'campaign_id' => 'string',\n      'configured_status' => 'ConfiguredStatus',\n      'created_time' => 'datetime',\n      'creative_sequence' => 'list<string>',\n      'daily_budget' => 'string',\n      'daily_min_spend_target' => 'string',\n      'daily_spend_cap' => 'string',\n      'destination_type' => 'string',\n      'dsa_beneficiary' => 'string',\n      'dsa_payor' => 'string',\n      'effective_status' => 'EffectiveStatus',\n      'end_time' => 'datetime',\n      'existing_customer_budget_percentage' => 'unsigned int',\n      'frequency_control_specs' => 'list<AdCampaignFrequencyControlSpecs>',\n      'full_funnel_exploration_mode' => 'string',\n      'id' => 'string',\n      'instagram_actor_id' => 'string',\n      'is_dynamic_creative' => 'bool',\n      'issues_info' => 'list<AdCampaignIssuesInfo>',\n      'learning_stage_info' => 'AdCampaignLearningStageInfo',\n      'lifetime_budget' => 'string',\n      'lifetime_imps' => 'int',\n      'lifetime_min_spend_target' => 'string',\n      'lifetime_spend_cap' => 'string',\n      'multi_optimization_goal_weight' => 'string',\n      'name' => 'string',\n      'optimization_goal' => 'OptimizationGoal',\n      'optimization_sub_event' => 'string',\n      'pacing_type' => 'list<string>',\n      'promoted_object' => 'AdPromotedObject',\n      'recommendations' => 'list<AdRecommendation>',\n      'recurring_budget_semantics' => 'bool',\n      'review_feedback' => 'string',\n      'rf_prediction_id' => 'string',\n      'source_adset' => 'AdSet',\n      'source_adset_id' => 'string',\n      'start_time' => 'datetime',\n      'status' => 'Status',\n      'targeting' => 'Targeting',\n      'targeting_optimization_types' => 'list<map<string, int>>',\n      'time_based_ad_rotation_id_blocks' => 'list<list<int>>',\n      'time_based_ad_rotation_intervals' => 'list<unsigned int>',\n      'updated_time' => 'datetime',\n      'use_new_app_click' => 'bool',\n      'campaign_spec' => 'Object',\n      'daily_imps' => 'unsigned int',\n      'date_format' => 'string',\n      'execution_options' => 'list<ExecutionOptions>',\n      'line_number' => 'unsigned int',\n      'rb_prediction_id' => 'string',\n      'time_start' => 'datetime',\n      'time_stop' => 'datetime',\n      'topline_id' => 'string',\n      'tune_for_category' => 'TuneForCategory',\n    );\n  }\n}\n", "num_lines": 182}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdsImageCropsFields extends AbstractEnum {\n\n  const FIELD_100X100 = '100x100';\n  const FIELD_100X72 = '100x72';\n  const FIELD_191X100 = '191x100';\n  const FIELD_400X150 = '400x150';\n  const FIELD_400X500 = '400x500';\n  const FIELD_600X360 = '600x360';\n  const FIELD_90X160 = '90x160';\n\n  public function getFieldTypes() {\n    return array(\n      '100x100' => 'list<list>',\n      '100x72' => 'list<list>',\n      '191x100' => 'list<list>',\n      '400x150' => 'list<list>',\n      '400x500' => 'list<list>',\n      '600x360' => 'list<list>',\n      '90x160' => 'list<list>',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdsInsightsFields extends AbstractEnum {\n\n  const ACCOUNT_CURRENCY = 'account_currency';\n  const ACCOUNT_ID = 'account_id';\n  const ACCOUNT_NAME = 'account_name';\n  const ACTION_VALUES = 'action_values';\n  const ACTIONS = 'actions';\n  const AD_CLICK_ACTIONS = 'ad_click_actions';\n  const AD_ID = 'ad_id';\n  const AD_IMPRESSION_ACTIONS = 'ad_impression_actions';\n  const AD_NAME = 'ad_name';\n  const ADSET_END = 'adset_end';\n  const ADSET_ID = 'adset_id';\n  const ADSET_NAME = 'adset_name';\n  const ADSET_START = 'adset_start';\n  const AGE_TARGETING = 'age_targeting';\n  const ATTRIBUTION_SETTING = 'attribution_setting';\n  const AUCTION_BID = 'auction_bid';\n  const AUCTION_COMPETITIVENESS = 'auction_competitiveness';\n  const AUCTION_MAX_COMPETITOR_BID = 'auction_max_competitor_bid';\n  const BUYING_TYPE = 'buying_type';\n  const CAMPAIGN_ID = 'campaign_id';\n  const CAMPAIGN_NAME = 'campaign_name';\n  const CANVAS_AVG_VIEW_PERCENT = 'canvas_avg_view_percent';\n  const CANVAS_AVG_VIEW_TIME = 'canvas_avg_view_time';\n  const CATALOG_SEGMENT_ACTIONS = 'catalog_segment_actions';\n  const CATALOG_SEGMENT_VALUE = 'catalog_segment_value';\n  const CATALOG_SEGMENT_VALUE_MOBILE_PURCHASE_ROAS = 'catalog_segment_value_mobile_purchase_roas';\n  const CATALOG_SEGMENT_VALUE_OMNI_PURCHASE_ROAS = 'catalog_segment_value_omni_purchase_roas';\n  const CATALOG_SEGMENT_VALUE_WEBSITE_PURCHASE_ROAS = 'catalog_segment_value_website_purchase_roas';\n  const CLICKS = 'clicks';\n  const CONVERSION_RATE_RANKING = 'conversion_rate_ranking';\n  const CONVERSION_VALUES = 'conversion_values';\n  const CONVERSIONS = 'conversions';\n  const CONVERTED_PRODUCT_QUANTITY = 'converted_product_quantity';\n  const CONVERTED_PRODUCT_VALUE = 'converted_product_value';\n  const COST_PER_15_SEC_VIDEO_VIEW = 'cost_per_15_sec_video_view';\n  const COST_PER_2_SEC_CONTINUOUS_VIDEO_VIEW = 'cost_per_2_sec_continuous_video_view';\n  const COST_PER_ACTION_TYPE = 'cost_per_action_type';\n  const COST_PER_AD_CLICK = 'cost_per_ad_click';\n  const COST_PER_CONVERSION = 'cost_per_conversion';\n  const COST_PER_DDA_COUNTBY_CONVS = 'cost_per_dda_countby_convs';\n  const COST_PER_ESTIMATED_AD_RECALLERS = 'cost_per_estimated_ad_recallers';\n  const COST_PER_INLINE_LINK_CLICK = 'cost_per_inline_link_click';\n  const COST_PER_INLINE_POST_ENGAGEMENT = 'cost_per_inline_post_engagement';\n  const COST_PER_ONE_THOUSAND_AD_IMPRESSION = 'cost_per_one_thousand_ad_impression';\n  const COST_PER_OUTBOUND_CLICK = 'cost_per_outbound_click';\n  const COST_PER_THRUPLAY = 'cost_per_thruplay';\n  const COST_PER_UNIQUE_ACTION_TYPE = 'cost_per_unique_action_type';\n  const COST_PER_UNIQUE_CLICK = 'cost_per_unique_click';\n  const COST_PER_UNIQUE_CONVERSION = 'cost_per_unique_conversion';\n  const COST_PER_UNIQUE_INLINE_LINK_CLICK = 'cost_per_unique_inline_link_click';\n  const COST_PER_UNIQUE_OUTBOUND_CLICK = 'cost_per_unique_outbound_click';\n  const CPC = 'cpc';\n  const CPM = 'cpm';\n  const CPP = 'cpp';\n  const CREATED_TIME = 'created_time';\n  const CREATIVE_MEDIA_TYPE = 'creative_media_type';\n  const CTR = 'ctr';\n  const DATE_START = 'date_start';\n  const DATE_STOP = 'date_stop';\n  const DDA_COUNTBY_CONVS = 'dda_countby_convs';\n  const DDA_RESULTS = 'dda_results';\n  const ENGAGEMENT_RATE_RANKING = 'engagement_rate_ranking';\n  const ESTIMATED_AD_RECALL_RATE = 'estimated_ad_recall_rate';\n  const ESTIMATED_AD_RECALL_RATE_LOWER_BOUND = 'estimated_ad_recall_rate_lower_bound';\n  const ESTIMATED_AD_RECALL_RATE_UPPER_BOUND = 'estimated_ad_recall_rate_upper_bound';\n  const ESTIMATED_AD_RECALLERS = 'estimated_ad_recallers';\n  const ESTIMATED_AD_RECALLERS_LOWER_BOUND = 'estimated_ad_recallers_lower_bound';\n  const ESTIMATED_AD_RECALLERS_UPPER_BOUND = 'estimated_ad_recallers_upper_bound';\n  const FREQUENCY = 'frequency';\n  const FULL_VIEW_IMPRESSIONS = 'full_view_impressions';\n  const FULL_VIEW_REACH = 'full_view_reach';\n  const GENDER_TARGETING = 'gender_targeting';\n  const IMPRESSIONS = 'impressions';\n  const INLINE_LINK_CLICK_CTR = 'inline_link_click_ctr';\n  const INLINE_LINK_CLICKS = 'inline_link_clicks';\n  const INLINE_POST_ENGAGEMENT = 'inline_post_engagement';\n  const INSTAGRAM_UPCOMING_EVENT_REMINDERS_SET = 'instagram_upcoming_event_reminders_set';\n  const INSTANT_EXPERIENCE_CLICKS_TO_OPEN = 'instant_experience_clicks_to_open';\n  const INSTANT_EXPERIENCE_CLICKS_TO_START = 'instant_experience_clicks_to_start';\n  const INSTANT_EXPERIENCE_OUTBOUND_CLICKS = 'instant_experience_outbound_clicks';\n  const INTERACTIVE_COMPONENT_TAP = 'interactive_component_tap';\n  const LABELS = 'labels';\n  const LOCATION = 'location';\n  const MOBILE_APP_PURCHASE_ROAS = 'mobile_app_purchase_roas';\n  const OBJECTIVE = 'objective';\n  const OPTIMIZATION_GOAL = 'optimization_goal';\n  const OUTBOUND_CLICKS = 'outbound_clicks';\n  const OUTBOUND_CLICKS_CTR = 'outbound_clicks_ctr';\n  const PLACE_PAGE_NAME = 'place_page_name';\n  const PURCHASE_ROAS = 'purchase_roas';\n  const QUALIFYING_QUESTION_QUALIFY_ANSWER_RATE = 'qualifying_question_qualify_answer_rate';\n  const QUALITY_RANKING = 'quality_ranking';\n  const QUALITY_SCORE_ECTR = 'quality_score_ectr';\n  const QUALITY_SCORE_ECVR = 'quality_score_ecvr';\n  const QUALITY_SCORE_ORGANIC = 'quality_score_organic';\n  const REACH = 'reach';\n  const SOCIAL_SPEND = 'social_spend';\n  const SPEND = 'spend';\n  const TOTAL_POSTBACKS = 'total_postbacks';\n  const TOTAL_POSTBACKS_DETAILED = 'total_postbacks_detailed';\n  const TOTAL_POSTBACKS_DETAILED_V4 = 'total_postbacks_detailed_v4';\n  const UNIQUE_ACTIONS = 'unique_actions';\n  const UNIQUE_CLICKS = 'unique_clicks';\n  const UNIQUE_CONVERSIONS = 'unique_conversions';\n  const UNIQUE_CTR = 'unique_ctr';\n  const UNIQUE_INLINE_LINK_CLICK_CTR = 'unique_inline_link_click_ctr';\n  const UNIQUE_INLINE_LINK_CLICKS = 'unique_inline_link_clicks';\n  const UNIQUE_LINK_CLICKS_CTR = 'unique_link_clicks_ctr';\n  const UNIQUE_OUTBOUND_CLICKS = 'unique_outbound_clicks';\n  const UNIQUE_OUTBOUND_CLICKS_CTR = 'unique_outbound_clicks_ctr';\n  const UNIQUE_VIDEO_CONTINUOUS_2_SEC_WATCHED_ACTIONS = 'unique_video_continuous_2_sec_watched_actions';\n  const UNIQUE_VIDEO_VIEW_15_SEC = 'unique_video_view_15_sec';\n  const UPDATED_TIME = 'updated_time';\n  const VIDEO_15_SEC_WATCHED_ACTIONS = 'video_15_sec_watched_actions';\n  const VIDEO_30_SEC_WATCHED_ACTIONS = 'video_30_sec_watched_actions';\n  const VIDEO_AVG_TIME_WATCHED_ACTIONS = 'video_avg_time_watched_actions';\n  const VIDEO_CONTINUOUS_2_SEC_WATCHED_ACTIONS = 'video_continuous_2_sec_watched_actions';\n  const VIDEO_P100_WATCHED_ACTIONS = 'video_p100_watched_actions';\n  const VIDEO_P25_WATCHED_ACTIONS = 'video_p25_watched_actions';\n  const VIDEO_P50_WATCHED_ACTIONS = 'video_p50_watched_actions';\n  const VIDEO_P75_WATCHED_ACTIONS = 'video_p75_watched_actions';\n  const VIDEO_P95_WATCHED_ACTIONS = 'video_p95_watched_actions';\n  const VIDEO_PLAY_ACTIONS = 'video_play_actions';\n  const VIDEO_PLAY_CURVE_ACTIONS = 'video_play_curve_actions';\n  const VIDEO_PLAY_RETENTION_0_TO_15S_ACTIONS = 'video_play_retention_0_to_15s_actions';\n  const VIDEO_PLAY_RETENTION_20_TO_60S_ACTIONS = 'video_play_retention_20_to_60s_actions';\n  const VIDEO_PLAY_RETENTION_GRAPH_ACTIONS = 'video_play_retention_graph_actions';\n  const VIDEO_THRUPLAY_WATCHED_ACTIONS = 'video_thruplay_watched_actions';\n  const VIDEO_TIME_WATCHED_ACTIONS = 'video_time_watched_actions';\n  const WEBSITE_CTR = 'website_ctr';\n  const WEBSITE_PURCHASE_ROAS = 'website_purchase_roas';\n  const WISH_BID = 'wish_bid';\n\n  public function getFieldTypes() {\n    return array(\n      'account_currency' => 'string',\n      'account_id' => 'string',\n      'account_name' => 'string',\n      'action_values' => 'list<AdsActionStats>',\n      'actions' => 'list<AdsActionStats>',\n      'ad_click_actions' => 'list<AdsActionStats>',\n      'ad_id' => 'string',\n      'ad_impression_actions' => 'list<AdsActionStats>',\n      'ad_name' => 'string',\n      'adset_end' => 'string',\n      'adset_id' => 'string',\n      'adset_name' => 'string',\n      'adset_start' => 'string',\n      'age_targeting' => 'string',\n      'attribution_setting' => 'string',\n      'auction_bid' => 'string',\n      'auction_competitiveness' => 'string',\n      'auction_max_competitor_bid' => 'string',\n      'buying_type' => 'string',\n      'campaign_id' => 'string',\n      'campaign_name' => 'string',\n      'canvas_avg_view_percent' => 'string',\n      'canvas_avg_view_time' => 'string',\n      'catalog_segment_actions' => 'list<AdsActionStats>',\n      'catalog_segment_value' => 'list<AdsActionStats>',\n      'catalog_segment_value_mobile_purchase_roas' => 'list<AdsActionStats>',\n      'catalog_segment_value_omni_purchase_roas' => 'list<AdsActionStats>',\n      'catalog_segment_value_website_purchase_roas' => 'list<AdsActionStats>',\n      'clicks' => 'string',\n      'conversion_rate_ranking' => 'string',\n      'conversion_values' => 'list<AdsActionStats>',\n      'conversions' => 'list<AdsActionStats>',\n      'converted_product_quantity' => 'list<AdsActionStats>',\n      'converted_product_value' => 'list<AdsActionStats>',\n      'cost_per_15_sec_video_view' => 'list<AdsActionStats>',\n      'cost_per_2_sec_continuous_video_view' => 'list<AdsActionStats>',\n      'cost_per_action_type' => 'list<AdsActionStats>',\n      'cost_per_ad_click' => 'list<AdsActionStats>',\n      'cost_per_conversion' => 'list<AdsActionStats>',\n      'cost_per_dda_countby_convs' => 'string',\n      'cost_per_estimated_ad_recallers' => 'string',\n      'cost_per_inline_link_click' => 'string',\n      'cost_per_inline_post_engagement' => 'string',\n      'cost_per_one_thousand_ad_impression' => 'list<AdsActionStats>',\n      'cost_per_outbound_click' => 'list<AdsActionStats>',\n      'cost_per_thruplay' => 'list<AdsActionStats>',\n      'cost_per_unique_action_type' => 'list<AdsActionStats>',\n      'cost_per_unique_click' => 'string',\n      'cost_per_unique_conversion' => 'list<AdsActionStats>',\n      'cost_per_unique_inline_link_click' => 'string',\n      'cost_per_unique_outbound_click' => 'list<AdsActionStats>',\n      'cpc' => 'string',\n      'cpm' => 'string',\n      'cpp' => 'string',\n      'created_time' => 'string',\n      'creative_media_type' => 'string',\n      'ctr' => 'string',\n      'date_start' => 'string',\n      'date_stop' => 'string',\n      'dda_countby_convs' => 'string',\n      'dda_results' => 'list<Object>',\n      'engagement_rate_ranking' => 'string',\n      'estimated_ad_recall_rate' => 'string',\n      'estimated_ad_recall_rate_lower_bound' => 'string',\n      'estimated_ad_recall_rate_upper_bound' => 'string',\n      'estimated_ad_recallers' => 'string',\n      'estimated_ad_recallers_lower_bound' => 'string',\n      'estimated_ad_recallers_upper_bound' => 'string',\n      'frequency' => 'string',\n      'full_view_impressions' => 'string',\n      'full_view_reach' => 'string',\n      'gender_targeting' => 'string',\n      'impressions' => 'string',\n      'inline_link_click_ctr' => 'string',\n      'inline_link_clicks' => 'string',\n      'inline_post_engagement' => 'string',\n      'instagram_upcoming_event_reminders_set' => 'string',\n      'instant_experience_clicks_to_open' => 'string',\n      'instant_experience_clicks_to_start' => 'string',\n      'instant_experience_outbound_clicks' => 'list<AdsActionStats>',\n      'interactive_component_tap' => 'list<AdsActionStats>',\n      'labels' => 'string',\n      'location' => 'string',\n      'mobile_app_purchase_roas' => 'list<AdsActionStats>',\n      'objective' => 'string',\n      'optimization_goal' => 'string',\n      'outbound_clicks' => 'list<AdsActionStats>',\n      'outbound_clicks_ctr' => 'list<AdsActionStats>',\n      'place_page_name' => 'string',\n      'purchase_roas' => 'list<AdsActionStats>',\n      'qualifying_question_qualify_answer_rate' => 'string',\n      'quality_ranking' => 'string',\n      'quality_score_ectr' => 'string',\n      'quality_score_ecvr' => 'string',\n      'quality_score_organic' => 'string',\n      'reach' => 'string',\n      'social_spend' => 'string',\n      'spend' => 'string',\n      'total_postbacks' => 'string',\n      'total_postbacks_detailed' => 'list<AdsActionStats>',\n      'total_postbacks_detailed_v4' => 'string',\n      'unique_actions' => 'list<AdsActionStats>',\n      'unique_clicks' => 'string',\n      'unique_conversions' => 'list<AdsActionStats>',\n      'unique_ctr' => 'string',\n      'unique_inline_link_click_ctr' => 'string',\n      'unique_inline_link_clicks' => 'string',\n      'unique_link_clicks_ctr' => 'string',\n      'unique_outbound_clicks' => 'list<AdsActionStats>',\n      'unique_outbound_clicks_ctr' => 'list<AdsActionStats>',\n      'unique_video_continuous_2_sec_watched_actions' => 'list<AdsActionStats>',\n      'unique_video_view_15_sec' => 'list<AdsActionStats>',\n      'updated_time' => 'string',\n      'video_15_sec_watched_actions' => 'list<AdsActionStats>',\n      'video_30_sec_watched_actions' => 'list<AdsActionStats>',\n      'video_avg_time_watched_actions' => 'list<AdsActionStats>',\n      'video_continuous_2_sec_watched_actions' => 'list<AdsActionStats>',\n      'video_p100_watched_actions' => 'list<AdsActionStats>',\n      'video_p25_watched_actions' => 'list<AdsActionStats>',\n      'video_p50_watched_actions' => 'list<AdsActionStats>',\n      'video_p75_watched_actions' => 'list<AdsActionStats>',\n      'video_p95_watched_actions' => 'list<AdsActionStats>',\n      'video_play_actions' => 'list<AdsActionStats>',\n      'video_play_curve_actions' => 'list<Object>',\n      'video_play_retention_0_to_15s_actions' => 'list<Object>',\n      'video_play_retention_20_to_60s_actions' => 'list<Object>',\n      'video_play_retention_graph_actions' => 'list<Object>',\n      'video_thruplay_watched_actions' => 'list<AdsActionStats>',\n      'video_time_watched_actions' => 'list<AdsActionStats>',\n      'website_ctr' => 'list<AdsActionStats>',\n      'website_purchase_roas' => 'list<AdsActionStats>',\n      'wish_bid' => 'string',\n    );\n  }\n}\n", "num_lines": 310}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdsOptimalDeliveryGrowthOpportunityFields extends AbstractEnum {\n\n  const CHILD_METADATA = 'child_metadata';\n  const METADATA = 'metadata';\n  const OPTIMIZATION_TYPE = 'optimization_type';\n\n  public function getFieldTypes() {\n    return array(\n      'child_metadata' => 'list<map<string, Object>>',\n      'metadata' => 'Object',\n      'optimization_type' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdsPixelFields extends AbstractEnum {\n\n  const AUTOMATIC_MATCHING_FIELDS = 'automatic_matching_fields';\n  const CAN_PROXY = 'can_proxy';\n  const CODE = 'code';\n  const CONFIG = 'config';\n  const CREATION_TIME = 'creation_time';\n  const CREATOR = 'creator';\n  const DATA_USE_SETTING = 'data_use_setting';\n  const DESCRIPTION = 'description';\n  const DUPLICATE_ENTRIES = 'duplicate_entries';\n  const ENABLE_AUTO_ASSIGN_TO_ACCOUNTS = 'enable_auto_assign_to_accounts';\n  const ENABLE_AUTOMATIC_MATCHING = 'enable_automatic_matching';\n  const EVENT_STATS = 'event_stats';\n  const EVENT_TIME_MAX = 'event_time_max';\n  const EVENT_TIME_MIN = 'event_time_min';\n  const FIRST_PARTY_COOKIE_STATUS = 'first_party_cookie_status';\n  const ID = 'id';\n  const IS_CONSOLIDATED_CONTAINER = 'is_consolidated_container';\n  const IS_CREATED_BY_BUSINESS = 'is_created_by_business';\n  const IS_CRM = 'is_crm';\n  const IS_MTA_USE = 'is_mta_use';\n  const IS_RESTRICTED_USE = 'is_restricted_use';\n  const IS_UNAVAILABLE = 'is_unavailable';\n  const LAST_FIRED_TIME = 'last_fired_time';\n  const LAST_UPLOAD_APP = 'last_upload_app';\n  const LAST_UPLOAD_APP_CHANGED_TIME = 'last_upload_app_changed_time';\n  const MATCH_RATE_APPROX = 'match_rate_approx';\n  const MATCHED_ENTRIES = 'matched_entries';\n  const NAME = 'name';\n  const OWNER_AD_ACCOUNT = 'owner_ad_account';\n  const OWNER_BUSINESS = 'owner_business';\n  const USAGE = 'usage';\n  const VALID_ENTRIES = 'valid_entries';\n\n  public function getFieldTypes() {\n    return array(\n      'automatic_matching_fields' => 'list<string>',\n      'can_proxy' => 'bool',\n      'code' => 'string',\n      'config' => 'string',\n      'creation_time' => 'datetime',\n      'creator' => 'User',\n      'data_use_setting' => 'string',\n      'description' => 'string',\n      'duplicate_entries' => 'int',\n      'enable_auto_assign_to_accounts' => 'bool',\n      'enable_automatic_matching' => 'bool',\n      'event_stats' => 'string',\n      'event_time_max' => 'int',\n      'event_time_min' => 'int',\n      'first_party_cookie_status' => 'string',\n      'id' => 'string',\n      'is_consolidated_container' => 'bool',\n      'is_created_by_business' => 'bool',\n      'is_crm' => 'bool',\n      'is_mta_use' => 'bool',\n      'is_restricted_use' => 'bool',\n      'is_unavailable' => 'bool',\n      'last_fired_time' => 'datetime',\n      'last_upload_app' => 'string',\n      'last_upload_app_changed_time' => 'int',\n      'match_rate_approx' => 'int',\n      'matched_entries' => 'int',\n      'name' => 'string',\n      'owner_ad_account' => 'AdAccount',\n      'owner_business' => 'Business',\n      'usage' => 'OfflineConversionDataSetUsage',\n      'valid_entries' => 'int',\n    );\n  }\n}\n", "num_lines": 110}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdsPixelStatsFields extends AbstractEnum {\n\n  const COUNT = 'count';\n  const DIAGNOSTICS_HOURLY_LAST_TIMESTAMP = 'diagnostics_hourly_last_timestamp';\n  const EVENT = 'event';\n  const VALUE = 'value';\n\n  public function getFieldTypes() {\n    return array(\n      'count' => 'int',\n      'diagnostics_hourly_last_timestamp' => 'datetime',\n      'event' => 'string',\n      'value' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdsPixelStatsResultFields extends AbstractEnum {\n\n  const AGGREGATION = 'aggregation';\n  const DATA = 'data';\n  const START_TIME = 'start_time';\n\n  public function getFieldTypes() {\n    return array(\n      'aggregation' => 'string',\n      'data' => 'list<AdsPixelStats>',\n      'start_time' => 'datetime',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdStudyCellFields extends AbstractEnum {\n\n  const AD_ENTITIES_COUNT = 'ad_entities_count';\n  const CONTROL_PERCENTAGE = 'control_percentage';\n  const ID = 'id';\n  const NAME = 'name';\n  const TREATMENT_PERCENTAGE = 'treatment_percentage';\n\n  public function getFieldTypes() {\n    return array(\n      'ad_entities_count' => 'unsigned int',\n      'control_percentage' => 'float',\n      'id' => 'string',\n      'name' => 'string',\n      'treatment_percentage' => 'float',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdStudyFields extends AbstractEnum {\n\n  const BUSINESS = 'business';\n  const CANCELED_TIME = 'canceled_time';\n  const CLIENT_BUSINESS = 'client_business';\n  const COOLDOWN_START_TIME = 'cooldown_start_time';\n  const CREATED_BY = 'created_by';\n  const CREATED_TIME = 'created_time';\n  const DESCRIPTION = 'description';\n  const END_TIME = 'end_time';\n  const ID = 'id';\n  const MEASUREMENT_CONTACT = 'measurement_contact';\n  const NAME = 'name';\n  const OBSERVATION_END_TIME = 'observation_end_time';\n  const RESULTS_FIRST_AVAILABLE_DATE = 'results_first_available_date';\n  const SALES_CONTACT = 'sales_contact';\n  const START_TIME = 'start_time';\n  const TYPE = 'type';\n  const UPDATED_BY = 'updated_by';\n  const UPDATED_TIME = 'updated_time';\n  const CELLS = 'cells';\n  const CONFIDENCE_LEVEL = 'confidence_level';\n  const OBJECTIVES = 'objectives';\n  const VIEWERS = 'viewers';\n\n  public function getFieldTypes() {\n    return array(\n      'business' => 'Business',\n      'canceled_time' => 'datetime',\n      'client_business' => 'Business',\n      'cooldown_start_time' => 'datetime',\n      'created_by' => 'User',\n      'created_time' => 'datetime',\n      'description' => 'string',\n      'end_time' => 'datetime',\n      'id' => 'string',\n      'measurement_contact' => 'User',\n      'name' => 'string',\n      'observation_end_time' => 'datetime',\n      'results_first_available_date' => 'string',\n      'sales_contact' => 'User',\n      'start_time' => 'datetime',\n      'type' => 'string',\n      'updated_by' => 'User',\n      'updated_time' => 'datetime',\n      'cells' => 'list<Object>',\n      'confidence_level' => 'float',\n      'objectives' => 'list<Object>',\n      'viewers' => 'list<int>',\n    );\n  }\n}\n", "num_lines": 90}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdStudyObjectiveFields extends AbstractEnum {\n\n  const ID = 'id';\n  const IS_PRIMARY = 'is_primary';\n  const LAST_UPDATED_RESULTS = 'last_updated_results';\n  const NAME = 'name';\n  const RESULTS = 'results';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'is_primary' => 'bool',\n      'last_updated_results' => 'string',\n      'name' => 'string',\n      'results' => 'list<string>',\n      'type' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdStudyObjectiveIDFields extends AbstractEnum {\n\n  const EVENT_NAMES = 'event_names';\n  const ID = 'id';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'event_names' => 'list<string>',\n      'id' => 'string',\n      'type' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AdStudyObjectiveOffsiteDatasetsFields extends AbstractEnum {\n\n  const EVENT_NAMES = 'event_names';\n  const ID = 'id';\n\n  public function getFieldTypes() {\n    return array(\n      'event_names' => 'list<string>',\n      'id' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static AdVideoFields getInstance()\n */\nclass AdVideoFields extends AbstractEnum {\n\n  const CREATED_TIME = 'created_time';\n  const DESCRIPTION = 'description';\n  const EMBED_HTML = 'embed_html';\n  const EMBEDDABLE = 'embeddable';\n  const FILE_URL = 'file_url';\n  const FORMAT = 'format';\n  const FROM = 'from';\n  const ICON = 'icon';\n  const ID = 'id';\n  const IS_INSTAGRAM_ELIGIBLE = 'is_instagram_eligible';\n  const NAME = 'name';\n  const PICTURE = 'picture';\n  const PUBLISHED = 'published';\n  const SLIDESHOW_SPEC = 'slideshow_spec';\n  const SOURCE = 'source';\n  const THUMBNAILS = 'thumbnails';\n  const UPDATED_TIME = 'updated_time';\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AgencyClientDeclarationFields extends AbstractEnum {\n\n  const AGENCY_REPRESENTING_CLIENT = 'agency_representing_client';\n  const CLIENT_BASED_IN_FRANCE = 'client_based_in_france';\n  const CLIENT_CITY = 'client_city';\n  const CLIENT_COUNTRY_CODE = 'client_country_code';\n  const CLIENT_EMAIL_ADDRESS = 'client_email_address';\n  const CLIENT_NAME = 'client_name';\n  const CLIENT_POSTAL_CODE = 'client_postal_code';\n  const CLIENT_PROVINCE = 'client_province';\n  const CLIENT_STREET = 'client_street';\n  const CLIENT_STREET2 = 'client_street2';\n  const HAS_WRITTEN_MANDATE_FROM_ADVERTISER = 'has_written_mandate_from_advertiser';\n  const IS_CLIENT_PAYING_INVOICES = 'is_client_paying_invoices';\n\n  public function getFieldTypes() {\n    return array(\n      'agency_representing_client' => 'unsigned int',\n      'client_based_in_france' => 'unsigned int',\n      'client_city' => 'string',\n      'client_country_code' => 'string',\n      'client_email_address' => 'string',\n      'client_name' => 'string',\n      'client_postal_code' => 'string',\n      'client_province' => 'string',\n      'client_street' => 'string',\n      'client_street2' => 'string',\n      'has_written_mandate_from_advertiser' => 'unsigned int',\n      'is_client_paying_invoices' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 70}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AgeRangeFields extends AbstractEnum {\n\n  const MAX = 'max';\n  const MIN = 'min';\n\n  public function getFieldTypes() {\n    return array(\n      'max' => 'unsigned int',\n      'min' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AlbumFields extends AbstractEnum {\n\n  const BACKDATED_TIME = 'backdated_time';\n  const BACKDATED_TIME_GRANULARITY = 'backdated_time_granularity';\n  const CAN_BACKDATE = 'can_backdate';\n  const CAN_UPLOAD = 'can_upload';\n  const COUNT = 'count';\n  const COVER_PHOTO = 'cover_photo';\n  const CREATED_TIME = 'created_time';\n  const DESCRIPTION = 'description';\n  const EDIT_LINK = 'edit_link';\n  const EVENT = 'event';\n  const FROM = 'from';\n  const ID = 'id';\n  const IS_USER_FACING = 'is_user_facing';\n  const LINK = 'link';\n  const LOCATION = 'location';\n  const MODIFIED_MAJOR = 'modified_major';\n  const NAME = 'name';\n  const PHOTO_COUNT = 'photo_count';\n  const PLACE = 'place';\n  const PRIVACY = 'privacy';\n  const TYPE = 'type';\n  const UPDATED_TIME = 'updated_time';\n  const VIDEO_COUNT = 'video_count';\n\n  public function getFieldTypes() {\n    return array(\n      'backdated_time' => 'datetime',\n      'backdated_time_granularity' => 'string',\n      'can_backdate' => 'bool',\n      'can_upload' => 'bool',\n      'count' => 'unsigned int',\n      'cover_photo' => 'Photo',\n      'created_time' => 'datetime',\n      'description' => 'string',\n      'edit_link' => 'Object',\n      'event' => 'Event',\n      'from' => 'Object',\n      'id' => 'string',\n      'is_user_facing' => 'bool',\n      'link' => 'Object',\n      'location' => 'string',\n      'modified_major' => 'datetime',\n      'name' => 'string',\n      'photo_count' => 'unsigned int',\n      'place' => 'Place',\n      'privacy' => 'string',\n      'type' => 'string',\n      'updated_time' => 'datetime',\n      'video_count' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 92}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AndroidAppLinkFields extends AbstractEnum {\n\n  const APP_NAME = 'app_name';\n  const FIELD_CLASS = 'class';\n  const PACKAGE = 'package';\n  const URL = 'url';\n\n  public function getFieldTypes() {\n    return array(\n      'app_name' => 'string',\n      'class' => 'string',\n      'package' => 'string',\n      'url' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ApplicationFields extends AbstractEnum {\n\n  const AAM_RULES = 'aam_rules';\n  const AN_AD_SPACE_LIMIT = 'an_ad_space_limit';\n  const AN_PLATFORMS = 'an_platforms';\n  const ANDROID_KEY_HASH = 'android_key_hash';\n  const ANDROID_SDK_ERROR_CATEGORIES = 'android_sdk_error_categories';\n  const APP_DOMAINS = 'app_domains';\n  const APP_EVENTS_CONFIG = 'app_events_config';\n  const APP_EVENTS_FEATURE_BITMASK = 'app_events_feature_bitmask';\n  const APP_EVENTS_SESSION_TIMEOUT = 'app_events_session_timeout';\n  const APP_INSTALL_TRACKED = 'app_install_tracked';\n  const APP_NAME = 'app_name';\n  const APP_SIGNALS_BINDING_IOS = 'app_signals_binding_ios';\n  const APP_TYPE = 'app_type';\n  const AUTH_DIALOG_DATA_HELP_URL = 'auth_dialog_data_help_url';\n  const AUTH_DIALOG_HEADLINE = 'auth_dialog_headline';\n  const AUTH_DIALOG_PERMS_EXPLANATION = 'auth_dialog_perms_explanation';\n  const AUTH_REFERRAL_DEFAULT_ACTIVITY_PRIVACY = 'auth_referral_default_activity_privacy';\n  const AUTH_REFERRAL_ENABLED = 'auth_referral_enabled';\n  const AUTH_REFERRAL_EXTENDED_PERMS = 'auth_referral_extended_perms';\n  const AUTH_REFERRAL_FRIEND_PERMS = 'auth_referral_friend_perms';\n  const AUTH_REFERRAL_RESPONSE_TYPE = 'auth_referral_response_type';\n  const AUTH_REFERRAL_USER_PERMS = 'auth_referral_user_perms';\n  const AUTO_EVENT_MAPPING_ANDROID = 'auto_event_mapping_android';\n  const AUTO_EVENT_MAPPING_IOS = 'auto_event_mapping_ios';\n  const AUTO_EVENT_SETUP_ENABLED = 'auto_event_setup_enabled';\n  const BUSINESS = 'business';\n  const CANVAS_FLUID_HEIGHT = 'canvas_fluid_height';\n  const CANVAS_FLUID_WIDTH = 'canvas_fluid_width';\n  const CANVAS_URL = 'canvas_url';\n  const CATEGORY = 'category';\n  const CLIENT_CONFIG = 'client_config';\n  const COMPANY = 'company';\n  const CONFIGURED_IOS_SSO = 'configured_ios_sso';\n  const CONTACT_EMAIL = 'contact_email';\n  const CREATED_TIME = 'created_time';\n  const CREATOR_UID = 'creator_uid';\n  const DAILY_ACTIVE_USERS = 'daily_active_users';\n  const DAILY_ACTIVE_USERS_RANK = 'daily_active_users_rank';\n  const DEAUTH_CALLBACK_URL = 'deauth_callback_url';\n  const DEFAULT_SHARE_MODE = 'default_share_mode';\n  const DESCRIPTION = 'description';\n  const FINANCIAL_ID = 'financial_id';\n  const GDPV4_CHROME_CUSTOM_TABS_ENABLED = 'gdpv4_chrome_custom_tabs_enabled';\n  const GDPV4_ENABLED = 'gdpv4_enabled';\n  const GDPV4_NUX_CONTENT = 'gdpv4_nux_content';\n  const GDPV4_NUX_ENABLED = 'gdpv4_nux_enabled';\n  const HAS_MESSENGER_PRODUCT = 'has_messenger_product';\n  const HOSTING_URL = 'hosting_url';\n  const ICON_URL = 'icon_url';\n  const ID = 'id';\n  const IOS_BUNDLE_ID = 'ios_bundle_id';\n  const IOS_SDK_DIALOG_FLOWS = 'ios_sdk_dialog_flows';\n  const IOS_SDK_ERROR_CATEGORIES = 'ios_sdk_error_categories';\n  const IOS_SFVC_ATTR = 'ios_sfvc_attr';\n  const IOS_SUPPORTS_NATIVE_PROXY_AUTH_FLOW = 'ios_supports_native_proxy_auth_flow';\n  const IOS_SUPPORTS_SYSTEM_AUTH = 'ios_supports_system_auth';\n  const IPAD_APP_STORE_ID = 'ipad_app_store_id';\n  const IPHONE_APP_STORE_ID = 'iphone_app_store_id';\n  const LATEST_SDK_VERSION = 'latest_sdk_version';\n  const LINK = 'link';\n  const LOGGING_TOKEN = 'logging_token';\n  const LOGO_URL = 'logo_url';\n  const MIGRATIONS = 'migrations';\n  const MOBILE_PROFILE_SECTION_URL = 'mobile_profile_section_url';\n  const MOBILE_WEB_URL = 'mobile_web_url';\n  const MONTHLY_ACTIVE_USERS = 'monthly_active_users';\n  const MONTHLY_ACTIVE_USERS_RANK = 'monthly_active_users_rank';\n  const NAME = 'name';\n  const NAMESPACE = 'namespace';\n  const OBJECT_STORE_URLS = 'object_store_urls';\n  const OWNER_BUSINESS = 'owner_business';\n  const PAGE_TAB_DEFAULT_NAME = 'page_tab_default_name';\n  const PAGE_TAB_URL = 'page_tab_url';\n  const PHOTO_URL = 'photo_url';\n  const PRIVACY_POLICY_URL = 'privacy_policy_url';\n  const PROFILE_SECTION_URL = 'profile_section_url';\n  const PROPERTY_ID = 'property_id';\n  const REAL_TIME_MODE_DEVICES = 'real_time_mode_devices';\n  const RESTRICTIONS = 'restrictions';\n  const RESTRICTIVE_DATA_FILTER_PARAMS = 'restrictive_data_filter_params';\n  const RESTRICTIVE_DATA_FILTER_RULES = 'restrictive_data_filter_rules';\n  const SDK_UPDATE_MESSAGE = 'sdk_update_message';\n  const SEAMLESS_LOGIN = 'seamless_login';\n  const SECURE_CANVAS_URL = 'secure_canvas_url';\n  const SECURE_PAGE_TAB_URL = 'secure_page_tab_url';\n  const SERVER_IP_WHITELIST = 'server_ip_whitelist';\n  const SMART_LOGIN_BOOKMARK_ICON_URL = 'smart_login_bookmark_icon_url';\n  const SMART_LOGIN_MENU_ICON_URL = 'smart_login_menu_icon_url';\n  const SOCIAL_DISCOVERY = 'social_discovery';\n  const SUBCATEGORY = 'subcategory';\n  const SUGGESTED_EVENTS_SETTING = 'suggested_events_setting';\n  const SUPPORTED_PLATFORMS = 'supported_platforms';\n  const SUPPORTS_APPREQUESTS_FAST_APP_SWITCH = 'supports_apprequests_fast_app_switch';\n  const SUPPORTS_ATTRIBUTION = 'supports_attribution';\n  const SUPPORTS_IMPLICIT_SDK_LOGGING = 'supports_implicit_sdk_logging';\n  const SUPPRESS_NATIVE_IOS_GDP = 'suppress_native_ios_gdp';\n  const TERMS_OF_SERVICE_URL = 'terms_of_service_url';\n  const URL_SCHEME_SUFFIX = 'url_scheme_suffix';\n  const USER_SUPPORT_EMAIL = 'user_support_email';\n  const USER_SUPPORT_URL = 'user_support_url';\n  const WEBSITE_URL = 'website_url';\n  const WEEKLY_ACTIVE_USERS = 'weekly_active_users';\n\n  public function getFieldTypes() {\n    return array(\n      'aam_rules' => 'string',\n      'an_ad_space_limit' => 'unsigned int',\n      'an_platforms' => 'list<string>',\n      'android_key_hash' => 'list<string>',\n      'android_sdk_error_categories' => 'list<Object>',\n      'app_domains' => 'list<string>',\n      'app_events_config' => 'Object',\n      'app_events_feature_bitmask' => 'unsigned int',\n      'app_events_session_timeout' => 'unsigned int',\n      'app_install_tracked' => 'bool',\n      'app_name' => 'string',\n      'app_signals_binding_ios' => 'list<Object>',\n      'app_type' => 'unsigned int',\n      'auth_dialog_data_help_url' => 'string',\n      'auth_dialog_headline' => 'string',\n      'auth_dialog_perms_explanation' => 'string',\n      'auth_referral_default_activity_privacy' => 'string',\n      'auth_referral_enabled' => 'unsigned int',\n      'auth_referral_extended_perms' => 'list<string>',\n      'auth_referral_friend_perms' => 'list<string>',\n      'auth_referral_response_type' => 'string',\n      'auth_referral_user_perms' => 'list<string>',\n      'auto_event_mapping_android' => 'list<Object>',\n      'auto_event_mapping_ios' => 'list<Object>',\n      'auto_event_setup_enabled' => 'bool',\n      'business' => 'Business',\n      'canvas_fluid_height' => 'bool',\n      'canvas_fluid_width' => 'unsigned int',\n      'canvas_url' => 'string',\n      'category' => 'string',\n      'client_config' => 'map',\n      'company' => 'string',\n      'configured_ios_sso' => 'bool',\n      'contact_email' => 'string',\n      'created_time' => 'datetime',\n      'creator_uid' => 'string',\n      'daily_active_users' => 'string',\n      'daily_active_users_rank' => 'unsigned int',\n      'deauth_callback_url' => 'string',\n      'default_share_mode' => 'string',\n      'description' => 'string',\n      'financial_id' => 'string',\n      'gdpv4_chrome_custom_tabs_enabled' => 'bool',\n      'gdpv4_enabled' => 'bool',\n      'gdpv4_nux_content' => 'string',\n      'gdpv4_nux_enabled' => 'bool',\n      'has_messenger_product' => 'bool',\n      'hosting_url' => 'string',\n      'icon_url' => 'string',\n      'id' => 'string',\n      'ios_bundle_id' => 'list<string>',\n      'ios_sdk_dialog_flows' => 'Object',\n      'ios_sdk_error_categories' => 'list<Object>',\n      'ios_sfvc_attr' => 'bool',\n      'ios_supports_native_proxy_auth_flow' => 'bool',\n      'ios_supports_system_auth' => 'bool',\n      'ipad_app_store_id' => 'string',\n      'iphone_app_store_id' => 'string',\n      'latest_sdk_version' => 'Object',\n      'link' => 'string',\n      'logging_token' => 'string',\n      'logo_url' => 'string',\n      'migrations' => 'map<string, bool>',\n      'mobile_profile_section_url' => 'string',\n      'mobile_web_url' => 'string',\n      'monthly_active_users' => 'string',\n      'monthly_active_users_rank' => 'unsigned int',\n      'name' => 'string',\n      'namespace' => 'string',\n      'object_store_urls' => 'Object',\n      'owner_business' => 'Business',\n      'page_tab_default_name' => 'string',\n      'page_tab_url' => 'string',\n      'photo_url' => 'string',\n      'privacy_policy_url' => 'string',\n      'profile_section_url' => 'string',\n      'property_id' => 'string',\n      'real_time_mode_devices' => 'list<string>',\n      'restrictions' => 'Object',\n      'restrictive_data_filter_params' => 'string',\n      'restrictive_data_filter_rules' => 'string',\n      'sdk_update_message' => 'string',\n      'seamless_login' => 'int',\n      'secure_canvas_url' => 'string',\n      'secure_page_tab_url' => 'string',\n      'server_ip_whitelist' => 'string',\n      'smart_login_bookmark_icon_url' => 'string',\n      'smart_login_menu_icon_url' => 'string',\n      'social_discovery' => 'unsigned int',\n      'subcategory' => 'string',\n      'suggested_events_setting' => 'string',\n      'supported_platforms' => 'list<SupportedPlatforms>',\n      'supports_apprequests_fast_app_switch' => 'Object',\n      'supports_attribution' => 'bool',\n      'supports_implicit_sdk_logging' => 'bool',\n      'suppress_native_ios_gdp' => 'bool',\n      'terms_of_service_url' => 'string',\n      'url_scheme_suffix' => 'string',\n      'user_support_email' => 'string',\n      'user_support_url' => 'string',\n      'website_url' => 'string',\n      'weekly_active_users' => 'string',\n    );\n  }\n}\n", "num_lines": 250}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AppRequestFields extends AbstractEnum {\n\n  const ACTION_TYPE = 'action_type';\n  const APPLICATION = 'application';\n  const CREATED_TIME = 'created_time';\n  const DATA = 'data';\n  const FROM = 'from';\n  const ID = 'id';\n  const MESSAGE = 'message';\n  const OBJECT = 'object';\n  const TO = 'to';\n\n  public function getFieldTypes() {\n    return array(\n      'action_type' => 'string',\n      'application' => 'Application',\n      'created_time' => 'datetime',\n      'data' => 'string',\n      'from' => 'Object',\n      'id' => 'string',\n      'message' => 'string',\n      'object' => 'Object',\n      'to' => 'Object',\n    );\n  }\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AppRequestFormerRecipientFields extends AbstractEnum {\n\n  const ID = 'id';\n  const RECIPIENT_ID = 'recipient_id';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'recipient_id' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AREffectsBatchStatusFields extends AbstractEnum {\n\n  const ERRORS = 'errors';\n  const PRODUCT_GROUPS = 'product_groups';\n  const STATUS = 'status';\n\n  public function getFieldTypes() {\n    return array(\n      'errors' => 'list<string>',\n      'product_groups' => 'list<Object>',\n      'status' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AssignedUserFields extends AbstractEnum {\n\n  const BUSINESS = 'business';\n  const ID = 'id';\n  const NAME = 'name';\n  const USER_TYPE = 'user_type';\n\n  public function getFieldTypes() {\n    return array(\n      'business' => 'Business',\n      'id' => 'string',\n      'name' => 'string',\n      'user_type' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AsyncRequestFields extends AbstractEnum {\n\n  const ID = 'id';\n  const RESULT = 'result';\n  const STATUS = 'status';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'int',\n      'result' => 'string',\n      'status' => 'int',\n      'type' => 'int',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AsyncSessionFields extends AbstractEnum {\n\n  const APP = 'app';\n  const COMPLETE_TIME = 'complete_time';\n  const ERROR_CODE = 'error_code';\n  const EXCEPTION = 'exception';\n  const ID = 'id';\n  const METHOD = 'method';\n  const NAME = 'name';\n  const PAGE = 'page';\n  const PERCENT_COMPLETED = 'percent_completed';\n  const PLATFORM_VERSION = 'platform_version';\n  const RESULT = 'result';\n  const START_TIME = 'start_time';\n  const STATUS = 'status';\n  const URI = 'uri';\n  const USER = 'user';\n\n  public function getFieldTypes() {\n    return array(\n      'app' => 'Application',\n      'complete_time' => 'datetime',\n      'error_code' => 'int',\n      'exception' => 'string',\n      'id' => 'string',\n      'method' => 'string',\n      'name' => 'string',\n      'page' => 'Page',\n      'percent_completed' => 'int',\n      'platform_version' => 'string',\n      'result' => 'string',\n      'start_time' => 'datetime',\n      'status' => 'string',\n      'uri' => 'string',\n      'user' => 'User',\n    );\n  }\n}\n", "num_lines": 76}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AttributionSpecFields extends AbstractEnum {\n\n  const EVENT_TYPE = 'event_type';\n  const WINDOW_DAYS = 'window_days';\n\n  public function getFieldTypes() {\n    return array(\n      'event_type' => 'string',\n      'window_days' => 'int',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AudiencePermissionForActionsFields extends AbstractEnum {\n\n  const CAN_EDIT = 'can_edit';\n  const CAN_SEE_INSIGHT = 'can_see_insight';\n  const CAN_SHARE = 'can_share';\n  const SUBTYPE_SUPPORTS_LOOKALIKE = 'subtype_supports_lookalike';\n  const SUPPORTS_RECIPIENT_LOOKALIKE = 'supports_recipient_lookalike';\n\n  public function getFieldTypes() {\n    return array(\n      'can_edit' => 'bool',\n      'can_see_insight' => 'bool',\n      'can_share' => 'bool',\n      'subtype_supports_lookalike' => 'bool',\n      'supports_recipient_lookalike' => 'bool',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AudioCopyrightFields extends AbstractEnum {\n\n  const CREATION_TIME = 'creation_time';\n  const DISPLAYED_MATCHES_COUNT = 'displayed_matches_count';\n  const ID = 'id';\n  const IN_CONFLICT = 'in_conflict';\n  const ISRC = 'isrc';\n  const MATCH_RULE = 'match_rule';\n  const OWNERSHIP_COUNTRIES = 'ownership_countries';\n  const REFERENCE_FILE_STATUS = 'reference_file_status';\n  const RIDGE_MONITORING_STATUS = 'ridge_monitoring_status';\n  const TAGS = 'tags';\n  const UPDATE_TIME = 'update_time';\n  const WHITELISTED_FB_USERS = 'whitelisted_fb_users';\n  const WHITELISTED_IG_USERS = 'whitelisted_ig_users';\n\n  public function getFieldTypes() {\n    return array(\n      'creation_time' => 'datetime',\n      'displayed_matches_count' => 'int',\n      'id' => 'string',\n      'in_conflict' => 'bool',\n      'isrc' => 'string',\n      'match_rule' => 'VideoCopyrightRule',\n      'ownership_countries' => 'list<string>',\n      'reference_file_status' => 'string',\n      'ridge_monitoring_status' => 'string',\n      'tags' => 'list<string>',\n      'update_time' => 'datetime',\n      'whitelisted_fb_users' => 'list<Object>',\n      'whitelisted_ig_users' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 72}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass AutomotiveModelFields extends AbstractEnum {\n\n  const APPLINKS = 'applinks';\n  const AUTOMOTIVE_MODEL_ID = 'automotive_model_id';\n  const AVAILABILITY = 'availability';\n  const BODY_STYLE = 'body_style';\n  const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';\n  const CURRENCY = 'currency';\n  const CUSTOM_LABEL_0 = 'custom_label_0';\n  const DESCRIPTION = 'description';\n  const DRIVETRAIN = 'drivetrain';\n  const EXTERIOR_COLOR = 'exterior_color';\n  const FINANCE_DESCRIPTION = 'finance_description';\n  const FINANCE_TYPE = 'finance_type';\n  const FUEL_TYPE = 'fuel_type';\n  const GENERATION = 'generation';\n  const ID = 'id';\n  const IMAGE_FETCH_STATUS = 'image_fetch_status';\n  const IMAGES = 'images';\n  const INTERIOR_COLOR = 'interior_color';\n  const INTERIOR_UPHOLSTERY = 'interior_upholstery';\n  const MAKE = 'make';\n  const MODEL = 'model';\n  const PRICE = 'price';\n  const SANITIZED_IMAGES = 'sanitized_images';\n  const TITLE = 'title';\n  const TRANSMISSION = 'transmission';\n  const TRIM = 'trim';\n  const UNIT_PRICE = 'unit_price';\n  const URL = 'url';\n  const VISIBILITY = 'visibility';\n  const YEAR = 'year';\n\n  public function getFieldTypes() {\n    return array(\n      'applinks' => 'CatalogItemAppLinks',\n      'automotive_model_id' => 'string',\n      'availability' => 'string',\n      'body_style' => 'string',\n      'category_specific_fields' => 'CatalogSubVerticalList',\n      'currency' => 'string',\n      'custom_label_0' => 'string',\n      'description' => 'string',\n      'drivetrain' => 'string',\n      'exterior_color' => 'string',\n      'finance_description' => 'string',\n      'finance_type' => 'string',\n      'fuel_type' => 'string',\n      'generation' => 'string',\n      'id' => 'string',\n      'image_fetch_status' => 'ImageFetchStatus',\n      'images' => 'list<string>',\n      'interior_color' => 'string',\n      'interior_upholstery' => 'string',\n      'make' => 'string',\n      'model' => 'string',\n      'price' => 'string',\n      'sanitized_images' => 'list<string>',\n      'title' => 'string',\n      'transmission' => 'string',\n      'trim' => 'string',\n      'unit_price' => 'Object',\n      'url' => 'string',\n      'visibility' => 'Visibility',\n      'year' => 'int',\n    );\n  }\n}\n", "num_lines": 106}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BrandRequestFields extends AbstractEnum {\n\n  const AD_COUNTRIES = 'ad_countries';\n  const ADDITIONAL_CONTACTS = 'additional_contacts';\n  const APPROVAL_LEVEL = 'approval_level';\n  const CELLS = 'cells';\n  const COUNTRIES = 'countries';\n  const DENY_REASON = 'deny_reason';\n  const END_TIME = 'end_time';\n  const ESTIMATED_REACH = 'estimated_reach';\n  const ID = 'id';\n  const IS_MULTICELL = 'is_multicell';\n  const LOCALE = 'locale';\n  const MAX_AGE = 'max_age';\n  const MIN_AGE = 'min_age';\n  const QUESTIONS = 'questions';\n  const REGION = 'region';\n  const REQUEST_STATUS = 'request_status';\n  const REVIEW_DATE = 'review_date';\n  const START_TIME = 'start_time';\n  const STATUS = 'status';\n  const SUBMIT_DATE = 'submit_date';\n  const TOTAL_BUDGET = 'total_budget';\n\n  public function getFieldTypes() {\n    return array(\n      'ad_countries' => 'list<string>',\n      'additional_contacts' => 'list<string>',\n      'approval_level' => 'unsigned int',\n      'cells' => 'list<Object>',\n      'countries' => 'list<string>',\n      'deny_reason' => 'string',\n      'end_time' => 'datetime',\n      'estimated_reach' => 'unsigned int',\n      'id' => 'string',\n      'is_multicell' => 'bool',\n      'locale' => 'string',\n      'max_age' => 'unsigned int',\n      'min_age' => 'unsigned int',\n      'questions' => 'list<Object>',\n      'region' => 'string',\n      'request_status' => 'string',\n      'review_date' => 'datetime',\n      'start_time' => 'datetime',\n      'status' => 'string',\n      'submit_date' => 'datetime',\n      'total_budget' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 88}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BrandSafetyBlockListUsageFields extends AbstractEnum {\n\n  const CURRENT_USAGE = 'current_usage';\n  const NEW_USAGE = 'new_usage';\n  const PLATFORM = 'platform';\n  const POSITION = 'position';\n  const THRESHOLD = 'threshold';\n\n  public function getFieldTypes() {\n    return array(\n      'current_usage' => 'int',\n      'new_usage' => 'int',\n      'platform' => 'string',\n      'position' => 'string',\n      'threshold' => 'int',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BroadTargetingCategoriesFields extends AbstractEnum {\n\n  const CATEGORY_DESCRIPTION = 'category_description';\n  const ID = 'id';\n  const NAME = 'name';\n  const PARENT_CATEGORY = 'parent_category';\n  const PATH = 'path';\n  const SIZE_LOWER_BOUND = 'size_lower_bound';\n  const SIZE_UPPER_BOUND = 'size_upper_bound';\n  const SOURCE = 'source';\n  const TYPE = 'type';\n  const TYPE_NAME = 'type_name';\n  const UNTRANSLATED_NAME = 'untranslated_name';\n  const UNTRANSLATED_PARENT_NAME = 'untranslated_parent_name';\n\n  public function getFieldTypes() {\n    return array(\n      'category_description' => 'string',\n      'id' => 'string',\n      'name' => 'string',\n      'parent_category' => 'string',\n      'path' => 'list<string>',\n      'size_lower_bound' => 'int',\n      'size_upper_bound' => 'int',\n      'source' => 'string',\n      'type' => 'int',\n      'type_name' => 'string',\n      'untranslated_name' => 'string',\n      'untranslated_parent_name' => 'string',\n    );\n  }\n}\n", "num_lines": 70}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessAdAccountRequestFields extends AbstractEnum {\n\n  const AD_ACCOUNT = 'ad_account';\n  const ID = 'id';\n\n  public function getFieldTypes() {\n    return array(\n      'ad_account' => 'AdAccount',\n      'id' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessApplicationRequestFields extends AbstractEnum {\n\n  const APPLICATION = 'application';\n  const ID = 'id';\n\n  public function getFieldTypes() {\n    return array(\n      'application' => 'Application',\n      'id' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessAssetGroupFields extends AbstractEnum {\n\n  const ID = 'id';\n  const NAME = 'name';\n  const OWNER_BUSINESS = 'owner_business';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'name' => 'string',\n      'owner_business' => 'Business',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessAssetSharingAgreementFields extends AbstractEnum {\n\n  const ID = 'id';\n  const INITIATOR = 'initiator';\n  const RECIPIENT = 'recipient';\n  const RELATIONSHIP_TYPE = 'relationship_type';\n  const REQUEST_STATUS = 'request_status';\n  const REQUEST_TYPE = 'request_type';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'initiator' => 'Business',\n      'recipient' => 'Business',\n      'relationship_type' => 'list<string>',\n      'request_status' => 'string',\n      'request_type' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessFields extends AbstractEnum {\n\n  const BLOCK_OFFLINE_ANALYTICS = 'block_offline_analytics';\n  const COLLABORATIVE_ADS_MANAGED_PARTNER_BUSINESS_INFO = 'collaborative_ads_managed_partner_business_info';\n  const COLLABORATIVE_ADS_MANAGED_PARTNER_ELIGIBILITY = 'collaborative_ads_managed_partner_eligibility';\n  const COLLABORATIVE_ADS_PARTNER_PREMIUM_OPTIONS = 'collaborative_ads_partner_premium_options';\n  const CREATED_BY = 'created_by';\n  const CREATED_TIME = 'created_time';\n  const EXTENDED_UPDATED_TIME = 'extended_updated_time';\n  const ID = 'id';\n  const IS_HIDDEN = 'is_hidden';\n  const LINK = 'link';\n  const NAME = 'name';\n  const PRIMARY_PAGE = 'primary_page';\n  const PROFILE_PICTURE_URI = 'profile_picture_uri';\n  const TIMEZONE_ID = 'timezone_id';\n  const TWO_FACTOR_TYPE = 'two_factor_type';\n  const UPDATED_BY = 'updated_by';\n  const UPDATED_TIME = 'updated_time';\n  const VERIFICATION_STATUS = 'verification_status';\n  const VERTICAL = 'vertical';\n  const VERTICAL_ID = 'vertical_id';\n\n  public function getFieldTypes() {\n    return array(\n      'block_offline_analytics' => 'bool',\n      'collaborative_ads_managed_partner_business_info' => 'ManagedPartnerBusiness',\n      'collaborative_ads_managed_partner_eligibility' => 'BusinessManagedPartnerEligibility',\n      'collaborative_ads_partner_premium_options' => 'BusinessPartnerPremiumOptions',\n      'created_by' => 'Object',\n      'created_time' => 'datetime',\n      'extended_updated_time' => 'datetime',\n      'id' => 'string',\n      'is_hidden' => 'bool',\n      'link' => 'string',\n      'name' => 'string',\n      'primary_page' => 'Page',\n      'profile_picture_uri' => 'string',\n      'timezone_id' => 'unsigned int',\n      'two_factor_type' => 'string',\n      'updated_by' => 'Object',\n      'updated_time' => 'datetime',\n      'verification_status' => 'string',\n      'vertical' => 'string',\n      'vertical_id' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 86}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessImageFields extends AbstractEnum {\n\n  const BUSINESS = 'business';\n  const CREATION_TIME = 'creation_time';\n  const HASH = 'hash';\n  const HEIGHT = 'height';\n  const ID = 'id';\n  const MEDIA_LIBRARY_URL = 'media_library_url';\n  const NAME = 'name';\n  const URL = 'url';\n  const URL_128 = 'url_128';\n  const WIDTH = 'width';\n\n  public function getFieldTypes() {\n    return array(\n      'business' => 'Business',\n      'creation_time' => 'datetime',\n      'hash' => 'string',\n      'height' => 'int',\n      'id' => 'string',\n      'media_library_url' => 'string',\n      'name' => 'string',\n      'url' => 'string',\n      'url_128' => 'string',\n      'width' => 'int',\n    );\n  }\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessManagedPartnerEligibilityFields extends AbstractEnum {\n\n  const IS_ELIGIBLE = 'is_eligible';\n  const REASON_CODE = 'reason_code';\n  const REASON_DESCRIPTION = 'reason_description';\n\n  public function getFieldTypes() {\n    return array(\n      'is_eligible' => 'bool',\n      'reason_code' => 'string',\n      'reason_description' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessOwnedObjectOnBehalfOfRequestFields extends AbstractEnum {\n\n  const BUSINESS_OWNED_OBJECT = 'business_owned_object';\n  const ID = 'id';\n  const RECEIVING_BUSINESS = 'receiving_business';\n  const REQUESTING_BUSINESS = 'requesting_business';\n  const STATUS = 'status';\n\n  public function getFieldTypes() {\n    return array(\n      'business_owned_object' => 'string',\n      'id' => 'string',\n      'receiving_business' => 'Business',\n      'requesting_business' => 'Business',\n      'status' => 'string',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessPageRequestFields extends AbstractEnum {\n\n  const ID = 'id';\n  const PAGE = 'page';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'page' => 'Page',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessPartnerPremiumOptionsFields extends AbstractEnum {\n\n  const ENABLE_BASKET_INSIGHT = 'enable_basket_insight';\n  const ENABLE_EXTENDED_AUDIENCE_RETARGETING = 'enable_extended_audience_retargeting';\n  const RETAILER_CUSTOM_AUDIENCE_CONFIG = 'retailer_custom_audience_config';\n\n  public function getFieldTypes() {\n    return array(\n      'enable_basket_insight' => 'bool',\n      'enable_extended_audience_retargeting' => 'bool',\n      'retailer_custom_audience_config' => 'Object',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessRoleRequestFields extends AbstractEnum {\n\n  const CREATED_BY = 'created_by';\n  const CREATED_TIME = 'created_time';\n  const EMAIL = 'email';\n  const EXPIRATION_TIME = 'expiration_time';\n  const EXPIRY_TIME = 'expiry_time';\n  const FINANCE_ROLE = 'finance_role';\n  const ID = 'id';\n  const INVITE_LINK = 'invite_link';\n  const IP_ROLE = 'ip_role';\n  const OWNER = 'owner';\n  const ROLE = 'role';\n  const STATUS = 'status';\n  const UPDATED_BY = 'updated_by';\n  const UPDATED_TIME = 'updated_time';\n\n  public function getFieldTypes() {\n    return array(\n      'created_by' => 'Object',\n      'created_time' => 'datetime',\n      'email' => 'string',\n      'expiration_time' => 'datetime',\n      'expiry_time' => 'datetime',\n      'finance_role' => 'string',\n      'id' => 'string',\n      'invite_link' => 'string',\n      'ip_role' => 'string',\n      'owner' => 'Business',\n      'role' => 'string',\n      'status' => 'string',\n      'updated_by' => 'Object',\n      'updated_time' => 'datetime',\n    );\n  }\n}\n", "num_lines": 74}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass BusinessUserFields extends AbstractEnum {\n\n  const BUSINESS = 'business';\n  const BUSINESS_ROLE_REQUEST = 'business_role_request';\n  const EMAIL = 'email';\n  const FINANCE_PERMISSION = 'finance_permission';\n  const FIRST_NAME = 'first_name';\n  const ID = 'id';\n  const IP_PERMISSION = 'ip_permission';\n  const LAST_NAME = 'last_name';\n  const MARKED_FOR_REMOVAL = 'marked_for_removal';\n  const NAME = 'name';\n  const PENDING_EMAIL = 'pending_email';\n  const ROLE = 'role';\n  const TITLE = 'title';\n  const TWO_FAC_STATUS = 'two_fac_status';\n\n  public function getFieldTypes() {\n    return array(\n      'business' => 'Business',\n      'business_role_request' => 'BusinessRoleRequest',\n      'email' => 'string',\n      'finance_permission' => 'string',\n      'first_name' => 'string',\n      'id' => 'string',\n      'ip_permission' => 'string',\n      'last_name' => 'string',\n      'marked_for_removal' => 'bool',\n      'name' => 'string',\n      'pending_email' => 'string',\n      'role' => 'string',\n      'title' => 'string',\n      'two_fac_status' => 'string',\n    );\n  }\n}\n", "num_lines": 74}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CampaignFields extends AbstractEnum {\n\n  const ACCOUNT_ID = 'account_id';\n  const ADLABELS = 'adlabels';\n  const BID_STRATEGY = 'bid_strategy';\n  const BOOSTED_OBJECT_ID = 'boosted_object_id';\n  const BRAND_LIFT_STUDIES = 'brand_lift_studies';\n  const BUDGET_REBALANCE_FLAG = 'budget_rebalance_flag';\n  const BUDGET_REMAINING = 'budget_remaining';\n  const BUYING_TYPE = 'buying_type';\n  const CAN_CREATE_BRAND_LIFT_STUDY = 'can_create_brand_lift_study';\n  const CAN_USE_SPEND_CAP = 'can_use_spend_cap';\n  const CONFIGURED_STATUS = 'configured_status';\n  const CREATED_TIME = 'created_time';\n  const DAILY_BUDGET = 'daily_budget';\n  const EFFECTIVE_STATUS = 'effective_status';\n  const HAS_SECONDARY_SKADNETWORK_REPORTING = 'has_secondary_skadnetwork_reporting';\n  const ID = 'id';\n  const IS_SKADNETWORK_ATTRIBUTION = 'is_skadnetwork_attribution';\n  const ISSUES_INFO = 'issues_info';\n  const LAST_BUDGET_TOGGLING_TIME = 'last_budget_toggling_time';\n  const LIFETIME_BUDGET = 'lifetime_budget';\n  const NAME = 'name';\n  const OBJECTIVE = 'objective';\n  const PACING_TYPE = 'pacing_type';\n  const PRIMARY_ATTRIBUTION = 'primary_attribution';\n  const PROMOTED_OBJECT = 'promoted_object';\n  const RECOMMENDATIONS = 'recommendations';\n  const SMART_PROMOTION_TYPE = 'smart_promotion_type';\n  const SOURCE_CAMPAIGN = 'source_campaign';\n  const SOURCE_CAMPAIGN_ID = 'source_campaign_id';\n  const SPECIAL_AD_CATEGORIES = 'special_ad_categories';\n  const SPECIAL_AD_CATEGORY = 'special_ad_category';\n  const SPECIAL_AD_CATEGORY_COUNTRY = 'special_ad_category_country';\n  const SPEND_CAP = 'spend_cap';\n  const START_TIME = 'start_time';\n  const STATUS = 'status';\n  const STOP_TIME = 'stop_time';\n  const TOPLINE_ID = 'topline_id';\n  const UPDATED_TIME = 'updated_time';\n  const ADBATCH = 'adbatch';\n  const EXECUTION_OPTIONS = 'execution_options';\n  const ITERATIVE_SPLIT_TEST_CONFIGS = 'iterative_split_test_configs';\n\n  public function getFieldTypes() {\n    return array(\n      'account_id' => 'string',\n      'adlabels' => 'list<AdLabel>',\n      'bid_strategy' => 'BidStrategy',\n      'boosted_object_id' => 'string',\n      'brand_lift_studies' => 'list<AdStudy>',\n      'budget_rebalance_flag' => 'bool',\n      'budget_remaining' => 'string',\n      'buying_type' => 'string',\n      'can_create_brand_lift_study' => 'bool',\n      'can_use_spend_cap' => 'bool',\n      'configured_status' => 'ConfiguredStatus',\n      'created_time' => 'datetime',\n      'daily_budget' => 'string',\n      'effective_status' => 'EffectiveStatus',\n      'has_secondary_skadnetwork_reporting' => 'bool',\n      'id' => 'string',\n      'is_skadnetwork_attribution' => 'bool',\n      'issues_info' => 'list<AdCampaignIssuesInfo>',\n      'last_budget_toggling_time' => 'datetime',\n      'lifetime_budget' => 'string',\n      'name' => 'string',\n      'objective' => 'string',\n      'pacing_type' => 'list<string>',\n      'primary_attribution' => 'string',\n      'promoted_object' => 'AdPromotedObject',\n      'recommendations' => 'list<AdRecommendation>',\n      'smart_promotion_type' => 'string',\n      'source_campaign' => 'Campaign',\n      'source_campaign_id' => 'string',\n      'special_ad_categories' => 'list<string>',\n      'special_ad_category' => 'string',\n      'special_ad_category_country' => 'list<string>',\n      'spend_cap' => 'string',\n      'start_time' => 'datetime',\n      'status' => 'Status',\n      'stop_time' => 'datetime',\n      'topline_id' => 'string',\n      'updated_time' => 'datetime',\n      'adbatch' => 'list<Object>',\n      'execution_options' => 'list<ExecutionOptions>',\n      'iterative_split_test_configs' => 'list<Object>',\n    );\n  }\n}\n", "num_lines": 128}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CampaignGroupBrandConfigurationFields extends AbstractEnum {\n\n  const BRAND_PRODUCT_NAME = 'brand_product_name';\n  const LOCALE = 'locale';\n  const VERTICAL = 'vertical';\n\n  public function getFieldTypes() {\n    return array(\n      'brand_product_name' => 'string',\n      'locale' => 'string',\n      'vertical' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CampaignGroupCollaborativeAdsPartnerInfoFields extends AbstractEnum {\n\n\n  public function getFieldTypes() {\n    return array(\n    );\n  }\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CanvasAdSettingsFields extends AbstractEnum {\n\n  const IS_CANVAS_COLLECTION_ELIGIBLE = 'is_canvas_collection_eligible';\n  const LEAD_FORM_CREATED_TIME = 'lead_form_created_time';\n  const LEAD_FORM_NAME = 'lead_form_name';\n  const LEAD_GEN_FORM_ID = 'lead_gen_form_id';\n  const LEADS_COUNT = 'leads_count';\n  const PRODUCT_SET_ID = 'product_set_id';\n  const USE_RETAILER_ITEM_IDS = 'use_retailer_item_ids';\n\n  public function getFieldTypes() {\n    return array(\n      'is_canvas_collection_eligible' => 'bool',\n      'lead_form_created_time' => 'unsigned int',\n      'lead_form_name' => 'string',\n      'lead_gen_form_id' => 'string',\n      'leads_count' => 'int',\n      'product_set_id' => 'string',\n      'use_retailer_item_ids' => 'bool',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CanvasBodyElementFields extends AbstractEnum {\n\n  const ELEMENT = 'element';\n\n  public function getFieldTypes() {\n    return array(\n      'element' => 'Object',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CanvasCollectionThumbnailFields extends AbstractEnum {\n\n  const ELEMENT_CHILD_INDEX = 'element_child_index';\n  const ELEMENT_ID = 'element_id';\n  const PHOTO = 'photo';\n\n  public function getFieldTypes() {\n    return array(\n      'element_child_index' => 'int',\n      'element_id' => 'string',\n      'photo' => 'Photo',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CanvasDynamicSettingFields extends AbstractEnum {\n\n  const CHILD_DOCUMENTS = 'child_documents';\n  const PRODUCT_SET_ID = 'product_set_id';\n  const ID = 'id';\n\n  public function getFieldTypes() {\n    return array(\n      'child_documents' => 'list<Canvas>',\n      'product_set_id' => 'string',\n      'id' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CanvasFields extends AbstractEnum {\n\n  const BACKGROUND_COLOR = 'background_color';\n  const BODY_ELEMENTS = 'body_elements';\n  const BUSINESS_ID = 'business_id';\n  const CANVAS_LINK = 'canvas_link';\n  const COLLECTION_HERO_IMAGE = 'collection_hero_image';\n  const COLLECTION_HERO_VIDEO = 'collection_hero_video';\n  const COLLECTION_THUMBNAILS = 'collection_thumbnails';\n  const DYNAMIC_SETTING = 'dynamic_setting';\n  const ELEMENT_PAYLOAD = 'element_payload';\n  const ELEMENTS = 'elements';\n  const FB_BODY_ELEMENTS = 'fb_body_elements';\n  const ID = 'id';\n  const IS_HIDDEN = 'is_hidden';\n  const IS_PUBLISHED = 'is_published';\n  const LAST_EDITOR = 'last_editor';\n  const LINKED_DOCUMENTS = 'linked_documents';\n  const NAME = 'name';\n  const OWNER = 'owner';\n  const PROPERTY_LIST = 'property_list';\n  const SOURCE_TEMPLATE = 'source_template';\n  const STORE_URL = 'store_url';\n  const STYLE_LIST = 'style_list';\n  const TAGS = 'tags';\n  const UI_PROPERTY_LIST = 'ui_property_list';\n  const UNUSED_BODY_ELEMENTS = 'unused_body_elements';\n  const UPDATE_TIME = 'update_time';\n  const USE_RETAILER_ITEM_IDS = 'use_retailer_item_ids';\n\n  public function getFieldTypes() {\n    return array(\n      'background_color' => 'string',\n      'body_elements' => 'list<Object>',\n      'business_id' => 'string',\n      'canvas_link' => 'string',\n      'collection_hero_image' => 'Photo',\n      'collection_hero_video' => 'AdVideo',\n      'collection_thumbnails' => 'list<CanvasCollectionThumbnail>',\n      'dynamic_setting' => 'CanvasDynamicSetting',\n      'element_payload' => 'string',\n      'elements' => 'list<RichMediaElement>',\n      'fb_body_elements' => 'list<Object>',\n      'id' => 'string',\n      'is_hidden' => 'bool',\n      'is_published' => 'bool',\n      'last_editor' => 'User',\n      'linked_documents' => 'list<Canvas>',\n      'name' => 'string',\n      'owner' => 'Page',\n      'property_list' => 'list<string>',\n      'source_template' => 'Object',\n      'store_url' => 'string',\n      'style_list' => 'list<string>',\n      'tags' => 'list<string>',\n      'ui_property_list' => 'list<string>',\n      'unused_body_elements' => 'list<Object>',\n      'update_time' => 'int',\n      'use_retailer_item_ids' => 'bool',\n    );\n  }\n}\n", "num_lines": 100}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CatalogBasedTargetingFields extends AbstractEnum {\n\n  const GEO_TARGETING_TYPE = 'geo_targeting_type';\n\n  public function getFieldTypes() {\n    return array(\n      'geo_targeting_type' => 'string',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CatalogItemAppealStatusFields extends AbstractEnum {\n\n  const HANDLE = 'handle';\n  const ITEM_ID = 'item_id';\n  const STATUS = 'status';\n  const USE_CASES = 'use_cases';\n\n  public function getFieldTypes() {\n    return array(\n      'handle' => 'string',\n      'item_id' => 'int',\n      'status' => 'Status',\n      'use_cases' => 'list<Object>',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CatalogItemAppLinksFields extends AbstractEnum {\n\n  const ANDROID = 'android';\n  const IOS = 'ios';\n  const IPAD = 'ipad';\n  const IPHONE = 'iphone';\n  const WEB = 'web';\n  const WINDOWS = 'windows';\n  const WINDOWS_PHONE = 'windows_phone';\n  const WINDOWS_UNIVERSAL = 'windows_universal';\n\n  public function getFieldTypes() {\n    return array(\n      'android' => 'list<AndroidAppLink>',\n      'ios' => 'list<IosAppLink>',\n      'ipad' => 'list<IosAppLink>',\n      'iphone' => 'list<IosAppLink>',\n      'web' => 'WebAppLink',\n      'windows' => 'list<WindowsAppLink>',\n      'windows_phone' => 'list<WindowsPhoneAppLink>',\n      'windows_universal' => 'list<WindowsAppLink>',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CatalogItemChannelsToIntegrityStatusFields extends AbstractEnum {\n\n  const CHANNELS = 'channels';\n  const REJECTION_INFORMATION = 'rejection_information';\n\n  public function getFieldTypes() {\n    return array(\n      'channels' => 'list<string>',\n      'rejection_information' => 'Object',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CatalogSegmentAllMatchCountLaserFields extends AbstractEnum {\n\n  const DATE_START = 'date_start';\n  const DATE_STOP = 'date_stop';\n  const EVENT = 'event';\n  const SOURCE = 'source';\n  const TOTAL_MATCHED_CONTENT_IDS = 'total_matched_content_ids';\n  const UNIQUE_MATCHED_CONTENT_IDS = 'unique_matched_content_ids';\n\n  public function getFieldTypes() {\n    return array(\n      'date_start' => 'string',\n      'date_stop' => 'string',\n      'event' => 'string',\n      'source' => 'ExternalEventSource',\n      'total_matched_content_ids' => 'int',\n      'unique_matched_content_ids' => 'int',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CatalogSubVerticalListFields extends AbstractEnum {\n\n  const APPLIANCES = 'appliances';\n  const BABY_FEEDING = 'baby_feeding';\n  const BABY_TRANSPORT = 'baby_transport';\n  const BEAUTY = 'beauty';\n  const BEDDING = 'bedding';\n  const CAMERAS = 'cameras';\n  const CAMERAS_AND_PHOTOS = 'cameras_and_photos';\n  const CELL_PHONES_AND_SMART_WATCHES = 'cell_phones_and_smart_watches';\n  const CLEANING_SUPPLIES = 'cleaning_supplies';\n  const CLO_OFFER = 'clo_offer';\n  const CLOTHING = 'clothing';\n  const CLOTHING_ACCESSORIES = 'clothing_accessories';\n  const COMPUTER_COMPONENTS = 'computer_components';\n  const COMPUTERS_AND_TABLETS = 'computers_and_tablets';\n  const COMPUTERS_LAPTOPS_AND_TABLETS = 'computers_laptops_and_tablets';\n  const DIAPERING_AND_POTTY_TRAINING = 'diapering_and_potty_training';\n  const DIGITAL_PRODUCT_OFFER = 'digital_product_offer';\n  const ELECTRONIC_ACCESSORIES_AND_CABLES = 'electronic_accessories_and_cables';\n  const ELECTRONICS_ACCESSORIES = 'electronics_accessories';\n  const FURNITURE = 'furniture';\n  const HEALTH = 'health';\n  const HOME = 'home';\n  const HOME_GOODS = 'home_goods';\n  const HOUSEHOLD_AND_CLEANING_SUPPLIES = 'household_and_cleaning_supplies';\n  const JEWELRY = 'jewelry';\n  const LARGE_APPLIANCES = 'large_appliances';\n  const LOCAL_SERVICE_BUSINESS_ITEM = 'local_service_business_item';\n  const LOCAL_SERVICE_BUSINESS_RESTAURANT = 'local_service_business_restaurant';\n  const LOYALTY_OFFER = 'loyalty_offer';\n  const MEETUP_SPACE = 'meetup_space';\n  const NURSERY = 'nursery';\n  const PRINTERS_AND_SCANNERS = 'printers_and_scanners';\n  const PRINTERS_SCANNERS_AND_FAX_MACHINES = 'printers_scanners_and_fax_machines';\n  const PRODUCT_DISCOUNT = 'product_discount';\n  const PROJECTORS = 'projectors';\n  const SHOES = 'shoes';\n  const SHOES_AND_FOOTWEAR = 'shoes_and_footwear';\n  const SOFTWARE = 'software';\n  const TELEVISIONS_AND_MONITORS = 'televisions_and_monitors';\n  const TEST_CHILD_SUB_VERTICAL = 'test_child_sub_vertical';\n  const TEST_GRAND_CHILD_SUB_VERTICAL = 'test_grand_child_sub_vertical';\n  const TEST_SUB_VERTICAL = 'test_sub_vertical';\n  const TEST_SUB_VERTICAL_ALIAS = 'test_sub_vertical_alias';\n  const TEST_SUB_VERTICAL_DATA_OBJECT = 'test_sub_vertical_data_object';\n  const THIRD_PARTY_ELECTRONICS = 'third_party_electronics';\n  const THIRD_PARTY_TOYS_AND_GAMES = 'third_party_toys_and_games';\n  const TOYS = 'toys';\n  const TOYS_AND_GAMES = 'toys_and_games';\n  const TVS_AND_MONITORS = 'tvs_and_monitors';\n  const VEHICLE_MANUFACTURER = 'vehicle_manufacturer';\n  const VIDEO_GAME_CONSOLES_AND_VIDEO_GAMES = 'video_game_consoles_and_video_games';\n  const VIDEO_GAMES_AND_CONSOLES = 'video_games_and_consoles';\n  const VIDEO_PROJECTORS = 'video_projectors';\n  const WATCHES = 'watches';\n\n  public function getFieldTypes() {\n    return array(\n      'appliances' => 'Object',\n      'baby_feeding' => 'Object',\n      'baby_transport' => 'Object',\n      'beauty' => 'Object',\n      'bedding' => 'Object',\n      'cameras' => 'Object',\n      'cameras_and_photos' => 'Object',\n      'cell_phones_and_smart_watches' => 'Object',\n      'cleaning_supplies' => 'Object',\n      'clo_offer' => 'Object',\n      'clothing' => 'Object',\n      'clothing_accessories' => 'Object',\n      'computer_components' => 'Object',\n      'computers_and_tablets' => 'Object',\n      'computers_laptops_and_tablets' => 'Object',\n      'diapering_and_potty_training' => 'Object',\n      'digital_product_offer' => 'Object',\n      'electronic_accessories_and_cables' => 'Object',\n      'electronics_accessories' => 'Object',\n      'furniture' => 'Object',\n      'health' => 'Object',\n      'home' => 'Object',\n      'home_goods' => 'Object',\n      'household_and_cleaning_supplies' => 'Object',\n      'jewelry' => 'Object',\n      'large_appliances' => 'Object',\n      'local_service_business_item' => 'Object',\n      'local_service_business_restaurant' => 'Object',\n      'loyalty_offer' => 'Object',\n      'meetup_space' => 'Object',\n      'nursery' => 'Object',\n      'printers_and_scanners' => 'Object',\n      'printers_scanners_and_fax_machines' => 'Object',\n      'product_discount' => 'Object',\n      'projectors' => 'Object',\n      'shoes' => 'Object',\n      'shoes_and_footwear' => 'Object',\n      'software' => 'Object',\n      'televisions_and_monitors' => 'Object',\n      'test_child_sub_vertical' => 'Object',\n      'test_grand_child_sub_vertical' => 'Object',\n      'test_sub_vertical' => 'Object',\n      'test_sub_vertical_alias' => 'Object',\n      'test_sub_vertical_data_object' => 'Object',\n      'third_party_electronics' => 'Object',\n      'third_party_toys_and_games' => 'Object',\n      'toys' => 'Object',\n      'toys_and_games' => 'Object',\n      'tvs_and_monitors' => 'Object',\n      'vehicle_manufacturer' => 'Object',\n      'video_game_consoles_and_video_games' => 'Object',\n      'video_games_and_consoles' => 'Object',\n      'video_projectors' => 'Object',\n      'watches' => 'Object',\n    );\n  }\n}\n", "num_lines": 154}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ChatPluginFields extends AbstractEnum {\n\n  const ALIGNMENT = 'alignment';\n  const DESKTOP_BOTTOM_SPACING = 'desktop_bottom_spacing';\n  const DESKTOP_SIDE_SPACING = 'desktop_side_spacing';\n  const ENTRY_POINT_ICON = 'entry_point_icon';\n  const ENTRY_POINT_LABEL = 'entry_point_label';\n  const GREETING_DIALOG_DISPLAY = 'greeting_dialog_display';\n  const GUEST_CHAT_MODE = 'guest_chat_mode';\n  const MOBILE_BOTTOM_SPACING = 'mobile_bottom_spacing';\n  const MOBILE_CHAT_DISPLAY = 'mobile_chat_display';\n  const MOBILE_SIDE_SPACING = 'mobile_side_spacing';\n  const THEME_COLOR = 'theme_color';\n  const WELCOME_SCREEN_GREETING = 'welcome_screen_greeting';\n\n  public function getFieldTypes() {\n    return array(\n      'alignment' => 'string',\n      'desktop_bottom_spacing' => 'string',\n      'desktop_side_spacing' => 'string',\n      'entry_point_icon' => 'string',\n      'entry_point_label' => 'string',\n      'greeting_dialog_display' => 'string',\n      'guest_chat_mode' => 'string',\n      'mobile_bottom_spacing' => 'string',\n      'mobile_chat_display' => 'string',\n      'mobile_side_spacing' => 'string',\n      'theme_color' => 'string',\n      'welcome_screen_greeting' => 'string',\n    );\n  }\n}\n", "num_lines": 70}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CheckBatchRequestStatusFields extends AbstractEnum {\n\n  const ERRORS = 'errors';\n  const ERRORS_TOTAL_COUNT = 'errors_total_count';\n  const HANDLE = 'handle';\n  const IDS_OF_INVALID_REQUESTS = 'ids_of_invalid_requests';\n  const STATUS = 'status';\n  const WARNINGS = 'warnings';\n  const WARNINGS_TOTAL_COUNT = 'warnings_total_count';\n\n  public function getFieldTypes() {\n    return array(\n      'errors' => 'list<Object>',\n      'errors_total_count' => 'int',\n      'handle' => 'string',\n      'ids_of_invalid_requests' => 'list<string>',\n      'status' => 'string',\n      'warnings' => 'list<Object>',\n      'warnings_total_count' => 'int',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ChildEventFields extends AbstractEnum {\n\n  const END_TIME = 'end_time';\n  const ID = 'id';\n  const START_TIME = 'start_time';\n  const TICKET_URI = 'ticket_uri';\n\n  public function getFieldTypes() {\n    return array(\n      'end_time' => 'string',\n      'id' => 'string',\n      'start_time' => 'string',\n      'ticket_uri' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static ClickTrackingTagFields getInstance()\n */\nclass ClickTrackingTagFields extends AbstractEnum {\n\n  const ID = 'id';\n  const ADD_TEMPLATE_PARAM = 'add_template_param';\n  const URL = 'url';\n  const ADGROUP_ID = 'adgroup_id';\n}\n", "num_lines": 39}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CloudGameFields extends AbstractEnum {\n\n  const ID = 'id';\n  const NAME = 'name';\n  const OWNER = 'owner';\n  const PLAYABLE_AD_FILE_SIZE = 'playable_ad_file_size';\n  const PLAYABLE_AD_ORIENTATION = 'playable_ad_orientation';\n  const PLAYABLE_AD_PACKAGE_NAME = 'playable_ad_package_name';\n  const PLAYABLE_AD_REJECT_REASON = 'playable_ad_reject_reason';\n  const PLAYABLE_AD_STATUS = 'playable_ad_status';\n  const PLAYABLE_AD_UPLOAD_TIME = 'playable_ad_upload_time';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'name' => 'string',\n      'owner' => 'Profile',\n      'playable_ad_file_size' => 'unsigned int',\n      'playable_ad_orientation' => 'string',\n      'playable_ad_package_name' => 'string',\n      'playable_ad_reject_reason' => 'string',\n      'playable_ad_status' => 'string',\n      'playable_ad_upload_time' => 'datetime',\n    );\n  }\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CollaborativeAdsPartnerInfoListItemFields extends AbstractEnum {\n\n\n  public function getFieldTypes() {\n    return array(\n    );\n  }\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CollaborativeAdsShareSettingsFields extends AbstractEnum {\n\n  const AGENCY_BUSINESS = 'agency_business';\n  const ID = 'id';\n  const PRODUCT_CATALOG_PROXY_ID = 'product_catalog_proxy_id';\n  const UTM_CAMPAIGN = 'utm_campaign';\n  const UTM_MEDIUM = 'utm_medium';\n  const UTM_SOURCE = 'utm_source';\n\n  public function getFieldTypes() {\n    return array(\n      'agency_business' => 'Business',\n      'id' => 'string',\n      'product_catalog_proxy_id' => 'string',\n      'utm_campaign' => 'string',\n      'utm_medium' => 'string',\n      'utm_source' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CommentFields extends AbstractEnum {\n\n  const ADMIN_CREATOR = 'admin_creator';\n  const APPLICATION = 'application';\n  const ATTACHMENT = 'attachment';\n  const CAN_COMMENT = 'can_comment';\n  const CAN_HIDE = 'can_hide';\n  const CAN_LIKE = 'can_like';\n  const CAN_REMOVE = 'can_remove';\n  const CAN_REPLY_PRIVATELY = 'can_reply_privately';\n  const COMMENT_COUNT = 'comment_count';\n  const CREATED_TIME = 'created_time';\n  const FROM = 'from';\n  const ID = 'id';\n  const IS_HIDDEN = 'is_hidden';\n  const IS_PRIVATE = 'is_private';\n  const LIKE_COUNT = 'like_count';\n  const LIVE_BROADCAST_TIMESTAMP = 'live_broadcast_timestamp';\n  const MESSAGE = 'message';\n  const MESSAGE_TAGS = 'message_tags';\n  const OBJECT = 'object';\n  const PARENT = 'parent';\n  const PERMALINK_URL = 'permalink_url';\n  const PRIVATE_REPLY_CONVERSATION = 'private_reply_conversation';\n  const USER_LIKES = 'user_likes';\n\n  public function getFieldTypes() {\n    return array(\n      'admin_creator' => 'User',\n      'application' => 'Application',\n      'attachment' => 'Object',\n      'can_comment' => 'bool',\n      'can_hide' => 'bool',\n      'can_like' => 'bool',\n      'can_remove' => 'bool',\n      'can_reply_privately' => 'bool',\n      'comment_count' => 'unsigned int',\n      'created_time' => 'datetime',\n      'from' => 'Object',\n      'id' => 'string',\n      'is_hidden' => 'bool',\n      'is_private' => 'bool',\n      'like_count' => 'unsigned int',\n      'live_broadcast_timestamp' => 'unsigned int',\n      'message' => 'string',\n      'message_tags' => 'list<EntityAtTextRange>',\n      'object' => 'Object',\n      'parent' => 'Comment',\n      'permalink_url' => 'Object',\n      'private_reply_conversation' => 'Object',\n      'user_likes' => 'bool',\n    );\n  }\n}\n", "num_lines": 92}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CommerceMerchantSettingsFields extends AbstractEnum {\n\n  const BRAINTREE_MERCHANT_ID = 'braintree_merchant_id';\n  const CHECKOUT_MESSAGE = 'checkout_message';\n  const COMMERCE_STORE = 'commerce_store';\n  const CONTACT_EMAIL = 'contact_email';\n  const CTA = 'cta';\n  const DISABLE_CHECKOUT_URLS = 'disable_checkout_urls';\n  const DISPLAY_NAME = 'display_name';\n  const EXTERNAL_MERCHANT_ID = 'external_merchant_id';\n  const FACEBOOK_CHANNEL = 'facebook_channel';\n  const FEATURE_ELIGIBILITY = 'feature_eligibility';\n  const HAS_DISCOUNT_CODE = 'has_discount_code';\n  const HAS_ONSITE_INTENT = 'has_onsite_intent';\n  const ID = 'id';\n  const INSTAGRAM_CHANNEL = 'instagram_channel';\n  const MERCHANT_ALERT_EMAIL = 'merchant_alert_email';\n  const MERCHANT_PAGE = 'merchant_page';\n  const MERCHANT_STATUS = 'merchant_status';\n  const ONSITE_COMMERCE_MERCHANT = 'onsite_commerce_merchant';\n  const PAYMENT_PROVIDER = 'payment_provider';\n  const PRIVACY_URL_BY_LOCALE = 'privacy_url_by_locale';\n  const REVIEW_REJECTION_MESSAGES = 'review_rejection_messages';\n  const REVIEW_REJECTION_REASONS = 'review_rejection_reasons';\n  const SUPPORTED_CARD_TYPES = 'supported_card_types';\n  const TERMS = 'terms';\n  const TERMS_URL_BY_LOCALE = 'terms_url_by_locale';\n  const WHATSAPP_CHANNEL = 'whatsapp_channel';\n\n  public function getFieldTypes() {\n    return array(\n      'braintree_merchant_id' => 'string',\n      'checkout_message' => 'string',\n      'commerce_store' => 'Object',\n      'contact_email' => 'string',\n      'cta' => 'string',\n      'disable_checkout_urls' => 'bool',\n      'display_name' => 'string',\n      'external_merchant_id' => 'string',\n      'facebook_channel' => 'Object',\n      'feature_eligibility' => 'Object',\n      'has_discount_code' => 'bool',\n      'has_onsite_intent' => 'bool',\n      'id' => 'string',\n      'instagram_channel' => 'Object',\n      'merchant_alert_email' => 'string',\n      'merchant_page' => 'Profile',\n      'merchant_status' => 'string',\n      'onsite_commerce_merchant' => 'Object',\n      'payment_provider' => 'string',\n      'privacy_url_by_locale' => 'list<map<string, string>>',\n      'review_rejection_messages' => 'list<string>',\n      'review_rejection_reasons' => 'list<string>',\n      'supported_card_types' => 'list<string>',\n      'terms' => 'string',\n      'terms_url_by_locale' => 'list<map<string, string>>',\n      'whatsapp_channel' => 'Object',\n    );\n  }\n}\n", "num_lines": 98}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CommerceMerchantSettingsSetupStatusFields extends AbstractEnum {\n\n  const DEALS_SETUP = 'deals_setup';\n  const MARKETPLACE_APPROVAL_STATUS = 'marketplace_approval_status';\n  const MARKETPLACE_APPROVAL_STATUS_DETAILS = 'marketplace_approval_status_details';\n  const PAYMENT_SETUP = 'payment_setup';\n  const REVIEW_STATUS = 'review_status';\n  const SHOP_SETUP = 'shop_setup';\n\n  public function getFieldTypes() {\n    return array(\n      'deals_setup' => 'string',\n      'marketplace_approval_status' => 'string',\n      'marketplace_approval_status_details' => 'Object',\n      'payment_setup' => 'string',\n      'review_status' => 'Object',\n      'shop_setup' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CommerceOrderFields extends AbstractEnum {\n\n  const BUYER_DETAILS = 'buyer_details';\n  const CHANNEL = 'channel';\n  const CREATED = 'created';\n  const ESTIMATED_PAYMENT_DETAILS = 'estimated_payment_details';\n  const ID = 'id';\n  const IS_GROUP_BUY = 'is_group_buy';\n  const IS_TEST_ORDER = 'is_test_order';\n  const LAST_UPDATED = 'last_updated';\n  const MERCHANT_ORDER_ID = 'merchant_order_id';\n  const ORDER_STATUS = 'order_status';\n  const SELECTED_SHIPPING_OPTION = 'selected_shipping_option';\n  const SHIP_BY_DATE = 'ship_by_date';\n  const SHIPPING_ADDRESS = 'shipping_address';\n\n  public function getFieldTypes() {\n    return array(\n      'buyer_details' => 'Object',\n      'channel' => 'string',\n      'created' => 'string',\n      'estimated_payment_details' => 'Object',\n      'id' => 'string',\n      'is_group_buy' => 'bool',\n      'is_test_order' => 'bool',\n      'last_updated' => 'string',\n      'merchant_order_id' => 'string',\n      'order_status' => 'Object',\n      'selected_shipping_option' => 'Object',\n      'ship_by_date' => 'string',\n      'shipping_address' => 'Object',\n    );\n  }\n}\n", "num_lines": 72}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CommerceOrderTransactionDetailFields extends AbstractEnum {\n\n  const NET_PAYMENT_AMOUNT = 'net_payment_amount';\n  const ORDER_DETAILS = 'order_details';\n  const PAYOUT_REFERENCE_ID = 'payout_reference_id';\n  const PROCESSING_FEE = 'processing_fee';\n  const TAX_RATE = 'tax_rate';\n  const TRANSACTION_DATE = 'transaction_date';\n  const TRANSACTION_TYPE = 'transaction_type';\n  const TRANSFER_ID = 'transfer_id';\n  const ID = 'id';\n\n  public function getFieldTypes() {\n    return array(\n      'net_payment_amount' => 'Object',\n      'order_details' => 'CommerceOrder',\n      'payout_reference_id' => 'string',\n      'processing_fee' => 'Object',\n      'tax_rate' => 'string',\n      'transaction_date' => 'string',\n      'transaction_type' => 'string',\n      'transfer_id' => 'string',\n      'id' => 'string',\n    );\n  }\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CommercePayoutFields extends AbstractEnum {\n\n  const AMOUNT = 'amount';\n  const PAYOUT_DATE = 'payout_date';\n  const PAYOUT_REFERENCE_ID = 'payout_reference_id';\n  const STATUS = 'status';\n  const TRANSFER_ID = 'transfer_id';\n\n  public function getFieldTypes() {\n    return array(\n      'amount' => 'Object',\n      'payout_date' => 'string',\n      'payout_reference_id' => 'string',\n      'status' => 'string',\n      'transfer_id' => 'string',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CommerceSettingsFields extends AbstractEnum {\n\n  const INVENTORY = 'inventory';\n  const TOTAL_INVENTORY = 'total_inventory';\n\n  public function getFieldTypes() {\n    return array(\n      'inventory' => 'int',\n      'total_inventory' => 'int',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ConnectionsTargetingFields extends AbstractEnum {\n\n  const ID = 'id';\n  const NAME = 'name';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'name' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ContextualBundlingSpecFields extends AbstractEnum {\n\n  const STATUS = 'status';\n\n  public function getFieldTypes() {\n    return array(\n      'status' => 'string',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ConversionActionQueryFields extends AbstractEnum {\n\n  const FIELD_ACTION_TYPE = 'action.type';\n  const APPLICATION = 'application';\n  const CONVERSION_ID = 'conversion_id';\n  const CREATIVE = 'creative';\n  const DATASET = 'dataset';\n  const EVENT = 'event';\n  const FIELD_EVENT_CREATOR = 'event.creator';\n  const EVENT_TYPE = 'event_type';\n  const FB_PIXEL = 'fb_pixel';\n  const FB_PIXEL_EVENT = 'fb_pixel_event';\n  const LEADGEN = 'leadgen';\n  const OBJECT = 'object';\n  const FIELD_OBJECT_DOMAIN = 'object.domain';\n  const OFFER = 'offer';\n  const FIELD_OFFER_CREATOR = 'offer.creator';\n  const OFFSITE_PIXEL = 'offsite_pixel';\n  const PAGE = 'page';\n  const FIELD_PAGE_PARENT = 'page.parent';\n  const POST = 'post';\n  const FIELD_POST_OBJECT = 'post.object';\n  const FIELD_POST_OBJECT_WALL = 'post.object.wall';\n  const FIELD_POST_WALL = 'post.wall';\n  const QUESTION = 'question';\n  const FIELD_QUESTION_CREATOR = 'question.creator';\n  const RESPONSE = 'response';\n  const SUBTYPE = 'subtype';\n\n  public function getFieldTypes() {\n    return array(\n      'action.type' => 'list<Object>',\n      'application' => 'list<Object>',\n      'conversion_id' => 'list<string>',\n      'creative' => 'list<Object>',\n      'dataset' => 'list<string>',\n      'event' => 'list<string>',\n      'event.creator' => 'list<string>',\n      'event_type' => 'list<string>',\n      'fb_pixel' => 'list<string>',\n      'fb_pixel_event' => 'list<string>',\n      'leadgen' => 'list<string>',\n      'object' => 'list<string>',\n      'object.domain' => 'list<string>',\n      'offer' => 'list<string>',\n      'offer.creator' => 'list<string>',\n      'offsite_pixel' => 'list<string>',\n      'page' => 'list<string>',\n      'page.parent' => 'list<string>',\n      'post' => 'list<string>',\n      'post.object' => 'list<string>',\n      'post.object.wall' => 'list<string>',\n      'post.wall' => 'list<string>',\n      'question' => 'list<string>',\n      'question.creator' => 'list<string>',\n      'response' => 'list<string>',\n      'subtype' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 98}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CopyrightReferenceContainerFields extends AbstractEnum {\n\n  const CONTENT_TYPE = 'content_type';\n  const COPYRIGHT_CREATION_TIME = 'copyright_creation_time';\n  const DOWNLOAD_HD_URL = 'download_hd_url';\n  const DURATION_IN_SEC = 'duration_in_sec';\n  const ID = 'id';\n  const ISWC = 'iswc';\n  const METADATA = 'metadata';\n  const PUBLISHED_TIME = 'published_time';\n  const THUMBNAIL_URL = 'thumbnail_url';\n  const TITLE = 'title';\n  const UNIVERSAL_CONTENT_ID = 'universal_content_id';\n  const WRITER_NAMES = 'writer_names';\n\n  public function getFieldTypes() {\n    return array(\n      'content_type' => 'string',\n      'copyright_creation_time' => 'datetime',\n      'download_hd_url' => 'string',\n      'duration_in_sec' => 'float',\n      'id' => 'string',\n      'iswc' => 'string',\n      'metadata' => 'Object',\n      'published_time' => 'datetime',\n      'thumbnail_url' => 'string',\n      'title' => 'string',\n      'universal_content_id' => 'string',\n      'writer_names' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 70}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CoverPhotoFields extends AbstractEnum {\n\n  const COVER_ID = 'cover_id';\n  const ID = 'id';\n  const OFFSET_X = 'offset_x';\n  const OFFSET_Y = 'offset_y';\n  const SOURCE = 'source';\n\n  public function getFieldTypes() {\n    return array(\n      'cover_id' => 'string',\n      'id' => 'string',\n      'offset_x' => 'float',\n      'offset_y' => 'float',\n      'source' => 'string',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CPASAdvertiserPartnershipRecommendationFields extends AbstractEnum {\n\n  const ADVERTISER_BUSINESS_ID = 'advertiser_business_id';\n  const BRAND_BUSINESS_ID = 'brand_business_id';\n  const BRANDS = 'brands';\n  const COUNTRIES = 'countries';\n  const ID = 'id';\n  const MERCHANT_BUSINESS_ID = 'merchant_business_id';\n  const MERCHANT_CATEGORIES = 'merchant_categories';\n  const STATUS = 'status';\n  const STATUS_REASON = 'status_reason';\n\n  public function getFieldTypes() {\n    return array(\n      'advertiser_business_id' => 'string',\n      'brand_business_id' => 'string',\n      'brands' => 'list<string>',\n      'countries' => 'list<string>',\n      'id' => 'string',\n      'merchant_business_id' => 'string',\n      'merchant_categories' => 'list<string>',\n      'status' => 'string',\n      'status_reason' => 'string',\n    );\n  }\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CPASBusinessSetupConfigFields extends AbstractEnum {\n\n  const ACCEPTED_COLLAB_ADS_TOS = 'accepted_collab_ads_tos';\n  const BUSINESS = 'business';\n  const BUSINESS_CAPABILITIES_STATUS = 'business_capabilities_status';\n  const CAPABILITIES_COMPLIANCE_STATUS = 'capabilities_compliance_status';\n  const ID = 'id';\n  const AD_ACCOUNTS = 'ad_accounts';\n\n  public function getFieldTypes() {\n    return array(\n      'accepted_collab_ads_tos' => 'bool',\n      'business' => 'Business',\n      'business_capabilities_status' => 'list<map<string, string>>',\n      'capabilities_compliance_status' => 'list<map<string, Object>>',\n      'id' => 'string',\n      'ad_accounts' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CPASCollaborationRequestFields extends AbstractEnum {\n\n  const BRANDS = 'brands';\n  const CONTACT_EMAIL = 'contact_email';\n  const CONTACT_FIRST_NAME = 'contact_first_name';\n  const CONTACT_LAST_NAME = 'contact_last_name';\n  const ID = 'id';\n  const PHONE_NUMBER = 'phone_number';\n  const RECEIVER_BUSINESS = 'receiver_business';\n  const REQUESTER_AGENCY_OR_BRAND = 'requester_agency_or_brand';\n  const SENDER_CLIENT_BUSINESS = 'sender_client_business';\n  const STATUS = 'status';\n\n  public function getFieldTypes() {\n    return array(\n      'brands' => 'list<string>',\n      'contact_email' => 'string',\n      'contact_first_name' => 'string',\n      'contact_last_name' => 'string',\n      'id' => 'string',\n      'phone_number' => 'string',\n      'receiver_business' => 'Business',\n      'requester_agency_or_brand' => 'string',\n      'sender_client_business' => 'Business',\n      'status' => 'string',\n    );\n  }\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CPASMerchantConfigFields extends AbstractEnum {\n\n  const ACCEPTED_TOS = 'accepted_tos';\n  const BETA_FEATURES = 'beta_features';\n  const BUSINESS_OUTCOMES_STATUS = 'business_outcomes_status';\n  const ID = 'id';\n  const IS_TEST_MERCHANT = 'is_test_merchant';\n  const OUTCOMES_COMPLIANCE_STATUS = 'outcomes_compliance_status';\n  const QUALIFIED_TO_ONBOARD = 'qualified_to_onboard';\n\n  public function getFieldTypes() {\n    return array(\n      'accepted_tos' => 'bool',\n      'beta_features' => 'list<string>',\n      'business_outcomes_status' => 'list<map<string, string>>',\n      'id' => 'string',\n      'is_test_merchant' => 'bool',\n      'outcomes_compliance_status' => 'list<map<string, Object>>',\n      'qualified_to_onboard' => 'bool',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CreativeHistoryFields extends AbstractEnum {\n\n  const CREATIVE_FINGERPRINT = 'creative_fingerprint';\n  const TIME_RANGES = 'time_ranges';\n\n  public function getFieldTypes() {\n    return array(\n      'creative_fingerprint' => 'int',\n      'time_ranges' => 'list<Object>',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CreditCardFields extends AbstractEnum {\n\n  const BILLING_ADDRESS = 'billing_address';\n  const CARD_COBADGING = 'card_cobadging';\n  const CARD_HOLDER_NAME = 'card_holder_name';\n  const CARD_TYPE = 'card_type';\n  const CREDENTIAL_ID = 'credential_id';\n  const DEFAULT_RECEIVING_METHOD_PRODUCTS = 'default_receiving_method_products';\n  const EXPIRY_MONTH = 'expiry_month';\n  const EXPIRY_YEAR = 'expiry_year';\n  const ID = 'id';\n  const IS_CVV_TRICKY_BIN = 'is_cvv_tricky_bin';\n  const IS_ENABLED = 'is_enabled';\n  const IS_LAST_USED = 'is_last_used';\n  const IS_NETWORK_TOKENIZED_IN_INDIA = 'is_network_tokenized_in_india';\n  const IS_SOFT_DISABLED = 'is_soft_disabled';\n  const IS_USER_VERIFIED = 'is_user_verified';\n  const IS_ZIP_VERIFIED = 'is_zip_verified';\n  const LAST4 = 'last4';\n  const READABLE_CARD_TYPE = 'readable_card_type';\n  const TIME_CREATED = 'time_created';\n  const TIME_CREATED_TS = 'time_created_ts';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'billing_address' => 'Object',\n      'card_cobadging' => 'string',\n      'card_holder_name' => 'string',\n      'card_type' => 'string',\n      'credential_id' => 'int',\n      'default_receiving_method_products' => 'list<string>',\n      'expiry_month' => 'string',\n      'expiry_year' => 'string',\n      'id' => 'string',\n      'is_cvv_tricky_bin' => 'bool',\n      'is_enabled' => 'bool',\n      'is_last_used' => 'bool',\n      'is_network_tokenized_in_india' => 'bool',\n      'is_soft_disabled' => 'bool',\n      'is_user_verified' => 'bool',\n      'is_zip_verified' => 'bool',\n      'last4' => 'string',\n      'readable_card_type' => 'string',\n      'time_created' => 'datetime',\n      'time_created_ts' => 'int',\n      'type' => 'string',\n    );\n  }\n}\n", "num_lines": 88}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CreditPartitionActionOptionsFields extends AbstractEnum {\n\n  const LIABILITY_TYPE = 'liability_type';\n  const PARTITION_TYPE = 'partition_type';\n  const SEND_BILL_TO = 'send_bill_to';\n\n  public function getFieldTypes() {\n    return array(\n      'liability_type' => 'Object',\n      'partition_type' => 'Object',\n      'send_bill_to' => 'Object',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CRMAddressFields extends AbstractEnum {\n\n  const CITY = 'city';\n  const CNPJ_TAX_ID = 'cnpj_tax_id';\n  const COUNTRY = 'country';\n  const ID = 'id';\n  const POSTAL_CODE = 'postal_code';\n  const REGISTRATION_LABEL = 'registration_label';\n  const REGISTRATION_NUMBER = 'registration_number';\n  const STATE = 'state';\n  const STREET1 = 'street1';\n  const STREET2 = 'street2';\n  const STREET3 = 'street3';\n  const STREET4 = 'street4';\n  const VALIDATION_STATUS = 'validation_status';\n  const VAT_TAX_ID = 'vat_tax_id';\n\n  public function getFieldTypes() {\n    return array(\n      'city' => 'string',\n      'cnpj_tax_id' => 'string',\n      'country' => 'string',\n      'id' => 'string',\n      'postal_code' => 'string',\n      'registration_label' => 'string',\n      'registration_number' => 'string',\n      'state' => 'string',\n      'street1' => 'string',\n      'street2' => 'string',\n      'street3' => 'string',\n      'street4' => 'string',\n      'validation_status' => 'string',\n      'vat_tax_id' => 'string',\n    );\n  }\n}\n", "num_lines": 74}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CurrencyAmountFields extends AbstractEnum {\n\n  const AMOUNT = 'amount';\n  const AMOUNT_IN_HUNDREDTHS = 'amount_in_hundredths';\n  const CURRENCY = 'currency';\n  const OFFSETTED_AMOUNT = 'offsetted_amount';\n\n  public function getFieldTypes() {\n    return array(\n      'amount' => 'string',\n      'amount_in_hundredths' => 'string',\n      'currency' => 'string',\n      'offsetted_amount' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CurrencyFields extends AbstractEnum {\n\n  const CURRENCY_OFFSET = 'currency_offset';\n  const USD_EXCHANGE = 'usd_exchange';\n  const USD_EXCHANGE_INVERSE = 'usd_exchange_inverse';\n  const USER_CURRENCY = 'user_currency';\n\n  public function getFieldTypes() {\n    return array(\n      'currency_offset' => 'unsigned int',\n      'usd_exchange' => 'float',\n      'usd_exchange_inverse' => 'float',\n      'user_currency' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudienceAdAccountFields extends AbstractEnum {\n\n  const ID = 'id';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudienceDataSourceFields extends AbstractEnum {\n\n  const CREATION_PARAMS = 'creation_params';\n  const SUB_TYPE = 'sub_type';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'creation_params' => 'string',\n      'sub_type' => 'SubType',\n      'type' => 'Type',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudienceFields extends AbstractEnum {\n\n  const ACCOUNT_ID = 'account_id';\n  const APPROXIMATE_COUNT_LOWER_BOUND = 'approximate_count_lower_bound';\n  const APPROXIMATE_COUNT_UPPER_BOUND = 'approximate_count_upper_bound';\n  const CUSTOMER_FILE_SOURCE = 'customer_file_source';\n  const DATA_SOURCE = 'data_source';\n  const DATA_SOURCE_TYPES = 'data_source_types';\n  const DATAFILE_CUSTOM_AUDIENCE_UPLOADING_STATUS = 'datafile_custom_audience_uploading_status';\n  const DELETE_TIME = 'delete_time';\n  const DELIVERY_STATUS = 'delivery_status';\n  const DESCRIPTION = 'description';\n  const EXCLUDED_CUSTOM_AUDIENCES = 'excluded_custom_audiences';\n  const EXTERNAL_EVENT_SOURCE = 'external_event_source';\n  const HOUSEHOLD_AUDIENCE = 'household_audience';\n  const ID = 'id';\n  const INCLUDED_CUSTOM_AUDIENCES = 'included_custom_audiences';\n  const IS_HOUSEHOLD = 'is_household';\n  const IS_SNAPSHOT = 'is_snapshot';\n  const IS_VALUE_BASED = 'is_value_based';\n  const LOOKALIKE_AUDIENCE_IDS = 'lookalike_audience_ids';\n  const LOOKALIKE_SPEC = 'lookalike_spec';\n  const NAME = 'name';\n  const OPERATION_STATUS = 'operation_status';\n  const OPT_OUT_LINK = 'opt_out_link';\n  const OWNER_BUSINESS = 'owner_business';\n  const PAGE_DELETION_MARKED_DELETE_TIME = 'page_deletion_marked_delete_time';\n  const PERMISSION_FOR_ACTIONS = 'permission_for_actions';\n  const PIXEL_ID = 'pixel_id';\n  const REGULATED_AUDIENCE_SPEC = 'regulated_audience_spec';\n  const RETENTION_DAYS = 'retention_days';\n  const REV_SHARE_POLICY_ID = 'rev_share_policy_id';\n  const RULE = 'rule';\n  const RULE_AGGREGATION = 'rule_aggregation';\n  const RULE_V2 = 'rule_v2';\n  const SEED_AUDIENCE = 'seed_audience';\n  const SHARING_STATUS = 'sharing_status';\n  const SUBTYPE = 'subtype';\n  const TIME_CONTENT_UPDATED = 'time_content_updated';\n  const TIME_CREATED = 'time_created';\n  const TIME_UPDATED = 'time_updated';\n  const ALLOWED_DOMAINS = 'allowed_domains';\n  const ASSOCIATED_AUDIENCE_ID = 'associated_audience_id';\n  const CLAIM_OBJECTIVE = 'claim_objective';\n  const CONTENT_TYPE = 'content_type';\n  const COUNTRIES = 'countries';\n  const CREATION_PARAMS = 'creation_params';\n  const DATASET_ID = 'dataset_id';\n  const ENABLE_FETCH_OR_CREATE = 'enable_fetch_or_create';\n  const EVENT_SOURCE_GROUP = 'event_source_group';\n  const EVENT_SOURCES = 'event_sources';\n  const EXCLUSIONS = 'exclusions';\n  const INCLUSIONS = 'inclusions';\n  const LIST_OF_ACCOUNTS = 'list_of_accounts';\n  const ORIGIN_AUDIENCE_ID = 'origin_audience_id';\n  const PARENT_AUDIENCE_ID = 'parent_audience_id';\n  const PARTNER_REFERENCE_KEY = 'partner_reference_key';\n  const PREFILL = 'prefill';\n  const PRODUCT_SET_ID = 'product_set_id';\n  const USE_IN_CAMPAIGNS = 'use_in_campaigns';\n  const VIDEO_GROUP_IDS = 'video_group_ids';\n\n  public function getFieldTypes() {\n    return array(\n      'account_id' => 'string',\n      'approximate_count_lower_bound' => 'int',\n      'approximate_count_upper_bound' => 'int',\n      'customer_file_source' => 'string',\n      'data_source' => 'CustomAudienceDataSource',\n      'data_source_types' => 'string',\n      'datafile_custom_audience_uploading_status' => 'string',\n      'delete_time' => 'int',\n      'delivery_status' => 'CustomAudienceStatus',\n      'description' => 'string',\n      'excluded_custom_audiences' => 'list<CustomAudience>',\n      'external_event_source' => 'AdsPixel',\n      'household_audience' => 'int',\n      'id' => 'string',\n      'included_custom_audiences' => 'list<CustomAudience>',\n      'is_household' => 'bool',\n      'is_snapshot' => 'bool',\n      'is_value_based' => 'bool',\n      'lookalike_audience_ids' => 'list<string>',\n      'lookalike_spec' => 'LookalikeSpec',\n      'name' => 'string',\n      'operation_status' => 'CustomAudienceStatus',\n      'opt_out_link' => 'string',\n      'owner_business' => 'Business',\n      'page_deletion_marked_delete_time' => 'int',\n      'permission_for_actions' => 'AudiencePermissionForActions',\n      'pixel_id' => 'string',\n      'regulated_audience_spec' => 'LookalikeSpec',\n      'retention_days' => 'int',\n      'rev_share_policy_id' => 'unsigned int',\n      'rule' => 'string',\n      'rule_aggregation' => 'string',\n      'rule_v2' => 'string',\n      'seed_audience' => 'int',\n      'sharing_status' => 'CustomAudienceSharingStatus',\n      'subtype' => 'string',\n      'time_content_updated' => 'unsigned int',\n      'time_created' => 'unsigned int',\n      'time_updated' => 'unsigned int',\n      'allowed_domains' => 'list<string>',\n      'associated_audience_id' => 'unsigned int',\n      'claim_objective' => 'ClaimObjective',\n      'content_type' => 'ContentType',\n      'countries' => 'string',\n      'creation_params' => 'map',\n      'dataset_id' => 'string',\n      'enable_fetch_or_create' => 'bool',\n      'event_source_group' => 'string',\n      'event_sources' => 'list<map>',\n      'exclusions' => 'list<Object>',\n      'inclusions' => 'list<Object>',\n      'list_of_accounts' => 'list<unsigned int>',\n      'origin_audience_id' => 'string',\n      'parent_audience_id' => 'unsigned int',\n      'partner_reference_key' => 'string',\n      'prefill' => 'bool',\n      'product_set_id' => 'string',\n      'use_in_campaigns' => 'bool',\n      'video_group_ids' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 164}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudienceGroupFields extends AbstractEnum {\n\n  const AUDIENCE_TYPE_PARAM_NAME = 'audience_type_param_name';\n  const EXISTING_CUSTOMER_TAG = 'existing_customer_tag';\n  const NEW_CUSTOMER_TAG = 'new_customer_tag';\n\n  public function getFieldTypes() {\n    return array(\n      'audience_type_param_name' => 'string',\n      'existing_customer_tag' => 'string',\n      'new_customer_tag' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static CustomAudienceMultikeySchemaFields getInstance()\n */\nclass CustomAudienceMultikeySchemaFields extends AbstractEnum {\n\n  const EXTERN_ID = 'EXTERN_ID';\n  const EMAIL = 'EMAIL';\n  const PHONE = 'PHONE';\n  const GENDER = 'GEN';\n  const BIRTH_YEAR = 'DOBY';\n  const BIRTH_MONTH = 'DOBM';\n  const BIRTH_DATE = 'DOBD';\n  const LAST_NAME = 'LN';\n  const FIRST_NAME = 'FN';\n  const FIRST_NAME_INITIAL = 'FI';\n  const CITY = 'CT';\n  const STATE = 'ST';\n  const ZIP = 'ZIP';\n  const MADID = 'MADID';\n  const COUNTRY = 'COUNTRY';\n  const FB_USER_ID = 'APPUID';\n  const LOOKALIKE_VALUE = 'LOOKALIKE_VALUE';\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudienceSessionFields extends AbstractEnum {\n\n  const END_TIME = 'end_time';\n  const NUM_INVALID_ENTRIES = 'num_invalid_entries';\n  const NUM_MATCHED = 'num_matched';\n  const NUM_RECEIVED = 'num_received';\n  const PROGRESS = 'progress';\n  const SESSION_ID = 'session_id';\n  const STAGE = 'stage';\n  const START_TIME = 'start_time';\n\n  public function getFieldTypes() {\n    return array(\n      'end_time' => 'string',\n      'num_invalid_entries' => 'string',\n      'num_matched' => 'string',\n      'num_received' => 'string',\n      'progress' => 'string',\n      'session_id' => 'string',\n      'stage' => 'string',\n      'start_time' => 'string',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudiencesharedAccountInfoFields extends AbstractEnum {\n\n  const ACCOUNT_ID = 'account_id';\n  const ACCOUNT_NAME = 'account_name';\n  const BUSINESS_ID = 'business_id';\n  const BUSINESS_NAME = 'business_name';\n  const SHARING_STATUS = 'sharing_status';\n\n  public function getFieldTypes() {\n    return array(\n      'account_id' => 'string',\n      'account_name' => 'string',\n      'business_id' => 'string',\n      'business_name' => 'string',\n      'sharing_status' => 'string',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudienceSharingStatusFields extends AbstractEnum {\n\n  const SHARING_RELATIONSHIP_ID = 'sharing_relationship_id';\n  const STATUS = 'status';\n\n  public function getFieldTypes() {\n    return array(\n      'sharing_relationship_id' => 'unsigned int',\n      'status' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudienceStatusFields extends AbstractEnum {\n\n  const CODE = 'code';\n  const DESCRIPTION = 'description';\n\n  public function getFieldTypes() {\n    return array(\n      'code' => 'unsigned int',\n      'description' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomAudiencesTOSFields extends AbstractEnum {\n\n  const CONTENT = 'content';\n  const ID = 'id';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'content' => 'string',\n      'id' => 'string',\n      'type' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomConversionFields extends AbstractEnum {\n\n  const ACCOUNT_ID = 'account_id';\n  const AGGREGATION_RULE = 'aggregation_rule';\n  const BUSINESS = 'business';\n  const CREATION_TIME = 'creation_time';\n  const CUSTOM_EVENT_TYPE = 'custom_event_type';\n  const DATA_SOURCES = 'data_sources';\n  const DEFAULT_CONVERSION_VALUE = 'default_conversion_value';\n  const DESCRIPTION = 'description';\n  const EVENT_SOURCE_TYPE = 'event_source_type';\n  const FIRST_FIRED_TIME = 'first_fired_time';\n  const ID = 'id';\n  const IS_ARCHIVED = 'is_archived';\n  const IS_UNAVAILABLE = 'is_unavailable';\n  const LAST_FIRED_TIME = 'last_fired_time';\n  const NAME = 'name';\n  const OFFLINE_CONVERSION_DATA_SET = 'offline_conversion_data_set';\n  const PIXEL = 'pixel';\n  const RETENTION_DAYS = 'retention_days';\n  const RULE = 'rule';\n  const ADVANCED_RULE = 'advanced_rule';\n  const EVENT_SOURCE_ID = 'event_source_id';\n  const CUSTOM_CONVERSION_ID = 'custom_conversion_id';\n\n  public function getFieldTypes() {\n    return array(\n      'account_id' => 'string',\n      'aggregation_rule' => 'string',\n      'business' => 'Business',\n      'creation_time' => 'datetime',\n      'custom_event_type' => 'CustomEventType',\n      'data_sources' => 'list<ExternalEventSource>',\n      'default_conversion_value' => 'int',\n      'description' => 'string',\n      'event_source_type' => 'string',\n      'first_fired_time' => 'datetime',\n      'id' => 'string',\n      'is_archived' => 'bool',\n      'is_unavailable' => 'bool',\n      'last_fired_time' => 'datetime',\n      'name' => 'string',\n      'offline_conversion_data_set' => 'OfflineConversionDataSet',\n      'pixel' => 'AdsPixel',\n      'retention_days' => 'unsigned int',\n      'rule' => 'string',\n      'advanced_rule' => 'string',\n      'event_source_id' => 'string',\n      'custom_conversion_id' => 'string',\n    );\n  }\n}\n", "num_lines": 90}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomConversionStatsResultFields extends AbstractEnum {\n\n  const AGGREGATION = 'aggregation';\n  const DATA = 'data';\n  const TIMESTAMP = 'timestamp';\n\n  public function getFieldTypes() {\n    return array(\n      'aggregation' => 'Aggregation',\n      'data' => 'list<Object>',\n      'timestamp' => 'datetime',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass CustomUserSettingsFields extends AbstractEnum {\n\n  const PAGE_LEVEL_PERSISTENT_MENU = 'page_level_persistent_menu';\n  const USER_LEVEL_PERSISTENT_MENU = 'user_level_persistent_menu';\n\n  public function getFieldTypes() {\n    return array(\n      'page_level_persistent_menu' => 'list<Object>',\n      'user_level_persistent_menu' => 'list<Object>',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DACheckFields extends AbstractEnum {\n\n  const ACTION_URI = 'action_uri';\n  const DESCRIPTION = 'description';\n  const KEY = 'key';\n  const RESULT = 'result';\n  const TITLE = 'title';\n  const USER_MESSAGE = 'user_message';\n\n  public function getFieldTypes() {\n    return array(\n      'action_uri' => 'string',\n      'description' => 'string',\n      'key' => 'string',\n      'result' => 'string',\n      'title' => 'string',\n      'user_message' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DayPartFields extends AbstractEnum {\n\n  const DAYS = 'days';\n  const END_MINUTE = 'end_minute';\n  const START_MINUTE = 'start_minute';\n  const TIMEZONE_TYPE = 'timezone_type';\n\n  public function getFieldTypes() {\n    return array(\n      'days' => 'list<int>',\n      'end_minute' => 'int',\n      'start_minute' => 'int',\n      'timezone_type' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DeliveryCheckExtraInfoFields extends AbstractEnum {\n\n  const ADGROUP_IDS = 'adgroup_ids';\n  const CAMPAIGN_IDS = 'campaign_ids';\n  const COUNTRIES = 'countries';\n\n  public function getFieldTypes() {\n    return array(\n      'adgroup_ids' => 'list<string>',\n      'campaign_ids' => 'list<string>',\n      'countries' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DeliveryCheckFields extends AbstractEnum {\n\n  const CHECK_NAME = 'check_name';\n  const DESCRIPTION = 'description';\n  const EXTRA_INFO = 'extra_info';\n  const SUMMARY = 'summary';\n\n  public function getFieldTypes() {\n    return array(\n      'check_name' => 'string',\n      'description' => 'string',\n      'extra_info' => 'DeliveryCheckExtraInfo',\n      'summary' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DeliveryWindowFields extends AbstractEnum {\n\n  const AD = 'ad';\n  const AE = 'ae';\n  const AF = 'af';\n  const AG = 'ag';\n  const AI = 'ai';\n  const AL = 'al';\n  const ALL = 'all';\n  const AM = 'am';\n  const AN = 'an';\n  const AO = 'ao';\n  const AQ = 'aq';\n  const AR = 'ar';\n  const FIELD_AS = 'as';\n  const AT = 'at';\n  const AU = 'au';\n  const AW = 'aw';\n  const AX = 'ax';\n  const AZ = 'az';\n  const BA = 'ba';\n  const BB = 'bb';\n  const BD = 'bd';\n  const BE = 'be';\n  const BF = 'bf';\n  const BG = 'bg';\n  const BH = 'bh';\n  const BI = 'bi';\n  const BJ = 'bj';\n  const BL = 'bl';\n  const BM = 'bm';\n  const BN = 'bn';\n  const BO = 'bo';\n  const BQ = 'bq';\n  const BR = 'br';\n  const BS = 'bs';\n  const BT = 'bt';\n  const BV = 'bv';\n  const BW = 'bw';\n  const BY = 'by';\n  const BZ = 'bz';\n  const CA = 'ca';\n  const CC = 'cc';\n  const CD = 'cd';\n  const CF = 'cf';\n  const CG = 'cg';\n  const CH = 'ch';\n  const CI = 'ci';\n  const CK = 'ck';\n  const CL = 'cl';\n  const CM = 'cm';\n  const CN = 'cn';\n  const CO = 'co';\n  const CR = 'cr';\n  const CU = 'cu';\n  const CV = 'cv';\n  const CW = 'cw';\n  const CX = 'cx';\n  const CY = 'cy';\n  const CZ = 'cz';\n  const DE = 'de';\n  const DJ = 'dj';\n  const DK = 'dk';\n  const DM = 'dm';\n  const FIELD_DO = 'do';\n  const DZ = 'dz';\n  const EC = 'ec';\n  const EE = 'ee';\n  const EG = 'eg';\n  const EH = 'eh';\n  const ER = 'er';\n  const ES = 'es';\n  const ET = 'et';\n  const FI = 'fi';\n  const FJ = 'fj';\n  const FK = 'fk';\n  const FM = 'fm';\n  const FO = 'fo';\n  const FR = 'fr';\n  const GA = 'ga';\n  const GB = 'gb';\n  const GD = 'gd';\n  const GE = 'ge';\n  const GF = 'gf';\n  const GG = 'gg';\n  const GH = 'gh';\n  const GI = 'gi';\n  const GL = 'gl';\n  const GM = 'gm';\n  const GN = 'gn';\n  const GP = 'gp';\n  const GQ = 'gq';\n  const GR = 'gr';\n  const GS = 'gs';\n  const GT = 'gt';\n  const GU = 'gu';\n  const GW = 'gw';\n  const GY = 'gy';\n  const HK = 'hk';\n  const HM = 'hm';\n  const HN = 'hn';\n  const HR = 'hr';\n  const HT = 'ht';\n  const HU = 'hu';\n  const ID = 'id';\n  const IE = 'ie';\n  const IL = 'il';\n  const IM = 'im';\n  const IN = 'in';\n  const IO = 'io';\n  const IQ = 'iq';\n  const IR = 'ir';\n  const IS = 'is';\n  const IT = 'it';\n  const JE = 'je';\n  const JM = 'jm';\n  const JO = 'jo';\n  const JP = 'jp';\n  const KE = 'ke';\n  const KG = 'kg';\n  const KH = 'kh';\n  const KI = 'ki';\n  const KM = 'km';\n  const KN = 'kn';\n  const KP = 'kp';\n  const KR = 'kr';\n  const KW = 'kw';\n  const KY = 'ky';\n  const KZ = 'kz';\n  const LA = 'la';\n  const LB = 'lb';\n  const LC = 'lc';\n  const LI = 'li';\n  const LK = 'lk';\n  const LR = 'lr';\n  const LS = 'ls';\n  const LT = 'lt';\n  const LU = 'lu';\n  const LV = 'lv';\n  const LY = 'ly';\n  const MA = 'ma';\n  const MC = 'mc';\n  const MD = 'md';\n  const ME = 'me';\n  const MF = 'mf';\n  const MG = 'mg';\n  const MH = 'mh';\n  const MK = 'mk';\n  const ML = 'ml';\n  const MM = 'mm';\n  const MN = 'mn';\n  const MO = 'mo';\n  const MP = 'mp';\n  const MQ = 'mq';\n  const MR = 'mr';\n  const MS = 'ms';\n  const MT = 'mt';\n  const MU = 'mu';\n  const MV = 'mv';\n  const MW = 'mw';\n  const MX = 'mx';\n  const MY = 'my';\n  const MZ = 'mz';\n  const NA = 'na';\n  const NC = 'nc';\n  const NE = 'ne';\n  const NF = 'nf';\n  const NG = 'ng';\n  const NI = 'ni';\n  const NL = 'nl';\n  const NO = 'no';\n  const NP = 'np';\n  const NR = 'nr';\n  const NU = 'nu';\n  const NZ = 'nz';\n  const OM = 'om';\n  const PA = 'pa';\n  const PE = 'pe';\n  const PF = 'pf';\n  const PG = 'pg';\n  const PH = 'ph';\n  const PK = 'pk';\n  const PL = 'pl';\n  const PM = 'pm';\n  const PN = 'pn';\n  const PR = 'pr';\n  const PS = 'ps';\n  const PT = 'pt';\n  const PW = 'pw';\n  const PY = 'py';\n  const QA = 'qa';\n  const RE = 're';\n  const RO = 'ro';\n  const RS = 'rs';\n  const RU = 'ru';\n  const RW = 'rw';\n  const SA = 'sa';\n  const SB = 'sb';\n  const SC = 'sc';\n  const SD = 'sd';\n  const SE = 'se';\n  const SG = 'sg';\n  const SH = 'sh';\n  const SI = 'si';\n  const SJ = 'sj';\n  const SK = 'sk';\n  const SL = 'sl';\n  const SM = 'sm';\n  const SN = 'sn';\n  const SO = 'so';\n  const SR = 'sr';\n  const SS = 'ss';\n  const ST = 'st';\n  const SV = 'sv';\n  const SX = 'sx';\n  const SY = 'sy';\n  const SZ = 'sz';\n  const TC = 'tc';\n  const TD = 'td';\n  const TF = 'tf';\n  const TG = 'tg';\n  const TH = 'th';\n  const TJ = 'tj';\n  const TK = 'tk';\n  const TL = 'tl';\n  const TM = 'tm';\n  const TN = 'tn';\n  const TO = 'to';\n  const TR = 'tr';\n  const TT = 'tt';\n  const TV = 'tv';\n  const TW = 'tw';\n  const TZ = 'tz';\n  const UA = 'ua';\n  const UG = 'ug';\n  const UM = 'um';\n  const US = 'us';\n  const UY = 'uy';\n  const UZ = 'uz';\n  const VA = 'va';\n  const VC = 'vc';\n  const VE = 've';\n  const VG = 'vg';\n  const VI = 'vi';\n  const VN = 'vn';\n  const VU = 'vu';\n  const WF = 'wf';\n  const WS = 'ws';\n  const XK = 'xk';\n  const YE = 'ye';\n  const YT = 'yt';\n  const ZA = 'za';\n  const ZM = 'zm';\n  const ZW = 'zw';\n\n  public function getFieldTypes() {\n    return array(\n      'ad' => 'int',\n      'ae' => 'int',\n      'af' => 'int',\n      'ag' => 'int',\n      'ai' => 'int',\n      'al' => 'int',\n      'all' => 'int',\n      'am' => 'int',\n      'an' => 'int',\n      'ao' => 'int',\n      'aq' => 'int',\n      'ar' => 'int',\n      'as' => 'int',\n      'at' => 'int',\n      'au' => 'int',\n      'aw' => 'int',\n      'ax' => 'int',\n      'az' => 'int',\n      'ba' => 'int',\n      'bb' => 'int',\n      'bd' => 'int',\n      'be' => 'int',\n      'bf' => 'int',\n      'bg' => 'int',\n      'bh' => 'int',\n      'bi' => 'int',\n      'bj' => 'int',\n      'bl' => 'int',\n      'bm' => 'int',\n      'bn' => 'int',\n      'bo' => 'int',\n      'bq' => 'int',\n      'br' => 'int',\n      'bs' => 'int',\n      'bt' => 'int',\n      'bv' => 'int',\n      'bw' => 'int',\n      'by' => 'int',\n      'bz' => 'int',\n      'ca' => 'int',\n      'cc' => 'int',\n      'cd' => 'int',\n      'cf' => 'int',\n      'cg' => 'int',\n      'ch' => 'int',\n      'ci' => 'int',\n      'ck' => 'int',\n      'cl' => 'int',\n      'cm' => 'int',\n      'cn' => 'int',\n      'co' => 'int',\n      'cr' => 'int',\n      'cu' => 'int',\n      'cv' => 'int',\n      'cw' => 'int',\n      'cx' => 'int',\n      'cy' => 'int',\n      'cz' => 'int',\n      'de' => 'int',\n      'dj' => 'int',\n      'dk' => 'int',\n      'dm' => 'int',\n      'do' => 'int',\n      'dz' => 'int',\n      'ec' => 'int',\n      'ee' => 'int',\n      'eg' => 'int',\n      'eh' => 'int',\n      'er' => 'int',\n      'es' => 'int',\n      'et' => 'int',\n      'fi' => 'int',\n      'fj' => 'int',\n      'fk' => 'int',\n      'fm' => 'int',\n      'fo' => 'int',\n      'fr' => 'int',\n      'ga' => 'int',\n      'gb' => 'int',\n      'gd' => 'int',\n      'ge' => 'int',\n      'gf' => 'int',\n      'gg' => 'int',\n      'gh' => 'int',\n      'gi' => 'int',\n      'gl' => 'int',\n      'gm' => 'int',\n      'gn' => 'int',\n      'gp' => 'int',\n      'gq' => 'int',\n      'gr' => 'int',\n      'gs' => 'int',\n      'gt' => 'int',\n      'gu' => 'int',\n      'gw' => 'int',\n      'gy' => 'int',\n      'hk' => 'int',\n      'hm' => 'int',\n      'hn' => 'int',\n      'hr' => 'int',\n      'ht' => 'int',\n      'hu' => 'int',\n      'id' => 'int',\n      'ie' => 'int',\n      'il' => 'int',\n      'im' => 'int',\n      'in' => 'int',\n      'io' => 'int',\n      'iq' => 'int',\n      'ir' => 'int',\n      'is' => 'int',\n      'it' => 'int',\n      'je' => 'int',\n      'jm' => 'int',\n      'jo' => 'int',\n      'jp' => 'int',\n      'ke' => 'int',\n      'kg' => 'int',\n      'kh' => 'int',\n      'ki' => 'int',\n      'km' => 'int',\n      'kn' => 'int',\n      'kp' => 'int',\n      'kr' => 'int',\n      'kw' => 'int',\n      'ky' => 'int',\n      'kz' => 'int',\n      'la' => 'int',\n      'lb' => 'int',\n      'lc' => 'int',\n      'li' => 'int',\n      'lk' => 'int',\n      'lr' => 'int',\n      'ls' => 'int',\n      'lt' => 'int',\n      'lu' => 'int',\n      'lv' => 'int',\n      'ly' => 'int',\n      'ma' => 'int',\n      'mc' => 'int',\n      'md' => 'int',\n      'me' => 'int',\n      'mf' => 'int',\n      'mg' => 'int',\n      'mh' => 'int',\n      'mk' => 'int',\n      'ml' => 'int',\n      'mm' => 'int',\n      'mn' => 'int',\n      'mo' => 'int',\n      'mp' => 'int',\n      'mq' => 'int',\n      'mr' => 'int',\n      'ms' => 'int',\n      'mt' => 'int',\n      'mu' => 'int',\n      'mv' => 'int',\n      'mw' => 'int',\n      'mx' => 'int',\n      'my' => 'int',\n      'mz' => 'int',\n      'na' => 'int',\n      'nc' => 'int',\n      'ne' => 'int',\n      'nf' => 'int',\n      'ng' => 'int',\n      'ni' => 'int',\n      'nl' => 'int',\n      'no' => 'int',\n      'np' => 'int',\n      'nr' => 'int',\n      'nu' => 'int',\n      'nz' => 'int',\n      'om' => 'int',\n      'pa' => 'int',\n      'pe' => 'int',\n      'pf' => 'int',\n      'pg' => 'int',\n      'ph' => 'int',\n      'pk' => 'int',\n      'pl' => 'int',\n      'pm' => 'int',\n      'pn' => 'int',\n      'pr' => 'int',\n      'ps' => 'int',\n      'pt' => 'int',\n      'pw' => 'int',\n      'py' => 'int',\n      'qa' => 'int',\n      're' => 'int',\n      'ro' => 'int',\n      'rs' => 'int',\n      'ru' => 'int',\n      'rw' => 'int',\n      'sa' => 'int',\n      'sb' => 'int',\n      'sc' => 'int',\n      'sd' => 'int',\n      'se' => 'int',\n      'sg' => 'int',\n      'sh' => 'int',\n      'si' => 'int',\n      'sj' => 'int',\n      'sk' => 'int',\n      'sl' => 'int',\n      'sm' => 'int',\n      'sn' => 'int',\n      'so' => 'int',\n      'sr' => 'int',\n      'ss' => 'int',\n      'st' => 'int',\n      'sv' => 'int',\n      'sx' => 'int',\n      'sy' => 'int',\n      'sz' => 'int',\n      'tc' => 'int',\n      'td' => 'int',\n      'tf' => 'int',\n      'tg' => 'int',\n      'th' => 'int',\n      'tj' => 'int',\n      'tk' => 'int',\n      'tl' => 'int',\n      'tm' => 'int',\n      'tn' => 'int',\n      'to' => 'int',\n      'tr' => 'int',\n      'tt' => 'int',\n      'tv' => 'int',\n      'tw' => 'int',\n      'tz' => 'int',\n      'ua' => 'int',\n      'ug' => 'int',\n      'um' => 'int',\n      'us' => 'int',\n      'uy' => 'int',\n      'uz' => 'int',\n      'va' => 'int',\n      'vc' => 'int',\n      've' => 'int',\n      'vg' => 'int',\n      'vi' => 'int',\n      'vn' => 'int',\n      'vu' => 'int',\n      'wf' => 'int',\n      'ws' => 'int',\n      'xk' => 'int',\n      'ye' => 'int',\n      'yt' => 'int',\n      'za' => 'int',\n      'zm' => 'int',\n      'zw' => 'int',\n    );\n  }\n}\n", "num_lines": 550}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DestinationCatalogSettingsFields extends AbstractEnum {\n\n  const GENERATE_ITEMS_FROM_PAGES = 'generate_items_from_pages';\n  const ID = 'id';\n\n  public function getFieldTypes() {\n    return array(\n      'generate_items_from_pages' => 'bool',\n      'id' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DestinationFields extends AbstractEnum {\n\n  const ADDRESS = 'address';\n  const APPLINKS = 'applinks';\n  const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';\n  const CURRENCY = 'currency';\n  const DESCRIPTION = 'description';\n  const DESTINATION_ID = 'destination_id';\n  const ID = 'id';\n  const IMAGE_FETCH_STATUS = 'image_fetch_status';\n  const IMAGES = 'images';\n  const NAME = 'name';\n  const PRICE = 'price';\n  const PRICE_CHANGE = 'price_change';\n  const SANITIZED_IMAGES = 'sanitized_images';\n  const TYPES = 'types';\n  const UNIT_PRICE = 'unit_price';\n  const URL = 'url';\n  const VISIBILITY = 'visibility';\n\n  public function getFieldTypes() {\n    return array(\n      'address' => 'string',\n      'applinks' => 'CatalogItemAppLinks',\n      'category_specific_fields' => 'CatalogSubVerticalList',\n      'currency' => 'string',\n      'description' => 'string',\n      'destination_id' => 'string',\n      'id' => 'string',\n      'image_fetch_status' => 'ImageFetchStatus',\n      'images' => 'list<string>',\n      'name' => 'string',\n      'price' => 'string',\n      'price_change' => 'string',\n      'sanitized_images' => 'list<string>',\n      'types' => 'list<string>',\n      'unit_price' => 'Object',\n      'url' => 'string',\n      'visibility' => 'Visibility',\n    );\n  }\n}\n", "num_lines": 80}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DynamicPostChildAttachmentFields extends AbstractEnum {\n\n  const DESCRIPTION = 'description';\n  const IMAGE_URL = 'image_url';\n  const LINK = 'link';\n  const PLACE_ID = 'place_id';\n  const PRODUCT_ID = 'product_id';\n  const TITLE = 'title';\n\n  public function getFieldTypes() {\n    return array(\n      'description' => 'string',\n      'image_url' => 'string',\n      'link' => 'string',\n      'place_id' => 'string',\n      'product_id' => 'string',\n      'title' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass DynamicPriceConfigByDateFields extends AbstractEnum {\n\n  const CHECKIN_DATE = 'checkin_date';\n  const PRICES = 'prices';\n  const PRICES_PRETTY = 'prices_pretty';\n  const ID = 'id';\n\n  public function getFieldTypes() {\n    return array(\n      'checkin_date' => 'string',\n      'prices' => 'string',\n      'prices_pretty' => 'list<Object>',\n      'id' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass EngagementFields extends AbstractEnum {\n\n  const COUNT = 'count';\n  const COUNT_STRING = 'count_string';\n  const COUNT_STRING_WITH_LIKE = 'count_string_with_like';\n  const COUNT_STRING_WITHOUT_LIKE = 'count_string_without_like';\n  const SOCIAL_SENTENCE = 'social_sentence';\n  const SOCIAL_SENTENCE_WITH_LIKE = 'social_sentence_with_like';\n  const SOCIAL_SENTENCE_WITHOUT_LIKE = 'social_sentence_without_like';\n\n  public function getFieldTypes() {\n    return array(\n      'count' => 'unsigned int',\n      'count_string' => 'string',\n      'count_string_with_like' => 'string',\n      'count_string_without_like' => 'string',\n      'social_sentence' => 'string',\n      'social_sentence_with_like' => 'string',\n      'social_sentence_without_like' => 'string',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass EntityAtTextRangeFields extends AbstractEnum {\n\n  const ID = 'id';\n  const LENGTH = 'length';\n  const NAME = 'name';\n  const OBJECT = 'object';\n  const OFFSET = 'offset';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'length' => 'unsigned int',\n      'name' => 'string',\n      'object' => 'Profile',\n      'offset' => 'unsigned int',\n      'type' => 'Type',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass EventFields extends AbstractEnum {\n\n  const ATTENDING_COUNT = 'attending_count';\n  const CAN_GUESTS_INVITE = 'can_guests_invite';\n  const CATEGORY = 'category';\n  const COVER = 'cover';\n  const CREATED_TIME = 'created_time';\n  const DECLINED_COUNT = 'declined_count';\n  const DESCRIPTION = 'description';\n  const DISCOUNT_CODE_ENABLED = 'discount_code_enabled';\n  const END_TIME = 'end_time';\n  const EVENT_TIMES = 'event_times';\n  const GUEST_LIST_ENABLED = 'guest_list_enabled';\n  const ID = 'id';\n  const INTERESTED_COUNT = 'interested_count';\n  const IS_CANCELED = 'is_canceled';\n  const IS_DRAFT = 'is_draft';\n  const IS_ONLINE = 'is_online';\n  const IS_PAGE_OWNED = 'is_page_owned';\n  const MAYBE_COUNT = 'maybe_count';\n  const NAME = 'name';\n  const NOREPLY_COUNT = 'noreply_count';\n  const ONLINE_EVENT_FORMAT = 'online_event_format';\n  const ONLINE_EVENT_THIRD_PARTY_URL = 'online_event_third_party_url';\n  const OWNER = 'owner';\n  const PARENT_GROUP = 'parent_group';\n  const PLACE = 'place';\n  const REGISTRATION_SETTING = 'registration_setting';\n  const SCHEDULED_PUBLISH_TIME = 'scheduled_publish_time';\n  const START_TIME = 'start_time';\n  const TICKET_SETTING = 'ticket_setting';\n  const TICKET_URI = 'ticket_uri';\n  const TICKET_URI_START_SALES_TIME = 'ticket_uri_start_sales_time';\n  const TICKETING_PRIVACY_URI = 'ticketing_privacy_uri';\n  const TICKETING_TERMS_URI = 'ticketing_terms_uri';\n  const TIMEZONE = 'timezone';\n  const TYPE = 'type';\n  const UPDATED_TIME = 'updated_time';\n\n  public function getFieldTypes() {\n    return array(\n      'attending_count' => 'int',\n      'can_guests_invite' => 'bool',\n      'category' => 'Category',\n      'cover' => 'CoverPhoto',\n      'created_time' => 'datetime',\n      'declined_count' => 'int',\n      'description' => 'string',\n      'discount_code_enabled' => 'bool',\n      'end_time' => 'string',\n      'event_times' => 'list<ChildEvent>',\n      'guest_list_enabled' => 'bool',\n      'id' => 'string',\n      'interested_count' => 'int',\n      'is_canceled' => 'bool',\n      'is_draft' => 'bool',\n      'is_online' => 'bool',\n      'is_page_owned' => 'bool',\n      'maybe_count' => 'int',\n      'name' => 'string',\n      'noreply_count' => 'int',\n      'online_event_format' => 'OnlineEventFormat',\n      'online_event_third_party_url' => 'string',\n      'owner' => 'Object',\n      'parent_group' => 'Group',\n      'place' => 'Place',\n      'registration_setting' => 'Object',\n      'scheduled_publish_time' => 'string',\n      'start_time' => 'string',\n      'ticket_setting' => 'Object',\n      'ticket_uri' => 'string',\n      'ticket_uri_start_sales_time' => 'string',\n      'ticketing_privacy_uri' => 'string',\n      'ticketing_terms_uri' => 'string',\n      'timezone' => 'string',\n      'type' => 'Type',\n      'updated_time' => 'datetime',\n    );\n  }\n}\n", "num_lines": 118}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass EventSourceGroupFields extends AbstractEnum {\n\n  const BUSINESS = 'business';\n  const EVENT_SOURCES = 'event_sources';\n  const ID = 'id';\n  const NAME = 'name';\n  const OWNER_BUSINESS = 'owner_business';\n\n  public function getFieldTypes() {\n    return array(\n      'business' => 'Business',\n      'event_sources' => 'list<ExternalEventSource>',\n      'id' => 'string',\n      'name' => 'string',\n      'owner_business' => 'Business',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ExperienceFields extends AbstractEnum {\n\n  const DESCRIPTION = 'description';\n  const FROM = 'from';\n  const ID = 'id';\n  const NAME = 'name';\n  const WITH = 'with';\n\n  public function getFieldTypes() {\n    return array(\n      'description' => 'string',\n      'from' => 'Object',\n      'id' => 'string',\n      'name' => 'string',\n      'with' => 'list<User>',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ExtendedCreditAllocationConfigFields extends AbstractEnum {\n\n  const CURRENCY_AMOUNT = 'currency_amount';\n  const ID = 'id';\n  const LIABILITY_TYPE = 'liability_type';\n  const OWNING_BUSINESS = 'owning_business';\n  const OWNING_CREDENTIAL = 'owning_credential';\n  const PARTITION_TYPE = 'partition_type';\n  const RECEIVING_BUSINESS = 'receiving_business';\n  const RECEIVING_CREDENTIAL = 'receiving_credential';\n  const REQUEST_STATUS = 'request_status';\n  const SEND_BILL_TO = 'send_bill_to';\n\n  public function getFieldTypes() {\n    return array(\n      'currency_amount' => 'CurrencyAmount',\n      'id' => 'string',\n      'liability_type' => 'string',\n      'owning_business' => 'Business',\n      'owning_credential' => 'ExtendedCredit',\n      'partition_type' => 'string',\n      'receiving_business' => 'Business',\n      'receiving_credential' => 'ExtendedCredit',\n      'request_status' => 'string',\n      'send_bill_to' => 'string',\n    );\n  }\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ExtendedCreditFields extends AbstractEnum {\n\n  const ALLOCATED_AMOUNT = 'allocated_amount';\n  const BALANCE = 'balance';\n  const CREDIT_AVAILABLE = 'credit_available';\n  const CREDIT_TYPE = 'credit_type';\n  const ID = 'id';\n  const IS_ACCESS_REVOKED = 'is_access_revoked';\n  const IS_AUTOMATED_EXPERIENCE = 'is_automated_experience';\n  const LEGAL_ENTITY_NAME = 'legal_entity_name';\n  const LIABLE_ADDRESS = 'liable_address';\n  const LIABLE_BIZ_NAME = 'liable_biz_name';\n  const MAX_BALANCE = 'max_balance';\n  const ONLINE_MAX_BALANCE = 'online_max_balance';\n  const OWNER_BUSINESS = 'owner_business';\n  const OWNER_BUSINESS_NAME = 'owner_business_name';\n  const PARTITION_FROM = 'partition_from';\n  const RECEIVING_CREDIT_ALLOCATION_CONFIG = 'receiving_credit_allocation_config';\n  const SEND_BILL_TO_ADDRESS = 'send_bill_to_address';\n  const SEND_BILL_TO_BIZ_NAME = 'send_bill_to_biz_name';\n  const SOLD_TO_ADDRESS = 'sold_to_address';\n\n  public function getFieldTypes() {\n    return array(\n      'allocated_amount' => 'CurrencyAmount',\n      'balance' => 'CurrencyAmount',\n      'credit_available' => 'CurrencyAmount',\n      'credit_type' => 'string',\n      'id' => 'string',\n      'is_access_revoked' => 'bool',\n      'is_automated_experience' => 'bool',\n      'legal_entity_name' => 'string',\n      'liable_address' => 'CRMAddress',\n      'liable_biz_name' => 'string',\n      'max_balance' => 'CurrencyAmount',\n      'online_max_balance' => 'CurrencyAmount',\n      'owner_business' => 'Business',\n      'owner_business_name' => 'string',\n      'partition_from' => 'string',\n      'receiving_credit_allocation_config' => 'ExtendedCreditAllocationConfig',\n      'send_bill_to_address' => 'CRMAddress',\n      'send_bill_to_biz_name' => 'string',\n      'sold_to_address' => 'CRMAddress',\n    );\n  }\n}\n", "num_lines": 84}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ExtendedCreditInvoiceGroupFields extends AbstractEnum {\n\n  const AUTO_ENROLL = 'auto_enroll';\n  const BILL_TO_ADDRESS = 'bill_to_address';\n  const CUSTOMER_PO_NUMBER = 'customer_po_number';\n  const EMAIL = 'email';\n  const EMAILS = 'emails';\n  const ID = 'id';\n  const LIABLE_ADDRESS = 'liable_address';\n  const NAME = 'name';\n  const SOLD_TO_ADDRESS = 'sold_to_address';\n\n  public function getFieldTypes() {\n    return array(\n      'auto_enroll' => 'bool',\n      'bill_to_address' => 'CRMAddress',\n      'customer_po_number' => 'string',\n      'email' => 'Object',\n      'emails' => 'list<string>',\n      'id' => 'string',\n      'liable_address' => 'CRMAddress',\n      'name' => 'string',\n      'sold_to_address' => 'CRMAddress',\n    );\n  }\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ExternalEventSourceFields extends AbstractEnum {\n\n  const ID = 'id';\n  const NAME = 'name';\n  const SOURCE_TYPE = 'source_type';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'name' => 'string',\n      'source_type' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass FAMEExportConfigFields extends AbstractEnum {\n\n  const CAN_EDIT = 'can_edit';\n  const COLUMN_ID = 'column_id';\n  const DISPLAY_NAME = 'display_name';\n  const FORMAT = 'format';\n\n  public function getFieldTypes() {\n    return array(\n      'can_edit' => 'bool',\n      'column_id' => 'string',\n      'display_name' => 'string',\n      'format' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass FlexibleTargetingFields extends AbstractEnum {\n\n  const BEHAVIORS = 'behaviors';\n  const COLLEGE_YEARS = 'college_years';\n  const CONNECTIONS = 'connections';\n  const CUSTOM_AUDIENCES = 'custom_audiences';\n  const EDUCATION_MAJORS = 'education_majors';\n  const EDUCATION_SCHOOLS = 'education_schools';\n  const EDUCATION_STATUSES = 'education_statuses';\n  const ETHNIC_AFFINITY = 'ethnic_affinity';\n  const FAMILY_STATUSES = 'family_statuses';\n  const FRIENDS_OF_CONNECTIONS = 'friends_of_connections';\n  const GENERATION = 'generation';\n  const HOME_OWNERSHIP = 'home_ownership';\n  const HOME_TYPE = 'home_type';\n  const HOME_VALUE = 'home_value';\n  const HOUSEHOLD_COMPOSITION = 'household_composition';\n  const INCOME = 'income';\n  const INDUSTRIES = 'industries';\n  const INTERESTED_IN = 'interested_in';\n  const INTERESTS = 'interests';\n  const LIFE_EVENTS = 'life_events';\n  const MOMS = 'moms';\n  const NET_WORTH = 'net_worth';\n  const OFFICE_TYPE = 'office_type';\n  const POLITICS = 'politics';\n  const RELATIONSHIP_STATUSES = 'relationship_statuses';\n  const USER_ADCLUSTERS = 'user_adclusters';\n  const WORK_EMPLOYERS = 'work_employers';\n  const WORK_POSITIONS = 'work_positions';\n\n  public function getFieldTypes() {\n    return array(\n      'behaviors' => 'list<IDName>',\n      'college_years' => 'list<unsigned int>',\n      'connections' => 'list<IDName>',\n      'custom_audiences' => 'list<IDName>',\n      'education_majors' => 'list<IDName>',\n      'education_schools' => 'list<IDName>',\n      'education_statuses' => 'list<unsigned int>',\n      'ethnic_affinity' => 'list<IDName>',\n      'family_statuses' => 'list<IDName>',\n      'friends_of_connections' => 'list<IDName>',\n      'generation' => 'list<IDName>',\n      'home_ownership' => 'list<IDName>',\n      'home_type' => 'list<IDName>',\n      'home_value' => 'list<IDName>',\n      'household_composition' => 'list<IDName>',\n      'income' => 'list<IDName>',\n      'industries' => 'list<IDName>',\n      'interested_in' => 'list<unsigned int>',\n      'interests' => 'list<IDName>',\n      'life_events' => 'list<IDName>',\n      'moms' => 'list<IDName>',\n      'net_worth' => 'list<IDName>',\n      'office_type' => 'list<IDName>',\n      'politics' => 'list<IDName>',\n      'relationship_statuses' => 'list<unsigned int>',\n      'user_adclusters' => 'list<IDName>',\n      'work_employers' => 'list<IDName>',\n      'work_positions' => 'list<IDName>',\n    );\n  }\n}\n", "num_lines": 102}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass FlightFields extends AbstractEnum {\n\n  const APPLINKS = 'applinks';\n  const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';\n  const CURRENCY = 'currency';\n  const DESCRIPTION = 'description';\n  const DESTINATION_AIRPORT = 'destination_airport';\n  const DESTINATION_CITY = 'destination_city';\n  const FLIGHT_ID = 'flight_id';\n  const ID = 'id';\n  const IMAGE_FETCH_STATUS = 'image_fetch_status';\n  const IMAGES = 'images';\n  const ONEWAY_CURRENCY = 'oneway_currency';\n  const ONEWAY_PRICE = 'oneway_price';\n  const ORIGIN_AIRPORT = 'origin_airport';\n  const ORIGIN_CITY = 'origin_city';\n  const PRICE = 'price';\n  const SANITIZED_IMAGES = 'sanitized_images';\n  const UNIT_PRICE = 'unit_price';\n  const URL = 'url';\n  const VISIBILITY = 'visibility';\n\n  public function getFieldTypes() {\n    return array(\n      'applinks' => 'CatalogItemAppLinks',\n      'category_specific_fields' => 'CatalogSubVerticalList',\n      'currency' => 'string',\n      'description' => 'string',\n      'destination_airport' => 'string',\n      'destination_city' => 'string',\n      'flight_id' => 'string',\n      'id' => 'string',\n      'image_fetch_status' => 'ImageFetchStatus',\n      'images' => 'list<string>',\n      'oneway_currency' => 'string',\n      'oneway_price' => 'string',\n      'origin_airport' => 'string',\n      'origin_city' => 'string',\n      'price' => 'string',\n      'sanitized_images' => 'list<string>',\n      'unit_price' => 'Object',\n      'url' => 'string',\n      'visibility' => 'Visibility',\n    );\n  }\n}\n", "num_lines": 84}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass FundingSourceDetailsCouponFields extends AbstractEnum {\n\n  const AMOUNT = 'amount';\n  const CURRENCY = 'currency';\n  const DISPLAY_AMOUNT = 'display_amount';\n  const EXPIRATION = 'expiration';\n\n  public function getFieldTypes() {\n    return array(\n      'amount' => 'int',\n      'currency' => 'string',\n      'display_amount' => 'string',\n      'expiration' => 'datetime',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass FundingSourceDetailsFields extends AbstractEnum {\n\n  const COUPON = 'coupon';\n  const DISPLAY_STRING = 'display_string';\n  const ID = 'id';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'coupon' => 'FundingSourceDetailsCoupon',\n      'display_string' => 'string',\n      'id' => 'string',\n      'type' => 'int',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass FundraiserPersonToCharityFields extends AbstractEnum {\n\n  const AMOUNT_RAISED = 'amount_raised';\n  const CHARITY_ID = 'charity_id';\n  const CURRENCY = 'currency';\n  const DESCRIPTION = 'description';\n  const DONATIONS_COUNT = 'donations_count';\n  const DONORS_COUNT = 'donors_count';\n  const END_TIME = 'end_time';\n  const EXTERNAL_AMOUNT_RAISED = 'external_amount_raised';\n  const EXTERNAL_DONATIONS_COUNT = 'external_donations_count';\n  const EXTERNAL_DONORS_COUNT = 'external_donors_count';\n  const EXTERNAL_EVENT_NAME = 'external_event_name';\n  const EXTERNAL_EVENT_START_TIME = 'external_event_start_time';\n  const EXTERNAL_EVENT_URI = 'external_event_uri';\n  const EXTERNAL_FUNDRAISER_URI = 'external_fundraiser_uri';\n  const EXTERNAL_ID = 'external_id';\n  const GOAL_AMOUNT = 'goal_amount';\n  const ID = 'id';\n  const INTERNAL_AMOUNT_RAISED = 'internal_amount_raised';\n  const INTERNAL_DONATIONS_COUNT = 'internal_donations_count';\n  const INTERNAL_DONORS_COUNT = 'internal_donors_count';\n  const NAME = 'name';\n  const URI = 'uri';\n\n  public function getFieldTypes() {\n    return array(\n      'amount_raised' => 'int',\n      'charity_id' => 'string',\n      'currency' => 'string',\n      'description' => 'string',\n      'donations_count' => 'int',\n      'donors_count' => 'int',\n      'end_time' => 'datetime',\n      'external_amount_raised' => 'int',\n      'external_donations_count' => 'int',\n      'external_donors_count' => 'int',\n      'external_event_name' => 'string',\n      'external_event_start_time' => 'datetime',\n      'external_event_uri' => 'string',\n      'external_fundraiser_uri' => 'string',\n      'external_id' => 'string',\n      'goal_amount' => 'int',\n      'id' => 'string',\n      'internal_amount_raised' => 'int',\n      'internal_donations_count' => 'int',\n      'internal_donors_count' => 'int',\n      'name' => 'string',\n      'uri' => 'string',\n    );\n  }\n}\n", "num_lines": 90}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass GameItemFields extends AbstractEnum {\n\n  const COUNT = 'count';\n  const CREATED = 'created';\n  const EXT_ID = 'ext_id';\n  const ID = 'id';\n  const ITEM_DEF = 'item_def';\n  const OWNER = 'owner';\n  const STATUS = 'status';\n  const UPDATED = 'updated';\n\n  public function getFieldTypes() {\n    return array(\n      'count' => 'int',\n      'created' => 'datetime',\n      'ext_id' => 'string',\n      'id' => 'string',\n      'item_def' => 'string',\n      'owner' => 'User',\n      'status' => 'string',\n      'updated' => 'datetime',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass GroupFields extends AbstractEnum {\n\n  const ARCHIVED = 'archived';\n  const COVER = 'cover';\n  const CREATED_TIME = 'created_time';\n  const DESCRIPTION = 'description';\n  const EMAIL = 'email';\n  const ICON = 'icon';\n  const ID = 'id';\n  const INSTALL = 'install';\n  const LINK = 'link';\n  const MEMBER_COUNT = 'member_count';\n  const MEMBER_REQUEST_COUNT = 'member_request_count';\n  const NAME = 'name';\n  const PARENT = 'parent';\n  const PERMISSIONS = 'permissions';\n  const PRIVACY = 'privacy';\n  const PURPOSE = 'purpose';\n  const SUBDOMAIN = 'subdomain';\n  const UPDATED_TIME = 'updated_time';\n  const VENUE = 'venue';\n\n  public function getFieldTypes() {\n    return array(\n      'archived' => 'bool',\n      'cover' => 'CoverPhoto',\n      'created_time' => 'datetime',\n      'description' => 'string',\n      'email' => 'string',\n      'icon' => 'string',\n      'id' => 'string',\n      'install' => 'Object',\n      'link' => 'string',\n      'member_count' => 'unsigned int',\n      'member_request_count' => 'unsigned int',\n      'name' => 'string',\n      'parent' => 'Object',\n      'permissions' => 'list<string>',\n      'privacy' => 'string',\n      'purpose' => 'string',\n      'subdomain' => 'string',\n      'updated_time' => 'datetime',\n      'venue' => 'Location',\n    );\n  }\n}\n", "num_lines": 84}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass HomeListingFields extends AbstractEnum {\n\n  const AC_TYPE = 'ac_type';\n  const ADDITIONAL_FEES_DESCRIPTION = 'additional_fees_description';\n  const ADDRESS = 'address';\n  const AGENT_COMPANY = 'agent_company';\n  const AGENT_EMAIL = 'agent_email';\n  const AGENT_FB_PAGE_ID = 'agent_fb_page_id';\n  const AGENT_NAME = 'agent_name';\n  const AGENT_PHONE = 'agent_phone';\n  const APPLINKS = 'applinks';\n  const AREA_SIZE = 'area_size';\n  const AREA_UNIT = 'area_unit';\n  const AVAILABILITY = 'availability';\n  const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';\n  const CO_2_EMISSION_RATING_EU = 'co_2_emission_rating_eu';\n  const CURRENCY = 'currency';\n  const DAYS_ON_MARKET = 'days_on_market';\n  const DESCRIPTION = 'description';\n  const ENERGY_RATING_EU = 'energy_rating_eu';\n  const FURNISH_TYPE = 'furnish_type';\n  const GROUP_ID = 'group_id';\n  const HEATING_TYPE = 'heating_type';\n  const HOME_LISTING_ID = 'home_listing_id';\n  const ID = 'id';\n  const IMAGE_FETCH_STATUS = 'image_fetch_status';\n  const IMAGES = 'images';\n  const LAUNDRY_TYPE = 'laundry_type';\n  const LISTING_TYPE = 'listing_type';\n  const MAX_CURRENCY = 'max_currency';\n  const MAX_PRICE = 'max_price';\n  const MIN_CURRENCY = 'min_currency';\n  const MIN_PRICE = 'min_price';\n  const NAME = 'name';\n  const NUM_BATHS = 'num_baths';\n  const NUM_BEDS = 'num_beds';\n  const NUM_ROOMS = 'num_rooms';\n  const NUM_UNITS = 'num_units';\n  const PARKING_TYPE = 'parking_type';\n  const PARTNER_VERIFICATION = 'partner_verification';\n  const PET_POLICY = 'pet_policy';\n  const PRICE = 'price';\n  const PROPERTY_TYPE = 'property_type';\n  const SANITIZED_IMAGES = 'sanitized_images';\n  const UNIT_PRICE = 'unit_price';\n  const URL = 'url';\n  const VISIBILITY = 'visibility';\n  const YEAR_BUILT = 'year_built';\n\n  public function getFieldTypes() {\n    return array(\n      'ac_type' => 'string',\n      'additional_fees_description' => 'string',\n      'address' => 'Object',\n      'agent_company' => 'string',\n      'agent_email' => 'string',\n      'agent_fb_page_id' => 'Page',\n      'agent_name' => 'string',\n      'agent_phone' => 'string',\n      'applinks' => 'CatalogItemAppLinks',\n      'area_size' => 'unsigned int',\n      'area_unit' => 'string',\n      'availability' => 'string',\n      'category_specific_fields' => 'CatalogSubVerticalList',\n      'co_2_emission_rating_eu' => 'Object',\n      'currency' => 'string',\n      'days_on_market' => 'unsigned int',\n      'description' => 'string',\n      'energy_rating_eu' => 'Object',\n      'furnish_type' => 'string',\n      'group_id' => 'string',\n      'heating_type' => 'string',\n      'home_listing_id' => 'string',\n      'id' => 'string',\n      'image_fetch_status' => 'ImageFetchStatus',\n      'images' => 'list<string>',\n      'laundry_type' => 'string',\n      'listing_type' => 'string',\n      'max_currency' => 'string',\n      'max_price' => 'string',\n      'min_currency' => 'string',\n      'min_price' => 'string',\n      'name' => 'string',\n      'num_baths' => 'float',\n      'num_beds' => 'float',\n      'num_rooms' => 'float',\n      'num_units' => 'unsigned int',\n      'parking_type' => 'string',\n      'partner_verification' => 'string',\n      'pet_policy' => 'string',\n      'price' => 'string',\n      'property_type' => 'string',\n      'sanitized_images' => 'list<string>',\n      'unit_price' => 'Object',\n      'url' => 'string',\n      'visibility' => 'Visibility',\n      'year_built' => 'int',\n    );\n  }\n}\n", "num_lines": 138}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass HotelFields extends AbstractEnum {\n\n  const ADDRESS = 'address';\n  const APPLINKS = 'applinks';\n  const BRAND = 'brand';\n  const CATEGORY = 'category';\n  const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';\n  const CURRENCY = 'currency';\n  const DESCRIPTION = 'description';\n  const GUEST_RATINGS = 'guest_ratings';\n  const HOTEL_ID = 'hotel_id';\n  const ID = 'id';\n  const IMAGE_FETCH_STATUS = 'image_fetch_status';\n  const IMAGES = 'images';\n  const LOWEST_BASE_PRICE = 'lowest_base_price';\n  const LOYALTY_PROGRAM = 'loyalty_program';\n  const MARGIN_LEVEL = 'margin_level';\n  const NAME = 'name';\n  const PHONE = 'phone';\n  const SALE_PRICE = 'sale_price';\n  const SANITIZED_IMAGES = 'sanitized_images';\n  const STAR_RATING = 'star_rating';\n  const UNIT_PRICE = 'unit_price';\n  const URL = 'url';\n  const VISIBILITY = 'visibility';\n  const BASE_PRICE = 'base_price';\n\n  public function getFieldTypes() {\n    return array(\n      'address' => 'string',\n      'applinks' => 'CatalogItemAppLinks',\n      'brand' => 'string',\n      'category' => 'string',\n      'category_specific_fields' => 'CatalogSubVerticalList',\n      'currency' => 'string',\n      'description' => 'string',\n      'guest_ratings' => 'string',\n      'hotel_id' => 'string',\n      'id' => 'string',\n      'image_fetch_status' => 'ImageFetchStatus',\n      'images' => 'list<string>',\n      'lowest_base_price' => 'string',\n      'loyalty_program' => 'string',\n      'margin_level' => 'unsigned int',\n      'name' => 'string',\n      'phone' => 'string',\n      'sale_price' => 'string',\n      'sanitized_images' => 'list<string>',\n      'star_rating' => 'float',\n      'unit_price' => 'Object',\n      'url' => 'string',\n      'visibility' => 'Visibility',\n      'base_price' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 94}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass HotelRoomFields extends AbstractEnum {\n\n  const APPLINKS = 'applinks';\n  const BASE_PRICE = 'base_price';\n  const CURRENCY = 'currency';\n  const DESCRIPTION = 'description';\n  const ID = 'id';\n  const IMAGES = 'images';\n  const MARGIN_LEVEL = 'margin_level';\n  const NAME = 'name';\n  const ROOM_ID = 'room_id';\n  const SALE_PRICE = 'sale_price';\n  const URL = 'url';\n\n  public function getFieldTypes() {\n    return array(\n      'applinks' => 'CatalogItemAppLinks',\n      'base_price' => 'string',\n      'currency' => 'string',\n      'description' => 'string',\n      'id' => 'string',\n      'images' => 'list<string>',\n      'margin_level' => 'string',\n      'name' => 'string',\n      'room_id' => 'string',\n      'sale_price' => 'string',\n      'url' => 'string',\n    );\n  }\n}\n", "num_lines": 68}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass IDNameFields extends AbstractEnum {\n\n  const ID = 'id';\n  const NAME = 'name';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'name' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass IGBCAdsPermissionFields extends AbstractEnum {\n\n  const ID = 'id';\n  const PERMISSION_TYPE = 'permission_type';\n  const STATUS = 'status';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'permission_type' => 'string',\n      'status' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass IGCommentFields extends AbstractEnum {\n\n  const FROM = 'from';\n  const HIDDEN = 'hidden';\n  const ID = 'id';\n  const LIKE_COUNT = 'like_count';\n  const MEDIA = 'media';\n  const PARENT_ID = 'parent_id';\n  const TEXT = 'text';\n  const TIMESTAMP = 'timestamp';\n  const USER = 'user';\n  const USERNAME = 'username';\n\n  public function getFieldTypes() {\n    return array(\n      'from' => 'Object',\n      'hidden' => 'bool',\n      'id' => 'string',\n      'like_count' => 'int',\n      'media' => 'IGMedia',\n      'parent_id' => 'string',\n      'text' => 'string',\n      'timestamp' => 'datetime',\n      'user' => 'IGUser',\n      'username' => 'string',\n    );\n  }\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass IGMediaFields extends AbstractEnum {\n\n  const CAPTION = 'caption';\n  const COMMENTS_COUNT = 'comments_count';\n  const ID = 'id';\n  const IG_ID = 'ig_id';\n  const IS_COMMENT_ENABLED = 'is_comment_enabled';\n  const IS_SHARED_TO_FEED = 'is_shared_to_feed';\n  const LIKE_COUNT = 'like_count';\n  const MEDIA_PRODUCT_TYPE = 'media_product_type';\n  const MEDIA_TYPE = 'media_type';\n  const MEDIA_URL = 'media_url';\n  const OWNER = 'owner';\n  const PERMALINK = 'permalink';\n  const SHORTCODE = 'shortcode';\n  const THUMBNAIL_URL = 'thumbnail_url';\n  const TIMESTAMP = 'timestamp';\n  const USERNAME = 'username';\n\n  public function getFieldTypes() {\n    return array(\n      'caption' => 'string',\n      'comments_count' => 'int',\n      'id' => 'string',\n      'ig_id' => 'string',\n      'is_comment_enabled' => 'bool',\n      'is_shared_to_feed' => 'bool',\n      'like_count' => 'int',\n      'media_product_type' => 'string',\n      'media_type' => 'string',\n      'media_url' => 'string',\n      'owner' => 'IGUser',\n      'permalink' => 'string',\n      'shortcode' => 'string',\n      'thumbnail_url' => 'string',\n      'timestamp' => 'datetime',\n      'username' => 'string',\n    );\n  }\n}\n", "num_lines": 78}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass IGUserFields extends AbstractEnum {\n\n  const BIOGRAPHY = 'biography';\n  const BUSINESS_DISCOVERY = 'business_discovery';\n  const FOLLOWERS_COUNT = 'followers_count';\n  const FOLLOWS_COUNT = 'follows_count';\n  const ID = 'id';\n  const IG_ID = 'ig_id';\n  const MEDIA_COUNT = 'media_count';\n  const MENTIONED_COMMENT = 'mentioned_comment';\n  const MENTIONED_MEDIA = 'mentioned_media';\n  const NAME = 'name';\n  const OWNER_BUSINESS = 'owner_business';\n  const PROFILE_PICTURE_URL = 'profile_picture_url';\n  const SHOPPING_PRODUCT_TAG_ELIGIBILITY = 'shopping_product_tag_eligibility';\n  const SHOPPING_REVIEW_STATUS = 'shopping_review_status';\n  const USERNAME = 'username';\n  const WEBSITE = 'website';\n\n  public function getFieldTypes() {\n    return array(\n      'biography' => 'string',\n      'business_discovery' => 'IGUser',\n      'followers_count' => 'int',\n      'follows_count' => 'int',\n      'id' => 'string',\n      'ig_id' => 'int',\n      'media_count' => 'int',\n      'mentioned_comment' => 'IGComment',\n      'mentioned_media' => 'IGMedia',\n      'name' => 'string',\n      'owner_business' => 'Business',\n      'profile_picture_url' => 'string',\n      'shopping_product_tag_eligibility' => 'bool',\n      'shopping_review_status' => 'string',\n      'username' => 'string',\n      'website' => 'string',\n    );\n  }\n}\n", "num_lines": 78}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ImageCopyrightFields extends AbstractEnum {\n\n  const ARTIST = 'artist';\n  const COPYRIGHT_MONITORING_STATUS = 'copyright_monitoring_status';\n  const CREATION_TIME = 'creation_time';\n  const CREATOR = 'creator';\n  const CUSTOM_ID = 'custom_id';\n  const DESCRIPTION = 'description';\n  const FILENAME = 'filename';\n  const ID = 'id';\n  const IMAGE = 'image';\n  const MATCHES_COUNT = 'matches_count';\n  const ORIGINAL_CONTENT_CREATION_DATE = 'original_content_creation_date';\n  const OWNERSHIP_COUNTRIES = 'ownership_countries';\n  const TAGS = 'tags';\n  const TITLE = 'title';\n  const UPDATE_TIME = 'update_time';\n\n  public function getFieldTypes() {\n    return array(\n      'artist' => 'string',\n      'copyright_monitoring_status' => 'string',\n      'creation_time' => 'datetime',\n      'creator' => 'string',\n      'custom_id' => 'string',\n      'description' => 'string',\n      'filename' => 'string',\n      'id' => 'string',\n      'image' => 'Photo',\n      'matches_count' => 'unsigned int',\n      'original_content_creation_date' => 'datetime',\n      'ownership_countries' => 'VideoCopyrightGeoGate',\n      'tags' => 'list<string>',\n      'title' => 'string',\n      'update_time' => 'datetime',\n    );\n  }\n}\n", "num_lines": 76}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass InsightsResultFields extends AbstractEnum {\n\n  const DESCRIPTION = 'description';\n  const DESCRIPTION_FROM_API_DOC = 'description_from_api_doc';\n  const ID = 'id';\n  const NAME = 'name';\n  const PERIOD = 'period';\n  const TITLE = 'title';\n  const VALUES = 'values';\n\n  public function getFieldTypes() {\n    return array(\n      'description' => 'string',\n      'description_from_api_doc' => 'string',\n      'id' => 'string',\n      'name' => 'string',\n      'period' => 'string',\n      'title' => 'string',\n      'values' => 'list<Object>',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass InstagramInsightsResultFields extends AbstractEnum {\n\n  const DESCRIPTION = 'description';\n  const ID = 'id';\n  const NAME = 'name';\n  const PERIOD = 'period';\n  const TITLE = 'title';\n  const TOTAL_VALUE = 'total_value';\n  const VALUES = 'values';\n\n  public function getFieldTypes() {\n    return array(\n      'description' => 'string',\n      'id' => 'string',\n      'name' => 'string',\n      'period' => 'string',\n      'title' => 'string',\n      'total_value' => 'Object',\n      'values' => 'list<InstagramInsightsValue>',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass InstagramInsightsValueFields extends AbstractEnum {\n\n  const END_TIME = 'end_time';\n  const VALUE = 'value';\n\n  public function getFieldTypes() {\n    return array(\n      'end_time' => 'datetime',\n      'value' => 'Object',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass InstagramUserFields extends AbstractEnum {\n\n  const FOLLOW_COUNT = 'follow_count';\n  const FOLLOWED_BY_COUNT = 'followed_by_count';\n  const HAS_PROFILE_PICTURE = 'has_profile_picture';\n  const ID = 'id';\n  const IS_PRIVATE = 'is_private';\n  const IS_PUBLISHED = 'is_published';\n  const MEDIA_COUNT = 'media_count';\n  const MINI_SHOP_STOREFRONT = 'mini_shop_storefront';\n  const OWNER_BUSINESS = 'owner_business';\n  const PROFILE_PIC = 'profile_pic';\n  const USERNAME = 'username';\n\n  public function getFieldTypes() {\n    return array(\n      'follow_count' => 'int',\n      'followed_by_count' => 'int',\n      'has_profile_picture' => 'bool',\n      'id' => 'string',\n      'is_private' => 'bool',\n      'is_published' => 'bool',\n      'media_count' => 'int',\n      'mini_shop_storefront' => 'Shop',\n      'owner_business' => 'Business',\n      'profile_pic' => 'string',\n      'username' => 'string',\n    );\n  }\n}\n", "num_lines": 68}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass InstantArticlesStatsFields extends AbstractEnum {\n\n  const ERROR = 'error';\n  const METADATA = 'metadata';\n  const METRIC = 'metric';\n  const TOTALS = 'totals';\n  const X_AXIS_BREAKDOWN = 'x_axis_breakdown';\n\n  public function getFieldTypes() {\n    return array(\n      'error' => 'string',\n      'metadata' => 'list<map<string, Object>>',\n      'metric' => 'Object',\n      'totals' => 'list<map<string, Object>>',\n      'x_axis_breakdown' => 'list<list<map<string, Object>>>',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass IosAppLinkFields extends AbstractEnum {\n\n  const APP_NAME = 'app_name';\n  const APP_STORE_ID = 'app_store_id';\n  const URL = 'url';\n\n  public function getFieldTypes() {\n    return array(\n      'app_name' => 'string',\n      'app_store_id' => 'string',\n      'url' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass JobOpeningFields extends AbstractEnum {\n\n  const ADDRESS = 'address';\n  const APPLICATION_CALLBACK_URL = 'application_callback_url';\n  const CREATED_TIME = 'created_time';\n  const DESCRIPTION = 'description';\n  const ERRORS = 'errors';\n  const EXTERNAL_COMPANY_FACEBOOK_URL = 'external_company_facebook_url';\n  const EXTERNAL_COMPANY_FULL_ADDRESS = 'external_company_full_address';\n  const EXTERNAL_COMPANY_ID = 'external_company_id';\n  const EXTERNAL_COMPANY_NAME = 'external_company_name';\n  const EXTERNAL_ID = 'external_id';\n  const ID = 'id';\n  const JOB_STATUS = 'job_status';\n  const LATITUDE = 'latitude';\n  const LONGITUDE = 'longitude';\n  const OFFSITE_APPLICATION_URL = 'offsite_application_url';\n  const PAGE = 'page';\n  const PHOTO = 'photo';\n  const PLATFORM_REVIEW_STATUS = 'platform_review_status';\n  const POST = 'post';\n  const REMOTE_TYPE = 'remote_type';\n  const REVIEW_REJECTION_REASONS = 'review_rejection_reasons';\n  const TITLE = 'title';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'address' => 'string',\n      'application_callback_url' => 'string',\n      'created_time' => 'datetime',\n      'description' => 'string',\n      'errors' => 'list<string>',\n      'external_company_facebook_url' => 'string',\n      'external_company_full_address' => 'string',\n      'external_company_id' => 'string',\n      'external_company_name' => 'string',\n      'external_id' => 'string',\n      'id' => 'string',\n      'job_status' => 'JobStatus',\n      'latitude' => 'float',\n      'longitude' => 'float',\n      'offsite_application_url' => 'string',\n      'page' => 'Page',\n      'photo' => 'Photo',\n      'platform_review_status' => 'PlatformReviewStatus',\n      'post' => 'Post',\n      'remote_type' => 'string',\n      'review_rejection_reasons' => 'list<ReviewRejectionReasons>',\n      'title' => 'string',\n      'type' => 'Type',\n    );\n  }\n}\n", "num_lines": 92}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass KeyValueFields extends AbstractEnum {\n\n  const KEY = 'key';\n  const VALUE = 'value';\n\n  public function getFieldTypes() {\n    return array(\n      'key' => 'string',\n      'value' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadFields extends AbstractEnum {\n\n  const AD_ID = 'ad_id';\n  const AD_NAME = 'ad_name';\n  const ADSET_ID = 'adset_id';\n  const ADSET_NAME = 'adset_name';\n  const CAMPAIGN_ID = 'campaign_id';\n  const CAMPAIGN_NAME = 'campaign_name';\n  const CREATED_TIME = 'created_time';\n  const CUSTOM_DISCLAIMER_RESPONSES = 'custom_disclaimer_responses';\n  const FIELD_DATA = 'field_data';\n  const FORM_ID = 'form_id';\n  const HOME_LISTING = 'home_listing';\n  const ID = 'id';\n  const IS_ORGANIC = 'is_organic';\n  const PARTNER_NAME = 'partner_name';\n  const PLATFORM = 'platform';\n  const POST = 'post';\n  const POST_SUBMISSION_CHECK_RESULT = 'post_submission_check_result';\n  const RETAILER_ITEM_ID = 'retailer_item_id';\n  const VEHICLE = 'vehicle';\n\n  public function getFieldTypes() {\n    return array(\n      'ad_id' => 'string',\n      'ad_name' => 'string',\n      'adset_id' => 'string',\n      'adset_name' => 'string',\n      'campaign_id' => 'string',\n      'campaign_name' => 'string',\n      'created_time' => 'datetime',\n      'custom_disclaimer_responses' => 'list<UserLeadGenDisclaimerResponse>',\n      'field_data' => 'list<UserLeadGenFieldData>',\n      'form_id' => 'string',\n      'home_listing' => 'HomeListing',\n      'id' => 'string',\n      'is_organic' => 'bool',\n      'partner_name' => 'string',\n      'platform' => 'string',\n      'post' => 'Link',\n      'post_submission_check_result' => 'LeadGenPostSubmissionCheckResult',\n      'retailer_item_id' => 'string',\n      'vehicle' => 'Vehicle',\n    );\n  }\n}\n", "num_lines": 84}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadGenAppointmentBookingInfoFields extends AbstractEnum {\n\n  const ADVERTISER_TIMEZONE_OFFSET = 'advertiser_timezone_offset';\n  const APPOINTMENT_DURATIONS = 'appointment_durations';\n  const APPOINTMENT_SLOTS_BY_DAY = 'appointment_slots_by_day';\n\n  public function getFieldTypes() {\n    return array(\n      'advertiser_timezone_offset' => 'string',\n      'appointment_durations' => 'list<string>',\n      'appointment_slots_by_day' => 'list<Object>',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadGenConditionalQuestionsGroupChoicesFields extends AbstractEnum {\n\n  const CUSTOMIZED_TOKEN = 'customized_token';\n  const NEXT_QUESTION_CHOICES = 'next_question_choices';\n  const VALUE = 'value';\n\n  public function getFieldTypes() {\n    return array(\n      'customized_token' => 'string',\n      'next_question_choices' => 'list<LeadGenConditionalQuestionsGroupChoices>',\n      'value' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadGenConditionalQuestionsGroupQuestionsFields extends AbstractEnum {\n\n  const FIELD_KEY = 'field_key';\n  const INPUT_TYPE = 'input_type';\n  const NAME = 'name';\n\n  public function getFieldTypes() {\n    return array(\n      'field_key' => 'string',\n      'input_type' => 'string',\n      'name' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadGenDraftQuestionFields extends AbstractEnum {\n\n  const CONDITIONAL_QUESTIONS_CHOICES = 'conditional_questions_choices';\n  const CONDITIONAL_QUESTIONS_GROUP_ID = 'conditional_questions_group_id';\n  const DEPENDENT_CONDITIONAL_QUESTIONS = 'dependent_conditional_questions';\n  const INLINE_CONTEXT = 'inline_context';\n  const KEY = 'key';\n  const LABEL = 'label';\n  const OPTIONS = 'options';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'conditional_questions_choices' => 'list<LeadGenConditionalQuestionsGroupChoices>',\n      'conditional_questions_group_id' => 'string',\n      'dependent_conditional_questions' => 'list<LeadGenConditionalQuestionsGroupQuestions>',\n      'inline_context' => 'string',\n      'key' => 'string',\n      'label' => 'string',\n      'options' => 'list<LeadGenQuestionOption>',\n      'type' => 'string',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadgenFormFields extends AbstractEnum {\n\n  const ALLOW_ORGANIC_LEAD = 'allow_organic_lead';\n  const BLOCK_DISPLAY_FOR_NON_TARGETED_VIEWER = 'block_display_for_non_targeted_viewer';\n  const CONTEXT_CARD = 'context_card';\n  const CREATED_TIME = 'created_time';\n  const CREATOR = 'creator';\n  const EXPIRED_LEADS_COUNT = 'expired_leads_count';\n  const FOLLOW_UP_ACTION_TEXT = 'follow_up_action_text';\n  const FOLLOW_UP_ACTION_URL = 'follow_up_action_url';\n  const ID = 'id';\n  const IS_OPTIMIZED_FOR_QUALITY = 'is_optimized_for_quality';\n  const LEADS_COUNT = 'leads_count';\n  const LEGAL_CONTENT = 'legal_content';\n  const LOCALE = 'locale';\n  const NAME = 'name';\n  const ORGANIC_LEADS_COUNT = 'organic_leads_count';\n  const PAGE = 'page';\n  const PAGE_ID = 'page_id';\n  const PRIVACY_POLICY_URL = 'privacy_policy_url';\n  const QUESTION_PAGE_CUSTOM_HEADLINE = 'question_page_custom_headline';\n  const QUESTIONS = 'questions';\n  const STATUS = 'status';\n  const THANK_YOU_PAGE = 'thank_you_page';\n  const TRACKING_PARAMETERS = 'tracking_parameters';\n\n  public function getFieldTypes() {\n    return array(\n      'allow_organic_lead' => 'bool',\n      'block_display_for_non_targeted_viewer' => 'bool',\n      'context_card' => 'Object',\n      'created_time' => 'datetime',\n      'creator' => 'User',\n      'expired_leads_count' => 'unsigned int',\n      'follow_up_action_text' => 'string',\n      'follow_up_action_url' => 'string',\n      'id' => 'string',\n      'is_optimized_for_quality' => 'bool',\n      'leads_count' => 'unsigned int',\n      'legal_content' => 'Object',\n      'locale' => 'string',\n      'name' => 'string',\n      'organic_leads_count' => 'unsigned int',\n      'page' => 'Page',\n      'page_id' => 'string',\n      'privacy_policy_url' => 'string',\n      'question_page_custom_headline' => 'string',\n      'questions' => 'list<LeadGenQuestion>',\n      'status' => 'string',\n      'thank_you_page' => 'Object',\n      'tracking_parameters' => 'list<map<string, string>>',\n    );\n  }\n}\n", "num_lines": 92}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadGenPostSubmissionCheckResultFields extends AbstractEnum {\n\n  const API_CALL_RESULT = 'api_call_result';\n  const API_ERROR_MESSAGE = 'api_error_message';\n  const SHOWN_THANK_YOU_PAGE = 'shown_thank_you_page';\n\n  public function getFieldTypes() {\n    return array(\n      'api_call_result' => 'string',\n      'api_error_message' => 'string',\n      'shown_thank_you_page' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadGenQuestionFields extends AbstractEnum {\n\n  const CONDITIONAL_QUESTIONS_CHOICES = 'conditional_questions_choices';\n  const CONDITIONAL_QUESTIONS_GROUP_ID = 'conditional_questions_group_id';\n  const DEPENDENT_CONDITIONAL_QUESTIONS = 'dependent_conditional_questions';\n  const ID = 'id';\n  const INLINE_CONTEXT = 'inline_context';\n  const KEY = 'key';\n  const LABEL = 'label';\n  const OPTIONS = 'options';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'conditional_questions_choices' => 'list<LeadGenConditionalQuestionsGroupChoices>',\n      'conditional_questions_group_id' => 'string',\n      'dependent_conditional_questions' => 'list<LeadGenConditionalQuestionsGroupQuestions>',\n      'id' => 'string',\n      'inline_context' => 'string',\n      'key' => 'string',\n      'label' => 'string',\n      'options' => 'list<LeadGenQuestionOption>',\n      'type' => 'string',\n    );\n  }\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LeadGenQuestionOptionFields extends AbstractEnum {\n\n  const KEY = 'key';\n  const VALUE = 'value';\n\n  public function getFieldTypes() {\n    return array(\n      'key' => 'string',\n      'value' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LifeEventFields extends AbstractEnum {\n\n  const DESCRIPTION = 'description';\n  const END_TIME = 'end_time';\n  const FROM = 'from';\n  const ID = 'id';\n  const IS_HIDDEN = 'is_hidden';\n  const START_TIME = 'start_time';\n  const TITLE = 'title';\n  const UPDATED_TIME = 'updated_time';\n\n  public function getFieldTypes() {\n    return array(\n      'description' => 'string',\n      'end_time' => 'datetime',\n      'from' => 'Page',\n      'id' => 'string',\n      'is_hidden' => 'bool',\n      'start_time' => 'datetime',\n      'title' => 'string',\n      'updated_time' => 'datetime',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LinkFields extends AbstractEnum {\n\n  const CAPTION = 'caption';\n  const CREATED_TIME = 'created_time';\n  const DESCRIPTION = 'description';\n  const FROM = 'from';\n  const ICON = 'icon';\n  const ID = 'id';\n  const LINK = 'link';\n  const MESSAGE = 'message';\n  const MULTI_SHARE_OPTIMIZED = 'multi_share_optimized';\n  const NAME = 'name';\n  const PRIVACY = 'privacy';\n  const VIA = 'via';\n\n  public function getFieldTypes() {\n    return array(\n      'caption' => 'string',\n      'created_time' => 'datetime',\n      'description' => 'string',\n      'from' => 'Object',\n      'icon' => 'string',\n      'id' => 'string',\n      'link' => 'string',\n      'message' => 'string',\n      'multi_share_optimized' => 'bool',\n      'name' => 'string',\n      'privacy' => 'Privacy',\n      'via' => 'Object',\n    );\n  }\n}\n", "num_lines": 70}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LiveVideoAdBreakConfigFields extends AbstractEnum {\n\n  const DEFAULT_AD_BREAK_DURATION = 'default_ad_break_duration';\n  const FAILURE_REASON_POLLING_INTERVAL = 'failure_reason_polling_interval';\n  const FIRST_BREAK_ELIGIBLE_SECS = 'first_break_eligible_secs';\n  const GUIDE_URL = 'guide_url';\n  const IS_ELIGIBLE_TO_ONBOARD = 'is_eligible_to_onboard';\n  const IS_ENABLED = 'is_enabled';\n  const ONBOARDING_URL = 'onboarding_url';\n  const PREPARING_DURATION = 'preparing_duration';\n  const TIME_BETWEEN_AD_BREAKS_SECS = 'time_between_ad_breaks_secs';\n  const VIEWER_COUNT_THRESHOLD = 'viewer_count_threshold';\n\n  public function getFieldTypes() {\n    return array(\n      'default_ad_break_duration' => 'unsigned int',\n      'failure_reason_polling_interval' => 'unsigned int',\n      'first_break_eligible_secs' => 'unsigned int',\n      'guide_url' => 'string',\n      'is_eligible_to_onboard' => 'bool',\n      'is_enabled' => 'bool',\n      'onboarding_url' => 'string',\n      'preparing_duration' => 'unsigned int',\n      'time_between_ad_breaks_secs' => 'unsigned int',\n      'viewer_count_threshold' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LiveVideoErrorFields extends AbstractEnum {\n\n  const CREATION_TIME = 'creation_time';\n  const ERROR_CODE = 'error_code';\n  const ERROR_MESSAGE = 'error_message';\n  const ERROR_TYPE = 'error_type';\n  const ID = 'id';\n\n  public function getFieldTypes() {\n    return array(\n      'creation_time' => 'datetime',\n      'error_code' => 'int',\n      'error_message' => 'string',\n      'error_type' => 'string',\n      'id' => 'string',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LiveVideoFields extends AbstractEnum {\n\n  const AD_BREAK_CONFIG = 'ad_break_config';\n  const AD_BREAK_FAILURE_REASON = 'ad_break_failure_reason';\n  const BROADCAST_START_TIME = 'broadcast_start_time';\n  const COPYRIGHT = 'copyright';\n  const CREATION_TIME = 'creation_time';\n  const DASH_INGEST_URL = 'dash_ingest_url';\n  const DASH_PREVIEW_URL = 'dash_preview_url';\n  const DESCRIPTION = 'description';\n  const EMBED_HTML = 'embed_html';\n  const FROM = 'from';\n  const ID = 'id';\n  const INGEST_STREAMS = 'ingest_streams';\n  const IS_MANUAL_MODE = 'is_manual_mode';\n  const IS_REFERENCE_ONLY = 'is_reference_only';\n  const LIVE_VIEWS = 'live_views';\n  const OVERLAY_URL = 'overlay_url';\n  const PERMALINK_URL = 'permalink_url';\n  const PLANNED_START_TIME = 'planned_start_time';\n  const RECOMMENDED_ENCODER_SETTINGS = 'recommended_encoder_settings';\n  const SECONDS_LEFT = 'seconds_left';\n  const SECURE_STREAM_URL = 'secure_stream_url';\n  const STATUS = 'status';\n  const STREAM_URL = 'stream_url';\n  const TARGETING = 'targeting';\n  const TITLE = 'title';\n  const TOTAL_VIEWS = 'total_views';\n  const VIDEO = 'video';\n\n  public function getFieldTypes() {\n    return array(\n      'ad_break_config' => 'LiveVideoAdBreakConfig',\n      'ad_break_failure_reason' => 'string',\n      'broadcast_start_time' => 'datetime',\n      'copyright' => 'VideoCopyright',\n      'creation_time' => 'datetime',\n      'dash_ingest_url' => 'string',\n      'dash_preview_url' => 'string',\n      'description' => 'string',\n      'embed_html' => 'Object',\n      'from' => 'Object',\n      'id' => 'string',\n      'ingest_streams' => 'list<LiveVideoInputStream>',\n      'is_manual_mode' => 'bool',\n      'is_reference_only' => 'bool',\n      'live_views' => 'unsigned int',\n      'overlay_url' => 'string',\n      'permalink_url' => 'Object',\n      'planned_start_time' => 'datetime',\n      'recommended_encoder_settings' => 'LiveVideoRecommendedEncoderSettings',\n      'seconds_left' => 'int',\n      'secure_stream_url' => 'string',\n      'status' => 'string',\n      'stream_url' => 'string',\n      'targeting' => 'LiveVideoTargeting',\n      'title' => 'string',\n      'total_views' => 'string',\n      'video' => 'AdVideo',\n    );\n  }\n}\n", "num_lines": 100}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LiveVideoInputStreamFields extends AbstractEnum {\n\n  const DASH_INGEST_URL = 'dash_ingest_url';\n  const DASH_PREVIEW_URL = 'dash_preview_url';\n  const ID = 'id';\n  const IS_MASTER = 'is_master';\n  const SECURE_STREAM_URL = 'secure_stream_url';\n  const STREAM_HEALTH = 'stream_health';\n  const STREAM_ID = 'stream_id';\n  const STREAM_URL = 'stream_url';\n\n  public function getFieldTypes() {\n    return array(\n      'dash_ingest_url' => 'string',\n      'dash_preview_url' => 'string',\n      'id' => 'string',\n      'is_master' => 'bool',\n      'secure_stream_url' => 'string',\n      'stream_health' => 'Object',\n      'stream_id' => 'string',\n      'stream_url' => 'string',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LiveVideoRecommendedEncoderSettingsFields extends AbstractEnum {\n\n  const AUDIO_CODEC_SETTINGS = 'audio_codec_settings';\n  const STREAMING_PROTOCOL = 'streaming_protocol';\n  const VIDEO_CODEC_SETTINGS = 'video_codec_settings';\n\n  public function getFieldTypes() {\n    return array(\n      'audio_codec_settings' => 'Object',\n      'streaming_protocol' => 'string',\n      'video_codec_settings' => 'Object',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LiveVideoTargetingFields extends AbstractEnum {\n\n  const AGE_MAX = 'age_max';\n  const AGE_MIN = 'age_min';\n  const EXCLUDED_COUNTRIES = 'excluded_countries';\n  const GEO_LOCATIONS = 'geo_locations';\n\n  public function getFieldTypes() {\n    return array(\n      'age_max' => 'unsigned int',\n      'age_min' => 'unsigned int',\n      'excluded_countries' => 'list<string>',\n      'geo_locations' => 'TargetingGeoLocation',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LocalServiceBusinessFields extends AbstractEnum {\n\n  const ADDRESS = 'address';\n  const APPLINKS = 'applinks';\n  const AVAILABILITY = 'availability';\n  const BRAND = 'brand';\n  const CATEGORY = 'category';\n  const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';\n  const CONDITION = 'condition';\n  const CUISINE_TYPE = 'cuisine_type';\n  const CURRENCY = 'currency';\n  const CUSTOM_LABEL_0 = 'custom_label_0';\n  const CUSTOM_LABEL_1 = 'custom_label_1';\n  const CUSTOM_LABEL_2 = 'custom_label_2';\n  const CUSTOM_LABEL_3 = 'custom_label_3';\n  const CUSTOM_LABEL_4 = 'custom_label_4';\n  const CUSTOM_NUMBER_0 = 'custom_number_0';\n  const CUSTOM_NUMBER_1 = 'custom_number_1';\n  const CUSTOM_NUMBER_2 = 'custom_number_2';\n  const CUSTOM_NUMBER_3 = 'custom_number_3';\n  const CUSTOM_NUMBER_4 = 'custom_number_4';\n  const DESCRIPTION = 'description';\n  const EXPIRATION_DATE = 'expiration_date';\n  const GTIN = 'gtin';\n  const ID = 'id';\n  const IMAGE_FETCH_STATUS = 'image_fetch_status';\n  const IMAGES = 'images';\n  const LOCAL_SERVICE_BUSINESS_ID = 'local_service_business_id';\n  const PHONE = 'phone';\n  const PRICE = 'price';\n  const PRICE_RANGE = 'price_range';\n  const RETAILER_CATEGORY = 'retailer_category';\n  const SANITIZED_IMAGES = 'sanitized_images';\n  const SIZE = 'size';\n  const TITLE = 'title';\n  const UNIT_PRICE = 'unit_price';\n  const URL = 'url';\n  const VENDOR_ID = 'vendor_id';\n  const VISIBILITY = 'visibility';\n\n  public function getFieldTypes() {\n    return array(\n      'address' => 'Object',\n      'applinks' => 'CatalogItemAppLinks',\n      'availability' => 'Availability',\n      'brand' => 'string',\n      'category' => 'string',\n      'category_specific_fields' => 'CatalogSubVerticalList',\n      'condition' => 'Condition',\n      'cuisine_type' => 'string',\n      'currency' => 'string',\n      'custom_label_0' => 'string',\n      'custom_label_1' => 'string',\n      'custom_label_2' => 'string',\n      'custom_label_3' => 'string',\n      'custom_label_4' => 'string',\n      'custom_number_0' => 'unsigned int',\n      'custom_number_1' => 'unsigned int',\n      'custom_number_2' => 'unsigned int',\n      'custom_number_3' => 'unsigned int',\n      'custom_number_4' => 'unsigned int',\n      'description' => 'string',\n      'expiration_date' => 'string',\n      'gtin' => 'string',\n      'id' => 'string',\n      'image_fetch_status' => 'ImageFetchStatus',\n      'images' => 'list<string>',\n      'local_service_business_id' => 'string',\n      'phone' => 'string',\n      'price' => 'string',\n      'price_range' => 'string',\n      'retailer_category' => 'string',\n      'sanitized_images' => 'list<string>',\n      'size' => 'string',\n      'title' => 'string',\n      'unit_price' => 'Object',\n      'url' => 'string',\n      'vendor_id' => 'string',\n      'visibility' => 'Visibility',\n    );\n  }\n}\n", "num_lines": 120}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LocationFields extends AbstractEnum {\n\n  const CITY = 'city';\n  const CITY_ID = 'city_id';\n  const COUNTRY = 'country';\n  const COUNTRY_CODE = 'country_code';\n  const LATITUDE = 'latitude';\n  const LOCATED_IN = 'located_in';\n  const LONGITUDE = 'longitude';\n  const NAME = 'name';\n  const REGION = 'region';\n  const REGION_ID = 'region_id';\n  const STATE = 'state';\n  const STREET = 'street';\n  const ZIP = 'zip';\n\n  public function getFieldTypes() {\n    return array(\n      'city' => 'string',\n      'city_id' => 'unsigned int',\n      'country' => 'string',\n      'country_code' => 'string',\n      'latitude' => 'float',\n      'located_in' => 'string',\n      'longitude' => 'float',\n      'name' => 'string',\n      'region' => 'string',\n      'region_id' => 'unsigned int',\n      'state' => 'string',\n      'street' => 'string',\n      'zip' => 'string',\n    );\n  }\n}\n", "num_lines": 72}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass LookalikeSpecFields extends AbstractEnum {\n\n  const COUNTRY = 'country';\n  const IS_FINANCIAL_SERVICE = 'is_financial_service';\n  const ORIGIN = 'origin';\n  const ORIGIN_EVENT_NAME = 'origin_event_name';\n  const ORIGIN_EVENT_SOURCE_NAME = 'origin_event_source_name';\n  const ORIGIN_EVENT_SOURCE_TYPE = 'origin_event_source_type';\n  const PRODUCT_SET_NAME = 'product_set_name';\n  const RATIO = 'ratio';\n  const STARTING_RATIO = 'starting_ratio';\n  const TARGET_COUNTRIES = 'target_countries';\n  const TARGET_COUNTRY_NAMES = 'target_country_names';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'country' => 'string',\n      'is_financial_service' => 'bool',\n      'origin' => 'list<Object>',\n      'origin_event_name' => 'string',\n      'origin_event_source_name' => 'string',\n      'origin_event_source_type' => 'string',\n      'product_set_name' => 'string',\n      'ratio' => 'float',\n      'starting_ratio' => 'float',\n      'target_countries' => 'list<string>',\n      'target_country_names' => 'list',\n      'type' => 'string',\n    );\n  }\n}\n", "num_lines": 70}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MailingAddressFields extends AbstractEnum {\n\n  const CITY = 'city';\n  const CITY_PAGE = 'city_page';\n  const COUNTRY = 'country';\n  const ID = 'id';\n  const POSTAL_CODE = 'postal_code';\n  const REGION = 'region';\n  const STREET1 = 'street1';\n  const STREET2 = 'street2';\n\n  public function getFieldTypes() {\n    return array(\n      'city' => 'string',\n      'city_page' => 'Page',\n      'country' => 'string',\n      'id' => 'string',\n      'postal_code' => 'string',\n      'region' => 'string',\n      'street1' => 'string',\n      'street2' => 'string',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ManagedPartnerBusinessFields extends AbstractEnum {\n\n  const AD_ACCOUNT = 'ad_account';\n  const CATALOG_SEGMENT = 'catalog_segment';\n  const EXTENDED_CREDIT = 'extended_credit';\n  const PAGE = 'page';\n  const SELLER_BUSINESS_INFO = 'seller_business_info';\n  const SELLER_BUSINESS_STATUS = 'seller_business_status';\n  const TEMPLATE = 'template';\n\n  public function getFieldTypes() {\n    return array(\n      'ad_account' => 'AdAccount',\n      'catalog_segment' => 'ProductCatalog',\n      'extended_credit' => 'ExtendedCredit',\n      'page' => 'Page',\n      'seller_business_info' => 'Object',\n      'seller_business_status' => 'string',\n      'template' => 'list<Object>',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MediaFingerprintFields extends AbstractEnum {\n\n  const DURATION_IN_SEC = 'duration_in_sec';\n  const FINGERPRINT_CONTENT_TYPE = 'fingerprint_content_type';\n  const FINGERPRINT_TYPE = 'fingerprint_type';\n  const ID = 'id';\n  const METADATA = 'metadata';\n  const TITLE = 'title';\n  const UNIVERSAL_CONTENT_ID = 'universal_content_id';\n\n  public function getFieldTypes() {\n    return array(\n      'duration_in_sec' => 'float',\n      'fingerprint_content_type' => 'string',\n      'fingerprint_type' => 'string',\n      'id' => 'string',\n      'metadata' => 'Object',\n      'title' => 'string',\n      'universal_content_id' => 'string',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MediaTitleFields extends AbstractEnum {\n\n  const APPLINKS = 'applinks';\n  const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';\n  const CONTENT_CATEGORY = 'content_category';\n  const CURRENCY = 'currency';\n  const DESCRIPTION = 'description';\n  const FB_PAGE_ALIAS = 'fb_page_alias';\n  const FB_PAGE_ID = 'fb_page_id';\n  const GENRES = 'genres';\n  const ID = 'id';\n  const IMAGE_FETCH_STATUS = 'image_fetch_status';\n  const IMAGES = 'images';\n  const KG_FB_ID = 'kg_fb_id';\n  const MEDIA_TITLE_ID = 'media_title_id';\n  const PRICE = 'price';\n  const SANITIZED_IMAGES = 'sanitized_images';\n  const TITLE = 'title';\n  const TITLE_DISPLAY_NAME = 'title_display_name';\n  const UNIT_PRICE = 'unit_price';\n  const URL = 'url';\n  const VISIBILITY = 'visibility';\n  const WIKI_DATA_ITEM = 'wiki_data_item';\n\n  public function getFieldTypes() {\n    return array(\n      'applinks' => 'CatalogItemAppLinks',\n      'category_specific_fields' => 'CatalogSubVerticalList',\n      'content_category' => 'string',\n      'currency' => 'string',\n      'description' => 'string',\n      'fb_page_alias' => 'string',\n      'fb_page_id' => 'Page',\n      'genres' => 'list<string>',\n      'id' => 'string',\n      'image_fetch_status' => 'ImageFetchStatus',\n      'images' => 'list<string>',\n      'kg_fb_id' => 'string',\n      'media_title_id' => 'string',\n      'price' => 'string',\n      'sanitized_images' => 'list<string>',\n      'title' => 'string',\n      'title_display_name' => 'string',\n      'unit_price' => 'Object',\n      'url' => 'string',\n      'visibility' => 'Visibility',\n      'wiki_data_item' => 'string',\n    );\n  }\n}\n", "num_lines": 88}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MessagingFeatureReviewFields extends AbstractEnum {\n\n  const FEATURE = 'feature';\n  const STATUS = 'status';\n\n  public function getFieldTypes() {\n    return array(\n      'feature' => 'string',\n      'status' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MessagingFeatureStatusFields extends AbstractEnum {\n\n  const HOP_V2 = 'hop_v2';\n\n  public function getFieldTypes() {\n    return array(\n      'hop_v2' => 'bool',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MessengerDestinationPageWelcomeMessageFields extends AbstractEnum {\n\n  const ID = 'id';\n  const PAGE_WELCOME_MESSAGE_BODY = 'page_welcome_message_body';\n  const PAGE_WELCOME_MESSAGE_TYPE = 'page_welcome_message_type';\n  const TEMPLATE_NAME = 'template_name';\n  const TIME_CREATED = 'time_created';\n  const TIME_LAST_USED = 'time_last_used';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'page_welcome_message_body' => 'string',\n      'page_welcome_message_type' => 'string',\n      'template_name' => 'string',\n      'time_created' => 'datetime',\n      'time_last_used' => 'datetime',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MessengerProfileFields extends AbstractEnum {\n\n  const ACCOUNT_LINKING_URL = 'account_linking_url';\n  const GET_STARTED = 'get_started';\n  const GREETING = 'greeting';\n  const ICE_BREAKERS = 'ice_breakers';\n  const PAYMENT_SETTINGS = 'payment_settings';\n  const PERSISTENT_MENU = 'persistent_menu';\n  const SUBJECT_TO_NEW_EU_PRIVACY_RULES = 'subject_to_new_eu_privacy_rules';\n  const TARGET_AUDIENCE = 'target_audience';\n  const WHITELISTED_DOMAINS = 'whitelisted_domains';\n\n  public function getFieldTypes() {\n    return array(\n      'account_linking_url' => 'string',\n      'get_started' => 'Object',\n      'greeting' => 'list<Object>',\n      'ice_breakers' => 'list<Object>',\n      'payment_settings' => 'Object',\n      'persistent_menu' => 'list<Object>',\n      'subject_to_new_eu_privacy_rules' => 'bool',\n      'target_audience' => 'Object',\n      'whitelisted_domains' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MinimumBudgetFields extends AbstractEnum {\n\n  const CURRENCY = 'currency';\n  const MIN_DAILY_BUDGET_HIGH_FREQ = 'min_daily_budget_high_freq';\n  const MIN_DAILY_BUDGET_IMP = 'min_daily_budget_imp';\n  const MIN_DAILY_BUDGET_LOW_FREQ = 'min_daily_budget_low_freq';\n  const MIN_DAILY_BUDGET_VIDEO_VIEWS = 'min_daily_budget_video_views';\n\n  public function getFieldTypes() {\n    return array(\n      'currency' => 'string',\n      'min_daily_budget_high_freq' => 'int',\n      'min_daily_budget_imp' => 'int',\n      'min_daily_budget_low_freq' => 'int',\n      'min_daily_budget_video_views' => 'int',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass MusicVideoCopyrightFields extends AbstractEnum {\n\n  const CREATION_TIME = 'creation_time';\n  const DISPLAYED_MATCHES_COUNT = 'displayed_matches_count';\n  const ID = 'id';\n  const IN_CONFLICT = 'in_conflict';\n  const ISRC = 'isrc';\n  const MATCH_RULE = 'match_rule';\n  const OWNERSHIP_COUNTRIES = 'ownership_countries';\n  const REFERENCE_FILE_STATUS = 'reference_file_status';\n  const RIDGE_MONITORING_STATUS = 'ridge_monitoring_status';\n  const TAGS = 'tags';\n  const UPDATE_TIME = 'update_time';\n  const VIDEO_ASSET = 'video_asset';\n  const WHITELISTED_FB_USERS = 'whitelisted_fb_users';\n  const WHITELISTED_IG_USERS = 'whitelisted_ig_users';\n\n  public function getFieldTypes() {\n    return array(\n      'creation_time' => 'datetime',\n      'displayed_matches_count' => 'int',\n      'id' => 'string',\n      'in_conflict' => 'bool',\n      'isrc' => 'string',\n      'match_rule' => 'VideoCopyrightRule',\n      'ownership_countries' => 'list<string>',\n      'reference_file_status' => 'string',\n      'ridge_monitoring_status' => 'string',\n      'tags' => 'list<string>',\n      'update_time' => 'datetime',\n      'video_asset' => 'CopyrightReferenceContainer',\n      'whitelisted_fb_users' => 'list<Object>',\n      'whitelisted_ig_users' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 74}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass NullNodeFields extends AbstractEnum {\n\n\n  public function getFieldTypes() {\n    return array(\n    );\n  }\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OfflineConversionDataSetFields extends AbstractEnum {\n\n  const AUTOMATIC_MATCHING_FIELDS = 'automatic_matching_fields';\n  const BUSINESS = 'business';\n  const CAN_PROXY = 'can_proxy';\n  const CONFIG = 'config';\n  const CREATION_TIME = 'creation_time';\n  const CREATOR = 'creator';\n  const DATA_USE_SETTING = 'data_use_setting';\n  const DESCRIPTION = 'description';\n  const DUPLICATE_ENTRIES = 'duplicate_entries';\n  const ENABLE_AUTO_ASSIGN_TO_ACCOUNTS = 'enable_auto_assign_to_accounts';\n  const ENABLE_AUTOMATIC_MATCHING = 'enable_automatic_matching';\n  const EVENT_STATS = 'event_stats';\n  const EVENT_TIME_MAX = 'event_time_max';\n  const EVENT_TIME_MIN = 'event_time_min';\n  const FIRST_PARTY_COOKIE_STATUS = 'first_party_cookie_status';\n  const ID = 'id';\n  const IS_CONSOLIDATED_CONTAINER = 'is_consolidated_container';\n  const IS_CREATED_BY_BUSINESS = 'is_created_by_business';\n  const IS_CRM = 'is_crm';\n  const IS_MTA_USE = 'is_mta_use';\n  const IS_RESTRICTED_USE = 'is_restricted_use';\n  const IS_UNAVAILABLE = 'is_unavailable';\n  const LAST_FIRED_TIME = 'last_fired_time';\n  const LAST_UPLOAD_APP = 'last_upload_app';\n  const LAST_UPLOAD_APP_CHANGED_TIME = 'last_upload_app_changed_time';\n  const MATCH_RATE_APPROX = 'match_rate_approx';\n  const MATCHED_ENTRIES = 'matched_entries';\n  const NAME = 'name';\n  const OWNER_AD_ACCOUNT = 'owner_ad_account';\n  const OWNER_BUSINESS = 'owner_business';\n  const USAGE = 'usage';\n  const VALID_ENTRIES = 'valid_entries';\n  const AUTO_ASSIGN_TO_NEW_ACCOUNTS_ONLY = 'auto_assign_to_new_accounts_only';\n\n  public function getFieldTypes() {\n    return array(\n      'automatic_matching_fields' => 'list<string>',\n      'business' => 'Business',\n      'can_proxy' => 'bool',\n      'config' => 'string',\n      'creation_time' => 'datetime',\n      'creator' => 'User',\n      'data_use_setting' => 'string',\n      'description' => 'string',\n      'duplicate_entries' => 'int',\n      'enable_auto_assign_to_accounts' => 'bool',\n      'enable_automatic_matching' => 'bool',\n      'event_stats' => 'string',\n      'event_time_max' => 'int',\n      'event_time_min' => 'int',\n      'first_party_cookie_status' => 'string',\n      'id' => 'string',\n      'is_consolidated_container' => 'bool',\n      'is_created_by_business' => 'bool',\n      'is_crm' => 'bool',\n      'is_mta_use' => 'bool',\n      'is_restricted_use' => 'bool',\n      'is_unavailable' => 'bool',\n      'last_fired_time' => 'datetime',\n      'last_upload_app' => 'string',\n      'last_upload_app_changed_time' => 'int',\n      'match_rate_approx' => 'int',\n      'matched_entries' => 'int',\n      'name' => 'string',\n      'owner_ad_account' => 'AdAccount',\n      'owner_business' => 'Business',\n      'usage' => 'OfflineConversionDataSetUsage',\n      'valid_entries' => 'int',\n      'auto_assign_to_new_accounts_only' => 'bool',\n    );\n  }\n}\n", "num_lines": 112}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OfflineConversionDataSetPermissionsFields extends AbstractEnum {\n\n  const CAN_EDIT = 'can_edit';\n  const CAN_EDIT_OR_UPLOAD = 'can_edit_or_upload';\n  const CAN_UPLOAD = 'can_upload';\n  const SHOULD_BLOCK_VANILLA_BUSINESS_EMPLOYEE_ACCESS = 'should_block_vanilla_business_employee_access';\n\n  public function getFieldTypes() {\n    return array(\n      'can_edit' => 'bool',\n      'can_edit_or_upload' => 'bool',\n      'can_upload' => 'bool',\n      'should_block_vanilla_business_employee_access' => 'bool',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OfflineConversionDataSetUploadFields extends AbstractEnum {\n\n  const API_CALLS = 'api_calls';\n  const CREATION_TIME = 'creation_time';\n  const DUPLICATE_ENTRIES = 'duplicate_entries';\n  const EVENT_STATS = 'event_stats';\n  const EVENT_TIME_MAX = 'event_time_max';\n  const EVENT_TIME_MIN = 'event_time_min';\n  const FIRST_UPLOAD_TIME = 'first_upload_time';\n  const ID = 'id';\n  const IS_EXCLUDED_FOR_LIFT = 'is_excluded_for_lift';\n  const LAST_UPLOAD_TIME = 'last_upload_time';\n  const MATCH_RATE_APPROX = 'match_rate_approx';\n  const MATCHED_ENTRIES = 'matched_entries';\n  const UPLOAD_TAG = 'upload_tag';\n  const VALID_ENTRIES = 'valid_entries';\n\n  public function getFieldTypes() {\n    return array(\n      'api_calls' => 'int',\n      'creation_time' => 'int',\n      'duplicate_entries' => 'int',\n      'event_stats' => 'string',\n      'event_time_max' => 'int',\n      'event_time_min' => 'int',\n      'first_upload_time' => 'int',\n      'id' => 'string',\n      'is_excluded_for_lift' => 'bool',\n      'last_upload_time' => 'int',\n      'match_rate_approx' => 'int',\n      'matched_entries' => 'int',\n      'upload_tag' => 'string',\n      'valid_entries' => 'int',\n    );\n  }\n}\n", "num_lines": 74}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OfflineConversionDataSetUsageFields extends AbstractEnum {\n\n  const NUM_LIFT_STUDIES = 'num_lift_studies';\n\n  public function getFieldTypes() {\n    return array(\n      'num_lift_studies' => 'int',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OffsitePixelFields extends AbstractEnum {\n\n  const CREATOR = 'creator';\n  const ID = 'id';\n  const JS_PIXEL = 'js_pixel';\n  const LAST_FIRING_TIME = 'last_firing_time';\n  const NAME = 'name';\n  const TAG = 'tag';\n\n  public function getFieldTypes() {\n    return array(\n      'creator' => 'string',\n      'id' => 'string',\n      'js_pixel' => 'string',\n      'last_firing_time' => 'datetime',\n      'name' => 'string',\n      'tag' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OmegaCustomerTrxFields extends AbstractEnum {\n\n  const AD_ACCOUNT_IDS = 'ad_account_ids';\n  const ADVERTISER_NAME = 'advertiser_name';\n  const AMOUNT = 'amount';\n  const AMOUNT_DUE = 'amount_due';\n  const BILLED_AMOUNT_DETAILS = 'billed_amount_details';\n  const BILLING_PERIOD = 'billing_period';\n  const CDN_DOWNLOAD_URI = 'cdn_download_uri';\n  const CURRENCY = 'currency';\n  const DOWNLOAD_URI = 'download_uri';\n  const DUE_DATE = 'due_date';\n  const ENTITY = 'entity';\n  const ID = 'id';\n  const INVOICE_DATE = 'invoice_date';\n  const INVOICE_ID = 'invoice_id';\n  const INVOICE_TYPE = 'invoice_type';\n  const LIABILITY_TYPE = 'liability_type';\n  const PAYMENT_STATUS = 'payment_status';\n  const PAYMENT_TERM = 'payment_term';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'ad_account_ids' => 'list<string>',\n      'advertiser_name' => 'string',\n      'amount' => 'string',\n      'amount_due' => 'CurrencyAmount',\n      'billed_amount_details' => 'Object',\n      'billing_period' => 'string',\n      'cdn_download_uri' => 'string',\n      'currency' => 'string',\n      'download_uri' => 'string',\n      'due_date' => 'datetime',\n      'entity' => 'string',\n      'id' => 'string',\n      'invoice_date' => 'datetime',\n      'invoice_id' => 'string',\n      'invoice_type' => 'string',\n      'liability_type' => 'string',\n      'payment_status' => 'string',\n      'payment_term' => 'string',\n      'type' => 'string',\n    );\n  }\n}\n", "num_lines": 84}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OpenBridgeConfigurationFields extends AbstractEnum {\n\n  const ACCESS_KEY = 'access_key';\n  const ACTIVE = 'active';\n  const ENDPOINT = 'endpoint';\n  const HOST_BUSINESS_ID = 'host_business_id';\n  const HOST_EXTERNAL_ID = 'host_external_id';\n  const ID = 'id';\n  const PIXEL_ID = 'pixel_id';\n\n  public function getFieldTypes() {\n    return array(\n      'access_key' => 'string',\n      'active' => 'bool',\n      'endpoint' => 'string',\n      'host_business_id' => 'string',\n      'host_external_id' => 'string',\n      'id' => 'string',\n      'pixel_id' => 'string',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OpenGraphContextFields extends AbstractEnum {\n\n  const ID = 'id';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass OutcomePredictionPointFields extends AbstractEnum {\n\n  const ACTIONS = 'actions';\n  const IMPRESSIONS = 'impressions';\n  const REACH = 'reach';\n  const SPEND = 'spend';\n\n  public function getFieldTypes() {\n    return array(\n      'actions' => 'float',\n      'impressions' => 'float',\n      'reach' => 'float',\n      'spend' => 'int',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageCallToActionFields extends AbstractEnum {\n\n  const ANDROID_APP = 'android_app';\n  const ANDROID_DEEPLINK = 'android_deeplink';\n  const ANDROID_DESTINATION_TYPE = 'android_destination_type';\n  const ANDROID_PACKAGE_NAME = 'android_package_name';\n  const ANDROID_URL = 'android_url';\n  const CREATED_TIME = 'created_time';\n  const EMAIL_ADDRESS = 'email_address';\n  const FROM = 'from';\n  const ID = 'id';\n  const INTL_NUMBER_WITH_PLUS = 'intl_number_with_plus';\n  const IPHONE_APP = 'iphone_app';\n  const IPHONE_DEEPLINK = 'iphone_deeplink';\n  const IPHONE_DESTINATION_TYPE = 'iphone_destination_type';\n  const IPHONE_URL = 'iphone_url';\n  const STATUS = 'status';\n  const TYPE = 'type';\n  const UPDATED_TIME = 'updated_time';\n  const WEB_DESTINATION_TYPE = 'web_destination_type';\n  const WEB_URL = 'web_url';\n\n  public function getFieldTypes() {\n    return array(\n      'android_app' => 'Application',\n      'android_deeplink' => 'string',\n      'android_destination_type' => 'string',\n      'android_package_name' => 'string',\n      'android_url' => 'string',\n      'created_time' => 'datetime',\n      'email_address' => 'string',\n      'from' => 'Page',\n      'id' => 'string',\n      'intl_number_with_plus' => 'string',\n      'iphone_app' => 'Application',\n      'iphone_deeplink' => 'string',\n      'iphone_destination_type' => 'string',\n      'iphone_url' => 'string',\n      'status' => 'string',\n      'type' => 'string',\n      'updated_time' => 'datetime',\n      'web_destination_type' => 'string',\n      'web_url' => 'string',\n    );\n  }\n}\n", "num_lines": 84}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageCategoryFields extends AbstractEnum {\n\n  const API_ENUM = 'api_enum';\n  const FB_PAGE_CATEGORIES = 'fb_page_categories';\n  const ID = 'id';\n  const NAME = 'name';\n\n  public function getFieldTypes() {\n    return array(\n      'api_enum' => 'string',\n      'fb_page_categories' => 'list<PageCategory>',\n      'id' => 'string',\n      'name' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageChangeProposalFields extends AbstractEnum {\n\n  const ACCEPTANCE_STATUS = 'acceptance_status';\n  const CATEGORY = 'category';\n  const CURRENT_VALUE = 'current_value';\n  const ID = 'id';\n  const PROPOSED_VALUE = 'proposed_value';\n  const UPCOMING_CHANGE_INFO = 'upcoming_change_info';\n\n  public function getFieldTypes() {\n    return array(\n      'acceptance_status' => 'string',\n      'category' => 'string',\n      'current_value' => 'string',\n      'id' => 'string',\n      'proposed_value' => 'string',\n      'upcoming_change_info' => 'PageUpcomingChange',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageCommerceEligibilityFields extends AbstractEnum {\n\n  const OFFSITE = 'offsite';\n  const ONSITE = 'onsite';\n\n  public function getFieldTypes() {\n    return array(\n      'offsite' => 'Object',\n      'onsite' => 'Object',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageFields extends AbstractEnum {\n\n  const ABOUT = 'about';\n  const ACCESS_TOKEN = 'access_token';\n  const AD_CAMPAIGN = 'ad_campaign';\n  const AFFILIATION = 'affiliation';\n  const APP_ID = 'app_id';\n  const ARTISTS_WE_LIKE = 'artists_we_like';\n  const ATTIRE = 'attire';\n  const AWARDS = 'awards';\n  const BAND_INTERESTS = 'band_interests';\n  const BAND_MEMBERS = 'band_members';\n  const BEST_PAGE = 'best_page';\n  const BIO = 'bio';\n  const BIRTHDAY = 'birthday';\n  const BOOKING_AGENT = 'booking_agent';\n  const BUILT = 'built';\n  const BUSINESS = 'business';\n  const CAN_CHECKIN = 'can_checkin';\n  const CAN_POST = 'can_post';\n  const CATEGORY = 'category';\n  const CATEGORY_LIST = 'category_list';\n  const CHECKINS = 'checkins';\n  const COMPANY_OVERVIEW = 'company_overview';\n  const CONNECTED_INSTAGRAM_ACCOUNT = 'connected_instagram_account';\n  const CONNECTED_PAGE_BACKED_INSTAGRAM_ACCOUNT = 'connected_page_backed_instagram_account';\n  const CONTACT_ADDRESS = 'contact_address';\n  const COPYRIGHT_WHITELISTED_IG_PARTNERS = 'copyright_whitelisted_ig_partners';\n  const COUNTRY_PAGE_LIKES = 'country_page_likes';\n  const COVER = 'cover';\n  const CULINARY_TEAM = 'culinary_team';\n  const CURRENT_LOCATION = 'current_location';\n  const DELIVERY_AND_PICKUP_OPTION_INFO = 'delivery_and_pickup_option_info';\n  const DESCRIPTION = 'description';\n  const DESCRIPTION_HTML = 'description_html';\n  const DIFFERENTLY_OPEN_OFFERINGS = 'differently_open_offerings';\n  const DIRECTED_BY = 'directed_by';\n  const DISPLAY_SUBTEXT = 'display_subtext';\n  const DISPLAYED_MESSAGE_RESPONSE_TIME = 'displayed_message_response_time';\n  const EMAILS = 'emails';\n  const ENGAGEMENT = 'engagement';\n  const FAN_COUNT = 'fan_count';\n  const FEATURED_VIDEO = 'featured_video';\n  const FEATURES = 'features';\n  const FOLLOWERS_COUNT = 'followers_count';\n  const FOOD_STYLES = 'food_styles';\n  const FOUNDED = 'founded';\n  const GENERAL_INFO = 'general_info';\n  const GENERAL_MANAGER = 'general_manager';\n  const GENRE = 'genre';\n  const GLOBAL_BRAND_PAGE_NAME = 'global_brand_page_name';\n  const GLOBAL_BRAND_ROOT_ID = 'global_brand_root_id';\n  const HAS_ADDED_APP = 'has_added_app';\n  const HAS_TRANSITIONED_TO_NEW_PAGE_EXPERIENCE = 'has_transitioned_to_new_page_experience';\n  const HAS_WHATSAPP_BUSINESS_NUMBER = 'has_whatsapp_business_number';\n  const HAS_WHATSAPP_NUMBER = 'has_whatsapp_number';\n  const HOMETOWN = 'hometown';\n  const HOURS = 'hours';\n  const ID = 'id';\n  const IMPRESSUM = 'impressum';\n  const INFLUENCES = 'influences';\n  const INSTAGRAM_BUSINESS_ACCOUNT = 'instagram_business_account';\n  const IS_ALWAYS_OPEN = 'is_always_open';\n  const IS_CHAIN = 'is_chain';\n  const IS_COMMUNITY_PAGE = 'is_community_page';\n  const IS_ELIGIBLE_FOR_BRANDED_CONTENT = 'is_eligible_for_branded_content';\n  const IS_MESSENGER_BOT_GET_STARTED_ENABLED = 'is_messenger_bot_get_started_enabled';\n  const IS_MESSENGER_PLATFORM_BOT = 'is_messenger_platform_bot';\n  const IS_OWNED = 'is_owned';\n  const IS_PERMANENTLY_CLOSED = 'is_permanently_closed';\n  const IS_PUBLISHED = 'is_published';\n  const IS_UNCLAIMED = 'is_unclaimed';\n  const IS_VERIFIED = 'is_verified';\n  const IS_WEBHOOKS_SUBSCRIBED = 'is_webhooks_subscribed';\n  const KEYWORDS = 'keywords';\n  const LEADGEN_TOS_ACCEPTANCE_TIME = 'leadgen_tos_acceptance_time';\n  const LEADGEN_TOS_ACCEPTED = 'leadgen_tos_accepted';\n  const LEADGEN_TOS_ACCEPTING_USER = 'leadgen_tos_accepting_user';\n  const LINK = 'link';\n  const LOCATION = 'location';\n  const MEMBERS = 'members';\n  const MERCHANT_ID = 'merchant_id';\n  const MERCHANT_REVIEW_STATUS = 'merchant_review_status';\n  const MESSAGING_FEATURE_STATUS = 'messaging_feature_status';\n  const MESSENGER_ADS_DEFAULT_ICEBREAKERS = 'messenger_ads_default_icebreakers';\n  const MESSENGER_ADS_DEFAULT_PAGE_WELCOME_MESSAGE = 'messenger_ads_default_page_welcome_message';\n  const MESSENGER_ADS_DEFAULT_QUICK_REPLIES = 'messenger_ads_default_quick_replies';\n  const MESSENGER_ADS_QUICK_REPLIES_TYPE = 'messenger_ads_quick_replies_type';\n  const MINI_SHOP_STOREFRONT = 'mini_shop_storefront';\n  const MISSION = 'mission';\n  const MPG = 'mpg';\n  const NAME = 'name';\n  const NAME_WITH_LOCATION_DESCRIPTOR = 'name_with_location_descriptor';\n  const NETWORK = 'network';\n  const NEW_LIKE_COUNT = 'new_like_count';\n  const OFFER_ELIGIBLE = 'offer_eligible';\n  const OVERALL_STAR_RATING = 'overall_star_rating';\n  const OWNER_BUSINESS = 'owner_business';\n  const PAGE_TOKEN = 'page_token';\n  const PARENT_PAGE = 'parent_page';\n  const PARKING = 'parking';\n  const PAYMENT_OPTIONS = 'payment_options';\n  const PERSONAL_INFO = 'personal_info';\n  const PERSONAL_INTERESTS = 'personal_interests';\n  const PHARMA_SAFETY_INFO = 'pharma_safety_info';\n  const PHONE = 'phone';\n  const PICKUP_OPTIONS = 'pickup_options';\n  const PLACE_TYPE = 'place_type';\n  const PLOT_OUTLINE = 'plot_outline';\n  const PREFERRED_AUDIENCE = 'preferred_audience';\n  const PRESS_CONTACT = 'press_contact';\n  const PRICE_RANGE = 'price_range';\n  const PRIVACY_INFO_URL = 'privacy_info_url';\n  const PRODUCED_BY = 'produced_by';\n  const PRODUCTS = 'products';\n  const PROMOTION_ELIGIBLE = 'promotion_eligible';\n  const PROMOTION_INELIGIBLE_REASON = 'promotion_ineligible_reason';\n  const PUBLIC_TRANSIT = 'public_transit';\n  const RATING_COUNT = 'rating_count';\n  const RECIPIENT = 'recipient';\n  const RECORD_LABEL = 'record_label';\n  const RELEASE_DATE = 'release_date';\n  const RESTAURANT_SERVICES = 'restaurant_services';\n  const RESTAURANT_SPECIALTIES = 'restaurant_specialties';\n  const SCHEDULE = 'schedule';\n  const SCREENPLAY_BY = 'screenplay_by';\n  const SEASON = 'season';\n  const SINGLE_LINE_ADDRESS = 'single_line_address';\n  const STARRING = 'starring';\n  const START_INFO = 'start_info';\n  const STORE_CODE = 'store_code';\n  const STORE_LOCATION_DESCRIPTOR = 'store_location_descriptor';\n  const STORE_NUMBER = 'store_number';\n  const STUDIO = 'studio';\n  const SUPPORTS_DONATE_BUTTON_IN_LIVE_VIDEO = 'supports_donate_button_in_live_video';\n  const TALKING_ABOUT_COUNT = 'talking_about_count';\n  const TEMPORARY_STATUS = 'temporary_status';\n  const UNREAD_MESSAGE_COUNT = 'unread_message_count';\n  const UNREAD_NOTIF_COUNT = 'unread_notif_count';\n  const UNSEEN_MESSAGE_COUNT = 'unseen_message_count';\n  const USERNAME = 'username';\n  const VERIFICATION_STATUS = 'verification_status';\n  const VOIP_INFO = 'voip_info';\n  const WEBSITE = 'website';\n  const WERE_HERE_COUNT = 'were_here_count';\n  const WHATSAPP_NUMBER = 'whatsapp_number';\n  const WRITTEN_BY = 'written_by';\n\n  public function getFieldTypes() {\n    return array(\n      'about' => 'string',\n      'access_token' => 'string',\n      'ad_campaign' => 'AdSet',\n      'affiliation' => 'string',\n      'app_id' => 'string',\n      'artists_we_like' => 'string',\n      'attire' => 'string',\n      'awards' => 'string',\n      'band_interests' => 'string',\n      'band_members' => 'string',\n      'best_page' => 'Page',\n      'bio' => 'string',\n      'birthday' => 'string',\n      'booking_agent' => 'string',\n      'built' => 'string',\n      'business' => 'Object',\n      'can_checkin' => 'bool',\n      'can_post' => 'bool',\n      'category' => 'string',\n      'category_list' => 'list<PageCategory>',\n      'checkins' => 'unsigned int',\n      'company_overview' => 'string',\n      'connected_instagram_account' => 'IGUser',\n      'connected_page_backed_instagram_account' => 'IGUser',\n      'contact_address' => 'MailingAddress',\n      'copyright_whitelisted_ig_partners' => 'list<string>',\n      'country_page_likes' => 'unsigned int',\n      'cover' => 'CoverPhoto',\n      'culinary_team' => 'string',\n      'current_location' => 'string',\n      'delivery_and_pickup_option_info' => 'list<string>',\n      'description' => 'string',\n      'description_html' => 'string',\n      'differently_open_offerings' => 'list<map<string, bool>>',\n      'directed_by' => 'string',\n      'display_subtext' => 'string',\n      'displayed_message_response_time' => 'string',\n      'emails' => 'list<string>',\n      'engagement' => 'Engagement',\n      'fan_count' => 'unsigned int',\n      'featured_video' => 'AdVideo',\n      'features' => 'string',\n      'followers_count' => 'unsigned int',\n      'food_styles' => 'list<string>',\n      'founded' => 'string',\n      'general_info' => 'string',\n      'general_manager' => 'string',\n      'genre' => 'string',\n      'global_brand_page_name' => 'string',\n      'global_brand_root_id' => 'string',\n      'has_added_app' => 'bool',\n      'has_transitioned_to_new_page_experience' => 'bool',\n      'has_whatsapp_business_number' => 'bool',\n      'has_whatsapp_number' => 'bool',\n      'hometown' => 'string',\n      'hours' => 'map<string, string>',\n      'id' => 'string',\n      'impressum' => 'string',\n      'influences' => 'string',\n      'instagram_business_account' => 'IGUser',\n      'is_always_open' => 'bool',\n      'is_chain' => 'bool',\n      'is_community_page' => 'bool',\n      'is_eligible_for_branded_content' => 'bool',\n      'is_messenger_bot_get_started_enabled' => 'bool',\n      'is_messenger_platform_bot' => 'bool',\n      'is_owned' => 'bool',\n      'is_permanently_closed' => 'bool',\n      'is_published' => 'bool',\n      'is_unclaimed' => 'bool',\n      'is_verified' => 'bool',\n      'is_webhooks_subscribed' => 'bool',\n      'keywords' => 'Object',\n      'leadgen_tos_acceptance_time' => 'datetime',\n      'leadgen_tos_accepted' => 'bool',\n      'leadgen_tos_accepting_user' => 'User',\n      'link' => 'string',\n      'location' => 'Location',\n      'members' => 'string',\n      'merchant_id' => 'string',\n      'merchant_review_status' => 'string',\n      'messaging_feature_status' => 'MessagingFeatureStatus',\n      'messenger_ads_default_icebreakers' => 'list<string>',\n      'messenger_ads_default_page_welcome_message' => 'MessengerDestinationPageWelcomeMessage',\n      'messenger_ads_default_quick_replies' => 'list<string>',\n      'messenger_ads_quick_replies_type' => 'string',\n      'mini_shop_storefront' => 'Shop',\n      'mission' => 'string',\n      'mpg' => 'string',\n      'name' => 'string',\n      'name_with_location_descriptor' => 'string',\n      'network' => 'string',\n      'new_like_count' => 'unsigned int',\n      'offer_eligible' => 'bool',\n      'overall_star_rating' => 'float',\n      'owner_business' => 'Business',\n      'page_token' => 'string',\n      'parent_page' => 'Page',\n      'parking' => 'PageParking',\n      'payment_options' => 'PagePaymentOptions',\n      'personal_info' => 'string',\n      'personal_interests' => 'string',\n      'pharma_safety_info' => 'string',\n      'phone' => 'string',\n      'pickup_options' => 'list<string>',\n      'place_type' => 'string',\n      'plot_outline' => 'string',\n      'preferred_audience' => 'Targeting',\n      'press_contact' => 'string',\n      'price_range' => 'string',\n      'privacy_info_url' => 'string',\n      'produced_by' => 'string',\n      'products' => 'string',\n      'promotion_eligible' => 'bool',\n      'promotion_ineligible_reason' => 'string',\n      'public_transit' => 'string',\n      'rating_count' => 'unsigned int',\n      'recipient' => 'string',\n      'record_label' => 'string',\n      'release_date' => 'string',\n      'restaurant_services' => 'PageRestaurantServices',\n      'restaurant_specialties' => 'PageRestaurantSpecialties',\n      'schedule' => 'string',\n      'screenplay_by' => 'string',\n      'season' => 'string',\n      'single_line_address' => 'string',\n      'starring' => 'string',\n      'start_info' => 'PageStartInfo',\n      'store_code' => 'string',\n      'store_location_descriptor' => 'string',\n      'store_number' => 'unsigned int',\n      'studio' => 'string',\n      'supports_donate_button_in_live_video' => 'bool',\n      'talking_about_count' => 'unsigned int',\n      'temporary_status' => 'string',\n      'unread_message_count' => 'unsigned int',\n      'unread_notif_count' => 'unsigned int',\n      'unseen_message_count' => 'unsigned int',\n      'username' => 'string',\n      'verification_status' => 'string',\n      'voip_info' => 'VoipInfo',\n      'website' => 'string',\n      'were_here_count' => 'unsigned int',\n      'whatsapp_number' => 'string',\n      'written_by' => 'string',\n    );\n  }\n}\n", "num_lines": 336}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageParkingFields extends AbstractEnum {\n\n  const LOT = 'lot';\n  const STREET = 'street';\n  const VALET = 'valet';\n\n  public function getFieldTypes() {\n    return array(\n      'lot' => 'unsigned int',\n      'street' => 'unsigned int',\n      'valet' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PagePaymentOptionsFields extends AbstractEnum {\n\n  const AMEX = 'amex';\n  const CASH_ONLY = 'cash_only';\n  const DISCOVER = 'discover';\n  const MASTERCARD = 'mastercard';\n  const VISA = 'visa';\n\n  public function getFieldTypes() {\n    return array(\n      'amex' => 'unsigned int',\n      'cash_only' => 'unsigned int',\n      'discover' => 'unsigned int',\n      'mastercard' => 'unsigned int',\n      'visa' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PagePostExperimentFields extends AbstractEnum {\n\n  const AUTO_RESOLVE_SETTINGS = 'auto_resolve_settings';\n  const CREATION_TIME = 'creation_time';\n  const CREATOR = 'creator';\n  const DECLARED_WINNING_TIME = 'declared_winning_time';\n  const DESCRIPTION = 'description';\n  const ID = 'id';\n  const INSIGHT_SNAPSHOTS = 'insight_snapshots';\n  const NAME = 'name';\n  const OPTIMIZATION_GOAL = 'optimization_goal';\n  const PUBLISH_STATUS = 'publish_status';\n  const PUBLISH_TIME = 'publish_time';\n  const SCHEDULED_EXPERIMENT_TIMESTAMP = 'scheduled_experiment_timestamp';\n  const UPDATED_TIME = 'updated_time';\n\n  public function getFieldTypes() {\n    return array(\n      'auto_resolve_settings' => 'Object',\n      'creation_time' => 'datetime',\n      'creator' => 'User',\n      'declared_winning_time' => 'datetime',\n      'description' => 'string',\n      'id' => 'string',\n      'insight_snapshots' => 'list<map<datetime, list<map<int, Object>>>>',\n      'name' => 'string',\n      'optimization_goal' => 'string',\n      'publish_status' => 'string',\n      'publish_time' => 'datetime',\n      'scheduled_experiment_timestamp' => 'datetime',\n      'updated_time' => 'datetime',\n    );\n  }\n}\n", "num_lines": 72}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PagePostFields extends AbstractEnum {\n\n  const ACTIONS = 'actions';\n  const ADMIN_CREATOR = 'admin_creator';\n  const ALLOWED_ADVERTISING_OBJECTIVES = 'allowed_advertising_objectives';\n  const APPLICATION = 'application';\n  const BACKDATED_TIME = 'backdated_time';\n  const CALL_TO_ACTION = 'call_to_action';\n  const CAN_REPLY_PRIVATELY = 'can_reply_privately';\n  const CHILD_ATTACHMENTS = 'child_attachments';\n  const COMMENTS_MIRRORING_DOMAIN = 'comments_mirroring_domain';\n  const COORDINATES = 'coordinates';\n  const CREATED_TIME = 'created_time';\n  const EVENT = 'event';\n  const EXPANDED_HEIGHT = 'expanded_height';\n  const EXPANDED_WIDTH = 'expanded_width';\n  const FEED_TARGETING = 'feed_targeting';\n  const FROM = 'from';\n  const FULL_PICTURE = 'full_picture';\n  const HEIGHT = 'height';\n  const ICON = 'icon';\n  const ID = 'id';\n  const INSTAGRAM_ELIGIBILITY = 'instagram_eligibility';\n  const IS_APP_SHARE = 'is_app_share';\n  const IS_ELIGIBLE_FOR_PROMOTION = 'is_eligible_for_promotion';\n  const IS_EXPIRED = 'is_expired';\n  const IS_HIDDEN = 'is_hidden';\n  const IS_INLINE_CREATED = 'is_inline_created';\n  const IS_INSTAGRAM_ELIGIBLE = 'is_instagram_eligible';\n  const IS_POPULAR = 'is_popular';\n  const IS_PUBLISHED = 'is_published';\n  const IS_SPHERICAL = 'is_spherical';\n  const MESSAGE = 'message';\n  const MESSAGE_TAGS = 'message_tags';\n  const MULTI_SHARE_END_CARD = 'multi_share_end_card';\n  const MULTI_SHARE_OPTIMIZED = 'multi_share_optimized';\n  const PARENT_ID = 'parent_id';\n  const PERMALINK_URL = 'permalink_url';\n  const PICTURE = 'picture';\n  const PLACE = 'place';\n  const PRIVACY = 'privacy';\n  const PROMOTABLE_ID = 'promotable_id';\n  const PROMOTION_STATUS = 'promotion_status';\n  const PROPERTIES = 'properties';\n  const SCHEDULED_PUBLISH_TIME = 'scheduled_publish_time';\n  const SHARES = 'shares';\n  const STATUS_TYPE = 'status_type';\n  const STORY = 'story';\n  const STORY_TAGS = 'story_tags';\n  const SUBSCRIBED = 'subscribed';\n  const TARGET = 'target';\n  const TARGETING = 'targeting';\n  const TIMELINE_VISIBILITY = 'timeline_visibility';\n  const UPDATED_TIME = 'updated_time';\n  const VIA = 'via';\n  const VIDEO_BUYING_ELIGIBILITY = 'video_buying_eligibility';\n  const WIDTH = 'width';\n\n  public function getFieldTypes() {\n    return array(\n      'actions' => 'list',\n      'admin_creator' => 'Object',\n      'allowed_advertising_objectives' => 'list<string>',\n      'application' => 'Application',\n      'backdated_time' => 'datetime',\n      'call_to_action' => 'Object',\n      'can_reply_privately' => 'bool',\n      'child_attachments' => 'list',\n      'comments_mirroring_domain' => 'string',\n      'coordinates' => 'Object',\n      'created_time' => 'datetime',\n      'event' => 'Event',\n      'expanded_height' => 'unsigned int',\n      'expanded_width' => 'unsigned int',\n      'feed_targeting' => 'Object',\n      'from' => 'Object',\n      'full_picture' => 'string',\n      'height' => 'unsigned int',\n      'icon' => 'string',\n      'id' => 'string',\n      'instagram_eligibility' => 'string',\n      'is_app_share' => 'bool',\n      'is_eligible_for_promotion' => 'bool',\n      'is_expired' => 'bool',\n      'is_hidden' => 'bool',\n      'is_inline_created' => 'bool',\n      'is_instagram_eligible' => 'bool',\n      'is_popular' => 'bool',\n      'is_published' => 'bool',\n      'is_spherical' => 'bool',\n      'message' => 'string',\n      'message_tags' => 'list',\n      'multi_share_end_card' => 'bool',\n      'multi_share_optimized' => 'bool',\n      'parent_id' => 'string',\n      'permalink_url' => 'Object',\n      'picture' => 'string',\n      'place' => 'Place',\n      'privacy' => 'Privacy',\n      'promotable_id' => 'string',\n      'promotion_status' => 'string',\n      'properties' => 'list',\n      'scheduled_publish_time' => 'float',\n      'shares' => 'Object',\n      'status_type' => 'string',\n      'story' => 'string',\n      'story_tags' => 'list',\n      'subscribed' => 'bool',\n      'target' => 'Profile',\n      'targeting' => 'Object',\n      'timeline_visibility' => 'string',\n      'updated_time' => 'datetime',\n      'via' => 'Object',\n      'video_buying_eligibility' => 'list<string>',\n      'width' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 156}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageRestaurantServicesFields extends AbstractEnum {\n\n  const CATERING = 'catering';\n  const DELIVERY = 'delivery';\n  const GROUPS = 'groups';\n  const KIDS = 'kids';\n  const OUTDOOR = 'outdoor';\n  const PICKUP = 'pickup';\n  const RESERVE = 'reserve';\n  const TAKEOUT = 'takeout';\n  const WAITER = 'waiter';\n  const WALKINS = 'walkins';\n\n  public function getFieldTypes() {\n    return array(\n      'catering' => 'bool',\n      'delivery' => 'bool',\n      'groups' => 'bool',\n      'kids' => 'bool',\n      'outdoor' => 'bool',\n      'pickup' => 'bool',\n      'reserve' => 'bool',\n      'takeout' => 'bool',\n      'waiter' => 'bool',\n      'walkins' => 'bool',\n    );\n  }\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageRestaurantSpecialtiesFields extends AbstractEnum {\n\n  const BREAKFAST = 'breakfast';\n  const COFFEE = 'coffee';\n  const DINNER = 'dinner';\n  const DRINKS = 'drinks';\n  const LUNCH = 'lunch';\n\n  public function getFieldTypes() {\n    return array(\n      'breakfast' => 'unsigned int',\n      'coffee' => 'unsigned int',\n      'dinner' => 'unsigned int',\n      'drinks' => 'unsigned int',\n      'lunch' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageSavedFilterFields extends AbstractEnum {\n\n  const DISPLAY_NAME = 'display_name';\n  const FILTERS = 'filters';\n  const ID = 'id';\n  const PAGE_ID = 'page_id';\n  const SECTION = 'section';\n  const TIME_CREATED = 'time_created';\n  const TIME_UPDATED = 'time_updated';\n\n  public function getFieldTypes() {\n    return array(\n      'display_name' => 'string',\n      'filters' => 'list<Object>',\n      'id' => 'string',\n      'page_id' => 'string',\n      'section' => 'string',\n      'time_created' => 'int',\n      'time_updated' => 'int',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageSettingsFields extends AbstractEnum {\n\n  const SETTING = 'setting';\n  const VALUE = 'value';\n\n  public function getFieldTypes() {\n    return array(\n      'setting' => 'string',\n      'value' => 'Object',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageStartInfoFields extends AbstractEnum {\n\n  const DATE = 'date';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'date' => 'Object',\n      'type' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageThreadOwnerFields extends AbstractEnum {\n\n  const THREAD_OWNER = 'thread_owner';\n\n  public function getFieldTypes() {\n    return array(\n      'thread_owner' => 'Object',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageUpcomingChangeFields extends AbstractEnum {\n\n  const CHANGE_TYPE = 'change_type';\n  const EFFECTIVE_TIME = 'effective_time';\n  const ID = 'id';\n  const PAGE = 'page';\n  const PROPOSAL = 'proposal';\n  const TIMER_STATUS = 'timer_status';\n\n  public function getFieldTypes() {\n    return array(\n      'change_type' => 'string',\n      'effective_time' => 'datetime',\n      'id' => 'string',\n      'page' => 'Page',\n      'proposal' => 'PageChangeProposal',\n      'timer_status' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PageUserMessageThreadLabelFields extends AbstractEnum {\n\n  const ID = 'id';\n  const PAGE_LABEL_NAME = 'page_label_name';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'page_label_name' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PartnerStudyFields extends AbstractEnum {\n\n  const ADDITIONAL_INFO = 'additional_info';\n  const BRAND = 'brand';\n  const CLIENT_NAME = 'client_name';\n  const EMAILS = 'emails';\n  const ID = 'id';\n  const INPUT_IDS = 'input_ids';\n  const IS_EXPORT = 'is_export';\n  const LIFT_STUDY = 'lift_study';\n  const LOCATION = 'location';\n  const MATCH_FILE_DS = 'match_file_ds';\n  const NAME = 'name';\n  const PARTNER_DEFINED_ID = 'partner_defined_id';\n  const PARTNER_HOUSEHOLD_GRAPH_DATASET_ID = 'partner_household_graph_dataset_id';\n  const STATUS = 'status';\n  const STUDY_END_DATE = 'study_end_date';\n  const STUDY_START_DATE = 'study_start_date';\n  const STUDY_TYPE = 'study_type';\n  const SUBMIT_DATE = 'submit_date';\n\n  public function getFieldTypes() {\n    return array(\n      'additional_info' => 'string',\n      'brand' => 'string',\n      'client_name' => 'string',\n      'emails' => 'string',\n      'id' => 'string',\n      'input_ids' => 'list<string>',\n      'is_export' => 'bool',\n      'lift_study' => 'AdStudy',\n      'location' => 'string',\n      'match_file_ds' => 'string',\n      'name' => 'string',\n      'partner_defined_id' => 'string',\n      'partner_household_graph_dataset_id' => 'string',\n      'status' => 'string',\n      'study_end_date' => 'datetime',\n      'study_start_date' => 'datetime',\n      'study_type' => 'string',\n      'submit_date' => 'datetime',\n    );\n  }\n}\n", "num_lines": 82}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PaymentEnginePaymentFields extends AbstractEnum {\n\n  const ACTIONS = 'actions';\n  const APPLICATION = 'application';\n  const COUNTRY = 'country';\n  const CREATED_TIME = 'created_time';\n  const DISPUTES = 'disputes';\n  const FRAUD_STATUS = 'fraud_status';\n  const FULFILLMENT_STATUS = 'fulfillment_status';\n  const ID = 'id';\n  const IS_FROM_AD = 'is_from_ad';\n  const IS_FROM_PAGE_POST = 'is_from_page_post';\n  const ITEMS = 'items';\n  const PAYOUT_FOREIGN_EXCHANGE_RATE = 'payout_foreign_exchange_rate';\n  const PHONE_SUPPORT_ELIGIBLE = 'phone_support_eligible';\n  const PLATFORM = 'platform';\n  const REFUNDABLE_AMOUNT = 'refundable_amount';\n  const REQUEST_ID = 'request_id';\n  const TAX = 'tax';\n  const TAX_COUNTRY = 'tax_country';\n  const TEST = 'test';\n  const USER = 'user';\n\n  public function getFieldTypes() {\n    return array(\n      'actions' => 'list<Object>',\n      'application' => 'Application',\n      'country' => 'string',\n      'created_time' => 'datetime',\n      'disputes' => 'list<Object>',\n      'fraud_status' => 'string',\n      'fulfillment_status' => 'string',\n      'id' => 'string',\n      'is_from_ad' => 'bool',\n      'is_from_page_post' => 'bool',\n      'items' => 'list<Object>',\n      'payout_foreign_exchange_rate' => 'float',\n      'phone_support_eligible' => 'bool',\n      'platform' => 'string',\n      'refundable_amount' => 'CurrencyAmount',\n      'request_id' => 'string',\n      'tax' => 'string',\n      'tax_country' => 'string',\n      'test' => 'unsigned int',\n      'user' => 'User',\n    );\n  }\n}\n", "num_lines": 86}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PaymentPricepointsFields extends AbstractEnum {\n\n  const MOBILE = 'mobile';\n\n  public function getFieldTypes() {\n    return array(\n      'mobile' => 'list<Object>',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PaymentSubscriptionFields extends AbstractEnum {\n\n  const AMOUNT = 'amount';\n  const APP_PARAM_DATA = 'app_param_data';\n  const APPLICATION = 'application';\n  const BILLING_PERIOD = 'billing_period';\n  const CANCELED_REASON = 'canceled_reason';\n  const CREATED_TIME = 'created_time';\n  const CURRENCY = 'currency';\n  const ID = 'id';\n  const LAST_PAYMENT = 'last_payment';\n  const NEXT_BILL_TIME = 'next_bill_time';\n  const NEXT_PERIOD_AMOUNT = 'next_period_amount';\n  const NEXT_PERIOD_CURRENCY = 'next_period_currency';\n  const NEXT_PERIOD_PRODUCT = 'next_period_product';\n  const PAYMENT_STATUS = 'payment_status';\n  const PENDING_CANCEL = 'pending_cancel';\n  const PERIOD_START_TIME = 'period_start_time';\n  const PRODUCT = 'product';\n  const STATUS = 'status';\n  const TEST = 'test';\n  const TRIAL_AMOUNT = 'trial_amount';\n  const TRIAL_CURRENCY = 'trial_currency';\n  const TRIAL_EXPIRY_TIME = 'trial_expiry_time';\n  const UPDATED_TIME = 'updated_time';\n  const USER = 'user';\n\n  public function getFieldTypes() {\n    return array(\n      'amount' => 'string',\n      'app_param_data' => 'string',\n      'application' => 'Application',\n      'billing_period' => 'string',\n      'canceled_reason' => 'string',\n      'created_time' => 'datetime',\n      'currency' => 'string',\n      'id' => 'string',\n      'last_payment' => 'PaymentEnginePayment',\n      'next_bill_time' => 'datetime',\n      'next_period_amount' => 'string',\n      'next_period_currency' => 'string',\n      'next_period_product' => 'string',\n      'payment_status' => 'string',\n      'pending_cancel' => 'bool',\n      'period_start_time' => 'datetime',\n      'product' => 'string',\n      'status' => 'string',\n      'test' => 'unsigned int',\n      'trial_amount' => 'string',\n      'trial_currency' => 'string',\n      'trial_expiry_time' => 'datetime',\n      'updated_time' => 'datetime',\n      'user' => 'User',\n    );\n  }\n}\n", "num_lines": 94}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PermissionFields extends AbstractEnum {\n\n  const PERMISSION = 'permission';\n  const STATUS = 'status';\n\n  public function getFieldTypes() {\n    return array(\n      'permission' => 'string',\n      'status' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PersonaFields extends AbstractEnum {\n\n  const ID = 'id';\n  const NAME = 'name';\n  const PROFILE_PICTURE_URL = 'profile_picture_url';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'name' => 'string',\n      'profile_picture_url' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PhotoFields extends AbstractEnum {\n\n  const ALBUM = 'album';\n  const ALT_TEXT = 'alt_text';\n  const ALT_TEXT_CUSTOM = 'alt_text_custom';\n  const BACKDATED_TIME = 'backdated_time';\n  const BACKDATED_TIME_GRANULARITY = 'backdated_time_granularity';\n  const CAN_BACKDATE = 'can_backdate';\n  const CAN_DELETE = 'can_delete';\n  const CAN_TAG = 'can_tag';\n  const CREATED_TIME = 'created_time';\n  const EVENT = 'event';\n  const FROM = 'from';\n  const HEIGHT = 'height';\n  const ICON = 'icon';\n  const ID = 'id';\n  const IMAGES = 'images';\n  const LINK = 'link';\n  const NAME = 'name';\n  const NAME_TAGS = 'name_tags';\n  const PAGE_STORY_ID = 'page_story_id';\n  const PICTURE = 'picture';\n  const PLACE = 'place';\n  const POSITION = 'position';\n  const SOURCE = 'source';\n  const TARGET = 'target';\n  const UPDATED_TIME = 'updated_time';\n  const WEBP_IMAGES = 'webp_images';\n  const WIDTH = 'width';\n\n  public function getFieldTypes() {\n    return array(\n      'album' => 'Album',\n      'alt_text' => 'string',\n      'alt_text_custom' => 'string',\n      'backdated_time' => 'datetime',\n      'backdated_time_granularity' => 'string',\n      'can_backdate' => 'bool',\n      'can_delete' => 'bool',\n      'can_tag' => 'bool',\n      'created_time' => 'datetime',\n      'event' => 'Event',\n      'from' => 'Object',\n      'height' => 'unsigned int',\n      'icon' => 'string',\n      'id' => 'string',\n      'images' => 'list<PlatformImageSource>',\n      'link' => 'string',\n      'name' => 'string',\n      'name_tags' => 'list<EntityAtTextRange>',\n      'page_story_id' => 'string',\n      'picture' => 'string',\n      'place' => 'Place',\n      'position' => 'unsigned int',\n      'source' => 'string',\n      'target' => 'Profile',\n      'updated_time' => 'datetime',\n      'webp_images' => 'list<PlatformImageSource>',\n      'width' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 100}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PlaceFields extends AbstractEnum {\n\n  const ID = 'id';\n  const LOCATION = 'location';\n  const NAME = 'name';\n  const OVERALL_RATING = 'overall_rating';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'location' => 'Location',\n      'name' => 'string',\n      'overall_rating' => 'float',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PlaceTopicFields extends AbstractEnum {\n\n  const COUNT = 'count';\n  const HAS_CHILDREN = 'has_children';\n  const ICON_URL = 'icon_url';\n  const ID = 'id';\n  const NAME = 'name';\n  const PARENT_IDS = 'parent_ids';\n  const PLURAL_NAME = 'plural_name';\n  const TOP_SUBTOPIC_NAMES = 'top_subtopic_names';\n\n  public function getFieldTypes() {\n    return array(\n      'count' => 'unsigned int',\n      'has_children' => 'bool',\n      'icon_url' => 'string',\n      'id' => 'string',\n      'name' => 'string',\n      'parent_ids' => 'list<string>',\n      'plural_name' => 'string',\n      'top_subtopic_names' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PlatformImageSourceFields extends AbstractEnum {\n\n  const HEIGHT = 'height';\n  const SOURCE = 'source';\n  const WIDTH = 'width';\n\n  public function getFieldTypes() {\n    return array(\n      'height' => 'unsigned int',\n      'source' => 'string',\n      'width' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PlayableContentFields extends AbstractEnum {\n\n  const ID = 'id';\n  const NAME = 'name';\n  const OWNER = 'owner';\n  const APP_ID = 'app_id';\n  const SESSION_ID = 'session_id';\n  const SOURCE = 'source';\n  const SOURCE_URL = 'source_url';\n  const SOURCE_ZIP = 'source_zip';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'name' => 'string',\n      'owner' => 'Profile',\n      'app_id' => 'string',\n      'session_id' => 'string',\n      'source' => 'file',\n      'source_url' => 'string',\n      'source_zip' => 'file',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PostFields extends AbstractEnum {\n\n  const ACTIONS = 'actions';\n  const ADMIN_CREATOR = 'admin_creator';\n  const ALLOWED_ADVERTISING_OBJECTIVES = 'allowed_advertising_objectives';\n  const APPLICATION = 'application';\n  const BACKDATED_TIME = 'backdated_time';\n  const CALL_TO_ACTION = 'call_to_action';\n  const CAN_REPLY_PRIVATELY = 'can_reply_privately';\n  const CAPTION = 'caption';\n  const CHILD_ATTACHMENTS = 'child_attachments';\n  const COMMENTS_MIRRORING_DOMAIN = 'comments_mirroring_domain';\n  const COORDINATES = 'coordinates';\n  const CREATED_TIME = 'created_time';\n  const DESCRIPTION = 'description';\n  const EVENT = 'event';\n  const EXPANDED_HEIGHT = 'expanded_height';\n  const EXPANDED_WIDTH = 'expanded_width';\n  const FEED_TARGETING = 'feed_targeting';\n  const FROM = 'from';\n  const FULL_PICTURE = 'full_picture';\n  const HEIGHT = 'height';\n  const ICON = 'icon';\n  const ID = 'id';\n  const INSTAGRAM_ELIGIBILITY = 'instagram_eligibility';\n  const IS_APP_SHARE = 'is_app_share';\n  const IS_ELIGIBLE_FOR_PROMOTION = 'is_eligible_for_promotion';\n  const IS_EXPIRED = 'is_expired';\n  const IS_HIDDEN = 'is_hidden';\n  const IS_INLINE_CREATED = 'is_inline_created';\n  const IS_INSTAGRAM_ELIGIBLE = 'is_instagram_eligible';\n  const IS_POPULAR = 'is_popular';\n  const IS_PUBLISHED = 'is_published';\n  const IS_SPHERICAL = 'is_spherical';\n  const LINK = 'link';\n  const MESSAGE = 'message';\n  const MESSAGE_TAGS = 'message_tags';\n  const MULTI_SHARE_END_CARD = 'multi_share_end_card';\n  const MULTI_SHARE_OPTIMIZED = 'multi_share_optimized';\n  const NAME = 'name';\n  const OBJECT_ID = 'object_id';\n  const PARENT_ID = 'parent_id';\n  const PERMALINK_URL = 'permalink_url';\n  const PICTURE = 'picture';\n  const PLACE = 'place';\n  const PRIVACY = 'privacy';\n  const PROMOTABLE_ID = 'promotable_id';\n  const PROMOTION_STATUS = 'promotion_status';\n  const PROPERTIES = 'properties';\n  const SCHEDULED_PUBLISH_TIME = 'scheduled_publish_time';\n  const SHARES = 'shares';\n  const SOURCE = 'source';\n  const STATUS_TYPE = 'status_type';\n  const STORY = 'story';\n  const STORY_TAGS = 'story_tags';\n  const SUBSCRIBED = 'subscribed';\n  const TARGET = 'target';\n  const TARGETING = 'targeting';\n  const TIMELINE_VISIBILITY = 'timeline_visibility';\n  const TYPE = 'type';\n  const UPDATED_TIME = 'updated_time';\n  const VIA = 'via';\n  const VIDEO_BUYING_ELIGIBILITY = 'video_buying_eligibility';\n  const WIDTH = 'width';\n\n  public function getFieldTypes() {\n    return array(\n      'actions' => 'list',\n      'admin_creator' => 'Object',\n      'allowed_advertising_objectives' => 'list<string>',\n      'application' => 'Application',\n      'backdated_time' => 'datetime',\n      'call_to_action' => 'Object',\n      'can_reply_privately' => 'bool',\n      'caption' => 'string',\n      'child_attachments' => 'list',\n      'comments_mirroring_domain' => 'string',\n      'coordinates' => 'Object',\n      'created_time' => 'datetime',\n      'description' => 'string',\n      'event' => 'Event',\n      'expanded_height' => 'unsigned int',\n      'expanded_width' => 'unsigned int',\n      'feed_targeting' => 'Object',\n      'from' => 'Object',\n      'full_picture' => 'string',\n      'height' => 'unsigned int',\n      'icon' => 'string',\n      'id' => 'string',\n      'instagram_eligibility' => 'string',\n      'is_app_share' => 'bool',\n      'is_eligible_for_promotion' => 'bool',\n      'is_expired' => 'bool',\n      'is_hidden' => 'bool',\n      'is_inline_created' => 'bool',\n      'is_instagram_eligible' => 'bool',\n      'is_popular' => 'bool',\n      'is_published' => 'bool',\n      'is_spherical' => 'bool',\n      'link' => 'Object',\n      'message' => 'string',\n      'message_tags' => 'list',\n      'multi_share_end_card' => 'bool',\n      'multi_share_optimized' => 'bool',\n      'name' => 'string',\n      'object_id' => 'string',\n      'parent_id' => 'string',\n      'permalink_url' => 'Object',\n      'picture' => 'string',\n      'place' => 'Place',\n      'privacy' => 'Privacy',\n      'promotable_id' => 'string',\n      'promotion_status' => 'string',\n      'properties' => 'list',\n      'scheduled_publish_time' => 'float',\n      'shares' => 'Object',\n      'source' => 'string',\n      'status_type' => 'string',\n      'story' => 'string',\n      'story_tags' => 'list',\n      'subscribed' => 'bool',\n      'target' => 'Profile',\n      'targeting' => 'Object',\n      'timeline_visibility' => 'string',\n      'type' => 'string',\n      'updated_time' => 'datetime',\n      'via' => 'Object',\n      'video_buying_eligibility' => 'list<string>',\n      'width' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 170}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PrivacyFields extends AbstractEnum {\n\n  const ALLOW = 'allow';\n  const DENY = 'deny';\n  const DESCRIPTION = 'description';\n  const FRIENDS = 'friends';\n  const NETWORKS = 'networks';\n  const VALUE = 'value';\n\n  public function getFieldTypes() {\n    return array(\n      'allow' => 'string',\n      'deny' => 'string',\n      'description' => 'string',\n      'friends' => 'string',\n      'networks' => 'string',\n      'value' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PrivateLiftStudyInstanceFields extends AbstractEnum {\n\n  const BREAKDOWN_KEY = 'breakdown_key';\n  const CREATED_TIME = 'created_time';\n  const FEATURE_LIST = 'feature_list';\n  const ID = 'id';\n  const ISSUER_CERTIFICATE = 'issuer_certificate';\n  const LATEST_STATUS_UPDATE_TIME = 'latest_status_update_time';\n  const RUN_ID = 'run_id';\n  const SERVER_HOSTNAMES = 'server_hostnames';\n  const SERVER_IPS = 'server_ips';\n  const STATUS = 'status';\n  const TIER = 'tier';\n\n  public function getFieldTypes() {\n    return array(\n      'breakdown_key' => 'string',\n      'created_time' => 'datetime',\n      'feature_list' => 'list<string>',\n      'id' => 'string',\n      'issuer_certificate' => 'string',\n      'latest_status_update_time' => 'datetime',\n      'run_id' => 'string',\n      'server_hostnames' => 'list<string>',\n      'server_ips' => 'list<string>',\n      'status' => 'string',\n      'tier' => 'string',\n    );\n  }\n}\n", "num_lines": 68}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static ProductAudienceFields getInstance()\n */\nclass ProductAudienceFields extends AbstractEnum {\n\n  const ID = 'id';\n  const NAME = 'name';\n  const DESCRIPTION = 'description';\n  const PRODUCT_SET_ID = 'product_set_id';\n  const PIXEL_ID = 'pixel_id';\n  const INCLUSIONS = 'inclusions';\n  const EXCLUSIONS = 'exclusions';\n}\n", "num_lines": 42}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogCategoryFields extends AbstractEnum {\n\n  const CRITERIA_VALUE = 'criteria_value';\n  const DESCRIPTION = 'description';\n  const DESTINATION_URI = 'destination_uri';\n  const IMAGE_URL = 'image_url';\n  const NAME = 'name';\n  const NUM_ITEMS = 'num_items';\n  const TOKENS = 'tokens';\n  const DATA = 'data';\n\n  public function getFieldTypes() {\n    return array(\n      'criteria_value' => 'string',\n      'description' => 'string',\n      'destination_uri' => 'string',\n      'image_url' => 'string',\n      'name' => 'string',\n      'num_items' => 'int',\n      'tokens' => 'list<map<string, string>>',\n      'data' => 'list<map>',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogDataSourceFields extends AbstractEnum {\n\n  const APP_ID = 'app_id';\n  const ID = 'id';\n  const INGESTION_SOURCE_TYPE = 'ingestion_source_type';\n  const NAME = 'name';\n  const UPLOAD_TYPE = 'upload_type';\n\n  public function getFieldTypes() {\n    return array(\n      'app_id' => 'string',\n      'id' => 'string',\n      'ingestion_source_type' => 'string',\n      'name' => 'string',\n      'upload_type' => 'string',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogDiagnosticGroupFields extends AbstractEnum {\n\n  const AFFECTED_CHANNELS = 'affected_channels';\n  const AFFECTED_ENTITY = 'affected_entity';\n  const AFFECTED_FEATURES = 'affected_features';\n  const DIAGNOSTICS = 'diagnostics';\n  const ERROR_CODE = 'error_code';\n  const NUMBER_OF_AFFECTED_ENTITIES = 'number_of_affected_entities';\n  const NUMBER_OF_AFFECTED_ITEMS = 'number_of_affected_items';\n  const SEVERITY = 'severity';\n  const SUBTITLE = 'subtitle';\n  const TITLE = 'title';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'affected_channels' => 'list<AffectedChannels>',\n      'affected_entity' => 'AffectedEntity',\n      'affected_features' => 'list<AffectedFeatures>',\n      'diagnostics' => 'list<Object>',\n      'error_code' => 'int',\n      'number_of_affected_entities' => 'int',\n      'number_of_affected_items' => 'int',\n      'severity' => 'Severity',\n      'subtitle' => 'string',\n      'title' => 'string',\n      'type' => 'Type',\n    );\n  }\n}\n", "num_lines": 68}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogFields extends AbstractEnum {\n\n  const AD_ACCOUNT_TO_COLLABORATIVE_ADS_SHARE_SETTINGS = 'ad_account_to_collaborative_ads_share_settings';\n  const AGENCY_COLLABORATIVE_ADS_SHARE_SETTINGS = 'agency_collaborative_ads_share_settings';\n  const BUSINESS = 'business';\n  const CATALOG_STORE = 'catalog_store';\n  const COMMERCE_MERCHANT_SETTINGS = 'commerce_merchant_settings';\n  const CREATOR_USER = 'creator_user';\n  const DA_DISPLAY_SETTINGS = 'da_display_settings';\n  const DEFAULT_IMAGE_URL = 'default_image_url';\n  const FALLBACK_IMAGE_URL = 'fallback_image_url';\n  const FEED_COUNT = 'feed_count';\n  const ID = 'id';\n  const IS_CATALOG_SEGMENT = 'is_catalog_segment';\n  const NAME = 'name';\n  const OWNER_BUSINESS = 'owner_business';\n  const PRODUCT_COUNT = 'product_count';\n  const STORE_CATALOG_SETTINGS = 'store_catalog_settings';\n  const VERTICAL = 'vertical';\n  const CATALOG_SEGMENT_FILTER = 'catalog_segment_filter';\n  const CATALOG_SEGMENT_PRODUCT_SET_ID = 'catalog_segment_product_set_id';\n  const DESTINATION_CATALOG_SETTINGS = 'destination_catalog_settings';\n  const FLIGHT_CATALOG_SETTINGS = 'flight_catalog_settings';\n  const PARENT_CATALOG_ID = 'parent_catalog_id';\n  const PARTNER_INTEGRATION = 'partner_integration';\n\n  public function getFieldTypes() {\n    return array(\n      'ad_account_to_collaborative_ads_share_settings' => 'CollaborativeAdsShareSettings',\n      'agency_collaborative_ads_share_settings' => 'CollaborativeAdsShareSettings',\n      'business' => 'Business',\n      'catalog_store' => 'StoreCatalogSettings',\n      'commerce_merchant_settings' => 'CommerceMerchantSettings',\n      'creator_user' => 'User',\n      'da_display_settings' => 'ProductCatalogImageSettings',\n      'default_image_url' => 'string',\n      'fallback_image_url' => 'list<string>',\n      'feed_count' => 'int',\n      'id' => 'string',\n      'is_catalog_segment' => 'bool',\n      'name' => 'string',\n      'owner_business' => 'Business',\n      'product_count' => 'int',\n      'store_catalog_settings' => 'StoreCatalogSettings',\n      'vertical' => 'string',\n      'catalog_segment_filter' => 'Object',\n      'catalog_segment_product_set_id' => 'string',\n      'destination_catalog_settings' => 'map',\n      'flight_catalog_settings' => 'map',\n      'parent_catalog_id' => 'string',\n      'partner_integration' => 'map',\n    );\n  }\n}\n", "num_lines": 92}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogHotelRoomsBatchFields extends AbstractEnum {\n\n  const ERRORS = 'errors';\n  const ERRORS_TOTAL_COUNT = 'errors_total_count';\n  const HANDLE = 'handle';\n  const STATUS = 'status';\n\n  public function getFieldTypes() {\n    return array(\n      'errors' => 'list<Object>',\n      'errors_total_count' => 'int',\n      'handle' => 'string',\n      'status' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogImageSettingsFields extends AbstractEnum {\n\n  const CAROUSEL_AD = 'carousel_ad';\n  const SINGLE_AD = 'single_ad';\n\n  public function getFieldTypes() {\n    return array(\n      'carousel_ad' => 'ProductCatalogImageSettingsOperation',\n      'single_ad' => 'ProductCatalogImageSettingsOperation',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogImageSettingsOperationFields extends AbstractEnum {\n\n  const TRANSFORMATION_TYPE = 'transformation_type';\n\n  public function getFieldTypes() {\n    return array(\n      'transformation_type' => 'string',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogPricingVariablesBatchFields extends AbstractEnum {\n\n  const ERRORS = 'errors';\n  const ERRORS_TOTAL_COUNT = 'errors_total_count';\n  const HANDLE = 'handle';\n  const STATUS = 'status';\n\n  public function getFieldTypes() {\n    return array(\n      'errors' => 'list<Object>',\n      'errors_total_count' => 'int',\n      'handle' => 'string',\n      'status' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductCatalogProductSetsBatchFields extends AbstractEnum {\n\n  const ERRORS = 'errors';\n  const ERRORS_TOTAL_COUNT = 'errors_total_count';\n  const HANDLE = 'handle';\n  const STATUS = 'status';\n\n  public function getFieldTypes() {\n    return array(\n      'errors' => 'list<Object>',\n      'errors_total_count' => 'int',\n      'handle' => 'string',\n      'status' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductEventStatFields extends AbstractEnum {\n\n  const DATE_START = 'date_start';\n  const DATE_STOP = 'date_stop';\n  const DEVICE_TYPE = 'device_type';\n  const EVENT = 'event';\n  const EVENT_SOURCE = 'event_source';\n  const TOTAL_CONTENT_IDS_MATCHED_OTHER_CATALOGS = 'total_content_ids_matched_other_catalogs';\n  const TOTAL_MATCHED_CONTENT_IDS = 'total_matched_content_ids';\n  const TOTAL_UNMATCHED_CONTENT_IDS = 'total_unmatched_content_ids';\n  const UNIQUE_CONTENT_IDS_MATCHED_OTHER_CATALOGS = 'unique_content_ids_matched_other_catalogs';\n  const UNIQUE_MATCHED_CONTENT_IDS = 'unique_matched_content_ids';\n  const UNIQUE_UNMATCHED_CONTENT_IDS = 'unique_unmatched_content_ids';\n\n  public function getFieldTypes() {\n    return array(\n      'date_start' => 'string',\n      'date_stop' => 'string',\n      'device_type' => 'DeviceType',\n      'event' => 'Event',\n      'event_source' => 'ExternalEventSource',\n      'total_content_ids_matched_other_catalogs' => 'int',\n      'total_matched_content_ids' => 'int',\n      'total_unmatched_content_ids' => 'int',\n      'unique_content_ids_matched_other_catalogs' => 'int',\n      'unique_matched_content_ids' => 'int',\n      'unique_unmatched_content_ids' => 'int',\n    );\n  }\n}\n", "num_lines": 68}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedFields extends AbstractEnum {\n\n  const COUNTRY = 'country';\n  const CREATED_TIME = 'created_time';\n  const DEFAULT_CURRENCY = 'default_currency';\n  const DELETION_ENABLED = 'deletion_enabled';\n  const DELIMITER = 'delimiter';\n  const ENCODING = 'encoding';\n  const FILE_NAME = 'file_name';\n  const ID = 'id';\n  const INGESTION_SOURCE_TYPE = 'ingestion_source_type';\n  const ITEM_SUB_TYPE = 'item_sub_type';\n  const LATEST_UPLOAD = 'latest_upload';\n  const MIGRATED_FROM_FEED_ID = 'migrated_from_feed_id';\n  const NAME = 'name';\n  const OVERRIDE_TYPE = 'override_type';\n  const PRIMARY_FEEDS = 'primary_feeds';\n  const PRODUCT_COUNT = 'product_count';\n  const QUOTED_FIELDS_MODE = 'quoted_fields_mode';\n  const SCHEDULE = 'schedule';\n  const SUPPLEMENTARY_FEEDS = 'supplementary_feeds';\n  const UPDATE_SCHEDULE = 'update_schedule';\n  const FEED_TYPE = 'feed_type';\n  const OVERRIDE_VALUE = 'override_value';\n  const PRIMARY_FEED_IDS = 'primary_feed_ids';\n  const RULES = 'rules';\n  const SELECTED_OVERRIDE_FIELDS = 'selected_override_fields';\n\n  public function getFieldTypes() {\n    return array(\n      'country' => 'string',\n      'created_time' => 'datetime',\n      'default_currency' => 'string',\n      'deletion_enabled' => 'bool',\n      'delimiter' => 'Delimiter',\n      'encoding' => 'string',\n      'file_name' => 'string',\n      'id' => 'string',\n      'ingestion_source_type' => 'IngestionSourceType',\n      'item_sub_type' => 'string',\n      'latest_upload' => 'ProductFeedUpload',\n      'migrated_from_feed_id' => 'string',\n      'name' => 'string',\n      'override_type' => 'string',\n      'primary_feeds' => 'list<string>',\n      'product_count' => 'int',\n      'quoted_fields_mode' => 'QuotedFieldsMode',\n      'schedule' => 'ProductFeedSchedule',\n      'supplementary_feeds' => 'list<string>',\n      'update_schedule' => 'ProductFeedSchedule',\n      'feed_type' => 'FeedType',\n      'override_value' => 'string',\n      'primary_feed_ids' => 'list<string>',\n      'rules' => 'list<string>',\n      'selected_override_fields' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 96}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedMissingFeedItemReplacementFields extends AbstractEnum {\n\n  const HOME_LISTING = 'home_listing';\n  const PRODUCT_ITEM = 'product_item';\n  const VEHICLE = 'vehicle';\n\n  public function getFieldTypes() {\n    return array(\n      'home_listing' => 'Object',\n      'product_item' => 'Object',\n      'vehicle' => 'Object',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedRuleFields extends AbstractEnum {\n\n  const ATTRIBUTE = 'attribute';\n  const ID = 'id';\n  const PARAMS = 'params';\n  const RULE_TYPE = 'rule_type';\n\n  public function getFieldTypes() {\n    return array(\n      'attribute' => 'string',\n      'id' => 'string',\n      'params' => 'list<map<string, string>>',\n      'rule_type' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedRuleSuggestionFields extends AbstractEnum {\n\n  const ATTRIBUTE = 'attribute';\n  const PARAMS = 'params';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'attribute' => 'string',\n      'params' => 'list<map<string, string>>',\n      'type' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedScheduleFields extends AbstractEnum {\n\n  const DAY_OF_MONTH = 'day_of_month';\n  const DAY_OF_WEEK = 'day_of_week';\n  const HOUR = 'hour';\n  const ID = 'id';\n  const INTERVAL = 'interval';\n  const INTERVAL_COUNT = 'interval_count';\n  const MINUTE = 'minute';\n  const TIMEZONE = 'timezone';\n  const URL = 'url';\n  const USERNAME = 'username';\n\n  public function getFieldTypes() {\n    return array(\n      'day_of_month' => 'unsigned int',\n      'day_of_week' => 'string',\n      'hour' => 'unsigned int',\n      'id' => 'string',\n      'interval' => 'Interval',\n      'interval_count' => 'unsigned int',\n      'minute' => 'unsigned int',\n      'timezone' => 'string',\n      'url' => 'string',\n      'username' => 'string',\n    );\n  }\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedUploadErrorFields extends AbstractEnum {\n\n  const AFFECTED_SURFACES = 'affected_surfaces';\n  const DESCRIPTION = 'description';\n  const ERROR_TYPE = 'error_type';\n  const ID = 'id';\n  const SEVERITY = 'severity';\n  const SUMMARY = 'summary';\n  const TOTAL_COUNT = 'total_count';\n\n  public function getFieldTypes() {\n    return array(\n      'affected_surfaces' => 'list<AffectedSurfaces>',\n      'description' => 'string',\n      'error_type' => 'string',\n      'id' => 'string',\n      'severity' => 'Severity',\n      'summary' => 'string',\n      'total_count' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedUploadErrorReportFields extends AbstractEnum {\n\n  const FILE_HANDLE = 'file_handle';\n  const REPORT_STATUS = 'report_status';\n\n  public function getFieldTypes() {\n    return array(\n      'file_handle' => 'string',\n      'report_status' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedUploadErrorSampleFields extends AbstractEnum {\n\n  const ID = 'id';\n  const RETAILER_ID = 'retailer_id';\n  const ROW_NUMBER = 'row_number';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'retailer_id' => 'string',\n      'row_number' => 'int',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductFeedUploadFields extends AbstractEnum {\n\n  const END_TIME = 'end_time';\n  const ERROR_COUNT = 'error_count';\n  const ERROR_REPORT = 'error_report';\n  const FILENAME = 'filename';\n  const ID = 'id';\n  const INPUT_METHOD = 'input_method';\n  const NUM_DELETED_ITEMS = 'num_deleted_items';\n  const NUM_DETECTED_ITEMS = 'num_detected_items';\n  const NUM_INVALID_ITEMS = 'num_invalid_items';\n  const NUM_PERSISTED_ITEMS = 'num_persisted_items';\n  const START_TIME = 'start_time';\n  const URL = 'url';\n  const WARNING_COUNT = 'warning_count';\n\n  public function getFieldTypes() {\n    return array(\n      'end_time' => 'datetime',\n      'error_count' => 'int',\n      'error_report' => 'ProductFeedUploadErrorReport',\n      'filename' => 'string',\n      'id' => 'string',\n      'input_method' => 'InputMethod',\n      'num_deleted_items' => 'int',\n      'num_detected_items' => 'int',\n      'num_invalid_items' => 'int',\n      'num_persisted_items' => 'int',\n      'start_time' => 'datetime',\n      'url' => 'string',\n      'warning_count' => 'int',\n    );\n  }\n}\n", "num_lines": 72}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductGroupFields extends AbstractEnum {\n\n  const ID = 'id';\n  const PRODUCT_CATALOG = 'product_catalog';\n  const RETAILER_ID = 'retailer_id';\n  const VARIANTS = 'variants';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'product_catalog' => 'ProductCatalog',\n      'retailer_id' => 'string',\n      'variants' => 'list<ProductVariant>',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductImageFields extends AbstractEnum {\n\n  const ID = 'id';\n  const IMAGE_URL = 'image_url';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'image_url' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductItemARDataFields extends AbstractEnum {\n\n  const CONTAINER_EFFECT = 'container_effect';\n  const EFFECT_ICON = 'effect_icon';\n  const EFFECT_PARAMETERS = 'effect_parameters';\n  const PICKER_ICON = 'picker_icon';\n  const PRODUCT_AR_LINK = 'product_ar_link';\n  const STATE = 'state';\n  const SURFACES = 'surfaces';\n\n  public function getFieldTypes() {\n    return array(\n      'container_effect' => 'string',\n      'effect_icon' => 'string',\n      'effect_parameters' => 'Object',\n      'picker_icon' => 'string',\n      'product_ar_link' => 'Object',\n      'state' => 'string',\n      'surfaces' => 'list<Surfaces>',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductItemCommerceInsightsFields extends AbstractEnum {\n\n  const MESSAGE_SENDS = 'message_sends';\n  const ORGANIC_IMPRESSIONS = 'organic_impressions';\n  const PAID_IMPRESSIONS = 'paid_impressions';\n\n  public function getFieldTypes() {\n    return array(\n      'message_sends' => 'unsigned int',\n      'organic_impressions' => 'unsigned int',\n      'paid_impressions' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductItemErrorFields extends AbstractEnum {\n\n  const DESCRIPTION = 'description';\n  const ERROR_PRIORITY = 'error_priority';\n  const ERROR_TYPE = 'error_type';\n  const TITLE = 'title';\n\n  public function getFieldTypes() {\n    return array(\n      'description' => 'string',\n      'error_priority' => 'string',\n      'error_type' => 'string',\n      'title' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductItemFields extends AbstractEnum {\n\n  const ADDITIONAL_IMAGE_CDN_URLS = 'additional_image_cdn_urls';\n  const ADDITIONAL_IMAGE_URLS = 'additional_image_urls';\n  const ADDITIONAL_VARIANT_ATTRIBUTES = 'additional_variant_attributes';\n  const AGE_GROUP = 'age_group';\n  const APPLINKS = 'applinks';\n  const AR_DATA = 'ar_data';\n  const AVAILABILITY = 'availability';\n  const BRAND = 'brand';\n  const CAPABILITY_TO_REVIEW_STATUS = 'capability_to_review_status';\n  const CATEGORY = 'category';\n  const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';\n  const COLOR = 'color';\n  const COMMERCE_INSIGHTS = 'commerce_insights';\n  const CONDITION = 'condition';\n  const CURRENCY = 'currency';\n  const CUSTOM_DATA = 'custom_data';\n  const CUSTOM_LABEL_0 = 'custom_label_0';\n  const CUSTOM_LABEL_1 = 'custom_label_1';\n  const CUSTOM_LABEL_2 = 'custom_label_2';\n  const CUSTOM_LABEL_3 = 'custom_label_3';\n  const CUSTOM_LABEL_4 = 'custom_label_4';\n  const CUSTOM_NUMBER_0 = 'custom_number_0';\n  const CUSTOM_NUMBER_1 = 'custom_number_1';\n  const CUSTOM_NUMBER_2 = 'custom_number_2';\n  const CUSTOM_NUMBER_3 = 'custom_number_3';\n  const CUSTOM_NUMBER_4 = 'custom_number_4';\n  const DESCRIPTION = 'description';\n  const ERRORS = 'errors';\n  const EXPIRATION_DATE = 'expiration_date';\n  const FB_PRODUCT_CATEGORY = 'fb_product_category';\n  const GENDER = 'gender';\n  const GTIN = 'gtin';\n  const ID = 'id';\n  const IMAGE_CDN_URLS = 'image_cdn_urls';\n  const IMAGE_FETCH_STATUS = 'image_fetch_status';\n  const IMAGE_URL = 'image_url';\n  const IMAGES = 'images';\n  const IMPORTER_ADDRESS = 'importer_address';\n  const IMPORTER_NAME = 'importer_name';\n  const INVALIDATION_ERRORS = 'invalidation_errors';\n  const INVENTORY = 'inventory';\n  const MANUFACTURER_INFO = 'manufacturer_info';\n  const MANUFACTURER_PART_NUMBER = 'manufacturer_part_number';\n  const MARKED_FOR_PRODUCT_LAUNCH = 'marked_for_product_launch';\n  const MATERIAL = 'material';\n  const MOBILE_LINK = 'mobile_link';\n  const NAME = 'name';\n  const ORDERING_INDEX = 'ordering_index';\n  const ORIGIN_COUNTRY = 'origin_country';\n  const PARENT_PRODUCT_ID = 'parent_product_id';\n  const PATTERN = 'pattern';\n  const POST_CONVERSION_SIGNAL_BASED_ENFORCEMENT_APPEAL_ELIGIBILITY = 'post_conversion_signal_based_enforcement_appeal_eligibility';\n  const PRICE = 'price';\n  const PRODUCT_CATALOG = 'product_catalog';\n  const PRODUCT_FEED = 'product_feed';\n  const PRODUCT_GROUP = 'product_group';\n  const PRODUCT_TYPE = 'product_type';\n  const QUANTITY_TO_SELL_ON_FACEBOOK = 'quantity_to_sell_on_facebook';\n  const RETAILER_ID = 'retailer_id';\n  const RETAILER_PRODUCT_GROUP_ID = 'retailer_product_group_id';\n  const REVIEW_REJECTION_REASONS = 'review_rejection_reasons';\n  const REVIEW_STATUS = 'review_status';\n  const SALE_PRICE = 'sale_price';\n  const SALE_PRICE_END_DATE = 'sale_price_end_date';\n  const SALE_PRICE_START_DATE = 'sale_price_start_date';\n  const SHIPPING_WEIGHT_UNIT = 'shipping_weight_unit';\n  const SHIPPING_WEIGHT_VALUE = 'shipping_weight_value';\n  const SHORT_DESCRIPTION = 'short_description';\n  const SIZE = 'size';\n  const START_DATE = 'start_date';\n  const URL = 'url';\n  const VISIBILITY = 'visibility';\n  const WA_COMPLIANCE_CATEGORY = 'wa_compliance_category';\n  const ADDITIONAL_UPLOADED_IMAGE_IDS = 'additional_uploaded_image_ids';\n  const ANDROID_APP_NAME = 'android_app_name';\n  const ANDROID_CLASS = 'android_class';\n  const ANDROID_PACKAGE = 'android_package';\n  const ANDROID_URL = 'android_url';\n  const CHECKOUT_URL = 'checkout_url';\n  const COMMERCE_TAX_CATEGORY = 'commerce_tax_category';\n  const IOS_APP_NAME = 'ios_app_name';\n  const IOS_APP_STORE_ID = 'ios_app_store_id';\n  const IOS_URL = 'ios_url';\n  const IPAD_APP_NAME = 'ipad_app_name';\n  const IPAD_APP_STORE_ID = 'ipad_app_store_id';\n  const IPAD_URL = 'ipad_url';\n  const IPHONE_APP_NAME = 'iphone_app_name';\n  const IPHONE_APP_STORE_ID = 'iphone_app_store_id';\n  const IPHONE_URL = 'iphone_url';\n  const LAUNCH_DATE = 'launch_date';\n  const OFFER_PRICE_AMOUNT = 'offer_price_amount';\n  const OFFER_PRICE_END_DATE = 'offer_price_end_date';\n  const OFFER_PRICE_START_DATE = 'offer_price_start_date';\n  const RETURN_POLICY_DAYS = 'return_policy_days';\n  const WINDOWS_PHONE_APP_ID = 'windows_phone_app_id';\n  const WINDOWS_PHONE_APP_NAME = 'windows_phone_app_name';\n  const WINDOWS_PHONE_URL = 'windows_phone_url';\n\n  public function getFieldTypes() {\n    return array(\n      'additional_image_cdn_urls' => 'list<list<map<string, string>>>',\n      'additional_image_urls' => 'list<string>',\n      'additional_variant_attributes' => 'list<map<string, string>>',\n      'age_group' => 'AgeGroup',\n      'applinks' => 'CatalogItemAppLinks',\n      'ar_data' => 'ProductItemARData',\n      'availability' => 'Availability',\n      'brand' => 'string',\n      'capability_to_review_status' => 'list<map<Object, Object>>',\n      'category' => 'string',\n      'category_specific_fields' => 'CatalogSubVerticalList',\n      'color' => 'string',\n      'commerce_insights' => 'ProductItemCommerceInsights',\n      'condition' => 'Condition',\n      'currency' => 'string',\n      'custom_data' => 'list<map<string, string>>',\n      'custom_label_0' => 'string',\n      'custom_label_1' => 'string',\n      'custom_label_2' => 'string',\n      'custom_label_3' => 'string',\n      'custom_label_4' => 'string',\n      'custom_number_0' => 'string',\n      'custom_number_1' => 'string',\n      'custom_number_2' => 'string',\n      'custom_number_3' => 'string',\n      'custom_number_4' => 'string',\n      'description' => 'string',\n      'errors' => 'list<ProductItemError>',\n      'expiration_date' => 'string',\n      'fb_product_category' => 'string',\n      'gender' => 'Gender',\n      'gtin' => 'string',\n      'id' => 'string',\n      'image_cdn_urls' => 'list<map<string, string>>',\n      'image_fetch_status' => 'ImageFetchStatus',\n      'image_url' => 'string',\n      'images' => 'list<string>',\n      'importer_address' => 'ProductItemImporterAddress',\n      'importer_name' => 'string',\n      'invalidation_errors' => 'list<Object>',\n      'inventory' => 'int',\n      'manufacturer_info' => 'string',\n      'manufacturer_part_number' => 'string',\n      'marked_for_product_launch' => 'string',\n      'material' => 'string',\n      'mobile_link' => 'string',\n      'name' => 'string',\n      'ordering_index' => 'int',\n      'origin_country' => 'string',\n      'parent_product_id' => 'string',\n      'pattern' => 'string',\n      'post_conversion_signal_based_enforcement_appeal_eligibility' => 'bool',\n      'price' => 'string',\n      'product_catalog' => 'ProductCatalog',\n      'product_feed' => 'ProductFeed',\n      'product_group' => 'ProductGroup',\n      'product_type' => 'string',\n      'quantity_to_sell_on_facebook' => 'int',\n      'retailer_id' => 'string',\n      'retailer_product_group_id' => 'string',\n      'review_rejection_reasons' => 'list<string>',\n      'review_status' => 'ReviewStatus',\n      'sale_price' => 'string',\n      'sale_price_end_date' => 'string',\n      'sale_price_start_date' => 'string',\n      'shipping_weight_unit' => 'ShippingWeightUnit',\n      'shipping_weight_value' => 'float',\n      'short_description' => 'string',\n      'size' => 'string',\n      'start_date' => 'string',\n      'url' => 'string',\n      'visibility' => 'Visibility',\n      'wa_compliance_category' => 'string',\n      'additional_uploaded_image_ids' => 'list<string>',\n      'android_app_name' => 'string',\n      'android_class' => 'string',\n      'android_package' => 'string',\n      'android_url' => 'string',\n      'checkout_url' => 'string',\n      'commerce_tax_category' => 'CommerceTaxCategory',\n      'ios_app_name' => 'string',\n      'ios_app_store_id' => 'unsigned int',\n      'ios_url' => 'string',\n      'ipad_app_name' => 'string',\n      'ipad_app_store_id' => 'unsigned int',\n      'ipad_url' => 'string',\n      'iphone_app_name' => 'string',\n      'iphone_app_store_id' => 'unsigned int',\n      'iphone_url' => 'string',\n      'launch_date' => 'string',\n      'offer_price_amount' => 'unsigned int',\n      'offer_price_end_date' => 'datetime',\n      'offer_price_start_date' => 'datetime',\n      'return_policy_days' => 'unsigned int',\n      'windows_phone_app_id' => 'string',\n      'windows_phone_app_name' => 'string',\n      'windows_phone_url' => 'string',\n    );\n  }\n}\n", "num_lines": 240}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductItemImporterAddressFields extends AbstractEnum {\n\n  const CITY = 'city';\n  const COUNTRY = 'country';\n  const POSTAL_CODE = 'postal_code';\n  const REGION = 'region';\n  const STREET1 = 'street1';\n  const STREET2 = 'street2';\n\n  public function getFieldTypes() {\n    return array(\n      'city' => 'string',\n      'country' => 'string',\n      'postal_code' => 'string',\n      'region' => 'string',\n      'street1' => 'string',\n      'street2' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductSetFields extends AbstractEnum {\n\n  const AUTO_CREATION_URL = 'auto_creation_url';\n  const FILTER = 'filter';\n  const ID = 'id';\n  const LATEST_METADATA = 'latest_metadata';\n  const LIVE_METADATA = 'live_metadata';\n  const NAME = 'name';\n  const ORDERING_INFO = 'ordering_info';\n  const PRODUCT_CATALOG = 'product_catalog';\n  const PRODUCT_COUNT = 'product_count';\n  const RETAILER_ID = 'retailer_id';\n  const METADATA = 'metadata';\n  const PUBLISH_TO_SHOPS = 'publish_to_shops';\n\n  public function getFieldTypes() {\n    return array(\n      'auto_creation_url' => 'string',\n      'filter' => 'string',\n      'id' => 'string',\n      'latest_metadata' => 'ProductSetMetadata',\n      'live_metadata' => 'ProductSetMetadata',\n      'name' => 'string',\n      'ordering_info' => 'list<int>',\n      'product_catalog' => 'ProductCatalog',\n      'product_count' => 'unsigned int',\n      'retailer_id' => 'string',\n      'metadata' => 'map',\n      'publish_to_shops' => 'list<map>',\n    );\n  }\n}\n", "num_lines": 70}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductSetMetadataFields extends AbstractEnum {\n\n  const COVER_IMAGE_URL = 'cover_image_url';\n  const DESCRIPTION = 'description';\n  const EXTERNAL_URL = 'external_url';\n  const INTEGRITY_REVIEW_STATUS = 'integrity_review_status';\n\n  public function getFieldTypes() {\n    return array(\n      'cover_image_url' => 'string',\n      'description' => 'string',\n      'external_url' => 'string',\n      'integrity_review_status' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProductVariantFields extends AbstractEnum {\n\n  const LABEL = 'label';\n  const OPTIONS = 'options';\n  const PRODUCT_FIELD = 'product_field';\n\n  public function getFieldTypes() {\n    return array(\n      'label' => 'string',\n      'options' => 'list<string>',\n      'product_field' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProfileFields extends AbstractEnum {\n\n  const CAN_POST = 'can_post';\n  const ID = 'id';\n  const LINK = 'link';\n  const NAME = 'name';\n  const PIC = 'pic';\n  const PIC_CROP = 'pic_crop';\n  const PIC_LARGE = 'pic_large';\n  const PIC_SMALL = 'pic_small';\n  const PIC_SQUARE = 'pic_square';\n  const PROFILE_TYPE = 'profile_type';\n  const USERNAME = 'username';\n\n  public function getFieldTypes() {\n    return array(\n      'can_post' => 'bool',\n      'id' => 'string',\n      'link' => 'string',\n      'name' => 'string',\n      'pic' => 'string',\n      'pic_crop' => 'ProfilePictureSource',\n      'pic_large' => 'string',\n      'pic_small' => 'string',\n      'pic_square' => 'string',\n      'profile_type' => 'ProfileType',\n      'username' => 'string',\n    );\n  }\n}\n", "num_lines": 68}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ProfilePictureSourceFields extends AbstractEnum {\n\n  const BOTTOM = 'bottom';\n  const CACHE_KEY = 'cache_key';\n  const HEIGHT = 'height';\n  const IS_SILHOUETTE = 'is_silhouette';\n  const LEFT = 'left';\n  const RIGHT = 'right';\n  const TOP = 'top';\n  const URL = 'url';\n  const WIDTH = 'width';\n\n  public function getFieldTypes() {\n    return array(\n      'bottom' => 'unsigned int',\n      'cache_key' => 'string',\n      'height' => 'unsigned int',\n      'is_silhouette' => 'bool',\n      'left' => 'unsigned int',\n      'right' => 'unsigned int',\n      'top' => 'unsigned int',\n      'url' => 'string',\n      'width' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass PublisherBlockListFields extends AbstractEnum {\n\n  const APP_PUBLISHERS = 'app_publishers';\n  const BUSINESS_OWNER_ID = 'business_owner_id';\n  const ID = 'id';\n  const IS_AUTO_BLOCKING_ON = 'is_auto_blocking_on';\n  const IS_ELIGIBLE_AT_CAMPAIGN_LEVEL = 'is_eligible_at_campaign_level';\n  const LAST_UPDATE_TIME = 'last_update_time';\n  const LAST_UPDATE_USER = 'last_update_user';\n  const NAME = 'name';\n  const OWNER_AD_ACCOUNT_ID = 'owner_ad_account_id';\n  const WEB_PUBLISHERS = 'web_publishers';\n\n  public function getFieldTypes() {\n    return array(\n      'app_publishers' => 'list<Object>',\n      'business_owner_id' => 'string',\n      'id' => 'string',\n      'is_auto_blocking_on' => 'bool',\n      'is_eligible_at_campaign_level' => 'bool',\n      'last_update_time' => 'datetime',\n      'last_update_user' => 'string',\n      'name' => 'string',\n      'owner_ad_account_id' => 'string',\n      'web_publishers' => 'list<Object>',\n    );\n  }\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass RawCustomAudienceFields extends AbstractEnum {\n\n  const ID = 'id';\n  const NAME = 'name';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'name' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencyActivityFields extends AbstractEnum {\n\n  const ACCOUNT_ID = 'account_id';\n  const CAMPAIGN_ACTIVE = 'campaign_active';\n  const CAMPAIGN_STARTED = 'campaign_started';\n  const CREATIVE_UPLOADED = 'creative_uploaded';\n  const IO_APPROVED = 'io_approved';\n  const SF_LINK = 'sf_link';\n\n  public function getFieldTypes() {\n    return array(\n      'account_id' => 'string',\n      'campaign_active' => 'bool',\n      'campaign_started' => 'bool',\n      'creative_uploaded' => 'bool',\n      'io_approved' => 'bool',\n      'sf_link' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencyAdFormatFields extends AbstractEnum {\n\n  const DETAILS = 'details';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'details' => 'Object',\n      'type' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencyCurveLowerConfidenceRangeFields extends AbstractEnum {\n\n  const IMPRESSION_LOWER = 'impression_lower';\n  const NUM_POINTS = 'num_points';\n  const REACH = 'reach';\n  const REACH_LOWER = 'reach_lower';\n  const UNIQ_VIDEO_VIEWS_2S_LOWER = 'uniq_video_views_2s_lower';\n  const VIDEO_VIEWS_2S_LOWER = 'video_views_2s_lower';\n\n  public function getFieldTypes() {\n    return array(\n      'impression_lower' => 'list<int>',\n      'num_points' => 'unsigned int',\n      'reach' => 'list<int>',\n      'reach_lower' => 'list<int>',\n      'uniq_video_views_2s_lower' => 'list<int>',\n      'video_views_2s_lower' => 'list<int>',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencyCurveUpperConfidenceRangeFields extends AbstractEnum {\n\n  const IMPRESSION_UPPER = 'impression_upper';\n  const NUM_POINTS = 'num_points';\n  const REACH = 'reach';\n  const REACH_UPPER = 'reach_upper';\n  const UNIQ_VIDEO_VIEWS_2S_UPPER = 'uniq_video_views_2s_upper';\n  const VIDEO_VIEWS_2S_UPPER = 'video_views_2s_upper';\n\n  public function getFieldTypes() {\n    return array(\n      'impression_upper' => 'list<int>',\n      'num_points' => 'unsigned int',\n      'reach' => 'list<int>',\n      'reach_upper' => 'list<int>',\n      'uniq_video_views_2s_upper' => 'list<int>',\n      'video_views_2s_upper' => 'list<int>',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencyDayPartFields extends AbstractEnum {\n\n  const DAYS = 'days';\n  const END_MINUTE = 'end_minute';\n  const START_MINUTE = 'start_minute';\n\n  public function getFieldTypes() {\n    return array(\n      'days' => 'list<int>',\n      'end_minute' => 'int',\n      'start_minute' => 'int',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencyEstimatesCurveFields extends AbstractEnum {\n\n  const BUDGET = 'budget';\n  const CONVERSION = 'conversion';\n  const IMPRESSION = 'impression';\n  const INTERPOLATED_REACH = 'interpolated_reach';\n  const NUM_POINTS = 'num_points';\n  const RAW_IMPRESSION = 'raw_impression';\n  const RAW_REACH = 'raw_reach';\n  const REACH = 'reach';\n\n  public function getFieldTypes() {\n    return array(\n      'budget' => 'list<int>',\n      'conversion' => 'list<int>',\n      'impression' => 'list<int>',\n      'interpolated_reach' => 'float',\n      'num_points' => 'unsigned int',\n      'raw_impression' => 'list<int>',\n      'raw_reach' => 'list<int>',\n      'reach' => 'list<int>',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencyEstimatesPlacementBreakdownFields extends AbstractEnum {\n\n  const ANDROID = 'android';\n  const AUDIENCE_NETWORK = 'audience_network';\n  const DESKTOP = 'desktop';\n  const FACEBOOK_SEARCH = 'facebook_search';\n  const FB_REELS = 'fb_reels';\n  const FB_REELS_OVERLAY = 'fb_reels_overlay';\n  const IG_ANDROID = 'ig_android';\n  const IG_IOS = 'ig_ios';\n  const IG_OTHER = 'ig_other';\n  const IG_REELS = 'ig_reels';\n  const IG_STORY = 'ig_story';\n  const INSTANT_ARTICLES = 'instant_articles';\n  const INSTREAM_VIDEOS = 'instream_videos';\n  const IOS = 'ios';\n  const MSITE = 'msite';\n  const SUGGESTED_VIDEOS = 'suggested_videos';\n\n  public function getFieldTypes() {\n    return array(\n      'android' => 'list<float>',\n      'audience_network' => 'list<float>',\n      'desktop' => 'list<float>',\n      'facebook_search' => 'list<float>',\n      'fb_reels' => 'list<float>',\n      'fb_reels_overlay' => 'list<float>',\n      'ig_android' => 'list<float>',\n      'ig_ios' => 'list<float>',\n      'ig_other' => 'list<float>',\n      'ig_reels' => 'list<float>',\n      'ig_story' => 'list<float>',\n      'instant_articles' => 'list<float>',\n      'instream_videos' => 'list<float>',\n      'ios' => 'list<float>',\n      'msite' => 'list<float>',\n      'suggested_videos' => 'list<float>',\n    );\n  }\n}\n", "num_lines": 78}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencyPredictionFields extends AbstractEnum {\n\n  const ACCOUNT_ID = 'account_id';\n  const ACTIVITY_STATUS = 'activity_status';\n  const AD_FORMATS = 'ad_formats';\n  const AUCTION_ENTRY_OPTION_INDEX = 'auction_entry_option_index';\n  const AUDIENCE_SIZE_LOWER_BOUND = 'audience_size_lower_bound';\n  const AUDIENCE_SIZE_UPPER_BOUND = 'audience_size_upper_bound';\n  const BUSINESS_ID = 'business_id';\n  const BUYING_TYPE = 'buying_type';\n  const CAMPAIGN_GROUP_ID = 'campaign_group_id';\n  const CAMPAIGN_ID = 'campaign_id';\n  const CAMPAIGN_TIME_START = 'campaign_time_start';\n  const CAMPAIGN_TIME_STOP = 'campaign_time_stop';\n  const CURRENCY = 'currency';\n  const CURVE_BUDGET_REACH = 'curve_budget_reach';\n  const CURVE_REACH = 'curve_reach';\n  const DAILY_GRP_CURVE = 'daily_grp_curve';\n  const DAILY_IMPRESSION_CURVE = 'daily_impression_curve';\n  const DAILY_IMPRESSION_CURVE_MAP = 'daily_impression_curve_map';\n  const DAY_PARTING_SCHEDULE = 'day_parting_schedule';\n  const DESTINATION_ID = 'destination_id';\n  const END_TIME = 'end_time';\n  const EXPIRATION_TIME = 'expiration_time';\n  const EXTERNAL_BUDGET = 'external_budget';\n  const EXTERNAL_IMPRESSION = 'external_impression';\n  const EXTERNAL_MAXIMUM_BUDGET = 'external_maximum_budget';\n  const EXTERNAL_MAXIMUM_IMPRESSION = 'external_maximum_impression';\n  const EXTERNAL_MAXIMUM_REACH = 'external_maximum_reach';\n  const EXTERNAL_MINIMUM_BUDGET = 'external_minimum_budget';\n  const EXTERNAL_MINIMUM_IMPRESSION = 'external_minimum_impression';\n  const EXTERNAL_MINIMUM_REACH = 'external_minimum_reach';\n  const EXTERNAL_REACH = 'external_reach';\n  const FEED_RATIO_0000 = 'feed_ratio_0000';\n  const FREQUENCY_CAP = 'frequency_cap';\n  const FREQUENCY_DISTRIBUTION_MAP = 'frequency_distribution_map';\n  const FREQUENCY_DISTRIBUTION_MAP_AGG = 'frequency_distribution_map_agg';\n  const GRP_AUDIENCE_SIZE = 'grp_audience_size';\n  const GRP_AVG_PROBABILITY_MAP = 'grp_avg_probability_map';\n  const GRP_COUNTRY_AUDIENCE_SIZE = 'grp_country_audience_size';\n  const GRP_CURVE = 'grp_curve';\n  const GRP_DMAS_AUDIENCE_SIZE = 'grp_dmas_audience_size';\n  const GRP_FILTERING_THRESHOLD_00 = 'grp_filtering_threshold_00';\n  const GRP_POINTS = 'grp_points';\n  const GRP_RATIO = 'grp_ratio';\n  const GRP_REACH_RATIO = 'grp_reach_ratio';\n  const GRP_STATUS = 'grp_status';\n  const HOLDOUT_PERCENTAGE = 'holdout_percentage';\n  const ID = 'id';\n  const IMPRESSION_CURVE = 'impression_curve';\n  const INSTAGRAM_DESTINATION_ID = 'instagram_destination_id';\n  const INSTREAM_PACKAGES = 'instream_packages';\n  const INTERVAL_FREQUENCY_CAP = 'interval_frequency_cap';\n  const INTERVAL_FREQUENCY_CAP_RESET_PERIOD = 'interval_frequency_cap_reset_period';\n  const IS_BONUS_MEDIA = 'is_bonus_media';\n  const IS_CONVERSION_GOAL = 'is_conversion_goal';\n  const IS_HIGHER_AVERAGE_FREQUENCY = 'is_higher_average_frequency';\n  const IS_IO = 'is_io';\n  const IS_RESERVED_BUYING = 'is_reserved_buying';\n  const IS_TRP = 'is_trp';\n  const NAME = 'name';\n  const OBJECTIVE = 'objective';\n  const OBJECTIVE_NAME = 'objective_name';\n  const ODAX_OBJECTIVE = 'odax_objective';\n  const ODAX_OBJECTIVE_NAME = 'odax_objective_name';\n  const OPTIMIZATION_GOAL = 'optimization_goal';\n  const OPTIMIZATION_GOAL_NAME = 'optimization_goal_name';\n  const PAUSE_PERIODS = 'pause_periods';\n  const PLACEMENT_BREAKDOWN = 'placement_breakdown';\n  const PLACEMENT_BREAKDOWN_MAP = 'placement_breakdown_map';\n  const PLAN_NAME = 'plan_name';\n  const PLAN_TYPE = 'plan_type';\n  const PREDICTION_MODE = 'prediction_mode';\n  const PREDICTION_PROGRESS = 'prediction_progress';\n  const REFERENCE_ID = 'reference_id';\n  const RESERVATION_STATUS = 'reservation_status';\n  const START_TIME = 'start_time';\n  const STATUS = 'status';\n  const STORY_EVENT_TYPE = 'story_event_type';\n  const TARGET_CPM = 'target_cpm';\n  const TARGET_SPEC = 'target_spec';\n  const TIME_CREATED = 'time_created';\n  const TIME_UPDATED = 'time_updated';\n  const TIMEZONE_ID = 'timezone_id';\n  const TIMEZONE_NAME = 'timezone_name';\n  const TOPLINE_ID = 'topline_id';\n  const VIDEO_VIEW_LENGTH_CONSTRAINT = 'video_view_length_constraint';\n  const VIEWTAG = 'viewtag';\n  const ACTION = 'action';\n  const BUDGET = 'budget';\n  const DEAL_ID = 'deal_id';\n  const DESTINATION_IDS = 'destination_ids';\n  const EXCEPTIONS = 'exceptions';\n  const EXISTING_CAMPAIGN_ID = 'existing_campaign_id';\n  const GRP_BUYING = 'grp_buying';\n  const IMPRESSION = 'impression';\n  const IS_FULL_VIEW = 'is_full_view';\n  const IS_REACH_AND_FREQUENCY_IO_BUYING = 'is_reach_and_frequency_io_buying';\n  const NUM_CURVE_POINTS = 'num_curve_points';\n  const REACH = 'reach';\n  const RF_PREDICTION_ID = 'rf_prediction_id';\n  const RF_PREDICTION_ID_TO_RELEASE = 'rf_prediction_id_to_release';\n  const RF_PREDICTION_ID_TO_SHARE = 'rf_prediction_id_to_share';\n  const STOP_TIME = 'stop_time';\n\n  public function getFieldTypes() {\n    return array(\n      'account_id' => 'int',\n      'activity_status' => 'ReachFrequencyActivity',\n      'ad_formats' => 'list<ReachFrequencyAdFormat>',\n      'auction_entry_option_index' => 'int',\n      'audience_size_lower_bound' => 'unsigned int',\n      'audience_size_upper_bound' => 'unsigned int',\n      'business_id' => 'int',\n      'buying_type' => 'string',\n      'campaign_group_id' => 'int',\n      'campaign_id' => 'string',\n      'campaign_time_start' => 'datetime',\n      'campaign_time_stop' => 'datetime',\n      'currency' => 'string',\n      'curve_budget_reach' => 'ReachFrequencyEstimatesCurve',\n      'curve_reach' => 'list<unsigned int>',\n      'daily_grp_curve' => 'list<float>',\n      'daily_impression_curve' => 'list<float>',\n      'daily_impression_curve_map' => 'list<map<unsigned int, list<float>>>',\n      'day_parting_schedule' => 'list<ReachFrequencyDayPart>',\n      'destination_id' => 'string',\n      'end_time' => 'datetime',\n      'expiration_time' => 'datetime',\n      'external_budget' => 'int',\n      'external_impression' => 'unsigned int',\n      'external_maximum_budget' => 'int',\n      'external_maximum_impression' => 'string',\n      'external_maximum_reach' => 'unsigned int',\n      'external_minimum_budget' => 'int',\n      'external_minimum_impression' => 'unsigned int',\n      'external_minimum_reach' => 'unsigned int',\n      'external_reach' => 'unsigned int',\n      'feed_ratio_0000' => 'unsigned int',\n      'frequency_cap' => 'unsigned int',\n      'frequency_distribution_map' => 'list<map<unsigned int, list<float>>>',\n      'frequency_distribution_map_agg' => 'list<map<unsigned int, list<unsigned int>>>',\n      'grp_audience_size' => 'float',\n      'grp_avg_probability_map' => 'string',\n      'grp_country_audience_size' => 'float',\n      'grp_curve' => 'list<float>',\n      'grp_dmas_audience_size' => 'float',\n      'grp_filtering_threshold_00' => 'unsigned int',\n      'grp_points' => 'float',\n      'grp_ratio' => 'float',\n      'grp_reach_ratio' => 'float',\n      'grp_status' => 'string',\n      'holdout_percentage' => 'unsigned int',\n      'id' => 'string',\n      'impression_curve' => 'list<unsigned int>',\n      'instagram_destination_id' => 'string',\n      'instream_packages' => 'list<string>',\n      'interval_frequency_cap' => 'unsigned int',\n      'interval_frequency_cap_reset_period' => 'unsigned int',\n      'is_bonus_media' => 'unsigned int',\n      'is_conversion_goal' => 'unsigned int',\n      'is_higher_average_frequency' => 'bool',\n      'is_io' => 'bool',\n      'is_reserved_buying' => 'unsigned int',\n      'is_trp' => 'bool',\n      'name' => 'string',\n      'objective' => 'unsigned int',\n      'objective_name' => 'string',\n      'odax_objective' => 'unsigned int',\n      'odax_objective_name' => 'string',\n      'optimization_goal' => 'unsigned int',\n      'optimization_goal_name' => 'string',\n      'pause_periods' => 'list<Object>',\n      'placement_breakdown' => 'ReachFrequencyEstimatesPlacementBreakdown',\n      'placement_breakdown_map' => 'list<map<unsigned int, ReachFrequencyEstimatesPlacementBreakdown>>',\n      'plan_name' => 'string',\n      'plan_type' => 'string',\n      'prediction_mode' => 'unsigned int',\n      'prediction_progress' => 'unsigned int',\n      'reference_id' => 'string',\n      'reservation_status' => 'unsigned int',\n      'start_time' => 'datetime',\n      'status' => 'unsigned int',\n      'story_event_type' => 'unsigned int',\n      'target_cpm' => 'unsigned int',\n      'target_spec' => 'Targeting',\n      'time_created' => 'datetime',\n      'time_updated' => 'datetime',\n      'timezone_id' => 'unsigned int',\n      'timezone_name' => 'string',\n      'topline_id' => 'unsigned int',\n      'video_view_length_constraint' => 'unsigned int',\n      'viewtag' => 'string',\n      'action' => 'Action',\n      'budget' => 'unsigned int',\n      'deal_id' => 'string',\n      'destination_ids' => 'list<string>',\n      'exceptions' => 'bool',\n      'existing_campaign_id' => 'string',\n      'grp_buying' => 'bool',\n      'impression' => 'unsigned int',\n      'is_full_view' => 'bool',\n      'is_reach_and_frequency_io_buying' => 'bool',\n      'num_curve_points' => 'unsigned int',\n      'reach' => 'unsigned int',\n      'rf_prediction_id' => 'string',\n      'rf_prediction_id_to_release' => 'string',\n      'rf_prediction_id_to_share' => 'string',\n      'stop_time' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 250}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ReachFrequencySpecFields extends AbstractEnum {\n\n  const COUNTRIES = 'countries';\n  const DEFAULT_CREATION_DATA = 'default_creation_data';\n  const GLOBAL_IO_MAX_CAMPAIGN_DURATION = 'global_io_max_campaign_duration';\n  const MAX_CAMPAIGN_DURATION = 'max_campaign_duration';\n  const MAX_DAYS_TO_FINISH = 'max_days_to_finish';\n  const MAX_PAUSE_WITHOUT_PREDICTION_RERUN = 'max_pause_without_prediction_rerun';\n  const MIN_CAMPAIGN_DURATION = 'min_campaign_duration';\n  const MIN_REACH_LIMITS = 'min_reach_limits';\n\n  public function getFieldTypes() {\n    return array(\n      'countries' => 'list<string>',\n      'default_creation_data' => 'Object',\n      'global_io_max_campaign_duration' => 'unsigned int',\n      'max_campaign_duration' => 'Object',\n      'max_days_to_finish' => 'Object',\n      'max_pause_without_prediction_rerun' => 'Object',\n      'min_campaign_duration' => 'Object',\n      'min_reach_limits' => 'Object',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass RecommendationFields extends AbstractEnum {\n\n  const CREATED_TIME = 'created_time';\n  const HAS_RATING = 'has_rating';\n  const HAS_REVIEW = 'has_review';\n  const OPEN_GRAPH_STORY = 'open_graph_story';\n  const RATING = 'rating';\n  const RECOMMENDATION_TYPE = 'recommendation_type';\n  const REVIEW_TEXT = 'review_text';\n  const REVIEWER = 'reviewer';\n\n  public function getFieldTypes() {\n    return array(\n      'created_time' => 'datetime',\n      'has_rating' => 'bool',\n      'has_review' => 'bool',\n      'open_graph_story' => 'Object',\n      'rating' => 'int',\n      'recommendation_type' => 'string',\n      'review_text' => 'string',\n      'reviewer' => 'User',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass RevSharePolicyFields extends AbstractEnum {\n\n  const POLICY_ID = 'policy_id';\n  const POLICY_NAME = 'policy_name';\n\n  public function getFieldTypes() {\n    return array(\n      'policy_id' => 'string',\n      'policy_name' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass RichMediaElementFields extends AbstractEnum {\n\n  const ELEMENT = 'element';\n  const ELEMENT_TYPE = 'element_type';\n  const NAME = 'name';\n\n  public function getFieldTypes() {\n    return array(\n      'element' => 'Object',\n      'element_type' => 'string',\n      'name' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass RTBDynamicPostFields extends AbstractEnum {\n\n  const CHILD_ATTACHMENTS = 'child_attachments';\n  const CREATED = 'created';\n  const DESCRIPTION = 'description';\n  const ID = 'id';\n  const IMAGE_URL = 'image_url';\n  const LINK = 'link';\n  const MESSAGE = 'message';\n  const OWNER_ID = 'owner_id';\n  const PLACE_ID = 'place_id';\n  const PRODUCT_ID = 'product_id';\n  const TITLE = 'title';\n\n  public function getFieldTypes() {\n    return array(\n      'child_attachments' => 'list<DynamicPostChildAttachment>',\n      'created' => 'datetime',\n      'description' => 'string',\n      'id' => 'string',\n      'image_url' => 'string',\n      'link' => 'string',\n      'message' => 'string',\n      'owner_id' => 'string',\n      'place_id' => 'string',\n      'product_id' => 'string',\n      'title' => 'string',\n    );\n  }\n}\n", "num_lines": 68}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass SavedAudienceFields extends AbstractEnum {\n\n  const ACCOUNT = 'account';\n  const APPROXIMATE_COUNT_LOWER_BOUND = 'approximate_count_lower_bound';\n  const APPROXIMATE_COUNT_UPPER_BOUND = 'approximate_count_upper_bound';\n  const DELETE_TIME = 'delete_time';\n  const DESCRIPTION = 'description';\n  const ID = 'id';\n  const NAME = 'name';\n  const OPERATION_STATUS = 'operation_status';\n  const OWNER_BUSINESS = 'owner_business';\n  const PAGE_DELETION_MARKED_DELETE_TIME = 'page_deletion_marked_delete_time';\n  const PERMISSION_FOR_ACTIONS = 'permission_for_actions';\n  const RUN_STATUS = 'run_status';\n  const SENTENCE_LINES = 'sentence_lines';\n  const TARGETING = 'targeting';\n  const TIME_CREATED = 'time_created';\n  const TIME_UPDATED = 'time_updated';\n\n  public function getFieldTypes() {\n    return array(\n      'account' => 'AdAccount',\n      'approximate_count_lower_bound' => 'int',\n      'approximate_count_upper_bound' => 'int',\n      'delete_time' => 'int',\n      'description' => 'string',\n      'id' => 'string',\n      'name' => 'string',\n      'operation_status' => 'CustomAudienceStatus',\n      'owner_business' => 'Business',\n      'page_deletion_marked_delete_time' => 'int',\n      'permission_for_actions' => 'AudiencePermissionForActions',\n      'run_status' => 'string',\n      'sentence_lines' => 'list',\n      'targeting' => 'Targeting',\n      'time_created' => 'datetime',\n      'time_updated' => 'datetime',\n    );\n  }\n}\n", "num_lines": 78}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass SavedMessageResponseFields extends AbstractEnum {\n\n  const CATEGORY = 'category';\n  const ID = 'id';\n  const IMAGE = 'image';\n  const IS_ENABLED = 'is_enabled';\n  const MESSAGE = 'message';\n  const TITLE = 'title';\n\n  public function getFieldTypes() {\n    return array(\n      'category' => 'string',\n      'id' => 'string',\n      'image' => 'string',\n      'is_enabled' => 'bool',\n      'message' => 'string',\n      'title' => 'string',\n    );\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass SecuritySettingsFields extends AbstractEnum {\n\n\n  public function getFieldTypes() {\n    return array(\n    );\n  }\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ShadowIGMediaProductTagsFields extends AbstractEnum {\n\n  const IMAGE_URL = 'image_url';\n  const IS_CHECKOUT = 'is_checkout';\n  const MERCHANT_ID = 'merchant_id';\n  const NAME = 'name';\n  const PRICE_STRING = 'price_string';\n  const PRODUCT_ID = 'product_id';\n  const REVIEW_STATUS = 'review_status';\n  const STRIPPED_PRICE_STRING = 'stripped_price_string';\n  const STRIPPED_SALE_PRICE_STRING = 'stripped_sale_price_string';\n  const X = 'x';\n  const Y = 'y';\n\n  public function getFieldTypes() {\n    return array(\n      'image_url' => 'string',\n      'is_checkout' => 'bool',\n      'merchant_id' => 'int',\n      'name' => 'string',\n      'price_string' => 'string',\n      'product_id' => 'int',\n      'review_status' => 'string',\n      'stripped_price_string' => 'string',\n      'stripped_sale_price_string' => 'string',\n      'x' => 'float',\n      'y' => 'float',\n    );\n  }\n}\n", "num_lines": 68}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ShopFields extends AbstractEnum {\n\n  const FB_SALES_CHANNEL = 'fb_sales_channel';\n  const ID = 'id';\n  const IG_SALES_CHANNEL = 'ig_sales_channel';\n  const WORKSPACE = 'workspace';\n\n  public function getFieldTypes() {\n    return array(\n      'fb_sales_channel' => 'Object',\n      'id' => 'string',\n      'ig_sales_channel' => 'Object',\n      'workspace' => 'Object',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ShopOrderFields extends AbstractEnum {\n\n  const CREATION_TIME = 'creation_time';\n  const ID = 'id';\n\n  public function getFieldTypes() {\n    return array(\n      'creation_time' => 'datetime',\n      'id' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass SplitTestWinnerFields extends AbstractEnum {\n\n  const AD_OBJECT_LEVEL = 'ad_object_level';\n  const CONFIDENCES = 'confidences';\n  const WINNER_AD_OBJECT_ID = 'winner_ad_object_id';\n\n  public function getFieldTypes() {\n    return array(\n      'ad_object_level' => 'string',\n      'confidences' => 'list<map<string, float>>',\n      'winner_ad_object_id' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass StoreCatalogSettingsFields extends AbstractEnum {\n\n  const ID = 'id';\n  const PAGE = 'page';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'page' => 'Page',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static SystemUserFields getInstance()\n */\nclass SystemUserFields extends AbstractEnum {\n\n  const ID = 'id';\n  const NAME = 'name';\n  const PERMISSIONS = 'permissions';\n  const ROLE = 'role';\n}\n", "num_lines": 39}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TabFields extends AbstractEnum {\n\n  const APPLICATION = 'application';\n  const CUSTOM_IMAGE_URL = 'custom_image_url';\n  const CUSTOM_NAME = 'custom_name';\n  const ID = 'id';\n  const IMAGE_URL = 'image_url';\n  const IS_NON_CONNECTION_LANDING_TAB = 'is_non_connection_landing_tab';\n  const IS_PERMANENT = 'is_permanent';\n  const LINK = 'link';\n  const NAME = 'name';\n  const POSITION = 'position';\n\n  public function getFieldTypes() {\n    return array(\n      'application' => 'Application',\n      'custom_image_url' => 'string',\n      'custom_name' => 'string',\n      'id' => 'string',\n      'image_url' => 'string',\n      'is_non_connection_landing_tab' => 'bool',\n      'is_permanent' => 'bool',\n      'link' => 'string',\n      'name' => 'string',\n      'position' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingDynamicRuleFields extends AbstractEnum {\n\n  const FIELD_ACTION_TYPE = 'action.type';\n  const AD_GROUP_ID = 'ad_group_id';\n  const CAMPAIGN_GROUP_ID = 'campaign_group_id';\n  const CAMPAIGN_ID = 'campaign_id';\n  const IMPRESSION_COUNT = 'impression_count';\n  const PAGE_ID = 'page_id';\n  const POST = 'post';\n  const RETENTION_SECONDS = 'retention_seconds';\n\n  public function getFieldTypes() {\n    return array(\n      'action.type' => 'string',\n      'ad_group_id' => 'string',\n      'campaign_group_id' => 'string',\n      'campaign_id' => 'string',\n      'impression_count' => 'string',\n      'page_id' => 'string',\n      'post' => 'string',\n      'retention_seconds' => 'string',\n    );\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingFields extends AbstractEnum {\n\n  const ADGROUP_ID = 'adgroup_id';\n  const AGE_MAX = 'age_max';\n  const AGE_MIN = 'age_min';\n  const APP_INSTALL_STATE = 'app_install_state';\n  const AUDIENCE_NETWORK_POSITIONS = 'audience_network_positions';\n  const BEHAVIORS = 'behaviors';\n  const BRAND_SAFETY_CONTENT_FILTER_LEVELS = 'brand_safety_content_filter_levels';\n  const CATALOG_BASED_TARGETING = 'catalog_based_targeting';\n  const CITIES = 'cities';\n  const COLLEGE_YEARS = 'college_years';\n  const CONNECTIONS = 'connections';\n  const CONTEXTUAL_TARGETING_CATEGORIES = 'contextual_targeting_categories';\n  const COUNTRIES = 'countries';\n  const COUNTRY = 'country';\n  const COUNTRY_GROUPS = 'country_groups';\n  const CUSTOM_AUDIENCES = 'custom_audiences';\n  const DEVICE_PLATFORMS = 'device_platforms';\n  const DIRECT_INSTALL_DEVICES = 'direct_install_devices';\n  const DYNAMIC_AUDIENCE_IDS = 'dynamic_audience_ids';\n  const EDUCATION_MAJORS = 'education_majors';\n  const EDUCATION_SCHOOLS = 'education_schools';\n  const EDUCATION_STATUSES = 'education_statuses';\n  const EFFECTIVE_AUDIENCE_NETWORK_POSITIONS = 'effective_audience_network_positions';\n  const EFFECTIVE_DEVICE_PLATFORMS = 'effective_device_platforms';\n  const EFFECTIVE_FACEBOOK_POSITIONS = 'effective_facebook_positions';\n  const EFFECTIVE_INSTAGRAM_POSITIONS = 'effective_instagram_positions';\n  const EFFECTIVE_MESSENGER_POSITIONS = 'effective_messenger_positions';\n  const EFFECTIVE_PUBLISHER_PLATFORMS = 'effective_publisher_platforms';\n  const ENGAGEMENT_SPECS = 'engagement_specs';\n  const ETHNIC_AFFINITY = 'ethnic_affinity';\n  const EXCLUDE_REACHED_SINCE = 'exclude_reached_since';\n  const EXCLUDED_BRAND_SAFETY_CONTENT_TYPES = 'excluded_brand_safety_content_types';\n  const EXCLUDED_CONNECTIONS = 'excluded_connections';\n  const EXCLUDED_CUSTOM_AUDIENCES = 'excluded_custom_audiences';\n  const EXCLUDED_DYNAMIC_AUDIENCE_IDS = 'excluded_dynamic_audience_ids';\n  const EXCLUDED_ENGAGEMENT_SPECS = 'excluded_engagement_specs';\n  const EXCLUDED_GEO_LOCATIONS = 'excluded_geo_locations';\n  const EXCLUDED_MOBILE_DEVICE_MODEL = 'excluded_mobile_device_model';\n  const EXCLUDED_PRODUCT_AUDIENCE_SPECS = 'excluded_product_audience_specs';\n  const EXCLUDED_PUBLISHER_CATEGORIES = 'excluded_publisher_categories';\n  const EXCLUDED_PUBLISHER_LIST_IDS = 'excluded_publisher_list_ids';\n  const EXCLUDED_USER_DEVICE = 'excluded_user_device';\n  const EXCLUSIONS = 'exclusions';\n  const FACEBOOK_POSITIONS = 'facebook_positions';\n  const FAMILY_STATUSES = 'family_statuses';\n  const FB_DEAL_ID = 'fb_deal_id';\n  const FLEXIBLE_SPEC = 'flexible_spec';\n  const FRIENDS_OF_CONNECTIONS = 'friends_of_connections';\n  const GENDERS = 'genders';\n  const GENERATION = 'generation';\n  const GEO_LOCATIONS = 'geo_locations';\n  const HOME_OWNERSHIP = 'home_ownership';\n  const HOME_TYPE = 'home_type';\n  const HOME_VALUE = 'home_value';\n  const HOUSEHOLD_COMPOSITION = 'household_composition';\n  const INCOME = 'income';\n  const INDUSTRIES = 'industries';\n  const INSTAGRAM_POSITIONS = 'instagram_positions';\n  const INSTREAM_VIDEO_SKIPPABLE_EXCLUDED = 'instream_video_skippable_excluded';\n  const INTERESTED_IN = 'interested_in';\n  const INTERESTS = 'interests';\n  const IS_WHATSAPP_DESTINATION_AD = 'is_whatsapp_destination_ad';\n  const KEYWORDS = 'keywords';\n  const LIFE_EVENTS = 'life_events';\n  const LOCALES = 'locales';\n  const MESSENGER_POSITIONS = 'messenger_positions';\n  const MOMS = 'moms';\n  const NET_WORTH = 'net_worth';\n  const OFFICE_TYPE = 'office_type';\n  const PLACE_PAGE_SET_IDS = 'place_page_set_ids';\n  const POLITICAL_VIEWS = 'political_views';\n  const POLITICS = 'politics';\n  const PRODUCT_AUDIENCE_SPECS = 'product_audience_specs';\n  const PROSPECTING_AUDIENCE = 'prospecting_audience';\n  const PUBLISHER_PLATFORMS = 'publisher_platforms';\n  const RADIUS = 'radius';\n  const REGIONS = 'regions';\n  const RELATIONSHIP_STATUSES = 'relationship_statuses';\n  const SITE_CATEGORY = 'site_category';\n  const TARGETING_OPTIMIZATION = 'targeting_optimization';\n  const TARGETING_RELAXATION_TYPES = 'targeting_relaxation_types';\n  const USER_ADCLUSTERS = 'user_adclusters';\n  const USER_DEVICE = 'user_device';\n  const USER_EVENT = 'user_event';\n  const USER_OS = 'user_os';\n  const WIRELESS_CARRIER = 'wireless_carrier';\n  const WORK_EMPLOYERS = 'work_employers';\n  const WORK_POSITIONS = 'work_positions';\n  const ZIPS = 'zips';\n\n  public function getFieldTypes() {\n    return array(\n      'adgroup_id' => 'string',\n      'age_max' => 'unsigned int',\n      'age_min' => 'unsigned int',\n      'app_install_state' => 'string',\n      'audience_network_positions' => 'list<string>',\n      'behaviors' => 'list<IDName>',\n      'brand_safety_content_filter_levels' => 'list<string>',\n      'catalog_based_targeting' => 'CatalogBasedTargeting',\n      'cities' => 'list<IDName>',\n      'college_years' => 'list<unsigned int>',\n      'connections' => 'list<ConnectionsTargeting>',\n      'contextual_targeting_categories' => 'list<IDName>',\n      'countries' => 'list<string>',\n      'country' => 'list<string>',\n      'country_groups' => 'list<string>',\n      'custom_audiences' => 'list<RawCustomAudience>',\n      'device_platforms' => 'list<DevicePlatforms>',\n      'direct_install_devices' => 'bool',\n      'dynamic_audience_ids' => 'list<string>',\n      'education_majors' => 'list<IDName>',\n      'education_schools' => 'list<IDName>',\n      'education_statuses' => 'list<unsigned int>',\n      'effective_audience_network_positions' => 'list<string>',\n      'effective_device_platforms' => 'list<EffectiveDevicePlatforms>',\n      'effective_facebook_positions' => 'list<string>',\n      'effective_instagram_positions' => 'list<string>',\n      'effective_messenger_positions' => 'list<string>',\n      'effective_publisher_platforms' => 'list<string>',\n      'engagement_specs' => 'list<TargetingDynamicRule>',\n      'ethnic_affinity' => 'list<IDName>',\n      'exclude_reached_since' => 'list<string>',\n      'excluded_brand_safety_content_types' => 'list<string>',\n      'excluded_connections' => 'list<ConnectionsTargeting>',\n      'excluded_custom_audiences' => 'list<RawCustomAudience>',\n      'excluded_dynamic_audience_ids' => 'list<string>',\n      'excluded_engagement_specs' => 'list<TargetingDynamicRule>',\n      'excluded_geo_locations' => 'TargetingGeoLocation',\n      'excluded_mobile_device_model' => 'list<string>',\n      'excluded_product_audience_specs' => 'list<TargetingProductAudienceSpec>',\n      'excluded_publisher_categories' => 'list<string>',\n      'excluded_publisher_list_ids' => 'list<string>',\n      'excluded_user_device' => 'list<string>',\n      'exclusions' => 'FlexibleTargeting',\n      'facebook_positions' => 'list<string>',\n      'family_statuses' => 'list<IDName>',\n      'fb_deal_id' => 'string',\n      'flexible_spec' => 'list<FlexibleTargeting>',\n      'friends_of_connections' => 'list<ConnectionsTargeting>',\n      'genders' => 'list<unsigned int>',\n      'generation' => 'list<IDName>',\n      'geo_locations' => 'TargetingGeoLocation',\n      'home_ownership' => 'list<IDName>',\n      'home_type' => 'list<IDName>',\n      'home_value' => 'list<IDName>',\n      'household_composition' => 'list<IDName>',\n      'income' => 'list<IDName>',\n      'industries' => 'list<IDName>',\n      'instagram_positions' => 'list<string>',\n      'instream_video_skippable_excluded' => 'bool',\n      'interested_in' => 'list<unsigned int>',\n      'interests' => 'list<IDName>',\n      'is_whatsapp_destination_ad' => 'bool',\n      'keywords' => 'list<string>',\n      'life_events' => 'list<IDName>',\n      'locales' => 'list<unsigned int>',\n      'messenger_positions' => 'list<string>',\n      'moms' => 'list<IDName>',\n      'net_worth' => 'list<IDName>',\n      'office_type' => 'list<IDName>',\n      'place_page_set_ids' => 'list<string>',\n      'political_views' => 'list<unsigned int>',\n      'politics' => 'list<IDName>',\n      'product_audience_specs' => 'list<TargetingProductAudienceSpec>',\n      'prospecting_audience' => 'TargetingProspectingAudience',\n      'publisher_platforms' => 'list<string>',\n      'radius' => 'string',\n      'regions' => 'list<IDName>',\n      'relationship_statuses' => 'list<unsigned int>',\n      'site_category' => 'list<string>',\n      'targeting_optimization' => 'string',\n      'targeting_relaxation_types' => 'TargetingRelaxation',\n      'user_adclusters' => 'list<IDName>',\n      'user_device' => 'list<string>',\n      'user_event' => 'list<unsigned int>',\n      'user_os' => 'list<string>',\n      'wireless_carrier' => 'list<string>',\n      'work_employers' => 'list<IDName>',\n      'work_positions' => 'list<IDName>',\n      'zips' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 224}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationCityFields extends AbstractEnum {\n\n  const COUNTRY = 'country';\n  const DISTANCE_UNIT = 'distance_unit';\n  const KEY = 'key';\n  const NAME = 'name';\n  const RADIUS = 'radius';\n  const REGION = 'region';\n  const REGION_ID = 'region_id';\n\n  public function getFieldTypes() {\n    return array(\n      'country' => 'string',\n      'distance_unit' => 'string',\n      'key' => 'string',\n      'name' => 'string',\n      'radius' => 'unsigned int',\n      'region' => 'string',\n      'region_id' => 'string',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationCustomLocationFields extends AbstractEnum {\n\n  const ADDRESS_STRING = 'address_string';\n  const COUNTRY = 'country';\n  const COUNTRY_GROUP = 'country_group';\n  const CUSTOM_TYPE = 'custom_type';\n  const DISTANCE_UNIT = 'distance_unit';\n  const KEY = 'key';\n  const LATITUDE = 'latitude';\n  const LONGITUDE = 'longitude';\n  const MAX_POPULATION = 'max_population';\n  const MIN_POPULATION = 'min_population';\n  const NAME = 'name';\n  const PRIMARY_CITY_ID = 'primary_city_id';\n  const RADIUS = 'radius';\n  const REGION_ID = 'region_id';\n\n  public function getFieldTypes() {\n    return array(\n      'address_string' => 'string',\n      'country' => 'string',\n      'country_group' => 'string',\n      'custom_type' => 'string',\n      'distance_unit' => 'string',\n      'key' => 'string',\n      'latitude' => 'float',\n      'longitude' => 'float',\n      'max_population' => 'int',\n      'min_population' => 'int',\n      'name' => 'string',\n      'primary_city_id' => 'int',\n      'radius' => 'float',\n      'region_id' => 'int',\n    );\n  }\n}\n", "num_lines": 74}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationElectoralDistrictFields extends AbstractEnum {\n\n  const COUNTRY = 'country';\n  const DEPRECATION_CODE = 'deprecation_code';\n  const ELECTORAL_DISTRICT = 'electoral_district';\n  const KEY = 'key';\n  const NAME = 'name';\n\n  public function getFieldTypes() {\n    return array(\n      'country' => 'string',\n      'deprecation_code' => 'string',\n      'electoral_district' => 'string',\n      'key' => 'string',\n      'name' => 'string',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationFields extends AbstractEnum {\n\n  const CITIES = 'cities';\n  const COUNTRIES = 'countries';\n  const COUNTRY_GROUPS = 'country_groups';\n  const CUSTOM_LOCATIONS = 'custom_locations';\n  const ELECTORAL_DISTRICTS = 'electoral_districts';\n  const GEO_MARKETS = 'geo_markets';\n  const LARGE_GEO_AREAS = 'large_geo_areas';\n  const LOCATION_CLUSTER_IDS = 'location_cluster_ids';\n  const LOCATION_EXPANSION = 'location_expansion';\n  const LOCATION_TYPES = 'location_types';\n  const MEDIUM_GEO_AREAS = 'medium_geo_areas';\n  const METRO_AREAS = 'metro_areas';\n  const NEIGHBORHOODS = 'neighborhoods';\n  const PLACES = 'places';\n  const POLITICAL_DISTRICTS = 'political_districts';\n  const REGIONS = 'regions';\n  const SMALL_GEO_AREAS = 'small_geo_areas';\n  const SUBCITIES = 'subcities';\n  const SUBNEIGHBORHOODS = 'subneighborhoods';\n  const ZIPS = 'zips';\n\n  public function getFieldTypes() {\n    return array(\n      'cities' => 'list<TargetingGeoLocationCity>',\n      'countries' => 'list<string>',\n      'country_groups' => 'list<string>',\n      'custom_locations' => 'list<TargetingGeoLocationCustomLocation>',\n      'electoral_districts' => 'list<TargetingGeoLocationElectoralDistrict>',\n      'geo_markets' => 'list<TargetingGeoLocationMarket>',\n      'large_geo_areas' => 'list<TargetingGeoLocationGeoEntities>',\n      'location_cluster_ids' => 'list<TargetingGeoLocationLocationCluster>',\n      'location_expansion' => 'TargetingGeoLocationLocationExpansion',\n      'location_types' => 'list<string>',\n      'medium_geo_areas' => 'list<TargetingGeoLocationGeoEntities>',\n      'metro_areas' => 'list<TargetingGeoLocationGeoEntities>',\n      'neighborhoods' => 'list<TargetingGeoLocationGeoEntities>',\n      'places' => 'list<TargetingGeoLocationPlace>',\n      'political_districts' => 'list<TargetingGeoLocationPoliticalDistrict>',\n      'regions' => 'list<TargetingGeoLocationRegion>',\n      'small_geo_areas' => 'list<TargetingGeoLocationGeoEntities>',\n      'subcities' => 'list<TargetingGeoLocationGeoEntities>',\n      'subneighborhoods' => 'list<TargetingGeoLocationGeoEntities>',\n      'zips' => 'list<TargetingGeoLocationZip>',\n    );\n  }\n}\n", "num_lines": 86}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationGeoEntitiesFields extends AbstractEnum {\n\n  const COUNTRY = 'country';\n  const KEY = 'key';\n  const NAME = 'name';\n  const REGION = 'region';\n  const REGION_ID = 'region_id';\n\n  public function getFieldTypes() {\n    return array(\n      'country' => 'string',\n      'key' => 'string',\n      'name' => 'string',\n      'region' => 'string',\n      'region_id' => 'string',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationLocationClusterFields extends AbstractEnum {\n\n  const KEY = 'key';\n\n  public function getFieldTypes() {\n    return array(\n      'key' => 'int',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationLocationExpansionFields extends AbstractEnum {\n\n  const ALLOWED = 'allowed';\n\n  public function getFieldTypes() {\n    return array(\n      'allowed' => 'bool',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationMarketFields extends AbstractEnum {\n\n  const COUNTRY = 'country';\n  const KEY = 'key';\n  const MARKET_TYPE = 'market_type';\n  const NAME = 'name';\n\n  public function getFieldTypes() {\n    return array(\n      'country' => 'string',\n      'key' => 'string',\n      'market_type' => 'string',\n      'name' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationPlaceFields extends AbstractEnum {\n\n  const COUNTRY = 'country';\n  const DISTANCE_UNIT = 'distance_unit';\n  const KEY = 'key';\n  const LATITUDE = 'latitude';\n  const LONGITUDE = 'longitude';\n  const NAME = 'name';\n  const PRIMARY_CITY_ID = 'primary_city_id';\n  const RADIUS = 'radius';\n  const REGION_ID = 'region_id';\n\n  public function getFieldTypes() {\n    return array(\n      'country' => 'string',\n      'distance_unit' => 'string',\n      'key' => 'string',\n      'latitude' => 'float',\n      'longitude' => 'float',\n      'name' => 'string',\n      'primary_city_id' => 'int',\n      'radius' => 'float',\n      'region_id' => 'int',\n    );\n  }\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationPoliticalDistrictFields extends AbstractEnum {\n\n  const COUNTRY = 'country';\n  const KEY = 'key';\n  const NAME = 'name';\n  const POLITICAL_DISTRICT = 'political_district';\n\n  public function getFieldTypes() {\n    return array(\n      'country' => 'string',\n      'key' => 'string',\n      'name' => 'string',\n      'political_district' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationRegionFields extends AbstractEnum {\n\n  const COUNTRY = 'country';\n  const KEY = 'key';\n  const NAME = 'name';\n\n  public function getFieldTypes() {\n    return array(\n      'country' => 'string',\n      'key' => 'string',\n      'name' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingGeoLocationZipFields extends AbstractEnum {\n\n  const COUNTRY = 'country';\n  const KEY = 'key';\n  const NAME = 'name';\n  const PRIMARY_CITY_ID = 'primary_city_id';\n  const REGION_ID = 'region_id';\n\n  public function getFieldTypes() {\n    return array(\n      'country' => 'string',\n      'key' => 'string',\n      'name' => 'string',\n      'primary_city_id' => 'int',\n      'region_id' => 'int',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingProductAudienceSpecFields extends AbstractEnum {\n\n  const EXCLUSIONS = 'exclusions';\n  const INCLUSIONS = 'inclusions';\n  const PRODUCT_SET_ID = 'product_set_id';\n\n  public function getFieldTypes() {\n    return array(\n      'exclusions' => 'list<TargetingProductAudienceSubSpec>',\n      'inclusions' => 'list<TargetingProductAudienceSubSpec>',\n      'product_set_id' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingProductAudienceSubSpecFields extends AbstractEnum {\n\n  const RETENTION_SECONDS = 'retention_seconds';\n  const RULE = 'rule';\n\n  public function getFieldTypes() {\n    return array(\n      'retention_seconds' => 'string',\n      'rule' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingProspectingAudienceFields extends AbstractEnum {\n\n  const SOURCES = 'sources';\n\n  public function getFieldTypes() {\n    return array(\n      'sources' => 'list<Object>',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingRelaxationFields extends AbstractEnum {\n\n  const CUSTOM_AUDIENCE = 'custom_audience';\n  const LOOKALIKE = 'lookalike';\n\n  public function getFieldTypes() {\n    return array(\n      'custom_audience' => 'unsigned int',\n      'lookalike' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TargetingSentenceLineFields extends AbstractEnum {\n\n  const ID = 'id';\n  const PARAMS = 'params';\n  const TARGETINGSENTENCELINES = 'targetingsentencelines';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'params' => 'Targeting',\n      'targetingsentencelines' => 'list',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TextWithEntitiesFields extends AbstractEnum {\n\n  const TEXT = 'text';\n\n  public function getFieldTypes() {\n    return array(\n      'text' => 'string',\n    );\n  }\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass TrackingAndConversionWithDefaultsFields extends AbstractEnum {\n\n  const CUSTOM_CONVERSION = 'custom_conversion';\n  const CUSTOM_TRACKING = 'custom_tracking';\n  const DEFAULT_CONVERSION = 'default_conversion';\n  const DEFAULT_TRACKING = 'default_tracking';\n\n  public function getFieldTypes() {\n    return array(\n      'custom_conversion' => 'list<Object>',\n      'custom_tracking' => 'list<Object>',\n      'default_conversion' => 'list<Object>',\n      'default_tracking' => 'list<Object>',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UnifiedThreadFields extends AbstractEnum {\n\n  const CAN_REPLY = 'can_reply';\n  const FOLDER = 'folder';\n  const FORMER_PARTICIPANTS = 'former_participants';\n  const ID = 'id';\n  const IS_SUBSCRIBED = 'is_subscribed';\n  const LINK = 'link';\n  const LINKED_GROUP = 'linked_group';\n  const MESSAGE_COUNT = 'message_count';\n  const NAME = 'name';\n  const PARTICIPANTS = 'participants';\n  const SCOPED_THREAD_KEY = 'scoped_thread_key';\n  const SENDERS = 'senders';\n  const SNIPPET = 'snippet';\n  const SUBJECT = 'subject';\n  const UNREAD_COUNT = 'unread_count';\n  const UPDATED_TIME = 'updated_time';\n  const WALLPAPER = 'wallpaper';\n\n  public function getFieldTypes() {\n    return array(\n      'can_reply' => 'bool',\n      'folder' => 'string',\n      'former_participants' => 'Object',\n      'id' => 'string',\n      'is_subscribed' => 'bool',\n      'link' => 'string',\n      'linked_group' => 'Group',\n      'message_count' => 'int',\n      'name' => 'string',\n      'participants' => 'Object',\n      'scoped_thread_key' => 'string',\n      'senders' => 'Object',\n      'snippet' => 'string',\n      'subject' => 'string',\n      'unread_count' => 'int',\n      'updated_time' => 'datetime',\n      'wallpaper' => 'string',\n    );\n  }\n}\n", "num_lines": 80}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass URLFields extends AbstractEnum {\n\n  const ENGAGEMENT = 'engagement';\n  const ID = 'id';\n  const OG_OBJECT = 'og_object';\n  const OWNERSHIP_PERMISSIONS = 'ownership_permissions';\n  const SCOPES = 'scopes';\n\n  public function getFieldTypes() {\n    return array(\n      'engagement' => 'Object',\n      'id' => 'string',\n      'og_object' => 'Object',\n      'ownership_permissions' => 'Object',\n      'scopes' => 'Object',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserCoverPhotoFields extends AbstractEnum {\n\n  const OFFSET_X = 'offset_x';\n  const OFFSET_Y = 'offset_y';\n  const SOURCE = 'source';\n\n  public function getFieldTypes() {\n    return array(\n      'offset_x' => 'float',\n      'offset_y' => 'float',\n      'source' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserDeviceFields extends AbstractEnum {\n\n  const HARDWARE = 'hardware';\n  const OS = 'os';\n\n  public function getFieldTypes() {\n    return array(\n      'hardware' => 'string',\n      'os' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserFields extends AbstractEnum {\n\n  const ABOUT = 'about';\n  const AGE_RANGE = 'age_range';\n  const BIRTHDAY = 'birthday';\n  const COMMUNITY = 'community';\n  const COVER = 'cover';\n  const CURRENCY = 'currency';\n  const EDUCATION = 'education';\n  const EMAIL = 'email';\n  const FAVORITE_ATHLETES = 'favorite_athletes';\n  const FAVORITE_TEAMS = 'favorite_teams';\n  const FIRST_NAME = 'first_name';\n  const GENDER = 'gender';\n  const HOMETOWN = 'hometown';\n  const ID = 'id';\n  const ID_FOR_AVATARS = 'id_for_avatars';\n  const INSPIRATIONAL_PEOPLE = 'inspirational_people';\n  const INSTALL_TYPE = 'install_type';\n  const INSTALLED = 'installed';\n  const IS_GUEST_USER = 'is_guest_user';\n  const LANGUAGES = 'languages';\n  const LAST_NAME = 'last_name';\n  const LINK = 'link';\n  const LOCAL_NEWS_MEGAPHONE_DISMISS_STATUS = 'local_news_megaphone_dismiss_status';\n  const LOCAL_NEWS_SUBSCRIPTION_STATUS = 'local_news_subscription_status';\n  const LOCALE = 'locale';\n  const LOCATION = 'location';\n  const MEETING_FOR = 'meeting_for';\n  const MIDDLE_NAME = 'middle_name';\n  const NAME = 'name';\n  const NAME_FORMAT = 'name_format';\n  const PAYMENT_PRICEPOINTS = 'payment_pricepoints';\n  const POLITICAL = 'political';\n  const PROFILE_PIC = 'profile_pic';\n  const QUOTES = 'quotes';\n  const RELATIONSHIP_STATUS = 'relationship_status';\n  const SHARED_LOGIN_UPGRADE_REQUIRED_BY = 'shared_login_upgrade_required_by';\n  const SHORT_NAME = 'short_name';\n  const SIGNIFICANT_OTHER = 'significant_other';\n  const SPORTS = 'sports';\n  const SUPPORTS_DONATE_BUTTON_IN_LIVE_VIDEO = 'supports_donate_button_in_live_video';\n  const THIRD_PARTY_ID = 'third_party_id';\n  const TIMEZONE = 'timezone';\n  const TOKEN_FOR_BUSINESS = 'token_for_business';\n  const UPDATED_TIME = 'updated_time';\n  const VERIFIED = 'verified';\n  const VIDEO_UPLOAD_LIMITS = 'video_upload_limits';\n  const WEBSITE = 'website';\n\n  public function getFieldTypes() {\n    return array(\n      'about' => 'string',\n      'age_range' => 'AgeRange',\n      'birthday' => 'string',\n      'community' => 'Group',\n      'cover' => 'UserCoverPhoto',\n      'currency' => 'Currency',\n      'education' => 'list<Object>',\n      'email' => 'string',\n      'favorite_athletes' => 'list<Experience>',\n      'favorite_teams' => 'list<Experience>',\n      'first_name' => 'string',\n      'gender' => 'string',\n      'hometown' => 'Page',\n      'id' => 'string',\n      'id_for_avatars' => 'string',\n      'inspirational_people' => 'list<Experience>',\n      'install_type' => 'string',\n      'installed' => 'bool',\n      'is_guest_user' => 'bool',\n      'languages' => 'list<Experience>',\n      'last_name' => 'string',\n      'link' => 'string',\n      'local_news_megaphone_dismiss_status' => 'bool',\n      'local_news_subscription_status' => 'bool',\n      'locale' => 'string',\n      'location' => 'Page',\n      'meeting_for' => 'list<string>',\n      'middle_name' => 'string',\n      'name' => 'string',\n      'name_format' => 'string',\n      'payment_pricepoints' => 'PaymentPricepoints',\n      'political' => 'string',\n      'profile_pic' => 'string',\n      'quotes' => 'string',\n      'relationship_status' => 'string',\n      'shared_login_upgrade_required_by' => 'Object',\n      'short_name' => 'string',\n      'significant_other' => 'User',\n      'sports' => 'list<Experience>',\n      'supports_donate_button_in_live_video' => 'bool',\n      'third_party_id' => 'string',\n      'timezone' => 'float',\n      'token_for_business' => 'string',\n      'updated_time' => 'datetime',\n      'verified' => 'bool',\n      'video_upload_limits' => 'VideoUploadLimits',\n      'website' => 'string',\n    );\n  }\n}\n", "num_lines": 140}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserIDForAppFields extends AbstractEnum {\n\n  const APP = 'app';\n  const ID = 'id';\n\n  public function getFieldTypes() {\n    return array(\n      'app' => 'Application',\n      'id' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserIDForPageFields extends AbstractEnum {\n\n  const ID = 'id';\n  const PAGE = 'page';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'page' => 'Page',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserLeadGenDisclaimerResponseFields extends AbstractEnum {\n\n  const CHECKBOX_KEY = 'checkbox_key';\n  const IS_CHECKED = 'is_checked';\n\n  public function getFieldTypes() {\n    return array(\n      'checkbox_key' => 'string',\n      'is_checked' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserLeadGenFieldDataFields extends AbstractEnum {\n\n  const NAME = 'name';\n  const VALUES = 'values';\n\n  public function getFieldTypes() {\n    return array(\n      'name' => 'string',\n      'values' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserPageOneTimeOptInTokenSettingsFields extends AbstractEnum {\n\n  const CREATION_TIMESTAMP = 'creation_timestamp';\n  const NEXT_ELIGIBLE_TIME = 'next_eligible_time';\n  const NOTIFICATION_MESSAGES_FREQUENCY = 'notification_messages_frequency';\n  const NOTIFICATION_MESSAGES_REOPTIN = 'notification_messages_reoptin';\n  const NOTIFICATION_MESSAGES_TIMEZONE = 'notification_messages_timezone';\n  const NOTIFICATION_MESSAGES_TOKEN = 'notification_messages_token';\n  const RECIPIENT_ID = 'recipient_id';\n  const TOKEN_EXPIRY_TIMESTAMP = 'token_expiry_timestamp';\n  const TOPIC_TITLE = 'topic_title';\n  const USER_TOKEN_STATUS = 'user_token_status';\n  const ID = 'id';\n\n  public function getFieldTypes() {\n    return array(\n      'creation_timestamp' => 'int',\n      'next_eligible_time' => 'int',\n      'notification_messages_frequency' => 'string',\n      'notification_messages_reoptin' => 'string',\n      'notification_messages_timezone' => 'string',\n      'notification_messages_token' => 'string',\n      'recipient_id' => 'string',\n      'token_expiry_timestamp' => 'int',\n      'topic_title' => 'string',\n      'user_token_status' => 'string',\n      'id' => 'string',\n    );\n  }\n}\n", "num_lines": 68}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass UserPaymentMobilePricepointsFields extends AbstractEnum {\n\n  const MOBILE_COUNTRY = 'mobile_country';\n  const PHONE_NUMBER_LAST4 = 'phone_number_last4';\n  const PRICEPOINTS = 'pricepoints';\n  const USER_CURRENCY = 'user_currency';\n\n  public function getFieldTypes() {\n    return array(\n      'mobile_country' => 'string',\n      'phone_number_last4' => 'string',\n      'pricepoints' => 'list<Object>',\n      'user_currency' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass ValueBasedEligibleSourceFields extends AbstractEnum {\n\n  const ID = 'id';\n  const TITLE = 'title';\n  const TYPE = 'type';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'title' => 'string',\n      'type' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VehicleFields extends AbstractEnum {\n\n  const ADDRESS = 'address';\n  const APPLINKS = 'applinks';\n  const AVAILABILITY = 'availability';\n  const BODY_STYLE = 'body_style';\n  const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';\n  const CONDITION = 'condition';\n  const CURRENCY = 'currency';\n  const CUSTOM_LABEL_0 = 'custom_label_0';\n  const DATE_FIRST_ON_LOT = 'date_first_on_lot';\n  const DEALER_COMMUNICATION_CHANNEL = 'dealer_communication_channel';\n  const DEALER_EMAIL = 'dealer_email';\n  const DEALER_ID = 'dealer_id';\n  const DEALER_NAME = 'dealer_name';\n  const DEALER_PHONE = 'dealer_phone';\n  const DEALER_PRIVACY_POLICY_URL = 'dealer_privacy_policy_url';\n  const DESCRIPTION = 'description';\n  const DRIVETRAIN = 'drivetrain';\n  const EXTERIOR_COLOR = 'exterior_color';\n  const FB_PAGE_ID = 'fb_page_id';\n  const FEATURES = 'features';\n  const FUEL_TYPE = 'fuel_type';\n  const ID = 'id';\n  const IMAGE_FETCH_STATUS = 'image_fetch_status';\n  const IMAGES = 'images';\n  const INTERIOR_COLOR = 'interior_color';\n  const LEGAL_DISCLOSURE_IMPRESSUM_URL = 'legal_disclosure_impressum_url';\n  const MAKE = 'make';\n  const MILEAGE = 'mileage';\n  const MODEL = 'model';\n  const PREVIOUS_CURRENCY = 'previous_currency';\n  const PREVIOUS_PRICE = 'previous_price';\n  const PRICE = 'price';\n  const SALE_CURRENCY = 'sale_currency';\n  const SALE_PRICE = 'sale_price';\n  const SANITIZED_IMAGES = 'sanitized_images';\n  const STATE_OF_VEHICLE = 'state_of_vehicle';\n  const TITLE = 'title';\n  const TRANSMISSION = 'transmission';\n  const TRIM = 'trim';\n  const UNIT_PRICE = 'unit_price';\n  const URL = 'url';\n  const VEHICLE_ID = 'vehicle_id';\n  const VEHICLE_REGISTRATION_PLATE = 'vehicle_registration_plate';\n  const VEHICLE_SPECIFICATIONS = 'vehicle_specifications';\n  const VEHICLE_TYPE = 'vehicle_type';\n  const VIN = 'vin';\n  const VISIBILITY = 'visibility';\n  const YEAR = 'year';\n\n  public function getFieldTypes() {\n    return array(\n      'address' => 'Object',\n      'applinks' => 'CatalogItemAppLinks',\n      'availability' => 'string',\n      'body_style' => 'string',\n      'category_specific_fields' => 'CatalogSubVerticalList',\n      'condition' => 'string',\n      'currency' => 'string',\n      'custom_label_0' => 'string',\n      'date_first_on_lot' => 'string',\n      'dealer_communication_channel' => 'string',\n      'dealer_email' => 'string',\n      'dealer_id' => 'string',\n      'dealer_name' => 'string',\n      'dealer_phone' => 'string',\n      'dealer_privacy_policy_url' => 'string',\n      'description' => 'string',\n      'drivetrain' => 'string',\n      'exterior_color' => 'string',\n      'fb_page_id' => 'Page',\n      'features' => 'list<Object>',\n      'fuel_type' => 'string',\n      'id' => 'string',\n      'image_fetch_status' => 'ImageFetchStatus',\n      'images' => 'list<string>',\n      'interior_color' => 'string',\n      'legal_disclosure_impressum_url' => 'string',\n      'make' => 'string',\n      'mileage' => 'Object',\n      'model' => 'string',\n      'previous_currency' => 'string',\n      'previous_price' => 'string',\n      'price' => 'string',\n      'sale_currency' => 'string',\n      'sale_price' => 'string',\n      'sanitized_images' => 'list<string>',\n      'state_of_vehicle' => 'string',\n      'title' => 'string',\n      'transmission' => 'string',\n      'trim' => 'string',\n      'unit_price' => 'Object',\n      'url' => 'string',\n      'vehicle_id' => 'string',\n      'vehicle_registration_plate' => 'string',\n      'vehicle_specifications' => 'list<Object>',\n      'vehicle_type' => 'string',\n      'vin' => 'string',\n      'visibility' => 'Visibility',\n      'year' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 142}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VehicleOfferFields extends AbstractEnum {\n\n  const AMOUNT_CURRENCY = 'amount_currency';\n  const AMOUNT_PERCENTAGE = 'amount_percentage';\n  const AMOUNT_PRICE = 'amount_price';\n  const AMOUNT_QUALIFIER = 'amount_qualifier';\n  const APPLINKS = 'applinks';\n  const AVAILABILITY = 'availability';\n  const BODY_STYLE = 'body_style';\n  const CASHBACK_CURRENCY = 'cashback_currency';\n  const CASHBACK_PRICE = 'cashback_price';\n  const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';\n  const CURRENCY = 'currency';\n  const DMA_CODES = 'dma_codes';\n  const DOWNPAYMENT_CURRENCY = 'downpayment_currency';\n  const DOWNPAYMENT_PRICE = 'downpayment_price';\n  const DOWNPAYMENT_QUALIFIER = 'downpayment_qualifier';\n  const DRIVETRAIN = 'drivetrain';\n  const END_DATE = 'end_date';\n  const END_TIME = 'end_time';\n  const EXTERIOR_COLOR = 'exterior_color';\n  const FUEL_TYPE = 'fuel_type';\n  const GENERATION = 'generation';\n  const ID = 'id';\n  const IMAGE_FETCH_STATUS = 'image_fetch_status';\n  const IMAGES = 'images';\n  const INTERIOR_COLOR = 'interior_color';\n  const INTERIOR_UPHOLSTERY = 'interior_upholstery';\n  const MAKE = 'make';\n  const MODEL = 'model';\n  const OFFER_DESCRIPTION = 'offer_description';\n  const OFFER_DISCLAIMER = 'offer_disclaimer';\n  const OFFER_TYPE = 'offer_type';\n  const PRICE = 'price';\n  const SANITIZED_IMAGES = 'sanitized_images';\n  const START_DATE = 'start_date';\n  const START_TIME = 'start_time';\n  const TERM_LENGTH = 'term_length';\n  const TERM_QUALIFIER = 'term_qualifier';\n  const TITLE = 'title';\n  const TRANSMISSION = 'transmission';\n  const TRIM = 'trim';\n  const UNIT_PRICE = 'unit_price';\n  const URL = 'url';\n  const VEHICLE_OFFER_ID = 'vehicle_offer_id';\n  const VISIBILITY = 'visibility';\n  const YEAR = 'year';\n\n  public function getFieldTypes() {\n    return array(\n      'amount_currency' => 'string',\n      'amount_percentage' => 'float',\n      'amount_price' => 'string',\n      'amount_qualifier' => 'string',\n      'applinks' => 'CatalogItemAppLinks',\n      'availability' => 'string',\n      'body_style' => 'string',\n      'cashback_currency' => 'string',\n      'cashback_price' => 'string',\n      'category_specific_fields' => 'CatalogSubVerticalList',\n      'currency' => 'string',\n      'dma_codes' => 'list<string>',\n      'downpayment_currency' => 'string',\n      'downpayment_price' => 'string',\n      'downpayment_qualifier' => 'string',\n      'drivetrain' => 'string',\n      'end_date' => 'string',\n      'end_time' => 'int',\n      'exterior_color' => 'string',\n      'fuel_type' => 'string',\n      'generation' => 'string',\n      'id' => 'string',\n      'image_fetch_status' => 'ImageFetchStatus',\n      'images' => 'list<string>',\n      'interior_color' => 'string',\n      'interior_upholstery' => 'string',\n      'make' => 'string',\n      'model' => 'string',\n      'offer_description' => 'string',\n      'offer_disclaimer' => 'string',\n      'offer_type' => 'string',\n      'price' => 'string',\n      'sanitized_images' => 'list<string>',\n      'start_date' => 'string',\n      'start_time' => 'int',\n      'term_length' => 'unsigned int',\n      'term_qualifier' => 'string',\n      'title' => 'string',\n      'transmission' => 'string',\n      'trim' => 'string',\n      'unit_price' => 'Object',\n      'url' => 'string',\n      'vehicle_offer_id' => 'string',\n      'visibility' => 'Visibility',\n      'year' => 'int',\n    );\n  }\n}\n", "num_lines": 136}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoCopyrightConditionGroupFields extends AbstractEnum {\n\n  const ACTION = 'action';\n  const CONDITIONS = 'conditions';\n  const VALIDITY_STATUS = 'validity_status';\n\n  public function getFieldTypes() {\n    return array(\n      'action' => 'string',\n      'conditions' => 'list<Object>',\n      'validity_status' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoCopyrightFields extends AbstractEnum {\n\n  const CONTENT_CATEGORY = 'content_category';\n  const COPYRIGHT_CONTENT_ID = 'copyright_content_id';\n  const CREATOR = 'creator';\n  const EXCLUDED_OWNERSHIP_SEGMENTS = 'excluded_ownership_segments';\n  const ID = 'id';\n  const IN_CONFLICT = 'in_conflict';\n  const MONITORING_STATUS = 'monitoring_status';\n  const MONITORING_TYPE = 'monitoring_type';\n  const OWNERSHIP_COUNTRIES = 'ownership_countries';\n  const REFERENCE_FILE = 'reference_file';\n  const REFERENCE_FILE_DISABLED = 'reference_file_disabled';\n  const REFERENCE_FILE_DISABLED_BY_OPS = 'reference_file_disabled_by_ops';\n  const REFERENCE_OWNER_ID = 'reference_owner_id';\n  const RULE_IDS = 'rule_ids';\n  const TAGS = 'tags';\n  const WHITELISTED_IDS = 'whitelisted_ids';\n\n  public function getFieldTypes() {\n    return array(\n      'content_category' => 'string',\n      'copyright_content_id' => 'string',\n      'creator' => 'User',\n      'excluded_ownership_segments' => 'list<VideoCopyrightSegment>',\n      'id' => 'string',\n      'in_conflict' => 'bool',\n      'monitoring_status' => 'string',\n      'monitoring_type' => 'string',\n      'ownership_countries' => 'VideoCopyrightGeoGate',\n      'reference_file' => 'CopyrightReferenceContainer',\n      'reference_file_disabled' => 'bool',\n      'reference_file_disabled_by_ops' => 'bool',\n      'reference_owner_id' => 'string',\n      'rule_ids' => 'list<VideoCopyrightRule>',\n      'tags' => 'list<string>',\n      'whitelisted_ids' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 78}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoCopyrightGeoGateFields extends AbstractEnum {\n\n  const EXCLUDED_COUNTRIES = 'excluded_countries';\n  const INCLUDED_COUNTRIES = 'included_countries';\n\n  public function getFieldTypes() {\n    return array(\n      'excluded_countries' => 'list<string>',\n      'included_countries' => 'list<string>',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoCopyrightRuleFields extends AbstractEnum {\n\n  const CONDITION_GROUPS = 'condition_groups';\n  const COPYRIGHTS = 'copyrights';\n  const CREATED_DATE = 'created_date';\n  const CREATOR = 'creator';\n  const ID = 'id';\n  const IS_IN_MIGRATION = 'is_in_migration';\n  const NAME = 'name';\n\n  public function getFieldTypes() {\n    return array(\n      'condition_groups' => 'list<VideoCopyrightConditionGroup>',\n      'copyrights' => 'list<string>',\n      'created_date' => 'datetime',\n      'creator' => 'User',\n      'id' => 'string',\n      'is_in_migration' => 'bool',\n      'name' => 'string',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoCopyrightSegmentFields extends AbstractEnum {\n\n  const DURATION_IN_SEC = 'duration_in_sec';\n  const MEDIA_TYPE = 'media_type';\n  const START_TIME_IN_SEC = 'start_time_in_sec';\n\n  public function getFieldTypes() {\n    return array(\n      'duration_in_sec' => 'float',\n      'media_type' => 'string',\n      'start_time_in_sec' => 'float',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoListFields extends AbstractEnum {\n\n  const CREATION_TIME = 'creation_time';\n  const DESCRIPTION = 'description';\n  const ID = 'id';\n  const LAST_MODIFIED = 'last_modified';\n  const OWNER = 'owner';\n  const SEASON_NUMBER = 'season_number';\n  const THUMBNAIL = 'thumbnail';\n  const TITLE = 'title';\n  const VIDEOS_COUNT = 'videos_count';\n\n  public function getFieldTypes() {\n    return array(\n      'creation_time' => 'datetime',\n      'description' => 'string',\n      'id' => 'string',\n      'last_modified' => 'datetime',\n      'owner' => 'Object',\n      'season_number' => 'int',\n      'thumbnail' => 'string',\n      'title' => 'string',\n      'videos_count' => 'int',\n    );\n  }\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoPollFields extends AbstractEnum {\n\n  const CLOSE_AFTER_VOTING = 'close_after_voting';\n  const DEFAULT_OPEN = 'default_open';\n  const ID = 'id';\n  const QUESTION = 'question';\n  const SHOW_GRADIENT = 'show_gradient';\n  const SHOW_RESULTS = 'show_results';\n  const STATUS = 'status';\n\n  public function getFieldTypes() {\n    return array(\n      'close_after_voting' => 'bool',\n      'default_open' => 'bool',\n      'id' => 'string',\n      'question' => 'string',\n      'show_gradient' => 'bool',\n      'show_results' => 'bool',\n      'status' => 'Status',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoThumbnailFields extends AbstractEnum {\n\n  const HEIGHT = 'height';\n  const ID = 'id';\n  const IS_PREFERRED = 'is_preferred';\n  const NAME = 'name';\n  const SCALE = 'scale';\n  const URI = 'uri';\n  const WIDTH = 'width';\n\n  public function getFieldTypes() {\n    return array(\n      'height' => 'unsigned int',\n      'id' => 'string',\n      'is_preferred' => 'bool',\n      'name' => 'string',\n      'scale' => 'float',\n      'uri' => 'string',\n      'width' => 'unsigned int',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VideoUploadLimitsFields extends AbstractEnum {\n\n  const LENGTH = 'length';\n  const SIZE = 'size';\n\n  public function getFieldTypes() {\n    return array(\n      'length' => 'unsigned int',\n      'size' => 'int',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass VoipInfoFields extends AbstractEnum {\n\n  const HAS_MOBILE_APP = 'has_mobile_app';\n  const HAS_PERMISSION = 'has_permission';\n  const IS_CALLABLE = 'is_callable';\n  const IS_CALLABLE_WEBRTC = 'is_callable_webrtc';\n  const IS_PUSHABLE = 'is_pushable';\n  const REASON_CODE = 'reason_code';\n  const REASON_DESCRIPTION = 'reason_description';\n\n  public function getFieldTypes() {\n    return array(\n      'has_mobile_app' => 'bool',\n      'has_permission' => 'bool',\n      'is_callable' => 'bool',\n      'is_callable_webrtc' => 'bool',\n      'is_pushable' => 'bool',\n      'reason_code' => 'unsigned int',\n      'reason_description' => 'string',\n    );\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass WebAppLinkFields extends AbstractEnum {\n\n  const SHOULD_FALLBACK = 'should_fallback';\n  const URL = 'url';\n\n  public function getFieldTypes() {\n    return array(\n      'should_fallback' => 'bool',\n      'url' => 'string',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass WhatsAppBusinessAccountFields extends AbstractEnum {\n\n  const ACCOUNT_REVIEW_STATUS = 'account_review_status';\n  const ANALYTICS = 'analytics';\n  const BUSINESS_VERIFICATION_STATUS = 'business_verification_status';\n  const COUNTRY = 'country';\n  const CREATION_TIME = 'creation_time';\n  const CURRENCY = 'currency';\n  const ID = 'id';\n  const MESSAGE_TEMPLATE_NAMESPACE = 'message_template_namespace';\n  const NAME = 'name';\n  const ON_BEHALF_OF_BUSINESS_INFO = 'on_behalf_of_business_info';\n  const OWNER_BUSINESS = 'owner_business';\n  const OWNER_BUSINESS_INFO = 'owner_business_info';\n  const OWNERSHIP_TYPE = 'ownership_type';\n  const PRIMARY_FUNDING_ID = 'primary_funding_id';\n  const PURCHASE_ORDER_NUMBER = 'purchase_order_number';\n  const STATUS = 'status';\n  const TIMEZONE_ID = 'timezone_id';\n\n  public function getFieldTypes() {\n    return array(\n      'account_review_status' => 'string',\n      'analytics' => 'Object',\n      'business_verification_status' => 'string',\n      'country' => 'string',\n      'creation_time' => 'int',\n      'currency' => 'string',\n      'id' => 'string',\n      'message_template_namespace' => 'string',\n      'name' => 'string',\n      'on_behalf_of_business_info' => 'Object',\n      'owner_business' => 'Business',\n      'owner_business_info' => 'Object',\n      'ownership_type' => 'string',\n      'primary_funding_id' => 'string',\n      'purchase_order_number' => 'string',\n      'status' => 'string',\n      'timezone_id' => 'string',\n    );\n  }\n}\n", "num_lines": 80}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass WhatsAppBusinessPreVerifiedPhoneNumberFields extends AbstractEnum {\n\n  const CODE_VERIFICATION_STATUS = 'code_verification_status';\n  const CODE_VERIFICATION_TIME = 'code_verification_time';\n  const ID = 'id';\n  const PHONE_NUMBER = 'phone_number';\n  const VERIFICATION_EXPIRY_TIME = 'verification_expiry_time';\n\n  public function getFieldTypes() {\n    return array(\n      'code_verification_status' => 'string',\n      'code_verification_time' => 'datetime',\n      'id' => 'string',\n      'phone_number' => 'string',\n      'verification_expiry_time' => 'datetime',\n    );\n  }\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass WhatsAppBusinessProfileFields extends AbstractEnum {\n\n  const ID = 'id';\n  const NAME_VERIFICATION = 'name_verification';\n  const WHATSAPP_BUSINESS_API_DATA = 'whatsapp_business_api_data';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'name_verification' => 'Object',\n      'whatsapp_business_api_data' => 'Object',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass WindowsAppLinkFields extends AbstractEnum {\n\n  const APP_ID = 'app_id';\n  const APP_NAME = 'app_name';\n  const PACKAGE_FAMILY_NAME = 'package_family_name';\n  const URL = 'url';\n\n  public function getFieldTypes() {\n    return array(\n      'app_id' => 'string',\n      'app_name' => 'string',\n      'package_family_name' => 'string',\n      'url' => 'string',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass WindowsPhoneAppLinkFields extends AbstractEnum {\n\n  const APP_ID = 'app_id';\n  const APP_NAME = 'app_name';\n  const URL = 'url';\n\n  public function getFieldTypes() {\n    return array(\n      'app_id' => 'string',\n      'app_name' => 'string',\n      'url' => 'string',\n    );\n  }\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass WoodhengePurchasedPAYGReceiptFields extends AbstractEnum {\n\n  const ID = 'id';\n  const NUMBER_OF_SUBSCRIPTIONS_PURCHASED = 'number_of_subscriptions_purchased';\n  const PURCHASE_TIME = 'purchase_time';\n  const USER = 'user';\n\n  public function getFieldTypes() {\n    return array(\n      'id' => 'string',\n      'number_of_subscriptions_purchased' => 'int',\n      'purchase_time' => 'datetime',\n      'user' => 'User',\n    );\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Fields;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n */\n\nclass WorkUserFrontlineFields extends AbstractEnum {\n\n  const HAS_ACCESS = 'has_access';\n  const IS_FRONTLINE = 'is_frontline';\n\n  public function getFieldTypes() {\n    return array(\n      'has_access' => 'bool',\n      'is_frontline' => 'bool',\n    );\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Search;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static DemographicSearchClasses getInstance()\n */\nclass DemographicSearchClasses extends AbstractEnum {\n\n  const LIFE_EVENTS = 'life_events';\n  const POLITICS = 'politics';\n  const MARKETS = 'markets';\n  const INDUSTRIES = 'industries';\n  const INCOME = 'income';\n  const NET_WORTH = 'net_worth';\n  const HOME_TYPE = 'home_type';\n  const HOME_OWNERSHIP = 'home_ownership';\n  const HOME_VALUE = 'home_value';\n  const ETHNIC_AFFINITY = 'ethnic_affinity';\n  const GENERATION = 'generation';\n  const HOUSEHOLD_COMPOSITION = 'household_composition';\n  const MOMS = 'moms';\n  const OFFICE_TYPE = 'office_type';\n  const FAMILY_STATUSES = 'family_statuses';\n  const DEMOGRAPHICS = 'demographics';\n}\n", "num_lines": 51}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Search;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static TargetingSearchTypes getInstance()\n */\nclass TargetingSearchTypes extends AbstractEnum {\n\n  const COUNTRY = 'adcountry';\n  const EDUCATION = 'adeducationschool';\n  const EMPLOYER = 'adworkemployer';\n  const GEOLOCATION = 'adgeolocation';\n  const GEOLOCATIONMETA = 'adgeolocationmeta';\n  const INTEREST = 'adinterest';\n  const INTEREST_SUGGESTION = 'adinterestsuggestion';\n  const INTEREST_VALIDATE = 'adinterestvalid';\n  const KEYWORD = 'adkeyword';\n  const LOCALE = 'adlocale';\n  const MAJOR = 'adeducationmajor';\n  const POSITION = 'adworkposition';\n  const RADIUS_SUGGESTION = 'adradiussuggestion';\n  const TARGETING_CATEGORY = 'adTargetingCategory';\n  const ZIPCODE = 'adzipcode';\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * Class ActionSource\n *\n * Where the conversion event occurred.\n *\n * @package FacebookAds\\Object\\ServerSide\n */\nclass ActionSource extends AbstractEnum {\n\n  /**\n   * Conversion happened over email.\n   */\n  const EMAIL = 'email';\n\n  /**\n   * Conversion was made on your website.\n   */\n  const WEBSITE = 'website';\n\n  /**\n   * Conversion was made using your app.\n   */\n  const APP = 'app';\n\n  /**\n   * Conversion was made over the phone.\n   */\n  const PHONE_CALL = 'phone_call';\n\n  /**\n   * Conversion was made via a messaging app, SMS, or online messaging feature.\n   */\n  const CHAT = 'chat';\n\n  /**\n   * Conversion was made in person at your physical store.\n   */\n  const PHYSICAL_STORE = 'physical_store';\n\n  /**\n   * Conversion happened automatically, for example, a subscription renewal that\u00e2\u20ac\u2122s set on auto-pay each month.\n   */\n  const SYSTEM_GENERATED = 'system_generated';\n\n  /**\n   * Conversion happened in a way that is not listed.\n   */\n  const OTHER = 'other';\n}\n", "num_lines": 78}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\SimpleRequest;\nuse FacebookAds\\Exception\\Exception;\n\nuse ArrayAccess;\n\nclass AdsPixelSettings implements ArrayAccess {\n\n  /**\n   * @var string\n   */\n  const SIGNALS_JSON_CONFIG_PATH = 'signals/config/json';\n\n  /**\n   * Associative array for storing property values\n   * @var mixed[]\n   */\n  protected $container = array();\n\n   /**\n   * Constructor\n   * @param mixed[] $data Associated array of property value initializing the model\n   */\n  public function __construct(array $data = null) {\n    $this->container['enable_automatic_matching'] = isset($data['enableAutomaticMatching']) ? $data['enableAutomaticMatching'] : null;;\n    $this->container['enabled_automatic_matching_fields'] = isset($data['enabledAutomaticMatchingFields']) ? $data['enabledAutomaticMatchingFields'] : null;\n    $this->container['pixel_id'] = isset($data['pixel_id']) ? $data['pixel_id'] : null;\n  }\n\n  /**\n   * Factory method to build the settings given a pixel id\n   * @param string $pixelId\n   * @return AdsPixelId\n   */\n  public static function buildFromPixelId($pixelId){\n    $response = self::callPixelSettingsEndpoint($pixelId);\n    if( $response !== null ){\n      $jsonString = $response->getBody();\n      $pixelSettingsAsDict = json_decode($jsonString, true);\n      if (array_key_exists('errorMessage', $pixelSettingsAsDict)){\n        return null;\n      }\n      $pixelSettingsAsDict['matchingConfig']['pixel_id'] = $pixelId;\n      return new AdsPixelSettings($pixelSettingsAsDict['matchingConfig']);\n    }\n    return null;\n  }\n\n  /**\n   * @param string $pixelId\n   * @return SimpleRequest\n  */\n  private static function callPixelSettingsEndpoint($pixelId){\n    $path = sprintf(\"%s/%s/\", self::SIGNALS_JSON_CONFIG_PATH, $pixelId);\n    $client = new Client();\n    $request = new SimpleRequest($client);\n    $request->setPath($path);\n    try{\n      return $client->sendRequest($request);\n    }\n    catch(Exception $e){\n      return null;\n    }\n  }\n\n  /**\n   * Get Pixel Id.\n   * @return string pixel id\n   */\n  public function getPixelId() {\n    return $this->container['pixel_id'];\n  }\n\n\n  /**\n   * Sets Pixel id.\n   * @param string $pixelId\n   * @return $this\n   */\n  public function setPixelId($pixelId) {\n    $this->container['pixel_id'] = $pixelId;\n    return $this;\n  }\n\n  /**\n   * Get Enable automatic matching.\n   * @return bool enable automatic matching\n   */\n  public function getEnableAutomaticMatching() {\n    return $this->container['enable_automatic_matching'];\n  }\n\n\n  /**\n   * Sets Enable automatic matching.\n   * @param bool $enableAutomaticMatching\n   * @return $this\n   */\n  public function setEnableAutomaticMatching($enableAutomaticMatching) {\n    $this->container['enable_automatic_matching'] = $enableAutomaticMatching;\n    return $this;\n  }\n\n  /**\n   * Get Enabled automatic matching fields.\n   * @return array enabled automatic matching fields\n   */\n  public function getEnabledAutomaticMatchingFields() {\n    return $this->container['enabled_automatic_matching_fields'];\n  }\n\n\n  /**\n   * Sets Enabled automatic matching fields.\n   * @param array $enabledAutomaticMatchingFields\n   * @return $this\n   */\n  public function setEnabledAutomaticMatchingFields($enabledAutomaticMatchingFields) {\n    $this->container['enabled_automatic_matching_fields'] = $enabledAutomaticMatchingFields;\n    return $this;\n  }\n\n  /**\n   * Returns true if offset exists. False otherwise.\n   * @param integer $offset Offset\n   * @return boolean\n   */\n  public function offsetExists($offset) : bool {\n    return isset($this->container[$offset]);\n  }\n\n  /**\n   * Gets offset.\n   * @param integer $offset Offset\n   * @return mixed\n   */\n  public function offsetGet($offset) : mixed {\n    return isset($this->container[$offset]) ? $this->container[$offset] : null;\n  }\n\n  /**\n   * Sets value based on offset.\n   * @param integer $offset Offset\n   * @param mixed $value Value to be set\n   * @return void\n   */\n  public function offsetSet($offset, $value) : void {\n    if (is_null($offset)) {\n      $this->container[] = $value;\n    } else {\n      $this->container[$offset] = $value;\n    }\n  }\n\n  /**\n   * Unsets offset.\n   * @param integer $offset Offset\n   * @return void\n   */\n  public function offsetUnset($offset) : void {\n    unset($this->container[$offset]);\n  }\n\n  /**\n   * Gets the string presentation of the object\n   * @return string\n   */\n  public function __toString() {\n    if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n      return json_encode($this, JSON_PRETTY_PRINT);\n    }\n    return json_encode($this);\n  }\n\n}\n", "num_lines": 202}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse ArrayAccess;\n\nclass AppData implements ArrayAccess {\n\n  private $application_tracking_enabled;\n  private $advertiser_tracking_enabled;\n  private $app_user_id;\n  private $campaign_ids;\n  private $consider_views;\n  private $extinfo;\n  private $include_dwell_data;\n  private $include_video_data;\n  private $install_referrer;\n  private $installer_package;\n  private $receipt_data;\n  private $url_schemes;\n  private $windows_attribution_id;\n\n  protected static $param_types = array(\n    'application_tracking_enabled' => 'bool',\n    'advertiser_tracking_enabled' => 'bool',\n    'app_user_id' => 'string',\n    'campaign_ids' => 'string',\n    'consider_views' => 'bool',\n    'extinfo' => 'FacebookAds\\Object\\ServerSide\\ExtendedDeviceInfo',\n    'include_dwell_data' => 'bool',\n    'include_video_data' => 'bool',\n    'install_referrer' => 'string',\n    'installer_package' => 'string',\n    'receipt_data' => 'string',\n    'url_schemes' => 'string',\n    'windows_attribution_id' => 'string',\n  );\n\n  protected static $attributeMap = array(\n    'application_tracking_enabled' => 'application_tracking_enabled',\n    'advertiser_tracking_enabled' => 'advertiser_tracking_enabled',\n    'app_user_id' => 'app_user_id',\n    'campaign_ids' => 'campaign_ids',\n    'consider_views' => 'consider_views',\n    'extinfo' => 'extinfo',\n    'include_dwell_data' => 'include_dwell_data',\n    'include_video_data' => 'include_video_data',\n    'install_referrer' => 'install_referrer',\n    'installer_package' => 'installer_package',\n    'receipt_data' => 'receipt_data',\n    'url_schemes' => 'url_schemes',\n    'windows_attribution_id' => 'windows_attribution_id',\n  );\n\n  protected static $setters = array(\n    'application_tracking_enabled' => 'setApplicationTrackingEnabled',\n    'advertiser_tracking_enabled' => 'setAdvertiserTrackingEnabled',\n    'app_user_id' => 'setAppUserId',\n    'campaign_ids' => 'setCampaignIds',\n    'consider_views' => 'setConsiderViews',\n    'extinfo' => 'setExtinfo',\n    'include_dwell_data' => 'setIncludeDwellData',\n    'include_video_data' => 'setIncludeVideoData',\n    'install_referrer' => 'setInstallReferrer',\n    'installer_package' => 'setInstallerPackage',\n    'receipt_data' => 'setReceiptData',\n    'url_schemes' => 'setUrlSchemes',\n    'windows_attribution_id' => 'setWindowsAttributionId',\n  );\n\n  protected static $getters = array(\n    'application_tracking_enabled' => 'getApplicationTrackingEnabled',\n    'advertiser_tracking_enabled' => 'getAdvertiserTrackingEnabled',\n    'app_user_id' => 'getAppUserId',\n    'campaign_ids' => 'getCampaignIds',\n    'consider_views' => 'getConsiderViews',\n    'extinfo' => 'getExtinfo',\n    'include_dwell_data' => 'getIncludeDwellData',\n    'include_video_data' => 'getIncludeVideoData',\n    'install_referrer' => 'getInstallReferrer',\n    'installer_package' => 'getInstallerPackage',\n    'receipt_data' => 'getReceiptData',\n    'url_schemes' => 'getUrlSchemes',\n    'windows_attribution_id' => 'getWindowsAttributionId',\n  );\n\n  protected $container = array();\n\n  public function __construct(array $data = null) {\n    $this->container['application_tracking_enabled'] = isset($data['application_tracking_enabled']) ? $data['application_tracking_enabled'] : null;\n    $this->container['advertiser_tracking_enabled'] = isset($data['advertiser_tracking_enabled']) ? $data['advertiser_tracking_enabled'] : null;\n    $this->container['app_user_id'] = isset($data['app_user_id']) ? $data['app_user_id'] : null;\n    $this->container['campaign_ids'] = isset($data['campaign_ids']) ? $data['campaign_ids'] : null;\n    $this->container['consider_views'] = isset($data['consider_views']) ? $data['consider_views'] : null;\n    $this->container['extinfo'] = isset($data['extinfo']) ? $data['extinfo'] : null;\n    $this->container['include_dwell_data'] = isset($data['include_dwell_data']) ? $data['include_dwell_data'] : null;\n    $this->container['include_video_data'] = isset($data['include_video_data']) ? $data['include_video_data'] : null;\n    $this->container['install_referrer'] = isset($data['install_referrer']) ? $data['install_referrer'] : null;\n    $this->container['installer_package'] = isset($data['installer_package']) ? $data['installer_package'] : null;\n    $this->container['receipt_data'] = isset($data['receipt_data']) ? $data['receipt_data'] : null;\n    $this->container['url_schemes'] = isset($data['url_schemes']) ? $data['url_schemes'] : null;\n    $this->container['windows_attribution_id'] = isset($data['windows_attribution_id']) ? $data['windows_attribution_id'] : null;\n  }\n\n  public static function paramTypes() {\n    return $self::param_types;\n  }\n\n  public static function attributeMap() {\n    return self::$attributeMap;\n  }\n\n  public static function setters() {\n    return self::$setters;\n  }\n\n  public static function getters() {\n    return self::$getters;\n  }\n\n  /**\n   * show all the invalid properties with reasons.\n   *\n   * @return array invalid properties with reasons\n   */\n  public function listInvalidProperties() {\n    $invalid_properties = array();\n    return $invalid_properties;\n  }\n\n  /**\n   * validate all the properties in the model\n   * return true if all passed\n   *\n   * @return bool True if all properties are valid\n   */\n  public function valid() {\n    return true;\n  }\n\n  public function setApplicationTrackingEnabled($application_tracking_enabled) {\n    $this->container['application_tracking_enabled'] = $application_tracking_enabled;\n\n    return $this;\n  }\n\n  public function setAdvertiserTrackingEnabled($advertiser_tracking_enabled) {\n    $this->container['advertiser_tracking_enabled'] = $advertiser_tracking_enabled;\n\n    return $this;\n  }\n\n  public function setAppUserId($app_user_id) {\n    $this->container['app_user_id'] = $app_user_id;\n\n    return $this;\n  }\n\n  public function setCampaignIds($campaign_ids) {\n    $this->container['campaign_ids'] = $campaign_ids;\n\n    return $this;\n  }\n\n  public function setConsiderViews($consider_views) {\n    $this->container['consider_views'] = $consider_views;\n\n    return $this;\n  }\n\n  public function setExtinfo($extinfo) {\n    $this->container['extinfo'] = $extinfo;\n\n    return $this;\n  }\n\n  public function setIncludeDwellData($include_dwell_data) {\n    $this->container['include_dwell_data'] = $include_dwell_data;\n\n    return $this;\n  }\n\n  public function setIncludeVideoData($include_video_data) {\n    $this->container['include_video_data'] = $include_video_data;\n\n    return $this;\n  }\n\n  public function setInstallReferrer($install_referrer) {\n    $this->container['install_referrer'] = $install_referrer;\n\n    return $this;\n  }\n\n  public function setInstallerPackage($installer_package) {\n    $this->container['installer_package'] = $installer_package;\n\n    return $this;\n  }\n\n  public function setReceiptData($receipt_data) {\n    $this->container['receipt_data'] = $receipt_data;\n\n    return $this;\n  }\n\n  public function setUrlSchemes($url_schemes) {\n    $this->container['url_schemes'] = $url_schemes;\n\n    return $this;\n  }\n\n  public function  setWindowsAttributionId($windows_attribution_id) {\n    $this->container['windows_attribution_id'] = $windows_attribution_id;\n\n    return $this;\n  }\n\n  /**\n   * Returns true if offset exists. False otherwise.\n   * @param integer $offset Offset\n   * @return boolean\n   */\n  public function offsetExists($offset) : bool {\n    return isset($this->container[$offset]);\n  }\n\n  /**\n   * Gets offset.\n   * @param integer $offset Offset\n   * @return mixed\n   */\n  public function offsetGet($offset) : mixed {\n    return isset($this->container[$offset]) ? $this->container[$offset] : null;\n  }\n\n  /**\n   * Sets value based on offset.\n   * @param integer $offset Offset\n   * @param mixed $value Value to be set\n   * @return void\n   */\n  public function offsetSet($offset, $value) : void {\n    if (is_null($offset)) {\n      $this->container[] = $value;\n    } else {\n      $this->container[$offset] = $value;\n    }\n  }\n\n  /**\n   * Unsets offset.\n   * @param integer $offset Offset\n   * @return void\n   */\n  public function offsetUnset($offset) : void {\n    unset($this->container[$offset]);\n  }\n\n  /**\n   * Noramlize\n   * @return array\n   */\n  public function normalize() {\n    $normalized_payload = array();\n    \n    $normalized_payload['app_user_id']= $this->getAppUserId();\n    $normalized_payload['campaign_ids'] = $this->getCampaignIds();\n    $normalized_payload['consider_views'] = $this->getConsiderViews();\n    $normalized_payload['extinfo'] = isset($this->container['extinfo'])? $this->getExtinfo()->normalize() : null;\n    $normalized_payload['include_dwell_data'] = $this->getIncludeDwellData();\n    $normalized_payload['include_video_data']= $this->getIncludeVideoData();\n    $normalized_payload['install_referrer'] = $this->getInstallReferrer();\n    $normalized_payload['installer_package'] = $this->getInstallerPackage();\n    $normalized_payload['receipt_data'] = $this->getReceiptData();\n    $normalized_payload['url_schemes'] = $this->getUrlSchemes();\n    $normalized_payload['windows_attribution_id'] = $this->getWindowsAttributionId();\n\n    $normalized_payload = array_filter($normalized_payload);\n\n    // The following two booleans are set after array_filter because they are required and \n    // shouldn't be removed when falsy\n    $normalized_payload['application_tracking_enabled'] = $this->getApplicationTrackingEnabled();\n    $normalized_payload['advertiser_tracking_enabled'] = $this->getAdvertiserTrackingEnabled();\n\n    return $normalized_payload;\n  }\n\n  public function getApplicationTrackingEnabled() {\n    return $this->container['application_tracking_enabled'];\n  }\n\n  public function getAdvertiserTrackingEnabled() {\n    return $this->container['advertiser_tracking_enabled'];\n  }\n\n  public function getAppUserId() {\n    return $this->container['app_user_id'];\n  }\n\n  public function getCampaignIds() {\n    return $this->container['campaign_ids'];\n  }\n\n  public function getConsiderViews() {\n    return $this->container['consider_views'];\n  }\n\n  public function getExtinfo() {\n    return $this->container['extinfo'];\n  }\n\n  public function getIncludeDwellData() {\n    return $this->container['include_dwell_data'];\n  }\n\n  public function getIncludeVideoData() {\n    return $this->container['include_video_data'];\n  }\n\n  public function getInstallReferrer() {\n    return $this->container['install_referrer'];\n  }\n\n  public function getInstallerPackage() {\n    return $this->container['installer_package'];\n  }\n\n  public function getReceiptData() {\n    return $this->container['receipt_data'];\n  }\n\n  public function getUrlSchemes() {\n    return $this->container['url_schemes'];\n  }\n\n  public function  getWindowsAttributionId() {\n    return $this->container['windows_attribution_id'];\n  }\n\n  /**\n   * Gets the string presentation of the object\n   * @return string\n   */\n  public function __toString() {\n    if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n      return json_encode($this, JSON_PRETTY_PRINT);\n    }\n\n    return json_encode($this);\n  }\n\n}\n", "num_lines": 376}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse FacebookAds\\Api;\n\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\HandlerStack;\nuse GuzzleHttp\\Handler\\CurlHandler;\n\nclass AsyncClient extends Singleton {\n  protected $client = null;\n\n  public function __construct() {\n    $handler_stack = HandlerStack::create(new CurlHandler([\n      'options' => [\n        CURLOPT_CONNECTTIMEOUT => 10,\n        CURLOPT_TIMEOUT => 60,\n        CURLOPT_RETURNTRANSFER => true,\n        CURLOPT_HEADER => true,\n        CURLOPT_CAINFO => Api::instance()->getHttpClient()->getCaBundlePath(),\n      ]\n    ]));\n\n    $this->client = new Client(['handler' => $handler_stack]);\n  }\n\n  public function getClient() {\n    return $this->client;\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse GuzzleHttp\\Promise;\n\nclass BatchProcessor {\n  protected $batch_size;\n  protected $concurrent_requests;\n  protected $pixel_id;\n\n  /**\n   * Constructor\n   * @param int $pixel_id\n   * @param int $batch_size\n   * @param int $concurrent_requests\n   */\n  public function __construct($pixel_id, $batch_size = 50, $concurrent_requests = 4) {\n    $this->pixel_id = $pixel_id;\n    // Note: batch_size is only used in processEvents and processEventsGenerator\n    $this->batch_size = $batch_size;\n    $this->concurrent_requests = $concurrent_requests;\n  }\n\n  /**\n   * Processes events that have identical event_request params\n   * @param array $event_request_params\n   * @param array|\\FacebookAds\\Object\\ServerSide\\Event $events\n   * @return void\n   */\n  public function processEvents($event_request_params, $events) {\n    $generator = $this->processEventsGenerator($event_request_params, $events);\n    foreach ($generator as $promises) {\n      Promise\\unwrap($promises);\n    }\n  }\n\n  /**\n   * This generator returns event_requests promises for events that have identical event_request params\n   * @param array $event_request_params\n   * @param array|\\FacebookAds\\Object\\ServerSide\\Event $events\n   * @return Generator|array|\\GuzzleHttp\\Promise\\PromiseInterface $promises\n   */\n  public function processEventsGenerator($event_request_params, $events) {\n    $index = 0;\n    while ($index < count($events)) {\n      $promises = [];\n\n      while ($index < count($events) && count($promises) < $this->concurrent_requests) {\n        $params = array_merge(\n          array('events' => array_slice($events, $index, $this->batch_size)),\n          $event_request_params\n        );\n        $event_request = new EventRequestAsync(\n          $this->pixel_id,\n          $params\n        );\n\n        $promises[] = $event_request->execute();\n        $index += $this->batch_size;\n      }\n\n      yield $promises;\n    }\n  }\n\n  /**\n   * Processes async event_requests\n   * @param array|\\FacebookAds\\Object\\ServerSide\\EventRequestAsync $event_requests_async\n   * @return void\n   */\n  public function processEventRequests($event_requests_async) {\n    $generator = $this->processEventRequestsGenerator($event_requests_async);\n    foreach ($generator as $promises) {\n      Promise\\unwrap($promises);\n    }\n  }\n\n  /**\n   * This generator returns event_requests promises\n   * @param array|\\FacebookAds\\Object\\ServerSide\\EventRequestAsync $event_requests_async\n   * @return Generator|array|\\GuzzleHttp\\Promise\\PromiseInterface $promises\n   */\n  public function processEventRequestsGenerator($event_requests_async) {\n    $index = 0;\n    while ($index < count($event_requests_async)) {\n      $promises = [];\n\n      $offset = 0;\n      while (($index + $offset) < count($event_requests_async) && count($promises) < $this->concurrent_requests) {\n        $promises[] = $event_requests_async[$index + $offset]->execute();\n        $offset += 1;\n      }\n      $index += $offset;\n\n      yield $promises;\n    }\n  }\n}\n", "num_lines": 122}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse Exception;\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse GuzzleHttp\\Utils;\nuse Psr\\Http\\Message\\ResponseInterface;\n\n/**\n * Implementation of Custom Endpoint Request that sends events to CAPIG /events endpoint\n *\n * @category Class\n */\nclass CAPIGatewayEndpoint implements CustomEndpointRequest {\n    private Client $client;\n    private string $access_key;\n    private string $endpoint_URL;\n    private bool $sendToEndpointOnly;\n    private ?Filter $filter = null;\n\n    /**\n     * Constructor\n     * @param string $endpoint_URL endpoint_URL\n     * @param string $access_key access_key\n     * @throws Exception\n     */\n    public function __construct(string $endpoint_URL, string $access_key) {\n        $this->validateEndpoint($endpoint_URL);\n        $this->endpoint_URL = $endpoint_URL;\n        $this->access_key = $access_key;\n        $this->client= new Client(['headers' => ['Content-Type' => 'application/json; charset=utf-8']]);\n        $this->sendToEndpointOnly = false;\n    }\n\n    /**\n     * Validates URL\n     * @param string $endpoint_URL\n     * @throws Exception\n     */\n    private function validateEndpoint(string $endpoint_URL):void {\n        if (!filter_var($endpoint_URL, FILTER_VALIDATE_URL)) {\n            throw new Exception('URL is in invalid format ');\n        }\n    }\n\n    /**\n     * Synchronously send events to specified CAPIG /events endpoint\n     * @throws GuzzleException\n     * @throws Exception\n     */\n    public function sendEvent(string $pixel_id, array $events): CustomEndpointResponse\n    {\n        try {\n            if (!is_null($this->filter)) {\n                $events = array_filter($events, function(Event $var){\n                    return $this->filter->shouldSendEvent($var);\n                });\n            }\n            if (count($events) == 0) {\n                return new CustomEndpointResponse(array('message' => 'No events to send'));\n            }\n            $response = $this->client->request('POST', $this->endpoint_URL.'/capi/'.$pixel_id.'/events', ['http_errors'=> false, 'body' => $this->createRequestBody($events)]);\n            if ($response->getStatusCode() != '202') {\n                // a HTTP response code of 202 means the events were accepted\n                throw new Exception('Server response code is '.$response->getStatusCode().' expect: 202');\n            } else {\n                return new CustomEndpointResponse(array('message' => $response->getBody()->getContents(), 'response_code'=> $response->getStatusCode()));\n            }\n        } catch (Exception $e) {\n            throw new Exception('Server failed to accept events. '.$e->getMessage());\n        }\n    }\n\n    /**\n     * Asynchronously send events to specified CAPIG /events endpoint\n     * @throws Exception\n     * returns PromiseInterface\n     */\n    public function sendEventAsync(string $pixel_id, array $events): PromiseInterface\n    {\n        if (!is_null($this->filter)) {\n            $events = array_filter($events, function (Event $var) {\n                return $this->filter->shouldSendEvent($var);\n            });\n        }\n        $promise = $this->client->requestAsync('POST', $this->endpoint_URL.'/capi/'.$pixel_id.'/events', ['http_errors'=> false, 'body' => $this->createRequestBody($events)]);\n        $promise->then(\n            function (ResponseInterface $response) {\n                if ($response->getStatusCode() != '202') {\n                    // a HTTP response code of 202 means the events were accepted\n                    throw new Exception('Server response code is '.$response->getStatusCode().' expect: 202');\n                } else {\n                    return new CustomEndpointResponse(array('message' => $response->getBody()->getContents(), 'response_code'=> $response->getStatusCode()));\n                }\n            },\n            function (RequestException $e) {\n                throw new Exception('Server failed to accept events. '.$e->getMessage());\n            }\n        );\n        return $promise;\n    }\n\n    private function createRequestBody($events): string\n    {\n        $events = $this->normalize($events);\n        $body = array();\n        $body['data'] = $events;\n        $body['accessKey'] = $this->access_key;\n        return Utils::jsonEncode($body);\n    }\n\n    private function normalize(array $events): array\n    {\n        // we need to normalize the event fields before sending\n        $normalized_events = array();\n        foreach ($events as $event) {\n            $normalized_event = $event->normalize();\n            $normalized_events[] = $normalized_event;\n        }\n        return $normalized_events;\n    }\n\n    public function setFilter(Filter $filter)\n    {\n        $this->filter = $filter;\n    }\n\n    public function setSendToEndpointOnly(bool $setSendToEndpointOnly)\n    {\n        $this->sendToEndpointOnly = $setSendToEndpointOnly;\n    }\n\n    public function isSendToEndpointOnly(): bool\n    {\n        return $this->sendToEndpointOnly;\n    }\n\n    public function getEndpoint(): string\n    {\n        return $this->endpoint_URL;\n    }\n}\n\n", "num_lines": 170}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse ArrayAccess;\n\nclass Content implements ArrayAccess {\n  /**\n   * Associative array for storing property values\n   * @var mixed[]\n   */\n  protected $container = array();\n\n  /**\n   * Constructor\n   * @param mixed[] $data Associated array of property value initializing the model\n   */\n  public function __construct(array $data = null) {\n    $this->container['product_id'] = isset($data['product_id']) ? $data['product_id'] : null;;\n    $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null;\n    $this->container['item_price'] = isset($data['item_price']) ? $data['item_price'] : null;\n    $this->container['title'] = isset($data['title']) ? $data['title'] : null;\n    $this->container['description'] = isset($data['description']) ? $data['description'] : null;\n    $this->container['brand'] = isset($data['brand']) ? $data['brand'] : null;\n    $this->container['category'] = isset($data['category']) ? $data['category'] : null;\n    $this->container['delivery_category'] = isset($data['delivery_category']) ? $data['delivery_category'] : null;\n  }\n\n\n  /**\n   * Get Product Id.\n   * @return string Product Id\n   */\n  public function getProductId() {\n    return $this->container['product_id'];\n  }\n\n\n  /**\n   * Sets product id.\n   * @param string $product_id product id\n   * @return $this\n   */\n  public function setProductId($product_id) {\n    $this->container['product_id'] = $product_id;\n    return $this;\n  }\n\n\n  /**\n   * Get number of product.\n   * @return integer quantity\n   */\n  public function getQuantity() {\n    return $this->container['quantity'];\n  }\n\n  /**\n   * Set number of product.\n   * @param integer $quantity number of items\n   * @return $this\n   */\n  public function setQuantity($quantity) {\n    $this->container['quantity'] = $quantity;\n    return $this;\n  }\n\n\n  /**\n   * Get Item Price.\n   * @return float Item Price\n   */\n  public function getItemPrice() {\n    return $this->container['item_price'];\n  }\n\n  /**\n   * Set Item Price.\n   * @param float $item_price single item price\n   * @return Content\n   */\n  public function setItemPrice($item_price) {\n    $this->container['item_price'] = $item_price;\n    return $this;\n  }\n\n\n  /**\n   * Get title.\n   * @return string title\n   */\n  public function getTitle() {\n    return $this->container['title'];\n  }\n\n  /**\n   * Sets title.\n   * @param string $title title\n   * @return $this\n   */\n  public function setTitle($title) {\n    $this->container['title'] = $title;\n    return $this;\n  }\n\n\n  /**\n   * Get description.\n   * @return string description\n   */\n  public function getDescription() {\n    return $this->container['description'];\n  }\n\n  /**\n   * Sets description.\n   * @param string $description description\n   * @return $this\n   */\n  public function setDescription($description) {\n    $this->container['description'] = $description;\n    return $this;\n  }\n\n\n  /**\n   * Get brand.\n   * @return string brand\n   */\n  public function getBrand() {\n    return $this->container['brand'];\n  }\n\n  /**\n   * Sets brand.\n   * @param string $brand brand\n   * @return $this\n   */\n  public function setBrand($brand) {\n    $this->container['brand'] = $brand;\n    return $this;\n  }\n\n\n  /**\n   * Get category.\n   * @return string category\n   */\n  public function getCategory() {\n    return $this->container['category'];\n  }\n\n  /**\n   * Sets category.\n   * @param string $category category\n   * @return $this\n   */\n  public function setCategory($category) {\n    $this->container['category'] = $category;\n    return $this;\n  }\n\n  /**\n   * Gets Type of delivery for a purchase event.\n   * @return string delivery_category\n   */\n  public function getDeliveryCategory() {\n    return $this->container['delivery_category'];\n  }\n\n  /**\n   * Sets Type of delivery for a purchase event.\n   * @param string $delivery_category\n   * @return $this\n   */\n  public function setDeliveryCategory($delivery_category) {\n    $this->container['delivery_category'] = $delivery_category;\n    return $this;\n  }\n\n  /**\n   * Returns true if offset exists. False otherwise.\n   * @param integer $offset Offset\n   * @return boolean\n   */\n  public function offsetExists($offset) : bool {\n    return isset($this->container[$offset]);\n  }\n\n  /**\n   * Gets offset.\n   * @param integer $offset Offset\n   * @return mixed\n   */\n  public function offsetGet($offset) : mixed {\n    return isset($this->container[$offset]) ? $this->container[$offset] : null;\n  }\n\n  /**\n   * Sets value based on offset.\n   * @param integer $offset Offset\n   * @param mixed $value Value to be set\n   * @return void\n   */\n  public function offsetSet($offset, $value) : void {\n    if (is_null($offset)) {\n      $this->container[] = $value;\n    } else {\n      $this->container[$offset] = $value;\n    }\n  }\n\n  /**\n   * Unsets offset.\n   * @param integer $offset Offset\n   * @return void\n   */\n  public function offsetUnset($offset) : void {\n    unset($this->container[$offset]);\n  }\n\n  /**\n   * Gets the string presentation of the object\n   * @return string\n   */\n  public function __toString() {\n    if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n      return json_encode($this, JSON_PRETTY_PRINT);\n    }\n\n    return json_encode($this);\n  }\n\n  /**\n   * Normalize\n   * @return array\n   */\n  public function normalize() {\n    $normalized_payload = array(\n      'id' => $this->container['product_id'],\n      'quantity' => $this->container['quantity'],\n      'item_price' => $this->container['item_price'],\n      'title' => $this->container['title'],\n      'description' => $this->container['description'],\n      'brand' => $this->container['brand'],\n      'category' => $this->container['category'],\n      'delivery_category' => Normalizer::normalize(\n        'delivery_category', $this->container['delivery_category']\n      ),\n    );\n\n    $normalized_payload = array_filter($normalized_payload);\n\n    return $normalized_payload;\n  }\n\n}\n", "num_lines": 280}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse ArrayAccess;\nuse InvalidArgumentException;\n\n\nclass CustomData implements ArrayAccess {\n\n  /**\n   * Array of property to type mappings. Used for (de)serialization\n   * @var string[]\n   */\n  protected static $param_types = array(\n    'value' => 'float',\n    'currency' => 'string',\n    'content_name' => 'string',\n    'content_category' => 'string',\n    'content_ids' => 'string[]',\n    'contents' => 'object[]',\n    'content_type' => 'string',\n    'order_id' => 'string',\n    'predicted_ltv' => 'float',\n    'num_items' => 'string',\n    'status' => 'string',\n    'search_string' => 'string',\n    'item_number' => 'string',\n    'delivery_category' => 'string',\n    'custom_properties' => 'array'\n  );\n  /**\n   * Array of attributes where the key is the local name, and the value is the original name\n   * @var string[]\n   */\n  protected static $attributeMap = array(\n    'value' => 'value',\n    'currency' => 'currency',\n    'content_name' => 'content_name',\n    'content_category' => 'content_category',\n    'content_ids' => 'content_ids',\n    'contents' => 'contents',\n    'content_type' => 'content_type',\n    'order_id' => 'order_id',\n    'predicted_ltv' => 'predicted_ltv',\n    'num_items' => 'num_items',\n    'status' => 'status',\n    'search_string' => 'search_string',\n    'item_number' => 'item_number',\n    'delivery_category' => 'delivery_category',\n    'custom_properties' => 'custom_properties'\n  );\n  /**\n   * Array of attributes to setter functions (for deserialization of responses)\n   * @var string[]\n   */\n  protected static $setters = array(\n    'value' => 'setValue',\n    'currency' => 'setCurrency',\n    'content_name' => 'setContentName',\n    'content_category' => 'setContentCategory',\n    'content_ids' => 'setContentIds',\n    'contents' => 'setContents',\n    'content_type' => 'setContentType',\n    'order_id' => 'setOrderId',\n    'predicted_ltv' => 'setPredictedLtv',\n    'num_items' => 'setNumItems',\n    'status' => 'setStatus',\n    'search_string' => 'setSearchString',\n    'item_number' => 'setItemNumber',\n    'delivery_category' => 'setDeliveryCategory',\n    'custom_properties' => 'setCustomProperties'\n  );\n  /**\n   * Array of attributes to getter functions (for serialization of requests)\n   * @var string[]\n   */\n  protected static $getters = array(\n    'value' => 'getValue',\n    'currency' => 'getCurrency',\n    'content_name' => 'getContentName',\n    'content_category' => 'getContentCategory',\n    'content_ids' => 'getContentIds',\n    'contents' => 'getContents',\n    'content_type' => 'getContentType',\n    'order_id' => 'getOrderId',\n    'predicted_ltv' => 'getPredictedLtv',\n    'num_items' => 'getNumItems',\n    'status' => 'getStatus',\n    'search_string' => 'getSearchString',\n    'item_number' => 'getItemNumber',\n    'delivery_category' => 'getDeliveryCategory',\n    'custom_properties' => 'getCustomProperties'\n  );\n  /**\n   * Associative array for storing property values\n   * @var mixed[]\n   */\n  protected $container = array();\n\n  /**\n   * Constructor\n   * @param mixed[] $data Associated array of property value initializing the model\n   */\n  public function __construct(array $data = null) {\n    $this->container['value'] = isset($data['value']) ? $data['value'] : null;\n    $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null;\n    $this->container['content_name'] = isset($data['content_name']) ? $data['content_name'] : null;\n    $this->container['content_category'] = isset($data['content_category']) ? $data['content_category'] : null;\n    $this->container['content_ids'] = isset($data['content_ids']) ? $data['content_ids'] : null;\n    $this->container['contents'] = isset($data['contents']) ? $data['contents'] : null;\n    $this->container['content_type'] = isset($data['content_type']) ? $data['content_type'] : null;\n    $this->container['order_id'] = isset($data['order_id']) ? $data['order_id'] : null;\n    $this->container['predicted_ltv'] = isset($data['predicted_ltv']) ? $data['predicted_ltv'] : null;\n    $this->container['num_items'] = isset($data['num_items']) ? $data['num_items'] : null;\n    $this->container['status'] = isset($data['status']) ? $data['status'] : null;\n    $this->container['search_string'] = isset($data['search_string']) ? $data['search_string'] : null;\n    $this->container['item_number'] = isset($data['item_number']) ? $data['item_number'] : null;\n    $this->container['delivery_category'] = isset($data['delivery_category']) ? $data['delivery_category'] : null;\n    $this->container['custom_properties'] = isset($data['custom_properties']) ? $data['custom_properties'] : null;\n  }\n\n  public static function paramTypes() {\n    return self::$param_types;\n  }\n\n  public static function attributeMap() {\n    return self::$attributeMap;\n  }\n\n  public static function setters() {\n    return self::$setters;\n  }\n\n  public static function getters() {\n    return self::$getters;\n  }\n\n  /**\n   * show all the invalid properties with reasons.\n   *\n   * @return array invalid properties with reasons\n   */\n  public function listInvalidProperties() {\n    $invalid_properties = array();\n    return $invalid_properties;\n  }\n\n  /**\n   * validate all the properties in the model\n   * return true if all passed\n   *\n   * @return bool True if all properteis are valid\n   */\n  public function valid() {\n    return true;\n  }\n\n  /**\n   * Sets value\n   * @param float $value A numeric value associated with this event.\n   *         This could be a monetary value or a value in some other metric.\n   * @return $this\n   */\n  public function setValue($value) {\n    $this->container['value'] = $value;\n\n    return $this;\n  }\n\n  /**\n   * Sets currency\n   * @param string $currency The currency for the value specified, if applicable.\n   *          Currency must be a valid ISO 4217 three digit currency code.\n   * @return $this\n   */\n  public function setCurrency($currency) {\n    $this->container['currency'] = $currency;\n\n    return $this;\n  }\n\n  /**\n   * Sets content_name\n   * @param string $content_name The name of the page or product associated with the event. Example: 'lettuce'.\n   * @return $this\n   */\n  public function setContentName($content_name) {\n    $this->container['content_name'] = $content_name;\n\n    return $this;\n  }\n\n  /**\n   * Sets content_category\n   * @param string $content_category The category of the content associated with the event. Example: 'grocery'\n   * @return $this\n   */\n  public function setContentCategory($content_category) {\n    $this->container['content_category'] = $content_category;\n\n    return $this;\n  }\n\n  /**\n   * Sets content_ids\n   * @param string[] $content_ids The content IDs associated with the event,\n   *      such as product SKUs for items in an AddToCart event: ['ABC123', 'XYZ789'].\n   *      If content_type is a product, then your content IDs must be an array with a single string value.\n   *      Otherwise, this array can contain any number of string values.\n   * @return $this\n   */\n  public function setContentIds($content_ids) {\n    $this->container['content_ids'] = $content_ids;\n\n    return $this;\n  }\n\n  /**\n   * Sets contents\n   * @param Content[] $contents A list of Content objects that contain the product IDs associated with\n   *          the event plus information about the products.\n   * @return $this\n   */\n  public function setContents($contents) {\n    $this->container['contents'] = $contents;\n\n    return $this;\n  }\n\n  /**\n   * Sets content_type\n   * @param string $content_type A String equal to either 'product' or 'product_group'.\n   *      Set to product if the keys you send content_ids or contents represent products.\n   *      Set to product_group if the keys you send in content_ids represent product groups.\n   * @return $this\n   */\n  public function setContentType($content_type) {\n    $this->container['content_type'] = $content_type;\n\n    return $this;\n  }\n\n  /**\n   * Sets order_id\n   * @param string $order_id The order ID for this transaction as a String.\n   * @return $this\n   */\n  public function setOrderId($order_id) {\n    $this->container['order_id'] = $order_id;\n\n    return $this;\n  }\n\n  /**\n   * Sets predicted_ltv\n   * @param float $predicted_ltv The predicted lifetime value of a conversion event.\n   * @return $this\n   */\n  public function setPredictedLtv($predicted_ltv) {\n    $this->container['predicted_ltv'] = $predicted_ltv;\n\n    return $this;\n  }\n\n  /**\n   * Sets num_items\n   * @param string $num_items Use only with InitiateCheckout events.\n   *      The number of items that a user tries to buy during checkout.\n   * @return $this\n   */\n  public function setNumItems($num_items) {\n    $this->container['num_items'] = $num_items;\n\n    return $this;\n  }\n\n  /**\n   * Sets status\n   * @param string $status Use only with CompleteRegistration events.\n   *      The status of the registration event.\n   * @return $this\n   */\n  public function setStatus($status) {\n    $this->container['status'] = $status;\n\n    return $this;\n  }\n\n  /**\n   * Sets a search query made by a user. Use only with Search events.\n   * @param string $search_string Use only with Search events.\n   *      A search query made by a user.\n   * @return $this\n   */\n  public function setSearchString($search_string) {\n    $this->container['search_string'] = $search_string;\n\n    return $this;\n  }\n\n  /**\n   * Sets Type of delivery for a purchase event.\n   * @param string $delivery_category Type of delivery for a purchase event.\n   * @return $this\n   */\n  public function setDeliveryCategory($delivery_category) {\n    $this->container['delivery_category'] = $delivery_category;\n\n    return $this;\n  }\n\n  /**\n   * Sets the item_number.\n   * @param string $item_number The item number.\n   * @return $this\n   */\n  public function setItemNumber($item_number) {\n    $this->container['item_number'] = $item_number;\n\n    return $this;\n  }\n\n  /**\n   * Sets custom_properties that are not defined as the standard properties list in custom data.\n   * @param array custom_properties dictionary to include custom properties that are not defined in custom data.\n   * @return $this\n   */\n  public function setCustomProperties($custom_properties) {\n    $this->container['custom_properties'] = $custom_properties;\n    return $this;\n  }\n\n  /**\n   * Returns true if offset exists. False otherwise.\n   * @param integer $offset Offset\n   * @return boolean\n   */\n  public function offsetExists($offset) : bool {\n    return isset($this->container[$offset]);\n  }\n\n  /**\n   * Gets offset.\n   * @param integer $offset Offset\n   * @return mixed\n   */\n  public function offsetGet($offset) : mixed {\n    return isset($this->container[$offset]) ? $this->container[$offset] : null;\n  }\n\n  /**\n   * Sets value based on offset.\n   * @param integer $offset Offset\n   * @param mixed $value Value to be set\n   * @return void\n   */\n  public function offsetSet($offset, $value) : void {\n    if (is_null($offset)) {\n      $this->container[] = $value;\n    } else {\n      $this->container[$offset] = $value;\n    }\n  }\n\n  /**\n   * Unsets offset.\n   * @param integer $offset Offset\n   * @return void\n   */\n  public function offsetUnset($offset) : void {\n    unset($this->container[$offset]);\n  }\n\n  /**\n   * Add a custom property to the custom_properties bag\n   * @param $key Custom property name\n   * @param $value Custom property value\n   * @return void\n   */\n  public function addCustomProperty($key, $value) {\n    $this->container['custom_properties'][$key] = $value;\n  }\n\n  /**\n   * Gets the value of a custom property from the custom_properties bag\n   * @param $key Custom property name\n   * @return string\n   */\n  public function getCustomProperty($key) {\n    if (array_key_exists(\n      $key, $this->container['custom_properties'])) {\n      return $this->container['custom_properties'][$key];\n    } else {\n      throw new \\Exception(\"Key not found in custom properties:'\" . $key . \"'\");\n    }\n  }\n\n  public function normalize() {\n    $normalized_payload = array();\n\n    $normalized_payload['value'] = $this->getValue();\n    $normalized_payload['currency'] =\n      Normalizer::normalize('currency', $this->getCurrency());\n    $normalized_payload['content_name'] = $this->getContentName();\n    $normalized_payload['content_category'] = $this->getContentCategory();\n    $normalized_payload['content_ids'] = $this->getContentIds();\n    $normalized_payload['content_type'] = $this->getContentType();\n    $normalized_payload['order_id'] = $this->getOrderId();\n    $normalized_payload['predicted_ltv'] = $this->getPredictedLtv();\n    $normalized_payload['num_items'] = $this->getNumItems();\n    $normalized_payload['status'] = $this->getStatus();\n    $normalized_payload['search_string'] = $this->getSearchString();\n    $normalized_payload['item_number'] = $this->getItemNumber();\n    $normalized_payload['delivery_category'] =\n      Normalizer::normalize('delivery_category', $this->getDeliveryCategory());\n\n    if (isset($this->container['contents'])) {\n      $contents = [];\n      foreach ($this->getContents() as $content) {\n        array_push($contents, $content->normalize());\n      }\n      $normalized_payload['contents'] = $contents;\n    }\n\n    if (isset($this->container['custom_properties'])) {\n      foreach ($this->getCustomProperties() as $key => $val) {\n        if (array_key_exists($key, $normalized_payload)) {\n          throw new \\Exception('Duplicate key defined as part of the custom_properties. key: \"' . $key . '\". Please make sure the keys defined in the custom_properties are not already available in standard custom_data property list.');\n        }\n\n        $normalized_payload[$key] = $val;\n      }\n    }\n\n    $normalized_payload = array_filter($normalized_payload, function($val) {\n      if (is_array($val)) {\n        return true;\n      } else {\n        return strlen((string) $val);\n      }\n    });\n\n    return $normalized_payload;\n\n  }\n\n  /**\n   * Gets a numeric value associated with this event.\n   * This could be a monetary value or a value in some other metric.\n   * @return float\n   */\n  public function getValue() {\n    return $this->container['value'];\n  }\n\n  /**\n   * Gets currency for the value specified, if applicable.\n   * @return string\n   */\n  public function getCurrency() {\n    return $this->container['currency'];\n  }\n\n  /**\n   * Gets content name of the page or product associated with the event. Example: 'lettuce'.\n   * @return string\n   */\n  public function getContentName() {\n    return $this->container['content_name'];\n  }\n\n  /**\n   * Gets the category of the content associated with the event. Example: 'grocery'\n   * @return string\n   */\n  public function getContentCategory() {\n    return $this->container['content_category'];\n  }\n\n  /**\n   * Gets the content IDs associated with the event,\n   * such as product SKUs for items in an AddToCart event: ['ABC123', 'XYZ789'].\n   * @return string[]\n   */\n  public function getContentIds() {\n    return $this->container['content_ids'];\n  }\n\n  /**\n   * Gets a list of Content objects that contain the product IDs associated with\n   * the event plus information about the products.\n   * @return Content[]\n   */\n  public function getContents() {\n    return $this->container['contents'];\n  }\n\n  /**\n   * Gets content type 'product' or 'product_group'\n   * @return string\n   */\n  public function getContentType() {\n    return $this->container['content_type'];\n  }\n\n  /**\n   * Gets the order ID for this transaction as a String.\n   * @return string\n   */\n  public function getOrderId() {\n    return $this->container['order_id'];\n  }\n\n  /**\n   * Gets the predicted lifetime value of a conversion event.\n   * @return float\n   */\n  public function getPredictedLtv() {\n    return $this->container['predicted_ltv'];\n  }\n\n  /**\n   * Gets the number of items that a user tries to buy during checkout\n   * @return string\n   */\n  public function getNumItems() {\n    return $this->container['num_items'];\n  }\n\n  /**\n   * Gets the status of the registration event\n   * @return string\n   */\n  public function getStatus() {\n    return $this->container['status'];\n  }\n\n  /**\n   * Gets a search query made by a user.\n   * @return string\n   */\n  public function getSearchString() {\n    return $this->container['search_string'];\n  }\n\n  /**\n   * Gets a delivery_category for a purchase order.\n   * @return string\n   */\n  public function getDeliveryCategory() {\n    return $this->container['delivery_category'];\n  }\n\n  /**\n   * Gets the item number.\n   * @return string\n   */\n  public function getItemNumber() {\n    return $this->container['item_number'];\n  }\n\n  /**\n   * Gets Custom Properties dictionary to add properties that are not defined as part of the custom data.\n   * @return array\n   */\n  public function getCustomProperties() {\n    return $this->container['custom_properties'];\n  }\n\n  /**\n   * Gets the string presentation of the object\n   * @return string\n   */\n  public function __toString() {\n    if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n      return json_encode($this, JSON_PRETTY_PRINT);\n    }\n\n    return json_encode($this);\n  }\n}\n", "num_lines": 605}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse GuzzleHttp\\Promise\\PromiseInterface;\n\n/**\n * Interface for Custom Endpoint Request\n *\n * @category Interface\n */\ninterface CustomEndpointRequest {\n    /**\n     * Synchronously send events to custom endpoint\n     * @param string $pixel_id\n     * @param array<Event> $events\n     * @return CustomEndpointResponse\n     */\n    public function sendEvent(string $pixel_id, array $events): CustomEndpointResponse;\n\n    /**\n     * Asynchronously send events to custom endpoint\n     * @param string $pixel_id\n     * @param array<Event> $events\n     * @return PromiseInterface\n     */\n    public function sendEventAsync(string $pixel_id, array $events): PromiseInterface;\n\n    /**\n     * Create a filter function that will filter events being sent to endpoint\n     * @param Filter $filter\n     */\n    public function setFilter(Filter $filter);\n\n    /**\n     * Sets whether events should be send to this endpoint only\n     * @param boolean $setSendToEndpointOnly\n     */\n    public function setSendToEndpointOnly(bool $setSendToEndpointOnly);\n\n    /**\n     * Returns whether events should be sent to this endpoint only\n     * @return boolean\n     */\n    public function isSendToEndpointOnly(): bool;\n\n    /**\n     * Returns endpoint URL\n     * @return string\n     */\n    public function getEndpoint(): string;\n}\n\n", "num_lines": 76}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\n/**\n * Server side response to a custom endpoint\n */\nclass CustomEndpointResponse {\n    /**\n     * Array of property to type mappings. Used for (de)serialization\n     * @var string[]\n     */\n    protected static $param_types = array(\n        'message' => 'string',\n        'response_code' => 'string'\n    );\n\n    /**\n     * Associative array for storing property values\n     * @var mixed[]\n     */\n    protected $container = array();\n\n    /**\n     * Constructor\n     * @param mixed[] $data Associated array of property value initializing the model\n     */\n    public function __construct(array $data = null) {\n        $this->container['message'] = isset($data['message']) ? $data['message'] : null;\n        $this->container['response_code'] = isset($data['response_code']) ? $data['response_code'] : null;\n    }\n\n    /**\n     * Gets the string representation of the object\n     * @return string\n     */\n    public function __toString() {\n        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n            return json_encode($this, JSON_PRETTY_PRINT);\n        }\n        return json_encode($this);\n    }\n\n    /**\n     * Gets message\n     * @return string\n     */\n    public function getMessage(): string {\n        return $this->container['message'];\n    }\n\n    /**\n     * Gets response code\n     * @return string\n     */\n    public function getResponseCode(): ?string {\n        return $this->container['response_code'];\n    }\n}\n", "num_lines": 82}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * Class DeliveryCategory\n *\n * Type of delivery for a purchase event.\n *\n * @package FacebookAds\\Object\\ServerSide\n */\nclass DeliveryCategory extends AbstractEnum {\n\n  /**\n  * Customer needs to enter the store to get the purchased product.\n  */\n  const IN_STORE = 'in_store';\n\n  /**\n  * Customer picks up their order by driving to a store and waiting inside their vehicle.\n  */\n  const CURBSIDE = 'curbside';\n\n  /**\n  * Purchase is delivered to the customer's home.\n  */\n  const HOME_DELIVERY = 'home_delivery';\n}\n", "num_lines": 53}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse ArrayAccess;\n\n/**\n * Server-Side Event\n *\n * @category    Class\n * @package     FacebookAds\\Object\\ServerSide\n */\nclass Event implements ArrayAccess {\n  /**\n   * Array of property to type mappings. Used for (de)serialization\n   * @var string[]\n   */\n  protected static $param_types = array(\n    'event_name' => 'string',\n    'event_time' => 'int',\n    'event_source_url' => 'string',\n    'opt_out' => 'bool',\n    'event_id' => 'string',\n    'user_data' => 'FacebookAds\\Object\\ServerSide\\UserData',\n    'custom_data' => 'FacebookAds\\Object\\ServerSide\\CustomData',\n    'data_processing_options' => 'string[]',\n    'data_processing_options_country' => 'int',\n    'data_processing_options_state' => 'int',\n    'action_source' => 'string',\n    'app_data' => 'FacebookAds\\Object\\ServerSide\\AppData',\n    'advanced_measurement_table' => 'string',\n  );\n  /**\n   * Array of attributes where the key is the local name, and the value is the original name\n   * @var string[]\n   */\n  protected static $attributeMap = array(\n    'event_name' => 'event_name',\n    'event_time' => 'event_time',\n    'event_source_url' => 'event_source_url',\n    'opt_out' => 'opt_out',\n    'event_id' => 'event_id',\n    'user_data' => 'user_data',\n    'custom_data' => 'custom_data',\n    'data_processing_options' => 'data_processing_options',\n    'data_processing_options_country' => 'data_processing_options_country',\n    'data_processing_options_state' => 'data_processing_options_state',\n    'action_source' => 'action_source',\n    'app_data' => 'app_data',\n    'advanced_measurement_table' => 'advanced_measurement_table',\n  );\n\n  /**\n   * Array of attributes to setter functions (for deserialization of responses)\n   * @var string[]\n   */\n  protected static $setters = array(\n    'event_name' => 'setEventName',\n    'event_time' => 'setEventTime',\n    'event_source_url' => 'setEventSourceUrl',\n    'opt_out' => 'setOptOut',\n    'event_id' => 'setEventId',\n    'user_data' => 'setUserData',\n    'custom_data' => 'setCustomData',\n    'data_processing_options' => 'setDataProcessingOptions',\n    'data_processing_options_country' => 'setDataProcessingOptionsCountry',\n    'data_processing_options_state' => 'setDataProcessingOptionsState',\n    'action_source' => 'setActionSource',\n    'app_data' => 'setAppData',\n    'advanced_measurement_table' => 'setAdvancedMeasurementTable',\n  );\n  /**\n   * Array of attributes to getter functions (for serialization of requests)\n   * @var string[]\n   */\n  protected static $getters = array(\n    'event_name' => 'getEventName',\n    'event_time' => 'getEventTime',\n    'event_source_url' => 'getEventSourceUrl',\n    'opt_out' => 'getOptOut',\n    'event_id' => 'getEventId',\n    'user_data' => 'getUserData',\n    'custom_data' => 'getCustomData',\n    'data_processing_options' => 'getDataProcessingOptions',\n    'data_processing_options_country' => 'getDataProcessingOptionsCountry',\n    'data_processing_options_state' => 'getDataProcessingOptionsState',\n    'action_source' => 'getActionSource',\n    'app_data' => 'getAppData',\n    'advanced_measurement_table' => 'getAdvancedMeasurementTable',\n  );\n  /**\n   * Associative array for storing property values\n   * @var mixed[]\n   */\n  protected $container = array();\n\n  /**\n   * Constructor\n   * @param mixed[] $data Associated array of property value initializing the model\n   */\n  public function __construct(array $data = null) {\n    $this->container['event_name'] = isset($data['event_name']) ? $data['event_name'] : null;\n    $this->container['event_time'] = isset($data['event_time']) ? $data['event_time'] : null;\n    $this->container['event_source_url'] = isset($data['event_source_url']) ? $data['event_source_url'] : null;\n    $this->container['opt_out'] = isset($data['opt_out']) ? $data['opt_out'] : null;\n    $this->container['event_id'] = isset($data['event_id']) ? $data['event_id'] : null;\n    $this->container['user_data'] = isset($data['user_data']) ? $data['user_data'] : null;\n    $this->container['custom_data'] = isset($data['custom_data']) ? $data['custom_data'] : null;\n    $this->container['data_processing_options'] = isset($data['data_processing_options']) ? $data['data_processing_options'] : null;\n    $this->container['data_processing_options_country'] = isset($data['data_processing_options_country']) ? $data['data_processing_options_country'] : null;\n    $this->container['data_processing_options_state'] = isset($data['data_processing_options_state']) ? $data['data_processing_options_state'] : null;\n    $this->container['action_source'] = isset($data['action_source']) ? $data['action_source'] : null;\n    $this->container['app_data'] = isset($data['app_data']) ? $data['app_data'] : null;\n    $this->container['advanced_measurement_table'] = isset($data['advanced_measurement_table']) ? $data['advanced_measurement_table'] : null;\n  }\n\n  public static function paramTypes() {\n    return self::$param_types;\n  }\n\n  public static function attributeMap() {\n    return self::$attributeMap;\n  }\n\n  public static function setters() {\n    return self::$setters;\n  }\n\n  public static function getters() {\n    return self::$getters;\n  }\n\n  /**\n   * show all the invalid properties with reasons.\n   *\n   * @return array invalid properties with reasons\n   */\n  public function listInvalidProperties() {\n    $invalid_properties = array();\n    if ($this->container['event_name'] === null) {\n      $invalid_properties[] = \"'event_name' can't be null\";\n    }\n    if ($this->container['event_time'] === null) {\n      $invalid_properties[] = \"'event_time' can't be null\";\n    }\n    if ($this->container['user_data'] === null) {\n      $invalid_properties[] = \"'user_data' can't be null\";\n    }\n    return $invalid_properties;\n  }\n\n  /**\n   * validate all the properties in the model\n   * return true if all passed\n   *\n   * @return bool True if all properteis are valid\n   */\n  public function valid() {\n    if ($this->container['event_name'] === null) {\n      return false;\n    }\n    if ($this->container['event_time'] === null) {\n      return false;\n    }\n    if ($this->container['user_data'] === null) {\n      return false;\n    }\n    return true;\n  }\n\n  /**\n   * Sets a Facebook pixel Standard Event or Custom Event name\n   * @param string $event_name A Facebook pixel Standard Event or Custom Event name.\n   * @return $this\n   */\n  public function setEventName($event_name) {\n    $this->container['event_name'] = $event_name;\n\n    return $this;\n  }\n\n  /**\n   * Sets a Unix timestamp in seconds indicating when the actual event occurred\n   * @param int $event_time A Unix timestamp in seconds indicating when the actual event occurred.\n   * @return $this\n   */\n  public function setEventTime($event_time) {\n    $this->container['event_time'] = $event_time;\n\n    return $this;\n  }\n\n  /**\n   * Sets the browser URL where the event happened\n   * @param string $event_source_url The browser URL where the event happened.\n   * @return $this\n   */\n  public function setEventSourceUrl($event_source_url) {\n    $this->container['event_source_url'] = $event_source_url;\n\n    return $this;\n  }\n\n  /**\n   * Sets a flag that indicates Facebook should or should not use this event for ads delivery optimization\n   * @param bool $opt_out A flag that indicates Facebook should or should not\n   *      use this event for ads delivery optimization.\n   *      If set to true, Facebook only use the event for attribution.\n   * @return $this\n   */\n  public function setOptOut($opt_out) {\n    $this->container['opt_out'] = $opt_out;\n\n    return $this;\n  }\n\n  /**\n   * Sets an ID used by Facebook to deduplicate the same event sent from both server and browser.\n   * @param string $event_id This ID can be any unique string chosen by the advertiser.\n   * event_id is used to deduplicate events sent by both Facebook Pixel and Server-Side API.\n   * event_name is also used in the deduplication process.\n   * For deduplication, the eventID from Facebook pixel must match the\n   * event_id in the corresponding Server-Side API event.\n   * @return $this\n   */\n  public function setEventId($event_id) {\n    $this->container['event_id'] = $event_id;\n\n    return $this;\n  }\n\n  /**\n   * Sets UserData object that contains user data.\n   * @param FacebookAds\\Object\\ServerSide\\UserData $user_data\n   * @return $this\n   */\n  public function setUserData($user_data) {\n    $this->container['user_data'] = $user_data;\n\n    return $this;\n  }\n\n  /**\n   * Sets CustomData object that includes additional business data about the event.\n   * @param FacebookAds\\Object\\ServerSide\\CustomData $custom_data\n   * @return $this\n   */\n  public function setCustomData($custom_data) {\n    $this->container['custom_data'] = $custom_data;\n\n    return $this;\n  }\n\n  /**\n   * Sets the processing options you would like to enable for a specific event.\n   * For more details see: https://developers.facebook.com/docs/marketing-apis/data-processing-options\n   * @param string[], e.g. [] or ['LDU']\n   * @return $this\n   */\n  public function setDataProcessingOptions($data_processing_options) {\n    $this->container['data_processing_options'] = $data_processing_options;\n\n    return $this;\n  }\n\n  /**\n   * Sets a country that you want to associate to this data processing option. If you set a country, you must also set a state.\n   * For more details see: https://developers.facebook.com/docs/marketing-apis/data-processing-options\n   * @param int\n   * @return $this\n   */\n  public function setDataProcessingOptionsCountry($data_processing_options_country) {\n    $this->container['data_processing_options_country'] = $data_processing_options_country;\n\n    return $this;\n  }\n\n  /**\n   * Sets a state that you want to associate with this data processing option.\n   * For more details see: https://developers.facebook.com/docs/marketing-apis/data-processing-options\n   * @param int\n   * @return $this\n   *\n   */\n  public function setDataProcessingOptionsState($data_processing_options_state) {\n    $this->container['data_processing_options_state'] = $data_processing_options_state;\n\n    return $this;\n  }\n\n  /**\n   * Gets action_source, this is where the Conversion occurred.\n   * @return string\n   */\n  public function getActionSource() {\n    return $this->container['action_source'];\n  }\n\n  /**\n   * Sets action_source, this is where the Conversion occurred.\n   * @return $this\n   */\n  public function setActionSource($action_source) {\n    $this->container['action_source'] = $action_source;\n    return $this;\n  }\n\n  /**\n   * Set AppData which contains app data and device information for events happening from an app\n   * @param AppData\n   * @return $this\n   */\n  public function setAppData($app_data) {\n    $this->container['app_data'] = $app_data;\n    return $this;\n  }\n\n  /**\n   * Returns true if offset exists. False otherwise.\n   * @param integer $offset Offset\n   * @return boolean\n   */\n  public function offsetExists($offset) : bool {\n    return isset($this->container[$offset]);\n  }\n\n  /**\n   * Gets offset.\n   * @param integer $offset Offset\n   * @return mixed\n   */\n  public function offsetGet($offset) : mixed {\n    return isset($this->container[$offset]) ? $this->container[$offset] : null;\n  }\n\n  /**\n   * Sets value based on offset.\n   * @param integer $offset Offset\n   * @param mixed $value Value to be set\n   * @return void\n   */\n  public function offsetSet($offset, $value) : void {\n    if (is_null($offset)) {\n      $this->container[] = $value;\n    } else {\n      $this->container[$offset] = $value;\n    }\n  }\n\n  /**\n   * Unsets offset.\n   * @param integer $offset Offset\n   * @return void\n   */\n  public function offsetUnset($offset) : void {\n    unset($this->container[$offset]);\n  }\n\n  /**\n   * Normalize\n   * @return array\n   */\n  public function normalize() {\n    $normalized_payload = array();\n\n    $normalized_payload['event_name'] = $this->getEventName();\n    $normalized_payload['event_time'] = $this->getEventTime();\n    $normalized_payload['event_source_url'] = $this->getEventSourceUrl();\n    $normalized_payload['opt_out'] = $this->getOptOut();\n    $normalized_payload['event_id'] = $this->getEventId();\n    $normalized_payload['user_data'] = isset($this->container['user_data']) ? $this->getUserData()->normalize() : null;\n    $normalized_payload['custom_data'] = isset($this->container['custom_data']) ? $this->getCustomData()\n      ->normalize() : null;\n\n    $normalized_payload['data_processing_options'] = $this->getDataProcessingOptions();\n    $normalized_payload['data_processing_options_country'] = $this->getDataProcessingOptionsCountry();\n    $normalized_payload['data_processing_options_state'] = $this->getDataProcessingOptionsState();\n    $normalized_payload['action_source'] = Normalizer::normalize(\n      'action_source',\n      $this->container['action_source']\n    );\n    $normalized_payload['advanced_measurement_table'] = $this->getAdvancedMeasurementTable();\n    $normalized_payload = array_filter($normalized_payload, function($val) { if(is_array($val)) { return true; } else { return strlen((string) $val); }});\n    // Add the opt_out value back in if it was filtered out\n    if ($this->getOptOut() === false) {\n      $normalized_payload['opt_out'] = $this->getOptOut();\n    }\n    $normalized_payload['app_data'] = isset($this->container['app_data']) ? $this->getAppData()->normalize() : null;\n    return $normalized_payload;\n  }\n\n  /**\n   * Gets Facebook pixel Standard Event or Custom Event name.\n   * @return string\n   */\n  public function getEventName() {\n    return $this->container['event_name'];\n  }\n\n  /**\n   * Gets Unix timestamp in seconds indicating when the actual event occurred.\n   * @return int\n   */\n  public function getEventTime() {\n    return $this->container['event_time'];\n  }\n\n  /**\n   * Gets browser URL where the event happened.\n   * @return string\n   */\n  public function getEventSourceUrl() {\n    return $this->container['event_source_url'];\n  }\n\n  /**\n   * Gets flag that indicates Facebook should or should not use this event for ads delivery optimization.\n   * If set to true, we only use the event for attribution.\n   * @return bool\n   */\n  public function getOptOut() {\n    return $this->container['opt_out'];\n  }\n\n  /**\n   * Gets Event ID can be any string chosen by the advertiser. It is used by Facebook to deduplicate\n   * the same event sent from both server and browser.\n   * @return string\n   */\n  public function getEventId() {\n    return $this->container['event_id'];\n  }\n\n  /**\n   * Gets UserData object that contains user data\n   * @return FacebookAds\\Object\\ServerSide\\UserData\n   */\n  public function getUserData() {\n    return $this->container['user_data'];\n  }\n\n  /**\n   * Gets customData object that includes additional business data about the event.\n   * @return FacebookAds\\Object\\ServerSide\\CustomData\n   */\n  public function getCustomData() {\n    return $this->container['custom_data'];\n  }\n\n  /**\n   * Gets DataProcessionOptions value of Processing options you would like to enable for a specific event.\n   * @return string[]\n   */\n  public function getDataProcessingOptions() {\n    return $this->container['data_processing_options'];\n  }\n\n  /**\n   * Gets DataProcessionOptionsState value that represents the state that you want to associate with this data processing option.\n   * @return int\n   */\n  public function getDataProcessingOptionsState() {\n    return $this->container['data_processing_options_state'];\n  }\n\n  /**\n   * Gets DataProcessionOptionsCountry value that represents the country that you want to associate to this data processing option.\n   * @return int\n   */\n  public function getDataProcessingOptionsCountry() {\n    return $this->container['data_processing_options_country'];\n  }\n\n  /**\n   * Get AppData which contains app data and device information for events happening from an app\n   * @return AppData\n   */\n  public function getAppData() {\n    return $this->container['app_data'];\n  }\n\n  /**\n   * Sets advanced_measurement_table, Only used for the Advanced Measurement API in the Advanced Analytics product.\n   * @return $this\n   */\n  public function setAdvancedMeasurementTable($advanced_measurement_table) {\n    $this->container['advanced_measurement_table'] = $advanced_measurement_table;\n    return $this;\n  }\n\n  /**\n   * Gets advanced_measurement_table, Only used for the Advanced Measurement API in the Advanced Analytics product.\n   * @return string\n   */\n  public function getAdvancedMeasurementTable() {\n    return $this->container['advanced_measurement_table'];\n  }\n\n  /**\n   * Gets the string representation of the object\n   * @return string\n   */\n  public function __toString() {\n    if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n      return json_encode($this, JSON_PRETTY_PRINT);\n    }\n\n    return json_encode($this);\n  }\n}\n", "num_lines": 533}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse ArrayAccess;\nuse FacebookAds\\Api;\nuse FacebookAds\\ApiConfig;\nuse FacebookAds\\Object\\AdsPixel;\n\n/**\n * Conversions API Event Request\n *\n * @category    Class\n */\nclass EventRequest implements ArrayAccess {\n  /**\n   * Array of property to type mappings. Used for (de)serialization\n   * @var string[]\n   */\n  protected static $param_types = array(\n    'events' => '\\FacebookAds\\Object\\ServerSide\\Event[]',\n    'test_event_code' => 'string',\n    'partner_agent' => 'string',\n    'namespace_id' => 'string',\n    'upload_id' => 'string',\n    'upload_tag' => 'string',\n    'upload_source' => 'string'\n  );\n  /**\n   * Array of attributes where the key is the local name, and the value is the original name\n   * @var string[]\n   */\n  protected static $attributeMap = array(\n    'events' => 'events',\n    'test_event_code' => 'test_event_code',\n    'partner_agent' => 'partner_agent',\n    'namespace_id' => 'namespace_id',\n    'upload_id' => 'upload_id',\n    'upload_tag' => 'upload_tag',\n    'upload_source' => 'upload_source'\n  );\n  /**\n   * Array of attributes to setter functions (for deserialization of responses)\n   * @var string[]\n   */\n  protected static $setters = array(\n    'events' => 'setEvents',\n    'test_event_code' => 'setTestEventCode',\n    'partner_agent' => 'setPartnerAgent',\n    'namespace_id' => 'setNamespaceId',\n    'upload_id' => 'setUploadId',\n    'upload_tag' => 'setUploadTag',\n    'upload_source' => 'setUploadSource'\n  );\n  /**\n   * Array of attributes to getter functions (for serialization of requests)\n   * @var string[]\n   */\n  protected static $getters = array(\n    'events' => 'getEvents',\n    'test_event_code' => 'getTestEventCode',\n    'partner_agent' => 'getPartnerAgent',\n    'namespace_id' => 'getNamespaceId',\n    'upload_id' => 'getUploadId',\n    'upload_tag' => 'getUploadTag',\n    'upload_source' => 'getUploadSource'\n  );\n  /**\n   * Associative array for storing property values\n   * @var mixed[]\n   */\n  protected $container = array();\n\n  protected $http_client = null;\n\n  protected $endpoint_request  = null;\n\n  /**\n   * Constructor\n   * @param string $pixel_id pixel id\n   * @param mixed[] $data Associated array of property value initializing the model\n   */\n  public function __construct($pixel_id, array $data = null) {\n    $this->container['pixel_id'] = $pixel_id;\n    $this->container['events'] = isset($data['events']) ? $data['events'] : null;\n    $this->container['test_event_code'] = isset($data['test_event_code']) ? $data['test_event_code'] : null;\n    $this->container['partner_agent'] = isset($data['partner_agent']) ? $data['partner_agent'] : null;\n    $this->container['namespace_id'] = isset($data['namespace_id']) ? $data['namespace_id'] : null;\n    $this->container['upload_id'] = isset($data['upload_id']) ? $data['upload_id'] : null;\n    $this->container['upload_tag'] = isset($data['upload_tag']) ? $data['upload_tag'] : null;\n    $this->container['upload_source'] = isset($data['upload_source']) ? $data['upload_source'] : null;\n  }\n\n  public static function paramTypes() {\n    return self::$param_types;\n  }\n\n  public static function attributeMap() {\n    return self::$attributeMap;\n  }\n\n  public static function setters() {\n    return self::$setters;\n  }\n\n  public static function getters() {\n    return self::$getters;\n  }\n\n  /**\n   * show all the invalid properties with reasons.\n   *\n   * @return array invalid properties with reasons\n   */\n  public function listInvalidProperties() {\n    $invalid_properties = array();\n    if ($this->container['events'] === null) {\n      $invalid_properties[] = \"'events' can't be null\";\n    }\n    return $invalid_properties;\n  }\n\n  /**\n   * validate all the properties in the model\n   * return true if all passed\n   *\n   * @return bool True if all properties are valid\n   */\n  public function valid() {\n    if ($this->container['events'] === null) {\n      return false;\n    }\n    return true;\n  }\n\n  /**\n   * Sets an array of Server Event objects\n   * @param FacebookAds\\Object\\ServerSide\\Event[] $events An array of Server Event objects\n   * @return $this\n   */\n  public function setEvents($events) {\n    $this->container['events'] = $events;\n    return $this;\n  }\n\n  /**\n   * Gets code used to verify that your server events are received correctly by Facebook. Use this\n   * code to test your server events in the Test Events feature in Events Manager.\n   * See Test Events Tool\n   * (https://developers.facebook.com/docs/marketing-api/conversions-api/using-the-api#testEvents)\n   * for an example.\n   * @return string\n   */\n  public function getTestEventCode() {\n    return $this->container['test_event_code'];\n  }\n\n  /**\n   * Sets code used to verify that your server events are received correctly by Facebook. Use this\n   * code to test your server events in the Test Events feature in Events Manager.\n   * See Test Events Tool\n   * (https://developers.facebook.com/docs/marketing-api/conversions-api/using-the-api#testEvents)\n   * for an example.\n   * @param string $test_event_code Code used to verify that your server events are received correctly by Facebook.\n   * Use this code to test your server events in the Test Events feature in Events Manager. See Test Events Tool\n   * (https://developers.facebook.com/docs/marketing-api/conversions-api/using-the-api#testEvents)\n   * for an example.\n   * @return $this\n   */\n  public function setTestEventCode($test_event_code) {\n    $this->container['test_event_code'] = $test_event_code;\n    return $this;\n  }\n\n  /**\n   * Sets Partner Agent, which specifies who is sending the event.\n   * @param string $partner_agent The partner agent who is sending the event\n   * @return $this\n   */\n  public function setPartnerAgent($partner_agent) {\n    $this->container['partner_agent'] = $partner_agent;\n\n    return $this;\n  }\n\n  /**\n   * Sets a custom HTTP Client object, which overrides the default HTTP service\n   * used to send the event request.\n   * @param HttpServiceInterface $http_client An object that implements the HttpServiceInterface\n   * @return $this\n   */\n  public function setHttpClient($http_client) {\n    $this->http_client = $http_client;\n    return $this;\n  }\n\n    /**\n     * Sets a custom Endpoint Request that is used to send the event request\n     * in addition to CAPI Request.\n     * @param CustomEndpointRequest $custom_endpoint An object that implements the CustomEndpointRequest\n     * @return $this\n     */\n    public function setCustomEndpoint(CustomEndpointRequest $custom_endpoint) {\n        $this->endpoint_request = $custom_endpoint;\n        return $this;\n    }\n\n  /**\n   * Execute the request\n   */\n  public function execute()\n  {\n      if ($this->endpoint_request != null && $this->endpoint_request->isSendToEndpointOnly()) {\n        // do not send to CAPI Endpoint. If no exception was thrown, we can assume all events were sent successfully\n        $customEndpointResponses = $this->sendEventsToCustomEndpoint();\n        return new EventResponse(array(\n            'data' => array('events_received' => count($this->container['events']), 'custom_endpoint_responses'=>$customEndpointResponses)\n        ));\n\n    } else if ($this->endpoint_request != null) {\n        $capiResponse = $this->sendToCAPIEndpoint();\n        $capiResponse->setCustomEndpointResponses(array($this->endpoint_request->getEndpoint() => $this->sendEventsToCustomEndpoint()));\n        return $capiResponse;\n    }\n    return $this->sendToCAPIEndpoint();\n  }\n\n    /**\n     * Synchronously send events to Custom Endpoint.\n     *\n     * @return array\n     */\n  private function sendEventsToCustomEndpoint(): array\n  {\n      $customEndpointResponse = $this->endpoint_request->sendEvent($this->container['pixel_id'], $this->container['events']);\n      return array($this->endpoint_request->getEndpoint() => $customEndpointResponse);\n  }\n\n    /**\n     * Synchronously send events to Facebook Conversions API.\n     *\n     * @return EventResponse response\n     */\n  private function sendToCAPIEndpoint(): EventResponse\n  {\n      if ($this->http_client != null) {\n          $http_client = $this->http_client;\n      } else {\n          $http_client = HttpServiceClientConfig::getInstance()->getClient();\n      }\n\n      if ($http_client != null) {\n          return $this->httpClientExecute($http_client);\n      }\n      return $this->defaultExecute();\n  }\n\n  private function defaultExecute() {\n    $fields = array();\n    $normalized_param = $this->normalize();\n    $ads_pixel = new AdsPixel($this->container['pixel_id']);\n    $response = $ads_pixel->createEvent(\n      $fields,\n      $normalized_param\n    );\n    return new EventResponse($response->exportAllData());\n  }\n\n  private function httpClientExecute($http_client) {\n    $base_url = 'https://graph.facebook.com/v' . ApiConfig::APIVersion;\n    $url = $base_url . '/' . $this->container['pixel_id'] . '/events';\n\n    $headers = array(\n      'User-Agent' => 'fbbizsdk-php-v' . ApiConfig::SDKVersion,\n      'Accept-Encoding' => '*',\n    );\n\n    $curl_options = array(\n      CURLOPT_CONNECTTIMEOUT => 10,\n      CURLOPT_TIMEOUT => 60,\n      CURLOPT_RETURNTRANSFER => true,\n      CURLOPT_HEADER => true,\n      CURLOPT_CAINFO => Util::getCaBundlePath(),\n    );\n\n    $params = $this->normalize();\n    if (HttpServiceClientConfig::getInstance()->getAccessToken() == null) {\n      $params['access_token'] = Api::instance()->getSession()->getAccessToken();\n    } else {\n      $params['access_token'] = HttpServiceClientConfig::getInstance()->getAccessToken();\n    }\n\n    $appsecret = null;\n    if (HttpServiceClientConfig::getInstance()->getAppsecret() == null) {\n      $appsecret = Api::instance()->getSession()->getAppSecret();\n    } else {\n      $appsecret = HttpServiceClientConfig::getInstance()->getAppsecret();\n    }\n    if ($appsecret != null) {\n      $params['appsecret_proof'] = Util::getAppsecretProof($params['access_token'], $appsecret);\n    }\n\n    return $http_client->executeRequest(\n      $url,\n      HttpMethod::POST,\n      $curl_options,\n      $headers,\n      $params\n    );\n  }\n\n  /**\n   * Normalize\n   * @return array\n   */\n  public function normalize() {\n    $normalized_events = array();\n    $events = $this->getEvents();\n    if (!is_null($events)) {\n      foreach ($events as $event) {\n        $normalized_event = $event->normalize();\n        array_push($normalized_events, $normalized_event);\n      }\n    }\n\n    $normalized_payload = array(\n      'data' => $normalized_events,\n      'test_event_code' => $this->container['test_event_code'],\n      'partner_agent' => $this->container['partner_agent'],\n      'namespace_id' => $this->container['namespace_id'],\n      'upload_id' => $this->container['upload_id'],\n      'upload_tag' => $this->container['upload_tag'],\n      'upload_source' => $this->container['upload_source'],\n    );\n    $normalized_payload = array_filter($normalized_payload);\n\n    return $normalized_payload;\n  }\n\n  /**\n   * Gets an array of Server Event objects\n   * @return FacebookAds\\Object\\ServerSide\\Event[]\n   */\n  public function getEvents() {\n    return $this->container['events'];\n  }\n\n  /**\n   * Gets Partner Agent, which specifies who is sending the event.\n   * @return string\n   */\n  public function getPartnerAgent() {\n    return $this->container['partner_agent'];\n  }\n\n  /**\n   * Gets namespace_id, a scope used to resolve extern_id or Third-party ID.\n   * Can be another data set or data partner ID.\n   * @return string\n   */\n  public function getNamespaceId() {\n    return $this->container['namespace_id'];\n  }\n\n  /**\n   * Sets namespace_id, a scope used to resolve extern_id or Third-party ID.\n   * Can be another data set or data partner ID.\n   * @return $this\n   */\n  public function setNamespaceId($namespace_id) {\n    $this->container['namespace_id'] = $namespace_id;\n    return $this;\n  }\n\n  /**\n   * Gets upload_id, a unique id used to denote the current set being uploaded.\n   * @return string\n   */\n  public function getUploadId() {\n    return $this->container['upload_id'];\n  }\n\n  /**\n   * Sets upload_id, a unique id used to denote the current set being uploaded.\n   * @return $this\n   */\n  public function setUploadId($upload_id) {\n    $this->container['upload_id'] = $upload_id;\n    return $this;\n  }\n\n  /**\n   * Gets upload_tag, a tag string added to track your Offline event uploads.\n   * @return string\n   */\n  public function getUploadTag() {\n    return $this->container['upload_tag'];\n  }\n\n  /**\n   * Sets upload_tag, a tag string added to track your Offline event uploads.\n   * @return $this\n   */\n  public function setUploadTag($upload_tag) {\n    $this->container['upload_tag'] = $upload_tag;\n    return $this;\n  }\n\n  /**\n   * Gets upload_source, the origin/source of data for the dataset to be uploaded.\n   * @return string\n   */\n  public function getUploadSource() {\n    return $this->container['upload_source'];\n  }\n\n  /**\n   * Sets upload_source, the origin/source of data for the dataset to be uploaded.\n   * @return $this\n   */\n  public function setUploadSource($upload_source) {\n    $this->container['upload_source'] = $upload_source;\n    return $this;\n  }\n\n  /**\n   * Returns true if offset exists. False otherwise.\n   * @param integer $offset Offset\n   * @return boolean\n   */\n  public function offsetExists($offset) : bool {\n    return isset($this->container[$offset]);\n  }\n\n  /**\n   * Gets offset.\n   * @param integer $offset Offset\n   * @return mixed\n   */\n  public function offsetGet($offset) : mixed {\n    return isset($this->container[$offset]) ? $this->container[$offset] : null;\n  }\n\n  /**\n   * Sets value based on offset.\n   * @param integer $offset Offset\n   * @param mixed $value Value to be set\n   * @return void\n   */\n  public function offsetSet($offset, $value) : void {\n    if (is_null($offset)) {\n      $this->container[] = $value;\n    } else {\n      $this->container[$offset] = $value;\n    }\n  }\n\n  /**\n   * Unsets offset.\n   * @param integer $offset Offset\n   * @return void\n   */\n  public function offsetUnset($offset) : void {\n    unset($this->container[$offset]);\n  }\n\n\n  /**\n   * Gets the string presentation of the object\n   * @return string\n   */\n  public function __toString() {\n    if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n      return json_encode($this, JSON_PRETTY_PRINT);\n    }\n\n    return json_encode($this);\n  }\n}\n", "num_lines": 502}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse FacebookAds\\Api;\nuse FacebookAds\\ApiConfig;\nuse FacebookAds\\Http\\Client;\nuse GuzzleHttp\\Promise\\Promise;\nuse GuzzleHttp\\Promise\\Utils;\nuse GuzzleHttp\\Psr7\\Request;\nuse GuzzleHttp\\Psr7\\MultipartStream;\n\nclass EventRequestAsync extends EventRequest {\n  /**\n   * Return an asynchronous request Promise\n   * @return \\GuzzleHttp\\Promise\\PromiseInterface\n   */\n  public function execute() {\n    $normalized_param = $this->normalize();\n    $pixel_id = $this->container['pixel_id'];\n    if ($this->endpoint_request != null && $this->endpoint_request->isSendToEndpointOnly()) {\n        return $this->endpoint_request->sendEventAsync($pixel_id, $this->container['events'])->then(function($customEndpointResponse) {\n            $response = $customEndpointResponse;\n            return new EventResponse(array(\n                'data' => array('events_received' => count($this->container['events']), 'custom_endpoint_responses'=>$response)\n            ));\n        });\n    }\n    $sendCAPIRequestPromise = $this->eventPromise(\n          $pixel_id,\n          $normalized_param\n    );\n    if ($this->endpoint_request != null) {\n        $customEndpointRequestPromise = $this->endpoint_request->sendEventAsync($this->container['pixel_id'], $this->container['events']);\n        // put both promises in an an array\n        $promises = Utils::all(array($sendCAPIRequestPromise, $customEndpointRequestPromise));\n        $promises->then(function($responses) {\n                $CAPIResponse = $responses[0];\n                $customEndpointResponse = $responses[1];\n                $CAPIResponse->setCustomEndpointResponses($customEndpointResponse);\n                return $CAPIResponse;\n        });\n        return $promises;\n    }\n    return $sendCAPIRequestPromise;\n  }\n\n  private function eventPromise($pixel_id, array $params = array()) {\n    $access_token = Api::instance()->getSession()->getAccessToken();\n    $headers = array(\n      'User-Agent' => 'fbbizsdk-php-v'.ApiConfig::APIVersion,\n      'Accept-Encoding' => '*',\n    );\n\n    $domain = Client::DEFAULT_LAST_LEVEL_DOMAIN . '.' . Client::DEFAULT_GRAPH_BASE_DOMAIN;\n    $base_url = 'https://' . $domain . '/v' . ApiConfig::APIVersion;\n\n    $url = $base_url.'/'.$pixel_id.'/events';\n\n    $events_json = \\GuzzleHttp\\json_encode($params['data']);\n    $multipart_contents = [\n      [\n        'name' => 'access_token',\n        'contents' => $access_token,\n        'headers' => array('Content-Type' => 'multipart/form-data'),\n      ],\n      [\n        'name' => 'data',\n        'contents' => $events_json,\n        'headers' => array('Content-Type' => 'multipart/form-data'),\n      ]\n    ];\n\n    foreach ($params as $key => $value) {\n      if ($key !== 'data') {\n        $multipart_contents[] = [\n          'name' => $key,\n          'contents' => $value,\n          'headers' => array('Content-Type' => 'multipart/form-data'),\n        ];\n      }\n    }\n\n    $body = new MultipartStream($multipart_contents);\n    $request = new Request('POST', $url, $headers, $body);\n\n    $client = AsyncClient::getInstance()->getClient();\n    return $client->sendAsync($request);\n  }\n}\n", "num_lines": 113}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse ArrayAccess;\n\n/**\n * Conversions API event response.\n *\n * @category    Class\n */\nclass EventResponse implements ArrayAccess {\n\n  /**\n   * Array of property to type mappings. Used for (de)serialization\n   * @var string[]\n   */\n  protected static $param_types = array(\n    'events_received' => 'int',\n    'messages' => 'string[]',\n    'fbtrace_id' => 'string',\n    'custom_endpoint_responses' => 'array'\n  );\n  /**\n   * Array of attributes where the key is the local name, and the value is the original name\n   * @var string[]\n   */\n  protected static $attributeMap = array(\n    'events_received' => 'events_received',\n    'messages' => 'messages',\n    'fbtrace_id' => 'fbtrace_id',\n    'custom_endpoint_responses' => 'custom_endpoint_responses',\n  );\n  /**\n   * Array of attributes to setter functions (for deserialization of responses)\n   * @var string[]\n   */\n  protected static $setters = array(\n    'events_received' => 'setEventsReceived',\n    'messages' => 'setMessages',\n    'fbtrace_id' => 'setFbTraceId',\n    'custom_endpoint_responses' => 'custom_endpoint_responses'\n  );\n  /**\n   * Array of attributes to getter functions (for serialization of requests)\n   * @var string[]\n   */\n  protected static $getters = array(\n    'events_received' => 'getEventsReceived',\n    'messages' => 'getMessages',\n    'fbtrace_id' => 'getFbTraceId',\n    'custom_endpoint_responses' => 'custom_endpoint_responses'\n  );\n  /**\n   * Associative array for storing property values\n   * @var mixed[]\n   */\n  protected $container = array();\n\n  /**\n   * Constructor\n   * @param mixed[] $data Associated array of property value initalizing the model\n   */\n  public function __construct(array $data = null) {\n    $this->container['events_received'] = isset($data['events_received']) ? $data['events_received'] : null;\n    $this->container['messages'] = isset($data['messages']) ? $data['messages'] : null;\n    $this->container['fbtrace_id'] = isset($data['fbtrace_id']) ? $data['fbtrace_id'] : null;\n    $this->container['custom_endpoint_responses'] = isset($data['custom_endpoint_responses']) ? $data['custom_endpoint_responses'] : null;\n  }\n\n  public static function paramTypes() {\n    return self::$param_types;\n  }\n\n  public static function attributeMap() {\n    return self::$attributeMap;\n  }\n\n  public static function setters() {\n    return self::$setters;\n  }\n\n  public static function getters() {\n    return self::$getters;\n  }\n\n  /**\n   * show all the invalid properties with reasons.\n   *\n   * @return array invalid properties with reasons\n   */\n  public function listInvalidProperties() {\n    $invalid_properties = array();\n    return $invalid_properties;\n  }\n\n  /**\n   * validate all the properties in the model\n   * return true if all passed\n   *\n   * @return bool True if all properteis are valid\n   */\n  public function valid() {\n    return true;\n  }\n\n  /**\n   * Gets number of events received.\n   * @return int\n   */\n  public function getEventsReceived() {\n    return $this->container['events_received'];\n  }\n\n  /**\n   * Sets number of events received.\n   * @param int $events_received number of events received.\n   * @return $this\n   */\n  public function setEventsReceived($events_received) {\n    $this->container['events_received'] = $events_received;\n\n    return $this;\n  }\n\n    /**\n     * Sets custom endpoint response results.\n     * @param array $custom_endpoint_responses Custom Endpoint Response that maps to the Custom Endpoint Requests sent.\n     * @return $this\n     */\n    public function setCustomEndpointResponses(array $custom_endpoint_responses) {\n        $this->container['custom_endpoint_responses'] = $custom_endpoint_responses;\n\n        return $this;\n    }\n\n    /**\n     * Gets custom endpoint response results.\n     * @return mixed $array\n     */\n    public function getCustomEndpointResponses() {\n        return $this->container['custom_endpoint_responses'];\n    }\n\n  /**\n   * Gets response messages.\n   * @return string[]\n   */\n  public function getMessages() {\n    return $this->container['messages'];\n  }\n\n  /**\n   * Sets response messages.\n   * @param string[] $messages response messages.\n   * @return $this\n   */\n  public function setMessages($messages) {\n    $this->container['messages'] = $messages;\n\n    return $this;\n  }\n\n  /**\n   * Gets Facebook trace id\n   * @return string\n   */\n  public function getFbTraceId() {\n    return $this->container['fbtrace_id'];\n  }\n\n  /**\n   * Sets Facebook trace id\n   * @param $fbtrace_id Facebook trace id\n   * @return $this\n   */\n  public function setFbTraceId($fbtrace_id) {\n    $this->container['fbtrace_id'] = $fbtrace_id;\n    return $this;\n  }\n\n  /**\n   * Returns true if offset exists. False otherwise.\n   * @param integer $offset Offset\n   * @return boolean\n   */\n  public function offsetExists($offset) : bool {\n    return isset($this->container[$offset]);\n  }\n\n  /**\n   * Gets offset.\n   * @param integer $offset Offset\n   * @return mixed\n   */\n  public function offsetGet($offset) : mixed {\n    return isset($this->container[$offset]) ? $this->container[$offset] : null;\n  }\n\n  /**\n   * Sets value based on offset.\n   * @param integer $offset Offset\n   * @param mixed $value Value to be set\n   * @return void\n   */\n  public function offsetSet($offset, $value) : void {\n    if (is_null($offset)) {\n      $this->container[] = $value;\n    } else {\n      $this->container[$offset] = $value;\n    }\n  }\n\n  /**\n   * Unsets offset.\n   * @param integer $offset Offset\n   * @return void\n   */\n  public function offsetUnset($offset) : void {\n    unset($this->container[$offset]);\n  }\n\n  /**\n   * Gets the string presentation of the object\n   * @return string\n   */\n  public function __toString() {\n    if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n      return json_encode($this, JSON_PRETTY_PRINT);\n    }\n    return json_encode($this);\n  }\n}\n", "num_lines": 256}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse ArrayAccess;\n\nclass ExtendedDeviceInfo implements ArrayAccess {\n\n  const EXT_INFO_VERSION        = 0;\n  const APP_PACKAGE_NAME        = 1;\n  const SHORT_VERSION           = 2;\n  const LONG_VERSION            = 3;\n  const OS_VERSION              = 4;\n  const DEVICE_MODEL_NAME       = 5;\n  const LOCALE                  = 6;\n  const TIMEZONE_ABBREVIATION   = 7;\n  const CARRIER                 = 8;\n  const SCREEN_WIDTH            = 9;\n  const SCREEN_HEIGHT           = 10;\n  const SCREEN_DENSITY          = 11;\n  const CPU_CORE_COUNT          = 12;\n  const TOTAL_DISK_SPACE_GB     = 13;\n  const FREE_DISK_SPACE_GB      = 14;\n  const DEVICE_TIME_ZONE        = 15;\n\n  protected static $param_types = array(\n    'ext_info_version' => 'string',\n    'app_package_name' => 'string',\n    'short_version' => 'string',\n    'long_version' => 'string',\n    'os_version' => 'string',\n    'device_model_name' => 'string',\n    'locale' => 'string',\n    'timezone_abbreviation' => 'string',\n    'carrier' => 'string',\n    'screen_width' => 'int',\n    'screen_height' => 'int',\n    'screen_density' => 'string',\n    'cpu_core_count' => 'int',\n    'total_disk_space_gb' => 'int',\n    'free_disk_space_gb' => 'int',\n    'device_time_zone' => 'string',\n  );\n\n  protected static $attributeMap = array(\n    'ext_info_version' => 'ext_info_version',\n    'app_package_name' => 'app_package_name',\n    'short_version' => 'short_version',\n    'long_version' => 'long_version',\n    'os_version' => 'os_version',\n    'device_model_name' => 'device_model_name',\n    'locale' => 'locale',\n    'timezone_abbreviation' => 'timezone_abbreviation',\n    'carrier' => 'carrier',\n    'screen_width' => 'screen_width',\n    'screen_height' => 'screen_height',\n    'screen_density' => 'screen_density',\n    'cpu_core_count' => 'cpu_core_count',\n    'total_disk_space_gb' => 'total_disk_space_gb',\n    'free_disk_space_gb' => 'free_disk_space_gb',\n    'device_time_zone' => 'device_time_zone',\n  );\n\n  protected static $setters = array(\n    'ext_info_version' => 'setExtInfoVersion',\n    'app_package_name' => 'setAppPackageName',\n    'short_version' => 'setShortVersion',\n    'long_version' => 'setLongVersion',\n    'os_version' => 'setOsVersion',\n    'device_model_name' => 'setDeviceModelName',\n    'locale' => 'setLocale',\n    'timezone_abbreviation' => 'setTimezoneAbbreviation',\n    'carrier' => 'setCarrier',\n    'screen_width' => 'setScreenWidth',\n    'screen_height' => 'setScreenHeight',\n    'screen_density' => 'setScreenDensity',\n    'cpu_core_count' => 'setCpuCoreCount',\n    'total_disk_space_gb' => 'setTotalDiskSpaceGb',\n    'free_disk_space_gb' => 'setFreeDiskSpaceGb',\n    'device_time_zone' => 'setDeviceTimeZone',\n  );\n\n  protected static $getters = array(\n    'ext_info_version' => 'getExtInfoVersion',\n    'app_package_name' => 'getAppPackageName',\n    'short_version' => 'getShortVersion',\n    'long_version' => 'getLongVersion',\n    'os_version' => 'getOsVersion',\n    'device_model_name' => 'getDeviceModelName',\n    'locale' => 'getLocale',\n    'timezone_abbreviation' => 'getTimezoneAbbreviation',\n    'carrier' => 'getCarrier',\n    'screen_width' => 'getScreenWidth',\n    'screen_height' => 'getScreenHeight',\n    'screen_density' => 'getScreenDensity',\n    'cpu_core_count' => 'getCpuCoreCount',\n    'total_disk_space_gb' => 'getTotalDiskSpaceGb',\n    'free_disk_space_gb' => 'getFreeDiskSpaceGb',\n    'device_time_zone' => 'getDeviceTimeZone',\n  );\n\n  protected $container = array();\n\n  public function __construct(array $data = null) {\n    $this->container['ext_info_version'] = isset($data['ext_info_version']) ? $data['ext_info_version'] : null;\n    $this->container['app_package_name'] = isset($data['app_package_name']) ? $data['app_package_name'] : null;\n    $this->container['short_version'] = isset($data['short_version']) ? $data['short_version'] : null;\n    $this->container['long_version'] = isset($data['long_version']) ? $data['long_version'] : null;\n    $this->container['os_version'] = isset($data['os_version']) ? $data['os_version'] : null;\n    $this->container['device_model_name'] = isset($data['device_model_name']) ? $data['device_model_name'] : null;\n    $this->container['locale'] = isset($data['locale']) ? $data['locale'] : null;\n    $this->container['timezone_abbreviation'] = isset($data['timezone_abbreviation']) ? $data['timezone_abbreviation'] : null;\n    $this->container['carrier'] = isset($data['carrier']) ? $data['carrier'] : null;\n    $this->container['screen_width'] = isset($data['screen_width']) ? $data['screen_width'] : null;\n    $this->container['screen_height'] = isset($data['screen_height']) ? $data['screen_height'] : null;\n    $this->container['screen_density'] = isset($data['screen_density']) ? $data['screen_density'] : null;\n    $this->container['cpu_core_count'] = isset($data['cpu_core_count']) ? $data['cpu_core_count'] : null;\n    $this->container['total_disk_space_gb'] = isset($data['total_disk_space_gb']) ? $data['total_disk_space_gb'] : null;\n    $this->container['free_disk_space_gb'] = isset($data['free_disk_space_gb']) ? $data['free_disk_space_gb'] : null;\n    $this->container['device_time_zone'] = isset($data['device_time_zone']) ? $data['device_time_zone'] : null;\n  }\n\n  public static function paramTypes() {\n    return $self::param_types;\n  }\n\n  public static function attributeMap() {\n    return self::$attributeMap;\n  }\n\n  public static function setters() {\n    return self::$setters;\n  }\n\n  public static function getters() {\n    return self::$getters;\n  }\n\n  /**\n   * show all the invalid properties with reasons.\n   *\n   * @return array invalid properties with reasons\n   */\n  public function listInvalidProperties() {\n    $invalid_properties = array();\n    return $invalid_properties;\n  }\n\n  /**\n   * validate all the properties in the model\n   * return true if all passed\n   *\n   * @return bool True if all properties are valid\n   */\n  public function valid() {\n    return true;\n  }\n\n  public function setExtInfoVersion($ext_info_version) {\n    $this->container['ext_info_version'] = $ext_info_version;\n\n    return $this;\n  }\n\n  public function setAppPackageName($app_package_name) {\n    $this->container['app_package_name'] = $app_package_name;\n\n    return $this;\n  }\n\n  public function setShortVersion($short_version) {\n    $this->container['short_version'] = $short_version;\n\n    return $this;\n  }\n\n  public function setLongVersion($long_version) {\n    $this->container['long_version'] = $long_version;\n\n    return $this;\n  }\n\n  public function setOsVersion($os_version) {\n    $this->container['os_version'] = $os_version;\n\n    return $this;\n  }\n\n  public function setDeviceModelName($device_model_name) {\n    $this->container['device_model_name'] = $device_model_name;\n\n    return $this;\n  }\n\n  public function setLocale($locale) {\n    $this->container['locale'] = $locale;\n\n    return $this;\n  }\n\n  public function setTimezoneAbbreviation($timezone_abbreviation) {\n    $this->container['timezone_abbreviation'] = $timezone_abbreviation;\n\n    return $this;\n  }\n\n  public function setCarrier($carrier) {\n    $this->container['carrier'] = $carrier;\n\n    return $this;\n  }\n\n  public function setScreenWidth($screen_width) {\n    $this->container['screen_width'] = $screen_width;\n\n    return $this;\n  }\n\n  public function setScreenHeight($screen_height) {\n    $this->container['screen_height'] = $screen_height;\n\n    return $this;\n  }\n\n  public function setScreenDensity($screen_density) {\n    $this->container['screen_density'] = $screen_density;\n\n    return $this;\n  }\n\n  public function setCpuCoreCount($cpu_core_count) {\n    $this->container['cpu_core_count'] = $cpu_core_count;\n\n    return $this;\n  }\n\n  public function setTotalDiskSpaceGb($total_disk_space_gb) {\n    $this->container['total_disk_space_gb'] = $total_disk_space_gb;\n\n    return $this;\n  }\n\n  public function setFreeDiskSpaceGb($free_disk_space_gb) {\n    $this->container['free_disk_space_gb'] = $free_disk_space_gb;\n\n    return $this;\n  }\n\n  public function setDeviceTimeZone($device_time_zone) {\n    $this->container['device_time_zone'] = $device_time_zone;\n\n    return $this;\n  }\n\n  /**\n   * Returns true if offset exists. False otherwise.\n   * @param integer $offset Offset\n   * @return boolean\n   */\n  public function offsetExists($offset) : bool {\n    return isset($this->container[$offset]);\n  }\n\n  /**\n   * Gets offset.\n   * @param integer $offset Offset\n   * @return mixed\n   */\n  public function offsetGet($offset) : mixed {\n    return isset($this->container[$offset]) ? $this->container[$offset] : null;\n  }\n\n  /**\n   * Sets value based on offset.\n   * @param integer $offset Offset\n   * @param mixed $value Value to be set\n   * @return void\n   */\n  public function offsetSet($offset, $value) : void {\n    if (is_null($offset)) {\n      $this->container[] = $value;\n    } else {\n      $this->container[$offset] = $value;\n    }\n  }\n\n  /**\n   * Unsets offset.\n   * @param integer $offset Offset\n   * @return void\n   */\n  public function offsetUnset($offset) : void {\n    unset($this->container[$offset]);\n  }\n\n  public function normalize() {\n    $extended_device_info_array = array();\n    $extended_device_info_array[self::EXT_INFO_VERSION] = $this->getExtInfoVersion();\n    $extended_device_info_array[self::APP_PACKAGE_NAME] = $this->getAppPackageName();\n    $extended_device_info_array[self::SHORT_VERSION] = $this->getShortVersion();\n    $extended_device_info_array[self::LONG_VERSION] = $this->getLongVersion();\n    $extended_device_info_array[self::OS_VERSION] = $this->getOsVersion();\n    $extended_device_info_array[self::DEVICE_MODEL_NAME] = $this->getDeviceModelName();\n    $extended_device_info_array[self::LOCALE] = $this->getLocale();\n    $extended_device_info_array[self::TIMEZONE_ABBREVIATION] = $this->getTimezoneAbbreviation();\n    $extended_device_info_array[self::CARRIER] = $this->getCarrier();\n    $extended_device_info_array[self::SCREEN_WIDTH] = $this->getScreenWidth();\n    $extended_device_info_array[self::SCREEN_HEIGHT] = $this->getScreenHeight();\n    $extended_device_info_array[self::SCREEN_DENSITY] = $this->getScreenDensity();\n    $extended_device_info_array[self::CPU_CORE_COUNT] = $this->getCpuCoreCount();\n    $extended_device_info_array[self::TOTAL_DISK_SPACE_GB] = $this->getTotalDiskSpaceGb();\n    $extended_device_info_array[self::FREE_DISK_SPACE_GB] = $this->getFreeDiskSpaceGb();\n    $extended_device_info_array[self::DEVICE_TIME_ZONE] = $this->getDeviceTimeZone();\n\n    return $extended_device_info_array;\n  }\n\n  public function getExtInfoVersion() {\n    return $this->container['ext_info_version'];\n  }\n\n  public function getAppPackageName() {\n    return $this->container['app_package_name'];\n  }\n\n  public function getShortVersion() {\n    return $this->container['short_version'];\n  }\n\n  public function getLongVersion() {\n    return $this->container['long_version'];\n  }\n\n  public function getOsVersion() {\n    return $this->container['os_version'];\n  }\n\n  public function getDeviceModelName() {\n    return $this->container['device_model_name'];\n  }\n\n  public function getLocale() {\n    return $this->container['locale'];\n  }\n\n  public function getTimezoneAbbreviation() {\n    return $this->container['timezone_abbreviation'];\n  }\n\n  public function getCarrier() {\n    return $this->container['carrier'];\n  }\n\n  public function getScreenWidth() {\n    return $this->container['screen_width'];\n  }\n\n  public function getScreenHeight() {\n    return $this->container['screen_height'];\n  }\n\n  public function getScreenDensity() {\n    return $this->container['screen_density'];\n  }\n\n  public function getCpuCoreCount() {\n    return $this->container['cpu_core_count'];\n  }\n\n  public function getTotalDiskSpaceGb() {\n    return $this->container['total_disk_space_gb'];\n  }\n\n  public function getFreeDiskSpaceGb() {\n    return $this->container['free_disk_space_gb'];\n  }\n\n  public function getDeviceTimeZone() {\n    return $this->container['device_time_zone'];\n  }\n\n  /**\n   * Gets the string presentation of the object\n   * @return string\n   */\n  public function __toString() {\n    if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n      return json_encode($this, JSON_PRETTY_PRINT);\n    }\n\n    return json_encode($this);\n  }\n\n}\n", "num_lines": 417}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\ninterface Filter\n{\n    /**\n     * Returns a boolean on whether the event should be filtered\n     * @param Event $event\n     * @return bool\n     */\n    public function shouldSendEvent(Event $event): bool;\n}\n", "num_lines": 36}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * Class Gender\n * @package FacebookAds\\Object\\ServerSide\n */\nclass Gender extends AbstractEnum {\n\n  const MALE = 'm';\n  const FEMALE = 'f';\n\n  public function getFieldTypes() {\n    return array(\n      'm' => 'string',\n      'f' => 'string',\n    );\n  }\n}", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\nfinal class HttpMethod extends AbstractEnum {\n  const POST = 'POST';\n  const PUT = 'PUT';\n  const GET = 'GET';\n  const DELETE = 'DELETE';\n}\n", "num_lines": 35}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nclass HttpServiceClientConfig extends Singleton {\n  protected $client = null;\n  protected $access_token = null;\n  protected $appsecret = null;\n\n  public function __construct() {}\n\n  public function getClient() {\n    return $this->client;\n  }\n\n  public function getAccessToken() {\n    return $this->access_token;\n  }\n\n  public function getAppsecret() {\n    return $this->appsecret;\n  }\n\n  public function setClient($client) {\n    $this->client = $client;\n  }\n\n  public function setAccessToken($access_token) {\n    $this->access_token = $access_token;\n  }\n\n  public function setAppsecret($appsecret) {\n    $this->appsecret = $appsecret;\n  }\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\ninterface HttpServiceInterface {\n  /**\n   * @param string $url The graph API endpoint that will be requested\n   * @param FacebookAds\\Object\\ServerSide\\HttpMethod $method The HTTP request method\n   * @param array $curl_options Contains curl options\n   * @param array $headers Contains HTTP request headers including User-Agent and Accept-Encoding\n   * @param array $params Contains request parameters including access_token, data, test_event_code, etc.\n   * @return FacebookAds\\Object\\ServerSide\\EventResponse\n   */\n  public function executeRequest($url, $method, array $curl_options, array $headers, array $params);\n}\n", "num_lines": 38}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse InvalidArgumentException;\n\n/**\n * Normalizer Class\n *\n * @category    Class\n * @package     FacebookAds\\Object\\ServerSide\n */\nclass Normalizer {\n  /**\n   * @param string $field to be normalized.\n   * @param string $data value to be normalized\n   * @return string\n   */\n  public static function normalize($field, $data) {\n    if ($data == null || strlen($data) == 0) {\n      return null;\n    }\n\n    // Check if already hashed. If yes, don't try to normalize an already hashed data.\n    if (Util::isHashed($data)) {\n      return $data;\n    }\n\n    $data = trim(strtolower($data));\n    $normalized_data = $data;\n\n    switch ($field) {\n      case 'em':\n        $normalized_data = Normalizer::normalizeEmail($data);\n        break;\n\n      case 'ph':\n        $normalized_data = Normalizer::normalizePhone($data);\n        break;\n\n      case 'zp':\n        $normalized_data = Normalizer::normalizeZipCode($data);\n        break;\n\n      case 'ct':\n        $normalized_data = Normalizer::normalizeCity($data);\n        break;\n\n      case 'st':\n        $normalized_data = Normalizer::normalizeState($data);\n        break;\n\n      case 'country':\n        $normalized_data = Normalizer::normalizeCountry($data);\n        break;\n\n      case 'currency':\n        $normalized_data = Normalizer::normalizeCurrency($data);\n        break;\n\n      case 'f5first':\n        $normalized_data = Normalizer::normalizeF5($data);\n        break;\n\n      case 'f5last':\n        $normalized_data = Normalizer::normalizeF5($data);\n        break;\n\n      case 'fi':\n        $normalized_data = Normalizer::normalizeFi($data);\n        break;\n\n      case 'dobd':\n        $normalized_data = Normalizer::normalizeDobd($data);\n        break;\n\n      case 'dobm':\n        $normalized_data = Normalizer::normalizeDobm($data);\n        break;\n\n      case 'doby':\n        $normalized_data = Normalizer::normalizeDoby($data);\n        break;\n\n      case 'delivery_category':\n        $normalized_data = Normalizer::normalizeDeliveryCategory($data);\n        break;\n\n      case 'action_source':\n        $normalized_data = Normalizer::normalizeActionSource($data);\n        break;\n\n      default:\n    }\n\n    return $normalized_data;\n  }\n\n  /**\n   * @param string $email Email address to be normalized.\n   * @return string\n   */\n  private static function normalizeEmail($email) {\n    // Validates email against RFC 822\n    $result = filter_var($email, FILTER_SANITIZE_EMAIL);\n\n    if (!filter_var($result, FILTER_VALIDATE_EMAIL)) {\n      throw new InvalidArgumentException('Invalid email format for the passed email: ' . $email . 'Please check the passed email format.');\n    }\n\n    return $result;\n  }\n\n  /**\n   * @param string $city city name to be normalized.\n   * @return string\n   */\n  private static function normalizeCity($city) {\n    return trim(preg_replace('/[0-9.\\s\\-()]/', '', $city));\n  }\n\n  /**\n   * @param string $state state name to be normalized.\n   * @return string\n   */\n  private static function normalizeState($state) {\n    return preg_replace('/[^a-z]/', '', $state);\n  }\n\n  /**\n   * @param string $country country code to be normalized(ISO 3166-2).\n   * @return string\n   */\n  private static function normalizeCountry($country) {\n    $result = preg_replace('/[^a-z]/i', '', $country);\n\n    if (strlen($result) != 2) {\n      throw new InvalidArgumentException('Invalid country format passed(' . $country . '). Country Code should be a two-letter ISO Country Code');\n    }\n\n    return $result;\n  }\n\n  /**\n   * @param string $zip postal code to be normalized.\n   * @return string\n   */\n  private static function normalizeZipCode($zip) {\n    // Removing the spaces from the zip code. Eg:\n    $zip = preg_replace('/[ ]/', '', $zip);\n\n    // If the code has more than one part, retain the first part.\n    $zip = explode('-', $zip)[0];\n    return $zip;\n  }\n\n  /**\n   * @param string $phone phone number to be normalized.\n   * @return string\n   */\n  private static function normalizePhone($phone) {\n    $result = trim(preg_replace('/[a-z()-]/', '', $phone));\n\n    if (Normalizer::isInternationalNumber($result)) {\n      $result = preg_replace('/[\\-\\s+]/', '', $result);\n    }\n\n    return $result;\n  }\n\n  /**\n   * @param string $currency currency code to be normalized(ISO 4217).\n   * @return string\n   */\n  private static function normalizeCurrency($currency) {\n    $result = preg_replace('/[^a-z]/i', '', $currency);\n\n    if (strlen($result) != 3) {\n      throw new InvalidArgumentException('Invalid currency format passed(' . $currency . '). Currency Code should be a three-letter ISO Currency Code');\n    }\n\n    return $result;\n  }\n\n  /**\n   *  @param string $name A first or last name to be normalized.\n   *  @return string\n   */\n  private static function normalizeF5($name) {\n    return substr($name, 0, 5);\n  }\n\n  /**\n   *  @param string $fi A first initial to be normalized.\n   *  @return string\n   */\n  private static function normalizeFi($fi) {\n    return substr($fi, 0, 1);\n  }\n\n  /**\n   *  @param string $dobd A date of birth day to be normalized.\n   *  @return string\n   */\n  private static function normalizeDobd($dobd) {\n    if (strlen($dobd) == 1) {\n      $dobd = '0' . $dobd;\n    }\n\n    if (!preg_match('/^[0-9]{2}$/', $dobd)) {\n      throw new InvalidArgumentException('Invalid dobd passed(' . $dobd . '). Date of birth day should be in format \"DD\".');\n    }\n\n    $dobd_int = intval($dobd);\n    $in_day_range = ($dobd_int >= 1) && ($dobd_int <= 31);\n    if (!$in_day_range) {\n      throw new InvalidArgumentException('Invalid dobd passed(' . $dobd . '). Date of birth day should be in format \"DD\".');\n    }\n\n    return $dobd;\n  }\n\n  /**\n   *  @param string $dobm A date of birth month to be normalized.\n   *  @return string\n   */\n  private static function normalizeDobm($dobm) {\n    if (strlen($dobm) == 1) {\n      $dobm = '0' . $dobm;\n    }\n\n    if (!preg_match('/^[0-9]{2}$/', $dobm)) {\n      throw new InvalidArgumentException('Invalid dobm passed(' . $dobm . '). Date of birth month should be in format \"MM\".');\n    }\n\n    $dobm_int = intval($dobm);\n    $in_month_range = ($dobm_int >= 1) && ($dobm_int <= 12);\n    if (!$in_month_range) {\n      throw new InvalidArgumentException('Invalid dobm passed(' . $dobm . '). Date of birth month should be in format \"MM\".');\n    }\n\n    return $dobm;\n  }\n\n  /**\n   *  @param string $doby A date of birth year to be normalized.\n   *  @return string\n   */\n  private static function normalizeDoby($doby) {\n    if (!preg_match('/^[0-9]{4}$/', $doby)) {\n      throw new InvalidArgumentException('Invalid doby passed(' . $doby . '). Date of birth year should be in format \"YYYY\".');\n    }\n\n    return $doby;\n  }\n\n  /**\n   * Normalizes the type of DeliveryCategory and throws error if invalid.\n   * @param string $delivery_category type of DeliveryCategory.\n   * @return string\n   */\n  private static function normalizeDeliveryCategory($delivery_category) {\n\n    $delivery_categories = DeliveryCategory::getInstance()->getValues();\n      if(!DeliveryCategory::getInstance()->isValidValue($delivery_category))\n        throw new InvalidArgumentException('Invalid delivery_category passed: ' . $delivery_category .\n                          '.Allowed values are one of ' . implode(\",\",$delivery_categories));\n\n    return $delivery_category;\n  }\n\n  /**\n   * @param string $phone_number Phone number to be normalized.\n   * @return bool\n   */\n  private static function isInternationalNumber($phone_number) {\n    // Remove spaces and hyphens\n    $phone_number = preg_replace('/[\\-\\s]/', '', $phone_number);\n\n    // Strip + and up to 2 leading 0s\n    $phone_number = preg_replace('/^\\+?0{0,2}/', '', $phone_number);\n\n    if (substr($phone_number, 0, 1) === '0') {\n      return false;\n    }\n\n    // International Phone number with country calling code.\n    $international_number_regex = '/^\\d{1,4}\\(?\\d{2,3}\\)?\\d{4,}$/';\n\n    return preg_match($international_number_regex, $phone_number);\n  }\n\n  /**\n   * Normalizes the action_source and throws an error if invalid.\n   * @param string $action_source type of DeliveryCategory.\n   * @return string\n   */\n  private static function normalizeActionSource($action_source) {\n    $action_sources = ActionSource::getInstance()->getValues();\n      if (!ActionSource::getInstance()->isValidValue($action_source)) {\n        throw new InvalidArgumentException(sprintf(\n          'Invalid action_source passed: %s. Allowed values are one of %s',\n          $action_source,\n          implode(\",\", $action_sources)\n        ));\n      }\n\n    return $action_source;\n  }\n}\n", "num_lines": 333}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nabstract class Singleton {\n  /**\n   * @var array\n   */\n  protected static $instances = array();\n\n\n  private function __construct() {}\n\n  public static function getInstance() {\n    $fqn = get_called_class();\n    if (!array_key_exists($fqn, static::$instances)) {\n      static::$instances[$fqn] = new static();\n    }\n\n    return static::$instances[$fqn];\n  }\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\nuse ArrayAccess;\nuse InvalidArgumentException;\n\n/**\n * UserData is a set of identifiers Facebook can use for targeted attribution.\n *\n * @category    Class\n */\nclass UserData implements ArrayAccess {\n  /**\n   * The original name of the model.\n   * @var string\n   */\n  protected static $swaggerModelName = 'server_side_pixel_user_data';\n\n  /**\n   * Error message for when both singular and plural values are set via constructor.\n   * @var string\n  */\n  private static $multiVariableConstructorError = 'Cannot set both %s and %s parameters via constructor. Please set either the singular or plural parameter, not both.';\n\n  /**\n   * Array of property to type mappings. Used for (de)serialization\n   * @var string[]\n   */\n  protected static $param_types = array(\n    'email' => 'string',\n    'emails' => 'string[]',\n    'phone' => 'string',\n    'phones' => 'string[]',\n    'gender' => 'string',\n    'genders' => 'string[]',\n    'date_of_birth' => 'string',\n    'dates_of_birth' => 'string[]',\n    'last_name' => 'string',\n    'last_names' => 'string[]',\n    'first_name' => 'string',\n    'first_names' => 'string[]',\n    'ct' => 'string',\n    'cts' => 'string[]',\n    'state' => 'string',\n    'states' => 'string[]',\n    'country_code' => 'string',\n    'country_codes' => 'string[]',\n    'zip_code' => 'string',\n    'zip_codes' => 'string[]',\n    'external_id' => 'string',\n    'external_ids' => 'string[]',\n    'client_ip_address' => 'string',\n    'client_user_agent' => 'string',\n    'fbc' => 'string',\n    'fbp' => 'string',\n    'subscription_id' => 'string',\n    'fb_login_id' => 'string',\n    'lead_id' => 'string',\n    'f5first' => 'string',\n    'f5last' => 'string',\n    'fi' => 'string',\n    'dobd' => 'string',\n    'dobm' => 'string',\n    'doby' => 'string',\n    'madid' => 'string',\n    'anon_id' => 'string'\n  );\n  /**\n   * Array of attributes where the key is the local name, and the value is the original name\n   * @var string[]\n   */\n  protected static $attributeMap = array(\n    'email' => 'email',\n    'emails' => 'emails',\n    'phone' => 'phone',\n    'phones' => 'phones',\n    'gender' => 'gender',\n    'genders' => 'genders',\n    'date_of_birth' => 'date_of_birth',\n    'dates_of_birth' => 'dates_of_birth',\n    'last_name' => 'last_name',\n    'last_names' => 'last_names',\n    'first_name' => 'first_name',\n    'first_names' => 'first_names',\n    'ct' => 'ct',\n    'cts' => 'cts',\n    'state' => 'state',\n    'states' => 'states',\n    'country_code' => 'country_code',\n    'country_codes' => 'country_codes',\n    'zip_code' => 'zip_code',\n    'zip_codes' => 'zip_codes',\n    'external_id' => 'external_id',\n    'external_ids' => 'external_ids',\n    'client_ip_address' => 'client_ip_address',\n    'client_user_agent' => 'client_user_agent',\n    'fbc' => 'fbc',\n    'fbp' => 'fbp',\n    'subscription_id' => 'subscription_id',\n    'fb_login_id' => 'fb_login_id',\n    'lead_id' => 'lead_id',\n    'f5first' => 'f5first',\n    'f5last' => 'f5last',\n    'fi' => 'fi',\n    'dobd' => 'dobd',\n    'dobm' => 'dobm',\n    'doby' => 'doby',\n    'madid' => 'madid',\n    'anon_id' => 'anon_id'\n  );\n  /**\n   * Array of attributes to setter functions (for deserialization of responses)\n   * @var string[]\n   */\n  protected static $setters = array(\n    'email' => 'setEmail',\n    'emails' => 'setEmails',\n    'phone' => 'setPhone',\n    'phones' => 'setPhones',\n    'gender' => 'setGender',\n    'genders' => 'setGenders',\n    'date_of_birth' => 'setDateOfBirth',\n    'dates_of_birth' => 'setDatesOfBirth',\n    'last_name' => 'setLastName',\n    'last_names' => 'setLastNames',\n    'first_name' => 'setFirstName',\n    'first_names' => 'setFirstNames',\n    'city' => 'setCity',\n    'cities' => 'setCities',\n    'state' => 'setState',\n    'states' => 'setStates',\n    'country_code' => 'setCountryCode',\n    'country_codes' => 'setCountryCodes',\n    'zip_code' => 'setZipCode',\n    'zip_codes' => 'setZipCodes',\n    'external_id' => 'setExternalId',\n    'external_ids' => 'setExternalIds',\n    'client_ip_address' => 'setClientIpAddress',\n    'client_user_agent' => 'setClientUserAgent',\n    'fbc' => 'setFbc',\n    'fbp' => 'setFbp',\n    'subscription_id' => 'setSubscriptionId',\n    'fb_login_id' => 'setFbLoginId',\n    'lead_id' => 'setLeadId',\n    'f5first' => 'setF5first',\n    'f5last' => 'setF5last',\n    'fi' => 'setFi',\n    'dobd' => 'setDobd',\n    'dobm' => 'setDobm',\n    'doby' => 'setDoby',\n    'madid' => 'setMadid',\n    'anon_id' => 'setAnonId'\n  );\n  /**\n   * Array of attributes to getter functions (for serialization of requests)\n   * @var string[]\n   */\n  protected static $getters = array(\n    'email' => 'getEmail',\n    'emails' => 'getEmails',\n    'phone' => 'getPhone',\n    'phones' => 'getPhones',\n    'gender' => 'getGender',\n    'genders' => 'getGenders',\n    'date_of_birth' => 'getDateOfBirth',\n    'dates_of_birth' => 'getDatesOfBirth',\n    'last_name' => 'getLastName',\n    'last_names' => 'getLastNames',\n    'first_name' => 'getFirstName',\n    'first_names' => 'getFirstNames',\n    'city' => 'getCity',\n    'cities' => 'getCities',\n    'state' => 'getState',\n    'states' => 'getStates',\n    'country_code' => 'getCountryCode',\n    'country_codes' => 'getCountryCodes',\n    'zip_code' => 'getZipCode',\n    'zip_codes' => 'getZipCodes',\n    'external_id' => 'getExternalId',\n    'external_ids' => 'getExternalIds',\n    'client_ip_address' => 'getClientIpAddress',\n    'client_user_agent' => 'getClientUserAgent',\n    'fbc' => 'getFbc',\n    'fbp' => 'getFbp',\n    'subscription_id' => 'getSubscriptionId',\n    'fb_login_id' => 'getFbLoginId',\n    'lead_id' => 'getLeadId',\n    'f5first' => 'getF5first',\n    'f5last' => 'getF5last',\n    'fi' => 'getFi',\n    'dobd' => 'getDobd',\n    'dobm' => 'getDobm',\n    'doby' => 'getDoby',\n    'madid' => 'getMadid',\n    'anon_id' => 'getAnonId'\n  );\n  /**\n   * Associative array for storing property values\n   * @var mixed[]\n   */\n  protected $container = array();\n\n  /**\n   * Constructor\n   * @param mixed[] $data Associated array of property value initalizing the model\n   */\n  public function __construct(array $data = null) {\n\n    # Let's make sure not both singular and plural parameters are set\n    if(isset($data['email']) And isset($data['emails'])) {\n      throw new InvalidArgumentException(sprintf(self::$multiVariableConstructorError, 'email', 'emails'));\n    }\n    if(isset($data['phone']) And isset($data['phones'])) {\n      throw new InvalidArgumentException(sprintf(self::$multiVariableConstructorError, 'phone', 'phones'));\n    }\n    if (isset($data['gender']) and isset($data['genders'])) {\n      throw new InvalidArgumentException(sprintf(self::$multiVariableConstructorError, 'gender', 'genders'));\n    }\n    if (isset($data['date_of_birth']) and isset($data['dates_of_birth'])) {\n      throw new InvalidArgumentException(sprintf(self::$multiVariableConstructorError, 'date_of_birth', 'dates_of_birth'));\n    }\n    if (isset($data['last_name']) and isset($data['last_names'])) {\n      throw new InvalidArgumentException(sprintf(self::$multiVariableConstructorError, 'last_name', 'last_names'));\n    }\n    if (isset($data['first_name']) and isset($data['first_names'])) {\n      throw new InvalidArgumentException(sprintf(self::$multiVariableConstructorError, 'first_name', 'first_names'));\n    }\n    if (isset($data['city']) and isset($data['cities'])) {\n      throw new InvalidArgumentException(sprintf(self::$multiVariableConstructorError, 'city', 'cities'));\n    }\n    if (isset($data['state']) and isset($data['states'])) {\n      throw new InvalidArgumentException(sprintf(self::$multiVariableConstructorError, 'state', 'states'));\n    }\n    if (isset($data['country_code']) and isset($data['country_codes'])) {\n      throw new InvalidArgumentException(sprintf(self::$multiVariableConstructorError, 'country_code', 'country_codes'));\n    }\n    if (isset($data['zip_code']) and isset($data['zip_codes'])) {\n      throw new InvalidArgumentException(sprintf(self::$multiVariableConstructorError, 'zip_code', 'zip_codes'));\n    }\n    if (isset($data['external_id']) and isset($data['external_ids'])) {\n      throw new InvalidArgumentException(sprintf(self::$multiVariableConstructorError, 'external_id', 'external_ids'));\n    }\n\n    # Set the parameters depending on which one is passed in.\n    if (isset($data['email'])) {\n      $this->setEmail($data['email']);\n    } else if(isset($data['emails'])) {\n      $this->setEmails($data['emails']);\n    }\n    if (isset($data['phone'])) {\n      $this->setPhone($data['phone']);\n    } else if(isset($data['phones'])) {\n      $this->setPhones($data['phones']);\n    }\n    if (isset($data['gender'])) {\n      $this->setGender($data['gender']);\n    } else if(isset($data['genders'])) {\n      $this->setGenders($data['genders']);\n    }\n    if (isset($data['date_of_birth'])) {\n      $this->setDateOfBirth($data['date_of_birth']);\n    } else if(isset($data['dates_of_birth'])) {\n      $this->setDatesOfBirth($data['dates_of_birth']);\n    }\n    if (isset($data['last_name'])) {\n      $this->setLastName($data['last_name']);\n    } else if(isset($data['last_names'])) {\n      $this->setLastNames($data['last_names']);\n    }\n    if (isset($data['first_name'])) {\n      $this->setFirstName($data['first_name']);\n    } else if(isset($data['first_names'])) {\n      $this->setFirstNames($data['first_names']);\n    }\n    if (isset($data['city'])) {\n      $this->setCity($data['city']);\n    } else if(isset($data['cities'])) {\n      $this->setCities($data['cities']);\n    }\n    if (isset($data['state'])) {\n      $this->setState($data['state']);\n    } else if(isset($data['states'])) {\n      $this->setStates($data['states']);\n    }\n    if (isset($data['country_code'])) {\n      $this->setCountryCode($data['country_code']);\n    } else if(isset($data['country_codes'])) {\n      $this->setCountryCodes($data['country_codes']);\n    }\n    if (isset($data['zip_code'])) {\n      $this->setZipCode($data['zip_code']);\n    } else if(isset($data['zip_codes'])) {\n      $this->setZipCodes($data['zip_codes']);\n    }\n    if (isset($data['external_id'])) {\n      $this->setExternalId($data['external_id']);\n    } else if(isset($data['external_ids'])) {\n      $this->setExternalIds($data['external_ids']);\n    }\n\n    $this->container['client_ip_address'] = isset($data['client_ip_address']) ? $data['client_ip_address'] : null;\n    $this->container['client_user_agent'] = isset($data['client_user_agent']) ? $data['client_user_agent'] : null;\n    $this->container['fbc'] = isset($data['fbc']) ? $data['fbc'] : null;\n    $this->container['fbp'] = isset($data['fbp']) ? $data['fbp'] : null;\n    $this->container['subscription_id'] = isset($data['subscription_id']) ? $data['subscription_id'] : null;\n    $this->container['fb_login_id'] = isset($data['fb_login_id']) ? $data['fb_login_id'] : null;\n    $this->container['lead_id'] = isset($data['lead_id']) ? $data['lead_id'] : null;\n    $this->container['f5first'] = isset($data['f5first']) ? $data['f5first'] : null;\n    $this->container['f5last'] = isset($data['f5last']) ? $data['f5last'] : null;\n    $this->container['fi'] = isset($data['fi']) ? $data['fi'] : null;\n    $this->container['dobd'] = isset($data['dobd']) ? $data['dobd'] : null;\n    $this->container['dobm'] = isset($data['dobm']) ? $data['dobm'] : null;\n    $this->container['doby'] = isset($data['doby']) ? $data['doby'] : null;\n    $this->container['madid'] = isset($data['madid']) ? $data['madid'] : null;\n    $this->container['anon_id'] = isset($data['anon_id']) ? $data['anon_id'] : null;\n\n\n  }\n\n  /**\n   * @return string[]\n   */\n  public static function paramTypes() {\n    return self::$param_types;\n  }\n\n  /**\n   * @return string[]\n   */\n  public static function attributeMap() {\n    return self::$attributeMap;\n  }\n\n  /**\n   * @return string[]\n   */\n  public static function setters() {\n    return self::$setters;\n  }\n\n  /**\n   * @return string[]\n   */\n  public static function getters() {\n    return self::$getters;\n  }\n\n  /**\n   * show all the invalid properties with reasons.\n   *\n   * @return array invalid properties with reasons\n   */\n  public function listInvalidProperties() {\n    $invalid_properties = array();\n    return $invalid_properties;\n  }\n\n  /**\n   * validate all the properties in the model\n   * return true if all passed\n   *\n   * @return bool True if all properteis are valid\n   */\n  public function valid() {\n    return true;\n  }\n\n  /**\n   * Sets an email address, in lowercase.\n   *\n   * <p>Example: joe@eg.com\n   * @param string $email An email address, in lowercase.\n   * @return $this\n   */\n  public function setEmail($email) {\n    $this->container['emails'] = isset($email) ? array($email) : null;\n\n    return $this;\n  }\n\n  /**\n   * Sets a list of email addresses, in lowercase.\n   *\n   * <p>Example: array('joe@eg.com', 'mary@test.com')\n   * @param string[] $emails A list of email addresses, in lowercase.\n   * @return $this\n   */\n  public function setEmails($emails) {\n    $this->container['emails'] = $emails;\n\n    return $this;\n  }\n\n  /**\n   * Sets a phone number. Include only digits with countryCode code, area code, and number.\n   *\n   * <p>Example: 16505551212\n   * @param string $phone A phone number. Include only digits with country code, area code, and number.\n   * @return $this\n   */\n  public function setPhone($phone) {\n    $this->container['phones'] = isset($phone) ? array($phone) : null;\n\n    return $this;\n  }\n\n  /**\n   * Sets a list of phone numbers. Include only digits with countryCode code, area code, and number.\n   *\n   * <p>Example: array('16505551212', '12052062007')\n   * @param string[] $phone A list of phone numbers. Include only digits with country code, area code, and number.\n   * @return $this\n   */\n  public function setPhones($phones) {\n    $this->container['phones'] = $phones;\n\n    return $this;\n  }\n\n  /**\n   * Sets Gender, in lowercase. Either f or m.\n   * @param FacebookAds\\Object\\ServerSide\\Gender $gender Gender, in lowercase. Either f or m.\n   * @return $this\n   */\n  public function setGender($gender) {\n    $this->container['genders'] = isset($gender) ? array($gender) : null;\n\n    return $this;\n  }\n\n  /**\n   * Sets a list of Genders, in lowercase.\n   * <p>Example: array('f', 'm')\n   * @param FacebookAds\\Object\\ServerSide\\Gender[] $genders A list of Genders, in lowercase.\n   * @return $this\n   */\n  public function setGenders($genders) {\n    $this->container['genders'] = $genders;\n\n    return $this;\n  }\n\n  /**\n   * Sets a date of birth given as year, month, and day.\n   *\n   * <p>Example: 19971226 for December 26, 1997.\n   * @param string $date_of_birth A date of birth given as year, month, and day.\n   * @return $this\n   */\n  public function setDateOfBirth($date_of_birth) {\n    $this->container['dates_of_birth'] = isset($date_of_birth) ? array($date_of_birth) : null;\n\n    return $this;\n  }\n\n    /**\n   * Sets a list of dates of birth given as year, month, and day.\n   *\n   * <p>Example: array('19971226', '19880102')\n   * @param string[] $dates_of_birth A list of dates of birth given as year, month, and day.\n   * @return $this\n   */\n  public function setDatesOfBirth($dates_of_birth) {\n    $this->container['dates_of_birth'] = $dates_of_birth;\n\n    return $this;\n  }\n\n  /**\n   * Sets a last name in lowercase.\n   *\n   * <p>Example: smith\n   * @param string $last_name A last name in lowercase.\n   * @return $this\n   */\n  public function setLastName($last_name) {\n    $this->container['last_names'] = isset($last_name) ? array($last_name) : null;\n\n    return $this;\n  }\n\n  /**\n   * Sets a list of last names in lowercase.\n   *\n   * <p>Example: array('smith', 'brown')\n   * @param string[] $last_names A list of last names in lowercase.\n   * @return $this\n   */\n  public function setLastNames($last_names) {\n    $this->container['last_names'] = $last_names;\n\n    return $this;\n  }\n\n  /**\n   * Sets a first name in lowercase.\n   *\n   * <p>Example: joe\n   * @param string $first_name A first name in lowercase.\n   * @return $this\n   */\n  public function setFirstName($first_name) {\n    $this->container['first_names'] = isset($first_name) ? array($first_name) : null;\n\n    return $this;\n  }\n\n  /**\n   * Sets a list of first names in lowercase.\n   *\n   * <p>Example: array('joe', 'mary')\n   * @param string[] $first_names A list of first names in lowercase.\n   * @return $this\n   */\n  public function setFirstNames($first_names) {\n    $this->container['first_names'] = $first_names;\n\n    return $this;\n  }\n\n  /**\n   * Sets a city in lower-case without spaces or punctuation.\n   *\n   * <p>Example: menlopark\n   * @param string $city A city in lower-case without spaces or punctuation.\n   * @return $this\n   */\n  public function setCity($city) {\n    $this->container['cities'] = isset($city) ? array($city) : null;\n\n    return $this;\n  }\n\n  /**\n   * Sets a list of cities in lower-case without spaces or punctuation.\n   *\n   * <p>Example: array('menlopark', 'seattle')\n   * @param string[] $cities A list of cities in lower-case without spaces or punctuation.\n   * @return $this\n   */\n  public function setCities($cities) {\n    $this->container['cities'] = $cities;\n\n    return $this;\n  }\n\n  /**\n   * Sets a two-letter state code in lowercase.\n   *\n   * <p>Example: ca\n   * @param string $state A two-letter state code in lowercase.\n   * @return $this\n   */\n  public function setState($state) {\n    $this->container['states'] = isset($state) ? array($state) : null;\n\n    return $this;\n  }\n\n  /**\n   * Sets a list of two-letter state codes in lowercase.\n   *\n   * <p>Example: array('ca', 'wa')\n   * @param string[] $states A list of two-letter state codes in lowercase.\n   * @return $this\n   */\n  public function setStates($states) {\n    $this->container['states'] = $states;\n\n    return $this;\n  }\n\n  /**\n   * Sets a two-letter country code in lowercase.\n   *\n   * <p>Example: us\n   * @param string $country_code two-letter country code in lowercase.\n   * @return $this\n   */\n  public function setCountryCode($country_code) {\n    $this->container['country_codes'] = isset($country_code) ? array($country_code) : null;\n\n    return $this;\n  }\n\n  /**\n   * Sets a list of two-letter country codes in lowercase.\n   *\n   * <p>Example: array('us', 'ca')\n   * @param string[] $country_codes A list of two-letter country codes in lowercase.\n   * @return $this\n   */\n  public function setCountryCodes($country_codes) {\n    $this->container['country_codes'] = $country_codes;\n\n    return $this;\n  }\n\n  /**\n   * Sets a five-digit zip code.\n   *\n   * <p>Example: 94035\n   * @param string $zip_code A five-digit zip code.\n   * @return $this\n   */\n  public function setZipCode($zip_code) {\n    $this->container['zip_codes'] = isset($zip_code) ? array($zip_code) : null;\n\n    return $this;\n  }\n\n  /**\n   * Sets a list of five-digit zip codes.\n   *\n   * <p>Example: array('94035', '98001')\n   * @param string[] $zip_codes A list of five-digit zip codes.\n   * @return $this\n   */\n  public function setZipCodes($zip_codes) {\n    $this->container['zip_codes'] = $zip_codes;\n\n    return $this;\n  }\n\n  /**\n   * Sets any unique ID from the advertiser, such as loyalty membership IDs, user IDs, and external\n   * cookie IDs. In the Offline Conversions API, this is known as extern_id. For more information,\n   * see Offline Conversions, Providing External IDs. If External ID is being sent via other\n   * channels, then it should be sent in the same format via the Conversions API.\n   * @param string $external_id Any unique ID from the advertiser, such as loyalty membership IDs,\n   *      user IDs, and external cookie IDs.\n   * @return $this\n   */\n  public function setExternalId($external_id) {\n    $this->container['external_ids'] = isset($external_id) ? array($external_id) : null;\n\n    return $this;\n  }\n\n  /**\n   * Sets a list of unique IDs from the advertiser, such as loyalty membership IDs, user IDs, and external\n   * cookie IDs. In the Offline Conversions API, this is known as extern_id. For more information,\n   * see Offline Conversions, Providing External IDs. If External ID is being sent via other\n   * channels, then it should be sent in the same format via the Conversions API.\n   * @param string[] $external_ids A list of unique IDs from the advertiser, such as loyalty membership IDs,\n   *      user IDs, and external cookie IDs.\n   * @return $this\n   */\n  public function setExternalIds($external_ids) {\n    $this->container['external_ids'] = $external_ids;\n\n    return $this;\n  }\n\n  /**\n   * Sets IP address of the browser corresponding to the event.\n   * @param string $client_ip_address The IP address of the browser corresponding to the event.\n   * @return $this\n   */\n  public function setClientIpAddress($client_ip_address) {\n    $this->container['client_ip_address'] = $client_ip_address;\n\n    return $this;\n  }\n\n  /**\n   * Sets user agent for the browser corresponding to the event.\n   * @param string $client_user_agent The user agent for the browser corresponding to the event.\n   * @return $this\n   */\n  public function setClientUserAgent($client_user_agent) {\n    $this->container['client_user_agent'] = $client_user_agent;\n\n    return $this;\n  }\n\n  /**\n   * Sets Facebook click ID value stored in the _fbc browser cookie under your domain. See Managing\n   * fbc and fbp Parameters for how to get this value\n   * (https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/customer-information-parameters#fbc),\n   * or generate this value from a fbclid query parameter.\n   * @param string $fbc The Facebook click ID value stored in the _fbc browser cookie under your domain.\n   * @return $this\n   */\n  public function setFbc($fbc) {\n    $this->container['fbc'] = $fbc;\n\n    return $this;\n  }\n\n  /**\n   * Sets Set Facebook browser ID value stored in the _fbp browser cookie under your domain. See Managing\n   * fbc and fbp Parameters for how to get this value\n   * (https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/customer-information-parameters#fbc),\n   * or generate this value from a fbclid query parameter.\n   * @param string $fbp The Facebook browser ID value stored in the _fbp browser cookie under your domain.\n   * @return $this\n   */\n  public function setFbp($fbp) {\n    $this->container['fbp'] = $fbp;\n\n    return $this;\n  }\n\n  /**\n   * Sets subscription ID for the user in this transaction. This is similar to the order ID for an\n   * individual product.\n   * @param string $subscription_id The subscription ID for the user in this transaction.\n   * @return $this\n   */\n  public function setSubscriptionId($subscription_id) {\n    $this->container['subscription_id'] = $subscription_id;\n\n    return $this;\n  }\n\n  /**\n   * Sets FbLogin ID for the user in this transaction.\n   * ID issued by Facebook when a person first logs into an instance of an app.\n   * This is also known as App-Scoped ID.\n   * @param string $fb_login_id The Fb_Login_Id for the user in this transaction.\n   * @return $this\n   */\n  public function setFbLoginId($fb_login_id) {\n    $this->container['fb_login_id'] = $fb_login_id;\n\n    return $this;\n  }\n\n  /**\n   * Sets lead_id for the user in this transaction.\n   * A lead_id is associated with a lead generated by Facebook's Lead Ads.\n   * @param string $lead_id The lead_id for the user in this transaction.\n   * @return $this\n   */\n  public function setLeadId($lead_id) {\n    $this->container['lead_id'] = $lead_id;\n\n    return $this;\n  }\n\n  /**\n   * Sets the first 5 letters of the first name.\n   * @param string $f5first The first 5 letters of the first name.\n   * @return $this\n   */\n  public function setF5first($f5first) {\n    $this->container['f5first'] = $f5first;\n\n    return $this;\n  }\n\n  /**\n   * Sets the first 5 letters of the last name.\n   * @param string $f5last The first 5 letters of the last name.\n   * @return $this\n   */\n  public function setF5last($f5last) {\n    $this->container['f5last'] = $f5last;\n\n    return $this;\n  }\n\n  /**\n   * Sets the first initial.\n   * @param string $fi The first initial.\n   * @return $this\n   */\n  public function setFi($fi) {\n    $this->container['fi'] = $fi;\n\n    return $this;\n  }\n\n  /**\n   * Sets the date of birth day.\n   * @param string $dobd The date of birth day.\n   * @return $this\n   */\n  public function setDobd($dobd) {\n    $this->container['dobd'] = $dobd;\n\n    return $this;\n  }\n\n  /**\n   * Sets the date of birth month.\n   * @param string $dobm The date of birth month.\n   * @return $this\n   */\n  public function setDobm($dobm) {\n    $this->container['dobm'] = $dobm;\n\n    return $this;\n  }\n\n  /**\n   * Sets the date of birth year.\n   * @param string $doby The date of birth year.\n   * @return $this\n   */\n  public function setDoby($doby) {\n    $this->container['doby'] = $doby;\n\n    return $this;\n  }\n\n  /**\n   * Set the mobile advertiser id which is either Apple's Advertising Identifier (IDFA) or\n   * Google Android's advertising ID\n   *\n   * @param madid is the mobile advertiser id\n   * @return $this\n   */\n  public function setMadid($madid) {\n    $this->container['madid'] = $madid;\n\n    return $this;\n  }\n\n  /**\n   * Set the ID of a person who has installed the app anonymously\n   *\n   * @param anon_id the anonymous id\n   * @return $this\n   */\n  public function setAnonId($anon_id) {\n    $this->container['anon_id'] = $anon_id;\n\n    return $this;\n  }\n\n  /**\n   * Returns true if offset exists. False otherwise.\n   * @param integer $offset Offset\n   * @return boolean\n   */\n  public function offsetExists($offset) : bool {\n    return isset($this->container[$offset]);\n  }\n\n  /**\n   * Gets offset.\n   * @param integer $offset Offset\n   * @return mixed\n   */\n  public function offsetGet($offset) : mixed {\n    return isset($this->container[$offset]) ? $this->container[$offset] : null;\n  }\n\n  /**\n   * Sets value based on offset.\n   * @param integer $offset Offset\n   * @param mixed $value Value to be set\n   * @return void\n   */\n  public function offsetSet($offset, $value) : void {\n    if (is_null($offset)) {\n      $this->container[] = $value;\n    } else {\n      $this->container[$offset] = $value;\n    }\n  }\n\n  /**\n   * Unsets offset.\n   * @param integer $offset Offset\n   * @return void\n   */\n  public function offsetUnset($offset) : void {\n    unset($this->container[$offset]);\n  }\n\n  public function normalize() {\n    $normalized_payload = array();\n\n    $normalized_payload['em'] = $this->normalizeHashDedup('em', $this->getEmails());\n    $normalized_payload['ph'] = $this->normalizeHashDedup('ph', $this->getPhones());\n    $normalized_payload['ge'] = $this->normalizeHashDedup('ge', $this->getGenders());\n    $normalized_payload['db'] = $this->normalizeHashDedup('db', $this->getDatesOfBirth());\n    $normalized_payload['ln'] = $this->normalizeHashDedup('ln', $this->getLastNames());\n    $normalized_payload['fn'] = $this->normalizeHashDedup('fn', $this->getFirstNames());\n    $normalized_payload['ct'] = $this->normalizeHashDedup('ct', $this->getCities());\n    $normalized_payload['st'] = $this->normalizeHashDedup('st', $this->getStates());\n    $normalized_payload['zp'] = $this->normalizeHashDedup('zp', $this->getZipCodes());\n    $normalized_payload['country'] = $this->normalizeHashDedup('country', $this->getCountryCodes());\n    $normalized_payload['external_id'] = $this->dedup($this->getExternalIds());\n    $normalized_payload['client_ip_address'] = $this->getClientIpAddress();\n    $normalized_payload['client_user_agent'] = $this->getClientUserAgent();\n    $normalized_payload['fbc'] = $this->getFbc();\n    $normalized_payload['fbp'] = $this->getFbp();\n    $normalized_payload['subscription_id'] = $this->getSubscriptionId();\n    $normalized_payload['fb_login_id'] = $this->getFbLoginId();\n    $normalized_payload['lead_id'] = $this->getLeadId();\n    $normalized_payload['f5first'] = Util::hash(Normalizer::normalize('f5first', $this->getF5first()));\n    $normalized_payload['f5last'] = Util::hash(Normalizer::normalize('f5last', $this->getF5last()));\n    $normalized_payload['fi'] = Util::hash(Normalizer::normalize('fi', $this->getFi()));\n    $normalized_payload['dobd'] = Util::hash(Normalizer::normalize('dobd', $this->getDobd()));\n    $normalized_payload['dobm'] = Util::hash(Normalizer::normalize('dobm', $this->getDobm()));\n    $normalized_payload['doby'] = Util::hash(Normalizer::normalize('doby', $this->getDoby()));\n    $normalized_payload['madid'] = Util::hash(Normalizer::normalize('madid', $this->getMadid()));\n    $normalized_payload['anon_id'] = Util::hash(Normalizer::normalize('anon_id', $this->getAnonId()));\n    $normalized_payload = array_filter($normalized_payload);\n    return $normalized_payload;\n  }\n\n  /**\n  * Simply return a deduped array for the given array, without performing any normalization or hash.\n  */\n  private function dedup($arr){\n    if(empty($arr)) {\n      return null;\n    }\n    $deduped = array();\n    foreach($arr as $val){\n      $deduped[$val] = true;\n    }\n    return array_keys($deduped);\n  }\n\n  /**\n  * Return a normalized, hashed, and deduped array for the given array.\n  */\n  private function normalizeHashDedup($fieldName, $valueList){\n    if(empty($valueList) || !isset($fieldName)) {\n      return null;\n    }\n    $deduped = array();\n    foreach($valueList as $val){\n      $hashedVal = Util::hash(Normalizer::normalize($fieldName, $val));\n      $deduped[$hashedVal] = true;\n    }\n    return array_keys($deduped);\n  }\n\n  /**\n   * Gets an email address, in lowercase.\n   * @return string\n   */\n  public function getEmail() {\n    return empty($this->container['emails']) ? null : $this->container['emails'][0];\n  }\n\n  /**\n   * Gets a list of email addresses, in lowercase.\n   * @return string[]\n   */\n  public function getEmails() {\n    return empty($this->container['emails']) ? null : $this->container['emails'];\n  }\n\n  /**\n   * Gets a phone number\n   * @return string\n   */\n  public function getPhone() {\n    return empty($this->container['phones']) ? null : $this->container['phones'][0];\n  }\n\n  /**\n   * Gets a list of phone numbers\n   * @return string[]\n   */\n  public function getPhones() {\n    return empty($this->container['phones']) ? null : $this->container['phones'];\n  }\n\n  /**\n   * Gets gender.\n   * @return string\n   */\n  public function getGender() {\n    return empty($this->container['genders']) ? null : $this->container['genders'][0];\n  }\n\n  /**\n   * Gets a list of genders.\n   * @return string[]\n   */\n  public function getGenders() {\n    return empty($this->container['genders']) ? null : $this->container['genders'];\n  }\n\n  /**\n   * Gets Date Of Birth.\n   * @return string\n   */\n  public function getDateOfBirth() {\n    return empty($this->container['dates_of_birth']) ? null : $this->container['dates_of_birth'][0];\n  }\n\n  /**\n   * Gets a list of dates Of Birth.\n   * @return string[]\n   */\n  public function getDatesOfBirth() {\n    return empty($this->container['dates_of_birth']) ? null : $this->container['dates_of_birth'];\n  }\n\n  /**\n   * Gets Last Name.\n   * @return string\n   */\n  public function getLastName() {\n    return empty($this->container['last_names']) ? null : $this->container['last_names'][0];\n  }\n\n  /**\n   * Gets a list of Last Names.\n   * @return string[]\n   */\n  public function getLastNames() {\n    return empty($this->container['last_names']) ? null : $this->container['last_names'];\n  }\n\n  /**\n   * Gets First Name.\n   * @return string\n   */\n  public function getFirstName() {\n    return empty($this->container['first_names']) ? null : $this->container['first_names'][0];\n  }\n\n  /**\n   * Gets a list of First Name.\n   * @return string[]\n   */\n  public function getFirstNames() {\n    return empty($this->container['first_names']) ? null : $this->container['first_names'];\n  }\n\n  /**\n   * Gets city.\n   * @return string\n   */\n  public function getCity() {\n    return empty($this->container['cities']) ? null : $this->container['cities'][0];\n  }\n\n  /**\n   * Gets a list of cities.\n   * @return string[]\n   */\n  public function getCities() {\n    return empty($this->container['cities']) ? null : $this->container['cities'];\n  }\n\n  /**\n   * Gets state.\n   * @return string\n   */\n  public function getState() {\n    return empty($this->container['states']) ? null : $this->container['states'][0];\n  }\n\n  /**\n   * Gets a list of states.\n   * @return string[]\n   */\n  public function getStates() {\n    return empty($this->container['states']) ? null : $this->container['states'];\n  }\n\n  /**\n   * Gets zip code\n   * @return string\n   */\n  public function getZipCode() {\n    return empty($this->container['zip_codes']) ? null : $this->container['zip_codes'][0];\n  }\n\n  /**\n   * Gets zip codes\n   * @return string[]\n   */\n  public function getZipCodes() {\n    return empty($this->container['zip_codes']) ? null : $this->container['zip_codes'];\n  }\n\n  /**\n   * Gets country code.\n   * @return string\n   */\n  public function getCountryCode() {\n    return empty($this->container['country_codes']) ? null : $this->container['country_codes'][0];\n  }\n\n  /**\n   * Gets country codes.\n   * @return string[]\n   */\n  public function getCountryCodes() {\n    return empty($this->container['country_codes']) ? null : $this->container['country_codes'];\n  }\n\n  /**\n   * Gets Any unique ID from the advertiser, such as loyalty membership IDs, user IDs, and external cookie IDs.\n   * @return string\n   */\n  public function getExternalId() {\n    return empty($this->container['external_ids']) ? null : $this->container['external_ids'][0];\n  }\n\n  /**\n   * Gets a list of unique IDs from the advertiser, such as loyalty membership IDs, user IDs, and external cookie IDs.\n   * @return string[]\n   */\n  public function getExternalIds() {\n    return empty($this->container['external_ids']) ? null : $this->container['external_ids'];\n  }\n\n  /**\n   * Gets IP address of the browser corresponding to the event.\n   * @return string\n   */\n  public function getClientIpAddress() {\n    return $this->container['client_ip_address'];\n  }\n\n  /**\n   * Gets user agent for the browser corresponding to the event.\n   * @return string\n   */\n  public function getClientUserAgent() {\n    return $this->container['client_user_agent'];\n  }\n\n  /**\n   * Gets the Facebook click ID value stored in the _fbc browser cookie under your domain.\n   * @return string\n   */\n  public function getFbc() {\n    return $this->container['fbc'];\n  }\n\n  /**\n   * Gets the Facebook browser ID value stored in the _fbp browser cookie under your domain.\n   * @return string\n   */\n  public function getFbp() {\n    return $this->container['fbp'];\n  }\n\n  /**\n   * Gets the subscription ID for the user in this transaction.\n   * @return string\n   */\n  public function getSubscriptionId() {\n    return $this->container['subscription_id'];\n  }\n\n  /**\n   * Gets the FbLogin ID for the user in this transaction.\n   * @return string\n   */\n  public function getFbLoginId() {\n    return $this->container['fb_login_id'];\n  }\n\n  /**\n   * Gets the lead_id for the user in this transaction.\n   * @return string\n   */\n  public function getLeadId() {\n    return $this->container['lead_id'];\n  }\n\n  /**\n   * Gets the first 5 letters of the first name.\n   * @return string\n   */\n  public function getF5first() {\n    return $this->container['f5first'];\n  }\n\n  /**\n   * Gets the first 5 letters of the last name.\n   * @return string\n   */\n  public function getF5last() {\n    return $this->container['f5last'];\n  }\n\n  /**\n   * Gets the first initial.\n   * @return string\n   */\n  public function getFi() {\n    return $this->container['fi'];\n  }\n\n  /**\n   * Gets the date of birth day.\n   * @return string\n   */\n  public function getDobd() {\n    return $this->container['dobd'];\n  }\n\n  /**\n   * Gets the date of birth month.\n   * @return string\n   */\n  public function getDobm() {\n    return $this->container['dobm'];\n  }\n\n  /**\n   * Gets the date of birth year.\n   * @return string\n   */\n  public function getDoby() {\n    return $this->container['doby'];\n  }\n\n  /**\n   * The mobile advertiser id\n   * @return string\n   */\n  public function getMadid() {\n    return $this->container['madid'];\n  }\n\n  /**\n   * ID of the person who has installed the app anonymously\n   * @return string\n   */\n  public function getAnonId() {\n    return $this->container['anon_id'];\n  }\n\n  /**\n   * Gets the string presentation of the object\n   * @return string\n   */\n  public function __toString() {\n    if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n      return json_encode($this, JSON_PRETTY_PRINT);\n    }\n\n    return json_encode($this);\n  }\n}\n", "num_lines": 1267}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\ServerSide;\n\n/**\n * Util Class\n *\n * @category    Class\n * @package     FacebookAds\\Object\\ServerSide\n */\nclass Util {\n  /**\n   * @param string $data hash input data using SHA256 algorithm.\n   * @return string\n   */\n  public static function hash($data) {\n    if ($data == null || Util::isHashed($data)) {\n      return $data;\n    }\n    return hash('sha256', $data, false);\n  }\n\n  /**\n   * @param string $pii PII data to check if its hashed.\n   * @return bool\n   */\n  public static function isHashed($pii) {\n    // it could be sha256 or md5\n    return preg_match('/^[A-Fa-f0-9]{64}$/', $pii) ||\n      preg_match('/^[a-f0-9]{32}$/', $pii);\n  }\n\n  /**\n   * Extracts the IP Address from the PHP Request Context.\n   * @return string\n   */\n  public static function getIpAddress() {\n    $ip_address = null;\n\n    if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n      $ip_address = $_SERVER['HTTP_CLIENT_IP'];\n    } else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n      $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];\n    } else if (!empty($_SERVER['REMOTE_ADDR'])) {\n      $ip_address = $_SERVER['REMOTE_ADDR'];\n    }\n\n    return $ip_address;\n  }\n\n  /**\n   * Extracts the HTTP User Agent from the PHP Request Context.\n   * @return string\n   */\n  public static function getHttpUserAgent() {\n    $user_agent = null;\n\n    if (!empty($_SERVER['HTTP_USER_AGENT'])) {\n      $user_agent = $_SERVER['HTTP_USER_AGENT'];\n    }\n\n    return $user_agent;\n  }\n\n  /**\n   * Extracts the URI from the PHP Request Context.\n   * @return string\n   */\n  public static function getRequestUri() {\n    $url = \"http://\";\n    if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {\n      $url = \"https://\";\n    }\n\n    if (!empty($_SERVER['HTTP_HOST'])) {\n      $url .= $_SERVER['HTTP_HOST'];\n    }\n\n    if (!empty($_SERVER['REQUEST_URI'])) {\n      $url .= $_SERVER['REQUEST_URI'];\n    }\n\n    return $url;\n  }\n\n  /**\n   * Extracts the FBP cookie from the PHP Request Context.\n   * @return string\n   */\n  public static function getFbp() {\n    $fbp = null;\n\n    if (!empty($_COOKIE['_fbp'])) {\n      $fbp = $_COOKIE['_fbp'];\n    }\n\n    return $fbp;\n  }\n\n  /**\n   * Extracts the FBC cookie from the PHP Request Context.\n   * @return string\n   */\n  public static function getFbc() {\n    $fbc = null;\n\n    if (!empty($_COOKIE['_fbc'])) {\n      $fbc = $_COOKIE['_fbc'];\n    }\n\n    return $fbc;\n  }\n\n  public static function getCaBundlePath() {\n    return __DIR__.DIRECTORY_SEPARATOR\n      .str_repeat('..'.DIRECTORY_SEPARATOR, 4)\n      .'fb_ca_chain_bundle.crt';\n  }\n\n  public static function getAppsecretProof($access_token, $appsecret) {\n    return hash_hmac(\n      'sha256',\n      $access_token,\n      $appsecret\n    );\n  }\n}\n", "num_lines": 150}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Signal;\n\nuse FacebookAds\\Object\\BusinessDataAPI\\Content as BusinessDataContent;\nuse FacebookAds\\Object\\ServerSide\\Content as ServerSideContent;\n\nclass Content {\n  /**\n   * Associative array for storing property values for Business Data API\n   * @var BusinessDataContent\n   */\n  protected $businessDataContent= null;\n\n  /**\n   * Associative array for storing property values for Conversion API\n   * @var ServerSideContent\n   */\n  protected $serverSideContent = null;\n\n  /**\n   * Constructor\n   * @param mixed[] $data Associated array of property value initializing the model\n   */\n  public function __construct(array $data = null) {\n    $this->businessDataContent = new BusinessDataContent($data);\n    $this->serverSideContent = new ServerSideContent($data);\n  }\n\n  /**\n   * Get Product Id.\n   * @return array Product Id\n   */\n  public function getProductId() {\n    return Util::constructResponse($this->serverSideContent->getProductId(), $this->businessDataContent->getProductId());\n  }\n\n  /**\n   * Sets product id.\n   * @param string $product_id product id\n   * @return $this\n   */\n  public function setProductId($product_id) {\n    $this->businessDataContent->setProductId($product_id);\n    $this->serverSideContent->setProductId($product_id);\n    return $this;\n  }\n\n  /**\n   * Get number of product.\n   * @return integer quantity\n   */\n  public function getQuantity() {\n    return Util::constructResponse($this->serverSideContent->getQuantity(), $this->businessDataContent->getQuantity());\n  }\n\n  /**\n   * Set number of product.\n   * @param integer $quantity number of items\n   * @return $this\n   */\n  public function setQuantity($quantity) {\n    $this->businessDataContent->setQuantity($quantity);\n    $this->serverSideContent->setQuantity($quantity);\n    return $this;\n  }\n\n  /**\n   * Get total price.\n   * @return array Price\n   */\n  public function getPrice() {\n    return Util::constructResponse(null, $this->businessDataContent->getPrice());\n  }\n\n  /**\n   * Set total price.\n   * @param float Price\n   * @return $this\n   */\n  public function setPrice($price) {\n    $this->businessDataContent->setPrice($price);\n    return $this;\n  }\n\n\n  /**\n   * Get title.\n   * @return array title\n   */\n  public function getTitle() {\n    return Util::constructResponse($this->serverSideContent->getTitle(), $this->businessDataContent->getTitle());\n  }\n\n  /**\n   * Sets title.\n   * @param string $title title\n   * @return $this\n   */\n  public function setTitle($title) {\n    $this->businessDataContent->setTitle($title);\n    $this->serverSideContent->setTitle($title);\n    return $this;\n  }\n\n  /**\n   * Get Item Price.\n   * @return array Item Price\n   */\n  public function getItemPrice() {\n    return Util::constructResponse($this->serverSideContent->getItemPrice(), null);\n  }\n\n  /**\n   * Set Item Price.\n   * @param float $item_price single item price\n   * @return Content\n   */\n  public function setItemPrice($item_price) {\n    $this->serverSideContent->setItemPrice($item_price);\n    return $this;\n  }\n\n  /**\n   * Get description.\n   * @return array description\n   */\n  public function getDescription() {\n    return Util::constructResponse($this->serverSideContent->getDescription(), null);\n  }\n\n  /**\n   * Sets description.\n   * @param string $description description\n   * @return $this\n   */\n  public function setDescription($description) {\n    $this->serverSideContent->setDescription($description);\n    return $this;\n  }\n\n  /**\n   * Get brand.\n   * @return array brand\n   */\n  public function getBrand() {\n    return Util::constructResponse($this->serverSideContent->getBrand(), null);\n  }\n\n  /**\n   * Sets brand.\n   * @param string $brand brand\n   * @return $this\n   */\n  public function setBrand($brand) {\n    $this->serverSideContent->setBrand($brand);\n    return $this;\n  }\n\n  /**\n   * Get category.\n   * @return array category\n   */\n  public function getCategory() {\n    return Util::constructResponse($this->serverSideContent->getCategory(), null);\n  }\n\n  /**\n   * Sets category.\n   * @param string $category category\n   * @return $this\n   */\n  public function setCategory($category) {\n    $this->serverSideContent->setCategory($category);\n    return $this;\n  }\n\n  /**\n   * Gets Type of delivery for a purchase event.\n   * @return array delivery_category\n   */\n  public function getDeliveryCategory() {\n    return Util::constructResponse($this->serverSideContent->getDeliveryCategory(), null);\n  }\n\n  /**\n   * Sets Type of delivery for a purchase event.\n   * @param string $delivery_category\n   * @return $this\n   */\n  public function setDeliveryCategory($delivery_category) {\n    $this->serverSideContent->setDeliveryCategory($delivery_category);\n    return $this;\n  }\n\n  /**\n   * Gets content for Business Data API\n   * @return BusinessDataContent\n   */\n  public function getBusinessDataContent() {\n    return $this->businessDataContent;\n  }\n\n  /**\n   * Gets content for Conversion API\n   * @return ServerSideContent\n   */\n  public function getServerSideContent() {\n    return $this->serverSideContent;\n  }\n}\n", "num_lines": 234}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Signal;\n\nuse FacebookAds\\Object\\BusinessDataAPI\\CustomData as BusinessDataCustomData;\nuse FacebookAds\\Object\\ServerSide\\CustomData as ServerSideCustomData;\n\nclass CustomData {\n\n  /**\n   * Associative array for storing property values for Business Data API\n   * @var BusinessDataCustomData\n   */\n  protected $businessDataCustomData= null;\n\n  /**\n   * Associative array for storing property values for Conversion API\n   * @var ServerSideCustomData\n   */\n  protected $serverSideCustomData = null;\n\n  /**\n   * Constructor\n   * @param mixed[] $data Associated array of property value initializing the model\n   */\n  public function __construct(array $data = null) {\n    $business_contents = array();\n    $server_contents = array();\n    if(isset($data['contents'])){\n        foreach ($data['contents'] as $content) {\n            array_push($business_contents, $content->getBusinessDataContent());\n            array_push($server_contents, $content->getServerSideContent());\n        }\n    }\n\n    $business_data = $data;\n    $server_data = $data;\n    $business_data['contents'] =  $business_contents;\n    $server_data['contents'] = $server_contents;\n    $business_data['billing_contact'] = isset($data['billing_contact']) ? $data['billing_contact']->getBusinessDataUserData() : null;\n    $business_data['shipping_contact'] = isset($data['shipping_contact']) ? $data['shipping_contact']->getBusinessDataUserData() : null;\n    $this->businessDataCustomData = new BusinessDataCustomData($business_data);\n    $this->serverSideCustomData = new ServerSideCustomData($server_data);\n  }\n\n  /**\n   * Sets value\n   * @param float $value A numeric value associated with this event.\n   *         This could be a monetary value or a value in some other metric.\n   * @return $this\n   */\n  public function setValue($value) {\n    $this->businessDataCustomData->setValue($value);\n    $this->serverSideCustomData->setValue($value);\n\n    return $this;\n  }\n\n  /**\n   * Sets currency\n   * @param string $currency The currency for the value specified, if applicable.\n   *          Currency must be a valid ISO 4217 three digit currency code.\n   * @return $this\n   */\n  public function setCurrency($currency) {\n    $this->businessDataCustomData->setCurrency($currency);\n    $this->serverSideCustomData->setCurrency($currency);\n\n    return $this;\n  }\n\n  /**\n   * Sets contents\n   * @param Content[] $contents A list of CustomData objects that contain the product IDs associated with\n   *          the event plus information about the products.\n   * @return $this\n   */\n  public function setContents($contents) {\n    $business_contents = array();\n    $server_contents = array();\n    foreach ($contents as $content) {\n        array_push($business_contents, $content->getBusinessDataContent());\n        array_push($server_contents, $content->getServerSideContent());\n    }\n    $this->businessDataCustomData->setContents($business_contents);\n    $this->serverSideCustomData->setContents($server_contents);\n    return $this;\n  }\n\n  /**\n   * Sets order_id\n   * @param string $order_id The order ID for this transaction as a String.\n   * @return $this\n   */\n  public function setOrderId($order_id) {\n    $this->businessDataCustomData->setOrderId($order_id);\n    $this->serverSideCustomData->setOrderId($order_id);\n\n    return $this;\n  }\n\n  /**\n   * Sets status\n   * @param string status of the order\n   *\n   * @return $this\n   */\n  public function setStatus($status) {\n    $this->businessDataCustomData->setStatus($status);\n    $this->serverSideCustomData->setStatus($status);\n\n    return $this;\n  }\n\n  /**\n   * Sets billing contact\n   * @param UserData billing_contact of the order\n   *\n   * @return $this\n   */\n  public function setBillingContact($billing_contact) {\n    $this->businessDataCustomData->setBillingContact($billing_contact->getBusinessDataUserData());\n\n    return $this;\n  }\n\n  /**\n   * Sets shipping contact\n   * @param UserData shipping_contact of the order\n   *\n   * @return $this\n   */\n  public function setShippingContact($shipping_contact) {\n    $this->businessDataCustomData->setShippingContact($shipping_contact->getBusinessDataUserData());\n\n    return $this;\n  }\n\n  /**\n   * Sets external order id\n   * @param string external_order_id unique order id\n   *\n   * @return $this\n   */\n  public function setExternalOrderId($external_order_id) {\n    $this->businessDataCustomData->setExternalOrderId($external_order_id);\n\n    return $this;\n  }\n\n  /**\n   * Sets original order id\n   * @param string original_order_id for Refund event.\n   *\n   * @return $this\n   */\n  public function setOriginalOrderId($original_order_id) {\n    $this->businessDataCustomData->setOriginalOrderId($original_order_id);\n\n    return $this;\n  }\n\n  /**\n   * Sets message for Refund event\n   * @param string message for Refund event\n   *\n   * @return $this\n   */\n  public function setMessage($message) {\n    $this->businessDataCustomData->setMessage($message);\n\n    return $this;\n  }\n\n  /**\n   * Sets content_name\n   * @param string $content_name The name of the page or product associated with the event. Example: 'lettuce'.\n   *\n   * @return $this\n   */\n  public function setContentName($content_name) {\n    $this->serverSideCustomData->setContentName($content_name);\n\n    return $this;\n  }\n\n  /**\n   * Sets content_category\n   * @param string $content_category The category of the content associated with the event. Example: 'grocery'\n   *\n   * @return $this\n   */\n  public function setContentCategory($content_category) {\n    $this->serverSideCustomData->setContentCategory($content_category);\n\n    return $this;\n  }\n\n  /**\n   * Sets content_ids\n   * @param string[] $content_ids The content IDs associated with the event,\n   *      such as product SKUs for items in an AddToCart event: ['ABC123', 'XYZ789'].\n   *      If content_type is a product, then your content IDs must be an array with a single string value.\n   *      Otherwise, this array can contain any number of string values.\n   *\n   * @return $this\n   */\n  public function setContentIds($content_ids) {\n    $this->serverSideCustomData->setContentIds($content_ids);\n\n    return $this;\n  }\n\n  /**\n   * Sets content_type\n   * @param string $content_type A String equal to either 'product' or 'product_group'.\n   *      Set to product if the keys you send content_ids or contents represent products.\n   *      Set to product_group if the keys you send in content_ids represent product groups.\n   *\n   * @return $this\n   */\n  public function setContentType($content_type) {\n    $this->serverSideCustomData->setContentType($content_type);\n\n    return $this;\n  }\n\n  /**\n   * Sets predicted_ltv\n   * @param float $predicted_ltv The predicted lifetime value of a conversion event.\n   *\n   * @return $this\n   */\n  public function setPredictedLtv($predicted_ltv) {\n    $this->serverSideCustomData->setPredictedLtv($predicted_ltv);\n\n    return $this;\n  }\n\n  /**\n   * Sets num_items\n   * @param string $num_items Use only with InitiateCheckout events.\n   *      The number of items that a user tries to buy during checkout.\n   *\n   * @return $this\n   */\n  public function setNumItems($num_items) {\n    $this->serverSideCustomData->setNumItems($num_items);\n\n    return $this;\n  }\n\n  /**\n   * Sets a search query made by a user. Use only with Search events.\n   * @param string $search_string Use only with Search events.\n   *      A search query made by a user.\n   *\n   * @return $this\n   */\n  public function setSearchString($search_string) {\n    $this->serverSideCustomData->setSearchString($search_string);\n\n    return $this;\n  }\n\n  /**\n   * Sets Type of delivery for a purchase event.\n   * @param string $delivery_category Type of delivery for a purchase event.\n   *\n   * @return $this\n   */\n  public function setDeliveryCategory($delivery_category) {\n    $this->serverSideCustomData->setDeliveryCategory($delivery_category);\n\n    return $this;\n  }\n\n  /**\n   * Sets the item_number.\n   * @param string $item_number The item number.\n   *\n   * @return $this\n   */\n  public function setItemNumber($item_number) {\n    $this->serverSideCustomData->setItemNumber($item_number);\n\n    return $this;\n  }\n\n  /**\n   * Sets custom_properties that are not defined as the standard properties list in custom data.\n   * @param array custom_properties dictionary to include custom properties that are not defined in custom data.\n   *\n   * @return $this\n   */\n  public function setCustomProperties($custom_properties) {\n    $this->serverSideCustomData->setCustomProperties($custom_properties);\n    return $this;\n  }\n\n\n  /**\n   * Gets a numeric value associated with this event.\n   * This could be a monetary value or a value in some other metric.\n   *\n   * @return array\n   */\n  public function getValue() {\n    return Util::constructResponse($this->serverSideCustomData->getValue(), $this->businessDataCustomData->getValue());\n  }\n\n  /**\n   * Gets currency for the value specified, if applicable.\n   * @return array\n   */\n  public function getCurrency() {\n    return Util::constructResponse($this->serverSideCustomData->getCurrency(), $this->businessDataCustomData->getCurrency());\n  }\n\n  /**\n   * Gets a list of CustomData objects that contain the product IDs associated with\n   * the event plus information about the products.\n   * @return array\n   */\n  public function getCustomDatas() {\n    return Util::constructResponse($this->serverSideCustomData->getCustomDatas(), $this->businessDataCustomData->getCustomDatas());\n  }\n\n  /**\n   * Gets the order ID for this transaction as a String.\n   * @return array\n   */\n  public function getOrderId() {\n    return Util::constructResponse($this->serverSideCustomData->getOrderId(), $this->businessDataCustomData->getOrderId());\n  }\n\n  /**\n   * Gets the status of the registration event\n   * @return array\n   */\n  public function getStatus() {\n    return Util::constructResponse($this->serverSideCustomData->getStatus(), $this->businessDataCustomData->getStatus());\n  }\n\n  /**\n   * Gets billing contact\n   *\n   * @return array\n   */\n  public function getBillingContact() {\n    return Util::constructResponse(null, $this->businessDataCustomData->getBillingContact());\n  }\n\n  /**\n   * Gets shipping contact\n   *\n   * @return array\n   */\n  public function getShippingContact() {\n    return Util::constructResponse(null, $this->businessDataCustomData->getShippingContact());\n  }\n\n  /**\n   * Gets external order id\n   *\n   * @return array\n   */\n  public function getExternalOrderId() {\n    return Util::constructResponse(null, $this->businessDataCustomData->getExternalOrderId());\n  }\n\n  /**\n   * Gets original order id\n   *\n   * @return array\n   */\n  public function getOriginalOrderId() {\n    return Util::constructResponse(null, $this->businessDataCustomData->getOriginalOrderId());\n  }\n\n  /**\n   * Gets message\n   *\n   * @return array\n   */\n  public function getMessage() {\n    return Util::constructResponse(null, $this->businessDataCustomData->getMessage());\n  }\n\n  /**\n   * Gets the value of a custom property from the custom_properties bag\n   * @param $key Custom property name\n   * @return array\n   */\n  public function getCustomProperty($key) {\n    return Util::constructResponse($this->serverSideCustomData->getCustomProperty($key), null);\n  }\n\n   /**\n   * Gets content name of the page or product associated with the event. Example: 'lettuce'.\n   * @return array\n   */\n  public function getContentName() {\n    return Util::constructResponse($this->serverSideCustomData->getContentName(), null);\n  }\n\n  /**\n   * Gets the category of the content associated with the event. Example: 'grocery'\n   * @return array\n   */\n  public function getContentCategory() {\n    return Util::constructResponse($this->serverSideCustomData->getContentCategory(), null);\n  }\n\n  /**\n   * Gets the content IDs associated with the event,\n   * such as product SKUs for items in an AddToCart event: ['ABC123', 'XYZ789'].\n   * @return array\n   */\n  public function getContentIds() {\n    return Util::constructResponse($this->serverSideCustomData->getContentIds(), null);\n  }\n\n  /**\n   * Gets content type 'product' or 'product_group'\n   * @return array\n   */\n  public function getContentType() {\n    return Util::constructResponse($this->serverSideCustomData->getContentType(), null);\n  }\n\n  /**\n   * Gets the predicted lifetime value of a conversion event.\n   * @return array\n   */\n  public function getPredictedLtv() {\n    return Util::constructResponse($this->serverSideCustomData->getPredictedLtv(), null);\n  }\n\n  /**\n   * Gets the number of items that a user tries to buy during checkout\n   * @return array\n   */\n  public function getNumItems() {\n    return Util::constructResponse($this->serverSideCustomData->getNumItems(), null);\n  }\n\n  /**\n   * Gets a search query made by a user.\n   * @return array\n   */\n  public function getSearchString() {\n    return Util::constructResponse($this->serverSideCustomData->getSearchString(), null);\n  }\n\n  /**\n   * Gets a delivery_category for a purchase order.\n   * @return array\n   */\n  public function getDeliveryCategory() {\n    return Util::constructResponse($this->serverSideCustomData->getDeliveryCategory(), null);\n  }\n\n  /**\n   * Gets the item number.\n   * @return array\n   */\n  public function getItemNumber() {\n    return Util::constructResponse($this->serverSideCustomData->getItemNumber(), null);\n  }\n\n  /**\n   * Gets Custom Properties dictionary to add properties that are not defined as part of the custom data.\n   * @return array\n   */\n  public function getCustomProperties() {\n    return Util::constructResponse($this->serverSideCustomData->getCustomProperties(), null);\n  }\n\n  /**\n   * Gets custom data for Business Data API\n   * @return BusinessDataCustomData\n   */\n  public function getBusinessDataCustomData() {\n    return $this->businessDataCustomData;\n  }\n\n  /**\n   * Gets custom data for Conversion API\n   * @return ServerSideCustomData\n   */\n  public function getServerSideCustomData() {\n    return $this->serverSideCustomData;\n  }\n}\n", "num_lines": 518}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Signal;\n\nuse FacebookAds\\Object\\BusinessDataAPI\\Event as BusinessDataEvent;\nuse FacebookAds\\Object\\ServerSide\\Event as ServerSideEvent;\n\n\nclass Event {\n   /**\n   * Associative array for storing property values for Business Data API\n   * @var BusinessDataEvent\n   */\n  protected $businessDataEvent= null;\n\n  /**\n   * Associative array for storing property values for Conversion API\n   * @var ServerSideEvent\n   */\n  protected $serverSideEvent = null;\n\n  /**\n   * Constructor\n   * @param mixed[] $data Associated array of property value initalizing the model\n   */\n  public function __construct(array $data = null) {\n    $business_data = $data;\n    $server_data = $data;\n    $business_data['user_data'] = isset($data['user_data']) ? $data['user_data']->getBusinessDataUserData() : null;\n    $server_data['user_data'] = isset($data['user_data']) ? $data['user_data']->getServerSideUserData() : null;\n    $business_data['custom_data'] = isset($data['custom_data']) ? $data['custom_data']->getBusinessDataCustomData() : null;\n    $server_data['custom_data'] = isset($data['custom_data']) ? $data['custom_data']->getServerSideCustomData() : null;\n\n    $this->businessDataEvent = new BusinessDataEvent($business_data);\n    $this->serverSideEvent = new ServerSideEvent($server_data);\n  }\n\n  /**\n   * Sets a Facebook pixel Standard Event or Custom Event name\n   * @param string $event_name A Facebook pixel Standard Event or Custom Event name.\n   * @return $this\n   */\n  public function setEventName($event_name) {\n    $this->businessDataEvent->setEventName($event_name);\n    $this->serverSideEvent->setEventName($event_name);\n\n    return $this;\n  }\n\n  /**\n   * Sets a Unix timestamp in seconds indicating when the actual event occurred\n   * @param int $event_time A Unix timestamp in seconds indicating when the actual event occurred.\n   * @return $this\n   */\n  public function setEventTime($event_time) {\n    $this->businessDataEvent->setEventTime($event_time);\n    $this->serverSideEvent->setEventTime($event_time);\n\n    return $this;\n  }\n\n  /**\n   * Sets an ID used by Facebook to deduplicate the same event sent from both server and browser.\n   * @param string $event_id This ID can be any unique string chosen by the advertiser.\n   * event_id is used to deduplicate events sent by both Facebook Pixel and Server-Side API.\n   * event_name is also used in the deduplication process.\n   * For deduplication, the eventID from Facebook pixel must match the\n   * event_id in the corresponding Server-Side API event.\n   * @return $this\n   */\n  public function setEventId($event_id) {\n    $this->businessDataEvent->setEventId($event_id);\n    $this->serverSideEvent->setEventId($event_id);\n\n    return $this;\n  }\n\n  /**\n   * Sets UserData object that contains user data.\n   * @param FacebookAds\\Object\\Signal\\UserData $user_data\n   * @return $this\n   */\n  public function setUserData($user_data) {\n    $this->businessDataEvent->setUserData($user_data->getBusinessDataUserData());\n    $this->serverSideEvent->setUserData($user_data->getServerSideUserData());\n\n    return $this;\n  }\n\n  /**\n   * Sets CustomData object that includes additional business data about the event.\n   * @param FacebookAds\\Object\\Signal\\CustomData $custom_data\n   * @return $this\n   */\n  public function setCustomData($custom_data) {\n    $this->businessDataEvent->setCustomData($custom_data->getBusinessDataCustomData());\n    $this->serverSideEvent->setCustomData($custom_data->getServerSideCustomData());\n\n    return $this;\n  }\n\n /**\n   * Sets the browser URL where the event happened\n   * @param string $event_source_url The browser URL where the event happened.\n   * @return $this\n   */\n  public function setEventSourceUrl($event_source_url) {\n    $this->serverSideEvent->setEventSourceUrl($event_source_url);\n\n    return $this;\n  }\n\n  /**\n   * Sets a flag that indicates Facebook should or should not use this event for ads delivery optimization\n   * @param bool $opt_out A flag that indicates Facebook should or should not\n   *      use this event for ads delivery optimization.\n   *      If set to true, Facebook only use the event for attribution.\n   * @return $this\n   */\n  public function setOptOut($opt_out) {\n    $this->serverSideEvent->setOptOut($opt_out);\n\n    return $this;\n  }\n\n  /**\n   * Sets the processing options you would like to enable for a specific event.\n   * For more details see: https://developers.facebook.com/docs/marketing-apis/data-processing-options\n   * @param string[], e.g. [] or ['LDU']\n   * @return $this\n   */\n  public function setDataProcessingOptions($data_processing_options) {\n    $this->businessDataEvent->setDataProcessingOptions($data_processing_options);\n    $this->serverSideEvent->setDataProcessingOptions($data_processing_options);\n\n    return $this;\n  }\n\n  /**\n   * Sets a country that you want to associate to this data processing option. If you set a country, you must also set a state.\n   * For more details see: https://developers.facebook.com/docs/marketing-apis/data-processing-options\n   * @param int\n   * @return $this\n   */\n  public function setDataProcessingOptionsCountry($data_processing_options_country) {\n    $this->businessDataEvent->setDataProcessingOptionsCountry($data_processing_options_country);\n    $this->serverSideEvent->setDataProcessingOptionsCountry($data_processing_options_country);\n\n    return $this;\n  }\n\n  /**\n   * Sets a state that you want to associate with this data processing option.\n   * For more details see: https://developers.facebook.com/docs/marketing-apis/data-processing-options\n   * @param int\n   * @return $this\n   *\n   */\n  public function setDataProcessingOptionsState($data_processing_options_state) {\n    $this->businessDataEvent->setDataProcessingOptionsState($data_processing_options_state);\n    $this->serverSideEvent->setDataProcessingOptionsState($data_processing_options_state);\n\n    return $this;\n  }\n\n  /**\n   * Gets Facebook pixel Standard Event or Custom Event name.\n   * @return array\n   */\n  public function getEventName() {\n    return Util::constructResponse($this->serverSideEvent->getEventName(), $this->businessDataEvent->getEventName());\n  }\n\n  /**\n   * Gets Unix timestamp in seconds indicating when the actual event occurred.\n   * @return array\n   */\n  public function getEventTime() {\n    return Util::constructResponse($this->serverSideEvent->getEventTime(), $this->businessDataEvent->getEventTime());\n  }\n\n  /**\n   * Gets Event ID can be any string chosen by the advertiser. It is used by Facebook to deduplicate\n   * the same event sent from both server and browser.\n   *@return array\n   */\n  public function getEventId() {\n    return Util::constructResponse($this->serverSideEvent->getEventId(), $this->businessDataEvent->getEventId());\n  }\n\n  /**\n   * Gets UserData object that contains user data\n   * @return array\n   */\n  public function getUserData() {\n    return Util::constructResponse($this->serverSideEvent->getUserData(), $this->businessDataEvent->getUserData());\n  }\n\n  /**\n   * Gets customData object that includes additional business data about the event.\n   * @return array\n   */\n  public function getCustomData() {\n    return Util::constructResponse($this->serverSideEvent->getCustomData(), $this->businessDataEvent->getCustomData());\n  }\n\n  /**\n   * Gets DataProcessionOptions value of Processing options you would like to enable for a specific event.\n   *@return array\n   */\n  public function getDataProcessingOptions() {\n    return Util::constructResponse($this->serverSideEvent->getDataProcessingOptions(), $this->businessDataEvent->getDataProcessingOptions());\n  }\n\n  /**\n   * Gets DataProcessionOptionsState value that represents the state that you want to associate with this data processing option.\n   *@return array\n   */\n  public function getDataProcessingOptionsState() {\n    return Util::constructResponse($this->serverSideEvent->getDataProcessingOptionsState(), $this->businessDataEvent->getDataProcessingOptionsState());\n  }\n\n  /**\n   * Gets DataProcessionOptionsCountry value that represents the country that you want to associate to this data processing option.\n   *@return array\n   */\n  public function getDataProcessingOptionsCountry() {\n    return Util::constructResponse($this->serverSideEvent->getDataProcessingOptionsCountry(), $this->businessDataEvent->getDataProcessingOptionsCountry());\n  }\n\n /**\n   * Gets event for Business Data API\n   * @return BusinessDataEvent\n   */\n  public function getBusinessDataEvent() {\n    return $this->businessDataEvent;\n  }\n\n  /**\n   * Gets event for Conversion API\n   * @return ServerSideEvent\n   */\n  public function getServerSideEvent() {\n    return $this->serverSideEvent;\n  }\n\n}\n", "num_lines": 270}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Signal;\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Object\\AdsPixel;\nuse FacebookAds\\Object\\Page;\nuse FacebookAds\\Object\\BusinessDataAPI\\EventRequest as BusinessDataEventRequest;\nuse FacebookAds\\Object\\ServerSide\\EventRequest as ServerSideEventRequest;\n\n/**\n * Event Request\n *\n * @category    Class\n */\nclass EventRequest {\n  /**\n   * Associative array for storing property values for Business Data API\n   * @var BusinessDataEventRequest\n   */\n  protected $businessDataEventRequest = null;\n\n  /**\n   * Associative array for storing property values for Conversion API\n   * @var ServerSideEventRequest\n   */\n  protected $serverSideEventRequest = null;\n\n  /**\n   * Constructor\n   * @param string $pixel_id pixel id\n   * @param string $page_id page id\n   * @param mixed[] $data Associated array of property value initializing the model\n   */\n  public function __construct(string $pixel_id, string $page_id, array $data = null) {\n    $business_data = $data;\n    $server_data = $data;\n\n    $business_events = array();\n    $server_events = array();\n    if(isset($data['events'])){\n        foreach ($events as $event) {\n            array_push($business_events, $event->getBusinessDataEvent());\n            array_push($server_events, $event->getServerSideEvent());\n        }\n    }\n    $business_data['events'] = $business_events;\n    $server_data['events'] =  $server_data;\n\n    $this->serverSideEventRequest = new ServerSideEventRequest($pixel_id, $server_data);\n    $this->businessDataEventRequest = new BusinessDataEventRequest($page_id, $business_data);\n  }\n\n  /**\n   * Sets an array of Signal Event objects\n   * @param FacebookAds\\Object\\Signal\\Event[] $events An array of Signal Event objects\n   * @return $this\n   */\n  public function setEvents($events) {\n    $business_events = array();\n    $server_events = array();\n    foreach ($events as $event) {\n        array_push($business_events, $event->getBusinessDataEvent());\n        array_push($server_events, $event->getServerSideEvent());\n    }\n    $this->businessDataEventRequest->setEvents($business_events);\n    $this->serverSideEventRequest->setEvents($server_events);\n\n    return $this;\n  }\n\n  /**\n   * Sets code used to verify that your server events are received correctly by Facebook. Use this\n   * code to test your server events in the Test Events feature in Events Manager.\n   * See Test Events Tool\n   * (https://developers.facebook.com/docs/marketing-api/facebook-pixel/server-side-api/using-the-api#testEvents)\n   * for an example.\n   * @param string $test_event_code Code used to verify that your server events are received correctly by Facebook.\n   * Use this code to test your server events in the Test Events feature in Events Manager. See Test Events Tool\n   * (https://developers.facebook.com/docs/marketing-api/facebook-pixel/server-side-api/using-the-api#testEvents)\n   * for an example.\n   * @return $this\n   */\n  public function setTestEventCode($test_event_code) {\n    $this->serverSideEventRequest->setTestEventCode($test_event_code);\n    return $this;\n  }\n\n  /**\n   * Sets Partner Agent, which specifies who is sending the event.\n   * @param string $partner_agent The partner agent who is sending the event\n   * @return $this\n   */\n  public function setPartnerAgent($partner_agent) {\n    $this->businessDataEventRequest->setPartnerAgent($partner_agent);\n    $this->serverSideEventRequest->setPartnerAgent($partner_agent);\n\n    return $this;\n  }\n\n   /**\n   * Sets namespace_id, a scope used to resolve extern_id or Third-party ID.\n   * Can be another data set or data partner ID.\n   * @return $this\n   */\n  public function setNamespaceId($namespace_id) {\n    $this->serverSideEventRequest->setNamespaceId($namespace_id);\n    return $this;\n  }\n\n    /**\n   * Sets upload_tag, a tag string added to track your Offline event uploads.\n   * @return $this\n   */\n  public function setUploadTag($upload_tag) {\n    $this->serverSideEventRequest->setUploadTag($upload_tag);\n    return $this;\n  }\n\n  /**\n   * Sets upload_id, a unique id used to denote the current set being uploaded.\n   * @return $this\n   */\n  public function setUploadId($upload_id) {\n    $this->serverSideEventRequest->setUploadId($upload_id);\n    return $this;\n  }\n\n  /**\n   * Sets upload_source, the origin/source of data for the dataset to be uploaded.\n   * @return $this\n   */\n  public function setUploadSource($upload_source) {\n    $this->serverSideEventRequest->setUploadSource($upload_source);\n    return $this;\n  }\n\n  /**\n   * Execute the request\n   * @return array\n   */\n  public function execute() {\n      return Util::constructResponse(\n          $this->serverSideEventRequest->execute(),\n          $this->businessDataEventRequest->execute()\n        );\n  }\n\n  /**\n   * Gets an array of Server Event objects\n   * @return array\n   */\n  public function getEvents() {\n    return Util::constructResponse($this->serverSideEvent->getEvents(), $this->businessDataEventRequest->getEvents());\n  }\n\n  /**\n   * Gets Partner Agent, which specifies who is sending the event.\n   * @return array\n   */\n  public function getPartnerAgent() {\n    return Util::constructResponse($this->serverSideEvent->getPartnerAgent(), $this->businessDataEventRequest->getPartnerAgent());\n  }\n\n  /**\n   * Gets namespace_id, a scope used to resolve extern_id or Third-party ID.\n   * Can be another data set or data partner ID.\n   * @return array\n   */\n  public function getNamespaceId() {\n    return Util::constructResponse($this->serverSideEvent->getNamespaceId(), null);\n  }\n\n  /**\n   * Gets upload_id, a unique id used to denote the current set being uploaded.\n   * @return array\n   */\n  public function getUploadId() {\n    return Util::constructResponse($this->serverSideEvent->getUploadId(), null);\n  }\n\n /**\n   * Gets code used to verify that your server events are received correctly by Facebook. Use this\n   * code to test your server events in the Test Events feature in Events Manager.\n   * See Test Events Tool\n   * (https://developers.facebook.com/docs/marketing-api/facebook-pixel/server-side-api/using-the-api#testEvents)\n   * for an example.\n   * @return array\n   */\n  public function getTestEventCode() {\n    return Util::constructResponse($this->serverSideEvent->getTestEventCode(), null);\n  }\n\n\n  /**\n   * Gets upload_tag, a tag string added to track your Offline event uploads.\n   * @return array\n   */\n  public function getUploadTag() {\n    return Util::constructResponse($this->serverSideEvent->getUploadTag(), null);\n  }\n\n  /**\n   * Gets upload_source, the origin/source of data for the dataset to be uploaded.\n   * @return array\n   */\n  public function getUploadSource() {\n    return Util::constructResponse($this->serverSideEvent->getUploadSource(), null);\n  }\n\n}\n", "num_lines": 234}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Signal;\n\nuse Util;\n\nuse FacebookAds\\Object\\BusinessDataAPI\\UserData as BusinessDataUserData;\nuse FacebookAds\\Object\\ServerSide\\UserData as ServerSideUserData;\n\n/**\n * UserData is a set of identifiers Facebook can use for targeted attribution.\n *\n * @category    Class\n */\nclass UserData {\n\n  /**\n   * Associative array for storing property values for Business Data API\n   * @var BusinessDataUserData\n   */\n  protected $businessDataUserData = null;\n\n  /**\n   * Associative array for storing property values for Conversion API\n   * @var ServerSideUserData\n   */\n  protected $serverSideUserData = null;\n\n  /**\n   * Constructor\n   * @param mixed[] $data Associated array of property value initalizing the model\n   */\n  public function __construct(array $data = null) {\n    $this->businessDataUserData = new BusinessDataUserData($data);\n    $this->serverSideUserData = new ServerSideUserData($data);\n  }\n\n  /**\n   * Sets an email address, in lowercase.\n   *\n   * Example: joe@eg.com\n   * @param string $email An email address, in lowercase.\n   * @return $this\n   */\n  public function setEmail($email) {\n    $this->businessDataUserData->setEmail($email);\n    $this->serverSideUserData->setEmail($email);\n    return $this;\n  }\n\n  /**\n   * Sets a phone number. Include only digits with countryCode code, area code, and number.\n   *\n   * Example: 16505551212\n   * @param string $phone A phone number. Include only digits with country code, area code, and number.\n   * @return $this\n   */\n  public function setPhone($phone) {\n    $this->businessDataUserData->setPhone($phone);\n    $this->serverSideUserData->setPhone($phone);\n\n    return $this;\n  }\n\n  /**\n   * Sets Gender, in lowercase. Either f or m.\n   * @param FacebookAds\\Object\\ServerSide\\Gender $gender Gender, in lowercase. Either f or m.\n   * @return $this\n   */\n  public function setGender($gender) {\n    $this->serverSideUserData->setGender($gender);\n\n    return $this;\n  }\n\n  /**\n   * Sets a date of birth given as year, month, and day.\n   *\n   * Example: 19971226 for December 26, 1997.\n   * @param string $date_of_birth A date of birth given as year, month, and day.\n   * @return $this\n   */\n  public function setDateOfBirth($date_of_birth) {\n    $this->businessDataUserData->setDateOfBirth($date_of_birth);\n    $this->serverSideUserData->setDateOfBirth($date_of_birth);\n\n    return $this;\n  }\n\n  /**\n   * Sets a last name in lowercase.\n   *\n   * Example: smith\n   * @param string $last_name A last name in lowercase.\n   * @return $this\n   */\n  public function setLastName($last_name) {\n    $this->businessDataUserData->setLastName($last_name);\n    $this->serverSideUserData->setLastName($last_name);\n\n    return $this;\n  }\n\n  /**\n   * Sets a first name in lowercase.\n   *\n   * Example: joe\n   * @param string $first_name A first name in lowercase.\n   * @return $this\n   */\n  public function setFirstName($first_name) {\n    $this->businessDataUserData->setFirstName($first_name);\n    $this->serverSideUserData->setFirstName($first_name);\n\n    return $this;\n  }\n\n  /**\n   * Sets a city in lowercase without spaces or punctuation.\n   *\n   * Example: menlopark\n   * @param string $city A city in lowercase without spaces or punctuation.\n   * @return $this\n   */\n  public function setCity($city) {\n    $this->businessDataUserData->setCity($city);\n    $this->serverSideUserData->setCity($city);\n\n    return $this;\n  }\n\n  /**\n   * Sets a two-letter state code in lowercase.\n   *\n   * Example: ca\n   * @param string $state A two-letter state code in lowercase.\n   * @return $this\n   */\n  public function setState($state) {\n    $this->businessDataUserData->setState($state);\n    $this->serverSideUserData->setState($state);\n\n    return $this;\n  }\n\n  /**\n   * Sets a two-letter country code in lowercase.\n   *\n   * Example: us\n   * @param string $country_code two-letter country code in lowercase.\n   * @return $this\n   */\n  public function setCountryCode($country_code) {\n    $this->businessDataUserData->setCountryCode($country_code);\n    $this->serverSideUserData->setCountryCode($country_code);\n\n    return $this;\n  }\n\n  /**\n   * Sets a five-digit zip code.\n   *\n   * Example: 94035\n   * @param string $zip_code A five-digit zip code.\n   * @return $this\n   */\n  public function setZipCode($zip_code) {\n    $this->businessDataUserData->setZipCode($zip_code);\n    $this->serverSideUserData->setZipCode($zip_code);\n\n    return $this;\n  }\n\n  /**\n   * Sets any unique ID from the advertiser, such as loyalty membership IDs, user IDs, and external\n   * cookie IDs. In the Offline Conversions API, this is known as extern_id. For more information,\n   * see Offline Conversions, Providing External IDs. If External ID is being sent via other\n   * channels, then it should be sent in the same format via the server-side API.\n   * @param string $external_id Any unique ID from the advertiser, such as loyalty membership IDs,\n   *      user IDs, and external cookie IDs.\n   * @return $this\n   */\n  public function setExternalId($external_id) {\n    $this->businessDataUserData->setExternalId($external_id);\n    $this->serverSideUserData->setExternalId($external_id);\n\n    return $this;\n  }\n\n  /**\n   * Sets IP address of the browser corresponding to the event.\n   * @param string $client_ip_address The IP address of the browser corresponding to the event.\n   * @return $this\n   */\n  public function setClientIpAddress($client_ip_address) {\n    $this->serverSideUserData->setClientIpAddress($client_ip_address);\n\n    return $this;\n  }\n\n  /**\n   * Sets user agent for the browser corresponding to the event.\n   * @param string $client_user_agent The user agent for the browser corresponding to the event.\n   * @return $this\n   */\n  public function setClientUserAgent($client_user_agent) {\n    $this->serverSideUserData->setClientUserAgent($client_user_agent);\n\n    return $this;\n  }\n\n  /**\n   * Sets Facebook click ID value stored in the _fbc browser cookie under your domain. See Managing\n   * fbc and fbp Parameters for how to get this value\n   * (https://developers.facebook.com/docs/marketing-api/facebook-pixel/server-side-api/parameters#fbc),\n   * or generate this value from a fbclid query parameter.\n   * @param string $fbc The Facebook click ID value stored in the _fbc browser cookie under your domain.\n   * @return $this\n   */\n  public function setFbc($fbc) {\n    $this->serverSideUserData->setFbc($fbc);\n\n    return $this;\n  }\n\n  /**\n   * Sets Set Facebook browser ID value stored in the _fbp browser cookie under your domain. See Managing\n   * fbc and fbp Parameters for how to get this value\n   * (https://developers.facebook.com/docs/marketing-api/facebook-pixel/server-side-api/parameters#fbc),\n   * or generate this value from a fbclid query parameter.\n   * @param string $fbp The Facebook browser ID value stored in the _fbp browser cookie under your domain.\n   * @return $this\n   */\n  public function setFbp($fbp) {\n    $this->serverSideUserData->setFbp($fbp);\n\n    return $this;\n  }\n\n  /**\n   * Sets subscription ID for the user in this transaction. This is similar to the order ID for an\n   * individual product.\n   * @param string $subscription_id The subscription ID for the user in this transaction.\n   * @return $this\n   */\n  public function setSubscriptionId($subscription_id) {\n    $this->serverSideUserData->setSubscriptionId($subscription_id);\n\n    return $this;\n  }\n\n  /**\n   * Sets FbLogin ID for the user in this transaction.\n   * ID issued by Facebook when a person first logs into an instance of an app.\n   * This is also known as App-Scoped ID.\n   * @param string $fb_login_id The Fb_Login_Id for the user in this transaction.\n   * @return $this\n   */\n  public function setFbLoginId($fb_login_id) {\n    $this->serverSideUserData->setFbLoginId($fb_login_id);\n\n    return $this;\n  }\n\n  /**\n   * Sets lead_id for the user in this transaction.\n   * A lead_id is associated with a lead generated by Facebook's Lead Ads.\n   * @param string $lead_id The lead_id for the user in this transaction.\n   * @return $this\n   */\n  public function setLeadId($lead_id) {\n    $this->serverSideUserData->setLeadId($lead_id);\n\n    return $this;\n  }\n\n  /**\n   * Sets the first 5 letters of the first name.\n   * @param string $f5first The first 5 letters of the first name.\n   * @return $this\n   */\n  public function setF5first($f5first) {\n    $this->serverSideUserData->setF5first($f5first);\n\n    return $this;\n  }\n\n  /**\n   * Sets the first 5 letters of the last name.\n   * @param string $f5last The first 5 letters of the last name.\n   * @return $this\n   */\n  public function setF5last($f5last) {\n    $this->serverSideUserData->setF5last($f5last);\n\n    return $this;\n  }\n\n  /**\n   * Sets the first initial.\n   * @param string $fi The first initial.\n   * @return $this\n   */\n  public function setFi($fi) {\n    $this->serverSideUserData->setFi($fi);\n\n    return $this;\n  }\n\n  /**\n   * Sets the date of birth day.\n   * @param string $dobd The date of birth day.\n   * @return $this\n   */\n  public function setDobd($dobd) {\n    $this->serverSideUserData->setDobd($dobd);\n\n    return $this;\n  }\n\n  /**\n   * Sets the date of birth month.\n   * @param string $dobm The date of birth month.\n   * @return $this\n   */\n  public function setDobm($dobm) {\n    $this->serverSideUserData->setDobm($dobm);\n\n    return $this;\n  }\n\n  /**\n   * Sets the date of birth year.\n   * @param string $doby The date of birth year.\n   * @return $this\n   */\n  public function setDoby($doby) {\n    $this->serverSideUserData->setDoby($doby);\n\n    return $this;\n  }\n\n  /**\n   * Sets physical address.\n   * @param string $address The physical address.\n   * @return $this\n   */\n  public function setAddress($address) {\n    $this->businessDataUserData->setAddress($address);\n\n    return $this;\n  }\n\n  /**\n   * Gets an email address, in lowercase.\n   * @return array\n   */\n  public function getEmail() {\n    return Util::constructResponse($this->serverSideUserData->getEmail(), $this->businessDataUserData->getEmail());\n  }\n\n  /**\n   * Gets a phone number\n   * @return array\n   */\n  public function getPhone() {\n    return Util::constructResponse($this->serverSideUserData->getPhone(), $this->businessDataUserData->getPhone());\n  }\n\n  /**\n   * Gets gender.\n   * @return array\n   */\n  public function getGender() {\n    return Util::constructResponse($this->serverSideUserData->getGender(), null);\n  }\n\n  /**\n   * Gets Date Of Birth.\n   * @return array\n   */\n  public function getDateOfBirth() {\n    return Util::constructResponse($this->serverSideUserData->getDateOfBirth(), $this->businessDataUserData->getDateOfBirth());\n  }\n\n  /**\n   * Gets Last Name.\n   * @return array\n   */\n  public function getLastName() {\n    return Util::constructResponse($this->serverSideUserData->getLastName(), $this->businessDataUserData->getLastName());\n  }\n\n  /**\n   * Gets First Name.\n   * @return array\n   */\n  public function getFirstName() {\n    return Util::constructResponse($this->serverSideUserData->getFirstName(), $this->businessDataUserData->getFirstName());\n  }\n\n  /**\n   * Gets city.\n   * @return array\n   */\n  public function getCity() {\n    return Util::constructResponse($this->serverSideUserData->getCity(), $this->businessDataUserData->getCity());\n  }\n\n  /**\n   * Gets state.\n   * @return array\n   */\n  public function getState() {\n    return Util::constructResponse($this->serverSideUserData->getState(), $this->businessDataUserData->getState());\n  }\n\n  /**\n   * Gets zip code\n   * @return array\n   */\n  public function getZipCode() {\n    return Util::constructResponse($this->serverSideUserData->getZipCode(), $this->businessDataUserData->getZipCode());\n  }\n\n  /**\n   * Gets country code.\n   * @return array\n   */\n  public function getCountryCode() {\n    return Util::constructResponse($this->serverSideUserData->getCountryCode(), $this->businessDataUserData->getCountryCode());\n  }\n\n  /**\n   * Gets Any unique ID from the advertiser, such as loyalty membership IDs, user IDs, and external cookie IDs.\n   * @return array\n   */\n  public function getExternalId() {\n    return Util::constructResponse($this->serverSideUserData->getExternalId(), $this->businessDataUserData->getExternalId());\n  }\n\n  /**\n   * Gets IP address of the browser corresponding to the event.\n   * @return array\n   */\n  public function getClientIpAddress() {\n    return Util::constructResponse($this->serverSideUserData->getClientIpAddress(), null);\n  }\n\n  /**\n   * Gets user agent for the browser corresponding to the event.\n   * @return array\n   */\n  public function getClientUserAgent() {\n    return Util::constructResponse($this->serverSideUserData->getClientUserAgent(), null);\n  }\n\n  /**\n   * Gets the Facebook click ID value stored in the _fbc browser cookie under your domain.\n   * @return array\n   */\n  public function getFbc() {\n    return Util::constructResponse($this->serverSideUserData->getFbc(), null);\n  }\n\n  /**\n   * Gets the Facebook browser ID value stored in the _fbp browser cookie under your domain.\n   * @return array\n   */\n  public function getFbp() {\n    return Util::constructResponse($this->serverSideUserData->getFbp(), null);\n  }\n\n  /**\n   * Gets the subscription ID for the user in this transaction.\n   * @return array\n   */\n  public function getSubscriptionId() {\n    return Util::constructResponse($this->serverSideUserData->getSubscriptionId(), null);\n  }\n\n  /**\n   * Gets the FbLogin ID for the user in this transaction.\n   * @return array\n   */\n  public function getFbLoginId() {\n    return Util::constructResponse($this->serverSideUserData->getFbLoginId(), null);\n  }\n\n  /**\n   * Gets the lead_id for the user in this transaction.\n   * @return array\n   */\n  public function getLeadId() {\n    return Util::constructResponse($this->serverSideUserData->getLeadId(), null);\n  }\n\n  /**\n   * Gets the first 5 letters of the first name.\n   * @return array\n   */\n  public function getF5first() {\n    return Util::constructResponse($this->serverSideUserData->getF5first(), null);\n  }\n\n  /**\n   * Gets the first 5 letters of the last name.\n   * @return array\n   */\n  public function getF5last() {\n    return Util::constructResponse($this->serverSideUserData->getF5last(), null);\n  }\n\n  /**\n   * Gets the first initial.\n   * @return array\n   */\n  public function getFi() {\n    return Util::constructResponse($this->serverSideUserData->getFi(), null);\n  }\n\n  /**\n   * Gets the date of birth day.\n   * @return array\n   */\n  public function getDobd() {\n    return Util::constructResponse($this->serverSideUserData->getDobd(), null);\n  }\n\n  /**\n   * Gets the date of birth month.\n   * @return array\n   */\n  public function getDobm() {\n    return Util::constructResponse($this->serverSideUserData->getDobm(), null);\n  }\n\n  /**\n   * Gets the date of birth year.\n   * @return array\n   */\n  public function getDoby() {\n    return Util::constructResponse($this->serverSideUserData->getDoby(), null);\n  }\n\n  /**\n   * Gets physical address\n   * @return array\n   */\n  public function getAddress() {\n    return Util::constructResponse(null, $this->businessDataUserData->getAddress());\n  }\n\n  /**\n   * Gets user data for Business Data API\n   * @return BusinessDataUserData\n   */\n  public function getBusinessDataUserData() {\n    return $this->businessDataUserData;\n  }\n\n  /**\n   * Gets user data for Conversion API\n   * @return ServerSideUserData\n   */\n  public function getServerSideUserData() {\n    return $this->serverSideUserData;\n  }\n\n}\n", "num_lines": 593}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Signal;\n\nclass Util {\n  /**\n   * @param capi_data conversion api data\n   * @param bdapi_data business data api data\n   * @return array\n   */\n  public static function constructResponse($capi_data,$bdapi_data) {\n    $response = array();\n    $response['business_data_api'] = $bdapi_data;\n    $response['conversion_api'] = $capi_data;\n    return $response;\n  }\n\n}\n", "num_lines": 41}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Traits;\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Http\\RequestInterface;\n\n/**\n * @method Api getApi()\n * @method string assureId()\n */\ntrait AdLabelAwareCrudObjectTrait {\n\n  /**\n   * Take ad label ids and format them correctly for the request\n   * @param array $adlabel_ids\n   * @return array\n   */\n  protected function formatParams(array $adlabel_ids) {\n    foreach ($adlabel_ids as &$adlabel_id) {\n      $adlabel_id = array('id' => $adlabel_id);\n    }\n\n    return array('adlabels' => $adlabel_ids);\n  }\n\n  /**\n   * @deprecated use createAdLabel instead\n   * @param array $ad_label_ids\n   */\n  public function addAdLabels(array $ad_label_ids) {\n    $this->getApi()->call(\n      '/'.$this->assureId().'/adlabels',\n      RequestInterface::METHOD_POST,\n      $this->formatParams($ad_label_ids));\n  }\n\n  /**\n   * @deprecated use deleteAdLabels instead\n   * @param array $ad_label_ids\n   */\n  public function removeAdLabels(array $ad_label_ids) {\n    $this->getApi()->call(\n      '/'.$this->assureId().'/adlabels',\n      RequestInterface::METHOD_DELETE,\n      $this->formatParams($ad_label_ids));\n  }\n}\n", "num_lines": 71}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Traits;\n\nuse FacebookAds\\Enum\\EnumInstanceInterface;\n\n/**\n * @method static EnumInstanceInterface getFieldsEnum()\n */\ntrait FieldValidation {\n\n  /**\n   * @param string $name\n   * @param mixed $value\n   * @throws \\InvalidArgumentException\n   * @staticvar array $fields\n   */\n  public function __set($name, $value) {\n    if (static::getFieldsEnum()->isValidValue($name)) {\n      parent::__set($name, $value);\n    } else {\n      throw new \\InvalidArgumentException(\n        $name.' is not a field of '.get_class($this));\n    }\n  }\n}\n", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Traits;\n\n/**\n * @deprecated\n * This trait will be deprecated\n * @property array $changedFields\n */\ntrait ObjectValidation {\n\n  /**\n   * @param array $params\n   * @return $this\n   */\n  abstract public function save(array $params = array());\n\n  /**\n   * @param array $params\n   * @return $this\n   * @throws \\InvalidArgumentException\n   */\n  public function validate(array $params = array()) {\n    $changed_fields = $this->changedFields;\n    $validate_flag = array(\n      'execution_options' => array('validate_only')\n    );\n    $this->save(array_merge($params, $validate_flag));\n    $this->changedFields = $changed_fields;\n    return $this;\n  }\n}\n", "num_lines": 55}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountActionSourceValues getInstance()\n */\nclass AdAccountActionSourceValues extends AbstractEnum {\n\n  const PHYSICAL_STORE = 'PHYSICAL_STORE';\n  const WEBSITE = 'WEBSITE';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountAdRulesHistoryActionValues getInstance()\n */\nclass AdAccountAdRulesHistoryActionValues extends AbstractEnum {\n\n  const BUDGET_NOT_REDISTRIBUTED = 'BUDGET_NOT_REDISTRIBUTED';\n  const CHANGED_BID = 'CHANGED_BID';\n  const CHANGED_BUDGET = 'CHANGED_BUDGET';\n  const EMAIL = 'EMAIL';\n  const ENABLE_AUTOFLOW = 'ENABLE_AUTOFLOW';\n  const ENDPOINT_PINGED = 'ENDPOINT_PINGED';\n  const ERROR = 'ERROR';\n  const FACEBOOK_NOTIFICATION_SENT = 'FACEBOOK_NOTIFICATION_SENT';\n  const MESSAGE_SENT = 'MESSAGE_SENT';\n  const NOT_CHANGED = 'NOT_CHANGED';\n  const PAUSED = 'PAUSED';\n  const UNPAUSED = 'UNPAUSED';\n}\n", "num_lines": 53}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountAdRulesHistoryEvaluationTypeValues getInstance()\n */\nclass AdAccountAdRulesHistoryEvaluationTypeValues extends AbstractEnum {\n\n  const SCHEDULE = 'SCHEDULE';\n  const TRIGGER = 'TRIGGER';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountAdVolumeRecommendationTypeValues getInstance()\n */\nclass AdAccountAdVolumeRecommendationTypeValues extends AbstractEnum {\n\n  const AB_TEST = 'AB_TEST';\n  const ACO_TOGGLE = 'ACO_TOGGLE';\n  const ADS_REPORTING = 'ADS_REPORTING';\n  const ADVANTAGE_PLUS_CREATIVE = 'ADVANTAGE_PLUS_CREATIVE';\n  const AD_OBJECTIVE = 'AD_OBJECTIVE';\n  const AEM_V2_INELIGIBLE = 'AEM_V2_INELIGIBLE';\n  const AGGREGATED_BID_LIMITED = 'AGGREGATED_BID_LIMITED';\n  const AGGREGATED_BUDGET_LIMITED = 'AGGREGATED_BUDGET_LIMITED';\n  const AGGREGATED_COST_LIMITED = 'AGGREGATED_COST_LIMITED';\n  const AUCTION_OVERLAP = 'AUCTION_OVERLAP';\n  const AUCTION_OVERLAP_CONSOLIDATION = 'AUCTION_OVERLAP_CONSOLIDATION';\n  const AUDIENCE_EXPANSION = 'AUDIENCE_EXPANSION';\n  const AUTOFLOW_OPT_IN = 'AUTOFLOW_OPT_IN';\n  const AUTOMATIC_PLACEMENTS = 'AUTOMATIC_PLACEMENTS';\n  const AUTO_BID = 'AUTO_BID';\n  const BROAD_TARGETING = 'BROAD_TARGETING';\n  const CAPI = 'CAPI';\n  const CONNECT_FACEBOOK_PAGE_TO_INSTAGRAM = 'CONNECT_FACEBOOK_PAGE_TO_INSTAGRAM';\n  const CONNECT_FACEBOOK_PAGE_TO_WHATSAPP = 'CONNECT_FACEBOOK_PAGE_TO_WHATSAPP';\n  const COST_GOAL = 'COST_GOAL';\n  const COST_GOAL_BUDGET_LIMITED = 'COST_GOAL_BUDGET_LIMITED';\n  const COST_GOAL_CPA_LIMITED = 'COST_GOAL_CPA_LIMITED';\n  const CREATIVE_BADGE = 'CREATIVE_BADGE';\n  const CREATIVE_FATIGUE = 'CREATIVE_FATIGUE';\n  const CREATIVE_FATIGUE_HOURLY = 'CREATIVE_FATIGUE_HOURLY';\n  const CREATIVE_LIMITED = 'CREATIVE_LIMITED';\n  const CREATIVE_LIMITED_HOURLY = 'CREATIVE_LIMITED_HOURLY';\n  const DEAD_LINK = 'DEAD_LINK';\n  const ECOSYSTEM_BID_REDUCE_L1_CARDINALITY = 'ECOSYSTEM_BID_REDUCE_L1_CARDINALITY';\n  const FRAGMENTATION = 'FRAGMENTATION';\n  const GES_TEST = 'GES_TEST';\n  const LEARNING_LIMITED = 'LEARNING_LIMITED';\n  const LOW_OUTCOME = 'LOW_OUTCOME';\n  const MMT_CAROUSEL_TO_VIDEO = 'MMT_CAROUSEL_TO_VIDEO';\n  const MOBILE_FIRST_VIDEO = 'MOBILE_FIRST_VIDEO';\n  const MULTI_TEXT = 'MULTI_TEXT';\n  const MUSIC = 'MUSIC';\n  const OPTIMAL_SPEND = 'OPTIMAL_SPEND';\n  const PAYMENT_METHOD = 'PAYMENT_METHOD';\n  const PFR_L1_INLINE_MMT = 'PFR_L1_INLINE_MMT';\n  const PREDICTIVE_CREATIVE_LIMITED = 'PREDICTIVE_CREATIVE_LIMITED';\n  const PREDICTIVE_CREATIVE_LIMITED_HOURLY = 'PREDICTIVE_CREATIVE_LIMITED_HOURLY';\n  const REVERT = 'REVERT';\n  const SCALE_GOOD_CAMPAIGN = 'SCALE_GOOD_CAMPAIGN';\n  const SEMANTIC_BASED_AUDIENCE_EXPANSION = 'SEMANTIC_BASED_AUDIENCE_EXPANSION';\n  const SETUP_PIXEL = 'SETUP_PIXEL';\n  const SHOPS_ADS = 'SHOPS_ADS';\n  const SIGNALS_GROWTH_CAPI = 'SIGNALS_GROWTH_CAPI';\n  const SIX_PLUS_MANUAL_PLACEMENTS = 'SIX_PLUS_MANUAL_PLACEMENTS';\n  const SPEND_LIMIT = 'SPEND_LIMIT';\n  const SYD_TEST_MODE = 'SYD_TEST_MODE';\n  const TOP_ADSETS_WITH_ADS_UNDER_CAP = 'TOP_ADSETS_WITH_ADS_UNDER_CAP';\n  const TOP_CAMPAIGNS_WITH_ADS_UNDER_CAP = 'TOP_CAMPAIGNS_WITH_ADS_UNDER_CAP';\n  const UNECONOMICAL_ADS_THROTTLING = 'UNECONOMICAL_ADS_THROTTLING';\n  const UNUSED_BUDGET = 'UNUSED_BUDGET';\n  const ZERO_IMPRESSION = 'ZERO_IMPRESSION';\n}\n", "num_lines": 97}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountClaimObjectiveValues getInstance()\n */\nclass AdAccountClaimObjectiveValues extends AbstractEnum {\n\n  const AUTOMOTIVE_MODEL = 'AUTOMOTIVE_MODEL';\n  const COLLABORATIVE_ADS = 'COLLABORATIVE_ADS';\n  const HOME_LISTING = 'HOME_LISTING';\n  const MEDIA_TITLE = 'MEDIA_TITLE';\n  const PRODUCT = 'PRODUCT';\n  const TRAVEL = 'TRAVEL';\n  const VEHICLE = 'VEHICLE';\n  const VEHICLE_OFFER = 'VEHICLE_OFFER';\n}\n", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountContentTypeValues getInstance()\n */\nclass AdAccountContentTypeValues extends AbstractEnum {\n\n  const AUTOMOTIVE_MODEL = 'AUTOMOTIVE_MODEL';\n  const DESTINATION = 'DESTINATION';\n  const FLIGHT = 'FLIGHT';\n  const HOME_LISTING = 'HOME_LISTING';\n  const HOTEL = 'HOTEL';\n  const JOB = 'JOB';\n  const LOCAL_SERVICE_BUSINESS = 'LOCAL_SERVICE_BUSINESS';\n  const LOCATION_BASED_ITEM = 'LOCATION_BASED_ITEM';\n  const MEDIA_TITLE = 'MEDIA_TITLE';\n  const OFFLINE_PRODUCT = 'OFFLINE_PRODUCT';\n  const PRODUCT = 'PRODUCT';\n  const VEHICLE = 'VEHICLE';\n  const VEHICLE_OFFER = 'VEHICLE_OFFER';\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountCurrencyValues getInstance()\n */\nclass AdAccountCurrencyValues extends AbstractEnum {\n\n  const AED = 'AED';\n  const ARS = 'ARS';\n  const AUD = 'AUD';\n  const BDT = 'BDT';\n  const BOB = 'BOB';\n  const BRL = 'BRL';\n  const CAD = 'CAD';\n  const CHF = 'CHF';\n  const CLP = 'CLP';\n  const CNY = 'CNY';\n  const COP = 'COP';\n  const CRC = 'CRC';\n  const CZK = 'CZK';\n  const DKK = 'DKK';\n  const DZD = 'DZD';\n  const EGP = 'EGP';\n  const EUR = 'EUR';\n  const GBP = 'GBP';\n  const GTQ = 'GTQ';\n  const HKD = 'HKD';\n  const HNL = 'HNL';\n  const HUF = 'HUF';\n  const IDR = 'IDR';\n  const ILS = 'ILS';\n  const INR = 'INR';\n  const ISK = 'ISK';\n  const JPY = 'JPY';\n  const KES = 'KES';\n  const KRW = 'KRW';\n  const LKR = 'LKR';\n  const MOP = 'MOP';\n  const MXN = 'MXN';\n  const MYR = 'MYR';\n  const NGN = 'NGN';\n  const NIO = 'NIO';\n  const NOK = 'NOK';\n  const NZD = 'NZD';\n  const PEN = 'PEN';\n  const PHP = 'PHP';\n  const PKR = 'PKR';\n  const PLN = 'PLN';\n  const PYG = 'PYG';\n  const QAR = 'QAR';\n  const RON = 'RON';\n  const SAR = 'SAR';\n  const SEK = 'SEK';\n  const SGD = 'SGD';\n  const THB = 'THB';\n  const VALUE_TRY = 'TRY';\n  const TWD = 'TWD';\n  const UAH = 'UAH';\n  const USD = 'USD';\n  const UYU = 'UYU';\n  const VND = 'VND';\n  const ZAR = 'ZAR';\n}\n", "num_lines": 96}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountDefaultObjectiveDefaultObjectiveForUserValues getInstance()\n */\nclass AdAccountDefaultObjectiveDefaultObjectiveForUserValues extends AbstractEnum {\n\n  const APP_INSTALLS = 'APP_INSTALLS';\n  const BRAND_AWARENESS = 'BRAND_AWARENESS';\n  const EVENT_RESPONSES = 'EVENT_RESPONSES';\n  const LEAD_GENERATION = 'LEAD_GENERATION';\n  const LINK_CLICKS = 'LINK_CLICKS';\n  const LOCAL_AWARENESS = 'LOCAL_AWARENESS';\n  const MESSAGES = 'MESSAGES';\n  const OFFER_CLAIMS = 'OFFER_CLAIMS';\n  const OUTCOME_APP_PROMOTION = 'OUTCOME_APP_PROMOTION';\n  const OUTCOME_AWARENESS = 'OUTCOME_AWARENESS';\n  const OUTCOME_ENGAGEMENT = 'OUTCOME_ENGAGEMENT';\n  const OUTCOME_LEADS = 'OUTCOME_LEADS';\n  const OUTCOME_SALES = 'OUTCOME_SALES';\n  const OUTCOME_TRAFFIC = 'OUTCOME_TRAFFIC';\n  const PAGE_LIKES = 'PAGE_LIKES';\n  const POST_ENGAGEMENT = 'POST_ENGAGEMENT';\n  const PRODUCT_CATALOG_SALES = 'PRODUCT_CATALOG_SALES';\n  const REACH = 'REACH';\n  const STORE_VISITS = 'STORE_VISITS';\n  const VIDEO_VIEWS = 'VIDEO_VIEWS';\n  const WEBSITE_CONVERSIONS = 'WEBSITE_CONVERSIONS';\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountDefaultObjectiveObjectiveForLevelValues getInstance()\n */\nclass AdAccountDefaultObjectiveObjectiveForLevelValues extends AbstractEnum {\n\n  const APP_INSTALLS = 'APP_INSTALLS';\n  const BRAND_AWARENESS = 'BRAND_AWARENESS';\n  const EVENT_RESPONSES = 'EVENT_RESPONSES';\n  const LEAD_GENERATION = 'LEAD_GENERATION';\n  const LINK_CLICKS = 'LINK_CLICKS';\n  const LOCAL_AWARENESS = 'LOCAL_AWARENESS';\n  const MESSAGES = 'MESSAGES';\n  const OFFER_CLAIMS = 'OFFER_CLAIMS';\n  const OUTCOME_APP_PROMOTION = 'OUTCOME_APP_PROMOTION';\n  const OUTCOME_AWARENESS = 'OUTCOME_AWARENESS';\n  const OUTCOME_ENGAGEMENT = 'OUTCOME_ENGAGEMENT';\n  const OUTCOME_LEADS = 'OUTCOME_LEADS';\n  const OUTCOME_SALES = 'OUTCOME_SALES';\n  const OUTCOME_TRAFFIC = 'OUTCOME_TRAFFIC';\n  const PAGE_LIKES = 'PAGE_LIKES';\n  const POST_ENGAGEMENT = 'POST_ENGAGEMENT';\n  const PRODUCT_CATALOG_SALES = 'PRODUCT_CATALOG_SALES';\n  const REACH = 'REACH';\n  const STORE_VISITS = 'STORE_VISITS';\n  const VIDEO_VIEWS = 'VIDEO_VIEWS';\n  const WEBSITE_CONVERSIONS = 'WEBSITE_CONVERSIONS';\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountDeliveryEstimateOptimizationGoalValues getInstance()\n */\nclass AdAccountDeliveryEstimateOptimizationGoalValues extends AbstractEnum {\n\n  const AD_RECALL_LIFT = 'AD_RECALL_LIFT';\n  const APP_INSTALLS = 'APP_INSTALLS';\n  const APP_INSTALLS_AND_OFFSITE_CONVERSIONS = 'APP_INSTALLS_AND_OFFSITE_CONVERSIONS';\n  const CONVERSATIONS = 'CONVERSATIONS';\n  const DERIVED_EVENTS = 'DERIVED_EVENTS';\n  const ENGAGED_USERS = 'ENGAGED_USERS';\n  const EVENT_RESPONSES = 'EVENT_RESPONSES';\n  const IMPRESSIONS = 'IMPRESSIONS';\n  const IN_APP_VALUE = 'IN_APP_VALUE';\n  const LANDING_PAGE_VIEWS = 'LANDING_PAGE_VIEWS';\n  const LEAD_GENERATION = 'LEAD_GENERATION';\n  const LINK_CLICKS = 'LINK_CLICKS';\n  const MESSAGING_APPOINTMENT_CONVERSION = 'MESSAGING_APPOINTMENT_CONVERSION';\n  const MESSAGING_PURCHASE_CONVERSION = 'MESSAGING_PURCHASE_CONVERSION';\n  const NONE = 'NONE';\n  const OFFSITE_CONVERSIONS = 'OFFSITE_CONVERSIONS';\n  const PAGE_LIKES = 'PAGE_LIKES';\n  const POST_ENGAGEMENT = 'POST_ENGAGEMENT';\n  const QUALITY_CALL = 'QUALITY_CALL';\n  const QUALITY_LEAD = 'QUALITY_LEAD';\n  const REACH = 'REACH';\n  const SUBSCRIBERS = 'SUBSCRIBERS';\n  const THRUPLAY = 'THRUPLAY';\n  const VALUE = 'VALUE';\n  const VISIT_INSTAGRAM_PROFILE = 'VISIT_INSTAGRAM_PROFILE';\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountMatchedSearchApplicationsEdgeDataAppStoreValues getInstance()\n */\nclass AdAccountMatchedSearchApplicationsEdgeDataAppStoreValues extends AbstractEnum {\n\n  const AMAZON_APP_STORE = 'AMAZON_APP_STORE';\n  const APK_MIRROR = 'APK_MIRROR';\n  const APK_MONK = 'APK_MONK';\n  const APK_PURE = 'APK_PURE';\n  const APTOIDE_A1_STORE = 'APTOIDE_A1_STORE';\n  const BEMOBI_MOBILE_STORE = 'BEMOBI_MOBILE_STORE';\n  const DOES_NOT_EXIST = 'DOES_NOT_EXIST';\n  const FB_ANDROID_STORE = 'FB_ANDROID_STORE';\n  const FB_CANVAS = 'FB_CANVAS';\n  const FB_GAMEROOM = 'FB_GAMEROOM';\n  const GALAXY_STORE = 'GALAXY_STORE';\n  const GOOGLE_PLAY = 'GOOGLE_PLAY';\n  const INSTANT_GAME = 'INSTANT_GAME';\n  const ITUNES = 'ITUNES';\n  const ITUNES_IPAD = 'ITUNES_IPAD';\n  const NEON_ANDROID_STORE = 'NEON_ANDROID_STORE';\n  const NONE = 'NONE';\n  const OCULUS_APP_STORE = 'OCULUS_APP_STORE';\n  const OPPO = 'OPPO';\n  const ROKU_STORE = 'ROKU_STORE';\n  const UPTODOWN = 'UPTODOWN';\n  const VIVO = 'VIVO';\n  const WINDOWS_10_STORE = 'WINDOWS_10_STORE';\n  const WINDOWS_STORE = 'WINDOWS_STORE';\n  const XIAOMI = 'XIAOMI';\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountSubtypeValues getInstance()\n */\nclass AdAccountSubtypeValues extends AbstractEnum {\n\n  const APP = 'APP';\n  const BAG_OF_ACCOUNTS = 'BAG_OF_ACCOUNTS';\n  const BIDDING = 'BIDDING';\n  const CLAIM = 'CLAIM';\n  const CUSTOM = 'CUSTOM';\n  const ENGAGEMENT = 'ENGAGEMENT';\n  const FOX = 'FOX';\n  const LOOKALIKE = 'LOOKALIKE';\n  const MANAGED = 'MANAGED';\n  const MEASUREMENT = 'MEASUREMENT';\n  const OFFLINE_CONVERSION = 'OFFLINE_CONVERSION';\n  const PARTNER = 'PARTNER';\n  const PRIMARY = 'PRIMARY';\n  const REGULATED_CATEGORIES_AUDIENCE = 'REGULATED_CATEGORIES_AUDIENCE';\n  const STUDY_RULE_AUDIENCE = 'STUDY_RULE_AUDIENCE';\n  const VIDEO = 'VIDEO';\n  const WEBSITE = 'WEBSITE';\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountTargetingUnifiedAppStoreValues getInstance()\n */\nclass AdAccountTargetingUnifiedAppStoreValues extends AbstractEnum {\n\n  const AMAZON_APP_STORE = 'amazon_app_store';\n  const APK_MIRROR = 'apk_mirror';\n  const APK_MONK = 'apk_monk';\n  const APK_PURE = 'apk_pure';\n  const APTOIDE_A1_STORE = 'aptoide_a1_store';\n  const BEMOBI_MOBILE_STORE = 'bemobi_mobile_store';\n  const DOES_NOT_EXIST = 'does_not_exist';\n  const FB_ANDROID_STORE = 'fb_android_store';\n  const FB_CANVAS = 'fb_canvas';\n  const FB_GAMEROOM = 'fb_gameroom';\n  const GALAXY_STORE = 'galaxy_store';\n  const GOOGLE_PLAY = 'google_play';\n  const INSTANT_GAME = 'instant_game';\n  const ITUNES = 'itunes';\n  const ITUNES_IPAD = 'itunes_ipad';\n  const NEON_ANDROID_STORE = 'neon_android_store';\n  const NONE = 'none';\n  const OCULUS_APP_STORE = 'oculus_app_store';\n  const OPPO = 'oppo';\n  const ROKU_CHANNEL_STORE = 'roku_channel_store';\n  const UPTODOWN = 'uptodown';\n  const VIVO = 'vivo';\n  const WINDOWS_10_STORE = 'windows_10_store';\n  const WINDOWS_STORE = 'windows_store';\n  const XIAOMI = 'xiaomi';\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountTargetingUnifiedLimitTypeValues getInstance()\n */\nclass AdAccountTargetingUnifiedLimitTypeValues extends AbstractEnum {\n\n  const BEHAVIORS = 'behaviors';\n  const COLLEGE_YEARS = 'college_years';\n  const EDUCATION_MAJORS = 'education_majors';\n  const EDUCATION_SCHOOLS = 'education_schools';\n  const EDUCATION_STATUSES = 'education_statuses';\n  const ETHNIC_AFFINITY = 'ethnic_affinity';\n  const FAMILY_STATUSES = 'family_statuses';\n  const GENERATION = 'generation';\n  const HOME_OWNERSHIP = 'home_ownership';\n  const HOME_TYPE = 'home_type';\n  const HOME_VALUE = 'home_value';\n  const HOUSEHOLD_COMPOSITION = 'household_composition';\n  const INCOME = 'income';\n  const INDUSTRIES = 'industries';\n  const INTERESTED_IN = 'interested_in';\n  const INTERESTS = 'interests';\n  const LIFE_EVENTS = 'life_events';\n  const LOCATION_CATEGORIES = 'location_categories';\n  const MOMS = 'moms';\n  const NET_WORTH = 'net_worth';\n  const OFFICE_TYPE = 'office_type';\n  const POLITICS = 'politics';\n  const RELATIONSHIP_STATUSES = 'relationship_statuses';\n  const USER_ADCLUSTERS = 'user_adclusters';\n  const WORK_EMPLOYERS = 'work_employers';\n  const WORK_POSITIONS = 'work_positions';\n}\n", "num_lines": 67}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountTargetingUnifiedModeValues getInstance()\n */\nclass AdAccountTargetingUnifiedModeValues extends AbstractEnum {\n\n  const BEST_PERFORMING = 'best_performing';\n  const RECENTLY_USED = 'recently_used';\n  const RELATED = 'related';\n  const SUGGESTIONS = 'suggestions';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountTargetingUnifiedObjectiveValues getInstance()\n */\nclass AdAccountTargetingUnifiedObjectiveValues extends AbstractEnum {\n\n  const APP_INSTALLS = 'APP_INSTALLS';\n  const BRAND_AWARENESS = 'BRAND_AWARENESS';\n  const CONVERSIONS = 'CONVERSIONS';\n  const EVENT_RESPONSES = 'EVENT_RESPONSES';\n  const LEAD_GENERATION = 'LEAD_GENERATION';\n  const LINK_CLICKS = 'LINK_CLICKS';\n  const LOCAL_AWARENESS = 'LOCAL_AWARENESS';\n  const MESSAGES = 'MESSAGES';\n  const OFFER_CLAIMS = 'OFFER_CLAIMS';\n  const OUTCOME_APP_PROMOTION = 'OUTCOME_APP_PROMOTION';\n  const OUTCOME_AWARENESS = 'OUTCOME_AWARENESS';\n  const OUTCOME_ENGAGEMENT = 'OUTCOME_ENGAGEMENT';\n  const OUTCOME_LEADS = 'OUTCOME_LEADS';\n  const OUTCOME_SALES = 'OUTCOME_SALES';\n  const OUTCOME_TRAFFIC = 'OUTCOME_TRAFFIC';\n  const PAGE_LIKES = 'PAGE_LIKES';\n  const POST_ENGAGEMENT = 'POST_ENGAGEMENT';\n  const PRODUCT_CATALOG_SALES = 'PRODUCT_CATALOG_SALES';\n  const REACH = 'REACH';\n  const STORE_VISITS = 'STORE_VISITS';\n  const VIDEO_VIEWS = 'VIDEO_VIEWS';\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountTargetingUnifiedRegulatedCategoriesValues getInstance()\n */\nclass AdAccountTargetingUnifiedRegulatedCategoriesValues extends AbstractEnum {\n\n  const CREDIT = 'CREDIT';\n  const EMPLOYMENT = 'EMPLOYMENT';\n  const HOUSING = 'HOUSING';\n  const ISSUES_ELECTIONS_POLITICS = 'ISSUES_ELECTIONS_POLITICS';\n  const NONE = 'NONE';\n  const ONLINE_GAMBLING_AND_GAMING = 'ONLINE_GAMBLING_AND_GAMING';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountTargetingUnifiedRegulatedCountriesValues getInstance()\n */\nclass AdAccountTargetingUnifiedRegulatedCountriesValues extends AbstractEnum {\n\n  const AD = 'AD';\n  const AE = 'AE';\n  const AF = 'AF';\n  const AG = 'AG';\n  const AI = 'AI';\n  const AL = 'AL';\n  const AM = 'AM';\n  const AN = 'AN';\n  const AO = 'AO';\n  const AQ = 'AQ';\n  const AR = 'AR';\n  const VALUE_AS = 'AS';\n  const AT = 'AT';\n  const AU = 'AU';\n  const AW = 'AW';\n  const AX = 'AX';\n  const AZ = 'AZ';\n  const BA = 'BA';\n  const BB = 'BB';\n  const BD = 'BD';\n  const BE = 'BE';\n  const BF = 'BF';\n  const BG = 'BG';\n  const BH = 'BH';\n  const BI = 'BI';\n  const BJ = 'BJ';\n  const BL = 'BL';\n  const BM = 'BM';\n  const BN = 'BN';\n  const BO = 'BO';\n  const BQ = 'BQ';\n  const BR = 'BR';\n  const BS = 'BS';\n  const BT = 'BT';\n  const BV = 'BV';\n  const BW = 'BW';\n  const BY = 'BY';\n  const BZ = 'BZ';\n  const CA = 'CA';\n  const CC = 'CC';\n  const CD = 'CD';\n  const CF = 'CF';\n  const CG = 'CG';\n  const CH = 'CH';\n  const CI = 'CI';\n  const CK = 'CK';\n  const CL = 'CL';\n  const CM = 'CM';\n  const CN = 'CN';\n  const CO = 'CO';\n  const CR = 'CR';\n  const CU = 'CU';\n  const CV = 'CV';\n  const CW = 'CW';\n  const CX = 'CX';\n  const CY = 'CY';\n  const CZ = 'CZ';\n  const DE = 'DE';\n  const DJ = 'DJ';\n  const DK = 'DK';\n  const DM = 'DM';\n  const VALUE_DO = 'DO';\n  const DZ = 'DZ';\n  const EC = 'EC';\n  const EE = 'EE';\n  const EG = 'EG';\n  const EH = 'EH';\n  const ER = 'ER';\n  const ES = 'ES';\n  const ET = 'ET';\n  const FI = 'FI';\n  const FJ = 'FJ';\n  const FK = 'FK';\n  const FM = 'FM';\n  const FO = 'FO';\n  const FR = 'FR';\n  const GA = 'GA';\n  const GB = 'GB';\n  const GD = 'GD';\n  const GE = 'GE';\n  const GF = 'GF';\n  const GG = 'GG';\n  const GH = 'GH';\n  const GI = 'GI';\n  const GL = 'GL';\n  const GM = 'GM';\n  const GN = 'GN';\n  const GP = 'GP';\n  const GQ = 'GQ';\n  const GR = 'GR';\n  const GS = 'GS';\n  const GT = 'GT';\n  const GU = 'GU';\n  const GW = 'GW';\n  const GY = 'GY';\n  const HK = 'HK';\n  const HM = 'HM';\n  const HN = 'HN';\n  const HR = 'HR';\n  const HT = 'HT';\n  const HU = 'HU';\n  const ID = 'ID';\n  const IE = 'IE';\n  const IL = 'IL';\n  const IM = 'IM';\n  const IN = 'IN';\n  const IO = 'IO';\n  const IQ = 'IQ';\n  const IR = 'IR';\n  const IS = 'IS';\n  const IT = 'IT';\n  const JE = 'JE';\n  const JM = 'JM';\n  const JO = 'JO';\n  const JP = 'JP';\n  const KE = 'KE';\n  const KG = 'KG';\n  const KH = 'KH';\n  const KI = 'KI';\n  const KM = 'KM';\n  const KN = 'KN';\n  const KP = 'KP';\n  const KR = 'KR';\n  const KW = 'KW';\n  const KY = 'KY';\n  const KZ = 'KZ';\n  const LA = 'LA';\n  const LB = 'LB';\n  const LC = 'LC';\n  const LI = 'LI';\n  const LK = 'LK';\n  const LR = 'LR';\n  const LS = 'LS';\n  const LT = 'LT';\n  const LU = 'LU';\n  const LV = 'LV';\n  const LY = 'LY';\n  const MA = 'MA';\n  const MC = 'MC';\n  const MD = 'MD';\n  const ME = 'ME';\n  const MF = 'MF';\n  const MG = 'MG';\n  const MH = 'MH';\n  const MK = 'MK';\n  const ML = 'ML';\n  const MM = 'MM';\n  const MN = 'MN';\n  const MO = 'MO';\n  const MP = 'MP';\n  const MQ = 'MQ';\n  const MR = 'MR';\n  const MS = 'MS';\n  const MT = 'MT';\n  const MU = 'MU';\n  const MV = 'MV';\n  const MW = 'MW';\n  const MX = 'MX';\n  const MY = 'MY';\n  const MZ = 'MZ';\n  const NA = 'NA';\n  const NC = 'NC';\n  const NE = 'NE';\n  const NF = 'NF';\n  const NG = 'NG';\n  const NI = 'NI';\n  const NL = 'NL';\n  const NO = 'NO';\n  const NP = 'NP';\n  const NR = 'NR';\n  const NU = 'NU';\n  const NZ = 'NZ';\n  const OM = 'OM';\n  const PA = 'PA';\n  const PE = 'PE';\n  const PF = 'PF';\n  const PG = 'PG';\n  const PH = 'PH';\n  const PK = 'PK';\n  const PL = 'PL';\n  const PM = 'PM';\n  const PN = 'PN';\n  const PR = 'PR';\n  const PS = 'PS';\n  const PT = 'PT';\n  const PW = 'PW';\n  const PY = 'PY';\n  const QA = 'QA';\n  const RE = 'RE';\n  const RO = 'RO';\n  const RS = 'RS';\n  const RU = 'RU';\n  const RW = 'RW';\n  const SA = 'SA';\n  const SB = 'SB';\n  const SC = 'SC';\n  const SD = 'SD';\n  const SE = 'SE';\n  const SG = 'SG';\n  const SH = 'SH';\n  const SI = 'SI';\n  const SJ = 'SJ';\n  const SK = 'SK';\n  const SL = 'SL';\n  const SM = 'SM';\n  const SN = 'SN';\n  const SO = 'SO';\n  const SR = 'SR';\n  const SS = 'SS';\n  const ST = 'ST';\n  const SV = 'SV';\n  const SX = 'SX';\n  const SY = 'SY';\n  const SZ = 'SZ';\n  const TC = 'TC';\n  const TD = 'TD';\n  const TF = 'TF';\n  const TG = 'TG';\n  const TH = 'TH';\n  const TJ = 'TJ';\n  const TK = 'TK';\n  const TL = 'TL';\n  const TM = 'TM';\n  const TN = 'TN';\n  const TO = 'TO';\n  const TR = 'TR';\n  const TT = 'TT';\n  const TV = 'TV';\n  const TW = 'TW';\n  const TZ = 'TZ';\n  const UA = 'UA';\n  const UG = 'UG';\n  const UM = 'UM';\n  const US = 'US';\n  const UY = 'UY';\n  const UZ = 'UZ';\n  const VA = 'VA';\n  const VC = 'VC';\n  const VE = 'VE';\n  const VG = 'VG';\n  const VI = 'VI';\n  const VN = 'VN';\n  const VU = 'VU';\n  const WF = 'WF';\n  const WS = 'WS';\n  const XK = 'XK';\n  const YE = 'YE';\n  const YT = 'YT';\n  const ZA = 'ZA';\n  const ZM = 'ZM';\n  const ZW = 'ZW';\n}\n", "num_lines": 292}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountTargetingUnifiedWhitelistedTypesValues getInstance()\n */\nclass AdAccountTargetingUnifiedWhitelistedTypesValues extends AbstractEnum {\n\n  const ADGROUP_ID = 'adgroup_id';\n  const AGE_MAX = 'age_max';\n  const AGE_MIN = 'age_min';\n  const AGE_RANGE = 'age_range';\n  const ALTERNATE_AUTO_TARGETING_OPTION = 'alternate_auto_targeting_option';\n  const APP_INSTALL_STATE = 'app_install_state';\n  const AUDIENCE_NETWORK_POSITIONS = 'audience_network_positions';\n  const BEHAVIORS = 'behaviors';\n  const BRAND_SAFETY_CONTENT_FILTER_LEVELS = 'brand_safety_content_filter_levels';\n  const BRAND_SAFETY_CONTENT_SEVERITY_LEVELS = 'brand_safety_content_severity_levels';\n  const CAFE_CA_CONTRACTION_TARGETING_SIGNAL = 'cafe_ca_contraction_targeting_signal';\n  const CAFE_CA_EXPANSION_TARGETING_SIGNAL = 'cafe_ca_expansion_targeting_signal';\n  const CATALOG_BASED_TARGETING = 'catalog_based_targeting';\n  const CITIES = 'cities';\n  const CITY_KEYS = 'city_keys';\n  const COLLEGE_YEARS = 'college_years';\n  const CONJUNCTIVE_USER_ADCLUSTERS = 'conjunctive_user_adclusters';\n  const CONNECTIONS = 'connections';\n  const CONTEXTUAL_TARGETING_CATEGORIES = 'contextual_targeting_categories';\n  const COUNTRIES = 'countries';\n  const COUNTRY = 'country';\n  const COUNTRY_GROUPS = 'country_groups';\n  const CUSTOM_AUDIENCES = 'custom_audiences';\n  const DEVICE_PLATFORMS = 'device_platforms';\n  const DIRECT_INSTALL_DEVICES = 'direct_install_devices';\n  const DYNAMIC_AUDIENCE_IDS = 'dynamic_audience_ids';\n  const EDUCATION_MAJORS = 'education_majors';\n  const EDUCATION_SCHOOLS = 'education_schools';\n  const EDUCATION_STATUSES = 'education_statuses';\n  const EFFECTIVE_AUDIENCE_NETWORK_POSITIONS = 'effective_audience_network_positions';\n  const EFFECTIVE_DEVICE_PLATFORMS = 'effective_device_platforms';\n  const EFFECTIVE_FACEBOOK_POSITIONS = 'effective_facebook_positions';\n  const EFFECTIVE_INSTAGRAM_POSITIONS = 'effective_instagram_positions';\n  const EFFECTIVE_MESSENGER_POSITIONS = 'effective_messenger_positions';\n  const EFFECTIVE_OCULUS_POSITIONS = 'effective_oculus_positions';\n  const EFFECTIVE_PUBLISHER_PLATFORMS = 'effective_publisher_platforms';\n  const EFFECTIVE_WHATSAPP_POSITIONS = 'effective_whatsapp_positions';\n  const ENGAGEMENT_SPECS = 'engagement_specs';\n  const ETHNIC_AFFINITY = 'ethnic_affinity';\n  const EXCLUDE_PREVIOUS_DAYS = 'exclude_previous_days';\n  const EXCLUDE_REACHED_SINCE = 'exclude_reached_since';\n  const EXCLUDED_BRAND_SAFETY_CONTENT_TYPES = 'excluded_brand_safety_content_types';\n  const EXCLUDED_CONNECTIONS = 'excluded_connections';\n  const EXCLUDED_CUSTOM_AUDIENCES = 'excluded_custom_audiences';\n  const EXCLUDED_DYNAMIC_AUDIENCE_IDS = 'excluded_dynamic_audience_ids';\n  const EXCLUDED_ENGAGEMENT_SPECS = 'excluded_engagement_specs';\n  const EXCLUDED_GEO_LOCATIONS = 'excluded_geo_locations';\n  const EXCLUDED_MOBILE_DEVICE_MODEL = 'excluded_mobile_device_model';\n  const EXCLUDED_PRODUCT_AUDIENCE_SPECS = 'excluded_product_audience_specs';\n  const EXCLUDED_PUBLISHER_CATEGORIES = 'excluded_publisher_categories';\n  const EXCLUDED_PUBLISHER_LIST_IDS = 'excluded_publisher_list_ids';\n  const EXCLUDED_USER_ADCLUSTERS = 'excluded_user_adclusters';\n  const EXCLUDED_USER_DEVICE = 'excluded_user_device';\n  const EXCLUSIONS = 'exclusions';\n  const FACEBOOK_POSITIONS = 'facebook_positions';\n  const FAMILY_STATUSES = 'family_statuses';\n  const FB_DEAL_ID = 'fb_deal_id';\n  const FLEXIBLE_SPEC = 'flexible_spec';\n  const FOLLOW_PROFILES = 'follow_profiles';\n  const FOLLOW_PROFILES_NEGATIVE = 'follow_profiles_negative';\n  const FORMAT = 'format';\n  const FRIENDS_OF_CONNECTIONS = 'friends_of_connections';\n  const GATEKEEPERS = 'gatekeepers';\n  const GENDERS = 'genders';\n  const GENERATION = 'generation';\n  const GEO_LOCATIONS = 'geo_locations';\n  const HOME_OWNERSHIP = 'home_ownership';\n  const HOME_TYPE = 'home_type';\n  const HOME_VALUE = 'home_value';\n  const HOUSEHOLD_COMPOSITION = 'household_composition';\n  const ID = 'id';\n  const INCOME = 'income';\n  const INDUSTRIES = 'industries';\n  const INSTAGRAM_HASHTAGS = 'instagram_hashtags';\n  const INSTAGRAM_POSITIONS = 'instagram_positions';\n  const INSTREAM_VIDEO_SKIPPABLE_EXCLUDED = 'instream_video_skippable_excluded';\n  const INSTREAM_VIDEO_SPONSORSHIP_PLACEMENTS = 'instream_video_sponsorship_placements';\n  const INTEREST_DEFAULTS_SOURCE = 'interest_defaults_source';\n  const INTERESTED_IN = 'interested_in';\n  const INTERESTS = 'interests';\n  const IS_INSTAGRAM_DESTINATION_AD = 'is_instagram_destination_ad';\n  const IS_WHATSAPP_DESTINATION_AD = 'is_whatsapp_destination_ad';\n  const KEYWORDS = 'keywords';\n  const LIFE_EVENTS = 'life_events';\n  const LOCALES = 'locales';\n  const LOCATION_CATEGORIES = 'location_categories';\n  const LOCATION_CLUSTER_IDS = 'location_cluster_ids';\n  const LOCATION_EXPANSION = 'location_expansion';\n  const MARKETPLACE_PRODUCT_CATEGORIES = 'marketplace_product_categories';\n  const MESSENGER_POSITIONS = 'messenger_positions';\n  const MOBILE_DEVICE_MODEL = 'mobile_device_model';\n  const MOMS = 'moms';\n  const NET_WORTH = 'net_worth';\n  const OCULUS_POSITIONS = 'oculus_positions';\n  const OFFICE_TYPE = 'office_type';\n  const PAGE_TYPES = 'page_types';\n  const PLACE_PAGE_SET_IDS = 'place_page_set_ids';\n  const POLITICAL_VIEWS = 'political_views';\n  const POLITICS = 'politics';\n  const PRODUCT_AUDIENCE_SPECS = 'product_audience_specs';\n  const PROSPECTING_AUDIENCE = 'prospecting_audience';\n  const PUBLISHER_PLATFORMS = 'publisher_platforms';\n  const RADIUS = 'radius';\n  const REGION_KEYS = 'region_keys';\n  const REGIONS = 'regions';\n  const RELATIONSHIP_STATUSES = 'relationship_statuses';\n  const RTB_FLAG = 'rtb_flag';\n  const SITE_CATEGORY = 'site_category';\n  const TARGETING_AUTOMATION = 'targeting_automation';\n  const TARGETING_OPTIMIZATION = 'targeting_optimization';\n  const TARGETING_RELAXATION_TYPES = 'targeting_relaxation_types';\n  const TIMEZONES = 'timezones';\n  const TOPIC = 'topic';\n  const TRENDING = 'trending';\n  const USER_ADCLUSTERS = 'user_adclusters';\n  const USER_DEVICE = 'user_device';\n  const USER_EVENT = 'user_event';\n  const USER_OS = 'user_os';\n  const USER_PAGE_THREADS = 'user_page_threads';\n  const USER_PAGE_THREADS_EXCLUDED = 'user_page_threads_excluded';\n  const WHATSAPP_POSITIONS = 'whatsapp_positions';\n  const WIRELESS_CARRIER = 'wireless_carrier';\n  const WORK_EMPLOYERS = 'work_employers';\n  const WORK_POSITIONS = 'work_positions';\n  const ZIPS = 'zips';\n}\n", "num_lines": 166}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAccountTasksValues getInstance()\n */\nclass AdAccountTasksValues extends AbstractEnum {\n\n  const AA_ANALYZE = 'AA_ANALYZE';\n  const ADVERTISE = 'ADVERTISE';\n  const ANALYZE = 'ANALYZE';\n  const DRAFT = 'DRAFT';\n  const MANAGE = 'MANAGE';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdActivityCategoryValues getInstance()\n */\nclass AdActivityCategoryValues extends AbstractEnum {\n\n  const ACCOUNT = 'ACCOUNT';\n  const AD = 'AD';\n  const AD_KEYWORDS = 'AD_KEYWORDS';\n  const AD_SET = 'AD_SET';\n  const AUDIENCE = 'AUDIENCE';\n  const BID = 'BID';\n  const BUDGET = 'BUDGET';\n  const CAMPAIGN = 'CAMPAIGN';\n  const DATE = 'DATE';\n  const STATUS = 'STATUS';\n  const TARGETING = 'TARGETING';\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdActivityDataSourceValues getInstance()\n */\nclass AdActivityDataSourceValues extends AbstractEnum {\n\n  const CALYPSO = 'CALYPSO';\n  const TAO = 'TAO';\n  const TAO_AD_ACCOUNT = 'TAO_AD_ACCOUNT';\n  const TAO_AD_STATUS = 'TAO_AD_STATUS';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdActivityEventTypeValues getInstance()\n */\nclass AdActivityEventTypeValues extends AbstractEnum {\n\n  const ACCOUNT_SPENDING_LIMIT_REACHED = 'account_spending_limit_reached';\n  const AD_ACCOUNT_ADD_USER_TO_ROLE = 'ad_account_add_user_to_role';\n  const AD_ACCOUNT_BILLING_CHARGE = 'ad_account_billing_charge';\n  const AD_ACCOUNT_BILLING_CHARGE_FAILED = 'ad_account_billing_charge_failed';\n  const AD_ACCOUNT_BILLING_CHARGEBACK = 'ad_account_billing_chargeback';\n  const AD_ACCOUNT_BILLING_CHARGEBACK_REVERSAL = 'ad_account_billing_chargeback_reversal';\n  const AD_ACCOUNT_BILLING_DECLINE = 'ad_account_billing_decline';\n  const AD_ACCOUNT_BILLING_REFUND = 'ad_account_billing_refund';\n  const AD_ACCOUNT_REMOVE_SPEND_LIMIT = 'ad_account_remove_spend_limit';\n  const AD_ACCOUNT_REMOVE_USER_FROM_ROLE = 'ad_account_remove_user_from_role';\n  const AD_ACCOUNT_RESET_SPEND_LIMIT = 'ad_account_reset_spend_limit';\n  const AD_ACCOUNT_SET_BUSINESS_INFORMATION = 'ad_account_set_business_information';\n  const AD_ACCOUNT_UPDATE_SPEND_LIMIT = 'ad_account_update_spend_limit';\n  const AD_ACCOUNT_UPDATE_STATUS = 'ad_account_update_status';\n  const AD_REVIEW_APPROVED = 'ad_review_approved';\n  const AD_REVIEW_DECLINED = 'ad_review_declined';\n  const ADD_FUNDING_SOURCE = 'add_funding_source';\n  const ADD_IMAGES = 'add_images';\n  const BILLING_EVENT = 'billing_event';\n  const CAMPAIGN_ENDED = 'campaign_ended';\n  const CAMPAIGN_SPENDING_LIMIT_REACHED = 'campaign_spending_limit_reached';\n  const CONVERSION_EVENT_UPDATED = 'conversion_event_updated';\n  const CREATE_AD = 'create_ad';\n  const CREATE_AD_SET = 'create_ad_set';\n  const CREATE_AUDIENCE = 'create_audience';\n  const CREATE_CAMPAIGN_GROUP = 'create_campaign_group';\n  const CREATE_CAMPAIGN_LEGACY = 'create_campaign_legacy';\n  const DELETE_AUDIENCE = 'delete_audience';\n  const DELETE_IMAGES = 'delete_images';\n  const DI_AD_SET_LEARNING_STAGE_EXIT = 'di_ad_set_learning_stage_exit';\n  const EDIT_AND_UPDATE_AD_CREATIVE = 'edit_and_update_ad_creative';\n  const EDIT_IMAGES = 'edit_images';\n  const FIRST_DELIVERY_EVENT = 'first_delivery_event';\n  const FUNDING_EVENT_INITIATED = 'funding_event_initiated';\n  const FUNDING_EVENT_SUCCESSFUL = 'funding_event_successful';\n  const LIFETIME_BUDGET_SPENT = 'lifetime_budget_spent';\n  const MERGE_CAMPAIGNS = 'merge_campaigns';\n  const RECEIVE_AUDIENCE = 'receive_audience';\n  const REMOVE_FUNDING_SOURCE = 'remove_funding_source';\n  const REMOVE_SHARED_AUDIENCE = 'remove_shared_audience';\n  const SHARE_AUDIENCE = 'share_audience';\n  const UNKNOWN = 'unknown';\n  const UNSHARE_AUDIENCE = 'unshare_audience';\n  const UPDATE_AD_BID_INFO = 'update_ad_bid_info';\n  const UPDATE_AD_BID_TYPE = 'update_ad_bid_type';\n  const UPDATE_AD_CREATIVE = 'update_ad_creative';\n  const UPDATE_AD_FRIENDLY_NAME = 'update_ad_friendly_name';\n  const UPDATE_AD_LABELS = 'update_ad_labels';\n  const UPDATE_AD_RUN_STATUS = 'update_ad_run_status';\n  const UPDATE_AD_RUN_STATUS_TO_BE_SET_AFTER_REVIEW = 'update_ad_run_status_to_be_set_after_review';\n  const UPDATE_AD_SET_AD_KEYWORDS = 'update_ad_set_ad_keywords';\n  const UPDATE_AD_SET_BID_ADJUSTMENTS = 'update_ad_set_bid_adjustments';\n  const UPDATE_AD_SET_BID_STRATEGY = 'update_ad_set_bid_strategy';\n  const UPDATE_AD_SET_BIDDING = 'update_ad_set_bidding';\n  const UPDATE_AD_SET_BUDGET = 'update_ad_set_budget';\n  const UPDATE_AD_SET_DURATION = 'update_ad_set_duration';\n  const UPDATE_AD_SET_LEARNING_STAGE_STATUS = 'update_ad_set_learning_stage_status';\n  const UPDATE_AD_SET_MIN_SPEND_TARGET = 'update_ad_set_min_spend_target';\n  const UPDATE_AD_SET_NAME = 'update_ad_set_name';\n  const UPDATE_AD_SET_OPTIMIZATION_GOAL = 'update_ad_set_optimization_goal';\n  const UPDATE_AD_SET_RUN_STATUS = 'update_ad_set_run_status';\n  const UPDATE_AD_SET_SPEND_CAP = 'update_ad_set_spend_cap';\n  const UPDATE_AD_SET_TARGET_SPEC = 'update_ad_set_target_spec';\n  const UPDATE_AD_TARGETS_SPEC = 'update_ad_targets_spec';\n  const UPDATE_ADGROUP_STOP_DELIVERY = 'update_adgroup_stop_delivery';\n  const UPDATE_AUDIENCE = 'update_audience';\n  const UPDATE_CAMPAIGN_AD_SCHEDULING = 'update_campaign_ad_scheduling';\n  const UPDATE_CAMPAIGN_BUDGET = 'update_campaign_budget';\n  const UPDATE_CAMPAIGN_BUDGET_OPTIMIZATION_TOGGLING_STATUS = 'update_campaign_budget_optimization_toggling_status';\n  const UPDATE_CAMPAIGN_DELIVERY_TYPE = 'update_campaign_delivery_type';\n  const UPDATE_CAMPAIGN_GROUP_AD_SCHEDULING = 'update_campaign_group_ad_scheduling';\n  const UPDATE_CAMPAIGN_GROUP_DELIVERY_TYPE = 'update_campaign_group_delivery_type';\n  const UPDATE_CAMPAIGN_GROUP_SPEND_CAP = 'update_campaign_group_spend_cap';\n  const UPDATE_CAMPAIGN_NAME = 'update_campaign_name';\n  const UPDATE_CAMPAIGN_RUN_STATUS = 'update_campaign_run_status';\n  const UPDATE_CAMPAIGN_SCHEDULE = 'update_campaign_schedule';\n  const UPDATE_DELIVERY_TYPE_CROSS_LEVEL_SHIFT = 'update_delivery_type_cross_level_shift';\n}\n", "num_lines": 118}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAssetFeedSpecCallToActionTypesValues getInstance()\n */\nclass AdAssetFeedSpecCallToActionTypesValues extends AbstractEnum {\n\n  const ADD_TO_CART = 'ADD_TO_CART';\n  const APPLY_NOW = 'APPLY_NOW';\n  const AUDIO_CALL = 'AUDIO_CALL';\n  const BOOK_TRAVEL = 'BOOK_TRAVEL';\n  const BUY = 'BUY';\n  const BUY_NOW = 'BUY_NOW';\n  const BUY_TICKETS = 'BUY_TICKETS';\n  const CALL = 'CALL';\n  const CALL_ME = 'CALL_ME';\n  const CALL_NOW = 'CALL_NOW';\n  const CONTACT = 'CONTACT';\n  const CONTACT_US = 'CONTACT_US';\n  const DONATE = 'DONATE';\n  const DONATE_NOW = 'DONATE_NOW';\n  const DOWNLOAD = 'DOWNLOAD';\n  const EVENT_RSVP = 'EVENT_RSVP';\n  const FIND_A_GROUP = 'FIND_A_GROUP';\n  const FIND_YOUR_GROUPS = 'FIND_YOUR_GROUPS';\n  const FOLLOW_NEWS_STORYLINE = 'FOLLOW_NEWS_STORYLINE';\n  const FOLLOW_PAGE = 'FOLLOW_PAGE';\n  const FOLLOW_USER = 'FOLLOW_USER';\n  const GET_DIRECTIONS = 'GET_DIRECTIONS';\n  const GET_OFFER = 'GET_OFFER';\n  const GET_OFFER_VIEW = 'GET_OFFER_VIEW';\n  const GET_PROMOTIONS = 'GET_PROMOTIONS';\n  const GET_QUOTE = 'GET_QUOTE';\n  const GET_SHOWTIMES = 'GET_SHOWTIMES';\n  const GET_STARTED = 'GET_STARTED';\n  const INQUIRE_NOW = 'INQUIRE_NOW';\n  const INSTALL_APP = 'INSTALL_APP';\n  const INSTALL_MOBILE_APP = 'INSTALL_MOBILE_APP';\n  const LEARN_MORE = 'LEARN_MORE';\n  const LIKE_PAGE = 'LIKE_PAGE';\n  const LISTEN_MUSIC = 'LISTEN_MUSIC';\n  const LISTEN_NOW = 'LISTEN_NOW';\n  const MESSAGE_PAGE = 'MESSAGE_PAGE';\n  const MOBILE_DOWNLOAD = 'MOBILE_DOWNLOAD';\n  const MOMENTS = 'MOMENTS';\n  const NO_BUTTON = 'NO_BUTTON';\n  const OPEN_INSTANT_APP = 'OPEN_INSTANT_APP';\n  const OPEN_LINK = 'OPEN_LINK';\n  const ORDER_NOW = 'ORDER_NOW';\n  const PAY_TO_ACCESS = 'PAY_TO_ACCESS';\n  const PLAY_GAME = 'PLAY_GAME';\n  const PLAY_GAME_ON_FACEBOOK = 'PLAY_GAME_ON_FACEBOOK';\n  const PURCHASE_GIFT_CARDS = 'PURCHASE_GIFT_CARDS';\n  const RAISE_MONEY = 'RAISE_MONEY';\n  const RECORD_NOW = 'RECORD_NOW';\n  const REFER_FRIENDS = 'REFER_FRIENDS';\n  const REQUEST_TIME = 'REQUEST_TIME';\n  const SAY_THANKS = 'SAY_THANKS';\n  const SEE_MORE = 'SEE_MORE';\n  const SELL_NOW = 'SELL_NOW';\n  const SEND_A_GIFT = 'SEND_A_GIFT';\n  const SEND_GIFT_MONEY = 'SEND_GIFT_MONEY';\n  const SEND_UPDATES = 'SEND_UPDATES';\n  const SHARE = 'SHARE';\n  const SHOP_NOW = 'SHOP_NOW';\n  const SIGN_UP = 'SIGN_UP';\n  const SOTTO_SUBSCRIBE = 'SOTTO_SUBSCRIBE';\n  const START_ORDER = 'START_ORDER';\n  const SUBSCRIBE = 'SUBSCRIBE';\n  const SWIPE_UP_PRODUCT = 'SWIPE_UP_PRODUCT';\n  const SWIPE_UP_SHOP = 'SWIPE_UP_SHOP';\n  const UPDATE_APP = 'UPDATE_APP';\n  const USE_APP = 'USE_APP';\n  const USE_MOBILE_APP = 'USE_MOBILE_APP';\n  const VIDEO_ANNOTATION = 'VIDEO_ANNOTATION';\n  const VIDEO_CALL = 'VIDEO_CALL';\n  const VISIT_PAGES_FEED = 'VISIT_PAGES_FEED';\n  const WATCH_MORE = 'WATCH_MORE';\n  const WATCH_VIDEO = 'WATCH_VIDEO';\n  const WHATSAPP_MESSAGE = 'WHATSAPP_MESSAGE';\n  const WOODHENGE_SUPPORT = 'WOODHENGE_SUPPORT';\n}\n", "num_lines": 115}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAsyncRequestSetNotificationModeValues getInstance()\n */\nclass AdAsyncRequestSetNotificationModeValues extends AbstractEnum {\n\n  const OFF = 'OFF';\n  const ON_COMPLETE = 'ON_COMPLETE';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdAsyncRequestStatusesValues getInstance()\n */\nclass AdAsyncRequestStatusesValues extends AbstractEnum {\n\n  const CANCELED = 'CANCELED';\n  const CANCELED_DEPENDENCY = 'CANCELED_DEPENDENCY';\n  const ERROR = 'ERROR';\n  const ERROR_CONFLICTS = 'ERROR_CONFLICTS';\n  const ERROR_DEPENDENCY = 'ERROR_DEPENDENCY';\n  const INITIAL = 'INITIAL';\n  const IN_PROGRESS = 'IN_PROGRESS';\n  const PENDING_DEPENDENCY = 'PENDING_DEPENDENCY';\n  const PROCESS_BY_AD_ASYNC_ENGINE = 'PROCESS_BY_AD_ASYNC_ENGINE';\n  const PROCESS_BY_EVENT_PROCESSOR = 'PROCESS_BY_EVENT_PROCESSOR';\n  const SUCCESS = 'SUCCESS';\n  const USER_CANCELED = 'USER_CANCELED';\n  const USER_CANCELED_DEPENDENCY = 'USER_CANCELED_DEPENDENCY';\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdBidTypeValues getInstance()\n */\nclass AdBidTypeValues extends AbstractEnum {\n\n  const ABSOLUTE_OCPM = 'ABSOLUTE_OCPM';\n  const CPA = 'CPA';\n  const CPC = 'CPC';\n  const CPM = 'CPM';\n  const MULTI_PREMIUM = 'MULTI_PREMIUM';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCampaignDeliveryEstimateOptimizationGoalValues getInstance()\n */\nclass AdCampaignDeliveryEstimateOptimizationGoalValues extends AbstractEnum {\n\n  const AD_RECALL_LIFT = 'AD_RECALL_LIFT';\n  const APP_INSTALLS = 'APP_INSTALLS';\n  const APP_INSTALLS_AND_OFFSITE_CONVERSIONS = 'APP_INSTALLS_AND_OFFSITE_CONVERSIONS';\n  const CONVERSATIONS = 'CONVERSATIONS';\n  const DERIVED_EVENTS = 'DERIVED_EVENTS';\n  const ENGAGED_USERS = 'ENGAGED_USERS';\n  const EVENT_RESPONSES = 'EVENT_RESPONSES';\n  const IMPRESSIONS = 'IMPRESSIONS';\n  const IN_APP_VALUE = 'IN_APP_VALUE';\n  const LANDING_PAGE_VIEWS = 'LANDING_PAGE_VIEWS';\n  const LEAD_GENERATION = 'LEAD_GENERATION';\n  const LINK_CLICKS = 'LINK_CLICKS';\n  const MESSAGING_APPOINTMENT_CONVERSION = 'MESSAGING_APPOINTMENT_CONVERSION';\n  const MESSAGING_PURCHASE_CONVERSION = 'MESSAGING_PURCHASE_CONVERSION';\n  const NONE = 'NONE';\n  const OFFSITE_CONVERSIONS = 'OFFSITE_CONVERSIONS';\n  const PAGE_LIKES = 'PAGE_LIKES';\n  const POST_ENGAGEMENT = 'POST_ENGAGEMENT';\n  const QUALITY_CALL = 'QUALITY_CALL';\n  const QUALITY_LEAD = 'QUALITY_LEAD';\n  const REACH = 'REACH';\n  const SUBSCRIBERS = 'SUBSCRIBERS';\n  const THRUPLAY = 'THRUPLAY';\n  const VALUE = 'VALUE';\n  const VISIT_INSTAGRAM_PROFILE = 'VISIT_INSTAGRAM_PROFILE';\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdConfiguredStatusValues getInstance()\n */\nclass AdConfiguredStatusValues extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const ARCHIVED = 'ARCHIVED';\n  const DELETED = 'DELETED';\n  const PAUSED = 'PAUSED';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeApplinkTreatmentValues getInstance()\n */\nclass AdCreativeApplinkTreatmentValues extends AbstractEnum {\n\n  const AUTOMATIC = 'automatic';\n  const DEEPLINK_WITH_APPSTORE_FALLBACK = 'deeplink_with_appstore_fallback';\n  const DEEPLINK_WITH_WEB_FALLBACK = 'deeplink_with_web_fallback';\n  const WEB_ONLY = 'web_only';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeAuthorizationCategoryValues getInstance()\n */\nclass AdCreativeAuthorizationCategoryValues extends AbstractEnum {\n\n  const NONE = 'NONE';\n  const POLITICAL = 'POLITICAL';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeCallToActionTypeValues getInstance()\n */\nclass AdCreativeCallToActionTypeValues extends AbstractEnum {\n\n  const ADD_TO_CART = 'ADD_TO_CART';\n  const APPLY_NOW = 'APPLY_NOW';\n  const AUDIO_CALL = 'AUDIO_CALL';\n  const BOOK_TRAVEL = 'BOOK_TRAVEL';\n  const BUY = 'BUY';\n  const BUY_NOW = 'BUY_NOW';\n  const BUY_TICKETS = 'BUY_TICKETS';\n  const CALL = 'CALL';\n  const CALL_ME = 'CALL_ME';\n  const CALL_NOW = 'CALL_NOW';\n  const CONTACT = 'CONTACT';\n  const CONTACT_US = 'CONTACT_US';\n  const DONATE = 'DONATE';\n  const DONATE_NOW = 'DONATE_NOW';\n  const DOWNLOAD = 'DOWNLOAD';\n  const EVENT_RSVP = 'EVENT_RSVP';\n  const FIND_A_GROUP = 'FIND_A_GROUP';\n  const FIND_YOUR_GROUPS = 'FIND_YOUR_GROUPS';\n  const FOLLOW_NEWS_STORYLINE = 'FOLLOW_NEWS_STORYLINE';\n  const FOLLOW_PAGE = 'FOLLOW_PAGE';\n  const FOLLOW_USER = 'FOLLOW_USER';\n  const GET_DIRECTIONS = 'GET_DIRECTIONS';\n  const GET_OFFER = 'GET_OFFER';\n  const GET_OFFER_VIEW = 'GET_OFFER_VIEW';\n  const GET_PROMOTIONS = 'GET_PROMOTIONS';\n  const GET_QUOTE = 'GET_QUOTE';\n  const GET_SHOWTIMES = 'GET_SHOWTIMES';\n  const GET_STARTED = 'GET_STARTED';\n  const INQUIRE_NOW = 'INQUIRE_NOW';\n  const INSTALL_APP = 'INSTALL_APP';\n  const INSTALL_MOBILE_APP = 'INSTALL_MOBILE_APP';\n  const LEARN_MORE = 'LEARN_MORE';\n  const LIKE_PAGE = 'LIKE_PAGE';\n  const LISTEN_MUSIC = 'LISTEN_MUSIC';\n  const LISTEN_NOW = 'LISTEN_NOW';\n  const MESSAGE_PAGE = 'MESSAGE_PAGE';\n  const MOBILE_DOWNLOAD = 'MOBILE_DOWNLOAD';\n  const MOMENTS = 'MOMENTS';\n  const NO_BUTTON = 'NO_BUTTON';\n  const OPEN_INSTANT_APP = 'OPEN_INSTANT_APP';\n  const OPEN_LINK = 'OPEN_LINK';\n  const ORDER_NOW = 'ORDER_NOW';\n  const PAY_TO_ACCESS = 'PAY_TO_ACCESS';\n  const PLAY_GAME = 'PLAY_GAME';\n  const PLAY_GAME_ON_FACEBOOK = 'PLAY_GAME_ON_FACEBOOK';\n  const PURCHASE_GIFT_CARDS = 'PURCHASE_GIFT_CARDS';\n  const RAISE_MONEY = 'RAISE_MONEY';\n  const RECORD_NOW = 'RECORD_NOW';\n  const REFER_FRIENDS = 'REFER_FRIENDS';\n  const REQUEST_TIME = 'REQUEST_TIME';\n  const SAY_THANKS = 'SAY_THANKS';\n  const SEE_MORE = 'SEE_MORE';\n  const SELL_NOW = 'SELL_NOW';\n  const SEND_A_GIFT = 'SEND_A_GIFT';\n  const SEND_GIFT_MONEY = 'SEND_GIFT_MONEY';\n  const SEND_UPDATES = 'SEND_UPDATES';\n  const SHARE = 'SHARE';\n  const SHOP_NOW = 'SHOP_NOW';\n  const SIGN_UP = 'SIGN_UP';\n  const SOTTO_SUBSCRIBE = 'SOTTO_SUBSCRIBE';\n  const START_ORDER = 'START_ORDER';\n  const SUBSCRIBE = 'SUBSCRIBE';\n  const SWIPE_UP_PRODUCT = 'SWIPE_UP_PRODUCT';\n  const SWIPE_UP_SHOP = 'SWIPE_UP_SHOP';\n  const UPDATE_APP = 'UPDATE_APP';\n  const USE_APP = 'USE_APP';\n  const USE_MOBILE_APP = 'USE_MOBILE_APP';\n  const VIDEO_ANNOTATION = 'VIDEO_ANNOTATION';\n  const VIDEO_CALL = 'VIDEO_CALL';\n  const VISIT_PAGES_FEED = 'VISIT_PAGES_FEED';\n  const WATCH_MORE = 'WATCH_MORE';\n  const WATCH_VIDEO = 'WATCH_VIDEO';\n  const WHATSAPP_MESSAGE = 'WHATSAPP_MESSAGE';\n  const WOODHENGE_SUPPORT = 'WOODHENGE_SUPPORT';\n}\n", "num_lines": 115}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeCategorizationCriteriaValues getInstance()\n */\nclass AdCreativeCategorizationCriteriaValues extends AbstractEnum {\n\n  const BRAND = 'brand';\n  const CATEGORY = 'category';\n  const PRODUCT_TYPE = 'product_type';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeCategoryMediaSourceValues getInstance()\n */\nclass AdCreativeCategoryMediaSourceValues extends AbstractEnum {\n\n  const CATEGORY = 'CATEGORY';\n  const MIXED = 'MIXED';\n  const PRODUCTS_COLLAGE = 'PRODUCTS_COLLAGE';\n  const PRODUCTS_SLIDESHOW = 'PRODUCTS_SLIDESHOW';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeDynamicAdVoiceValues getInstance()\n */\nclass AdCreativeDynamicAdVoiceValues extends AbstractEnum {\n\n  const DYNAMIC = 'DYNAMIC';\n  const STORY_OWNER = 'STORY_OWNER';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeLinkDataAttachmentStyleValues getInstance()\n */\nclass AdCreativeLinkDataAttachmentStyleValues extends AbstractEnum {\n\n  const VALUE_DEFAULT = 'default';\n  const LINK = 'link';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeLinkDataCallToActionTypeValues getInstance()\n */\nclass AdCreativeLinkDataCallToActionTypeValues extends AbstractEnum {\n\n  const ADD_TO_CART = 'ADD_TO_CART';\n  const APPLY_NOW = 'APPLY_NOW';\n  const AUDIO_CALL = 'AUDIO_CALL';\n  const BOOK_TRAVEL = 'BOOK_TRAVEL';\n  const BUY = 'BUY';\n  const BUY_NOW = 'BUY_NOW';\n  const BUY_TICKETS = 'BUY_TICKETS';\n  const CALL = 'CALL';\n  const CALL_ME = 'CALL_ME';\n  const CALL_NOW = 'CALL_NOW';\n  const CONTACT = 'CONTACT';\n  const CONTACT_US = 'CONTACT_US';\n  const DONATE = 'DONATE';\n  const DONATE_NOW = 'DONATE_NOW';\n  const DOWNLOAD = 'DOWNLOAD';\n  const EVENT_RSVP = 'EVENT_RSVP';\n  const FIND_A_GROUP = 'FIND_A_GROUP';\n  const FIND_YOUR_GROUPS = 'FIND_YOUR_GROUPS';\n  const FOLLOW_NEWS_STORYLINE = 'FOLLOW_NEWS_STORYLINE';\n  const FOLLOW_PAGE = 'FOLLOW_PAGE';\n  const FOLLOW_USER = 'FOLLOW_USER';\n  const GET_DIRECTIONS = 'GET_DIRECTIONS';\n  const GET_OFFER = 'GET_OFFER';\n  const GET_OFFER_VIEW = 'GET_OFFER_VIEW';\n  const GET_PROMOTIONS = 'GET_PROMOTIONS';\n  const GET_QUOTE = 'GET_QUOTE';\n  const GET_SHOWTIMES = 'GET_SHOWTIMES';\n  const GET_STARTED = 'GET_STARTED';\n  const INQUIRE_NOW = 'INQUIRE_NOW';\n  const INSTALL_APP = 'INSTALL_APP';\n  const INSTALL_MOBILE_APP = 'INSTALL_MOBILE_APP';\n  const LEARN_MORE = 'LEARN_MORE';\n  const LIKE_PAGE = 'LIKE_PAGE';\n  const LISTEN_MUSIC = 'LISTEN_MUSIC';\n  const LISTEN_NOW = 'LISTEN_NOW';\n  const MESSAGE_PAGE = 'MESSAGE_PAGE';\n  const MOBILE_DOWNLOAD = 'MOBILE_DOWNLOAD';\n  const MOMENTS = 'MOMENTS';\n  const NO_BUTTON = 'NO_BUTTON';\n  const OPEN_INSTANT_APP = 'OPEN_INSTANT_APP';\n  const OPEN_LINK = 'OPEN_LINK';\n  const ORDER_NOW = 'ORDER_NOW';\n  const PAY_TO_ACCESS = 'PAY_TO_ACCESS';\n  const PLAY_GAME = 'PLAY_GAME';\n  const PLAY_GAME_ON_FACEBOOK = 'PLAY_GAME_ON_FACEBOOK';\n  const PURCHASE_GIFT_CARDS = 'PURCHASE_GIFT_CARDS';\n  const RAISE_MONEY = 'RAISE_MONEY';\n  const RECORD_NOW = 'RECORD_NOW';\n  const REFER_FRIENDS = 'REFER_FRIENDS';\n  const REQUEST_TIME = 'REQUEST_TIME';\n  const SAY_THANKS = 'SAY_THANKS';\n  const SEE_MORE = 'SEE_MORE';\n  const SELL_NOW = 'SELL_NOW';\n  const SEND_A_GIFT = 'SEND_A_GIFT';\n  const SEND_GIFT_MONEY = 'SEND_GIFT_MONEY';\n  const SEND_UPDATES = 'SEND_UPDATES';\n  const SHARE = 'SHARE';\n  const SHOP_NOW = 'SHOP_NOW';\n  const SIGN_UP = 'SIGN_UP';\n  const SOTTO_SUBSCRIBE = 'SOTTO_SUBSCRIBE';\n  const START_ORDER = 'START_ORDER';\n  const SUBSCRIBE = 'SUBSCRIBE';\n  const SWIPE_UP_PRODUCT = 'SWIPE_UP_PRODUCT';\n  const SWIPE_UP_SHOP = 'SWIPE_UP_SHOP';\n  const UPDATE_APP = 'UPDATE_APP';\n  const USE_APP = 'USE_APP';\n  const USE_MOBILE_APP = 'USE_MOBILE_APP';\n  const VIDEO_ANNOTATION = 'VIDEO_ANNOTATION';\n  const VIDEO_CALL = 'VIDEO_CALL';\n  const VISIT_PAGES_FEED = 'VISIT_PAGES_FEED';\n  const WATCH_MORE = 'WATCH_MORE';\n  const WATCH_VIDEO = 'WATCH_VIDEO';\n  const WHATSAPP_MESSAGE = 'WHATSAPP_MESSAGE';\n  const WOODHENGE_SUPPORT = 'WOODHENGE_SUPPORT';\n}\n", "num_lines": 115}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeLinkDataFormatOptionValues getInstance()\n */\nclass AdCreativeLinkDataFormatOptionValues extends AbstractEnum {\n\n  const CAROUSEL_AR_EFFECTS = 'carousel_ar_effects';\n  const CAROUSEL_IMAGES_MULTI_ITEMS = 'carousel_images_multi_items';\n  const CAROUSEL_IMAGES_SINGLE_ITEM = 'carousel_images_single_item';\n  const CAROUSEL_SLIDESHOWS = 'carousel_slideshows';\n  const SINGLE_IMAGE = 'single_image';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeLinkDataImageLayerSpecBlendingModeValues getInstance()\n */\nclass AdCreativeLinkDataImageLayerSpecBlendingModeValues extends AbstractEnum {\n\n  const LIGHTEN = 'lighten';\n  const MULTIPLY = 'multiply';\n  const NORMAL = 'normal';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeLinkDataImageLayerSpecFrameSourceValues getInstance()\n */\nclass AdCreativeLinkDataImageLayerSpecFrameSourceValues extends AbstractEnum {\n\n  const CUSTOM = 'custom';\n}\n", "num_lines": 42}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeLinkDataImageLayerSpecImageSourceValues getInstance()\n */\nclass AdCreativeLinkDataImageLayerSpecImageSourceValues extends AbstractEnum {\n\n  const CATALOG = 'catalog';\n}\n", "num_lines": 42}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeLinkDataImageLayerSpecLayerTypeValues getInstance()\n */\nclass AdCreativeLinkDataImageLayerSpecLayerTypeValues extends AbstractEnum {\n\n  const FRAME_OVERLAY = 'frame_overlay';\n  const IMAGE = 'image';\n  const TEXT_OVERLAY = 'text_overlay';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeLinkDataImageLayerSpecOverlayPositionValues getInstance()\n */\nclass AdCreativeLinkDataImageLayerSpecOverlayPositionValues extends AbstractEnum {\n\n  const BOTTOM = 'bottom';\n  const BOTTOM_LEFT = 'bottom_left';\n  const BOTTOM_RIGHT = 'bottom_right';\n  const CENTER = 'center';\n  const LEFT = 'left';\n  const RIGHT = 'right';\n  const TOP = 'top';\n  const TOP_LEFT = 'top_left';\n  const TOP_RIGHT = 'top_right';\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeLinkDataImageLayerSpecOverlayShapeValues getInstance()\n */\nclass AdCreativeLinkDataImageLayerSpecOverlayShapeValues extends AbstractEnum {\n\n  const CIRCLE = 'circle';\n  const NONE = 'none';\n  const PILL = 'pill';\n  const RECTANGLE = 'rectangle';\n  const TRIANGLE = 'triangle';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeLinkDataImageLayerSpecTextFontValues getInstance()\n */\nclass AdCreativeLinkDataImageLayerSpecTextFontValues extends AbstractEnum {\n\n  const DROID_SERIF_REGULAR = 'droid_serif_regular';\n  const LATO_REGULAR = 'lato_regular';\n  const NOTO_SANS_REGULAR = 'noto_sans_regular';\n  const NUNITO_SANS_BOLD = 'nunito_sans_bold';\n  const OPEN_SANS_BOLD = 'open_sans_bold';\n  const OPEN_SANS_CONDENSED_BOLD = 'open_sans_condensed_bold';\n  const PT_SERIF_BOLD = 'pt_serif_bold';\n  const ROBOTO_CONDENSED_REGULAR = 'roboto_condensed_regular';\n  const ROBOTO_MEDIUM = 'roboto_medium';\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeLinkDataImageOverlaySpecCustomTextTypeValues getInstance()\n */\nclass AdCreativeLinkDataImageOverlaySpecCustomTextTypeValues extends AbstractEnum {\n\n  const FREE_SHIPPING = 'free_shipping';\n  const POPULAR = 'popular';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeLinkDataImageOverlaySpecOverlayTemplateValues getInstance()\n */\nclass AdCreativeLinkDataImageOverlaySpecOverlayTemplateValues extends AbstractEnum {\n\n  const CIRCLE_WITH_TEXT = 'circle_with_text';\n  const PILL_WITH_TEXT = 'pill_with_text';\n  const TRIANGLE_WITH_TEXT = 'triangle_with_text';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeLinkDataImageOverlaySpecPositionValues getInstance()\n */\nclass AdCreativeLinkDataImageOverlaySpecPositionValues extends AbstractEnum {\n\n  const BOTTOM_LEFT = 'bottom_left';\n  const BOTTOM_RIGHT = 'bottom_right';\n  const TOP_LEFT = 'top_left';\n  const TOP_RIGHT = 'top_right';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeLinkDataImageOverlaySpecTextFontValues getInstance()\n */\nclass AdCreativeLinkDataImageOverlaySpecTextFontValues extends AbstractEnum {\n\n  const DROID_SERIF_REGULAR = 'droid_serif_regular';\n  const DYNADS_HYBRID_BOLD = 'dynads_hybrid_bold';\n  const LATO_REGULAR = 'lato_regular';\n  const NOTO_SANS_REGULAR = 'noto_sans_regular';\n  const NUNITO_SANS_BOLD = 'nunito_sans_bold';\n  const OPEN_SANS_BOLD = 'open_sans_bold';\n  const OPEN_SANS_CONDENSED_BOLD = 'open_sans_condensed_bold';\n  const PT_SERIF_BOLD = 'pt_serif_bold';\n  const ROBOTO_CONDENSED_REGULAR = 'roboto_condensed_regular';\n  const ROBOTO_MEDIUM = 'roboto_medium';\n}\n", "num_lines": 51}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeLinkDataImageOverlaySpecTextTypeValues getInstance()\n */\nclass AdCreativeLinkDataImageOverlaySpecTextTypeValues extends AbstractEnum {\n\n  const AUTOMATED_PERSONALIZE = 'automated_personalize';\n  const CUSTOM = 'custom';\n  const DISCLAIMER = 'disclaimer';\n  const FROM_PRICE = 'from_price';\n  const GUEST_RATING = 'guest_rating';\n  const PERCENTAGE_OFF = 'percentage_off';\n  const PRICE = 'price';\n  const STAR_RATING = 'star_rating';\n  const STRIKETHROUGH_PRICE = 'strikethrough_price';\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeLinkDataImageOverlaySpecThemeColorValues getInstance()\n */\nclass AdCreativeLinkDataImageOverlaySpecThemeColorValues extends AbstractEnum {\n\n  const BACKGROUND_000000_TEXT_FFFFFF = 'background_000000_text_ffffff';\n  const BACKGROUND_0090FF_TEXT_FFFFFF = 'background_0090ff_text_ffffff';\n  const BACKGROUND_00AF4C_TEXT_FFFFFF = 'background_00af4c_text_ffffff';\n  const BACKGROUND_595959_TEXT_FFFFFF = 'background_595959_text_ffffff';\n  const BACKGROUND_755DDE_TEXT_FFFFFF = 'background_755dde_text_ffffff';\n  const BACKGROUND_E50900_TEXT_FFFFFF = 'background_e50900_text_ffffff';\n  const BACKGROUND_F23474_TEXT_FFFFFF = 'background_f23474_text_ffffff';\n  const BACKGROUND_F78400_TEXT_FFFFFF = 'background_f78400_text_ffffff';\n  const BACKGROUND_FFFFFF_TEXT_000000 = 'background_ffffff_text_000000';\n  const BACKGROUND_FFFFFF_TEXT_007AD0 = 'background_ffffff_text_007ad0';\n  const BACKGROUND_FFFFFF_TEXT_009C2A = 'background_ffffff_text_009c2a';\n  const BACKGROUND_FFFFFF_TEXT_646464 = 'background_ffffff_text_646464';\n  const BACKGROUND_FFFFFF_TEXT_755DDE = 'background_ffffff_text_755dde';\n  const BACKGROUND_FFFFFF_TEXT_C91B00 = 'background_ffffff_text_c91b00';\n  const BACKGROUND_FFFFFF_TEXT_F23474 = 'background_ffffff_text_f23474';\n  const BACKGROUND_FFFFFF_TEXT_F78400 = 'background_ffffff_text_f78400';\n}\n", "num_lines": 57}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeObjectTypeValues getInstance()\n */\nclass AdCreativeObjectTypeValues extends AbstractEnum {\n\n  const APPLICATION = 'APPLICATION';\n  const DOMAIN = 'DOMAIN';\n  const EVENT = 'EVENT';\n  const INVALID = 'INVALID';\n  const OFFER = 'OFFER';\n  const PAGE = 'PAGE';\n  const PHOTO = 'PHOTO';\n  const POST_DELETED = 'POST_DELETED';\n  const PRIVACY_CHECK_FAIL = 'PRIVACY_CHECK_FAIL';\n  const SHARE = 'SHARE';\n  const STATUS = 'STATUS';\n  const STORE_ITEM = 'STORE_ITEM';\n  const VIDEO = 'VIDEO';\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeOperatorValues getInstance()\n */\nclass AdCreativeOperatorValues extends AbstractEnum {\n\n  const ALL = 'ALL';\n  const ANY = 'ANY';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdCreativeStatusValues getInstance()\n */\nclass AdCreativeStatusValues extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const DELETED = 'DELETED';\n  const IN_PROCESS = 'IN_PROCESS';\n  const WITH_ISSUES = 'WITH_ISSUES';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdDatePresetValues getInstance()\n */\nclass AdDatePresetValues extends AbstractEnum {\n\n  const DATA_MAXIMUM = 'data_maximum';\n  const LAST_14D = 'last_14d';\n  const LAST_28D = 'last_28d';\n  const LAST_30D = 'last_30d';\n  const LAST_3D = 'last_3d';\n  const LAST_7D = 'last_7d';\n  const LAST_90D = 'last_90d';\n  const LAST_MONTH = 'last_month';\n  const LAST_QUARTER = 'last_quarter';\n  const LAST_WEEK_MON_SUN = 'last_week_mon_sun';\n  const LAST_WEEK_SUN_SAT = 'last_week_sun_sat';\n  const LAST_YEAR = 'last_year';\n  const MAXIMUM = 'maximum';\n  const THIS_MONTH = 'this_month';\n  const THIS_QUARTER = 'this_quarter';\n  const THIS_WEEK_MON_TODAY = 'this_week_mon_today';\n  const THIS_WEEK_SUN_TODAY = 'this_week_sun_today';\n  const THIS_YEAR = 'this_year';\n  const TODAY = 'today';\n  const YESTERDAY = 'yesterday';\n}\n", "num_lines": 61}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdEffectiveStatusValues getInstance()\n */\nclass AdEffectiveStatusValues extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const ADSET_PAUSED = 'ADSET_PAUSED';\n  const ARCHIVED = 'ARCHIVED';\n  const CAMPAIGN_PAUSED = 'CAMPAIGN_PAUSED';\n  const DELETED = 'DELETED';\n  const DISAPPROVED = 'DISAPPROVED';\n  const IN_PROCESS = 'IN_PROCESS';\n  const PAUSED = 'PAUSED';\n  const PENDING_BILLING_INFO = 'PENDING_BILLING_INFO';\n  const PENDING_REVIEW = 'PENDING_REVIEW';\n  const PREAPPROVED = 'PREAPPROVED';\n  const WITH_ISSUES = 'WITH_ISSUES';\n}\n", "num_lines": 53}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdExecutionOptionsValues getInstance()\n */\nclass AdExecutionOptionsValues extends AbstractEnum {\n\n  const INCLUDE_RECOMMENDATIONS = 'include_recommendations';\n  const SYNCHRONOUS_AD_REVIEW = 'synchronous_ad_review';\n  const VALIDATE_ONLY = 'validate_only';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdImageStatusValues getInstance()\n */\nclass AdImageStatusValues extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const DELETED = 'DELETED';\n  const INTERNAL = 'INTERNAL';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdMetaRewardAdgroupStatusValues getInstance()\n */\nclass AdMetaRewardAdgroupStatusValues extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const INACTIVE = 'INACTIVE';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdNetworkAnalyticsSyncQueryResultAggregationPeriodValues getInstance()\n */\nclass AdNetworkAnalyticsSyncQueryResultAggregationPeriodValues extends AbstractEnum {\n\n  const DAY = 'DAY';\n  const TOTAL = 'TOTAL';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdNetworkAnalyticsSyncQueryResultBreakdownsValues getInstance()\n */\nclass AdNetworkAnalyticsSyncQueryResultBreakdownsValues extends AbstractEnum {\n\n  const AD_SERVER_CAMPAIGN_ID = 'AD_SERVER_CAMPAIGN_ID';\n  const AD_SPACE = 'AD_SPACE';\n  const AGE = 'AGE';\n  const APP = 'APP';\n  const CLICKED_VIEW_TAG = 'CLICKED_VIEW_TAG';\n  const COUNTRY = 'COUNTRY';\n  const DEAL = 'DEAL';\n  const DEAL_AD = 'DEAL_AD';\n  const DEAL_PAGE = 'DEAL_PAGE';\n  const DELIVERY_METHOD = 'DELIVERY_METHOD';\n  const DISPLAY_FORMAT = 'DISPLAY_FORMAT';\n  const FAIL_REASON = 'FAIL_REASON';\n  const GENDER = 'GENDER';\n  const INSTANT_ARTICLE_ID = 'INSTANT_ARTICLE_ID';\n  const INSTANT_ARTICLE_PAGE_ID = 'INSTANT_ARTICLE_PAGE_ID';\n  const IS_DEAL_BACKFILL = 'IS_DEAL_BACKFILL';\n  const PLACEMENT = 'PLACEMENT';\n  const PLACEMENT_NAME = 'PLACEMENT_NAME';\n  const PLATFORM = 'PLATFORM';\n  const PROPERTY = 'PROPERTY';\n  const SDK_VERSION = 'SDK_VERSION';\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdNetworkAnalyticsSyncQueryResultMetricsValues getInstance()\n */\nclass AdNetworkAnalyticsSyncQueryResultMetricsValues extends AbstractEnum {\n\n  const FB_AD_NETWORK_BIDDING_BID_RATE = 'FB_AD_NETWORK_BIDDING_BID_RATE';\n  const FB_AD_NETWORK_BIDDING_REQUEST = 'FB_AD_NETWORK_BIDDING_REQUEST';\n  const FB_AD_NETWORK_BIDDING_RESPONSE = 'FB_AD_NETWORK_BIDDING_RESPONSE';\n  const FB_AD_NETWORK_BIDDING_REVENUE = 'FB_AD_NETWORK_BIDDING_REVENUE';\n  const FB_AD_NETWORK_BIDDING_WIN_RATE = 'FB_AD_NETWORK_BIDDING_WIN_RATE';\n  const FB_AD_NETWORK_CLICK = 'FB_AD_NETWORK_CLICK';\n  const FB_AD_NETWORK_CPM = 'FB_AD_NETWORK_CPM';\n  const FB_AD_NETWORK_CTR = 'FB_AD_NETWORK_CTR';\n  const FB_AD_NETWORK_FILLED_REQUEST = 'FB_AD_NETWORK_FILLED_REQUEST';\n  const FB_AD_NETWORK_FILL_RATE = 'FB_AD_NETWORK_FILL_RATE';\n  const FB_AD_NETWORK_IMP = 'FB_AD_NETWORK_IMP';\n  const FB_AD_NETWORK_IMPRESSION_RATE = 'FB_AD_NETWORK_IMPRESSION_RATE';\n  const FB_AD_NETWORK_REQUEST = 'FB_AD_NETWORK_REQUEST';\n  const FB_AD_NETWORK_REVENUE = 'FB_AD_NETWORK_REVENUE';\n  const FB_AD_NETWORK_SHOW_RATE = 'FB_AD_NETWORK_SHOW_RATE';\n  const FB_AD_NETWORK_VIDEO_GUARANTEE_REVENUE = 'FB_AD_NETWORK_VIDEO_GUARANTEE_REVENUE';\n  const FB_AD_NETWORK_VIDEO_MRC = 'FB_AD_NETWORK_VIDEO_MRC';\n  const FB_AD_NETWORK_VIDEO_MRC_RATE = 'FB_AD_NETWORK_VIDEO_MRC_RATE';\n  const FB_AD_NETWORK_VIDEO_VIEW = 'FB_AD_NETWORK_VIDEO_VIEW';\n  const FB_AD_NETWORK_VIDEO_VIEW_RATE = 'FB_AD_NETWORK_VIDEO_VIEW_RATE';\n}\n", "num_lines": 61}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdNetworkAnalyticsSyncQueryResultOrderingColumnValues getInstance()\n */\nclass AdNetworkAnalyticsSyncQueryResultOrderingColumnValues extends AbstractEnum {\n\n  const METRIC = 'METRIC';\n  const TIME = 'TIME';\n  const VALUE = 'VALUE';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdNetworkAnalyticsSyncQueryResultOrderingTypeValues getInstance()\n */\nclass AdNetworkAnalyticsSyncQueryResultOrderingTypeValues extends AbstractEnum {\n\n  const ASCENDING = 'ASCENDING';\n  const DESCENDING = 'DESCENDING';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdOperatorValues getInstance()\n */\nclass AdOperatorValues extends AbstractEnum {\n\n  const ALL = 'ALL';\n  const ANY = 'ANY';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdPlacePageSetLocationTypesValues getInstance()\n */\nclass AdPlacePageSetLocationTypesValues extends AbstractEnum {\n\n  const HOME = 'home';\n  const RECENT = 'recent';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdPlacePageSetTargetedAreaTypeValues getInstance()\n */\nclass AdPlacePageSetTargetedAreaTypeValues extends AbstractEnum {\n\n  const CUSTOM_RADIUS = 'CUSTOM_RADIUS';\n  const MARKETING_AREA = 'MARKETING_AREA';\n  const NONE = 'NONE';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdPreviewAdFormatValues getInstance()\n */\nclass AdPreviewAdFormatValues extends AbstractEnum {\n\n  const AUDIENCE_NETWORK_INSTREAM_VIDEO = 'AUDIENCE_NETWORK_INSTREAM_VIDEO';\n  const AUDIENCE_NETWORK_INSTREAM_VIDEO_MOBILE = 'AUDIENCE_NETWORK_INSTREAM_VIDEO_MOBILE';\n  const AUDIENCE_NETWORK_OUTSTREAM_VIDEO = 'AUDIENCE_NETWORK_OUTSTREAM_VIDEO';\n  const AUDIENCE_NETWORK_REWARDED_VIDEO = 'AUDIENCE_NETWORK_REWARDED_VIDEO';\n  const BIZ_DISCO_FEED_MOBILE = 'BIZ_DISCO_FEED_MOBILE';\n  const DESKTOP_FEED_STANDARD = 'DESKTOP_FEED_STANDARD';\n  const FACEBOOK_REELS_BANNER = 'FACEBOOK_REELS_BANNER';\n  const FACEBOOK_REELS_BANNER_DESKTOP = 'FACEBOOK_REELS_BANNER_DESKTOP';\n  const FACEBOOK_REELS_MOBILE = 'FACEBOOK_REELS_MOBILE';\n  const FACEBOOK_REELS_POSTLOOP = 'FACEBOOK_REELS_POSTLOOP';\n  const FACEBOOK_REELS_STICKER = 'FACEBOOK_REELS_STICKER';\n  const FACEBOOK_STORY_MOBILE = 'FACEBOOK_STORY_MOBILE';\n  const FACEBOOK_STORY_STICKER_MOBILE = 'FACEBOOK_STORY_STICKER_MOBILE';\n  const INSTAGRAM_EXPLORE_CONTEXTUAL = 'INSTAGRAM_EXPLORE_CONTEXTUAL';\n  const INSTAGRAM_EXPLORE_GRID_HOME = 'INSTAGRAM_EXPLORE_GRID_HOME';\n  const INSTAGRAM_EXPLORE_IMMERSIVE = 'INSTAGRAM_EXPLORE_IMMERSIVE';\n  const INSTAGRAM_FEED_WEB = 'INSTAGRAM_FEED_WEB';\n  const INSTAGRAM_FEED_WEB_M_SITE = 'INSTAGRAM_FEED_WEB_M_SITE';\n  const INSTAGRAM_PROFILE_FEED = 'INSTAGRAM_PROFILE_FEED';\n  const INSTAGRAM_REELS = 'INSTAGRAM_REELS';\n  const INSTAGRAM_REELS_OVERLAY = 'INSTAGRAM_REELS_OVERLAY';\n  const INSTAGRAM_SEARCH_CHAIN = 'INSTAGRAM_SEARCH_CHAIN';\n  const INSTAGRAM_SEARCH_GRID = 'INSTAGRAM_SEARCH_GRID';\n  const INSTAGRAM_STANDARD = 'INSTAGRAM_STANDARD';\n  const INSTAGRAM_STORY = 'INSTAGRAM_STORY';\n  const INSTAGRAM_STORY_CAMERA_TRAY = 'INSTAGRAM_STORY_CAMERA_TRAY';\n  const INSTAGRAM_STORY_WEB = 'INSTAGRAM_STORY_WEB';\n  const INSTAGRAM_STORY_WEB_M_SITE = 'INSTAGRAM_STORY_WEB_M_SITE';\n  const INSTANT_ARTICLE_RECIRCULATION_AD = 'INSTANT_ARTICLE_RECIRCULATION_AD';\n  const INSTANT_ARTICLE_STANDARD = 'INSTANT_ARTICLE_STANDARD';\n  const INSTREAM_BANNER_DESKTOP = 'INSTREAM_BANNER_DESKTOP';\n  const INSTREAM_BANNER_MOBILE = 'INSTREAM_BANNER_MOBILE';\n  const INSTREAM_VIDEO_DESKTOP = 'INSTREAM_VIDEO_DESKTOP';\n  const INSTREAM_VIDEO_IMAGE = 'INSTREAM_VIDEO_IMAGE';\n  const INSTREAM_VIDEO_MOBILE = 'INSTREAM_VIDEO_MOBILE';\n  const JOB_BROWSER_DESKTOP = 'JOB_BROWSER_DESKTOP';\n  const JOB_BROWSER_MOBILE = 'JOB_BROWSER_MOBILE';\n  const MARKETPLACE_MOBILE = 'MARKETPLACE_MOBILE';\n  const MESSENGER_MOBILE_INBOX_MEDIA = 'MESSENGER_MOBILE_INBOX_MEDIA';\n  const MESSENGER_MOBILE_STORY_MEDIA = 'MESSENGER_MOBILE_STORY_MEDIA';\n  const MOBILE_BANNER = 'MOBILE_BANNER';\n  const MOBILE_FEED_BASIC = 'MOBILE_FEED_BASIC';\n  const MOBILE_FEED_STANDARD = 'MOBILE_FEED_STANDARD';\n  const MOBILE_FULLWIDTH = 'MOBILE_FULLWIDTH';\n  const MOBILE_INTERSTITIAL = 'MOBILE_INTERSTITIAL';\n  const MOBILE_MEDIUM_RECTANGLE = 'MOBILE_MEDIUM_RECTANGLE';\n  const MOBILE_NATIVE = 'MOBILE_NATIVE';\n  const RIGHT_COLUMN_STANDARD = 'RIGHT_COLUMN_STANDARD';\n  const SUGGESTED_VIDEO_DESKTOP = 'SUGGESTED_VIDEO_DESKTOP';\n  const SUGGESTED_VIDEO_MOBILE = 'SUGGESTED_VIDEO_MOBILE';\n  const WATCH_FEED_HOME = 'WATCH_FEED_HOME';\n  const WATCH_FEED_MOBILE = 'WATCH_FEED_MOBILE';\n}\n", "num_lines": 93}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdPreviewCreativeFeatureValues getInstance()\n */\nclass AdPreviewCreativeFeatureValues extends AbstractEnum {\n\n  const PROFILE_CARD = 'profile_card';\n}\n", "num_lines": 42}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdPreviewRenderTypeValues getInstance()\n */\nclass AdPreviewRenderTypeValues extends AbstractEnum {\n\n  const FALLBACK = 'FALLBACK';\n}\n", "num_lines": 42}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdPromotedObjectCustomEventTypeValues getInstance()\n */\nclass AdPromotedObjectCustomEventTypeValues extends AbstractEnum {\n\n  const ACHIEVEMENT_UNLOCKED = 'ACHIEVEMENT_UNLOCKED';\n  const ADD_PAYMENT_INFO = 'ADD_PAYMENT_INFO';\n  const ADD_TO_CART = 'ADD_TO_CART';\n  const ADD_TO_WISHLIST = 'ADD_TO_WISHLIST';\n  const COMPLETE_REGISTRATION = 'COMPLETE_REGISTRATION';\n  const CONTACT = 'CONTACT';\n  const CONTENT_VIEW = 'CONTENT_VIEW';\n  const CUSTOMIZE_PRODUCT = 'CUSTOMIZE_PRODUCT';\n  const D2_RETENTION = 'D2_RETENTION';\n  const D7_RETENTION = 'D7_RETENTION';\n  const DONATE = 'DONATE';\n  const FIND_LOCATION = 'FIND_LOCATION';\n  const INITIATED_CHECKOUT = 'INITIATED_CHECKOUT';\n  const LEAD = 'LEAD';\n  const LEVEL_ACHIEVED = 'LEVEL_ACHIEVED';\n  const LISTING_INTERACTION = 'LISTING_INTERACTION';\n  const MESSAGING_CONVERSATION_STARTED_7D = 'MESSAGING_CONVERSATION_STARTED_7D';\n  const OTHER = 'OTHER';\n  const PURCHASE = 'PURCHASE';\n  const RATE = 'RATE';\n  const SCHEDULE = 'SCHEDULE';\n  const SEARCH = 'SEARCH';\n  const SERVICE_BOOKING_REQUEST = 'SERVICE_BOOKING_REQUEST';\n  const SPENT_CREDITS = 'SPENT_CREDITS';\n  const START_TRIAL = 'START_TRIAL';\n  const SUBMIT_APPLICATION = 'SUBMIT_APPLICATION';\n  const SUBSCRIBE = 'SUBSCRIBE';\n  const TUTORIAL_COMPLETION = 'TUTORIAL_COMPLETION';\n}\n", "num_lines": 69}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdRecommendationConfidenceValues getInstance()\n */\nclass AdRecommendationConfidenceValues extends AbstractEnum {\n\n  const HIGH = 'HIGH';\n  const LOW = 'LOW';\n  const MEDIUM = 'MEDIUM';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdRecommendationImportanceValues getInstance()\n */\nclass AdRecommendationImportanceValues extends AbstractEnum {\n\n  const HIGH = 'HIGH';\n  const LOW = 'LOW';\n  const MEDIUM = 'MEDIUM';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdRuleEvaluationSpecEvaluationTypeValues getInstance()\n */\nclass AdRuleEvaluationSpecEvaluationTypeValues extends AbstractEnum {\n\n  const SCHEDULE = 'SCHEDULE';\n  const TRIGGER = 'TRIGGER';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdRuleExecutionOptionsOperatorValues getInstance()\n */\nclass AdRuleExecutionOptionsOperatorValues extends AbstractEnum {\n\n  const EQUAL = 'EQUAL';\n  const IN = 'IN';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdRuleExecutionSpecExecutionTypeValues getInstance()\n */\nclass AdRuleExecutionSpecExecutionTypeValues extends AbstractEnum {\n\n  const ADD_INTEREST_RELAXATION = 'ADD_INTEREST_RELAXATION';\n  const ADD_QUESTIONNAIRE_INTERESTS = 'ADD_QUESTIONNAIRE_INTERESTS';\n  const AUDIENCE_CONSOLIDATION = 'AUDIENCE_CONSOLIDATION';\n  const AUDIENCE_CONSOLIDATION_ASK_FIRST = 'AUDIENCE_CONSOLIDATION_ASK_FIRST';\n  const CHANGE_BID = 'CHANGE_BID';\n  const CHANGE_BUDGET = 'CHANGE_BUDGET';\n  const CHANGE_CAMPAIGN_BUDGET = 'CHANGE_CAMPAIGN_BUDGET';\n  const INCREASE_RADIUS = 'INCREASE_RADIUS';\n  const NOTIFICATION = 'NOTIFICATION';\n  const PAUSE = 'PAUSE';\n  const PING_ENDPOINT = 'PING_ENDPOINT';\n  const REBALANCE_BUDGET = 'REBALANCE_BUDGET';\n  const ROTATE = 'ROTATE';\n  const UNPAUSE = 'UNPAUSE';\n  const UPDATE_CREATIVE = 'UPDATE_CREATIVE';\n  const UPDATE_LAX_BUDGET = 'UPDATE_LAX_BUDGET';\n  const UPDATE_LAX_DURATION = 'UPDATE_LAX_DURATION';\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdRuleFiltersOperatorValues getInstance()\n */\nclass AdRuleFiltersOperatorValues extends AbstractEnum {\n\n  const ALL = 'ALL';\n  const ANY = 'ANY';\n  const CONTAIN = 'CONTAIN';\n  const EQUAL = 'EQUAL';\n  const GREATER_THAN = 'GREATER_THAN';\n  const IN = 'IN';\n  const IN_RANGE = 'IN_RANGE';\n  const LESS_THAN = 'LESS_THAN';\n  const NONE = 'NONE';\n  const NOT_CONTAIN = 'NOT_CONTAIN';\n  const NOT_EQUAL = 'NOT_EQUAL';\n  const NOT_IN = 'NOT_IN';\n  const NOT_IN_RANGE = 'NOT_IN_RANGE';\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdRuleHistoryActionValues getInstance()\n */\nclass AdRuleHistoryActionValues extends AbstractEnum {\n\n  const BUDGET_NOT_REDISTRIBUTED = 'BUDGET_NOT_REDISTRIBUTED';\n  const CHANGED_BID = 'CHANGED_BID';\n  const CHANGED_BUDGET = 'CHANGED_BUDGET';\n  const EMAIL = 'EMAIL';\n  const ENABLE_AUTOFLOW = 'ENABLE_AUTOFLOW';\n  const ENDPOINT_PINGED = 'ENDPOINT_PINGED';\n  const ERROR = 'ERROR';\n  const FACEBOOK_NOTIFICATION_SENT = 'FACEBOOK_NOTIFICATION_SENT';\n  const MESSAGE_SENT = 'MESSAGE_SENT';\n  const NOT_CHANGED = 'NOT_CHANGED';\n  const PAUSED = 'PAUSED';\n  const UNPAUSED = 'UNPAUSED';\n}\n", "num_lines": 53}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdRuleHistoryResultObjectTypeValues getInstance()\n */\nclass AdRuleHistoryResultObjectTypeValues extends AbstractEnum {\n\n  const AD = 'AD';\n  const ADSET = 'ADSET';\n  const CAMPAIGN = 'CAMPAIGN';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdRuleStatusValues getInstance()\n */\nclass AdRuleStatusValues extends AbstractEnum {\n\n  const DELETED = 'DELETED';\n  const DISABLED = 'DISABLED';\n  const ENABLED = 'ENABLED';\n  const HAS_ISSUES = 'HAS_ISSUES';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdRuleTriggerOperatorValues getInstance()\n */\nclass AdRuleTriggerOperatorValues extends AbstractEnum {\n\n  const ALL = 'ALL';\n  const ANY = 'ANY';\n  const CONTAIN = 'CONTAIN';\n  const EQUAL = 'EQUAL';\n  const GREATER_THAN = 'GREATER_THAN';\n  const IN = 'IN';\n  const IN_RANGE = 'IN_RANGE';\n  const LESS_THAN = 'LESS_THAN';\n  const NONE = 'NONE';\n  const NOT_CONTAIN = 'NOT_CONTAIN';\n  const NOT_EQUAL = 'NOT_EQUAL';\n  const NOT_IN = 'NOT_IN';\n  const NOT_IN_RANGE = 'NOT_IN_RANGE';\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdRuleTriggerTypeValues getInstance()\n */\nclass AdRuleTriggerTypeValues extends AbstractEnum {\n\n  const DELIVERY_INSIGHTS_CHANGE = 'DELIVERY_INSIGHTS_CHANGE';\n  const METADATA_CREATION = 'METADATA_CREATION';\n  const METADATA_UPDATE = 'METADATA_UPDATE';\n  const STATS_CHANGE = 'STATS_CHANGE';\n  const STATS_MILESTONE = 'STATS_MILESTONE';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdRuleUiCreationSourceValues getInstance()\n */\nclass AdRuleUiCreationSourceValues extends AbstractEnum {\n\n  const AM_ACCOUNT_OVERVIEW_RECOMMENDATIONS = 'AM_ACCOUNT_OVERVIEW_RECOMMENDATIONS';\n  const AM_ACTIVITY_HISTORY_TABLE = 'AM_ACTIVITY_HISTORY_TABLE';\n  const AM_AD_OBJECT_NAME_CARD = 'AM_AD_OBJECT_NAME_CARD';\n  const AM_AMFE_L3_RECOMMENDATION = 'AM_AMFE_L3_RECOMMENDATION';\n  const AM_AUTOFLOW_GUIDANCE_CARD = 'AM_AUTOFLOW_GUIDANCE_CARD';\n  const AM_AUTO_APPLY_WIDGET = 'AM_AUTO_APPLY_WIDGET';\n  const AM_EDITOR_CARD = 'AM_EDITOR_CARD';\n  const AM_INFO_CARD = 'AM_INFO_CARD';\n  const AM_NAME_CELL_DROPDOWN = 'AM_NAME_CELL_DROPDOWN';\n  const AM_OPTIMIZATION_TIP_GUIDANCE_CARD = 'AM_OPTIMIZATION_TIP_GUIDANCE_CARD';\n  const AM_PERFORMANCE_SUMMARY = 'AM_PERFORMANCE_SUMMARY';\n  const AM_RULE_LANDING_PAGE_BANNER = 'AM_RULE_LANDING_PAGE_BANNER';\n  const AM_SYD_RESOLUTION_FLOW = 'AM_SYD_RESOLUTION_FLOW';\n  const AM_SYD_RESOLUTION_FLOW_MODAL = 'AM_SYD_RESOLUTION_FLOW_MODAL';\n  const AM_TOOLBAR_CREATE_RULE_DROPDOWN = 'AM_TOOLBAR_CREATE_RULE_DROPDOWN';\n  const PE_CAMPAIGN_STRUCTURE_MENU = 'PE_CAMPAIGN_STRUCTURE_MENU';\n  const PE_EDITOR_CARD = 'PE_EDITOR_CARD';\n  const PE_INFO_CARD = 'PE_INFO_CARD';\n  const PE_TOOLBAR_CREATE_RULE_DROPDOWN = 'PE_TOOLBAR_CREATE_RULE_DROPDOWN';\n  const RULES_MANAGEMENT_PAGE_ACTION_DROPDOWN = 'RULES_MANAGEMENT_PAGE_ACTION_DROPDOWN';\n  const RULES_MANAGEMENT_PAGE_RULE_GROUP = 'RULES_MANAGEMENT_PAGE_RULE_GROUP';\n  const RULES_MANAGEMENT_PAGE_RULE_NAME = 'RULES_MANAGEMENT_PAGE_RULE_NAME';\n  const RULES_MANAGEMENT_PAGE_TOP_NAV = 'RULES_MANAGEMENT_PAGE_TOP_NAV';\n  const RULES_VIEW_ACTIVE_RULES_DIALOG = 'RULES_VIEW_ACTIVE_RULES_DIALOG';\n  const RULE_CREATION_SUCCESS_DIALOG = 'RULE_CREATION_SUCCESS_DIALOG';\n  const RULE_SYD_REDIRECT = 'RULE_SYD_REDIRECT';\n  const RULE_TEMPLATES_DIALOG = 'RULE_TEMPLATES_DIALOG';\n}\n", "num_lines": 68}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdSetBidStrategyValues getInstance()\n */\nclass AdSetBidStrategyValues extends AbstractEnum {\n\n  const COST_CAP = 'COST_CAP';\n  const LOWEST_COST_WITHOUT_CAP = 'LOWEST_COST_WITHOUT_CAP';\n  const LOWEST_COST_WITH_BID_CAP = 'LOWEST_COST_WITH_BID_CAP';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdSetBillingEventValues getInstance()\n */\nclass AdSetBillingEventValues extends AbstractEnum {\n\n  const APP_INSTALLS = 'APP_INSTALLS';\n  const CLICKS = 'CLICKS';\n  const IMPRESSIONS = 'IMPRESSIONS';\n  const LINK_CLICKS = 'LINK_CLICKS';\n  const LISTING_INTERACTION = 'LISTING_INTERACTION';\n  const NONE = 'NONE';\n  const OFFER_CLAIMS = 'OFFER_CLAIMS';\n  const PAGE_LIKES = 'PAGE_LIKES';\n  const POST_ENGAGEMENT = 'POST_ENGAGEMENT';\n  const PURCHASE = 'PURCHASE';\n  const THRUPLAY = 'THRUPLAY';\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdSetConfiguredStatusValues getInstance()\n */\nclass AdSetConfiguredStatusValues extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const ARCHIVED = 'ARCHIVED';\n  const DELETED = 'DELETED';\n  const PAUSED = 'PAUSED';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdSetDatePresetValues getInstance()\n */\nclass AdSetDatePresetValues extends AbstractEnum {\n\n  const DATA_MAXIMUM = 'data_maximum';\n  const LAST_14D = 'last_14d';\n  const LAST_28D = 'last_28d';\n  const LAST_30D = 'last_30d';\n  const LAST_3D = 'last_3d';\n  const LAST_7D = 'last_7d';\n  const LAST_90D = 'last_90d';\n  const LAST_MONTH = 'last_month';\n  const LAST_QUARTER = 'last_quarter';\n  const LAST_WEEK_MON_SUN = 'last_week_mon_sun';\n  const LAST_WEEK_SUN_SAT = 'last_week_sun_sat';\n  const LAST_YEAR = 'last_year';\n  const MAXIMUM = 'maximum';\n  const THIS_MONTH = 'this_month';\n  const THIS_QUARTER = 'this_quarter';\n  const THIS_WEEK_MON_TODAY = 'this_week_mon_today';\n  const THIS_WEEK_SUN_TODAY = 'this_week_sun_today';\n  const THIS_YEAR = 'this_year';\n  const TODAY = 'today';\n  const YESTERDAY = 'yesterday';\n}\n", "num_lines": 61}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdSetDestinationTypeValues getInstance()\n */\nclass AdSetDestinationTypeValues extends AbstractEnum {\n\n  const APP = 'APP';\n  const APPLINKS_AUTOMATIC = 'APPLINKS_AUTOMATIC';\n  const FACEBOOK = 'FACEBOOK';\n  const MESSENGER = 'MESSENGER';\n  const UNDEFINED = 'UNDEFINED';\n  const WEBSITE = 'WEBSITE';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdSetEffectiveStatusValues getInstance()\n */\nclass AdSetEffectiveStatusValues extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const ARCHIVED = 'ARCHIVED';\n  const CAMPAIGN_PAUSED = 'CAMPAIGN_PAUSED';\n  const DELETED = 'DELETED';\n  const IN_PROCESS = 'IN_PROCESS';\n  const PAUSED = 'PAUSED';\n  const WITH_ISSUES = 'WITH_ISSUES';\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdSetExecutionOptionsValues getInstance()\n */\nclass AdSetExecutionOptionsValues extends AbstractEnum {\n\n  const INCLUDE_RECOMMENDATIONS = 'include_recommendations';\n  const VALIDATE_ONLY = 'validate_only';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdSetFullFunnelExplorationModeValues getInstance()\n */\nclass AdSetFullFunnelExplorationModeValues extends AbstractEnum {\n\n  const EXTENDED_EXPLORATION = 'EXTENDED_EXPLORATION';\n  const LIMITED_EXPLORATION = 'LIMITED_EXPLORATION';\n  const NONE_EXPLORATION = 'NONE_EXPLORATION';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdSetMultiOptimizationGoalWeightValues getInstance()\n */\nclass AdSetMultiOptimizationGoalWeightValues extends AbstractEnum {\n\n  const BALANCED = 'BALANCED';\n  const PREFER_EVENT = 'PREFER_EVENT';\n  const PREFER_INSTALL = 'PREFER_INSTALL';\n  const UNDEFINED = 'UNDEFINED';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdSetOperatorValues getInstance()\n */\nclass AdSetOperatorValues extends AbstractEnum {\n\n  const ALL = 'ALL';\n  const ANY = 'ANY';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdSetOptimizationGoalValues getInstance()\n */\nclass AdSetOptimizationGoalValues extends AbstractEnum {\n\n  const AD_RECALL_LIFT = 'AD_RECALL_LIFT';\n  const APP_INSTALLS = 'APP_INSTALLS';\n  const APP_INSTALLS_AND_OFFSITE_CONVERSIONS = 'APP_INSTALLS_AND_OFFSITE_CONVERSIONS';\n  const CONVERSATIONS = 'CONVERSATIONS';\n  const DERIVED_EVENTS = 'DERIVED_EVENTS';\n  const ENGAGED_USERS = 'ENGAGED_USERS';\n  const EVENT_RESPONSES = 'EVENT_RESPONSES';\n  const IMPRESSIONS = 'IMPRESSIONS';\n  const IN_APP_VALUE = 'IN_APP_VALUE';\n  const LANDING_PAGE_VIEWS = 'LANDING_PAGE_VIEWS';\n  const LEAD_GENERATION = 'LEAD_GENERATION';\n  const LINK_CLICKS = 'LINK_CLICKS';\n  const MESSAGING_APPOINTMENT_CONVERSION = 'MESSAGING_APPOINTMENT_CONVERSION';\n  const MESSAGING_PURCHASE_CONVERSION = 'MESSAGING_PURCHASE_CONVERSION';\n  const NONE = 'NONE';\n  const OFFSITE_CONVERSIONS = 'OFFSITE_CONVERSIONS';\n  const PAGE_LIKES = 'PAGE_LIKES';\n  const POST_ENGAGEMENT = 'POST_ENGAGEMENT';\n  const QUALITY_CALL = 'QUALITY_CALL';\n  const QUALITY_LEAD = 'QUALITY_LEAD';\n  const REACH = 'REACH';\n  const SUBSCRIBERS = 'SUBSCRIBERS';\n  const THRUPLAY = 'THRUPLAY';\n  const VALUE = 'VALUE';\n  const VISIT_INSTAGRAM_PROFILE = 'VISIT_INSTAGRAM_PROFILE';\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdSetOptimizationSubEventValues getInstance()\n */\nclass AdSetOptimizationSubEventValues extends AbstractEnum {\n\n  const NONE = 'NONE';\n  const TRAVEL_INTENT = 'TRAVEL_INTENT';\n  const TRAVEL_INTENT_BUCKET_01 = 'TRAVEL_INTENT_BUCKET_01';\n  const TRAVEL_INTENT_BUCKET_02 = 'TRAVEL_INTENT_BUCKET_02';\n  const TRAVEL_INTENT_BUCKET_03 = 'TRAVEL_INTENT_BUCKET_03';\n  const TRAVEL_INTENT_BUCKET_04 = 'TRAVEL_INTENT_BUCKET_04';\n  const TRAVEL_INTENT_BUCKET_05 = 'TRAVEL_INTENT_BUCKET_05';\n  const TRAVEL_INTENT_NO_DESTINATION_INTENT = 'TRAVEL_INTENT_NO_DESTINATION_INTENT';\n  const TRIP_CONSIDERATION = 'TRIP_CONSIDERATION';\n  const VIDEO_SOUND_ON = 'VIDEO_SOUND_ON';\n}\n", "num_lines": 51}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdSetStatusOptionValues getInstance()\n */\nclass AdSetStatusOptionValues extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const INHERITED_FROM_SOURCE = 'INHERITED_FROM_SOURCE';\n  const PAUSED = 'PAUSED';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdSetStatusValues getInstance()\n */\nclass AdSetStatusValues extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const ARCHIVED = 'ARCHIVED';\n  const DELETED = 'DELETED';\n  const PAUSED = 'PAUSED';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdSetTuneForCategoryValues getInstance()\n */\nclass AdSetTuneForCategoryValues extends AbstractEnum {\n\n  const CREDIT = 'CREDIT';\n  const EMPLOYMENT = 'EMPLOYMENT';\n  const HOUSING = 'HOUSING';\n  const ISSUES_ELECTIONS_POLITICS = 'ISSUES_ELECTIONS_POLITICS';\n  const NONE = 'NONE';\n  const ONLINE_GAMBLING_AND_GAMING = 'ONLINE_GAMBLING_AND_GAMING';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdsInsightsActionAttributionWindowsValues getInstance()\n */\nclass AdsInsightsActionAttributionWindowsValues extends AbstractEnum {\n\n  const VALUE_1D_CLICK = '1d_click';\n  const VALUE_1D_VIEW = '1d_view';\n  const VALUE_28D_CLICK = '28d_click';\n  const VALUE_28D_VIEW = '28d_view';\n  const VALUE_7D_CLICK = '7d_click';\n  const VALUE_7D_VIEW = '7d_view';\n  const DDA = 'dda';\n  const VALUE_DEFAULT = 'default';\n  const SKAN_CLICK = 'skan_click';\n  const SKAN_VIEW = 'skan_view';\n}\n", "num_lines": 51}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdsInsightsActionBreakdownsValues getInstance()\n */\nclass AdsInsightsActionBreakdownsValues extends AbstractEnum {\n\n  const ACTION_CANVAS_COMPONENT_NAME = 'action_canvas_component_name';\n  const ACTION_CAROUSEL_CARD_ID = 'action_carousel_card_id';\n  const ACTION_CAROUSEL_CARD_NAME = 'action_carousel_card_name';\n  const ACTION_DESTINATION = 'action_destination';\n  const ACTION_DEVICE = 'action_device';\n  const ACTION_REACTION = 'action_reaction';\n  const ACTION_TARGET_ID = 'action_target_id';\n  const ACTION_TYPE = 'action_type';\n  const ACTION_VIDEO_SOUND = 'action_video_sound';\n  const ACTION_VIDEO_TYPE = 'action_video_type';\n}\n", "num_lines": 51}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdsInsightsActionReportTimeValues getInstance()\n */\nclass AdsInsightsActionReportTimeValues extends AbstractEnum {\n\n  const CONVERSION = 'conversion';\n  const IMPRESSION = 'impression';\n  const MIXED = 'mixed';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdsInsightsBreakdownsValues getInstance()\n */\nclass AdsInsightsBreakdownsValues extends AbstractEnum {\n\n  const AD_FORMAT_ASSET = 'ad_format_asset';\n  const AGE = 'age';\n  const APP_ID = 'app_id';\n  const BODY_ASSET = 'body_asset';\n  const CALL_TO_ACTION_ASSET = 'call_to_action_asset';\n  const COARSE_CONVERSION_VALUE = 'coarse_conversion_value';\n  const COUNTRY = 'country';\n  const DESCRIPTION_ASSET = 'description_asset';\n  const DEVICE_PLATFORM = 'device_platform';\n  const DMA = 'dma';\n  const FIDELITY_TYPE = 'fidelity_type';\n  const FREQUENCY_VALUE = 'frequency_value';\n  const GENDER = 'gender';\n  const HOURLY_STATS_AGGREGATED_BY_ADVERTISER_TIME_ZONE = 'hourly_stats_aggregated_by_advertiser_time_zone';\n  const HOURLY_STATS_AGGREGATED_BY_AUDIENCE_TIME_ZONE = 'hourly_stats_aggregated_by_audience_time_zone';\n  const HSID = 'hsid';\n  const IMAGE_ASSET = 'image_asset';\n  const IMPRESSION_DEVICE = 'impression_device';\n  const IS_CONVERSION_ID_MODELED = 'is_conversion_id_modeled';\n  const LINK_URL_ASSET = 'link_url_asset';\n  const MMM = 'mmm';\n  const PLACE_PAGE_ID = 'place_page_id';\n  const PLATFORM_POSITION = 'platform_position';\n  const POSTBACK_SEQUENCE_INDEX = 'postback_sequence_index';\n  const PRODUCT_ID = 'product_id';\n  const PUBLISHER_PLATFORM = 'publisher_platform';\n  const REDOWNLOAD = 'redownload';\n  const REGION = 'region';\n  const SKAN_CAMPAIGN_ID = 'skan_campaign_id';\n  const SKAN_CONVERSION_ID = 'skan_conversion_id';\n  const TITLE_ASSET = 'title_asset';\n  const VIDEO_ASSET = 'video_asset';\n}\n", "num_lines": 73}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdsInsightsDatePresetValues getInstance()\n */\nclass AdsInsightsDatePresetValues extends AbstractEnum {\n\n  const DATA_MAXIMUM = 'data_maximum';\n  const LAST_14D = 'last_14d';\n  const LAST_28D = 'last_28d';\n  const LAST_30D = 'last_30d';\n  const LAST_3D = 'last_3d';\n  const LAST_7D = 'last_7d';\n  const LAST_90D = 'last_90d';\n  const LAST_MONTH = 'last_month';\n  const LAST_QUARTER = 'last_quarter';\n  const LAST_WEEK_MON_SUN = 'last_week_mon_sun';\n  const LAST_WEEK_SUN_SAT = 'last_week_sun_sat';\n  const LAST_YEAR = 'last_year';\n  const MAXIMUM = 'maximum';\n  const THIS_MONTH = 'this_month';\n  const THIS_QUARTER = 'this_quarter';\n  const THIS_WEEK_MON_TODAY = 'this_week_mon_today';\n  const THIS_WEEK_SUN_TODAY = 'this_week_sun_today';\n  const THIS_YEAR = 'this_year';\n  const TODAY = 'today';\n  const YESTERDAY = 'yesterday';\n}\n", "num_lines": 61}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdsInsightsLevelValues getInstance()\n */\nclass AdsInsightsLevelValues extends AbstractEnum {\n\n  const ACCOUNT = 'account';\n  const AD = 'ad';\n  const ADSET = 'adset';\n  const CAMPAIGN = 'campaign';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdsInsightsSummaryActionBreakdownsValues getInstance()\n */\nclass AdsInsightsSummaryActionBreakdownsValues extends AbstractEnum {\n\n  const ACTION_CANVAS_COMPONENT_NAME = 'action_canvas_component_name';\n  const ACTION_CAROUSEL_CARD_ID = 'action_carousel_card_id';\n  const ACTION_CAROUSEL_CARD_NAME = 'action_carousel_card_name';\n  const ACTION_DESTINATION = 'action_destination';\n  const ACTION_DEVICE = 'action_device';\n  const ACTION_REACTION = 'action_reaction';\n  const ACTION_TARGET_ID = 'action_target_id';\n  const ACTION_TYPE = 'action_type';\n  const ACTION_VIDEO_SOUND = 'action_video_sound';\n  const ACTION_VIDEO_TYPE = 'action_video_type';\n}\n", "num_lines": 51}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdsPixelAutomaticMatchingFieldsValues getInstance()\n */\nclass AdsPixelAutomaticMatchingFieldsValues extends AbstractEnum {\n\n  const COUNTRY = 'country';\n  const CT = 'ct';\n  const DB = 'db';\n  const EM = 'em';\n  const EXTERNAL_ID = 'external_id';\n  const FN = 'fn';\n  const GE = 'ge';\n  const LN = 'ln';\n  const PH = 'ph';\n  const ST = 'st';\n  const ZP = 'zp';\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdsPixelDataUseSettingValues getInstance()\n */\nclass AdsPixelDataUseSettingValues extends AbstractEnum {\n\n  const ADVERTISING_AND_ANALYTICS = 'ADVERTISING_AND_ANALYTICS';\n  const ANALYTICS_ONLY = 'ANALYTICS_ONLY';\n  const VALUE_EMPTY = 'EMPTY';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdsPixelFirstPartyCookieStatusValues getInstance()\n */\nclass AdsPixelFirstPartyCookieStatusValues extends AbstractEnum {\n\n  const VALUE_EMPTY = 'EMPTY';\n  const FIRST_PARTY_COOKIE_DISABLED = 'FIRST_PARTY_COOKIE_DISABLED';\n  const FIRST_PARTY_COOKIE_ENABLED = 'FIRST_PARTY_COOKIE_ENABLED';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdsPixelSortByValues getInstance()\n */\nclass AdsPixelSortByValues extends AbstractEnum {\n\n  const LAST_FIRED_TIME = 'LAST_FIRED_TIME';\n  const NAME = 'NAME';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdsPixelStatsResultAggregationValues getInstance()\n */\nclass AdsPixelStatsResultAggregationValues extends AbstractEnum {\n\n  const BROWSER_TYPE = 'browser_type';\n  const CUSTOM_DATA_FIELD = 'custom_data_field';\n  const DEVICE_OS = 'device_os';\n  const DEVICE_TYPE = 'device_type';\n  const EVENT = 'event';\n  const EVENT_DETECTION_METHOD = 'event_detection_method';\n  const EVENT_PROCESSING_RESULTS = 'event_processing_results';\n  const EVENT_SOURCE = 'event_source';\n  const EVENT_TOTAL_COUNTS = 'event_total_counts';\n  const EVENT_VALUE_COUNT = 'event_value_count';\n  const HAD_PII = 'had_pii';\n  const HOST = 'host';\n  const MATCH_KEYS = 'match_keys';\n  const PIXEL_FIRE = 'pixel_fire';\n  const URL = 'url';\n  const URL_BY_RULE = 'url_by_rule';\n}\n", "num_lines": 57}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdsPixelTasksValues getInstance()\n */\nclass AdsPixelTasksValues extends AbstractEnum {\n\n  const AA_ANALYZE = 'AA_ANALYZE';\n  const ADVERTISE = 'ADVERTISE';\n  const ANALYZE = 'ANALYZE';\n  const EDIT = 'EDIT';\n  const UPLOAD = 'UPLOAD';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdStatusOptionValues getInstance()\n */\nclass AdStatusOptionValues extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const INHERITED_FROM_SOURCE = 'INHERITED_FROM_SOURCE';\n  const PAUSED = 'PAUSED';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdStatusValues getInstance()\n */\nclass AdStatusValues extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const ARCHIVED = 'ARCHIVED';\n  const DELETED = 'DELETED';\n  const PAUSED = 'PAUSED';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdStudyCellCreationTemplateValues getInstance()\n */\nclass AdStudyCellCreationTemplateValues extends AbstractEnum {\n\n  const AUTOMATIC_PLACEMENTS = 'AUTOMATIC_PLACEMENTS';\n  const BRAND_AWARENESS = 'BRAND_AWARENESS';\n  const FACEBOOK = 'FACEBOOK';\n  const FACEBOOK_AUDIENCE_NETWORK = 'FACEBOOK_AUDIENCE_NETWORK';\n  const FACEBOOK_INSTAGRAM = 'FACEBOOK_INSTAGRAM';\n  const FACEBOOK_NEWS_FEED = 'FACEBOOK_NEWS_FEED';\n  const FACEBOOK_NEWS_FEED_IN_STREAM_VIDEO = 'FACEBOOK_NEWS_FEED_IN_STREAM_VIDEO';\n  const HIGH_FREQUENCY = 'HIGH_FREQUENCY';\n  const INSTAGRAM = 'INSTAGRAM';\n  const IN_STREAM_VIDEO = 'IN_STREAM_VIDEO';\n  const LOW_FREQUENCY = 'LOW_FREQUENCY';\n  const MEDIUM_FREQUENCY = 'MEDIUM_FREQUENCY';\n  const MOBILE_OPTIMIZED_VIDEO = 'MOBILE_OPTIMIZED_VIDEO';\n  const PAGE_POST_ENGAGEMENT = 'PAGE_POST_ENGAGEMENT';\n  const REACH = 'REACH';\n  const TV_COMMERCIAL = 'TV_COMMERCIAL';\n  const TV_FACEBOOK = 'TV_FACEBOOK';\n  const VIDEO_VIEW_OPTIMIZATION = 'VIDEO_VIEW_OPTIMIZATION';\n}\n", "num_lines": 59}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdStudyObjectiveTypeValues getInstance()\n */\nclass AdStudyObjectiveTypeValues extends AbstractEnum {\n\n  const BRAND = 'BRAND';\n  const BRANDLIFT = 'BRANDLIFT';\n  const CONVERSIONS = 'CONVERSIONS';\n  const FTL = 'FTL';\n  const MAE = 'MAE';\n  const MAI = 'MAI';\n  const MPC_CONVERSION = 'MPC_CONVERSION';\n  const NONSALES = 'NONSALES';\n  const PARTNER = 'PARTNER';\n  const SALES = 'SALES';\n  const TELCO = 'TELCO';\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdStudyTypeValues getInstance()\n */\nclass AdStudyTypeValues extends AbstractEnum {\n\n  const CONTINUOUS_LIFT_CONFIG = 'CONTINUOUS_LIFT_CONFIG';\n  const GEO_LIFT = 'GEO_LIFT';\n  const LIFT = 'LIFT';\n  const SPLIT_TEST = 'SPLIT_TEST';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdVideoBackdatedTimeGranularityValues getInstance()\n */\nclass AdVideoBackdatedTimeGranularityValues extends AbstractEnum {\n\n  const DAY = 'day';\n  const HOUR = 'hour';\n  const MIN = 'min';\n  const MONTH = 'month';\n  const NONE = 'none';\n  const YEAR = 'year';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdVideoContainerTypeValues getInstance()\n */\nclass AdVideoContainerTypeValues extends AbstractEnum {\n\n  const ACO_AUTOEXTRACTED_VIDEO = 'ACO_AUTOEXTRACTED_VIDEO';\n  const ACO_VIDEO_VARIATION = 'ACO_VIDEO_VARIATION';\n  const ADS_AI_GENERATED = 'ADS_AI_GENERATED';\n  const AD_BREAK_PREVIEW = 'AD_BREAK_PREVIEW';\n  const AD_DERIVATIVE = 'AD_DERIVATIVE';\n  const AD_LIBRARY_WATERMARK = 'AD_LIBRARY_WATERMARK';\n  const AGE_UP = 'AGE_UP';\n  const ALBUM_MULTIMEDIA_POST = 'ALBUM_MULTIMEDIA_POST';\n  const ALOHA_CALL_VIDEO = 'ALOHA_CALL_VIDEO';\n  const ALOHA_SUPERFRAME = 'ALOHA_SUPERFRAME';\n  const APP_REREVIEW_SCREENCAST = 'APP_REREVIEW_SCREENCAST';\n  const APP_REVIEW_SCREENCAST = 'APP_REVIEW_SCREENCAST';\n  const ASSET_MANAGER = 'ASSET_MANAGER';\n  const ATLAS_VIDEO = 'ATLAS_VIDEO';\n  const AUDIO_BRIEF = 'AUDIO_BRIEF';\n  const AUDIO_BROADCAST = 'AUDIO_BROADCAST';\n  const AUDIO_COMMENT = 'AUDIO_COMMENT';\n  const BROADCAST = 'BROADCAST';\n  const BULLETIN_ARTICLE_AUDIO = 'BULLETIN_ARTICLE_AUDIO';\n  const CANDIDATE_VIDEOS_DELETED = 'CANDIDATE_VIDEOS_DELETED';\n  const CANVAS = 'CANVAS';\n  const CFC_VIDEO = 'CFC_VIDEO';\n  const CMS_MEDIA_MANAGER = 'CMS_MEDIA_MANAGER';\n  const CONTAINED_POST_ATTACHMENT = 'CONTAINED_POST_ATTACHMENT';\n  const CONTAINED_POST_AUDIO_BROADCAST = 'CONTAINED_POST_AUDIO_BROADCAST';\n  const CONTAINED_POST_COPYRIGHT_REFERENCE_BROADCAST = 'CONTAINED_POST_COPYRIGHT_REFERENCE_BROADCAST';\n  const COPYRIGHT_REFERENCE_BROADCAST = 'COPYRIGHT_REFERENCE_BROADCAST';\n  const COPYRIGHT_REFERENCE_VIDEO = 'COPYRIGHT_REFERENCE_VIDEO';\n  const CREATION_ML_PRECREATION = 'CREATION_ML_PRECREATION';\n  const DCO_AD_ASSET_FEED = 'DCO_AD_ASSET_FEED';\n  const DCO_AUTOGEN_VIDEO = 'DCO_AUTOGEN_VIDEO';\n  const DCO_TRIMMED_VIDEO = 'DCO_TRIMMED_VIDEO';\n  const DIM_SUM = 'DIM_SUM';\n  const DIRECTED_POST_ATTACHMENT = 'DIRECTED_POST_ATTACHMENT';\n  const DIRECT_INBOX = 'DIRECT_INBOX';\n  const DIRECT_INBOX_REACTION = 'DIRECT_INBOX_REACTION';\n  const DROPS_SHOPPING_EVENT_PAGE = 'DROPS_SHOPPING_EVENT_PAGE';\n  const DYNAMIC_ITEM_DISPLAY_BUNDLE = 'DYNAMIC_ITEM_DISPLAY_BUNDLE';\n  const DYNAMIC_ITEM_VIDEO = 'DYNAMIC_ITEM_VIDEO';\n  const DYNAMIC_TEMPLATE_VIDEO = 'DYNAMIC_TEMPLATE_VIDEO';\n  const EVENT_COVER_VIDEO = 'EVENT_COVER_VIDEO';\n  const EVENT_TOUR = 'EVENT_TOUR';\n  const FACECAST_DVR = 'FACECAST_DVR';\n  const FB_AVATAR_ANIMATED_SATP = 'FB_AVATAR_ANIMATED_SATP';\n  const FB_COLLECTIBLE_VIDEO = 'FB_COLLECTIBLE_VIDEO';\n  const FB_SHORTS = 'FB_SHORTS';\n  const FB_SHORTS_CONTENT_REMIXABLE = 'FB_SHORTS_CONTENT_REMIXABLE';\n  const FB_SHORTS_CROSS_META_POST = 'FB_SHORTS_CROSS_META_POST';\n  const FB_SHORTS_GROUP_POST = 'FB_SHORTS_GROUP_POST';\n  const FB_SHORTS_PMV_POST = 'FB_SHORTS_PMV_POST';\n  const FB_SHORTS_PMV_POST_NO_NEWSFEED_NOR_TIMELINE = 'FB_SHORTS_PMV_POST_NO_NEWSFEED_NOR_TIMELINE';\n  const FB_SHORTS_POST = 'FB_SHORTS_POST';\n  const FB_SHORTS_REMIX_POST = 'FB_SHORTS_REMIX_POST';\n  const FUNDRAISER_COVER_VIDEO = 'FUNDRAISER_COVER_VIDEO';\n  const GAME_CLIP = 'GAME_CLIP';\n  const GEMSTONE = 'GEMSTONE';\n  const GIF_TO_VIDEO = 'GIF_TO_VIDEO';\n  const GOODWILL_ANNIVERSARY_DEPRECATED = 'GOODWILL_ANNIVERSARY_DEPRECATED';\n  const GOODWILL_ANNIVERSARY_PROMOTION_DEPRECATED = 'GOODWILL_ANNIVERSARY_PROMOTION_DEPRECATED';\n  const GOODWILL_VIDEO_CONTAINED_SHARE = 'GOODWILL_VIDEO_CONTAINED_SHARE';\n  const GOODWILL_VIDEO_PROMOTION = 'GOODWILL_VIDEO_PROMOTION';\n  const GOODWILL_VIDEO_SHARE = 'GOODWILL_VIDEO_SHARE';\n  const GOODWILL_VIDEO_TOKEN_REQUIRED = 'GOODWILL_VIDEO_TOKEN_REQUIRED';\n  const GROUP_POST = 'GROUP_POST';\n  const HACK_TV = 'HACK_TV';\n  const HEURISTIC_CLUSTER_VIDEO = 'HEURISTIC_CLUSTER_VIDEO';\n  const HEURISTIC_PREVIEW = 'HEURISTIC_PREVIEW';\n  const HIGHLIGHT_CLIP_VIDEO = 'HIGHLIGHT_CLIP_VIDEO';\n  const HUDDLE_BROADCAST = 'HUDDLE_BROADCAST';\n  const IG_REELS_XPV = 'IG_REELS_XPV';\n  const IG_STORIES_READER = 'IG_STORIES_READER';\n  const INJECTABLE = 'INJECTABLE';\n  const INSPIRATION_VIDEO = 'INSPIRATION_VIDEO';\n  const INSTAGRAM_VIDEO_COPY = 'INSTAGRAM_VIDEO_COPY';\n  const INSTANT_APPLICATION_PREVIEW = 'INSTANT_APPLICATION_PREVIEW';\n  const INSTANT_ARTICLE = 'INSTANT_ARTICLE';\n  const INSTANT_GAME_CLIP = 'INSTANT_GAME_CLIP';\n  const ISSUE_MODULE = 'ISSUE_MODULE';\n  const JOBS_CAREERS = 'JOBS_CAREERS';\n  const JOBS_VISUAL_INTRO_ENTRY = 'JOBS_VISUAL_INTRO_ENTRY';\n  const JOB_APPLICATION_VIDEO = 'JOB_APPLICATION_VIDEO';\n  const JOB_OPENING_VIDEO = 'JOB_OPENING_VIDEO';\n  const KOTOTORO = 'KOTOTORO';\n  const LEARN = 'LEARN';\n  const LEGACY = 'LEGACY';\n  const LEGACY_CONTAINED_POST_BROADCAST = 'LEGACY_CONTAINED_POST_BROADCAST';\n  const LIVE_AUDIO_ROOM_BROADCAST = 'LIVE_AUDIO_ROOM_BROADCAST';\n  const LIVE_CLIP_PREVIEW = 'LIVE_CLIP_PREVIEW';\n  const LIVE_CLIP_WORKCHAT = 'LIVE_CLIP_WORKCHAT';\n  const LIVE_CREATIVE_KIT_VIDEO = 'LIVE_CREATIVE_KIT_VIDEO';\n  const LIVE_PHOTO = 'LIVE_PHOTO';\n  const LOOK_NOW_DEPRECATED = 'LOOK_NOW_DEPRECATED';\n  const MARKETPLACE_LISTING_VIDEO = 'MARKETPLACE_LISTING_VIDEO';\n  const MARKETPLACE_PRE_RECORDED_VIDEO = 'MARKETPLACE_PRE_RECORDED_VIDEO';\n  const MESSENGER_WATCH_TOGETHER = 'MESSENGER_WATCH_TOGETHER';\n  const MOMENTS_VIDEO = 'MOMENTS_VIDEO';\n  const MUSIC_CLIP = 'MUSIC_CLIP';\n  const MUSIC_CLIP_IN_AUDIO_DIGEST = 'MUSIC_CLIP_IN_AUDIO_DIGEST';\n  const MUSIC_CLIP_IN_COMMENT = 'MUSIC_CLIP_IN_COMMENT';\n  const MUSIC_CLIP_IN_LIGHTWEIGHT_STATUS = 'MUSIC_CLIP_IN_LIGHTWEIGHT_STATUS';\n  const MUSIC_CLIP_IN_POLL_OPTION = 'MUSIC_CLIP_IN_POLL_OPTION';\n  const MUSIC_CLIP_ON_DATING_PROFILE = 'MUSIC_CLIP_ON_DATING_PROFILE';\n  const NEO_ASYNC_GAME_VIDEO = 'NEO_ASYNC_GAME_VIDEO';\n  const NEW_CONTAINED_POST_BROADCAST = 'NEW_CONTAINED_POST_BROADCAST';\n  const NO_STORY = 'NO_STORY';\n  const NO_STORY_WITH_ENTPOST = 'NO_STORY_WITH_ENTPOST';\n  const NPE_COLLAB_COPYRIGHT_CHECK = 'NPE_COLLAB_COPYRIGHT_CHECK';\n  const OCULUS_CREATOR_PORTAL = 'OCULUS_CREATOR_PORTAL';\n  const OCULUS_VENUES_BROADCAST = 'OCULUS_VENUES_BROADCAST';\n  const OFFERS_VIDEO = 'OFFERS_VIDEO';\n  const PAGES_COVER_VIDEO = 'PAGES_COVER_VIDEO';\n  const PAGE_REVIEW_SCREENCAST = 'PAGE_REVIEW_SCREENCAST';\n  const PAGE_SLIDESHOW_VIDEO = 'PAGE_SLIDESHOW_VIDEO';\n  const PAID_CONTENT_PREVIEW = 'PAID_CONTENT_PREVIEW';\n  const PAID_CONTENT_VIDEO = 'PAID_CONTENT_VIDEO';\n  const PAID_CONTENT_VIDEO__POST = 'PAID_CONTENT_VIDEO__POST';\n  const PAPER_DOCUMENT_AUDIO = 'PAPER_DOCUMENT_AUDIO';\n  const PAPER_DOCUMENT_VIDEO = 'PAPER_DOCUMENT_VIDEO';\n  const PIXELCLOUD = 'PIXELCLOUD';\n  const PODCAST_HIGHLIGHT = 'PODCAST_HIGHLIGHT';\n  const PODCAST_ML_PREVIEW = 'PODCAST_ML_PREVIEW';\n  const PODCAST_ML_PREVIEW_NO_NEWSFEED_STORY = 'PODCAST_ML_PREVIEW_NO_NEWSFEED_STORY';\n  const PODCAST_RSS = 'PODCAST_RSS';\n  const PODCAST_RSS_EPHEMERAL = 'PODCAST_RSS_EPHEMERAL';\n  const PODCAST_RSS_NO_NEWSFEED_STORY = 'PODCAST_RSS_NO_NEWSFEED_STORY';\n  const PODCAST_VOICES = 'PODCAST_VOICES';\n  const PODCAST_VOICES_NO_NEWSFEED_STORY = 'PODCAST_VOICES_NO_NEWSFEED_STORY';\n  const PREMIERE_SOURCE = 'PREMIERE_SOURCE';\n  const PREMIUM_MUSIC_VIDEO_CLIP = 'PREMIUM_MUSIC_VIDEO_CLIP';\n  const PREMIUM_MUSIC_VIDEO_CROPPED_CLIP = 'PREMIUM_MUSIC_VIDEO_CROPPED_CLIP';\n  const PREMIUM_MUSIC_VIDEO_NO_NEWSFEED_STORY = 'PREMIUM_MUSIC_VIDEO_NO_NEWSFEED_STORY';\n  const PREMIUM_MUSIC_VIDEO_WITH_NEWSFEED_STORY = 'PREMIUM_MUSIC_VIDEO_WITH_NEWSFEED_STORY';\n  const PRIVATE_GALLERY_VIDEO = 'PRIVATE_GALLERY_VIDEO';\n  const PRODUCT_VIDEO = 'PRODUCT_VIDEO';\n  const PROFILE_COVER_VIDEO = 'PROFILE_COVER_VIDEO';\n  const PROFILE_INTRO_CARD = 'PROFILE_INTRO_CARD';\n  const PROFILE_VIDEO = 'PROFILE_VIDEO';\n  const PROTON = 'PROTON';\n  const QUICK_PROMOTION = 'QUICK_PROMOTION';\n  const REPLACE_VIDEO = 'REPLACE_VIDEO';\n  const SALES_CLIENT_INTERACTION = 'SALES_CLIENT_INTERACTION';\n  const SAY_THANKS_DEPRECATED = 'SAY_THANKS_DEPRECATED';\n  const SHOWREEL_NATIVE_DUMMY_VIDEO = 'SHOWREEL_NATIVE_DUMMY_VIDEO';\n  const SLIDESHOW_ANIMOTO = 'SLIDESHOW_ANIMOTO';\n  const SLIDESHOW_SHAKR = 'SLIDESHOW_SHAKR';\n  const SLIDESHOW_VARIATION_VIDEO = 'SLIDESHOW_VARIATION_VIDEO';\n  const SOTTO_CONTENT = 'SOTTO_CONTENT';\n  const SOUNDBITES_VIDEO = 'SOUNDBITES_VIDEO';\n  const SOUND_PLATFORM_STREAM = 'SOUND_PLATFORM_STREAM';\n  const SRT_ATTACHMENT = 'SRT_ATTACHMENT';\n  const STAGES_BROADCAST = 'STAGES_BROADCAST';\n  const STORIES_VIDEO = 'STORIES_VIDEO';\n  const STORIES_WEARABLE = 'STORIES_WEARABLE';\n  const STORYLINE = 'STORYLINE';\n  const STORYLINE_WITH_EXTERNAL_MUSIC = 'STORYLINE_WITH_EXTERNAL_MUSIC';\n  const STORY_ARCHIVE_VIDEO = 'STORY_ARCHIVE_VIDEO';\n  const STORY_CARD_TEMPLATE = 'STORY_CARD_TEMPLATE';\n  const STREAM_HIGHLIGHTS_VIDEO = 'STREAM_HIGHLIGHTS_VIDEO';\n  const TAROT_DIGEST = 'TAROT_DIGEST';\n  const TEMPORARY_UNLISTED = 'TEMPORARY_UNLISTED';\n  const TEMP_MULTIMEDIA_POST = 'TEMP_MULTIMEDIA_POST';\n  const UNLISTED = 'UNLISTED';\n  const UNLISTED_HACK_TV = 'UNLISTED_HACK_TV';\n  const UNLISTED_HORIZON = 'UNLISTED_HORIZON';\n  const UNLISTED_OCULUS = 'UNLISTED_OCULUS';\n  const VIDEO_COMMENT = 'VIDEO_COMMENT';\n  const VIDEO_COMPOSITION_VARIATION = 'VIDEO_COMPOSITION_VARIATION';\n  const VIDEO_CREATIVE_EDITOR_AUTOGEN_AD_VIDEO = 'VIDEO_CREATIVE_EDITOR_AUTOGEN_AD_VIDEO';\n  const VIDEO_SUPERRES = 'VIDEO_SUPERRES';\n  const VOICES_ARTICLE_VIDEO = 'VOICES_ARTICLE_VIDEO';\n  const VU_GENERATED_VIDEO = 'VU_GENERATED_VIDEO';\n  const WOODHENGE = 'WOODHENGE';\n  const WORK_KNOWLEDGE_VIDEO = 'WORK_KNOWLEDGE_VIDEO';\n  const YOUR_DAY = 'YOUR_DAY';\n}\n", "num_lines": 215}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdVideoContentCategoryValues getInstance()\n */\nclass AdVideoContentCategoryValues extends AbstractEnum {\n\n  const BEAUTY_FASHION = 'BEAUTY_FASHION';\n  const BUSINESS = 'BUSINESS';\n  const CARS_TRUCKS = 'CARS_TRUCKS';\n  const COMEDY = 'COMEDY';\n  const CUTE_ANIMALS = 'CUTE_ANIMALS';\n  const ENTERTAINMENT = 'ENTERTAINMENT';\n  const FAMILY = 'FAMILY';\n  const FOOD_HEALTH = 'FOOD_HEALTH';\n  const HOME = 'HOME';\n  const LIFESTYLE = 'LIFESTYLE';\n  const MUSIC = 'MUSIC';\n  const NEWS = 'NEWS';\n  const OTHER = 'OTHER';\n  const POLITICS = 'POLITICS';\n  const SCIENCE = 'SCIENCE';\n  const SPORTS = 'SPORTS';\n  const TECHNOLOGY = 'TECHNOLOGY';\n  const VIDEO_GAMING = 'VIDEO_GAMING';\n}\n", "num_lines": 59}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdVideoFormattingValues getInstance()\n */\nclass AdVideoFormattingValues extends AbstractEnum {\n\n  const MARKDOWN = 'MARKDOWN';\n  const PLAINTEXT = 'PLAINTEXT';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdVideoOriginalProjectionTypeValues getInstance()\n */\nclass AdVideoOriginalProjectionTypeValues extends AbstractEnum {\n\n  const CUBEMAP = 'cubemap';\n  const EQUIRECTANGULAR = 'equirectangular';\n  const HALF_EQUIRECTANGULAR = 'half_equirectangular';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdVideoSwapModeValues getInstance()\n */\nclass AdVideoSwapModeValues extends AbstractEnum {\n\n  const REPLACE = 'replace';\n}\n", "num_lines": 42}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdVideoTypeValues getInstance()\n */\nclass AdVideoTypeValues extends AbstractEnum {\n\n  const TAGGED = 'tagged';\n  const UPLOADED = 'uploaded';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdVideoUnpublishedContentTypeValues getInstance()\n */\nclass AdVideoUnpublishedContentTypeValues extends AbstractEnum {\n\n  const ADS_POST = 'ADS_POST';\n  const DRAFT = 'DRAFT';\n  const INLINE_CREATED = 'INLINE_CREATED';\n  const PUBLISHED = 'PUBLISHED';\n  const REVIEWABLE_BRANDED_CONTENT = 'REVIEWABLE_BRANDED_CONTENT';\n  const SCHEDULED = 'SCHEDULED';\n  const SCHEDULED_RECURRING = 'SCHEDULED_RECURRING';\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdVideoUploadPhaseValues getInstance()\n */\nclass AdVideoUploadPhaseValues extends AbstractEnum {\n\n  const CANCEL = 'cancel';\n  const FINISH = 'finish';\n  const START = 'start';\n  const TRANSFER = 'transfer';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AdVideoVideoStateValues getInstance()\n */\nclass AdVideoVideoStateValues extends AbstractEnum {\n\n  const DRAFT = 'DRAFT';\n  const PUBLISHED = 'PUBLISHED';\n  const SCHEDULED = 'SCHEDULED';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ApplicationAnPlatformsValues getInstance()\n */\nclass ApplicationAnPlatformsValues extends AbstractEnum {\n\n  const ANDROID = 'ANDROID';\n  const DESKTOP = 'DESKTOP';\n  const GALAXY = 'GALAXY';\n  const INSTANT_ARTICLES = 'INSTANT_ARTICLES';\n  const IOS = 'IOS';\n  const MOBILE_WEB = 'MOBILE_WEB';\n  const OCULUS = 'OCULUS';\n  const UNKNOWN = 'UNKNOWN';\n  const XIAOMI = 'XIAOMI';\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ApplicationLoggingSourceValues getInstance()\n */\nclass ApplicationLoggingSourceValues extends AbstractEnum {\n\n  const DETECTION = 'DETECTION';\n  const MESSENGER_BOT = 'MESSENGER_BOT';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ApplicationLoggingTargetValues getInstance()\n */\nclass ApplicationLoggingTargetValues extends AbstractEnum {\n\n  const APP = 'APP';\n  const APP_AND_PAGE = 'APP_AND_PAGE';\n  const PAGE = 'PAGE';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ApplicationMutationMethodValues getInstance()\n */\nclass ApplicationMutationMethodValues extends AbstractEnum {\n\n  const ADD = 'ADD';\n  const DELETE = 'DELETE';\n  const REPLACE = 'REPLACE';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ApplicationPlatformValues getInstance()\n */\nclass ApplicationPlatformValues extends AbstractEnum {\n\n  const ANDROID = 'ANDROID';\n  const IOS = 'IOS';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ApplicationPostMethodValues getInstance()\n */\nclass ApplicationPostMethodValues extends AbstractEnum {\n\n  const CODELESS = 'CODELESS';\n  const EYMT = 'EYMT';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ApplicationRequestTypeValues getInstance()\n */\nclass ApplicationRequestTypeValues extends AbstractEnum {\n\n  const APP_INDEXING = 'APP_INDEXING';\n  const BUTTON_SAMPLING = 'BUTTON_SAMPLING';\n  const PLUGIN = 'PLUGIN';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ApplicationSupportedPlatformsValues getInstance()\n */\nclass ApplicationSupportedPlatformsValues extends AbstractEnum {\n\n  const AMAZON = 'AMAZON';\n  const ANDROID = 'ANDROID';\n  const CANVAS = 'CANVAS';\n  const GAMEROOM = 'GAMEROOM';\n  const INSTANT_GAME = 'INSTANT_GAME';\n  const IPAD = 'IPAD';\n  const IPHONE = 'IPHONE';\n  const MOBILE_WEB = 'MOBILE_WEB';\n  const OCULUS = 'OCULUS';\n  const SAMSUNG = 'SAMSUNG';\n  const SUPPLEMENTARY_IMAGES = 'SUPPLEMENTARY_IMAGES';\n  const WEB = 'WEB';\n  const WINDOWS = 'WINDOWS';\n  const XIAOMI = 'XIAOMI';\n}\n", "num_lines": 55}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static AppRoles getInstance()\n */\nclass AppRoles extends AbstractEnum {\n\n  const ADMINISTRATOR  = 'ADMINISTRATOR';\n  const DEVELOPER = 'DEVELOPER';\n  const TESTER = 'TESTER';\n  const INSIGHTS_USER = 'INSIGHTS_USER';\n  const TEST_USER = 'TEST_USER';\n\n}\n", "num_lines": 41}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\nclass ArchivableCrudObjectEffectiveStatuses extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const AD_PAUSED = 'AD_PAUSED';\n  const ADSET_PAUSED = 'ADSET_PAUSED';\n  const ARCHIVED = 'ARCHIVED';\n  const ARCHIVED_IN_DRAFT = 'ARCHIVED_IN_DRAFT';\n  const CAMPAIGN_PAUSED = 'CAMPAIGN_PAUSED';\n  const DELETED = 'DELETED';\n  const DISAPPROVED = 'DISAPPROVED';\n  const PAUSED = 'PAUSED';\n  const PENDING = 'PENDING';\n  const PENDING_BILLING_INFO = 'PENDING_BILLING_INFO';\n  const PENDING_REVIEW = 'PENDING_REVIEW';\n  const PREAPPROVED = 'PREAPPROVED';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AsyncRequestStatusValues getInstance()\n */\nclass AsyncRequestStatusValues extends AbstractEnum {\n\n  const ERROR = 'ERROR';\n  const EXECUTING = 'EXECUTING';\n  const FINISHED = 'FINISHED';\n  const INITIALIZED = 'INITIALIZED';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AsyncRequestTypeValues getInstance()\n */\nclass AsyncRequestTypeValues extends AbstractEnum {\n\n  const ASYNC_ADGROUP_CREATION = 'ASYNC_ADGROUP_CREATION';\n  const BATCH_API = 'BATCH_API';\n  const DRAFTS = 'DRAFTS';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AutomotiveModelImageFetchStatusValues getInstance()\n */\nclass AutomotiveModelImageFetchStatusValues extends AbstractEnum {\n\n  const DIRECT_UPLOAD = 'DIRECT_UPLOAD';\n  const FETCHED = 'FETCHED';\n  const FETCH_FAILED = 'FETCH_FAILED';\n  const NO_STATUS = 'NO_STATUS';\n  const OUTDATED = 'OUTDATED';\n  const PARTIAL_FETCH = 'PARTIAL_FETCH';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static AutomotiveModelVisibilityValues getInstance()\n */\nclass AutomotiveModelVisibilityValues extends AbstractEnum {\n\n  const PUBLISHED = 'PUBLISHED';\n  const STAGING = 'STAGING';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\n/**\n * @deprecated use AdSetBillingEventValues instead\n *\n * @method static BillingEvents getInstance()\n */\nclass BillingEvents extends AdSetBillingEventValues {}\n", "num_lines": 33}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static BusinessActionSourceValues getInstance()\n */\nclass BusinessActionSourceValues extends AbstractEnum {\n\n  const PHYSICAL_STORE = 'PHYSICAL_STORE';\n  const WEBSITE = 'WEBSITE';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static BusinessAssetGroupAdaccountTasksValues getInstance()\n */\nclass BusinessAssetGroupAdaccountTasksValues extends AbstractEnum {\n\n  const AA_ANALYZE = 'AA_ANALYZE';\n  const ADVERTISE = 'ADVERTISE';\n  const ANALYZE = 'ANALYZE';\n  const DRAFT = 'DRAFT';\n  const MANAGE = 'MANAGE';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static BusinessAssetGroupOfflineConversionDataSetTasksValues getInstance()\n */\nclass BusinessAssetGroupOfflineConversionDataSetTasksValues extends AbstractEnum {\n\n  const AA_ANALYZE = 'AA_ANALYZE';\n  const ADVERTISE = 'ADVERTISE';\n  const MANAGE = 'MANAGE';\n  const UPLOAD = 'UPLOAD';\n  const VIEW = 'VIEW';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static BusinessAssetGroupPageTasksValues getInstance()\n */\nclass BusinessAssetGroupPageTasksValues extends AbstractEnum {\n\n  const ADVERTISE = 'ADVERTISE';\n  const ANALYZE = 'ANALYZE';\n  const CASHIER_ROLE = 'CASHIER_ROLE';\n  const CREATE_CONTENT = 'CREATE_CONTENT';\n  const MANAGE = 'MANAGE';\n  const MANAGE_JOBS = 'MANAGE_JOBS';\n  const MANAGE_LEADS = 'MANAGE_LEADS';\n  const MESSAGING = 'MESSAGING';\n  const MODERATE = 'MODERATE';\n  const MODERATE_COMMUNITY = 'MODERATE_COMMUNITY';\n  const PAGES_MESSAGING = 'PAGES_MESSAGING';\n  const PAGES_MESSAGING_SUBSCRIPTIONS = 'PAGES_MESSAGING_SUBSCRIPTIONS';\n  const PROFILE_PLUS_ADVERTISE = 'PROFILE_PLUS_ADVERTISE';\n  const PROFILE_PLUS_ANALYZE = 'PROFILE_PLUS_ANALYZE';\n  const PROFILE_PLUS_CREATE_CONTENT = 'PROFILE_PLUS_CREATE_CONTENT';\n  const PROFILE_PLUS_FACEBOOK_ACCESS = 'PROFILE_PLUS_FACEBOOK_ACCESS';\n  const PROFILE_PLUS_FULL_CONTROL = 'PROFILE_PLUS_FULL_CONTROL';\n  const PROFILE_PLUS_MANAGE = 'PROFILE_PLUS_MANAGE';\n  const PROFILE_PLUS_MANAGE_LEADS = 'PROFILE_PLUS_MANAGE_LEADS';\n  const PROFILE_PLUS_MESSAGING = 'PROFILE_PLUS_MESSAGING';\n  const PROFILE_PLUS_MODERATE = 'PROFILE_PLUS_MODERATE';\n  const PROFILE_PLUS_MODERATE_DELEGATE_COMMUNITY = 'PROFILE_PLUS_MODERATE_DELEGATE_COMMUNITY';\n  const PROFILE_PLUS_REVENUE = 'PROFILE_PLUS_REVENUE';\n  const READ_PAGE_MAILBOXES = 'READ_PAGE_MAILBOXES';\n  const VIEW_MONETIZATION_INSIGHTS = 'VIEW_MONETIZATION_INSIGHTS';\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static BusinessAssetGroupPixelTasksValues getInstance()\n */\nclass BusinessAssetGroupPixelTasksValues extends AbstractEnum {\n\n  const AA_ANALYZE = 'AA_ANALYZE';\n  const ADVERTISE = 'ADVERTISE';\n  const ANALYZE = 'ANALYZE';\n  const EDIT = 'EDIT';\n  const UPLOAD = 'UPLOAD';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static BusinessAssetSharingAgreementRequestStatusValues getInstance()\n */\nclass BusinessAssetSharingAgreementRequestStatusValues extends AbstractEnum {\n\n  const APPROVE = 'APPROVE';\n  const DECLINE = 'DECLINE';\n  const EXPIRED = 'EXPIRED';\n  const IN_PROGRESS = 'IN_PROGRESS';\n  const PENDING = 'PENDING';\n  const PENDING_EMAIL_VERIFICATION = 'PENDING_EMAIL_VERIFICATION';\n  const PENDING_INTEGRITY_REVIEW = 'PENDING_INTEGRITY_REVIEW';\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static BusinessOwnedObjectOnBehalfOfRequestStatusValues getInstance()\n */\nclass BusinessOwnedObjectOnBehalfOfRequestStatusValues extends AbstractEnum {\n\n  const APPROVE = 'APPROVE';\n  const DECLINE = 'DECLINE';\n  const EXPIRED = 'EXPIRED';\n  const IN_PROGRESS = 'IN_PROGRESS';\n  const PENDING = 'PENDING';\n  const PENDING_EMAIL_VERIFICATION = 'PENDING_EMAIL_VERIFICATION';\n  const PENDING_INTEGRITY_REVIEW = 'PENDING_INTEGRITY_REVIEW';\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static BusinessPagePermittedTasksValues getInstance()\n */\nclass BusinessPagePermittedTasksValues extends AbstractEnum {\n\n  const ADVERTISE = 'ADVERTISE';\n  const ANALYZE = 'ANALYZE';\n  const CASHIER_ROLE = 'CASHIER_ROLE';\n  const CREATE_CONTENT = 'CREATE_CONTENT';\n  const MANAGE = 'MANAGE';\n  const MANAGE_JOBS = 'MANAGE_JOBS';\n  const MANAGE_LEADS = 'MANAGE_LEADS';\n  const MESSAGING = 'MESSAGING';\n  const MODERATE = 'MODERATE';\n  const MODERATE_COMMUNITY = 'MODERATE_COMMUNITY';\n  const PAGES_MESSAGING = 'PAGES_MESSAGING';\n  const PAGES_MESSAGING_SUBSCRIPTIONS = 'PAGES_MESSAGING_SUBSCRIPTIONS';\n  const PROFILE_PLUS_ADVERTISE = 'PROFILE_PLUS_ADVERTISE';\n  const PROFILE_PLUS_ANALYZE = 'PROFILE_PLUS_ANALYZE';\n  const PROFILE_PLUS_CREATE_CONTENT = 'PROFILE_PLUS_CREATE_CONTENT';\n  const PROFILE_PLUS_FACEBOOK_ACCESS = 'PROFILE_PLUS_FACEBOOK_ACCESS';\n  const PROFILE_PLUS_FULL_CONTROL = 'PROFILE_PLUS_FULL_CONTROL';\n  const PROFILE_PLUS_MANAGE = 'PROFILE_PLUS_MANAGE';\n  const PROFILE_PLUS_MANAGE_LEADS = 'PROFILE_PLUS_MANAGE_LEADS';\n  const PROFILE_PLUS_MESSAGING = 'PROFILE_PLUS_MESSAGING';\n  const PROFILE_PLUS_MODERATE = 'PROFILE_PLUS_MODERATE';\n  const PROFILE_PLUS_MODERATE_DELEGATE_COMMUNITY = 'PROFILE_PLUS_MODERATE_DELEGATE_COMMUNITY';\n  const PROFILE_PLUS_REVENUE = 'PROFILE_PLUS_REVENUE';\n  const READ_PAGE_MAILBOXES = 'READ_PAGE_MAILBOXES';\n  const VIEW_MONETIZATION_INSIGHTS = 'VIEW_MONETIZATION_INSIGHTS';\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static BusinessPermittedTasksValues getInstance()\n */\nclass BusinessPermittedTasksValues extends AbstractEnum {\n\n  const ADVERTISE = 'ADVERTISE';\n  const ANALYZE = 'ANALYZE';\n  const CASHIER_ROLE = 'CASHIER_ROLE';\n  const CREATE_CONTENT = 'CREATE_CONTENT';\n  const MANAGE = 'MANAGE';\n  const MANAGE_JOBS = 'MANAGE_JOBS';\n  const MANAGE_LEADS = 'MANAGE_LEADS';\n  const MESSAGING = 'MESSAGING';\n  const MODERATE = 'MODERATE';\n  const MODERATE_COMMUNITY = 'MODERATE_COMMUNITY';\n  const PAGES_MESSAGING = 'PAGES_MESSAGING';\n  const PAGES_MESSAGING_SUBSCRIPTIONS = 'PAGES_MESSAGING_SUBSCRIPTIONS';\n  const PROFILE_PLUS_ADVERTISE = 'PROFILE_PLUS_ADVERTISE';\n  const PROFILE_PLUS_ANALYZE = 'PROFILE_PLUS_ANALYZE';\n  const PROFILE_PLUS_CREATE_CONTENT = 'PROFILE_PLUS_CREATE_CONTENT';\n  const PROFILE_PLUS_FACEBOOK_ACCESS = 'PROFILE_PLUS_FACEBOOK_ACCESS';\n  const PROFILE_PLUS_FULL_CONTROL = 'PROFILE_PLUS_FULL_CONTROL';\n  const PROFILE_PLUS_MANAGE = 'PROFILE_PLUS_MANAGE';\n  const PROFILE_PLUS_MANAGE_LEADS = 'PROFILE_PLUS_MANAGE_LEADS';\n  const PROFILE_PLUS_MESSAGING = 'PROFILE_PLUS_MESSAGING';\n  const PROFILE_PLUS_MODERATE = 'PROFILE_PLUS_MODERATE';\n  const PROFILE_PLUS_MODERATE_DELEGATE_COMMUNITY = 'PROFILE_PLUS_MODERATE_DELEGATE_COMMUNITY';\n  const PROFILE_PLUS_REVENUE = 'PROFILE_PLUS_REVENUE';\n  const READ_PAGE_MAILBOXES = 'READ_PAGE_MAILBOXES';\n  const VIEW_MONETIZATION_INSIGHTS = 'VIEW_MONETIZATION_INSIGHTS';\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static BusinessRoleRequestRoleValues getInstance()\n */\nclass BusinessRoleRequestRoleValues extends AbstractEnum {\n\n  const ADMIN = 'ADMIN';\n  const ADS_RIGHTS_REVIEWER = 'ADS_RIGHTS_REVIEWER';\n  const VALUE_DEFAULT = 'DEFAULT';\n  const DEVELOPER = 'DEVELOPER';\n  const EMPLOYEE = 'EMPLOYEE';\n  const FINANCE_ANALYST = 'FINANCE_ANALYST';\n  const FINANCE_EDIT = 'FINANCE_EDIT';\n  const FINANCE_EDITOR = 'FINANCE_EDITOR';\n  const FINANCE_VIEW = 'FINANCE_VIEW';\n  const MANAGE = 'MANAGE';\n  const PARTNER_CENTER_ADMIN = 'PARTNER_CENTER_ADMIN';\n  const PARTNER_CENTER_ANALYST = 'PARTNER_CENTER_ANALYST';\n  const PARTNER_CENTER_EDUCATION = 'PARTNER_CENTER_EDUCATION';\n  const PARTNER_CENTER_MARKETING = 'PARTNER_CENTER_MARKETING';\n  const PARTNER_CENTER_OPERATIONS = 'PARTNER_CENTER_OPERATIONS';\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static BusinessRoles getInstance()\n */\nclass BusinessRoles extends AbstractEnum {\n\n  const ADMIN  = 'ADMIN';\n  const EMPLOYEE = 'EMPLOYEE';\n  const OWNER = 'OWNER';\n  const AGENCY = 'AGENCY';\n\n}\n", "num_lines": 40}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static BusinessSubverticalV2Values getInstance()\n */\nclass BusinessSubverticalV2Values extends AbstractEnum {\n\n  const ACCOUNTING_AND_TAX = 'ACCOUNTING_AND_TAX';\n  const ACTIVITIES_AND_LEISURE = 'ACTIVITIES_AND_LEISURE';\n  const AIR = 'AIR';\n  const APPAREL_AND_ACCESSORIES = 'APPAREL_AND_ACCESSORIES';\n  const ARTS_AND_HERITAGE_AND_EDUCATION = 'ARTS_AND_HERITAGE_AND_EDUCATION';\n  const AR_OR_VR_GAMING = 'AR_OR_VR_GAMING';\n  const AUDIO_STREAMING = 'AUDIO_STREAMING';\n  const AUTO = 'AUTO';\n  const AUTO_INSURANCE = 'AUTO_INSURANCE';\n  const AUTO_RENTAL = 'AUTO_RENTAL';\n  const BABY = 'BABY';\n  const BALLOT_INITIATIVE_OR_REFERENDUM = 'BALLOT_INITIATIVE_OR_REFERENDUM';\n  const BEAUTY = 'BEAUTY';\n  const BEAUTY_AND_FASHION = 'BEAUTY_AND_FASHION';\n  const BEER_AND_WINE_AND_LIQUOR_AND_MALT_BEVERAGES = 'BEER_AND_WINE_AND_LIQUOR_AND_MALT_BEVERAGES';\n  const BOOKSTORES = 'BOOKSTORES';\n  const BROADCAST_TELEVISION = 'BROADCAST_TELEVISION';\n  const BUSINESS_CONSULTANTS = 'BUSINESS_CONSULTANTS';\n  const BUYING_AGENCY = 'BUYING_AGENCY';\n  const CABLE_AND_SATELLITE = 'CABLE_AND_SATELLITE';\n  const CABLE_TELEVISION = 'CABLE_TELEVISION';\n  const CALL_CENTER_AND_MESSAGING_SERVICES = 'CALL_CENTER_AND_MESSAGING_SERVICES';\n  const CANDIDATE_OR_POLITICIAN = 'CANDIDATE_OR_POLITICIAN';\n  const CAREER = 'CAREER';\n  const CAREER_AND_TECH = 'CAREER_AND_TECH';\n  const CASUAL_DINING = 'CASUAL_DINING';\n  const CHRONIC_CONDITIONS_AND_MEDICAL_CAUSES = 'CHRONIC_CONDITIONS_AND_MEDICAL_CAUSES';\n  const CIVIC_INFLUENCERS = 'CIVIC_INFLUENCERS';\n  const CLINICAL_TRIALS = 'CLINICAL_TRIALS';\n  const COFFEE = 'COFFEE';\n  const COMPUTER_AND_SOFTWARE_AND_HARDWARE = 'COMPUTER_AND_SOFTWARE_AND_HARDWARE';\n  const CONSOLE_AND_CROSS_PLATFORM_GAMING = 'CONSOLE_AND_CROSS_PLATFORM_GAMING';\n  const CONSULTING = 'CONSULTING';\n  const CONSUMER_ELECTRONICS = 'CONSUMER_ELECTRONICS';\n  const COUNSELING_AND_PSYCHOTHERAPY = 'COUNSELING_AND_PSYCHOTHERAPY';\n  const CREATIVE_AGENCY = 'CREATIVE_AGENCY';\n  const CREDIT_AND_FINANCING_AND_MORTAGES = 'CREDIT_AND_FINANCING_AND_MORTAGES';\n  const CRUISES_AND_MARINE = 'CRUISES_AND_MARINE';\n  const CULTURE_AND_LIFESTYLE = 'CULTURE_AND_LIFESTYLE';\n  const DATA_ANALYTICS_AND_DATA_MANAGEMENT = 'DATA_ANALYTICS_AND_DATA_MANAGEMENT';\n  const DATING_AND_TECHNOLOGY_APPS = 'DATING_AND_TECHNOLOGY_APPS';\n  const DEPARTMENT_STORE = 'DEPARTMENT_STORE';\n  const DESKTOP_SOFTWARE = 'DESKTOP_SOFTWARE';\n  const DIETING_AND_FITNESS_PROGRAMS = 'DIETING_AND_FITNESS_PROGRAMS';\n  const DIGITAL_NATIVE_EDUCATION_OR_TRAINING = 'DIGITAL_NATIVE_EDUCATION_OR_TRAINING';\n  const DRINKING_PLACES = 'DRINKING_PLACES';\n  const EDUCATION_RESOURCES = 'EDUCATION_RESOURCES';\n  const ED_TECH = 'ED_TECH';\n  const ELEARNING_AND_MASSIVE_ONLINE_OPEN_COURSES = 'ELEARNING_AND_MASSIVE_ONLINE_OPEN_COURSES';\n  const ELECTION_COMMISSION = 'ELECTION_COMMISSION';\n  const ELECTRONICS_AND_APPLIANCES = 'ELECTRONICS_AND_APPLIANCES';\n  const ENGINEERING_AND_DESIGN = 'ENGINEERING_AND_DESIGN';\n  const ENVIRONMENT_AND_ANIMAL_WELFARE = 'ENVIRONMENT_AND_ANIMAL_WELFARE';\n  const ESPORTS = 'ESPORTS';\n  const EVENTS = 'EVENTS';\n  const FARMING_AND_RANCHING = 'FARMING_AND_RANCHING';\n  const FILE_STORAGE_AND_CLOUD_AND_DATA_SERVICES = 'FILE_STORAGE_AND_CLOUD_AND_DATA_SERVICES';\n  const FINANCE = 'FINANCE';\n  const FIN_TECH = 'FIN_TECH';\n  const FISHING_AND_HUNTING_AND_FORESTRY_AND_LOGGING = 'FISHING_AND_HUNTING_AND_FORESTRY_AND_LOGGING';\n  const FITNESS = 'FITNESS';\n  const FOOD = 'FOOD';\n  const FOOTWEAR = 'FOOTWEAR';\n  const FOR_PROFIT_COLLEGES_AND_UNIVERSITIES = 'FOR_PROFIT_COLLEGES_AND_UNIVERSITIES';\n  const FULL_SERVICE_AGENCY = 'FULL_SERVICE_AGENCY';\n  const GOVERNMENT_CONTROLLED_ENTITY = 'GOVERNMENT_CONTROLLED_ENTITY';\n  const GOVERNMENT_DEPARTMENT_OR_AGENCY = 'GOVERNMENT_DEPARTMENT_OR_AGENCY';\n  const GOVERNMENT_OFFICIAL = 'GOVERNMENT_OFFICIAL';\n  const GOVERNMENT_OWNED_MEDIA = 'GOVERNMENT_OWNED_MEDIA';\n  const GROCERY_AND_DRUG_AND_CONVENIENCE = 'GROCERY_AND_DRUG_AND_CONVENIENCE';\n  const HEAD_OF_STATE = 'HEAD_OF_STATE';\n  const HEALTH_INSURANCE = 'HEALTH_INSURANCE';\n  const HEALTH_SYSTEMS_AND_PRACTITIONERS = 'HEALTH_SYSTEMS_AND_PRACTITIONERS';\n  const HEALTH_TECH = 'HEALTH_TECH';\n  const HOME_AND_FURNITURE_AND_OFFICE = 'HOME_AND_FURNITURE_AND_OFFICE';\n  const HOME_IMPROVEMENT = 'HOME_IMPROVEMENT';\n  const HOME_INSURANCE = 'HOME_INSURANCE';\n  const HOME_TECH = 'HOME_TECH';\n  const HOTEL_AND_ACCOMODATION = 'HOTEL_AND_ACCOMODATION';\n  const HOUSEHOLD_GOODS_DURABLE = 'HOUSEHOLD_GOODS_DURABLE';\n  const HOUSEHOLD_GOODS_NON_DURABLE = 'HOUSEHOLD_GOODS_NON_DURABLE';\n  const HR_AND_FINANCIAL_MANAGEMENT = 'HR_AND_FINANCIAL_MANAGEMENT';\n  const HUMANITARIAN_OR_DISASTER_RELIEF = 'HUMANITARIAN_OR_DISASTER_RELIEF';\n  const INDEPENDENT_EXPENDITURE_GROUP = 'INDEPENDENT_EXPENDITURE_GROUP';\n  const INSURANCE_TECH = 'INSURANCE_TECH';\n  const INTERNATIONAL_ORGANIZATON = 'INTERNATIONAL_ORGANIZATON';\n  const INVESTMENT_BANK_AND_BROKERAGE = 'INVESTMENT_BANK_AND_BROKERAGE';\n  const ISSUE_ADVOCACY = 'ISSUE_ADVOCACY';\n  const LEGAL = 'LEGAL';\n  const LIFE_INSURANCE = 'LIFE_INSURANCE';\n  const LOGISTICS_AND_TRANSPORTATION_AND_FLEET_MANAGEMENT = 'LOGISTICS_AND_TRANSPORTATION_AND_FLEET_MANAGEMENT';\n  const MANUFACTURING = 'MANUFACTURING';\n  const MEDICAL_DEVICES_AND_SUPPLIES_AND_EQUIPMENT = 'MEDICAL_DEVICES_AND_SUPPLIES_AND_EQUIPMENT';\n  const MEDSPA_AND_ELECTIVE_SURGERIES_AND_ALTERNATIVE_MEDICINE = 'MEDSPA_AND_ELECTIVE_SURGERIES_AND_ALTERNATIVE_MEDICINE';\n  const MINING_AND_QUARRYING = 'MINING_AND_QUARRYING';\n  const MOBILE_GAMING = 'MOBILE_GAMING';\n  const MOVIES = 'MOVIES';\n  const MUSEUMS_AND_PARKS_AND_LIBRARIES = 'MUSEUMS_AND_PARKS_AND_LIBRARIES';\n  const MUSIC = 'MUSIC';\n  const NETWORK_SECURITY_PRODUCTS = 'NETWORK_SECURITY_PRODUCTS';\n  const NEWS_AND_CURRENT_EVENTS = 'NEWS_AND_CURRENT_EVENTS';\n  const NON_PRESCRIPTION = 'NON_PRESCRIPTION';\n  const NOT_FOR_PROFIT_COLLEGES_AND_UNIVERSITIES = 'NOT_FOR_PROFIT_COLLEGES_AND_UNIVERSITIES';\n  const OFFICE = 'OFFICE';\n  const OFFICE_OR_BUSINESS_SUPPLIES = 'OFFICE_OR_BUSINESS_SUPPLIES';\n  const OIL_AND_GAS_AND_CONSUMABLE_FUEL = 'OIL_AND_GAS_AND_CONSUMABLE_FUEL';\n  const ONLINE_ONLY_PUBLICATIONS = 'ONLINE_ONLY_PUBLICATIONS';\n  const PACKAGE_OR_FREIGHT_DELIVERY = 'PACKAGE_OR_FREIGHT_DELIVERY';\n  const PARTY_INDEPENDENT_EXPENDITURE_GROUP_US = 'PARTY_INDEPENDENT_EXPENDITURE_GROUP_US';\n  const PAYMENT_PROCESSING_AND_GATEWAY_SOLUTIONS = 'PAYMENT_PROCESSING_AND_GATEWAY_SOLUTIONS';\n  const PC_GAMING = 'PC_GAMING';\n  const PEOPLE = 'PEOPLE';\n  const PERSONAL_CARE = 'PERSONAL_CARE';\n  const PET = 'PET';\n  const PHOTOGRAPHY_AND_FILMING_SERVICES = 'PHOTOGRAPHY_AND_FILMING_SERVICES';\n  const PIZZA = 'PIZZA';\n  const PLANNING_AGENCY = 'PLANNING_AGENCY';\n  const POLITICAL_PARTY_OR_COMMITTEE = 'POLITICAL_PARTY_OR_COMMITTEE';\n  const PRESCRIPTION = 'PRESCRIPTION';\n  const PROFESSIONAL_ASSOCIATIONS = 'PROFESSIONAL_ASSOCIATIONS';\n  const PROPERTY_AND_CASUALTY = 'PROPERTY_AND_CASUALTY';\n  const QUICK_SERVICE = 'QUICK_SERVICE';\n  const RADIO = 'RADIO';\n  const RAILROADS = 'RAILROADS';\n  const REAL_ESTATE = 'REAL_ESTATE';\n  const REAL_MONEY_GAMING = 'REAL_MONEY_GAMING';\n  const RECREATIONAL = 'RECREATIONAL';\n  const RELIGIOUS = 'RELIGIOUS';\n  const RESELLER = 'RESELLER';\n  const RESIDENTIAL_AND_LONG_TERM_CARE_FACILITIES_AND_OUTPATIENT_CARE_CENTERS = 'RESIDENTIAL_AND_LONG_TERM_CARE_FACILITIES_AND_OUTPATIENT_CARE_CENTERS';\n  const RETAIL_AND_CREDIT_UNION_AND_COMMERCIAL_BANK = 'RETAIL_AND_CREDIT_UNION_AND_COMMERCIAL_BANK';\n  const RIDE_SHARING_OR_TAXI_SERVICES = 'RIDE_SHARING_OR_TAXI_SERVICES';\n  const SAFETY_SERVICES = 'SAFETY_SERVICES';\n  const SCHOLARLY = 'SCHOLARLY';\n  const SCHOOL_AND_EARLY_CHILDREN_EDCATION = 'SCHOOL_AND_EARLY_CHILDREN_EDCATION';\n  const SOCIAL_MEDIA = 'SOCIAL_MEDIA';\n  const SOFTWARE_AS_A_SERVICE = 'SOFTWARE_AS_A_SERVICE';\n  const SPORTING = 'SPORTING';\n  const SPORTING_AND_OUTDOOR = 'SPORTING_AND_OUTDOOR';\n  const SPORTS = 'SPORTS';\n  const SUPERSTORES = 'SUPERSTORES';\n  const T1_AUTOMOTIVE_MANUFACTURER = 'T1_AUTOMOTIVE_MANUFACTURER';\n  const T1_MOTORCYCLE = 'T1_MOTORCYCLE';\n  const T2_DEALER_ASSOCIATIONS = 'T2_DEALER_ASSOCIATIONS';\n  const T3_AUTO_AGENCY = 'T3_AUTO_AGENCY';\n  const T3_AUTO_RESELLERS = 'T3_AUTO_RESELLERS';\n  const T3_DEALER_GROUPS = 'T3_DEALER_GROUPS';\n  const T3_FRANCHISE_DEALER = 'T3_FRANCHISE_DEALER';\n  const T3_INDEPENDENT_DEALER = 'T3_INDEPENDENT_DEALER';\n  const T3_PARTS_AND_SERVICES = 'T3_PARTS_AND_SERVICES';\n  const T3_PORTALS = 'T3_PORTALS';\n  const TELECOMMUNICATIONS_EQUIPMENT_AND_ACCESSORIES = 'TELECOMMUNICATIONS_EQUIPMENT_AND_ACCESSORIES';\n  const TELEPHONE_SERVICE_PROVIDERS_AND_CARRIERS = 'TELEPHONE_SERVICE_PROVIDERS_AND_CARRIERS';\n  const TICKETING = 'TICKETING';\n  const TOBACCO = 'TOBACCO';\n  const TOURISM_AND_TRAVEL_SERVICES = 'TOURISM_AND_TRAVEL_SERVICES';\n  const TOURISM_BOARD = 'TOURISM_BOARD';\n  const TOY_AND_HOBBY = 'TOY_AND_HOBBY';\n  const TRADE_SCHOOL = 'TRADE_SCHOOL';\n  const TRAVEL_AGENCIES_AND_GUIDES_AND_OTAS = 'TRAVEL_AGENCIES_AND_GUIDES_AND_OTAS';\n  const UTILITIES_AND_ENERGY_EQUIPMENT_AND_SERVICES = 'UTILITIES_AND_ENERGY_EQUIPMENT_AND_SERVICES';\n  const VETERINARY_CLINICS_AND_SERVICES = 'VETERINARY_CLINICS_AND_SERVICES';\n  const VIDEO_STREAMING = 'VIDEO_STREAMING';\n  const VIRTUAL_SERVICES = 'VIRTUAL_SERVICES';\n  const VITAMINS_OR_WELLNESS = 'VITAMINS_OR_WELLNESS';\n  const WAREHOUSING_AND_STORAGE = 'WAREHOUSING_AND_STORAGE';\n  const WATER_AND_SOFT_DRINK_AND_BAVERAGE = 'WATER_AND_SOFT_DRINK_AND_BAVERAGE';\n  const WEBSITE_DESIGNERS_OR_GRAPHIC_DESIGNERS = 'WEBSITE_DESIGNERS_OR_GRAPHIC_DESIGNERS';\n  const WHOLESALE = 'WHOLESALE';\n  const WIRELESS_SERVICES = 'WIRELESS_SERVICES';\n}\n", "num_lines": 211}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static BusinessSurveyBusinessTypeValues getInstance()\n */\nclass BusinessSurveyBusinessTypeValues extends AbstractEnum {\n\n  const ADVERTISER = 'ADVERTISER';\n  const AGENCY = 'AGENCY';\n  const APP_DEVELOPER = 'APP_DEVELOPER';\n  const PUBLISHER = 'PUBLISHER';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static BusinessTwoFactorTypeValues getInstance()\n */\nclass BusinessTwoFactorTypeValues extends AbstractEnum {\n\n  const ADMIN_REQUIRED = 'admin_required';\n  const ALL_REQUIRED = 'all_required';\n  const NONE = 'none';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static BusinessUserRoleValues getInstance()\n */\nclass BusinessUserRoleValues extends AbstractEnum {\n\n  const ADMIN = 'ADMIN';\n  const ADS_RIGHTS_REVIEWER = 'ADS_RIGHTS_REVIEWER';\n  const VALUE_DEFAULT = 'DEFAULT';\n  const DEVELOPER = 'DEVELOPER';\n  const EMPLOYEE = 'EMPLOYEE';\n  const FINANCE_ANALYST = 'FINANCE_ANALYST';\n  const FINANCE_EDIT = 'FINANCE_EDIT';\n  const FINANCE_EDITOR = 'FINANCE_EDITOR';\n  const FINANCE_VIEW = 'FINANCE_VIEW';\n  const MANAGE = 'MANAGE';\n  const PARTNER_CENTER_ADMIN = 'PARTNER_CENTER_ADMIN';\n  const PARTNER_CENTER_ANALYST = 'PARTNER_CENTER_ANALYST';\n  const PARTNER_CENTER_EDUCATION = 'PARTNER_CENTER_EDUCATION';\n  const PARTNER_CENTER_MARKETING = 'PARTNER_CENTER_MARKETING';\n  const PARTNER_CENTER_OPERATIONS = 'PARTNER_CENTER_OPERATIONS';\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static BusinessVerticalV2Values getInstance()\n */\nclass BusinessVerticalV2Values extends AbstractEnum {\n\n  const ADVERTISING_AND_MARKETING = 'ADVERTISING_AND_MARKETING';\n  const AGRICULTURE = 'AGRICULTURE';\n  const AUTOMOTIVE = 'AUTOMOTIVE';\n  const BANKING_AND_CREDIT_CARDS = 'BANKING_AND_CREDIT_CARDS';\n  const BUSINESS_TO_BUSINESS = 'BUSINESS_TO_BUSINESS';\n  const CONSUMER_PACKAGED_GOODS = 'CONSUMER_PACKAGED_GOODS';\n  const ECOMMERCE = 'ECOMMERCE';\n  const EDUCATION = 'EDUCATION';\n  const ENERGY_AND_NATURAL_RESOURCES_AND_UTILITIES = 'ENERGY_AND_NATURAL_RESOURCES_AND_UTILITIES';\n  const ENTERTAINMENT_AND_MEDIA = 'ENTERTAINMENT_AND_MEDIA';\n  const GAMING = 'GAMING';\n  const GOVERNMENT = 'GOVERNMENT';\n  const HEALTHCARE_AND_PHARMACEUTICALS_AND_BIOTECH = 'HEALTHCARE_AND_PHARMACEUTICALS_AND_BIOTECH';\n  const INSURANCE = 'INSURANCE';\n  const NON_PROFIT = 'NON_PROFIT';\n  const ORGANIZATIONS_AND_ASSOCIATIONS = 'ORGANIZATIONS_AND_ASSOCIATIONS';\n  const POLITICS = 'POLITICS';\n  const PROFESSIONAL_SERVICES = 'PROFESSIONAL_SERVICES';\n  const PUBLISHING = 'PUBLISHING';\n  const RESTAURANTS = 'RESTAURANTS';\n  const RETAIL = 'RETAIL';\n  const TECHNOLOGY = 'TECHNOLOGY';\n  const TELECOM = 'TELECOM';\n  const TRAVEL = 'TRAVEL';\n}\n", "num_lines": 65}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static BusinessVerticalValues getInstance()\n */\nclass BusinessVerticalValues extends AbstractEnum {\n\n  const ADVERTISING = 'ADVERTISING';\n  const AUTOMOTIVE = 'AUTOMOTIVE';\n  const CONSUMER_PACKAGED_GOODS = 'CONSUMER_PACKAGED_GOODS';\n  const ECOMMERCE = 'ECOMMERCE';\n  const EDUCATION = 'EDUCATION';\n  const ENERGY_AND_UTILITIES = 'ENERGY_AND_UTILITIES';\n  const ENTERTAINMENT_AND_MEDIA = 'ENTERTAINMENT_AND_MEDIA';\n  const FINANCIAL_SERVICES = 'FINANCIAL_SERVICES';\n  const GAMING = 'GAMING';\n  const GOVERNMENT_AND_POLITICS = 'GOVERNMENT_AND_POLITICS';\n  const HEALTH = 'HEALTH';\n  const LUXURY = 'LUXURY';\n  const MARKETING = 'MARKETING';\n  const NON_PROFIT = 'NON_PROFIT';\n  const ORGANIZATIONS_AND_ASSOCIATIONS = 'ORGANIZATIONS_AND_ASSOCIATIONS';\n  const OTHER = 'OTHER';\n  const PROFESSIONAL_SERVICES = 'PROFESSIONAL_SERVICES';\n  const RESTAURANT = 'RESTAURANT';\n  const RETAIL = 'RETAIL';\n  const TECHNOLOGY = 'TECHNOLOGY';\n  const TELECOM = 'TELECOM';\n  const TRAVEL = 'TRAVEL';\n}\n", "num_lines": 63}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CampaignBidStrategyValues getInstance()\n */\nclass CampaignBidStrategyValues extends AbstractEnum {\n\n  const COST_CAP = 'COST_CAP';\n  const LOWEST_COST_WITHOUT_CAP = 'LOWEST_COST_WITHOUT_CAP';\n  const LOWEST_COST_WITH_BID_CAP = 'LOWEST_COST_WITH_BID_CAP';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static CampaignBuyingTypeValues getInstance()\n */\nclass CampaignBuyingTypeValues extends AbstractEnum {\n\n  const AUCTION  = 'AUCTION';\n  const RESERVED = 'RESERVED';\n}\n", "num_lines": 37}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CampaignConfiguredStatusValues getInstance()\n */\nclass CampaignConfiguredStatusValues extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const ARCHIVED = 'ARCHIVED';\n  const DELETED = 'DELETED';\n  const PAUSED = 'PAUSED';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CampaignDatePresetValues getInstance()\n */\nclass CampaignDatePresetValues extends AbstractEnum {\n\n  const DATA_MAXIMUM = 'data_maximum';\n  const LAST_14D = 'last_14d';\n  const LAST_28D = 'last_28d';\n  const LAST_30D = 'last_30d';\n  const LAST_3D = 'last_3d';\n  const LAST_7D = 'last_7d';\n  const LAST_90D = 'last_90d';\n  const LAST_MONTH = 'last_month';\n  const LAST_QUARTER = 'last_quarter';\n  const LAST_WEEK_MON_SUN = 'last_week_mon_sun';\n  const LAST_WEEK_SUN_SAT = 'last_week_sun_sat';\n  const LAST_YEAR = 'last_year';\n  const MAXIMUM = 'maximum';\n  const THIS_MONTH = 'this_month';\n  const THIS_QUARTER = 'this_quarter';\n  const THIS_WEEK_MON_TODAY = 'this_week_mon_today';\n  const THIS_WEEK_SUN_TODAY = 'this_week_sun_today';\n  const THIS_YEAR = 'this_year';\n  const TODAY = 'today';\n  const YESTERDAY = 'yesterday';\n}\n", "num_lines": 61}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CampaignEffectiveStatusValues getInstance()\n */\nclass CampaignEffectiveStatusValues extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const ARCHIVED = 'ARCHIVED';\n  const DELETED = 'DELETED';\n  const IN_PROCESS = 'IN_PROCESS';\n  const PAUSED = 'PAUSED';\n  const WITH_ISSUES = 'WITH_ISSUES';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CampaignExecutionOptionsValues getInstance()\n */\nclass CampaignExecutionOptionsValues extends AbstractEnum {\n\n  const INCLUDE_RECOMMENDATIONS = 'include_recommendations';\n  const VALIDATE_ONLY = 'validate_only';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CampaignObjectiveValues getInstance()\n */\nclass CampaignObjectiveValues extends AbstractEnum {\n\n  const APP_INSTALLS = 'APP_INSTALLS';\n  const BRAND_AWARENESS = 'BRAND_AWARENESS';\n  const CONVERSIONS = 'CONVERSIONS';\n  const EVENT_RESPONSES = 'EVENT_RESPONSES';\n  const LEAD_GENERATION = 'LEAD_GENERATION';\n  const LINK_CLICKS = 'LINK_CLICKS';\n  const LOCAL_AWARENESS = 'LOCAL_AWARENESS';\n  const MESSAGES = 'MESSAGES';\n  const OFFER_CLAIMS = 'OFFER_CLAIMS';\n  const OUTCOME_APP_PROMOTION = 'OUTCOME_APP_PROMOTION';\n  const OUTCOME_AWARENESS = 'OUTCOME_AWARENESS';\n  const OUTCOME_ENGAGEMENT = 'OUTCOME_ENGAGEMENT';\n  const OUTCOME_LEADS = 'OUTCOME_LEADS';\n  const OUTCOME_SALES = 'OUTCOME_SALES';\n  const OUTCOME_TRAFFIC = 'OUTCOME_TRAFFIC';\n  const PAGE_LIKES = 'PAGE_LIKES';\n  const POST_ENGAGEMENT = 'POST_ENGAGEMENT';\n  const PRODUCT_CATALOG_SALES = 'PRODUCT_CATALOG_SALES';\n  const REACH = 'REACH';\n  const STORE_VISITS = 'STORE_VISITS';\n  const VIDEO_VIEWS = 'VIDEO_VIEWS';\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CampaignOperatorValues getInstance()\n */\nclass CampaignOperatorValues extends AbstractEnum {\n\n  const ALL = 'ALL';\n  const ANY = 'ANY';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CampaignSmartPromotionTypeValues getInstance()\n */\nclass CampaignSmartPromotionTypeValues extends AbstractEnum {\n\n  const GUIDED_CREATION = 'GUIDED_CREATION';\n  const SMART_APP_PROMOTION = 'SMART_APP_PROMOTION';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CampaignSpecialAdCategoriesValues getInstance()\n */\nclass CampaignSpecialAdCategoriesValues extends AbstractEnum {\n\n  const CREDIT = 'CREDIT';\n  const EMPLOYMENT = 'EMPLOYMENT';\n  const HOUSING = 'HOUSING';\n  const ISSUES_ELECTIONS_POLITICS = 'ISSUES_ELECTIONS_POLITICS';\n  const NONE = 'NONE';\n  const ONLINE_GAMBLING_AND_GAMING = 'ONLINE_GAMBLING_AND_GAMING';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CampaignSpecialAdCategoryCountryValues getInstance()\n */\nclass CampaignSpecialAdCategoryCountryValues extends AbstractEnum {\n\n  const AD = 'AD';\n  const AE = 'AE';\n  const AF = 'AF';\n  const AG = 'AG';\n  const AI = 'AI';\n  const AL = 'AL';\n  const AM = 'AM';\n  const AN = 'AN';\n  const AO = 'AO';\n  const AQ = 'AQ';\n  const AR = 'AR';\n  const VALUE_AS = 'AS';\n  const AT = 'AT';\n  const AU = 'AU';\n  const AW = 'AW';\n  const AX = 'AX';\n  const AZ = 'AZ';\n  const BA = 'BA';\n  const BB = 'BB';\n  const BD = 'BD';\n  const BE = 'BE';\n  const BF = 'BF';\n  const BG = 'BG';\n  const BH = 'BH';\n  const BI = 'BI';\n  const BJ = 'BJ';\n  const BL = 'BL';\n  const BM = 'BM';\n  const BN = 'BN';\n  const BO = 'BO';\n  const BQ = 'BQ';\n  const BR = 'BR';\n  const BS = 'BS';\n  const BT = 'BT';\n  const BV = 'BV';\n  const BW = 'BW';\n  const BY = 'BY';\n  const BZ = 'BZ';\n  const CA = 'CA';\n  const CC = 'CC';\n  const CD = 'CD';\n  const CF = 'CF';\n  const CG = 'CG';\n  const CH = 'CH';\n  const CI = 'CI';\n  const CK = 'CK';\n  const CL = 'CL';\n  const CM = 'CM';\n  const CN = 'CN';\n  const CO = 'CO';\n  const CR = 'CR';\n  const CU = 'CU';\n  const CV = 'CV';\n  const CW = 'CW';\n  const CX = 'CX';\n  const CY = 'CY';\n  const CZ = 'CZ';\n  const DE = 'DE';\n  const DJ = 'DJ';\n  const DK = 'DK';\n  const DM = 'DM';\n  const VALUE_DO = 'DO';\n  const DZ = 'DZ';\n  const EC = 'EC';\n  const EE = 'EE';\n  const EG = 'EG';\n  const EH = 'EH';\n  const ER = 'ER';\n  const ES = 'ES';\n  const ET = 'ET';\n  const FI = 'FI';\n  const FJ = 'FJ';\n  const FK = 'FK';\n  const FM = 'FM';\n  const FO = 'FO';\n  const FR = 'FR';\n  const GA = 'GA';\n  const GB = 'GB';\n  const GD = 'GD';\n  const GE = 'GE';\n  const GF = 'GF';\n  const GG = 'GG';\n  const GH = 'GH';\n  const GI = 'GI';\n  const GL = 'GL';\n  const GM = 'GM';\n  const GN = 'GN';\n  const GP = 'GP';\n  const GQ = 'GQ';\n  const GR = 'GR';\n  const GS = 'GS';\n  const GT = 'GT';\n  const GU = 'GU';\n  const GW = 'GW';\n  const GY = 'GY';\n  const HK = 'HK';\n  const HM = 'HM';\n  const HN = 'HN';\n  const HR = 'HR';\n  const HT = 'HT';\n  const HU = 'HU';\n  const ID = 'ID';\n  const IE = 'IE';\n  const IL = 'IL';\n  const IM = 'IM';\n  const IN = 'IN';\n  const IO = 'IO';\n  const IQ = 'IQ';\n  const IR = 'IR';\n  const IS = 'IS';\n  const IT = 'IT';\n  const JE = 'JE';\n  const JM = 'JM';\n  const JO = 'JO';\n  const JP = 'JP';\n  const KE = 'KE';\n  const KG = 'KG';\n  const KH = 'KH';\n  const KI = 'KI';\n  const KM = 'KM';\n  const KN = 'KN';\n  const KP = 'KP';\n  const KR = 'KR';\n  const KW = 'KW';\n  const KY = 'KY';\n  const KZ = 'KZ';\n  const LA = 'LA';\n  const LB = 'LB';\n  const LC = 'LC';\n  const LI = 'LI';\n  const LK = 'LK';\n  const LR = 'LR';\n  const LS = 'LS';\n  const LT = 'LT';\n  const LU = 'LU';\n  const LV = 'LV';\n  const LY = 'LY';\n  const MA = 'MA';\n  const MC = 'MC';\n  const MD = 'MD';\n  const ME = 'ME';\n  const MF = 'MF';\n  const MG = 'MG';\n  const MH = 'MH';\n  const MK = 'MK';\n  const ML = 'ML';\n  const MM = 'MM';\n  const MN = 'MN';\n  const MO = 'MO';\n  const MP = 'MP';\n  const MQ = 'MQ';\n  const MR = 'MR';\n  const MS = 'MS';\n  const MT = 'MT';\n  const MU = 'MU';\n  const MV = 'MV';\n  const MW = 'MW';\n  const MX = 'MX';\n  const MY = 'MY';\n  const MZ = 'MZ';\n  const NA = 'NA';\n  const NC = 'NC';\n  const NE = 'NE';\n  const NF = 'NF';\n  const NG = 'NG';\n  const NI = 'NI';\n  const NL = 'NL';\n  const NO = 'NO';\n  const NP = 'NP';\n  const NR = 'NR';\n  const NU = 'NU';\n  const NZ = 'NZ';\n  const OM = 'OM';\n  const PA = 'PA';\n  const PE = 'PE';\n  const PF = 'PF';\n  const PG = 'PG';\n  const PH = 'PH';\n  const PK = 'PK';\n  const PL = 'PL';\n  const PM = 'PM';\n  const PN = 'PN';\n  const PR = 'PR';\n  const PS = 'PS';\n  const PT = 'PT';\n  const PW = 'PW';\n  const PY = 'PY';\n  const QA = 'QA';\n  const RE = 'RE';\n  const RO = 'RO';\n  const RS = 'RS';\n  const RU = 'RU';\n  const RW = 'RW';\n  const SA = 'SA';\n  const SB = 'SB';\n  const SC = 'SC';\n  const SD = 'SD';\n  const SE = 'SE';\n  const SG = 'SG';\n  const SH = 'SH';\n  const SI = 'SI';\n  const SJ = 'SJ';\n  const SK = 'SK';\n  const SL = 'SL';\n  const SM = 'SM';\n  const SN = 'SN';\n  const SO = 'SO';\n  const SR = 'SR';\n  const SS = 'SS';\n  const ST = 'ST';\n  const SV = 'SV';\n  const SX = 'SX';\n  const SY = 'SY';\n  const SZ = 'SZ';\n  const TC = 'TC';\n  const TD = 'TD';\n  const TF = 'TF';\n  const TG = 'TG';\n  const TH = 'TH';\n  const TJ = 'TJ';\n  const TK = 'TK';\n  const TL = 'TL';\n  const TM = 'TM';\n  const TN = 'TN';\n  const TO = 'TO';\n  const TR = 'TR';\n  const TT = 'TT';\n  const TV = 'TV';\n  const TW = 'TW';\n  const TZ = 'TZ';\n  const UA = 'UA';\n  const UG = 'UG';\n  const UM = 'UM';\n  const US = 'US';\n  const UY = 'UY';\n  const UZ = 'UZ';\n  const VA = 'VA';\n  const VC = 'VC';\n  const VE = 'VE';\n  const VG = 'VG';\n  const VI = 'VI';\n  const VN = 'VN';\n  const VU = 'VU';\n  const WF = 'WF';\n  const WS = 'WS';\n  const XK = 'XK';\n  const YE = 'YE';\n  const YT = 'YT';\n  const ZA = 'ZA';\n  const ZM = 'ZM';\n  const ZW = 'ZW';\n}\n", "num_lines": 292}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CampaignSpecialAdCategoryValues getInstance()\n */\nclass CampaignSpecialAdCategoryValues extends AbstractEnum {\n\n  const CREDIT = 'CREDIT';\n  const EMPLOYMENT = 'EMPLOYMENT';\n  const HOUSING = 'HOUSING';\n  const ISSUES_ELECTIONS_POLITICS = 'ISSUES_ELECTIONS_POLITICS';\n  const NONE = 'NONE';\n  const ONLINE_GAMBLING_AND_GAMING = 'ONLINE_GAMBLING_AND_GAMING';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CampaignStatusOptionValues getInstance()\n */\nclass CampaignStatusOptionValues extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const INHERITED_FROM_SOURCE = 'INHERITED_FROM_SOURCE';\n  const PAUSED = 'PAUSED';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CampaignStatusValues getInstance()\n */\nclass CampaignStatusValues extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const ARCHIVED = 'ARCHIVED';\n  const DELETED = 'DELETED';\n  const PAUSED = 'PAUSED';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CatalogItemAppealStatusStatusValues getInstance()\n */\nclass CatalogItemAppealStatusStatusValues extends AbstractEnum {\n\n  const THIS_ITEM_CANNOT_BE_APPEALED_AS_IT_IS_EITHER_APPROVED_OR_ALREADY_HAS_AN_APPEAL = 'This item cannot be appealed as it is either approved or already has an appeal';\n  const THIS_ITEM_IS_NOT_REJECTED_FOR_ANY_OF_CHANNELS = 'This item is not rejected for any of channels';\n  const WEVE_ENCOUNTERED_UNEXPECTED_ERROR_WHILE_PROCESSING_THIS_REQUEST_PLEASE_TRY_AGAIN_LATER_ = 'Weve encountered unexpected error while processing this request. Please try again later !';\n  const YOUVE_REACHED_THE_MAXIMUM_NUMBER_OF_ITEM_REQUESTS_YOU_CAN_MAKE_THIS_WEEK_YOULL_BE_ABLE_TO_REQUEST_ITEM_REVIEWS_AGAIN_WITHIN_THE_NEXT_7_DAYS_ = 'Youve reached the maximum number of item requests you can make this week. Youll be able to request item reviews again within the next 7 days.';\n  const YOUR_REQUEST_WAS_RECEIVED_SEE_INFORMATION_BELOW_TO_LEARN_MORE_ = 'Your request was received. See information below to learn more.';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CheckBatchRequestStatusErrorPriorityValues getInstance()\n */\nclass CheckBatchRequestStatusErrorPriorityValues extends AbstractEnum {\n\n  const HIGH = 'HIGH';\n  const LOW = 'LOW';\n  const MEDIUM = 'MEDIUM';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CommentCommentPrivacyValueValues getInstance()\n */\nclass CommentCommentPrivacyValueValues extends AbstractEnum {\n\n  const DECLINED_BY_ADMIN_ASSISTANT = 'DECLINED_BY_ADMIN_ASSISTANT';\n  const DEFAULT_PRIVACY = 'DEFAULT_PRIVACY';\n  const FRIENDS_AND_POST_OWNER = 'FRIENDS_AND_POST_OWNER';\n  const FRIENDS_ONLY = 'FRIENDS_ONLY';\n  const GRAPHQL_MULTIPLE_VALUE_HACK_DO_NOT_USE = 'GRAPHQL_MULTIPLE_VALUE_HACK_DO_NOT_USE';\n  const OWNER_OR_COMMENTER = 'OWNER_OR_COMMENTER';\n  const PENDING_APPROVAL = 'PENDING_APPROVAL';\n  const REMOVED_BY_ADMIN_ASSISTANT = 'REMOVED_BY_ADMIN_ASSISTANT';\n  const SIDE_CONVERSATION = 'SIDE_CONVERSATION';\n  const SIDE_CONVERSATION_AND_POST_OWNER = 'SIDE_CONVERSATION_AND_POST_OWNER';\n  const SPOTLIGHT_TAB = 'SPOTLIGHT_TAB';\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CommentFilterValues getInstance()\n */\nclass CommentFilterValues extends AbstractEnum {\n\n  const STREAM = 'stream';\n  const TOPLEVEL = 'toplevel';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CommentLiveFilterValues getInstance()\n */\nclass CommentLiveFilterValues extends AbstractEnum {\n\n  const FILTER_LOW_QUALITY = 'filter_low_quality';\n  const NO_FILTER = 'no_filter';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CommentOrderValues getInstance()\n */\nclass CommentOrderValues extends AbstractEnum {\n\n  const CHRONOLOGICAL = 'chronological';\n  const REVERSE_CHRONOLOGICAL = 'reverse_chronological';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CommerceOrderFiltersValues getInstance()\n */\nclass CommerceOrderFiltersValues extends AbstractEnum {\n\n  const HAS_CANCELLATIONS = 'HAS_CANCELLATIONS';\n  const HAS_FULFILLMENTS = 'HAS_FULFILLMENTS';\n  const HAS_REFUNDS = 'HAS_REFUNDS';\n  const NO_CANCELLATIONS = 'NO_CANCELLATIONS';\n  const NO_REFUNDS = 'NO_REFUNDS';\n  const NO_SHIPMENTS = 'NO_SHIPMENTS';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CommerceOrderReasonCodeValues getInstance()\n */\nclass CommerceOrderReasonCodeValues extends AbstractEnum {\n\n  const BUYERS_REMORSE = 'BUYERS_REMORSE';\n  const DAMAGED_GOODS = 'DAMAGED_GOODS';\n  const FACEBOOK_INITIATED = 'FACEBOOK_INITIATED';\n  const NOT_AS_DESCRIBED = 'NOT_AS_DESCRIBED';\n  const QUALITY_ISSUE = 'QUALITY_ISSUE';\n  const REFUND_COMPROMISED = 'REFUND_COMPROMISED';\n  const REFUND_FOR_RETURN = 'REFUND_FOR_RETURN';\n  const REFUND_REASON_OTHER = 'REFUND_REASON_OTHER';\n  const REFUND_SFI_FAKE = 'REFUND_SFI_FAKE';\n  const REFUND_SFI_REAL = 'REFUND_SFI_REAL';\n  const WRONG_ITEM = 'WRONG_ITEM';\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CommerceOrderStateValues getInstance()\n */\nclass CommerceOrderStateValues extends AbstractEnum {\n\n  const COMPLETED = 'COMPLETED';\n  const CREATED = 'CREATED';\n  const FB_PROCESSING = 'FB_PROCESSING';\n  const IN_PROGRESS = 'IN_PROGRESS';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static ConnectionObjectTypes getInstance()\n */\nclass ConnectionObjectTypes extends AbstractEnum {\n\n  const PAGE = 1;\n  const APPLICATION = 2;\n  const EVENT = 3;\n  const PLACE = 6;\n  const DOMAIN = 7;\n}\n", "num_lines": 40}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CPASCollaborationRequestRequesterAgencyOrBrandValues getInstance()\n */\nclass CPASCollaborationRequestRequesterAgencyOrBrandValues extends AbstractEnum {\n\n  const AGENCY = 'AGENCY';\n  const BRAND = 'BRAND';\n  const MERCHANT = 'MERCHANT';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CustomAudienceActionSourceValues getInstance()\n */\nclass CustomAudienceActionSourceValues extends AbstractEnum {\n\n  const PHYSICAL_STORE = 'PHYSICAL_STORE';\n  const WEBSITE = 'WEBSITE';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CustomAudienceClaimObjectiveValues getInstance()\n */\nclass CustomAudienceClaimObjectiveValues extends AbstractEnum {\n\n  const AUTOMOTIVE_MODEL = 'AUTOMOTIVE_MODEL';\n  const COLLABORATIVE_ADS = 'COLLABORATIVE_ADS';\n  const HOME_LISTING = 'HOME_LISTING';\n  const MEDIA_TITLE = 'MEDIA_TITLE';\n  const PRODUCT = 'PRODUCT';\n  const TRAVEL = 'TRAVEL';\n  const VEHICLE = 'VEHICLE';\n  const VEHICLE_OFFER = 'VEHICLE_OFFER';\n}\n", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CustomAudienceContentTypeValues getInstance()\n */\nclass CustomAudienceContentTypeValues extends AbstractEnum {\n\n  const AUTOMOTIVE_MODEL = 'AUTOMOTIVE_MODEL';\n  const DESTINATION = 'DESTINATION';\n  const FLIGHT = 'FLIGHT';\n  const HOME_LISTING = 'HOME_LISTING';\n  const HOTEL = 'HOTEL';\n  const JOB = 'JOB';\n  const LOCAL_SERVICE_BUSINESS = 'LOCAL_SERVICE_BUSINESS';\n  const LOCATION_BASED_ITEM = 'LOCATION_BASED_ITEM';\n  const MEDIA_TITLE = 'MEDIA_TITLE';\n  const OFFLINE_PRODUCT = 'OFFLINE_PRODUCT';\n  const PRODUCT = 'PRODUCT';\n  const VEHICLE = 'VEHICLE';\n  const VEHICLE_OFFER = 'VEHICLE_OFFER';\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CustomAudienceCustomerFileSourceValues getInstance()\n */\nclass CustomAudienceCustomerFileSourceValues extends AbstractEnum {\n\n  const BOTH_USER_AND_PARTNER_PROVIDED = 'BOTH_USER_AND_PARTNER_PROVIDED';\n  const PARTNER_PROVIDED_ONLY = 'PARTNER_PROVIDED_ONLY';\n  const USER_PROVIDED_ONLY = 'USER_PROVIDED_ONLY';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CustomAudienceDataSourceSubTypeValues getInstance()\n */\nclass CustomAudienceDataSourceSubTypeValues extends AbstractEnum {\n\n  const ANYTHING = 'ANYTHING';\n  const APP_USERS = 'APP_USERS';\n  const AR_EFFECTS_EVENTS = 'AR_EFFECTS_EVENTS';\n  const AR_EXPERIENCE_EVENTS = 'AR_EXPERIENCE_EVENTS';\n  const CAMPAIGN_CONVERSIONS = 'CAMPAIGN_CONVERSIONS';\n  const COMBINATION_CUSTOM_AUDIENCE_USERS = 'COMBINATION_CUSTOM_AUDIENCE_USERS';\n  const CONSTANT_CONTACTS_EMAIL_HASHES = 'CONSTANT_CONTACTS_EMAIL_HASHES';\n  const CONTACT_IMPORTER = 'CONTACT_IMPORTER';\n  const CONVERSION_PIXEL_HITS = 'CONVERSION_PIXEL_HITS';\n  const COPY_PASTE_EMAIL_HASHES = 'COPY_PASTE_EMAIL_HASHES';\n  const CUSTOM_AUDIENCE_USERS = 'CUSTOM_AUDIENCE_USERS';\n  const CUSTOM_DATA_TARGETING = 'CUSTOM_DATA_TARGETING';\n  const DATA_FILE = 'DATA_FILE';\n  const DYNAMIC_RULE = 'DYNAMIC_RULE';\n  const ENGAGEMENT_EVENT_USERS = 'ENGAGEMENT_EVENT_USERS';\n  const EXPANDED_AUDIENCE = 'EXPANDED_AUDIENCE';\n  const EXTERNAL_IDS = 'EXTERNAL_IDS';\n  const EXTERNAL_IDS_MIX = 'EXTERNAL_IDS_MIX';\n  const FACEBOOK_WIFI_EVENTS = 'FACEBOOK_WIFI_EVENTS';\n  const FB_EVENT_SIGNALS = 'FB_EVENT_SIGNALS';\n  const FB_PIXEL_HITS = 'FB_PIXEL_HITS';\n  const HASHES = 'HASHES';\n  const HASHES_OR_USER_IDS = 'HASHES_OR_USER_IDS';\n  const HOUSEHOLD_EXPANSION = 'HOUSEHOLD_EXPANSION';\n  const IG_BUSINESS_EVENTS = 'IG_BUSINESS_EVENTS';\n  const IG_PROMOTED_POST = 'IG_PROMOTED_POST';\n  const INSTANT_ARTICLE_EVENTS = 'INSTANT_ARTICLE_EVENTS';\n  const LOOKALIKE_PLATFORM = 'LOOKALIKE_PLATFORM';\n  const MAIL_CHIMP_EMAIL_HASHES = 'MAIL_CHIMP_EMAIL_HASHES';\n  const MOBILE_ADVERTISER_IDS = 'MOBILE_ADVERTISER_IDS';\n  const MOBILE_APP_COMBINATION_EVENTS = 'MOBILE_APP_COMBINATION_EVENTS';\n  const MOBILE_APP_CUSTOM_AUDIENCE_USERS = 'MOBILE_APP_CUSTOM_AUDIENCE_USERS';\n  const MOBILE_APP_EVENTS = 'MOBILE_APP_EVENTS';\n  const MULTICOUNTRY_COMBINATION = 'MULTICOUNTRY_COMBINATION';\n  const MULTI_DATA_EVENTS = 'MULTI_DATA_EVENTS';\n  const MULTI_EVENT_SOURCE = 'MULTI_EVENT_SOURCE';\n  const MULTI_HASHES = 'MULTI_HASHES';\n  const NOTHING = 'NOTHING';\n  const OFFLINE_EVENT_USERS = 'OFFLINE_EVENT_USERS';\n  const PAGE_FANS = 'PAGE_FANS';\n  const PAGE_SMART_AUDIENCE = 'PAGE_SMART_AUDIENCE';\n  const PARTNER_CATEGORY_USERS = 'PARTNER_CATEGORY_USERS';\n  const PLACE_VISITS = 'PLACE_VISITS';\n  const PLATFORM = 'PLATFORM';\n  const PLATFORM_USERS = 'PLATFORM_USERS';\n  const SEED_LIST = 'SEED_LIST';\n  const SIGNAL_SOURCE = 'SIGNAL_SOURCE';\n  const SMART_AUDIENCE = 'SMART_AUDIENCE';\n  const STORE_VISIT_EVENTS = 'STORE_VISIT_EVENTS';\n  const SUBSCRIBER_LIST = 'SUBSCRIBER_LIST';\n  const S_EXPR = 'S_EXPR';\n  const TOKENS = 'TOKENS';\n  const USER_IDS = 'USER_IDS';\n  const VIDEO_EVENTS = 'VIDEO_EVENTS';\n  const VIDEO_EVENT_USERS = 'VIDEO_EVENT_USERS';\n  const WEB_PIXEL_COMBINATION_EVENTS = 'WEB_PIXEL_COMBINATION_EVENTS';\n  const WEB_PIXEL_HITS = 'WEB_PIXEL_HITS';\n  const WEB_PIXEL_HITS_CUSTOM_AUDIENCE_USERS = 'WEB_PIXEL_HITS_CUSTOM_AUDIENCE_USERS';\n}\n", "num_lines": 99}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CustomAudienceDataSourceTypeValues getInstance()\n */\nclass CustomAudienceDataSourceTypeValues extends AbstractEnum {\n\n  const CONTACT_IMPORTER = 'CONTACT_IMPORTER';\n  const COPY_PASTE = 'COPY_PASTE';\n  const EVENT_BASED = 'EVENT_BASED';\n  const FILE_IMPORTED = 'FILE_IMPORTED';\n  const HOUSEHOLD_AUDIENCE = 'HOUSEHOLD_AUDIENCE';\n  const SEED_BASED = 'SEED_BASED';\n  const THIRD_PARTY_IMPORTED = 'THIRD_PARTY_IMPORTED';\n  const UNKNOWN = 'UNKNOWN';\n}\n", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static CustomAudienceSubtypes getInstance()\n */\nclass CustomAudienceSubtypes extends AbstractEnum {\n\n  const APP = 'APP';\n  const APP_COMBINATION = 'APP_COMBINATION';\n  const CUSTOM = 'CUSTOM';\n  const LOOKALIKE = 'LOOKALIKE';\n  const MANAGED = 'MANAGED';\n  const PARTNER = 'PARTNER';\n  const VIDEO = 'VIDEO';\n  const WEBSITE = 'WEBSITE';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CustomAudienceSubtypeValues getInstance()\n */\nclass CustomAudienceSubtypeValues extends AbstractEnum {\n\n  const APP = 'APP';\n  const BAG_OF_ACCOUNTS = 'BAG_OF_ACCOUNTS';\n  const BIDDING = 'BIDDING';\n  const CLAIM = 'CLAIM';\n  const CUSTOM = 'CUSTOM';\n  const ENGAGEMENT = 'ENGAGEMENT';\n  const FOX = 'FOX';\n  const LOOKALIKE = 'LOOKALIKE';\n  const MANAGED = 'MANAGED';\n  const MEASUREMENT = 'MEASUREMENT';\n  const OFFLINE_CONVERSION = 'OFFLINE_CONVERSION';\n  const PARTNER = 'PARTNER';\n  const PRIMARY = 'PRIMARY';\n  const REGULATED_CATEGORIES_AUDIENCE = 'REGULATED_CATEGORIES_AUDIENCE';\n  const STUDY_RULE_AUDIENCE = 'STUDY_RULE_AUDIENCE';\n  const VIDEO = 'VIDEO';\n  const WEBSITE = 'WEBSITE';\n}\n", "num_lines": 58}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static CustomAudienceTypes getInstance()\n */\nclass CustomAudienceTypes extends AbstractEnum {\n\n  /**\n   * @var string\n   */\n  const ID = 'UID';\n\n  /**\n   * @var string\n   */\n  const CLAIM = 'CLAIM';\n\n  /**\n   * @var string\n   */\n  const EMAIL = 'EMAIL_SHA256';\n\n  /**\n   * @var string\n   */\n  const PHONE = 'PHONE_SHA256';\n\n  /**\n   * @var string\n   */\n  const MOBILE_ADVERTISER_ID = 'MOBILE_ADVERTISER_ID';\n}\n", "num_lines": 59}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CustomConversionCustomEventTypeValues getInstance()\n */\nclass CustomConversionCustomEventTypeValues extends AbstractEnum {\n\n  const ADD_PAYMENT_INFO = 'ADD_PAYMENT_INFO';\n  const ADD_TO_CART = 'ADD_TO_CART';\n  const ADD_TO_WISHLIST = 'ADD_TO_WISHLIST';\n  const COMPLETE_REGISTRATION = 'COMPLETE_REGISTRATION';\n  const CONTACT = 'CONTACT';\n  const CONTENT_VIEW = 'CONTENT_VIEW';\n  const CUSTOMIZE_PRODUCT = 'CUSTOMIZE_PRODUCT';\n  const DONATE = 'DONATE';\n  const FACEBOOK_SELECTED = 'FACEBOOK_SELECTED';\n  const FIND_LOCATION = 'FIND_LOCATION';\n  const INITIATED_CHECKOUT = 'INITIATED_CHECKOUT';\n  const LEAD = 'LEAD';\n  const LISTING_INTERACTION = 'LISTING_INTERACTION';\n  const OTHER = 'OTHER';\n  const PURCHASE = 'PURCHASE';\n  const SCHEDULE = 'SCHEDULE';\n  const SEARCH = 'SEARCH';\n  const START_TRIAL = 'START_TRIAL';\n  const SUBMIT_APPLICATION = 'SUBMIT_APPLICATION';\n  const SUBSCRIBE = 'SUBSCRIBE';\n}\n", "num_lines": 61}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static CustomConversionStatsResultAggregationValues getInstance()\n */\nclass CustomConversionStatsResultAggregationValues extends AbstractEnum {\n\n  const COUNT = 'count';\n  const DEVICE_TYPE = 'device_type';\n  const HOST = 'host';\n  const PIXEL_FIRE = 'pixel_fire';\n  const UNMATCHED_COUNT = 'unmatched_count';\n  const UNMATCHED_USD_AMOUNT = 'unmatched_usd_amount';\n  const URL = 'url';\n  const USD_AMOUNT = 'usd_amount';\n}\n", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static DACheckConnectionMethodValues getInstance()\n */\nclass DACheckConnectionMethodValues extends AbstractEnum {\n\n  const ALL = 'ALL';\n  const APP = 'APP';\n  const BROWSER = 'BROWSER';\n  const SERVER = 'SERVER';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static DestinationImageFetchStatusValues getInstance()\n */\nclass DestinationImageFetchStatusValues extends AbstractEnum {\n\n  const DIRECT_UPLOAD = 'DIRECT_UPLOAD';\n  const FETCHED = 'FETCHED';\n  const FETCH_FAILED = 'FETCH_FAILED';\n  const NO_STATUS = 'NO_STATUS';\n  const OUTDATED = 'OUTDATED';\n  const PARTIAL_FETCH = 'PARTIAL_FETCH';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static DestinationVisibilityValues getInstance()\n */\nclass DestinationVisibilityValues extends AbstractEnum {\n\n  const PUBLISHED = 'PUBLISHED';\n  const STAGING = 'STAGING';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static EntityAtTextRangeTypeValues getInstance()\n */\nclass EntityAtTextRangeTypeValues extends AbstractEnum {\n\n  const APPLICATION = 'application';\n  const EVENT = 'event';\n  const GROUP = 'group';\n  const PAGE = 'page';\n  const USER = 'user';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static EventCategoryValues getInstance()\n */\nclass EventCategoryValues extends AbstractEnum {\n\n  const CLASSIC_LITERATURE = 'CLASSIC_LITERATURE';\n  const COMEDY = 'COMEDY';\n  const CRAFTS = 'CRAFTS';\n  const DANCE = 'DANCE';\n  const DRINKS = 'DRINKS';\n  const FITNESS_AND_WORKOUTS = 'FITNESS_AND_WORKOUTS';\n  const FOODS = 'FOODS';\n  const GAMES = 'GAMES';\n  const GARDENING = 'GARDENING';\n  const HEALTHY_LIVING_AND_SELF_CARE = 'HEALTHY_LIVING_AND_SELF_CARE';\n  const HEALTH_AND_MEDICAL = 'HEALTH_AND_MEDICAL';\n  const HOME_AND_GARDEN = 'HOME_AND_GARDEN';\n  const MUSIC_AND_AUDIO = 'MUSIC_AND_AUDIO';\n  const PARTIES = 'PARTIES';\n  const PROFESSIONAL_NETWORKING = 'PROFESSIONAL_NETWORKING';\n  const RELIGIONS = 'RELIGIONS';\n  const SHOPPING_EVENT = 'SHOPPING_EVENT';\n  const SOCIAL_ISSUES = 'SOCIAL_ISSUES';\n  const SPORTS = 'SPORTS';\n  const THEATER = 'THEATER';\n  const TV_AND_MOVIES = 'TV_AND_MOVIES';\n  const VISUAL_ARTS = 'VISUAL_ARTS';\n}\n", "num_lines": 63}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static EventEventStateFilterValues getInstance()\n */\nclass EventEventStateFilterValues extends AbstractEnum {\n\n  const CANCELED = 'canceled';\n  const DRAFT = 'draft';\n  const PUBLISHED = 'published';\n  const SCHEDULED_DRAFT_FOR_PUBLICATION = 'scheduled_draft_for_publication';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static EventOnlineEventFormatValues getInstance()\n */\nclass EventOnlineEventFormatValues extends AbstractEnum {\n\n  const FB_LIVE = 'fb_live';\n  const MESSENGER_ROOM = 'messenger_room';\n  const NONE = 'none';\n  const OTHER = 'other';\n  const THIRD_PARTY = 'third_party';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static EventTimeFilterValues getInstance()\n */\nclass EventTimeFilterValues extends AbstractEnum {\n\n  const PAST = 'past';\n  const UPCOMING = 'upcoming';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static EventTypeValues getInstance()\n */\nclass EventTypeValues extends AbstractEnum {\n\n  const COMMUNITY = 'community';\n  const FRIENDS = 'friends';\n  const GROUP = 'group';\n  const VALUE_PRIVATE = 'private';\n  const VALUE_PUBLIC = 'public';\n  const WORK_COMPANY = 'work_company';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ExtendedCreditAllocationConfigLiabilityTypeValues getInstance()\n */\nclass ExtendedCreditAllocationConfigLiabilityTypeValues extends AbstractEnum {\n\n  const MSA = 'MSA';\n  const NORMAL = 'Normal';\n  const SEQUENTIAL = 'Sequential';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ExtendedCreditAllocationConfigPartitionTypeValues getInstance()\n */\nclass ExtendedCreditAllocationConfigPartitionTypeValues extends AbstractEnum {\n\n  const AUTH = 'AUTH';\n  const FIXED = 'FIXED';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ExtendedCreditAllocationConfigSendBillToValues getInstance()\n */\nclass ExtendedCreditAllocationConfigSendBillToValues extends AbstractEnum {\n\n  const ADVERTISER = 'Advertiser';\n  const AGENCY = 'Agency';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static FeedEncoding getInstance()\n */\nclass FeedEncoding extends AbstractEnum {\n\n  const AUTODETECT  = 'AUTODETECT';\n  const ASCII = 'ASCII';\n  const UTF_8 = 'UTF_8';\n  const UTF_16 = 'UTF_16';\n  const LATIN_1 = 'LATIN_1';\n}\n", "num_lines": 40}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static FlightImageFetchStatusValues getInstance()\n */\nclass FlightImageFetchStatusValues extends AbstractEnum {\n\n  const DIRECT_UPLOAD = 'DIRECT_UPLOAD';\n  const FETCHED = 'FETCHED';\n  const FETCH_FAILED = 'FETCH_FAILED';\n  const NO_STATUS = 'NO_STATUS';\n  const OUTDATED = 'OUTDATED';\n  const PARTIAL_FETCH = 'PARTIAL_FETCH';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static FlightVisibilityValues getInstance()\n */\nclass FlightVisibilityValues extends AbstractEnum {\n\n  const PUBLISHED = 'PUBLISHED';\n  const STAGING = 'STAGING';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static FundraiserPersonToCharityFundraiserTypeValues getInstance()\n */\nclass FundraiserPersonToCharityFundraiserTypeValues extends AbstractEnum {\n\n  const PERSON_FOR_CHARITY = 'person_for_charity';\n}\n", "num_lines": 42}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static GameItemActionValues getInstance()\n */\nclass GameItemActionValues extends AbstractEnum {\n\n  const CONSUME = 'CONSUME';\n  const DROP = 'DROP';\n  const MARK = 'MARK';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static GroupGroupTypeValues getInstance()\n */\nclass GroupGroupTypeValues extends AbstractEnum {\n\n  const CASUAL = 'CASUAL';\n  const COWORKERS = 'COWORKERS';\n  const CUSTOM = 'CUSTOM';\n  const FOR_SALE = 'FOR_SALE';\n  const FOR_WORK = 'FOR_WORK';\n  const GAME = 'GAME';\n  const HEALTH_SUPPORT = 'HEALTH_SUPPORT';\n  const JOBS = 'JOBS';\n  const LEARNING = 'LEARNING';\n  const NONE = 'NONE';\n  const PARENTING = 'PARENTING';\n  const STREAMER = 'STREAMER';\n  const WORK_ANNOUNCEMENT = 'WORK_ANNOUNCEMENT';\n  const WORK_DEMO_GROUP = 'WORK_DEMO_GROUP';\n  const WORK_DISCUSSION = 'WORK_DISCUSSION';\n  const WORK_EPHEMERAL = 'WORK_EPHEMERAL';\n  const WORK_FEEDBACK = 'WORK_FEEDBACK';\n  const WORK_FOR_SALE = 'WORK_FOR_SALE';\n  const WORK_GARDEN = 'WORK_GARDEN';\n  const WORK_INTEGRITY = 'WORK_INTEGRITY';\n  const WORK_LEARNING = 'WORK_LEARNING';\n  const WORK_MENTORSHIP = 'WORK_MENTORSHIP';\n  const WORK_MULTI_COMPANY = 'WORK_MULTI_COMPANY';\n  const WORK_RECRUITING = 'WORK_RECRUITING';\n  const WORK_SOCIAL = 'WORK_SOCIAL';\n  const WORK_STAGES = 'WORK_STAGES';\n  const WORK_TEAM = 'WORK_TEAM';\n  const WORK_TEAMWORK = 'WORK_TEAMWORK';\n}\n", "num_lines": 69}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static GroupJoinSettingValues getInstance()\n */\nclass GroupJoinSettingValues extends AbstractEnum {\n\n  const ADMIN_ONLY = 'ADMIN_ONLY';\n  const ANYONE = 'ANYONE';\n  const NONE = 'NONE';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static GroupPostPermissionsValues getInstance()\n */\nclass GroupPostPermissionsValues extends AbstractEnum {\n\n  const VALUE_0 = '0';\n  const VALUE_1 = '1';\n  const VALUE_2 = '2';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static GroupPurposeValues getInstance()\n */\nclass GroupPurposeValues extends AbstractEnum {\n\n  const CASUAL = 'CASUAL';\n  const COWORKERS = 'COWORKERS';\n  const CUSTOM = 'CUSTOM';\n  const FOR_SALE = 'FOR_SALE';\n  const FOR_WORK = 'FOR_WORK';\n  const GAME = 'GAME';\n  const HEALTH_SUPPORT = 'HEALTH_SUPPORT';\n  const JOBS = 'JOBS';\n  const LEARNING = 'LEARNING';\n  const NONE = 'NONE';\n  const PARENTING = 'PARENTING';\n  const STREAMER = 'STREAMER';\n  const WORK_ANNOUNCEMENT = 'WORK_ANNOUNCEMENT';\n  const WORK_DEMO_GROUP = 'WORK_DEMO_GROUP';\n  const WORK_DISCUSSION = 'WORK_DISCUSSION';\n  const WORK_EPHEMERAL = 'WORK_EPHEMERAL';\n  const WORK_FEEDBACK = 'WORK_FEEDBACK';\n  const WORK_FOR_SALE = 'WORK_FOR_SALE';\n  const WORK_GARDEN = 'WORK_GARDEN';\n  const WORK_INTEGRITY = 'WORK_INTEGRITY';\n  const WORK_LEARNING = 'WORK_LEARNING';\n  const WORK_MENTORSHIP = 'WORK_MENTORSHIP';\n  const WORK_MULTI_COMPANY = 'WORK_MULTI_COMPANY';\n  const WORK_RECRUITING = 'WORK_RECRUITING';\n  const WORK_SOCIAL = 'WORK_SOCIAL';\n  const WORK_STAGES = 'WORK_STAGES';\n  const WORK_TEAM = 'WORK_TEAM';\n  const WORK_TEAMWORK = 'WORK_TEAMWORK';\n}\n", "num_lines": 69}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static HomeListingImageFetchStatusValues getInstance()\n */\nclass HomeListingImageFetchStatusValues extends AbstractEnum {\n\n  const DIRECT_UPLOAD = 'DIRECT_UPLOAD';\n  const FETCHED = 'FETCHED';\n  const FETCH_FAILED = 'FETCH_FAILED';\n  const NO_STATUS = 'NO_STATUS';\n  const OUTDATED = 'OUTDATED';\n  const PARTIAL_FETCH = 'PARTIAL_FETCH';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static HomeListingVisibilityValues getInstance()\n */\nclass HomeListingVisibilityValues extends AbstractEnum {\n\n  const PUBLISHED = 'PUBLISHED';\n  const STAGING = 'STAGING';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static HotelImageFetchStatusValues getInstance()\n */\nclass HotelImageFetchStatusValues extends AbstractEnum {\n\n  const DIRECT_UPLOAD = 'DIRECT_UPLOAD';\n  const FETCHED = 'FETCHED';\n  const FETCH_FAILED = 'FETCH_FAILED';\n  const NO_STATUS = 'NO_STATUS';\n  const OUTDATED = 'OUTDATED';\n  const PARTIAL_FETCH = 'PARTIAL_FETCH';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static HotelVisibilityValues getInstance()\n */\nclass HotelVisibilityValues extends AbstractEnum {\n\n  const PUBLISHED = 'PUBLISHED';\n  const STAGING = 'STAGING';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ImageCopyrightGeoOwnershipValues getInstance()\n */\nclass ImageCopyrightGeoOwnershipValues extends AbstractEnum {\n\n  const AD = 'AD';\n  const AE = 'AE';\n  const AF = 'AF';\n  const AG = 'AG';\n  const AI = 'AI';\n  const AL = 'AL';\n  const AM = 'AM';\n  const AN = 'AN';\n  const AO = 'AO';\n  const AQ = 'AQ';\n  const AR = 'AR';\n  const VALUE_AS = 'AS';\n  const AT = 'AT';\n  const AU = 'AU';\n  const AW = 'AW';\n  const AX = 'AX';\n  const AZ = 'AZ';\n  const BA = 'BA';\n  const BB = 'BB';\n  const BD = 'BD';\n  const BE = 'BE';\n  const BF = 'BF';\n  const BG = 'BG';\n  const BH = 'BH';\n  const BI = 'BI';\n  const BJ = 'BJ';\n  const BL = 'BL';\n  const BM = 'BM';\n  const BN = 'BN';\n  const BO = 'BO';\n  const BQ = 'BQ';\n  const BR = 'BR';\n  const BS = 'BS';\n  const BT = 'BT';\n  const BV = 'BV';\n  const BW = 'BW';\n  const BY = 'BY';\n  const BZ = 'BZ';\n  const CA = 'CA';\n  const CC = 'CC';\n  const CD = 'CD';\n  const CF = 'CF';\n  const CG = 'CG';\n  const CH = 'CH';\n  const CI = 'CI';\n  const CK = 'CK';\n  const CL = 'CL';\n  const CM = 'CM';\n  const CN = 'CN';\n  const CO = 'CO';\n  const CR = 'CR';\n  const CU = 'CU';\n  const CV = 'CV';\n  const CW = 'CW';\n  const CX = 'CX';\n  const CY = 'CY';\n  const CZ = 'CZ';\n  const DE = 'DE';\n  const DJ = 'DJ';\n  const DK = 'DK';\n  const DM = 'DM';\n  const VALUE_DO = 'DO';\n  const DZ = 'DZ';\n  const EC = 'EC';\n  const EE = 'EE';\n  const EG = 'EG';\n  const EH = 'EH';\n  const ER = 'ER';\n  const ES = 'ES';\n  const ET = 'ET';\n  const FI = 'FI';\n  const FJ = 'FJ';\n  const FK = 'FK';\n  const FM = 'FM';\n  const FO = 'FO';\n  const FR = 'FR';\n  const GA = 'GA';\n  const GB = 'GB';\n  const GD = 'GD';\n  const GE = 'GE';\n  const GF = 'GF';\n  const GG = 'GG';\n  const GH = 'GH';\n  const GI = 'GI';\n  const GL = 'GL';\n  const GM = 'GM';\n  const GN = 'GN';\n  const GP = 'GP';\n  const GQ = 'GQ';\n  const GR = 'GR';\n  const GS = 'GS';\n  const GT = 'GT';\n  const GU = 'GU';\n  const GW = 'GW';\n  const GY = 'GY';\n  const HK = 'HK';\n  const HM = 'HM';\n  const HN = 'HN';\n  const HR = 'HR';\n  const HT = 'HT';\n  const HU = 'HU';\n  const ID = 'ID';\n  const IE = 'IE';\n  const IL = 'IL';\n  const IM = 'IM';\n  const IN = 'IN';\n  const IO = 'IO';\n  const IQ = 'IQ';\n  const IR = 'IR';\n  const IS = 'IS';\n  const IT = 'IT';\n  const JE = 'JE';\n  const JM = 'JM';\n  const JO = 'JO';\n  const JP = 'JP';\n  const KE = 'KE';\n  const KG = 'KG';\n  const KH = 'KH';\n  const KI = 'KI';\n  const KM = 'KM';\n  const KN = 'KN';\n  const KP = 'KP';\n  const KR = 'KR';\n  const KW = 'KW';\n  const KY = 'KY';\n  const KZ = 'KZ';\n  const LA = 'LA';\n  const LB = 'LB';\n  const LC = 'LC';\n  const LI = 'LI';\n  const LK = 'LK';\n  const LR = 'LR';\n  const LS = 'LS';\n  const LT = 'LT';\n  const LU = 'LU';\n  const LV = 'LV';\n  const LY = 'LY';\n  const MA = 'MA';\n  const MC = 'MC';\n  const MD = 'MD';\n  const ME = 'ME';\n  const MF = 'MF';\n  const MG = 'MG';\n  const MH = 'MH';\n  const MK = 'MK';\n  const ML = 'ML';\n  const MM = 'MM';\n  const MN = 'MN';\n  const MO = 'MO';\n  const MP = 'MP';\n  const MQ = 'MQ';\n  const MR = 'MR';\n  const MS = 'MS';\n  const MT = 'MT';\n  const MU = 'MU';\n  const MV = 'MV';\n  const MW = 'MW';\n  const MX = 'MX';\n  const MY = 'MY';\n  const MZ = 'MZ';\n  const NA = 'NA';\n  const NC = 'NC';\n  const NE = 'NE';\n  const NF = 'NF';\n  const NG = 'NG';\n  const NI = 'NI';\n  const NL = 'NL';\n  const NO = 'NO';\n  const NP = 'NP';\n  const NR = 'NR';\n  const NU = 'NU';\n  const NZ = 'NZ';\n  const OM = 'OM';\n  const PA = 'PA';\n  const PE = 'PE';\n  const PF = 'PF';\n  const PG = 'PG';\n  const PH = 'PH';\n  const PK = 'PK';\n  const PL = 'PL';\n  const PM = 'PM';\n  const PN = 'PN';\n  const PR = 'PR';\n  const PS = 'PS';\n  const PT = 'PT';\n  const PW = 'PW';\n  const PY = 'PY';\n  const QA = 'QA';\n  const RE = 'RE';\n  const RO = 'RO';\n  const RS = 'RS';\n  const RU = 'RU';\n  const RW = 'RW';\n  const SA = 'SA';\n  const SB = 'SB';\n  const SC = 'SC';\n  const SD = 'SD';\n  const SE = 'SE';\n  const SG = 'SG';\n  const SH = 'SH';\n  const SI = 'SI';\n  const SJ = 'SJ';\n  const SK = 'SK';\n  const SL = 'SL';\n  const SM = 'SM';\n  const SN = 'SN';\n  const SO = 'SO';\n  const SR = 'SR';\n  const SS = 'SS';\n  const ST = 'ST';\n  const SV = 'SV';\n  const SX = 'SX';\n  const SY = 'SY';\n  const SZ = 'SZ';\n  const TC = 'TC';\n  const TD = 'TD';\n  const TF = 'TF';\n  const TG = 'TG';\n  const TH = 'TH';\n  const TJ = 'TJ';\n  const TK = 'TK';\n  const TL = 'TL';\n  const TM = 'TM';\n  const TN = 'TN';\n  const TO = 'TO';\n  const TP = 'TP';\n  const TR = 'TR';\n  const TT = 'TT';\n  const TV = 'TV';\n  const TW = 'TW';\n  const TZ = 'TZ';\n  const UA = 'UA';\n  const UG = 'UG';\n  const UM = 'UM';\n  const US = 'US';\n  const UY = 'UY';\n  const UZ = 'UZ';\n  const VA = 'VA';\n  const VC = 'VC';\n  const VE = 'VE';\n  const VG = 'VG';\n  const VI = 'VI';\n  const VN = 'VN';\n  const VU = 'VU';\n  const WF = 'WF';\n  const WS = 'WS';\n  const XK = 'XK';\n  const YE = 'YE';\n  const YT = 'YT';\n  const ZA = 'ZA';\n  const ZM = 'ZM';\n  const ZW = 'ZW';\n}\n", "num_lines": 293}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static InsightsIncrements getInstance()\n */\nclass InsightsIncrements extends AbstractEnum {\n\n  const MONTHLY = 'monthly';\n  const ALL_DAYS = 'all_days';\n}\n", "num_lines": 37}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static InsightsOperators getInstance()\n */\nclass InsightsOperators extends AbstractEnum {\n\n  const ALL = 'ALL';\n  const ANY = 'ANY';\n  const CONTAIN = 'CONTAIN';\n  const EQUAL = 'EQUAL';\n  const GREATER_THAN = 'GREATER_THAN';\n  const GREATER_THAN_OR_EQUAL = 'GREATER_THAN_OR_EQUAL';\n  const IN = 'IN';\n  const IN_RANGE = 'IN_RANGE';\n  const LESS_THAN = 'LESS_THAN';\n  const LESS_THAN_OR_EQUAL = 'LESS_THAN_OR_EQUAL';\n  const NONE = 'NONE';\n  const NOT_CONTAIN = 'NOT_CONTAIN';\n  const NOT_EQUAL = 'NOT_EQUAL';\n  const NOT_IN = 'NOT_IN';\n  const NOT_IN_RANGE = 'NOT_IN_RANGE';\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static InsightsResultDatePresetValues getInstance()\n */\nclass InsightsResultDatePresetValues extends AbstractEnum {\n\n  const DATA_MAXIMUM = 'data_maximum';\n  const LAST_14D = 'last_14d';\n  const LAST_28D = 'last_28d';\n  const LAST_30D = 'last_30d';\n  const LAST_3D = 'last_3d';\n  const LAST_7D = 'last_7d';\n  const LAST_90D = 'last_90d';\n  const LAST_MONTH = 'last_month';\n  const LAST_QUARTER = 'last_quarter';\n  const LAST_WEEK_MON_SUN = 'last_week_mon_sun';\n  const LAST_WEEK_SUN_SAT = 'last_week_sun_sat';\n  const LAST_YEAR = 'last_year';\n  const MAXIMUM = 'maximum';\n  const THIS_MONTH = 'this_month';\n  const THIS_QUARTER = 'this_quarter';\n  const THIS_WEEK_MON_TODAY = 'this_week_mon_today';\n  const THIS_WEEK_SUN_TODAY = 'this_week_sun_today';\n  const THIS_YEAR = 'this_year';\n  const TODAY = 'today';\n  const YESTERDAY = 'yesterday';\n}\n", "num_lines": 61}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static InsightsResultPeriodValues getInstance()\n */\nclass InsightsResultPeriodValues extends AbstractEnum {\n\n  const DAY = 'day';\n  const DAYS_28 = 'days_28';\n  const LIFETIME = 'lifetime';\n  const MONTH = 'month';\n  const TOTAL_OVER_RANGE = 'total_over_range';\n  const WEEK = 'week';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static InstagramInsightsResultBreakdownValues getInstance()\n */\nclass InstagramInsightsResultBreakdownValues extends AbstractEnum {\n\n  const ACTION_TYPE = 'action_type';\n  const FOLLOW_TYPE = 'follow_type';\n  const STORY_NAVIGATION_ACTION_TYPE = 'story_navigation_action_type';\n  const SURFACE_TYPE = 'surface_type';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static InstagramInsightsResultMetricTypeValues getInstance()\n */\nclass InstagramInsightsResultMetricTypeValues extends AbstractEnum {\n\n  const VALUE_DEFAULT = 'default';\n  const TIME_SERIES = 'time_series';\n  const TOTAL_VALUE = 'total_value';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static InstagramInsightsResultMetricValues getInstance()\n */\nclass InstagramInsightsResultMetricValues extends AbstractEnum {\n\n  const CAROUSEL_ALBUM_ENGAGEMENT = 'carousel_album_engagement';\n  const CAROUSEL_ALBUM_IMPRESSIONS = 'carousel_album_impressions';\n  const CAROUSEL_ALBUM_REACH = 'carousel_album_reach';\n  const CAROUSEL_ALBUM_SAVED = 'carousel_album_saved';\n  const CAROUSEL_ALBUM_VIDEO_VIEWS = 'carousel_album_video_views';\n  const COMMENTS = 'comments';\n  const ENGAGEMENT = 'engagement';\n  const EXITS = 'exits';\n  const FOLLOWS = 'follows';\n  const IMPRESSIONS = 'impressions';\n  const LIKES = 'likes';\n  const NAVIGATION = 'navigation';\n  const PLAYS = 'plays';\n  const PROFILE_ACTIVITY = 'profile_activity';\n  const PROFILE_VISITS = 'profile_visits';\n  const REACH = 'reach';\n  const REPLIES = 'replies';\n  const SAVED = 'saved';\n  const SHARES = 'shares';\n  const TAPS_BACK = 'taps_back';\n  const TAPS_FORWARD = 'taps_forward';\n  const TOTAL_INTERACTIONS = 'total_interactions';\n  const VIDEO_VIEWS = 'video_views';\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static InstagramInsightsResultPeriodValues getInstance()\n */\nclass InstagramInsightsResultPeriodValues extends AbstractEnum {\n\n  const DAY = 'day';\n  const DAYS_28 = 'days_28';\n  const LIFETIME = 'lifetime';\n  const MONTH = 'month';\n  const TOTAL_OVER_RANGE = 'total_over_range';\n  const WEEK = 'week';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static InstagramInsightsResultTimeframeValues getInstance()\n */\nclass InstagramInsightsResultTimeframeValues extends AbstractEnum {\n\n  const LAST_14_DAYS = 'last_14_days';\n  const LAST_30_DAYS = 'last_30_days';\n  const LAST_90_DAYS = 'last_90_days';\n  const PREV_MONTH = 'prev_month';\n  const THIS_MONTH = 'this_month';\n  const THIS_WEEK = 'this_week';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static JobOpeningJobStatusValues getInstance()\n */\nclass JobOpeningJobStatusValues extends AbstractEnum {\n\n  const CLOSED = 'CLOSED';\n  const DRAFT = 'DRAFT';\n  const OPEN = 'OPEN';\n  const PROVISIONAL = 'PROVISIONAL';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static JobOpeningPlatformReviewStatusValues getInstance()\n */\nclass JobOpeningPlatformReviewStatusValues extends AbstractEnum {\n\n  const APPROVED = 'APPROVED';\n  const PENDING = 'PENDING';\n  const REJECTED = 'REJECTED';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static JobOpeningReviewRejectionReasonsValues getInstance()\n */\nclass JobOpeningReviewRejectionReasonsValues extends AbstractEnum {\n\n  const ADULT_CONTENT = 'ADULT_CONTENT';\n  const DISCRIMINATION = 'DISCRIMINATION';\n  const DRUGS = 'DRUGS';\n  const GENERIC_DEFAULT = 'GENERIC_DEFAULT';\n  const ILLEGAL = 'ILLEGAL';\n  const IMPERSONATION = 'IMPERSONATION';\n  const MISLEADING = 'MISLEADING';\n  const MULTILEVEL_MARKETING = 'MULTILEVEL_MARKETING';\n  const PERSONAL_INFO = 'PERSONAL_INFO';\n  const SEXUAL = 'SEXUAL';\n}\n", "num_lines": 51}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static JobOpeningTypeValues getInstance()\n */\nclass JobOpeningTypeValues extends AbstractEnum {\n\n  const CONTRACT = 'CONTRACT';\n  const FULL_TIME = 'FULL_TIME';\n  const INTERNSHIP = 'INTERNSHIP';\n  const PART_TIME = 'PART_TIME';\n  const VOLUNTEER = 'VOLUNTEER';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static LeadgenFormLocaleValues getInstance()\n */\nclass LeadgenFormLocaleValues extends AbstractEnum {\n\n  const AR_AR = 'AR_AR';\n  const CS_CZ = 'CS_CZ';\n  const DA_DK = 'DA_DK';\n  const DE_DE = 'DE_DE';\n  const EL_GR = 'EL_GR';\n  const EN_GB = 'EN_GB';\n  const EN_US = 'EN_US';\n  const ES_ES = 'ES_ES';\n  const ES_LA = 'ES_LA';\n  const FI_FI = 'FI_FI';\n  const FR_FR = 'FR_FR';\n  const HE_IL = 'HE_IL';\n  const HI_IN = 'HI_IN';\n  const HU_HU = 'HU_HU';\n  const ID_ID = 'ID_ID';\n  const IT_IT = 'IT_IT';\n  const JA_JP = 'JA_JP';\n  const KO_KR = 'KO_KR';\n  const NB_NO = 'NB_NO';\n  const NL_NL = 'NL_NL';\n  const PL_PL = 'PL_PL';\n  const PT_BR = 'PT_BR';\n  const PT_PT = 'PT_PT';\n  const RO_RO = 'RO_RO';\n  const RU_RU = 'RU_RU';\n  const SV_SE = 'SV_SE';\n  const TH_TH = 'TH_TH';\n  const TR_TR = 'TR_TR';\n  const VI_VN = 'VI_VN';\n  const ZH_CN = 'ZH_CN';\n  const ZH_HK = 'ZH_HK';\n  const ZH_TW = 'ZH_TW';\n}\n", "num_lines": 73}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static LeadgenFormStatusValues getInstance()\n */\nclass LeadgenFormStatusValues extends AbstractEnum {\n\n  const ACTIVE = 'ACTIVE';\n  const ARCHIVED = 'ARCHIVED';\n  const DELETED = 'DELETED';\n  const DRAFT = 'DRAFT';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static LiveVideoBroadcastStatusValues getInstance()\n */\nclass LiveVideoBroadcastStatusValues extends AbstractEnum {\n\n  const LIVE = 'LIVE';\n  const LIVE_STOPPED = 'LIVE_STOPPED';\n  const PROCESSING = 'PROCESSING';\n  const SCHEDULED_CANCELED = 'SCHEDULED_CANCELED';\n  const SCHEDULED_EXPIRED = 'SCHEDULED_EXPIRED';\n  const SCHEDULED_LIVE = 'SCHEDULED_LIVE';\n  const SCHEDULED_UNPUBLISHED = 'SCHEDULED_UNPUBLISHED';\n  const UNPUBLISHED = 'UNPUBLISHED';\n  const VOD = 'VOD';\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static LiveVideoLiveCommentModerationSettingValues getInstance()\n */\nclass LiveVideoLiveCommentModerationSettingValues extends AbstractEnum {\n\n  const VALUE_DEFAULT = 'DEFAULT';\n  const DISCUSSION = 'DISCUSSION';\n  const FOLLOWED = 'FOLLOWED';\n  const FOLLOWER = 'FOLLOWER';\n  const NO_HYPERLINK = 'NO_HYPERLINK';\n  const PROTECTED_MODE = 'PROTECTED_MODE';\n  const RESTRICTED = 'RESTRICTED';\n  const SLOW = 'SLOW';\n  const SUPPORTER = 'SUPPORTER';\n  const TAGGED = 'TAGGED';\n}\n", "num_lines": 51}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static LiveVideoPersistentStreamKeyStatusValues getInstance()\n */\nclass LiveVideoPersistentStreamKeyStatusValues extends AbstractEnum {\n\n  const DISABLE = 'DISABLE';\n  const ENABLE = 'ENABLE';\n  const REGENERATE = 'REGENERATE';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static LiveVideoProjectionValues getInstance()\n */\nclass LiveVideoProjectionValues extends AbstractEnum {\n\n  const CUBEMAP = 'CUBEMAP';\n  const EQUIRECTANGULAR = 'EQUIRECTANGULAR';\n  const HALF_EQUIRECTANGULAR = 'HALF_EQUIRECTANGULAR';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static LiveVideoSourceValues getInstance()\n */\nclass LiveVideoSourceValues extends AbstractEnum {\n\n  const OWNER = 'owner';\n  const TARGET = 'target';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static LiveVideoSpatialAudioFormatValues getInstance()\n */\nclass LiveVideoSpatialAudioFormatValues extends AbstractEnum {\n\n  const AMBIX_4 = 'ambiX_4';\n}\n", "num_lines": 42}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static LiveVideoStatusValues getInstance()\n */\nclass LiveVideoStatusValues extends AbstractEnum {\n\n  const LIVE_NOW = 'LIVE_NOW';\n  const SCHEDULED_CANCELED = 'SCHEDULED_CANCELED';\n  const SCHEDULED_LIVE = 'SCHEDULED_LIVE';\n  const SCHEDULED_UNPUBLISHED = 'SCHEDULED_UNPUBLISHED';\n  const UNPUBLISHED = 'UNPUBLISHED';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static LiveVideoStereoscopicModeValues getInstance()\n */\nclass LiveVideoStereoscopicModeValues extends AbstractEnum {\n\n  const LEFT_RIGHT = 'LEFT_RIGHT';\n  const MONO = 'MONO';\n  const TOP_BOTTOM = 'TOP_BOTTOM';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static LiveVideoStreamTypeValues getInstance()\n */\nclass LiveVideoStreamTypeValues extends AbstractEnum {\n\n  const AMBIENT = 'AMBIENT';\n  const REGULAR = 'REGULAR';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static LocalServiceBusinessAvailabilityValues getInstance()\n */\nclass LocalServiceBusinessAvailabilityValues extends AbstractEnum {\n\n  const AVAILABLE_FOR_ORDER = 'AVAILABLE_FOR_ORDER';\n  const DISCONTINUED = 'DISCONTINUED';\n  const IN_STOCK = 'IN_STOCK';\n  const OUT_OF_STOCK = 'OUT_OF_STOCK';\n  const PENDING = 'PENDING';\n  const PREORDER = 'PREORDER';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static LocalServiceBusinessConditionValues getInstance()\n */\nclass LocalServiceBusinessConditionValues extends AbstractEnum {\n\n  const PC_CPO = 'PC_CPO';\n  const PC_NEW = 'PC_NEW';\n  const PC_OPEN_BOX_NEW = 'PC_OPEN_BOX_NEW';\n  const PC_REFURBISHED = 'PC_REFURBISHED';\n  const PC_USED = 'PC_USED';\n  const PC_USED_FAIR = 'PC_USED_FAIR';\n  const PC_USED_GOOD = 'PC_USED_GOOD';\n  const PC_USED_LIKE_NEW = 'PC_USED_LIKE_NEW';\n}\n", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static LocalServiceBusinessImageFetchStatusValues getInstance()\n */\nclass LocalServiceBusinessImageFetchStatusValues extends AbstractEnum {\n\n  const DIRECT_UPLOAD = 'DIRECT_UPLOAD';\n  const FETCHED = 'FETCHED';\n  const FETCH_FAILED = 'FETCH_FAILED';\n  const NO_STATUS = 'NO_STATUS';\n  const OUTDATED = 'OUTDATED';\n  const PARTIAL_FETCH = 'PARTIAL_FETCH';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static LocalServiceBusinessVisibilityValues getInstance()\n */\nclass LocalServiceBusinessVisibilityValues extends AbstractEnum {\n\n  const PUBLISHED = 'PUBLISHED';\n  const STAGING = 'STAGING';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static MediaFingerprintFingerprintContentTypeValues getInstance()\n */\nclass MediaFingerprintFingerprintContentTypeValues extends AbstractEnum {\n\n  const AM_SONGTRACK = 'AM_SONGTRACK';\n  const EPISODE = 'EPISODE';\n  const MOVIE = 'MOVIE';\n  const OTHER = 'OTHER';\n  const SONGTRACK = 'SONGTRACK';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static MediaTitleContentCategoryValues getInstance()\n */\nclass MediaTitleContentCategoryValues extends AbstractEnum {\n\n  const MOVIE = 'MOVIE';\n  const MUSIC = 'MUSIC';\n  const TV_SHOW = 'TV_SHOW';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static MediaTitleImageFetchStatusValues getInstance()\n */\nclass MediaTitleImageFetchStatusValues extends AbstractEnum {\n\n  const DIRECT_UPLOAD = 'DIRECT_UPLOAD';\n  const FETCHED = 'FETCHED';\n  const FETCH_FAILED = 'FETCH_FAILED';\n  const NO_STATUS = 'NO_STATUS';\n  const OUTDATED = 'OUTDATED';\n  const PARTIAL_FETCH = 'PARTIAL_FETCH';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static MediaTitleVisibilityValues getInstance()\n */\nclass MediaTitleVisibilityValues extends AbstractEnum {\n\n  const PUBLISHED = 'PUBLISHED';\n  const STAGING = 'STAGING';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static OfflineConversionDataSetPermittedRolesValues getInstance()\n */\nclass OfflineConversionDataSetPermittedRolesValues extends AbstractEnum {\n\n  const ADMIN = 'ADMIN';\n  const ADVERTISER = 'ADVERTISER';\n  const UPLOADER = 'UPLOADER';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static OfflineConversionDataSetRelationshipTypeValues getInstance()\n */\nclass OfflineConversionDataSetRelationshipTypeValues extends AbstractEnum {\n\n  const AD_MANAGER = 'AD_MANAGER';\n  const AGENCY = 'AGENCY';\n  const AGGREGATOR = 'AGGREGATOR';\n  const AUDIENCE_MANAGER = 'AUDIENCE_MANAGER';\n  const OTHER = 'OTHER';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static OfflineConversionDataSetUploadOrderValues getInstance()\n */\nclass OfflineConversionDataSetUploadOrderValues extends AbstractEnum {\n\n  const ASCENDING = 'ASCENDING';\n  const DESCENDING = 'DESCENDING';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static OfflineConversionDataSetUploadSortByValues getInstance()\n */\nclass OfflineConversionDataSetUploadSortByValues extends AbstractEnum {\n\n  const API_CALLS = 'API_CALLS';\n  const CREATION_TIME = 'CREATION_TIME';\n  const EVENT_TIME_MAX = 'EVENT_TIME_MAX';\n  const EVENT_TIME_MIN = 'EVENT_TIME_MIN';\n  const FIRST_UPLOAD_TIME = 'FIRST_UPLOAD_TIME';\n  const IS_EXCLUDED_FOR_LIFT = 'IS_EXCLUDED_FOR_LIFT';\n  const LAST_UPLOAD_TIME = 'LAST_UPLOAD_TIME';\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static OmegaCustomerTrxTypeValues getInstance()\n */\nclass OmegaCustomerTrxTypeValues extends AbstractEnum {\n\n  const CM = 'CM';\n  const DM = 'DM';\n  const INV = 'INV';\n  const PRO_FORMA = 'PRO_FORMA';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageAlignmentValues getInstance()\n */\nclass PageAlignmentValues extends AbstractEnum {\n\n  const LEFT = 'LEFT';\n  const RIGHT = 'RIGHT';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageAttireValues getInstance()\n */\nclass PageAttireValues extends AbstractEnum {\n\n  const CASUAL = 'Casual';\n  const DRESSY = 'Dressy';\n  const UNSPECIFIED = 'Unspecified';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageBackdatedTimeGranularityValues getInstance()\n */\nclass PageBackdatedTimeGranularityValues extends AbstractEnum {\n\n  const DAY = 'day';\n  const HOUR = 'hour';\n  const MIN = 'min';\n  const MONTH = 'month';\n  const NONE = 'none';\n  const YEAR = 'year';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageCallToActionAndroidDestinationTypeValues getInstance()\n */\nclass PageCallToActionAndroidDestinationTypeValues extends AbstractEnum {\n\n  const APP_DEEPLINK = 'APP_DEEPLINK';\n  const BECOME_A_VOLUNTEER = 'BECOME_A_VOLUNTEER';\n  const EMAIL = 'EMAIL';\n  const FACEBOOK_APP = 'FACEBOOK_APP';\n  const FOLLOW = 'FOLLOW';\n  const MARKETPLACE_INVENTORY_PAGE = 'MARKETPLACE_INVENTORY_PAGE';\n  const MENU_ON_FACEBOOK = 'MENU_ON_FACEBOOK';\n  const MESSENGER = 'MESSENGER';\n  const MINI_SHOP = 'MINI_SHOP';\n  const MOBILE_CENTER = 'MOBILE_CENTER';\n  const NONE = 'NONE';\n  const PHONE_CALL = 'PHONE_CALL';\n  const SHOP_ON_FACEBOOK = 'SHOP_ON_FACEBOOK';\n  const WEBSITE = 'WEBSITE';\n}\n", "num_lines": 55}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageCallToActionIphoneDestinationTypeValues getInstance()\n */\nclass PageCallToActionIphoneDestinationTypeValues extends AbstractEnum {\n\n  const APP_DEEPLINK = 'APP_DEEPLINK';\n  const BECOME_A_VOLUNTEER = 'BECOME_A_VOLUNTEER';\n  const EMAIL = 'EMAIL';\n  const FACEBOOK_APP = 'FACEBOOK_APP';\n  const FOLLOW = 'FOLLOW';\n  const MARKETPLACE_INVENTORY_PAGE = 'MARKETPLACE_INVENTORY_PAGE';\n  const MENU_ON_FACEBOOK = 'MENU_ON_FACEBOOK';\n  const MESSENGER = 'MESSENGER';\n  const MINI_SHOP = 'MINI_SHOP';\n  const NONE = 'NONE';\n  const PHONE_CALL = 'PHONE_CALL';\n  const SHOP_ON_FACEBOOK = 'SHOP_ON_FACEBOOK';\n  const WEBSITE = 'WEBSITE';\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageCallToActionTypeValues getInstance()\n */\nclass PageCallToActionTypeValues extends AbstractEnum {\n\n  const BECOME_A_VOLUNTEER = 'BECOME_A_VOLUNTEER';\n  const BOOK_APPOINTMENT = 'BOOK_APPOINTMENT';\n  const BOOK_NOW = 'BOOK_NOW';\n  const BUY_TICKETS = 'BUY_TICKETS';\n  const CALL_NOW = 'CALL_NOW';\n  const CHARITY_DONATE = 'CHARITY_DONATE';\n  const CONTACT_US = 'CONTACT_US';\n  const DONATE_NOW = 'DONATE_NOW';\n  const EMAIL = 'EMAIL';\n  const FOLLOW_PAGE = 'FOLLOW_PAGE';\n  const GET_DIRECTIONS = 'GET_DIRECTIONS';\n  const GET_OFFER = 'GET_OFFER';\n  const GET_OFFER_VIEW = 'GET_OFFER_VIEW';\n  const INTERESTED = 'INTERESTED';\n  const LEARN_MORE = 'LEARN_MORE';\n  const LISTEN = 'LISTEN';\n  const LOCAL_DEV_PLATFORM = 'LOCAL_DEV_PLATFORM';\n  const MESSAGE = 'MESSAGE';\n  const MOBILE_CENTER = 'MOBILE_CENTER';\n  const OPEN_APP = 'OPEN_APP';\n  const ORDER_FOOD = 'ORDER_FOOD';\n  const PLAY_MUSIC = 'PLAY_MUSIC';\n  const PLAY_NOW = 'PLAY_NOW';\n  const PURCHASE_GIFT_CARDS = 'PURCHASE_GIFT_CARDS';\n  const REQUEST_APPOINTMENT = 'REQUEST_APPOINTMENT';\n  const REQUEST_QUOTE = 'REQUEST_QUOTE';\n  const SHOP_NOW = 'SHOP_NOW';\n  const SHOP_ON_FACEBOOK = 'SHOP_ON_FACEBOOK';\n  const SIGN_UP = 'SIGN_UP';\n  const VIEW_INVENTORY = 'VIEW_INVENTORY';\n  const VIEW_MENU = 'VIEW_MENU';\n  const VIEW_SHOP = 'VIEW_SHOP';\n  const VISIT_GROUP = 'VISIT_GROUP';\n  const WATCH_NOW = 'WATCH_NOW';\n  const WOODHENGE_SUPPORT = 'WOODHENGE_SUPPORT';\n}\n", "num_lines": 76}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageCallToActionWebDestinationTypeValues getInstance()\n */\nclass PageCallToActionWebDestinationTypeValues extends AbstractEnum {\n\n  const BECOME_A_VOLUNTEER = 'BECOME_A_VOLUNTEER';\n  const BECOME_SUPPORTER = 'BECOME_SUPPORTER';\n  const EMAIL = 'EMAIL';\n  const FOLLOW = 'FOLLOW';\n  const MESSENGER = 'MESSENGER';\n  const MOBILE_CENTER = 'MOBILE_CENTER';\n  const NONE = 'NONE';\n  const SHOP_ON_FACEBOOK = 'SHOP_ON_FACEBOOK';\n  const WEBSITE = 'WEBSITE';\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageCheckinEntryPointValues getInstance()\n */\nclass PageCheckinEntryPointValues extends AbstractEnum {\n\n  const BRANDING_CHECKIN = 'BRANDING_CHECKIN';\n  const BRANDING_OTHER = 'BRANDING_OTHER';\n  const BRANDING_PHOTO = 'BRANDING_PHOTO';\n  const BRANDING_STATUS = 'BRANDING_STATUS';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageDeveloperActionValues getInstance()\n */\nclass PageDeveloperActionValues extends AbstractEnum {\n\n  const ENABLE_FOLLOWUP_MESSAGE = 'ENABLE_FOLLOWUP_MESSAGE';\n  const SEND_RE_OPTIN = 'SEND_RE_OPTIN';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageEntryPointIconValues getInstance()\n */\nclass PageEntryPointIconValues extends AbstractEnum {\n\n  const CHAT_ANGULAR_ICON = 'CHAT_ANGULAR_ICON';\n  const CHAT_ROUND_ICON = 'CHAT_ROUND_ICON';\n  const MESSENGER_ICON = 'MESSENGER_ICON';\n  const NONE = 'NONE';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageEntryPointLabelValues getInstance()\n */\nclass PageEntryPointLabelValues extends AbstractEnum {\n\n  const ASK_US = 'ASK_US';\n  const CHAT = 'CHAT';\n  const HELP = 'HELP';\n  const NONE = 'NONE';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageFoodStylesValues getInstance()\n */\nclass PageFoodStylesValues extends AbstractEnum {\n\n  const AFGHANI = 'Afghani';\n  const AMERICAN_NEW_ = 'American (New)';\n  const AMERICAN_TRADITIONAL_ = 'American (Traditional)';\n  const ASIAN_FUSION = 'Asian Fusion';\n  const BARBEQUE = 'Barbeque';\n  const BRAZILIAN = 'Brazilian';\n  const BREAKFAST = 'Breakfast';\n  const BRITISH = 'British';\n  const BRUNCH = 'Brunch';\n  const BUFFETS = 'Buffets';\n  const BURGERS = 'Burgers';\n  const BURMESE = 'Burmese';\n  const CAJUN_CREOLE = 'Cajun/Creole';\n  const CARIBBEAN = 'Caribbean';\n  const CHINESE = 'Chinese';\n  const CREPERIES = 'Creperies';\n  const CUBAN = 'Cuban';\n  const DELIS = 'Delis';\n  const DINERS = 'Diners';\n  const ETHIOPIAN = 'Ethiopian';\n  const FAST_FOOD = 'Fast Food';\n  const FILIPINO = 'Filipino';\n  const FONDUE = 'Fondue';\n  const FOOD_STANDS = 'Food Stands';\n  const FRENCH = 'French';\n  const GERMAN = 'German';\n  const GREEK_AND_MEDITERRANEAN = 'Greek and Mediterranean';\n  const HAWAIIAN = 'Hawaiian';\n  const HIMALAYAN_NEPALESE = 'Himalayan/Nepalese';\n  const HOT_DOGS = 'Hot Dogs';\n  const INDIAN_PAKISTANI = 'Indian/Pakistani';\n  const IRISH = 'Irish';\n  const ITALIAN = 'Italian';\n  const JAPANESE = 'Japanese';\n  const KOREAN = 'Korean';\n  const LATIN_AMERICAN = 'Latin American';\n  const MEXICAN = 'Mexican';\n  const MIDDLE_EASTERN = 'Middle Eastern';\n  const MOROCCAN = 'Moroccan';\n  const PIZZA = 'Pizza';\n  const RUSSIAN = 'Russian';\n  const SANDWICHES = 'Sandwiches';\n  const SEAFOOD = 'Seafood';\n  const SINGAPOREAN = 'Singaporean';\n  const SOUL_FOOD = 'Soul Food';\n  const SOUTHERN = 'Southern';\n  const SPANISH_BASQUE = 'Spanish/Basque';\n  const STEAKHOUSES = 'Steakhouses';\n  const SUSHI_BARS = 'Sushi Bars';\n  const TAIWANESE = 'Taiwanese';\n  const TAPAS_BARS = 'Tapas Bars';\n  const TEX_MEX = 'Tex-Mex';\n  const THAI = 'Thai';\n  const TURKISH = 'Turkish';\n  const VEGAN = 'Vegan';\n  const VEGETARIAN = 'Vegetarian';\n  const VIETNAMESE = 'Vietnamese';\n}\n", "num_lines": 98}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageFormattingValues getInstance()\n */\nclass PageFormattingValues extends AbstractEnum {\n\n  const MARKDOWN = 'MARKDOWN';\n  const PLAINTEXT = 'PLAINTEXT';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageGreetingDialogDisplayValues getInstance()\n */\nclass PageGreetingDialogDisplayValues extends AbstractEnum {\n\n  const HIDE = 'HIDE';\n  const SHOW = 'SHOW';\n  const WELCOME_MESSAGE = 'WELCOME_MESSAGE';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageGuestChatModeValues getInstance()\n */\nclass PageGuestChatModeValues extends AbstractEnum {\n\n  const DISABLED = 'DISABLED';\n  const ENABLED = 'ENABLED';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageMessagingTypeValues getInstance()\n */\nclass PageMessagingTypeValues extends AbstractEnum {\n\n  const MESSAGE_TAG = 'MESSAGE_TAG';\n  const RESPONSE = 'RESPONSE';\n  const UPDATE = 'UPDATE';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageMobileChatDisplayValues getInstance()\n */\nclass PageMobileChatDisplayValues extends AbstractEnum {\n\n  const APP_SWITCH = 'APP_SWITCH';\n  const CHAT_TAB = 'CHAT_TAB';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageModelValues getInstance()\n */\nclass PageModelValues extends AbstractEnum {\n\n  const ARABIC = 'ARABIC';\n  const CHINESE = 'CHINESE';\n  const CROATIAN = 'CROATIAN';\n  const CUSTOM = 'CUSTOM';\n  const DANISH = 'DANISH';\n  const DUTCH = 'DUTCH';\n  const ENGLISH = 'ENGLISH';\n  const FRENCH_STANDARD = 'FRENCH_STANDARD';\n  const GEORGIAN = 'GEORGIAN';\n  const GERMAN_STANDARD = 'GERMAN_STANDARD';\n  const GREEK = 'GREEK';\n  const HEBREW = 'HEBREW';\n  const HUNGARIAN = 'HUNGARIAN';\n  const IRISH = 'IRISH';\n  const ITALIAN_STANDARD = 'ITALIAN_STANDARD';\n  const KOREAN = 'KOREAN';\n  const NORWEGIAN_BOKMAL = 'NORWEGIAN_BOKMAL';\n  const POLISH = 'POLISH';\n  const PORTUGUESE = 'PORTUGUESE';\n  const ROMANIAN = 'ROMANIAN';\n  const SPANISH = 'SPANISH';\n  const SWEDISH = 'SWEDISH';\n  const VIETNAMESE = 'VIETNAMESE';\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageNotificationTypeValues getInstance()\n */\nclass PageNotificationTypeValues extends AbstractEnum {\n\n  const NO_PUSH = 'NO_PUSH';\n  const REGULAR = 'REGULAR';\n  const SILENT_PUSH = 'SILENT_PUSH';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PagePermittedTasksValues getInstance()\n */\nclass PagePermittedTasksValues extends AbstractEnum {\n\n  const ADVERTISE = 'ADVERTISE';\n  const ANALYZE = 'ANALYZE';\n  const CASHIER_ROLE = 'CASHIER_ROLE';\n  const CREATE_CONTENT = 'CREATE_CONTENT';\n  const MANAGE = 'MANAGE';\n  const MANAGE_JOBS = 'MANAGE_JOBS';\n  const MANAGE_LEADS = 'MANAGE_LEADS';\n  const MESSAGING = 'MESSAGING';\n  const MODERATE = 'MODERATE';\n  const MODERATE_COMMUNITY = 'MODERATE_COMMUNITY';\n  const PAGES_MESSAGING = 'PAGES_MESSAGING';\n  const PAGES_MESSAGING_SUBSCRIPTIONS = 'PAGES_MESSAGING_SUBSCRIPTIONS';\n  const PROFILE_PLUS_ADVERTISE = 'PROFILE_PLUS_ADVERTISE';\n  const PROFILE_PLUS_ANALYZE = 'PROFILE_PLUS_ANALYZE';\n  const PROFILE_PLUS_CREATE_CONTENT = 'PROFILE_PLUS_CREATE_CONTENT';\n  const PROFILE_PLUS_FACEBOOK_ACCESS = 'PROFILE_PLUS_FACEBOOK_ACCESS';\n  const PROFILE_PLUS_FULL_CONTROL = 'PROFILE_PLUS_FULL_CONTROL';\n  const PROFILE_PLUS_MANAGE = 'PROFILE_PLUS_MANAGE';\n  const PROFILE_PLUS_MANAGE_LEADS = 'PROFILE_PLUS_MANAGE_LEADS';\n  const PROFILE_PLUS_MESSAGING = 'PROFILE_PLUS_MESSAGING';\n  const PROFILE_PLUS_MODERATE = 'PROFILE_PLUS_MODERATE';\n  const PROFILE_PLUS_MODERATE_DELEGATE_COMMUNITY = 'PROFILE_PLUS_MODERATE_DELEGATE_COMMUNITY';\n  const PROFILE_PLUS_REVENUE = 'PROFILE_PLUS_REVENUE';\n  const READ_PAGE_MAILBOXES = 'READ_PAGE_MAILBOXES';\n  const VIEW_MONETIZATION_INSIGHTS = 'VIEW_MONETIZATION_INSIGHTS';\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PagePickupOptionsValues getInstance()\n */\nclass PagePickupOptionsValues extends AbstractEnum {\n\n  const CURBSIDE = 'CURBSIDE';\n  const IN_STORE = 'IN_STORE';\n  const OTHER = 'OTHER';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PagePlaceAttachmentSettingValues getInstance()\n */\nclass PagePlaceAttachmentSettingValues extends AbstractEnum {\n\n  const VALUE_1 = '1';\n  const VALUE_2 = '2';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PagePlatformValues getInstance()\n */\nclass PagePlatformValues extends AbstractEnum {\n\n  const INSTAGRAM = 'INSTAGRAM';\n  const MESSENGER = 'MESSENGER';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PagePostBackdatedTimeGranularityValues getInstance()\n */\nclass PagePostBackdatedTimeGranularityValues extends AbstractEnum {\n\n  const DAY = 'day';\n  const HOUR = 'hour';\n  const MIN = 'min';\n  const MONTH = 'month';\n  const NONE = 'none';\n  const YEAR = 'year';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PagePostFeedStoryVisibilityValues getInstance()\n */\nclass PagePostFeedStoryVisibilityValues extends AbstractEnum {\n\n  const HIDDEN = 'hidden';\n  const VISIBLE = 'visible';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PagePostingToRedspaceValues getInstance()\n */\nclass PagePostingToRedspaceValues extends AbstractEnum {\n\n  const DISABLED = 'disabled';\n  const ENABLED = 'enabled';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PagePostSurfacesBlacklistValues getInstance()\n */\nclass PagePostSurfacesBlacklistValues extends AbstractEnum {\n\n  const VALUE_1 = '1';\n  const VALUE_2 = '2';\n  const VALUE_3 = '3';\n  const VALUE_4 = '4';\n  const VALUE_5 = '5';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PagePostTimelineVisibilityValues getInstance()\n */\nclass PagePostTimelineVisibilityValues extends AbstractEnum {\n\n  const FORCED_ALLOW = 'forced_allow';\n  const HIDDEN = 'hidden';\n  const NORMAL = 'normal';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PagePostWithValues getInstance()\n */\nclass PagePostWithValues extends AbstractEnum {\n\n  const LOCATION = 'LOCATION';\n}\n", "num_lines": 42}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static PageRoles getInstance()\n */\nclass PageRoles extends AbstractEnum {\n\n  const ADVERTISER  = 'ADVERTISER';\n  const CONTENT_CREATOR = 'CONTENT_CREATOR';\n  const MANAGER = 'MANAGER';\n  const MODERATOR = 'MODERATOR';\n  const INSIGHTS_ANALYST = 'INSIGHTS_ANALYST';\n}\n", "num_lines": 40}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageSenderActionValues getInstance()\n */\nclass PageSenderActionValues extends AbstractEnum {\n\n  const MARK_SEEN = 'MARK_SEEN';\n  const REACT = 'REACT';\n  const TYPING_OFF = 'TYPING_OFF';\n  const TYPING_ON = 'TYPING_ON';\n  const UNREACT = 'UNREACT';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageSubscribedFieldsValues getInstance()\n */\nclass PageSubscribedFieldsValues extends AbstractEnum {\n\n  const AFFILIATION = 'affiliation';\n  const ATTIRE = 'attire';\n  const AWARDS = 'awards';\n  const BIO = 'bio';\n  const BIRTHDAY = 'birthday';\n  const CATEGORY = 'category';\n  const CHECKINS = 'checkins';\n  const COMPANY_OVERVIEW = 'company_overview';\n  const CONVERSATIONS = 'conversations';\n  const CULINARY_TEAM = 'culinary_team';\n  const CURRENT_LOCATION = 'current_location';\n  const DESCRIPTION = 'description';\n  const EMAIL = 'email';\n  const FEATURE_ACCESS_LIST = 'feature_access_list';\n  const FEED = 'feed';\n  const FOUNDED = 'founded';\n  const GENERAL_INFO = 'general_info';\n  const GENERAL_MANAGER = 'general_manager';\n  const GROUP_FEED = 'group_feed';\n  const HOMETOWN = 'hometown';\n  const HOURS = 'hours';\n  const IN_THREAD_LEAD_FORM_SUBMIT = 'in_thread_lead_form_submit';\n  const INBOX_LABELS = 'inbox_labels';\n  const INVOICE_ACCESS_BANK_SLIP_EVENTS = 'invoice_access_bank_slip_events';\n  const INVOICE_ACCESS_INVOICE_CHANGE = 'invoice_access_invoice_change';\n  const INVOICE_ACCESS_INVOICE_DRAFT_CHANGE = 'invoice_access_invoice_draft_change';\n  const INVOICE_ACCESS_ONBOARDING_STATUS_ACTIVE = 'invoice_access_onboarding_status_active';\n  const LEADGEN = 'leadgen';\n  const LEADGEN_FAT = 'leadgen_fat';\n  const LIVE_VIDEOS = 'live_videos';\n  const LOCAL_DELIVERY = 'local_delivery';\n  const LOCATION = 'location';\n  const MCOM_INVOICE_CHANGE = 'mcom_invoice_change';\n  const MEMBERS = 'members';\n  const MENTION = 'mention';\n  const MERCHANT_REVIEW = 'merchant_review';\n  const MESSAGE_CONTEXT = 'message_context';\n  const MESSAGE_DELIVERIES = 'message_deliveries';\n  const MESSAGE_ECHOES = 'message_echoes';\n  const MESSAGE_MENTION = 'message_mention';\n  const MESSAGE_REACTIONS = 'message_reactions';\n  const MESSAGE_READS = 'message_reads';\n  const MESSAGES = 'messages';\n  const MESSAGING_ACCOUNT_LINKING = 'messaging_account_linking';\n  const MESSAGING_APPOINTMENTS = 'messaging_appointments';\n  const MESSAGING_CHECKOUT_UPDATES = 'messaging_checkout_updates';\n  const MESSAGING_CUSTOMER_INFORMATION = 'messaging_customer_information';\n  const MESSAGING_DIRECT_SENDS = 'messaging_direct_sends';\n  const MESSAGING_FBLOGIN_ACCOUNT_LINKING = 'messaging_fblogin_account_linking';\n  const MESSAGING_FEEDBACK = 'messaging_feedback';\n  const MESSAGING_GAME_PLAYS = 'messaging_game_plays';\n  const MESSAGING_HANDOVERS = 'messaging_handovers';\n  const MESSAGING_OPTINS = 'messaging_optins';\n  const MESSAGING_OPTOUTS = 'messaging_optouts';\n  const MESSAGING_PAYMENTS = 'messaging_payments';\n  const MESSAGING_POLICY_ENFORCEMENT = 'messaging_policy_enforcement';\n  const MESSAGING_POSTBACKS = 'messaging_postbacks';\n  const MESSAGING_PRE_CHECKOUTS = 'messaging_pre_checkouts';\n  const MESSAGING_REFERRALS = 'messaging_referrals';\n  const MISSION = 'mission';\n  const NAME = 'name';\n  const PAGE_ABOUT_STORY = 'page_about_story';\n  const PAGE_CHANGE_PROPOSAL = 'page_change_proposal';\n  const PAGE_UPCOMING_CHANGE = 'page_upcoming_change';\n  const PARKING = 'parking';\n  const PAYMENT_OPTIONS = 'payment_options';\n  const PERSONAL_INFO = 'personal_info';\n  const PERSONAL_INTERESTS = 'personal_interests';\n  const PHONE = 'phone';\n  const PICTURE = 'picture';\n  const PRICE_RANGE = 'price_range';\n  const PRODUCT_REVIEW = 'product_review';\n  const PRODUCTS = 'products';\n  const PUBLIC_TRANSIT = 'public_transit';\n  const PUBLISHER_SUBSCRIPTIONS = 'publisher_subscriptions';\n  const RATINGS = 'ratings';\n  const REGISTRATION = 'registration';\n  const SEND_CART = 'send_cart';\n  const STANDBY = 'standby';\n  const USER_ACTION = 'user_action';\n  const VIDEO_TEXT_QUESTION_RESPONSES = 'video_text_question_responses';\n  const VIDEOS = 'videos';\n  const WEBSITE = 'website';\n}\n", "num_lines": 124}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageSuggestionActionValues getInstance()\n */\nclass PageSuggestionActionValues extends AbstractEnum {\n\n  const ACCEPT = 'ACCEPT';\n  const DISMISS = 'DISMISS';\n  const IMPRESSION = 'IMPRESSION';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageTargetSurfaceValues getInstance()\n */\nclass PageTargetSurfaceValues extends AbstractEnum {\n\n  const STORY = 'STORY';\n  const TIMELINE = 'TIMELINE';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageTasksValues getInstance()\n */\nclass PageTasksValues extends AbstractEnum {\n\n  const ADVERTISE = 'ADVERTISE';\n  const ANALYZE = 'ANALYZE';\n  const CASHIER_ROLE = 'CASHIER_ROLE';\n  const CREATE_CONTENT = 'CREATE_CONTENT';\n  const MANAGE = 'MANAGE';\n  const MANAGE_JOBS = 'MANAGE_JOBS';\n  const MANAGE_LEADS = 'MANAGE_LEADS';\n  const MESSAGING = 'MESSAGING';\n  const MODERATE = 'MODERATE';\n  const MODERATE_COMMUNITY = 'MODERATE_COMMUNITY';\n  const PAGES_MESSAGING = 'PAGES_MESSAGING';\n  const PAGES_MESSAGING_SUBSCRIPTIONS = 'PAGES_MESSAGING_SUBSCRIPTIONS';\n  const PROFILE_PLUS_ADVERTISE = 'PROFILE_PLUS_ADVERTISE';\n  const PROFILE_PLUS_ANALYZE = 'PROFILE_PLUS_ANALYZE';\n  const PROFILE_PLUS_CREATE_CONTENT = 'PROFILE_PLUS_CREATE_CONTENT';\n  const PROFILE_PLUS_FACEBOOK_ACCESS = 'PROFILE_PLUS_FACEBOOK_ACCESS';\n  const PROFILE_PLUS_FULL_CONTROL = 'PROFILE_PLUS_FULL_CONTROL';\n  const PROFILE_PLUS_MANAGE = 'PROFILE_PLUS_MANAGE';\n  const PROFILE_PLUS_MANAGE_LEADS = 'PROFILE_PLUS_MANAGE_LEADS';\n  const PROFILE_PLUS_MESSAGING = 'PROFILE_PLUS_MESSAGING';\n  const PROFILE_PLUS_MODERATE = 'PROFILE_PLUS_MODERATE';\n  const PROFILE_PLUS_MODERATE_DELEGATE_COMMUNITY = 'PROFILE_PLUS_MODERATE_DELEGATE_COMMUNITY';\n  const PROFILE_PLUS_REVENUE = 'PROFILE_PLUS_REVENUE';\n  const READ_PAGE_MAILBOXES = 'READ_PAGE_MAILBOXES';\n  const VIEW_MONETIZATION_INSIGHTS = 'VIEW_MONETIZATION_INSIGHTS';\n}\n", "num_lines": 66}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageTemporaryStatusValues getInstance()\n */\nclass PageTemporaryStatusValues extends AbstractEnum {\n\n  const DIFFERENTLY_OPEN = 'DIFFERENTLY_OPEN';\n  const NO_DATA = 'NO_DATA';\n  const OPERATING_AS_USUAL = 'OPERATING_AS_USUAL';\n  const TEMPORARILY_CLOSED = 'TEMPORARILY_CLOSED';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @deprecated page_types are read-only in v2.7 and to be removed in v2.8\n * @method static PageTypes getInstance()\n */\nclass PageTypes extends AbstractEnum {\n\n  const DESKTOP_FEED = 'desktopfeed';\n  const HOME = 'home';\n  const INSTAGRAM_STREAM = 'instagramstream';\n  const LEGACY_EXTERNAL = 'legacyexternal';\n  const LOGOUT = 'logout';\n  const MOBILE_EXTERNAL = 'mobileexternal';\n  const MOBILE_FEED = 'mobilefeed';\n  const RIGHT_COLUMN = 'rightcolumn';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PageUnpublishedContentTypeValues getInstance()\n */\nclass PageUnpublishedContentTypeValues extends AbstractEnum {\n\n  const ADS_POST = 'ADS_POST';\n  const DRAFT = 'DRAFT';\n  const INLINE_CREATED = 'INLINE_CREATED';\n  const PUBLISHED = 'PUBLISHED';\n  const REVIEWABLE_BRANDED_CONTENT = 'REVIEWABLE_BRANDED_CONTENT';\n  const SCHEDULED = 'SCHEDULED';\n  const SCHEDULED_RECURRING = 'SCHEDULED_RECURRING';\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PaymentEnginePaymentReasonValues getInstance()\n */\nclass PaymentEnginePaymentReasonValues extends AbstractEnum {\n\n  const BANNED_USER = 'BANNED_USER';\n  const DENIED_REFUND = 'DENIED_REFUND';\n  const GRANTED_REPLACEMENT_ITEM = 'GRANTED_REPLACEMENT_ITEM';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PermissionStatusValues getInstance()\n */\nclass PermissionStatusValues extends AbstractEnum {\n\n  const DECLINED = 'declined';\n  const EXPIRED = 'expired';\n  const GRANTED = 'granted';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PhotoBackdatedTimeGranularityValues getInstance()\n */\nclass PhotoBackdatedTimeGranularityValues extends AbstractEnum {\n\n  const DAY = 'day';\n  const HOUR = 'hour';\n  const MIN = 'min';\n  const MONTH = 'month';\n  const NONE = 'none';\n  const YEAR = 'year';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PhotoTypeValues getInstance()\n */\nclass PhotoTypeValues extends AbstractEnum {\n\n  const PROFILE = 'profile';\n  const TAGGED = 'tagged';\n  const UPLOADED = 'uploaded';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PhotoUnpublishedContentTypeValues getInstance()\n */\nclass PhotoUnpublishedContentTypeValues extends AbstractEnum {\n\n  const ADS_POST = 'ADS_POST';\n  const DRAFT = 'DRAFT';\n  const INLINE_CREATED = 'INLINE_CREATED';\n  const PUBLISHED = 'PUBLISHED';\n  const REVIEWABLE_BRANDED_CONTENT = 'REVIEWABLE_BRANDED_CONTENT';\n  const SCHEDULED = 'SCHEDULED';\n  const SCHEDULED_RECURRING = 'SCHEDULED_RECURRING';\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PostBackdatedTimeGranularityValues getInstance()\n */\nclass PostBackdatedTimeGranularityValues extends AbstractEnum {\n\n  const DAY = 'day';\n  const HOUR = 'hour';\n  const MIN = 'min';\n  const MONTH = 'month';\n  const NONE = 'none';\n  const YEAR = 'year';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PostCheckinEntryPointValues getInstance()\n */\nclass PostCheckinEntryPointValues extends AbstractEnum {\n\n  const BRANDING_CHECKIN = 'BRANDING_CHECKIN';\n  const BRANDING_OTHER = 'BRANDING_OTHER';\n  const BRANDING_PHOTO = 'BRANDING_PHOTO';\n  const BRANDING_STATUS = 'BRANDING_STATUS';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PostFeedStoryVisibilityValues getInstance()\n */\nclass PostFeedStoryVisibilityValues extends AbstractEnum {\n\n  const HIDDEN = 'hidden';\n  const VISIBLE = 'visible';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PostFormattingValues getInstance()\n */\nclass PostFormattingValues extends AbstractEnum {\n\n  const MARKDOWN = 'MARKDOWN';\n  const PLAINTEXT = 'PLAINTEXT';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PostPlaceAttachmentSettingValues getInstance()\n */\nclass PostPlaceAttachmentSettingValues extends AbstractEnum {\n\n  const VALUE_1 = '1';\n  const VALUE_2 = '2';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PostPostingToRedspaceValues getInstance()\n */\nclass PostPostingToRedspaceValues extends AbstractEnum {\n\n  const DISABLED = 'disabled';\n  const ENABLED = 'enabled';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PostPostSurfacesBlacklistValues getInstance()\n */\nclass PostPostSurfacesBlacklistValues extends AbstractEnum {\n\n  const VALUE_1 = '1';\n  const VALUE_2 = '2';\n  const VALUE_3 = '3';\n  const VALUE_4 = '4';\n  const VALUE_5 = '5';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PostTargetSurfaceValues getInstance()\n */\nclass PostTargetSurfaceValues extends AbstractEnum {\n\n  const STORY = 'STORY';\n  const TIMELINE = 'TIMELINE';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PostTimelineVisibilityValues getInstance()\n */\nclass PostTimelineVisibilityValues extends AbstractEnum {\n\n  const FORCED_ALLOW = 'forced_allow';\n  const HIDDEN = 'hidden';\n  const NORMAL = 'normal';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PostUnpublishedContentTypeValues getInstance()\n */\nclass PostUnpublishedContentTypeValues extends AbstractEnum {\n\n  const ADS_POST = 'ADS_POST';\n  const DRAFT = 'DRAFT';\n  const INLINE_CREATED = 'INLINE_CREATED';\n  const PUBLISHED = 'PUBLISHED';\n  const REVIEWABLE_BRANDED_CONTENT = 'REVIEWABLE_BRANDED_CONTENT';\n  const SCHEDULED = 'SCHEDULED';\n  const SCHEDULED_RECURRING = 'SCHEDULED_RECURRING';\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static PrivateLiftStudyInstanceOperationValues getInstance()\n */\nclass PrivateLiftStudyInstanceOperationValues extends AbstractEnum {\n\n  const AGGREGATE = 'AGGREGATE';\n  const CANCEL = 'CANCEL';\n  const COMPUTE = 'COMPUTE';\n  const ID_MATCH = 'ID_MATCH';\n  const NEXT = 'NEXT';\n  const NONE = 'NONE';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductCatalogCategoryCategorizationCriteriaValues getInstance()\n */\nclass ProductCatalogCategoryCategorizationCriteriaValues extends AbstractEnum {\n\n  const BRAND = 'BRAND';\n  const CATEGORY = 'CATEGORY';\n  const PRODUCT_TYPE = 'PRODUCT_TYPE';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductCatalogDataSourceIngestionSourceTypeValues getInstance()\n */\nclass ProductCatalogDataSourceIngestionSourceTypeValues extends AbstractEnum {\n\n  const ALL = 'ALL';\n  const PRIMARY = 'PRIMARY';\n  const SUPPLEMENTARY = 'SUPPLEMENTARY';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductCatalogDiagnosticGroupAffectedChannelsValues getInstance()\n */\nclass ProductCatalogDiagnosticGroupAffectedChannelsValues extends AbstractEnum {\n\n  const BUSINESS_INBOX_IN_MESSENGER = 'business_inbox_in_messenger';\n  const SHOPS = 'shops';\n  const TEST_CAPABILITY = 'test_capability';\n  const UNIVERSAL_CHECKOUT = 'universal_checkout';\n  const US_MARKETPLACE = 'us_marketplace';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductCatalogDiagnosticGroupAffectedEntitiesValues getInstance()\n */\nclass ProductCatalogDiagnosticGroupAffectedEntitiesValues extends AbstractEnum {\n\n  const PRODUCT_CATALOG = 'product_catalog';\n  const PRODUCT_ITEM = 'product_item';\n  const PRODUCT_SET = 'product_set';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductCatalogDiagnosticGroupAffectedEntityValues getInstance()\n */\nclass ProductCatalogDiagnosticGroupAffectedEntityValues extends AbstractEnum {\n\n  const PRODUCT_CATALOG = 'product_catalog';\n  const PRODUCT_ITEM = 'product_item';\n  const PRODUCT_SET = 'product_set';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductCatalogDiagnosticGroupAffectedFeaturesValues getInstance()\n */\nclass ProductCatalogDiagnosticGroupAffectedFeaturesValues extends AbstractEnum {\n\n  const AUGMENTED_REALITY = 'augmented_reality';\n  const CHECKOUT = 'checkout';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductCatalogDiagnosticGroupSeveritiesValues getInstance()\n */\nclass ProductCatalogDiagnosticGroupSeveritiesValues extends AbstractEnum {\n\n  const MUST_FIX = 'MUST_FIX';\n  const OPPORTUNITY = 'OPPORTUNITY';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductCatalogDiagnosticGroupSeverityValues getInstance()\n */\nclass ProductCatalogDiagnosticGroupSeverityValues extends AbstractEnum {\n\n  const MUST_FIX = 'MUST_FIX';\n  const OPPORTUNITY = 'OPPORTUNITY';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductCatalogDiagnosticGroupTypesValues getInstance()\n */\nclass ProductCatalogDiagnosticGroupTypesValues extends AbstractEnum {\n\n  const AR_VISIBILITY_ISSUES = 'AR_VISIBILITY_ISSUES';\n  const ATTRIBUTES_INVALID = 'ATTRIBUTES_INVALID';\n  const ATTRIBUTES_MISSING = 'ATTRIBUTES_MISSING';\n  const CATEGORY = 'CATEGORY';\n  const CHECKOUT = 'CHECKOUT';\n  const IMAGE_QUALITY = 'IMAGE_QUALITY';\n  const LOW_QUALITY_TITLE_AND_DESCRIPTION = 'LOW_QUALITY_TITLE_AND_DESCRIPTION';\n  const POLICY_VIOLATION = 'POLICY_VIOLATION';\n  const SHOPS_VISIBILITY_ISSUES = 'SHOPS_VISIBILITY_ISSUES';\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductCatalogDiagnosticGroupTypeValues getInstance()\n */\nclass ProductCatalogDiagnosticGroupTypeValues extends AbstractEnum {\n\n  const AR_VISIBILITY_ISSUES = 'AR_VISIBILITY_ISSUES';\n  const ATTRIBUTES_INVALID = 'ATTRIBUTES_INVALID';\n  const ATTRIBUTES_MISSING = 'ATTRIBUTES_MISSING';\n  const CATEGORY = 'CATEGORY';\n  const CHECKOUT = 'CHECKOUT';\n  const IMAGE_QUALITY = 'IMAGE_QUALITY';\n  const LOW_QUALITY_TITLE_AND_DESCRIPTION = 'LOW_QUALITY_TITLE_AND_DESCRIPTION';\n  const POLICY_VIOLATION = 'POLICY_VIOLATION';\n  const SHOPS_VISIBILITY_ISSUES = 'SHOPS_VISIBILITY_ISSUES';\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductCatalogItemSubTypeValues getInstance()\n */\nclass ProductCatalogItemSubTypeValues extends AbstractEnum {\n\n  const APPLIANCES = 'APPLIANCES';\n  const BABY_FEEDING = 'BABY_FEEDING';\n  const BABY_TRANSPORT = 'BABY_TRANSPORT';\n  const BEAUTY = 'BEAUTY';\n  const BEDDING = 'BEDDING';\n  const CAMERAS = 'CAMERAS';\n  const CELL_PHONES_AND_SMART_WATCHES = 'CELL_PHONES_AND_SMART_WATCHES';\n  const CLEANING_SUPPLIES = 'CLEANING_SUPPLIES';\n  const CLOTHING = 'CLOTHING';\n  const CLOTHING_ACCESSORIES = 'CLOTHING_ACCESSORIES';\n  const COMPUTERS_AND_TABLETS = 'COMPUTERS_AND_TABLETS';\n  const DIAPERING_AND_POTTY_TRAINING = 'DIAPERING_AND_POTTY_TRAINING';\n  const ELECTRONICS_ACCESSORIES = 'ELECTRONICS_ACCESSORIES';\n  const FURNITURE = 'FURNITURE';\n  const HEALTH = 'HEALTH';\n  const HOME_GOODS = 'HOME_GOODS';\n  const JEWELRY = 'JEWELRY';\n  const NURSERY = 'NURSERY';\n  const PRINTERS_AND_SCANNERS = 'PRINTERS_AND_SCANNERS';\n  const PROJECTORS = 'PROJECTORS';\n  const SHOES_AND_FOOTWEAR = 'SHOES_AND_FOOTWEAR';\n  const SOFTWARE = 'SOFTWARE';\n  const TOYS = 'TOYS';\n  const TVS_AND_MONITORS = 'TVS_AND_MONITORS';\n  const VIDEO_GAME_CONSOLES_AND_VIDEO_GAMES = 'VIDEO_GAME_CONSOLES_AND_VIDEO_GAMES';\n  const WATCHES = 'WATCHES';\n}\n", "num_lines": 67}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductCatalogPermittedRolesValues getInstance()\n */\nclass ProductCatalogPermittedRolesValues extends AbstractEnum {\n\n  const ADMIN = 'ADMIN';\n  const ADVERTISER = 'ADVERTISER';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductCatalogPermittedTasksValues getInstance()\n */\nclass ProductCatalogPermittedTasksValues extends AbstractEnum {\n\n  const ADVERTISE = 'ADVERTISE';\n  const MANAGE = 'MANAGE';\n  const MANAGE_AR = 'MANAGE_AR';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductCatalogStandardValues getInstance()\n */\nclass ProductCatalogStandardValues extends AbstractEnum {\n\n  const GOOGLE = 'google';\n}\n", "num_lines": 42}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductCatalogTasksValues getInstance()\n */\nclass ProductCatalogTasksValues extends AbstractEnum {\n\n  const ADVERTISE = 'ADVERTISE';\n  const MANAGE = 'MANAGE';\n  const MANAGE_AR = 'MANAGE_AR';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductCatalogVerticalValues getInstance()\n */\nclass ProductCatalogVerticalValues extends AbstractEnum {\n\n  const ADOPTABLE_PETS = 'adoptable_pets';\n  const BOOKABLE = 'bookable';\n  const COMMERCE = 'commerce';\n  const DESTINATIONS = 'destinations';\n  const FLIGHTS = 'flights';\n  const HOME_LISTINGS = 'home_listings';\n  const HOTELS = 'hotels';\n  const JOBS = 'jobs';\n  const LOCAL_DELIVERY_SHIPPING_PROFILES = 'local_delivery_shipping_profiles';\n  const LOCAL_SERVICE_BUSINESSES = 'local_service_businesses';\n  const OFFER_ITEMS = 'offer_items';\n  const OFFLINE_COMMERCE = 'offline_commerce';\n  const TICKETED_EXPERIENCES = 'ticketed_experiences';\n  const TRANSACTABLE_ITEMS = 'transactable_items';\n  const VEHICLES = 'vehicles';\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductEventStatBreakdownsValues getInstance()\n */\nclass ProductEventStatBreakdownsValues extends AbstractEnum {\n\n  const DEVICE_TYPE = 'DEVICE_TYPE';\n}\n", "num_lines": 42}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductEventStatDeviceTypeValues getInstance()\n */\nclass ProductEventStatDeviceTypeValues extends AbstractEnum {\n\n  const DESKTOP = 'desktop';\n  const MOBILE_ANDROID_PHONE = 'mobile_android_phone';\n  const MOBILE_ANDROID_TABLET = 'mobile_android_tablet';\n  const MOBILE_IPAD = 'mobile_ipad';\n  const MOBILE_IPHONE = 'mobile_iphone';\n  const MOBILE_IPOD = 'mobile_ipod';\n  const MOBILE_PHONE = 'mobile_phone';\n  const MOBILE_TABLET = 'mobile_tablet';\n  const MOBILE_WINDOWS_PHONE = 'mobile_windows_phone';\n  const UNKNOWN = 'unknown';\n}\n", "num_lines": 51}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductEventStatEventValues getInstance()\n */\nclass ProductEventStatEventValues extends AbstractEnum {\n\n  const ADDTOCART = 'AddToCart';\n  const ADDTOWISHLIST = 'AddToWishlist';\n  const INITIATECHECKOUT = 'InitiateCheckout';\n  const LEAD = 'Lead';\n  const PURCHASE = 'Purchase';\n  const SEARCH = 'Search';\n  const SUBSCRIBE = 'Subscribe';\n  const VIEWCONTENT = 'ViewContent';\n}\n", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductFeedDelimiterValues getInstance()\n */\nclass ProductFeedDelimiterValues extends AbstractEnum {\n\n  const AUTODETECT = 'AUTODETECT';\n  const BAR = 'BAR';\n  const COMMA = 'COMMA';\n  const SEMICOLON = 'SEMICOLON';\n  const TAB = 'TAB';\n  const TILDE = 'TILDE';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductFeedEncodingValues getInstance()\n */\nclass ProductFeedEncodingValues extends AbstractEnum {\n\n  const AUTODETECT = 'AUTODETECT';\n  const LATIN1 = 'LATIN1';\n  const UTF16BE = 'UTF16BE';\n  const UTF16LE = 'UTF16LE';\n  const UTF32BE = 'UTF32BE';\n  const UTF32LE = 'UTF32LE';\n  const UTF8 = 'UTF8';\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductFeedFeedTypeValues getInstance()\n */\nclass ProductFeedFeedTypeValues extends AbstractEnum {\n\n  const AUTOMOTIVE_MODEL = 'AUTOMOTIVE_MODEL';\n  const DESTINATION = 'DESTINATION';\n  const FLIGHT = 'FLIGHT';\n  const HOME_LISTING = 'HOME_LISTING';\n  const HOTEL = 'HOTEL';\n  const HOTEL_ROOM = 'HOTEL_ROOM';\n  const LOCAL_INVENTORY = 'LOCAL_INVENTORY';\n  const MEDIA_TITLE = 'MEDIA_TITLE';\n  const OFFER = 'OFFER';\n  const PRODUCTS = 'PRODUCTS';\n  const TRANSACTABLE_ITEMS = 'TRANSACTABLE_ITEMS';\n  const VEHICLES = 'VEHICLES';\n  const VEHICLE_OFFER = 'VEHICLE_OFFER';\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductFeedIngestionSourceTypeValues getInstance()\n */\nclass ProductFeedIngestionSourceTypeValues extends AbstractEnum {\n\n  const PRIMARY_FEED = 'primary_feed';\n  const SUPPLEMENTARY_FEED = 'supplementary_feed';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductFeedItemSubTypeValues getInstance()\n */\nclass ProductFeedItemSubTypeValues extends AbstractEnum {\n\n  const APPLIANCES = 'APPLIANCES';\n  const BABY_FEEDING = 'BABY_FEEDING';\n  const BABY_TRANSPORT = 'BABY_TRANSPORT';\n  const BEAUTY = 'BEAUTY';\n  const BEDDING = 'BEDDING';\n  const CAMERAS = 'CAMERAS';\n  const CELL_PHONES_AND_SMART_WATCHES = 'CELL_PHONES_AND_SMART_WATCHES';\n  const CLEANING_SUPPLIES = 'CLEANING_SUPPLIES';\n  const CLOTHING = 'CLOTHING';\n  const CLOTHING_ACCESSORIES = 'CLOTHING_ACCESSORIES';\n  const COMPUTERS_AND_TABLETS = 'COMPUTERS_AND_TABLETS';\n  const DIAPERING_AND_POTTY_TRAINING = 'DIAPERING_AND_POTTY_TRAINING';\n  const ELECTRONICS_ACCESSORIES = 'ELECTRONICS_ACCESSORIES';\n  const FURNITURE = 'FURNITURE';\n  const HEALTH = 'HEALTH';\n  const HOME_GOODS = 'HOME_GOODS';\n  const JEWELRY = 'JEWELRY';\n  const NURSERY = 'NURSERY';\n  const PRINTERS_AND_SCANNERS = 'PRINTERS_AND_SCANNERS';\n  const PROJECTORS = 'PROJECTORS';\n  const SHOES_AND_FOOTWEAR = 'SHOES_AND_FOOTWEAR';\n  const SOFTWARE = 'SOFTWARE';\n  const TOYS = 'TOYS';\n  const TVS_AND_MONITORS = 'TVS_AND_MONITORS';\n  const VIDEO_GAME_CONSOLES_AND_VIDEO_GAMES = 'VIDEO_GAME_CONSOLES_AND_VIDEO_GAMES';\n  const WATCHES = 'WATCHES';\n}\n", "num_lines": 67}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductFeedOverrideTypeValues getInstance()\n */\nclass ProductFeedOverrideTypeValues extends AbstractEnum {\n\n  const BATCH_API_LANGUAGE_OR_COUNTRY = 'BATCH_API_LANGUAGE_OR_COUNTRY';\n  const CATALOG_SEGMENT_CUSTOMIZE_DEFAULT = 'CATALOG_SEGMENT_CUSTOMIZE_DEFAULT';\n  const COUNTRY = 'COUNTRY';\n  const LANGUAGE = 'LANGUAGE';\n  const LANGUAGE_AND_COUNTRY = 'LANGUAGE_AND_COUNTRY';\n  const LOCAL = 'LOCAL';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductFeedQuotedFieldsModeValues getInstance()\n */\nclass ProductFeedQuotedFieldsModeValues extends AbstractEnum {\n\n  const AUTODETECT = 'AUTODETECT';\n  const OFF = 'OFF';\n  const ON = 'ON';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductFeedRuleRuleTypeValues getInstance()\n */\nclass ProductFeedRuleRuleTypeValues extends AbstractEnum {\n\n  const FALLBACK_RULE = 'fallback_rule';\n  const LETTER_CASE_RULE = 'letter_case_rule';\n  const MAPPING_RULE = 'mapping_rule';\n  const REGEX_REPLACE_RULE = 'regex_replace_rule';\n  const VALUE_MAPPING_RULE = 'value_mapping_rule';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductFeedScheduleIntervalValues getInstance()\n */\nclass ProductFeedScheduleIntervalValues extends AbstractEnum {\n\n  const DAILY = 'DAILY';\n  const HOURLY = 'HOURLY';\n  const MONTHLY = 'MONTHLY';\n  const WEEKLY = 'WEEKLY';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductFeedUploadErrorAffectedSurfacesValues getInstance()\n */\nclass ProductFeedUploadErrorAffectedSurfacesValues extends AbstractEnum {\n\n  const DYNAMIC_ADS = 'Dynamic Ads';\n  const MARKETPLACE = 'Marketplace';\n  const US_MARKETPLACE = 'US Marketplace';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductFeedUploadErrorErrorPriorityValues getInstance()\n */\nclass ProductFeedUploadErrorErrorPriorityValues extends AbstractEnum {\n\n  const HIGH = 'HIGH';\n  const LOW = 'LOW';\n  const MEDIUM = 'MEDIUM';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductFeedUploadErrorSeverityValues getInstance()\n */\nclass ProductFeedUploadErrorSeverityValues extends AbstractEnum {\n\n  const FATAL = 'fatal';\n  const WARNING = 'warning';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductFeedUploadInputMethodValues getInstance()\n */\nclass ProductFeedUploadInputMethodValues extends AbstractEnum {\n\n  const GOOGLE_SHEETS_FETCH = 'Google Sheets Fetch';\n  const MANUAL_UPLOAD = 'Manual Upload';\n  const REUPLOAD_LAST_FILE = 'Reupload Last File';\n  const SERVER_FETCH = 'Server Fetch';\n  const USER_INITIATED_SERVER_FETCH = 'User initiated server fetch';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductItemAgeGroupValues getInstance()\n */\nclass ProductItemAgeGroupValues extends AbstractEnum {\n\n  const ADULT = 'adult';\n  const ALL_AGES = 'all ages';\n  const INFANT = 'infant';\n  const KIDS = 'kids';\n  const NEWBORN = 'newborn';\n  const TEEN = 'teen';\n  const TODDLER = 'toddler';\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductItemARDataSurfacesValues getInstance()\n */\nclass ProductItemARDataSurfacesValues extends AbstractEnum {\n\n  const B2C_MARKETPLACE = 'B2C_MARKETPLACE';\n  const C2C_MARKETPLACE = 'C2C_MARKETPLACE';\n  const DA = 'DA';\n  const DAILY_DEALS = 'DAILY_DEALS';\n  const DAILY_DEALS_LEGACY = 'DAILY_DEALS_LEGACY';\n  const IG_PRODUCT_TAGGING = 'IG_PRODUCT_TAGGING';\n  const MARKETPLACE = 'MARKETPLACE';\n  const MARKETPLACE_ADS_DEPRECATED = 'MARKETPLACE_ADS_DEPRECATED';\n  const MARKETPLACE_SHOPS = 'MARKETPLACE_SHOPS';\n  const MINI_SHOPS = 'MINI_SHOPS';\n  const OFFLINE_CONVERSIONS = 'OFFLINE_CONVERSIONS';\n  const SHOPS = 'SHOPS';\n  const UNIVERSAL_CHECKOUT = 'UNIVERSAL_CHECKOUT';\n  const WHATSAPP = 'WHATSAPP';\n}\n", "num_lines": 55}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductItemAvailabilityValues getInstance()\n */\nclass ProductItemAvailabilityValues extends AbstractEnum {\n\n  const AVAILABLE_FOR_ORDER = 'available for order';\n  const DISCONTINUED = 'discontinued';\n  const IN_STOCK = 'in stock';\n  const OUT_OF_STOCK = 'out of stock';\n  const PENDING = 'pending';\n  const PREORDER = 'preorder';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductItemCommerceTaxCategoryValues getInstance()\n */\nclass ProductItemCommerceTaxCategoryValues extends AbstractEnum {\n\n  const FB_ANIMAL = 'FB_ANIMAL';\n  const FB_ANIMAL_SUPP = 'FB_ANIMAL_SUPP';\n  const FB_APRL = 'FB_APRL';\n  const FB_APRL_ACCESSORIES = 'FB_APRL_ACCESSORIES';\n  const FB_APRL_ATHL_UNIF = 'FB_APRL_ATHL_UNIF';\n  const FB_APRL_CASES = 'FB_APRL_CASES';\n  const FB_APRL_CLOTHING = 'FB_APRL_CLOTHING';\n  const FB_APRL_COSTUME = 'FB_APRL_COSTUME';\n  const FB_APRL_CSTM = 'FB_APRL_CSTM';\n  const FB_APRL_FORMAL = 'FB_APRL_FORMAL';\n  const FB_APRL_HANDBAG = 'FB_APRL_HANDBAG';\n  const FB_APRL_JEWELRY = 'FB_APRL_JEWELRY';\n  const FB_APRL_SHOE = 'FB_APRL_SHOE';\n  const FB_APRL_SHOE_ACC = 'FB_APRL_SHOE_ACC';\n  const FB_APRL_SWIM = 'FB_APRL_SWIM';\n  const FB_APRL_SWIM_CHIL = 'FB_APRL_SWIM_CHIL';\n  const FB_APRL_SWIM_CVR = 'FB_APRL_SWIM_CVR';\n  const FB_ARTS = 'FB_ARTS';\n  const FB_ARTS_HOBBY = 'FB_ARTS_HOBBY';\n  const FB_ARTS_PARTY = 'FB_ARTS_PARTY';\n  const FB_ARTS_PARTY_GIFT_CARD = 'FB_ARTS_PARTY_GIFT_CARD';\n  const FB_ARTS_TICKET = 'FB_ARTS_TICKET';\n  const FB_BABY = 'FB_BABY';\n  const FB_BABY_BATH = 'FB_BABY_BATH';\n  const FB_BABY_BLANKET = 'FB_BABY_BLANKET';\n  const FB_BABY_DIAPER = 'FB_BABY_DIAPER';\n  const FB_BABY_GIFT_SET = 'FB_BABY_GIFT_SET';\n  const FB_BABY_HEALTH = 'FB_BABY_HEALTH';\n  const FB_BABY_NURSING = 'FB_BABY_NURSING';\n  const FB_BABY_POTTY_TRN = 'FB_BABY_POTTY_TRN';\n  const FB_BABY_SAFE = 'FB_BABY_SAFE';\n  const FB_BABY_TOYS = 'FB_BABY_TOYS';\n  const FB_BABY_TRANSPORT = 'FB_BABY_TRANSPORT';\n  const FB_BABY_TRANSPORT_ACC = 'FB_BABY_TRANSPORT_ACC';\n  const FB_BAGS = 'FB_BAGS';\n  const FB_BAGS_BKPK = 'FB_BAGS_BKPK';\n  const FB_BAGS_BOXES = 'FB_BAGS_BOXES';\n  const FB_BAGS_BRFCS = 'FB_BAGS_BRFCS';\n  const FB_BAGS_CSMT_BAG = 'FB_BAGS_CSMT_BAG';\n  const FB_BAGS_DFFL = 'FB_BAGS_DFFL';\n  const FB_BAGS_DIPR = 'FB_BAGS_DIPR';\n  const FB_BAGS_FNNY = 'FB_BAGS_FNNY';\n  const FB_BAGS_GRMT = 'FB_BAGS_GRMT';\n  const FB_BAGS_LUGG = 'FB_BAGS_LUGG';\n  const FB_BAGS_LUG_ACC = 'FB_BAGS_LUG_ACC';\n  const FB_BAGS_MSGR = 'FB_BAGS_MSGR';\n  const FB_BAGS_TOTE = 'FB_BAGS_TOTE';\n  const FB_BAGS_TRN_CAS = 'FB_BAGS_TRN_CAS';\n  const FB_BLDG = 'FB_BLDG';\n  const FB_BLDG_ACC = 'FB_BLDG_ACC';\n  const FB_BLDG_CNSMB = 'FB_BLDG_CNSMB';\n  const FB_BLDG_FENCE = 'FB_BLDG_FENCE';\n  const FB_BLDG_FUEL_TNK = 'FB_BLDG_FUEL_TNK';\n  const FB_BLDG_HT_VNT = 'FB_BLDG_HT_VNT';\n  const FB_BLDG_LOCK = 'FB_BLDG_LOCK';\n  const FB_BLDG_MATRL = 'FB_BLDG_MATRL';\n  const FB_BLDG_PLMB = 'FB_BLDG_PLMB';\n  const FB_BLDG_PUMP = 'FB_BLDG_PUMP';\n  const FB_BLDG_PWRS = 'FB_BLDG_PWRS';\n  const FB_BLDG_STR_TANK = 'FB_BLDG_STR_TANK';\n  const FB_BLDG_S_ENG = 'FB_BLDG_S_ENG';\n  const FB_BLDG_TL_ACC = 'FB_BLDG_TL_ACC';\n  const FB_BLDG_TOOL = 'FB_BLDG_TOOL';\n  const FB_BUSIND = 'FB_BUSIND';\n  const FB_BUSIND_ADVERTISING = 'FB_BUSIND_ADVERTISING';\n  const FB_BUSIND_AGRICULTURE = 'FB_BUSIND_AGRICULTURE';\n  const FB_BUSIND_AUTOMATION = 'FB_BUSIND_AUTOMATION';\n  const FB_BUSIND_HEAVY_MACH = 'FB_BUSIND_HEAVY_MACH';\n  const FB_BUSIND_LAB = 'FB_BUSIND_LAB';\n  const FB_BUSIND_MEDICAL = 'FB_BUSIND_MEDICAL';\n  const FB_BUSIND_RETAIL = 'FB_BUSIND_RETAIL';\n  const FB_BUSIND_SANITARY_CT = 'FB_BUSIND_SANITARY_CT';\n  const FB_BUSIND_SIGN = 'FB_BUSIND_SIGN';\n  const FB_BUSIND_STORAGE = 'FB_BUSIND_STORAGE';\n  const FB_BUSIND_STORAGE_ACC = 'FB_BUSIND_STORAGE_ACC';\n  const FB_BUSIND_WORK_GEAR = 'FB_BUSIND_WORK_GEAR';\n  const FB_CAMERA_ACC = 'FB_CAMERA_ACC';\n  const FB_CAMERA_CAMERA = 'FB_CAMERA_CAMERA';\n  const FB_CAMERA_OPTIC = 'FB_CAMERA_OPTIC';\n  const FB_CAMERA_OPTICS = 'FB_CAMERA_OPTICS';\n  const FB_CAMERA_PHOTO = 'FB_CAMERA_PHOTO';\n  const FB_ELEC = 'FB_ELEC';\n  const FB_ELEC_ACC = 'FB_ELEC_ACC';\n  const FB_ELEC_ARCDADE = 'FB_ELEC_ARCDADE';\n  const FB_ELEC_AUDIO = 'FB_ELEC_AUDIO';\n  const FB_ELEC_CIRCUIT = 'FB_ELEC_CIRCUIT';\n  const FB_ELEC_COMM = 'FB_ELEC_COMM';\n  const FB_ELEC_COMPUTER = 'FB_ELEC_COMPUTER';\n  const FB_ELEC_GPS_ACC = 'FB_ELEC_GPS_ACC';\n  const FB_ELEC_GPS_NAV = 'FB_ELEC_GPS_NAV';\n  const FB_ELEC_GPS_TRK = 'FB_ELEC_GPS_TRK';\n  const FB_ELEC_MARINE = 'FB_ELEC_MARINE';\n  const FB_ELEC_NETWORK = 'FB_ELEC_NETWORK';\n  const FB_ELEC_PART = 'FB_ELEC_PART';\n  const FB_ELEC_PRINT = 'FB_ELEC_PRINT';\n  const FB_ELEC_RADAR = 'FB_ELEC_RADAR';\n  const FB_ELEC_SFTWR = 'FB_ELEC_SFTWR';\n  const FB_ELEC_SPEED_RDR = 'FB_ELEC_SPEED_RDR';\n  const FB_ELEC_TELEVISION = 'FB_ELEC_TELEVISION';\n  const FB_ELEC_TOLL = 'FB_ELEC_TOLL';\n  const FB_ELEC_VIDEO = 'FB_ELEC_VIDEO';\n  const FB_ELEC_VID_GM_ACC = 'FB_ELEC_VID_GM_ACC';\n  const FB_ELEC_VID_GM_CNSL = 'FB_ELEC_VID_GM_CNSL';\n  const FB_FOOD = 'FB_FOOD';\n  const FB_FURN = 'FB_FURN';\n  const FB_FURN_BABY = 'FB_FURN_BABY';\n  const FB_FURN_BENCH = 'FB_FURN_BENCH';\n  const FB_FURN_CART = 'FB_FURN_CART';\n  const FB_FURN_CHAIR = 'FB_FURN_CHAIR';\n  const FB_FURN_CHAIR_ACC = 'FB_FURN_CHAIR_ACC';\n  const FB_FURN_DIVIDE = 'FB_FURN_DIVIDE';\n  const FB_FURN_DIVIDE_ACC = 'FB_FURN_DIVIDE_ACC';\n  const FB_FURN_ENT_CTR = 'FB_FURN_ENT_CTR';\n  const FB_FURN_FUTN = 'FB_FURN_FUTN';\n  const FB_FURN_FUTN_PAD = 'FB_FURN_FUTN_PAD';\n  const FB_FURN_OFFICE = 'FB_FURN_OFFICE';\n  const FB_FURN_OFFICE_ACC = 'FB_FURN_OFFICE_ACC';\n  const FB_FURN_OTTO = 'FB_FURN_OTTO';\n  const FB_FURN_OUTDOOR = 'FB_FURN_OUTDOOR';\n  const FB_FURN_OUTDOOR_ACC = 'FB_FURN_OUTDOOR_ACC';\n  const FB_FURN_SETS = 'FB_FURN_SETS';\n  const FB_FURN_SHELVE_ACC = 'FB_FURN_SHELVE_ACC';\n  const FB_FURN_SHLF = 'FB_FURN_SHLF';\n  const FB_FURN_SOFA = 'FB_FURN_SOFA';\n  const FB_FURN_SOFA_ACC = 'FB_FURN_SOFA_ACC';\n  const FB_FURN_STORAGE = 'FB_FURN_STORAGE';\n  const FB_FURN_TABL = 'FB_FURN_TABL';\n  const FB_FURN_TABL_ACC = 'FB_FURN_TABL_ACC';\n  const FB_GENERIC_TAXABLE = 'FB_GENERIC_TAXABLE';\n  const FB_HLTH = 'FB_HLTH';\n  const FB_HLTH_HLTH = 'FB_HLTH_HLTH';\n  const FB_HLTH_JWL_CR = 'FB_HLTH_JWL_CR';\n  const FB_HLTH_LILP_BLM = 'FB_HLTH_LILP_BLM';\n  const FB_HLTH_LTN_SPF = 'FB_HLTH_LTN_SPF';\n  const FB_HLTH_PRSL_CR = 'FB_HLTH_PRSL_CR';\n  const FB_HLTH_SKN_CR = 'FB_HLTH_SKN_CR';\n  const FB_HMGN = 'FB_HMGN';\n  const FB_HMGN_BATH = 'FB_HMGN_BATH';\n  const FB_HMGN_DCOR = 'FB_HMGN_DCOR';\n  const FB_HMGN_EMGY = 'FB_HMGN_EMGY';\n  const FB_HMGN_FPLC = 'FB_HMGN_FPLC';\n  const FB_HMGN_FPLC_ACC = 'FB_HMGN_FPLC_ACC';\n  const FB_HMGN_GS_SFT = 'FB_HMGN_GS_SFT';\n  const FB_HMGN_HS_ACC = 'FB_HMGN_HS_ACC';\n  const FB_HMGN_HS_APP = 'FB_HMGN_HS_APP';\n  const FB_HMGN_HS_SPL = 'FB_HMGN_HS_SPL';\n  const FB_HMGN_KTCN = 'FB_HMGN_KTCN';\n  const FB_HMGN_LAWN = 'FB_HMGN_LAWN';\n  const FB_HMGN_LGHT = 'FB_HMGN_LGHT';\n  const FB_HMGN_LINN = 'FB_HMGN_LINN';\n  const FB_HMGN_LT_ACC = 'FB_HMGN_LT_ACC';\n  const FB_HMGN_OTDR = 'FB_HMGN_OTDR';\n  const FB_HMGN_POOL = 'FB_HMGN_POOL';\n  const FB_HMGN_SCTY = 'FB_HMGN_SCTY';\n  const FB_HMGN_SMK_ACC = 'FB_HMGN_SMK_ACC';\n  const FB_HMGN_UMBR = 'FB_HMGN_UMBR';\n  const FB_HMGN_UMBR_ACC = 'FB_HMGN_UMBR_ACC';\n  const FB_MDIA = 'FB_MDIA';\n  const FB_MDIA_BOOK = 'FB_MDIA_BOOK';\n  const FB_MDIA_DVDS = 'FB_MDIA_DVDS';\n  const FB_MDIA_MAG = 'FB_MDIA_MAG';\n  const FB_MDIA_MANL = 'FB_MDIA_MANL';\n  const FB_MDIA_MUSC = 'FB_MDIA_MUSC';\n  const FB_MDIA_PRJ_PLN = 'FB_MDIA_PRJ_PLN';\n  const FB_MDIA_SHT_MUS = 'FB_MDIA_SHT_MUS';\n  const FB_OFFC = 'FB_OFFC';\n  const FB_OFFC_BKAC = 'FB_OFFC_BKAC';\n  const FB_OFFC_CRTS = 'FB_OFFC_CRTS';\n  const FB_OFFC_DSKP = 'FB_OFFC_DSKP';\n  const FB_OFFC_EQIP = 'FB_OFFC_EQIP';\n  const FB_OFFC_FLNG = 'FB_OFFC_FLNG';\n  const FB_OFFC_GNRL = 'FB_OFFC_GNRL';\n  const FB_OFFC_INSTM = 'FB_OFFC_INSTM';\n  const FB_OFFC_LP_DSK = 'FB_OFFC_LP_DSK';\n  const FB_OFFC_MATS = 'FB_OFFC_MATS';\n  const FB_OFFC_NM_PLT = 'FB_OFFC_NM_PLT';\n  const FB_OFFC_PPR_HNDL = 'FB_OFFC_PPR_HNDL';\n  const FB_OFFC_PRSNT_SPL = 'FB_OFFC_PRSNT_SPL';\n  const FB_OFFC_SEALR = 'FB_OFFC_SEALR';\n  const FB_OFFC_SHIP_SPL = 'FB_OFFC_SHIP_SPL';\n  const FB_RLGN = 'FB_RLGN';\n  const FB_RLGN_CMNY = 'FB_RLGN_CMNY';\n  const FB_RLGN_ITEM = 'FB_RLGN_ITEM';\n  const FB_RLGN_WEDD = 'FB_RLGN_WEDD';\n  const FB_SFTWR = 'FB_SFTWR';\n  const FB_SFWR_CMPTR = 'FB_SFWR_CMPTR';\n  const FB_SFWR_DGTL_GD = 'FB_SFWR_DGTL_GD';\n  const FB_SFWR_GAME = 'FB_SFWR_GAME';\n  const FB_SHIPPING = 'FB_SHIPPING';\n  const FB_SPOR = 'FB_SPOR';\n  const FB_SPORT_ATHL = 'FB_SPORT_ATHL';\n  const FB_SPORT_ATHL_CLTH = 'FB_SPORT_ATHL_CLTH';\n  const FB_SPORT_ATHL_SHOE = 'FB_SPORT_ATHL_SHOE';\n  const FB_SPORT_ATHL_SPRT = 'FB_SPORT_ATHL_SPRT';\n  const FB_SPORT_EXRCS = 'FB_SPORT_EXRCS';\n  const FB_SPORT_INDR_GM = 'FB_SPORT_INDR_GM';\n  const FB_SPORT_OTDR_GM = 'FB_SPORT_OTDR_GM';\n  const FB_TOYS = 'FB_TOYS';\n  const FB_TOYS_EQIP = 'FB_TOYS_EQIP';\n  const FB_TOYS_GAME = 'FB_TOYS_GAME';\n  const FB_TOYS_PZZL = 'FB_TOYS_PZZL';\n  const FB_TOYS_TMRS = 'FB_TOYS_TMRS';\n  const FB_TOYS_TOYS = 'FB_TOYS_TOYS';\n  const FB_VEHI = 'FB_VEHI';\n  const FB_VEHI_PART = 'FB_VEHI_PART';\n}\n", "num_lines": 246}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductItemConditionValues getInstance()\n */\nclass ProductItemConditionValues extends AbstractEnum {\n\n  const CPO = 'cpo';\n  const VALUE_NEW = 'new';\n  const OPEN_BOX_NEW = 'open_box_new';\n  const REFURBISHED = 'refurbished';\n  const USED = 'used';\n  const USED_FAIR = 'used_fair';\n  const USED_GOOD = 'used_good';\n  const USED_LIKE_NEW = 'used_like_new';\n}\n", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductItemErrorPriorityValues getInstance()\n */\nclass ProductItemErrorPriorityValues extends AbstractEnum {\n\n  const HIGH = 'HIGH';\n  const LOW = 'LOW';\n  const MEDIUM = 'MEDIUM';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductItemErrorTypeValues getInstance()\n */\nclass ProductItemErrorTypeValues extends AbstractEnum {\n\n  const AR_DELETED_DUE_TO_UPDATE = 'AR_DELETED_DUE_TO_UPDATE';\n  const AR_POLICY_VIOLATED = 'AR_POLICY_VIOLATED';\n  const AVAILABLE = 'AVAILABLE';\n  const BAD_QUALITY_IMAGE = 'BAD_QUALITY_IMAGE';\n  const CANNOT_EDIT_SUBSCRIPTION_PRODUCTS = 'CANNOT_EDIT_SUBSCRIPTION_PRODUCTS';\n  const CRAWLED_AVAILABILITY_MISMATCH = 'CRAWLED_AVAILABILITY_MISMATCH';\n  const DIGITAL_GOODS_NOT_AVAILABLE_FOR_CHECKOUT = 'DIGITAL_GOODS_NOT_AVAILABLE_FOR_CHECKOUT';\n  const DUPLICATE_IMAGES = 'DUPLICATE_IMAGES';\n  const DUPLICATE_TITLE_AND_DESCRIPTION = 'DUPLICATE_TITLE_AND_DESCRIPTION';\n  const EMPTY_DESCRIPTION = 'EMPTY_DESCRIPTION';\n  const GENERIC_INVALID_FIELD = 'GENERIC_INVALID_FIELD';\n  const HIDDEN_UNTIL_PRODUCT_LAUNCH = 'HIDDEN_UNTIL_PRODUCT_LAUNCH';\n  const IMAGE_FETCH_FAILED = 'IMAGE_FETCH_FAILED';\n  const IMAGE_FETCH_FAILED_BAD_GATEWAY = 'IMAGE_FETCH_FAILED_BAD_GATEWAY';\n  const IMAGE_FETCH_FAILED_FILE_SIZE_EXCEEDED = 'IMAGE_FETCH_FAILED_FILE_SIZE_EXCEEDED';\n  const IMAGE_FETCH_FAILED_FORBIDDEN = 'IMAGE_FETCH_FAILED_FORBIDDEN';\n  const IMAGE_FETCH_FAILED_LINK_BROKEN = 'IMAGE_FETCH_FAILED_LINK_BROKEN';\n  const IMAGE_FETCH_FAILED_TIMED_OUT = 'IMAGE_FETCH_FAILED_TIMED_OUT';\n  const IMAGE_RESOLUTION_LOW = 'IMAGE_RESOLUTION_LOW';\n  const INACTIVE_SHOPIFY_PRODUCT = 'INACTIVE_SHOPIFY_PRODUCT';\n  const INVALID_COMMERCE_TAX_CATEGORY = 'INVALID_COMMERCE_TAX_CATEGORY';\n  const INVALID_IMAGES = 'INVALID_IMAGES';\n  const INVALID_MONETIZER_RETURN_POLICY = 'INVALID_MONETIZER_RETURN_POLICY';\n  const INVALID_PRE_ORDER_PARAMS = 'INVALID_PRE_ORDER_PARAMS';\n  const INVALID_SHIPPING_PROFILE_PARAMS = 'INVALID_SHIPPING_PROFILE_PARAMS';\n  const INVALID_SUBSCRIPTION_DISABLE_PARAMS = 'INVALID_SUBSCRIPTION_DISABLE_PARAMS';\n  const INVALID_SUBSCRIPTION_ENABLE_PARAMS = 'INVALID_SUBSCRIPTION_ENABLE_PARAMS';\n  const INVALID_SUBSCRIPTION_PARAMS = 'INVALID_SUBSCRIPTION_PARAMS';\n  const INVENTORY_ZERO_AVAILABILITY_IN_STOCK = 'INVENTORY_ZERO_AVAILABILITY_IN_STOCK';\n  const IN_ANOTHER_PRODUCT_LAUNCH = 'IN_ANOTHER_PRODUCT_LAUNCH';\n  const ITEM_GROUP_NOT_SPECIFIED = 'ITEM_GROUP_NOT_SPECIFIED';\n  const ITEM_NOT_SHIPPABLE_FOR_SCA_SHOP = 'ITEM_NOT_SHIPPABLE_FOR_SCA_SHOP';\n  const ITEM_OVERRIDE_NOT_VISIBLE = 'ITEM_OVERRIDE_NOT_VISIBLE';\n  const ITEM_STALE_OUT_OF_STOCK = 'ITEM_STALE_OUT_OF_STOCK';\n  const MINI_SHOPS_DISABLED_BY_USER = 'MINI_SHOPS_DISABLED_BY_USER';\n  const MISSING_CHECKOUT = 'MISSING_CHECKOUT';\n  const MISSING_CHECKOUT_CURRENCY = 'MISSING_CHECKOUT_CURRENCY';\n  const MISSING_COLOR = 'MISSING_COLOR';\n  const MISSING_COUNTRY_OVERRIDE_IN_SHIPPING_PROFILE = 'MISSING_COUNTRY_OVERRIDE_IN_SHIPPING_PROFILE';\n  const MISSING_INDIA_COMPLIANCE_FIELDS = 'MISSING_INDIA_COMPLIANCE_FIELDS';\n  const MISSING_SHIPPING_PROFILE = 'MISSING_SHIPPING_PROFILE';\n  const MISSING_SIZE = 'MISSING_SIZE';\n  const MISSING_TAX_CATEGORY = 'MISSING_TAX_CATEGORY';\n  const NEGATIVE_COMMUNITY_FEEDBACK = 'NEGATIVE_COMMUNITY_FEEDBACK';\n  const NOT_ENOUGH_IMAGES = 'NOT_ENOUGH_IMAGES';\n  const PART_OF_PRODUCT_LAUNCH = 'PART_OF_PRODUCT_LAUNCH';\n  const PRODUCT_EXPIRED = 'PRODUCT_EXPIRED';\n  const PRODUCT_ITEM_HIDDEN_FROM_ALL_SHOPS = 'PRODUCT_ITEM_HIDDEN_FROM_ALL_SHOPS';\n  const PRODUCT_ITEM_NOT_INCLUDED_IN_ANY_SHOP = 'PRODUCT_ITEM_NOT_INCLUDED_IN_ANY_SHOP';\n  const PRODUCT_ITEM_NOT_VISIBLE = 'PRODUCT_ITEM_NOT_VISIBLE';\n  const PRODUCT_NOT_APPROVED = 'PRODUCT_NOT_APPROVED';\n  const PRODUCT_NOT_DOMINANT_CURRENCY = 'PRODUCT_NOT_DOMINANT_CURRENCY';\n  const PRODUCT_OUT_OF_STOCK = 'PRODUCT_OUT_OF_STOCK';\n  const PRODUCT_URL_EQUALS_DOMAIN = 'PRODUCT_URL_EQUALS_DOMAIN';\n  const PROPERTY_PRICE_CURRENCY_NOT_SUPPORTED = 'PROPERTY_PRICE_CURRENCY_NOT_SUPPORTED';\n  const PROPERTY_PRICE_TOO_HIGH = 'PROPERTY_PRICE_TOO_HIGH';\n  const PROPERTY_PRICE_TOO_LOW = 'PROPERTY_PRICE_TOO_LOW';\n  const PROPERTY_VALUE_CONTAINS_HTML_TAGS = 'PROPERTY_VALUE_CONTAINS_HTML_TAGS';\n  const PROPERTY_VALUE_DESCRIPTION_CONTAINS_OFF_PLATFORM_LINK = 'PROPERTY_VALUE_DESCRIPTION_CONTAINS_OFF_PLATFORM_LINK';\n  const PROPERTY_VALUE_FORMAT = 'PROPERTY_VALUE_FORMAT';\n  const PROPERTY_VALUE_MISSING = 'PROPERTY_VALUE_MISSING';\n  const PROPERTY_VALUE_MISSING_WARNING = 'PROPERTY_VALUE_MISSING_WARNING';\n  const PROPERTY_VALUE_NON_POSITIVE = 'PROPERTY_VALUE_NON_POSITIVE';\n  const PROPERTY_VALUE_STRING_EXCEEDS_LENGTH = 'PROPERTY_VALUE_STRING_EXCEEDS_LENGTH';\n  const PROPERTY_VALUE_STRING_TOO_SHORT = 'PROPERTY_VALUE_STRING_TOO_SHORT';\n  const PROPERTY_VALUE_UPPERCASE_WARNING = 'PROPERTY_VALUE_UPPERCASE_WARNING';\n  const QUALITY_DUPLICATED_DESCRIPTION = 'QUALITY_DUPLICATED_DESCRIPTION';\n  const QUALITY_ITEM_LINK_BROKEN = 'QUALITY_ITEM_LINK_BROKEN';\n  const QUALITY_ITEM_LINK_REDIRECTING = 'QUALITY_ITEM_LINK_REDIRECTING';\n  const RETAILER_ID_NOT_PROVIDED = 'RETAILER_ID_NOT_PROVIDED';\n  const SHOPIFY_ITEM_MISSING_SHIPPING_PROFILE = 'SHOPIFY_ITEM_MISSING_SHIPPING_PROFILE';\n  const SUBSCRIPTION_INFO_NOT_ENABLED_FOR_FEED = 'SUBSCRIPTION_INFO_NOT_ENABLED_FOR_FEED';\n  const TAX_CATEGORY_NOT_SUPPORTED_IN_UK = 'TAX_CATEGORY_NOT_SUPPORTED_IN_UK';\n  const UNSUPPORTED_PRODUCT_CATEGORY = 'UNSUPPORTED_PRODUCT_CATEGORY';\n  const VARIANT_ATTRIBUTE_ISSUE = 'VARIANT_ATTRIBUTE_ISSUE';\n}\n", "num_lines": 116}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductItemGenderValues getInstance()\n */\nclass ProductItemGenderValues extends AbstractEnum {\n\n  const FEMALE = 'female';\n  const MALE = 'male';\n  const UNISEX = 'unisex';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductItemImageFetchStatusValues getInstance()\n */\nclass ProductItemImageFetchStatusValues extends AbstractEnum {\n\n  const DIRECT_UPLOAD = 'DIRECT_UPLOAD';\n  const FETCHED = 'FETCHED';\n  const FETCH_FAILED = 'FETCH_FAILED';\n  const NO_STATUS = 'NO_STATUS';\n  const OUTDATED = 'OUTDATED';\n  const PARTIAL_FETCH = 'PARTIAL_FETCH';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductItemMarkedForProductLaunchValues getInstance()\n */\nclass ProductItemMarkedForProductLaunchValues extends AbstractEnum {\n\n  const VALUE_DEFAULT = 'default';\n  const MARKED = 'marked';\n  const NOT_MARKED = 'not_marked';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductItemOriginCountryValues getInstance()\n */\nclass ProductItemOriginCountryValues extends AbstractEnum {\n\n  const AD = 'AD';\n  const AE = 'AE';\n  const AF = 'AF';\n  const AG = 'AG';\n  const AI = 'AI';\n  const AL = 'AL';\n  const AM = 'AM';\n  const AN = 'AN';\n  const AO = 'AO';\n  const AQ = 'AQ';\n  const AR = 'AR';\n  const VALUE_AS = 'AS';\n  const AT = 'AT';\n  const AU = 'AU';\n  const AW = 'AW';\n  const AX = 'AX';\n  const AZ = 'AZ';\n  const BA = 'BA';\n  const BB = 'BB';\n  const BD = 'BD';\n  const BE = 'BE';\n  const BF = 'BF';\n  const BG = 'BG';\n  const BH = 'BH';\n  const BI = 'BI';\n  const BJ = 'BJ';\n  const BL = 'BL';\n  const BM = 'BM';\n  const BN = 'BN';\n  const BO = 'BO';\n  const BQ = 'BQ';\n  const BR = 'BR';\n  const BS = 'BS';\n  const BT = 'BT';\n  const BV = 'BV';\n  const BW = 'BW';\n  const BY = 'BY';\n  const BZ = 'BZ';\n  const CA = 'CA';\n  const CC = 'CC';\n  const CD = 'CD';\n  const CF = 'CF';\n  const CG = 'CG';\n  const CH = 'CH';\n  const CI = 'CI';\n  const CK = 'CK';\n  const CL = 'CL';\n  const CM = 'CM';\n  const CN = 'CN';\n  const CO = 'CO';\n  const CR = 'CR';\n  const CU = 'CU';\n  const CV = 'CV';\n  const CW = 'CW';\n  const CX = 'CX';\n  const CY = 'CY';\n  const CZ = 'CZ';\n  const DE = 'DE';\n  const DJ = 'DJ';\n  const DK = 'DK';\n  const DM = 'DM';\n  const VALUE_DO = 'DO';\n  const DZ = 'DZ';\n  const EC = 'EC';\n  const EE = 'EE';\n  const EG = 'EG';\n  const EH = 'EH';\n  const ER = 'ER';\n  const ES = 'ES';\n  const ET = 'ET';\n  const FI = 'FI';\n  const FJ = 'FJ';\n  const FK = 'FK';\n  const FM = 'FM';\n  const FO = 'FO';\n  const FR = 'FR';\n  const GA = 'GA';\n  const GB = 'GB';\n  const GD = 'GD';\n  const GE = 'GE';\n  const GF = 'GF';\n  const GG = 'GG';\n  const GH = 'GH';\n  const GI = 'GI';\n  const GL = 'GL';\n  const GM = 'GM';\n  const GN = 'GN';\n  const GP = 'GP';\n  const GQ = 'GQ';\n  const GR = 'GR';\n  const GS = 'GS';\n  const GT = 'GT';\n  const GU = 'GU';\n  const GW = 'GW';\n  const GY = 'GY';\n  const HK = 'HK';\n  const HM = 'HM';\n  const HN = 'HN';\n  const HR = 'HR';\n  const HT = 'HT';\n  const HU = 'HU';\n  const ID = 'ID';\n  const IE = 'IE';\n  const IL = 'IL';\n  const IM = 'IM';\n  const IN = 'IN';\n  const IO = 'IO';\n  const IQ = 'IQ';\n  const IR = 'IR';\n  const IS = 'IS';\n  const IT = 'IT';\n  const JE = 'JE';\n  const JM = 'JM';\n  const JO = 'JO';\n  const JP = 'JP';\n  const KE = 'KE';\n  const KG = 'KG';\n  const KH = 'KH';\n  const KI = 'KI';\n  const KM = 'KM';\n  const KN = 'KN';\n  const KP = 'KP';\n  const KR = 'KR';\n  const KW = 'KW';\n  const KY = 'KY';\n  const KZ = 'KZ';\n  const LA = 'LA';\n  const LB = 'LB';\n  const LC = 'LC';\n  const LI = 'LI';\n  const LK = 'LK';\n  const LR = 'LR';\n  const LS = 'LS';\n  const LT = 'LT';\n  const LU = 'LU';\n  const LV = 'LV';\n  const LY = 'LY';\n  const MA = 'MA';\n  const MC = 'MC';\n  const MD = 'MD';\n  const ME = 'ME';\n  const MF = 'MF';\n  const MG = 'MG';\n  const MH = 'MH';\n  const MK = 'MK';\n  const ML = 'ML';\n  const MM = 'MM';\n  const MN = 'MN';\n  const MO = 'MO';\n  const MP = 'MP';\n  const MQ = 'MQ';\n  const MR = 'MR';\n  const MS = 'MS';\n  const MT = 'MT';\n  const MU = 'MU';\n  const MV = 'MV';\n  const MW = 'MW';\n  const MX = 'MX';\n  const MY = 'MY';\n  const MZ = 'MZ';\n  const NA = 'NA';\n  const NC = 'NC';\n  const NE = 'NE';\n  const NF = 'NF';\n  const NG = 'NG';\n  const NI = 'NI';\n  const NL = 'NL';\n  const NO = 'NO';\n  const NP = 'NP';\n  const NR = 'NR';\n  const NU = 'NU';\n  const NZ = 'NZ';\n  const OM = 'OM';\n  const PA = 'PA';\n  const PE = 'PE';\n  const PF = 'PF';\n  const PG = 'PG';\n  const PH = 'PH';\n  const PK = 'PK';\n  const PL = 'PL';\n  const PM = 'PM';\n  const PN = 'PN';\n  const PR = 'PR';\n  const PS = 'PS';\n  const PT = 'PT';\n  const PW = 'PW';\n  const PY = 'PY';\n  const QA = 'QA';\n  const RE = 'RE';\n  const RO = 'RO';\n  const RS = 'RS';\n  const RU = 'RU';\n  const RW = 'RW';\n  const SA = 'SA';\n  const SB = 'SB';\n  const SC = 'SC';\n  const SD = 'SD';\n  const SE = 'SE';\n  const SG = 'SG';\n  const SH = 'SH';\n  const SI = 'SI';\n  const SJ = 'SJ';\n  const SK = 'SK';\n  const SL = 'SL';\n  const SM = 'SM';\n  const SN = 'SN';\n  const SO = 'SO';\n  const SR = 'SR';\n  const SS = 'SS';\n  const ST = 'ST';\n  const SV = 'SV';\n  const SX = 'SX';\n  const SY = 'SY';\n  const SZ = 'SZ';\n  const TC = 'TC';\n  const TD = 'TD';\n  const TF = 'TF';\n  const TG = 'TG';\n  const TH = 'TH';\n  const TJ = 'TJ';\n  const TK = 'TK';\n  const TL = 'TL';\n  const TM = 'TM';\n  const TN = 'TN';\n  const TO = 'TO';\n  const TR = 'TR';\n  const TT = 'TT';\n  const TV = 'TV';\n  const TW = 'TW';\n  const TZ = 'TZ';\n  const UA = 'UA';\n  const UG = 'UG';\n  const UM = 'UM';\n  const US = 'US';\n  const UY = 'UY';\n  const UZ = 'UZ';\n  const VA = 'VA';\n  const VC = 'VC';\n  const VE = 'VE';\n  const VG = 'VG';\n  const VI = 'VI';\n  const VN = 'VN';\n  const VU = 'VU';\n  const WF = 'WF';\n  const WS = 'WS';\n  const XK = 'XK';\n  const YE = 'YE';\n  const YT = 'YT';\n  const ZA = 'ZA';\n  const ZM = 'ZM';\n  const ZW = 'ZW';\n}\n", "num_lines": 292}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductItemReviewStatusValues getInstance()\n */\nclass ProductItemReviewStatusValues extends AbstractEnum {\n\n  const APPROVED = 'approved';\n  const OUTDATED = 'outdated';\n  const PENDING = 'pending';\n  const REJECTED = 'rejected';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductItemShippingWeightUnitValues getInstance()\n */\nclass ProductItemShippingWeightUnitValues extends AbstractEnum {\n\n  const VALUE_G = 'g';\n  const KG = 'kg';\n  const LB = 'lb';\n  const OZ = 'oz';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductItemVisibilityValues getInstance()\n */\nclass ProductItemVisibilityValues extends AbstractEnum {\n\n  const PUBLISHED = 'published';\n  const STAGING = 'staging';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProductItemWaComplianceCategoryValues getInstance()\n */\nclass ProductItemWaComplianceCategoryValues extends AbstractEnum {\n\n  const COUNTRY_ORIGIN_EXEMPT = 'COUNTRY_ORIGIN_EXEMPT';\n  const VALUE_DEFAULT = 'DEFAULT';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProfilePictureSourceBreakingChangeValues getInstance()\n */\nclass ProfilePictureSourceBreakingChangeValues extends AbstractEnum {\n\n  const PROFILE_PICTURE = 'PROFILE_PICTURE';\n}\n", "num_lines": 42}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProfilePictureSourceTypeValues getInstance()\n */\nclass ProfilePictureSourceTypeValues extends AbstractEnum {\n\n  const ALBUM = 'album';\n  const SMALL = 'small';\n  const THUMBNAIL = 'thumbnail';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProfileProfileTypeValues getInstance()\n */\nclass ProfileProfileTypeValues extends AbstractEnum {\n\n  const APPLICATION = 'application';\n  const EVENT = 'event';\n  const GROUP = 'group';\n  const PAGE = 'page';\n  const USER = 'user';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ProfileTypeValues getInstance()\n */\nclass ProfileTypeValues extends AbstractEnum {\n\n  const ANGRY = 'ANGRY';\n  const CARE = 'CARE';\n  const FIRE = 'FIRE';\n  const HAHA = 'HAHA';\n  const HUNDRED = 'HUNDRED';\n  const LIKE = 'LIKE';\n  const LOVE = 'LOVE';\n  const NONE = 'NONE';\n  const PRIDE = 'PRIDE';\n  const SAD = 'SAD';\n  const THANKFUL = 'THANKFUL';\n  const WOW = 'WOW';\n}\n", "num_lines": 53}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ReachFrequencyPredictionActionValues getInstance()\n */\nclass ReachFrequencyPredictionActionValues extends AbstractEnum {\n\n  const CANCEL = 'cancel';\n  const QUOTE = 'quote';\n  const RESERVE = 'reserve';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ReachFrequencyPredictionBuyingTypeValues getInstance()\n */\nclass ReachFrequencyPredictionBuyingTypeValues extends AbstractEnum {\n\n  const AUCTION = 'AUCTION';\n  const DEPRECATED_REACH_BLOCK = 'DEPRECATED_REACH_BLOCK';\n  const FIXED_CPM = 'FIXED_CPM';\n  const MIXED = 'MIXED';\n  const REACHBLOCK = 'REACHBLOCK';\n  const RESEARCH_POLL = 'RESEARCH_POLL';\n  const RESERVED = 'RESERVED';\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static ReachFrequencyPredictionInstreamPackagesValues getInstance()\n */\nclass ReachFrequencyPredictionInstreamPackagesValues extends AbstractEnum {\n\n  const BEAUTY = 'BEAUTY';\n  const ENTERTAINMENT = 'ENTERTAINMENT';\n  const FOOD = 'FOOD';\n  const NORMAL = 'NORMAL';\n  const PREMIUM = 'PREMIUM';\n  const REGULAR_ANIMALS_PETS = 'REGULAR_ANIMALS_PETS';\n  const REGULAR_FOOD = 'REGULAR_FOOD';\n  const REGULAR_GAMES = 'REGULAR_GAMES';\n  const REGULAR_POLITICS = 'REGULAR_POLITICS';\n  const REGULAR_SPORTS = 'REGULAR_SPORTS';\n  const REGULAR_STYLE = 'REGULAR_STYLE';\n  const REGULAR_TV_MOVIES = 'REGULAR_TV_MOVIES';\n  const SPANISH = 'SPANISH';\n  const SPORTS = 'SPORTS';\n}\n", "num_lines": 55}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static ReachFrequencyPredictionStatuses getInstance()\n */\nclass ReachFrequencyPredictionStatuses extends AbstractEnum {\n\n  const SUCCESS = 1;\n  const PENDING = 2;\n  const UNREACHABLE_AUDIENCE = 3;\n  const CONFIG_INVALID = 4;\n  const TARGET_SPEC_INVALID = 5;\n  const BUDGET_TOO_LOW = 6;\n  const TOO_SHORT_AD_SET_LENGTH = 7;\n  const TOO_LONG_AD_SET_LENGTH = 8;\n  const END_DATE_TOO_FAR = 9;\n  const FREQUENCY_CAP_NOT_SPECIFIED = 10;\n  const UNSUPPORTED_PLACEMENT = 11;\n  const DATE_ERROR = 12;\n  const COUNTRY_NOT_SUPPORTED = 13;\n  const BLACKOUT_DAYS = 14;\n  const INSUFFICIENT_INVENTORY = 15;\n  const REACH_BELOW_1_MILLION = 16;\n  const MINIMUM_REACH_NOT_AVAILABLE = 17;\n  const INVENTORY_CHANGED = 21;\n}\n", "num_lines": 53}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static SystemUserRoleValues getInstance()\n */\nclass SystemUserRoleValues extends AbstractEnum {\n\n  const ADMIN = 'ADMIN';\n  const ADS_RIGHTS_REVIEWER = 'ADS_RIGHTS_REVIEWER';\n  const VALUE_DEFAULT = 'DEFAULT';\n  const DEVELOPER = 'DEVELOPER';\n  const EMPLOYEE = 'EMPLOYEE';\n  const FINANCE_ANALYST = 'FINANCE_ANALYST';\n  const FINANCE_EDIT = 'FINANCE_EDIT';\n  const FINANCE_EDITOR = 'FINANCE_EDITOR';\n  const FINANCE_VIEW = 'FINANCE_VIEW';\n  const MANAGE = 'MANAGE';\n  const PARTNER_CENTER_ADMIN = 'PARTNER_CENTER_ADMIN';\n  const PARTNER_CENTER_ANALYST = 'PARTNER_CENTER_ANALYST';\n  const PARTNER_CENTER_EDUCATION = 'PARTNER_CENTER_EDUCATION';\n  const PARTNER_CENTER_MARKETING = 'PARTNER_CENTER_MARKETING';\n  const PARTNER_CENTER_OPERATIONS = 'PARTNER_CENTER_OPERATIONS';\n}\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static TargetingDevicePlatformsValues getInstance()\n */\nclass TargetingDevicePlatformsValues extends AbstractEnum {\n\n  const DESKTOP = 'desktop';\n  const MOBILE = 'mobile';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static TargetingEffectiveDevicePlatformsValues getInstance()\n */\nclass TargetingEffectiveDevicePlatformsValues extends AbstractEnum {\n\n  const DESKTOP = 'desktop';\n  const MOBILE = 'mobile';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static TermsOfService getInstance()\n */\nclass TermsOfService extends AbstractEnum {\n\n  const CUSTOM_AUDIENCE  = 'custom_audience';\n  const WEBSITE_CUSTOM_AUDIENCE = 'website_custom_audience';\n  const MOBILE_APP_CUSTOM_AUDIENCE = 'mobile_app_custom_audience';\n}\n", "num_lines": 38}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static UnifiedThreadPlatformValues getInstance()\n */\nclass UnifiedThreadPlatformValues extends AbstractEnum {\n\n  const INSTAGRAM = 'INSTAGRAM';\n  const MESSENGER = 'MESSENGER';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static URLScopesValues getInstance()\n */\nclass URLScopesValues extends AbstractEnum {\n\n  const NEWS_TAB = 'NEWS_TAB';\n  const NEWS_TAB_DEV_ENV = 'NEWS_TAB_DEV_ENV';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static UserFilteringValues getInstance()\n */\nclass UserFilteringValues extends AbstractEnum {\n\n  const EMA = 'ema';\n  const GROUPS = 'groups';\n  const GROUPS_SOCIAL = 'groups_social';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static UserLocalNewsMegaphoneDismissStatusValues getInstance()\n */\nclass UserLocalNewsMegaphoneDismissStatusValues extends AbstractEnum {\n\n  const NO = 'NO';\n  const YES = 'YES';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static UserLocalNewsSubscriptionStatusValues getInstance()\n */\nclass UserLocalNewsSubscriptionStatusValues extends AbstractEnum {\n\n  const STATUS_OFF = 'STATUS_OFF';\n  const STATUS_ON = 'STATUS_ON';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * @method static UserPermissionRoles getInstance()\n */\nclass UserPermissionRoles extends AbstractEnum {\n\n  const ADMIN  = 'ADMIN';\n  const EMPLOYEE  = 'EMPLOYEE';\n}\n", "num_lines": 37}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static UserTypeValues getInstance()\n */\nclass UserTypeValues extends AbstractEnum {\n\n  const CONTENT_UPDATE = 'content_update';\n  const GENERIC = 'generic';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VehicleAvailabilityValues getInstance()\n */\nclass VehicleAvailabilityValues extends AbstractEnum {\n\n  const AVAILABLE = 'AVAILABLE';\n  const NOT_AVAILABLE = 'NOT_AVAILABLE';\n  const PENDING = 'PENDING';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VehicleBodyStyleValues getInstance()\n */\nclass VehicleBodyStyleValues extends AbstractEnum {\n\n  const CONVERTIBLE = 'CONVERTIBLE';\n  const COUPE = 'COUPE';\n  const CROSSOVER = 'CROSSOVER';\n  const ESTATE = 'ESTATE';\n  const GRANDTOURER = 'GRANDTOURER';\n  const HATCHBACK = 'HATCHBACK';\n  const MINIBUS = 'MINIBUS';\n  const MINIVAN = 'MINIVAN';\n  const MPV = 'MPV';\n  const NONE = 'NONE';\n  const OTHER = 'OTHER';\n  const PICKUP = 'PICKUP';\n  const ROADSTER = 'ROADSTER';\n  const SALOON = 'SALOON';\n  const SEDAN = 'SEDAN';\n  const SMALL_CAR = 'SMALL_CAR';\n  const SPORTSCAR = 'SPORTSCAR';\n  const SUPERCAR = 'SUPERCAR';\n  const SUPERMINI = 'SUPERMINI';\n  const SUV = 'SUV';\n  const TRUCK = 'TRUCK';\n  const VAN = 'VAN';\n  const WAGON = 'WAGON';\n}\n", "num_lines": 64}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VehicleConditionValues getInstance()\n */\nclass VehicleConditionValues extends AbstractEnum {\n\n  const EXCELLENT = 'EXCELLENT';\n  const FAIR = 'FAIR';\n  const GOOD = 'GOOD';\n  const NONE = 'NONE';\n  const OTHER = 'OTHER';\n  const POOR = 'POOR';\n  const VERY_GOOD = 'VERY_GOOD';\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VehicleDrivetrainValues getInstance()\n */\nclass VehicleDrivetrainValues extends AbstractEnum {\n\n  const AWD = 'AWD';\n  const FOUR_WD = 'FOUR_WD';\n  const FWD = 'FWD';\n  const NONE = 'NONE';\n  const OTHER = 'OTHER';\n  const RWD = 'RWD';\n  const TWO_WD = 'TWO_WD';\n}\n", "num_lines": 48}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VehicleFuelTypeValues getInstance()\n */\nclass VehicleFuelTypeValues extends AbstractEnum {\n\n  const DIESEL = 'DIESEL';\n  const ELECTRIC = 'ELECTRIC';\n  const FLEX = 'FLEX';\n  const GASOLINE = 'GASOLINE';\n  const HYBRID = 'HYBRID';\n  const NONE = 'NONE';\n  const OTHER = 'OTHER';\n  const PETROL = 'PETROL';\n  const PLUGIN_HYBRID = 'PLUGIN_HYBRID';\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VehicleImageFetchStatusValues getInstance()\n */\nclass VehicleImageFetchStatusValues extends AbstractEnum {\n\n  const DIRECT_UPLOAD = 'DIRECT_UPLOAD';\n  const FETCHED = 'FETCHED';\n  const FETCH_FAILED = 'FETCH_FAILED';\n  const NO_STATUS = 'NO_STATUS';\n  const OUTDATED = 'OUTDATED';\n  const PARTIAL_FETCH = 'PARTIAL_FETCH';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VehicleOfferImageFetchStatusValues getInstance()\n */\nclass VehicleOfferImageFetchStatusValues extends AbstractEnum {\n\n  const DIRECT_UPLOAD = 'DIRECT_UPLOAD';\n  const FETCHED = 'FETCHED';\n  const FETCH_FAILED = 'FETCH_FAILED';\n  const NO_STATUS = 'NO_STATUS';\n  const OUTDATED = 'OUTDATED';\n  const PARTIAL_FETCH = 'PARTIAL_FETCH';\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VehicleOfferVisibilityValues getInstance()\n */\nclass VehicleOfferVisibilityValues extends AbstractEnum {\n\n  const PUBLISHED = 'PUBLISHED';\n  const STAGING = 'STAGING';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VehicleStateOfVehicleValues getInstance()\n */\nclass VehicleStateOfVehicleValues extends AbstractEnum {\n\n  const CPO = 'CPO';\n  const VALUE_NEW = 'NEW';\n  const USED = 'USED';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VehicleTransmissionValues getInstance()\n */\nclass VehicleTransmissionValues extends AbstractEnum {\n\n  const AUTOMATIC = 'AUTOMATIC';\n  const MANUAL = 'MANUAL';\n  const NONE = 'NONE';\n  const OTHER = 'OTHER';\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VehicleVehicleTypeValues getInstance()\n */\nclass VehicleVehicleTypeValues extends AbstractEnum {\n\n  const BOAT = 'BOAT';\n  const CAR_TRUCK = 'CAR_TRUCK';\n  const COMMERCIAL = 'COMMERCIAL';\n  const MOTORCYCLE = 'MOTORCYCLE';\n  const OTHER = 'OTHER';\n  const POWERSPORT = 'POWERSPORT';\n  const RV_CAMPER = 'RV_CAMPER';\n  const TRAILER = 'TRAILER';\n}\n", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VehicleVisibilityValues getInstance()\n */\nclass VehicleVisibilityValues extends AbstractEnum {\n\n  const PUBLISHED = 'PUBLISHED';\n  const STAGING = 'STAGING';\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VideoCopyrightContentCategoryValues getInstance()\n */\nclass VideoCopyrightContentCategoryValues extends AbstractEnum {\n\n  const EPISODE = 'episode';\n  const MOVIE = 'movie';\n  const WEB = 'web';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VideoCopyrightMonitoringTypeValues getInstance()\n */\nclass VideoCopyrightMonitoringTypeValues extends AbstractEnum {\n\n  const AUDIO_ONLY = 'AUDIO_ONLY';\n  const VIDEO_AND_AUDIO = 'VIDEO_AND_AUDIO';\n  const VIDEO_ONLY = 'VIDEO_ONLY';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VideoCopyrightRuleSourceValues getInstance()\n */\nclass VideoCopyrightRuleSourceValues extends AbstractEnum {\n\n  const MATCH_SETTINGS_DIALOG = 'MATCH_SETTINGS_DIALOG';\n  const RULES_SELECTOR = 'RULES_SELECTOR';\n  const RULES_TAB = 'RULES_TAB';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VideoPollActionValues getInstance()\n */\nclass VideoPollActionValues extends AbstractEnum {\n\n  const ATTACH_TO_VIDEO = 'ATTACH_TO_VIDEO';\n  const CLOSE = 'CLOSE';\n  const DELETE_POLL = 'DELETE_POLL';\n  const SHOW_RESULTS = 'SHOW_RESULTS';\n  const SHOW_VOTING = 'SHOW_VOTING';\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static VideoPollStatusValues getInstance()\n */\nclass VideoPollStatusValues extends AbstractEnum {\n\n  const CLOSED = 'closed';\n  const RESULTS_OPEN = 'results_open';\n  const VOTING_OPEN = 'voting_open';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static WhatsAppBusinessAccountCategoryValues getInstance()\n */\nclass WhatsAppBusinessAccountCategoryValues extends AbstractEnum {\n\n  const AUTHENTICATION = 'AUTHENTICATION';\n  const MARKETING = 'MARKETING';\n  const UTILITY = 'UTILITY';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static WhatsAppBusinessAccountTasksValues getInstance()\n */\nclass WhatsAppBusinessAccountTasksValues extends AbstractEnum {\n\n  const DEVELOP = 'DEVELOP';\n  const FULL_CONTROL = 'FULL_CONTROL';\n  const MANAGE = 'MANAGE';\n  const MANAGE_EXTENSIONS = 'MANAGE_EXTENSIONS';\n  const MANAGE_PHONE = 'MANAGE_PHONE';\n  const MANAGE_PHONE_ASSETS = 'MANAGE_PHONE_ASSETS';\n  const MANAGE_TEMPLATES = 'MANAGE_TEMPLATES';\n  const MESSAGING = 'MESSAGING';\n  const VIEW_COST = 'VIEW_COST';\n  const VIEW_PHONE_ASSETS = 'VIEW_PHONE_ASSETS';\n  const VIEW_TEMPLATES = 'VIEW_TEMPLATES';\n}\n", "num_lines": 52}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAds\\Object\\Values;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\n/**\n * This class is auto-generated.\n *\n * For any issues or feature requests related to this class, please let us know\n * on github and we'll fix in our codegen framework. We'll not be able to accept\n * pull request for this class.\n *\n * @method static WhatsAppBusinessPreVerifiedPhoneNumberCodeVerificationStatusValues getInstance()\n */\nclass WhatsAppBusinessPreVerifiedPhoneNumberCodeVerificationStatusValues extends AbstractEnum {\n\n  const EXPIRED = 'EXPIRED';\n  const NOT_VERIFIED = 'NOT_VERIFIED';\n  const VERIFIED = 'VERIFIED';\n}\n", "num_lines": 44}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nreturn array(\n\n  /**\n   * @var string Numeric Facebook app id, espressed as string\n   */\n  'app_id' => '',\n\n  /**\n   * @var string App Secret\n   * @see https://developers.facebook.com/apps/<APP_ID>/dashboard/\n   */\n  'app_secret' => '',\n\n  /**\n   * @var string User Access Token\n   * @see https://developers.facebook.com/docs/facebook-login/access-tokens/\n   */\n  'access_token' => '',\n\n  /**\n   * @var string Numeric Facebook Business Manager id, espressed as string\n   */\n  'business_id' => '',\n\n  /**\n   * @var string Numeric Facebook id, preceded by 'act_', espressed as string\n   * @see https://www.facebook.com/ads/manage/home/\n   */\n  'act_id' => '',\n\n  /**\n   * @var string PHP timezone compatible with the AdAccount timezone, override php.ini config\n   * @see http://php.net/manual/en/timezones.php\n   */\n  'act_timezone' => '',\n\n  /**\n   * @var string Numeric Facebook id, espressed as string\n   * @see https://www.facebook.com/ads/manage/home/\n   */\n  'page_id' => '',\n\n  /**\n   * @var string Url of your app [Stream post URL security]\n   *             Example: 'http://my.domain.com/'\n   * @see https://developers.facebook.com/docs/facebook-login/security/#surfacearea\n   */\n  'app_url' => '',\n\n  /**\n   * @var string Numeric Instagram actor id, espressed as string\n   */\n  'instagram_actor_id' => '',\n\n  // OPTIONAL INTEGRATION TESTS\n\n  'skip_if' => array(\n\n    /**\n     * @var bool Skip tests that require an business manager\n     * @see https://developers.facebook.com/docs/marketing-api/businessmanager/\n     */\n    'no_business_manager' => true,\n\n    /**\n     * @var bool Skip tests that require an account with a valid payment method\n     * @see https://secure.facebook.com/ads/manage/funding.php\n     */\n    'no_payment_method' => true,\n\n    /**\n     * @var bool Skip tests that require parnet categories whitelisting\n     * @see https://developers.facebook.com/docs/reference/ads-api/partnercategories\n     */\n    'no_partner_categories' => true,\n\n    /**\n     * @var bool Skip tests that require video upload\n     */\n    'no_video_upload' => true,\n\n    /**\n     * @var bool Skip tests that require reach and frequency whitelisting\n     */\n    'no_reach_and_frequency_whitelist' => true,\n\n    /**\n     * @var bool Skip tests that require polling for async jobs execution\n     */\n    'no_async_jobs' => true,\n\n    /**\n     * @var bool Skip tests that require an instagram actor\n     */\n    'no_instagram' => true,\n  ),\n\n  // OPTIONAL CONFIGURATIONS\n\n  /**\n   * @var string Override Facebook graph domain\n   *             Example: try hitting beta.facebook.com\n   */\n  'graph_base_domain' => '',\n\n  /**\n   * @var string Disable SSL verification between CA and host\n   *             [Security] Do not change this unless you trust your network\n   */\n  'skip_ssl_verification' => false,\n\n  /**\n   * @var string Filepath to which cUrl shell equivalents will be dumped\n   *             Tip: access std streams with 'php://stdout' or 'php://stderr'\n   */\n  'curl_logger' => '',\n\n  // OPTIONAL SECONDARY ENTITIES\n  // Do not set the same as primary. May incurr in lost permissions.\n\n  /**\n   * @var string Ausiliary Business ID for permissions and sharing testing\n   */\n  'secondary_business_id' => '',\n\n  /**\n   * @var string Ausiliary Account ID for permissions and sharing testing\n   */\n  'secondary_account_id' => '',\n\n  /**\n   * @var string Ausiliary Page ID for permissions and sharing testing\n   */\n  'secondary_page_id' => '',\n\n  /**\n   * @var string Ausiliary Page ID for permissions and sharing testing\n   */\n  'secondary_app_id' => '',\n);\n", "num_lines": 165}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Bootstrap;\n\nerror_reporting(E_ALL | E_STRICT);\nif (!ini_get('date.timezone')) {\n  ini_set('date.timezone', 'UTC');\n}\n\nrequire_once __DIR__.'/FacebookAdsTest/Bootstrap/Bootstrap.php';\nrequire_once __DIR__.'/FacebookAdsTest/Bootstrap/IntegrationBootstrap.php';\n\n$bootstrap = new IntegrationBootstrap();\n$bootstrap->init();\n\nreturn $bootstrap;\n", "num_lines": 39}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Bootstrap;\n\nerror_reporting(E_ALL | E_STRICT);\nif (!ini_get('date.timezone')) {\n  ini_set('date.timezone', 'UTC');\n}\nrequire_once __DIR__.'/FacebookAdsTest/Bootstrap/Bootstrap.php';\n\n$bootstrap = new Bootstrap();\n$bootstrap->init();\n\nreturn $bootstrap;\n", "num_lines": 37}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest;\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Http\\Adapter\\CurlAdapter;\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\Exception\\RequestException;\nuse FacebookAds\\Logger\\CurlLogger;\nuse FacebookAds\\Logger\\LoggerInterface;\nuse FacebookAds\\Logger\\NullLogger;\nuse FacebookAds\\Session;\nuse FacebookAdsTest\\Exception\\PHPUnitRequestExceptionWrapper;\n\n/**\n * Base class for the integration test cases.\n * Provide Network services.\n */\nclass AbstractIntegrationTestCase extends AbstractTestCase {\n\n  /**\n   * @var LoggerInterface\n   */\n  protected $logger;\n\n  /**\n   * @var Client\n   */\n  protected $httpClient;\n\n  /**\n   * @var Session\n   */\n  protected $session;\n\n  /**\n   * @var Api\n   */\n  protected $api;\n\n  /**\n   * @return LoggerInterface\n   */\n  public function getLogger() {\n    return $this->logger;\n  }\n\n  /**\n   * @return Session\n   */\n  public function getSession() {\n    return $this->session;\n  }\n\n  /**\n   * @return Client\n   */\n  public function getHttpClient() {\n    return $this->httpClient;\n  }\n\n  /**\n   * @return Api\n   */\n  public function getApi() {\n    return $this->api;\n  }\n\n  protected function setupSession() {\n    $this->session = new Session(\n      $this->getConfig()->appId,\n      $this->getConfig()->appSecret,\n      $this->getConfig()->accessToken);\n  }\n\n  protected function setupHttpClient() {\n    $this->httpClient = new Client();\n    if ($this->getConfig()->graphBaseDomain) {\n      $this->httpClient->setDefaultGraphBaseDomain(\n        $this->getConfig()->graphBaseDomain);\n    }\n    if ($this->getConfig()->skipSslVerification) {\n      /** @var CurlAdapter $adapter */\n      $adapter = $this->httpClient->getAdapter();\n      $adapter->getOpts()->offsetSet(CURLOPT_SSL_VERIFYHOST, false);\n      $adapter->getOpts()->offsetSet(CURLOPT_SSL_VERIFYPEER, false);\n    }\n  }\n\n  protected function setupLogger() {\n    $this->logger = $this->getConfig()->curlLogger\n      ? new CurlLogger(fopen($this->getConfig()->curlLogger, \"a\"))\n      : new NullLogger();\n  }\n\n  protected function setupApi() {\n    $this->api = new Api(\n      $this->getHttpClient(),\n      $this->getSession());\n\n    $this->api->setLogger($this->getLogger());\n\n    Api::setInstance($this->api);\n  }\n\n  public function setup() : void {\n    parent::setup();\n\n    $this->getSkippableFeaturesManager()->enforceSkipTest($this);\n\n    $this->setupLogger();\n    $this->setupSession();\n    $this->setupHttpClient();\n    $this->setupApi();\n  }\n\n  public function tearDown() : void {\n    $this->api = null;\n    $this->httpClient = null;\n    $this->session = null;\n    $this->logger = null;\n\n    parent::tearDown();\n  }\n\n  /**\n   * This method is called when a test method did not execute successfully.\n   *\n   * @param \\Throwable $e\n   * @throws \\Throwable\n   */\n  protected function onNotSuccessfulTest(\\Throwable $e) : void {\n    if ($e instanceof RequestException) {\n      throw new PHPUnitRequestExceptionWrapper($e);\n    } else {\n      throw $e;\n    }\n  }\n}\n", "num_lines": 162}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest;\n\nuse FacebookAdsTest\\Config\\Config;\nuse FacebookAdsTest\\Config\\SkippableFeaturesManager;\nuse \\PHPUnit_Framework_MockObject_Builder_InvocationMocker as Mock;\nuse PHPUnit\\Framework\\TestCase;\n\n/**\n * Base class for the unit test cases, providing the functions for AdsAPI\n * initialization etc.\n */\nclass AbstractTestCase extends TestCase {\n\n  /**\n   * @return SkippableFeaturesManager\n   */\n  public function getSkippableFeaturesManager() {\n    return SkippableFeaturesManager::instance();\n  }\n\n  /**\n   * @param string $key\n   * @return bool\n   */\n  public function shouldSkipTest($key) {\n    return $this->getSkippableFeaturesManager()->isSkipKey($key);\n  }\n\n  public function skipIf($key) {\n    if ($this->shouldSkipTest($key)) {\n      $this->markTestSkipped();\n    }\n  }\n\n  /**\n   * @return Config\n   */\n  public function getConfig() {\n    return Config::instance();\n  }\n\n  /**\n   * @return string\n   * @deprecated use getConfig()\n   */\n  public function getTestRunId() {\n    return $this->getConfig()->testRunId;\n  }\n\n  /**\n   * @return string\n   * @deprecated use getConfig()\n   */\n  public function getTestImagePath() {\n    return $this->getConfig()->testImagePath;\n  }\n\n  /**\n   * @return string\n   * @deprecated use getConfig()\n   */\n  public function getTestZippedImagesPath() {\n    return $this->getConfig()->testZippedImagesPath;\n  }\n\n  /**\n   * @return string\n   * @deprecated use getConfig()\n   */\n  public function getTestVideoPath() {\n    return $this->getConfig()->testVideoPath;\n  }\n\n  /**\n   * @param mixed $mock\n   * @param array $data\n   */\n  protected function makeMockIterable(\n    $mock, array $data = array()) {\n\n    /** @var Mock $mock */\n    $mock->method('count')->willReturn(count($data));\n    $mock->method('getIterator')->willReturn(new \\ArrayIterator($data));\n    $mock->method('getArrayCopy')->willReturn($data);\n    $mock->method('export')->willReturn($data);\n  }\n\n  /**\n   * @param \\Closure $closure\n   * @param string $fqn\n   */\n  protected function assertWillThrow(\n    \\Closure $closure,\n    $fqn = 'Exception') {\n\n    try {\n      call_user_func($closure);\n    } catch (\\Exception $e) {\n      $this->assertTrue(\n        is_a($e, $fqn),\n        'Expected exception of type '.$fqn.': '.get_class($e).' received');\n\n      return;\n    }\n\n    $this->fail('Expected exception didn\\'t throw: '.$fqn);\n  }\n}\n", "num_lines": 133}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest;\n\nuse FacebookAds\\Http\\Adapter\\AdapterInterface;\nuse FacebookAds\\Http\\Adapter\\Curl\\CurlInterface;\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\Headers;\nuse FacebookAds\\Http\\Parameters;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\nuse FacebookAds\\Logger\\LoggerInterface;\nuse FacebookAds\\Session;\nuse PHPUnit_Framework_MockObject_Builder_InvocationMocker as Mocker;\nuse PHPUnit_Framework_MockObject_MockObject as Mock;\n\n/**\n * @method Mocker|Mock getMock($fqn, $methods = array(), $arguments = array())\n */\nabstract class AbstractUnitTestCase extends AbstractTestCase {\n\n  /**\n   * @var string\n   */\n  const FQN_ADAPTER_INTERFACE = '\\FacebookAds\\Http\\Adapter\\AdapterInterface';\n\n  /**\n   * @var string\n   */\n  const FQN_CLIENT = '\\FacebookAds\\Http\\Client';\n\n  /**\n   * @var string\n   */\n  const FQN_CURL_INTERFACE = '\\FacebookAds\\Http\\Adapter\\Curl\\CurlInterface';\n\n  /**\n   * @var string\n   */\n  const FQN_HEADERS = '\\FacebookAds\\Http\\Headers';\n\n  /**\n   * @var string\n   */\n  const FQN_LOGGER_INTERFACE = '\\FacebookAds\\Logger\\LoggerInterface';\n\n  /**\n   * @var string\n   */\n  const FQN_PARAMETERS = '\\FacebookAds\\Http\\Parameters';\n\n  /**\n   * @var string\n   */\n  const FQN_JSON_AWARE_PARAMETERS\n    = '\\FacebookAds\\Logger\\CurlLogger\\JsonAwareParameters';\n\n  /**\n   * @var string\n   */\n  const FQN_REQUEST_INTERFACE = '\\FacebookAds\\Http\\RequestInterface';\n\n  /**\n   * @var string\n   */\n  const FQN_RESPONSE_INTERFACE = '\\FacebookAds\\Http\\ResponseInterface';\n\n  /**\n   * @var string\n   */\n  const FQN_SESSION = '\\FacebookAds\\Session';\n\n  /**\n   * @var string\n   */\n  const VALUE_SESSION_APP_ID = '<APP_ID>';\n\n  /**\n   * @var string\n   */\n  const VALUE_SESSION_APP_SECRET = '<APP_SECRET>';\n\n  /**\n   * @var string\n   */\n  const VALUE_SESSION_ACCESS_TOKEN = '<ACCESS_TOKEN>';\n\n  /**\n   * @return Mocker|Mock|ResponseInterface\n   */\n  protected function createResponseMock() {\n    return $this->createMock(static::FQN_RESPONSE_INTERFACE);\n  }\n\n  /**\n   * @return Mocker|Mock|Client\n   */\n  protected function createClientMock() {\n    return $this->createMock(static::FQN_CLIENT);\n  }\n\n  /**\n   * @return Mocker|Mock|CurlInterface\n   */\n  protected function createCurlMock() {\n    return $this->createMock(static::FQN_CURL_INTERFACE);\n  }\n\n  /**\n   * @return Mocker|Mock|Headers\n   */\n  protected function createHeadersMock() {\n    return $this->createMock(static::FQN_HEADERS);\n  }\n\n  /**\n   * @return Mocker|Mock|LoggerInterface\n   */\n  protected function createLoggerMock() {\n    return $this->createMock(static::FQN_LOGGER_INTERFACE);\n  }\n\n  /**\n   * @return Mocker|Mock|Parameters\n   */\n  protected function createParametersMock() {\n    return $this->createMock(static::FQN_PARAMETERS);\n  }\n\n  /**\n   * @return Mocker|Mock|Parameters\n   */\n  protected function createJsonAwareParametersMock() {\n    return $this->createMock(static::FQN_JSON_AWARE_PARAMETERS);\n  }\n\n  /**\n   * @return Mocker|Mock|RequestInterface\n   */\n  protected function createRequestMock() {\n    return $this->createMock(static::FQN_REQUEST_INTERFACE);\n  }\n\n  /**\n   * @return Mocker|Mock|AdapterInterface\n   */\n  protected function createAdapterMock() {\n    return $this->createMock(static::FQN_ADAPTER_INTERFACE);\n  }\n\n  /**\n   * @return Mocker|Mock|Session\n   */\n  protected function createSessionMock() {\n    return $this->getMockBuilder(static::FQN_SESSION)\n                ->setConstructorArgs(array(\n                  static::VALUE_SESSION_APP_ID,\n                  static::VALUE_SESSION_APP_SECRET,\n                  static::VALUE_SESSION_ACCESS_TOKEN,\n                ))\n                ->getMock();\n  }\n}\n", "num_lines": 186}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest;\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\nuse FacebookAds\\Logger\\NullLogger;\n\nclass ApiTest extends AbstractUnitTestCase {\n\n  /**\n   * @return Api\n   */\n  protected function createApi() {\n    return new Api($this->createClientMock(), $this->createSessionMock());\n  }\n\n  public function testInstance() {\n    $this->assertNull(Api::instance());\n\n    $api = $this->createApi();\n    Api::setInstance($api);\n    $this->assertTrue($api === Api::instance());\n\n    $newApi = $this->createApi();\n    Api::setInstance($newApi);\n    $this->assertTrue($newApi === Api::instance());\n    $this->assertFalse($api === Api::instance());\n  }\n\n  public function testInit() {\n    $api = Api::init(\n      static::VALUE_SESSION_APP_ID,\n      static::VALUE_SESSION_APP_SECRET,\n      static::VALUE_SESSION_ACCESS_TOKEN,\n      false\n    );\n    $this->assertTrue($api instanceof Api);\n    $this->assertTrue($api === Api::instance());\n    $this->assertEquals(\n      static::VALUE_SESSION_APP_ID, $api->getSession()->getAppId());\n    $this->assertEquals(\n      static::VALUE_SESSION_APP_SECRET, $api->getSession()->getAppSecret());\n    $this->assertEquals(\n      static::VALUE_SESSION_ACCESS_TOKEN, $api->getSession()->getAccessToken());\n  }\n\n  public function testGetters() {\n    $client = $this->createClientMock();\n    $session = $this->createSessionMock();\n    $api = new Api($client, $session);\n    $this->assertTrue($api->getHttpClient() === $client);\n    $this->assertTrue($api->getSession() === $session);\n  }\n\n  public function testLogger() {\n    $api = $this->createApi();\n    $logger = $this->createLoggerMock();\n    $api->setLogger($logger);\n    $this->assertTrue($logger === $api->getLogger());\n\n    // Test default\n    $api = $this->createApi();\n    $this->assertTrue($api->getLogger() instanceof NullLogger);\n  }\n\n  public function testDefaultGraphVersion() {\n    $api = $this->createApi();\n    $api->setDefaultGraphVersion('<VERSION>');\n    $this->assertEquals('<VERSION>', $api->getDefaultGraphVersion());\n\n    // Test default\n    $api = $this->createApi();\n    $this->assertTrue(is_string($api->getDefaultGraphVersion()));\n    $this->assertRegExp('/^\\d+\\.\\d+$/', $api->getDefaultGraphVersion());\n  }\n\n  public function testCall() {\n    $request = $this->createRequestMock();\n    $request->method('execute')->willReturn($this->createResponseMock());\n    $request->method('getQueryParams')\n      ->willReturn($this->createParametersMock());\n    $request->method('getBodyParams')\n      ->willReturn($this->createParametersMock());\n    $request->expects($this->exactly(2))->method('setMethod')\n      ->with($this->logicalOr(\n        RequestInterface::METHOD_GET,\n        RequestInterface::METHOD_POST));\n    $request->expects($this->exactly(2))->method('setGraphVersion')\n      ->with($this->equalTo($this->createApi()->getDefaultGraphVersion()));\n    $request->expects($this->exactly(2))->method('setPath')\n      ->with($this->equalTo('/<PATH>'));\n\n    $client = $this->createClientMock();\n    $client->method('createRequest')->willReturn($request);\n\n    $session = $this->createSessionMock();\n    $session->method('getAppSecretProof')->willReturn('<APP_SECRET_PROOF>');\n    $session->method('getRequestParameters')->willReturn([]);\n\n    $logger = $this->createLoggerMock();\n    $logger->expects($this->exactly(2))->method('logRequest');\n    $logger->expects($this->exactly(2))->method('logResponse');\n\n    $api = new Api($client, $session);\n    $api->setLogger($logger);\n\n    // HTTP GET request\n    $request->expects($this->exactly(1))->method('getQueryParams');\n\n    $response = $api->call('/<PATH>');\n    $this->assertTrue($response instanceof ResponseInterface);\n\n    // HTTP POST request\n    $request->expects($this->exactly(1))->method('getBodyParams');\n\n    $api->call(\n      '/<PATH>', RequestInterface::METHOD_POST, array('param' => 'value'));\n    $this->assertTrue($response instanceof ResponseInterface);\n  }\n\n  public function testBase64UrlEncode() {\n    $this->assertEquals('MTIzNDU', Api::base64UrlEncode('12345'));\n  }\n}\n", "num_lines": 149}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest;\n\nuse FacebookAds\\Cursor;\n\nclass CursorDegradationTest extends CursorTest {\n\n  /**\n   * @return string\n   */\n  protected function getUniquePageId() {\n    return (string) (microtime(true) * 1000000);\n  }\n\n  /**\n   * @return array\n   */\n  protected function createSampleResponseContent() {\n    $url_fmt = $this->createUnparameterizedUrl()\n      .'?offset=%s';\n\n    $content = parent::createSampleResponseContent();\n    $content['paging'] = array(\n      'next' => sprintf($url_fmt, $this->getUniquePageId()),\n      'previous' => sprintf($url_fmt, $this->getUniquePageId()),\n    );\n\n    return $content;\n  }\n\n  public function testRequestParamReset() {\n    $response = $this->createResponseChainMock(1);\n    $cursor = new Cursor($response, $this->objectPrototype);\n    $params = $cursor->getLastResponse()->getRequest()->getQueryParams();\n    $params->offsetSet('offset', $this->getUniquePageId());\n\n    $cursor->fetchAfter();\n    $params2 = $cursor->getLastResponse()->getRequest()->getQueryParams();\n\n    $this->assertNotEquals(\n      $params->offsetGet('offset'), $params2->offsetGet('offset'));\n  }\n\n  public function testGetters() {\n    $response = $this->createResponseChainMock(1);\n    $cursor = new Cursor($response, $this->objectPrototype);\n\n    $this->assertTrue($response === $cursor->getResponse());\n    $this->assertTrue($response === $cursor->getLastResponse());\n    $this->assertNull($cursor->getAfter());\n    $this->assertNull($cursor->getBefore());\n  }\n}\n", "num_lines": 77}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest;\n\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\Parameters;\nuse FacebookAds\\Http\\Request;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAds\\Object\\AbstractObject;\nuse FacebookAds\\Cursor;\nuse FacebookAdsTest\\Object\\EmptyObject;\nuse \\PHPUnit_Framework_MockObject_Builder_InvocationMocker as Mock;\n\nclass CursorTest extends AbstractUnitTestCase {\n  /**\n   * @var EmptyObject\n   */\n  protected $objectPrototype;\n\n  /**\n   * @return array\n   */\n  protected function createEmptyResponseContent() {\n    return array('data' => array());\n  }\n\n\n  /**\n   * @return string\n   */\n  protected function getUniquePageId() {\n    return uniqid();\n  }\n\n  /**\n   * @return array\n   */\n  protected function createSampleResponseContent() {\n    $content = array(\n      'paging' => array(\n        'cursors' => array(\n          'after' => $this->getUniquePageId(),\n          'before' => $this->getUniquePageId(),\n        ),\n      ),\n    ) + $this->createEmptyResponseContent();\n\n    $count = rand(2, 5);\n    for ($i = 0; $i < $count; $i++) {\n      $content['data'][] = array(\n        AbstractCrudObject::FIELD_ID => $i,\n      );\n    }\n\n    return $content;\n  }\n\n  /**\n   * @return string\n   */\n  protected function createUnparameterizedUrl() {\n    return Request::PROTOCOL_HTTPS\n      .Client::DEFAULT_LAST_LEVEL_DOMAIN\n      .'.'.Client::DEFAULT_GRAPH_BASE_DOMAIN\n      .'/node/edge';\n  }\n\n  /**\n   * @param int $num_pages\n   * @param RequestInterface|null $prev\n   * @return Mock|ResponseInterface\n   */\n  protected function createResponseChainMock(\n    $num_pages, RequestInterface $prev = null) {\n\n    $query_params = $prev ? clone $prev->getQueryParams() : new Parameters();\n    $sample_content = $this->createSampleResponseContent();\n\n    $request = $this->createRequestMock();\n    $request->method('getMethod')->willReturn(RequestInterface::METHOD_GET);\n    $request->method('getQueryParams')->willReturn($query_params);\n\n    $response = $this->createResponseMock();\n    $response->method('getRequest')->willReturn($request);\n\n    $request->method('execute')->willReturn($response);\n\n    $callback = function() use ($num_pages, $sample_content) {\n      return $num_pages > 0\n        ? $sample_content\n        : $this->createEmptyResponseContent();\n    };\n\n    $clone_callback = function() use ($num_pages, $request) {\n      return $this->createResponseChainMock(\n        $num_pages - 1, $request)->getRequest();\n    };\n\n    $url_callback = function() use ($query_params) {\n      return $this->createUnparameterizedUrl().'?'\n        .http_build_query($query_params->getArrayCopy());\n    };\n\n    $response->method('getContent')->willReturnCallback($callback);\n    $request->method('createClone')->willReturnCallback($clone_callback);\n    $request->method('getUrl')->willReturnCallback($url_callback);\n\n    return $response;\n  }\n\n  /**\n   * @return Mock|ResponseInterface\n   */\n  protected function createEmptyResponseMock() {\n    $response = $this->createResponseMock();\n    $response->method('getContent')->willReturn(array(\n      'data' => array(),\n    ));\n\n    return $response;\n  }\n\n  public function setup(): void {\n    parent::setup();\n    $this->objectPrototype = new EmptyObject();\n  }\n\n  public function tearDown(): void {\n    $this->objectPrototype = null;\n    parent::tearDown();\n  }\n\n  public function testGetters() {\n    $response = $this->createResponseChainMock(1);\n    $cursor = new Cursor($response, $this->objectPrototype);\n\n    $this->assertTrue($response === $cursor->getResponse());\n    $this->assertTrue($response === $cursor->getLastResponse());\n    $this->assertTrue(is_string($cursor->getAfter()));\n    $this->assertTrue(is_string($cursor->getBefore()));\n    $this->assertNotEquals($cursor->getBefore(), $cursor->getAfter());\n  }\n\n  /**\n   * @return array\n   */\n  public function responseDataStructureProvider() {\n    return array(\n      array(array()),\n      array(array('data' => null)),\n      array(array('data' => 1)),\n    );\n  }\n\n  /**\n   * @dataProvider responseDataStructureProvider\n   * @param mixed $content\n   */\n  public function testResponseDataStructure($content) {\n    $response = $this->createResponseMock();\n    $response->method('getContent')->willReturn($content);\n\n    $this->expectException(\\InvalidArgumentException::class);\n\n    new Cursor($response, $this->objectPrototype);\n  }\n\n  public function testIterator() {\n    $cursor = new Cursor(\n      $this->createResponseChainMock(1), $this->objectPrototype);\n\n    $this->assertTrue($cursor instanceof \\Iterator);\n\n    $k = 0;\n\n    foreach ($cursor as $key => $value) {\n      if ($key != $k) {\n        $this->fail('iteration count missmatch $key');\n      }\n      ++$k;\n    }\n\n    $this->assertEquals($k, count($cursor));\n\n    $cursor->rewind();\n\n    $this->assertEquals(0, $cursor->key());\n    $cursor->next();\n    $this->assertEquals(1, $cursor->key());\n    $cursor->prev();\n    $this->assertEquals(0, $cursor->key());\n\n    $this->assertEquals($cursor->getIndexLeft(), 0);\n    $this->assertEquals($cursor->getIndexRight(), count($cursor) - 1);\n  }\n\n  public function testCountable() {\n    $response = $this->createResponseChainMock(1);\n    $cursor = new Cursor($response, $this->objectPrototype);\n\n    $this->assertTrue($cursor instanceof \\Countable);\n    $this->assertEquals($cursor->count(), count($cursor));\n    $this->assertEquals(\n      $cursor->count(), count($response->getContent()['data']));\n  }\n\n  public function testArrayAccess() {\n    $response = $this->createResponseChainMock(1);\n    $test_index = rand(1, count($response->getContent()) - 1);\n\n    $cursor = new Cursor($response, $this->objectPrototype);\n\n    $this->assertTrue($cursor instanceof \\arrayaccess);\n\n    $subject = new EmptyObject();\n    $subject->setData($response->getContent()['data'][$test_index]);\n\n    // Checking offsetGet\n    $this->assertEquals($cursor[$test_index]->getData(), $subject->getData());\n    // Checking offsetExists\n    $this->assertFalse(isset($cursor[count($cursor)]));\n    // Checking offsetUnset\n    unset($cursor[$test_index]);\n    $this->assertNull($cursor[$test_index]);\n    // Checking offsetSet\n    $cursor->offsetSet($test_index, $subject);\n    $this->assertEquals($cursor[$test_index]->getData(), $subject->getData());\n    // Checking offsetSet - append\n    $count = count($cursor);\n    $cursor->offsetSet(null, new EmptyObject());\n    $this->assertEquals(count($cursor), $count + 1);\n  }\n\n  public function testUnneededFetch() {\n    $response = $this->createEmptyResponseMock();\n    $cursor = new Cursor($response, $this->objectPrototype);\n    $this->assertNull($cursor->createBeforeRequest());\n    $this->assertNull($cursor->createAfterRequest());\n\n    // Reset for proper fetching\n    $response = $this->createEmptyResponseMock();\n    $cursor = new Cursor($response, $this->objectPrototype);\n    $length = $cursor->count();\n    $cursor->fetchBefore();\n    $this->assertEquals($length, $cursor->count());\n    $cursor->fetchAfter();\n    $this->assertEquals($length, $cursor->count());\n  }\n\n  public function testIterability() {\n    $response = $this->createResponseChainMock(1);\n    $cursor = new Cursor($response, $this->objectPrototype);\n\n    $cursor->next();\n    $cursor->rewind();\n    $this->assertEquals($cursor->getIndexLeft(), $cursor->key());\n\n    $cursor->end();\n    $this->assertEquals($cursor->getIndexRight(), $cursor->key());\n\n    $index = rand($cursor->getIndexLeft(), $cursor->getIndexRight());\n    $cursor->seekTo($index);\n    $this->assertEquals($index, $cursor->key());\n\n    // Fetch after\n    $cursor = new Cursor($response, $this->objectPrototype);\n    $cursor->fetchAfter();\n    $this->assertFalse($response === $cursor->getLastResponse());\n  }\n\n  public function testRequestParamReset() {\n    $response = $this->createResponseChainMock(1);\n    $cursor = new Cursor($response, $this->objectPrototype);\n    $params = $cursor->getLastResponse()->getRequest()->getQueryParams();\n    $params->offsetSet('after', $this->getUniquePageId());\n    $params->offsetSet('before', $this->getUniquePageId());\n\n    $cursor->fetchAfter();\n    $params2 = $cursor->getLastResponse()->getRequest()->getQueryParams();\n    $this->assertNotEquals(\n      $params->offsetGet('after'), $params2->offsetGet('after'));\n  }\n\n  public function testImplicitFetch() {\n    // Test setters/getters\n    $response = $this->createEmptyResponseMock();\n    $cursor = new Cursor($response, $this->objectPrototype);\n\n    $this->assertFalse(Cursor::getDefaultUseImplicitFetch());\n    $this->assertFalse($cursor->getUseImplicitFetch());\n    $cursor->setUseImplicitFetch(true);\n    $this->assertTrue($cursor->getUseImplicitFetch());\n\n    Cursor::setDefaultUseImplicitFetch(true);\n\n    $response = $this->createEmptyResponseMock();\n    $cursor = new Cursor($response, $this->objectPrototype);\n    $this->assertTrue(Cursor::getDefaultUseImplicitFetch());\n    $this->assertTrue($cursor->getUseImplicitFetch());\n\n    // Test ordered iteration\n    // f() lower interval * min repetition > upper interval\n    // Min repetition > upper interval / lower interval -> f(x): x > 5 / 2 -> 3\n    $response = $this->createResponseChainMock(3);\n    $cursor = new Cursor($response, $this->objectPrototype);\n    while ($cursor->valid()) {\n      $cursor->next();\n    }\n\n    // Min upper boundary = upper interval + 1 = 5 + 1 = 6\n    $this->assertGreaterThanOrEqual(6, $cursor->count());\n\n    // Test rervese iteration\n    // same f()\n    $response = $this->createResponseChainMock(3);\n    $cursor = new Cursor($response, $this->objectPrototype);\n\n    $count = 0;\n    while ($cursor->valid()) {\n      $cursor->prev();\n    }\n\n    $this->assertGreaterThanOrEqual(6, $cursor->count());\n\n    // Force the array out of boundaries\n    $response = $this->createResponseChainMock(1);\n    $cursor = new Cursor($response, $this->objectPrototype);\n    $cursor->setUseImplicitFetch(false);\n    $cursor->prev();\n\n    // Restore static behaviour\n    Cursor::setDefaultUseImplicitFetch(false);\n  }\n\n  public function testExportability() {\n    $response = $this->createResponseChainMock(1);\n    $cursor = new Cursor($response, $this->objectPrototype);\n    $array_copy = $cursor->getArrayCopy();\n\n    $this->assertTrue(is_array($array_copy));\n    $this->assertEquals($cursor->getArrayCopy(), $cursor->getObjects());\n    $this->assertEquals(\n      count($array_copy), count($response->getContent()['data']));\n\n    foreach ($array_copy as $object) {\n      if (!$object instanceof AbstractObject) {\n        $this->fail(\"Wrong instance in array copy\");\n      }\n    }\n\n    $cursor->fetchAfter();\n    $cursor->fetchBefore();\n\n    $index = $cursor->getIndexLeft();\n    // Test in-memory order while exporting\n    foreach ($cursor->getArrayCopy(true) as $key => $object) {\n      if ($key < $index) {\n        $this->fail(\"Wrong order in sorted array copy\");\n      }\n    }\n  }\n}\n", "num_lines": 387}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest;\n\nuse FacebookAds\\Session;\n\nclass SessionTest extends AbstractUnitTestCase {\n\n  /**\n   * @return Session\n   */\n  protected function createSession() {\n    return new Session(\n      static::VALUE_SESSION_APP_ID,\n      static::VALUE_SESSION_APP_SECRET,\n      static::VALUE_SESSION_ACCESS_TOKEN);\n  }\n\n  public function testGetters() {\n    $session = $this->createSession();\n\n    $this->assertEquals(\n      static::VALUE_SESSION_APP_ID, $session->getAppId());\n    $this->assertEquals(\n      static::VALUE_SESSION_APP_SECRET, $session->getAppSecret());\n    $this->assertEquals(\n      static::VALUE_SESSION_ACCESS_TOKEN, $session->getAccessToken());\n  }\n\n  public function testAppSecretProof() {\n    $session = $this->createSession();\n    $proof = $session->getAppSecretProof();\n\n    // Assert SHA-2 > 256 bits > 64 chars\n    $this->assertTrue(strlen($proof) == 64);\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Bootstrap;\n\nuse FacebookAdsTest\\Config\\Config;\n\nclass Bootstrap {\n\n  /**\n   * @var self\n   */\n  private static $instance;\n\n  /**\n   * @var bool\n   */\n  private $isIntialized = false;\n\n  /**\n   * @var array|null\n   */\n  protected $configData;\n\n  /**\n   * @var Config|null\n   */\n  protected $config;\n\n  /**\n   * @var mixed\n   */\n  protected $autoloader;\n\n  /**\n   * @throws \\LogicException\n   */\n  final public function __construct() {\n    if (self::$instance !== null) {\n      throw new \\LogicException(\"Bootstrap already instanciated\");\n    }\n\n    self::$instance = $this;\n  }\n\n  /**\n   * @return string\n   */\n  protected function getComposerAutoloadPath() {\n    return __DIR__.'/../../../vendor/autoload.php';\n  }\n\n  /**\n   * @return mixed\n   */\n  public function getAutoloader() {\n    if ($this->autoloader === null) {\n      $autoload_path = $this->getComposerAutoloadPath();\n      if (!is_readable($autoload_path)) {\n        throw new \\RuntimeException(\"Could not read \".$autoload_path);\n      }\n      $this->autoloader = include $autoload_path;\n      $this->autoloader->addPsr4('FacebookAdsTest\\\\', __DIR__.'/../');\n    }\n\n    return $this->autoloader;\n  }\n\n  /**\n   * Simplifies the common pattern of checking for an index in an array\n   * and selecting a default value if it does not exist\n   *\n   * @param array $array\n   * @param string|int $key\n   * @param mixed $default\n   * @return mixed\n   */\n  protected function idx(array $array, $key, $default = null) {\n    return array_key_exists($key, $array) && $array[$key] !== ''\n      ? $array[$key]\n      : $default;\n  }\n\n  /**\n   * Simplifies the common pattern of checking for an index in an array\n   * and throw an exception if not\n   *\n   * @param array $array\n   * @param string|int $key\n   * @return mixed\n   * @throws \\Exception\n   */\n  protected function idxt(array $array, $key) {\n    if (!array_key_exists($key, $array) || !$array[$key]) {\n      throw new \\Exception(\"Missing mandatory config '{$key}'\");\n    }\n\n    return $array[$key];\n  }\n\n  /**\n   * @return Config\n   */\n  public function getConfig() {\n    if ($this->config === null) {\n      $this->config = new Config();\n      $this->config->testRunId\n        = md5($this->idx($_SERVER, 'LOGNAME', uniqid(true)).microtime(true));\n      $this->config->testImagePath = __DIR__.'/../../misc/image.png';\n      $this->config->testZippedImagesPath = __DIR__.'/../../misc/images.zip';\n      $this->config->testVideoPath = __DIR__.'/../../misc/video.mp4';\n    }\n\n    return $this->config;\n  }\n\n  /**\n   * @throws \\LogicException\n   */\n  public function init() {\n    if ($this->isIntialized) {\n      throw new \\LogicException(\"Bootstrap already initialized\");\n    }\n\n    $this->getAutoloader();\n    Config::setInstance($this->getConfig());\n  }\n}\n", "num_lines": 150}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Bootstrap;\n\nuse FacebookAdsTest\\Config\\Config;\nuse FacebookAdsTest\\Config\\SkippableFeaturesManager;\n\nclass IntegrationBootstrap extends Bootstrap {\n\n  /**\n   * @param string $file_path\n   * @return array\n   * @throws \\RuntimeException\n   */\n  protected function loadConfigData($file_path) {\n    if (!is_readable($file_path)) {\n      throw new \\RuntimeException(\"Could not read {$file_path}\");\n    }\n\n    $data = require $file_path;\n    if (!is_array($data)) {\n      throw new \\RuntimeException(\"Invalid config structure\");\n    }\n\n    return $data;\n  }\n\n  /**\n   * @return array\n   */\n  protected function getConfigData() {\n    if ($this->configData === null) {\n      $this->configData = $this->loadConfigData(__DIR__.'/../../config.php');\n    }\n\n    return $this->configData;\n  }\n\n  /**\n   * @param string|int $key\n   * @param mixed $default\n   * @return mixed\n   */\n  protected function confx($key, $default = null) {\n    return $this->idx($this->getConfigData(), $key, $default);\n  }\n\n  /**\n   * @param string|int $key\n   * @return mixed\n   * @throws \\Exception\n   */\n  protected function confxt($key) {\n    return $this->idxt($this->getConfigData(), $key);\n  }\n\n  /**\n   * @return Config\n   */\n  protected function getUnitConfig() {\n    return parent::getConfig();\n  }\n\n  /**\n   * @return Config\n   */\n  public function getConfig() {\n    if ($this->config === null) {\n      $this->config = parent::getConfig();\n      $this->config->appId = $this->confx('app_id');\n      $this->config->appSecret = $this->confx('app_secret');\n      $this->config->accessToken = $this->confx('access_token');\n      $this->config->accountId = $this->confx('act_id');\n      $this->config->pageId = $this->confx('page_id');\n      $this->config->appUrl = $this->confx('app_url');\n      $this->config->businessId = $this->confx('business_id');\n      $this->config->instagramActorId = $this->confx('instagram_actor_id');\n\n      // Optionals: Override unit config\n      $this->config->testRunId = $this->confx(\n        'test_run_id', $this->config->testRunId);\n      $this->config->testImagePath = $this->confx(\n        'test_image_path', $this->config->testImagePath);\n      $this->config->testZippedImagesPath = $this->confx(\n        'test_zipped_images_path', $this->config->testZippedImagesPath);\n      $this->config->testVideoPath = $this->confx(\n        'test_video_path', $this->config->testVideoPath);\n\n      // Optionals\n      $this->config->secondaryBusinessId\n        = $this->confx('secondary_business_id', '');\n      $this->config->secondaryAccountId\n        = $this->confx('secondary_account_id', '');\n      $this->config->secondaryPageId = $this->confx('secondary_page_id', '');\n      $this->config->secondaryAppId = $this->confx('secondary_app_id', '');\n      $this->config->graphBaseDomain = $this->confx('graph_base_domain');\n      $this->config->skipSslVerification\n        = $this->confx('skip_ssl_verification', false);\n      $this->config->curlLogger = $this->confx('curl_logger');\n\n      SkippableFeaturesManager::setInstance(\n        new SkippableFeaturesManager($this->confx('skip_if', array())));\n    }\n\n    return $this->config;\n  }\n}\n", "num_lines": 130}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Config;\n\nfinal class Config {\n\n  /**\n   * @var self\n   */\n  protected static $instance;\n\n  /**\n   * @var string\n   */\n  public $testRunId;\n\n  /**\n   * @var string\n   */\n  public $testImagePath;\n\n  /**\n   * @var string\n   */\n  public $testZippedImagesPath;\n\n  /**\n   * @var string\n   */\n  public $testVideoPath;\n\n  /**\n   * @var string\n   */\n  public $curlLogger;\n\n  /**\n   * @var string\n   */\n  public $appId;\n\n  /**\n   * @var string\n   */\n  public $appSecret;\n\n  /**\n   * @var string\n   */\n  public $accessToken;\n\n  /**\n   * @var string\n   */\n  public $businessId;\n\n  /**\n   * @var string\n   */\n  public $accountId;\n\n  /**\n   * @var string\n   */\n  public $pageId;\n\n  /**\n   * @var string\n   */\n  public $appUrl;\n\n  /**\n   * @var string\n   */\n  public $instagramActorId;\n\n  /**\n   * @var string\n   */\n  public $secondaryBusinessId;\n\n  /**\n   * @var string\n   */\n  public $secondaryPageId;\n\n  /**\n   * @var string\n   */\n  public $secondaryAccountId;\n\n  /**\n   * @var string\n   */\n  public $secondaryAppId;\n\n  /**\n   * @var string\n   */\n  public $graphBaseDomain;\n\n  /**\n   * @var bool\n   */\n  public $skipSslVerification;\n\n  /**\n   * @return Config\n   */\n  public static function instance() {\n    return self::$instance ?: (self::$instance = new self());\n  }\n\n  /**\n   * @param Config $config\n   */\n  public static function setInstance(Config $config) {\n    self::$instance = $config;\n  }\n\n  /**\n   * @param string $key\n   * @param string $value\n   */\n  public function __set($key, $value) {\n    throw new \\RuntimeException(\"Unsupported key: {$key}\");\n  }\n}\n", "num_lines": 151}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Config;\n\nuse FacebookAdsTest\\AbstractTestCase;\n\nfinal class SkippableFeaturesManager {\n\n  /**\n   * @var SkippableFeaturesManager\n   */\n  private static $instance;\n\n  /**\n   * @var array\n   */\n  protected $data = array();\n\n  /**\n   * @return SkippableFeaturesManager\n   */\n  public static function instance() {\n    return self::$instance ?: (self::$instance = new self());\n  }\n\n  /**\n   * @param SkippableFeaturesManager $manager\n   */\n  public static function setInstance(SkippableFeaturesManager $manager) {\n    self::$instance = $manager;\n  }\n\n  /**\n   * @param array $data\n   */\n  public function __construct(array $data = array()) {\n    $this->setData($data);\n  }\n\n  public function setData(array $data = array()) {\n    $this->data = $data;\n  }\n\n  /**\n   * @return array\n   */\n  public function getData() {\n    return $this->data;\n  }\n\n  /**\n   * @param $key\n   * @return bool\n   */\n  public function isSkipKey($key) {\n    return array_key_exists($key, $this->data) && $this->data[$key];\n  }\n\n  /**\n   * @param AbstractTestCase $test\n   * @return bool\n   */\n  public function enforceSkipTest(AbstractTestCase $test) {\n    if ($test instanceof SkippableFeatureTestInterface) {\n      foreach ($test->skipIfAny() as $key) {\n        if ($this->isSkipKey($key)) {\n          /** @var AbstractTestCase $test */\n          $test->markTestSkipped(\"Reason: skipped by config '{$key}'\");\n        }\n      }\n    }\n  }\n}\n", "num_lines": 96}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Config;\n\ninterface SkippableFeatureTestInterface {\n\n  /**\n   * @return array\n   */\n  public function skipIfAny();\n}\n", "num_lines": 34}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Enum;\n\nuse FacebookAds\\Enum\\AbstractEnum;\n\nclass DummyEnum extends AbstractEnum {\n\n  const NAME_1 = 'VALUE_1';\n  const NAME_2 = 'VALUE_2';\n}\n", "num_lines": 34}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Enum;\n\nuse FacebookAds\\Enum\\EmptyEnum;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass EnumTest extends AbstractUnitTestCase {\n\n  public function testSingleton() {\n    $this->assertTrue(DummyEnum::getInstance() === DummyEnum::getInstance());\n  }\n\n  public function testAccess() {\n    $this->assertEquals(DummyEnum::className(), get_class(new DummyEnum()));\n\n    $enum = DummyEnum::getInstance();\n    $copy = $enum->getArrayCopy();\n    $names = $enum->getNames();\n    $values = $enum->getValues();\n    $values_map = $enum->getValuesMap();\n\n    $this->assertEquals(2, count($copy));\n    $this->assertArrayHasKey('NAME_1', $copy);\n    $this->assertEquals(DummyEnum::NAME_1, $copy['NAME_1']);\n\n    $this->assertEquals(2, count($names));\n    $this->assertTrue(in_array('NAME_1', $names));\n\n    $this->assertEquals(2, count($values));\n    $this->assertTrue(in_array(DummyEnum::NAME_1, $values));\n\n    $this->assertEquals(2, count($values_map));\n    $this->assertArrayHasKey(DummyEnum::NAME_1, $values_map);\n\n    $this->assertEquals(DummyEnum::NAME_1, $enum->getValueForName('NAME_1'));\n  }\n\n  public function testLazyLoading() {\n    $enum = DummyEnum::getInstance();\n\n    $this->assertTrue($enum->getArrayCopy() === $enum->getArrayCopy());\n    $this->assertTrue($enum->getNames() === $enum->getNames());\n    $this->assertTrue($enum->getValues() === $enum->getValues());\n    $this->assertTrue($enum->getValuesMap() === $enum->getValuesMap());\n  }\n\n  public function testValidation() {\n    $enum = DummyEnum::getInstance();\n\n    $this->assertTrue($enum->isValid('NAME_1'));\n    $this->assertFalse($enum->isValid('NAME_ND'));\n    $this->assertTrue($enum->isValidValue(DummyEnum::NAME_1));\n    $this->assertFalse($enum->isValidValue('VALUE_ND'));\n  }\n\n\n  public function testAssurance() {\n    $enum = DummyEnum::getInstance();\n\n    $this->assertEquals(DummyEnum::NAME_1, $enum->assureValueForName('NAME_1'));\n    $this->assertWillThrow(function() use ($enum) {\n      $enum->assureValueForName('NAME_ND');\n    }, 'InvalidArgumentException');\n\n    $enum->assureIsValid('NAME_1');\n    $this->assertWillThrow(function() use ($enum) {\n      $enum->assureIsValid('NAME_ND');\n    }, 'InvalidArgumentException');\n\n    $enum->assureIsValidValue(DummyEnum::NAME_1);\n    $this->assertWillThrow(function() use ($enum) {\n      $enum->assureIsValidValue('VALUE_ND');\n    }, 'InvalidArgumentException');\n  }\n\n  public function testEmptyEnum() {\n    $enum = EmptyEnum::getInstance();\n\n    $this->assertEquals(array(), $enum->getArrayCopy());\n    $this->assertEquals(array(), $enum->getNames());\n    $this->assertEquals(array(), $enum->getValues());\n    $this->assertEquals(array(), $enum->getValuesMap());\n  }\n}\n", "num_lines": 108}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Exception;\n\nuse FacebookAds\\Http\\Exception\\RequestException;\n\nclass PHPUnitRequestExceptionWrapper\n  extends \\PHPUnit_Framework_ExceptionWrapper {\n\n  /**\n   * @var RequestException\n   */\n  protected $wrappedException;\n\n  /**\n   * @param RequestException $e\n   */\n  public function __construct(RequestException $e) {\n    $this->wrappedException = $e;\n    parent::__construct($e);\n  }\n\n  /**\n   * @return RequestException\n   */\n  public function getWrappedException() {\n    return $this->wrappedException;\n  }\n\n  protected function requestToString(RequestException $e) {\n    if ($e->getResponse() === null) {\n      return '-';\n    }\n\n    $request = $e->getResponse()->getRequest();\n\n    return sprintf(\n      \"%s %s\\n%s\",\n      $request->getMethod(),\n      $request->getUrl(),\n      \"    \".str_replace(\"\\n\", \"\\n    \", json_encode(\n        $request->getFileParams()->getArrayCopy()\n          + $request->getBodyParams()->getArrayCopy(),\n        JSON_PRETTY_PRINT)));\n  }\n\n  /**\n   * @return string\n   */\n  protected function blameFieldSpecsToString() {\n    return implode(\", \", array_map(function($value) {\n      return $value[0];\n    }, $this->getWrappedException()->getErrorBlameFieldSpecs()));\n  }\n\n  /**\n   * @return string\n   */\n  public function __toString() {\n    $string = \\PHPUnit_Framework_TestFailure::exceptionToString($this);\n\n    $e = $this->getWrappedException();\n\n    $string .= \"\\n  Request: \".$this->requestToString($e).\"\\n\"\n      .\"  HTTP status Code: \".$e->getHttpStatusCode().\"\\n\"\n      .\"  Is transient: \".($e->isTransient() ? 'true' : 'false').\"\\n\"\n      .\"  Code: \".$e->getCode().\"\\n\"\n      .\"  Error Subcode: \".$e->getErrorSubcode().\"\\n\"\n      .\"  Error User Title: \".$e->getErrorUserTitle().\"\\n\"\n      .\"  Error User Message: \".$e->getErrorUserMessage().\"\\n\";\n\n    if ($e->getErrorBlameFieldSpecs()) {\n      $string .= \"  Error Blame Fields: \".$this->blameFieldSpecsToString().\"\\n\";\n    }\n\n    if ($trace = \\PHPUnit_Util_Filter::getFilteredStacktrace($this)) {\n      $string .= \"\\n\" . $trace;\n    }\n\n    if ($this->previous) {\n      $string .= \"\\nCaused by\\n\" . $this->previous;\n    }\n\n    return $string;\n  }\n}\n", "num_lines": 109}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Http;\n\nuse FacebookAds\\ApiConfig;\nuse FacebookAds\\Http\\Adapter\\AdapterInterface;\nuse FacebookAds\\Http\\Adapter\\CurlAdapter;\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\Exception\\EmptyResponseException;\nuse FacebookAds\\Http\\Exception\\RequestException;\nuse FacebookAds\\Http\\Headers;\nuse FacebookAds\\Http\\Request;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\Response;\nuse FacebookAds\\Http\\ResponseInterface;\nuse FacebookAdsTest\\AbstractUnitTestCase;\nuse \\PHPUnit_Framework_MockObject_Builder_InvocationMocker as Mock;\n\nclass ClientTest extends AbstractUnitTestCase {\n\n  /**\n   * @param mixed $response_content\n   * @return Mock|AdapterInterface\n   */\n  protected function createMockChain($response_content) {\n    $adapter = $this->createAdapterMock();\n    $response = $this->createResponseMock();\n    $response->method('getContent')->willReturn($response_content);\n    $adapter->method('sendRequest')->willReturn($response);\n\n    return $adapter;\n  }\n\n  public function testPrototypes() {\n    $client = new Client();\n\n    $request_proto = $this->createRequestMock();\n    $request_proto->method('createClone')->willReturnSelf();\n    $client->setRequestPrototype($request_proto);\n    $this->assertTrue($request_proto === $client->getRequestPrototype());\n    $this->assertTrue($client->createRequest() instanceof RequestInterface);\n\n    $response_proto = $this->createResponseMock();\n    $client->setResponsePrototype($response_proto);\n    $this->assertTrue($response_proto === $client->getResponsePrototype());\n    $this->assertTrue($client->createResponse() instanceof ResponseInterface);\n\n    // Default initialization\n    $client = new Client();\n    $this->assertTrue($client->getRequestPrototype() instanceof Request);\n    $this->assertTrue($client->getResponsePrototype() instanceof Response);\n  }\n\n  public function testHeaders() {\n    $headers = new Headers();\n    $this->assertTrue($headers instanceof \\IteratorAggregate);\n    $this->assertTrue($headers instanceof \\Traversable);\n    $this->assertTrue($headers instanceof \\ArrayAccess);\n    $this->assertTrue($headers instanceof \\Serializable);\n    $this->assertTrue($headers instanceof \\Countable);\n\n    $client = new Client();\n    $client->setDefaultRequestHeaders($headers);\n    $this->assertTrue($headers === $client->getDefaultRequestHeaders());\n\n    // Default initialization\n    $client = new Client();\n    $headers = $client->getDefaultRequestHeaders();\n    $this->assertTrue($headers instanceof Headers);\n    $this->assertTrue($headers === $client->getDefaultRequestHeaders());\n    $this->assertArrayHasKey('User-Agent', $headers);\n    $this->assertEquals('fbbizsdk-php-v'.ApiConfig::SDKVersion, $headers['User-Agent']);\n  }\n\n  public function testDomain() {\n    $client = new Client();\n    $this->assertEquals(\n      Client::DEFAULT_GRAPH_BASE_DOMAIN, $client->getDefaultGraphBaseDomain());\n\n    $domain = 'not.facebook.com';\n    $client->setDefaultGraphBaseDomain($domain);\n    $this->assertEquals($domain, $client->getDefaultGraphBaseDomain());\n  }\n\n  public function testAdapter() {\n    $client = new Client();\n\n    $adapter = $this->createAdapterMock();\n    $client->setAdapter($adapter);\n    $this->assertTrue($client->getAdapter() instanceof AdapterInterface);\n    $this->assertTrue($adapter === $client->getAdapter());\n\n    // Default initialization\n    $client = new Client();\n    $this->assertTrue($client->getAdapter() instanceof CurlAdapter);\n  }\n\n  public function testCaBundlePath() {\n    $client = new Client();\n    $path = '/tmp/dont_care_if_exists';\n    $client->setCaBundlePath($path);\n    $this->assertEquals($path, $client->getCaBundlePath());\n\n    // Default initialization\n    $client = new Client();\n    $this->assertFalse(!$client->getCaBundlePath());\n    $this->assertFileExists($client->getCaBundlePath());\n  }\n\n  public function testSendRequest() {\n    $client = new Client();\n\n    // Empty response > json_decode('') = null\n    $client->setAdapter($this->createMockChain(null));\n\n    $exception_catched = false;\n    try {\n      $client->sendRequest($this->createRequestMock());\n    } catch (EmptyResponseException $e) {\n      $exception_catched = true;\n    }\n    $this->assertTrue($exception_catched);\n\n    // Error payload\n    $client->setAdapter($this->createMockChain(array(\n      'error' => array(\n        'message' => 'Stub Server Error Message',\n        'type' => 'FacebookApiException',\n        'code' => 1,\n      ),\n    )));\n\n    $exception_catched = false;\n    try {\n      $client->sendRequest($this->createRequestMock());\n    } catch (EmptyResponseException $e) {\n      $this->fail(\"Catched wrong RequestException\");\n    } catch (RequestException $e) {\n      $exception_catched = true;\n    }\n    $this->assertTrue($exception_catched);\n\n    // Success\n    $client->setAdapter($this->createMockChain(array(\n      'id' => 4,\n    )));\n\n    $response = $client->sendRequest($this->createRequestMock());\n    $this->assertTrue($response instanceof ResponseInterface);\n    $content = $response->getContent();\n    $this->assertArrayHasKey('id', $content);\n    $this->assertEquals($content['id'], 4);\n  }\n}\n", "num_lines": 177}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Http;\n\nuse FacebookAds\\Http\\FileParameter;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass FileParameterTest extends AbstractUnitTestCase {\n\n  public function testGetters() {\n    $path = 'PATH';\n    $name = 'NAME';\n    $mime_type = 'MIME_TYPE';\n    $param = (new FileParameter($path))\n      ->setName($name)\n      ->setMimeType($mime_type);\n\n    $this->assertEquals($param->getPath(), $path);\n    $this->assertEquals($param->getName(), $name);\n    $this->assertEquals($param->getMimeType(), $mime_type);\n  }\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Http;\n\nuse FacebookAds\\Http\\Parameters;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass ParametersTest extends AbstractUnitTestCase {\n\n  public function testInterfaces() {\n    $parameters = new Parameters();\n    $this->assertTrue($parameters instanceof \\IteratorAggregate);\n    $this->assertTrue($parameters instanceof \\Traversable);\n    $this->assertTrue($parameters instanceof \\ArrayAccess);\n    $this->assertTrue($parameters instanceof \\Serializable);\n    $this->assertTrue($parameters instanceof \\Countable);\n  }\n\n  public function testEnhance() {\n    $parameters = new Parameters();\n    $copy = $parameters->getArrayCopy();\n\n    $data = array(\n      'foo' => 0,\n      'bar' => 1,\n    );\n\n    $copy = array_merge($copy, $data);\n    $parameters->enhance($data);\n    $this->assertEquals($copy, $parameters->getArrayCopy());\n\n    $data = array(\n      'bar' => -1,\n      'baz' => 2,\n    );\n\n    $copy = array_merge($copy, $data);\n    $parameters->enhance($data);\n    $this->assertEquals($copy, $parameters->getArrayCopy());\n  }\n\n  public function testExport() {\n    $parameters = new Parameters();\n    $parameters['scalar'] = 1;\n    $parameters['non_scalar'] = array(0, '1', true);\n    $data = $parameters->export();\n    $this->assertArrayHasKey('scalar', $data);\n    $this->assertEquals(1, $data['scalar']);\n    $this->assertArrayHasKey('non_scalar', $data);\n    $this->assertEquals('[0,\"1\",true]', $data['non_scalar']);\n  }\n}\n", "num_lines": 75}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Http;\n\nuse FacebookAds\\Api;\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\Headers;\nuse FacebookAds\\Http\\Parameters;\nuse FacebookAds\\Http\\Request;\nuse FacebookAds\\Http\\ResponseInterface;\nuse FacebookAds\\Http\\Util;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass RequestTest extends AbstractUnitTestCase {\n\n  /**\n   * @return Request\n   */\n  protected function createRequest() {\n    return new Request($this->createClientMock());\n  }\n\n  public function testGetters() {\n    $client = $this->createClientMock();\n    $request = new Request($client);\n\n    $this->assertTrue($request->getClient() instanceof Client);\n    $this->assertTrue($client === $request->getClient());\n  }\n\n  public function testProtocol() {\n    $request = $this->createRequest();\n    $protocol = Request::PROTOCOL_HTTP;\n    $request->setProtocol($protocol);\n    $this->assertEquals($protocol, $request->getProtocol());\n  }\n\n  public function testDomain() {\n    $request = $this->createRequest();\n    $domain = 'not.facebook.com';\n    $request->setDomain($domain);\n    $this->assertEquals($domain, $request->getDomain());\n\n    // Default initialization\n    $client = $this->createClientMock();\n    $client->method('getDefaultGraphBaseDomain')\n      ->willReturn('not.facebook.com');\n    $request = new Request($client);\n    $domain = $request->getDomain();\n    $this->assertRegExp('/.+\\.not\\.facebook\\.com/', $domain);\n    $this->assertEquals($domain, $request->getDomain());\n\n    // Partially set\n    $client = $this->createClientMock();\n    $client->method('getDefaultGraphBaseDomain')\n      ->willReturn('probably.not.facebook.com');\n    $request = new Request($client);\n    $request->setLastLevelDomain('most');\n    $domain = $request->getDomain();\n    $this->assertEquals('most.probably.not.facebook.com', $domain);\n    $this->assertEquals($domain, $request->getDomain());\n  }\n\n  public function testHeaders() {\n    $client = $this->createClientMock();\n    $request = new Request($client);\n    $headers = $this->createHeadersMock();\n    $client->setDefaultRequestHeaders($headers);\n    $request->setHeaders($headers);\n    $headers_mirror = $request->getHeaders();\n    $this->assertTrue($headers_mirror instanceof Headers);\n    $this->assertTrue($headers_mirror === $request->getHeaders());\n\n    // Default initialization\n    $headers = new Headers();\n    $client = $this->createClientMock();\n    $client->method('getDefaultRequestHeaders')->willReturn($headers);\n    $request = new Request($client);\n    $headers_mirror = $request->getHeaders();\n    $this->assertTrue($headers_mirror instanceof Headers);\n    $this->assertFalse($headers === $request->getHeaders());\n    $this->assertTrue($headers_mirror === $request->getHeaders());\n  }\n\n  public function testMethod() {\n    $request = $this->createRequest();\n    $method = Request::METHOD_GET;\n    $request->setMethod($method);\n    $this->assertEquals($method, $request->getMethod());\n  }\n\n  public function testPath() {\n    $request = $this->createRequest();\n    $path = '/node/edge';\n    $request->setPath($path);\n    $this->assertEquals($path, $request->getPath());\n  }\n\n  public function testGraphVersion() {\n    $request = $this->createRequest();\n    $graph_version = Api::VERSION;\n    $request->setGraphVersion($graph_version);\n    $this->assertEquals($graph_version, $request->getGraphVersion());\n  }\n\n  public function testQueryParams() {\n    $request = $this->createRequest();\n    $parameters = $this->createParametersMock();\n    $request->setQueryParams($parameters);\n    $this->assertTrue($request->getQueryParams() instanceof Parameters);\n    $this->assertTrue($parameters === $request->getQueryParams());\n\n    // Default initialization\n    $request = $this->createRequest();\n    $parameters = $request->getQueryParams();\n    $this->assertTrue($parameters instanceof Parameters);\n    $this->assertTrue($parameters === $request->getQueryParams());\n  }\n\n  public function testBodyParams() {\n    $request = $this->createRequest();\n    $parameters = $this->createParametersMock();\n    $request->setBodyParams($parameters);\n    $this->assertTrue($request->getBodyParams() instanceof Parameters);\n    $this->assertTrue($parameters === $request->getBodyParams());\n\n    // Default initialization\n    $request = $this->createRequest();\n    $parameters = $request->getBodyParams();\n    $this->assertTrue($parameters instanceof Parameters);\n    $this->assertTrue($parameters === $request->getBodyParams());\n  }\n\n  public function testFileParams() {\n    $request = $this->createRequest();\n    $parameters = $this->createParametersMock();\n    $request->setFileParams($parameters);\n    $this->assertTrue($request->getFileParams() instanceof Parameters);\n    $this->assertTrue($parameters === $request->getFileParams());\n\n    // Default initialization\n    $request = $this->createRequest();\n    $parameters = $request->getFileParams();\n    $this->assertTrue($parameters instanceof Parameters);\n    $this->assertTrue($parameters === $request->getFileParams());\n  }\n\n  public function testClone() {\n    $request = $this->createRequest();\n    $query_params = $this->createParametersMock();\n    $request->setFileParams($query_params);\n    $body_params = $this->createParametersMock();\n    $request->setBodyParams($body_params);\n    $file_params = $this->createParametersMock();\n    $request->setFileParams($file_params);\n\n    $clone = $request->createClone();\n    $this->assertFalse($query_params === $clone->getQueryParams());\n    $this->assertFalse($body_params === $clone->getBodyParams());\n    $this->assertFalse($file_params === $clone->getFileParams());\n  }\n\n  public function testUrlCustomArgSeparator(){\n      $separator = ini_get('arg_separator.output');\n      ini_set('arg_separator.output', '&amp;');\n      $this->testUrl();\n      ini_set('arg_separator.output', $separator);\n  }\n\n  /**\n   * @depends testProtocol\n   * @depends testDomain\n   * @depends testGraphVersion\n   * @depends testPath\n   * @depends testQueryParams\n   */\n  public function testUrl() {\n    $client = $this->createClientMock();\n    $client->method('getDefaultGraphBaseDomain')\n      ->willReturn(Client::DEFAULT_GRAPH_BASE_DOMAIN);\n    $request = new Request($client);\n    $request->setGraphVersion('2.2');\n    $request->setPath('/node/edge');\n    $url = $request->getUrl();\n    $this->assertEquals(\n      parse_url($url, PHP_URL_SCHEME).'://', $request->getProtocol());\n    $this->assertEquals(parse_url($url, PHP_URL_HOST), $request->getDomain());\n    $this->assertEquals(\n      parse_url($url, PHP_URL_PATH),\n      sprintf(\"/v%s%s\", $request->getGraphVersion(), $request->getPath()));\n    $this->assertNull(parse_url($url, PHP_URL_QUERY));\n\n    // With query\n    $params = array(\n      'sdk' => 'PHP',\n      'names' => 'abc,def',\n    );\n    $request->setQueryParams(new Parameters($params));\n    $url = $request->getUrl();\n    $parsed_query = Util::parseUrlQuery(parse_url($url, PHP_URL_QUERY));\n    $this->assertEquals(\n      $parsed_query, $request->getQueryParams()->getArrayCopy());\n  }\n\n  public function testExecute() {\n    $response = $this->createResponseMock();\n    $client = $this->createClientMock();\n    $client->method('sendRequest')->willReturn($response);\n    $request = new Request($client);\n    $response_mirror = $request->execute();\n    $this->assertTrue($response_mirror instanceof ResponseInterface);\n    $this->assertTrue($response_mirror === $response);\n  }\n}\n", "num_lines": 237}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Http;\n\nuse FacebookAds\\Http\\Headers;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\Response;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass ResponseTest extends AbstractUnitTestCase {\n\n  /**\n   * @return Response\n   */\n  protected function createResponse() {\n    return new Response();\n  }\n\n  public function testRequest() {\n    $response = $this->createResponse();\n    $request = $this->createRequestMock();\n    $response->setRequest($request);\n    $request_mirror = $response->getRequest();\n    $this->assertTrue($request_mirror instanceof RequestInterface);\n    $this->assertTrue($request_mirror === $request);\n  }\n\n  public function testStatusCode() {\n    $response = $this->createResponse();\n    $response->setStatusCode(200);\n    $this->assertEquals(200, $response->getStatusCode());\n  }\n\n  public function testHeaders() {\n    $response = $this->createResponse();\n    $headers = $this->createHeadersMock();\n    $response->setHeaders($headers);\n    $headers_mirror = $response->getHeaders();\n    $this->assertTrue($headers_mirror instanceof Headers);\n    $this->assertTrue($headers_mirror === $response->getHeaders());\n\n    // Default initialization\n    $response = $this->createResponse();\n    $headers_mirror = $response->getHeaders();\n    $this->assertTrue($headers instanceof Headers);\n    $this->assertTrue($headers_mirror === $response->getHeaders());\n  }\n\n  public function testBodyContent() {\n    $response = $this->createResponse();\n    $body = '{\"data\":[]}';\n    $response->setBody($body);\n    $this->assertEquals($body, $response->getBody());\n    $this->assertEquals(array('data' => array()), $response->getContent());\n  }\n}\n", "num_lines": 79}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Http\\Adapter;\n\nuse FacebookAds\\Http\\Adapter\\AdapterInterface;\nuse FacebookAds\\Http\\Client;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nabstract class AbstractAdapterTest extends AbstractUnitTestCase {\n\n  /**\n   * @param Client $client\n   * @return AdapterInterface\n   */\n  abstract protected function createAdapter($client = null);\n\n  public function testGetters() {\n    $client = new Client();\n    $adapter = $this->createAdapter($client);\n    $this->assertTrue($client === $adapter->getClient());\n    $this->assertEquals(\n      $client->getCaBundlePath(), $adapter->getCaBundlePath());\n  }\n\n  public function testOpts() {\n    $adapter = $this->createAdapter();\n    $opts = new \\ArrayObject();\n    $adapter->setOpts($opts);\n    $this->assertTrue($opts === $adapter->getOpts());\n\n    // Default initialization\n    $adapter = $this->createAdapter();\n    $this->assertTrue($adapter->getOpts() instanceof \\ArrayObject);\n  }\n\n  abstract public function testRequest();\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Http\\Adapter;\n\nuse FacebookAds\\Exception\\Exception;\nuse FacebookAds\\Http\\Adapter\\Curl\\CurlInterface;\nuse FacebookAds\\Http\\Adapter\\CurlAdapter;\nuse FacebookAds\\Http\\Client;\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Http\\ResponseInterface;\nuse \\PHPUnit_Framework_MockObject_Builder_InvocationMocker as Mock;\n\nclass CurlAdapterTest extends AbstractAdapterTest {\n\n  /**\n   * @param Client $client\n   * @return CurlAdapter\n   */\n  protected function createAdapter($client = null) {\n    return new CurlAdapter($client ?: new Client(), $this->createCurlMock());\n  }\n\n  public function testGetters() {\n    parent::testGetters();\n    $this->assertTrue(\n      $this->createAdapter()->getCurl() instanceof CurlInterface);\n  }\n\n  public function testRequest() {\n    $adapter = $this->createAdapter();\n\n    /** @var Mock|CurlInterface $curl */\n    $curl = $adapter->getCurl();\n    $curl->method('preparePostFileField')->willReturn('file');\n    $curl->method('exec')->willReturn(\"HTTP/1.1 200 OK\\nX-header: value\");\n\n    $headers = $this->createHeadersMock();\n    $this->makeMockIterable($headers, array(\n      'X-custom-header' => 'header value',\n    ));\n\n    $query = $this->createParametersMock(array(\n      'param' => 'value',\n    ));\n\n    // HTTP_GET\n    $body = $this->createParametersMock();\n    $this->makeMockIterable($body);\n\n    $files = $this->createParametersMock();\n    $this->makeMockIterable($files);\n\n    $request = $this->createRequestMock();\n    $request->method('getMethod')->willReturn(RequestInterface::METHOD_GET);\n    $request->method('getHeaders')->willReturn($headers);\n    $request->method('getQueryParams')->willReturn($query);\n    $request->method('getBodyParams')->willReturn($body);\n    $request->method('getFileParams')->willReturn($files);\n    $response = $adapter->sendRequest($request);\n    $this->assertTrue($response instanceof ResponseInterface);\n\n    // HTTP_POST with files\n    $body = $this->createParametersMock();\n    $this->makeMockIterable($body, array(\n      'file' => './filepath',\n    ));\n\n    $files = $this->createParametersMock();\n    $this->makeMockIterable($files, array(\n      'field' => 'value',\n    ));\n\n    $request = $this->createRequestMock();\n    $request->method('getMethod')->willReturn(RequestInterface::METHOD_POST);\n    $request->method('getHeaders')->willReturn($headers);\n    $request->method('getQueryParams')->willReturn($query);\n    $request->method('getBodyParams')->willReturn($body);\n    $request->method('getFileParams')->willReturn($files);\n\n    $response = $adapter->sendRequest($request);\n    $this->assertTrue($response instanceof ResponseInterface);\n\n    // HTTP_DELETE\n    $body = $this->createParametersMock();\n    $this->makeMockIterable($body);\n\n    $files = $this->createParametersMock();\n    $this->makeMockIterable($files);\n\n    $request = $this->createRequestMock();\n    $request->method('getMethod')->willReturn(RequestInterface::METHOD_DELETE);\n    $request->method('getHeaders')->willReturn($headers);\n    $request->method('getQueryParams')->willReturn($query);\n    $request->method('getBodyParams')->willReturn($body);\n    $request->method('getFileParams')->willReturn($files);\n\n    $response = $adapter->sendRequest($request);\n    $this->assertTrue($response instanceof ResponseInterface);\n\n    // Force Curl Error\n    /** @var CurlInterface|Mock $curl */\n    $curl = $adapter->getCurl();\n    $curl->method('errno')->willReturn(CURLE_SSL_CONNECT_ERROR);\n    $curl->method('error')->willReturn('Mocked Curl Error');\n    $body = $this->createParametersMock();\n    $this->makeMockIterable($body);\n\n    $files = $this->createParametersMock();\n    $this->makeMockIterable($files);\n\n    $request = $this->createRequestMock();\n    $request->method('getMethod')->willReturn(RequestInterface::METHOD_DELETE);\n    $request->method('getHeaders')->willReturn($headers);\n    $request->method('getQueryParams')->willReturn($query);\n    $request->method('getBodyParams')->willReturn($body);\n    $request->method('getFileParams')->willReturn($files);\n\n    $e = null;\n    try {\n      $adapter->sendRequest($request);\n    } catch (Exception $e) {}\n    $this->assertTrue($e !== null);\n  }\n}\n", "num_lines": 147}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Http\\Exception;\n\nuse FacebookAds\\Http\\Exception\\RequestException;\nuse FacebookAds\\Http\\Response;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass RequestExceptionTest extends AbstractUnitTestCase {\n\n  public function testGetters() {\n    $data = array(\n      'error' => array(\n        'message' => 'Stub Server Error Message',\n        'type' => 'FacebookApiException',\n        'code' => 1,\n        'error_data' => array(\n          'blame_field_specs' => array(\n            array('mandatory_field'),\n            array('field_with_malformed_value'),\n          ),\n        ),\n        'error_subcode' => 1,\n        'is_transient' => false,\n        'error_user_title' => 'Just a test',\n        'error_user_msg' => 'Let\\'s avoid alarmism',\n      ),\n    );\n    $status_code = 400;\n    $response = new Response();\n    $response->setBody(json_encode($data));\n    $response->setStatusCode($status_code);\n    $e = new RequestException($response);\n    $this->assertEquals($status_code, $e->getHttpStatusCode());\n    $this->assertEquals(\n      $data['error']['error_subcode'], $e->getErrorSubcode());\n    $this->assertEquals(\n      $data['error']['error_user_title'], $e->getErrorUserTitle());\n    $this->assertEquals(\n      $data['error']['error_user_msg'], $e->getErrorUserMessage());\n    $this->assertEquals(\n      $data['error']['error_data']['blame_field_specs'],\n      $e->getErrorBlameFieldSpecs());\n  }\n\n  public function testGetFacebookTraceIdReturnsValueFromResponseErrorData() {\n    $data = array(\n      'error' => array(\n        'fbtrace_id' => 'abc123',\n      ),\n    );\n\n    $response = new Response();\n    $response->setBody(json_encode($data));\n    $e = new RequestException($response);\n\n    $this->assertSame('abc123', $e->getFacebookTraceId());\n  }\n\n  public function testGetErrorBlameFieldSpecsReturnsNullWithNullErrorData() {\n    $data = array(\n      'error' => array(\n          'error_data' => null,\n      ),\n    );\n\n    $response = new Response();\n    $response->setBody(json_encode($data));\n    $e = new RequestException($response);\n\n    $this->assertNull($e->getErrorBlameFieldSpecs());\n  }\n\n  /**\n   * @return array\n   */\n  public function createConcreteProvider() {\n    return array(\n      array(array('type' => 'OAuthException'), 'AuthorizationException'),\n      array(array('code' => 1), 'ServerException'),\n      array(array('code' => 4), 'ThrottleException'),\n      array(array('code' => 506), 'ClientException'),\n      array(array('code' => 10), 'PermissionException'),\n      array(array(), 'RequestException'),\n    );\n  }\n\n  /**\n   * @param array $data\n   * @param string $expected_class\n   * @dataProvider createConcreteProvider\n   */\n  public function testCreateConcrete($data, $expected_class) {\n    $response = new Response();\n    $response->setBody(json_encode(array('error' => $data)));\n    $response->setStatusCode(400);\n    $e = RequestException::create($response);\n    $fqn = '\\FacebookAds\\Http\\Exception\\\\'.$expected_class;\n    $this->assertTrue(is_a($e, $fqn));\n  }\n}\n", "num_lines": 124}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Logger;\n\nuse FacebookAds\\Logger\\LoggerInterface;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nabstract class AbstractLoggerTest extends AbstractUnitTestCase {\n\n  /**\n   * @var string\n   */\n  const VALUE_LOG_LEVEL = '<LEVEL>';\n\n  /**\n   * @var string\n   */\n  const VALUE_LOG_MESSAGE = '<MESSAGE>';\n\n  /**\n   * @return LoggerInterface\n   */\n  abstract protected function createLogger();\n}\n", "num_lines": 47}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Logger;\n\nuse FacebookAds\\Http\\RequestInterface;\nuse FacebookAds\\Logger\\CurlLogger;\nuse FacebookAds\\Logger\\CurlLogger\\JsonAwareParameters;\n\nclass CurlLoggerTest extends AbstractLoggerTest {\n\n  /**\n   * @var resource\n   */\n  protected $handle;\n\n  public function setup(): void {\n    $this->handle = fopen('php://temp', 'w+');\n  }\n\n  public function tearDown(): void {\n    fclose($this->handle);\n  }\n\n  /**\n   * @return resource\n   */\n  protected function getHandle() {\n    return $this->handle;\n  }\n\n  /**\n   * @return CurlLogger\n   */\n  protected function createLogger() {\n    return new CurlLogger($this->getHandle());\n  }\n\n  protected function createRequestMock() {\n    $query = $this->createParametersMock();\n    $query->method('export')->willReturn(array(\n      'appsecret_proof' => '<APPSECRET_PROOF>',\n      'access_token' => '<ACCESS_TOKEN>',\n      'query_field' => 'query_value',\n    ));\n\n    $body = $this->createParametersMock();\n    $body->method('export')->willReturn(array(\n      'body_field' => 'body_value',\n    ));\n\n    $files = $this->createParametersMock();\n    $files->method('export')->willReturn(array(\n      'file_field' => 'filepath',\n    ));\n\n    $request = parent::createRequestMock();\n    $request->method('getQueryParams')->willReturn($query);\n    $request->method('getBodyParams')->willReturn($body);\n    $request->method('getFileParams')->willReturn($files);\n\n    return $request;\n  }\n\n  public function testLog() {\n    $this->createLogger()->log(\n      static::VALUE_LOG_LEVEL, static::VALUE_LOG_MESSAGE);\n  }\n\n  /**\n   * @return array\n   */\n  public function logRequestProvider() {\n    return array(\n      array(RequestInterface::METHOD_GET),\n      array(RequestInterface::METHOD_POST),\n      array(RequestInterface::METHOD_PUT),\n      array(RequestInterface::METHOD_DELETE),\n    );\n  }\n\n  /**\n   * @dataProvider logRequestProvider\n   * @param string $http_method\n   */\n  public function testLogRequest($http_method) {\n    $request = $this->createRequestMock();\n    $request->method('getMethod')->willReturn($http_method);\n\n    $logger = $this->createLogger();\n    $logger->logRequest(static::VALUE_LOG_LEVEL, $request);\n  }\n\n  public function testLogResponse() {\n    $this->createLogger()->logResponse(\n      static::VALUE_LOG_LEVEL, $this->createResponseMock());\n  }\n\n  public function testJsonPrettyPrint() {\n    $logger = $this->createLogger();\n    $this->assertFalse($logger->isJsonPrettyPrint());\n    $logger->setJsonPrettyPrint(true);\n    $this->assertTrue($logger->isJsonPrettyPrint());\n\n    $query = new JsonAwareParameters(array(\n      'json_field' => array_fill(0, 3, 'json_value'),\n    ));\n    $body = $files = $this->createParametersMock();\n\n    $request = parent::createRequestMock();\n    $request->method('getQueryParams')->willReturn($query);\n    $request->method('getBodyParams')->willReturn($body);\n    $request->method('getFileParams')->willReturn($files);\n\n    $logger->logRequest(static::VALUE_LOG_LEVEL, $request);\n\n    $logger->setJsonPrettyPrint(false);\n    $this->assertFalse($logger->isJsonPrettyPrint());\n  }\n}\n", "num_lines": 142}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Logger;\n\nuse FacebookAds\\Logger\\NullLogger;\n\nclass NullLoggerTest extends AbstractLoggerTest {\n\n  protected function createLogger() {\n    return new NullLogger();\n  }\n\n  public function testLog() {\n    $this->createLogger()->log(\n      static::VALUE_LOG_LEVEL, static::VALUE_LOG_MESSAGE);\n  }\n\n  public function testLogRequest() {\n    $this->createLogger()->logRequest(\n      static::VALUE_LOG_LEVEL, $this->createRequestMock());\n  }\n\n  public function testLogResponse() {\n    $this->createLogger()->logResponse(\n      static::VALUE_LOG_LEVEL, $this->createResponseMock());\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Logger\\CurlLogger;\n\nuse FacebookAds\\Logger\\CurlLogger\\JsonAwareParameters;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass JsonAwareParametersTest extends AbstractUnitTestCase {\n  use JsonAwareTestTrait;\n\n  /**\n   * @dataProvider parameterProvider\n   * @param mixed $param_data\n   */\n  public function testExtract($param_data) {\n    foreach ((new JsonAwareParameters($param_data))->export() as $param) {\n      $this->assertTrue(is_scalar($param) || is_null($param));\n    }\n  }\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Logger\\CurlLogger;\n\nuse FacebookAds\\Logger\\CurlLogger\\JsonNode;\n\ntrait JsonAwareTestTrait {\n\n  /**\n   * @return array\n   */\n  public function parameterProvider() {\n    $base = array(\n      'appsecret_proof' => '<APPSECRET_PROOF>',\n      'access_token' => '<ACCESS_TOKEN>',\n      'query_field' => 'query_value',\n    );\n\n    return array(\n      array(\n        $base + array(\n          'json_field' => array(\n            'query_field' => 'query_value',\n          ),\n        )\n      ),\n      array(\n        $base + array(\n          'json_field' => array(\n            'query_field' => 'query_value',\n            'query_field_1' => 'query_value_1',\n            'query_field_2' => 'query_value_2',\n          ),\n        )\n      ),\n      array(\n        $base + array(\n          'json_field' => array(\n            'query_field' => str_repeat('x', JsonNode::EXPLOSION_THRESHOLD + 1),\n          ),\n        ),\n      ),\n      array(\n        $base + array(\n          'json_field' => array(),\n        ),\n      ),\n      array(\n        $base + array(\n          'json_field' => array(\n            'vector_value_1',\n            'vector_value_2',\n            'vector_value_3',\n          ),\n        ),\n      ),\n      array(\n        array(),\n      ),\n      array(\n        new \\StdClass(),\n      )\n    );\n  }\n}\n", "num_lines": 88}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Logger\\CurlLogger;\n\nuse FacebookAds\\Logger\\CurlLogger\\JsonNode;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass JsonNodeTest extends AbstractUnitTestCase {\n  use JsonAwareTestTrait;\n\n  /**\n   * @dataProvider parameterProvider\n   * @param mixed $param_data\n   */\n  public function testEncoding($param_data) {\n    JsonNode::factory($param_data)->encode();\n  }\n\n  public function testInvalidType() {\n    $this->expectException(\\InvalidArgumentException::class);\n    JsonNode::factory(fopen('php://memory', 'r'))->encode();\n  }\n\n  /**\n   * Test the sanity check for behaviour on empty children list\n   * which should never happen as this is protected method\n   */\n  public function testGetLastChildKey() {\n    $object = JsonNode::factory(array());\n    $method = new \\ReflectionMethod($object, 'getLastChildKey');\n    $method->setAccessible(true);\n\n    $this->assertNull($method->invoke($object));\n\n    $method->setAccessible(false);\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAdsTest\\Config\\SkippableFeatureTestInterface;\n\nabstract class AbstractAsyncJobTestCase extends AbstractCrudObjectTestCase\n  implements SkippableFeatureTestInterface {\n\n  /**\n   * @return array\n   */\n  public function skipIfAny() {\n    return array('no_async_jobs');\n  }\n\n  /**\n   * @param AbstractCrudObject $job\n   * @param int $timeout\n   * @param int $interval\n   */\n  protected function waitTillJobComplete(\n    AbstractCrudObject $job, $timeout = 60, $interval = 2) {\n\n    $end = time() + $timeout;\n    do {\n      if ($job->getSelf()->isComplete()) {\n        return;\n      }\n      sleep($interval);\n    } while (time() <= $end);\n\n    $this->markTestSkipped(\n      \"Async Job timed out. Timeout: {$timeout}, Interval: {$interval}\");\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAdsTest\\Object\\EmptyCrudObject;\nuse FacebookAds\\Object\\AbstractCrudObject;\n\nclass AbstractCrudObjectTest extends AbstractCrudObjectTestCase {\n\n  public function testCreationWithNull() {\n    $this->checkCreationSuccessWithID(null);\n  }\n\n  public function testCreationWithNegativeId() {\n    $this->checkCreationFailureWithID(-1234123);\n  }\n\n  public function testCreationWithPositiveId() {\n    $this->checkCreationSuccessWithID(100007309086878);\n  }\n\n  public function testCreationWithCorrectStringId() {\n    $this->checkCreationSuccessWithID('100007309086878');\n  }\n\n  public function testCreationWithIncorrectNegativeStringId() {\n    $this->checkCreationFailureWithID('-1234123');\n  }\n\n  public function testCreationWithIncorrectStringId() {\n    $this->checkCreationFailureWithID('1.234e10');\n  }\n\n  public function testCreationSuccessWithAct_() {\n    $this->checkCreationSuccessWithID('act_12341521352312');\n  }\n\n  public function testCreationFailureWithAct_() {\n    $this->checkCreationFailureWithID('act_1.1234e10');\n  }\n\n  public function testCreationWithOverFlowInt() {\n    $this->checkCreationFailureWithID(PHP_INT_MAX+1);\n  }\n  private function checkCreationSuccessWithID($id) {\n    new EmptyCrudObject($id);\n  }\n\n  private function checkCreationFailureWithID($id) {\n    $this->assertInvalidArgumentException($id);\n  }\n\n  /**\n   * @param mixed $id\n   */\n  public function assertInvalidArgumentException(mixed $id) {\n    $has_throw_exception = false;\n    try {\n      new EmptyCrudObject($id);\n    } catch (\\InvalidArgumentException $e) {\n      $has_throw_exception = true;\n    }\n    $this->assertTrue($has_throw_exception);\n  }\n\n}\n", "num_lines": 89}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Cursor;\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAds\\Object\\AbstractObject;\nuse FacebookAds\\Object\\AbstractArchivableCrudObject;\nuse FacebookAds\\Object\\AdLabel;\nuse FacebookAds\\Object\\CanRedownloadInterface;\nuse FacebookAds\\Object\\Fields\\AbstractArchivableCrudObjectFields;\nuse FacebookAds\\Object\\Fields\\AdLabelFields;\nuse FacebookAds\\Object\\Traits\\AdLabelAwareCrudObjectTrait;\nuse FacebookAdsTest\\AbstractIntegrationTestCase;\n\nabstract class AbstractCrudObjectTestCase extends AbstractIntegrationTestCase {\n\n  /**\n   * @param AbstractCrudObject $subject\n   * @param array $params\n   */\n  public function assertCanCreate(\n    AbstractCrudObject $subject, array $params = array()) {\n\n    if ($subject instanceof CanRedownloadInterface) {\n      $params[CanRedownloadInterface::PARAM_REDOWNLOAD] = true;\n    }\n\n    $this->assertEmpty($subject->{AbstractCrudObject::FIELD_ID});\n    $subject->create($params);\n    $this->assertNotEmpty($subject->{AbstractCrudObject::FIELD_ID});\n\n    /** @var AbstractCrudObject $subject */\n    if ($subject instanceof CanRedownloadInterface) {\n      $non_null_count = 0;\n      foreach ($subject->getData() as $key => $value) {\n        if ($key !== AbstractCrudObject::FIELD_ID && $value !== null) {\n          ++$non_null_count;\n          // Normalize assert function behaviour with non-redownloadable objects\n          $subject->{$key} = null;\n        }\n      }\n\n      $this->assertGreaterThan(0, $non_null_count);\n    }\n  }\n\n  /**\n   * @param AbstractCrudObject $object\n   * @return AbstractCrudObject\n   */\n  protected function getEmptyClone(AbstractCrudObject $object) {\n    $fqn = get_class($object);\n    return new $fqn(\n      $object->{AbstractCrudObject::FIELD_ID},\n      $object->getParentId());\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   */\n  public function assertCannotCreate(AbstractCrudObject $subject) {\n    $has_throw_exception = false;\n    try {\n      $subject->create();\n    } catch (\\Exception $e) {\n      $has_throw_exception = true;\n    }\n    $this->assertTrue($has_throw_exception);\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   */\n  public function assertCanRead(AbstractCrudObject $subject) {\n    $this->assertNotEmpty($subject->{AbstractCrudObject::FIELD_ID});\n    $mirror = $this->getEmptyClone($subject);\n    $mirror->read();\n    $this->assertEquals(\n      $subject->{AbstractCrudObject::FIELD_ID},\n      $mirror->{AbstractCrudObject::FIELD_ID});\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   * @param string $connection_name\n   * @param array $fields\n   * @param array $params\n   * @return mixed\n   */\n  protected function fetchConnection(\n    AbstractCrudObject $subject,\n    $connection_name,\n    array $fields = array(),\n    array $params = array()) {\n\n    $this->assertNotEmpty($subject->{AbstractCrudObject::FIELD_ID});\n    $mirror = $this->getEmptyClone($subject);\n    return call_user_func(array($mirror, $connection_name), $fields, $params);\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   * @param string $connection_name\n   * @param array $fields\n   * @param array $params\n   */\n  public function assertCanFetchConnection(\n    AbstractCrudObject $subject,\n    $connection_name,\n    array $fields = array(),\n    array $params = array()) {\n\n    $result = $this->fetchConnection(\n      $subject, $connection_name, $fields, $params);\n\n    $this->assertTrue(\n      $result instanceof Cursor\n      || $result instanceof AbstractObject);\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   * @param string $connection_name\n   * @param array $fields\n   * @param array $params\n   */\n  public function assertCanFetchConnectionAsArray(\n    AbstractCrudObject $subject,\n    $connection_name,\n    array $fields = array(),\n    array $params = array()) {\n\n    $result = $this->fetchConnection(\n      $subject, $connection_name, $fields, $params);\n\n    $this->assertTrue(is_array($result));\n\n    foreach ($result as $object) {\n      if (!$object instanceof AbstractObject) {\n        $this->fail(\"Not an instance of AbstractObject\");\n      }\n    }\n  }\n\n  /**\n   * @param AbstractCrudObject $object\n   * @param array $diff\n   * @return array\n   */\n  private function extractDiffFromObject(\n    AbstractCrudObject $object,\n    array $diff) {\n\n    $sub_diff = array();\n    foreach ($object->getData() as $key => $val) {\n      if (array_key_exists($key, $diff)) {\n        $sub_diff[$key] = $val;\n      }\n    }\n\n    return $sub_diff + array_combine(\n      array_keys($diff),\n      array_fill(0, count($diff), null));\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   * @param array $diff Data to be changed in the object\n   */\n  public function assertCanUpdate(\n    AbstractCrudObject $subject,\n    array $diff) {\n\n    $this->assertNotEmpty($subject->{AbstractCrudObject::FIELD_ID});\n    $mirror = $this->getEmptyClone($subject);\n    $mirror->read();\n    $mirror->setData($diff);\n    $mirror->update();\n    $this->assertNotEmpty($subject->id);\n    $mirror2 = $this->getEmptyClone($subject);\n    $mirror2->read(array_keys($diff));\n    $this->assertEquals(\n      $this->extractDiffFromObject($mirror, $diff),\n      $this->extractDiffFromObject($mirror2, $diff));\n\n    $subject->read(array_keys($diff));\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   */\n  public function assertCannotUpdate(AbstractCrudObject $subject) {\n    $has_throw_exception = false;\n    try {\n      $subject->update();\n    } catch (\\Exception $e) {\n      $has_throw_exception = true;\n    }\n    $this->assertTrue($has_throw_exception);\n  }\n\n  /**\n   * @param AbstractArchivableCrudObject $subject\n   * @param string $status\n   */\n  private function assertArchivableCrudObjectStatus(\n    AbstractArchivableCrudObject $subject, $status) {\n\n    $fields = array(\n      AbstractArchivableCrudObjectFields::CONFIGURED_STATUS,\n      AbstractArchivableCrudObjectFields::EFFECTIVE_STATUS,\n    );\n\n    $mirror = $this->getEmptyClone($subject);\n    $mirror->read($fields);\n\n    foreach ($fields as $field) {\n      $this->assertEquals($mirror->{$field}, $status);\n      $subject->{$field} = $status;\n    }\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   */\n  public function assertCanDelete(AbstractCrudObject $subject) {\n    $this->assertNotEmpty($subject->{AbstractCrudObject::FIELD_ID});\n    $subject->deleteSelf();\n    if ($subject instanceof AbstractArchivableCrudObject) {\n      $this->assertArchivableCrudObjectStatus(\n        $subject, AbstractArchivableCrudObject::STATUS_DELETED);\n    }\n  }\n\n  /**\n   * @param AbstractCrudObject $subject\n   */\n  public function assertCannotDelete(AbstractCrudObject $subject) {\n    $has_throw_exception = false;\n    try {\n      $subject->deleteSelf();\n    } catch (\\Exception $e) {\n      $has_throw_exception = true;\n    }\n    $this->assertTrue($has_throw_exception);\n  }\n\n  /**\n   * @param AbstractArchivableCrudObject $subject\n   */\n  public function assertCanArchive(AbstractArchivableCrudObject $subject) {\n    $this->assertNotEmpty($subject->{AbstractCrudObject::FIELD_ID});\n    $subject->archiveSelf();\n    if ($subject instanceof AbstractArchivableCrudObject) {\n      $this->assertArchivableCrudObjectStatus(\n        $subject, AbstractArchivableCrudObject::STATUS_ARCHIVED);\n    }\n  }\n\n  /**\n   * @param array $response_content\n   */\n  public function assertSuccessResponse(array $response_content) {\n    $this->assertTrue(is_array($response_content));\n    $this->assertArrayHasKey('success', $response_content);\n    $this->assertTrue($response_content['success']);\n  }\n\n  /**\n   * @param AdLabelAwareCrudObjectTrait|AbstractCrudObject $object\n   */\n  public function assertCanBeLabeled(AbstractCrudObject $object) {\n    $label = new AdLabel(null, $this->getConfig()->accountId);\n    $label->{AdLabelFields::NAME} = $this->getConfig()->testRunId;\n    $label->create();\n\n    /** @var AdLabelAwareCrudObjectTrait|AbstractCrudObject $mirror */\n    $mirror = $this->getEmptyClone($object);\n    $mirror->addAdLabels(array($label->{AdLabelFields::ID}));\n\n    $mirror = $this->getEmptyClone($object);\n    $mirror->read(array('adlabels'));\n    $this->assertCount(1, $mirror->{'adlabels'});\n\n    $mirror = $this->getEmptyClone($object);\n    $mirror->removeAdLabels(array($label->{AdLabelFields::ID}));\n    $mirror->read(array('adlabels'));\n    $this->assertNull($mirror->{'adlabels'});\n\n    $label->deleteSelf();\n  }\n}\n", "num_lines": 316}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdAccountGroup;\nuse FacebookAds\\Object\\Fields\\AdAccountGroupFields;\n\nclass AdAccountGroupTest extends AbstractCrudObjectTestCase {\n\n  public function testCrudAccess() {\n    $group = new AdAccountGroup();\n    $group->{AdAccountGroupFields::NAME} = $this->getConfig()->testRunId;\n    $this->assertCanCreate($group);\n    $this->assertCanRead($group);\n    $this->assertCanUpdate($group, array(\n      AdAccountGroupFields::NAME => $this->getConfig()->testRunId.' updated'));\n\n    $this->assertCanFetchConnectionAsArray($group, 'getUsers');\n    $this->assertCanFetchConnectionAsArray($group, 'getAdAccounts');\n\n    $this->assertCanDelete($group);\n  }\n}\n", "num_lines": 46}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\AdLabel;\nuse FacebookAds\\Object\\Fields\\AdAccountFields;\nuse FacebookAds\\Object\\Fields\\AdCreativeFields;\nuse FacebookAds\\Object\\Fields\\AdLabelFields;\nuse FacebookAds\\Object\\Values\\AdAccountRoles;\nuse FacebookAds\\Object\\Fields\\TargetingSpecsFields;\nuse FacebookAds\\Object\\TargetingSpecs;\nuse FacebookAds\\Object\\Values\\AdFormats;\nuse FacebookAds\\Object\\Values\\OptimizationGoals;\n\nclass AdAccountTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * @var AdLabel\n   */\n  protected $adLabel;\n\n  public function setup() {\n    parent::setup();\n\n    $this->adLabel = new AdLabel(null, $this->getConfig()->accountId);\n    $this->adLabel->{AdLabelFields::NAME} = $this->getConfig()->testRunId;\n    $this->adLabel->create();\n  }\n\n  public function tearDown() {\n    if ($this->adLabel !== null) {\n      $this->adLabel->deleteSelf();\n      $this->adLabel = null;\n    }\n\n    parent::tearDown();\n  }\n\n  public function testCrud() {\n    $account = new AdAccount($this->getConfig()->accountId);\n\n    $this->assertCanRead($account);\n    $name = $account->read(array(AdAccountFields::NAME))\n      ->{AdAccountFields::NAME};\n    $this->assertCanUpdate(\n      $account,\n      array(AdAccountFields::NAME => $this->getConfig()->testRunId));\n\n    // Restore original account name\n    $account->{AdAccountFields::NAME} = $name;\n    $account->save();\n\n    $this->assertCannotDelete($account);\n\n    $targeting = new TargetingSpecs();\n    $targeting->setData(array(\n      TargetingSpecsFields::GEO_LOCATIONS =>\n        array('countries' => array('US', 'JP')),\n      TargetingSpecsFields::GENDERS => array(1),\n      TargetingSpecsFields::AGE_MIN => 20,\n      TargetingSpecsFields::AGE_MAX => 24,\n    ));\n\n    $creative = (new AdCreative())->setData(array(\n      AdCreativeFields::TITLE => 'My Test Creative',\n      AdCreativeFields::BODY => 'My Test Ad Creative Body',\n      AdCreativeFields::OBJECT_URL => 'https://www.facebook.com/facebook',\n    ));\n\n    $targeting_params = array(\n      'targeting_spec' => $targeting->exportData(),\n    );\n\n    $label_params = array(\n      'ad_label_ids' => array(\n        $this->adLabel->{AdLabelFields::ID},\n      ),\n    );\n\n    $this->assertCanFetchConnection($account, 'getActivities');\n    $this->assertCanFetchConnection($account, 'getAdUsers');\n    $this->assertCanFetchConnection($account, 'getCampaigns');\n    $this->assertCanFetchConnection($account, 'getAdSets');\n    $this->assertCanFetchConnection($account, 'getAds');\n    $this->assertCanFetchConnection($account, 'getAdCreatives');\n    $this->assertCanFetchConnection($account, 'getAdImages');\n    $this->assertCanFetchConnection($account, 'getAdsPixels');\n    $this->assertCanFetchConnection($account, 'getAdVideos');\n    $this->assertCanFetchConnection($account, 'getBroadCategoryTargeting');\n    $this->assertCanFetchConnection($account, 'getCustomAudiences');\n    $this->assertCanFetchConnection($account, 'getConversionPixels');\n    $this->assertCanFetchConnection($account, 'getPartnerCategories');\n    $this->assertCanFetchConnection($account, 'getRateCards');\n    $this->assertCanFetchConnection(\n      $account,\n      'getReachEstimate',\n      array(),\n      array_merge(\n        $targeting_params,\n        array(\n          'optimize_for' => OptimizationGoals::OFFSITE_CONVERSIONS,\n        )));\n\n    if (!$this->shouldSkipTest('no_reach_and_frequency')) {\n      $this->assertCanFetchConnection($account, 'getReachFrequencyPredictions');\n    }\n\n    $this->assertCanFetchConnection(\n      $account, 'getTargetingDescription', array(), $targeting_params);\n\n    $this->assertCanFetchConnection($account, 'getTransactions');\n    $this->assertCanFetchConnection($account, 'getAdPreviews', array(), array(\n      'ad_format' => AdFormats::DESKTOP_FEED_STANDARD,\n      'creative' => $creative->exportData(),\n    ));\n    $this->assertCanFetchConnection($account, 'getInsights');\n    $this->assertCanFetchConnection($account, 'getInsightsAsync');\n    $this->assertCanFetchConnection($account, 'getAgencies');\n    $this->assertCanFetchConnection($account, 'getMinimumBudgets');\n    $this->assertCanFetchConnection($account, 'getAdLabels');\n    $this->assertCanFetchConnection(\n      $account, 'getCampaignsByLabel', array(), $label_params);\n    $this->assertCanFetchConnection(\n      $account, 'getAdSetsByLabel', array(), $label_params);\n    $this->assertCanFetchConnection(\n      $account, 'getAdsByLabel', array(), $label_params);\n    $this->assertCanFetchConnection(\n      $account, 'getAdCreativesByLabel', array(), $label_params);\n\n\n    if (!$this->getSkippableFeaturesManager()\n      ->isSkipKey('no_business_manager')) {\n\n      $account->grantAgencyAcccess(\n        $this->getConfig()->secondaryBusinessId,\n        array(AdAccountRoles::GENERAL_USER));\n\n      $account->revokeAgencyAccess($this->getConfig()->secondaryBusinessId);\n    }\n  }\n}\n", "num_lines": 166}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdConversionPixel;\nuse FacebookAds\\Object\\Fields\\AdConversionPixelFields;\n\nclass AdConversionPixelTest extends AbstractCrudObjectTestCase {\n\n  public function testCrud() {\n    $conversionPixel = new AdConversionPixel(\n      null, $this->getConfig()->accountId);\n    $conversionPixel->{AdConversionPixelFields::NAME}\n      = $this->getConfig()->testRunId;\n    $conversionPixel->{AdConversionPixelFields::TAG} = 'checkout';\n\n    $this->assertCanCreate($conversionPixel);\n    $this->assertCanRead($conversionPixel);\n    $this->assertCanUpdate(\n      $conversionPixel,\n      array(\n        AdConversionPixelFields::TAG => 'add_to_cart',\n      ));\n    $this->assertCanDelete($conversionPixel);\n  }\n}\n", "num_lines": 49}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\AdImage;\nuse FacebookAds\\Object\\ObjectStorySpec;\nuse FacebookAds\\Object\\ObjectStory\\LinkData;\nuse FacebookAds\\Object\\ObjectStory\\AttachmentData;\nuse FacebookAds\\Object\\Fields\\AdCreativeFields;\nuse FacebookAds\\Object\\Fields\\AdImageFields;\nuse FacebookAds\\Object\\Fields\\ObjectStorySpecFields;\nuse FacebookAds\\Object\\Fields\\ObjectStory\\LinkDataFields;\nuse FacebookAds\\Object\\Fields\\ObjectStory\\AttachmentDataFields;\n\nclass AdCreativeTest extends AbstractCrudObjectTestCase {\n\n  public function testCrud() {\n    $creative = new AdCreative(null, $this->getConfig()->accountId);\n    $creative->{AdCreativeFields::TITLE} = 'My Test Ad';\n    $creative->{AdCreativeFields::NAME} = 'My Test Ad';\n    $creative->{AdCreativeFields::BODY} = 'My Test Ad Body';\n    $creative->{AdCreativeFields::OBJECT_ID} = $this->getConfig()->pageId;\n    $this->assertCanCreate($creative);\n    $this->assertCanRead($creative);\n    $this->assertCanUpdate(\n      $creative,\n      array(\n        AdCreativeFields::NAME => 'My Test Ad '. $this->getConfig()->testRunId,\n      ));\n    $this->assertCanBeLabeled($creative);\n    $this->assertCanDelete($creative);\n  }\n\n  public function testMultiProductObjectSpec() {\n    // Create a new AdCreative\n    $creative = new AdCreative(null, $this->getConfig()->accountId);\n    $creative->{AdCreativeFields::NAME} = 'Multi Product Ad Creative';\n\n    // Create a new ObjectStorySpec to create an unpublished post\n    $story = new ObjectStorySpec();\n    $story->{ObjectStorySpecFields::PAGE_ID} = $this->getConfig()->pageId;\n\n    // Create LinkData object representing data for a link page post\n    $link = new LinkData();\n    $link->{LinkDataFields::LINK} = $this->getConfig()->appUrl;\n    $link->{LinkDataFields::CAPTION} = 'My Caption';\n\n    // Upload a test image to use in Attachments\n    $adImage = new AdImage(null, $this->getConfig()->accountId);\n    $adImage->{AdImageFields::FILENAME} = $this->getConfig()->testImagePath;\n    $adImage->save();\n\n    // Create 3 products as this will be a multi-product ad\n    $product1 = (new AttachmentData())->setData(array(\n      AttachmentDataFields::LINK => $this->getConfig()->appUrl.'p1',\n      AttachmentDataFields::IMAGE_HASH => $adImage->hash,\n      AttachmentDataFields::NAME => 'Product 1',\n      AttachmentDataFields::DESCRIPTION => '$100',\n    ));\n\n    $product2 = (new AttachmentData())->setData(array(\n      AttachmentDataFields::LINK => $this->getConfig()->appUrl.'p2',\n      AttachmentDataFields::IMAGE_HASH => $adImage->hash,\n      AttachmentDataFields::NAME => 'Product 2',\n      AttachmentDataFields::DESCRIPTION => '$200',\n    ));\n\n    $product3 = (new AttachmentData())->setData(array(\n      AttachmentDataFields::LINK => $this->getConfig()->appUrl.'p3',\n      AttachmentDataFields::IMAGE_HASH => $adImage->hash,\n      AttachmentDataFields::NAME => 'Product 3',\n      AttachmentDataFields::DESCRIPTION => '$300',\n    ));\n\n    // Add the products into the child attachments\n    $link->{LinkDataFields::CHILD_ATTACHMENTS} = array(\n      $product1,\n      $product2,\n      $product3,\n    );\n\n    $story->{ObjectStorySpecFields::LINK_DATA} = $link;\n    $creative->{AdCreativeFields::OBJECT_STORY_SPEC} = $story;\n\n    $this->assertCanCreate($creative);\n    $this->assertCanDelete($creative);\n  }\n}\n", "num_lines": 112}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdImage;\nuse FacebookAds\\Object\\Fields\\AdImageFields;\n\nclass AdImageTest extends AbstractCrudObjectTestCase {\n\n  public function testCrud() {\n    $image = new AdImage(null, $this->getConfig()->accountId);\n    $image->{AdImageFields::FILENAME} = $this->getConfig()->testImagePath;\n    $this->assertCanCreate($image);\n    $this->assertCanRead($image);\n    $this->assertCannotUpdate($image);\n    $this->assertCanDelete($image);\n  }\n\n  /**\n   * @expectedException \\Exception\n   */\n  public function testZipFileInNormalCreate() {\n    $image = new AdImage(null, $this->getConfig()->accountId);\n    $image->{AdImageFields::FILENAME}\n      = $this->getConfig()->testZippedImagesPath;\n    $image->create();\n  }\n\n  public function testBulkZipUpload() {\n    $images = AdImage::createFromZip(\n       $this->getConfig()->testZippedImagesPath,\n       $this->getConfig()->accountId);\n    $this->assertTrue(is_array($images));\n\n    foreach ($images as $image) {\n      $this->assertCanDelete($image);\n    }\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdLabel;\nuse FacebookAds\\Object\\Fields\\AdLabelFields;\n\nclass AdLabelTest extends AbstractCrudObjectTestCase {\n\n  public function testCrudAccess() {\n    $label = new AdLabel(null, $this->getConfig()->accountId);\n    $label->{AdLabelFields::NAME} = $this->getConfig()->testRunId;\n\n    $this->assertCanCreate($label);\n    $this->assertCanRead($label);\n    $this->assertCanUpdate(\n      $label,\n      array(AdLabelFields::NAME => $this->getConfig()->testRunId . ' updated'));\n\n    $this->assertCanDelete($label);\n  }\n}\n", "num_lines": 45}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdImage;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\Fields\\AdImageFields;\nuse FacebookAds\\Object\\TargetingSpecs;\nuse FacebookAds\\Object\\Fields\\AdPreviewFields;\nuse FacebookAds\\Object\\Fields\\AdCreativeFields;\nuse FacebookAds\\Object\\Fields\\AdFields;\nuse FacebookAds\\Object\\Fields\\AdSetFields;\nuse FacebookAds\\Object\\Fields\\CampaignFields;\nuse FacebookAds\\Object\\Fields\\TargetingSpecsFields;\nuse FacebookAds\\Object\\Values\\AdFormats;\nuse FacebookAds\\Object\\Values\\BillingEvents;\nuse FacebookAds\\Object\\Values\\OptimizationGoals;\nuse FacebookAdsTest\\Config\\SkippableFeatureTestInterface;\n\nclass AdPreviewTest extends AbstractCrudObjectTestCase\n  implements SkippableFeatureTestInterface {\n\n  /**\n   * @var Campaign\n   */\n  protected $campaign;\n\n  /**\n   * @var AdSet\n   */\n  protected $adSet;\n\n  /**\n   * @var Ad\n   */\n  protected $ad;\n\n  /**\n   * @var AdImage\n   */\n  protected $adImage;\n\n  /**\n   * @var AdCreative\n   */\n  protected $adCreative;\n\n  /**\n   * @return array\n   */\n  public function skipIfAny() {\n    return array('no_payment_method');\n  }\n\n  public function setup() {\n    parent::setup();\n\n    $targeting = new TargetingSpecs();\n    $targeting->{TargetingSpecsFields::GEO_LOCATIONS}\n      = array('countries' => array('US'));\n\n    $this->campaign = new Campaign(null, $this->getConfig()->accountId);\n    $this->campaign->{CampaignFields::NAME} = $this->getConfig()->testRunId;\n    $this->campaign->create();\n\n    $this->adSet = new AdSet(null, $this->getConfig()->accountId);\n    $this->adSet->{AdSetFields::CAMPAIGN_ID}\n      = (int) $this->campaign->{AdSetFields::ID};\n    $this->adSet->{AdSetFields::NAME} = $this->getConfig()->testRunId;\n    $this->adSet->{AdSetFields::DAILY_BUDGET} = '150';\n    $this->adSet->{AdSetFields::START_TIME}\n      = (new \\DateTime(\"+1 week\"))->format(\\DateTime::ISO8601);\n    $this->adSet->{AdSetFields::END_TIME}\n      = (new \\DateTime(\"+2 week\"))->format(\\DateTime::ISO8601);\n    $this->adSet->{AdFields::TARGETING} = $targeting;\n    $this->adSet->{AdSetFields::OPTIMIZATION_GOAL} = OptimizationGoals::REACH;\n    $this->adSet->{AdSetFields::BILLING_EVENT} = BillingEvents::IMPRESSIONS;\n    $this->adSet->{AdSetFields::BID_AMOUNT} = 2;\n    $this->adSet->create(array(\n      AdSet::STATUS_PARAM_NAME => AdSet::STATUS_PAUSED,\n    ));\n\n    $this->adImage = new AdImage(null, $this->getConfig()->accountId);\n    $this->adImage->{AdImageFields::FILENAME}\n      = $this->getConfig()->testImagePath;\n    $this->adImage->save();\n\n    $this->adCreative = new AdCreative(null, $this->getConfig()->accountId);\n    $this->adCreative->{AdCreativeFields::TITLE} = 'My Test Ad';\n    $this->adCreative->{AdCreativeFields::BODY} = 'My Test Ad Body';\n    $this->adCreative->{AdCreativeFields::OBJECT_ID}\n      = $this->getConfig()->pageId;\n    $this->adCreative->{AdCreativeFields::IMAGE_HASH}\n      = $this->adImage->{AdImageFields::HASH};\n    $this->adCreative->create();\n\n    $this->ad = new Ad(null, $this->getConfig()->accountId);\n    $this->ad->{AdFields::NAME} = $this->getConfig()->testRunId;\n    $this->ad->{AdFields::ADSET_ID}\n      = (int) $this->adSet->{AdSetFields::ID};\n    $this->ad->{AdFields::CREATIVE}\n      = array('creative_id' => $this->adCreative->{AdCreativeFields::ID});\n    $this->ad->create(array(\n      Ad::STATUS_PARAM_NAME => Ad::STATUS_PAUSED,\n    ));\n  }\n\n  public function tearDown() {\n\n    if ($this->ad) {\n      $this->ad->deleteSelf();\n      $this->ad = null;\n    }\n\n    if ($this->adSet) {\n      $this->adSet->deleteSelf();\n      $this->adSet = null;\n    }\n\n    if ($this->campaign) {\n      $this->campaign->deleteSelf();\n      $this->campaign = null;\n    }\n\n    if ($this->adCreative) {\n      $this->adCreative->deleteSelf();\n      $this->adCreative = null;\n    }\n\n    if ($this->adImage) {\n      $this->adImage->deleteSelf();\n      $this->adImage = null;\n    }\n\n    parent::tearDown();\n  }\n\n  public function testAdPreviews() {\n    // Preview with actual creative\n    $previews = $this->adCreative->getAdPreviews(\n      array(),\n      array(\n        AdPreviewFields::AD_FORMAT => AdFormats::RIGHT_COLUMN_STANDARD\n      )\n    );\n    $this->assertNotEquals(0, $previews->count());\n    $preview = $previews->offsetGet(0);\n    $this->assertRegExp(\n      '/iframe/',\n      $preview->{AdPreviewFields::BODY}\n    );\n\n    // Preview with actual adgroup\n    $previews = $this->ad->getAdPreviews(\n      array(),\n      array(\n        AdPreviewFields::AD_FORMAT => AdFormats::RIGHT_COLUMN_STANDARD\n      )\n    );\n    $this->assertNotEquals(0, $previews->count());\n    $preview = $previews->offsetGet(0);\n    $this->assertRegExp(\n      '/iframe/',\n      $preview->{AdPreviewFields::BODY}\n    );\n\n    // Preview with creative specs\n    $account = new AdAccount($this->getConfig()->accountId);\n    $previews = $account->getAdPreviews(\n      array(),\n      array(\n        AdPreviewFields::CREATIVE => array(\n          AdCreativeFields::BODY => 'Testing the creative preview',\n          AdCreativeFields::OBJECT_ID => $this->getConfig()->pageId,\n        ),\n        AdPreviewFields::AD_FORMAT => AdFormats::RIGHT_COLUMN_STANDARD,\n      )\n    );\n    $this->assertNotEquals(0, $previews->count());\n    $preview = $previews->offsetGet(0);\n    $this->assertRegExp(\n      '/iframe/',\n      $preview->{AdPreviewFields::BODY}\n    );\n  }\n}\n", "num_lines": 213}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Object\\Fields\\CampaignFields;\nuse FacebookAds\\Object\\Fields\\AdSetFields;\nuse FacebookAds\\Object\\Fields\\TargetingSpecsFields;\nuse FacebookAds\\Object\\TargetingSpecs;\nuse FacebookAds\\Object\\Values\\BillingEvents;\nuse FacebookAds\\Object\\Values\\OptimizationGoals;\n\nclass AdSetTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * @var Campaign\n   */\n  protected $campaign;\n\n  public function setup() {\n    parent::setup();\n    $this->campaign = new Campaign(null, $this->getConfig()->accountId);\n    $this->campaign->{CampaignFields::NAME}\n      = $this->getConfig()->testRunId;\n    $this->campaign->create();\n  }\n\n  public function tearDown() {\n    $this->campaign->deleteSelf();\n    $this->campaign = null;\n    parent::tearDown();\n  }\n\n  public function testCrud() {\n    $targeting = new TargetingSpecs();\n    $targeting->{TargetingSpecsFields::GEO_LOCATIONS}\n      = array('countries' => array('US'));\n\n    $set = new AdSet(null, $this->getConfig()->accountId);\n    $set->{AdSetFields::CAMPAIGN_ID}\n      = $this->campaign->{CampaignFields::ID};\n    $set->{AdSetFields::NAME} = $this->getConfig()->testRunId;\n    $set->{AdSetFields::OPTIMIZATION_GOAL} = OptimizationGoals::REACH;\n    $set->{AdSetFields::BILLING_EVENT} = BillingEvents::IMPRESSIONS;\n    $set->{AdSetFields::BID_AMOUNT} = 2;\n    $set->{AdSetFields::DAILY_BUDGET} = '150';\n    $set->{AdSetFields::TARGETING} = $targeting;\n    $set->{AdSetFields::START_TIME}\n      = (new \\DateTime(\"+1 week\"))->format(\\DateTime::ISO8601);\n    $set->{AdSetFields::END_TIME}\n      = (new \\DateTime(\"+2 week\"))->format(\\DateTime::ISO8601);\n\n    $this->assertCanCreate($set, array(\n      AdSet::STATUS_PARAM_NAME => AdSet::STATUS_PAUSED,\n    ));\n    $this->assertCanRead($set);\n    $this->assertCanUpdate($set, array(\n      AdSetFields::NAME => $this->getConfig()->testRunId.' updated',\n    ));\n    $this->assertCanFetchConnection($set, 'getAds');\n    $this->assertCanFetchConnection($set, 'getAdCreatives');\n    $this->assertCanFetchConnection($set, 'getInsights');\n    $this->assertCanFetchConnection($set, 'getInsightsAsync');\n\n    $this->assertCanBeLabeled($set);\n    $this->assertCanArchive($set);\n\n    $this->assertCanDelete($set);\n  }\n}\n", "num_lines": 94}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdsPixel;\nuse FacebookAds\\Object\\Business;\nuse FacebookAds\\Object\\Fields\\AdsPixelsFields;\nuse FacebookAds\\Object\\Values\\AdsPixelStatAggregations;\n\nclass AdsPixelTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * AdsPixels can be created but only one per account can exist\n   */\n  public function testCreate() {\n    // make sure there's at least one pixel\n    $account = new AdAccount($this->getConfig()->accountId);\n    $pixels = $account->getAdsPixels();\n    $pixel = null;\n\n    if (!$pixels->count()) {\n      $pixel = new AdsPixel(null, $this->getConfig()->accountId);\n      $pixel->{AdsPixelsFields::NAME} = 'WCA Pixel';\n      $this->assertCanCreate($pixel);\n    } else {\n      $pixel = $pixels->current();\n    }\n\n    $pixel = new AdsPixel(null, $this->getConfig()->accountId);\n    $pixel->{AdsPixelsFields::NAME} = $this->getConfig()->testRunId;\n    $this->assertCannotCreate($pixel);\n  }\n\n  /**\n   * @return AdsPixel\n   */\n  protected function getAccountPixel() {\n    $cursor = (new AdAccount($this->getConfig()->accountId))->getAdsPixels();\n    $this->assertGreaterThanOrEqual(1, $cursor->count());\n\n    return $cursor->current();\n  }\n\n  /**\n   * @depends testCreate\n   */\n  public function testCrud() {\n    $pixel = $this->getAccountPixel();\n\n    $this->assertCanRead($pixel, array(\n      AdsPixelsFields::NAME,\n    ));\n\n    $name = $pixel->{AdsPixelsFields::NAME};\n\n    $this->assertCanUpdate(\n      $pixel,\n      array(\n        AdsPixelsFields::NAME => $this->getConfig()->testRunId.' updated',\n      ));\n\n    $pixel->{AdsPixelsFields::NAME} = $name;\n    $pixel->update();\n\n    $this->assertCanFetchConnection($pixel, 'getAdAccounts', array(), array(\n      'business' => $this->getConfig()->businessId,\n    ));\n    $this->assertCanFetchConnection($pixel, 'getAgencies');\n    $this->assertCanFetchConnection($pixel, 'getStats', array(), array(\n      'aggregation' => AdsPixelStatAggregations::EVENT,\n    ));\n\n    $this->assertCannotDelete($pixel);\n  }\n\n  /**\n   * @depends testCreate\n   */\n  public function testShareWithAdAccount() {\n    $this->skipIf('no_business_manager');\n\n    if (!$this->getConfig()->secondaryBusinessId) {\n      $this->markTestSkipped('No secondary business provided in config');\n    }\n\n    if (!$this->getConfig()->secondaryAccountId) {\n      $this->markTestSkipped('No secondary ad account provided in config');\n    }\n\n    $account_id_int = (int) substr($this->getConfig()->secondaryAccountId, 4);\n\n    $pixel = $this->getAccountPixel();\n\n    $pixel->sharePixelWithAdAccount(\n      $this->getConfig()->secondaryBusinessId,\n      $account_id_int);\n\n    $pixel->unsharePixelWithAdAccount(\n      $this->getConfig()->secondaryBusinessId,\n      $account_id_int);\n\n  }\n\n  /**\n   * @depends testCreate\n   */\n  public function testShareWithAgency() {\n    $this->skipIf('no_business_manager');\n\n    if (!$this->getConfig()->secondaryAccountId) {\n      $this->markTestSkipped('No secondary business provided in config');\n    }\n\n    $pixel = $this->getAccountPixel();\n\n    $business = new Business($this->getConfig()->businessId);\n    $cursor = $business->getAgencies();\n    $cursor->setUseImplicitFetch(true);\n\n    $agency_id = null;\n    foreach ($cursor as $agency) {\n      if (\n        $agency->{AbstractCrudObject::FIELD_ID}\n        == $this->getConfig()->secondaryBusinessId\n      ) {\n        $agency_id = $agency->{AbstractCrudObject::FIELD_ID};\n      }\n    }\n\n    if ($agency_id === null) {\n      $this->markTestSkipped(\"Secondary business is not a valid agency\");\n    }\n\n    $pixel->sharePixelWithAgency(\n      $this->getConfig()->businessId,\n      $this->getConfig()->secondaryBusinessId);\n\n    $pixel->unsharePixelWithAgency(\n      $this->getConfig()->businessId,\n      $this->getConfig()->secondaryBusinessId);\n  }\n}\n", "num_lines": 167}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Object\\AdImage;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Object\\Fields\\CampaignFields;\nuse FacebookAds\\Object\\Fields\\AdCreativeFields;\nuse FacebookAds\\Object\\Fields\\AdFields;\nuse FacebookAds\\Object\\Fields\\AdImageFields;\nuse FacebookAds\\Object\\Fields\\AdSetFields;\nuse FacebookAds\\Object\\Fields\\ObjectStory\\LinkDataFields;\nuse FacebookAds\\Object\\Fields\\ObjectStorySpecFields;\nuse FacebookAds\\Object\\ObjectStory\\LinkData;\nuse FacebookAds\\Object\\ObjectStorySpec;\nuse FacebookAds\\Object\\TargetingSpecs;\nuse FacebookAds\\Object\\Fields\\TargetingSpecsFields;\nuse FacebookAds\\Object\\Values\\BillingEvents;\nuse FacebookAds\\Object\\Values\\OptimizationGoals;\nuse FacebookAdsTest\\Config\\SkippableFeatureTestInterface;\n\nclass AdTest extends AbstractCrudObjectTestCase\n  implements SkippableFeatureTestInterface {\n\n  /**\n   * @var Campaign\n   */\n  protected $campaign;\n\n  /**\n   * @var AdSet\n   */\n  protected $adSet;\n\n  /**\n   * @var AdCreative\n   */\n  protected $adCreative;\n\n  /**\n   * @var AdImage\n   */\n  protected $adImage;\n\n  /**\n   * @return array\n   */\n  public function skipIfAny() {\n    return array('no_payment_method');\n  }\n\n  public function setup() {\n    parent::setup();\n\n    $targeting = new TargetingSpecs();\n    $targeting->{TargetingSpecsFields::GEO_LOCATIONS} = array(\n      'countries' => array('US'),\n    );\n\n    $this->campaign = new Campaign(null, $this->getConfig()->accountId);\n    $this->campaign->{CampaignFields::NAME} = $this->getConfig()->testRunId;\n    $this->campaign->create();\n\n    $this->adSet = new AdSet(null, $this->getConfig()->accountId);\n    $this->adSet->{AdSetFields::CAMPAIGN_ID}\n      = (int) $this->campaign->{AdSetFields::ID};\n    $this->adSet->{AdSetFields::NAME} = $this->getConfig()->testRunId;\n    $this->adSet->{AdSetFields::DAILY_BUDGET} = '150';\n    $this->adSet->{AdSetFields::START_TIME}\n      = (new \\DateTime(\"+1 week\"))->format(\\DateTime::ISO8601);\n    $this->adSet->{AdSetFields::END_TIME}\n      = (new \\DateTime(\"+2 week\"))->format(\\DateTime::ISO8601);\n    $this->adSet->{AdSetFields::TARGETING} = $targeting;\n    $this->adSet->{AdSetFields::OPTIMIZATION_GOAL} = OptimizationGoals::REACH;\n    $this->adSet->{AdSetFields::BILLING_EVENT} = BillingEvents::IMPRESSIONS;\n    $this->adSet->{AdSetFields::BID_AMOUNT} = 2;\n    $this->adSet->save(array(\n      AdSet::STATUS_PARAM_NAME => AdSet::STATUS_PAUSED,\n    ));\n\n    $this->adImage = new AdImage(null, $this->getConfig()->accountId);\n    $this->adImage->{AdImageFields::FILENAME}\n      = $this->getConfig()->testImagePath;\n    $this->adImage->save();\n\n    $link = new LinkData();\n    $link->{LinkDataFields::MESSAGE} = 'Message';\n    $link->{LinkDataFields::IMAGE_HASH} = $this->adImage->{AdImageFields::HASH};\n    $link->{LinkDataFields::LINK} = $this->getConfig()->appUrl;\n\n    $story = new ObjectStorySpec();\n    $story->{ObjectStorySpecFields::PAGE_ID} = $this->getConfig()->pageId;\n    $story->{ObjectStorySpecFields::LINK_DATA} = $link;\n\n    $this->adCreative = new AdCreative(null, $this->getConfig()->accountId);\n    $this->adCreative->{AdCreativeFields::OBJECT_STORY_SPEC} = $story;\n    $this->adCreative->create();\n  }\n\n  public function tearDown() {\n    if ($this->adSet) {\n      $this->adSet->deleteSelf();\n      $this->adSet = null;\n    }\n\n    if ($this->campaign) {\n      $this->campaign->deleteSelf();\n      $this->campaign = null;\n    }\n\n    if ($this->adCreative) {\n      $this->adCreative->deleteSelf();\n      $this->adCreative = null;\n    }\n\n    if ($this->adImage) {\n      $this->adImage->deleteSelf();\n      $this->adImage = null;\n    }\n\n    parent::tearDown();\n  }\n\n  public function testCrudAccess() {\n\n    $group = new Ad(null, $this->getConfig()->accountId);\n    $group->{AdFields::NAME} = $this->getConfig()->testRunId;\n    $group->{AdFields::ADSET_ID}\n      = (int) $this->adSet->{AdSetFields::ID};\n    $group->{AdFields::CREATIVE}\n      = array('creative_id' => $this->adCreative->{AdCreativeFields::ID});\n\n    $this->assertCanCreate($group, array(\n      Ad::STATUS_PARAM_NAME => Ad::STATUS_PAUSED,\n    ));\n    $this->assertCanRead($group);\n    $this->assertCanUpdate($group, array(\n      AdFields::NAME => $this->getConfig()->testRunId.' updated',\n    ));\n\n    $this->assertCanFetchConnection($group, 'getAdCreatives');\n    $this->assertCanFetchConnection($group, 'getLeads');\n    $this->assertCanFetchConnection($group, 'getTargetingDescription');\n    $this->assertCanFetchConnection($group, 'getAdPreviews',\n      array(),\n      array('ad_format' => 'RIGHT_COLUMN_STANDARD'));\n\n    if (!$this->shouldSkipTest('no_reach_and_frequency')) {\n      $this->assertCanFetchConnection($group, 'getReachEstimate');\n    }\n    $this->assertCanFetchConnection($group, 'getClickTrackingTag');\n    $this->assertCanFetchConnection($group, 'getInsights');\n    $this->assertCanFetchConnection($group, 'getInsightsAsync');\n\n    $this->assertCanBeLabeled($group);\n    $this->assertCanArchive($group);\n\n    $this->assertCanDelete($group);\n  }\n}\n", "num_lines": 186}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdUser;\nuse FacebookAds\\Object\\Fields\\AdUserFields;\n\nclass AdUserTest extends AbstractCrudObjectTestCase {\n\n  public function testCrudAccess() {\n    $ad_account = new AdAccount($this->getConfig()->accountId);\n    $ad_users = $ad_account->getAdUsers();\n\n    $this->assertGreaterThan(0, $ad_users->count());\n\n    $uid = (new AdUser('me'))->read()->{AdUserFields::ID};\n    $found = false;\n    foreach ($ad_users as $ad_user) {\n      if ($ad_user->id === $uid) {\n        $this->assertCanFetchConnection($ad_user, 'getAdAccounts');\n        $this->assertCanFetchConnection($ad_user, 'getAdAccountGroups');\n        $found = true;\n        break;\n      }\n    }\n\n    $this->assertTrue($found);\n  }\n}\n", "num_lines": 53}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdVideo;\nuse FacebookAds\\Object\\Fields\\AdVideoFields;\nuse FacebookAdsTest\\Config\\SkippableFeatureTestInterface;\n\nclass AdVideoTest extends AbstractCrudObjectTestCase\n  implements SkippableFeatureTestInterface {\n\n  /**\n   * @return array\n   */\n  public function skipIfAny() {\n    return array('no_video_upload');\n  }\n\n  public function testCrud() {\n    $video = new AdVideo(null, $this->getConfig()->accountId);\n    $video->{AdVideoFields::NAME} = $this->getConfig()->testRunId;\n    $video->{AdVideoFields::SOURCE} = $this->getConfig()->testVideoPath;\n    $this->assertCanCreate($video);\n    $this->assertCanRead($video);\n    $this->assertCanUpdate($video, array(\n      AdVideoFields::NAME => $this->getConfig()->testRunId.' updated',\n    ));\n    $this->assertCanDelete($video);\n  }\n}\n", "num_lines": 53}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\n namespace FacebookAdsTest\\Object;\n\n use FacebookAds\\Object\\AdAccount;\n use FacebookAds\\Object\\Fields\\AdAccountFields;\n use FacebookAds\\Object\\AdReportRun;\n use FacebookAds\\Object\\Fields\\AdsInsightsFields;\n use FacebookAds\\Api;\n\n class AsyncJobInsightsTest extends AbstractAsyncJobTestCase {\n\n   public function testCrud() {\n     $account = new AdAccount($this->getConfig()->accountId);\n     $job = $account->getInsightsAsync();\n     $this->assertTrue($job instanceof AdReportRun);\n     $this->waitTillJobComplete($job);\n     $job->getInsights();\n   }\n\n   public function testFields() {\n     $account = new AdAccount($this->getConfig()->accountId);\n     $fields = array(AdAccountFields::ACCOUNT_ID);\n     $account->{AdAccountFields::ACCOUNT_ID} = $account->getSelf($fields)->{AdAccountFields::ACCOUNT_ID};\n     $fields = array(AdsInsightsFields::ACCOUNT_ID);\n     $job = $account->getInsightsAsync($fields);\n     $this->assertTrue($job instanceof AdReportRun);\n     $this->waitTillJobComplete($job);\n     $result = $job->getInsights();\n     $this->assertEquals(\n       $result[0]->{AdsInsightsFields::ACCOUNT_ID},\n       $account->{AdAccountFields::ACCOUNT_ID});\n   }\n }\n", "num_lines": 57}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdUser;\nuse FacebookAds\\Object\\Business;\nuse FacebookAds\\Object\\Fields\\AdUserFields;\nuse FacebookAds\\Object\\Fields\\BusinessFields;\nuse FacebookAds\\Object\\Values\\AdAccountRoles;\nuse FacebookAdsTest\\Config\\SkippableFeatureTestInterface;\nuse FacebookAds\\Object\\Values\\BusinessRoles;\n\nclass BusinessTest extends AbstractCrudObjectTestCase\n  implements SkippableFeatureTestInterface {\n\n  /**\n   * @return array\n   */\n  public function skipIfAny() {\n    return array('no_business_manager');\n  }\n\n  public function testCrud() {\n    $business = new Business($this->getConfig()->businessId);\n    $this->assertCanRead($business);\n    $this->assertCannotDelete($business);\n\n\n    $name = $business->read(array(BusinessFields::NAME))\n      ->{BusinessFields::NAME};\n\n    $this->assertCanUpdate($business, array(\n      BusinessFields::NAME => \"My Awesome Business\"\n    ));\n\n    $business->{BusinessFields::NAME} = $name;\n    $business->save();\n\n\n    if ($this->getConfig()->secondaryPageId) {\n      $business->claimPage(\n        $this->getConfig()->secondaryPageId,\n        BusinessRoles::OWNER);\n      $business->deletePage($this->getConfig()->secondaryPageId);\n    }\n\n    $business->inviteUserByEmail('test@example.com', BusinessRoles::EMPLOYEE);\n    $business->deleteUserByEmail('test@example.com');\n\n    $user = (new AdUser('me'))->read(array('id'));\n    $business->addUserPermissionById(\n      $user->{AdUserFields::ID},\n      BusinessRoles::ADMIN);\n\n    if ($this->getConfig()->secondaryAccountId) {\n      $business->claimAdAccount(\n        $this->getConfig()->secondaryAccountId,\n        BusinessRoles::AGENCY,\n        array(AdAccountRoles::ADMIN));\n      $business->deleteAdAccount(\n        $this->getConfig()->secondaryAccountId);\n    }\n\n    if ($this->getConfig()->secondaryAppId) {\n      $business->claimApp(\n        $this->getConfig()->secondaryAppId,\n        BusinessRoles::OWNER);\n      $business->deleteApp($this->getConfig()->secondaryAppId);\n    }\n  }\n\n  public function testConnections() {\n    $business = new Business($this->getConfig()->businessId);\n    $this->assertCanFetchConnection($business, 'getAdAccounts');\n    $this->assertCanFetchConnection($business, 'getUserPermissions');\n    $this->assertCanFetchConnection($business, 'getProjects');\n    $this->assertCanFetchConnection($business, 'getPages');\n    $this->assertCanFetchConnection($business, 'getApps');\n    $this->assertCanFetchConnection($business, 'getClients');\n    $this->assertCanFetchConnection($business, 'getAgencies');\n    $this->assertCanFetchConnection($business, 'getCreditCards');\n    $this->assertCanFetchConnection($business, 'getExtendedCredits');\n    $this->assertCanFetchConnection($business, 'getProductCatalogues');\n    $this->assertCanFetchConnection($business, 'getSystemUsers');\n    $this->assertCanFetchConnection($business, 'getAdsPixels');\n  }\n}\n", "num_lines": 110}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\Fields\\CampaignFields;\n\nclass CampaignTest extends AbstractCrudObjectTestCase {\n\n  public function testCrud() {\n    $campaign = new Campaign(null, $this->getConfig()->accountId);\n    $campaign->{CampaignFields::NAME} = $this->getConfig()->testRunId;\n    \n    $this->assertCanCreate($campaign);\n    $this->assertCanRead($campaign);\n    $this->assertCanUpdate(\n      $campaign,\n      array(\n        CampaignFields::NAME => $this->getConfig()->testRunId.' updated',\n      ));\n    $this->assertCanFetchConnection($campaign, 'getAdSets');\n    $this->assertCanFetchConnection($campaign, 'getAds');\n    $this->assertCanFetchConnection($campaign, 'getInsights');\n    $this->assertCanFetchConnection($campaign, 'getInsightsAsync');\n\n    $this->assertCanBeLabeled($campaign);\n    $this->assertCanArchive($campaign);\n\n    $this->assertCanDelete($campaign);\n  }\n}\n", "num_lines": 54}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Object\\Fields\\CustomAudienceFields;\nuse FacebookAds\\Object\\Fields\\CustomAudienceMultikeySchemaFields;\nuse FacebookAds\\Object\\Values\\CustomAudienceSubtypes;\nuse FacebookAds\\Object\\Values\\CustomAudienceTypes;\n\nclass CustomAudienceMultikeyTest extends AbstractCrudObjectTestCase {\n\n  /**\n  * @var CustomAudience\n  */\n  protected $customaudience;\n\n  public function setup() {\n    parent::setup();\n    $adaccount = new AdAccount($this->getConfig()->accountId);\n    $params = array(\n      CustomAudienceFields::NAME => $this->getConfig()->testRunId,\n      CustomAudienceFields::SUBTYPE => CustomAudienceSubtypes::CUSTOM,\n    );\n    $this->customaudience = $adaccount->createCustomAudience(\n      array(),\n      $params\n    );\n  }\n\n  public function tearDown() {\n    if ($this->customaudience) {\n      $this->customaudience->deleteSelf();\n    }\n  }\n\n  private function checkServerResponse(\n    CustomAudience $ca,\n    array $users,\n    array $schema,\n    $is_hashed,\n    $is_normalized) {\n    $add = $ca->addUsersMultiKey($users, $schema, $is_hashed, $is_normalized);\n    $this->assertClusterChangesResponse($ca, $users, $add);\n    $remove = $ca->removeUsersMultiKey($users, $schema, $is_hashed, $is_normalized);\n    $this->assertClusterChangesResponse($ca, $users, $remove);\n  }\n\n\n  protected function assertClusterChangesResponse(\n    CustomAudience $ca, array $users, $response) {\n\n    $this->assertTrue(is_array($response));\n\n    $this->assertArrayHasKey('audience_id', $response);\n    $this->assertEquals(\n      $response['audience_id'], $ca->{CustomAudienceFields::ID});\n    $this->assertArrayHasKey('num_received', $response);\n    $this->assertEquals($response['num_received'], count($users));\n    $this->assertArrayHasKey('num_invalid_entries', $response);\n    $this->assertEquals($response['num_invalid_entries'], 0);\n  }\n\n  public function testMultikeyCustomAudiences() {\n    $users = array(\n      array('abc123def', 'fname', 'lname', 'someone@example.com'),\n      array('abc234def', 'fname_new', 'lname_new', 'someone_new@example.com'),\n    );\n    $schema = array(\n      CustomAudienceMultikeySchemaFields::EXTERN_ID,\n      CustomAudienceMultikeySchemaFields::FIRST_NAME,\n      CustomAudienceMultikeySchemaFields::LAST_NAME,\n      CustomAudienceMultikeySchemaFields::EMAIL,\n    );\n    $is_hashed = false;\n    $is_normalized = false;\n    $this->checkServerResponse(\n      $this->customaudience,\n      $users,\n      $schema,\n      $is_hashed,\n      $is_normalized);\n  }\n\n  public function testSinglekeyExternIDCustomAudiences() {\n    $users = array(\n      array('abc123def'),\n      array('abc234def'),\n      array('abc345def'),\n      array('abc456def'),\n    );\n    $schema = array(\n      CustomAudienceMultikeySchemaFields::EXTERN_ID,\n    );\n    $is_hashed = false;\n    $is_normalized = false;\n    $this->checkServerResponse(\n      $this->customaudience,\n      $users,\n      $schema,\n      $is_hashed,\n      $is_normalized);\n  }\n\n}\n", "num_lines": 128}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\CustomAudience;\nuse FacebookAds\\Object\\Fields\\CustomAudienceFields;\nuse FacebookAds\\Object\\Values\\CustomAudienceSubtypes;\nuse FacebookAds\\Object\\Values\\CustomAudienceTypes;\n\nclass CustomAudienceTest extends AbstractCrudObjectTestCase {\n\n  protected function assertClusterChangesResponse(\n    CustomAudience $ca, array $users, $response) {\n\n    $this->assertTrue(is_array($response));\n\n    $this->assertArrayHasKey('audience_id', $response);\n    $this->assertEquals(\n      $response['audience_id'], $ca->{CustomAudienceFields::ID});\n    $this->assertArrayHasKey('num_received', $response);\n    $this->assertEquals($response['num_received'], count($users));\n    $this->assertArrayHasKey('num_invalid_entries', $response);\n    $this->assertEquals($response['num_invalid_entries'], 0);\n  }\n\n  public function testCustomAudiences() {\n    $ca = new CustomAudience(null, $this->getConfig()->accountId);\n    $ca->{CustomAudienceFields::NAME} = $this->getConfig()->testRunId;\n    $ca->{CustomAudienceFields::SUBTYPE} = CustomAudienceSubtypes::CUSTOM;\n\n    $this->assertCanCreate($ca);\n\n    $this->assertCanRead($ca);\n    $this->assertCanUpdate(\n      $ca,\n      array(\n        CustomAudienceFields::NAME => $this->getConfig()->testRunId.' updated',\n      ));\n\n    $users = array('someone@example.com');\n\n    $add = $ca->addUsers($users, CustomAudienceTypes::EMAIL);\n    $this->assertClusterChangesResponse($ca, $users, $add);\n\n    $remove = $ca->removeUsers($users, CustomAudienceTypes::EMAIL);\n    $this->assertClusterChangesResponse($ca, $users, $remove);\n\n    $optout = $ca->optOutUsers($users, CustomAudienceTypes::EMAIL);\n    $this->assertSuccessResponse($optout);\n\n    $this->assertCanDelete($ca);\n  }\n\n  /**\n   * @depends testCustomAudiences\n   */\n  public function testAppIdsPayload() {\n    $ca = new CustomAudience(null, $this->getConfig()->accountId);\n    $ca->{CustomAudienceFields::NAME} = $this->getConfig()->testRunId;\n    $ca->{CustomAudienceFields::SUBTYPE} = CustomAudienceSubtypes::CUSTOM;\n    $ca->create();\n\n    $users = array($this->getApi()->call('/me')->getContent()['id']);\n\n    $add = $ca->addUsers(\n      $users, CustomAudienceTypes::ID, array($this->getConfig()->appId));\n    $this->assertClusterChangesResponse($ca, $users, $add);\n\n    $remove = $ca->removeUsers(\n      $users, CustomAudienceTypes::ID, array($this->getConfig()->appId));\n    $this->assertClusterChangesResponse($ca, $users, $remove);\n\n    $optout = $ca->optOutUsers(\n      $users, CustomAudienceTypes::ID, array($this->getConfig()->appId));\n    $this->assertSuccessResponse($optout);\n\n    $ca->deleteSelf();\n  }\n}\n", "num_lines": 102}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\Campaign;\nuse FacebookAds\\Object\\AdCreative;\nuse FacebookAds\\Object\\Ad;\nuse FacebookAds\\Object\\AdSet;\nuse FacebookAds\\Object\\AdsPixel;\nuse FacebookAds\\Object\\ObjectStorySpec;\nuse FacebookAds\\Object\\ProductAudience;\nuse FacebookAds\\Object\\ProductCatalog;\nuse FacebookAds\\Object\\ProductSet;\nuse FacebookAds\\Object\\TargetingSpecs;\nuse FacebookAds\\Object\\ObjectStory\\TemplateData;\nuse FacebookAds\\Object\\Fields\\CampaignFields;\nuse FacebookAds\\Object\\Fields\\AdCreativeFields;\nuse FacebookAds\\Object\\Fields\\AdFields;\nuse FacebookAds\\Object\\Fields\\AdSetFields;\nuse FacebookAds\\Object\\Fields\\AdsPixelsFields;\nuse FacebookAds\\Object\\Fields\\ObjectStory\\TemplateDataFields;\nuse FacebookAds\\Object\\Fields\\ObjectStorySpecFields;\nuse FacebookAds\\Object\\Fields\\ProductAudienceFields;\nuse FacebookAds\\Object\\Fields\\ProductCatalogFields;\nuse FacebookAds\\Object\\Fields\\ProductSetFields;\nuse FacebookAds\\Object\\Fields\\TargetingSpecsFields;\nuse FacebookAds\\Object\\Values\\AdObjectives;\nuse FacebookAds\\Object\\Values\\BillingEvents;\nuse FacebookAds\\Object\\Values\\CallToActionTypes;\nuse FacebookAds\\Object\\Values\\OptimizationGoals;\n\nclass DynamicProductAdsAdvertTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * @var ProductSet\n   */\n  protected $productSet;\n\n  /**\n   * @var ProductCatalog\n   */\n  protected $productCatalog;\n\n  /**\n   * @var AdsPixel\n   */\n  protected $adsPixel;\n\n  /**\n   * @var ProductAudience\n   */\n  protected $productAudience;\n\n  /**\n   * @var Campaign\n   */\n  protected $campaign;\n\n  /**\n   * @var AdSet\n   */\n  protected $adSet;\n\n  /**\n   * @var Ad\n   */\n  protected $ad;\n\n  /**\n   * @var AdCreative\n   */\n  protected $creative;\n\n  public function setup() {\n    parent::setup();\n\n    $account = new AdAccount($this->getConfig()->accountId);\n    $this->adsPixel = $account->getAdsPixels()->current();\n    if ($this->adsPixel === null) {\n      throw new \\Exception('Ads Pixel is null');\n    }\n\n    $this->productCatalog =\n      new ProductCatalog(null, $this->getConfig()->businessId);\n    $this->productCatalog->setData(array(\n      ProductCatalogFields::NAME => $this->getConfig()->testRunId,\n    ));\n    $this->productCatalog->create();\n\n    $this->productSet =\n      new ProductSet(null, $this->productCatalog->{ProductCatalogFields::ID});\n    $this->productSet->setData(array(\n      ProductSetFields::NAME => $this->getConfig()->testRunId,\n      ProductSetFields::FILTER => array(\n        'retailer_id' => array(\n          'is_any' => array('pid1', 'pid2')\n        )\n      )\n    ));\n    $this->productSet->create();\n\n    $this->productAudience\n      = new ProductAudience(null, $this->getConfig()->accountId);\n    $this->productAudience->setData(array(\n      ProductAudienceFields::NAME => $this->getConfig()->testRunId,\n      ProductAudienceFields::PRODUCT_SET_ID =>\n        $this->productSet->{ProductSetFields::ID},\n      ProductAudienceFields::PIXEL_ID =>\n        $this->adsPixel->{AdsPixelsFields::ID},\n      ProductAudienceFields::INCLUSIONS => array(array(\n        'retention_seconds' => 86400,\n        'rule' => array(\n          'and' => array(\n            array('event' => array('eq'=>'ViewContent')),\n            array('userAgent' => array('i_contains'=>'iPhone'))\n          )\n        )\n      )),\n    ));\n\n    $this->productAudience->create();\n  }\n\n  public function tearDown() {\n    if ($this->productSet) {\n      $this->productSet->deleteSelf();\n      $this->productSet = null;\n    }\n\n    if ($this->productCatalog) {\n      $this->productCatalog->deleteSelf();\n      $this->productCatalog = null;\n    }\n\n    if ($this->productAudience) {\n      $this->productAudience->deleteSelf();\n      $this->productAudience = null;\n    }\n\n    if ($this->campaign) {\n      $this->campaign->deleteSelf();\n      $this->campaign = null;\n    }\n\n    if ($this->adSet) {\n      $this->adSet->deleteSelf();\n      $this->adSet = null;\n    }\n\n    if ($this->ad) {\n      $this->ad->deleteSelf();\n      $this->ad = null;\n    }\n\n    if ($this->creative) {\n      $this->creative->deleteSelf();\n      $this->creative = null;\n    }\n\n    parent::tearDown();\n  }\n\n  public function testDynamicProductAdsCreation() {\n    $this->campaign = new Campaign(null, $this->getConfig()->accountId);\n    $this->campaign->setData(array(\n      CampaignFields::NAME => $this->getConfig()->testRunId,\n      CampaignFields::OBJECTIVE => AdObjectives::PRODUCT_CATALOG_SALES,\n      CampaignFields::PROMOTED_OBJECT =>\n        array('product_catalog_id' =>\n          $this->productCatalog->{ProductCatalogFields::ID})\n     ));\n    $this->assertCanCreate($this->campaign);\n\n    $targeting = new TargetingSpecs();\n    $targeting->{TargetingSpecsFields::GEO_LOCATIONS} =\n      array('countries' => array('US'));\n    $targeting->{TargetingSpecsFields::DYNAMIC_AUDIENCE_IDS} =\n      array($this->productAudience->{ProductAudienceFields::ID});\n\n    $this->adSet = new AdSet(null, $this->getConfig()->accountId);\n    $this->adSet->setData(array(\n      AdSetFields::NAME => $this->getConfig()->testRunId,\n      AdSetFields::OPTIMIZATION_GOAL => OptimizationGoals::LINK_CLICKS,\n      AdSetFields::BILLING_EVENT => BillingEvents::IMPRESSIONS,\n      AdSetFields::BID_AMOUNT => 2,\n      AdSetFields::DAILY_BUDGET => 2000,\n      AdSetFields::CAMPAIGN_ID =>\n        $this->campaign->{CampaignFields::ID},\n      AdSetFields::TARGETING => $targeting,\n      AdsetFields::PROMOTED_OBJECT =>\n        array(\n          'product_set_id' => $this->productSet->{ProductSetFields::ID},\n        ),\n    ));\n    $this->assertCanCreate($this->adSet);\n\n    $template = new TemplateData();\n    $template->setData(array(\n      TemplateDataFields::DESCRIPTION => '{{product.description}}',\n      TemplateDataFields::LINK => 'http://www.example.com/',\n      TemplateDataFields::MESSAGE => 'Test DPA Ad Message',\n      TemplateDataFields::NAME => '{{product.name | titleize}}',\n      TemplateDataFields::CALL_TO_ACTION => array(\n        'type' => CallToActionTypes::SHOP_NOW\n      ),\n    ));\n\n    $story = new ObjectStorySpec();\n    $story->setData(array(\n      ObjectStorySpecFields::PAGE_ID => $this->getConfig()->pageId,\n      ObjectStorySpecFields::TEMPLATE_DATA => $template,\n    ));\n\n    $this->creative = new AdCreative(null, $this->getConfig()->accountId);\n    $this->creative->setData(array(\n      AdCreativeFields::NAME => $this->getConfig()->testRunId,\n      AdCreativeFields::OBJECT_STORY_SPEC => $story,\n      AdCreativeFields::PRODUCT_SET_ID =>\n        $this->productSet->{ProductSetFields::ID},\n    ));\n    $this->assertCanCreate($this->creative);\n\n    $this->ad = new Ad(null, $this->getConfig()->accountId);\n    $this->ad->setData(array(\n      AdFields::NAME => 'DPA Test Ad 1 '.$this->getConfig()->testRunId,\n      AdFields::ADSET_ID => $this->adSet->{AdSetFields::ID},\n      AdFields::CREATIVE =>\n        array('creative_id' => $this->creative->{AdCreativeFields::ID}),\n    ));\n    $this->assertCanCreate($this->ad);\n  }\n}\n", "num_lines": 256}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AbstractCrudObject;\n\nclass EmptyCrudObject extends AbstractCrudObject {\n}\n", "num_lines": 31}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAds\\Object\\AbstractObject;\n\nclass EmptyObject extends AbstractObject {\n\n  /**\n   * @var array\n   */\n  protected static $fields = array(\n    AbstractCrudObject::FIELD_ID,\n  );\n}\n", "num_lines": 39}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\Fields\\LeadgenFormFields;\nuse FacebookAds\\Object\\LeadgenForm;\nuse FacebookAds\\Object\\Page;\n\nclass LeadgenFormTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * @var int\n   */\n  protected $leadgenFormId;\n\n  public function setup() {\n    parent::setup();\n\n    $page = new Page($this->getConfig()->pageId);\n    $forms = $page->getLeadgenForms();\n\n    if ($forms->count() === 0) {\n      $this->markTestSkipped(sprintf(\n        'LeadgenForms can\\'t be created through the API.'\n          .' Page %s has no leadgen forms',\n        (string)$this->getConfig()->pageId));\n    }\n\n    $this->leadgenFormId = $forms->current()->{LeadgenFormFields::ID};\n  }\n\n  public function tearDown() {\n    $this->leadgenFormId = null;\n\n    parent::tearDown();\n  }\n\n  public function testCrud() {\n    $form = new LeadgenForm($this->leadgenFormId);\n\n    $this->assertCannotCreate($form);\n    $this->assertCanRead($form);\n    $this->assertCannotUpdate($form);\n    $this->assertCanFetchConnection($form, 'getLeads');\n    $this->assertCannotDelete($form);\n  }\n}\n", "num_lines": 70}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\Fields\\LeadFields;\nuse FacebookAds\\Object\\Fields\\LeadgenFormFields;\nuse FacebookAds\\Object\\Lead;\nuse FacebookAds\\Object\\LeadgenForm;\nuse FacebookAds\\Object\\Page;\n\nclass LeadTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * @var int\n   */\n  protected $leadId;\n\n  public function setup() {\n    parent::setup();\n\n    $limit = 25;\n    $page = new Page($this->getConfig()->pageId);\n    $forms = $page->getLeadgenForms(\n      array(LeadgenFormFields::ID),\n      array('limit' => $limit));\n\n    $forms->setUseImplicitFetch(false); // Force-disable pagination\n\n    /** @var LeadgenForm $form */\n    foreach ($forms as $form) {\n      $leads = $form->getLeads();\n      if ($leads->count() > 0) {\n        $this->leadId = $leads->current()->{LeadFields::ID};\n        break;\n      }\n    }\n\n    if ($this->leadId === null) {\n      $this->markTestSkipped(sprintf(\n        'Leads can\\'t be created through the API.'\n          .' The first %d leadgen forms of Page %s have no leads',\n        $limit,\n        (string)$this->getConfig()->pageId));\n    }\n  }\n\n  public function tearDown() {\n    $this->leadId = null;\n\n    parent::tearDown();\n  }\n\n  public function testCrud() {\n    $lead = new Lead($this->leadId);\n\n    $this->assertCannotCreate($lead);\n    $this->assertCanRead($lead);\n    $this->assertCannotUpdate($lead);\n    $this->assertCannotDelete($lead);\n  }\n}\n", "num_lines": 84}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\Page;\n\nclass PageTest extends AbstractCrudObjectTestCase {\n\n  public function testConnections() {\n    $page = new Page($this->getConfig()->pageId);\n\n    $this->assertCannotCreate($page);\n    $this->assertCanRead($page);\n    $this->assertCanFetchConnection($page, 'getLeadgenForms');\n\n    // Page editing is currently not supported in the SDK\n  }\n}\n", "num_lines": 41}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\PartnerCategory;\nuse FacebookAdsTest\\Config\\SkippableFeatureTestInterface;\n\nclass PartnerCategoryTest extends AbstractCrudObjectTestCase\n  implements SkippableFeatureTestInterface {\n\n  /**\n   * @return array\n   */\n  public function skipIfAny() {\n    return array('no_partner_categories');\n  }\n\n  public function testCrudAccess() {\n    $account = new AdAccount($this->getConfig()->accountId);\n    $cursor = $account->getPartnerCategories();\n    if (!$cursor->count()) {\n      $this->markTestSkipped();\n    }\n\n    /* @var $category AbstractCrudObject */\n    $category = $cursor->current();\n\n    $this->assertTrue($category instanceof PartnerCategory);\n    $this->assertCanRead($category);\n    $this->assertCannotUpdate($category);\n    $this->assertCannotDelete($category);\n    $this->assertCannotCreate(\n      new PartnerCategory(null, $this->getConfig()->accountId));\n  }\n}\n", "num_lines": 60}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AdAccount;\nuse FacebookAds\\Object\\AdsPixel;\nuse FacebookAds\\Object\\ProductAudience;\nuse FacebookAds\\Object\\ProductCatalog;\nuse FacebookAds\\Object\\ProductSet;\nuse FacebookAds\\Object\\Fields\\AdsPixelsFields;\nuse FacebookAds\\Object\\Fields\\ProductAudienceFields;\nuse FacebookAds\\Object\\Fields\\ProductCatalogFields;\nuse FacebookAds\\Object\\Fields\\ProductSetFields;\n\nclass ProductAudienceTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * @var ProductSet\n   */\n  protected $productSet;\n\n  /**\n   * @var ProductCatalog\n   */\n  protected $productCatalog;\n\n  /**\n   * @var AdAccount\n   */\n  protected $account;\n\n  /**\n   * @var AdsPixel\n   */\n  protected $adsPixel;\n\n  public function setup() {\n    parent::setup();\n\n    $this->account = new AdAccount($this->getConfig()->accountId);\n\n    $cursor = $this->account->getAdsPixels();\n    $this->adsPixel = $cursor->current();\n\n    $this->productCatalog =\n      new ProductCatalog(null, $this->getConfig()->businessId);\n    $this->productCatalog->setData(array(\n      ProductCatalogFields::NAME => $this->getConfig()->testRunId,\n    ));\n    $this->productCatalog->create();\n\n    $this->productSet =\n      new ProductSet(null, $this->productCatalog->{ProductCatalogFields::ID});\n    $this->productSet->setData(array(\n      ProductSetFields::NAME => $this->getConfig()->testRunId,\n      ProductSetFields::FILTER => array(\n        'retailer_id' => array(\n          'is_any' => array('pid1', 'pid2')\n        )\n      )\n    ));\n    $this->productSet->create();\n  }\n\n  public function tearDown() {\n    if ($this->productSet) {\n      $this->productSet->deleteSelf();\n      $this->productSet = null;\n    }\n\n    if ($this->productCatalog) {\n      $this->productCatalog->deleteSelf();\n      $this->productCatalog = null;\n    }\n\n    parent::tearDown();\n  }\n\n  public function testCrudAccess() {\n    $audience_name = $this->getConfig()->testRunId;\n    $this->adsPixel->{AdsPixelsFields::ID};\n\n    $audience = new ProductAudience(null, $this->getConfig()->accountId);\n    $audience->setData(array(\n      ProductAudienceFields::NAME => $audience_name,\n      ProductAudienceFields::PRODUCT_SET_ID =>\n        $this->productSet->{ProductSetFields::ID},\n      ProductAudienceFields::PIXEL_ID =>\n        $this->adsPixel->{AdsPixelsFields::ID},\n      ProductAudienceFields::INCLUSIONS => array(array(\n        'retention_seconds' => 86400,\n        'rule' => array(\n          'and' => array(\n            array('event' => array('eq'=>'ViewContent')),\n            array('userAgent' => array('i_contains'=>'iPhone'))\n          )\n        )\n      )),\n    ));\n\n    $this->assertCanCreate($audience);\n    $this->assertCanRead($audience);\n    $this->assertCanUpdate($audience, array(\n      ProductAudienceFields::NAME => $audience_name.' updated',\n    ));\n    $this->assertCanDelete($audience);\n  }\n}\n", "num_lines": 131}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\ProductCatalog;\nuse FacebookAds\\Object\\Fields\\ProductCatalogFields;\n\nclass ProductCatalogTest extends AbstractCrudObjectTestCase {\n\n  public function testCrud() {\n    $catalog_name = $this->getConfig()->testRunId;\n    $catalog = new ProductCatalog(null, $this->getConfig()->businessId);\n    $catalog->setData(array(\n      ProductCatalogFields::NAME => $catalog_name,\n    ));\n\n    $this->assertCanCreate($catalog);\n    $this->assertCanRead($catalog);\n    $this->assertCanUpdate($catalog, array(\n      ProductCatalogFields::NAME => $catalog_name.' updated',\n    ));\n    $this->assertCanFetchConnectionAsArray($catalog, 'getExternalEventSources');\n    $this->assertCanFetchConnection($catalog, 'getProductSets');\n    $this->assertCanFetchConnection($catalog, 'getProductFeeds');\n    $this->assertCanDelete($catalog);\n  }\n}\n", "num_lines": 50}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\ProductCatalog;\nuse FacebookAds\\Object\\ProductFeed;\nuse FacebookAds\\Object\\Fields\\ProductCatalogFields;\nuse FacebookAds\\Object\\Fields\\ProductFeedFields;\n\nclass ProductFeedTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * @var ProductCatalog\n   */\n  protected $productCatalog;\n\n  public function setup() {\n    parent::setup();\n\n    $this->productCatalog\n      = new ProductCatalog(null, $this->getConfig()->businessId);\n    $this->productCatalog->setData(array(\n      ProductCatalogFields::NAME => $this->getConfig()->testRunId,\n    ));\n    $this->productCatalog->create();\n  }\n\n  public function tearDown() {\n    if ($this->productCatalog) {\n      $this->productCatalog->deleteSelf();\n      $this->productCatalog = null;\n    }\n\n    parent::tearDown();\n  }\n\n  public function testCrudAccess() {\n    $feed_name = $this->getConfig()->testRunId;\n    $feed = new ProductFeed(null, $this->productCatalog->id);\n    $feed->setData(array(\n      ProductFeedFields::FILE_NAME => 'my_product_feed.tsv',\n      ProductFeedFields::NAME => $feed_name,\n    ));\n\n    $this->assertCanCreate($feed);\n    $this->assertCanRead($feed);\n    $this->assertCanUpdate($feed, array(\n      ProductFeedFields::NAME => $feed_name.' updated',\n    ));\n    $this->assertCanFetchConnection($feed, 'getProducts');\n    $this->assertCanFetchConnection($feed, 'getUploads');\n    $this->assertCanDelete($feed);\n  }\n}\n", "num_lines": 77}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\ProductCatalog;\nuse FacebookAds\\Object\\ProductSet;\nuse FacebookAds\\Object\\Fields\\ProductCatalogFields;\nuse FacebookAds\\Object\\Fields\\ProductSetFields;\n\nclass ProductSetTest extends AbstractCrudObjectTestCase {\n\n  /**\n   * @var ProductCatalog\n   */\n  protected $productCatalog;\n\n  public function setup() {\n    parent::setup();\n\n    $this->productCatalog\n      = new ProductCatalog(null, $this->getConfig()->businessId);\n    $this->productCatalog->setData(array(\n      ProductCatalogFields::NAME => $this->getConfig()->testRunId,\n    ));\n    $this->productCatalog->create();\n  }\n\n  public function tearDown() {\n    if ($this->productCatalog) {\n      $this->productCatalog->deleteSelf();\n      $this->productCatalog = null;\n    }\n\n    parent::tearDown();\n  }\n\n  public function testCrudAccess() {\n    $feed_name = $this->getConfig()->testRunId;\n    $product_set = new ProductSet(null, $this->productCatalog->id);\n    $product_set->setData(array(\n      ProductSetFields::NAME => $feed_name,\n      ProductSetFields::FILTER => array(\n        'retailer_id' => array(\n          'is_any' => array('pid1', 'pid2')\n        )\n      )\n    ));\n\n    $this->assertCanCreate($product_set);\n    $this->assertCanRead($product_set);\n    $this->assertCanUpdate($product_set, array(\n      ProductSetFields::NAME => $feed_name.' updated',\n    ));\n    $this->assertCanFetchConnection($product_set, 'getProductGroups');\n    $this->assertCanDelete($product_set);\n  }\n}\n", "num_lines": 80}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\Project;\nuse FacebookAds\\Object\\Fields\\ProjectFields;\nuse FacebookAdsTest\\Config\\SkippableFeatureTestInterface;\n\nclass ProjectTest extends AbstractCrudObjectTestCase\n  implements SkippableFeatureTestInterface {\n\n  /**\n   * @return array\n   */\n  public function skipIfAny() {\n    return array('no_business_manager');\n  }\n\n  public function testCrud() {\n    $project = new Project(null, $this->getConfig()->businessId);\n    $project->{ProjectFields::NAME} = 'Test Project';\n\n    $this->assertCanCreate($project);\n    $this->assertCanRead($project);\n    $this->assertCanUpdate($project, array(\n      ProjectFields::NAME => 'Updated Test Project Name'\n    ));\n\n    $this->assertCanFetchConnection($project, 'getPages');\n    $this->assertCanFetchConnection($project, 'getAdAccounts');\n    $this->assertCanFetchConnection($project, 'getApps');\n\n    $project->addPage($this->getConfig()->pageId);\n    $project->deletePage($this->getConfig()->pageId);\n\n    $project->adAdAccount($this->getConfig()->accountId);\n    $project->deleteAdAccount($this->getConfig()->accountId);\n\n    $project->addApp($this->getConfig()->appId);\n    $project->deleteApp($this->getConfig()->appId);\n\n    $this->assertCanDelete($project);\n  }\n}\n", "num_lines": 67}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAdsTest\\AbstractTestCase;\nuse FacebookAds\\Object\\ReachEstimate;\nuse FacebookAds\\Object\\Fields\\ReachEstimateFields;\n\nclass ReachEstimateTest extends AbstractTestCase {\n\n  public function testOnlyInnerData() {\n    $reach_estimate = new ReachEstimate();\n    $reach_estimate->setData(array(\n      'data' => array(\n        ReachEstimateFields::ESTIMATE_READY => true,\n      ),\n    ));\n    $this->assertTrue($reach_estimate->{ReachEstimateFields::ESTIMATE_READY});\n  }\n\n  public function testOnlyOuterData() {\n    $reach_estimate = new ReachEstimate();\n    $reach_estimate->setData(array(\n      ReachEstimateFields::ESTIMATE_READY => true,\n    ));\n    $this->assertTrue($reach_estimate->{ReachEstimateFields::ESTIMATE_READY});\n  }\n\n  public function testInnerDataTakesPrecedenceOverOuterData() {\n    $reach_estimate = new ReachEstimate();\n    $reach_estimate->setData(array(\n      ReachEstimateFields::ESTIMATE_READY => false,\n      'data' => array(\n        ReachEstimateFields::ESTIMATE_READY => true,\n      ),\n     ));\n    $this->assertTrue($reach_estimate->{ReachEstimateFields::ESTIMATE_READY});\n  }\n}\n", "num_lines": 62}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\Fields\\TargetingFields;\nuse FacebookAds\\Object\\ReachFrequencyPrediction;\nuse FacebookAds\\Object\\Fields\\ReachFrequencyPredictionFields as RF;\nuse FacebookAds\\Object\\TargetingSpecs;\nuse FacebookAds\\Object\\Values\\AdObjectives;\nuse FacebookAdsTest\\Config\\SkippableFeatureTestInterface;\n\nclass ReachFrequencyPredictionTest extends AbstractCrudObjectTestCase\n  implements SkippableFeatureTestInterface {\n\n  /**\n   * @return array\n   */\n  public function skipIfAny() {\n    return array('no_reach_and_frequency');\n  }\n\n  public function testCrudAccess() {\n\n    $prediction\n      = new ReachFrequencyPrediction(null, $this->getConfig()->accountId);\n\n    $targeting = new TargetingSpecs();\n    $targeting->{TargetingSpecsFields::GEO_LOCATIONS}\n      = array('countries' => array('US'));\n    $targeting->{TargetingFields::AGE_MAX} = 35;\n    $targeting->{TargetingFields::AGE_MIN} = 20;\n    $targeting->{TargetingFields::GENDERS} = array(2);\n    $targeting->{TargetingFields::PUBLISHER_PLATFORMS} = array('facebook');\n    $targeting->{TargetingFields::DEVICE_PLATFORMS} = array('desktop');\n    $targeting->{TargetingFields::FACEBOOK_POSITIONS} = array('feed');\n\n    $prediction->setData(array(\n      RF::BUDGET => 3000000,\n      RF::TARGET_SPEC => $targeting,\n      RF::START_TIME => strtotime('midnight + 2 weeks'),\n      RF::END_TIME => strtotime('midnight + 3 weeks'),\n      RF::FREQUENCY_CAP => 4,\n      RF::DESTINATION_ID => $this->getConfig()->pageId,\n      RF::PREDICTION_MODE => ReachFrequencyPrediction::PREDICTION_MODE_REACH,\n      RF::OBJECTIVE => AdObjectives::POST_ENGAGEMENT,\n      RF::STORY_EVENT_TYPE => 128,\n    ));\n\n    $this->assertCanCreate($prediction);\n    $this->assertCanDelete($prediction);\n  }\n\n}\n", "num_lines": 76}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAds\\Object\\AbstractCrudObject;\nuse FacebookAds\\Object\\TargetingSearch;\nuse FacebookAds\\Object\\Search\\TargetingSearchTypes;\n\nclass TargetingSearchTest extends AbstractCrudObjectTestCase {\n\n  public function testCrudAccess() {\n    $cursor = TargetingSearch::search(\n      TargetingSearchTypes::GEOLOCATION, null, 'Lon');\n\n    /* @var $category AbstractCrudObject */\n    $result = $cursor->current();\n    $this->assertTrue($result instanceof TargetingSearch);\n    $this->assertNotEmpty($result->key);\n  }\n}\n", "num_lines": 43}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object\\CustomAudienceNormalizers;\n\nuse FacebookAdsTest\\AbstractUnitTestCase;\nuse FacebookAds\\Object\\CustomAudienceNormalizers\\EmailNormalizer;\n\nclass EmailNormalizerTest extends AbstractUnitTestCase {\n\n    /**\n     * @var EmailNormalizer\n     */\n    protected $emailNormalizer;\n\n    public function setUp() {\n        $this->emailNormalizer = new EmailNormalizer();\n    }\n\n    public function testNormalizeData() {\n        return array(\n            array(\n                \"foo@fb.com\\t\\r\\n\\0\\x0B.\",\n                'foo@fb.com',\n            ),\n        );\n    }\n\n    /**\n     * @dataProvider testNormalizeData\n     */\n    public function testNormalize($input, $expected) {\n        $this->assertEquals(\n            $expected,\n            $this->emailNormalizer->normalize('email', $input));\n    }\n}\n", "num_lines": 59}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object\\ServerSide;\n\nuse FacebookAdsTest\\AbstractUnitTestCase;\nuse FacebookAds\\Object\\ServerSide\\AsyncClient;\nuse FacebookAds\\Api;\n\nuse GuzzleHttp\\HandlerStack;\nuse GuzzleHttp\\Handler\\CurlHandler;\n\nApi::init(null, null, 'access-token', false);\n\nclass AsyncClientTest extends AbstractUnitTestCase {\n  public function testSingleton() {\n    $client1 = AsyncClient::getInstance()->getClient();\n    $client2 = AsyncClient::getInstance()->getClient();\n\n    $this->assertEquals($client1, $client2);\n  }\n\n  public function testCurlOptions() {\n    $async_client = AsyncClient::getInstance()->getClient();\n    $expected_handler = HandlerStack::create(new CurlHandler([\n      'options' => [\n        CURLOPT_CONNECTTIMEOUT => 10,\n        CURLOPT_TIMEOUT => 60,\n        CURLOPT_RETURNTRANSFER => true,\n        CURLOPT_HEADER => true,\n        CURLOPT_CAINFO => Api::instance()->getHttpClient()->getCaBundlePath(),\n      ]\n    ]));\n\n    $this->assertEquals($expected_handler, $async_client->getConfig()['handler']);\n  }\n}\n", "num_lines": 59}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object\\ServerSide;\n\nuse FacebookAdsTest\\AbstractUnitTestCase;\nuse FacebookAds\\Object\\ServerSide\\Event;\nuse FacebookAds\\Object\\ServerSide\\UserData;\nuse FacebookAds\\Object\\ServerSide\\BatchProcessor;\nuse FacebookAds\\Api;\nuse GuzzleHttp\\Promise;\nuse Mockery as m;\n\nclass BatchProcessorTest extends AbstractUnitTestCase {\n  protected function setUp(): void {\n    $this->user_data = (new UserData())->setEmail('joe@eg.com');\n    $this->event = (new Event())\n      ->setEventName('Purchase')\n      ->setEventTime(time())\n      ->setUserData($this->user_data);\n    $this->pixel_id = 'pixel-id-0';\n    $this->test_event_code = 'test-code-1';\n    $batch_size = 5;\n    $concurrent_requests = 2;\n    $this->batch_processor = new BatchProcessor($this->pixel_id, $batch_size, $concurrent_requests);\n  }\n\n  protected function tearDown(): void {\n    m::close();\n  }\n\n  public function testProcessEvents() {\n    $expected_event_request_params = array(\n      'events' => array_fill(0, 5, $this->event),\n      'test_event_code' => $this->test_event_code,\n    );\n\n    $mock_event_request_async = m::mock('overload:FacebookAds\\Object\\ServerSide\\EventRequestAsync');\n    $mock_guzzle_promise = m::mock();\n\n    $mock_event_request_async\n      ->shouldReceive('__construct')\n      ->atLeast()\n      ->once()\n      ->with($this->pixel_id, $expected_event_request_params);\n    $mock_event_request_async\n      ->shouldReceive('execute')\n      ->atLeast()\n      ->once()\n      ->andReturn($mock_guzzle_promise);\n    $mock_guzzle_promise\n      ->shouldReceive('wait')\n      ->times(3);\n    $this->addToAssertionCount(\n      m::getContainer()->mockery_getExpectationCount()\n    );\n\n    $events = array_fill(0, 15, $this->event);\n    $this->batch_processor->processEvents(\n      array('test_event_code' => $this->test_event_code),\n      $events\n    );\n  }\n\n  public function testProcessEventsGenerator() {\n    $expected_event_request_params = array(\n      'events' => array_fill(0, 5, $this->event),\n      'test_event_code' => $this->test_event_code,\n    );\n\n    $mock_event_request_async = m::mock('overload:FacebookAds\\Object\\ServerSide\\EventRequestAsync');\n    $mock_guzzle_promise = m::mock();\n\n    $mock_event_request_async\n      ->shouldReceive('__construct')\n      ->atLeast()\n      ->once()\n      ->with($this->pixel_id, $expected_event_request_params);\n    $mock_event_request_async\n      ->shouldReceive('execute')\n      ->atLeast()\n      ->once()\n      ->andReturn($mock_guzzle_promise);\n    $mock_guzzle_promise\n      ->shouldReceive('wait')\n      ->times(3);\n\n    $events = array_fill(0, 15, $this->event);\n    $generator = $this->batch_processor->processEventsGenerator(\n      array('test_event_code' => $this->test_event_code),\n      $events\n    );\n    $iterations = 0;\n    foreach ($generator as $promises) {\n      $iterations += 1;\n      Promise\\unwrap($promises);\n    }\n\n    $this->assertEquals($iterations, 2);\n  }\n\n  public function testProcessEventRequests() {\n    $mock_event_request_async = m::mock();\n    $mock_guzzle_promise = m::mock();\n    $expected_event_request_params = array_fill(0, 5, $mock_event_request_async);\n\n    $mock_event_request_async\n      ->shouldReceive('execute')\n      ->times(5)\n      ->andReturn($mock_guzzle_promise);\n    $mock_guzzle_promise\n      ->shouldReceive('wait')\n      ->times(5);\n    $this->addToAssertionCount(\n      m::getContainer()->mockery_getExpectationCount()\n    );\n\n    $event_requests = array_fill(0, 5, $mock_event_request_async);\n    $this->batch_processor->processEventRequests($event_requests);\n  }\n\n  public function testProcessEventRequestsGenerator() {\n    $mock_event_request_async = m::mock();\n    $mock_guzzle_promise = m::mock();\n    $expected_event_request_params = array_fill(0, 5, $mock_event_request_async);\n\n    $mock_event_request_async\n      ->shouldReceive('execute')\n      ->times(5)\n      ->andReturn($mock_guzzle_promise);\n    $mock_guzzle_promise\n      ->shouldReceive('wait')\n      ->times(5);\n\n    $event_requests = array_fill(0, 5, $mock_event_request_async);\n    $generator = $this->batch_processor->processEventRequestsGenerator($event_requests);\n    $iterations = 0;\n    foreach ($generator as $promises) {\n      $iterations += 1;\n      Promise\\unwrap($promises);\n    }\n\n    $this->assertEquals(3, $iterations);\n  }\n}\n", "num_lines": 167}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object\\ServerSide;\n\nuse FacebookAds\\Object\\ServerSide\\CAPIGatewayEndpoint;\nuse FacebookAds\\Object\\ServerSide\\Event;\nuse FacebookAds\\Object\\ServerSide\\Filter;\nuse FacebookAdsTest\\AbstractUnitTestCase;\n\nclass filterAllEvents implements Filter {\n    public function shouldSendEvent(Event $event): bool\n    {\n        return false;\n    }\n}\nclass CAPIGatewayEndpointTest extends AbstractUnitTestCase {\n\n    public function testBuildersAndGetters(){\n        $capiIngressRequest = new CAPIGatewayEndpoint(\"https://example.com\", \"ACCESS_KEY\");\n        $this->assertEquals($capiIngressRequest->getEndpoint(), \"https://example.com\");\n        $this->assertFalse($capiIngressRequest->isSendToEndpointOnly());\n        $capiIngressRequest->setSendToEndpointOnly(true);\n        $this->assertTrue($capiIngressRequest->isSendToEndpointOnly());\n    }\n\n    public function testInvalidUrl() {\n        $has_throw_exception = false;\n        try {\n            new CAPIGatewayEndpoint(\"badDomain\", \"ACCESS_KEY\");\n        }\n        catch (\\Exception $exception) {\n            $has_throw_exception = true;\n            $expected_string = \"URL is in invalid format\";\n            $this->assertStringContainsString($expected_string, $exception->getMessage());\n        }\n        $this->assertTrue($has_throw_exception);\n    }\n\n    public function testFilterAllEvents() {\n        $capiIngressRequest = new CAPIGatewayEndpoint(\"https://example.com\", \"ACCESS_KEY\");\n        $capiIngressRequest->setFilter(new filterAllEvents());\n        $event1 = new Event();\n        $event1->setEventId('1');\n        $event2 = new Event();\n        $event2->setEventId('2');\n        $events = array($event1, $event2);\n        $response = $capiIngressRequest->sendEvent('pixelId', $events);\n        $this->assertEquals($response->getMessage(), 'No events to send');\n        $this->assertEquals($response->getResponseCode(), null);\n    }\n}\n", "num_lines": 74}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAdsTest\\AbstractUnitTestCase;\nuse FacebookAds\\Object\\ServerSide\\Content;\nuse FacebookAds\\Object\\ServerSide\\DeliveryCategory;\n\n\nclass ContentTest extends AbstractUnitTestCase {\n  public function testContentBuilder() {\n    $expected = array(\n      'id' => 'product-test',\n      'quantity' => 10,\n      'item_price' => 4.99,\n      'title' => 'title-test',\n      'description' => 'description-test',\n      'brand' => 'brand-test',\n      'category' => 'category-test',\n      'delivery_category' => DeliveryCategory::CURBSIDE,\n    );\n\n    $content = (new Content())\n      ->setProductId($expected['id'])\n      ->setQuantity($expected['quantity'])\n      ->setItemPrice($expected['item_price'])\n      ->setTitle($expected['title'])\n      ->setDescription($expected['description'])\n      ->setBrand($expected['brand'])\n      ->setCategory($expected['category'])\n      ->setDeliveryCategory($expected['delivery_category']);\n\n    $this->assertEquals($content->normalize(), $expected);\n  }\n\n  public function testContentConstructor() {\n    $initial = array(\n      'product_id' => 'product-test',\n      'quantity' => 10,\n      'item_price' => 4.99,\n      'title' => 'title-test',\n      'description' => 'description-test',\n      'brand' => 'brand-test',\n      'category' => 'category-test',\n      'delivery_category' => DeliveryCategory::CURBSIDE,\n    );\n    $expected = array(\n      'id' => $initial['product_id'],\n      'quantity' => $initial['quantity'],\n      'item_price' => $initial['item_price'],\n      'title' => $initial['title'],\n      'description' => $initial['description'],\n      'brand' => $initial['brand'],\n      'category' => $initial['category'],\n      'delivery_category' => DeliveryCategory::CURBSIDE,\n    );\n    $content = new Content($initial);\n\n    $this->assertEquals($content->normalize(), $expected);\n  }\n\n  public function testInvalidDeliveryCategory() {\n    $test_delivery_category = 'invalid_delivery_category';\n    $content = (new Content())->setDeliveryCategory($test_delivery_category);\n    try {\n     $normalized_payload = $content->normalize();\n    } catch (\\Exception $exception) {\n      $threw_exception = true;\n      $expected_string = sprintf(\"Invalid delivery_category passed: %s\", $test_delivery_category);\n      $this->assertStringContainsString($expected_string, $exception->getMessage());\n    }\n\n    $this->assertTrue($threw_exception);\n  }\n}\n", "num_lines": 98}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAdsTest\\AbstractUnitTestCase;\nuse FacebookAds\\Object\\ServerSide\\CustomData;\nuse FacebookAds\\Object\\ServerSide\\Content;\nuse FacebookAds\\Object\\ServerSide\\DeliveryCategory;\n\nclass CustomDataTest extends AbstractUnitTestCase {\n  public function testBuilderAndConstructor() {\n    $custom_properties = array(\n      'custom1' => 'property1',\n      'custom2' => 'property2'\n    );\n    $content_state = array('title' => 'content-1');\n    $content = new Content($content_state);\n    $state = array(\n      'value' => 0.1,\n      'currency' => 'usd',\n      'content_name' => 'content-name-2',\n      'content_category' => 'content-category-3',\n      'content_ids' => array('id-1', 'id2'),\n      'content_type' => 'content-type-4',\n      'order_id' => 'order-id-5',\n      'predicted_ltv' => 6.10,\n      'num_items' => 7,\n      'status' => 'status-8',\n      'search_string' => 'search-string-9',\n      'item_number' => 'item-number-10',\n      'delivery_category' => DeliveryCategory::CURBSIDE,\n    );\n    $expected = array_merge(\n      $state,\n      array('contents' => array($content_state)),\n      $custom_properties\n    );\n    $builder = (new CustomData())\n      ->setValue($state['value'])\n      ->setCurrency($state['currency'])\n      ->setContentName($state['content_name'])\n      ->setContentCategory($state['content_category'])\n      ->setContentIds($state['content_ids'])\n      ->setContents(array($content))\n      ->setContentType($state['content_type'])\n      ->setOrderId($state['order_id'])\n      ->setPredictedLtv($state['predicted_ltv'])\n      ->setNumItems($state['num_items'])\n      ->setStatus($state['status'])\n      ->setSearchString($state['search_string'])\n      ->setItemNumber($state['item_number'])\n      ->setDeliveryCategory($state['delivery_category'])\n      ->setCustomProperties($custom_properties);\n    $this->assertEquals($expected, $builder->normalize());\n\n    $constructor = new CustomData(array(\n      'value' => $state['value'],\n      'currency' => $state['currency'],\n      'content_name' => $state['content_name'],\n      'content_category' => $state['content_category'],\n      'content_ids' => $state['content_ids'],\n      'contents' => array($content),\n      'content_type' => $state['content_type'],\n      'order_id' => $state['order_id'],\n      'predicted_ltv' => $state['predicted_ltv'],\n      'num_items' => $state['num_items'],\n      'status' => $state['status'],\n      'search_string' => $state['search_string'],\n      'item_number' => $state['item_number'],\n      'delivery_category' => $state['delivery_category'],\n      'custom_properties' => $custom_properties\n    ));\n    $this->assertEquals($expected, $constructor->normalize());\n  }\n\n  public function testInvalidDeliveryCategory() {\n    $test_delivery_category = 'invalid_delivery_category';\n\n    $custom_data = (new CustomData())->setDeliveryCategory($test_delivery_category);\n\n    try {\n     $normalized_payload = $custom_data->normalize();\n    } catch (\\Exception $exception) {\n      $has_throw_exception = true;\n      $expected_string = sprintf(\"Invalid delivery_category passed: %s\",$test_delivery_category);\n      $this->assertStringContainsString($expected_string, $exception->getMessage());\n    }\n\n    $this->assertTrue($has_throw_exception);\n  }\n\n  public function testZeroCustomDataValue() {\n    $custom_data = (new CustomData())->setValue(0.0);\n\n    $normalized_payload = $custom_data->normalize();\n    $this->assertEquals($normalized_payload['value'], 0);\n  }\n}\n", "num_lines": 121}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object\\ServerSide;\n\nuse FacebookAdsTest\\AbstractUnitTestCase;\nuse FacebookAds\\Object\\ServerSide\\CustomData;\nuse FacebookAds\\Object\\ServerSide\\Event;\nuse FacebookAds\\Object\\ServerSide\\UserData;\n\nclass EventAMAPITest extends AbstractUnitTestCase {\n    public function testBuilder() {\n      $user_data = new UserData(array('email' => 'eg@test.com'));\n      $custom_data = new CustomData(array('col_1' => 'foo2'));\n      $expected = array(\n        'event_name' => 'custom',\n        'event_time' => 1234,\n        'user_data' => $user_data->normalize(),\n        'custom_data' => $custom_data->normalize(),\n        'data_processing_options' => array('AMO'),\n        'advanced_measurement_table' => 'test_am_table',\n      );\n\n      $event = (new Event())\n        ->setEventName($expected['event_name'])\n        ->setEventTime($expected['event_time'])\n        ->setUserData($user_data)\n        ->setCustomData($custom_data)\n        ->setDataProcessingOptions($expected['data_processing_options'])\n        ->setAdvancedMeasurementTable($expected['advanced_measurement_table']);\n\n      $this->assertEquals($expected, $event->normalize());\n    }\n  }\n", "num_lines": 56}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object\\ServerSide;\n\nuse FacebookAdsTest\\AbstractUnitTestCase;\nuse FacebookAds\\Object\\ServerSide\\Event;\nuse FacebookAds\\Object\\ServerSide\\EventRequestAsync;\nuse FacebookAds\\Api;\n\nclass EventRequestAsyncTest extends AbstractUnitTestCase {\n  public function testBuilder() {\n    $event = new Event(array('event_name' => 'my-event'));\n    $expected = array(\n      'data' => array(array('event_name' => $event['event_name'])),\n      'test_event_code' => 'test-event-code-0',\n      'partner_agent' => 'partner-agent-1',\n      'namespace_id' => 'namespace-id-2',\n      'upload_id' => 'upload-id-3',\n      'upload_tag' => 'upload-tag-4',\n      'upload_source' => 'upload-source-5',\n    );\n    $event_request_async = (new EventRequestAsync('pixel-id'))\n      ->setEvents(array($event))\n      ->setTestEventCode($expected['test_event_code'])\n      ->setPartnerAgent($expected['partner_agent'])\n      ->setNamespaceId($expected['namespace_id'])\n      ->setUploadId($expected['upload_id'])\n      ->setUploadTag($expected['upload_tag'])\n      ->setUploadSource($expected['upload_source']);\n\n    $this->assertEquals($expected, $event_request_async->normalize());\n  }\n\n  public function testConstructor() {\n    $event = new Event(array('event_name' => 'my-event'));\n    $expected_event = array('data' => [array('event_name' => $event['event_name'])]);\n    $state = array(\n      'test_event_code' => 'test-event-code-0',\n      'partner_agent' => 'partner-agent-1',\n      'namespace_id' => 'namespace-id-2',\n      'upload_id' => 'upload-id-3',\n      'upload_tag' => 'upload-tag-4',\n      'upload_source' => 'upload-source-5',\n    );\n    $data = array_merge(array('events' => array($event)), $state);\n    $expected = array_merge($state, $expected_event);\n    $event_request_async = new EventRequestAsync('pixel-id', $data);\n\n    $this->assertEquals($expected, $event_request_async->normalize());\n  }\n\n  public function testPromiseCancel() {\n    Api::init(null, null, 'access-token-123');\n    $event_request_async = new EventRequestAsync('pixel-id-456', array(\n      'test_event_code' => 'test-event-code-0',\n      'events' => array(new Event(array('event_name' => 'my-event')))\n    ));\n    $promise = $event_request_async->execute();\n    $promise->cancel();\n\n    $this->assertEquals('rejected', $promise->getState());\n  }\n\n  public function testPromiseReject() {\n    Api::init(null, null, 'access-token-123');\n    $event_request_async = new EventRequestAsync('pixel-id-456', array(\n      'test_event_code' => 'test-event-code-0',\n      'events' => array(new Event(array('event_name' => 'my-event')))\n    ));\n    $promise = $event_request_async->execute();\n    $promise->reject('some error');\n\n    $this->assertEquals('rejected', $promise->getState());\n  }\n}\n", "num_lines": 98}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object\\ServerSide;\n\nuse FacebookAdsTest\\AbstractUnitTestCase;\nuse FacebookAds\\Api;\nuse FacebookAds\\ApiConfig;\nuse FacebookAds\\Object\\AbstractObject;\nuse FacebookAds\\Object\\ServerSide\\Event;\nuse FacebookAds\\Object\\ServerSide\\EventRequest;\nuse FacebookAds\\Object\\ServerSide\\EventResponse;\nuse FacebookAds\\Object\\ServerSide\\HttpServiceClientConfig;\nuse FacebookAds\\Object\\ServerSide\\Util;\nuse Mockery as m;\n\nclass EventRequestTest extends AbstractUnitTestCase {\n  protected function setUp(): void {\n    $this->expected_pixel_id = 'pixel-1000';\n    $this->expected_url = 'https://graph.facebook.com/v'\n      . ApiConfig::APIVersion\n      . '/'\n      . $this->expected_pixel_id\n      . '/events';\n    $this->expected_headers = array(\n      'User-Agent' => 'fbbizsdk-php-v' . ApiConfig::SDKVersion,\n      'Accept-Encoding' => '*',\n    );\n    $this->expected_access_token = 'a-test-token';\n    $this->expected_curl_options = array(\n      CURLOPT_CONNECTTIMEOUT => 10,\n      CURLOPT_TIMEOUT => 60,\n      CURLOPT_RETURNTRANSFER => true,\n      CURLOPT_HEADER => true,\n      CURLOPT_CAINFO => Util::getCaBundlePath(),\n    );\n    HttpServiceClientConfig::getInstance()->setAccessToken(null);\n    HttpServiceClientConfig::getInstance()->setClient(null);\n    HttpServiceClientConfig::getInstance()->setAppsecret(null);\n    Api::init(null, null, null, false);\n  }\n\n  protected function tearDown(): void {\n    m::close();\n  }\n\n  public function testBuilder() {\n    $event = new Event(array('event_name' => 'event-123'));\n    $expected = array(\n      'data' => array(array('event_name' => $event['event_name'])),\n      'test_event_code' => 'test-event-code-0',\n      'partner_agent' => 'partner-agent-1',\n      'namespace_id' => 'namespace-id-2',\n      'upload_id' => 'upload-id-3',\n      'upload_tag' => 'upload-tag-4',\n      'upload_source' => 'upload-source-5',\n    );\n    $event_request = (new EventRequest('pixel-id'))\n      ->setEvents(array($event))\n      ->setTestEventCode($expected['test_event_code'])\n      ->setPartnerAgent($expected['partner_agent'])\n      ->setNamespaceId($expected['namespace_id'])\n      ->setUploadId($expected['upload_id'])\n      ->setUploadTag($expected['upload_tag'])\n      ->setUploadSource($expected['upload_source']);\n\n    $this->assertEquals($expected, $event_request->normalize());\n  }\n\n  public function testConstructor() {\n    $event = new Event(array('event_name' => 'event-123'));\n    $expected_event = array('data' => [array('event_name' => $event['event_name'])]);\n    $state = array(\n      'test_event_code' => 'test-event-code-0',\n      'partner_agent' => 'partner-agent-1',\n      'namespace_id' => 'namespace-id-2',\n      'upload_id' => 'upload-id-3',\n      'upload_tag' => 'upload-tag-4',\n      'upload_source' => 'upload-source-5',\n    );\n    $data = array_merge(array('events' => array($event)), $state);\n    $expected = array_merge($state, $expected_event);\n    $event_request = new EventRequest('pixel-id', $data);\n\n    $this->assertEquals($expected, $event_request->normalize());\n  }\n\n  public function testDefaultHttpService() {\n    $mock_ads_pixel = m::mock('overload:FacebookAds\\Object\\AdsPixel');\n    $mock_ads_pixel\n      ->shouldReceive('__construct')\n      ->once()\n      ->with($this->expected_pixel_id);\n    $event_response_contents = array('data' => array('events_received' => 1));\n    $expected_event_response = new EventResponse($event_response_contents);\n    $create_response_mock = $this->createMock(AbstractObject::class);\n    $create_response_mock\n      ->expects($this->once())\n      ->method('exportAllData')\n      ->willReturn($event_response_contents);\n    $event_request = new EventRequest($this->expected_pixel_id);\n    $event_request->setEvents(array(new Event(array('event_name' => 'event-123'))));\n    $mock_ads_pixel\n      ->shouldReceive('createEvent')\n      ->once()\n      ->with(array(), $event_request->normalize())\n      ->andReturn($create_response_mock);\n    $actual_event_response = $event_request->execute();\n\n    $this->assertEquals($expected_event_response, $actual_event_response);\n  }\n\n  public function testSetHttpClient() {\n    $appsecret = 'appsecret-012';\n    Api::init(null, $appsecret, $this->expected_access_token, false);\n    $mock_client = m::mock('FacebookAdsTest\\Object\\ServerSide\\TestHelpers\\FakeHttpService');\n    $expected_event_response = new EventResponse(\n      array(\n        'data' => array('events_received' => 1)\n      )\n    );\n    $event_request = new EventRequest($this->expected_pixel_id);\n    $event_request->setEvents(array(new Event(array('event_name' => 'event-123'))));\n    $event_request->setHttpClient($mock_client);\n    $mock_client\n      ->shouldReceive('executeRequest')\n      ->once()\n      ->with(\n        $this->expected_url,\n        'POST',\n        $this->expected_curl_options,\n        $this->expected_headers,\n        $this->normalize_and_merge($event_request, $this->expected_access_token, $appsecret)\n      )\n      ->andReturn($expected_event_response);\n    $actual_event_response = $event_request->execute();\n\n    $this->assertEquals($expected_event_response, $actual_event_response);\n  }\n\n  public function testSetHttpClientClientConfig() {\n    $mock_client = m::mock('FacebookAdsTest\\Object\\ServerSide\\TestHelpers\\FakeHttpService');\n    $expected_event_response = new EventResponse(\n      array(\n        'data' => array('events_received' => 1)\n      )\n    );\n    $event_request = new EventRequest($this->expected_pixel_id);\n    $event_request->setEvents(array(new Event(array('event_name' => 'event-123'))));\n    $mock_client\n      ->shouldReceive('executeRequest')\n      ->once()\n      ->with(\n        $this->expected_url,\n        'POST',\n        $this->expected_curl_options,\n        $this->expected_headers,\n        $this->normalize_and_merge($event_request, $this->expected_access_token, null)\n      )\n      ->andReturn($expected_event_response);\n    HttpServiceClientConfig::getInstance()->setClient($mock_client);\n    HttpServiceClientConfig::getInstance()->setAccessToken($this->expected_access_token);\n    $actual_event_response = $event_request->execute();\n\n    $this->assertEquals($expected_event_response, $actual_event_response);\n  }\n\n  public function testEventRequestHttpClientOverridesClientConfig() {\n    $appsecret = 'appsecret-012';\n    Api::init(null, 'a-different-app-secret', 'a-different-access-token', false);\n    $mock_used_client = m::mock('FacebookAdsTest\\Object\\ServerSide\\TestHelpers\\AnotherHttpService');\n    $mock_unused_client = m::mock('FacebookAdsTest\\Object\\ServerSide\\TestHelpers\\AnotherHttpService');\n    $expected_event_response = new EventResponse(\n      array(\n        'data' => array('events_received' => 1)\n      )\n    );\n    $event_request = new EventRequest($this->expected_pixel_id);\n    $event_request->setEvents(array(new Event(array('event_name' => 'event-123'))));\n    $event_request->setHttpClient($mock_used_client);\n    $mock_used_client\n      ->shouldReceive('executeRequest')\n      ->once()\n      ->with(\n        $this->expected_url,\n        'POST',\n        $this->expected_curl_options,\n        $this->expected_headers,\n        $this->normalize_and_merge($event_request, $this->expected_access_token, $appsecret)\n      )\n      ->andReturn($expected_event_response);\n    HttpServiceClientConfig::getInstance()->setClient($mock_unused_client);\n    HttpServiceClientConfig::getInstance()->setAccessToken($this->expected_access_token);\n    HttpServiceClientConfig::getInstance()->setAppsecret($appsecret);\n    $actual_event_response = $event_request->execute();\n\n    $this->assertEquals($expected_event_response, $actual_event_response);\n  }\n\n  // Test helper functions\n\n  protected function normalize_and_merge($event_request, $access_token, $appsecret) {\n    $normalized_merged = $event_request->normalize();\n    $normalized_merged['access_token'] = $access_token;\n    if ($appsecret != null) {\n      $normalized_merged['appsecret_proof'] = Util::getAppsecretProof($access_token, $appsecret);\n    }\n    return $normalized_merged;\n  }\n}\n", "num_lines": 232}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object\\ServerSide;\n\nuse FacebookAdsTest\\AbstractUnitTestCase;\nuse FacebookAds\\Object\\ServerSide\\ActionSource;\nuse FacebookAds\\Object\\ServerSide\\CustomData;\nuse FacebookAds\\Object\\ServerSide\\Event;\nuse FacebookAds\\Object\\ServerSide\\UserData;\n\nclass EventTest extends AbstractUnitTestCase {\n  public function testBuilder() {\n    $user_data = new UserData(array('email' => 'eg@test.com'));\n    $custom_data = new CustomData(array('order_id' => '123'));\n    $expected = array(\n      'event_name' => 'event_name-0',\n      'event_time' => 1234,\n      'event_source_url' => 'event_source_url-2',\n      'opt_out' => false,\n      'event_id' => 'event_id-3',\n      'user_data' => $user_data->normalize(),\n      'custom_data' => $custom_data->normalize(),\n      'data_processing_options' => array('1', '2'),\n      'data_processing_options_country' => 1,\n      'data_processing_options_state' => 2,\n      'action_source' => ActionSource::WEBSITE,\n    );\n\n    $event = (new Event())\n      ->setEventName($expected['event_name'])\n      ->setEventTime($expected['event_time'])\n      ->setEventSourceUrl($expected['event_source_url'])\n      ->setOptOut($expected['opt_out'])\n      ->setEventId($expected['event_id'])\n      ->setUserData($user_data)\n      ->setCustomData($custom_data)\n      ->setDataProcessingOptions($expected['data_processing_options'])\n      ->setDataProcessingOptionsCountry($expected['data_processing_options_country'])\n      ->setDataProcessingOptionsState($expected['data_processing_options_state'])\n      ->setActionSource($expected['action_source']);\n\n    $this->assertEquals($expected, $event->normalize());\n  }\n\n  public function testWhenOptOutIsTrue() {\n    $event = (new Event())->setOptOut(true);\n\n    $this->assertEquals(array('opt_out' => true), $event->normalize());\n  }\n\n  public function testInvalidActionSource() {\n    $action_source = 'invalid action source';\n    $event = (new Event())->setActionSource($action_source);\n\n    try {\n     $normalized_payload = $event->normalize();\n    } catch (\\Exception $exception) {\n      $has_thrown_exception = true;\n      $expected_string = sprintf(\"Invalid action_source passed: %s\",$action_source);\n      $this->assertStringContainsString($expected_string, $exception->getMessage());\n    }\n\n    $this->assertTrue($has_thrown_exception);\n  }\n\n  public function testActionSourceGetsNormalized() {\n    $event = (new Event())->setActionSource('Email');\n    $normalized_payload = $event->normalize();\n\n    $this->assertEquals($normalized_payload['action_source'], 'email');\n  }\n\n  public function testActionSourceIsNull() {\n    $event = (new Event());\n    $normalized_payload = $event->normalize();\n\n    $this->assertFalse(array_key_exists('action_source', $normalized_payload));\n  }\n}\n", "num_lines": 102}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAdsTest\\AbstractUnitTestCase;\nuse FacebookAds\\Object\\ServerSide\\Event;\n\n\nclass ServerSideNormalizeTest extends AbstractUnitTestCase {\n\n  public function testEventData(){\n    $testName = 'Test123Event';\n    $testUrl = 'www.example.com';\n    $testTime = time();\n\n    $event = (new Event())\n      ->setEventName($testName)\n      ->setEventTime($testTime)\n      ->setEventSourceUrl($testUrl);\n\n    $normalized_array = $event->normalize();\n    $this->assertEquals($normalized_array['event_name'], $testName);\n    $this->assertEquals($normalized_array['event_time'], $testTime);\n    $this->assertEquals($normalized_array['event_source_url'], $testUrl);\n  }\n\n  public function testEmptyLDUData(){\n    $event = (new Event())\n      ->setEventName('TestEvent')\n      ->setDataProcessingOptions([]);\n\n    $normalized_array = $event->normalize();\n\n    $this->assertEquals($normalized_array['data_processing_options'], array());\n  }\n\n  public function testDefaultLDUData(){\n    $event = (new Event())\n      ->setEventName('TestEvent')\n      ->setDataProcessingOptions(['LDU'])\n      ->setDataProcessingOptionsCountry(0)\n      ->setDataProcessingOptionsState(0);\n\n    $normalized_array = $event->normalize();\n\n    $this->assertEquals($normalized_array['data_processing_options'], array(\"LDU\"));\n    $this->assertEquals($normalized_array['data_processing_options_state'], \"0\");\n    $this->assertEquals($normalized_array['data_processing_options_country'], \"0\");\n  }\n\n  public function testValidLDUStateCountryData(){\n    $event = (new Event())\n      ->setEventName('TestEvent')\n      ->setDataProcessingOptions(['LDU'])\n      ->setDataProcessingOptionsCountry(1)\n      ->setDataProcessingOptionsState(1000);\n\n    $normalized_array = $event->normalize();\n\n    $this->assertEquals($normalized_array['data_processing_options'], array(\"LDU\"));\n    $this->assertEquals($normalized_array['data_processing_options_state'], \"1000\");\n    $this->assertEquals($normalized_array['data_processing_options_country'], \"1\");\n  }\n}\n", "num_lines": 87}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAdsTest\\AbstractUnitTestCase;\nuse FacebookAds\\Object\\ServerSide\\Normalizer;\n\n\nclass ServerSideNormalizeTest extends AbstractUnitTestCase {\n\n  /**\n   * Test cases for Email Normalization\n   */\n  public function emailNormalizeData() {\n    return array(\n      array(\n        \"foo(.bar)@baz.com/\",\n        'foo.bar@baz.com',\n      ),\n      array(\n        'foo\"@bar.com',\n        'foo@bar.com',\n      ),\n      array(\n        'foo()@bar.com',\n        'foo@bar.com',\n      ),\n    );\n  }\n\n  /**\n   * @dataProvider emailNormalizeData\n   */\n  public function testEmailNormalize($input, $expected) {\n    $this->assertEquals(\n      $expected,\n      Normalizer::normalize('em', $input));\n  }\n\n  /**\n   * Test cases for Phone Normalization\n   */\n  public function phoneNormalizeData() {\n    return array(\n      array(\n        '123-456-7890',\n        '1234567890',\n      ),\n      array(\n        '777 747 (3515)',\n        '7777473515',\n      ),\n      array(\n        '+442071838750',\n        '442071838750',\n      ),\n      array(\n        '44-12390821300A',\n        '4412390821300',\n      )\n    );\n  }\n\n  /**\n   * @dataProvider phoneNormalizeData\n   */\n  public function testPhoneNormalize($input, $expected) {\n    $this->assertEquals(\n      $expected,\n      Normalizer::normalize('ph', $input));\n  }\n\n  /**\n   * Test cases for Postal Code Normalization\n   */\n  public function postalCodeNormalizeData() {\n    return array(\n      array(\n        '  98121',\n        '98121',\n      ),\n      array(\n        '98121-4892',\n        '98121',\n      ),\n      array(\n        'NR9 5AL',\n        'nr95al',\n      ),\n      array(\n        '98-121-4892',\n        '98',\n      ),\n    );\n  }\n\n  /**\n   * @dataProvider postalCodeNormalizeData\n   */\n  public function testPostalCodeNormalize($input, $expected) {\n    $this->assertEquals(\n      $expected,\n      Normalizer::normalize('zp', $input));\n  }\n\n  /**\n   * Test cases for City Normalization\n   */\n  public function cityNormalizeData() {\n    return array(\n      array(\n        'Menlo Park',\n        'menlopark',\n      ),\n      array(\n        'Seattle-98121',\n        'seattle',\n      ),\n      array(\n        'Washington D.C',\n        'washingtondc',\n      ),\n    );\n  }\n\n  /**\n   * @dataProvider cityNormalizeData\n   */\n  public function testCityNormalize($input, $expected) {\n    $this->assertEquals(\n      $expected,\n      Normalizer::normalize('ct', $input));\n  }\n\n  /**\n   * Test cases for Country Normalization\n   */\n  public function countryNormalizeData() {\n    return array(\n      array(\n        '   US   ',\n        'us',\n      ),\n      array(\n        '*****UU*****', // Can't validate, just normalizes\n        'uu',\n      ),\n    );\n  }\n\n  /**\n   * @dataProvider countryNormalizeData\n   */\n  public function testCountryNormalize($input, $expected) {\n    $this->assertEquals(\n      $expected,\n      Normalizer::normalize('country', $input));\n  }\n\n  /**\n   * Test cases for Currency Normalization\n   */\n  public function currencyNormalizeData() {\n    return array(\n      array(\n        '   ABC   ', // Can't validate the data, just normalizes.\n        'abc',\n      ),\n      array(\n        'INR',\n        'inr',\n      ),\n    );\n  }\n\n  /**\n   * @dataProvider currencyNormalizeData\n   */\n  public function testCurrencyNormalize($input, $expected) {\n    $this->assertEquals(\n      $expected,\n      Normalizer::normalize('currency', $input));\n  }\n\n  /**\n   * test for asserting valid exception is thrown for invalid (ISO)currency format\n   */\n  public function testCurrencyException() {\n    $has_throw_exception = false;\n    try {\n      Normalizer::normalize('currency', 'Us Dollar');\n    } catch (\\Exception $e) {\n      $has_throw_exception = true;\n    }\n    $this->assertTrue($has_throw_exception);\n  }\n\n  /**\n   * test for asserting valid exception is thrown for invalid (ISO)country format\n   */\n  public function testCountryException() {\n    $has_throw_exception = false;\n    try {\n      Normalizer::normalize('country', 'United States of America');\n    } catch (\\Exception $e) {\n      $has_throw_exception = true;\n    }\n    $this->assertTrue($has_throw_exception);\n  }\n\n  /**\n   * test for asserting valid exception is thrown for invalid Email format\n   */\n  public function testEmailException() {\n    $has_throw_exception = false;\n    try {\n      Normalizer::normalize('em', '324342@@@@bar.com');\n    } catch (\\Exception $e) {\n      $has_throw_exception = true;\n    }\n    $this->assertTrue($has_throw_exception);\n  }\n\n  public function f5firstData() {\n    return array(\n      array(\n        'George',\n        'georg',\n      ),\n      array(\n        'John',\n        'john',\n      ),\n      array(\n        '',\n        '',\n      ),\n      array(\n        null,\n        null,\n      ),\n    );\n  }\n\n  /**\n   * @dataProvider f5firstData\n   */\n  public function testF5first($input, $expected) {\n    $this->assertEquals(\n      $expected,\n      Normalizer::normalize('f5first', $input)\n    );\n  }\n\n  public function f5lastData() {\n    return array(\n      array(\n        'Washington',\n        'washi',\n      ),\n      array(\n        'Adams',\n        'adams',\n      ),\n      array(\n        '',\n        '',\n      ),\n      array(\n        null,\n        null,\n      ),\n    );\n  }\n\n  /**\n   * @dataProvider f5lastData\n   */\n  public function testF5last($input, $expected) {\n    $this->assertEquals(\n      $expected,\n      Normalizer::normalize('f5last', $input)\n    );\n  }\n\n  public function fiData() {\n    return array(\n      array(\n        'GW',\n        'g',\n      ),\n      array(\n        'j',\n        'j',\n      ),\n      array(\n        '',\n        '',\n      ),\n      array(\n        null,\n        null,\n      ),\n    );\n  }\n\n  /**\n   * @dataProvider fiData\n   */\n  public function testFi($input, $expected) {\n    $this->assertEquals(\n      $expected,\n      Normalizer::normalize('fi', $input)\n    );\n  }\n\n  public function dobdData() {\n    return array(\n      array(\n        '1',\n        '01',\n      ),\n      array(\n        '9',\n        '09',\n      ),\n      array(\n        '31',\n        '31',\n      ),\n      array(\n        '',\n        '',\n      ),\n      array(\n        null,\n        null,\n      ),\n    );\n  }\n\n  /**\n   * @dataProvider dobdData\n   */\n  public function testDobd($input, $expected) {\n    $this->assertEquals(\n      $expected,\n      Normalizer::normalize('dobd', $input)\n    );\n  }\n\n  public function testDobdException() {\n    $failure_cases = array(\n      '-1',\n      '0',\n      '32',\n      '2b',\n      'ab',\n    );\n    $exceptions_counter = 0;\n    $has_throw_exception = false;\n    foreach ($failure_cases as $case) {\n      try {\n        Normalizer::normalize('dobd', $case);\n      } catch (\\Exception $e) {\n        $exceptions_counter += 1;\n      }\n    }\n    $this->assertEquals(count($failure_cases), $exceptions_counter);\n  }\n\n  public function dobmData() {\n    return array(\n      array(\n        '1',\n        '01',\n      ),\n      array(\n        '5',\n        '05',\n      ),\n      array(\n        '12',\n        '12',\n      ),\n      array(\n        '',\n        '',\n      ),\n      array(\n        null,\n        null,\n      ),\n    );\n  }\n\n  /**\n   * @dataProvider dobmData\n   */\n  public function testDobm($input, $expected) {\n    $this->assertEquals(\n      $expected,\n      Normalizer::normalize('dobm', $input)\n    );\n  }\n\n  public function testDobmException() {\n    $failure_cases = array(\n      '-1',\n      '0',\n      '13',\n      '1a',\n      'May',\n      'oc',\n    );\n    $exceptions_counter = 0;\n    $has_throw_exception = false;\n    foreach ($failure_cases as $case) {\n      try {\n        Normalizer::normalize('dobm', $case);\n      } catch (\\Exception $e) {\n        $exceptions_counter += 1;\n      }\n    }\n    $this->assertEquals(count($failure_cases), $exceptions_counter);\n  }\n\n  public function dobyData() {\n    return array(\n      array(\n        '1995',\n        '1995',\n      ),\n      array(\n        '9999',\n        '9999',\n      ),\n      array(\n        '1000',\n        '1000',\n      ),\n      array(\n        '',\n        '',\n      ),\n      array(\n        null,\n        null,\n      ),\n    );\n  }\n\n  /**\n   * @dataProvider dobyData\n   */\n  public function testDoby($input, $expected) {\n    $this->assertEquals(\n      $expected,\n      Normalizer::normalize('doby', $input)\n    );\n  }\n\n  public function testDobyException() {\n    $failure_cases = array(\n      '-1',\n      '0',\n      '20',\n      '12345',\n      'nineteen-eighty',\n    );\n    $exceptions_counter = 0;\n    $has_throw_exception = false;\n    foreach ($failure_cases as $case) {\n      try {\n        Normalizer::normalize('doby', $case);\n      } catch (\\Exception $e) {\n        $exceptions_counter += 1;\n      }\n    }\n    $this->assertEquals(count($failure_cases), $exceptions_counter);\n  }\n\n  /**\n   * Test cases for DeliveryCategory Normalization\n   */\n  public function deliveryCategoryNormalizeData() {\n    return array(\n      array(\n        'home_delivery',\n        'home_delivery',\n      ),\n      array(\n        'CURBSIDE',\n        'curbside',\n      ),\n      array(\n        ' IN_STORE ',\n        'in_store',\n      ),\n    );\n  }\n\n  /**\n   * @dataProvider deliveryCategoryNormalizeData\n   */\n  public function testDeliveryCategoryNormalize($input, $expected) {\n    $this->assertEquals(\n      $expected,\n      Normalizer::normalize('delivery_category', $input));\n  }\n}\n", "num_lines": 534}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object\\ServerSide;\n\nuse PHPUnit\\Framework\\TestCase;\nuse FacebookAds\\Object\\ServerSide\\Util;\n\nclass ServerSideUtilTest extends TestCase {\n\n  public function setUp(): void {\n    $_SERVER = [];\n    $_COOKIE = [];\n  }\n\n  public function testNewEventTakesIpAddressFromHttpClientIP() {\n    $_SERVER[\"HTTP_CLIENT_IP\"] = \"HTTP_CLIENT_IP_VALUE\";\n    $_SERVER[\"HTTP_X_FORWARDED_FOR\"] = \"HTTP_X_FORWARDED_FOR_VALUE\";\n    $_SERVER[\"REMOTE_ADDR\"] = \"REMOTE_ADDR\";\n    $this->assertEquals(\"HTTP_CLIENT_IP_VALUE\",\n      Util::getIpAddress());\n  }\n\n  public function testNewEventTakesIpAddressFromHttpXForwardedFor() {\n    $_SERVER[\"HTTP_X_FORWARDED_FOR\"] = \"HTTP_X_FORWARDED_FOR_VALUE\";\n    $_SERVER[\"REMOTE_ADDR\"] = \"REMOTE_ADDR\";\n    $this->assertEquals(\"HTTP_X_FORWARDED_FOR_VALUE\",\n      Util::getIpAddress());\n  }\n\n  public function testNewEventTakesIpAddressFromRemoteAddr() {\n    $_SERVER[\"REMOTE_ADDR\"] = \"REMOTE_ADDR_VALUE\";\n    $this->assertEquals(\"REMOTE_ADDR_VALUE\",\n      Util::getIpAddress());\n  }\n\n  public function testNewEventHasUserAgent() {\n    $_SERVER[\"HTTP_USER_AGENT\"] = \"HTTP_USER_AGENT_VALUE\";\n\n    $this->assertEquals(\"HTTP_USER_AGENT_VALUE\",\n      Util::getHttpUserAgent());\n  }\n\n  public function testNewEventHasEventSourceUrlWithHttps() {\n    $_SERVER[\"HTTPS\"] = \"anyvalue\";\n    $_SERVER[\"HTTP_HOST\"] = \"www.pikachu.com\";\n    $_SERVER[\"REQUEST_URI\"] = \"/index.php\";\n\n    $this->assertEquals(\"https://www.pikachu.com/index.php\", Util::getRequestUri());\n  }\n\n  public function testNewEventHasEventSourceUrlWithHttp() {\n    $_SERVER[\"HTTPS\"] = \"\";\n    $_SERVER[\"HTTP_HOST\"] = \"www.pikachu.com\";\n    $_SERVER[\"REQUEST_URI\"] = \"/index.php\";\n\n\n    $this->assertEquals(\"http://www.pikachu.com/index.php\", Util::getRequestUri());\n  }\n\n  public function testNewEventHasEventSourceUrlWithHttpsOff() {\n    $_SERVER[\"HTTPS\"] = \"off\";\n    $_SERVER[\"HTTP_HOST\"] = \"www.pikachu.com\";\n    $_SERVER[\"REQUEST_URI\"] = \"/index.php\";\n\n    $this->assertEquals(\"http://www.pikachu.com/index.php\", Util::getRequestUri());\n  }\n\n\n  public function testNewEventHasFbc() {\n    $_COOKIE[\"_fbc\"] = \"_fbc_value\";\n\n    $this->assertEquals(\"_fbc_value\", Util::getFbc());\n  }\n\n  public function testNewEventHasFbp() {\n    $_COOKIE[\"_fbp\"] = \"_fbp_value\";\n\n    $this->assertEquals(\"_fbp_value\", Util::getFbp());\n  }\n\n  public function testGetCaBundlePath() {\n    $this->assertTrue(file_exists(Util::getCaBundlePath()));\n  }\n\n  public function testGetAppsecretProof() {\n    $access_token = 'accesstoken0';\n    $appsecret = 'appsecret1';\n    $expected_appsecret_proof = hash_hmac(\n      'sha256',\n      $access_token,\n      $appsecret\n    );\n\n    $this->assertEquals(\n      Util::getAppsecretProof($access_token, $appsecret),\n      $expected_appsecret_proof\n    );\n  }\n}\n", "num_lines": 122}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object;\n\nuse FacebookAdsTest\\AbstractUnitTestCase;\nuse FacebookAds\\Object\\ServerSide\\UserData;\nuse FacebookAds\\Object\\ServerSide\\Util;\nuse InvalidArgumentException;\n\n\nclass UserDataTest extends AbstractUnitTestCase {\n  public function testBuilderAndConstructor() {\n    $initial_state = array(\n      'email' => 'email-0@test.com',\n      'phone' => '1234567890',\n      'gender' => 'f',\n      'date_of_birth' => '01/01/2001',\n      'last_name' => 'last_name-4',\n      'first_name' => 'first_name-5',\n      'city' => 'city',\n      'state' => 'state',\n      'country_code' => 'us',\n      'zip_code' => '12345',\n      'external_id' => 'external_id-10',\n      'client_ip_address' => 'client_ip_address-11',\n      'client_user_agent' => 'client_user_agent-12',\n      'fbc' => 'fbc-13',\n      'fbp' => 'fbp-14',\n      'subscription_id' => 'subscription_id-15',\n      'fb_login_id' => 'fb_login_id-16',\n      'lead_id' => 'lead_id-17',\n      'f5first' => 'f5fir',\n      'f5last' => 'f5las',\n      'fi' => 'f',\n      'dobd' => '01',\n      'dobm' => '01',\n      'doby' => '2001'\n    );\n    $expected = array(\n      'em' => array(Util::hash($initial_state['email'])),\n      'ph' => array(Util::hash($initial_state['phone'])),\n      'ge' => array(Util::hash($initial_state['gender'])),\n      'db' => array(Util::hash($initial_state['date_of_birth'])),\n      'ln' => array(Util::hash($initial_state['last_name'])),\n      'fn' => array(Util::hash($initial_state['first_name'])),\n      'ct' => array(Util::hash($initial_state['city'])),\n      'st' => array(Util::hash($initial_state['state'])),\n      'country' => array(Util::hash($initial_state['country_code'])),\n      'zp' => array(Util::hash($initial_state['zip_code'])),\n      'external_id' => array('external_id-10'),\n      'client_ip_address' => 'client_ip_address-11',\n      'client_user_agent' => 'client_user_agent-12',\n      'fbc' => 'fbc-13',\n      'fbp' => 'fbp-14',\n      'subscription_id' => 'subscription_id-15',\n      'fb_login_id' => 'fb_login_id-16',\n      'lead_id' => 'lead_id-17',\n      'f5first' => Util::hash($initial_state['f5first']),\n      'f5last' => Util::hash($initial_state['f5last']),\n      'fi' => Util::hash($initial_state['fi']),\n      'dobd' => Util::hash($initial_state['dobd']),\n      'dobm' => Util::hash($initial_state['dobm']),\n      'doby' => Util::hash($initial_state['doby'])\n    );\n    $builder = (new UserData())\n      ->setEmail($initial_state['email'])\n      ->setPhone($initial_state['phone'])\n      ->setGender($initial_state['gender'])\n      ->setDateOfBirth($initial_state['date_of_birth'])\n      ->setLastName($initial_state['last_name'])\n      ->setFirstName($initial_state['first_name'])\n      ->setCity($initial_state['city'])\n      ->setState($initial_state['state'])\n      ->setCountryCode($initial_state['country_code'])\n      ->setZipCode($initial_state['zip_code'])\n      ->setExternalId($initial_state['external_id'])\n      ->setClientIpAddress($initial_state['client_ip_address'])\n      ->setClientUserAgent($initial_state['client_user_agent'])\n      ->setFbc($initial_state['fbc'])\n      ->setFbp($initial_state['fbp'])\n      ->setSubscriptionId($initial_state['subscription_id'])\n      ->setFbLoginId($initial_state['fb_login_id'])\n      ->setLeadId($initial_state['lead_id'])\n      ->setF5first($initial_state['f5first'])\n      ->setF5last($initial_state['f5last'])\n      ->setFi($initial_state['fi'])\n      ->setDobd($initial_state['dobd'])\n      ->setDobm($initial_state['dobm'])\n      ->setDoby($initial_state['doby']);\n\n    $this->assertEquals($expected, $builder->normalize());\n\n    $constructor = new UserData($initial_state);\n    $this->assertEquals($expected, $constructor->normalize());\n\n    // Make sure single value getters still work, since we store these fields as arrays internally.\n    $this->assertEquals($initial_state['email'], $constructor->getEmail());\n    $this->assertEquals($initial_state['phone'], $constructor->getPhone());\n    $this->assertEquals($initial_state['gender'], $constructor->getGender());\n    $this->assertEquals($initial_state['date_of_birth'], $constructor->getDateOfBirth());\n    $this->assertEquals($initial_state['last_name'], $constructor->getLastName());\n    $this->assertEquals($initial_state['first_name'], $constructor->getFirstName());\n    $this->assertEquals($initial_state['city'], $constructor->getCity());\n    $this->assertEquals($initial_state['state'], $constructor->getState());\n    $this->assertEquals($initial_state['country_code'], $constructor->getCountryCode());\n    $this->assertEquals($initial_state['zip_code'], $constructor->getZipCode());\n    $this->assertEquals($initial_state['external_id'], $constructor->getExternalId());\n  }\n\n  public function testMultiValueFieldsGettersAndSetters() {\n    $initial_state = array(\n      'emails' => array('email-0@test.com', 'email-1@eg.com'),\n      'phones' => array('1234567890', '10000000000'),\n      'genders' => array('f', 'm'),\n      'dates_of_birth' => array('01/01/2001', '02/09/2008'),\n      'last_names' => array('last_name-4', 'smith'),\n      'first_names' => array('first_name-5', 'joe'),\n      'cities' => array('seattle', 'san fransisco'),\n      'states' => array('WA', 'CA'),\n      'country_codes' => array('us', 'ca'),\n      'zip_codes' => array('12345', '00000'),\n      'external_ids' => array('external_id-10', '123')\n    );\n\n    $userData = (new UserData())\n      ->setEmails($initial_state['emails'])\n      ->setPhones($initial_state['phones'])\n      ->setGenders($initial_state['genders'])\n      ->setDatesOfBirth($initial_state['dates_of_birth'])\n      ->setLastNames($initial_state['last_names'])\n      ->setFirstNames($initial_state['first_names'])\n      ->setCities($initial_state['cities'])\n      ->setStates($initial_state['states'])\n      ->setCountryCodes($initial_state['country_codes'])\n      ->setZipCodes($initial_state['zip_codes'])\n      ->setExternalIds($initial_state['external_ids']);\n\n    $this->assertEquals($initial_state['emails'], $userData->getEmails());\n    $this->assertEquals($initial_state['phones'], $userData->getPhones());\n    $this->assertEquals($initial_state['genders'], $userData->getGenders());\n    $this->assertEquals($initial_state['dates_of_birth'], $userData->getDatesOfBirth());\n    $this->assertEquals($initial_state['last_names'], $userData->getLastNames());\n    $this->assertEquals($initial_state['first_names'], $userData->getFirstNames());\n    $this->assertEquals($initial_state['cities'], $userData->getCities());\n    $this->assertEquals($initial_state['states'], $userData->getStates());\n    $this->assertEquals($initial_state['country_codes'], $userData->getCountryCodes());\n    $this->assertEquals($initial_state['zip_codes'], $userData->getZipCodes());\n    $this->assertEquals($initial_state['external_ids'], $userData->getExternalIds());\n  }\n\n  public function testConstructorWithBothSingularAndPluralParams() {\n    $params = array(\n      array('email', 'emails'),\n      array('phone', 'phones'),\n      array('gender', 'genders'),\n      array('date_of_birth', 'dates_of_birth'),\n      array('last_name', 'last_names'),\n      array('first_name', 'first_names'),\n      array('city', 'cities'),\n      array('state', 'states'),\n      array('country_code', 'country_codes'),\n      array('zip_code', 'zip_codes'),\n      array('external_id', 'external_ids')\n    );\n\n    $exception_count = 0;\n    foreach ($params as $p){\n      $initial_state = array(\n        $p[0] => 'testStr1',\n        $p[1] => array('testStr2', 'testStr3')\n      );\n      try {\n        $userData = new UserData($initial_state);\n      } catch(InvalidArgumentException $e) {\n        $exception_count++;\n      }\n    }\n    self::assertEquals(count($params), $exception_count);\n  }\n\n  public function testConstructorWithOnlyPluralParams() {\n    $initial_state = array(\n      'emails' => array('email-0@test.com', 'email-1@eg.com'),\n      'phones' => array('1234567890', '10000000000'),\n      'genders' => array('f', 'm'),\n      'dates_of_birth' => array('01/01/2001', '02/09/2008'),\n      'last_names' => array('last_name-4', 'smith'),\n      'first_names' => array('first_name-5', 'joe'),\n      'cities' => array('seattle', 'san fransisco'),\n      'states' => array('WA', 'CA'),\n      'country_codes' => array('us', 'ca'),\n      'zip_codes' => array('12345', '00000'),\n      'external_ids' => array('external_id-10', '123')\n    );\n\n    $userData = new UserData($initial_state);\n\n    $this->assertEquals($initial_state['emails'], $userData->getEmails());\n    $this->assertEquals($initial_state['phones'], $userData->getPhones());\n    $this->assertEquals($initial_state['genders'], $userData->getGenders());\n    $this->assertEquals($initial_state['dates_of_birth'], $userData->getDatesOfBirth());\n    $this->assertEquals($initial_state['last_names'], $userData->getLastNames());\n    $this->assertEquals($initial_state['first_names'], $userData->getFirstNames());\n    $this->assertEquals($initial_state['cities'], $userData->getCities());\n    $this->assertEquals($initial_state['states'], $userData->getStates());\n    $this->assertEquals($initial_state['country_codes'], $userData->getCountryCodes());\n    $this->assertEquals($initial_state['zip_codes'], $userData->getZipCodes());\n    $this->assertEquals($initial_state['external_ids'], $userData->getExternalIds());\n  }\n\n  public function testGettersAndSettersWithNull() {\n    $userData = (new UserData())\n      ->setEmail(null)\n      ->setPhone(null)\n      ->setGender(null)\n      ->setDateOfBirth(null)\n      ->setLastName(null)\n      ->setFirstName(null)\n      ->setCity(null)\n      ->setState(null)\n      ->setCountryCode(null)\n      ->setZipCode(null)\n      ->setExternalId(null);\n\n    $this->assertEquals(null, $userData->getEmail());\n    $this->assertEquals(null, $userData->getPhone());\n    $this->assertEquals(null, $userData->getGender());\n    $this->assertEquals(null, $userData->getDateOfBirth());\n    $this->assertEquals(null, $userData->getLastName());\n    $this->assertEquals(null, $userData->getFirstName());\n    $this->assertEquals(null, $userData->getCity());\n    $this->assertEquals(null, $userData->getState());\n    $this->assertEquals(null, $userData->getCountryCode());\n    $this->assertEquals(null, $userData->getZipCode());\n    $this->assertEquals(null, $userData->getExternalId());\n  }\n\n  public function testGettersAndSettersWithEmpty() {\n    $userData = (new UserData())\n      ->setEmails(array())\n      ->setPhones(array())\n      ->setGenders(array())\n      ->setDatesOfBirth(array())\n      ->setLastNames(array())\n      ->setFirstNames(array())\n      ->setCities(array())\n      ->setStates(array())\n      ->setCountryCodes(array())\n      ->setZipCodes(array())\n      ->setExternalIds(array());\n\n    $this->assertEquals(null, $userData->getEmail());\n    $this->assertEquals(null, $userData->getPhone());\n    $this->assertEquals(null, $userData->getGender());\n    $this->assertEquals(null, $userData->getDateOfBirth());\n    $this->assertEquals(null, $userData->getLastName());\n    $this->assertEquals(null, $userData->getFirstName());\n    $this->assertEquals(null, $userData->getCity());\n    $this->assertEquals(null, $userData->getState());\n    $this->assertEquals(null, $userData->getCountryCode());\n    $this->assertEquals(null, $userData->getZipCode());\n    $this->assertEquals(null, $userData->getExternalId());\n  }\n\n  public function testMultiValueFieldsDeduplication() {\n    $initial_state = array(\n      'emails' => array('email-0@test.com', 'email-1@eg.com', 'email-1@eg.com'),\n      'phones' => array('1234567890', '10000000000', '10000000000'),\n      'genders' => array('f', 'm', 'm'),\n      'dates_of_birth' => array('01/01/2001', '02/09/2008', '02/09/2008'),\n      'last_names' => array('last_name-4', 'smith', 'smith'),\n      'first_names' => array('first_name-5', 'joe', 'first_name-5'),\n      'cities' => array('seattle', 'sanfransisco', 'seattle'),\n      'states' => array('wa', 'ca', 'wa'),\n      'country_codes' => array('us', 'ca', 'us'),\n      'zip_codes' => array('12345', '00000', '12345'),\n      'external_ids' => array('external_id-10', '123', 'external_id-10')\n    );\n\n    $userData = (new UserData())\n      ->setEmails($initial_state['emails'])\n      ->setPhones($initial_state['phones'])\n      ->setGenders($initial_state['genders'])\n      ->setDatesOfBirth($initial_state['dates_of_birth'])\n      ->setLastNames($initial_state['last_names'])\n      ->setFirstNames($initial_state['first_names'])\n      ->setCities($initial_state['cities'])\n      ->setStates($initial_state['states'])\n      ->setCountryCodes($initial_state['country_codes'])\n      ->setZipCodes($initial_state['zip_codes'])\n      ->setExternalIds($initial_state['external_ids']);\n\n    $normalized = $userData->normalize();\n\n    $this->assertEquals(2, count($normalized['em']));\n    $this->assertEquals(2, count($normalized['ph']));\n    $this->assertEquals(2, count($normalized['ge']));\n    $this->assertEquals(2, count($normalized['db']));\n    $this->assertEquals(2, count($normalized['ln']));\n    $this->assertEquals(2, count($normalized['fn']));\n    $this->assertEquals(2, count($normalized['ct']));\n    $this->assertEquals(2, count($normalized['st']));\n    $this->assertEquals(2, count($normalized['country']));\n    $this->assertEquals(2, count($normalized['zp']));\n    $this->assertEquals(2, count($normalized['external_id']));\n  }\n\n  public function testNormalizeMultiValueFields() {\n    $initial_state = array(\n      'email' => array('email-0@test.com', 'email-1@eg.com'),\n      'phone' => array('1234567890', '10000000000'),\n      'gender' => array('f', 'm'),\n      'date_of_birth' => array('01/01/2001', '02/09/2008'),\n      'last_name' => array('last_name-4', 'smith'),\n      'first_name' => array('first_name-5', 'joe'),\n      'city' => array('seattle', 'sanfransisco'),\n      'state' => array('wa', 'ca'),\n      'country_code' => array('us', 'ca'),\n      'zip_code' => array('12345', '00000'),\n      'external_id' => array('external_id-10', '123')\n    );\n\n    $userData = (new UserData())\n      ->setEmails($initial_state['email'])\n      ->setPhones($initial_state['phone'])\n      ->setGenders($initial_state['gender'])\n      ->setDatesOfBirth($initial_state['date_of_birth'])\n      ->setLastNames($initial_state['last_name'])\n      ->setFirstNames($initial_state['first_name'])\n      ->setCities($initial_state['city'])\n      ->setStates($initial_state['state'])\n      ->setCountryCodes($initial_state['country_code'])\n      ->setZipCodes($initial_state['zip_code'])\n      ->setExternalIds($initial_state['external_id']);\n\n    $expected = array(\n      'em' => $this->hashList($initial_state['email']),\n      'ph' => $this->hashList($initial_state['phone']),\n      'ge' => $this->hashList($initial_state['gender']),\n      'db' => $this->hashList($initial_state['date_of_birth']),\n      'ln' => $this->hashList($initial_state['last_name']),\n      'fn' => $this->hashList($initial_state['first_name']),\n      'ct' => $this->hashList($initial_state['city']),\n      'st' => $this->hashList($initial_state['state']),\n      'country' => $this->hashList($initial_state['country_code']),\n      'zp' => $this->hashList($initial_state['zip_code']),\n      'external_id' => $initial_state['external_id']\n    );\n\n    $this->assertEquals($expected, $userData->normalize());\n  }\n\n  public function testMultiValueFieldsCanNormalizeEmpty() {\n    $userData = new UserData();\n    $normalized = $userData->normalize();\n\n    $this->assertEquals(array(), $normalized);\n  }\n\n  private function hashList($arr){\n    return array_map(\n      function($val){\n        return Util::hash($val);\n      },\n      $arr);\n  }\n}\n", "num_lines": 390}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object\\ServerSide\\TestHelpers;\nuse FacebookAds\\Object\\ServerSide\\HttpServiceInterface;\n\nclass AnotherHttpService implements HttpServiceInterface {\n  public function executeRequest($url, $method, array $curl_options, array $headers, array $params) {\n    return null;\n  }\n}\n", "num_lines": 33}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object\\ServerSide\\TestHelpers;\nuse FacebookAds\\Object\\ServerSide\\HttpServiceInterface;\n\nclass FakeHttpService implements HttpServiceInterface {\n  public function executeRequest($url, $method, array $curl_options, array $headers, array $params) {\n    return null;\n  }\n}\n", "num_lines": 33}
{"repo_name": "facebook-php-business-sdk", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to\n * use, copy, modify, and distribute this software in source code or binary\n * form for use in connection with the web services and APIs provided by\n * Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use\n * of this software is subject to the Facebook Developer Principles and\n * Policies [http://developers.facebook.com/policy/]. This copyright notice\n * shall be included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n *\n */\n\nnamespace FacebookAdsTest\\Object\\Signal;\n\nuse FacebookAdsTest\\AbstractUnitTestCase;\nuse FacebookAds\\Object\\Signal\\CustomData;\nuse FacebookAds\\Object\\Signal\\Event;\nuse FacebookAds\\Object\\Signal\\UserData;\n\nclass EventTest extends AbstractUnitTestCase {\n  public function testBuilder() {\n    $user_data = new UserData(array('email' => 'aaa@fb.com'));\n    $billing_contact = new UserData(array('email' => 'bbb@fb.com'));\n    $shipping_contact = new UserData(array('email' => 'ccc@fb.com'));\n    $custom_data = (new CustomData())\n    ->setOrderId('order_id')\n    ->setBillingContact($billing_contact)\n    ->setShippingContact($shipping_contact);\n    $expected = array(\n      'event_name' => 'event_name',\n      'event_time' => 1234,\n      'event_id' => 'event_id',\n      'data_processing_options' => array('LDU'),\n      'data_processing_options_country' => 1,\n      'data_processing_options_state' => 1000,\n    );\n\n    $event = (new Event())\n      ->setEventName($expected['event_name'])\n      ->setEventTime($expected['event_time'])\n      ->setEventId($expected['event_id'])\n      ->setUserData($user_data)\n      ->setCustomData($custom_data)\n      ->setDataProcessingOptions($expected['data_processing_options'])\n      ->setDataProcessingOptionsCountry($expected['data_processing_options_country'])\n      ->setDataProcessingOptionsState($expected['data_processing_options_state']);\n\n    $expected['user_data'] = $user_data->getBusinessDataUserData()->toJson();\n    $expected['custom_data'] = $custom_data->getBusinessDataCustomData()->toJson();\n    $this->assertEquals($expected, $event->getBusinessDataEvent()->toJson());\n    $this->assertEquals('order_id', $event->getBusinessDataEvent()->getCustomData()->getOrderId());\n    $this->assertEquals('ccc@fb.com', $event->getBusinessDataEvent()->getCustomData()->getShippingContact()->getEmail());\n    $this->assertEquals('bbb@fb.com', $event->getBusinessDataEvent()->getCustomData()->getBillingContact()->getEmail());\n    $this->assertEquals('aaa@fb.com', $event->getBusinessDataEvent()->getUserData()->getEmail());\n\n    $expected['user_data'] = $user_data->getServerSideUserData()->normalize();\n    $expected['custom_data'] = $custom_data->getServerSideCustomData()->normalize();\n    $this->assertEquals($expected, $event->getServerSideEvent()->normalize());\n    $this->assertEquals('order_id', $event->getServerSideEvent()->getCustomData()->getOrderId());\n    $this->assertEquals('aaa@fb.com', $event->getServerSideEvent()->getUserData()->getEmail());\n\n  }\n}\n", "num_lines": 76}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\test;\n\n/**\n * Original thrift service:-\n * AdapterService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/AdapterService'))>>\ninterface AdapterServiceAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * CountingStruct\n   *   count();\n   */\n  public function count(): Awaitable<\\facebook\\thrift\\test\\CountingStruct>;\n\n  /**\n   * Original thrift definition:-\n   * HeapAllocated\n   *   adaptedTypes(1: HeapAllocated arg);\n   */\n  public function adaptedTypes(?\\facebook\\thrift\\test\\HeapAllocated $arg): Awaitable<\\facebook\\thrift\\test\\HeapAllocated>;\n}\n\n/**\n * Original thrift service:-\n * AdapterService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/AdapterService'))>>\ninterface AdapterServiceIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * CountingStruct\n   *   count();\n   */\n  public function count(): \\facebook\\thrift\\test\\CountingStruct;\n\n  /**\n   * Original thrift definition:-\n   * HeapAllocated\n   *   adaptedTypes(1: HeapAllocated arg);\n   */\n  public function adaptedTypes(?\\facebook\\thrift\\test\\HeapAllocated $arg): \\facebook\\thrift\\test\\HeapAllocated;\n}\n\n/**\n * Original thrift service:-\n * AdapterService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/AdapterService'))>>\ninterface AdapterServiceAsyncClientIf extends AdapterServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * AdapterService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/AdapterService'))>>\ninterface AdapterServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * CountingStruct\n   *   count();\n   */\n  public function count(): Awaitable<\\facebook\\thrift\\test\\CountingStruct>;\n\n  /**\n   * Original thrift definition:-\n   * HeapAllocated\n   *   adaptedTypes(1: HeapAllocated arg);\n   */\n  public function adaptedTypes(?\\facebook\\thrift\\test\\HeapAllocated $arg): Awaitable<\\facebook\\thrift\\test\\HeapAllocated>;\n}\n\n/**\n * Original thrift service:-\n * AdapterService\n */\ntrait AdapterServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass AdapterServiceAsyncClient extends \\ThriftClientBase implements AdapterServiceAsyncClientIf {\n  use AdapterServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * CountingStruct\n   *   count();\n   */\n  public async function count(): Awaitable<\\facebook\\thrift\\test\\CountingStruct> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\facebook\\thrift\\test\\AdapterService_count_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"AdapterService\", \"count\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"count\", false);\n    return await $this->genAwaitResponse(\\facebook\\thrift\\test\\AdapterService_count_result::class, \"count\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * HeapAllocated\n   *   adaptedTypes(1: HeapAllocated arg);\n   */\n  public async function adaptedTypes(?\\facebook\\thrift\\test\\HeapAllocated $arg): Awaitable<\\facebook\\thrift\\test\\HeapAllocated> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\facebook\\thrift\\test\\AdapterService_adaptedTypes_args::fromShape(shape(\n      'arg' => $arg,\n    ));\n    await $this->asyncHandler_->genBefore(\"AdapterService\", \"adaptedTypes\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"adaptedTypes\", false);\n    return await $this->genAwaitResponse(\\facebook\\thrift\\test\\AdapterService_adaptedTypes_result::class, \"adaptedTypes\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass AdapterServiceClient extends \\ThriftClientBase implements AdapterServiceClientIf {\n  use AdapterServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * CountingStruct\n   *   count();\n   */\n  public async function count(): Awaitable<\\facebook\\thrift\\test\\CountingStruct> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\facebook\\thrift\\test\\AdapterService_count_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"AdapterService\", \"count\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"count\", false);\n    return await $this->genAwaitResponse(\\facebook\\thrift\\test\\AdapterService_count_result::class, \"count\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * HeapAllocated\n   *   adaptedTypes(1: HeapAllocated arg);\n   */\n  public async function adaptedTypes(?\\facebook\\thrift\\test\\HeapAllocated $arg): Awaitable<\\facebook\\thrift\\test\\HeapAllocated> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\facebook\\thrift\\test\\AdapterService_adaptedTypes_args::fromShape(shape(\n      'arg' => $arg,\n    ));\n    await $this->asyncHandler_->genBefore(\"AdapterService\", \"adaptedTypes\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"adaptedTypes\", false);\n    return await $this->genAwaitResponse(\\facebook\\thrift\\test\\AdapterService_adaptedTypes_result::class, \"adaptedTypes\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_count(): int {\n    $args = \\facebook\\thrift\\test\\AdapterService_count_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"count\", false);\n  }\n  public function recv_count(?int $expectedsequenceid = null): \\facebook\\thrift\\test\\CountingStruct {\n    return $this->recvImplHelper(\\facebook\\thrift\\test\\AdapterService_count_result::class, \"count\", false, $expectedsequenceid);\n  }\n  public function send_adaptedTypes(?\\facebook\\thrift\\test\\HeapAllocated $arg): int {\n    $args = \\facebook\\thrift\\test\\AdapterService_adaptedTypes_args::fromShape(shape(\n      'arg' => $arg,\n    ));\n    return $this->sendImplHelper($args, \"adaptedTypes\", false);\n  }\n  public function recv_adaptedTypes(?int $expectedsequenceid = null): \\facebook\\thrift\\test\\HeapAllocated {\n    return $this->recvImplHelper(\\facebook\\thrift\\test\\AdapterService_adaptedTypes_result::class, \"adaptedTypes\", false, $expectedsequenceid);\n  }\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass AdapterService_count_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AdapterService_count_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.count_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass AdapterService_count_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = \\facebook\\thrift\\test\\CountingStruct;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\CountingStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 361061362707289990;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AdapterService_count_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.AdapterService_count_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.CountingStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\CountingStruct>($parsed['success']));\n      $_tmp1 = \\facebook\\thrift\\test\\CountingStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->success = $_tmp1;\n    }\n  }\n\n}\n\nclass AdapterService_adaptedTypes_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'arg',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\HeapAllocated::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'arg' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'arg' => ?\\facebook\\thrift\\test\\HeapAllocated,\n  );\n\n  const type TShape = shape(\n    ?'arg' => ?\\facebook\\thrift\\test\\HeapAllocated::TShape,\n  );\n  const int STRUCTURAL_ID = 270071957836224163;\n  public ?\\facebook\\thrift\\test\\HeapAllocated $arg;\n\n  public function __construct(?\\facebook\\thrift\\test\\HeapAllocated $arg = null)[] {\n    $this->arg = $arg;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'arg'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AdapterService_adaptedTypes_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.adaptedTypes_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.HeapAllocated\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"arg\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'arg' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::MoveOnlyAdapter\",\n                \"moveOnly\" => true,\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'arg') === null ? null : (\\facebook\\thrift\\test\\HeapAllocated::__fromShape($shape['arg'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'arg' => $this->arg?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'arg') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\HeapAllocated>($parsed['arg']));\n      $_tmp1 = \\facebook\\thrift\\test\\HeapAllocated::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->arg = $_tmp1;\n    }\n  }\n\n}\n\nclass AdapterService_adaptedTypes_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = \\facebook\\thrift\\test\\HeapAllocated;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\HeapAllocated::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 8969067960420042186;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AdapterService_adaptedTypes_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.AdapterService_adaptedTypes_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.HeapAllocated\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'success' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::MoveOnlyAdapter\",\n                \"moveOnly\" => true,\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\HeapAllocated>($parsed['success']));\n      $_tmp1 = \\facebook\\thrift\\test\\HeapAllocated::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->success = $_tmp1;\n    }\n  }\n\n}\n\nclass AdapterServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return \\tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.AdapterService\",\n        \"functions\" => vec[\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"count\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.CountingStruct\",\n                    )\n                  ),\n                )\n              ),\n            )\n          ),\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"adaptedTypes\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.HeapAllocated\",\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.HeapAllocated\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"arg\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n              'module.CountingStruct' => \\facebook\\thrift\\test\\CountingStruct::getStructMetadata(),\n              'module.HeapAllocated' => \\facebook\\thrift\\test\\HeapAllocated::getStructMetadata(),\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 694}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\cpp;\n\n/**\n * Original thrift enum:-\n * RefType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/RefType'))>>\nenum RefType: int {\n  Unique = 0;\n  Shared = 1;\n  SharedMutable = 2;\n}\n\nclass RefType_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"cpp.RefType\",\n        \"elements\" => dict[\n          0 => \"Unique\",\n          1 => \"Shared\",\n          2 => \"SharedMutable\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Enum in C++ by default uses signed 32 bit integer. There is no need to specify\n * underlying type for signed 32 bit integer.\n * \n * Original thrift enum:-\n * EnumUnderlyingType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/EnumUnderlyingType'))>>\nenum EnumUnderlyingType: int {\n  /**\n   * ::std::int8_t\n   */\n  I8 = 0;\n  /**\n   * ::std::uint8_t\n   */\n  U8 = 1;\n  /**\n   * ::std::int16_t\n   */\n  I16 = 2;\n  /**\n   * ::std::uint16_t\n   */\n  U16 = 3;\n  /**\n   * ::std::uint32_t\n   */\n  U32 = 4;\n}\n\nclass EnumUnderlyingType_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"cpp.EnumUnderlyingType\",\n        \"elements\" => dict[\n          0 => \"I8\",\n          1 => \"U8\",\n          2 => \"I16\",\n          3 => \"U16\",\n          4 => \"U32\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Changes the native type of a Thrift object.\n * `name` and `template` correspond to `cpp.type` and `cpp.template` respecively.\n *\n * Original thrift struct:-\n * Type\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Type'))>>\nclass Type implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'template',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'template' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'template' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'template' => string,\n  );\n  const int STRUCTURAL_ID = 6389487468753271119;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string template\n   */\n  public string $template;\n\n  public function __construct(?string $name = null, ?string $template = null)[] {\n    $this->name = $name ?? '';\n    $this->template = $template ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'template'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Type';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Type\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"template\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['template'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'template' => $this->template,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'template') !== null) {\n      $this->template = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['template']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Ref\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Ref'))>>\nclass Ref implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'type',\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\annotation\\cpp\\RefType::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'type' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\RefType,\n  );\n\n  const type TShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\RefType,\n  );\n  const int STRUCTURAL_ID = 8496209332976516665;\n  /**\n   * Original thrift field:-\n   * 1: cpp.RefType type\n   */\n  public ?\\facebook\\thrift\\annotation\\cpp\\RefType $type;\n\n  public function __construct(?\\facebook\\thrift\\annotation\\cpp\\RefType $type = null)[] {\n    $this->type = $type;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Ref';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Ref\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"cpp.RefType\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"type\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'type' => $this->type,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'type') !== null) {\n      $this->type = \\facebook\\thrift\\annotation\\cpp\\RefType::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\annotation\\cpp\\RefType>($parsed['type']));\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Lazy\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Lazy'))>>\nclass Lazy implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ref',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ref' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ref' => ?bool,\n  );\n\n  const type TShape = shape(\n    'ref' => bool,\n  );\n  const int STRUCTURAL_ID = 2641839514020242314;\n  /**\n   * Original thrift field:-\n   * 1: bool ref\n   */\n  public bool $ref;\n\n  public function __construct(?bool $ref = null)[] {\n    $this->ref = $ref ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ref'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Lazy';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Lazy\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"ref\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['ref'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'ref' => $this->ref,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'ref') !== null) {\n      $this->ref = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['ref']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * DisableLazyChecksum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/DisableLazyChecksum'))>>\nclass DisableLazyChecksum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'DisableLazyChecksum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.DisableLazyChecksum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that applies a C++ adapter to typedef, field, or struct.\n * \n * For example:\n * \n *   @cpp.Adapter{name = \"::ns::IdAdapter\"}\n *   typedef i64 MyI64;\n * \n * Here the type `MyI64` has the C++ adapter `IdAdapter`.\n * \n *   struct User {\n *     @cpp.Adapter{name = \"::ns::IdAdapter\"}\n *     1: i64 id;\n *   }\n * \n * Here the field `id` has the C++ adapter `IdAdapter`.\n *\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'adaptedType',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'underlyingName',\n      'type' => \\TType::STRING,\n    ),\n    4 => shape(\n      'var' => 'extraNamespace',\n      'type' => \\TType::STRING,\n    ),\n    5 => shape(\n      'var' => 'moveOnly',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'adaptedType' => 2,\n    'underlyingName' => 3,\n    'extraNamespace' => 4,\n    'moveOnly' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'adaptedType' => ?string,\n    ?'underlyingName' => ?string,\n    ?'extraNamespace' => ?string,\n    ?'moveOnly' => ?bool,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'adaptedType' => string,\n    'underlyingName' => string,\n    'extraNamespace' => string,\n    'moveOnly' => bool,\n  );\n  const int STRUCTURAL_ID = 8180344078447403329;\n  /**\n   * The name of a C++ adapter type used to convert between Thrift and native\n   * C++ representation.\n   * \n   * The adapter can be either a Type or Field adapter, providing either of the following APIs:\n   * \n   *     struct ThriftTypeAdapter {\n   *       static AdaptedType fromThrift(ThriftType thrift);\n   *       static {const ThriftType& | ThriftType} toThrift(const AdaptedType& native);\n   *     };\n   * \n   *     struct ThriftFieldAdapter {\n   *       // Context is an instantiation of apache::thrift::FieldContext\n   *       template <class Context>\n   *       static void construct(AdaptedType& field, Context ctx);\n   * \n   *       template <class Context>\n   *       static AdaptedType fromThriftField(ThriftType value, Context ctx);\n   * \n   *       template <class Context>\n   *       static {const ThriftType& | ThriftType} toThrift(const AdaptedType& adapted, Context ctx);\n   *     };\n   * \n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * It is sometimes necessary to specify AdaptedType here (in case the codegen would\n   * have a circular depdenceny, which will cause the C++ build to fail).\n   * \n   * Original thrift field:-\n   * 2: string adaptedType\n   */\n  public string $adaptedType;\n  /**\n   * The name and/or extra namespace to use when directly adapting a type\n   * (as opposed a typedef).\n   * \n   * In this case, the IDL name of the type will refer to the adapted type in\n   * C++ and the underlying thrift type will be generated in a nested\n   * namespace and/or with a different name.\n   * \n   * If neither `underlyingName` or `extraNamespace` is provided, the\n   * underlying type will be generated in a nested 'detail' namespace with\n   * the same name.\n   * \n   * Original thrift field:-\n   * 3: string underlyingName\n   */\n  public string $underlyingName;\n  /**\n   * Original thrift field:-\n   * 4: string extraNamespace\n   */\n  public string $extraNamespace;\n  /**\n   * Must set to true when adapted type is not copyable.\n   * \n   * Original thrift field:-\n   * 5: bool moveOnly\n   */\n  public bool $moveOnly;\n\n  public function __construct(?string $name = null, ?string $adaptedType = null, ?string $underlyingName = null, ?string $extraNamespace = null, ?bool $moveOnly = null)[] {\n    $this->name = $name ?? '';\n    $this->adaptedType = $adaptedType ?? '';\n    $this->underlyingName = $underlyingName ?? '';\n    $this->extraNamespace = $extraNamespace ?? '';\n    $this->moveOnly = $moveOnly ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'adaptedType'),\n      Shapes::idx($shape, 'underlyingName'),\n      Shapes::idx($shape, 'extraNamespace'),\n      Shapes::idx($shape, 'moveOnly'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"adaptedType\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"underlyingName\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"extraNamespace\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"moveOnly\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['adaptedType'],\n      $shape['underlyingName'],\n      $shape['extraNamespace'],\n      $shape['moveOnly'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'adaptedType' => $this->adaptedType,\n      'underlyingName' => $this->underlyingName,\n      'extraNamespace' => $this->extraNamespace,\n      'moveOnly' => $this->moveOnly,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'adaptedType') !== null) {\n      $this->adaptedType = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['adaptedType']);\n    }\n    if (idx($parsed, 'underlyingName') !== null) {\n      $this->underlyingName = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['underlyingName']);\n    }\n    if (idx($parsed, 'extraNamespace') !== null) {\n      $this->extraNamespace = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['extraNamespace']);\n    }\n    if (idx($parsed, 'moveOnly') !== null) {\n      $this->moveOnly = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['moveOnly']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * PackIsset\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/PackIsset'))>>\nclass PackIsset implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'atomic',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'atomic' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'atomic' => ?bool,\n  );\n\n  const type TShape = shape(\n    'atomic' => bool,\n  );\n  const int STRUCTURAL_ID = 1587553453134051231;\n  /**\n   * Original thrift field:-\n   * 1: bool atomic\n   */\n  public bool $atomic;\n\n  public function __construct(?bool $atomic = null)[] {\n    $this->atomic = $atomic ?? true;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'atomic'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PackIsset';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.PackIsset\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"atomic\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['atomic'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'atomic' => $this->atomic,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'atomic') !== null) {\n      $this->atomic = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['atomic']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MinimizePadding\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/MinimizePadding'))>>\nclass MinimizePadding implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MinimizePadding';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.MinimizePadding\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * TriviallyRelocatable\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/TriviallyRelocatable'))>>\nclass TriviallyRelocatable implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TriviallyRelocatable';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.TriviallyRelocatable\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ScopedEnumAsUnionType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/ScopedEnumAsUnionType'))>>\nclass ScopedEnumAsUnionType implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ScopedEnumAsUnionType';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.ScopedEnumAsUnionType\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a typedef should be 'strong', and require an explicit cast to\n * the underlying type.\n * \n * Currently only works for integer typedefs, for example:\n * \n *     @cpp.StrongType\n *     typedef i32 MyId;\n * \n * Will cause an enum class to be used instead of a typedef in the genearte code, for example:\n * \n *     enum class MyId : ::std::int32_t {};\n * \n *\n * Original thrift struct:-\n * StrongType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/StrongType'))>>\nclass StrongType implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StrongType';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.StrongType\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that intercepts field access with C++ field interceptor.\n * Use with *caution* since this may introduce substantial performance overhead on each field access.\n * \n * For example:\n * \n *     struct Foo {\n *       @cpp.FieldInterceptor{name = \"MyFieldInterceptor\"}\n *       1: i64 id;\n *     }\n * \n * The field interceptor `MyFieldInterceptor` will intercept with `interceptThriftFieldAccess`\n * when the field `id` is accessed.\n *\n * Original thrift struct:-\n * FieldInterceptor\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/FieldInterceptor'))>>\nclass FieldInterceptor implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'noinline',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'noinline' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'noinline' => ?bool,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'noinline' => bool,\n  );\n  const int STRUCTURAL_ID = 8132831456632900275;\n  /**\n   * The name of a field interceptor.\n   * \n   * The field interceptor provides the following API:\n   * \n   *     struct ThriftFieldInterceptor {\n   *       template <typename T, typename Struct, int16_t FieldId>\n   *       static void interceptThriftFieldAccess(T&& field,\n   *                                              apache::thrift::FieldContext<Struct, FieldId>&& ctx);\n   *     };\n   * \n   * The field interceptor intercepts with the field value and the field context.\n   * It enforces an easily searchable function name `interceptThriftFieldAccess`.\n   * \n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Setting to true makes compiler not inline and erase function signature for\n   * the intercepting field accessor.\n   * \n   * Original thrift field:-\n   * 2: bool noinline\n   */\n  public bool $noinline;\n\n  public function __construct(?string $name = null, ?bool $noinline = null)[] {\n    $this->name = $name ?? '';\n    $this->noinline = $noinline ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'noinline'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldInterceptor';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.FieldInterceptor\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"noinline\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['noinline'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'noinline' => $this->noinline,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'noinline') !== null) {\n      $this->noinline = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['noinline']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * UseOpEncode\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/UseOpEncode'))>>\nclass UseOpEncode implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'UseOpEncode';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.UseOpEncode\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates an integer type for C++ to use as the underlying type of enum, for example:\n * \n *     @cpp.EnumType{type = cpp.EnumUnderlyingType.I8}\n *     enum Fruit {\n *       Apple = 0,\n *       Banana = 1,\n *     }\n * \n * will be generated into the following:\n * \n *     enum class Fruit : ::std::int8_t {\n *       Apple = 0,\n *       Banana = 1,\n *     };\n * \n *\n * Original thrift struct:-\n * EnumType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/EnumType'))>>\nclass EnumType implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'type',\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'type' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType,\n  );\n\n  const type TShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType,\n  );\n  const int STRUCTURAL_ID = 1724537317047809370;\n  /**\n   * Original thrift field:-\n   * 1: cpp.EnumUnderlyingType type\n   */\n  public ?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType $type;\n\n  public function __construct(?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType $type = null)[] {\n    $this->type = $type;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumType';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.EnumType\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"cpp.EnumUnderlyingType\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"type\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'type' => $this->type,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'type') !== null) {\n      $this->type = \\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType>($parsed['type']));\n    }\n  }\n\n}\n\n/**\n * Indicates that frozen types should not be generated for a given struct.\n *\n * Original thrift struct:-\n * Frozen2Exclude\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Frozen2Exclude'))>>\nclass Frozen2Exclude implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Frozen2Exclude';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Frozen2Exclude\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that the container params must be complete at the time this type is instantiated.\n * Only required in rare cases where the build fails with a frozen-related assert failure.\n *\n * Original thrift struct:-\n * Frozen2RequiresCompleteContainerParams\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Frozen2RequiresCompleteContainerParams'))>>\nclass Frozen2RequiresCompleteContainerParams implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Frozen2RequiresCompleteContainerParams';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Frozen2RequiresCompleteContainerParams\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1938}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\hack;\n\n/**\n * Original thrift struct:-\n * FieldWrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/FieldWrapper'))>>\nclass FieldWrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldWrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.FieldWrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Wrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Wrapper'))>>\nclass Wrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'underlyingName',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'extraNamespace',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'underlyingName' => 2,\n    'extraNamespace' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'underlyingName' => ?string,\n    ?'extraNamespace' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'underlyingName' => string,\n    'extraNamespace' => string,\n  );\n  const int STRUCTURAL_ID = 1284986773698322040;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string underlyingName\n   */\n  public string $underlyingName;\n  /**\n   * Original thrift field:-\n   * 3: string extraNamespace\n   */\n  public string $extraNamespace;\n\n  public function __construct(?string $name = null, ?string $underlyingName = null, ?string $extraNamespace = null)[] {\n    $this->name = $name ?? '';\n    $this->underlyingName = $underlyingName ?? '';\n    $this->extraNamespace = $extraNamespace ?? \"thrift_adapted_types\";\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'underlyingName'),\n      Shapes::idx($shape, 'extraNamespace'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Wrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Wrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"underlyingName\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"extraNamespace\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['underlyingName'],\n      $shape['extraNamespace'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'underlyingName' => $this->underlyingName,\n      'extraNamespace' => $this->extraNamespace,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'underlyingName') !== null) {\n      $this->underlyingName = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['underlyingName']);\n    }\n    if (idx($parsed, 'extraNamespace') !== null) {\n      $this->extraNamespace = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['extraNamespace']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * SkipCodegen\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/SkipCodegen'))>>\nclass SkipCodegen implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'reason' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'reason' => ?string,\n  );\n\n  const type TShape = shape(\n    'reason' => string,\n  );\n  const int STRUCTURAL_ID = 3707764047816594739;\n  /**\n   * Original thrift field:-\n   * 1: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $reason = null)[] {\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SkipCodegen';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.SkipCodegen\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['reason'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'reason' => $this->reason,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'reason') !== null) {\n      $this->reason = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['reason']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Name\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Name'))>>\nclass Name implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'reason' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'reason' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'reason' => string,\n  );\n  const int STRUCTURAL_ID = 4844827548325959202;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $name = null, ?string $reason = null)[] {\n    $this->name = $name ?? '';\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Name';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Name\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['reason'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'reason' => $this->reason,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'reason') !== null) {\n      $this->reason = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['reason']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * UnionEnumAttributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/UnionEnumAttributes'))>>\nclass UnionEnumAttributes implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?Vector<string>,\n  );\n\n  const type TShape = shape(\n    'attributes' => vec<string>,\n  );\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public Vector<string> $attributes;\n\n  public function __construct(?Vector<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'UnionEnumAttributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.UnionEnumAttributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['attributes'] |> new Vector($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'attributes' => vec($this->attributes),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'attributes') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<string>>($parsed['attributes']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = '';\n        $_elem5 = $_value2;\n        $_container4 []= $_elem5;\n      }\n      $this->attributes = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructTrait'))>>\nclass StructTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructTrait\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Attributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Attributes'))>>\nclass Attributes implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?Vector<string>,\n  );\n\n  const type TShape = shape(\n    'attributes' => vec<string>,\n  );\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public Vector<string> $attributes;\n\n  public function __construct(?Vector<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Attributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Attributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['attributes'] |> new Vector($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'attributes' => vec($this->attributes),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'attributes') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<string>>($parsed['attributes']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = '';\n        $_elem5 = $_value2;\n        $_container4 []= $_elem5;\n      }\n      $this->attributes = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructAsTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructAsTrait'))>>\nclass StructAsTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructAsTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructAsTrait\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ModuleInternal\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/ModuleInternal'))>>\nclass ModuleInternal implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ModuleInternal';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.ModuleInternal\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1297}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\test;\n\nclass module_CONSTANTS implements \\IThriftConstants {\n  /**\n   * Original thrift constant:-\n   * i32 var1\n   */\n  const int var1 = 10;\n\n  /**\n   * Original thrift constant:-\n   * string var2\n   */\n  const string var2 = \"20\";\n\n  /**\n   * Original thrift constant:-\n   * module.MyStruct var3\n   */\n  <<__Memoize>>\n  public static function var3()[write_props]: \\facebook\\thrift\\test\\MyStruct{\n    return \\facebook\\thrift\\test\\MyStruct::fromShape(\n      shape(\n        \"field\" => 30,\n        \"set_string\" => Set {\n          \"10\",\n          \"20\",\n        },\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * i32 var4\n   */\n  const int var4 = 40;\n\n  /**\n   * Original thrift constant:-\n   * string var5\n   */\n  const string var5 = \"50\";\n\n  /**\n   * Original thrift constant:-\n   * module.MyStruct var6\n   */\n  <<__Memoize>>\n  public static function var6()[write_props]: \\facebook\\thrift\\test\\MyStruct{\n    return \\facebook\\thrift\\test\\MyStruct::fromShape(\n      shape(\n        \"field\" => 60,\n        \"set_string\" => Set {\n          \"30\",\n          \"40\",\n        },\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * i32 timeout\n   */\n  const int timeout = 42;\n\n  /**\n   * Original thrift constant:-\n   * string msg\n   */\n  const string msg = \"hello, world\";\n\n  /**\n   * Original thrift constant:-\n   * module.Person2 person\n   */\n  <<__Memoize>>\n  public static function person()[write_props]: \\facebook\\thrift\\test\\Person2{\n    return \\facebook\\thrift\\test\\Person2::fromShape(\n      shape(\n        \"name\" => \"DefaultName\",\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * i32 timeout_no_transitive\n   */\n  const int timeout_no_transitive = 420;\n\n  /**\n   * Original thrift constant:-\n   * string msg_no_transitive\n   */\n  const string msg_no_transitive = \"hello, world 2\";\n\n  /**\n   * Original thrift constant:-\n   * module.Person2 person_no_transitive\n   */\n  <<__Memoize>>\n  public static function person_no_transitive()[write_props]: \\facebook\\thrift\\test\\Person2{\n    return \\facebook\\thrift\\test\\Person2::fromShape(\n      shape(\n        \"name\" => \"DefaultName 2\",\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.AdaptedBool type_adapted\n   */\n  const \\facebook\\thrift\\test\\AdaptedBool type_adapted = true;\n\n  /**\n   * Original thrift constant:-\n   * module.MoveOnly nested_adapted\n   */\n  <<__Memoize>>\n  public static function nested_adapted()[write_props]: \\facebook\\thrift\\test\\MoveOnly{\n    return \\facebook\\thrift\\test\\MoveOnly::fromShape(\n      shape(\n        \"ptr\" => \\facebook\\thrift\\test\\HeapAllocated::fromShape(\n          shape(\n          )\n        ),\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * list<module.AdaptedByte> container_of_adapted\n   */\n  <<__Memoize>>\n  public static function container_of_adapted()[write_props]: \\ConstVector<\\facebook\\thrift\\test\\AdaptedByte>{\n    return ImmVector {\n      1,\n      2,\n      3,\n    };\n  }\n\n\n  public static function getAllStructuredAnnotations()[write_props]: dict<string, dict<string, \\IThriftStruct>> {\n    return dict[\n      'var1' => dict[\n        '\\facebook\\thrift\\test\\Config' => \\facebook\\thrift\\test\\Config::fromShape(\n          shape(\n            \"path\" => \"foo\",\n          )\n        ),\n      ],\n      'var2' => dict[\n        '\\facebook\\thrift\\test\\Config' => \\facebook\\thrift\\test\\Config::fromShape(\n          shape(\n            \"path\" => \"bar\",\n          )\n        ),\n      ],\n      'var3' => dict[\n        '\\facebook\\thrift\\test\\Config' => \\facebook\\thrift\\test\\Config::fromShape(\n          shape(\n            \"path\" => \"baz\",\n          )\n        ),\n      ],\n      'var4' => dict[\n        '\\facebook\\thrift\\test\\Config' => \\facebook\\thrift\\test\\Config::fromShape(\n          shape(\n            \"path\" => \"foo2\",\n          )\n        ),\n      ],\n      'var5' => dict[\n        '\\facebook\\thrift\\test\\Config' => \\facebook\\thrift\\test\\Config::fromShape(\n          shape(\n            \"path\" => \"bar2\",\n          )\n        ),\n      ],\n      'var6' => dict[\n        '\\facebook\\thrift\\test\\Config' => \\facebook\\thrift\\test\\Config::fromShape(\n          shape(\n            \"path\" => \"baz2\",\n          )\n        ),\n      ],\n      'timeout' => dict[\n        '\\facebook\\thrift\\test\\Person' => \\facebook\\thrift\\test\\Person::fromShape(\n          shape(\n            \"name\" => \"Foo\",\n          )\n        ),\n      ],\n      'msg' => dict[\n        '\\facebook\\thrift\\test\\Person' => \\facebook\\thrift\\test\\Person::fromShape(\n          shape(\n            \"name\" => \"Bar\",\n          )\n        ),\n      ],\n      'person' => dict[\n        '\\facebook\\thrift\\test\\Person' => \\facebook\\thrift\\test\\Person::fromShape(\n          shape(\n            \"name\" => \"NameFromAnnotation\",\n          )\n        ),\n      ],\n      'timeout_no_transitive' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::test::VariableAdapter\",\n          )\n        ),\n      ],\n      'msg_no_transitive' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::test::VariableAdapter\",\n          )\n        ),\n      ],\n      'person_no_transitive' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::test::VariableAdapter\",\n          )\n        ),\n      ],\n    ];\n  }\n}\n\n", "num_lines": 246}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\test;\n\n/**\n * Original thrift enum:-\n * Color\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/Color'))>>\nenum Color: int {\n  UNKNOWN = 0;\n  RED = 1;\n  GREEN = 2;\n  BLUE = 3;\n}\n\nclass Color_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.Color\",\n        \"elements\" => dict[\n          0 => \"UNKNOWN\",\n          1 => \"RED\",\n          2 => \"GREEN\",\n          3 => \"BLUE\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift enum:-\n * ThriftAdaptedEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/ThriftAdaptedEnum'))>>\nenum ThriftAdaptedEnum: int {\n  Zero = 0;\n  One = 1;\n}\n\nclass ThriftAdaptedEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.ThriftAdaptedEnum\",\n        \"elements\" => dict[\n          0 => \"Zero\",\n          1 => \"One\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\ntype SetWithAdapter = \\Adapter2::THackType;\ntype StringWithAdapter = \\Adapter1::THackType;\ntype ListWithElemAdapter = Vector<\\facebook\\thrift\\test\\StringWithAdapter>;\ntype ListWithElemAdapter_withAdapter = \\Adapter2::THackType;\ntype MyI64 = int;\ntype DoubleTypedefI64 = \\facebook\\thrift\\test\\MyI64;\ntype MyI32 = \\Adapter1::THackType;\ntype FooWithAdapter = \\Adapter1::THackType;\ntype StructWithAdapter = \\Adapter2::THackType;\ntype UnionWithAdapter = \\Adapter2::THackType;\ntype AdaptedA = \\facebook\\thrift\\test\\A;\ntype DurationMs = int;\ntype AdaptedBool = bool;\ntype AdaptedByte = int;\ntype AdaptedShort = int;\ntype AdaptedInteger = int;\ntype AdaptedLong = int;\ntype AdaptedDouble = float;\ntype AdaptedString = string;\ntype DoubleTypedefBool = \\facebook\\thrift\\test\\AdaptedBool;\ntype CustomProtocolType = string;\ntype IndirectionString = string;\ntype AdaptedEnum = \\facebook\\thrift\\test\\ThriftAdaptedEnum;\ntype AdaptedTypedef = \\facebook\\thrift\\test\\AdaptedStruct;\ntype TypedefOfDirect = \\facebook\\thrift\\test\\DirectlyAdaptedStruct;\ntype AdaptedCircularAdaptee = \\facebook\\thrift\\test\\CircularAdaptee;\ntype CountingInt = int;\ntype FooWithAdapter_9317 = \\Adapter1::THackType;\ntype ListWithElemAdapter_withAdapter_2312 = \\Adapter2::THackType;\ntype MyI32_4873 = \\Adapter1::THackType;\ntype StringWithAdapter_7208 = \\Adapter1::THackType;\n/**\n * Original thrift struct:-\n * MyAnnotation\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/MyAnnotation'))>>\nclass MyAnnotation implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'signature',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'color',\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\test\\Color::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'signature' => 1,\n    'color' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'signature' => ?string,\n    ?'color' => ?\\facebook\\thrift\\test\\Color,\n  );\n\n  const type TShape = shape(\n    'signature' => string,\n    ?'color' => ?\\facebook\\thrift\\test\\Color,\n  );\n  const int STRUCTURAL_ID = 4648320388473985046;\n  /**\n   * Original thrift field:-\n   * 1: string signature\n   */\n  public string $signature;\n  /**\n   * Original thrift field:-\n   * 2: module.Color color\n   */\n  public ?\\facebook\\thrift\\test\\Color $color;\n\n  public function __construct(?string $signature = null, ?\\facebook\\thrift\\test\\Color $color = null)[] {\n    $this->signature = $signature ?? '';\n    $this->color = $color ?? \\facebook\\thrift\\test\\Color::RED;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'signature'),\n      Shapes::idx($shape, 'color'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyAnnotation';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyAnnotation\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"signature\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Color\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"color\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\python\\Adapter' => \\facebook\\thrift\\annotation\\python\\Adapter::fromShape(\n          shape(\n            \"name\" => \"my.module.Adapter2\",\n            \"typeHint\" => \"my.another.module.AdaptedType2[]\",\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['signature'],\n      Shapes::idx($shape, 'color'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'signature' => $this->signature,\n      'color' => $this->color,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'signature') !== null) {\n      $this->signature = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['signature']);\n    }\n    if (idx($parsed, 'color') !== null) {\n      $this->color = \\facebook\\thrift\\test\\Color::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\Color>($parsed['color']));\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Foo\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/compiler/test/fixtures/adapter/src/module/Foo'))>>\nclass Foo implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'intField',\n      'adapter' => \\Adapter1::class,\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'optionalIntField',\n      'adapter' => \\Adapter1::class,\n      'type' => \\TType::I32,\n    ),\n    3 => shape(\n      'var' => 'intFieldWithDefault',\n      'adapter' => \\Adapter1::class,\n      'type' => \\TType::I32,\n    ),\n    4 => shape(\n      'var' => 'setField',\n      'adapter' => \\Adapter2::class,\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    5 => shape(\n      'var' => 'optionalSetField',\n      'adapter' => \\Adapter2::class,\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    6 => shape(\n      'var' => 'mapField',\n      'adapter' => \\Adapter3::class,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'adapter' => \\Adapter2::class,\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRING,\n        'elem' => shape(\n          'adapter' => \\Adapter1::class,\n          'type' => \\TType::STRING,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    7 => shape(\n      'var' => 'optionalMapField',\n      'adapter' => \\Adapter3::class,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'adapter' => \\Adapter2::class,\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRING,\n        'elem' => shape(\n          'adapter' => \\Adapter1::class,\n          'type' => \\TType::STRING,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    8 => shape(\n      'var' => 'binaryField',\n      'adapter' => \\Adapter1::class,\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    9 => shape(\n      'var' => 'longField',\n      'type' => \\TType::I64,\n    ),\n    10 => shape(\n      'var' => 'adaptedLongField',\n      'type' => \\TType::I64,\n    ),\n    11 => shape(\n      'var' => 'doubleAdaptedField',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'intField' => 1,\n    'optionalIntField' => 2,\n    'intFieldWithDefault' => 3,\n    'setField' => 4,\n    'optionalSetField' => 5,\n    'mapField' => 6,\n    'optionalMapField' => 7,\n    'binaryField' => 8,\n    'longField' => 9,\n    'adaptedLongField' => 10,\n    'doubleAdaptedField' => 11,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'intField' => ?\\Adapter1::THackType,\n    ?'optionalIntField' => ?\\Adapter1::THackType,\n    ?'intFieldWithDefault' => ?\\Adapter1::THackType,\n    ?'setField' => ?\\facebook\\thrift\\test\\SetWithAdapter,\n    ?'optionalSetField' => ?\\facebook\\thrift\\test\\SetWithAdapter,\n    ?'mapField' => ?\\Adapter3::THackType,\n    ?'optionalMapField' => ?\\Adapter3::THackType,\n    ?'binaryField' => ?\\Adapter1::THackType,\n    ?'longField' => ?\\facebook\\thrift\\test\\MyI64,\n    ?'adaptedLongField' => ?\\facebook\\thrift\\test\\MyI64,\n    ?'doubleAdaptedField' => ?\\facebook\\thrift\\test\\DoubleTypedefI64,\n  );\n\n  const type TShape = shape(\n    'intField' => \\Adapter1::THackType,\n    ?'optionalIntField' => ?\\Adapter1::THackType,\n    'intFieldWithDefault' => \\Adapter1::THackType,\n    'setField' => \\facebook\\thrift\\test\\SetWithAdapter,\n    ?'optionalSetField' => ?\\facebook\\thrift\\test\\SetWithAdapter,\n    'mapField' => \\Adapter3::THackType,\n    ?'optionalMapField' => ?\\Adapter3::THackType,\n    'binaryField' => \\Adapter1::THackType,\n    'longField' => \\facebook\\thrift\\test\\MyI64,\n    'adaptedLongField' => \\facebook\\thrift\\test\\MyI64,\n    'doubleAdaptedField' => \\facebook\\thrift\\test\\DoubleTypedefI64,\n  );\n  const int STRUCTURAL_ID = 5127579417322622320;\n  /**\n   * Original thrift field:-\n   * 1: i32 intField\n   */\n  public \\Adapter1::THackType $intField;\n  /**\n   * Original thrift field:-\n   * 2: i32 optionalIntField\n   */\n  public ?\\Adapter1::THackType $optionalIntField;\n  /**\n   * Original thrift field:-\n   * 3: i32 intFieldWithDefault\n   */\n  public \\Adapter1::THackType $intFieldWithDefault;\n  /**\n   * Original thrift field:-\n   * 4: module.SetWithAdapter setField\n   */\n  public \\facebook\\thrift\\test\\SetWithAdapter $setField;\n  /**\n   * Original thrift field:-\n   * 5: module.SetWithAdapter optionalSetField\n   */\n  public ?\\facebook\\thrift\\test\\SetWithAdapter $optionalSetField;\n  /**\n   * Original thrift field:-\n   * 6: map<string, module.ListWithElemAdapter_withAdapter_2312> mapField\n   */\n  public \\Adapter3::THackType $mapField;\n  /**\n   * Original thrift field:-\n   * 7: map<string, module.ListWithElemAdapter_withAdapter_2312> optionalMapField\n   */\n  public ?\\Adapter3::THackType $optionalMapField;\n  /**\n   * Original thrift field:-\n   * 8: binary binaryField\n   */\n  public \\Adapter1::THackType $binaryField;\n  /**\n   * Original thrift field:-\n   * 9: module.MyI64 longField\n   */\n  public \\facebook\\thrift\\test\\MyI64 $longField;\n  /**\n   * Original thrift field:-\n   * 10: module.MyI64 adaptedLongField\n   */\n  public \\facebook\\thrift\\test\\MyI64 $adaptedLongField;\n  /**\n   * Original thrift field:-\n   * 11: module.DoubleTypedefI64 doubleAdaptedField\n   */\n  public \\facebook\\thrift\\test\\DoubleTypedefI64 $doubleAdaptedField;\n\n  public function __construct(?\\Adapter1::THackType $intField = null, ?\\Adapter1::THackType $optionalIntField = null, ?\\Adapter1::THackType $intFieldWithDefault = null, ?\\facebook\\thrift\\test\\SetWithAdapter $setField = null, ?\\facebook\\thrift\\test\\SetWithAdapter $optionalSetField = null, ?\\Adapter3::THackType $mapField = null, ?\\Adapter3::THackType $optionalMapField = null, ?\\Adapter1::THackType $binaryField = null, ?\\facebook\\thrift\\test\\MyI64 $longField = null, ?\\facebook\\thrift\\test\\MyI64 $adaptedLongField = null, ?\\facebook\\thrift\\test\\DoubleTypedefI64 $doubleAdaptedField = null)[] {\n    $this->intField = $intField ?? \\Adapter1::fromThrift(0);\n    $this->optionalIntField = $optionalIntField;\n    $this->intFieldWithDefault = $intFieldWithDefault ?? \\Adapter1::fromThrift(13);\n    $this->setField = $setField ?? \\Adapter2::fromThrift(Set {});\n    $this->optionalSetField = $optionalSetField;\n    $this->mapField = $mapField ?? \\Adapter3::fromThrift(Map {});\n    $this->optionalMapField = $optionalMapField;\n    $this->binaryField = $binaryField ?? \\Adapter1::fromThrift('');\n    $this->longField = $longField ?? 0;\n    $this->adaptedLongField = $adaptedLongField ?? 0;\n    $this->doubleAdaptedField = $doubleAdaptedField ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'intField'),\n      Shapes::idx($shape, 'optionalIntField'),\n      Shapes::idx($shape, 'intFieldWithDefault'),\n      Shapes::idx($shape, 'setField'),\n      Shapes::idx($shape, 'optionalSetField'),\n      Shapes::idx($shape, 'mapField'),\n      Shapes::idx($shape, 'optionalMapField'),\n      Shapes::idx($shape, 'binaryField'),\n      Shapes::idx($shape, 'longField'),\n      Shapes::idx($shape, 'adaptedLongField'),\n      Shapes::idx($shape, 'doubleAdaptedField'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Foo\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"intField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"optionalIntField\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"intFieldWithDefault\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.SetWithAdapter\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"setField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.SetWithAdapter\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optionalSetField\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.ListWithElemAdapter_withAdapter_2312\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.ListWithElemAdapter_withAdapter_2312\",\n                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.ListWithElemAdapter_withAdapter\",\n                                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                shape(\n                                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                                    shape(\n                                                      \"name\" => \"module.ListWithElemAdapter_withAdapter\",\n                                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                        shape(\n                                                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                                            shape(\n                                                              \"name\" => \"module.ListWithElemAdapter\",\n                                                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                                shape(\n                                                                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                                                                    shape(\n                                                                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                                                        shape(\n                                                                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                                                            shape(\n                                                                              \"name\" => \"module.StringWithAdapter\",\n                                                                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                                                shape(\n                                                                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                                                                )\n                                                                              ),\n                                                                            )\n                                                                          ),\n                                                                        )\n                                                                      ),\n                                                                    )\n                                                                  ),\n                                                                )\n                                                              ),\n                                                            )\n                                                          ),\n                                                        )\n                                                      ),\n                                                    )\n                                                  ),\n                                                )\n                                              ),\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"mapField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.ListWithElemAdapter_withAdapter_2312\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.ListWithElemAdapter_withAdapter_2312\",\n                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.ListWithElemAdapter_withAdapter\",\n                                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                shape(\n                                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                                    shape(\n                                                      \"name\" => \"module.ListWithElemAdapter_withAdapter\",\n                                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                        shape(\n                                                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                                            shape(\n                                                              \"name\" => \"module.ListWithElemAdapter\",\n                                                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                                shape(\n                                                                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                                                                    shape(\n                                                                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                                                        shape(\n                                                                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                                                            shape(\n                                                                              \"name\" => \"module.StringWithAdapter\",\n                                                                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                                                shape(\n                                                                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                                                                )\n                                                                              ),\n                                                                            )\n                                                                          ),\n                                                                        )\n                                                                      ),\n                                                                    )\n                                                                  ),\n                                                                )\n                                                              ),\n                                                            )\n                                                          ),\n                                                        )\n                                                      ),\n                                                    )\n                                                  ),\n                                                )\n                                              ),\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optionalMapField\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"binaryField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyI64\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"longField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 10,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyI64\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedLongField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 11,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.DoubleTypedefI64\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.MyI64\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"doubleAdaptedField\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'intField' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'optionalIntField' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'intFieldWithDefault' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'setField' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter2\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter2\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter2\",\n              )\n            ),\n          ],\n        ),\n        'optionalSetField' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter2\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter2\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter2\",\n              )\n            ),\n          ],\n        ),\n        'mapField' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter3\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter3\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter3\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'optionalMapField' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter3\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter3\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter3\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'binaryField' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter3\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter3\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'longField' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\test\\MyAnnotation' => \\facebook\\thrift\\test\\MyAnnotation::fromShape(\n              shape(\n                \"signature\" => \"MyI64\",\n                \"color\" => \\facebook\\thrift\\test\\Color::GREEN,\n              )\n            ),\n          ],\n        ),\n        'adaptedLongField' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter2\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\python\\Adapter' => \\facebook\\thrift\\annotation\\python\\Adapter::fromShape(\n              shape(\n                \"name\" => \"my.Adapter3\",\n                \"typeHint\" => \"my.AdaptedType3[]\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter2\",\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\test\\MyAnnotation' => \\facebook\\thrift\\test\\MyAnnotation::fromShape(\n              shape(\n                \"signature\" => \"MyI64\",\n                \"color\" => \\facebook\\thrift\\test\\Color::GREEN,\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['intField'],\n      Shapes::idx($shape, 'optionalIntField'),\n      $shape['intFieldWithDefault'],\n      $shape['setField'],\n      Shapes::idx($shape, 'optionalSetField'),\n      $shape['mapField'],\n      Shapes::idx($shape, 'optionalMapField'),\n      $shape['binaryField'],\n      $shape['longField'],\n      $shape['adaptedLongField'],\n      $shape['doubleAdaptedField'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'intField' => $this->intField,\n      'optionalIntField' => $this->optionalIntField,\n      'intFieldWithDefault' => $this->intFieldWithDefault,\n      'setField' => $this->setField,\n      'optionalSetField' => $this->optionalSetField,\n      'mapField' => $this->mapField,\n      'optionalMapField' => $this->optionalMapField,\n      'binaryField' => $this->binaryField,\n      'longField' => $this->longField,\n      'adaptedLongField' => $this->adaptedLongField,\n      'doubleAdaptedField' => $this->doubleAdaptedField,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'intField') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['intField']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->intField = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'optionalIntField') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['optionalIntField']);\n      if ($_tmp1 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->optionalIntField = (int)$_tmp1;\n      }\n    }\n    if (idx($parsed, 'intFieldWithDefault') !== null) {\n      $_tmp2 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['intFieldWithDefault']);\n      if ($_tmp2 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->intFieldWithDefault = (int)$_tmp2;\n      }\n    }\n    if (idx($parsed, 'setField') !== null) {\n      $_json6 = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\SetWithAdapter>($parsed['setField']);\n      $_container7 = Set {};\n      foreach($_json6 as $_key4 => $_value5) {\n        $_elem8 = '';\n        $_elem8 = $_value5;\n        $_container7->add($_elem8);\n      }\n      $this->setField = $_container7;\n    }\n    if (idx($parsed, 'optionalSetField') !== null) {\n      $_json12 = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\SetWithAdapter>($parsed['optionalSetField']);\n      $_container13 = Set {};\n      foreach($_json12 as $_key10 => $_value11) {\n        $_elem14 = '';\n        $_elem14 = $_value11;\n        $_container13->add($_elem14);\n      }\n      $this->optionalSetField = $_container13;\n    }\n    if (idx($parsed, 'mapField') !== null) {\n      $_json18 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, \\facebook\\thrift\\test\\ListWithElemAdapter_withAdapter_2312>>($parsed['mapField']);\n      $_container19 = Map {};\n      foreach($_json18 as $_key16 => $_value17) {\n        $_value20 = Vector {};\n        $_json24 = $_value17;\n        $_container25 = Vector {};\n        foreach($_json24 as $_key22 => $_value23) {\n          $_elem26 = '';\n          $_elem26 = $_value23;\n          $_container25 []= $_elem26;\n        }\n        $_value20 = $_container25;\n        $_container19[$_key16] = $_value20;\n      }\n      $this->mapField = $_container19;\n    }\n    if (idx($parsed, 'optionalMapField') !== null) {\n      $_json30 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, \\facebook\\thrift\\test\\ListWithElemAdapter_withAdapter_2312>>($parsed['optionalMapField']);\n      $_container31 = Map {};\n      foreach($_json30 as $_key28 => $_value29) {\n        $_value32 = Vector {};\n        $_json36 = $_value29;\n        $_container37 = Vector {};\n        foreach($_json36 as $_key34 => $_value35) {\n          $_elem38 = '';\n          $_elem38 = $_value35;\n          $_container37 []= $_elem38;\n        }\n        $_value32 = $_container37;\n        $_container31[$_key28] = $_value32;\n      }\n      $this->optionalMapField = $_container31;\n    }\n    if (idx($parsed, 'binaryField') !== null) {\n      $this->binaryField = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['binaryField']);\n    }\n    if (idx($parsed, 'longField') !== null) {\n      $this->longField = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\MyI64>($parsed['longField']);\n    }\n    if (idx($parsed, 'adaptedLongField') !== null) {\n      $this->adaptedLongField = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\MyI64>($parsed['adaptedLongField']);\n    }\n    if (idx($parsed, 'doubleAdaptedField') !== null) {\n      $this->doubleAdaptedField = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\DoubleTypedefI64>($parsed['doubleAdaptedField']);\n    }\n  }\n\n  private static function __hackAdapterTypeChecks()[]: void {\n    \\ThriftUtil::requireSameType<\\Adapter1::TThriftType, int>();\n    \\ThriftUtil::requireSameType<\\Adapter1::TThriftType, string>();\n    \\ThriftUtil::requireSameType<\\Adapter2::TThriftType, Set<string>>();\n    \\ThriftUtil::requireSameType<\\Adapter2::TThriftType, Vector<\\facebook\\thrift\\test\\StringWithAdapter>>();\n    \\ThriftUtil::requireSameType<\\Adapter3::TThriftType, Map<string, \\facebook\\thrift\\test\\ListWithElemAdapter_withAdapter_2312>>();\n  }\n\n}\n\nenum BazEnum: int {\n  _EMPTY_ = 0;\n  intField = 1;\n  setField = 4;\n  mapField = 6;\n  binaryField = 8;\n  longField = 9;\n}\n\n/**\n * Original thrift struct:-\n * Baz\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/Baz'))>>\nclass Baz implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<\\facebook\\thrift\\test\\BazEnum>, \\IThriftShapishSyncStruct {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'intField',\n      'union' => true,\n      'adapter' => \\Adapter1::class,\n      'type' => \\TType::I32,\n    ),\n    4 => shape(\n      'var' => 'setField',\n      'union' => true,\n      'adapter' => \\Adapter2::class,\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    6 => shape(\n      'var' => 'mapField',\n      'union' => true,\n      'adapter' => \\Adapter3::class,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'adapter' => \\Adapter2::class,\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRING,\n        'elem' => shape(\n          'adapter' => \\Adapter1::class,\n          'type' => \\TType::STRING,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    8 => shape(\n      'var' => 'binaryField',\n      'union' => true,\n      'adapter' => \\Adapter1::class,\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    9 => shape(\n      'var' => 'longField',\n      'union' => true,\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'intField' => 1,\n    'setField' => 4,\n    'mapField' => 6,\n    'binaryField' => 8,\n    'longField' => 9,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'intField' => ?\\Adapter1::THackType,\n    ?'setField' => ?\\facebook\\thrift\\test\\SetWithAdapter,\n    ?'mapField' => ?\\Adapter3::THackType,\n    ?'binaryField' => ?\\Adapter1::THackType,\n    ?'longField' => ?\\facebook\\thrift\\test\\MyI64,\n  );\n\n  const type TShape = shape(\n    ?'intField' => ?\\Adapter1::THackType,\n    ?'setField' => ?\\facebook\\thrift\\test\\SetWithAdapter,\n    ?'mapField' => ?\\Adapter3::THackType,\n    ?'binaryField' => ?\\Adapter1::THackType,\n    ?'longField' => ?\\facebook\\thrift\\test\\MyI64,\n  );\n  const int STRUCTURAL_ID = 8924052603013047554;\n  /**\n   * Original thrift field:-\n   * 1: i32 intField\n   */\n  public ?\\Adapter1::THackType $intField;\n  /**\n   * Original thrift field:-\n   * 4: module.SetWithAdapter setField\n   */\n  public ?\\facebook\\thrift\\test\\SetWithAdapter $setField;\n  /**\n   * Original thrift field:-\n   * 6: map<string, module.ListWithElemAdapter_withAdapter_2312> mapField\n   */\n  public ?\\Adapter3::THackType $mapField;\n  /**\n   * Original thrift field:-\n   * 8: binary binaryField\n   */\n  public ?\\Adapter1::THackType $binaryField;\n  /**\n   * Original thrift field:-\n   * 9: module.MyI64 longField\n   */\n  public ?\\facebook\\thrift\\test\\MyI64 $longField;\n  protected \\facebook\\thrift\\test\\BazEnum $_type = \\facebook\\thrift\\test\\BazEnum::_EMPTY_;\n\n  public function __construct(?\\Adapter1::THackType $intField = null, ?\\facebook\\thrift\\test\\SetWithAdapter $setField = null, ?\\Adapter3::THackType $mapField = null, ?\\Adapter1::THackType $binaryField = null, ?\\facebook\\thrift\\test\\MyI64 $longField = null)[] {\n    $this->_type = \\facebook\\thrift\\test\\BazEnum::_EMPTY_;\n    if ($intField !== null) {\n      $this->intField = $intField;\n      $this->_type = \\facebook\\thrift\\test\\BazEnum::intField;\n    }\n    if ($setField !== null) {\n      $this->setField = $setField;\n      $this->_type = \\facebook\\thrift\\test\\BazEnum::setField;\n    }\n    if ($mapField !== null) {\n      $this->mapField = $mapField;\n      $this->_type = \\facebook\\thrift\\test\\BazEnum::mapField;\n    }\n    if ($binaryField !== null) {\n      $this->binaryField = $binaryField;\n      $this->_type = \\facebook\\thrift\\test\\BazEnum::binaryField;\n    }\n    if ($longField !== null) {\n      $this->longField = $longField;\n      $this->_type = \\facebook\\thrift\\test\\BazEnum::longField;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'intField'),\n      Shapes::idx($shape, 'setField'),\n      Shapes::idx($shape, 'mapField'),\n      Shapes::idx($shape, 'binaryField'),\n      Shapes::idx($shape, 'longField'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Baz';\n  }\n\n  public function getType()[]: \\facebook\\thrift\\test\\BazEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case \\facebook\\thrift\\test\\BazEnum::intField:\n        $this->intField = null;\n        break;\n      case \\facebook\\thrift\\test\\BazEnum::setField:\n        $this->setField = null;\n        break;\n      case \\facebook\\thrift\\test\\BazEnum::mapField:\n        $this->mapField = null;\n        break;\n      case \\facebook\\thrift\\test\\BazEnum::binaryField:\n        $this->binaryField = null;\n        break;\n      case \\facebook\\thrift\\test\\BazEnum::longField:\n        $this->longField = null;\n        break;\n      case \\facebook\\thrift\\test\\BazEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = \\facebook\\thrift\\test\\BazEnum::_EMPTY_;\n  }\n\n  public function set_intField(\\Adapter1::THackType $intField)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\BazEnum::intField;\n    $this->intField = $intField;\n    return $this;\n  }\n\n  public function get_intField()[]: ?\\Adapter1::THackType {\n    return $this->intField;\n  }\n\n  public function getx_intField()[]: \\Adapter1::THackType {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\BazEnum::intField,\n      'get_intField called on an instance of Baz whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->intField as nonnull;\n  }\n\n  public function set_setField(\\facebook\\thrift\\test\\SetWithAdapter $setField)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\BazEnum::setField;\n    $this->setField = $setField;\n    return $this;\n  }\n\n  public function get_setField()[]: ?\\facebook\\thrift\\test\\SetWithAdapter {\n    return $this->setField;\n  }\n\n  public function getx_setField()[]: \\facebook\\thrift\\test\\SetWithAdapter {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\BazEnum::setField,\n      'get_setField called on an instance of Baz whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->setField as nonnull;\n  }\n\n  public function set_mapField(\\Adapter3::THackType $mapField)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\BazEnum::mapField;\n    $this->mapField = $mapField;\n    return $this;\n  }\n\n  public function get_mapField()[]: ?\\Adapter3::THackType {\n    return $this->mapField;\n  }\n\n  public function getx_mapField()[]: \\Adapter3::THackType {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\BazEnum::mapField,\n      'get_mapField called on an instance of Baz whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->mapField as nonnull;\n  }\n\n  public function set_binaryField(\\Adapter1::THackType $binaryField)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\BazEnum::binaryField;\n    $this->binaryField = $binaryField;\n    return $this;\n  }\n\n  public function get_binaryField()[]: ?\\Adapter1::THackType {\n    return $this->binaryField;\n  }\n\n  public function getx_binaryField()[]: \\Adapter1::THackType {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\BazEnum::binaryField,\n      'get_binaryField called on an instance of Baz whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->binaryField as nonnull;\n  }\n\n  public function set_longField(\\facebook\\thrift\\test\\MyI64 $longField)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\BazEnum::longField;\n    $this->longField = $longField;\n    return $this;\n  }\n\n  public function get_longField()[]: ?\\facebook\\thrift\\test\\MyI64 {\n    return $this->longField;\n  }\n\n  public function getx_longField()[]: \\facebook\\thrift\\test\\MyI64 {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\BazEnum::longField,\n      'get_longField called on an instance of Baz whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->longField as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Baz\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"intField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.SetWithAdapter\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"setField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.ListWithElemAdapter_withAdapter_2312\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.ListWithElemAdapter_withAdapter_2312\",\n                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.ListWithElemAdapter_withAdapter\",\n                                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                shape(\n                                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                                    shape(\n                                                      \"name\" => \"module.ListWithElemAdapter_withAdapter\",\n                                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                        shape(\n                                                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                                            shape(\n                                                              \"name\" => \"module.ListWithElemAdapter\",\n                                                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                                shape(\n                                                                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                                                                    shape(\n                                                                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                                                        shape(\n                                                                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                                                            shape(\n                                                                              \"name\" => \"module.StringWithAdapter\",\n                                                                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                                                shape(\n                                                                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                                                                )\n                                                                              ),\n                                                                            )\n                                                                          ),\n                                                                        )\n                                                                      ),\n                                                                    )\n                                                                  ),\n                                                                )\n                                                              ),\n                                                            )\n                                                          ),\n                                                        )\n                                                      ),\n                                                    )\n                                                  ),\n                                                )\n                                              ),\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"mapField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"binaryField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyI64\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"longField\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'intField' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'setField' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter2\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter2\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter2\",\n              )\n            ),\n          ],\n        ),\n        'mapField' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter3\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter3\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter3\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'binaryField' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'longField' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\test\\MyAnnotation' => \\facebook\\thrift\\test\\MyAnnotation::fromShape(\n              shape(\n                \"signature\" => \"MyI64\",\n                \"color\" => \\facebook\\thrift\\test\\Color::GREEN,\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'intField'),\n      Shapes::idx($shape, 'setField'),\n      Shapes::idx($shape, 'mapField'),\n      Shapes::idx($shape, 'binaryField'),\n      Shapes::idx($shape, 'longField'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'intField' => $this->intField,\n      'setField' => $this->setField,\n      'mapField' => $this->mapField,\n      'binaryField' => $this->binaryField,\n      'longField' => $this->longField,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = \\facebook\\thrift\\test\\BazEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'intField') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['intField']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->intField = (int)$_tmp0;\n      }\n      $this->_type = \\facebook\\thrift\\test\\BazEnum::intField;\n    }\n    if (idx($parsed, 'setField') !== null) {\n      $_json4 = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\SetWithAdapter>($parsed['setField']);\n      $_container5 = Set {};\n      foreach($_json4 as $_key2 => $_value3) {\n        $_elem6 = '';\n        $_elem6 = $_value3;\n        $_container5->add($_elem6);\n      }\n      $this->setField = $_container5;\n      $this->_type = \\facebook\\thrift\\test\\BazEnum::setField;\n    }\n    if (idx($parsed, 'mapField') !== null) {\n      $_json10 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, \\facebook\\thrift\\test\\ListWithElemAdapter_withAdapter_2312>>($parsed['mapField']);\n      $_container11 = Map {};\n      foreach($_json10 as $_key8 => $_value9) {\n        $_value12 = Vector {};\n        $_json16 = $_value9;\n        $_container17 = Vector {};\n        foreach($_json16 as $_key14 => $_value15) {\n          $_elem18 = '';\n          $_elem18 = $_value15;\n          $_container17 []= $_elem18;\n        }\n        $_value12 = $_container17;\n        $_container11[$_key8] = $_value12;\n      }\n      $this->mapField = $_container11;\n      $this->_type = \\facebook\\thrift\\test\\BazEnum::mapField;\n    }\n    if (idx($parsed, 'binaryField') !== null) {\n      $this->binaryField = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['binaryField']);\n      $this->_type = \\facebook\\thrift\\test\\BazEnum::binaryField;\n    }\n    if (idx($parsed, 'longField') !== null) {\n      $this->longField = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\MyI64>($parsed['longField']);\n      $this->_type = \\facebook\\thrift\\test\\BazEnum::longField;\n    }\n  }\n\n  private static function __hackAdapterTypeChecks()[]: void {\n    \\ThriftUtil::requireSameType<\\Adapter1::TThriftType, int>();\n    \\ThriftUtil::requireSameType<\\Adapter1::TThriftType, string>();\n    \\ThriftUtil::requireSameType<\\Adapter2::TThriftType, Set<string>>();\n    \\ThriftUtil::requireSameType<\\Adapter2::TThriftType, Vector<\\facebook\\thrift\\test\\StringWithAdapter>>();\n    \\ThriftUtil::requireSameType<\\Adapter3::TThriftType, Map<string, \\facebook\\thrift\\test\\ListWithElemAdapter_withAdapter_2312>>();\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Bar\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/Bar'))>>\nclass Bar implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'structField',\n      'adapter' => \\Adapter1::class,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\Foo::class,\n    ),\n    2 => shape(\n      'var' => 'optionalStructField',\n      'adapter' => \\Adapter1::class,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\Foo::class,\n    ),\n    3 => shape(\n      'var' => 'structListField',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRUCT,\n      'elem' => shape(\n        'adapter' => \\Adapter1::class,\n        'type' => \\TType::STRUCT,\n        'class' => \\facebook\\thrift\\test\\Foo::class,\n      ),\n      'format' => 'collection',\n    ),\n    4 => shape(\n      'var' => 'optionalStructListField',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRUCT,\n      'elem' => shape(\n        'adapter' => \\Adapter1::class,\n        'type' => \\TType::STRUCT,\n        'class' => \\facebook\\thrift\\test\\Foo::class,\n      ),\n      'format' => 'collection',\n    ),\n    5 => shape(\n      'var' => 'unionField',\n      'adapter' => \\Adapter1::class,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\Baz::class,\n    ),\n    6 => shape(\n      'var' => 'optionalUnionField',\n      'adapter' => \\Adapter1::class,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\Baz::class,\n    ),\n    7 => shape(\n      'var' => 'adaptedStructField',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\DirectlyAdapted::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'structField' => 1,\n    'optionalStructField' => 2,\n    'structListField' => 3,\n    'optionalStructListField' => 4,\n    'unionField' => 5,\n    'optionalUnionField' => 6,\n    'adaptedStructField' => 7,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'structField' => ?\\Adapter1::THackType,\n    ?'optionalStructField' => ?\\Adapter1::THackType,\n    ?'structListField' => ?Vector<\\facebook\\thrift\\test\\FooWithAdapter_9317>,\n    ?'optionalStructListField' => ?Vector<\\facebook\\thrift\\test\\FooWithAdapter_9317>,\n    ?'unionField' => ?\\Adapter1::THackType,\n    ?'optionalUnionField' => ?\\Adapter1::THackType,\n    ?'adaptedStructField' => ?\\facebook\\thrift\\test\\DirectlyAdapted,\n  );\n\n  const type TShape = shape(\n    ?'structField' => ?\\Adapter1::THackType,\n    ?'optionalStructField' => ?\\Adapter1::THackType,\n    'structListField' => vec<\\facebook\\thrift\\test\\FooWithAdapter_9317>,\n    ?'optionalStructListField' => ?vec<\\facebook\\thrift\\test\\FooWithAdapter_9317>,\n    ?'unionField' => ?\\Adapter1::THackType,\n    ?'optionalUnionField' => ?\\Adapter1::THackType,\n    ?'adaptedStructField' => ?\\facebook\\thrift\\test\\DirectlyAdapted::TShape,\n  );\n  const int STRUCTURAL_ID = 7938871189708910014;\n  /**\n   * Original thrift field:-\n   * 1: module.Foo structField\n   */\n  public ?\\Adapter1::THackType $structField;\n  /**\n   * Original thrift field:-\n   * 2: module.Foo optionalStructField\n   */\n  public ?\\Adapter1::THackType $optionalStructField;\n  /**\n   * Original thrift field:-\n   * 3: list<module.FooWithAdapter_9317> structListField\n   */\n  public Vector<\\facebook\\thrift\\test\\FooWithAdapter_9317> $structListField;\n  /**\n   * Original thrift field:-\n   * 4: list<module.FooWithAdapter_9317> optionalStructListField\n   */\n  public ?Vector<\\facebook\\thrift\\test\\FooWithAdapter_9317> $optionalStructListField;\n  /**\n   * Original thrift field:-\n   * 5: module.Baz unionField\n   */\n  public ?\\Adapter1::THackType $unionField;\n  /**\n   * Original thrift field:-\n   * 6: module.Baz optionalUnionField\n   */\n  public ?\\Adapter1::THackType $optionalUnionField;\n  /**\n   * Original thrift field:-\n   * 7: module.DirectlyAdapted adaptedStructField\n   */\n  public ?\\facebook\\thrift\\test\\DirectlyAdapted $adaptedStructField;\n\n  public function __construct(?\\Adapter1::THackType $structField = null, ?\\Adapter1::THackType $optionalStructField = null, ?Vector<\\facebook\\thrift\\test\\FooWithAdapter_9317> $structListField = null, ?Vector<\\facebook\\thrift\\test\\FooWithAdapter_9317> $optionalStructListField = null, ?\\Adapter1::THackType $unionField = null, ?\\Adapter1::THackType $optionalUnionField = null, ?\\facebook\\thrift\\test\\DirectlyAdapted $adaptedStructField = null)[] {\n    $this->structField = $structField;\n    $this->optionalStructField = $optionalStructField;\n    $this->structListField = $structListField ?? Vector {};\n    $this->optionalStructListField = $optionalStructListField;\n    $this->unionField = $unionField;\n    $this->optionalUnionField = $optionalUnionField;\n    $this->adaptedStructField = $adaptedStructField;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'structField'),\n      Shapes::idx($shape, 'optionalStructField'),\n      Shapes::idx($shape, 'structListField'),\n      Shapes::idx($shape, 'optionalStructListField'),\n      Shapes::idx($shape, 'unionField'),\n      Shapes::idx($shape, 'optionalUnionField'),\n      Shapes::idx($shape, 'adaptedStructField'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Bar';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Bar\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.Foo\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"structField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.Foo\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optionalStructField\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.FooWithAdapter_9317\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.FooWithAdapter_9317\",\n                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.FooWithAdapter\",\n                                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                shape(\n                                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                                    shape(\n                                                      \"name\" => \"module.FooWithAdapter\",\n                                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                        shape(\n                                                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                                            shape(\n                                                              \"name\" => \"module.Foo\",\n                                                            )\n                                                          ),\n                                                        )\n                                                      ),\n                                                    )\n                                                  ),\n                                                )\n                                              ),\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"structListField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.FooWithAdapter_9317\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.FooWithAdapter_9317\",\n                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.FooWithAdapter\",\n                                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                shape(\n                                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                                    shape(\n                                                      \"name\" => \"module.FooWithAdapter\",\n                                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                        shape(\n                                                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                                            shape(\n                                                              \"name\" => \"module.Foo\",\n                                                            )\n                                                          ),\n                                                        )\n                                                      ),\n                                                    )\n                                                  ),\n                                                )\n                                              ),\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optionalStructListField\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.Baz\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.Baz\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"unionField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.Baz\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.Baz\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optionalUnionField\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.DirectlyAdapted\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.DirectlyAdapted\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedStructField\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'structField' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n                \"adaptedType\" => \"::my::Cpp::Type1\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'optionalStructField' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'unionField' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'optionalUnionField' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'adaptedStructField' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\python\\Adapter' => \\facebook\\thrift\\annotation\\python\\Adapter::fromShape(\n              shape(\n                \"name\" => \"my.module.Adapter\",\n                \"typeHint\" => \"my.another.module.AdaptedType\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'structField'),\n      Shapes::idx($shape, 'optionalStructField'),\n      $shape['structListField']\n        |> Vec\\map(\n          $$,\n          $_val0 ==> $_val0\n            |> \\facebook\\thrift\\test\\Foo::__fromShape($$),\n        ) |> new Vector($$),\n      Shapes::idx($shape, 'optionalStructListField') === null ? null : ($shape['optionalStructListField']\n        |> Vec\\map(\n          $$,\n          $_val1 ==> $_val1\n            |> \\facebook\\thrift\\test\\Foo::__fromShape($$),\n        ) |> new Vector($$)),\n      Shapes::idx($shape, 'unionField'),\n      Shapes::idx($shape, 'optionalUnionField'),\n      Shapes::idx($shape, 'adaptedStructField') === null ? null : (\\facebook\\thrift\\test\\DirectlyAdapted::__fromShape($shape['adaptedStructField'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'structField' => $this->structField,\n      'optionalStructField' => $this->optionalStructField,\n      'structListField' => $this->structListField->map(\n        ($_val0) ==> $_val0->__toShape(),\n      )\n        |> vec($$),\n      'optionalStructListField' => $this->optionalStructListField?->map(\n        ($_val0) ==> $_val0->__toShape(),\n      )\n        |> $$ === null ? null : vec($$),\n      'unionField' => $this->unionField,\n      'optionalUnionField' => $this->optionalUnionField,\n      'adaptedStructField' => $this->adaptedStructField?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'structField') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\Foo>($parsed['structField']));\n      $_tmp1 = \\facebook\\thrift\\test\\Foo::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->structField = $_tmp1;\n    }\n    if (idx($parsed, 'optionalStructField') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\Foo>($parsed['optionalStructField']));\n      $_tmp3 = \\facebook\\thrift\\test\\Foo::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->optionalStructField = $_tmp3;\n    }\n    if (idx($parsed, 'structListField') !== null) {\n      $_json7 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<\\facebook\\thrift\\test\\FooWithAdapter_9317>>($parsed['structListField']);\n      $_container8 = Vector {};\n      foreach($_json7 as $_key5 => $_value6) {\n        $_elem9 = \\facebook\\thrift\\test\\Foo::withDefaultValues();\n        $_tmp10 = \\json_encode($_value6);\n        $_tmp11 = \\facebook\\thrift\\test\\Foo::withDefaultValues();\n        $_tmp11->readFromJson($_tmp10);\n        $_elem9 = $_tmp11;\n        $_container8 []= $_elem9;\n      }\n      $this->structListField = $_container8;\n    }\n    if (idx($parsed, 'optionalStructListField') !== null) {\n      $_json15 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<\\facebook\\thrift\\test\\FooWithAdapter_9317>>($parsed['optionalStructListField']);\n      $_container16 = Vector {};\n      foreach($_json15 as $_key13 => $_value14) {\n        $_elem17 = \\facebook\\thrift\\test\\Foo::withDefaultValues();\n        $_tmp18 = \\json_encode($_value14);\n        $_tmp19 = \\facebook\\thrift\\test\\Foo::withDefaultValues();\n        $_tmp19->readFromJson($_tmp18);\n        $_elem17 = $_tmp19;\n        $_container16 []= $_elem17;\n      }\n      $this->optionalStructListField = $_container16;\n    }\n    if (idx($parsed, 'unionField') !== null) {\n      $_tmp20 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\Baz>($parsed['unionField']));\n      $_tmp21 = \\facebook\\thrift\\test\\Baz::withDefaultValues();\n      $_tmp21->readFromJson($_tmp20);\n      $this->unionField = $_tmp21;\n    }\n    if (idx($parsed, 'optionalUnionField') !== null) {\n      $_tmp22 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\Baz>($parsed['optionalUnionField']));\n      $_tmp23 = \\facebook\\thrift\\test\\Baz::withDefaultValues();\n      $_tmp23->readFromJson($_tmp22);\n      $this->optionalUnionField = $_tmp23;\n    }\n    if (idx($parsed, 'adaptedStructField') !== null) {\n      $_tmp24 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\DirectlyAdapted>($parsed['adaptedStructField']));\n      $_tmp25 = \\facebook\\thrift\\test\\DirectlyAdapted::withDefaultValues();\n      $_tmp25->readFromJson($_tmp24);\n      $this->adaptedStructField = $_tmp25;\n    }\n  }\n\n  private static function __hackAdapterTypeChecks()[]: void {\n    \\ThriftUtil::requireSameType<\\Adapter1::TThriftType, \\facebook\\thrift\\test\\Baz>();\n    \\ThriftUtil::requireSameType<\\Adapter1::TThriftType, \\facebook\\thrift\\test\\Foo>();\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * DirectlyAdapted\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/DirectlyAdapted'))>>\nclass DirectlyAdapted implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?int,\n  );\n\n  const type TShape = shape(\n    'field' => int,\n  );\n  const int STRUCTURAL_ID = 7035499037608086885;\n  /**\n   * Original thrift field:-\n   * 1: i32 field\n   */\n  public int $field;\n\n  public function __construct(?int $field = null)[] {\n    $this->field = $field ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'DirectlyAdapted';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.DirectlyAdapted\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::my::Adapter\",\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\python\\Adapter' => \\facebook\\thrift\\annotation\\python\\Adapter::fromShape(\n          shape(\n            \"name\" => \"my.module.Adapter\",\n            \"typeHint\" => \"my.another.module.AdaptedType\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field' => $this->field,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['field']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->field = (int)$_tmp0;\n      }\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * IndependentDirectlyAdapted\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/IndependentDirectlyAdapted'))>>\nclass IndependentDirectlyAdapted implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?int,\n  );\n\n  const type TShape = shape(\n    'field' => int,\n  );\n  const int STRUCTURAL_ID = 7035499037608086885;\n  /**\n   * Original thrift field:-\n   * 1: i32 field\n   */\n  public int $field;\n\n  public function __construct(?int $field = null)[] {\n    $this->field = $field ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'IndependentDirectlyAdapted';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.IndependentDirectlyAdapted\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::my::Adapter\",\n            \"adaptedType\" => \"::my::Type\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field' => $this->field,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['field']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->field = (int)$_tmp0;\n      }\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructWithFieldAdapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/StructWithFieldAdapter'))>>\nclass StructWithFieldAdapter implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'shared_field',\n      'type' => \\TType::I32,\n    ),\n    3 => shape(\n      'var' => 'opt_shared_field',\n      'type' => \\TType::I32,\n    ),\n    4 => shape(\n      'var' => 'opt_boxed_field',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n    'shared_field' => 2,\n    'opt_shared_field' => 3,\n    'opt_boxed_field' => 4,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?int,\n    ?'shared_field' => ?int,\n    ?'opt_shared_field' => ?int,\n    ?'opt_boxed_field' => ?int,\n  );\n\n  const type TShape = shape(\n    'field' => int,\n    'shared_field' => int,\n    ?'opt_shared_field' => ?int,\n    ?'opt_boxed_field' => ?int,\n  );\n  const int STRUCTURAL_ID = 1940453594051247312;\n  /**\n   * Original thrift field:-\n   * 1: i32 field\n   */\n  public int $field;\n  /**\n   * Original thrift field:-\n   * 2: i32 shared_field\n   */\n  public int $shared_field;\n  /**\n   * Original thrift field:-\n   * 3: i32 opt_shared_field\n   */\n  public ?int $opt_shared_field;\n  /**\n   * Original thrift field:-\n   * 4: i32 opt_boxed_field\n   */\n  public ?int $opt_boxed_field;\n\n  public function __construct(?int $field = null, ?int $shared_field = null, ?int $opt_shared_field = null, ?int $opt_boxed_field = null)[] {\n    $this->field = $field ?? 0;\n    $this->shared_field = $shared_field ?? 0;\n    $this->opt_shared_field = $opt_shared_field;\n    $this->opt_boxed_field = $opt_boxed_field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n      Shapes::idx($shape, 'shared_field'),\n      Shapes::idx($shape, 'opt_shared_field'),\n      Shapes::idx($shape, 'opt_boxed_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructWithFieldAdapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.StructWithFieldAdapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"shared_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"opt_shared_field\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"opt_boxed_field\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\python\\Adapter' => \\facebook\\thrift\\annotation\\python\\Adapter::fromShape(\n              shape(\n                \"name\" => \"my.Adapter1\",\n                \"typeHint\" => \"my.AdaptedType1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1<>\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'shared_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Ref' => \\facebook\\thrift\\annotation\\cpp\\Ref::fromShape(\n              shape(\n                \"type\" => \\facebook\\thrift\\annotation\\cpp\\RefType::Shared,\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'opt_shared_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Ref' => \\facebook\\thrift\\annotation\\cpp\\Ref::fromShape(\n              shape(\n                \"type\" => \\facebook\\thrift\\annotation\\cpp\\RefType::Shared,\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1<>\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'opt_boxed_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\Box' => \\facebook\\thrift\\annotation\\Box::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field'],\n      $shape['shared_field'],\n      Shapes::idx($shape, 'opt_shared_field'),\n      Shapes::idx($shape, 'opt_boxed_field'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field' => $this->field,\n      'shared_field' => $this->shared_field,\n      'opt_shared_field' => $this->opt_shared_field,\n      'opt_boxed_field' => $this->opt_boxed_field,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['field']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->field = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'shared_field') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['shared_field']);\n      if ($_tmp1 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->shared_field = (int)$_tmp1;\n      }\n    }\n    if (idx($parsed, 'opt_shared_field') !== null) {\n      $_tmp2 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['opt_shared_field']);\n      if ($_tmp2 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->opt_shared_field = (int)$_tmp2;\n      }\n    }\n    if (idx($parsed, 'opt_boxed_field') !== null) {\n      $_tmp3 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['opt_boxed_field']);\n      if ($_tmp3 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->opt_boxed_field = (int)$_tmp3;\n      }\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * TerseAdaptedFields\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/TerseAdaptedFields'))>>\nclass TerseAdaptedFields implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'int_field',\n      'is_terse' => true,\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'string_field',\n      'is_terse' => true,\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'set_field',\n      'is_terse' => true,\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'int_field' => 1,\n    'string_field' => 2,\n    'set_field' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'int_field' => ?int,\n    ?'string_field' => ?string,\n    ?'set_field' => ?Set<int>,\n  );\n\n  const type TShape = shape(\n    'int_field' => int,\n    'string_field' => string,\n    'set_field' => dict<int, bool>,\n  );\n  const int STRUCTURAL_ID = 4698812981420911373;\n  /**\n   * Original thrift field:-\n   * 1: i32 int_field\n   */\n  public int $int_field;\n  /**\n   * Original thrift field:-\n   * 2: string string_field\n   */\n  public string $string_field;\n  /**\n   * Original thrift field:-\n   * 3: set<i32> set_field\n   */\n  public Set<int> $set_field;\n\n  public function __construct(?int $int_field = null, ?string $string_field = null, ?Set<int> $set_field = null)[] {\n    $this->int_field = $int_field ?? 0;\n    $this->string_field = $string_field ?? '';\n    $this->set_field = $set_field ?? Set {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'int_field'),\n      Shapes::idx($shape, 'string_field'),\n      Shapes::idx($shape, 'set_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TerseAdaptedFields';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->int_field = 0;\n    $this->string_field = '';\n    $this->set_field = Set {};\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TerseAdaptedFields\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"int_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"string_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"set_field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'int_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'string_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'set_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['int_field'],\n      $shape['string_field'],\n      new Set(Keyset\\keys($shape['set_field'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'int_field' => $this->int_field,\n      'string_field' => $this->string_field,\n      'set_field' => ThriftUtil::toDArray(Dict\\fill_keys($this->set_field->toValuesArray(), true), static::class),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'int_field') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['int_field']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->int_field = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'string_field') !== null) {\n      $this->string_field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['string_field']);\n    }\n    if (idx($parsed, 'set_field') !== null) {\n      $_json4 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['set_field']);\n      $_container5 = Set {};\n      foreach($_json4 as $_key2 => $_value3) {\n        $_elem6 = 0;\n        $_tmp7 = (int)$_value3;\n        if ($_tmp7 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem6 = (int)$_tmp7;\n        }\n        $_container5->add($_elem6);\n      }\n      $this->set_field = $_container5;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * B\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/B'))>>\nclass B implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\A::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?\\facebook\\thrift\\test\\AdaptedA,\n  );\n\n  const type TShape = shape(\n    ?'a' => ?\\facebook\\thrift\\test\\A::TShape,\n  );\n  const int STRUCTURAL_ID = 1135805466744601735;\n  /**\n   * Original thrift field:-\n   * 1: module.AdaptedA a\n   */\n  public ?\\facebook\\thrift\\test\\AdaptedA $a;\n\n  public function __construct(?\\facebook\\thrift\\test\\AdaptedA $a = null)[] {\n    $this->a = $a;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'B';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.B\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedA\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.AdaptedA\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.A\",\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'a' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a') === null ? null : (\\facebook\\thrift\\test\\A::__fromShape($shape['a'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'a' => $this->a?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'a') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedA>($parsed['a']));\n      $_tmp1 = \\facebook\\thrift\\test\\A::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->a = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * A\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/A'))>>\nclass A implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'A';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.A\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Config\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/Config'))>>\nclass Config implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'path',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'path' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'path' => ?string,\n  );\n\n  const type TShape = shape(\n    'path' => string,\n  );\n  const int STRUCTURAL_ID = 4266277309871357727;\n  /**\n   * Original thrift field:-\n   * 1: string path\n   */\n  public string $path;\n\n  public function __construct(?string $path = null)[] {\n    $this->path = $path ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'path'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Config';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Config\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"path\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"MyVarAdapter\",\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\python\\Adapter' => \\facebook\\thrift\\annotation\\python\\Adapter::fromShape(\n          shape(\n            \"name\" => \"my.ConfigAdapter\",\n            \"typeHint\" => \"my.ConfiguredVar[]\",\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['path'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'path' => $this->path,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'path') !== null) {\n      $this->path = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['path']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/MyStruct'))>>\nclass MyStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'set_string',\n      'adapter' => \\Adapter2::class,\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n    'set_string' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?int,\n    ?'set_string' => ?\\facebook\\thrift\\test\\SetWithAdapter,\n  );\n\n  const type TShape = shape(\n    'field' => int,\n    'set_string' => \\facebook\\thrift\\test\\SetWithAdapter,\n  );\n  const int STRUCTURAL_ID = 5903652997290634247;\n  /**\n   * Original thrift field:-\n   * 1: i32 field\n   */\n  public int $field;\n  /**\n   * Original thrift field:-\n   * 2: module.SetWithAdapter set_string\n   */\n  public \\facebook\\thrift\\test\\SetWithAdapter $set_string;\n\n  public function __construct(?int $field = null, ?\\facebook\\thrift\\test\\SetWithAdapter $set_string = null)[] {\n    $this->field = $field ?? 0;\n    $this->set_string = $set_string ?? \\Adapter2::fromThrift(Set {});\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n      Shapes::idx($shape, 'set_string'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.SetWithAdapter\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"set_string\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'set_string' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter2\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter2\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter2\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field'],\n      $shape['set_string'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field' => $this->field,\n      'set_string' => $this->set_string,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['field']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->field = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'set_string') !== null) {\n      $_json4 = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\SetWithAdapter>($parsed['set_string']);\n      $_container5 = Set {};\n      foreach($_json4 as $_key2 => $_value3) {\n        $_elem6 = '';\n        $_elem6 = $_value3;\n        $_container5->add($_elem6);\n      }\n      $this->set_string = $_container5;\n    }\n  }\n\n  private static function __hackAdapterTypeChecks()[]: void {\n    \\ThriftUtil::requireSameType<\\Adapter2::TThriftType, Set<string>>();\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * AdaptTestStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/AdaptTestStruct'))>>\nclass AdaptTestStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'delay',\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'custom',\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    3 => shape(\n      'var' => 'timeout',\n      'type' => \\TType::I64,\n    ),\n    4 => shape(\n      'var' => 'data',\n      'type' => \\TType::I64,\n    ),\n    5 => shape(\n      'var' => 'meta',\n      'type' => \\TType::STRING,\n    ),\n    6 => shape(\n      'var' => 'indirectionString',\n      'type' => \\TType::STRING,\n    ),\n    7 => shape(\n      'var' => 'string_data',\n      'type' => \\TType::STRING,\n    ),\n    8 => shape(\n      'var' => 'double_wrapped_bool',\n      'type' => \\TType::BOOL,\n    ),\n    9 => shape(\n      'var' => 'double_wrapped_integer',\n      'type' => \\TType::I32,\n    ),\n    10 => shape(\n      'var' => 'binary_data',\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'delay' => 1,\n    'custom' => 2,\n    'timeout' => 3,\n    'data' => 4,\n    'meta' => 5,\n    'indirectionString' => 6,\n    'string_data' => 7,\n    'double_wrapped_bool' => 8,\n    'double_wrapped_integer' => 9,\n    'binary_data' => 10,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'delay' => ?\\facebook\\thrift\\test\\DurationMs,\n    ?'custom' => ?\\facebook\\thrift\\test\\CustomProtocolType,\n    ?'timeout' => ?int,\n    ?'data' => ?int,\n    ?'meta' => ?string,\n    ?'indirectionString' => ?\\facebook\\thrift\\test\\IndirectionString,\n    ?'string_data' => ?string,\n    ?'double_wrapped_bool' => ?\\facebook\\thrift\\test\\AdaptedBool,\n    ?'double_wrapped_integer' => ?\\facebook\\thrift\\test\\AdaptedInteger,\n    ?'binary_data' => ?string,\n  );\n\n  const type TShape = shape(\n    'delay' => \\facebook\\thrift\\test\\DurationMs,\n    'custom' => \\facebook\\thrift\\test\\CustomProtocolType,\n    'timeout' => int,\n    'data' => int,\n    'meta' => string,\n    'indirectionString' => \\facebook\\thrift\\test\\IndirectionString,\n    'string_data' => string,\n    'double_wrapped_bool' => \\facebook\\thrift\\test\\AdaptedBool,\n    'double_wrapped_integer' => \\facebook\\thrift\\test\\AdaptedInteger,\n    'binary_data' => string,\n  );\n  const int STRUCTURAL_ID = 9217156058896773800;\n  /**\n   * Original thrift field:-\n   * 1: module.DurationMs delay\n   */\n  public \\facebook\\thrift\\test\\DurationMs $delay;\n  /**\n   * Original thrift field:-\n   * 2: module.CustomProtocolType custom\n   */\n  public \\facebook\\thrift\\test\\CustomProtocolType $custom;\n  /**\n   * Original thrift field:-\n   * 3: i64 timeout\n   */\n  public int $timeout;\n  /**\n   * Original thrift field:-\n   * 4: i64 data\n   */\n  public int $data;\n  /**\n   * Original thrift field:-\n   * 5: string meta\n   */\n  public string $meta;\n  /**\n   * Original thrift field:-\n   * 6: module.IndirectionString indirectionString\n   */\n  public \\facebook\\thrift\\test\\IndirectionString $indirectionString;\n  /**\n   * Original thrift field:-\n   * 7: string string_data\n   */\n  public string $string_data;\n  /**\n   * Original thrift field:-\n   * 8: module.AdaptedBool double_wrapped_bool\n   */\n  public \\facebook\\thrift\\test\\AdaptedBool $double_wrapped_bool;\n  /**\n   * Original thrift field:-\n   * 9: module.AdaptedInteger double_wrapped_integer\n   */\n  public \\facebook\\thrift\\test\\AdaptedInteger $double_wrapped_integer;\n  /**\n   * Original thrift field:-\n   * 10: binary binary_data\n   */\n  public string $binary_data;\n\n  public function __construct(?\\facebook\\thrift\\test\\DurationMs $delay = null, ?\\facebook\\thrift\\test\\CustomProtocolType $custom = null, ?int $timeout = null, ?int $data = null, ?string $meta = null, ?\\facebook\\thrift\\test\\IndirectionString $indirectionString = null, ?string $string_data = null, ?\\facebook\\thrift\\test\\AdaptedBool $double_wrapped_bool = null, ?\\facebook\\thrift\\test\\AdaptedInteger $double_wrapped_integer = null, ?string $binary_data = null)[] {\n    $this->delay = $delay ?? 0;\n    $this->custom = $custom ?? '';\n    $this->timeout = $timeout ?? 0;\n    $this->data = $data ?? 0;\n    $this->meta = $meta ?? '';\n    $this->indirectionString = $indirectionString ?? '';\n    $this->string_data = $string_data ?? '';\n    $this->double_wrapped_bool = $double_wrapped_bool ?? false;\n    $this->double_wrapped_integer = $double_wrapped_integer ?? 0;\n    $this->binary_data = $binary_data ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'delay'),\n      Shapes::idx($shape, 'custom'),\n      Shapes::idx($shape, 'timeout'),\n      Shapes::idx($shape, 'data'),\n      Shapes::idx($shape, 'meta'),\n      Shapes::idx($shape, 'indirectionString'),\n      Shapes::idx($shape, 'string_data'),\n      Shapes::idx($shape, 'double_wrapped_bool'),\n      Shapes::idx($shape, 'double_wrapped_integer'),\n      Shapes::idx($shape, 'binary_data'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AdaptTestStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.AdaptTestStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.DurationMs\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"delay\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.CustomProtocolType\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"custom\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"timeout\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"data\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"meta\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.IndirectionString\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"indirectionString\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"string_data\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedBool\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"double_wrapped_bool\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedInteger\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"double_wrapped_integer\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 10,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"binary_data\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'delay' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::AdaptTestMsAdapter\",\n              )\n            ),\n          ],\n        ),\n        'custom' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::CustomProtocolAdapter\",\n              )\n            ),\n          ],\n        ),\n        'timeout' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::AdaptTestMsAdapter\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'data' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::AdapterWithContext\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'indirectionString' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::IndirectionAdapter<::apache::thrift::test::IndirectionString>\",\n              )\n            ),\n          ],\n        ),\n        'string_data' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::AdapterWithContext\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'double_wrapped_bool' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'double_wrapped_integer' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::AdapterWithContext\",\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'binary_data' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::AdapterWithContext\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['delay'],\n      $shape['custom'],\n      $shape['timeout'],\n      $shape['data'],\n      $shape['meta'],\n      $shape['indirectionString'],\n      $shape['string_data'],\n      $shape['double_wrapped_bool'],\n      $shape['double_wrapped_integer'],\n      $shape['binary_data'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'delay' => $this->delay,\n      'custom' => $this->custom,\n      'timeout' => $this->timeout,\n      'data' => $this->data,\n      'meta' => $this->meta,\n      'indirectionString' => $this->indirectionString,\n      'string_data' => $this->string_data,\n      'double_wrapped_bool' => $this->double_wrapped_bool,\n      'double_wrapped_integer' => $this->double_wrapped_integer,\n      'binary_data' => $this->binary_data,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'delay') !== null) {\n      $this->delay = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\DurationMs>($parsed['delay']);\n    }\n    if (idx($parsed, 'custom') !== null) {\n      $this->custom = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\CustomProtocolType>($parsed['custom']);\n    }\n    if (idx($parsed, 'timeout') !== null) {\n      $this->timeout = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['timeout']);\n    }\n    if (idx($parsed, 'data') !== null) {\n      $this->data = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['data']);\n    }\n    if (idx($parsed, 'meta') !== null) {\n      $this->meta = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['meta']);\n    }\n    if (idx($parsed, 'indirectionString') !== null) {\n      $this->indirectionString = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\IndirectionString>($parsed['indirectionString']);\n    }\n    if (idx($parsed, 'string_data') !== null) {\n      $this->string_data = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['string_data']);\n    }\n    if (idx($parsed, 'double_wrapped_bool') !== null) {\n      $this->double_wrapped_bool = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedBool>($parsed['double_wrapped_bool']);\n    }\n    if (idx($parsed, 'double_wrapped_integer') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedInteger>($parsed['double_wrapped_integer']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->double_wrapped_integer = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'binary_data') !== null) {\n      $this->binary_data = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['binary_data']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * AdaptTemplatedTestStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/AdaptTemplatedTestStruct'))>>\nclass AdaptTemplatedTestStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'adaptedBool',\n      'type' => \\TType::BOOL,\n    ),\n    2 => shape(\n      'var' => 'adaptedByte',\n      'type' => \\TType::BYTE,\n    ),\n    3 => shape(\n      'var' => 'adaptedShort',\n      'type' => \\TType::I16,\n    ),\n    4 => shape(\n      'var' => 'adaptedInteger',\n      'type' => \\TType::I32,\n    ),\n    5 => shape(\n      'var' => 'adaptedLong',\n      'type' => \\TType::I64,\n    ),\n    6 => shape(\n      'var' => 'adaptedDouble',\n      'type' => \\TType::DOUBLE,\n    ),\n    7 => shape(\n      'var' => 'adaptedString',\n      'type' => \\TType::STRING,\n    ),\n    8 => shape(\n      'var' => 'adaptedList',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I64,\n      'elem' => shape(\n        'type' => \\TType::I64,\n      ),\n      'format' => 'collection',\n    ),\n    9 => shape(\n      'var' => 'adaptedSet',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I64,\n      'elem' => shape(\n        'type' => \\TType::I64,\n      ),\n      'format' => 'collection',\n    ),\n    10 => shape(\n      'var' => 'adaptedMap',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I64,\n      'vtype' => \\TType::I64,\n      'key' => shape(\n        'type' => \\TType::I64,\n      ),\n      'val' => shape(\n        'type' => \\TType::I64,\n      ),\n      'format' => 'collection',\n    ),\n    11 => shape(\n      'var' => 'adaptedBoolDefault',\n      'type' => \\TType::BOOL,\n    ),\n    12 => shape(\n      'var' => 'adaptedByteDefault',\n      'type' => \\TType::BYTE,\n    ),\n    13 => shape(\n      'var' => 'adaptedShortDefault',\n      'type' => \\TType::I16,\n    ),\n    14 => shape(\n      'var' => 'adaptedIntegerDefault',\n      'type' => \\TType::I32,\n    ),\n    15 => shape(\n      'var' => 'adaptedLongDefault',\n      'type' => \\TType::I64,\n    ),\n    16 => shape(\n      'var' => 'adaptedDoubleDefault',\n      'type' => \\TType::DOUBLE,\n    ),\n    17 => shape(\n      'var' => 'adaptedStringDefault',\n      'type' => \\TType::STRING,\n    ),\n    18 => shape(\n      'var' => 'adaptedEnum',\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\test\\ThriftAdaptedEnum::class,\n    ),\n    19 => shape(\n      'var' => 'adaptedListDefault',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I64,\n      'elem' => shape(\n        'type' => \\TType::I64,\n      ),\n      'format' => 'collection',\n    ),\n    20 => shape(\n      'var' => 'adaptedSetDefault',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I64,\n      'elem' => shape(\n        'type' => \\TType::I64,\n      ),\n      'format' => 'collection',\n    ),\n    21 => shape(\n      'var' => 'adaptedMapDefault',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I64,\n      'vtype' => \\TType::I64,\n      'key' => shape(\n        'type' => \\TType::I64,\n      ),\n      'val' => shape(\n        'type' => \\TType::I64,\n      ),\n      'format' => 'collection',\n    ),\n    22 => shape(\n      'var' => 'doubleTypedefBool',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'adaptedBool' => 1,\n    'adaptedByte' => 2,\n    'adaptedShort' => 3,\n    'adaptedInteger' => 4,\n    'adaptedLong' => 5,\n    'adaptedDouble' => 6,\n    'adaptedString' => 7,\n    'adaptedList' => 8,\n    'adaptedSet' => 9,\n    'adaptedMap' => 10,\n    'adaptedBoolDefault' => 11,\n    'adaptedByteDefault' => 12,\n    'adaptedShortDefault' => 13,\n    'adaptedIntegerDefault' => 14,\n    'adaptedLongDefault' => 15,\n    'adaptedDoubleDefault' => 16,\n    'adaptedStringDefault' => 17,\n    'adaptedEnum' => 18,\n    'adaptedListDefault' => 19,\n    'adaptedSetDefault' => 20,\n    'adaptedMapDefault' => 21,\n    'doubleTypedefBool' => 22,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'adaptedBool' => ?\\facebook\\thrift\\test\\AdaptedBool,\n    ?'adaptedByte' => ?\\facebook\\thrift\\test\\AdaptedByte,\n    ?'adaptedShort' => ?\\facebook\\thrift\\test\\AdaptedShort,\n    ?'adaptedInteger' => ?\\facebook\\thrift\\test\\AdaptedInteger,\n    ?'adaptedLong' => ?\\facebook\\thrift\\test\\AdaptedLong,\n    ?'adaptedDouble' => ?\\facebook\\thrift\\test\\AdaptedDouble,\n    ?'adaptedString' => ?\\facebook\\thrift\\test\\AdaptedString,\n    ?'adaptedList' => ?Vector<int>,\n    ?'adaptedSet' => ?Set<int>,\n    ?'adaptedMap' => ?Map<int, int>,\n    ?'adaptedBoolDefault' => ?\\facebook\\thrift\\test\\AdaptedBool,\n    ?'adaptedByteDefault' => ?\\facebook\\thrift\\test\\AdaptedByte,\n    ?'adaptedShortDefault' => ?\\facebook\\thrift\\test\\AdaptedShort,\n    ?'adaptedIntegerDefault' => ?\\facebook\\thrift\\test\\AdaptedInteger,\n    ?'adaptedLongDefault' => ?\\facebook\\thrift\\test\\AdaptedLong,\n    ?'adaptedDoubleDefault' => ?\\facebook\\thrift\\test\\AdaptedDouble,\n    ?'adaptedStringDefault' => ?\\facebook\\thrift\\test\\AdaptedString,\n    ?'adaptedEnum' => ?\\facebook\\thrift\\test\\AdaptedEnum,\n    ?'adaptedListDefault' => ?Vector<int>,\n    ?'adaptedSetDefault' => ?Set<int>,\n    ?'adaptedMapDefault' => ?Map<int, int>,\n    ?'doubleTypedefBool' => ?\\facebook\\thrift\\test\\DoubleTypedefBool,\n  );\n\n  const type TShape = shape(\n    'adaptedBool' => \\facebook\\thrift\\test\\AdaptedBool,\n    'adaptedByte' => \\facebook\\thrift\\test\\AdaptedByte,\n    'adaptedShort' => \\facebook\\thrift\\test\\AdaptedShort,\n    'adaptedInteger' => \\facebook\\thrift\\test\\AdaptedInteger,\n    'adaptedLong' => \\facebook\\thrift\\test\\AdaptedLong,\n    'adaptedDouble' => \\facebook\\thrift\\test\\AdaptedDouble,\n    'adaptedString' => \\facebook\\thrift\\test\\AdaptedString,\n    'adaptedList' => vec<int>,\n    'adaptedSet' => dict<int, bool>,\n    'adaptedMap' => dict<int, int>,\n    'adaptedBoolDefault' => \\facebook\\thrift\\test\\AdaptedBool,\n    'adaptedByteDefault' => \\facebook\\thrift\\test\\AdaptedByte,\n    'adaptedShortDefault' => \\facebook\\thrift\\test\\AdaptedShort,\n    'adaptedIntegerDefault' => \\facebook\\thrift\\test\\AdaptedInteger,\n    'adaptedLongDefault' => \\facebook\\thrift\\test\\AdaptedLong,\n    'adaptedDoubleDefault' => \\facebook\\thrift\\test\\AdaptedDouble,\n    'adaptedStringDefault' => \\facebook\\thrift\\test\\AdaptedString,\n    ?'adaptedEnum' => ?\\facebook\\thrift\\test\\AdaptedEnum,\n    'adaptedListDefault' => vec<int>,\n    'adaptedSetDefault' => dict<int, bool>,\n    'adaptedMapDefault' => dict<int, int>,\n    'doubleTypedefBool' => \\facebook\\thrift\\test\\DoubleTypedefBool,\n  );\n  const int STRUCTURAL_ID = 1552800196824590900;\n  /**\n   * Original thrift field:-\n   * 1: module.AdaptedBool adaptedBool\n   */\n  public \\facebook\\thrift\\test\\AdaptedBool $adaptedBool;\n  /**\n   * Original thrift field:-\n   * 2: module.AdaptedByte adaptedByte\n   */\n  public \\facebook\\thrift\\test\\AdaptedByte $adaptedByte;\n  /**\n   * Original thrift field:-\n   * 3: module.AdaptedShort adaptedShort\n   */\n  public \\facebook\\thrift\\test\\AdaptedShort $adaptedShort;\n  /**\n   * Original thrift field:-\n   * 4: module.AdaptedInteger adaptedInteger\n   */\n  public \\facebook\\thrift\\test\\AdaptedInteger $adaptedInteger;\n  /**\n   * Original thrift field:-\n   * 5: module.AdaptedLong adaptedLong\n   */\n  public \\facebook\\thrift\\test\\AdaptedLong $adaptedLong;\n  /**\n   * Original thrift field:-\n   * 6: module.AdaptedDouble adaptedDouble\n   */\n  public \\facebook\\thrift\\test\\AdaptedDouble $adaptedDouble;\n  /**\n   * Original thrift field:-\n   * 7: module.AdaptedString adaptedString\n   */\n  public \\facebook\\thrift\\test\\AdaptedString $adaptedString;\n  /**\n   * Original thrift field:-\n   * 8: list<i64> adaptedList\n   */\n  public Vector<int> $adaptedList;\n  /**\n   * Original thrift field:-\n   * 9: set<i64> adaptedSet\n   */\n  public Set<int> $adaptedSet;\n  /**\n   * Original thrift field:-\n   * 10: map<i64, i64> adaptedMap\n   */\n  public Map<int, int> $adaptedMap;\n  /**\n   * Original thrift field:-\n   * 11: module.AdaptedBool adaptedBoolDefault\n   */\n  public \\facebook\\thrift\\test\\AdaptedBool $adaptedBoolDefault;\n  /**\n   * Original thrift field:-\n   * 12: module.AdaptedByte adaptedByteDefault\n   */\n  public \\facebook\\thrift\\test\\AdaptedByte $adaptedByteDefault;\n  /**\n   * Original thrift field:-\n   * 13: module.AdaptedShort adaptedShortDefault\n   */\n  public \\facebook\\thrift\\test\\AdaptedShort $adaptedShortDefault;\n  /**\n   * Original thrift field:-\n   * 14: module.AdaptedInteger adaptedIntegerDefault\n   */\n  public \\facebook\\thrift\\test\\AdaptedInteger $adaptedIntegerDefault;\n  /**\n   * Original thrift field:-\n   * 15: module.AdaptedLong adaptedLongDefault\n   */\n  public \\facebook\\thrift\\test\\AdaptedLong $adaptedLongDefault;\n  /**\n   * Original thrift field:-\n   * 16: module.AdaptedDouble adaptedDoubleDefault\n   */\n  public \\facebook\\thrift\\test\\AdaptedDouble $adaptedDoubleDefault;\n  /**\n   * Original thrift field:-\n   * 17: module.AdaptedString adaptedStringDefault\n   */\n  public \\facebook\\thrift\\test\\AdaptedString $adaptedStringDefault;\n  /**\n   * Original thrift field:-\n   * 18: module.AdaptedEnum adaptedEnum\n   */\n  public ?\\facebook\\thrift\\test\\AdaptedEnum $adaptedEnum;\n  /**\n   * Original thrift field:-\n   * 19: list<i64> adaptedListDefault\n   */\n  public Vector<int> $adaptedListDefault;\n  /**\n   * Original thrift field:-\n   * 20: set<i64> adaptedSetDefault\n   */\n  public Set<int> $adaptedSetDefault;\n  /**\n   * Original thrift field:-\n   * 21: map<i64, i64> adaptedMapDefault\n   */\n  public Map<int, int> $adaptedMapDefault;\n  /**\n   * Original thrift field:-\n   * 22: module.DoubleTypedefBool doubleTypedefBool\n   */\n  public \\facebook\\thrift\\test\\DoubleTypedefBool $doubleTypedefBool;\n\n  public function __construct(?\\facebook\\thrift\\test\\AdaptedBool $adaptedBool = null, ?\\facebook\\thrift\\test\\AdaptedByte $adaptedByte = null, ?\\facebook\\thrift\\test\\AdaptedShort $adaptedShort = null, ?\\facebook\\thrift\\test\\AdaptedInteger $adaptedInteger = null, ?\\facebook\\thrift\\test\\AdaptedLong $adaptedLong = null, ?\\facebook\\thrift\\test\\AdaptedDouble $adaptedDouble = null, ?\\facebook\\thrift\\test\\AdaptedString $adaptedString = null, ?Vector<int> $adaptedList = null, ?Set<int> $adaptedSet = null, ?Map<int, int> $adaptedMap = null, ?\\facebook\\thrift\\test\\AdaptedBool $adaptedBoolDefault = null, ?\\facebook\\thrift\\test\\AdaptedByte $adaptedByteDefault = null, ?\\facebook\\thrift\\test\\AdaptedShort $adaptedShortDefault = null, ?\\facebook\\thrift\\test\\AdaptedInteger $adaptedIntegerDefault = null, ?\\facebook\\thrift\\test\\AdaptedLong $adaptedLongDefault = null, ?\\facebook\\thrift\\test\\AdaptedDouble $adaptedDoubleDefault = null, ?\\facebook\\thrift\\test\\AdaptedString $adaptedStringDefault = null, ?\\facebook\\thrift\\test\\AdaptedEnum $adaptedEnum = null, ?Vector<int> $adaptedListDefault = null, ?Set<int> $adaptedSetDefault = null, ?Map<int, int> $adaptedMapDefault = null, ?\\facebook\\thrift\\test\\DoubleTypedefBool $doubleTypedefBool = null)[] {\n    $this->adaptedBool = $adaptedBool ?? false;\n    $this->adaptedByte = $adaptedByte ?? 0;\n    $this->adaptedShort = $adaptedShort ?? 0;\n    $this->adaptedInteger = $adaptedInteger ?? 0;\n    $this->adaptedLong = $adaptedLong ?? 0;\n    $this->adaptedDouble = $adaptedDouble ?? 0.0;\n    $this->adaptedString = $adaptedString ?? '';\n    $this->adaptedList = $adaptedList ?? Vector {};\n    $this->adaptedSet = $adaptedSet ?? Set {};\n    $this->adaptedMap = $adaptedMap ?? Map {};\n    $this->adaptedBoolDefault = $adaptedBoolDefault ?? true;\n    $this->adaptedByteDefault = $adaptedByteDefault ?? 1;\n    $this->adaptedShortDefault = $adaptedShortDefault ?? 2;\n    $this->adaptedIntegerDefault = $adaptedIntegerDefault ?? 3;\n    $this->adaptedLongDefault = $adaptedLongDefault ?? 4;\n    $this->adaptedDoubleDefault = $adaptedDoubleDefault ?? 5.0;\n    $this->adaptedStringDefault = $adaptedStringDefault ?? \"6\";\n    $this->adaptedEnum = $adaptedEnum ?? \\facebook\\thrift\\test\\ThriftAdaptedEnum::One;\n    $this->adaptedListDefault = $adaptedListDefault ?? Vector {\n      1,\n    };\n    $this->adaptedSetDefault = $adaptedSetDefault ?? Set {\n      1,\n    };\n    $this->adaptedMapDefault = $adaptedMapDefault ?? Map {\n      1 => 1,\n    };\n    $this->doubleTypedefBool = $doubleTypedefBool ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'adaptedBool'),\n      Shapes::idx($shape, 'adaptedByte'),\n      Shapes::idx($shape, 'adaptedShort'),\n      Shapes::idx($shape, 'adaptedInteger'),\n      Shapes::idx($shape, 'adaptedLong'),\n      Shapes::idx($shape, 'adaptedDouble'),\n      Shapes::idx($shape, 'adaptedString'),\n      Shapes::idx($shape, 'adaptedList'),\n      Shapes::idx($shape, 'adaptedSet'),\n      Shapes::idx($shape, 'adaptedMap'),\n      Shapes::idx($shape, 'adaptedBoolDefault'),\n      Shapes::idx($shape, 'adaptedByteDefault'),\n      Shapes::idx($shape, 'adaptedShortDefault'),\n      Shapes::idx($shape, 'adaptedIntegerDefault'),\n      Shapes::idx($shape, 'adaptedLongDefault'),\n      Shapes::idx($shape, 'adaptedDoubleDefault'),\n      Shapes::idx($shape, 'adaptedStringDefault'),\n      Shapes::idx($shape, 'adaptedEnum'),\n      Shapes::idx($shape, 'adaptedListDefault'),\n      Shapes::idx($shape, 'adaptedSetDefault'),\n      Shapes::idx($shape, 'adaptedMapDefault'),\n      Shapes::idx($shape, 'doubleTypedefBool'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AdaptTemplatedTestStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.AdaptTemplatedTestStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedBool\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedBool\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedByte\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedByte\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedShort\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedShort\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedInteger\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedInteger\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedLong\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedLong\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedDouble\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedDouble\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedString\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedString\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedList\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedSet\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 10,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedMap\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 11,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedBool\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedBoolDefault\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 12,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedByte\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedByteDefault\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 13,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedShort\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedShortDefault\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 14,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedInteger\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedIntegerDefault\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 15,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedLong\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedLongDefault\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 16,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedDouble\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedDoubleDefault\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 17,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedString\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedStringDefault\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 18,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedEnum\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                            shape(\n                              \"name\" => \"module.ThriftAdaptedEnum\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedEnum\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 19,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedListDefault\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 20,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedSetDefault\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 21,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedMapDefault\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 22,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.DoubleTypedefBool\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.AdaptedBool\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"doubleTypedefBool\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'adaptedBool' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'adaptedByte' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'adaptedShort' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'adaptedInteger' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'adaptedLong' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'adaptedDouble' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'adaptedString' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'adaptedList' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'adaptedSet' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'adaptedMap' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'adaptedBoolDefault' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'adaptedByteDefault' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'adaptedShortDefault' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'adaptedIntegerDefault' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'adaptedLongDefault' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'adaptedDoubleDefault' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'adaptedStringDefault' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'adaptedEnum' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::StaticCastAdapter<::apache::thrift::test::basic::AdaptedEnum, ::apache::thrift::test::basic::ThriftAdaptedEnum>\",\n              )\n            ),\n          ],\n        ),\n        'adaptedListDefault' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::fbthrift_adapters::test::TestAdapter\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'adaptedSetDefault' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::fbthrift_adapters::test::TestAdapter\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'adaptedMapDefault' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\rust\\Adapter' => \\facebook\\thrift\\annotation\\rust\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::fbthrift_adapters::test::TestAdapter\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['adaptedBool'],\n      $shape['adaptedByte'],\n      $shape['adaptedShort'],\n      $shape['adaptedInteger'],\n      $shape['adaptedLong'],\n      $shape['adaptedDouble'],\n      $shape['adaptedString'],\n      $shape['adaptedList'] |> new Vector($$),\n      new Set(Keyset\\keys($shape['adaptedSet'])),\n      $shape['adaptedMap'] |> new Map($$),\n      $shape['adaptedBoolDefault'],\n      $shape['adaptedByteDefault'],\n      $shape['adaptedShortDefault'],\n      $shape['adaptedIntegerDefault'],\n      $shape['adaptedLongDefault'],\n      $shape['adaptedDoubleDefault'],\n      $shape['adaptedStringDefault'],\n      Shapes::idx($shape, 'adaptedEnum'),\n      $shape['adaptedListDefault'] |> new Vector($$),\n      new Set(Keyset\\keys($shape['adaptedSetDefault'])),\n      $shape['adaptedMapDefault'] |> new Map($$),\n      $shape['doubleTypedefBool'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'adaptedBool' => $this->adaptedBool,\n      'adaptedByte' => $this->adaptedByte,\n      'adaptedShort' => $this->adaptedShort,\n      'adaptedInteger' => $this->adaptedInteger,\n      'adaptedLong' => $this->adaptedLong,\n      'adaptedDouble' => $this->adaptedDouble,\n      'adaptedString' => $this->adaptedString,\n      'adaptedList' => vec($this->adaptedList),\n      'adaptedSet' => ThriftUtil::toDArray(Dict\\fill_keys($this->adaptedSet->toValuesArray(), true), static::class),\n      'adaptedMap' => dict($this->adaptedMap),\n      'adaptedBoolDefault' => $this->adaptedBoolDefault,\n      'adaptedByteDefault' => $this->adaptedByteDefault,\n      'adaptedShortDefault' => $this->adaptedShortDefault,\n      'adaptedIntegerDefault' => $this->adaptedIntegerDefault,\n      'adaptedLongDefault' => $this->adaptedLongDefault,\n      'adaptedDoubleDefault' => $this->adaptedDoubleDefault,\n      'adaptedStringDefault' => $this->adaptedStringDefault,\n      'adaptedEnum' => $this->adaptedEnum,\n      'adaptedListDefault' => vec($this->adaptedListDefault),\n      'adaptedSetDefault' => ThriftUtil::toDArray(Dict\\fill_keys($this->adaptedSetDefault->toValuesArray(), true), static::class),\n      'adaptedMapDefault' => dict($this->adaptedMapDefault),\n      'doubleTypedefBool' => $this->doubleTypedefBool,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'adaptedBool') !== null) {\n      $this->adaptedBool = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedBool>($parsed['adaptedBool']);\n    }\n    if (idx($parsed, 'adaptedByte') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedByte>($parsed['adaptedByte']);\n      if ($_tmp0 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->adaptedByte = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'adaptedShort') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedShort>($parsed['adaptedShort']);\n      if ($_tmp1 > 0x7fff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->adaptedShort = (int)$_tmp1;\n      }\n    }\n    if (idx($parsed, 'adaptedInteger') !== null) {\n      $_tmp2 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedInteger>($parsed['adaptedInteger']);\n      if ($_tmp2 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->adaptedInteger = (int)$_tmp2;\n      }\n    }\n    if (idx($parsed, 'adaptedLong') !== null) {\n      $this->adaptedLong = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedLong>($parsed['adaptedLong']);\n    }\n    if (idx($parsed, 'adaptedDouble') !== null) {\n      $this->adaptedDouble = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedDouble>($parsed['adaptedDouble']);\n    }\n    if (idx($parsed, 'adaptedString') !== null) {\n      $this->adaptedString = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedString>($parsed['adaptedString']);\n    }\n    if (idx($parsed, 'adaptedList') !== null) {\n      $_json6 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['adaptedList']);\n      $_container7 = Vector {};\n      foreach($_json6 as $_key4 => $_value5) {\n        $_elem8 = 0;\n        $_elem8 = $_value5;\n        $_container7 []= $_elem8;\n      }\n      $this->adaptedList = $_container7;\n    }\n    if (idx($parsed, 'adaptedSet') !== null) {\n      $_json12 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['adaptedSet']);\n      $_container13 = Set {};\n      foreach($_json12 as $_key10 => $_value11) {\n        $_elem14 = 0;\n        $_elem14 = $_value11;\n        $_container13->add($_elem14);\n      }\n      $this->adaptedSet = $_container13;\n    }\n    if (idx($parsed, 'adaptedMap') !== null) {\n      $_json18 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, int>>($parsed['adaptedMap']);\n      $_container19 = Map {};\n      foreach($_json18 as $_key16 => $_value17) {\n        $_value20 = 0;\n        $_value20 = $_value17;\n        $_container19[$_key16] = $_value20;\n      }\n      $this->adaptedMap = $_container19;\n    }\n    if (idx($parsed, 'adaptedBoolDefault') !== null) {\n      $this->adaptedBoolDefault = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedBool>($parsed['adaptedBoolDefault']);\n    }\n    if (idx($parsed, 'adaptedByteDefault') !== null) {\n      $_tmp21 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedByte>($parsed['adaptedByteDefault']);\n      if ($_tmp21 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->adaptedByteDefault = (int)$_tmp21;\n      }\n    }\n    if (idx($parsed, 'adaptedShortDefault') !== null) {\n      $_tmp22 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedShort>($parsed['adaptedShortDefault']);\n      if ($_tmp22 > 0x7fff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->adaptedShortDefault = (int)$_tmp22;\n      }\n    }\n    if (idx($parsed, 'adaptedIntegerDefault') !== null) {\n      $_tmp23 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedInteger>($parsed['adaptedIntegerDefault']);\n      if ($_tmp23 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->adaptedIntegerDefault = (int)$_tmp23;\n      }\n    }\n    if (idx($parsed, 'adaptedLongDefault') !== null) {\n      $this->adaptedLongDefault = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedLong>($parsed['adaptedLongDefault']);\n    }\n    if (idx($parsed, 'adaptedDoubleDefault') !== null) {\n      $this->adaptedDoubleDefault = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedDouble>($parsed['adaptedDoubleDefault']);\n    }\n    if (idx($parsed, 'adaptedStringDefault') !== null) {\n      $this->adaptedStringDefault = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedString>($parsed['adaptedStringDefault']);\n    }\n    if (idx($parsed, 'adaptedEnum') !== null) {\n      $this->adaptedEnum = \\facebook\\thrift\\test\\ThriftAdaptedEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedEnum>($parsed['adaptedEnum']));\n    }\n    if (idx($parsed, 'adaptedListDefault') !== null) {\n      $_json27 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['adaptedListDefault']);\n      $_container28 = Vector {};\n      foreach($_json27 as $_key25 => $_value26) {\n        $_elem29 = 0;\n        $_elem29 = $_value26;\n        $_container28 []= $_elem29;\n      }\n      $this->adaptedListDefault = $_container28;\n    }\n    if (idx($parsed, 'adaptedSetDefault') !== null) {\n      $_json33 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['adaptedSetDefault']);\n      $_container34 = Set {};\n      foreach($_json33 as $_key31 => $_value32) {\n        $_elem35 = 0;\n        $_elem35 = $_value32;\n        $_container34->add($_elem35);\n      }\n      $this->adaptedSetDefault = $_container34;\n    }\n    if (idx($parsed, 'adaptedMapDefault') !== null) {\n      $_json39 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, int>>($parsed['adaptedMapDefault']);\n      $_container40 = Map {};\n      foreach($_json39 as $_key37 => $_value38) {\n        $_value41 = 0;\n        $_value41 = $_value38;\n        $_container40[$_key37] = $_value41;\n      }\n      $this->adaptedMapDefault = $_container40;\n    }\n    if (idx($parsed, 'doubleTypedefBool') !== null) {\n      $this->doubleTypedefBool = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\DoubleTypedefBool>($parsed['doubleTypedefBool']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * AdaptTemplatedNestedTestStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/AdaptTemplatedNestedTestStruct'))>>\nclass AdaptTemplatedNestedTestStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'adaptedStruct',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\AdaptTemplatedTestStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'adaptedStruct' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'adaptedStruct' => ?\\facebook\\thrift\\test\\AdaptTemplatedTestStruct,\n  );\n\n  const type TShape = shape(\n    ?'adaptedStruct' => ?\\facebook\\thrift\\test\\AdaptTemplatedTestStruct::TShape,\n  );\n  const int STRUCTURAL_ID = 7684145159661226586;\n  /**\n   * Original thrift field:-\n   * 1: module.AdaptTemplatedTestStruct adaptedStruct\n   */\n  public ?\\facebook\\thrift\\test\\AdaptTemplatedTestStruct $adaptedStruct;\n\n  public function __construct(?\\facebook\\thrift\\test\\AdaptTemplatedTestStruct $adaptedStruct = null)[] {\n    $this->adaptedStruct = $adaptedStruct;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'adaptedStruct'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AdaptTemplatedNestedTestStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.AdaptTemplatedNestedTestStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptTemplatedTestStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedStruct\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'adaptedStruct') === null ? null : (\\facebook\\thrift\\test\\AdaptTemplatedTestStruct::__fromShape($shape['adaptedStruct'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'adaptedStruct' => $this->adaptedStruct?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'adaptedStruct') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptTemplatedTestStruct>($parsed['adaptedStruct']));\n      $_tmp1 = \\facebook\\thrift\\test\\AdaptTemplatedTestStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->adaptedStruct = $_tmp1;\n    }\n  }\n\n}\n\nenum AdaptTestUnionEnum: int {\n  _EMPTY_ = 0;\n  delay = 1;\n  custom = 2;\n}\n\n/**\n * Original thrift struct:-\n * AdaptTestUnion\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/AdaptTestUnion'))>>\nclass AdaptTestUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<\\facebook\\thrift\\test\\AdaptTestUnionEnum>, \\IThriftShapishSyncStruct {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'delay',\n      'union' => true,\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'custom',\n      'union' => true,\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'delay' => 1,\n    'custom' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'delay' => ?\\facebook\\thrift\\test\\DurationMs,\n    ?'custom' => ?\\facebook\\thrift\\test\\CustomProtocolType,\n  );\n\n  const type TShape = shape(\n    ?'delay' => ?\\facebook\\thrift\\test\\DurationMs,\n    ?'custom' => ?\\facebook\\thrift\\test\\CustomProtocolType,\n  );\n  const int STRUCTURAL_ID = 7327808847999377042;\n  /**\n   * Original thrift field:-\n   * 1: module.DurationMs delay\n   */\n  public ?\\facebook\\thrift\\test\\DurationMs $delay;\n  /**\n   * Original thrift field:-\n   * 2: module.CustomProtocolType custom\n   */\n  public ?\\facebook\\thrift\\test\\CustomProtocolType $custom;\n  protected \\facebook\\thrift\\test\\AdaptTestUnionEnum $_type = \\facebook\\thrift\\test\\AdaptTestUnionEnum::_EMPTY_;\n\n  public function __construct(?\\facebook\\thrift\\test\\DurationMs $delay = null, ?\\facebook\\thrift\\test\\CustomProtocolType $custom = null)[] {\n    $this->_type = \\facebook\\thrift\\test\\AdaptTestUnionEnum::_EMPTY_;\n    if ($delay !== null) {\n      $this->delay = $delay;\n      $this->_type = \\facebook\\thrift\\test\\AdaptTestUnionEnum::delay;\n    }\n    if ($custom !== null) {\n      $this->custom = $custom;\n      $this->_type = \\facebook\\thrift\\test\\AdaptTestUnionEnum::custom;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'delay'),\n      Shapes::idx($shape, 'custom'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AdaptTestUnion';\n  }\n\n  public function getType()[]: \\facebook\\thrift\\test\\AdaptTestUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case \\facebook\\thrift\\test\\AdaptTestUnionEnum::delay:\n        $this->delay = null;\n        break;\n      case \\facebook\\thrift\\test\\AdaptTestUnionEnum::custom:\n        $this->custom = null;\n        break;\n      case \\facebook\\thrift\\test\\AdaptTestUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = \\facebook\\thrift\\test\\AdaptTestUnionEnum::_EMPTY_;\n  }\n\n  public function set_delay(\\facebook\\thrift\\test\\DurationMs $delay)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\AdaptTestUnionEnum::delay;\n    $this->delay = $delay;\n    return $this;\n  }\n\n  public function get_delay()[]: ?\\facebook\\thrift\\test\\DurationMs {\n    return $this->delay;\n  }\n\n  public function getx_delay()[]: \\facebook\\thrift\\test\\DurationMs {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\AdaptTestUnionEnum::delay,\n      'get_delay called on an instance of AdaptTestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->delay as nonnull;\n  }\n\n  public function set_custom(\\facebook\\thrift\\test\\CustomProtocolType $custom)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\AdaptTestUnionEnum::custom;\n    $this->custom = $custom;\n    return $this;\n  }\n\n  public function get_custom()[]: ?\\facebook\\thrift\\test\\CustomProtocolType {\n    return $this->custom;\n  }\n\n  public function getx_custom()[]: \\facebook\\thrift\\test\\CustomProtocolType {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\AdaptTestUnionEnum::custom,\n      'get_custom called on an instance of AdaptTestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->custom as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.AdaptTestUnion\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.DurationMs\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"delay\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.CustomProtocolType\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"custom\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'delay' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::AdaptTestMsAdapter\",\n              )\n            ),\n          ],\n        ),\n        'custom' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::CustomProtocolAdapter\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'delay'),\n      Shapes::idx($shape, 'custom'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'delay' => $this->delay,\n      'custom' => $this->custom,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = \\facebook\\thrift\\test\\AdaptTestUnionEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'delay') !== null) {\n      $this->delay = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\DurationMs>($parsed['delay']);\n      $this->_type = \\facebook\\thrift\\test\\AdaptTestUnionEnum::delay;\n    }\n    if (idx($parsed, 'custom') !== null) {\n      $this->custom = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\CustomProtocolType>($parsed['custom']);\n      $this->_type = \\facebook\\thrift\\test\\AdaptTestUnionEnum::custom;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * AdaptedStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/AdaptedStruct'))>>\nclass AdaptedStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'data',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'data' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'data' => ?int,\n  );\n\n  const type TShape = shape(\n    'data' => int,\n  );\n  const int STRUCTURAL_ID = 3905817191290553362;\n  /**\n   * Original thrift field:-\n   * 1: i64 data\n   */\n  public int $data;\n\n  public function __construct(?int $data = null)[] {\n    $this->data = $data ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'data'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AdaptedStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.AdaptedStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"data\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['data'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'data' => $this->data,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'data') !== null) {\n      $this->data = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['data']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * DirectlyAdaptedStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/DirectlyAdaptedStruct'))>>\nclass DirectlyAdaptedStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'data',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'data' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'data' => ?int,\n  );\n\n  const type TShape = shape(\n    'data' => int,\n  );\n  const int STRUCTURAL_ID = 3905817191290553362;\n  /**\n   * Original thrift field:-\n   * 1: i64 data\n   */\n  public int $data;\n\n  public function __construct(?int $data = null)[] {\n    $this->data = $data ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'data'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'DirectlyAdaptedStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.DirectlyAdaptedStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"data\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['data'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'data' => $this->data,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'data') !== null) {\n      $this->data = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['data']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructFieldAdaptedStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/StructFieldAdaptedStruct'))>>\nclass StructFieldAdaptedStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'adaptedStruct',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\AdaptedStruct::class,\n    ),\n    2 => shape(\n      'var' => 'adaptedTypedef',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\AdaptedStruct::class,\n    ),\n    3 => shape(\n      'var' => 'directlyAdapted',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\DirectlyAdaptedStruct::class,\n    ),\n    4 => shape(\n      'var' => 'typedefOfAdapted',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\DirectlyAdaptedStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'adaptedStruct' => 1,\n    'adaptedTypedef' => 2,\n    'directlyAdapted' => 3,\n    'typedefOfAdapted' => 4,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'adaptedStruct' => ?\\facebook\\thrift\\test\\AdaptedStruct,\n    ?'adaptedTypedef' => ?\\facebook\\thrift\\test\\AdaptedTypedef,\n    ?'directlyAdapted' => ?\\facebook\\thrift\\test\\DirectlyAdaptedStruct,\n    ?'typedefOfAdapted' => ?\\facebook\\thrift\\test\\TypedefOfDirect,\n  );\n\n  const type TShape = shape(\n    ?'adaptedStruct' => ?\\facebook\\thrift\\test\\AdaptedStruct::TShape,\n    ?'adaptedTypedef' => ?\\facebook\\thrift\\test\\AdaptedStruct::TShape,\n    ?'directlyAdapted' => ?\\facebook\\thrift\\test\\DirectlyAdaptedStruct::TShape,\n    ?'typedefOfAdapted' => ?\\facebook\\thrift\\test\\DirectlyAdaptedStruct::TShape,\n  );\n  const int STRUCTURAL_ID = 3653783318222631819;\n  /**\n   * Original thrift field:-\n   * 1: module.AdaptedStruct adaptedStruct\n   */\n  public ?\\facebook\\thrift\\test\\AdaptedStruct $adaptedStruct;\n  /**\n   * Original thrift field:-\n   * 2: module.AdaptedTypedef adaptedTypedef\n   */\n  public ?\\facebook\\thrift\\test\\AdaptedTypedef $adaptedTypedef;\n  /**\n   * Original thrift field:-\n   * 3: module.DirectlyAdaptedStruct directlyAdapted\n   */\n  public ?\\facebook\\thrift\\test\\DirectlyAdaptedStruct $directlyAdapted;\n  /**\n   * Original thrift field:-\n   * 4: module.TypedefOfDirect typedefOfAdapted\n   */\n  public ?\\facebook\\thrift\\test\\TypedefOfDirect $typedefOfAdapted;\n\n  public function __construct(?\\facebook\\thrift\\test\\AdaptedStruct $adaptedStruct = null, ?\\facebook\\thrift\\test\\AdaptedTypedef $adaptedTypedef = null, ?\\facebook\\thrift\\test\\DirectlyAdaptedStruct $directlyAdapted = null, ?\\facebook\\thrift\\test\\TypedefOfDirect $typedefOfAdapted = null)[] {\n    $this->adaptedStruct = $adaptedStruct;\n    $this->adaptedTypedef = $adaptedTypedef;\n    $this->directlyAdapted = $directlyAdapted;\n    $this->typedefOfAdapted = $typedefOfAdapted;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'adaptedStruct'),\n      Shapes::idx($shape, 'adaptedTypedef'),\n      Shapes::idx($shape, 'directlyAdapted'),\n      Shapes::idx($shape, 'typedefOfAdapted'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructFieldAdaptedStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.StructFieldAdaptedStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedStruct\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedTypedef\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.AdaptedStruct\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"adaptedTypedef\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.DirectlyAdaptedStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"directlyAdapted\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.TypedefOfDirect\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.DirectlyAdaptedStruct\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"typedefOfAdapted\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'adaptedStruct' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'adaptedTypedef' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n        'directlyAdapted' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'adaptedStruct') === null ? null : (\\facebook\\thrift\\test\\AdaptedStruct::__fromShape($shape['adaptedStruct'])),\n      Shapes::idx($shape, 'adaptedTypedef') === null ? null : (\\facebook\\thrift\\test\\AdaptedStruct::__fromShape($shape['adaptedTypedef'])),\n      Shapes::idx($shape, 'directlyAdapted') === null ? null : (\\facebook\\thrift\\test\\DirectlyAdaptedStruct::__fromShape($shape['directlyAdapted'])),\n      Shapes::idx($shape, 'typedefOfAdapted') === null ? null : (\\facebook\\thrift\\test\\DirectlyAdaptedStruct::__fromShape($shape['typedefOfAdapted'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'adaptedStruct' => $this->adaptedStruct?->__toShape(),\n      'adaptedTypedef' => $this->adaptedTypedef?->__toShape(),\n      'directlyAdapted' => $this->directlyAdapted?->__toShape(),\n      'typedefOfAdapted' => $this->typedefOfAdapted?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'adaptedStruct') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedStruct>($parsed['adaptedStruct']));\n      $_tmp1 = \\facebook\\thrift\\test\\AdaptedStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->adaptedStruct = $_tmp1;\n    }\n    if (idx($parsed, 'adaptedTypedef') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedTypedef>($parsed['adaptedTypedef']));\n      $_tmp3 = \\facebook\\thrift\\test\\AdaptedStruct::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->adaptedTypedef = $_tmp3;\n    }\n    if (idx($parsed, 'directlyAdapted') !== null) {\n      $_tmp4 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\DirectlyAdaptedStruct>($parsed['directlyAdapted']));\n      $_tmp5 = \\facebook\\thrift\\test\\DirectlyAdaptedStruct::withDefaultValues();\n      $_tmp5->readFromJson($_tmp4);\n      $this->directlyAdapted = $_tmp5;\n    }\n    if (idx($parsed, 'typedefOfAdapted') !== null) {\n      $_tmp6 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\TypedefOfDirect>($parsed['typedefOfAdapted']));\n      $_tmp7 = \\facebook\\thrift\\test\\DirectlyAdaptedStruct::withDefaultValues();\n      $_tmp7->readFromJson($_tmp6);\n      $this->typedefOfAdapted = $_tmp7;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * CircularAdaptee\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/CircularAdaptee'))>>\nclass CircularAdaptee implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\CircularStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?\\facebook\\thrift\\test\\CircularStruct,\n  );\n\n  const type TShape = shape(\n    ?'field' => ?\\facebook\\thrift\\test\\CircularStruct::TShape,\n  );\n  const int STRUCTURAL_ID = 6453901709117171539;\n  /**\n   * Original thrift field:-\n   * 1: module.CircularStruct field\n   */\n  public ?\\facebook\\thrift\\test\\CircularStruct $field;\n\n  public function __construct(?\\facebook\\thrift\\test\\CircularStruct $field = null)[] {\n    $this->field = $field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'CircularAdaptee';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.CircularAdaptee\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.CircularStruct\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.CircularStruct\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field') === null ? null : (\\facebook\\thrift\\test\\CircularStruct::__fromShape($shape['field'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field' => $this->field?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\CircularStruct>($parsed['field']));\n      $_tmp1 = \\facebook\\thrift\\test\\CircularStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->field = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * CircularStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/CircularStruct'))>>\nclass CircularStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\CircularAdaptee::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?\\facebook\\thrift\\test\\AdaptedCircularAdaptee,\n  );\n\n  const type TShape = shape(\n    ?'field' => ?\\facebook\\thrift\\test\\CircularAdaptee::TShape,\n  );\n  const int STRUCTURAL_ID = 7977518433842367675;\n  /**\n   * Original thrift field:-\n   * 1: module.AdaptedCircularAdaptee field\n   */\n  public ?\\facebook\\thrift\\test\\AdaptedCircularAdaptee $field;\n\n  public function __construct(?\\facebook\\thrift\\test\\AdaptedCircularAdaptee $field = null)[] {\n    $this->field = $field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'CircularStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.CircularStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedCircularAdaptee\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.AdaptedCircularAdaptee\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.CircularAdaptee\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"field\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Ref' => \\facebook\\thrift\\annotation\\cpp\\Ref::fromShape(\n              shape(\n                \"type\" => \\facebook\\thrift\\annotation\\cpp\\RefType::Unique,\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::MemberAccessAdapter\",\n                \"adaptedType\" => \"::apache::thrift::test::TaggedWrapper<CircularAdaptee, CircularStruct>\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field') === null ? null : (\\facebook\\thrift\\test\\CircularAdaptee::__fromShape($shape['field'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field' => $this->field?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\AdaptedCircularAdaptee>($parsed['field']));\n      $_tmp1 = \\facebook\\thrift\\test\\CircularAdaptee::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->field = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ReorderedStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/ReorderedStruct'))>>\nclass ReorderedStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'reordered_dependent_adapted',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\DeclaredAfterStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'reordered_dependent_adapted' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'reordered_dependent_adapted' => ?\\facebook\\thrift\\test\\DeclaredAfterStruct,\n  );\n\n  const type TShape = shape(\n    ?'reordered_dependent_adapted' => ?\\facebook\\thrift\\test\\DeclaredAfterStruct::TShape,\n  );\n  const int STRUCTURAL_ID = 2416271555865439268;\n  /**\n   * Original thrift field:-\n   * 1: module.DeclaredAfterStruct reordered_dependent_adapted\n   */\n  public ?\\facebook\\thrift\\test\\DeclaredAfterStruct $reordered_dependent_adapted;\n\n  public function __construct(?\\facebook\\thrift\\test\\DeclaredAfterStruct $reordered_dependent_adapted = null)[] {\n    $this->reordered_dependent_adapted = $reordered_dependent_adapted;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reordered_dependent_adapted'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ReorderedStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ReorderedStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.DeclaredAfterStruct\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.DeclaredAfterStruct\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"reordered_dependent_adapted\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'reordered_dependent_adapted' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Ref' => \\facebook\\thrift\\annotation\\cpp\\Ref::fromShape(\n              shape(\n                \"type\" => \\facebook\\thrift\\annotation\\cpp\\RefType::Unique,\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::IdentityAdapter<detail::DeclaredAfterStruct>\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reordered_dependent_adapted') === null ? null : (\\facebook\\thrift\\test\\DeclaredAfterStruct::__fromShape($shape['reordered_dependent_adapted'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'reordered_dependent_adapted' => $this->reordered_dependent_adapted?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'reordered_dependent_adapted') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\DeclaredAfterStruct>($parsed['reordered_dependent_adapted']));\n      $_tmp1 = \\facebook\\thrift\\test\\DeclaredAfterStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->reordered_dependent_adapted = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * DeclaredAfterStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/DeclaredAfterStruct'))>>\nclass DeclaredAfterStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'DeclaredAfterStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.DeclaredAfterStruct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::test::IdentityAdapter<detail::DeclaredAfterStruct>\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * RenamedStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/RenamedStruct'))>>\nclass RenamedStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'data',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'data' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'data' => ?int,\n  );\n\n  const type TShape = shape(\n    'data' => int,\n  );\n  const int STRUCTURAL_ID = 3905817191290553362;\n  /**\n   * Original thrift field:-\n   * 1: i64 data\n   */\n  public int $data;\n\n  public function __construct(?int $data = null)[] {\n    $this->data = $data ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'data'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RenamedStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.RenamedStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"data\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n            \"underlyingName\" => \"UnderlyingRenamedStruct\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['data'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'data' => $this->data,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'data') !== null) {\n      $this->data = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['data']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * SameNamespaceStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/SameNamespaceStruct'))>>\nclass SameNamespaceStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'data',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'data' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'data' => ?int,\n  );\n\n  const type TShape = shape(\n    'data' => int,\n  );\n  const int STRUCTURAL_ID = 3905817191290553362;\n  /**\n   * Original thrift field:-\n   * 1: i64 data\n   */\n  public int $data;\n\n  public function __construct(?int $data = null)[] {\n    $this->data = $data ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'data'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SameNamespaceStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SameNamespaceStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"data\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n            \"underlyingName\" => \"UnderlyingSameNamespaceStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['data'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'data' => $this->data,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'data') !== null) {\n      $this->data = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['data']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * HeapAllocated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/HeapAllocated'))>>\nclass HeapAllocated implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'HeapAllocated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.HeapAllocated\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::test::MoveOnlyAdapter\",\n            \"moveOnly\" => true,\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MoveOnly\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/MoveOnly'))>>\nclass MoveOnly implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ptr',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\HeapAllocated::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ptr' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ptr' => ?\\facebook\\thrift\\test\\HeapAllocated,\n  );\n\n  const type TShape = shape(\n    ?'ptr' => ?\\facebook\\thrift\\test\\HeapAllocated::TShape,\n  );\n  const int STRUCTURAL_ID = 1105592653371346642;\n  /**\n   * Original thrift field:-\n   * 1: module.HeapAllocated ptr\n   */\n  public ?\\facebook\\thrift\\test\\HeapAllocated $ptr;\n\n  public function __construct(?\\facebook\\thrift\\test\\HeapAllocated $ptr = null)[] {\n    $this->ptr = $ptr;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ptr'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MoveOnly';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MoveOnly\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.HeapAllocated\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ptr\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'ptr' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::MoveOnlyAdapter\",\n                \"moveOnly\" => true,\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ptr') === null ? null : (\\facebook\\thrift\\test\\HeapAllocated::__fromShape($shape['ptr'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'ptr' => $this->ptr?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'ptr') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\HeapAllocated>($parsed['ptr']));\n      $_tmp1 = \\facebook\\thrift\\test\\HeapAllocated::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->ptr = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * AlsoMoveOnly\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/AlsoMoveOnly'))>>\nclass AlsoMoveOnly implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ptr',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ptr' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ptr' => ?int,\n  );\n\n  const type TShape = shape(\n    'ptr' => int,\n  );\n  const int STRUCTURAL_ID = 6708492965690058109;\n  /**\n   * Original thrift field:-\n   * 1: i64 ptr\n   */\n  public int $ptr;\n\n  public function __construct(?int $ptr = null)[] {\n    $this->ptr = $ptr ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ptr'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AlsoMoveOnly';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.AlsoMoveOnly\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"ptr\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'ptr' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::MoveOnlyAdapter\",\n                \"moveOnly\" => true,\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['ptr'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'ptr' => $this->ptr,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'ptr') !== null) {\n      $this->ptr = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['ptr']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ApplyAdapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/ApplyAdapter'))>>\nclass ApplyAdapter implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ApplyAdapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ApplyAdapter\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::test::TemplatedTestAdapter\",\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * TransitiveAdapted\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/TransitiveAdapted'))>>\nclass TransitiveAdapted implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TransitiveAdapted';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TransitiveAdapted\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\test\\ApplyAdapter' => \\facebook\\thrift\\test\\ApplyAdapter::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * CountingStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/CountingStruct'))>>\nclass CountingStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'regularInt',\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'countingInt',\n      'type' => \\TType::I64,\n    ),\n    3 => shape(\n      'var' => 'regularString',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'regularInt' => 1,\n    'countingInt' => 2,\n    'regularString' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'regularInt' => ?int,\n    ?'countingInt' => ?\\facebook\\thrift\\test\\CountingInt,\n    ?'regularString' => ?string,\n  );\n\n  const type TShape = shape(\n    ?'regularInt' => ?int,\n    ?'countingInt' => ?\\facebook\\thrift\\test\\CountingInt,\n    ?'regularString' => ?string,\n  );\n  const int STRUCTURAL_ID = 1297891124769241261;\n  /**\n   * Original thrift field:-\n   * 1: i64 regularInt\n   */\n  public ?int $regularInt;\n  /**\n   * Original thrift field:-\n   * 2: module.CountingInt countingInt\n   */\n  public ?\\facebook\\thrift\\test\\CountingInt $countingInt;\n  /**\n   * Original thrift field:-\n   * 3: string regularString\n   */\n  public ?string $regularString;\n\n  public function __construct(?int $regularInt = null, ?\\facebook\\thrift\\test\\CountingInt $countingInt = null, ?string $regularString = null)[] {\n    $this->regularInt = $regularInt;\n    $this->countingInt = $countingInt;\n    $this->regularString = $regularString;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'regularInt'),\n      Shapes::idx($shape, 'countingInt'),\n      Shapes::idx($shape, 'regularString'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'CountingStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.CountingStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"regularInt\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.CountingInt\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"countingInt\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"regularString\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'regularInt' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::CountingAdapter<false, int>\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'countingInt' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::CountingAdapter<true, int>\",\n              )\n            ),\n          ],\n        ),\n        'regularString' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::test::CountingAdapter<false, std::string>\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'regularInt'),\n      Shapes::idx($shape, 'countingInt'),\n      Shapes::idx($shape, 'regularString'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'regularInt' => $this->regularInt,\n      'countingInt' => $this->countingInt,\n      'regularString' => $this->regularString,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'regularInt') !== null) {\n      $this->regularInt = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['regularInt']);\n    }\n    if (idx($parsed, 'countingInt') !== null) {\n      $this->countingInt = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\CountingInt>($parsed['countingInt']);\n    }\n    if (idx($parsed, 'regularString') !== null) {\n      $this->regularString = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['regularString']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Person\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/Person'))>>\nclass Person implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Person';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Person\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::test::VariableAdapter\",\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Person2\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/Person2'))>>\nclass Person2 implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Person2';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Person2\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n", "num_lines": 8319}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\python;\n\n/**\n * Original thrift struct:-\n * Hidden\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/python/Hidden'))>>\nclass Hidden implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Hidden';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"python.Hidden\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Flags\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/python/Flags'))>>\nclass Flags implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Flags';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"python.Flags\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Name\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/python/Name'))>>\nclass Name implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Name';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"python.Name\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * IOBuf\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/python/IOBuf'))>>\nclass IOBuf implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'IOBuf';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"python.IOBuf\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/python/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'typeHint',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'typeHint' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'typeHint' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'typeHint' => string,\n  );\n  const int STRUCTURAL_ID = 8465306397732997722;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string typeHint\n   */\n  public string $typeHint;\n\n  public function __construct(?string $name = null, ?string $typeHint = null)[] {\n    $this->name = $name ?? '';\n    $this->typeHint = $typeHint ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'typeHint'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"python.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"typeHint\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['typeHint'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'typeHint' => $this->typeHint,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'typeHint') !== null) {\n      $this->typeHint = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['typeHint']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MarshalCapi\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/python/MarshalCapi'))>>\nclass MarshalCapi implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MarshalCapi';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"python.MarshalCapi\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 627}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\rust;\n\n/**\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/rust/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"rust.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Derive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/rust/Derive'))>>\nclass Derive implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'derives',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'derives' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'derives' => ?Vector<string>,\n  );\n\n  const type TShape = shape(\n    'derives' => vec<string>,\n  );\n  const int STRUCTURAL_ID = 365218803088477774;\n  /**\n   * Original thrift field:-\n   * 1: list<string> derives\n   */\n  public Vector<string> $derives;\n\n  public function __construct(?Vector<string> $derives = null)[] {\n    $this->derives = $derives ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'derives'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Derive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"rust.Derive\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"derives\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['derives'] |> new Vector($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'derives' => vec($this->derives),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'derives') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<string>>($parsed['derives']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = '';\n        $_elem5 = $_value2;\n        $_container4 []= $_elem5;\n      }\n      $this->derives = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ServiceExn\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/rust/ServiceExn'))>>\nclass ServiceExn implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'anyhow_to_application_exn',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'anyhow_to_application_exn' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'anyhow_to_application_exn' => ?bool,\n  );\n\n  const type TShape = shape(\n    'anyhow_to_application_exn' => bool,\n  );\n  const int STRUCTURAL_ID = 7965253136079409026;\n  /**\n   * Original thrift field:-\n   * 1: bool anyhow_to_application_exn\n   */\n  public bool $anyhow_to_application_exn;\n\n  public function __construct(?bool $anyhow_to_application_exn = null)[] {\n    $this->anyhow_to_application_exn = $anyhow_to_application_exn ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'anyhow_to_application_exn'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ServiceExn';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"rust.ServiceExn\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"anyhow_to_application_exn\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['anyhow_to_application_exn'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'anyhow_to_application_exn' => $this->anyhow_to_application_exn,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'anyhow_to_application_exn') !== null) {\n      $this->anyhow_to_application_exn = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['anyhow_to_application_exn']);\n    }\n  }\n\n}\n\n", "num_lines": 394}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1588}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\test;\n\n/**\n * Original thrift service:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/Service'))>>\ninterface ServiceAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * MyI32_4873\n   *   func(1: StringWithAdapter_7208 arg1,\n   *        2: string arg2,\n   *        3: Foo arg3);\n   */\n  public function func(\\facebook\\thrift\\test\\StringWithAdapter_7208 $arg1, string $arg2, ?\\facebook\\thrift\\test\\Foo $arg3): Awaitable<\\facebook\\thrift\\test\\MyI32_4873>;\n}\n\n/**\n * Original thrift service:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/Service'))>>\ninterface ServiceIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * MyI32_4873\n   *   func(1: StringWithAdapter_7208 arg1,\n   *        2: string arg2,\n   *        3: Foo arg3);\n   */\n  public function func(\\facebook\\thrift\\test\\StringWithAdapter_7208 $arg1, string $arg2, ?\\facebook\\thrift\\test\\Foo $arg3): \\facebook\\thrift\\test\\MyI32_4873;\n}\n\n/**\n * Original thrift service:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/Service'))>>\ninterface ServiceAsyncClientIf extends ServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/Service'))>>\ninterface ServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * MyI32_4873\n   *   func(1: StringWithAdapter_7208 arg1,\n   *        2: string arg2,\n   *        3: Foo arg3);\n   */\n  public function func(\\facebook\\thrift\\test\\StringWithAdapter_7208 $arg1, string $arg2, ?\\facebook\\thrift\\test\\Foo $arg3): Awaitable<\\facebook\\thrift\\test\\MyI32_4873>;\n}\n\n/**\n * Original thrift service:-\n * Service\n */\ntrait ServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass ServiceAsyncClient extends \\ThriftClientBase implements ServiceAsyncClientIf {\n  use ServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * MyI32_4873\n   *   func(1: StringWithAdapter_7208 arg1,\n   *        2: string arg2,\n   *        3: Foo arg3);\n   */\n  public async function func(\\facebook\\thrift\\test\\StringWithAdapter_7208 $arg1, string $arg2, ?\\facebook\\thrift\\test\\Foo $arg3): Awaitable<\\facebook\\thrift\\test\\MyI32_4873> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\facebook\\thrift\\test\\Service_func_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n      'arg3' => $arg3,\n    ));\n    await $this->asyncHandler_->genBefore(\"Service\", \"func\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"func\", false);\n    return await $this->genAwaitResponse(\\facebook\\thrift\\test\\Service_func_result::class, \"func\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass ServiceClient extends \\ThriftClientBase implements ServiceClientIf {\n  use ServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * MyI32_4873\n   *   func(1: StringWithAdapter_7208 arg1,\n   *        2: string arg2,\n   *        3: Foo arg3);\n   */\n  public async function func(\\facebook\\thrift\\test\\StringWithAdapter_7208 $arg1, string $arg2, ?\\facebook\\thrift\\test\\Foo $arg3): Awaitable<\\facebook\\thrift\\test\\MyI32_4873> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\facebook\\thrift\\test\\Service_func_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n      'arg3' => $arg3,\n    ));\n    await $this->asyncHandler_->genBefore(\"Service\", \"func\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"func\", false);\n    return await $this->genAwaitResponse(\\facebook\\thrift\\test\\Service_func_result::class, \"func\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_func(\\facebook\\thrift\\test\\StringWithAdapter_7208 $arg1, string $arg2, ?\\facebook\\thrift\\test\\Foo $arg3): int {\n    $args = \\facebook\\thrift\\test\\Service_func_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n      'arg3' => $arg3,\n    ));\n    return $this->sendImplHelper($args, \"func\", false);\n  }\n  public function recv_func(?int $expectedsequenceid = null): \\facebook\\thrift\\test\\MyI32_4873 {\n    return $this->recvImplHelper(\\facebook\\thrift\\test\\Service_func_result::class, \"func\", false, $expectedsequenceid);\n  }\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass Service_func_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'arg1',\n      'adapter' => \\Adapter1::class,\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'arg2',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'arg3',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\Foo::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'arg1' => 1,\n    'arg2' => 2,\n    'arg3' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'arg1' => ?\\facebook\\thrift\\test\\StringWithAdapter_7208,\n    ?'arg2' => ?string,\n    ?'arg3' => ?\\facebook\\thrift\\test\\Foo,\n  );\n\n  const type TShape = shape(\n    'arg1' => \\facebook\\thrift\\test\\StringWithAdapter_7208,\n    'arg2' => string,\n    ?'arg3' => ?\\facebook\\thrift\\test\\Foo::TShape,\n  );\n  const int STRUCTURAL_ID = 1456593986927498685;\n  public \\facebook\\thrift\\test\\StringWithAdapter_7208 $arg1;\n  public string $arg2;\n  public ?\\facebook\\thrift\\test\\Foo $arg3;\n\n  public function __construct(?\\facebook\\thrift\\test\\StringWithAdapter_7208 $arg1 = null, ?string $arg2 = null, ?\\facebook\\thrift\\test\\Foo $arg3 = null)[] {\n    $this->arg1 = $arg1 ?? \\Adapter1::fromThrift('');\n    $this->arg2 = $arg2 ?? '';\n    $this->arg3 = $arg3;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'arg1'),\n      Shapes::idx($shape, 'arg2'),\n      Shapes::idx($shape, 'arg3'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service_func_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.func_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.StringWithAdapter_7208\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.StringWithAdapter_7208\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.StringWithAdapter\",\n                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.StringWithAdapter\",\n                                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                shape(\n                                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                                )\n                                              ),\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"arg1\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"arg2\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"arg3\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'arg2' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter2\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['arg1'],\n      $shape['arg2'],\n      Shapes::idx($shape, 'arg3') === null ? null : (\\facebook\\thrift\\test\\Foo::__fromShape($shape['arg3'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'arg1' => $this->arg1,\n      'arg2' => $this->arg2,\n      'arg3' => $this->arg3?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'arg1') !== null) {\n      $this->arg1 = HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\StringWithAdapter_7208>($parsed['arg1']);\n    }\n    if (idx($parsed, 'arg2') !== null) {\n      $this->arg2 = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['arg2']);\n    }\n    if (idx($parsed, 'arg3') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\Foo>($parsed['arg3']));\n      $_tmp1 = \\facebook\\thrift\\test\\Foo::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->arg3 = $_tmp1;\n    }\n  }\n\n  private static function __hackAdapterTypeChecks()[]: void {\n    \\ThriftUtil::requireSameType<\\Adapter1::TThriftType, string>();\n  }\n\n}\n\nclass Service_func_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = \\facebook\\thrift\\test\\MyI32_4873;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'adapter' => \\Adapter1::class,\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1013885591449640654;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service_func_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Service_func_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyI32_4873\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.MyI32_4873\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.MyI32\",\n                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.MyI32\",\n                                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                shape(\n                                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                                )\n                                              ),\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\MyI32_4873>($parsed['success']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->success = (int)$_tmp0;\n      }\n    }\n  }\n\n  private static function __hackAdapterTypeChecks()[]: void {\n    \\ThriftUtil::requireSameType<\\Adapter1::TThriftType, int>();\n  }\n\n}\n\nclass ServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return \\tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.Service\",\n        \"functions\" => vec[\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"func\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyI32_4873\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.MyI32_4873\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.MyI32\",\n                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.MyI32\",\n                                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                shape(\n                                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                                )\n                                              ),\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                          shape(\n                            \"name\" => \"module.StringWithAdapter_7208\",\n                            \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                  shape(\n                                    \"name\" => \"module.StringWithAdapter_7208\",\n                                    \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                          shape(\n                                            \"name\" => \"module.StringWithAdapter\",\n                                            \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                              shape(\n                                                \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                                  shape(\n                                                    \"name\" => \"module.StringWithAdapter\",\n                                                    \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                      shape(\n                                                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                                      )\n                                                    ),\n                                                  )\n                                                ),\n                                              )\n                                            ),\n                                          )\n                                        ),\n                                      )\n                                    ),\n                                  )\n                                ),\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"arg1\",\n                  )\n                ),\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                      )\n                    ),\n                    \"name\" => \"arg2\",\n                  )\n                ),\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 3,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.Foo\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"arg3\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n              'module.Foo' => \\facebook\\thrift\\test\\Foo::getStructMetadata(),\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 668}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates a definition/feature may change in incompatible ways.\n *\n * Original thrift struct:-\n * Beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Beta'))>>\nclass Beta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used with permission, may\n * only work in specific contexts, and may change in incompatible ways without\n * notice.\n *\n * Original thrift struct:-\n * Experimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Experimental'))>>\nclass Experimental implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Experimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Experimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used in an ephemeral testing\n * enviornment.\n * \n * Such enviornments only store serialized values temporarly and strictly\n * control which versions of Thrift definitions are used, so 'compatibility'\n * is not a concern.\n *\n * Original thrift struct:-\n * Testing\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Testing'))>>\nclass Testing implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Testing';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Testing\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should no longer be used.\n *\n * Original thrift struct:-\n * Deprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Deprecated'))>>\nclass Deprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const type TShape = shape(\n    'message' => string,\n  );\n  const int STRUCTURAL_ID = 2427562471238739676;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Deprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Deprecated\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['message'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'message' => $this->message,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'message') !== null) {\n      $this->message = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['message']);\n    }\n  }\n\n}\n\n/**\n * Annotate a thrift structured or enum to indicate if ids or values should not\n * be used.\n * \n * For example, you may want to mark ids as deprecated, or these ids\n * might be reserved for other use cases or annotations.\n * \n * The resolved set of disallowed ids is the union of the values in `ids` and\n * the range of values represented in `id_ranges`. Example:\n * \n *  // These ids are not allowed: 3, 8, half-open ranges [10, 15), [20, 30)\n *  @thrift.ReserveIds{ids = [3, 8], id_ranges = {10: 15, 20: 30}}\n *  struct Foo {\n *    ...\n *    3: i64 f; // Build failure: 3 cannot be used\n *  }\n *\n * Original thrift struct:-\n * ReserveIds\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ReserveIds'))>>\nclass ReserveIds implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ids',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'id_ranges',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ids' => 1,\n    'id_ranges' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ids' => ?Vector<int>,\n    ?'id_ranges' => ?Map<int, int>,\n  );\n\n  const type TShape = shape(\n    'ids' => vec<int>,\n    'id_ranges' => dict<int, int>,\n  );\n  const int STRUCTURAL_ID = 4105998268635615653;\n  /**\n   * Individual ids that cannot be used.\n   * \n   * Original thrift field:-\n   * 1: list<i32> ids\n   */\n  public Vector<int> $ids;\n  /**\n   * Represents ranges of ids that cannot be used.\n   * \n   * Each (key: value) pair represents the half-open range `[key, value)`,\n   * where `key` is included and `value` is not. For example, the map\n   * `{10: 15, 20: 30}` represents the union of id/value ranges `[10, 15)` and\n   * `[20, 30)`.\n   * \n   * Original thrift field:-\n   * 2: map<i32, i32> id_ranges\n   */\n  public Map<int, int> $id_ranges;\n\n  public function __construct(?Vector<int> $ids = null, ?Map<int, int> $id_ranges = null)[] {\n    $this->ids = $ids ?? Vector {};\n    $this->id_ranges = $id_ranges ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ids'),\n      Shapes::idx($shape, 'id_ranges'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ReserveIds';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ReserveIds\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ids\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"id_ranges\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['ids'] |> new Vector($$),\n      $shape['id_ranges'] |> new Map($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'ids' => vec($this->ids),\n      'id_ranges' => dict($this->id_ranges),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'ids') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['ids']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = 0;\n        $_tmp6 = (int)$_value2;\n        if ($_tmp6 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem5 = (int)$_tmp6;\n        }\n        $_container4 []= $_elem5;\n      }\n      $this->ids = $_container4;\n    }\n    if (idx($parsed, 'id_ranges') !== null) {\n      $_json10 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, int>>($parsed['id_ranges']);\n      $_container11 = Map {};\n      foreach($_json10 as $_key8 => $_value9) {\n        $_value12 = 0;\n        $_tmp13 = (int)$_value9;\n        if ($_tmp13 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value12 = (int)$_tmp13;\n        }\n        $_container11[$_key8] = $_value12;\n      }\n      $this->id_ranges = $_container11;\n    }\n  }\n\n}\n\n/**\n * Indicates additional backward compatibility restrictions, beyond the\n * standard Thrift required 'wire' compatibility.\n *\n * Original thrift struct:-\n * RequiresBackwardCompatibility\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RequiresBackwardCompatibility'))>>\nclass RequiresBackwardCompatibility implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field_name',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field_name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field_name' => ?bool,\n  );\n\n  const type TShape = shape(\n    'field_name' => bool,\n  );\n  const int STRUCTURAL_ID = 4755373036761315562;\n  /**\n   * Original thrift field:-\n   * 1: bool field_name\n   */\n  public bool $field_name;\n\n  public function __construct(?bool $field_name = null)[] {\n    $this->field_name = $field_name ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field_name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RequiresBackwardCompatibility';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.RequiresBackwardCompatibility\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"field_name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field_name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field_name' => $this->field_name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field_name') !== null) {\n      $this->field_name = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['field_name']);\n    }\n  }\n\n}\n\n/**\n * Disables testing features.\n *\n * Original thrift struct:-\n * NoTesting\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoTesting'))>>\nclass NoTesting implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoTesting';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoTesting\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables experimental features.\n *\n * Original thrift struct:-\n * NoExperimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoExperimental'))>>\nclass NoExperimental implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoExperimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoExperimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables @Beta features.\n *\n * Original thrift struct:-\n * NoBeta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoBeta'))>>\nclass NoBeta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoBeta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoBeta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoExperimental' => \\facebook\\thrift\\annotation\\NoExperimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature must not depend directly on an unreleased\n * or testing definition/feature.\n *\n * Original thrift struct:-\n * Released\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Released'))>>\nclass Released implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Released';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Released\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoBeta' => \\facebook\\thrift\\annotation\\NoBeta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\NoTesting' => \\facebook\\thrift\\annotation\\NoTesting::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables legacy features.\n *\n * Original thrift struct:-\n * NoLegacy\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoLegacy'))>>\nclass NoLegacy implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoLegacy';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoLegacy\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables @Deprecated features.\n * \n * Should only be enabled in `test` versions, as deprecated implies removing\n * the feature will break current usage (otherwise it would be legacy or\n * deleted).\n *\n * Original thrift struct:-\n * NoDeprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoDeprecated'))>>\nclass NoDeprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoDeprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoDeprecated\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoLegacy' => \\facebook\\thrift\\annotation\\NoLegacy::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that changes the field qualifier from 'none' to 'terse'.\n * A terse field is eligible to skip serialization, when it equals to the\n * intrinsic default value. It also clears to the intrinsic default value\n * before deserialization to distinguish between if a terse field was skipped\n * or missing during serialization. This is different from an unqualified\n * field, as an unqualified field is always serialized regardless of its value,\n * and it is not cleared before deserialization.\n * \n * The annotation can be only used to annotate an unqualified field, and when\n * it is annotating a struct or exception, it changes all unqualified fields to\n * terse fields. Note, the annotation can not be used for union.\n *\n * Original thrift struct:-\n * TerseWrite\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/TerseWrite'))>>\nclass TerseWrite implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TerseWrite';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.TerseWrite\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack.\n *\n * Original thrift struct:-\n * Box\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Box'))>>\nclass Box implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Box';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Box\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Mixin\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Mixin'))>>\nclass Mixin implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Mixin';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Mixin\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Option to serialize thrift struct in ascending field id order.\n * \n * This can potentially make serialized data size smaller in compact protocol,\n * since compact protocol can write deltas between subsequent field ids.\n *\n * Original thrift struct:-\n * SerializeInFieldIdOrder\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/SerializeInFieldIdOrder'))>>\nclass SerializeInFieldIdOrder implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SerializeInFieldIdOrder';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.SerializeInFieldIdOrder\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates an enum is a bitmask and should support bit-wise operators.\n *\n * Original thrift struct:-\n * BitmaskEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/BitmaskEnum'))>>\nclass BitmaskEnum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BitmaskEnum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.BitmaskEnum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all released v1 features.\n *\n * Original thrift struct:-\n * v1\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1'))>>\nclass v1 implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all beta v1 features.\n * \n * Beta features are guaranteed to *not* break unrelated Thrift features\n * so they should be relatively safe to test alongside other beta or\n * released Thrift features.\n *\n * Original thrift struct:-\n * v1beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1beta'))>>\nclass v1beta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1' => \\facebook\\thrift\\annotation\\v1::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all experimental v1 features.\n * \n * Use with *caution* and only with explicit permission. This may enable\n * features may change significantly without notice or not work correctly\n * in all contexts.\n *\n * Original thrift struct:-\n * v1alpha\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1alpha'))>>\nclass v1alpha implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1alpha';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1alpha\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1beta' => \\facebook\\thrift\\annotation\\v1beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\SerializeInFieldIdOrder' => \\facebook\\thrift\\annotation\\SerializeInFieldIdOrder::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables experimental features, even those that are known to break common\n * use cases.\n *\n * Original thrift struct:-\n * v1test\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1test'))>>\nclass v1test implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1test';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1test\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoDeprecated' => \\facebook\\thrift\\annotation\\NoDeprecated::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\v1alpha' => \\facebook\\thrift\\annotation\\v1alpha::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Testing' => \\facebook\\thrift\\annotation\\Testing::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Specifies the field where the exception message is stored. The field\n * is used to generate an additional method to get it.\n *\n * Original thrift struct:-\n * ExceptionMessage\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ExceptionMessage'))>>\nclass ExceptionMessage implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?string,\n  );\n\n  const type TShape = shape(\n    'field' => string,\n  );\n  const int STRUCTURAL_ID = 6158382972310209096;\n  /**\n   * Original thrift field:-\n   * 1: string field\n   */\n  public string $field;\n\n  public function __construct(?string $field = null)[] {\n    $this->field = $field ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ExceptionMessage';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ExceptionMessage\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field' => $this->field,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $this->field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['field']);\n    }\n  }\n\n}\n\n/**\n * Generates a const of type schema. Struct containing the schema of the\n * annotated type. Optionally specify name to override default\n * schema<structName>.\n *\n * Original thrift struct:-\n * GenerateRuntimeSchema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/GenerateRuntimeSchema'))>>\nclass GenerateRuntimeSchema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'GenerateRuntimeSchema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.GenerateRuntimeSchema\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack, and that\n * identical values can be shared in immutable contexts.\n *\n * Original thrift struct:-\n * InternBox\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/InternBox'))>>\nclass InternBox implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'InternBox';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.InternBox\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 2564}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift enum:-\n * Enum\n */\nenum Enum: int {\n  ENUM = 1;\n}\n\nclass Enum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.Enum\",\n        \"elements\" => dict[\n          1 => \"ENUM\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * A\n */\nclass A implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'just_an_enum',\n      'type' => \\TType::I32,\n      'enum' => Enum::class,\n    ),\n    2 => shape(\n      'var' => 'a',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'just_an_enum' => 1,\n    'a' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'just_an_enum' => ?Enum,\n    ?'a' => ?string,\n  );\n\n  const type TShape = shape(\n    ?'just_an_enum' => ?Enum,\n    'a' => string,\n  );\n  const int STRUCTURAL_ID = 4307695496151664311;\n  /**\n   * Original thrift field:-\n   * 1: module.Enum just_an_enum\n   */\n  public ?Enum $just_an_enum;\n  /**\n   * Original thrift field:-\n   * 2: string a\n   */\n  public string $a;\n\n  public function __construct(?Enum $just_an_enum = null, ?string $a = null)[] {\n    $this->just_an_enum = $just_an_enum;\n    $this->a = $a ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'just_an_enum'),\n      Shapes::idx($shape, 'a'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'A';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.A\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Enum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"just_an_enum\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'just_an_enum'),\n      $shape['a'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'just_an_enum' => $this->just_an_enum,\n      'a' => $this->a,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * B\n */\nclass B implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'map_of_string_to_string',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'harray',\n    ),\n    2 => shape(\n      'var' => 'map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'harray',\n    ),\n    3 => shape(\n      'var' => 'map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => A::class,\n      ),\n      'format' => 'harray',\n    ),\n    5 => shape(\n      'var' => 'map_of_string_to_list_of_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRUCT,\n        'elem' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    6 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    7 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    8 => shape(\n      'var' => 'map_of_string_to_list_of_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    9 => shape(\n      'var' => 'map_of_string_to_set_of_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::SET,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::SET,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    10 => shape(\n      'var' => 'list_of_string',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'harray',\n    ),\n    11 => shape(\n      'var' => 'list_of_i32',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'harray',\n    ),\n    14 => shape(\n      'var' => 'list_of_set_of_i32',\n      'type' => \\TType::LST,\n      'etype' => \\TType::SET,\n      'elem' => shape(\n        'type' => \\TType::SET,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    15 => shape(\n      'var' => 'list_of_map_of_string_to_list_of_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::LST,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::LST,\n          'etype' => \\TType::STRUCT,\n          'elem' => shape(\n            'type' => \\TType::STRUCT,\n            'class' => A::class,\n          ),\n          'format' => 'harray',\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    16 => shape(\n      'var' => 'list_of_map_of_string_to_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    17 => shape(\n      'var' => 'set_of_i32',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'harray',\n    ),\n    18 => shape(\n      'var' => 'set_of_string',\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'harray',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'map_of_string_to_string' => 1,\n    'map_of_string_to_i32' => 2,\n    'map_of_string_to_A' => 3,\n    'map_of_string_to_list_of_A' => 5,\n    'map_of_string_to_map_of_string_to_i32' => 6,\n    'map_of_string_to_map_of_string_to_A' => 7,\n    'map_of_string_to_list_of_i32' => 8,\n    'map_of_string_to_set_of_i32' => 9,\n    'list_of_string' => 10,\n    'list_of_i32' => 11,\n    'list_of_set_of_i32' => 14,\n    'list_of_map_of_string_to_list_of_A' => 15,\n    'list_of_map_of_string_to_A' => 16,\n    'set_of_i32' => 17,\n    'set_of_string' => 18,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'map_of_string_to_string' => ?dict<string, string>,\n    ?'map_of_string_to_i32' => ?dict<string, int>,\n    ?'map_of_string_to_A' => ?dict<string, A>,\n    ?'map_of_string_to_list_of_A' => ?dict<string, vec<A>>,\n    ?'map_of_string_to_map_of_string_to_i32' => ?dict<string, dict<string, int>>,\n    ?'map_of_string_to_map_of_string_to_A' => ?dict<string, dict<string, A>>,\n    ?'map_of_string_to_list_of_i32' => ?dict<string, vec<int>>,\n    ?'map_of_string_to_set_of_i32' => ?dict<string, keyset<int>>,\n    ?'list_of_string' => ?vec<string>,\n    ?'list_of_i32' => ?vec<int>,\n    ?'list_of_set_of_i32' => ?vec<keyset<int>>,\n    ?'list_of_map_of_string_to_list_of_A' => ?vec<dict<string, vec<A>>>,\n    ?'list_of_map_of_string_to_A' => ?vec<dict<string, A>>,\n    ?'set_of_i32' => ?keyset<int>,\n    ?'set_of_string' => ?keyset<string>,\n  );\n\n  const type TShape = shape(\n    'map_of_string_to_string' => dict<arraykey, string>,\n    'map_of_string_to_i32' => dict<arraykey, int>,\n    'map_of_string_to_A' => dict<arraykey, A::TShape>,\n    'map_of_string_to_list_of_A' => dict<arraykey, vec<A::TShape>>,\n    'map_of_string_to_map_of_string_to_i32' => dict<arraykey, dict<arraykey, int>>,\n    'map_of_string_to_map_of_string_to_A' => dict<arraykey, dict<arraykey, A::TShape>>,\n    'map_of_string_to_list_of_i32' => dict<arraykey, vec<int>>,\n    'map_of_string_to_set_of_i32' => dict<arraykey, keyset<int>>,\n    'list_of_string' => vec<string>,\n    'list_of_i32' => vec<int>,\n    'list_of_set_of_i32' => vec<keyset<int>>,\n    'list_of_map_of_string_to_list_of_A' => vec<dict<arraykey, vec<A::TShape>>>,\n    'list_of_map_of_string_to_A' => vec<dict<arraykey, A::TShape>>,\n    'set_of_i32' => keyset<int>,\n    'set_of_string' => keyset<string>,\n  );\n  const int STRUCTURAL_ID = 4382244206701168633;\n  /**\n   * Original thrift field:-\n   * 1: map<string, string> map_of_string_to_string\n   */\n  public dict<string, string> $map_of_string_to_string;\n  /**\n   * Original thrift field:-\n   * 2: map<string, i32> map_of_string_to_i32\n   */\n  public dict<string, int> $map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 3: map<string, module.A> map_of_string_to_A\n   */\n  public dict<string, A> $map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 5: map<string, list<module.A>> map_of_string_to_list_of_A\n   */\n  public dict<string, vec<A>> $map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 6: map<string, map<string, i32>> map_of_string_to_map_of_string_to_i32\n   */\n  public dict<string, dict<string, int>> $map_of_string_to_map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 7: map<string, map<string, module.A>> map_of_string_to_map_of_string_to_A\n   */\n  public dict<string, dict<string, A>> $map_of_string_to_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 8: map<string, list<i32>> map_of_string_to_list_of_i32\n   */\n  public dict<string, vec<int>> $map_of_string_to_list_of_i32;\n  /**\n   * Original thrift field:-\n   * 9: map<string, set<i32>> map_of_string_to_set_of_i32\n   */\n  public dict<string, keyset<int>> $map_of_string_to_set_of_i32;\n  /**\n   * Original thrift field:-\n   * 10: list<string> list_of_string\n   */\n  public vec<string> $list_of_string;\n  /**\n   * Original thrift field:-\n   * 11: list<i32> list_of_i32\n   */\n  public vec<int> $list_of_i32;\n  /**\n   * Original thrift field:-\n   * 14: list<set<i32>> list_of_set_of_i32\n   */\n  public vec<keyset<int>> $list_of_set_of_i32;\n  /**\n   * Original thrift field:-\n   * 15: list<map<string, list<module.A>>> list_of_map_of_string_to_list_of_A\n   */\n  public vec<dict<string, vec<A>>> $list_of_map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 16: list<map<string, module.A>> list_of_map_of_string_to_A\n   */\n  public vec<dict<string, A>> $list_of_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 17: set<i32> set_of_i32\n   */\n  public keyset<int> $set_of_i32;\n  /**\n   * Original thrift field:-\n   * 18: set<string> set_of_string\n   */\n  public keyset<string> $set_of_string;\n\n  public function __construct(?dict<string, string> $map_of_string_to_string = null, ?dict<string, int> $map_of_string_to_i32 = null, ?dict<string, A> $map_of_string_to_A = null, ?dict<string, vec<A>> $map_of_string_to_list_of_A = null, ?dict<string, dict<string, int>> $map_of_string_to_map_of_string_to_i32 = null, ?dict<string, dict<string, A>> $map_of_string_to_map_of_string_to_A = null, ?dict<string, vec<int>> $map_of_string_to_list_of_i32 = null, ?dict<string, keyset<int>> $map_of_string_to_set_of_i32 = null, ?vec<string> $list_of_string = null, ?vec<int> $list_of_i32 = null, ?vec<keyset<int>> $list_of_set_of_i32 = null, ?vec<dict<string, vec<A>>> $list_of_map_of_string_to_list_of_A = null, ?vec<dict<string, A>> $list_of_map_of_string_to_A = null, ?keyset<int> $set_of_i32 = null, ?keyset<string> $set_of_string = null)[] {\n    $this->map_of_string_to_string = $map_of_string_to_string ?? dict[];\n    $this->map_of_string_to_i32 = $map_of_string_to_i32 ?? dict[];\n    $this->map_of_string_to_A = $map_of_string_to_A ?? dict[];\n    $this->map_of_string_to_list_of_A = $map_of_string_to_list_of_A ?? dict[];\n    $this->map_of_string_to_map_of_string_to_i32 = $map_of_string_to_map_of_string_to_i32 ?? dict[];\n    $this->map_of_string_to_map_of_string_to_A = $map_of_string_to_map_of_string_to_A ?? dict[];\n    $this->map_of_string_to_list_of_i32 = $map_of_string_to_list_of_i32 ?? dict[];\n    $this->map_of_string_to_set_of_i32 = $map_of_string_to_set_of_i32 ?? dict[];\n    $this->list_of_string = $list_of_string ?? vec[];\n    $this->list_of_i32 = $list_of_i32 ?? vec[];\n    $this->list_of_set_of_i32 = $list_of_set_of_i32 ?? vec[];\n    $this->list_of_map_of_string_to_list_of_A = $list_of_map_of_string_to_list_of_A ?? vec[];\n    $this->list_of_map_of_string_to_A = $list_of_map_of_string_to_A ?? vec[];\n    $this->set_of_i32 = $set_of_i32 ?? keyset[];\n    $this->set_of_string = $set_of_string ?? keyset[];\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'map_of_string_to_string'),\n      Shapes::idx($shape, 'map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_A'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_A'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_i32'),\n      Shapes::idx($shape, 'map_of_string_to_set_of_i32'),\n      Shapes::idx($shape, 'list_of_string'),\n      Shapes::idx($shape, 'list_of_i32'),\n      Shapes::idx($shape, 'list_of_set_of_i32'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_A'),\n      Shapes::idx($shape, 'set_of_i32'),\n      Shapes::idx($shape, 'set_of_string'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'B';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.B\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_string\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.A\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_set_of_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 10,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_string\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 11,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 14,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_set_of_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 15,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.A\",\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_list_of_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 16,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 17,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"set_of_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 18,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"set_of_string\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['map_of_string_to_string']\n        |> self::__stringifyMapKeys($$),\n      $shape['map_of_string_to_i32']\n        |> self::__stringifyMapKeys($$),\n      $shape['map_of_string_to_A']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val0 ==> $_val0\n            |> A::__fromShape($$),\n        ),\n      $shape['map_of_string_to_list_of_A']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val2 ==> $_val2\n            |> Vec\\map(\n              $$,\n              $_val1 ==> $_val1\n                |> A::__fromShape($$),\n            ),\n        ),\n      $shape['map_of_string_to_map_of_string_to_i32']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val3 ==> $_val3\n            |> self::__stringifyMapKeys($$),\n        ),\n      $shape['map_of_string_to_map_of_string_to_A']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val5 ==> $_val5\n            |> Dict\\map(\n              self::__stringifyMapKeys($$),\n              $_val4 ==> $_val4\n                |> A::__fromShape($$),\n            ),\n        ),\n      $shape['map_of_string_to_list_of_i32']\n        |> self::__stringifyMapKeys($$),\n      $shape['map_of_string_to_set_of_i32']\n        |> self::__stringifyMapKeys($$),\n      $shape['list_of_string'],\n      $shape['list_of_i32'],\n      $shape['list_of_set_of_i32'],\n      $shape['list_of_map_of_string_to_list_of_A']\n        |> Vec\\map(\n          $$,\n          $_val8 ==> $_val8\n            |> Dict\\map(\n              self::__stringifyMapKeys($$),\n              $_val7 ==> $_val7\n                |> Vec\\map(\n                  $$,\n                  $_val6 ==> $_val6\n                    |> A::__fromShape($$),\n                ),\n            ),\n        ),\n      $shape['list_of_map_of_string_to_A']\n        |> Vec\\map(\n          $$,\n          $_val10 ==> $_val10\n            |> Dict\\map(\n              self::__stringifyMapKeys($$),\n              $_val9 ==> $_val9\n                |> A::__fromShape($$),\n            ),\n        ),\n      $shape['set_of_i32'],\n      $shape['set_of_string'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'map_of_string_to_string' => $this->map_of_string_to_string,\n      'map_of_string_to_i32' => $this->map_of_string_to_i32,\n      'map_of_string_to_A' => $this->map_of_string_to_A\n        |> Dict\\map(\n          $$,\n          ($_val0) ==> $_val0->__toShape(),\n        ),\n      'map_of_string_to_list_of_A' => $this->map_of_string_to_list_of_A\n        |> Dict\\map(\n          $$,\n          ($_val0) ==> $_val0\n            |> Vec\\map(\n              $$,\n              ($_val1) ==> $_val1->__toShape(),\n            ),\n        ),\n      'map_of_string_to_map_of_string_to_i32' => $this->map_of_string_to_map_of_string_to_i32,\n      'map_of_string_to_map_of_string_to_A' => $this->map_of_string_to_map_of_string_to_A\n        |> Dict\\map(\n          $$,\n          ($_val0) ==> $_val0\n            |> Dict\\map(\n              $$,\n              ($_val1) ==> $_val1->__toShape(),\n            ),\n        ),\n      'map_of_string_to_list_of_i32' => $this->map_of_string_to_list_of_i32,\n      'map_of_string_to_set_of_i32' => $this->map_of_string_to_set_of_i32,\n      'list_of_string' => $this->list_of_string,\n      'list_of_i32' => $this->list_of_i32,\n      'list_of_set_of_i32' => $this->list_of_set_of_i32,\n      'list_of_map_of_string_to_list_of_A' => $this->list_of_map_of_string_to_list_of_A\n        |> Vec\\map(\n          $$,\n          ($_val0) ==> $_val0\n            |> Dict\\map(\n              $$,\n              ($_val1) ==> $_val1\n                |> Vec\\map(\n                  $$,\n                  ($_val2) ==> $_val2->__toShape(),\n                ),\n            ),\n        ),\n      'list_of_map_of_string_to_A' => $this->list_of_map_of_string_to_A\n        |> Vec\\map(\n          $$,\n          ($_val0) ==> $_val0\n            |> Dict\\map(\n              $$,\n              ($_val1) ==> $_val1->__toShape(),\n            ),\n        ),\n      'set_of_i32' => $this->set_of_i32,\n      'set_of_string' => $this->set_of_string,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * C\n */\nclass C implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'just_an_A',\n      'type' => \\TType::STRUCT,\n      'class' => A::class,\n    ),\n    2 => shape(\n      'var' => 'just_an_enum',\n      'type' => \\TType::I32,\n      'enum' => Enum::class,\n    ),\n    4 => shape(\n      'var' => 'map_of_string_to_string',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'harray',\n    ),\n    5 => shape(\n      'var' => 'map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'harray',\n    ),\n    6 => shape(\n      'var' => 'map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => A::class,\n      ),\n      'format' => 'harray',\n    ),\n    7 => shape(\n      'var' => 'map_of_string_to_self',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => B::class,\n      ),\n      'format' => 'harray',\n    ),\n    8 => shape(\n      'var' => 'map_of_string_to_list_of_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRUCT,\n        'elem' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    9 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    10 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    11 => shape(\n      'var' => 'map_of_string_to_list_of_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    12 => shape(\n      'var' => 'map_of_string_to_set_of_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::SET,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::SET,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    13 => shape(\n      'var' => 'list_of_string',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'harray',\n    ),\n    14 => shape(\n      'var' => 'list_of_map_of_string_to_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    17 => shape(\n      'var' => 'list_of_map_of_string_to_list_of_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::LST,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::LST,\n          'etype' => \\TType::STRUCT,\n          'elem' => shape(\n            'type' => \\TType::STRUCT,\n            'class' => A::class,\n          ),\n          'format' => 'harray',\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    18 => shape(\n      'var' => 'list_of_i32',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'harray',\n    ),\n    19 => shape(\n      'var' => 'map_of_string_to_list_of_string',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRING,\n        'elem' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    20 => shape(\n      'var' => 'set_of_i32',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'harray',\n    ),\n    21 => shape(\n      'var' => 'set_of_string',\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'harray',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'just_an_A' => 1,\n    'just_an_enum' => 2,\n    'map_of_string_to_string' => 4,\n    'map_of_string_to_i32' => 5,\n    'map_of_string_to_A' => 6,\n    'map_of_string_to_self' => 7,\n    'map_of_string_to_list_of_A' => 8,\n    'map_of_string_to_map_of_string_to_i32' => 9,\n    'map_of_string_to_map_of_string_to_A' => 10,\n    'map_of_string_to_list_of_i32' => 11,\n    'map_of_string_to_set_of_i32' => 12,\n    'list_of_string' => 13,\n    'list_of_map_of_string_to_A' => 14,\n    'list_of_map_of_string_to_list_of_A' => 17,\n    'list_of_i32' => 18,\n    'map_of_string_to_list_of_string' => 19,\n    'set_of_i32' => 20,\n    'set_of_string' => 21,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'just_an_A' => ?A,\n    ?'just_an_enum' => ?Enum,\n    ?'map_of_string_to_string' => ?dict<string, string>,\n    ?'map_of_string_to_i32' => ?dict<string, int>,\n    ?'map_of_string_to_A' => ?dict<string, A>,\n    ?'map_of_string_to_self' => ?dict<string, B>,\n    ?'map_of_string_to_list_of_A' => ?dict<string, vec<A>>,\n    ?'map_of_string_to_map_of_string_to_i32' => ?dict<string, dict<string, int>>,\n    ?'map_of_string_to_map_of_string_to_A' => ?dict<string, dict<string, A>>,\n    ?'map_of_string_to_list_of_i32' => ?dict<string, vec<int>>,\n    ?'map_of_string_to_set_of_i32' => ?dict<string, keyset<int>>,\n    ?'list_of_string' => ?vec<string>,\n    ?'list_of_map_of_string_to_A' => ?vec<dict<string, A>>,\n    ?'list_of_map_of_string_to_list_of_A' => ?vec<dict<string, vec<A>>>,\n    ?'list_of_i32' => ?vec<int>,\n    ?'map_of_string_to_list_of_string' => ?dict<string, vec<string>>,\n    ?'set_of_i32' => ?keyset<int>,\n    ?'set_of_string' => ?keyset<string>,\n  );\n\n  const type TShape = shape(\n    ?'just_an_A' => ?A::TShape,\n    ?'just_an_enum' => ?Enum,\n    ?'map_of_string_to_string' => ?dict<arraykey, string>,\n    ?'map_of_string_to_i32' => ?dict<arraykey, int>,\n    ?'map_of_string_to_A' => ?dict<arraykey, A::TShape>,\n    ?'map_of_string_to_self' => ?dict<arraykey, B::TShape>,\n    ?'map_of_string_to_list_of_A' => ?dict<arraykey, vec<A::TShape>>,\n    ?'map_of_string_to_map_of_string_to_i32' => ?dict<arraykey, dict<arraykey, int>>,\n    ?'map_of_string_to_map_of_string_to_A' => ?dict<arraykey, dict<arraykey, A::TShape>>,\n    ?'map_of_string_to_list_of_i32' => ?dict<arraykey, vec<int>>,\n    ?'map_of_string_to_set_of_i32' => ?dict<arraykey, keyset<int>>,\n    ?'list_of_string' => ?vec<string>,\n    ?'list_of_map_of_string_to_A' => ?vec<dict<arraykey, A::TShape>>,\n    ?'list_of_map_of_string_to_list_of_A' => ?vec<dict<arraykey, vec<A::TShape>>>,\n    ?'list_of_i32' => ?vec<int>,\n    ?'map_of_string_to_list_of_string' => ?dict<arraykey, vec<string>>,\n    ?'set_of_i32' => ?keyset<int>,\n    ?'set_of_string' => ?keyset<string>,\n  );\n  const int STRUCTURAL_ID = 7779248235937077517;\n  /**\n   * Original thrift field:-\n   * 1: module.A just_an_A\n   */\n  public ?A $just_an_A;\n  /**\n   * Original thrift field:-\n   * 2: module.Enum just_an_enum\n   */\n  public ?Enum $just_an_enum;\n  /**\n   * Original thrift field:-\n   * 4: map<string, string> map_of_string_to_string\n   */\n  public ?dict<string, string> $map_of_string_to_string;\n  /**\n   * Original thrift field:-\n   * 5: map<string, i32> map_of_string_to_i32\n   */\n  public ?dict<string, int> $map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 6: map<string, module.A> map_of_string_to_A\n   */\n  public ?dict<string, A> $map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 7: map<string, module.B> map_of_string_to_self\n   */\n  public ?dict<string, B> $map_of_string_to_self;\n  /**\n   * Original thrift field:-\n   * 8: map<string, list<module.A>> map_of_string_to_list_of_A\n   */\n  public ?dict<string, vec<A>> $map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 9: map<string, map<string, i32>> map_of_string_to_map_of_string_to_i32\n   */\n  public ?dict<string, dict<string, int>> $map_of_string_to_map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 10: map<string, map<string, module.A>> map_of_string_to_map_of_string_to_A\n   */\n  public ?dict<string, dict<string, A>> $map_of_string_to_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 11: map<string, list<i32>> map_of_string_to_list_of_i32\n   */\n  public ?dict<string, vec<int>> $map_of_string_to_list_of_i32;\n  /**\n   * Original thrift field:-\n   * 12: map<string, set<i32>> map_of_string_to_set_of_i32\n   */\n  public ?dict<string, keyset<int>> $map_of_string_to_set_of_i32;\n  /**\n   * Original thrift field:-\n   * 13: list<string> list_of_string\n   */\n  public ?vec<string> $list_of_string;\n  /**\n   * Original thrift field:-\n   * 14: list<map<string, module.A>> list_of_map_of_string_to_A\n   */\n  public ?vec<dict<string, A>> $list_of_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 17: list<map<string, list<module.A>>> list_of_map_of_string_to_list_of_A\n   */\n  public ?vec<dict<string, vec<A>>> $list_of_map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 18: list<i32> list_of_i32\n   */\n  public ?vec<int> $list_of_i32;\n  /**\n   * Original thrift field:-\n   * 19: map<string, list<string>> map_of_string_to_list_of_string\n   */\n  public ?dict<string, vec<string>> $map_of_string_to_list_of_string;\n  /**\n   * Original thrift field:-\n   * 20: set<i32> set_of_i32\n   */\n  public ?keyset<int> $set_of_i32;\n  /**\n   * Original thrift field:-\n   * 21: set<string> set_of_string\n   */\n  public ?keyset<string> $set_of_string;\n\n  public function __construct(?A $just_an_A = null, ?Enum $just_an_enum = null, ?dict<string, string> $map_of_string_to_string = null, ?dict<string, int> $map_of_string_to_i32 = null, ?dict<string, A> $map_of_string_to_A = null, ?dict<string, B> $map_of_string_to_self = null, ?dict<string, vec<A>> $map_of_string_to_list_of_A = null, ?dict<string, dict<string, int>> $map_of_string_to_map_of_string_to_i32 = null, ?dict<string, dict<string, A>> $map_of_string_to_map_of_string_to_A = null, ?dict<string, vec<int>> $map_of_string_to_list_of_i32 = null, ?dict<string, keyset<int>> $map_of_string_to_set_of_i32 = null, ?vec<string> $list_of_string = null, ?vec<dict<string, A>> $list_of_map_of_string_to_A = null, ?vec<dict<string, vec<A>>> $list_of_map_of_string_to_list_of_A = null, ?vec<int> $list_of_i32 = null, ?dict<string, vec<string>> $map_of_string_to_list_of_string = null, ?keyset<int> $set_of_i32 = null, ?keyset<string> $set_of_string = null)[] {\n    $this->just_an_A = $just_an_A;\n    $this->just_an_enum = $just_an_enum;\n    $this->map_of_string_to_string = $map_of_string_to_string;\n    $this->map_of_string_to_i32 = $map_of_string_to_i32;\n    $this->map_of_string_to_A = $map_of_string_to_A;\n    $this->map_of_string_to_self = $map_of_string_to_self;\n    $this->map_of_string_to_list_of_A = $map_of_string_to_list_of_A;\n    $this->map_of_string_to_map_of_string_to_i32 = $map_of_string_to_map_of_string_to_i32;\n    $this->map_of_string_to_map_of_string_to_A = $map_of_string_to_map_of_string_to_A;\n    $this->map_of_string_to_list_of_i32 = $map_of_string_to_list_of_i32;\n    $this->map_of_string_to_set_of_i32 = $map_of_string_to_set_of_i32;\n    $this->list_of_string = $list_of_string;\n    $this->list_of_map_of_string_to_A = $list_of_map_of_string_to_A;\n    $this->list_of_map_of_string_to_list_of_A = $list_of_map_of_string_to_list_of_A;\n    $this->list_of_i32 = $list_of_i32;\n    $this->map_of_string_to_list_of_string = $map_of_string_to_list_of_string;\n    $this->set_of_i32 = $set_of_i32;\n    $this->set_of_string = $set_of_string;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'just_an_A'),\n      Shapes::idx($shape, 'just_an_enum'),\n      Shapes::idx($shape, 'map_of_string_to_string'),\n      Shapes::idx($shape, 'map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_A'),\n      Shapes::idx($shape, 'map_of_string_to_self'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_A'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_i32'),\n      Shapes::idx($shape, 'map_of_string_to_set_of_i32'),\n      Shapes::idx($shape, 'list_of_string'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_A'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'list_of_i32'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_string'),\n      Shapes::idx($shape, 'set_of_i32'),\n      Shapes::idx($shape, 'set_of_string'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'C';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.C\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.A\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"just_an_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Enum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"just_an_enum\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_string\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.A\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.B\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_self\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 10,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 11,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 12,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_set_of_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 13,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_string\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 14,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 17,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.A\",\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_list_of_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 18,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 19,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_string\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 20,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"set_of_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 21,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"set_of_string\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'just_an_A') === null ? null : (A::__fromShape($shape['just_an_A'])),\n      Shapes::idx($shape, 'just_an_enum'),\n      Shapes::idx($shape, 'map_of_string_to_string') === null ? null : ($shape['map_of_string_to_string']\n        |> self::__stringifyMapKeys($$)),\n      Shapes::idx($shape, 'map_of_string_to_i32') === null ? null : ($shape['map_of_string_to_i32']\n        |> self::__stringifyMapKeys($$)),\n      Shapes::idx($shape, 'map_of_string_to_A') === null ? null : ($shape['map_of_string_to_A']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val0 ==> $_val0\n            |> A::__fromShape($$),\n        )),\n      Shapes::idx($shape, 'map_of_string_to_self') === null ? null : ($shape['map_of_string_to_self']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val1 ==> $_val1\n            |> B::__fromShape($$),\n        )),\n      Shapes::idx($shape, 'map_of_string_to_list_of_A') === null ? null : ($shape['map_of_string_to_list_of_A']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val3 ==> $_val3\n            |> Vec\\map(\n              $$,\n              $_val2 ==> $_val2\n                |> A::__fromShape($$),\n            ),\n        )),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_i32') === null ? null : ($shape['map_of_string_to_map_of_string_to_i32']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val4 ==> $_val4\n            |> self::__stringifyMapKeys($$),\n        )),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_A') === null ? null : ($shape['map_of_string_to_map_of_string_to_A']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val6 ==> $_val6\n            |> Dict\\map(\n              self::__stringifyMapKeys($$),\n              $_val5 ==> $_val5\n                |> A::__fromShape($$),\n            ),\n        )),\n      Shapes::idx($shape, 'map_of_string_to_list_of_i32') === null ? null : ($shape['map_of_string_to_list_of_i32']\n        |> self::__stringifyMapKeys($$)),\n      Shapes::idx($shape, 'map_of_string_to_set_of_i32') === null ? null : ($shape['map_of_string_to_set_of_i32']\n        |> self::__stringifyMapKeys($$)),\n      Shapes::idx($shape, 'list_of_string'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_A') === null ? null : ($shape['list_of_map_of_string_to_A']\n        |> Vec\\map(\n          $$,\n          $_val8 ==> $_val8\n            |> Dict\\map(\n              self::__stringifyMapKeys($$),\n              $_val7 ==> $_val7\n                |> A::__fromShape($$),\n            ),\n        )),\n      Shapes::idx($shape, 'list_of_map_of_string_to_list_of_A') === null ? null : ($shape['list_of_map_of_string_to_list_of_A']\n        |> Vec\\map(\n          $$,\n          $_val11 ==> $_val11\n            |> Dict\\map(\n              self::__stringifyMapKeys($$),\n              $_val10 ==> $_val10\n                |> Vec\\map(\n                  $$,\n                  $_val9 ==> $_val9\n                    |> A::__fromShape($$),\n                ),\n            ),\n        )),\n      Shapes::idx($shape, 'list_of_i32'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_string') === null ? null : ($shape['map_of_string_to_list_of_string']\n        |> self::__stringifyMapKeys($$)),\n      Shapes::idx($shape, 'set_of_i32'),\n      Shapes::idx($shape, 'set_of_string'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'just_an_A' => $this->just_an_A?->__toShape(),\n      'just_an_enum' => $this->just_an_enum,\n      'map_of_string_to_string' => $this->map_of_string_to_string,\n      'map_of_string_to_i32' => $this->map_of_string_to_i32,\n      'map_of_string_to_A' => $this->map_of_string_to_A\n        |> $$ === null \n          ? null \n          : Dict\\map(\n            $$,\n            ($_val0) ==> $_val0->__toShape(),\n          ),\n      'map_of_string_to_self' => $this->map_of_string_to_self\n        |> $$ === null \n          ? null \n          : Dict\\map(\n            $$,\n            ($_val0) ==> $_val0->__toShape(),\n          ),\n      'map_of_string_to_list_of_A' => $this->map_of_string_to_list_of_A\n        |> $$ === null \n          ? null \n          : Dict\\map(\n            $$,\n            ($_val0) ==> $_val0\n              |> Vec\\map(\n                $$,\n                ($_val1) ==> $_val1->__toShape(),\n              ),\n          ),\n      'map_of_string_to_map_of_string_to_i32' => $this->map_of_string_to_map_of_string_to_i32,\n      'map_of_string_to_map_of_string_to_A' => $this->map_of_string_to_map_of_string_to_A\n        |> $$ === null \n          ? null \n          : Dict\\map(\n            $$,\n            ($_val0) ==> $_val0\n              |> Dict\\map(\n                $$,\n                ($_val1) ==> $_val1->__toShape(),\n              ),\n          ),\n      'map_of_string_to_list_of_i32' => $this->map_of_string_to_list_of_i32,\n      'map_of_string_to_set_of_i32' => $this->map_of_string_to_set_of_i32,\n      'list_of_string' => $this->list_of_string,\n      'list_of_map_of_string_to_A' => $this->list_of_map_of_string_to_A\n        |> $$ === null \n          ? null \n          : Vec\\map(\n            $$,\n            ($_val0) ==> $_val0\n              |> Dict\\map(\n                $$,\n                ($_val1) ==> $_val1->__toShape(),\n              ),\n          ),\n      'list_of_map_of_string_to_list_of_A' => $this->list_of_map_of_string_to_list_of_A\n        |> $$ === null \n          ? null \n          : Vec\\map(\n            $$,\n            ($_val0) ==> $_val0\n              |> Dict\\map(\n                $$,\n                ($_val1) ==> $_val1\n                  |> Vec\\map(\n                    $$,\n                    ($_val2) ==> $_val2->__toShape(),\n                  ),\n              ),\n          ),\n      'list_of_i32' => $this->list_of_i32,\n      'map_of_string_to_list_of_string' => $this->map_of_string_to_list_of_string,\n      'set_of_i32' => $this->set_of_i32,\n      'set_of_string' => $this->set_of_string,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 2380}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures\\basic;\n\nmodule hack.module.test;\n/**\n * Original thrift service:-\n * DbMixedStackArguments\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/DbMixedStackArguments'))>>\ninterface DbMixedStackArgumentsAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * binary\n   *   getDataByKey0(1: string key);\n   */\n  public function getDataByKey0(string $key): Awaitable<string>;\n\n  /**\n   * Original thrift definition:-\n   * binary\n   *   getDataByKey1(1: string key);\n   */\n  public function getDataByKey1(string $key): Awaitable<string>;\n}\n\n/**\n * Original thrift service:-\n * DbMixedStackArguments\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/DbMixedStackArguments'))>>\ninterface DbMixedStackArgumentsIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * binary\n   *   getDataByKey0(1: string key);\n   */\n  public function getDataByKey0(string $key): string;\n\n  /**\n   * Original thrift definition:-\n   * binary\n   *   getDataByKey1(1: string key);\n   */\n  public function getDataByKey1(string $key): string;\n}\n\n/**\n * Original thrift service:-\n * DbMixedStackArguments\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/DbMixedStackArguments'))>>\ninterface DbMixedStackArgumentsAsyncClientIf extends DbMixedStackArgumentsAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * DbMixedStackArguments\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/DbMixedStackArguments'))>>\ninterface DbMixedStackArgumentsClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * binary\n   *   getDataByKey0(1: string key);\n   */\n  public function getDataByKey0(string $key): Awaitable<string>;\n\n  /**\n   * Original thrift definition:-\n   * binary\n   *   getDataByKey1(1: string key);\n   */\n  public function getDataByKey1(string $key): Awaitable<string>;\n}\n\n/**\n * Original thrift service:-\n * DbMixedStackArguments\n */\ntrait DbMixedStackArgumentsClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass DbMixedStackArgumentsAsyncClient extends \\ThriftClientBase implements DbMixedStackArgumentsAsyncClientIf {\n  use DbMixedStackArgumentsClientBase;\n\n  /**\n   * Original thrift definition:-\n   * binary\n   *   getDataByKey0(1: string key);\n   */\n  public async function getDataByKey0(string $key): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey0_args::fromShape(shape(\n      'key' => $key,\n    ));\n    await $this->asyncHandler_->genBefore(\"DbMixedStackArguments\", \"getDataByKey0\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"getDataByKey0\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey0_result::class, \"getDataByKey0\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * binary\n   *   getDataByKey1(1: string key);\n   */\n  public async function getDataByKey1(string $key): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey1_args::fromShape(shape(\n      'key' => $key,\n    ));\n    await $this->asyncHandler_->genBefore(\"DbMixedStackArguments\", \"getDataByKey1\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"getDataByKey1\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey1_result::class, \"getDataByKey1\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass DbMixedStackArgumentsClient extends \\ThriftClientBase implements DbMixedStackArgumentsClientIf {\n  use DbMixedStackArgumentsClientBase;\n\n  /**\n   * Original thrift definition:-\n   * binary\n   *   getDataByKey0(1: string key);\n   */\n  public async function getDataByKey0(string $key): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey0_args::fromShape(shape(\n      'key' => $key,\n    ));\n    await $this->asyncHandler_->genBefore(\"DbMixedStackArguments\", \"getDataByKey0\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"getDataByKey0\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey0_result::class, \"getDataByKey0\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * binary\n   *   getDataByKey1(1: string key);\n   */\n  public async function getDataByKey1(string $key): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey1_args::fromShape(shape(\n      'key' => $key,\n    ));\n    await $this->asyncHandler_->genBefore(\"DbMixedStackArguments\", \"getDataByKey1\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"getDataByKey1\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey1_result::class, \"getDataByKey1\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_getDataByKey0(string $key): int {\n    $args = \\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey0_args::fromShape(shape(\n      'key' => $key,\n    ));\n    return $this->sendImplHelper($args, \"getDataByKey0\", false);\n  }\n  public function recv_getDataByKey0(?int $expectedsequenceid = null): string {\n    return $this->recvImplHelper(\\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey0_result::class, \"getDataByKey0\", false, $expectedsequenceid);\n  }\n  public function send_getDataByKey1(string $key): int {\n    $args = \\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey1_args::fromShape(shape(\n      'key' => $key,\n    ));\n    return $this->sendImplHelper($args, \"getDataByKey1\", false);\n  }\n  public function recv_getDataByKey1(?int $expectedsequenceid = null): string {\n    return $this->recvImplHelper(\\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey1_result::class, \"getDataByKey1\", false, $expectedsequenceid);\n  }\n}\n\nabstract class DbMixedStackArgumentsAsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as DbMixedStackArgumentsAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = DbMixedStackArgumentsStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'DbMixedStackArguments';\n\n  protected async function process_getDataByKey0(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('getDataByKey0');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'getDataByKey0', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey0_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey0_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey0_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'getDataByKey0', $args);\n    $result = \\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey0_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\DbMixedStackArguments', 'getDataByKey0', $args);\n      $result->success = await $this->handler->getDataByKey0($args->key);\n      $this->eventHandler_->postExec($handler_ctx, 'getDataByKey0', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'getDataByKey0', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'getDataByKey0', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getDataByKey0', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getDataByKey0', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getDataByKey0\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'getDataByKey0', $result);\n  }\n  protected async function process_getDataByKey1(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('getDataByKey1');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'getDataByKey1', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey1_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey1_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey1_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'getDataByKey1', $args);\n    $result = \\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey1_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\DbMixedStackArguments', 'getDataByKey1', $args);\n      $result->success = await $this->handler->getDataByKey1($args->key);\n      $this->eventHandler_->postExec($handler_ctx, 'getDataByKey1', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'getDataByKey1', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'getDataByKey1', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getDataByKey1', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getDataByKey1', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getDataByKey1\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'getDataByKey1', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = DbMixedStackArgumentsStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass DbMixedStackArgumentsAsyncProcessor extends DbMixedStackArgumentsAsyncProcessorBase {\n  const type TThriftIf = DbMixedStackArgumentsAsyncIf;\n}\n\nabstract class DbMixedStackArgumentsSyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as DbMixedStackArgumentsIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = DbMixedStackArgumentsStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'DbMixedStackArguments';\n\n  protected function process_getDataByKey0(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('getDataByKey0');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'getDataByKey0', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey0_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey0_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey0_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'getDataByKey0', $args);\n    $result = \\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey0_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\DbMixedStackArguments', 'getDataByKey0', $args);\n      $result->success = $this->handler->getDataByKey0($args->key);\n      $this->eventHandler_->postExec($handler_ctx, 'getDataByKey0', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'getDataByKey0', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'getDataByKey0', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getDataByKey0', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getDataByKey0', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getDataByKey0\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'getDataByKey0', $result);\n  }\n  protected function process_getDataByKey1(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('getDataByKey1');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'getDataByKey1', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey1_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey1_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey1_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'getDataByKey1', $args);\n    $result = \\test\\fixtures\\basic\\DbMixedStackArguments_getDataByKey1_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\DbMixedStackArguments', 'getDataByKey1', $args);\n      $result->success = $this->handler->getDataByKey1($args->key);\n      $this->eventHandler_->postExec($handler_ctx, 'getDataByKey1', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'getDataByKey1', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'getDataByKey1', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getDataByKey1', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getDataByKey1', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getDataByKey1\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'getDataByKey1', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = DbMixedStackArgumentsStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass DbMixedStackArgumentsSyncProcessor extends DbMixedStackArgumentsSyncProcessorBase {\n  const type TThriftIf = DbMixedStackArgumentsIf;\n}\n// For backwards compatibility\nclass DbMixedStackArgumentsProcessor extends DbMixedStackArgumentsSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass DbMixedStackArguments_getDataByKey0_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'key',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'key' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'key' => ?string,\n  );\n\n  const type TShape = shape(\n    'key' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 4222184892931375562;\n  public string $key;\n\n  public function __construct(?string $key = null)[] {\n    $this->key = $key ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'key'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'DbMixedStackArguments_getDataByKey0_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.getDataByKey0_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"key\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['key'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'key' => $this->key,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'key') !== null) {\n      $this->key = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['key']);\n    }\n  }\n\n}\n\nclass DbMixedStackArguments_getDataByKey0_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'DbMixedStackArguments_getDataByKey0_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.DbMixedStackArguments_getDataByKey0_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $this->success = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['success']);\n    }\n  }\n\n}\n\nclass DbMixedStackArguments_getDataByKey1_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'key',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'key' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'key' => ?string,\n  );\n\n  const type TShape = shape(\n    'key' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 4222184892931375562;\n  public string $key;\n\n  public function __construct(?string $key = null)[] {\n    $this->key = $key ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'key'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'DbMixedStackArguments_getDataByKey1_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.getDataByKey1_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"key\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['key'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'key' => $this->key,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'key') !== null) {\n      $this->key = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['key']);\n    }\n  }\n\n}\n\nclass DbMixedStackArguments_getDataByKey1_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'DbMixedStackArguments_getDataByKey1_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.DbMixedStackArguments_getDataByKey1_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $this->success = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['success']);\n    }\n  }\n\n}\n\nclass DbMixedStackArgumentsStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return \\tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.DbMixedStackArguments\",\n        \"functions\" => vec[\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"getDataByKey0\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                      )\n                    ),\n                    \"name\" => \"key\",\n                  )\n                ),\n              ],\n            )\n          ),\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"getDataByKey1\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                      )\n                    ),\n                    \"name\" => \"key\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 954}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures\\basic;\n\nmodule hack.module.test;\n/**\n * Original thrift service:-\n * FB303Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/FB303Service'))>>\ninterface FB303ServiceAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * ReservedKeyword\n   *   renamed_rpc(1: i32 int_parameter);\n   */\n  public function renamed_rpc(int $renamed_parameter): Awaitable<\\test\\fixtures\\basic\\MyRenamedStruct>;\n}\n\n/**\n * Original thrift service:-\n * FB303Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/FB303Service'))>>\ninterface FB303ServiceIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * ReservedKeyword\n   *   renamed_rpc(1: i32 int_parameter);\n   */\n  public function renamed_rpc(int $renamed_parameter): \\test\\fixtures\\basic\\MyRenamedStruct;\n}\n\n/**\n * Original thrift service:-\n * FB303Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/FB303Service'))>>\ninterface FB303ServiceAsyncClientIf extends FB303ServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * FB303Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/FB303Service'))>>\ninterface FB303ServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * ReservedKeyword\n   *   renamed_rpc(1: i32 int_parameter);\n   */\n  public function renamed_rpc(int $renamed_parameter): Awaitable<\\test\\fixtures\\basic\\MyRenamedStruct>;\n}\n\n/**\n * Original thrift service:-\n * FB303Service\n */\ntrait FB303ServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass FB303ServiceAsyncClient extends \\ThriftClientBase implements FB303ServiceAsyncClientIf {\n  use FB303ServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * ReservedKeyword\n   *   renamed_rpc(1: i32 int_parameter);\n   */\n  public async function renamed_rpc(int $renamed_parameter): Awaitable<\\test\\fixtures\\basic\\MyRenamedStruct> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\FB303Service_renamed_rpc_args::fromShape(shape(\n      'int_parameter' => $int_parameter,\n    ));\n    await $this->asyncHandler_->genBefore(\"FB303Service\", \"renamed_rpc\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"renamed_rpc\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\basic\\FB303Service_renamed_rpc_result::class, \"simple_rpc\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass FB303ServiceClient extends \\ThriftClientBase implements FB303ServiceClientIf {\n  use FB303ServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * ReservedKeyword\n   *   renamed_rpc(1: i32 int_parameter);\n   */\n  public async function renamed_rpc(int $renamed_parameter): Awaitable<\\test\\fixtures\\basic\\MyRenamedStruct> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\FB303Service_renamed_rpc_args::fromShape(shape(\n      'int_parameter' => $int_parameter,\n    ));\n    await $this->asyncHandler_->genBefore(\"FB303Service\", \"renamed_rpc\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"renamed_rpc\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\basic\\FB303Service_renamed_rpc_result::class, \"simple_rpc\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_renamed_rpc(int $renamed_parameter): int {\n    $args = \\test\\fixtures\\basic\\FB303Service_renamed_rpc_args::fromShape(shape(\n      'int_parameter' => $int_parameter,\n    ));\n    return $this->sendImplHelper($args, \"renamed_rpc\", false);\n  }\n  public function recv_renamed_rpc(?int $expectedsequenceid = null): \\test\\fixtures\\basic\\MyRenamedStruct {\n    return $this->recvImplHelper(\\test\\fixtures\\basic\\FB303Service_renamed_rpc_result::class, \"renamed_rpc\", false, $expectedsequenceid);\n  }\n}\n\nabstract class FB303ServiceAsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as FB303ServiceAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = FB303ServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'FB303Service';\n\n  protected async function process_renamed_rpc(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('renamed_rpc');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'renamed_rpc', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\FB303Service_renamed_rpc_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\FB303Service_renamed_rpc_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\FB303Service_renamed_rpc_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'renamed_rpc', $args);\n    $result = \\test\\fixtures\\basic\\FB303Service_renamed_rpc_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\FB303Service', 'renamed_rpc', $args);\n      $result->success = await $this->handler->renamed_rpc($args->int_parameter);\n      $this->eventHandler_->postExec($handler_ctx, 'renamed_rpc', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'renamed_rpc', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'renamed_rpc', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'renamed_rpc', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'renamed_rpc', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"renamed_rpc\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'renamed_rpc', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = FB303ServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass FB303ServiceAsyncProcessor extends FB303ServiceAsyncProcessorBase {\n  const type TThriftIf = FB303ServiceAsyncIf;\n}\n\nabstract class FB303ServiceSyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as FB303ServiceIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = FB303ServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'FB303Service';\n\n  protected function process_renamed_rpc(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('renamed_rpc');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'renamed_rpc', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\FB303Service_renamed_rpc_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\FB303Service_renamed_rpc_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\FB303Service_renamed_rpc_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'renamed_rpc', $args);\n    $result = \\test\\fixtures\\basic\\FB303Service_renamed_rpc_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\FB303Service', 'renamed_rpc', $args);\n      $result->success = $this->handler->renamed_rpc($args->int_parameter);\n      $this->eventHandler_->postExec($handler_ctx, 'renamed_rpc', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'renamed_rpc', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'renamed_rpc', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'renamed_rpc', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'renamed_rpc', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"renamed_rpc\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'renamed_rpc', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = FB303ServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass FB303ServiceSyncProcessor extends FB303ServiceSyncProcessorBase {\n  const type TThriftIf = FB303ServiceIf;\n}\n// For backwards compatibility\nclass FB303ServiceProcessor extends FB303ServiceSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass FB303Service_renamed_rpc implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'int_parameter',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'int_parameter' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'int_parameter' => ?int,\n  );\n\n  const type TShape = shape(\n    'int_parameter' => int,\n    ...\n  );\n  const int STRUCTURAL_ID = 3607165688153615571;\n  public int $int_parameter;\n\n  public function __construct(?int $int_parameter = null)[] {\n    $this->int_parameter = $int_parameter ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'int_parameter'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FB303Service_renamed_rpc';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.simple_rpc_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"int_parameter\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'int_parameter' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Name' => \\facebook\\thrift\\annotation\\hack\\Name::fromShape(\n              shape(\n                \"name\" => \"renamed_parameter\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['int_parameter'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'int_parameter' => $this->int_parameter,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'int_parameter') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['int_parameter']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->int_parameter = (int)$_tmp0;\n      }\n    }\n  }\n\n}\n\nclass FB303Service_renamed_rpc_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = \\test\\fixtures\\basic\\MyRenamedStruct;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\basic\\MyRenamedStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 7443966475393398575;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FB303Service_renamed_rpc_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.FB303Service_renamed_rpc_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.ReservedKeyword\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'success' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Name' => \\facebook\\thrift\\annotation\\hack\\Name::fromShape(\n              shape(\n                \"name\" => \"MyRenamedStruct\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\basic\\MyRenamedStruct>($parsed['success']));\n      $_tmp1 = \\test\\fixtures\\basic\\MyRenamedStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->success = $_tmp1;\n    }\n  }\n\n}\n\nclass FB303ServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return \\tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.FB303Service\",\n        \"functions\" => vec[\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"renamed_rpc\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.ReservedKeyword\",\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                      )\n                    ),\n                    \"name\" => \"int_parameter\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n              'module.ReservedKeyword' => \\test\\fixtures\\basic\\MyRenamedStruct::getStructMetadata(),\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n        'renamed_rpc' => dict[\n          '\\facebook\\thrift\\annotation\\hack\\Name' => \\facebook\\thrift\\annotation\\hack\\Name::fromShape(\n            shape(\n              \"name\" => \"renamed_rpc\",\n            )\n          ),\n        ],\n      ],\n    );\n  }\n}\n\n", "num_lines": 623}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\hack;\n\n/**\n * Original thrift struct:-\n * FieldWrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/FieldWrapper'))>>\nclass FieldWrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldWrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.FieldWrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Wrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Wrapper'))>>\nclass Wrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'underlyingName',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'extraNamespace',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'underlyingName' => 2,\n    'extraNamespace' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'underlyingName' => ?string,\n    ?'extraNamespace' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'underlyingName' => string,\n    'extraNamespace' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 1284986773698322040;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string underlyingName\n   */\n  public string $underlyingName;\n  /**\n   * Original thrift field:-\n   * 3: string extraNamespace\n   */\n  public string $extraNamespace;\n\n  public function __construct(?string $name = null, ?string $underlyingName = null, ?string $extraNamespace = null)[] {\n    $this->name = $name ?? '';\n    $this->underlyingName = $underlyingName ?? '';\n    $this->extraNamespace = $extraNamespace ?? \"thrift_adapted_types\";\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'underlyingName'),\n      Shapes::idx($shape, 'extraNamespace'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Wrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Wrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"underlyingName\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"extraNamespace\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['underlyingName'],\n      $shape['extraNamespace'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'underlyingName' => $this->underlyingName,\n      'extraNamespace' => $this->extraNamespace,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'underlyingName') !== null) {\n      $this->underlyingName = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['underlyingName']);\n    }\n    if (idx($parsed, 'extraNamespace') !== null) {\n      $this->extraNamespace = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['extraNamespace']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * SkipCodegen\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/SkipCodegen'))>>\nclass SkipCodegen implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'reason' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'reason' => ?string,\n  );\n\n  const type TShape = shape(\n    'reason' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 3707764047816594739;\n  /**\n   * Original thrift field:-\n   * 1: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $reason = null)[] {\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SkipCodegen';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.SkipCodegen\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['reason'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'reason' => $this->reason,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'reason') !== null) {\n      $this->reason = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['reason']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Name\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Name'))>>\nclass Name implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'reason' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'reason' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'reason' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 4844827548325959202;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $name = null, ?string $reason = null)[] {\n    $this->name = $name ?? '';\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Name';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Name\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['reason'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'reason' => $this->reason,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'reason') !== null) {\n      $this->reason = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['reason']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * UnionEnumAttributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/UnionEnumAttributes'))>>\nclass UnionEnumAttributes implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?Vector<string>,\n  );\n\n  const type TShape = shape(\n    'attributes' => vec<string>,\n    ...\n  );\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public Vector<string> $attributes;\n\n  public function __construct(?Vector<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'UnionEnumAttributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.UnionEnumAttributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['attributes'] |> new Vector($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'attributes' => vec($this->attributes),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'attributes') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<string>>($parsed['attributes']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = '';\n        $_elem5 = $_value2;\n        $_container4 []= $_elem5;\n      }\n      $this->attributes = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructTrait'))>>\nclass StructTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructTrait\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Attributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Attributes'))>>\nclass Attributes implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?Vector<string>,\n  );\n\n  const type TShape = shape(\n    'attributes' => vec<string>,\n    ...\n  );\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public Vector<string> $attributes;\n\n  public function __construct(?Vector<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Attributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Attributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['attributes'] |> new Vector($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'attributes' => vec($this->attributes),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'attributes') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<string>>($parsed['attributes']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = '';\n        $_elem5 = $_value2;\n        $_container4 []= $_elem5;\n      }\n      $this->attributes = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructAsTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructAsTrait'))>>\nclass StructAsTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructAsTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructAsTrait\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ModuleInternal\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/ModuleInternal'))>>\nclass ModuleInternal implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ModuleInternal';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.ModuleInternal\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1307}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures\\basic;\n\nmodule hack.module.test;\n/**\n * Original thrift enum:-\n * MyEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/MyEnum'))>>\nenum MyEnum: int {\n  MyValue1 = 0;\n  MyValue2 = 1;\n}\n\nclass MyEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.MyEnum\",\n        \"elements\" => dict[\n          0 => \"MyValue1\",\n          1 => \"MyValue2\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift enum:-\n * HackEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/HackEnum'))>>\nenum RenamedEnum: int {\n  Value1 = 0;\n  renamedValue = 1;\n}\n\nclass RenamedEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.HackEnum\",\n        \"elements\" => dict[\n          0 => \"Value1\",\n          1 => \"Value2\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\Name' => \\facebook\\thrift\\annotation\\hack\\Name::fromShape(\n          shape(\n            \"name\" => \"RenamedEnum\",\n          )\n        ),\n      ],\n      'constants' => dict[\n        'Value2' => dict[\n          '\\facebook\\thrift\\annotation\\hack\\Name' => \\facebook\\thrift\\annotation\\hack\\Name::fromShape(\n            shape(\n              \"name\" => \"renamedValue\",\n            )\n          ),\n        ],\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * MyStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/MyStruct'))>>\nclass MyStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'MyIntField',\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'MyStringField',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'MyDataField',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\basic\\MyDataItem::class,\n    ),\n    4 => shape(\n      'var' => 'myEnum',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\basic\\MyEnum::class,\n    ),\n    5 => shape(\n      'var' => 'oneway',\n      'type' => \\TType::BOOL,\n    ),\n    6 => shape(\n      'var' => 'readonly',\n      'type' => \\TType::BOOL,\n    ),\n    7 => shape(\n      'var' => 'idempotent',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'MyIntField' => 1,\n    'MyStringField' => 2,\n    'MyDataField' => 3,\n    'myEnum' => 4,\n    'oneway' => 5,\n    'readonly' => 6,\n    'idempotent' => 7,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'MyIntField' => ?int,\n    ?'MyStringField' => ?string,\n    ?'MyDataField' => ?\\test\\fixtures\\basic\\MyDataItem,\n    ?'myEnum' => ?\\test\\fixtures\\basic\\MyEnum,\n    ?'oneway' => ?bool,\n    ?'readonly' => ?bool,\n    ?'idempotent' => ?bool,\n  );\n\n  const type TShape = shape(\n    'MyIntField' => int,\n    'MyStringField' => string,\n    ?'MyDataField' => ?\\test\\fixtures\\basic\\MyDataItem::TShape,\n    ?'myEnum' => ?\\test\\fixtures\\basic\\MyEnum,\n    'oneway' => bool,\n    'readonly' => bool,\n    'idempotent' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 4991963907375804067;\n  /**\n   * Original thrift field:-\n   * 1: i64 MyIntField\n   */\n  public int $MyIntField;\n  /**\n   * Original thrift field:-\n   * 2: string MyStringField\n   */\n  public string $MyStringField;\n  /**\n   * Original thrift field:-\n   * 3: module.MyDataItem MyDataField\n   */\n  public ?\\test\\fixtures\\basic\\MyDataItem $MyDataField;\n  /**\n   * Original thrift field:-\n   * 4: module.MyEnum myEnum\n   */\n  public ?\\test\\fixtures\\basic\\MyEnum $myEnum;\n  /**\n   * Original thrift field:-\n   * 5: bool oneway\n   */\n  public bool $oneway;\n  /**\n   * Original thrift field:-\n   * 6: bool readonly\n   */\n  public bool $readonly;\n  /**\n   * Original thrift field:-\n   * 7: bool idempotent\n   */\n  public bool $idempotent;\n\n  public function __construct(?int $MyIntField = null, ?string $MyStringField = null, ?\\test\\fixtures\\basic\\MyDataItem $MyDataField = null, ?\\test\\fixtures\\basic\\MyEnum $myEnum = null, ?bool $oneway = null, ?bool $readonly = null, ?bool $idempotent = null)[] {\n    $this->MyIntField = $MyIntField ?? 0;\n    $this->MyStringField = $MyStringField ?? '';\n    $this->MyDataField = $MyDataField;\n    $this->myEnum = $myEnum;\n    $this->oneway = $oneway ?? false;\n    $this->readonly = $readonly ?? false;\n    $this->idempotent = $idempotent ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'MyIntField'),\n      Shapes::idx($shape, 'MyStringField'),\n      Shapes::idx($shape, 'MyDataField'),\n      Shapes::idx($shape, 'myEnum'),\n      Shapes::idx($shape, 'oneway'),\n      Shapes::idx($shape, 'readonly'),\n      Shapes::idx($shape, 'idempotent'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"MyIntField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"MyStringField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyDataItem\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.MyDataItem\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"MyDataField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"myEnum\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"oneway\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"readonly\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"idempotent\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['MyIntField'],\n      $shape['MyStringField'],\n      Shapes::idx($shape, 'MyDataField') === null ? null : (\\test\\fixtures\\basic\\MyDataItem::__fromShape($shape['MyDataField'])),\n      Shapes::idx($shape, 'myEnum'),\n      $shape['oneway'],\n      $shape['readonly'],\n      $shape['idempotent'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'MyIntField' => $this->MyIntField,\n      'MyStringField' => $this->MyStringField,\n      'MyDataField' => $this->MyDataField?->__toShape(),\n      'myEnum' => $this->myEnum,\n      'oneway' => $this->oneway,\n      'readonly' => $this->readonly,\n      'idempotent' => $this->idempotent,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'MyIntField') !== null) {\n      $this->MyIntField = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['MyIntField']);\n    }\n    if (idx($parsed, 'MyStringField') !== null) {\n      $this->MyStringField = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['MyStringField']);\n    }\n    if (idx($parsed, 'MyDataField') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\basic\\MyDataItem>($parsed['MyDataField']));\n      $_tmp1 = \\test\\fixtures\\basic\\MyDataItem::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->MyDataField = $_tmp1;\n    }\n    if (idx($parsed, 'myEnum') !== null) {\n      $this->myEnum = \\test\\fixtures\\basic\\MyEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\basic\\MyEnum>($parsed['myEnum']));\n    }\n    if (idx($parsed, 'oneway') !== null) {\n      $this->oneway = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['oneway']);\n    }\n    if (idx($parsed, 'readonly') !== null) {\n      $this->readonly = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['readonly']);\n    }\n    if (idx($parsed, 'idempotent') !== null) {\n      $this->idempotent = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['idempotent']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyDataItem\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/MyDataItem'))>>\nclass MyDataItem implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyDataItem';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyDataItem\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nenum MyUnionEnum: int {\n  _EMPTY_ = 0;\n  myEnum = 1;\n  myStruct = 2;\n  myDataItem = 3;\n}\n\n/**\n * Original thrift struct:-\n * MyUnion\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/MyUnion'))>>\nclass MyUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<\\test\\fixtures\\basic\\MyUnionEnum>, \\IThriftShapishSyncStruct {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'myEnum',\n      'union' => true,\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\basic\\MyEnum::class,\n    ),\n    2 => shape(\n      'var' => 'myStruct',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\basic\\MyStruct::class,\n    ),\n    3 => shape(\n      'var' => 'myDataItem',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\basic\\MyDataItem::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'myEnum' => 1,\n    'myStruct' => 2,\n    'myDataItem' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'myEnum' => ?\\test\\fixtures\\basic\\MyEnum,\n    ?'myStruct' => ?\\test\\fixtures\\basic\\MyStruct,\n    ?'myDataItem' => ?\\test\\fixtures\\basic\\MyDataItem,\n  );\n\n  const type TShape = shape(\n    ?'myEnum' => ?\\test\\fixtures\\basic\\MyEnum,\n    ?'myStruct' => ?\\test\\fixtures\\basic\\MyStruct::TShape,\n    ?'myDataItem' => ?\\test\\fixtures\\basic\\MyDataItem::TShape,\n    ...\n  );\n  const int STRUCTURAL_ID = 4641160414833587430;\n  /**\n   * Original thrift field:-\n   * 1: module.MyEnum myEnum\n   */\n  public ?\\test\\fixtures\\basic\\MyEnum $myEnum;\n  /**\n   * Original thrift field:-\n   * 2: module.MyStruct myStruct\n   */\n  public ?\\test\\fixtures\\basic\\MyStruct $myStruct;\n  /**\n   * Original thrift field:-\n   * 3: module.MyDataItem myDataItem\n   */\n  public ?\\test\\fixtures\\basic\\MyDataItem $myDataItem;\n  protected \\test\\fixtures\\basic\\MyUnionEnum $_type = \\test\\fixtures\\basic\\MyUnionEnum::_EMPTY_;\n\n  public function __construct(?\\test\\fixtures\\basic\\MyEnum $myEnum = null, ?\\test\\fixtures\\basic\\MyStruct $myStruct = null, ?\\test\\fixtures\\basic\\MyDataItem $myDataItem = null)[] {\n    $this->_type = \\test\\fixtures\\basic\\MyUnionEnum::_EMPTY_;\n    if ($myEnum !== null) {\n      $this->myEnum = $myEnum;\n      $this->_type = \\test\\fixtures\\basic\\MyUnionEnum::myEnum;\n    }\n    if ($myStruct !== null) {\n      $this->myStruct = $myStruct;\n      $this->_type = \\test\\fixtures\\basic\\MyUnionEnum::myStruct;\n    }\n    if ($myDataItem !== null) {\n      $this->myDataItem = $myDataItem;\n      $this->_type = \\test\\fixtures\\basic\\MyUnionEnum::myDataItem;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'myEnum'),\n      Shapes::idx($shape, 'myStruct'),\n      Shapes::idx($shape, 'myDataItem'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyUnion';\n  }\n\n  public function getType()[]: \\test\\fixtures\\basic\\MyUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case \\test\\fixtures\\basic\\MyUnionEnum::myEnum:\n        $this->myEnum = null;\n        break;\n      case \\test\\fixtures\\basic\\MyUnionEnum::myStruct:\n        $this->myStruct = null;\n        break;\n      case \\test\\fixtures\\basic\\MyUnionEnum::myDataItem:\n        $this->myDataItem = null;\n        break;\n      case \\test\\fixtures\\basic\\MyUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = \\test\\fixtures\\basic\\MyUnionEnum::_EMPTY_;\n  }\n\n  public function set_myEnum(\\test\\fixtures\\basic\\MyEnum $myEnum)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\basic\\MyUnionEnum::myEnum;\n    $this->myEnum = $myEnum;\n    return $this;\n  }\n\n  public function get_myEnum()[]: ?\\test\\fixtures\\basic\\MyEnum {\n    return $this->myEnum;\n  }\n\n  public function getx_myEnum()[]: \\test\\fixtures\\basic\\MyEnum {\n    invariant(\n      $this->_type === \\test\\fixtures\\basic\\MyUnionEnum::myEnum,\n      'get_myEnum called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->myEnum as nonnull;\n  }\n\n  public function set_myStruct(\\test\\fixtures\\basic\\MyStruct $myStruct)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\basic\\MyUnionEnum::myStruct;\n    $this->myStruct = $myStruct;\n    return $this;\n  }\n\n  public function get_myStruct()[]: ?\\test\\fixtures\\basic\\MyStruct {\n    return $this->myStruct;\n  }\n\n  public function getx_myStruct()[]: \\test\\fixtures\\basic\\MyStruct {\n    invariant(\n      $this->_type === \\test\\fixtures\\basic\\MyUnionEnum::myStruct,\n      'get_myStruct called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->myStruct as nonnull;\n  }\n\n  public function set_myDataItem(\\test\\fixtures\\basic\\MyDataItem $myDataItem)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\basic\\MyUnionEnum::myDataItem;\n    $this->myDataItem = $myDataItem;\n    return $this;\n  }\n\n  public function get_myDataItem()[]: ?\\test\\fixtures\\basic\\MyDataItem {\n    return $this->myDataItem;\n  }\n\n  public function getx_myDataItem()[]: \\test\\fixtures\\basic\\MyDataItem {\n    invariant(\n      $this->_type === \\test\\fixtures\\basic\\MyUnionEnum::myDataItem,\n      'get_myDataItem called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->myDataItem as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyUnion\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"myEnum\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"myStruct\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyDataItem\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"myDataItem\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'myEnum'),\n      Shapes::idx($shape, 'myStruct') === null ? null : (\\test\\fixtures\\basic\\MyStruct::__fromShape($shape['myStruct'])),\n      Shapes::idx($shape, 'myDataItem') === null ? null : (\\test\\fixtures\\basic\\MyDataItem::__fromShape($shape['myDataItem'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'myEnum' => $this->myEnum,\n      'myStruct' => $this->myStruct?->__toShape(),\n      'myDataItem' => $this->myDataItem?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = \\test\\fixtures\\basic\\MyUnionEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'myEnum') !== null) {\n      $this->myEnum = \\test\\fixtures\\basic\\MyEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\basic\\MyEnum>($parsed['myEnum']));\n      $this->_type = \\test\\fixtures\\basic\\MyUnionEnum::myEnum;\n    }\n    if (idx($parsed, 'myStruct') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\basic\\MyStruct>($parsed['myStruct']));\n      $_tmp1 = \\test\\fixtures\\basic\\MyStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->myStruct = $_tmp1;\n      $this->_type = \\test\\fixtures\\basic\\MyUnionEnum::myStruct;\n    }\n    if (idx($parsed, 'myDataItem') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\basic\\MyDataItem>($parsed['myDataItem']));\n      $_tmp3 = \\test\\fixtures\\basic\\MyDataItem::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->myDataItem = $_tmp3;\n      $this->_type = \\test\\fixtures\\basic\\MyUnionEnum::myDataItem;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ReservedKeyword\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/ReservedKeyword'))>>\nclass MyRenamedStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'reserved_field',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'reserved_field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'reserved_field' => ?int,\n  );\n\n  const type TShape = shape(\n    'reserved_field' => int,\n    ...\n  );\n  const int STRUCTURAL_ID = 9144321583101923955;\n  /**\n   * Original thrift field:-\n   * 1: i32 reserved_field\n   */\n  public int $reserved_field;\n\n  public function __construct(?int $reserved_field = null)[] {\n    $this->reserved_field = $reserved_field ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reserved_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyRenamedStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ReservedKeyword\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"reserved_field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\Name' => \\facebook\\thrift\\annotation\\hack\\Name::fromShape(\n          shape(\n            \"name\" => \"MyRenamedStruct\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'reserved_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Name' => \\facebook\\thrift\\annotation\\hack\\Name::fromShape(\n              shape(\n                \"name\" => \"renamed_field\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['reserved_field'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'reserved_field' => $this->reserved_field,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'reserved_field') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['reserved_field']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->reserved_field = (int)$_tmp0;\n      }\n    }\n  }\n\n}\n\nenum MyRenamedUnionEnum: int {\n  _EMPTY_ = 0;\n  reserved_field = 1;\n}\n\n/**\n * Original thrift struct:-\n * UnionToBeRenamed\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/UnionToBeRenamed'))>>\nclass MyRenamedUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<\\test\\fixtures\\basic\\MyRenamedUnionEnum>, \\IThriftShapishSyncStruct {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'reserved_field',\n      'union' => true,\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'reserved_field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'reserved_field' => ?int,\n  );\n\n  const type TShape = shape(\n    ?'reserved_field' => ?int,\n    ...\n  );\n  const int STRUCTURAL_ID = 9144321583101923955;\n  /**\n   * Original thrift field:-\n   * 1: i32 reserved_field\n   */\n  public ?int $reserved_field;\n  protected \\test\\fixtures\\basic\\MyRenamedUnionEnum $_type = \\test\\fixtures\\basic\\MyRenamedUnionEnum::_EMPTY_;\n\n  public function __construct(?int $reserved_field = null)[] {\n    $this->_type = \\test\\fixtures\\basic\\MyRenamedUnionEnum::_EMPTY_;\n    if ($reserved_field !== null) {\n      $this->reserved_field = $reserved_field;\n      $this->_type = \\test\\fixtures\\basic\\MyRenamedUnionEnum::reserved_field;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reserved_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyRenamedUnion';\n  }\n\n  public function getType()[]: \\test\\fixtures\\basic\\MyRenamedUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case \\test\\fixtures\\basic\\MyRenamedUnionEnum::reserved_field:\n        $this->reserved_field = null;\n        break;\n      case \\test\\fixtures\\basic\\MyRenamedUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = \\test\\fixtures\\basic\\MyRenamedUnionEnum::_EMPTY_;\n  }\n\n  public function set_reserved_field(int $reserved_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\basic\\MyRenamedUnionEnum::reserved_field;\n    $this->reserved_field = $reserved_field;\n    return $this;\n  }\n\n  public function get_reserved_field()[]: ?int {\n    return $this->reserved_field;\n  }\n\n  public function getx_reserved_field()[]: int {\n    invariant(\n      $this->_type === \\test\\fixtures\\basic\\MyRenamedUnionEnum::reserved_field,\n      'get_reserved_field called on an instance of UnionToBeRenamed whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->reserved_field as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.UnionToBeRenamed\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"reserved_field\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\Name' => \\facebook\\thrift\\annotation\\hack\\Name::fromShape(\n          shape(\n            \"name\" => \"MyRenamedUnion\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'reserved_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Name' => \\facebook\\thrift\\annotation\\hack\\Name::fromShape(\n              shape(\n                \"name\" => \"renamed_field\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reserved_field'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'reserved_field' => $this->reserved_field,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = \\test\\fixtures\\basic\\UnionToBeRenamedEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'reserved_field') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['reserved_field']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->reserved_field = (int)$_tmp0;\n      }\n      $this->_type = \\test\\fixtures\\basic\\UnionToBeRenamedEnum::reserved_field;\n    }\n  }\n\n}\n\n", "num_lines": 1101}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures\\basic;\n\nmodule hack.module.test;\n/**\n * Original thrift service:-\n * MyService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/MyService'))>>\ninterface MyServiceAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   ping();\n   */\n  public function ping(): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getRandomData();\n   */\n  public function getRandomData(): Awaitable<string>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   sink(1: i64 sink);\n   */\n  public function sink(int $sink): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   putDataById(1: i64 id,\n   *               2: string data);\n   */\n  public function putDataById(int $id, string $data): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   hasDataById(1: i64 id);\n   */\n  public function hasDataById(int $id): Awaitable<bool>;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getDataById(1: i64 id);\n   */\n  public function getDataById(int $id): Awaitable<string>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   deleteDataById(1: i64 id);\n   */\n  public function deleteDataById(int $id): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * oneway void\n   *   lobDataById(1: i64 id,\n   *               2: string data);\n   */\n  public function lobDataById(int $id, string $data): Awaitable<void>;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/MyService'))>>\ninterface MyServiceIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   ping();\n   */\n  public function ping(): void;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getRandomData();\n   */\n  public function getRandomData(): string;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   sink(1: i64 sink);\n   */\n  public function sink(int $sink): void;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   putDataById(1: i64 id,\n   *               2: string data);\n   */\n  public function putDataById(int $id, string $data): void;\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   hasDataById(1: i64 id);\n   */\n  public function hasDataById(int $id): bool;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getDataById(1: i64 id);\n   */\n  public function getDataById(int $id): string;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   deleteDataById(1: i64 id);\n   */\n  public function deleteDataById(int $id): void;\n\n  /**\n   * Original thrift definition:-\n   * oneway void\n   *   lobDataById(1: i64 id,\n   *               2: string data);\n   */\n  public function lobDataById(int $id, string $data): void;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/MyService'))>>\ninterface MyServiceAsyncClientIf extends MyServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/MyService'))>>\ninterface MyServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   ping();\n   */\n  public function ping(): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getRandomData();\n   */\n  public function getRandomData(): Awaitable<string>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   sink(1: i64 sink);\n   */\n  public function sink(int $sink): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   putDataById(1: i64 id,\n   *               2: string data);\n   */\n  public function putDataById(int $id, string $data): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   hasDataById(1: i64 id);\n   */\n  public function hasDataById(int $id): Awaitable<bool>;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getDataById(1: i64 id);\n   */\n  public function getDataById(int $id): Awaitable<string>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   deleteDataById(1: i64 id);\n   */\n  public function deleteDataById(int $id): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * oneway void\n   *   lobDataById(1: i64 id,\n   *               2: string data);\n   */\n  public function lobDataById(int $id, string $data): Awaitable<void>;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ntrait MyServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass MyServiceAsyncClient extends \\ThriftClientBase implements MyServiceAsyncClientIf {\n  use MyServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   ping();\n   */\n  public async function ping(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\MyService_ping_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"ping\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"ping\", false);\n    await $this->genAwaitResponse(\\test\\fixtures\\basic\\MyService_ping_result::class, \"ping\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getRandomData();\n   */\n  public async function getRandomData(): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\MyService_getRandomData_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"getRandomData\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"getRandomData\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\basic\\MyService_getRandomData_result::class, \"getRandomData\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   sink(1: i64 sink);\n   */\n  public async function sink(int $sink): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\MyService_sink_args::fromShape(shape(\n      'sink' => $sink,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"sink\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"sink\", false);\n    await $this->genAwaitResponse(\\test\\fixtures\\basic\\MyService_sink_result::class, \"sink\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   putDataById(1: i64 id,\n   *               2: string data);\n   */\n  public async function putDataById(int $id, string $data): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\MyService_putDataById_args::fromShape(shape(\n      'id' => $id,\n      'data' => $data,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"putDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"putDataById\", false);\n    await $this->genAwaitResponse(\\test\\fixtures\\basic\\MyService_putDataById_result::class, \"putDataById\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   hasDataById(1: i64 id);\n   */\n  public async function hasDataById(int $id): Awaitable<bool> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\MyService_hasDataById_args::fromShape(shape(\n      'id' => $id,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"hasDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"hasDataById\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\basic\\MyService_hasDataById_result::class, \"hasDataById\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getDataById(1: i64 id);\n   */\n  public async function getDataById(int $id): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\MyService_getDataById_args::fromShape(shape(\n      'id' => $id,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"getDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"getDataById\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\basic\\MyService_getDataById_result::class, \"getDataById\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   deleteDataById(1: i64 id);\n   */\n  public async function deleteDataById(int $id): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\MyService_deleteDataById_args::fromShape(shape(\n      'id' => $id,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"deleteDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"deleteDataById\", false);\n    await $this->genAwaitResponse(\\test\\fixtures\\basic\\MyService_deleteDataById_result::class, \"deleteDataById\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * oneway void\n   *   lobDataById(1: i64 id,\n   *               2: string data);\n   */\n  public async function lobDataById(int $id, string $data): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\MyService_lobDataById_args::fromShape(shape(\n      'id' => $id,\n      'data' => $data,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"lobDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"lobDataById\", true);\n    await $this->genAwaitNoResponse($rpc_options);\n  }\n\n}\n\nclass MyServiceClient extends \\ThriftClientBase implements MyServiceClientIf {\n  use MyServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   ping();\n   */\n  public async function ping(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\MyService_ping_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"ping\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"ping\", false);\n    await $this->genAwaitResponse(\\test\\fixtures\\basic\\MyService_ping_result::class, \"ping\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getRandomData();\n   */\n  public async function getRandomData(): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\MyService_getRandomData_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"getRandomData\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"getRandomData\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\basic\\MyService_getRandomData_result::class, \"getRandomData\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   sink(1: i64 sink);\n   */\n  public async function sink(int $sink): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\MyService_sink_args::fromShape(shape(\n      'sink' => $sink,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"sink\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"sink\", false);\n    await $this->genAwaitResponse(\\test\\fixtures\\basic\\MyService_sink_result::class, \"sink\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   putDataById(1: i64 id,\n   *               2: string data);\n   */\n  public async function putDataById(int $id, string $data): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\MyService_putDataById_args::fromShape(shape(\n      'id' => $id,\n      'data' => $data,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"putDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"putDataById\", false);\n    await $this->genAwaitResponse(\\test\\fixtures\\basic\\MyService_putDataById_result::class, \"putDataById\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   hasDataById(1: i64 id);\n   */\n  public async function hasDataById(int $id): Awaitable<bool> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\MyService_hasDataById_args::fromShape(shape(\n      'id' => $id,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"hasDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"hasDataById\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\basic\\MyService_hasDataById_result::class, \"hasDataById\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getDataById(1: i64 id);\n   */\n  public async function getDataById(int $id): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\MyService_getDataById_args::fromShape(shape(\n      'id' => $id,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"getDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"getDataById\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\basic\\MyService_getDataById_result::class, \"getDataById\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   deleteDataById(1: i64 id);\n   */\n  public async function deleteDataById(int $id): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\MyService_deleteDataById_args::fromShape(shape(\n      'id' => $id,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"deleteDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"deleteDataById\", false);\n    await $this->genAwaitResponse(\\test\\fixtures\\basic\\MyService_deleteDataById_result::class, \"deleteDataById\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * oneway void\n   *   lobDataById(1: i64 id,\n   *               2: string data);\n   */\n  public async function lobDataById(int $id, string $data): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\MyService_lobDataById_args::fromShape(shape(\n      'id' => $id,\n      'data' => $data,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"lobDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"lobDataById\", true);\n    await $this->genAwaitNoResponse($rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_ping(): int {\n    $args = \\test\\fixtures\\basic\\MyService_ping_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"ping\", false);\n  }\n  public function recv_ping(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(\\test\\fixtures\\basic\\MyService_ping_result::class, \"ping\", true, $expectedsequenceid);\n  }\n  public function send_getRandomData(): int {\n    $args = \\test\\fixtures\\basic\\MyService_getRandomData_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"getRandomData\", false);\n  }\n  public function recv_getRandomData(?int $expectedsequenceid = null): string {\n    return $this->recvImplHelper(\\test\\fixtures\\basic\\MyService_getRandomData_result::class, \"getRandomData\", false, $expectedsequenceid);\n  }\n  public function send_sink(int $sink): int {\n    $args = \\test\\fixtures\\basic\\MyService_sink_args::fromShape(shape(\n      'sink' => $sink,\n    ));\n    return $this->sendImplHelper($args, \"sink\", false);\n  }\n  public function recv_sink(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(\\test\\fixtures\\basic\\MyService_sink_result::class, \"sink\", true, $expectedsequenceid);\n  }\n  public function send_putDataById(int $id, string $data): int {\n    $args = \\test\\fixtures\\basic\\MyService_putDataById_args::fromShape(shape(\n      'id' => $id,\n      'data' => $data,\n    ));\n    return $this->sendImplHelper($args, \"putDataById\", false);\n  }\n  public function recv_putDataById(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(\\test\\fixtures\\basic\\MyService_putDataById_result::class, \"putDataById\", true, $expectedsequenceid);\n  }\n  public function send_hasDataById(int $id): int {\n    $args = \\test\\fixtures\\basic\\MyService_hasDataById_args::fromShape(shape(\n      'id' => $id,\n    ));\n    return $this->sendImplHelper($args, \"hasDataById\", false);\n  }\n  public function recv_hasDataById(?int $expectedsequenceid = null): bool {\n    return $this->recvImplHelper(\\test\\fixtures\\basic\\MyService_hasDataById_result::class, \"hasDataById\", false, $expectedsequenceid);\n  }\n  public function send_getDataById(int $id): int {\n    $args = \\test\\fixtures\\basic\\MyService_getDataById_args::fromShape(shape(\n      'id' => $id,\n    ));\n    return $this->sendImplHelper($args, \"getDataById\", false);\n  }\n  public function recv_getDataById(?int $expectedsequenceid = null): string {\n    return $this->recvImplHelper(\\test\\fixtures\\basic\\MyService_getDataById_result::class, \"getDataById\", false, $expectedsequenceid);\n  }\n  public function send_deleteDataById(int $id): int {\n    $args = \\test\\fixtures\\basic\\MyService_deleteDataById_args::fromShape(shape(\n      'id' => $id,\n    ));\n    return $this->sendImplHelper($args, \"deleteDataById\", false);\n  }\n  public function recv_deleteDataById(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(\\test\\fixtures\\basic\\MyService_deleteDataById_result::class, \"deleteDataById\", true, $expectedsequenceid);\n  }\n  public function send_lobDataById(int $id, string $data): int {\n    $args = \\test\\fixtures\\basic\\MyService_lobDataById_args::fromShape(shape(\n      'id' => $id,\n      'data' => $data,\n    ));\n    return $this->sendImplHelper($args, \"lobDataById\", true);\n  }\n}\n\nabstract class MyServiceAsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as MyServiceAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = MyServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'MyService';\n\n  protected async function process_ping(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('ping');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'ping', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\MyService_ping_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\MyService_ping_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\MyService_ping_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'ping', $args);\n    $result = \\test\\fixtures\\basic\\MyService_ping_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\MyService', 'ping', $args);\n      await $this->handler->ping();\n      $this->eventHandler_->postExec($handler_ctx, 'ping', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'ping', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'ping', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'ping', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'ping', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"ping\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'ping', $result);\n  }\n  protected async function process_getRandomData(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('getRandomData');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'getRandomData', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\MyService_getRandomData_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\MyService_getRandomData_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\MyService_getRandomData_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'getRandomData', $args);\n    $result = \\test\\fixtures\\basic\\MyService_getRandomData_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\MyService', 'getRandomData', $args);\n      $result->success = await $this->handler->getRandomData();\n      $this->eventHandler_->postExec($handler_ctx, 'getRandomData', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'getRandomData', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'getRandomData', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getRandomData', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getRandomData', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getRandomData\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'getRandomData', $result);\n  }\n  protected async function process_sink(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('sink');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'sink', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\MyService_sink_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\MyService_sink_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\MyService_sink_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'sink', $args);\n    $result = \\test\\fixtures\\basic\\MyService_sink_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\MyService', 'sink', $args);\n      await $this->handler->sink($args->sink);\n      $this->eventHandler_->postExec($handler_ctx, 'sink', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'sink', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'sink', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'sink', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'sink', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"sink\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'sink', $result);\n  }\n  protected async function process_putDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('putDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'putDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\MyService_putDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\MyService_putDataById_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\MyService_putDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'putDataById', $args);\n    $result = \\test\\fixtures\\basic\\MyService_putDataById_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\MyService', 'putDataById', $args);\n      await $this->handler->putDataById($args->id, $args->data);\n      $this->eventHandler_->postExec($handler_ctx, 'putDataById', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'putDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'putDataById', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'putDataById', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'putDataById', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"putDataById\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'putDataById', $result);\n  }\n  protected async function process_hasDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('hasDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'hasDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\MyService_hasDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\MyService_hasDataById_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\MyService_hasDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'hasDataById', $args);\n    $result = \\test\\fixtures\\basic\\MyService_hasDataById_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\MyService', 'hasDataById', $args);\n      $result->success = await $this->handler->hasDataById($args->id);\n      $this->eventHandler_->postExec($handler_ctx, 'hasDataById', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'hasDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'hasDataById', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'hasDataById', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'hasDataById', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"hasDataById\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'hasDataById', $result);\n  }\n  protected async function process_getDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('getDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'getDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\MyService_getDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\MyService_getDataById_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\MyService_getDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'getDataById', $args);\n    $result = \\test\\fixtures\\basic\\MyService_getDataById_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\MyService', 'getDataById', $args);\n      $result->success = await $this->handler->getDataById($args->id);\n      $this->eventHandler_->postExec($handler_ctx, 'getDataById', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'getDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'getDataById', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getDataById', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getDataById', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getDataById\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'getDataById', $result);\n  }\n  protected async function process_deleteDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('deleteDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'deleteDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\MyService_deleteDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\MyService_deleteDataById_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\MyService_deleteDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'deleteDataById', $args);\n    $result = \\test\\fixtures\\basic\\MyService_deleteDataById_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\MyService', 'deleteDataById', $args);\n      await $this->handler->deleteDataById($args->id);\n      $this->eventHandler_->postExec($handler_ctx, 'deleteDataById', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'deleteDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'deleteDataById', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'deleteDataById', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'deleteDataById', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"deleteDataById\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'deleteDataById', $result);\n  }\n  protected async function process_lobDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('lobDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'lobDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\MyService_lobDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\MyService_lobDataById_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\MyService_lobDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'lobDataById', $args);\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\MyService', 'lobDataById', $args);\n      await $this->handler->lobDataById($args->id, $args->data);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'lobDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    return;\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = MyServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass MyServiceAsyncProcessor extends MyServiceAsyncProcessorBase {\n  const type TThriftIf = MyServiceAsyncIf;\n}\n\nabstract class MyServiceSyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as MyServiceIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = MyServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'MyService';\n\n  protected function process_ping(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('ping');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'ping', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\MyService_ping_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\MyService_ping_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\MyService_ping_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'ping', $args);\n    $result = \\test\\fixtures\\basic\\MyService_ping_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\MyService', 'ping', $args);\n      $this->handler->ping();\n      $this->eventHandler_->postExec($handler_ctx, 'ping', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'ping', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'ping', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'ping', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'ping', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"ping\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'ping', $result);\n  }\n  protected function process_getRandomData(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('getRandomData');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'getRandomData', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\MyService_getRandomData_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\MyService_getRandomData_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\MyService_getRandomData_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'getRandomData', $args);\n    $result = \\test\\fixtures\\basic\\MyService_getRandomData_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\MyService', 'getRandomData', $args);\n      $result->success = $this->handler->getRandomData();\n      $this->eventHandler_->postExec($handler_ctx, 'getRandomData', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'getRandomData', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'getRandomData', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getRandomData', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getRandomData', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getRandomData\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'getRandomData', $result);\n  }\n  protected function process_sink(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('sink');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'sink', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\MyService_sink_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\MyService_sink_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\MyService_sink_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'sink', $args);\n    $result = \\test\\fixtures\\basic\\MyService_sink_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\MyService', 'sink', $args);\n      $this->handler->sink($args->sink);\n      $this->eventHandler_->postExec($handler_ctx, 'sink', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'sink', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'sink', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'sink', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'sink', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"sink\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'sink', $result);\n  }\n  protected function process_putDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('putDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'putDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\MyService_putDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\MyService_putDataById_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\MyService_putDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'putDataById', $args);\n    $result = \\test\\fixtures\\basic\\MyService_putDataById_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\MyService', 'putDataById', $args);\n      $this->handler->putDataById($args->id, $args->data);\n      $this->eventHandler_->postExec($handler_ctx, 'putDataById', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'putDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'putDataById', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'putDataById', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'putDataById', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"putDataById\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'putDataById', $result);\n  }\n  protected function process_hasDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('hasDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'hasDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\MyService_hasDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\MyService_hasDataById_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\MyService_hasDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'hasDataById', $args);\n    $result = \\test\\fixtures\\basic\\MyService_hasDataById_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\MyService', 'hasDataById', $args);\n      $result->success = $this->handler->hasDataById($args->id);\n      $this->eventHandler_->postExec($handler_ctx, 'hasDataById', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'hasDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'hasDataById', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'hasDataById', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'hasDataById', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"hasDataById\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'hasDataById', $result);\n  }\n  protected function process_getDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('getDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'getDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\MyService_getDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\MyService_getDataById_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\MyService_getDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'getDataById', $args);\n    $result = \\test\\fixtures\\basic\\MyService_getDataById_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\MyService', 'getDataById', $args);\n      $result->success = $this->handler->getDataById($args->id);\n      $this->eventHandler_->postExec($handler_ctx, 'getDataById', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'getDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'getDataById', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getDataById', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getDataById', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getDataById\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'getDataById', $result);\n  }\n  protected function process_deleteDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('deleteDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'deleteDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\MyService_deleteDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\MyService_deleteDataById_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\MyService_deleteDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'deleteDataById', $args);\n    $result = \\test\\fixtures\\basic\\MyService_deleteDataById_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\MyService', 'deleteDataById', $args);\n      $this->handler->deleteDataById($args->id);\n      $this->eventHandler_->postExec($handler_ctx, 'deleteDataById', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'deleteDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'deleteDataById', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'deleteDataById', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'deleteDataById', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"deleteDataById\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'deleteDataById', $result);\n  }\n  protected function process_lobDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('lobDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'lobDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\MyService_lobDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\MyService_lobDataById_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\MyService_lobDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'lobDataById', $args);\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\MyService', 'lobDataById', $args);\n      $this->handler->lobDataById($args->id, $args->data);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'lobDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    return;\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = MyServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass MyServiceSyncProcessor extends MyServiceSyncProcessorBase {\n  const type TThriftIf = MyServiceIf;\n}\n// For backwards compatibility\nclass MyServiceProcessor extends MyServiceSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass MyService_ping_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_ping_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ping_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyService_ping_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_ping_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_ping_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyService_getRandomData_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_getRandomData_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.getRandomData_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyService_getRandomData_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_getRandomData_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_getRandomData_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $this->success = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['success']);\n    }\n  }\n\n}\n\nclass MyService_sink_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'sink',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'sink' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'sink' => ?int,\n  );\n\n  const type TShape = shape(\n    'sink' => int,\n    ...\n  );\n  const int STRUCTURAL_ID = 7104007081489563250;\n  public int $sink;\n\n  public function __construct(?int $sink = null)[] {\n    $this->sink = $sink ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'sink'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_sink_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.sink_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"sink\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['sink'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'sink' => $this->sink,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'sink') !== null) {\n      $this->sink = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['sink']);\n    }\n  }\n\n}\n\nclass MyService_sink_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_sink_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_sink_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyService_putDataById_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'id',\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'data',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'id' => 1,\n    'data' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'id' => ?int,\n    ?'data' => ?string,\n  );\n\n  const type TShape = shape(\n    'id' => int,\n    'data' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 1055685087985327657;\n  public int $id;\n  public string $data;\n\n  public function __construct(?int $id = null, ?string $data = null)[] {\n    $this->id = $id ?? 0;\n    $this->data = $data ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'id'),\n      Shapes::idx($shape, 'data'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_putDataById_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.putDataById_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"id\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"data\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['id'],\n      $shape['data'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'id' => $this->id,\n      'data' => $this->data,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'id') !== null) {\n      $this->id = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['id']);\n    }\n    if (idx($parsed, 'data') !== null) {\n      $this->data = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['data']);\n    }\n  }\n\n}\n\nclass MyService_putDataById_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_putDataById_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_putDataById_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyService_hasDataById_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'id',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'id' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'id' => ?int,\n  );\n\n  const type TShape = shape(\n    'id' => int,\n    ...\n  );\n  const int STRUCTURAL_ID = 3807211151619655933;\n  public int $id;\n\n  public function __construct(?int $id = null)[] {\n    $this->id = $id ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'id'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_hasDataById_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.hasDataById_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"id\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['id'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'id' => $this->id,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'id') !== null) {\n      $this->id = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['id']);\n    }\n  }\n\n}\n\nclass MyService_hasDataById_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = bool;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 8594383818423018844;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_hasDataById_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_hasDataById_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $this->success = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['success']);\n    }\n  }\n\n}\n\nclass MyService_getDataById_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'id',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'id' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'id' => ?int,\n  );\n\n  const type TShape = shape(\n    'id' => int,\n    ...\n  );\n  const int STRUCTURAL_ID = 3807211151619655933;\n  public int $id;\n\n  public function __construct(?int $id = null)[] {\n    $this->id = $id ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'id'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_getDataById_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.getDataById_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"id\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['id'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'id' => $this->id,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'id') !== null) {\n      $this->id = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['id']);\n    }\n  }\n\n}\n\nclass MyService_getDataById_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_getDataById_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_getDataById_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $this->success = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['success']);\n    }\n  }\n\n}\n\nclass MyService_deleteDataById_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'id',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'id' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'id' => ?int,\n  );\n\n  const type TShape = shape(\n    'id' => int,\n    ...\n  );\n  const int STRUCTURAL_ID = 3807211151619655933;\n  public int $id;\n\n  public function __construct(?int $id = null)[] {\n    $this->id = $id ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'id'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_deleteDataById_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.deleteDataById_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"id\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['id'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'id' => $this->id,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'id') !== null) {\n      $this->id = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['id']);\n    }\n  }\n\n}\n\nclass MyService_deleteDataById_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_deleteDataById_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_deleteDataById_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyService_lobDataById_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'id',\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'data',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'id' => 1,\n    'data' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'id' => ?int,\n    ?'data' => ?string,\n  );\n\n  const type TShape = shape(\n    'id' => int,\n    'data' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 1055685087985327657;\n  public int $id;\n  public string $data;\n\n  public function __construct(?int $id = null, ?string $data = null)[] {\n    $this->id = $id ?? 0;\n    $this->data = $data ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'id'),\n      Shapes::idx($shape, 'data'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_lobDataById_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.lobDataById_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"id\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"data\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['id'],\n      $shape['data'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'id' => $this->id,\n      'data' => $this->data,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'id') !== null) {\n      $this->id = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['id']);\n    }\n    if (idx($parsed, 'data') !== null) {\n      $this->data = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['data']);\n    }\n  }\n\n}\n\nclass MyServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return \\tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.MyService\",\n        \"functions\" => vec[\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"ping\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n            )\n          ),\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"getRandomData\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n            )\n          ),\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"sink\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"sink\",\n                  )\n                ),\n              ],\n            )\n          ),\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"putDataById\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"id\",\n                  )\n                ),\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                      )\n                    ),\n                    \"name\" => \"data\",\n                  )\n                ),\n              ],\n            )\n          ),\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"hasDataById\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"id\",\n                  )\n                ),\n              ],\n            )\n          ),\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"getDataById\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"id\",\n                  )\n                ),\n              ],\n            )\n          ),\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"deleteDataById\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"id\",\n                  )\n                ),\n              ],\n            )\n          ),\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"lobDataById\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"id\",\n                  )\n                ),\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                      )\n                    ),\n                    \"name\" => \"data\",\n                  )\n                ),\n              ],\n              \"is_oneway\" => true,\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n        'invalid_return_for_hack' => dict[\n          '\\facebook\\thrift\\annotation\\hack\\SkipCodegen' => \\facebook\\thrift\\annotation\\hack\\SkipCodegen::fromShape(\n            shape(\n              \"reason\" => \"Invalid key type\",\n            )\n          ),\n        ],\n        'rpc_skipped_codegen' => dict[\n          '\\facebook\\thrift\\annotation\\hack\\SkipCodegen' => \\facebook\\thrift\\annotation\\hack\\SkipCodegen::fromShape(\n            shape(\n              \"reason\" => \"Skip function deprecation\",\n            )\n          ),\n        ],\n      ],\n    );\n  }\n}\n\n", "num_lines": 2969}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures\\basic;\n\nmodule hack.module.test;\n/**\n * Original thrift service:-\n * FooService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/FooService'))>>\ninterface RenamedServiceAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   simple_rpc();\n   */\n  public function simple_rpc(): Awaitable<void>;\n}\n\n/**\n * Original thrift service:-\n * FooService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/FooService'))>>\ninterface RenamedServiceIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   simple_rpc();\n   */\n  public function simple_rpc(): void;\n}\n\n/**\n * Original thrift service:-\n * FooService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/FooService'))>>\ninterface RenamedServiceAsyncClientIf extends RenamedServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * FooService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/FooService'))>>\ninterface RenamedServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   simple_rpc();\n   */\n  public function simple_rpc(): Awaitable<void>;\n}\n\n/**\n * Original thrift service:-\n * FooService\n */\ntrait RenamedServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass RenamedServiceAsyncClient extends \\ThriftClientBase implements RenamedServiceAsyncClientIf {\n  use RenamedServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   simple_rpc();\n   */\n  public async function simple_rpc(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\RenamedService_simple_rpc_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"FooService\", \"simple_rpc\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"simple_rpc\", false);\n    await $this->genAwaitResponse(\\test\\fixtures\\basic\\RenamedService_simple_rpc_result::class, \"simple_rpc\", true, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass RenamedServiceClient extends \\ThriftClientBase implements RenamedServiceClientIf {\n  use RenamedServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   simple_rpc();\n   */\n  public async function simple_rpc(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic\\RenamedService_simple_rpc_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"FooService\", \"simple_rpc\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"simple_rpc\", false);\n    await $this->genAwaitResponse(\\test\\fixtures\\basic\\RenamedService_simple_rpc_result::class, \"simple_rpc\", true, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_simple_rpc(): int {\n    $args = \\test\\fixtures\\basic\\RenamedService_simple_rpc_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"simple_rpc\", false);\n  }\n  public function recv_simple_rpc(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(\\test\\fixtures\\basic\\RenamedService_simple_rpc_result::class, \"simple_rpc\", true, $expectedsequenceid);\n  }\n}\n\nabstract class RenamedServiceAsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as RenamedServiceAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = RenamedServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'FooService';\n\n  protected async function process_simple_rpc(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('simple_rpc');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'simple_rpc', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\RenamedService_simple_rpc_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\RenamedService_simple_rpc_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\RenamedService_simple_rpc_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'simple_rpc', $args);\n    $result = \\test\\fixtures\\basic\\RenamedService_simple_rpc_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\RenamedService', 'simple_rpc', $args);\n      await $this->handler->simple_rpc();\n      $this->eventHandler_->postExec($handler_ctx, 'simple_rpc', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'simple_rpc', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'simple_rpc', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'simple_rpc', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'simple_rpc', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"simple_rpc\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'simple_rpc', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = RenamedServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass RenamedServiceAsyncProcessor extends RenamedServiceAsyncProcessorBase {\n  const type TThriftIf = RenamedServiceAsyncIf;\n}\n\nabstract class RenamedServiceSyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as RenamedServiceIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = RenamedServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'FooService';\n\n  protected function process_simple_rpc(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('simple_rpc');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'simple_rpc', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\basic\\RenamedService_simple_rpc_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\basic\\RenamedService_simple_rpc_args');\n    } else {\n      $args = \\test\\fixtures\\basic\\RenamedService_simple_rpc_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'simple_rpc', $args);\n    $result = \\test\\fixtures\\basic\\RenamedService_simple_rpc_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\basic\\RenamedService', 'simple_rpc', $args);\n      $this->handler->simple_rpc();\n      $this->eventHandler_->postExec($handler_ctx, 'simple_rpc', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'simple_rpc', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'simple_rpc', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'simple_rpc', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'simple_rpc', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"simple_rpc\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'simple_rpc', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = RenamedServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass RenamedServiceSyncProcessor extends RenamedServiceSyncProcessorBase {\n  const type TThriftIf = RenamedServiceIf;\n}\n// For backwards compatibility\nclass RenamedServiceProcessor extends RenamedServiceSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass FooService_simple_rpc_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FooService_simple_rpc_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.simple_rpc_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass FooService_simple_rpc_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FooService_simple_rpc_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.FooService_simple_rpc_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass RenamedServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return \\tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.FooService\",\n        \"functions\" => vec[\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"simple_rpc\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\Name' => \\facebook\\thrift\\annotation\\hack\\Name::fromShape(\n          shape(\n            \"name\" => \"RenamedService\",\n          )\n        ),\n      ],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 510}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1606}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * BadService\n */\ninterface BadServiceAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   bar();\n   */\n  public function bar(): Awaitable<int>;\n}\n\n/**\n * Original thrift service:-\n * BadService\n */\ninterface BadServiceIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   bar();\n   */\n  public function bar(): int;\n}\n\n/**\n * Original thrift service:-\n * BadService\n */\ninterface BadServiceAsyncClientIf extends BadServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * BadService\n */\ninterface BadServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   bar();\n   */\n  public function bar(): Awaitable<int>;\n}\n\n/**\n * Original thrift service:-\n * BadService\n */\ntrait BadServiceClientBase {\n  require extends \\ThriftClientBase;\n\n  /* interaction handlers factory methods */\n  public function createBadInteraction(): BadService_BadInteraction {\n    $interaction = new BadService_BadInteraction($this->input_, $this->output_, $this->channel_);\n    $interaction->setAsyncHandler($this->asyncHandler_)->setEventHandler($this->eventHandler_);\n    return $interaction;\n  }\n\n}\n\nclass BadServiceAsyncClient extends \\ThriftClientBase implements BadServiceAsyncClientIf {\n  use BadServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   bar();\n   */\n  public async function bar(): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = BadService_bar_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"BadService\", \"bar\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"bar\", false);\n    return await $this->genAwaitResponse(BadService_bar_result::class, \"bar\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass BadServiceClient extends \\ThriftClientBase implements BadServiceClientIf {\n  use BadServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   bar();\n   */\n  public async function bar(): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = BadService_bar_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"BadService\", \"bar\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"bar\", false);\n    return await $this->genAwaitResponse(BadService_bar_result::class, \"bar\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_bar(): int {\n    $args = BadService_bar_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"bar\", false);\n  }\n  public function recv_bar(?int $expectedsequenceid = null): int {\n    return $this->recvImplHelper(BadService_bar_result::class, \"bar\", false, $expectedsequenceid);\n  }\n}\n\n// INTERACTION HANDLERS\n\nclass BadService_BadInteraction extends \\ThriftClientBase {\n  private \\InteractionId $interactionId;\n\n  public function __construct(\\TProtocol $input, ?\\TProtocol $output = null, ?\\IThriftMigrationAsyncChannel $channel = null)[leak_safe] {\n    parent::__construct($input, $output, $channel);\n    if ($this->channel_ is nonnull) {\n      $this->interactionId = $this->channel_->createInteraction(\"BadInteraction\");\n    } else {\n      throw new \\Exception(\"The channel must be nonnull to create interactions.\");\n    }\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   foo();\n   */\n  public async function foo(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? new \\RpcOptions();\n    $rpc_options = $rpc_options->setInteractionId($this->interactionId);\n    $args = BadService_BadInteraction_foo_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"BadService\", \"BadInteraction.foo\", $args);\n    $currentseqid = $this->sendImpl_foo();\n    await $this->genAwaitResponse(BadService_BadInteraction_foo_result::class, \"foo\", true, $currentseqid, $rpc_options);\n  }\n\n  protected function sendImpl_foo(): int {\n    $currentseqid = $this->getNextSequenceID();\n    $args = BadService_BadInteraction_foo_args::withDefaultValues();\n    try {\n      $this->eventHandler_->preSend('BadInteraction.foo', $args, $currentseqid);\n      if ($this->output_ is \\TBinaryProtocolAccelerated)\n      {\n        \\thrift_protocol_write_binary($this->output_, 'BadInteraction.foo', \\TMessageType::CALL, $args, $currentseqid, $this->output_->isStrictWrite(), false);\n      }\n      else if ($this->output_ is \\TCompactProtocolAccelerated)\n      {\n        \\thrift_protocol_write_compact2($this->output_, 'BadInteraction.foo', \\TMessageType::CALL, $args, $currentseqid, false, \\TCompactProtocolBase::VERSION);\n      }\n      else\n      {\n        $this->output_->writeMessageBegin('BadInteraction.foo', \\TMessageType::CALL, $currentseqid);\n        $args->write($this->output_);\n        $this->output_->writeMessageEnd();\n        $this->output_->getTransport()->flush();\n      }\n    } catch (\\THandlerShortCircuitException $ex) {\n      switch ($ex->resultType) {\n        case \\THandlerShortCircuitException::R_EXPECTED_EX:\n        case \\THandlerShortCircuitException::R_UNEXPECTED_EX:\n          $this->eventHandler_->sendError('BadInteraction.foo', $args, $currentseqid, $ex->result);\n          throw $ex->result;\n        case \\THandlerShortCircuitException::R_SUCCESS:\n        default:\n          $this->eventHandler_->postSend('BadInteraction.foo', $args, $currentseqid);\n          return $currentseqid;\n      }\n    } catch (\\Exception $ex) {\n      $this->eventHandler_->sendError('BadInteraction.foo', $args, $currentseqid, $ex);\n      throw $ex;\n    }\n    $this->eventHandler_->postSend('BadInteraction.foo', $args, $currentseqid);\n    return $currentseqid;\n  }\n}\n\nabstract class BadServiceAsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as BadServiceAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = BadServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'BadService';\n\n  protected async function process_bar(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('bar');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'bar', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'BadService_bar_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'BadService_bar_args');\n    } else {\n      $args = BadService_bar_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'bar', $args);\n    $result = BadService_bar_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'BadService', 'bar', $args);\n      $result->success = await $this->handler->bar();\n      $this->eventHandler_->postExec($handler_ctx, 'bar', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'bar', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'bar', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'bar', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'bar', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"bar\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'bar', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = BadServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass BadServiceAsyncProcessor extends BadServiceAsyncProcessorBase {\n  const type TThriftIf = BadServiceAsyncIf;\n}\n\nabstract class BadServiceSyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as BadServiceIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = BadServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'BadService';\n\n  protected function process_bar(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('bar');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'bar', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'BadService_bar_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'BadService_bar_args');\n    } else {\n      $args = BadService_bar_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'bar', $args);\n    $result = BadService_bar_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'BadService', 'bar', $args);\n      $result->success = $this->handler->bar();\n      $this->eventHandler_->postExec($handler_ctx, 'bar', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'bar', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'bar', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'bar', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'bar', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"bar\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'bar', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = BadServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass BadServiceSyncProcessor extends BadServiceSyncProcessorBase {\n  const type TThriftIf = BadServiceIf;\n}\n// For backwards compatibility\nclass BadServiceProcessor extends BadServiceSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass BadService_bar_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BadService_bar_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.bar_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass BadService_bar_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 3865318819874171525;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BadService_bar_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.BadService_bar_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['success']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->success = (int)$_tmp0;\n      }\n    }\n  }\n\n}\n\nclass BadService_BadInteraction_foo_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BadService_BadInteraction_foo_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.foo_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass BadService_BadInteraction_foo_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BadService_BadInteraction_foo_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.BadService_BadInteraction_foo_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass BadServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.BadService\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"bar\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 748}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\cpp;\n\n/**\n * Original thrift enum:-\n * RefType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/RefType'))>>\nenum RefType: int {\n  Unique = 0;\n  Shared = 1;\n  SharedMutable = 2;\n}\n\nclass RefType_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"cpp.RefType\",\n        \"elements\" => dict[\n          0 => \"Unique\",\n          1 => \"Shared\",\n          2 => \"SharedMutable\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Enum in C++ by default uses signed 32 bit integer. There is no need to specify\n * underlying type for signed 32 bit integer.\n * \n * Original thrift enum:-\n * EnumUnderlyingType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/EnumUnderlyingType'))>>\nenum EnumUnderlyingType: int {\n  /**\n   * ::std::int8_t\n   */\n  I8 = 0;\n  /**\n   * ::std::uint8_t\n   */\n  U8 = 1;\n  /**\n   * ::std::int16_t\n   */\n  I16 = 2;\n  /**\n   * ::std::uint16_t\n   */\n  U16 = 3;\n  /**\n   * ::std::uint32_t\n   */\n  U32 = 4;\n}\n\nclass EnumUnderlyingType_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"cpp.EnumUnderlyingType\",\n        \"elements\" => dict[\n          0 => \"I8\",\n          1 => \"U8\",\n          2 => \"I16\",\n          3 => \"U16\",\n          4 => \"U32\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Changes the native type of a Thrift object.\n * `name` and `template` correspond to `cpp.type` and `cpp.template` respecively.\n *\n * Original thrift struct:-\n * Type\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Type'))>>\nclass Type implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'template',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'template' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'template' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'template' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 6389487468753271119;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string template\n   */\n  public string $template;\n\n  public function __construct(?string $name = null, ?string $template = null)[] {\n    $this->name = $name ?? '';\n    $this->template = $template ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'template'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Type';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Type\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"template\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['template'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'template' => $this->template,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'template') !== null) {\n      $this->template = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['template']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Ref\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Ref'))>>\nclass Ref implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'type',\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\annotation\\cpp\\RefType::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'type' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\RefType,\n  );\n\n  const type TShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\RefType,\n    ...\n  );\n  const int STRUCTURAL_ID = 8496209332976516665;\n  /**\n   * Original thrift field:-\n   * 1: cpp.RefType type\n   */\n  public ?\\facebook\\thrift\\annotation\\cpp\\RefType $type;\n\n  public function __construct(?\\facebook\\thrift\\annotation\\cpp\\RefType $type = null)[] {\n    $this->type = $type;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Ref';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Ref\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"cpp.RefType\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"type\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'type' => $this->type,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'type') !== null) {\n      $this->type = \\facebook\\thrift\\annotation\\cpp\\RefType::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\annotation\\cpp\\RefType>($parsed['type']));\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Lazy\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Lazy'))>>\nclass Lazy implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ref',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ref' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ref' => ?bool,\n  );\n\n  const type TShape = shape(\n    'ref' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 2641839514020242314;\n  /**\n   * Original thrift field:-\n   * 1: bool ref\n   */\n  public bool $ref;\n\n  public function __construct(?bool $ref = null)[] {\n    $this->ref = $ref ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ref'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Lazy';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Lazy\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"ref\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['ref'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'ref' => $this->ref,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'ref') !== null) {\n      $this->ref = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['ref']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * DisableLazyChecksum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/DisableLazyChecksum'))>>\nclass DisableLazyChecksum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'DisableLazyChecksum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.DisableLazyChecksum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that applies a C++ adapter to typedef, field, or struct.\n * \n * For example:\n * \n *   @cpp.Adapter{name = \"::ns::IdAdapter\"}\n *   typedef i64 MyI64;\n * \n * Here the type `MyI64` has the C++ adapter `IdAdapter`.\n * \n *   struct User {\n *     @cpp.Adapter{name = \"::ns::IdAdapter\"}\n *     1: i64 id;\n *   }\n * \n * Here the field `id` has the C++ adapter `IdAdapter`.\n *\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'adaptedType',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'underlyingName',\n      'type' => \\TType::STRING,\n    ),\n    4 => shape(\n      'var' => 'extraNamespace',\n      'type' => \\TType::STRING,\n    ),\n    5 => shape(\n      'var' => 'moveOnly',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'adaptedType' => 2,\n    'underlyingName' => 3,\n    'extraNamespace' => 4,\n    'moveOnly' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'adaptedType' => ?string,\n    ?'underlyingName' => ?string,\n    ?'extraNamespace' => ?string,\n    ?'moveOnly' => ?bool,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'adaptedType' => string,\n    'underlyingName' => string,\n    'extraNamespace' => string,\n    'moveOnly' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 8180344078447403329;\n  /**\n   * The name of a C++ adapter type used to convert between Thrift and native\n   * C++ representation.\n   * \n   * The adapter can be either a Type or Field adapter, providing either of the following APIs:\n   * \n   *     struct ThriftTypeAdapter {\n   *       static AdaptedType fromThrift(ThriftType thrift);\n   *       static {const ThriftType& | ThriftType} toThrift(const AdaptedType& native);\n   *     };\n   * \n   *     struct ThriftFieldAdapter {\n   *       // Context is an instantiation of apache::thrift::FieldContext\n   *       template <class Context>\n   *       static void construct(AdaptedType& field, Context ctx);\n   * \n   *       template <class Context>\n   *       static AdaptedType fromThriftField(ThriftType value, Context ctx);\n   * \n   *       template <class Context>\n   *       static {const ThriftType& | ThriftType} toThrift(const AdaptedType& adapted, Context ctx);\n   *     };\n   * \n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * It is sometimes necessary to specify AdaptedType here (in case the codegen would\n   * have a circular depdenceny, which will cause the C++ build to fail).\n   * \n   * Original thrift field:-\n   * 2: string adaptedType\n   */\n  public string $adaptedType;\n  /**\n   * The name and/or extra namespace to use when directly adapting a type\n   * (as opposed a typedef).\n   * \n   * In this case, the IDL name of the type will refer to the adapted type in\n   * C++ and the underlying thrift type will be generated in a nested\n   * namespace and/or with a different name.\n   * \n   * If neither `underlyingName` or `extraNamespace` is provided, the\n   * underlying type will be generated in a nested 'detail' namespace with\n   * the same name.\n   * \n   * Original thrift field:-\n   * 3: string underlyingName\n   */\n  public string $underlyingName;\n  /**\n   * Original thrift field:-\n   * 4: string extraNamespace\n   */\n  public string $extraNamespace;\n  /**\n   * Must set to true when adapted type is not copyable.\n   * \n   * Original thrift field:-\n   * 5: bool moveOnly\n   */\n  public bool $moveOnly;\n\n  public function __construct(?string $name = null, ?string $adaptedType = null, ?string $underlyingName = null, ?string $extraNamespace = null, ?bool $moveOnly = null)[] {\n    $this->name = $name ?? '';\n    $this->adaptedType = $adaptedType ?? '';\n    $this->underlyingName = $underlyingName ?? '';\n    $this->extraNamespace = $extraNamespace ?? '';\n    $this->moveOnly = $moveOnly ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'adaptedType'),\n      Shapes::idx($shape, 'underlyingName'),\n      Shapes::idx($shape, 'extraNamespace'),\n      Shapes::idx($shape, 'moveOnly'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"adaptedType\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"underlyingName\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"extraNamespace\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"moveOnly\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['adaptedType'],\n      $shape['underlyingName'],\n      $shape['extraNamespace'],\n      $shape['moveOnly'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'adaptedType' => $this->adaptedType,\n      'underlyingName' => $this->underlyingName,\n      'extraNamespace' => $this->extraNamespace,\n      'moveOnly' => $this->moveOnly,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'adaptedType') !== null) {\n      $this->adaptedType = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['adaptedType']);\n    }\n    if (idx($parsed, 'underlyingName') !== null) {\n      $this->underlyingName = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['underlyingName']);\n    }\n    if (idx($parsed, 'extraNamespace') !== null) {\n      $this->extraNamespace = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['extraNamespace']);\n    }\n    if (idx($parsed, 'moveOnly') !== null) {\n      $this->moveOnly = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['moveOnly']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * PackIsset\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/PackIsset'))>>\nclass PackIsset implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'atomic',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'atomic' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'atomic' => ?bool,\n  );\n\n  const type TShape = shape(\n    'atomic' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 1587553453134051231;\n  /**\n   * Original thrift field:-\n   * 1: bool atomic\n   */\n  public bool $atomic;\n\n  public function __construct(?bool $atomic = null)[] {\n    $this->atomic = $atomic ?? true;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'atomic'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PackIsset';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.PackIsset\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"atomic\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['atomic'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'atomic' => $this->atomic,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'atomic') !== null) {\n      $this->atomic = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['atomic']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MinimizePadding\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/MinimizePadding'))>>\nclass MinimizePadding implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MinimizePadding';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.MinimizePadding\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * TriviallyRelocatable\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/TriviallyRelocatable'))>>\nclass TriviallyRelocatable implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TriviallyRelocatable';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.TriviallyRelocatable\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ScopedEnumAsUnionType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/ScopedEnumAsUnionType'))>>\nclass ScopedEnumAsUnionType implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ScopedEnumAsUnionType';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.ScopedEnumAsUnionType\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a typedef should be 'strong', and require an explicit cast to\n * the underlying type.\n * \n * Currently only works for integer typedefs, for example:\n * \n *     @cpp.StrongType\n *     typedef i32 MyId;\n * \n * Will cause an enum class to be used instead of a typedef in the genearte code, for example:\n * \n *     enum class MyId : ::std::int32_t {};\n * \n *\n * Original thrift struct:-\n * StrongType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/StrongType'))>>\nclass StrongType implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StrongType';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.StrongType\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that intercepts field access with C++ field interceptor.\n * Use with *caution* since this may introduce substantial performance overhead on each field access.\n * \n * For example:\n * \n *     struct Foo {\n *       @cpp.FieldInterceptor{name = \"MyFieldInterceptor\"}\n *       1: i64 id;\n *     }\n * \n * The field interceptor `MyFieldInterceptor` will intercept with `interceptThriftFieldAccess`\n * when the field `id` is accessed.\n *\n * Original thrift struct:-\n * FieldInterceptor\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/FieldInterceptor'))>>\nclass FieldInterceptor implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'noinline',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'noinline' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'noinline' => ?bool,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'noinline' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 8132831456632900275;\n  /**\n   * The name of a field interceptor.\n   * \n   * The field interceptor provides the following API:\n   * \n   *     struct ThriftFieldInterceptor {\n   *       template <typename T, typename Struct, int16_t FieldId>\n   *       static void interceptThriftFieldAccess(T&& field,\n   *                                              apache::thrift::FieldContext<Struct, FieldId>&& ctx);\n   *     };\n   * \n   * The field interceptor intercepts with the field value and the field context.\n   * It enforces an easily searchable function name `interceptThriftFieldAccess`.\n   * \n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Setting to true makes compiler not inline and erase function signature for\n   * the intercepting field accessor.\n   * \n   * Original thrift field:-\n   * 2: bool noinline\n   */\n  public bool $noinline;\n\n  public function __construct(?string $name = null, ?bool $noinline = null)[] {\n    $this->name = $name ?? '';\n    $this->noinline = $noinline ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'noinline'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldInterceptor';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.FieldInterceptor\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"noinline\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['noinline'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'noinline' => $this->noinline,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'noinline') !== null) {\n      $this->noinline = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['noinline']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * UseOpEncode\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/UseOpEncode'))>>\nclass UseOpEncode implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'UseOpEncode';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.UseOpEncode\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates an integer type for C++ to use as the underlying type of enum, for example:\n * \n *     @cpp.EnumType{type = cpp.EnumUnderlyingType.I8}\n *     enum Fruit {\n *       Apple = 0,\n *       Banana = 1,\n *     }\n * \n * will be generated into the following:\n * \n *     enum class Fruit : ::std::int8_t {\n *       Apple = 0,\n *       Banana = 1,\n *     };\n * \n *\n * Original thrift struct:-\n * EnumType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/EnumType'))>>\nclass EnumType implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'type',\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'type' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType,\n  );\n\n  const type TShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType,\n    ...\n  );\n  const int STRUCTURAL_ID = 1724537317047809370;\n  /**\n   * Original thrift field:-\n   * 1: cpp.EnumUnderlyingType type\n   */\n  public ?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType $type;\n\n  public function __construct(?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType $type = null)[] {\n    $this->type = $type;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumType';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.EnumType\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"cpp.EnumUnderlyingType\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"type\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'type' => $this->type,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'type') !== null) {\n      $this->type = \\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType>($parsed['type']));\n    }\n  }\n\n}\n\n/**\n * Indicates that frozen types should not be generated for a given struct.\n *\n * Original thrift struct:-\n * Frozen2Exclude\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Frozen2Exclude'))>>\nclass Frozen2Exclude implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Frozen2Exclude';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Frozen2Exclude\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that the container params must be complete at the time this type is instantiated.\n * Only required in rare cases where the build fails with a frozen-related assert failure.\n *\n * Original thrift struct:-\n * Frozen2RequiresCompleteContainerParams\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Frozen2RequiresCompleteContainerParams'))>>\nclass Frozen2RequiresCompleteContainerParams implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Frozen2RequiresCompleteContainerParams';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Frozen2RequiresCompleteContainerParams\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1953}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nclass module_CONSTANTS implements \\IThriftConstants {\n  /**\n   * Original thrift constant:-\n   * module.MyStruct myStruct\n   */\n  <<__Memoize>>\n  public static function myStruct()[write_props]: MyStruct{\n    return MyStruct::fromShape(\n      shape(\n        \"major\" => 42,\n        \"package\" => \"package\",\n        \"my_enum\" => MyEnum::DOMAIN,\n      )\n    );\n  }\n\n\n  public static function getAllStructuredAnnotations()[write_props]: dict<string, dict<string, \\IThriftStruct>> {\n    return dict[\n    ];\n  }\n}\n\n", "num_lines": 32}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift enum:-\n * MyEnum\n */\nenum MyEnum: int {\n  MyValue1 = 0;\n  MyValue2 = 1;\n  DOMAIN = 2;\n}\n\nclass MyEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.MyEnum\",\n        \"elements\" => dict[\n          0 => \"MyValue1\",\n          1 => \"MyValue2\",\n          2 => \"DOMAIN\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * MyStructNestedAnnotation\n */\nclass MyStructNestedAnnotation implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStructNestedAnnotation';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStructNestedAnnotation\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\nenum MyUnionEnum: int {\n  _EMPTY_ = 0;\n}\n\n/**\n * Original thrift struct:-\n * MyUnion\n */\nclass MyUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<MyUnionEnum>, \\IThriftShapishSyncStruct {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n  protected MyUnionEnum $_type = MyUnionEnum::_EMPTY_;\n\n  public function __construct()[] {\n    $this->_type = MyUnionEnum::_EMPTY_;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyUnion';\n  }\n\n  public function getType()[]: MyUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case MyUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = MyUnionEnum::_EMPTY_;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyUnion\",\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::StaticCast\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = MyUnionEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * MyException\n */\nclass MyException extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n    parent::__construct();\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyException';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.MyException\",\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::StaticCast\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/compiler/test/fixtures/basic-annotations/src/module/MyStruct')),\\SomeClass(\\AnotherClass::class)>>\nclass MyStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    2 => shape(\n      'var' => 'major',\n      'type' => \\TType::I64,\n    ),\n    1 => shape(\n      'var' => 'package',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'annotation_with_quote',\n      'type' => \\TType::STRING,\n    ),\n    4 => shape(\n      'var' => 'class_',\n      'type' => \\TType::STRING,\n    ),\n    5 => shape(\n      'var' => 'annotation_with_trailing_comma',\n      'type' => \\TType::STRING,\n    ),\n    6 => shape(\n      'var' => 'empty_annotations',\n      'type' => \\TType::STRING,\n    ),\n    7 => shape(\n      'var' => 'my_enum',\n      'type' => \\TType::I32,\n      'enum' => MyEnum::class,\n    ),\n    8 => shape(\n      'var' => 'cpp_type_annotation',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    9 => shape(\n      'var' => 'my_union',\n      'type' => \\TType::STRUCT,\n      'class' => MyUnion::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'major' => 2,\n    'package' => 1,\n    'annotation_with_quote' => 3,\n    'class_' => 4,\n    'annotation_with_trailing_comma' => 5,\n    'empty_annotations' => 6,\n    'my_enum' => 7,\n    'cpp_type_annotation' => 8,\n    'my_union' => 9,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'major' => ?int,\n    ?'package' => ?string,\n    ?'annotation_with_quote' => ?string,\n    ?'class_' => ?string,\n    ?'annotation_with_trailing_comma' => ?string,\n    ?'empty_annotations' => ?string,\n    ?'my_enum' => ?MyEnum,\n    ?'cpp_type_annotation' => ?Vector<string>,\n    ?'my_union' => ?MyUnion,\n  );\n\n  const type TShape = shape(\n    'major' => int,\n    'package' => string,\n    'annotation_with_quote' => string,\n    'class_' => string,\n    'annotation_with_trailing_comma' => string,\n    'empty_annotations' => string,\n    ?'my_enum' => ?MyEnum,\n    'cpp_type_annotation' => vec<string>,\n    ?'my_union' => ?MyUnion::TShape,\n    ...\n  );\n  const int STRUCTURAL_ID = 8440300490729065437;\n  /**\n   * Original thrift field:-\n   * 2: i64 major\n   */\n  public int $major;\n  /**\n   * Original thrift field:-\n   * 1: string package\n   */\n  public string $package;\n  /**\n   * Original thrift field:-\n   * 3: string annotation_with_quote\n   */\n  public string $annotation_with_quote;\n  /**\n   * Original thrift field:-\n   * 4: string class_\n   */\n  public string $class_;\n  /**\n   * Original thrift field:-\n   * 5: string annotation_with_trailing_comma\n   */\n  public string $annotation_with_trailing_comma;\n  /**\n   * Original thrift field:-\n   * 6: string empty_annotations\n   */\n  public string $empty_annotations;\n  /**\n   * Original thrift field:-\n   * 7: module.MyEnum my_enum\n   */\n  public ?MyEnum $my_enum;\n  /**\n   * Original thrift field:-\n   * 8: list<string> cpp_type_annotation\n   */\n  public Vector<string> $cpp_type_annotation;\n  /**\n   * Original thrift field:-\n   * 9: module.MyUnion my_union\n   */\n  public ?MyUnion $my_union;\n\n  public function __construct(?int $major = null, ?string $package = null, ?string $annotation_with_quote = null, ?string $class_ = null, ?string $annotation_with_trailing_comma = null, ?string $empty_annotations = null, ?MyEnum $my_enum = null, ?Vector<string> $cpp_type_annotation = null, ?MyUnion $my_union = null)[] {\n    $this->major = $major ?? 0;\n    $this->package = $package ?? '';\n    $this->annotation_with_quote = $annotation_with_quote ?? '';\n    $this->class_ = $class_ ?? '';\n    $this->annotation_with_trailing_comma = $annotation_with_trailing_comma ?? '';\n    $this->empty_annotations = $empty_annotations ?? '';\n    $this->my_enum = $my_enum;\n    $this->cpp_type_annotation = $cpp_type_annotation ?? Vector {};\n    $this->my_union = $my_union;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'major'),\n      Shapes::idx($shape, 'package'),\n      Shapes::idx($shape, 'annotation_with_quote'),\n      Shapes::idx($shape, 'class_'),\n      Shapes::idx($shape, 'annotation_with_trailing_comma'),\n      Shapes::idx($shape, 'empty_annotations'),\n      Shapes::idx($shape, 'my_enum'),\n      Shapes::idx($shape, 'cpp_type_annotation'),\n      Shapes::idx($shape, 'my_union'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"major\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"package\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"annotation_with_quote\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"class_\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"annotation_with_trailing_comma\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"empty_annotations\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"my_enum\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"cpp_type_annotation\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyUnion\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"my_union\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::StaticCast\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'my_union' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::StaticCast\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['major'],\n      $shape['package'],\n      $shape['annotation_with_quote'],\n      $shape['class_'],\n      $shape['annotation_with_trailing_comma'],\n      $shape['empty_annotations'],\n      Shapes::idx($shape, 'my_enum'),\n      $shape['cpp_type_annotation'] |> new Vector($$),\n      Shapes::idx($shape, 'my_union') === null ? null : (MyUnion::__fromShape($shape['my_union'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'major' => $this->major,\n      'package' => $this->package,\n      'annotation_with_quote' => $this->annotation_with_quote,\n      'class_' => $this->class_,\n      'annotation_with_trailing_comma' => $this->annotation_with_trailing_comma,\n      'empty_annotations' => $this->empty_annotations,\n      'my_enum' => $this->my_enum,\n      'cpp_type_annotation' => vec($this->cpp_type_annotation),\n      'my_union' => $this->my_union?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'major') !== null) {\n      $this->major = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['major']);\n    }\n    if (idx($parsed, 'package') !== null) {\n      $this->package = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['package']);\n    }\n    if (idx($parsed, 'annotation_with_quote') !== null) {\n      $this->annotation_with_quote = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['annotation_with_quote']);\n    }\n    if (idx($parsed, 'class_') !== null) {\n      $this->class_ = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['class_']);\n    }\n    if (idx($parsed, 'annotation_with_trailing_comma') !== null) {\n      $this->annotation_with_trailing_comma = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['annotation_with_trailing_comma']);\n    }\n    if (idx($parsed, 'empty_annotations') !== null) {\n      $this->empty_annotations = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['empty_annotations']);\n    }\n    if (idx($parsed, 'my_enum') !== null) {\n      $this->my_enum = MyEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, MyEnum>($parsed['my_enum']));\n    }\n    if (idx($parsed, 'cpp_type_annotation') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<string>>($parsed['cpp_type_annotation']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = '';\n        $_elem5 = $_value2;\n        $_container4 []= $_elem5;\n      }\n      $this->cpp_type_annotation = $_container4;\n    }\n    if (idx($parsed, 'my_union') !== null) {\n      $_tmp6 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, MyUnion>($parsed['my_union']));\n      $_tmp7 = MyUnion::withDefaultValues();\n      $_tmp7->readFromJson($_tmp6);\n      $this->my_union = $_tmp7;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * SecretStruct\n */\nclass SecretStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'id',\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'password',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'id' => 1,\n    'password' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'id' => ?int,\n    ?'password' => ?string,\n  );\n\n  const type TShape = shape(\n    'id' => int,\n    'password' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 7563936987719176841;\n  /**\n   * Original thrift field:-\n   * 1: i64 id\n   */\n  public int $id;\n  /**\n   * Original thrift field:-\n   * 2: string password\n   */\n  public string $password;\n\n  public function __construct(?int $id = null, ?string $password = null)[] {\n    $this->id = $id ?? 0;\n    $this->password = $password ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'id'),\n      Shapes::idx($shape, 'password'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SecretStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SecretStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"id\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"password\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['id'],\n      $shape['password'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'id' => $this->id,\n      'password' => $this->password,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'id') !== null) {\n      $this->id = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['id']);\n    }\n    if (idx($parsed, 'password') !== null) {\n      $this->password = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['password']);\n    }\n  }\n\n}\n\n", "num_lines": 877}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * MyService\n */\ninterface MyServiceAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   ping()\n   *   throws (1: MyException myExcept);\n   */\n  public function ping(): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getRandomData();\n   */\n  public function getRandomData(): Awaitable<string>;\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   hasDataById(1: i64 id);\n   */\n  public function hasDataById(int $id): Awaitable<bool>;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getDataById(1: i64 id);\n   */\n  public function getDataById(int $id): Awaitable<string>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   putDataById(1: i64 id,\n   *               2: string data);\n   */\n  public function putDataById(int $id, string $data): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * oneway void\n   *   lobDataById(1: i64 id,\n   *               2: string data);\n   */\n  public function lobDataById(int $id, string $data): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   doNothing();\n   */\n  public function doNothing(): Awaitable<void>;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ninterface MyServiceIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   ping()\n   *   throws (1: MyException myExcept);\n   */\n  public function ping(): void;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getRandomData();\n   */\n  public function getRandomData(): string;\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   hasDataById(1: i64 id);\n   */\n  public function hasDataById(int $id): bool;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getDataById(1: i64 id);\n   */\n  public function getDataById(int $id): string;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   putDataById(1: i64 id,\n   *               2: string data);\n   */\n  public function putDataById(int $id, string $data): void;\n\n  /**\n   * Original thrift definition:-\n   * oneway void\n   *   lobDataById(1: i64 id,\n   *               2: string data);\n   */\n  public function lobDataById(int $id, string $data): void;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   doNothing();\n   */\n  public function doNothing(): void;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ninterface MyServiceAsyncClientIf extends MyServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ninterface MyServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   ping()\n   *   throws (1: MyException myExcept);\n   */\n  public function ping(): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getRandomData();\n   */\n  public function getRandomData(): Awaitable<string>;\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   hasDataById(1: i64 id);\n   */\n  public function hasDataById(int $id): Awaitable<bool>;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getDataById(1: i64 id);\n   */\n  public function getDataById(int $id): Awaitable<string>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   putDataById(1: i64 id,\n   *               2: string data);\n   */\n  public function putDataById(int $id, string $data): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * oneway void\n   *   lobDataById(1: i64 id,\n   *               2: string data);\n   */\n  public function lobDataById(int $id, string $data): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   doNothing();\n   */\n  public function doNothing(): Awaitable<void>;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ntrait MyServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass MyServiceAsyncClient extends \\ThriftClientBase implements MyServiceAsyncClientIf {\n  use MyServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   ping()\n   *   throws (1: MyException myExcept);\n   */\n  public async function ping(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_ping_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"ping\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"ping\", false);\n    await $this->genAwaitResponse(MyService_ping_result::class, \"ping\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getRandomData();\n   */\n  public async function getRandomData(): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_getRandomData_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"getRandomData\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"getRandomData\", false);\n    return await $this->genAwaitResponse(MyService_getRandomData_result::class, \"getRandomData\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   hasDataById(1: i64 id);\n   */\n  public async function hasDataById(int $id): Awaitable<bool> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_hasDataById_args::fromShape(shape(\n      'id' => $id,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"hasDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"hasDataById\", false);\n    return await $this->genAwaitResponse(MyService_hasDataById_result::class, \"hasDataById\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getDataById(1: i64 id);\n   */\n  public async function getDataById(int $id): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_getDataById_args::fromShape(shape(\n      'id' => $id,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"getDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"getDataById\", false);\n    return await $this->genAwaitResponse(MyService_getDataById_result::class, \"getDataById\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   putDataById(1: i64 id,\n   *               2: string data);\n   */\n  public async function putDataById(int $id, string $data): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_putDataById_args::fromShape(shape(\n      'id' => $id,\n      'data' => $data,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"putDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"putDataById\", false);\n    await $this->genAwaitResponse(MyService_putDataById_result::class, \"putDataById\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * oneway void\n   *   lobDataById(1: i64 id,\n   *               2: string data);\n   */\n  public async function lobDataById(int $id, string $data): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_lobDataById_args::fromShape(shape(\n      'id' => $id,\n      'data' => $data,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"lobDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"lobDataById\", true);\n    await $this->genAwaitNoResponse($rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   doNothing();\n   */\n  public async function doNothing(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_doNothing_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"doNothing\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"doNothing\", false);\n    await $this->genAwaitResponse(MyService_doNothing_result::class, \"doNothing\", true, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass MyServiceClient extends \\ThriftClientBase implements MyServiceClientIf {\n  use MyServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   ping()\n   *   throws (1: MyException myExcept);\n   */\n  public async function ping(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_ping_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"ping\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"ping\", false);\n    await $this->genAwaitResponse(MyService_ping_result::class, \"ping\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getRandomData();\n   */\n  public async function getRandomData(): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_getRandomData_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"getRandomData\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"getRandomData\", false);\n    return await $this->genAwaitResponse(MyService_getRandomData_result::class, \"getRandomData\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   hasDataById(1: i64 id);\n   */\n  public async function hasDataById(int $id): Awaitable<bool> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_hasDataById_args::fromShape(shape(\n      'id' => $id,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"hasDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"hasDataById\", false);\n    return await $this->genAwaitResponse(MyService_hasDataById_result::class, \"hasDataById\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   getDataById(1: i64 id);\n   */\n  public async function getDataById(int $id): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_getDataById_args::fromShape(shape(\n      'id' => $id,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"getDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"getDataById\", false);\n    return await $this->genAwaitResponse(MyService_getDataById_result::class, \"getDataById\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   putDataById(1: i64 id,\n   *               2: string data);\n   */\n  public async function putDataById(int $id, string $data): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_putDataById_args::fromShape(shape(\n      'id' => $id,\n      'data' => $data,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"putDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"putDataById\", false);\n    await $this->genAwaitResponse(MyService_putDataById_result::class, \"putDataById\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * oneway void\n   *   lobDataById(1: i64 id,\n   *               2: string data);\n   */\n  public async function lobDataById(int $id, string $data): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_lobDataById_args::fromShape(shape(\n      'id' => $id,\n      'data' => $data,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"lobDataById\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"lobDataById\", true);\n    await $this->genAwaitNoResponse($rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   doNothing();\n   */\n  public async function doNothing(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_doNothing_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"doNothing\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"doNothing\", false);\n    await $this->genAwaitResponse(MyService_doNothing_result::class, \"doNothing\", true, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_ping(): int {\n    $args = MyService_ping_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"ping\", false);\n  }\n  public function recv_ping(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(MyService_ping_result::class, \"ping\", true, $expectedsequenceid);\n  }\n  public function send_getRandomData(): int {\n    $args = MyService_getRandomData_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"getRandomData\", false);\n  }\n  public function recv_getRandomData(?int $expectedsequenceid = null): string {\n    return $this->recvImplHelper(MyService_getRandomData_result::class, \"getRandomData\", false, $expectedsequenceid);\n  }\n  public function send_hasDataById(int $id): int {\n    $args = MyService_hasDataById_args::fromShape(shape(\n      'id' => $id,\n    ));\n    return $this->sendImplHelper($args, \"hasDataById\", false);\n  }\n  public function recv_hasDataById(?int $expectedsequenceid = null): bool {\n    return $this->recvImplHelper(MyService_hasDataById_result::class, \"hasDataById\", false, $expectedsequenceid);\n  }\n  public function send_getDataById(int $id): int {\n    $args = MyService_getDataById_args::fromShape(shape(\n      'id' => $id,\n    ));\n    return $this->sendImplHelper($args, \"getDataById\", false);\n  }\n  public function recv_getDataById(?int $expectedsequenceid = null): string {\n    return $this->recvImplHelper(MyService_getDataById_result::class, \"getDataById\", false, $expectedsequenceid);\n  }\n  public function send_putDataById(int $id, string $data): int {\n    $args = MyService_putDataById_args::fromShape(shape(\n      'id' => $id,\n      'data' => $data,\n    ));\n    return $this->sendImplHelper($args, \"putDataById\", false);\n  }\n  public function recv_putDataById(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(MyService_putDataById_result::class, \"putDataById\", true, $expectedsequenceid);\n  }\n  public function send_lobDataById(int $id, string $data): int {\n    $args = MyService_lobDataById_args::fromShape(shape(\n      'id' => $id,\n      'data' => $data,\n    ));\n    return $this->sendImplHelper($args, \"lobDataById\", true);\n  }\n  public function send_doNothing(): int {\n    $args = MyService_doNothing_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"doNothing\", false);\n  }\n  public function recv_doNothing(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(MyService_doNothing_result::class, \"doNothing\", true, $expectedsequenceid);\n  }\n}\n\nabstract class MyServiceAsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as MyServiceAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = MyServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'MyService';\n\n  protected async function process_ping(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('ping');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'ping', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyService_ping_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyService_ping_args');\n    } else {\n      $args = MyService_ping_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'ping', $args);\n    $result = MyService_ping_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'ping', $args);\n      await $this->handler->ping();\n      $this->eventHandler_->postExec($handler_ctx, 'ping', $result);\n    } catch (MyException $exc0) {\n      $this->eventHandler_->handlerException($handler_ctx, 'ping', $exc0);\n      $result->myExcept = $exc0;\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'ping', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'ping', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'ping', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'ping', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"ping\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'ping', $result);\n  }\n  protected async function process_getRandomData(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('getRandomData');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'getRandomData', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyService_getRandomData_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyService_getRandomData_args');\n    } else {\n      $args = MyService_getRandomData_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'getRandomData', $args);\n    $result = MyService_getRandomData_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'getRandomData', $args);\n      $result->success = await $this->handler->getRandomData();\n      $this->eventHandler_->postExec($handler_ctx, 'getRandomData', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'getRandomData', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'getRandomData', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getRandomData', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getRandomData', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getRandomData\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'getRandomData', $result);\n  }\n  protected async function process_hasDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('hasDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'hasDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyService_hasDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyService_hasDataById_args');\n    } else {\n      $args = MyService_hasDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'hasDataById', $args);\n    $result = MyService_hasDataById_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'hasDataById', $args);\n      $result->success = await $this->handler->hasDataById($args->id);\n      $this->eventHandler_->postExec($handler_ctx, 'hasDataById', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'hasDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'hasDataById', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'hasDataById', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'hasDataById', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"hasDataById\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'hasDataById', $result);\n  }\n  protected async function process_getDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('getDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'getDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyService_getDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyService_getDataById_args');\n    } else {\n      $args = MyService_getDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'getDataById', $args);\n    $result = MyService_getDataById_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'getDataById', $args);\n      $result->success = await $this->handler->getDataById($args->id);\n      $this->eventHandler_->postExec($handler_ctx, 'getDataById', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'getDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'getDataById', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getDataById', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getDataById', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getDataById\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'getDataById', $result);\n  }\n  protected async function process_putDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('putDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'putDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyService_putDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyService_putDataById_args');\n    } else {\n      $args = MyService_putDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'putDataById', $args);\n    $result = MyService_putDataById_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'putDataById', $args);\n      await $this->handler->putDataById($args->id, $args->data);\n      $this->eventHandler_->postExec($handler_ctx, 'putDataById', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'putDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'putDataById', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'putDataById', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'putDataById', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"putDataById\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'putDataById', $result);\n  }\n  protected async function process_lobDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('lobDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'lobDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyService_lobDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyService_lobDataById_args');\n    } else {\n      $args = MyService_lobDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'lobDataById', $args);\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'lobDataById', $args);\n      await $this->handler->lobDataById($args->id, $args->data);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'lobDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    return;\n  }\n  protected async function process_doNothing(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('doNothing');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'doNothing', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyService_doNothing_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyService_doNothing_args');\n    } else {\n      $args = MyService_doNothing_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'doNothing', $args);\n    $result = MyService_doNothing_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'doNothing', $args);\n      await $this->handler->doNothing();\n      $this->eventHandler_->postExec($handler_ctx, 'doNothing', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'doNothing', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'doNothing', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'doNothing', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'doNothing', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"doNothing\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'doNothing', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = MyServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass MyServiceAsyncProcessor extends MyServiceAsyncProcessorBase {\n  const type TThriftIf = MyServiceAsyncIf;\n}\n\nabstract class MyServiceSyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as MyServiceIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = MyServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'MyService';\n\n  protected function process_ping(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('ping');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'ping', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyService_ping_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyService_ping_args');\n    } else {\n      $args = MyService_ping_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'ping', $args);\n    $result = MyService_ping_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'ping', $args);\n      $this->handler->ping();\n      $this->eventHandler_->postExec($handler_ctx, 'ping', $result);\n    } catch (MyException $exc0) {\n      $this->eventHandler_->handlerException($handler_ctx, 'ping', $exc0);\n      $result->myExcept = $exc0;\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'ping', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'ping', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'ping', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'ping', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"ping\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'ping', $result);\n  }\n  protected function process_getRandomData(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('getRandomData');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'getRandomData', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyService_getRandomData_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyService_getRandomData_args');\n    } else {\n      $args = MyService_getRandomData_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'getRandomData', $args);\n    $result = MyService_getRandomData_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'getRandomData', $args);\n      $result->success = $this->handler->getRandomData();\n      $this->eventHandler_->postExec($handler_ctx, 'getRandomData', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'getRandomData', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'getRandomData', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getRandomData', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getRandomData', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getRandomData\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'getRandomData', $result);\n  }\n  protected function process_hasDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('hasDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'hasDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyService_hasDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyService_hasDataById_args');\n    } else {\n      $args = MyService_hasDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'hasDataById', $args);\n    $result = MyService_hasDataById_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'hasDataById', $args);\n      $result->success = $this->handler->hasDataById($args->id);\n      $this->eventHandler_->postExec($handler_ctx, 'hasDataById', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'hasDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'hasDataById', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'hasDataById', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'hasDataById', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"hasDataById\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'hasDataById', $result);\n  }\n  protected function process_getDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('getDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'getDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyService_getDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyService_getDataById_args');\n    } else {\n      $args = MyService_getDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'getDataById', $args);\n    $result = MyService_getDataById_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'getDataById', $args);\n      $result->success = $this->handler->getDataById($args->id);\n      $this->eventHandler_->postExec($handler_ctx, 'getDataById', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'getDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'getDataById', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getDataById', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getDataById', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getDataById\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'getDataById', $result);\n  }\n  protected function process_putDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('putDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'putDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyService_putDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyService_putDataById_args');\n    } else {\n      $args = MyService_putDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'putDataById', $args);\n    $result = MyService_putDataById_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'putDataById', $args);\n      $this->handler->putDataById($args->id, $args->data);\n      $this->eventHandler_->postExec($handler_ctx, 'putDataById', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'putDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'putDataById', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'putDataById', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'putDataById', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"putDataById\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'putDataById', $result);\n  }\n  protected function process_lobDataById(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('lobDataById');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'lobDataById', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyService_lobDataById_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyService_lobDataById_args');\n    } else {\n      $args = MyService_lobDataById_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'lobDataById', $args);\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'lobDataById', $args);\n      $this->handler->lobDataById($args->id, $args->data);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'lobDataById', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    return;\n  }\n  protected function process_doNothing(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('doNothing');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'doNothing', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyService_doNothing_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyService_doNothing_args');\n    } else {\n      $args = MyService_doNothing_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'doNothing', $args);\n    $result = MyService_doNothing_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'doNothing', $args);\n      $this->handler->doNothing();\n      $this->eventHandler_->postExec($handler_ctx, 'doNothing', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'doNothing', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'doNothing', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'doNothing', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'doNothing', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"doNothing\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'doNothing', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = MyServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass MyServiceSyncProcessor extends MyServiceSyncProcessorBase {\n  const type TThriftIf = MyServiceIf;\n}\n// For backwards compatibility\nclass MyServiceProcessor extends MyServiceSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass MyService_ping_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_ping_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ping_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyService_ping_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'myExcept',\n      'type' => \\TType::STRUCT,\n      'class' => MyException::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'myExcept' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'myExcept' => ?MyException,\n  );\n\n  const int STRUCTURAL_ID = 7189959854181053156;\n  public ?MyException $myExcept;\n\n  public function __construct(?MyException $myExcept = null)[] {\n    $this->myExcept = $myExcept;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'myExcept'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_ping_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_ping_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyException\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"myExcept\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'myExcept' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::StaticCast\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'myExcept') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, MyException>($parsed['myExcept']));\n      $_tmp1 = MyException::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->myExcept = $_tmp1;\n    }\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->myExcept !== null) {\n      return $this->myExcept;\n    }\n    return null;\n  }\n}\n\nclass MyService_getRandomData_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_getRandomData_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.getRandomData_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyService_getRandomData_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_getRandomData_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_getRandomData_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $this->success = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['success']);\n    }\n  }\n\n}\n\nclass MyService_hasDataById_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'id',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'id' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'id' => ?int,\n  );\n\n  const type TShape = shape(\n    'id' => int,\n    ...\n  );\n  const int STRUCTURAL_ID = 3807211151619655933;\n  public int $id;\n\n  public function __construct(?int $id = null)[] {\n    $this->id = $id ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'id'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_hasDataById_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.hasDataById_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"id\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['id'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'id' => $this->id,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'id') !== null) {\n      $this->id = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['id']);\n    }\n  }\n\n}\n\nclass MyService_hasDataById_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = bool;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 8594383818423018844;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_hasDataById_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_hasDataById_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $this->success = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['success']);\n    }\n  }\n\n}\n\nclass MyService_getDataById_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'id',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'id' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'id' => ?int,\n  );\n\n  const type TShape = shape(\n    'id' => int,\n    ...\n  );\n  const int STRUCTURAL_ID = 3807211151619655933;\n  public int $id;\n\n  public function __construct(?int $id = null)[] {\n    $this->id = $id ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'id'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_getDataById_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.getDataById_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"id\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['id'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'id' => $this->id,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'id') !== null) {\n      $this->id = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['id']);\n    }\n  }\n\n}\n\nclass MyService_getDataById_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_getDataById_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_getDataById_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $this->success = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['success']);\n    }\n  }\n\n}\n\nclass MyService_putDataById_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'id',\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'data',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'id' => 1,\n    'data' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'id' => ?int,\n    ?'data' => ?string,\n  );\n\n  const type TShape = shape(\n    'id' => int,\n    'data' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 1055685087985327657;\n  public int $id;\n  public string $data;\n\n  public function __construct(?int $id = null, ?string $data = null)[] {\n    $this->id = $id ?? 0;\n    $this->data = $data ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'id'),\n      Shapes::idx($shape, 'data'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_putDataById_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.putDataById_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"id\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"data\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'data' => shape(\n          'field' => dict[\n            'MyStructNestedAnnotation' => MyStructNestedAnnotation::fromShape(\n              shape(\n                \"name\" => \"argument\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['id'],\n      $shape['data'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'id' => $this->id,\n      'data' => $this->data,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'id') !== null) {\n      $this->id = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['id']);\n    }\n    if (idx($parsed, 'data') !== null) {\n      $this->data = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['data']);\n    }\n  }\n\n}\n\nclass MyService_putDataById_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_putDataById_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_putDataById_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyService_lobDataById_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'id',\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'data',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'id' => 1,\n    'data' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'id' => ?int,\n    ?'data' => ?string,\n  );\n\n  const type TShape = shape(\n    'id' => int,\n    'data' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 1055685087985327657;\n  public int $id;\n  public string $data;\n\n  public function __construct(?int $id = null, ?string $data = null)[] {\n    $this->id = $id ?? 0;\n    $this->data = $data ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'id'),\n      Shapes::idx($shape, 'data'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_lobDataById_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.lobDataById_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"id\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"data\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['id'],\n      $shape['data'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'id' => $this->id,\n      'data' => $this->data,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'id') !== null) {\n      $this->id = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['id']);\n    }\n    if (idx($parsed, 'data') !== null) {\n      $this->data = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['data']);\n    }\n  }\n\n}\n\nclass MyService_doNothing_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_doNothing_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.doNothing_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyService_doNothing_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_doNothing_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_doNothing_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.MyService\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"ping\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n              \"exceptions\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.MyException\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"myExcept\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"getRandomData\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"hasDataById\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"id\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"getDataById\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"id\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"putDataById\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"id\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                      )\n                    ),\n                    \"name\" => \"data\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"lobDataById\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"id\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                      )\n                    ),\n                    \"name\" => \"data\",\n                  )\n                ),\n              ],\n              \"is_oneway\" => true,\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"doNothing\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n              'module.MyException' => MyException::getExceptionMetadata(),\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 2642}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * MyServicePrioChild\n */\ninterface MyServicePrioChildAsyncIf extends MyServicePrioParentAsyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   pang();\n   */\n  public function pang(): Awaitable<void>;\n}\n\n/**\n * Original thrift service:-\n * MyServicePrioChild\n */\ninterface MyServicePrioChildIf extends MyServicePrioParentIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   pang();\n   */\n  public function pang(): void;\n}\n\n/**\n * Original thrift service:-\n * MyServicePrioChild\n */\ninterface MyServicePrioChildAsyncClientIf extends MyServicePrioChildAsyncIf, MyServicePrioParentAsyncClientIf {\n}\n\n/**\n * Original thrift service:-\n * MyServicePrioChild\n */\ninterface MyServicePrioChildClientIf extends MyServicePrioParentClientIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   pang();\n   */\n  public function pang(): Awaitable<void>;\n}\n\n/**\n * Original thrift service:-\n * MyServicePrioChild\n */\ntrait MyServicePrioChildClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass MyServicePrioChildAsyncClient extends MyServicePrioParentAsyncClient implements MyServicePrioChildAsyncClientIf {\n  use MyServicePrioChildClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   pang();\n   */\n  public async function pang(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyServicePrioChild_pang_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyServicePrioChild\", \"pang\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"pang\", false);\n    await $this->genAwaitResponse(MyServicePrioChild_pang_result::class, \"pang\", true, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass MyServicePrioChildClient extends MyServicePrioParentClient implements MyServicePrioChildClientIf {\n  use MyServicePrioChildClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   pang();\n   */\n  public async function pang(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyServicePrioChild_pang_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyServicePrioChild\", \"pang\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"pang\", false);\n    await $this->genAwaitResponse(MyServicePrioChild_pang_result::class, \"pang\", true, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_pang(): int {\n    $args = MyServicePrioChild_pang_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"pang\", false);\n  }\n  public function recv_pang(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(MyServicePrioChild_pang_result::class, \"pang\", true, $expectedsequenceid);\n  }\n}\n\nabstract class MyServicePrioChildAsyncProcessorBase extends MyServicePrioParentAsyncProcessorBase {\n  abstract const type TThriftIf as MyServicePrioChildAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = MyServicePrioChildStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'MyServicePrioChild';\n\n  protected async function process_pang(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('pang');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'pang', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyServicePrioChild_pang_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyServicePrioChild_pang_args');\n    } else {\n      $args = MyServicePrioChild_pang_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'pang', $args);\n    $result = MyServicePrioChild_pang_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyServicePrioChild', 'pang', $args);\n      await $this->handler->pang();\n      $this->eventHandler_->postExec($handler_ctx, 'pang', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'pang', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'pang', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'pang', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'pang', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"pang\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'pang', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = MyServicePrioChildStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass MyServicePrioChildAsyncProcessor extends MyServicePrioChildAsyncProcessorBase {\n  const type TThriftIf = MyServicePrioChildAsyncIf;\n}\n\nabstract class MyServicePrioChildSyncProcessorBase extends MyServicePrioParentSyncProcessorBase {\n  abstract const type TThriftIf as MyServicePrioChildIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = MyServicePrioChildStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'MyServicePrioChild';\n\n  protected function process_pang(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('pang');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'pang', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyServicePrioChild_pang_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyServicePrioChild_pang_args');\n    } else {\n      $args = MyServicePrioChild_pang_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'pang', $args);\n    $result = MyServicePrioChild_pang_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyServicePrioChild', 'pang', $args);\n      $this->handler->pang();\n      $this->eventHandler_->postExec($handler_ctx, 'pang', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'pang', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'pang', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'pang', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'pang', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"pang\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'pang', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = MyServicePrioChildStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass MyServicePrioChildSyncProcessor extends MyServicePrioChildSyncProcessorBase {\n  const type TThriftIf = MyServicePrioChildIf;\n}\n// For backwards compatibility\nclass MyServicePrioChildProcessor extends MyServicePrioChildSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass MyServicePrioChild_pang_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyServicePrioChild_pang_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.pang_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyServicePrioChild_pang_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyServicePrioChild_pang_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyServicePrioChild_pang_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyServicePrioChildStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.MyServicePrioChild\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"pang\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n            )\n          ),\n        ],\n        \"parent\" => \"module.MyServicePrioParent\",\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n              'module.MyServicePrioParent' => MyServicePrioParentStaticMetadata::getServiceMetadata(),\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 499}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * MyServicePrioParent\n */\ninterface MyServicePrioParentAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   ping();\n   */\n  public function ping(): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   pong();\n   */\n  public function pong(): Awaitable<void>;\n}\n\n/**\n * Original thrift service:-\n * MyServicePrioParent\n */\ninterface MyServicePrioParentIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   ping();\n   */\n  public function ping(): void;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   pong();\n   */\n  public function pong(): void;\n}\n\n/**\n * Original thrift service:-\n * MyServicePrioParent\n */\ninterface MyServicePrioParentAsyncClientIf extends MyServicePrioParentAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * MyServicePrioParent\n */\ninterface MyServicePrioParentClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   ping();\n   */\n  public function ping(): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   pong();\n   */\n  public function pong(): Awaitable<void>;\n}\n\n/**\n * Original thrift service:-\n * MyServicePrioParent\n */\ntrait MyServicePrioParentClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass MyServicePrioParentAsyncClient extends \\ThriftClientBase implements MyServicePrioParentAsyncClientIf {\n  use MyServicePrioParentClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   ping();\n   */\n  public async function ping(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyServicePrioParent_ping_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyServicePrioParent\", \"ping\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"ping\", false);\n    await $this->genAwaitResponse(MyServicePrioParent_ping_result::class, \"ping\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   pong();\n   */\n  public async function pong(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyServicePrioParent_pong_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyServicePrioParent\", \"pong\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"pong\", false);\n    await $this->genAwaitResponse(MyServicePrioParent_pong_result::class, \"pong\", true, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass MyServicePrioParentClient extends \\ThriftClientBase implements MyServicePrioParentClientIf {\n  use MyServicePrioParentClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   ping();\n   */\n  public async function ping(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyServicePrioParent_ping_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyServicePrioParent\", \"ping\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"ping\", false);\n    await $this->genAwaitResponse(MyServicePrioParent_ping_result::class, \"ping\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   pong();\n   */\n  public async function pong(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyServicePrioParent_pong_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyServicePrioParent\", \"pong\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"pong\", false);\n    await $this->genAwaitResponse(MyServicePrioParent_pong_result::class, \"pong\", true, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_ping(): int {\n    $args = MyServicePrioParent_ping_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"ping\", false);\n  }\n  public function recv_ping(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(MyServicePrioParent_ping_result::class, \"ping\", true, $expectedsequenceid);\n  }\n  public function send_pong(): int {\n    $args = MyServicePrioParent_pong_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"pong\", false);\n  }\n  public function recv_pong(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(MyServicePrioParent_pong_result::class, \"pong\", true, $expectedsequenceid);\n  }\n}\n\nabstract class MyServicePrioParentAsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as MyServicePrioParentAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = MyServicePrioParentStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'MyServicePrioParent';\n\n  protected async function process_ping(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('ping');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'ping', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyServicePrioParent_ping_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyServicePrioParent_ping_args');\n    } else {\n      $args = MyServicePrioParent_ping_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'ping', $args);\n    $result = MyServicePrioParent_ping_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyServicePrioParent', 'ping', $args);\n      await $this->handler->ping();\n      $this->eventHandler_->postExec($handler_ctx, 'ping', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'ping', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'ping', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'ping', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'ping', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"ping\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'ping', $result);\n  }\n  protected async function process_pong(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('pong');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'pong', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyServicePrioParent_pong_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyServicePrioParent_pong_args');\n    } else {\n      $args = MyServicePrioParent_pong_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'pong', $args);\n    $result = MyServicePrioParent_pong_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyServicePrioParent', 'pong', $args);\n      await $this->handler->pong();\n      $this->eventHandler_->postExec($handler_ctx, 'pong', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'pong', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'pong', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'pong', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'pong', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"pong\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'pong', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = MyServicePrioParentStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass MyServicePrioParentAsyncProcessor extends MyServicePrioParentAsyncProcessorBase {\n  const type TThriftIf = MyServicePrioParentAsyncIf;\n}\n\nabstract class MyServicePrioParentSyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as MyServicePrioParentIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = MyServicePrioParentStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'MyServicePrioParent';\n\n  protected function process_ping(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('ping');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'ping', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyServicePrioParent_ping_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyServicePrioParent_ping_args');\n    } else {\n      $args = MyServicePrioParent_ping_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'ping', $args);\n    $result = MyServicePrioParent_ping_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyServicePrioParent', 'ping', $args);\n      $this->handler->ping();\n      $this->eventHandler_->postExec($handler_ctx, 'ping', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'ping', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'ping', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'ping', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'ping', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"ping\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'ping', $result);\n  }\n  protected function process_pong(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('pong');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'pong', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyServicePrioParent_pong_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyServicePrioParent_pong_args');\n    } else {\n      $args = MyServicePrioParent_pong_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'pong', $args);\n    $result = MyServicePrioParent_pong_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyServicePrioParent', 'pong', $args);\n      $this->handler->pong();\n      $this->eventHandler_->postExec($handler_ctx, 'pong', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'pong', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'pong', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'pong', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'pong', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"pong\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'pong', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = MyServicePrioParentStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass MyServicePrioParentSyncProcessor extends MyServicePrioParentSyncProcessorBase {\n  const type TThriftIf = MyServicePrioParentIf;\n}\n// For backwards compatibility\nclass MyServicePrioParentProcessor extends MyServicePrioParentSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass MyServicePrioParent_ping_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyServicePrioParent_ping_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ping_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyServicePrioParent_ping_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyServicePrioParent_ping_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyServicePrioParent_ping_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyServicePrioParent_pong_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyServicePrioParent_pong_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.pong_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyServicePrioParent_pong_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyServicePrioParent_pong_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyServicePrioParent_pong_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nclass MyServicePrioParentStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.MyServicePrioParent\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"ping\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"pong\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 797}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1606}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates a definition/feature may change in incompatible ways.\n *\n * Original thrift struct:-\n * Beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Beta'))>>\nclass Beta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used with permission, may\n * only work in specific contexts, and may change in incompatible ways without\n * notice.\n *\n * Original thrift struct:-\n * Experimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Experimental'))>>\nclass Experimental implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Experimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Experimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used in an ephemeral testing\n * enviornment.\n * \n * Such enviornments only store serialized values temporarly and strictly\n * control which versions of Thrift definitions are used, so 'compatibility'\n * is not a concern.\n *\n * Original thrift struct:-\n * Testing\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Testing'))>>\nclass Testing implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Testing';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Testing\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should no longer be used.\n *\n * Original thrift struct:-\n * Deprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Deprecated'))>>\nclass Deprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const type TShape = shape(\n    'message' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2427562471238739676;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Deprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Deprecated\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['message'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'message' => $this->message,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'message') !== null) {\n      $this->message = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['message']);\n    }\n  }\n\n}\n\n/**\n * Annotate a thrift structured or enum to indicate if ids or values should not\n * be used.\n * \n * For example, you may want to mark ids as deprecated, or these ids\n * might be reserved for other use cases or annotations.\n * \n * The resolved set of disallowed ids is the union of the values in `ids` and\n * the range of values represented in `id_ranges`. Example:\n * \n *  // These ids are not allowed: 3, 8, half-open ranges [10, 15), [20, 30)\n *  @thrift.ReserveIds{ids = [3, 8], id_ranges = {10: 15, 20: 30}}\n *  struct Foo {\n *    ...\n *    3: i64 f; // Build failure: 3 cannot be used\n *  }\n *\n * Original thrift struct:-\n * ReserveIds\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ReserveIds'))>>\nclass ReserveIds implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ids',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'id_ranges',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ids' => 1,\n    'id_ranges' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ids' => ?Vector<int>,\n    ?'id_ranges' => ?Map<int, int>,\n  );\n\n  const type TShape = shape(\n    'ids' => vec<int>,\n    'id_ranges' => dict<int, int>,\n    ...\n  );\n  const int STRUCTURAL_ID = 4105998268635615653;\n  /**\n   * Individual ids that cannot be used.\n   * \n   * Original thrift field:-\n   * 1: list<i32> ids\n   */\n  public Vector<int> $ids;\n  /**\n   * Represents ranges of ids that cannot be used.\n   * \n   * Each (key: value) pair represents the half-open range `[key, value)`,\n   * where `key` is included and `value` is not. For example, the map\n   * `{10: 15, 20: 30}` represents the union of id/value ranges `[10, 15)` and\n   * `[20, 30)`.\n   * \n   * Original thrift field:-\n   * 2: map<i32, i32> id_ranges\n   */\n  public Map<int, int> $id_ranges;\n\n  public function __construct(?Vector<int> $ids = null, ?Map<int, int> $id_ranges = null)[] {\n    $this->ids = $ids ?? Vector {};\n    $this->id_ranges = $id_ranges ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ids'),\n      Shapes::idx($shape, 'id_ranges'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ReserveIds';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ReserveIds\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ids\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"id_ranges\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['ids'] |> new Vector($$),\n      $shape['id_ranges'] |> new Map($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'ids' => vec($this->ids),\n      'id_ranges' => dict($this->id_ranges),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'ids') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['ids']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = 0;\n        $_tmp6 = (int)$_value2;\n        if ($_tmp6 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem5 = (int)$_tmp6;\n        }\n        $_container4 []= $_elem5;\n      }\n      $this->ids = $_container4;\n    }\n    if (idx($parsed, 'id_ranges') !== null) {\n      $_json10 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, int>>($parsed['id_ranges']);\n      $_container11 = Map {};\n      foreach($_json10 as $_key8 => $_value9) {\n        $_value12 = 0;\n        $_tmp13 = (int)$_value9;\n        if ($_tmp13 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value12 = (int)$_tmp13;\n        }\n        $_container11[$_key8] = $_value12;\n      }\n      $this->id_ranges = $_container11;\n    }\n  }\n\n}\n\n/**\n * Indicates additional backward compatibility restrictions, beyond the\n * standard Thrift required 'wire' compatibility.\n *\n * Original thrift struct:-\n * RequiresBackwardCompatibility\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RequiresBackwardCompatibility'))>>\nclass RequiresBackwardCompatibility implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field_name',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field_name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field_name' => ?bool,\n  );\n\n  const type TShape = shape(\n    'field_name' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 4755373036761315562;\n  /**\n   * Original thrift field:-\n   * 1: bool field_name\n   */\n  public bool $field_name;\n\n  public function __construct(?bool $field_name = null)[] {\n    $this->field_name = $field_name ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field_name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RequiresBackwardCompatibility';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.RequiresBackwardCompatibility\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"field_name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field_name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field_name' => $this->field_name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field_name') !== null) {\n      $this->field_name = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['field_name']);\n    }\n  }\n\n}\n\n/**\n * Disables testing features.\n *\n * Original thrift struct:-\n * NoTesting\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoTesting'))>>\nclass NoTesting implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoTesting';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoTesting\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables experimental features.\n *\n * Original thrift struct:-\n * NoExperimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoExperimental'))>>\nclass NoExperimental implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoExperimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoExperimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables @Beta features.\n *\n * Original thrift struct:-\n * NoBeta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoBeta'))>>\nclass NoBeta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoBeta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoBeta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoExperimental' => \\facebook\\thrift\\annotation\\NoExperimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature must not depend directly on an unreleased\n * or testing definition/feature.\n *\n * Original thrift struct:-\n * Released\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Released'))>>\nclass Released implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Released';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Released\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoBeta' => \\facebook\\thrift\\annotation\\NoBeta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\NoTesting' => \\facebook\\thrift\\annotation\\NoTesting::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables legacy features.\n *\n * Original thrift struct:-\n * NoLegacy\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoLegacy'))>>\nclass NoLegacy implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoLegacy';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoLegacy\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables @Deprecated features.\n * \n * Should only be enabled in `test` versions, as deprecated implies removing\n * the feature will break current usage (otherwise it would be legacy or\n * deleted).\n *\n * Original thrift struct:-\n * NoDeprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoDeprecated'))>>\nclass NoDeprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoDeprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoDeprecated\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoLegacy' => \\facebook\\thrift\\annotation\\NoLegacy::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that changes the field qualifier from 'none' to 'terse'.\n * A terse field is eligible to skip serialization, when it equals to the\n * intrinsic default value. It also clears to the intrinsic default value\n * before deserialization to distinguish between if a terse field was skipped\n * or missing during serialization. This is different from an unqualified\n * field, as an unqualified field is always serialized regardless of its value,\n * and it is not cleared before deserialization.\n * \n * The annotation can be only used to annotate an unqualified field, and when\n * it is annotating a struct or exception, it changes all unqualified fields to\n * terse fields. Note, the annotation can not be used for union.\n *\n * Original thrift struct:-\n * TerseWrite\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/TerseWrite'))>>\nclass TerseWrite implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TerseWrite';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.TerseWrite\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack.\n *\n * Original thrift struct:-\n * Box\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Box'))>>\nclass Box implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Box';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Box\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Mixin\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Mixin'))>>\nclass Mixin implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Mixin';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Mixin\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Option to serialize thrift struct in ascending field id order.\n * \n * This can potentially make serialized data size smaller in compact protocol,\n * since compact protocol can write deltas between subsequent field ids.\n *\n * Original thrift struct:-\n * SerializeInFieldIdOrder\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/SerializeInFieldIdOrder'))>>\nclass SerializeInFieldIdOrder implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SerializeInFieldIdOrder';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.SerializeInFieldIdOrder\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates an enum is a bitmask and should support bit-wise operators.\n *\n * Original thrift struct:-\n * BitmaskEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/BitmaskEnum'))>>\nclass BitmaskEnum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BitmaskEnum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.BitmaskEnum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all released v1 features.\n *\n * Original thrift struct:-\n * v1\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1'))>>\nclass v1 implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all beta v1 features.\n * \n * Beta features are guaranteed to *not* break unrelated Thrift features\n * so they should be relatively safe to test alongside other beta or\n * released Thrift features.\n *\n * Original thrift struct:-\n * v1beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1beta'))>>\nclass v1beta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1' => \\facebook\\thrift\\annotation\\v1::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all experimental v1 features.\n * \n * Use with *caution* and only with explicit permission. This may enable\n * features may change significantly without notice or not work correctly\n * in all contexts.\n *\n * Original thrift struct:-\n * v1alpha\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1alpha'))>>\nclass v1alpha implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1alpha';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1alpha\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1beta' => \\facebook\\thrift\\annotation\\v1beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\SerializeInFieldIdOrder' => \\facebook\\thrift\\annotation\\SerializeInFieldIdOrder::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables experimental features, even those that are known to break common\n * use cases.\n *\n * Original thrift struct:-\n * v1test\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1test'))>>\nclass v1test implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1test';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1test\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoDeprecated' => \\facebook\\thrift\\annotation\\NoDeprecated::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\v1alpha' => \\facebook\\thrift\\annotation\\v1alpha::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Testing' => \\facebook\\thrift\\annotation\\Testing::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Specifies the field where the exception message is stored. The field\n * is used to generate an additional method to get it.\n *\n * Original thrift struct:-\n * ExceptionMessage\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ExceptionMessage'))>>\nclass ExceptionMessage implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?string,\n  );\n\n  const type TShape = shape(\n    'field' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 6158382972310209096;\n  /**\n   * Original thrift field:-\n   * 1: string field\n   */\n  public string $field;\n\n  public function __construct(?string $field = null)[] {\n    $this->field = $field ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ExceptionMessage';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ExceptionMessage\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field' => $this->field,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $this->field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['field']);\n    }\n  }\n\n}\n\n/**\n * Generates a const of type schema. Struct containing the schema of the\n * annotated type. Optionally specify name to override default\n * schema<structName>.\n *\n * Original thrift struct:-\n * GenerateRuntimeSchema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/GenerateRuntimeSchema'))>>\nclass GenerateRuntimeSchema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'GenerateRuntimeSchema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.GenerateRuntimeSchema\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack, and that\n * identical values can be shared in immutable contexts.\n *\n * Original thrift struct:-\n * InternBox\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/InternBox'))>>\nclass InternBox implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'InternBox';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.InternBox\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 2588}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift struct:-\n * structured_annotation_included\n */\nclass structured_annotation_included implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? \"cacbcac\";\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'structured_annotation_included';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"included.structured_annotation_included\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 94}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures\\basic-structured-annotations;\n\nclass module_CONSTANTS implements \\IThriftConstants {\n  /**\n   * Original thrift constant:-\n   * map<string, string> MyConst\n   */\n  <<__Memoize>>\n  public static function MyConst()[write_props]: \\ConstMap<string, string>{\n    return ImmMap {\n      \"ENUMERATOR\" => \"enum\",\n      \"CONST\" => \"const\",\n    };\n  }\n\n\n  public static function getAllStructuredAnnotations()[write_props]: dict<string, dict<string, \\IThriftStruct>> {\n    return dict[\n      'MyConst' => dict[\n        '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline::fromShape(\n          shape(\n            \"name\" => \"MyHackEnum\",\n          )\n        ),\n      ],\n    ];\n  }\n}\n\n", "num_lines": 38}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures\\basic-structured-annotations;\n\n/**\n * Original thrift enum:-\n * MyEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic-structured-annotations/MyEnum'))>>\nenum MyEnum: int {\n  UNKNOWN = 0;\n  ONE = 1;\n}\n\nclass MyEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.MyEnum\",\n        \"elements\" => dict[\n          0 => \"UNKNOWN\",\n          1 => \"ONE\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[\n        '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline::fromShape(\n          shape(\n            \"count\" => 4,\n          )\n        ),\n      ],\n      'constants' => dict[\n        'UNKNOWN' => dict[\n          '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default::fromShape(\n            shape(\n              \"name\" => \"unknown\",\n            )\n          ),\n        ],\n        'ONE' => dict[\n          '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default::fromShape(\n            shape(\n              \"name\" => \"one\",\n            )\n          ),\n        ],\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * structured_annotation_inline\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic-structured-annotations/structured_annotation_inline'))>>\nclass structured_annotation_inline implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'count',\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'count' => 1,\n    'name' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'count' => ?int,\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 4972386806027895704;\n  /**\n   * Original thrift field:-\n   * 1: i64 count\n   */\n  public int $count;\n  /**\n   * Original thrift field:-\n   * 2: string name\n   */\n  public string $name;\n\n  public function __construct(?int $count = null, ?string $name = null)[] {\n    $this->count = $count ?? 0;\n    $this->name = $name ?? \"abacaba\";\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'count'),\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'structured_annotation_inline';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.structured_annotation_inline\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"count\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * structured_annotation_with_default\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic-structured-annotations/structured_annotation_with_default'))>>\nclass structured_annotation_with_default implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? \"abacabadabacaba\";\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'structured_annotation_with_default';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.structured_annotation_with_default\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * structured_annotation_recursive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic-structured-annotations/structured_annotation_recursive'))>>\nclass structured_annotation_recursive implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'recurse',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_recursive::class,\n    ),\n    3 => shape(\n      'var' => 'forward',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_forward::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'recurse' => 2,\n    'forward' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'recurse' => ?\\test\\fixtures\\basic-structured-annotations\\structured_annotation_recursive,\n    ?'forward' => ?\\test\\fixtures\\basic-structured-annotations\\structured_annotation_forward,\n  );\n\n  const int STRUCTURAL_ID = 2762967868033251423;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: module.structured_annotation_recursive recurse\n   */\n  public ?\\test\\fixtures\\basic-structured-annotations\\structured_annotation_recursive $recurse;\n  /**\n   * Original thrift field:-\n   * 3: module.structured_annotation_forward forward\n   */\n  public ?\\test\\fixtures\\basic-structured-annotations\\structured_annotation_forward $forward;\n\n  public function __construct(?string $name = null, ?\\test\\fixtures\\basic-structured-annotations\\structured_annotation_recursive $recurse = null, ?\\test\\fixtures\\basic-structured-annotations\\structured_annotation_forward $forward = null)[] {\n    $this->name = $name ?? '';\n    $this->recurse = $recurse;\n    $this->forward = $forward;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'recurse'),\n      Shapes::idx($shape, 'forward'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'structured_annotation_recursive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.structured_annotation_recursive\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.structured_annotation_recursive\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.structured_annotation_recursive\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"recurse\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.structured_annotation_forward\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.structured_annotation_forward\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"forward\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * structured_annotation_forward\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic-structured-annotations/structured_annotation_forward'))>>\nclass structured_annotation_forward implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'count',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'count' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'count' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 6887469671700782815;\n  /**\n   * Original thrift field:-\n   * 1: i64 count\n   */\n  public int $count;\n\n  public function __construct(?int $count = null)[] {\n    $this->count = $count ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'count'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'structured_annotation_forward';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.structured_annotation_forward\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"count\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * structured_annotation_nested\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic-structured-annotations/structured_annotation_nested'))>>\nclass structured_annotation_nested implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'nest',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'nest' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'nest' => ?\\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default,\n  );\n\n  const int STRUCTURAL_ID = 6161284296844090840;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: module.structured_annotation_with_default nest\n   */\n  public ?\\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default $nest;\n\n  public function __construct(?string $name = null, ?\\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default $nest = null)[] {\n    $this->name = $name ?? '';\n    $this->nest = $nest;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'nest'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'structured_annotation_nested';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.structured_annotation_nested\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.structured_annotation_with_default\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"nest\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic-structured-annotations/MyStruct'))>>\nclass MyStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'annotated_field',\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'annotated_type',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'annotated_recursive',\n      'type' => \\TType::STRING,\n    ),\n    4 => shape(\n      'var' => 'annotated_nested',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'annotated_field' => 1,\n    'annotated_type' => 2,\n    'annotated_recursive' => 3,\n    'annotated_nested' => 4,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'annotated_field' => ?int,\n    ?'annotated_type' => ?string,\n    ?'annotated_recursive' => ?string,\n    ?'annotated_nested' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 3348150936040517721;\n  /**\n   * Original thrift field:-\n   * 1: i64 annotated_field\n   */\n  public int $annotated_field;\n  /**\n   * Original thrift field:-\n   * 2: module.annotated_inline_string annotated_type\n   */\n  public string $annotated_type;\n  /**\n   * Original thrift field:-\n   * 3: string annotated_recursive\n   */\n  public string $annotated_recursive;\n  /**\n   * Original thrift field:-\n   * 4: i64 annotated_nested\n   */\n  public int $annotated_nested;\n\n  public function __construct(?int $annotated_field = null, ?string $annotated_type = null, ?string $annotated_recursive = null, ?int $annotated_nested = null)[] {\n    $this->annotated_field = $annotated_field ?? 0;\n    $this->annotated_type = $annotated_type ?? '';\n    $this->annotated_recursive = $annotated_recursive ?? '';\n    $this->annotated_nested = $annotated_nested ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'annotated_field'),\n      Shapes::idx($shape, 'annotated_type'),\n      Shapes::idx($shape, 'annotated_recursive'),\n      Shapes::idx($shape, 'annotated_nested'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"annotated_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.annotated_inline_string\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"annotated_type\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"annotated_recursive\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"annotated_nested\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline::fromShape(\n          shape(\n            \"count\" => 2,\n          )\n        ),\n        '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default::fromShape(\n          shape(\n          )\n        ),\n        '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_nested' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_nested::fromShape(\n          shape(\n            \"name\" => \"nesty2\",\n            \"nest\" => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default::fromShape(\n              shape(\n                \"name\" => \"dcdbdcdadcdbdcd\",\n              )\n            ),\n          )\n        ),\n        '\\structured_annotation_included' => \\structured_annotation_included::fromShape(\n          shape(\n            \"name\" => \"aba\",\n          )\n        ),\n        '\\test\\namespace\\structured_annotation_with_namespace' => \\test\\namespace\\structured_annotation_with_namespace::fromShape(\n          shape(\n            \"name\" => \"bac\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'annotated_field' => shape(\n          'field' => dict[\n            '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline::fromShape(\n              shape(\n                \"count\" => 1,\n                \"name\" => \"counter\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'annotated_type' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline::fromShape(\n              shape(\n                \"count\" => 1,\n              )\n            ),\n            '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default::fromShape(\n              shape(\n                \"name\" => \"abc\",\n              )\n            ),\n          ],\n        ),\n        'annotated_recursive' => shape(\n          'field' => dict[\n            '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_recursive' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_recursive::fromShape(\n              shape(\n                \"name\" => \"abc\",\n                \"recurse\" => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_recursive::fromShape(\n                  shape(\n                    \"name\" => \"cba\",\n                  )\n                ),\n                \"forward\" => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_forward::fromShape(\n                  shape(\n                    \"count\" => 3,\n                  )\n                ),\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'annotated_nested' => shape(\n          'field' => dict[\n            '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_nested' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_nested::fromShape(\n              shape(\n                \"name\" => \"nesty\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * MyException\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic-structured-annotations/MyException'))>>\nclass MyException extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'context',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'context' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'context' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 4527164319056566576;\n  /**\n   * Original thrift field:-\n   * 1: string context\n   */\n  public string $context;\n\n  public function __construct(?string $context = null)[] {\n    parent::__construct();\n    $this->context = $context ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'context'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyException';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return \\tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.MyException\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"context\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_nested' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_nested::fromShape(\n          shape(\n            \"name\" => \"nesty\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'context' => shape(\n          'field' => dict[\n            '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nenum MyUnionEnum: int {\n  _EMPTY_ = 0;\n  first = 1;\n  second = 2;\n}\n\n/**\n * Original thrift struct:-\n * MyUnion\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic-structured-annotations/MyUnion'))>>\nclass MyUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<\\test\\fixtures\\basic-structured-annotations\\MyUnionEnum> {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'first',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'second',\n      'union' => true,\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'first' => 1,\n    'second' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'first' => ?string,\n    ?'second' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 1597178699879920243;\n  /**\n   * Original thrift field:-\n   * 1: module.annotated_inline_string first\n   */\n  public ?string $first;\n  /**\n   * Original thrift field:-\n   * 2: module.annotated_inline_i64 second\n   */\n  public ?int $second;\n  protected \\test\\fixtures\\basic-structured-annotations\\MyUnionEnum $_type = \\test\\fixtures\\basic-structured-annotations\\MyUnionEnum::_EMPTY_;\n\n  public function __construct(?string $first = null, ?int $second = null)[] {\n    $this->_type = \\test\\fixtures\\basic-structured-annotations\\MyUnionEnum::_EMPTY_;\n    if ($first !== null) {\n      $this->first = $first;\n      $this->_type = \\test\\fixtures\\basic-structured-annotations\\MyUnionEnum::first;\n    }\n    if ($second !== null) {\n      $this->second = $second;\n      $this->_type = \\test\\fixtures\\basic-structured-annotations\\MyUnionEnum::second;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'first'),\n      Shapes::idx($shape, 'second'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyUnion';\n  }\n\n  public function getType()[]: \\test\\fixtures\\basic-structured-annotations\\MyUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case \\test\\fixtures\\basic-structured-annotations\\MyUnionEnum::first:\n        $this->first = null;\n        break;\n      case \\test\\fixtures\\basic-structured-annotations\\MyUnionEnum::second:\n        $this->second = null;\n        break;\n      case \\test\\fixtures\\basic-structured-annotations\\MyUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = \\test\\fixtures\\basic-structured-annotations\\MyUnionEnum::_EMPTY_;\n  }\n\n  public function set_first(string $first)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\basic-structured-annotations\\MyUnionEnum::first;\n    $this->first = $first;\n    return $this;\n  }\n\n  public function get_first()[]: ?string {\n    return $this->first;\n  }\n\n  public function getx_first()[]: string {\n    invariant(\n      $this->_type === \\test\\fixtures\\basic-structured-annotations\\MyUnionEnum::first,\n      'get_first called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->first as nonnull;\n  }\n\n  public function set_second(int $second)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\basic-structured-annotations\\MyUnionEnum::second;\n    $this->second = $second;\n    return $this;\n  }\n\n  public function get_second()[]: ?int {\n    return $this->second;\n  }\n\n  public function getx_second()[]: int {\n    invariant(\n      $this->_type === \\test\\fixtures\\basic-structured-annotations\\MyUnionEnum::second,\n      'get_second called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->second as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyUnion\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.annotated_inline_string\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"first\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.annotated_inline_i64\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"second\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_nested' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_nested::fromShape(\n          shape(\n            \"name\" => \"nesty\",\n            \"nest\" => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default::fromShape(\n              shape(\n              )\n            ),\n          )\n        ),\n      ],\n      'fields' => dict[\n        'first' => shape(\n          'field' => dict[\n            '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline::fromShape(\n              shape(\n                \"count\" => 1,\n              )\n            ),\n            '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default::fromShape(\n              shape(\n                \"name\" => \"abc\",\n              )\n            ),\n          ],\n        ),\n        'second' => shape(\n          'field' => dict[\n            '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default::fromShape(\n              shape(\n                \"name\" => \"aba\",\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline::fromShape(\n              shape(\n                \"count\" => 2,\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1225}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures\\basic-structured-annotations;\n\n/**\n * Original thrift service:-\n * MyService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic-structured-annotations/MyService'))>>\ninterface MyServiceAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * annotated_inline_string\n   *   first();\n   */\n  public function first(): Awaitable<string>;\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   second(1: i64 count);\n   */\n  public function second(int $count): Awaitable<bool>;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic-structured-annotations/MyService'))>>\ninterface MyServiceIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * annotated_inline_string\n   *   first();\n   */\n  public function first(): string;\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   second(1: i64 count);\n   */\n  public function second(int $count): bool;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic-structured-annotations/MyService'))>>\ninterface MyServiceAsyncClientIf extends MyServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic-structured-annotations/MyService'))>>\ninterface MyServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * annotated_inline_string\n   *   first();\n   */\n  public function first(): Awaitable<string>;\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   second(1: i64 count);\n   */\n  public function second(int $count): Awaitable<bool>;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ntrait MyServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass MyServiceAsyncClient extends \\ThriftClientBase implements MyServiceAsyncClientIf {\n  use MyServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * annotated_inline_string\n   *   first();\n   */\n  public async function first(): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic-structured-annotations\\MyService_first_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"first\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"first\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\basic-structured-annotations\\MyService_first_result::class, \"first\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   second(1: i64 count);\n   */\n  public async function second(int $count): Awaitable<bool> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic-structured-annotations\\MyService_second_args::fromShape(shape(\n      'count' => $count,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"second\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"second\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\basic-structured-annotations\\MyService_second_result::class, \"second\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass MyServiceClient extends \\ThriftClientBase implements MyServiceClientIf {\n  use MyServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * annotated_inline_string\n   *   first();\n   */\n  public async function first(): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic-structured-annotations\\MyService_first_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"first\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"first\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\basic-structured-annotations\\MyService_first_result::class, \"first\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   second(1: i64 count);\n   */\n  public async function second(int $count): Awaitable<bool> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\basic-structured-annotations\\MyService_second_args::fromShape(shape(\n      'count' => $count,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"second\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"second\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\basic-structured-annotations\\MyService_second_result::class, \"second\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_first(): int {\n    $args = \\test\\fixtures\\basic-structured-annotations\\MyService_first_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"first\", false);\n  }\n  public function recv_first(?int $expectedsequenceid = null): string {\n    return $this->recvImplHelper(\\test\\fixtures\\basic-structured-annotations\\MyService_first_result::class, \"first\", false, $expectedsequenceid);\n  }\n  public function send_second(int $count): int {\n    $args = \\test\\fixtures\\basic-structured-annotations\\MyService_second_args::fromShape(shape(\n      'count' => $count,\n    ));\n    return $this->sendImplHelper($args, \"second\", false);\n  }\n  public function recv_second(?int $expectedsequenceid = null): bool {\n    return $this->recvImplHelper(\\test\\fixtures\\basic-structured-annotations\\MyService_second_result::class, \"second\", false, $expectedsequenceid);\n  }\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass MyService_first_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_first_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.first_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_first_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 8648204672360810467;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_first_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_first_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.annotated_inline_string\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'success' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline::fromShape(\n              shape(\n                \"count\" => 1,\n              )\n            ),\n            '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default::fromShape(\n              shape(\n                \"name\" => \"abc\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_second_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'count',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'count' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'count' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 6887469671700782815;\n  public int $count;\n\n  public function __construct(?int $count = null)[] {\n    $this->count = $count ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'count'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_second_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.second_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"count\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'count' => shape(\n          'field' => dict[\n            '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline::fromShape(\n              shape(\n                \"count\" => 4,\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_second_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = bool;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 8594383818423018844;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_second_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_second_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return \\tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.MyService\",\n        \"functions\" => vec[\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"first\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.annotated_inline_string\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n            )\n          ),\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"second\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"count\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[\n        '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline::fromShape(\n          shape(\n            \"count\" => 3,\n          )\n        ),\n      ],\n      'functions' => dict[\n        'first' => dict[\n          '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_with_default::fromShape(\n            shape(\n            )\n          ),\n        ],\n        'second' => dict[\n          '\\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline' => \\test\\fixtures\\basic-structured-annotations\\structured_annotation_inline::fromShape(\n            shape(\n              \"count\" => 2,\n            )\n          ),\n        ],\n      ],\n    );\n  }\n}\n\n", "num_lines": 626}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\namespace;\n\n/**\n * Original thrift struct:-\n * structured_annotation_with_namespace\n */\nclass structured_annotation_with_namespace implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? \"abacaba\";\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'structured_annotation_with_namespace';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"namespaced.structured_annotation_with_namespace\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 96}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nenum ComplexUnionEnum: int {\n  _EMPTY_ = 0;\n  intValue = 1;\n  stringValue = 5;\n  intListValue = 2;\n  stringListValue = 3;\n  typedefValue = 9;\n  stringRef = 14;\n}\n\n/**\n * Original thrift struct:-\n * ComplexUnion\n */\nclass ComplexUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<ComplexUnionEnum> {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'intValue',\n      'union' => true,\n      'type' => \\TType::I64,\n    ),\n    5 => shape(\n      'var' => 'stringValue',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'intListValue',\n      'union' => true,\n      'type' => \\TType::LST,\n      'etype' => \\TType::I64,\n      'elem' => shape(\n        'type' => \\TType::I64,\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'stringListValue',\n      'union' => true,\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    9 => shape(\n      'var' => 'typedefValue',\n      'union' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I16,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::I16,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    14 => shape(\n      'var' => 'stringRef',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'intValue' => 1,\n    'stringValue' => 5,\n    'intListValue' => 2,\n    'stringListValue' => 3,\n    'typedefValue' => 9,\n    'stringRef' => 14,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'intValue' => ?int,\n    ?'stringValue' => ?string,\n    ?'intListValue' => ?Vector<int>,\n    ?'stringListValue' => ?Vector<string>,\n    ?'typedefValue' => ?Map<int, string>,\n    ?'stringRef' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 1260275021738383280;\n  /**\n   * Original thrift field:-\n   * 1: i64 intValue\n   */\n  protected ?int $intValue;\n  /**\n   * Original thrift field:-\n   * 5: string stringValue\n   */\n  protected ?string $stringValue;\n  /**\n   * Original thrift field:-\n   * 2: list<i64> intListValue\n   */\n  protected ?Vector<int> $intListValue;\n  /**\n   * Original thrift field:-\n   * 3: list<string> stringListValue\n   */\n  protected ?Vector<string> $stringListValue;\n  /**\n   * Original thrift field:-\n   * 9: module.containerTypedef typedefValue\n   */\n  protected ?Map<int, string> $typedefValue;\n  /**\n   * Original thrift field:-\n   * 14: string stringRef\n   */\n  protected ?string $stringRef;\n  protected ComplexUnionEnum $_type = ComplexUnionEnum::_EMPTY_;\n\n  public function __construct(?int $intValue = null, ?string $stringValue = null, ?Vector<int> $intListValue = null, ?Vector<string> $stringListValue = null, ?Map<int, string> $typedefValue = null, ?string $stringRef = null)[] {\n    $this->_type = ComplexUnionEnum::_EMPTY_;\n    if ($intValue !== null) {\n      $this->intValue = $intValue;\n      $this->_type = ComplexUnionEnum::intValue;\n    }\n    if ($stringValue !== null) {\n      $this->stringValue = $stringValue;\n      $this->_type = ComplexUnionEnum::stringValue;\n    }\n    if ($intListValue !== null) {\n      $this->intListValue = $intListValue;\n      $this->_type = ComplexUnionEnum::intListValue;\n    }\n    if ($stringListValue !== null) {\n      $this->stringListValue = $stringListValue;\n      $this->_type = ComplexUnionEnum::stringListValue;\n    }\n    if ($typedefValue !== null) {\n      $this->typedefValue = $typedefValue;\n      $this->_type = ComplexUnionEnum::typedefValue;\n    }\n    if ($stringRef !== null) {\n      $this->stringRef = $stringRef;\n      $this->_type = ComplexUnionEnum::stringRef;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'intValue'),\n      Shapes::idx($shape, 'stringValue'),\n      Shapes::idx($shape, 'intListValue'),\n      Shapes::idx($shape, 'stringListValue'),\n      Shapes::idx($shape, 'typedefValue'),\n      Shapes::idx($shape, 'stringRef'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ComplexUnion';\n  }\n\n  public function getType()[]: ComplexUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case ComplexUnionEnum::intValue:\n        $this->intValue = null;\n        break;\n      case ComplexUnionEnum::stringValue:\n        $this->stringValue = null;\n        break;\n      case ComplexUnionEnum::intListValue:\n        $this->intListValue = null;\n        break;\n      case ComplexUnionEnum::stringListValue:\n        $this->stringListValue = null;\n        break;\n      case ComplexUnionEnum::typedefValue:\n        $this->typedefValue = null;\n        break;\n      case ComplexUnionEnum::stringRef:\n        $this->stringRef = null;\n        break;\n      case ComplexUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = ComplexUnionEnum::_EMPTY_;\n  }\n\n  public function set_intValue(int $intValue)[write_props]: this {\n    $this->reset();\n    $this->_type = ComplexUnionEnum::intValue;\n    $this->intValue = $intValue;\n    return $this;\n  }\n\n  public function get_intValue()[]: ?int {\n    return $this->intValue;\n  }\n\n  public function getx_intValue()[]: int {\n    invariant(\n      $this->_type === ComplexUnionEnum::intValue,\n      'get_intValue called on an instance of ComplexUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->intValue as nonnull;\n  }\n\n  public function set_stringValue(string $stringValue)[write_props]: this {\n    $this->reset();\n    $this->_type = ComplexUnionEnum::stringValue;\n    $this->stringValue = $stringValue;\n    return $this;\n  }\n\n  public function get_stringValue()[]: ?string {\n    return $this->stringValue;\n  }\n\n  public function getx_stringValue()[]: string {\n    invariant(\n      $this->_type === ComplexUnionEnum::stringValue,\n      'get_stringValue called on an instance of ComplexUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->stringValue as nonnull;\n  }\n\n  public function set_intListValue(Vector<int> $intListValue)[write_props]: this {\n    $this->reset();\n    $this->_type = ComplexUnionEnum::intListValue;\n    $this->intListValue = $intListValue;\n    return $this;\n  }\n\n  public function get_intListValue()[]: ?Vector<int> {\n    return $this->intListValue;\n  }\n\n  public function getx_intListValue()[]: Vector<int> {\n    invariant(\n      $this->_type === ComplexUnionEnum::intListValue,\n      'get_intListValue called on an instance of ComplexUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->intListValue as nonnull;\n  }\n\n  public function set_stringListValue(Vector<string> $stringListValue)[write_props]: this {\n    $this->reset();\n    $this->_type = ComplexUnionEnum::stringListValue;\n    $this->stringListValue = $stringListValue;\n    return $this;\n  }\n\n  public function get_stringListValue()[]: ?Vector<string> {\n    return $this->stringListValue;\n  }\n\n  public function getx_stringListValue()[]: Vector<string> {\n    invariant(\n      $this->_type === ComplexUnionEnum::stringListValue,\n      'get_stringListValue called on an instance of ComplexUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->stringListValue as nonnull;\n  }\n\n  public function set_typedefValue(Map<int, string> $typedefValue)[write_props]: this {\n    $this->reset();\n    $this->_type = ComplexUnionEnum::typedefValue;\n    $this->typedefValue = $typedefValue;\n    return $this;\n  }\n\n  public function get_typedefValue()[]: ?Map<int, string> {\n    return $this->typedefValue;\n  }\n\n  public function getx_typedefValue()[]: Map<int, string> {\n    invariant(\n      $this->_type === ComplexUnionEnum::typedefValue,\n      'get_typedefValue called on an instance of ComplexUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->typedefValue as nonnull;\n  }\n\n  public function set_stringRef(string $stringRef)[write_props]: this {\n    $this->reset();\n    $this->_type = ComplexUnionEnum::stringRef;\n    $this->stringRef = $stringRef;\n    return $this;\n  }\n\n  public function get_stringRef()[]: ?string {\n    return $this->stringRef;\n  }\n\n  public function getx_stringRef()[]: string {\n    invariant(\n      $this->_type === ComplexUnionEnum::stringRef,\n      'get_stringRef called on an instance of ComplexUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->stringRef as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ComplexUnion\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"intValue\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"stringValue\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"intListValue\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"stringListValue\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.containerTypedef\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"typedefValue\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 14,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"stringRef\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = ComplexUnionEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'intValue') !== null) {\n      $this->intValue = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['intValue']);\n      $this->_type = ComplexUnionEnum::intValue;\n    }\n    if (idx($parsed, 'stringValue') !== null) {\n      $this->stringValue = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['stringValue']);\n      $this->_type = ComplexUnionEnum::stringValue;\n    }\n    if (idx($parsed, 'intListValue') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['intListValue']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = 0;\n        $_elem5 = $_value2;\n        $_container4 []= $_elem5;\n      }\n      $this->intListValue = $_container4;\n      $this->_type = ComplexUnionEnum::intListValue;\n    }\n    if (idx($parsed, 'stringListValue') !== null) {\n      $_json9 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<string>>($parsed['stringListValue']);\n      $_container10 = Vector {};\n      foreach($_json9 as $_key7 => $_value8) {\n        $_elem11 = '';\n        $_elem11 = $_value8;\n        $_container10 []= $_elem11;\n      }\n      $this->stringListValue = $_container10;\n      $this->_type = ComplexUnionEnum::stringListValue;\n    }\n    if (idx($parsed, 'typedefValue') !== null) {\n      $_json15 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, string>>($parsed['typedefValue']);\n      $_container16 = Map {};\n      foreach($_json15 as $_key13 => $_value14) {\n        $_value17 = '';\n        $_value17 = $_value14;\n        $_container16[$_key13] = $_value17;\n      }\n      $this->typedefValue = $_container16;\n      $this->_type = ComplexUnionEnum::typedefValue;\n    }\n    if (idx($parsed, 'stringRef') !== null) {\n      $this->stringRef = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['stringRef']);\n      $this->_type = ComplexUnionEnum::stringRef;\n    }\n  }\n\n}\n\nenum ListUnionEnum: int {\n  _EMPTY_ = 0;\n  intListValue = 2;\n  stringListValue = 3;\n}\n\n/**\n * Original thrift struct:-\n * ListUnion\n */\nclass ListUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<ListUnionEnum> {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    2 => shape(\n      'var' => 'intListValue',\n      'union' => true,\n      'type' => \\TType::LST,\n      'etype' => \\TType::I64,\n      'elem' => shape(\n        'type' => \\TType::I64,\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'stringListValue',\n      'union' => true,\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'intListValue' => 2,\n    'stringListValue' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'intListValue' => ?Vector<int>,\n    ?'stringListValue' => ?Vector<string>,\n  );\n\n  const int STRUCTURAL_ID = 3965946011249022525;\n  /**\n   * Original thrift field:-\n   * 2: list<i64> intListValue\n   */\n  protected ?Vector<int> $intListValue;\n  /**\n   * Original thrift field:-\n   * 3: list<string> stringListValue\n   */\n  protected ?Vector<string> $stringListValue;\n  protected ListUnionEnum $_type = ListUnionEnum::_EMPTY_;\n\n  public function __construct(?Vector<int> $intListValue = null, ?Vector<string> $stringListValue = null)[] {\n    $this->_type = ListUnionEnum::_EMPTY_;\n    if ($intListValue !== null) {\n      $this->intListValue = $intListValue;\n      $this->_type = ListUnionEnum::intListValue;\n    }\n    if ($stringListValue !== null) {\n      $this->stringListValue = $stringListValue;\n      $this->_type = ListUnionEnum::stringListValue;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'intListValue'),\n      Shapes::idx($shape, 'stringListValue'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ListUnion';\n  }\n\n  public function getType()[]: ListUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case ListUnionEnum::intListValue:\n        $this->intListValue = null;\n        break;\n      case ListUnionEnum::stringListValue:\n        $this->stringListValue = null;\n        break;\n      case ListUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = ListUnionEnum::_EMPTY_;\n  }\n\n  public function set_intListValue(Vector<int> $intListValue)[write_props]: this {\n    $this->reset();\n    $this->_type = ListUnionEnum::intListValue;\n    $this->intListValue = $intListValue;\n    return $this;\n  }\n\n  public function get_intListValue()[]: ?Vector<int> {\n    return $this->intListValue;\n  }\n\n  public function getx_intListValue()[]: Vector<int> {\n    invariant(\n      $this->_type === ListUnionEnum::intListValue,\n      'get_intListValue called on an instance of ListUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->intListValue as nonnull;\n  }\n\n  public function set_stringListValue(Vector<string> $stringListValue)[write_props]: this {\n    $this->reset();\n    $this->_type = ListUnionEnum::stringListValue;\n    $this->stringListValue = $stringListValue;\n    return $this;\n  }\n\n  public function get_stringListValue()[]: ?Vector<string> {\n    return $this->stringListValue;\n  }\n\n  public function getx_stringListValue()[]: Vector<string> {\n    invariant(\n      $this->_type === ListUnionEnum::stringListValue,\n      'get_stringListValue called on an instance of ListUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->stringListValue as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ListUnion\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"intListValue\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"stringListValue\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = ListUnionEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'intListValue') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['intListValue']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = 0;\n        $_elem5 = $_value2;\n        $_container4 []= $_elem5;\n      }\n      $this->intListValue = $_container4;\n      $this->_type = ListUnionEnum::intListValue;\n    }\n    if (idx($parsed, 'stringListValue') !== null) {\n      $_json9 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<string>>($parsed['stringListValue']);\n      $_container10 = Vector {};\n      foreach($_json9 as $_key7 => $_value8) {\n        $_elem11 = '';\n        $_elem11 = $_value8;\n        $_container10 []= $_elem11;\n      }\n      $this->stringListValue = $_container10;\n      $this->_type = ListUnionEnum::stringListValue;\n    }\n  }\n\n}\n\nenum DataUnionEnum: int {\n  _EMPTY_ = 0;\n  binaryData = 1;\n  stringData = 2;\n}\n\n/**\n * Original thrift struct:-\n * DataUnion\n */\nclass DataUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<DataUnionEnum> {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'binaryData',\n      'union' => true,\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    2 => shape(\n      'var' => 'stringData',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'binaryData' => 1,\n    'stringData' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'binaryData' => ?string,\n    ?'stringData' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 4138034353479042532;\n  /**\n   * Original thrift field:-\n   * 1: binary binaryData\n   */\n  protected ?string $binaryData;\n  /**\n   * Original thrift field:-\n   * 2: string stringData\n   */\n  protected ?string $stringData;\n  protected DataUnionEnum $_type = DataUnionEnum::_EMPTY_;\n\n  public function __construct(?string $binaryData = null, ?string $stringData = null)[] {\n    $this->_type = DataUnionEnum::_EMPTY_;\n    if ($binaryData !== null) {\n      $this->binaryData = $binaryData;\n      $this->_type = DataUnionEnum::binaryData;\n    }\n    if ($stringData !== null) {\n      $this->stringData = $stringData;\n      $this->_type = DataUnionEnum::stringData;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'binaryData'),\n      Shapes::idx($shape, 'stringData'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'DataUnion';\n  }\n\n  public function getType()[]: DataUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case DataUnionEnum::binaryData:\n        $this->binaryData = null;\n        break;\n      case DataUnionEnum::stringData:\n        $this->stringData = null;\n        break;\n      case DataUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = DataUnionEnum::_EMPTY_;\n  }\n\n  public function set_binaryData(string $binaryData)[write_props]: this {\n    $this->reset();\n    $this->_type = DataUnionEnum::binaryData;\n    $this->binaryData = $binaryData;\n    return $this;\n  }\n\n  public function get_binaryData()[]: ?string {\n    return $this->binaryData;\n  }\n\n  public function getx_binaryData()[]: string {\n    invariant(\n      $this->_type === DataUnionEnum::binaryData,\n      'get_binaryData called on an instance of DataUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->binaryData as nonnull;\n  }\n\n  public function set_stringData(string $stringData)[write_props]: this {\n    $this->reset();\n    $this->_type = DataUnionEnum::stringData;\n    $this->stringData = $stringData;\n    return $this;\n  }\n\n  public function get_stringData()[]: ?string {\n    return $this->stringData;\n  }\n\n  public function getx_stringData()[]: string {\n    invariant(\n      $this->_type === DataUnionEnum::stringData,\n      'get_stringData called on an instance of DataUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->stringData as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.DataUnion\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"binaryData\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"stringData\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = DataUnionEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'binaryData') !== null) {\n      $this->binaryData = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['binaryData']);\n      $this->_type = DataUnionEnum::binaryData;\n    }\n    if (idx($parsed, 'stringData') !== null) {\n      $this->stringData = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['stringData']);\n      $this->_type = DataUnionEnum::stringData;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Val\n */\nclass Val implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'strVal',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'intVal',\n      'type' => \\TType::I32,\n    ),\n    9 => shape(\n      'var' => 'typedefValue',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I16,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::I16,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'strVal' => 1,\n    'intVal' => 2,\n    'typedefValue' => 9,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'strVal' => ?string,\n    ?'intVal' => ?int,\n    ?'typedefValue' => ?Map<int, string>,\n  );\n\n  const int STRUCTURAL_ID = 7250696402099336501;\n  /**\n   * Original thrift field:-\n   * 1: string strVal\n   */\n  public string $strVal;\n  /**\n   * Original thrift field:-\n   * 2: i32 intVal\n   */\n  public int $intVal;\n  /**\n   * Original thrift field:-\n   * 9: module.containerTypedef typedefValue\n   */\n  public Map<int, string> $typedefValue;\n\n  public function __construct(?string $strVal = null, ?int $intVal = null, ?Map<int, string> $typedefValue = null)[] {\n    $this->strVal = $strVal ?? '';\n    $this->intVal = $intVal ?? 0;\n    $this->typedefValue = $typedefValue ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'strVal'),\n      Shapes::idx($shape, 'intVal'),\n      Shapes::idx($shape, 'typedefValue'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Val';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Val\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"strVal\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"intVal\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.containerTypedef\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"typedefValue\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'strVal') !== null) {\n      $this->strVal = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['strVal']);\n    }\n    if (idx($parsed, 'intVal') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['intVal']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->intVal = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'typedefValue') !== null) {\n      $_json4 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, string>>($parsed['typedefValue']);\n      $_container5 = Map {};\n      foreach($_json4 as $_key2 => $_value3) {\n        $_value6 = '';\n        $_value6 = $_value3;\n        $_container5[$_key2] = $_value6;\n      }\n      $this->typedefValue = $_container5;\n    }\n  }\n\n}\n\nenum ValUnionEnum: int {\n  _EMPTY_ = 0;\n  v1 = 1;\n  v2 = 2;\n}\n\n/**\n * Original thrift struct:-\n * ValUnion\n */\nclass ValUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<ValUnionEnum> {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'v1',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => Val::class,\n    ),\n    2 => shape(\n      'var' => 'v2',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => Val::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'v1' => 1,\n    'v2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'v1' => ?Val,\n    ?'v2' => ?Val,\n  );\n\n  const int STRUCTURAL_ID = 7355268417298249876;\n  /**\n   * Original thrift field:-\n   * 1: module.Val v1\n   */\n  protected ?Val $v1;\n  /**\n   * Original thrift field:-\n   * 2: module.Val v2\n   */\n  protected ?Val $v2;\n  protected ValUnionEnum $_type = ValUnionEnum::_EMPTY_;\n\n  public function __construct(?Val $v1 = null, ?Val $v2 = null)[] {\n    $this->_type = ValUnionEnum::_EMPTY_;\n    if ($v1 !== null) {\n      $this->v1 = $v1;\n      $this->_type = ValUnionEnum::v1;\n    }\n    if ($v2 !== null) {\n      $this->v2 = $v2;\n      $this->_type = ValUnionEnum::v2;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'v1'),\n      Shapes::idx($shape, 'v2'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ValUnion';\n  }\n\n  public function getType()[]: ValUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case ValUnionEnum::v1:\n        $this->v1 = null;\n        break;\n      case ValUnionEnum::v2:\n        $this->v2 = null;\n        break;\n      case ValUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = ValUnionEnum::_EMPTY_;\n  }\n\n  public function set_v1(Val $v1)[write_props]: this {\n    $this->reset();\n    $this->_type = ValUnionEnum::v1;\n    $this->v1 = $v1;\n    return $this;\n  }\n\n  public function get_v1()[]: ?Val {\n    return $this->v1;\n  }\n\n  public function getx_v1()[]: Val {\n    invariant(\n      $this->_type === ValUnionEnum::v1,\n      'get_v1 called on an instance of ValUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->v1 as nonnull;\n  }\n\n  public function set_v2(Val $v2)[write_props]: this {\n    $this->reset();\n    $this->_type = ValUnionEnum::v2;\n    $this->v2 = $v2;\n    return $this;\n  }\n\n  public function get_v2()[]: ?Val {\n    return $this->v2;\n  }\n\n  public function getx_v2()[]: Val {\n    invariant(\n      $this->_type === ValUnionEnum::v2,\n      'get_v2 called on an instance of ValUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->v2 as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ValUnion\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Val\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"v1\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Val\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"v2\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = ValUnionEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'v1') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, Val>($parsed['v1']));\n      $_tmp1 = Val::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->v1 = $_tmp1;\n      $this->_type = ValUnionEnum::v1;\n    }\n    if (idx($parsed, 'v2') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, Val>($parsed['v2']));\n      $_tmp3 = Val::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->v2 = $_tmp3;\n      $this->_type = ValUnionEnum::v2;\n    }\n  }\n\n}\n\nenum VirtualComplexUnionEnum: int {\n  _EMPTY_ = 0;\n  thingOne = 1;\n  thingTwo = 2;\n}\n\n/**\n * Original thrift struct:-\n * VirtualComplexUnion\n */\nclass VirtualComplexUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<VirtualComplexUnionEnum> {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'thingOne',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'thingTwo',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'thingOne' => 1,\n    'thingTwo' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'thingOne' => ?string,\n    ?'thingTwo' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 8657642278595798833;\n  /**\n   * Original thrift field:-\n   * 1: string thingOne\n   */\n  protected ?string $thingOne;\n  /**\n   * Original thrift field:-\n   * 2: string thingTwo\n   */\n  protected ?string $thingTwo;\n  protected VirtualComplexUnionEnum $_type = VirtualComplexUnionEnum::_EMPTY_;\n\n  public function __construct(?string $thingOne = null, ?string $thingTwo = null)[] {\n    $this->_type = VirtualComplexUnionEnum::_EMPTY_;\n    if ($thingOne !== null) {\n      $this->thingOne = $thingOne;\n      $this->_type = VirtualComplexUnionEnum::thingOne;\n    }\n    if ($thingTwo !== null) {\n      $this->thingTwo = $thingTwo;\n      $this->_type = VirtualComplexUnionEnum::thingTwo;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'thingOne'),\n      Shapes::idx($shape, 'thingTwo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'VirtualComplexUnion';\n  }\n\n  public function getType()[]: VirtualComplexUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case VirtualComplexUnionEnum::thingOne:\n        $this->thingOne = null;\n        break;\n      case VirtualComplexUnionEnum::thingTwo:\n        $this->thingTwo = null;\n        break;\n      case VirtualComplexUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = VirtualComplexUnionEnum::_EMPTY_;\n  }\n\n  public function set_thingOne(string $thingOne)[write_props]: this {\n    $this->reset();\n    $this->_type = VirtualComplexUnionEnum::thingOne;\n    $this->thingOne = $thingOne;\n    return $this;\n  }\n\n  public function get_thingOne()[]: ?string {\n    return $this->thingOne;\n  }\n\n  public function getx_thingOne()[]: string {\n    invariant(\n      $this->_type === VirtualComplexUnionEnum::thingOne,\n      'get_thingOne called on an instance of VirtualComplexUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->thingOne as nonnull;\n  }\n\n  public function set_thingTwo(string $thingTwo)[write_props]: this {\n    $this->reset();\n    $this->_type = VirtualComplexUnionEnum::thingTwo;\n    $this->thingTwo = $thingTwo;\n    return $this;\n  }\n\n  public function get_thingTwo()[]: ?string {\n    return $this->thingTwo;\n  }\n\n  public function getx_thingTwo()[]: string {\n    invariant(\n      $this->_type === VirtualComplexUnionEnum::thingTwo,\n      'get_thingTwo called on an instance of VirtualComplexUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->thingTwo as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.VirtualComplexUnion\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"thingOne\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"thingTwo\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = VirtualComplexUnionEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'thingOne') !== null) {\n      $this->thingOne = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['thingOne']);\n      $this->_type = VirtualComplexUnionEnum::thingOne;\n    }\n    if (idx($parsed, 'thingTwo') !== null) {\n      $this->thingTwo = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['thingTwo']);\n      $this->_type = VirtualComplexUnionEnum::thingTwo;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * NonCopyableStruct\n */\nclass NonCopyableStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'num',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'num' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'num' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 7064950569513307469;\n  /**\n   * Original thrift field:-\n   * 1: i64 num\n   */\n  public int $num;\n\n  public function __construct(?int $num = null)[] {\n    $this->num = $num ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'num'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NonCopyableStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.NonCopyableStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"num\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'num') !== null) {\n      $this->num = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['num']);\n    }\n  }\n\n}\n\nenum NonCopyableUnionEnum: int {\n  _EMPTY_ = 0;\n  s = 1;\n}\n\n/**\n * Original thrift struct:-\n * NonCopyableUnion\n */\nclass NonCopyableUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<NonCopyableUnionEnum> {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 's',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => NonCopyableStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    's' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'s' => ?NonCopyableStruct,\n  );\n\n  const int STRUCTURAL_ID = 5595426780316201025;\n  /**\n   * Original thrift field:-\n   * 1: module.NonCopyableStruct s\n   */\n  protected ?NonCopyableStruct $s;\n  protected NonCopyableUnionEnum $_type = NonCopyableUnionEnum::_EMPTY_;\n\n  public function __construct(?NonCopyableStruct $s = null)[] {\n    $this->_type = NonCopyableUnionEnum::_EMPTY_;\n    if ($s !== null) {\n      $this->s = $s;\n      $this->_type = NonCopyableUnionEnum::s;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 's'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NonCopyableUnion';\n  }\n\n  public function getType()[]: NonCopyableUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case NonCopyableUnionEnum::s:\n        $this->s = null;\n        break;\n      case NonCopyableUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = NonCopyableUnionEnum::_EMPTY_;\n  }\n\n  public function set_s(NonCopyableStruct $s)[write_props]: this {\n    $this->reset();\n    $this->_type = NonCopyableUnionEnum::s;\n    $this->s = $s;\n    return $this;\n  }\n\n  public function get_s()[]: ?NonCopyableStruct {\n    return $this->s;\n  }\n\n  public function getx_s()[]: NonCopyableStruct {\n    invariant(\n      $this->_type === NonCopyableUnionEnum::s,\n      'get_s called on an instance of NonCopyableUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->s as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.NonCopyableUnion\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.NonCopyableStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"s\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = NonCopyableUnionEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 's') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, NonCopyableStruct>($parsed['s']));\n      $_tmp1 = NonCopyableStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->s = $_tmp1;\n      $this->_type = NonCopyableUnionEnum::s;\n    }\n  }\n\n}\n\n", "num_lines": 1817}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nclass module_CONSTANTS implements \\IThriftConstants {\n  /**\n   * Original thrift constant:-\n   * i32 myInt\n   */\n  const int myInt = 1337;\n\n  /**\n   * Original thrift constant:-\n   * string name\n   */\n  const string name = \"Mark Zuckerberg\";\n\n  /**\n   * Original thrift constant:-\n   * string multi_line_string\n   */\n  const string multi_line_string = \"This\\nis a\\nmulti line string.\\n\";\n\n  /**\n   * Original thrift constant:-\n   * list<map<string, i32>> states\n   */\n  <<__Memoize>>\n  public static function states()[write_props]: \\ConstVector<\\ConstMap<string, int>>{\n    return ImmVector {\n      ImmMap {\n        \"San Diego\" => 3211000,\n        \"Sacramento\" => 479600,\n        \"SF\" => 837400,\n      },\n      ImmMap {\n        \"New York\" => 8406000,\n        \"Albany\" => 98400,\n      },\n    };\n  }\n\n  /**\n   * Original thrift constant:-\n   * double x\n   */\n  const float x = 1.0;\n\n  /**\n   * Original thrift constant:-\n   * double y\n   */\n  const float y = 1000000.0;\n\n  /**\n   * Original thrift constant:-\n   * double z\n   */\n  const float z = 1e+09;\n\n  /**\n   * Original thrift constant:-\n   * double zeroDoubleValue\n   */\n  const float zeroDoubleValue = 0.0;\n\n  /**\n   * Original thrift constant:-\n   * double longDoubleValue\n   */\n  const float longDoubleValue = 2.59961e-05;\n\n  /**\n   * Original thrift constant:-\n   * module.MyCompany my_company\n   */\n  const MyCompany my_company = Company::FACEBOOK;\n\n  /**\n   * Original thrift constant:-\n   * module.MyStringIdentifier foo\n   */\n  const MyStringIdentifier foo = \"foo\";\n\n  /**\n   * Original thrift constant:-\n   * module.MyIntIdentifier bar\n   */\n  const MyIntIdentifier bar = 42;\n\n  /**\n   * Original thrift constant:-\n   * module.MyMapIdentifier mymap\n   */\n  <<__Memoize>>\n  public static function mymap()[write_props]: MyMapIdentifier{\n    return ImmMap {\n      \"keys\" => \"values\",\n    };\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.Internship instagram\n   */\n  <<__Memoize>>\n  public static function instagram()[write_props]: Internship{\n    return Internship::fromShape(\n      shape(\n        \"weeks\" => 12,\n        \"title\" => \"Software Engineer\",\n        \"employer\" => Company::INSTAGRAM,\n        \"compensation\" => 1200.0,\n        \"school\" => \"Monters University\",\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.Internship partial_const\n   */\n  <<__Memoize>>\n  public static function partial_const()[write_props]: Internship{\n    return Internship::fromShape(\n      shape(\n        \"weeks\" => 8,\n        \"title\" => \"Some Job\",\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * list<module.Range> kRanges\n   */\n  <<__Memoize>>\n  public static function kRanges()[write_props]: \\ConstVector<Range>{\n    return ImmVector {\n      Range::fromShape(\n        shape(\n          \"min\" => 1,\n          \"max\" => 2,\n        )\n      ),\n      Range::fromShape(\n        shape(\n          \"min\" => 5,\n          \"max\" => 6,\n        )\n      ),\n    };\n  }\n\n  /**\n   * Original thrift constant:-\n   * list<module.Internship> internList\n   */\n  <<__Memoize>>\n  public static function internList()[write_props]: \\ConstVector<Internship>{\n    return ImmVector {\n      Internship::fromShape(\n        shape(\n          \"weeks\" => 12,\n          \"title\" => \"Software Engineer\",\n          \"employer\" => Company::INSTAGRAM,\n          \"compensation\" => 1200.0,\n          \"school\" => \"Monters University\",\n        )\n      ),\n      Internship::fromShape(\n        shape(\n          \"weeks\" => 10,\n          \"title\" => \"Sales Intern\",\n          \"employer\" => Company::FACEBOOK,\n          \"compensation\" => 1000.0,\n        )\n      ),\n    };\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.struct1 pod_0\n   */\n  <<__Memoize>>\n  public static function pod_0()[write_props]: struct1{\n    return struct1::fromShape(\n      shape(\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.struct1 pod_s_0\n   */\n  <<__Memoize>>\n  public static function pod_s_0()[write_props]: struct1{\n    return struct1::fromShape(\n      shape(\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.struct1 pod_1\n   */\n  <<__Memoize>>\n  public static function pod_1()[write_props]: struct1{\n    return struct1::fromShape(\n      shape(\n        \"a\" => 10,\n        \"b\" => \"foo\",\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.struct1 pod_s_1\n   */\n  <<__Memoize>>\n  public static function pod_s_1()[write_props]: struct1{\n    return struct1::fromShape(\n      shape(\n        \"a\" => 10,\n        \"b\" => \"foo\",\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.struct2 pod_2\n   */\n  <<__Memoize>>\n  public static function pod_2()[write_props]: struct2{\n    return struct2::fromShape(\n      shape(\n        \"a\" => 98,\n        \"b\" => \"gaz\",\n        \"c\" => struct1::fromShape(\n          shape(\n            \"a\" => 12,\n            \"b\" => \"bar\",\n          )\n        ),\n        \"d\" => Vector {\n          11,\n          22,\n          33,\n        },\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.struct2 pod_trailing_commas\n   */\n  <<__Memoize>>\n  public static function pod_trailing_commas()[write_props]: struct2{\n    return struct2::fromShape(\n      shape(\n        \"a\" => 98,\n        \"b\" => \"gaz\",\n        \"c\" => struct1::fromShape(\n          shape(\n            \"a\" => 12,\n            \"b\" => \"bar\",\n          )\n        ),\n        \"d\" => Vector {\n          11,\n          22,\n          33,\n        },\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.struct2 pod_s_2\n   */\n  <<__Memoize>>\n  public static function pod_s_2()[write_props]: struct2{\n    return struct2::fromShape(\n      shape(\n        \"a\" => 98,\n        \"b\" => \"gaz\",\n        \"c\" => struct1::fromShape(\n          shape(\n            \"a\" => 12,\n            \"b\" => \"bar\",\n          )\n        ),\n        \"d\" => Vector {\n          11,\n          22,\n          33,\n        },\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.struct3 pod_3\n   */\n  <<__Memoize>>\n  public static function pod_3()[write_props]: struct3{\n    return struct3::fromShape(\n      shape(\n        \"a\" => \"abc\",\n        \"b\" => 456,\n        \"c\" => struct2::fromShape(\n          shape(\n            \"a\" => 888,\n            \"c\" => struct1::fromShape(\n              shape(\n                \"b\" => \"gaz\",\n              )\n            ),\n            \"d\" => Vector {\n              1,\n              2,\n              3,\n            },\n          )\n        ),\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.struct3 pod_s_3\n   */\n  <<__Memoize>>\n  public static function pod_s_3()[write_props]: struct3{\n    return struct3::fromShape(\n      shape(\n        \"a\" => \"abc\",\n        \"b\" => 456,\n        \"c\" => struct2::fromShape(\n          shape(\n            \"a\" => 888,\n            \"c\" => struct1::fromShape(\n              shape(\n                \"b\" => \"gaz\",\n              )\n            ),\n            \"d\" => Vector {\n              1,\n              2,\n              3,\n            },\n          )\n        ),\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.struct4 pod_4\n   */\n  <<__Memoize>>\n  public static function pod_4()[write_props]: struct4{\n    return struct4::fromShape(\n      shape(\n        \"a\" => 1234,\n        \"b\" => 0.333,\n        \"c\" => 25,\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.union1 u_1_1\n   */\n  <<__Memoize>>\n  public static function u_1_1()[write_props]: union1{\n    return union1::fromShape(\n      shape(\n        \"i\" => 97,\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.union1 u_1_2\n   */\n  <<__Memoize>>\n  public static function u_1_2()[write_props]: union1{\n    return union1::fromShape(\n      shape(\n        \"d\" => 5.6,\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.union1 u_1_3\n   */\n  <<__Memoize>>\n  public static function u_1_3()[write_props]: union1{\n    return union1::fromShape(\n      shape(\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.union2 u_2_1\n   */\n  <<__Memoize>>\n  public static function u_2_1()[write_props]: union2{\n    return union2::fromShape(\n      shape(\n        \"i\" => 51,\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.union2 u_2_2\n   */\n  <<__Memoize>>\n  public static function u_2_2()[write_props]: union2{\n    return union2::fromShape(\n      shape(\n        \"d\" => 6.7,\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.union2 u_2_3\n   */\n  <<__Memoize>>\n  public static function u_2_3()[write_props]: union2{\n    return union2::fromShape(\n      shape(\n        \"s\" => struct1::fromShape(\n          shape(\n            \"a\" => 8,\n            \"b\" => \"abacabb\",\n          )\n        ),\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.union2 u_2_4\n   */\n  <<__Memoize>>\n  public static function u_2_4()[write_props]: union2{\n    return union2::fromShape(\n      shape(\n        \"u\" => union1::fromShape(\n          shape(\n            \"i\" => 43,\n          )\n        ),\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.union2 u_2_5\n   */\n  <<__Memoize>>\n  public static function u_2_5()[write_props]: union2{\n    return union2::fromShape(\n      shape(\n        \"u\" => union1::fromShape(\n          shape(\n            \"d\" => 9.8,\n          )\n        ),\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * module.union2 u_2_6\n   */\n  <<__Memoize>>\n  public static function u_2_6()[write_props]: union2{\n    return union2::fromShape(\n      shape(\n        \"u\" => union1::fromShape(\n          shape(\n          )\n        ),\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * string apostrophe\n   */\n  const string apostrophe = \"'\";\n\n  /**\n   * Original thrift constant:-\n   * string tripleApostrophe\n   */\n  const string tripleApostrophe = \"'''\";\n\n  /**\n   * Original thrift constant:-\n   * string quotationMark\n   */\n  const string quotationMark = \"\\\"\";\n\n  /**\n   * Original thrift constant:-\n   * string backslash\n   */\n  const string backslash = \"\\\\\";\n\n  /**\n   * Original thrift constant:-\n   * string escaped_a\n   */\n  const string escaped_a = \"a\";\n\n  /**\n   * Original thrift constant:-\n   * map<string, i32> char2ascii\n   */\n  <<__Memoize>>\n  public static function char2ascii()[write_props]: \\ConstMap<string, int>{\n    return ImmMap {\n      \"'\" => 39,\n      \"\\\"\" => 34,\n      \"\\\\\" => 92,\n      \"a\" => 97,\n    };\n  }\n\n  /**\n   * Original thrift constant:-\n   * list<string> escaped_strings\n   */\n  <<__Memoize>>\n  public static function escaped_strings()[write_props]: \\ConstVector<string>{\n    return ImmVector {\n      \"\\x01\",\n      \"\\x1f\",\n      \" \",\n      \"'\",\n      \"\\\"\",\n      \"\\n\",\n      \"\\x0d\",\n      \"\\x09\",\n      \"a\",\n      \"\u00c2\u00ab\",\n      \"j\",\n      \"\u00c2\u00a6\",\n      \"ayyy\",\n      \"\u00c2\u00abyyy\",\n      \"jyyy\",\n      \"\u00c2\u00a6yyy\",\n      \"zzza\",\n      \"zzz\u00c2\u00ab\",\n      \"zzzj\",\n      \"zzz\u00c2\u00a6\",\n      \"zzzayyy\",\n      \"zzz\u00c2\u00abyyy\",\n      \"zzzjyyy\",\n      \"zzz\u00c2\u00a6yyy\",\n    };\n  }\n\n  /**\n   * Original thrift constant:-\n   * bool false_c\n   */\n  const bool false_c = false;\n\n  /**\n   * Original thrift constant:-\n   * bool true_c\n   */\n  const bool true_c = true;\n\n  /**\n   * Original thrift constant:-\n   * byte zero_byte\n   */\n  const int zero_byte = 0;\n\n  /**\n   * Original thrift constant:-\n   * i16 zero16\n   */\n  const int zero16 = 0;\n\n  /**\n   * Original thrift constant:-\n   * i32 zero32\n   */\n  const int zero32 = 0;\n\n  /**\n   * Original thrift constant:-\n   * i64 zero64\n   */\n  const int zero64 = 0;\n\n  /**\n   * Original thrift constant:-\n   * double zero_dot_zero\n   */\n  const float zero_dot_zero = 0.0;\n\n  /**\n   * Original thrift constant:-\n   * string empty_string\n   */\n  const string empty_string = \"\";\n\n  /**\n   * Original thrift constant:-\n   * list<i32> empty_int_list\n   */\n  <<__Memoize>>\n  public static function empty_int_list()[write_props]: \\ConstVector<int>{\n    return ImmVector {\n    };\n  }\n\n  /**\n   * Original thrift constant:-\n   * list<string> empty_string_list\n   */\n  <<__Memoize>>\n  public static function empty_string_list()[write_props]: \\ConstVector<string>{\n    return ImmVector {\n    };\n  }\n\n  /**\n   * Original thrift constant:-\n   * set<i32> empty_int_set\n   */\n  <<__Memoize>>\n  public static function empty_int_set()[write_props]: \\ConstSet<int>{\n    return ImmSet {\n    };\n  }\n\n  /**\n   * Original thrift constant:-\n   * set<string> empty_string_set\n   */\n  <<__Memoize>>\n  public static function empty_string_set()[write_props]: \\ConstSet<string>{\n    return ImmSet {\n    };\n  }\n\n  /**\n   * Original thrift constant:-\n   * map<i32, i32> empty_int_int_map\n   */\n  <<__Memoize>>\n  public static function empty_int_int_map()[write_props]: \\ConstMap<int, int>{\n    return ImmMap {\n    };\n  }\n\n  /**\n   * Original thrift constant:-\n   * map<i32, string> empty_int_string_map\n   */\n  <<__Memoize>>\n  public static function empty_int_string_map()[write_props]: \\ConstMap<int, string>{\n    return ImmMap {\n    };\n  }\n\n  /**\n   * Original thrift constant:-\n   * map<string, i32> empty_string_int_map\n   */\n  <<__Memoize>>\n  public static function empty_string_int_map()[write_props]: \\ConstMap<string, int>{\n    return ImmMap {\n    };\n  }\n\n  /**\n   * Original thrift constant:-\n   * map<string, string> empty_string_string_map\n   */\n  <<__Memoize>>\n  public static function empty_string_string_map()[write_props]: \\ConstMap<string, string>{\n    return ImmMap {\n    };\n  }\n\n  /**\n   * Original thrift constant:-\n   * i64 maxIntDec\n   */\n  const int maxIntDec = 9223372036854775807;\n\n  /**\n   * Original thrift constant:-\n   * i64 maxIntOct\n   */\n  const int maxIntOct = 9223372036854775807;\n\n  /**\n   * Original thrift constant:-\n   * i64 maxIntHex\n   */\n  const int maxIntHex = 9223372036854775807;\n\n  /**\n   * Original thrift constant:-\n   * i64 maxIntBin\n   */\n  const int maxIntBin = 9223372036854775807;\n\n  /**\n   * Original thrift constant:-\n   * double maxDub\n   */\n  const float maxDub = 1.79769e+308;\n\n  /**\n   * Original thrift constant:-\n   * double minDub\n   */\n  const float minDub = 2.22507e-308;\n\n  /**\n   * Original thrift constant:-\n   * double minSDub\n   */\n  const float minSDub = 4.94066e-324;\n\n  /**\n   * Original thrift constant:-\n   * i64 maxPIntDec\n   */\n  const int maxPIntDec = 9223372036854775807;\n\n  /**\n   * Original thrift constant:-\n   * i64 maxPIntOct\n   */\n  const int maxPIntOct = 9223372036854775807;\n\n  /**\n   * Original thrift constant:-\n   * i64 maxPIntHex\n   */\n  const int maxPIntHex = 9223372036854775807;\n\n  /**\n   * Original thrift constant:-\n   * i64 maxPIntBin\n   */\n  const int maxPIntBin = 9223372036854775807;\n\n  /**\n   * Original thrift constant:-\n   * double maxPDub\n   */\n  const float maxPDub = 1.79769e+308;\n\n  /**\n   * Original thrift constant:-\n   * double minPDub\n   */\n  const float minPDub = 2.22507e-308;\n\n  /**\n   * Original thrift constant:-\n   * double minPSDub\n   */\n  const float minPSDub = 4.94066e-324;\n\n  /**\n   * Original thrift constant:-\n   * i64 minIntDec\n   */\n  const int minIntDec = -9223372036854775808;\n\n  /**\n   * Original thrift constant:-\n   * i64 minIntOct\n   */\n  const int minIntOct = -9223372036854775808;\n\n  /**\n   * Original thrift constant:-\n   * i64 minIntHex\n   */\n  const int minIntHex = -9223372036854775808;\n\n  /**\n   * Original thrift constant:-\n   * i64 minIntBin\n   */\n  const int minIntBin = -9223372036854775808;\n\n  /**\n   * Original thrift constant:-\n   * double maxNDub\n   */\n  const float maxNDub = -1.79769e+308;\n\n  /**\n   * Original thrift constant:-\n   * double minNDub\n   */\n  const float minNDub = -2.22507e-308;\n\n  /**\n   * Original thrift constant:-\n   * double minNSDub\n   */\n  const float minNSDub = -4.94066e-324;\n\n\n  public static function getAllStructuredAnnotations()[write_props]: dict<string, dict<string, \\IThriftStruct>> {\n    return dict[\n    ];\n  }\n}\n\n", "num_lines": 857}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift enum:-\n * EmptyEnum\n */\nenum EmptyEnum: int {\n}\n\nclass EmptyEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.EmptyEnum\",\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift enum:-\n * City\n */\nenum City: int {\n  NYC = 0;\n  MPK = 1;\n  SEA = 2;\n  LON = 3;\n}\n\nclass City_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.City\",\n        \"elements\" => dict[\n          0 => \"NYC\",\n          1 => \"MPK\",\n          2 => \"SEA\",\n          3 => \"LON\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift enum:-\n * Company\n */\nenum Company: int {\n  FACEBOOK = 0;\n  WHATSAPP = 1;\n  OCULUS = 2;\n  INSTAGRAM = 3;\n}\n\nclass Company_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.Company\",\n        \"elements\" => dict[\n          0 => \"FACEBOOK\",\n          1 => \"WHATSAPP\",\n          2 => \"OCULUS\",\n          3 => \"INSTAGRAM\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\ntype MyCompany = Company;\ntype MyStringIdentifier = string;\ntype MyIntIdentifier = int;\ntype MyMapIdentifier = Map<string, string>;\n/**\n * Original thrift struct:-\n * Internship\n */\nclass Internship implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'weeks',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'title',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'employer',\n      'type' => \\TType::I32,\n      'enum' => Company::class,\n    ),\n    4 => shape(\n      'var' => 'compensation',\n      'type' => \\TType::DOUBLE,\n    ),\n    5 => shape(\n      'var' => 'school',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'weeks' => 1,\n    'title' => 2,\n    'employer' => 3,\n    'compensation' => 4,\n    'school' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'weeks' => ?int,\n    ?'title' => ?string,\n    ?'employer' => ?Company,\n    ?'compensation' => ?float,\n    ?'school' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 5601694484190969969;\n  /**\n   * Original thrift field:-\n   * 1: i32 weeks\n   */\n  public int $weeks;\n  /**\n   * Original thrift field:-\n   * 2: string title\n   */\n  public string $title;\n  /**\n   * Original thrift field:-\n   * 3: module.Company employer\n   */\n  public ?Company $employer;\n  /**\n   * Original thrift field:-\n   * 4: double compensation\n   */\n  public ?float $compensation;\n  /**\n   * Original thrift field:-\n   * 5: string school\n   */\n  public ?string $school;\n\n  public function __construct(?int $weeks = null, ?string $title = null, ?Company $employer = null, ?float $compensation = null, ?string $school = null)[] {\n    $this->weeks = $weeks ?? 0;\n    $this->title = $title ?? '';\n    $this->employer = $employer;\n    $this->compensation = $compensation;\n    $this->school = $school;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'weeks'),\n      Shapes::idx($shape, 'title'),\n      Shapes::idx($shape, 'employer'),\n      Shapes::idx($shape, 'compensation'),\n      Shapes::idx($shape, 'school'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Internship';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Internship\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"weeks\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"title\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Company\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"employer\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"compensation\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"school\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Range\n */\nclass Range implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'min',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'max',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'min' => 1,\n    'max' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'min' => ?int,\n    ?'max' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 6850388386457434767;\n  /**\n   * Original thrift field:-\n   * 1: i32 min\n   */\n  public int $min;\n  /**\n   * Original thrift field:-\n   * 2: i32 max\n   */\n  public int $max;\n\n  public function __construct(?int $min = null, ?int $max = null)[] {\n    $this->min = $min ?? 0;\n    $this->max = $max ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'min'),\n      Shapes::idx($shape, 'max'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Range';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Range\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"min\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"max\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * struct1\n */\nclass struct1 implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?int,\n    ?'b' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 7783381726179123112;\n  /**\n   * Original thrift field:-\n   * 1: i32 a\n   */\n  public int $a;\n  /**\n   * Original thrift field:-\n   * 2: string b\n   */\n  public string $b;\n\n  public function __construct(?int $a = null, ?string $b = null)[] {\n    $this->a = $a ?? 1234567;\n    $this->b = $b ?? \"<uninitialized>\";\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'struct1';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.struct1\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * struct2\n */\nclass struct2 implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'c',\n      'type' => \\TType::STRUCT,\n      'class' => struct1::class,\n    ),\n    4 => shape(\n      'var' => 'd',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n    'c' => 3,\n    'd' => 4,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?int,\n    ?'b' => ?string,\n    ?'c' => ?struct1,\n    ?'d' => ?Vector<int>,\n  );\n\n  const int STRUCTURAL_ID = 6352184485829261382;\n  /**\n   * Original thrift field:-\n   * 1: i32 a\n   */\n  public int $a;\n  /**\n   * Original thrift field:-\n   * 2: string b\n   */\n  public string $b;\n  /**\n   * Original thrift field:-\n   * 3: module.struct1 c\n   */\n  public ?struct1 $c;\n  /**\n   * Original thrift field:-\n   * 4: list<i32> d\n   */\n  public Vector<int> $d;\n\n  public function __construct(?int $a = null, ?string $b = null, ?struct1 $c = null, ?Vector<int> $d = null)[] {\n    $this->a = $a ?? 0;\n    $this->b = $b ?? '';\n    $this->c = $c;\n    $this->d = $d ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n      Shapes::idx($shape, 'c'),\n      Shapes::idx($shape, 'd'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'struct2';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.struct2\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.struct1\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"c\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"d\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * struct3\n */\nclass struct3 implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::I32,\n    ),\n    3 => shape(\n      'var' => 'c',\n      'type' => \\TType::STRUCT,\n      'class' => struct2::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n    'c' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?string,\n    ?'b' => ?int,\n    ?'c' => ?struct2,\n  );\n\n  const int STRUCTURAL_ID = 8770775784736740409;\n  /**\n   * Original thrift field:-\n   * 1: string a\n   */\n  public string $a;\n  /**\n   * Original thrift field:-\n   * 2: i32 b\n   */\n  public int $b;\n  /**\n   * Original thrift field:-\n   * 3: module.struct2 c\n   */\n  public ?struct2 $c;\n\n  public function __construct(?string $a = null, ?int $b = null, ?struct2 $c = null)[] {\n    $this->a = $a ?? '';\n    $this->b = $b ?? 0;\n    $this->c = $c;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n      Shapes::idx($shape, 'c'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'struct3';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.struct3\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.struct2\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"c\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * struct4\n */\nclass struct4 implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::DOUBLE,\n    ),\n    3 => shape(\n      'var' => 'c',\n      'type' => \\TType::BYTE,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n    'c' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?int,\n    ?'b' => ?float,\n    ?'c' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 3152965649269433242;\n  /**\n   * Original thrift field:-\n   * 1: i32 a\n   */\n  public int $a;\n  /**\n   * Original thrift field:-\n   * 2: double b\n   */\n  public ?float $b;\n  /**\n   * Original thrift field:-\n   * 3: byte c\n   */\n  public ?int $c;\n\n  public function __construct(?int $a = null, ?float $b = null, ?int $c = null)[] {\n    $this->a = $a ?? 0;\n    $this->b = $b;\n    $this->c = $c;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n      Shapes::idx($shape, 'c'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'struct4';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.struct4\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"b\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                )\n              ),\n              \"name\" => \"c\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nenum union1Enum: int {\n  _EMPTY_ = 0;\n  i = 1;\n  d = 2;\n}\n\n/**\n * Original thrift struct:-\n * union1\n */\nclass union1 implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<union1Enum> {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'i',\n      'union' => true,\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'd',\n      'union' => true,\n      'type' => \\TType::DOUBLE,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'i' => 1,\n    'd' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'i' => ?int,\n    ?'d' => ?float,\n  );\n\n  const int STRUCTURAL_ID = 3529312341790331108;\n  /**\n   * Original thrift field:-\n   * 1: i32 i\n   */\n  public ?int $i;\n  /**\n   * Original thrift field:-\n   * 2: double d\n   */\n  public ?float $d;\n  protected union1Enum $_type = union1Enum::_EMPTY_;\n\n  public function __construct(?int $i = null, ?float $d = null)[] {\n    $this->_type = union1Enum::_EMPTY_;\n    if ($i !== null) {\n      $this->i = $i;\n      $this->_type = union1Enum::i;\n    }\n    if ($d !== null) {\n      $this->d = $d;\n      $this->_type = union1Enum::d;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'i'),\n      Shapes::idx($shape, 'd'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'union1';\n  }\n\n  public function getType()[]: union1Enum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case union1Enum::i:\n        $this->i = null;\n        break;\n      case union1Enum::d:\n        $this->d = null;\n        break;\n      case union1Enum::_EMPTY_:\n        break;\n    }\n    $this->_type = union1Enum::_EMPTY_;\n  }\n\n  public function set_i(int $i)[write_props]: this {\n    $this->reset();\n    $this->_type = union1Enum::i;\n    $this->i = $i;\n    return $this;\n  }\n\n  public function get_i()[]: ?int {\n    return $this->i;\n  }\n\n  public function getx_i()[]: int {\n    invariant(\n      $this->_type === union1Enum::i,\n      'get_i called on an instance of union1 whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->i as nonnull;\n  }\n\n  public function set_d(float $d)[write_props]: this {\n    $this->reset();\n    $this->_type = union1Enum::d;\n    $this->d = $d;\n    return $this;\n  }\n\n  public function get_d()[]: ?float {\n    return $this->d;\n  }\n\n  public function getx_d()[]: float {\n    invariant(\n      $this->_type === union1Enum::d,\n      'get_d called on an instance of union1 whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->d as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.union1\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"d\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nenum union2Enum: int {\n  _EMPTY_ = 0;\n  i = 1;\n  d = 2;\n  s = 3;\n  u = 4;\n}\n\n/**\n * Original thrift struct:-\n * union2\n */\nclass union2 implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<union2Enum> {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'i',\n      'union' => true,\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'd',\n      'union' => true,\n      'type' => \\TType::DOUBLE,\n    ),\n    3 => shape(\n      'var' => 's',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => struct1::class,\n    ),\n    4 => shape(\n      'var' => 'u',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => union1::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'i' => 1,\n    'd' => 2,\n    's' => 3,\n    'u' => 4,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'i' => ?int,\n    ?'d' => ?float,\n    ?'s' => ?struct1,\n    ?'u' => ?union1,\n  );\n\n  const int STRUCTURAL_ID = 1639711719709684790;\n  /**\n   * Original thrift field:-\n   * 1: i32 i\n   */\n  public ?int $i;\n  /**\n   * Original thrift field:-\n   * 2: double d\n   */\n  public ?float $d;\n  /**\n   * Original thrift field:-\n   * 3: module.struct1 s\n   */\n  public ?struct1 $s;\n  /**\n   * Original thrift field:-\n   * 4: module.union1 u\n   */\n  public ?union1 $u;\n  protected union2Enum $_type = union2Enum::_EMPTY_;\n\n  public function __construct(?int $i = null, ?float $d = null, ?struct1 $s = null, ?union1 $u = null)[] {\n    $this->_type = union2Enum::_EMPTY_;\n    if ($i !== null) {\n      $this->i = $i;\n      $this->_type = union2Enum::i;\n    }\n    if ($d !== null) {\n      $this->d = $d;\n      $this->_type = union2Enum::d;\n    }\n    if ($s !== null) {\n      $this->s = $s;\n      $this->_type = union2Enum::s;\n    }\n    if ($u !== null) {\n      $this->u = $u;\n      $this->_type = union2Enum::u;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'i'),\n      Shapes::idx($shape, 'd'),\n      Shapes::idx($shape, 's'),\n      Shapes::idx($shape, 'u'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'union2';\n  }\n\n  public function getType()[]: union2Enum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case union2Enum::i:\n        $this->i = null;\n        break;\n      case union2Enum::d:\n        $this->d = null;\n        break;\n      case union2Enum::s:\n        $this->s = null;\n        break;\n      case union2Enum::u:\n        $this->u = null;\n        break;\n      case union2Enum::_EMPTY_:\n        break;\n    }\n    $this->_type = union2Enum::_EMPTY_;\n  }\n\n  public function set_i(int $i)[write_props]: this {\n    $this->reset();\n    $this->_type = union2Enum::i;\n    $this->i = $i;\n    return $this;\n  }\n\n  public function get_i()[]: ?int {\n    return $this->i;\n  }\n\n  public function getx_i()[]: int {\n    invariant(\n      $this->_type === union2Enum::i,\n      'get_i called on an instance of union2 whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->i as nonnull;\n  }\n\n  public function set_d(float $d)[write_props]: this {\n    $this->reset();\n    $this->_type = union2Enum::d;\n    $this->d = $d;\n    return $this;\n  }\n\n  public function get_d()[]: ?float {\n    return $this->d;\n  }\n\n  public function getx_d()[]: float {\n    invariant(\n      $this->_type === union2Enum::d,\n      'get_d called on an instance of union2 whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->d as nonnull;\n  }\n\n  public function set_s(struct1 $s)[write_props]: this {\n    $this->reset();\n    $this->_type = union2Enum::s;\n    $this->s = $s;\n    return $this;\n  }\n\n  public function get_s()[]: ?struct1 {\n    return $this->s;\n  }\n\n  public function getx_s()[]: struct1 {\n    invariant(\n      $this->_type === union2Enum::s,\n      'get_s called on an instance of union2 whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->s as nonnull;\n  }\n\n  public function set_u(union1 $u)[write_props]: this {\n    $this->reset();\n    $this->_type = union2Enum::u;\n    $this->u = $u;\n    return $this;\n  }\n\n  public function get_u()[]: ?union1 {\n    return $this->u;\n  }\n\n  public function getx_u()[]: union1 {\n    invariant(\n      $this->_type === union2Enum::u,\n      'get_u called on an instance of union2 whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->u as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.union2\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"d\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.struct1\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"s\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.union1\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"u\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1443}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Detailed overview of service\n * \n * Original thrift service:-\n * C\n */\ninterface CAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Function doctext.\n   * \n   * Original thrift definition:-\n   * void\n   *   f();\n   */\n  public function f(): Awaitable<void>;\n\n  /**\n   * \n   * Original thrift definition:-\n   * string\n   *   thing(1: i32 a,\n   *         2: string b,\n   *         3: set<i32> c)\n   *   throws (1: Bang bang);\n   */\n  public function thing(int $a, string $b, Set<int> $c): Awaitable<string>;\n}\n\n/**\n * Detailed overview of service\n * \n * Original thrift service:-\n * C\n */\ninterface CIf extends \\IThriftSyncIf {\n  /**\n   * Function doctext.\n   * \n   * Original thrift definition:-\n   * void\n   *   f();\n   */\n  public function f(): void;\n\n  /**\n   * \n   * Original thrift definition:-\n   * string\n   *   thing(1: i32 a,\n   *         2: string b,\n   *         3: set<i32> c)\n   *   throws (1: Bang bang);\n   */\n  public function thing(int $a, string $b, Set<int> $c): string;\n}\n\n/**\n * Detailed overview of service\n * \n * Original thrift service:-\n * C\n */\ninterface CAsyncClientIf extends CAsyncIf {\n  /**\n   * Streaming function\n   * \n   * Original thrift definition:-\n   * void, stream<number>\n   *   numbers();\n   */\n  public function numbers(): Awaitable<\\ResponseAndClientStream<null, int>>;\n}\n\n/**\n * Detailed overview of service\n * \n * Original thrift service:-\n * C\n */\ninterface CClientIf extends \\IThriftSyncIf {\n  /**\n   * Function doctext.\n   * \n   * Original thrift definition:-\n   * void\n   *   f();\n   */\n  public function f(): Awaitable<void>;\n\n  /**\n   * \n   * Original thrift definition:-\n   * string\n   *   thing(1: i32 a,\n   *         2: string b,\n   *         3: set<i32> c)\n   *   throws (1: Bang bang);\n   */\n  public function thing(int $a, string $b, Set<int> $c): Awaitable<string>;\n\n  /**\n   * Streaming function\n   * \n   * Original thrift definition:-\n   * void, stream<number>\n   *   numbers();\n   */\n  public function numbers(): Awaitable<\\ResponseAndClientStream<null, int>>;\n}\n\n/**\n * Detailed overview of service\n * \n * Original thrift service:-\n * C\n */\ntrait CClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass CAsyncClient extends \\ThriftClientBase implements CAsyncClientIf {\n  use CClientBase;\n\n  /**\n   * Function doctext.\n   * \n   * Original thrift definition:-\n   * void\n   *   f();\n   */\n  public async function f(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = C_f_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"C\", \"f\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"f\", false);\n    await $this->genAwaitResponse(C_f_result::class, \"f\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * \n   * Original thrift definition:-\n   * string\n   *   thing(1: i32 a,\n   *         2: string b,\n   *         3: set<i32> c)\n   *   throws (1: Bang bang);\n   */\n  public async function thing(int $a, string $b, Set<int> $c): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = C_thing_args::fromShape(shape(\n      'a' => $a,\n      'b' => $b,\n      'c' => $c,\n    ));\n    await $this->asyncHandler_->genBefore(\"C\", \"thing\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"thing\", false);\n    return await $this->genAwaitResponse(C_thing_result::class, \"thing\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Streaming function\n   * \n   * Original thrift definition:-\n   * void, stream<number>\n   *   numbers();\n   */\n  public async function numbers(): Awaitable<\\ResponseAndClientStream<null, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = C_numbers_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"C\", \"numbers\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"numbers\", false);\n    return await $this->genAwaitStreamResponse(C_numbers_FirstResponse::class, C_numbers_StreamResponse::class, \"numbers\", true, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass CClient extends \\ThriftClientBase implements CClientIf {\n  use CClientBase;\n\n  /**\n   * Function doctext.\n   * \n   * Original thrift definition:-\n   * void\n   *   f();\n   */\n  public async function f(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = C_f_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"C\", \"f\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"f\", false);\n    await $this->genAwaitResponse(C_f_result::class, \"f\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * \n   * Original thrift definition:-\n   * string\n   *   thing(1: i32 a,\n   *         2: string b,\n   *         3: set<i32> c)\n   *   throws (1: Bang bang);\n   */\n  public async function thing(int $a, string $b, Set<int> $c): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = C_thing_args::fromShape(shape(\n      'a' => $a,\n      'b' => $b,\n      'c' => $c,\n    ));\n    await $this->asyncHandler_->genBefore(\"C\", \"thing\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"thing\", false);\n    return await $this->genAwaitResponse(C_thing_result::class, \"thing\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Streaming function\n   * \n   * Original thrift definition:-\n   * void, stream<number>\n   *   numbers();\n   */\n  public async function numbers(): Awaitable<\\ResponseAndClientStream<null, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = C_numbers_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"C\", \"numbers\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"numbers\", false);\n    return await $this->genAwaitStreamResponse(C_numbers_FirstResponse::class, C_numbers_StreamResponse::class, \"numbers\", true, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_f(): int {\n    $args = C_f_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"f\", false);\n  }\n  public function recv_f(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(C_f_result::class, \"f\", true, $expectedsequenceid);\n  }\n  public function send_thing(int $a, string $b, Set<int> $c): int {\n    $args = C_thing_args::fromShape(shape(\n      'a' => $a,\n      'b' => $b,\n      'c' => $c,\n    ));\n    return $this->sendImplHelper($args, \"thing\", false);\n  }\n  public function recv_thing(?int $expectedsequenceid = null): string {\n    return $this->recvImplHelper(C_thing_result::class, \"thing\", false, $expectedsequenceid);\n  }\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass C_f_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'C_f_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.f_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass C_f_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'C_f_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.C_f_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass C_thing_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'c',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n    'c' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?int,\n    ?'b' => ?string,\n    ?'c' => ?Set<int>,\n  );\n\n  const int STRUCTURAL_ID = 5152653522450717322;\n  public int $a;\n  public string $b;\n  public Set<int> $c;\n\n  public function __construct(?int $a = null, ?string $b = null, ?Set<int> $c = null)[] {\n    $this->a = $a ?? 0;\n    $this->b = $b ?? '';\n    $this->c = $c ?? Set {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n      Shapes::idx($shape, 'c'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'C_thing_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.thing_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"c\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass C_thing_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n    ),\n    1 => shape(\n      'var' => 'bang',\n      'type' => \\TType::STRUCT,\n      'class' => Bang::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n    'bang' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n    ?'bang' => ?Bang,\n  );\n\n  const int STRUCTURAL_ID = 8456199022957829086;\n  public ?this::TResult $success;\n  public ?Bang $bang;\n\n  public function __construct(?this::TResult $success = null, ?Bang $bang = null)[] {\n    $this->success = $success;\n    $this->bang = $bang;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n      Shapes::idx($shape, 'bang'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'C_thing_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.C_thing_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Bang\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"bang\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->bang !== null) {\n      return $this->bang;\n    }\n    return null;\n  }\n}\n\nclass C_numbers_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'C_numbers_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.numbers_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass C_numbers_StreamResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1815418233987567820;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'C_numbers_StreamResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.C_numbers_StreamResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.number\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass C_numbers_FirstResponse extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'C_numbers_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.C_numbers_FirstResponse\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass CStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.C\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"f\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"thing\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                      )\n                    ),\n                    \"name\" => \"a\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                      )\n                    ),\n                    \"name\" => \"b\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 3,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_set\" => tmeta_ThriftSetType::fromShape(\n                          shape(\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"c\",\n                  )\n                ),\n              ],\n              \"exceptions\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.Bang\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"bang\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"numbers\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_stream\" => tmeta_ThriftStreamType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.number\",\n                              \"underlyingType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n              'module.Bang' => Bang::getExceptionMetadata(),\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 997}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nclass module_CONSTANTS implements \\IThriftConstants {\n  /**\n   * Constant foo\n   * \n   * Original thrift constant:-\n   * string FOO\n   */\n  const string FOO = \"foo\";\n\n  /**\n   * Multi-\n   * line\n   * slash comment\n   * \n   * Original thrift constant:-\n   * i32 BAR\n   */\n  const int BAR = 123;\n\n  /**\n   * BIFF has your mail\n   * \n   * Original thrift constant:-\n   * i32 BIFF\n   */\n  const int BIFF = 0;\n\n  /**\n   * Original thrift constant:-\n   * i32 SHOUTY\n   */\n  const int SHOUTY = 11;\n\n\n  public static function getAllStructuredAnnotations()[write_props]: dict<string, dict<string, \\IThriftStruct>> {\n    return dict[\n    ];\n  }\n}\n\n", "num_lines": 49}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * This enum is great\n * \n * Original thrift enum:-\n * B\n */\nenum B: int {\n  /**\n   * EnumDef doctext.\n   */\n  HELLO = 0;\n}\n\nclass B_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.B\",\n        \"elements\" => dict[\n          0 => \"HELLO\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * DefinitionList doctext.\n *\n * Original thrift struct:-\n * A\n */\nclass A implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'useless_field',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'useless_field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'useless_field' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 4169556808001627706;\n  /**\n   * Field doctext.\n   * \n   * Original thrift field:-\n   * 1: i32 useless_field\n   */\n  public int $useless_field;\n\n  public function __construct(?int $useless_field = null)[] {\n    $this->useless_field = $useless_field ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'useless_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'A';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.A\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"useless_field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nenum UEnum: int {\n  _EMPTY_ = 0;\n  i = 1;\n  s = 2;\n}\n\n/**\n * Union U\n *\n * Original thrift struct:-\n * U\n */\nclass U implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<UEnum> {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'i',\n      'union' => true,\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 's',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'i' => 1,\n    's' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'i' => ?int,\n    ?'s' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 3963907419268179345;\n  /**\n   * i32 field i\n   * \n   * Original thrift field:-\n   * 1: i32 i\n   */\n  public ?int $i;\n  /**\n   * string s\n   * \n   * Original thrift field:-\n   * 2: string s\n   */\n  public ?string $s;\n  protected UEnum $_type = UEnum::_EMPTY_;\n\n  public function __construct(?int $i = null, ?string $s = null)[] {\n    $this->_type = UEnum::_EMPTY_;\n    if ($i !== null) {\n      $this->i = $i;\n      $this->_type = UEnum::i;\n    }\n    if ($s !== null) {\n      $this->s = $s;\n      $this->_type = UEnum::s;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'i'),\n      Shapes::idx($shape, 's'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'U';\n  }\n\n  public function getType()[]: UEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case UEnum::i:\n        $this->i = null;\n        break;\n      case UEnum::s:\n        $this->s = null;\n        break;\n      case UEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = UEnum::_EMPTY_;\n  }\n\n  public function set_i(int $i)[write_props]: this {\n    $this->reset();\n    $this->_type = UEnum::i;\n    $this->i = $i;\n    return $this;\n  }\n\n  public function get_i()[]: ?int {\n    return $this->i;\n  }\n\n  public function getx_i()[]: int {\n    invariant(\n      $this->_type === UEnum::i,\n      'get_i called on an instance of U whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->i as nonnull;\n  }\n\n  public function set_s(string $s)[write_props]: this {\n    $this->reset();\n    $this->_type = UEnum::s;\n    $this->s = $s;\n    return $this;\n  }\n\n  public function get_s()[]: ?string {\n    return $this->s;\n  }\n\n  public function getx_s()[]: string {\n    invariant(\n      $this->_type === UEnum::s,\n      'get_s called on an instance of U whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->s as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.U\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"s\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Something amiss\n *\n * Original thrift exception:-\n * Bang\n */\nclass Bang extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2427562471238739676;\n  /**\n   * All explosions can be explained away\n   * \n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Bang';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.Bang\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 410}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures\\enums;\n\n/**\n * Original thrift enum:-\n * Metasyntactic\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/enums/Metasyntactic'))>>\nenum Metasyntactic: int {\n  FOO = 1;\n  BAR = 2;\n  BAZ = 3;\n  BAX = 4;\n}\n\nclass Metasyntactic_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.Metasyntactic\",\n        \"elements\" => dict[\n          1 => \"FOO\",\n          2 => \"BAR\",\n          3 => \"BAZ\",\n          4 => \"BAX\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift enum:-\n * MyEnum1\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/enums/MyEnum1'))>>\nenum MyEnum1: int {\n  ME1_0 = 0;\n  ME1_1 = 1;\n  ME1_2 = 2;\n  ME1_3 = 3;\n  ME1_5 = 5;\n  ME1_6 = 6;\n}\n\nclass MyEnum1_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.MyEnum1\",\n        \"elements\" => dict[\n          0 => \"ME1_0\",\n          1 => \"ME1_1\",\n          2 => \"ME1_2\",\n          3 => \"ME1_3\",\n          5 => \"ME1_5\",\n          6 => \"ME1_6\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift enum:-\n * MyEnum2\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/enums/MyEnum2'))>>\nenum MyEnum2: int {\n  ME2_0 = 0;\n  ME2_1 = 1;\n  ME2_2 = 2;\n}\n\nclass MyEnum2_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.MyEnum2\",\n        \"elements\" => dict[\n          0 => \"ME2_0\",\n          1 => \"ME2_1\",\n          2 => \"ME2_2\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift enum:-\n * MyEnum3\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/enums/MyEnum3'))>>\nenum MyEnum3: int {\n  ME3_0 = 0;\n  ME3_1 = 1;\n  ME3_N2 = -2;\n  ME3_N1 = -1;\n  ME3_9 = 9;\n  ME3_10 = 10;\n}\n\nclass MyEnum3_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.MyEnum3\",\n        \"elements\" => dict[\n          0 => \"ME3_0\",\n          1 => \"ME3_1\",\n          -2 => \"ME3_N2\",\n          -1 => \"ME3_N1\",\n          9 => \"ME3_9\",\n          10 => \"ME3_10\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift enum:-\n * MyEnum4\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/enums/MyEnum4'))>>\nenum MyEnum4: int {\n  ME4_A = 2147483645;\n  ME4_B = 2147483646;\n  ME4_C = 2147483647;\n  ME4_D = -2147483648;\n}\n\nclass MyEnum4_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.MyEnum4\",\n        \"elements\" => dict[\n          2147483645 => \"ME4_A\",\n          2147483646 => \"ME4_B\",\n          2147483647 => \"ME4_C\",\n          -2147483648 => \"ME4_D\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift enum:-\n * MyBitmaskEnum1\n */\nfinal class MyBitmaskEnum1 extends \\Flags {\n  const int   ONE = 1;\n  const int   TWO = 2;\n  const int   FOUR = 4;\n}\n\nclass MyBitmaskEnum1_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.MyBitmaskEnum1\",\n        \"elements\" => dict[\n          1 => \"ONE\",\n          2 => \"TWO\",\n          4 => \"FOUR\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift enum:-\n * MyBitmaskEnum2\n */\nfinal class MyBitmaskEnum2 extends \\Flags {\n  const int   ONE = 1;\n  const int   TWO = 2;\n  const int   FOUR = 4;\n}\n\nclass MyBitmaskEnum2_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.MyBitmaskEnum2\",\n        \"elements\" => dict[\n          1 => \"ONE\",\n          2 => \"TWO\",\n          4 => \"FOUR\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[\n        '\\facebook\\thrift\\annotation\\BitmaskEnum' => \\facebook\\thrift\\annotation\\BitmaskEnum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * SomeStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/enums/SomeStruct'))>>\nclass SomeStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'reasonable',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\enums\\Metasyntactic::class,\n    ),\n    2 => shape(\n      'var' => 'fine',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\enums\\Metasyntactic::class,\n    ),\n    3 => shape(\n      'var' => 'questionable',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\enums\\Metasyntactic::class,\n    ),\n    4 => shape(\n      'var' => 'tags',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'reasonable' => 1,\n    'fine' => 2,\n    'questionable' => 3,\n    'tags' => 4,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'reasonable' => ?\\test\\fixtures\\enums\\Metasyntactic,\n    ?'fine' => ?\\test\\fixtures\\enums\\Metasyntactic,\n    ?'questionable' => ?\\test\\fixtures\\enums\\Metasyntactic,\n    ?'tags' => ?Set<int>,\n  );\n\n  const type TShape = shape(\n    ?'reasonable' => ?\\test\\fixtures\\enums\\Metasyntactic,\n    ?'fine' => ?\\test\\fixtures\\enums\\Metasyntactic,\n    ?'questionable' => ?\\test\\fixtures\\enums\\Metasyntactic,\n    'tags' => dict<int, bool>,\n    ...\n  );\n  const int STRUCTURAL_ID = 8159017183734005742;\n  /**\n   * Original thrift field:-\n   * 1: module.Metasyntactic reasonable\n   */\n  public ?\\test\\fixtures\\enums\\Metasyntactic $reasonable;\n  /**\n   * Original thrift field:-\n   * 2: module.Metasyntactic fine\n   */\n  public ?\\test\\fixtures\\enums\\Metasyntactic $fine;\n  /**\n   * Original thrift field:-\n   * 3: module.Metasyntactic questionable\n   */\n  public ?\\test\\fixtures\\enums\\Metasyntactic $questionable;\n  /**\n   * Original thrift field:-\n   * 4: set<i32> tags\n   */\n  public Set<int> $tags;\n\n  public function __construct(?\\test\\fixtures\\enums\\Metasyntactic $reasonable = null, ?\\test\\fixtures\\enums\\Metasyntactic $fine = null, ?\\test\\fixtures\\enums\\Metasyntactic $questionable = null, ?Set<int> $tags = null)[] {\n    $this->reasonable = $reasonable ?? \\test\\fixtures\\enums\\Metasyntactic::FOO;\n    $this->fine = $fine ?? \\test\\fixtures\\enums\\Metasyntactic::BAR;\n    $this->questionable = $questionable ?? \\test\\fixtures\\enums\\Metasyntactic::coerce(-1);\n    $this->tags = $tags ?? Set {\n    };\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reasonable'),\n      Shapes::idx($shape, 'fine'),\n      Shapes::idx($shape, 'questionable'),\n      Shapes::idx($shape, 'tags'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SomeStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SomeStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Metasyntactic\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"reasonable\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Metasyntactic\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"fine\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Metasyntactic\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"questionable\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"tags\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reasonable'),\n      Shapes::idx($shape, 'fine'),\n      Shapes::idx($shape, 'questionable'),\n      new Set(Keyset\\keys($shape['tags'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'reasonable' => $this->reasonable,\n      'fine' => $this->fine,\n      'questionable' => $this->questionable,\n      'tags' => ThriftUtil::toDArray(Dict\\fill_keys($this->tags->toValuesArray(), true), static::class),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'reasonable') !== null) {\n      $this->reasonable = \\test\\fixtures\\enums\\Metasyntactic::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\enums\\Metasyntactic>($parsed['reasonable']));\n    }\n    if (idx($parsed, 'fine') !== null) {\n      $this->fine = \\test\\fixtures\\enums\\Metasyntactic::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\enums\\Metasyntactic>($parsed['fine']));\n    }\n    if (idx($parsed, 'questionable') !== null) {\n      $this->questionable = \\test\\fixtures\\enums\\Metasyntactic::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\enums\\Metasyntactic>($parsed['questionable']));\n    }\n    if (idx($parsed, 'tags') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['tags']);\n      $_container4 = Set {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = 0;\n        $_tmp6 = (int)$_value2;\n        if ($_tmp6 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem5 = (int)$_tmp6;\n        }\n        $_container4->add($_elem5);\n      }\n      $this->tags = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/enums/MyStruct'))>>\nclass MyStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'me2_3',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\enums\\MyEnum2::class,\n    ),\n    2 => shape(\n      'var' => 'me3_n3',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\enums\\MyEnum3::class,\n    ),\n    4 => shape(\n      'var' => 'me1_t1',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\enums\\MyEnum1::class,\n    ),\n    6 => shape(\n      'var' => 'me1_t2',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\enums\\MyEnum1::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'me2_3' => 1,\n    'me3_n3' => 2,\n    'me1_t1' => 4,\n    'me1_t2' => 6,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'me2_3' => ?\\test\\fixtures\\enums\\MyEnum2,\n    ?'me3_n3' => ?\\test\\fixtures\\enums\\MyEnum3,\n    ?'me1_t1' => ?\\test\\fixtures\\enums\\MyEnum1,\n    ?'me1_t2' => ?\\test\\fixtures\\enums\\MyEnum1,\n  );\n\n  const type TShape = shape(\n    ?'me2_3' => ?\\test\\fixtures\\enums\\MyEnum2,\n    ?'me3_n3' => ?\\test\\fixtures\\enums\\MyEnum3,\n    ?'me1_t1' => ?\\test\\fixtures\\enums\\MyEnum1,\n    ?'me1_t2' => ?\\test\\fixtures\\enums\\MyEnum1,\n    ...\n  );\n  const int STRUCTURAL_ID = 8234221749727407461;\n  /**\n   * Original thrift field:-\n   * 1: module.MyEnum2 me2_3\n   */\n  public ?\\test\\fixtures\\enums\\MyEnum2 $me2_3;\n  /**\n   * Original thrift field:-\n   * 2: module.MyEnum3 me3_n3\n   */\n  public ?\\test\\fixtures\\enums\\MyEnum3 $me3_n3;\n  /**\n   * Original thrift field:-\n   * 4: module.MyEnum1 me1_t1\n   */\n  public ?\\test\\fixtures\\enums\\MyEnum1 $me1_t1;\n  /**\n   * Original thrift field:-\n   * 6: module.MyEnum1 me1_t2\n   */\n  public ?\\test\\fixtures\\enums\\MyEnum1 $me1_t2;\n\n  public function __construct(?\\test\\fixtures\\enums\\MyEnum2 $me2_3 = null, ?\\test\\fixtures\\enums\\MyEnum3 $me3_n3 = null, ?\\test\\fixtures\\enums\\MyEnum1 $me1_t1 = null, ?\\test\\fixtures\\enums\\MyEnum1 $me1_t2 = null)[] {\n    $this->me2_3 = $me2_3 ?? \\test\\fixtures\\enums\\MyEnum2::coerce(3);\n    $this->me3_n3 = $me3_n3 ?? \\test\\fixtures\\enums\\MyEnum3::coerce(-3);\n    $this->me1_t1 = $me1_t1 ?? \\test\\fixtures\\enums\\MyEnum1::ME1_1;\n    $this->me1_t2 = $me1_t2 ?? \\test\\fixtures\\enums\\MyEnum1::ME1_1;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'me2_3'),\n      Shapes::idx($shape, 'me3_n3'),\n      Shapes::idx($shape, 'me1_t1'),\n      Shapes::idx($shape, 'me1_t2'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum2\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"me2_3\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum3\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"me3_n3\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum1\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"me1_t1\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum1\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"me1_t2\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'me2_3'),\n      Shapes::idx($shape, 'me3_n3'),\n      Shapes::idx($shape, 'me1_t1'),\n      Shapes::idx($shape, 'me1_t2'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'me2_3' => $this->me2_3,\n      'me3_n3' => $this->me3_n3,\n      'me1_t1' => $this->me1_t1,\n      'me1_t2' => $this->me1_t2,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'me2_3') !== null) {\n      $this->me2_3 = \\test\\fixtures\\enums\\MyEnum2::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\enums\\MyEnum2>($parsed['me2_3']));\n    }\n    if (idx($parsed, 'me3_n3') !== null) {\n      $this->me3_n3 = \\test\\fixtures\\enums\\MyEnum3::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\enums\\MyEnum3>($parsed['me3_n3']));\n    }\n    if (idx($parsed, 'me1_t1') !== null) {\n      $this->me1_t1 = \\test\\fixtures\\enums\\MyEnum1::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\enums\\MyEnum1>($parsed['me1_t1']));\n    }\n    if (idx($parsed, 'me1_t2') !== null) {\n      $this->me1_t2 = \\test\\fixtures\\enums\\MyEnum1::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\enums\\MyEnum1>($parsed['me1_t2']));\n    }\n  }\n\n}\n\n", "num_lines": 735}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1606}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates a definition/feature may change in incompatible ways.\n *\n * Original thrift struct:-\n * Beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Beta'))>>\nclass Beta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used with permission, may\n * only work in specific contexts, and may change in incompatible ways without\n * notice.\n *\n * Original thrift struct:-\n * Experimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Experimental'))>>\nclass Experimental implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Experimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Experimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used in an ephemeral testing\n * enviornment.\n * \n * Such enviornments only store serialized values temporarly and strictly\n * control which versions of Thrift definitions are used, so 'compatibility'\n * is not a concern.\n *\n * Original thrift struct:-\n * Testing\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Testing'))>>\nclass Testing implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Testing';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Testing\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should no longer be used.\n *\n * Original thrift struct:-\n * Deprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Deprecated'))>>\nclass Deprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const type TShape = shape(\n    'message' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2427562471238739676;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Deprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Deprecated\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['message'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'message' => $this->message,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'message') !== null) {\n      $this->message = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['message']);\n    }\n  }\n\n}\n\n/**\n * Annotate a thrift structured or enum to indicate if ids or values should not\n * be used.\n * \n * For example, you may want to mark ids as deprecated, or these ids\n * might be reserved for other use cases or annotations.\n * \n * The resolved set of disallowed ids is the union of the values in `ids` and\n * the range of values represented in `id_ranges`. Example:\n * \n *  // These ids are not allowed: 3, 8, half-open ranges [10, 15), [20, 30)\n *  @thrift.ReserveIds{ids = [3, 8], id_ranges = {10: 15, 20: 30}}\n *  struct Foo {\n *    ...\n *    3: i64 f; // Build failure: 3 cannot be used\n *  }\n *\n * Original thrift struct:-\n * ReserveIds\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ReserveIds'))>>\nclass ReserveIds implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ids',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'id_ranges',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ids' => 1,\n    'id_ranges' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ids' => ?Vector<int>,\n    ?'id_ranges' => ?Map<int, int>,\n  );\n\n  const type TShape = shape(\n    'ids' => vec<int>,\n    'id_ranges' => dict<int, int>,\n    ...\n  );\n  const int STRUCTURAL_ID = 4105998268635615653;\n  /**\n   * Individual ids that cannot be used.\n   * \n   * Original thrift field:-\n   * 1: list<i32> ids\n   */\n  public Vector<int> $ids;\n  /**\n   * Represents ranges of ids that cannot be used.\n   * \n   * Each (key: value) pair represents the half-open range `[key, value)`,\n   * where `key` is included and `value` is not. For example, the map\n   * `{10: 15, 20: 30}` represents the union of id/value ranges `[10, 15)` and\n   * `[20, 30)`.\n   * \n   * Original thrift field:-\n   * 2: map<i32, i32> id_ranges\n   */\n  public Map<int, int> $id_ranges;\n\n  public function __construct(?Vector<int> $ids = null, ?Map<int, int> $id_ranges = null)[] {\n    $this->ids = $ids ?? Vector {};\n    $this->id_ranges = $id_ranges ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ids'),\n      Shapes::idx($shape, 'id_ranges'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ReserveIds';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ReserveIds\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ids\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"id_ranges\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['ids'] |> new Vector($$),\n      $shape['id_ranges'] |> new Map($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'ids' => vec($this->ids),\n      'id_ranges' => dict($this->id_ranges),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'ids') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['ids']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = 0;\n        $_tmp6 = (int)$_value2;\n        if ($_tmp6 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem5 = (int)$_tmp6;\n        }\n        $_container4 []= $_elem5;\n      }\n      $this->ids = $_container4;\n    }\n    if (idx($parsed, 'id_ranges') !== null) {\n      $_json10 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, int>>($parsed['id_ranges']);\n      $_container11 = Map {};\n      foreach($_json10 as $_key8 => $_value9) {\n        $_value12 = 0;\n        $_tmp13 = (int)$_value9;\n        if ($_tmp13 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value12 = (int)$_tmp13;\n        }\n        $_container11[$_key8] = $_value12;\n      }\n      $this->id_ranges = $_container11;\n    }\n  }\n\n}\n\n/**\n * Indicates additional backward compatibility restrictions, beyond the\n * standard Thrift required 'wire' compatibility.\n *\n * Original thrift struct:-\n * RequiresBackwardCompatibility\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RequiresBackwardCompatibility'))>>\nclass RequiresBackwardCompatibility implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field_name',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field_name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field_name' => ?bool,\n  );\n\n  const type TShape = shape(\n    'field_name' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 4755373036761315562;\n  /**\n   * Original thrift field:-\n   * 1: bool field_name\n   */\n  public bool $field_name;\n\n  public function __construct(?bool $field_name = null)[] {\n    $this->field_name = $field_name ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field_name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RequiresBackwardCompatibility';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.RequiresBackwardCompatibility\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"field_name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field_name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field_name' => $this->field_name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field_name') !== null) {\n      $this->field_name = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['field_name']);\n    }\n  }\n\n}\n\n/**\n * Disables testing features.\n *\n * Original thrift struct:-\n * NoTesting\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoTesting'))>>\nclass NoTesting implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoTesting';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoTesting\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables experimental features.\n *\n * Original thrift struct:-\n * NoExperimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoExperimental'))>>\nclass NoExperimental implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoExperimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoExperimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables @Beta features.\n *\n * Original thrift struct:-\n * NoBeta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoBeta'))>>\nclass NoBeta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoBeta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoBeta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoExperimental' => \\facebook\\thrift\\annotation\\NoExperimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature must not depend directly on an unreleased\n * or testing definition/feature.\n *\n * Original thrift struct:-\n * Released\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Released'))>>\nclass Released implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Released';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Released\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoBeta' => \\facebook\\thrift\\annotation\\NoBeta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\NoTesting' => \\facebook\\thrift\\annotation\\NoTesting::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables legacy features.\n *\n * Original thrift struct:-\n * NoLegacy\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoLegacy'))>>\nclass NoLegacy implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoLegacy';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoLegacy\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables @Deprecated features.\n * \n * Should only be enabled in `test` versions, as deprecated implies removing\n * the feature will break current usage (otherwise it would be legacy or\n * deleted).\n *\n * Original thrift struct:-\n * NoDeprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoDeprecated'))>>\nclass NoDeprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoDeprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoDeprecated\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoLegacy' => \\facebook\\thrift\\annotation\\NoLegacy::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that changes the field qualifier from 'none' to 'terse'.\n * A terse field is eligible to skip serialization, when it equals to the\n * intrinsic default value. It also clears to the intrinsic default value\n * before deserialization to distinguish between if a terse field was skipped\n * or missing during serialization. This is different from an unqualified\n * field, as an unqualified field is always serialized regardless of its value,\n * and it is not cleared before deserialization.\n * \n * The annotation can be only used to annotate an unqualified field, and when\n * it is annotating a struct or exception, it changes all unqualified fields to\n * terse fields. Note, the annotation can not be used for union.\n *\n * Original thrift struct:-\n * TerseWrite\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/TerseWrite'))>>\nclass TerseWrite implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TerseWrite';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.TerseWrite\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack.\n *\n * Original thrift struct:-\n * Box\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Box'))>>\nclass Box implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Box';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Box\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Mixin\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Mixin'))>>\nclass Mixin implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Mixin';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Mixin\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Option to serialize thrift struct in ascending field id order.\n * \n * This can potentially make serialized data size smaller in compact protocol,\n * since compact protocol can write deltas between subsequent field ids.\n *\n * Original thrift struct:-\n * SerializeInFieldIdOrder\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/SerializeInFieldIdOrder'))>>\nclass SerializeInFieldIdOrder implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SerializeInFieldIdOrder';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.SerializeInFieldIdOrder\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates an enum is a bitmask and should support bit-wise operators.\n *\n * Original thrift struct:-\n * BitmaskEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/BitmaskEnum'))>>\nclass BitmaskEnum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BitmaskEnum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.BitmaskEnum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all released v1 features.\n *\n * Original thrift struct:-\n * v1\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1'))>>\nclass v1 implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all beta v1 features.\n * \n * Beta features are guaranteed to *not* break unrelated Thrift features\n * so they should be relatively safe to test alongside other beta or\n * released Thrift features.\n *\n * Original thrift struct:-\n * v1beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1beta'))>>\nclass v1beta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1' => \\facebook\\thrift\\annotation\\v1::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all experimental v1 features.\n * \n * Use with *caution* and only with explicit permission. This may enable\n * features may change significantly without notice or not work correctly\n * in all contexts.\n *\n * Original thrift struct:-\n * v1alpha\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1alpha'))>>\nclass v1alpha implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1alpha';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1alpha\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1beta' => \\facebook\\thrift\\annotation\\v1beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\SerializeInFieldIdOrder' => \\facebook\\thrift\\annotation\\SerializeInFieldIdOrder::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables experimental features, even those that are known to break common\n * use cases.\n *\n * Original thrift struct:-\n * v1test\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1test'))>>\nclass v1test implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1test';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1test\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoDeprecated' => \\facebook\\thrift\\annotation\\NoDeprecated::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\v1alpha' => \\facebook\\thrift\\annotation\\v1alpha::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Testing' => \\facebook\\thrift\\annotation\\Testing::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Specifies the field where the exception message is stored. The field\n * is used to generate an additional method to get it.\n *\n * Original thrift struct:-\n * ExceptionMessage\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ExceptionMessage'))>>\nclass ExceptionMessage implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?string,\n  );\n\n  const type TShape = shape(\n    'field' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 6158382972310209096;\n  /**\n   * Original thrift field:-\n   * 1: string field\n   */\n  public string $field;\n\n  public function __construct(?string $field = null)[] {\n    $this->field = $field ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ExceptionMessage';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ExceptionMessage\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field' => $this->field,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $this->field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['field']);\n    }\n  }\n\n}\n\n/**\n * Generates a const of type schema. Struct containing the schema of the\n * annotated type. Optionally specify name to override default\n * schema<structName>.\n *\n * Original thrift struct:-\n * GenerateRuntimeSchema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/GenerateRuntimeSchema'))>>\nclass GenerateRuntimeSchema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'GenerateRuntimeSchema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.GenerateRuntimeSchema\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack, and that\n * identical values can be shared in immutable contexts.\n *\n * Original thrift struct:-\n * InternBox\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/InternBox'))>>\nclass InternBox implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'InternBox';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.InternBox\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 2588}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift exception:-\n * Fiery\n */\nclass Fiery extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 1438368398389181198;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Fiery';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.Fiery\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * Serious\n */\nclass Serious extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'sonnet',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'sonnet' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'sonnet' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 7572301088987666687;\n  /**\n   * Original thrift field:-\n   * 1: string sonnet\n   */\n  public ?string $sonnet;\n\n  public function __construct(?string $sonnet = null)[] {\n    parent::__construct();\n    $this->sonnet = $sonnet;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'sonnet'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Serious';\n  }\n\n  <<__Override>>\n  public function getMessage()[]: string {\n    return $this->sonnet ?? '';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.Serious\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"sonnet\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * ComplexFieldNames\n */\nclass ComplexFieldNames extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'error_message',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'internal_error_message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'error_message' => 1,\n    'internal_error_message' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'error_message' => ?string,\n    ?'internal_error_message' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 4419960994551853385;\n  /**\n   * Original thrift field:-\n   * 1: string error_message\n   */\n  public string $error_message;\n  /**\n   * Original thrift field:-\n   * 2: string internal_error_message\n   */\n  public string $internal_error_message;\n\n  public function __construct(?string $error_message = null, ?string $internal_error_message = null)[] {\n    parent::__construct();\n    $this->error_message = $error_message ?? '';\n    $this->internal_error_message = $internal_error_message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'error_message'),\n      Shapes::idx($shape, 'internal_error_message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ComplexFieldNames';\n  }\n\n  <<__Override>>\n  public function getMessage()[]: string {\n    return $this->internal_error_message ?? '';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.ComplexFieldNames\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"error_message\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"internal_error_message\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * CustomFieldNames\n */\nclass CustomFieldNames extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'error_message',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'internal_error_message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'error_message' => 1,\n    'internal_error_message' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'error_message' => ?string,\n    ?'internal_error_message' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 4419960994551853385;\n  /**\n   * Original thrift field:-\n   * 1: string error_message\n   */\n  public string $error_message;\n  /**\n   * Original thrift field:-\n   * 2: string internal_error_message\n   */\n  public string $internal_error_message;\n\n  public function __construct(?string $error_message = null, ?string $internal_error_message = null)[] {\n    parent::__construct();\n    $this->error_message = $error_message ?? '';\n    $this->internal_error_message = $internal_error_message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'error_message'),\n      Shapes::idx($shape, 'internal_error_message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'CustomFieldNames';\n  }\n\n  <<__Override>>\n  public function getMessage()[]: string {\n    return $this->internal_error_message ?? '';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.CustomFieldNames\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"error_message\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"internal_error_message\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * ExceptionWithPrimitiveField\n */\nclass ExceptionWithPrimitiveField extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'error_code',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n    'error_code' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n    ?'error_code' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 2746197671326593349;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n  /**\n   * Original thrift field:-\n   * 2: i32 error_code\n   */\n  public int $error_code;\n\n  public function __construct(?string $message = null, ?int $error_code = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n    $this->error_code = $error_code ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n      Shapes::idx($shape, 'error_code'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ExceptionWithPrimitiveField';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.ExceptionWithPrimitiveField\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"error_code\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * ExceptionWithStructuredAnnotation\n */\nclass ExceptionWithStructuredAnnotation extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message_field',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'error_code',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message_field' => 1,\n    'error_code' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message_field' => ?string,\n    ?'error_code' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 267833845416100769;\n  /**\n   * Original thrift field:-\n   * 1: string message_field\n   */\n  public string $message_field;\n  /**\n   * Original thrift field:-\n   * 2: i32 error_code\n   */\n  public int $error_code;\n\n  public function __construct(?string $message_field = null, ?int $error_code = null)[] {\n    parent::__construct();\n    $this->message_field = $message_field ?? '';\n    $this->error_code = $error_code ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message_field'),\n      Shapes::idx($shape, 'error_code'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ExceptionWithStructuredAnnotation';\n  }\n\n  <<__Override>>\n  public function getMessage()[]: string {\n    return $this->message_field ?? '';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.ExceptionWithStructuredAnnotation\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"error_code\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\ExceptionMessage' => \\facebook\\thrift\\annotation\\ExceptionMessage::fromShape(\n          shape(\n            \"field\" => \"message_field\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * Banal\n */\nclass Banal extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n    parent::__construct();\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Banal';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.Banal\",\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 701}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * Raiser\n */\ninterface RaiserAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   doBland();\n   */\n  public function doBland(): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   doRaise()\n   *   throws (1: Banal b,\n   *           2: Fiery f,\n   *           3: Serious s);\n   */\n  public function doRaise(): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   get200();\n   */\n  public function get200(): Awaitable<string>;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   get500()\n   *   throws (1: Fiery f,\n   *           2: Banal b,\n   *           3: Serious s);\n   */\n  public function get500(): Awaitable<string>;\n}\n\n/**\n * Original thrift service:-\n * Raiser\n */\ninterface RaiserIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   doBland();\n   */\n  public function doBland(): void;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   doRaise()\n   *   throws (1: Banal b,\n   *           2: Fiery f,\n   *           3: Serious s);\n   */\n  public function doRaise(): void;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   get200();\n   */\n  public function get200(): string;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   get500()\n   *   throws (1: Fiery f,\n   *           2: Banal b,\n   *           3: Serious s);\n   */\n  public function get500(): string;\n}\n\n/**\n * Original thrift service:-\n * Raiser\n */\ninterface RaiserAsyncClientIf extends RaiserAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * Raiser\n */\ninterface RaiserClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   doBland();\n   */\n  public function doBland(): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   doRaise()\n   *   throws (1: Banal b,\n   *           2: Fiery f,\n   *           3: Serious s);\n   */\n  public function doRaise(): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   get200();\n   */\n  public function get200(): Awaitable<string>;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   get500()\n   *   throws (1: Fiery f,\n   *           2: Banal b,\n   *           3: Serious s);\n   */\n  public function get500(): Awaitable<string>;\n}\n\n/**\n * Original thrift service:-\n * Raiser\n */\ntrait RaiserClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass RaiserAsyncClient extends \\ThriftClientBase implements RaiserAsyncClientIf {\n  use RaiserClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   doBland();\n   */\n  public async function doBland(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Raiser_doBland_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"Raiser\", \"doBland\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"doBland\", false);\n    await $this->genAwaitResponse(Raiser_doBland_result::class, \"doBland\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   doRaise()\n   *   throws (1: Banal b,\n   *           2: Fiery f,\n   *           3: Serious s);\n   */\n  public async function doRaise(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Raiser_doRaise_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"Raiser\", \"doRaise\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"doRaise\", false);\n    await $this->genAwaitResponse(Raiser_doRaise_result::class, \"doRaise\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   get200();\n   */\n  public async function get200(): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Raiser_get200_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"Raiser\", \"get200\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"get200\", false);\n    return await $this->genAwaitResponse(Raiser_get200_result::class, \"get200\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   get500()\n   *   throws (1: Fiery f,\n   *           2: Banal b,\n   *           3: Serious s);\n   */\n  public async function get500(): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Raiser_get500_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"Raiser\", \"get500\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"get500\", false);\n    return await $this->genAwaitResponse(Raiser_get500_result::class, \"get500\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass RaiserClient extends \\ThriftClientBase implements RaiserClientIf {\n  use RaiserClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   doBland();\n   */\n  public async function doBland(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Raiser_doBland_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"Raiser\", \"doBland\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"doBland\", false);\n    await $this->genAwaitResponse(Raiser_doBland_result::class, \"doBland\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   doRaise()\n   *   throws (1: Banal b,\n   *           2: Fiery f,\n   *           3: Serious s);\n   */\n  public async function doRaise(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Raiser_doRaise_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"Raiser\", \"doRaise\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"doRaise\", false);\n    await $this->genAwaitResponse(Raiser_doRaise_result::class, \"doRaise\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   get200();\n   */\n  public async function get200(): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Raiser_get200_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"Raiser\", \"get200\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"get200\", false);\n    return await $this->genAwaitResponse(Raiser_get200_result::class, \"get200\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   get500()\n   *   throws (1: Fiery f,\n   *           2: Banal b,\n   *           3: Serious s);\n   */\n  public async function get500(): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Raiser_get500_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"Raiser\", \"get500\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"get500\", false);\n    return await $this->genAwaitResponse(Raiser_get500_result::class, \"get500\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_doBland(): int {\n    $args = Raiser_doBland_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"doBland\", false);\n  }\n  public function recv_doBland(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(Raiser_doBland_result::class, \"doBland\", true, $expectedsequenceid);\n  }\n  public function send_doRaise(): int {\n    $args = Raiser_doRaise_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"doRaise\", false);\n  }\n  public function recv_doRaise(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(Raiser_doRaise_result::class, \"doRaise\", true, $expectedsequenceid);\n  }\n  public function send_get200(): int {\n    $args = Raiser_get200_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"get200\", false);\n  }\n  public function recv_get200(?int $expectedsequenceid = null): string {\n    return $this->recvImplHelper(Raiser_get200_result::class, \"get200\", false, $expectedsequenceid);\n  }\n  public function send_get500(): int {\n    $args = Raiser_get500_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"get500\", false);\n  }\n  public function recv_get500(?int $expectedsequenceid = null): string {\n    return $this->recvImplHelper(Raiser_get500_result::class, \"get500\", false, $expectedsequenceid);\n  }\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass Raiser_doBland_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Raiser_doBland_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.doBland_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass Raiser_doBland_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Raiser_doBland_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Raiser_doBland_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass Raiser_doRaise_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Raiser_doRaise_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.doRaise_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass Raiser_doRaise_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'b',\n      'type' => \\TType::STRUCT,\n      'class' => Banal::class,\n    ),\n    2 => shape(\n      'var' => 'f',\n      'type' => \\TType::STRUCT,\n      'class' => Fiery::class,\n    ),\n    3 => shape(\n      'var' => 's',\n      'type' => \\TType::STRUCT,\n      'class' => Serious::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'b' => 1,\n    'f' => 2,\n    's' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'b' => ?Banal,\n    ?'f' => ?Fiery,\n    ?'s' => ?Serious,\n  );\n\n  const int STRUCTURAL_ID = 1991614683033939916;\n  public ?Banal $b;\n  public ?Fiery $f;\n  public ?Serious $s;\n\n  public function __construct(?Banal $b = null, ?Fiery $f = null, ?Serious $s = null)[] {\n    $this->b = $b;\n    $this->f = $f;\n    $this->s = $s;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'b'),\n      Shapes::idx($shape, 'f'),\n      Shapes::idx($shape, 's'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Raiser_doRaise_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Raiser_doRaise_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.Banal\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.Banal\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Fiery\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"f\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Serious\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"s\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->b !== null) {\n      return $this->b;\n    }\n    if ($this->f !== null) {\n      return $this->f;\n    }\n    if ($this->s !== null) {\n      return $this->s;\n    }\n    return null;\n  }\n}\n\nclass Raiser_get200_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Raiser_get200_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.get200_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass Raiser_get200_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Raiser_get200_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Raiser_get200_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass Raiser_get500_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Raiser_get500_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.get500_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass Raiser_get500_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n    ),\n    1 => shape(\n      'var' => 'f',\n      'type' => \\TType::STRUCT,\n      'class' => Fiery::class,\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::STRUCT,\n      'class' => Banal::class,\n    ),\n    3 => shape(\n      'var' => 's',\n      'type' => \\TType::STRUCT,\n      'class' => Serious::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n    'f' => 1,\n    'b' => 2,\n    's' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n    ?'f' => ?Fiery,\n    ?'b' => ?Banal,\n    ?'s' => ?Serious,\n  );\n\n  const int STRUCTURAL_ID = 6147773747560615508;\n  public ?this::TResult $success;\n  public ?Fiery $f;\n  public ?Banal $b;\n  public ?Serious $s;\n\n  public function __construct(?this::TResult $success = null, ?Fiery $f = null, ?Banal $b = null, ?Serious $s = null)[] {\n    $this->success = $success;\n    $this->f = $f;\n    $this->b = $b;\n    $this->s = $s;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n      Shapes::idx($shape, 'f'),\n      Shapes::idx($shape, 'b'),\n      Shapes::idx($shape, 's'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Raiser_get500_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Raiser_get500_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Fiery\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"f\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.Banal\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.Banal\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Serious\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"s\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->f !== null) {\n      return $this->f;\n    }\n    if ($this->b !== null) {\n      return $this->b;\n    }\n    if ($this->s !== null) {\n      return $this->s;\n    }\n    return null;\n  }\n}\n\nclass RaiserStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.Raiser\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"doBland\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"doRaise\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n              \"exceptions\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                          shape(\n                            \"name\" => \"module.Banal\",\n                            \"underlyingType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                  shape(\n                                    \"name\" => \"module.Banal\",\n                                  )\n                                ),\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"b\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.Fiery\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"f\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 3,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.Serious\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"s\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"get200\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"get500\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"exceptions\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.Fiery\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"f\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                          shape(\n                            \"name\" => \"module.Banal\",\n                            \"underlyingType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                  shape(\n                                    \"name\" => \"module.Banal\",\n                                  )\n                                ),\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"b\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 3,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.Serious\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"s\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n              'module.Banal' => Banal::getExceptionMetadata(),\n              'module.Fiery' => Fiery::getExceptionMetadata(),\n              'module.Serious' => Serious::getExceptionMetadata(),\n              'module.Banal' => Banal::getExceptionMetadata(),\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 1221}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1228}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates a definition/feature may change in incompatible ways.\n *\n * Original thrift struct:-\n * Beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Beta'))>>\nclass Beta implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used with permission, may\n * only work in specific contexts, and may change in incompatible ways without\n * notice.\n *\n * Original thrift struct:-\n * Experimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Experimental'))>>\nclass Experimental implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Experimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Experimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used in an ephemeral testing\n * enviornment.\n * \n * Such enviornments only store serialized values temporarly and strictly\n * control which versions of Thrift definitions are used, so 'compatibility'\n * is not a concern.\n *\n * Original thrift struct:-\n * Testing\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Testing'))>>\nclass Testing implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Testing';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Testing\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates a definition/feature should no longer be used.\n *\n * Original thrift struct:-\n * Deprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Deprecated'))>>\nclass Deprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2427562471238739676;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Deprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Deprecated\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Annotate a thrift structured or enum to indicate if ids or values should not\n * be used.\n * \n * For example, you may want to mark ids as deprecated, or these ids\n * might be reserved for other use cases or annotations.\n * \n * The resolved set of disallowed ids is the union of the values in `ids` and\n * the range of values represented in `id_ranges`. Example:\n * \n *  // These ids are not allowed: 3, 8, half-open ranges [10, 15), [20, 30)\n *  @thrift.ReserveIds{ids = [3, 8], id_ranges = {10: 15, 20: 30}}\n *  struct Foo {\n *    ...\n *    3: i64 f; // Build failure: 3 cannot be used\n *  }\n *\n * Original thrift struct:-\n * ReserveIds\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ReserveIds'))>>\nclass ReserveIds implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ids',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'id_ranges',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ids' => 1,\n    'id_ranges' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ids' => ?Vector<int>,\n    ?'id_ranges' => ?Map<int, int>,\n  );\n\n  const int STRUCTURAL_ID = 4105998268635615653;\n  /**\n   * Individual ids that cannot be used.\n   * \n   * Original thrift field:-\n   * 1: list<i32> ids\n   */\n  public Vector<int> $ids;\n  /**\n   * Represents ranges of ids that cannot be used.\n   * \n   * Each (key: value) pair represents the half-open range `[key, value)`,\n   * where `key` is included and `value` is not. For example, the map\n   * `{10: 15, 20: 30}` represents the union of id/value ranges `[10, 15)` and\n   * `[20, 30)`.\n   * \n   * Original thrift field:-\n   * 2: map<i32, i32> id_ranges\n   */\n  public Map<int, int> $id_ranges;\n\n  public function __construct(?Vector<int> $ids = null, ?Map<int, int> $id_ranges = null)[] {\n    $this->ids = $ids ?? Vector {};\n    $this->id_ranges = $id_ranges ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ids'),\n      Shapes::idx($shape, 'id_ranges'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ReserveIds';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ReserveIds\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ids\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"id_ranges\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates additional backward compatibility restrictions, beyond the\n * standard Thrift required 'wire' compatibility.\n *\n * Original thrift struct:-\n * RequiresBackwardCompatibility\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RequiresBackwardCompatibility'))>>\nclass RequiresBackwardCompatibility implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field_name',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field_name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field_name' => ?bool,\n  );\n\n  const int STRUCTURAL_ID = 4755373036761315562;\n  /**\n   * Original thrift field:-\n   * 1: bool field_name\n   */\n  public bool $field_name;\n\n  public function __construct(?bool $field_name = null)[] {\n    $this->field_name = $field_name ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field_name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RequiresBackwardCompatibility';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.RequiresBackwardCompatibility\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"field_name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Disables testing features.\n *\n * Original thrift struct:-\n * NoTesting\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoTesting'))>>\nclass NoTesting implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoTesting';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoTesting\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Disables experimental features.\n *\n * Original thrift struct:-\n * NoExperimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoExperimental'))>>\nclass NoExperimental implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoExperimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoExperimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Disables @Beta features.\n *\n * Original thrift struct:-\n * NoBeta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoBeta'))>>\nclass NoBeta implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoBeta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoBeta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoExperimental' => \\facebook\\thrift\\annotation\\NoExperimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates a definition/feature must not depend directly on an unreleased\n * or testing definition/feature.\n *\n * Original thrift struct:-\n * Released\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Released'))>>\nclass Released implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Released';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Released\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoBeta' => \\facebook\\thrift\\annotation\\NoBeta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\NoTesting' => \\facebook\\thrift\\annotation\\NoTesting::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Disables legacy features.\n *\n * Original thrift struct:-\n * NoLegacy\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoLegacy'))>>\nclass NoLegacy implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoLegacy';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoLegacy\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Disables @Deprecated features.\n * \n * Should only be enabled in `test` versions, as deprecated implies removing\n * the feature will break current usage (otherwise it would be legacy or\n * deleted).\n *\n * Original thrift struct:-\n * NoDeprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoDeprecated'))>>\nclass NoDeprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoDeprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoDeprecated\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoLegacy' => \\facebook\\thrift\\annotation\\NoLegacy::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * An annotation that changes the field qualifier from 'none' to 'terse'.\n * A terse field is eligible to skip serialization, when it equals to the\n * intrinsic default value. It also clears to the intrinsic default value\n * before deserialization to distinguish between if a terse field was skipped\n * or missing during serialization. This is different from an unqualified\n * field, as an unqualified field is always serialized regardless of its value,\n * and it is not cleared before deserialization.\n * \n * The annotation can be only used to annotate an unqualified field, and when\n * it is annotating a struct or exception, it changes all unqualified fields to\n * terse fields. Note, the annotation can not be used for union.\n *\n * Original thrift struct:-\n * TerseWrite\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/TerseWrite'))>>\nclass TerseWrite implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TerseWrite';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.TerseWrite\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack.\n *\n * Original thrift struct:-\n * Box\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Box'))>>\nclass Box implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Box';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Box\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Mixin\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Mixin'))>>\nclass Mixin implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Mixin';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Mixin\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Option to serialize thrift struct in ascending field id order.\n * \n * This can potentially make serialized data size smaller in compact protocol,\n * since compact protocol can write deltas between subsequent field ids.\n *\n * Original thrift struct:-\n * SerializeInFieldIdOrder\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/SerializeInFieldIdOrder'))>>\nclass SerializeInFieldIdOrder implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SerializeInFieldIdOrder';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.SerializeInFieldIdOrder\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates an enum is a bitmask and should support bit-wise operators.\n *\n * Original thrift struct:-\n * BitmaskEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/BitmaskEnum'))>>\nclass BitmaskEnum implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BitmaskEnum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.BitmaskEnum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Enables all released v1 features.\n *\n * Original thrift struct:-\n * v1\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1'))>>\nclass v1 implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Enables all beta v1 features.\n * \n * Beta features are guaranteed to *not* break unrelated Thrift features\n * so they should be relatively safe to test alongside other beta or\n * released Thrift features.\n *\n * Original thrift struct:-\n * v1beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1beta'))>>\nclass v1beta implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1' => \\facebook\\thrift\\annotation\\v1::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Enables all experimental v1 features.\n * \n * Use with *caution* and only with explicit permission. This may enable\n * features may change significantly without notice or not work correctly\n * in all contexts.\n *\n * Original thrift struct:-\n * v1alpha\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1alpha'))>>\nclass v1alpha implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1alpha';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1alpha\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1beta' => \\facebook\\thrift\\annotation\\v1beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\SerializeInFieldIdOrder' => \\facebook\\thrift\\annotation\\SerializeInFieldIdOrder::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Enables experimental features, even those that are known to break common\n * use cases.\n *\n * Original thrift struct:-\n * v1test\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1test'))>>\nclass v1test implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1test';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1test\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoDeprecated' => \\facebook\\thrift\\annotation\\NoDeprecated::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\v1alpha' => \\facebook\\thrift\\annotation\\v1alpha::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Testing' => \\facebook\\thrift\\annotation\\Testing::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Specifies the field where the exception message is stored. The field\n * is used to generate an additional method to get it.\n *\n * Original thrift struct:-\n * ExceptionMessage\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ExceptionMessage'))>>\nclass ExceptionMessage implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 6158382972310209096;\n  /**\n   * Original thrift field:-\n   * 1: string field\n   */\n  public string $field;\n\n  public function __construct(?string $field = null)[] {\n    $this->field = $field ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ExceptionMessage';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ExceptionMessage\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Generates a const of type schema. Struct containing the schema of the\n * annotated type. Optionally specify name to override default\n * schema<structName>.\n *\n * Original thrift struct:-\n * GenerateRuntimeSchema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/GenerateRuntimeSchema'))>>\nclass GenerateRuntimeSchema implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'GenerateRuntimeSchema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.GenerateRuntimeSchema\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack, and that\n * identical values can be shared in immutable contexts.\n *\n * Original thrift struct:-\n * InternBox\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/InternBox'))>>\nclass InternBox implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'InternBox';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.InternBox\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 2024}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public function baz(Set<int> $a, KeyedContainer<int, KeyedContainer<int, Set<string>>> $b, int $c, ?Foo $d, int $e): Awaitable<string>;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public function baz(Set<int> $a, KeyedContainer<int, KeyedContainer<int, Set<string>>> $b, int $c, ?Foo $d, int $e): string;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarAsyncClientIf extends BarAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public function baz(Set<int> $a, KeyedContainer<int, KeyedContainer<int, Set<string>>> $b, int $c, ?Foo $d, int $e): Awaitable<string>;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ntrait BarClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass BarAsyncClient extends \\ThriftClientBase implements BarAsyncClientIf {\n  use BarClientBase;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public async function baz(Set<int> $a, KeyedContainer<int, KeyedContainer<int, Set<string>>> $b, int $c, ?Foo $d, int $e): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => (new Vector($b))->map(\n        $_val0 ==> new Map($_val0)\n      ),\n      'c' => $c,\n      'd' => $d,\n      'e' => $e,\n    ));\n    await $this->asyncHandler_->genBefore(\"Bar\", \"baz\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"baz\", false);\n    return await $this->genAwaitResponse(Bar_baz_result::class, \"baz\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass BarClient extends \\ThriftClientBase implements BarClientIf {\n  use BarClientBase;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public async function baz(Set<int> $a, KeyedContainer<int, KeyedContainer<int, Set<string>>> $b, int $c, ?Foo $d, int $e): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => (new Vector($b))->map(\n        $_val0 ==> new Map($_val0)\n      ),\n      'c' => $c,\n      'd' => $d,\n      'e' => $e,\n    ));\n    await $this->asyncHandler_->genBefore(\"Bar\", \"baz\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"baz\", false);\n    return await $this->genAwaitResponse(Bar_baz_result::class, \"baz\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_baz(Set<int> $a, KeyedContainer<int, KeyedContainer<int, Set<string>>> $b, int $c, ?Foo $d, int $e): int {\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => (new Vector($b))->map(\n        $_val0 ==> new Map($_val0)\n      ),\n      'c' => $c,\n      'd' => $d,\n      'e' => $e,\n    ));\n    return $this->sendImplHelper($args, \"baz\", false);\n  }\n  public function recv_baz(?int $expectedsequenceid = null): string {\n    return $this->recvImplHelper(Bar_baz_result::class, \"baz\", false, $expectedsequenceid);\n  }\n}\n\nabstract class BarAsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as BarAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = BarStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'Bar';\n\n  protected async function process_baz(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('baz');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'baz', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'Bar_baz_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'Bar_baz_args');\n    } else {\n      $args = Bar_baz_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'baz', $args);\n    $result = Bar_baz_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'Bar', 'baz', $args);\n      $result->success = await $this->handler->baz($args->a, $args->b, $args->c, $args->d, $args->e);\n      $this->eventHandler_->postExec($handler_ctx, 'baz', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'baz', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'baz', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'baz', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'baz', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"baz\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'baz', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = BarStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass BarAsyncProcessor extends BarAsyncProcessorBase {\n  const type TThriftIf = BarAsyncIf;\n}\n\nabstract class BarSyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as BarIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = BarStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'Bar';\n\n  protected function process_baz(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('baz');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'baz', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'Bar_baz_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'Bar_baz_args');\n    } else {\n      $args = Bar_baz_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'baz', $args);\n    $result = Bar_baz_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'Bar', 'baz', $args);\n      $result->success = $this->handler->baz($args->a, $args->b, $args->c, $args->d, $args->e);\n      $this->eventHandler_->postExec($handler_ctx, 'baz', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'baz', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'baz', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'baz', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'baz', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"baz\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'baz', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = BarStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass BarSyncProcessor extends BarSyncProcessorBase {\n  const type TThriftIf = BarIf;\n}\n// For backwards compatibility\nclass BarProcessor extends BarSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass Bar_baz_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::I32,\n        'vtype' => \\TType::SET,\n        'key' => shape(\n          'type' => \\TType::I32,\n        ),\n        'val' => shape(\n          'type' => \\TType::SET,\n          'etype' => \\TType::STRING,\n          'elem' => shape(\n            'type' => \\TType::STRING,\n          ),\n          'format' => 'collection',\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'c',\n      'type' => \\TType::I64,\n    ),\n    4 => shape(\n      'var' => 'd',\n      'type' => \\TType::STRUCT,\n      'class' => Foo::class,\n    ),\n    5 => shape(\n      'var' => 'e',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n    'c' => 3,\n    'd' => 4,\n    'e' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?Set<int>,\n    ?'b' => ?Vector<Map<int, Set<string>>>,\n    ?'c' => ?int,\n    ?'d' => ?Foo,\n    ?'e' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 7865027497865509792;\n  public Set<int> $a;\n  public Vector<Map<int, Set<string>>> $b;\n  public int $c;\n  public ?Foo $d;\n  public int $e;\n\n  public function __construct(?Set<int> $a = null, ?Vector<Map<int, Set<string>>> $b = null, ?int $c = null, ?Foo $d = null, ?int $e = null)[] {\n    $this->a = $a ?? Set {};\n    $this->b = $b ?? Vector {};\n    $this->c = $c ?? 0;\n    $this->d = $d;\n    $this->e = $e ?? 4;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n      Shapes::idx($shape, 'c'),\n      Shapes::idx($shape, 'd'),\n      Shapes::idx($shape, 'e'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>(idx($map, 'a'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, Vector<Map<int, Set<string>>>>(idx($map, 'b'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, int>(idx($map, 'c'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, Foo>(idx($map, 'd'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, int>(idx($map, 'e'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Bar_baz_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.baz_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"c\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"d\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"e\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass Bar_baz_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'success'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Bar_baz_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Bar_baz_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass BarStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.Bar\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"baz\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_set\" => tmeta_ThriftSetType::fromShape(\n                          shape(\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"a\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_list\" => tmeta_ThriftListType::fromShape(\n                          shape(\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_map\" => tmeta_ThriftMapType::fromShape(\n                                  shape(\n                                    \"keyType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                      )\n                                    ),\n                                    \"valueType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                          shape(\n                                            \"valueType\" => tmeta_ThriftType::fromShape(\n                                              shape(\n                                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                              )\n                                            ),\n                                          )\n                                        ),\n                                      )\n                                    ),\n                                  )\n                                ),\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"b\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 3,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"c\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 4,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.Foo\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"d\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 5,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"e\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n              'module.Foo' => Foo::getStructMetadata(),\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 818}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift enum:-\n * TestEnum\n */\nenum TestEnum: int {\n  UNKNOWN = 0;\n  VALUE1 = 1;\n  VALUE2 = 2;\n}\n\nclass TestEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.TestEnum\",\n        \"elements\" => dict[\n          0 => \"UNKNOWN\",\n          1 => \"VALUE1\",\n          2 => \"VALUE2\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * Foo\n */\nclass Foo implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::SET,\n        'elem' => shape(\n          'type' => \\TType::SET,\n          'etype' => \\TType::I32,\n          'elem' => shape(\n            'type' => \\TType::I32,\n          ),\n          'format' => 'collection',\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'c',\n      'type' => \\TType::I64,\n    ),\n    4 => shape(\n      'var' => 'd',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n    'c' => 3,\n    'd' => 4,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?Vector<string>,\n    ?'b' => ?Map<string, Vector<Set<int>>>,\n    ?'c' => ?int,\n    ?'d' => ?bool,\n  );\n\n  const int STRUCTURAL_ID = 3946809642153193229;\n  /**\n   * Original thrift field:-\n   * 1: list<string> a\n   */\n  public Vector<string> $a;\n  /**\n   * Original thrift field:-\n   * 2: map<string, list<set<i32>>> b\n   */\n  public ?Map<string, Vector<Set<int>>> $b;\n  /**\n   * Original thrift field:-\n   * 3: i64 c\n   */\n  public int $c;\n  /**\n   * Original thrift field:-\n   * 4: bool d\n   */\n  public bool $d;\n\n  public function __construct(?Vector<string> $a = null, ?Map<string, Vector<Set<int>>> $b = null, ?int $c = null, ?bool $d = null)[] {\n    $this->a = $a ?? Vector {};\n    $this->b = $b;\n    $this->c = $c ?? 7;\n    $this->d = $d ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n      Shapes::idx($shape, 'c'),\n      Shapes::idx($shape, 'd'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, Vector<string>>(idx($map, 'a'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, Vector<Set<int>>>>(idx($map, 'b'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, int>(idx($map, 'c'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, bool>(idx($map, 'd'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Foo\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"b\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"c\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"d\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nenum TestUnionEnum: int {\n  _EMPTY_ = 0;\n  string_field = 1;\n  int_field = 2;\n  enum_field = 3;\n  foo_struct = 4;\n}\n\n/**\n * Original thrift struct:-\n * TestUnion\n */\nclass TestUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<TestUnionEnum> {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'string_field',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'int_field',\n      'union' => true,\n      'type' => \\TType::I32,\n    ),\n    3 => shape(\n      'var' => 'enum_field',\n      'union' => true,\n      'type' => \\TType::I32,\n      'enum' => TestEnum::class,\n    ),\n    4 => shape(\n      'var' => 'foo_struct',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => Foo::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'string_field' => 1,\n    'int_field' => 2,\n    'enum_field' => 3,\n    'foo_struct' => 4,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'string_field' => ?string,\n    ?'int_field' => ?int,\n    ?'enum_field' => ?TestEnum,\n    ?'foo_struct' => ?Foo,\n  );\n\n  const int STRUCTURAL_ID = 1329962823516941134;\n  /**\n   * Original thrift field:-\n   * 1: string string_field\n   */\n  public ?string $string_field;\n  /**\n   * Original thrift field:-\n   * 2: i32 int_field\n   */\n  public ?int $int_field;\n  /**\n   * Original thrift field:-\n   * 3: module.TestEnum enum_field\n   */\n  public ?TestEnum $enum_field;\n  /**\n   * Original thrift field:-\n   * 4: module.Foo foo_struct\n   */\n  public ?Foo $foo_struct;\n  protected TestUnionEnum $_type = TestUnionEnum::_EMPTY_;\n\n  public function __construct(?string $string_field = null, ?int $int_field = null, ?TestEnum $enum_field = null, ?Foo $foo_struct = null)[] {\n    $this->_type = TestUnionEnum::_EMPTY_;\n    if ($string_field !== null) {\n      $this->string_field = $string_field;\n      $this->_type = TestUnionEnum::string_field;\n    }\n    if ($int_field !== null) {\n      $this->int_field = $int_field;\n      $this->_type = TestUnionEnum::int_field;\n    }\n    if ($enum_field !== null) {\n      $this->enum_field = $enum_field;\n      $this->_type = TestUnionEnum::enum_field;\n    }\n    if ($foo_struct !== null) {\n      $this->foo_struct = $foo_struct;\n      $this->_type = TestUnionEnum::foo_struct;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'string_field'),\n      Shapes::idx($shape, 'int_field'),\n      Shapes::idx($shape, 'enum_field'),\n      Shapes::idx($shape, 'foo_struct'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'string_field'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, int>(idx($map, 'int_field'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, TestEnum>(idx($map, 'enum_field'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, Foo>(idx($map, 'foo_struct'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestUnion';\n  }\n\n  public function getType()[]: TestUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case TestUnionEnum::string_field:\n        $this->string_field = null;\n        break;\n      case TestUnionEnum::int_field:\n        $this->int_field = null;\n        break;\n      case TestUnionEnum::enum_field:\n        $this->enum_field = null;\n        break;\n      case TestUnionEnum::foo_struct:\n        $this->foo_struct = null;\n        break;\n      case TestUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = TestUnionEnum::_EMPTY_;\n  }\n\n  public function set_string_field(string $string_field)[write_props]: this {\n    $this->reset();\n    $this->_type = TestUnionEnum::string_field;\n    $this->string_field = $string_field;\n    return $this;\n  }\n\n  public function get_string_field()[]: ?string {\n    return $this->string_field;\n  }\n\n  public function getx_string_field()[]: string {\n    invariant(\n      $this->_type === TestUnionEnum::string_field,\n      'get_string_field called on an instance of TestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->string_field as nonnull;\n  }\n\n  public function set_int_field(int $int_field)[write_props]: this {\n    $this->reset();\n    $this->_type = TestUnionEnum::int_field;\n    $this->int_field = $int_field;\n    return $this;\n  }\n\n  public function get_int_field()[]: ?int {\n    return $this->int_field;\n  }\n\n  public function getx_int_field()[]: int {\n    invariant(\n      $this->_type === TestUnionEnum::int_field,\n      'get_int_field called on an instance of TestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->int_field as nonnull;\n  }\n\n  public function set_enum_field(TestEnum $enum_field)[write_props]: this {\n    $this->reset();\n    $this->_type = TestUnionEnum::enum_field;\n    $this->enum_field = $enum_field;\n    return $this;\n  }\n\n  public function get_enum_field()[]: ?TestEnum {\n    return $this->enum_field;\n  }\n\n  public function getx_enum_field()[]: TestEnum {\n    invariant(\n      $this->_type === TestUnionEnum::enum_field,\n      'get_enum_field called on an instance of TestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->enum_field as nonnull;\n  }\n\n  public function set_foo_struct(Foo $foo_struct)[write_props]: this {\n    $this->reset();\n    $this->_type = TestUnionEnum::foo_struct;\n    $this->foo_struct = $foo_struct;\n    return $this;\n  }\n\n  public function get_foo_struct()[]: ?Foo {\n    return $this->foo_struct;\n  }\n\n  public function getx_foo_struct()[]: Foo {\n    invariant(\n      $this->_type === TestUnionEnum::foo_struct,\n      'get_foo_struct called on an instance of TestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->foo_struct as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TestUnion\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"string_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"int_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.TestEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"enum_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"foo_struct\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * Baz\n */\nclass Baz extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'some_field',\n      'type' => \\TType::STRUCT,\n      'class' => Foo::class,\n    ),\n    3 => shape(\n      'var' => 'some_container',\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    4 => shape(\n      'var' => 'code',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n    'some_field' => 2,\n    'some_container' => 3,\n    'code' => 4,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n    ?'some_field' => ?Foo,\n    ?'some_container' => ?Set<string>,\n    ?'code' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 1663976252517274137;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n  /**\n   * Original thrift field:-\n   * 2: module.Foo some_field\n   */\n  public ?Foo $some_field;\n  /**\n   * Original thrift field:-\n   * 3: set<string> some_container\n   */\n  public Set<string> $some_container;\n  /**\n   * Original thrift field:-\n   * 4: i32 code\n   */\n  public int $code;\n\n  public function __construct(?string $message = null, ?Foo $some_field = null, ?Set<string> $some_container = null, ?int $code = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n    $this->some_field = $some_field;\n    $this->some_container = $some_container ?? Set {};\n    $this->code = $code ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n      Shapes::idx($shape, 'some_field'),\n      Shapes::idx($shape, 'some_container'),\n      Shapes::idx($shape, 'code'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'message'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, Foo>(idx($map, 'some_field'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, Set<string>>(idx($map, 'some_container'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, int>(idx($map, 'code'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Baz';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.Baz\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"some_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"some_container\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"code\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * OptBaz\n */\nclass OptBaz extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 546500496397478593;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'message'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'OptBaz';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.OptBaz\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 853}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b);\n   */\n  public function baz(keyset<int> $a, KeyedContainer<int, KeyedContainer<int, keyset<string>>> $b): Awaitable<string>;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b);\n   */\n  public function baz(keyset<int> $a, KeyedContainer<int, KeyedContainer<int, keyset<string>>> $b): string;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarAsyncClientIf extends BarAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b);\n   */\n  public function baz(keyset<int> $a, KeyedContainer<int, KeyedContainer<int, keyset<string>>> $b): Awaitable<string>;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ntrait BarClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass BarAsyncClient extends \\ThriftClientBase implements BarAsyncClientIf {\n  use BarClientBase;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b);\n   */\n  public async function baz(keyset<int> $a, KeyedContainer<int, KeyedContainer<int, keyset<string>>> $b): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => Vec\\map($b, \n        $_val0 ==> dict($_val0)\n      ),\n    ));\n    await $this->asyncHandler_->genBefore(\"Bar\", \"baz\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"baz\", false);\n    return await $this->genAwaitResponse(Bar_baz_result::class, \"baz\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass BarClient extends \\ThriftClientBase implements BarClientIf {\n  use BarClientBase;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b);\n   */\n  public async function baz(keyset<int> $a, KeyedContainer<int, KeyedContainer<int, keyset<string>>> $b): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => Vec\\map($b, \n        $_val0 ==> dict($_val0)\n      ),\n    ));\n    await $this->asyncHandler_->genBefore(\"Bar\", \"baz\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"baz\", false);\n    return await $this->genAwaitResponse(Bar_baz_result::class, \"baz\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_baz(keyset<int> $a, KeyedContainer<int, KeyedContainer<int, keyset<string>>> $b): int {\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => Vec\\map($b, \n        $_val0 ==> dict($_val0)\n      ),\n    ));\n    return $this->sendImplHelper($args, \"baz\", false);\n  }\n  public function recv_baz(?int $expectedsequenceid = null): string {\n    return $this->recvImplHelper(Bar_baz_result::class, \"baz\", false, $expectedsequenceid);\n  }\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass Bar_baz_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'harray',\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::I32,\n        'vtype' => \\TType::SET,\n        'key' => shape(\n          'type' => \\TType::I32,\n        ),\n        'val' => shape(\n          'type' => \\TType::SET,\n          'etype' => \\TType::STRING,\n          'elem' => shape(\n            'type' => \\TType::STRING,\n          ),\n          'format' => 'harray',\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?keyset<int>,\n    ?'b' => ?vec<dict<int, keyset<string>>>,\n  );\n\n  const int STRUCTURAL_ID = 5283012534631553068;\n  public keyset<int> $a;\n  public vec<dict<int, keyset<string>>> $b;\n\n  public function __construct(?keyset<int> $a = null, ?vec<dict<int, keyset<string>>> $b = null)[] {\n    $this->a = $a ?? keyset[];\n    $this->b = $b ?? vec[];\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Bar_baz_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.baz_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass Bar_baz_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Bar_baz_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Bar_baz_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass BarStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.Bar\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"baz\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_set\" => tmeta_ThriftSetType::fromShape(\n                          shape(\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"a\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_list\" => tmeta_ThriftListType::fromShape(\n                          shape(\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_map\" => tmeta_ThriftMapType::fromShape(\n                                  shape(\n                                    \"keyType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                      )\n                                    ),\n                                    \"valueType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                          shape(\n                                            \"valueType\" => tmeta_ThriftType::fromShape(\n                                              shape(\n                                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                              )\n                                            ),\n                                          )\n                                        ),\n                                      )\n                                    ),\n                                  )\n                                ),\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"b\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 495}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\hack;\n\n/**\n * Original thrift struct:-\n * FieldWrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/FieldWrapper'))>>\nclass FieldWrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldWrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.FieldWrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Wrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Wrapper'))>>\nclass Wrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'underlyingName',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'extraNamespace',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'underlyingName' => 2,\n    'extraNamespace' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'underlyingName' => ?string,\n    ?'extraNamespace' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 1284986773698322040;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string underlyingName\n   */\n  public string $underlyingName;\n  /**\n   * Original thrift field:-\n   * 3: string extraNamespace\n   */\n  public string $extraNamespace;\n\n  public function __construct(?string $name = null, ?string $underlyingName = null, ?string $extraNamespace = null)[] {\n    $this->name = $name ?? '';\n    $this->underlyingName = $underlyingName ?? '';\n    $this->extraNamespace = $extraNamespace ?? \"thrift_adapted_types\";\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'underlyingName'),\n      Shapes::idx($shape, 'extraNamespace'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Wrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Wrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"underlyingName\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"extraNamespace\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * SkipCodegen\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/SkipCodegen'))>>\nclass SkipCodegen implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'reason' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'reason' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 3707764047816594739;\n  /**\n   * Original thrift field:-\n   * 1: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $reason = null)[] {\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SkipCodegen';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.SkipCodegen\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Name\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Name'))>>\nclass Name implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'reason' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'reason' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 4844827548325959202;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $name = null, ?string $reason = null)[] {\n    $this->name = $name ?? '';\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Name';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Name\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * UnionEnumAttributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/UnionEnumAttributes'))>>\nclass UnionEnumAttributes implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'harray',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?vec<string>,\n  );\n\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public vec<string> $attributes;\n\n  public function __construct(?vec<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? vec[];\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'UnionEnumAttributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.UnionEnumAttributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructTrait'))>>\nclass StructTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructTrait\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Attributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Attributes'))>>\nclass Attributes implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'harray',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?vec<string>,\n  );\n\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public vec<string> $attributes;\n\n  public function __construct(?vec<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? vec[];\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Attributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Attributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructAsTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructAsTrait'))>>\nclass StructAsTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructAsTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructAsTrait\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ModuleInternal\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/ModuleInternal'))>>\nclass ModuleInternal implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ModuleInternal';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.ModuleInternal\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1017}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift struct:-\n * Foo\n */\nclass Foo implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'harray',\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::SET,\n        'elem' => shape(\n          'type' => \\TType::SET,\n          'etype' => \\TType::I32,\n          'elem' => shape(\n            'type' => \\TType::I32,\n          ),\n          'format' => 'harray',\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?vec<string>,\n    ?'b' => ?dict<string, vec<keyset<int>>>,\n  );\n\n  const int STRUCTURAL_ID = 4230744283513012869;\n  /**\n   * Original thrift field:-\n   * 1: list<string> a\n   */\n  public vec<string> $a;\n  /**\n   * Original thrift field:-\n   * 2: map<string, list<set<i32>>> b\n   */\n  public dict<string, vec<keyset<int>>> $b;\n\n  public function __construct(?vec<string> $a = null, ?dict<string, vec<keyset<int>>> $b = null)[] {\n    $this->a = $a ?? vec[];\n    $this->b = $b ?? dict[];\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Foo\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 179}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1228}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\hack;\n\n/**\n * Original thrift struct:-\n * FieldWrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/FieldWrapper'))>>\nclass FieldWrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldWrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.FieldWrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Wrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Wrapper'))>>\nclass Wrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'underlyingName',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'extraNamespace',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'underlyingName' => 2,\n    'extraNamespace' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'underlyingName' => ?string,\n    ?'extraNamespace' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 1284986773698322040;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string underlyingName\n   */\n  public string $underlyingName;\n  /**\n   * Original thrift field:-\n   * 3: string extraNamespace\n   */\n  public string $extraNamespace;\n\n  public function __construct(?string $name = null, ?string $underlyingName = null, ?string $extraNamespace = null)[] {\n    $this->name = $name ?? '';\n    $this->underlyingName = $underlyingName ?? '';\n    $this->extraNamespace = $extraNamespace ?? \"thrift_adapted_types\";\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'underlyingName'),\n      Shapes::idx($shape, 'extraNamespace'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Wrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Wrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"underlyingName\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"extraNamespace\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * SkipCodegen\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/SkipCodegen'))>>\nclass SkipCodegen implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'reason' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'reason' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 3707764047816594739;\n  /**\n   * Original thrift field:-\n   * 1: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $reason = null)[] {\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SkipCodegen';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.SkipCodegen\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Name\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Name'))>>\nclass Name implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'reason' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'reason' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 4844827548325959202;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $name = null, ?string $reason = null)[] {\n    $this->name = $name ?? '';\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Name';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Name\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * UnionEnumAttributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/UnionEnumAttributes'))>>\nclass UnionEnumAttributes implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?Vector<string>,\n  );\n\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public Vector<string> $attributes;\n\n  public function __construct(?Vector<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'UnionEnumAttributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.UnionEnumAttributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructTrait'))>>\nclass StructTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructTrait\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Attributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Attributes'))>>\nclass Attributes implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?Vector<string>,\n  );\n\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public Vector<string> $attributes;\n\n  public function __construct(?Vector<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Attributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Attributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructAsTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructAsTrait'))>>\nclass StructAsTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructAsTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructAsTrait\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ModuleInternal\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/ModuleInternal'))>>\nclass ModuleInternal implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ModuleInternal';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.ModuleInternal\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1017}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures\\jsenum;\n\n/**\n * Original thrift enum:-\n * MyThriftEnum\n */\n<<ApiEnum, JSEnum>>\nenum MyThriftEnum: int {\n  foo = 1;\n  bar = 2;\n  baz = 3;\n}\n\nclass MyThriftEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module1.MyThriftEnum\",\n        \"elements\" => dict[\n          1 => \"foo\",\n          2 => \"bar\",\n          3 => \"baz\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * MyThriftStruct\n */\n<<ClassAttribute>>\nclass MyThriftStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'bar',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'baz',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n    'bar' => 2,\n    'baz' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?string,\n    ?'bar' => ?string,\n    ?'baz' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 6671455975178405100;\n  /**\n   * Original thrift field:-\n   * 1: string foo\n   */\n  <<FieldAttribute>>\n  public string $foo;\n  /**\n   * Original thrift field:-\n   * 2: string bar\n   */\n  public string $bar;\n  /**\n   * Original thrift field:-\n   * 3: string baz\n   */\n  public string $baz;\n\n  public function __construct(?string $foo = null, ?string $bar = null, ?string $baz = null)[] {\n    $this->foo = $foo ?? '';\n    $this->bar = $bar ?? '';\n    $this->baz = $baz ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n      Shapes::idx($shape, 'bar'),\n      Shapes::idx($shape, 'baz'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyThriftStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module1.MyThriftStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"bar\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"baz\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MySecondThriftStruct\n */\nclass MySecondThriftStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\jsenum\\MyThriftEnum::class,\n    ),\n    2 => shape(\n      'var' => 'bar',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\jsenum\\MyThriftStruct::class,\n    ),\n    3 => shape(\n      'var' => 'baz',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n    'bar' => 2,\n    'baz' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?\\test\\fixtures\\jsenum\\MyThriftEnum,\n    ?'bar' => ?\\test\\fixtures\\jsenum\\MyThriftStruct,\n    ?'baz' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 2800971917864580212;\n  /**\n   * Original thrift field:-\n   * 1: module1.MyThriftEnum foo\n   */\n  public ?\\test\\fixtures\\jsenum\\MyThriftEnum $foo;\n  /**\n   * Original thrift field:-\n   * 2: module1.MyThriftStruct bar\n   */\n  public ?\\test\\fixtures\\jsenum\\MyThriftStruct $bar;\n  /**\n   * Original thrift field:-\n   * 3: i64 baz\n   */\n  public int $baz;\n\n  public function __construct(?\\test\\fixtures\\jsenum\\MyThriftEnum $foo = null, ?\\test\\fixtures\\jsenum\\MyThriftStruct $bar = null, ?int $baz = null)[] {\n    $this->foo = $foo;\n    $this->bar = $bar;\n    $this->baz = $baz ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n      Shapes::idx($shape, 'bar'),\n      Shapes::idx($shape, 'baz'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MySecondThriftStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module1.MySecondThriftStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module1.MyThriftEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module1.MyThriftStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"bar\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"baz\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyThirdThriftStruct\n */\n<<ApiEnum, JSEnum>>\nclass MyThirdThriftStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 4302560019326481254;\n  /**\n   * Original thrift field:-\n   * 1: i32 foo\n   */\n  <<FieldAttribute>>\n  public int $foo;\n\n  public function __construct(?int $foo = null)[] {\n    $this->foo = $foo ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyThirdThriftStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module1.MyThirdThriftStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\Attributes' => \\facebook\\thrift\\annotation\\hack\\Attributes::fromShape(\n          shape(\n            \"attributes\" => vec[\n              \"ApiEnum\",\n              \"JSEnum\",\n            ],\n          )\n        ),\n      ],\n      'fields' => dict[\n        'foo' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Attributes' => \\facebook\\thrift\\annotation\\hack\\Attributes::fromShape(\n              shape(\n                \"attributes\" => vec[\n                  \"FieldAttribute\",\n                ],\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n<<EnumAttributes>>\nenum UnionTestingEnum: int {\n  _EMPTY_ = 0;\n  foo = 1;\n  bar = 3;\n}\n\n/**\n * Original thrift struct:-\n * UnionTesting\n */\nclass UnionTesting implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<\\test\\fixtures\\jsenum\\UnionTestingEnum> {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'bar',\n      'union' => true,\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n    'bar' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?string,\n    ?'bar' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 4708174399727259919;\n  /**\n   * Original thrift field:-\n   * 1: string foo\n   */\n  public ?string $foo;\n  /**\n   * Original thrift field:-\n   * 3: i64 bar\n   */\n  public ?int $bar;\n  protected \\test\\fixtures\\jsenum\\UnionTestingEnum $_type = \\test\\fixtures\\jsenum\\UnionTestingEnum::_EMPTY_;\n\n  public function __construct(?string $foo = null, ?int $bar = null)[] {\n    $this->_type = \\test\\fixtures\\jsenum\\UnionTestingEnum::_EMPTY_;\n    if ($foo !== null) {\n      $this->foo = $foo;\n      $this->_type = \\test\\fixtures\\jsenum\\UnionTestingEnum::foo;\n    }\n    if ($bar !== null) {\n      $this->bar = $bar;\n      $this->_type = \\test\\fixtures\\jsenum\\UnionTestingEnum::bar;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n      Shapes::idx($shape, 'bar'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'UnionTesting';\n  }\n\n  public function getType()[]: \\test\\fixtures\\jsenum\\UnionTestingEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case \\test\\fixtures\\jsenum\\UnionTestingEnum::foo:\n        $this->foo = null;\n        break;\n      case \\test\\fixtures\\jsenum\\UnionTestingEnum::bar:\n        $this->bar = null;\n        break;\n      case \\test\\fixtures\\jsenum\\UnionTestingEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = \\test\\fixtures\\jsenum\\UnionTestingEnum::_EMPTY_;\n  }\n\n  public function set_foo(string $foo)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\jsenum\\UnionTestingEnum::foo;\n    $this->foo = $foo;\n    return $this;\n  }\n\n  public function get_foo()[]: ?string {\n    return $this->foo;\n  }\n\n  public function getx_foo()[]: string {\n    invariant(\n      $this->_type === \\test\\fixtures\\jsenum\\UnionTestingEnum::foo,\n      'get_foo called on an instance of UnionTesting whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->foo as nonnull;\n  }\n\n  public function set_bar(int $bar)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\jsenum\\UnionTestingEnum::bar;\n    $this->bar = $bar;\n    return $this;\n  }\n\n  public function get_bar()[]: ?int {\n    return $this->bar;\n  }\n\n  public function getx_bar()[]: int {\n    invariant(\n      $this->_type === \\test\\fixtures\\jsenum\\UnionTestingEnum::bar,\n      'get_bar called on an instance of UnionTesting whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->bar as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module1.UnionTesting\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"bar\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\UnionEnumAttributes' => \\facebook\\thrift\\annotation\\hack\\UnionEnumAttributes::fromShape(\n          shape(\n            \"attributes\" => vec[\n              \"EnumAttributes\",\n            ],\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n<<EnumAttributes, EnumAttributes2>>\nenum UnionTestingStructuredEnum: int {\n  _EMPTY_ = 0;\n  foo = 1;\n  bar = 3;\n}\n\n/**\n * Original thrift struct:-\n * UnionTestingStructured\n */\nclass UnionTestingStructured implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<\\test\\fixtures\\jsenum\\UnionTestingStructuredEnum> {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'bar',\n      'union' => true,\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n    'bar' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?string,\n    ?'bar' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 4708174399727259919;\n  /**\n   * Original thrift field:-\n   * 1: string foo\n   */\n  public ?string $foo;\n  /**\n   * Original thrift field:-\n   * 3: i64 bar\n   */\n  public ?int $bar;\n  protected \\test\\fixtures\\jsenum\\UnionTestingStructuredEnum $_type = \\test\\fixtures\\jsenum\\UnionTestingStructuredEnum::_EMPTY_;\n\n  public function __construct(?string $foo = null, ?int $bar = null)[] {\n    $this->_type = \\test\\fixtures\\jsenum\\UnionTestingStructuredEnum::_EMPTY_;\n    if ($foo !== null) {\n      $this->foo = $foo;\n      $this->_type = \\test\\fixtures\\jsenum\\UnionTestingStructuredEnum::foo;\n    }\n    if ($bar !== null) {\n      $this->bar = $bar;\n      $this->_type = \\test\\fixtures\\jsenum\\UnionTestingStructuredEnum::bar;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n      Shapes::idx($shape, 'bar'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'UnionTestingStructured';\n  }\n\n  public function getType()[]: \\test\\fixtures\\jsenum\\UnionTestingStructuredEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case \\test\\fixtures\\jsenum\\UnionTestingStructuredEnum::foo:\n        $this->foo = null;\n        break;\n      case \\test\\fixtures\\jsenum\\UnionTestingStructuredEnum::bar:\n        $this->bar = null;\n        break;\n      case \\test\\fixtures\\jsenum\\UnionTestingStructuredEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = \\test\\fixtures\\jsenum\\UnionTestingStructuredEnum::_EMPTY_;\n  }\n\n  public function set_foo(string $foo)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\jsenum\\UnionTestingStructuredEnum::foo;\n    $this->foo = $foo;\n    return $this;\n  }\n\n  public function get_foo()[]: ?string {\n    return $this->foo;\n  }\n\n  public function getx_foo()[]: string {\n    invariant(\n      $this->_type === \\test\\fixtures\\jsenum\\UnionTestingStructuredEnum::foo,\n      'get_foo called on an instance of UnionTestingStructured whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->foo as nonnull;\n  }\n\n  public function set_bar(int $bar)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\jsenum\\UnionTestingStructuredEnum::bar;\n    $this->bar = $bar;\n    return $this;\n  }\n\n  public function get_bar()[]: ?int {\n    return $this->bar;\n  }\n\n  public function getx_bar()[]: int {\n    invariant(\n      $this->_type === \\test\\fixtures\\jsenum\\UnionTestingStructuredEnum::bar,\n      'get_bar called on an instance of UnionTestingStructured whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->bar as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module1.UnionTestingStructured\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"bar\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\UnionEnumAttributes' => \\facebook\\thrift\\annotation\\hack\\UnionEnumAttributes::fromShape(\n          shape(\n            \"attributes\" => vec[\n              \"EnumAttributes\",\n              \"EnumAttributes2\",\n            ],\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 816}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1228}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public function baz(\\ConstSet<int> $a, KeyedContainer<int, KeyedContainer<int, \\ConstSet<string>>> $b, int $c, ?Foo $d, int $e): Awaitable<string>;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public function baz(\\ConstSet<int> $a, KeyedContainer<int, KeyedContainer<int, \\ConstSet<string>>> $b, int $c, ?Foo $d, int $e): string;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarAsyncClientIf extends BarAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public function baz(\\ConstSet<int> $a, KeyedContainer<int, KeyedContainer<int, \\ConstSet<string>>> $b, int $c, ?Foo $d, int $e): Awaitable<string>;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ntrait BarClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass BarAsyncClient extends \\ThriftClientBase implements BarAsyncClientIf {\n  use BarClientBase;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public async function baz(\\ConstSet<int> $a, KeyedContainer<int, KeyedContainer<int, \\ConstSet<string>>> $b, int $c, ?Foo $d, int $e): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => (new Vector($b))->map(\n        $_val0 ==> new Map($_val0)\n      ),\n      'c' => $c,\n      'd' => $d,\n      'e' => $e,\n    ));\n    await $this->asyncHandler_->genBefore(\"Bar\", \"baz\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"baz\", false);\n    return await $this->genAwaitResponse(Bar_baz_result::class, \"baz\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass BarClient extends \\ThriftClientBase implements BarClientIf {\n  use BarClientBase;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public async function baz(\\ConstSet<int> $a, KeyedContainer<int, KeyedContainer<int, \\ConstSet<string>>> $b, int $c, ?Foo $d, int $e): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => (new Vector($b))->map(\n        $_val0 ==> new Map($_val0)\n      ),\n      'c' => $c,\n      'd' => $d,\n      'e' => $e,\n    ));\n    await $this->asyncHandler_->genBefore(\"Bar\", \"baz\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"baz\", false);\n    return await $this->genAwaitResponse(Bar_baz_result::class, \"baz\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_baz(\\ConstSet<int> $a, KeyedContainer<int, KeyedContainer<int, \\ConstSet<string>>> $b, int $c, ?Foo $d, int $e): int {\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => (new Vector($b))->map(\n        $_val0 ==> new Map($_val0)\n      ),\n      'c' => $c,\n      'd' => $d,\n      'e' => $e,\n    ));\n    return $this->sendImplHelper($args, \"baz\", false);\n  }\n  public function recv_baz(?int $expectedsequenceid = null): string {\n    return $this->recvImplHelper(Bar_baz_result::class, \"baz\", false, $expectedsequenceid);\n  }\n}\n\nabstract class BarAsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as BarAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = BarStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'Bar';\n\n  protected async function process_baz(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('baz');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'baz', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'Bar_baz_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'Bar_baz_args');\n    } else {\n      $args = Bar_baz_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'baz', $args);\n    $result = Bar_baz_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'Bar', 'baz', $args);\n      $result->success = await $this->handler->baz($args->a, $args->b, $args->c, $args->d, $args->e);\n      $this->eventHandler_->postExec($handler_ctx, 'baz', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'baz', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'baz', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'baz', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'baz', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"baz\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'baz', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = BarStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass BarAsyncProcessor extends BarAsyncProcessorBase {\n  const type TThriftIf = BarAsyncIf;\n}\n\nabstract class BarSyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as BarIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = BarStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'Bar';\n\n  protected function process_baz(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('baz');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'baz', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'Bar_baz_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'Bar_baz_args');\n    } else {\n      $args = Bar_baz_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'baz', $args);\n    $result = Bar_baz_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'Bar', 'baz', $args);\n      $result->success = $this->handler->baz($args->a, $args->b, $args->c, $args->d, $args->e);\n      $this->eventHandler_->postExec($handler_ctx, 'baz', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'baz', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'baz', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'baz', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'baz', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"baz\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'baz', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = BarStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass BarSyncProcessor extends BarSyncProcessorBase {\n  const type TThriftIf = BarIf;\n}\n// For backwards compatibility\nclass BarProcessor extends BarSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass Bar_baz_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::I32,\n        'vtype' => \\TType::SET,\n        'key' => shape(\n          'type' => \\TType::I32,\n        ),\n        'val' => shape(\n          'type' => \\TType::SET,\n          'etype' => \\TType::STRING,\n          'elem' => shape(\n            'type' => \\TType::STRING,\n          ),\n          'format' => 'collection',\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'c',\n      'type' => \\TType::I64,\n    ),\n    4 => shape(\n      'var' => 'd',\n      'type' => \\TType::STRUCT,\n      'class' => Foo::class,\n    ),\n    5 => shape(\n      'var' => 'e',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n    'c' => 3,\n    'd' => 4,\n    'e' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?\\ConstSet<int>,\n    ?'b' => ?\\ConstVector<\\ConstMap<int, \\ConstSet<string>>>,\n    ?'c' => ?int,\n    ?'d' => ?Foo,\n    ?'e' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 7865027497865509792;\n  public \\ConstSet<int> $a;\n  public \\ConstVector<\\ConstMap<int, \\ConstSet<string>>> $b;\n  public int $c;\n  public ?Foo $d;\n  public int $e;\n\n  public function __construct(?\\ConstSet<int> $a = null, ?\\ConstVector<\\ConstMap<int, \\ConstSet<string>>> $b = null, ?int $c = null, ?Foo $d = null, ?int $e = null)[] {\n    $this->a = $a ?? Set {};\n    $this->b = $b ?? Vector {};\n    $this->c = $c ?? 0;\n    $this->d = $d;\n    $this->e = $e ?? 4;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n      Shapes::idx($shape, 'c'),\n      Shapes::idx($shape, 'd'),\n      Shapes::idx($shape, 'e'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Bar_baz_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.baz_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"c\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"d\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"e\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass Bar_baz_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Bar_baz_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Bar_baz_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass BarStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.Bar\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"baz\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_set\" => tmeta_ThriftSetType::fromShape(\n                          shape(\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"a\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_list\" => tmeta_ThriftListType::fromShape(\n                          shape(\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_map\" => tmeta_ThriftMapType::fromShape(\n                                  shape(\n                                    \"keyType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                      )\n                                    ),\n                                    \"valueType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                          shape(\n                                            \"valueType\" => tmeta_ThriftType::fromShape(\n                                              shape(\n                                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                              )\n                                            ),\n                                          )\n                                        ),\n                                      )\n                                    ),\n                                  )\n                                ),\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"b\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 3,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"c\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 4,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.Foo\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"d\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 5,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"e\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n              'module.Foo' => Foo::getStructMetadata(),\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 802}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift struct:-\n * Foo\n */\nclass Foo implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::SET,\n        'elem' => shape(\n          'type' => \\TType::SET,\n          'etype' => \\TType::I32,\n          'elem' => shape(\n            'type' => \\TType::I32,\n          ),\n          'format' => 'collection',\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'c',\n      'type' => \\TType::I64,\n    ),\n    4 => shape(\n      'var' => 'd',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n    'c' => 3,\n    'd' => 4,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?\\ConstVector<string>,\n    ?'b' => ?\\ConstMap<string, \\ConstVector<\\ConstSet<int>>>,\n    ?'c' => ?int,\n    ?'d' => ?bool,\n  );\n\n  const int STRUCTURAL_ID = 3946809642153193229;\n  /**\n   * Original thrift field:-\n   * 1: list<string> a\n   */\n  public \\ConstVector<string> $a;\n  /**\n   * Original thrift field:-\n   * 2: map<string, list<set<i32>>> b\n   */\n  public ?\\ConstMap<string, \\ConstVector<\\ConstSet<int>>> $b;\n  /**\n   * Original thrift field:-\n   * 3: i64 c\n   */\n  public int $c;\n  /**\n   * Original thrift field:-\n   * 4: bool d\n   */\n  public bool $d;\n\n  public function __construct(?\\ConstVector<string> $a = null, ?\\ConstMap<string, \\ConstVector<\\ConstSet<int>>> $b = null, ?int $c = null, ?bool $d = null)[] {\n    $this->a = $a ?? Vector {};\n    $this->b = $b;\n    $this->c = $c ?? 7;\n    $this->d = $d ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n      Shapes::idx($shape, 'c'),\n      Shapes::idx($shape, 'd'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Foo\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"b\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"c\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"d\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * Baz\n */\nclass Baz extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2427562471238739676;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Baz';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.Baz\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 314}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures\\hackenumtyping;\n\n/**\n * Original thrift enum:-\n * MyEnum\n */\nenum MyEnum: int as int {\n  MyValue1 = 0;\n  MyValue2 = 1;\n}\ntype MyEnumType = MyEnum;\n\nclass MyEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.MyEnum\",\n        \"elements\" => dict[\n          0 => \"MyValue1\",\n          1 => \"MyValue2\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 43}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift enum:-\n * MyEnum\n */\nenum MyEnum: int {\n  MyValue1 = 0;\n  MyValue2 = 1;\n}\n\nclass MyEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.MyEnum\",\n        \"elements\" => dict[\n          0 => \"MyValue1\",\n          1 => \"MyValue2\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift exception:-\n * MyException1\n */\nclass MyException1 extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'code',\n      'type' => \\TType::I32,\n      'enum' => MyEnum::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n    'code' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n    ?'code' => ?MyEnum,\n  );\n\n  const int STRUCTURAL_ID = 7711048519845400283;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n  /**\n   * Original thrift field:-\n   * 2: module.MyEnum code\n   */\n  public /* Originally defined as MyEnum */ int $code;\n\n  public function setCodeAsEnum(MyEnum $code)[write_props]: void {\n    $this->code = HH\\FIXME\\UNSAFE_CAST<arraykey, int>($code, 'nontransparent enum');\n  }\n\n  public function getCodeAsEnum()[]: MyEnum {\n    return HH\\FIXME\\UNSAFE_CAST<int, MyEnum>($this->code, 'retain HHVM enforcement semantics');\n  }\n\n  public function __construct(?string $message = null, ?MyEnum $code = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n    $this->code = HH\\FIXME\\UNSAFE_CAST<arraykey, int>($code ?? MyEnum::MyValue1, 'nontransparent Enum');\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n      Shapes::idx($shape, 'code'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyException1';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.MyException1\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"code\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * MyException2\n */\nclass MyException2 extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'code',\n      'type' => \\TType::I32,\n      'enum' => MyEnum::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n    'code' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n    ?'code' => ?MyEnum,\n  );\n\n  const int STRUCTURAL_ID = 3067783023341493113;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n  /**\n   * Original thrift field:-\n   * 2: module.MyEnum code\n   */\n  public /* Originally defined as MyEnum */ int $code;\n\n  public function setCodeAsEnum(MyEnum $code)[write_props]: void {\n    $this->code = HH\\FIXME\\UNSAFE_CAST<arraykey, int>($code, 'nontransparent enum');\n  }\n\n  public function getCodeAsEnum()[]: MyEnum {\n    return HH\\FIXME\\UNSAFE_CAST<int, MyEnum>($this->code, 'retain HHVM enforcement semantics');\n  }\n\n  public function __construct(?string $message = null, ?MyEnum $code = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n    $this->code = HH\\FIXME\\UNSAFE_CAST<arraykey, int>($code ?? MyEnum::MyValue1, 'nontransparent Enum');\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n      Shapes::idx($shape, 'code'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyException2';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.MyException2\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"code\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * MyException3\n */\nclass MyException3 extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'code',\n      'type' => \\TType::I32,\n      'enum' => MyEnum::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n    'code' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n    ?'code' => ?MyEnum,\n  );\n\n  const int STRUCTURAL_ID = 3517193566312570591;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n  /**\n   * Original thrift field:-\n   * 2: module.MyEnum code\n   */\n  public /* Originally defined as MyEnum */ int $code;\n\n  public function setCodeAsEnum(MyEnum $code)[write_props]: void {\n    $this->code = HH\\FIXME\\UNSAFE_CAST<arraykey, int>($code, 'nontransparent enum');\n  }\n\n  public function getCodeAsEnum()[]: MyEnum {\n    return HH\\FIXME\\UNSAFE_CAST<int, MyEnum>($this->code, 'retain HHVM enforcement semantics');\n  }\n\n  public function __construct(?string $message = null, ?MyEnum $code = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n    $this->code = HH\\FIXME\\UNSAFE_CAST<arraykey, int>($code ?? MyEnum::MyValue1, 'nontransparent Enum');\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n      Shapes::idx($shape, 'code'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyException3';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.MyException3\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"code\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * MyException4\n */\nclass MyException4 extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'code',\n      'type' => \\TType::I32,\n      'enum' => MyEnum::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n    'code' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n    ?'code' => ?MyEnum,\n  );\n\n  const int STRUCTURAL_ID = 3517193566312570591;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n  /**\n   * Original thrift field:-\n   * 2: module.MyEnum code\n   */\n  public /* Originally defined as MyEnum */ int $code;\n\n  public function setCodeAsEnum(MyEnum $code)[write_props]: void {\n    $this->code = HH\\FIXME\\UNSAFE_CAST<arraykey, int>($code, 'nontransparent enum');\n  }\n\n  public function getCodeAsEnum()[]: MyEnum {\n    return HH\\FIXME\\UNSAFE_CAST<int, MyEnum>($this->code, 'retain HHVM enforcement semantics');\n  }\n\n  public function __construct(?string $message = null, ?MyEnum $code = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n    $this->code = HH\\FIXME\\UNSAFE_CAST<arraykey, int>($code ?? MyEnum::MyValue2, 'nontransparent Enum');\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n      Shapes::idx($shape, 'code'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyException4';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.MyException4\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"code\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * MyException5\n */\nclass MyException5 extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'code',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n    'code' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n    ?'code' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 7335721753390449361;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n  /**\n   * Original thrift field:-\n   * 2: i64 code\n   */\n  public int $code;\n\n  public function __construct(?string $message = null, ?int $code = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n    $this->code = $code ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n      Shapes::idx($shape, 'code'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyException5';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.MyException5\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"code\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 639}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift enum:-\n * MyEnum\n */\nenum MyEnum: int as int {\n  MyValue1 = 0;\n  MyValue2 = 1;\n}\n\nclass MyEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.MyEnum\",\n        \"elements\" => dict[\n          0 => \"MyValue1\",\n          1 => \"MyValue2\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift exception:-\n * MyException\n */\nclass MyException extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'code',\n      'type' => \\TType::I32,\n      'enum' => MyEnum::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n    'code' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n    ?'code' => ?MyEnum,\n  );\n\n  const int STRUCTURAL_ID = 3517193566312570591;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n  /**\n   * Original thrift field:-\n   * 2: module.MyEnum code\n   */\n  public /* Originally defined as MyEnum */ int $code;\n\n  public function setCodeAsEnum(MyEnum $code)[write_props]: void {\n    $this->code = $code;\n  }\n\n  public function getCodeAsEnum()[]: MyEnum {\n    return HH\\FIXME\\UNSAFE_CAST<int, MyEnum>($this->code, 'retain HHVM enforcement semantics');\n  }\n\n  public function __construct(?string $message = null, ?MyEnum $code = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n    $this->code = $code ?? MyEnum::MyValue1;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n      Shapes::idx($shape, 'code'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyException';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.MyException\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"code\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 162}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * Brox\n */\ninterface Beeble_BroxAsyncIf extends \\IThriftAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * Brox\n */\ninterface Beeble_BroxIf extends \\IThriftSyncIf {\n}\n\n/**\n * Original thrift service:-\n * Brox\n */\ninterface Beeble_BroxAsyncClientIf extends Beeble_BroxAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * Brox\n */\ninterface Beeble_BroxClientIf extends \\IThriftSyncIf {\n}\n\n/**\n * Original thrift service:-\n * Brox\n */\ntrait Beeble_BroxClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass Beeble_BroxAsyncClient extends \\ThriftClientBase implements Beeble_BroxAsyncClientIf {\n  use Beeble_BroxClientBase;\n\n}\n\nclass Beeble_BroxClient extends \\ThriftClientBase implements Beeble_BroxClientIf {\n  use Beeble_BroxClientBase;\n\n  /* send and recv functions */\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass Beeble_BroxStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.Brox\",\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 106}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n", "num_lines": 9}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift enum:-\n * FooEnum\n */\nenum FooEnum: int {\n  BAR = 0;\n  BAZ = 1;\n}\n\nclass FooEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.FooEnum\",\n        \"elements\" => dict[\n          0 => \"BAR\",\n          1 => \"BAZ\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * BarStruct\n */\nclass BarStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'e',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::I32,\n        'enum' => FooEnum::class,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n        'enum' => FooEnum::class,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 's',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n        'enum' => FooEnum::class,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'e' => 1,\n    's' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'e' => ?Map<FooEnum, FooEnum>,\n    ?'s' => ?Set<FooEnum>,\n  );\n\n  const type TShape = shape(\n    'e' => darray<FooEnum, FooEnum>,\n    's' => darray<FooEnum, bool>,\n    ...\n  );\n  const int STRUCTURAL_ID = 2986314503120154076;\n  /**\n   * Original thrift field:-\n   * 1: map<module.FooEnum, module.FooEnum> e\n   */\n  public Map<FooEnum, FooEnum> $e;\n  /**\n   * Original thrift field:-\n   * 2: set<module.FooEnum> s\n   */\n  public Set<FooEnum> $s;\n\n  public function __construct(?Map<FooEnum, FooEnum> $e = null, ?Set<FooEnum> $s = null)[] {\n    $this->e = $e ?? Map {};\n    $this->s = $s ?? Set {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'e'),\n      Shapes::idx($shape, 's'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BarStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.BarStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                            shape(\n                              \"name\" => \"module.FooEnum\",\n                            )\n                          ),\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                            shape(\n                              \"name\" => \"module.FooEnum\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"e\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                            shape(\n                              \"name\" => \"module.FooEnum\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"s\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['e'] |> new Map($$),\n      new Set(Keyset\\keys($shape['s'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'e' => ThriftUtil::toDArray($this->e, static::class),\n      's' => ThriftUtil::toDArray(Dict\\fill_keys($this->s->toValuesArray(), true), static::class),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 217}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\hack;\n\n/**\n * Original thrift struct:-\n * FieldWrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/FieldWrapper'))>>\nclass FieldWrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldWrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.FieldWrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Wrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Wrapper'))>>\nclass Wrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'underlyingName',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'extraNamespace',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'underlyingName' => 2,\n    'extraNamespace' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'underlyingName' => ?string,\n    ?'extraNamespace' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 1284986773698322040;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string underlyingName\n   */\n  public string $underlyingName;\n  /**\n   * Original thrift field:-\n   * 3: string extraNamespace\n   */\n  public string $extraNamespace;\n\n  public function __construct(?string $name = null, ?string $underlyingName = null, ?string $extraNamespace = null)[] {\n    $this->name = $name ?? '';\n    $this->underlyingName = $underlyingName ?? '';\n    $this->extraNamespace = $extraNamespace ?? \"thrift_adapted_types\";\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'underlyingName'),\n      Shapes::idx($shape, 'extraNamespace'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Wrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Wrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"underlyingName\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"extraNamespace\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * SkipCodegen\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/SkipCodegen'))>>\nclass SkipCodegen implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'reason' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'reason' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 3707764047816594739;\n  /**\n   * Original thrift field:-\n   * 1: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $reason = null)[] {\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SkipCodegen';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.SkipCodegen\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Name\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Name'))>>\nclass Name implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'reason' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'reason' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 4844827548325959202;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $name = null, ?string $reason = null)[] {\n    $this->name = $name ?? '';\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Name';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Name\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * UnionEnumAttributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/UnionEnumAttributes'))>>\nclass UnionEnumAttributes implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?Vector<string>,\n  );\n\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public Vector<string> $attributes;\n\n  public function __construct(?Vector<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'UnionEnumAttributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.UnionEnumAttributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructTrait'))>>\nclass StructTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructTrait\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Attributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Attributes'))>>\nclass Attributes implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?Vector<string>,\n  );\n\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public Vector<string> $attributes;\n\n  public function __construct(?Vector<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Attributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Attributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructAsTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructAsTrait'))>>\nclass StructAsTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructAsTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructAsTrait\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ModuleInternal\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/ModuleInternal'))>>\nclass ModuleInternal implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ModuleInternal';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.ModuleInternal\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1017}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift struct:-\n * MyStruct\n */\nclass MyStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  use MyStructTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 5005397852709472361;\n  /**\n   * Original thrift field:-\n   * 1: string foo\n   */\n  public string $foo;\n\n  public function __construct(?string $foo = null)[] {\n    $this->foo = $foo ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\StructTrait' => \\facebook\\thrift\\annotation\\hack\\StructTrait::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MySecondStruct\n */\nclass MySecondStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  use MySecondStructTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 5005397852709472361;\n  /**\n   * Original thrift field:-\n   * 1: string foo\n   */\n  public string $foo;\n\n  public function __construct(?string $foo = null)[] {\n    $this->foo = $foo ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MySecondStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MySecondStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\StructTrait' => \\facebook\\thrift\\annotation\\hack\\StructTrait::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyThirdStruct\n */\nclass MyThirdStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  use \\CustomTraitName;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 5005397852709472361;\n  /**\n   * Original thrift field:-\n   * 1: string foo\n   */\n  public string $foo;\n\n  public function __construct(?string $foo = null)[] {\n    $this->foo = $foo ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyThirdStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyThirdStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\StructTrait' => \\facebook\\thrift\\annotation\\hack\\StructTrait::fromShape(\n          shape(\n            \"name\" => \"\\\\CustomTraitName\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyFourthStruct\n */\nclass MyFourthStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  use MyFourthStructTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 5005397852709472361;\n  /**\n   * Original thrift field:-\n   * 1: string foo\n   */\n  public string $foo;\n\n  public function __construct(?string $foo = null)[] {\n    $this->foo = $foo ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyFourthStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyFourthStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\StructTrait' => \\facebook\\thrift\\annotation\\hack\\StructTrait::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyFifthStruct\n */\nclass MyFifthStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  use \\CustomTraitName;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 5005397852709472361;\n  /**\n   * Original thrift field:-\n   * 1: string foo\n   */\n  public string $foo;\n\n  public function __construct(?string $foo = null)[] {\n    $this->foo = $foo ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyFifthStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyFifthStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\StructTrait' => \\facebook\\thrift\\annotation\\hack\\StructTrait::fromShape(\n          shape(\n            \"name\" => \"\\\\CustomTraitName\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\ntrait MySixthStructTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?string,\n  );\n\n  static function getStructuralID()[]: int {\n    return 5005397852709472361;\n  }\n  /**\n   * Original thrift field:-\n   * 1: string foo\n   */\n  public string $foo;\n\n  public function __construct(?string $foo = null)[] {\n    $this->foo = $foo ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MySixthStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MySixthStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\StructAsTrait' => \\facebook\\thrift\\annotation\\hack\\StructAsTrait::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\ntrait MySeventhStructTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?string,\n  );\n\n  static function getStructuralID()[]: int {\n    return 5005397852709472361;\n  }\n  /**\n   * Original thrift field:-\n   * 1: string foo\n   */\n  public string $foo;\n\n  public function __construct(?string $foo = null)[] {\n    $this->foo = $foo ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MySeventhStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MySeventhStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\StructAsTrait' => \\facebook\\thrift\\annotation\\hack\\StructAsTrait::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 647}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1228}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace thrift_adapted_types {\ntype i64WithWrapper = int;\n}\nnamespace thrift_adapted_types {\n\n  /**\n   * Original thrift struct:-\n   * StructWithWrapper\n   */\nclass StructWithWrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n    use \\ThriftSerializationTrait;\n\n    const \\ThriftStructTypes::TSpec SPEC = dict[\n      1 => shape(\n        'var' => 'int_field',\n        'type' => \\TType::I64,\n      ),\n    ];\n    const dict<string, int> FIELDMAP = dict[\n      'int_field' => 1,\n    ];\n\n    const type TConstructorShape = shape(\n      ?'int_field' => ?int,\n    );\n\n    const type TShape = shape(\n      'int_field' => int,\n    );\n    const int STRUCTURAL_ID = 8549930382776002541;\n    /**\n     * Original thrift field:-\n     * 1: i64 int_field\n     */\n    public int $int_field;\n\n    public function __construct(?int $int_field = null)[] {\n      $this->int_field = $int_field ?? 0;\n    }\n\n    public static function withDefaultValues()[]: this {\n      return new static();\n    }\n\n    public static function fromShape(self::TConstructorShape $shape)[]: this {\n      return new static(\n        Shapes::idx($shape, 'int_field'),\n      );\n    }\n\n    public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n      return new static(\n        HH\\FIXME\\UNSAFE_CAST<mixed, int>(idx($map, 'int_field'), 'map value is mixed'),\n      );\n    }\n\n    public function getName()[]: string {\n      return 'StructWithWrapper';\n    }\n\n    public function clearTerseFields()[write_props]: void {\n    }\n\n    public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n      return \\tmeta_ThriftStruct::fromShape(\n        shape(\n          \"name\" => \"annotations.StructWithWrapper\",\n          \"fields\" => vec[\n            \\tmeta_ThriftField::fromShape(\n              shape(\n                \"id\" => 1,\n                \"type\" => \\tmeta_ThriftType::fromShape(\n                  shape(\n                    \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                  )\n                ),\n                \"name\" => \"int_field\",\n              )\n            ),\n          ],\n          \"is_union\" => false,\n        )\n      );\n    }\n\n    public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n      return shape(\n        'struct' => dict[\n          '\\facebook\\thrift\\annotation\\hack\\Wrapper' => \\facebook\\thrift\\annotation\\hack\\Wrapper::fromShape(\n            shape(\n              \"name\" => \"\\\\MyStructWrapper\",\n            )\n          ),\n        ],\n        'fields' => dict[\n        ],\n      );\n    }\n\n    public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n      return Dict\\map_keys($m, $key ==> (string)$key);\n    }\n\n    public static function __fromShape(self::TShape $shape)[]: this {\n      return new static(\n        $shape['int_field'],\n      );\n    }\n\n    public function __toShape()[]: self::TShape {\n      return shape(\n        'int_field' => $this->int_field,\n      );\n    }\n    public function getInstanceKey()[write_props]: string {\n      return \\TCompactSerializer::serialize($this);\n    }\n\n    public function readFromJson(string $jsonText): void {\n      $parsed = json_decode($jsonText, true);\n\n      if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n        throw new \\TProtocolException(\"Cannot parse the given json string.\");\n      }\n\n      if (idx($parsed, 'int_field') !== null) {\n        $this->int_field = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['int_field']);\n      }\n    }\n\n  }\n\n\n}\n\n", "num_lines": 144}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nclass annotations_CONSTANTS implements \\IThriftConstants {\n  /**\n   * Original thrift constant:-\n   * map<string, string> MyConst\n   */\n  const dict<string, string> MyConst = dict[\n    \"ENUMERATOR\" => \"enum\",\n    \"CONST\" => \"const\",\n  ];\n\n\n  public static function getAllStructuredAnnotations()[write_props]: dict<string, dict<string, \\IThriftStruct>> {\n    $structured_annotation_recursive0 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive0->name = \"abc_constants\";\n\n    $structured_annotation_recursive1 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive1->name = \"cba_constants\";\n\n    $structured_annotation_recursive0->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive1);\n\n    $structured_annotation_recursive0->default = structured_annotation_with_default::fromShape(\n      shape(\n        \"count\" => 3,\n      )\n    );\n\n    $structured_annotation_recursive2 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive2->name = \"key_constants1\";\n\n    $structured_annotation_recursive3 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive3->name = \"def_constants\";\n\n    $structured_annotation_recursive2->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive3);\n\n    $structured_annotation_recursive4 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive4->name = \"key_constants2\";\n\n    $structured_annotation_recursive5 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive5->name = \"fed_constants\";\n\n    $structured_annotation_recursive4->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive5);\n\n    $structured_annotation_recursive0->recurse_map = dict[\n      \"key_constants1\" => $structured_annotation_recursive2,\n      \"key_constants2\" => $structured_annotation_recursive4,\n    ];\n\n    return dict[\n      'MyConst' => dict[\n        'structured_annotation_recursive' => $structured_annotation_recursive0,\n      ],\n    ];\n  }\n}\n\n", "num_lines": 64}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\ntype StructWithWrapper = \\MyStructWrapper<\\thrift_adapted_types\\StructWithWrapper>;\n/**\n * Original thrift enum:-\n * MyEnum\n */\nenum MyEnum: int {\n  UNKNOWN = 0;\n  ONE = 1;\n}\n\nclass MyEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"annotations.MyEnum\",\n        \"elements\" => dict[\n          0 => \"UNKNOWN\",\n          1 => \"ONE\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    $structured_annotation_recursive0 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive0->name = \"abc_enum\";\n\n    $structured_annotation_recursive1 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive1->name = \"cba_enum\";\n\n    $structured_annotation_recursive0->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive1);\n\n    $structured_annotation_recursive0->default = structured_annotation_with_default::fromShape(\n      shape(\n        \"count\" => 3,\n      )\n    );\n\n    $structured_annotation_recursive2 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive2->name = \"key_enum1\";\n\n    $structured_annotation_recursive3 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive3->name = \"def_enum\";\n\n    $structured_annotation_recursive2->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive3);\n\n    $structured_annotation_recursive4 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive4->name = \"key_enum2\";\n\n    $structured_annotation_recursive5 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive5->name = \"fed_enum\";\n\n    $structured_annotation_recursive4->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive5);\n\n    $structured_annotation_recursive0->recurse_map = dict[\n      \"key_enum1\" => $structured_annotation_recursive2,\n      \"key_enum2\" => $structured_annotation_recursive4,\n    ];\n\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n        'UNKNOWN' => dict[\n          'structured_annotation_recursive' => $structured_annotation_recursive0,\n        ],\n      ],\n    );\n  }\n}\n\ntype i64WithWrapper = \\MyTypeIntWrapper<\\thrift_adapted_types\\i64WithWrapper>;\n/**\n * Original thrift struct:-\n * structured_annotation_with_default\n */\nclass structured_annotation_with_default implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'count',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'count' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'count' => ?int,\n  );\n\n  const type TShape = shape(\n    'count' => int,\n  );\n  const int STRUCTURAL_ID = 1502749363246025945;\n  /**\n   * Original thrift field:-\n   * 1: i32 count\n   */\n  public int $count;\n\n  public function __construct(?int $count = null)[] {\n    $this->count = $count ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'count'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, int>(idx($map, 'count'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'structured_annotation_with_default';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"annotations.structured_annotation_with_default\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"count\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['count'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'count' => $this->count,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'count') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['count']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->count = (int)$_tmp0;\n      }\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * structured_annotation_recursive\n */\nclass structured_annotation_recursive implements \\IThriftAsyncStruct, \\IThriftStructMetadata, \\IThriftShapishAsyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'recurse',\n      'is_wrapped' => true,\n      'type' => \\TType::STRUCT,\n      'class' => structured_annotation_recursive::class,\n    ),\n    3 => shape(\n      'var' => 'default',\n      'type' => \\TType::STRUCT,\n      'class' => structured_annotation_with_default::class,\n    ),\n    4 => shape(\n      'var' => 'recurse_map',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => structured_annotation_recursive::class,\n      ),\n      'format' => 'harray',\n    ),\n    5 => shape(\n      'var' => 'int_field',\n      'is_type_wrapped' => true,\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'recurse' => 2,\n    'default' => 3,\n    'recurse_map' => 4,\n    'int_field' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'recurse' => ?structured_annotation_recursive,\n    ?'default' => ?structured_annotation_with_default,\n    ?'recurse_map' => ?dict<string, structured_annotation_recursive>,\n    ?'int_field' => ?\\thrift_adapted_types\\i64WithWrapper,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    ?'recurse' => ?structured_annotation_recursive::TShape,\n    ?'default' => ?structured_annotation_with_default::TShape,\n    'recurse_map' => dict<arraykey, structured_annotation_recursive::TShape>,\n    'int_field' => \\thrift_adapted_types\\i64WithWrapper,\n  );\n  const int STRUCTURAL_ID = 3145177041506723998;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: annotations.structured_annotation_recursive recurse\n   */\n  private ?MyFieldWrapper<?structured_annotation_recursive, structured_annotation_recursive> $recurse;\n\n  public function get_recurse()[]: MyFieldWrapper<?structured_annotation_recursive, structured_annotation_recursive> {\n    return $this->recurse as nonnull;\n  }\n\n  /**\n   * Original thrift field:-\n   * 3: annotations.structured_annotation_with_default default\n   */\n  public ?structured_annotation_with_default $default;\n  /**\n   * Original thrift field:-\n   * 4: map<string, annotations.structured_annotation_recursive> recurse_map\n   */\n  public dict<string, structured_annotation_recursive> $recurse_map;\n  /**\n   * Original thrift field:-\n   * 5: annotations.i64WithWrapper int_field\n   */\n  public i64WithWrapper $int_field;\n\n  public function set_int_field_DO_NOT_USE_THRIFT_INTERNAL(int $int_field)[write_props]: void {\n    $this->int_field = \\MyTypeIntWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\thrift_adapted_types\\i64WithWrapper>($int_field);\n  }\n\n\n  public function __construct()[] {\n    $this->name = '';\n    $this->recurse_map = dict[];\n    $this->int_field = \\MyTypeIntWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\thrift_adapted_types\\i64WithWrapper>(0);\n    $this->recurse = MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<?structured_annotation_recursive, structured_annotation_recursive>(null, 2, $this);\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static async function genFromShape(self::TConstructorShape $shape)[zoned_shallow]: Awaitable<this> {\n    $obj = new static();\n    $name = Shapes::idx($shape, 'name');\n    if ($name !== null) {\n      $obj->name = $name;\n    }\n    $recurse = Shapes::idx($shape, 'recurse');\n    if ($recurse !== null) {\n      await $obj->get_recurse()->genWrap($recurse);\n    }\n    $default = Shapes::idx($shape, 'default');\n    if ($default !== null) {\n      $obj->default = $default;\n    }\n    $recurse_map = Shapes::idx($shape, 'recurse_map');\n    if ($recurse_map !== null) {\n      $obj->recurse_map = $recurse_map;\n    }\n    $int_field = Shapes::idx($shape, 'int_field');\n    if ($int_field !== null) {\n      $obj->int_field = await \\MyTypeIntWrapper::genFromThrift<\\thrift_adapted_types\\i64WithWrapper>($int_field);\n    }\n    return $obj;\n  }\n\n  public static async function genFromMap_DEPRECATED(@KeyedContainer<string, mixed> $map): Awaitable<this> {\n    $obj = new static();\n    $name = idx($map, 'name');\n    if ($name !== null) {\n      $obj->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($name, 'Map value is mixed');\n    }\n    $recurse = idx($map, 'recurse');\n    if ($recurse !== null) {\n      await $obj->get_recurse()->genWrap(HH\\FIXME\\UNSAFE_CAST<mixed, structured_annotation_recursive>($recurse, 'Map value is mixed'));\n    }\n    $default = idx($map, 'default');\n    if ($default !== null) {\n      $obj->default = HH\\FIXME\\UNSAFE_CAST<mixed, structured_annotation_with_default>($default, 'Map value is mixed');\n    }\n    $recurse_map = idx($map, 'recurse_map');\n    if ($recurse_map !== null) {\n      $obj->recurse_map = HH\\FIXME\\UNSAFE_CAST<mixed, dict<string, structured_annotation_recursive>>($recurse_map, 'Map value is mixed');\n    }\n    $int_field = idx($map, 'int_field');\n    if ($int_field !== null) {\n      $obj->int_field = await \\MyTypeIntWrapper::genFromThrift<\\thrift_adapted_types\\i64WithWrapper>(HH\\FIXME\\UNSAFE_CAST<mixed, \\thrift_adapted_types\\i64WithWrapper>($int_field, 'Map value is mixed'));\n    }\n    return $obj;\n  }\n\n  public function getName()[]: string {\n    return 'structured_annotation_recursive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"annotations.structured_annotation_recursive\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"annotations.structured_annotation_recursive\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"annotations.structured_annotation_recursive\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"recurse\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"annotations.structured_annotation_with_default\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"default\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"annotations.structured_annotation_recursive\",\n                              \"underlyingType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"annotations.structured_annotation_recursive\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"recurse_map\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"annotations.i64WithWrapper\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"int_field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'recurse' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\FieldWrapper' => \\facebook\\thrift\\annotation\\hack\\FieldWrapper::fromShape(\n              shape(\n                \"name\" => \"MyFieldWrapper\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'int_field' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Wrapper' => \\facebook\\thrift\\annotation\\hack\\Wrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyTypeIntWrapper\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static async function __genFromShape(self::TShape $shape): Awaitable<this> {\n    $obj = new static();\n    $obj->name = $shape['name'];\n    $recurse = Shapes::idx($shape, 'recurse');\n    if ($recurse !== null) {\n      $recurse = await structured_annotation_recursive::__genFromShape($recurse);\n      await $obj->get_recurse()->genWrap($recurse);\n    }\n    $default = Shapes::idx($shape, 'default');\n    if ($default !== null) {\n      $obj->default = structured_annotation_with_default::__fromShape($default);\n    }\n    $obj->recurse_map = self::__stringifyMapKeys(\n      await Dict\\map_async(\n        $shape['recurse_map'],\n        async $val0 ==> \n          await structured_annotation_recursive::__genFromShape($val0)\n      )\n    );\n    $obj->int_field = await \\MyTypeIntWrapper::genFromThrift<\\thrift_adapted_types\\i64WithWrapper>($shape['int_field']);\n    return $obj;\n  }\n\n  public async function __genToShape(): Awaitable<self::TShape> {\n    $recurse = await ($this->recurse as nonnull)->genUnwrap();\n    $int_field = await $this->int_field->genUnwrap();\n    return shape(\n      'name' => $this->name,\n      'recurse' => await ($recurse === null \n        ? null \n        : (\n        $recurse->__genToShape()\n        )\n      ),\n      'default' => ($this->default === null \n        ? null \n        : (\n        $this->default->__toShape()\n        )\n      ),\n      'recurse_map' => await Dict\\map_async(\n        $this->recurse_map,\n        async $val0 ==> \n          await $val0->__genToShape()\n      ),\n      'int_field' => $int_field,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'recurse') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, structured_annotation_recursive>($parsed['recurse']));\n      $_tmp1 = structured_annotation_recursive::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->recurse = $_tmp1;\n    }\n    if (idx($parsed, 'default') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, structured_annotation_with_default>($parsed['default']));\n      $_tmp3 = structured_annotation_with_default::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->default = $_tmp3;\n    }\n    if (idx($parsed, 'recurse_map') !== null) {\n      $_json7 = HH\\FIXME\\UNSAFE_CAST<mixed, dict<string, structured_annotation_recursive>>($parsed['recurse_map']);\n      $_container8 = dict[];\n      foreach($_json7 as $_key5 => $_value6) {\n        $_value9 = structured_annotation_recursive::withDefaultValues();\n        $_tmp10 = \\json_encode($_value6);\n        $_tmp11 = structured_annotation_recursive::withDefaultValues();\n        $_tmp11->readFromJson($_tmp10);\n        $_value9 = $_tmp11;\n        $_container8[$_key5] = $_value9;\n      }\n      $this->recurse_map = $_container8;\n    }\n    if (idx($parsed, 'int_field') !== null) {\n      $this->int_field = HH\\FIXME\\UNSAFE_CAST<mixed, i64WithWrapper>($parsed['int_field']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStruct\n */\nclass MyStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'annotated_recursive',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'annotated_struct_wrapper',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'annotated_recursive' => 1,\n    'annotated_struct_wrapper' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'annotated_recursive' => ?string,\n    ?'annotated_struct_wrapper' => ?string,\n  );\n\n  const type TShape = shape(\n    'annotated_recursive' => string,\n    'annotated_struct_wrapper' => string,\n  );\n  const int STRUCTURAL_ID = 589959247947768145;\n  /**\n   * Original thrift field:-\n   * 1: string annotated_recursive\n   */\n  public string $annotated_recursive;\n  /**\n   * Original thrift field:-\n   * 2: string annotated_struct_wrapper\n   */\n  public string $annotated_struct_wrapper;\n\n  public function __construct(?string $annotated_recursive = null, ?string $annotated_struct_wrapper = null)[] {\n    $this->annotated_recursive = $annotated_recursive ?? '';\n    $this->annotated_struct_wrapper = $annotated_struct_wrapper ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'annotated_recursive'),\n      Shapes::idx($shape, 'annotated_struct_wrapper'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'annotated_recursive'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'annotated_struct_wrapper'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"annotations.MyStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"annotated_recursive\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"annotated_struct_wrapper\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    $structured_annotation_recursive0 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive0->name = \"abc_struct\";\n\n    $structured_annotation_recursive1 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive1->name = \"cba_struct\";\n\n    $structured_annotation_recursive0->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive1);\n\n    $structured_annotation_recursive0->default = structured_annotation_with_default::fromShape(\n      shape(\n        \"count\" => 3,\n      )\n    );\n\n    $structured_annotation_recursive2 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive2->name = \"key_struct1\";\n\n    $structured_annotation_recursive3 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive3->name = \"def_struct\";\n\n    $structured_annotation_recursive2->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive3);\n\n    $structured_annotation_recursive4 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive4->name = \"key_struct2\";\n\n    $structured_annotation_recursive5 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive5->name = \"fed_struct\";\n\n    $structured_annotation_recursive4->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive5);\n\n    $structured_annotation_recursive0->recurse_map = dict[\n      \"key_struct1\" => $structured_annotation_recursive2,\n      \"key_struct2\" => $structured_annotation_recursive4,\n    ];\n\n    $structured_annotation_recursive0->int_field = \\MyTypeIntWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\thrift_adapted_types\\i64WithWrapper>(10);\n\n    $structured_annotation_recursive6 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive6->name = \"abc_struct_field\";\n\n    $structured_annotation_recursive7 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive7->name = \"cba_struct_field\";\n\n    $structured_annotation_recursive6->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive7);\n\n    $structured_annotation_recursive6->default = structured_annotation_with_default::fromShape(\n      shape(\n        \"count\" => 3,\n      )\n    );\n\n    $structured_annotation_recursive8 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive8->name = \"key_struct_field1\";\n\n    $structured_annotation_recursive9 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive9->name = \"def_struct_field\";\n\n    $structured_annotation_recursive8->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive9);\n\n    $structured_annotation_recursive10 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive10->name = \"key_struct_field2\";\n\n    $structured_annotation_recursive11 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive11->name = \"fed_struct_field\";\n\n    $structured_annotation_recursive10->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive11);\n\n    $structured_annotation_recursive6->recurse_map = dict[\n      \"key_struct_field1\" => $structured_annotation_recursive8,\n      \"key_struct_field2\" => $structured_annotation_recursive10,\n    ];\n\n    return shape(\n      'struct' => dict[\n        'structured_annotation_recursive' => $structured_annotation_recursive0,\n      ],\n      'fields' => dict[\n        'annotated_recursive' => shape(\n          'field' => dict[\n            'structured_annotation_recursive' => $structured_annotation_recursive6,\n          ],\n          'type' => dict[],\n        ),\n        'annotated_struct_wrapper' => shape(\n          'field' => dict[\n            'StructWithWrapper' => \\thrift_adapted_types\\StructWithWrapper::fromShape(\n              shape(\n                \"int_field\" => 11,\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['annotated_recursive'],\n      $shape['annotated_struct_wrapper'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'annotated_recursive' => $this->annotated_recursive,\n      'annotated_struct_wrapper' => $this->annotated_struct_wrapper,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'annotated_recursive') !== null) {\n      $this->annotated_recursive = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['annotated_recursive']);\n    }\n    if (idx($parsed, 'annotated_struct_wrapper') !== null) {\n      $this->annotated_struct_wrapper = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['annotated_struct_wrapper']);\n    }\n  }\n\n}\n\n", "num_lines": 863}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nclass constants_CONSTANTS implements \\IThriftConstants {\n  /**\n   * Original thrift constant:-\n   * constants.MyCompany my_company\n   */\n  const MyCompany my_company = Company::FACEBOOK;\n\n  /**\n   * Original thrift constant:-\n   * constants.Internship instagram\n   */\n  <<__Memoize>>\n  public static function instagram()[write_props]: Internship{\n    $Internship0 = Internship::withDefaultValues();\n    $Internship0->weeks = 12;\n\n    $Internship0->title = \"Software Engineer\";\n\n    $Internship0->employer = Company::INSTAGRAM;\n\n    $Internship0->get_compensation()->setValue_DO_NOT_USE_THRIFT_INTERNAL(1200.0);\n\n    $Internship0->school = \"Monters University\";\n\n    $Internship0->intern_id = \\MyTypeIntWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\detail\\i64WithWrapper>(10011);\n\n    return $Internship0;\n  }\n\n  /**\n   * Original thrift constant:-\n   * list<constants.Internship> internList\n   */\n  <<__Memoize>>\n  public static function internList()[write_props]: vec<Internship>{\n    $Internship0 = Internship::withDefaultValues();\n    $Internship0->weeks = 12;\n\n    $Internship0->title = \"Software Engineer\";\n\n    $Internship0->employer = Company::INSTAGRAM;\n\n    $Internship0->get_compensation()->setValue_DO_NOT_USE_THRIFT_INTERNAL(1200.0);\n\n    $Internship0->school = \"Monters University\";\n\n    $Internship0->intern_id = \\MyTypeIntWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\detail\\i64WithWrapper>(10011);\n\n    $Internship1 = Internship::withDefaultValues();\n    $Internship1->weeks = 10;\n\n    $Internship1->title = \"Sales Intern\";\n\n    $Internship1->employer = Company::FACEBOOK;\n\n    $Internship1->get_compensation()->setValue_DO_NOT_USE_THRIFT_INTERNAL(1000.0);\n\n    $Internship1->intern_id = \\MyTypeIntWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\detail\\i64WithWrapper>(10013);\n\n    return vec[\n      $Internship0,\n      $Internship1,\n    ];\n  }\n\n  /**\n   * Original thrift constant:-\n   * list<constants.SWE> engineers\n   */\n  <<__Memoize>>\n  public static function engineers()[write_props]: vec<SWE>{\n    return vec[\n      SWE::fromShape(\n        shape(\n          \"employer\" => Company::FACEBOOK,\n          \"compensation\" => 1000.0,\n        )\n      ),\n      SWE::fromShape(\n        shape(\n          \"employer\" => Company::WHATSAPP,\n          \"compensation\" => 1200.0,\n        )\n      ),\n      SWE::fromShape(\n        shape(\n          \"employer\" => Company::OCULUS,\n          \"compensation\" => 1200.0,\n        )\n      ),\n    ];\n  }\n\n  /**\n   * Original thrift constant:-\n   * list<include.StructWithWrapper> wrapped_structs\n   */\n  <<__Memoize>>\n  public static function wrapped_structs()[write_props]: vec<StructWithWrapper>{\n    return vec[\n      \\MyStructWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\thrift_adapted_types\\StructWithWrapper>(\\thrift_adapted_types\\StructWithWrapper::fromShape(\n        shape(\n          \"int_field\" => 1,\n        )\n      )),\n      \\MyStructWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\thrift_adapted_types\\StructWithWrapper>(\\thrift_adapted_types\\StructWithWrapper::fromShape(\n        shape(\n          \"int_field\" => 2,\n        )\n      )),\n    ];\n  }\n\n  /**\n   * Original thrift constant:-\n   * list<include.i64WithWrapper> wrapped_ints\n   */\n  <<__Memoize>>\n  public static function wrapped_ints()[write_props]: vec<i64WithWrapper>{\n    return vec[\n      \\MyTypeIntWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\detail\\i64WithWrapper>(1),\n      \\MyTypeIntWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\detail\\i64WithWrapper>(2),\n    ];\n  }\n\n\n  public static function getAllStructuredAnnotations()[write_props]: dict<string, dict<string, \\IThriftStruct>> {\n    return dict[\n      'engineers' => dict[\n        'AnnotationStruct' => AnnotationStruct::fromShape(\n          shape(\n          )\n        ),\n      ],\n    ];\n  }\n}\n\n", "num_lines": 147}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift enum:-\n * Company\n */\nenum Company: int {\n  FACEBOOK = 0;\n  WHATSAPP = 1;\n  OCULUS = 2;\n  INSTAGRAM = 3;\n}\n\nclass Company_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"constants.Company\",\n        \"elements\" => dict[\n          0 => \"FACEBOOK\",\n          1 => \"WHATSAPP\",\n          2 => \"OCULUS\",\n          3 => \"INSTAGRAM\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n        'FACEBOOK' => dict[\n          'AnnotationStruct' => AnnotationStruct::fromShape(\n            shape(\n            )\n          ),\n        ],\n      ],\n    );\n  }\n}\n\ntype MyCompany = Company;\n/**\n * Original thrift struct:-\n * Internship\n */\nclass Internship implements \\IThriftAsyncStruct, \\IThriftStructMetadata, \\IThriftShapishAsyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'weeks',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'title',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'employer',\n      'type' => \\TType::I32,\n      'enum' => Company::class,\n    ),\n    4 => shape(\n      'var' => 'compensation',\n      'is_wrapped' => true,\n      'type' => \\TType::DOUBLE,\n    ),\n    5 => shape(\n      'var' => 'school',\n      'type' => \\TType::STRING,\n    ),\n    6 => shape(\n      'var' => 'intern_id',\n      'is_type_wrapped' => true,\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'weeks' => 1,\n    'title' => 2,\n    'employer' => 3,\n    'compensation' => 4,\n    'school' => 5,\n    'intern_id' => 6,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'weeks' => ?int,\n    ?'title' => ?string,\n    ?'employer' => ?Company,\n    ?'compensation' => ?float,\n    ?'school' => ?string,\n    ?'intern_id' => ?\\detail\\i64WithWrapper,\n  );\n\n  const type TShape = shape(\n    'weeks' => int,\n    'title' => string,\n    ?'employer' => ?Company,\n    ?'compensation' => ?float,\n    ?'school' => ?string,\n    'intern_id' => \\detail\\i64WithWrapper,\n  );\n  const int STRUCTURAL_ID = 2043029874796299989;\n  /**\n   * Original thrift field:-\n   * 1: i32 weeks\n   */\n  public int $weeks;\n  /**\n   * Original thrift field:-\n   * 2: string title\n   */\n  public string $title;\n  /**\n   * Original thrift field:-\n   * 3: constants.Company employer\n   */\n  public ?Company $employer;\n  /**\n   * Original thrift field:-\n   * 4: double compensation\n   */\n  private ?\\MyFieldWrapper<?float, Internship> $compensation;\n\n  public function get_compensation()[]: \\MyFieldWrapper<?float, Internship> {\n    return $this->compensation as nonnull;\n  }\n\n  /**\n   * Original thrift field:-\n   * 5: string school\n   */\n  public ?string $school;\n  /**\n   * Original thrift field:-\n   * 6: include.i64WithWrapper intern_id\n   */\n  public i64WithWrapper $intern_id;\n\n  public function set_intern_id_DO_NOT_USE_THRIFT_INTERNAL(int $intern_id)[write_props]: void {\n    $this->intern_id = \\MyTypeIntWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\detail\\i64WithWrapper>($intern_id);\n  }\n\n\n  public function __construct()[] {\n    $this->weeks = 0;\n    $this->title = '';\n    $this->intern_id = \\MyTypeIntWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\detail\\i64WithWrapper>(0);\n    $this->compensation = \\MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<?float, Internship>(null, 4, $this);\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static async function genFromShape(self::TConstructorShape $shape)[zoned_shallow]: Awaitable<this> {\n    $obj = new static();\n    $weeks = Shapes::idx($shape, 'weeks');\n    if ($weeks !== null) {\n      $obj->weeks = $weeks;\n    }\n    $title = Shapes::idx($shape, 'title');\n    if ($title !== null) {\n      $obj->title = $title;\n    }\n    $employer = Shapes::idx($shape, 'employer');\n    if ($employer !== null) {\n      $obj->employer = $employer;\n    }\n    $compensation = Shapes::idx($shape, 'compensation');\n    if ($compensation !== null) {\n      await $obj->get_compensation()->genWrap($compensation);\n    }\n    $school = Shapes::idx($shape, 'school');\n    if ($school !== null) {\n      $obj->school = $school;\n    }\n    $intern_id = Shapes::idx($shape, 'intern_id');\n    if ($intern_id !== null) {\n      $obj->intern_id = await \\MyTypeIntWrapper::genFromThrift<\\detail\\i64WithWrapper>($intern_id);\n    }\n    return $obj;\n  }\n\n  public static async function genFromMap_DEPRECATED(@KeyedContainer<string, mixed> $map): Awaitable<this> {\n    $obj = new static();\n    $weeks = idx($map, 'weeks');\n    if ($weeks !== null) {\n      $obj->weeks = HH\\FIXME\\UNSAFE_CAST<mixed, int>($weeks, 'Map value is mixed');\n    }\n    $title = idx($map, 'title');\n    if ($title !== null) {\n      $obj->title = HH\\FIXME\\UNSAFE_CAST<mixed, string>($title, 'Map value is mixed');\n    }\n    $employer = idx($map, 'employer');\n    if ($employer !== null) {\n      $obj->employer = HH\\FIXME\\UNSAFE_CAST<mixed, Company>($employer, 'Map value is mixed');\n    }\n    $compensation = idx($map, 'compensation');\n    if ($compensation !== null) {\n      await $obj->get_compensation()->genWrap(HH\\FIXME\\UNSAFE_CAST<mixed, float>($compensation, 'Map value is mixed'));\n    }\n    $school = idx($map, 'school');\n    if ($school !== null) {\n      $obj->school = HH\\FIXME\\UNSAFE_CAST<mixed, string>($school, 'Map value is mixed');\n    }\n    $intern_id = idx($map, 'intern_id');\n    if ($intern_id !== null) {\n      $obj->intern_id = await \\MyTypeIntWrapper::genFromThrift<\\detail\\i64WithWrapper>(HH\\FIXME\\UNSAFE_CAST<mixed, \\detail\\i64WithWrapper>($intern_id, 'Map value is mixed'));\n    }\n    return $obj;\n  }\n\n  public function getName()[]: string {\n    return 'Internship';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"constants.Internship\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"weeks\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"title\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"constants.Company\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"employer\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"compensation\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"school\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"include.i64WithWrapper\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"intern_id\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'compensation' => shape(\n          'field' => dict[\n            'AnnotationStruct' => AnnotationStruct::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'intern_id' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Wrapper' => \\facebook\\thrift\\annotation\\hack\\Wrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyTypeIntWrapper\",\n                \"extraNamespace\" => \"detail\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static async function __genFromShape(self::TShape $shape): Awaitable<this> {\n    $obj = new static();\n    $obj->weeks = $shape['weeks'];\n    $obj->title = $shape['title'];\n    $employer = Shapes::idx($shape, 'employer');\n    if ($employer !== null) {\n      $obj->employer = $employer;\n    }\n    $compensation = Shapes::idx($shape, 'compensation');\n    if ($compensation !== null) {\n      await $obj->get_compensation()->genWrap($compensation);\n    }\n    $school = Shapes::idx($shape, 'school');\n    if ($school !== null) {\n      $obj->school = $school;\n    }\n    $obj->intern_id = await \\MyTypeIntWrapper::genFromThrift<\\detail\\i64WithWrapper>($shape['intern_id']);\n    return $obj;\n  }\n\n  public async function __genToShape(): Awaitable<self::TShape> {\n    $compensation = await ($this->compensation as nonnull)->genUnwrap();\n    $intern_id = await $this->intern_id->genUnwrap();\n    return shape(\n      'weeks' => $this->weeks,\n      'title' => $this->title,\n      'employer' => $this->employer,\n      'compensation' => $compensation,\n      'school' => $this->school,\n      'intern_id' => $intern_id,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'weeks') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['weeks']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->weeks = (int)$_tmp0;\n      }\n    } else {\n      throw new \\TProtocolException(\"Required field weeks cannot be found.\");\n    }\n    if (idx($parsed, 'title') !== null) {\n      $this->title = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['title']);\n    }\n    if (idx($parsed, 'employer') !== null) {\n      $this->employer = Company::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, Company>($parsed['employer']));\n    }\n    if (idx($parsed, 'compensation') !== null) {\n      $this->compensation = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['compensation']);\n    }\n    if (idx($parsed, 'school') !== null) {\n      $this->school = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['school']);\n    }\n    if (idx($parsed, 'intern_id') !== null) {\n      $this->intern_id = HH\\FIXME\\UNSAFE_CAST<mixed, i64WithWrapper>($parsed['intern_id']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * SWE\n */\nclass SWE implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'employer',\n      'type' => \\TType::I32,\n      'enum' => Company::class,\n    ),\n    2 => shape(\n      'var' => 'compensation',\n      'type' => \\TType::DOUBLE,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'employer' => 1,\n    'compensation' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'employer' => ?Company,\n    ?'compensation' => ?float,\n  );\n\n  const type TShape = shape(\n    ?'employer' => ?Company,\n    ?'compensation' => ?float,\n  );\n  const int STRUCTURAL_ID = 1922683334218183646;\n  /**\n   * Original thrift field:-\n   * 1: constants.Company employer\n   */\n  public ?Company $employer;\n  /**\n   * Original thrift field:-\n   * 2: double compensation\n   */\n  public ?float $compensation;\n\n  public function __construct(?Company $employer = null, ?float $compensation = null)[] {\n    $this->employer = $employer;\n    $this->compensation = $compensation;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'employer'),\n      Shapes::idx($shape, 'compensation'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, Company>(idx($map, 'employer'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, float>(idx($map, 'compensation'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SWE';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"constants.SWE\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"constants.Company\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"employer\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"compensation\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'employer'),\n      Shapes::idx($shape, 'compensation'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'employer' => $this->employer,\n      'compensation' => $this->compensation,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'employer') !== null) {\n      $this->employer = Company::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, Company>($parsed['employer']));\n    }\n    if (idx($parsed, 'compensation') !== null) {\n      $this->compensation = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['compensation']);\n    }\n  }\n\n}\n\n", "num_lines": 587}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\hack;\n\n/**\n * Original thrift struct:-\n * FieldWrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/FieldWrapper'))>>\nclass FieldWrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'name'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldWrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.FieldWrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Wrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Wrapper'))>>\nclass Wrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'underlyingName',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'extraNamespace',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'underlyingName' => 2,\n    'extraNamespace' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'underlyingName' => ?string,\n    ?'extraNamespace' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'underlyingName' => string,\n    'extraNamespace' => string,\n  );\n  const int STRUCTURAL_ID = 1284986773698322040;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string underlyingName\n   */\n  public string $underlyingName;\n  /**\n   * Original thrift field:-\n   * 3: string extraNamespace\n   */\n  public string $extraNamespace;\n\n  public function __construct(?string $name = null, ?string $underlyingName = null, ?string $extraNamespace = null)[] {\n    $this->name = $name ?? '';\n    $this->underlyingName = $underlyingName ?? '';\n    $this->extraNamespace = $extraNamespace ?? \"thrift_adapted_types\";\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'underlyingName'),\n      Shapes::idx($shape, 'extraNamespace'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'name'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'underlyingName'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'extraNamespace'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Wrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Wrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"underlyingName\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"extraNamespace\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['underlyingName'],\n      $shape['extraNamespace'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'underlyingName' => $this->underlyingName,\n      'extraNamespace' => $this->extraNamespace,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'underlyingName') !== null) {\n      $this->underlyingName = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['underlyingName']);\n    }\n    if (idx($parsed, 'extraNamespace') !== null) {\n      $this->extraNamespace = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['extraNamespace']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'name'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * SkipCodegen\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/SkipCodegen'))>>\nclass SkipCodegen implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'reason' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'reason' => ?string,\n  );\n\n  const type TShape = shape(\n    'reason' => string,\n  );\n  const int STRUCTURAL_ID = 3707764047816594739;\n  /**\n   * Original thrift field:-\n   * 1: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $reason = null)[] {\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'reason'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SkipCodegen';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.SkipCodegen\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['reason'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'reason' => $this->reason,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'reason') !== null) {\n      $this->reason = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['reason']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Name\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Name'))>>\nclass Name implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'reason' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'reason' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'reason' => string,\n  );\n  const int STRUCTURAL_ID = 4844827548325959202;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $name = null, ?string $reason = null)[] {\n    $this->name = $name ?? '';\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'name'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'reason'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Name';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Name\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['reason'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'reason' => $this->reason,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'reason') !== null) {\n      $this->reason = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['reason']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * UnionEnumAttributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/UnionEnumAttributes'))>>\nclass UnionEnumAttributes implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'harray',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?vec<string>,\n  );\n\n  const type TShape = shape(\n    'attributes' => vec<string>,\n  );\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public vec<string> $attributes;\n\n  public function __construct(?vec<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? vec[];\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, vec<string>>(idx($map, 'attributes'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'UnionEnumAttributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.UnionEnumAttributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['attributes'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'attributes' => $this->attributes,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'attributes') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, vec<string>>($parsed['attributes']);\n      $_container4 = vec[];\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = '';\n        $_elem5 = $_value2;\n        $_container4 []= $_elem5;\n      }\n      $this->attributes = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructTrait'))>>\nclass StructTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'name'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructTrait\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Attributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Attributes'))>>\nclass Attributes implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'harray',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?vec<string>,\n  );\n\n  const type TShape = shape(\n    'attributes' => vec<string>,\n  );\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public vec<string> $attributes;\n\n  public function __construct(?vec<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? vec[];\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, vec<string>>(idx($map, 'attributes'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Attributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Attributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['attributes'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'attributes' => $this->attributes,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'attributes') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, vec<string>>($parsed['attributes']);\n      $_container4 = vec[];\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = '';\n        $_elem5 = $_value2;\n        $_container4 []= $_elem5;\n      }\n      $this->attributes = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructAsTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructAsTrait'))>>\nclass StructAsTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructAsTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructAsTrait\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ModuleInternal\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/ModuleInternal'))>>\nclass ModuleInternal implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ModuleInternal';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.ModuleInternal\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1398}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace detail {\ntype i64WithWrapper = int;\n}\nnamespace thrift_adapted_types {\n\n  /**\n   * Original thrift struct:-\n   * StructWithWrapper\n   */\nclass StructWithWrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n    use \\ThriftSerializationTrait;\n\n    const \\ThriftStructTypes::TSpec SPEC = dict[\n      1 => shape(\n        'var' => 'int_field',\n        'type' => \\TType::I64,\n      ),\n    ];\n    const dict<string, int> FIELDMAP = dict[\n      'int_field' => 1,\n    ];\n\n    const type TConstructorShape = shape(\n      ?'int_field' => ?int,\n    );\n\n    const type TShape = shape(\n      'int_field' => int,\n    );\n    const int STRUCTURAL_ID = 8549930382776002541;\n    /**\n     * Original thrift field:-\n     * 1: i64 int_field\n     */\n    public int $int_field;\n\n    public function __construct(?int $int_field = null)[] {\n      $this->int_field = $int_field ?? 0;\n    }\n\n    public static function withDefaultValues()[]: this {\n      return new static();\n    }\n\n    public static function fromShape(self::TConstructorShape $shape)[]: this {\n      return new static(\n        Shapes::idx($shape, 'int_field'),\n      );\n    }\n\n    public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n      return new static(\n        HH\\FIXME\\UNSAFE_CAST<mixed, int>(idx($map, 'int_field'), 'map value is mixed'),\n      );\n    }\n\n    public function getName()[]: string {\n      return 'StructWithWrapper';\n    }\n\n    public function clearTerseFields()[write_props]: void {\n    }\n\n    public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n      return \\tmeta_ThriftStruct::fromShape(\n        shape(\n          \"name\" => \"include.StructWithWrapper\",\n          \"fields\" => vec[\n            \\tmeta_ThriftField::fromShape(\n              shape(\n                \"id\" => 1,\n                \"type\" => \\tmeta_ThriftType::fromShape(\n                  shape(\n                    \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                  )\n                ),\n                \"name\" => \"int_field\",\n              )\n            ),\n          ],\n          \"is_union\" => false,\n        )\n      );\n    }\n\n    public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n      return shape(\n        'struct' => dict[\n          '\\facebook\\thrift\\annotation\\hack\\Wrapper' => \\facebook\\thrift\\annotation\\hack\\Wrapper::fromShape(\n            shape(\n              \"name\" => \"\\\\MyStructWrapper\",\n            )\n          ),\n        ],\n        'fields' => dict[\n        ],\n      );\n    }\n\n    public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n      return Dict\\map_keys($m, $key ==> (string)$key);\n    }\n\n    public static function __fromShape(self::TShape $shape)[]: this {\n      return new static(\n        $shape['int_field'],\n      );\n    }\n\n    public function __toShape()[]: self::TShape {\n      return shape(\n        'int_field' => $this->int_field,\n      );\n    }\n    public function getInstanceKey()[write_props]: string {\n      return \\TCompactSerializer::serialize($this);\n    }\n\n    public function readFromJson(string $jsonText): void {\n      $parsed = json_decode($jsonText, true);\n\n      if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n        throw new \\TProtocolException(\"Cannot parse the given json string.\");\n      }\n\n      if (idx($parsed, 'int_field') !== null) {\n        $this->int_field = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['int_field']);\n      }\n    }\n\n  }\n\n\n}\n\n", "num_lines": 144}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\ntype StructWithWrapper = \\MyStructWrapper<\\thrift_adapted_types\\StructWithWrapper>;\ntype i64WithAdapter = \\MyAdapterInt::THackType;\ntype i64WithWrapper = \\MyTypeIntWrapper<\\detail\\i64WithWrapper>;\ntype AdaptedMap = \\MyAdapter1::THackType;\ntype AdaptedStruct = \\MyAdapter1::THackType;\n/**\n * Original thrift struct:-\n * AnnotationStruct\n */\nclass AnnotationStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AnnotationStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"include.AnnotationStruct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\hack\\Wrapper' => \\facebook\\thrift\\annotation\\hack\\Wrapper::fromShape(\n          shape(\n            \"name\" => \"\\\\MyFieldWrapper\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStruct\n */\nclass MyStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishAsyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'nested_struct',\n      'type' => \\TType::STRUCT,\n      'class' => MyNestedStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'nested_struct' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'nested_struct' => ?MyNestedStruct,\n  );\n\n  const type TShape = shape(\n    ?'nested_struct' => ?MyNestedStruct::TShape,\n  );\n  const int STRUCTURAL_ID = 6466034702854646588;\n  /**\n   * Original thrift field:-\n   * 1: include.MyNestedStruct nested_struct\n   */\n  public ?MyNestedStruct $nested_struct;\n\n  public function __construct(?MyNestedStruct $nested_struct = null)[] {\n    $this->nested_struct = $nested_struct;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'nested_struct'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, MyNestedStruct>(idx($map, 'nested_struct'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"include.MyStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"include.MyNestedStruct\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"include.MyNestedStruct\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"nested_struct\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static async function __genFromShape(self::TShape $shape): Awaitable<this> {\n    $obj = new static();\n    $nested_struct = Shapes::idx($shape, 'nested_struct');\n    if ($nested_struct !== null) {\n      $obj->nested_struct = await MyNestedStruct::__genFromShape($nested_struct);\n    }\n    return $obj;\n  }\n\n  public async function __genToShape(): Awaitable<self::TShape> {\n    return shape(\n      'nested_struct' => await ($this->nested_struct === null \n        ? null \n        : (\n        $this->nested_struct->__genToShape()\n        )\n      ),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'nested_struct') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, MyNestedStruct>($parsed['nested_struct']));\n      $_tmp1 = MyNestedStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->nested_struct = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyNestedStruct\n */\nclass MyNestedStruct implements \\IThriftAsyncStruct, \\IThriftStructMetadata, \\IThriftShapishAsyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'wrapped_field',\n      'is_wrapped' => true,\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'annotated_field',\n      'is_wrapped' => true,\n      'type' => \\TType::I64,\n    ),\n    3 => shape(\n      'var' => 'adapted_type',\n      'adapter' => \\MyAdapter1::class,\n      'type' => \\TType::I64,\n    ),\n    4 => shape(\n      'var' => 'adapted__and_wrapped_type',\n      'is_wrapped' => true,\n      'adapter' => \\MyAdapter1::class,\n      'type' => \\TType::I64,\n    ),\n    5 => shape(\n      'var' => 'optional_adapted_and_wrapped_type',\n      'is_wrapped' => true,\n      'adapter' => \\MyAdapterInt::class,\n      'type' => \\TType::I64,\n    ),\n    7 => shape(\n      'var' => 'wrapped_type_int',\n      'is_wrapped' => true,\n      'is_type_wrapped' => true,\n      'type' => \\TType::I64,\n    ),\n    8 => shape(\n      'var' => 'double_wrapped_struct',\n      'is_wrapped' => true,\n      'is_type_wrapped' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\thrift_adapted_types\\StructWithWrapper::class,\n    ),\n    9 => shape(\n      'var' => 'optional_adapted_and_wrapped_type_map',\n      'is_wrapped' => true,\n      'adapter' => \\MyAdapter1::class,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => MyStruct::class,\n      ),\n      'format' => 'harray',\n    ),\n    10 => shape(\n      'var' => 'optional_adapted_and_wrapped_type_struct',\n      'is_wrapped' => true,\n      'adapter' => \\MyAdapter1::class,\n      'type' => \\TType::STRUCT,\n      'class' => MyStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'wrapped_field' => 1,\n    'annotated_field' => 2,\n    'adapted_type' => 3,\n    'adapted__and_wrapped_type' => 4,\n    'optional_adapted_and_wrapped_type' => 5,\n    'wrapped_type_int' => 7,\n    'double_wrapped_struct' => 8,\n    'optional_adapted_and_wrapped_type_map' => 9,\n    'optional_adapted_and_wrapped_type_struct' => 10,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'wrapped_field' => ?int,\n    ?'annotated_field' => ?int,\n    ?'adapted_type' => ?\\MyAdapter1::THackType,\n    ?'adapted__and_wrapped_type' => ?\\MyAdapter1::THackType,\n    ?'optional_adapted_and_wrapped_type' => ?i64WithAdapter,\n    ?'wrapped_type_int' => ?\\detail\\i64WithWrapper,\n    ?'double_wrapped_struct' => ?\\thrift_adapted_types\\StructWithWrapper,\n    ?'optional_adapted_and_wrapped_type_map' => ?AdaptedMap,\n    ?'optional_adapted_and_wrapped_type_struct' => ?AdaptedStruct,\n  );\n\n  const type TShape = shape(\n    'wrapped_field' => int,\n    'annotated_field' => int,\n    'adapted_type' => \\MyAdapter1::THackType,\n    'adapted__and_wrapped_type' => \\MyAdapter1::THackType,\n    ?'optional_adapted_and_wrapped_type' => ?i64WithAdapter,\n    'wrapped_type_int' => \\detail\\i64WithWrapper,\n    ?'double_wrapped_struct' => ?\\thrift_adapted_types\\StructWithWrapper::TShape,\n    ?'optional_adapted_and_wrapped_type_map' => ?AdaptedMap,\n    ?'optional_adapted_and_wrapped_type_struct' => ?AdaptedStruct,\n  );\n  const int STRUCTURAL_ID = 4891388107170377575;\n  /**\n   * Original thrift field:-\n   * 1: i64 wrapped_field\n   */\n  private ?\\MyFieldWrapper<int, MyNestedStruct> $wrapped_field;\n\n  public function get_wrapped_field()[]: \\MyFieldWrapper<int, MyNestedStruct> {\n    return $this->wrapped_field as nonnull;\n  }\n\n  /**\n   * Original thrift field:-\n   * 2: i64 annotated_field\n   */\n  private ?\\MyFieldWrapper<int, MyNestedStruct> $annotated_field;\n\n  public function get_annotated_field()[]: \\MyFieldWrapper<int, MyNestedStruct> {\n    return $this->annotated_field as nonnull;\n  }\n\n  /**\n   * Original thrift field:-\n   * 3: i64 adapted_type\n   */\n  public \\MyAdapter1::THackType $adapted_type;\n  /**\n   * Original thrift field:-\n   * 4: i64 adapted__and_wrapped_type\n   */\n  private ?\\MyFieldWrapper<\\MyAdapter1::THackType, MyNestedStruct> $adapted__and_wrapped_type;\n\n  public function get_adapted__and_wrapped_type()[]: \\MyFieldWrapper<\\MyAdapter1::THackType, MyNestedStruct> {\n    return $this->adapted__and_wrapped_type as nonnull;\n  }\n\n  /**\n   * Original thrift field:-\n   * 5: include.i64WithAdapter optional_adapted_and_wrapped_type\n   */\n  private ?\\MyFieldWrapper<?i64WithAdapter, MyNestedStruct> $optional_adapted_and_wrapped_type;\n\n  public function get_optional_adapted_and_wrapped_type()[]: \\MyFieldWrapper<?i64WithAdapter, MyNestedStruct> {\n    return $this->optional_adapted_and_wrapped_type as nonnull;\n  }\n\n  /**\n   * Original thrift field:-\n   * 7: include.i64WithWrapper wrapped_type_int\n   */\n  private ?\\MyFieldWrapper<i64WithWrapper, MyNestedStruct> $wrapped_type_int;\n\n  public function get_wrapped_type_int()[]: \\MyFieldWrapper<i64WithWrapper, MyNestedStruct> {\n    return $this->wrapped_type_int as nonnull;\n  }\n\n\n  public function set_wrapped_type_int_DO_NOT_USE_THRIFT_INTERNAL(int $wrapped_type_int)[write_props]: void {\n    $wrapped_type_int = \\MyTypeIntWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\detail\\i64WithWrapper>($wrapped_type_int);\n    $this->get_wrapped_type_int()->setValue_DO_NOT_USE_THRIFT_INTERNAL($wrapped_type_int);\n  }\n\n  /**\n   * Original thrift field:-\n   * 8: include.StructWithWrapper double_wrapped_struct\n   */\n  private ?\\MyFieldWrapper<?StructWithWrapper, MyNestedStruct> $double_wrapped_struct;\n\n  public function get_double_wrapped_struct()[]: \\MyFieldWrapper<?StructWithWrapper, MyNestedStruct> {\n    return $this->double_wrapped_struct as nonnull;\n  }\n\n\n  public function set_double_wrapped_struct_DO_NOT_USE_THRIFT_INTERNAL(\\thrift_adapted_types\\StructWithWrapper $double_wrapped_struct)[write_props]: void {\n    $double_wrapped_struct = \\MyStructWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\thrift_adapted_types\\StructWithWrapper>($double_wrapped_struct);\n    $this->get_double_wrapped_struct()->setValue_DO_NOT_USE_THRIFT_INTERNAL($double_wrapped_struct);\n  }\n\n  /**\n   * Original thrift field:-\n   * 9: include.AdaptedMap optional_adapted_and_wrapped_type_map\n   */\n  private ?\\MyFieldWrapper<?AdaptedMap, MyNestedStruct> $optional_adapted_and_wrapped_type_map;\n\n  public function get_optional_adapted_and_wrapped_type_map()[]: \\MyFieldWrapper<?AdaptedMap, MyNestedStruct> {\n    return $this->optional_adapted_and_wrapped_type_map as nonnull;\n  }\n\n  /**\n   * Original thrift field:-\n   * 10: include.AdaptedStruct optional_adapted_and_wrapped_type_struct\n   */\n  private ?\\MyFieldWrapper<?AdaptedStruct, MyNestedStruct> $optional_adapted_and_wrapped_type_struct;\n\n  public function get_optional_adapted_and_wrapped_type_struct()[]: \\MyFieldWrapper<?AdaptedStruct, MyNestedStruct> {\n    return $this->optional_adapted_and_wrapped_type_struct as nonnull;\n  }\n\n\n  public function __construct()[] {\n    $this->adapted_type = \\MyAdapter1::fromThrift(0);\n    $this->wrapped_field = \\MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<int, MyNestedStruct>(0, 1, $this);\n    $this->annotated_field = \\MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<int, MyNestedStruct>(0, 2, $this);\n    $this->adapted__and_wrapped_type = \\MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\MyAdapter1::THackType, MyNestedStruct>(\\MyAdapter1::fromThrift(0), 4, $this);\n    $this->optional_adapted_and_wrapped_type = \\MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<?\\MyAdapterInt::THackType, MyNestedStruct>(null, 5, $this);\n    $this->wrapped_type_int = \\MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<i64WithWrapper, MyNestedStruct>(\\MyTypeIntWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\detail\\i64WithWrapper>(0), 7, $this);\n    $this->double_wrapped_struct = \\MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<?StructWithWrapper, MyNestedStruct>(null, 8, $this);\n    $this->optional_adapted_and_wrapped_type_map = \\MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<?\\MyAdapter1::THackType, MyNestedStruct>(null, 9, $this);\n    $this->optional_adapted_and_wrapped_type_struct = \\MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<?\\MyAdapter1::THackType, MyNestedStruct>(null, 10, $this);\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static async function genFromShape(self::TConstructorShape $shape)[zoned_shallow]: Awaitable<this> {\n    $obj = new static();\n    $wrapped_field = Shapes::idx($shape, 'wrapped_field');\n    if ($wrapped_field !== null) {\n      await $obj->get_wrapped_field()->genWrap($wrapped_field);\n    }\n    $annotated_field = Shapes::idx($shape, 'annotated_field');\n    if ($annotated_field !== null) {\n      await $obj->get_annotated_field()->genWrap($annotated_field);\n    }\n    $adapted_type = Shapes::idx($shape, 'adapted_type');\n    if ($adapted_type !== null) {\n      $obj->adapted_type = $adapted_type;\n    }\n    $adapted__and_wrapped_type = Shapes::idx($shape, 'adapted__and_wrapped_type');\n    if ($adapted__and_wrapped_type !== null) {\n      await $obj->get_adapted__and_wrapped_type()->genWrap($adapted__and_wrapped_type);\n    }\n    $optional_adapted_and_wrapped_type = Shapes::idx($shape, 'optional_adapted_and_wrapped_type');\n    if ($optional_adapted_and_wrapped_type !== null) {\n      await $obj->get_optional_adapted_and_wrapped_type()->genWrap($optional_adapted_and_wrapped_type);\n    }\n    $wrapped_type_int = Shapes::idx($shape, 'wrapped_type_int');\n    if ($wrapped_type_int !== null) {\n      $wrapped_type_int = await \\MyTypeIntWrapper::genFromThrift<\\detail\\i64WithWrapper>($wrapped_type_int);\n      await $obj->get_wrapped_type_int()->genWrap($wrapped_type_int);\n    }\n    $double_wrapped_struct = Shapes::idx($shape, 'double_wrapped_struct');\n    if ($double_wrapped_struct !== null) {\n      $double_wrapped_struct = await \\MyStructWrapper::genFromThrift<\\thrift_adapted_types\\StructWithWrapper>($double_wrapped_struct);\n      await $obj->get_double_wrapped_struct()->genWrap($double_wrapped_struct);\n    }\n    $optional_adapted_and_wrapped_type_map = Shapes::idx($shape, 'optional_adapted_and_wrapped_type_map');\n    if ($optional_adapted_and_wrapped_type_map !== null) {\n      await $obj->get_optional_adapted_and_wrapped_type_map()->genWrap($optional_adapted_and_wrapped_type_map);\n    }\n    $optional_adapted_and_wrapped_type_struct = Shapes::idx($shape, 'optional_adapted_and_wrapped_type_struct');\n    if ($optional_adapted_and_wrapped_type_struct !== null) {\n      await $obj->get_optional_adapted_and_wrapped_type_struct()->genWrap($optional_adapted_and_wrapped_type_struct);\n    }\n    return $obj;\n  }\n\n  public static async function genFromMap_DEPRECATED(@KeyedContainer<string, mixed> $map): Awaitable<this> {\n    $obj = new static();\n    $wrapped_field = idx($map, 'wrapped_field');\n    if ($wrapped_field !== null) {\n      await $obj->get_wrapped_field()->genWrap(HH\\FIXME\\UNSAFE_CAST<mixed, int>($wrapped_field, 'Map value is mixed'));\n    }\n    $annotated_field = idx($map, 'annotated_field');\n    if ($annotated_field !== null) {\n      await $obj->get_annotated_field()->genWrap(HH\\FIXME\\UNSAFE_CAST<mixed, int>($annotated_field, 'Map value is mixed'));\n    }\n    $adapted_type = idx($map, 'adapted_type');\n    if ($adapted_type !== null) {\n      $obj->adapted_type = HH\\FIXME\\UNSAFE_CAST<mixed, int>($adapted_type, 'Map value is mixed');\n    }\n    $adapted__and_wrapped_type = idx($map, 'adapted__and_wrapped_type');\n    if ($adapted__and_wrapped_type !== null) {\n      await $obj->get_adapted__and_wrapped_type()->genWrap(HH\\FIXME\\UNSAFE_CAST<mixed, int>($adapted__and_wrapped_type, 'Map value is mixed'));\n    }\n    $optional_adapted_and_wrapped_type = idx($map, 'optional_adapted_and_wrapped_type');\n    if ($optional_adapted_and_wrapped_type !== null) {\n      await $obj->get_optional_adapted_and_wrapped_type()->genWrap(HH\\FIXME\\UNSAFE_CAST<mixed, i64WithAdapter>($optional_adapted_and_wrapped_type, 'Map value is mixed'));\n    }\n    $wrapped_type_int = idx($map, 'wrapped_type_int');\n    if ($wrapped_type_int !== null) {\n      $wrapped_type_int = await \\MyTypeIntWrapper::genFromThrift<\\detail\\i64WithWrapper>(HH\\FIXME\\UNSAFE_CAST<mixed, \\detail\\i64WithWrapper>($wrapped_type_int, 'Map value is mixed'));\n      await $obj->get_wrapped_type_int()->genWrap($wrapped_type_int);\n    }\n    $double_wrapped_struct = idx($map, 'double_wrapped_struct');\n    if ($double_wrapped_struct !== null) {\n      $double_wrapped_struct = await \\MyStructWrapper::genFromThrift<\\thrift_adapted_types\\StructWithWrapper>(HH\\FIXME\\UNSAFE_CAST<mixed, \\thrift_adapted_types\\StructWithWrapper>($double_wrapped_struct, 'Map value is mixed'));\n      await $obj->get_double_wrapped_struct()->genWrap($double_wrapped_struct);\n    }\n    $optional_adapted_and_wrapped_type_map = idx($map, 'optional_adapted_and_wrapped_type_map');\n    if ($optional_adapted_and_wrapped_type_map !== null) {\n      await $obj->get_optional_adapted_and_wrapped_type_map()->genWrap(HH\\FIXME\\UNSAFE_CAST<mixed, AdaptedMap>($optional_adapted_and_wrapped_type_map, 'Map value is mixed'));\n    }\n    $optional_adapted_and_wrapped_type_struct = idx($map, 'optional_adapted_and_wrapped_type_struct');\n    if ($optional_adapted_and_wrapped_type_struct !== null) {\n      await $obj->get_optional_adapted_and_wrapped_type_struct()->genWrap(HH\\FIXME\\UNSAFE_CAST<mixed, AdaptedStruct>($optional_adapted_and_wrapped_type_struct, 'Map value is mixed'));\n    }\n    return $obj;\n  }\n\n  public function getName()[]: string {\n    return 'MyNestedStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"include.MyNestedStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"wrapped_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"annotated_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"adapted_type\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"adapted__and_wrapped_type\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"include.i64WithAdapter\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_adapted_and_wrapped_type\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"include.i64WithWrapper\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"wrapped_type_int\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"include.StructWithWrapper\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"include.StructWithWrapper\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"double_wrapped_struct\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"include.AdaptedMap\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"include.MyStruct\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_adapted_and_wrapped_type_map\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 10,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"include.AdaptedStruct\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"include.MyStruct\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_adapted_and_wrapped_type_struct\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'wrapped_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\FieldWrapper' => \\facebook\\thrift\\annotation\\hack\\FieldWrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyFieldWrapper\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'annotated_field' => shape(\n          'field' => dict[\n            'AnnotationStruct' => AnnotationStruct::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'adapted_type' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\MyAdapter1\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'adapted__and_wrapped_type' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\FieldWrapper' => \\facebook\\thrift\\annotation\\hack\\FieldWrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyFieldWrapper\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\MyAdapter1\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'optional_adapted_and_wrapped_type' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\FieldWrapper' => \\facebook\\thrift\\annotation\\hack\\FieldWrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyFieldWrapper\",\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\MyAdapterInt\",\n              )\n            ),\n          ],\n        ),\n        'wrapped_type_int' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\FieldWrapper' => \\facebook\\thrift\\annotation\\hack\\FieldWrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyFieldWrapper\",\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Wrapper' => \\facebook\\thrift\\annotation\\hack\\Wrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyTypeIntWrapper\",\n                \"extraNamespace\" => \"detail\",\n              )\n            ),\n          ],\n        ),\n        'double_wrapped_struct' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\FieldWrapper' => \\facebook\\thrift\\annotation\\hack\\FieldWrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyFieldWrapper\",\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Wrapper' => \\facebook\\thrift\\annotation\\hack\\Wrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyStructWrapper\",\n              )\n            ),\n          ],\n        ),\n        'optional_adapted_and_wrapped_type_map' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\FieldWrapper' => \\facebook\\thrift\\annotation\\hack\\FieldWrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyFieldWrapper\",\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\MyAdapter1\",\n              )\n            ),\n          ],\n        ),\n        'optional_adapted_and_wrapped_type_struct' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\FieldWrapper' => \\facebook\\thrift\\annotation\\hack\\FieldWrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyFieldWrapper\",\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\MyAdapter1\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static async function __genFromShape(self::TShape $shape): Awaitable<this> {\n    $obj = new static();\n    await $obj->get_wrapped_field()->genWrap($shape['wrapped_field']);\n    await $obj->get_annotated_field()->genWrap($shape['annotated_field']);\n    $obj->adapted_type = $shape['adapted_type'];\n    await $obj->get_adapted__and_wrapped_type()->genWrap($shape['adapted__and_wrapped_type']);\n    $optional_adapted_and_wrapped_type = Shapes::idx($shape, 'optional_adapted_and_wrapped_type');\n    if ($optional_adapted_and_wrapped_type !== null) {\n      await $obj->get_optional_adapted_and_wrapped_type()->genWrap($optional_adapted_and_wrapped_type);\n    }\n    $wrapped_type_int = await \\MyTypeIntWrapper::genFromThrift<\\detail\\i64WithWrapper>($shape['wrapped_type_int']);\n    await $obj->get_wrapped_type_int()->genWrap($wrapped_type_int);\n    $double_wrapped_struct = Shapes::idx($shape, 'double_wrapped_struct');\n    if ($double_wrapped_struct !== null) {\n      $double_wrapped_struct = await \\MyStructWrapper::genFromThrift<\\thrift_adapted_types\\StructWithWrapper>(\\thrift_adapted_types\\StructWithWrapper::__fromShape($double_wrapped_struct));\n      await $obj->get_double_wrapped_struct()->genWrap($double_wrapped_struct);\n    }\n    $optional_adapted_and_wrapped_type_map = Shapes::idx($shape, 'optional_adapted_and_wrapped_type_map');\n    if ($optional_adapted_and_wrapped_type_map !== null) {\n      await $obj->get_optional_adapted_and_wrapped_type_map()->genWrap($optional_adapted_and_wrapped_type_map);\n    }\n    $optional_adapted_and_wrapped_type_struct = Shapes::idx($shape, 'optional_adapted_and_wrapped_type_struct');\n    if ($optional_adapted_and_wrapped_type_struct !== null) {\n      await $obj->get_optional_adapted_and_wrapped_type_struct()->genWrap($optional_adapted_and_wrapped_type_struct);\n    }\n    return $obj;\n  }\n\n  public async function __genToShape(): Awaitable<self::TShape> {\n    $wrapped_field = await ($this->wrapped_field as nonnull)->genUnwrap();\n    $annotated_field = await ($this->annotated_field as nonnull)->genUnwrap();\n    $adapted__and_wrapped_type = await ($this->adapted__and_wrapped_type as nonnull)->genUnwrap();\n    $optional_adapted_and_wrapped_type = await ($this->optional_adapted_and_wrapped_type as nonnull)->genUnwrap();\n    $wrapped_type_int = await ($this->wrapped_type_int as nonnull)->genUnwrap();\n    $wrapped_type_int = await $wrapped_type_int->genUnwrap();\n    $double_wrapped_struct = await ($this->double_wrapped_struct as nonnull)->genUnwrap();\n    $double_wrapped_struct = await $double_wrapped_struct?->genUnwrap();\n    $optional_adapted_and_wrapped_type_map = await ($this->optional_adapted_and_wrapped_type_map as nonnull)->genUnwrap();\n    $optional_adapted_and_wrapped_type_struct = await ($this->optional_adapted_and_wrapped_type_struct as nonnull)->genUnwrap();\n    return shape(\n      'wrapped_field' => $wrapped_field,\n      'annotated_field' => $annotated_field,\n      'adapted_type' => $this->adapted_type,\n      'adapted__and_wrapped_type' => $adapted__and_wrapped_type,\n      'optional_adapted_and_wrapped_type' => $optional_adapted_and_wrapped_type,\n      'wrapped_type_int' => $wrapped_type_int,\n      'double_wrapped_struct' => ($double_wrapped_struct === null \n        ? null \n        : (\n        $double_wrapped_struct->__toShape()\n        )\n      ),\n      'optional_adapted_and_wrapped_type_map' => await ($optional_adapted_and_wrapped_type_map === null \n        ? null \n        : (\n        Dict\\map_async(\n        $optional_adapted_and_wrapped_type_map,\n        async $val0 ==> \n          await $val0->__genToShape()\n      )\n        )\n      ),\n      'optional_adapted_and_wrapped_type_struct' => await ($optional_adapted_and_wrapped_type_struct === null \n        ? null \n        : (\n        $optional_adapted_and_wrapped_type_struct->__genToShape()\n        )\n      ),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'wrapped_field') !== null) {\n      $this->wrapped_field = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['wrapped_field']);\n    }\n    if (idx($parsed, 'annotated_field') !== null) {\n      $this->annotated_field = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['annotated_field']);\n    }\n    if (idx($parsed, 'adapted_type') !== null) {\n      $this->adapted_type = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['adapted_type']);\n    }\n    if (idx($parsed, 'adapted__and_wrapped_type') !== null) {\n      $this->adapted__and_wrapped_type = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['adapted__and_wrapped_type']);\n    }\n    if (idx($parsed, 'optional_adapted_and_wrapped_type') !== null) {\n      $this->optional_adapted_and_wrapped_type = HH\\FIXME\\UNSAFE_CAST<mixed, i64WithAdapter>($parsed['optional_adapted_and_wrapped_type']);\n    }\n    if (idx($parsed, 'wrapped_type_int') !== null) {\n      $this->wrapped_type_int = HH\\FIXME\\UNSAFE_CAST<mixed, i64WithWrapper>($parsed['wrapped_type_int']);\n    }\n    if (idx($parsed, 'double_wrapped_struct') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, StructWithWrapper>($parsed['double_wrapped_struct']));\n      $_tmp1 = StructWithWrapper::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->double_wrapped_struct = $_tmp1;\n    }\n    if (idx($parsed, 'optional_adapted_and_wrapped_type_map') !== null) {\n      $_json5 = HH\\FIXME\\UNSAFE_CAST<mixed, AdaptedMap>($parsed['optional_adapted_and_wrapped_type_map']);\n      $_container6 = dict[];\n      foreach($_json5 as $_key3 => $_value4) {\n        $_value7 = MyStruct::withDefaultValues();\n        $_tmp8 = \\json_encode($_value4);\n        $_tmp9 = MyStruct::withDefaultValues();\n        $_tmp9->readFromJson($_tmp8);\n        $_value7 = $_tmp9;\n        $_container6[$_key3] = $_value7;\n      }\n      $this->optional_adapted_and_wrapped_type_map = $_container6;\n    }\n    if (idx($parsed, 'optional_adapted_and_wrapped_type_struct') !== null) {\n      $_tmp10 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, AdaptedStruct>($parsed['optional_adapted_and_wrapped_type_struct']));\n      $_tmp11 = MyStruct::withDefaultValues();\n      $_tmp11->readFromJson($_tmp10);\n      $this->optional_adapted_and_wrapped_type_struct = $_tmp11;\n    }\n  }\n\n  private static function __hackAdapterTypeChecks()[]: void {\n    \\ThriftUtil::requireSameType<\\MyAdapter1::TThriftType, MyStruct>();\n    \\ThriftUtil::requireSameType<\\MyAdapter1::TThriftType, dict<string, MyStruct>>();\n    \\ThriftUtil::requireSameType<\\MyAdapter1::TThriftType, int>();\n    \\ThriftUtil::requireSameType<\\MyAdapterInt::TThriftType, int>();\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyComplexStruct\n */\nclass MyComplexStruct implements \\IThriftAsyncStruct, \\IThriftStructMetadata, \\IThriftShapishAsyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'map_of_string_to_MyStruct',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => MyStruct::class,\n      ),\n      'format' => 'harray',\n    ),\n    2 => shape(\n      'var' => 'map_of_string_to_list_of_MyStruct',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRUCT,\n        'elem' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => MyStruct::class,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    3 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    4 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_MyStruct',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => MyStruct::class,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    5 => shape(\n      'var' => 'list_of_map_of_string_to_list_of_MyStruct',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::LST,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::LST,\n          'etype' => \\TType::STRUCT,\n          'elem' => shape(\n            'type' => \\TType::STRUCT,\n            'class' => MyStruct::class,\n          ),\n          'format' => 'harray',\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    6 => shape(\n      'var' => 'list_of_map_of_string_to_MyStruct',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => MyStruct::class,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    7 => shape(\n      'var' => 'list_of_map_of_string_to_StructWithWrapper',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'is_type_wrapped' => true,\n          'type' => \\TType::STRUCT,\n          'class' => \\thrift_adapted_types\\StructWithWrapper::class,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'map_of_string_to_MyStruct' => 1,\n    'map_of_string_to_list_of_MyStruct' => 2,\n    'map_of_string_to_map_of_string_to_i32' => 3,\n    'map_of_string_to_map_of_string_to_MyStruct' => 4,\n    'list_of_map_of_string_to_list_of_MyStruct' => 5,\n    'list_of_map_of_string_to_MyStruct' => 6,\n    'list_of_map_of_string_to_StructWithWrapper' => 7,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'map_of_string_to_MyStruct' => ?dict<string, MyStruct>,\n    ?'map_of_string_to_list_of_MyStruct' => ?dict<string, vec<MyStruct>>,\n    ?'map_of_string_to_map_of_string_to_i32' => ?dict<string, dict<string, int>>,\n    ?'map_of_string_to_map_of_string_to_MyStruct' => ?dict<string, dict<string, MyStruct>>,\n    ?'list_of_map_of_string_to_list_of_MyStruct' => ?vec<dict<string, vec<MyStruct>>>,\n    ?'list_of_map_of_string_to_MyStruct' => ?vec<dict<string, MyStruct>>,\n    ?'list_of_map_of_string_to_StructWithWrapper' => ?vec<dict<string, \\thrift_adapted_types\\StructWithWrapper>>,\n  );\n\n  const type TShape = shape(\n    'map_of_string_to_MyStruct' => dict<arraykey, MyStruct::TShape>,\n    'map_of_string_to_list_of_MyStruct' => dict<arraykey, vec<MyStruct::TShape>>,\n    'map_of_string_to_map_of_string_to_i32' => dict<arraykey, dict<arraykey, int>>,\n    'map_of_string_to_map_of_string_to_MyStruct' => dict<arraykey, dict<arraykey, MyStruct::TShape>>,\n    'list_of_map_of_string_to_list_of_MyStruct' => vec<dict<arraykey, vec<MyStruct::TShape>>>,\n    'list_of_map_of_string_to_MyStruct' => vec<dict<arraykey, MyStruct::TShape>>,\n    'list_of_map_of_string_to_StructWithWrapper' => vec<dict<arraykey, \\thrift_adapted_types\\StructWithWrapper::TShape>>,\n  );\n  const int STRUCTURAL_ID = 6139035146599508839;\n  /**\n   * Original thrift field:-\n   * 1: map<string, include.MyStruct> map_of_string_to_MyStruct\n   */\n  public dict<string, MyStruct> $map_of_string_to_MyStruct;\n  /**\n   * Original thrift field:-\n   * 2: map<string, list<include.MyStruct>> map_of_string_to_list_of_MyStruct\n   */\n  public dict<string, vec<MyStruct>> $map_of_string_to_list_of_MyStruct;\n  /**\n   * Original thrift field:-\n   * 3: map<string, map<string, i32>> map_of_string_to_map_of_string_to_i32\n   */\n  public dict<string, dict<string, int>> $map_of_string_to_map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 4: map<string, map<string, include.MyStruct>> map_of_string_to_map_of_string_to_MyStruct\n   */\n  public dict<string, dict<string, MyStruct>> $map_of_string_to_map_of_string_to_MyStruct;\n  /**\n   * Original thrift field:-\n   * 5: list<map<string, list<include.MyStruct>>> list_of_map_of_string_to_list_of_MyStruct\n   */\n  public vec<dict<string, vec<MyStruct>>> $list_of_map_of_string_to_list_of_MyStruct;\n  /**\n   * Original thrift field:-\n   * 6: list<map<string, include.MyStruct>> list_of_map_of_string_to_MyStruct\n   */\n  public vec<dict<string, MyStruct>> $list_of_map_of_string_to_MyStruct;\n  /**\n   * Original thrift field:-\n   * 7: list<map<string, include.StructWithWrapper>> list_of_map_of_string_to_StructWithWrapper\n   */\n  public vec<dict<string, StructWithWrapper>> $list_of_map_of_string_to_StructWithWrapper;\n\n  public function set_list_of_map_of_string_to_StructWithWrapper_DO_NOT_USE_THRIFT_INTERNAL(vec<dict<string, \\thrift_adapted_types\\StructWithWrapper>> $list_of_map_of_string_to_StructWithWrapper)[write_props]: void {\n    $this->list_of_map_of_string_to_StructWithWrapper = Vec\\map(\n      $list_of_map_of_string_to_StructWithWrapper,\n      $val0 ==> \n        Dict\\map(\n          $val0,\n          $val1 ==> \n            \\MyStructWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\thrift_adapted_types\\StructWithWrapper>($val1)\n        )\n    );\n  }\n\n\n  public function __construct()[] {\n    $this->map_of_string_to_MyStruct = dict[];\n    $this->map_of_string_to_list_of_MyStruct = dict[];\n    $this->map_of_string_to_map_of_string_to_i32 = dict[];\n    $this->map_of_string_to_map_of_string_to_MyStruct = dict[];\n    $this->list_of_map_of_string_to_list_of_MyStruct = vec[];\n    $this->list_of_map_of_string_to_MyStruct = vec[];\n    $this->list_of_map_of_string_to_StructWithWrapper = vec[];\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static async function genFromShape(self::TConstructorShape $shape)[zoned_shallow]: Awaitable<this> {\n    $obj = new static();\n    $map_of_string_to_MyStruct = Shapes::idx($shape, 'map_of_string_to_MyStruct');\n    if ($map_of_string_to_MyStruct !== null) {\n      $obj->map_of_string_to_MyStruct = $map_of_string_to_MyStruct;\n    }\n    $map_of_string_to_list_of_MyStruct = Shapes::idx($shape, 'map_of_string_to_list_of_MyStruct');\n    if ($map_of_string_to_list_of_MyStruct !== null) {\n      $obj->map_of_string_to_list_of_MyStruct = $map_of_string_to_list_of_MyStruct;\n    }\n    $map_of_string_to_map_of_string_to_i32 = Shapes::idx($shape, 'map_of_string_to_map_of_string_to_i32');\n    if ($map_of_string_to_map_of_string_to_i32 !== null) {\n      $obj->map_of_string_to_map_of_string_to_i32 = $map_of_string_to_map_of_string_to_i32;\n    }\n    $map_of_string_to_map_of_string_to_MyStruct = Shapes::idx($shape, 'map_of_string_to_map_of_string_to_MyStruct');\n    if ($map_of_string_to_map_of_string_to_MyStruct !== null) {\n      $obj->map_of_string_to_map_of_string_to_MyStruct = $map_of_string_to_map_of_string_to_MyStruct;\n    }\n    $list_of_map_of_string_to_list_of_MyStruct = Shapes::idx($shape, 'list_of_map_of_string_to_list_of_MyStruct');\n    if ($list_of_map_of_string_to_list_of_MyStruct !== null) {\n      $obj->list_of_map_of_string_to_list_of_MyStruct = $list_of_map_of_string_to_list_of_MyStruct;\n    }\n    $list_of_map_of_string_to_MyStruct = Shapes::idx($shape, 'list_of_map_of_string_to_MyStruct');\n    if ($list_of_map_of_string_to_MyStruct !== null) {\n      $obj->list_of_map_of_string_to_MyStruct = $list_of_map_of_string_to_MyStruct;\n    }\n    $list_of_map_of_string_to_StructWithWrapper = Shapes::idx($shape, 'list_of_map_of_string_to_StructWithWrapper');\n    if ($list_of_map_of_string_to_StructWithWrapper !== null) {\n      $obj->list_of_map_of_string_to_StructWithWrapper = await Vec\\map_async(\n        $list_of_map_of_string_to_StructWithWrapper,\n        async $val0 ==> \n          await Dict\\map_async(\n            $val0,\n            async $val1 ==> \n              await \\MyStructWrapper::genFromThrift<\\thrift_adapted_types\\StructWithWrapper>($val1)\n          )\n      );\n    }\n    return $obj;\n  }\n\n  public static async function genFromMap_DEPRECATED(@KeyedContainer<string, mixed> $map): Awaitable<this> {\n    $obj = new static();\n    $map_of_string_to_MyStruct = idx($map, 'map_of_string_to_MyStruct');\n    if ($map_of_string_to_MyStruct !== null) {\n      $obj->map_of_string_to_MyStruct = HH\\FIXME\\UNSAFE_CAST<mixed, dict<string, MyStruct>>($map_of_string_to_MyStruct, 'Map value is mixed');\n    }\n    $map_of_string_to_list_of_MyStruct = idx($map, 'map_of_string_to_list_of_MyStruct');\n    if ($map_of_string_to_list_of_MyStruct !== null) {\n      $obj->map_of_string_to_list_of_MyStruct = HH\\FIXME\\UNSAFE_CAST<mixed, dict<string, vec<MyStruct>>>($map_of_string_to_list_of_MyStruct, 'Map value is mixed');\n    }\n    $map_of_string_to_map_of_string_to_i32 = idx($map, 'map_of_string_to_map_of_string_to_i32');\n    if ($map_of_string_to_map_of_string_to_i32 !== null) {\n      $obj->map_of_string_to_map_of_string_to_i32 = HH\\FIXME\\UNSAFE_CAST<mixed, dict<string, dict<string, int>>>($map_of_string_to_map_of_string_to_i32, 'Map value is mixed');\n    }\n    $map_of_string_to_map_of_string_to_MyStruct = idx($map, 'map_of_string_to_map_of_string_to_MyStruct');\n    if ($map_of_string_to_map_of_string_to_MyStruct !== null) {\n      $obj->map_of_string_to_map_of_string_to_MyStruct = HH\\FIXME\\UNSAFE_CAST<mixed, dict<string, dict<string, MyStruct>>>($map_of_string_to_map_of_string_to_MyStruct, 'Map value is mixed');\n    }\n    $list_of_map_of_string_to_list_of_MyStruct = idx($map, 'list_of_map_of_string_to_list_of_MyStruct');\n    if ($list_of_map_of_string_to_list_of_MyStruct !== null) {\n      $obj->list_of_map_of_string_to_list_of_MyStruct = HH\\FIXME\\UNSAFE_CAST<mixed, vec<dict<string, vec<MyStruct>>>>($list_of_map_of_string_to_list_of_MyStruct, 'Map value is mixed');\n    }\n    $list_of_map_of_string_to_MyStruct = idx($map, 'list_of_map_of_string_to_MyStruct');\n    if ($list_of_map_of_string_to_MyStruct !== null) {\n      $obj->list_of_map_of_string_to_MyStruct = HH\\FIXME\\UNSAFE_CAST<mixed, vec<dict<string, MyStruct>>>($list_of_map_of_string_to_MyStruct, 'Map value is mixed');\n    }\n    $list_of_map_of_string_to_StructWithWrapper = idx($map, 'list_of_map_of_string_to_StructWithWrapper');\n    if ($list_of_map_of_string_to_StructWithWrapper !== null) {\n      $obj->list_of_map_of_string_to_StructWithWrapper = await Vec\\map_async(\n        HH\\FIXME\\UNSAFE_CAST<mixed, vec<dict<string, \\thrift_adapted_types\\StructWithWrapper>>>($list_of_map_of_string_to_StructWithWrapper, 'Map value is mixed'),\n        async $val0 ==> \n          await Dict\\map_async(\n            $val0,\n            async $val1 ==> \n              await \\MyStructWrapper::genFromThrift<\\thrift_adapted_types\\StructWithWrapper>($val1)\n          )\n      );\n    }\n    return $obj;\n  }\n\n  public function getName()[]: string {\n    return 'MyComplexStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"include.MyComplexStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"include.MyStruct\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_MyStruct\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"include.MyStruct\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_MyStruct\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"include.MyStruct\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_MyStruct\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                            shape(\n                                              \"name\" => \"include.MyStruct\",\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_list_of_MyStruct\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"include.MyStruct\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_MyStruct\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"include.StructWithWrapper\",\n                                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                            shape(\n                                              \"name\" => \"include.StructWithWrapper\",\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_StructWithWrapper\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static async function __genFromShape(self::TShape $shape): Awaitable<this> {\n    $obj = new static();\n    $obj->map_of_string_to_MyStruct = self::__stringifyMapKeys(\n      await Dict\\map_async(\n        $shape['map_of_string_to_MyStruct'],\n        async $val0 ==> \n          await MyStruct::__genFromShape($val0)\n      )\n    );\n    $obj->map_of_string_to_list_of_MyStruct = self::__stringifyMapKeys(\n      await Dict\\map_async(\n        $shape['map_of_string_to_list_of_MyStruct'],\n        async $val1 ==> \n          await Vec\\map_async(\n            $val1,\n            async $val2 ==> \n              await MyStruct::__genFromShape($val2)\n          )\n      )\n    );\n    $obj->map_of_string_to_map_of_string_to_i32 = self::__stringifyMapKeys(\n      Dict\\map(\n        $shape['map_of_string_to_map_of_string_to_i32'],\n        $val3 ==> \n          self::__stringifyMapKeys(\n            $val3\n          )\n      )\n    );\n    $obj->map_of_string_to_map_of_string_to_MyStruct = self::__stringifyMapKeys(\n      await Dict\\map_async(\n        $shape['map_of_string_to_map_of_string_to_MyStruct'],\n        async $val4 ==> \n          self::__stringifyMapKeys(\n            await Dict\\map_async(\n              $val4,\n              async $val5 ==> \n                await MyStruct::__genFromShape($val5)\n            )\n          )\n      )\n    );\n    $obj->list_of_map_of_string_to_list_of_MyStruct = await Vec\\map_async(\n      $shape['list_of_map_of_string_to_list_of_MyStruct'],\n      async $val6 ==> \n        self::__stringifyMapKeys(\n          await Dict\\map_async(\n            $val6,\n            async $val7 ==> \n              await Vec\\map_async(\n                $val7,\n                async $val8 ==> \n                  await MyStruct::__genFromShape($val8)\n              )\n          )\n        )\n    );\n    $obj->list_of_map_of_string_to_MyStruct = await Vec\\map_async(\n      $shape['list_of_map_of_string_to_MyStruct'],\n      async $val9 ==> \n        self::__stringifyMapKeys(\n          await Dict\\map_async(\n            $val9,\n            async $val10 ==> \n              await MyStruct::__genFromShape($val10)\n          )\n        )\n    );\n    $obj->list_of_map_of_string_to_StructWithWrapper = await Vec\\map_async(\n      $shape['list_of_map_of_string_to_StructWithWrapper'],\n      async $val11 ==> \n        self::__stringifyMapKeys(\n          await Dict\\map_async(\n            $val11,\n            async $val12 ==> \n              await \\MyStructWrapper::genFromThrift<\\thrift_adapted_types\\StructWithWrapper>(\\thrift_adapted_types\\StructWithWrapper::__fromShape($val12))\n          )\n        )\n    );\n    return $obj;\n  }\n\n  public async function __genToShape(): Awaitable<self::TShape> {\n    return shape(\n      'map_of_string_to_MyStruct' => await Dict\\map_async(\n        $this->map_of_string_to_MyStruct,\n        async $val0 ==> \n          await $val0->__genToShape()\n      ),\n      'map_of_string_to_list_of_MyStruct' => await Dict\\map_async(\n        $this->map_of_string_to_list_of_MyStruct,\n        async $val0 ==> \n          await Vec\\map_async(\n            $val0,\n            async $val1 ==> \n              await $val1->__genToShape()\n          )\n      ),\n      'map_of_string_to_map_of_string_to_i32' => Dict\\map(\n        $this->map_of_string_to_map_of_string_to_i32,\n        $val0 ==> \n          dict($val0)\n      ),\n      'map_of_string_to_map_of_string_to_MyStruct' => await Dict\\map_async(\n        $this->map_of_string_to_map_of_string_to_MyStruct,\n        async $val0 ==> \n          await Dict\\map_async(\n            $val0,\n            async $val1 ==> \n              await $val1->__genToShape()\n          )\n      ),\n      'list_of_map_of_string_to_list_of_MyStruct' => await Vec\\map_async(\n        $this->list_of_map_of_string_to_list_of_MyStruct,\n        async $val0 ==> \n          await Dict\\map_async(\n            $val0,\n            async $val1 ==> \n              await Vec\\map_async(\n                $val1,\n                async $val2 ==> \n                  await $val2->__genToShape()\n              )\n          )\n      ),\n      'list_of_map_of_string_to_MyStruct' => await Vec\\map_async(\n        $this->list_of_map_of_string_to_MyStruct,\n        async $val0 ==> \n          await Dict\\map_async(\n            $val0,\n            async $val1 ==> \n              await $val1->__genToShape()\n          )\n      ),\n      'list_of_map_of_string_to_StructWithWrapper' => await Vec\\map_async(\n        $this->list_of_map_of_string_to_StructWithWrapper,\n        async $val0 ==> \n          await Dict\\map_async(\n            $val0,\n            async $val1 ==> \n              {\n                $val1 = await $val1->genUnwrap();\n                return $val1->__toShape();\n              }\n          )\n      ),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'map_of_string_to_MyStruct') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, dict<string, MyStruct>>($parsed['map_of_string_to_MyStruct']);\n      $_container4 = dict[];\n      foreach($_json3 as $_key1 => $_value2) {\n        $_value5 = MyStruct::withDefaultValues();\n        $_tmp6 = \\json_encode($_value2);\n        $_tmp7 = MyStruct::withDefaultValues();\n        $_tmp7->readFromJson($_tmp6);\n        $_value5 = $_tmp7;\n        $_container4[$_key1] = $_value5;\n      }\n      $this->map_of_string_to_MyStruct = $_container4;\n    }\n    if (idx($parsed, 'map_of_string_to_list_of_MyStruct') !== null) {\n      $_json11 = HH\\FIXME\\UNSAFE_CAST<mixed, dict<string, vec<MyStruct>>>($parsed['map_of_string_to_list_of_MyStruct']);\n      $_container12 = dict[];\n      foreach($_json11 as $_key9 => $_value10) {\n        $_value13 = vec[];\n        $_json17 = $_value10;\n        $_container18 = vec[];\n        foreach($_json17 as $_key15 => $_value16) {\n          $_elem19 = MyStruct::withDefaultValues();\n          $_tmp20 = \\json_encode($_value16);\n          $_tmp21 = MyStruct::withDefaultValues();\n          $_tmp21->readFromJson($_tmp20);\n          $_elem19 = $_tmp21;\n          $_container18 []= $_elem19;\n        }\n        $_value13 = $_container18;\n        $_container12[$_key9] = $_value13;\n      }\n      $this->map_of_string_to_list_of_MyStruct = $_container12;\n    }\n    if (idx($parsed, 'map_of_string_to_map_of_string_to_i32') !== null) {\n      $_json25 = HH\\FIXME\\UNSAFE_CAST<mixed, dict<string, dict<string, int>>>($parsed['map_of_string_to_map_of_string_to_i32']);\n      $_container26 = dict[];\n      foreach($_json25 as $_key23 => $_value24) {\n        $_value27 = dict[];\n        $_json31 = $_value24;\n        $_container32 = dict[];\n        foreach($_json31 as $_key29 => $_value30) {\n          $_value33 = 0;\n          $_tmp34 = (int)$_value30;\n          if ($_tmp34 > 0x7fffffff) {\n            throw new \\TProtocolException(\"number exceeds limit in field\");\n          } else {\n            $_value33 = (int)$_tmp34;\n          }\n          $_container32[$_key29] = $_value33;\n        }\n        $_value27 = $_container32;\n        $_container26[$_key23] = $_value27;\n      }\n      $this->map_of_string_to_map_of_string_to_i32 = $_container26;\n    }\n    if (idx($parsed, 'map_of_string_to_map_of_string_to_MyStruct') !== null) {\n      $_json38 = HH\\FIXME\\UNSAFE_CAST<mixed, dict<string, dict<string, MyStruct>>>($parsed['map_of_string_to_map_of_string_to_MyStruct']);\n      $_container39 = dict[];\n      foreach($_json38 as $_key36 => $_value37) {\n        $_value40 = dict[];\n        $_json44 = $_value37;\n        $_container45 = dict[];\n        foreach($_json44 as $_key42 => $_value43) {\n          $_value46 = MyStruct::withDefaultValues();\n          $_tmp47 = \\json_encode($_value43);\n          $_tmp48 = MyStruct::withDefaultValues();\n          $_tmp48->readFromJson($_tmp47);\n          $_value46 = $_tmp48;\n          $_container45[$_key42] = $_value46;\n        }\n        $_value40 = $_container45;\n        $_container39[$_key36] = $_value40;\n      }\n      $this->map_of_string_to_map_of_string_to_MyStruct = $_container39;\n    }\n    if (idx($parsed, 'list_of_map_of_string_to_list_of_MyStruct') !== null) {\n      $_json52 = HH\\FIXME\\UNSAFE_CAST<mixed, vec<dict<string, vec<MyStruct>>>>($parsed['list_of_map_of_string_to_list_of_MyStruct']);\n      $_container53 = vec[];\n      foreach($_json52 as $_key50 => $_value51) {\n        $_elem54 = dict[];\n        $_json58 = $_value51;\n        $_container59 = dict[];\n        foreach($_json58 as $_key56 => $_value57) {\n          $_value60 = vec[];\n          $_json64 = $_value57;\n          $_container65 = vec[];\n          foreach($_json64 as $_key62 => $_value63) {\n            $_elem66 = MyStruct::withDefaultValues();\n            $_tmp67 = \\json_encode($_value63);\n            $_tmp68 = MyStruct::withDefaultValues();\n            $_tmp68->readFromJson($_tmp67);\n            $_elem66 = $_tmp68;\n            $_container65 []= $_elem66;\n          }\n          $_value60 = $_container65;\n          $_container59[$_key56] = $_value60;\n        }\n        $_elem54 = $_container59;\n        $_container53 []= $_elem54;\n      }\n      $this->list_of_map_of_string_to_list_of_MyStruct = $_container53;\n    }\n    if (idx($parsed, 'list_of_map_of_string_to_MyStruct') !== null) {\n      $_json72 = HH\\FIXME\\UNSAFE_CAST<mixed, vec<dict<string, MyStruct>>>($parsed['list_of_map_of_string_to_MyStruct']);\n      $_container73 = vec[];\n      foreach($_json72 as $_key70 => $_value71) {\n        $_elem74 = dict[];\n        $_json78 = $_value71;\n        $_container79 = dict[];\n        foreach($_json78 as $_key76 => $_value77) {\n          $_value80 = MyStruct::withDefaultValues();\n          $_tmp81 = \\json_encode($_value77);\n          $_tmp82 = MyStruct::withDefaultValues();\n          $_tmp82->readFromJson($_tmp81);\n          $_value80 = $_tmp82;\n          $_container79[$_key76] = $_value80;\n        }\n        $_elem74 = $_container79;\n        $_container73 []= $_elem74;\n      }\n      $this->list_of_map_of_string_to_MyStruct = $_container73;\n    }\n    if (idx($parsed, 'list_of_map_of_string_to_StructWithWrapper') !== null) {\n      $_json86 = HH\\FIXME\\UNSAFE_CAST<mixed, vec<dict<string, StructWithWrapper>>>($parsed['list_of_map_of_string_to_StructWithWrapper']);\n      $_container87 = vec[];\n      foreach($_json86 as $_key84 => $_value85) {\n        $_elem88 = dict[];\n        $_json92 = $_value85;\n        $_container93 = dict[];\n        foreach($_json92 as $_key90 => $_value91) {\n          $_value94 = StructWithWrapper::withDefaultValues();\n          $_tmp95 = \\json_encode($_value91);\n          $_tmp96 = StructWithWrapper::withDefaultValues();\n          $_tmp96->readFromJson($_tmp95);\n          $_value94 = $_tmp96;\n          $_container93[$_key90] = $_value94;\n        }\n        $_elem88 = $_container93;\n        $_container87 []= $_elem88;\n      }\n      $this->list_of_map_of_string_to_StructWithWrapper = $_container87;\n    }\n  }\n\n}\n\n", "num_lines": 1955}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift struct:-\n * MyStruct\n */\nclass MyStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'int_field',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'int_field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'int_field' => ?int,\n  );\n\n  const type TShape = shape(\n    'int_field' => int,\n  );\n  const int STRUCTURAL_ID = 8549930382776002541;\n  /**\n   * Original thrift field:-\n   * 1: i64 int_field\n   */\n  public int $int_field;\n\n  public function __construct(?int $int_field = null)[] {\n    $this->int_field = $int_field ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'int_field'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, int>(idx($map, 'int_field'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"int_field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['int_field'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'int_field' => $this->int_field,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'int_field') !== null) {\n      $this->int_field = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['int_field']);\n    }\n  }\n\n}\n\nenum MyUnionEnum: int {\n  _EMPTY_ = 0;\n  union_annotated_field = 1;\n  union_adapted_type = 3;\n}\n\n/**\n * Original thrift struct:-\n * MyUnion\n */\nclass MyUnion implements \\IThriftAsyncStruct, \\IThriftStructMetadata, \\IThriftUnion<MyUnionEnum>, \\IThriftShapishAsyncStruct {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'union_annotated_field',\n      'union' => true,\n      'is_wrapped' => true,\n      'type' => \\TType::I64,\n    ),\n    3 => shape(\n      'var' => 'union_adapted_type',\n      'union' => true,\n      'adapter' => \\AdapterTestIntToString::class,\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'union_annotated_field' => 1,\n    'union_adapted_type' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'union_annotated_field' => ?int,\n    ?'union_adapted_type' => ?\\AdapterTestIntToString::THackType,\n  );\n\n  const type TShape = shape(\n    ?'union_annotated_field' => ?int,\n    ?'union_adapted_type' => ?\\AdapterTestIntToString::THackType,\n  );\n  const int STRUCTURAL_ID = 4654710099560546823;\n  /**\n   * Original thrift field:-\n   * 1: i64 union_annotated_field\n   */\n  private ?\\MyFieldWrapper<int, MyUnion> $union_annotated_field;\n  /**\n   * Original thrift field:-\n   * 3: i64 union_adapted_type\n   */\n  public ?\\AdapterTestIntToString::THackType $union_adapted_type;\n  protected MyUnionEnum $_type = MyUnionEnum::_EMPTY_;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static async function genFromShape(self::TConstructorShape $shape)[zoned_shallow]: Awaitable<this> {\n    $obj = new static();\n    $union_annotated_field = Shapes::idx($shape, 'union_annotated_field');\n    if ($union_annotated_field !== null) {\n      $obj->_type = MyUnionEnum::union_annotated_field;\n      $obj->union_annotated_field = await \\MyFieldWrapper::genFromThrift<int, MyUnion>($union_annotated_field, 1, $obj);\n    }\n    $union_adapted_type = Shapes::idx($shape, 'union_adapted_type');\n    if ($union_adapted_type !== null) {\n      $obj->_type = MyUnionEnum::union_adapted_type;\n      $obj->union_adapted_type = $union_adapted_type;\n    }\n    return $obj;\n  }\n\n  public static async function genFromMap_DEPRECATED(@KeyedContainer<string, mixed> $map): Awaitable<this> {\n    $obj = new static();\n    $union_annotated_field = idx($map, 'union_annotated_field');\n    if ($union_annotated_field !== null) {\n      $obj->_type = MyUnionEnum::union_annotated_field;\n      $obj->union_annotated_field = await \\MyFieldWrapper::genFromThrift<int, MyUnion>(HH\\FIXME\\UNSAFE_CAST<mixed, int>($union_annotated_field, 'Map value is mixed'), 1, $obj);\n    }\n    $union_adapted_type = idx($map, 'union_adapted_type');\n    if ($union_adapted_type !== null) {\n      $obj->_type = MyUnionEnum::union_adapted_type;\n      $obj->union_adapted_type = HH\\FIXME\\UNSAFE_CAST<mixed, int>($union_adapted_type, 'Map value is mixed');\n    }\n    return $obj;\n  }\n\n  public function getName()[]: string {\n    return 'MyUnion';\n  }\n\n  public function getType()[]: MyUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case MyUnionEnum::union_annotated_field:\n        $this->union_annotated_field = null;\n        break;\n      case MyUnionEnum::union_adapted_type:\n        $this->union_adapted_type = null;\n        break;\n      case MyUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = MyUnionEnum::_EMPTY_;\n  }\n\n  public function set_union_annotated_field(int $union_annotated_field)[write_props]: this {\n    $this->reset();\n    $this->_type = MyUnionEnum::union_annotated_field;\n    $this->union_annotated_field = \\MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<int, MyUnion>($union_annotated_field, 1, $this);\n    return $this;\n  }\n\n  public function get_union_annotated_field()[]: ?\\MyFieldWrapper<int, MyUnion> {\n    return $this->union_annotated_field;\n  }\n\n  public function getx_union_annotated_field()[]: \\MyFieldWrapper<int, MyUnion> {\n    invariant(\n      $this->_type === MyUnionEnum::union_annotated_field,\n      'get_union_annotated_field called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->union_annotated_field as nonnull;\n  }\n\n  public function set_union_adapted_type(\\AdapterTestIntToString::THackType $union_adapted_type)[write_props]: this {\n    $this->reset();\n    $this->_type = MyUnionEnum::union_adapted_type;\n    $this->union_adapted_type = $union_adapted_type;\n    return $this;\n  }\n\n  public function get_union_adapted_type()[]: ?\\AdapterTestIntToString::THackType {\n    return $this->union_adapted_type;\n  }\n\n  public function getx_union_adapted_type()[]: \\AdapterTestIntToString::THackType {\n    invariant(\n      $this->_type === MyUnionEnum::union_adapted_type,\n      'get_union_adapted_type called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->union_adapted_type as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyUnion\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"union_annotated_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"union_adapted_type\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'union_annotated_field' => shape(\n          'field' => dict[\n            'AnnotationStruct' => AnnotationStruct::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'union_adapted_type' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\AdapterTestIntToString\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static async function __genFromShape(self::TShape $shape): Awaitable<this> {\n    $obj = new static();\n    $union_annotated_field = Shapes::idx($shape, 'union_annotated_field');\n    if ($union_annotated_field !== null) {\n      $obj->_type = MyUnionEnum::union_annotated_field;\n      $obj->union_annotated_field = await \\MyFieldWrapper::genFromThrift<int, MyUnion>($union_annotated_field, 1, $obj);\n    }\n    $union_adapted_type = Shapes::idx($shape, 'union_adapted_type');\n    if ($union_adapted_type !== null) {\n      $obj->_type = MyUnionEnum::union_adapted_type;\n      $obj->union_adapted_type = $union_adapted_type;\n    }\n    return $obj;\n  }\n\n  public async function __genToShape(): Awaitable<self::TShape> {\n    $union_annotated_field = await $this->union_annotated_field?->genUnwrap();\n    return shape(\n      'union_annotated_field' => $union_annotated_field,\n      'union_adapted_type' => $this->union_adapted_type,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = MyUnionEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'union_annotated_field') !== null) {\n      $this->union_annotated_field = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['union_annotated_field']);\n      $this->_type = MyUnionEnum::union_annotated_field;\n    }\n    if (idx($parsed, 'union_adapted_type') !== null) {\n      $this->union_adapted_type = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['union_adapted_type']);\n      $this->_type = MyUnionEnum::union_adapted_type;\n    }\n  }\n\n  private static function __hackAdapterTypeChecks()[]: void {\n    \\ThriftUtil::requireSameType<\\AdapterTestIntToString::TThriftType, int>();\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * MyException\n */\nclass MyException extends \\TException implements \\IThriftAsyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'code',\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'annotated_message',\n      'is_wrapped' => true,\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'code' => 1,\n    'message' => 2,\n    'annotated_message' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'code' => ?int,\n    ?'message' => ?string,\n    ?'annotated_message' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 5996584748207663461;\n  /**\n   * Original thrift field:-\n   * 1: i64 code\n   */\n  public int $code;\n  /**\n   * Original thrift field:-\n   * 2: string message\n   */\n  public string $message;\n  /**\n   * Original thrift field:-\n   * 3: string annotated_message\n   */\n  private ?\\MyFieldWrapper<string, MyException> $annotated_message;\n\n  public function get_annotated_message()[]: \\MyFieldWrapper<string, MyException> {\n    return $this->annotated_message as nonnull;\n  }\n\n\n  public function __construct()[] {\n    parent::__construct();\n    $this->code = 0;\n    $this->message = '';\n    $this->annotated_message = \\MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<string, MyException>('', 3, $this);\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static async function genFromShape(self::TConstructorShape $shape)[zoned_shallow]: Awaitable<this> {\n    $obj = new static();\n    $code = Shapes::idx($shape, 'code');\n    if ($code !== null) {\n      $obj->code = $code;\n    }\n    $message = Shapes::idx($shape, 'message');\n    if ($message !== null) {\n      $obj->message = $message;\n    }\n    $annotated_message = Shapes::idx($shape, 'annotated_message');\n    if ($annotated_message !== null) {\n      await $obj->get_annotated_message()->genWrap($annotated_message);\n    }\n    return $obj;\n  }\n\n  public static async function genFromMap_DEPRECATED(@KeyedContainer<string, mixed> $map): Awaitable<this> {\n    $obj = new static();\n    $code = idx($map, 'code');\n    if ($code !== null) {\n      $obj->code = HH\\FIXME\\UNSAFE_CAST<mixed, int>($code, 'Map value is mixed');\n    }\n    $message = idx($map, 'message');\n    if ($message !== null) {\n      $obj->message = HH\\FIXME\\UNSAFE_CAST<mixed, string>($message, 'Map value is mixed');\n    }\n    $annotated_message = idx($map, 'annotated_message');\n    if ($annotated_message !== null) {\n      await $obj->get_annotated_message()->genWrap(HH\\FIXME\\UNSAFE_CAST<mixed, string>($annotated_message, 'Map value is mixed'));\n    }\n    return $obj;\n  }\n\n  public function getName()[]: string {\n    return 'MyException';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.MyException\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"code\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"annotated_message\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'annotated_message' => shape(\n          'field' => dict[\n            'AnnotationStruct' => AnnotationStruct::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'code') !== null) {\n      $this->code = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['code']);\n    }\n    if (idx($parsed, 'message') !== null) {\n      $this->message = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['message']);\n    }\n    if (idx($parsed, 'annotated_message') !== null) {\n      $this->annotated_message = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['annotated_message']);\n    }\n  }\n\n}\n\n", "num_lines": 592}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * MyService\n */\ninterface MyServiceAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * bool\n   *   second(1: i64 count);\n   */\n  public function second(int $count): Awaitable<bool>;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ninterface MyServiceIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * bool\n   *   second(1: i64 count);\n   */\n  public function second(int $count): bool;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ninterface MyServiceAsyncClientIf extends MyServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ninterface MyServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * bool\n   *   second(1: i64 count);\n   */\n  public function second(int $count): Awaitable<bool>;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ntrait MyServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass MyServiceAsyncClient extends \\ThriftClientBase implements MyServiceAsyncClientIf {\n  use MyServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   second(1: i64 count);\n   */\n  public async function second(int $count): Awaitable<bool> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_second_args::fromShape(shape(\n      'count' => $count,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"second\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"second\", false);\n    return await $this->genAwaitResponse(MyService_second_result::class, \"second\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass MyServiceClient extends \\ThriftClientBase implements MyServiceClientIf {\n  use MyServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * bool\n   *   second(1: i64 count);\n   */\n  public async function second(int $count): Awaitable<bool> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_second_args::fromShape(shape(\n      'count' => $count,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"second\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"second\", false);\n    return await $this->genAwaitResponse(MyService_second_result::class, \"second\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_second(int $count): int {\n    $args = MyService_second_args::fromShape(shape(\n      'count' => $count,\n    ));\n    return $this->sendImplHelper($args, \"second\", false);\n  }\n  public function recv_second(?int $expectedsequenceid = null): bool {\n    return $this->recvImplHelper(MyService_second_result::class, \"second\", false, $expectedsequenceid);\n  }\n}\n\nabstract class MyServiceAsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as MyServiceAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = MyServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'MyService';\n\n  protected async function process_second(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('second');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'second', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyService_second_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyService_second_args');\n    } else {\n      $args = MyService_second_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'second', $args);\n    $result = MyService_second_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'second', $args);\n      $result->success = await $this->handler->second($args->count);\n      $this->eventHandler_->postExec($handler_ctx, 'second', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'second', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'second', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'second', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'second', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"second\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'second', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = MyServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass MyServiceAsyncProcessor extends MyServiceAsyncProcessorBase {\n  const type TThriftIf = MyServiceAsyncIf;\n}\n\nabstract class MyServiceSyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as MyServiceIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = MyServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'MyService';\n\n  protected function process_second(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('second');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'second', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'MyService_second_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'MyService_second_args');\n    } else {\n      $args = MyService_second_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'second', $args);\n    $result = MyService_second_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'second', $args);\n      $result->success = $this->handler->second($args->count);\n      $this->eventHandler_->postExec($handler_ctx, 'second', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'second', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'second', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'second', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'second', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"second\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'second', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = MyServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass MyServiceSyncProcessor extends MyServiceSyncProcessorBase {\n  const type TThriftIf = MyServiceIf;\n}\n// For backwards compatibility\nclass MyServiceProcessor extends MyServiceSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass MyService_second_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'count',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'count' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'count' => ?int,\n  );\n\n  const type TShape = shape(\n    'count' => int,\n  );\n  const int STRUCTURAL_ID = 6887469671700782815;\n  public int $count;\n\n  public function __construct(?int $count = null)[] {\n    $this->count = $count ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'count'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, int>(idx($map, 'count'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_second_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"annotations.second_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"count\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    $structured_annotation_recursive0 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive0->name = \"abc_service_method\";\n\n    $structured_annotation_recursive1 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive1->name = \"cba_service_method\";\n\n    $structured_annotation_recursive0->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive1);\n\n    $structured_annotation_recursive0->default = structured_annotation_with_default::fromShape(\n      shape(\n        \"count\" => 3,\n      )\n    );\n\n    $structured_annotation_recursive2 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive2->name = \"key_service_method1\";\n\n    $structured_annotation_recursive3 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive3->name = \"def_service_method\";\n\n    $structured_annotation_recursive2->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive3);\n\n    $structured_annotation_recursive4 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive4->name = \"key_service_method2\";\n\n    $structured_annotation_recursive5 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive5->name = \"fed_service_method\";\n\n    $structured_annotation_recursive4->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive5);\n\n    $structured_annotation_recursive0->recurse_map = dict[\n      \"key_service_method1\" => $structured_annotation_recursive2,\n      \"key_servic_methode2\" => $structured_annotation_recursive4,\n    ];\n\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'count' => shape(\n          'field' => dict[\n            'structured_annotation_recursive' => $structured_annotation_recursive0,\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['count'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'count' => $this->count,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'count') !== null) {\n      $this->count = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['count']);\n    }\n  }\n\n}\n\nclass MyService_second_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = bool;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 8594383818423018844;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, bool>(idx($map, 'success'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_second_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"annotations.MyService_second_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $this->success = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['success']);\n    }\n  }\n\n}\n\nclass MyServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"annotations.MyService\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"second\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"count\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'annotations',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    $structured_annotation_recursive0 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive0->name = \"abc_service\";\n\n    $structured_annotation_recursive1 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive1->name = \"cba_service\";\n\n    $structured_annotation_recursive0->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive1);\n\n    $structured_annotation_recursive0->default = structured_annotation_with_default::fromShape(\n      shape(\n        \"count\" => 3,\n      )\n    );\n\n    $structured_annotation_recursive2 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive2->name = \"key_service1\";\n\n    $structured_annotation_recursive3 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive3->name = \"def_service\";\n\n    $structured_annotation_recursive2->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive3);\n\n    $structured_annotation_recursive4 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive4->name = \"key_service2\";\n\n    $structured_annotation_recursive5 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive5->name = \"fed_service\";\n\n    $structured_annotation_recursive4->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive5);\n\n    $structured_annotation_recursive0->recurse_map = dict[\n      \"key_service1\" => $structured_annotation_recursive2,\n      \"key_service2\" => $structured_annotation_recursive4,\n    ];\n\n    $structured_annotation_recursive6 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive6->name = \"abc_service_method\";\n\n    $structured_annotation_recursive7 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive7->name = \"cba_service_method\";\n\n    $structured_annotation_recursive6->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive7);\n\n    $structured_annotation_recursive6->default = structured_annotation_with_default::fromShape(\n      shape(\n        \"count\" => 3,\n      )\n    );\n\n    $structured_annotation_recursive8 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive8->name = \"key_service_method1\";\n\n    $structured_annotation_recursive9 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive9->name = \"def_service_method\";\n\n    $structured_annotation_recursive8->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive9);\n\n    $structured_annotation_recursive10 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive10->name = \"key_service_method2\";\n\n    $structured_annotation_recursive11 = structured_annotation_recursive::withDefaultValues();\n    $structured_annotation_recursive11->name = \"fed_service_method\";\n\n    $structured_annotation_recursive10->get_recurse()->setValue_DO_NOT_USE_THRIFT_INTERNAL($structured_annotation_recursive11);\n\n    $structured_annotation_recursive6->recurse_map = dict[\n      \"key_service_method1\" => $structured_annotation_recursive8,\n      \"key_servic_methode2\" => $structured_annotation_recursive10,\n    ];\n\n    return shape(\n      'service' => dict[\n        'structured_annotation_recursive' => $structured_annotation_recursive0,\n      ],\n      'functions' => dict[\n        'second' => dict[\n          'structured_annotation_recursive' => $structured_annotation_recursive6,\n        ],\n      ],\n    );\n  }\n}\n\n", "num_lines": 702}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1750}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * Service\n */\ninterface ServiceAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   func(1: string arg1,\n   *        2: include.MyStruct arg2);\n   */\n  public function func(string $arg1, ?MyStruct $arg2): Awaitable<int>;\n}\n\n/**\n * Original thrift service:-\n * Service\n */\ninterface ServiceIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   func(1: string arg1,\n   *        2: include.MyStruct arg2);\n   */\n  public function func(string $arg1, ?MyStruct $arg2): int;\n}\n\n/**\n * Original thrift service:-\n * Service\n */\ninterface ServiceAsyncClientIf extends ServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * Service\n */\ninterface ServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   func(1: string arg1,\n   *        2: include.MyStruct arg2);\n   */\n  public function func(string $arg1, ?MyStruct $arg2): Awaitable<int>;\n}\n\n/**\n * Original thrift service:-\n * Service\n */\ntrait ServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass ServiceAsyncClient extends \\ThriftClientBase implements ServiceAsyncClientIf {\n  use ServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   func(1: string arg1,\n   *        2: include.MyStruct arg2);\n   */\n  public async function func(string $arg1, ?MyStruct $arg2): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Service_func_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n    ));\n    await $this->asyncHandler_->genBefore(\"Service\", \"func\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"func\", false);\n    return await $this->genAwaitResponse(Service_func_result::class, \"func\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass ServiceClient extends \\ThriftClientBase implements ServiceClientIf {\n  use ServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   func(1: string arg1,\n   *        2: include.MyStruct arg2);\n   */\n  public async function func(string $arg1, ?MyStruct $arg2): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Service_func_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n    ));\n    await $this->asyncHandler_->genBefore(\"Service\", \"func\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"func\", false);\n    return await $this->genAwaitResponse(Service_func_result::class, \"func\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_func(string $arg1, ?MyStruct $arg2): int {\n    $args = Service_func_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n    ));\n    return $this->sendImplHelper($args, \"func\", false);\n  }\n  public function recv_func(?int $expectedsequenceid = null): int {\n    return $this->recvImplHelper(Service_func_result::class, \"func\", false, $expectedsequenceid);\n  }\n}\n\nabstract class ServiceAsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as ServiceAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = ServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'Service';\n\n  protected async function process_func(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('func');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'func', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'Service_func_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'Service_func_args');\n    } else {\n      $args = Service_func_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'func', $args);\n    $result = Service_func_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'Service', 'func', $args);\n      $result->success = await $this->handler->func($args->arg1, $args->arg2);\n      $this->eventHandler_->postExec($handler_ctx, 'func', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'func', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'func', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'func', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'func', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"func\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'func', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = ServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass ServiceAsyncProcessor extends ServiceAsyncProcessorBase {\n  const type TThriftIf = ServiceAsyncIf;\n}\n\nabstract class ServiceSyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as ServiceIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = ServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'Service';\n\n  protected function process_func(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('func');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'func', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'Service_func_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'Service_func_args');\n    } else {\n      $args = Service_func_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'func', $args);\n    $result = Service_func_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'Service', 'func', $args);\n      $result->success = $this->handler->func($args->arg1, $args->arg2);\n      $this->eventHandler_->postExec($handler_ctx, 'func', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'func', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'func', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'func', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'func', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"func\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'func', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = ServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass ServiceSyncProcessor extends ServiceSyncProcessorBase {\n  const type TThriftIf = ServiceIf;\n}\n// For backwards compatibility\nclass ServiceProcessor extends ServiceSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass Service_func_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'arg1',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'arg2',\n      'type' => \\TType::STRUCT,\n      'class' => MyStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'arg1' => 1,\n    'arg2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'arg1' => ?string,\n    ?'arg2' => ?MyStruct,\n  );\n\n  const type TShape = shape(\n    'arg1' => string,\n    ?'arg2' => ?MyStruct::TShape,\n  );\n  const int STRUCTURAL_ID = 6560600906529955702;\n  public string $arg1;\n  public ?MyStruct $arg2;\n\n  public function __construct(?string $arg1 = null, ?MyStruct $arg2 = null)[] {\n    $this->arg1 = $arg1 ?? '';\n    $this->arg2 = $arg2;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'arg1'),\n      Shapes::idx($shape, 'arg2'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'arg1'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, MyStruct>(idx($map, 'arg2'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service_func_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.func_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"arg1\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"include.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"arg2\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['arg1'],\n      Shapes::idx($shape, 'arg2') === null ? null : (MyStruct::__fromShape($shape['arg2'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'arg1' => $this->arg1,\n      'arg2' => $this->arg2?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'arg1') !== null) {\n      $this->arg1 = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['arg1']);\n    }\n    if (idx($parsed, 'arg2') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, MyStruct>($parsed['arg2']));\n      $_tmp1 = MyStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->arg2 = $_tmp1;\n    }\n  }\n\n}\n\nclass Service_func_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 3865318819874171525;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, int>(idx($map, 'success'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service_func_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Service_func_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['success']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->success = (int)$_tmp0;\n      }\n    }\n  }\n\n}\n\nclass ServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.Service\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"func\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                      )\n                    ),\n                    \"name\" => \"arg1\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"include.MyStruct\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"arg2\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n              'include.MyStruct' => MyStruct::getStructMetadata(),\n              'include.MyNestedStruct' => MyNestedStruct::getStructMetadata(),\n              'include.StructWithWrapper' => \\thrift_adapted_types\\StructWithWrapper::getStructMetadata(),\n              'include.MyStruct' => MyStruct::getStructMetadata(),\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 653}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * Service1\n */\ninterface Service1AsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func(1: string arg1,\n   *        2: MyStruct arg2);\n   */\n  public function func(string $arg1, ?MyStruct $arg2): Awaitable<MyStruct>;\n\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func1(1: string arg1,\n   *         2: MyStruct arg2);\n   */\n  public function func1(string $arg1, ?MyStruct $arg2): Awaitable<MyStruct>;\n\n  /**\n   * Original thrift definition:-\n   * i64WithWrapper\n   *   func2(1: StructWithWrapper arg1,\n   *         2: i64WithWrapper arg2);\n   */\n  public function func2(?StructWithWrapper $arg1, i64WithWrapper $arg2): Awaitable<i64WithWrapper>;\n}\n\n/**\n * Original thrift service:-\n * Service1\n */\ninterface Service1If extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func(1: string arg1,\n   *        2: MyStruct arg2);\n   */\n  public function func(string $arg1, ?MyStruct $arg2): MyStruct;\n\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func1(1: string arg1,\n   *         2: MyStruct arg2);\n   */\n  public function func1(string $arg1, ?MyStruct $arg2): MyStruct;\n\n  /**\n   * Original thrift definition:-\n   * i64WithWrapper\n   *   func2(1: StructWithWrapper arg1,\n   *         2: i64WithWrapper arg2);\n   */\n  public function func2(?StructWithWrapper $arg1, i64WithWrapper $arg2): i64WithWrapper;\n}\n\n/**\n * Original thrift service:-\n * Service1\n */\ninterface Service1AsyncClientIf extends Service1AsyncIf {\n}\n\n/**\n * Original thrift service:-\n * Service1\n */\ninterface Service1ClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func(1: string arg1,\n   *        2: MyStruct arg2);\n   */\n  public function func(string $arg1, ?MyStruct $arg2): Awaitable<MyStruct>;\n\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func1(1: string arg1,\n   *         2: MyStruct arg2);\n   */\n  public function func1(string $arg1, ?MyStruct $arg2): Awaitable<MyStruct>;\n\n  /**\n   * Original thrift definition:-\n   * i64WithWrapper\n   *   func2(1: StructWithWrapper arg1,\n   *         2: i64WithWrapper arg2);\n   */\n  public function func2(?StructWithWrapper $arg1, i64WithWrapper $arg2): Awaitable<i64WithWrapper>;\n}\n\n/**\n * Original thrift service:-\n * Service1\n */\ntrait Service1ClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass Service1AsyncClient extends \\ThriftClientBase implements Service1AsyncClientIf {\n  use Service1ClientBase;\n\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func(1: string arg1,\n   *        2: MyStruct arg2);\n   */\n  public async function func(string $arg1, ?MyStruct $arg2): Awaitable<MyStruct> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Service1_func_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n    ));\n    await $this->asyncHandler_->genBefore(\"Service1\", \"func\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"func\", false);\n    return await $this->genAwaitResponse(Service1_func_result::class, \"func\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func1(1: string arg1,\n   *         2: MyStruct arg2);\n   */\n  public async function func1(string $arg1, ?MyStruct $arg2): Awaitable<MyStruct> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Service1_func1_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n    ));\n    await $this->asyncHandler_->genBefore(\"Service1\", \"func1\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"func1\", false);\n    return await $this->genAwaitResponse(Service1_func1_result::class, \"func1\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * i64WithWrapper\n   *   func2(1: StructWithWrapper arg1,\n   *         2: i64WithWrapper arg2);\n   */\n  public async function func2(?StructWithWrapper $arg1, i64WithWrapper $arg2): Awaitable<i64WithWrapper> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Service1_func2_args::withDefaultValues();\n    if ($arg1 !== null) {\n      $args->arg1 = $arg1;\n    }\n    if ($arg2 !== null) {\n      $args->arg2 = $arg2;\n    }\n    await $this->asyncHandler_->genBefore(\"Service1\", \"func2\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"func2\", false);\n    return await $this->genAwaitResponse(Service1_func2_result::class, \"func2\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass Service1Client extends \\ThriftClientBase implements Service1ClientIf {\n  use Service1ClientBase;\n\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func(1: string arg1,\n   *        2: MyStruct arg2);\n   */\n  public async function func(string $arg1, ?MyStruct $arg2): Awaitable<MyStruct> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Service1_func_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n    ));\n    await $this->asyncHandler_->genBefore(\"Service1\", \"func\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"func\", false);\n    return await $this->genAwaitResponse(Service1_func_result::class, \"func\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func1(1: string arg1,\n   *         2: MyStruct arg2);\n   */\n  public async function func1(string $arg1, ?MyStruct $arg2): Awaitable<MyStruct> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Service1_func1_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n    ));\n    await $this->asyncHandler_->genBefore(\"Service1\", \"func1\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"func1\", false);\n    return await $this->genAwaitResponse(Service1_func1_result::class, \"func1\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * i64WithWrapper\n   *   func2(1: StructWithWrapper arg1,\n   *         2: i64WithWrapper arg2);\n   */\n  public async function func2(?StructWithWrapper $arg1, i64WithWrapper $arg2): Awaitable<i64WithWrapper> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Service1_func2_args::withDefaultValues();\n    if ($arg1 !== null) {\n      $args->arg1 = $arg1;\n    }\n    if ($arg2 !== null) {\n      $args->arg2 = $arg2;\n    }\n    await $this->asyncHandler_->genBefore(\"Service1\", \"func2\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"func2\", false);\n    return await $this->genAwaitResponse(Service1_func2_result::class, \"func2\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_func(string $arg1, ?MyStruct $arg2): int {\n    $args = Service1_func_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n    ));\n    return $this->sendImplHelper($args, \"func\", false);\n  }\n  public function recv_func(?int $expectedsequenceid = null): MyStruct {\n    return $this->recvImplHelper(Service1_func_result::class, \"func\", false, $expectedsequenceid);\n  }\n  public function send_func1(string $arg1, ?MyStruct $arg2): int {\n    $args = Service1_func1_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n    ));\n    return $this->sendImplHelper($args, \"func1\", false);\n  }\n  public function recv_func1(?int $expectedsequenceid = null): MyStruct {\n    return $this->recvImplHelper(Service1_func1_result::class, \"func1\", false, $expectedsequenceid);\n  }\n  public function send_func2(?StructWithWrapper $arg1, i64WithWrapper $arg2): int {\n    $args = Service1_func2_args::withDefaultValues();\n    if ($arg1 !== null) {\n      $args->arg1 = $arg1;\n    }\n    if ($arg2 !== null) {\n      $args->arg2 = $arg2;\n    }\n    return $this->sendImplHelper($args, \"func2\", false);\n  }\n  public function recv_func2(?int $expectedsequenceid = null): i64WithWrapper {\n    return $this->recvImplHelper(Service1_func2_result::class, \"func2\", false, $expectedsequenceid);\n  }\n}\n\nabstract class Service1AsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as Service1AsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = Service1StaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'Service1';\n\n  protected async function process_func(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('func');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'func', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'Service1_func_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'Service1_func_args');\n    } else {\n      $args = Service1_func_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'func', $args);\n    $result = Service1_func_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'Service1', 'func', $args);\n      $result->success = await $this->handler->func($args->arg1, $args->arg2);\n      $this->eventHandler_->postExec($handler_ctx, 'func', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'func', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'func', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'func', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'func', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"func\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'func', $result);\n  }\n  protected async function process_func1(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('func1');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'func1', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'Service1_func1_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'Service1_func1_args');\n    } else {\n      $args = Service1_func1_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'func1', $args);\n    $result = Service1_func1_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'Service1', 'func1', $args);\n      $result->success = await $this->handler->func1($args->arg1, $args->arg2);\n      $this->eventHandler_->postExec($handler_ctx, 'func1', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'func1', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'func1', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'func1', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'func1', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"func1\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'func1', $result);\n  }\n  protected async function process_func2(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('func2');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'func2', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'Service1_func2_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'Service1_func2_args');\n    } else {\n      $args = Service1_func2_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'func2', $args);\n    $result = Service1_func2_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'Service1', 'func2', $args);\n      $result->success = await $this->handler->func2($args->arg1, $args->arg2);\n      $this->eventHandler_->postExec($handler_ctx, 'func2', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'func2', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'func2', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'func2', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'func2', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"func2\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'func2', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = Service1StaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass Service1AsyncProcessor extends Service1AsyncProcessorBase {\n  const type TThriftIf = Service1AsyncIf;\n}\n\nabstract class Service1SyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as Service1If;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = Service1StaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'Service1';\n\n  protected function process_func(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('func');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'func', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'Service1_func_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'Service1_func_args');\n    } else {\n      $args = Service1_func_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'func', $args);\n    $result = Service1_func_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'Service1', 'func', $args);\n      $result->success = $this->handler->func($args->arg1, $args->arg2);\n      $this->eventHandler_->postExec($handler_ctx, 'func', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'func', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'func', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'func', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'func', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"func\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'func', $result);\n  }\n  protected function process_func1(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('func1');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'func1', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'Service1_func1_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'Service1_func1_args');\n    } else {\n      $args = Service1_func1_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'func1', $args);\n    $result = Service1_func1_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'Service1', 'func1', $args);\n      $result->success = $this->handler->func1($args->arg1, $args->arg2);\n      $this->eventHandler_->postExec($handler_ctx, 'func1', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'func1', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'func1', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'func1', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'func1', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"func1\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'func1', $result);\n  }\n  protected function process_func2(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('func2');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'func2', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'Service1_func2_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'Service1_func2_args');\n    } else {\n      $args = Service1_func2_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'func2', $args);\n    $result = Service1_func2_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'Service1', 'func2', $args);\n      $result->success = $this->handler->func2($args->arg1, $args->arg2);\n      $this->eventHandler_->postExec($handler_ctx, 'func2', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'func2', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'func2', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'func2', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'func2', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"func2\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'func2', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = Service1StaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass Service1SyncProcessor extends Service1SyncProcessorBase {\n  const type TThriftIf = Service1If;\n}\n// For backwards compatibility\nclass Service1Processor extends Service1SyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass Service1_func_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishAsyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'arg1',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'arg2',\n      'type' => \\TType::STRUCT,\n      'class' => MyStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'arg1' => 1,\n    'arg2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'arg1' => ?string,\n    ?'arg2' => ?MyStruct,\n  );\n\n  const type TShape = shape(\n    'arg1' => string,\n    ?'arg2' => ?MyStruct::TShape,\n  );\n  const int STRUCTURAL_ID = 6560600906529955702;\n  public string $arg1;\n  public ?MyStruct $arg2;\n\n  public function __construct(?string $arg1 = null, ?MyStruct $arg2 = null)[] {\n    $this->arg1 = $arg1 ?? '';\n    $this->arg2 = $arg2;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'arg1'),\n      Shapes::idx($shape, 'arg2'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'arg1'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, MyStruct>(idx($map, 'arg2'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service1_func_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"include.func_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"arg1\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"include.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"arg2\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static async function __genFromShape(self::TShape $shape): Awaitable<this> {\n    $obj = new static();\n    $obj->arg1 = $shape['arg1'];\n    $arg2 = Shapes::idx($shape, 'arg2');\n    if ($arg2 !== null) {\n      $obj->arg2 = await MyStruct::__genFromShape($arg2);\n    }\n    return $obj;\n  }\n\n  public async function __genToShape(): Awaitable<self::TShape> {\n    return shape(\n      'arg1' => $this->arg1,\n      'arg2' => await ($this->arg2 === null \n        ? null \n        : (\n        $this->arg2->__genToShape()\n        )\n      ),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'arg1') !== null) {\n      $this->arg1 = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['arg1']);\n    }\n    if (idx($parsed, 'arg2') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, MyStruct>($parsed['arg2']));\n      $_tmp1 = MyStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->arg2 = $_tmp1;\n    }\n  }\n\n}\n\nclass Service1_func_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = MyStruct;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => MyStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 7307096097859369800;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, MyStruct>(idx($map, 'success'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service1_func_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"include.Service1_func_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"include.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, MyStruct>($parsed['success']));\n      $_tmp1 = MyStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->success = $_tmp1;\n    }\n  }\n\n}\n\nclass Service1_func1_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishAsyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'arg1',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'arg2',\n      'type' => \\TType::STRUCT,\n      'class' => MyStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'arg1' => 1,\n    'arg2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'arg1' => ?string,\n    ?'arg2' => ?MyStruct,\n  );\n\n  const type TShape = shape(\n    'arg1' => string,\n    ?'arg2' => ?MyStruct::TShape,\n  );\n  const int STRUCTURAL_ID = 6560600906529955702;\n  public string $arg1;\n  public ?MyStruct $arg2;\n\n  public function __construct(?string $arg1 = null, ?MyStruct $arg2 = null)[] {\n    $this->arg1 = $arg1 ?? '';\n    $this->arg2 = $arg2;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'arg1'),\n      Shapes::idx($shape, 'arg2'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'arg1'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, MyStruct>(idx($map, 'arg2'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service1_func1_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"include.func1_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"arg1\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"include.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"arg2\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static async function __genFromShape(self::TShape $shape): Awaitable<this> {\n    $obj = new static();\n    $obj->arg1 = $shape['arg1'];\n    $arg2 = Shapes::idx($shape, 'arg2');\n    if ($arg2 !== null) {\n      $obj->arg2 = await MyStruct::__genFromShape($arg2);\n    }\n    return $obj;\n  }\n\n  public async function __genToShape(): Awaitable<self::TShape> {\n    return shape(\n      'arg1' => $this->arg1,\n      'arg2' => await ($this->arg2 === null \n        ? null \n        : (\n        $this->arg2->__genToShape()\n        )\n      ),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'arg1') !== null) {\n      $this->arg1 = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['arg1']);\n    }\n    if (idx($parsed, 'arg2') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, MyStruct>($parsed['arg2']));\n      $_tmp1 = MyStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->arg2 = $_tmp1;\n    }\n  }\n\n}\n\nclass Service1_func1_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = MyStruct;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => MyStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 7307096097859369800;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, MyStruct>(idx($map, 'success'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service1_func1_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"include.Service1_func1_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"include.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, MyStruct>($parsed['success']));\n      $_tmp1 = MyStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->success = $_tmp1;\n    }\n  }\n\n}\n\nclass Service1_func2_args implements \\IThriftAsyncStruct, \\IThriftStructMetadata, \\IThriftShapishAsyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'arg1',\n      'is_type_wrapped' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\thrift_adapted_types\\StructWithWrapper::class,\n    ),\n    2 => shape(\n      'var' => 'arg2',\n      'is_type_wrapped' => true,\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'arg1' => 1,\n    'arg2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'arg1' => ?\\thrift_adapted_types\\StructWithWrapper,\n    ?'arg2' => ?\\detail\\i64WithWrapper,\n  );\n\n  const type TShape = shape(\n    ?'arg1' => ?\\thrift_adapted_types\\StructWithWrapper::TShape,\n    'arg2' => \\detail\\i64WithWrapper,\n  );\n  const int STRUCTURAL_ID = 7334474533984828341;\n  public ?StructWithWrapper $arg1;\n\n  public function set_arg1_DO_NOT_USE_THRIFT_INTERNAL(\\thrift_adapted_types\\StructWithWrapper $arg1)[write_props]: void {\n    $this->arg1 = \\MyStructWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\thrift_adapted_types\\StructWithWrapper>($arg1);\n  }\n\n  public i64WithWrapper $arg2;\n\n  public function set_arg2_DO_NOT_USE_THRIFT_INTERNAL(int $arg2)[write_props]: void {\n    $this->arg2 = \\MyTypeIntWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\detail\\i64WithWrapper>($arg2);\n  }\n\n\n  public function __construct()[] {\n    $this->arg2 = \\MyTypeIntWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\detail\\i64WithWrapper>(0);\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static async function genFromShape(self::TConstructorShape $shape)[zoned_shallow]: Awaitable<this> {\n    $obj = new static();\n    $arg1 = Shapes::idx($shape, 'arg1');\n    if ($arg1 !== null) {\n      $obj->arg1 = await \\MyStructWrapper::genFromThrift<\\thrift_adapted_types\\StructWithWrapper>($arg1);\n    }\n    $arg2 = Shapes::idx($shape, 'arg2');\n    if ($arg2 !== null) {\n      $obj->arg2 = await \\MyTypeIntWrapper::genFromThrift<\\detail\\i64WithWrapper>($arg2);\n    }\n    return $obj;\n  }\n\n  public static async function genFromMap_DEPRECATED(@KeyedContainer<string, mixed> $map): Awaitable<this> {\n    $obj = new static();\n    $arg1 = idx($map, 'arg1');\n    if ($arg1 !== null) {\n      $obj->arg1 = await \\MyStructWrapper::genFromThrift<\\thrift_adapted_types\\StructWithWrapper>(HH\\FIXME\\UNSAFE_CAST<mixed, \\thrift_adapted_types\\StructWithWrapper>($arg1, 'Map value is mixed'));\n    }\n    $arg2 = idx($map, 'arg2');\n    if ($arg2 !== null) {\n      $obj->arg2 = await \\MyTypeIntWrapper::genFromThrift<\\detail\\i64WithWrapper>(HH\\FIXME\\UNSAFE_CAST<mixed, \\detail\\i64WithWrapper>($arg2, 'Map value is mixed'));\n    }\n    return $obj;\n  }\n\n  public function getName()[]: string {\n    return 'Service1_func2_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"include.func2_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"include.StructWithWrapper\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"include.StructWithWrapper\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"arg1\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"include.i64WithWrapper\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"arg2\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'arg1' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Wrapper' => \\facebook\\thrift\\annotation\\hack\\Wrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyStructWrapper\",\n              )\n            ),\n          ],\n        ),\n        'arg2' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Wrapper' => \\facebook\\thrift\\annotation\\hack\\Wrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyTypeIntWrapper\",\n                \"extraNamespace\" => \"detail\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static async function __genFromShape(self::TShape $shape): Awaitable<this> {\n    $obj = new static();\n    $arg1 = Shapes::idx($shape, 'arg1');\n    if ($arg1 !== null) {\n      $obj->arg1 = await \\MyStructWrapper::genFromThrift<\\thrift_adapted_types\\StructWithWrapper>(\\thrift_adapted_types\\StructWithWrapper::__fromShape($arg1));\n    }\n    $obj->arg2 = await \\MyTypeIntWrapper::genFromThrift<\\detail\\i64WithWrapper>($shape['arg2']);\n    return $obj;\n  }\n\n  public async function __genToShape(): Awaitable<self::TShape> {\n    $arg1 = await $this->arg1?->genUnwrap();\n    $arg2 = await $this->arg2->genUnwrap();\n    return shape(\n      'arg1' => ($arg1 === null \n        ? null \n        : (\n        $arg1->__toShape()\n        )\n      ),\n      'arg2' => $arg2,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'arg1') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, StructWithWrapper>($parsed['arg1']));\n      $_tmp1 = StructWithWrapper::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->arg1 = $_tmp1;\n    }\n    if (idx($parsed, 'arg2') !== null) {\n      $this->arg2 = HH\\FIXME\\UNSAFE_CAST<mixed, i64WithWrapper>($parsed['arg2']);\n    }\n  }\n\n}\n\nclass Service1_func2_result extends \\ThriftAsyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = i64WithWrapper;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'is_type_wrapped' => true,\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?\\detail\\i64WithWrapper,\n  );\n\n  const int STRUCTURAL_ID = 338438324750488489;\n  public ?this::TResult $success;\n\n  public function set_success_DO_NOT_USE_THRIFT_INTERNAL(int $success)[write_props]: void {\n    $this->success = \\MyTypeIntWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<\\detail\\i64WithWrapper>($success);\n  }\n\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static async function genFromShape(self::TConstructorShape $shape)[zoned_shallow]: Awaitable<this> {\n    $obj = new static();\n    $success = Shapes::idx($shape, 'success');\n    if ($success !== null) {\n      $obj->success = await \\MyTypeIntWrapper::genFromThrift<\\detail\\i64WithWrapper>($success);\n    }\n    return $obj;\n  }\n\n  public static async function genFromMap_DEPRECATED(@KeyedContainer<string, mixed> $map): Awaitable<this> {\n    $obj = new static();\n    $success = idx($map, 'success');\n    if ($success !== null) {\n      $obj->success = await \\MyTypeIntWrapper::genFromThrift<\\detail\\i64WithWrapper>(HH\\FIXME\\UNSAFE_CAST<mixed, \\detail\\i64WithWrapper>($success, 'Map value is mixed'));\n    }\n    return $obj;\n  }\n\n  public function getName()[]: string {\n    return 'Service1_func2_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"include.Service1_func2_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"include.i64WithWrapper\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'success' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Wrapper' => \\facebook\\thrift\\annotation\\hack\\Wrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyTypeIntWrapper\",\n                \"extraNamespace\" => \"detail\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $this->success = HH\\FIXME\\UNSAFE_CAST<mixed, i64WithWrapper>($parsed['success']);\n    }\n  }\n\n}\n\nclass Service1StaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"include.Service1\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"func\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"include.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                      )\n                    ),\n                    \"name\" => \"arg1\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"include.MyStruct\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"arg2\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"func1\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"include.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                      )\n                    ),\n                    \"name\" => \"arg1\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"include.MyStruct\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"arg2\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"func2\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"include.i64WithWrapper\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                          shape(\n                            \"name\" => \"include.StructWithWrapper\",\n                            \"underlyingType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                  shape(\n                                    \"name\" => \"include.StructWithWrapper\",\n                                  )\n                                ),\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"arg1\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                          shape(\n                            \"name\" => \"include.i64WithWrapper\",\n                            \"underlyingType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"arg2\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'include',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n              'include.MyStruct' => MyStruct::getStructMetadata(),\n              'include.MyNestedStruct' => MyNestedStruct::getStructMetadata(),\n              'include.StructWithWrapper' => \\thrift_adapted_types\\StructWithWrapper::getStructMetadata(),\n              'include.StructWithWrapper' => \\thrift_adapted_types\\StructWithWrapper::getStructMetadata(),\n              'include.MyStruct' => MyStruct::getStructMetadata(),\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 1722}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\hack;\n\n/**\n * Original thrift struct:-\n * FieldWrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/FieldWrapper'))>>\nclass FieldWrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldWrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.FieldWrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Wrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Wrapper'))>>\nclass Wrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'underlyingName',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'extraNamespace',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'underlyingName' => 2,\n    'extraNamespace' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'underlyingName' => ?string,\n    ?'extraNamespace' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'underlyingName' => string,\n    'extraNamespace' => string,\n  );\n  const int STRUCTURAL_ID = 1284986773698322040;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string underlyingName\n   */\n  public string $underlyingName;\n  /**\n   * Original thrift field:-\n   * 3: string extraNamespace\n   */\n  public string $extraNamespace;\n\n  public function __construct(?string $name = null, ?string $underlyingName = null, ?string $extraNamespace = null)[] {\n    $this->name = $name ?? '';\n    $this->underlyingName = $underlyingName ?? '';\n    $this->extraNamespace = $extraNamespace ?? \"thrift_adapted_types\";\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'underlyingName'),\n      Shapes::idx($shape, 'extraNamespace'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Wrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Wrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"underlyingName\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"extraNamespace\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['underlyingName'],\n      $shape['extraNamespace'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'underlyingName' => $this->underlyingName,\n      'extraNamespace' => $this->extraNamespace,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'underlyingName') !== null) {\n      $this->underlyingName = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['underlyingName']);\n    }\n    if (idx($parsed, 'extraNamespace') !== null) {\n      $this->extraNamespace = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['extraNamespace']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * SkipCodegen\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/SkipCodegen'))>>\nclass SkipCodegen implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'reason' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'reason' => ?string,\n  );\n\n  const type TShape = shape(\n    'reason' => string,\n  );\n  const int STRUCTURAL_ID = 3707764047816594739;\n  /**\n   * Original thrift field:-\n   * 1: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $reason = null)[] {\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SkipCodegen';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.SkipCodegen\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['reason'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'reason' => $this->reason,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'reason') !== null) {\n      $this->reason = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['reason']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Name\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Name'))>>\nclass Name implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'reason' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'reason' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'reason' => string,\n  );\n  const int STRUCTURAL_ID = 4844827548325959202;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $name = null, ?string $reason = null)[] {\n    $this->name = $name ?? '';\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Name';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Name\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['reason'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'reason' => $this->reason,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'reason') !== null) {\n      $this->reason = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['reason']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * UnionEnumAttributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/UnionEnumAttributes'))>>\nclass UnionEnumAttributes implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?Vector<string>,\n  );\n\n  const type TShape = shape(\n    'attributes' => vec<string>,\n  );\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public Vector<string> $attributes;\n\n  public function __construct(?Vector<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'UnionEnumAttributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.UnionEnumAttributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['attributes'] |> new Vector($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'attributes' => vec($this->attributes),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'attributes') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<string>>($parsed['attributes']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = '';\n        $_elem5 = $_value2;\n        $_container4 []= $_elem5;\n      }\n      $this->attributes = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructTrait'))>>\nclass StructTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructTrait\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Attributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Attributes'))>>\nclass Attributes implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?Vector<string>,\n  );\n\n  const type TShape = shape(\n    'attributes' => vec<string>,\n  );\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public Vector<string> $attributes;\n\n  public function __construct(?Vector<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Attributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Attributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['attributes'] |> new Vector($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'attributes' => vec($this->attributes),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'attributes') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<string>>($parsed['attributes']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = '';\n        $_elem5 = $_value2;\n        $_container4 []= $_elem5;\n      }\n      $this->attributes = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructAsTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructAsTrait'))>>\nclass StructAsTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructAsTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructAsTrait\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ModuleInternal\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/ModuleInternal'))>>\nclass ModuleInternal implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ModuleInternal';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.ModuleInternal\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1337}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift struct:-\n * AnnotationStruct\n */\nclass AnnotationStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AnnotationStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.AnnotationStruct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\hack\\FieldWrapper' => \\facebook\\thrift\\annotation\\hack\\FieldWrapper::fromShape(\n          shape(\n            \"name\" => \"\\\\MyFieldWrapper\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStruct\n */\nclass MyStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishAsyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'nested_struct',\n      'type' => \\TType::STRUCT,\n      'class' => MyNestedStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'nested_struct' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'nested_struct' => ?MyNestedStruct,\n  );\n\n  const type TShape = shape(\n    ?'nested_struct' => ?MyNestedStruct::TShape,\n  );\n  const int STRUCTURAL_ID = 6466034702854646588;\n  /**\n   * Original thrift field:-\n   * 1: module.MyNestedStruct nested_struct\n   */\n  public ?MyNestedStruct $nested_struct;\n\n  public function __construct(?MyNestedStruct $nested_struct = null)[] {\n    $this->nested_struct = $nested_struct;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'nested_struct'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyNestedStruct\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.MyNestedStruct\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"nested_struct\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static async function __genFromShape(self::TShape $shape): Awaitable<this> {\n    $obj = new static();\n    $nested_struct = Shapes::idx($shape, 'nested_struct');\n    if ($nested_struct !== null) {\n      $obj->nested_struct = await MyNestedStruct::__genFromShape($nested_struct);\n    }\n    return $obj;\n  }\n\n  public async function __genToShape(): Awaitable<self::TShape> {\n    return shape(\n      'nested_struct' => await ($this->nested_struct === null \n        ? null \n        : (\n        $this->nested_struct->__genToShape()\n        )\n      ),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'nested_struct') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, MyNestedStruct>($parsed['nested_struct']));\n      $_tmp1 = MyNestedStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->nested_struct = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyNestedStruct\n */\nclass MyNestedStruct implements \\IThriftAsyncStruct, \\IThriftStructMetadata, \\IThriftShapishAsyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'wrapped_field',\n      'is_wrapped' => true,\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'annotated_field',\n      'is_wrapped' => true,\n      'type' => \\TType::I64,\n    ),\n    3 => shape(\n      'var' => 'adapted_type',\n      'adapter' => \\MyAdapter::class,\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'wrapped_field' => 1,\n    'annotated_field' => 2,\n    'adapted_type' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'wrapped_field' => ?int,\n    ?'annotated_field' => ?int,\n    ?'adapted_type' => ?\\MyAdapter::THackType,\n  );\n\n  const type TShape = shape(\n    'wrapped_field' => int,\n    'annotated_field' => int,\n    'adapted_type' => \\MyAdapter::THackType,\n  );\n  const int STRUCTURAL_ID = 3672151039112827748;\n  /**\n   * Original thrift field:-\n   * 1: i64 wrapped_field\n   */\n  private ?\\MyFieldWrapper<int, MyNestedStruct> $wrapped_field;\n\n  public function get_wrapped_field()[]: \\MyFieldWrapper<int, MyNestedStruct> {\n    return $this->wrapped_field as nonnull;\n  }\n\n  /**\n   * Original thrift field:-\n   * 2: i64 annotated_field\n   */\n  private ?\\MyFieldWrapper<int, MyNestedStruct> $annotated_field;\n\n  public function get_annotated_field()[]: \\MyFieldWrapper<int, MyNestedStruct> {\n    return $this->annotated_field as nonnull;\n  }\n\n  /**\n   * Original thrift field:-\n   * 3: i64 adapted_type\n   */\n  public \\MyAdapter::THackType $adapted_type;\n\n  public function __construct()[] {\n    $this->adapted_type = \\MyAdapter::fromThrift(0);\n    $this->wrapped_field = \\MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<int, MyNestedStruct>(0, 1, $this);\n    $this->annotated_field = \\MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<int, MyNestedStruct>(0, 2, $this);\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static async function genFromShape(self::TConstructorShape $shape)[zoned_shallow]: Awaitable<this> {\n    $obj = new static();\n    $wrapped_field = Shapes::idx($shape, 'wrapped_field');\n    if ($wrapped_field !== null) {\n      await $obj->get_wrapped_field()->genWrap($wrapped_field);\n    }\n    $annotated_field = Shapes::idx($shape, 'annotated_field');\n    if ($annotated_field !== null) {\n      await $obj->get_annotated_field()->genWrap($annotated_field);\n    }\n    $adapted_type = Shapes::idx($shape, 'adapted_type');\n    if ($adapted_type !== null) {\n      $obj->adapted_type = $adapted_type;\n    }\n    return $obj;\n  }\n\n  public function getName()[]: string {\n    return 'MyNestedStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyNestedStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"wrapped_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"annotated_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"adapted_type\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'wrapped_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\FieldWrapper' => \\facebook\\thrift\\annotation\\hack\\FieldWrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyFieldWrapper\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'annotated_field' => shape(\n          'field' => dict[\n            'AnnotationStruct' => AnnotationStruct::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'adapted_type' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\MyAdapter\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static async function __genFromShape(self::TShape $shape): Awaitable<this> {\n    $obj = new static();\n    await $obj->get_wrapped_field()->genWrap($shape['wrapped_field']);\n    await $obj->get_annotated_field()->genWrap($shape['annotated_field']);\n    $obj->adapted_type = $shape['adapted_type'];\n    return $obj;\n  }\n\n  public async function __genToShape(): Awaitable<self::TShape> {\n    $wrapped_field = await ($this->wrapped_field as nonnull)->genUnwrap();\n    $annotated_field = await ($this->annotated_field as nonnull)->genUnwrap();\n    return shape(\n      'wrapped_field' => $wrapped_field,\n      'annotated_field' => $annotated_field,\n      'adapted_type' => $this->adapted_type,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'wrapped_field') !== null) {\n      $this->wrapped_field = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['wrapped_field']);\n    }\n    if (idx($parsed, 'annotated_field') !== null) {\n      $this->annotated_field = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['annotated_field']);\n    }\n    if (idx($parsed, 'adapted_type') !== null) {\n      $this->adapted_type = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['adapted_type']);\n    }\n  }\n\n  private static function __hackAdapterTypeChecks()[]: void {\n    \\ThriftUtil::requireSameType<\\MyAdapter::TThriftType, int>();\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyComplexStruct\n */\nclass MyComplexStruct implements \\IThriftAsyncStruct, \\IThriftStructMetadata, \\IThriftShapishAsyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'map_of_string_to_MyStruct',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => MyStruct::class,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'map_of_string_to_list_of_MyStruct',\n      'is_wrapped' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRUCT,\n        'elem' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => MyStruct::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    4 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_MyStruct',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => MyStruct::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    5 => shape(\n      'var' => 'list_of_map_of_string_to_list_of_MyStruct',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::LST,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::LST,\n          'etype' => \\TType::STRUCT,\n          'elem' => shape(\n            'type' => \\TType::STRUCT,\n            'class' => MyStruct::class,\n          ),\n          'format' => 'collection',\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    6 => shape(\n      'var' => 'list_of_map_of_string_to_MyStruct',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => MyStruct::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'map_of_string_to_MyStruct' => 1,\n    'map_of_string_to_list_of_MyStruct' => 2,\n    'map_of_string_to_map_of_string_to_i32' => 3,\n    'map_of_string_to_map_of_string_to_MyStruct' => 4,\n    'list_of_map_of_string_to_list_of_MyStruct' => 5,\n    'list_of_map_of_string_to_MyStruct' => 6,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'map_of_string_to_MyStruct' => ?Map<string, MyStruct>,\n    ?'map_of_string_to_list_of_MyStruct' => ?Map<string, Vector<MyStruct>>,\n    ?'map_of_string_to_map_of_string_to_i32' => ?Map<string, Map<string, int>>,\n    ?'map_of_string_to_map_of_string_to_MyStruct' => ?Map<string, Map<string, MyStruct>>,\n    ?'list_of_map_of_string_to_list_of_MyStruct' => ?Vector<Map<string, Vector<MyStruct>>>,\n    ?'list_of_map_of_string_to_MyStruct' => ?Vector<Map<string, MyStruct>>,\n  );\n\n  const type TShape = shape(\n    'map_of_string_to_MyStruct' => dict<arraykey, MyStruct::TShape>,\n    'map_of_string_to_list_of_MyStruct' => dict<arraykey, vec<MyStruct::TShape>>,\n    'map_of_string_to_map_of_string_to_i32' => dict<arraykey, dict<arraykey, int>>,\n    'map_of_string_to_map_of_string_to_MyStruct' => dict<arraykey, dict<arraykey, MyStruct::TShape>>,\n    'list_of_map_of_string_to_list_of_MyStruct' => vec<dict<arraykey, vec<MyStruct::TShape>>>,\n    'list_of_map_of_string_to_MyStruct' => vec<dict<arraykey, MyStruct::TShape>>,\n  );\n  const int STRUCTURAL_ID = 8703607584527805207;\n  /**\n   * Original thrift field:-\n   * 1: map<string, module.MyStruct> map_of_string_to_MyStruct\n   */\n  public Map<string, MyStruct> $map_of_string_to_MyStruct;\n  /**\n   * Original thrift field:-\n   * 2: map<string, list<module.MyStruct>> map_of_string_to_list_of_MyStruct\n   */\n  private ?\\MyFieldWrapper<Map<string, Vector<MyStruct>>, MyComplexStruct> $map_of_string_to_list_of_MyStruct;\n\n  public function get_map_of_string_to_list_of_MyStruct()[]: \\MyFieldWrapper<Map<string, Vector<MyStruct>>, MyComplexStruct> {\n    return $this->map_of_string_to_list_of_MyStruct as nonnull;\n  }\n\n  /**\n   * Original thrift field:-\n   * 3: map<string, map<string, i32>> map_of_string_to_map_of_string_to_i32\n   */\n  public Map<string, Map<string, int>> $map_of_string_to_map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 4: map<string, map<string, module.MyStruct>> map_of_string_to_map_of_string_to_MyStruct\n   */\n  public Map<string, Map<string, MyStruct>> $map_of_string_to_map_of_string_to_MyStruct;\n  /**\n   * Original thrift field:-\n   * 5: list<map<string, list<module.MyStruct>>> list_of_map_of_string_to_list_of_MyStruct\n   */\n  public Vector<Map<string, Vector<MyStruct>>> $list_of_map_of_string_to_list_of_MyStruct;\n  /**\n   * Original thrift field:-\n   * 6: list<map<string, module.MyStruct>> list_of_map_of_string_to_MyStruct\n   */\n  public Vector<Map<string, MyStruct>> $list_of_map_of_string_to_MyStruct;\n\n  public function __construct()[] {\n    $this->map_of_string_to_MyStruct = Map {};\n    $this->map_of_string_to_map_of_string_to_i32 = Map {};\n    $this->map_of_string_to_map_of_string_to_MyStruct = Map {};\n    $this->list_of_map_of_string_to_list_of_MyStruct = Vector {};\n    $this->list_of_map_of_string_to_MyStruct = Vector {};\n    $this->map_of_string_to_list_of_MyStruct = \\MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<Map<string, Vector<MyStruct>>, MyComplexStruct>(Map {}, 2, $this);\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static async function genFromShape(self::TConstructorShape $shape)[zoned_shallow]: Awaitable<this> {\n    $obj = new static();\n    $map_of_string_to_MyStruct = Shapes::idx($shape, 'map_of_string_to_MyStruct');\n    if ($map_of_string_to_MyStruct !== null) {\n      $obj->map_of_string_to_MyStruct = $map_of_string_to_MyStruct;\n    }\n    $map_of_string_to_list_of_MyStruct = Shapes::idx($shape, 'map_of_string_to_list_of_MyStruct');\n    if ($map_of_string_to_list_of_MyStruct !== null) {\n      await $obj->get_map_of_string_to_list_of_MyStruct()->genWrap($map_of_string_to_list_of_MyStruct);\n    }\n    $map_of_string_to_map_of_string_to_i32 = Shapes::idx($shape, 'map_of_string_to_map_of_string_to_i32');\n    if ($map_of_string_to_map_of_string_to_i32 !== null) {\n      $obj->map_of_string_to_map_of_string_to_i32 = $map_of_string_to_map_of_string_to_i32;\n    }\n    $map_of_string_to_map_of_string_to_MyStruct = Shapes::idx($shape, 'map_of_string_to_map_of_string_to_MyStruct');\n    if ($map_of_string_to_map_of_string_to_MyStruct !== null) {\n      $obj->map_of_string_to_map_of_string_to_MyStruct = $map_of_string_to_map_of_string_to_MyStruct;\n    }\n    $list_of_map_of_string_to_list_of_MyStruct = Shapes::idx($shape, 'list_of_map_of_string_to_list_of_MyStruct');\n    if ($list_of_map_of_string_to_list_of_MyStruct !== null) {\n      $obj->list_of_map_of_string_to_list_of_MyStruct = $list_of_map_of_string_to_list_of_MyStruct;\n    }\n    $list_of_map_of_string_to_MyStruct = Shapes::idx($shape, 'list_of_map_of_string_to_MyStruct');\n    if ($list_of_map_of_string_to_MyStruct !== null) {\n      $obj->list_of_map_of_string_to_MyStruct = $list_of_map_of_string_to_MyStruct;\n    }\n    return $obj;\n  }\n\n  public function getName()[]: string {\n    return 'MyComplexStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyComplexStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.MyStruct\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_MyStruct\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.MyStruct\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_MyStruct\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.MyStruct\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_MyStruct\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.MyStruct\",\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_list_of_MyStruct\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.MyStruct\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_MyStruct\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'map_of_string_to_list_of_MyStruct' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\FieldWrapper' => \\facebook\\thrift\\annotation\\hack\\FieldWrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyFieldWrapper\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static async function __genFromShape(self::TShape $shape): Awaitable<this> {\n    $obj = new static();\n    $obj->map_of_string_to_MyStruct = self::__stringifyMapKeys(\n      new Map(await Dict\\map_async(\n        $shape['map_of_string_to_MyStruct'],\n        async $val0 ==> \n          await MyStruct::__genFromShape($val0)\n      ))\n    );\n    $map_of_string_to_list_of_MyStruct = self::__stringifyMapKeys(\n      new Map(await Dict\\map_async(\n        $shape['map_of_string_to_list_of_MyStruct'],\n        async $val1 ==> \n          new Vector(await Vec\\map_async(\n            $val1,\n            async $val2 ==> \n              await MyStruct::__genFromShape($val2)\n          ))\n      ))\n    );\n    await $obj->get_map_of_string_to_list_of_MyStruct()->genWrap($map_of_string_to_list_of_MyStruct);\n    $obj->map_of_string_to_map_of_string_to_i32 = self::__stringifyMapKeys(\n      new Map(Dict\\map(\n        $shape['map_of_string_to_map_of_string_to_i32'],\n        $val3 ==> \n          self::__stringifyMapKeys(\n            new Map($val3)\n          )\n      ))\n    );\n    $obj->map_of_string_to_map_of_string_to_MyStruct = self::__stringifyMapKeys(\n      new Map(await Dict\\map_async(\n        $shape['map_of_string_to_map_of_string_to_MyStruct'],\n        async $val4 ==> \n          self::__stringifyMapKeys(\n            new Map(await Dict\\map_async(\n              $val4,\n              async $val5 ==> \n                await MyStruct::__genFromShape($val5)\n            ))\n          )\n      ))\n    );\n    $obj->list_of_map_of_string_to_list_of_MyStruct = new Vector(await Vec\\map_async(\n      $shape['list_of_map_of_string_to_list_of_MyStruct'],\n      async $val6 ==> \n        self::__stringifyMapKeys(\n          new Map(await Dict\\map_async(\n            $val6,\n            async $val7 ==> \n              new Vector(await Vec\\map_async(\n                $val7,\n                async $val8 ==> \n                  await MyStruct::__genFromShape($val8)\n              ))\n          ))\n        )\n    ));\n    $obj->list_of_map_of_string_to_MyStruct = new Vector(await Vec\\map_async(\n      $shape['list_of_map_of_string_to_MyStruct'],\n      async $val9 ==> \n        self::__stringifyMapKeys(\n          new Map(await Dict\\map_async(\n            $val9,\n            async $val10 ==> \n              await MyStruct::__genFromShape($val10)\n          ))\n        )\n    ));\n    return $obj;\n  }\n\n  public async function __genToShape(): Awaitable<self::TShape> {\n    $map_of_string_to_list_of_MyStruct = await ($this->map_of_string_to_list_of_MyStruct as nonnull)->genUnwrap();\n    return shape(\n      'map_of_string_to_MyStruct' => await Dict\\map_async(\n        $this->map_of_string_to_MyStruct,\n        async $val0 ==> \n          await $val0->__genToShape()\n      ),\n      'map_of_string_to_list_of_MyStruct' => await Dict\\map_async(\n        $map_of_string_to_list_of_MyStruct,\n        async $val0 ==> \n          await Vec\\map_async(\n            $val0,\n            async $val1 ==> \n              await $val1->__genToShape()\n          )\n      ),\n      'map_of_string_to_map_of_string_to_i32' => Dict\\map(\n        $this->map_of_string_to_map_of_string_to_i32,\n        $val0 ==> \n          dict($val0)\n      ),\n      'map_of_string_to_map_of_string_to_MyStruct' => await Dict\\map_async(\n        $this->map_of_string_to_map_of_string_to_MyStruct,\n        async $val0 ==> \n          await Dict\\map_async(\n            $val0,\n            async $val1 ==> \n              await $val1->__genToShape()\n          )\n      ),\n      'list_of_map_of_string_to_list_of_MyStruct' => await Vec\\map_async(\n        $this->list_of_map_of_string_to_list_of_MyStruct,\n        async $val0 ==> \n          await Dict\\map_async(\n            $val0,\n            async $val1 ==> \n              await Vec\\map_async(\n                $val1,\n                async $val2 ==> \n                  await $val2->__genToShape()\n              )\n          )\n      ),\n      'list_of_map_of_string_to_MyStruct' => await Vec\\map_async(\n        $this->list_of_map_of_string_to_MyStruct,\n        async $val0 ==> \n          await Dict\\map_async(\n            $val0,\n            async $val1 ==> \n              await $val1->__genToShape()\n          )\n      ),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'map_of_string_to_MyStruct') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, MyStruct>>($parsed['map_of_string_to_MyStruct']);\n      $_container4 = Map {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_value5 = MyStruct::withDefaultValues();\n        $_tmp6 = \\json_encode($_value2);\n        $_tmp7 = MyStruct::withDefaultValues();\n        $_tmp7->readFromJson($_tmp6);\n        $_value5 = $_tmp7;\n        $_container4[$_key1] = $_value5;\n      }\n      $this->map_of_string_to_MyStruct = $_container4;\n    }\n    if (idx($parsed, 'map_of_string_to_list_of_MyStruct') !== null) {\n      $_json11 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, Vector<MyStruct>>>($parsed['map_of_string_to_list_of_MyStruct']);\n      $_container12 = Map {};\n      foreach($_json11 as $_key9 => $_value10) {\n        $_value13 = Vector {};\n        $_json17 = $_value10;\n        $_container18 = Vector {};\n        foreach($_json17 as $_key15 => $_value16) {\n          $_elem19 = MyStruct::withDefaultValues();\n          $_tmp20 = \\json_encode($_value16);\n          $_tmp21 = MyStruct::withDefaultValues();\n          $_tmp21->readFromJson($_tmp20);\n          $_elem19 = $_tmp21;\n          $_container18 []= $_elem19;\n        }\n        $_value13 = $_container18;\n        $_container12[$_key9] = $_value13;\n      }\n      $this->map_of_string_to_list_of_MyStruct = $_container12;\n    }\n    if (idx($parsed, 'map_of_string_to_map_of_string_to_i32') !== null) {\n      $_json25 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, Map<string, int>>>($parsed['map_of_string_to_map_of_string_to_i32']);\n      $_container26 = Map {};\n      foreach($_json25 as $_key23 => $_value24) {\n        $_value27 = Map {};\n        $_json31 = $_value24;\n        $_container32 = Map {};\n        foreach($_json31 as $_key29 => $_value30) {\n          $_value33 = 0;\n          $_tmp34 = (int)$_value30;\n          if ($_tmp34 > 0x7fffffff) {\n            throw new \\TProtocolException(\"number exceeds limit in field\");\n          } else {\n            $_value33 = (int)$_tmp34;\n          }\n          $_container32[$_key29] = $_value33;\n        }\n        $_value27 = $_container32;\n        $_container26[$_key23] = $_value27;\n      }\n      $this->map_of_string_to_map_of_string_to_i32 = $_container26;\n    }\n    if (idx($parsed, 'map_of_string_to_map_of_string_to_MyStruct') !== null) {\n      $_json38 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, Map<string, MyStruct>>>($parsed['map_of_string_to_map_of_string_to_MyStruct']);\n      $_container39 = Map {};\n      foreach($_json38 as $_key36 => $_value37) {\n        $_value40 = Map {};\n        $_json44 = $_value37;\n        $_container45 = Map {};\n        foreach($_json44 as $_key42 => $_value43) {\n          $_value46 = MyStruct::withDefaultValues();\n          $_tmp47 = \\json_encode($_value43);\n          $_tmp48 = MyStruct::withDefaultValues();\n          $_tmp48->readFromJson($_tmp47);\n          $_value46 = $_tmp48;\n          $_container45[$_key42] = $_value46;\n        }\n        $_value40 = $_container45;\n        $_container39[$_key36] = $_value40;\n      }\n      $this->map_of_string_to_map_of_string_to_MyStruct = $_container39;\n    }\n    if (idx($parsed, 'list_of_map_of_string_to_list_of_MyStruct') !== null) {\n      $_json52 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<Map<string, Vector<MyStruct>>>>($parsed['list_of_map_of_string_to_list_of_MyStruct']);\n      $_container53 = Vector {};\n      foreach($_json52 as $_key50 => $_value51) {\n        $_elem54 = Map {};\n        $_json58 = $_value51;\n        $_container59 = Map {};\n        foreach($_json58 as $_key56 => $_value57) {\n          $_value60 = Vector {};\n          $_json64 = $_value57;\n          $_container65 = Vector {};\n          foreach($_json64 as $_key62 => $_value63) {\n            $_elem66 = MyStruct::withDefaultValues();\n            $_tmp67 = \\json_encode($_value63);\n            $_tmp68 = MyStruct::withDefaultValues();\n            $_tmp68->readFromJson($_tmp67);\n            $_elem66 = $_tmp68;\n            $_container65 []= $_elem66;\n          }\n          $_value60 = $_container65;\n          $_container59[$_key56] = $_value60;\n        }\n        $_elem54 = $_container59;\n        $_container53 []= $_elem54;\n      }\n      $this->list_of_map_of_string_to_list_of_MyStruct = $_container53;\n    }\n    if (idx($parsed, 'list_of_map_of_string_to_MyStruct') !== null) {\n      $_json72 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<Map<string, MyStruct>>>($parsed['list_of_map_of_string_to_MyStruct']);\n      $_container73 = Vector {};\n      foreach($_json72 as $_key70 => $_value71) {\n        $_elem74 = Map {};\n        $_json78 = $_value71;\n        $_container79 = Map {};\n        foreach($_json78 as $_key76 => $_value77) {\n          $_value80 = MyStruct::withDefaultValues();\n          $_tmp81 = \\json_encode($_value77);\n          $_tmp82 = MyStruct::withDefaultValues();\n          $_tmp82->readFromJson($_tmp81);\n          $_value80 = $_tmp82;\n          $_container79[$_key76] = $_value80;\n        }\n        $_elem74 = $_container79;\n        $_container73 []= $_elem74;\n      }\n      $this->list_of_map_of_string_to_MyStruct = $_container73;\n    }\n  }\n\n}\n\n", "num_lines": 1236}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * MyService\n */\ninterface MyServiceAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func(1: string arg1,\n   *        2: MyStruct arg2);\n   */\n  public function func(string $arg1, ?MyStruct $arg2): Awaitable<MyStruct>;\n\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func1(1: string arg1,\n   *         2: MyStruct arg2);\n   */\n  public function func1(string $arg1, ?MyStruct $arg2): Awaitable<MyStruct>;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ninterface MyServiceIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func(1: string arg1,\n   *        2: MyStruct arg2);\n   */\n  public function func(string $arg1, ?MyStruct $arg2): MyStruct;\n\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func1(1: string arg1,\n   *         2: MyStruct arg2);\n   */\n  public function func1(string $arg1, ?MyStruct $arg2): MyStruct;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ninterface MyServiceAsyncClientIf extends MyServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ninterface MyServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func(1: string arg1,\n   *        2: MyStruct arg2);\n   */\n  public function func(string $arg1, ?MyStruct $arg2): Awaitable<MyStruct>;\n\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func1(1: string arg1,\n   *         2: MyStruct arg2);\n   */\n  public function func1(string $arg1, ?MyStruct $arg2): Awaitable<MyStruct>;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ntrait MyServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass MyServiceAsyncClient extends \\ThriftClientBase implements MyServiceAsyncClientIf {\n  use MyServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func(1: string arg1,\n   *        2: MyStruct arg2);\n   */\n  public async function func(string $arg1, ?MyStruct $arg2): Awaitable<MyStruct> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_func_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"func\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"func\", false);\n    return await $this->genAwaitResponse(MyService_func_result::class, \"func\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func1(1: string arg1,\n   *         2: MyStruct arg2);\n   */\n  public async function func1(string $arg1, ?MyStruct $arg2): Awaitable<MyStruct> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_func1_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"func1\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"func1\", false);\n    return await $this->genAwaitResponse(MyService_func1_result::class, \"func1\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass MyServiceClient extends \\ThriftClientBase implements MyServiceClientIf {\n  use MyServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func(1: string arg1,\n   *        2: MyStruct arg2);\n   */\n  public async function func(string $arg1, ?MyStruct $arg2): Awaitable<MyStruct> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_func_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"func\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"func\", false);\n    return await $this->genAwaitResponse(MyService_func_result::class, \"func\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   func1(1: string arg1,\n   *         2: MyStruct arg2);\n   */\n  public async function func1(string $arg1, ?MyStruct $arg2): Awaitable<MyStruct> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_func1_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"func1\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"func1\", false);\n    return await $this->genAwaitResponse(MyService_func1_result::class, \"func1\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_func(string $arg1, ?MyStruct $arg2): int {\n    $args = MyService_func_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n    ));\n    return $this->sendImplHelper($args, \"func\", false);\n  }\n  public function recv_func(?int $expectedsequenceid = null): MyStruct {\n    return $this->recvImplHelper(MyService_func_result::class, \"func\", false, $expectedsequenceid);\n  }\n  public function send_func1(string $arg1, ?MyStruct $arg2): int {\n    $args = MyService_func1_args::fromShape(shape(\n      'arg1' => $arg1,\n      'arg2' => $arg2,\n    ));\n    return $this->sendImplHelper($args, \"func1\", false);\n  }\n  public function recv_func1(?int $expectedsequenceid = null): MyStruct {\n    return $this->recvImplHelper(MyService_func1_result::class, \"func1\", false, $expectedsequenceid);\n  }\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass MyService_func_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishAsyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'arg1',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'arg2',\n      'type' => \\TType::STRUCT,\n      'class' => MyStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'arg1' => 1,\n    'arg2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'arg1' => ?string,\n    ?'arg2' => ?MyStruct,\n  );\n\n  const type TShape = shape(\n    'arg1' => string,\n    ?'arg2' => ?MyStruct::TShape,\n  );\n  const int STRUCTURAL_ID = 6560600906529955702;\n  public string $arg1;\n  public ?MyStruct $arg2;\n\n  public function __construct(?string $arg1 = null, ?MyStruct $arg2 = null)[] {\n    $this->arg1 = $arg1 ?? '';\n    $this->arg2 = $arg2;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'arg1'),\n      Shapes::idx($shape, 'arg2'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_func_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.func_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"arg1\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"arg2\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static async function __genFromShape(self::TShape $shape): Awaitable<this> {\n    $obj = new static();\n    $obj->arg1 = $shape['arg1'];\n    $arg2 = Shapes::idx($shape, 'arg2');\n    if ($arg2 !== null) {\n      $obj->arg2 = await MyStruct::__genFromShape($arg2);\n    }\n    return $obj;\n  }\n\n  public async function __genToShape(): Awaitable<self::TShape> {\n    return shape(\n      'arg1' => $this->arg1,\n      'arg2' => await ($this->arg2 === null \n        ? null \n        : (\n        $this->arg2->__genToShape()\n        )\n      ),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'arg1') !== null) {\n      $this->arg1 = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['arg1']);\n    }\n    if (idx($parsed, 'arg2') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, MyStruct>($parsed['arg2']));\n      $_tmp1 = MyStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->arg2 = $_tmp1;\n    }\n  }\n\n}\n\nclass MyService_func_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = MyStruct;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => MyStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 7307096097859369800;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_func_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_func_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, MyStruct>($parsed['success']));\n      $_tmp1 = MyStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->success = $_tmp1;\n    }\n  }\n\n}\n\nclass MyService_func1_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishAsyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'arg1',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'arg2',\n      'type' => \\TType::STRUCT,\n      'class' => MyStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'arg1' => 1,\n    'arg2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'arg1' => ?string,\n    ?'arg2' => ?MyStruct,\n  );\n\n  const type TShape = shape(\n    'arg1' => string,\n    ?'arg2' => ?MyStruct::TShape,\n  );\n  const int STRUCTURAL_ID = 6560600906529955702;\n  public string $arg1;\n  public ?MyStruct $arg2;\n\n  public function __construct(?string $arg1 = null, ?MyStruct $arg2 = null)[] {\n    $this->arg1 = $arg1 ?? '';\n    $this->arg2 = $arg2;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'arg1'),\n      Shapes::idx($shape, 'arg2'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_func1_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.func1_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"arg1\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"arg2\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static async function __genFromShape(self::TShape $shape): Awaitable<this> {\n    $obj = new static();\n    $obj->arg1 = $shape['arg1'];\n    $arg2 = Shapes::idx($shape, 'arg2');\n    if ($arg2 !== null) {\n      $obj->arg2 = await MyStruct::__genFromShape($arg2);\n    }\n    return $obj;\n  }\n\n  public async function __genToShape(): Awaitable<self::TShape> {\n    return shape(\n      'arg1' => $this->arg1,\n      'arg2' => await ($this->arg2 === null \n        ? null \n        : (\n        $this->arg2->__genToShape()\n        )\n      ),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'arg1') !== null) {\n      $this->arg1 = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['arg1']);\n    }\n    if (idx($parsed, 'arg2') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, MyStruct>($parsed['arg2']));\n      $_tmp1 = MyStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->arg2 = $_tmp1;\n    }\n  }\n\n}\n\nclass MyService_func1_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = MyStruct;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => MyStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 7307096097859369800;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_func1_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_func1_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, MyStruct>($parsed['success']));\n      $_tmp1 = MyStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->success = $_tmp1;\n    }\n  }\n\n}\n\nclass MyServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.MyService\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"func\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                      )\n                    ),\n                    \"name\" => \"arg1\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.MyStruct\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"arg2\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"func1\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                      )\n                    ),\n                    \"name\" => \"arg1\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.MyStruct\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"arg2\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n              'module.MyStruct' => MyStruct::getStructMetadata(),\n              'module.MyNestedStruct' => MyNestedStruct::getStructMetadata(),\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 839}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1660}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\hack;\n\n/**\n * Original thrift struct:-\n * FieldWrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/FieldWrapper'))>>\nclass FieldWrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldWrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.FieldWrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Wrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Wrapper'))>>\nclass Wrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'underlyingName',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'extraNamespace',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'underlyingName' => 2,\n    'extraNamespace' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'underlyingName' => ?string,\n    ?'extraNamespace' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 1284986773698322040;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string underlyingName\n   */\n  public string $underlyingName;\n  /**\n   * Original thrift field:-\n   * 3: string extraNamespace\n   */\n  public string $extraNamespace;\n\n  public function __construct(?string $name = null, ?string $underlyingName = null, ?string $extraNamespace = null)[] {\n    $this->name = $name ?? '';\n    $this->underlyingName = $underlyingName ?? '';\n    $this->extraNamespace = $extraNamespace ?? \"thrift_adapted_types\";\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'underlyingName'),\n      Shapes::idx($shape, 'extraNamespace'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Wrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Wrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"underlyingName\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"extraNamespace\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * SkipCodegen\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/SkipCodegen'))>>\nclass SkipCodegen implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'reason' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'reason' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 3707764047816594739;\n  /**\n   * Original thrift field:-\n   * 1: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $reason = null)[] {\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SkipCodegen';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.SkipCodegen\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Name\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Name'))>>\nclass Name implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'reason' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'reason' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 4844827548325959202;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $name = null, ?string $reason = null)[] {\n    $this->name = $name ?? '';\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Name';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Name\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * UnionEnumAttributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/UnionEnumAttributes'))>>\nclass UnionEnumAttributes implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?Vector<string>,\n  );\n\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public Vector<string> $attributes;\n\n  public function __construct(?Vector<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'UnionEnumAttributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.UnionEnumAttributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructTrait'))>>\nclass StructTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructTrait\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Attributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Attributes'))>>\nclass Attributes implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?Vector<string>,\n  );\n\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public Vector<string> $attributes;\n\n  public function __construct(?Vector<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Attributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Attributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructAsTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructAsTrait'))>>\nclass StructAsTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructAsTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructAsTrait\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ModuleInternal\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/ModuleInternal'))>>\nclass ModuleInternal implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ModuleInternal';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.ModuleInternal\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1017}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace hack\\fixtures;\n\nmodule hack.module.internal;\n/**\n * Original thrift enum:-\n * FooEnum\n */\nenum FooEnum: int {\n}\n\nclass FooEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.FooEnum\",\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\ModuleInternal' => \\facebook\\thrift\\annotation\\hack\\ModuleInternal::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * Foo\n */\nclass Foo implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'i_field',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'str_field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'i_field' => 1,\n    'str_field' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'i_field' => ?int,\n    ?'str_field' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 7422449121106253639;\n  /**\n   * Original thrift field:-\n   * 1: i32 i_field\n   */\n  public int $i_field;\n  /**\n   * Original thrift field:-\n   * 2: string str_field\n   */\n  public string $str_field;\n\n  public function __construct(?int $i_field = null, ?string $str_field = null)[] {\n    $this->i_field = $i_field ?? 0;\n    $this->str_field = $str_field ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'i_field'),\n      Shapes::idx($shape, 'str_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Foo\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"str_field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\ModuleInternal' => \\facebook\\thrift\\annotation\\hack\\ModuleInternal::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n        'str_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\ModuleInternal' => \\facebook\\thrift\\annotation\\hack\\ModuleInternal::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nenum FooUnionEnum: int {\n  _EMPTY_ = 0;\n  int_field = 1;\n  str_field = 2;\n}\n\n/**\n * Original thrift struct:-\n * FooUnion\n */\nclass FooUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<\\hack\\fixtures\\FooUnionEnum> {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'int_field',\n      'union' => true,\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'str_field',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'int_field' => 1,\n    'str_field' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'int_field' => ?int,\n    ?'str_field' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 3905905529819142594;\n  /**\n   * Original thrift field:-\n   * 1: i32 int_field\n   */\n  public ?int $int_field;\n  /**\n   * Original thrift field:-\n   * 2: string str_field\n   */\n  public ?string $str_field;\n  protected \\hack\\fixtures\\FooUnionEnum $_type = \\hack\\fixtures\\FooUnionEnum::_EMPTY_;\n\n  public function __construct(?int $int_field = null, ?string $str_field = null)[] {\n    $this->_type = \\hack\\fixtures\\FooUnionEnum::_EMPTY_;\n    if ($int_field !== null) {\n      $this->int_field = $int_field;\n      $this->_type = \\hack\\fixtures\\FooUnionEnum::int_field;\n    }\n    if ($str_field !== null) {\n      $this->str_field = $str_field;\n      $this->_type = \\hack\\fixtures\\FooUnionEnum::str_field;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'int_field'),\n      Shapes::idx($shape, 'str_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FooUnion';\n  }\n\n  public function getType()[]: \\hack\\fixtures\\FooUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case \\hack\\fixtures\\FooUnionEnum::int_field:\n        $this->int_field = null;\n        break;\n      case \\hack\\fixtures\\FooUnionEnum::str_field:\n        $this->str_field = null;\n        break;\n      case \\hack\\fixtures\\FooUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = \\hack\\fixtures\\FooUnionEnum::_EMPTY_;\n  }\n\n  public function set_int_field(int $int_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\hack\\fixtures\\FooUnionEnum::int_field;\n    $this->int_field = $int_field;\n    return $this;\n  }\n\n  public function get_int_field()[]: ?int {\n    return $this->int_field;\n  }\n\n  public function getx_int_field()[]: int {\n    invariant(\n      $this->_type === \\hack\\fixtures\\FooUnionEnum::int_field,\n      'get_int_field called on an instance of FooUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->int_field as nonnull;\n  }\n\n  public function set_str_field(string $str_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\hack\\fixtures\\FooUnionEnum::str_field;\n    $this->str_field = $str_field;\n    return $this;\n  }\n\n  public function get_str_field()[]: ?string {\n    return $this->str_field;\n  }\n\n  public function getx_str_field()[]: string {\n    invariant(\n      $this->_type === \\hack\\fixtures\\FooUnionEnum::str_field,\n      'get_str_field called on an instance of FooUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->str_field as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.FooUnion\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"int_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"str_field\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\ModuleInternal' => \\facebook\\thrift\\annotation\\hack\\ModuleInternal::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 353}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1228}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace hack\\fixtures;\n\nmodule hack.module.internal;\n/**\n * Original thrift service:-\n * TestServiceWithMethodAnnotation\n */\ninterface TestServiceWithMethodAnnotationAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   testMethodWithAnnotation();\n   */\n  internal function testMethodWithAnnotation(): Awaitable<int>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   testMethodWithoutAnnotation();\n   */\n  public function testMethodWithoutAnnotation(): Awaitable<void>;\n}\n\n/**\n * Original thrift service:-\n * TestServiceWithMethodAnnotation\n */\ninterface TestServiceWithMethodAnnotationIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   testMethodWithAnnotation();\n   */\n  internal function testMethodWithAnnotation(): int;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   testMethodWithoutAnnotation();\n   */\n  public function testMethodWithoutAnnotation(): void;\n}\n\n/**\n * Original thrift service:-\n * TestServiceWithMethodAnnotation\n */\ninterface TestServiceWithMethodAnnotationAsyncClientIf extends TestServiceWithMethodAnnotationAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * TestServiceWithMethodAnnotation\n */\ninterface TestServiceWithMethodAnnotationClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   testMethodWithAnnotation();\n   */\n  internal function testMethodWithAnnotation(): Awaitable<int>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   testMethodWithoutAnnotation();\n   */\n  public function testMethodWithoutAnnotation(): Awaitable<void>;\n}\n\n/**\n * Original thrift service:-\n * TestServiceWithMethodAnnotation\n */\ntrait TestServiceWithMethodAnnotationClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass TestServiceWithMethodAnnotationAsyncClient extends \\ThriftClientBase implements TestServiceWithMethodAnnotationAsyncClientIf {\n  use TestServiceWithMethodAnnotationClientBase;\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   testMethodWithAnnotation();\n   */\n  internal async function testMethodWithAnnotation(): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\hack\\fixtures\\TestServiceWithMethodAnnotation_testMethodWithAnnotation_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"TestServiceWithMethodAnnotation\", \"testMethodWithAnnotation\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"testMethodWithAnnotation\", false);\n    return await $this->genAwaitResponse(\\hack\\fixtures\\TestServiceWithMethodAnnotation_testMethodWithAnnotation_result::class, \"testMethodWithAnnotation\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   testMethodWithoutAnnotation();\n   */\n  public async function testMethodWithoutAnnotation(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\hack\\fixtures\\TestServiceWithMethodAnnotation_testMethodWithoutAnnotation_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"TestServiceWithMethodAnnotation\", \"testMethodWithoutAnnotation\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"testMethodWithoutAnnotation\", false);\n    await $this->genAwaitResponse(\\hack\\fixtures\\TestServiceWithMethodAnnotation_testMethodWithoutAnnotation_result::class, \"testMethodWithoutAnnotation\", true, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass TestServiceWithMethodAnnotationClient extends \\ThriftClientBase implements TestServiceWithMethodAnnotationClientIf {\n  use TestServiceWithMethodAnnotationClientBase;\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   testMethodWithAnnotation();\n   */\n  internal async function testMethodWithAnnotation(): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\hack\\fixtures\\TestServiceWithMethodAnnotation_testMethodWithAnnotation_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"TestServiceWithMethodAnnotation\", \"testMethodWithAnnotation\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"testMethodWithAnnotation\", false);\n    return await $this->genAwaitResponse(\\hack\\fixtures\\TestServiceWithMethodAnnotation_testMethodWithAnnotation_result::class, \"testMethodWithAnnotation\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   testMethodWithoutAnnotation();\n   */\n  public async function testMethodWithoutAnnotation(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\hack\\fixtures\\TestServiceWithMethodAnnotation_testMethodWithoutAnnotation_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"TestServiceWithMethodAnnotation\", \"testMethodWithoutAnnotation\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"testMethodWithoutAnnotation\", false);\n    await $this->genAwaitResponse(\\hack\\fixtures\\TestServiceWithMethodAnnotation_testMethodWithoutAnnotation_result::class, \"testMethodWithoutAnnotation\", true, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  internal function send_testMethodWithAnnotation(): int {\n    $args = \\hack\\fixtures\\TestServiceWithMethodAnnotation_testMethodWithAnnotation_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"testMethodWithAnnotation\", false);\n  }\n  internal function recv_testMethodWithAnnotation(?int $expectedsequenceid = null): int {\n    return $this->recvImplHelper(\\hack\\fixtures\\TestServiceWithMethodAnnotation_testMethodWithAnnotation_result::class, \"testMethodWithAnnotation\", false, $expectedsequenceid);\n  }\n  public function send_testMethodWithoutAnnotation(): int {\n    $args = \\hack\\fixtures\\TestServiceWithMethodAnnotation_testMethodWithoutAnnotation_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"testMethodWithoutAnnotation\", false);\n  }\n  public function recv_testMethodWithoutAnnotation(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(\\hack\\fixtures\\TestServiceWithMethodAnnotation_testMethodWithoutAnnotation_result::class, \"testMethodWithoutAnnotation\", true, $expectedsequenceid);\n  }\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass TestServiceWithMethodAnnotation_testMethodWithAnnotation_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestServiceWithMethodAnnotation_testMethodWithAnnotation_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.testMethodWithAnnotation_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass TestServiceWithMethodAnnotation_testMethodWithAnnotation_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 3865318819874171525;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestServiceWithMethodAnnotation_testMethodWithAnnotation_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TestServiceWithMethodAnnotation_testMethodWithAnnotation_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass TestServiceWithMethodAnnotation_testMethodWithoutAnnotation_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestServiceWithMethodAnnotation_testMethodWithoutAnnotation_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.testMethodWithoutAnnotation_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass TestServiceWithMethodAnnotation_testMethodWithoutAnnotation_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestServiceWithMethodAnnotation_testMethodWithoutAnnotation_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TestServiceWithMethodAnnotation_testMethodWithoutAnnotation_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass TestServiceWithMethodAnnotationStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return \\tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.TestServiceWithMethodAnnotation\",\n        \"functions\" => vec[\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"testMethodWithAnnotation\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n            )\n          ),\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"testMethodWithoutAnnotation\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n        'testMethodWithAnnotation' => dict[\n          '\\facebook\\thrift\\annotation\\hack\\ModuleInternal' => \\facebook\\thrift\\annotation\\hack\\ModuleInternal::fromShape(\n            shape(\n            )\n          ),\n        ],\n      ],\n    );\n  }\n}\n\n", "num_lines": 502}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace hack\\fixtures;\n\nmodule hack.module.internal;\n/**\n * Original thrift service:-\n * TestServiceWithServiceAnnotation\n */\ninterface TestServiceWithServiceAnnotationAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   testMethodWithServiceAnnotation();\n   */\n  internal function testMethodWithServiceAnnotation(): Awaitable<int>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   testMethodWithServiceAnnotation2();\n   */\n  internal function testMethodWithServiceAnnotation2(): Awaitable<void>;\n}\n\n/**\n * Original thrift service:-\n * TestServiceWithServiceAnnotation\n */\ninterface TestServiceWithServiceAnnotationIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   testMethodWithServiceAnnotation();\n   */\n  internal function testMethodWithServiceAnnotation(): int;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   testMethodWithServiceAnnotation2();\n   */\n  internal function testMethodWithServiceAnnotation2(): void;\n}\n\n/**\n * Original thrift service:-\n * TestServiceWithServiceAnnotation\n */\ninterface TestServiceWithServiceAnnotationAsyncClientIf extends TestServiceWithServiceAnnotationAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * TestServiceWithServiceAnnotation\n */\ninterface TestServiceWithServiceAnnotationClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   testMethodWithServiceAnnotation();\n   */\n  internal function testMethodWithServiceAnnotation(): Awaitable<int>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   testMethodWithServiceAnnotation2();\n   */\n  internal function testMethodWithServiceAnnotation2(): Awaitable<void>;\n}\n\n/**\n * Original thrift service:-\n * TestServiceWithServiceAnnotation\n */\ntrait TestServiceWithServiceAnnotationClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass TestServiceWithServiceAnnotationAsyncClient extends \\ThriftClientBase implements TestServiceWithServiceAnnotationAsyncClientIf {\n  use TestServiceWithServiceAnnotationClientBase;\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   testMethodWithServiceAnnotation();\n   */\n  internal async function testMethodWithServiceAnnotation(): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\hack\\fixtures\\TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"TestServiceWithServiceAnnotation\", \"testMethodWithServiceAnnotation\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"testMethodWithServiceAnnotation\", false);\n    return await $this->genAwaitResponse(\\hack\\fixtures\\TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation_result::class, \"testMethodWithServiceAnnotation\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   testMethodWithServiceAnnotation2();\n   */\n  internal async function testMethodWithServiceAnnotation2(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\hack\\fixtures\\TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation2_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"TestServiceWithServiceAnnotation\", \"testMethodWithServiceAnnotation2\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"testMethodWithServiceAnnotation2\", false);\n    await $this->genAwaitResponse(\\hack\\fixtures\\TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation2_result::class, \"testMethodWithServiceAnnotation2\", true, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass TestServiceWithServiceAnnotationClient extends \\ThriftClientBase implements TestServiceWithServiceAnnotationClientIf {\n  use TestServiceWithServiceAnnotationClientBase;\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   testMethodWithServiceAnnotation();\n   */\n  internal async function testMethodWithServiceAnnotation(): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\hack\\fixtures\\TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"TestServiceWithServiceAnnotation\", \"testMethodWithServiceAnnotation\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"testMethodWithServiceAnnotation\", false);\n    return await $this->genAwaitResponse(\\hack\\fixtures\\TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation_result::class, \"testMethodWithServiceAnnotation\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   testMethodWithServiceAnnotation2();\n   */\n  internal async function testMethodWithServiceAnnotation2(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\hack\\fixtures\\TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation2_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"TestServiceWithServiceAnnotation\", \"testMethodWithServiceAnnotation2\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"testMethodWithServiceAnnotation2\", false);\n    await $this->genAwaitResponse(\\hack\\fixtures\\TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation2_result::class, \"testMethodWithServiceAnnotation2\", true, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  internal function send_testMethodWithServiceAnnotation(): int {\n    $args = \\hack\\fixtures\\TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"testMethodWithServiceAnnotation\", false);\n  }\n  internal function recv_testMethodWithServiceAnnotation(?int $expectedsequenceid = null): int {\n    return $this->recvImplHelper(\\hack\\fixtures\\TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation_result::class, \"testMethodWithServiceAnnotation\", false, $expectedsequenceid);\n  }\n  internal function send_testMethodWithServiceAnnotation2(): int {\n    $args = \\hack\\fixtures\\TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation2_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"testMethodWithServiceAnnotation2\", false);\n  }\n  internal function recv_testMethodWithServiceAnnotation2(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(\\hack\\fixtures\\TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation2_result::class, \"testMethodWithServiceAnnotation2\", true, $expectedsequenceid);\n  }\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.testMethodWithServiceAnnotation_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 3865318819874171525;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation2_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation2_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.testMethodWithServiceAnnotation2_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation2_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation2_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TestServiceWithServiceAnnotation_testMethodWithServiceAnnotation2_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass TestServiceWithServiceAnnotationStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return \\tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.TestServiceWithServiceAnnotation\",\n        \"functions\" => vec[\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"testMethodWithServiceAnnotation\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n            )\n          ),\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"testMethodWithServiceAnnotation2\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[\n        '\\facebook\\thrift\\annotation\\hack\\ModuleInternal' => \\facebook\\thrift\\annotation\\hack\\ModuleInternal::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 501}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace foo\\hack_ns;\n\n/**\n * Original thrift service:-\n * FooHackService\n */\ninterface FooHackServiceAsyncIf extends \\IThriftAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * FooHackService\n */\ninterface FooHackServiceIf extends \\IThriftSyncIf {\n}\n\n/**\n * Original thrift service:-\n * FooHackService\n */\ninterface FooHackServiceAsyncClientIf extends FooHackServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * FooHackService\n */\ninterface FooHackServiceClientIf extends \\IThriftSyncIf {\n}\n\n/**\n * Original thrift service:-\n * FooHackService\n */\ntrait FooHackServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass FooHackServiceAsyncClient extends \\ThriftClientBase implements FooHackServiceAsyncClientIf {\n  use FooHackServiceClientBase;\n\n}\n\nclass FooHackServiceClient extends \\ThriftClientBase implements FooHackServiceClientIf {\n  use FooHackServiceClientBase;\n\n  /* send and recv functions */\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass FooHackServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return \\tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.FooHackService\",\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 108}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace hack_ns2;\n\n/**\n * Original thrift enum:-\n * Status\n */\nenum Status: int {\n  Unknown = 0;\n}\n\nclass Status_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module2.Status\",\n        \"elements\" => dict[\n          0 => \"Unknown\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * FBStruct\n */\nclass FBStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'str_value',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'str_value' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'str_value' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 7258556236863001185;\n  /**\n   * Original thrift field:-\n   * 1: string str_value\n   */\n  public string $str_value;\n\n  public function __construct(?string $str_value = null)[] {\n    $this->str_value = $str_value ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'str_value'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FBStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module2.FBStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"str_value\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 125}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace foo\\hack_ns;\n\n/**\n * Original thrift enum:-\n * Status\n */\nenum Status: int {\n  Unknown = 0;\n}\n\nclass Status_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.Status\",\n        \"elements\" => dict[\n          0 => \"Unknown\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * TestStruct\n */\nclass TestStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'str_value',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'str_value' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'str_value' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 7258556236863001185;\n  /**\n   * Original thrift field:-\n   * 1: string str_value\n   */\n  public string $str_value;\n\n  public function __construct(?string $str_value = null)[] {\n    $this->str_value = $str_value ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'str_value'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TestStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"str_value\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 125}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace hack_ns2;\n\n/**\n * Original thrift service:-\n * TestService\n */\ninterface TestServiceAsyncIf extends \\foo\\hack_ns\\FooHackServiceAsyncIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   ping(1: string str_arg);\n   */\n  public function ping(string $str_arg): Awaitable<int>;\n}\n\n/**\n * Original thrift service:-\n * TestService\n */\ninterface TestServiceIf extends \\foo\\hack_ns\\FooHackServiceIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   ping(1: string str_arg);\n   */\n  public function ping(string $str_arg): int;\n}\n\n/**\n * Original thrift service:-\n * TestService\n */\ninterface TestServiceAsyncClientIf extends TestServiceAsyncIf, \\foo\\hack_ns\\FooHackServiceAsyncClientIf {\n}\n\n/**\n * Original thrift service:-\n * TestService\n */\ninterface TestServiceClientIf extends \\foo\\hack_ns\\FooHackServiceClientIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   ping(1: string str_arg);\n   */\n  public function ping(string $str_arg): Awaitable<int>;\n}\n\n/**\n * Original thrift service:-\n * TestService\n */\ntrait TestServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass TestServiceAsyncClient extends \\foo\\hack_ns\\FooHackServiceAsyncClient implements TestServiceAsyncClientIf {\n  use TestServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   ping(1: string str_arg);\n   */\n  public async function ping(string $str_arg): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\hack_ns2\\TestService_ping_args::fromShape(shape(\n      'str_arg' => $str_arg,\n    ));\n    await $this->asyncHandler_->genBefore(\"TestService\", \"ping\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"ping\", false);\n    return await $this->genAwaitResponse(\\hack_ns2\\TestService_ping_result::class, \"ping\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass TestServiceClient extends \\foo\\hack_ns\\FooHackServiceClient implements TestServiceClientIf {\n  use TestServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   ping(1: string str_arg);\n   */\n  public async function ping(string $str_arg): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\hack_ns2\\TestService_ping_args::fromShape(shape(\n      'str_arg' => $str_arg,\n    ));\n    await $this->asyncHandler_->genBefore(\"TestService\", \"ping\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"ping\", false);\n    return await $this->genAwaitResponse(\\hack_ns2\\TestService_ping_result::class, \"ping\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_ping(string $str_arg): int {\n    $args = \\hack_ns2\\TestService_ping_args::fromShape(shape(\n      'str_arg' => $str_arg,\n    ));\n    return $this->sendImplHelper($args, \"ping\", false);\n  }\n  public function recv_ping(?int $expectedsequenceid = null): int {\n    return $this->recvImplHelper(\\hack_ns2\\TestService_ping_result::class, \"ping\", false, $expectedsequenceid);\n  }\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass TestService_ping_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'str_arg',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'str_arg' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'str_arg' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 5542358918184482101;\n  public string $str_arg;\n\n  public function __construct(?string $str_arg = null)[] {\n    $this->str_arg = $str_arg ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'str_arg'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestService_ping_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module2.ping_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"str_arg\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass TestService_ping_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 3865318819874171525;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestService_ping_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module2.TestService_ping_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass TestServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return \\tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module2.TestService\",\n        \"functions\" => vec[\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"ping\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                      )\n                    ),\n                    \"name\" => \"str_arg\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n        \"parent\" => \"module.FooHackService\",\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module2',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n              'module.FooHackService' => \\foo\\hack_ns\\FooHackServiceStaticMetadata::getServiceMetadata(),\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 356}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace include_typedef;\n\ntype MyI32 = int;\n/**\n * Original thrift struct:-\n * Foo\n */\nclass Foo implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'i_field',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'i_field2',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'i_field' => 1,\n    'i_field2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'i_field' => ?\\include_typedef\\MyI32,\n    ?'i_field2' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 4034280781637513039;\n  /**\n   * Original thrift field:-\n   * 1: include.MyI32 i_field\n   */\n  public \\include_typedef\\MyI32 $i_field;\n  /**\n   * Original thrift field:-\n   * 2: i32 i_field2\n   */\n  public int $i_field2;\n\n  public function __construct(?\\include_typedef\\MyI32 $i_field = null, ?int $i_field2 = null)[] {\n    $this->i_field = $i_field ?? 0;\n    $this->i_field2 = $i_field2 ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'i_field'),\n      Shapes::idx($shape, 'i_field2'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"include.Foo\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"include.MyI32\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"i_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i_field2\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 130}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace module_typedef;\n\ntype MyI32 = int;\n/**\n * Original thrift struct:-\n * Foo\n */\nclass Foo implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'i_field',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'i_field2',\n      'type' => \\TType::I32,\n    ),\n    3 => shape(\n      'var' => 'i_field3',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'i_field' => 1,\n    'i_field2' => 2,\n    'i_field3' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'i_field' => ?\\include_typedef\\MyI32,\n    ?'i_field2' => ?\\module_typedef\\MyI32,\n    ?'i_field3' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 4166182619516796800;\n  /**\n   * Original thrift field:-\n   * 1: include.MyI32 i_field\n   */\n  public \\include_typedef\\MyI32 $i_field;\n  /**\n   * Original thrift field:-\n   * 2: module.MyI32 i_field2\n   */\n  public \\module_typedef\\MyI32 $i_field2;\n  /**\n   * Original thrift field:-\n   * 3: i32 i_field3\n   */\n  public int $i_field3;\n\n  public function __construct(?\\include_typedef\\MyI32 $i_field = null, ?\\module_typedef\\MyI32 $i_field2 = null, ?int $i_field3 = null)[] {\n    $this->i_field = $i_field ?? 0;\n    $this->i_field2 = $i_field2 ?? 0;\n    $this->i_field3 = $i_field3 ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'i_field'),\n      Shapes::idx($shape, 'i_field2'),\n      Shapes::idx($shape, 'i_field3'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Foo\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"include.MyI32\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"i_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyI32\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"i_field2\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i_field3\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 163}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\ntype include_typedef_IncludedMyI32 = int;\n/**\n * Original thrift struct:-\n * IncludedFoo\n */\nclass include_typedef_IncludedFoo implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'i_field',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'i_field2',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'i_field' => 1,\n    'i_field2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'i_field' => ?include_typedef_IncludedMyI32,\n    ?'i_field2' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 134695345279680724;\n  /**\n   * Original thrift field:-\n   * 1: php_include.IncludedMyI32 i_field\n   */\n  public include_typedef_IncludedMyI32 $i_field;\n  /**\n   * Original thrift field:-\n   * 2: i32 i_field2\n   */\n  public int $i_field2;\n\n  public function __construct(?include_typedef_IncludedMyI32 $i_field = null, ?int $i_field2 = null)[] {\n    $this->i_field = $i_field ?? 0;\n    $this->i_field2 = $i_field2 ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'i_field'),\n      Shapes::idx($shape, 'i_field2'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'IncludedFoo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"php_include.IncludedFoo\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"php_include.IncludedMyI32\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"i_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i_field2\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 128}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\ntype include_typedef_MyI32 = int;\n/**\n * Original thrift struct:-\n * Foo\n */\nclass include_typedef_Foo implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'i_field',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'i_field2',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'i_field' => 1,\n    'i_field2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'i_field' => ?include_typedef_MyI32,\n    ?'i_field2' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 4034280781637513039;\n  /**\n   * Original thrift field:-\n   * 1: php_module.MyI32 i_field\n   */\n  public include_typedef_MyI32 $i_field;\n  /**\n   * Original thrift field:-\n   * 2: i32 i_field2\n   */\n  public int $i_field2;\n\n  public function __construct(?include_typedef_MyI32 $i_field = null, ?int $i_field2 = null)[] {\n    $this->i_field = $i_field ?? 0;\n    $this->i_field2 = $i_field2 ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'i_field'),\n      Shapes::idx($shape, 'i_field2'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"php_module.Foo\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"php_module.MyI32\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"i_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i_field2\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 128}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift struct:-\n * Fields\n */\nclass Fields implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    100 => shape(\n      'var' => 'injected_field',\n      'type' => \\TType::STRING,\n    ),\n    101 => shape(\n      'var' => 'injected_structured_annotation_field',\n      'type' => \\TType::STRING,\n    ),\n    102 => shape(\n      'var' => 'injected_unstructured_annotation_field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'injected_field' => 100,\n    'injected_structured_annotation_field' => 101,\n    'injected_unstructured_annotation_field' => 102,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'injected_field' => ?string,\n    ?'injected_structured_annotation_field' => ?string,\n    ?'injected_unstructured_annotation_field' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 1725960953533133382;\n  /**\n   * Original thrift field:-\n   * 100: string injected_field\n   */\n  public string $injected_field;\n  /**\n   * Original thrift field:-\n   * 101: string injected_structured_annotation_field\n   */\n  public ?string $injected_structured_annotation_field;\n  /**\n   * Original thrift field:-\n   * 102: string injected_unstructured_annotation_field\n   */\n  public ?string $injected_unstructured_annotation_field;\n\n  public function __construct(?string $injected_field = null, ?string $injected_structured_annotation_field = null, ?string $injected_unstructured_annotation_field = null)[] {\n    $this->injected_field = $injected_field ?? '';\n    $this->injected_structured_annotation_field = $injected_structured_annotation_field;\n    $this->injected_unstructured_annotation_field = $injected_unstructured_annotation_field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'injected_field'),\n      Shapes::idx($shape, 'injected_structured_annotation_field'),\n      Shapes::idx($shape, 'injected_unstructured_annotation_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Fields';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"foo.Fields\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 100,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"injected_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 101,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"injected_structured_annotation_field\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 102,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"injected_unstructured_annotation_field\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'injected_structured_annotation_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\Box' => \\facebook\\thrift\\annotation\\Box::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 153}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Original thrift struct:-\n * InjectMetadataFields\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/InjectMetadataFields'))>>\nclass InjectMetadataFields implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'type',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'type' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'type' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 75466648195691209;\n  /**\n   * Original thrift field:-\n   * 1: string type\n   */\n  public string $type;\n\n  public function __construct(?string $type = null)[] {\n    $this->type = $type ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'InjectMetadataFields';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"internal.InjectMetadataFields\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"type\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 106}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift struct:-\n * Fields\n */\nclass Fields implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    100 => shape(\n      'var' => 'injected_field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'injected_field' => 100,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'injected_field' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 8264058527515912971;\n  /**\n   * Original thrift field:-\n   * 100: string injected_field\n   */\n  public string $injected_field;\n\n  public function __construct(?string $injected_field = null)[] {\n    $this->injected_field = $injected_field ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'injected_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Fields';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Fields\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 100,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"injected_field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * FieldsInjectedToEmptyStruct\n */\nclass FieldsInjectedToEmptyStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    -1100 => shape(\n      'var' => 'injected_field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'injected_field' => -1100,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'injected_field' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 4521072312993129309;\n  /**\n   * Original thrift field:-\n   * -1100: string injected_field\n   */\n  public string $injected_field;\n\n  public function __construct(?string $injected_field = null)[] {\n    $this->injected_field = $injected_field ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'injected_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldsInjectedToEmptyStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.FieldsInjectedToEmptyStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -1100,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"injected_field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\InjectMetadataFields' => \\facebook\\thrift\\annotation\\InjectMetadataFields::fromShape(\n          shape(\n            \"type\" => \"Fields\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * FieldsInjectedToStruct\n */\nclass FieldsInjectedToStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'string_field',\n      'type' => \\TType::STRING,\n    ),\n    -1100 => shape(\n      'var' => 'injected_field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'string_field' => 1,\n    'injected_field' => -1100,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'string_field' => ?string,\n    ?'injected_field' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 6883092442816482656;\n  /**\n   * Original thrift field:-\n   * 1: string string_field\n   */\n  public string $string_field;\n  /**\n   * Original thrift field:-\n   * -1100: string injected_field\n   */\n  public string $injected_field;\n\n  public function __construct(?string $string_field = null, ?string $injected_field = null)[] {\n    $this->string_field = $string_field ?? '';\n    $this->injected_field = $injected_field ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'string_field'),\n      Shapes::idx($shape, 'injected_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldsInjectedToStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.FieldsInjectedToStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"string_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -1100,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"injected_field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\InjectMetadataFields' => \\facebook\\thrift\\annotation\\InjectMetadataFields::fromShape(\n          shape(\n            \"type\" => \"Fields\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * FieldsInjectedWithIncludedStruct\n */\nclass FieldsInjectedWithIncludedStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'string_field',\n      'type' => \\TType::STRING,\n    ),\n    -1100 => shape(\n      'var' => 'injected_field',\n      'type' => \\TType::STRING,\n    ),\n    -1101 => shape(\n      'var' => 'injected_structured_annotation_field',\n      'type' => \\TType::STRING,\n    ),\n    -1102 => shape(\n      'var' => 'injected_unstructured_annotation_field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'string_field' => 1,\n    'injected_field' => -1100,\n    'injected_structured_annotation_field' => -1101,\n    'injected_unstructured_annotation_field' => -1102,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'string_field' => ?string,\n    ?'injected_field' => ?string,\n    ?'injected_structured_annotation_field' => ?string,\n    ?'injected_unstructured_annotation_field' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 1871478197671938632;\n  /**\n   * Original thrift field:-\n   * 1: string string_field\n   */\n  public string $string_field;\n  /**\n   * Original thrift field:-\n   * -1100: string injected_field\n   */\n  public string $injected_field;\n  /**\n   * Original thrift field:-\n   * -1101: string injected_structured_annotation_field\n   */\n  public ?string $injected_structured_annotation_field;\n  /**\n   * Original thrift field:-\n   * -1102: string injected_unstructured_annotation_field\n   */\n  public ?string $injected_unstructured_annotation_field;\n\n  public function __construct(?string $string_field = null, ?string $injected_field = null, ?string $injected_structured_annotation_field = null, ?string $injected_unstructured_annotation_field = null)[] {\n    $this->string_field = $string_field ?? '';\n    $this->injected_field = $injected_field ?? '';\n    $this->injected_structured_annotation_field = $injected_structured_annotation_field;\n    $this->injected_unstructured_annotation_field = $injected_unstructured_annotation_field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'string_field'),\n      Shapes::idx($shape, 'injected_field'),\n      Shapes::idx($shape, 'injected_structured_annotation_field'),\n      Shapes::idx($shape, 'injected_unstructured_annotation_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldsInjectedWithIncludedStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.FieldsInjectedWithIncludedStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"string_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -1100,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"injected_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -1101,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"injected_structured_annotation_field\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -1102,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"injected_unstructured_annotation_field\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\InjectMetadataFields' => \\facebook\\thrift\\annotation\\InjectMetadataFields::fromShape(\n          shape(\n            \"type\" => \"foo.Fields\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'injected_structured_annotation_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\Box' => \\facebook\\thrift\\annotation\\Box::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 474}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1228}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates a definition/feature may change in incompatible ways.\n *\n * Original thrift struct:-\n * Beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Beta'))>>\nclass Beta implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used with permission, may\n * only work in specific contexts, and may change in incompatible ways without\n * notice.\n *\n * Original thrift struct:-\n * Experimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Experimental'))>>\nclass Experimental implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Experimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Experimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used in an ephemeral testing\n * enviornment.\n * \n * Such enviornments only store serialized values temporarly and strictly\n * control which versions of Thrift definitions are used, so 'compatibility'\n * is not a concern.\n *\n * Original thrift struct:-\n * Testing\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Testing'))>>\nclass Testing implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Testing';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Testing\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates a definition/feature should no longer be used.\n *\n * Original thrift struct:-\n * Deprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Deprecated'))>>\nclass Deprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2427562471238739676;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Deprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Deprecated\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Annotate a thrift structured or enum to indicate if ids or values should not\n * be used.\n * \n * For example, you may want to mark ids as deprecated, or these ids\n * might be reserved for other use cases or annotations.\n * \n * The resolved set of disallowed ids is the union of the values in `ids` and\n * the range of values represented in `id_ranges`. Example:\n * \n *  // These ids are not allowed: 3, 8, half-open ranges [10, 15), [20, 30)\n *  @thrift.ReserveIds{ids = [3, 8], id_ranges = {10: 15, 20: 30}}\n *  struct Foo {\n *    ...\n *    3: i64 f; // Build failure: 3 cannot be used\n *  }\n *\n * Original thrift struct:-\n * ReserveIds\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ReserveIds'))>>\nclass ReserveIds implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ids',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'id_ranges',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ids' => 1,\n    'id_ranges' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ids' => ?Vector<int>,\n    ?'id_ranges' => ?Map<int, int>,\n  );\n\n  const int STRUCTURAL_ID = 4105998268635615653;\n  /**\n   * Individual ids that cannot be used.\n   * \n   * Original thrift field:-\n   * 1: list<i32> ids\n   */\n  public Vector<int> $ids;\n  /**\n   * Represents ranges of ids that cannot be used.\n   * \n   * Each (key: value) pair represents the half-open range `[key, value)`,\n   * where `key` is included and `value` is not. For example, the map\n   * `{10: 15, 20: 30}` represents the union of id/value ranges `[10, 15)` and\n   * `[20, 30)`.\n   * \n   * Original thrift field:-\n   * 2: map<i32, i32> id_ranges\n   */\n  public Map<int, int> $id_ranges;\n\n  public function __construct(?Vector<int> $ids = null, ?Map<int, int> $id_ranges = null)[] {\n    $this->ids = $ids ?? Vector {};\n    $this->id_ranges = $id_ranges ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ids'),\n      Shapes::idx($shape, 'id_ranges'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ReserveIds';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ReserveIds\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ids\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"id_ranges\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates additional backward compatibility restrictions, beyond the\n * standard Thrift required 'wire' compatibility.\n *\n * Original thrift struct:-\n * RequiresBackwardCompatibility\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RequiresBackwardCompatibility'))>>\nclass RequiresBackwardCompatibility implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field_name',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field_name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field_name' => ?bool,\n  );\n\n  const int STRUCTURAL_ID = 4755373036761315562;\n  /**\n   * Original thrift field:-\n   * 1: bool field_name\n   */\n  public bool $field_name;\n\n  public function __construct(?bool $field_name = null)[] {\n    $this->field_name = $field_name ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field_name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RequiresBackwardCompatibility';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.RequiresBackwardCompatibility\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"field_name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Disables testing features.\n *\n * Original thrift struct:-\n * NoTesting\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoTesting'))>>\nclass NoTesting implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoTesting';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoTesting\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Disables experimental features.\n *\n * Original thrift struct:-\n * NoExperimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoExperimental'))>>\nclass NoExperimental implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoExperimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoExperimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Disables @Beta features.\n *\n * Original thrift struct:-\n * NoBeta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoBeta'))>>\nclass NoBeta implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoBeta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoBeta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoExperimental' => \\facebook\\thrift\\annotation\\NoExperimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates a definition/feature must not depend directly on an unreleased\n * or testing definition/feature.\n *\n * Original thrift struct:-\n * Released\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Released'))>>\nclass Released implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Released';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Released\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoBeta' => \\facebook\\thrift\\annotation\\NoBeta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\NoTesting' => \\facebook\\thrift\\annotation\\NoTesting::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Disables legacy features.\n *\n * Original thrift struct:-\n * NoLegacy\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoLegacy'))>>\nclass NoLegacy implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoLegacy';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoLegacy\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Disables @Deprecated features.\n * \n * Should only be enabled in `test` versions, as deprecated implies removing\n * the feature will break current usage (otherwise it would be legacy or\n * deleted).\n *\n * Original thrift struct:-\n * NoDeprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoDeprecated'))>>\nclass NoDeprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoDeprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoDeprecated\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoLegacy' => \\facebook\\thrift\\annotation\\NoLegacy::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * An annotation that changes the field qualifier from 'none' to 'terse'.\n * A terse field is eligible to skip serialization, when it equals to the\n * intrinsic default value. It also clears to the intrinsic default value\n * before deserialization to distinguish between if a terse field was skipped\n * or missing during serialization. This is different from an unqualified\n * field, as an unqualified field is always serialized regardless of its value,\n * and it is not cleared before deserialization.\n * \n * The annotation can be only used to annotate an unqualified field, and when\n * it is annotating a struct or exception, it changes all unqualified fields to\n * terse fields. Note, the annotation can not be used for union.\n *\n * Original thrift struct:-\n * TerseWrite\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/TerseWrite'))>>\nclass TerseWrite implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TerseWrite';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.TerseWrite\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack.\n *\n * Original thrift struct:-\n * Box\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Box'))>>\nclass Box implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Box';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Box\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Mixin\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Mixin'))>>\nclass Mixin implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Mixin';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Mixin\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Option to serialize thrift struct in ascending field id order.\n * \n * This can potentially make serialized data size smaller in compact protocol,\n * since compact protocol can write deltas between subsequent field ids.\n *\n * Original thrift struct:-\n * SerializeInFieldIdOrder\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/SerializeInFieldIdOrder'))>>\nclass SerializeInFieldIdOrder implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SerializeInFieldIdOrder';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.SerializeInFieldIdOrder\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates an enum is a bitmask and should support bit-wise operators.\n *\n * Original thrift struct:-\n * BitmaskEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/BitmaskEnum'))>>\nclass BitmaskEnum implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BitmaskEnum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.BitmaskEnum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Enables all released v1 features.\n *\n * Original thrift struct:-\n * v1\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1'))>>\nclass v1 implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Enables all beta v1 features.\n * \n * Beta features are guaranteed to *not* break unrelated Thrift features\n * so they should be relatively safe to test alongside other beta or\n * released Thrift features.\n *\n * Original thrift struct:-\n * v1beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1beta'))>>\nclass v1beta implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1' => \\facebook\\thrift\\annotation\\v1::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Enables all experimental v1 features.\n * \n * Use with *caution* and only with explicit permission. This may enable\n * features may change significantly without notice or not work correctly\n * in all contexts.\n *\n * Original thrift struct:-\n * v1alpha\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1alpha'))>>\nclass v1alpha implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1alpha';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1alpha\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1beta' => \\facebook\\thrift\\annotation\\v1beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\SerializeInFieldIdOrder' => \\facebook\\thrift\\annotation\\SerializeInFieldIdOrder::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Enables experimental features, even those that are known to break common\n * use cases.\n *\n * Original thrift struct:-\n * v1test\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1test'))>>\nclass v1test implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1test';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1test\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoDeprecated' => \\facebook\\thrift\\annotation\\NoDeprecated::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\v1alpha' => \\facebook\\thrift\\annotation\\v1alpha::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Testing' => \\facebook\\thrift\\annotation\\Testing::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Specifies the field where the exception message is stored. The field\n * is used to generate an additional method to get it.\n *\n * Original thrift struct:-\n * ExceptionMessage\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ExceptionMessage'))>>\nclass ExceptionMessage implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 6158382972310209096;\n  /**\n   * Original thrift field:-\n   * 1: string field\n   */\n  public string $field;\n\n  public function __construct(?string $field = null)[] {\n    $this->field = $field ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ExceptionMessage';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ExceptionMessage\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Generates a const of type schema. Struct containing the schema of the\n * annotated type. Optionally specify name to override default\n * schema<structName>.\n *\n * Original thrift struct:-\n * GenerateRuntimeSchema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/GenerateRuntimeSchema'))>>\nclass GenerateRuntimeSchema implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'GenerateRuntimeSchema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.GenerateRuntimeSchema\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack, and that\n * identical values can be shared in immutable contexts.\n *\n * Original thrift struct:-\n * InternBox\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/InternBox'))>>\nclass InternBox implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'InternBox';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.InternBox\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 2024}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift exception:-\n * CustomException\n */\nclass CustomException extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2427562471238739676;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'CustomException';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.CustomException\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 94}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * MyService\n */\ninterface MyServiceAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   foo();\n   */\n  public function foo(): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   interact(1: i32 arg);\n   */\n  public function interact(int $arg): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   interactFast();\n   */\n  public function interactFast(): Awaitable<int>;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ninterface MyServiceIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   foo();\n   */\n  public function foo(): void;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   interact(1: i32 arg);\n   */\n  public function interact(int $arg): void;\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   interactFast();\n   */\n  public function interactFast(): int;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ninterface MyServiceAsyncClientIf extends MyServiceAsyncIf {\n  /**\n   * Original thrift definition:-\n   * i32, stream<i32>\n   *   serialize();\n   */\n  public function serialize(): Awaitable<\\ResponseAndClientStream<int, int>>;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ninterface MyServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   foo();\n   */\n  public function foo(): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   interact(1: i32 arg);\n   */\n  public function interact(int $arg): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   interactFast();\n   */\n  public function interactFast(): Awaitable<int>;\n\n  /**\n   * Original thrift definition:-\n   * i32, stream<i32>\n   *   serialize();\n   */\n  public function serialize(): Awaitable<\\ResponseAndClientStream<int, int>>;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ntrait MyServiceClientBase {\n  require extends \\ThriftClientBase;\n\n  /* interaction handlers factory methods */\n  public function createMyInteraction(): MyService_MyInteraction {\n    $interaction = new MyService_MyInteraction($this->input_, $this->output_, $this->channel_);\n    $interaction->setAsyncHandler($this->asyncHandler_)->setEventHandler($this->eventHandler_);\n    return $interaction;\n  }\n\n  public function createMyInteractionFast(): MyService_MyInteractionFast {\n    $interaction = new MyService_MyInteractionFast($this->input_, $this->output_, $this->channel_);\n    $interaction->setAsyncHandler($this->asyncHandler_)->setEventHandler($this->eventHandler_);\n    return $interaction;\n  }\n\n  public function createSerialInteraction(): MyService_SerialInteraction {\n    $interaction = new MyService_SerialInteraction($this->input_, $this->output_, $this->channel_);\n    $interaction->setAsyncHandler($this->asyncHandler_)->setEventHandler($this->eventHandler_);\n    return $interaction;\n  }\n\n}\n\nclass MyServiceAsyncClient extends \\ThriftClientBase implements MyServiceAsyncClientIf {\n  use MyServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   foo();\n   */\n  public async function foo(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_foo_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"foo\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"foo\", false);\n    await $this->genAwaitResponse(MyService_foo_result::class, \"foo\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   interact(1: i32 arg);\n   */\n  public async function interact(int $arg): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_interact_args::fromShape(shape(\n      'arg' => $arg,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"interact\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"interact\", false);\n    await $this->genAwaitResponse(MyService_interact_result::class, \"interact\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   interactFast();\n   */\n  public async function interactFast(): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_interactFast_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"interactFast\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"interactFast\", false);\n    return await $this->genAwaitResponse(MyService_interactFast_result::class, \"interactFast\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * i32, stream<i32>\n   *   serialize();\n   */\n  public async function serialize(): Awaitable<\\ResponseAndClientStream<int, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_serialize_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"serialize\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"serialize\", false);\n    return await $this->genAwaitStreamResponse(MyService_serialize_FirstResponse::class, MyService_serialize_StreamResponse::class, \"serialize\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass MyServiceClient extends \\ThriftClientBase implements MyServiceClientIf {\n  use MyServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   foo();\n   */\n  public async function foo(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_foo_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"foo\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"foo\", false);\n    await $this->genAwaitResponse(MyService_foo_result::class, \"foo\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   interact(1: i32 arg);\n   */\n  public async function interact(int $arg): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_interact_args::fromShape(shape(\n      'arg' => $arg,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"interact\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"interact\", false);\n    await $this->genAwaitResponse(MyService_interact_result::class, \"interact\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   interactFast();\n   */\n  public async function interactFast(): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_interactFast_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"interactFast\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"interactFast\", false);\n    return await $this->genAwaitResponse(MyService_interactFast_result::class, \"interactFast\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * i32, stream<i32>\n   *   serialize();\n   */\n  public async function serialize(): Awaitable<\\ResponseAndClientStream<int, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = MyService_serialize_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"serialize\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"serialize\", false);\n    return await $this->genAwaitStreamResponse(MyService_serialize_FirstResponse::class, MyService_serialize_StreamResponse::class, \"serialize\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_foo(): int {\n    $args = MyService_foo_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"foo\", false);\n  }\n  public function recv_foo(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(MyService_foo_result::class, \"foo\", true, $expectedsequenceid);\n  }\n  public function send_interact(int $arg): int {\n    $args = MyService_interact_args::fromShape(shape(\n      'arg' => $arg,\n    ));\n    return $this->sendImplHelper($args, \"interact\", false);\n  }\n  public function recv_interact(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(MyService_interact_result::class, \"interact\", true, $expectedsequenceid);\n  }\n  public function send_interactFast(): int {\n    $args = MyService_interactFast_args::withDefaultValues();\n    return $this->sendImplHelper($args, \"interactFast\", false);\n  }\n  public function recv_interactFast(?int $expectedsequenceid = null): int {\n    return $this->recvImplHelper(MyService_interactFast_result::class, \"interactFast\", false, $expectedsequenceid);\n  }\n}\n\n// INTERACTION HANDLERS\n\nclass MyService_MyInteraction extends \\ThriftClientBase {\n  private \\InteractionId $interactionId;\n\n  public function __construct(\\TProtocol $input, ?\\TProtocol $output = null, ?\\IThriftMigrationAsyncChannel $channel = null)[leak_safe] {\n    parent::__construct($input, $output, $channel);\n    if ($this->channel_ is nonnull) {\n      $this->interactionId = $this->channel_->createInteraction(\"MyInteraction\");\n    } else {\n      throw new \\Exception(\"The channel must be nonnull to create interactions.\");\n    }\n  }\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   frobnicate()\n   *   throws (1: CustomException ex);\n   */\n  public async function frobnicate(): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? new \\RpcOptions();\n    $rpc_options = $rpc_options->setInteractionId($this->interactionId);\n    $args = MyService_MyInteraction_frobnicate_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"MyInteraction.frobnicate\", $args);\n    $currentseqid = $this->sendImpl_frobnicate();\n    return await $this->genAwaitResponse(MyService_MyInteraction_frobnicate_result::class, \"frobnicate\", false, $currentseqid, $rpc_options);\n  }\n\n  protected function sendImpl_frobnicate(): int {\n    $currentseqid = $this->getNextSequenceID();\n    $args = MyService_MyInteraction_frobnicate_args::withDefaultValues();\n    try {\n      $this->eventHandler_->preSend('MyInteraction.frobnicate', $args, $currentseqid);\n      if ($this->output_ is \\TBinaryProtocolAccelerated)\n      {\n        \\thrift_protocol_write_binary($this->output_, 'MyInteraction.frobnicate', \\TMessageType::CALL, $args, $currentseqid, $this->output_->isStrictWrite(), false);\n      }\n      else if ($this->output_ is \\TCompactProtocolAccelerated)\n      {\n        \\thrift_protocol_write_compact2($this->output_, 'MyInteraction.frobnicate', \\TMessageType::CALL, $args, $currentseqid, false, \\TCompactProtocolBase::VERSION);\n      }\n      else\n      {\n        $this->output_->writeMessageBegin('MyInteraction.frobnicate', \\TMessageType::CALL, $currentseqid);\n        $args->write($this->output_);\n        $this->output_->writeMessageEnd();\n        $this->output_->getTransport()->flush();\n      }\n    } catch (\\THandlerShortCircuitException $ex) {\n      switch ($ex->resultType) {\n        case \\THandlerShortCircuitException::R_EXPECTED_EX:\n        case \\THandlerShortCircuitException::R_UNEXPECTED_EX:\n          $this->eventHandler_->sendError('MyInteraction.frobnicate', $args, $currentseqid, $ex->result);\n          throw $ex->result;\n        case \\THandlerShortCircuitException::R_SUCCESS:\n        default:\n          $this->eventHandler_->postSend('MyInteraction.frobnicate', $args, $currentseqid);\n          return $currentseqid;\n      }\n    } catch (\\Exception $ex) {\n      $this->eventHandler_->sendError('MyInteraction.frobnicate', $args, $currentseqid, $ex);\n      throw $ex;\n    }\n    $this->eventHandler_->postSend('MyInteraction.frobnicate', $args, $currentseqid);\n    return $currentseqid;\n  }\n  /**\n   * Original thrift definition:-\n   * oneway void\n   *   ping();\n   */\n  public async function ping(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? new \\RpcOptions();\n    $rpc_options = $rpc_options->setInteractionId($this->interactionId);\n    $args = MyService_MyInteraction_ping_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"MyInteraction.ping\", $args);\n    $currentseqid = $this->sendImpl_ping();\n    await $this->genAwaitNoResponse($rpc_options);\n  }\n\n  protected function sendImpl_ping(): int {\n    $currentseqid = $this->getNextSequenceID();\n    $args = MyService_MyInteraction_ping_args::withDefaultValues();\n    try {\n      $this->eventHandler_->preSend('MyInteraction.ping', $args, $currentseqid);\n      if ($this->output_ is \\TBinaryProtocolAccelerated)\n      {\n        \\thrift_protocol_write_binary($this->output_, 'MyInteraction.ping', \\TMessageType::CALL, $args, $currentseqid, $this->output_->isStrictWrite(), true);\n      }\n      else if ($this->output_ is \\TCompactProtocolAccelerated)\n      {\n        \\thrift_protocol_write_compact2($this->output_, 'MyInteraction.ping', \\TMessageType::CALL, $args, $currentseqid, true, \\TCompactProtocolBase::VERSION);\n      }\n      else\n      {\n        $this->output_->writeMessageBegin('MyInteraction.ping', \\TMessageType::CALL, $currentseqid);\n        $args->write($this->output_);\n        $this->output_->writeMessageEnd();\n        $this->output_->getTransport()->onewayFlush();\n      }\n    } catch (\\THandlerShortCircuitException $ex) {\n      switch ($ex->resultType) {\n        case \\THandlerShortCircuitException::R_EXPECTED_EX:\n        case \\THandlerShortCircuitException::R_UNEXPECTED_EX:\n          $this->eventHandler_->sendError('MyInteraction.ping', $args, $currentseqid, $ex->result);\n          throw $ex->result;\n        case \\THandlerShortCircuitException::R_SUCCESS:\n        default:\n          $this->eventHandler_->postSend('MyInteraction.ping', $args, $currentseqid);\n          return $currentseqid;\n      }\n    } catch (\\Exception $ex) {\n      $this->eventHandler_->sendError('MyInteraction.ping', $args, $currentseqid, $ex);\n      throw $ex;\n    }\n    $this->eventHandler_->postSend('MyInteraction.ping', $args, $currentseqid);\n    return $currentseqid;\n  }\n  /**\n   * Original thrift definition:-\n   * void, stream<bool>\n   *   truthify();\n   */\n  public async function truthify(): Awaitable<\\ResponseAndClientStream<null, bool>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? new \\RpcOptions();\n    $rpc_options = $rpc_options->setInteractionId($this->interactionId);\n    $args = MyService_MyInteraction_truthify_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"MyInteraction.truthify\", $args);\n    $currentseqid = $this->sendImpl_truthify();\n    return await $this->genAwaitStreamResponse(MyService_MyInteraction_truthify_FirstResponse::class, MyService_MyInteraction_truthify_StreamResponse::class, \"truthify\", true, $currentseqid, $rpc_options);\n  }\n\n  protected function sendImpl_truthify(): int {\n    $currentseqid = $this->getNextSequenceID();\n    $args = MyService_MyInteraction_truthify_args::withDefaultValues();\n    try {\n      $this->eventHandler_->preSend('MyInteraction.truthify', $args, $currentseqid);\n      if ($this->output_ is \\TBinaryProtocolAccelerated)\n      {\n        \\thrift_protocol_write_binary($this->output_, 'MyInteraction.truthify', \\TMessageType::CALL, $args, $currentseqid, $this->output_->isStrictWrite(), false);\n      }\n      else if ($this->output_ is \\TCompactProtocolAccelerated)\n      {\n        \\thrift_protocol_write_compact2($this->output_, 'MyInteraction.truthify', \\TMessageType::CALL, $args, $currentseqid, false, \\TCompactProtocolBase::VERSION);\n      }\n      else\n      {\n        $this->output_->writeMessageBegin('MyInteraction.truthify', \\TMessageType::CALL, $currentseqid);\n        $args->write($this->output_);\n        $this->output_->writeMessageEnd();\n        $this->output_->getTransport()->flush();\n      }\n    } catch (\\THandlerShortCircuitException $ex) {\n      switch ($ex->resultType) {\n        case \\THandlerShortCircuitException::R_EXPECTED_EX:\n        case \\THandlerShortCircuitException::R_UNEXPECTED_EX:\n          $this->eventHandler_->sendError('MyInteraction.truthify', $args, $currentseqid, $ex->result);\n          throw $ex->result;\n        case \\THandlerShortCircuitException::R_SUCCESS:\n        default:\n          $this->eventHandler_->postSend('MyInteraction.truthify', $args, $currentseqid);\n          return $currentseqid;\n      }\n    } catch (\\Exception $ex) {\n      $this->eventHandler_->sendError('MyInteraction.truthify', $args, $currentseqid, $ex);\n      throw $ex;\n    }\n    $this->eventHandler_->postSend('MyInteraction.truthify', $args, $currentseqid);\n    return $currentseqid;\n  }\n  /**\n   * Original thrift definition:-\n   * set<i32>, sink<string, binary>\n   *   encode();\n   */\n  public async function encode(): Awaitable<\\ResponseAndClientSink<Set<int>, string, string>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? new \\RpcOptions();\n$rpc_options->setInteractionId($this->interactionId);\n    $args = MyService_MyInteraction_encode_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"MyInteraction.encode\", $args);\n    $currentseqid = $this->sendImpl_encode();\n    return await $this->genAwaitSinkResponse(MyService_MyInteraction_encode_FirstResponse::class, MyService_MyInteraction_encode_SinkPayload::class, MyService_MyInteraction_encode_FinalResponse::class, \"encode\", false, $currentseqid, $rpc_options);\n  }\n\n  protected function sendImpl_encode(): int {\n    $currentseqid = $this->getNextSequenceID();\n    $args = MyService_MyInteraction_encode_args::withDefaultValues();\n    try {\n      $this->eventHandler_->preSend('MyInteraction.encode', $args, $currentseqid);\n      if ($this->output_ is \\TBinaryProtocolAccelerated)\n      {\n        \\thrift_protocol_write_binary($this->output_, 'MyInteraction.encode', \\TMessageType::CALL, $args, $currentseqid, $this->output_->isStrictWrite(), false);\n      }\n      else if ($this->output_ is \\TCompactProtocolAccelerated)\n      {\n        \\thrift_protocol_write_compact2($this->output_, 'MyInteraction.encode', \\TMessageType::CALL, $args, $currentseqid, false, \\TCompactProtocolBase::VERSION);\n      }\n      else\n      {\n        $this->output_->writeMessageBegin('MyInteraction.encode', \\TMessageType::CALL, $currentseqid);\n        $args->write($this->output_);\n        $this->output_->writeMessageEnd();\n        $this->output_->getTransport()->flush();\n      }\n    } catch (\\THandlerShortCircuitException $ex) {\n      switch ($ex->resultType) {\n        case \\THandlerShortCircuitException::R_EXPECTED_EX:\n        case \\THandlerShortCircuitException::R_UNEXPECTED_EX:\n          $this->eventHandler_->sendError('MyInteraction.encode', $args, $currentseqid, $ex->result);\n          throw $ex->result;\n        case \\THandlerShortCircuitException::R_SUCCESS:\n        default:\n          $this->eventHandler_->postSend('MyInteraction.encode', $args, $currentseqid);\n          return $currentseqid;\n      }\n    } catch (\\Exception $ex) {\n      $this->eventHandler_->sendError('MyInteraction.encode', $args, $currentseqid, $ex);\n      throw $ex;\n    }\n    $this->eventHandler_->postSend('MyInteraction.encode', $args, $currentseqid);\n    return $currentseqid;\n  }\n}\n\nclass MyService_MyInteractionFast extends \\ThriftClientBase {\n  private \\InteractionId $interactionId;\n\n  public function __construct(\\TProtocol $input, ?\\TProtocol $output = null, ?\\IThriftMigrationAsyncChannel $channel = null)[leak_safe] {\n    parent::__construct($input, $output, $channel);\n    if ($this->channel_ is nonnull) {\n      $this->interactionId = $this->channel_->createInteraction(\"MyInteractionFast\");\n    } else {\n      throw new \\Exception(\"The channel must be nonnull to create interactions.\");\n    }\n  }\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   frobnicate();\n   */\n  public async function frobnicate(): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? new \\RpcOptions();\n    $rpc_options = $rpc_options->setInteractionId($this->interactionId);\n    $args = MyService_MyInteractionFast_frobnicate_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"MyInteractionFast.frobnicate\", $args);\n    $currentseqid = $this->sendImpl_frobnicate();\n    return await $this->genAwaitResponse(MyService_MyInteractionFast_frobnicate_result::class, \"frobnicate\", false, $currentseqid, $rpc_options);\n  }\n\n  protected function sendImpl_frobnicate(): int {\n    $currentseqid = $this->getNextSequenceID();\n    $args = MyService_MyInteractionFast_frobnicate_args::withDefaultValues();\n    try {\n      $this->eventHandler_->preSend('MyInteractionFast.frobnicate', $args, $currentseqid);\n      if ($this->output_ is \\TBinaryProtocolAccelerated)\n      {\n        \\thrift_protocol_write_binary($this->output_, 'MyInteractionFast.frobnicate', \\TMessageType::CALL, $args, $currentseqid, $this->output_->isStrictWrite(), false);\n      }\n      else if ($this->output_ is \\TCompactProtocolAccelerated)\n      {\n        \\thrift_protocol_write_compact2($this->output_, 'MyInteractionFast.frobnicate', \\TMessageType::CALL, $args, $currentseqid, false, \\TCompactProtocolBase::VERSION);\n      }\n      else\n      {\n        $this->output_->writeMessageBegin('MyInteractionFast.frobnicate', \\TMessageType::CALL, $currentseqid);\n        $args->write($this->output_);\n        $this->output_->writeMessageEnd();\n        $this->output_->getTransport()->flush();\n      }\n    } catch (\\THandlerShortCircuitException $ex) {\n      switch ($ex->resultType) {\n        case \\THandlerShortCircuitException::R_EXPECTED_EX:\n        case \\THandlerShortCircuitException::R_UNEXPECTED_EX:\n          $this->eventHandler_->sendError('MyInteractionFast.frobnicate', $args, $currentseqid, $ex->result);\n          throw $ex->result;\n        case \\THandlerShortCircuitException::R_SUCCESS:\n        default:\n          $this->eventHandler_->postSend('MyInteractionFast.frobnicate', $args, $currentseqid);\n          return $currentseqid;\n      }\n    } catch (\\Exception $ex) {\n      $this->eventHandler_->sendError('MyInteractionFast.frobnicate', $args, $currentseqid, $ex);\n      throw $ex;\n    }\n    $this->eventHandler_->postSend('MyInteractionFast.frobnicate', $args, $currentseqid);\n    return $currentseqid;\n  }\n  /**\n   * Original thrift definition:-\n   * oneway void\n   *   ping();\n   */\n  public async function ping(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? new \\RpcOptions();\n    $rpc_options = $rpc_options->setInteractionId($this->interactionId);\n    $args = MyService_MyInteractionFast_ping_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"MyInteractionFast.ping\", $args);\n    $currentseqid = $this->sendImpl_ping();\n    await $this->genAwaitNoResponse($rpc_options);\n  }\n\n  protected function sendImpl_ping(): int {\n    $currentseqid = $this->getNextSequenceID();\n    $args = MyService_MyInteractionFast_ping_args::withDefaultValues();\n    try {\n      $this->eventHandler_->preSend('MyInteractionFast.ping', $args, $currentseqid);\n      if ($this->output_ is \\TBinaryProtocolAccelerated)\n      {\n        \\thrift_protocol_write_binary($this->output_, 'MyInteractionFast.ping', \\TMessageType::CALL, $args, $currentseqid, $this->output_->isStrictWrite(), true);\n      }\n      else if ($this->output_ is \\TCompactProtocolAccelerated)\n      {\n        \\thrift_protocol_write_compact2($this->output_, 'MyInteractionFast.ping', \\TMessageType::CALL, $args, $currentseqid, true, \\TCompactProtocolBase::VERSION);\n      }\n      else\n      {\n        $this->output_->writeMessageBegin('MyInteractionFast.ping', \\TMessageType::CALL, $currentseqid);\n        $args->write($this->output_);\n        $this->output_->writeMessageEnd();\n        $this->output_->getTransport()->onewayFlush();\n      }\n    } catch (\\THandlerShortCircuitException $ex) {\n      switch ($ex->resultType) {\n        case \\THandlerShortCircuitException::R_EXPECTED_EX:\n        case \\THandlerShortCircuitException::R_UNEXPECTED_EX:\n          $this->eventHandler_->sendError('MyInteractionFast.ping', $args, $currentseqid, $ex->result);\n          throw $ex->result;\n        case \\THandlerShortCircuitException::R_SUCCESS:\n        default:\n          $this->eventHandler_->postSend('MyInteractionFast.ping', $args, $currentseqid);\n          return $currentseqid;\n      }\n    } catch (\\Exception $ex) {\n      $this->eventHandler_->sendError('MyInteractionFast.ping', $args, $currentseqid, $ex);\n      throw $ex;\n    }\n    $this->eventHandler_->postSend('MyInteractionFast.ping', $args, $currentseqid);\n    return $currentseqid;\n  }\n  /**\n   * Original thrift definition:-\n   * void, stream<bool>\n   *   truthify();\n   */\n  public async function truthify(): Awaitable<\\ResponseAndClientStream<null, bool>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? new \\RpcOptions();\n    $rpc_options = $rpc_options->setInteractionId($this->interactionId);\n    $args = MyService_MyInteractionFast_truthify_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"MyInteractionFast.truthify\", $args);\n    $currentseqid = $this->sendImpl_truthify();\n    return await $this->genAwaitStreamResponse(MyService_MyInteractionFast_truthify_FirstResponse::class, MyService_MyInteractionFast_truthify_StreamResponse::class, \"truthify\", true, $currentseqid, $rpc_options);\n  }\n\n  protected function sendImpl_truthify(): int {\n    $currentseqid = $this->getNextSequenceID();\n    $args = MyService_MyInteractionFast_truthify_args::withDefaultValues();\n    try {\n      $this->eventHandler_->preSend('MyInteractionFast.truthify', $args, $currentseqid);\n      if ($this->output_ is \\TBinaryProtocolAccelerated)\n      {\n        \\thrift_protocol_write_binary($this->output_, 'MyInteractionFast.truthify', \\TMessageType::CALL, $args, $currentseqid, $this->output_->isStrictWrite(), false);\n      }\n      else if ($this->output_ is \\TCompactProtocolAccelerated)\n      {\n        \\thrift_protocol_write_compact2($this->output_, 'MyInteractionFast.truthify', \\TMessageType::CALL, $args, $currentseqid, false, \\TCompactProtocolBase::VERSION);\n      }\n      else\n      {\n        $this->output_->writeMessageBegin('MyInteractionFast.truthify', \\TMessageType::CALL, $currentseqid);\n        $args->write($this->output_);\n        $this->output_->writeMessageEnd();\n        $this->output_->getTransport()->flush();\n      }\n    } catch (\\THandlerShortCircuitException $ex) {\n      switch ($ex->resultType) {\n        case \\THandlerShortCircuitException::R_EXPECTED_EX:\n        case \\THandlerShortCircuitException::R_UNEXPECTED_EX:\n          $this->eventHandler_->sendError('MyInteractionFast.truthify', $args, $currentseqid, $ex->result);\n          throw $ex->result;\n        case \\THandlerShortCircuitException::R_SUCCESS:\n        default:\n          $this->eventHandler_->postSend('MyInteractionFast.truthify', $args, $currentseqid);\n          return $currentseqid;\n      }\n    } catch (\\Exception $ex) {\n      $this->eventHandler_->sendError('MyInteractionFast.truthify', $args, $currentseqid, $ex);\n      throw $ex;\n    }\n    $this->eventHandler_->postSend('MyInteractionFast.truthify', $args, $currentseqid);\n    return $currentseqid;\n  }\n  /**\n   * Original thrift definition:-\n   * set<i32>, sink<string, binary>\n   *   encode();\n   */\n  public async function encode(): Awaitable<\\ResponseAndClientSink<Set<int>, string, string>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? new \\RpcOptions();\n$rpc_options->setInteractionId($this->interactionId);\n    $args = MyService_MyInteractionFast_encode_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"MyInteractionFast.encode\", $args);\n    $currentseqid = $this->sendImpl_encode();\n    return await $this->genAwaitSinkResponse(MyService_MyInteractionFast_encode_FirstResponse::class, MyService_MyInteractionFast_encode_SinkPayload::class, MyService_MyInteractionFast_encode_FinalResponse::class, \"encode\", false, $currentseqid, $rpc_options);\n  }\n\n  protected function sendImpl_encode(): int {\n    $currentseqid = $this->getNextSequenceID();\n    $args = MyService_MyInteractionFast_encode_args::withDefaultValues();\n    try {\n      $this->eventHandler_->preSend('MyInteractionFast.encode', $args, $currentseqid);\n      if ($this->output_ is \\TBinaryProtocolAccelerated)\n      {\n        \\thrift_protocol_write_binary($this->output_, 'MyInteractionFast.encode', \\TMessageType::CALL, $args, $currentseqid, $this->output_->isStrictWrite(), false);\n      }\n      else if ($this->output_ is \\TCompactProtocolAccelerated)\n      {\n        \\thrift_protocol_write_compact2($this->output_, 'MyInteractionFast.encode', \\TMessageType::CALL, $args, $currentseqid, false, \\TCompactProtocolBase::VERSION);\n      }\n      else\n      {\n        $this->output_->writeMessageBegin('MyInteractionFast.encode', \\TMessageType::CALL, $currentseqid);\n        $args->write($this->output_);\n        $this->output_->writeMessageEnd();\n        $this->output_->getTransport()->flush();\n      }\n    } catch (\\THandlerShortCircuitException $ex) {\n      switch ($ex->resultType) {\n        case \\THandlerShortCircuitException::R_EXPECTED_EX:\n        case \\THandlerShortCircuitException::R_UNEXPECTED_EX:\n          $this->eventHandler_->sendError('MyInteractionFast.encode', $args, $currentseqid, $ex->result);\n          throw $ex->result;\n        case \\THandlerShortCircuitException::R_SUCCESS:\n        default:\n          $this->eventHandler_->postSend('MyInteractionFast.encode', $args, $currentseqid);\n          return $currentseqid;\n      }\n    } catch (\\Exception $ex) {\n      $this->eventHandler_->sendError('MyInteractionFast.encode', $args, $currentseqid, $ex);\n      throw $ex;\n    }\n    $this->eventHandler_->postSend('MyInteractionFast.encode', $args, $currentseqid);\n    return $currentseqid;\n  }\n}\n\nclass MyService_SerialInteraction extends \\ThriftClientBase {\n  private \\InteractionId $interactionId;\n\n  public function __construct(\\TProtocol $input, ?\\TProtocol $output = null, ?\\IThriftMigrationAsyncChannel $channel = null)[leak_safe] {\n    parent::__construct($input, $output, $channel);\n    if ($this->channel_ is nonnull) {\n      $this->interactionId = $this->channel_->createInteraction(\"SerialInteraction\");\n    } else {\n      throw new \\Exception(\"The channel must be nonnull to create interactions.\");\n    }\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   frobnicate();\n   */\n  public async function frobnicate(): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? new \\RpcOptions();\n    $rpc_options = $rpc_options->setInteractionId($this->interactionId);\n    $args = MyService_SerialInteraction_frobnicate_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"MyService\", \"SerialInteraction.frobnicate\", $args);\n    $currentseqid = $this->sendImpl_frobnicate();\n    await $this->genAwaitResponse(MyService_SerialInteraction_frobnicate_result::class, \"frobnicate\", true, $currentseqid, $rpc_options);\n  }\n\n  protected function sendImpl_frobnicate(): int {\n    $currentseqid = $this->getNextSequenceID();\n    $args = MyService_SerialInteraction_frobnicate_args::withDefaultValues();\n    try {\n      $this->eventHandler_->preSend('SerialInteraction.frobnicate', $args, $currentseqid);\n      if ($this->output_ is \\TBinaryProtocolAccelerated)\n      {\n        \\thrift_protocol_write_binary($this->output_, 'SerialInteraction.frobnicate', \\TMessageType::CALL, $args, $currentseqid, $this->output_->isStrictWrite(), false);\n      }\n      else if ($this->output_ is \\TCompactProtocolAccelerated)\n      {\n        \\thrift_protocol_write_compact2($this->output_, 'SerialInteraction.frobnicate', \\TMessageType::CALL, $args, $currentseqid, false, \\TCompactProtocolBase::VERSION);\n      }\n      else\n      {\n        $this->output_->writeMessageBegin('SerialInteraction.frobnicate', \\TMessageType::CALL, $currentseqid);\n        $args->write($this->output_);\n        $this->output_->writeMessageEnd();\n        $this->output_->getTransport()->flush();\n      }\n    } catch (\\THandlerShortCircuitException $ex) {\n      switch ($ex->resultType) {\n        case \\THandlerShortCircuitException::R_EXPECTED_EX:\n        case \\THandlerShortCircuitException::R_UNEXPECTED_EX:\n          $this->eventHandler_->sendError('SerialInteraction.frobnicate', $args, $currentseqid, $ex->result);\n          throw $ex->result;\n        case \\THandlerShortCircuitException::R_SUCCESS:\n        default:\n          $this->eventHandler_->postSend('SerialInteraction.frobnicate', $args, $currentseqid);\n          return $currentseqid;\n      }\n    } catch (\\Exception $ex) {\n      $this->eventHandler_->sendError('SerialInteraction.frobnicate', $args, $currentseqid, $ex);\n      throw $ex;\n    }\n    $this->eventHandler_->postSend('SerialInteraction.frobnicate', $args, $currentseqid);\n    return $currentseqid;\n  }\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass MyService_foo_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_foo_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.foo_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_foo_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_foo_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_foo_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_interact_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'arg',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'arg' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'arg' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 6449802475022035959;\n  public int $arg;\n\n  public function __construct(?int $arg = null)[] {\n    $this->arg = $arg ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'arg'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_interact_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.interact_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"arg\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_interact_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_interact_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_interact_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_interactFast_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_interactFast_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.interactFast_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_interactFast_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 3865318819874171525;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_interactFast_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_interactFast_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_serialize_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_serialize_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.serialize_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_serialize_StreamResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 3865318819874171525;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_serialize_StreamResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_serialize_StreamResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_serialize_FirstResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 3865318819874171525;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_serialize_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_serialize_FirstResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteraction_frobnicate_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteraction_frobnicate_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.frobnicate_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteraction_frobnicate_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n    1 => shape(\n      'var' => 'ex',\n      'type' => \\TType::STRUCT,\n      'class' => CustomException::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n    'ex' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n    ?'ex' => ?CustomException,\n  );\n\n  const int STRUCTURAL_ID = 7122595353333880010;\n  public ?this::TResult $success;\n  public ?CustomException $ex;\n\n  public function __construct(?this::TResult $success = null, ?CustomException $ex = null)[] {\n    $this->success = $success;\n    $this->ex = $ex;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n      Shapes::idx($shape, 'ex'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteraction_frobnicate_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_MyInteraction_frobnicate_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.CustomException\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ex\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->ex !== null) {\n      return $this->ex;\n    }\n    return null;\n  }\n}\n\nclass MyService_MyInteraction_ping_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteraction_ping_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ping_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteraction_truthify_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteraction_truthify_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.truthify_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteraction_truthify_StreamResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = bool;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 8594383818423018844;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteraction_truthify_StreamResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_MyInteraction_truthify_StreamResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteraction_truthify_FirstResponse extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteraction_truthify_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_MyInteraction_truthify_FirstResponse\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteraction_encode_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteraction_encode_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.encode_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteraction_encode_FirstResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = Set<int>;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 5594803499509360192;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteraction_encode_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_MyInteraction_encode_FirstResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteraction_encode_SinkPayload extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteraction_encode_SinkPayload';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_MyInteraction_encode_SinkPayload\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteraction_encode_FinalResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteraction_encode_FinalResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_MyInteraction_encode_FinalResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteractionFast_frobnicate_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteractionFast_frobnicate_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.frobnicate_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteractionFast_frobnicate_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 3865318819874171525;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteractionFast_frobnicate_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_MyInteractionFast_frobnicate_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteractionFast_ping_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteractionFast_ping_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ping_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteractionFast_truthify_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteractionFast_truthify_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.truthify_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteractionFast_truthify_StreamResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = bool;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 8594383818423018844;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteractionFast_truthify_StreamResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_MyInteractionFast_truthify_StreamResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteractionFast_truthify_FirstResponse extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteractionFast_truthify_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_MyInteractionFast_truthify_FirstResponse\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteractionFast_encode_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteractionFast_encode_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.encode_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteractionFast_encode_FirstResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = Set<int>;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 5594803499509360192;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteractionFast_encode_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_MyInteractionFast_encode_FirstResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteractionFast_encode_SinkPayload extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteractionFast_encode_SinkPayload';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_MyInteractionFast_encode_SinkPayload\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_MyInteractionFast_encode_FinalResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_MyInteractionFast_encode_FinalResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_MyInteractionFast_encode_FinalResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_SerialInteraction_frobnicate_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_SerialInteraction_frobnicate_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.frobnicate_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyService_SerialInteraction_frobnicate_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_SerialInteraction_frobnicate_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_SerialInteraction_frobnicate_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass MyServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.MyService\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"foo\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"interact\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                      )\n                    ),\n                    \"name\" => \"arg\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"interactFast\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"serialize\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_stream\" => tmeta_ThriftStreamType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 3076}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures\\lazy_constants;\n\nclass module_CONSTANTS implements \\IThriftConstants {\n  /**\n   * Original thrift constant:-\n   * i32 myInt\n   */\n  const int myInt = 1337;\n\n  /**\n   * Original thrift constant:-\n   * string name\n   */\n  const string name = \"Mark Zuckerberg\";\n\n  /**\n   * Original thrift constant:-\n   * list<map<string, i32>> states\n   */\n  const vec<dict<string, int>> states = vec[\n    dict[\n      \"San Diego\" => 3211000,\n      \"Sacramento\" => 479600,\n      \"SF\" => 837400,\n    ],\n    dict[\n      \"New York\" => 8406000,\n      \"Albany\" => 98400,\n    ],\n  ];\n\n  /**\n   * Original thrift constant:-\n   * set<string> cities\n   */\n  const keyset<string> cities = keyset[\n    \"New York\",\n    \"Sacramento\",\n  ];\n\n  /**\n   * Original thrift constant:-\n   * double x\n   */\n  const float x = 1.0;\n\n  /**\n   * Original thrift constant:-\n   * double y\n   */\n  const float y = 1000000.0;\n\n  /**\n   * Original thrift constant:-\n   * double z\n   */\n  const float z = 1e+09;\n\n  /**\n   * Original thrift constant:-\n   * map<module.Company, i32> const_enum_map\n   */\n  const dict<\\test\\fixtures\\lazy_constants\\Company, int> const_enum_map = dict[\n    \\test\\fixtures\\lazy_constants\\Company::FACEBOOK => 123,\n    \\test\\fixtures\\lazy_constants\\Company::WHATSAPP => 2,\n  ];\n\n  /**\n   * Original thrift constant:-\n   * module.Internship instagram\n   */\n  <<__Memoize>>\n  public static function instagram()[write_props]: \\test\\fixtures\\lazy_constants\\Internship{\n    return \\test\\fixtures\\lazy_constants\\Internship::fromShape(\n      shape(\n        \"weeks\" => 12,\n        \"title\" => \"Software Engineer\",\n        \"employer\" => \\test\\fixtures\\lazy_constants\\Company::INSTAGRAM,\n      )\n    );\n  }\n\n  /**\n   * Original thrift constant:-\n   * list<module.Range> kRanges\n   */\n  <<__Memoize>>\n  public static function kRanges()[write_props]: vec<\\test\\fixtures\\lazy_constants\\Range>{\n    return vec[\n      \\test\\fixtures\\lazy_constants\\Range::fromShape(\n        shape(\n          \"min\" => 1,\n          \"max\" => 2,\n        )\n      ),\n      \\test\\fixtures\\lazy_constants\\Range::fromShape(\n        shape(\n          \"min\" => 5,\n          \"max\" => 6,\n        )\n      ),\n    ];\n  }\n\n  /**\n   * Original thrift constant:-\n   * list<module.Internship> internList\n   */\n  <<__Memoize>>\n  public static function internList()[write_props]: vec<\\test\\fixtures\\lazy_constants\\Internship>{\n    return vec[\n      \\test\\fixtures\\lazy_constants\\Internship::fromShape(\n        shape(\n          \"weeks\" => 12,\n          \"title\" => \"Software Engineer\",\n          \"employer\" => \\test\\fixtures\\lazy_constants\\Company::INSTAGRAM,\n        )\n      ),\n      \\test\\fixtures\\lazy_constants\\Internship::fromShape(\n        shape(\n          \"weeks\" => 10,\n          \"title\" => \"Sales Intern\",\n          \"employer\" => \\test\\fixtures\\lazy_constants\\Company::FACEBOOK,\n        )\n      ),\n    ];\n  }\n\n  /**\n   * Original thrift constant:-\n   * string apostrophe\n   */\n  const string apostrophe = \"'\";\n\n  /**\n   * Original thrift constant:-\n   * string tripleApostrophe\n   */\n  const string tripleApostrophe = \"'''\";\n\n  /**\n   * Original thrift constant:-\n   * string quotationMark\n   */\n  const string quotationMark = \"\\\"\";\n\n  /**\n   * Original thrift constant:-\n   * string backslash\n   */\n  const string backslash = \"\\\\\";\n\n  /**\n   * Original thrift constant:-\n   * string escaped_a\n   */\n  const string escaped_a = \"a\";\n\n  /**\n   * Original thrift constant:-\n   * map<string, i32> char2ascii\n   */\n  const dict<string, int> char2ascii = dict[\n    \"'\" => 39,\n    \"\\\"\" => 34,\n    \"\\\\\" => 92,\n    \"a\" => 97,\n  ];\n\n\n  public static function getAllStructuredAnnotations()[write_props]: dict<string, dict<string, \\IThriftStruct>> {\n    return dict[\n    ];\n  }\n}\n\n", "num_lines": 185}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures\\lazy_constants;\n\n/**\n * Original thrift enum:-\n * City\n */\nenum City: int {\n  NYC = 0;\n  MPK = 1;\n  SEA = 2;\n  LON = 3;\n}\n\nclass City_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.City\",\n        \"elements\" => dict[\n          0 => \"NYC\",\n          1 => \"MPK\",\n          2 => \"SEA\",\n          3 => \"LON\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift enum:-\n * Company\n */\nenum Company: int {\n  FACEBOOK = 0;\n  WHATSAPP = 1;\n  OCULUS = 2;\n  INSTAGRAM = 3;\n}\n\nclass Company_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.Company\",\n        \"elements\" => dict[\n          0 => \"FACEBOOK\",\n          1 => \"WHATSAPP\",\n          2 => \"OCULUS\",\n          3 => \"INSTAGRAM\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * Internship\n */\nclass Internship implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'weeks',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'title',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'employer',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\lazy_constants\\Company::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'weeks' => 1,\n    'title' => 2,\n    'employer' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'weeks' => ?int,\n    ?'title' => ?string,\n    ?'employer' => ?\\test\\fixtures\\lazy_constants\\Company,\n  );\n\n  const int STRUCTURAL_ID = 749038867953722654;\n  /**\n   * Original thrift field:-\n   * 1: i32 weeks\n   */\n  public int $weeks;\n  /**\n   * Original thrift field:-\n   * 2: string title\n   */\n  public string $title;\n  /**\n   * Original thrift field:-\n   * 3: module.Company employer\n   */\n  public ?\\test\\fixtures\\lazy_constants\\Company $employer;\n\n  public function __construct(?int $weeks = null, ?string $title = null, ?\\test\\fixtures\\lazy_constants\\Company $employer = null)[] {\n    $this->weeks = $weeks ?? 0;\n    $this->title = $title ?? '';\n    $this->employer = $employer;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'weeks'),\n      Shapes::idx($shape, 'title'),\n      Shapes::idx($shape, 'employer'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Internship';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Internship\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"weeks\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"title\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Company\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"employer\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Range\n */\nclass Range implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'min',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'max',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'min' => 1,\n    'max' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'min' => ?int,\n    ?'max' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 6850388386457434767;\n  /**\n   * Original thrift field:-\n   * 1: i32 min\n   */\n  public int $min;\n  /**\n   * Original thrift field:-\n   * 2: i32 max\n   */\n  public int $max;\n\n  public function __construct(?int $min = null, ?int $max = null)[] {\n    $this->min = $min ?? 0;\n    $this->max = $max ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'min'),\n      Shapes::idx($shape, 'max'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Range';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Range\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"min\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"max\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 329}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\namespace_from_package\\module;\n\n/**\n * Original thrift struct:-\n * Foo\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/namespace_from_package/module/Foo'))>>\nclass Foo implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'MyInt',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'MyInt' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'MyInt' => ?int,\n  );\n\n  const type TShape = shape(\n    'MyInt' => int,\n  );\n  const int STRUCTURAL_ID = 2232659903239944098;\n  /**\n   * Original thrift field:-\n   * 1: i64 MyInt\n   */\n  public int $MyInt;\n\n  public function __construct(?int $MyInt = null)[] {\n    $this->MyInt = $MyInt ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'MyInt'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Foo\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"MyInt\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['MyInt'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'MyInt' => $this->MyInt,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'MyInt') !== null) {\n      $this->MyInt = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['MyInt']);\n    }\n  }\n\n}\n\n", "num_lines": 123}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\namespace_from_package\\module;\n\n/**\n * Original thrift service:-\n * TestService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/namespace_from_package/module/TestService'))>>\ninterface TestServiceAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * i64\n   *   init(1: i64 int1);\n   */\n  public function init(int $int1): Awaitable<int>;\n}\n\n/**\n * Original thrift service:-\n * TestService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/namespace_from_package/module/TestService'))>>\ninterface TestServiceIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * i64\n   *   init(1: i64 int1);\n   */\n  public function init(int $int1): int;\n}\n\n/**\n * Original thrift service:-\n * TestService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/namespace_from_package/module/TestService'))>>\ninterface TestServiceAsyncClientIf extends TestServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * TestService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/namespace_from_package/module/TestService'))>>\ninterface TestServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * i64\n   *   init(1: i64 int1);\n   */\n  public function init(int $int1): Awaitable<int>;\n}\n\n/**\n * Original thrift service:-\n * TestService\n */\ntrait TestServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass TestServiceAsyncClient extends \\ThriftClientBase implements TestServiceAsyncClientIf {\n  use TestServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * i64\n   *   init(1: i64 int1);\n   */\n  public async function init(int $int1): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\namespace_from_package\\module\\TestService_init_args::fromShape(shape(\n      'int1' => $int1,\n    ));\n    await $this->asyncHandler_->genBefore(\"TestService\", \"init\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"init\", false);\n    return await $this->genAwaitResponse(\\test\\namespace_from_package\\module\\TestService_init_result::class, \"init\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass TestServiceClient extends \\ThriftClientBase implements TestServiceClientIf {\n  use TestServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * i64\n   *   init(1: i64 int1);\n   */\n  public async function init(int $int1): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\namespace_from_package\\module\\TestService_init_args::fromShape(shape(\n      'int1' => $int1,\n    ));\n    await $this->asyncHandler_->genBefore(\"TestService\", \"init\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"init\", false);\n    return await $this->genAwaitResponse(\\test\\namespace_from_package\\module\\TestService_init_result::class, \"init\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_init(int $int1): int {\n    $args = \\test\\namespace_from_package\\module\\TestService_init_args::fromShape(shape(\n      'int1' => $int1,\n    ));\n    return $this->sendImplHelper($args, \"init\", false);\n  }\n  public function recv_init(?int $expectedsequenceid = null): int {\n    return $this->recvImplHelper(\\test\\namespace_from_package\\module\\TestService_init_result::class, \"init\", false, $expectedsequenceid);\n  }\n}\n\nabstract class TestServiceAsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as TestServiceAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = TestServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'TestService';\n\n  protected async function process_init(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('init');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'init', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\namespace_from_package\\module\\TestService_init_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\namespace_from_package\\module\\TestService_init_args');\n    } else {\n      $args = \\test\\namespace_from_package\\module\\TestService_init_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'init', $args);\n    $result = \\test\\namespace_from_package\\module\\TestService_init_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\namespace_from_package\\module\\TestService', 'init', $args);\n      $result->success = await $this->handler->init($args->int1);\n      $this->eventHandler_->postExec($handler_ctx, 'init', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'init', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'init', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'init', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'init', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"init\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'init', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = TestServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass TestServiceAsyncProcessor extends TestServiceAsyncProcessorBase {\n  const type TThriftIf = TestServiceAsyncIf;\n}\n\nabstract class TestServiceSyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as TestServiceIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = TestServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'TestService';\n\n  protected function process_init(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('init');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'init', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\namespace_from_package\\module\\TestService_init_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\namespace_from_package\\module\\TestService_init_args');\n    } else {\n      $args = \\test\\namespace_from_package\\module\\TestService_init_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'init', $args);\n    $result = \\test\\namespace_from_package\\module\\TestService_init_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\namespace_from_package\\module\\TestService', 'init', $args);\n      $result->success = $this->handler->init($args->int1);\n      $this->eventHandler_->postExec($handler_ctx, 'init', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'init', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'init', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'init', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'init', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"init\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'init', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = TestServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass TestServiceSyncProcessor extends TestServiceSyncProcessorBase {\n  const type TThriftIf = TestServiceIf;\n}\n// For backwards compatibility\nclass TestServiceProcessor extends TestServiceSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass TestService_init_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'int1',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'int1' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'int1' => ?int,\n  );\n\n  const type TShape = shape(\n    'int1' => int,\n  );\n  const int STRUCTURAL_ID = 975124300794717332;\n  public int $int1;\n\n  public function __construct(?int $int1 = null)[] {\n    $this->int1 = $int1 ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'int1'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestService_init_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.init_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"int1\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['int1'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'int1' => $this->int1,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'int1') !== null) {\n      $this->int1 = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['int1']);\n    }\n  }\n\n}\n\nclass TestService_init_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 5548670328188446575;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestService_init_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TestService_init_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $this->success = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['success']);\n    }\n  }\n\n}\n\nclass TestServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return \\tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.TestService\",\n        \"functions\" => vec[\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"init\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"int1\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 576}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\namespace_from_package_without_module_name;\n\n/**\n * Original thrift struct:-\n * Foo\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/namespace_from_package_without_module_name/Foo'))>>\nclass Foo implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'MyInt',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'MyInt' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'MyInt' => ?int,\n  );\n\n  const type TShape = shape(\n    'MyInt' => int,\n  );\n  const int STRUCTURAL_ID = 2232659903239944098;\n  /**\n   * Original thrift field:-\n   * 1: i64 MyInt\n   */\n  public int $MyInt;\n\n  public function __construct(?int $MyInt = null)[] {\n    $this->MyInt = $MyInt ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'MyInt'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Foo\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"MyInt\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['MyInt'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'MyInt' => $this->MyInt,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'MyInt') !== null) {\n      $this->MyInt = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['MyInt']);\n    }\n  }\n\n}\n\n", "num_lines": 123}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\namespace_from_package_without_module_name;\n\n/**\n * Original thrift service:-\n * TestService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/namespace_from_package_without_module_name/TestService'))>>\ninterface TestServiceAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * i64\n   *   init(1: i64 int1);\n   */\n  public function init(int $int1): Awaitable<int>;\n}\n\n/**\n * Original thrift service:-\n * TestService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/namespace_from_package_without_module_name/TestService'))>>\ninterface TestServiceIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * i64\n   *   init(1: i64 int1);\n   */\n  public function init(int $int1): int;\n}\n\n/**\n * Original thrift service:-\n * TestService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/namespace_from_package_without_module_name/TestService'))>>\ninterface TestServiceAsyncClientIf extends TestServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * TestService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/namespace_from_package_without_module_name/TestService'))>>\ninterface TestServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * i64\n   *   init(1: i64 int1);\n   */\n  public function init(int $int1): Awaitable<int>;\n}\n\n/**\n * Original thrift service:-\n * TestService\n */\ntrait TestServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass TestServiceAsyncClient extends \\ThriftClientBase implements TestServiceAsyncClientIf {\n  use TestServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * i64\n   *   init(1: i64 int1);\n   */\n  public async function init(int $int1): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\namespace_from_package_without_module_name\\TestService_init_args::fromShape(shape(\n      'int1' => $int1,\n    ));\n    await $this->asyncHandler_->genBefore(\"TestService\", \"init\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"init\", false);\n    return await $this->genAwaitResponse(\\test\\namespace_from_package_without_module_name\\TestService_init_result::class, \"init\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass TestServiceClient extends \\ThriftClientBase implements TestServiceClientIf {\n  use TestServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * i64\n   *   init(1: i64 int1);\n   */\n  public async function init(int $int1): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\namespace_from_package_without_module_name\\TestService_init_args::fromShape(shape(\n      'int1' => $int1,\n    ));\n    await $this->asyncHandler_->genBefore(\"TestService\", \"init\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"init\", false);\n    return await $this->genAwaitResponse(\\test\\namespace_from_package_without_module_name\\TestService_init_result::class, \"init\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_init(int $int1): int {\n    $args = \\test\\namespace_from_package_without_module_name\\TestService_init_args::fromShape(shape(\n      'int1' => $int1,\n    ));\n    return $this->sendImplHelper($args, \"init\", false);\n  }\n  public function recv_init(?int $expectedsequenceid = null): int {\n    return $this->recvImplHelper(\\test\\namespace_from_package_without_module_name\\TestService_init_result::class, \"init\", false, $expectedsequenceid);\n  }\n}\n\nabstract class TestServiceAsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as TestServiceAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = TestServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'TestService';\n\n  protected async function process_init(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('init');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'init', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\namespace_from_package_without_module_name\\TestService_init_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\namespace_from_package_without_module_name\\TestService_init_args');\n    } else {\n      $args = \\test\\namespace_from_package_without_module_name\\TestService_init_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'init', $args);\n    $result = \\test\\namespace_from_package_without_module_name\\TestService_init_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\namespace_from_package_without_module_name\\TestService', 'init', $args);\n      $result->success = await $this->handler->init($args->int1);\n      $this->eventHandler_->postExec($handler_ctx, 'init', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'init', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'init', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'init', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'init', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"init\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'init', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = TestServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass TestServiceAsyncProcessor extends TestServiceAsyncProcessorBase {\n  const type TThriftIf = TestServiceAsyncIf;\n}\n\nabstract class TestServiceSyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as TestServiceIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = TestServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'TestService';\n\n  protected function process_init(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('init');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'init', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\namespace_from_package_without_module_name\\TestService_init_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\namespace_from_package_without_module_name\\TestService_init_args');\n    } else {\n      $args = \\test\\namespace_from_package_without_module_name\\TestService_init_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'init', $args);\n    $result = \\test\\namespace_from_package_without_module_name\\TestService_init_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\namespace_from_package_without_module_name\\TestService', 'init', $args);\n      $result->success = $this->handler->init($args->int1);\n      $this->eventHandler_->postExec($handler_ctx, 'init', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'init', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'init', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'init', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'init', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"init\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'init', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = TestServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass TestServiceSyncProcessor extends TestServiceSyncProcessorBase {\n  const type TThriftIf = TestServiceIf;\n}\n// For backwards compatibility\nclass TestServiceProcessor extends TestServiceSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass TestService_init_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'int1',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'int1' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'int1' => ?int,\n  );\n\n  const type TShape = shape(\n    'int1' => int,\n  );\n  const int STRUCTURAL_ID = 975124300794717332;\n  public int $int1;\n\n  public function __construct(?int $int1 = null)[] {\n    $this->int1 = $int1 ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'int1'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestService_init_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.init_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"int1\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['int1'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'int1' => $this->int1,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'int1') !== null) {\n      $this->int1 = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['int1']);\n    }\n  }\n\n}\n\nclass TestService_init_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 5548670328188446575;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestService_init_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TestService_init_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $this->success = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['success']);\n    }\n  }\n\n}\n\nclass TestServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return \\tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.TestService\",\n        \"functions\" => vec[\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"init\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"int1\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 576}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures\\no-legacy-apis;\n\n/**\n * Original thrift enum:-\n * MyEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/no-legacy-apis/MyEnum'))>>\nenum MyEnum: int {\n  MyValue1 = 0;\n  MyValue2 = 1;\n}\n\nclass MyEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.MyEnum\",\n        \"elements\" => dict[\n          0 => \"MyValue1\",\n          1 => \"MyValue2\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * MyStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/no-legacy-apis/MyStruct'))>>\nclass MyStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'myIntField',\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'myStringField',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'myIntField' => 1,\n    'myStringField' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'myIntField' => ?int,\n    ?'myStringField' => ?string,\n  );\n\n  const type TShape = shape(\n    'myIntField' => int,\n    'myStringField' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 503180278934651066;\n  /**\n   * Original thrift field:-\n   * 1: i64 myIntField\n   */\n  public int $myIntField;\n  /**\n   * Original thrift field:-\n   * 2: string myStringField\n   */\n  public string $myStringField;\n\n  public function __construct(?int $myIntField = null, ?string $myStringField = null)[] {\n    $this->myIntField = $myIntField ?? 0;\n    $this->myStringField = $myStringField ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'myIntField'),\n      Shapes::idx($shape, 'myStringField'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"myIntField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"myStringField\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['myIntField'],\n      $shape['myStringField'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'myIntField' => $this->myIntField,\n      'myStringField' => $this->myStringField,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'myIntField') !== null) {\n      $this->myIntField = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['myIntField']);\n    }\n    if (idx($parsed, 'myStringField') !== null) {\n      $this->myStringField = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['myStringField']);\n    }\n  }\n\n}\n\nenum MyUnionEnum: int {\n  _EMPTY_ = 0;\n  myEnum = 1;\n  myDataItem = 2;\n}\n\n/**\n * Original thrift struct:-\n * MyUnion\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/no-legacy-apis/MyUnion'))>>\nclass MyUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<\\test\\fixtures\\no-legacy-apis\\MyUnionEnum>, \\IThriftShapishSyncStruct {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'myEnum',\n      'union' => true,\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\no-legacy-apis\\MyEnum::class,\n    ),\n    2 => shape(\n      'var' => 'myDataItem',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\no-legacy-apis\\MyStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'myEnum' => 1,\n    'myDataItem' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'myEnum' => ?\\test\\fixtures\\no-legacy-apis\\MyEnum,\n    ?'myDataItem' => ?\\test\\fixtures\\no-legacy-apis\\MyStruct,\n  );\n\n  const type TShape = shape(\n    ?'myEnum' => ?\\test\\fixtures\\no-legacy-apis\\MyEnum,\n    ?'myDataItem' => ?\\test\\fixtures\\no-legacy-apis\\MyStruct::TShape,\n    ...\n  );\n  const int STRUCTURAL_ID = 7590509256672853308;\n  /**\n   * Original thrift field:-\n   * 1: module.MyEnum myEnum\n   */\n  public ?\\test\\fixtures\\no-legacy-apis\\MyEnum $myEnum;\n  /**\n   * Original thrift field:-\n   * 2: module.MyStruct myDataItem\n   */\n  public ?\\test\\fixtures\\no-legacy-apis\\MyStruct $myDataItem;\n  protected \\test\\fixtures\\no-legacy-apis\\MyUnionEnum $_type = \\test\\fixtures\\no-legacy-apis\\MyUnionEnum::_EMPTY_;\n\n  public function __construct(?\\test\\fixtures\\no-legacy-apis\\MyEnum $myEnum = null, ?\\test\\fixtures\\no-legacy-apis\\MyStruct $myDataItem = null)[] {\n    $this->_type = \\test\\fixtures\\no-legacy-apis\\MyUnionEnum::_EMPTY_;\n    if ($myEnum !== null) {\n      $this->myEnum = $myEnum;\n      $this->_type = \\test\\fixtures\\no-legacy-apis\\MyUnionEnum::myEnum;\n    }\n    if ($myDataItem !== null) {\n      $this->myDataItem = $myDataItem;\n      $this->_type = \\test\\fixtures\\no-legacy-apis\\MyUnionEnum::myDataItem;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'myEnum'),\n      Shapes::idx($shape, 'myDataItem'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyUnion';\n  }\n\n  public function getType()[]: \\test\\fixtures\\no-legacy-apis\\MyUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case \\test\\fixtures\\no-legacy-apis\\MyUnionEnum::myEnum:\n        $this->myEnum = null;\n        break;\n      case \\test\\fixtures\\no-legacy-apis\\MyUnionEnum::myDataItem:\n        $this->myDataItem = null;\n        break;\n      case \\test\\fixtures\\no-legacy-apis\\MyUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = \\test\\fixtures\\no-legacy-apis\\MyUnionEnum::_EMPTY_;\n  }\n\n  public function set_myEnum(\\test\\fixtures\\no-legacy-apis\\MyEnum $myEnum)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\no-legacy-apis\\MyUnionEnum::myEnum;\n    $this->myEnum = $myEnum;\n    return $this;\n  }\n\n  public function get_myEnum()[]: ?\\test\\fixtures\\no-legacy-apis\\MyEnum {\n    return $this->myEnum;\n  }\n\n  public function getx_myEnum()[]: \\test\\fixtures\\no-legacy-apis\\MyEnum {\n    invariant(\n      $this->_type === \\test\\fixtures\\no-legacy-apis\\MyUnionEnum::myEnum,\n      'get_myEnum called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->myEnum as nonnull;\n  }\n\n  public function set_myDataItem(\\test\\fixtures\\no-legacy-apis\\MyStruct $myDataItem)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\no-legacy-apis\\MyUnionEnum::myDataItem;\n    $this->myDataItem = $myDataItem;\n    return $this;\n  }\n\n  public function get_myDataItem()[]: ?\\test\\fixtures\\no-legacy-apis\\MyStruct {\n    return $this->myDataItem;\n  }\n\n  public function getx_myDataItem()[]: \\test\\fixtures\\no-legacy-apis\\MyStruct {\n    invariant(\n      $this->_type === \\test\\fixtures\\no-legacy-apis\\MyUnionEnum::myDataItem,\n      'get_myDataItem called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->myDataItem as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyUnion\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"myEnum\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"myDataItem\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'myEnum'),\n      Shapes::idx($shape, 'myDataItem') === null ? null : (\\test\\fixtures\\no-legacy-apis\\MyStruct::__fromShape($shape['myDataItem'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'myEnum' => $this->myEnum,\n      'myDataItem' => $this->myDataItem?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = \\test\\fixtures\\no-legacy-apis\\MyUnionEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'myEnum') !== null) {\n      $this->myEnum = \\test\\fixtures\\no-legacy-apis\\MyEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\no-legacy-apis\\MyEnum>($parsed['myEnum']));\n      $this->_type = \\test\\fixtures\\no-legacy-apis\\MyUnionEnum::myEnum;\n    }\n    if (idx($parsed, 'myDataItem') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\no-legacy-apis\\MyStruct>($parsed['myDataItem']));\n      $_tmp1 = \\test\\fixtures\\no-legacy-apis\\MyStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->myDataItem = $_tmp1;\n      $this->_type = \\test\\fixtures\\no-legacy-apis\\MyUnionEnum::myDataItem;\n    }\n  }\n\n}\n\n", "num_lines": 419}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures\\no-legacy-apis;\n\n/**\n * Original thrift service:-\n * MyService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/no-legacy-apis/MyService'))>>\ninterface MyServiceAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   query(1: MyUnion u);\n   */\n  public function query(?\\test\\fixtures\\no-legacy-apis\\MyUnion $u): Awaitable<\\test\\fixtures\\no-legacy-apis\\MyStruct>;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/no-legacy-apis/MyService'))>>\ninterface MyServiceIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   query(1: MyUnion u);\n   */\n  public function query(?\\test\\fixtures\\no-legacy-apis\\MyUnion $u): \\test\\fixtures\\no-legacy-apis\\MyStruct;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/no-legacy-apis/MyService'))>>\ninterface MyServiceAsyncClientIf extends MyServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/no-legacy-apis/MyService'))>>\ninterface MyServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   query(1: MyUnion u);\n   */\n  public function query(?\\test\\fixtures\\no-legacy-apis\\MyUnion $u): Awaitable<\\test\\fixtures\\no-legacy-apis\\MyStruct>;\n}\n\n/**\n * Original thrift service:-\n * MyService\n */\ntrait MyServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass MyServiceAsyncClient extends \\ThriftClientBase implements MyServiceAsyncClientIf {\n  use MyServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   query(1: MyUnion u);\n   */\n  public async function query(?\\test\\fixtures\\no-legacy-apis\\MyUnion $u): Awaitable<\\test\\fixtures\\no-legacy-apis\\MyStruct> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\no-legacy-apis\\MyService_query_args::fromShape(shape(\n      'u' => $u,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"query\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"query\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\no-legacy-apis\\MyService_query_result::class, \"query\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass MyServiceClient extends \\ThriftClientBase implements MyServiceClientIf {\n  use MyServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * MyStruct\n   *   query(1: MyUnion u);\n   */\n  public async function query(?\\test\\fixtures\\no-legacy-apis\\MyUnion $u): Awaitable<\\test\\fixtures\\no-legacy-apis\\MyStruct> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\test\\fixtures\\no-legacy-apis\\MyService_query_args::fromShape(shape(\n      'u' => $u,\n    ));\n    await $this->asyncHandler_->genBefore(\"MyService\", \"query\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"query\", false);\n    return await $this->genAwaitResponse(\\test\\fixtures\\no-legacy-apis\\MyService_query_result::class, \"query\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_query(?\\test\\fixtures\\no-legacy-apis\\MyUnion $u): int {\n    $args = \\test\\fixtures\\no-legacy-apis\\MyService_query_args::fromShape(shape(\n      'u' => $u,\n    ));\n    return $this->sendImplHelper($args, \"query\", false);\n  }\n  public function recv_query(?int $expectedsequenceid = null): \\test\\fixtures\\no-legacy-apis\\MyStruct {\n    return $this->recvImplHelper(\\test\\fixtures\\no-legacy-apis\\MyService_query_result::class, \"query\", false, $expectedsequenceid);\n  }\n}\n\nabstract class MyServiceAsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as MyServiceAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = MyServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'MyService';\n\n  protected async function process_query(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('query');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'query', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\no-legacy-apis\\MyService_query_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\no-legacy-apis\\MyService_query_args');\n    } else {\n      $args = \\test\\fixtures\\no-legacy-apis\\MyService_query_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'query', $args);\n    $result = \\test\\fixtures\\no-legacy-apis\\MyService_query_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\no-legacy-apis\\MyService', 'query', $args);\n      $result->success = await $this->handler->query($args->u);\n      $this->eventHandler_->postExec($handler_ctx, 'query', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'query', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'query', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'query', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'query', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"query\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'query', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = MyServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass MyServiceAsyncProcessor extends MyServiceAsyncProcessorBase {\n  const type TThriftIf = MyServiceAsyncIf;\n}\n\nabstract class MyServiceSyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as MyServiceIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = MyServiceStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'MyService';\n\n  protected function process_query(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('query');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'query', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\test\\fixtures\\no-legacy-apis\\MyService_query_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\test\\fixtures\\no-legacy-apis\\MyService_query_args');\n    } else {\n      $args = \\test\\fixtures\\no-legacy-apis\\MyService_query_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'query', $args);\n    $result = \\test\\fixtures\\no-legacy-apis\\MyService_query_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, '\\test\\fixtures\\no-legacy-apis\\MyService', 'query', $args);\n      $result->success = $this->handler->query($args->u);\n      $this->eventHandler_->postExec($handler_ctx, 'query', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'query', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'query', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'query', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'query', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"query\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'query', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = MyServiceStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass MyServiceSyncProcessor extends MyServiceSyncProcessorBase {\n  const type TThriftIf = MyServiceIf;\n}\n// For backwards compatibility\nclass MyServiceProcessor extends MyServiceSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass MyService_query_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'u',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\no-legacy-apis\\MyUnion::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'u' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'u' => ?\\test\\fixtures\\no-legacy-apis\\MyUnion,\n  );\n\n  const type TShape = shape(\n    ?'u' => ?\\test\\fixtures\\no-legacy-apis\\MyUnion::TShape,\n    ...\n  );\n  const int STRUCTURAL_ID = 806889198569760186;\n  public ?\\test\\fixtures\\no-legacy-apis\\MyUnion $u;\n\n  public function __construct(?\\test\\fixtures\\no-legacy-apis\\MyUnion $u = null)[] {\n    $this->u = $u;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'u'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_query_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.query_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyUnion\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"u\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'u') === null ? null : (\\test\\fixtures\\no-legacy-apis\\MyUnion::__fromShape($shape['u'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'u' => $this->u?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'u') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\no-legacy-apis\\MyUnion>($parsed['u']));\n      $_tmp1 = \\test\\fixtures\\no-legacy-apis\\MyUnion::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->u = $_tmp1;\n    }\n  }\n\n}\n\nclass MyService_query_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = \\test\\fixtures\\no-legacy-apis\\MyStruct;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\no-legacy-apis\\MyStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 7307096097859369800;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyService_query_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyService_query_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\no-legacy-apis\\MyStruct>($parsed['success']));\n      $_tmp1 = \\test\\fixtures\\no-legacy-apis\\MyStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->success = $_tmp1;\n    }\n  }\n\n}\n\nclass MyServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return \\tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.MyService\",\n        \"functions\" => vec[\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"query\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.MyUnion\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"u\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n              'module.MyEnum' => \\test\\fixtures\\no-legacy-apis\\MyEnum_TEnumStaticMetadata::getEnumMetadata(),\n            ],\n            'structs' => dict[\n              'module.MyStruct' => \\test\\fixtures\\no-legacy-apis\\MyStruct::getStructMetadata(),\n              'module.MyUnion' => \\test\\fixtures\\no-legacy-apis\\MyUnion::getStructMetadata(),\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 604}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1606}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates a definition/feature may change in incompatible ways.\n *\n * Original thrift struct:-\n * Beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Beta'))>>\nclass Beta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used with permission, may\n * only work in specific contexts, and may change in incompatible ways without\n * notice.\n *\n * Original thrift struct:-\n * Experimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Experimental'))>>\nclass Experimental implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Experimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Experimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used in an ephemeral testing\n * enviornment.\n * \n * Such enviornments only store serialized values temporarly and strictly\n * control which versions of Thrift definitions are used, so 'compatibility'\n * is not a concern.\n *\n * Original thrift struct:-\n * Testing\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Testing'))>>\nclass Testing implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Testing';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Testing\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should no longer be used.\n *\n * Original thrift struct:-\n * Deprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Deprecated'))>>\nclass Deprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const type TShape = shape(\n    'message' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2427562471238739676;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Deprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Deprecated\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['message'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'message' => $this->message,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'message') !== null) {\n      $this->message = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['message']);\n    }\n  }\n\n}\n\n/**\n * Annotate a thrift structured or enum to indicate if ids or values should not\n * be used.\n * \n * For example, you may want to mark ids as deprecated, or these ids\n * might be reserved for other use cases or annotations.\n * \n * The resolved set of disallowed ids is the union of the values in `ids` and\n * the range of values represented in `id_ranges`. Example:\n * \n *  // These ids are not allowed: 3, 8, half-open ranges [10, 15), [20, 30)\n *  @thrift.ReserveIds{ids = [3, 8], id_ranges = {10: 15, 20: 30}}\n *  struct Foo {\n *    ...\n *    3: i64 f; // Build failure: 3 cannot be used\n *  }\n *\n * Original thrift struct:-\n * ReserveIds\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ReserveIds'))>>\nclass ReserveIds implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ids',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'id_ranges',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ids' => 1,\n    'id_ranges' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ids' => ?Vector<int>,\n    ?'id_ranges' => ?Map<int, int>,\n  );\n\n  const type TShape = shape(\n    'ids' => vec<int>,\n    'id_ranges' => dict<int, int>,\n    ...\n  );\n  const int STRUCTURAL_ID = 4105998268635615653;\n  /**\n   * Individual ids that cannot be used.\n   * \n   * Original thrift field:-\n   * 1: list<i32> ids\n   */\n  public Vector<int> $ids;\n  /**\n   * Represents ranges of ids that cannot be used.\n   * \n   * Each (key: value) pair represents the half-open range `[key, value)`,\n   * where `key` is included and `value` is not. For example, the map\n   * `{10: 15, 20: 30}` represents the union of id/value ranges `[10, 15)` and\n   * `[20, 30)`.\n   * \n   * Original thrift field:-\n   * 2: map<i32, i32> id_ranges\n   */\n  public Map<int, int> $id_ranges;\n\n  public function __construct(?Vector<int> $ids = null, ?Map<int, int> $id_ranges = null)[] {\n    $this->ids = $ids ?? Vector {};\n    $this->id_ranges = $id_ranges ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ids'),\n      Shapes::idx($shape, 'id_ranges'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ReserveIds';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ReserveIds\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ids\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"id_ranges\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['ids'] |> new Vector($$),\n      $shape['id_ranges'] |> new Map($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'ids' => vec($this->ids),\n      'id_ranges' => dict($this->id_ranges),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'ids') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['ids']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = 0;\n        $_tmp6 = (int)$_value2;\n        if ($_tmp6 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem5 = (int)$_tmp6;\n        }\n        $_container4 []= $_elem5;\n      }\n      $this->ids = $_container4;\n    }\n    if (idx($parsed, 'id_ranges') !== null) {\n      $_json10 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, int>>($parsed['id_ranges']);\n      $_container11 = Map {};\n      foreach($_json10 as $_key8 => $_value9) {\n        $_value12 = 0;\n        $_tmp13 = (int)$_value9;\n        if ($_tmp13 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value12 = (int)$_tmp13;\n        }\n        $_container11[$_key8] = $_value12;\n      }\n      $this->id_ranges = $_container11;\n    }\n  }\n\n}\n\n/**\n * Indicates additional backward compatibility restrictions, beyond the\n * standard Thrift required 'wire' compatibility.\n *\n * Original thrift struct:-\n * RequiresBackwardCompatibility\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RequiresBackwardCompatibility'))>>\nclass RequiresBackwardCompatibility implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field_name',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field_name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field_name' => ?bool,\n  );\n\n  const type TShape = shape(\n    'field_name' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 4755373036761315562;\n  /**\n   * Original thrift field:-\n   * 1: bool field_name\n   */\n  public bool $field_name;\n\n  public function __construct(?bool $field_name = null)[] {\n    $this->field_name = $field_name ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field_name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RequiresBackwardCompatibility';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.RequiresBackwardCompatibility\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"field_name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field_name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field_name' => $this->field_name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field_name') !== null) {\n      $this->field_name = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['field_name']);\n    }\n  }\n\n}\n\n/**\n * Disables testing features.\n *\n * Original thrift struct:-\n * NoTesting\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoTesting'))>>\nclass NoTesting implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoTesting';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoTesting\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables experimental features.\n *\n * Original thrift struct:-\n * NoExperimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoExperimental'))>>\nclass NoExperimental implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoExperimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoExperimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables @Beta features.\n *\n * Original thrift struct:-\n * NoBeta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoBeta'))>>\nclass NoBeta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoBeta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoBeta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoExperimental' => \\facebook\\thrift\\annotation\\NoExperimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature must not depend directly on an unreleased\n * or testing definition/feature.\n *\n * Original thrift struct:-\n * Released\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Released'))>>\nclass Released implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Released';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Released\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoBeta' => \\facebook\\thrift\\annotation\\NoBeta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\NoTesting' => \\facebook\\thrift\\annotation\\NoTesting::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables legacy features.\n *\n * Original thrift struct:-\n * NoLegacy\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoLegacy'))>>\nclass NoLegacy implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoLegacy';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoLegacy\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables @Deprecated features.\n * \n * Should only be enabled in `test` versions, as deprecated implies removing\n * the feature will break current usage (otherwise it would be legacy or\n * deleted).\n *\n * Original thrift struct:-\n * NoDeprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoDeprecated'))>>\nclass NoDeprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoDeprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoDeprecated\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoLegacy' => \\facebook\\thrift\\annotation\\NoLegacy::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that changes the field qualifier from 'none' to 'terse'.\n * A terse field is eligible to skip serialization, when it equals to the\n * intrinsic default value. It also clears to the intrinsic default value\n * before deserialization to distinguish between if a terse field was skipped\n * or missing during serialization. This is different from an unqualified\n * field, as an unqualified field is always serialized regardless of its value,\n * and it is not cleared before deserialization.\n * \n * The annotation can be only used to annotate an unqualified field, and when\n * it is annotating a struct or exception, it changes all unqualified fields to\n * terse fields. Note, the annotation can not be used for union.\n *\n * Original thrift struct:-\n * TerseWrite\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/TerseWrite'))>>\nclass TerseWrite implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TerseWrite';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.TerseWrite\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack.\n *\n * Original thrift struct:-\n * Box\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Box'))>>\nclass Box implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Box';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Box\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Mixin\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Mixin'))>>\nclass Mixin implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Mixin';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Mixin\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Option to serialize thrift struct in ascending field id order.\n * \n * This can potentially make serialized data size smaller in compact protocol,\n * since compact protocol can write deltas between subsequent field ids.\n *\n * Original thrift struct:-\n * SerializeInFieldIdOrder\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/SerializeInFieldIdOrder'))>>\nclass SerializeInFieldIdOrder implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SerializeInFieldIdOrder';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.SerializeInFieldIdOrder\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates an enum is a bitmask and should support bit-wise operators.\n *\n * Original thrift struct:-\n * BitmaskEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/BitmaskEnum'))>>\nclass BitmaskEnum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BitmaskEnum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.BitmaskEnum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all released v1 features.\n *\n * Original thrift struct:-\n * v1\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1'))>>\nclass v1 implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all beta v1 features.\n * \n * Beta features are guaranteed to *not* break unrelated Thrift features\n * so they should be relatively safe to test alongside other beta or\n * released Thrift features.\n *\n * Original thrift struct:-\n * v1beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1beta'))>>\nclass v1beta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1' => \\facebook\\thrift\\annotation\\v1::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all experimental v1 features.\n * \n * Use with *caution* and only with explicit permission. This may enable\n * features may change significantly without notice or not work correctly\n * in all contexts.\n *\n * Original thrift struct:-\n * v1alpha\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1alpha'))>>\nclass v1alpha implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1alpha';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1alpha\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1beta' => \\facebook\\thrift\\annotation\\v1beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\SerializeInFieldIdOrder' => \\facebook\\thrift\\annotation\\SerializeInFieldIdOrder::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables experimental features, even those that are known to break common\n * use cases.\n *\n * Original thrift struct:-\n * v1test\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1test'))>>\nclass v1test implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1test';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1test\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoDeprecated' => \\facebook\\thrift\\annotation\\NoDeprecated::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\v1alpha' => \\facebook\\thrift\\annotation\\v1alpha::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Testing' => \\facebook\\thrift\\annotation\\Testing::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Specifies the field where the exception message is stored. The field\n * is used to generate an additional method to get it.\n *\n * Original thrift struct:-\n * ExceptionMessage\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ExceptionMessage'))>>\nclass ExceptionMessage implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?string,\n  );\n\n  const type TShape = shape(\n    'field' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 6158382972310209096;\n  /**\n   * Original thrift field:-\n   * 1: string field\n   */\n  public string $field;\n\n  public function __construct(?string $field = null)[] {\n    $this->field = $field ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ExceptionMessage';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ExceptionMessage\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field' => $this->field,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $this->field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['field']);\n    }\n  }\n\n}\n\n/**\n * Generates a const of type schema. Struct containing the schema of the\n * annotated type. Optionally specify name to override default\n * schema<structName>.\n *\n * Original thrift struct:-\n * GenerateRuntimeSchema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/GenerateRuntimeSchema'))>>\nclass GenerateRuntimeSchema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'GenerateRuntimeSchema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.GenerateRuntimeSchema\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack, and that\n * identical values can be shared in immutable contexts.\n *\n * Original thrift struct:-\n * InternBox\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/InternBox'))>>\nclass InternBox implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'InternBox';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.InternBox\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 2588}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift enum:-\n * Animal\n */\nenum Animal: int {\n  DOG = 1;\n  CAT = 2;\n  TARANTULA = 3;\n}\n\nclass Animal_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.Animal\",\n        \"elements\" => dict[\n          1 => \"DOG\",\n          2 => \"CAT\",\n          3 => \"TARANTULA\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * Color\n */\nclass Color implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'red',\n      'type' => \\TType::DOUBLE,\n    ),\n    2 => shape(\n      'var' => 'green',\n      'type' => \\TType::DOUBLE,\n    ),\n    3 => shape(\n      'var' => 'blue',\n      'type' => \\TType::DOUBLE,\n    ),\n    4 => shape(\n      'var' => 'alpha',\n      'type' => \\TType::DOUBLE,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'red' => 1,\n    'green' => 2,\n    'blue' => 3,\n    'alpha' => 4,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'red' => ?float,\n    ?'green' => ?float,\n    ?'blue' => ?float,\n    ?'alpha' => ?float,\n  );\n\n  const int STRUCTURAL_ID = 5495510740722957663;\n  /**\n   * Original thrift field:-\n   * 1: double red\n   */\n  public float $red;\n  /**\n   * Original thrift field:-\n   * 2: double green\n   */\n  public float $green;\n  /**\n   * Original thrift field:-\n   * 3: double blue\n   */\n  public float $blue;\n  /**\n   * Original thrift field:-\n   * 4: double alpha\n   */\n  public float $alpha;\n\n  public function __construct(?float $red = null, ?float $green = null, ?float $blue = null, ?float $alpha = null)[] {\n    $this->red = $red ?? 0.0;\n    $this->green = $green ?? 0.0;\n    $this->blue = $blue ?? 0.0;\n    $this->alpha = $alpha ?? 0.0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'red'),\n      Shapes::idx($shape, 'green'),\n      Shapes::idx($shape, 'blue'),\n      Shapes::idx($shape, 'alpha'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Color';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Color\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"red\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"green\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"blue\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"alpha\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Vehicle\n */\nclass Vehicle implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'color',\n      'type' => \\TType::STRUCT,\n      'class' => Color::class,\n    ),\n    2 => shape(\n      'var' => 'licensePlate',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'description',\n      'type' => \\TType::STRING,\n    ),\n    4 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    5 => shape(\n      'var' => 'hasAC',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'color' => 1,\n    'licensePlate' => 2,\n    'description' => 3,\n    'name' => 4,\n    'hasAC' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'color' => ?Color,\n    ?'licensePlate' => ?string,\n    ?'description' => ?string,\n    ?'name' => ?string,\n    ?'hasAC' => ?bool,\n  );\n\n  const int STRUCTURAL_ID = 2222890000100114781;\n  /**\n   * Original thrift field:-\n   * 1: module.Color color\n   */\n  public ?Color $color;\n  /**\n   * Original thrift field:-\n   * 2: string licensePlate\n   */\n  public ?string $licensePlate;\n  /**\n   * Original thrift field:-\n   * 3: string description\n   */\n  public ?string $description;\n  /**\n   * Original thrift field:-\n   * 4: string name\n   */\n  public ?string $name;\n  /**\n   * Original thrift field:-\n   * 5: bool hasAC\n   */\n  public bool $hasAC;\n\n  public function __construct(?Color $color = null, ?string $licensePlate = null, ?string $description = null, ?string $name = null, ?bool $hasAC = null)[] {\n    $this->color = $color;\n    $this->licensePlate = $licensePlate;\n    $this->description = $description;\n    $this->name = $name;\n    $this->hasAC = $hasAC ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'color'),\n      Shapes::idx($shape, 'licensePlate'),\n      Shapes::idx($shape, 'description'),\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'hasAC'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Vehicle';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Vehicle\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Color\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"color\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"licensePlate\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"description\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"hasAC\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Person\n */\nclass Person implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'id',\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'age',\n      'type' => \\TType::I16,\n    ),\n    4 => shape(\n      'var' => 'address',\n      'type' => \\TType::STRING,\n    ),\n    5 => shape(\n      'var' => 'favoriteColor',\n      'type' => \\TType::STRUCT,\n      'class' => Color::class,\n    ),\n    6 => shape(\n      'var' => 'friends',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I64,\n      'elem' => shape(\n        'type' => \\TType::I64,\n      ),\n      'format' => 'collection',\n    ),\n    7 => shape(\n      'var' => 'bestFriend',\n      'type' => \\TType::I64,\n    ),\n    8 => shape(\n      'var' => 'petNames',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::I32,\n        'enum' => Animal::class,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    9 => shape(\n      'var' => 'afraidOfAnimal',\n      'type' => \\TType::I32,\n      'enum' => Animal::class,\n    ),\n    10 => shape(\n      'var' => 'vehicles',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRUCT,\n      'elem' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => Vehicle::class,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'id' => 1,\n    'name' => 2,\n    'age' => 3,\n    'address' => 4,\n    'favoriteColor' => 5,\n    'friends' => 6,\n    'bestFriend' => 7,\n    'petNames' => 8,\n    'afraidOfAnimal' => 9,\n    'vehicles' => 10,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'id' => ?int,\n    ?'name' => ?string,\n    ?'age' => ?int,\n    ?'address' => ?string,\n    ?'favoriteColor' => ?Color,\n    ?'friends' => ?Set<int>,\n    ?'bestFriend' => ?int,\n    ?'petNames' => ?Map<Animal, string>,\n    ?'afraidOfAnimal' => ?Animal,\n    ?'vehicles' => ?Vector<Vehicle>,\n  );\n\n  const int STRUCTURAL_ID = 5615342512964403351;\n  /**\n   * Original thrift field:-\n   * 1: module.PersonID id\n   */\n  public int $id;\n  /**\n   * Original thrift field:-\n   * 2: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 3: i16 age\n   */\n  public ?int $age;\n  /**\n   * Original thrift field:-\n   * 4: string address\n   */\n  public ?string $address;\n  /**\n   * Original thrift field:-\n   * 5: module.Color favoriteColor\n   */\n  public ?Color $favoriteColor;\n  /**\n   * Original thrift field:-\n   * 6: set<module.PersonID> friends\n   */\n  public ?Set<int> $friends;\n  /**\n   * Original thrift field:-\n   * 7: module.PersonID bestFriend\n   */\n  public ?int $bestFriend;\n  /**\n   * Original thrift field:-\n   * 8: map<module.Animal, string> petNames\n   */\n  public ?Map<Animal, string> $petNames;\n  /**\n   * Original thrift field:-\n   * 9: module.Animal afraidOfAnimal\n   */\n  public ?Animal $afraidOfAnimal;\n  /**\n   * Original thrift field:-\n   * 10: list<module.Vehicle> vehicles\n   */\n  public ?Vector<Vehicle> $vehicles;\n\n  public function __construct(?int $id = null, ?string $name = null, ?int $age = null, ?string $address = null, ?Color $favoriteColor = null, ?Set<int> $friends = null, ?int $bestFriend = null, ?Map<Animal, string> $petNames = null, ?Animal $afraidOfAnimal = null, ?Vector<Vehicle> $vehicles = null)[] {\n    $this->id = $id ?? 0;\n    $this->name = $name ?? '';\n    $this->age = $age;\n    $this->address = $address;\n    $this->favoriteColor = $favoriteColor;\n    $this->friends = $friends;\n    $this->bestFriend = $bestFriend;\n    $this->petNames = $petNames;\n    $this->afraidOfAnimal = $afraidOfAnimal;\n    $this->vehicles = $vehicles;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'id'),\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'age'),\n      Shapes::idx($shape, 'address'),\n      Shapes::idx($shape, 'favoriteColor'),\n      Shapes::idx($shape, 'friends'),\n      Shapes::idx($shape, 'bestFriend'),\n      Shapes::idx($shape, 'petNames'),\n      Shapes::idx($shape, 'afraidOfAnimal'),\n      Shapes::idx($shape, 'vehicles'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Person';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Person\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.PersonID\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"id\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                )\n              ),\n              \"name\" => \"age\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"address\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Color\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"favoriteColor\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.PersonID\",\n                              \"underlyingType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"friends\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.PersonID\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"bestFriend\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                            shape(\n                              \"name\" => \"module.Animal\",\n                            )\n                          ),\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"petNames\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Animal\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"afraidOfAnimal\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 10,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.Vehicle\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"vehicles\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 793}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n", "num_lines": 9}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * NestedContainers\n */\ninterface NestedContainersAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   mapList(1: map<i32, list<i32>> foo);\n   */\n  public function mapList(KeyedContainer<int, KeyedContainer<int, int>> $foo): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   mapSet(1: map<i32, set<i32>> foo);\n   */\n  public function mapSet(KeyedContainer<int, Set<int>> $foo): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   listMap(1: list<map<i32, i32>> foo);\n   */\n  public function listMap(KeyedContainer<int, KeyedContainer<int, int>> $foo): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   listSet(1: list<set<i32>> foo);\n   */\n  public function listSet(KeyedContainer<int, Set<int>> $foo): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   turtles(1: list<list<map<i32, map<i32, set<i32>>>>> foo);\n   */\n  public function turtles(KeyedContainer<int, KeyedContainer<int, KeyedContainer<int, KeyedContainer<int, Set<int>>>>> $foo): Awaitable<void>;\n}\n\n/**\n * Original thrift service:-\n * NestedContainers\n */\ninterface NestedContainersIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   mapList(1: map<i32, list<i32>> foo);\n   */\n  public function mapList(KeyedContainer<int, KeyedContainer<int, int>> $foo): void;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   mapSet(1: map<i32, set<i32>> foo);\n   */\n  public function mapSet(KeyedContainer<int, Set<int>> $foo): void;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   listMap(1: list<map<i32, i32>> foo);\n   */\n  public function listMap(KeyedContainer<int, KeyedContainer<int, int>> $foo): void;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   listSet(1: list<set<i32>> foo);\n   */\n  public function listSet(KeyedContainer<int, Set<int>> $foo): void;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   turtles(1: list<list<map<i32, map<i32, set<i32>>>>> foo);\n   */\n  public function turtles(KeyedContainer<int, KeyedContainer<int, KeyedContainer<int, KeyedContainer<int, Set<int>>>>> $foo): void;\n}\n\n/**\n * Original thrift service:-\n * NestedContainers\n */\ninterface NestedContainersAsyncClientIf extends NestedContainersAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * NestedContainers\n */\ninterface NestedContainersClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * void\n   *   mapList(1: map<i32, list<i32>> foo);\n   */\n  public function mapList(KeyedContainer<int, KeyedContainer<int, int>> $foo): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   mapSet(1: map<i32, set<i32>> foo);\n   */\n  public function mapSet(KeyedContainer<int, Set<int>> $foo): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   listMap(1: list<map<i32, i32>> foo);\n   */\n  public function listMap(KeyedContainer<int, KeyedContainer<int, int>> $foo): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   listSet(1: list<set<i32>> foo);\n   */\n  public function listSet(KeyedContainer<int, Set<int>> $foo): Awaitable<void>;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   turtles(1: list<list<map<i32, map<i32, set<i32>>>>> foo);\n   */\n  public function turtles(KeyedContainer<int, KeyedContainer<int, KeyedContainer<int, KeyedContainer<int, Set<int>>>>> $foo): Awaitable<void>;\n}\n\n/**\n * Original thrift service:-\n * NestedContainers\n */\ntrait NestedContainersClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass NestedContainersAsyncClient extends \\ThriftClientBase implements NestedContainersAsyncClientIf {\n  use NestedContainersClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   mapList(1: map<i32, list<i32>> foo);\n   */\n  public async function mapList(KeyedContainer<int, KeyedContainer<int, int>> $foo): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = NestedContainers_mapList_args::fromShape(shape(\n      'foo' => (new Map($foo))->map(\n        $_val0 ==> new Vector($_val0)\n      ),\n    ));\n    await $this->asyncHandler_->genBefore(\"NestedContainers\", \"mapList\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"mapList\", false);\n    await $this->genAwaitResponse(NestedContainers_mapList_result::class, \"mapList\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   mapSet(1: map<i32, set<i32>> foo);\n   */\n  public async function mapSet(KeyedContainer<int, Set<int>> $foo): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = NestedContainers_mapSet_args::fromShape(shape(\n      'foo' => new Map($foo),\n    ));\n    await $this->asyncHandler_->genBefore(\"NestedContainers\", \"mapSet\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"mapSet\", false);\n    await $this->genAwaitResponse(NestedContainers_mapSet_result::class, \"mapSet\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   listMap(1: list<map<i32, i32>> foo);\n   */\n  public async function listMap(KeyedContainer<int, KeyedContainer<int, int>> $foo): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = NestedContainers_listMap_args::fromShape(shape(\n      'foo' => (new Vector($foo))->map(\n        $_val0 ==> new Map($_val0)\n      ),\n    ));\n    await $this->asyncHandler_->genBefore(\"NestedContainers\", \"listMap\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"listMap\", false);\n    await $this->genAwaitResponse(NestedContainers_listMap_result::class, \"listMap\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   listSet(1: list<set<i32>> foo);\n   */\n  public async function listSet(KeyedContainer<int, Set<int>> $foo): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = NestedContainers_listSet_args::fromShape(shape(\n      'foo' => new Vector($foo),\n    ));\n    await $this->asyncHandler_->genBefore(\"NestedContainers\", \"listSet\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"listSet\", false);\n    await $this->genAwaitResponse(NestedContainers_listSet_result::class, \"listSet\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   turtles(1: list<list<map<i32, map<i32, set<i32>>>>> foo);\n   */\n  public async function turtles(KeyedContainer<int, KeyedContainer<int, KeyedContainer<int, KeyedContainer<int, Set<int>>>>> $foo): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = NestedContainers_turtles_args::fromShape(shape(\n      'foo' => (new Vector($foo))->map(\n        $_val0 ==> (new Vector($_val0))->map(\n          $_val1 ==> (new Map($_val1))->map(\n            $_val2 ==> new Map($_val2)\n          )\n        )\n      ),\n    ));\n    await $this->asyncHandler_->genBefore(\"NestedContainers\", \"turtles\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"turtles\", false);\n    await $this->genAwaitResponse(NestedContainers_turtles_result::class, \"turtles\", true, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass NestedContainersClient extends \\ThriftClientBase implements NestedContainersClientIf {\n  use NestedContainersClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   mapList(1: map<i32, list<i32>> foo);\n   */\n  public async function mapList(KeyedContainer<int, KeyedContainer<int, int>> $foo): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = NestedContainers_mapList_args::fromShape(shape(\n      'foo' => (new Map($foo))->map(\n        $_val0 ==> new Vector($_val0)\n      ),\n    ));\n    await $this->asyncHandler_->genBefore(\"NestedContainers\", \"mapList\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"mapList\", false);\n    await $this->genAwaitResponse(NestedContainers_mapList_result::class, \"mapList\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   mapSet(1: map<i32, set<i32>> foo);\n   */\n  public async function mapSet(KeyedContainer<int, Set<int>> $foo): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = NestedContainers_mapSet_args::fromShape(shape(\n      'foo' => new Map($foo),\n    ));\n    await $this->asyncHandler_->genBefore(\"NestedContainers\", \"mapSet\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"mapSet\", false);\n    await $this->genAwaitResponse(NestedContainers_mapSet_result::class, \"mapSet\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   listMap(1: list<map<i32, i32>> foo);\n   */\n  public async function listMap(KeyedContainer<int, KeyedContainer<int, int>> $foo): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = NestedContainers_listMap_args::fromShape(shape(\n      'foo' => (new Vector($foo))->map(\n        $_val0 ==> new Map($_val0)\n      ),\n    ));\n    await $this->asyncHandler_->genBefore(\"NestedContainers\", \"listMap\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"listMap\", false);\n    await $this->genAwaitResponse(NestedContainers_listMap_result::class, \"listMap\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   listSet(1: list<set<i32>> foo);\n   */\n  public async function listSet(KeyedContainer<int, Set<int>> $foo): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = NestedContainers_listSet_args::fromShape(shape(\n      'foo' => new Vector($foo),\n    ));\n    await $this->asyncHandler_->genBefore(\"NestedContainers\", \"listSet\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"listSet\", false);\n    await $this->genAwaitResponse(NestedContainers_listSet_result::class, \"listSet\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void\n   *   turtles(1: list<list<map<i32, map<i32, set<i32>>>>> foo);\n   */\n  public async function turtles(KeyedContainer<int, KeyedContainer<int, KeyedContainer<int, KeyedContainer<int, Set<int>>>>> $foo): Awaitable<void> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = NestedContainers_turtles_args::fromShape(shape(\n      'foo' => (new Vector($foo))->map(\n        $_val0 ==> (new Vector($_val0))->map(\n          $_val1 ==> (new Map($_val1))->map(\n            $_val2 ==> new Map($_val2)\n          )\n        )\n      ),\n    ));\n    await $this->asyncHandler_->genBefore(\"NestedContainers\", \"turtles\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"turtles\", false);\n    await $this->genAwaitResponse(NestedContainers_turtles_result::class, \"turtles\", true, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_mapList(KeyedContainer<int, KeyedContainer<int, int>> $foo): int {\n    $args = NestedContainers_mapList_args::fromShape(shape(\n      'foo' => (new Map($foo))->map(\n        $_val0 ==> new Vector($_val0)\n      ),\n    ));\n    return $this->sendImplHelper($args, \"mapList\", false);\n  }\n  public function recv_mapList(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(NestedContainers_mapList_result::class, \"mapList\", true, $expectedsequenceid);\n  }\n  public function send_mapSet(KeyedContainer<int, Set<int>> $foo): int {\n    $args = NestedContainers_mapSet_args::fromShape(shape(\n      'foo' => new Map($foo),\n    ));\n    return $this->sendImplHelper($args, \"mapSet\", false);\n  }\n  public function recv_mapSet(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(NestedContainers_mapSet_result::class, \"mapSet\", true, $expectedsequenceid);\n  }\n  public function send_listMap(KeyedContainer<int, KeyedContainer<int, int>> $foo): int {\n    $args = NestedContainers_listMap_args::fromShape(shape(\n      'foo' => (new Vector($foo))->map(\n        $_val0 ==> new Map($_val0)\n      ),\n    ));\n    return $this->sendImplHelper($args, \"listMap\", false);\n  }\n  public function recv_listMap(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(NestedContainers_listMap_result::class, \"listMap\", true, $expectedsequenceid);\n  }\n  public function send_listSet(KeyedContainer<int, Set<int>> $foo): int {\n    $args = NestedContainers_listSet_args::fromShape(shape(\n      'foo' => new Vector($foo),\n    ));\n    return $this->sendImplHelper($args, \"listSet\", false);\n  }\n  public function recv_listSet(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(NestedContainers_listSet_result::class, \"listSet\", true, $expectedsequenceid);\n  }\n  public function send_turtles(KeyedContainer<int, KeyedContainer<int, KeyedContainer<int, KeyedContainer<int, Set<int>>>>> $foo): int {\n    $args = NestedContainers_turtles_args::fromShape(shape(\n      'foo' => (new Vector($foo))->map(\n        $_val0 ==> (new Vector($_val0))->map(\n          $_val1 ==> (new Map($_val1))->map(\n            $_val2 ==> new Map($_val2)\n          )\n        )\n      ),\n    ));\n    return $this->sendImplHelper($args, \"turtles\", false);\n  }\n  public function recv_turtles(?int $expectedsequenceid = null): void {\n    $this->recvImplHelper(NestedContainers_turtles_result::class, \"turtles\", true, $expectedsequenceid);\n  }\n}\n\nabstract class NestedContainersAsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as NestedContainersAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = NestedContainersStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'NestedContainers';\n\n  protected async function process_mapList(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('mapList');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'mapList', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'NestedContainers_mapList_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'NestedContainers_mapList_args');\n    } else {\n      $args = NestedContainers_mapList_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'mapList', $args);\n    $result = NestedContainers_mapList_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'NestedContainers', 'mapList', $args);\n      await $this->handler->mapList($args->foo);\n      $this->eventHandler_->postExec($handler_ctx, 'mapList', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'mapList', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'mapList', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'mapList', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'mapList', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"mapList\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'mapList', $result);\n  }\n  protected async function process_mapSet(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('mapSet');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'mapSet', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'NestedContainers_mapSet_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'NestedContainers_mapSet_args');\n    } else {\n      $args = NestedContainers_mapSet_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'mapSet', $args);\n    $result = NestedContainers_mapSet_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'NestedContainers', 'mapSet', $args);\n      await $this->handler->mapSet($args->foo);\n      $this->eventHandler_->postExec($handler_ctx, 'mapSet', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'mapSet', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'mapSet', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'mapSet', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'mapSet', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"mapSet\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'mapSet', $result);\n  }\n  protected async function process_listMap(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('listMap');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'listMap', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'NestedContainers_listMap_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'NestedContainers_listMap_args');\n    } else {\n      $args = NestedContainers_listMap_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'listMap', $args);\n    $result = NestedContainers_listMap_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'NestedContainers', 'listMap', $args);\n      await $this->handler->listMap($args->foo);\n      $this->eventHandler_->postExec($handler_ctx, 'listMap', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'listMap', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'listMap', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'listMap', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'listMap', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"listMap\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'listMap', $result);\n  }\n  protected async function process_listSet(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('listSet');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'listSet', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'NestedContainers_listSet_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'NestedContainers_listSet_args');\n    } else {\n      $args = NestedContainers_listSet_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'listSet', $args);\n    $result = NestedContainers_listSet_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'NestedContainers', 'listSet', $args);\n      await $this->handler->listSet($args->foo);\n      $this->eventHandler_->postExec($handler_ctx, 'listSet', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'listSet', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'listSet', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'listSet', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'listSet', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"listSet\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'listSet', $result);\n  }\n  protected async function process_turtles(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('turtles');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'turtles', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'NestedContainers_turtles_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'NestedContainers_turtles_args');\n    } else {\n      $args = NestedContainers_turtles_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'turtles', $args);\n    $result = NestedContainers_turtles_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'NestedContainers', 'turtles', $args);\n      await $this->handler->turtles($args->foo);\n      $this->eventHandler_->postExec($handler_ctx, 'turtles', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'turtles', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'turtles', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'turtles', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'turtles', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"turtles\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'turtles', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = NestedContainersStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass NestedContainersAsyncProcessor extends NestedContainersAsyncProcessorBase {\n  const type TThriftIf = NestedContainersAsyncIf;\n}\n\nabstract class NestedContainersSyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as NestedContainersIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = NestedContainersStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'NestedContainers';\n\n  protected function process_mapList(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('mapList');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'mapList', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'NestedContainers_mapList_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'NestedContainers_mapList_args');\n    } else {\n      $args = NestedContainers_mapList_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'mapList', $args);\n    $result = NestedContainers_mapList_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'NestedContainers', 'mapList', $args);\n      $this->handler->mapList($args->foo);\n      $this->eventHandler_->postExec($handler_ctx, 'mapList', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'mapList', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'mapList', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'mapList', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'mapList', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"mapList\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'mapList', $result);\n  }\n  protected function process_mapSet(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('mapSet');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'mapSet', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'NestedContainers_mapSet_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'NestedContainers_mapSet_args');\n    } else {\n      $args = NestedContainers_mapSet_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'mapSet', $args);\n    $result = NestedContainers_mapSet_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'NestedContainers', 'mapSet', $args);\n      $this->handler->mapSet($args->foo);\n      $this->eventHandler_->postExec($handler_ctx, 'mapSet', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'mapSet', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'mapSet', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'mapSet', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'mapSet', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"mapSet\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'mapSet', $result);\n  }\n  protected function process_listMap(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('listMap');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'listMap', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'NestedContainers_listMap_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'NestedContainers_listMap_args');\n    } else {\n      $args = NestedContainers_listMap_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'listMap', $args);\n    $result = NestedContainers_listMap_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'NestedContainers', 'listMap', $args);\n      $this->handler->listMap($args->foo);\n      $this->eventHandler_->postExec($handler_ctx, 'listMap', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'listMap', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'listMap', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'listMap', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'listMap', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"listMap\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'listMap', $result);\n  }\n  protected function process_listSet(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('listSet');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'listSet', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'NestedContainers_listSet_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'NestedContainers_listSet_args');\n    } else {\n      $args = NestedContainers_listSet_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'listSet', $args);\n    $result = NestedContainers_listSet_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'NestedContainers', 'listSet', $args);\n      $this->handler->listSet($args->foo);\n      $this->eventHandler_->postExec($handler_ctx, 'listSet', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'listSet', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'listSet', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'listSet', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'listSet', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"listSet\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'listSet', $result);\n  }\n  protected function process_turtles(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('turtles');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'turtles', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'NestedContainers_turtles_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'NestedContainers_turtles_args');\n    } else {\n      $args = NestedContainers_turtles_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'turtles', $args);\n    $result = NestedContainers_turtles_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'NestedContainers', 'turtles', $args);\n      $this->handler->turtles($args->foo);\n      $this->eventHandler_->postExec($handler_ctx, 'turtles', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'turtles', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'turtles', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'turtles', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'turtles', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"turtles\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'turtles', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = NestedContainersStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass NestedContainersSyncProcessor extends NestedContainersSyncProcessorBase {\n  const type TThriftIf = NestedContainersIf;\n}\n// For backwards compatibility\nclass NestedContainersProcessor extends NestedContainersSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass NestedContainers_mapList_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?Map<int, Vector<int>>,\n  );\n\n  const type TShape = shape(\n    'foo' => dict<int, vec<int>>,\n    ...\n  );\n  const int STRUCTURAL_ID = 860610040470759468;\n  public Map<int, Vector<int>> $foo;\n\n  public function __construct(?Map<int, Vector<int>> $foo = null)[] {\n    $this->foo = $foo ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NestedContainers_mapList_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.mapList_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['foo']\n        |> Dict\\map(\n          $$,\n          $_val0 ==> $_val0 |> new Vector($$),\n        ) |> new Map($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'foo' => $this->foo->map(\n        ($_val0) ==> vec($_val0),\n      )\n        |> dict($$),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass NestedContainers_mapList_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NestedContainers_mapList_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.NestedContainers_mapList_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass NestedContainers_mapSet_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::SET,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::SET,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?Map<int, Set<int>>,\n  );\n\n  const type TShape = shape(\n    'foo' => dict<int, dict<int, bool>>,\n    ...\n  );\n  const int STRUCTURAL_ID = 860610040470759468;\n  public Map<int, Set<int>> $foo;\n\n  public function __construct(?Map<int, Set<int>> $foo = null)[] {\n    $this->foo = $foo ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NestedContainers_mapSet_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.mapSet_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['foo']\n        |> Dict\\map(\n          $$,\n          $_val0 ==> $_val0\n            |> new Set(Keyset\\keys($$)),\n        ) |> new Map($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'foo' => $this->foo->map(\n        ($_val0) ==> ThriftUtil::toDArray(Dict\\fill_keys($_val0, true), static::class),\n      )\n        |> dict($$),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass NestedContainers_mapSet_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NestedContainers_mapSet_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.NestedContainers_mapSet_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass NestedContainers_listMap_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::I32,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::I32,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?Vector<Map<int, int>>,\n  );\n\n  const type TShape = shape(\n    'foo' => vec<dict<int, int>>,\n    ...\n  );\n  const int STRUCTURAL_ID = 860610040470759468;\n  public Vector<Map<int, int>> $foo;\n\n  public function __construct(?Vector<Map<int, int>> $foo = null)[] {\n    $this->foo = $foo ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NestedContainers_listMap_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.listMap_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['foo']\n        |> Vec\\map(\n          $$,\n          $_val0 ==> $_val0 |> new Map($$),\n        ) |> new Vector($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'foo' => $this->foo->map(\n        ($_val0) ==> dict($_val0),\n      )\n        |> vec($$),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass NestedContainers_listMap_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NestedContainers_listMap_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.NestedContainers_listMap_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass NestedContainers_listSet_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::LST,\n      'etype' => \\TType::SET,\n      'elem' => shape(\n        'type' => \\TType::SET,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?Vector<Set<int>>,\n  );\n\n  const type TShape = shape(\n    'foo' => vec<dict<int, bool>>,\n    ...\n  );\n  const int STRUCTURAL_ID = 860610040470759468;\n  public Vector<Set<int>> $foo;\n\n  public function __construct(?Vector<Set<int>> $foo = null)[] {\n    $this->foo = $foo ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NestedContainers_listSet_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.listSet_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['foo']\n        |> Vec\\map(\n          $$,\n          $_val0 ==> $_val0\n            |> new Set(Keyset\\keys($$)),\n        ) |> new Vector($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'foo' => $this->foo->map(\n        ($_val0) ==> ThriftUtil::toDArray(Dict\\fill_keys($_val0, true), static::class),\n      )\n        |> vec($$),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass NestedContainers_listSet_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NestedContainers_listSet_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.NestedContainers_listSet_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass NestedContainers_turtles_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::LST,\n      'etype' => \\TType::LST,\n      'elem' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::MAP,\n        'elem' => shape(\n          'type' => \\TType::MAP,\n          'ktype' => \\TType::I32,\n          'vtype' => \\TType::MAP,\n          'key' => shape(\n            'type' => \\TType::I32,\n          ),\n          'val' => shape(\n            'type' => \\TType::MAP,\n            'ktype' => \\TType::I32,\n            'vtype' => \\TType::SET,\n            'key' => shape(\n              'type' => \\TType::I32,\n            ),\n            'val' => shape(\n              'type' => \\TType::SET,\n              'etype' => \\TType::I32,\n              'elem' => \\HH\\FIXME\\UNSAFE_CAST<mixed, \\HH_FIXME\\NON_DENOTABLE_TYPE>(shape(\n                'type' => \\TType::I32,\n              )),\n              'format' => 'collection',\n            ),\n            'format' => 'collection',\n          ),\n          'format' => 'collection',\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?Vector<Vector<Map<int, Map<int, Set<int>>>>>,\n  );\n\n  const type TShape = shape(\n    'foo' => vec<vec<dict<int, dict<int, dict<int, bool>>>>>,\n    ...\n  );\n  const int STRUCTURAL_ID = 860610040470759468;\n  public Vector<Vector<Map<int, Map<int, Set<int>>>>> $foo;\n\n  public function __construct(?Vector<Vector<Map<int, Map<int, Set<int>>>>> $foo = null)[] {\n    $this->foo = $foo ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NestedContainers_turtles_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.turtles_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                                    shape(\n                                      \"keyType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                        )\n                                      ),\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                                            shape(\n                                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                                shape(\n                                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                                )\n                                              ),\n                                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                                shape(\n                                                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                                    shape(\n                                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                                        shape(\n                                                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                                        )\n                                                      ),\n                                                    )\n                                                  ),\n                                                )\n                                              ),\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['foo']\n        |> Vec\\map(\n          $$,\n          $_val3 ==> $_val3\n            |> Vec\\map(\n              $$,\n              $_val2 ==> $_val2\n                |> Dict\\map(\n                  $$,\n                  $_val1 ==> $_val1\n                    |> Dict\\map(\n                      $$,\n                      $_val0 ==> $_val0\n                        |> new Set(Keyset\\keys($$)),\n                    ) |> new Map($$),\n                ) |> new Map($$),\n            ) |> new Vector($$),\n        ) |> new Vector($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'foo' => $this->foo->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->map(\n            ($_val2) ==> $_val2->map(\n              ($_val3) ==> ThriftUtil::toDArray(Dict\\fill_keys($_val3, true), static::class),\n            )\n              |> dict($$),\n          )\n            |> dict($$),\n        )\n          |> vec($$),\n      )\n        |> vec($$),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass NestedContainers_turtles_result extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NestedContainers_turtles_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.NestedContainers_turtles_result\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass NestedContainersStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.NestedContainers\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"mapList\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_map\" => tmeta_ThriftMapType::fromShape(\n                          shape(\n                            \"keyType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                              )\n                            ),\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_list\" => tmeta_ThriftListType::fromShape(\n                                  shape(\n                                    \"valueType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                      )\n                                    ),\n                                  )\n                                ),\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"foo\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"mapSet\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_map\" => tmeta_ThriftMapType::fromShape(\n                          shape(\n                            \"keyType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                              )\n                            ),\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                  shape(\n                                    \"valueType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                      )\n                                    ),\n                                  )\n                                ),\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"foo\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"listMap\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_list\" => tmeta_ThriftListType::fromShape(\n                          shape(\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_map\" => tmeta_ThriftMapType::fromShape(\n                                  shape(\n                                    \"keyType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                      )\n                                    ),\n                                    \"valueType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                      )\n                                    ),\n                                  )\n                                ),\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"foo\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"listSet\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_list\" => tmeta_ThriftListType::fromShape(\n                          shape(\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                  shape(\n                                    \"valueType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                      )\n                                    ),\n                                  )\n                                ),\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"foo\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"turtles\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_list\" => tmeta_ThriftListType::fromShape(\n                          shape(\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_list\" => tmeta_ThriftListType::fromShape(\n                                  shape(\n                                    \"valueType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_map\" => tmeta_ThriftMapType::fromShape(\n                                          shape(\n                                            \"keyType\" => tmeta_ThriftType::fromShape(\n                                              shape(\n                                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                              )\n                                            ),\n                                            \"valueType\" => tmeta_ThriftType::fromShape(\n                                              shape(\n                                                \"t_map\" => tmeta_ThriftMapType::fromShape(\n                                                  shape(\n                                                    \"keyType\" => tmeta_ThriftType::fromShape(\n                                                      shape(\n                                                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                                      )\n                                                    ),\n                                                    \"valueType\" => tmeta_ThriftType::fromShape(\n                                                      shape(\n                                                        \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                                          shape(\n                                                            \"valueType\" => tmeta_ThriftType::fromShape(\n                                                              shape(\n                                                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                                              )\n                                                            ),\n                                                          )\n                                                        ),\n                                                      )\n                                                    ),\n                                                  )\n                                                ),\n                                              )\n                                            ),\n                                          )\n                                        ),\n                                      )\n                                    ),\n                                  )\n                                ),\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"foo\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 2259}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\cpp;\n\n/**\n * Original thrift enum:-\n * RefType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/RefType'))>>\nenum RefType: int {\n  Unique = 0;\n  Shared = 1;\n  SharedMutable = 2;\n}\n\nclass RefType_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"cpp.RefType\",\n        \"elements\" => dict[\n          0 => \"Unique\",\n          1 => \"Shared\",\n          2 => \"SharedMutable\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Enum in C++ by default uses signed 32 bit integer. There is no need to specify\n * underlying type for signed 32 bit integer.\n * \n * Original thrift enum:-\n * EnumUnderlyingType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/EnumUnderlyingType'))>>\nenum EnumUnderlyingType: int {\n  /**\n   * ::std::int8_t\n   */\n  I8 = 0;\n  /**\n   * ::std::uint8_t\n   */\n  U8 = 1;\n  /**\n   * ::std::int16_t\n   */\n  I16 = 2;\n  /**\n   * ::std::uint16_t\n   */\n  U16 = 3;\n  /**\n   * ::std::uint32_t\n   */\n  U32 = 4;\n}\n\nclass EnumUnderlyingType_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"cpp.EnumUnderlyingType\",\n        \"elements\" => dict[\n          0 => \"I8\",\n          1 => \"U8\",\n          2 => \"I16\",\n          3 => \"U16\",\n          4 => \"U32\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Changes the native type of a Thrift object.\n * `name` and `template` correspond to `cpp.type` and `cpp.template` respecively.\n *\n * Original thrift struct:-\n * Type\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Type'))>>\nclass Type implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'template',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'template' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'template' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'template' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 6389487468753271119;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string template\n   */\n  public string $template;\n\n  public function __construct(?string $name = null, ?string $template = null)[] {\n    $this->name = $name ?? '';\n    $this->template = $template ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'template'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Type';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Type\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"template\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['template'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'template' => $this->template,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'template') !== null) {\n      $this->template = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['template']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Ref\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Ref'))>>\nclass Ref implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'type',\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\annotation\\cpp\\RefType::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'type' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\RefType,\n  );\n\n  const type TShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\RefType,\n    ...\n  );\n  const int STRUCTURAL_ID = 8496209332976516665;\n  /**\n   * Original thrift field:-\n   * 1: cpp.RefType type\n   */\n  public ?\\facebook\\thrift\\annotation\\cpp\\RefType $type;\n\n  public function __construct(?\\facebook\\thrift\\annotation\\cpp\\RefType $type = null)[] {\n    $this->type = $type;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Ref';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Ref\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"cpp.RefType\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"type\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'type' => $this->type,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'type') !== null) {\n      $this->type = \\facebook\\thrift\\annotation\\cpp\\RefType::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\annotation\\cpp\\RefType>($parsed['type']));\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Lazy\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Lazy'))>>\nclass Lazy implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ref',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ref' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ref' => ?bool,\n  );\n\n  const type TShape = shape(\n    'ref' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 2641839514020242314;\n  /**\n   * Original thrift field:-\n   * 1: bool ref\n   */\n  public bool $ref;\n\n  public function __construct(?bool $ref = null)[] {\n    $this->ref = $ref ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ref'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Lazy';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Lazy\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"ref\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['ref'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'ref' => $this->ref,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'ref') !== null) {\n      $this->ref = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['ref']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * DisableLazyChecksum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/DisableLazyChecksum'))>>\nclass DisableLazyChecksum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'DisableLazyChecksum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.DisableLazyChecksum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that applies a C++ adapter to typedef, field, or struct.\n * \n * For example:\n * \n *   @cpp.Adapter{name = \"::ns::IdAdapter\"}\n *   typedef i64 MyI64;\n * \n * Here the type `MyI64` has the C++ adapter `IdAdapter`.\n * \n *   struct User {\n *     @cpp.Adapter{name = \"::ns::IdAdapter\"}\n *     1: i64 id;\n *   }\n * \n * Here the field `id` has the C++ adapter `IdAdapter`.\n *\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'adaptedType',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'underlyingName',\n      'type' => \\TType::STRING,\n    ),\n    4 => shape(\n      'var' => 'extraNamespace',\n      'type' => \\TType::STRING,\n    ),\n    5 => shape(\n      'var' => 'moveOnly',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'adaptedType' => 2,\n    'underlyingName' => 3,\n    'extraNamespace' => 4,\n    'moveOnly' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'adaptedType' => ?string,\n    ?'underlyingName' => ?string,\n    ?'extraNamespace' => ?string,\n    ?'moveOnly' => ?bool,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'adaptedType' => string,\n    'underlyingName' => string,\n    'extraNamespace' => string,\n    'moveOnly' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 8180344078447403329;\n  /**\n   * The name of a C++ adapter type used to convert between Thrift and native\n   * C++ representation.\n   * \n   * The adapter can be either a Type or Field adapter, providing either of the following APIs:\n   * \n   *     struct ThriftTypeAdapter {\n   *       static AdaptedType fromThrift(ThriftType thrift);\n   *       static {const ThriftType& | ThriftType} toThrift(const AdaptedType& native);\n   *     };\n   * \n   *     struct ThriftFieldAdapter {\n   *       // Context is an instantiation of apache::thrift::FieldContext\n   *       template <class Context>\n   *       static void construct(AdaptedType& field, Context ctx);\n   * \n   *       template <class Context>\n   *       static AdaptedType fromThriftField(ThriftType value, Context ctx);\n   * \n   *       template <class Context>\n   *       static {const ThriftType& | ThriftType} toThrift(const AdaptedType& adapted, Context ctx);\n   *     };\n   * \n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * It is sometimes necessary to specify AdaptedType here (in case the codegen would\n   * have a circular depdenceny, which will cause the C++ build to fail).\n   * \n   * Original thrift field:-\n   * 2: string adaptedType\n   */\n  public string $adaptedType;\n  /**\n   * The name and/or extra namespace to use when directly adapting a type\n   * (as opposed a typedef).\n   * \n   * In this case, the IDL name of the type will refer to the adapted type in\n   * C++ and the underlying thrift type will be generated in a nested\n   * namespace and/or with a different name.\n   * \n   * If neither `underlyingName` or `extraNamespace` is provided, the\n   * underlying type will be generated in a nested 'detail' namespace with\n   * the same name.\n   * \n   * Original thrift field:-\n   * 3: string underlyingName\n   */\n  public string $underlyingName;\n  /**\n   * Original thrift field:-\n   * 4: string extraNamespace\n   */\n  public string $extraNamespace;\n  /**\n   * Must set to true when adapted type is not copyable.\n   * \n   * Original thrift field:-\n   * 5: bool moveOnly\n   */\n  public bool $moveOnly;\n\n  public function __construct(?string $name = null, ?string $adaptedType = null, ?string $underlyingName = null, ?string $extraNamespace = null, ?bool $moveOnly = null)[] {\n    $this->name = $name ?? '';\n    $this->adaptedType = $adaptedType ?? '';\n    $this->underlyingName = $underlyingName ?? '';\n    $this->extraNamespace = $extraNamespace ?? '';\n    $this->moveOnly = $moveOnly ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'adaptedType'),\n      Shapes::idx($shape, 'underlyingName'),\n      Shapes::idx($shape, 'extraNamespace'),\n      Shapes::idx($shape, 'moveOnly'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"adaptedType\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"underlyingName\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"extraNamespace\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"moveOnly\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['adaptedType'],\n      $shape['underlyingName'],\n      $shape['extraNamespace'],\n      $shape['moveOnly'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'adaptedType' => $this->adaptedType,\n      'underlyingName' => $this->underlyingName,\n      'extraNamespace' => $this->extraNamespace,\n      'moveOnly' => $this->moveOnly,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'adaptedType') !== null) {\n      $this->adaptedType = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['adaptedType']);\n    }\n    if (idx($parsed, 'underlyingName') !== null) {\n      $this->underlyingName = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['underlyingName']);\n    }\n    if (idx($parsed, 'extraNamespace') !== null) {\n      $this->extraNamespace = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['extraNamespace']);\n    }\n    if (idx($parsed, 'moveOnly') !== null) {\n      $this->moveOnly = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['moveOnly']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * PackIsset\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/PackIsset'))>>\nclass PackIsset implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'atomic',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'atomic' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'atomic' => ?bool,\n  );\n\n  const type TShape = shape(\n    'atomic' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 1587553453134051231;\n  /**\n   * Original thrift field:-\n   * 1: bool atomic\n   */\n  public bool $atomic;\n\n  public function __construct(?bool $atomic = null)[] {\n    $this->atomic = $atomic ?? true;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'atomic'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PackIsset';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.PackIsset\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"atomic\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['atomic'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'atomic' => $this->atomic,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'atomic') !== null) {\n      $this->atomic = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['atomic']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MinimizePadding\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/MinimizePadding'))>>\nclass MinimizePadding implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MinimizePadding';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.MinimizePadding\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * TriviallyRelocatable\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/TriviallyRelocatable'))>>\nclass TriviallyRelocatable implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TriviallyRelocatable';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.TriviallyRelocatable\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ScopedEnumAsUnionType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/ScopedEnumAsUnionType'))>>\nclass ScopedEnumAsUnionType implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ScopedEnumAsUnionType';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.ScopedEnumAsUnionType\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a typedef should be 'strong', and require an explicit cast to\n * the underlying type.\n * \n * Currently only works for integer typedefs, for example:\n * \n *     @cpp.StrongType\n *     typedef i32 MyId;\n * \n * Will cause an enum class to be used instead of a typedef in the genearte code, for example:\n * \n *     enum class MyId : ::std::int32_t {};\n * \n *\n * Original thrift struct:-\n * StrongType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/StrongType'))>>\nclass StrongType implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StrongType';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.StrongType\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that intercepts field access with C++ field interceptor.\n * Use with *caution* since this may introduce substantial performance overhead on each field access.\n * \n * For example:\n * \n *     struct Foo {\n *       @cpp.FieldInterceptor{name = \"MyFieldInterceptor\"}\n *       1: i64 id;\n *     }\n * \n * The field interceptor `MyFieldInterceptor` will intercept with `interceptThriftFieldAccess`\n * when the field `id` is accessed.\n *\n * Original thrift struct:-\n * FieldInterceptor\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/FieldInterceptor'))>>\nclass FieldInterceptor implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'noinline',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'noinline' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'noinline' => ?bool,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'noinline' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 8132831456632900275;\n  /**\n   * The name of a field interceptor.\n   * \n   * The field interceptor provides the following API:\n   * \n   *     struct ThriftFieldInterceptor {\n   *       template <typename T, typename Struct, int16_t FieldId>\n   *       static void interceptThriftFieldAccess(T&& field,\n   *                                              apache::thrift::FieldContext<Struct, FieldId>&& ctx);\n   *     };\n   * \n   * The field interceptor intercepts with the field value and the field context.\n   * It enforces an easily searchable function name `interceptThriftFieldAccess`.\n   * \n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Setting to true makes compiler not inline and erase function signature for\n   * the intercepting field accessor.\n   * \n   * Original thrift field:-\n   * 2: bool noinline\n   */\n  public bool $noinline;\n\n  public function __construct(?string $name = null, ?bool $noinline = null)[] {\n    $this->name = $name ?? '';\n    $this->noinline = $noinline ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'noinline'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldInterceptor';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.FieldInterceptor\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"noinline\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['noinline'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'noinline' => $this->noinline,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'noinline') !== null) {\n      $this->noinline = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['noinline']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * UseOpEncode\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/UseOpEncode'))>>\nclass UseOpEncode implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'UseOpEncode';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.UseOpEncode\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates an integer type for C++ to use as the underlying type of enum, for example:\n * \n *     @cpp.EnumType{type = cpp.EnumUnderlyingType.I8}\n *     enum Fruit {\n *       Apple = 0,\n *       Banana = 1,\n *     }\n * \n * will be generated into the following:\n * \n *     enum class Fruit : ::std::int8_t {\n *       Apple = 0,\n *       Banana = 1,\n *     };\n * \n *\n * Original thrift struct:-\n * EnumType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/EnumType'))>>\nclass EnumType implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'type',\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'type' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType,\n  );\n\n  const type TShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType,\n    ...\n  );\n  const int STRUCTURAL_ID = 1724537317047809370;\n  /**\n   * Original thrift field:-\n   * 1: cpp.EnumUnderlyingType type\n   */\n  public ?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType $type;\n\n  public function __construct(?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType $type = null)[] {\n    $this->type = $type;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumType';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.EnumType\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"cpp.EnumUnderlyingType\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"type\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'type' => $this->type,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'type') !== null) {\n      $this->type = \\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType>($parsed['type']));\n    }\n  }\n\n}\n\n/**\n * Indicates that frozen types should not be generated for a given struct.\n *\n * Original thrift struct:-\n * Frozen2Exclude\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Frozen2Exclude'))>>\nclass Frozen2Exclude implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Frozen2Exclude';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Frozen2Exclude\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that the container params must be complete at the time this type is instantiated.\n * Only required in rare cases where the build fails with a frozen-related assert failure.\n *\n * Original thrift struct:-\n * Frozen2RequiresCompleteContainerParams\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Frozen2RequiresCompleteContainerParams'))>>\nclass Frozen2RequiresCompleteContainerParams implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Frozen2RequiresCompleteContainerParams';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Frozen2RequiresCompleteContainerParams\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1953}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nclass apache_thrift_type_id_CONSTANTS implements \\IThriftConstants {\n  /**\n   * Original thrift constant:-\n   * id.ExternId noId\n   */\n  const int noId = 0;\n\n\n  public static function getAllStructuredAnnotations()[write_props]: dict<string, dict<string, \\IThriftStruct>> {\n    return dict[\n    ];\n  }\n}\n\n", "num_lines": 23}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n", "num_lines": 9}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\java;\n\n/**\n * Original thrift struct:-\n * Mutable\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/java/Mutable'))>>\nclass Mutable implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Mutable';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"java.Mutable\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Annotation\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/java/Annotation'))>>\nclass Annotation implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'java_annotation',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'java_annotation' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'java_annotation' => ?string,\n  );\n\n  const type TShape = shape(\n    'java_annotation' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 763961079324172604;\n  /**\n   * Original thrift field:-\n   * 1: string java_annotation\n   */\n  public string $java_annotation;\n\n  public function __construct(?string $java_annotation = null)[] {\n    $this->java_annotation = $java_annotation ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'java_annotation'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Annotation';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"java.Annotation\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"java_annotation\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['java_annotation'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'java_annotation' => $this->java_annotation,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'java_annotation') !== null) {\n      $this->java_annotation = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['java_annotation']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * BinaryString\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/java/BinaryString'))>>\nclass BinaryString implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BinaryString';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"java.BinaryString\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/java/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'adapterClassName',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'typeClassName',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'adapterClassName' => 1,\n    'typeClassName' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'adapterClassName' => ?string,\n    ?'typeClassName' => ?string,\n  );\n\n  const type TShape = shape(\n    'adapterClassName' => string,\n    'typeClassName' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 257715266218410746;\n  /**\n   * Original thrift field:-\n   * 1: string adapterClassName\n   */\n  public string $adapterClassName;\n  /**\n   * Original thrift field:-\n   * 2: string typeClassName\n   */\n  public string $typeClassName;\n\n  public function __construct(?string $adapterClassName = null, ?string $typeClassName = null)[] {\n    $this->adapterClassName = $adapterClassName ?? '';\n    $this->typeClassName = $typeClassName ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'adapterClassName'),\n      Shapes::idx($shape, 'typeClassName'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"java.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"adapterClassName\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"typeClassName\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['adapterClassName'],\n      $shape['typeClassName'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'adapterClassName' => $this->adapterClassName,\n      'typeClassName' => $this->typeClassName,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'adapterClassName') !== null) {\n      $this->adapterClassName = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['adapterClassName']);\n    }\n    if (idx($parsed, 'typeClassName') !== null) {\n      $this->typeClassName = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['typeClassName']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Wrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/java/Wrapper'))>>\nclass Wrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'wrapperClassName',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'typeClassName',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'wrapperClassName' => 1,\n    'typeClassName' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'wrapperClassName' => ?string,\n    ?'typeClassName' => ?string,\n  );\n\n  const type TShape = shape(\n    'wrapperClassName' => string,\n    'typeClassName' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 8397972237530040802;\n  /**\n   * Original thrift field:-\n   * 1: string wrapperClassName\n   */\n  public string $wrapperClassName;\n  /**\n   * Original thrift field:-\n   * 2: string typeClassName\n   */\n  public string $typeClassName;\n\n  public function __construct(?string $wrapperClassName = null, ?string $typeClassName = null)[] {\n    $this->wrapperClassName = $wrapperClassName ?? '';\n    $this->typeClassName = $typeClassName ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'wrapperClassName'),\n      Shapes::idx($shape, 'typeClassName'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Wrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"java.Wrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"wrapperClassName\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"typeClassName\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['wrapperClassName'],\n      $shape['typeClassName'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'wrapperClassName' => $this->wrapperClassName,\n      'typeClassName' => $this->typeClassName,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'wrapperClassName') !== null) {\n      $this->wrapperClassName = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['wrapperClassName']);\n    }\n    if (idx($parsed, 'typeClassName') !== null) {\n      $this->typeClassName = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['typeClassName']);\n    }\n  }\n\n}\n\n", "num_lines": 621}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures\\patch;\n\n/**\n * Original thrift enum:-\n * MyEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyEnum'))>>\nenum MyEnum: int {\n  MyValue0 = 0;\n}\n\nclass MyEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.MyEnum\",\n        \"elements\" => dict[\n          0 => \"MyValue0\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * MyData\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyData'))>>\nclass MyData implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'data1',\n      'is_terse' => true,\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'data2',\n      'is_terse' => true,\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'data1' => 1,\n    'data2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'data1' => ?string,\n    ?'data2' => ?int,\n  );\n\n  const type TShape = shape(\n    'data1' => string,\n    'data2' => int,\n    ...\n  );\n  const int STRUCTURAL_ID = 5497211930825790974;\n  /**\n   * Original thrift field:-\n   * 1: string data1\n   */\n  public string $data1;\n  /**\n   * Original thrift field:-\n   * 2: i32 data2\n   */\n  public int $data2;\n\n  public function __construct(?string $data1 = null, ?int $data2 = null)[] {\n    $this->data1 = $data1 ?? '';\n    $this->data2 = $data2 ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'data1'),\n      Shapes::idx($shape, 'data2'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyData';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->data1 = '';\n    $this->data2 = 0;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyData\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"data1\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"data2\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['data1'],\n      $shape['data2'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'data1' => $this->data1,\n      'data2' => $this->data2,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'data1') !== null) {\n      $this->data1 = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['data1']);\n    }\n    if (idx($parsed, 'data2') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['data2']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->data2 = (int)$_tmp0;\n      }\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyDataWithCustomDefault\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyDataWithCustomDefault'))>>\nclass MyDataWithCustomDefault implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'data1',\n      'is_terse' => true,\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'data2',\n      'is_terse' => true,\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'data1' => 1,\n    'data2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'data1' => ?string,\n    ?'data2' => ?int,\n  );\n\n  const type TShape = shape(\n    'data1' => string,\n    'data2' => int,\n    ...\n  );\n  const int STRUCTURAL_ID = 5497211930825790974;\n  /**\n   * Original thrift field:-\n   * 1: string data1\n   */\n  public string $data1;\n  /**\n   * Original thrift field:-\n   * 2: i32 data2\n   */\n  public int $data2;\n\n  public function __construct(?string $data1 = null, ?int $data2 = null)[] {\n    $this->data1 = $data1 ?? \"1\";\n    $this->data2 = $data2 ?? 2;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'data1'),\n      Shapes::idx($shape, 'data2'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyDataWithCustomDefault';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->data1 = '';\n    $this->data2 = 0;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyDataWithCustomDefault\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"data1\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"data2\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['data1'],\n      $shape['data2'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'data1' => $this->data1,\n      'data2' => $this->data2,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'data1') !== null) {\n      $this->data1 = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['data1']);\n    }\n    if (idx($parsed, 'data2') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['data2']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->data2 = (int)$_tmp0;\n      }\n    }\n  }\n\n}\n\nenum InnerUnionEnum: int {\n  _EMPTY_ = 0;\n  innerOption = 1;\n}\n\n/**\n * Original thrift struct:-\n * InnerUnion\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/InnerUnion'))>>\nclass InnerUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<\\test\\fixtures\\patch\\InnerUnionEnum>, \\IThriftShapishSyncStruct {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'innerOption',\n      'union' => true,\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'innerOption' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'innerOption' => ?string,\n  );\n\n  const type TShape = shape(\n    ?'innerOption' => ?string,\n    ...\n  );\n  const int STRUCTURAL_ID = 8244649827300221001;\n  /**\n   * Original thrift field:-\n   * 1: binary innerOption\n   */\n  public ?string $innerOption;\n  protected \\test\\fixtures\\patch\\InnerUnionEnum $_type = \\test\\fixtures\\patch\\InnerUnionEnum::_EMPTY_;\n\n  public function __construct(?string $innerOption = null)[] {\n    $this->_type = \\test\\fixtures\\patch\\InnerUnionEnum::_EMPTY_;\n    if ($innerOption !== null) {\n      $this->innerOption = $innerOption;\n      $this->_type = \\test\\fixtures\\patch\\InnerUnionEnum::innerOption;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'innerOption'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'InnerUnion';\n  }\n\n  public function getType()[]: \\test\\fixtures\\patch\\InnerUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case \\test\\fixtures\\patch\\InnerUnionEnum::innerOption:\n        $this->innerOption = null;\n        break;\n      case \\test\\fixtures\\patch\\InnerUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = \\test\\fixtures\\patch\\InnerUnionEnum::_EMPTY_;\n  }\n\n  public function set_innerOption(string $innerOption)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\patch\\InnerUnionEnum::innerOption;\n    $this->innerOption = $innerOption;\n    return $this;\n  }\n\n  public function get_innerOption()[]: ?string {\n    return $this->innerOption;\n  }\n\n  public function getx_innerOption()[]: string {\n    invariant(\n      $this->_type === \\test\\fixtures\\patch\\InnerUnionEnum::innerOption,\n      'get_innerOption called on an instance of InnerUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->innerOption as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.InnerUnion\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"innerOption\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'innerOption'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'innerOption' => $this->innerOption,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = \\test\\fixtures\\patch\\InnerUnionEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'innerOption') !== null) {\n      $this->innerOption = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['innerOption']);\n      $this->_type = \\test\\fixtures\\patch\\InnerUnionEnum::innerOption;\n    }\n  }\n\n}\n\nenum MyUnionEnum: int {\n  _EMPTY_ = 0;\n  option1 = 1;\n  option2 = 2;\n  option3 = 3;\n}\n\n/**\n * Original thrift struct:-\n * MyUnion\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyUnion'))>>\nclass MyUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<\\test\\fixtures\\patch\\MyUnionEnum>, \\IThriftShapishSyncStruct {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'option1',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'option2',\n      'union' => true,\n      'type' => \\TType::I32,\n    ),\n    3 => shape(\n      'var' => 'option3',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\InnerUnion::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'option1' => 1,\n    'option2' => 2,\n    'option3' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'option1' => ?string,\n    ?'option2' => ?int,\n    ?'option3' => ?\\test\\fixtures\\patch\\InnerUnion,\n  );\n\n  const type TShape = shape(\n    ?'option1' => ?string,\n    ?'option2' => ?int,\n    ?'option3' => ?\\test\\fixtures\\patch\\InnerUnion::TShape,\n    ...\n  );\n  const int STRUCTURAL_ID = 2373941666242479705;\n  /**\n   * Original thrift field:-\n   * 1: string option1\n   */\n  public ?string $option1;\n  /**\n   * Original thrift field:-\n   * 2: i32 option2\n   */\n  public ?int $option2;\n  /**\n   * Original thrift field:-\n   * 3: module.InnerUnion option3\n   */\n  public ?\\test\\fixtures\\patch\\InnerUnion $option3;\n  protected \\test\\fixtures\\patch\\MyUnionEnum $_type = \\test\\fixtures\\patch\\MyUnionEnum::_EMPTY_;\n\n  public function __construct(?string $option1 = null, ?int $option2 = null, ?\\test\\fixtures\\patch\\InnerUnion $option3 = null)[] {\n    $this->_type = \\test\\fixtures\\patch\\MyUnionEnum::_EMPTY_;\n    if ($option1 !== null) {\n      $this->option1 = $option1;\n      $this->_type = \\test\\fixtures\\patch\\MyUnionEnum::option1;\n    }\n    if ($option2 !== null) {\n      $this->option2 = $option2;\n      $this->_type = \\test\\fixtures\\patch\\MyUnionEnum::option2;\n    }\n    if ($option3 !== null) {\n      $this->option3 = $option3;\n      $this->_type = \\test\\fixtures\\patch\\MyUnionEnum::option3;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'option1'),\n      Shapes::idx($shape, 'option2'),\n      Shapes::idx($shape, 'option3'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyUnion';\n  }\n\n  public function getType()[]: \\test\\fixtures\\patch\\MyUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case \\test\\fixtures\\patch\\MyUnionEnum::option1:\n        $this->option1 = null;\n        break;\n      case \\test\\fixtures\\patch\\MyUnionEnum::option2:\n        $this->option2 = null;\n        break;\n      case \\test\\fixtures\\patch\\MyUnionEnum::option3:\n        $this->option3 = null;\n        break;\n      case \\test\\fixtures\\patch\\MyUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = \\test\\fixtures\\patch\\MyUnionEnum::_EMPTY_;\n  }\n\n  public function set_option1(string $option1)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\patch\\MyUnionEnum::option1;\n    $this->option1 = $option1;\n    return $this;\n  }\n\n  public function get_option1()[]: ?string {\n    return $this->option1;\n  }\n\n  public function getx_option1()[]: string {\n    invariant(\n      $this->_type === \\test\\fixtures\\patch\\MyUnionEnum::option1,\n      'get_option1 called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->option1 as nonnull;\n  }\n\n  public function set_option2(int $option2)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\patch\\MyUnionEnum::option2;\n    $this->option2 = $option2;\n    return $this;\n  }\n\n  public function get_option2()[]: ?int {\n    return $this->option2;\n  }\n\n  public function getx_option2()[]: int {\n    invariant(\n      $this->_type === \\test\\fixtures\\patch\\MyUnionEnum::option2,\n      'get_option2 called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->option2 as nonnull;\n  }\n\n  public function set_option3(\\test\\fixtures\\patch\\InnerUnion $option3)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\patch\\MyUnionEnum::option3;\n    $this->option3 = $option3;\n    return $this;\n  }\n\n  public function get_option3()[]: ?\\test\\fixtures\\patch\\InnerUnion {\n    return $this->option3;\n  }\n\n  public function getx_option3()[]: \\test\\fixtures\\patch\\InnerUnion {\n    invariant(\n      $this->_type === \\test\\fixtures\\patch\\MyUnionEnum::option3,\n      'get_option3 called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->option3 as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyUnion\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"option1\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"option2\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.InnerUnion\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"option3\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'option1'),\n      Shapes::idx($shape, 'option2'),\n      Shapes::idx($shape, 'option3') === null ? null : (\\test\\fixtures\\patch\\InnerUnion::__fromShape($shape['option3'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'option1' => $this->option1,\n      'option2' => $this->option2,\n      'option3' => $this->option3?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = \\test\\fixtures\\patch\\MyUnionEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'option1') !== null) {\n      $this->option1 = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['option1']);\n      $this->_type = \\test\\fixtures\\patch\\MyUnionEnum::option1;\n    }\n    if (idx($parsed, 'option2') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['option2']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->option2 = (int)$_tmp0;\n      }\n      $this->_type = \\test\\fixtures\\patch\\MyUnionEnum::option2;\n    }\n    if (idx($parsed, 'option3') !== null) {\n      $_tmp1 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\InnerUnion>($parsed['option3']));\n      $_tmp2 = \\test\\fixtures\\patch\\InnerUnion::withDefaultValues();\n      $_tmp2->readFromJson($_tmp1);\n      $this->option3 = $_tmp2;\n      $this->_type = \\test\\fixtures\\patch\\MyUnionEnum::option3;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyStruct'))>>\nclass MyStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    -1 => shape(\n      'var' => 'boolVal',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    -2 => shape(\n      'var' => 'byteVal',\n      'is_terse' => true,\n      'type' => \\TType::BYTE,\n    ),\n    -3 => shape(\n      'var' => 'i16Val',\n      'is_terse' => true,\n      'type' => \\TType::I16,\n    ),\n    -4 => shape(\n      'var' => 'i32Val',\n      'is_terse' => true,\n      'type' => \\TType::I32,\n    ),\n    -5 => shape(\n      'var' => 'i64Val',\n      'is_terse' => true,\n      'type' => \\TType::I64,\n    ),\n    -6 => shape(\n      'var' => 'floatVal',\n      'is_terse' => true,\n      'type' => \\TType::FLOAT,\n    ),\n    -7 => shape(\n      'var' => 'doubleVal',\n      'is_terse' => true,\n      'type' => \\TType::DOUBLE,\n    ),\n    -8 => shape(\n      'var' => 'stringVal',\n      'is_terse' => true,\n      'type' => \\TType::STRING,\n    ),\n    -9 => shape(\n      'var' => 'binaryVal',\n      'is_terse' => true,\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    -10 => shape(\n      'var' => 'enumVal',\n      'is_terse' => true,\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\patch\\MyEnum::class,\n    ),\n    -11 => shape(\n      'var' => 'structVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyData::class,\n    ),\n    -12 => shape(\n      'var' => 'unionVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyUnion::class,\n    ),\n    -13 => shape(\n      'var' => 'lateStructVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\LateDefStruct::class,\n    ),\n    -14 => shape(\n      'var' => 'optBoolVal',\n      'type' => \\TType::BOOL,\n    ),\n    -15 => shape(\n      'var' => 'optByteVal',\n      'type' => \\TType::BYTE,\n    ),\n    -16 => shape(\n      'var' => 'optI16Val',\n      'type' => \\TType::I16,\n    ),\n    -17 => shape(\n      'var' => 'optI32Val',\n      'type' => \\TType::I32,\n    ),\n    -18 => shape(\n      'var' => 'optI64Val',\n      'type' => \\TType::I64,\n    ),\n    -19 => shape(\n      'var' => 'optFloatVal',\n      'type' => \\TType::FLOAT,\n    ),\n    -20 => shape(\n      'var' => 'optDoubleVal',\n      'type' => \\TType::DOUBLE,\n    ),\n    -21 => shape(\n      'var' => 'optStringVal',\n      'type' => \\TType::STRING,\n    ),\n    -22 => shape(\n      'var' => 'optBinaryVal',\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    -23 => shape(\n      'var' => 'optEnumVal',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\patch\\MyEnum::class,\n    ),\n    -24 => shape(\n      'var' => 'optStructVal',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyData::class,\n    ),\n    -25 => shape(\n      'var' => 'optLateStructVal',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\LateDefStruct::class,\n    ),\n    -26 => shape(\n      'var' => 'optListVal',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    -27 => shape(\n      'var' => 'optSetVal',\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    -28 => shape(\n      'var' => 'optMapVal',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    -29 => shape(\n      'var' => 'listMap',\n      'is_terse' => true,\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    -30 => shape(\n      'var' => 'mapMap',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    -31 => shape(\n      'var' => 'i32WithCustomDefault',\n      'is_terse' => true,\n      'type' => \\TType::I32,\n    ),\n    -32 => shape(\n      'var' => 'structWithCustomDefault',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyDataWithCustomDefault::class,\n    ),\n    1 => shape(\n      'var' => 'structWithFieldCustomDefault',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyData::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'boolVal' => -1,\n    'byteVal' => -2,\n    'i16Val' => -3,\n    'i32Val' => -4,\n    'i64Val' => -5,\n    'floatVal' => -6,\n    'doubleVal' => -7,\n    'stringVal' => -8,\n    'binaryVal' => -9,\n    'enumVal' => -10,\n    'structVal' => -11,\n    'unionVal' => -12,\n    'lateStructVal' => -13,\n    'optBoolVal' => -14,\n    'optByteVal' => -15,\n    'optI16Val' => -16,\n    'optI32Val' => -17,\n    'optI64Val' => -18,\n    'optFloatVal' => -19,\n    'optDoubleVal' => -20,\n    'optStringVal' => -21,\n    'optBinaryVal' => -22,\n    'optEnumVal' => -23,\n    'optStructVal' => -24,\n    'optLateStructVal' => -25,\n    'optListVal' => -26,\n    'optSetVal' => -27,\n    'optMapVal' => -28,\n    'listMap' => -29,\n    'mapMap' => -30,\n    'i32WithCustomDefault' => -31,\n    'structWithCustomDefault' => -32,\n    'structWithFieldCustomDefault' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'boolVal' => ?bool,\n    ?'byteVal' => ?int,\n    ?'i16Val' => ?int,\n    ?'i32Val' => ?int,\n    ?'i64Val' => ?int,\n    ?'floatVal' => ?float,\n    ?'doubleVal' => ?float,\n    ?'stringVal' => ?string,\n    ?'binaryVal' => ?string,\n    ?'enumVal' => ?\\test\\fixtures\\patch\\MyEnum,\n    ?'structVal' => ?\\test\\fixtures\\patch\\MyData,\n    ?'unionVal' => ?\\test\\fixtures\\patch\\MyUnion,\n    ?'lateStructVal' => ?\\test\\fixtures\\patch\\LateDefStruct,\n    ?'optBoolVal' => ?bool,\n    ?'optByteVal' => ?int,\n    ?'optI16Val' => ?int,\n    ?'optI32Val' => ?int,\n    ?'optI64Val' => ?int,\n    ?'optFloatVal' => ?float,\n    ?'optDoubleVal' => ?float,\n    ?'optStringVal' => ?string,\n    ?'optBinaryVal' => ?string,\n    ?'optEnumVal' => ?\\test\\fixtures\\patch\\MyEnum,\n    ?'optStructVal' => ?\\test\\fixtures\\patch\\MyData,\n    ?'optLateStructVal' => ?\\test\\fixtures\\patch\\LateDefStruct,\n    ?'optListVal' => ?Vector<int>,\n    ?'optSetVal' => ?Set<string>,\n    ?'optMapVal' => ?Map<string, string>,\n    ?'listMap' => ?Vector<Map<string, int>>,\n    ?'mapMap' => ?Map<string, Map<string, int>>,\n    ?'i32WithCustomDefault' => ?int,\n    ?'structWithCustomDefault' => ?\\test\\fixtures\\patch\\MyDataWithCustomDefault,\n    ?'structWithFieldCustomDefault' => ?\\test\\fixtures\\patch\\MyData,\n  );\n\n  const type TShape = shape(\n    'boolVal' => bool,\n    'byteVal' => int,\n    'i16Val' => int,\n    'i32Val' => int,\n    'i64Val' => int,\n    'floatVal' => float,\n    'doubleVal' => float,\n    'stringVal' => string,\n    'binaryVal' => string,\n    ?'enumVal' => ?\\test\\fixtures\\patch\\MyEnum,\n    ?'structVal' => ?\\test\\fixtures\\patch\\MyData::TShape,\n    ?'unionVal' => ?\\test\\fixtures\\patch\\MyUnion::TShape,\n    ?'lateStructVal' => ?\\test\\fixtures\\patch\\LateDefStruct::TShape,\n    ?'optBoolVal' => ?bool,\n    ?'optByteVal' => ?int,\n    ?'optI16Val' => ?int,\n    ?'optI32Val' => ?int,\n    ?'optI64Val' => ?int,\n    ?'optFloatVal' => ?float,\n    ?'optDoubleVal' => ?float,\n    ?'optStringVal' => ?string,\n    ?'optBinaryVal' => ?string,\n    ?'optEnumVal' => ?\\test\\fixtures\\patch\\MyEnum,\n    ?'optStructVal' => ?\\test\\fixtures\\patch\\MyData::TShape,\n    ?'optLateStructVal' => ?\\test\\fixtures\\patch\\LateDefStruct::TShape,\n    ?'optListVal' => ?vec<int>,\n    ?'optSetVal' => ?dict<string, bool>,\n    ?'optMapVal' => ?dict<string, string>,\n    'listMap' => vec<dict<string, int>>,\n    'mapMap' => dict<string, dict<string, int>>,\n    'i32WithCustomDefault' => int,\n    ?'structWithCustomDefault' => ?\\test\\fixtures\\patch\\MyDataWithCustomDefault::TShape,\n    ?'structWithFieldCustomDefault' => ?\\test\\fixtures\\patch\\MyData::TShape,\n    ...\n  );\n  const int STRUCTURAL_ID = 8604220942000869633;\n  /**\n   * Original thrift field:-\n   * -1: bool boolVal\n   */\n  public bool $boolVal;\n  /**\n   * Original thrift field:-\n   * -2: byte byteVal\n   */\n  public int $byteVal;\n  /**\n   * Original thrift field:-\n   * -3: i16 i16Val\n   */\n  public int $i16Val;\n  /**\n   * Original thrift field:-\n   * -4: i32 i32Val\n   */\n  public int $i32Val;\n  /**\n   * Original thrift field:-\n   * -5: i64 i64Val\n   */\n  public int $i64Val;\n  /**\n   * Original thrift field:-\n   * -6: float floatVal\n   */\n  public float $floatVal;\n  /**\n   * Original thrift field:-\n   * -7: double doubleVal\n   */\n  public float $doubleVal;\n  /**\n   * Original thrift field:-\n   * -8: string stringVal\n   */\n  public string $stringVal;\n  /**\n   * Original thrift field:-\n   * -9: binary binaryVal\n   */\n  public string $binaryVal;\n  /**\n   * Original thrift field:-\n   * -10: module.MyEnum enumVal\n   */\n  public ?\\test\\fixtures\\patch\\MyEnum $enumVal;\n  /**\n   * Original thrift field:-\n   * -11: module.MyData structVal\n   */\n  public ?\\test\\fixtures\\patch\\MyData $structVal;\n  /**\n   * Original thrift field:-\n   * -12: module.MyUnion unionVal\n   */\n  public ?\\test\\fixtures\\patch\\MyUnion $unionVal;\n  /**\n   * Original thrift field:-\n   * -13: module.LateDefStruct lateStructVal\n   */\n  public ?\\test\\fixtures\\patch\\LateDefStruct $lateStructVal;\n  /**\n   * Original thrift field:-\n   * -14: bool optBoolVal\n   */\n  public ?bool $optBoolVal;\n  /**\n   * Original thrift field:-\n   * -15: byte optByteVal\n   */\n  public ?int $optByteVal;\n  /**\n   * Original thrift field:-\n   * -16: i16 optI16Val\n   */\n  public ?int $optI16Val;\n  /**\n   * Original thrift field:-\n   * -17: i32 optI32Val\n   */\n  public ?int $optI32Val;\n  /**\n   * Original thrift field:-\n   * -18: i64 optI64Val\n   */\n  public ?int $optI64Val;\n  /**\n   * Original thrift field:-\n   * -19: float optFloatVal\n   */\n  public ?float $optFloatVal;\n  /**\n   * Original thrift field:-\n   * -20: double optDoubleVal\n   */\n  public ?float $optDoubleVal;\n  /**\n   * Original thrift field:-\n   * -21: string optStringVal\n   */\n  public ?string $optStringVal;\n  /**\n   * Original thrift field:-\n   * -22: binary optBinaryVal\n   */\n  public ?string $optBinaryVal;\n  /**\n   * Original thrift field:-\n   * -23: module.MyEnum optEnumVal\n   */\n  public ?\\test\\fixtures\\patch\\MyEnum $optEnumVal;\n  /**\n   * Original thrift field:-\n   * -24: module.MyData optStructVal\n   */\n  public ?\\test\\fixtures\\patch\\MyData $optStructVal;\n  /**\n   * Original thrift field:-\n   * -25: module.LateDefStruct optLateStructVal\n   */\n  public ?\\test\\fixtures\\patch\\LateDefStruct $optLateStructVal;\n  /**\n   * Original thrift field:-\n   * -26: list<i16> optListVal\n   */\n  public ?Vector<int> $optListVal;\n  /**\n   * Original thrift field:-\n   * -27: set<string> optSetVal\n   */\n  public ?Set<string> $optSetVal;\n  /**\n   * Original thrift field:-\n   * -28: map<string, string> optMapVal\n   */\n  public ?Map<string, string> $optMapVal;\n  /**\n   * Original thrift field:-\n   * -29: list<map<string, i32>> listMap\n   */\n  public Vector<Map<string, int>> $listMap;\n  /**\n   * Original thrift field:-\n   * -30: map<string, map<string, i32>> mapMap\n   */\n  public Map<string, Map<string, int>> $mapMap;\n  /**\n   * Original thrift field:-\n   * -31: i32 i32WithCustomDefault\n   */\n  public int $i32WithCustomDefault;\n  /**\n   * Original thrift field:-\n   * -32: module.MyDataWithCustomDefault structWithCustomDefault\n   */\n  public ?\\test\\fixtures\\patch\\MyDataWithCustomDefault $structWithCustomDefault;\n  /**\n   * Original thrift field:-\n   * 1: module.MyData structWithFieldCustomDefault\n   */\n  public ?\\test\\fixtures\\patch\\MyData $structWithFieldCustomDefault;\n\n  public function __construct(?bool $boolVal = null, ?int $byteVal = null, ?int $i16Val = null, ?int $i32Val = null, ?int $i64Val = null, ?float $floatVal = null, ?float $doubleVal = null, ?string $stringVal = null, ?string $binaryVal = null, ?\\test\\fixtures\\patch\\MyEnum $enumVal = null, ?\\test\\fixtures\\patch\\MyData $structVal = null, ?\\test\\fixtures\\patch\\MyUnion $unionVal = null, ?\\test\\fixtures\\patch\\LateDefStruct $lateStructVal = null, ?bool $optBoolVal = null, ?int $optByteVal = null, ?int $optI16Val = null, ?int $optI32Val = null, ?int $optI64Val = null, ?float $optFloatVal = null, ?float $optDoubleVal = null, ?string $optStringVal = null, ?string $optBinaryVal = null, ?\\test\\fixtures\\patch\\MyEnum $optEnumVal = null, ?\\test\\fixtures\\patch\\MyData $optStructVal = null, ?\\test\\fixtures\\patch\\LateDefStruct $optLateStructVal = null, ?Vector<int> $optListVal = null, ?Set<string> $optSetVal = null, ?Map<string, string> $optMapVal = null, ?Vector<Map<string, int>> $listMap = null, ?Map<string, Map<string, int>> $mapMap = null, ?int $i32WithCustomDefault = null, ?\\test\\fixtures\\patch\\MyDataWithCustomDefault $structWithCustomDefault = null, ?\\test\\fixtures\\patch\\MyData $structWithFieldCustomDefault = null)[] {\n    $this->boolVal = $boolVal ?? false;\n    $this->byteVal = $byteVal ?? 0;\n    $this->i16Val = $i16Val ?? 0;\n    $this->i32Val = $i32Val ?? 0;\n    $this->i64Val = $i64Val ?? 0;\n    $this->floatVal = $floatVal ?? 0.0;\n    $this->doubleVal = $doubleVal ?? 0.0;\n    $this->stringVal = $stringVal ?? '';\n    $this->binaryVal = $binaryVal ?? '';\n    $this->enumVal = $enumVal;\n    $this->structVal = $structVal;\n    $this->unionVal = $unionVal;\n    $this->lateStructVal = $lateStructVal;\n    $this->optBoolVal = $optBoolVal;\n    $this->optByteVal = $optByteVal;\n    $this->optI16Val = $optI16Val;\n    $this->optI32Val = $optI32Val;\n    $this->optI64Val = $optI64Val;\n    $this->optFloatVal = $optFloatVal;\n    $this->optDoubleVal = $optDoubleVal;\n    $this->optStringVal = $optStringVal;\n    $this->optBinaryVal = $optBinaryVal;\n    $this->optEnumVal = $optEnumVal;\n    $this->optStructVal = $optStructVal;\n    $this->optLateStructVal = $optLateStructVal;\n    $this->optListVal = $optListVal;\n    $this->optSetVal = $optSetVal;\n    $this->optMapVal = $optMapVal;\n    $this->listMap = $listMap ?? Vector {};\n    $this->mapMap = $mapMap ?? Map {};\n    $this->i32WithCustomDefault = $i32WithCustomDefault ?? 1;\n    $this->structWithCustomDefault = $structWithCustomDefault;\n    $this->structWithFieldCustomDefault = $structWithFieldCustomDefault;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'boolVal'),\n      Shapes::idx($shape, 'byteVal'),\n      Shapes::idx($shape, 'i16Val'),\n      Shapes::idx($shape, 'i32Val'),\n      Shapes::idx($shape, 'i64Val'),\n      Shapes::idx($shape, 'floatVal'),\n      Shapes::idx($shape, 'doubleVal'),\n      Shapes::idx($shape, 'stringVal'),\n      Shapes::idx($shape, 'binaryVal'),\n      Shapes::idx($shape, 'enumVal'),\n      Shapes::idx($shape, 'structVal'),\n      Shapes::idx($shape, 'unionVal'),\n      Shapes::idx($shape, 'lateStructVal'),\n      Shapes::idx($shape, 'optBoolVal'),\n      Shapes::idx($shape, 'optByteVal'),\n      Shapes::idx($shape, 'optI16Val'),\n      Shapes::idx($shape, 'optI32Val'),\n      Shapes::idx($shape, 'optI64Val'),\n      Shapes::idx($shape, 'optFloatVal'),\n      Shapes::idx($shape, 'optDoubleVal'),\n      Shapes::idx($shape, 'optStringVal'),\n      Shapes::idx($shape, 'optBinaryVal'),\n      Shapes::idx($shape, 'optEnumVal'),\n      Shapes::idx($shape, 'optStructVal'),\n      Shapes::idx($shape, 'optLateStructVal'),\n      Shapes::idx($shape, 'optListVal'),\n      Shapes::idx($shape, 'optSetVal'),\n      Shapes::idx($shape, 'optMapVal'),\n      Shapes::idx($shape, 'listMap'),\n      Shapes::idx($shape, 'mapMap'),\n      Shapes::idx($shape, 'i32WithCustomDefault'),\n      Shapes::idx($shape, 'structWithCustomDefault'),\n      Shapes::idx($shape, 'structWithFieldCustomDefault'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->boolVal = false;\n    $this->byteVal = 0;\n    $this->i16Val = 0;\n    $this->i32Val = 0;\n    $this->i64Val = 0;\n    $this->floatVal = 0.0;\n    $this->doubleVal = 0.0;\n    $this->stringVal = '';\n    $this->binaryVal = '';\n    $this->enumVal = null;\n    $this->structVal = null;\n    $this->unionVal = null;\n    $this->lateStructVal = null;\n    $this->listMap = Vector {};\n    $this->mapMap = Map {};\n    $this->i32WithCustomDefault = 0;\n    $this->structWithCustomDefault = null;\n    $this->structWithFieldCustomDefault = null;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"boolVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                )\n              ),\n              \"name\" => \"byteVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                )\n              ),\n              \"name\" => \"i16Val\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i32Val\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"i64Val\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_FLOAT_TYPE,\n                )\n              ),\n              \"name\" => \"floatVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"doubleVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"stringVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"binaryVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -10,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"enumVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -11,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyData\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"structVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -12,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyUnion\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"unionVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -13,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.LateDefStruct\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.LateDefStruct\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"lateStructVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -14,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"optBoolVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -15,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                )\n              ),\n              \"name\" => \"optByteVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -16,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                )\n              ),\n              \"name\" => \"optI16Val\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -17,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"optI32Val\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -18,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"optI64Val\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -19,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_FLOAT_TYPE,\n                )\n              ),\n              \"name\" => \"optFloatVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -20,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"optDoubleVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -21,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"optStringVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -22,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"optBinaryVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -23,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optEnumVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -24,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyData\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optStructVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -25,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.LateDefStruct\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.LateDefStruct\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optLateStructVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -26,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optListVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -27,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optSetVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -28,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optMapVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -29,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"listMap\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -30,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"mapMap\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -31,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i32WithCustomDefault\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -32,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyDataWithCustomDefault\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"structWithCustomDefault\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyData\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"structWithFieldCustomDefault\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Testing' => \\facebook\\thrift\\annotation\\Testing::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['boolVal'],\n      $shape['byteVal'],\n      $shape['i16Val'],\n      $shape['i32Val'],\n      $shape['i64Val'],\n      $shape['floatVal'],\n      $shape['doubleVal'],\n      $shape['stringVal'],\n      $shape['binaryVal'],\n      Shapes::idx($shape, 'enumVal'),\n      Shapes::idx($shape, 'structVal') === null ? null : (\\test\\fixtures\\patch\\MyData::__fromShape($shape['structVal'])),\n      Shapes::idx($shape, 'unionVal') === null ? null : (\\test\\fixtures\\patch\\MyUnion::__fromShape($shape['unionVal'])),\n      Shapes::idx($shape, 'lateStructVal') === null ? null : (\\test\\fixtures\\patch\\LateDefStruct::__fromShape($shape['lateStructVal'])),\n      Shapes::idx($shape, 'optBoolVal'),\n      Shapes::idx($shape, 'optByteVal'),\n      Shapes::idx($shape, 'optI16Val'),\n      Shapes::idx($shape, 'optI32Val'),\n      Shapes::idx($shape, 'optI64Val'),\n      Shapes::idx($shape, 'optFloatVal'),\n      Shapes::idx($shape, 'optDoubleVal'),\n      Shapes::idx($shape, 'optStringVal'),\n      Shapes::idx($shape, 'optBinaryVal'),\n      Shapes::idx($shape, 'optEnumVal'),\n      Shapes::idx($shape, 'optStructVal') === null ? null : (\\test\\fixtures\\patch\\MyData::__fromShape($shape['optStructVal'])),\n      Shapes::idx($shape, 'optLateStructVal') === null ? null : (\\test\\fixtures\\patch\\LateDefStruct::__fromShape($shape['optLateStructVal'])),\n      Shapes::idx($shape, 'optListVal') === null ? null : ($shape['optListVal'] |> new Vector($$)),\n      Shapes::idx($shape, 'optSetVal') === null ? null : (new Set(Keyset\\keys($shape['optSetVal']))),\n      Shapes::idx($shape, 'optMapVal') === null ? null : ($shape['optMapVal'] |> new Map($$)),\n      $shape['listMap']\n        |> Vec\\map(\n          $$,\n          $_val0 ==> $_val0 |> new Map($$),\n        ) |> new Vector($$),\n      $shape['mapMap']\n        |> Dict\\map(\n          $$,\n          $_val1 ==> $_val1 |> new Map($$),\n        ) |> new Map($$),\n      $shape['i32WithCustomDefault'],\n      Shapes::idx($shape, 'structWithCustomDefault') === null ? null : (\\test\\fixtures\\patch\\MyDataWithCustomDefault::__fromShape($shape['structWithCustomDefault'])),\n      Shapes::idx($shape, 'structWithFieldCustomDefault') === null ? null : (\\test\\fixtures\\patch\\MyData::__fromShape($shape['structWithFieldCustomDefault'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'boolVal' => $this->boolVal,\n      'byteVal' => $this->byteVal,\n      'i16Val' => $this->i16Val,\n      'i32Val' => $this->i32Val,\n      'i64Val' => $this->i64Val,\n      'floatVal' => $this->floatVal,\n      'doubleVal' => $this->doubleVal,\n      'stringVal' => $this->stringVal,\n      'binaryVal' => $this->binaryVal,\n      'enumVal' => $this->enumVal,\n      'structVal' => $this->structVal?->__toShape(),\n      'unionVal' => $this->unionVal?->__toShape(),\n      'lateStructVal' => $this->lateStructVal?->__toShape(),\n      'optBoolVal' => $this->optBoolVal,\n      'optByteVal' => $this->optByteVal,\n      'optI16Val' => $this->optI16Val,\n      'optI32Val' => $this->optI32Val,\n      'optI64Val' => $this->optI64Val,\n      'optFloatVal' => $this->optFloatVal,\n      'optDoubleVal' => $this->optDoubleVal,\n      'optStringVal' => $this->optStringVal,\n      'optBinaryVal' => $this->optBinaryVal,\n      'optEnumVal' => $this->optEnumVal,\n      'optStructVal' => $this->optStructVal?->__toShape(),\n      'optLateStructVal' => $this->optLateStructVal?->__toShape(),\n      'optListVal' => $this->optListVal\n        |> $$ === null ? null : vec($$),\n      'optSetVal' => $this->optSetVal\n        |> $$ === null ? null : ThriftUtil::toDArray(Dict\\fill_keys($$->toValuesArray(), true), static::class),\n      'optMapVal' => $this->optMapVal\n        |> $$ === null ? null : dict($$),\n      'listMap' => $this->listMap->map(\n        ($_val0) ==> dict($_val0),\n      )\n        |> vec($$),\n      'mapMap' => $this->mapMap->map(\n        ($_val0) ==> dict($_val0),\n      )\n        |> dict($$),\n      'i32WithCustomDefault' => $this->i32WithCustomDefault,\n      'structWithCustomDefault' => $this->structWithCustomDefault?->__toShape(),\n      'structWithFieldCustomDefault' => $this->structWithFieldCustomDefault?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'boolVal') !== null) {\n      $this->boolVal = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['boolVal']);\n    }\n    if (idx($parsed, 'byteVal') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['byteVal']);\n      if ($_tmp0 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->byteVal = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'i16Val') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['i16Val']);\n      if ($_tmp1 > 0x7fff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->i16Val = (int)$_tmp1;\n      }\n    }\n    if (idx($parsed, 'i32Val') !== null) {\n      $_tmp2 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['i32Val']);\n      if ($_tmp2 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->i32Val = (int)$_tmp2;\n      }\n    }\n    if (idx($parsed, 'i64Val') !== null) {\n      $this->i64Val = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['i64Val']);\n    }\n    if (idx($parsed, 'floatVal') !== null) {\n      $this->floatVal = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['floatVal']);\n    }\n    if (idx($parsed, 'doubleVal') !== null) {\n      $this->doubleVal = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['doubleVal']);\n    }\n    if (idx($parsed, 'stringVal') !== null) {\n      $this->stringVal = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['stringVal']);\n    }\n    if (idx($parsed, 'binaryVal') !== null) {\n      $this->binaryVal = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['binaryVal']);\n    }\n    if (idx($parsed, 'enumVal') !== null) {\n      $this->enumVal = \\test\\fixtures\\patch\\MyEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyEnum>($parsed['enumVal']));\n    }\n    if (idx($parsed, 'structVal') !== null) {\n      $_tmp3 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyData>($parsed['structVal']));\n      $_tmp4 = \\test\\fixtures\\patch\\MyData::withDefaultValues();\n      $_tmp4->readFromJson($_tmp3);\n      $this->structVal = $_tmp4;\n    }\n    if (idx($parsed, 'unionVal') !== null) {\n      $_tmp5 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyUnion>($parsed['unionVal']));\n      $_tmp6 = \\test\\fixtures\\patch\\MyUnion::withDefaultValues();\n      $_tmp6->readFromJson($_tmp5);\n      $this->unionVal = $_tmp6;\n    }\n    if (idx($parsed, 'lateStructVal') !== null) {\n      $_tmp7 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\LateDefStruct>($parsed['lateStructVal']));\n      $_tmp8 = \\test\\fixtures\\patch\\LateDefStruct::withDefaultValues();\n      $_tmp8->readFromJson($_tmp7);\n      $this->lateStructVal = $_tmp8;\n    }\n    if (idx($parsed, 'optBoolVal') !== null) {\n      $this->optBoolVal = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['optBoolVal']);\n    }\n    if (idx($parsed, 'optByteVal') !== null) {\n      $_tmp9 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['optByteVal']);\n      if ($_tmp9 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->optByteVal = (int)$_tmp9;\n      }\n    }\n    if (idx($parsed, 'optI16Val') !== null) {\n      $_tmp10 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['optI16Val']);\n      if ($_tmp10 > 0x7fff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->optI16Val = (int)$_tmp10;\n      }\n    }\n    if (idx($parsed, 'optI32Val') !== null) {\n      $_tmp11 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['optI32Val']);\n      if ($_tmp11 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->optI32Val = (int)$_tmp11;\n      }\n    }\n    if (idx($parsed, 'optI64Val') !== null) {\n      $this->optI64Val = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['optI64Val']);\n    }\n    if (idx($parsed, 'optFloatVal') !== null) {\n      $this->optFloatVal = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['optFloatVal']);\n    }\n    if (idx($parsed, 'optDoubleVal') !== null) {\n      $this->optDoubleVal = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['optDoubleVal']);\n    }\n    if (idx($parsed, 'optStringVal') !== null) {\n      $this->optStringVal = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['optStringVal']);\n    }\n    if (idx($parsed, 'optBinaryVal') !== null) {\n      $this->optBinaryVal = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['optBinaryVal']);\n    }\n    if (idx($parsed, 'optEnumVal') !== null) {\n      $this->optEnumVal = \\test\\fixtures\\patch\\MyEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyEnum>($parsed['optEnumVal']));\n    }\n    if (idx($parsed, 'optStructVal') !== null) {\n      $_tmp12 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyData>($parsed['optStructVal']));\n      $_tmp13 = \\test\\fixtures\\patch\\MyData::withDefaultValues();\n      $_tmp13->readFromJson($_tmp12);\n      $this->optStructVal = $_tmp13;\n    }\n    if (idx($parsed, 'optLateStructVal') !== null) {\n      $_tmp14 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\LateDefStruct>($parsed['optLateStructVal']));\n      $_tmp15 = \\test\\fixtures\\patch\\LateDefStruct::withDefaultValues();\n      $_tmp15->readFromJson($_tmp14);\n      $this->optLateStructVal = $_tmp15;\n    }\n    if (idx($parsed, 'optListVal') !== null) {\n      $_json19 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['optListVal']);\n      $_container20 = Vector {};\n      foreach($_json19 as $_key17 => $_value18) {\n        $_elem21 = 0;\n        $_tmp22 = (int)$_value18;\n        if ($_tmp22 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem21 = (int)$_tmp22;\n        }\n        $_container20 []= $_elem21;\n      }\n      $this->optListVal = $_container20;\n    }\n    if (idx($parsed, 'optSetVal') !== null) {\n      $_json26 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<string>>($parsed['optSetVal']);\n      $_container27 = Set {};\n      foreach($_json26 as $_key24 => $_value25) {\n        $_elem28 = '';\n        $_elem28 = $_value25;\n        $_container27->add($_elem28);\n      }\n      $this->optSetVal = $_container27;\n    }\n    if (idx($parsed, 'optMapVal') !== null) {\n      $_json32 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, string>>($parsed['optMapVal']);\n      $_container33 = Map {};\n      foreach($_json32 as $_key30 => $_value31) {\n        $_value34 = '';\n        $_value34 = $_value31;\n        $_container33[$_key30] = $_value34;\n      }\n      $this->optMapVal = $_container33;\n    }\n    if (idx($parsed, 'listMap') !== null) {\n      $_json38 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<Map<string, int>>>($parsed['listMap']);\n      $_container39 = Vector {};\n      foreach($_json38 as $_key36 => $_value37) {\n        $_elem40 = Map {};\n        $_json44 = $_value37;\n        $_container45 = Map {};\n        foreach($_json44 as $_key42 => $_value43) {\n          $_value46 = 0;\n          $_tmp47 = (int)$_value43;\n          if ($_tmp47 > 0x7fffffff) {\n            throw new \\TProtocolException(\"number exceeds limit in field\");\n          } else {\n            $_value46 = (int)$_tmp47;\n          }\n          $_container45[$_key42] = $_value46;\n        }\n        $_elem40 = $_container45;\n        $_container39 []= $_elem40;\n      }\n      $this->listMap = $_container39;\n    }\n    if (idx($parsed, 'mapMap') !== null) {\n      $_json51 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, Map<string, int>>>($parsed['mapMap']);\n      $_container52 = Map {};\n      foreach($_json51 as $_key49 => $_value50) {\n        $_value53 = Map {};\n        $_json57 = $_value50;\n        $_container58 = Map {};\n        foreach($_json57 as $_key55 => $_value56) {\n          $_value59 = 0;\n          $_tmp60 = (int)$_value56;\n          if ($_tmp60 > 0x7fffffff) {\n            throw new \\TProtocolException(\"number exceeds limit in field\");\n          } else {\n            $_value59 = (int)$_tmp60;\n          }\n          $_container58[$_key55] = $_value59;\n        }\n        $_value53 = $_container58;\n        $_container52[$_key49] = $_value53;\n      }\n      $this->mapMap = $_container52;\n    }\n    if (idx($parsed, 'i32WithCustomDefault') !== null) {\n      $_tmp61 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['i32WithCustomDefault']);\n      if ($_tmp61 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->i32WithCustomDefault = (int)$_tmp61;\n      }\n    }\n    if (idx($parsed, 'structWithCustomDefault') !== null) {\n      $_tmp62 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyDataWithCustomDefault>($parsed['structWithCustomDefault']));\n      $_tmp63 = \\test\\fixtures\\patch\\MyDataWithCustomDefault::withDefaultValues();\n      $_tmp63->readFromJson($_tmp62);\n      $this->structWithCustomDefault = $_tmp63;\n    }\n    if (idx($parsed, 'structWithFieldCustomDefault') !== null) {\n      $_tmp64 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyData>($parsed['structWithFieldCustomDefault']));\n      $_tmp65 = \\test\\fixtures\\patch\\MyData::withDefaultValues();\n      $_tmp65->readFromJson($_tmp64);\n      $this->structWithFieldCustomDefault = $_tmp65;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * LateDefStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/LateDefStruct'))>>\nclass LateDefStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'LateDefStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.LateDefStruct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Recursive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/Recursive'))>>\nclass Recursive implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    -1 => shape(\n      'var' => 'nodes',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\test\\fixtures\\patch\\Recursive::class,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'nodes' => -1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'nodes' => ?Map<string, \\test\\fixtures\\patch\\Recursive>,\n  );\n\n  const type TShape = shape(\n    'nodes' => dict<string, \\test\\fixtures\\patch\\Recursive::TShape>,\n    ...\n  );\n  const int STRUCTURAL_ID = 6832467362236085104;\n  /**\n   * Original thrift field:-\n   * -1: map<string, module.Recursive> nodes\n   */\n  public Map<string, \\test\\fixtures\\patch\\Recursive> $nodes;\n\n  public function __construct(?Map<string, \\test\\fixtures\\patch\\Recursive> $nodes = null)[] {\n    $this->nodes = $nodes ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'nodes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Recursive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->nodes = Map {};\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Recursive\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.Recursive\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.Recursive\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"nodes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'nodes' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\op\\AssignOnlyPatch' => \\facebook\\thrift\\op\\AssignOnlyPatch::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['nodes']\n        |> Dict\\map(\n          $$,\n          $_val0 ==> $_val0\n            |> \\test\\fixtures\\patch\\Recursive::__fromShape($$),\n        ) |> new Map($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'nodes' => $this->nodes->map(\n        ($_val0) ==> $_val0->__toShape(),\n      )\n        |> dict($$),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'nodes') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, \\test\\fixtures\\patch\\Recursive>>($parsed['nodes']);\n      $_container4 = Map {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_value5 = \\test\\fixtures\\patch\\Recursive::withDefaultValues();\n        $_tmp6 = \\json_encode($_value2);\n        $_tmp7 = \\test\\fixtures\\patch\\Recursive::withDefaultValues();\n        $_tmp7->readFromJson($_tmp6);\n        $_value5 = $_tmp7;\n        $_container4[$_key1] = $_value5;\n      }\n      $this->nodes = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Bar\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/Bar'))>>\nclass Bar implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    -1 => shape(\n      'var' => 'loop',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\Loop::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'loop' => -1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'loop' => ?\\test\\fixtures\\patch\\Loop,\n  );\n\n  const type TShape = shape(\n    ?'loop' => ?\\test\\fixtures\\patch\\Loop::TShape,\n    ...\n  );\n  const int STRUCTURAL_ID = 418974100266768802;\n  /**\n   * Original thrift field:-\n   * -1: module.Loop loop\n   */\n  public ?\\test\\fixtures\\patch\\Loop $loop;\n\n  public function __construct(?\\test\\fixtures\\patch\\Loop $loop = null)[] {\n    $this->loop = $loop;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'loop'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Bar';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->loop = null;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Bar\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.Loop\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.Loop\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"loop\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'loop' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\op\\AssignOnlyPatch' => \\facebook\\thrift\\op\\AssignOnlyPatch::fromShape(\n              shape(\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'loop') === null ? null : (\\test\\fixtures\\patch\\Loop::__fromShape($shape['loop'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'loop' => $this->loop?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'loop') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\Loop>($parsed['loop']));\n      $_tmp1 = \\test\\fixtures\\patch\\Loop::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->loop = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Loop\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/Loop'))>>\nclass Loop implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    -1 => shape(\n      'var' => 'bar',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\Bar::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'bar' => -1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'bar' => ?\\test\\fixtures\\patch\\Bar,\n  );\n\n  const type TShape = shape(\n    ?'bar' => ?\\test\\fixtures\\patch\\Bar::TShape,\n    ...\n  );\n  const int STRUCTURAL_ID = 3942468431999341434;\n  /**\n   * Original thrift field:-\n   * -1: module.Bar bar\n   */\n  public ?\\test\\fixtures\\patch\\Bar $bar;\n\n  public function __construct(?\\test\\fixtures\\patch\\Bar $bar = null)[] {\n    $this->bar = $bar;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'bar'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Loop';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->bar = null;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Loop\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Bar\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"bar\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\op\\AssignOnlyPatch' => \\facebook\\thrift\\op\\AssignOnlyPatch::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n        'bar' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\op\\AssignOnlyPatch' => \\facebook\\thrift\\op\\AssignOnlyPatch::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'bar') === null ? null : (\\test\\fixtures\\patch\\Bar::__fromShape($shape['bar'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'bar' => $this->bar?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'bar') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\Bar>($parsed['bar']));\n      $_tmp1 = \\test\\fixtures\\patch\\Bar::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->bar = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyDataPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyDataPatch'))>>\nclass MyDataPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyData::class,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    3 => shape(\n      'var' => 'patchPrior',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyDataFieldPatch::class,\n    ),\n    5 => shape(\n      'var' => 'ensure',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyDataEnsureStruct::class,\n    ),\n    6 => shape(\n      'var' => 'patch',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyDataFieldPatch::class,\n    ),\n    7 => shape(\n      'var' => 'remove',\n      'is_terse' => true,\n      'type' => \\TType::SET,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'patchPrior' => 3,\n    'ensure' => 5,\n    'patch' => 6,\n    'remove' => 7,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?\\test\\fixtures\\patch\\MyData,\n    ?'clear' => ?bool,\n    ?'patchPrior' => ?\\test\\fixtures\\patch\\MyDataFieldPatch,\n    ?'ensure' => ?\\test\\fixtures\\patch\\MyDataEnsureStruct,\n    ?'patch' => ?\\test\\fixtures\\patch\\MyDataFieldPatch,\n    ?'remove' => ?Set<int>,\n  );\n\n  const int STRUCTURAL_ID = 3179324577763743942;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: module.MyData assign\n   */\n  public ?\\test\\fixtures\\patch\\MyData $assign;\n  /**\n   * Clears a value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Patches any previously set values. Applies second.\n   * \n   * Original thrift field:-\n   * 3: module.MyDataFieldPatch patchPrior\n   */\n  public ?\\test\\fixtures\\patch\\MyDataFieldPatch $patchPrior;\n  /**\n   * Initialize fields, using the given defaults. Applies third.\n   * \n   * Original thrift field:-\n   * 5: module.MyDataEnsureStruct ensure\n   */\n  public ?\\test\\fixtures\\patch\\MyDataEnsureStruct $ensure;\n  /**\n   * Patches any set value, including newly set values. Applies last.\n   * \n   * Original thrift field:-\n   * 6: module.MyDataFieldPatch patch\n   */\n  public ?\\test\\fixtures\\patch\\MyDataFieldPatch $patch;\n  /**\n   * Removes entries, if present. Applies third.\n   * \n   * Original thrift field:-\n   * 7: set<patch.FieldId> remove\n   */\n  public Set<int> $remove;\n\n  public function __construct(?\\test\\fixtures\\patch\\MyData $assign = null, ?bool $clear = null, ?\\test\\fixtures\\patch\\MyDataFieldPatch $patchPrior = null, ?\\test\\fixtures\\patch\\MyDataEnsureStruct $ensure = null, ?\\test\\fixtures\\patch\\MyDataFieldPatch $patch = null, ?Set<int> $remove = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->patchPrior = $patchPrior;\n    $this->ensure = $ensure;\n    $this->patch = $patch;\n    $this->remove = $remove ?? Set {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'patchPrior'),\n      Shapes::idx($shape, 'ensure'),\n      Shapes::idx($shape, 'patch'),\n      Shapes::idx($shape, 'remove'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyDataPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->patchPrior = null;\n    $this->ensure = null;\n    $this->patch = null;\n    $this->remove = Set {};\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyDataPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyData\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyDataFieldPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patchPrior\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyDataEnsureStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ensure\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyDataFieldPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patch\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"patch.FieldId\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"id.FieldId\",\n                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"remove\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::MyDataPatchStruct>\",\n            \"underlyingName\" => \"MyDataPatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'patchPrior' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::MyDataFieldPatchStruct>\",\n                \"underlyingName\" => \"MyDataFieldPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'ensure' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude' => \\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude::fromShape(\n              shape(\n              )\n            ),\n          ],\n        ),\n        'patch' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::MyDataFieldPatchStruct>\",\n                \"underlyingName\" => \"MyDataFieldPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyData>($parsed['assign']));\n      $_tmp1 = \\test\\fixtures\\patch\\MyData::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->assign = $_tmp1;\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'patchPrior') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyDataFieldPatch>($parsed['patchPrior']));\n      $_tmp3 = \\test\\fixtures\\patch\\MyDataFieldPatch::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->patchPrior = $_tmp3;\n    }\n    if (idx($parsed, 'ensure') !== null) {\n      $_tmp4 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyDataEnsureStruct>($parsed['ensure']));\n      $_tmp5 = \\test\\fixtures\\patch\\MyDataEnsureStruct::withDefaultValues();\n      $_tmp5->readFromJson($_tmp4);\n      $this->ensure = $_tmp5;\n    }\n    if (idx($parsed, 'patch') !== null) {\n      $_tmp6 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyDataFieldPatch>($parsed['patch']));\n      $_tmp7 = \\test\\fixtures\\patch\\MyDataFieldPatch::withDefaultValues();\n      $_tmp7->readFromJson($_tmp6);\n      $this->patch = $_tmp7;\n    }\n    if (idx($parsed, 'remove') !== null) {\n      $_json11 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['remove']);\n      $_container12 = Set {};\n      foreach($_json11 as $_key9 => $_value10) {\n        $_elem13 = 0;\n        $_tmp14 = (int)$_value10;\n        if ($_tmp14 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem13 = (int)$_tmp14;\n        }\n        $_container12->add($_elem13);\n      }\n      $this->remove = $_container12;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyDataFieldPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyDataFieldPatch'))>>\nclass MyDataFieldPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'data1',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\StringPatch::class,\n    ),\n    2 => shape(\n      'var' => 'data2',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\I32Patch::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'data1' => 1,\n    'data2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'data1' => ?\\facebook\\thrift\\op\\StringPatch,\n    ?'data2' => ?\\facebook\\thrift\\op\\I32Patch,\n  );\n\n  const int STRUCTURAL_ID = 6838201112512803660;\n  /**\n   * Original thrift field:-\n   * 1: patch.StringPatch data1\n   */\n  public ?\\facebook\\thrift\\op\\StringPatch $data1;\n  /**\n   * Original thrift field:-\n   * 2: patch.I32Patch data2\n   */\n  public ?\\facebook\\thrift\\op\\I32Patch $data2;\n\n  public function __construct(?\\facebook\\thrift\\op\\StringPatch $data1 = null, ?\\facebook\\thrift\\op\\I32Patch $data2 = null)[] {\n    $this->data1 = $data1;\n    $this->data2 = $data2;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'data1'),\n      Shapes::idx($shape, 'data2'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyDataFieldPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->data1 = null;\n    $this->data2 = null;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyDataFieldPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.StringPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"data1\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.I32Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"data2\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::MyDataFieldPatchStruct>\",\n            \"underlyingName\" => \"MyDataFieldPatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'data1' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::StringPatchAdapter<::apache::thrift::op::StringPatchStruct>\",\n                \"underlyingName\" => \"StringPatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'data2' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::I32PatchStruct>\",\n                \"underlyingName\" => \"I32PatchStruct\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'data1') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\StringPatch>($parsed['data1']));\n      $_tmp1 = \\facebook\\thrift\\op\\StringPatch::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->data1 = $_tmp1;\n    }\n    if (idx($parsed, 'data2') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\I32Patch>($parsed['data2']));\n      $_tmp3 = \\facebook\\thrift\\op\\I32Patch::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->data2 = $_tmp3;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyDataEnsureStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyDataEnsureStruct'))>>\nclass MyDataEnsureStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'data1',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'data2',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'data1' => 1,\n    'data2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'data1' => ?string,\n    ?'data2' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 6756681704373274917;\n  /**\n   * Original thrift field:-\n   * 1: string data1\n   */\n  public ?string $data1;\n  /**\n   * Original thrift field:-\n   * 2: i32 data2\n   */\n  public ?int $data2;\n\n  public function __construct(?string $data1 = null, ?int $data2 = null)[] {\n    $this->data1 = $data1;\n    $this->data2 = $data2;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'data1'),\n      Shapes::idx($shape, 'data2'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyDataEnsureStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyDataEnsureStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"data1\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"data2\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude' => \\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'data1') !== null) {\n      $this->data1 = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['data1']);\n    }\n    if (idx($parsed, 'data2') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['data2']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->data2 = (int)$_tmp0;\n      }\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyDataWithCustomDefaultPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyDataWithCustomDefaultPatch'))>>\nclass MyDataWithCustomDefaultPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyDataWithCustomDefault::class,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    3 => shape(\n      'var' => 'patchPrior',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyDataWithCustomDefaultFieldPatch::class,\n    ),\n    5 => shape(\n      'var' => 'ensure',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyDataWithCustomDefaultEnsureStruct::class,\n    ),\n    6 => shape(\n      'var' => 'patch',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyDataWithCustomDefaultFieldPatch::class,\n    ),\n    7 => shape(\n      'var' => 'remove',\n      'is_terse' => true,\n      'type' => \\TType::SET,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'patchPrior' => 3,\n    'ensure' => 5,\n    'patch' => 6,\n    'remove' => 7,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?\\test\\fixtures\\patch\\MyDataWithCustomDefault,\n    ?'clear' => ?bool,\n    ?'patchPrior' => ?\\test\\fixtures\\patch\\MyDataWithCustomDefaultFieldPatch,\n    ?'ensure' => ?\\test\\fixtures\\patch\\MyDataWithCustomDefaultEnsureStruct,\n    ?'patch' => ?\\test\\fixtures\\patch\\MyDataWithCustomDefaultFieldPatch,\n    ?'remove' => ?Set<int>,\n  );\n\n  const int STRUCTURAL_ID = 1453378509450537954;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: module.MyDataWithCustomDefault assign\n   */\n  public ?\\test\\fixtures\\patch\\MyDataWithCustomDefault $assign;\n  /**\n   * Clears a value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Patches any previously set values. Applies second.\n   * \n   * Original thrift field:-\n   * 3: module.MyDataWithCustomDefaultFieldPatch patchPrior\n   */\n  public ?\\test\\fixtures\\patch\\MyDataWithCustomDefaultFieldPatch $patchPrior;\n  /**\n   * Initialize fields, using the given defaults. Applies third.\n   * \n   * Original thrift field:-\n   * 5: module.MyDataWithCustomDefaultEnsureStruct ensure\n   */\n  public ?\\test\\fixtures\\patch\\MyDataWithCustomDefaultEnsureStruct $ensure;\n  /**\n   * Patches any set value, including newly set values. Applies last.\n   * \n   * Original thrift field:-\n   * 6: module.MyDataWithCustomDefaultFieldPatch patch\n   */\n  public ?\\test\\fixtures\\patch\\MyDataWithCustomDefaultFieldPatch $patch;\n  /**\n   * Removes entries, if present. Applies third.\n   * \n   * Original thrift field:-\n   * 7: set<patch.FieldId> remove\n   */\n  public Set<int> $remove;\n\n  public function __construct(?\\test\\fixtures\\patch\\MyDataWithCustomDefault $assign = null, ?bool $clear = null, ?\\test\\fixtures\\patch\\MyDataWithCustomDefaultFieldPatch $patchPrior = null, ?\\test\\fixtures\\patch\\MyDataWithCustomDefaultEnsureStruct $ensure = null, ?\\test\\fixtures\\patch\\MyDataWithCustomDefaultFieldPatch $patch = null, ?Set<int> $remove = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->patchPrior = $patchPrior;\n    $this->ensure = $ensure;\n    $this->patch = $patch;\n    $this->remove = $remove ?? Set {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'patchPrior'),\n      Shapes::idx($shape, 'ensure'),\n      Shapes::idx($shape, 'patch'),\n      Shapes::idx($shape, 'remove'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyDataWithCustomDefaultPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->patchPrior = null;\n    $this->ensure = null;\n    $this->patch = null;\n    $this->remove = Set {};\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyDataWithCustomDefaultPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyDataWithCustomDefault\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyDataWithCustomDefaultFieldPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patchPrior\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyDataWithCustomDefaultEnsureStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ensure\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyDataWithCustomDefaultFieldPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patch\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"patch.FieldId\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"id.FieldId\",\n                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"remove\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::MyDataWithCustomDefaultPatchStruct>\",\n            \"underlyingName\" => \"MyDataWithCustomDefaultPatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'patchPrior' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::MyDataWithCustomDefaultFieldPatchStruct>\",\n                \"underlyingName\" => \"MyDataWithCustomDefaultFieldPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'ensure' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude' => \\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude::fromShape(\n              shape(\n              )\n            ),\n          ],\n        ),\n        'patch' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::MyDataWithCustomDefaultFieldPatchStruct>\",\n                \"underlyingName\" => \"MyDataWithCustomDefaultFieldPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyDataWithCustomDefault>($parsed['assign']));\n      $_tmp1 = \\test\\fixtures\\patch\\MyDataWithCustomDefault::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->assign = $_tmp1;\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'patchPrior') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyDataWithCustomDefaultFieldPatch>($parsed['patchPrior']));\n      $_tmp3 = \\test\\fixtures\\patch\\MyDataWithCustomDefaultFieldPatch::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->patchPrior = $_tmp3;\n    }\n    if (idx($parsed, 'ensure') !== null) {\n      $_tmp4 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyDataWithCustomDefaultEnsureStruct>($parsed['ensure']));\n      $_tmp5 = \\test\\fixtures\\patch\\MyDataWithCustomDefaultEnsureStruct::withDefaultValues();\n      $_tmp5->readFromJson($_tmp4);\n      $this->ensure = $_tmp5;\n    }\n    if (idx($parsed, 'patch') !== null) {\n      $_tmp6 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyDataWithCustomDefaultFieldPatch>($parsed['patch']));\n      $_tmp7 = \\test\\fixtures\\patch\\MyDataWithCustomDefaultFieldPatch::withDefaultValues();\n      $_tmp7->readFromJson($_tmp6);\n      $this->patch = $_tmp7;\n    }\n    if (idx($parsed, 'remove') !== null) {\n      $_json11 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['remove']);\n      $_container12 = Set {};\n      foreach($_json11 as $_key9 => $_value10) {\n        $_elem13 = 0;\n        $_tmp14 = (int)$_value10;\n        if ($_tmp14 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem13 = (int)$_tmp14;\n        }\n        $_container12->add($_elem13);\n      }\n      $this->remove = $_container12;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyDataWithCustomDefaultFieldPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyDataWithCustomDefaultFieldPatch'))>>\nclass MyDataWithCustomDefaultFieldPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'data1',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\StringPatch::class,\n    ),\n    2 => shape(\n      'var' => 'data2',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\I32Patch::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'data1' => 1,\n    'data2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'data1' => ?\\facebook\\thrift\\op\\StringPatch,\n    ?'data2' => ?\\facebook\\thrift\\op\\I32Patch,\n  );\n\n  const int STRUCTURAL_ID = 6838201112512803660;\n  /**\n   * Original thrift field:-\n   * 1: patch.StringPatch data1\n   */\n  public ?\\facebook\\thrift\\op\\StringPatch $data1;\n  /**\n   * Original thrift field:-\n   * 2: patch.I32Patch data2\n   */\n  public ?\\facebook\\thrift\\op\\I32Patch $data2;\n\n  public function __construct(?\\facebook\\thrift\\op\\StringPatch $data1 = null, ?\\facebook\\thrift\\op\\I32Patch $data2 = null)[] {\n    $this->data1 = $data1;\n    $this->data2 = $data2;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'data1'),\n      Shapes::idx($shape, 'data2'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyDataWithCustomDefaultFieldPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->data1 = null;\n    $this->data2 = null;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyDataWithCustomDefaultFieldPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.StringPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"data1\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.I32Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"data2\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::MyDataWithCustomDefaultFieldPatchStruct>\",\n            \"underlyingName\" => \"MyDataWithCustomDefaultFieldPatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'data1' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::StringPatchAdapter<::apache::thrift::op::StringPatchStruct>\",\n                \"underlyingName\" => \"StringPatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'data2' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::I32PatchStruct>\",\n                \"underlyingName\" => \"I32PatchStruct\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'data1') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\StringPatch>($parsed['data1']));\n      $_tmp1 = \\facebook\\thrift\\op\\StringPatch::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->data1 = $_tmp1;\n    }\n    if (idx($parsed, 'data2') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\I32Patch>($parsed['data2']));\n      $_tmp3 = \\facebook\\thrift\\op\\I32Patch::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->data2 = $_tmp3;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyDataWithCustomDefaultEnsureStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyDataWithCustomDefaultEnsureStruct'))>>\nclass MyDataWithCustomDefaultEnsureStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'data1',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'data2',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'data1' => 1,\n    'data2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'data1' => ?string,\n    ?'data2' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 6756681704373274917;\n  /**\n   * Original thrift field:-\n   * 1: string data1\n   */\n  public ?string $data1;\n  /**\n   * Original thrift field:-\n   * 2: i32 data2\n   */\n  public ?int $data2;\n\n  public function __construct(?string $data1 = null, ?int $data2 = null)[] {\n    $this->data1 = $data1;\n    $this->data2 = $data2;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'data1'),\n      Shapes::idx($shape, 'data2'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyDataWithCustomDefaultEnsureStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyDataWithCustomDefaultEnsureStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"data1\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"data2\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude' => \\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'data1') !== null) {\n      $this->data1 = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['data1']);\n    }\n    if (idx($parsed, 'data2') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['data2']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->data2 = (int)$_tmp0;\n      }\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * InnerUnionPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/InnerUnionPatch'))>>\nclass InnerUnionPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\InnerUnion::class,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    3 => shape(\n      'var' => 'patchPrior',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\InnerUnionFieldPatch::class,\n    ),\n    4 => shape(\n      'var' => 'ensure',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\InnerUnion::class,\n    ),\n    6 => shape(\n      'var' => 'patch',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\InnerUnionFieldPatch::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'patchPrior' => 3,\n    'ensure' => 4,\n    'patch' => 6,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?\\test\\fixtures\\patch\\InnerUnion,\n    ?'clear' => ?bool,\n    ?'patchPrior' => ?\\test\\fixtures\\patch\\InnerUnionFieldPatch,\n    ?'ensure' => ?\\test\\fixtures\\patch\\InnerUnion,\n    ?'patch' => ?\\test\\fixtures\\patch\\InnerUnionFieldPatch,\n  );\n\n  const int STRUCTURAL_ID = 1915469083935775747;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: module.InnerUnion assign\n   */\n  public ?\\test\\fixtures\\patch\\InnerUnion $assign;\n  /**\n   * Clears any set value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Patches any previously set values. Applies second.\n   * \n   * Original thrift field:-\n   * 3: module.InnerUnionFieldPatch patchPrior\n   */\n  public ?\\test\\fixtures\\patch\\InnerUnionFieldPatch $patchPrior;\n  /**\n   * Assigns the value, if not already set to the same field. Applies third.\n   * \n   * Original thrift field:-\n   * 4: module.InnerUnion ensure\n   */\n  public ?\\test\\fixtures\\patch\\InnerUnion $ensure;\n  /**\n   * Patches any set value, including newly set values. Applies last.\n   * \n   * Original thrift field:-\n   * 6: module.InnerUnionFieldPatch patch\n   */\n  public ?\\test\\fixtures\\patch\\InnerUnionFieldPatch $patch;\n\n  public function __construct(?\\test\\fixtures\\patch\\InnerUnion $assign = null, ?bool $clear = null, ?\\test\\fixtures\\patch\\InnerUnionFieldPatch $patchPrior = null, ?\\test\\fixtures\\patch\\InnerUnion $ensure = null, ?\\test\\fixtures\\patch\\InnerUnionFieldPatch $patch = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->patchPrior = $patchPrior;\n    $this->ensure = $ensure;\n    $this->patch = $patch;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'patchPrior'),\n      Shapes::idx($shape, 'ensure'),\n      Shapes::idx($shape, 'patch'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'InnerUnionPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->patchPrior = null;\n    $this->ensure = null;\n    $this->patch = null;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.InnerUnionPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.InnerUnion\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.InnerUnionFieldPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patchPrior\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.InnerUnion\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ensure\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.InnerUnionFieldPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patch\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::UnionPatchAdapter<::test::fixtures::patch::InnerUnionPatchStruct>\",\n            \"underlyingName\" => \"InnerUnionPatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'patchPrior' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::InnerUnionFieldPatchStruct>\",\n                \"underlyingName\" => \"InnerUnionFieldPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'ensure' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'patch' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::InnerUnionFieldPatchStruct>\",\n                \"underlyingName\" => \"InnerUnionFieldPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\InnerUnion>($parsed['assign']));\n      $_tmp1 = \\test\\fixtures\\patch\\InnerUnion::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->assign = $_tmp1;\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'patchPrior') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\InnerUnionFieldPatch>($parsed['patchPrior']));\n      $_tmp3 = \\test\\fixtures\\patch\\InnerUnionFieldPatch::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->patchPrior = $_tmp3;\n    }\n    if (idx($parsed, 'ensure') !== null) {\n      $_tmp4 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\InnerUnion>($parsed['ensure']));\n      $_tmp5 = \\test\\fixtures\\patch\\InnerUnion::withDefaultValues();\n      $_tmp5->readFromJson($_tmp4);\n      $this->ensure = $_tmp5;\n    }\n    if (idx($parsed, 'patch') !== null) {\n      $_tmp6 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\InnerUnionFieldPatch>($parsed['patch']));\n      $_tmp7 = \\test\\fixtures\\patch\\InnerUnionFieldPatch::withDefaultValues();\n      $_tmp7->readFromJson($_tmp6);\n      $this->patch = $_tmp7;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * InnerUnionFieldPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/InnerUnionFieldPatch'))>>\nclass InnerUnionFieldPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'innerOption',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\BinaryPatch::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'innerOption' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'innerOption' => ?\\facebook\\thrift\\op\\BinaryPatch,\n  );\n\n  const int STRUCTURAL_ID = 7781104017677120443;\n  /**\n   * Original thrift field:-\n   * 1: patch.BinaryPatch innerOption\n   */\n  public ?\\facebook\\thrift\\op\\BinaryPatch $innerOption;\n\n  public function __construct(?\\facebook\\thrift\\op\\BinaryPatch $innerOption = null)[] {\n    $this->innerOption = $innerOption;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'innerOption'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'InnerUnionFieldPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->innerOption = null;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.InnerUnionFieldPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.BinaryPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"innerOption\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::InnerUnionFieldPatchStruct>\",\n            \"underlyingName\" => \"InnerUnionFieldPatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'innerOption' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::BinaryPatchAdapter<::apache::thrift::op::BinaryPatchStruct>\",\n                \"underlyingName\" => \"BinaryPatchStruct\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'innerOption') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\BinaryPatch>($parsed['innerOption']));\n      $_tmp1 = \\facebook\\thrift\\op\\BinaryPatch::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->innerOption = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyUnionPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyUnionPatch'))>>\nclass MyUnionPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyUnion::class,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    3 => shape(\n      'var' => 'patchPrior',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyUnionFieldPatch::class,\n    ),\n    4 => shape(\n      'var' => 'ensure',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyUnion::class,\n    ),\n    6 => shape(\n      'var' => 'patch',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyUnionFieldPatch::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'patchPrior' => 3,\n    'ensure' => 4,\n    'patch' => 6,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?\\test\\fixtures\\patch\\MyUnion,\n    ?'clear' => ?bool,\n    ?'patchPrior' => ?\\test\\fixtures\\patch\\MyUnionFieldPatch,\n    ?'ensure' => ?\\test\\fixtures\\patch\\MyUnion,\n    ?'patch' => ?\\test\\fixtures\\patch\\MyUnionFieldPatch,\n  );\n\n  const int STRUCTURAL_ID = 366391298232838551;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: module.MyUnion assign\n   */\n  public ?\\test\\fixtures\\patch\\MyUnion $assign;\n  /**\n   * Clears any set value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Patches any previously set values. Applies second.\n   * \n   * Original thrift field:-\n   * 3: module.MyUnionFieldPatch patchPrior\n   */\n  public ?\\test\\fixtures\\patch\\MyUnionFieldPatch $patchPrior;\n  /**\n   * Assigns the value, if not already set to the same field. Applies third.\n   * \n   * Original thrift field:-\n   * 4: module.MyUnion ensure\n   */\n  public ?\\test\\fixtures\\patch\\MyUnion $ensure;\n  /**\n   * Patches any set value, including newly set values. Applies last.\n   * \n   * Original thrift field:-\n   * 6: module.MyUnionFieldPatch patch\n   */\n  public ?\\test\\fixtures\\patch\\MyUnionFieldPatch $patch;\n\n  public function __construct(?\\test\\fixtures\\patch\\MyUnion $assign = null, ?bool $clear = null, ?\\test\\fixtures\\patch\\MyUnionFieldPatch $patchPrior = null, ?\\test\\fixtures\\patch\\MyUnion $ensure = null, ?\\test\\fixtures\\patch\\MyUnionFieldPatch $patch = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->patchPrior = $patchPrior;\n    $this->ensure = $ensure;\n    $this->patch = $patch;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'patchPrior'),\n      Shapes::idx($shape, 'ensure'),\n      Shapes::idx($shape, 'patch'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyUnionPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->patchPrior = null;\n    $this->ensure = null;\n    $this->patch = null;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyUnionPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyUnion\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyUnionFieldPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patchPrior\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyUnion\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ensure\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyUnionFieldPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patch\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::UnionPatchAdapter<::test::fixtures::patch::MyUnionPatchStruct>\",\n            \"underlyingName\" => \"MyUnionPatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'patchPrior' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::MyUnionFieldPatchStruct>\",\n                \"underlyingName\" => \"MyUnionFieldPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'ensure' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'patch' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::MyUnionFieldPatchStruct>\",\n                \"underlyingName\" => \"MyUnionFieldPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyUnion>($parsed['assign']));\n      $_tmp1 = \\test\\fixtures\\patch\\MyUnion::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->assign = $_tmp1;\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'patchPrior') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyUnionFieldPatch>($parsed['patchPrior']));\n      $_tmp3 = \\test\\fixtures\\patch\\MyUnionFieldPatch::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->patchPrior = $_tmp3;\n    }\n    if (idx($parsed, 'ensure') !== null) {\n      $_tmp4 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyUnion>($parsed['ensure']));\n      $_tmp5 = \\test\\fixtures\\patch\\MyUnion::withDefaultValues();\n      $_tmp5->readFromJson($_tmp4);\n      $this->ensure = $_tmp5;\n    }\n    if (idx($parsed, 'patch') !== null) {\n      $_tmp6 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyUnionFieldPatch>($parsed['patch']));\n      $_tmp7 = \\test\\fixtures\\patch\\MyUnionFieldPatch::withDefaultValues();\n      $_tmp7->readFromJson($_tmp6);\n      $this->patch = $_tmp7;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyUnionFieldPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyUnionFieldPatch'))>>\nclass MyUnionFieldPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'option1',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\StringPatch::class,\n    ),\n    2 => shape(\n      'var' => 'option2',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\I32Patch::class,\n    ),\n    3 => shape(\n      'var' => 'option3',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\InnerUnionPatch::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'option1' => 1,\n    'option2' => 2,\n    'option3' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'option1' => ?\\facebook\\thrift\\op\\StringPatch,\n    ?'option2' => ?\\facebook\\thrift\\op\\I32Patch,\n    ?'option3' => ?\\test\\fixtures\\patch\\InnerUnionPatch,\n  );\n\n  const int STRUCTURAL_ID = 2282223608803987365;\n  /**\n   * Original thrift field:-\n   * 1: patch.StringPatch option1\n   */\n  public ?\\facebook\\thrift\\op\\StringPatch $option1;\n  /**\n   * Original thrift field:-\n   * 2: patch.I32Patch option2\n   */\n  public ?\\facebook\\thrift\\op\\I32Patch $option2;\n  /**\n   * Original thrift field:-\n   * 3: module.InnerUnionPatch option3\n   */\n  public ?\\test\\fixtures\\patch\\InnerUnionPatch $option3;\n\n  public function __construct(?\\facebook\\thrift\\op\\StringPatch $option1 = null, ?\\facebook\\thrift\\op\\I32Patch $option2 = null, ?\\test\\fixtures\\patch\\InnerUnionPatch $option3 = null)[] {\n    $this->option1 = $option1;\n    $this->option2 = $option2;\n    $this->option3 = $option3;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'option1'),\n      Shapes::idx($shape, 'option2'),\n      Shapes::idx($shape, 'option3'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyUnionFieldPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->option1 = null;\n    $this->option2 = null;\n    $this->option3 = null;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyUnionFieldPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.StringPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"option1\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.I32Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"option2\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.InnerUnionPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"option3\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::MyUnionFieldPatchStruct>\",\n            \"underlyingName\" => \"MyUnionFieldPatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'option1' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::StringPatchAdapter<::apache::thrift::op::StringPatchStruct>\",\n                \"underlyingName\" => \"StringPatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'option2' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::I32PatchStruct>\",\n                \"underlyingName\" => \"I32PatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'option3' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::UnionPatchAdapter<::test::fixtures::patch::InnerUnionPatchStruct>\",\n                \"underlyingName\" => \"InnerUnionPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'option1') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\StringPatch>($parsed['option1']));\n      $_tmp1 = \\facebook\\thrift\\op\\StringPatch::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->option1 = $_tmp1;\n    }\n    if (idx($parsed, 'option2') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\I32Patch>($parsed['option2']));\n      $_tmp3 = \\facebook\\thrift\\op\\I32Patch::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->option2 = $_tmp3;\n    }\n    if (idx($parsed, 'option3') !== null) {\n      $_tmp4 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\InnerUnionPatch>($parsed['option3']));\n      $_tmp5 = \\test\\fixtures\\patch\\InnerUnionPatch::withDefaultValues();\n      $_tmp5->readFromJson($_tmp4);\n      $this->option3 = $_tmp5;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStructPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyStructPatch'))>>\nclass MyStructPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyStruct::class,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    3 => shape(\n      'var' => 'patchPrior',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyStructFieldPatch::class,\n    ),\n    5 => shape(\n      'var' => 'ensure',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyStructEnsureStruct::class,\n    ),\n    6 => shape(\n      'var' => 'patch',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyStructFieldPatch::class,\n    ),\n    7 => shape(\n      'var' => 'remove',\n      'is_terse' => true,\n      'type' => \\TType::SET,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'patchPrior' => 3,\n    'ensure' => 5,\n    'patch' => 6,\n    'remove' => 7,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?\\test\\fixtures\\patch\\MyStruct,\n    ?'clear' => ?bool,\n    ?'patchPrior' => ?\\test\\fixtures\\patch\\MyStructFieldPatch,\n    ?'ensure' => ?\\test\\fixtures\\patch\\MyStructEnsureStruct,\n    ?'patch' => ?\\test\\fixtures\\patch\\MyStructFieldPatch,\n    ?'remove' => ?Set<int>,\n  );\n\n  const int STRUCTURAL_ID = 2180737522386571259;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: module.MyStruct assign\n   */\n  public ?\\test\\fixtures\\patch\\MyStruct $assign;\n  /**\n   * Clears a value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Patches any previously set values. Applies second.\n   * \n   * Original thrift field:-\n   * 3: module.MyStructFieldPatch patchPrior\n   */\n  public ?\\test\\fixtures\\patch\\MyStructFieldPatch $patchPrior;\n  /**\n   * Initialize fields, using the given defaults. Applies third.\n   * \n   * Original thrift field:-\n   * 5: module.MyStructEnsureStruct ensure\n   */\n  public ?\\test\\fixtures\\patch\\MyStructEnsureStruct $ensure;\n  /**\n   * Patches any set value, including newly set values. Applies last.\n   * \n   * Original thrift field:-\n   * 6: module.MyStructFieldPatch patch\n   */\n  public ?\\test\\fixtures\\patch\\MyStructFieldPatch $patch;\n  /**\n   * Removes entries, if present. Applies third.\n   * \n   * Original thrift field:-\n   * 7: set<patch.FieldId> remove\n   */\n  public Set<int> $remove;\n\n  public function __construct(?\\test\\fixtures\\patch\\MyStruct $assign = null, ?bool $clear = null, ?\\test\\fixtures\\patch\\MyStructFieldPatch $patchPrior = null, ?\\test\\fixtures\\patch\\MyStructEnsureStruct $ensure = null, ?\\test\\fixtures\\patch\\MyStructFieldPatch $patch = null, ?Set<int> $remove = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->patchPrior = $patchPrior;\n    $this->ensure = $ensure;\n    $this->patch = $patch;\n    $this->remove = $remove ?? Set {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'patchPrior'),\n      Shapes::idx($shape, 'ensure'),\n      Shapes::idx($shape, 'patch'),\n      Shapes::idx($shape, 'remove'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStructPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->patchPrior = null;\n    $this->ensure = null;\n    $this->patch = null;\n    $this->remove = Set {};\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStructPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStructFieldPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patchPrior\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStructEnsureStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ensure\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStructFieldPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patch\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"patch.FieldId\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"id.FieldId\",\n                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"remove\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::MyStructPatchStruct>\",\n            \"underlyingName\" => \"MyStructPatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'assign' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\Testing' => \\facebook\\thrift\\annotation\\Testing::fromShape(\n              shape(\n              )\n            ),\n          ],\n        ),\n        'patchPrior' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::MyStructFieldPatchStruct>\",\n                \"underlyingName\" => \"MyStructFieldPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'ensure' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude' => \\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude::fromShape(\n              shape(\n              )\n            ),\n          ],\n        ),\n        'patch' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::MyStructFieldPatchStruct>\",\n                \"underlyingName\" => \"MyStructFieldPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyStruct>($parsed['assign']));\n      $_tmp1 = \\test\\fixtures\\patch\\MyStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->assign = $_tmp1;\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'patchPrior') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyStructFieldPatch>($parsed['patchPrior']));\n      $_tmp3 = \\test\\fixtures\\patch\\MyStructFieldPatch::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->patchPrior = $_tmp3;\n    }\n    if (idx($parsed, 'ensure') !== null) {\n      $_tmp4 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyStructEnsureStruct>($parsed['ensure']));\n      $_tmp5 = \\test\\fixtures\\patch\\MyStructEnsureStruct::withDefaultValues();\n      $_tmp5->readFromJson($_tmp4);\n      $this->ensure = $_tmp5;\n    }\n    if (idx($parsed, 'patch') !== null) {\n      $_tmp6 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyStructFieldPatch>($parsed['patch']));\n      $_tmp7 = \\test\\fixtures\\patch\\MyStructFieldPatch::withDefaultValues();\n      $_tmp7->readFromJson($_tmp6);\n      $this->patch = $_tmp7;\n    }\n    if (idx($parsed, 'remove') !== null) {\n      $_json11 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['remove']);\n      $_container12 = Set {};\n      foreach($_json11 as $_key9 => $_value10) {\n        $_elem13 = 0;\n        $_tmp14 = (int)$_value10;\n        if ($_tmp14 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem13 = (int)$_tmp14;\n        }\n        $_container12->add($_elem13);\n      }\n      $this->remove = $_container12;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStructField10Patch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyStructField10Patch'))>>\nclass MyStructField10Patch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\patch\\MyEnum::class,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?\\test\\fixtures\\patch\\MyEnum,\n    ?'clear' => ?bool,\n  );\n\n  const int STRUCTURAL_ID = 4425646384421675469;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: module.MyEnum assign\n   */\n  public ?\\test\\fixtures\\patch\\MyEnum $assign;\n  /**\n   * Clears a value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n\n  public function __construct(?\\test\\fixtures\\patch\\MyEnum $assign = null, ?bool $clear = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStructField10Patch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStructField10Patch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::AssignPatchAdapter<::test::fixtures::patch::MyStructField10PatchStruct>\",\n            \"underlyingName\" => \"MyStructField10PatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $this->assign = \\test\\fixtures\\patch\\MyEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyEnum>($parsed['assign']));\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStructField23Patch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyStructField23Patch'))>>\nclass MyStructField23Patch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\patch\\MyEnum::class,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?\\test\\fixtures\\patch\\MyEnum,\n    ?'clear' => ?bool,\n  );\n\n  const int STRUCTURAL_ID = 4425646384421675469;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: module.MyEnum assign\n   */\n  public ?\\test\\fixtures\\patch\\MyEnum $assign;\n  /**\n   * Clears a value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n\n  public function __construct(?\\test\\fixtures\\patch\\MyEnum $assign = null, ?bool $clear = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStructField23Patch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStructField23Patch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::AssignPatchAdapter<::test::fixtures::patch::MyStructField23PatchStruct>\",\n            \"underlyingName\" => \"MyStructField23PatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $this->assign = \\test\\fixtures\\patch\\MyEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyEnum>($parsed['assign']));\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStructField26Patch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyStructField26Patch'))>>\nclass MyStructField26Patch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    8 => shape(\n      'var' => 'prepend',\n      'is_terse' => true,\n      'type' => \\TType::LST,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    9 => shape(\n      'var' => 'append',\n      'is_terse' => true,\n      'type' => \\TType::LST,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'prepend' => 8,\n    'append' => 9,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?Vector<int>,\n    ?'clear' => ?bool,\n    ?'prepend' => ?Vector<int>,\n    ?'append' => ?Vector<int>,\n  );\n\n  const int STRUCTURAL_ID = 2937022562509798365;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: list<i16> assign\n   */\n  public ?Vector<int> $assign;\n  /**\n   * Clears a value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Prepends to the front of a given list.\n   * \n   * Original thrift field:-\n   * 8: list<i16> prepend\n   */\n  public Vector<int> $prepend;\n  /**\n   * Appends to the back of a given list.\n   * \n   * Original thrift field:-\n   * 9: list<i16> append\n   */\n  public Vector<int> $append;\n\n  public function __construct(?Vector<int> $assign = null, ?bool $clear = null, ?Vector<int> $prepend = null, ?Vector<int> $append = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->prepend = $prepend ?? Vector {};\n    $this->append = $append ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'prepend'),\n      Shapes::idx($shape, 'append'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStructField26Patch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->prepend = Vector {};\n    $this->append = Vector {};\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStructField26Patch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"prepend\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"append\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::ListPatchAdapter<::test::fixtures::patch::MyStructField26PatchStruct>\",\n            \"underlyingName\" => \"MyStructField26PatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['assign']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = 0;\n        $_tmp6 = (int)$_value2;\n        if ($_tmp6 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem5 = (int)$_tmp6;\n        }\n        $_container4 []= $_elem5;\n      }\n      $this->assign = $_container4;\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'prepend') !== null) {\n      $_json10 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['prepend']);\n      $_container11 = Vector {};\n      foreach($_json10 as $_key8 => $_value9) {\n        $_elem12 = 0;\n        $_tmp13 = (int)$_value9;\n        if ($_tmp13 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem12 = (int)$_tmp13;\n        }\n        $_container11 []= $_elem12;\n      }\n      $this->prepend = $_container11;\n    }\n    if (idx($parsed, 'append') !== null) {\n      $_json17 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['append']);\n      $_container18 = Vector {};\n      foreach($_json17 as $_key15 => $_value16) {\n        $_elem19 = 0;\n        $_tmp20 = (int)$_value16;\n        if ($_tmp20 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem19 = (int)$_tmp20;\n        }\n        $_container18 []= $_elem19;\n      }\n      $this->append = $_container18;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStructField27Patch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyStructField27Patch'))>>\nclass MyStructField27Patch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    7 => shape(\n      'var' => 'remove',\n      'is_terse' => true,\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    8 => shape(\n      'var' => 'add',\n      'is_terse' => true,\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'remove' => 7,\n    'add' => 8,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?Set<string>,\n    ?'clear' => ?bool,\n    ?'remove' => ?Set<string>,\n    ?'add' => ?Set<string>,\n  );\n\n  const int STRUCTURAL_ID = 6426013098386337881;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: set<string> assign\n   */\n  public ?Set<string> $assign;\n  /**\n   * Clears a value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Removes entries, if present. Applies third.\n   * \n   * Original thrift field:-\n   * 7: set<string> remove\n   */\n  public Set<string> $remove;\n  /**\n   * Adds entries, if not already present. Applies fourth.\n   * \n   * Original thrift field:-\n   * 8: set<string> add\n   */\n  public Set<string> $add;\n\n  public function __construct(?Set<string> $assign = null, ?bool $clear = null, ?Set<string> $remove = null, ?Set<string> $add = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->remove = $remove ?? Set {};\n    $this->add = $add ?? Set {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'remove'),\n      Shapes::idx($shape, 'add'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStructField27Patch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->remove = Set {};\n    $this->add = Set {};\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStructField27Patch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"remove\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"add\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::SetPatchAdapter<::test::fixtures::patch::MyStructField27PatchStruct>\",\n            \"underlyingName\" => \"MyStructField27PatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<string>>($parsed['assign']);\n      $_container4 = Set {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = '';\n        $_elem5 = $_value2;\n        $_container4->add($_elem5);\n      }\n      $this->assign = $_container4;\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'remove') !== null) {\n      $_json9 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<string>>($parsed['remove']);\n      $_container10 = Set {};\n      foreach($_json9 as $_key7 => $_value8) {\n        $_elem11 = '';\n        $_elem11 = $_value8;\n        $_container10->add($_elem11);\n      }\n      $this->remove = $_container10;\n    }\n    if (idx($parsed, 'add') !== null) {\n      $_json15 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<string>>($parsed['add']);\n      $_container16 = Set {};\n      foreach($_json15 as $_key13 => $_value14) {\n        $_elem17 = '';\n        $_elem17 = $_value14;\n        $_container16->add($_elem17);\n      }\n      $this->add = $_container16;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStructField28Patch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyStructField28Patch'))>>\nclass MyStructField28Patch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    3 => shape(\n      'var' => 'patchPrior',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\facebook\\thrift\\op\\StringPatch::class,\n      ),\n      'format' => 'collection',\n    ),\n    5 => shape(\n      'var' => 'add',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    6 => shape(\n      'var' => 'patch',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\facebook\\thrift\\op\\StringPatch::class,\n      ),\n      'format' => 'collection',\n    ),\n    7 => shape(\n      'var' => 'remove',\n      'is_terse' => true,\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    9 => shape(\n      'var' => 'put',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'patchPrior' => 3,\n    'add' => 5,\n    'patch' => 6,\n    'remove' => 7,\n    'put' => 9,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?Map<string, string>,\n    ?'clear' => ?bool,\n    ?'patchPrior' => ?Map<string, \\facebook\\thrift\\op\\StringPatch>,\n    ?'add' => ?Map<string, string>,\n    ?'patch' => ?Map<string, \\facebook\\thrift\\op\\StringPatch>,\n    ?'remove' => ?Set<string>,\n    ?'put' => ?Map<string, string>,\n  );\n\n  const int STRUCTURAL_ID = 1721371192977592724;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: map<string, string> assign\n   */\n  public ?Map<string, string> $assign;\n  /**\n   * Clears a value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Patches any previously set values. Applies second.\n   * \n   * Original thrift field:-\n   * 3: map<string, patch.StringPatch> patchPrior\n   */\n  public Map<string, \\facebook\\thrift\\op\\StringPatch> $patchPrior;\n  /**\n   * Add the given values, if the keys are not already present. Applies forth.\n   * \n   * Original thrift field:-\n   * 5: map<string, string> add\n   */\n  public Map<string, string> $add;\n  /**\n   * Patches any set value, including newly set values. Applies last.\n   * \n   * Original thrift field:-\n   * 6: map<string, patch.StringPatch> patch\n   */\n  public Map<string, \\facebook\\thrift\\op\\StringPatch> $patch;\n  /**\n   * Removes entries, if present. Applies third.\n   * \n   * Original thrift field:-\n   * 7: set<string> remove\n   */\n  public Set<string> $remove;\n  /**\n   * Adds or replaces the given key/value pairs. Applies fifth.\n   * \n   * Original thrift field:-\n   * 9: map<string, string> put\n   */\n  public Map<string, string> $put;\n\n  public function __construct(?Map<string, string> $assign = null, ?bool $clear = null, ?Map<string, \\facebook\\thrift\\op\\StringPatch> $patchPrior = null, ?Map<string, string> $add = null, ?Map<string, \\facebook\\thrift\\op\\StringPatch> $patch = null, ?Set<string> $remove = null, ?Map<string, string> $put = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->patchPrior = $patchPrior ?? Map {};\n    $this->add = $add ?? Map {};\n    $this->patch = $patch ?? Map {};\n    $this->remove = $remove ?? Set {};\n    $this->put = $put ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'patchPrior'),\n      Shapes::idx($shape, 'add'),\n      Shapes::idx($shape, 'patch'),\n      Shapes::idx($shape, 'remove'),\n      Shapes::idx($shape, 'put'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStructField28Patch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->patchPrior = Map {};\n    $this->add = Map {};\n    $this->patch = Map {};\n    $this->remove = Set {};\n    $this->put = Map {};\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStructField28Patch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"patch.StringPatch\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patchPrior\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"add\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"patch.StringPatch\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patch\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"remove\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"put\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::MapPatchAdapter<::test::fixtures::patch::MyStructField28PatchStruct>\",\n            \"underlyingName\" => \"MyStructField28PatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, string>>($parsed['assign']);\n      $_container4 = Map {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_value5 = '';\n        $_value5 = $_value2;\n        $_container4[$_key1] = $_value5;\n      }\n      $this->assign = $_container4;\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'patchPrior') !== null) {\n      $_json9 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, \\facebook\\thrift\\op\\StringPatch>>($parsed['patchPrior']);\n      $_container10 = Map {};\n      foreach($_json9 as $_key7 => $_value8) {\n        $_value11 = \\facebook\\thrift\\op\\StringPatch::withDefaultValues();\n        $_tmp12 = \\json_encode($_value8);\n        $_tmp13 = \\facebook\\thrift\\op\\StringPatch::withDefaultValues();\n        $_tmp13->readFromJson($_tmp12);\n        $_value11 = $_tmp13;\n        $_container10[$_key7] = $_value11;\n      }\n      $this->patchPrior = $_container10;\n    }\n    if (idx($parsed, 'add') !== null) {\n      $_json17 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, string>>($parsed['add']);\n      $_container18 = Map {};\n      foreach($_json17 as $_key15 => $_value16) {\n        $_value19 = '';\n        $_value19 = $_value16;\n        $_container18[$_key15] = $_value19;\n      }\n      $this->add = $_container18;\n    }\n    if (idx($parsed, 'patch') !== null) {\n      $_json23 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, \\facebook\\thrift\\op\\StringPatch>>($parsed['patch']);\n      $_container24 = Map {};\n      foreach($_json23 as $_key21 => $_value22) {\n        $_value25 = \\facebook\\thrift\\op\\StringPatch::withDefaultValues();\n        $_tmp26 = \\json_encode($_value22);\n        $_tmp27 = \\facebook\\thrift\\op\\StringPatch::withDefaultValues();\n        $_tmp27->readFromJson($_tmp26);\n        $_value25 = $_tmp27;\n        $_container24[$_key21] = $_value25;\n      }\n      $this->patch = $_container24;\n    }\n    if (idx($parsed, 'remove') !== null) {\n      $_json31 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<string>>($parsed['remove']);\n      $_container32 = Set {};\n      foreach($_json31 as $_key29 => $_value30) {\n        $_elem33 = '';\n        $_elem33 = $_value30;\n        $_container32->add($_elem33);\n      }\n      $this->remove = $_container32;\n    }\n    if (idx($parsed, 'put') !== null) {\n      $_json37 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, string>>($parsed['put']);\n      $_container38 = Map {};\n      foreach($_json37 as $_key35 => $_value36) {\n        $_value39 = '';\n        $_value39 = $_value36;\n        $_container38[$_key35] = $_value39;\n      }\n      $this->put = $_container38;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStructField29Patch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyStructField29Patch'))>>\nclass MyStructField29Patch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    8 => shape(\n      'var' => 'prepend',\n      'is_terse' => true,\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    9 => shape(\n      'var' => 'append',\n      'is_terse' => true,\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'prepend' => 8,\n    'append' => 9,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?Vector<Map<string, int>>,\n    ?'clear' => ?bool,\n    ?'prepend' => ?Vector<Map<string, int>>,\n    ?'append' => ?Vector<Map<string, int>>,\n  );\n\n  const int STRUCTURAL_ID = 2937022562509798365;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: list<map<string, i32>> assign\n   */\n  public ?Vector<Map<string, int>> $assign;\n  /**\n   * Clears a value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Prepends to the front of a given list.\n   * \n   * Original thrift field:-\n   * 8: list<map<string, i32>> prepend\n   */\n  public Vector<Map<string, int>> $prepend;\n  /**\n   * Appends to the back of a given list.\n   * \n   * Original thrift field:-\n   * 9: list<map<string, i32>> append\n   */\n  public Vector<Map<string, int>> $append;\n\n  public function __construct(?Vector<Map<string, int>> $assign = null, ?bool $clear = null, ?Vector<Map<string, int>> $prepend = null, ?Vector<Map<string, int>> $append = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->prepend = $prepend ?? Vector {};\n    $this->append = $append ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'prepend'),\n      Shapes::idx($shape, 'append'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStructField29Patch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->prepend = Vector {};\n    $this->append = Vector {};\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStructField29Patch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"prepend\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"append\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::ListPatchAdapter<::test::fixtures::patch::MyStructField29PatchStruct>\",\n            \"underlyingName\" => \"MyStructField29PatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<Map<string, int>>>($parsed['assign']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = Map {};\n        $_json9 = $_value2;\n        $_container10 = Map {};\n        foreach($_json9 as $_key7 => $_value8) {\n          $_value11 = 0;\n          $_tmp12 = (int)$_value8;\n          if ($_tmp12 > 0x7fffffff) {\n            throw new \\TProtocolException(\"number exceeds limit in field\");\n          } else {\n            $_value11 = (int)$_tmp12;\n          }\n          $_container10[$_key7] = $_value11;\n        }\n        $_elem5 = $_container10;\n        $_container4 []= $_elem5;\n      }\n      $this->assign = $_container4;\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'prepend') !== null) {\n      $_json16 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<Map<string, int>>>($parsed['prepend']);\n      $_container17 = Vector {};\n      foreach($_json16 as $_key14 => $_value15) {\n        $_elem18 = Map {};\n        $_json22 = $_value15;\n        $_container23 = Map {};\n        foreach($_json22 as $_key20 => $_value21) {\n          $_value24 = 0;\n          $_tmp25 = (int)$_value21;\n          if ($_tmp25 > 0x7fffffff) {\n            throw new \\TProtocolException(\"number exceeds limit in field\");\n          } else {\n            $_value24 = (int)$_tmp25;\n          }\n          $_container23[$_key20] = $_value24;\n        }\n        $_elem18 = $_container23;\n        $_container17 []= $_elem18;\n      }\n      $this->prepend = $_container17;\n    }\n    if (idx($parsed, 'append') !== null) {\n      $_json29 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<Map<string, int>>>($parsed['append']);\n      $_container30 = Vector {};\n      foreach($_json29 as $_key27 => $_value28) {\n        $_elem31 = Map {};\n        $_json35 = $_value28;\n        $_container36 = Map {};\n        foreach($_json35 as $_key33 => $_value34) {\n          $_value37 = 0;\n          $_tmp38 = (int)$_value34;\n          if ($_tmp38 > 0x7fffffff) {\n            throw new \\TProtocolException(\"number exceeds limit in field\");\n          } else {\n            $_value37 = (int)$_tmp38;\n          }\n          $_container36[$_key33] = $_value37;\n        }\n        $_elem31 = $_container36;\n        $_container30 []= $_elem31;\n      }\n      $this->append = $_container30;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStructField30Patch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyStructField30Patch'))>>\nclass MyStructField30Patch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    3 => shape(\n      'var' => 'patchPrior',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\test\\fixtures\\patch\\MyStructField30Patch1::class,\n      ),\n      'format' => 'collection',\n    ),\n    5 => shape(\n      'var' => 'add',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    6 => shape(\n      'var' => 'patch',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\test\\fixtures\\patch\\MyStructField30Patch1::class,\n      ),\n      'format' => 'collection',\n    ),\n    7 => shape(\n      'var' => 'remove',\n      'is_terse' => true,\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    9 => shape(\n      'var' => 'put',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'patchPrior' => 3,\n    'add' => 5,\n    'patch' => 6,\n    'remove' => 7,\n    'put' => 9,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?Map<string, Map<string, int>>,\n    ?'clear' => ?bool,\n    ?'patchPrior' => ?Map<string, \\test\\fixtures\\patch\\MyStructField30Patch1>,\n    ?'add' => ?Map<string, Map<string, int>>,\n    ?'patch' => ?Map<string, \\test\\fixtures\\patch\\MyStructField30Patch1>,\n    ?'remove' => ?Set<string>,\n    ?'put' => ?Map<string, Map<string, int>>,\n  );\n\n  const int STRUCTURAL_ID = 1721371192977592724;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: map<string, map<string, i32>> assign\n   */\n  public ?Map<string, Map<string, int>> $assign;\n  /**\n   * Clears a value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Patches any previously set values. Applies second.\n   * \n   * Original thrift field:-\n   * 3: map<string, module.MyStructField30Patch1> patchPrior\n   */\n  public Map<string, \\test\\fixtures\\patch\\MyStructField30Patch1> $patchPrior;\n  /**\n   * Add the given values, if the keys are not already present. Applies forth.\n   * \n   * Original thrift field:-\n   * 5: map<string, map<string, i32>> add\n   */\n  public Map<string, Map<string, int>> $add;\n  /**\n   * Patches any set value, including newly set values. Applies last.\n   * \n   * Original thrift field:-\n   * 6: map<string, module.MyStructField30Patch1> patch\n   */\n  public Map<string, \\test\\fixtures\\patch\\MyStructField30Patch1> $patch;\n  /**\n   * Removes entries, if present. Applies third.\n   * \n   * Original thrift field:-\n   * 7: set<string> remove\n   */\n  public Set<string> $remove;\n  /**\n   * Adds or replaces the given key/value pairs. Applies fifth.\n   * \n   * Original thrift field:-\n   * 9: map<string, map<string, i32>> put\n   */\n  public Map<string, Map<string, int>> $put;\n\n  public function __construct(?Map<string, Map<string, int>> $assign = null, ?bool $clear = null, ?Map<string, \\test\\fixtures\\patch\\MyStructField30Patch1> $patchPrior = null, ?Map<string, Map<string, int>> $add = null, ?Map<string, \\test\\fixtures\\patch\\MyStructField30Patch1> $patch = null, ?Set<string> $remove = null, ?Map<string, Map<string, int>> $put = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->patchPrior = $patchPrior ?? Map {};\n    $this->add = $add ?? Map {};\n    $this->patch = $patch ?? Map {};\n    $this->remove = $remove ?? Set {};\n    $this->put = $put ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'patchPrior'),\n      Shapes::idx($shape, 'add'),\n      Shapes::idx($shape, 'patch'),\n      Shapes::idx($shape, 'remove'),\n      Shapes::idx($shape, 'put'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStructField30Patch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->patchPrior = Map {};\n    $this->add = Map {};\n    $this->patch = Map {};\n    $this->remove = Set {};\n    $this->put = Map {};\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStructField30Patch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.MyStructField30Patch1\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patchPrior\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"add\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.MyStructField30Patch1\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patch\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"remove\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"put\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::MapPatchAdapter<::test::fixtures::patch::MyStructField30PatchStruct>\",\n            \"underlyingName\" => \"MyStructField30PatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, Map<string, int>>>($parsed['assign']);\n      $_container4 = Map {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_value5 = Map {};\n        $_json9 = $_value2;\n        $_container10 = Map {};\n        foreach($_json9 as $_key7 => $_value8) {\n          $_value11 = 0;\n          $_tmp12 = (int)$_value8;\n          if ($_tmp12 > 0x7fffffff) {\n            throw new \\TProtocolException(\"number exceeds limit in field\");\n          } else {\n            $_value11 = (int)$_tmp12;\n          }\n          $_container10[$_key7] = $_value11;\n        }\n        $_value5 = $_container10;\n        $_container4[$_key1] = $_value5;\n      }\n      $this->assign = $_container4;\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'patchPrior') !== null) {\n      $_json16 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, \\test\\fixtures\\patch\\MyStructField30Patch1>>($parsed['patchPrior']);\n      $_container17 = Map {};\n      foreach($_json16 as $_key14 => $_value15) {\n        $_value18 = \\test\\fixtures\\patch\\MyStructField30Patch1::withDefaultValues();\n        $_tmp19 = \\json_encode($_value15);\n        $_tmp20 = \\test\\fixtures\\patch\\MyStructField30Patch1::withDefaultValues();\n        $_tmp20->readFromJson($_tmp19);\n        $_value18 = $_tmp20;\n        $_container17[$_key14] = $_value18;\n      }\n      $this->patchPrior = $_container17;\n    }\n    if (idx($parsed, 'add') !== null) {\n      $_json24 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, Map<string, int>>>($parsed['add']);\n      $_container25 = Map {};\n      foreach($_json24 as $_key22 => $_value23) {\n        $_value26 = Map {};\n        $_json30 = $_value23;\n        $_container31 = Map {};\n        foreach($_json30 as $_key28 => $_value29) {\n          $_value32 = 0;\n          $_tmp33 = (int)$_value29;\n          if ($_tmp33 > 0x7fffffff) {\n            throw new \\TProtocolException(\"number exceeds limit in field\");\n          } else {\n            $_value32 = (int)$_tmp33;\n          }\n          $_container31[$_key28] = $_value32;\n        }\n        $_value26 = $_container31;\n        $_container25[$_key22] = $_value26;\n      }\n      $this->add = $_container25;\n    }\n    if (idx($parsed, 'patch') !== null) {\n      $_json37 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, \\test\\fixtures\\patch\\MyStructField30Patch1>>($parsed['patch']);\n      $_container38 = Map {};\n      foreach($_json37 as $_key35 => $_value36) {\n        $_value39 = \\test\\fixtures\\patch\\MyStructField30Patch1::withDefaultValues();\n        $_tmp40 = \\json_encode($_value36);\n        $_tmp41 = \\test\\fixtures\\patch\\MyStructField30Patch1::withDefaultValues();\n        $_tmp41->readFromJson($_tmp40);\n        $_value39 = $_tmp41;\n        $_container38[$_key35] = $_value39;\n      }\n      $this->patch = $_container38;\n    }\n    if (idx($parsed, 'remove') !== null) {\n      $_json45 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<string>>($parsed['remove']);\n      $_container46 = Set {};\n      foreach($_json45 as $_key43 => $_value44) {\n        $_elem47 = '';\n        $_elem47 = $_value44;\n        $_container46->add($_elem47);\n      }\n      $this->remove = $_container46;\n    }\n    if (idx($parsed, 'put') !== null) {\n      $_json51 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, Map<string, int>>>($parsed['put']);\n      $_container52 = Map {};\n      foreach($_json51 as $_key49 => $_value50) {\n        $_value53 = Map {};\n        $_json57 = $_value50;\n        $_container58 = Map {};\n        foreach($_json57 as $_key55 => $_value56) {\n          $_value59 = 0;\n          $_tmp60 = (int)$_value56;\n          if ($_tmp60 > 0x7fffffff) {\n            throw new \\TProtocolException(\"number exceeds limit in field\");\n          } else {\n            $_value59 = (int)$_tmp60;\n          }\n          $_container58[$_key55] = $_value59;\n        }\n        $_value53 = $_container58;\n        $_container52[$_key49] = $_value53;\n      }\n      $this->put = $_container52;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStructField30Patch1\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyStructField30Patch1'))>>\nclass MyStructField30Patch1 implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    3 => shape(\n      'var' => 'patchPrior',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\facebook\\thrift\\op\\I32Patch::class,\n      ),\n      'format' => 'collection',\n    ),\n    5 => shape(\n      'var' => 'add',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    6 => shape(\n      'var' => 'patch',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\facebook\\thrift\\op\\I32Patch::class,\n      ),\n      'format' => 'collection',\n    ),\n    7 => shape(\n      'var' => 'remove',\n      'is_terse' => true,\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    9 => shape(\n      'var' => 'put',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'patchPrior' => 3,\n    'add' => 5,\n    'patch' => 6,\n    'remove' => 7,\n    'put' => 9,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?Map<string, int>,\n    ?'clear' => ?bool,\n    ?'patchPrior' => ?Map<string, \\facebook\\thrift\\op\\I32Patch>,\n    ?'add' => ?Map<string, int>,\n    ?'patch' => ?Map<string, \\facebook\\thrift\\op\\I32Patch>,\n    ?'remove' => ?Set<string>,\n    ?'put' => ?Map<string, int>,\n  );\n\n  const int STRUCTURAL_ID = 1721371192977592724;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: map<string, i32> assign\n   */\n  public ?Map<string, int> $assign;\n  /**\n   * Clears a value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Patches any previously set values. Applies second.\n   * \n   * Original thrift field:-\n   * 3: map<string, patch.I32Patch> patchPrior\n   */\n  public Map<string, \\facebook\\thrift\\op\\I32Patch> $patchPrior;\n  /**\n   * Add the given values, if the keys are not already present. Applies forth.\n   * \n   * Original thrift field:-\n   * 5: map<string, i32> add\n   */\n  public Map<string, int> $add;\n  /**\n   * Patches any set value, including newly set values. Applies last.\n   * \n   * Original thrift field:-\n   * 6: map<string, patch.I32Patch> patch\n   */\n  public Map<string, \\facebook\\thrift\\op\\I32Patch> $patch;\n  /**\n   * Removes entries, if present. Applies third.\n   * \n   * Original thrift field:-\n   * 7: set<string> remove\n   */\n  public Set<string> $remove;\n  /**\n   * Adds or replaces the given key/value pairs. Applies fifth.\n   * \n   * Original thrift field:-\n   * 9: map<string, i32> put\n   */\n  public Map<string, int> $put;\n\n  public function __construct(?Map<string, int> $assign = null, ?bool $clear = null, ?Map<string, \\facebook\\thrift\\op\\I32Patch> $patchPrior = null, ?Map<string, int> $add = null, ?Map<string, \\facebook\\thrift\\op\\I32Patch> $patch = null, ?Set<string> $remove = null, ?Map<string, int> $put = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->patchPrior = $patchPrior ?? Map {};\n    $this->add = $add ?? Map {};\n    $this->patch = $patch ?? Map {};\n    $this->remove = $remove ?? Set {};\n    $this->put = $put ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'patchPrior'),\n      Shapes::idx($shape, 'add'),\n      Shapes::idx($shape, 'patch'),\n      Shapes::idx($shape, 'remove'),\n      Shapes::idx($shape, 'put'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStructField30Patch1';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->patchPrior = Map {};\n    $this->add = Map {};\n    $this->patch = Map {};\n    $this->remove = Set {};\n    $this->put = Map {};\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStructField30Patch1\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"patch.I32Patch\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patchPrior\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"add\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"patch.I32Patch\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patch\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"remove\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"put\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::MapPatchAdapter<::test::fixtures::patch::MyStructField30Patch1Struct>\",\n            \"underlyingName\" => \"MyStructField30Patch1Struct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, int>>($parsed['assign']);\n      $_container4 = Map {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_value5 = 0;\n        $_tmp6 = (int)$_value2;\n        if ($_tmp6 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value5 = (int)$_tmp6;\n        }\n        $_container4[$_key1] = $_value5;\n      }\n      $this->assign = $_container4;\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'patchPrior') !== null) {\n      $_json10 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, \\facebook\\thrift\\op\\I32Patch>>($parsed['patchPrior']);\n      $_container11 = Map {};\n      foreach($_json10 as $_key8 => $_value9) {\n        $_value12 = \\facebook\\thrift\\op\\I32Patch::withDefaultValues();\n        $_tmp13 = \\json_encode($_value9);\n        $_tmp14 = \\facebook\\thrift\\op\\I32Patch::withDefaultValues();\n        $_tmp14->readFromJson($_tmp13);\n        $_value12 = $_tmp14;\n        $_container11[$_key8] = $_value12;\n      }\n      $this->patchPrior = $_container11;\n    }\n    if (idx($parsed, 'add') !== null) {\n      $_json18 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, int>>($parsed['add']);\n      $_container19 = Map {};\n      foreach($_json18 as $_key16 => $_value17) {\n        $_value20 = 0;\n        $_tmp21 = (int)$_value17;\n        if ($_tmp21 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value20 = (int)$_tmp21;\n        }\n        $_container19[$_key16] = $_value20;\n      }\n      $this->add = $_container19;\n    }\n    if (idx($parsed, 'patch') !== null) {\n      $_json25 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, \\facebook\\thrift\\op\\I32Patch>>($parsed['patch']);\n      $_container26 = Map {};\n      foreach($_json25 as $_key23 => $_value24) {\n        $_value27 = \\facebook\\thrift\\op\\I32Patch::withDefaultValues();\n        $_tmp28 = \\json_encode($_value24);\n        $_tmp29 = \\facebook\\thrift\\op\\I32Patch::withDefaultValues();\n        $_tmp29->readFromJson($_tmp28);\n        $_value27 = $_tmp29;\n        $_container26[$_key23] = $_value27;\n      }\n      $this->patch = $_container26;\n    }\n    if (idx($parsed, 'remove') !== null) {\n      $_json33 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<string>>($parsed['remove']);\n      $_container34 = Set {};\n      foreach($_json33 as $_key31 => $_value32) {\n        $_elem35 = '';\n        $_elem35 = $_value32;\n        $_container34->add($_elem35);\n      }\n      $this->remove = $_container34;\n    }\n    if (idx($parsed, 'put') !== null) {\n      $_json39 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, int>>($parsed['put']);\n      $_container40 = Map {};\n      foreach($_json39 as $_key37 => $_value38) {\n        $_value41 = 0;\n        $_tmp42 = (int)$_value38;\n        if ($_tmp42 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value41 = (int)$_tmp42;\n        }\n        $_container40[$_key37] = $_value41;\n      }\n      $this->put = $_container40;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStructFieldPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyStructFieldPatch'))>>\nclass MyStructFieldPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    -32 => shape(\n      'var' => 'structWithCustomDefault',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyDataWithCustomDefaultPatch::class,\n    ),\n    -31 => shape(\n      'var' => 'i32WithCustomDefault',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\I32Patch::class,\n    ),\n    -30 => shape(\n      'var' => 'mapMap',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyStructField30Patch::class,\n    ),\n    -29 => shape(\n      'var' => 'listMap',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyStructField29Patch::class,\n    ),\n    -28 => shape(\n      'var' => 'optMapVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyStructField28Patch::class,\n    ),\n    -27 => shape(\n      'var' => 'optSetVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyStructField27Patch::class,\n    ),\n    -26 => shape(\n      'var' => 'optListVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyStructField26Patch::class,\n    ),\n    -25 => shape(\n      'var' => 'optLateStructVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\LateDefStructPatch::class,\n    ),\n    -24 => shape(\n      'var' => 'optStructVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyDataPatch::class,\n    ),\n    -23 => shape(\n      'var' => 'optEnumVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyStructField23Patch::class,\n    ),\n    -22 => shape(\n      'var' => 'optBinaryVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\BinaryPatch::class,\n    ),\n    -21 => shape(\n      'var' => 'optStringVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\StringPatch::class,\n    ),\n    -20 => shape(\n      'var' => 'optDoubleVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\DoublePatch::class,\n    ),\n    -19 => shape(\n      'var' => 'optFloatVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\FloatPatch::class,\n    ),\n    -18 => shape(\n      'var' => 'optI64Val',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\I64Patch::class,\n    ),\n    -17 => shape(\n      'var' => 'optI32Val',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\I32Patch::class,\n    ),\n    -16 => shape(\n      'var' => 'optI16Val',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\I16Patch::class,\n    ),\n    -15 => shape(\n      'var' => 'optByteVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\BytePatch::class,\n    ),\n    -14 => shape(\n      'var' => 'optBoolVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\BoolPatch::class,\n    ),\n    -13 => shape(\n      'var' => 'lateStructVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\LateDefStructPatch::class,\n    ),\n    -12 => shape(\n      'var' => 'unionVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyUnionPatch::class,\n    ),\n    -11 => shape(\n      'var' => 'structVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyDataPatch::class,\n    ),\n    -10 => shape(\n      'var' => 'enumVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyStructField10Patch::class,\n    ),\n    -9 => shape(\n      'var' => 'binaryVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\BinaryPatch::class,\n    ),\n    -8 => shape(\n      'var' => 'stringVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\StringPatch::class,\n    ),\n    -7 => shape(\n      'var' => 'doubleVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\DoublePatch::class,\n    ),\n    -6 => shape(\n      'var' => 'floatVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\FloatPatch::class,\n    ),\n    -5 => shape(\n      'var' => 'i64Val',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\I64Patch::class,\n    ),\n    -4 => shape(\n      'var' => 'i32Val',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\I32Patch::class,\n    ),\n    -3 => shape(\n      'var' => 'i16Val',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\I16Patch::class,\n    ),\n    -2 => shape(\n      'var' => 'byteVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\BytePatch::class,\n    ),\n    -1 => shape(\n      'var' => 'boolVal',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\op\\BoolPatch::class,\n    ),\n    1 => shape(\n      'var' => 'structWithFieldCustomDefault',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyDataPatch::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'structWithCustomDefault' => -32,\n    'i32WithCustomDefault' => -31,\n    'mapMap' => -30,\n    'listMap' => -29,\n    'optMapVal' => -28,\n    'optSetVal' => -27,\n    'optListVal' => -26,\n    'optLateStructVal' => -25,\n    'optStructVal' => -24,\n    'optEnumVal' => -23,\n    'optBinaryVal' => -22,\n    'optStringVal' => -21,\n    'optDoubleVal' => -20,\n    'optFloatVal' => -19,\n    'optI64Val' => -18,\n    'optI32Val' => -17,\n    'optI16Val' => -16,\n    'optByteVal' => -15,\n    'optBoolVal' => -14,\n    'lateStructVal' => -13,\n    'unionVal' => -12,\n    'structVal' => -11,\n    'enumVal' => -10,\n    'binaryVal' => -9,\n    'stringVal' => -8,\n    'doubleVal' => -7,\n    'floatVal' => -6,\n    'i64Val' => -5,\n    'i32Val' => -4,\n    'i16Val' => -3,\n    'byteVal' => -2,\n    'boolVal' => -1,\n    'structWithFieldCustomDefault' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'structWithCustomDefault' => ?\\test\\fixtures\\patch\\MyDataWithCustomDefaultPatch,\n    ?'i32WithCustomDefault' => ?\\facebook\\thrift\\op\\I32Patch,\n    ?'mapMap' => ?\\test\\fixtures\\patch\\MyStructField30Patch,\n    ?'listMap' => ?\\test\\fixtures\\patch\\MyStructField29Patch,\n    ?'optMapVal' => ?\\test\\fixtures\\patch\\MyStructField28Patch,\n    ?'optSetVal' => ?\\test\\fixtures\\patch\\MyStructField27Patch,\n    ?'optListVal' => ?\\test\\fixtures\\patch\\MyStructField26Patch,\n    ?'optLateStructVal' => ?\\test\\fixtures\\patch\\LateDefStructPatch,\n    ?'optStructVal' => ?\\test\\fixtures\\patch\\MyDataPatch,\n    ?'optEnumVal' => ?\\test\\fixtures\\patch\\MyStructField23Patch,\n    ?'optBinaryVal' => ?\\facebook\\thrift\\op\\BinaryPatch,\n    ?'optStringVal' => ?\\facebook\\thrift\\op\\StringPatch,\n    ?'optDoubleVal' => ?\\facebook\\thrift\\op\\DoublePatch,\n    ?'optFloatVal' => ?\\facebook\\thrift\\op\\FloatPatch,\n    ?'optI64Val' => ?\\facebook\\thrift\\op\\I64Patch,\n    ?'optI32Val' => ?\\facebook\\thrift\\op\\I32Patch,\n    ?'optI16Val' => ?\\facebook\\thrift\\op\\I16Patch,\n    ?'optByteVal' => ?\\facebook\\thrift\\op\\BytePatch,\n    ?'optBoolVal' => ?\\facebook\\thrift\\op\\BoolPatch,\n    ?'lateStructVal' => ?\\test\\fixtures\\patch\\LateDefStructPatch,\n    ?'unionVal' => ?\\test\\fixtures\\patch\\MyUnionPatch,\n    ?'structVal' => ?\\test\\fixtures\\patch\\MyDataPatch,\n    ?'enumVal' => ?\\test\\fixtures\\patch\\MyStructField10Patch,\n    ?'binaryVal' => ?\\facebook\\thrift\\op\\BinaryPatch,\n    ?'stringVal' => ?\\facebook\\thrift\\op\\StringPatch,\n    ?'doubleVal' => ?\\facebook\\thrift\\op\\DoublePatch,\n    ?'floatVal' => ?\\facebook\\thrift\\op\\FloatPatch,\n    ?'i64Val' => ?\\facebook\\thrift\\op\\I64Patch,\n    ?'i32Val' => ?\\facebook\\thrift\\op\\I32Patch,\n    ?'i16Val' => ?\\facebook\\thrift\\op\\I16Patch,\n    ?'byteVal' => ?\\facebook\\thrift\\op\\BytePatch,\n    ?'boolVal' => ?\\facebook\\thrift\\op\\BoolPatch,\n    ?'structWithFieldCustomDefault' => ?\\test\\fixtures\\patch\\MyDataPatch,\n  );\n\n  const int STRUCTURAL_ID = 2177152892435994657;\n  /**\n   * Original thrift field:-\n   * -32: module.MyDataWithCustomDefaultPatch structWithCustomDefault\n   */\n  public ?\\test\\fixtures\\patch\\MyDataWithCustomDefaultPatch $structWithCustomDefault;\n  /**\n   * Original thrift field:-\n   * -31: patch.I32Patch i32WithCustomDefault\n   */\n  public ?\\facebook\\thrift\\op\\I32Patch $i32WithCustomDefault;\n  /**\n   * Original thrift field:-\n   * -30: module.MyStructField30Patch mapMap\n   */\n  public ?\\test\\fixtures\\patch\\MyStructField30Patch $mapMap;\n  /**\n   * Original thrift field:-\n   * -29: module.MyStructField29Patch listMap\n   */\n  public ?\\test\\fixtures\\patch\\MyStructField29Patch $listMap;\n  /**\n   * Original thrift field:-\n   * -28: module.MyStructField28Patch optMapVal\n   */\n  public ?\\test\\fixtures\\patch\\MyStructField28Patch $optMapVal;\n  /**\n   * Original thrift field:-\n   * -27: module.MyStructField27Patch optSetVal\n   */\n  public ?\\test\\fixtures\\patch\\MyStructField27Patch $optSetVal;\n  /**\n   * Original thrift field:-\n   * -26: module.MyStructField26Patch optListVal\n   */\n  public ?\\test\\fixtures\\patch\\MyStructField26Patch $optListVal;\n  /**\n   * Original thrift field:-\n   * -25: module.LateDefStructPatch optLateStructVal\n   */\n  public ?\\test\\fixtures\\patch\\LateDefStructPatch $optLateStructVal;\n  /**\n   * Original thrift field:-\n   * -24: module.MyDataPatch optStructVal\n   */\n  public ?\\test\\fixtures\\patch\\MyDataPatch $optStructVal;\n  /**\n   * Original thrift field:-\n   * -23: module.MyStructField23Patch optEnumVal\n   */\n  public ?\\test\\fixtures\\patch\\MyStructField23Patch $optEnumVal;\n  /**\n   * Original thrift field:-\n   * -22: patch.BinaryPatch optBinaryVal\n   */\n  public ?\\facebook\\thrift\\op\\BinaryPatch $optBinaryVal;\n  /**\n   * Original thrift field:-\n   * -21: patch.StringPatch optStringVal\n   */\n  public ?\\facebook\\thrift\\op\\StringPatch $optStringVal;\n  /**\n   * Original thrift field:-\n   * -20: patch.DoublePatch optDoubleVal\n   */\n  public ?\\facebook\\thrift\\op\\DoublePatch $optDoubleVal;\n  /**\n   * Original thrift field:-\n   * -19: patch.FloatPatch optFloatVal\n   */\n  public ?\\facebook\\thrift\\op\\FloatPatch $optFloatVal;\n  /**\n   * Original thrift field:-\n   * -18: patch.I64Patch optI64Val\n   */\n  public ?\\facebook\\thrift\\op\\I64Patch $optI64Val;\n  /**\n   * Original thrift field:-\n   * -17: patch.I32Patch optI32Val\n   */\n  public ?\\facebook\\thrift\\op\\I32Patch $optI32Val;\n  /**\n   * Original thrift field:-\n   * -16: patch.I16Patch optI16Val\n   */\n  public ?\\facebook\\thrift\\op\\I16Patch $optI16Val;\n  /**\n   * Original thrift field:-\n   * -15: patch.BytePatch optByteVal\n   */\n  public ?\\facebook\\thrift\\op\\BytePatch $optByteVal;\n  /**\n   * Original thrift field:-\n   * -14: patch.BoolPatch optBoolVal\n   */\n  public ?\\facebook\\thrift\\op\\BoolPatch $optBoolVal;\n  /**\n   * Original thrift field:-\n   * -13: module.LateDefStructPatch lateStructVal\n   */\n  public ?\\test\\fixtures\\patch\\LateDefStructPatch $lateStructVal;\n  /**\n   * Original thrift field:-\n   * -12: module.MyUnionPatch unionVal\n   */\n  public ?\\test\\fixtures\\patch\\MyUnionPatch $unionVal;\n  /**\n   * Original thrift field:-\n   * -11: module.MyDataPatch structVal\n   */\n  public ?\\test\\fixtures\\patch\\MyDataPatch $structVal;\n  /**\n   * Original thrift field:-\n   * -10: module.MyStructField10Patch enumVal\n   */\n  public ?\\test\\fixtures\\patch\\MyStructField10Patch $enumVal;\n  /**\n   * Original thrift field:-\n   * -9: patch.BinaryPatch binaryVal\n   */\n  public ?\\facebook\\thrift\\op\\BinaryPatch $binaryVal;\n  /**\n   * Original thrift field:-\n   * -8: patch.StringPatch stringVal\n   */\n  public ?\\facebook\\thrift\\op\\StringPatch $stringVal;\n  /**\n   * Original thrift field:-\n   * -7: patch.DoublePatch doubleVal\n   */\n  public ?\\facebook\\thrift\\op\\DoublePatch $doubleVal;\n  /**\n   * Original thrift field:-\n   * -6: patch.FloatPatch floatVal\n   */\n  public ?\\facebook\\thrift\\op\\FloatPatch $floatVal;\n  /**\n   * Original thrift field:-\n   * -5: patch.I64Patch i64Val\n   */\n  public ?\\facebook\\thrift\\op\\I64Patch $i64Val;\n  /**\n   * Original thrift field:-\n   * -4: patch.I32Patch i32Val\n   */\n  public ?\\facebook\\thrift\\op\\I32Patch $i32Val;\n  /**\n   * Original thrift field:-\n   * -3: patch.I16Patch i16Val\n   */\n  public ?\\facebook\\thrift\\op\\I16Patch $i16Val;\n  /**\n   * Original thrift field:-\n   * -2: patch.BytePatch byteVal\n   */\n  public ?\\facebook\\thrift\\op\\BytePatch $byteVal;\n  /**\n   * Original thrift field:-\n   * -1: patch.BoolPatch boolVal\n   */\n  public ?\\facebook\\thrift\\op\\BoolPatch $boolVal;\n  /**\n   * Original thrift field:-\n   * 1: module.MyDataPatch structWithFieldCustomDefault\n   */\n  public ?\\test\\fixtures\\patch\\MyDataPatch $structWithFieldCustomDefault;\n\n  public function __construct(?\\test\\fixtures\\patch\\MyDataWithCustomDefaultPatch $structWithCustomDefault = null, ?\\facebook\\thrift\\op\\I32Patch $i32WithCustomDefault = null, ?\\test\\fixtures\\patch\\MyStructField30Patch $mapMap = null, ?\\test\\fixtures\\patch\\MyStructField29Patch $listMap = null, ?\\test\\fixtures\\patch\\MyStructField28Patch $optMapVal = null, ?\\test\\fixtures\\patch\\MyStructField27Patch $optSetVal = null, ?\\test\\fixtures\\patch\\MyStructField26Patch $optListVal = null, ?\\test\\fixtures\\patch\\LateDefStructPatch $optLateStructVal = null, ?\\test\\fixtures\\patch\\MyDataPatch $optStructVal = null, ?\\test\\fixtures\\patch\\MyStructField23Patch $optEnumVal = null, ?\\facebook\\thrift\\op\\BinaryPatch $optBinaryVal = null, ?\\facebook\\thrift\\op\\StringPatch $optStringVal = null, ?\\facebook\\thrift\\op\\DoublePatch $optDoubleVal = null, ?\\facebook\\thrift\\op\\FloatPatch $optFloatVal = null, ?\\facebook\\thrift\\op\\I64Patch $optI64Val = null, ?\\facebook\\thrift\\op\\I32Patch $optI32Val = null, ?\\facebook\\thrift\\op\\I16Patch $optI16Val = null, ?\\facebook\\thrift\\op\\BytePatch $optByteVal = null, ?\\facebook\\thrift\\op\\BoolPatch $optBoolVal = null, ?\\test\\fixtures\\patch\\LateDefStructPatch $lateStructVal = null, ?\\test\\fixtures\\patch\\MyUnionPatch $unionVal = null, ?\\test\\fixtures\\patch\\MyDataPatch $structVal = null, ?\\test\\fixtures\\patch\\MyStructField10Patch $enumVal = null, ?\\facebook\\thrift\\op\\BinaryPatch $binaryVal = null, ?\\facebook\\thrift\\op\\StringPatch $stringVal = null, ?\\facebook\\thrift\\op\\DoublePatch $doubleVal = null, ?\\facebook\\thrift\\op\\FloatPatch $floatVal = null, ?\\facebook\\thrift\\op\\I64Patch $i64Val = null, ?\\facebook\\thrift\\op\\I32Patch $i32Val = null, ?\\facebook\\thrift\\op\\I16Patch $i16Val = null, ?\\facebook\\thrift\\op\\BytePatch $byteVal = null, ?\\facebook\\thrift\\op\\BoolPatch $boolVal = null, ?\\test\\fixtures\\patch\\MyDataPatch $structWithFieldCustomDefault = null)[] {\n    $this->structWithCustomDefault = $structWithCustomDefault;\n    $this->i32WithCustomDefault = $i32WithCustomDefault;\n    $this->mapMap = $mapMap;\n    $this->listMap = $listMap;\n    $this->optMapVal = $optMapVal;\n    $this->optSetVal = $optSetVal;\n    $this->optListVal = $optListVal;\n    $this->optLateStructVal = $optLateStructVal;\n    $this->optStructVal = $optStructVal;\n    $this->optEnumVal = $optEnumVal;\n    $this->optBinaryVal = $optBinaryVal;\n    $this->optStringVal = $optStringVal;\n    $this->optDoubleVal = $optDoubleVal;\n    $this->optFloatVal = $optFloatVal;\n    $this->optI64Val = $optI64Val;\n    $this->optI32Val = $optI32Val;\n    $this->optI16Val = $optI16Val;\n    $this->optByteVal = $optByteVal;\n    $this->optBoolVal = $optBoolVal;\n    $this->lateStructVal = $lateStructVal;\n    $this->unionVal = $unionVal;\n    $this->structVal = $structVal;\n    $this->enumVal = $enumVal;\n    $this->binaryVal = $binaryVal;\n    $this->stringVal = $stringVal;\n    $this->doubleVal = $doubleVal;\n    $this->floatVal = $floatVal;\n    $this->i64Val = $i64Val;\n    $this->i32Val = $i32Val;\n    $this->i16Val = $i16Val;\n    $this->byteVal = $byteVal;\n    $this->boolVal = $boolVal;\n    $this->structWithFieldCustomDefault = $structWithFieldCustomDefault;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'structWithCustomDefault'),\n      Shapes::idx($shape, 'i32WithCustomDefault'),\n      Shapes::idx($shape, 'mapMap'),\n      Shapes::idx($shape, 'listMap'),\n      Shapes::idx($shape, 'optMapVal'),\n      Shapes::idx($shape, 'optSetVal'),\n      Shapes::idx($shape, 'optListVal'),\n      Shapes::idx($shape, 'optLateStructVal'),\n      Shapes::idx($shape, 'optStructVal'),\n      Shapes::idx($shape, 'optEnumVal'),\n      Shapes::idx($shape, 'optBinaryVal'),\n      Shapes::idx($shape, 'optStringVal'),\n      Shapes::idx($shape, 'optDoubleVal'),\n      Shapes::idx($shape, 'optFloatVal'),\n      Shapes::idx($shape, 'optI64Val'),\n      Shapes::idx($shape, 'optI32Val'),\n      Shapes::idx($shape, 'optI16Val'),\n      Shapes::idx($shape, 'optByteVal'),\n      Shapes::idx($shape, 'optBoolVal'),\n      Shapes::idx($shape, 'lateStructVal'),\n      Shapes::idx($shape, 'unionVal'),\n      Shapes::idx($shape, 'structVal'),\n      Shapes::idx($shape, 'enumVal'),\n      Shapes::idx($shape, 'binaryVal'),\n      Shapes::idx($shape, 'stringVal'),\n      Shapes::idx($shape, 'doubleVal'),\n      Shapes::idx($shape, 'floatVal'),\n      Shapes::idx($shape, 'i64Val'),\n      Shapes::idx($shape, 'i32Val'),\n      Shapes::idx($shape, 'i16Val'),\n      Shapes::idx($shape, 'byteVal'),\n      Shapes::idx($shape, 'boolVal'),\n      Shapes::idx($shape, 'structWithFieldCustomDefault'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStructFieldPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->structWithCustomDefault = null;\n    $this->i32WithCustomDefault = null;\n    $this->mapMap = null;\n    $this->listMap = null;\n    $this->optMapVal = null;\n    $this->optSetVal = null;\n    $this->optListVal = null;\n    $this->optLateStructVal = null;\n    $this->optStructVal = null;\n    $this->optEnumVal = null;\n    $this->optBinaryVal = null;\n    $this->optStringVal = null;\n    $this->optDoubleVal = null;\n    $this->optFloatVal = null;\n    $this->optI64Val = null;\n    $this->optI32Val = null;\n    $this->optI16Val = null;\n    $this->optByteVal = null;\n    $this->optBoolVal = null;\n    $this->lateStructVal = null;\n    $this->unionVal = null;\n    $this->structVal = null;\n    $this->enumVal = null;\n    $this->binaryVal = null;\n    $this->stringVal = null;\n    $this->doubleVal = null;\n    $this->floatVal = null;\n    $this->i64Val = null;\n    $this->i32Val = null;\n    $this->i16Val = null;\n    $this->byteVal = null;\n    $this->boolVal = null;\n    $this->structWithFieldCustomDefault = null;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStructFieldPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -32,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyDataWithCustomDefaultPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"structWithCustomDefault\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -31,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.I32Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"i32WithCustomDefault\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -30,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStructField30Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"mapMap\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -29,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStructField29Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"listMap\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -28,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStructField28Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optMapVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -27,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStructField27Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optSetVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -26,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStructField26Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optListVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -25,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.LateDefStructPatch\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.LateDefStructPatch\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optLateStructVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -24,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyDataPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optStructVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -23,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStructField23Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optEnumVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -22,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.BinaryPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optBinaryVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -21,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.StringPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optStringVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -20,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.DoublePatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optDoubleVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -19,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.FloatPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optFloatVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -18,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.I64Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optI64Val\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -17,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.I32Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optI32Val\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -16,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.I16Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optI16Val\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -15,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.BytePatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optByteVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -14,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.BoolPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optBoolVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -13,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.LateDefStructPatch\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.LateDefStructPatch\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"lateStructVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -12,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyUnionPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"unionVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -11,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyDataPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"structVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -10,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyStructField10Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"enumVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.BinaryPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"binaryVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.StringPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"stringVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.DoublePatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"doubleVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.FloatPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"floatVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.I64Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"i64Val\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.I32Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"i32Val\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.I16Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"i16Val\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.BytePatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"byteVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"patch.BoolPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"boolVal\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyDataPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"structWithFieldCustomDefault\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::MyStructFieldPatchStruct>\",\n            \"underlyingName\" => \"MyStructFieldPatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'structWithCustomDefault' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::MyDataWithCustomDefaultPatchStruct>\",\n                \"underlyingName\" => \"MyDataWithCustomDefaultPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'i32WithCustomDefault' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::I32PatchStruct>\",\n                \"underlyingName\" => \"I32PatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'mapMap' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::MapPatchAdapter<::test::fixtures::patch::MyStructField30PatchStruct>\",\n                \"underlyingName\" => \"MyStructField30PatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'listMap' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::ListPatchAdapter<::test::fixtures::patch::MyStructField29PatchStruct>\",\n                \"underlyingName\" => \"MyStructField29PatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'optMapVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::MapPatchAdapter<::test::fixtures::patch::MyStructField28PatchStruct>\",\n                \"underlyingName\" => \"MyStructField28PatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'optSetVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::SetPatchAdapter<::test::fixtures::patch::MyStructField27PatchStruct>\",\n                \"underlyingName\" => \"MyStructField27PatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'optListVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::ListPatchAdapter<::test::fixtures::patch::MyStructField26PatchStruct>\",\n                \"underlyingName\" => \"MyStructField26PatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'optLateStructVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::LateDefStructPatchStruct>\",\n                \"underlyingName\" => \"LateDefStructPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'optStructVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::MyDataPatchStruct>\",\n                \"underlyingName\" => \"MyDataPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'optEnumVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::AssignPatchAdapter<::test::fixtures::patch::MyStructField23PatchStruct>\",\n                \"underlyingName\" => \"MyStructField23PatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'optBinaryVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::BinaryPatchAdapter<::apache::thrift::op::BinaryPatchStruct>\",\n                \"underlyingName\" => \"BinaryPatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'optStringVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::StringPatchAdapter<::apache::thrift::op::StringPatchStruct>\",\n                \"underlyingName\" => \"StringPatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'optDoubleVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::DoublePatchStruct>\",\n                \"underlyingName\" => \"DoublePatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'optFloatVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::FloatPatchStruct>\",\n                \"underlyingName\" => \"FloatPatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'optI64Val' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::I64PatchStruct>\",\n                \"underlyingName\" => \"I64PatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'optI32Val' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::I32PatchStruct>\",\n                \"underlyingName\" => \"I32PatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'optI16Val' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::I16PatchStruct>\",\n                \"underlyingName\" => \"I16PatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'optByteVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::BytePatchStruct>\",\n                \"underlyingName\" => \"BytePatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'optBoolVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::BoolPatchAdapter<::apache::thrift::op::BoolPatchStruct>\",\n                \"underlyingName\" => \"BoolPatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'lateStructVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::LateDefStructPatchStruct>\",\n                \"underlyingName\" => \"LateDefStructPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'unionVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::UnionPatchAdapter<::test::fixtures::patch::MyUnionPatchStruct>\",\n                \"underlyingName\" => \"MyUnionPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'structVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::MyDataPatchStruct>\",\n                \"underlyingName\" => \"MyDataPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'enumVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::AssignPatchAdapter<::test::fixtures::patch::MyStructField10PatchStruct>\",\n                \"underlyingName\" => \"MyStructField10PatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'binaryVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::BinaryPatchAdapter<::apache::thrift::op::BinaryPatchStruct>\",\n                \"underlyingName\" => \"BinaryPatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'stringVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::StringPatchAdapter<::apache::thrift::op::StringPatchStruct>\",\n                \"underlyingName\" => \"StringPatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'doubleVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::DoublePatchStruct>\",\n                \"underlyingName\" => \"DoublePatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'floatVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::FloatPatchStruct>\",\n                \"underlyingName\" => \"FloatPatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'i64Val' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::I64PatchStruct>\",\n                \"underlyingName\" => \"I64PatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'i32Val' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::I32PatchStruct>\",\n                \"underlyingName\" => \"I32PatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'i16Val' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::I16PatchStruct>\",\n                \"underlyingName\" => \"I16PatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'byteVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::BytePatchStruct>\",\n                \"underlyingName\" => \"BytePatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'boolVal' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::BoolPatchAdapter<::apache::thrift::op::BoolPatchStruct>\",\n                \"underlyingName\" => \"BoolPatchStruct\",\n              )\n            ),\n          ],\n        ),\n        'structWithFieldCustomDefault' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::MyDataPatchStruct>\",\n                \"underlyingName\" => \"MyDataPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'structWithCustomDefault') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyDataWithCustomDefaultPatch>($parsed['structWithCustomDefault']));\n      $_tmp1 = \\test\\fixtures\\patch\\MyDataWithCustomDefaultPatch::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->structWithCustomDefault = $_tmp1;\n    }\n    if (idx($parsed, 'i32WithCustomDefault') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\I32Patch>($parsed['i32WithCustomDefault']));\n      $_tmp3 = \\facebook\\thrift\\op\\I32Patch::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->i32WithCustomDefault = $_tmp3;\n    }\n    if (idx($parsed, 'mapMap') !== null) {\n      $_tmp4 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyStructField30Patch>($parsed['mapMap']));\n      $_tmp5 = \\test\\fixtures\\patch\\MyStructField30Patch::withDefaultValues();\n      $_tmp5->readFromJson($_tmp4);\n      $this->mapMap = $_tmp5;\n    }\n    if (idx($parsed, 'listMap') !== null) {\n      $_tmp6 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyStructField29Patch>($parsed['listMap']));\n      $_tmp7 = \\test\\fixtures\\patch\\MyStructField29Patch::withDefaultValues();\n      $_tmp7->readFromJson($_tmp6);\n      $this->listMap = $_tmp7;\n    }\n    if (idx($parsed, 'optMapVal') !== null) {\n      $_tmp8 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyStructField28Patch>($parsed['optMapVal']));\n      $_tmp9 = \\test\\fixtures\\patch\\MyStructField28Patch::withDefaultValues();\n      $_tmp9->readFromJson($_tmp8);\n      $this->optMapVal = $_tmp9;\n    }\n    if (idx($parsed, 'optSetVal') !== null) {\n      $_tmp10 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyStructField27Patch>($parsed['optSetVal']));\n      $_tmp11 = \\test\\fixtures\\patch\\MyStructField27Patch::withDefaultValues();\n      $_tmp11->readFromJson($_tmp10);\n      $this->optSetVal = $_tmp11;\n    }\n    if (idx($parsed, 'optListVal') !== null) {\n      $_tmp12 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyStructField26Patch>($parsed['optListVal']));\n      $_tmp13 = \\test\\fixtures\\patch\\MyStructField26Patch::withDefaultValues();\n      $_tmp13->readFromJson($_tmp12);\n      $this->optListVal = $_tmp13;\n    }\n    if (idx($parsed, 'optLateStructVal') !== null) {\n      $_tmp14 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\LateDefStructPatch>($parsed['optLateStructVal']));\n      $_tmp15 = \\test\\fixtures\\patch\\LateDefStructPatch::withDefaultValues();\n      $_tmp15->readFromJson($_tmp14);\n      $this->optLateStructVal = $_tmp15;\n    }\n    if (idx($parsed, 'optStructVal') !== null) {\n      $_tmp16 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyDataPatch>($parsed['optStructVal']));\n      $_tmp17 = \\test\\fixtures\\patch\\MyDataPatch::withDefaultValues();\n      $_tmp17->readFromJson($_tmp16);\n      $this->optStructVal = $_tmp17;\n    }\n    if (idx($parsed, 'optEnumVal') !== null) {\n      $_tmp18 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyStructField23Patch>($parsed['optEnumVal']));\n      $_tmp19 = \\test\\fixtures\\patch\\MyStructField23Patch::withDefaultValues();\n      $_tmp19->readFromJson($_tmp18);\n      $this->optEnumVal = $_tmp19;\n    }\n    if (idx($parsed, 'optBinaryVal') !== null) {\n      $_tmp20 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\BinaryPatch>($parsed['optBinaryVal']));\n      $_tmp21 = \\facebook\\thrift\\op\\BinaryPatch::withDefaultValues();\n      $_tmp21->readFromJson($_tmp20);\n      $this->optBinaryVal = $_tmp21;\n    }\n    if (idx($parsed, 'optStringVal') !== null) {\n      $_tmp22 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\StringPatch>($parsed['optStringVal']));\n      $_tmp23 = \\facebook\\thrift\\op\\StringPatch::withDefaultValues();\n      $_tmp23->readFromJson($_tmp22);\n      $this->optStringVal = $_tmp23;\n    }\n    if (idx($parsed, 'optDoubleVal') !== null) {\n      $_tmp24 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\DoublePatch>($parsed['optDoubleVal']));\n      $_tmp25 = \\facebook\\thrift\\op\\DoublePatch::withDefaultValues();\n      $_tmp25->readFromJson($_tmp24);\n      $this->optDoubleVal = $_tmp25;\n    }\n    if (idx($parsed, 'optFloatVal') !== null) {\n      $_tmp26 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\FloatPatch>($parsed['optFloatVal']));\n      $_tmp27 = \\facebook\\thrift\\op\\FloatPatch::withDefaultValues();\n      $_tmp27->readFromJson($_tmp26);\n      $this->optFloatVal = $_tmp27;\n    }\n    if (idx($parsed, 'optI64Val') !== null) {\n      $_tmp28 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\I64Patch>($parsed['optI64Val']));\n      $_tmp29 = \\facebook\\thrift\\op\\I64Patch::withDefaultValues();\n      $_tmp29->readFromJson($_tmp28);\n      $this->optI64Val = $_tmp29;\n    }\n    if (idx($parsed, 'optI32Val') !== null) {\n      $_tmp30 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\I32Patch>($parsed['optI32Val']));\n      $_tmp31 = \\facebook\\thrift\\op\\I32Patch::withDefaultValues();\n      $_tmp31->readFromJson($_tmp30);\n      $this->optI32Val = $_tmp31;\n    }\n    if (idx($parsed, 'optI16Val') !== null) {\n      $_tmp32 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\I16Patch>($parsed['optI16Val']));\n      $_tmp33 = \\facebook\\thrift\\op\\I16Patch::withDefaultValues();\n      $_tmp33->readFromJson($_tmp32);\n      $this->optI16Val = $_tmp33;\n    }\n    if (idx($parsed, 'optByteVal') !== null) {\n      $_tmp34 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\BytePatch>($parsed['optByteVal']));\n      $_tmp35 = \\facebook\\thrift\\op\\BytePatch::withDefaultValues();\n      $_tmp35->readFromJson($_tmp34);\n      $this->optByteVal = $_tmp35;\n    }\n    if (idx($parsed, 'optBoolVal') !== null) {\n      $_tmp36 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\BoolPatch>($parsed['optBoolVal']));\n      $_tmp37 = \\facebook\\thrift\\op\\BoolPatch::withDefaultValues();\n      $_tmp37->readFromJson($_tmp36);\n      $this->optBoolVal = $_tmp37;\n    }\n    if (idx($parsed, 'lateStructVal') !== null) {\n      $_tmp38 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\LateDefStructPatch>($parsed['lateStructVal']));\n      $_tmp39 = \\test\\fixtures\\patch\\LateDefStructPatch::withDefaultValues();\n      $_tmp39->readFromJson($_tmp38);\n      $this->lateStructVal = $_tmp39;\n    }\n    if (idx($parsed, 'unionVal') !== null) {\n      $_tmp40 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyUnionPatch>($parsed['unionVal']));\n      $_tmp41 = \\test\\fixtures\\patch\\MyUnionPatch::withDefaultValues();\n      $_tmp41->readFromJson($_tmp40);\n      $this->unionVal = $_tmp41;\n    }\n    if (idx($parsed, 'structVal') !== null) {\n      $_tmp42 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyDataPatch>($parsed['structVal']));\n      $_tmp43 = \\test\\fixtures\\patch\\MyDataPatch::withDefaultValues();\n      $_tmp43->readFromJson($_tmp42);\n      $this->structVal = $_tmp43;\n    }\n    if (idx($parsed, 'enumVal') !== null) {\n      $_tmp44 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyStructField10Patch>($parsed['enumVal']));\n      $_tmp45 = \\test\\fixtures\\patch\\MyStructField10Patch::withDefaultValues();\n      $_tmp45->readFromJson($_tmp44);\n      $this->enumVal = $_tmp45;\n    }\n    if (idx($parsed, 'binaryVal') !== null) {\n      $_tmp46 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\BinaryPatch>($parsed['binaryVal']));\n      $_tmp47 = \\facebook\\thrift\\op\\BinaryPatch::withDefaultValues();\n      $_tmp47->readFromJson($_tmp46);\n      $this->binaryVal = $_tmp47;\n    }\n    if (idx($parsed, 'stringVal') !== null) {\n      $_tmp48 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\StringPatch>($parsed['stringVal']));\n      $_tmp49 = \\facebook\\thrift\\op\\StringPatch::withDefaultValues();\n      $_tmp49->readFromJson($_tmp48);\n      $this->stringVal = $_tmp49;\n    }\n    if (idx($parsed, 'doubleVal') !== null) {\n      $_tmp50 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\DoublePatch>($parsed['doubleVal']));\n      $_tmp51 = \\facebook\\thrift\\op\\DoublePatch::withDefaultValues();\n      $_tmp51->readFromJson($_tmp50);\n      $this->doubleVal = $_tmp51;\n    }\n    if (idx($parsed, 'floatVal') !== null) {\n      $_tmp52 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\FloatPatch>($parsed['floatVal']));\n      $_tmp53 = \\facebook\\thrift\\op\\FloatPatch::withDefaultValues();\n      $_tmp53->readFromJson($_tmp52);\n      $this->floatVal = $_tmp53;\n    }\n    if (idx($parsed, 'i64Val') !== null) {\n      $_tmp54 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\I64Patch>($parsed['i64Val']));\n      $_tmp55 = \\facebook\\thrift\\op\\I64Patch::withDefaultValues();\n      $_tmp55->readFromJson($_tmp54);\n      $this->i64Val = $_tmp55;\n    }\n    if (idx($parsed, 'i32Val') !== null) {\n      $_tmp56 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\I32Patch>($parsed['i32Val']));\n      $_tmp57 = \\facebook\\thrift\\op\\I32Patch::withDefaultValues();\n      $_tmp57->readFromJson($_tmp56);\n      $this->i32Val = $_tmp57;\n    }\n    if (idx($parsed, 'i16Val') !== null) {\n      $_tmp58 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\I16Patch>($parsed['i16Val']));\n      $_tmp59 = \\facebook\\thrift\\op\\I16Patch::withDefaultValues();\n      $_tmp59->readFromJson($_tmp58);\n      $this->i16Val = $_tmp59;\n    }\n    if (idx($parsed, 'byteVal') !== null) {\n      $_tmp60 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\BytePatch>($parsed['byteVal']));\n      $_tmp61 = \\facebook\\thrift\\op\\BytePatch::withDefaultValues();\n      $_tmp61->readFromJson($_tmp60);\n      $this->byteVal = $_tmp61;\n    }\n    if (idx($parsed, 'boolVal') !== null) {\n      $_tmp62 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\op\\BoolPatch>($parsed['boolVal']));\n      $_tmp63 = \\facebook\\thrift\\op\\BoolPatch::withDefaultValues();\n      $_tmp63->readFromJson($_tmp62);\n      $this->boolVal = $_tmp63;\n    }\n    if (idx($parsed, 'structWithFieldCustomDefault') !== null) {\n      $_tmp64 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyDataPatch>($parsed['structWithFieldCustomDefault']));\n      $_tmp65 = \\test\\fixtures\\patch\\MyDataPatch::withDefaultValues();\n      $_tmp65->readFromJson($_tmp64);\n      $this->structWithFieldCustomDefault = $_tmp65;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStructEnsureStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/MyStructEnsureStruct'))>>\nclass MyStructEnsureStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    -32 => shape(\n      'var' => 'structWithCustomDefault',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyDataWithCustomDefault::class,\n    ),\n    -31 => shape(\n      'var' => 'i32WithCustomDefault',\n      'type' => \\TType::I32,\n    ),\n    -30 => shape(\n      'var' => 'mapMap',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    -29 => shape(\n      'var' => 'listMap',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    -28 => shape(\n      'var' => 'optMapVal',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    -27 => shape(\n      'var' => 'optSetVal',\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    -26 => shape(\n      'var' => 'optListVal',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    -25 => shape(\n      'var' => 'optLateStructVal',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\LateDefStruct::class,\n    ),\n    -24 => shape(\n      'var' => 'optStructVal',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyData::class,\n    ),\n    -23 => shape(\n      'var' => 'optEnumVal',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\patch\\MyEnum::class,\n    ),\n    -22 => shape(\n      'var' => 'optBinaryVal',\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    -21 => shape(\n      'var' => 'optStringVal',\n      'type' => \\TType::STRING,\n    ),\n    -20 => shape(\n      'var' => 'optDoubleVal',\n      'type' => \\TType::DOUBLE,\n    ),\n    -19 => shape(\n      'var' => 'optFloatVal',\n      'type' => \\TType::FLOAT,\n    ),\n    -18 => shape(\n      'var' => 'optI64Val',\n      'type' => \\TType::I64,\n    ),\n    -17 => shape(\n      'var' => 'optI32Val',\n      'type' => \\TType::I32,\n    ),\n    -16 => shape(\n      'var' => 'optI16Val',\n      'type' => \\TType::I16,\n    ),\n    -15 => shape(\n      'var' => 'optByteVal',\n      'type' => \\TType::BYTE,\n    ),\n    -14 => shape(\n      'var' => 'optBoolVal',\n      'type' => \\TType::BOOL,\n    ),\n    -13 => shape(\n      'var' => 'lateStructVal',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\LateDefStruct::class,\n    ),\n    -12 => shape(\n      'var' => 'unionVal',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyUnion::class,\n    ),\n    -11 => shape(\n      'var' => 'structVal',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyData::class,\n    ),\n    -10 => shape(\n      'var' => 'enumVal',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\patch\\MyEnum::class,\n    ),\n    -9 => shape(\n      'var' => 'binaryVal',\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    -8 => shape(\n      'var' => 'stringVal',\n      'type' => \\TType::STRING,\n    ),\n    -7 => shape(\n      'var' => 'doubleVal',\n      'type' => \\TType::DOUBLE,\n    ),\n    -6 => shape(\n      'var' => 'floatVal',\n      'type' => \\TType::FLOAT,\n    ),\n    -5 => shape(\n      'var' => 'i64Val',\n      'type' => \\TType::I64,\n    ),\n    -4 => shape(\n      'var' => 'i32Val',\n      'type' => \\TType::I32,\n    ),\n    -3 => shape(\n      'var' => 'i16Val',\n      'type' => \\TType::I16,\n    ),\n    -2 => shape(\n      'var' => 'byteVal',\n      'type' => \\TType::BYTE,\n    ),\n    -1 => shape(\n      'var' => 'boolVal',\n      'type' => \\TType::BOOL,\n    ),\n    1 => shape(\n      'var' => 'structWithFieldCustomDefault',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\MyData::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'structWithCustomDefault' => -32,\n    'i32WithCustomDefault' => -31,\n    'mapMap' => -30,\n    'listMap' => -29,\n    'optMapVal' => -28,\n    'optSetVal' => -27,\n    'optListVal' => -26,\n    'optLateStructVal' => -25,\n    'optStructVal' => -24,\n    'optEnumVal' => -23,\n    'optBinaryVal' => -22,\n    'optStringVal' => -21,\n    'optDoubleVal' => -20,\n    'optFloatVal' => -19,\n    'optI64Val' => -18,\n    'optI32Val' => -17,\n    'optI16Val' => -16,\n    'optByteVal' => -15,\n    'optBoolVal' => -14,\n    'lateStructVal' => -13,\n    'unionVal' => -12,\n    'structVal' => -11,\n    'enumVal' => -10,\n    'binaryVal' => -9,\n    'stringVal' => -8,\n    'doubleVal' => -7,\n    'floatVal' => -6,\n    'i64Val' => -5,\n    'i32Val' => -4,\n    'i16Val' => -3,\n    'byteVal' => -2,\n    'boolVal' => -1,\n    'structWithFieldCustomDefault' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'structWithCustomDefault' => ?\\test\\fixtures\\patch\\MyDataWithCustomDefault,\n    ?'i32WithCustomDefault' => ?int,\n    ?'mapMap' => ?Map<string, Map<string, int>>,\n    ?'listMap' => ?Vector<Map<string, int>>,\n    ?'optMapVal' => ?Map<string, string>,\n    ?'optSetVal' => ?Set<string>,\n    ?'optListVal' => ?Vector<int>,\n    ?'optLateStructVal' => ?\\test\\fixtures\\patch\\LateDefStruct,\n    ?'optStructVal' => ?\\test\\fixtures\\patch\\MyData,\n    ?'optEnumVal' => ?\\test\\fixtures\\patch\\MyEnum,\n    ?'optBinaryVal' => ?string,\n    ?'optStringVal' => ?string,\n    ?'optDoubleVal' => ?float,\n    ?'optFloatVal' => ?float,\n    ?'optI64Val' => ?int,\n    ?'optI32Val' => ?int,\n    ?'optI16Val' => ?int,\n    ?'optByteVal' => ?int,\n    ?'optBoolVal' => ?bool,\n    ?'lateStructVal' => ?\\test\\fixtures\\patch\\LateDefStruct,\n    ?'unionVal' => ?\\test\\fixtures\\patch\\MyUnion,\n    ?'structVal' => ?\\test\\fixtures\\patch\\MyData,\n    ?'enumVal' => ?\\test\\fixtures\\patch\\MyEnum,\n    ?'binaryVal' => ?string,\n    ?'stringVal' => ?string,\n    ?'doubleVal' => ?float,\n    ?'floatVal' => ?float,\n    ?'i64Val' => ?int,\n    ?'i32Val' => ?int,\n    ?'i16Val' => ?int,\n    ?'byteVal' => ?int,\n    ?'boolVal' => ?bool,\n    ?'structWithFieldCustomDefault' => ?\\test\\fixtures\\patch\\MyData,\n  );\n\n  const int STRUCTURAL_ID = 8458031364624826074;\n  /**\n   * Original thrift field:-\n   * -32: module.MyDataWithCustomDefault structWithCustomDefault\n   */\n  public ?\\test\\fixtures\\patch\\MyDataWithCustomDefault $structWithCustomDefault;\n  /**\n   * Original thrift field:-\n   * -31: i32 i32WithCustomDefault\n   */\n  public ?int $i32WithCustomDefault;\n  /**\n   * Original thrift field:-\n   * -30: map<string, map<string, i32>> mapMap\n   */\n  public ?Map<string, Map<string, int>> $mapMap;\n  /**\n   * Original thrift field:-\n   * -29: list<map<string, i32>> listMap\n   */\n  public ?Vector<Map<string, int>> $listMap;\n  /**\n   * Original thrift field:-\n   * -28: map<string, string> optMapVal\n   */\n  public ?Map<string, string> $optMapVal;\n  /**\n   * Original thrift field:-\n   * -27: set<string> optSetVal\n   */\n  public ?Set<string> $optSetVal;\n  /**\n   * Original thrift field:-\n   * -26: list<i16> optListVal\n   */\n  public ?Vector<int> $optListVal;\n  /**\n   * Original thrift field:-\n   * -25: module.LateDefStruct optLateStructVal\n   */\n  public ?\\test\\fixtures\\patch\\LateDefStruct $optLateStructVal;\n  /**\n   * Original thrift field:-\n   * -24: module.MyData optStructVal\n   */\n  public ?\\test\\fixtures\\patch\\MyData $optStructVal;\n  /**\n   * Original thrift field:-\n   * -23: module.MyEnum optEnumVal\n   */\n  public ?\\test\\fixtures\\patch\\MyEnum $optEnumVal;\n  /**\n   * Original thrift field:-\n   * -22: binary optBinaryVal\n   */\n  public ?string $optBinaryVal;\n  /**\n   * Original thrift field:-\n   * -21: string optStringVal\n   */\n  public ?string $optStringVal;\n  /**\n   * Original thrift field:-\n   * -20: double optDoubleVal\n   */\n  public ?float $optDoubleVal;\n  /**\n   * Original thrift field:-\n   * -19: float optFloatVal\n   */\n  public ?float $optFloatVal;\n  /**\n   * Original thrift field:-\n   * -18: i64 optI64Val\n   */\n  public ?int $optI64Val;\n  /**\n   * Original thrift field:-\n   * -17: i32 optI32Val\n   */\n  public ?int $optI32Val;\n  /**\n   * Original thrift field:-\n   * -16: i16 optI16Val\n   */\n  public ?int $optI16Val;\n  /**\n   * Original thrift field:-\n   * -15: byte optByteVal\n   */\n  public ?int $optByteVal;\n  /**\n   * Original thrift field:-\n   * -14: bool optBoolVal\n   */\n  public ?bool $optBoolVal;\n  /**\n   * Original thrift field:-\n   * -13: module.LateDefStruct lateStructVal\n   */\n  public ?\\test\\fixtures\\patch\\LateDefStruct $lateStructVal;\n  /**\n   * Original thrift field:-\n   * -12: module.MyUnion unionVal\n   */\n  public ?\\test\\fixtures\\patch\\MyUnion $unionVal;\n  /**\n   * Original thrift field:-\n   * -11: module.MyData structVal\n   */\n  public ?\\test\\fixtures\\patch\\MyData $structVal;\n  /**\n   * Original thrift field:-\n   * -10: module.MyEnum enumVal\n   */\n  public ?\\test\\fixtures\\patch\\MyEnum $enumVal;\n  /**\n   * Original thrift field:-\n   * -9: binary binaryVal\n   */\n  public ?string $binaryVal;\n  /**\n   * Original thrift field:-\n   * -8: string stringVal\n   */\n  public ?string $stringVal;\n  /**\n   * Original thrift field:-\n   * -7: double doubleVal\n   */\n  public ?float $doubleVal;\n  /**\n   * Original thrift field:-\n   * -6: float floatVal\n   */\n  public ?float $floatVal;\n  /**\n   * Original thrift field:-\n   * -5: i64 i64Val\n   */\n  public ?int $i64Val;\n  /**\n   * Original thrift field:-\n   * -4: i32 i32Val\n   */\n  public ?int $i32Val;\n  /**\n   * Original thrift field:-\n   * -3: i16 i16Val\n   */\n  public ?int $i16Val;\n  /**\n   * Original thrift field:-\n   * -2: byte byteVal\n   */\n  public ?int $byteVal;\n  /**\n   * Original thrift field:-\n   * -1: bool boolVal\n   */\n  public ?bool $boolVal;\n  /**\n   * Original thrift field:-\n   * 1: module.MyData structWithFieldCustomDefault\n   */\n  public ?\\test\\fixtures\\patch\\MyData $structWithFieldCustomDefault;\n\n  public function __construct(?\\test\\fixtures\\patch\\MyDataWithCustomDefault $structWithCustomDefault = null, ?int $i32WithCustomDefault = null, ?Map<string, Map<string, int>> $mapMap = null, ?Vector<Map<string, int>> $listMap = null, ?Map<string, string> $optMapVal = null, ?Set<string> $optSetVal = null, ?Vector<int> $optListVal = null, ?\\test\\fixtures\\patch\\LateDefStruct $optLateStructVal = null, ?\\test\\fixtures\\patch\\MyData $optStructVal = null, ?\\test\\fixtures\\patch\\MyEnum $optEnumVal = null, ?string $optBinaryVal = null, ?string $optStringVal = null, ?float $optDoubleVal = null, ?float $optFloatVal = null, ?int $optI64Val = null, ?int $optI32Val = null, ?int $optI16Val = null, ?int $optByteVal = null, ?bool $optBoolVal = null, ?\\test\\fixtures\\patch\\LateDefStruct $lateStructVal = null, ?\\test\\fixtures\\patch\\MyUnion $unionVal = null, ?\\test\\fixtures\\patch\\MyData $structVal = null, ?\\test\\fixtures\\patch\\MyEnum $enumVal = null, ?string $binaryVal = null, ?string $stringVal = null, ?float $doubleVal = null, ?float $floatVal = null, ?int $i64Val = null, ?int $i32Val = null, ?int $i16Val = null, ?int $byteVal = null, ?bool $boolVal = null, ?\\test\\fixtures\\patch\\MyData $structWithFieldCustomDefault = null)[] {\n    $this->structWithCustomDefault = $structWithCustomDefault;\n    $this->i32WithCustomDefault = $i32WithCustomDefault;\n    $this->mapMap = $mapMap;\n    $this->listMap = $listMap;\n    $this->optMapVal = $optMapVal;\n    $this->optSetVal = $optSetVal;\n    $this->optListVal = $optListVal;\n    $this->optLateStructVal = $optLateStructVal;\n    $this->optStructVal = $optStructVal;\n    $this->optEnumVal = $optEnumVal;\n    $this->optBinaryVal = $optBinaryVal;\n    $this->optStringVal = $optStringVal;\n    $this->optDoubleVal = $optDoubleVal;\n    $this->optFloatVal = $optFloatVal;\n    $this->optI64Val = $optI64Val;\n    $this->optI32Val = $optI32Val;\n    $this->optI16Val = $optI16Val;\n    $this->optByteVal = $optByteVal;\n    $this->optBoolVal = $optBoolVal;\n    $this->lateStructVal = $lateStructVal;\n    $this->unionVal = $unionVal;\n    $this->structVal = $structVal;\n    $this->enumVal = $enumVal;\n    $this->binaryVal = $binaryVal;\n    $this->stringVal = $stringVal;\n    $this->doubleVal = $doubleVal;\n    $this->floatVal = $floatVal;\n    $this->i64Val = $i64Val;\n    $this->i32Val = $i32Val;\n    $this->i16Val = $i16Val;\n    $this->byteVal = $byteVal;\n    $this->boolVal = $boolVal;\n    $this->structWithFieldCustomDefault = $structWithFieldCustomDefault;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'structWithCustomDefault'),\n      Shapes::idx($shape, 'i32WithCustomDefault'),\n      Shapes::idx($shape, 'mapMap'),\n      Shapes::idx($shape, 'listMap'),\n      Shapes::idx($shape, 'optMapVal'),\n      Shapes::idx($shape, 'optSetVal'),\n      Shapes::idx($shape, 'optListVal'),\n      Shapes::idx($shape, 'optLateStructVal'),\n      Shapes::idx($shape, 'optStructVal'),\n      Shapes::idx($shape, 'optEnumVal'),\n      Shapes::idx($shape, 'optBinaryVal'),\n      Shapes::idx($shape, 'optStringVal'),\n      Shapes::idx($shape, 'optDoubleVal'),\n      Shapes::idx($shape, 'optFloatVal'),\n      Shapes::idx($shape, 'optI64Val'),\n      Shapes::idx($shape, 'optI32Val'),\n      Shapes::idx($shape, 'optI16Val'),\n      Shapes::idx($shape, 'optByteVal'),\n      Shapes::idx($shape, 'optBoolVal'),\n      Shapes::idx($shape, 'lateStructVal'),\n      Shapes::idx($shape, 'unionVal'),\n      Shapes::idx($shape, 'structVal'),\n      Shapes::idx($shape, 'enumVal'),\n      Shapes::idx($shape, 'binaryVal'),\n      Shapes::idx($shape, 'stringVal'),\n      Shapes::idx($shape, 'doubleVal'),\n      Shapes::idx($shape, 'floatVal'),\n      Shapes::idx($shape, 'i64Val'),\n      Shapes::idx($shape, 'i32Val'),\n      Shapes::idx($shape, 'i16Val'),\n      Shapes::idx($shape, 'byteVal'),\n      Shapes::idx($shape, 'boolVal'),\n      Shapes::idx($shape, 'structWithFieldCustomDefault'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStructEnsureStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStructEnsureStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -32,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyDataWithCustomDefault\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"structWithCustomDefault\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -31,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i32WithCustomDefault\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -30,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"mapMap\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -29,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"listMap\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -28,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optMapVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -27,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optSetVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -26,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optListVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -25,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.LateDefStruct\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.LateDefStruct\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optLateStructVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -24,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyData\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optStructVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -23,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optEnumVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -22,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"optBinaryVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -21,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"optStringVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -20,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"optDoubleVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -19,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_FLOAT_TYPE,\n                )\n              ),\n              \"name\" => \"optFloatVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -18,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"optI64Val\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -17,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"optI32Val\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -16,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                )\n              ),\n              \"name\" => \"optI16Val\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -15,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                )\n              ),\n              \"name\" => \"optByteVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -14,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"optBoolVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -13,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.LateDefStruct\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.LateDefStruct\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"lateStructVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -12,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyUnion\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"unionVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -11,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyData\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"structVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -10,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"enumVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"binaryVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"stringVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"doubleVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_FLOAT_TYPE,\n                )\n              ),\n              \"name\" => \"floatVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"i64Val\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i32Val\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                )\n              ),\n              \"name\" => \"i16Val\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                )\n              ),\n              \"name\" => \"byteVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"boolVal\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyData\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"structWithFieldCustomDefault\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude' => \\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'structWithCustomDefault') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyDataWithCustomDefault>($parsed['structWithCustomDefault']));\n      $_tmp1 = \\test\\fixtures\\patch\\MyDataWithCustomDefault::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->structWithCustomDefault = $_tmp1;\n    }\n    if (idx($parsed, 'i32WithCustomDefault') !== null) {\n      $_tmp2 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['i32WithCustomDefault']);\n      if ($_tmp2 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->i32WithCustomDefault = (int)$_tmp2;\n      }\n    }\n    if (idx($parsed, 'mapMap') !== null) {\n      $_json6 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, Map<string, int>>>($parsed['mapMap']);\n      $_container7 = Map {};\n      foreach($_json6 as $_key4 => $_value5) {\n        $_value8 = Map {};\n        $_json12 = $_value5;\n        $_container13 = Map {};\n        foreach($_json12 as $_key10 => $_value11) {\n          $_value14 = 0;\n          $_tmp15 = (int)$_value11;\n          if ($_tmp15 > 0x7fffffff) {\n            throw new \\TProtocolException(\"number exceeds limit in field\");\n          } else {\n            $_value14 = (int)$_tmp15;\n          }\n          $_container13[$_key10] = $_value14;\n        }\n        $_value8 = $_container13;\n        $_container7[$_key4] = $_value8;\n      }\n      $this->mapMap = $_container7;\n    }\n    if (idx($parsed, 'listMap') !== null) {\n      $_json19 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<Map<string, int>>>($parsed['listMap']);\n      $_container20 = Vector {};\n      foreach($_json19 as $_key17 => $_value18) {\n        $_elem21 = Map {};\n        $_json25 = $_value18;\n        $_container26 = Map {};\n        foreach($_json25 as $_key23 => $_value24) {\n          $_value27 = 0;\n          $_tmp28 = (int)$_value24;\n          if ($_tmp28 > 0x7fffffff) {\n            throw new \\TProtocolException(\"number exceeds limit in field\");\n          } else {\n            $_value27 = (int)$_tmp28;\n          }\n          $_container26[$_key23] = $_value27;\n        }\n        $_elem21 = $_container26;\n        $_container20 []= $_elem21;\n      }\n      $this->listMap = $_container20;\n    }\n    if (idx($parsed, 'optMapVal') !== null) {\n      $_json32 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, string>>($parsed['optMapVal']);\n      $_container33 = Map {};\n      foreach($_json32 as $_key30 => $_value31) {\n        $_value34 = '';\n        $_value34 = $_value31;\n        $_container33[$_key30] = $_value34;\n      }\n      $this->optMapVal = $_container33;\n    }\n    if (idx($parsed, 'optSetVal') !== null) {\n      $_json38 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<string>>($parsed['optSetVal']);\n      $_container39 = Set {};\n      foreach($_json38 as $_key36 => $_value37) {\n        $_elem40 = '';\n        $_elem40 = $_value37;\n        $_container39->add($_elem40);\n      }\n      $this->optSetVal = $_container39;\n    }\n    if (idx($parsed, 'optListVal') !== null) {\n      $_json44 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['optListVal']);\n      $_container45 = Vector {};\n      foreach($_json44 as $_key42 => $_value43) {\n        $_elem46 = 0;\n        $_tmp47 = (int)$_value43;\n        if ($_tmp47 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem46 = (int)$_tmp47;\n        }\n        $_container45 []= $_elem46;\n      }\n      $this->optListVal = $_container45;\n    }\n    if (idx($parsed, 'optLateStructVal') !== null) {\n      $_tmp48 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\LateDefStruct>($parsed['optLateStructVal']));\n      $_tmp49 = \\test\\fixtures\\patch\\LateDefStruct::withDefaultValues();\n      $_tmp49->readFromJson($_tmp48);\n      $this->optLateStructVal = $_tmp49;\n    }\n    if (idx($parsed, 'optStructVal') !== null) {\n      $_tmp50 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyData>($parsed['optStructVal']));\n      $_tmp51 = \\test\\fixtures\\patch\\MyData::withDefaultValues();\n      $_tmp51->readFromJson($_tmp50);\n      $this->optStructVal = $_tmp51;\n    }\n    if (idx($parsed, 'optEnumVal') !== null) {\n      $this->optEnumVal = \\test\\fixtures\\patch\\MyEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyEnum>($parsed['optEnumVal']));\n    }\n    if (idx($parsed, 'optBinaryVal') !== null) {\n      $this->optBinaryVal = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['optBinaryVal']);\n    }\n    if (idx($parsed, 'optStringVal') !== null) {\n      $this->optStringVal = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['optStringVal']);\n    }\n    if (idx($parsed, 'optDoubleVal') !== null) {\n      $this->optDoubleVal = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['optDoubleVal']);\n    }\n    if (idx($parsed, 'optFloatVal') !== null) {\n      $this->optFloatVal = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['optFloatVal']);\n    }\n    if (idx($parsed, 'optI64Val') !== null) {\n      $this->optI64Val = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['optI64Val']);\n    }\n    if (idx($parsed, 'optI32Val') !== null) {\n      $_tmp52 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['optI32Val']);\n      if ($_tmp52 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->optI32Val = (int)$_tmp52;\n      }\n    }\n    if (idx($parsed, 'optI16Val') !== null) {\n      $_tmp53 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['optI16Val']);\n      if ($_tmp53 > 0x7fff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->optI16Val = (int)$_tmp53;\n      }\n    }\n    if (idx($parsed, 'optByteVal') !== null) {\n      $_tmp54 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['optByteVal']);\n      if ($_tmp54 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->optByteVal = (int)$_tmp54;\n      }\n    }\n    if (idx($parsed, 'optBoolVal') !== null) {\n      $this->optBoolVal = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['optBoolVal']);\n    }\n    if (idx($parsed, 'lateStructVal') !== null) {\n      $_tmp55 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\LateDefStruct>($parsed['lateStructVal']));\n      $_tmp56 = \\test\\fixtures\\patch\\LateDefStruct::withDefaultValues();\n      $_tmp56->readFromJson($_tmp55);\n      $this->lateStructVal = $_tmp56;\n    }\n    if (idx($parsed, 'unionVal') !== null) {\n      $_tmp57 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyUnion>($parsed['unionVal']));\n      $_tmp58 = \\test\\fixtures\\patch\\MyUnion::withDefaultValues();\n      $_tmp58->readFromJson($_tmp57);\n      $this->unionVal = $_tmp58;\n    }\n    if (idx($parsed, 'structVal') !== null) {\n      $_tmp59 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyData>($parsed['structVal']));\n      $_tmp60 = \\test\\fixtures\\patch\\MyData::withDefaultValues();\n      $_tmp60->readFromJson($_tmp59);\n      $this->structVal = $_tmp60;\n    }\n    if (idx($parsed, 'enumVal') !== null) {\n      $this->enumVal = \\test\\fixtures\\patch\\MyEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyEnum>($parsed['enumVal']));\n    }\n    if (idx($parsed, 'binaryVal') !== null) {\n      $this->binaryVal = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['binaryVal']);\n    }\n    if (idx($parsed, 'stringVal') !== null) {\n      $this->stringVal = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['stringVal']);\n    }\n    if (idx($parsed, 'doubleVal') !== null) {\n      $this->doubleVal = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['doubleVal']);\n    }\n    if (idx($parsed, 'floatVal') !== null) {\n      $this->floatVal = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['floatVal']);\n    }\n    if (idx($parsed, 'i64Val') !== null) {\n      $this->i64Val = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['i64Val']);\n    }\n    if (idx($parsed, 'i32Val') !== null) {\n      $_tmp61 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['i32Val']);\n      if ($_tmp61 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->i32Val = (int)$_tmp61;\n      }\n    }\n    if (idx($parsed, 'i16Val') !== null) {\n      $_tmp62 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['i16Val']);\n      if ($_tmp62 > 0x7fff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->i16Val = (int)$_tmp62;\n      }\n    }\n    if (idx($parsed, 'byteVal') !== null) {\n      $_tmp63 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['byteVal']);\n      if ($_tmp63 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->byteVal = (int)$_tmp63;\n      }\n    }\n    if (idx($parsed, 'boolVal') !== null) {\n      $this->boolVal = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['boolVal']);\n    }\n    if (idx($parsed, 'structWithFieldCustomDefault') !== null) {\n      $_tmp64 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\MyData>($parsed['structWithFieldCustomDefault']));\n      $_tmp65 = \\test\\fixtures\\patch\\MyData::withDefaultValues();\n      $_tmp65->readFromJson($_tmp64);\n      $this->structWithFieldCustomDefault = $_tmp65;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * LateDefStructPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/LateDefStructPatch'))>>\nclass LateDefStructPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\LateDefStruct::class,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    3 => shape(\n      'var' => 'patchPrior',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\LateDefStructFieldPatch::class,\n    ),\n    5 => shape(\n      'var' => 'ensure',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\LateDefStructEnsureStruct::class,\n    ),\n    6 => shape(\n      'var' => 'patch',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\LateDefStructFieldPatch::class,\n    ),\n    7 => shape(\n      'var' => 'remove',\n      'is_terse' => true,\n      'type' => \\TType::SET,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'patchPrior' => 3,\n    'ensure' => 5,\n    'patch' => 6,\n    'remove' => 7,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?\\test\\fixtures\\patch\\LateDefStruct,\n    ?'clear' => ?bool,\n    ?'patchPrior' => ?\\test\\fixtures\\patch\\LateDefStructFieldPatch,\n    ?'ensure' => ?\\test\\fixtures\\patch\\LateDefStructEnsureStruct,\n    ?'patch' => ?\\test\\fixtures\\patch\\LateDefStructFieldPatch,\n    ?'remove' => ?Set<int>,\n  );\n\n  const int STRUCTURAL_ID = 4095174235818678939;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: module.LateDefStruct assign\n   */\n  public ?\\test\\fixtures\\patch\\LateDefStruct $assign;\n  /**\n   * Clears a value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Patches any previously set values. Applies second.\n   * \n   * Original thrift field:-\n   * 3: module.LateDefStructFieldPatch patchPrior\n   */\n  public ?\\test\\fixtures\\patch\\LateDefStructFieldPatch $patchPrior;\n  /**\n   * Initialize fields, using the given defaults. Applies third.\n   * \n   * Original thrift field:-\n   * 5: module.LateDefStructEnsureStruct ensure\n   */\n  public ?\\test\\fixtures\\patch\\LateDefStructEnsureStruct $ensure;\n  /**\n   * Patches any set value, including newly set values. Applies last.\n   * \n   * Original thrift field:-\n   * 6: module.LateDefStructFieldPatch patch\n   */\n  public ?\\test\\fixtures\\patch\\LateDefStructFieldPatch $patch;\n  /**\n   * Removes entries, if present. Applies third.\n   * \n   * Original thrift field:-\n   * 7: set<patch.FieldId> remove\n   */\n  public Set<int> $remove;\n\n  public function __construct(?\\test\\fixtures\\patch\\LateDefStruct $assign = null, ?bool $clear = null, ?\\test\\fixtures\\patch\\LateDefStructFieldPatch $patchPrior = null, ?\\test\\fixtures\\patch\\LateDefStructEnsureStruct $ensure = null, ?\\test\\fixtures\\patch\\LateDefStructFieldPatch $patch = null, ?Set<int> $remove = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->patchPrior = $patchPrior;\n    $this->ensure = $ensure;\n    $this->patch = $patch;\n    $this->remove = $remove ?? Set {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'patchPrior'),\n      Shapes::idx($shape, 'ensure'),\n      Shapes::idx($shape, 'patch'),\n      Shapes::idx($shape, 'remove'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'LateDefStructPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->patchPrior = null;\n    $this->ensure = null;\n    $this->patch = null;\n    $this->remove = Set {};\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.LateDefStructPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.LateDefStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.LateDefStructFieldPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patchPrior\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.LateDefStructEnsureStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ensure\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.LateDefStructFieldPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patch\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"patch.FieldId\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"id.FieldId\",\n                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"remove\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::LateDefStructPatchStruct>\",\n            \"underlyingName\" => \"LateDefStructPatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'patchPrior' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::LateDefStructFieldPatchStruct>\",\n                \"underlyingName\" => \"LateDefStructFieldPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'ensure' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude' => \\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude::fromShape(\n              shape(\n              )\n            ),\n          ],\n        ),\n        'patch' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::LateDefStructFieldPatchStruct>\",\n                \"underlyingName\" => \"LateDefStructFieldPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\LateDefStruct>($parsed['assign']));\n      $_tmp1 = \\test\\fixtures\\patch\\LateDefStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->assign = $_tmp1;\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'patchPrior') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\LateDefStructFieldPatch>($parsed['patchPrior']));\n      $_tmp3 = \\test\\fixtures\\patch\\LateDefStructFieldPatch::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->patchPrior = $_tmp3;\n    }\n    if (idx($parsed, 'ensure') !== null) {\n      $_tmp4 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\LateDefStructEnsureStruct>($parsed['ensure']));\n      $_tmp5 = \\test\\fixtures\\patch\\LateDefStructEnsureStruct::withDefaultValues();\n      $_tmp5->readFromJson($_tmp4);\n      $this->ensure = $_tmp5;\n    }\n    if (idx($parsed, 'patch') !== null) {\n      $_tmp6 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\LateDefStructFieldPatch>($parsed['patch']));\n      $_tmp7 = \\test\\fixtures\\patch\\LateDefStructFieldPatch::withDefaultValues();\n      $_tmp7->readFromJson($_tmp6);\n      $this->patch = $_tmp7;\n    }\n    if (idx($parsed, 'remove') !== null) {\n      $_json11 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['remove']);\n      $_container12 = Set {};\n      foreach($_json11 as $_key9 => $_value10) {\n        $_elem13 = 0;\n        $_tmp14 = (int)$_value10;\n        if ($_tmp14 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem13 = (int)$_tmp14;\n        }\n        $_container12->add($_elem13);\n      }\n      $this->remove = $_container12;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * LateDefStructFieldPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/LateDefStructFieldPatch'))>>\nclass LateDefStructFieldPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'LateDefStructFieldPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.LateDefStructFieldPatch\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::LateDefStructFieldPatchStruct>\",\n            \"underlyingName\" => \"LateDefStructFieldPatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * LateDefStructEnsureStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/LateDefStructEnsureStruct'))>>\nclass LateDefStructEnsureStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'LateDefStructEnsureStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.LateDefStructEnsureStruct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude' => \\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * RecursivePatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/RecursivePatch'))>>\nclass RecursivePatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\Recursive::class,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    3 => shape(\n      'var' => 'patchPrior',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\RecursiveFieldPatch::class,\n    ),\n    5 => shape(\n      'var' => 'ensure',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\RecursiveEnsureStruct::class,\n    ),\n    6 => shape(\n      'var' => 'patch',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\RecursiveFieldPatch::class,\n    ),\n    7 => shape(\n      'var' => 'remove',\n      'is_terse' => true,\n      'type' => \\TType::SET,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'patchPrior' => 3,\n    'ensure' => 5,\n    'patch' => 6,\n    'remove' => 7,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?\\test\\fixtures\\patch\\Recursive,\n    ?'clear' => ?bool,\n    ?'patchPrior' => ?\\test\\fixtures\\patch\\RecursiveFieldPatch,\n    ?'ensure' => ?\\test\\fixtures\\patch\\RecursiveEnsureStruct,\n    ?'patch' => ?\\test\\fixtures\\patch\\RecursiveFieldPatch,\n    ?'remove' => ?Set<int>,\n  );\n\n  const int STRUCTURAL_ID = 6057258732540886167;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: module.Recursive assign\n   */\n  public ?\\test\\fixtures\\patch\\Recursive $assign;\n  /**\n   * Clears a value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Patches any previously set values. Applies second.\n   * \n   * Original thrift field:-\n   * 3: module.RecursiveFieldPatch patchPrior\n   */\n  public ?\\test\\fixtures\\patch\\RecursiveFieldPatch $patchPrior;\n  /**\n   * Initialize fields, using the given defaults. Applies third.\n   * \n   * Original thrift field:-\n   * 5: module.RecursiveEnsureStruct ensure\n   */\n  public ?\\test\\fixtures\\patch\\RecursiveEnsureStruct $ensure;\n  /**\n   * Patches any set value, including newly set values. Applies last.\n   * \n   * Original thrift field:-\n   * 6: module.RecursiveFieldPatch patch\n   */\n  public ?\\test\\fixtures\\patch\\RecursiveFieldPatch $patch;\n  /**\n   * Removes entries, if present. Applies third.\n   * \n   * Original thrift field:-\n   * 7: set<patch.FieldId> remove\n   */\n  public Set<int> $remove;\n\n  public function __construct(?\\test\\fixtures\\patch\\Recursive $assign = null, ?bool $clear = null, ?\\test\\fixtures\\patch\\RecursiveFieldPatch $patchPrior = null, ?\\test\\fixtures\\patch\\RecursiveEnsureStruct $ensure = null, ?\\test\\fixtures\\patch\\RecursiveFieldPatch $patch = null, ?Set<int> $remove = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->patchPrior = $patchPrior;\n    $this->ensure = $ensure;\n    $this->patch = $patch;\n    $this->remove = $remove ?? Set {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'patchPrior'),\n      Shapes::idx($shape, 'ensure'),\n      Shapes::idx($shape, 'patch'),\n      Shapes::idx($shape, 'remove'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RecursivePatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->patchPrior = null;\n    $this->ensure = null;\n    $this->patch = null;\n    $this->remove = Set {};\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.RecursivePatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Recursive\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.RecursiveFieldPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patchPrior\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.RecursiveEnsureStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ensure\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.RecursiveFieldPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patch\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"patch.FieldId\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"id.FieldId\",\n                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"remove\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::RecursivePatchStruct>\",\n            \"underlyingName\" => \"RecursivePatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'patchPrior' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::RecursiveFieldPatchStruct>\",\n                \"underlyingName\" => \"RecursiveFieldPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'ensure' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude' => \\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude::fromShape(\n              shape(\n              )\n            ),\n          ],\n        ),\n        'patch' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::RecursiveFieldPatchStruct>\",\n                \"underlyingName\" => \"RecursiveFieldPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\Recursive>($parsed['assign']));\n      $_tmp1 = \\test\\fixtures\\patch\\Recursive::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->assign = $_tmp1;\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'patchPrior') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\RecursiveFieldPatch>($parsed['patchPrior']));\n      $_tmp3 = \\test\\fixtures\\patch\\RecursiveFieldPatch::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->patchPrior = $_tmp3;\n    }\n    if (idx($parsed, 'ensure') !== null) {\n      $_tmp4 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\RecursiveEnsureStruct>($parsed['ensure']));\n      $_tmp5 = \\test\\fixtures\\patch\\RecursiveEnsureStruct::withDefaultValues();\n      $_tmp5->readFromJson($_tmp4);\n      $this->ensure = $_tmp5;\n    }\n    if (idx($parsed, 'patch') !== null) {\n      $_tmp6 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\RecursiveFieldPatch>($parsed['patch']));\n      $_tmp7 = \\test\\fixtures\\patch\\RecursiveFieldPatch::withDefaultValues();\n      $_tmp7->readFromJson($_tmp6);\n      $this->patch = $_tmp7;\n    }\n    if (idx($parsed, 'remove') !== null) {\n      $_json11 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['remove']);\n      $_container12 = Set {};\n      foreach($_json11 as $_key9 => $_value10) {\n        $_elem13 = 0;\n        $_tmp14 = (int)$_value10;\n        if ($_tmp14 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem13 = (int)$_tmp14;\n        }\n        $_container12->add($_elem13);\n      }\n      $this->remove = $_container12;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * RecursiveField1Patch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/RecursiveField1Patch'))>>\nclass RecursiveField1Patch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\test\\fixtures\\patch\\Recursive::class,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?Map<string, \\test\\fixtures\\patch\\Recursive>,\n    ?'clear' => ?bool,\n  );\n\n  const int STRUCTURAL_ID = 2553542170459237600;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: map<string, module.Recursive> assign\n   */\n  public ?Map<string, \\test\\fixtures\\patch\\Recursive> $assign;\n  /**\n   * Clears a value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n\n  public function __construct(?Map<string, \\test\\fixtures\\patch\\Recursive> $assign = null, ?bool $clear = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RecursiveField1Patch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.RecursiveField1Patch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.Recursive\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.Recursive\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::AssignPatchAdapter<::test::fixtures::patch::RecursiveField1PatchStruct>\",\n            \"underlyingName\" => \"RecursiveField1PatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, \\test\\fixtures\\patch\\Recursive>>($parsed['assign']);\n      $_container4 = Map {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_value5 = \\test\\fixtures\\patch\\Recursive::withDefaultValues();\n        $_tmp6 = \\json_encode($_value2);\n        $_tmp7 = \\test\\fixtures\\patch\\Recursive::withDefaultValues();\n        $_tmp7->readFromJson($_tmp6);\n        $_value5 = $_tmp7;\n        $_container4[$_key1] = $_value5;\n      }\n      $this->assign = $_container4;\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * RecursiveFieldPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/RecursiveFieldPatch'))>>\nclass RecursiveFieldPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    -1 => shape(\n      'var' => 'nodes',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\RecursiveField1Patch::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'nodes' => -1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'nodes' => ?\\test\\fixtures\\patch\\RecursiveField1Patch,\n  );\n\n  const int STRUCTURAL_ID = 5650747686776624114;\n  /**\n   * Original thrift field:-\n   * -1: module.RecursiveField1Patch nodes\n   */\n  public ?\\test\\fixtures\\patch\\RecursiveField1Patch $nodes;\n\n  public function __construct(?\\test\\fixtures\\patch\\RecursiveField1Patch $nodes = null)[] {\n    $this->nodes = $nodes;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'nodes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RecursiveFieldPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->nodes = null;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.RecursiveFieldPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.RecursiveField1Patch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"nodes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::RecursiveFieldPatchStruct>\",\n            \"underlyingName\" => \"RecursiveFieldPatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'nodes' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::AssignPatchAdapter<::test::fixtures::patch::RecursiveField1PatchStruct>\",\n                \"underlyingName\" => \"RecursiveField1PatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'nodes') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\RecursiveField1Patch>($parsed['nodes']));\n      $_tmp1 = \\test\\fixtures\\patch\\RecursiveField1Patch::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->nodes = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * RecursiveEnsureStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/RecursiveEnsureStruct'))>>\nclass RecursiveEnsureStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    -1 => shape(\n      'var' => 'nodes',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\test\\fixtures\\patch\\Recursive::class,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'nodes' => -1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'nodes' => ?Map<string, \\test\\fixtures\\patch\\Recursive>,\n  );\n\n  const int STRUCTURAL_ID = 3722360834412776999;\n  /**\n   * Original thrift field:-\n   * -1: map<string, module.Recursive> nodes\n   */\n  public ?Map<string, \\test\\fixtures\\patch\\Recursive> $nodes;\n\n  public function __construct(?Map<string, \\test\\fixtures\\patch\\Recursive> $nodes = null)[] {\n    $this->nodes = $nodes;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'nodes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RecursiveEnsureStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.RecursiveEnsureStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.Recursive\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.Recursive\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"nodes\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude' => \\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'nodes') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, \\test\\fixtures\\patch\\Recursive>>($parsed['nodes']);\n      $_container4 = Map {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_value5 = \\test\\fixtures\\patch\\Recursive::withDefaultValues();\n        $_tmp6 = \\json_encode($_value2);\n        $_tmp7 = \\test\\fixtures\\patch\\Recursive::withDefaultValues();\n        $_tmp7->readFromJson($_tmp6);\n        $_value5 = $_tmp7;\n        $_container4[$_key1] = $_value5;\n      }\n      $this->nodes = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * BarPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/BarPatch'))>>\nclass BarPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\Bar::class,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    3 => shape(\n      'var' => 'patchPrior',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\BarFieldPatch::class,\n    ),\n    5 => shape(\n      'var' => 'ensure',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\BarEnsureStruct::class,\n    ),\n    6 => shape(\n      'var' => 'patch',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\BarFieldPatch::class,\n    ),\n    7 => shape(\n      'var' => 'remove',\n      'is_terse' => true,\n      'type' => \\TType::SET,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'patchPrior' => 3,\n    'ensure' => 5,\n    'patch' => 6,\n    'remove' => 7,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?\\test\\fixtures\\patch\\Bar,\n    ?'clear' => ?bool,\n    ?'patchPrior' => ?\\test\\fixtures\\patch\\BarFieldPatch,\n    ?'ensure' => ?\\test\\fixtures\\patch\\BarEnsureStruct,\n    ?'patch' => ?\\test\\fixtures\\patch\\BarFieldPatch,\n    ?'remove' => ?Set<int>,\n  );\n\n  const int STRUCTURAL_ID = 7975740035235247535;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: module.Bar assign\n   */\n  public ?\\test\\fixtures\\patch\\Bar $assign;\n  /**\n   * Clears a value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Patches any previously set values. Applies second.\n   * \n   * Original thrift field:-\n   * 3: module.BarFieldPatch patchPrior\n   */\n  public ?\\test\\fixtures\\patch\\BarFieldPatch $patchPrior;\n  /**\n   * Initialize fields, using the given defaults. Applies third.\n   * \n   * Original thrift field:-\n   * 5: module.BarEnsureStruct ensure\n   */\n  public ?\\test\\fixtures\\patch\\BarEnsureStruct $ensure;\n  /**\n   * Patches any set value, including newly set values. Applies last.\n   * \n   * Original thrift field:-\n   * 6: module.BarFieldPatch patch\n   */\n  public ?\\test\\fixtures\\patch\\BarFieldPatch $patch;\n  /**\n   * Removes entries, if present. Applies third.\n   * \n   * Original thrift field:-\n   * 7: set<patch.FieldId> remove\n   */\n  public Set<int> $remove;\n\n  public function __construct(?\\test\\fixtures\\patch\\Bar $assign = null, ?bool $clear = null, ?\\test\\fixtures\\patch\\BarFieldPatch $patchPrior = null, ?\\test\\fixtures\\patch\\BarEnsureStruct $ensure = null, ?\\test\\fixtures\\patch\\BarFieldPatch $patch = null, ?Set<int> $remove = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->patchPrior = $patchPrior;\n    $this->ensure = $ensure;\n    $this->patch = $patch;\n    $this->remove = $remove ?? Set {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'patchPrior'),\n      Shapes::idx($shape, 'ensure'),\n      Shapes::idx($shape, 'patch'),\n      Shapes::idx($shape, 'remove'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BarPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->patchPrior = null;\n    $this->ensure = null;\n    $this->patch = null;\n    $this->remove = Set {};\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.BarPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Bar\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.BarFieldPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patchPrior\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.BarEnsureStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ensure\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.BarFieldPatch\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"patch\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"patch.FieldId\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"id.FieldId\",\n                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"remove\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::BarPatchStruct>\",\n            \"underlyingName\" => \"BarPatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'patchPrior' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::BarFieldPatchStruct>\",\n                \"underlyingName\" => \"BarFieldPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n        'ensure' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude' => \\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude::fromShape(\n              shape(\n              )\n            ),\n          ],\n        ),\n        'patch' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::BarFieldPatchStruct>\",\n                \"underlyingName\" => \"BarFieldPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\Bar>($parsed['assign']));\n      $_tmp1 = \\test\\fixtures\\patch\\Bar::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->assign = $_tmp1;\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'patchPrior') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\BarFieldPatch>($parsed['patchPrior']));\n      $_tmp3 = \\test\\fixtures\\patch\\BarFieldPatch::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->patchPrior = $_tmp3;\n    }\n    if (idx($parsed, 'ensure') !== null) {\n      $_tmp4 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\BarEnsureStruct>($parsed['ensure']));\n      $_tmp5 = \\test\\fixtures\\patch\\BarEnsureStruct::withDefaultValues();\n      $_tmp5->readFromJson($_tmp4);\n      $this->ensure = $_tmp5;\n    }\n    if (idx($parsed, 'patch') !== null) {\n      $_tmp6 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\BarFieldPatch>($parsed['patch']));\n      $_tmp7 = \\test\\fixtures\\patch\\BarFieldPatch::withDefaultValues();\n      $_tmp7->readFromJson($_tmp6);\n      $this->patch = $_tmp7;\n    }\n    if (idx($parsed, 'remove') !== null) {\n      $_json11 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['remove']);\n      $_container12 = Set {};\n      foreach($_json11 as $_key9 => $_value10) {\n        $_elem13 = 0;\n        $_tmp14 = (int)$_value10;\n        if ($_tmp14 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem13 = (int)$_tmp14;\n        }\n        $_container12->add($_elem13);\n      }\n      $this->remove = $_container12;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * BarFieldPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/BarFieldPatch'))>>\nclass BarFieldPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    -1 => shape(\n      'var' => 'loop',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\LoopPatch::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'loop' => -1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'loop' => ?\\test\\fixtures\\patch\\LoopPatch,\n  );\n\n  const int STRUCTURAL_ID = 3282171960754554582;\n  /**\n   * Original thrift field:-\n   * -1: module.LoopPatch loop\n   */\n  public ?\\test\\fixtures\\patch\\LoopPatch $loop;\n\n  public function __construct(?\\test\\fixtures\\patch\\LoopPatch $loop = null)[] {\n    $this->loop = $loop;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'loop'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BarFieldPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->loop = null;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.BarFieldPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.LoopPatch\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.LoopPatch\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"loop\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::BarFieldPatchStruct>\",\n            \"underlyingName\" => \"BarFieldPatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'loop' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\InternBox' => \\facebook\\thrift\\annotation\\InternBox::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::apache::thrift::op::detail::AssignPatchAdapter<::test::fixtures::patch::LoopPatchStruct>\",\n                \"underlyingName\" => \"LoopPatchStruct\",\n                \"extraNamespace\" => \"\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'loop') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\LoopPatch>($parsed['loop']));\n      $_tmp1 = \\test\\fixtures\\patch\\LoopPatch::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->loop = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * BarEnsureStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/BarEnsureStruct'))>>\nclass BarEnsureStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    -1 => shape(\n      'var' => 'loop',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\Loop::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'loop' => -1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'loop' => ?\\test\\fixtures\\patch\\Loop,\n  );\n\n  const int STRUCTURAL_ID = 2398939770440216623;\n  /**\n   * Original thrift field:-\n   * -1: module.Loop loop\n   */\n  public ?\\test\\fixtures\\patch\\Loop $loop;\n\n  public function __construct(?\\test\\fixtures\\patch\\Loop $loop = null)[] {\n    $this->loop = $loop;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'loop'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BarEnsureStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.BarEnsureStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => -1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.Loop\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.Loop\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"loop\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude' => \\facebook\\thrift\\annotation\\cpp\\Frozen2Exclude::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n        'loop' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\op\\AssignOnlyPatch' => \\facebook\\thrift\\op\\AssignOnlyPatch::fromShape(\n              shape(\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'loop') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\Loop>($parsed['loop']));\n      $_tmp1 = \\test\\fixtures\\patch\\Loop::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->loop = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * LoopPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/patch/LoopPatch'))>>\nclass LoopPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\patch\\Loop::class,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?\\test\\fixtures\\patch\\Loop,\n    ?'clear' => ?bool,\n  );\n\n  const int STRUCTURAL_ID = 3189284720730559067;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other operations are ignored.\n   * \n   * Note: Optional and union fields must be set before assigned.\n   * \n   * \n   * Original thrift field:-\n   * 1: module.Loop assign\n   */\n  public ?\\test\\fixtures\\patch\\Loop $assign;\n  /**\n   * Clears a value. Applies first.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n\n  public function __construct(?\\test\\fixtures\\patch\\Loop $assign = null, ?bool $clear = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'LoopPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.LoopPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Loop\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::AssignPatchAdapter<::test::fixtures::patch::LoopPatchStruct>\",\n            \"underlyingName\" => \"LoopPatchStruct\",\n            \"extraNamespace\" => \"\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'assign' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\op\\AssignOnlyPatch' => \\facebook\\thrift\\op\\AssignOnlyPatch::fromShape(\n              shape(\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\test\\fixtures\\patch\\Loop>($parsed['assign']));\n      $_tmp1 = \\test\\fixtures\\patch\\Loop::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->assign = $_tmp1;\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n  }\n\n}\n\n", "num_lines": 13695}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\op;\n\n/**\n * The meaning of the patch op field ids, in all properly formulated patch\n * definitions.\n * \n * Patch field ids are interpreted at runtime, as a dynamic patch protocol,\n * without any additional schema derived from IDL patch definitions.\n * \n * Original thrift enum:-\n * PatchOp\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/op/PatchOp'))>>\nenum PatchOp: int {\n  Unspecified = 0;\n  /**\n   * Set the value. Supersedes all other ops.\n   * \n   * Note: Due to a limitation in current Thrift protocol encoding schemes,\n   * unions cannot be reliabily distinquished from structs/exceptions, so fields\n   * must be set before assign can change the value, for example via an\n   * `EnsureStruct` or `EnsureUnion` operation.\n   */\n  Assign = 1;\n  /**\n   * Set to the intrinsic default (which might be 'unset').\n   */\n  Clear = 2;\n  /**\n   * Apply a field/value-wise patch.\n   */\n  PatchPrior = 3;\n  /**\n   * Set to the given default, if not already of the same type.\n   * \n   * In a dynamic context this means the ids/values must match exactly:\n   *     ensureUnion(Object ensureUnion, Object value) {\n   *       if (ensureUnion.ids() != value.ids())\n   *         value = ensureUnion;\n   *     }\n   */\n  EnsureUnion = 4;\n  /**\n   *  * A pair-wise ensure operation.\n   *  *\n   *  * For maps this is an \"add if key not present\".\n   *  *\n   *  * For structs, this can be use to encodes the default state of the fields, based\n   *  * on thier qualifier type:\n   *  * - optional: absent\n   *  * - terse: intrinsic default\n   *  * - fill: custom default\n   * *\n   */\n  EnsureStruct = 5;\n  /**\n   * Apply a field/value-wise patch after all other ops.\n   */\n  PatchAfter = 6;\n  /**\n   * Remove if present.\n   * \n   * A key/value-based remove for set, 'saturating subtract' for\n   * numeric/'counting' types, 'remove by key' for map, and `remove by field id` for struct.\n   */\n  Remove = 7;\n  /**\n   * Add/prepend a value,with the following semantics:\n   * - Key/value-based 'add' for set;\n   * - 'prepend' for list, string, or binary; and\n   * - saturating 'add' for numeric/counting types.\n   */\n  Add = 8;\n  /**\n   * Put/append/invert a value, with the following semantics:\n   * - 'update or insert' for maps;\n   * - 'append' for list, string or binary; and\n   * - 'invert' for boolean.\n   */\n  Put = 9;\n}\n\nclass PatchOp_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"patch.PatchOp\",\n        \"elements\" => dict[\n          0 => \"Unspecified\",\n          1 => \"Assign\",\n          2 => \"Clear\",\n          3 => \"PatchPrior\",\n          4 => \"EnsureUnion\",\n          5 => \"EnsureStruct\",\n          6 => \"PatchAfter\",\n          7 => \"Remove\",\n          8 => \"Add\",\n          9 => \"Put\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * An annotation that indicates a patch representation should be generated for\n * the associated definition.\n *\n * Original thrift struct:-\n * GeneratePatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/op/GeneratePatch'))>>\nclass GeneratePatch implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'GeneratePatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"patch.GeneratePatch\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * AssignOnlyPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/op/AssignOnlyPatch'))>>\nclass AssignOnlyPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AssignOnlyPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"patch.AssignOnlyPatch\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A patch for a boolean value.\n *\n * Original thrift struct:-\n * BoolPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/op/BoolPatch'))>>\nclass BoolPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::BOOL,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    9 => shape(\n      'var' => 'invert',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'invert' => 9,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?bool,\n    ?'clear' => ?bool,\n    ?'invert' => ?bool,\n  );\n\n  const type TShape = shape(\n    ?'assign' => ?bool,\n    'clear' => bool,\n    'invert' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 6587786969423386652;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other patch operations are ignored.\n   * \n   * Note: Only modifies set field values.\n   * \n   * Original thrift field:-\n   * 1: bool assign\n   */\n  public ?bool $assign;\n  /**\n   * Clear any set value.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * If the bool value should be inverted.\n   * \n   * Original thrift field:-\n   * 9: bool invert\n   */\n  public bool $invert;\n\n  public function __construct(?bool $assign = null, ?bool $clear = null, ?bool $invert = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->invert = $invert ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'invert'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BoolPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->invert = false;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"patch.BoolPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"invert\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::BoolPatchAdapter<::apache::thrift::op::BoolPatchStruct>\",\n            \"underlyingName\" => \"BoolPatchStruct\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      $shape['clear'],\n      $shape['invert'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'assign' => $this->assign,\n      'clear' => $this->clear,\n      'invert' => $this->invert,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $this->assign = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['assign']);\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'invert') !== null) {\n      $this->invert = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['invert']);\n    }\n  }\n\n}\n\n/**\n * A patch for an 8-bit integer value.\n *\n * Original thrift struct:-\n * BytePatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/op/BytePatch'))>>\nclass BytePatch implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::BYTE,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    8 => shape(\n      'var' => 'add',\n      'is_terse' => true,\n      'type' => \\TType::BYTE,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'add' => 8,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?int,\n    ?'clear' => ?bool,\n    ?'add' => ?int,\n  );\n\n  const type TShape = shape(\n    ?'assign' => ?int,\n    'clear' => bool,\n    'add' => int,\n    ...\n  );\n  const int STRUCTURAL_ID = 353839682464366106;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other patch operations are ignored.\n   * \n   * Note: Only modifies set field values.\n   * \n   * Original thrift field:-\n   * 1: byte assign\n   */\n  public ?int $assign;\n  /**\n   * Clear any set value.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Add to a given value.\n   * \n   * Original thrift field:-\n   * 8: byte add\n   */\n  public int $add;\n\n  public function __construct(?int $assign = null, ?bool $clear = null, ?int $add = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->add = $add ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'add'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BytePatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->add = 0;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"patch.BytePatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                )\n              ),\n              \"name\" => \"add\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::BytePatchStruct>\",\n            \"underlyingName\" => \"BytePatchStruct\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      $shape['clear'],\n      $shape['add'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'assign' => $this->assign,\n      'clear' => $this->clear,\n      'add' => $this->add,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['assign']);\n      if ($_tmp0 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->assign = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'add') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['add']);\n      if ($_tmp1 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->add = (int)$_tmp1;\n      }\n    }\n  }\n\n}\n\n/**\n * A patch for a 16-bit integer value.\n *\n * Original thrift struct:-\n * I16Patch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/op/I16Patch'))>>\nclass I16Patch implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::I16,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    8 => shape(\n      'var' => 'add',\n      'is_terse' => true,\n      'type' => \\TType::I16,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'add' => 8,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?int,\n    ?'clear' => ?bool,\n    ?'add' => ?int,\n  );\n\n  const type TShape = shape(\n    ?'assign' => ?int,\n    'clear' => bool,\n    'add' => int,\n    ...\n  );\n  const int STRUCTURAL_ID = 218422147056489009;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other patch operations are ignored.\n   * \n   * Note: Only modifies set field values.\n   * \n   * Original thrift field:-\n   * 1: i16 assign\n   */\n  public ?int $assign;\n  /**\n   * Clear any set value.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Add to a given value.\n   * \n   * Original thrift field:-\n   * 8: i16 add\n   */\n  public int $add;\n\n  public function __construct(?int $assign = null, ?bool $clear = null, ?int $add = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->add = $add ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'add'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'I16Patch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->add = 0;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"patch.I16Patch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                )\n              ),\n              \"name\" => \"add\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::I16PatchStruct>\",\n            \"underlyingName\" => \"I16PatchStruct\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      $shape['clear'],\n      $shape['add'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'assign' => $this->assign,\n      'clear' => $this->clear,\n      'add' => $this->add,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['assign']);\n      if ($_tmp0 > 0x7fff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->assign = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'add') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['add']);\n      if ($_tmp1 > 0x7fff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->add = (int)$_tmp1;\n      }\n    }\n  }\n\n}\n\n/**\n * A patch for a 32-bit integer value.\n *\n * Original thrift struct:-\n * I32Patch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/op/I32Patch'))>>\nclass I32Patch implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    8 => shape(\n      'var' => 'add',\n      'is_terse' => true,\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'add' => 8,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?int,\n    ?'clear' => ?bool,\n    ?'add' => ?int,\n  );\n\n  const type TShape = shape(\n    ?'assign' => ?int,\n    'clear' => bool,\n    'add' => int,\n    ...\n  );\n  const int STRUCTURAL_ID = 8147514463397038431;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other patch operations are ignored.\n   * \n   * Note: Only modifies set field values.\n   * \n   * Original thrift field:-\n   * 1: i32 assign\n   */\n  public ?int $assign;\n  /**\n   * Clears any set value.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Add to a given value.\n   * \n   * Original thrift field:-\n   * 8: i32 add\n   */\n  public int $add;\n\n  public function __construct(?int $assign = null, ?bool $clear = null, ?int $add = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->add = $add ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'add'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'I32Patch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->add = 0;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"patch.I32Patch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"add\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::I32PatchStruct>\",\n            \"underlyingName\" => \"I32PatchStruct\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      $shape['clear'],\n      $shape['add'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'assign' => $this->assign,\n      'clear' => $this->clear,\n      'add' => $this->add,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['assign']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->assign = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'add') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['add']);\n      if ($_tmp1 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->add = (int)$_tmp1;\n      }\n    }\n  }\n\n}\n\n/**\n * A patch for a 64-bit integer value.\n *\n * Original thrift struct:-\n * I64Patch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/op/I64Patch'))>>\nclass I64Patch implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    8 => shape(\n      'var' => 'add',\n      'is_terse' => true,\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'add' => 8,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?int,\n    ?'clear' => ?bool,\n    ?'add' => ?int,\n  );\n\n  const type TShape = shape(\n    ?'assign' => ?int,\n    'clear' => bool,\n    'add' => int,\n    ...\n  );\n  const int STRUCTURAL_ID = 3463481380739863248;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other patch operations are ignored.\n   * \n   * Note: Only modifies set field values.\n   * \n   * Original thrift field:-\n   * 1: i64 assign\n   */\n  public ?int $assign;\n  /**\n   * Clear any set value.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Add to a given value.\n   * \n   * Original thrift field:-\n   * 8: i64 add\n   */\n  public int $add;\n\n  public function __construct(?int $assign = null, ?bool $clear = null, ?int $add = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->add = $add ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'add'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'I64Patch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->add = 0;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"patch.I64Patch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"add\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::I64PatchStruct>\",\n            \"underlyingName\" => \"I64PatchStruct\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      $shape['clear'],\n      $shape['add'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'assign' => $this->assign,\n      'clear' => $this->clear,\n      'add' => $this->add,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $this->assign = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['assign']);\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'add') !== null) {\n      $this->add = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['add']);\n    }\n  }\n\n}\n\n/**\n * A patch for a 32-bit floating point value.\n *\n * Original thrift struct:-\n * FloatPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/op/FloatPatch'))>>\nclass FloatPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::FLOAT,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    8 => shape(\n      'var' => 'add',\n      'is_terse' => true,\n      'type' => \\TType::FLOAT,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'add' => 8,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?float,\n    ?'clear' => ?bool,\n    ?'add' => ?float,\n  );\n\n  const type TShape = shape(\n    ?'assign' => ?float,\n    'clear' => bool,\n    'add' => float,\n    ...\n  );\n  const int STRUCTURAL_ID = 2148458437976210697;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other patch operations are ignored.\n   * \n   * Note: Only modifies set field values.\n   * \n   * Original thrift field:-\n   * 1: float assign\n   */\n  public ?float $assign;\n  /**\n   * Clear any set value.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Add to a given value.\n   * \n   * Original thrift field:-\n   * 8: float add\n   */\n  public float $add;\n\n  public function __construct(?float $assign = null, ?bool $clear = null, ?float $add = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->add = $add ?? 0.0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'add'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FloatPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->add = 0.0;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"patch.FloatPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_FLOAT_TYPE,\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_FLOAT_TYPE,\n                )\n              ),\n              \"name\" => \"add\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::FloatPatchStruct>\",\n            \"underlyingName\" => \"FloatPatchStruct\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      $shape['clear'],\n      $shape['add'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'assign' => $this->assign,\n      'clear' => $this->clear,\n      'add' => $this->add,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $this->assign = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['assign']);\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'add') !== null) {\n      $this->add = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['add']);\n    }\n  }\n\n}\n\n/**\n * A patch for an 64-bit floating point value.\n *\n * Original thrift struct:-\n * DoublePatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/op/DoublePatch'))>>\nclass DoublePatch implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::DOUBLE,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    8 => shape(\n      'var' => 'add',\n      'is_terse' => true,\n      'type' => \\TType::DOUBLE,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'add' => 8,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?float,\n    ?'clear' => ?bool,\n    ?'add' => ?float,\n  );\n\n  const type TShape = shape(\n    ?'assign' => ?float,\n    'clear' => bool,\n    'add' => float,\n    ...\n  );\n  const int STRUCTURAL_ID = 5393538735552286670;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other patch operations are ignored.\n   * \n   * Note: Only modifies set field values.\n   * \n   * Original thrift field:-\n   * 1: double assign\n   */\n  public ?float $assign;\n  /**\n   * Clear any set value.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Add to a given value.\n   * \n   * Original thrift field:-\n   * 8: double add\n   */\n  public float $add;\n\n  public function __construct(?float $assign = null, ?bool $clear = null, ?float $add = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->add = $add ?? 0.0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'add'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'DoublePatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->add = 0.0;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"patch.DoublePatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"add\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::NumberPatchAdapter<::apache::thrift::op::DoublePatchStruct>\",\n            \"underlyingName\" => \"DoublePatchStruct\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      $shape['clear'],\n      $shape['add'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'assign' => $this->assign,\n      'clear' => $this->clear,\n      'add' => $this->add,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $this->assign = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['assign']);\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'add') !== null) {\n      $this->add = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['add']);\n    }\n  }\n\n}\n\n/**\n * A patch for a string value.\n *\n * Original thrift struct:-\n * StringPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/op/StringPatch'))>>\nclass StringPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    8 => shape(\n      'var' => 'prepend',\n      'is_terse' => true,\n      'type' => \\TType::STRING,\n    ),\n    9 => shape(\n      'var' => 'append',\n      'is_terse' => true,\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'prepend' => 8,\n    'append' => 9,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?string,\n    ?'clear' => ?bool,\n    ?'prepend' => ?string,\n    ?'append' => ?string,\n  );\n\n  const type TShape = shape(\n    ?'assign' => ?string,\n    'clear' => bool,\n    'prepend' => string,\n    'append' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 4803569377705535564;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other patch operations are ignored.\n   * \n   * Note: Only modifies set field values.\n   * \n   * Original thrift field:-\n   * 1: string assign\n   */\n  public ?string $assign;\n  /**\n   * Clear a given string.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Prepend to a given value.\n   * \n   * Original thrift field:-\n   * 8: string prepend\n   */\n  public string $prepend;\n  /**\n   * Append to a given value.\n   * \n   * Original thrift field:-\n   * 9: string append\n   */\n  public string $append;\n\n  public function __construct(?string $assign = null, ?bool $clear = null, ?string $prepend = null, ?string $append = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->prepend = $prepend ?? '';\n    $this->append = $append ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'prepend'),\n      Shapes::idx($shape, 'append'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StringPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->prepend = '';\n    $this->append = '';\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"patch.StringPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"prepend\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"append\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::StringPatchAdapter<::apache::thrift::op::StringPatchStruct>\",\n            \"underlyingName\" => \"StringPatchStruct\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      $shape['clear'],\n      $shape['prepend'],\n      $shape['append'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'assign' => $this->assign,\n      'clear' => $this->clear,\n      'prepend' => $this->prepend,\n      'append' => $this->append,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $this->assign = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['assign']);\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'prepend') !== null) {\n      $this->prepend = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['prepend']);\n    }\n    if (idx($parsed, 'append') !== null) {\n      $this->append = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['append']);\n    }\n  }\n\n}\n\n/**\n * A patch for a binary value.\n *\n * Original thrift struct:-\n * BinaryPatch\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/op/BinaryPatch'))>>\nclass BinaryPatch implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'assign',\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    2 => shape(\n      'var' => 'clear',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    8 => shape(\n      'var' => 'prepend',\n      'is_terse' => true,\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    9 => shape(\n      'var' => 'append',\n      'is_terse' => true,\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'assign' => 1,\n    'clear' => 2,\n    'prepend' => 8,\n    'append' => 9,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'assign' => ?string,\n    ?'clear' => ?bool,\n    ?'prepend' => ?string,\n    ?'append' => ?string,\n  );\n\n  const type TShape = shape(\n    ?'assign' => ?string,\n    'clear' => bool,\n    'prepend' => string,\n    'append' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 3833420858319564148;\n  /**\n   * Assigns to a (set) value.\n   * \n   * If set, all other patch operations are ignored.\n   * \n   * Note: Only modifies set field values.\n   * \n   * Original thrift field:-\n   * 1: standard.ByteBuffer assign\n   */\n  public ?string $assign;\n  /**\n   * Clear a given binary.\n   * \n   * Original thrift field:-\n   * 2: bool clear\n   */\n  public bool $clear;\n  /**\n   * Prepend to a given value.\n   * \n   * Original thrift field:-\n   * 8: standard.ByteBuffer prepend\n   */\n  public string $prepend;\n  /**\n   * Append to a given value.\n   * \n   * Original thrift field:-\n   * 9: standard.ByteBuffer append\n   */\n  public string $append;\n\n  public function __construct(?string $assign = null, ?bool $clear = null, ?string $prepend = null, ?string $append = null)[] {\n    $this->assign = $assign;\n    $this->clear = $clear ?? false;\n    $this->prepend = $prepend ?? '';\n    $this->append = $append ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      Shapes::idx($shape, 'clear'),\n      Shapes::idx($shape, 'prepend'),\n      Shapes::idx($shape, 'append'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BinaryPatch';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->clear = false;\n    $this->prepend = '';\n    $this->append = '';\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"patch.BinaryPatch\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"standard.ByteBuffer\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"assign\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"clear\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"standard.ByteBuffer\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"prepend\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"standard.ByteBuffer\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"append\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"::apache::thrift::op::detail::BinaryPatchAdapter<::apache::thrift::op::BinaryPatchStruct>\",\n            \"underlyingName\" => \"BinaryPatchStruct\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'assign' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\java\\Adapter' => \\facebook\\thrift\\annotation\\java\\Adapter::fromShape(\n              shape(\n                \"adapterClassName\" => \"com.facebook.thrift.adapter.common.UnpooledByteBufTypeAdapter\",\n                \"typeClassName\" => \"io.netty.buffer.ByteBuf\",\n              )\n            ),\n          ],\n        ),\n        'prepend' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\java\\Adapter' => \\facebook\\thrift\\annotation\\java\\Adapter::fromShape(\n              shape(\n                \"adapterClassName\" => \"com.facebook.thrift.adapter.common.UnpooledByteBufTypeAdapter\",\n                \"typeClassName\" => \"io.netty.buffer.ByteBuf\",\n              )\n            ),\n          ],\n        ),\n        'append' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\java\\Adapter' => \\facebook\\thrift\\annotation\\java\\Adapter::fromShape(\n              shape(\n                \"adapterClassName\" => \"com.facebook.thrift.adapter.common.UnpooledByteBufTypeAdapter\",\n                \"typeClassName\" => \"io.netty.buffer.ByteBuf\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'assign'),\n      $shape['clear'],\n      $shape['prepend'],\n      $shape['append'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'assign' => $this->assign,\n      'clear' => $this->clear,\n      'prepend' => $this->prepend,\n      'append' => $this->append,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'assign') !== null) {\n      $this->assign = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['assign']);\n    }\n    if (idx($parsed, 'clear') !== null) {\n      $this->clear = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['clear']);\n    }\n    if (idx($parsed, 'prepend') !== null) {\n      $this->prepend = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['prepend']);\n    }\n    if (idx($parsed, 'append') !== null) {\n      $this->append = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['append']);\n    }\n  }\n\n}\n\n", "num_lines": 2238}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1606}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift enum:-\n * Void\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/type/Void'))>>\nenum apache_thrift_type_standard_Void: int {\n  Unused = 0;\n}\n\nclass apache_thrift_type_standard_Void_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"standard.Void\",\n        \"elements\" => dict[\n          0 => \"Unused\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * The standard Thrift protocols.\n * \n * Original thrift enum:-\n * StandardProtocol\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/type/StandardProtocol'))>>\nenum apache_thrift_type_standard_StandardProtocol: int {\n  Custom = 0;\n  Binary = 1;\n  Compact = 2;\n  Json = 3;\n  SimpleJson = 4;\n}\n\nclass apache_thrift_type_standard_StandardProtocol_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"standard.StandardProtocol\",\n        \"elements\" => dict[\n          0 => \"Custom\",\n          1 => \"Binary\",\n          2 => \"Compact\",\n          3 => \"Json\",\n          4 => \"SimpleJson\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\nenum apache_thrift_type_standard_TypeUriEnum: int {\n  _EMPTY_ = 0;\n  uri = 1;\n  typeHashPrefixSha2_256 = 2;\n  scopedName = 3;\n}\n\n/**\n * The uri of an IDL defined type.\n *\n * Original thrift struct:-\n * TypeUri\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/type/TypeUri'))>>\nclass apache_thrift_type_standard_TypeUri implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<apache_thrift_type_standard_TypeUriEnum>, \\IThriftShapishSyncStruct {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'uri',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'typeHashPrefixSha2_256',\n      'union' => true,\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    3 => shape(\n      'var' => 'scopedName',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'uri' => 1,\n    'typeHashPrefixSha2_256' => 2,\n    'scopedName' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'uri' => ?string,\n    ?'typeHashPrefixSha2_256' => ?string,\n    ?'scopedName' => ?string,\n  );\n\n  const type TShape = shape(\n    ?'uri' => ?string,\n    ?'typeHashPrefixSha2_256' => ?string,\n    ?'scopedName' => ?string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2998943141803441214;\n  /**\n   * The unique Thrift URI for this type.\n   * \n   * Original thrift field:-\n   * 1: standard.Uri uri\n   */\n  public ?string $uri;\n  /**\n   * A prefix of the SHA2-256 hash of the URI.\n   * \n   * Original thrift field:-\n   * 2: standard.ByteString typeHashPrefixSha2_256\n   */\n  public ?string $typeHashPrefixSha2_256;\n  /**\n   * The (potentially not unique) scoped name of this type.\n   * Format is `filename.typename`, e.g. `standard.TypeUri`.\n   * This is a fallback for types that do not have URIs yet.\n   * Must be prepared for the active field to switch to `uri` as package statements are rolled out!\n   * \n   * Original thrift field:-\n   * 3: string scopedName\n   */\n  public ?string $scopedName;\n  protected apache_thrift_type_standard_TypeUriEnum $_type = apache_thrift_type_standard_TypeUriEnum::_EMPTY_;\n\n  public function __construct(?string $uri = null, ?string $typeHashPrefixSha2_256 = null, ?string $scopedName = null)[] {\n    $this->_type = apache_thrift_type_standard_TypeUriEnum::_EMPTY_;\n    if ($uri !== null) {\n      $this->uri = $uri;\n      $this->_type = apache_thrift_type_standard_TypeUriEnum::uri;\n    }\n    if ($typeHashPrefixSha2_256 !== null) {\n      $this->typeHashPrefixSha2_256 = $typeHashPrefixSha2_256;\n      $this->_type = apache_thrift_type_standard_TypeUriEnum::typeHashPrefixSha2_256;\n    }\n    if ($scopedName !== null) {\n      $this->scopedName = $scopedName;\n      $this->_type = apache_thrift_type_standard_TypeUriEnum::scopedName;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'uri'),\n      Shapes::idx($shape, 'typeHashPrefixSha2_256'),\n      Shapes::idx($shape, 'scopedName'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TypeUri';\n  }\n\n  public function getType()[]: apache_thrift_type_standard_TypeUriEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case apache_thrift_type_standard_TypeUriEnum::uri:\n        $this->uri = null;\n        break;\n      case apache_thrift_type_standard_TypeUriEnum::typeHashPrefixSha2_256:\n        $this->typeHashPrefixSha2_256 = null;\n        break;\n      case apache_thrift_type_standard_TypeUriEnum::scopedName:\n        $this->scopedName = null;\n        break;\n      case apache_thrift_type_standard_TypeUriEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = apache_thrift_type_standard_TypeUriEnum::_EMPTY_;\n  }\n\n  public function set_uri(string $uri)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeUriEnum::uri;\n    $this->uri = $uri;\n    return $this;\n  }\n\n  public function get_uri()[]: ?string {\n    return $this->uri;\n  }\n\n  public function getx_uri()[]: string {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeUriEnum::uri,\n      'get_uri called on an instance of TypeUri whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->uri as nonnull;\n  }\n\n  public function set_typeHashPrefixSha2_256(string $typeHashPrefixSha2_256)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeUriEnum::typeHashPrefixSha2_256;\n    $this->typeHashPrefixSha2_256 = $typeHashPrefixSha2_256;\n    return $this;\n  }\n\n  public function get_typeHashPrefixSha2_256()[]: ?string {\n    return $this->typeHashPrefixSha2_256;\n  }\n\n  public function getx_typeHashPrefixSha2_256()[]: string {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeUriEnum::typeHashPrefixSha2_256,\n      'get_typeHashPrefixSha2_256 called on an instance of TypeUri whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->typeHashPrefixSha2_256 as nonnull;\n  }\n\n  public function set_scopedName(string $scopedName)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeUriEnum::scopedName;\n    $this->scopedName = $scopedName;\n    return $this;\n  }\n\n  public function get_scopedName()[]: ?string {\n    return $this->scopedName;\n  }\n\n  public function getx_scopedName()[]: string {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeUriEnum::scopedName,\n      'get_scopedName called on an instance of TypeUri whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->scopedName as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"standard.TypeUri\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"standard.Uri\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"uri\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"standard.ByteString\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"typeHashPrefixSha2_256\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"scopedName\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'uri' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n              shape(\n              )\n            ),\n          ],\n        ),\n        'typeHashPrefixSha2_256' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\java\\Adapter' => \\facebook\\thrift\\annotation\\java\\Adapter::fromShape(\n              shape(\n                \"adapterClassName\" => \"com.facebook.thrift.adapter.common.UnpooledByteBufTypeAdapter\",\n                \"typeClassName\" => \"io.netty.buffer.ByteBuf\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'uri'),\n      Shapes::idx($shape, 'typeHashPrefixSha2_256'),\n      Shapes::idx($shape, 'scopedName'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'uri' => $this->uri,\n      'typeHashPrefixSha2_256' => $this->typeHashPrefixSha2_256,\n      'scopedName' => $this->scopedName,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = apache_thrift_type_standard_TypeUriEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'uri') !== null) {\n      $this->uri = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['uri']);\n      $this->_type = apache_thrift_type_standard_TypeUriEnum::uri;\n    }\n    if (idx($parsed, 'typeHashPrefixSha2_256') !== null) {\n      $this->typeHashPrefixSha2_256 = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['typeHashPrefixSha2_256']);\n      $this->_type = apache_thrift_type_standard_TypeUriEnum::typeHashPrefixSha2_256;\n    }\n    if (idx($parsed, 'scopedName') !== null) {\n      $this->scopedName = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['scopedName']);\n      $this->_type = apache_thrift_type_standard_TypeUriEnum::scopedName;\n    }\n  }\n\n}\n\nenum apache_thrift_type_standard_TypeNameEnum: int {\n  _EMPTY_ = 0;\n  boolType = 1;\n  byteType = 2;\n  i16Type = 3;\n  i32Type = 4;\n  i64Type = 5;\n  floatType = 6;\n  doubleType = 7;\n  stringType = 8;\n  binaryType = 9;\n  enumType = 10;\n  typedefType = 17;\n  structType = 11;\n  unionType = 12;\n  exceptionType = 13;\n  listType = 14;\n  setType = 15;\n  mapType = 16;\n}\n\n/**\n * Uniquely identifies a Thrift type.\n *\n * Original thrift struct:-\n * TypeName\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/type/TypeName'))>>\nclass apache_thrift_type_standard_TypeName implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<apache_thrift_type_standard_TypeNameEnum>, \\IThriftShapishSyncStruct {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'boolType',\n      'union' => true,\n      'type' => \\TType::I32,\n      'enum' => apache_thrift_type_standard_Void::class,\n    ),\n    2 => shape(\n      'var' => 'byteType',\n      'union' => true,\n      'type' => \\TType::I32,\n      'enum' => apache_thrift_type_standard_Void::class,\n    ),\n    3 => shape(\n      'var' => 'i16Type',\n      'union' => true,\n      'type' => \\TType::I32,\n      'enum' => apache_thrift_type_standard_Void::class,\n    ),\n    4 => shape(\n      'var' => 'i32Type',\n      'union' => true,\n      'type' => \\TType::I32,\n      'enum' => apache_thrift_type_standard_Void::class,\n    ),\n    5 => shape(\n      'var' => 'i64Type',\n      'union' => true,\n      'type' => \\TType::I32,\n      'enum' => apache_thrift_type_standard_Void::class,\n    ),\n    6 => shape(\n      'var' => 'floatType',\n      'union' => true,\n      'type' => \\TType::I32,\n      'enum' => apache_thrift_type_standard_Void::class,\n    ),\n    7 => shape(\n      'var' => 'doubleType',\n      'union' => true,\n      'type' => \\TType::I32,\n      'enum' => apache_thrift_type_standard_Void::class,\n    ),\n    8 => shape(\n      'var' => 'stringType',\n      'union' => true,\n      'type' => \\TType::I32,\n      'enum' => apache_thrift_type_standard_Void::class,\n    ),\n    9 => shape(\n      'var' => 'binaryType',\n      'union' => true,\n      'type' => \\TType::I32,\n      'enum' => apache_thrift_type_standard_Void::class,\n    ),\n    10 => shape(\n      'var' => 'enumType',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => apache_thrift_type_standard_TypeUri::class,\n    ),\n    17 => shape(\n      'var' => 'typedefType',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => apache_thrift_type_standard_TypeUri::class,\n    ),\n    11 => shape(\n      'var' => 'structType',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => apache_thrift_type_standard_TypeUri::class,\n    ),\n    12 => shape(\n      'var' => 'unionType',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => apache_thrift_type_standard_TypeUri::class,\n    ),\n    13 => shape(\n      'var' => 'exceptionType',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => apache_thrift_type_standard_TypeUri::class,\n    ),\n    14 => shape(\n      'var' => 'listType',\n      'union' => true,\n      'type' => \\TType::I32,\n      'enum' => apache_thrift_type_standard_Void::class,\n    ),\n    15 => shape(\n      'var' => 'setType',\n      'union' => true,\n      'type' => \\TType::I32,\n      'enum' => apache_thrift_type_standard_Void::class,\n    ),\n    16 => shape(\n      'var' => 'mapType',\n      'union' => true,\n      'type' => \\TType::I32,\n      'enum' => apache_thrift_type_standard_Void::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'boolType' => 1,\n    'byteType' => 2,\n    'i16Type' => 3,\n    'i32Type' => 4,\n    'i64Type' => 5,\n    'floatType' => 6,\n    'doubleType' => 7,\n    'stringType' => 8,\n    'binaryType' => 9,\n    'enumType' => 10,\n    'typedefType' => 17,\n    'structType' => 11,\n    'unionType' => 12,\n    'exceptionType' => 13,\n    'listType' => 14,\n    'setType' => 15,\n    'mapType' => 16,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'boolType' => ?apache_thrift_type_standard_Void,\n    ?'byteType' => ?apache_thrift_type_standard_Void,\n    ?'i16Type' => ?apache_thrift_type_standard_Void,\n    ?'i32Type' => ?apache_thrift_type_standard_Void,\n    ?'i64Type' => ?apache_thrift_type_standard_Void,\n    ?'floatType' => ?apache_thrift_type_standard_Void,\n    ?'doubleType' => ?apache_thrift_type_standard_Void,\n    ?'stringType' => ?apache_thrift_type_standard_Void,\n    ?'binaryType' => ?apache_thrift_type_standard_Void,\n    ?'enumType' => ?apache_thrift_type_standard_TypeUri,\n    ?'typedefType' => ?apache_thrift_type_standard_TypeUri,\n    ?'structType' => ?apache_thrift_type_standard_TypeUri,\n    ?'unionType' => ?apache_thrift_type_standard_TypeUri,\n    ?'exceptionType' => ?apache_thrift_type_standard_TypeUri,\n    ?'listType' => ?apache_thrift_type_standard_Void,\n    ?'setType' => ?apache_thrift_type_standard_Void,\n    ?'mapType' => ?apache_thrift_type_standard_Void,\n  );\n\n  const type TShape = shape(\n    ?'boolType' => ?apache_thrift_type_standard_Void,\n    ?'byteType' => ?apache_thrift_type_standard_Void,\n    ?'i16Type' => ?apache_thrift_type_standard_Void,\n    ?'i32Type' => ?apache_thrift_type_standard_Void,\n    ?'i64Type' => ?apache_thrift_type_standard_Void,\n    ?'floatType' => ?apache_thrift_type_standard_Void,\n    ?'doubleType' => ?apache_thrift_type_standard_Void,\n    ?'stringType' => ?apache_thrift_type_standard_Void,\n    ?'binaryType' => ?apache_thrift_type_standard_Void,\n    ?'enumType' => ?apache_thrift_type_standard_TypeUri::TShape,\n    ?'typedefType' => ?apache_thrift_type_standard_TypeUri::TShape,\n    ?'structType' => ?apache_thrift_type_standard_TypeUri::TShape,\n    ?'unionType' => ?apache_thrift_type_standard_TypeUri::TShape,\n    ?'exceptionType' => ?apache_thrift_type_standard_TypeUri::TShape,\n    ?'listType' => ?apache_thrift_type_standard_Void,\n    ?'setType' => ?apache_thrift_type_standard_Void,\n    ?'mapType' => ?apache_thrift_type_standard_Void,\n    ...\n  );\n  const int STRUCTURAL_ID = 2966511906547332991;\n  /**\n   * True(1) or False(0)\n   * \n   * Original thrift field:-\n   * 1: standard.Void boolType\n   */\n  public ?apache_thrift_type_standard_Void $boolType;\n  /**\n   * 8-bit signed integer\n   * \n   * Original thrift field:-\n   * 2: standard.Void byteType\n   */\n  public ?apache_thrift_type_standard_Void $byteType;\n  /**\n   * 16-bit signed integer\n   * \n   * Original thrift field:-\n   * 3: standard.Void i16Type\n   */\n  public ?apache_thrift_type_standard_Void $i16Type;\n  /**\n   * 32-bit signed integer\n   * \n   * Original thrift field:-\n   * 4: standard.Void i32Type\n   */\n  public ?apache_thrift_type_standard_Void $i32Type;\n  /**\n   * 64-bit signed integer\n   * \n   * Original thrift field:-\n   * 5: standard.Void i64Type\n   */\n  public ?apache_thrift_type_standard_Void $i64Type;\n  /**\n   * 32-bit floating point\n   * \n   * Original thrift field:-\n   * 6: standard.Void floatType\n   */\n  public ?apache_thrift_type_standard_Void $floatType;\n  /**\n   * 64-bit floating point\n   * \n   * Original thrift field:-\n   * 7: standard.Void doubleType\n   */\n  public ?apache_thrift_type_standard_Void $doubleType;\n  /**\n   * UTF-8 encoded string\n   * \n   * Original thrift field:-\n   * 8: standard.Void stringType\n   */\n  public ?apache_thrift_type_standard_Void $stringType;\n  /**\n   * Arbitrary byte string\n   * \n   * Original thrift field:-\n   * 9: standard.Void binaryType\n   */\n  public ?apache_thrift_type_standard_Void $binaryType;\n  /**\n   * 32-bit signed integer, with named values.\n   * \n   * Original thrift field:-\n   * 10: standard.TypeUri enumType\n   */\n  public ?apache_thrift_type_standard_TypeUri $enumType;\n  /**\n   * `typedef` definition\n   * \n   * Original thrift field:-\n   * 17: standard.TypeUri typedefType\n   */\n  public ?apache_thrift_type_standard_TypeUri $typedefType;\n  /**\n   * `struct` definition\n   * \n   * Original thrift field:-\n   * 11: standard.TypeUri structType\n   */\n  public ?apache_thrift_type_standard_TypeUri $structType;\n  /**\n   * `union` definition\n   * \n   * Original thrift field:-\n   * 12: standard.TypeUri unionType\n   */\n  public ?apache_thrift_type_standard_TypeUri $unionType;\n  /**\n   * `exception` definition\n   * \n   * Original thrift field:-\n   * 13: standard.TypeUri exceptionType\n   */\n  public ?apache_thrift_type_standard_TypeUri $exceptionType;\n  /**\n   * `list<V>` definition\n   * \n   * Original thrift field:-\n   * 14: standard.Void listType\n   */\n  public ?apache_thrift_type_standard_Void $listType;\n  /**\n   * `set<K>` definition\n   * \n   * Original thrift field:-\n   * 15: standard.Void setType\n   */\n  public ?apache_thrift_type_standard_Void $setType;\n  /**\n   * `map<K, V>` definition\n   * \n   * Original thrift field:-\n   * 16: standard.Void mapType\n   */\n  public ?apache_thrift_type_standard_Void $mapType;\n  protected apache_thrift_type_standard_TypeNameEnum $_type = apache_thrift_type_standard_TypeNameEnum::_EMPTY_;\n\n  public function __construct(?apache_thrift_type_standard_Void $boolType = null, ?apache_thrift_type_standard_Void $byteType = null, ?apache_thrift_type_standard_Void $i16Type = null, ?apache_thrift_type_standard_Void $i32Type = null, ?apache_thrift_type_standard_Void $i64Type = null, ?apache_thrift_type_standard_Void $floatType = null, ?apache_thrift_type_standard_Void $doubleType = null, ?apache_thrift_type_standard_Void $stringType = null, ?apache_thrift_type_standard_Void $binaryType = null, ?apache_thrift_type_standard_TypeUri $enumType = null, ?apache_thrift_type_standard_TypeUri $typedefType = null, ?apache_thrift_type_standard_TypeUri $structType = null, ?apache_thrift_type_standard_TypeUri $unionType = null, ?apache_thrift_type_standard_TypeUri $exceptionType = null, ?apache_thrift_type_standard_Void $listType = null, ?apache_thrift_type_standard_Void $setType = null, ?apache_thrift_type_standard_Void $mapType = null)[] {\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::_EMPTY_;\n    if ($boolType !== null) {\n      $this->boolType = $boolType;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::boolType;\n    }\n    if ($byteType !== null) {\n      $this->byteType = $byteType;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::byteType;\n    }\n    if ($i16Type !== null) {\n      $this->i16Type = $i16Type;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::i16Type;\n    }\n    if ($i32Type !== null) {\n      $this->i32Type = $i32Type;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::i32Type;\n    }\n    if ($i64Type !== null) {\n      $this->i64Type = $i64Type;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::i64Type;\n    }\n    if ($floatType !== null) {\n      $this->floatType = $floatType;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::floatType;\n    }\n    if ($doubleType !== null) {\n      $this->doubleType = $doubleType;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::doubleType;\n    }\n    if ($stringType !== null) {\n      $this->stringType = $stringType;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::stringType;\n    }\n    if ($binaryType !== null) {\n      $this->binaryType = $binaryType;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::binaryType;\n    }\n    if ($enumType !== null) {\n      $this->enumType = $enumType;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::enumType;\n    }\n    if ($typedefType !== null) {\n      $this->typedefType = $typedefType;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::typedefType;\n    }\n    if ($structType !== null) {\n      $this->structType = $structType;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::structType;\n    }\n    if ($unionType !== null) {\n      $this->unionType = $unionType;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::unionType;\n    }\n    if ($exceptionType !== null) {\n      $this->exceptionType = $exceptionType;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::exceptionType;\n    }\n    if ($listType !== null) {\n      $this->listType = $listType;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::listType;\n    }\n    if ($setType !== null) {\n      $this->setType = $setType;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::setType;\n    }\n    if ($mapType !== null) {\n      $this->mapType = $mapType;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::mapType;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'boolType'),\n      Shapes::idx($shape, 'byteType'),\n      Shapes::idx($shape, 'i16Type'),\n      Shapes::idx($shape, 'i32Type'),\n      Shapes::idx($shape, 'i64Type'),\n      Shapes::idx($shape, 'floatType'),\n      Shapes::idx($shape, 'doubleType'),\n      Shapes::idx($shape, 'stringType'),\n      Shapes::idx($shape, 'binaryType'),\n      Shapes::idx($shape, 'enumType'),\n      Shapes::idx($shape, 'typedefType'),\n      Shapes::idx($shape, 'structType'),\n      Shapes::idx($shape, 'unionType'),\n      Shapes::idx($shape, 'exceptionType'),\n      Shapes::idx($shape, 'listType'),\n      Shapes::idx($shape, 'setType'),\n      Shapes::idx($shape, 'mapType'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TypeName';\n  }\n\n  public function getType()[]: apache_thrift_type_standard_TypeNameEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case apache_thrift_type_standard_TypeNameEnum::boolType:\n        $this->boolType = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::byteType:\n        $this->byteType = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::i16Type:\n        $this->i16Type = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::i32Type:\n        $this->i32Type = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::i64Type:\n        $this->i64Type = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::floatType:\n        $this->floatType = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::doubleType:\n        $this->doubleType = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::stringType:\n        $this->stringType = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::binaryType:\n        $this->binaryType = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::enumType:\n        $this->enumType = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::typedefType:\n        $this->typedefType = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::structType:\n        $this->structType = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::unionType:\n        $this->unionType = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::exceptionType:\n        $this->exceptionType = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::listType:\n        $this->listType = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::setType:\n        $this->setType = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::mapType:\n        $this->mapType = null;\n        break;\n      case apache_thrift_type_standard_TypeNameEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::_EMPTY_;\n  }\n\n  public function set_boolType(apache_thrift_type_standard_Void $boolType)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::boolType;\n    $this->boolType = $boolType;\n    return $this;\n  }\n\n  public function get_boolType()[]: ?apache_thrift_type_standard_Void {\n    return $this->boolType;\n  }\n\n  public function getx_boolType()[]: apache_thrift_type_standard_Void {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::boolType,\n      'get_boolType called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->boolType as nonnull;\n  }\n\n  public function set_byteType(apache_thrift_type_standard_Void $byteType)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::byteType;\n    $this->byteType = $byteType;\n    return $this;\n  }\n\n  public function get_byteType()[]: ?apache_thrift_type_standard_Void {\n    return $this->byteType;\n  }\n\n  public function getx_byteType()[]: apache_thrift_type_standard_Void {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::byteType,\n      'get_byteType called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->byteType as nonnull;\n  }\n\n  public function set_i16Type(apache_thrift_type_standard_Void $i16Type)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::i16Type;\n    $this->i16Type = $i16Type;\n    return $this;\n  }\n\n  public function get_i16Type()[]: ?apache_thrift_type_standard_Void {\n    return $this->i16Type;\n  }\n\n  public function getx_i16Type()[]: apache_thrift_type_standard_Void {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::i16Type,\n      'get_i16Type called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->i16Type as nonnull;\n  }\n\n  public function set_i32Type(apache_thrift_type_standard_Void $i32Type)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::i32Type;\n    $this->i32Type = $i32Type;\n    return $this;\n  }\n\n  public function get_i32Type()[]: ?apache_thrift_type_standard_Void {\n    return $this->i32Type;\n  }\n\n  public function getx_i32Type()[]: apache_thrift_type_standard_Void {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::i32Type,\n      'get_i32Type called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->i32Type as nonnull;\n  }\n\n  public function set_i64Type(apache_thrift_type_standard_Void $i64Type)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::i64Type;\n    $this->i64Type = $i64Type;\n    return $this;\n  }\n\n  public function get_i64Type()[]: ?apache_thrift_type_standard_Void {\n    return $this->i64Type;\n  }\n\n  public function getx_i64Type()[]: apache_thrift_type_standard_Void {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::i64Type,\n      'get_i64Type called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->i64Type as nonnull;\n  }\n\n  public function set_floatType(apache_thrift_type_standard_Void $floatType)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::floatType;\n    $this->floatType = $floatType;\n    return $this;\n  }\n\n  public function get_floatType()[]: ?apache_thrift_type_standard_Void {\n    return $this->floatType;\n  }\n\n  public function getx_floatType()[]: apache_thrift_type_standard_Void {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::floatType,\n      'get_floatType called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->floatType as nonnull;\n  }\n\n  public function set_doubleType(apache_thrift_type_standard_Void $doubleType)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::doubleType;\n    $this->doubleType = $doubleType;\n    return $this;\n  }\n\n  public function get_doubleType()[]: ?apache_thrift_type_standard_Void {\n    return $this->doubleType;\n  }\n\n  public function getx_doubleType()[]: apache_thrift_type_standard_Void {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::doubleType,\n      'get_doubleType called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->doubleType as nonnull;\n  }\n\n  public function set_stringType(apache_thrift_type_standard_Void $stringType)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::stringType;\n    $this->stringType = $stringType;\n    return $this;\n  }\n\n  public function get_stringType()[]: ?apache_thrift_type_standard_Void {\n    return $this->stringType;\n  }\n\n  public function getx_stringType()[]: apache_thrift_type_standard_Void {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::stringType,\n      'get_stringType called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->stringType as nonnull;\n  }\n\n  public function set_binaryType(apache_thrift_type_standard_Void $binaryType)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::binaryType;\n    $this->binaryType = $binaryType;\n    return $this;\n  }\n\n  public function get_binaryType()[]: ?apache_thrift_type_standard_Void {\n    return $this->binaryType;\n  }\n\n  public function getx_binaryType()[]: apache_thrift_type_standard_Void {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::binaryType,\n      'get_binaryType called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->binaryType as nonnull;\n  }\n\n  public function set_enumType(apache_thrift_type_standard_TypeUri $enumType)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::enumType;\n    $this->enumType = $enumType;\n    return $this;\n  }\n\n  public function get_enumType()[]: ?apache_thrift_type_standard_TypeUri {\n    return $this->enumType;\n  }\n\n  public function getx_enumType()[]: apache_thrift_type_standard_TypeUri {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::enumType,\n      'get_enumType called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->enumType as nonnull;\n  }\n\n  public function set_typedefType(apache_thrift_type_standard_TypeUri $typedefType)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::typedefType;\n    $this->typedefType = $typedefType;\n    return $this;\n  }\n\n  public function get_typedefType()[]: ?apache_thrift_type_standard_TypeUri {\n    return $this->typedefType;\n  }\n\n  public function getx_typedefType()[]: apache_thrift_type_standard_TypeUri {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::typedefType,\n      'get_typedefType called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->typedefType as nonnull;\n  }\n\n  public function set_structType(apache_thrift_type_standard_TypeUri $structType)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::structType;\n    $this->structType = $structType;\n    return $this;\n  }\n\n  public function get_structType()[]: ?apache_thrift_type_standard_TypeUri {\n    return $this->structType;\n  }\n\n  public function getx_structType()[]: apache_thrift_type_standard_TypeUri {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::structType,\n      'get_structType called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->structType as nonnull;\n  }\n\n  public function set_unionType(apache_thrift_type_standard_TypeUri $unionType)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::unionType;\n    $this->unionType = $unionType;\n    return $this;\n  }\n\n  public function get_unionType()[]: ?apache_thrift_type_standard_TypeUri {\n    return $this->unionType;\n  }\n\n  public function getx_unionType()[]: apache_thrift_type_standard_TypeUri {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::unionType,\n      'get_unionType called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->unionType as nonnull;\n  }\n\n  public function set_exceptionType(apache_thrift_type_standard_TypeUri $exceptionType)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::exceptionType;\n    $this->exceptionType = $exceptionType;\n    return $this;\n  }\n\n  public function get_exceptionType()[]: ?apache_thrift_type_standard_TypeUri {\n    return $this->exceptionType;\n  }\n\n  public function getx_exceptionType()[]: apache_thrift_type_standard_TypeUri {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::exceptionType,\n      'get_exceptionType called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->exceptionType as nonnull;\n  }\n\n  public function set_listType(apache_thrift_type_standard_Void $listType)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::listType;\n    $this->listType = $listType;\n    return $this;\n  }\n\n  public function get_listType()[]: ?apache_thrift_type_standard_Void {\n    return $this->listType;\n  }\n\n  public function getx_listType()[]: apache_thrift_type_standard_Void {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::listType,\n      'get_listType called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->listType as nonnull;\n  }\n\n  public function set_setType(apache_thrift_type_standard_Void $setType)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::setType;\n    $this->setType = $setType;\n    return $this;\n  }\n\n  public function get_setType()[]: ?apache_thrift_type_standard_Void {\n    return $this->setType;\n  }\n\n  public function getx_setType()[]: apache_thrift_type_standard_Void {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::setType,\n      'get_setType called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->setType as nonnull;\n  }\n\n  public function set_mapType(apache_thrift_type_standard_Void $mapType)[write_props]: this {\n    $this->reset();\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::mapType;\n    $this->mapType = $mapType;\n    return $this;\n  }\n\n  public function get_mapType()[]: ?apache_thrift_type_standard_Void {\n    return $this->mapType;\n  }\n\n  public function getx_mapType()[]: apache_thrift_type_standard_Void {\n    invariant(\n      $this->_type === apache_thrift_type_standard_TypeNameEnum::mapType,\n      'get_mapType called on an instance of TypeName whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->mapType as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"standard.TypeName\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"standard.Void\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"boolType\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"standard.Void\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"byteType\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"standard.Void\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"i16Type\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"standard.Void\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"i32Type\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"standard.Void\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"i64Type\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"standard.Void\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"floatType\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"standard.Void\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"doubleType\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"standard.Void\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"stringType\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"standard.Void\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"binaryType\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 10,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"standard.TypeUri\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"enumType\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 17,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"standard.TypeUri\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"typedefType\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 11,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"standard.TypeUri\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"structType\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 12,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"standard.TypeUri\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"unionType\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 13,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"standard.TypeUri\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"exceptionType\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 14,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"standard.Void\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"listType\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 15,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"standard.Void\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"setType\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 16,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"standard.Void\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"mapType\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'boolType'),\n      Shapes::idx($shape, 'byteType'),\n      Shapes::idx($shape, 'i16Type'),\n      Shapes::idx($shape, 'i32Type'),\n      Shapes::idx($shape, 'i64Type'),\n      Shapes::idx($shape, 'floatType'),\n      Shapes::idx($shape, 'doubleType'),\n      Shapes::idx($shape, 'stringType'),\n      Shapes::idx($shape, 'binaryType'),\n      Shapes::idx($shape, 'enumType') === null ? null : (apache_thrift_type_standard_TypeUri::__fromShape($shape['enumType'])),\n      Shapes::idx($shape, 'typedefType') === null ? null : (apache_thrift_type_standard_TypeUri::__fromShape($shape['typedefType'])),\n      Shapes::idx($shape, 'structType') === null ? null : (apache_thrift_type_standard_TypeUri::__fromShape($shape['structType'])),\n      Shapes::idx($shape, 'unionType') === null ? null : (apache_thrift_type_standard_TypeUri::__fromShape($shape['unionType'])),\n      Shapes::idx($shape, 'exceptionType') === null ? null : (apache_thrift_type_standard_TypeUri::__fromShape($shape['exceptionType'])),\n      Shapes::idx($shape, 'listType'),\n      Shapes::idx($shape, 'setType'),\n      Shapes::idx($shape, 'mapType'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'boolType' => $this->boolType,\n      'byteType' => $this->byteType,\n      'i16Type' => $this->i16Type,\n      'i32Type' => $this->i32Type,\n      'i64Type' => $this->i64Type,\n      'floatType' => $this->floatType,\n      'doubleType' => $this->doubleType,\n      'stringType' => $this->stringType,\n      'binaryType' => $this->binaryType,\n      'enumType' => $this->enumType?->__toShape(),\n      'typedefType' => $this->typedefType?->__toShape(),\n      'structType' => $this->structType?->__toShape(),\n      'unionType' => $this->unionType?->__toShape(),\n      'exceptionType' => $this->exceptionType?->__toShape(),\n      'listType' => $this->listType,\n      'setType' => $this->setType,\n      'mapType' => $this->mapType,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = apache_thrift_type_standard_TypeNameEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'boolType') !== null) {\n      $this->boolType = apache_thrift_type_standard_Void::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['boolType']));\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::boolType;\n    }\n    if (idx($parsed, 'byteType') !== null) {\n      $this->byteType = apache_thrift_type_standard_Void::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['byteType']));\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::byteType;\n    }\n    if (idx($parsed, 'i16Type') !== null) {\n      $this->i16Type = apache_thrift_type_standard_Void::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['i16Type']));\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::i16Type;\n    }\n    if (idx($parsed, 'i32Type') !== null) {\n      $this->i32Type = apache_thrift_type_standard_Void::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['i32Type']));\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::i32Type;\n    }\n    if (idx($parsed, 'i64Type') !== null) {\n      $this->i64Type = apache_thrift_type_standard_Void::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['i64Type']));\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::i64Type;\n    }\n    if (idx($parsed, 'floatType') !== null) {\n      $this->floatType = apache_thrift_type_standard_Void::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['floatType']));\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::floatType;\n    }\n    if (idx($parsed, 'doubleType') !== null) {\n      $this->doubleType = apache_thrift_type_standard_Void::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['doubleType']));\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::doubleType;\n    }\n    if (idx($parsed, 'stringType') !== null) {\n      $this->stringType = apache_thrift_type_standard_Void::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['stringType']));\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::stringType;\n    }\n    if (idx($parsed, 'binaryType') !== null) {\n      $this->binaryType = apache_thrift_type_standard_Void::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['binaryType']));\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::binaryType;\n    }\n    if (idx($parsed, 'enumType') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_TypeUri>($parsed['enumType']));\n      $_tmp1 = apache_thrift_type_standard_TypeUri::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->enumType = $_tmp1;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::enumType;\n    }\n    if (idx($parsed, 'typedefType') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_TypeUri>($parsed['typedefType']));\n      $_tmp3 = apache_thrift_type_standard_TypeUri::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->typedefType = $_tmp3;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::typedefType;\n    }\n    if (idx($parsed, 'structType') !== null) {\n      $_tmp4 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_TypeUri>($parsed['structType']));\n      $_tmp5 = apache_thrift_type_standard_TypeUri::withDefaultValues();\n      $_tmp5->readFromJson($_tmp4);\n      $this->structType = $_tmp5;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::structType;\n    }\n    if (idx($parsed, 'unionType') !== null) {\n      $_tmp6 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_TypeUri>($parsed['unionType']));\n      $_tmp7 = apache_thrift_type_standard_TypeUri::withDefaultValues();\n      $_tmp7->readFromJson($_tmp6);\n      $this->unionType = $_tmp7;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::unionType;\n    }\n    if (idx($parsed, 'exceptionType') !== null) {\n      $_tmp8 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_TypeUri>($parsed['exceptionType']));\n      $_tmp9 = apache_thrift_type_standard_TypeUri::withDefaultValues();\n      $_tmp9->readFromJson($_tmp8);\n      $this->exceptionType = $_tmp9;\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::exceptionType;\n    }\n    if (idx($parsed, 'listType') !== null) {\n      $this->listType = apache_thrift_type_standard_Void::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['listType']));\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::listType;\n    }\n    if (idx($parsed, 'setType') !== null) {\n      $this->setType = apache_thrift_type_standard_Void::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['setType']));\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::setType;\n    }\n    if (idx($parsed, 'mapType') !== null) {\n      $this->mapType = apache_thrift_type_standard_Void::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['mapType']));\n      $this->_type = apache_thrift_type_standard_TypeNameEnum::mapType;\n    }\n  }\n\n}\n\n", "num_lines": 1649}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates a definition/feature may change in incompatible ways.\n *\n * Original thrift struct:-\n * Beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Beta'))>>\nclass Beta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used with permission, may\n * only work in specific contexts, and may change in incompatible ways without\n * notice.\n *\n * Original thrift struct:-\n * Experimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Experimental'))>>\nclass Experimental implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Experimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Experimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used in an ephemeral testing\n * enviornment.\n * \n * Such enviornments only store serialized values temporarly and strictly\n * control which versions of Thrift definitions are used, so 'compatibility'\n * is not a concern.\n *\n * Original thrift struct:-\n * Testing\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Testing'))>>\nclass Testing implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Testing';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Testing\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should no longer be used.\n *\n * Original thrift struct:-\n * Deprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Deprecated'))>>\nclass Deprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const type TShape = shape(\n    'message' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2427562471238739676;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Deprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Deprecated\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['message'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'message' => $this->message,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'message') !== null) {\n      $this->message = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['message']);\n    }\n  }\n\n}\n\n/**\n * Annotate a thrift structured or enum to indicate if ids or values should not\n * be used.\n * \n * For example, you may want to mark ids as deprecated, or these ids\n * might be reserved for other use cases or annotations.\n * \n * The resolved set of disallowed ids is the union of the values in `ids` and\n * the range of values represented in `id_ranges`. Example:\n * \n *  // These ids are not allowed: 3, 8, half-open ranges [10, 15), [20, 30)\n *  @thrift.ReserveIds{ids = [3, 8], id_ranges = {10: 15, 20: 30}}\n *  struct Foo {\n *    ...\n *    3: i64 f; // Build failure: 3 cannot be used\n *  }\n *\n * Original thrift struct:-\n * ReserveIds\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ReserveIds'))>>\nclass ReserveIds implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ids',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'id_ranges',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ids' => 1,\n    'id_ranges' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ids' => ?Vector<int>,\n    ?'id_ranges' => ?Map<int, int>,\n  );\n\n  const type TShape = shape(\n    'ids' => vec<int>,\n    'id_ranges' => dict<int, int>,\n    ...\n  );\n  const int STRUCTURAL_ID = 4105998268635615653;\n  /**\n   * Individual ids that cannot be used.\n   * \n   * Original thrift field:-\n   * 1: list<i32> ids\n   */\n  public Vector<int> $ids;\n  /**\n   * Represents ranges of ids that cannot be used.\n   * \n   * Each (key: value) pair represents the half-open range `[key, value)`,\n   * where `key` is included and `value` is not. For example, the map\n   * `{10: 15, 20: 30}` represents the union of id/value ranges `[10, 15)` and\n   * `[20, 30)`.\n   * \n   * Original thrift field:-\n   * 2: map<i32, i32> id_ranges\n   */\n  public Map<int, int> $id_ranges;\n\n  public function __construct(?Vector<int> $ids = null, ?Map<int, int> $id_ranges = null)[] {\n    $this->ids = $ids ?? Vector {};\n    $this->id_ranges = $id_ranges ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ids'),\n      Shapes::idx($shape, 'id_ranges'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ReserveIds';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ReserveIds\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ids\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"id_ranges\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['ids'] |> new Vector($$),\n      $shape['id_ranges'] |> new Map($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'ids' => vec($this->ids),\n      'id_ranges' => dict($this->id_ranges),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'ids') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['ids']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = 0;\n        $_tmp6 = (int)$_value2;\n        if ($_tmp6 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem5 = (int)$_tmp6;\n        }\n        $_container4 []= $_elem5;\n      }\n      $this->ids = $_container4;\n    }\n    if (idx($parsed, 'id_ranges') !== null) {\n      $_json10 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, int>>($parsed['id_ranges']);\n      $_container11 = Map {};\n      foreach($_json10 as $_key8 => $_value9) {\n        $_value12 = 0;\n        $_tmp13 = (int)$_value9;\n        if ($_tmp13 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value12 = (int)$_tmp13;\n        }\n        $_container11[$_key8] = $_value12;\n      }\n      $this->id_ranges = $_container11;\n    }\n  }\n\n}\n\n/**\n * Indicates additional backward compatibility restrictions, beyond the\n * standard Thrift required 'wire' compatibility.\n *\n * Original thrift struct:-\n * RequiresBackwardCompatibility\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RequiresBackwardCompatibility'))>>\nclass RequiresBackwardCompatibility implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field_name',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field_name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field_name' => ?bool,\n  );\n\n  const type TShape = shape(\n    'field_name' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 4755373036761315562;\n  /**\n   * Original thrift field:-\n   * 1: bool field_name\n   */\n  public bool $field_name;\n\n  public function __construct(?bool $field_name = null)[] {\n    $this->field_name = $field_name ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field_name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RequiresBackwardCompatibility';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.RequiresBackwardCompatibility\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"field_name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field_name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field_name' => $this->field_name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field_name') !== null) {\n      $this->field_name = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['field_name']);\n    }\n  }\n\n}\n\n/**\n * Disables testing features.\n *\n * Original thrift struct:-\n * NoTesting\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoTesting'))>>\nclass NoTesting implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoTesting';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoTesting\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables experimental features.\n *\n * Original thrift struct:-\n * NoExperimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoExperimental'))>>\nclass NoExperimental implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoExperimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoExperimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables @Beta features.\n *\n * Original thrift struct:-\n * NoBeta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoBeta'))>>\nclass NoBeta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoBeta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoBeta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoExperimental' => \\facebook\\thrift\\annotation\\NoExperimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature must not depend directly on an unreleased\n * or testing definition/feature.\n *\n * Original thrift struct:-\n * Released\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Released'))>>\nclass Released implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Released';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Released\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoBeta' => \\facebook\\thrift\\annotation\\NoBeta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\NoTesting' => \\facebook\\thrift\\annotation\\NoTesting::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables legacy features.\n *\n * Original thrift struct:-\n * NoLegacy\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoLegacy'))>>\nclass NoLegacy implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoLegacy';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoLegacy\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables @Deprecated features.\n * \n * Should only be enabled in `test` versions, as deprecated implies removing\n * the feature will break current usage (otherwise it would be legacy or\n * deleted).\n *\n * Original thrift struct:-\n * NoDeprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoDeprecated'))>>\nclass NoDeprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoDeprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoDeprecated\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoLegacy' => \\facebook\\thrift\\annotation\\NoLegacy::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that changes the field qualifier from 'none' to 'terse'.\n * A terse field is eligible to skip serialization, when it equals to the\n * intrinsic default value. It also clears to the intrinsic default value\n * before deserialization to distinguish between if a terse field was skipped\n * or missing during serialization. This is different from an unqualified\n * field, as an unqualified field is always serialized regardless of its value,\n * and it is not cleared before deserialization.\n * \n * The annotation can be only used to annotate an unqualified field, and when\n * it is annotating a struct or exception, it changes all unqualified fields to\n * terse fields. Note, the annotation can not be used for union.\n *\n * Original thrift struct:-\n * TerseWrite\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/TerseWrite'))>>\nclass TerseWrite implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TerseWrite';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.TerseWrite\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack.\n *\n * Original thrift struct:-\n * Box\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Box'))>>\nclass Box implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Box';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Box\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Mixin\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Mixin'))>>\nclass Mixin implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Mixin';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Mixin\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Option to serialize thrift struct in ascending field id order.\n * \n * This can potentially make serialized data size smaller in compact protocol,\n * since compact protocol can write deltas between subsequent field ids.\n *\n * Original thrift struct:-\n * SerializeInFieldIdOrder\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/SerializeInFieldIdOrder'))>>\nclass SerializeInFieldIdOrder implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SerializeInFieldIdOrder';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.SerializeInFieldIdOrder\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates an enum is a bitmask and should support bit-wise operators.\n *\n * Original thrift struct:-\n * BitmaskEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/BitmaskEnum'))>>\nclass BitmaskEnum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BitmaskEnum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.BitmaskEnum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all released v1 features.\n *\n * Original thrift struct:-\n * v1\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1'))>>\nclass v1 implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all beta v1 features.\n * \n * Beta features are guaranteed to *not* break unrelated Thrift features\n * so they should be relatively safe to test alongside other beta or\n * released Thrift features.\n *\n * Original thrift struct:-\n * v1beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1beta'))>>\nclass v1beta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1' => \\facebook\\thrift\\annotation\\v1::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all experimental v1 features.\n * \n * Use with *caution* and only with explicit permission. This may enable\n * features may change significantly without notice or not work correctly\n * in all contexts.\n *\n * Original thrift struct:-\n * v1alpha\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1alpha'))>>\nclass v1alpha implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1alpha';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1alpha\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1beta' => \\facebook\\thrift\\annotation\\v1beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\SerializeInFieldIdOrder' => \\facebook\\thrift\\annotation\\SerializeInFieldIdOrder::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables experimental features, even those that are known to break common\n * use cases.\n *\n * Original thrift struct:-\n * v1test\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1test'))>>\nclass v1test implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1test';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1test\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoDeprecated' => \\facebook\\thrift\\annotation\\NoDeprecated::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\v1alpha' => \\facebook\\thrift\\annotation\\v1alpha::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Testing' => \\facebook\\thrift\\annotation\\Testing::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Specifies the field where the exception message is stored. The field\n * is used to generate an additional method to get it.\n *\n * Original thrift struct:-\n * ExceptionMessage\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ExceptionMessage'))>>\nclass ExceptionMessage implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?string,\n  );\n\n  const type TShape = shape(\n    'field' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 6158382972310209096;\n  /**\n   * Original thrift field:-\n   * 1: string field\n   */\n  public string $field;\n\n  public function __construct(?string $field = null)[] {\n    $this->field = $field ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ExceptionMessage';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ExceptionMessage\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field' => $this->field,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $this->field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['field']);\n    }\n  }\n\n}\n\n/**\n * Generates a const of type schema. Struct containing the schema of the\n * annotated type. Optionally specify name to override default\n * schema<structName>.\n *\n * Original thrift struct:-\n * GenerateRuntimeSchema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/GenerateRuntimeSchema'))>>\nclass GenerateRuntimeSchema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'GenerateRuntimeSchema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.GenerateRuntimeSchema\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack, and that\n * identical values can be shared in immutable contexts.\n *\n * Original thrift struct:-\n * InternBox\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/InternBox'))>>\nclass InternBox implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'InternBox';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.InternBox\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 2588}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public function baz(?dict<int, bool> $a, ?KeyedContainer<int, KeyedContainer<int, dict<string, bool>>> $b, ?int $c, ?Foo $d, ?int $e): Awaitable<string>;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public function baz(?dict<int, bool> $a, ?KeyedContainer<int, KeyedContainer<int, dict<string, bool>>> $b, ?int $c, ?Foo $d, ?int $e): string;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarAsyncClientIf extends BarAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public function baz(?dict<int, bool> $a, ?KeyedContainer<int, KeyedContainer<int, dict<string, bool>>> $b, ?int $c, ?Foo $d, ?int $e): Awaitable<string>;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ntrait BarClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass BarAsyncClient extends \\ThriftClientBase implements BarAsyncClientIf {\n  use BarClientBase;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public async function baz(?dict<int, bool> $a, ?KeyedContainer<int, KeyedContainer<int, dict<string, bool>>> $b, ?int $c, ?Foo $d, ?int $e): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a === null ? null : $a,\n      'b' => $b === null ? null : Vec\\map($b, \n        $_val0 ==> dict($_val0)\n      ),\n      'c' => $c === null ? null : $c,\n      'd' => $d === null ? null : $d,\n      'e' => $e === null ? null : $e,\n    ));\n    await $this->asyncHandler_->genBefore(\"Bar\", \"baz\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"baz\", false);\n    return await $this->genAwaitResponse(Bar_baz_result::class, \"baz\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public async function baz__LEGACY_ARRAYS(?dict<int, bool> $a, ?KeyedContainer<int, KeyedContainer<int, dict<string, bool>>> $b, ?int $c, ?Foo $d, ?int $e): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a === null ? null : $a,\n      'b' => $b === null ? null : Vec\\map($b, \n        $_val0 ==> dict($_val0)\n      ),\n      'c' => $c === null ? null : $c,\n      'd' => $d === null ? null : $d,\n      'e' => $e === null ? null : $e,\n    ));\n    await $this->asyncHandler_->genBefore(\"Bar\", \"baz\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"baz\", false);\n    return await $this->genAwaitResponse(Bar_baz_result::class, \"baz\", false, $currentseqid, $rpc_options, shape('read_options' => \\THRIFT_MARK_LEGACY_ARRAYS));\n  }\n\n}\n\nclass BarClient extends \\ThriftClientBase implements BarClientIf {\n  use BarClientBase;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public async function baz(?dict<int, bool> $a, ?KeyedContainer<int, KeyedContainer<int, dict<string, bool>>> $b, ?int $c, ?Foo $d, ?int $e): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a === null ? null : $a,\n      'b' => $b === null ? null : Vec\\map($b, \n        $_val0 ==> dict($_val0)\n      ),\n      'c' => $c === null ? null : $c,\n      'd' => $d === null ? null : $d,\n      'e' => $e === null ? null : $e,\n    ));\n    await $this->asyncHandler_->genBefore(\"Bar\", \"baz\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"baz\", false);\n    return await $this->genAwaitResponse(Bar_baz_result::class, \"baz\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public async function baz__LEGACY_ARRAYS(?dict<int, bool> $a, ?KeyedContainer<int, KeyedContainer<int, dict<string, bool>>> $b, ?int $c, ?Foo $d, ?int $e): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a === null ? null : $a,\n      'b' => $b === null ? null : Vec\\map($b, \n        $_val0 ==> dict($_val0)\n      ),\n      'c' => $c === null ? null : $c,\n      'd' => $d === null ? null : $d,\n      'e' => $e === null ? null : $e,\n    ));\n    await $this->asyncHandler_->genBefore(\"Bar\", \"baz\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"baz\", false);\n    return await $this->genAwaitResponse(Bar_baz_result::class, \"baz\", false, $currentseqid, $rpc_options, shape('read_options' => \\THRIFT_MARK_LEGACY_ARRAYS));\n  }\n\n  /* send and recv functions */\n  public function send_baz(dict<int, bool> $a, KeyedContainer<int, KeyedContainer<int, dict<string, bool>>> $b, int $c, ?Foo $d, int $e): int {\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a === null ? null : $a,\n      'b' => $b === null ? null : Vec\\map($b, \n        $_val0 ==> dict($_val0)\n      ),\n      'c' => $c === null ? null : $c,\n      'd' => $d === null ? null : $d,\n      'e' => $e === null ? null : $e,\n    ));\n    return $this->sendImplHelper($args, \"baz\", false);\n  }\n  public function recv_baz(?int $expectedsequenceid = null): string {\n    return $this->recvImplHelper(Bar_baz_result::class, \"baz\", false, $expectedsequenceid);\n  }\n}\n\nabstract class BarAsyncProcessorBase extends \\ThriftAsyncProcessor {\n  abstract const type TThriftIf as BarAsyncIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = BarStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'Bar';\n\n  protected async function process_baz(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('baz');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'baz', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'Bar_baz_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'Bar_baz_args');\n    } else {\n      $args = Bar_baz_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'baz', $args);\n    $result = Bar_baz_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'Bar', 'baz', $args);\n      $result->success = await $this->handler->baz($args->a, $args->b, $args->c, $args->d, $args->e);\n      $this->eventHandler_->postExec($handler_ctx, 'baz', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'baz', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'baz', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'baz', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'baz', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"baz\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'baz', $result);\n  }\n  protected async function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): Awaitable<void> {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = BarStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass BarAsyncProcessor extends BarAsyncProcessorBase {\n  const type TThriftIf = BarAsyncIf;\n}\n\nabstract class BarSyncProcessorBase extends \\ThriftSyncProcessor {\n  abstract const type TThriftIf as BarIf;\n  const classname<\\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = BarStaticMetadata::class;\n  const string THRIFT_SVC_NAME = 'Bar';\n\n  protected function process_baz(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $handler_ctx = $this->eventHandler_->getHandlerContext('baz');\n    $reply_type = \\TMessageType::REPLY;\n\n    $this->eventHandler_->preRead($handler_ctx, 'baz', dict[]);\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, 'Bar_baz_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, 'Bar_baz_args');\n    } else {\n      $args = Bar_baz_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $this->eventHandler_->postRead($handler_ctx, 'baz', $args);\n    $result = Bar_baz_result::withDefaultValues();\n    try {\n      $this->eventHandler_->preExec($handler_ctx, 'Bar', 'baz', $args);\n      $result->success = $this->handler->baz($args->a, $args->b, $args->c, $args->d, $args->e);\n      $this->eventHandler_->postExec($handler_ctx, 'baz', $result);\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $this->eventHandler_->handlerError($handler_ctx, 'baz', $ex);\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    $this->eventHandler_->preWrite($handler_ctx, 'baz', $result);\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'baz', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'baz', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"baz\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n    $this->eventHandler_->postWrite($handler_ctx, 'baz', $result);\n  }\n  protected function process_getThriftServiceMetadata(int $seqid, \\TProtocol $input, \\TProtocol $output): void {\n    $reply_type = \\TMessageType::REPLY;\n\n    if ($input is \\TBinaryProtocolAccelerated) {\n      $args = \\thrift_protocol_read_binary_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else if ($input is \\TCompactProtocolAccelerated) {\n      $args = \\thrift_protocol_read_compact_struct($input, '\\tmeta_ThriftMetadataService_getThriftServiceMetadata_args');\n    } else {\n      $args = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_args::withDefaultValues();\n      $args->read($input);\n    }\n    $input->readMessageEnd();\n    $result = \\tmeta_ThriftMetadataService_getThriftServiceMetadata_result::withDefaultValues();\n    try {\n      $result->success = BarStaticMetadata::getServiceMetadataResponse();\n    } catch (\\Exception $ex) {\n      $reply_type = \\TMessageType::EXCEPTION;\n      $result = new \\TApplicationException($ex->getMessage().\"\\n\".$ex->getTraceAsString());\n    }\n    if ($output is \\TBinaryProtocolAccelerated)\n    {\n      \\thrift_protocol_write_binary($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, $output->isStrictWrite());\n    }\n    else if ($output is \\TCompactProtocolAccelerated)\n    {\n      \\thrift_protocol_write_compact2($output, 'getThriftServiceMetadata', $reply_type, $result, $seqid, false, \\TCompactProtocolBase::VERSION);\n    }\n    else\n    {\n      $output->writeMessageBegin(\"getThriftServiceMetadata\", $reply_type, $seqid);\n      $result->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n    }\n  }\n}\nclass BarSyncProcessor extends BarSyncProcessorBase {\n  const type TThriftIf = BarIf;\n}\n// For backwards compatibility\nclass BarProcessor extends BarSyncProcessor {}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass Bar_baz_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'array',\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::I32,\n        'vtype' => \\TType::SET,\n        'key' => shape(\n          'type' => \\TType::I32,\n        ),\n        'val' => shape(\n          'type' => \\TType::SET,\n          'etype' => \\TType::STRING,\n          'elem' => shape(\n            'type' => \\TType::STRING,\n          ),\n          'format' => 'array',\n        ),\n        'format' => 'array',\n      ),\n      'format' => 'array',\n    ),\n    3 => shape(\n      'var' => 'c',\n      'type' => \\TType::I64,\n    ),\n    4 => shape(\n      'var' => 'd',\n      'type' => \\TType::STRUCT,\n      'class' => Foo::class,\n    ),\n    5 => shape(\n      'var' => 'e',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n    'c' => 3,\n    'd' => 4,\n    'e' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?darray<int, bool>,\n    ?'b' => ?varray<darray<int, darray<string, bool>>>,\n    ?'c' => ?int,\n    ?'d' => ?Foo,\n    ?'e' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 7865027497865509792;\n  public ?dict<int, bool> $a;\n  public ?vec<dict<int, dict<string, bool>>> $b;\n  public ?int $c;\n  public ?Foo $d;\n  public ?int $e;\n\n  public function __construct(?dict<int, bool> $a = null, ?vec<dict<int, dict<string, bool>>> $b = null, ?int $c = null, ?Foo $d = null, ?int $e = null)[] {\n    $this->a = $a;\n    $this->b = $b;\n    $this->c = $c;\n    $this->d = $d;\n    $this->e = $e ?? 4;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n      Shapes::idx($shape, 'c'),\n      Shapes::idx($shape, 'd'),\n      Shapes::idx($shape, 'e'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, dict<int, bool>>(idx($map, 'a'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, vec<dict<int, dict<string, bool>>>>(idx($map, 'b'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, int>(idx($map, 'c'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, Foo>(idx($map, 'd'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, int>(idx($map, 'e'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Bar_baz_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.baz_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"c\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"d\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"e\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass Bar_baz_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'success'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Bar_baz_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Bar_baz_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass BarStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.Bar\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"baz\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_set\" => tmeta_ThriftSetType::fromShape(\n                          shape(\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"a\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_list\" => tmeta_ThriftListType::fromShape(\n                          shape(\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_map\" => tmeta_ThriftMapType::fromShape(\n                                  shape(\n                                    \"keyType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                      )\n                                    ),\n                                    \"valueType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                          shape(\n                                            \"valueType\" => tmeta_ThriftType::fromShape(\n                                              shape(\n                                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                              )\n                                            ),\n                                          )\n                                        ),\n                                      )\n                                    ),\n                                  )\n                                ),\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"b\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 3,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"c\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 4,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.Foo\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"d\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 5,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"e\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n              'module.Foo' => Foo::getStructMetadata(),\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 876}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift struct:-\n * Foo\n */\nclass Foo implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'array',\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::SET,\n        'elem' => shape(\n          'type' => \\TType::SET,\n          'etype' => \\TType::I32,\n          'elem' => shape(\n            'type' => \\TType::I32,\n          ),\n          'format' => 'array',\n        ),\n        'format' => 'array',\n      ),\n      'format' => 'array',\n    ),\n    3 => shape(\n      'var' => 'c',\n      'type' => \\TType::I64,\n    ),\n    4 => shape(\n      'var' => 'd',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n    'c' => 3,\n    'd' => 4,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?varray<string>,\n    ?'b' => ?darray<string, varray<darray<int, bool>>>,\n    ?'c' => ?int,\n    ?'d' => ?bool,\n  );\n\n  const int STRUCTURAL_ID = 3946809642153193229;\n  /**\n   * Original thrift field:-\n   * 1: list<string> a\n   */\n  public ?vec<string> $a;\n  /**\n   * Original thrift field:-\n   * 2: map<string, list<set<i32>>> b\n   */\n  public ?dict<string, vec<dict<int, bool>>> $b;\n  /**\n   * Original thrift field:-\n   * 3: i64 c\n   */\n  public ?int $c;\n  /**\n   * Original thrift field:-\n   * 4: bool d\n   */\n  public ?bool $d;\n\n  public function __construct(?vec<string> $a = null, ?dict<string, vec<dict<int, bool>>> $b = null, ?int $c = null, ?bool $d = null)[] {\n    $this->a = $a;\n    $this->b = $b;\n    $this->c = $c ?? 7;\n    $this->d = $d ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n      Shapes::idx($shape, 'c'),\n      Shapes::idx($shape, 'd'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, vec<string>>(idx($map, 'a'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, dict<string, vec<dict<int, bool>>>>(idx($map, 'b'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, int>(idx($map, 'c'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, bool>(idx($map, 'd'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Foo\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"b\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"c\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"d\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * Baz\n */\nclass Baz extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'some_field',\n      'type' => \\TType::STRUCT,\n      'class' => Foo::class,\n    ),\n    3 => shape(\n      'var' => 'some_container',\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'array',\n    ),\n    4 => shape(\n      'var' => 'code',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n    'some_field' => 2,\n    'some_container' => 3,\n    'code' => 4,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n    ?'some_field' => ?Foo,\n    ?'some_container' => ?darray<string, bool>,\n    ?'code' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 1663976252517274137;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n  /**\n   * Original thrift field:-\n   * 2: module.Foo some_field\n   */\n  public ?Foo $some_field;\n  /**\n   * Original thrift field:-\n   * 3: set<string> some_container\n   */\n  public ?dict<string, bool> $some_container;\n  /**\n   * Original thrift field:-\n   * 4: i32 code\n   */\n  public int $code;\n\n  public function __construct(?string $message = null, ?Foo $some_field = null, ?dict<string, bool> $some_container = null, ?int $code = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n    $this->some_field = $some_field;\n    $this->some_container = $some_container;\n    $this->code = $code ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n      Shapes::idx($shape, 'some_field'),\n      Shapes::idx($shape, 'some_container'),\n      Shapes::idx($shape, 'code'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'message'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, Foo>(idx($map, 'some_field'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, dict<string, bool>>(idx($map, 'some_container'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, int>(idx($map, 'code'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Baz';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.Baz\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"some_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"some_container\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"code\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * OptBaz\n */\nclass OptBaz extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 546500496397478593;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(@KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'message'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'OptBaz';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.OptBaz\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 514}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * FooHackService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/foo/php/ns/FooHackService'))>>\ninterface FooHackServiceAsyncIf extends \\IThriftAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * FooHackService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/foo/php/ns/FooHackService'))>>\ninterface FooHackServiceIf extends \\IThriftSyncIf {\n}\n\n/**\n * Original thrift service:-\n * FooHackService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/foo/php/ns/FooHackService'))>>\ninterface FooHackServiceAsyncClientIf extends FooHackServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * FooHackService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/foo/php/ns/FooHackService'))>>\ninterface FooHackServiceClientIf extends \\IThriftSyncIf {\n}\n\n/**\n * Original thrift service:-\n * FooHackService\n */\ntrait FooHackServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass FooHackServiceAsyncClient extends \\ThriftClientBase implements FooHackServiceAsyncClientIf {\n  use FooHackServiceClientBase;\n\n}\n\nclass FooHackServiceClient extends \\ThriftClientBase implements FooHackServiceClientIf {\n  use FooHackServiceClientBase;\n\n  /* send and recv functions */\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass FooHackServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.FooHackService\",\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 110}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace hack_ns2;\n\n/**\n * Original thrift enum:-\n * Status\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/hack/ns2/Status'))>>\nenum Status: int {\n  Unknown = 0;\n}\n\nclass Status_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module2.Status\",\n        \"elements\" => dict[\n          0 => \"Unknown\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * FBStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/hack/ns2/FBStruct'))>>\nclass FBStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'str_value',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'enum_value',\n      'type' => \\TType::I32,\n      'enum' => \\foo_php_ns_Status::class,\n    ),\n    3 => shape(\n      'var' => 'struct_value',\n      'type' => \\TType::STRUCT,\n      'class' => \\foo_php_ns_TestStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'str_value' => 1,\n    'enum_value' => 2,\n    'struct_value' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'str_value' => ?string,\n    ?'enum_value' => ?\\foo_php_ns_Status,\n    ?'struct_value' => ?\\foo_php_ns_TestStruct,\n  );\n\n  const int STRUCTURAL_ID = 3033845145268312663;\n  /**\n   * Original thrift field:-\n   * 1: string str_value\n   */\n  public string $str_value;\n  /**\n   * Original thrift field:-\n   * 2: module.Status enum_value\n   */\n  public ?\\foo_php_ns_Status $enum_value;\n  /**\n   * Original thrift field:-\n   * 3: module.TestStruct struct_value\n   */\n  public ?\\foo_php_ns_TestStruct $struct_value;\n\n  public function __construct(?string $str_value = null, ?\\foo_php_ns_Status $enum_value = null, ?\\foo_php_ns_TestStruct $struct_value = null)[] {\n    $this->str_value = $str_value ?? '';\n    $this->enum_value = $enum_value;\n    $this->struct_value = $struct_value;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'str_value'),\n      Shapes::idx($shape, 'enum_value'),\n      Shapes::idx($shape, 'struct_value'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FBStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module2.FBStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"str_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Status\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"enum_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.TestStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"struct_value\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 185}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift enum:-\n * Status\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/foo/php/ns/Status'))>>\nenum foo_php_ns_Status: int {\n  Unknown = 0;\n}\n\nclass foo_php_ns_Status_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.Status\",\n        \"elements\" => dict[\n          0 => \"Unknown\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * TestStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/foo/php/ns/TestStruct'))>>\nclass foo_php_ns_TestStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'str_value',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'str_value' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'str_value' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 7258556236863001185;\n  /**\n   * Original thrift field:-\n   * 1: string str_value\n   */\n  public string $str_value;\n\n  public function __construct(?string $str_value = null)[] {\n    $this->str_value = $str_value ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'str_value'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TestStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"str_value\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 125}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace hack_ns2;\n\n/**\n * Original thrift service:-\n * TestService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/hack/ns2/TestService'))>>\ninterface TestServiceAsyncIf extends \\FooHackServiceAsyncIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   ping(1: string str_arg);\n   */\n  public function ping(string $str_arg): Awaitable<int>;\n}\n\n/**\n * Original thrift service:-\n * TestService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/hack/ns2/TestService'))>>\ninterface TestServiceIf extends \\FooHackServiceIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   ping(1: string str_arg);\n   */\n  public function ping(string $str_arg): int;\n}\n\n/**\n * Original thrift service:-\n * TestService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/hack/ns2/TestService'))>>\ninterface TestServiceAsyncClientIf extends TestServiceAsyncIf, \\FooHackServiceAsyncClientIf {\n}\n\n/**\n * Original thrift service:-\n * TestService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'test.dev/hack/ns2/TestService'))>>\ninterface TestServiceClientIf extends \\FooHackServiceClientIf {\n  /**\n   * Original thrift definition:-\n   * i32\n   *   ping(1: string str_arg);\n   */\n  public function ping(string $str_arg): Awaitable<int>;\n}\n\n/**\n * Original thrift service:-\n * TestService\n */\ntrait TestServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass TestServiceAsyncClient extends \\FooHackServiceAsyncClient implements TestServiceAsyncClientIf {\n  use TestServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   ping(1: string str_arg);\n   */\n  public async function ping(string $str_arg): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\hack_ns2\\TestService_ping_args::fromShape(shape(\n      'str_arg' => $str_arg,\n    ));\n    await $this->asyncHandler_->genBefore(\"TestService\", \"ping\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"ping\", false);\n    return await $this->genAwaitResponse(\\hack_ns2\\TestService_ping_result::class, \"ping\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass TestServiceClient extends \\FooHackServiceClient implements TestServiceClientIf {\n  use TestServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * i32\n   *   ping(1: string str_arg);\n   */\n  public async function ping(string $str_arg): Awaitable<int> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\hack_ns2\\TestService_ping_args::fromShape(shape(\n      'str_arg' => $str_arg,\n    ));\n    await $this->asyncHandler_->genBefore(\"TestService\", \"ping\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"ping\", false);\n    return await $this->genAwaitResponse(\\hack_ns2\\TestService_ping_result::class, \"ping\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_ping(string $str_arg): int {\n    $args = \\hack_ns2\\TestService_ping_args::fromShape(shape(\n      'str_arg' => $str_arg,\n    ));\n    return $this->sendImplHelper($args, \"ping\", false);\n  }\n  public function recv_ping(?int $expectedsequenceid = null): int {\n    return $this->recvImplHelper(\\hack_ns2\\TestService_ping_result::class, \"ping\", false, $expectedsequenceid);\n  }\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass TestService_ping_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'str_arg',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'str_arg' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'str_arg' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 5542358918184482101;\n  public string $str_arg;\n\n  public function __construct(?string $str_arg = null)[] {\n    $this->str_arg = $str_arg ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'str_arg'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestService_ping_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module2.ping_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"str_arg\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass TestService_ping_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 3865318819874171525;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestService_ping_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module2.TestService_ping_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass TestServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return \\tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module2.TestService\",\n        \"functions\" => vec[\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"ping\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                      )\n                    ),\n                    \"name\" => \"str_arg\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n        \"parent\" => \"module.FooHackService\",\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module2',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n              'module.FooHackService' => \\FooHackServiceStaticMetadata::getServiceMetadata(),\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 360}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift struct:-\n * Foo\n */\nclass Foo implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field2',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'field3',\n      'type' => \\TType::I32,\n    ),\n    3 => shape(\n      'var' => 'field1',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field2' => 1,\n    'field3' => 2,\n    'field1' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field1' => ?int,\n    ?'field2' => ?int,\n    ?'field3' => ?int,\n  );\n\n  const type TShape = shape(\n    'field1' => int,\n    'field2' => int,\n    'field3' => int,\n  );\n  const int STRUCTURAL_ID = 1700330082146725318;\n  /**\n   * Original thrift field:-\n   * 3: i32 field1\n   */\n  public int $field1;\n  /**\n   * Original thrift field:-\n   * 1: i32 field2\n   */\n  public int $field2;\n  /**\n   * Original thrift field:-\n   * 2: i32 field3\n   */\n  public int $field3;\n\n  public function __construct(?int $field1 = null, ?int $field2 = null, ?int $field3 = null)[] {\n    $this->field1 = $field1 ?? 0;\n    $this->field2 = $field2 ?? 0;\n    $this->field3 = $field3 ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field1'),\n      Shapes::idx($shape, 'field2'),\n      Shapes::idx($shape, 'field3'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Foo\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"field1\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"field2\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"field3\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\SerializeInFieldIdOrder' => \\facebook\\thrift\\annotation\\SerializeInFieldIdOrder::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field1'],\n      $shape['field2'],\n      $shape['field3'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field1' => $this->field1,\n      'field2' => $this->field2,\n      'field3' => $this->field3,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field1') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['field1']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->field1 = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'field2') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['field2']);\n      if ($_tmp1 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->field2 = (int)$_tmp1;\n      }\n    }\n    if (idx($parsed, 'field3') !== null) {\n      $_tmp2 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['field3']);\n      if ($_tmp2 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->field3 = (int)$_tmp2;\n      }\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Foo2\n */\nclass Foo2 implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    3 => shape(\n      'var' => 'field1',\n      'type' => \\TType::I32,\n    ),\n    1 => shape(\n      'var' => 'field2',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'field3',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field1' => 3,\n    'field2' => 1,\n    'field3' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field1' => ?int,\n    ?'field2' => ?int,\n    ?'field3' => ?int,\n  );\n\n  const type TShape = shape(\n    'field1' => int,\n    'field2' => int,\n    'field3' => int,\n  );\n  const int STRUCTURAL_ID = 1700330082146725318;\n  /**\n   * Original thrift field:-\n   * 3: i32 field1\n   */\n  public int $field1;\n  /**\n   * Original thrift field:-\n   * 1: i32 field2\n   */\n  public int $field2;\n  /**\n   * Original thrift field:-\n   * 2: i32 field3\n   */\n  public int $field3;\n\n  public function __construct(?int $field1 = null, ?int $field2 = null, ?int $field3 = null)[] {\n    $this->field1 = $field1 ?? 0;\n    $this->field2 = $field2 ?? 0;\n    $this->field3 = $field3 ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field1'),\n      Shapes::idx($shape, 'field2'),\n      Shapes::idx($shape, 'field3'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo2';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Foo2\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"field1\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"field2\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"field3\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field1'],\n      $shape['field2'],\n      $shape['field3'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field1' => $this->field1,\n      'field2' => $this->field2,\n      'field3' => $this->field3,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field1') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['field1']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->field1 = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'field2') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['field2']);\n      if ($_tmp1 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->field2 = (int)$_tmp1;\n      }\n    }\n    if (idx($parsed, 'field3') !== null) {\n      $_tmp2 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['field3']);\n      if ($_tmp2 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->field3 = (int)$_tmp2;\n      }\n    }\n  }\n\n}\n\n", "num_lines": 386}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1588}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates a definition/feature may change in incompatible ways.\n *\n * Original thrift struct:-\n * Beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Beta'))>>\nclass Beta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used with permission, may\n * only work in specific contexts, and may change in incompatible ways without\n * notice.\n *\n * Original thrift struct:-\n * Experimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Experimental'))>>\nclass Experimental implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Experimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Experimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used in an ephemeral testing\n * enviornment.\n * \n * Such enviornments only store serialized values temporarly and strictly\n * control which versions of Thrift definitions are used, so 'compatibility'\n * is not a concern.\n *\n * Original thrift struct:-\n * Testing\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Testing'))>>\nclass Testing implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Testing';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Testing\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should no longer be used.\n *\n * Original thrift struct:-\n * Deprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Deprecated'))>>\nclass Deprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const type TShape = shape(\n    'message' => string,\n  );\n  const int STRUCTURAL_ID = 2427562471238739676;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Deprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Deprecated\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['message'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'message' => $this->message,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'message') !== null) {\n      $this->message = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['message']);\n    }\n  }\n\n}\n\n/**\n * Annotate a thrift structured or enum to indicate if ids or values should not\n * be used.\n * \n * For example, you may want to mark ids as deprecated, or these ids\n * might be reserved for other use cases or annotations.\n * \n * The resolved set of disallowed ids is the union of the values in `ids` and\n * the range of values represented in `id_ranges`. Example:\n * \n *  // These ids are not allowed: 3, 8, half-open ranges [10, 15), [20, 30)\n *  @thrift.ReserveIds{ids = [3, 8], id_ranges = {10: 15, 20: 30}}\n *  struct Foo {\n *    ...\n *    3: i64 f; // Build failure: 3 cannot be used\n *  }\n *\n * Original thrift struct:-\n * ReserveIds\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ReserveIds'))>>\nclass ReserveIds implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ids',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'id_ranges',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ids' => 1,\n    'id_ranges' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ids' => ?Vector<int>,\n    ?'id_ranges' => ?Map<int, int>,\n  );\n\n  const type TShape = shape(\n    'ids' => vec<int>,\n    'id_ranges' => dict<int, int>,\n  );\n  const int STRUCTURAL_ID = 4105998268635615653;\n  /**\n   * Individual ids that cannot be used.\n   * \n   * Original thrift field:-\n   * 1: list<i32> ids\n   */\n  public Vector<int> $ids;\n  /**\n   * Represents ranges of ids that cannot be used.\n   * \n   * Each (key: value) pair represents the half-open range `[key, value)`,\n   * where `key` is included and `value` is not. For example, the map\n   * `{10: 15, 20: 30}` represents the union of id/value ranges `[10, 15)` and\n   * `[20, 30)`.\n   * \n   * Original thrift field:-\n   * 2: map<i32, i32> id_ranges\n   */\n  public Map<int, int> $id_ranges;\n\n  public function __construct(?Vector<int> $ids = null, ?Map<int, int> $id_ranges = null)[] {\n    $this->ids = $ids ?? Vector {};\n    $this->id_ranges = $id_ranges ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ids'),\n      Shapes::idx($shape, 'id_ranges'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ReserveIds';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ReserveIds\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ids\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"id_ranges\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['ids'] |> new Vector($$),\n      $shape['id_ranges'] |> new Map($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'ids' => vec($this->ids),\n      'id_ranges' => dict($this->id_ranges),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'ids') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['ids']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = 0;\n        $_tmp6 = (int)$_value2;\n        if ($_tmp6 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem5 = (int)$_tmp6;\n        }\n        $_container4 []= $_elem5;\n      }\n      $this->ids = $_container4;\n    }\n    if (idx($parsed, 'id_ranges') !== null) {\n      $_json10 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, int>>($parsed['id_ranges']);\n      $_container11 = Map {};\n      foreach($_json10 as $_key8 => $_value9) {\n        $_value12 = 0;\n        $_tmp13 = (int)$_value9;\n        if ($_tmp13 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value12 = (int)$_tmp13;\n        }\n        $_container11[$_key8] = $_value12;\n      }\n      $this->id_ranges = $_container11;\n    }\n  }\n\n}\n\n/**\n * Indicates additional backward compatibility restrictions, beyond the\n * standard Thrift required 'wire' compatibility.\n *\n * Original thrift struct:-\n * RequiresBackwardCompatibility\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RequiresBackwardCompatibility'))>>\nclass RequiresBackwardCompatibility implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field_name',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field_name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field_name' => ?bool,\n  );\n\n  const type TShape = shape(\n    'field_name' => bool,\n  );\n  const int STRUCTURAL_ID = 4755373036761315562;\n  /**\n   * Original thrift field:-\n   * 1: bool field_name\n   */\n  public bool $field_name;\n\n  public function __construct(?bool $field_name = null)[] {\n    $this->field_name = $field_name ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field_name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RequiresBackwardCompatibility';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.RequiresBackwardCompatibility\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"field_name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field_name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field_name' => $this->field_name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field_name') !== null) {\n      $this->field_name = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['field_name']);\n    }\n  }\n\n}\n\n/**\n * Disables testing features.\n *\n * Original thrift struct:-\n * NoTesting\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoTesting'))>>\nclass NoTesting implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoTesting';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoTesting\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables experimental features.\n *\n * Original thrift struct:-\n * NoExperimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoExperimental'))>>\nclass NoExperimental implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoExperimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoExperimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables @Beta features.\n *\n * Original thrift struct:-\n * NoBeta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoBeta'))>>\nclass NoBeta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoBeta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoBeta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoExperimental' => \\facebook\\thrift\\annotation\\NoExperimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature must not depend directly on an unreleased\n * or testing definition/feature.\n *\n * Original thrift struct:-\n * Released\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Released'))>>\nclass Released implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Released';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Released\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoBeta' => \\facebook\\thrift\\annotation\\NoBeta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\NoTesting' => \\facebook\\thrift\\annotation\\NoTesting::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables legacy features.\n *\n * Original thrift struct:-\n * NoLegacy\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoLegacy'))>>\nclass NoLegacy implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoLegacy';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoLegacy\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables @Deprecated features.\n * \n * Should only be enabled in `test` versions, as deprecated implies removing\n * the feature will break current usage (otherwise it would be legacy or\n * deleted).\n *\n * Original thrift struct:-\n * NoDeprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoDeprecated'))>>\nclass NoDeprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoDeprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoDeprecated\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoLegacy' => \\facebook\\thrift\\annotation\\NoLegacy::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that changes the field qualifier from 'none' to 'terse'.\n * A terse field is eligible to skip serialization, when it equals to the\n * intrinsic default value. It also clears to the intrinsic default value\n * before deserialization to distinguish between if a terse field was skipped\n * or missing during serialization. This is different from an unqualified\n * field, as an unqualified field is always serialized regardless of its value,\n * and it is not cleared before deserialization.\n * \n * The annotation can be only used to annotate an unqualified field, and when\n * it is annotating a struct or exception, it changes all unqualified fields to\n * terse fields. Note, the annotation can not be used for union.\n *\n * Original thrift struct:-\n * TerseWrite\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/TerseWrite'))>>\nclass TerseWrite implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TerseWrite';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.TerseWrite\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack.\n *\n * Original thrift struct:-\n * Box\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Box'))>>\nclass Box implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Box';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Box\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Mixin\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Mixin'))>>\nclass Mixin implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Mixin';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Mixin\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Option to serialize thrift struct in ascending field id order.\n * \n * This can potentially make serialized data size smaller in compact protocol,\n * since compact protocol can write deltas between subsequent field ids.\n *\n * Original thrift struct:-\n * SerializeInFieldIdOrder\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/SerializeInFieldIdOrder'))>>\nclass SerializeInFieldIdOrder implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SerializeInFieldIdOrder';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.SerializeInFieldIdOrder\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates an enum is a bitmask and should support bit-wise operators.\n *\n * Original thrift struct:-\n * BitmaskEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/BitmaskEnum'))>>\nclass BitmaskEnum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BitmaskEnum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.BitmaskEnum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all released v1 features.\n *\n * Original thrift struct:-\n * v1\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1'))>>\nclass v1 implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all beta v1 features.\n * \n * Beta features are guaranteed to *not* break unrelated Thrift features\n * so they should be relatively safe to test alongside other beta or\n * released Thrift features.\n *\n * Original thrift struct:-\n * v1beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1beta'))>>\nclass v1beta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1' => \\facebook\\thrift\\annotation\\v1::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all experimental v1 features.\n * \n * Use with *caution* and only with explicit permission. This may enable\n * features may change significantly without notice or not work correctly\n * in all contexts.\n *\n * Original thrift struct:-\n * v1alpha\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1alpha'))>>\nclass v1alpha implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1alpha';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1alpha\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1beta' => \\facebook\\thrift\\annotation\\v1beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\SerializeInFieldIdOrder' => \\facebook\\thrift\\annotation\\SerializeInFieldIdOrder::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables experimental features, even those that are known to break common\n * use cases.\n *\n * Original thrift struct:-\n * v1test\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1test'))>>\nclass v1test implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1test';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1test\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoDeprecated' => \\facebook\\thrift\\annotation\\NoDeprecated::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\v1alpha' => \\facebook\\thrift\\annotation\\v1alpha::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Testing' => \\facebook\\thrift\\annotation\\Testing::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Specifies the field where the exception message is stored. The field\n * is used to generate an additional method to get it.\n *\n * Original thrift struct:-\n * ExceptionMessage\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ExceptionMessage'))>>\nclass ExceptionMessage implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?string,\n  );\n\n  const type TShape = shape(\n    'field' => string,\n  );\n  const int STRUCTURAL_ID = 6158382972310209096;\n  /**\n   * Original thrift field:-\n   * 1: string field\n   */\n  public string $field;\n\n  public function __construct(?string $field = null)[] {\n    $this->field = $field ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ExceptionMessage';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ExceptionMessage\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field' => $this->field,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $this->field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['field']);\n    }\n  }\n\n}\n\n/**\n * Generates a const of type schema. Struct containing the schema of the\n * annotated type. Optionally specify name to override default\n * schema<structName>.\n *\n * Original thrift struct:-\n * GenerateRuntimeSchema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/GenerateRuntimeSchema'))>>\nclass GenerateRuntimeSchema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'GenerateRuntimeSchema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.GenerateRuntimeSchema\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack, and that\n * identical values can be shared in immutable contexts.\n *\n * Original thrift struct:-\n * InternBox\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/InternBox'))>>\nclass InternBox implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'InternBox';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.InternBox\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 2564}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures;\n\n/**\n * Original thrift enum:-\n * Enum\n */\nenum Enum: int {\n  ENUM = 1;\n}\n\nclass Enum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.Enum\",\n        \"elements\" => dict[\n          1 => \"ENUM\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\nenum UnionEnum: int {\n  _EMPTY_ = 0;\n  intValue = 1;\n  stringValue = 5;\n}\n\n/**\n * Original thrift struct:-\n * Union\n */\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<\\test\\fixtures\\UnionEnum>, \\IThriftShapishSyncStruct {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'intValue',\n      'union' => true,\n      'type' => \\TType::I64,\n    ),\n    5 => shape(\n      'var' => 'stringValue',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'intValue' => 1,\n    'stringValue' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'intValue' => ?int,\n    ?'stringValue' => ?string,\n  );\n\n  const type TShape = shape(\n    ?'intValue' => ?int,\n    ?'stringValue' => ?string,\n    ...\n  );\n  const int STRUCTURAL_ID = 7430801321277306554;\n  /**\n   * Original thrift field:-\n   * 1: i64 intValue\n   */\n  public ?int $intValue;\n  /**\n   * Original thrift field:-\n   * 5: string stringValue\n   */\n  public ?string $stringValue;\n  protected \\test\\fixtures\\UnionEnum $_type = \\test\\fixtures\\UnionEnum::_EMPTY_;\n\n  public function __construct(?int $intValue = null, ?string $stringValue = null)[] {\n    $this->_type = \\test\\fixtures\\UnionEnum::_EMPTY_;\n    if ($intValue !== null) {\n      $this->intValue = $intValue;\n      $this->_type = \\test\\fixtures\\UnionEnum::intValue;\n    }\n    if ($stringValue !== null) {\n      $this->stringValue = $stringValue;\n      $this->_type = \\test\\fixtures\\UnionEnum::stringValue;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'intValue'),\n      Shapes::idx($shape, 'stringValue'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function getType()[]: \\test\\fixtures\\UnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case \\test\\fixtures\\UnionEnum::intValue:\n        $this->intValue = null;\n        break;\n      case \\test\\fixtures\\UnionEnum::stringValue:\n        $this->stringValue = null;\n        break;\n      case \\test\\fixtures\\UnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = \\test\\fixtures\\UnionEnum::_EMPTY_;\n  }\n\n  public function set_intValue(int $intValue)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\UnionEnum::intValue;\n    $this->intValue = $intValue;\n    return $this;\n  }\n\n  public function get_intValue()[]: ?int {\n    return $this->intValue;\n  }\n\n  public function getx_intValue()[]: int {\n    invariant(\n      $this->_type === \\test\\fixtures\\UnionEnum::intValue,\n      'get_intValue called on an instance of Union whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->intValue as nonnull;\n  }\n\n  public function set_stringValue(string $stringValue)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\UnionEnum::stringValue;\n    $this->stringValue = $stringValue;\n    return $this;\n  }\n\n  public function get_stringValue()[]: ?string {\n    return $this->stringValue;\n  }\n\n  public function getx_stringValue()[]: string {\n    invariant(\n      $this->_type === \\test\\fixtures\\UnionEnum::stringValue,\n      'get_stringValue called on an instance of Union whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->stringValue as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Union\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"intValue\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"stringValue\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'intValue'),\n      Shapes::idx($shape, 'stringValue'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'intValue' => $this->intValue,\n      'stringValue' => $this->stringValue,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * A\n */\nclass A implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?string,\n  );\n\n  const type TShape = shape(\n    'a' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 7939807933046472325;\n  /**\n   * Original thrift field:-\n   * 1: string a\n   */\n  public string $a;\n\n  public function __construct(?string $a = null)[] {\n    $this->a = $a ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'A';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.A\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['a'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'a' => $this->a,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * B\n */\nclass B implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'just_an_A',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\A::class,\n    ),\n    2 => shape(\n      'var' => 'set_of_i32',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'list_of_i32',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    4 => shape(\n      'var' => 'list_of_string',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    5 => shape(\n      'var' => 'map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    6 => shape(\n      'var' => 'map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\test\\fixtures\\A::class,\n      ),\n      'format' => 'collection',\n    ),\n    7 => shape(\n      'var' => 'map_of_string_to_list_of_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    8 => shape(\n      'var' => 'map_of_string_to_list_of_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRUCT,\n        'elem' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => \\test\\fixtures\\A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    9 => shape(\n      'var' => 'map_of_string_to_set_of_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::SET,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::SET,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    10 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    11 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => \\test\\fixtures\\A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    12 => shape(\n      'var' => 'list_of_set_of_i32',\n      'type' => \\TType::LST,\n      'etype' => \\TType::SET,\n      'elem' => shape(\n        'type' => \\TType::SET,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    13 => shape(\n      'var' => 'list_of_map_of_string_to_list_of_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::LST,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::LST,\n          'etype' => \\TType::STRUCT,\n          'elem' => shape(\n            'type' => \\TType::STRUCT,\n            'class' => \\test\\fixtures\\A::class,\n          ),\n          'format' => 'collection',\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    14 => shape(\n      'var' => 'list_of_map_of_string_to_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => \\test\\fixtures\\A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    17 => shape(\n      'var' => 'just_an_enum',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\Enum::class,\n    ),\n    18 => shape(\n      'var' => 'just_a_union',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\Union::class,\n    ),\n    51 => shape(\n      'var' => 'optional_just_an_A',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\A::class,\n    ),\n    52 => shape(\n      'var' => 'optional_set_of_i32',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    53 => shape(\n      'var' => 'optional_list_of_i32',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    54 => shape(\n      'var' => 'optional_list_of_string',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    55 => shape(\n      'var' => 'optional_map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    56 => shape(\n      'var' => 'optional_map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\test\\fixtures\\A::class,\n      ),\n      'format' => 'collection',\n    ),\n    57 => shape(\n      'var' => 'optional_map_of_string_to_list_of_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    58 => shape(\n      'var' => 'optional_map_of_string_to_list_of_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRUCT,\n        'elem' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => \\test\\fixtures\\A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    59 => shape(\n      'var' => 'optional_map_of_string_to_set_of_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::SET,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::SET,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    60 => shape(\n      'var' => 'optional_enum',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\Enum::class,\n    ),\n    70 => shape(\n      'var' => 'required_enum_with_default',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\Enum::class,\n    ),\n    80 => shape(\n      'var' => 'string_with_default_value',\n      'type' => \\TType::STRING,\n    ),\n    81 => shape(\n      'var' => 'i32_with_default_value',\n      'type' => \\TType::I32,\n    ),\n    82 => shape(\n      'var' => 'double_with_default_value',\n      'type' => \\TType::DOUBLE,\n    ),\n    83 => shape(\n      'var' => 'enum_with_default_value',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\Enum::class,\n    ),\n    84 => shape(\n      'var' => 'A_with_default_value',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\A::class,\n    ),\n    85 => shape(\n      'var' => 'set_of_i32_with_default_value',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    86 => shape(\n      'var' => 'map_of_i32_to_string_with_default_value',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    87 => shape(\n      'var' => 'list_of_string_with_default_value',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    88 => shape(\n      'var' => 'map_of_string_to_list_of_i32_with_default_value',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'just_an_A' => 1,\n    'set_of_i32' => 2,\n    'list_of_i32' => 3,\n    'list_of_string' => 4,\n    'map_of_string_to_i32' => 5,\n    'map_of_string_to_A' => 6,\n    'map_of_string_to_list_of_i32' => 7,\n    'map_of_string_to_list_of_A' => 8,\n    'map_of_string_to_set_of_i32' => 9,\n    'map_of_string_to_map_of_string_to_i32' => 10,\n    'map_of_string_to_map_of_string_to_A' => 11,\n    'list_of_set_of_i32' => 12,\n    'list_of_map_of_string_to_list_of_A' => 13,\n    'list_of_map_of_string_to_A' => 14,\n    'just_an_enum' => 17,\n    'just_a_union' => 18,\n    'optional_just_an_A' => 51,\n    'optional_set_of_i32' => 52,\n    'optional_list_of_i32' => 53,\n    'optional_list_of_string' => 54,\n    'optional_map_of_string_to_i32' => 55,\n    'optional_map_of_string_to_A' => 56,\n    'optional_map_of_string_to_list_of_i32' => 57,\n    'optional_map_of_string_to_list_of_A' => 58,\n    'optional_map_of_string_to_set_of_i32' => 59,\n    'optional_enum' => 60,\n    'required_enum_with_default' => 70,\n    'string_with_default_value' => 80,\n    'i32_with_default_value' => 81,\n    'double_with_default_value' => 82,\n    'enum_with_default_value' => 83,\n    'A_with_default_value' => 84,\n    'set_of_i32_with_default_value' => 85,\n    'map_of_i32_to_string_with_default_value' => 86,\n    'list_of_string_with_default_value' => 87,\n    'map_of_string_to_list_of_i32_with_default_value' => 88,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'just_an_A' => ?\\test\\fixtures\\A,\n    ?'set_of_i32' => ?Set<int>,\n    ?'list_of_i32' => ?Vector<int>,\n    ?'list_of_string' => ?Vector<string>,\n    ?'map_of_string_to_i32' => ?Map<string, int>,\n    ?'map_of_string_to_A' => ?Map<string, \\test\\fixtures\\A>,\n    ?'map_of_string_to_list_of_i32' => ?Map<string, Vector<int>>,\n    ?'map_of_string_to_list_of_A' => ?Map<string, Vector<\\test\\fixtures\\A>>,\n    ?'map_of_string_to_set_of_i32' => ?Map<string, Set<int>>,\n    ?'map_of_string_to_map_of_string_to_i32' => ?Map<string, Map<string, int>>,\n    ?'map_of_string_to_map_of_string_to_A' => ?Map<string, Map<string, \\test\\fixtures\\A>>,\n    ?'list_of_set_of_i32' => ?Vector<Set<int>>,\n    ?'list_of_map_of_string_to_list_of_A' => ?Vector<Map<string, Vector<\\test\\fixtures\\A>>>,\n    ?'list_of_map_of_string_to_A' => ?Vector<Map<string, \\test\\fixtures\\A>>,\n    ?'just_an_enum' => ?\\test\\fixtures\\Enum,\n    ?'just_a_union' => ?\\test\\fixtures\\Union,\n    ?'optional_just_an_A' => ?\\test\\fixtures\\A,\n    ?'optional_set_of_i32' => ?Set<int>,\n    ?'optional_list_of_i32' => ?Vector<int>,\n    ?'optional_list_of_string' => ?Vector<string>,\n    ?'optional_map_of_string_to_i32' => ?Map<string, int>,\n    ?'optional_map_of_string_to_A' => ?Map<string, \\test\\fixtures\\A>,\n    ?'optional_map_of_string_to_list_of_i32' => ?Map<string, Vector<int>>,\n    ?'optional_map_of_string_to_list_of_A' => ?Map<string, Vector<\\test\\fixtures\\A>>,\n    ?'optional_map_of_string_to_set_of_i32' => ?Map<string, Set<int>>,\n    ?'optional_enum' => ?\\test\\fixtures\\Enum,\n    ?'required_enum_with_default' => ?\\test\\fixtures\\Enum,\n    ?'string_with_default_value' => ?string,\n    ?'i32_with_default_value' => ?int,\n    ?'double_with_default_value' => ?float,\n    ?'enum_with_default_value' => ?\\test\\fixtures\\Enum,\n    ?'A_with_default_value' => ?\\test\\fixtures\\A,\n    ?'set_of_i32_with_default_value' => ?Set<int>,\n    ?'map_of_i32_to_string_with_default_value' => ?Map<int, string>,\n    ?'list_of_string_with_default_value' => ?Vector<string>,\n    ?'map_of_string_to_list_of_i32_with_default_value' => ?Map<string, Vector<int>>,\n  );\n\n  const type TShape = shape(\n    ?'just_an_A' => ?\\test\\fixtures\\A::TShape,\n    'set_of_i32' => dict<int, bool>,\n    'list_of_i32' => vec<int>,\n    'list_of_string' => vec<string>,\n    'map_of_string_to_i32' => dict<string, int>,\n    'map_of_string_to_A' => dict<string, \\test\\fixtures\\A::TShape>,\n    'map_of_string_to_list_of_i32' => dict<string, vec<int>>,\n    'map_of_string_to_list_of_A' => dict<string, vec<\\test\\fixtures\\A::TShape>>,\n    'map_of_string_to_set_of_i32' => dict<string, dict<int, bool>>,\n    'map_of_string_to_map_of_string_to_i32' => dict<string, dict<string, int>>,\n    'map_of_string_to_map_of_string_to_A' => dict<string, dict<string, \\test\\fixtures\\A::TShape>>,\n    'list_of_set_of_i32' => vec<dict<int, bool>>,\n    'list_of_map_of_string_to_list_of_A' => vec<dict<string, vec<\\test\\fixtures\\A::TShape>>>,\n    'list_of_map_of_string_to_A' => vec<dict<string, \\test\\fixtures\\A::TShape>>,\n    ?'just_an_enum' => ?\\test\\fixtures\\Enum,\n    ?'just_a_union' => ?\\test\\fixtures\\Union::TShape,\n    ?'optional_just_an_A' => ?\\test\\fixtures\\A::TShape,\n    ?'optional_set_of_i32' => ?dict<int, bool>,\n    ?'optional_list_of_i32' => ?vec<int>,\n    ?'optional_list_of_string' => ?vec<string>,\n    ?'optional_map_of_string_to_i32' => ?dict<string, int>,\n    ?'optional_map_of_string_to_A' => ?dict<string, \\test\\fixtures\\A::TShape>,\n    ?'optional_map_of_string_to_list_of_i32' => ?dict<string, vec<int>>,\n    ?'optional_map_of_string_to_list_of_A' => ?dict<string, vec<\\test\\fixtures\\A::TShape>>,\n    ?'optional_map_of_string_to_set_of_i32' => ?dict<string, dict<int, bool>>,\n    ?'optional_enum' => ?\\test\\fixtures\\Enum,\n    'required_enum_with_default' => \\test\\fixtures\\Enum,\n    'string_with_default_value' => string,\n    'i32_with_default_value' => int,\n    'double_with_default_value' => float,\n    ?'enum_with_default_value' => ?\\test\\fixtures\\Enum,\n    ?'A_with_default_value' => ?\\test\\fixtures\\A::TShape,\n    'set_of_i32_with_default_value' => dict<int, bool>,\n    'map_of_i32_to_string_with_default_value' => dict<int, string>,\n    'list_of_string_with_default_value' => vec<string>,\n    'map_of_string_to_list_of_i32_with_default_value' => dict<string, vec<int>>,\n    ...\n  );\n  const int STRUCTURAL_ID = 7290621384819644133;\n  /**\n   * Original thrift field:-\n   * 1: module.A just_an_A\n   */\n  public ?\\test\\fixtures\\A $just_an_A;\n  /**\n   * Original thrift field:-\n   * 2: set<i32> set_of_i32\n   */\n  public Set<int> $set_of_i32;\n  /**\n   * Original thrift field:-\n   * 3: list<i32> list_of_i32\n   */\n  public Vector<int> $list_of_i32;\n  /**\n   * Original thrift field:-\n   * 4: list<string> list_of_string\n   */\n  public Vector<string> $list_of_string;\n  /**\n   * Original thrift field:-\n   * 5: map<string, i32> map_of_string_to_i32\n   */\n  public Map<string, int> $map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 6: map<string, module.A> map_of_string_to_A\n   */\n  public Map<string, \\test\\fixtures\\A> $map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 7: map<string, list<i32>> map_of_string_to_list_of_i32\n   */\n  public Map<string, Vector<int>> $map_of_string_to_list_of_i32;\n  /**\n   * Original thrift field:-\n   * 8: map<string, list<module.A>> map_of_string_to_list_of_A\n   */\n  public Map<string, Vector<\\test\\fixtures\\A>> $map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 9: map<string, set<i32>> map_of_string_to_set_of_i32\n   */\n  public Map<string, Set<int>> $map_of_string_to_set_of_i32;\n  /**\n   * Original thrift field:-\n   * 10: map<string, map<string, i32>> map_of_string_to_map_of_string_to_i32\n   */\n  public Map<string, Map<string, int>> $map_of_string_to_map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 11: map<string, map<string, module.A>> map_of_string_to_map_of_string_to_A\n   */\n  public Map<string, Map<string, \\test\\fixtures\\A>> $map_of_string_to_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 12: list<set<i32>> list_of_set_of_i32\n   */\n  public Vector<Set<int>> $list_of_set_of_i32;\n  /**\n   * Original thrift field:-\n   * 13: list<map<string, list<module.A>>> list_of_map_of_string_to_list_of_A\n   */\n  public Vector<Map<string, Vector<\\test\\fixtures\\A>>> $list_of_map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 14: list<map<string, module.A>> list_of_map_of_string_to_A\n   */\n  public Vector<Map<string, \\test\\fixtures\\A>> $list_of_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 17: module.Enum just_an_enum\n   */\n  public ?\\test\\fixtures\\Enum $just_an_enum;\n  /**\n   * Original thrift field:-\n   * 18: module.Union just_a_union\n   */\n  public ?\\test\\fixtures\\Union $just_a_union;\n  /**\n   * Original thrift field:-\n   * 51: module.A optional_just_an_A\n   */\n  public ?\\test\\fixtures\\A $optional_just_an_A;\n  /**\n   * Original thrift field:-\n   * 52: set<i32> optional_set_of_i32\n   */\n  public ?Set<int> $optional_set_of_i32;\n  /**\n   * Original thrift field:-\n   * 53: list<i32> optional_list_of_i32\n   */\n  public ?Vector<int> $optional_list_of_i32;\n  /**\n   * Original thrift field:-\n   * 54: list<string> optional_list_of_string\n   */\n  public ?Vector<string> $optional_list_of_string;\n  /**\n   * Original thrift field:-\n   * 55: map<string, i32> optional_map_of_string_to_i32\n   */\n  public ?Map<string, int> $optional_map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 56: map<string, module.A> optional_map_of_string_to_A\n   */\n  public ?Map<string, \\test\\fixtures\\A> $optional_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 57: map<string, list<i32>> optional_map_of_string_to_list_of_i32\n   */\n  public ?Map<string, Vector<int>> $optional_map_of_string_to_list_of_i32;\n  /**\n   * Original thrift field:-\n   * 58: map<string, list<module.A>> optional_map_of_string_to_list_of_A\n   */\n  public ?Map<string, Vector<\\test\\fixtures\\A>> $optional_map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 59: map<string, set<i32>> optional_map_of_string_to_set_of_i32\n   */\n  public ?Map<string, Set<int>> $optional_map_of_string_to_set_of_i32;\n  /**\n   * Original thrift field:-\n   * 60: module.Enum optional_enum\n   */\n  public ?\\test\\fixtures\\Enum $optional_enum;\n  /**\n   * Original thrift field:-\n   * 70: module.Enum required_enum_with_default\n   */\n  public \\test\\fixtures\\Enum $required_enum_with_default;\n  /**\n   * Original thrift field:-\n   * 80: string string_with_default_value\n   */\n  public string $string_with_default_value;\n  /**\n   * Original thrift field:-\n   * 81: i32 i32_with_default_value\n   */\n  public int $i32_with_default_value;\n  /**\n   * Original thrift field:-\n   * 82: double double_with_default_value\n   */\n  public float $double_with_default_value;\n  /**\n   * Original thrift field:-\n   * 83: module.Enum enum_with_default_value\n   */\n  public ?\\test\\fixtures\\Enum $enum_with_default_value;\n  /**\n   * Original thrift field:-\n   * 84: module.A A_with_default_value\n   */\n  public ?\\test\\fixtures\\A $A_with_default_value;\n  /**\n   * Original thrift field:-\n   * 85: set<i32> set_of_i32_with_default_value\n   */\n  public Set<int> $set_of_i32_with_default_value;\n  /**\n   * Original thrift field:-\n   * 86: map<i32, string> map_of_i32_to_string_with_default_value\n   */\n  public Map<int, string> $map_of_i32_to_string_with_default_value;\n  /**\n   * Original thrift field:-\n   * 87: list<string> list_of_string_with_default_value\n   */\n  public Vector<string> $list_of_string_with_default_value;\n  /**\n   * Original thrift field:-\n   * 88: map<string, list<i32>> map_of_string_to_list_of_i32_with_default_value\n   */\n  public Map<string, Vector<int>> $map_of_string_to_list_of_i32_with_default_value;\n\n  public function __construct(?\\test\\fixtures\\A $just_an_A = null, ?Set<int> $set_of_i32 = null, ?Vector<int> $list_of_i32 = null, ?Vector<string> $list_of_string = null, ?Map<string, int> $map_of_string_to_i32 = null, ?Map<string, \\test\\fixtures\\A> $map_of_string_to_A = null, ?Map<string, Vector<int>> $map_of_string_to_list_of_i32 = null, ?Map<string, Vector<\\test\\fixtures\\A>> $map_of_string_to_list_of_A = null, ?Map<string, Set<int>> $map_of_string_to_set_of_i32 = null, ?Map<string, Map<string, int>> $map_of_string_to_map_of_string_to_i32 = null, ?Map<string, Map<string, \\test\\fixtures\\A>> $map_of_string_to_map_of_string_to_A = null, ?Vector<Set<int>> $list_of_set_of_i32 = null, ?Vector<Map<string, Vector<\\test\\fixtures\\A>>> $list_of_map_of_string_to_list_of_A = null, ?Vector<Map<string, \\test\\fixtures\\A>> $list_of_map_of_string_to_A = null, ?\\test\\fixtures\\Enum $just_an_enum = null, ?\\test\\fixtures\\Union $just_a_union = null, ?\\test\\fixtures\\A $optional_just_an_A = null, ?Set<int> $optional_set_of_i32 = null, ?Vector<int> $optional_list_of_i32 = null, ?Vector<string> $optional_list_of_string = null, ?Map<string, int> $optional_map_of_string_to_i32 = null, ?Map<string, \\test\\fixtures\\A> $optional_map_of_string_to_A = null, ?Map<string, Vector<int>> $optional_map_of_string_to_list_of_i32 = null, ?Map<string, Vector<\\test\\fixtures\\A>> $optional_map_of_string_to_list_of_A = null, ?Map<string, Set<int>> $optional_map_of_string_to_set_of_i32 = null, ?\\test\\fixtures\\Enum $optional_enum = null, ?\\test\\fixtures\\Enum $required_enum_with_default = null, ?string $string_with_default_value = null, ?int $i32_with_default_value = null, ?float $double_with_default_value = null, ?\\test\\fixtures\\Enum $enum_with_default_value = null, ?\\test\\fixtures\\A $A_with_default_value = null, ?Set<int> $set_of_i32_with_default_value = null, ?Map<int, string> $map_of_i32_to_string_with_default_value = null, ?Vector<string> $list_of_string_with_default_value = null, ?Map<string, Vector<int>> $map_of_string_to_list_of_i32_with_default_value = null)[] {\n    $this->just_an_A = $just_an_A;\n    $this->set_of_i32 = $set_of_i32 ?? Set {};\n    $this->list_of_i32 = $list_of_i32 ?? Vector {};\n    $this->list_of_string = $list_of_string ?? Vector {};\n    $this->map_of_string_to_i32 = $map_of_string_to_i32 ?? Map {};\n    $this->map_of_string_to_A = $map_of_string_to_A ?? Map {};\n    $this->map_of_string_to_list_of_i32 = $map_of_string_to_list_of_i32 ?? Map {};\n    $this->map_of_string_to_list_of_A = $map_of_string_to_list_of_A ?? Map {};\n    $this->map_of_string_to_set_of_i32 = $map_of_string_to_set_of_i32 ?? Map {};\n    $this->map_of_string_to_map_of_string_to_i32 = $map_of_string_to_map_of_string_to_i32 ?? Map {};\n    $this->map_of_string_to_map_of_string_to_A = $map_of_string_to_map_of_string_to_A ?? Map {};\n    $this->list_of_set_of_i32 = $list_of_set_of_i32 ?? Vector {};\n    $this->list_of_map_of_string_to_list_of_A = $list_of_map_of_string_to_list_of_A ?? Vector {};\n    $this->list_of_map_of_string_to_A = $list_of_map_of_string_to_A ?? Vector {};\n    $this->just_an_enum = $just_an_enum;\n    $this->just_a_union = $just_a_union;\n    $this->optional_just_an_A = $optional_just_an_A;\n    $this->optional_set_of_i32 = $optional_set_of_i32;\n    $this->optional_list_of_i32 = $optional_list_of_i32;\n    $this->optional_list_of_string = $optional_list_of_string;\n    $this->optional_map_of_string_to_i32 = $optional_map_of_string_to_i32;\n    $this->optional_map_of_string_to_A = $optional_map_of_string_to_A;\n    $this->optional_map_of_string_to_list_of_i32 = $optional_map_of_string_to_list_of_i32;\n    $this->optional_map_of_string_to_list_of_A = $optional_map_of_string_to_list_of_A;\n    $this->optional_map_of_string_to_set_of_i32 = $optional_map_of_string_to_set_of_i32;\n    $this->optional_enum = $optional_enum;\n    $this->required_enum_with_default = $required_enum_with_default ?? \\test\\fixtures\\Enum::ENUM;\n    $this->string_with_default_value = $string_with_default_value ?? \"de_fault_in_our_stars\";\n    $this->i32_with_default_value = $i32_with_default_value ?? 1729;\n    $this->double_with_default_value = $double_with_default_value ?? 3.14159;\n    $this->enum_with_default_value = $enum_with_default_value ?? \\test\\fixtures\\Enum::ENUM;\n    $this->A_with_default_value = $A_with_default_value;\n    $this->set_of_i32_with_default_value = $set_of_i32_with_default_value ?? Set {\n      3,\n      7,\n      31,\n      127,\n    };\n    $this->map_of_i32_to_string_with_default_value = $map_of_i32_to_string_with_default_value ?? Map {\n      1 => \"fish\",\n      2 => \"fish\",\n    };\n    $this->list_of_string_with_default_value = $list_of_string_with_default_value ?? Vector {\n      \"red fish\",\n      \"blue fish\",\n    };\n    $this->map_of_string_to_list_of_i32_with_default_value = $map_of_string_to_list_of_i32_with_default_value ?? Map {\n      \"Jenny\" => Vector {\n        8,\n        6,\n        7,\n        5,\n        3,\n        0,\n        9,\n      },\n    };\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'just_an_A'),\n      Shapes::idx($shape, 'set_of_i32'),\n      Shapes::idx($shape, 'list_of_i32'),\n      Shapes::idx($shape, 'list_of_string'),\n      Shapes::idx($shape, 'map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_A'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_i32'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'map_of_string_to_set_of_i32'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_A'),\n      Shapes::idx($shape, 'list_of_set_of_i32'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_A'),\n      Shapes::idx($shape, 'just_an_enum'),\n      Shapes::idx($shape, 'just_a_union'),\n      Shapes::idx($shape, 'optional_just_an_A'),\n      Shapes::idx($shape, 'optional_set_of_i32'),\n      Shapes::idx($shape, 'optional_list_of_i32'),\n      Shapes::idx($shape, 'optional_list_of_string'),\n      Shapes::idx($shape, 'optional_map_of_string_to_i32'),\n      Shapes::idx($shape, 'optional_map_of_string_to_A'),\n      Shapes::idx($shape, 'optional_map_of_string_to_list_of_i32'),\n      Shapes::idx($shape, 'optional_map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'optional_map_of_string_to_set_of_i32'),\n      Shapes::idx($shape, 'optional_enum'),\n      Shapes::idx($shape, 'required_enum_with_default'),\n      Shapes::idx($shape, 'string_with_default_value'),\n      Shapes::idx($shape, 'i32_with_default_value'),\n      Shapes::idx($shape, 'double_with_default_value'),\n      Shapes::idx($shape, 'enum_with_default_value'),\n      Shapes::idx($shape, 'A_with_default_value'),\n      Shapes::idx($shape, 'set_of_i32_with_default_value'),\n      Shapes::idx($shape, 'map_of_i32_to_string_with_default_value'),\n      Shapes::idx($shape, 'list_of_string_with_default_value'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_i32_with_default_value'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'B';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.B\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.A\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"just_an_A\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"set_of_i32\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_i32\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_string\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_i32\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.A\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_A\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_i32\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_A\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_set_of_i32\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 10,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_i32\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 11,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_A\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 12,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_set_of_i32\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 13,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                                    shape(\n                                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.A\",\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_list_of_A\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 14,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_A\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 17,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Enum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"just_an_enum\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 18,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Union\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"just_a_union\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 51,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.A\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_just_an_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 52,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_set_of_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 53,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_list_of_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 54,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_list_of_string\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 55,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_map_of_string_to_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 56,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.A\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_map_of_string_to_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 57,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_map_of_string_to_list_of_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 58,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_map_of_string_to_list_of_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 59,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_map_of_string_to_set_of_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 60,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Enum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_enum\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 70,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Enum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"required_enum_with_default\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 80,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"string_with_default_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 81,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i32_with_default_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 82,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"double_with_default_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 83,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Enum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"enum_with_default_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 84,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.A\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"A_with_default_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 85,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"set_of_i32_with_default_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 86,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_i32_to_string_with_default_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 87,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_string_with_default_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 88,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_i32_with_default_value\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'just_an_A') === null ? null : (\\test\\fixtures\\A::__fromShape($shape['just_an_A'])),\n      new Set(Keyset\\keys($shape['set_of_i32'])),\n      $shape['list_of_i32'] |> new Vector($$),\n      $shape['list_of_string'] |> new Vector($$),\n      $shape['map_of_string_to_i32'] |> new Map($$),\n      $shape['map_of_string_to_A']\n        |> Dict\\map(\n          $$,\n          $_val0 ==> $_val0\n            |> \\test\\fixtures\\A::__fromShape($$),\n        ) |> new Map($$),\n      $shape['map_of_string_to_list_of_i32']\n        |> Dict\\map(\n          $$,\n          $_val1 ==> $_val1 |> new Vector($$),\n        ) |> new Map($$),\n      $shape['map_of_string_to_list_of_A']\n        |> Dict\\map(\n          $$,\n          $_val3 ==> $_val3\n            |> Vec\\map(\n              $$,\n              $_val2 ==> $_val2\n                |> \\test\\fixtures\\A::__fromShape($$),\n            ) |> new Vector($$),\n        ) |> new Map($$),\n      $shape['map_of_string_to_set_of_i32']\n        |> Dict\\map(\n          $$,\n          $_val4 ==> $_val4\n            |> new Set(Keyset\\keys($$)),\n        ) |> new Map($$),\n      $shape['map_of_string_to_map_of_string_to_i32']\n        |> Dict\\map(\n          $$,\n          $_val5 ==> $_val5 |> new Map($$),\n        ) |> new Map($$),\n      $shape['map_of_string_to_map_of_string_to_A']\n        |> Dict\\map(\n          $$,\n          $_val7 ==> $_val7\n            |> Dict\\map(\n              $$,\n              $_val6 ==> $_val6\n                |> \\test\\fixtures\\A::__fromShape($$),\n            ) |> new Map($$),\n        ) |> new Map($$),\n      $shape['list_of_set_of_i32']\n        |> Vec\\map(\n          $$,\n          $_val8 ==> $_val8\n            |> new Set(Keyset\\keys($$)),\n        ) |> new Vector($$),\n      $shape['list_of_map_of_string_to_list_of_A']\n        |> Vec\\map(\n          $$,\n          $_val11 ==> $_val11\n            |> Dict\\map(\n              $$,\n              $_val10 ==> $_val10\n                |> Vec\\map(\n                  $$,\n                  $_val9 ==> $_val9\n                    |> \\test\\fixtures\\A::__fromShape($$),\n                ) |> new Vector($$),\n            ) |> new Map($$),\n        ) |> new Vector($$),\n      $shape['list_of_map_of_string_to_A']\n        |> Vec\\map(\n          $$,\n          $_val13 ==> $_val13\n            |> Dict\\map(\n              $$,\n              $_val12 ==> $_val12\n                |> \\test\\fixtures\\A::__fromShape($$),\n            ) |> new Map($$),\n        ) |> new Vector($$),\n      Shapes::idx($shape, 'just_an_enum'),\n      Shapes::idx($shape, 'just_a_union') === null ? null : (\\test\\fixtures\\Union::__fromShape($shape['just_a_union'])),\n      Shapes::idx($shape, 'optional_just_an_A') === null ? null : (\\test\\fixtures\\A::__fromShape($shape['optional_just_an_A'])),\n      Shapes::idx($shape, 'optional_set_of_i32') === null ? null : (new Set(Keyset\\keys($shape['optional_set_of_i32']))),\n      Shapes::idx($shape, 'optional_list_of_i32') === null ? null : ($shape['optional_list_of_i32'] |> new Vector($$)),\n      Shapes::idx($shape, 'optional_list_of_string') === null ? null : ($shape['optional_list_of_string'] |> new Vector($$)),\n      Shapes::idx($shape, 'optional_map_of_string_to_i32') === null ? null : ($shape['optional_map_of_string_to_i32'] |> new Map($$)),\n      Shapes::idx($shape, 'optional_map_of_string_to_A') === null ? null : ($shape['optional_map_of_string_to_A']\n        |> Dict\\map(\n          $$,\n          $_val14 ==> $_val14\n            |> \\test\\fixtures\\A::__fromShape($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'optional_map_of_string_to_list_of_i32') === null ? null : ($shape['optional_map_of_string_to_list_of_i32']\n        |> Dict\\map(\n          $$,\n          $_val15 ==> $_val15 |> new Vector($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'optional_map_of_string_to_list_of_A') === null ? null : ($shape['optional_map_of_string_to_list_of_A']\n        |> Dict\\map(\n          $$,\n          $_val17 ==> $_val17\n            |> Vec\\map(\n              $$,\n              $_val16 ==> $_val16\n                |> \\test\\fixtures\\A::__fromShape($$),\n            ) |> new Vector($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'optional_map_of_string_to_set_of_i32') === null ? null : ($shape['optional_map_of_string_to_set_of_i32']\n        |> Dict\\map(\n          $$,\n          $_val18 ==> $_val18\n            |> new Set(Keyset\\keys($$)),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'optional_enum'),\n      $shape['required_enum_with_default'],\n      $shape['string_with_default_value'],\n      $shape['i32_with_default_value'],\n      $shape['double_with_default_value'],\n      Shapes::idx($shape, 'enum_with_default_value'),\n      Shapes::idx($shape, 'A_with_default_value') === null ? null : (\\test\\fixtures\\A::__fromShape($shape['A_with_default_value'])),\n      new Set(Keyset\\keys($shape['set_of_i32_with_default_value'])),\n      $shape['map_of_i32_to_string_with_default_value'] |> new Map($$),\n      $shape['list_of_string_with_default_value'] |> new Vector($$),\n      $shape['map_of_string_to_list_of_i32_with_default_value']\n        |> Dict\\map(\n          $$,\n          $_val19 ==> $_val19 |> new Vector($$),\n        ) |> new Map($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'just_an_A' => $this->just_an_A?->__toShape(),\n      'set_of_i32' => ThriftUtil::toDArray(Dict\\fill_keys($this->set_of_i32->toValuesArray(), true), static::class),\n      'list_of_i32' => vec($this->list_of_i32),\n      'list_of_string' => vec($this->list_of_string),\n      'map_of_string_to_i32' => dict($this->map_of_string_to_i32),\n      'map_of_string_to_A' => $this->map_of_string_to_A->map(\n        ($_val0) ==> $_val0->__toShape(),\n      )\n        |> dict($$),\n      'map_of_string_to_list_of_i32' => $this->map_of_string_to_list_of_i32->map(\n        ($_val0) ==> vec($_val0),\n      )\n        |> dict($$),\n      'map_of_string_to_list_of_A' => $this->map_of_string_to_list_of_A->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> vec($$),\n      )\n        |> dict($$),\n      'map_of_string_to_set_of_i32' => $this->map_of_string_to_set_of_i32->map(\n        ($_val0) ==> ThriftUtil::toDArray(Dict\\fill_keys($_val0, true), static::class),\n      )\n        |> dict($$),\n      'map_of_string_to_map_of_string_to_i32' => $this->map_of_string_to_map_of_string_to_i32->map(\n        ($_val0) ==> dict($_val0),\n      )\n        |> dict($$),\n      'map_of_string_to_map_of_string_to_A' => $this->map_of_string_to_map_of_string_to_A->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> dict($$),\n      )\n        |> dict($$),\n      'list_of_set_of_i32' => $this->list_of_set_of_i32->map(\n        ($_val0) ==> ThriftUtil::toDArray(Dict\\fill_keys($_val0, true), static::class),\n      )\n        |> vec($$),\n      'list_of_map_of_string_to_list_of_A' => $this->list_of_map_of_string_to_list_of_A->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->map(\n            ($_val2) ==> $_val2->__toShape(),\n          )\n            |> vec($$),\n        )\n          |> dict($$),\n      )\n        |> vec($$),\n      'list_of_map_of_string_to_A' => $this->list_of_map_of_string_to_A->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> dict($$),\n      )\n        |> vec($$),\n      'just_an_enum' => $this->just_an_enum,\n      'just_a_union' => $this->just_a_union?->__toShape(),\n      'optional_just_an_A' => $this->optional_just_an_A?->__toShape(),\n      'optional_set_of_i32' => $this->optional_set_of_i32\n        |> $$ === null ? null : ThriftUtil::toDArray(Dict\\fill_keys($$->toValuesArray(), true), static::class),\n      'optional_list_of_i32' => $this->optional_list_of_i32\n        |> $$ === null ? null : vec($$),\n      'optional_list_of_string' => $this->optional_list_of_string\n        |> $$ === null ? null : vec($$),\n      'optional_map_of_string_to_i32' => $this->optional_map_of_string_to_i32\n        |> $$ === null ? null : dict($$),\n      'optional_map_of_string_to_A' => $this->optional_map_of_string_to_A?->map(\n        ($_val0) ==> $_val0->__toShape(),\n      )\n        |> $$ === null ? null : dict($$),\n      'optional_map_of_string_to_list_of_i32' => $this->optional_map_of_string_to_list_of_i32?->map(\n        ($_val0) ==> vec($_val0),\n      )\n        |> $$ === null ? null : dict($$),\n      'optional_map_of_string_to_list_of_A' => $this->optional_map_of_string_to_list_of_A?->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> vec($$),\n      )\n        |> $$ === null ? null : dict($$),\n      'optional_map_of_string_to_set_of_i32' => $this->optional_map_of_string_to_set_of_i32?->map(\n        ($_val0) ==> ThriftUtil::toDArray(Dict\\fill_keys($_val0, true), static::class),\n      )\n        |> $$ === null ? null : dict($$),\n      'optional_enum' => $this->optional_enum,\n      'required_enum_with_default' => $this->required_enum_with_default,\n      'string_with_default_value' => $this->string_with_default_value,\n      'i32_with_default_value' => $this->i32_with_default_value,\n      'double_with_default_value' => $this->double_with_default_value,\n      'enum_with_default_value' => $this->enum_with_default_value,\n      'A_with_default_value' => $this->A_with_default_value?->__toShape(),\n      'set_of_i32_with_default_value' => ThriftUtil::toDArray(Dict\\fill_keys($this->set_of_i32_with_default_value->toValuesArray(), true), static::class),\n      'map_of_i32_to_string_with_default_value' => dict($this->map_of_i32_to_string_with_default_value),\n      'list_of_string_with_default_value' => vec($this->list_of_string_with_default_value),\n      'map_of_string_to_list_of_i32_with_default_value' => $this->map_of_string_to_list_of_i32_with_default_value->map(\n        ($_val0) ==> vec($_val0),\n      )\n        |> dict($$),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 2302}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace test\\fixtures;\n\n/**\n * Original thrift enum:-\n * Enum\n */\nenum Enum: int {\n  ENUM = 1;\n}\n\nclass Enum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.Enum\",\n        \"elements\" => dict[\n          1 => \"ENUM\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\nenum UnionEnum: int {\n  _EMPTY_ = 0;\n  intValue = 1;\n  stringValue = 5;\n}\n\n/**\n * Original thrift struct:-\n * Union\n */\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<\\test\\fixtures\\UnionEnum>, \\IThriftShapishSyncStruct {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'intValue',\n      'union' => true,\n      'type' => \\TType::I64,\n    ),\n    5 => shape(\n      'var' => 'stringValue',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'intValue' => 1,\n    'stringValue' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'intValue' => ?int,\n    ?'stringValue' => ?string,\n  );\n\n  const type TShape = shape(\n    ?'intValue' => ?int,\n    ?'stringValue' => ?string,\n  );\n  const int STRUCTURAL_ID = 7430801321277306554;\n  /**\n   * Original thrift field:-\n   * 1: i64 intValue\n   */\n  public ?int $intValue;\n  /**\n   * Original thrift field:-\n   * 5: string stringValue\n   */\n  public ?string $stringValue;\n  protected \\test\\fixtures\\UnionEnum $_type = \\test\\fixtures\\UnionEnum::_EMPTY_;\n\n  public function __construct(?int $intValue = null, ?string $stringValue = null)[] {\n    $this->_type = \\test\\fixtures\\UnionEnum::_EMPTY_;\n    if ($intValue !== null) {\n      $this->intValue = $intValue;\n      $this->_type = \\test\\fixtures\\UnionEnum::intValue;\n    }\n    if ($stringValue !== null) {\n      $this->stringValue = $stringValue;\n      $this->_type = \\test\\fixtures\\UnionEnum::stringValue;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'intValue'),\n      Shapes::idx($shape, 'stringValue'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function getType()[]: \\test\\fixtures\\UnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case \\test\\fixtures\\UnionEnum::intValue:\n        $this->intValue = null;\n        break;\n      case \\test\\fixtures\\UnionEnum::stringValue:\n        $this->stringValue = null;\n        break;\n      case \\test\\fixtures\\UnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = \\test\\fixtures\\UnionEnum::_EMPTY_;\n  }\n\n  public function set_intValue(int $intValue)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\UnionEnum::intValue;\n    $this->intValue = $intValue;\n    return $this;\n  }\n\n  public function get_intValue()[]: ?int {\n    return $this->intValue;\n  }\n\n  public function getx_intValue()[]: int {\n    invariant(\n      $this->_type === \\test\\fixtures\\UnionEnum::intValue,\n      'get_intValue called on an instance of Union whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->intValue as nonnull;\n  }\n\n  public function set_stringValue(string $stringValue)[write_props]: this {\n    $this->reset();\n    $this->_type = \\test\\fixtures\\UnionEnum::stringValue;\n    $this->stringValue = $stringValue;\n    return $this;\n  }\n\n  public function get_stringValue()[]: ?string {\n    return $this->stringValue;\n  }\n\n  public function getx_stringValue()[]: string {\n    invariant(\n      $this->_type === \\test\\fixtures\\UnionEnum::stringValue,\n      'get_stringValue called on an instance of Union whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->stringValue as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Union\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"intValue\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"stringValue\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'intValue'),\n      Shapes::idx($shape, 'stringValue'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'intValue' => $this->intValue,\n      'stringValue' => $this->stringValue,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * A\n */\nclass A implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?string,\n  );\n\n  const type TShape = shape(\n    'a' => string,\n  );\n  const int STRUCTURAL_ID = 7939807933046472325;\n  /**\n   * Original thrift field:-\n   * 1: string a\n   */\n  public string $a;\n\n  public function __construct(?string $a = null)[] {\n    $this->a = $a ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'A';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.A\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['a'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'a' => $this->a,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * B\n */\nclass B implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'just_an_A',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\A::class,\n    ),\n    2 => shape(\n      'var' => 'set_of_i32',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'list_of_i32',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    4 => shape(\n      'var' => 'list_of_string',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    5 => shape(\n      'var' => 'map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    6 => shape(\n      'var' => 'map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\test\\fixtures\\A::class,\n      ),\n      'format' => 'collection',\n    ),\n    7 => shape(\n      'var' => 'map_of_string_to_list_of_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    8 => shape(\n      'var' => 'map_of_string_to_list_of_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRUCT,\n        'elem' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => \\test\\fixtures\\A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    9 => shape(\n      'var' => 'map_of_string_to_set_of_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::SET,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::SET,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    10 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    11 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => \\test\\fixtures\\A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    12 => shape(\n      'var' => 'list_of_set_of_i32',\n      'type' => \\TType::LST,\n      'etype' => \\TType::SET,\n      'elem' => shape(\n        'type' => \\TType::SET,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    13 => shape(\n      'var' => 'list_of_map_of_string_to_list_of_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::LST,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::LST,\n          'etype' => \\TType::STRUCT,\n          'elem' => shape(\n            'type' => \\TType::STRUCT,\n            'class' => \\test\\fixtures\\A::class,\n          ),\n          'format' => 'collection',\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    14 => shape(\n      'var' => 'list_of_map_of_string_to_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => \\test\\fixtures\\A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    17 => shape(\n      'var' => 'just_an_enum',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\Enum::class,\n    ),\n    18 => shape(\n      'var' => 'just_a_union',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\Union::class,\n    ),\n    51 => shape(\n      'var' => 'optional_just_an_A',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\A::class,\n    ),\n    52 => shape(\n      'var' => 'optional_set_of_i32',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    53 => shape(\n      'var' => 'optional_list_of_i32',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    54 => shape(\n      'var' => 'optional_list_of_string',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    55 => shape(\n      'var' => 'optional_map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    56 => shape(\n      'var' => 'optional_map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\test\\fixtures\\A::class,\n      ),\n      'format' => 'collection',\n    ),\n    57 => shape(\n      'var' => 'optional_map_of_string_to_list_of_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    58 => shape(\n      'var' => 'optional_map_of_string_to_list_of_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRUCT,\n        'elem' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => \\test\\fixtures\\A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    59 => shape(\n      'var' => 'optional_map_of_string_to_set_of_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::SET,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::SET,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    60 => shape(\n      'var' => 'optional_enum',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\Enum::class,\n    ),\n    70 => shape(\n      'var' => 'required_enum_with_default',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\Enum::class,\n    ),\n    80 => shape(\n      'var' => 'string_with_default_value',\n      'type' => \\TType::STRING,\n    ),\n    81 => shape(\n      'var' => 'i32_with_default_value',\n      'type' => \\TType::I32,\n    ),\n    82 => shape(\n      'var' => 'double_with_default_value',\n      'type' => \\TType::DOUBLE,\n    ),\n    83 => shape(\n      'var' => 'enum_with_default_value',\n      'type' => \\TType::I32,\n      'enum' => \\test\\fixtures\\Enum::class,\n    ),\n    84 => shape(\n      'var' => 'A_with_default_value',\n      'type' => \\TType::STRUCT,\n      'class' => \\test\\fixtures\\A::class,\n    ),\n    85 => shape(\n      'var' => 'set_of_i32_with_default_value',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    86 => shape(\n      'var' => 'map_of_i32_to_string_with_default_value',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    87 => shape(\n      'var' => 'list_of_string_with_default_value',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    88 => shape(\n      'var' => 'map_of_string_to_list_of_i32_with_default_value',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'just_an_A' => 1,\n    'set_of_i32' => 2,\n    'list_of_i32' => 3,\n    'list_of_string' => 4,\n    'map_of_string_to_i32' => 5,\n    'map_of_string_to_A' => 6,\n    'map_of_string_to_list_of_i32' => 7,\n    'map_of_string_to_list_of_A' => 8,\n    'map_of_string_to_set_of_i32' => 9,\n    'map_of_string_to_map_of_string_to_i32' => 10,\n    'map_of_string_to_map_of_string_to_A' => 11,\n    'list_of_set_of_i32' => 12,\n    'list_of_map_of_string_to_list_of_A' => 13,\n    'list_of_map_of_string_to_A' => 14,\n    'just_an_enum' => 17,\n    'just_a_union' => 18,\n    'optional_just_an_A' => 51,\n    'optional_set_of_i32' => 52,\n    'optional_list_of_i32' => 53,\n    'optional_list_of_string' => 54,\n    'optional_map_of_string_to_i32' => 55,\n    'optional_map_of_string_to_A' => 56,\n    'optional_map_of_string_to_list_of_i32' => 57,\n    'optional_map_of_string_to_list_of_A' => 58,\n    'optional_map_of_string_to_set_of_i32' => 59,\n    'optional_enum' => 60,\n    'required_enum_with_default' => 70,\n    'string_with_default_value' => 80,\n    'i32_with_default_value' => 81,\n    'double_with_default_value' => 82,\n    'enum_with_default_value' => 83,\n    'A_with_default_value' => 84,\n    'set_of_i32_with_default_value' => 85,\n    'map_of_i32_to_string_with_default_value' => 86,\n    'list_of_string_with_default_value' => 87,\n    'map_of_string_to_list_of_i32_with_default_value' => 88,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'just_an_A' => ?\\test\\fixtures\\A,\n    ?'set_of_i32' => ?Set<int>,\n    ?'list_of_i32' => ?Vector<int>,\n    ?'list_of_string' => ?Vector<string>,\n    ?'map_of_string_to_i32' => ?Map<string, int>,\n    ?'map_of_string_to_A' => ?Map<string, \\test\\fixtures\\A>,\n    ?'map_of_string_to_list_of_i32' => ?Map<string, Vector<int>>,\n    ?'map_of_string_to_list_of_A' => ?Map<string, Vector<\\test\\fixtures\\A>>,\n    ?'map_of_string_to_set_of_i32' => ?Map<string, Set<int>>,\n    ?'map_of_string_to_map_of_string_to_i32' => ?Map<string, Map<string, int>>,\n    ?'map_of_string_to_map_of_string_to_A' => ?Map<string, Map<string, \\test\\fixtures\\A>>,\n    ?'list_of_set_of_i32' => ?Vector<Set<int>>,\n    ?'list_of_map_of_string_to_list_of_A' => ?Vector<Map<string, Vector<\\test\\fixtures\\A>>>,\n    ?'list_of_map_of_string_to_A' => ?Vector<Map<string, \\test\\fixtures\\A>>,\n    ?'just_an_enum' => ?\\test\\fixtures\\Enum,\n    ?'just_a_union' => ?\\test\\fixtures\\Union,\n    ?'optional_just_an_A' => ?\\test\\fixtures\\A,\n    ?'optional_set_of_i32' => ?Set<int>,\n    ?'optional_list_of_i32' => ?Vector<int>,\n    ?'optional_list_of_string' => ?Vector<string>,\n    ?'optional_map_of_string_to_i32' => ?Map<string, int>,\n    ?'optional_map_of_string_to_A' => ?Map<string, \\test\\fixtures\\A>,\n    ?'optional_map_of_string_to_list_of_i32' => ?Map<string, Vector<int>>,\n    ?'optional_map_of_string_to_list_of_A' => ?Map<string, Vector<\\test\\fixtures\\A>>,\n    ?'optional_map_of_string_to_set_of_i32' => ?Map<string, Set<int>>,\n    ?'optional_enum' => ?\\test\\fixtures\\Enum,\n    ?'required_enum_with_default' => ?\\test\\fixtures\\Enum,\n    ?'string_with_default_value' => ?string,\n    ?'i32_with_default_value' => ?int,\n    ?'double_with_default_value' => ?float,\n    ?'enum_with_default_value' => ?\\test\\fixtures\\Enum,\n    ?'A_with_default_value' => ?\\test\\fixtures\\A,\n    ?'set_of_i32_with_default_value' => ?Set<int>,\n    ?'map_of_i32_to_string_with_default_value' => ?Map<int, string>,\n    ?'list_of_string_with_default_value' => ?Vector<string>,\n    ?'map_of_string_to_list_of_i32_with_default_value' => ?Map<string, Vector<int>>,\n  );\n\n  const type TShape = shape(\n    ?'just_an_A' => ?\\test\\fixtures\\A::TShape,\n    'set_of_i32' => dict<int, bool>,\n    'list_of_i32' => vec<int>,\n    'list_of_string' => vec<string>,\n    'map_of_string_to_i32' => dict<string, int>,\n    'map_of_string_to_A' => dict<string, \\test\\fixtures\\A::TShape>,\n    'map_of_string_to_list_of_i32' => dict<string, vec<int>>,\n    'map_of_string_to_list_of_A' => dict<string, vec<\\test\\fixtures\\A::TShape>>,\n    'map_of_string_to_set_of_i32' => dict<string, dict<int, bool>>,\n    'map_of_string_to_map_of_string_to_i32' => dict<string, dict<string, int>>,\n    'map_of_string_to_map_of_string_to_A' => dict<string, dict<string, \\test\\fixtures\\A::TShape>>,\n    'list_of_set_of_i32' => vec<dict<int, bool>>,\n    'list_of_map_of_string_to_list_of_A' => vec<dict<string, vec<\\test\\fixtures\\A::TShape>>>,\n    'list_of_map_of_string_to_A' => vec<dict<string, \\test\\fixtures\\A::TShape>>,\n    ?'just_an_enum' => ?\\test\\fixtures\\Enum,\n    ?'just_a_union' => ?\\test\\fixtures\\Union::TShape,\n    ?'optional_just_an_A' => ?\\test\\fixtures\\A::TShape,\n    ?'optional_set_of_i32' => ?dict<int, bool>,\n    ?'optional_list_of_i32' => ?vec<int>,\n    ?'optional_list_of_string' => ?vec<string>,\n    ?'optional_map_of_string_to_i32' => ?dict<string, int>,\n    ?'optional_map_of_string_to_A' => ?dict<string, \\test\\fixtures\\A::TShape>,\n    ?'optional_map_of_string_to_list_of_i32' => ?dict<string, vec<int>>,\n    ?'optional_map_of_string_to_list_of_A' => ?dict<string, vec<\\test\\fixtures\\A::TShape>>,\n    ?'optional_map_of_string_to_set_of_i32' => ?dict<string, dict<int, bool>>,\n    ?'optional_enum' => ?\\test\\fixtures\\Enum,\n    'required_enum_with_default' => \\test\\fixtures\\Enum,\n    'string_with_default_value' => string,\n    'i32_with_default_value' => int,\n    'double_with_default_value' => float,\n    ?'enum_with_default_value' => ?\\test\\fixtures\\Enum,\n    ?'A_with_default_value' => ?\\test\\fixtures\\A::TShape,\n    'set_of_i32_with_default_value' => dict<int, bool>,\n    'map_of_i32_to_string_with_default_value' => dict<int, string>,\n    'list_of_string_with_default_value' => vec<string>,\n    'map_of_string_to_list_of_i32_with_default_value' => dict<string, vec<int>>,\n  );\n  const int STRUCTURAL_ID = 7290621384819644133;\n  /**\n   * Original thrift field:-\n   * 1: module.A just_an_A\n   */\n  public ?\\test\\fixtures\\A $just_an_A;\n  /**\n   * Original thrift field:-\n   * 2: set<i32> set_of_i32\n   */\n  public Set<int> $set_of_i32;\n  /**\n   * Original thrift field:-\n   * 3: list<i32> list_of_i32\n   */\n  public Vector<int> $list_of_i32;\n  /**\n   * Original thrift field:-\n   * 4: list<string> list_of_string\n   */\n  public Vector<string> $list_of_string;\n  /**\n   * Original thrift field:-\n   * 5: map<string, i32> map_of_string_to_i32\n   */\n  public Map<string, int> $map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 6: map<string, module.A> map_of_string_to_A\n   */\n  public Map<string, \\test\\fixtures\\A> $map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 7: map<string, list<i32>> map_of_string_to_list_of_i32\n   */\n  public Map<string, Vector<int>> $map_of_string_to_list_of_i32;\n  /**\n   * Original thrift field:-\n   * 8: map<string, list<module.A>> map_of_string_to_list_of_A\n   */\n  public Map<string, Vector<\\test\\fixtures\\A>> $map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 9: map<string, set<i32>> map_of_string_to_set_of_i32\n   */\n  public Map<string, Set<int>> $map_of_string_to_set_of_i32;\n  /**\n   * Original thrift field:-\n   * 10: map<string, map<string, i32>> map_of_string_to_map_of_string_to_i32\n   */\n  public Map<string, Map<string, int>> $map_of_string_to_map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 11: map<string, map<string, module.A>> map_of_string_to_map_of_string_to_A\n   */\n  public Map<string, Map<string, \\test\\fixtures\\A>> $map_of_string_to_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 12: list<set<i32>> list_of_set_of_i32\n   */\n  public Vector<Set<int>> $list_of_set_of_i32;\n  /**\n   * Original thrift field:-\n   * 13: list<map<string, list<module.A>>> list_of_map_of_string_to_list_of_A\n   */\n  public Vector<Map<string, Vector<\\test\\fixtures\\A>>> $list_of_map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 14: list<map<string, module.A>> list_of_map_of_string_to_A\n   */\n  public Vector<Map<string, \\test\\fixtures\\A>> $list_of_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 17: module.Enum just_an_enum\n   */\n  public ?\\test\\fixtures\\Enum $just_an_enum;\n  /**\n   * Original thrift field:-\n   * 18: module.Union just_a_union\n   */\n  public ?\\test\\fixtures\\Union $just_a_union;\n  /**\n   * Original thrift field:-\n   * 51: module.A optional_just_an_A\n   */\n  public ?\\test\\fixtures\\A $optional_just_an_A;\n  /**\n   * Original thrift field:-\n   * 52: set<i32> optional_set_of_i32\n   */\n  public ?Set<int> $optional_set_of_i32;\n  /**\n   * Original thrift field:-\n   * 53: list<i32> optional_list_of_i32\n   */\n  public ?Vector<int> $optional_list_of_i32;\n  /**\n   * Original thrift field:-\n   * 54: list<string> optional_list_of_string\n   */\n  public ?Vector<string> $optional_list_of_string;\n  /**\n   * Original thrift field:-\n   * 55: map<string, i32> optional_map_of_string_to_i32\n   */\n  public ?Map<string, int> $optional_map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 56: map<string, module.A> optional_map_of_string_to_A\n   */\n  public ?Map<string, \\test\\fixtures\\A> $optional_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 57: map<string, list<i32>> optional_map_of_string_to_list_of_i32\n   */\n  public ?Map<string, Vector<int>> $optional_map_of_string_to_list_of_i32;\n  /**\n   * Original thrift field:-\n   * 58: map<string, list<module.A>> optional_map_of_string_to_list_of_A\n   */\n  public ?Map<string, Vector<\\test\\fixtures\\A>> $optional_map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 59: map<string, set<i32>> optional_map_of_string_to_set_of_i32\n   */\n  public ?Map<string, Set<int>> $optional_map_of_string_to_set_of_i32;\n  /**\n   * Original thrift field:-\n   * 60: module.Enum optional_enum\n   */\n  public ?\\test\\fixtures\\Enum $optional_enum;\n  /**\n   * Original thrift field:-\n   * 70: module.Enum required_enum_with_default\n   */\n  public \\test\\fixtures\\Enum $required_enum_with_default;\n  /**\n   * Original thrift field:-\n   * 80: string string_with_default_value\n   */\n  public string $string_with_default_value;\n  /**\n   * Original thrift field:-\n   * 81: i32 i32_with_default_value\n   */\n  public int $i32_with_default_value;\n  /**\n   * Original thrift field:-\n   * 82: double double_with_default_value\n   */\n  public float $double_with_default_value;\n  /**\n   * Original thrift field:-\n   * 83: module.Enum enum_with_default_value\n   */\n  public ?\\test\\fixtures\\Enum $enum_with_default_value;\n  /**\n   * Original thrift field:-\n   * 84: module.A A_with_default_value\n   */\n  public ?\\test\\fixtures\\A $A_with_default_value;\n  /**\n   * Original thrift field:-\n   * 85: set<i32> set_of_i32_with_default_value\n   */\n  public Set<int> $set_of_i32_with_default_value;\n  /**\n   * Original thrift field:-\n   * 86: map<i32, string> map_of_i32_to_string_with_default_value\n   */\n  public Map<int, string> $map_of_i32_to_string_with_default_value;\n  /**\n   * Original thrift field:-\n   * 87: list<string> list_of_string_with_default_value\n   */\n  public Vector<string> $list_of_string_with_default_value;\n  /**\n   * Original thrift field:-\n   * 88: map<string, list<i32>> map_of_string_to_list_of_i32_with_default_value\n   */\n  public Map<string, Vector<int>> $map_of_string_to_list_of_i32_with_default_value;\n\n  public function __construct(?\\test\\fixtures\\A $just_an_A = null, ?Set<int> $set_of_i32 = null, ?Vector<int> $list_of_i32 = null, ?Vector<string> $list_of_string = null, ?Map<string, int> $map_of_string_to_i32 = null, ?Map<string, \\test\\fixtures\\A> $map_of_string_to_A = null, ?Map<string, Vector<int>> $map_of_string_to_list_of_i32 = null, ?Map<string, Vector<\\test\\fixtures\\A>> $map_of_string_to_list_of_A = null, ?Map<string, Set<int>> $map_of_string_to_set_of_i32 = null, ?Map<string, Map<string, int>> $map_of_string_to_map_of_string_to_i32 = null, ?Map<string, Map<string, \\test\\fixtures\\A>> $map_of_string_to_map_of_string_to_A = null, ?Vector<Set<int>> $list_of_set_of_i32 = null, ?Vector<Map<string, Vector<\\test\\fixtures\\A>>> $list_of_map_of_string_to_list_of_A = null, ?Vector<Map<string, \\test\\fixtures\\A>> $list_of_map_of_string_to_A = null, ?\\test\\fixtures\\Enum $just_an_enum = null, ?\\test\\fixtures\\Union $just_a_union = null, ?\\test\\fixtures\\A $optional_just_an_A = null, ?Set<int> $optional_set_of_i32 = null, ?Vector<int> $optional_list_of_i32 = null, ?Vector<string> $optional_list_of_string = null, ?Map<string, int> $optional_map_of_string_to_i32 = null, ?Map<string, \\test\\fixtures\\A> $optional_map_of_string_to_A = null, ?Map<string, Vector<int>> $optional_map_of_string_to_list_of_i32 = null, ?Map<string, Vector<\\test\\fixtures\\A>> $optional_map_of_string_to_list_of_A = null, ?Map<string, Set<int>> $optional_map_of_string_to_set_of_i32 = null, ?\\test\\fixtures\\Enum $optional_enum = null, ?\\test\\fixtures\\Enum $required_enum_with_default = null, ?string $string_with_default_value = null, ?int $i32_with_default_value = null, ?float $double_with_default_value = null, ?\\test\\fixtures\\Enum $enum_with_default_value = null, ?\\test\\fixtures\\A $A_with_default_value = null, ?Set<int> $set_of_i32_with_default_value = null, ?Map<int, string> $map_of_i32_to_string_with_default_value = null, ?Vector<string> $list_of_string_with_default_value = null, ?Map<string, Vector<int>> $map_of_string_to_list_of_i32_with_default_value = null)[] {\n    $this->just_an_A = $just_an_A;\n    $this->set_of_i32 = $set_of_i32 ?? Set {};\n    $this->list_of_i32 = $list_of_i32 ?? Vector {};\n    $this->list_of_string = $list_of_string ?? Vector {};\n    $this->map_of_string_to_i32 = $map_of_string_to_i32 ?? Map {};\n    $this->map_of_string_to_A = $map_of_string_to_A ?? Map {};\n    $this->map_of_string_to_list_of_i32 = $map_of_string_to_list_of_i32 ?? Map {};\n    $this->map_of_string_to_list_of_A = $map_of_string_to_list_of_A ?? Map {};\n    $this->map_of_string_to_set_of_i32 = $map_of_string_to_set_of_i32 ?? Map {};\n    $this->map_of_string_to_map_of_string_to_i32 = $map_of_string_to_map_of_string_to_i32 ?? Map {};\n    $this->map_of_string_to_map_of_string_to_A = $map_of_string_to_map_of_string_to_A ?? Map {};\n    $this->list_of_set_of_i32 = $list_of_set_of_i32 ?? Vector {};\n    $this->list_of_map_of_string_to_list_of_A = $list_of_map_of_string_to_list_of_A ?? Vector {};\n    $this->list_of_map_of_string_to_A = $list_of_map_of_string_to_A ?? Vector {};\n    $this->just_an_enum = $just_an_enum;\n    $this->just_a_union = $just_a_union;\n    $this->optional_just_an_A = $optional_just_an_A;\n    $this->optional_set_of_i32 = $optional_set_of_i32;\n    $this->optional_list_of_i32 = $optional_list_of_i32;\n    $this->optional_list_of_string = $optional_list_of_string;\n    $this->optional_map_of_string_to_i32 = $optional_map_of_string_to_i32;\n    $this->optional_map_of_string_to_A = $optional_map_of_string_to_A;\n    $this->optional_map_of_string_to_list_of_i32 = $optional_map_of_string_to_list_of_i32;\n    $this->optional_map_of_string_to_list_of_A = $optional_map_of_string_to_list_of_A;\n    $this->optional_map_of_string_to_set_of_i32 = $optional_map_of_string_to_set_of_i32;\n    $this->optional_enum = $optional_enum;\n    $this->required_enum_with_default = $required_enum_with_default ?? \\test\\fixtures\\Enum::ENUM;\n    $this->string_with_default_value = $string_with_default_value ?? \"de_fault_in_our_stars\";\n    $this->i32_with_default_value = $i32_with_default_value ?? 1729;\n    $this->double_with_default_value = $double_with_default_value ?? 3.14159;\n    $this->enum_with_default_value = $enum_with_default_value ?? \\test\\fixtures\\Enum::ENUM;\n    $this->A_with_default_value = $A_with_default_value;\n    $this->set_of_i32_with_default_value = $set_of_i32_with_default_value ?? Set {\n      3,\n      7,\n      31,\n      127,\n    };\n    $this->map_of_i32_to_string_with_default_value = $map_of_i32_to_string_with_default_value ?? Map {\n      1 => \"fish\",\n      2 => \"fish\",\n    };\n    $this->list_of_string_with_default_value = $list_of_string_with_default_value ?? Vector {\n      \"red fish\",\n      \"blue fish\",\n    };\n    $this->map_of_string_to_list_of_i32_with_default_value = $map_of_string_to_list_of_i32_with_default_value ?? Map {\n      \"Jenny\" => Vector {\n        8,\n        6,\n        7,\n        5,\n        3,\n        0,\n        9,\n      },\n    };\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'just_an_A'),\n      Shapes::idx($shape, 'set_of_i32'),\n      Shapes::idx($shape, 'list_of_i32'),\n      Shapes::idx($shape, 'list_of_string'),\n      Shapes::idx($shape, 'map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_A'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_i32'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'map_of_string_to_set_of_i32'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_A'),\n      Shapes::idx($shape, 'list_of_set_of_i32'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_A'),\n      Shapes::idx($shape, 'just_an_enum'),\n      Shapes::idx($shape, 'just_a_union'),\n      Shapes::idx($shape, 'optional_just_an_A'),\n      Shapes::idx($shape, 'optional_set_of_i32'),\n      Shapes::idx($shape, 'optional_list_of_i32'),\n      Shapes::idx($shape, 'optional_list_of_string'),\n      Shapes::idx($shape, 'optional_map_of_string_to_i32'),\n      Shapes::idx($shape, 'optional_map_of_string_to_A'),\n      Shapes::idx($shape, 'optional_map_of_string_to_list_of_i32'),\n      Shapes::idx($shape, 'optional_map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'optional_map_of_string_to_set_of_i32'),\n      Shapes::idx($shape, 'optional_enum'),\n      Shapes::idx($shape, 'required_enum_with_default'),\n      Shapes::idx($shape, 'string_with_default_value'),\n      Shapes::idx($shape, 'i32_with_default_value'),\n      Shapes::idx($shape, 'double_with_default_value'),\n      Shapes::idx($shape, 'enum_with_default_value'),\n      Shapes::idx($shape, 'A_with_default_value'),\n      Shapes::idx($shape, 'set_of_i32_with_default_value'),\n      Shapes::idx($shape, 'map_of_i32_to_string_with_default_value'),\n      Shapes::idx($shape, 'list_of_string_with_default_value'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_i32_with_default_value'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'B';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.B\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.A\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"just_an_A\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"set_of_i32\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_i32\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_string\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_i32\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.A\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_A\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_i32\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_A\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_set_of_i32\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 10,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_i32\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 11,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_A\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 12,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_set_of_i32\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 13,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                                    shape(\n                                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.A\",\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_list_of_A\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 14,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_A\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 17,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Enum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"just_an_enum\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 18,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Union\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"just_a_union\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 51,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.A\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_just_an_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 52,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_set_of_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 53,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_list_of_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 54,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_list_of_string\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 55,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_map_of_string_to_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 56,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.A\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_map_of_string_to_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 57,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_map_of_string_to_list_of_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 58,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_map_of_string_to_list_of_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 59,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_map_of_string_to_set_of_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 60,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Enum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_enum\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 70,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Enum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"required_enum_with_default\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 80,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"string_with_default_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 81,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i32_with_default_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 82,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"double_with_default_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 83,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Enum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"enum_with_default_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 84,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.A\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"A_with_default_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 85,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"set_of_i32_with_default_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 86,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_i32_to_string_with_default_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 87,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_string_with_default_value\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 88,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_i32_with_default_value\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'just_an_A') === null ? null : (\\test\\fixtures\\A::__fromShape($shape['just_an_A'])),\n      new Set(Keyset\\keys($shape['set_of_i32'])),\n      $shape['list_of_i32'] |> new Vector($$),\n      $shape['list_of_string'] |> new Vector($$),\n      $shape['map_of_string_to_i32'] |> new Map($$),\n      $shape['map_of_string_to_A']\n        |> Dict\\map(\n          $$,\n          $_val0 ==> $_val0\n            |> \\test\\fixtures\\A::__fromShape($$),\n        ) |> new Map($$),\n      $shape['map_of_string_to_list_of_i32']\n        |> Dict\\map(\n          $$,\n          $_val1 ==> $_val1 |> new Vector($$),\n        ) |> new Map($$),\n      $shape['map_of_string_to_list_of_A']\n        |> Dict\\map(\n          $$,\n          $_val3 ==> $_val3\n            |> Vec\\map(\n              $$,\n              $_val2 ==> $_val2\n                |> \\test\\fixtures\\A::__fromShape($$),\n            ) |> new Vector($$),\n        ) |> new Map($$),\n      $shape['map_of_string_to_set_of_i32']\n        |> Dict\\map(\n          $$,\n          $_val4 ==> $_val4\n            |> new Set(Keyset\\keys($$)),\n        ) |> new Map($$),\n      $shape['map_of_string_to_map_of_string_to_i32']\n        |> Dict\\map(\n          $$,\n          $_val5 ==> $_val5 |> new Map($$),\n        ) |> new Map($$),\n      $shape['map_of_string_to_map_of_string_to_A']\n        |> Dict\\map(\n          $$,\n          $_val7 ==> $_val7\n            |> Dict\\map(\n              $$,\n              $_val6 ==> $_val6\n                |> \\test\\fixtures\\A::__fromShape($$),\n            ) |> new Map($$),\n        ) |> new Map($$),\n      $shape['list_of_set_of_i32']\n        |> Vec\\map(\n          $$,\n          $_val8 ==> $_val8\n            |> new Set(Keyset\\keys($$)),\n        ) |> new Vector($$),\n      $shape['list_of_map_of_string_to_list_of_A']\n        |> Vec\\map(\n          $$,\n          $_val11 ==> $_val11\n            |> Dict\\map(\n              $$,\n              $_val10 ==> $_val10\n                |> Vec\\map(\n                  $$,\n                  $_val9 ==> $_val9\n                    |> \\test\\fixtures\\A::__fromShape($$),\n                ) |> new Vector($$),\n            ) |> new Map($$),\n        ) |> new Vector($$),\n      $shape['list_of_map_of_string_to_A']\n        |> Vec\\map(\n          $$,\n          $_val13 ==> $_val13\n            |> Dict\\map(\n              $$,\n              $_val12 ==> $_val12\n                |> \\test\\fixtures\\A::__fromShape($$),\n            ) |> new Map($$),\n        ) |> new Vector($$),\n      Shapes::idx($shape, 'just_an_enum'),\n      Shapes::idx($shape, 'just_a_union') === null ? null : (\\test\\fixtures\\Union::__fromShape($shape['just_a_union'])),\n      Shapes::idx($shape, 'optional_just_an_A') === null ? null : (\\test\\fixtures\\A::__fromShape($shape['optional_just_an_A'])),\n      Shapes::idx($shape, 'optional_set_of_i32') === null ? null : (new Set(Keyset\\keys($shape['optional_set_of_i32']))),\n      Shapes::idx($shape, 'optional_list_of_i32') === null ? null : ($shape['optional_list_of_i32'] |> new Vector($$)),\n      Shapes::idx($shape, 'optional_list_of_string') === null ? null : ($shape['optional_list_of_string'] |> new Vector($$)),\n      Shapes::idx($shape, 'optional_map_of_string_to_i32') === null ? null : ($shape['optional_map_of_string_to_i32'] |> new Map($$)),\n      Shapes::idx($shape, 'optional_map_of_string_to_A') === null ? null : ($shape['optional_map_of_string_to_A']\n        |> Dict\\map(\n          $$,\n          $_val14 ==> $_val14\n            |> \\test\\fixtures\\A::__fromShape($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'optional_map_of_string_to_list_of_i32') === null ? null : ($shape['optional_map_of_string_to_list_of_i32']\n        |> Dict\\map(\n          $$,\n          $_val15 ==> $_val15 |> new Vector($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'optional_map_of_string_to_list_of_A') === null ? null : ($shape['optional_map_of_string_to_list_of_A']\n        |> Dict\\map(\n          $$,\n          $_val17 ==> $_val17\n            |> Vec\\map(\n              $$,\n              $_val16 ==> $_val16\n                |> \\test\\fixtures\\A::__fromShape($$),\n            ) |> new Vector($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'optional_map_of_string_to_set_of_i32') === null ? null : ($shape['optional_map_of_string_to_set_of_i32']\n        |> Dict\\map(\n          $$,\n          $_val18 ==> $_val18\n            |> new Set(Keyset\\keys($$)),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'optional_enum'),\n      $shape['required_enum_with_default'],\n      $shape['string_with_default_value'],\n      $shape['i32_with_default_value'],\n      $shape['double_with_default_value'],\n      Shapes::idx($shape, 'enum_with_default_value'),\n      Shapes::idx($shape, 'A_with_default_value') === null ? null : (\\test\\fixtures\\A::__fromShape($shape['A_with_default_value'])),\n      new Set(Keyset\\keys($shape['set_of_i32_with_default_value'])),\n      $shape['map_of_i32_to_string_with_default_value'] |> new Map($$),\n      $shape['list_of_string_with_default_value'] |> new Vector($$),\n      $shape['map_of_string_to_list_of_i32_with_default_value']\n        |> Dict\\map(\n          $$,\n          $_val19 ==> $_val19 |> new Vector($$),\n        ) |> new Map($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'just_an_A' => $this->just_an_A?->__toShape(),\n      'set_of_i32' => ThriftUtil::toDArray(Dict\\fill_keys($this->set_of_i32->toValuesArray(), true), static::class),\n      'list_of_i32' => vec($this->list_of_i32),\n      'list_of_string' => vec($this->list_of_string),\n      'map_of_string_to_i32' => dict($this->map_of_string_to_i32),\n      'map_of_string_to_A' => $this->map_of_string_to_A->map(\n        ($_val0) ==> $_val0->__toShape(),\n      )\n        |> dict($$),\n      'map_of_string_to_list_of_i32' => $this->map_of_string_to_list_of_i32->map(\n        ($_val0) ==> vec($_val0),\n      )\n        |> dict($$),\n      'map_of_string_to_list_of_A' => $this->map_of_string_to_list_of_A->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> vec($$),\n      )\n        |> dict($$),\n      'map_of_string_to_set_of_i32' => $this->map_of_string_to_set_of_i32->map(\n        ($_val0) ==> ThriftUtil::toDArray(Dict\\fill_keys($_val0, true), static::class),\n      )\n        |> dict($$),\n      'map_of_string_to_map_of_string_to_i32' => $this->map_of_string_to_map_of_string_to_i32->map(\n        ($_val0) ==> dict($_val0),\n      )\n        |> dict($$),\n      'map_of_string_to_map_of_string_to_A' => $this->map_of_string_to_map_of_string_to_A->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> dict($$),\n      )\n        |> dict($$),\n      'list_of_set_of_i32' => $this->list_of_set_of_i32->map(\n        ($_val0) ==> ThriftUtil::toDArray(Dict\\fill_keys($_val0, true), static::class),\n      )\n        |> vec($$),\n      'list_of_map_of_string_to_list_of_A' => $this->list_of_map_of_string_to_list_of_A->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->map(\n            ($_val2) ==> $_val2->__toShape(),\n          )\n            |> vec($$),\n        )\n          |> dict($$),\n      )\n        |> vec($$),\n      'list_of_map_of_string_to_A' => $this->list_of_map_of_string_to_A->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> dict($$),\n      )\n        |> vec($$),\n      'just_an_enum' => $this->just_an_enum,\n      'just_a_union' => $this->just_a_union?->__toShape(),\n      'optional_just_an_A' => $this->optional_just_an_A?->__toShape(),\n      'optional_set_of_i32' => $this->optional_set_of_i32\n        |> $$ === null ? null : ThriftUtil::toDArray(Dict\\fill_keys($$->toValuesArray(), true), static::class),\n      'optional_list_of_i32' => $this->optional_list_of_i32\n        |> $$ === null ? null : vec($$),\n      'optional_list_of_string' => $this->optional_list_of_string\n        |> $$ === null ? null : vec($$),\n      'optional_map_of_string_to_i32' => $this->optional_map_of_string_to_i32\n        |> $$ === null ? null : dict($$),\n      'optional_map_of_string_to_A' => $this->optional_map_of_string_to_A?->map(\n        ($_val0) ==> $_val0->__toShape(),\n      )\n        |> $$ === null ? null : dict($$),\n      'optional_map_of_string_to_list_of_i32' => $this->optional_map_of_string_to_list_of_i32?->map(\n        ($_val0) ==> vec($_val0),\n      )\n        |> $$ === null ? null : dict($$),\n      'optional_map_of_string_to_list_of_A' => $this->optional_map_of_string_to_list_of_A?->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> vec($$),\n      )\n        |> $$ === null ? null : dict($$),\n      'optional_map_of_string_to_set_of_i32' => $this->optional_map_of_string_to_set_of_i32?->map(\n        ($_val0) ==> ThriftUtil::toDArray(Dict\\fill_keys($_val0, true), static::class),\n      )\n        |> $$ === null ? null : dict($$),\n      'optional_enum' => $this->optional_enum,\n      'required_enum_with_default' => $this->required_enum_with_default,\n      'string_with_default_value' => $this->string_with_default_value,\n      'i32_with_default_value' => $this->i32_with_default_value,\n      'double_with_default_value' => $this->double_with_default_value,\n      'enum_with_default_value' => $this->enum_with_default_value,\n      'A_with_default_value' => $this->A_with_default_value?->__toShape(),\n      'set_of_i32_with_default_value' => ThriftUtil::toDArray(Dict\\fill_keys($this->set_of_i32_with_default_value->toValuesArray(), true), static::class),\n      'map_of_i32_to_string_with_default_value' => dict($this->map_of_i32_to_string_with_default_value),\n      'list_of_string_with_default_value' => vec($this->list_of_string_with_default_value),\n      'map_of_string_to_list_of_i32_with_default_value' => $this->map_of_string_to_list_of_i32_with_default_value->map(\n        ($_val0) ==> vec($_val0),\n      )\n        |> dict($$),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 2299}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift struct:-\n * Foo\n */\nclass Foo implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'just_int',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'list_of_strings',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'set_of_ints',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'array',\n    ),\n    4 => shape(\n      'var' => 'map_of_list_of_strings',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRING,\n        'elem' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    5 => shape(\n      'var' => 'map_of_set_of_strings',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::SET,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::SET,\n        'etype' => \\TType::STRING,\n        'elem' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'format' => 'array',\n      ),\n      'format' => 'collection',\n    ),\n    6 => shape(\n      'var' => 'map_of_strings_to_map_of_string_ints',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    7 => shape(\n      'var' => 'optional_map_of_map_of_sets',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::I32,\n        'vtype' => \\TType::SET,\n        'key' => shape(\n          'type' => \\TType::I32,\n        ),\n        'val' => shape(\n          'type' => \\TType::SET,\n          'etype' => \\TType::STRING,\n          'elem' => shape(\n            'type' => \\TType::STRING,\n          ),\n          'format' => 'array',\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'just_int' => 1,\n    'list_of_strings' => 2,\n    'set_of_ints' => 3,\n    'map_of_list_of_strings' => 4,\n    'map_of_set_of_strings' => 5,\n    'map_of_strings_to_map_of_string_ints' => 6,\n    'optional_map_of_map_of_sets' => 7,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'just_int' => ?int,\n    ?'list_of_strings' => ?Vector<string>,\n    ?'set_of_ints' => ?darray<int, bool>,\n    ?'map_of_list_of_strings' => ?Map<string, Vector<string>>,\n    ?'map_of_set_of_strings' => ?Map<string, darray<string, bool>>,\n    ?'map_of_strings_to_map_of_string_ints' => ?Map<string, Map<string, int>>,\n    ?'optional_map_of_map_of_sets' => ?Map<int, Map<int, darray<string, bool>>>,\n  );\n\n  const type TShape = shape(\n    'just_int' => int,\n    'list_of_strings' => varray<string>,\n    'set_of_ints' => darray<int, bool>,\n    'map_of_list_of_strings' => darray<string, varray<string>>,\n    'map_of_set_of_strings' => darray<string, darray<string, bool>>,\n    'map_of_strings_to_map_of_string_ints' => darray<string, darray<string, int>>,\n    ?'optional_map_of_map_of_sets' => ?darray<int, darray<int, darray<string, bool>>>,\n    ...\n  );\n  const int STRUCTURAL_ID = 6419322044061300149;\n  /**\n   * Original thrift field:-\n   * 1: i32 just_int\n   */\n  public int $just_int;\n  /**\n   * Original thrift field:-\n   * 2: list<string> list_of_strings\n   */\n  public Vector<string> $list_of_strings;\n  /**\n   * Original thrift field:-\n   * 3: set<i32> set_of_ints\n   */\n  public dict<int, bool> $set_of_ints;\n  /**\n   * Original thrift field:-\n   * 4: map<string, list<string>> map_of_list_of_strings\n   */\n  public Map<string, Vector<string>> $map_of_list_of_strings;\n  /**\n   * Original thrift field:-\n   * 5: map<string, set<string>> map_of_set_of_strings\n   */\n  public Map<string, dict<string, bool>> $map_of_set_of_strings;\n  /**\n   * Original thrift field:-\n   * 6: map<string, map<string, i32>> map_of_strings_to_map_of_string_ints\n   */\n  public Map<string, Map<string, int>> $map_of_strings_to_map_of_string_ints;\n  /**\n   * Original thrift field:-\n   * 7: map<i32, map<i32, set<string>>> optional_map_of_map_of_sets\n   */\n  public ?Map<int, Map<int, dict<string, bool>>> $optional_map_of_map_of_sets;\n\n  public function __construct(?int $just_int = null, ?Vector<string> $list_of_strings = null, ?dict<int, bool> $set_of_ints = null, ?Map<string, Vector<string>> $map_of_list_of_strings = null, ?Map<string, dict<string, bool>> $map_of_set_of_strings = null, ?Map<string, Map<string, int>> $map_of_strings_to_map_of_string_ints = null, ?Map<int, Map<int, dict<string, bool>>> $optional_map_of_map_of_sets = null)[] {\n    $this->just_int = $just_int ?? 0;\n    $this->list_of_strings = $list_of_strings ?? Vector {};\n    $this->set_of_ints = $set_of_ints ?? dict[];\n    $this->map_of_list_of_strings = $map_of_list_of_strings ?? Map {};\n    $this->map_of_set_of_strings = $map_of_set_of_strings ?? Map {};\n    $this->map_of_strings_to_map_of_string_ints = $map_of_strings_to_map_of_string_ints ?? Map {};\n    $this->optional_map_of_map_of_sets = $optional_map_of_map_of_sets;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'just_int'),\n      Shapes::idx($shape, 'list_of_strings'),\n      Shapes::idx($shape, 'set_of_ints'),\n      Shapes::idx($shape, 'map_of_list_of_strings'),\n      Shapes::idx($shape, 'map_of_set_of_strings'),\n      Shapes::idx($shape, 'map_of_strings_to_map_of_string_ints'),\n      Shapes::idx($shape, 'optional_map_of_map_of_sets'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Foo\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"just_int\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_strings\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"set_of_ints\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_list_of_strings\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_set_of_strings\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_strings_to_map_of_string_ints\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_map_of_map_of_sets\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['just_int'],\n      $shape['list_of_strings'] |> new Vector($$),\n      $shape['set_of_ints'],\n      $shape['map_of_list_of_strings']\n        |> Dict\\map(\n          $$,\n          $_val0 ==> $_val0 |> new Vector($$),\n        ) |> new Map($$),\n      $shape['map_of_set_of_strings'] |> new Map($$),\n      $shape['map_of_strings_to_map_of_string_ints']\n        |> Dict\\map(\n          $$,\n          $_val1 ==> $_val1 |> new Map($$),\n        ) |> new Map($$),\n      Shapes::idx($shape, 'optional_map_of_map_of_sets') === null ? null : ($shape['optional_map_of_map_of_sets']\n        |> Dict\\map(\n          $$,\n          $_val2 ==> $_val2 |> new Map($$),\n        ) |> new Map($$)),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'just_int' => $this->just_int,\n      'list_of_strings' => vec($this->list_of_strings),\n      'set_of_ints' => $this->set_of_ints,\n      'map_of_list_of_strings' => $this->map_of_list_of_strings->map(\n        ($_val0) ==> vec($_val0),\n      )\n        |> ThriftUtil::toDArray($$, static::class),\n      'map_of_set_of_strings' => $this->map_of_set_of_strings->map(\n        ($_val0) ==> dict($_val0),\n      )\n        |> ThriftUtil::toDArray($$, static::class),\n      'map_of_strings_to_map_of_string_ints' => $this->map_of_strings_to_map_of_string_ints->map(\n        ($_val0) ==> ThriftUtil::toDArray($_val0, static::class),\n      )\n        |> ThriftUtil::toDArray($$, static::class),\n      'optional_map_of_map_of_sets' => $this->optional_map_of_map_of_sets?->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> dict($_val1),\n        )\n          |> ThriftUtil::toDArray($$, static::class),\n      )\n        |> $$ === null ? null : ThriftUtil::toDArray($$, static::class),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 496}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift enum:-\n * Enum\n */\nenum Enum: int {\n  ENUM = 1;\n}\n\nclass Enum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.Enum\",\n        \"elements\" => dict[\n          1 => \"ENUM\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * A\n */\nclass A implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?string,\n  );\n\n  const type TShape = shape(\n    'a' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 7939807933046472325;\n  /**\n   * Original thrift field:-\n   * 1: string a\n   */\n  public string $a;\n\n  public function __construct(?string $a = null)[] {\n    $this->a = $a ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'A';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.A\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['a'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'a' => $this->a,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * B\n */\nclass B implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'just_an_A',\n      'type' => \\TType::STRUCT,\n      'class' => A::class,\n    ),\n    2 => shape(\n      'var' => 'set_of_i32',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'list_of_i32',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    4 => shape(\n      'var' => 'list_of_string',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    5 => shape(\n      'var' => 'map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    6 => shape(\n      'var' => 'map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => A::class,\n      ),\n      'format' => 'collection',\n    ),\n    7 => shape(\n      'var' => 'map_of_string_to_list_of_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    8 => shape(\n      'var' => 'map_of_string_to_list_of_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRUCT,\n        'elem' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    9 => shape(\n      'var' => 'map_of_string_to_set_of_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::SET,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::SET,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    10 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    11 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    12 => shape(\n      'var' => 'list_of_set_of_i32',\n      'type' => \\TType::LST,\n      'etype' => \\TType::SET,\n      'elem' => shape(\n        'type' => \\TType::SET,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    13 => shape(\n      'var' => 'list_of_map_of_string_to_list_of_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::LST,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::LST,\n          'etype' => \\TType::STRUCT,\n          'elem' => shape(\n            'type' => \\TType::STRUCT,\n            'class' => A::class,\n          ),\n          'format' => 'collection',\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    14 => shape(\n      'var' => 'list_of_map_of_string_to_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    17 => shape(\n      'var' => 'just_an_enum',\n      'type' => \\TType::I32,\n      'enum' => Enum::class,\n    ),\n    51 => shape(\n      'var' => 'optional_just_an_A',\n      'type' => \\TType::STRUCT,\n      'class' => A::class,\n    ),\n    52 => shape(\n      'var' => 'optional_set_of_i32',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    53 => shape(\n      'var' => 'optional_list_of_i32',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    54 => shape(\n      'var' => 'optional_list_of_string',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    55 => shape(\n      'var' => 'optional_map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    56 => shape(\n      'var' => 'optional_map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => A::class,\n      ),\n      'format' => 'collection',\n    ),\n    57 => shape(\n      'var' => 'optional_map_of_string_to_list_of_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    58 => shape(\n      'var' => 'optional_map_of_string_to_list_of_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRUCT,\n        'elem' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    59 => shape(\n      'var' => 'optional_map_of_string_to_set_of_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::SET,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::SET,\n        'etype' => \\TType::I32,\n        'elem' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    60 => shape(\n      'var' => 'optional_enum',\n      'type' => \\TType::I32,\n      'enum' => Enum::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'just_an_A' => 1,\n    'set_of_i32' => 2,\n    'list_of_i32' => 3,\n    'list_of_string' => 4,\n    'map_of_string_to_i32' => 5,\n    'map_of_string_to_A' => 6,\n    'map_of_string_to_list_of_i32' => 7,\n    'map_of_string_to_list_of_A' => 8,\n    'map_of_string_to_set_of_i32' => 9,\n    'map_of_string_to_map_of_string_to_i32' => 10,\n    'map_of_string_to_map_of_string_to_A' => 11,\n    'list_of_set_of_i32' => 12,\n    'list_of_map_of_string_to_list_of_A' => 13,\n    'list_of_map_of_string_to_A' => 14,\n    'just_an_enum' => 17,\n    'optional_just_an_A' => 51,\n    'optional_set_of_i32' => 52,\n    'optional_list_of_i32' => 53,\n    'optional_list_of_string' => 54,\n    'optional_map_of_string_to_i32' => 55,\n    'optional_map_of_string_to_A' => 56,\n    'optional_map_of_string_to_list_of_i32' => 57,\n    'optional_map_of_string_to_list_of_A' => 58,\n    'optional_map_of_string_to_set_of_i32' => 59,\n    'optional_enum' => 60,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'just_an_A' => ?A,\n    ?'set_of_i32' => ?Set<int>,\n    ?'list_of_i32' => ?Vector<int>,\n    ?'list_of_string' => ?Vector<string>,\n    ?'map_of_string_to_i32' => ?Map<string, int>,\n    ?'map_of_string_to_A' => ?Map<string, A>,\n    ?'map_of_string_to_list_of_i32' => ?Map<string, Vector<int>>,\n    ?'map_of_string_to_list_of_A' => ?Map<string, Vector<A>>,\n    ?'map_of_string_to_set_of_i32' => ?Map<string, Set<int>>,\n    ?'map_of_string_to_map_of_string_to_i32' => ?Map<string, Map<string, int>>,\n    ?'map_of_string_to_map_of_string_to_A' => ?Map<string, Map<string, A>>,\n    ?'list_of_set_of_i32' => ?Vector<Set<int>>,\n    ?'list_of_map_of_string_to_list_of_A' => ?Vector<Map<string, Vector<A>>>,\n    ?'list_of_map_of_string_to_A' => ?Vector<Map<string, A>>,\n    ?'just_an_enum' => ?Enum,\n    ?'optional_just_an_A' => ?A,\n    ?'optional_set_of_i32' => ?Set<int>,\n    ?'optional_list_of_i32' => ?Vector<int>,\n    ?'optional_list_of_string' => ?Vector<string>,\n    ?'optional_map_of_string_to_i32' => ?Map<string, int>,\n    ?'optional_map_of_string_to_A' => ?Map<string, A>,\n    ?'optional_map_of_string_to_list_of_i32' => ?Map<string, Vector<int>>,\n    ?'optional_map_of_string_to_list_of_A' => ?Map<string, Vector<A>>,\n    ?'optional_map_of_string_to_set_of_i32' => ?Map<string, Set<int>>,\n    ?'optional_enum' => ?Enum,\n  );\n\n  const type TShape = shape(\n    ?'just_an_A' => ?A::TShape,\n    'set_of_i32' => dict<int, bool>,\n    'list_of_i32' => vec<int>,\n    'list_of_string' => vec<string>,\n    'map_of_string_to_i32' => dict<arraykey, int>,\n    'map_of_string_to_A' => dict<arraykey, A::TShape>,\n    'map_of_string_to_list_of_i32' => dict<arraykey, vec<int>>,\n    'map_of_string_to_list_of_A' => dict<arraykey, vec<A::TShape>>,\n    'map_of_string_to_set_of_i32' => dict<arraykey, dict<int, bool>>,\n    'map_of_string_to_map_of_string_to_i32' => dict<arraykey, dict<arraykey, int>>,\n    'map_of_string_to_map_of_string_to_A' => dict<arraykey, dict<arraykey, A::TShape>>,\n    'list_of_set_of_i32' => vec<dict<int, bool>>,\n    'list_of_map_of_string_to_list_of_A' => vec<dict<arraykey, vec<A::TShape>>>,\n    'list_of_map_of_string_to_A' => vec<dict<arraykey, A::TShape>>,\n    ?'just_an_enum' => ?Enum,\n    ?'optional_just_an_A' => ?A::TShape,\n    ?'optional_set_of_i32' => ?dict<int, bool>,\n    ?'optional_list_of_i32' => ?vec<int>,\n    ?'optional_list_of_string' => ?vec<string>,\n    ?'optional_map_of_string_to_i32' => ?dict<arraykey, int>,\n    ?'optional_map_of_string_to_A' => ?dict<arraykey, A::TShape>,\n    ?'optional_map_of_string_to_list_of_i32' => ?dict<arraykey, vec<int>>,\n    ?'optional_map_of_string_to_list_of_A' => ?dict<arraykey, vec<A::TShape>>,\n    ?'optional_map_of_string_to_set_of_i32' => ?dict<arraykey, dict<int, bool>>,\n    ?'optional_enum' => ?Enum,\n    ...\n  );\n  const int STRUCTURAL_ID = 5253870888365642604;\n  /**\n   * Original thrift field:-\n   * 1: module.A just_an_A\n   */\n  public ?A $just_an_A;\n  /**\n   * Original thrift field:-\n   * 2: set<i32> set_of_i32\n   */\n  public Set<int> $set_of_i32;\n  /**\n   * Original thrift field:-\n   * 3: list<i32> list_of_i32\n   */\n  public Vector<int> $list_of_i32;\n  /**\n   * Original thrift field:-\n   * 4: list<string> list_of_string\n   */\n  public Vector<string> $list_of_string;\n  /**\n   * Original thrift field:-\n   * 5: map<string, i32> map_of_string_to_i32\n   */\n  public Map<string, int> $map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 6: map<string, module.A> map_of_string_to_A\n   */\n  public Map<string, A> $map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 7: map<string, list<i32>> map_of_string_to_list_of_i32\n   */\n  public Map<string, Vector<int>> $map_of_string_to_list_of_i32;\n  /**\n   * Original thrift field:-\n   * 8: map<string, list<module.A>> map_of_string_to_list_of_A\n   */\n  public Map<string, Vector<A>> $map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 9: map<string, set<i32>> map_of_string_to_set_of_i32\n   */\n  public Map<string, Set<int>> $map_of_string_to_set_of_i32;\n  /**\n   * Original thrift field:-\n   * 10: map<string, map<string, i32>> map_of_string_to_map_of_string_to_i32\n   */\n  public Map<string, Map<string, int>> $map_of_string_to_map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 11: map<string, map<string, module.A>> map_of_string_to_map_of_string_to_A\n   */\n  public Map<string, Map<string, A>> $map_of_string_to_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 12: list<set<i32>> list_of_set_of_i32\n   */\n  public Vector<Set<int>> $list_of_set_of_i32;\n  /**\n   * Original thrift field:-\n   * 13: list<map<string, list<module.A>>> list_of_map_of_string_to_list_of_A\n   */\n  public Vector<Map<string, Vector<A>>> $list_of_map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 14: list<map<string, module.A>> list_of_map_of_string_to_A\n   */\n  public Vector<Map<string, A>> $list_of_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 17: module.Enum just_an_enum\n   */\n  public ?Enum $just_an_enum;\n  /**\n   * Original thrift field:-\n   * 51: module.A optional_just_an_A\n   */\n  public ?A $optional_just_an_A;\n  /**\n   * Original thrift field:-\n   * 52: set<i32> optional_set_of_i32\n   */\n  public ?Set<int> $optional_set_of_i32;\n  /**\n   * Original thrift field:-\n   * 53: list<i32> optional_list_of_i32\n   */\n  public ?Vector<int> $optional_list_of_i32;\n  /**\n   * Original thrift field:-\n   * 54: list<string> optional_list_of_string\n   */\n  public ?Vector<string> $optional_list_of_string;\n  /**\n   * Original thrift field:-\n   * 55: map<string, i32> optional_map_of_string_to_i32\n   */\n  public ?Map<string, int> $optional_map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 56: map<string, module.A> optional_map_of_string_to_A\n   */\n  public ?Map<string, A> $optional_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 57: map<string, list<i32>> optional_map_of_string_to_list_of_i32\n   */\n  public ?Map<string, Vector<int>> $optional_map_of_string_to_list_of_i32;\n  /**\n   * Original thrift field:-\n   * 58: map<string, list<module.A>> optional_map_of_string_to_list_of_A\n   */\n  public ?Map<string, Vector<A>> $optional_map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 59: map<string, set<i32>> optional_map_of_string_to_set_of_i32\n   */\n  public ?Map<string, Set<int>> $optional_map_of_string_to_set_of_i32;\n  /**\n   * Original thrift field:-\n   * 60: module.Enum optional_enum\n   */\n  public ?Enum $optional_enum;\n\n  public function __construct(?A $just_an_A = null, ?Set<int> $set_of_i32 = null, ?Vector<int> $list_of_i32 = null, ?Vector<string> $list_of_string = null, ?Map<string, int> $map_of_string_to_i32 = null, ?Map<string, A> $map_of_string_to_A = null, ?Map<string, Vector<int>> $map_of_string_to_list_of_i32 = null, ?Map<string, Vector<A>> $map_of_string_to_list_of_A = null, ?Map<string, Set<int>> $map_of_string_to_set_of_i32 = null, ?Map<string, Map<string, int>> $map_of_string_to_map_of_string_to_i32 = null, ?Map<string, Map<string, A>> $map_of_string_to_map_of_string_to_A = null, ?Vector<Set<int>> $list_of_set_of_i32 = null, ?Vector<Map<string, Vector<A>>> $list_of_map_of_string_to_list_of_A = null, ?Vector<Map<string, A>> $list_of_map_of_string_to_A = null, ?Enum $just_an_enum = null, ?A $optional_just_an_A = null, ?Set<int> $optional_set_of_i32 = null, ?Vector<int> $optional_list_of_i32 = null, ?Vector<string> $optional_list_of_string = null, ?Map<string, int> $optional_map_of_string_to_i32 = null, ?Map<string, A> $optional_map_of_string_to_A = null, ?Map<string, Vector<int>> $optional_map_of_string_to_list_of_i32 = null, ?Map<string, Vector<A>> $optional_map_of_string_to_list_of_A = null, ?Map<string, Set<int>> $optional_map_of_string_to_set_of_i32 = null, ?Enum $optional_enum = null)[] {\n    $this->just_an_A = $just_an_A;\n    $this->set_of_i32 = $set_of_i32 ?? Set {};\n    $this->list_of_i32 = $list_of_i32 ?? Vector {};\n    $this->list_of_string = $list_of_string ?? Vector {};\n    $this->map_of_string_to_i32 = $map_of_string_to_i32 ?? Map {};\n    $this->map_of_string_to_A = $map_of_string_to_A ?? Map {};\n    $this->map_of_string_to_list_of_i32 = $map_of_string_to_list_of_i32 ?? Map {};\n    $this->map_of_string_to_list_of_A = $map_of_string_to_list_of_A ?? Map {};\n    $this->map_of_string_to_set_of_i32 = $map_of_string_to_set_of_i32 ?? Map {};\n    $this->map_of_string_to_map_of_string_to_i32 = $map_of_string_to_map_of_string_to_i32 ?? Map {};\n    $this->map_of_string_to_map_of_string_to_A = $map_of_string_to_map_of_string_to_A ?? Map {};\n    $this->list_of_set_of_i32 = $list_of_set_of_i32 ?? Vector {};\n    $this->list_of_map_of_string_to_list_of_A = $list_of_map_of_string_to_list_of_A ?? Vector {};\n    $this->list_of_map_of_string_to_A = $list_of_map_of_string_to_A ?? Vector {};\n    $this->just_an_enum = $just_an_enum;\n    $this->optional_just_an_A = $optional_just_an_A;\n    $this->optional_set_of_i32 = $optional_set_of_i32;\n    $this->optional_list_of_i32 = $optional_list_of_i32;\n    $this->optional_list_of_string = $optional_list_of_string;\n    $this->optional_map_of_string_to_i32 = $optional_map_of_string_to_i32;\n    $this->optional_map_of_string_to_A = $optional_map_of_string_to_A;\n    $this->optional_map_of_string_to_list_of_i32 = $optional_map_of_string_to_list_of_i32;\n    $this->optional_map_of_string_to_list_of_A = $optional_map_of_string_to_list_of_A;\n    $this->optional_map_of_string_to_set_of_i32 = $optional_map_of_string_to_set_of_i32;\n    $this->optional_enum = $optional_enum;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'just_an_A'),\n      Shapes::idx($shape, 'set_of_i32'),\n      Shapes::idx($shape, 'list_of_i32'),\n      Shapes::idx($shape, 'list_of_string'),\n      Shapes::idx($shape, 'map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_A'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_i32'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'map_of_string_to_set_of_i32'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_A'),\n      Shapes::idx($shape, 'list_of_set_of_i32'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_A'),\n      Shapes::idx($shape, 'just_an_enum'),\n      Shapes::idx($shape, 'optional_just_an_A'),\n      Shapes::idx($shape, 'optional_set_of_i32'),\n      Shapes::idx($shape, 'optional_list_of_i32'),\n      Shapes::idx($shape, 'optional_list_of_string'),\n      Shapes::idx($shape, 'optional_map_of_string_to_i32'),\n      Shapes::idx($shape, 'optional_map_of_string_to_A'),\n      Shapes::idx($shape, 'optional_map_of_string_to_list_of_i32'),\n      Shapes::idx($shape, 'optional_map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'optional_map_of_string_to_set_of_i32'),\n      Shapes::idx($shape, 'optional_enum'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'B';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.B\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.A\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"just_an_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"set_of_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_string\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.A\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_set_of_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 10,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 11,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 12,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_set_of_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 13,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.A\",\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_list_of_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 14,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 17,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Enum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"just_an_enum\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 51,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.A\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_just_an_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 52,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_set_of_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 53,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_list_of_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 54,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_list_of_string\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 55,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_map_of_string_to_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 56,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.A\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_map_of_string_to_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 57,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_map_of_string_to_list_of_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 58,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_map_of_string_to_list_of_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 59,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_set\" => tmeta_ThriftSetType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_map_of_string_to_set_of_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 60,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"module.Enum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"optional_enum\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __stringifyMapKeys<T>(dict<arraykey, T> $m)[]: dict<string, T> {\n    return Dict\\map_keys($m, $key ==> (string)$key);\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'just_an_A') === null ? null : (A::__fromShape($shape['just_an_A'])),\n      new Set(Keyset\\keys($shape['set_of_i32'])),\n      $shape['list_of_i32'] |> new Vector($$),\n      $shape['list_of_string'] |> new Vector($$),\n      $shape['map_of_string_to_i32']\n        |> self::__stringifyMapKeys($$) |> new Map($$),\n      $shape['map_of_string_to_A']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val0 ==> $_val0\n            |> A::__fromShape($$),\n        ) |> new Map($$),\n      $shape['map_of_string_to_list_of_i32']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val1 ==> $_val1 |> new Vector($$),\n        ) |> new Map($$),\n      $shape['map_of_string_to_list_of_A']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val3 ==> $_val3\n            |> Vec\\map(\n              $$,\n              $_val2 ==> $_val2\n                |> A::__fromShape($$),\n            ) |> new Vector($$),\n        ) |> new Map($$),\n      $shape['map_of_string_to_set_of_i32']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val4 ==> $_val4\n            |> new Set(Keyset\\keys($$)),\n        ) |> new Map($$),\n      $shape['map_of_string_to_map_of_string_to_i32']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val5 ==> $_val5\n            |> self::__stringifyMapKeys($$) |> new Map($$),\n        ) |> new Map($$),\n      $shape['map_of_string_to_map_of_string_to_A']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val7 ==> $_val7\n            |> Dict\\map(\n              self::__stringifyMapKeys($$),\n              $_val6 ==> $_val6\n                |> A::__fromShape($$),\n            ) |> new Map($$),\n        ) |> new Map($$),\n      $shape['list_of_set_of_i32']\n        |> Vec\\map(\n          $$,\n          $_val8 ==> $_val8\n            |> new Set(Keyset\\keys($$)),\n        ) |> new Vector($$),\n      $shape['list_of_map_of_string_to_list_of_A']\n        |> Vec\\map(\n          $$,\n          $_val11 ==> $_val11\n            |> Dict\\map(\n              self::__stringifyMapKeys($$),\n              $_val10 ==> $_val10\n                |> Vec\\map(\n                  $$,\n                  $_val9 ==> $_val9\n                    |> A::__fromShape($$),\n                ) |> new Vector($$),\n            ) |> new Map($$),\n        ) |> new Vector($$),\n      $shape['list_of_map_of_string_to_A']\n        |> Vec\\map(\n          $$,\n          $_val13 ==> $_val13\n            |> Dict\\map(\n              self::__stringifyMapKeys($$),\n              $_val12 ==> $_val12\n                |> A::__fromShape($$),\n            ) |> new Map($$),\n        ) |> new Vector($$),\n      Shapes::idx($shape, 'just_an_enum'),\n      Shapes::idx($shape, 'optional_just_an_A') === null ? null : (A::__fromShape($shape['optional_just_an_A'])),\n      Shapes::idx($shape, 'optional_set_of_i32') === null ? null : (new Set(Keyset\\keys($shape['optional_set_of_i32']))),\n      Shapes::idx($shape, 'optional_list_of_i32') === null ? null : ($shape['optional_list_of_i32'] |> new Vector($$)),\n      Shapes::idx($shape, 'optional_list_of_string') === null ? null : ($shape['optional_list_of_string'] |> new Vector($$)),\n      Shapes::idx($shape, 'optional_map_of_string_to_i32') === null ? null : ($shape['optional_map_of_string_to_i32']\n        |> self::__stringifyMapKeys($$) |> new Map($$)),\n      Shapes::idx($shape, 'optional_map_of_string_to_A') === null ? null : ($shape['optional_map_of_string_to_A']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val14 ==> $_val14\n            |> A::__fromShape($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'optional_map_of_string_to_list_of_i32') === null ? null : ($shape['optional_map_of_string_to_list_of_i32']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val15 ==> $_val15 |> new Vector($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'optional_map_of_string_to_list_of_A') === null ? null : ($shape['optional_map_of_string_to_list_of_A']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val17 ==> $_val17\n            |> Vec\\map(\n              $$,\n              $_val16 ==> $_val16\n                |> A::__fromShape($$),\n            ) |> new Vector($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'optional_map_of_string_to_set_of_i32') === null ? null : ($shape['optional_map_of_string_to_set_of_i32']\n        |> Dict\\map(\n          self::__stringifyMapKeys($$),\n          $_val18 ==> $_val18\n            |> new Set(Keyset\\keys($$)),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'optional_enum'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'just_an_A' => $this->just_an_A?->__toShape(),\n      'set_of_i32' => ThriftUtil::toDArray(Dict\\fill_keys($this->set_of_i32->toValuesArray(), true), static::class),\n      'list_of_i32' => vec($this->list_of_i32),\n      'list_of_string' => vec($this->list_of_string),\n      'map_of_string_to_i32' => dict($this->map_of_string_to_i32),\n      'map_of_string_to_A' => $this->map_of_string_to_A->map(\n        ($_val0) ==> $_val0->__toShape(),\n      )\n        |> dict($$),\n      'map_of_string_to_list_of_i32' => $this->map_of_string_to_list_of_i32->map(\n        ($_val0) ==> vec($_val0),\n      )\n        |> dict($$),\n      'map_of_string_to_list_of_A' => $this->map_of_string_to_list_of_A->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> vec($$),\n      )\n        |> dict($$),\n      'map_of_string_to_set_of_i32' => $this->map_of_string_to_set_of_i32->map(\n        ($_val0) ==> ThriftUtil::toDArray(Dict\\fill_keys($_val0, true), static::class),\n      )\n        |> dict($$),\n      'map_of_string_to_map_of_string_to_i32' => $this->map_of_string_to_map_of_string_to_i32->map(\n        ($_val0) ==> dict($_val0),\n      )\n        |> dict($$),\n      'map_of_string_to_map_of_string_to_A' => $this->map_of_string_to_map_of_string_to_A->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> dict($$),\n      )\n        |> dict($$),\n      'list_of_set_of_i32' => $this->list_of_set_of_i32->map(\n        ($_val0) ==> ThriftUtil::toDArray(Dict\\fill_keys($_val0, true), static::class),\n      )\n        |> vec($$),\n      'list_of_map_of_string_to_list_of_A' => $this->list_of_map_of_string_to_list_of_A->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->map(\n            ($_val2) ==> $_val2->__toShape(),\n          )\n            |> vec($$),\n        )\n          |> dict($$),\n      )\n        |> vec($$),\n      'list_of_map_of_string_to_A' => $this->list_of_map_of_string_to_A->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> dict($$),\n      )\n        |> vec($$),\n      'just_an_enum' => $this->just_an_enum,\n      'optional_just_an_A' => $this->optional_just_an_A?->__toShape(),\n      'optional_set_of_i32' => $this->optional_set_of_i32\n        |> $$ === null ? null : ThriftUtil::toDArray(Dict\\fill_keys($$->toValuesArray(), true), static::class),\n      'optional_list_of_i32' => $this->optional_list_of_i32\n        |> $$ === null ? null : vec($$),\n      'optional_list_of_string' => $this->optional_list_of_string\n        |> $$ === null ? null : vec($$),\n      'optional_map_of_string_to_i32' => $this->optional_map_of_string_to_i32\n        |> $$ === null ? null : dict($$),\n      'optional_map_of_string_to_A' => $this->optional_map_of_string_to_A?->map(\n        ($_val0) ==> $_val0->__toShape(),\n      )\n        |> $$ === null ? null : dict($$),\n      'optional_map_of_string_to_list_of_i32' => $this->optional_map_of_string_to_list_of_i32?->map(\n        ($_val0) ==> vec($_val0),\n      )\n        |> $$ === null ? null : dict($$),\n      'optional_map_of_string_to_list_of_A' => $this->optional_map_of_string_to_list_of_A?->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> vec($$),\n      )\n        |> $$ === null ? null : dict($$),\n      'optional_map_of_string_to_set_of_i32' => $this->optional_map_of_string_to_set_of_i32?->map(\n        ($_val0) ==> ThriftUtil::toDArray(Dict\\fill_keys($_val0, true), static::class),\n      )\n        |> $$ === null ? null : dict($$),\n      'optional_enum' => $this->optional_enum,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1682}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public function baz(Set<int> $a, KeyedContainer<int, KeyedContainer<int, Set<string>>> $b, int $c, ?Foo $d, int $e): Awaitable<string>;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public function baz(Set<int> $a, KeyedContainer<int, KeyedContainer<int, Set<string>>> $b, int $c, ?Foo $d, int $e): string;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarAsyncClientIf extends BarAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public function baz(Set<int> $a, KeyedContainer<int, KeyedContainer<int, Set<string>>> $b, int $c, ?Foo $d, int $e): Awaitable<string>;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ntrait BarClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass BarAsyncClient extends \\ThriftClientBase implements BarAsyncClientIf {\n  use BarClientBase;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public async function baz(Set<int> $a, KeyedContainer<int, KeyedContainer<int, Set<string>>> $b, int $c, ?Foo $d, int $e): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => (new Vector($b))->map(\n        $_val0 ==> new Map($_val0)\n      ),\n      'c' => $c,\n      'd' => $d,\n      'e' => $e,\n    ));\n    await $this->asyncHandler_->genBefore(\"Bar\", \"baz\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"baz\", false);\n    return await $this->genAwaitResponse(Bar_baz_result::class, \"baz\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass BarClient extends \\ThriftClientBase implements BarClientIf {\n  use BarClientBase;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public async function baz(Set<int> $a, KeyedContainer<int, KeyedContainer<int, Set<string>>> $b, int $c, ?Foo $d, int $e): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => (new Vector($b))->map(\n        $_val0 ==> new Map($_val0)\n      ),\n      'c' => $c,\n      'd' => $d,\n      'e' => $e,\n    ));\n    await $this->asyncHandler_->genBefore(\"Bar\", \"baz\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"baz\", false);\n    return await $this->genAwaitResponse(Bar_baz_result::class, \"baz\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_baz(Set<int> $a, KeyedContainer<int, KeyedContainer<int, Set<string>>> $b, int $c, ?Foo $d, int $e): int {\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => (new Vector($b))->map(\n        $_val0 ==> new Map($_val0)\n      ),\n      'c' => $c,\n      'd' => $d,\n      'e' => $e,\n    ));\n    return $this->sendImplHelper($args, \"baz\", false);\n  }\n  public function recv_baz(?int $expectedsequenceid = null): string {\n    return $this->recvImplHelper(Bar_baz_result::class, \"baz\", false, $expectedsequenceid);\n  }\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass Bar_baz_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::I32,\n        'vtype' => \\TType::SET,\n        'key' => shape(\n          'type' => \\TType::I32,\n        ),\n        'val' => shape(\n          'type' => \\TType::SET,\n          'etype' => \\TType::STRING,\n          'elem' => shape(\n            'type' => \\TType::STRING,\n          ),\n          'format' => 'collection',\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'c',\n      'type' => \\TType::I64,\n    ),\n    4 => shape(\n      'var' => 'd',\n      'type' => \\TType::STRUCT,\n      'class' => Foo::class,\n    ),\n    5 => shape(\n      'var' => 'e',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n    'c' => 3,\n    'd' => 4,\n    'e' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?Set<int>,\n    ?'b' => ?Vector<Map<int, Set<string>>>,\n    ?'c' => ?int,\n    ?'d' => ?Foo,\n    ?'e' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 7865027497865509792;\n  public Set<int> $a;\n  public Vector<Map<int, Set<string>>> $b;\n  public int $c;\n  public ?Foo $d;\n  public int $e;\n\n  public function __construct(?Set<int> $a = null, ?Vector<Map<int, Set<string>>> $b = null, ?int $c = null, ?Foo $d = null, ?int $e = null)[] {\n    $this->a = $a ?? Set {};\n    $this->b = $b ?? Vector {};\n    $this->c = $c ?? 0;\n    $this->d = $d;\n    $this->e = $e ?? 4;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n      Shapes::idx($shape, 'c'),\n      Shapes::idx($shape, 'd'),\n      Shapes::idx($shape, 'e'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Bar_baz_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.baz_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"c\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"d\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"e\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass Bar_baz_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Bar_baz_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Bar_baz_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass BarStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.Bar\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"baz\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_set\" => tmeta_ThriftSetType::fromShape(\n                          shape(\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"a\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_list\" => tmeta_ThriftListType::fromShape(\n                          shape(\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_map\" => tmeta_ThriftMapType::fromShape(\n                                  shape(\n                                    \"keyType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                      )\n                                    ),\n                                    \"valueType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                          shape(\n                                            \"valueType\" => tmeta_ThriftType::fromShape(\n                                              shape(\n                                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                              )\n                                            ),\n                                          )\n                                        ),\n                                      )\n                                    ),\n                                  )\n                                ),\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"b\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 3,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"c\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 4,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.Foo\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"d\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 5,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"e\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n              'module.Foo' => Foo::getStructMetadata(),\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 622}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift enum:-\n * TestEnum\n */\nenum TestEnum: int {\n  UNKNOWN = 0;\n  NEW_VALUE = 1;\n}\n\nclass TestEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.TestEnum\",\n        \"elements\" => dict[\n          0 => \"UNKNOWN\",\n          1 => \"NEW_VALUE\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\nenum TestUnionEnum: int {\n  _EMPTY_ = 0;\n  int_value = 1;\n  str_value = 2;\n  double_value = 3;\n  list_of_strings = 4;\n  map_of_string_to_ints = 5;\n  struct_foo = 6;\n}\n\n/**\n * Original thrift struct:-\n * TestUnion\n */\nclass TestUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<TestUnionEnum> {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'int_value',\n      'union' => true,\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'str_value',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'double_value',\n      'union' => true,\n      'type' => \\TType::DOUBLE,\n    ),\n    4 => shape(\n      'var' => 'list_of_strings',\n      'union' => true,\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    5 => shape(\n      'var' => 'map_of_string_to_ints',\n      'union' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    6 => shape(\n      'var' => 'struct_foo',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => Foo::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'int_value' => 1,\n    'str_value' => 2,\n    'double_value' => 3,\n    'list_of_strings' => 4,\n    'map_of_string_to_ints' => 5,\n    'struct_foo' => 6,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'int_value' => ?int,\n    ?'str_value' => ?string,\n    ?'double_value' => ?float,\n    ?'list_of_strings' => ?Vector<string>,\n    ?'map_of_string_to_ints' => ?Map<string, int>,\n    ?'struct_foo' => ?Foo,\n  );\n\n  const int STRUCTURAL_ID = 872350750526219001;\n  /**\n   * Original thrift field:-\n   * 1: i32 int_value\n   */\n  public ?int $int_value;\n  /**\n   * Original thrift field:-\n   * 2: string str_value\n   */\n  public ?string $str_value;\n  /**\n   * Original thrift field:-\n   * 3: double double_value\n   */\n  public ?float $double_value;\n  /**\n   * Original thrift field:-\n   * 4: list<string> list_of_strings\n   */\n  public ?Vector<string> $list_of_strings;\n  /**\n   * Original thrift field:-\n   * 5: map<string, i32> map_of_string_to_ints\n   */\n  public ?Map<string, int> $map_of_string_to_ints;\n  /**\n   * Original thrift field:-\n   * 6: module.Foo struct_foo\n   */\n  public ?Foo $struct_foo;\n  protected TestUnionEnum $_type = TestUnionEnum::_EMPTY_;\n\n  public function __construct(?int $int_value = null, ?string $str_value = null, ?float $double_value = null, ?Vector<string> $list_of_strings = null, ?Map<string, int> $map_of_string_to_ints = null, ?Foo $struct_foo = null)[] {\n    $this->_type = TestUnionEnum::_EMPTY_;\n    if ($int_value !== null) {\n      $this->int_value = $int_value;\n      $this->_type = TestUnionEnum::int_value;\n    }\n    if ($str_value !== null) {\n      $this->str_value = $str_value;\n      $this->_type = TestUnionEnum::str_value;\n    }\n    if ($double_value !== null) {\n      $this->double_value = $double_value;\n      $this->_type = TestUnionEnum::double_value;\n    }\n    if ($list_of_strings !== null) {\n      $this->list_of_strings = $list_of_strings;\n      $this->_type = TestUnionEnum::list_of_strings;\n    }\n    if ($map_of_string_to_ints !== null) {\n      $this->map_of_string_to_ints = $map_of_string_to_ints;\n      $this->_type = TestUnionEnum::map_of_string_to_ints;\n    }\n    if ($struct_foo !== null) {\n      $this->struct_foo = $struct_foo;\n      $this->_type = TestUnionEnum::struct_foo;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'int_value'),\n      Shapes::idx($shape, 'str_value'),\n      Shapes::idx($shape, 'double_value'),\n      Shapes::idx($shape, 'list_of_strings'),\n      Shapes::idx($shape, 'map_of_string_to_ints'),\n      Shapes::idx($shape, 'struct_foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestUnion';\n  }\n\n  public function getType()[]: TestUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case TestUnionEnum::int_value:\n        $this->int_value = null;\n        break;\n      case TestUnionEnum::str_value:\n        $this->str_value = null;\n        break;\n      case TestUnionEnum::double_value:\n        $this->double_value = null;\n        break;\n      case TestUnionEnum::list_of_strings:\n        $this->list_of_strings = null;\n        break;\n      case TestUnionEnum::map_of_string_to_ints:\n        $this->map_of_string_to_ints = null;\n        break;\n      case TestUnionEnum::struct_foo:\n        $this->struct_foo = null;\n        break;\n      case TestUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = TestUnionEnum::_EMPTY_;\n  }\n\n  public function set_int_value(int $int_value)[write_props]: this {\n    $this->reset();\n    $this->_type = TestUnionEnum::int_value;\n    $this->int_value = $int_value;\n    return $this;\n  }\n\n  public function get_int_value()[]: ?int {\n    return $this->int_value;\n  }\n\n  public function getx_int_value()[]: int {\n    invariant(\n      $this->_type === TestUnionEnum::int_value,\n      'get_int_value called on an instance of TestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->int_value as nonnull;\n  }\n\n  public function set_str_value(string $str_value)[write_props]: this {\n    $this->reset();\n    $this->_type = TestUnionEnum::str_value;\n    $this->str_value = $str_value;\n    return $this;\n  }\n\n  public function get_str_value()[]: ?string {\n    return $this->str_value;\n  }\n\n  public function getx_str_value()[]: string {\n    invariant(\n      $this->_type === TestUnionEnum::str_value,\n      'get_str_value called on an instance of TestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->str_value as nonnull;\n  }\n\n  public function set_double_value(float $double_value)[write_props]: this {\n    $this->reset();\n    $this->_type = TestUnionEnum::double_value;\n    $this->double_value = $double_value;\n    return $this;\n  }\n\n  public function get_double_value()[]: ?float {\n    return $this->double_value;\n  }\n\n  public function getx_double_value()[]: float {\n    invariant(\n      $this->_type === TestUnionEnum::double_value,\n      'get_double_value called on an instance of TestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->double_value as nonnull;\n  }\n\n  public function set_list_of_strings(Vector<string> $list_of_strings)[write_props]: this {\n    $this->reset();\n    $this->_type = TestUnionEnum::list_of_strings;\n    $this->list_of_strings = $list_of_strings;\n    return $this;\n  }\n\n  public function get_list_of_strings()[]: ?Vector<string> {\n    return $this->list_of_strings;\n  }\n\n  public function getx_list_of_strings()[]: Vector<string> {\n    invariant(\n      $this->_type === TestUnionEnum::list_of_strings,\n      'get_list_of_strings called on an instance of TestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->list_of_strings as nonnull;\n  }\n\n  public function set_map_of_string_to_ints(Map<string, int> $map_of_string_to_ints)[write_props]: this {\n    $this->reset();\n    $this->_type = TestUnionEnum::map_of_string_to_ints;\n    $this->map_of_string_to_ints = $map_of_string_to_ints;\n    return $this;\n  }\n\n  public function get_map_of_string_to_ints()[]: ?Map<string, int> {\n    return $this->map_of_string_to_ints;\n  }\n\n  public function getx_map_of_string_to_ints()[]: Map<string, int> {\n    invariant(\n      $this->_type === TestUnionEnum::map_of_string_to_ints,\n      'get_map_of_string_to_ints called on an instance of TestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->map_of_string_to_ints as nonnull;\n  }\n\n  public function set_struct_foo(Foo $struct_foo)[write_props]: this {\n    $this->reset();\n    $this->_type = TestUnionEnum::struct_foo;\n    $this->struct_foo = $struct_foo;\n    return $this;\n  }\n\n  public function get_struct_foo()[]: ?Foo {\n    return $this->struct_foo;\n  }\n\n  public function getx_struct_foo()[]: Foo {\n    invariant(\n      $this->_type === TestUnionEnum::struct_foo,\n      'get_struct_foo called on an instance of TestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->struct_foo as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TestUnion\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"int_value\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"str_value\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"double_value\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_strings\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_ints\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.Foo\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"struct_foo\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Foo\n */\nclass Foo implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::SET,\n        'elem' => shape(\n          'type' => \\TType::SET,\n          'etype' => \\TType::I32,\n          'elem' => shape(\n            'type' => \\TType::I32,\n          ),\n          'format' => 'collection',\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'c',\n      'type' => \\TType::I64,\n    ),\n    4 => shape(\n      'var' => 'd',\n      'type' => \\TType::BOOL,\n    ),\n    5 => shape(\n      'var' => 'str_value',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n    'c' => 3,\n    'd' => 4,\n    'str_value' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?Vector<string>,\n    ?'b' => ?Map<string, Vector<Set<int>>>,\n    ?'c' => ?int,\n    ?'d' => ?bool,\n    ?'str_value' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 5952652426480946901;\n  /**\n   * Original thrift field:-\n   * 1: list<string> a\n   */\n  public Vector<string> $a;\n  /**\n   * Original thrift field:-\n   * 2: map<string, list<set<i32>>> b\n   */\n  public ?Map<string, Vector<Set<int>>> $b;\n  /**\n   * Original thrift field:-\n   * 3: i64 c\n   */\n  public int $c;\n  /**\n   * Original thrift field:-\n   * 4: bool d\n   */\n  public bool $d;\n  /**\n   * Original thrift field:-\n   * 5: string str_value\n   */\n  public string $str_value;\n\n  public function __construct(?Vector<string> $a = null, ?Map<string, Vector<Set<int>>> $b = null, ?int $c = null, ?bool $d = null, ?string $str_value = null)[] {\n    $this->a = $a ?? Vector {};\n    $this->b = $b;\n    $this->c = $c ?? 7;\n    $this->d = $d ?? false;\n    $this->str_value = $str_value ?? \"hello\";\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n      Shapes::idx($shape, 'c'),\n      Shapes::idx($shape, 'd'),\n      Shapes::idx($shape, 'str_value'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Foo\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"b\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"c\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"d\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"str_value\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * TestStruct\n */\nclass TestStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo_struct',\n      'type' => \\TType::STRUCT,\n      'class' => Foo::class,\n    ),\n    2 => shape(\n      'var' => 'union_value',\n      'type' => \\TType::STRUCT,\n      'class' => TestUnion::class,\n    ),\n    3 => shape(\n      'var' => 'struct_of_self',\n      'type' => \\TType::STRUCT,\n      'class' => TestStruct::class,\n    ),\n    4 => shape(\n      'var' => 'list_of_struct_foo',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRUCT,\n      'elem' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => Foo::class,\n      ),\n      'format' => 'collection',\n    ),\n    5 => shape(\n      'var' => 'map_of_string_to_struct_foo',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => Foo::class,\n      ),\n      'format' => 'collection',\n    ),\n    6 => shape(\n      'var' => 'list_of_struct_self',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRUCT,\n      'elem' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => TestStruct::class,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo_struct' => 1,\n    'union_value' => 2,\n    'struct_of_self' => 3,\n    'list_of_struct_foo' => 4,\n    'map_of_string_to_struct_foo' => 5,\n    'list_of_struct_self' => 6,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo_struct' => ?Foo,\n    ?'union_value' => ?TestUnion,\n    ?'struct_of_self' => ?TestStruct,\n    ?'list_of_struct_foo' => ?Vector<Foo>,\n    ?'map_of_string_to_struct_foo' => ?Map<string, Foo>,\n    ?'list_of_struct_self' => ?Vector<TestStruct>,\n  );\n\n  const int STRUCTURAL_ID = 6681594433718475023;\n  /**\n   * Original thrift field:-\n   * 1: module.Foo foo_struct\n   */\n  public ?Foo $foo_struct;\n  /**\n   * Original thrift field:-\n   * 2: module.TestUnion union_value\n   */\n  public ?TestUnion $union_value;\n  /**\n   * Original thrift field:-\n   * 3: module.TestStruct struct_of_self\n   */\n  public ?TestStruct $struct_of_self;\n  /**\n   * Original thrift field:-\n   * 4: list<module.Foo> list_of_struct_foo\n   */\n  public Vector<Foo> $list_of_struct_foo;\n  /**\n   * Original thrift field:-\n   * 5: map<string, module.Foo> map_of_string_to_struct_foo\n   */\n  public Map<string, Foo> $map_of_string_to_struct_foo;\n  /**\n   * Original thrift field:-\n   * 6: list<module.TestStruct> list_of_struct_self\n   */\n  public Vector<TestStruct> $list_of_struct_self;\n\n  public function __construct(?Foo $foo_struct = null, ?TestUnion $union_value = null, ?TestStruct $struct_of_self = null, ?Vector<Foo> $list_of_struct_foo = null, ?Map<string, Foo> $map_of_string_to_struct_foo = null, ?Vector<TestStruct> $list_of_struct_self = null)[] {\n    $this->foo_struct = $foo_struct;\n    $this->union_value = $union_value;\n    $this->struct_of_self = $struct_of_self;\n    $this->list_of_struct_foo = $list_of_struct_foo ?? Vector {};\n    $this->map_of_string_to_struct_foo = $map_of_string_to_struct_foo ?? Map {};\n    $this->list_of_struct_self = $list_of_struct_self ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo_struct'),\n      Shapes::idx($shape, 'union_value'),\n      Shapes::idx($shape, 'struct_of_self'),\n      Shapes::idx($shape, 'list_of_struct_foo'),\n      Shapes::idx($shape, 'map_of_string_to_struct_foo'),\n      Shapes::idx($shape, 'list_of_struct_self'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TestStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"foo_struct\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.TestUnion\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"union_value\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.TestStruct\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.TestStruct\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"struct_of_self\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.Foo\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_struct_foo\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.Foo\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_struct_foo\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.TestStruct\",\n                              \"underlyingType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.TestStruct\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_struct_self\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * Baz\n */\nclass Baz extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'some_field',\n      'type' => \\TType::STRUCT,\n      'class' => Foo::class,\n    ),\n    3 => shape(\n      'var' => 'some_container',\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    4 => shape(\n      'var' => 'code',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n    'some_field' => 2,\n    'some_container' => 3,\n    'code' => 4,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n    ?'some_field' => ?Foo,\n    ?'some_container' => ?Set<string>,\n    ?'code' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 1663976252517274137;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n  /**\n   * Original thrift field:-\n   * 2: module.Foo some_field\n   */\n  public ?Foo $some_field;\n  /**\n   * Original thrift field:-\n   * 3: set<string> some_container\n   */\n  public Set<string> $some_container;\n  /**\n   * Original thrift field:-\n   * 4: i32 code\n   */\n  public int $code;\n\n  public function __construct(?string $message = null, ?Foo $some_field = null, ?Set<string> $some_container = null, ?int $code = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n    $this->some_field = $some_field;\n    $this->some_container = $some_container ?? Set {};\n    $this->code = $code ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n      Shapes::idx($shape, 'some_field'),\n      Shapes::idx($shape, 'some_container'),\n      Shapes::idx($shape, 'code'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Baz';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.Baz\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"some_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"some_container\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"code\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * OptBaz\n */\nclass OptBaz extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 546500496397478593;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'OptBaz';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.OptBaz\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1286}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public function baz(dict<int, bool> $a, KeyedContainer<int, KeyedContainer<int, dict<string, bool>>> $b, int $c, ?Foo $d, int $e): Awaitable<string>;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public function baz(dict<int, bool> $a, KeyedContainer<int, KeyedContainer<int, dict<string, bool>>> $b, int $c, ?Foo $d, int $e): string;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarAsyncClientIf extends BarAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ninterface BarClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public function baz(dict<int, bool> $a, KeyedContainer<int, KeyedContainer<int, dict<string, bool>>> $b, int $c, ?Foo $d, int $e): Awaitable<string>;\n}\n\n/**\n * Original thrift service:-\n * Bar\n */\ntrait BarClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass BarAsyncClient extends \\ThriftClientBase implements BarAsyncClientIf {\n  use BarClientBase;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public async function baz(dict<int, bool> $a, KeyedContainer<int, KeyedContainer<int, dict<string, bool>>> $b, int $c, ?Foo $d, int $e): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => Vec\\map($b, \n        $_val0 ==> dict($_val0)\n      ),\n      'c' => $c,\n      'd' => $d,\n      'e' => $e,\n    ));\n    await $this->asyncHandler_->genBefore(\"Bar\", \"baz\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"baz\", false);\n    return await $this->genAwaitResponse(Bar_baz_result::class, \"baz\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public async function baz__LEGACY_ARRAYS(dict<int, bool> $a, KeyedContainer<int, KeyedContainer<int, dict<string, bool>>> $b, int $c, ?Foo $d, int $e): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => Vec\\map($b, \n        $_val0 ==> dict($_val0)\n      ),\n      'c' => $c,\n      'd' => $d,\n      'e' => $e,\n    ));\n    await $this->asyncHandler_->genBefore(\"Bar\", \"baz\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"baz\", false);\n    return await $this->genAwaitResponse(Bar_baz_result::class, \"baz\", false, $currentseqid, $rpc_options, shape('read_options' => \\THRIFT_MARK_LEGACY_ARRAYS));\n  }\n\n}\n\nclass BarClient extends \\ThriftClientBase implements BarClientIf {\n  use BarClientBase;\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public async function baz(dict<int, bool> $a, KeyedContainer<int, KeyedContainer<int, dict<string, bool>>> $b, int $c, ?Foo $d, int $e): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => Vec\\map($b, \n        $_val0 ==> dict($_val0)\n      ),\n      'c' => $c,\n      'd' => $d,\n      'e' => $e,\n    ));\n    await $this->asyncHandler_->genBefore(\"Bar\", \"baz\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"baz\", false);\n    return await $this->genAwaitResponse(Bar_baz_result::class, \"baz\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * string\n   *   baz(1: set<i32> a,\n   *       2: list<map<i32, set<string>>> b,\n   *       3: i64 c,\n   *       4: Foo d,\n   *       5: i64 e);\n   */\n  public async function baz__LEGACY_ARRAYS(dict<int, bool> $a, KeyedContainer<int, KeyedContainer<int, dict<string, bool>>> $b, int $c, ?Foo $d, int $e): Awaitable<string> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => Vec\\map($b, \n        $_val0 ==> dict($_val0)\n      ),\n      'c' => $c,\n      'd' => $d,\n      'e' => $e,\n    ));\n    await $this->asyncHandler_->genBefore(\"Bar\", \"baz\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"baz\", false);\n    return await $this->genAwaitResponse(Bar_baz_result::class, \"baz\", false, $currentseqid, $rpc_options, shape('read_options' => \\THRIFT_MARK_LEGACY_ARRAYS));\n  }\n\n  /* send and recv functions */\n  public function send_baz(dict<int, bool> $a, KeyedContainer<int, KeyedContainer<int, dict<string, bool>>> $b, int $c, ?Foo $d, int $e): int {\n    $args = Bar_baz_args::fromShape(shape(\n      'a' => $a,\n      'b' => Vec\\map($b, \n        $_val0 ==> dict($_val0)\n      ),\n      'c' => $c,\n      'd' => $d,\n      'e' => $e,\n    ));\n    return $this->sendImplHelper($args, \"baz\", false);\n  }\n  public function recv_baz(?int $expectedsequenceid = null): string {\n    return $this->recvImplHelper(Bar_baz_result::class, \"baz\", false, $expectedsequenceid);\n  }\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass Bar_baz_args implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'array',\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::I32,\n        'vtype' => \\TType::SET,\n        'key' => shape(\n          'type' => \\TType::I32,\n        ),\n        'val' => shape(\n          'type' => \\TType::SET,\n          'etype' => \\TType::STRING,\n          'elem' => shape(\n            'type' => \\TType::STRING,\n          ),\n          'format' => 'array',\n        ),\n        'format' => 'array',\n      ),\n      'format' => 'array',\n    ),\n    3 => shape(\n      'var' => 'c',\n      'type' => \\TType::I64,\n    ),\n    4 => shape(\n      'var' => 'd',\n      'type' => \\TType::STRUCT,\n      'class' => Foo::class,\n    ),\n    5 => shape(\n      'var' => 'e',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n    'c' => 3,\n    'd' => 4,\n    'e' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?dict<int, bool>,\n    ?'b' => ?varray<darray<int, dict<string, bool>>>,\n    ?'c' => ?int,\n    ?'d' => ?Foo,\n    ?'e' => ?int,\n  );\n\n  const type TShape = shape(\n    'a' => dict<int, bool>,\n    'b' => varray<darray<int, dict<string, bool>>>,\n    'c' => int,\n    ?'d' => ?Foo::TShape,\n    'e' => int,\n  );\n  const int STRUCTURAL_ID = 7865027497865509792;\n  public dict<int, bool> $a;\n  public vec<dict<int, dict<string, bool>>> $b;\n  public int $c;\n  public ?Foo $d;\n  public int $e;\n\n  public function __construct(?dict<int, bool> $a = null, ?vec<dict<int, dict<string, bool>>> $b = null, ?int $c = null, ?Foo $d = null, ?int $e = null)[] {\n    $this->a = $a ?? dict[];\n    $this->b = $b ?? vec[];\n    $this->c = $c ?? 0;\n    $this->d = $d;\n    $this->e = $e ?? 4;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n      Shapes::idx($shape, 'c'),\n      Shapes::idx($shape, 'd'),\n      Shapes::idx($shape, 'e'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Bar_baz_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.baz_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"c\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"d\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"e\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['a'],\n      $shape['b'],\n      $shape['c'],\n      Shapes::idx($shape, 'd') === null ? null : (Foo::__fromShape($shape['d'])),\n      $shape['e'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'a' => $this->a,\n      'b' => $this->b,\n      'c' => $this->c,\n      'd' => $this->d?->__toShape(),\n      'e' => $this->e,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass Bar_baz_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = string;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1365128170602685579;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Bar_baz_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Bar_baz_result\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass BarStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.Bar\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"baz\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_set\" => tmeta_ThriftSetType::fromShape(\n                          shape(\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"a\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_list\" => tmeta_ThriftListType::fromShape(\n                          shape(\n                            \"valueType\" => tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_map\" => tmeta_ThriftMapType::fromShape(\n                                  shape(\n                                    \"keyType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                      )\n                                    ),\n                                    \"valueType\" => tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                          shape(\n                                            \"valueType\" => tmeta_ThriftType::fromShape(\n                                              shape(\n                                                \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                              )\n                                            ),\n                                          )\n                                        ),\n                                      )\n                                    ),\n                                  )\n                                ),\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"b\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 3,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"c\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 4,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.Foo\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"d\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 5,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                      )\n                    ),\n                    \"name\" => \"e\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n              'module.Foo' => Foo::getStructMetadata(),\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 706}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift enum:-\n * TestEnum\n */\nenum TestEnum: int {\n  UNKNOWN = 0;\n  NEW_VALUE = 1;\n}\n\nclass TestEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.TestEnum\",\n        \"elements\" => dict[\n          0 => \"UNKNOWN\",\n          1 => \"NEW_VALUE\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\nenum TestUnionEnum: int {\n  _EMPTY_ = 0;\n  int_value = 1;\n  str_value = 2;\n  double_value = 3;\n  list_of_strings = 4;\n  map_of_string_to_ints = 5;\n  struct_foo = 6;\n}\n\n/**\n * Original thrift struct:-\n * TestUnion\n */\nclass TestUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<TestUnionEnum>, \\IThriftShapishSyncStruct {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'int_value',\n      'union' => true,\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'str_value',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'double_value',\n      'union' => true,\n      'type' => \\TType::DOUBLE,\n    ),\n    4 => shape(\n      'var' => 'list_of_strings',\n      'union' => true,\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'array',\n    ),\n    5 => shape(\n      'var' => 'map_of_string_to_ints',\n      'union' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'array',\n    ),\n    6 => shape(\n      'var' => 'struct_foo',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => Foo::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'int_value' => 1,\n    'str_value' => 2,\n    'double_value' => 3,\n    'list_of_strings' => 4,\n    'map_of_string_to_ints' => 5,\n    'struct_foo' => 6,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'int_value' => ?int,\n    ?'str_value' => ?string,\n    ?'double_value' => ?float,\n    ?'list_of_strings' => ?varray<string>,\n    ?'map_of_string_to_ints' => ?darray<string, int>,\n    ?'struct_foo' => ?Foo,\n  );\n\n  const type TShape = shape(\n    ?'int_value' => ?int,\n    ?'str_value' => ?string,\n    ?'double_value' => ?float,\n    ?'list_of_strings' => ?varray<string>,\n    ?'map_of_string_to_ints' => ?darray<string, int>,\n    ?'struct_foo' => ?Foo::TShape,\n  );\n  const int STRUCTURAL_ID = 872350750526219001;\n  /**\n   * Original thrift field:-\n   * 1: i32 int_value\n   */\n  public ?int $int_value;\n  /**\n   * Original thrift field:-\n   * 2: string str_value\n   */\n  public ?string $str_value;\n  /**\n   * Original thrift field:-\n   * 3: double double_value\n   */\n  public ?float $double_value;\n  /**\n   * Original thrift field:-\n   * 4: list<string> list_of_strings\n   */\n  public ?vec<string> $list_of_strings;\n  /**\n   * Original thrift field:-\n   * 5: map<string, i32> map_of_string_to_ints\n   */\n  public ?dict<string, int> $map_of_string_to_ints;\n  /**\n   * Original thrift field:-\n   * 6: module.Foo struct_foo\n   */\n  public ?Foo $struct_foo;\n  protected TestUnionEnum $_type = TestUnionEnum::_EMPTY_;\n\n  public function __construct(?int $int_value = null, ?string $str_value = null, ?float $double_value = null, ?vec<string> $list_of_strings = null, ?dict<string, int> $map_of_string_to_ints = null, ?Foo $struct_foo = null)[] {\n    $this->_type = TestUnionEnum::_EMPTY_;\n    if ($int_value !== null) {\n      $this->int_value = $int_value;\n      $this->_type = TestUnionEnum::int_value;\n    }\n    if ($str_value !== null) {\n      $this->str_value = $str_value;\n      $this->_type = TestUnionEnum::str_value;\n    }\n    if ($double_value !== null) {\n      $this->double_value = $double_value;\n      $this->_type = TestUnionEnum::double_value;\n    }\n    if ($list_of_strings !== null) {\n      $this->list_of_strings = $list_of_strings;\n      $this->_type = TestUnionEnum::list_of_strings;\n    }\n    if ($map_of_string_to_ints !== null) {\n      $this->map_of_string_to_ints = $map_of_string_to_ints;\n      $this->_type = TestUnionEnum::map_of_string_to_ints;\n    }\n    if ($struct_foo !== null) {\n      $this->struct_foo = $struct_foo;\n      $this->_type = TestUnionEnum::struct_foo;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'int_value'),\n      Shapes::idx($shape, 'str_value'),\n      Shapes::idx($shape, 'double_value'),\n      Shapes::idx($shape, 'list_of_strings'),\n      Shapes::idx($shape, 'map_of_string_to_ints'),\n      Shapes::idx($shape, 'struct_foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestUnion';\n  }\n\n  public function getType()[]: TestUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case TestUnionEnum::int_value:\n        $this->int_value = null;\n        break;\n      case TestUnionEnum::str_value:\n        $this->str_value = null;\n        break;\n      case TestUnionEnum::double_value:\n        $this->double_value = null;\n        break;\n      case TestUnionEnum::list_of_strings:\n        $this->list_of_strings = null;\n        break;\n      case TestUnionEnum::map_of_string_to_ints:\n        $this->map_of_string_to_ints = null;\n        break;\n      case TestUnionEnum::struct_foo:\n        $this->struct_foo = null;\n        break;\n      case TestUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = TestUnionEnum::_EMPTY_;\n  }\n\n  public function set_int_value(int $int_value)[write_props]: this {\n    $this->reset();\n    $this->_type = TestUnionEnum::int_value;\n    $this->int_value = $int_value;\n    return $this;\n  }\n\n  public function get_int_value()[]: ?int {\n    return $this->int_value;\n  }\n\n  public function getx_int_value()[]: int {\n    invariant(\n      $this->_type === TestUnionEnum::int_value,\n      'get_int_value called on an instance of TestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->int_value as nonnull;\n  }\n\n  public function set_str_value(string $str_value)[write_props]: this {\n    $this->reset();\n    $this->_type = TestUnionEnum::str_value;\n    $this->str_value = $str_value;\n    return $this;\n  }\n\n  public function get_str_value()[]: ?string {\n    return $this->str_value;\n  }\n\n  public function getx_str_value()[]: string {\n    invariant(\n      $this->_type === TestUnionEnum::str_value,\n      'get_str_value called on an instance of TestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->str_value as nonnull;\n  }\n\n  public function set_double_value(float $double_value)[write_props]: this {\n    $this->reset();\n    $this->_type = TestUnionEnum::double_value;\n    $this->double_value = $double_value;\n    return $this;\n  }\n\n  public function get_double_value()[]: ?float {\n    return $this->double_value;\n  }\n\n  public function getx_double_value()[]: float {\n    invariant(\n      $this->_type === TestUnionEnum::double_value,\n      'get_double_value called on an instance of TestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->double_value as nonnull;\n  }\n\n  public function set_list_of_strings(vec<string> $list_of_strings)[write_props]: this {\n    $this->reset();\n    $this->_type = TestUnionEnum::list_of_strings;\n    $this->list_of_strings = $list_of_strings;\n    return $this;\n  }\n\n  public function get_list_of_strings()[]: ?vec<string> {\n    return $this->list_of_strings;\n  }\n\n  public function getx_list_of_strings()[]: vec<string> {\n    invariant(\n      $this->_type === TestUnionEnum::list_of_strings,\n      'get_list_of_strings called on an instance of TestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->list_of_strings as nonnull;\n  }\n\n  public function set_map_of_string_to_ints(dict<string, int> $map_of_string_to_ints)[write_props]: this {\n    $this->reset();\n    $this->_type = TestUnionEnum::map_of_string_to_ints;\n    $this->map_of_string_to_ints = $map_of_string_to_ints;\n    return $this;\n  }\n\n  public function get_map_of_string_to_ints()[]: ?dict<string, int> {\n    return $this->map_of_string_to_ints;\n  }\n\n  public function getx_map_of_string_to_ints()[]: dict<string, int> {\n    invariant(\n      $this->_type === TestUnionEnum::map_of_string_to_ints,\n      'get_map_of_string_to_ints called on an instance of TestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->map_of_string_to_ints as nonnull;\n  }\n\n  public function set_struct_foo(Foo $struct_foo)[write_props]: this {\n    $this->reset();\n    $this->_type = TestUnionEnum::struct_foo;\n    $this->struct_foo = $struct_foo;\n    return $this;\n  }\n\n  public function get_struct_foo()[]: ?Foo {\n    return $this->struct_foo;\n  }\n\n  public function getx_struct_foo()[]: Foo {\n    invariant(\n      $this->_type === TestUnionEnum::struct_foo,\n      'get_struct_foo called on an instance of TestUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->struct_foo as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TestUnion\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"int_value\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"str_value\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"double_value\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_strings\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_ints\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                      \"underlyingType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.Foo\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"struct_foo\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'int_value'),\n      Shapes::idx($shape, 'str_value'),\n      Shapes::idx($shape, 'double_value'),\n      Shapes::idx($shape, 'list_of_strings'),\n      Shapes::idx($shape, 'map_of_string_to_ints'),\n      Shapes::idx($shape, 'struct_foo') === null ? null : (Foo::__fromShape($shape['struct_foo'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'int_value' => $this->int_value,\n      'str_value' => $this->str_value,\n      'double_value' => $this->double_value,\n      'list_of_strings' => $this->list_of_strings,\n      'map_of_string_to_ints' => $this->map_of_string_to_ints,\n      'struct_foo' => $this->struct_foo?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Foo\n */\nclass Foo implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'array',\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::SET,\n        'elem' => shape(\n          'type' => \\TType::SET,\n          'etype' => \\TType::I32,\n          'elem' => shape(\n            'type' => \\TType::I32,\n          ),\n          'format' => 'array',\n        ),\n        'format' => 'array',\n      ),\n      'format' => 'array',\n    ),\n    3 => shape(\n      'var' => 'c',\n      'type' => \\TType::I64,\n    ),\n    4 => shape(\n      'var' => 'd',\n      'type' => \\TType::BOOL,\n    ),\n    5 => shape(\n      'var' => 'str_value',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n    'c' => 3,\n    'd' => 4,\n    'str_value' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?varray<string>,\n    ?'b' => ?darray<string, varray<dict<int, bool>>>,\n    ?'c' => ?int,\n    ?'d' => ?bool,\n    ?'str_value' => ?string,\n  );\n\n  const type TShape = shape(\n    'a' => varray<string>,\n    ?'b' => ?darray<string, varray<dict<int, bool>>>,\n    'c' => int,\n    'd' => bool,\n    'str_value' => string,\n  );\n  const int STRUCTURAL_ID = 5952652426480946901;\n  /**\n   * Original thrift field:-\n   * 1: list<string> a\n   */\n  public vec<string> $a;\n  /**\n   * Original thrift field:-\n   * 2: map<string, list<set<i32>>> b\n   */\n  public ?dict<string, vec<dict<int, bool>>> $b;\n  /**\n   * Original thrift field:-\n   * 3: i64 c\n   */\n  public int $c;\n  /**\n   * Original thrift field:-\n   * 4: bool d\n   */\n  public bool $d;\n  /**\n   * Original thrift field:-\n   * 5: string str_value\n   */\n  public string $str_value;\n\n  public function __construct(?vec<string> $a = null, ?dict<string, vec<dict<int, bool>>> $b = null, ?int $c = null, ?bool $d = null, ?string $str_value = null)[] {\n    $this->a = $a ?? vec[];\n    $this->b = $b;\n    $this->c = $c ?? 7;\n    $this->d = $d ?? false;\n    $this->str_value = $str_value ?? \"hello\";\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n      Shapes::idx($shape, 'c'),\n      Shapes::idx($shape, 'd'),\n      Shapes::idx($shape, 'str_value'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Foo\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"b\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"c\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"d\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"str_value\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['a'],\n      Shapes::idx($shape, 'b'),\n      $shape['c'],\n      $shape['d'],\n      $shape['str_value'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'a' => $this->a,\n      'b' => $this->b,\n      'c' => $this->c,\n      'd' => $this->d,\n      'str_value' => $this->str_value,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * TestStruct\n */\nclass TestStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo_struct',\n      'type' => \\TType::STRUCT,\n      'class' => Foo::class,\n    ),\n    2 => shape(\n      'var' => 'union_value',\n      'type' => \\TType::STRUCT,\n      'class' => TestUnion::class,\n    ),\n    4 => shape(\n      'var' => 'list_of_struct_foo',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRUCT,\n      'elem' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => Foo::class,\n      ),\n      'format' => 'array',\n    ),\n    5 => shape(\n      'var' => 'map_of_string_to_struct_foo',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => Foo::class,\n      ),\n      'format' => 'array',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo_struct' => 1,\n    'union_value' => 2,\n    'list_of_struct_foo' => 4,\n    'map_of_string_to_struct_foo' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo_struct' => ?Foo,\n    ?'union_value' => ?TestUnion,\n    ?'list_of_struct_foo' => ?varray<Foo>,\n    ?'map_of_string_to_struct_foo' => ?darray<string, Foo>,\n  );\n\n  const type TShape = shape(\n    ?'foo_struct' => ?Foo::TShape,\n    ?'union_value' => ?TestUnion::TShape,\n    'list_of_struct_foo' => varray<Foo::TShape>,\n    'map_of_string_to_struct_foo' => darray<string, Foo::TShape>,\n  );\n  const int STRUCTURAL_ID = 6061345478592222801;\n  /**\n   * Original thrift field:-\n   * 1: module.Foo foo_struct\n   */\n  public ?Foo $foo_struct;\n  /**\n   * Original thrift field:-\n   * 2: module.TestUnion union_value\n   */\n  public ?TestUnion $union_value;\n  /**\n   * Original thrift field:-\n   * 4: list<module.Foo> list_of_struct_foo\n   */\n  public vec<Foo> $list_of_struct_foo;\n  /**\n   * Original thrift field:-\n   * 5: map<string, module.Foo> map_of_string_to_struct_foo\n   */\n  public dict<string, Foo> $map_of_string_to_struct_foo;\n\n  public function __construct(?Foo $foo_struct = null, ?TestUnion $union_value = null, ?vec<Foo> $list_of_struct_foo = null, ?dict<string, Foo> $map_of_string_to_struct_foo = null)[] {\n    $this->foo_struct = $foo_struct;\n    $this->union_value = $union_value;\n    $this->list_of_struct_foo = $list_of_struct_foo ?? vec[];\n    $this->map_of_string_to_struct_foo = $map_of_string_to_struct_foo ?? dict[];\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo_struct'),\n      Shapes::idx($shape, 'union_value'),\n      Shapes::idx($shape, 'list_of_struct_foo'),\n      Shapes::idx($shape, 'map_of_string_to_struct_foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TestStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TestStruct\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"foo_struct\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.TestUnion\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"union_value\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.Foo\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_struct_foo\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.Foo\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_struct_foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo_struct') === null ? null : (Foo::__fromShape($shape['foo_struct'])),\n      Shapes::idx($shape, 'union_value') === null ? null : (TestUnion::__fromShape($shape['union_value'])),\n      $shape['list_of_struct_foo']\n        |> Vec\\map(\n          $$,\n          $_val0 ==> $_val0\n            |> Foo::__fromShape($$),\n        ),\n      $shape['map_of_string_to_struct_foo']\n        |> Dict\\map(\n          $$,\n          $_val1 ==> $_val1\n            |> Foo::__fromShape($$),\n        ),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'foo_struct' => $this->foo_struct?->__toShape(),\n      'union_value' => $this->union_value?->__toShape(),\n      'list_of_struct_foo' => $this->list_of_struct_foo\n        |> Vec\\map(\n          $$,\n          ($_val0) ==> $_val0->__toShape(),\n        ),\n      'map_of_string_to_struct_foo' => $this->map_of_string_to_struct_foo\n        |> Dict\\map(\n          $$,\n          ($_val0) ==> $_val0->__toShape(),\n        ),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * Baz\n */\nclass Baz extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'some_field',\n      'type' => \\TType::STRUCT,\n      'class' => Foo::class,\n    ),\n    3 => shape(\n      'var' => 'some_container',\n      'type' => \\TType::SET,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'array',\n    ),\n    4 => shape(\n      'var' => 'code',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n    'some_field' => 2,\n    'some_container' => 3,\n    'code' => 4,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n    ?'some_field' => ?Foo,\n    ?'some_container' => ?dict<string, bool>,\n    ?'code' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 1663976252517274137;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n  /**\n   * Original thrift field:-\n   * 2: module.Foo some_field\n   */\n  public ?Foo $some_field;\n  /**\n   * Original thrift field:-\n   * 3: set<string> some_container\n   */\n  public dict<string, bool> $some_container;\n  /**\n   * Original thrift field:-\n   * 4: i32 code\n   */\n  public int $code;\n\n  public function __construct(?string $message = null, ?Foo $some_field = null, ?dict<string, bool> $some_container = null, ?int $code = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n    $this->some_field = $some_field;\n    $this->some_container = $some_container ?? dict[];\n    $this->code = $code ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n      Shapes::idx($shape, 'some_field'),\n      Shapes::idx($shape, 'some_container'),\n      Shapes::idx($shape, 'code'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Baz';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.Baz\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.Foo\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"some_field\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"some_container\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"code\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * OptBaz\n */\nclass OptBaz extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 546500496397478593;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    parent::__construct();\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'OptBaz';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.OptBaz\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1293}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift struct:-\n * A\n */\nclass A implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'map_of_string_to_string',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'harray',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'map_of_string_to_string' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?string,\n    ?'map_of_string_to_string' => ?dict<string, string>,\n  );\n\n  const type TShape = shape(\n    'a' => string,\n    'map_of_string_to_string' => dict<string, string>,\n    ...\n  );\n  const int STRUCTURAL_ID = 3181416921594932928;\n  /**\n   * Original thrift field:-\n   * 1: string a\n   */\n  public string $a;\n  /**\n   * Original thrift field:-\n   * 2: map<string, string> map_of_string_to_string\n   */\n  public dict<string, string> $map_of_string_to_string;\n\n  public function __construct(?string $a = null, ?dict<string, string> $map_of_string_to_string = null)[] {\n    $this->a = $a ?? '';\n    $this->map_of_string_to_string = $map_of_string_to_string ?? dict[];\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'map_of_string_to_string'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'A';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.A\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_string\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['a'],\n      $shape['map_of_string_to_string'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'a' => $this->a,\n      'map_of_string_to_string' => $this->map_of_string_to_string,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * B\n */\nclass B implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'map_of_string_to_string',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'harray',\n    ),\n    2 => shape(\n      'var' => 'map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'harray',\n    ),\n    3 => shape(\n      'var' => 'map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => A::class,\n      ),\n      'format' => 'harray',\n    ),\n    5 => shape(\n      'var' => 'map_of_string_to_list_of_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRUCT,\n        'elem' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    6 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    7 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    8 => shape(\n      'var' => 'list_of_string',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'harray',\n    ),\n    9 => shape(\n      'var' => 'list_of_map_of_string_to_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    12 => shape(\n      'var' => 'list_of_map_of_string_to_list_of_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::LST,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::LST,\n          'etype' => \\TType::STRUCT,\n          'elem' => shape(\n            'type' => \\TType::STRUCT,\n            'class' => A::class,\n          ),\n          'format' => 'harray',\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'map_of_string_to_string' => 1,\n    'map_of_string_to_i32' => 2,\n    'map_of_string_to_A' => 3,\n    'map_of_string_to_list_of_A' => 5,\n    'map_of_string_to_map_of_string_to_i32' => 6,\n    'map_of_string_to_map_of_string_to_A' => 7,\n    'list_of_string' => 8,\n    'list_of_map_of_string_to_A' => 9,\n    'list_of_map_of_string_to_list_of_A' => 12,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'map_of_string_to_string' => ?dict<string, string>,\n    ?'map_of_string_to_i32' => ?dict<string, int>,\n    ?'map_of_string_to_A' => ?dict<string, A>,\n    ?'map_of_string_to_list_of_A' => ?dict<string, vec<A>>,\n    ?'map_of_string_to_map_of_string_to_i32' => ?dict<string, dict<string, int>>,\n    ?'map_of_string_to_map_of_string_to_A' => ?dict<string, dict<string, A>>,\n    ?'list_of_string' => ?vec<string>,\n    ?'list_of_map_of_string_to_A' => ?vec<dict<string, A>>,\n    ?'list_of_map_of_string_to_list_of_A' => ?vec<dict<string, vec<A>>>,\n  );\n\n  const type TShape = shape(\n    'map_of_string_to_string' => dict<string, string>,\n    'map_of_string_to_i32' => dict<string, int>,\n    'map_of_string_to_A' => dict<string, A::TShape>,\n    'map_of_string_to_list_of_A' => dict<string, vec<A::TShape>>,\n    'map_of_string_to_map_of_string_to_i32' => dict<string, dict<string, int>>,\n    'map_of_string_to_map_of_string_to_A' => dict<string, dict<string, A::TShape>>,\n    'list_of_string' => vec<string>,\n    'list_of_map_of_string_to_A' => vec<dict<string, A::TShape>>,\n    'list_of_map_of_string_to_list_of_A' => vec<dict<string, vec<A::TShape>>>,\n    ...\n  );\n  const int STRUCTURAL_ID = 924423330915405193;\n  /**\n   * Original thrift field:-\n   * 1: map<string, string> map_of_string_to_string\n   */\n  public dict<string, string> $map_of_string_to_string;\n  /**\n   * Original thrift field:-\n   * 2: map<string, i32> map_of_string_to_i32\n   */\n  public dict<string, int> $map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 3: map<string, module.A> map_of_string_to_A\n   */\n  public dict<string, A> $map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 5: map<string, list<module.A>> map_of_string_to_list_of_A\n   */\n  public dict<string, vec<A>> $map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 6: map<string, map<string, i32>> map_of_string_to_map_of_string_to_i32\n   */\n  public dict<string, dict<string, int>> $map_of_string_to_map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 7: map<string, map<string, module.A>> map_of_string_to_map_of_string_to_A\n   */\n  public dict<string, dict<string, A>> $map_of_string_to_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 8: list<string> list_of_string\n   */\n  public vec<string> $list_of_string;\n  /**\n   * Original thrift field:-\n   * 9: list<map<string, module.A>> list_of_map_of_string_to_A\n   */\n  public vec<dict<string, A>> $list_of_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 12: list<map<string, list<module.A>>> list_of_map_of_string_to_list_of_A\n   */\n  public vec<dict<string, vec<A>>> $list_of_map_of_string_to_list_of_A;\n\n  public function __construct(?dict<string, string> $map_of_string_to_string = null, ?dict<string, int> $map_of_string_to_i32 = null, ?dict<string, A> $map_of_string_to_A = null, ?dict<string, vec<A>> $map_of_string_to_list_of_A = null, ?dict<string, dict<string, int>> $map_of_string_to_map_of_string_to_i32 = null, ?dict<string, dict<string, A>> $map_of_string_to_map_of_string_to_A = null, ?vec<string> $list_of_string = null, ?vec<dict<string, A>> $list_of_map_of_string_to_A = null, ?vec<dict<string, vec<A>>> $list_of_map_of_string_to_list_of_A = null)[] {\n    $this->map_of_string_to_string = $map_of_string_to_string ?? dict[];\n    $this->map_of_string_to_i32 = $map_of_string_to_i32 ?? dict[];\n    $this->map_of_string_to_A = $map_of_string_to_A ?? dict[];\n    $this->map_of_string_to_list_of_A = $map_of_string_to_list_of_A ?? dict[];\n    $this->map_of_string_to_map_of_string_to_i32 = $map_of_string_to_map_of_string_to_i32 ?? dict[];\n    $this->map_of_string_to_map_of_string_to_A = $map_of_string_to_map_of_string_to_A ?? dict[];\n    $this->list_of_string = $list_of_string ?? vec[];\n    $this->list_of_map_of_string_to_A = $list_of_map_of_string_to_A ?? vec[];\n    $this->list_of_map_of_string_to_list_of_A = $list_of_map_of_string_to_list_of_A ?? vec[];\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'map_of_string_to_string'),\n      Shapes::idx($shape, 'map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_A'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_A'),\n      Shapes::idx($shape, 'list_of_string'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_A'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_list_of_A'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'B';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.B\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_string\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.A\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_string\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 12,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.A\",\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_list_of_A\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['map_of_string_to_string'],\n      $shape['map_of_string_to_i32'],\n      $shape['map_of_string_to_A']\n        |> Dict\\map(\n          $$,\n          $_val0 ==> $_val0\n            |> A::__fromShape($$),\n        ),\n      $shape['map_of_string_to_list_of_A']\n        |> Dict\\map(\n          $$,\n          $_val2 ==> $_val2\n            |> Vec\\map(\n              $$,\n              $_val1 ==> $_val1\n                |> A::__fromShape($$),\n            ),\n        ),\n      $shape['map_of_string_to_map_of_string_to_i32'],\n      $shape['map_of_string_to_map_of_string_to_A']\n        |> Dict\\map(\n          $$,\n          $_val4 ==> $_val4\n            |> Dict\\map(\n              $$,\n              $_val3 ==> $_val3\n                |> A::__fromShape($$),\n            ),\n        ),\n      $shape['list_of_string'],\n      $shape['list_of_map_of_string_to_A']\n        |> Vec\\map(\n          $$,\n          $_val6 ==> $_val6\n            |> Dict\\map(\n              $$,\n              $_val5 ==> $_val5\n                |> A::__fromShape($$),\n            ),\n        ),\n      $shape['list_of_map_of_string_to_list_of_A']\n        |> Vec\\map(\n          $$,\n          $_val9 ==> $_val9\n            |> Dict\\map(\n              $$,\n              $_val8 ==> $_val8\n                |> Vec\\map(\n                  $$,\n                  $_val7 ==> $_val7\n                    |> A::__fromShape($$),\n                ),\n            ),\n        ),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'map_of_string_to_string' => $this->map_of_string_to_string,\n      'map_of_string_to_i32' => $this->map_of_string_to_i32,\n      'map_of_string_to_A' => $this->map_of_string_to_A\n        |> Dict\\map(\n          $$,\n          ($_val0) ==> $_val0->__toShape(),\n        ),\n      'map_of_string_to_list_of_A' => $this->map_of_string_to_list_of_A\n        |> Dict\\map(\n          $$,\n          ($_val0) ==> $_val0\n            |> Vec\\map(\n              $$,\n              ($_val1) ==> $_val1->__toShape(),\n            ),\n        ),\n      'map_of_string_to_map_of_string_to_i32' => $this->map_of_string_to_map_of_string_to_i32,\n      'map_of_string_to_map_of_string_to_A' => $this->map_of_string_to_map_of_string_to_A\n        |> Dict\\map(\n          $$,\n          ($_val0) ==> $_val0\n            |> Dict\\map(\n              $$,\n              ($_val1) ==> $_val1->__toShape(),\n            ),\n        ),\n      'list_of_string' => $this->list_of_string,\n      'list_of_map_of_string_to_A' => $this->list_of_map_of_string_to_A\n        |> Vec\\map(\n          $$,\n          ($_val0) ==> $_val0\n            |> Dict\\map(\n              $$,\n              ($_val1) ==> $_val1->__toShape(),\n            ),\n        ),\n      'list_of_map_of_string_to_list_of_A' => $this->list_of_map_of_string_to_list_of_A\n        |> Vec\\map(\n          $$,\n          ($_val0) ==> $_val0\n            |> Dict\\map(\n              $$,\n              ($_val1) ==> $_val1\n                |> Vec\\map(\n                  $$,\n                  ($_val2) ==> $_val2->__toShape(),\n                ),\n            ),\n        ),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * C\n */\nclass C implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'map_of_string_to_string',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'harray',\n    ),\n    2 => shape(\n      'var' => 'map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'harray',\n    ),\n    3 => shape(\n      'var' => 'map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => A::class,\n      ),\n      'format' => 'harray',\n    ),\n    5 => shape(\n      'var' => 'map_of_string_to_list_of_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRUCT,\n        'elem' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    6 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    7 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    8 => shape(\n      'var' => 'list_of_string',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'harray',\n    ),\n    9 => shape(\n      'var' => 'list_of_map_of_string_to_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n    12 => shape(\n      'var' => 'list_of_map_of_string_to_list_of_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::LST,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::LST,\n          'etype' => \\TType::STRUCT,\n          'elem' => shape(\n            'type' => \\TType::STRUCT,\n            'class' => A::class,\n          ),\n          'format' => 'harray',\n        ),\n        'format' => 'harray',\n      ),\n      'format' => 'harray',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'map_of_string_to_string' => 1,\n    'map_of_string_to_i32' => 2,\n    'map_of_string_to_A' => 3,\n    'map_of_string_to_list_of_A' => 5,\n    'map_of_string_to_map_of_string_to_i32' => 6,\n    'map_of_string_to_map_of_string_to_A' => 7,\n    'list_of_string' => 8,\n    'list_of_map_of_string_to_A' => 9,\n    'list_of_map_of_string_to_list_of_A' => 12,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'map_of_string_to_string' => ?dict<string, string>,\n    ?'map_of_string_to_i32' => ?dict<string, int>,\n    ?'map_of_string_to_A' => ?dict<string, A>,\n    ?'map_of_string_to_list_of_A' => ?dict<string, vec<A>>,\n    ?'map_of_string_to_map_of_string_to_i32' => ?dict<string, dict<string, int>>,\n    ?'map_of_string_to_map_of_string_to_A' => ?dict<string, dict<string, A>>,\n    ?'list_of_string' => ?vec<string>,\n    ?'list_of_map_of_string_to_A' => ?vec<dict<string, A>>,\n    ?'list_of_map_of_string_to_list_of_A' => ?vec<dict<string, vec<A>>>,\n  );\n\n  const type TShape = shape(\n    ?'map_of_string_to_string' => ?dict<string, string>,\n    ?'map_of_string_to_i32' => ?dict<string, int>,\n    ?'map_of_string_to_A' => ?dict<string, A::TShape>,\n    ?'map_of_string_to_list_of_A' => ?dict<string, vec<A::TShape>>,\n    ?'map_of_string_to_map_of_string_to_i32' => ?dict<string, dict<string, int>>,\n    ?'map_of_string_to_map_of_string_to_A' => ?dict<string, dict<string, A::TShape>>,\n    ?'list_of_string' => ?vec<string>,\n    ?'list_of_map_of_string_to_A' => ?vec<dict<string, A::TShape>>,\n    ?'list_of_map_of_string_to_list_of_A' => ?vec<dict<string, vec<A::TShape>>>,\n    ...\n  );\n  const int STRUCTURAL_ID = 1457869504541452190;\n  /**\n   * Original thrift field:-\n   * 1: map<string, string> map_of_string_to_string\n   */\n  public ?dict<string, string> $map_of_string_to_string;\n  /**\n   * Original thrift field:-\n   * 2: map<string, i32> map_of_string_to_i32\n   */\n  public ?dict<string, int> $map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 3: map<string, module.A> map_of_string_to_A\n   */\n  public ?dict<string, A> $map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 5: map<string, list<module.A>> map_of_string_to_list_of_A\n   */\n  public ?dict<string, vec<A>> $map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 6: map<string, map<string, i32>> map_of_string_to_map_of_string_to_i32\n   */\n  public ?dict<string, dict<string, int>> $map_of_string_to_map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 7: map<string, map<string, module.A>> map_of_string_to_map_of_string_to_A\n   */\n  public ?dict<string, dict<string, A>> $map_of_string_to_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 8: list<string> list_of_string\n   */\n  public ?vec<string> $list_of_string;\n  /**\n   * Original thrift field:-\n   * 9: list<map<string, module.A>> list_of_map_of_string_to_A\n   */\n  public ?vec<dict<string, A>> $list_of_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 12: list<map<string, list<module.A>>> list_of_map_of_string_to_list_of_A\n   */\n  public ?vec<dict<string, vec<A>>> $list_of_map_of_string_to_list_of_A;\n\n  public function __construct(?dict<string, string> $map_of_string_to_string = null, ?dict<string, int> $map_of_string_to_i32 = null, ?dict<string, A> $map_of_string_to_A = null, ?dict<string, vec<A>> $map_of_string_to_list_of_A = null, ?dict<string, dict<string, int>> $map_of_string_to_map_of_string_to_i32 = null, ?dict<string, dict<string, A>> $map_of_string_to_map_of_string_to_A = null, ?vec<string> $list_of_string = null, ?vec<dict<string, A>> $list_of_map_of_string_to_A = null, ?vec<dict<string, vec<A>>> $list_of_map_of_string_to_list_of_A = null)[] {\n    $this->map_of_string_to_string = $map_of_string_to_string;\n    $this->map_of_string_to_i32 = $map_of_string_to_i32;\n    $this->map_of_string_to_A = $map_of_string_to_A;\n    $this->map_of_string_to_list_of_A = $map_of_string_to_list_of_A;\n    $this->map_of_string_to_map_of_string_to_i32 = $map_of_string_to_map_of_string_to_i32;\n    $this->map_of_string_to_map_of_string_to_A = $map_of_string_to_map_of_string_to_A;\n    $this->list_of_string = $list_of_string;\n    $this->list_of_map_of_string_to_A = $list_of_map_of_string_to_A;\n    $this->list_of_map_of_string_to_list_of_A = $list_of_map_of_string_to_list_of_A;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'map_of_string_to_string'),\n      Shapes::idx($shape, 'map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_A'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_A'),\n      Shapes::idx($shape, 'list_of_string'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_A'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_list_of_A'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'C';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.C\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_string\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.A\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_string\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 12,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.A\",\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_list_of_A\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'map_of_string_to_string'),\n      Shapes::idx($shape, 'map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_A') === null ? null : ($shape['map_of_string_to_A']\n        |> Dict\\map(\n          $$,\n          $_val0 ==> $_val0\n            |> A::__fromShape($$),\n        )),\n      Shapes::idx($shape, 'map_of_string_to_list_of_A') === null ? null : ($shape['map_of_string_to_list_of_A']\n        |> Dict\\map(\n          $$,\n          $_val2 ==> $_val2\n            |> Vec\\map(\n              $$,\n              $_val1 ==> $_val1\n                |> A::__fromShape($$),\n            ),\n        )),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_A') === null ? null : ($shape['map_of_string_to_map_of_string_to_A']\n        |> Dict\\map(\n          $$,\n          $_val4 ==> $_val4\n            |> Dict\\map(\n              $$,\n              $_val3 ==> $_val3\n                |> A::__fromShape($$),\n            ),\n        )),\n      Shapes::idx($shape, 'list_of_string'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_A') === null ? null : ($shape['list_of_map_of_string_to_A']\n        |> Vec\\map(\n          $$,\n          $_val6 ==> $_val6\n            |> Dict\\map(\n              $$,\n              $_val5 ==> $_val5\n                |> A::__fromShape($$),\n            ),\n        )),\n      Shapes::idx($shape, 'list_of_map_of_string_to_list_of_A') === null ? null : ($shape['list_of_map_of_string_to_list_of_A']\n        |> Vec\\map(\n          $$,\n          $_val9 ==> $_val9\n            |> Dict\\map(\n              $$,\n              $_val8 ==> $_val8\n                |> Vec\\map(\n                  $$,\n                  $_val7 ==> $_val7\n                    |> A::__fromShape($$),\n                ),\n            ),\n        )),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'map_of_string_to_string' => $this->map_of_string_to_string,\n      'map_of_string_to_i32' => $this->map_of_string_to_i32,\n      'map_of_string_to_A' => $this->map_of_string_to_A\n        |> $$ === null \n          ? null \n          : Dict\\map(\n            $$,\n            ($_val0) ==> $_val0->__toShape(),\n          ),\n      'map_of_string_to_list_of_A' => $this->map_of_string_to_list_of_A\n        |> $$ === null \n          ? null \n          : Dict\\map(\n            $$,\n            ($_val0) ==> $_val0\n              |> Vec\\map(\n                $$,\n                ($_val1) ==> $_val1->__toShape(),\n              ),\n          ),\n      'map_of_string_to_map_of_string_to_i32' => $this->map_of_string_to_map_of_string_to_i32,\n      'map_of_string_to_map_of_string_to_A' => $this->map_of_string_to_map_of_string_to_A\n        |> $$ === null \n          ? null \n          : Dict\\map(\n            $$,\n            ($_val0) ==> $_val0\n              |> Dict\\map(\n                $$,\n                ($_val1) ==> $_val1->__toShape(),\n              ),\n          ),\n      'list_of_string' => $this->list_of_string,\n      'list_of_map_of_string_to_A' => $this->list_of_map_of_string_to_A\n        |> $$ === null \n          ? null \n          : Vec\\map(\n            $$,\n            ($_val0) ==> $_val0\n              |> Dict\\map(\n                $$,\n                ($_val1) ==> $_val1->__toShape(),\n              ),\n          ),\n      'list_of_map_of_string_to_list_of_A' => $this->list_of_map_of_string_to_list_of_A\n        |> $$ === null \n          ? null \n          : Vec\\map(\n            $$,\n            ($_val0) ==> $_val0\n              |> Dict\\map(\n                $$,\n                ($_val1) ==> $_val1\n                  |> Vec\\map(\n                    $$,\n                    ($_val2) ==> $_val2->__toShape(),\n                  ),\n              ),\n          ),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1599}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift struct:-\n * A\n */\nclass A implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'map_of_string_to_string',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'map_of_string_to_string' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?string,\n    ?'map_of_string_to_string' => ?Map<string, string>,\n  );\n\n  const type TShape = shape(\n    ?'a' => ?string,\n    ?'map_of_string_to_string' => ?dict<string, string>,\n    ...\n  );\n  const int STRUCTURAL_ID = 3181416921594932928;\n  /**\n   * Original thrift field:-\n   * 1: string a\n   */\n  public ?string $a;\n  /**\n   * Original thrift field:-\n   * 2: map<string, string> map_of_string_to_string\n   */\n  public ?Map<string, string> $map_of_string_to_string;\n\n  public function __construct(?string $a = null, ?Map<string, string> $map_of_string_to_string = null)[] {\n    $this->a = $a;\n    $this->map_of_string_to_string = $map_of_string_to_string;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'map_of_string_to_string'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'A';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.A\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_string\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'map_of_string_to_string') === null ? null : ($shape['map_of_string_to_string'] |> new Map($$)),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'a' => $this->a,\n      'map_of_string_to_string' => $this->map_of_string_to_string\n        |> $$ === null ? null : dict($$),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * B\n */\nclass B implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'map_of_string_to_string',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => A::class,\n      ),\n      'format' => 'collection',\n    ),\n    5 => shape(\n      'var' => 'map_of_string_to_list_of_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRUCT,\n        'elem' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    6 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    7 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    8 => shape(\n      'var' => 'list_of_string',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    9 => shape(\n      'var' => 'list_of_map_of_string_to_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    12 => shape(\n      'var' => 'list_of_map_of_string_to_list_of_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::LST,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::LST,\n          'etype' => \\TType::STRUCT,\n          'elem' => shape(\n            'type' => \\TType::STRUCT,\n            'class' => A::class,\n          ),\n          'format' => 'collection',\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'map_of_string_to_string' => 1,\n    'map_of_string_to_i32' => 2,\n    'map_of_string_to_A' => 3,\n    'map_of_string_to_list_of_A' => 5,\n    'map_of_string_to_map_of_string_to_i32' => 6,\n    'map_of_string_to_map_of_string_to_A' => 7,\n    'list_of_string' => 8,\n    'list_of_map_of_string_to_A' => 9,\n    'list_of_map_of_string_to_list_of_A' => 12,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'map_of_string_to_string' => ?Map<string, string>,\n    ?'map_of_string_to_i32' => ?Map<string, int>,\n    ?'map_of_string_to_A' => ?Map<string, A>,\n    ?'map_of_string_to_list_of_A' => ?Map<string, Vector<A>>,\n    ?'map_of_string_to_map_of_string_to_i32' => ?Map<string, Map<string, int>>,\n    ?'map_of_string_to_map_of_string_to_A' => ?Map<string, Map<string, A>>,\n    ?'list_of_string' => ?Vector<string>,\n    ?'list_of_map_of_string_to_A' => ?Vector<Map<string, A>>,\n    ?'list_of_map_of_string_to_list_of_A' => ?Vector<Map<string, Vector<A>>>,\n  );\n\n  const type TShape = shape(\n    ?'map_of_string_to_string' => ?dict<string, string>,\n    ?'map_of_string_to_i32' => ?dict<string, int>,\n    ?'map_of_string_to_A' => ?dict<string, A::TShape>,\n    ?'map_of_string_to_list_of_A' => ?dict<string, vec<A::TShape>>,\n    ?'map_of_string_to_map_of_string_to_i32' => ?dict<string, dict<string, int>>,\n    ?'map_of_string_to_map_of_string_to_A' => ?dict<string, dict<string, A::TShape>>,\n    ?'list_of_string' => ?vec<string>,\n    ?'list_of_map_of_string_to_A' => ?vec<dict<string, A::TShape>>,\n    ?'list_of_map_of_string_to_list_of_A' => ?vec<dict<string, vec<A::TShape>>>,\n    ...\n  );\n  const int STRUCTURAL_ID = 924423330915405193;\n  /**\n   * Original thrift field:-\n   * 1: map<string, string> map_of_string_to_string\n   */\n  public ?Map<string, string> $map_of_string_to_string;\n  /**\n   * Original thrift field:-\n   * 2: map<string, i32> map_of_string_to_i32\n   */\n  public ?Map<string, int> $map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 3: map<string, module.A> map_of_string_to_A\n   */\n  public ?Map<string, A> $map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 5: map<string, list<module.A>> map_of_string_to_list_of_A\n   */\n  public ?Map<string, Vector<A>> $map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 6: map<string, map<string, i32>> map_of_string_to_map_of_string_to_i32\n   */\n  public ?Map<string, Map<string, int>> $map_of_string_to_map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 7: map<string, map<string, module.A>> map_of_string_to_map_of_string_to_A\n   */\n  public ?Map<string, Map<string, A>> $map_of_string_to_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 8: list<string> list_of_string\n   */\n  public ?Vector<string> $list_of_string;\n  /**\n   * Original thrift field:-\n   * 9: list<map<string, module.A>> list_of_map_of_string_to_A\n   */\n  public ?Vector<Map<string, A>> $list_of_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 12: list<map<string, list<module.A>>> list_of_map_of_string_to_list_of_A\n   */\n  public ?Vector<Map<string, Vector<A>>> $list_of_map_of_string_to_list_of_A;\n\n  public function __construct(?Map<string, string> $map_of_string_to_string = null, ?Map<string, int> $map_of_string_to_i32 = null, ?Map<string, A> $map_of_string_to_A = null, ?Map<string, Vector<A>> $map_of_string_to_list_of_A = null, ?Map<string, Map<string, int>> $map_of_string_to_map_of_string_to_i32 = null, ?Map<string, Map<string, A>> $map_of_string_to_map_of_string_to_A = null, ?Vector<string> $list_of_string = null, ?Vector<Map<string, A>> $list_of_map_of_string_to_A = null, ?Vector<Map<string, Vector<A>>> $list_of_map_of_string_to_list_of_A = null)[] {\n    $this->map_of_string_to_string = $map_of_string_to_string;\n    $this->map_of_string_to_i32 = $map_of_string_to_i32;\n    $this->map_of_string_to_A = $map_of_string_to_A;\n    $this->map_of_string_to_list_of_A = $map_of_string_to_list_of_A;\n    $this->map_of_string_to_map_of_string_to_i32 = $map_of_string_to_map_of_string_to_i32;\n    $this->map_of_string_to_map_of_string_to_A = $map_of_string_to_map_of_string_to_A;\n    $this->list_of_string = $list_of_string;\n    $this->list_of_map_of_string_to_A = $list_of_map_of_string_to_A;\n    $this->list_of_map_of_string_to_list_of_A = $list_of_map_of_string_to_list_of_A;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'map_of_string_to_string'),\n      Shapes::idx($shape, 'map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_A'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_A'),\n      Shapes::idx($shape, 'list_of_string'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_A'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_list_of_A'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'B';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.B\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_string\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.A\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_i32\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_string\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_A\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 12,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.A\",\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_list_of_A\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'map_of_string_to_string') === null ? null : ($shape['map_of_string_to_string'] |> new Map($$)),\n      Shapes::idx($shape, 'map_of_string_to_i32') === null ? null : ($shape['map_of_string_to_i32'] |> new Map($$)),\n      Shapes::idx($shape, 'map_of_string_to_A') === null ? null : ($shape['map_of_string_to_A']\n        |> Dict\\map(\n          $$,\n          $_val0 ==> $_val0\n            |> A::__fromShape($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'map_of_string_to_list_of_A') === null ? null : ($shape['map_of_string_to_list_of_A']\n        |> Dict\\map(\n          $$,\n          $_val2 ==> $_val2\n            |> Vec\\map(\n              $$,\n              $_val1 ==> $_val1\n                |> A::__fromShape($$),\n            ) |> new Vector($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_i32') === null ? null : ($shape['map_of_string_to_map_of_string_to_i32']\n        |> Dict\\map(\n          $$,\n          $_val3 ==> $_val3 |> new Map($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_A') === null ? null : ($shape['map_of_string_to_map_of_string_to_A']\n        |> Dict\\map(\n          $$,\n          $_val5 ==> $_val5\n            |> Dict\\map(\n              $$,\n              $_val4 ==> $_val4\n                |> A::__fromShape($$),\n            ) |> new Map($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'list_of_string') === null ? null : ($shape['list_of_string'] |> new Vector($$)),\n      Shapes::idx($shape, 'list_of_map_of_string_to_A') === null ? null : ($shape['list_of_map_of_string_to_A']\n        |> Vec\\map(\n          $$,\n          $_val7 ==> $_val7\n            |> Dict\\map(\n              $$,\n              $_val6 ==> $_val6\n                |> A::__fromShape($$),\n            ) |> new Map($$),\n        ) |> new Vector($$)),\n      Shapes::idx($shape, 'list_of_map_of_string_to_list_of_A') === null ? null : ($shape['list_of_map_of_string_to_list_of_A']\n        |> Vec\\map(\n          $$,\n          $_val10 ==> $_val10\n            |> Dict\\map(\n              $$,\n              $_val9 ==> $_val9\n                |> Vec\\map(\n                  $$,\n                  $_val8 ==> $_val8\n                    |> A::__fromShape($$),\n                ) |> new Vector($$),\n            ) |> new Map($$),\n        ) |> new Vector($$)),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'map_of_string_to_string' => $this->map_of_string_to_string\n        |> $$ === null ? null : dict($$),\n      'map_of_string_to_i32' => $this->map_of_string_to_i32\n        |> $$ === null ? null : dict($$),\n      'map_of_string_to_A' => $this->map_of_string_to_A?->map(\n        ($_val0) ==> $_val0->__toShape(),\n      )\n        |> $$ === null ? null : dict($$),\n      'map_of_string_to_list_of_A' => $this->map_of_string_to_list_of_A?->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> vec($$),\n      )\n        |> $$ === null ? null : dict($$),\n      'map_of_string_to_map_of_string_to_i32' => $this->map_of_string_to_map_of_string_to_i32?->map(\n        ($_val0) ==> dict($_val0),\n      )\n        |> $$ === null ? null : dict($$),\n      'map_of_string_to_map_of_string_to_A' => $this->map_of_string_to_map_of_string_to_A?->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> dict($$),\n      )\n        |> $$ === null ? null : dict($$),\n      'list_of_string' => $this->list_of_string\n        |> $$ === null ? null : vec($$),\n      'list_of_map_of_string_to_A' => $this->list_of_map_of_string_to_A?->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> dict($$),\n      )\n        |> $$ === null ? null : vec($$),\n      'list_of_map_of_string_to_list_of_A' => $this->list_of_map_of_string_to_list_of_A?->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->map(\n            ($_val2) ==> $_val2->__toShape(),\n          )\n            |> vec($$),\n        )\n          |> dict($$),\n      )\n        |> $$ === null ? null : vec($$),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * C\n */\nclass C implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'map_of_string_to_string',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => A::class,\n      ),\n      'format' => 'collection',\n    ),\n    5 => shape(\n      'var' => 'map_of_string_to_list_of_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::LST,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::LST,\n        'etype' => \\TType::STRUCT,\n        'elem' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    6 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_i32',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::I32,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::I32,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    7 => shape(\n      'var' => 'map_of_string_to_map_of_string_to_A',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::MAP,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    8 => shape(\n      'var' => 'list_of_string',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    9 => shape(\n      'var' => 'list_of_map_of_string_to_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::STRUCT,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRUCT,\n          'class' => A::class,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n    12 => shape(\n      'var' => 'list_of_map_of_string_to_list_of_A',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::STRING,\n        'vtype' => \\TType::LST,\n        'key' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'val' => shape(\n          'type' => \\TType::LST,\n          'etype' => \\TType::STRUCT,\n          'elem' => shape(\n            'type' => \\TType::STRUCT,\n            'class' => A::class,\n          ),\n          'format' => 'collection',\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'map_of_string_to_string' => 1,\n    'map_of_string_to_i32' => 2,\n    'map_of_string_to_A' => 3,\n    'map_of_string_to_list_of_A' => 5,\n    'map_of_string_to_map_of_string_to_i32' => 6,\n    'map_of_string_to_map_of_string_to_A' => 7,\n    'list_of_string' => 8,\n    'list_of_map_of_string_to_A' => 9,\n    'list_of_map_of_string_to_list_of_A' => 12,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'map_of_string_to_string' => ?Map<string, string>,\n    ?'map_of_string_to_i32' => ?Map<string, int>,\n    ?'map_of_string_to_A' => ?Map<string, A>,\n    ?'map_of_string_to_list_of_A' => ?Map<string, Vector<A>>,\n    ?'map_of_string_to_map_of_string_to_i32' => ?Map<string, Map<string, int>>,\n    ?'map_of_string_to_map_of_string_to_A' => ?Map<string, Map<string, A>>,\n    ?'list_of_string' => ?Vector<string>,\n    ?'list_of_map_of_string_to_A' => ?Vector<Map<string, A>>,\n    ?'list_of_map_of_string_to_list_of_A' => ?Vector<Map<string, Vector<A>>>,\n  );\n\n  const type TShape = shape(\n    ?'map_of_string_to_string' => ?dict<string, string>,\n    ?'map_of_string_to_i32' => ?dict<string, int>,\n    ?'map_of_string_to_A' => ?dict<string, A::TShape>,\n    ?'map_of_string_to_list_of_A' => ?dict<string, vec<A::TShape>>,\n    ?'map_of_string_to_map_of_string_to_i32' => ?dict<string, dict<string, int>>,\n    ?'map_of_string_to_map_of_string_to_A' => ?dict<string, dict<string, A::TShape>>,\n    ?'list_of_string' => ?vec<string>,\n    ?'list_of_map_of_string_to_A' => ?vec<dict<string, A::TShape>>,\n    ?'list_of_map_of_string_to_list_of_A' => ?vec<dict<string, vec<A::TShape>>>,\n    ...\n  );\n  const int STRUCTURAL_ID = 1457869504541452190;\n  /**\n   * Original thrift field:-\n   * 1: map<string, string> map_of_string_to_string\n   */\n  public ?Map<string, string> $map_of_string_to_string;\n  /**\n   * Original thrift field:-\n   * 2: map<string, i32> map_of_string_to_i32\n   */\n  public ?Map<string, int> $map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 3: map<string, module.A> map_of_string_to_A\n   */\n  public ?Map<string, A> $map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 5: map<string, list<module.A>> map_of_string_to_list_of_A\n   */\n  public ?Map<string, Vector<A>> $map_of_string_to_list_of_A;\n  /**\n   * Original thrift field:-\n   * 6: map<string, map<string, i32>> map_of_string_to_map_of_string_to_i32\n   */\n  public ?Map<string, Map<string, int>> $map_of_string_to_map_of_string_to_i32;\n  /**\n   * Original thrift field:-\n   * 7: map<string, map<string, module.A>> map_of_string_to_map_of_string_to_A\n   */\n  public ?Map<string, Map<string, A>> $map_of_string_to_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 8: list<string> list_of_string\n   */\n  public ?Vector<string> $list_of_string;\n  /**\n   * Original thrift field:-\n   * 9: list<map<string, module.A>> list_of_map_of_string_to_A\n   */\n  public ?Vector<Map<string, A>> $list_of_map_of_string_to_A;\n  /**\n   * Original thrift field:-\n   * 12: list<map<string, list<module.A>>> list_of_map_of_string_to_list_of_A\n   */\n  public ?Vector<Map<string, Vector<A>>> $list_of_map_of_string_to_list_of_A;\n\n  public function __construct(?Map<string, string> $map_of_string_to_string = null, ?Map<string, int> $map_of_string_to_i32 = null, ?Map<string, A> $map_of_string_to_A = null, ?Map<string, Vector<A>> $map_of_string_to_list_of_A = null, ?Map<string, Map<string, int>> $map_of_string_to_map_of_string_to_i32 = null, ?Map<string, Map<string, A>> $map_of_string_to_map_of_string_to_A = null, ?Vector<string> $list_of_string = null, ?Vector<Map<string, A>> $list_of_map_of_string_to_A = null, ?Vector<Map<string, Vector<A>>> $list_of_map_of_string_to_list_of_A = null)[] {\n    $this->map_of_string_to_string = $map_of_string_to_string;\n    $this->map_of_string_to_i32 = $map_of_string_to_i32;\n    $this->map_of_string_to_A = $map_of_string_to_A;\n    $this->map_of_string_to_list_of_A = $map_of_string_to_list_of_A;\n    $this->map_of_string_to_map_of_string_to_i32 = $map_of_string_to_map_of_string_to_i32;\n    $this->map_of_string_to_map_of_string_to_A = $map_of_string_to_map_of_string_to_A;\n    $this->list_of_string = $list_of_string;\n    $this->list_of_map_of_string_to_A = $list_of_map_of_string_to_A;\n    $this->list_of_map_of_string_to_list_of_A = $list_of_map_of_string_to_list_of_A;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'map_of_string_to_string'),\n      Shapes::idx($shape, 'map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_A'),\n      Shapes::idx($shape, 'map_of_string_to_list_of_A'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_i32'),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_A'),\n      Shapes::idx($shape, 'list_of_string'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_A'),\n      Shapes::idx($shape, 'list_of_map_of_string_to_list_of_A'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'C';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.C\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_string\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.A\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_list\" => tmeta_ThriftListType::fromShape(\n                            shape(\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_list_of_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_i32\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_of_string_to_map_of_string_to_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_string\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.A\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_A\",\n              \"is_optional\" => true,\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 12,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                              \"valueType\" => tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_list\" => tmeta_ThriftListType::fromShape(\n                                    shape(\n                                      \"valueType\" => tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                                            shape(\n                                              \"name\" => \"module.A\",\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_of_map_of_string_to_list_of_A\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'map_of_string_to_string') === null ? null : ($shape['map_of_string_to_string'] |> new Map($$)),\n      Shapes::idx($shape, 'map_of_string_to_i32') === null ? null : ($shape['map_of_string_to_i32'] |> new Map($$)),\n      Shapes::idx($shape, 'map_of_string_to_A') === null ? null : ($shape['map_of_string_to_A']\n        |> Dict\\map(\n          $$,\n          $_val0 ==> $_val0\n            |> A::__fromShape($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'map_of_string_to_list_of_A') === null ? null : ($shape['map_of_string_to_list_of_A']\n        |> Dict\\map(\n          $$,\n          $_val2 ==> $_val2\n            |> Vec\\map(\n              $$,\n              $_val1 ==> $_val1\n                |> A::__fromShape($$),\n            ) |> new Vector($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_i32') === null ? null : ($shape['map_of_string_to_map_of_string_to_i32']\n        |> Dict\\map(\n          $$,\n          $_val3 ==> $_val3 |> new Map($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'map_of_string_to_map_of_string_to_A') === null ? null : ($shape['map_of_string_to_map_of_string_to_A']\n        |> Dict\\map(\n          $$,\n          $_val5 ==> $_val5\n            |> Dict\\map(\n              $$,\n              $_val4 ==> $_val4\n                |> A::__fromShape($$),\n            ) |> new Map($$),\n        ) |> new Map($$)),\n      Shapes::idx($shape, 'list_of_string') === null ? null : ($shape['list_of_string'] |> new Vector($$)),\n      Shapes::idx($shape, 'list_of_map_of_string_to_A') === null ? null : ($shape['list_of_map_of_string_to_A']\n        |> Vec\\map(\n          $$,\n          $_val7 ==> $_val7\n            |> Dict\\map(\n              $$,\n              $_val6 ==> $_val6\n                |> A::__fromShape($$),\n            ) |> new Map($$),\n        ) |> new Vector($$)),\n      Shapes::idx($shape, 'list_of_map_of_string_to_list_of_A') === null ? null : ($shape['list_of_map_of_string_to_list_of_A']\n        |> Vec\\map(\n          $$,\n          $_val10 ==> $_val10\n            |> Dict\\map(\n              $$,\n              $_val9 ==> $_val9\n                |> Vec\\map(\n                  $$,\n                  $_val8 ==> $_val8\n                    |> A::__fromShape($$),\n                ) |> new Vector($$),\n            ) |> new Map($$),\n        ) |> new Vector($$)),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'map_of_string_to_string' => $this->map_of_string_to_string\n        |> $$ === null ? null : dict($$),\n      'map_of_string_to_i32' => $this->map_of_string_to_i32\n        |> $$ === null ? null : dict($$),\n      'map_of_string_to_A' => $this->map_of_string_to_A?->map(\n        ($_val0) ==> $_val0->__toShape(),\n      )\n        |> $$ === null ? null : dict($$),\n      'map_of_string_to_list_of_A' => $this->map_of_string_to_list_of_A?->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> vec($$),\n      )\n        |> $$ === null ? null : dict($$),\n      'map_of_string_to_map_of_string_to_i32' => $this->map_of_string_to_map_of_string_to_i32?->map(\n        ($_val0) ==> dict($_val0),\n      )\n        |> $$ === null ? null : dict($$),\n      'map_of_string_to_map_of_string_to_A' => $this->map_of_string_to_map_of_string_to_A?->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> dict($$),\n      )\n        |> $$ === null ? null : dict($$),\n      'list_of_string' => $this->list_of_string\n        |> $$ === null ? null : vec($$),\n      'list_of_map_of_string_to_A' => $this->list_of_map_of_string_to_A?->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->__toShape(),\n        )\n          |> dict($$),\n      )\n        |> $$ === null ? null : vec($$),\n      'list_of_map_of_string_to_list_of_A' => $this->list_of_map_of_string_to_list_of_A?->map(\n        ($_val0) ==> $_val0->map(\n          ($_val1) ==> $_val1->map(\n            ($_val2) ==> $_val2->__toShape(),\n          )\n            |> vec($$),\n        )\n          |> dict($$),\n      )\n        |> $$ === null ? null : vec($$),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 1590}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift struct:-\n * InitialResponse\n */\nclass InitialResponse implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'content',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'content' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'content' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 921480878768501242;\n  /**\n   * Original thrift field:-\n   * 1: string content\n   */\n  public string $content;\n\n  public function __construct(?string $content = null)[] {\n    $this->content = $content ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'content'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'InitialResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.InitialResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"content\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * FinalResponse\n */\nclass FinalResponse implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'content',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'content' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'content' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 921480878768501242;\n  /**\n   * Original thrift field:-\n   * 1: string content\n   */\n  public string $content;\n\n  public function __construct(?string $content = null)[] {\n    $this->content = $content ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'content'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FinalResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.FinalResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"content\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * SinkPayload\n */\nclass SinkPayload implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'content',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'content' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'content' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 921480878768501242;\n  /**\n   * Original thrift field:-\n   * 1: string content\n   */\n  public string $content;\n\n  public function __construct(?string $content = null)[] {\n    $this->content = $content ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'content'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkPayload';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkPayload\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"content\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * CompatibleWithKeywordSink\n */\nclass CompatibleWithKeywordSink implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'sink',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'sink' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'sink' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 3905273354198769243;\n  /**\n   * Original thrift field:-\n   * 1: string sink\n   */\n  public string $sink;\n\n  public function __construct(?string $sink = null)[] {\n    $this->sink = $sink ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'sink'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'CompatibleWithKeywordSink';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.CompatibleWithKeywordSink\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"sink\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * InitialException\n */\nclass InitialException extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'reason' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'reason' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 3707764047816594739;\n  /**\n   * Original thrift field:-\n   * 1: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $reason = null)[] {\n    parent::__construct();\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'InitialException';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.InitialException\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * SinkException1\n */\nclass SinkException1 extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'reason' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'reason' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 3707764047816594739;\n  /**\n   * Original thrift field:-\n   * 1: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $reason = null)[] {\n    parent::__construct();\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkException1';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.SinkException1\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * SinkException2\n */\nclass SinkException2 extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'reason',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'reason' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'reason' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 989028245140918602;\n  /**\n   * Original thrift field:-\n   * 1: i64 reason\n   */\n  public int $reason;\n\n  public function __construct(?int $reason = null)[] {\n    parent::__construct();\n    $this->reason = $reason ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkException2';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.SinkException2\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 604}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * SinkService\n */\ninterface SinkServiceAsyncIf extends \\IThriftAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * SinkService\n */\ninterface SinkServiceIf extends \\IThriftSyncIf {\n}\n\n/**\n * Original thrift service:-\n * SinkService\n */\ninterface SinkServiceAsyncClientIf extends SinkServiceAsyncIf {\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, FinalResponse>\n   *   method();\n   */\n  public function method(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;\n\n  /**\n   * Original thrift definition:-\n   * InitialResponse, sink<SinkPayload, FinalResponse>\n   *   methodAndReponse();\n   */\n  public function methodAndReponse(): Awaitable<\\ResponseAndClientSink<InitialResponse, SinkPayload, FinalResponse>>;\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, FinalResponse>\n   *   methodThrow()\n   *   throws (1: InitialException ex);\n   */\n  public function methodThrow(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, throws (1: SinkException1 ex), FinalResponse>\n   *   methodSinkThrow();\n   */\n  public function methodSinkThrow(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, FinalResponse, throws (1: SinkException2 ex)>\n   *   methodFinalThrow();\n   */\n  public function methodFinalThrow(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, throws (1: SinkException1 ex), FinalResponse, throws (1: SinkException2 ex)>\n   *   methodBothThrow();\n   */\n  public function methodBothThrow(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, FinalResponse>\n   *   methodFast();\n   */\n  public function methodFast(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;\n}\n\n/**\n * Original thrift service:-\n * SinkService\n */\ninterface SinkServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, FinalResponse>\n   *   method();\n   */\n  public function method(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;\n\n  /**\n   * Original thrift definition:-\n   * InitialResponse, sink<SinkPayload, FinalResponse>\n   *   methodAndReponse();\n   */\n  public function methodAndReponse(): Awaitable<\\ResponseAndClientSink<InitialResponse, SinkPayload, FinalResponse>>;\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, FinalResponse>\n   *   methodThrow()\n   *   throws (1: InitialException ex);\n   */\n  public function methodThrow(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, throws (1: SinkException1 ex), FinalResponse>\n   *   methodSinkThrow();\n   */\n  public function methodSinkThrow(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, FinalResponse, throws (1: SinkException2 ex)>\n   *   methodFinalThrow();\n   */\n  public function methodFinalThrow(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, throws (1: SinkException1 ex), FinalResponse, throws (1: SinkException2 ex)>\n   *   methodBothThrow();\n   */\n  public function methodBothThrow(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, FinalResponse>\n   *   methodFast();\n   */\n  public function methodFast(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;\n}\n\n/**\n * Original thrift service:-\n * SinkService\n */\ntrait SinkServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass SinkServiceAsyncClient extends \\ThriftClientBase implements SinkServiceAsyncClientIf {\n  use SinkServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, FinalResponse>\n   *   method();\n   */\n  public async function method(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = SinkService_method_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"SinkService\", \"method\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"method\", false);\n    return await $this->genAwaitSinkResponse(SinkService_method_FirstResponse::class, SinkService_method_SinkPayload::class, SinkService_method_FinalResponse::class, \"method\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * InitialResponse, sink<SinkPayload, FinalResponse>\n   *   methodAndReponse();\n   */\n  public async function methodAndReponse(): Awaitable<\\ResponseAndClientSink<InitialResponse, SinkPayload, FinalResponse>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = SinkService_methodAndReponse_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"SinkService\", \"methodAndReponse\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"methodAndReponse\", false);\n    return await $this->genAwaitSinkResponse(SinkService_methodAndReponse_FirstResponse::class, SinkService_methodAndReponse_SinkPayload::class, SinkService_methodAndReponse_FinalResponse::class, \"methodAndReponse\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, FinalResponse>\n   *   methodThrow()\n   *   throws (1: InitialException ex);\n   */\n  public async function methodThrow(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = SinkService_methodThrow_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"SinkService\", \"methodThrow\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"methodThrow\", false);\n    return await $this->genAwaitSinkResponse(SinkService_methodThrow_FirstResponse::class, SinkService_methodThrow_SinkPayload::class, SinkService_methodThrow_FinalResponse::class, \"methodThrow\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, throws (1: SinkException1 ex), FinalResponse>\n   *   methodSinkThrow();\n   */\n  public async function methodSinkThrow(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = SinkService_methodSinkThrow_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"SinkService\", \"methodSinkThrow\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"methodSinkThrow\", false);\n    return await $this->genAwaitSinkResponse(SinkService_methodSinkThrow_FirstResponse::class, SinkService_methodSinkThrow_SinkPayload::class, SinkService_methodSinkThrow_FinalResponse::class, \"methodSinkThrow\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, FinalResponse, throws (1: SinkException2 ex)>\n   *   methodFinalThrow();\n   */\n  public async function methodFinalThrow(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = SinkService_methodFinalThrow_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"SinkService\", \"methodFinalThrow\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"methodFinalThrow\", false);\n    return await $this->genAwaitSinkResponse(SinkService_methodFinalThrow_FirstResponse::class, SinkService_methodFinalThrow_SinkPayload::class, SinkService_methodFinalThrow_FinalResponse::class, \"methodFinalThrow\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, throws (1: SinkException1 ex), FinalResponse, throws (1: SinkException2 ex)>\n   *   methodBothThrow();\n   */\n  public async function methodBothThrow(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = SinkService_methodBothThrow_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"SinkService\", \"methodBothThrow\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"methodBothThrow\", false);\n    return await $this->genAwaitSinkResponse(SinkService_methodBothThrow_FirstResponse::class, SinkService_methodBothThrow_SinkPayload::class, SinkService_methodBothThrow_FinalResponse::class, \"methodBothThrow\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, FinalResponse>\n   *   methodFast();\n   */\n  public async function methodFast(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = SinkService_methodFast_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"SinkService\", \"methodFast\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"methodFast\", false);\n    return await $this->genAwaitSinkResponse(SinkService_methodFast_FirstResponse::class, SinkService_methodFast_SinkPayload::class, SinkService_methodFast_FinalResponse::class, \"methodFast\", true, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass SinkServiceClient extends \\ThriftClientBase implements SinkServiceClientIf {\n  use SinkServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, FinalResponse>\n   *   method();\n   */\n  public async function method(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = SinkService_method_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"SinkService\", \"method\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"method\", false);\n    return await $this->genAwaitSinkResponse(SinkService_method_FirstResponse::class, SinkService_method_SinkPayload::class, SinkService_method_FinalResponse::class, \"method\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * InitialResponse, sink<SinkPayload, FinalResponse>\n   *   methodAndReponse();\n   */\n  public async function methodAndReponse(): Awaitable<\\ResponseAndClientSink<InitialResponse, SinkPayload, FinalResponse>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = SinkService_methodAndReponse_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"SinkService\", \"methodAndReponse\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"methodAndReponse\", false);\n    return await $this->genAwaitSinkResponse(SinkService_methodAndReponse_FirstResponse::class, SinkService_methodAndReponse_SinkPayload::class, SinkService_methodAndReponse_FinalResponse::class, \"methodAndReponse\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, FinalResponse>\n   *   methodThrow()\n   *   throws (1: InitialException ex);\n   */\n  public async function methodThrow(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = SinkService_methodThrow_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"SinkService\", \"methodThrow\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"methodThrow\", false);\n    return await $this->genAwaitSinkResponse(SinkService_methodThrow_FirstResponse::class, SinkService_methodThrow_SinkPayload::class, SinkService_methodThrow_FinalResponse::class, \"methodThrow\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, throws (1: SinkException1 ex), FinalResponse>\n   *   methodSinkThrow();\n   */\n  public async function methodSinkThrow(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = SinkService_methodSinkThrow_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"SinkService\", \"methodSinkThrow\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"methodSinkThrow\", false);\n    return await $this->genAwaitSinkResponse(SinkService_methodSinkThrow_FirstResponse::class, SinkService_methodSinkThrow_SinkPayload::class, SinkService_methodSinkThrow_FinalResponse::class, \"methodSinkThrow\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, FinalResponse, throws (1: SinkException2 ex)>\n   *   methodFinalThrow();\n   */\n  public async function methodFinalThrow(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = SinkService_methodFinalThrow_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"SinkService\", \"methodFinalThrow\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"methodFinalThrow\", false);\n    return await $this->genAwaitSinkResponse(SinkService_methodFinalThrow_FirstResponse::class, SinkService_methodFinalThrow_SinkPayload::class, SinkService_methodFinalThrow_FinalResponse::class, \"methodFinalThrow\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, throws (1: SinkException1 ex), FinalResponse, throws (1: SinkException2 ex)>\n   *   methodBothThrow();\n   */\n  public async function methodBothThrow(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = SinkService_methodBothThrow_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"SinkService\", \"methodBothThrow\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"methodBothThrow\", false);\n    return await $this->genAwaitSinkResponse(SinkService_methodBothThrow_FirstResponse::class, SinkService_methodBothThrow_SinkPayload::class, SinkService_methodBothThrow_FinalResponse::class, \"methodBothThrow\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, sink<SinkPayload, FinalResponse>\n   *   methodFast();\n   */\n  public async function methodFast(): Awaitable<\\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = SinkService_methodFast_args::withDefaultValues();\n    await $this->asyncHandler_->genBefore(\"SinkService\", \"methodFast\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"methodFast\", false);\n    return await $this->genAwaitSinkResponse(SinkService_methodFast_FirstResponse::class, SinkService_methodFast_SinkPayload::class, SinkService_methodFast_FinalResponse::class, \"methodFast\", true, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass SinkService_method_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_method_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.method_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_method_FirstResponse extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_method_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_method_FirstResponse\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_method_SinkPayload extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = SinkPayload;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => SinkPayload::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 5047864711357047518;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_method_SinkPayload';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_method_SinkPayload\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.SinkPayload\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_method_FinalResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = FinalResponse;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => FinalResponse::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 7640464975912492398;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_method_FinalResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_method_FinalResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FinalResponse\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodAndReponse_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodAndReponse_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.methodAndReponse_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodAndReponse_FirstResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = InitialResponse;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => InitialResponse::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 1156060868779247352;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodAndReponse_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodAndReponse_FirstResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.InitialResponse\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodAndReponse_SinkPayload extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = SinkPayload;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => SinkPayload::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 5047864711357047518;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodAndReponse_SinkPayload';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodAndReponse_SinkPayload\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.SinkPayload\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodAndReponse_FinalResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = FinalResponse;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => FinalResponse::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 7640464975912492398;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodAndReponse_FinalResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodAndReponse_FinalResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FinalResponse\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodThrow_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodThrow_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.methodThrow_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodThrow_FirstResponse extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ex',\n      'type' => \\TType::STRUCT,\n      'class' => InitialException::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ex' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ex' => ?InitialException,\n  );\n\n  const int STRUCTURAL_ID = 5881917388606205109;\n  public ?InitialException $ex;\n\n  public function __construct(?InitialException $ex = null)[] {\n    $this->ex = $ex;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ex'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodThrow_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodThrow_FirstResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.InitialException\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ex\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->ex !== null) {\n      return $this->ex;\n    }\n    return null;\n  }\n}\n\nclass SinkService_methodThrow_SinkPayload extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = SinkPayload;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => SinkPayload::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 5047864711357047518;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodThrow_SinkPayload';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodThrow_SinkPayload\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.SinkPayload\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodThrow_FinalResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = FinalResponse;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => FinalResponse::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 7640464975912492398;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodThrow_FinalResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodThrow_FinalResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FinalResponse\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodSinkThrow_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodSinkThrow_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.methodSinkThrow_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodSinkThrow_FirstResponse extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodSinkThrow_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodSinkThrow_FirstResponse\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodSinkThrow_SinkPayload extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = SinkPayload;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => SinkPayload::class,\n    ),\n    1 => shape(\n      'var' => 'ex',\n      'type' => \\TType::STRUCT,\n      'class' => SinkException1::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n    'ex' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n    ?'ex' => ?SinkException1,\n  );\n\n  const int STRUCTURAL_ID = 8919728181176611439;\n  public ?this::TResult $success;\n  public ?SinkException1 $ex;\n\n  public function __construct(?this::TResult $success = null, ?SinkException1 $ex = null)[] {\n    $this->success = $success;\n    $this->ex = $ex;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n      Shapes::idx($shape, 'ex'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodSinkThrow_SinkPayload';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodSinkThrow_SinkPayload\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.SinkPayload\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.SinkException1\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ex\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->ex !== null) {\n      return $this->ex;\n    }\n    return null;\n  }\n}\n\nclass SinkService_methodSinkThrow_FinalResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = FinalResponse;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => FinalResponse::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 7640464975912492398;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodSinkThrow_FinalResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodSinkThrow_FinalResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FinalResponse\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodFinalThrow_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodFinalThrow_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.methodFinalThrow_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodFinalThrow_FirstResponse extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodFinalThrow_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodFinalThrow_FirstResponse\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodFinalThrow_SinkPayload extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = SinkPayload;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => SinkPayload::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 5047864711357047518;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodFinalThrow_SinkPayload';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodFinalThrow_SinkPayload\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.SinkPayload\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodFinalThrow_FinalResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = FinalResponse;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => FinalResponse::class,\n    ),\n    1 => shape(\n      'var' => 'ex',\n      'type' => \\TType::STRUCT,\n      'class' => SinkException2::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n    'ex' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n    ?'ex' => ?SinkException2,\n  );\n\n  const int STRUCTURAL_ID = 1352924921392902231;\n  public ?this::TResult $success;\n  public ?SinkException2 $ex;\n\n  public function __construct(?this::TResult $success = null, ?SinkException2 $ex = null)[] {\n    $this->success = $success;\n    $this->ex = $ex;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n      Shapes::idx($shape, 'ex'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodFinalThrow_FinalResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodFinalThrow_FinalResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FinalResponse\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.SinkException2\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ex\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->ex !== null) {\n      return $this->ex;\n    }\n    return null;\n  }\n}\n\nclass SinkService_methodBothThrow_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodBothThrow_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.methodBothThrow_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodBothThrow_FirstResponse extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodBothThrow_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodBothThrow_FirstResponse\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodBothThrow_SinkPayload extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = SinkPayload;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => SinkPayload::class,\n    ),\n    1 => shape(\n      'var' => 'ex',\n      'type' => \\TType::STRUCT,\n      'class' => SinkException1::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n    'ex' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n    ?'ex' => ?SinkException1,\n  );\n\n  const int STRUCTURAL_ID = 8919728181176611439;\n  public ?this::TResult $success;\n  public ?SinkException1 $ex;\n\n  public function __construct(?this::TResult $success = null, ?SinkException1 $ex = null)[] {\n    $this->success = $success;\n    $this->ex = $ex;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n      Shapes::idx($shape, 'ex'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodBothThrow_SinkPayload';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodBothThrow_SinkPayload\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.SinkPayload\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.SinkException1\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ex\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->ex !== null) {\n      return $this->ex;\n    }\n    return null;\n  }\n}\n\nclass SinkService_methodBothThrow_FinalResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = FinalResponse;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => FinalResponse::class,\n    ),\n    1 => shape(\n      'var' => 'ex',\n      'type' => \\TType::STRUCT,\n      'class' => SinkException2::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n    'ex' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n    ?'ex' => ?SinkException2,\n  );\n\n  const int STRUCTURAL_ID = 1352924921392902231;\n  public ?this::TResult $success;\n  public ?SinkException2 $ex;\n\n  public function __construct(?this::TResult $success = null, ?SinkException2 $ex = null)[] {\n    $this->success = $success;\n    $this->ex = $ex;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n      Shapes::idx($shape, 'ex'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodBothThrow_FinalResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodBothThrow_FinalResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FinalResponse\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.SinkException2\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ex\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->ex !== null) {\n      return $this->ex;\n    }\n    return null;\n  }\n}\n\nclass SinkService_methodFast_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodFast_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.methodFast_args\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodFast_FirstResponse extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodFast_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodFast_FirstResponse\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodFast_SinkPayload extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = SinkPayload;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => SinkPayload::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 5047864711357047518;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodFast_SinkPayload';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodFast_SinkPayload\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.SinkPayload\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkService_methodFast_FinalResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = FinalResponse;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::STRUCT,\n      'class' => FinalResponse::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 7640464975912492398;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SinkService_methodFast_FinalResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SinkService_methodFast_FinalResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FinalResponse\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass SinkServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.SinkService\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"method\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_sink\" => tmeta_ThriftSinkType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.SinkPayload\",\n                            )\n                          ),\n                        )\n                      ),\n                      \"finalResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.FinalResponse\",\n                            )\n                          ),\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"methodAndReponse\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_sink\" => tmeta_ThriftSinkType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.SinkPayload\",\n                            )\n                          ),\n                        )\n                      ),\n                      \"finalResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.FinalResponse\",\n                            )\n                          ),\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.InitialResponse\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"methodThrow\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_sink\" => tmeta_ThriftSinkType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.SinkPayload\",\n                            )\n                          ),\n                        )\n                      ),\n                      \"finalResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.FinalResponse\",\n                            )\n                          ),\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"exceptions\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.InitialException\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"ex\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"methodSinkThrow\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_sink\" => tmeta_ThriftSinkType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.SinkPayload\",\n                            )\n                          ),\n                        )\n                      ),\n                      \"finalResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.FinalResponse\",\n                            )\n                          ),\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"methodFinalThrow\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_sink\" => tmeta_ThriftSinkType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.SinkPayload\",\n                            )\n                          ),\n                        )\n                      ),\n                      \"finalResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.FinalResponse\",\n                            )\n                          ),\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"methodBothThrow\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_sink\" => tmeta_ThriftSinkType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.SinkPayload\",\n                            )\n                          ),\n                        )\n                      ),\n                      \"finalResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.FinalResponse\",\n                            )\n                          ),\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"methodFast\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_sink\" => tmeta_ThriftSinkType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.SinkPayload\",\n                            )\n                          ),\n                        )\n                      ),\n                      \"finalResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.FinalResponse\",\n                            )\n                          ),\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n              'module.SinkPayload' => SinkPayload::getStructMetadata(),\n              'module.FinalResponse' => FinalResponse::getStructMetadata(),\n              'module.InitialResponse' => InitialResponse::getStructMetadata(),\n            ],\n            'exceptions' => dict[\n              'module.InitialException' => InitialException::getExceptionMetadata(),\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 2855}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift struct:-\n * Foo\n */\nclass Foo implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?int,\n    ?'b' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 5526046231048010857;\n  /**\n   * Original thrift field:-\n   * 1: i64 a\n   */\n  public int $a;\n  /**\n   * Original thrift field:-\n   * 2: string b\n   */\n  public string $b;\n\n  public function __construct(?int $a = null, ?string $b = null)[] {\n    $this->a = $a ?? 0;\n    $this->b = $b ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n    );\n  }\n\n  public static function fromMap_DEPRECATED(<<__Soft>> KeyedContainer<string, mixed> $map)[]: this {\n    return new static(\n      HH\\FIXME\\UNSAFE_CAST<mixed, int>(idx($map, 'a'), 'map value is mixed'),\n      HH\\FIXME\\UNSAFE_CAST<mixed, string>(idx($map, 'b'), 'map value is mixed'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Foo';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Foo\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 125}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift exception:-\n * FooStreamEx\n */\nclass FooStreamEx extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n    parent::__construct();\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FooStreamEx';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.FooStreamEx\",\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * FooEx\n */\nclass FooEx extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n    parent::__construct();\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FooEx';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.FooEx\",\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * FooEx2\n */\nclass FooEx2 extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n    parent::__construct();\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FooEx2';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"module.FooEx2\",\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\n", "num_lines": 186}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\n/**\n * Original thrift service:-\n * PubSubStreamingService\n */\ninterface PubSubStreamingServiceAsyncIf extends \\IThriftAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * PubSubStreamingService\n */\ninterface PubSubStreamingServiceIf extends \\IThriftSyncIf {\n}\n\n/**\n * Original thrift service:-\n * PubSubStreamingService\n */\ninterface PubSubStreamingServiceAsyncClientIf extends PubSubStreamingServiceAsyncIf {\n  /**\n   * Original thrift definition:-\n   * void, stream<i32>\n   *   returnstream(1: i32 i32_from,\n   *                2: i32 i32_to);\n   */\n  public function returnstream(int $i32_from, int $i32_to): Awaitable<\\ResponseAndClientStream<null, int>>;\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32, throws (1: FooStreamEx e)>\n   *   streamthrows(1: i32 foo);\n   */\n  public function streamthrows(int $foo): Awaitable<\\ResponseAndClientStream<null, int>>;\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32>\n   *   servicethrows(1: i32 foo)\n   *   throws (1: FooEx e);\n   */\n  public function servicethrows(int $foo): Awaitable<\\ResponseAndClientStream<null, int>>;\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32>\n   *   servicethrows2(1: i32 foo)\n   *   throws (1: FooEx e1,\n   *           2: FooEx2 e2);\n   */\n  public function servicethrows2(int $foo): Awaitable<\\ResponseAndClientStream<null, int>>;\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32, throws (1: FooStreamEx e)>\n   *   boththrows(1: i32 foo)\n   *   throws (1: FooEx e);\n   */\n  public function boththrows(int $foo): Awaitable<\\ResponseAndClientStream<null, int>>;\n\n  /**\n   * Original thrift definition:-\n   * i32, stream<i32, throws (1: FooStreamEx e)>\n   *   responseandstreamstreamthrows(1: i32 foo);\n   */\n  public function responseandstreamstreamthrows(int $foo): Awaitable<\\ResponseAndClientStream<int, int>>;\n\n  /**\n   * Original thrift definition:-\n   * i32, stream<i32>\n   *   responseandstreamservicethrows(1: i32 foo)\n   *   throws (1: FooEx e);\n   */\n  public function responseandstreamservicethrows(int $foo): Awaitable<\\ResponseAndClientStream<int, int>>;\n\n  /**\n   * Original thrift definition:-\n   * i32, stream<i32, throws (1: FooStreamEx e)>\n   *   responseandstreamboththrows(1: i32 foo)\n   *   throws (1: FooEx e);\n   */\n  public function responseandstreamboththrows(int $foo): Awaitable<\\ResponseAndClientStream<int, int>>;\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32>\n   *   returnstreamFast(1: i32 i32_from,\n   *                    2: i32 i32_to);\n   */\n  public function returnstreamFast(int $i32_from, int $i32_to): Awaitable<\\ResponseAndClientStream<null, int>>;\n}\n\n/**\n * Original thrift service:-\n * PubSubStreamingService\n */\ninterface PubSubStreamingServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * void, stream<i32>\n   *   returnstream(1: i32 i32_from,\n   *                2: i32 i32_to);\n   */\n  public function returnstream(int $i32_from, int $i32_to): Awaitable<\\ResponseAndClientStream<null, int>>;\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32, throws (1: FooStreamEx e)>\n   *   streamthrows(1: i32 foo);\n   */\n  public function streamthrows(int $foo): Awaitable<\\ResponseAndClientStream<null, int>>;\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32>\n   *   servicethrows(1: i32 foo)\n   *   throws (1: FooEx e);\n   */\n  public function servicethrows(int $foo): Awaitable<\\ResponseAndClientStream<null, int>>;\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32>\n   *   servicethrows2(1: i32 foo)\n   *   throws (1: FooEx e1,\n   *           2: FooEx2 e2);\n   */\n  public function servicethrows2(int $foo): Awaitable<\\ResponseAndClientStream<null, int>>;\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32, throws (1: FooStreamEx e)>\n   *   boththrows(1: i32 foo)\n   *   throws (1: FooEx e);\n   */\n  public function boththrows(int $foo): Awaitable<\\ResponseAndClientStream<null, int>>;\n\n  /**\n   * Original thrift definition:-\n   * i32, stream<i32, throws (1: FooStreamEx e)>\n   *   responseandstreamstreamthrows(1: i32 foo);\n   */\n  public function responseandstreamstreamthrows(int $foo): Awaitable<\\ResponseAndClientStream<int, int>>;\n\n  /**\n   * Original thrift definition:-\n   * i32, stream<i32>\n   *   responseandstreamservicethrows(1: i32 foo)\n   *   throws (1: FooEx e);\n   */\n  public function responseandstreamservicethrows(int $foo): Awaitable<\\ResponseAndClientStream<int, int>>;\n\n  /**\n   * Original thrift definition:-\n   * i32, stream<i32, throws (1: FooStreamEx e)>\n   *   responseandstreamboththrows(1: i32 foo)\n   *   throws (1: FooEx e);\n   */\n  public function responseandstreamboththrows(int $foo): Awaitable<\\ResponseAndClientStream<int, int>>;\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32>\n   *   returnstreamFast(1: i32 i32_from,\n   *                    2: i32 i32_to);\n   */\n  public function returnstreamFast(int $i32_from, int $i32_to): Awaitable<\\ResponseAndClientStream<null, int>>;\n}\n\n/**\n * Original thrift service:-\n * PubSubStreamingService\n */\ntrait PubSubStreamingServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass PubSubStreamingServiceAsyncClient extends \\ThriftClientBase implements PubSubStreamingServiceAsyncClientIf {\n  use PubSubStreamingServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32>\n   *   returnstream(1: i32 i32_from,\n   *                2: i32 i32_to);\n   */\n  public async function returnstream(int $i32_from, int $i32_to): Awaitable<\\ResponseAndClientStream<null, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_returnstream_args::fromShape(shape(\n      'i32_from' => $i32_from,\n      'i32_to' => $i32_to,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"returnstream\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"returnstream\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_returnstream_FirstResponse::class, PubSubStreamingService_returnstream_StreamResponse::class, \"returnstream\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32, throws (1: FooStreamEx e)>\n   *   streamthrows(1: i32 foo);\n   */\n  public async function streamthrows(int $foo): Awaitable<\\ResponseAndClientStream<null, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_streamthrows_args::fromShape(shape(\n      'foo' => $foo,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"streamthrows\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"streamthrows\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_streamthrows_FirstResponse::class, PubSubStreamingService_streamthrows_StreamResponse::class, \"streamthrows\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32>\n   *   servicethrows(1: i32 foo)\n   *   throws (1: FooEx e);\n   */\n  public async function servicethrows(int $foo): Awaitable<\\ResponseAndClientStream<null, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_servicethrows_args::fromShape(shape(\n      'foo' => $foo,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"servicethrows\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"servicethrows\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_servicethrows_FirstResponse::class, PubSubStreamingService_servicethrows_StreamResponse::class, \"servicethrows\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32>\n   *   servicethrows2(1: i32 foo)\n   *   throws (1: FooEx e1,\n   *           2: FooEx2 e2);\n   */\n  public async function servicethrows2(int $foo): Awaitable<\\ResponseAndClientStream<null, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_servicethrows2_args::fromShape(shape(\n      'foo' => $foo,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"servicethrows2\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"servicethrows2\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_servicethrows2_FirstResponse::class, PubSubStreamingService_servicethrows2_StreamResponse::class, \"servicethrows2\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32, throws (1: FooStreamEx e)>\n   *   boththrows(1: i32 foo)\n   *   throws (1: FooEx e);\n   */\n  public async function boththrows(int $foo): Awaitable<\\ResponseAndClientStream<null, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_boththrows_args::fromShape(shape(\n      'foo' => $foo,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"boththrows\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"boththrows\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_boththrows_FirstResponse::class, PubSubStreamingService_boththrows_StreamResponse::class, \"boththrows\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * i32, stream<i32, throws (1: FooStreamEx e)>\n   *   responseandstreamstreamthrows(1: i32 foo);\n   */\n  public async function responseandstreamstreamthrows(int $foo): Awaitable<\\ResponseAndClientStream<int, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_responseandstreamstreamthrows_args::fromShape(shape(\n      'foo' => $foo,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"responseandstreamstreamthrows\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"responseandstreamstreamthrows\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_responseandstreamstreamthrows_FirstResponse::class, PubSubStreamingService_responseandstreamstreamthrows_StreamResponse::class, \"responseandstreamstreamthrows\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * i32, stream<i32>\n   *   responseandstreamservicethrows(1: i32 foo)\n   *   throws (1: FooEx e);\n   */\n  public async function responseandstreamservicethrows(int $foo): Awaitable<\\ResponseAndClientStream<int, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_responseandstreamservicethrows_args::fromShape(shape(\n      'foo' => $foo,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"responseandstreamservicethrows\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"responseandstreamservicethrows\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_responseandstreamservicethrows_FirstResponse::class, PubSubStreamingService_responseandstreamservicethrows_StreamResponse::class, \"responseandstreamservicethrows\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * i32, stream<i32, throws (1: FooStreamEx e)>\n   *   responseandstreamboththrows(1: i32 foo)\n   *   throws (1: FooEx e);\n   */\n  public async function responseandstreamboththrows(int $foo): Awaitable<\\ResponseAndClientStream<int, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_responseandstreamboththrows_args::fromShape(shape(\n      'foo' => $foo,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"responseandstreamboththrows\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"responseandstreamboththrows\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_responseandstreamboththrows_FirstResponse::class, PubSubStreamingService_responseandstreamboththrows_StreamResponse::class, \"responseandstreamboththrows\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32>\n   *   returnstreamFast(1: i32 i32_from,\n   *                    2: i32 i32_to);\n   */\n  public async function returnstreamFast(int $i32_from, int $i32_to): Awaitable<\\ResponseAndClientStream<null, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_returnstreamFast_args::fromShape(shape(\n      'i32_from' => $i32_from,\n      'i32_to' => $i32_to,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"returnstreamFast\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"returnstreamFast\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_returnstreamFast_FirstResponse::class, PubSubStreamingService_returnstreamFast_StreamResponse::class, \"returnstreamFast\", true, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass PubSubStreamingServiceClient extends \\ThriftClientBase implements PubSubStreamingServiceClientIf {\n  use PubSubStreamingServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32>\n   *   returnstream(1: i32 i32_from,\n   *                2: i32 i32_to);\n   */\n  public async function returnstream(int $i32_from, int $i32_to): Awaitable<\\ResponseAndClientStream<null, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_returnstream_args::fromShape(shape(\n      'i32_from' => $i32_from,\n      'i32_to' => $i32_to,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"returnstream\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"returnstream\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_returnstream_FirstResponse::class, PubSubStreamingService_returnstream_StreamResponse::class, \"returnstream\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32, throws (1: FooStreamEx e)>\n   *   streamthrows(1: i32 foo);\n   */\n  public async function streamthrows(int $foo): Awaitable<\\ResponseAndClientStream<null, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_streamthrows_args::fromShape(shape(\n      'foo' => $foo,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"streamthrows\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"streamthrows\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_streamthrows_FirstResponse::class, PubSubStreamingService_streamthrows_StreamResponse::class, \"streamthrows\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32>\n   *   servicethrows(1: i32 foo)\n   *   throws (1: FooEx e);\n   */\n  public async function servicethrows(int $foo): Awaitable<\\ResponseAndClientStream<null, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_servicethrows_args::fromShape(shape(\n      'foo' => $foo,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"servicethrows\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"servicethrows\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_servicethrows_FirstResponse::class, PubSubStreamingService_servicethrows_StreamResponse::class, \"servicethrows\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32>\n   *   servicethrows2(1: i32 foo)\n   *   throws (1: FooEx e1,\n   *           2: FooEx2 e2);\n   */\n  public async function servicethrows2(int $foo): Awaitable<\\ResponseAndClientStream<null, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_servicethrows2_args::fromShape(shape(\n      'foo' => $foo,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"servicethrows2\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"servicethrows2\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_servicethrows2_FirstResponse::class, PubSubStreamingService_servicethrows2_StreamResponse::class, \"servicethrows2\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32, throws (1: FooStreamEx e)>\n   *   boththrows(1: i32 foo)\n   *   throws (1: FooEx e);\n   */\n  public async function boththrows(int $foo): Awaitable<\\ResponseAndClientStream<null, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_boththrows_args::fromShape(shape(\n      'foo' => $foo,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"boththrows\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"boththrows\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_boththrows_FirstResponse::class, PubSubStreamingService_boththrows_StreamResponse::class, \"boththrows\", true, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * i32, stream<i32, throws (1: FooStreamEx e)>\n   *   responseandstreamstreamthrows(1: i32 foo);\n   */\n  public async function responseandstreamstreamthrows(int $foo): Awaitable<\\ResponseAndClientStream<int, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_responseandstreamstreamthrows_args::fromShape(shape(\n      'foo' => $foo,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"responseandstreamstreamthrows\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"responseandstreamstreamthrows\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_responseandstreamstreamthrows_FirstResponse::class, PubSubStreamingService_responseandstreamstreamthrows_StreamResponse::class, \"responseandstreamstreamthrows\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * i32, stream<i32>\n   *   responseandstreamservicethrows(1: i32 foo)\n   *   throws (1: FooEx e);\n   */\n  public async function responseandstreamservicethrows(int $foo): Awaitable<\\ResponseAndClientStream<int, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_responseandstreamservicethrows_args::fromShape(shape(\n      'foo' => $foo,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"responseandstreamservicethrows\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"responseandstreamservicethrows\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_responseandstreamservicethrows_FirstResponse::class, PubSubStreamingService_responseandstreamservicethrows_StreamResponse::class, \"responseandstreamservicethrows\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * i32, stream<i32, throws (1: FooStreamEx e)>\n   *   responseandstreamboththrows(1: i32 foo)\n   *   throws (1: FooEx e);\n   */\n  public async function responseandstreamboththrows(int $foo): Awaitable<\\ResponseAndClientStream<int, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_responseandstreamboththrows_args::fromShape(shape(\n      'foo' => $foo,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"responseandstreamboththrows\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"responseandstreamboththrows\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_responseandstreamboththrows_FirstResponse::class, PubSubStreamingService_responseandstreamboththrows_StreamResponse::class, \"responseandstreamboththrows\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * void, stream<i32>\n   *   returnstreamFast(1: i32 i32_from,\n   *                    2: i32 i32_to);\n   */\n  public async function returnstreamFast(int $i32_from, int $i32_to): Awaitable<\\ResponseAndClientStream<null, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = PubSubStreamingService_returnstreamFast_args::fromShape(shape(\n      'i32_from' => $i32_from,\n      'i32_to' => $i32_to,\n    ));\n    await $this->asyncHandler_->genBefore(\"PubSubStreamingService\", \"returnstreamFast\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"returnstreamFast\", false);\n    return await $this->genAwaitStreamResponse(PubSubStreamingService_returnstreamFast_FirstResponse::class, PubSubStreamingService_returnstreamFast_StreamResponse::class, \"returnstreamFast\", true, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass PubSubStreamingService_returnstream_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'i32_from',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'i32_to',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'i32_from' => 1,\n    'i32_to' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'i32_from' => ?int,\n    ?'i32_to' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 6851224626875989960;\n  public int $i32_from;\n  public int $i32_to;\n\n  public function __construct(?int $i32_from = null, ?int $i32_to = null)[] {\n    $this->i32_from = $i32_from ?? 0;\n    $this->i32_to = $i32_to ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'i32_from'),\n      Shapes::idx($shape, 'i32_to'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_returnstream_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.returnstream_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i32_from\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i32_to\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_returnstream_StreamResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 3865318819874171525;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_returnstream_StreamResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_returnstream_StreamResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_returnstream_FirstResponse extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_returnstream_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_returnstream_FirstResponse\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_streamthrows_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 4302560019326481254;\n  public int $foo;\n\n  public function __construct(?int $foo = null)[] {\n    $this->foo = $foo ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_streamthrows_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.streamthrows_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_streamthrows_StreamResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n    1 => shape(\n      'var' => 'e',\n      'type' => \\TType::STRUCT,\n      'class' => FooStreamEx::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n    'e' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n    ?'e' => ?FooStreamEx,\n  );\n\n  const int STRUCTURAL_ID = 7900894693871902695;\n  public ?this::TResult $success;\n  public ?FooStreamEx $e;\n\n  public function __construct(?this::TResult $success = null, ?FooStreamEx $e = null)[] {\n    $this->success = $success;\n    $this->e = $e;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n      Shapes::idx($shape, 'e'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_streamthrows_StreamResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_streamthrows_StreamResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FooStreamEx\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"e\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->e !== null) {\n      return $this->e;\n    }\n    return null;\n  }\n}\n\nclass PubSubStreamingService_streamthrows_FirstResponse extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_streamthrows_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_streamthrows_FirstResponse\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_servicethrows_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 4302560019326481254;\n  public int $foo;\n\n  public function __construct(?int $foo = null)[] {\n    $this->foo = $foo ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_servicethrows_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.servicethrows_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_servicethrows_StreamResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 3865318819874171525;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_servicethrows_StreamResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_servicethrows_StreamResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_servicethrows_FirstResponse extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'e',\n      'type' => \\TType::STRUCT,\n      'class' => FooEx::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'e' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'e' => ?FooEx,\n  );\n\n  const int STRUCTURAL_ID = 1166333131961181261;\n  public ?FooEx $e;\n\n  public function __construct(?FooEx $e = null)[] {\n    $this->e = $e;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'e'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_servicethrows_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_servicethrows_FirstResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FooEx\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"e\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->e !== null) {\n      return $this->e;\n    }\n    return null;\n  }\n}\n\nclass PubSubStreamingService_servicethrows2_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 4302560019326481254;\n  public int $foo;\n\n  public function __construct(?int $foo = null)[] {\n    $this->foo = $foo ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_servicethrows2_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.servicethrows2_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_servicethrows2_StreamResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 3865318819874171525;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_servicethrows2_StreamResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_servicethrows2_StreamResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_servicethrows2_FirstResponse extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'e1',\n      'type' => \\TType::STRUCT,\n      'class' => FooEx::class,\n    ),\n    2 => shape(\n      'var' => 'e2',\n      'type' => \\TType::STRUCT,\n      'class' => FooEx2::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'e1' => 1,\n    'e2' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'e1' => ?FooEx,\n    ?'e2' => ?FooEx2,\n  );\n\n  const int STRUCTURAL_ID = 5404057405652507927;\n  public ?FooEx $e1;\n  public ?FooEx2 $e2;\n\n  public function __construct(?FooEx $e1 = null, ?FooEx2 $e2 = null)[] {\n    $this->e1 = $e1;\n    $this->e2 = $e2;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'e1'),\n      Shapes::idx($shape, 'e2'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_servicethrows2_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_servicethrows2_FirstResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FooEx\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"e1\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FooEx2\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"e2\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->e1 !== null) {\n      return $this->e1;\n    }\n    if ($this->e2 !== null) {\n      return $this->e2;\n    }\n    return null;\n  }\n}\n\nclass PubSubStreamingService_boththrows_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 4302560019326481254;\n  public int $foo;\n\n  public function __construct(?int $foo = null)[] {\n    $this->foo = $foo ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_boththrows_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.boththrows_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_boththrows_StreamResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n    1 => shape(\n      'var' => 'e',\n      'type' => \\TType::STRUCT,\n      'class' => FooStreamEx::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n    'e' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n    ?'e' => ?FooStreamEx,\n  );\n\n  const int STRUCTURAL_ID = 7900894693871902695;\n  public ?this::TResult $success;\n  public ?FooStreamEx $e;\n\n  public function __construct(?this::TResult $success = null, ?FooStreamEx $e = null)[] {\n    $this->success = $success;\n    $this->e = $e;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n      Shapes::idx($shape, 'e'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_boththrows_StreamResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_boththrows_StreamResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FooStreamEx\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"e\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->e !== null) {\n      return $this->e;\n    }\n    return null;\n  }\n}\n\nclass PubSubStreamingService_boththrows_FirstResponse extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'e',\n      'type' => \\TType::STRUCT,\n      'class' => FooEx::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'e' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'e' => ?FooEx,\n  );\n\n  const int STRUCTURAL_ID = 1166333131961181261;\n  public ?FooEx $e;\n\n  public function __construct(?FooEx $e = null)[] {\n    $this->e = $e;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'e'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_boththrows_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_boththrows_FirstResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FooEx\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"e\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->e !== null) {\n      return $this->e;\n    }\n    return null;\n  }\n}\n\nclass PubSubStreamingService_responseandstreamstreamthrows_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 4302560019326481254;\n  public int $foo;\n\n  public function __construct(?int $foo = null)[] {\n    $this->foo = $foo ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_responseandstreamstreamthrows_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.responseandstreamstreamthrows_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_responseandstreamstreamthrows_StreamResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n    1 => shape(\n      'var' => 'e',\n      'type' => \\TType::STRUCT,\n      'class' => FooStreamEx::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n    'e' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n    ?'e' => ?FooStreamEx,\n  );\n\n  const int STRUCTURAL_ID = 7900894693871902695;\n  public ?this::TResult $success;\n  public ?FooStreamEx $e;\n\n  public function __construct(?this::TResult $success = null, ?FooStreamEx $e = null)[] {\n    $this->success = $success;\n    $this->e = $e;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n      Shapes::idx($shape, 'e'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_responseandstreamstreamthrows_StreamResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_responseandstreamstreamthrows_StreamResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FooStreamEx\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"e\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->e !== null) {\n      return $this->e;\n    }\n    return null;\n  }\n}\n\nclass PubSubStreamingService_responseandstreamstreamthrows_FirstResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 3865318819874171525;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_responseandstreamstreamthrows_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_responseandstreamstreamthrows_FirstResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_responseandstreamservicethrows_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 4302560019326481254;\n  public int $foo;\n\n  public function __construct(?int $foo = null)[] {\n    $this->foo = $foo ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_responseandstreamservicethrows_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.responseandstreamservicethrows_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_responseandstreamservicethrows_StreamResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 3865318819874171525;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_responseandstreamservicethrows_StreamResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_responseandstreamservicethrows_StreamResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_responseandstreamservicethrows_FirstResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n    1 => shape(\n      'var' => 'e',\n      'type' => \\TType::STRUCT,\n      'class' => FooEx::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n    'e' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n    ?'e' => ?FooEx,\n  );\n\n  const int STRUCTURAL_ID = 7792945036684644137;\n  public ?this::TResult $success;\n  public ?FooEx $e;\n\n  public function __construct(?this::TResult $success = null, ?FooEx $e = null)[] {\n    $this->success = $success;\n    $this->e = $e;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n      Shapes::idx($shape, 'e'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_responseandstreamservicethrows_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_responseandstreamservicethrows_FirstResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FooEx\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"e\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->e !== null) {\n      return $this->e;\n    }\n    return null;\n  }\n}\n\nclass PubSubStreamingService_responseandstreamboththrows_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 4302560019326481254;\n  public int $foo;\n\n  public function __construct(?int $foo = null)[] {\n    $this->foo = $foo ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_responseandstreamboththrows_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.responseandstreamboththrows_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_responseandstreamboththrows_StreamResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n    1 => shape(\n      'var' => 'e',\n      'type' => \\TType::STRUCT,\n      'class' => FooStreamEx::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n    'e' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n    ?'e' => ?FooStreamEx,\n  );\n\n  const int STRUCTURAL_ID = 7900894693871902695;\n  public ?this::TResult $success;\n  public ?FooStreamEx $e;\n\n  public function __construct(?this::TResult $success = null, ?FooStreamEx $e = null)[] {\n    $this->success = $success;\n    $this->e = $e;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n      Shapes::idx($shape, 'e'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_responseandstreamboththrows_StreamResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_responseandstreamboththrows_StreamResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FooStreamEx\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"e\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->e !== null) {\n      return $this->e;\n    }\n    return null;\n  }\n}\n\nclass PubSubStreamingService_responseandstreamboththrows_FirstResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n    1 => shape(\n      'var' => 'e',\n      'type' => \\TType::STRUCT,\n      'class' => FooEx::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n    'e' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n    ?'e' => ?FooEx,\n  );\n\n  const int STRUCTURAL_ID = 7792945036684644137;\n  public ?this::TResult $success;\n  public ?FooEx $e;\n\n  public function __construct(?this::TResult $success = null, ?FooEx $e = null)[] {\n    $this->success = $success;\n    $this->e = $e;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n      Shapes::idx($shape, 'e'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_responseandstreamboththrows_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_responseandstreamboththrows_FirstResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.FooEx\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"e\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function checkForException(): ?\\TException {\n    if ($this->e !== null) {\n      return $this->e;\n    }\n    return null;\n  }\n}\n\nclass PubSubStreamingService_returnstreamFast_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'i32_from',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'i32_to',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'i32_from' => 1,\n    'i32_to' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'i32_from' => ?int,\n    ?'i32_to' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 6851224626875989960;\n  public int $i32_from;\n  public int $i32_to;\n\n  public function __construct(?int $i32_from = null, ?int $i32_to = null)[] {\n    $this->i32_from = $i32_from ?? 0;\n    $this->i32_to = $i32_to ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'i32_from'),\n      Shapes::idx($shape, 'i32_to'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_returnstreamFast_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.returnstreamFast_args\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i32_from\",\n            )\n          ),\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i32_to\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_returnstreamFast_StreamResponse extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = int;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 3865318819874171525;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_returnstreamFast_StreamResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_returnstreamFast_StreamResponse\",\n        \"fields\" => vec[\n          tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingService_returnstreamFast_FirstResponse extends \\ThriftSyncStructWithoutResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PubSubStreamingService_returnstreamFast_FirstResponse';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService_returnstreamFast_FirstResponse\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n}\n\nclass PubSubStreamingServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.PubSubStreamingService\",\n        \"functions\" => vec[\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"returnstream\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_stream\" => tmeta_ThriftStreamType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                      )\n                    ),\n                    \"name\" => \"i32_from\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                      )\n                    ),\n                    \"name\" => \"i32_to\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"streamthrows\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_stream\" => tmeta_ThriftStreamType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                      )\n                    ),\n                    \"name\" => \"foo\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"servicethrows\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_stream\" => tmeta_ThriftStreamType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                      )\n                    ),\n                    \"name\" => \"foo\",\n                  )\n                ),\n              ],\n              \"exceptions\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.FooEx\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"e\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"servicethrows2\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_stream\" => tmeta_ThriftStreamType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                      )\n                    ),\n                    \"name\" => \"foo\",\n                  )\n                ),\n              ],\n              \"exceptions\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.FooEx\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"e1\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.FooEx2\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"e2\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"boththrows\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_stream\" => tmeta_ThriftStreamType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                      )\n                    ),\n                    \"name\" => \"foo\",\n                  )\n                ),\n              ],\n              \"exceptions\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.FooEx\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"e\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"responseandstreamstreamthrows\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_stream\" => tmeta_ThriftStreamType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                      )\n                    ),\n                    \"name\" => \"foo\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"responseandstreamservicethrows\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_stream\" => tmeta_ThriftStreamType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                      )\n                    ),\n                    \"name\" => \"foo\",\n                  )\n                ),\n              ],\n              \"exceptions\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.FooEx\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"e\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"responseandstreamboththrows\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_stream\" => tmeta_ThriftStreamType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                      )\n                    ),\n                    \"name\" => \"foo\",\n                  )\n                ),\n              ],\n              \"exceptions\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_struct\" => tmeta_ThriftStructType::fromShape(\n                          shape(\n                            \"name\" => \"module.FooEx\",\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"e\",\n                  )\n                ),\n              ],\n            )\n          ),\n          tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"returnstreamFast\",\n              \"return_type\" => tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_stream\" => tmeta_ThriftStreamType::fromShape(\n                    shape(\n                      \"elemType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"initialResponseType\" => tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                      )\n                    ),\n                    \"name\" => \"i32_from\",\n                  )\n                ),\n                tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 2,\n                    \"type\" => tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_primitive\" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                      )\n                    ),\n                    \"name\" => \"i32_to\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n              'module.FooEx' => FooEx::getExceptionMetadata(),\n              'module.FooEx2' => FooEx2::getExceptionMetadata(),\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 3382}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\cpp;\n\n/**\n * Original thrift enum:-\n * RefType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/RefType'))>>\nenum RefType: int {\n  Unique = 0;\n  Shared = 1;\n  SharedMutable = 2;\n}\n\nclass RefType_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"cpp.RefType\",\n        \"elements\" => dict[\n          0 => \"Unique\",\n          1 => \"Shared\",\n          2 => \"SharedMutable\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Enum in C++ by default uses signed 32 bit integer. There is no need to specify\n * underlying type for signed 32 bit integer.\n * \n * Original thrift enum:-\n * EnumUnderlyingType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/EnumUnderlyingType'))>>\nenum EnumUnderlyingType: int {\n  /**\n   * ::std::int8_t\n   */\n  I8 = 0;\n  /**\n   * ::std::uint8_t\n   */\n  U8 = 1;\n  /**\n   * ::std::int16_t\n   */\n  I16 = 2;\n  /**\n   * ::std::uint16_t\n   */\n  U16 = 3;\n  /**\n   * ::std::uint32_t\n   */\n  U32 = 4;\n}\n\nclass EnumUnderlyingType_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"cpp.EnumUnderlyingType\",\n        \"elements\" => dict[\n          0 => \"I8\",\n          1 => \"U8\",\n          2 => \"I16\",\n          3 => \"U16\",\n          4 => \"U32\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Changes the native type of a Thrift object.\n * `name` and `template` correspond to `cpp.type` and `cpp.template` respecively.\n *\n * Original thrift struct:-\n * Type\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Type'))>>\nclass Type implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'template',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'template' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'template' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'template' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 6389487468753271119;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string template\n   */\n  public string $template;\n\n  public function __construct(?string $name = null, ?string $template = null)[] {\n    $this->name = $name ?? '';\n    $this->template = $template ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'template'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Type';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Type\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"template\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['template'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'template' => $this->template,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'template') !== null) {\n      $this->template = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['template']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Ref\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Ref'))>>\nclass Ref implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'type',\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\annotation\\cpp\\RefType::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'type' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\RefType,\n  );\n\n  const type TShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\RefType,\n    ...\n  );\n  const int STRUCTURAL_ID = 8496209332976516665;\n  /**\n   * Original thrift field:-\n   * 1: cpp.RefType type\n   */\n  public ?\\facebook\\thrift\\annotation\\cpp\\RefType $type;\n\n  public function __construct(?\\facebook\\thrift\\annotation\\cpp\\RefType $type = null)[] {\n    $this->type = $type;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Ref';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Ref\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"cpp.RefType\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"type\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'type' => $this->type,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'type') !== null) {\n      $this->type = \\facebook\\thrift\\annotation\\cpp\\RefType::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\annotation\\cpp\\RefType>($parsed['type']));\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Lazy\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Lazy'))>>\nclass Lazy implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ref',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ref' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ref' => ?bool,\n  );\n\n  const type TShape = shape(\n    'ref' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 2641839514020242314;\n  /**\n   * Original thrift field:-\n   * 1: bool ref\n   */\n  public bool $ref;\n\n  public function __construct(?bool $ref = null)[] {\n    $this->ref = $ref ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ref'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Lazy';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Lazy\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"ref\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['ref'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'ref' => $this->ref,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'ref') !== null) {\n      $this->ref = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['ref']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * DisableLazyChecksum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/DisableLazyChecksum'))>>\nclass DisableLazyChecksum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'DisableLazyChecksum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.DisableLazyChecksum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that applies a C++ adapter to typedef, field, or struct.\n * \n * For example:\n * \n *   @cpp.Adapter{name = \"::ns::IdAdapter\"}\n *   typedef i64 MyI64;\n * \n * Here the type `MyI64` has the C++ adapter `IdAdapter`.\n * \n *   struct User {\n *     @cpp.Adapter{name = \"::ns::IdAdapter\"}\n *     1: i64 id;\n *   }\n * \n * Here the field `id` has the C++ adapter `IdAdapter`.\n *\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'adaptedType',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'underlyingName',\n      'type' => \\TType::STRING,\n    ),\n    4 => shape(\n      'var' => 'extraNamespace',\n      'type' => \\TType::STRING,\n    ),\n    5 => shape(\n      'var' => 'moveOnly',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'adaptedType' => 2,\n    'underlyingName' => 3,\n    'extraNamespace' => 4,\n    'moveOnly' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'adaptedType' => ?string,\n    ?'underlyingName' => ?string,\n    ?'extraNamespace' => ?string,\n    ?'moveOnly' => ?bool,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'adaptedType' => string,\n    'underlyingName' => string,\n    'extraNamespace' => string,\n    'moveOnly' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 8180344078447403329;\n  /**\n   * The name of a C++ adapter type used to convert between Thrift and native\n   * C++ representation.\n   * \n   * The adapter can be either a Type or Field adapter, providing either of the following APIs:\n   * \n   *     struct ThriftTypeAdapter {\n   *       static AdaptedType fromThrift(ThriftType thrift);\n   *       static {const ThriftType& | ThriftType} toThrift(const AdaptedType& native);\n   *     };\n   * \n   *     struct ThriftFieldAdapter {\n   *       // Context is an instantiation of apache::thrift::FieldContext\n   *       template <class Context>\n   *       static void construct(AdaptedType& field, Context ctx);\n   * \n   *       template <class Context>\n   *       static AdaptedType fromThriftField(ThriftType value, Context ctx);\n   * \n   *       template <class Context>\n   *       static {const ThriftType& | ThriftType} toThrift(const AdaptedType& adapted, Context ctx);\n   *     };\n   * \n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * It is sometimes necessary to specify AdaptedType here (in case the codegen would\n   * have a circular depdenceny, which will cause the C++ build to fail).\n   * \n   * Original thrift field:-\n   * 2: string adaptedType\n   */\n  public string $adaptedType;\n  /**\n   * The name and/or extra namespace to use when directly adapting a type\n   * (as opposed a typedef).\n   * \n   * In this case, the IDL name of the type will refer to the adapted type in\n   * C++ and the underlying thrift type will be generated in a nested\n   * namespace and/or with a different name.\n   * \n   * If neither `underlyingName` or `extraNamespace` is provided, the\n   * underlying type will be generated in a nested 'detail' namespace with\n   * the same name.\n   * \n   * Original thrift field:-\n   * 3: string underlyingName\n   */\n  public string $underlyingName;\n  /**\n   * Original thrift field:-\n   * 4: string extraNamespace\n   */\n  public string $extraNamespace;\n  /**\n   * Must set to true when adapted type is not copyable.\n   * \n   * Original thrift field:-\n   * 5: bool moveOnly\n   */\n  public bool $moveOnly;\n\n  public function __construct(?string $name = null, ?string $adaptedType = null, ?string $underlyingName = null, ?string $extraNamespace = null, ?bool $moveOnly = null)[] {\n    $this->name = $name ?? '';\n    $this->adaptedType = $adaptedType ?? '';\n    $this->underlyingName = $underlyingName ?? '';\n    $this->extraNamespace = $extraNamespace ?? '';\n    $this->moveOnly = $moveOnly ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'adaptedType'),\n      Shapes::idx($shape, 'underlyingName'),\n      Shapes::idx($shape, 'extraNamespace'),\n      Shapes::idx($shape, 'moveOnly'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"adaptedType\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"underlyingName\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"extraNamespace\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"moveOnly\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['adaptedType'],\n      $shape['underlyingName'],\n      $shape['extraNamespace'],\n      $shape['moveOnly'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'adaptedType' => $this->adaptedType,\n      'underlyingName' => $this->underlyingName,\n      'extraNamespace' => $this->extraNamespace,\n      'moveOnly' => $this->moveOnly,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'adaptedType') !== null) {\n      $this->adaptedType = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['adaptedType']);\n    }\n    if (idx($parsed, 'underlyingName') !== null) {\n      $this->underlyingName = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['underlyingName']);\n    }\n    if (idx($parsed, 'extraNamespace') !== null) {\n      $this->extraNamespace = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['extraNamespace']);\n    }\n    if (idx($parsed, 'moveOnly') !== null) {\n      $this->moveOnly = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['moveOnly']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * PackIsset\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/PackIsset'))>>\nclass PackIsset implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'atomic',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'atomic' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'atomic' => ?bool,\n  );\n\n  const type TShape = shape(\n    'atomic' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 1587553453134051231;\n  /**\n   * Original thrift field:-\n   * 1: bool atomic\n   */\n  public bool $atomic;\n\n  public function __construct(?bool $atomic = null)[] {\n    $this->atomic = $atomic ?? true;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'atomic'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PackIsset';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.PackIsset\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"atomic\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['atomic'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'atomic' => $this->atomic,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'atomic') !== null) {\n      $this->atomic = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['atomic']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MinimizePadding\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/MinimizePadding'))>>\nclass MinimizePadding implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MinimizePadding';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.MinimizePadding\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * TriviallyRelocatable\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/TriviallyRelocatable'))>>\nclass TriviallyRelocatable implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TriviallyRelocatable';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.TriviallyRelocatable\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ScopedEnumAsUnionType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/ScopedEnumAsUnionType'))>>\nclass ScopedEnumAsUnionType implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ScopedEnumAsUnionType';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.ScopedEnumAsUnionType\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a typedef should be 'strong', and require an explicit cast to\n * the underlying type.\n * \n * Currently only works for integer typedefs, for example:\n * \n *     @cpp.StrongType\n *     typedef i32 MyId;\n * \n * Will cause an enum class to be used instead of a typedef in the genearte code, for example:\n * \n *     enum class MyId : ::std::int32_t {};\n * \n *\n * Original thrift struct:-\n * StrongType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/StrongType'))>>\nclass StrongType implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StrongType';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.StrongType\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that intercepts field access with C++ field interceptor.\n * Use with *caution* since this may introduce substantial performance overhead on each field access.\n * \n * For example:\n * \n *     struct Foo {\n *       @cpp.FieldInterceptor{name = \"MyFieldInterceptor\"}\n *       1: i64 id;\n *     }\n * \n * The field interceptor `MyFieldInterceptor` will intercept with `interceptThriftFieldAccess`\n * when the field `id` is accessed.\n *\n * Original thrift struct:-\n * FieldInterceptor\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/FieldInterceptor'))>>\nclass FieldInterceptor implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'noinline',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'noinline' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'noinline' => ?bool,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'noinline' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 8132831456632900275;\n  /**\n   * The name of a field interceptor.\n   * \n   * The field interceptor provides the following API:\n   * \n   *     struct ThriftFieldInterceptor {\n   *       template <typename T, typename Struct, int16_t FieldId>\n   *       static void interceptThriftFieldAccess(T&& field,\n   *                                              apache::thrift::FieldContext<Struct, FieldId>&& ctx);\n   *     };\n   * \n   * The field interceptor intercepts with the field value and the field context.\n   * It enforces an easily searchable function name `interceptThriftFieldAccess`.\n   * \n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Setting to true makes compiler not inline and erase function signature for\n   * the intercepting field accessor.\n   * \n   * Original thrift field:-\n   * 2: bool noinline\n   */\n  public bool $noinline;\n\n  public function __construct(?string $name = null, ?bool $noinline = null)[] {\n    $this->name = $name ?? '';\n    $this->noinline = $noinline ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'noinline'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldInterceptor';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.FieldInterceptor\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"noinline\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['noinline'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'noinline' => $this->noinline,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'noinline') !== null) {\n      $this->noinline = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['noinline']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * UseOpEncode\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/UseOpEncode'))>>\nclass UseOpEncode implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'UseOpEncode';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.UseOpEncode\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates an integer type for C++ to use as the underlying type of enum, for example:\n * \n *     @cpp.EnumType{type = cpp.EnumUnderlyingType.I8}\n *     enum Fruit {\n *       Apple = 0,\n *       Banana = 1,\n *     }\n * \n * will be generated into the following:\n * \n *     enum class Fruit : ::std::int8_t {\n *       Apple = 0,\n *       Banana = 1,\n *     };\n * \n *\n * Original thrift struct:-\n * EnumType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/EnumType'))>>\nclass EnumType implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'type',\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'type' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType,\n  );\n\n  const type TShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType,\n    ...\n  );\n  const int STRUCTURAL_ID = 1724537317047809370;\n  /**\n   * Original thrift field:-\n   * 1: cpp.EnumUnderlyingType type\n   */\n  public ?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType $type;\n\n  public function __construct(?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType $type = null)[] {\n    $this->type = $type;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumType';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.EnumType\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"cpp.EnumUnderlyingType\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"type\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'type' => $this->type,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'type') !== null) {\n      $this->type = \\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType>($parsed['type']));\n    }\n  }\n\n}\n\n/**\n * Indicates that frozen types should not be generated for a given struct.\n *\n * Original thrift struct:-\n * Frozen2Exclude\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Frozen2Exclude'))>>\nclass Frozen2Exclude implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Frozen2Exclude';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Frozen2Exclude\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that the container params must be complete at the time this type is instantiated.\n * Only required in rare cases where the build fails with a frozen-related assert failure.\n *\n * Original thrift struct:-\n * Frozen2RequiresCompleteContainerParams\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Frozen2RequiresCompleteContainerParams'))>>\nclass Frozen2RequiresCompleteContainerParams implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Frozen2RequiresCompleteContainerParams';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Frozen2RequiresCompleteContainerParams\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1953}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\hack;\n\n/**\n * Original thrift struct:-\n * FieldWrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/FieldWrapper'))>>\nclass FieldWrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldWrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.FieldWrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Wrapper\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Wrapper'))>>\nclass Wrapper implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'underlyingName',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'extraNamespace',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'underlyingName' => 2,\n    'extraNamespace' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'underlyingName' => ?string,\n    ?'extraNamespace' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'underlyingName' => string,\n    'extraNamespace' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 1284986773698322040;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string underlyingName\n   */\n  public string $underlyingName;\n  /**\n   * Original thrift field:-\n   * 3: string extraNamespace\n   */\n  public string $extraNamespace;\n\n  public function __construct(?string $name = null, ?string $underlyingName = null, ?string $extraNamespace = null)[] {\n    $this->name = $name ?? '';\n    $this->underlyingName = $underlyingName ?? '';\n    $this->extraNamespace = $extraNamespace ?? \"thrift_adapted_types\";\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'underlyingName'),\n      Shapes::idx($shape, 'extraNamespace'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Wrapper';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Wrapper\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"underlyingName\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"extraNamespace\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['underlyingName'],\n      $shape['extraNamespace'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'underlyingName' => $this->underlyingName,\n      'extraNamespace' => $this->extraNamespace,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'underlyingName') !== null) {\n      $this->underlyingName = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['underlyingName']);\n    }\n    if (idx($parsed, 'extraNamespace') !== null) {\n      $this->extraNamespace = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['extraNamespace']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * SkipCodegen\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/SkipCodegen'))>>\nclass SkipCodegen implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'reason' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'reason' => ?string,\n  );\n\n  const type TShape = shape(\n    'reason' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 3707764047816594739;\n  /**\n   * Original thrift field:-\n   * 1: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $reason = null)[] {\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SkipCodegen';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.SkipCodegen\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['reason'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'reason' => $this->reason,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'reason') !== null) {\n      $this->reason = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['reason']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Name\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Name'))>>\nclass Name implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'reason',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'reason' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'reason' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    'reason' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 4844827548325959202;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string reason\n   */\n  public string $reason;\n\n  public function __construct(?string $name = null, ?string $reason = null)[] {\n    $this->name = $name ?? '';\n    $this->reason = $reason ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'reason'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Name';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Name\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"reason\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n      $shape['reason'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n      'reason' => $this->reason,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'reason') !== null) {\n      $this->reason = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['reason']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * UnionEnumAttributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/UnionEnumAttributes'))>>\nclass UnionEnumAttributes implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?Vector<string>,\n  );\n\n  const type TShape = shape(\n    'attributes' => vec<string>,\n    ...\n  );\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public Vector<string> $attributes;\n\n  public function __construct(?Vector<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'UnionEnumAttributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.UnionEnumAttributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['attributes'] |> new Vector($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'attributes' => vec($this->attributes),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'attributes') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<string>>($parsed['attributes']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = '';\n        $_elem5 = $_value2;\n        $_container4 []= $_elem5;\n      }\n      $this->attributes = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructTrait'))>>\nclass StructTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructTrait\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Attributes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Attributes'))>>\nclass Attributes implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'attributes',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRING,\n      'elem' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'attributes' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'attributes' => ?Vector<string>,\n  );\n\n  const type TShape = shape(\n    'attributes' => vec<string>,\n    ...\n  );\n  const int STRUCTURAL_ID = 4379867690114498379;\n  /**\n   * Original thrift field:-\n   * 1: list<string> attributes\n   */\n  public Vector<string> $attributes;\n\n  public function __construct(?Vector<string> $attributes = null)[] {\n    $this->attributes = $attributes ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'attributes'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Attributes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.Attributes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"attributes\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['attributes'] |> new Vector($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'attributes' => vec($this->attributes),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'attributes') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<string>>($parsed['attributes']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = '';\n        $_elem5 = $_value2;\n        $_container4 []= $_elem5;\n      }\n      $this->attributes = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructAsTrait\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructAsTrait'))>>\nclass StructAsTrait implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructAsTrait';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.StructAsTrait\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ModuleInternal\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/ModuleInternal'))>>\nclass ModuleInternal implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ModuleInternal';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"hack.ModuleInternal\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1307}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1606}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\test\\terse_write;\n\n/**\n * Original thrift enum:-\n * MyEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/terse_write/MyEnum'))>>\nenum MyEnum: int {\n  ME0 = 0;\n  ME1 = 1;\n}\n\nclass MyEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"terse_write.MyEnum\",\n        \"elements\" => dict[\n          0 => \"ME0\",\n          1 => \"ME1\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * MyStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/terse_write/MyStruct'))>>\nclass MyStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"terse_write.MyStruct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\nenum MyUnionEnum: int {\n  _EMPTY_ = 0;\n  bool_field = 1;\n  byte_field = 2;\n  short_field = 3;\n  int_field = 4;\n  long_field = 5;\n  float_field = 6;\n  double_field = 7;\n  string_field = 8;\n  binary_field = 9;\n  enum_field = 10;\n  list_field = 11;\n  set_field = 12;\n  map_field = 13;\n  struct_field = 14;\n}\n\n/**\n * Original thrift struct:-\n * MyUnion\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/terse_write/MyUnion'))>>\nclass MyUnion implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftUnion<\\facebook\\thrift\\test\\terse_write\\MyUnionEnum>, \\IThriftShapishSyncStruct {\n  use \\ThriftUnionSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'bool_field',\n      'union' => true,\n      'type' => \\TType::BOOL,\n    ),\n    2 => shape(\n      'var' => 'byte_field',\n      'union' => true,\n      'type' => \\TType::BYTE,\n    ),\n    3 => shape(\n      'var' => 'short_field',\n      'union' => true,\n      'type' => \\TType::I16,\n    ),\n    4 => shape(\n      'var' => 'int_field',\n      'union' => true,\n      'type' => \\TType::I32,\n    ),\n    5 => shape(\n      'var' => 'long_field',\n      'union' => true,\n      'type' => \\TType::I64,\n    ),\n    6 => shape(\n      'var' => 'float_field',\n      'union' => true,\n      'type' => \\TType::FLOAT,\n    ),\n    7 => shape(\n      'var' => 'double_field',\n      'union' => true,\n      'type' => \\TType::DOUBLE,\n    ),\n    8 => shape(\n      'var' => 'string_field',\n      'union' => true,\n      'type' => \\TType::STRING,\n    ),\n    9 => shape(\n      'var' => 'binary_field',\n      'union' => true,\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    10 => shape(\n      'var' => 'enum_field',\n      'union' => true,\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\test\\terse_write\\MyEnum::class,\n    ),\n    11 => shape(\n      'var' => 'list_field',\n      'union' => true,\n      'type' => \\TType::LST,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    12 => shape(\n      'var' => 'set_field',\n      'union' => true,\n      'type' => \\TType::SET,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    13 => shape(\n      'var' => 'map_field',\n      'union' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I16,\n      'vtype' => \\TType::I16,\n      'key' => shape(\n        'type' => \\TType::I16,\n      ),\n      'val' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    14 => shape(\n      'var' => 'struct_field',\n      'union' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\terse_write\\MyStruct::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'bool_field' => 1,\n    'byte_field' => 2,\n    'short_field' => 3,\n    'int_field' => 4,\n    'long_field' => 5,\n    'float_field' => 6,\n    'double_field' => 7,\n    'string_field' => 8,\n    'binary_field' => 9,\n    'enum_field' => 10,\n    'list_field' => 11,\n    'set_field' => 12,\n    'map_field' => 13,\n    'struct_field' => 14,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'bool_field' => ?bool,\n    ?'byte_field' => ?int,\n    ?'short_field' => ?int,\n    ?'int_field' => ?int,\n    ?'long_field' => ?int,\n    ?'float_field' => ?float,\n    ?'double_field' => ?float,\n    ?'string_field' => ?string,\n    ?'binary_field' => ?string,\n    ?'enum_field' => ?\\facebook\\thrift\\test\\terse_write\\MyEnum,\n    ?'list_field' => ?Vector<int>,\n    ?'set_field' => ?Set<int>,\n    ?'map_field' => ?Map<int, int>,\n    ?'struct_field' => ?\\facebook\\thrift\\test\\terse_write\\MyStruct,\n  );\n\n  const type TShape = shape(\n    ?'bool_field' => ?bool,\n    ?'byte_field' => ?int,\n    ?'short_field' => ?int,\n    ?'int_field' => ?int,\n    ?'long_field' => ?int,\n    ?'float_field' => ?float,\n    ?'double_field' => ?float,\n    ?'string_field' => ?string,\n    ?'binary_field' => ?string,\n    ?'enum_field' => ?\\facebook\\thrift\\test\\terse_write\\MyEnum,\n    ?'list_field' => ?vec<int>,\n    ?'set_field' => ?dict<int, bool>,\n    ?'map_field' => ?dict<int, int>,\n    ?'struct_field' => ?\\facebook\\thrift\\test\\terse_write\\MyStruct::TShape,\n    ...\n  );\n  const int STRUCTURAL_ID = 586689148575201005;\n  /**\n   * Original thrift field:-\n   * 1: bool bool_field\n   */\n  public ?bool $bool_field;\n  /**\n   * Original thrift field:-\n   * 2: byte byte_field\n   */\n  public ?int $byte_field;\n  /**\n   * Original thrift field:-\n   * 3: i16 short_field\n   */\n  public ?int $short_field;\n  /**\n   * Original thrift field:-\n   * 4: i32 int_field\n   */\n  public ?int $int_field;\n  /**\n   * Original thrift field:-\n   * 5: i64 long_field\n   */\n  public ?int $long_field;\n  /**\n   * Original thrift field:-\n   * 6: float float_field\n   */\n  public ?float $float_field;\n  /**\n   * Original thrift field:-\n   * 7: double double_field\n   */\n  public ?float $double_field;\n  /**\n   * Original thrift field:-\n   * 8: string string_field\n   */\n  public ?string $string_field;\n  /**\n   * Original thrift field:-\n   * 9: binary binary_field\n   */\n  public ?string $binary_field;\n  /**\n   * Original thrift field:-\n   * 10: terse_write.MyEnum enum_field\n   */\n  public ?\\facebook\\thrift\\test\\terse_write\\MyEnum $enum_field;\n  /**\n   * Original thrift field:-\n   * 11: list<i16> list_field\n   */\n  public ?Vector<int> $list_field;\n  /**\n   * Original thrift field:-\n   * 12: set<i16> set_field\n   */\n  public ?Set<int> $set_field;\n  /**\n   * Original thrift field:-\n   * 13: map<i16, i16> map_field\n   */\n  public ?Map<int, int> $map_field;\n  /**\n   * Original thrift field:-\n   * 14: terse_write.MyStruct struct_field\n   */\n  public ?\\facebook\\thrift\\test\\terse_write\\MyStruct $struct_field;\n  protected \\facebook\\thrift\\test\\terse_write\\MyUnionEnum $_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::_EMPTY_;\n\n  public function __construct(?bool $bool_field = null, ?int $byte_field = null, ?int $short_field = null, ?int $int_field = null, ?int $long_field = null, ?float $float_field = null, ?float $double_field = null, ?string $string_field = null, ?string $binary_field = null, ?\\facebook\\thrift\\test\\terse_write\\MyEnum $enum_field = null, ?Vector<int> $list_field = null, ?Set<int> $set_field = null, ?Map<int, int> $map_field = null, ?\\facebook\\thrift\\test\\terse_write\\MyStruct $struct_field = null)[] {\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::_EMPTY_;\n    if ($bool_field !== null) {\n      $this->bool_field = $bool_field;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::bool_field;\n    }\n    if ($byte_field !== null) {\n      $this->byte_field = $byte_field;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::byte_field;\n    }\n    if ($short_field !== null) {\n      $this->short_field = $short_field;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::short_field;\n    }\n    if ($int_field !== null) {\n      $this->int_field = $int_field;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::int_field;\n    }\n    if ($long_field !== null) {\n      $this->long_field = $long_field;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::long_field;\n    }\n    if ($float_field !== null) {\n      $this->float_field = $float_field;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::float_field;\n    }\n    if ($double_field !== null) {\n      $this->double_field = $double_field;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::double_field;\n    }\n    if ($string_field !== null) {\n      $this->string_field = $string_field;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::string_field;\n    }\n    if ($binary_field !== null) {\n      $this->binary_field = $binary_field;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::binary_field;\n    }\n    if ($enum_field !== null) {\n      $this->enum_field = $enum_field;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::enum_field;\n    }\n    if ($list_field !== null) {\n      $this->list_field = $list_field;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::list_field;\n    }\n    if ($set_field !== null) {\n      $this->set_field = $set_field;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::set_field;\n    }\n    if ($map_field !== null) {\n      $this->map_field = $map_field;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::map_field;\n    }\n    if ($struct_field !== null) {\n      $this->struct_field = $struct_field;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::struct_field;\n    }\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'bool_field'),\n      Shapes::idx($shape, 'byte_field'),\n      Shapes::idx($shape, 'short_field'),\n      Shapes::idx($shape, 'int_field'),\n      Shapes::idx($shape, 'long_field'),\n      Shapes::idx($shape, 'float_field'),\n      Shapes::idx($shape, 'double_field'),\n      Shapes::idx($shape, 'string_field'),\n      Shapes::idx($shape, 'binary_field'),\n      Shapes::idx($shape, 'enum_field'),\n      Shapes::idx($shape, 'list_field'),\n      Shapes::idx($shape, 'set_field'),\n      Shapes::idx($shape, 'map_field'),\n      Shapes::idx($shape, 'struct_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyUnion';\n  }\n\n  public function getType()[]: \\facebook\\thrift\\test\\terse_write\\MyUnionEnum {\n    return $this->_type;\n  }\n\n  public function reset()[write_props]: void {\n    switch ($this->_type) {\n      case \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::bool_field:\n        $this->bool_field = null;\n        break;\n      case \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::byte_field:\n        $this->byte_field = null;\n        break;\n      case \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::short_field:\n        $this->short_field = null;\n        break;\n      case \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::int_field:\n        $this->int_field = null;\n        break;\n      case \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::long_field:\n        $this->long_field = null;\n        break;\n      case \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::float_field:\n        $this->float_field = null;\n        break;\n      case \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::double_field:\n        $this->double_field = null;\n        break;\n      case \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::string_field:\n        $this->string_field = null;\n        break;\n      case \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::binary_field:\n        $this->binary_field = null;\n        break;\n      case \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::enum_field:\n        $this->enum_field = null;\n        break;\n      case \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::list_field:\n        $this->list_field = null;\n        break;\n      case \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::set_field:\n        $this->set_field = null;\n        break;\n      case \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::map_field:\n        $this->map_field = null;\n        break;\n      case \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::struct_field:\n        $this->struct_field = null;\n        break;\n      case \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::_EMPTY_:\n        break;\n    }\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::_EMPTY_;\n  }\n\n  public function set_bool_field(bool $bool_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::bool_field;\n    $this->bool_field = $bool_field;\n    return $this;\n  }\n\n  public function get_bool_field()[]: ?bool {\n    return $this->bool_field;\n  }\n\n  public function getx_bool_field()[]: bool {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::bool_field,\n      'get_bool_field called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->bool_field as nonnull;\n  }\n\n  public function set_byte_field(int $byte_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::byte_field;\n    $this->byte_field = $byte_field;\n    return $this;\n  }\n\n  public function get_byte_field()[]: ?int {\n    return $this->byte_field;\n  }\n\n  public function getx_byte_field()[]: int {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::byte_field,\n      'get_byte_field called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->byte_field as nonnull;\n  }\n\n  public function set_short_field(int $short_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::short_field;\n    $this->short_field = $short_field;\n    return $this;\n  }\n\n  public function get_short_field()[]: ?int {\n    return $this->short_field;\n  }\n\n  public function getx_short_field()[]: int {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::short_field,\n      'get_short_field called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->short_field as nonnull;\n  }\n\n  public function set_int_field(int $int_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::int_field;\n    $this->int_field = $int_field;\n    return $this;\n  }\n\n  public function get_int_field()[]: ?int {\n    return $this->int_field;\n  }\n\n  public function getx_int_field()[]: int {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::int_field,\n      'get_int_field called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->int_field as nonnull;\n  }\n\n  public function set_long_field(int $long_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::long_field;\n    $this->long_field = $long_field;\n    return $this;\n  }\n\n  public function get_long_field()[]: ?int {\n    return $this->long_field;\n  }\n\n  public function getx_long_field()[]: int {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::long_field,\n      'get_long_field called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->long_field as nonnull;\n  }\n\n  public function set_float_field(float $float_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::float_field;\n    $this->float_field = $float_field;\n    return $this;\n  }\n\n  public function get_float_field()[]: ?float {\n    return $this->float_field;\n  }\n\n  public function getx_float_field()[]: float {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::float_field,\n      'get_float_field called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->float_field as nonnull;\n  }\n\n  public function set_double_field(float $double_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::double_field;\n    $this->double_field = $double_field;\n    return $this;\n  }\n\n  public function get_double_field()[]: ?float {\n    return $this->double_field;\n  }\n\n  public function getx_double_field()[]: float {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::double_field,\n      'get_double_field called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->double_field as nonnull;\n  }\n\n  public function set_string_field(string $string_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::string_field;\n    $this->string_field = $string_field;\n    return $this;\n  }\n\n  public function get_string_field()[]: ?string {\n    return $this->string_field;\n  }\n\n  public function getx_string_field()[]: string {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::string_field,\n      'get_string_field called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->string_field as nonnull;\n  }\n\n  public function set_binary_field(string $binary_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::binary_field;\n    $this->binary_field = $binary_field;\n    return $this;\n  }\n\n  public function get_binary_field()[]: ?string {\n    return $this->binary_field;\n  }\n\n  public function getx_binary_field()[]: string {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::binary_field,\n      'get_binary_field called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->binary_field as nonnull;\n  }\n\n  public function set_enum_field(\\facebook\\thrift\\test\\terse_write\\MyEnum $enum_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::enum_field;\n    $this->enum_field = $enum_field;\n    return $this;\n  }\n\n  public function get_enum_field()[]: ?\\facebook\\thrift\\test\\terse_write\\MyEnum {\n    return $this->enum_field;\n  }\n\n  public function getx_enum_field()[]: \\facebook\\thrift\\test\\terse_write\\MyEnum {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::enum_field,\n      'get_enum_field called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->enum_field as nonnull;\n  }\n\n  public function set_list_field(Vector<int> $list_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::list_field;\n    $this->list_field = $list_field;\n    return $this;\n  }\n\n  public function get_list_field()[]: ?Vector<int> {\n    return $this->list_field;\n  }\n\n  public function getx_list_field()[]: Vector<int> {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::list_field,\n      'get_list_field called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->list_field as nonnull;\n  }\n\n  public function set_set_field(Set<int> $set_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::set_field;\n    $this->set_field = new Set(Keyset\\keys($set_field));\n    return $this;\n  }\n\n  public function get_set_field()[]: ?Set<int> {\n    return $this->set_field;\n  }\n\n  public function getx_set_field()[]: Set<int> {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::set_field,\n      'get_set_field called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->set_field as nonnull;\n  }\n\n  public function set_map_field(Map<int, int> $map_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::map_field;\n    $this->map_field = $map_field;\n    return $this;\n  }\n\n  public function get_map_field()[]: ?Map<int, int> {\n    return $this->map_field;\n  }\n\n  public function getx_map_field()[]: Map<int, int> {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::map_field,\n      'get_map_field called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->map_field as nonnull;\n  }\n\n  public function set_struct_field(\\facebook\\thrift\\test\\terse_write\\MyStruct $struct_field)[write_props]: this {\n    $this->reset();\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::struct_field;\n    $this->struct_field = $struct_field;\n    return $this;\n  }\n\n  public function get_struct_field()[]: ?\\facebook\\thrift\\test\\terse_write\\MyStruct {\n    return $this->struct_field;\n  }\n\n  public function getx_struct_field()[]: \\facebook\\thrift\\test\\terse_write\\MyStruct {\n    invariant(\n      $this->_type === \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::struct_field,\n      'get_struct_field called on an instance of MyUnion whose current type is %s',\n      (string)$this->_type,\n    );\n    return $this->struct_field as nonnull;\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"terse_write.MyUnion\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"bool_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                )\n              ),\n              \"name\" => \"byte_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                )\n              ),\n              \"name\" => \"short_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"int_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"long_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_FLOAT_TYPE,\n                )\n              ),\n              \"name\" => \"float_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"double_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"string_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"binary_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 10,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"terse_write.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"enum_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 11,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 12,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"set_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 13,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 14,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"terse_write.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"struct_field\",\n            )\n          ),\n        ],\n        \"is_union\" => true,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'bool_field'),\n      Shapes::idx($shape, 'byte_field'),\n      Shapes::idx($shape, 'short_field'),\n      Shapes::idx($shape, 'int_field'),\n      Shapes::idx($shape, 'long_field'),\n      Shapes::idx($shape, 'float_field'),\n      Shapes::idx($shape, 'double_field'),\n      Shapes::idx($shape, 'string_field'),\n      Shapes::idx($shape, 'binary_field'),\n      Shapes::idx($shape, 'enum_field'),\n      Shapes::idx($shape, 'list_field') === null ? null : ($shape['list_field'] |> new Vector($$)),\n      Shapes::idx($shape, 'set_field') === null ? null : (new Set(Keyset\\keys($shape['set_field']))),\n      Shapes::idx($shape, 'map_field') === null ? null : ($shape['map_field'] |> new Map($$)),\n      Shapes::idx($shape, 'struct_field') === null ? null : (\\facebook\\thrift\\test\\terse_write\\MyStruct::__fromShape($shape['struct_field'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'bool_field' => $this->bool_field,\n      'byte_field' => $this->byte_field,\n      'short_field' => $this->short_field,\n      'int_field' => $this->int_field,\n      'long_field' => $this->long_field,\n      'float_field' => $this->float_field,\n      'double_field' => $this->double_field,\n      'string_field' => $this->string_field,\n      'binary_field' => $this->binary_field,\n      'enum_field' => $this->enum_field,\n      'list_field' => $this->list_field\n        |> $$ === null ? null : vec($$),\n      'set_field' => $this->set_field\n        |> $$ === null ? null : ThriftUtil::toDArray(Dict\\fill_keys($$->toValuesArray(), true), static::class),\n      'map_field' => $this->map_field\n        |> $$ === null ? null : dict($$),\n      'struct_field' => $this->struct_field?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::_EMPTY_;\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'bool_field') !== null) {\n      $this->bool_field = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['bool_field']);\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::bool_field;\n    }\n    if (idx($parsed, 'byte_field') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['byte_field']);\n      if ($_tmp0 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->byte_field = (int)$_tmp0;\n      }\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::byte_field;\n    }\n    if (idx($parsed, 'short_field') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['short_field']);\n      if ($_tmp1 > 0x7fff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->short_field = (int)$_tmp1;\n      }\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::short_field;\n    }\n    if (idx($parsed, 'int_field') !== null) {\n      $_tmp2 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['int_field']);\n      if ($_tmp2 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->int_field = (int)$_tmp2;\n      }\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::int_field;\n    }\n    if (idx($parsed, 'long_field') !== null) {\n      $this->long_field = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['long_field']);\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::long_field;\n    }\n    if (idx($parsed, 'float_field') !== null) {\n      $this->float_field = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['float_field']);\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::float_field;\n    }\n    if (idx($parsed, 'double_field') !== null) {\n      $this->double_field = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['double_field']);\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::double_field;\n    }\n    if (idx($parsed, 'string_field') !== null) {\n      $this->string_field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['string_field']);\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::string_field;\n    }\n    if (idx($parsed, 'binary_field') !== null) {\n      $this->binary_field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['binary_field']);\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::binary_field;\n    }\n    if (idx($parsed, 'enum_field') !== null) {\n      $this->enum_field = \\facebook\\thrift\\test\\terse_write\\MyEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\terse_write\\MyEnum>($parsed['enum_field']));\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::enum_field;\n    }\n    if (idx($parsed, 'list_field') !== null) {\n      $_json6 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['list_field']);\n      $_container7 = Vector {};\n      foreach($_json6 as $_key4 => $_value5) {\n        $_elem8 = 0;\n        $_tmp9 = (int)$_value5;\n        if ($_tmp9 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem8 = (int)$_tmp9;\n        }\n        $_container7 []= $_elem8;\n      }\n      $this->list_field = $_container7;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::list_field;\n    }\n    if (idx($parsed, 'set_field') !== null) {\n      $_json13 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['set_field']);\n      $_container14 = Set {};\n      foreach($_json13 as $_key11 => $_value12) {\n        $_elem15 = 0;\n        $_tmp16 = (int)$_value12;\n        if ($_tmp16 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem15 = (int)$_tmp16;\n        }\n        $_container14->add($_elem15);\n      }\n      $this->set_field = $_container14;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::set_field;\n    }\n    if (idx($parsed, 'map_field') !== null) {\n      $_json20 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, int>>($parsed['map_field']);\n      $_container21 = Map {};\n      foreach($_json20 as $_key18 => $_value19) {\n        $_value22 = 0;\n        $_tmp23 = (int)$_value19;\n        if ($_tmp23 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value22 = (int)$_tmp23;\n        }\n        $_container21[$_key18] = $_value22;\n      }\n      $this->map_field = $_container21;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::map_field;\n    }\n    if (idx($parsed, 'struct_field') !== null) {\n      $_tmp24 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\terse_write\\MyStruct>($parsed['struct_field']));\n      $_tmp25 = \\facebook\\thrift\\test\\terse_write\\MyStruct::withDefaultValues();\n      $_tmp25->readFromJson($_tmp24);\n      $this->struct_field = $_tmp25;\n      $this->_type = \\facebook\\thrift\\test\\terse_write\\MyUnionEnum::struct_field;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStructWithCustomDefault\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/terse_write/MyStructWithCustomDefault'))>>\nclass MyStructWithCustomDefault implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field1',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field1' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field1' => ?int,\n  );\n\n  const type TShape = shape(\n    'field1' => int,\n    ...\n  );\n  const int STRUCTURAL_ID = 1037618795438567400;\n  /**\n   * Original thrift field:-\n   * 1: i64 field1\n   */\n  public int $field1;\n\n  public function __construct(?int $field1 = null)[] {\n    $this->field1 = $field1 ?? 1;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field1'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStructWithCustomDefault';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"terse_write.MyStructWithCustomDefault\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"field1\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field1'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field1' => $this->field1,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field1') !== null) {\n      $this->field1 = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['field1']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructLevelTerseStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/terse_write/StructLevelTerseStruct'))>>\nclass StructLevelTerseStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'bool_field',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    2 => shape(\n      'var' => 'byte_field',\n      'is_terse' => true,\n      'type' => \\TType::BYTE,\n    ),\n    3 => shape(\n      'var' => 'short_field',\n      'is_terse' => true,\n      'type' => \\TType::I16,\n    ),\n    4 => shape(\n      'var' => 'int_field',\n      'is_terse' => true,\n      'type' => \\TType::I32,\n    ),\n    5 => shape(\n      'var' => 'long_field',\n      'is_terse' => true,\n      'type' => \\TType::I64,\n    ),\n    6 => shape(\n      'var' => 'float_field',\n      'is_terse' => true,\n      'type' => \\TType::FLOAT,\n    ),\n    7 => shape(\n      'var' => 'double_field',\n      'is_terse' => true,\n      'type' => \\TType::DOUBLE,\n    ),\n    8 => shape(\n      'var' => 'string_field',\n      'is_terse' => true,\n      'type' => \\TType::STRING,\n    ),\n    9 => shape(\n      'var' => 'binary_field',\n      'is_terse' => true,\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    10 => shape(\n      'var' => 'enum_field',\n      'is_terse' => true,\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\test\\terse_write\\MyEnum::class,\n    ),\n    11 => shape(\n      'var' => 'list_field',\n      'is_terse' => true,\n      'type' => \\TType::LST,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    12 => shape(\n      'var' => 'set_field',\n      'is_terse' => true,\n      'type' => \\TType::SET,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    13 => shape(\n      'var' => 'map_field',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I16,\n      'vtype' => \\TType::I16,\n      'key' => shape(\n        'type' => \\TType::I16,\n      ),\n      'val' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    14 => shape(\n      'var' => 'struct_field',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\terse_write\\MyStruct::class,\n    ),\n    15 => shape(\n      'var' => 'union_field',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\terse_write\\MyUnion::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'bool_field' => 1,\n    'byte_field' => 2,\n    'short_field' => 3,\n    'int_field' => 4,\n    'long_field' => 5,\n    'float_field' => 6,\n    'double_field' => 7,\n    'string_field' => 8,\n    'binary_field' => 9,\n    'enum_field' => 10,\n    'list_field' => 11,\n    'set_field' => 12,\n    'map_field' => 13,\n    'struct_field' => 14,\n    'union_field' => 15,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'bool_field' => ?bool,\n    ?'byte_field' => ?int,\n    ?'short_field' => ?int,\n    ?'int_field' => ?int,\n    ?'long_field' => ?int,\n    ?'float_field' => ?float,\n    ?'double_field' => ?float,\n    ?'string_field' => ?string,\n    ?'binary_field' => ?string,\n    ?'enum_field' => ?\\facebook\\thrift\\test\\terse_write\\MyEnum,\n    ?'list_field' => ?Vector<int>,\n    ?'set_field' => ?Set<int>,\n    ?'map_field' => ?Map<int, int>,\n    ?'struct_field' => ?\\facebook\\thrift\\test\\terse_write\\MyStruct,\n    ?'union_field' => ?\\facebook\\thrift\\test\\terse_write\\MyUnion,\n  );\n\n  const type TShape = shape(\n    'bool_field' => bool,\n    'byte_field' => int,\n    'short_field' => int,\n    'int_field' => int,\n    'long_field' => int,\n    'float_field' => float,\n    'double_field' => float,\n    'string_field' => string,\n    'binary_field' => string,\n    ?'enum_field' => ?\\facebook\\thrift\\test\\terse_write\\MyEnum,\n    'list_field' => vec<int>,\n    'set_field' => dict<int, bool>,\n    'map_field' => dict<int, int>,\n    ?'struct_field' => ?\\facebook\\thrift\\test\\terse_write\\MyStruct::TShape,\n    ?'union_field' => ?\\facebook\\thrift\\test\\terse_write\\MyUnion::TShape,\n    ...\n  );\n  const int STRUCTURAL_ID = 886176714715872097;\n  /**\n   * Original thrift field:-\n   * 1: bool bool_field\n   */\n  public bool $bool_field;\n  /**\n   * Original thrift field:-\n   * 2: byte byte_field\n   */\n  public int $byte_field;\n  /**\n   * Original thrift field:-\n   * 3: i16 short_field\n   */\n  public int $short_field;\n  /**\n   * Original thrift field:-\n   * 4: i32 int_field\n   */\n  public int $int_field;\n  /**\n   * Original thrift field:-\n   * 5: i64 long_field\n   */\n  public int $long_field;\n  /**\n   * Original thrift field:-\n   * 6: float float_field\n   */\n  public float $float_field;\n  /**\n   * Original thrift field:-\n   * 7: double double_field\n   */\n  public float $double_field;\n  /**\n   * Original thrift field:-\n   * 8: string string_field\n   */\n  public string $string_field;\n  /**\n   * Original thrift field:-\n   * 9: binary binary_field\n   */\n  public string $binary_field;\n  /**\n   * Original thrift field:-\n   * 10: terse_write.MyEnum enum_field\n   */\n  public ?\\facebook\\thrift\\test\\terse_write\\MyEnum $enum_field;\n  /**\n   * Original thrift field:-\n   * 11: list<i16> list_field\n   */\n  public Vector<int> $list_field;\n  /**\n   * Original thrift field:-\n   * 12: set<i16> set_field\n   */\n  public Set<int> $set_field;\n  /**\n   * Original thrift field:-\n   * 13: map<i16, i16> map_field\n   */\n  public Map<int, int> $map_field;\n  /**\n   * Original thrift field:-\n   * 14: terse_write.MyStruct struct_field\n   */\n  public ?\\facebook\\thrift\\test\\terse_write\\MyStruct $struct_field;\n  /**\n   * Original thrift field:-\n   * 15: terse_write.MyUnion union_field\n   */\n  public ?\\facebook\\thrift\\test\\terse_write\\MyUnion $union_field;\n\n  public function __construct(?bool $bool_field = null, ?int $byte_field = null, ?int $short_field = null, ?int $int_field = null, ?int $long_field = null, ?float $float_field = null, ?float $double_field = null, ?string $string_field = null, ?string $binary_field = null, ?\\facebook\\thrift\\test\\terse_write\\MyEnum $enum_field = null, ?Vector<int> $list_field = null, ?Set<int> $set_field = null, ?Map<int, int> $map_field = null, ?\\facebook\\thrift\\test\\terse_write\\MyStruct $struct_field = null, ?\\facebook\\thrift\\test\\terse_write\\MyUnion $union_field = null)[] {\n    $this->bool_field = $bool_field ?? false;\n    $this->byte_field = $byte_field ?? 0;\n    $this->short_field = $short_field ?? 0;\n    $this->int_field = $int_field ?? 0;\n    $this->long_field = $long_field ?? 0;\n    $this->float_field = $float_field ?? 0.0;\n    $this->double_field = $double_field ?? 0.0;\n    $this->string_field = $string_field ?? '';\n    $this->binary_field = $binary_field ?? '';\n    $this->enum_field = $enum_field;\n    $this->list_field = $list_field ?? Vector {};\n    $this->set_field = $set_field ?? Set {};\n    $this->map_field = $map_field ?? Map {};\n    $this->struct_field = $struct_field;\n    $this->union_field = $union_field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'bool_field'),\n      Shapes::idx($shape, 'byte_field'),\n      Shapes::idx($shape, 'short_field'),\n      Shapes::idx($shape, 'int_field'),\n      Shapes::idx($shape, 'long_field'),\n      Shapes::idx($shape, 'float_field'),\n      Shapes::idx($shape, 'double_field'),\n      Shapes::idx($shape, 'string_field'),\n      Shapes::idx($shape, 'binary_field'),\n      Shapes::idx($shape, 'enum_field'),\n      Shapes::idx($shape, 'list_field'),\n      Shapes::idx($shape, 'set_field'),\n      Shapes::idx($shape, 'map_field'),\n      Shapes::idx($shape, 'struct_field'),\n      Shapes::idx($shape, 'union_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructLevelTerseStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->bool_field = false;\n    $this->byte_field = 0;\n    $this->short_field = 0;\n    $this->int_field = 0;\n    $this->long_field = 0;\n    $this->float_field = 0.0;\n    $this->double_field = 0.0;\n    $this->string_field = '';\n    $this->binary_field = '';\n    $this->enum_field = null;\n    $this->list_field = Vector {};\n    $this->set_field = Set {};\n    $this->map_field = Map {};\n    $this->struct_field = null;\n    $this->union_field = null;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"terse_write.StructLevelTerseStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"bool_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                )\n              ),\n              \"name\" => \"byte_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                )\n              ),\n              \"name\" => \"short_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"int_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"long_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_FLOAT_TYPE,\n                )\n              ),\n              \"name\" => \"float_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"double_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"string_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"binary_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 10,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"terse_write.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"enum_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 11,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 12,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"set_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 13,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 14,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"terse_write.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"struct_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 15,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"terse_write.MyUnion\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"union_field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['bool_field'],\n      $shape['byte_field'],\n      $shape['short_field'],\n      $shape['int_field'],\n      $shape['long_field'],\n      $shape['float_field'],\n      $shape['double_field'],\n      $shape['string_field'],\n      $shape['binary_field'],\n      Shapes::idx($shape, 'enum_field'),\n      $shape['list_field'] |> new Vector($$),\n      new Set(Keyset\\keys($shape['set_field'])),\n      $shape['map_field'] |> new Map($$),\n      Shapes::idx($shape, 'struct_field') === null ? null : (\\facebook\\thrift\\test\\terse_write\\MyStruct::__fromShape($shape['struct_field'])),\n      Shapes::idx($shape, 'union_field') === null ? null : (\\facebook\\thrift\\test\\terse_write\\MyUnion::__fromShape($shape['union_field'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'bool_field' => $this->bool_field,\n      'byte_field' => $this->byte_field,\n      'short_field' => $this->short_field,\n      'int_field' => $this->int_field,\n      'long_field' => $this->long_field,\n      'float_field' => $this->float_field,\n      'double_field' => $this->double_field,\n      'string_field' => $this->string_field,\n      'binary_field' => $this->binary_field,\n      'enum_field' => $this->enum_field,\n      'list_field' => vec($this->list_field),\n      'set_field' => ThriftUtil::toDArray(Dict\\fill_keys($this->set_field->toValuesArray(), true), static::class),\n      'map_field' => dict($this->map_field),\n      'struct_field' => $this->struct_field?->__toShape(),\n      'union_field' => $this->union_field?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'bool_field') !== null) {\n      $this->bool_field = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['bool_field']);\n    }\n    if (idx($parsed, 'byte_field') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['byte_field']);\n      if ($_tmp0 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->byte_field = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'short_field') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['short_field']);\n      if ($_tmp1 > 0x7fff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->short_field = (int)$_tmp1;\n      }\n    }\n    if (idx($parsed, 'int_field') !== null) {\n      $_tmp2 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['int_field']);\n      if ($_tmp2 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->int_field = (int)$_tmp2;\n      }\n    }\n    if (idx($parsed, 'long_field') !== null) {\n      $this->long_field = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['long_field']);\n    }\n    if (idx($parsed, 'float_field') !== null) {\n      $this->float_field = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['float_field']);\n    }\n    if (idx($parsed, 'double_field') !== null) {\n      $this->double_field = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['double_field']);\n    }\n    if (idx($parsed, 'string_field') !== null) {\n      $this->string_field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['string_field']);\n    }\n    if (idx($parsed, 'binary_field') !== null) {\n      $this->binary_field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['binary_field']);\n    }\n    if (idx($parsed, 'enum_field') !== null) {\n      $this->enum_field = \\facebook\\thrift\\test\\terse_write\\MyEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\terse_write\\MyEnum>($parsed['enum_field']));\n    }\n    if (idx($parsed, 'list_field') !== null) {\n      $_json6 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['list_field']);\n      $_container7 = Vector {};\n      foreach($_json6 as $_key4 => $_value5) {\n        $_elem8 = 0;\n        $_tmp9 = (int)$_value5;\n        if ($_tmp9 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem8 = (int)$_tmp9;\n        }\n        $_container7 []= $_elem8;\n      }\n      $this->list_field = $_container7;\n    }\n    if (idx($parsed, 'set_field') !== null) {\n      $_json13 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['set_field']);\n      $_container14 = Set {};\n      foreach($_json13 as $_key11 => $_value12) {\n        $_elem15 = 0;\n        $_tmp16 = (int)$_value12;\n        if ($_tmp16 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem15 = (int)$_tmp16;\n        }\n        $_container14->add($_elem15);\n      }\n      $this->set_field = $_container14;\n    }\n    if (idx($parsed, 'map_field') !== null) {\n      $_json20 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, int>>($parsed['map_field']);\n      $_container21 = Map {};\n      foreach($_json20 as $_key18 => $_value19) {\n        $_value22 = 0;\n        $_tmp23 = (int)$_value19;\n        if ($_tmp23 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value22 = (int)$_tmp23;\n        }\n        $_container21[$_key18] = $_value22;\n      }\n      $this->map_field = $_container21;\n    }\n    if (idx($parsed, 'struct_field') !== null) {\n      $_tmp24 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\terse_write\\MyStruct>($parsed['struct_field']));\n      $_tmp25 = \\facebook\\thrift\\test\\terse_write\\MyStruct::withDefaultValues();\n      $_tmp25->readFromJson($_tmp24);\n      $this->struct_field = $_tmp25;\n    }\n    if (idx($parsed, 'union_field') !== null) {\n      $_tmp26 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\terse_write\\MyUnion>($parsed['union_field']));\n      $_tmp27 = \\facebook\\thrift\\test\\terse_write\\MyUnion::withDefaultValues();\n      $_tmp27->readFromJson($_tmp26);\n      $this->union_field = $_tmp27;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * FieldLevelTerseStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/terse_write/FieldLevelTerseStruct'))>>\nclass FieldLevelTerseStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'terse_bool_field',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    2 => shape(\n      'var' => 'terse_byte_field',\n      'is_terse' => true,\n      'type' => \\TType::BYTE,\n    ),\n    3 => shape(\n      'var' => 'terse_short_field',\n      'is_terse' => true,\n      'type' => \\TType::I16,\n    ),\n    4 => shape(\n      'var' => 'terse_int_field',\n      'is_terse' => true,\n      'type' => \\TType::I32,\n    ),\n    5 => shape(\n      'var' => 'terse_long_field',\n      'is_terse' => true,\n      'type' => \\TType::I64,\n    ),\n    6 => shape(\n      'var' => 'terse_float_field',\n      'is_terse' => true,\n      'type' => \\TType::FLOAT,\n    ),\n    7 => shape(\n      'var' => 'terse_double_field',\n      'is_terse' => true,\n      'type' => \\TType::DOUBLE,\n    ),\n    8 => shape(\n      'var' => 'terse_string_field',\n      'is_terse' => true,\n      'type' => \\TType::STRING,\n    ),\n    9 => shape(\n      'var' => 'terse_binary_field',\n      'is_terse' => true,\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    10 => shape(\n      'var' => 'terse_enum_field',\n      'is_terse' => true,\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\test\\terse_write\\MyEnum::class,\n    ),\n    11 => shape(\n      'var' => 'terse_list_field',\n      'is_terse' => true,\n      'type' => \\TType::LST,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    12 => shape(\n      'var' => 'terse_set_field',\n      'is_terse' => true,\n      'type' => \\TType::SET,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    13 => shape(\n      'var' => 'terse_map_field',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I16,\n      'vtype' => \\TType::I16,\n      'key' => shape(\n        'type' => \\TType::I16,\n      ),\n      'val' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    14 => shape(\n      'var' => 'terse_struct_field',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\terse_write\\MyStruct::class,\n    ),\n    29 => shape(\n      'var' => 'terse_union_field',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\terse_write\\MyUnion::class,\n    ),\n    15 => shape(\n      'var' => 'bool_field',\n      'type' => \\TType::BOOL,\n    ),\n    16 => shape(\n      'var' => 'byte_field',\n      'type' => \\TType::BYTE,\n    ),\n    17 => shape(\n      'var' => 'short_field',\n      'type' => \\TType::I16,\n    ),\n    18 => shape(\n      'var' => 'int_field',\n      'type' => \\TType::I32,\n    ),\n    19 => shape(\n      'var' => 'long_field',\n      'type' => \\TType::I64,\n    ),\n    20 => shape(\n      'var' => 'float_field',\n      'type' => \\TType::FLOAT,\n    ),\n    21 => shape(\n      'var' => 'double_field',\n      'type' => \\TType::DOUBLE,\n    ),\n    22 => shape(\n      'var' => 'string_field',\n      'type' => \\TType::STRING,\n    ),\n    23 => shape(\n      'var' => 'binary_field',\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    24 => shape(\n      'var' => 'enum_field',\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\test\\terse_write\\MyEnum::class,\n    ),\n    25 => shape(\n      'var' => 'list_field',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    26 => shape(\n      'var' => 'set_field',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    27 => shape(\n      'var' => 'map_field',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I16,\n      'vtype' => \\TType::I16,\n      'key' => shape(\n        'type' => \\TType::I16,\n      ),\n      'val' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    28 => shape(\n      'var' => 'struct_field',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\terse_write\\MyStruct::class,\n    ),\n    30 => shape(\n      'var' => 'union_field',\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\terse_write\\MyUnion::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'terse_bool_field' => 1,\n    'terse_byte_field' => 2,\n    'terse_short_field' => 3,\n    'terse_int_field' => 4,\n    'terse_long_field' => 5,\n    'terse_float_field' => 6,\n    'terse_double_field' => 7,\n    'terse_string_field' => 8,\n    'terse_binary_field' => 9,\n    'terse_enum_field' => 10,\n    'terse_list_field' => 11,\n    'terse_set_field' => 12,\n    'terse_map_field' => 13,\n    'terse_struct_field' => 14,\n    'terse_union_field' => 29,\n    'bool_field' => 15,\n    'byte_field' => 16,\n    'short_field' => 17,\n    'int_field' => 18,\n    'long_field' => 19,\n    'float_field' => 20,\n    'double_field' => 21,\n    'string_field' => 22,\n    'binary_field' => 23,\n    'enum_field' => 24,\n    'list_field' => 25,\n    'set_field' => 26,\n    'map_field' => 27,\n    'struct_field' => 28,\n    'union_field' => 30,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'terse_bool_field' => ?bool,\n    ?'terse_byte_field' => ?int,\n    ?'terse_short_field' => ?int,\n    ?'terse_int_field' => ?int,\n    ?'terse_long_field' => ?int,\n    ?'terse_float_field' => ?float,\n    ?'terse_double_field' => ?float,\n    ?'terse_string_field' => ?string,\n    ?'terse_binary_field' => ?string,\n    ?'terse_enum_field' => ?\\facebook\\thrift\\test\\terse_write\\MyEnum,\n    ?'terse_list_field' => ?Vector<int>,\n    ?'terse_set_field' => ?Set<int>,\n    ?'terse_map_field' => ?Map<int, int>,\n    ?'terse_struct_field' => ?\\facebook\\thrift\\test\\terse_write\\MyStruct,\n    ?'terse_union_field' => ?\\facebook\\thrift\\test\\terse_write\\MyUnion,\n    ?'bool_field' => ?bool,\n    ?'byte_field' => ?int,\n    ?'short_field' => ?int,\n    ?'int_field' => ?int,\n    ?'long_field' => ?int,\n    ?'float_field' => ?float,\n    ?'double_field' => ?float,\n    ?'string_field' => ?string,\n    ?'binary_field' => ?string,\n    ?'enum_field' => ?\\facebook\\thrift\\test\\terse_write\\MyEnum,\n    ?'list_field' => ?Vector<int>,\n    ?'set_field' => ?Set<int>,\n    ?'map_field' => ?Map<int, int>,\n    ?'struct_field' => ?\\facebook\\thrift\\test\\terse_write\\MyStruct,\n    ?'union_field' => ?\\facebook\\thrift\\test\\terse_write\\MyUnion,\n  );\n\n  const type TShape = shape(\n    'terse_bool_field' => bool,\n    'terse_byte_field' => int,\n    'terse_short_field' => int,\n    'terse_int_field' => int,\n    'terse_long_field' => int,\n    'terse_float_field' => float,\n    'terse_double_field' => float,\n    'terse_string_field' => string,\n    'terse_binary_field' => string,\n    ?'terse_enum_field' => ?\\facebook\\thrift\\test\\terse_write\\MyEnum,\n    'terse_list_field' => vec<int>,\n    'terse_set_field' => dict<int, bool>,\n    'terse_map_field' => dict<int, int>,\n    ?'terse_struct_field' => ?\\facebook\\thrift\\test\\terse_write\\MyStruct::TShape,\n    ?'terse_union_field' => ?\\facebook\\thrift\\test\\terse_write\\MyUnion::TShape,\n    'bool_field' => bool,\n    'byte_field' => int,\n    'short_field' => int,\n    'int_field' => int,\n    'long_field' => int,\n    'float_field' => float,\n    'double_field' => float,\n    'string_field' => string,\n    'binary_field' => string,\n    ?'enum_field' => ?\\facebook\\thrift\\test\\terse_write\\MyEnum,\n    'list_field' => vec<int>,\n    'set_field' => dict<int, bool>,\n    'map_field' => dict<int, int>,\n    ?'struct_field' => ?\\facebook\\thrift\\test\\terse_write\\MyStruct::TShape,\n    ?'union_field' => ?\\facebook\\thrift\\test\\terse_write\\MyUnion::TShape,\n    ...\n  );\n  const int STRUCTURAL_ID = 8495142353295299602;\n  /**\n   * Original thrift field:-\n   * 1: bool terse_bool_field\n   */\n  public bool $terse_bool_field;\n  /**\n   * Original thrift field:-\n   * 2: byte terse_byte_field\n   */\n  public int $terse_byte_field;\n  /**\n   * Original thrift field:-\n   * 3: i16 terse_short_field\n   */\n  public int $terse_short_field;\n  /**\n   * Original thrift field:-\n   * 4: i32 terse_int_field\n   */\n  public int $terse_int_field;\n  /**\n   * Original thrift field:-\n   * 5: i64 terse_long_field\n   */\n  public int $terse_long_field;\n  /**\n   * Original thrift field:-\n   * 6: float terse_float_field\n   */\n  public float $terse_float_field;\n  /**\n   * Original thrift field:-\n   * 7: double terse_double_field\n   */\n  public float $terse_double_field;\n  /**\n   * Original thrift field:-\n   * 8: string terse_string_field\n   */\n  public string $terse_string_field;\n  /**\n   * Original thrift field:-\n   * 9: binary terse_binary_field\n   */\n  public string $terse_binary_field;\n  /**\n   * Original thrift field:-\n   * 10: terse_write.MyEnum terse_enum_field\n   */\n  public ?\\facebook\\thrift\\test\\terse_write\\MyEnum $terse_enum_field;\n  /**\n   * Original thrift field:-\n   * 11: list<i16> terse_list_field\n   */\n  public Vector<int> $terse_list_field;\n  /**\n   * Original thrift field:-\n   * 12: set<i16> terse_set_field\n   */\n  public Set<int> $terse_set_field;\n  /**\n   * Original thrift field:-\n   * 13: map<i16, i16> terse_map_field\n   */\n  public Map<int, int> $terse_map_field;\n  /**\n   * Original thrift field:-\n   * 14: terse_write.MyStruct terse_struct_field\n   */\n  public ?\\facebook\\thrift\\test\\terse_write\\MyStruct $terse_struct_field;\n  /**\n   * Original thrift field:-\n   * 29: terse_write.MyUnion terse_union_field\n   */\n  public ?\\facebook\\thrift\\test\\terse_write\\MyUnion $terse_union_field;\n  /**\n   * Original thrift field:-\n   * 15: bool bool_field\n   */\n  public bool $bool_field;\n  /**\n   * Original thrift field:-\n   * 16: byte byte_field\n   */\n  public int $byte_field;\n  /**\n   * Original thrift field:-\n   * 17: i16 short_field\n   */\n  public int $short_field;\n  /**\n   * Original thrift field:-\n   * 18: i32 int_field\n   */\n  public int $int_field;\n  /**\n   * Original thrift field:-\n   * 19: i64 long_field\n   */\n  public int $long_field;\n  /**\n   * Original thrift field:-\n   * 20: float float_field\n   */\n  public float $float_field;\n  /**\n   * Original thrift field:-\n   * 21: double double_field\n   */\n  public float $double_field;\n  /**\n   * Original thrift field:-\n   * 22: string string_field\n   */\n  public string $string_field;\n  /**\n   * Original thrift field:-\n   * 23: binary binary_field\n   */\n  public string $binary_field;\n  /**\n   * Original thrift field:-\n   * 24: terse_write.MyEnum enum_field\n   */\n  public ?\\facebook\\thrift\\test\\terse_write\\MyEnum $enum_field;\n  /**\n   * Original thrift field:-\n   * 25: list<i16> list_field\n   */\n  public Vector<int> $list_field;\n  /**\n   * Original thrift field:-\n   * 26: set<i16> set_field\n   */\n  public Set<int> $set_field;\n  /**\n   * Original thrift field:-\n   * 27: map<i16, i16> map_field\n   */\n  public Map<int, int> $map_field;\n  /**\n   * Original thrift field:-\n   * 28: terse_write.MyStruct struct_field\n   */\n  public ?\\facebook\\thrift\\test\\terse_write\\MyStruct $struct_field;\n  /**\n   * Original thrift field:-\n   * 30: terse_write.MyUnion union_field\n   */\n  public ?\\facebook\\thrift\\test\\terse_write\\MyUnion $union_field;\n\n  public function __construct(?bool $terse_bool_field = null, ?int $terse_byte_field = null, ?int $terse_short_field = null, ?int $terse_int_field = null, ?int $terse_long_field = null, ?float $terse_float_field = null, ?float $terse_double_field = null, ?string $terse_string_field = null, ?string $terse_binary_field = null, ?\\facebook\\thrift\\test\\terse_write\\MyEnum $terse_enum_field = null, ?Vector<int> $terse_list_field = null, ?Set<int> $terse_set_field = null, ?Map<int, int> $terse_map_field = null, ?\\facebook\\thrift\\test\\terse_write\\MyStruct $terse_struct_field = null, ?\\facebook\\thrift\\test\\terse_write\\MyUnion $terse_union_field = null, ?bool $bool_field = null, ?int $byte_field = null, ?int $short_field = null, ?int $int_field = null, ?int $long_field = null, ?float $float_field = null, ?float $double_field = null, ?string $string_field = null, ?string $binary_field = null, ?\\facebook\\thrift\\test\\terse_write\\MyEnum $enum_field = null, ?Vector<int> $list_field = null, ?Set<int> $set_field = null, ?Map<int, int> $map_field = null, ?\\facebook\\thrift\\test\\terse_write\\MyStruct $struct_field = null, ?\\facebook\\thrift\\test\\terse_write\\MyUnion $union_field = null)[] {\n    $this->terse_bool_field = $terse_bool_field ?? false;\n    $this->terse_byte_field = $terse_byte_field ?? 0;\n    $this->terse_short_field = $terse_short_field ?? 0;\n    $this->terse_int_field = $terse_int_field ?? 0;\n    $this->terse_long_field = $terse_long_field ?? 0;\n    $this->terse_float_field = $terse_float_field ?? 0.0;\n    $this->terse_double_field = $terse_double_field ?? 0.0;\n    $this->terse_string_field = $terse_string_field ?? '';\n    $this->terse_binary_field = $terse_binary_field ?? '';\n    $this->terse_enum_field = $terse_enum_field;\n    $this->terse_list_field = $terse_list_field ?? Vector {};\n    $this->terse_set_field = $terse_set_field ?? Set {};\n    $this->terse_map_field = $terse_map_field ?? Map {};\n    $this->terse_struct_field = $terse_struct_field;\n    $this->terse_union_field = $terse_union_field;\n    $this->bool_field = $bool_field ?? false;\n    $this->byte_field = $byte_field ?? 0;\n    $this->short_field = $short_field ?? 0;\n    $this->int_field = $int_field ?? 0;\n    $this->long_field = $long_field ?? 0;\n    $this->float_field = $float_field ?? 0.0;\n    $this->double_field = $double_field ?? 0.0;\n    $this->string_field = $string_field ?? '';\n    $this->binary_field = $binary_field ?? '';\n    $this->enum_field = $enum_field;\n    $this->list_field = $list_field ?? Vector {};\n    $this->set_field = $set_field ?? Set {};\n    $this->map_field = $map_field ?? Map {};\n    $this->struct_field = $struct_field;\n    $this->union_field = $union_field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'terse_bool_field'),\n      Shapes::idx($shape, 'terse_byte_field'),\n      Shapes::idx($shape, 'terse_short_field'),\n      Shapes::idx($shape, 'terse_int_field'),\n      Shapes::idx($shape, 'terse_long_field'),\n      Shapes::idx($shape, 'terse_float_field'),\n      Shapes::idx($shape, 'terse_double_field'),\n      Shapes::idx($shape, 'terse_string_field'),\n      Shapes::idx($shape, 'terse_binary_field'),\n      Shapes::idx($shape, 'terse_enum_field'),\n      Shapes::idx($shape, 'terse_list_field'),\n      Shapes::idx($shape, 'terse_set_field'),\n      Shapes::idx($shape, 'terse_map_field'),\n      Shapes::idx($shape, 'terse_struct_field'),\n      Shapes::idx($shape, 'terse_union_field'),\n      Shapes::idx($shape, 'bool_field'),\n      Shapes::idx($shape, 'byte_field'),\n      Shapes::idx($shape, 'short_field'),\n      Shapes::idx($shape, 'int_field'),\n      Shapes::idx($shape, 'long_field'),\n      Shapes::idx($shape, 'float_field'),\n      Shapes::idx($shape, 'double_field'),\n      Shapes::idx($shape, 'string_field'),\n      Shapes::idx($shape, 'binary_field'),\n      Shapes::idx($shape, 'enum_field'),\n      Shapes::idx($shape, 'list_field'),\n      Shapes::idx($shape, 'set_field'),\n      Shapes::idx($shape, 'map_field'),\n      Shapes::idx($shape, 'struct_field'),\n      Shapes::idx($shape, 'union_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldLevelTerseStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->terse_bool_field = false;\n    $this->terse_byte_field = 0;\n    $this->terse_short_field = 0;\n    $this->terse_int_field = 0;\n    $this->terse_long_field = 0;\n    $this->terse_float_field = 0.0;\n    $this->terse_double_field = 0.0;\n    $this->terse_string_field = '';\n    $this->terse_binary_field = '';\n    $this->terse_enum_field = null;\n    $this->terse_list_field = Vector {};\n    $this->terse_set_field = Set {};\n    $this->terse_map_field = Map {};\n    $this->terse_struct_field = null;\n    $this->terse_union_field = null;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"terse_write.FieldLevelTerseStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"terse_bool_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                )\n              ),\n              \"name\" => \"terse_byte_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                )\n              ),\n              \"name\" => \"terse_short_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"terse_int_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"terse_long_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_FLOAT_TYPE,\n                )\n              ),\n              \"name\" => \"terse_float_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"terse_double_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"terse_string_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"terse_binary_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 10,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"terse_write.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"terse_enum_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 11,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"terse_list_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 12,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"terse_set_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 13,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"terse_map_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 14,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"terse_write.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"terse_struct_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 29,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"terse_write.MyUnion\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"terse_union_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 15,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"bool_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 16,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                )\n              ),\n              \"name\" => \"byte_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 17,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                )\n              ),\n              \"name\" => \"short_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 18,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"int_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 19,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"long_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 20,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_FLOAT_TYPE,\n                )\n              ),\n              \"name\" => \"float_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 21,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"double_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 22,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"string_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 23,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"binary_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 24,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"terse_write.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"enum_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 25,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 26,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"set_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 27,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 28,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"terse_write.MyStruct\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"struct_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 30,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"terse_write.MyUnion\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"union_field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'terse_bool_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'terse_byte_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'terse_short_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'terse_int_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'terse_long_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'terse_float_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'terse_double_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'terse_string_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'terse_binary_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'terse_enum_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'terse_list_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'terse_set_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'terse_map_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'terse_struct_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'terse_union_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['terse_bool_field'],\n      $shape['terse_byte_field'],\n      $shape['terse_short_field'],\n      $shape['terse_int_field'],\n      $shape['terse_long_field'],\n      $shape['terse_float_field'],\n      $shape['terse_double_field'],\n      $shape['terse_string_field'],\n      $shape['terse_binary_field'],\n      Shapes::idx($shape, 'terse_enum_field'),\n      $shape['terse_list_field'] |> new Vector($$),\n      new Set(Keyset\\keys($shape['terse_set_field'])),\n      $shape['terse_map_field'] |> new Map($$),\n      Shapes::idx($shape, 'terse_struct_field') === null ? null : (\\facebook\\thrift\\test\\terse_write\\MyStruct::__fromShape($shape['terse_struct_field'])),\n      Shapes::idx($shape, 'terse_union_field') === null ? null : (\\facebook\\thrift\\test\\terse_write\\MyUnion::__fromShape($shape['terse_union_field'])),\n      $shape['bool_field'],\n      $shape['byte_field'],\n      $shape['short_field'],\n      $shape['int_field'],\n      $shape['long_field'],\n      $shape['float_field'],\n      $shape['double_field'],\n      $shape['string_field'],\n      $shape['binary_field'],\n      Shapes::idx($shape, 'enum_field'),\n      $shape['list_field'] |> new Vector($$),\n      new Set(Keyset\\keys($shape['set_field'])),\n      $shape['map_field'] |> new Map($$),\n      Shapes::idx($shape, 'struct_field') === null ? null : (\\facebook\\thrift\\test\\terse_write\\MyStruct::__fromShape($shape['struct_field'])),\n      Shapes::idx($shape, 'union_field') === null ? null : (\\facebook\\thrift\\test\\terse_write\\MyUnion::__fromShape($shape['union_field'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'terse_bool_field' => $this->terse_bool_field,\n      'terse_byte_field' => $this->terse_byte_field,\n      'terse_short_field' => $this->terse_short_field,\n      'terse_int_field' => $this->terse_int_field,\n      'terse_long_field' => $this->terse_long_field,\n      'terse_float_field' => $this->terse_float_field,\n      'terse_double_field' => $this->terse_double_field,\n      'terse_string_field' => $this->terse_string_field,\n      'terse_binary_field' => $this->terse_binary_field,\n      'terse_enum_field' => $this->terse_enum_field,\n      'terse_list_field' => vec($this->terse_list_field),\n      'terse_set_field' => ThriftUtil::toDArray(Dict\\fill_keys($this->terse_set_field->toValuesArray(), true), static::class),\n      'terse_map_field' => dict($this->terse_map_field),\n      'terse_struct_field' => $this->terse_struct_field?->__toShape(),\n      'terse_union_field' => $this->terse_union_field?->__toShape(),\n      'bool_field' => $this->bool_field,\n      'byte_field' => $this->byte_field,\n      'short_field' => $this->short_field,\n      'int_field' => $this->int_field,\n      'long_field' => $this->long_field,\n      'float_field' => $this->float_field,\n      'double_field' => $this->double_field,\n      'string_field' => $this->string_field,\n      'binary_field' => $this->binary_field,\n      'enum_field' => $this->enum_field,\n      'list_field' => vec($this->list_field),\n      'set_field' => ThriftUtil::toDArray(Dict\\fill_keys($this->set_field->toValuesArray(), true), static::class),\n      'map_field' => dict($this->map_field),\n      'struct_field' => $this->struct_field?->__toShape(),\n      'union_field' => $this->union_field?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'terse_bool_field') !== null) {\n      $this->terse_bool_field = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['terse_bool_field']);\n    }\n    if (idx($parsed, 'terse_byte_field') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['terse_byte_field']);\n      if ($_tmp0 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->terse_byte_field = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'terse_short_field') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['terse_short_field']);\n      if ($_tmp1 > 0x7fff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->terse_short_field = (int)$_tmp1;\n      }\n    }\n    if (idx($parsed, 'terse_int_field') !== null) {\n      $_tmp2 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['terse_int_field']);\n      if ($_tmp2 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->terse_int_field = (int)$_tmp2;\n      }\n    }\n    if (idx($parsed, 'terse_long_field') !== null) {\n      $this->terse_long_field = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['terse_long_field']);\n    }\n    if (idx($parsed, 'terse_float_field') !== null) {\n      $this->terse_float_field = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['terse_float_field']);\n    }\n    if (idx($parsed, 'terse_double_field') !== null) {\n      $this->terse_double_field = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['terse_double_field']);\n    }\n    if (idx($parsed, 'terse_string_field') !== null) {\n      $this->terse_string_field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['terse_string_field']);\n    }\n    if (idx($parsed, 'terse_binary_field') !== null) {\n      $this->terse_binary_field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['terse_binary_field']);\n    }\n    if (idx($parsed, 'terse_enum_field') !== null) {\n      $this->terse_enum_field = \\facebook\\thrift\\test\\terse_write\\MyEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\terse_write\\MyEnum>($parsed['terse_enum_field']));\n    }\n    if (idx($parsed, 'terse_list_field') !== null) {\n      $_json6 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['terse_list_field']);\n      $_container7 = Vector {};\n      foreach($_json6 as $_key4 => $_value5) {\n        $_elem8 = 0;\n        $_tmp9 = (int)$_value5;\n        if ($_tmp9 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem8 = (int)$_tmp9;\n        }\n        $_container7 []= $_elem8;\n      }\n      $this->terse_list_field = $_container7;\n    }\n    if (idx($parsed, 'terse_set_field') !== null) {\n      $_json13 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['terse_set_field']);\n      $_container14 = Set {};\n      foreach($_json13 as $_key11 => $_value12) {\n        $_elem15 = 0;\n        $_tmp16 = (int)$_value12;\n        if ($_tmp16 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem15 = (int)$_tmp16;\n        }\n        $_container14->add($_elem15);\n      }\n      $this->terse_set_field = $_container14;\n    }\n    if (idx($parsed, 'terse_map_field') !== null) {\n      $_json20 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, int>>($parsed['terse_map_field']);\n      $_container21 = Map {};\n      foreach($_json20 as $_key18 => $_value19) {\n        $_value22 = 0;\n        $_tmp23 = (int)$_value19;\n        if ($_tmp23 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value22 = (int)$_tmp23;\n        }\n        $_container21[$_key18] = $_value22;\n      }\n      $this->terse_map_field = $_container21;\n    }\n    if (idx($parsed, 'terse_struct_field') !== null) {\n      $_tmp24 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\terse_write\\MyStruct>($parsed['terse_struct_field']));\n      $_tmp25 = \\facebook\\thrift\\test\\terse_write\\MyStruct::withDefaultValues();\n      $_tmp25->readFromJson($_tmp24);\n      $this->terse_struct_field = $_tmp25;\n    }\n    if (idx($parsed, 'terse_union_field') !== null) {\n      $_tmp26 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\terse_write\\MyUnion>($parsed['terse_union_field']));\n      $_tmp27 = \\facebook\\thrift\\test\\terse_write\\MyUnion::withDefaultValues();\n      $_tmp27->readFromJson($_tmp26);\n      $this->terse_union_field = $_tmp27;\n    }\n    if (idx($parsed, 'bool_field') !== null) {\n      $this->bool_field = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['bool_field']);\n    }\n    if (idx($parsed, 'byte_field') !== null) {\n      $_tmp28 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['byte_field']);\n      if ($_tmp28 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->byte_field = (int)$_tmp28;\n      }\n    }\n    if (idx($parsed, 'short_field') !== null) {\n      $_tmp29 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['short_field']);\n      if ($_tmp29 > 0x7fff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->short_field = (int)$_tmp29;\n      }\n    }\n    if (idx($parsed, 'int_field') !== null) {\n      $_tmp30 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['int_field']);\n      if ($_tmp30 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->int_field = (int)$_tmp30;\n      }\n    }\n    if (idx($parsed, 'long_field') !== null) {\n      $this->long_field = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['long_field']);\n    }\n    if (idx($parsed, 'float_field') !== null) {\n      $this->float_field = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['float_field']);\n    }\n    if (idx($parsed, 'double_field') !== null) {\n      $this->double_field = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['double_field']);\n    }\n    if (idx($parsed, 'string_field') !== null) {\n      $this->string_field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['string_field']);\n    }\n    if (idx($parsed, 'binary_field') !== null) {\n      $this->binary_field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['binary_field']);\n    }\n    if (idx($parsed, 'enum_field') !== null) {\n      $this->enum_field = \\facebook\\thrift\\test\\terse_write\\MyEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\terse_write\\MyEnum>($parsed['enum_field']));\n    }\n    if (idx($parsed, 'list_field') !== null) {\n      $_json34 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['list_field']);\n      $_container35 = Vector {};\n      foreach($_json34 as $_key32 => $_value33) {\n        $_elem36 = 0;\n        $_tmp37 = (int)$_value33;\n        if ($_tmp37 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem36 = (int)$_tmp37;\n        }\n        $_container35 []= $_elem36;\n      }\n      $this->list_field = $_container35;\n    }\n    if (idx($parsed, 'set_field') !== null) {\n      $_json41 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['set_field']);\n      $_container42 = Set {};\n      foreach($_json41 as $_key39 => $_value40) {\n        $_elem43 = 0;\n        $_tmp44 = (int)$_value40;\n        if ($_tmp44 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem43 = (int)$_tmp44;\n        }\n        $_container42->add($_elem43);\n      }\n      $this->set_field = $_container42;\n    }\n    if (idx($parsed, 'map_field') !== null) {\n      $_json48 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, int>>($parsed['map_field']);\n      $_container49 = Map {};\n      foreach($_json48 as $_key46 => $_value47) {\n        $_value50 = 0;\n        $_tmp51 = (int)$_value47;\n        if ($_tmp51 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value50 = (int)$_tmp51;\n        }\n        $_container49[$_key46] = $_value50;\n      }\n      $this->map_field = $_container49;\n    }\n    if (idx($parsed, 'struct_field') !== null) {\n      $_tmp52 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\terse_write\\MyStruct>($parsed['struct_field']));\n      $_tmp53 = \\facebook\\thrift\\test\\terse_write\\MyStruct::withDefaultValues();\n      $_tmp53->readFromJson($_tmp52);\n      $this->struct_field = $_tmp53;\n    }\n    if (idx($parsed, 'union_field') !== null) {\n      $_tmp54 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\terse_write\\MyUnion>($parsed['union_field']));\n      $_tmp55 = \\facebook\\thrift\\test\\terse_write\\MyUnion::withDefaultValues();\n      $_tmp55->readFromJson($_tmp54);\n      $this->union_field = $_tmp55;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * TerseStructWithCustomDefault\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/terse_write/TerseStructWithCustomDefault'))>>\nclass TerseStructWithCustomDefault implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'bool_field',\n      'is_terse' => true,\n      'type' => \\TType::BOOL,\n    ),\n    2 => shape(\n      'var' => 'byte_field',\n      'is_terse' => true,\n      'type' => \\TType::BYTE,\n    ),\n    3 => shape(\n      'var' => 'short_field',\n      'is_terse' => true,\n      'type' => \\TType::I16,\n    ),\n    4 => shape(\n      'var' => 'int_field',\n      'is_terse' => true,\n      'type' => \\TType::I32,\n    ),\n    5 => shape(\n      'var' => 'long_field',\n      'is_terse' => true,\n      'type' => \\TType::I64,\n    ),\n    6 => shape(\n      'var' => 'float_field',\n      'is_terse' => true,\n      'type' => \\TType::FLOAT,\n    ),\n    7 => shape(\n      'var' => 'double_field',\n      'is_terse' => true,\n      'type' => \\TType::DOUBLE,\n    ),\n    8 => shape(\n      'var' => 'string_field',\n      'is_terse' => true,\n      'type' => \\TType::STRING,\n    ),\n    9 => shape(\n      'var' => 'binary_field',\n      'is_terse' => true,\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    10 => shape(\n      'var' => 'enum_field',\n      'is_terse' => true,\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\test\\terse_write\\MyEnum::class,\n    ),\n    11 => shape(\n      'var' => 'list_field',\n      'is_terse' => true,\n      'type' => \\TType::LST,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    12 => shape(\n      'var' => 'set_field',\n      'is_terse' => true,\n      'type' => \\TType::SET,\n      'etype' => \\TType::I16,\n      'elem' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    13 => shape(\n      'var' => 'map_field',\n      'is_terse' => true,\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I16,\n      'vtype' => \\TType::I16,\n      'key' => shape(\n        'type' => \\TType::I16,\n      ),\n      'val' => shape(\n        'type' => \\TType::I16,\n      ),\n      'format' => 'collection',\n    ),\n    14 => shape(\n      'var' => 'struct_field',\n      'is_terse' => true,\n      'type' => \\TType::STRUCT,\n      'class' => \\facebook\\thrift\\test\\terse_write\\MyStructWithCustomDefault::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'bool_field' => 1,\n    'byte_field' => 2,\n    'short_field' => 3,\n    'int_field' => 4,\n    'long_field' => 5,\n    'float_field' => 6,\n    'double_field' => 7,\n    'string_field' => 8,\n    'binary_field' => 9,\n    'enum_field' => 10,\n    'list_field' => 11,\n    'set_field' => 12,\n    'map_field' => 13,\n    'struct_field' => 14,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'bool_field' => ?bool,\n    ?'byte_field' => ?int,\n    ?'short_field' => ?int,\n    ?'int_field' => ?int,\n    ?'long_field' => ?int,\n    ?'float_field' => ?float,\n    ?'double_field' => ?float,\n    ?'string_field' => ?string,\n    ?'binary_field' => ?string,\n    ?'enum_field' => ?\\facebook\\thrift\\test\\terse_write\\MyEnum,\n    ?'list_field' => ?Vector<int>,\n    ?'set_field' => ?Set<int>,\n    ?'map_field' => ?Map<int, int>,\n    ?'struct_field' => ?\\facebook\\thrift\\test\\terse_write\\MyStructWithCustomDefault,\n  );\n\n  const type TShape = shape(\n    'bool_field' => bool,\n    'byte_field' => int,\n    'short_field' => int,\n    'int_field' => int,\n    'long_field' => int,\n    'float_field' => float,\n    'double_field' => float,\n    'string_field' => string,\n    'binary_field' => string,\n    ?'enum_field' => ?\\facebook\\thrift\\test\\terse_write\\MyEnum,\n    'list_field' => vec<int>,\n    'set_field' => dict<int, bool>,\n    'map_field' => dict<int, int>,\n    ?'struct_field' => ?\\facebook\\thrift\\test\\terse_write\\MyStructWithCustomDefault::TShape,\n    ...\n  );\n  const int STRUCTURAL_ID = 3545739898930729460;\n  /**\n   * Original thrift field:-\n   * 1: bool bool_field\n   */\n  public bool $bool_field;\n  /**\n   * Original thrift field:-\n   * 2: byte byte_field\n   */\n  public int $byte_field;\n  /**\n   * Original thrift field:-\n   * 3: i16 short_field\n   */\n  public int $short_field;\n  /**\n   * Original thrift field:-\n   * 4: i32 int_field\n   */\n  public int $int_field;\n  /**\n   * Original thrift field:-\n   * 5: i64 long_field\n   */\n  public int $long_field;\n  /**\n   * Original thrift field:-\n   * 6: float float_field\n   */\n  public float $float_field;\n  /**\n   * Original thrift field:-\n   * 7: double double_field\n   */\n  public float $double_field;\n  /**\n   * Original thrift field:-\n   * 8: string string_field\n   */\n  public string $string_field;\n  /**\n   * Original thrift field:-\n   * 9: binary binary_field\n   */\n  public string $binary_field;\n  /**\n   * Original thrift field:-\n   * 10: terse_write.MyEnum enum_field\n   */\n  public ?\\facebook\\thrift\\test\\terse_write\\MyEnum $enum_field;\n  /**\n   * Original thrift field:-\n   * 11: list<i16> list_field\n   */\n  public Vector<int> $list_field;\n  /**\n   * Original thrift field:-\n   * 12: set<i16> set_field\n   */\n  public Set<int> $set_field;\n  /**\n   * Original thrift field:-\n   * 13: map<i16, i16> map_field\n   */\n  public Map<int, int> $map_field;\n  /**\n   * Original thrift field:-\n   * 14: terse_write.MyStructWithCustomDefault struct_field\n   */\n  public ?\\facebook\\thrift\\test\\terse_write\\MyStructWithCustomDefault $struct_field;\n\n  public function __construct(?bool $bool_field = null, ?int $byte_field = null, ?int $short_field = null, ?int $int_field = null, ?int $long_field = null, ?float $float_field = null, ?float $double_field = null, ?string $string_field = null, ?string $binary_field = null, ?\\facebook\\thrift\\test\\terse_write\\MyEnum $enum_field = null, ?Vector<int> $list_field = null, ?Set<int> $set_field = null, ?Map<int, int> $map_field = null, ?\\facebook\\thrift\\test\\terse_write\\MyStructWithCustomDefault $struct_field = null)[] {\n    $this->bool_field = $bool_field ?? true;\n    $this->byte_field = $byte_field ?? 1;\n    $this->short_field = $short_field ?? 2;\n    $this->int_field = $int_field ?? 3;\n    $this->long_field = $long_field ?? 4;\n    $this->float_field = $float_field ?? 5.0;\n    $this->double_field = $double_field ?? 6.0;\n    $this->string_field = $string_field ?? \"7\";\n    $this->binary_field = $binary_field ?? \"8\";\n    $this->enum_field = $enum_field ?? \\facebook\\thrift\\test\\terse_write\\MyEnum::ME1;\n    $this->list_field = $list_field ?? Vector {\n      1,\n    };\n    $this->set_field = $set_field ?? Set {\n      1,\n    };\n    $this->map_field = $map_field ?? Map {\n      1 => 1,\n    };\n    $this->struct_field = $struct_field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'bool_field'),\n      Shapes::idx($shape, 'byte_field'),\n      Shapes::idx($shape, 'short_field'),\n      Shapes::idx($shape, 'int_field'),\n      Shapes::idx($shape, 'long_field'),\n      Shapes::idx($shape, 'float_field'),\n      Shapes::idx($shape, 'double_field'),\n      Shapes::idx($shape, 'string_field'),\n      Shapes::idx($shape, 'binary_field'),\n      Shapes::idx($shape, 'enum_field'),\n      Shapes::idx($shape, 'list_field'),\n      Shapes::idx($shape, 'set_field'),\n      Shapes::idx($shape, 'map_field'),\n      Shapes::idx($shape, 'struct_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TerseStructWithCustomDefault';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->bool_field = false;\n    $this->byte_field = 0;\n    $this->short_field = 0;\n    $this->int_field = 0;\n    $this->long_field = 0;\n    $this->float_field = 0.0;\n    $this->double_field = 0.0;\n    $this->string_field = '';\n    $this->binary_field = '';\n    $this->enum_field = null;\n    $this->list_field = Vector {};\n    $this->set_field = Set {};\n    $this->map_field = Map {};\n    $this->struct_field = null;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"terse_write.TerseStructWithCustomDefault\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"bool_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                )\n              ),\n              \"name\" => \"byte_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                )\n              ),\n              \"name\" => \"short_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"int_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"long_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_FLOAT_TYPE,\n                )\n              ),\n              \"name\" => \"float_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_DOUBLE_TYPE,\n                )\n              ),\n              \"name\" => \"double_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"string_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 9,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                )\n              ),\n              \"name\" => \"binary_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 10,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"terse_write.MyEnum\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"enum_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 11,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 12,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"set_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 13,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"map_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 14,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"terse_write.MyStructWithCustomDefault\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"struct_field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['bool_field'],\n      $shape['byte_field'],\n      $shape['short_field'],\n      $shape['int_field'],\n      $shape['long_field'],\n      $shape['float_field'],\n      $shape['double_field'],\n      $shape['string_field'],\n      $shape['binary_field'],\n      Shapes::idx($shape, 'enum_field'),\n      $shape['list_field'] |> new Vector($$),\n      new Set(Keyset\\keys($shape['set_field'])),\n      $shape['map_field'] |> new Map($$),\n      Shapes::idx($shape, 'struct_field') === null ? null : (\\facebook\\thrift\\test\\terse_write\\MyStructWithCustomDefault::__fromShape($shape['struct_field'])),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'bool_field' => $this->bool_field,\n      'byte_field' => $this->byte_field,\n      'short_field' => $this->short_field,\n      'int_field' => $this->int_field,\n      'long_field' => $this->long_field,\n      'float_field' => $this->float_field,\n      'double_field' => $this->double_field,\n      'string_field' => $this->string_field,\n      'binary_field' => $this->binary_field,\n      'enum_field' => $this->enum_field,\n      'list_field' => vec($this->list_field),\n      'set_field' => ThriftUtil::toDArray(Dict\\fill_keys($this->set_field->toValuesArray(), true), static::class),\n      'map_field' => dict($this->map_field),\n      'struct_field' => $this->struct_field?->__toShape(),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'bool_field') !== null) {\n      $this->bool_field = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['bool_field']);\n    }\n    if (idx($parsed, 'byte_field') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['byte_field']);\n      if ($_tmp0 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->byte_field = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'short_field') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['short_field']);\n      if ($_tmp1 > 0x7fff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->short_field = (int)$_tmp1;\n      }\n    }\n    if (idx($parsed, 'int_field') !== null) {\n      $_tmp2 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['int_field']);\n      if ($_tmp2 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->int_field = (int)$_tmp2;\n      }\n    }\n    if (idx($parsed, 'long_field') !== null) {\n      $this->long_field = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['long_field']);\n    }\n    if (idx($parsed, 'float_field') !== null) {\n      $this->float_field = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['float_field']);\n    }\n    if (idx($parsed, 'double_field') !== null) {\n      $this->double_field = HH\\FIXME\\UNSAFE_CAST<mixed, float>($parsed['double_field']);\n    }\n    if (idx($parsed, 'string_field') !== null) {\n      $this->string_field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['string_field']);\n    }\n    if (idx($parsed, 'binary_field') !== null) {\n      $this->binary_field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['binary_field']);\n    }\n    if (idx($parsed, 'enum_field') !== null) {\n      $this->enum_field = \\facebook\\thrift\\test\\terse_write\\MyEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\terse_write\\MyEnum>($parsed['enum_field']));\n    }\n    if (idx($parsed, 'list_field') !== null) {\n      $_json6 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['list_field']);\n      $_container7 = Vector {};\n      foreach($_json6 as $_key4 => $_value5) {\n        $_elem8 = 0;\n        $_tmp9 = (int)$_value5;\n        if ($_tmp9 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem8 = (int)$_tmp9;\n        }\n        $_container7 []= $_elem8;\n      }\n      $this->list_field = $_container7;\n    }\n    if (idx($parsed, 'set_field') !== null) {\n      $_json13 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['set_field']);\n      $_container14 = Set {};\n      foreach($_json13 as $_key11 => $_value12) {\n        $_elem15 = 0;\n        $_tmp16 = (int)$_value12;\n        if ($_tmp16 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem15 = (int)$_tmp16;\n        }\n        $_container14->add($_elem15);\n      }\n      $this->set_field = $_container14;\n    }\n    if (idx($parsed, 'map_field') !== null) {\n      $_json20 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, int>>($parsed['map_field']);\n      $_container21 = Map {};\n      foreach($_json20 as $_key18 => $_value19) {\n        $_value22 = 0;\n        $_tmp23 = (int)$_value19;\n        if ($_tmp23 > 0x7fff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value22 = (int)$_tmp23;\n        }\n        $_container21[$_key18] = $_value22;\n      }\n      $this->map_field = $_container21;\n    }\n    if (idx($parsed, 'struct_field') !== null) {\n      $_tmp24 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\test\\terse_write\\MyStructWithCustomDefault>($parsed['struct_field']));\n      $_tmp25 = \\facebook\\thrift\\test\\terse_write\\MyStructWithCustomDefault::withDefaultValues();\n      $_tmp25->readFromJson($_tmp24);\n      $this->struct_field = $_tmp25;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * AdaptedFields\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/terse_write/AdaptedFields'))>>\nclass AdaptedFields implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field1',\n      'is_terse' => true,\n      'adapter' => \\Adapter1::class,\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'field2',\n      'adapter' => \\Adapter1::class,\n      'is_terse' => true,\n      'type' => \\TType::I32,\n    ),\n    3 => shape(\n      'var' => 'field3',\n      'is_terse' => true,\n      'adapter' => \\Adapter1::class,\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field1' => 1,\n    'field2' => 2,\n    'field3' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field1' => ?\\Adapter1::THackType,\n    ?'field2' => ?\\Adapter1::THackType,\n    ?'field3' => ?\\Adapter1::THackType,\n  );\n\n  const type TShape = shape(\n    'field1' => \\Adapter1::THackType,\n    'field2' => \\Adapter1::THackType,\n    'field3' => \\Adapter1::THackType,\n    ...\n  );\n  const int STRUCTURAL_ID = 8495441692096133093;\n  /**\n   * Original thrift field:-\n   * 1: terse_write.MyInteger field1\n   */\n  public \\Adapter1::THackType $field1;\n  /**\n   * Original thrift field:-\n   * 2: i32 field2\n   */\n  public \\Adapter1::THackType $field2;\n  /**\n   * Original thrift field:-\n   * 3: terse_write.MyInteger field3\n   */\n  public \\Adapter1::THackType $field3;\n\n  public function __construct(?\\Adapter1::THackType $field1 = null, ?\\Adapter1::THackType $field2 = null, ?\\Adapter1::THackType $field3 = null)[] {\n    $this->field1 = $field1 ?? \\Adapter1::fromThrift(0);\n    $this->field2 = $field2 ?? \\Adapter1::fromThrift(0);\n    $this->field3 = $field3 ?? \\Adapter1::fromThrift(0);\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field1'),\n      Shapes::idx($shape, 'field2'),\n      Shapes::idx($shape, 'field3'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AdaptedFields';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->field1 = \\Adapter1::fromThrift(0);\n    $this->field2 = \\Adapter1::fromThrift(0);\n    $this->field3 = \\Adapter1::fromThrift(0);\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"terse_write.AdaptedFields\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"terse_write.MyInteger\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"field1\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"field2\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"terse_write.MyInteger\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"field3\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n        'field1' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter\",\n              )\n            ),\n          ],\n        ),\n        'field2' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'field3' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter\",\n              )\n            ),\n          ],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\Adapter' => \\facebook\\thrift\\annotation\\hack\\Adapter::fromShape(\n              shape(\n                \"name\" => \"\\\\Adapter1\",\n              )\n            ),\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field1'],\n      $shape['field2'],\n      $shape['field3'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field1' => $this->field1,\n      'field2' => $this->field2,\n      'field3' => $this->field3,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field1') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, \\Adapter1::THackType>($parsed['field1']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->field1 = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'field2') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['field2']);\n      if ($_tmp1 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->field2 = (int)$_tmp1;\n      }\n    }\n    if (idx($parsed, 'field3') !== null) {\n      $_tmp2 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, \\Adapter1::THackType>($parsed['field3']);\n      if ($_tmp2 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->field3 = (int)$_tmp2;\n      }\n    }\n  }\n\n  private static function __hackAdapterTypeChecks()[]: void {\n    \\ThriftUtil::requireSameType<\\Adapter1::TThriftType, int>();\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * WrappedFields\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/terse_write/WrappedFields'))>>\nclass WrappedFields implements \\IThriftAsyncStruct, \\IThriftStructMetadata, \\IThriftShapishAsyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field1',\n      'is_wrapped' => true,\n      'is_terse' => true,\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field1' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field1' => ?int,\n  );\n\n  const type TShape = shape(\n    'field1' => int,\n    ...\n  );\n  const int STRUCTURAL_ID = 3788696854924653147;\n  /**\n   * Original thrift field:-\n   * 1: i32 field1\n   */\n  private ?\\MyFieldWrapper<int, \\facebook\\thrift\\test\\terse_write\\WrappedFields> $field1;\n\n  public function get_field1()[]: \\MyFieldWrapper<int, \\facebook\\thrift\\test\\terse_write\\WrappedFields> {\n    return $this->field1 as nonnull;\n  }\n\n\n  public function __construct()[] {\n    $this->field1 = \\MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<int, \\facebook\\thrift\\test\\terse_write\\WrappedFields>(7, 1, $this);\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static async function genFromShape(self::TConstructorShape $shape)[zoned_shallow]: Awaitable<this> {\n    $obj = new static();\n    $field1 = Shapes::idx($shape, 'field1');\n    if ($field1 !== null) {\n      await $obj->get_field1()->genWrap($field1);\n    }\n    return $obj;\n  }\n\n  public function getName()[]: string {\n    return 'WrappedFields';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->field1 = \\MyFieldWrapper::fromThrift_DO_NOT_USE_THRIFT_INTERNAL<int, \\facebook\\thrift\\test\\terse_write\\WrappedFields>(0, 1, $this);\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"terse_write.WrappedFields\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"field1\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n        'field1' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\hack\\FieldWrapper' => \\facebook\\thrift\\annotation\\hack\\FieldWrapper::fromShape(\n              shape(\n                \"name\" => \"\\\\MyFieldWrapper\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public static async function __genFromShape(self::TShape $shape): Awaitable<this> {\n    $obj = new static();\n    await $obj->get_field1()->genWrap($shape['field1']);\n    return $obj;\n  }\n\n  public async function __genToShape(): Awaitable<self::TShape> {\n    $field1 = await ($this->field1 as nonnull)->genUnwrap();\n    return shape(\n      'field1' => $field1,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field1') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['field1']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->field1 = (int)$_tmp0;\n      }\n    }\n  }\n\n}\n\n/**\n * Original thrift exception:-\n * TerseException\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/test/terse_write/TerseException'))>>\nclass TerseException extends \\TException implements \\IThriftSyncStruct, \\IThriftExceptionMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'msg',\n      'is_terse' => true,\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'msg' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'msg' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 1537019148371217773;\n  /**\n   * Original thrift field:-\n   * 1: string msg\n   */\n  public string $msg;\n\n  public function __construct(?string $msg = null)[] {\n    parent::__construct();\n    $this->msg = $msg ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'msg'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TerseException';\n  }\n\n  <<__Override>>\n  public function getMessage()[]: string {\n    return $this->msg ?? '';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->msg = '';\n  }\n\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException {\n    return \\tmeta_ThriftException::fromShape(\n      shape(\n        \"name\" => \"terse_write.TerseException\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"msg\",\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'msg') !== null) {\n      $this->msg = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['msg']);\n    }\n  }\n\n}\n\n", "num_lines": 4545}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates a definition/feature may change in incompatible ways.\n *\n * Original thrift struct:-\n * Beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Beta'))>>\nclass Beta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used with permission, may\n * only work in specific contexts, and may change in incompatible ways without\n * notice.\n *\n * Original thrift struct:-\n * Experimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Experimental'))>>\nclass Experimental implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Experimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Experimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used in an ephemeral testing\n * enviornment.\n * \n * Such enviornments only store serialized values temporarly and strictly\n * control which versions of Thrift definitions are used, so 'compatibility'\n * is not a concern.\n *\n * Original thrift struct:-\n * Testing\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Testing'))>>\nclass Testing implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Testing';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Testing\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should no longer be used.\n *\n * Original thrift struct:-\n * Deprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Deprecated'))>>\nclass Deprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const type TShape = shape(\n    'message' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2427562471238739676;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Deprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Deprecated\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['message'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'message' => $this->message,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'message') !== null) {\n      $this->message = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['message']);\n    }\n  }\n\n}\n\n/**\n * Annotate a thrift structured or enum to indicate if ids or values should not\n * be used.\n * \n * For example, you may want to mark ids as deprecated, or these ids\n * might be reserved for other use cases or annotations.\n * \n * The resolved set of disallowed ids is the union of the values in `ids` and\n * the range of values represented in `id_ranges`. Example:\n * \n *  // These ids are not allowed: 3, 8, half-open ranges [10, 15), [20, 30)\n *  @thrift.ReserveIds{ids = [3, 8], id_ranges = {10: 15, 20: 30}}\n *  struct Foo {\n *    ...\n *    3: i64 f; // Build failure: 3 cannot be used\n *  }\n *\n * Original thrift struct:-\n * ReserveIds\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ReserveIds'))>>\nclass ReserveIds implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ids',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'id_ranges',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ids' => 1,\n    'id_ranges' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ids' => ?Vector<int>,\n    ?'id_ranges' => ?Map<int, int>,\n  );\n\n  const type TShape = shape(\n    'ids' => vec<int>,\n    'id_ranges' => dict<int, int>,\n    ...\n  );\n  const int STRUCTURAL_ID = 4105998268635615653;\n  /**\n   * Individual ids that cannot be used.\n   * \n   * Original thrift field:-\n   * 1: list<i32> ids\n   */\n  public Vector<int> $ids;\n  /**\n   * Represents ranges of ids that cannot be used.\n   * \n   * Each (key: value) pair represents the half-open range `[key, value)`,\n   * where `key` is included and `value` is not. For example, the map\n   * `{10: 15, 20: 30}` represents the union of id/value ranges `[10, 15)` and\n   * `[20, 30)`.\n   * \n   * Original thrift field:-\n   * 2: map<i32, i32> id_ranges\n   */\n  public Map<int, int> $id_ranges;\n\n  public function __construct(?Vector<int> $ids = null, ?Map<int, int> $id_ranges = null)[] {\n    $this->ids = $ids ?? Vector {};\n    $this->id_ranges = $id_ranges ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ids'),\n      Shapes::idx($shape, 'id_ranges'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ReserveIds';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ReserveIds\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ids\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"id_ranges\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['ids'] |> new Vector($$),\n      $shape['id_ranges'] |> new Map($$),\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'ids' => vec($this->ids),\n      'id_ranges' => dict($this->id_ranges),\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'ids') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['ids']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = 0;\n        $_tmp6 = (int)$_value2;\n        if ($_tmp6 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem5 = (int)$_tmp6;\n        }\n        $_container4 []= $_elem5;\n      }\n      $this->ids = $_container4;\n    }\n    if (idx($parsed, 'id_ranges') !== null) {\n      $_json10 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, int>>($parsed['id_ranges']);\n      $_container11 = Map {};\n      foreach($_json10 as $_key8 => $_value9) {\n        $_value12 = 0;\n        $_tmp13 = (int)$_value9;\n        if ($_tmp13 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value12 = (int)$_tmp13;\n        }\n        $_container11[$_key8] = $_value12;\n      }\n      $this->id_ranges = $_container11;\n    }\n  }\n\n}\n\n/**\n * Indicates additional backward compatibility restrictions, beyond the\n * standard Thrift required 'wire' compatibility.\n *\n * Original thrift struct:-\n * RequiresBackwardCompatibility\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RequiresBackwardCompatibility'))>>\nclass RequiresBackwardCompatibility implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field_name',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field_name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field_name' => ?bool,\n  );\n\n  const type TShape = shape(\n    'field_name' => bool,\n    ...\n  );\n  const int STRUCTURAL_ID = 4755373036761315562;\n  /**\n   * Original thrift field:-\n   * 1: bool field_name\n   */\n  public bool $field_name;\n\n  public function __construct(?bool $field_name = null)[] {\n    $this->field_name = $field_name ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field_name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RequiresBackwardCompatibility';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.RequiresBackwardCompatibility\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"field_name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field_name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field_name' => $this->field_name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field_name') !== null) {\n      $this->field_name = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['field_name']);\n    }\n  }\n\n}\n\n/**\n * Disables testing features.\n *\n * Original thrift struct:-\n * NoTesting\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoTesting'))>>\nclass NoTesting implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoTesting';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoTesting\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables experimental features.\n *\n * Original thrift struct:-\n * NoExperimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoExperimental'))>>\nclass NoExperimental implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoExperimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoExperimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables @Beta features.\n *\n * Original thrift struct:-\n * NoBeta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoBeta'))>>\nclass NoBeta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoBeta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoBeta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoExperimental' => \\facebook\\thrift\\annotation\\NoExperimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature must not depend directly on an unreleased\n * or testing definition/feature.\n *\n * Original thrift struct:-\n * Released\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Released'))>>\nclass Released implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Released';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Released\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoBeta' => \\facebook\\thrift\\annotation\\NoBeta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\NoTesting' => \\facebook\\thrift\\annotation\\NoTesting::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables legacy features.\n *\n * Original thrift struct:-\n * NoLegacy\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoLegacy'))>>\nclass NoLegacy implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoLegacy';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoLegacy\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables @Deprecated features.\n * \n * Should only be enabled in `test` versions, as deprecated implies removing\n * the feature will break current usage (otherwise it would be legacy or\n * deleted).\n *\n * Original thrift struct:-\n * NoDeprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoDeprecated'))>>\nclass NoDeprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoDeprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoDeprecated\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoLegacy' => \\facebook\\thrift\\annotation\\NoLegacy::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that changes the field qualifier from 'none' to 'terse'.\n * A terse field is eligible to skip serialization, when it equals to the\n * intrinsic default value. It also clears to the intrinsic default value\n * before deserialization to distinguish between if a terse field was skipped\n * or missing during serialization. This is different from an unqualified\n * field, as an unqualified field is always serialized regardless of its value,\n * and it is not cleared before deserialization.\n * \n * The annotation can be only used to annotate an unqualified field, and when\n * it is annotating a struct or exception, it changes all unqualified fields to\n * terse fields. Note, the annotation can not be used for union.\n *\n * Original thrift struct:-\n * TerseWrite\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/TerseWrite'))>>\nclass TerseWrite implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TerseWrite';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.TerseWrite\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack.\n *\n * Original thrift struct:-\n * Box\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Box'))>>\nclass Box implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Box';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Box\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Mixin\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Mixin'))>>\nclass Mixin implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Mixin';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Mixin\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Option to serialize thrift struct in ascending field id order.\n * \n * This can potentially make serialized data size smaller in compact protocol,\n * since compact protocol can write deltas between subsequent field ids.\n *\n * Original thrift struct:-\n * SerializeInFieldIdOrder\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/SerializeInFieldIdOrder'))>>\nclass SerializeInFieldIdOrder implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SerializeInFieldIdOrder';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.SerializeInFieldIdOrder\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates an enum is a bitmask and should support bit-wise operators.\n *\n * Original thrift struct:-\n * BitmaskEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/BitmaskEnum'))>>\nclass BitmaskEnum implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BitmaskEnum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.BitmaskEnum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all released v1 features.\n *\n * Original thrift struct:-\n * v1\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1'))>>\nclass v1 implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all beta v1 features.\n * \n * Beta features are guaranteed to *not* break unrelated Thrift features\n * so they should be relatively safe to test alongside other beta or\n * released Thrift features.\n *\n * Original thrift struct:-\n * v1beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1beta'))>>\nclass v1beta implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1' => \\facebook\\thrift\\annotation\\v1::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all experimental v1 features.\n * \n * Use with *caution* and only with explicit permission. This may enable\n * features may change significantly without notice or not work correctly\n * in all contexts.\n *\n * Original thrift struct:-\n * v1alpha\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1alpha'))>>\nclass v1alpha implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1alpha';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1alpha\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1beta' => \\facebook\\thrift\\annotation\\v1beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\SerializeInFieldIdOrder' => \\facebook\\thrift\\annotation\\SerializeInFieldIdOrder::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables experimental features, even those that are known to break common\n * use cases.\n *\n * Original thrift struct:-\n * v1test\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1test'))>>\nclass v1test implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1test';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1test\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoDeprecated' => \\facebook\\thrift\\annotation\\NoDeprecated::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\v1alpha' => \\facebook\\thrift\\annotation\\v1alpha::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Testing' => \\facebook\\thrift\\annotation\\Testing::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Specifies the field where the exception message is stored. The field\n * is used to generate an additional method to get it.\n *\n * Original thrift struct:-\n * ExceptionMessage\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ExceptionMessage'))>>\nclass ExceptionMessage implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?string,\n  );\n\n  const type TShape = shape(\n    'field' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 6158382972310209096;\n  /**\n   * Original thrift field:-\n   * 1: string field\n   */\n  public string $field;\n\n  public function __construct(?string $field = null)[] {\n    $this->field = $field ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ExceptionMessage';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ExceptionMessage\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['field'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'field' => $this->field,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $this->field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['field']);\n    }\n  }\n\n}\n\n/**\n * Generates a const of type schema. Struct containing the schema of the\n * annotated type. Optionally specify name to override default\n * schema<structName>.\n *\n * Original thrift struct:-\n * GenerateRuntimeSchema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/GenerateRuntimeSchema'))>>\nclass GenerateRuntimeSchema implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const type TShape = shape(\n    'name' => string,\n    ...\n  );\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'GenerateRuntimeSchema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.GenerateRuntimeSchema\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n      $shape['name'],\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n      'name' => $this->name,\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack, and that\n * identical values can be shared in immutable contexts.\n *\n * Original thrift struct:-\n * InternBox\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/InternBox'))>>\nclass InternBox implements \\IThriftSyncStruct, \\IThriftStructMetadata, \\IThriftShapishSyncStruct {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const type TShape = shape(\n    ...\n  );\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'InternBox';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.InternBox\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public static function __fromShape(self::TShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function __toShape()[]: self::TShape {\n    return shape(\n    );\n  }\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 2588}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation\\cpp;\n\n/**\n * Original thrift enum:-\n * RefType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/RefType'))>>\nenum RefType: int {\n  Unique = 0;\n  Shared = 1;\n  SharedMutable = 2;\n}\n\nclass RefType_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"cpp.RefType\",\n        \"elements\" => dict[\n          0 => \"Unique\",\n          1 => \"Shared\",\n          2 => \"SharedMutable\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Enum in C++ by default uses signed 32 bit integer. There is no need to specify\n * underlying type for signed 32 bit integer.\n * \n * Original thrift enum:-\n * EnumUnderlyingType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/EnumUnderlyingType'))>>\nenum EnumUnderlyingType: int {\n  /**\n   * ::std::int8_t\n   */\n  I8 = 0;\n  /**\n   * ::std::uint8_t\n   */\n  U8 = 1;\n  /**\n   * ::std::int16_t\n   */\n  I16 = 2;\n  /**\n   * ::std::uint16_t\n   */\n  U16 = 3;\n  /**\n   * ::std::uint32_t\n   */\n  U32 = 4;\n}\n\nclass EnumUnderlyingType_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"cpp.EnumUnderlyingType\",\n        \"elements\" => dict[\n          0 => \"I8\",\n          1 => \"U8\",\n          2 => \"I16\",\n          3 => \"U16\",\n          4 => \"U32\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Changes the native type of a Thrift object.\n * `name` and `template` correspond to `cpp.type` and `cpp.template` respecively.\n *\n * Original thrift struct:-\n * Type\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Type'))>>\nclass Type implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'template',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'template' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'template' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 6389487468753271119;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Original thrift field:-\n   * 2: string template\n   */\n  public string $template;\n\n  public function __construct(?string $name = null, ?string $template = null)[] {\n    $this->name = $name ?? '';\n    $this->template = $template ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'template'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Type';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Type\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"template\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'template') !== null) {\n      $this->template = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['template']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Ref\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Ref'))>>\nclass Ref implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'type',\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\annotation\\cpp\\RefType::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'type' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\RefType,\n  );\n\n  const int STRUCTURAL_ID = 8496209332976516665;\n  /**\n   * Original thrift field:-\n   * 1: cpp.RefType type\n   */\n  public ?\\facebook\\thrift\\annotation\\cpp\\RefType $type;\n\n  public function __construct(?\\facebook\\thrift\\annotation\\cpp\\RefType $type = null)[] {\n    $this->type = $type;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Ref';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Ref\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"cpp.RefType\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"type\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'type') !== null) {\n      $this->type = \\facebook\\thrift\\annotation\\cpp\\RefType::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\annotation\\cpp\\RefType>($parsed['type']));\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Lazy\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Lazy'))>>\nclass Lazy implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ref',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ref' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ref' => ?bool,\n  );\n\n  const int STRUCTURAL_ID = 2641839514020242314;\n  /**\n   * Original thrift field:-\n   * 1: bool ref\n   */\n  public bool $ref;\n\n  public function __construct(?bool $ref = null)[] {\n    $this->ref = $ref ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ref'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Lazy';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Lazy\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"ref\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'ref') !== null) {\n      $this->ref = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['ref']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * DisableLazyChecksum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/DisableLazyChecksum'))>>\nclass DisableLazyChecksum implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'DisableLazyChecksum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.DisableLazyChecksum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that applies a C++ adapter to typedef, field, or struct.\n * \n * For example:\n * \n *   @cpp.Adapter{name = \"::ns::IdAdapter\"}\n *   typedef i64 MyI64;\n * \n * Here the type `MyI64` has the C++ adapter `IdAdapter`.\n * \n *   struct User {\n *     @cpp.Adapter{name = \"::ns::IdAdapter\"}\n *     1: i64 id;\n *   }\n * \n * Here the field `id` has the C++ adapter `IdAdapter`.\n *\n * Original thrift struct:-\n * Adapter\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Adapter'))>>\nclass Adapter implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'adaptedType',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'underlyingName',\n      'type' => \\TType::STRING,\n    ),\n    4 => shape(\n      'var' => 'extraNamespace',\n      'type' => \\TType::STRING,\n    ),\n    5 => shape(\n      'var' => 'moveOnly',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'adaptedType' => 2,\n    'underlyingName' => 3,\n    'extraNamespace' => 4,\n    'moveOnly' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'adaptedType' => ?string,\n    ?'underlyingName' => ?string,\n    ?'extraNamespace' => ?string,\n    ?'moveOnly' => ?bool,\n  );\n\n  const int STRUCTURAL_ID = 8180344078447403329;\n  /**\n   * The name of a C++ adapter type used to convert between Thrift and native\n   * C++ representation.\n   * \n   * The adapter can be either a Type or Field adapter, providing either of the following APIs:\n   * \n   *     struct ThriftTypeAdapter {\n   *       static AdaptedType fromThrift(ThriftType thrift);\n   *       static {const ThriftType& | ThriftType} toThrift(const AdaptedType& native);\n   *     };\n   * \n   *     struct ThriftFieldAdapter {\n   *       // Context is an instantiation of apache::thrift::FieldContext\n   *       template <class Context>\n   *       static void construct(AdaptedType& field, Context ctx);\n   * \n   *       template <class Context>\n   *       static AdaptedType fromThriftField(ThriftType value, Context ctx);\n   * \n   *       template <class Context>\n   *       static {const ThriftType& | ThriftType} toThrift(const AdaptedType& adapted, Context ctx);\n   *     };\n   * \n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * It is sometimes necessary to specify AdaptedType here (in case the codegen would\n   * have a circular depdenceny, which will cause the C++ build to fail).\n   * \n   * Original thrift field:-\n   * 2: string adaptedType\n   */\n  public string $adaptedType;\n  /**\n   * The name and/or extra namespace to use when directly adapting a type\n   * (as opposed a typedef).\n   * \n   * In this case, the IDL name of the type will refer to the adapted type in\n   * C++ and the underlying thrift type will be generated in a nested\n   * namespace and/or with a different name.\n   * \n   * If neither `underlyingName` or `extraNamespace` is provided, the\n   * underlying type will be generated in a nested 'detail' namespace with\n   * the same name.\n   * \n   * Original thrift field:-\n   * 3: string underlyingName\n   */\n  public string $underlyingName;\n  /**\n   * Original thrift field:-\n   * 4: string extraNamespace\n   */\n  public string $extraNamespace;\n  /**\n   * Must set to true when adapted type is not copyable.\n   * \n   * Original thrift field:-\n   * 5: bool moveOnly\n   */\n  public bool $moveOnly;\n\n  public function __construct(?string $name = null, ?string $adaptedType = null, ?string $underlyingName = null, ?string $extraNamespace = null, ?bool $moveOnly = null)[] {\n    $this->name = $name ?? '';\n    $this->adaptedType = $adaptedType ?? '';\n    $this->underlyingName = $underlyingName ?? '';\n    $this->extraNamespace = $extraNamespace ?? '';\n    $this->moveOnly = $moveOnly ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'adaptedType'),\n      Shapes::idx($shape, 'underlyingName'),\n      Shapes::idx($shape, 'extraNamespace'),\n      Shapes::idx($shape, 'moveOnly'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Adapter';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Adapter\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"adaptedType\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"underlyingName\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"extraNamespace\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"moveOnly\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'adaptedType') !== null) {\n      $this->adaptedType = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['adaptedType']);\n    }\n    if (idx($parsed, 'underlyingName') !== null) {\n      $this->underlyingName = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['underlyingName']);\n    }\n    if (idx($parsed, 'extraNamespace') !== null) {\n      $this->extraNamespace = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['extraNamespace']);\n    }\n    if (idx($parsed, 'moveOnly') !== null) {\n      $this->moveOnly = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['moveOnly']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * PackIsset\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/PackIsset'))>>\nclass PackIsset implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'atomic',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'atomic' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'atomic' => ?bool,\n  );\n\n  const int STRUCTURAL_ID = 1587553453134051231;\n  /**\n   * Original thrift field:-\n   * 1: bool atomic\n   */\n  public bool $atomic;\n\n  public function __construct(?bool $atomic = null)[] {\n    $this->atomic = $atomic ?? true;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'atomic'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'PackIsset';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.PackIsset\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"atomic\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'atomic') !== null) {\n      $this->atomic = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['atomic']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MinimizePadding\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/MinimizePadding'))>>\nclass MinimizePadding implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MinimizePadding';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.MinimizePadding\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * TriviallyRelocatable\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/TriviallyRelocatable'))>>\nclass TriviallyRelocatable implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TriviallyRelocatable';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.TriviallyRelocatable\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ScopedEnumAsUnionType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/ScopedEnumAsUnionType'))>>\nclass ScopedEnumAsUnionType implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ScopedEnumAsUnionType';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.ScopedEnumAsUnionType\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a typedef should be 'strong', and require an explicit cast to\n * the underlying type.\n * \n * Currently only works for integer typedefs, for example:\n * \n *     @cpp.StrongType\n *     typedef i32 MyId;\n * \n * Will cause an enum class to be used instead of a typedef in the genearte code, for example:\n * \n *     enum class MyId : ::std::int32_t {};\n * \n *\n * Original thrift struct:-\n * StrongType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/StrongType'))>>\nclass StrongType implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StrongType';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.StrongType\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that intercepts field access with C++ field interceptor.\n * Use with *caution* since this may introduce substantial performance overhead on each field access.\n * \n * For example:\n * \n *     struct Foo {\n *       @cpp.FieldInterceptor{name = \"MyFieldInterceptor\"}\n *       1: i64 id;\n *     }\n * \n * The field interceptor `MyFieldInterceptor` will intercept with `interceptThriftFieldAccess`\n * when the field `id` is accessed.\n *\n * Original thrift struct:-\n * FieldInterceptor\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/FieldInterceptor'))>>\nclass FieldInterceptor implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'noinline',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n    'noinline' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n    ?'noinline' => ?bool,\n  );\n\n  const int STRUCTURAL_ID = 8132831456632900275;\n  /**\n   * The name of a field interceptor.\n   * \n   * The field interceptor provides the following API:\n   * \n   *     struct ThriftFieldInterceptor {\n   *       template <typename T, typename Struct, int16_t FieldId>\n   *       static void interceptThriftFieldAccess(T&& field,\n   *                                              apache::thrift::FieldContext<Struct, FieldId>&& ctx);\n   *     };\n   * \n   * The field interceptor intercepts with the field value and the field context.\n   * It enforces an easily searchable function name `interceptThriftFieldAccess`.\n   * \n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n  /**\n   * Setting to true makes compiler not inline and erase function signature for\n   * the intercepting field accessor.\n   * \n   * Original thrift field:-\n   * 2: bool noinline\n   */\n  public bool $noinline;\n\n  public function __construct(?string $name = null, ?bool $noinline = null)[] {\n    $this->name = $name ?? '';\n    $this->noinline = $noinline ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n      Shapes::idx($shape, 'noinline'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'FieldInterceptor';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.FieldInterceptor\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"noinline\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n    if (idx($parsed, 'noinline') !== null) {\n      $this->noinline = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['noinline']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * UseOpEncode\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/UseOpEncode'))>>\nclass UseOpEncode implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'UseOpEncode';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.UseOpEncode\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates an integer type for C++ to use as the underlying type of enum, for example:\n * \n *     @cpp.EnumType{type = cpp.EnumUnderlyingType.I8}\n *     enum Fruit {\n *       Apple = 0,\n *       Banana = 1,\n *     }\n * \n * will be generated into the following:\n * \n *     enum class Fruit : ::std::int8_t {\n *       Apple = 0,\n *       Banana = 1,\n *     };\n * \n *\n * Original thrift struct:-\n * EnumType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/EnumType'))>>\nclass EnumType implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'type',\n      'type' => \\TType::I32,\n      'enum' => \\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'type' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'type' => ?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType,\n  );\n\n  const int STRUCTURAL_ID = 1724537317047809370;\n  /**\n   * Original thrift field:-\n   * 1: cpp.EnumUnderlyingType type\n   */\n  public ?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType $type;\n\n  public function __construct(?\\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType $type = null)[] {\n    $this->type = $type;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'type'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumType';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.EnumType\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                    shape(\n                      \"name\" => \"cpp.EnumUnderlyingType\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"type\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'type') !== null) {\n      $this->type = \\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\facebook\\thrift\\annotation\\cpp\\EnumUnderlyingType>($parsed['type']));\n    }\n  }\n\n}\n\n/**\n * Indicates that frozen types should not be generated for a given struct.\n *\n * Original thrift struct:-\n * Frozen2Exclude\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Frozen2Exclude'))>>\nclass Frozen2Exclude implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Frozen2Exclude';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Frozen2Exclude\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that the container params must be complete at the time this type is instantiated.\n * Only required in rare cases where the build fails with a frozen-related assert failure.\n *\n * Original thrift struct:-\n * Frozen2RequiresCompleteContainerParams\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/cpp/Frozen2RequiresCompleteContainerParams'))>>\nclass Frozen2RequiresCompleteContainerParams implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Frozen2RequiresCompleteContainerParams';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"cpp.Frozen2RequiresCompleteContainerParams\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1734}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace apache\\thrift\\fixtures\\types;\n\n", "num_lines": 11}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace apache\\thrift\\fixtures\\types;\n\n/**\n * Original thrift enum:-\n * has_bitwise_ops\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/has_bitwise_ops'))>>\nenum has_bitwise_ops: int {\n  none = 0;\n  zero = 1;\n  one = 2;\n  two = 4;\n  three = 8;\n}\n\nclass has_bitwise_ops_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.has_bitwise_ops\",\n        \"elements\" => dict[\n          0 => \"none\",\n          1 => \"zero\",\n          2 => \"one\",\n          4 => \"two\",\n          8 => \"three\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift enum:-\n * is_unscoped\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/is_unscoped'))>>\nenum is_unscoped: int {\n  hello = 0;\n  world = 1;\n}\n\nclass is_unscoped_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.is_unscoped\",\n        \"elements\" => dict[\n          0 => \"hello\",\n          1 => \"world\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift enum:-\n * MyForwardRefEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/MyForwardRefEnum'))>>\nenum MyForwardRefEnum: int {\n  ZERO = 0;\n  NONZERO = 12;\n}\n\nclass MyForwardRefEnum_TEnumStaticMetadata implements \\IThriftEnumStaticMetadata {\n  public static function getEnumMetadata()[]: \\tmeta_ThriftEnum {\n    return \\tmeta_ThriftEnum::fromShape(\n      shape(\n        \"name\" => \"module.MyForwardRefEnum\",\n        \"elements\" => dict[\n          0 => \"ZERO\",\n          12 => \"NONZERO\",\n        ],\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TEnumAnnotations {\n    return shape(\n      'enum' => dict[],\n      'constants' => dict[\n      ],\n    );\n  }\n}\n\n/**\n * Original thrift struct:-\n * empty_struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/empty_struct'))>>\nclass empty_struct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'empty_struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.empty_struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * decorated_struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/decorated_struct'))>>\nclass decorated_struct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 6158382972310209096;\n  /**\n   * Original thrift field:-\n   * 1: string field\n   */\n  public string $field;\n\n  public function __construct(?string $field = null)[] {\n    $this->field = $field ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'decorated_struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.decorated_struct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $this->field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['field']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ContainerStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/ContainerStruct'))>>\nclass ContainerStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    12 => shape(\n      'var' => 'fieldA',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'fieldB',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'fieldC',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    4 => shape(\n      'var' => 'fieldD',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    5 => shape(\n      'var' => 'fieldE',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    6 => shape(\n      'var' => 'fieldF',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    7 => shape(\n      'var' => 'fieldG',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n    8 => shape(\n      'var' => 'fieldH',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'fieldA' => 12,\n    'fieldB' => 2,\n    'fieldC' => 3,\n    'fieldD' => 4,\n    'fieldE' => 5,\n    'fieldF' => 6,\n    'fieldG' => 7,\n    'fieldH' => 8,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'fieldA' => ?Vector<int>,\n    ?'fieldB' => ?Vector<int>,\n    ?'fieldC' => ?Vector<int>,\n    ?'fieldD' => ?Vector<int>,\n    ?'fieldE' => ?Vector<int>,\n    ?'fieldF' => ?Set<int>,\n    ?'fieldG' => ?Map<int, string>,\n    ?'fieldH' => ?Map<int, string>,\n  );\n\n  const int STRUCTURAL_ID = 2901459969892394021;\n  /**\n   * Original thrift field:-\n   * 12: list<i32> fieldA\n   */\n  public Vector<int> $fieldA;\n  /**\n   * Original thrift field:-\n   * 2: list<i32> fieldB\n   */\n  public Vector<int> $fieldB;\n  /**\n   * Original thrift field:-\n   * 3: list<i32> fieldC\n   */\n  public Vector<int> $fieldC;\n  /**\n   * Original thrift field:-\n   * 4: list<i32> fieldD\n   */\n  public Vector<int> $fieldD;\n  /**\n   * Original thrift field:-\n   * 5: list<i32> fieldE\n   */\n  public Vector<int> $fieldE;\n  /**\n   * Original thrift field:-\n   * 6: set<i32> fieldF\n   */\n  public Set<int> $fieldF;\n  /**\n   * Original thrift field:-\n   * 7: map<i32, string> fieldG\n   */\n  public Map<int, string> $fieldG;\n  /**\n   * Original thrift field:-\n   * 8: included.SomeMap fieldH\n   */\n  public Map<int, string> $fieldH;\n\n  public function __construct(?Vector<int> $fieldA = null, ?Vector<int> $fieldB = null, ?Vector<int> $fieldC = null, ?Vector<int> $fieldD = null, ?Vector<int> $fieldE = null, ?Set<int> $fieldF = null, ?Map<int, string> $fieldG = null, ?Map<int, string> $fieldH = null)[] {\n    $this->fieldA = $fieldA ?? Vector {};\n    $this->fieldB = $fieldB ?? Vector {};\n    $this->fieldC = $fieldC ?? Vector {};\n    $this->fieldD = $fieldD ?? Vector {};\n    $this->fieldE = $fieldE ?? Vector {};\n    $this->fieldF = $fieldF ?? Set {};\n    $this->fieldG = $fieldG ?? Map {};\n    $this->fieldH = $fieldH ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'fieldA'),\n      Shapes::idx($shape, 'fieldB'),\n      Shapes::idx($shape, 'fieldC'),\n      Shapes::idx($shape, 'fieldD'),\n      Shapes::idx($shape, 'fieldE'),\n      Shapes::idx($shape, 'fieldF'),\n      Shapes::idx($shape, 'fieldG'),\n      Shapes::idx($shape, 'fieldH'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ContainerStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ContainerStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 12,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"fieldA\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"fieldB\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"fieldC\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"fieldD\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"fieldE\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"fieldF\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"fieldG\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 8,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"included.SomeMap\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"fieldH\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'fieldB' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Type' => \\facebook\\thrift\\annotation\\cpp\\Type::fromShape(\n              shape(\n                \"template\" => \"std::list\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'fieldA') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['fieldA']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = 0;\n        $_tmp6 = (int)$_value2;\n        if ($_tmp6 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem5 = (int)$_tmp6;\n        }\n        $_container4 []= $_elem5;\n      }\n      $this->fieldA = $_container4;\n    }\n    if (idx($parsed, 'fieldB') !== null) {\n      $_json10 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['fieldB']);\n      $_container11 = Vector {};\n      foreach($_json10 as $_key8 => $_value9) {\n        $_elem12 = 0;\n        $_tmp13 = (int)$_value9;\n        if ($_tmp13 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem12 = (int)$_tmp13;\n        }\n        $_container11 []= $_elem12;\n      }\n      $this->fieldB = $_container11;\n    }\n    if (idx($parsed, 'fieldC') !== null) {\n      $_json17 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['fieldC']);\n      $_container18 = Vector {};\n      foreach($_json17 as $_key15 => $_value16) {\n        $_elem19 = 0;\n        $_tmp20 = (int)$_value16;\n        if ($_tmp20 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem19 = (int)$_tmp20;\n        }\n        $_container18 []= $_elem19;\n      }\n      $this->fieldC = $_container18;\n    }\n    if (idx($parsed, 'fieldD') !== null) {\n      $_json24 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['fieldD']);\n      $_container25 = Vector {};\n      foreach($_json24 as $_key22 => $_value23) {\n        $_elem26 = 0;\n        $_tmp27 = (int)$_value23;\n        if ($_tmp27 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem26 = (int)$_tmp27;\n        }\n        $_container25 []= $_elem26;\n      }\n      $this->fieldD = $_container25;\n    }\n    if (idx($parsed, 'fieldE') !== null) {\n      $_json31 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['fieldE']);\n      $_container32 = Vector {};\n      foreach($_json31 as $_key29 => $_value30) {\n        $_elem33 = 0;\n        $_tmp34 = (int)$_value30;\n        if ($_tmp34 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem33 = (int)$_tmp34;\n        }\n        $_container32 []= $_elem33;\n      }\n      $this->fieldE = $_container32;\n    }\n    if (idx($parsed, 'fieldF') !== null) {\n      $_json38 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['fieldF']);\n      $_container39 = Set {};\n      foreach($_json38 as $_key36 => $_value37) {\n        $_elem40 = 0;\n        $_tmp41 = (int)$_value37;\n        if ($_tmp41 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem40 = (int)$_tmp41;\n        }\n        $_container39->add($_elem40);\n      }\n      $this->fieldF = $_container39;\n    }\n    if (idx($parsed, 'fieldG') !== null) {\n      $_json45 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, string>>($parsed['fieldG']);\n      $_container46 = Map {};\n      foreach($_json45 as $_key43 => $_value44) {\n        $_value47 = '';\n        $_value47 = $_value44;\n        $_container46[$_key43] = $_value47;\n      }\n      $this->fieldG = $_container46;\n    }\n    if (idx($parsed, 'fieldH') !== null) {\n      $_json51 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, string>>($parsed['fieldH']);\n      $_container52 = Map {};\n      foreach($_json51 as $_key49 => $_value50) {\n        $_value53 = '';\n        $_value53 = $_value50;\n        $_container52[$_key49] = $_value53;\n      }\n      $this->fieldH = $_container52;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * CppTypeStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/CppTypeStruct'))>>\nclass CppTypeStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'fieldA',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'fieldA' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'fieldA' => ?Vector<int>,\n  );\n\n  const int STRUCTURAL_ID = 9369458949141941;\n  /**\n   * Original thrift field:-\n   * 1: list<i32> fieldA\n   */\n  public Vector<int> $fieldA;\n\n  public function __construct(?Vector<int> $fieldA = null)[] {\n    $this->fieldA = $fieldA ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'fieldA'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'CppTypeStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.CppTypeStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"fieldA\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'fieldA') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['fieldA']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = 0;\n        $_tmp6 = (int)$_value2;\n        if ($_tmp6 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem5 = (int)$_tmp6;\n        }\n        $_container4 []= $_elem5;\n      }\n      $this->fieldA = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * VirtualStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/VirtualStruct'))>>\nclass VirtualStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'MyIntField',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'MyIntField' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'MyIntField' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 7014352813131039231;\n  /**\n   * Original thrift field:-\n   * 1: i64 MyIntField\n   */\n  public int $MyIntField;\n\n  public function __construct(?int $MyIntField = null)[] {\n    $this->MyIntField = $MyIntField ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'MyIntField'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'VirtualStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.VirtualStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"MyIntField\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'MyIntField') !== null) {\n      $this->MyIntField = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['MyIntField']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStructWithForwardRefEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/MyStructWithForwardRefEnum'))>>\nclass MyStructWithForwardRefEnum implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::I32,\n      'enum' => \\apache\\thrift\\fixtures\\types\\MyForwardRefEnum::class,\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::I32,\n      'enum' => \\apache\\thrift\\fixtures\\types\\MyForwardRefEnum::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?\\apache\\thrift\\fixtures\\types\\MyForwardRefEnum,\n    ?'b' => ?\\apache\\thrift\\fixtures\\types\\MyForwardRefEnum,\n  );\n\n  const int STRUCTURAL_ID = 6098225215594902198;\n  /**\n   * Original thrift field:-\n   * 1: module.MyForwardRefEnum a\n   */\n  public ?\\apache\\thrift\\fixtures\\types\\MyForwardRefEnum $a;\n  /**\n   * Original thrift field:-\n   * 2: module.MyForwardRefEnum b\n   */\n  public ?\\apache\\thrift\\fixtures\\types\\MyForwardRefEnum $b;\n\n  public function __construct(?\\apache\\thrift\\fixtures\\types\\MyForwardRefEnum $a = null, ?\\apache\\thrift\\fixtures\\types\\MyForwardRefEnum $b = null)[] {\n    $this->a = $a ?? \\apache\\thrift\\fixtures\\types\\MyForwardRefEnum::NONZERO;\n    $this->b = $b ?? \\apache\\thrift\\fixtures\\types\\MyForwardRefEnum::NONZERO;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStructWithForwardRefEnum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStructWithForwardRefEnum\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyForwardRefEnum\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                            shape(\n                              \"name\" => \"module.MyForwardRefEnum\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyForwardRefEnum\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_enum\" => \\tmeta_ThriftEnumType::fromShape(\n                            shape(\n                              \"name\" => \"module.MyForwardRefEnum\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'a') !== null) {\n      $this->a = \\apache\\thrift\\fixtures\\types\\MyForwardRefEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\apache\\thrift\\fixtures\\types\\MyForwardRefEnum>($parsed['a']));\n    }\n    if (idx($parsed, 'b') !== null) {\n      $this->b = \\apache\\thrift\\fixtures\\types\\MyForwardRefEnum::coerce(HH\\FIXME\\UNSAFE_CAST<mixed, \\apache\\thrift\\fixtures\\types\\MyForwardRefEnum>($parsed['b']));\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * TrivialNumeric\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/TrivialNumeric'))>>\nclass TrivialNumeric implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?int,\n    ?'b' => ?bool,\n  );\n\n  const int STRUCTURAL_ID = 3920068475021763685;\n  /**\n   * Original thrift field:-\n   * 1: i32 a\n   */\n  public int $a;\n  /**\n   * Original thrift field:-\n   * 2: bool b\n   */\n  public bool $b;\n\n  public function __construct(?int $a = null, ?bool $b = null)[] {\n    $this->a = $a ?? 0;\n    $this->b = $b ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TrivialNumeric';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TrivialNumeric\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'a') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['a']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->a = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'b') !== null) {\n      $this->b = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['b']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * TrivialNestedWithDefault\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/TrivialNestedWithDefault'))>>\nclass TrivialNestedWithDefault implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'z',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'n',\n      'type' => \\TType::STRUCT,\n      'class' => \\apache\\thrift\\fixtures\\types\\TrivialNumeric::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'z' => 1,\n    'n' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'z' => ?int,\n    ?'n' => ?\\apache\\thrift\\fixtures\\types\\TrivialNumeric,\n  );\n\n  const int STRUCTURAL_ID = 5012136746274172257;\n  /**\n   * Original thrift field:-\n   * 1: i32 z\n   */\n  public int $z;\n  /**\n   * Original thrift field:-\n   * 2: module.TrivialNumeric n\n   */\n  public ?\\apache\\thrift\\fixtures\\types\\TrivialNumeric $n;\n\n  public function __construct(?int $z = null, ?\\apache\\thrift\\fixtures\\types\\TrivialNumeric $n = null)[] {\n    $this->z = $z ?? 4;\n    $this->n = $n;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'z'),\n      Shapes::idx($shape, 'n'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TrivialNestedWithDefault';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TrivialNestedWithDefault\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"z\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.TrivialNumeric\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"n\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'z') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['z']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->z = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'n') !== null) {\n      $_tmp1 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\apache\\thrift\\fixtures\\types\\TrivialNumeric>($parsed['n']));\n      $_tmp2 = \\apache\\thrift\\fixtures\\types\\TrivialNumeric::withDefaultValues();\n      $_tmp2->readFromJson($_tmp1);\n      $this->n = $_tmp2;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ComplexString\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/ComplexString'))>>\nclass ComplexString implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'a',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'b',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'a' => 1,\n    'b' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'a' => ?string,\n    ?'b' => ?Map<string, int>,\n  );\n\n  const int STRUCTURAL_ID = 5460740530481786095;\n  /**\n   * Original thrift field:-\n   * 1: string a\n   */\n  public string $a;\n  /**\n   * Original thrift field:-\n   * 2: map<string, i32> b\n   */\n  public Map<string, int> $b;\n\n  public function __construct(?string $a = null, ?Map<string, int> $b = null)[] {\n    $this->a = $a ?? '';\n    $this->b = $b ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'a'),\n      Shapes::idx($shape, 'b'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ComplexString';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ComplexString\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"a\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"b\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'a') !== null) {\n      $this->a = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['a']);\n    }\n    if (idx($parsed, 'b') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, int>>($parsed['b']);\n      $_container4 = Map {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_value5 = 0;\n        $_tmp6 = (int)$_value2;\n        if ($_tmp6 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value5 = (int)$_tmp6;\n        }\n        $_container4[$_key1] = $_value5;\n      }\n      $this->b = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ComplexNestedWithDefault\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/ComplexNestedWithDefault'))>>\nclass ComplexNestedWithDefault implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'z',\n      'type' => \\TType::STRING,\n    ),\n    2 => shape(\n      'var' => 'n',\n      'type' => \\TType::STRUCT,\n      'class' => \\apache\\thrift\\fixtures\\types\\ComplexString::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'z' => 1,\n    'n' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'z' => ?string,\n    ?'n' => ?\\apache\\thrift\\fixtures\\types\\ComplexString,\n  );\n\n  const int STRUCTURAL_ID = 2913723608362321564;\n  /**\n   * Original thrift field:-\n   * 1: string z\n   */\n  public string $z;\n  /**\n   * Original thrift field:-\n   * 2: module.ComplexString n\n   */\n  public ?\\apache\\thrift\\fixtures\\types\\ComplexString $n;\n\n  public function __construct(?string $z = null, ?\\apache\\thrift\\fixtures\\types\\ComplexString $n = null)[] {\n    $this->z = $z ?? \"4\";\n    $this->n = $n;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'z'),\n      Shapes::idx($shape, 'n'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ComplexNestedWithDefault';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ComplexNestedWithDefault\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"z\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.ComplexString\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"n\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'z') !== null) {\n      $this->z = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['z']);\n    }\n    if (idx($parsed, 'n') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\apache\\thrift\\fixtures\\types\\ComplexString>($parsed['n']));\n      $_tmp1 = \\apache\\thrift\\fixtures\\types\\ComplexString::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->n = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MinPadding\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/MinPadding'))>>\nclass MinPadding implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'small',\n      'type' => \\TType::BYTE,\n    ),\n    2 => shape(\n      'var' => 'big',\n      'type' => \\TType::I64,\n    ),\n    3 => shape(\n      'var' => 'medium',\n      'type' => \\TType::I16,\n    ),\n    4 => shape(\n      'var' => 'biggish',\n      'type' => \\TType::I32,\n    ),\n    5 => shape(\n      'var' => 'tiny',\n      'type' => \\TType::BYTE,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'small' => 1,\n    'big' => 2,\n    'medium' => 3,\n    'biggish' => 4,\n    'tiny' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'small' => ?int,\n    ?'big' => ?int,\n    ?'medium' => ?int,\n    ?'biggish' => ?int,\n    ?'tiny' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 723753448680843528;\n  /**\n   * Original thrift field:-\n   * 1: byte small\n   */\n  public int $small;\n  /**\n   * Original thrift field:-\n   * 2: i64 big\n   */\n  public int $big;\n  /**\n   * Original thrift field:-\n   * 3: i16 medium\n   */\n  public int $medium;\n  /**\n   * Original thrift field:-\n   * 4: i32 biggish\n   */\n  public int $biggish;\n  /**\n   * Original thrift field:-\n   * 5: byte tiny\n   */\n  public int $tiny;\n\n  public function __construct(?int $small = null, ?int $big = null, ?int $medium = null, ?int $biggish = null, ?int $tiny = null)[] {\n    $this->small = $small ?? 0;\n    $this->big = $big ?? 0;\n    $this->medium = $medium ?? 0;\n    $this->biggish = $biggish ?? 0;\n    $this->tiny = $tiny ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'small'),\n      Shapes::idx($shape, 'big'),\n      Shapes::idx($shape, 'medium'),\n      Shapes::idx($shape, 'biggish'),\n      Shapes::idx($shape, 'tiny'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MinPadding';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MinPadding\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                )\n              ),\n              \"name\" => \"small\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"big\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                )\n              ),\n              \"name\" => \"medium\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"biggish\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                )\n              ),\n              \"name\" => \"tiny\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\MinimizePadding' => \\facebook\\thrift\\annotation\\cpp\\MinimizePadding::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'small') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['small']);\n      if ($_tmp0 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->small = (int)$_tmp0;\n      }\n    } else {\n      throw new \\TProtocolException(\"Required field small cannot be found.\");\n    }\n    if (idx($parsed, 'big') !== null) {\n      $this->big = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['big']);\n    } else {\n      throw new \\TProtocolException(\"Required field big cannot be found.\");\n    }\n    if (idx($parsed, 'medium') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['medium']);\n      if ($_tmp1 > 0x7fff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->medium = (int)$_tmp1;\n      }\n    } else {\n      throw new \\TProtocolException(\"Required field medium cannot be found.\");\n    }\n    if (idx($parsed, 'biggish') !== null) {\n      $_tmp2 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['biggish']);\n      if ($_tmp2 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->biggish = (int)$_tmp2;\n      }\n    } else {\n      throw new \\TProtocolException(\"Required field biggish cannot be found.\");\n    }\n    if (idx($parsed, 'tiny') !== null) {\n      $_tmp3 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['tiny']);\n      if ($_tmp3 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->tiny = (int)$_tmp3;\n      }\n    } else {\n      throw new \\TProtocolException(\"Required field tiny cannot be found.\");\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MinPaddingWithCustomType\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/MinPaddingWithCustomType'))>>\nclass MinPaddingWithCustomType implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'small',\n      'is_terse' => true,\n      'type' => \\TType::BYTE,\n    ),\n    2 => shape(\n      'var' => 'big',\n      'is_terse' => true,\n      'type' => \\TType::I64,\n    ),\n    3 => shape(\n      'var' => 'medium',\n      'is_terse' => true,\n      'type' => \\TType::I16,\n    ),\n    4 => shape(\n      'var' => 'biggish',\n      'is_terse' => true,\n      'type' => \\TType::I32,\n    ),\n    5 => shape(\n      'var' => 'tiny',\n      'is_terse' => true,\n      'type' => \\TType::BYTE,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'small' => 1,\n    'big' => 2,\n    'medium' => 3,\n    'biggish' => 4,\n    'tiny' => 5,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'small' => ?int,\n    ?'big' => ?int,\n    ?'medium' => ?int,\n    ?'biggish' => ?int,\n    ?'tiny' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 7925816223011912416;\n  /**\n   * Original thrift field:-\n   * 1: byte small\n   */\n  public int $small;\n  /**\n   * Original thrift field:-\n   * 2: i64 big\n   */\n  public int $big;\n  /**\n   * Original thrift field:-\n   * 3: i16 medium\n   */\n  public int $medium;\n  /**\n   * Original thrift field:-\n   * 4: i32 biggish\n   */\n  public int $biggish;\n  /**\n   * Original thrift field:-\n   * 5: byte tiny\n   */\n  public int $tiny;\n\n  public function __construct(?int $small = null, ?int $big = null, ?int $medium = null, ?int $biggish = null, ?int $tiny = null)[] {\n    $this->small = $small ?? 0;\n    $this->big = $big ?? 0;\n    $this->medium = $medium ?? 0;\n    $this->biggish = $biggish ?? 0;\n    $this->tiny = $tiny ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'small'),\n      Shapes::idx($shape, 'big'),\n      Shapes::idx($shape, 'medium'),\n      Shapes::idx($shape, 'biggish'),\n      Shapes::idx($shape, 'tiny'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MinPaddingWithCustomType';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n    $this->small = 0;\n    $this->big = 0;\n    $this->medium = 0;\n    $this->biggish = 0;\n    $this->tiny = 0;\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MinPaddingWithCustomType\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                )\n              ),\n              \"name\" => \"small\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"big\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                )\n              ),\n              \"name\" => \"medium\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"biggish\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,\n                )\n              ),\n              \"name\" => \"tiny\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\cpp\\MinimizePadding' => \\facebook\\thrift\\annotation\\cpp\\MinimizePadding::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TerseWrite' => \\facebook\\thrift\\annotation\\TerseWrite::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n        'medium' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n              shape(\n                \"name\" => \"::my::Adapter\",\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'small') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['small']);\n      if ($_tmp0 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->small = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'big') !== null) {\n      $this->big = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['big']);\n    }\n    if (idx($parsed, 'medium') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['medium']);\n      if ($_tmp1 > 0x7fff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->medium = (int)$_tmp1;\n      }\n    }\n    if (idx($parsed, 'biggish') !== null) {\n      $_tmp2 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['biggish']);\n      if ($_tmp2 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->biggish = (int)$_tmp2;\n      }\n    }\n    if (idx($parsed, 'tiny') !== null) {\n      $_tmp3 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['tiny']);\n      if ($_tmp3 > 0x7f) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->tiny = (int)$_tmp3;\n      }\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/MyStruct'))>>\nclass MyStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'MyIntField',\n      'type' => \\TType::I64,\n    ),\n    2 => shape(\n      'var' => 'MyStringField',\n      'type' => \\TType::STRING,\n    ),\n    3 => shape(\n      'var' => 'majorVer',\n      'type' => \\TType::I64,\n    ),\n    4 => shape(\n      'var' => 'data',\n      'type' => \\TType::STRUCT,\n      'class' => \\apache\\thrift\\fixtures\\types\\MyDataItem::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'MyIntField' => 1,\n    'MyStringField' => 2,\n    'majorVer' => 3,\n    'data' => 4,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'MyIntField' => ?int,\n    ?'MyStringField' => ?string,\n    ?'majorVer' => ?int,\n    ?'data' => ?\\apache\\thrift\\fixtures\\types\\MyDataItem,\n  );\n\n  const int STRUCTURAL_ID = 2472338421128341558;\n  /**\n   * Original thrift field:-\n   * 1: i64 MyIntField\n   */\n  public int $MyIntField;\n  /**\n   * Original thrift field:-\n   * 2: string MyStringField\n   */\n  public string $MyStringField;\n  /**\n   * Original thrift field:-\n   * 3: i64 majorVer\n   */\n  public int $majorVer;\n  /**\n   * Original thrift field:-\n   * 4: module.MyDataItem data\n   */\n  public ?\\apache\\thrift\\fixtures\\types\\MyDataItem $data;\n\n  public function __construct(?int $MyIntField = null, ?string $MyStringField = null, ?int $majorVer = null, ?\\apache\\thrift\\fixtures\\types\\MyDataItem $data = null)[] {\n    $this->MyIntField = $MyIntField ?? 0;\n    $this->MyStringField = $MyStringField ?? '';\n    $this->majorVer = $majorVer ?? 0;\n    $this->data = $data;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'MyIntField'),\n      Shapes::idx($shape, 'MyStringField'),\n      Shapes::idx($shape, 'majorVer'),\n      Shapes::idx($shape, 'data'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"MyIntField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"MyStringField\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"majorVer\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.MyDataItem\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.MyDataItem\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"data\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'MyIntField') !== null) {\n      $this->MyIntField = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['MyIntField']);\n    }\n    if (idx($parsed, 'MyStringField') !== null) {\n      $this->MyStringField = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['MyStringField']);\n    }\n    if (idx($parsed, 'majorVer') !== null) {\n      $this->majorVer = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['majorVer']);\n    }\n    if (idx($parsed, 'data') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\apache\\thrift\\fixtures\\types\\MyDataItem>($parsed['data']));\n      $_tmp1 = \\apache\\thrift\\fixtures\\types\\MyDataItem::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->data = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * MyDataItem\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/MyDataItem'))>>\nclass MyDataItem implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'MyDataItem';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.MyDataItem\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Renaming\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/Renaming'))>>\nclass Renaming implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::I64,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 2811793053530639830;\n  /**\n   * Original thrift field:-\n   * 1: i64 foo\n   */\n  public int $foo;\n\n  public function __construct(?int $foo = null)[] {\n    $this->foo = $foo ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Renaming';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.Renaming\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                )\n              ),\n              \"name\" => \"foo\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'foo') !== null) {\n      $this->foo = HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['foo']);\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * AnnotatedTypes\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/AnnotatedTypes'))>>\nclass AnnotatedTypes implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'binary_field',\n      'type' => \\TType::STRING,\n      'is_binary' => true,\n    ),\n    2 => shape(\n      'var' => 'list_field',\n      'type' => \\TType::LST,\n      'etype' => \\TType::MAP,\n      'elem' => shape(\n        'type' => \\TType::MAP,\n        'ktype' => \\TType::I32,\n        'vtype' => \\TType::STRING,\n        'key' => shape(\n          'type' => \\TType::I32,\n        ),\n        'val' => shape(\n          'type' => \\TType::STRING,\n        ),\n        'format' => 'collection',\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'binary_field' => 1,\n    'list_field' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'binary_field' => ?string,\n    ?'list_field' => ?Vector<Map<int, string>>,\n  );\n\n  const int STRUCTURAL_ID = 7799859984459418183;\n  /**\n   * Original thrift field:-\n   * 1: module.TBinary binary_field\n   */\n  public string $binary_field;\n  /**\n   * Original thrift field:-\n   * 2: included.SomeListOfTypeMap list_field\n   */\n  public Vector<Map<int, string>> $list_field;\n\n  public function __construct(?string $binary_field = null, ?Vector<Map<int, string>> $list_field = null)[] {\n    $this->binary_field = $binary_field ?? '';\n    $this->list_field = $list_field ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'binary_field'),\n      Shapes::idx($shape, 'list_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AnnotatedTypes';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.AnnotatedTypes\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.TBinary\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.TBinary\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"binary_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"included.SomeListOfTypeMap\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"included.SomeListOfTypeMap\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                                    shape(\n                                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                            shape(\n                                              \"name\" => \"included.SomeMap\",\n                                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                                shape(\n                                                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                                                    shape(\n                                                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                                        shape(\n                                                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                                        )\n                                                      ),\n                                                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                                        shape(\n                                                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                                        )\n                                                      ),\n                                                    )\n                                                  ),\n                                                )\n                                              ),\n                                            )\n                                          ),\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"list_field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'binary_field') !== null) {\n      $this->binary_field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['binary_field']);\n    }\n    if (idx($parsed, 'list_field') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<Map<int, string>>>($parsed['list_field']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = Map {};\n        $_json9 = $_value2;\n        $_container10 = Map {};\n        foreach($_json9 as $_key7 => $_value8) {\n          $_value11 = '';\n          $_value11 = $_value8;\n          $_container10[$_key7] = $_value11;\n        }\n        $_elem5 = $_container10;\n        $_container4 []= $_elem5;\n      }\n      $this->list_field = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ForwardUsageRoot\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/ForwardUsageRoot'))>>\nclass ForwardUsageRoot implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ForwardUsageStruct',\n      'type' => \\TType::STRUCT,\n      'class' => \\apache\\thrift\\fixtures\\types\\ForwardUsageStruct::class,\n    ),\n    2 => shape(\n      'var' => 'ForwardUsageByRef',\n      'type' => \\TType::STRUCT,\n      'class' => \\apache\\thrift\\fixtures\\types\\ForwardUsageByRef::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ForwardUsageStruct' => 1,\n    'ForwardUsageByRef' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ForwardUsageStruct' => ?\\apache\\thrift\\fixtures\\types\\ForwardUsageStruct,\n    ?'ForwardUsageByRef' => ?\\apache\\thrift\\fixtures\\types\\ForwardUsageByRef,\n  );\n\n  const int STRUCTURAL_ID = 839155360071855827;\n  /**\n   * Original thrift field:-\n   * 1: module.ForwardUsageStruct ForwardUsageStruct\n   */\n  public ?\\apache\\thrift\\fixtures\\types\\ForwardUsageStruct $ForwardUsageStruct;\n  /**\n   * Original thrift field:-\n   * 2: module.ForwardUsageByRef ForwardUsageByRef\n   */\n  public ?\\apache\\thrift\\fixtures\\types\\ForwardUsageByRef $ForwardUsageByRef;\n\n  public function __construct(?\\apache\\thrift\\fixtures\\types\\ForwardUsageStruct $ForwardUsageStruct = null, ?\\apache\\thrift\\fixtures\\types\\ForwardUsageByRef $ForwardUsageByRef = null)[] {\n    $this->ForwardUsageStruct = $ForwardUsageStruct;\n    $this->ForwardUsageByRef = $ForwardUsageByRef;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ForwardUsageStruct'),\n      Shapes::idx($shape, 'ForwardUsageByRef'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ForwardUsageRoot';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ForwardUsageRoot\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.ForwardUsageStruct\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.ForwardUsageStruct\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ForwardUsageStruct\",\n              \"is_optional\" => true,\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.ForwardUsageByRef\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                            shape(\n                              \"name\" => \"module.ForwardUsageByRef\",\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ForwardUsageByRef\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'ForwardUsageStruct') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\apache\\thrift\\fixtures\\types\\ForwardUsageStruct>($parsed['ForwardUsageStruct']));\n      $_tmp1 = \\apache\\thrift\\fixtures\\types\\ForwardUsageStruct::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->ForwardUsageStruct = $_tmp1;\n    }\n    if (idx($parsed, 'ForwardUsageByRef') !== null) {\n      $_tmp2 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\apache\\thrift\\fixtures\\types\\ForwardUsageByRef>($parsed['ForwardUsageByRef']));\n      $_tmp3 = \\apache\\thrift\\fixtures\\types\\ForwardUsageByRef::withDefaultValues();\n      $_tmp3->readFromJson($_tmp2);\n      $this->ForwardUsageByRef = $_tmp3;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ForwardUsageStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/ForwardUsageStruct'))>>\nclass ForwardUsageStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::STRUCT,\n      'class' => \\apache\\thrift\\fixtures\\types\\ForwardUsageRoot::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?\\apache\\thrift\\fixtures\\types\\ForwardUsageRoot,\n  );\n\n  const int STRUCTURAL_ID = 7148256645166217470;\n  /**\n   * Original thrift field:-\n   * 1: module.ForwardUsageRoot foo\n   */\n  public ?\\apache\\thrift\\fixtures\\types\\ForwardUsageRoot $foo;\n\n  public function __construct(?\\apache\\thrift\\fixtures\\types\\ForwardUsageRoot $foo = null)[] {\n    $this->foo = $foo;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ForwardUsageStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ForwardUsageStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.ForwardUsageRoot\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"foo\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'foo') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\apache\\thrift\\fixtures\\types\\ForwardUsageRoot>($parsed['foo']));\n      $_tmp1 = \\apache\\thrift\\fixtures\\types\\ForwardUsageRoot::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->foo = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * ForwardUsageByRef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/ForwardUsageByRef'))>>\nclass ForwardUsageByRef implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'foo',\n      'type' => \\TType::STRUCT,\n      'class' => \\apache\\thrift\\fixtures\\types\\ForwardUsageRoot::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'foo' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'foo' => ?\\apache\\thrift\\fixtures\\types\\ForwardUsageRoot,\n  );\n\n  const int STRUCTURAL_ID = 7148256645166217470;\n  /**\n   * Original thrift field:-\n   * 1: module.ForwardUsageRoot foo\n   */\n  public ?\\apache\\thrift\\fixtures\\types\\ForwardUsageRoot $foo;\n\n  public function __construct(?\\apache\\thrift\\fixtures\\types\\ForwardUsageRoot $foo = null)[] {\n    $this->foo = $foo;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'foo'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ForwardUsageByRef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.ForwardUsageByRef\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.ForwardUsageRoot\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"foo\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'foo') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\apache\\thrift\\fixtures\\types\\ForwardUsageRoot>($parsed['foo']));\n      $_tmp1 = \\apache\\thrift\\fixtures\\types\\ForwardUsageRoot::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->foo = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * IncompleteMap\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/IncompleteMap'))>>\nclass IncompleteMap implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\apache\\thrift\\fixtures\\types\\IncompleteMapDep::class,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?Map<int, \\apache\\thrift\\fixtures\\types\\IncompleteMapDep>,\n  );\n\n  const int STRUCTURAL_ID = 8146873538067102953;\n  /**\n   * Original thrift field:-\n   * 1: map<i32, module.IncompleteMapDep> field\n   */\n  public ?Map<int, \\apache\\thrift\\fixtures\\types\\IncompleteMapDep> $field;\n\n  public function __construct(?Map<int, \\apache\\thrift\\fixtures\\types\\IncompleteMapDep> $field = null)[] {\n    $this->field = $field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'IncompleteMap';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.IncompleteMap\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.IncompleteMapDep\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.IncompleteMapDep\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"field\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, \\apache\\thrift\\fixtures\\types\\IncompleteMapDep>>($parsed['field']);\n      $_container4 = Map {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_value5 = \\apache\\thrift\\fixtures\\types\\IncompleteMapDep::withDefaultValues();\n        $_tmp6 = \\json_encode($_value2);\n        $_tmp7 = \\apache\\thrift\\fixtures\\types\\IncompleteMapDep::withDefaultValues();\n        $_tmp7->readFromJson($_tmp6);\n        $_value5 = $_tmp7;\n        $_container4[$_key1] = $_value5;\n      }\n      $this->field = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * IncompleteMapDep\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/IncompleteMapDep'))>>\nclass IncompleteMapDep implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'IncompleteMapDep';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.IncompleteMapDep\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * CompleteMap\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/CompleteMap'))>>\nclass CompleteMap implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::STRUCT,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\apache\\thrift\\fixtures\\types\\CompleteMapDep::class,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?Map<int, \\apache\\thrift\\fixtures\\types\\CompleteMapDep>,\n  );\n\n  const int STRUCTURAL_ID = 8146873538067102953;\n  /**\n   * Original thrift field:-\n   * 1: map<i32, module.CompleteMapDep> field\n   */\n  public ?Map<int, \\apache\\thrift\\fixtures\\types\\CompleteMapDep> $field;\n\n  public function __construct(?Map<int, \\apache\\thrift\\fixtures\\types\\CompleteMapDep> $field = null)[] {\n    $this->field = $field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'CompleteMap';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.CompleteMap\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.CompleteMapDep\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.CompleteMapDep\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"field\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, \\apache\\thrift\\fixtures\\types\\CompleteMapDep>>($parsed['field']);\n      $_container4 = Map {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_value5 = \\apache\\thrift\\fixtures\\types\\CompleteMapDep::withDefaultValues();\n        $_tmp6 = \\json_encode($_value2);\n        $_tmp7 = \\apache\\thrift\\fixtures\\types\\CompleteMapDep::withDefaultValues();\n        $_tmp7->readFromJson($_tmp6);\n        $_value5 = $_tmp7;\n        $_container4[$_key1] = $_value5;\n      }\n      $this->field = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * CompleteMapDep\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/CompleteMapDep'))>>\nclass CompleteMapDep implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'CompleteMapDep';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.CompleteMapDep\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * IncompleteList\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/IncompleteList'))>>\nclass IncompleteList implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRUCT,\n      'elem' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\apache\\thrift\\fixtures\\types\\IncompleteListDep::class,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?Vector<\\apache\\thrift\\fixtures\\types\\IncompleteListDep>,\n  );\n\n  const int STRUCTURAL_ID = 8146873538067102953;\n  /**\n   * Original thrift field:-\n   * 1: list<module.IncompleteListDep> field\n   */\n  public ?Vector<\\apache\\thrift\\fixtures\\types\\IncompleteListDep> $field;\n\n  public function __construct(?Vector<\\apache\\thrift\\fixtures\\types\\IncompleteListDep> $field = null)[] {\n    $this->field = $field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'IncompleteList';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.IncompleteList\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.IncompleteListDep\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.IncompleteListDep\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"field\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<\\apache\\thrift\\fixtures\\types\\IncompleteListDep>>($parsed['field']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = \\apache\\thrift\\fixtures\\types\\IncompleteListDep::withDefaultValues();\n        $_tmp6 = \\json_encode($_value2);\n        $_tmp7 = \\apache\\thrift\\fixtures\\types\\IncompleteListDep::withDefaultValues();\n        $_tmp7->readFromJson($_tmp6);\n        $_elem5 = $_tmp7;\n        $_container4 []= $_elem5;\n      }\n      $this->field = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * IncompleteListDep\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/IncompleteListDep'))>>\nclass IncompleteListDep implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'IncompleteListDep';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.IncompleteListDep\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * CompleteList\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/CompleteList'))>>\nclass CompleteList implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRUCT,\n      'elem' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\apache\\thrift\\fixtures\\types\\CompleteListDep::class,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?Vector<\\apache\\thrift\\fixtures\\types\\CompleteListDep>,\n  );\n\n  const int STRUCTURAL_ID = 8146873538067102953;\n  /**\n   * Original thrift field:-\n   * 1: list<module.CompleteListDep> field\n   */\n  public ?Vector<\\apache\\thrift\\fixtures\\types\\CompleteListDep> $field;\n\n  public function __construct(?Vector<\\apache\\thrift\\fixtures\\types\\CompleteListDep> $field = null)[] {\n    $this->field = $field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'CompleteList';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.CompleteList\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.CompleteListDep\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.CompleteListDep\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"field\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<\\apache\\thrift\\fixtures\\types\\CompleteListDep>>($parsed['field']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = \\apache\\thrift\\fixtures\\types\\CompleteListDep::withDefaultValues();\n        $_tmp6 = \\json_encode($_value2);\n        $_tmp7 = \\apache\\thrift\\fixtures\\types\\CompleteListDep::withDefaultValues();\n        $_tmp7->readFromJson($_tmp6);\n        $_elem5 = $_tmp7;\n        $_container4 []= $_elem5;\n      }\n      $this->field = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * CompleteListDep\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/CompleteListDep'))>>\nclass CompleteListDep implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'CompleteListDep';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.CompleteListDep\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * AdaptedList\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/AdaptedList'))>>\nclass AdaptedList implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRUCT,\n      'elem' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\apache\\thrift\\fixtures\\types\\AdaptedListDep::class,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?Vector<\\apache\\thrift\\fixtures\\types\\AdaptedListDep>,\n  );\n\n  const int STRUCTURAL_ID = 8146873538067102953;\n  /**\n   * Original thrift field:-\n   * 1: list<module.AdaptedListDep> field\n   */\n  public ?Vector<\\apache\\thrift\\fixtures\\types\\AdaptedListDep> $field;\n\n  public function __construct(?Vector<\\apache\\thrift\\fixtures\\types\\AdaptedListDep> $field = null)[] {\n    $this->field = $field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AdaptedList';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.AdaptedList\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.AdaptedListDep\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.AdaptedListDep\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"field\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<\\apache\\thrift\\fixtures\\types\\AdaptedListDep>>($parsed['field']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = \\apache\\thrift\\fixtures\\types\\AdaptedListDep::withDefaultValues();\n        $_tmp6 = \\json_encode($_value2);\n        $_tmp7 = \\apache\\thrift\\fixtures\\types\\AdaptedListDep::withDefaultValues();\n        $_tmp7->readFromJson($_tmp6);\n        $_elem5 = $_tmp7;\n        $_container4 []= $_elem5;\n      }\n      $this->field = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * AdaptedListDep\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/AdaptedListDep'))>>\nclass AdaptedListDep implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::STRUCT,\n      'class' => \\apache\\thrift\\fixtures\\types\\AdaptedList::class,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?\\apache\\thrift\\fixtures\\types\\AdaptedList,\n  );\n\n  const int STRUCTURAL_ID = 4190573964717330521;\n  /**\n   * Original thrift field:-\n   * 1: module.AdaptedList field\n   */\n  public ?\\apache\\thrift\\fixtures\\types\\AdaptedList $field;\n\n  public function __construct(?\\apache\\thrift\\fixtures\\types\\AdaptedList $field = null)[] {\n    $this->field = $field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AdaptedListDep';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.AdaptedListDep\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                    shape(\n                      \"name\" => \"module.AdaptedList\",\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"IdentityAdapter<detail::AdaptedListDep>\",\n            \"adaptedType\" => \"detail::AdaptedListDep\",\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $_tmp0 = \\json_encode(HH\\FIXME\\UNSAFE_CAST<mixed, \\apache\\thrift\\fixtures\\types\\AdaptedList>($parsed['field']));\n      $_tmp1 = \\apache\\thrift\\fixtures\\types\\AdaptedList::withDefaultValues();\n      $_tmp1->readFromJson($_tmp0);\n      $this->field = $_tmp1;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * DependentAdaptedList\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/DependentAdaptedList'))>>\nclass DependentAdaptedList implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::LST,\n      'etype' => \\TType::STRUCT,\n      'elem' => shape(\n        'type' => \\TType::STRUCT,\n        'class' => \\apache\\thrift\\fixtures\\types\\DependentAdaptedListDep::class,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?Vector<\\apache\\thrift\\fixtures\\types\\DependentAdaptedListDep>,\n  );\n\n  const int STRUCTURAL_ID = 8146873538067102953;\n  /**\n   * Original thrift field:-\n   * 1: list<module.DependentAdaptedListDep> field\n   */\n  public ?Vector<\\apache\\thrift\\fixtures\\types\\DependentAdaptedListDep> $field;\n\n  public function __construct(?Vector<\\apache\\thrift\\fixtures\\types\\DependentAdaptedListDep> $field = null)[] {\n    $this->field = $field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'DependentAdaptedList';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.DependentAdaptedList\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.DependentAdaptedListDep\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_struct\" => \\tmeta_ThriftStructType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.DependentAdaptedListDep\",\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"field\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<\\apache\\thrift\\fixtures\\types\\DependentAdaptedListDep>>($parsed['field']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = \\apache\\thrift\\fixtures\\types\\DependentAdaptedListDep::withDefaultValues();\n        $_tmp6 = \\json_encode($_value2);\n        $_tmp7 = \\apache\\thrift\\fixtures\\types\\DependentAdaptedListDep::withDefaultValues();\n        $_tmp7->readFromJson($_tmp6);\n        $_elem5 = $_tmp7;\n        $_container4 []= $_elem5;\n      }\n      $this->field = $_container4;\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * DependentAdaptedListDep\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/DependentAdaptedListDep'))>>\nclass DependentAdaptedListDep implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::I16,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 4533421093368234312;\n  /**\n   * Original thrift field:-\n   * 1: i16 field\n   */\n  public ?int $field;\n\n  public function __construct(?int $field = null)[] {\n    $this->field = $field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'DependentAdaptedListDep';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.DependentAdaptedListDep\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,\n                )\n              ),\n              \"name\" => \"field\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\cpp\\Adapter' => \\facebook\\thrift\\annotation\\cpp\\Adapter::fromShape(\n          shape(\n            \"name\" => \"IdentityAdapter<detail::DependentAdaptedListDep>\",\n          )\n        ),\n      ],\n      'fields' => dict[\n        'field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\Box' => \\facebook\\thrift\\annotation\\Box::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['field']);\n      if ($_tmp0 > 0x7fff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->field = (int)$_tmp0;\n      }\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * AllocatorAware\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/AllocatorAware'))>>\nclass AllocatorAware implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'aa_list',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'aa_set',\n      'type' => \\TType::SET,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    3 => shape(\n      'var' => 'aa_map',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    4 => shape(\n      'var' => 'aa_string',\n      'type' => \\TType::STRING,\n    ),\n    5 => shape(\n      'var' => 'not_a_container',\n      'type' => \\TType::I32,\n    ),\n    6 => shape(\n      'var' => 'aa_unique',\n      'type' => \\TType::I32,\n    ),\n    7 => shape(\n      'var' => 'aa_shared',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'aa_list' => 1,\n    'aa_set' => 2,\n    'aa_map' => 3,\n    'aa_string' => 4,\n    'not_a_container' => 5,\n    'aa_unique' => 6,\n    'aa_shared' => 7,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'aa_list' => ?Vector<int>,\n    ?'aa_set' => ?Set<int>,\n    ?'aa_map' => ?Map<int, int>,\n    ?'aa_string' => ?string,\n    ?'not_a_container' => ?int,\n    ?'aa_unique' => ?int,\n    ?'aa_shared' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 6797195997786481852;\n  /**\n   * Original thrift field:-\n   * 1: list<i32> aa_list\n   */\n  public Vector<int> $aa_list;\n  /**\n   * Original thrift field:-\n   * 2: set<i32> aa_set\n   */\n  public Set<int> $aa_set;\n  /**\n   * Original thrift field:-\n   * 3: map<i32, i32> aa_map\n   */\n  public Map<int, int> $aa_map;\n  /**\n   * Original thrift field:-\n   * 4: string aa_string\n   */\n  public string $aa_string;\n  /**\n   * Original thrift field:-\n   * 5: i32 not_a_container\n   */\n  public int $not_a_container;\n  /**\n   * Original thrift field:-\n   * 6: i32 aa_unique\n   */\n  public int $aa_unique;\n  /**\n   * Original thrift field:-\n   * 7: i32 aa_shared\n   */\n  public int $aa_shared;\n\n  public function __construct(?Vector<int> $aa_list = null, ?Set<int> $aa_set = null, ?Map<int, int> $aa_map = null, ?string $aa_string = null, ?int $not_a_container = null, ?int $aa_unique = null, ?int $aa_shared = null)[] {\n    $this->aa_list = $aa_list ?? Vector {};\n    $this->aa_set = $aa_set ?? Set {};\n    $this->aa_map = $aa_map ?? Map {};\n    $this->aa_string = $aa_string ?? '';\n    $this->not_a_container = $not_a_container ?? 0;\n    $this->aa_unique = $aa_unique ?? 0;\n    $this->aa_shared = $aa_shared ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'aa_list'),\n      Shapes::idx($shape, 'aa_set'),\n      Shapes::idx($shape, 'aa_map'),\n      Shapes::idx($shape, 'aa_string'),\n      Shapes::idx($shape, 'not_a_container'),\n      Shapes::idx($shape, 'aa_unique'),\n      Shapes::idx($shape, 'aa_shared'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AllocatorAware';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.AllocatorAware\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"aa_list\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_set\" => \\tmeta_ThriftSetType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"aa_set\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"aa_map\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 4,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"aa_string\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 5,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"not_a_container\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 6,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"aa_unique\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 7,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"aa_shared\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'aa_unique' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Ref' => \\facebook\\thrift\\annotation\\cpp\\Ref::fromShape(\n              shape(\n                \"type\" => \\facebook\\thrift\\annotation\\cpp\\RefType::Unique,\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n        'aa_shared' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Ref' => \\facebook\\thrift\\annotation\\cpp\\Ref::fromShape(\n              shape(\n                \"type\" => \\facebook\\thrift\\annotation\\cpp\\RefType::SharedMutable,\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'aa_list') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['aa_list']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = 0;\n        $_tmp6 = (int)$_value2;\n        if ($_tmp6 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem5 = (int)$_tmp6;\n        }\n        $_container4 []= $_elem5;\n      }\n      $this->aa_list = $_container4;\n    }\n    if (idx($parsed, 'aa_set') !== null) {\n      $_json10 = HH\\FIXME\\UNSAFE_CAST<mixed, Set<int>>($parsed['aa_set']);\n      $_container11 = Set {};\n      foreach($_json10 as $_key8 => $_value9) {\n        $_elem12 = 0;\n        $_tmp13 = (int)$_value9;\n        if ($_tmp13 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem12 = (int)$_tmp13;\n        }\n        $_container11->add($_elem12);\n      }\n      $this->aa_set = $_container11;\n    }\n    if (idx($parsed, 'aa_map') !== null) {\n      $_json17 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, int>>($parsed['aa_map']);\n      $_container18 = Map {};\n      foreach($_json17 as $_key15 => $_value16) {\n        $_value19 = 0;\n        $_tmp20 = (int)$_value16;\n        if ($_tmp20 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value19 = (int)$_tmp20;\n        }\n        $_container18[$_key15] = $_value19;\n      }\n      $this->aa_map = $_container18;\n    }\n    if (idx($parsed, 'aa_string') !== null) {\n      $this->aa_string = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['aa_string']);\n    }\n    if (idx($parsed, 'not_a_container') !== null) {\n      $_tmp21 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['not_a_container']);\n      if ($_tmp21 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->not_a_container = (int)$_tmp21;\n      }\n    }\n    if (idx($parsed, 'aa_unique') !== null) {\n      $_tmp22 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['aa_unique']);\n      if ($_tmp22 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->aa_unique = (int)$_tmp22;\n      }\n    }\n    if (idx($parsed, 'aa_shared') !== null) {\n      $_tmp23 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['aa_shared']);\n      if ($_tmp23 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->aa_shared = (int)$_tmp23;\n      }\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * AllocatorAware2\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/AllocatorAware2'))>>\nclass AllocatorAware2 implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'not_a_container',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'box_field',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'not_a_container' => 1,\n    'box_field' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'not_a_container' => ?int,\n    ?'box_field' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 8535397751218300194;\n  /**\n   * Original thrift field:-\n   * 1: i32 not_a_container\n   */\n  public int $not_a_container;\n  /**\n   * Original thrift field:-\n   * 2: i32 box_field\n   */\n  public ?int $box_field;\n\n  public function __construct(?int $not_a_container = null, ?int $box_field = null)[] {\n    $this->not_a_container = $not_a_container ?? 0;\n    $this->box_field = $box_field;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'not_a_container'),\n      Shapes::idx($shape, 'box_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'AllocatorAware2';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.AllocatorAware2\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"not_a_container\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"box_field\",\n              \"is_optional\" => true,\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'box_field' => shape(\n          'field' => dict[\n            '\\facebook\\thrift\\annotation\\Box' => \\facebook\\thrift\\annotation\\Box::fromShape(\n              shape(\n              )\n            ),\n          ],\n          'type' => dict[],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'not_a_container') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['not_a_container']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->not_a_container = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'box_field') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['box_field']);\n      if ($_tmp1 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->box_field = (int)$_tmp1;\n      }\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * TypedefStruct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/TypedefStruct'))>>\nclass TypedefStruct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'i32_field',\n      'type' => \\TType::I32,\n    ),\n    2 => shape(\n      'var' => 'IntTypedef_field',\n      'type' => \\TType::I32,\n    ),\n    3 => shape(\n      'var' => 'UintTypedef_field',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'i32_field' => 1,\n    'IntTypedef_field' => 2,\n    'UintTypedef_field' => 3,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'i32_field' => ?int,\n    ?'IntTypedef_field' => ?int,\n    ?'UintTypedef_field' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 9104074718450007174;\n  /**\n   * Original thrift field:-\n   * 1: i32 i32_field\n   */\n  public int $i32_field;\n  /**\n   * Original thrift field:-\n   * 2: module.IntTypedef IntTypedef_field\n   */\n  public int $IntTypedef_field;\n  /**\n   * Original thrift field:-\n   * 3: module.UintTypedef UintTypedef_field\n   */\n  public int $UintTypedef_field;\n\n  public function __construct(?int $i32_field = null, ?int $IntTypedef_field = null, ?int $UintTypedef_field = null)[] {\n    $this->i32_field = $i32_field ?? 0;\n    $this->IntTypedef_field = $IntTypedef_field ?? 0;\n    $this->UintTypedef_field = $UintTypedef_field ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'i32_field'),\n      Shapes::idx($shape, 'IntTypedef_field'),\n      Shapes::idx($shape, 'UintTypedef_field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TypedefStruct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.TypedefStruct\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"i32_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.IntTypedef\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"IntTypedef_field\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 3,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"module.UintTypedef\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.IntTypedef\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                                    shape(\n                                      \"name\" => \"module.IntTypedef\",\n                                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                        shape(\n                                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                        )\n                                      ),\n                                    )\n                                  ),\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"UintTypedef_field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n        'UintTypedef_field' => shape(\n          'field' => dict[],\n          'type' => dict[\n            '\\facebook\\thrift\\annotation\\cpp\\Type' => \\facebook\\thrift\\annotation\\cpp\\Type::fromShape(\n              shape(\n                \"name\" => \"std::uint32_t\",\n              )\n            ),\n          ],\n        ),\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'i32_field') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['i32_field']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->i32_field = (int)$_tmp0;\n      }\n    }\n    if (idx($parsed, 'IntTypedef_field') !== null) {\n      $_tmp1 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['IntTypedef_field']);\n      if ($_tmp1 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->IntTypedef_field = (int)$_tmp1;\n      }\n    }\n    if (idx($parsed, 'UintTypedef_field') !== null) {\n      $_tmp2 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['UintTypedef_field']);\n      if ($_tmp2 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->UintTypedef_field = (int)$_tmp2;\n      }\n    }\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * StructWithDoubleUnderscores\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/StructWithDoubleUnderscores'))>>\nclass StructWithDoubleUnderscores implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => '__field',\n      'type' => \\TType::I32,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    '__field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'__field' => ?int,\n  );\n\n  const int STRUCTURAL_ID = 8209484534723602012;\n  /**\n   * Original thrift field:-\n   * 1: i32 __field\n   */\n  public int $__field;\n\n  public function __construct(?int $__field = null)[] {\n    $this->__field = $__field ?? 0;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, '__field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'StructWithDoubleUnderscores';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.StructWithDoubleUnderscores\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                )\n              ),\n              \"name\" => \"__field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, '__field') !== null) {\n      $_tmp0 = (int)HH\\FIXME\\UNSAFE_CAST<mixed, int>($parsed['__field']);\n      if ($_tmp0 > 0x7fffffff) {\n        throw new \\TProtocolException(\"number exceeds limit in field\");\n      } else {\n        $this->__field = (int)$_tmp0;\n      }\n    }\n  }\n\n}\n\n", "num_lines": 5368}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates that the scope of sibling annotations is transitive.\n * \n * For example:\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     @scope.Transitive\n *     struct Structured {}\n * \n * Annotating a Thrift struct with @Structured automatically applies\n * @scope.Struct, @scope.Union and @scope.Exception annotations, i.e.\n * \n *     @Structured\n *     struct MyAnnotation {}\n * \n * is equivalent to\n * \n *     @scope.Struct\n *     @scope.Union\n *     @scope.Exception\n *     struct MyAnnotation {}\n * \n *\n * Original thrift struct:-\n * Transitive\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Transitive'))>>\nclass Transitive implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Transitive';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Transitive\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that an annotation should be included in the runtime schema.\n * \n * See thrift/lib/thrift/schema.thrift\n *\n * Original thrift struct:-\n * Schema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Schema'))>>\nclass Schema implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Schema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Schema\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Program scope.\n * \n * This allows annotations on the `package` definition, which implies the\n * annotaiton applies to the entire program.\n *\n * Original thrift struct:-\n * Program\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Program'))>>\nclass Program implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Program';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Program\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `struct` definition scope.\n *\n * Original thrift struct:-\n * Struct\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Struct'))>>\nclass Struct implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Struct';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Struct\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `union` definition scope.\n *\n * Original thrift struct:-\n * Union\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Union'))>>\nclass Union implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Union';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Union\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `exception` definition scope.\n *\n * Original thrift struct:-\n * Exception\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Exception'))>>\nclass Exception implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Exception';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Exception\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Field declartaions, for example in `struct` or `function` declartions.\n *\n * Original thrift struct:-\n * Field\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Field'))>>\nclass Field implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Field';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Field\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `typedef` definition scope.\n *\n * Original thrift struct:-\n * Typedef\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Typedef'))>>\nclass Typedef implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Typedef';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Typedef\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `service` definition scope.\n *\n * Original thrift struct:-\n * Service\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Service'))>>\nclass Service implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Service';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Service\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `interaction` definition scope.\n *\n * Original thrift struct:-\n * Interaction\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interaction'))>>\nclass Interaction implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Interaction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interaction\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `function` definition scope.\n *\n * Original thrift struct:-\n * Function\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Function'))>>\nclass TFunction implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TFunction';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Function\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The Enum value definition scope.\n *\n * Original thrift struct:-\n * EnumValue\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/EnumValue'))>>\nclass EnumValue implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'EnumValue';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.EnumValue\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * The `const` definition scope.\n *\n * Original thrift struct:-\n * Const\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Const'))>>\nclass TConst implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TConst';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Const\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Enum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Enum'))>>\nclass Enum implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Enum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Enum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'structured' definitions.\n *\n * Original thrift struct:-\n * Structured\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Structured'))>>\nclass Structured implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Structured';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Structured\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Union' => \\facebook\\thrift\\annotation\\Union::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all 'interface' definitions.\n *\n * Original thrift struct:-\n * Interface\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Interface'))>>\nclass TInterface implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TInterface';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Interface\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Interaction' => \\facebook\\thrift\\annotation\\Interaction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all program-scoped definition.\n *\n * Original thrift struct:-\n * RootDefinition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RootDefinition'))>>\nclass RootDefinition implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RootDefinition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.RootDefinition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TInterface' => \\facebook\\thrift\\annotation\\TInterface::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * A scope that includes all definitions.\n *\n * Original thrift struct:-\n * Definition\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Definition'))>>\nclass Definition implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Definition';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"scope.Definition\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\RootDefinition' => \\facebook\\thrift\\annotation\\RootDefinition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TFunction' => \\facebook\\thrift\\annotation\\TFunction::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\EnumValue' => \\facebook\\thrift\\annotation\\EnumValue::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 1390}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace apache\\thrift\\fixtures\\types;\n\n/**\n * Original thrift service:-\n * SomeService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/SomeService'))>>\ninterface SomeServiceAsyncIf extends \\IThriftAsyncIf {\n  /**\n   * Original thrift definition:-\n   * included.SomeMap\n   *   bounce_map(1: included.SomeMap m);\n   */\n  public function bounce_map(Map<int, string> $m): Awaitable<Map<int, string>>;\n\n  /**\n   * Original thrift definition:-\n   * map<TBinary, i64>\n   *   binary_keyed_map(1: list<i64> r);\n   */\n  public function binary_keyed_map(KeyedContainer<int, int> $r): Awaitable<Map<string, int>>;\n}\n\n/**\n * Original thrift service:-\n * SomeService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/SomeService'))>>\ninterface SomeServiceIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * included.SomeMap\n   *   bounce_map(1: included.SomeMap m);\n   */\n  public function bounce_map(Map<int, string> $m): Map<int, string>;\n\n  /**\n   * Original thrift definition:-\n   * map<TBinary, i64>\n   *   binary_keyed_map(1: list<i64> r);\n   */\n  public function binary_keyed_map(KeyedContainer<int, int> $r): Map<string, int>;\n}\n\n/**\n * Original thrift service:-\n * SomeService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/SomeService'))>>\ninterface SomeServiceAsyncClientIf extends SomeServiceAsyncIf {\n}\n\n/**\n * Original thrift service:-\n * SomeService\n */\n<<\\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/SomeService'))>>\ninterface SomeServiceClientIf extends \\IThriftSyncIf {\n  /**\n   * Original thrift definition:-\n   * included.SomeMap\n   *   bounce_map(1: included.SomeMap m);\n   */\n  public function bounce_map(Map<int, string> $m): Awaitable<Map<int, string>>;\n\n  /**\n   * Original thrift definition:-\n   * map<TBinary, i64>\n   *   binary_keyed_map(1: list<i64> r);\n   */\n  public function binary_keyed_map(KeyedContainer<int, int> $r): Awaitable<Map<string, int>>;\n}\n\n/**\n * Original thrift service:-\n * SomeService\n */\ntrait SomeServiceClientBase {\n  require extends \\ThriftClientBase;\n\n}\n\nclass SomeServiceAsyncClient extends \\ThriftClientBase implements SomeServiceAsyncClientIf {\n  use SomeServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * included.SomeMap\n   *   bounce_map(1: included.SomeMap m);\n   */\n  public async function bounce_map(Map<int, string> $m): Awaitable<Map<int, string>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\apache\\thrift\\fixtures\\types\\SomeService_bounce_map_args::fromShape(shape(\n      'm' => $m,\n    ));\n    await $this->asyncHandler_->genBefore(\"SomeService\", \"bounce_map\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"bounce_map\", false);\n    return await $this->genAwaitResponse(\\apache\\thrift\\fixtures\\types\\SomeService_bounce_map_result::class, \"bounce_map\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * map<TBinary, i64>\n   *   binary_keyed_map(1: list<i64> r);\n   */\n  public async function binary_keyed_map(KeyedContainer<int, int> $r): Awaitable<Map<string, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\apache\\thrift\\fixtures\\types\\SomeService_binary_keyed_map_args::fromShape(shape(\n      'r' => new Vector($r),\n    ));\n    await $this->asyncHandler_->genBefore(\"SomeService\", \"binary_keyed_map\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"binary_keyed_map\", false);\n    return await $this->genAwaitResponse(\\apache\\thrift\\fixtures\\types\\SomeService_binary_keyed_map_result::class, \"binary_keyed_map\", false, $currentseqid, $rpc_options);\n  }\n\n}\n\nclass SomeServiceClient extends \\ThriftClientBase implements SomeServiceClientIf {\n  use SomeServiceClientBase;\n\n  /**\n   * Original thrift definition:-\n   * included.SomeMap\n   *   bounce_map(1: included.SomeMap m);\n   */\n  public async function bounce_map(Map<int, string> $m): Awaitable<Map<int, string>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\apache\\thrift\\fixtures\\types\\SomeService_bounce_map_args::fromShape(shape(\n      'm' => $m,\n    ));\n    await $this->asyncHandler_->genBefore(\"SomeService\", \"bounce_map\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"bounce_map\", false);\n    return await $this->genAwaitResponse(\\apache\\thrift\\fixtures\\types\\SomeService_bounce_map_result::class, \"bounce_map\", false, $currentseqid, $rpc_options);\n  }\n\n  /**\n   * Original thrift definition:-\n   * map<TBinary, i64>\n   *   binary_keyed_map(1: list<i64> r);\n   */\n  public async function binary_keyed_map(KeyedContainer<int, int> $r): Awaitable<Map<string, int>> {\n    $hh_frame_metadata = $this->getHHFrameMetadata();\n    if ($hh_frame_metadata !== null) {\n      \\HH\\set_frame_metadata($hh_frame_metadata);\n    }\n    $rpc_options = $this->getAndResetOptions() ?? \\ThriftClientBase::defaultOptions();\n    $args = \\apache\\thrift\\fixtures\\types\\SomeService_binary_keyed_map_args::fromShape(shape(\n      'r' => new Vector($r),\n    ));\n    await $this->asyncHandler_->genBefore(\"SomeService\", \"binary_keyed_map\", $args);\n    $currentseqid = $this->sendImplHelper($args, \"binary_keyed_map\", false);\n    return await $this->genAwaitResponse(\\apache\\thrift\\fixtures\\types\\SomeService_binary_keyed_map_result::class, \"binary_keyed_map\", false, $currentseqid, $rpc_options);\n  }\n\n  /* send and recv functions */\n  public function send_bounce_map(Map<int, string> $m): int {\n    $args = \\apache\\thrift\\fixtures\\types\\SomeService_bounce_map_args::fromShape(shape(\n      'm' => $m,\n    ));\n    return $this->sendImplHelper($args, \"bounce_map\", false);\n  }\n  public function recv_bounce_map(?int $expectedsequenceid = null): Map<int, string> {\n    return $this->recvImplHelper(\\apache\\thrift\\fixtures\\types\\SomeService_bounce_map_result::class, \"bounce_map\", false, $expectedsequenceid);\n  }\n  public function send_binary_keyed_map(KeyedContainer<int, int> $r): int {\n    $args = \\apache\\thrift\\fixtures\\types\\SomeService_binary_keyed_map_args::fromShape(shape(\n      'r' => new Vector($r),\n    ));\n    return $this->sendImplHelper($args, \"binary_keyed_map\", false);\n  }\n  public function recv_binary_keyed_map(?int $expectedsequenceid = null): Map<string, int> {\n    return $this->recvImplHelper(\\apache\\thrift\\fixtures\\types\\SomeService_binary_keyed_map_result::class, \"binary_keyed_map\", false, $expectedsequenceid);\n  }\n}\n\n// HELPER FUNCTIONS AND STRUCTURES\n\nclass SomeService_bounce_map_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'm',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'm' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'m' => ?Map<int, string>,\n  );\n\n  const int STRUCTURAL_ID = 1590329293490505564;\n  public Map<int, string> $m;\n\n  public function __construct(?Map<int, string> $m = null)[] {\n    $this->m = $m ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'm'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SomeService_bounce_map_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.bounce_map_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"included.SomeMap\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"m\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'm') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, string>>($parsed['m']);\n      $_container4 = Map {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_value5 = '';\n        $_value5 = $_value2;\n        $_container4[$_key1] = $_value5;\n      }\n      $this->m = $_container4;\n    }\n  }\n\n}\n\nclass SomeService_bounce_map_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = Map<int, string>;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::STRING,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::STRING,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 390979496709511735;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SomeService_bounce_map_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SomeService_bounce_map_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"included.SomeMap\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, string>>($parsed['success']);\n      $_container4 = Map {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_value5 = '';\n        $_value5 = $_value2;\n        $_container4[$_key1] = $_value5;\n      }\n      $this->success = $_container4;\n    }\n  }\n\n}\n\nclass SomeService_binary_keyed_map_args implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'r',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I64,\n      'elem' => shape(\n        'type' => \\TType::I64,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'r' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'r' => ?Vector<int>,\n  );\n\n  const int STRUCTURAL_ID = 4817436577562933873;\n  public Vector<int> $r;\n\n  public function __construct(?Vector<int> $r = null)[] {\n    $this->r = $r ?? Vector {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'r'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SomeService_binary_keyed_map_args';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.binary_keyed_map_args\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"r\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'r') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['r']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = 0;\n        $_elem5 = $_value2;\n        $_container4 []= $_elem5;\n      }\n      $this->r = $_container4;\n    }\n  }\n\n}\n\nclass SomeService_binary_keyed_map_result extends \\ThriftSyncStructWithResult implements \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const type TResult = Map<string, int>;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    0 => shape(\n      'var' => 'success',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::STRING,\n      'vtype' => \\TType::I64,\n      'key' => shape(\n        'type' => \\TType::STRING,\n        'is_binary' => true,\n      ),\n      'val' => shape(\n        'type' => \\TType::I64,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'success' => 0,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'success' => ?this::TResult,\n  );\n\n  const int STRUCTURAL_ID = 5594803499509360192;\n  public ?this::TResult $success;\n\n  public function __construct(?this::TResult $success = null)[] {\n    $this->success = $success;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'success'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SomeService_binary_keyed_map_result';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"module.SomeService_binary_keyed_map_result\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 0,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.TBinary\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"success\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'success') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<string, int>>($parsed['success']);\n      $_container4 = Map {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_value5 = 0;\n        $_value5 = $_value2;\n        $_container4[$_key1] = $_value5;\n      }\n      $this->success = $_container4;\n    }\n  }\n\n}\n\nclass SomeServiceStaticMetadata implements \\IThriftServiceStaticMetadata {\n  public static function getServiceMetadata()[]: \\tmeta_ThriftService {\n    return \\tmeta_ThriftService::fromShape(\n      shape(\n        \"name\" => \"module.SomeService\",\n        \"functions\" => vec[\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"bounce_map\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                    shape(\n                      \"name\" => \"included.SomeMap\",\n                      \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                            shape(\n                              \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                )\n                              ),\n                              \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                          shape(\n                            \"name\" => \"included.SomeMap\",\n                            \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                                  shape(\n                                    \"keyType\" => \\tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                                      )\n                                    ),\n                                    \"valueType\" => \\tmeta_ThriftType::fromShape(\n                                      shape(\n                                        \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                                      )\n                                    ),\n                                  )\n                                ),\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"m\",\n                  )\n                ),\n              ],\n            )\n          ),\n          \\tmeta_ThriftFunction::fromShape(\n            shape(\n              \"name\" => \"binary_keyed_map\",\n              \"return_type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_typedef\" => \\tmeta_ThriftTypedefType::fromShape(\n                            shape(\n                              \"name\" => \"module.TBinary\",\n                              \"underlyingType\" => \\tmeta_ThriftType::fromShape(\n                                shape(\n                                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,\n                                )\n                              ),\n                            )\n                          ),\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"arguments\" => vec[\n                \\tmeta_ThriftField::fromShape(\n                  shape(\n                    \"id\" => 1,\n                    \"type\" => \\tmeta_ThriftType::fromShape(\n                      shape(\n                        \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                          shape(\n                            \"valueType\" => \\tmeta_ThriftType::fromShape(\n                              shape(\n                                \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,\n                              )\n                            ),\n                          )\n                        ),\n                      )\n                    ),\n                    \"name\" => \"r\",\n                  )\n                ),\n              ],\n            )\n          ),\n        ],\n      )\n    );\n  }\n\n  public static function getServiceMetadataResponse()[]: \\tmeta_ThriftServiceMetadataResponse {\n    return \\tmeta_ThriftServiceMetadataResponse::fromShape(\n      shape(\n        'context' => \\tmeta_ThriftServiceContext::fromShape(\n          shape(\n            'service_info' => self::getServiceMetadata(),\n            'module' => \\tmeta_ThriftModuleContext::fromShape(\n              shape(\n                'name' => 'module',\n              )\n            ),\n          )\n        ),\n        'metadata' => \\tmeta_ThriftMetadata::fromShape(\n          shape(\n            'enums' => dict[\n            ],\n            'structs' => dict[\n            ],\n            'exceptions' => dict[\n            ],\n            'services' => dict[\n            ],\n          )\n        ),\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TServiceAnnotations {\n    return shape(\n      'service' => dict[],\n      'functions' => dict[\n      ],\n    );\n  }\n}\n\n", "num_lines": 862}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/**\n * Autogenerated by Thrift\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n *  @generated\n */\n\nnamespace facebook\\thrift\\annotation;\n\n/**\n * Indicates a definition/feature may change in incompatible ways.\n *\n * Original thrift struct:-\n * Beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Beta'))>>\nclass Beta implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used with permission, may\n * only work in specific contexts, and may change in incompatible ways without\n * notice.\n *\n * Original thrift struct:-\n * Experimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Experimental'))>>\nclass Experimental implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Experimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Experimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should only be used in an ephemeral testing\n * enviornment.\n * \n * Such enviornments only store serialized values temporarly and strictly\n * control which versions of Thrift definitions are used, so 'compatibility'\n * is not a concern.\n *\n * Original thrift struct:-\n * Testing\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Testing'))>>\nclass Testing implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Testing';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Testing\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature should no longer be used.\n *\n * Original thrift struct:-\n * Deprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Deprecated'))>>\nclass Deprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'message',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'message' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'message' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2427562471238739676;\n  /**\n   * Original thrift field:-\n   * 1: string message\n   */\n  public string $message;\n\n  public function __construct(?string $message = null)[] {\n    $this->message = $message ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'message'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Deprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Deprecated\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"message\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'message') !== null) {\n      $this->message = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['message']);\n    }\n  }\n\n}\n\n/**\n * Annotate a thrift structured or enum to indicate if ids or values should not\n * be used.\n * \n * For example, you may want to mark ids as deprecated, or these ids\n * might be reserved for other use cases or annotations.\n * \n * The resolved set of disallowed ids is the union of the values in `ids` and\n * the range of values represented in `id_ranges`. Example:\n * \n *  // These ids are not allowed: 3, 8, half-open ranges [10, 15), [20, 30)\n *  @thrift.ReserveIds{ids = [3, 8], id_ranges = {10: 15, 20: 30}}\n *  struct Foo {\n *    ...\n *    3: i64 f; // Build failure: 3 cannot be used\n *  }\n *\n * Original thrift struct:-\n * ReserveIds\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ReserveIds'))>>\nclass ReserveIds implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'ids',\n      'type' => \\TType::LST,\n      'etype' => \\TType::I32,\n      'elem' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n    2 => shape(\n      'var' => 'id_ranges',\n      'type' => \\TType::MAP,\n      'ktype' => \\TType::I32,\n      'vtype' => \\TType::I32,\n      'key' => shape(\n        'type' => \\TType::I32,\n      ),\n      'val' => shape(\n        'type' => \\TType::I32,\n      ),\n      'format' => 'collection',\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'ids' => 1,\n    'id_ranges' => 2,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'ids' => ?Vector<int>,\n    ?'id_ranges' => ?Map<int, int>,\n  );\n\n  const int STRUCTURAL_ID = 4105998268635615653;\n  /**\n   * Individual ids that cannot be used.\n   * \n   * Original thrift field:-\n   * 1: list<i32> ids\n   */\n  public Vector<int> $ids;\n  /**\n   * Represents ranges of ids that cannot be used.\n   * \n   * Each (key: value) pair represents the half-open range `[key, value)`,\n   * where `key` is included and `value` is not. For example, the map\n   * `{10: 15, 20: 30}` represents the union of id/value ranges `[10, 15)` and\n   * `[20, 30)`.\n   * \n   * Original thrift field:-\n   * 2: map<i32, i32> id_ranges\n   */\n  public Map<int, int> $id_ranges;\n\n  public function __construct(?Vector<int> $ids = null, ?Map<int, int> $id_ranges = null)[] {\n    $this->ids = $ids ?? Vector {};\n    $this->id_ranges = $id_ranges ?? Map {};\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'ids'),\n      Shapes::idx($shape, 'id_ranges'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ReserveIds';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ReserveIds\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_list\" => \\tmeta_ThriftListType::fromShape(\n                    shape(\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"ids\",\n            )\n          ),\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 2,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_map\" => \\tmeta_ThriftMapType::fromShape(\n                    shape(\n                      \"keyType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                      \"valueType\" => \\tmeta_ThriftType::fromShape(\n                        shape(\n                          \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,\n                        )\n                      ),\n                    )\n                  ),\n                )\n              ),\n              \"name\" => \"id_ranges\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'ids') !== null) {\n      $_json3 = HH\\FIXME\\UNSAFE_CAST<mixed, Vector<int>>($parsed['ids']);\n      $_container4 = Vector {};\n      foreach($_json3 as $_key1 => $_value2) {\n        $_elem5 = 0;\n        $_tmp6 = (int)$_value2;\n        if ($_tmp6 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_elem5 = (int)$_tmp6;\n        }\n        $_container4 []= $_elem5;\n      }\n      $this->ids = $_container4;\n    }\n    if (idx($parsed, 'id_ranges') !== null) {\n      $_json10 = HH\\FIXME\\UNSAFE_CAST<mixed, Map<int, int>>($parsed['id_ranges']);\n      $_container11 = Map {};\n      foreach($_json10 as $_key8 => $_value9) {\n        $_value12 = 0;\n        $_tmp13 = (int)$_value9;\n        if ($_tmp13 > 0x7fffffff) {\n          throw new \\TProtocolException(\"number exceeds limit in field\");\n        } else {\n          $_value12 = (int)$_tmp13;\n        }\n        $_container11[$_key8] = $_value12;\n      }\n      $this->id_ranges = $_container11;\n    }\n  }\n\n}\n\n/**\n * Indicates additional backward compatibility restrictions, beyond the\n * standard Thrift required 'wire' compatibility.\n *\n * Original thrift struct:-\n * RequiresBackwardCompatibility\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/RequiresBackwardCompatibility'))>>\nclass RequiresBackwardCompatibility implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field_name',\n      'type' => \\TType::BOOL,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field_name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field_name' => ?bool,\n  );\n\n  const int STRUCTURAL_ID = 4755373036761315562;\n  /**\n   * Original thrift field:-\n   * 1: bool field_name\n   */\n  public bool $field_name;\n\n  public function __construct(?bool $field_name = null)[] {\n    $this->field_name = $field_name ?? false;\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field_name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'RequiresBackwardCompatibility';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.RequiresBackwardCompatibility\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,\n                )\n              ),\n              \"name\" => \"field_name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field_name') !== null) {\n      $this->field_name = HH\\FIXME\\UNSAFE_CAST<mixed, bool>($parsed['field_name']);\n    }\n  }\n\n}\n\n/**\n * Disables testing features.\n *\n * Original thrift struct:-\n * NoTesting\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoTesting'))>>\nclass NoTesting implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoTesting';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoTesting\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables experimental features.\n *\n * Original thrift struct:-\n * NoExperimental\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoExperimental'))>>\nclass NoExperimental implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoExperimental';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoExperimental\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables @Beta features.\n *\n * Original thrift struct:-\n * NoBeta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoBeta'))>>\nclass NoBeta implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoBeta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoBeta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoExperimental' => \\facebook\\thrift\\annotation\\NoExperimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates a definition/feature must not depend directly on an unreleased\n * or testing definition/feature.\n *\n * Original thrift struct:-\n * Released\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Released'))>>\nclass Released implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Released';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Released\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoBeta' => \\facebook\\thrift\\annotation\\NoBeta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\NoTesting' => \\facebook\\thrift\\annotation\\NoTesting::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables legacy features.\n *\n * Original thrift struct:-\n * NoLegacy\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoLegacy'))>>\nclass NoLegacy implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoLegacy';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoLegacy\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Definition' => \\facebook\\thrift\\annotation\\Definition::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Disables @Deprecated features.\n * \n * Should only be enabled in `test` versions, as deprecated implies removing\n * the feature will break current usage (otherwise it would be legacy or\n * deleted).\n *\n * Original thrift struct:-\n * NoDeprecated\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/NoDeprecated'))>>\nclass NoDeprecated implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'NoDeprecated';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.NoDeprecated\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoLegacy' => \\facebook\\thrift\\annotation\\NoLegacy::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * An annotation that changes the field qualifier from 'none' to 'terse'.\n * A terse field is eligible to skip serialization, when it equals to the\n * intrinsic default value. It also clears to the intrinsic default value\n * before deserialization to distinguish between if a terse field was skipped\n * or missing during serialization. This is different from an unqualified\n * field, as an unqualified field is always serialized regardless of its value,\n * and it is not cleared before deserialization.\n * \n * The annotation can be only used to annotate an unqualified field, and when\n * it is annotating a struct or exception, it changes all unqualified fields to\n * terse fields. Note, the annotation can not be used for union.\n *\n * Original thrift struct:-\n * TerseWrite\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/TerseWrite'))>>\nclass TerseWrite implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'TerseWrite';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.TerseWrite\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Program' => \\facebook\\thrift\\annotation\\Program::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack.\n *\n * Original thrift struct:-\n * Box\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Box'))>>\nclass Box implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Box';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Box\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Original thrift struct:-\n * Mixin\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/Mixin'))>>\nclass Mixin implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'Mixin';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.Mixin\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Option to serialize thrift struct in ascending field id order.\n * \n * This can potentially make serialized data size smaller in compact protocol,\n * since compact protocol can write deltas between subsequent field ids.\n *\n * Original thrift struct:-\n * SerializeInFieldIdOrder\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/SerializeInFieldIdOrder'))>>\nclass SerializeInFieldIdOrder implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'SerializeInFieldIdOrder';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.SerializeInFieldIdOrder\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Struct' => \\facebook\\thrift\\annotation\\Struct::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Indicates an enum is a bitmask and should support bit-wise operators.\n *\n * Original thrift struct:-\n * BitmaskEnum\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/BitmaskEnum'))>>\nclass BitmaskEnum implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'BitmaskEnum';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.BitmaskEnum\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all released v1 features.\n *\n * Original thrift struct:-\n * v1\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1'))>>\nclass v1 implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all beta v1 features.\n * \n * Beta features are guaranteed to *not* break unrelated Thrift features\n * so they should be relatively safe to test alongside other beta or\n * released Thrift features.\n *\n * Original thrift struct:-\n * v1beta\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1beta'))>>\nclass v1beta implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1beta';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1beta\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1' => \\facebook\\thrift\\annotation\\v1::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Beta' => \\facebook\\thrift\\annotation\\Beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables all experimental v1 features.\n * \n * Use with *caution* and only with explicit permission. This may enable\n * features may change significantly without notice or not work correctly\n * in all contexts.\n *\n * Original thrift struct:-\n * v1alpha\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1alpha'))>>\nclass v1alpha implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1alpha';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1alpha\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\v1beta' => \\facebook\\thrift\\annotation\\v1beta::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\SerializeInFieldIdOrder' => \\facebook\\thrift\\annotation\\SerializeInFieldIdOrder::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Enables experimental features, even those that are known to break common\n * use cases.\n *\n * Original thrift struct:-\n * v1test\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/v1test'))>>\nclass v1test implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'v1test';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.v1test\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\NoDeprecated' => \\facebook\\thrift\\annotation\\NoDeprecated::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\v1alpha' => \\facebook\\thrift\\annotation\\v1alpha::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Testing' => \\facebook\\thrift\\annotation\\Testing::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Transitive' => \\facebook\\thrift\\annotation\\Transitive::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n/**\n * Specifies the field where the exception message is stored. The field\n * is used to generate an additional method to get it.\n *\n * Original thrift struct:-\n * ExceptionMessage\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/ExceptionMessage'))>>\nclass ExceptionMessage implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'field',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'field' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'field' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 6158382972310209096;\n  /**\n   * Original thrift field:-\n   * 1: string field\n   */\n  public string $field;\n\n  public function __construct(?string $field = null)[] {\n    $this->field = $field ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'field'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'ExceptionMessage';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.ExceptionMessage\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"field\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Exception' => \\facebook\\thrift\\annotation\\Exception::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'field') !== null) {\n      $this->field = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['field']);\n    }\n  }\n\n}\n\n/**\n * Generates a const of type schema. Struct containing the schema of the\n * annotated type. Optionally specify name to override default\n * schema<structName>.\n *\n * Original thrift struct:-\n * GenerateRuntimeSchema\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/GenerateRuntimeSchema'))>>\nclass GenerateRuntimeSchema implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n    1 => shape(\n      'var' => 'name',\n      'type' => \\TType::STRING,\n    ),\n  ];\n  const dict<string, int> FIELDMAP = dict[\n    'name' => 1,\n  ];\n\n  const type TConstructorShape = shape(\n    ?'name' => ?string,\n  );\n\n  const int STRUCTURAL_ID = 2593878277785201336;\n  /**\n   * Original thrift field:-\n   * 1: string name\n   */\n  public string $name;\n\n  public function __construct(?string $name = null)[] {\n    $this->name = $name ?? '';\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n      Shapes::idx($shape, 'name'),\n    );\n  }\n\n  public function getName()[]: string {\n    return 'GenerateRuntimeSchema';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.GenerateRuntimeSchema\",\n        \"fields\" => vec[\n          \\tmeta_ThriftField::fromShape(\n            shape(\n              \"id\" => 1,\n              \"type\" => \\tmeta_ThriftType::fromShape(\n                shape(\n                  \"t_primitive\" => \\tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,\n                )\n              ),\n              \"name\" => \"name\",\n            )\n          ),\n        ],\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Structured' => \\facebook\\thrift\\annotation\\Structured::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Service' => \\facebook\\thrift\\annotation\\Service::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\TConst' => \\facebook\\thrift\\annotation\\TConst::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Enum' => \\facebook\\thrift\\annotation\\Enum::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Typedef' => \\facebook\\thrift\\annotation\\Typedef::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n    if (idx($parsed, 'name') !== null) {\n      $this->name = HH\\FIXME\\UNSAFE_CAST<mixed, string>($parsed['name']);\n    }\n  }\n\n}\n\n/**\n * Indicates that a field's value should never be stored on the stack, and that\n * identical values can be shared in immutable contexts.\n *\n * Original thrift struct:-\n * InternBox\n */\n<<\\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/InternBox'))>>\nclass InternBox implements \\IThriftSyncStruct, \\IThriftStructMetadata {\n  use \\ThriftSerializationTrait;\n\n  const \\ThriftStructTypes::TSpec SPEC = dict[\n  ];\n  const dict<string, int> FIELDMAP = dict[\n  ];\n\n  const type TConstructorShape = shape(\n  );\n\n  const int STRUCTURAL_ID = 957977401221134810;\n\n  public function __construct()[] {\n  }\n\n  public static function withDefaultValues()[]: this {\n    return new static();\n  }\n\n  public static function fromShape(self::TConstructorShape $shape)[]: this {\n    return new static(\n    );\n  }\n\n  public function getName()[]: string {\n    return 'InternBox';\n  }\n\n  public function clearTerseFields()[write_props]: void {\n  }\n\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct {\n    return \\tmeta_ThriftStruct::fromShape(\n      shape(\n        \"name\" => \"thrift.InternBox\",\n        \"is_union\" => false,\n      )\n    );\n  }\n\n  public static function getAllStructuredAnnotations()[write_props]: \\TStructAnnotations {\n    return shape(\n      'struct' => dict[\n        '\\facebook\\thrift\\annotation\\Field' => \\facebook\\thrift\\annotation\\Field::fromShape(\n          shape(\n          )\n        ),\n        '\\facebook\\thrift\\annotation\\Experimental' => \\facebook\\thrift\\annotation\\Experimental::fromShape(\n          shape(\n          )\n        ),\n      ],\n      'fields' => dict[\n      ],\n    );\n  }\n\n  public function getInstanceKey()[write_props]: string {\n    return \\TCompactSerializer::serialize($this);\n  }\n\n  public function readFromJson(string $jsonText): void {\n    $parsed = json_decode($jsonText, true);\n\n    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {\n      throw new \\TProtocolException(\"Cannot parse the given json string.\");\n    }\n\n  }\n\n}\n\n", "num_lines": 2282}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nclass ImportThriftLibFromWWW {\n  public static function run(array<string> $argv): void {\n    invariant(count($argv) >= 2, 'Need to specify path to www');\n    self::importHackLib($argv[1]);\n    self::transpileHack();\n  }\n\n  protected static function importHackLib(string $www_path): void {\n    self::walkPHPFiles(\n      $www_path.'/flib/thrift/core',\n      array(''),\n      function (string $root, string $path, string $file) {\n        if (strpos($path, '__tests__') !== false) {\n          echo \"Skipping $path/$file\\n\";\n          return;\n        }\n\n        $contents = file_get_contents($root.$path.'/'.$file);\n        $contents = preg_replace(\n          '#/\\* BEGIN_STRIP \\*/.*?/\\* END_STRIP \\*/#s',\n          '',\n          $contents,\n        );\n        $contents = preg_replace(\n          '#/\\* INSERT (.*?) END_INSERT \\*/#s',\n          '\\\\1',\n          $contents,\n        );\n\n        $license = array(\n          '/**',\n          '* Copyright (c) 2006- Facebook',\n          '* Distributed under the Thrift Software License',\n          '*',\n          '* See accompanying file LICENSE or visit the Thrift site at:',\n          '* http://developers.facebook.com/thrift/',\n          '*',\n          '* @package '.str_replace('/', '.',dirname('thrift'.$path.'/'.$file)),\n          '*/',\n        );\n        $replacement = \"\\\\1\\n\".implode(\"\\n\", $license).\"\\n\";\n        $contents = preg_replace(\n          '#^(<\\?hh(?: +// +[a-z]+)?\\n)//.*\\n#',\n          $replacement,\n          $contents,\n        );\n\n        if (!file_exists(__DIR__.'/src/'.$path)) {\n          mkdir(__DIR__.'/src/'.$path, 0755, true);\n        }\n        file_put_contents(__DIR__.'/src/'.$path.'/'.$file, $contents);\n        echo \"Imported $path/$file\\n\";\n      }\n    );\n  }\n\n  protected static function transpileHack(): void {\n    $transpiler = realpath(__DIR__.'/../../../_bin/hphp/hack/src/h2tp/h2tp');\n    $source = realpath(__DIR__.'/src');\n    $dest = realpath(__DIR__.'/../php/src');\n\n    system('rm -rf '.$dest);\n    system($transpiler.' '.$source.' '.$dest);\n\n    file_put_contents($dest.'/Thrift.php', implode(\"\\n\", array(\n      '<?php',\n      'if (!isset($GLOBALS[\\'THRIFT_ROOT\\'])) {',\n      '  $GLOBALS[\\'THRIFT_ROOT\\'] = __DIR__;',\n      '}',\n      '',\n      '// This file was split into several separate files',\n      '// Now we can just require_once all of them',\n      '',\n      'require_once $GLOBALS[\\'THRIFT_ROOT\\'].\\'/TType.php\\';',\n      'require_once $GLOBALS[\\'THRIFT_ROOT\\'].\\'/TMessageType.php\\';',\n      'require_once $GLOBALS[\\'THRIFT_ROOT\\'].\\'/TException.php\\';',\n      'require_once $GLOBALS[\\'THRIFT_ROOT\\'].\\'/TBase.php\\';',\n      'require_once $GLOBALS[\\'THRIFT_ROOT\\'].\\'/IThriftClient.php\\';',\n      'require_once $GLOBALS[\\'THRIFT_ROOT\\'].\\'/IThriftProcessor.php\\';',\n      'require_once $GLOBALS[\\'THRIFT_ROOT\\'].\\'/IThriftStruct.php\\';',\n      'require_once $GLOBALS[\\'THRIFT_ROOT\\'].\\'/TProcessorEventHandler.php\\';',\n      'require_once $GLOBALS[\\'THRIFT_ROOT\\'].\\'/TClientEventHandler.php\\';',\n      'require_once $GLOBALS[\\'THRIFT_ROOT\\'].\\'/TApplicationException.php\\';',\n      'require_once $GLOBALS[\\'THRIFT_ROOT\\'].\\'/protocol/TProtocol.php\\';',\n      'require_once $GLOBALS[\\'THRIFT_ROOT\\'].\\'/transport/TTransport.php\\';',\n      '',\n    )));\n\n    file_put_contents($dest.'/autoload.php', implode(\"\\n\", array(\n      '<?php',\n      '// Thrift autoload support is deprecated.',\n      '// Instead, use the Composer autoloader or another',\n      '// autoloader implementation.',\n      '',\n    )));\n\n    $nonclass_files = ImmSet {\n      '/Thrift.php',\n      '/autoload.php',\n    };\n    $classes = Map {};\n\n    self::walkPHPFiles(\n      $dest,\n      array(''),\n      function (string $root, string $path, string $file) use ($classes, $nonclass_files) {\n        if (strpos($path, '__tests__') !== false) {\n          echo \"Skipping $path/$file\\n\";\n          return;\n        }\n\n        if (!$nonclass_files->contains($path.'/'.$file)) {\n          $classes[basename($file, '.php')] = $path.'/'.$file;\n        }\n\n        $contents = file_get_contents($root.$path.'/'.$file);\n\n        $header = array(\n          '<?php',\n          '',\n          '/**',\n          '* Copyright (c) 2006- Facebook',\n          '* Distributed under the Thrift Software License',\n          '*',\n          '* See accompanying file LICENSE or visit the Thrift site at:',\n          '* http://developers.facebook.com/thrift/',\n          '*',\n          '* @package '.str_replace('/', '.', dirname('thrift'.$path.'/'.$file)),\n          '*/',\n          '',\n          '',\n        );\n\n        $contents = preg_replace('#<\\?php\\n#', implode(\"\\n\", $header), $contents);\n\n        file_put_contents($root.$path.'/'.$file, $contents);\n\n        echo \"Added header to $path/$file\\n\";\n      }\n    );\n\n    self::walkPHPFiles(\n      $dest,\n      array(''),\n      function (string $root, string $path, string $file) use ($classes, $nonclass_files) {\n        if (strpos($path, '__tests__') !== false) {\n          echo \"Skipping $path/$file\\n\";\n          return;\n        }\n\n        if ($nonclass_files->contains($path.'/'.$file)) {\n          return;\n        }\n\n        $contents = file_get_contents($root.$path.'/'.$file);\n\n        $includes = Vector {};\n        $skip_includes = ImmMap {\n          'TProtocol.php' => ImmSet {\n            'TBinaryProtocolAccelerated',\n            'TBinaryProtocolUnaccelerated',\n            'TCompactProtocolAccelerated',\n            'TCompactProtocolUnaccelerated',\n          },\n        };\n        foreach ($classes as $class => $classpath) {\n          if ($file === $class.'.php') {\n            continue;\n          }\n          if ($skip_includes->containsKey($file)) {\n            if ($skip_includes->at($file)->contains($class)) {\n              continue;\n            }\n          }\n          if (preg_match('/'.$class.'[^a-zA-Z]/', $contents)) {\n            $includes[] = $classpath;\n          }\n        }\n\n        if (!$includes->isEmpty()) {\n          sort($includes);\n          $hacklib = 'require_once ($GLOBALS[\"HACKLIB_ROOT\"]);';\n          $thrift_root_path = '__DIR__';\n\n          $subdirs = substr_count($path, '/');\n          if ($subdirs > 0) {\n            $thrift_root_path = '__DIR__.\\''.str_repeat('/..', $subdirs).'\\'';\n          }\n\n          $thrift_root = implode(\"\\n\", array(\n            'if (!isset($GLOBALS[\\'THRIFT_ROOT\\'])) {',\n            '  $GLOBALS[\\'THRIFT_ROOT\\'] = '.$thrift_root_path.';',\n            '}',\n          ));\n\n          $replacement = \"$hacklib\\n$thrift_root\\n\".implode(\"\\n\", $includes->map(function ($path): string {\n            return 'require_once $GLOBALS[\\'THRIFT_ROOT\\'].\\''.$path.'\\';';\n          }));\n\n          $contents = str_replace(\n            $hacklib,\n            $replacement,\n            $contents,\n          );\n\n          file_put_contents($root.$path.'/'.$file, $contents);\n\n          echo \"Added includes to $path/$file\\n\";\n        }\n      }\n    );\n  }\n\n  protected static function walkPHPFiles(\n    string $root,\n    array<string> $paths,\n    (function (string, string, string): void) $cb,\n  ): void {\n    for ($i = 0; $i < count($paths); $i++) {\n      $path = $paths[$i];\n      $full_path = $root.$path;\n\n      $files = scandir($full_path);\n      foreach ($files as $file) {\n        if ($file === '.' || $file === '..') {\n          continue;\n        }\n\n        if (is_dir($full_path.'/'.$file)) {\n          $paths[] = $path.'/'.$file;\n        }\n\n        if (!preg_match('/\\.php$/', $file)) {\n          continue;\n        }\n\n        $cb($root, $path, $file);\n      }\n    }\n  }\n}\n\nImportThriftLibFromWWW::run($argv);\n", "num_lines": 261}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\ninterface IThriftAsyncIf extends IThriftIf {\n}\n", "num_lines": 22}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\ninterface IThriftAsyncProcessor extends IThriftProcessor {\n  public function processAsync(\n    TProtocol $input,\n    TProtocol $output,\n  ): Awaitable<bool>;\n}\n", "num_lines": 26}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\ninterface IThriftAsyncRpcOptionsIf extends IThriftIf {\n}\n", "num_lines": 22}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\n/**\n * Base interface for Thrift clients\n */\ninterface IThriftClient {\n  public function getEventHandler(): TClientEventHandler;\n  public function setEventHandler(TClientEventHandler $handler): this;\n  public function getAsyncHandler(): TClientAsyncHandler;\n  public function setAsyncHandler(TClientAsyncHandler $handler): this;\n}\n", "num_lines": 29}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\n/**\n * Base interface for Thrift service handlers/clients\n */\ninterface IThriftIf {\n}\n", "num_lines": 25}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\n/**\n * Base interface for Thrift processors\n */\ninterface IThriftProcessor {\n  public function getEventHandler(): TProcessorEventHandler;\n  public function setEventHandler(TProcessorEventHandler $handler): this;\n  public function process(TProtocol $input, TProtocol $output): bool;\n}\n", "num_lines": 28}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\n/**\n * Interface for Thrift structs that support conversions to shapes\n */\ninterface IThriftShapishStruct extends IThriftStruct {\n  abstract const type TShape;\n\n  public function __toShape(): this::TShape;\n  public static function __fromShape(this::TShape $shape): this;\n\n  public static function __jsonArrayToShape(\n    array<arraykey, mixed> $json_data,\n  ): ?this::TShape;\n}\n", "num_lines": 33}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\n/**\n * Base interface for Thrift structs\n */\n<<__ConsistentConstruct>>\ninterface IThriftStruct extends \\HH\\IMemoizeParam {\n  const type TFieldSpec = \\ThriftStructTypes::TFieldSpec;\n  const type TElemSpec = \\ThriftStructTypes::TElemSpec;\n  const type TGenericSpec = \\ThriftStructTypes::TGenericSpec;\n\n  abstract const dict<int, this::TFieldSpec> SPEC;\n  abstract const dict<string, int> FIELDMAP;\n  abstract const varray<IThriftStruct> ANNOTATIONS;\n  abstract const int STRUCTURAL_ID;\n\n  <<__Rx>>\n  public function __construct();\n  <<__Rx>>\n  public function fromShape();\n  public function getName(): string;\n  public function read(TProtocol $input): int;\n  public function write(TProtocol $input): int;\n  public static function getAllStructuredAnnotations(): \\TStructAnnotations;\n}\n", "num_lines": 43}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\ninterface IThriftSyncIf extends IThriftIf {\n}\n", "num_lines": 22}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\n/**\n * Base interface for Thrift unions\n */\ninterface IThriftUnion<T> extends IThriftStruct {\n  public function getType(): T;\n}\n", "num_lines": 26}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\ntype TStructFieldAnnotations = shape(\n  'field' => dict<string, \\IThriftStruct>,\n  'type' => dict<string, \\IThriftStruct>,\n);\n\ntype TStructAnnotations = shape(\n  'struct' => dict<string, \\IThriftStruct>,\n  'fields' => dict<string, TStructFieldAnnotations>,\n);\n\ntype TServiceAnnotations = shape(\n  'service' => dict<string, \\IThriftStruct>,\n  'functions' => dict<string, dict<string, \\IThriftStruct>>,\n);\n\ntype TEnumAnnotations = shape(\n  'enum' => dict<string, \\IThriftStruct>,\n  'constants' => dict<string, dict<string, \\IThriftStruct>>,\n);\n\ninterface IThriftServiceStaticMetadata {\n  public static function getAllStructuredAnnotations(): \\TServiceAnnotations;\n}\n\ninterface IThriftEnumStaticMetadata {\n  public static function getAllStructuredAnnotations(): \\TEnumAnnotations;\n}\n\ninterface IThriftConstants {\n  public static function getAllStructuredAnnotations(\n  ): dict<string, dict<string, \\IThriftStruct>>;\n}\n\ninterface IThriftExceptionMetadata {\n  public static function getExceptionMetadata()[]: \\tmeta_ThriftException;\n}\n\ninterface IThriftStructMetadata {\n  public static function getStructMetadata()[]: \\tmeta_ThriftStruct;\n}\n", "num_lines": 60}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\nclass TApplicationException extends TException {\n  static array<int, array<string, mixed>>\n    $_TSPEC = array(\n      1 => array('var' => 'message', 'type' => TType::STRING),\n      2 => array('var' => 'code', 'type' => TType::I32),\n    );\n\n  const UNKNOWN = 0;\n  const UNKNOWN_METHOD = 1;\n  const INVALID_MESSAGE_TYPE = 2;\n  const WRONG_METHOD_NAME = 3;\n  const BAD_SEQUENCE_ID = 4;\n  const MISSING_RESULT = 5;\n  const INVALID_TRANSFORM = 6;\n\n  public function __construct(?string $message = null, int $code = 0) {\n    parent::__construct($message, $code);\n  }\n\n  public function read(TProtocol $output) {\n    return $this->_read('TApplicationException', self::$_TSPEC, $output);\n  }\n\n  public function write(TProtocol $output): int {\n    $xfer = 0;\n    $xfer += $output->writeStructBegin('TApplicationException');\n    if ($message = $this->getMessage()) {\n      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);\n      $xfer += $output->writeString($message);\n      $xfer += $output->writeFieldEnd();\n    }\n    if ($code = $this->getCode()) {\n      $xfer += $output->writeFieldBegin('type', TType::I32, 2);\n      $xfer += $output->writeI32($code);\n      $xfer += $output->writeFieldEnd();\n    }\n    $xfer += $output->writeFieldStop();\n    $xfer += $output->writeStructEnd();\n    return $xfer;\n  }\n}\n", "num_lines": 61}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\n/**\n * Base class from which other Thrift structs extend. This is so that we can\n * cut back on the size of the generated code which is turning out to have a\n * nontrivial cost just to load thanks to the wondrously abysmal implementation\n * of PHP. Note that code is intentionally duplicated in here to avoid making\n * function calls for every field or member of a container.\n */\nabstract class TBase {\n\n  static\n    $tmethod = array(\n      TType::BOOL => 'Bool',\n      TType::BYTE => 'Byte',\n      TType::I16 => 'I16',\n      TType::I32 => 'I32',\n      TType::I64 => 'I64',\n      TType::DOUBLE => 'Double',\n      TType::STRING => 'String',\n      TType::FLOAT => 'Float',\n    );\n\n  public abstract function read(TProtocol $input);\n\n  public abstract function write(TProtocol $output);\n\n  public function __construct($spec = null, $vals = null) {\n    if (is_array($spec) && is_array($vals)) {\n      foreach ($spec as $fid => $fspec) {\n        $var = $fspec['var'];\n        if (isset($vals[$var])) {\n          $this->$var = $vals[$var];\n        }\n      }\n    }\n  }\n\n  private function _readMap(&$var, $spec, $input) {\n    $xfer = 0;\n    $ktype = $spec['ktype'];\n    $vtype = $spec['vtype'];\n    $kread = $vread = null;\n    $kspec = array();\n    $vspec = array();\n    if (isset(TBase::$tmethod[$ktype])) {\n      $kread = 'read'.TBase::$tmethod[$ktype];\n    } else {\n      $kspec = $spec['key'];\n    }\n    if (isset(TBase::$tmethod[$vtype])) {\n      $vread = 'read'.TBase::$tmethod[$vtype];\n    } else {\n      $vspec = $spec['val'];\n    }\n    $var = array();\n    $_ktype = 0;\n    $_vtype = 0;\n    $size = 0;\n    $xfer += $input->readMapBegin(inout $_ktype, inout $_vtype, inout $size);\n    for ($i = 0; $i < $size; ++$i) {\n      $key = $val = null;\n      if ($kread !== null) {\n        $xfer += $input->$kread($key);\n      } else {\n        switch ($ktype) {\n          case TType::STRUCT:\n            $class = $kspec['class'];\n            $key = new $class();\n            $xfer += $key->read($input);\n            break;\n          case TType::MAP:\n            $xfer += $this->_readMap($key, $kspec, $input);\n            break;\n          case TType::LST:\n            $xfer += $this->_readList($key, $kspec, $input, false);\n            break;\n          case TType::SET:\n            $xfer += $this->_readList($key, $kspec, $input, true);\n            break;\n        }\n      }\n      if ($vread !== null) {\n        $xfer += $input->$vread($val);\n      } else {\n        switch ($vtype) {\n          case TType::STRUCT:\n            $class = $vspec['class'];\n            $val = new $class();\n            $xfer += $val->read($input);\n            break;\n          case TType::MAP:\n            $xfer += $this->_readMap($val, $vspec, $input);\n            break;\n          case TType::LST:\n            $xfer += $this->_readList($val, $vspec, $input, false);\n            break;\n          case TType::SET:\n            $xfer += $this->_readList($val, $vspec, $input, true);\n            break;\n        }\n      }\n      $var[$key] = $val;\n    }\n    $xfer += $input->readMapEnd();\n    return $xfer;\n  }\n\n  private function _readList(&$var, $spec, $input, $set = false) {\n    $xfer = 0;\n    $etype = $spec['etype'];\n    $eread = $vread = null;\n    if (isset(TBase::$tmethod[$etype])) {\n      $eread = 'read'.TBase::$tmethod[$etype];\n    } else {\n      $espec = $spec['elem'];\n    }\n    /* UNSAFE_EXPR - this array is used both as vector and a map */\n    $var = array();\n    $_etype = $size = 0;\n    if ($set) {\n      $xfer += $input->readSetBegin($_etype, $size);\n    } else {\n      $xfer += $input->readListBegin($_etype, $size);\n    }\n    for ($i = 0; $i < $size; ++$i) {\n      $elem = null;\n      if ($eread !== null) {\n        $xfer += $input->$eread($elem);\n      } else {\n        $espec = $spec['elem'];\n        switch ($etype) {\n          case TType::STRUCT:\n            $class = $espec['class'];\n            $elem = new $class();\n            $xfer += $elem->read($input);\n            break;\n          case TType::MAP:\n            $xfer += $this->_readMap($elem, $espec, $input);\n            break;\n          case TType::LST:\n            $xfer += $this->_readList($elem, $espec, $input, false);\n            break;\n          case TType::SET:\n            $xfer += $this->_readList($elem, $espec, $input, true);\n            break;\n        }\n      }\n      if ($set) {\n        $var[$elem] = true;\n      } else {\n        $var[] = $elem;\n      }\n    }\n    if ($set) {\n      $xfer += $input->readSetEnd();\n    } else {\n      $xfer += $input->readListEnd();\n    }\n    return $xfer;\n  }\n\n  protected function _read($class, $spec, $input) {\n    $xfer = 0;\n    $fname = null;\n    $ftype = 0;\n    $fid = 0;\n    $xfer += $input->readStructBegin(inout $fname);\n    while (true) {\n      $xfer += $input->readFieldBegin(inout $fname, inout $ftype, inout $fid);\n      if ($ftype == TType::STOP) {\n        break;\n      }\n      if (isset($spec[$fid])) {\n        $fspec = $spec[$fid];\n        $var = $fspec['var'];\n        if ($ftype == $fspec['type']) {\n          $xfer = 0;\n          if (isset(TBase::$tmethod[$ftype])) {\n            $func = 'read'.TBase::$tmethod[$ftype];\n            $xfer += $input->$func($this->$var);\n          } else {\n            switch ($ftype) {\n              case TType::STRUCT:\n                $class = $fspec['class'];\n                $this->$var = new $class();\n                $xfer += $this->$var->read($input);\n                break;\n              case TType::MAP:\n                $xfer += $this->_readMap($this->$var, $fspec, $input);\n                break;\n              case TType::LST:\n                $xfer +=\n                  $this->_readList($this->$var, $fspec, $input, false);\n                break;\n              case TType::SET:\n                $xfer +=\n                  $this->_readList($this->$var, $fspec, $input, true);\n                break;\n            }\n          }\n        } else {\n          $xfer += $input->skip($ftype);\n        }\n      } else {\n        $xfer += $input->skip($ftype);\n      }\n      $xfer += $input->readFieldEnd();\n    }\n    $xfer += $input->readStructEnd();\n    return $xfer;\n  }\n\n  private function _writeMap($var, $spec, $output) {\n    $xfer = 0;\n    $ktype = $spec['ktype'];\n    $vtype = $spec['vtype'];\n    $kwrite = $vwrite = null;\n    $kspec = null;\n    $vspec = null;\n    if (isset(TBase::$tmethod[$ktype])) {\n      $kwrite = 'write'.TBase::$tmethod[$ktype];\n    } else {\n      $kspec = $spec['key'];\n    }\n    if (isset(TBase::$tmethod[$vtype])) {\n      $vwrite = 'write'.TBase::$tmethod[$vtype];\n    } else {\n      $vspec = $spec['val'];\n    }\n    $xfer += $output->writeMapBegin($ktype, $vtype, count($var));\n    foreach ($var as $key => $val) {\n      if (isset($kwrite)) {\n        $xfer += $output->$kwrite($key);\n      } else {\n        switch ($ktype) {\n          case TType::STRUCT:\n            $xfer += $key->write($output);\n            break;\n          case TType::MAP:\n            $xfer += $this->_writeMap($key, $kspec, $output);\n            break;\n          case TType::LST:\n            $xfer += $this->_writeList($key, $kspec, $output, false);\n            break;\n          case TType::SET:\n            $xfer += $this->_writeList($key, $kspec, $output, true);\n            break;\n        }\n      }\n      if (isset($vwrite)) {\n        $xfer += $output->$vwrite($val);\n      } else {\n        switch ($vtype) {\n          case TType::STRUCT:\n            $xfer += $val->write($output);\n            break;\n          case TType::MAP:\n            $xfer += $this->_writeMap($val, $vspec, $output);\n            break;\n          case TType::LST:\n            $xfer += $this->_writeList($val, $vspec, $output, false);\n            break;\n          case TType::SET:\n            $xfer += $this->_writeList($val, $vspec, $output, true);\n            break;\n        }\n      }\n    }\n    $xfer += $output->writeMapEnd();\n    return $xfer;\n  }\n\n  private function _writeList($var, $spec, $output, $set = false) {\n    $xfer = 0;\n    $etype = $spec['etype'];\n    $ewrite = null;\n    $espec = null;\n    if (isset(TBase::$tmethod[$etype])) {\n      $ewrite = 'write'.TBase::$tmethod[$etype];\n    } else {\n      $espec = $spec['elem'];\n    }\n    if ($set) {\n      $xfer += $output->writeSetBegin($etype, count($var));\n    } else {\n      $xfer += $output->writeListBegin($etype, count($var));\n    }\n    foreach ($var as $key => $val) {\n      $elem = $set ? $key : $val;\n      if (isset($ewrite)) {\n        $xfer += $output->$ewrite($elem);\n      } else {\n        switch ($etype) {\n          case TType::STRUCT:\n            $xfer += $elem->write($output);\n            break;\n          case TType::MAP:\n            $xfer += $this->_writeMap($elem, $espec, $output);\n            break;\n          case TType::LST:\n            $xfer += $this->_writeList($elem, $espec, $output, false);\n            break;\n          case TType::SET:\n            $xfer += $this->_writeList($elem, $espec, $output, true);\n            break;\n        }\n      }\n    }\n    if ($set) {\n      $xfer += $output->writeSetEnd();\n    } else {\n      $xfer += $output->writeListEnd();\n    }\n    return $xfer;\n  }\n\n  protected function _write($class, $spec, $output) {\n    $xfer = 0;\n    $xfer += $output->writeStructBegin($class);\n    foreach ($spec as $fid => $fspec) {\n      $var = $fspec['var'];\n      if ($this->$var !== null) {\n        $ftype = $fspec['type'];\n        $xfer += $output->writeFieldBegin($var, $ftype, $fid);\n        if (isset(TBase::$tmethod[$ftype])) {\n          $func = 'write'.TBase::$tmethod[$ftype];\n          $xfer += $output->$func($this->$var);\n        } else {\n          switch ($ftype) {\n            case TType::STRUCT:\n              $xfer += $this->$var->write($output);\n              break;\n            case TType::MAP:\n              $xfer += $this->_writeMap($this->$var, $fspec, $output);\n              break;\n            case TType::LST:\n              $xfer +=\n                $this->_writeList($this->$var, $fspec, $output, false);\n              break;\n            case TType::SET:\n              $xfer +=\n                $this->_writeList($this->$var, $fspec, $output, true);\n              break;\n          }\n        }\n        $xfer += $output->writeFieldEnd();\n      }\n    }\n    $xfer += $output->writeFieldStop();\n    $xfer += $output->writeStructEnd();\n    return $xfer;\n  }\n}\n", "num_lines": 372}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\n/**\n * This allows clients to perform calls as generators\n */\nclass TClientAsyncHandler {\n  // Called before send in gen_methodName() calls\n  public async function genBefore(): Awaitable<void> {\n    // Do nothing\n  }\n\n  // Called between the send and recv for gen_methodName() calls\n  public async function genWait(int $sequence_id): Awaitable<void> {\n    // Do nothing\n  }\n\n  // Called after recv in gen_methodName() calls\n  public async function genAfter(): Awaitable<void> {\n    // Do nothing\n  }\n}\n", "num_lines": 39}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\n/**\n * Event handler for thrift clients\n */\nclass TClientEventHandler {\n  public function setClient(IThriftClient $client): void {}\n  // Called before the request is sent to the server\n  public function preSend(\n    string $fn_name,\n    mixed $args,\n    int $sequence_id,\n  ): void {}\n\n  // Called after the request is sent to the server\n  public function postSend(\n    string $fn_name,\n    mixed $args,\n    int $sequence_id,\n  ): void {}\n\n  // Called if there is an exception writing the data\n  public function sendError(\n    string $fn_name,\n    mixed $args,\n    int $sequence_id,\n    Exception $ex,\n  ): void {}\n\n  // Called before the response is read from the server\n  // Exceptions thrown here are caught by clientException and clientError.\n  public function preRecv(string $fn_name, ?int $ex_sequence_id): void {}\n\n  // Called after the response is read from the server\n  public function postRecv(\n    string $fn_name,\n    ?int $ex_sequence_id,\n    mixed $result,\n  ): void {}\n\n  // Called if (and only if) the client threw an expected $exception.\n  public function recvException(\n    string $fn_name,\n    ?int $ex_sequence_id,\n    TException $exception,\n  ): void {}\n\n  // Called if (and only if) the client threw an unexpected $exception.\n  public function recvError(\n    string $fn_name,\n    ?int $ex_sequence_id,\n    Exception $exception,\n  ): void {}\n}\n", "num_lines": 72}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\nfinal class TClientMultiEventHandler extends TClientEventHandler {\n  private Map<string, TClientEventHandler> $handlers;\n\n  public function __construct() {\n    $this->handlers = Map {};\n  }\n\n  public function addHandler(string $key, TClientEventHandler $handler): this {\n    $this->handlers[$key] = $handler;\n    return $this;\n  }\n\n  public function getHandler(string $key): TClientEventHandler {\n    return $this->handlers[$key];\n  }\n\n  public function removeHandler(string $key): TClientEventHandler {\n    $handler = $this->getHandler($key);\n    $this->handlers->remove($key);\n    return $handler;\n  }\n\n  public function preSend(\n    string $fn_name,\n    mixed $args,\n    int $sequence_id,\n  ): void {\n    foreach ($this->handlers as $handler) {\n      $handler->preSend($fn_name, $args, $sequence_id);\n    }\n  }\n\n  public function postSend(\n    string $fn_name,\n    mixed $args,\n    int $sequence_id,\n  ): void {\n    foreach ($this->handlers as $handler) {\n      $handler->postSend($fn_name, $args, $sequence_id);\n    }\n  }\n\n  public function sendError(\n    string $fn_name,\n    mixed $args,\n    int $sequence_id,\n    Exception $ex,\n  ): void {\n    foreach ($this->handlers as $handler) {\n      $handler->sendError($fn_name, $args, $sequence_id, $ex);\n    }\n  }\n\n  public function preRecv(string $fn_name, ?int $ex_sequence_id): void {\n    foreach ($this->handlers as $handler) {\n      $handler->preRecv($fn_name, $ex_sequence_id);\n    }\n  }\n\n  public function postRecv(\n    string $fn_name,\n    ?int $ex_sequence_id,\n    mixed $result,\n  ): void {\n    foreach ($this->handlers as $handler) {\n      $handler->postRecv($fn_name, $ex_sequence_id, $result);\n    }\n  }\n\n  public function recvException(\n    string $fn_name,\n    ?int $ex_sequence_id,\n    TException $exception,\n  ): void {\n    foreach ($this->handlers as $handler) {\n      $handler->recvException($fn_name, $ex_sequence_id, $exception);\n    }\n  }\n\n  public function recvError(\n    string $fn_name,\n    ?int $ex_sequence_id,\n    Exception $exception,\n  ): void {\n    foreach ($this->handlers as $handler) {\n      $handler->recvError($fn_name, $ex_sequence_id, $exception);\n    }\n  }\n}\n", "num_lines": 109}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\n/**\n * NOTE(mcslee): This currently contains a ton of duplicated code from TBase\n * because we need to save CPU cycles and this is not yet in an extension.\n * Ideally we'd multiply-inherit TException from both Exception and Base, but\n * that's not possible in PHP and there are no modules either, so for now we\n * apologetically take a trip to HackTown.\n *\n * Can be called with standard Exception constructor (message, code) or with\n * Thrift Base object constructor (spec, vals).\n *\n * @param mixed $p1 Message (string) or type-spec (array)\n * @param mixed $p2 Code (integer) or values (array)\n */\nclass TException extends Exception {\n  public function __construct($p1 = null, $p2 = 0) {\n    if (is_array($p1) && is_array($p2)) {\n      $spec = $p1;\n      $vals = $p2;\n      foreach ($spec as $fid => $fspec) {\n        $var = $fspec['var'];\n        if (isset($vals[$var])) {\n          $this->$var = $vals[$var];\n        }\n      }\n      parent::__construct();\n    } else {\n      parent::__construct((string) $p1, $p2);\n    }\n  }\n\n  static\n    $tmethod = array(\n      TType::BOOL => 'Bool',\n      TType::BYTE => 'Byte',\n      TType::I16 => 'I16',\n      TType::I32 => 'I32',\n      TType::I64 => 'I64',\n      TType::DOUBLE => 'Double',\n      TType::STRING => 'String',\n      TType::FLOAT => 'Float',\n    );\n\n  private function _readMap(&$var, $spec, $input) {\n    $xfer = 0;\n    $ktype = $spec['ktype'];\n    $vtype = $spec['vtype'];\n    $kread = $vread = null;\n    $kspec = array();\n    $vspec = array();\n    if (isset(TBase::$tmethod[$ktype])) {\n      $kread = 'read'.TBase::$tmethod[$ktype];\n    } else {\n      $kspec = $spec['key'];\n    }\n    if (isset(TBase::$tmethod[$vtype])) {\n      $vread = 'read'.TBase::$tmethod[$vtype];\n    } else {\n      $vspec = $spec['val'];\n    }\n    $var = array();\n    $_ktype = 0;\n    $_vtype = 0;\n    $size = 0;\n    $xfer += $input->readMapBegin(inout $_ktype, inout $_vtype, inout $size);\n    for ($i = 0; $i < $size; ++$i) {\n      $key = $val = null;\n      if ($kread !== null) {\n        $xfer += $input->$kread($key);\n      } else {\n        switch ($ktype) {\n          case TType::STRUCT:\n            $class = $kspec['class'];\n            $key = new $class();\n            $xfer += $key->read($input);\n            break;\n          case TType::MAP:\n            $xfer += $this->_readMap($key, $kspec, $input);\n            break;\n          case TType::LST:\n            $xfer += $this->_readList($key, $kspec, $input, false);\n            break;\n          case TType::SET:\n            $xfer += $this->_readList($key, $kspec, $input, true);\n            break;\n        }\n      }\n      if ($vread !== null) {\n        $xfer += $input->$vread($val);\n      } else {\n        switch ($vtype) {\n          case TType::STRUCT:\n            $class = $vspec['class'];\n            $val = new $class();\n            $xfer += $val->read($input);\n            break;\n          case TType::MAP:\n            $xfer += $this->_readMap($val, $vspec, $input);\n            break;\n          case TType::LST:\n            $xfer += $this->_readList($val, $vspec, $input, false);\n            break;\n          case TType::SET:\n            $xfer += $this->_readList($val, $vspec, $input, true);\n            break;\n        }\n      }\n      $var[$key] = $val;\n    }\n    $xfer += $input->readMapEnd();\n    return $xfer;\n  }\n\n  private function _readList(&$var, $spec, $input, $set = false) {\n    $xfer = 0;\n    $etype = $spec['etype'];\n    $eread = $vread = null;\n    if (isset(TBase::$tmethod[$etype])) {\n      $eread = 'read'.TBase::$tmethod[$etype];\n    } else {\n      $espec = $spec['elem'];\n    }\n    /* UNSAFE_EXPR - this array is used both as vector and a map */\n    $var = array();\n    $_etype = $size = 0;\n    if ($set) {\n      $xfer += $input->readSetBegin($_etype, $size);\n    } else {\n      $xfer += $input->readListBegin($_etype, $size);\n    }\n    for ($i = 0; $i < $size; ++$i) {\n      $elem = null;\n      if ($eread !== null) {\n        $xfer += $input->$eread($elem);\n      } else {\n        $espec = $spec['elem'];\n        switch ($etype) {\n          case TType::STRUCT:\n            $class = $espec['class'];\n            $elem = new $class();\n            $xfer += $elem->read($input);\n            break;\n          case TType::MAP:\n            $xfer += $this->_readMap($elem, $espec, $input);\n            break;\n          case TType::LST:\n            $xfer += $this->_readList($elem, $espec, $input, false);\n            break;\n          case TType::SET:\n            $xfer += $this->_readList($elem, $espec, $input, true);\n            break;\n        }\n      }\n      if ($set) {\n        $var[$elem] = true;\n      } else {\n        $var[] = $elem;\n      }\n    }\n    if ($set) {\n      $xfer += $input->readSetEnd();\n    } else {\n      $xfer += $input->readListEnd();\n    }\n    return $xfer;\n  }\n\n  protected function _read($class, $spec, $input) {\n    $xfer = 0;\n    $fname = null;\n    $ftype = 0;\n    $fid = 0;\n    $xfer += $input->readStructBegin(inout $fname);\n    while (true) {\n      $xfer += $input->readFieldBegin(inout $fname, inout $ftype, inout $fid);\n      if ($ftype == TType::STOP) {\n        break;\n      }\n      if (isset($spec[$fid])) {\n        $fspec = $spec[$fid];\n        $var = $fspec['var'];\n        if ($ftype == $fspec['type']) {\n          $xfer = 0;\n          if (isset(TBase::$tmethod[$ftype])) {\n            $func = 'read'.TBase::$tmethod[$ftype];\n            $xfer += $input->$func($this->$var);\n          } else {\n            switch ($ftype) {\n              case TType::STRUCT:\n                $class = $fspec['class'];\n                $this->$var = new $class();\n                $xfer += $this->$var->read($input);\n                break;\n              case TType::MAP:\n                $xfer += $this->_readMap($this->$var, $fspec, $input);\n                break;\n              case TType::LST:\n                $xfer +=\n                  $this->_readList($this->$var, $fspec, $input, false);\n                break;\n              case TType::SET:\n                $xfer +=\n                  $this->_readList($this->$var, $fspec, $input, true);\n                break;\n            }\n          }\n        } else {\n          $xfer += $input->skip($ftype);\n        }\n      } else {\n        $xfer += $input->skip($ftype);\n      }\n      $xfer += $input->readFieldEnd();\n    }\n    $xfer += $input->readStructEnd();\n    return $xfer;\n  }\n\n  private function _writeMap($var, $spec, $output) {\n    $xfer = 0;\n    $ktype = $spec['ktype'];\n    $vtype = $spec['vtype'];\n    $kwrite = $vwrite = null;\n    $kspec = null;\n    $vspec = null;\n    if (isset(TBase::$tmethod[$ktype])) {\n      $kwrite = 'write'.TBase::$tmethod[$ktype];\n    } else {\n      $kspec = $spec['key'];\n    }\n    if (isset(TBase::$tmethod[$vtype])) {\n      $vwrite = 'write'.TBase::$tmethod[$vtype];\n    } else {\n      $vspec = $spec['val'];\n    }\n    $xfer += $output->writeMapBegin($ktype, $vtype, count($var));\n    foreach ($var as $key => $val) {\n      if (isset($kwrite)) {\n        $xfer += $output->$kwrite($key);\n      } else {\n        switch ($ktype) {\n          case TType::STRUCT:\n            $xfer += $key->write($output);\n            break;\n          case TType::MAP:\n            $xfer += $this->_writeMap($key, $kspec, $output);\n            break;\n          case TType::LST:\n            $xfer += $this->_writeList($key, $kspec, $output, false);\n            break;\n          case TType::SET:\n            $xfer += $this->_writeList($key, $kspec, $output, true);\n            break;\n        }\n      }\n      if (isset($vwrite)) {\n        $xfer += $output->$vwrite($val);\n      } else {\n        switch ($vtype) {\n          case TType::STRUCT:\n            $xfer += $val->write($output);\n            break;\n          case TType::MAP:\n            $xfer += $this->_writeMap($val, $vspec, $output);\n            break;\n          case TType::LST:\n            $xfer += $this->_writeList($val, $vspec, $output, false);\n            break;\n          case TType::SET:\n            $xfer += $this->_writeList($val, $vspec, $output, true);\n            break;\n        }\n      }\n    }\n    $xfer += $output->writeMapEnd();\n    return $xfer;\n  }\n\n  private function _writeList($var, $spec, $output, $set = false) {\n    $xfer = 0;\n    $etype = $spec['etype'];\n    $ewrite = null;\n    $espec = null;\n    if (isset(TBase::$tmethod[$etype])) {\n      $ewrite = 'write'.TBase::$tmethod[$etype];\n    } else {\n      $espec = $spec['elem'];\n    }\n    if ($set) {\n      $xfer += $output->writeSetBegin($etype, count($var));\n    } else {\n      $xfer += $output->writeListBegin($etype, count($var));\n    }\n    foreach ($var as $key => $val) {\n      $elem = $set ? $key : $val;\n      if (isset($ewrite)) {\n        $xfer += $output->$ewrite($elem);\n      } else {\n        switch ($etype) {\n          case TType::STRUCT:\n            $xfer += $elem->write($output);\n            break;\n          case TType::MAP:\n            $xfer += $this->_writeMap($elem, $espec, $output);\n            break;\n          case TType::LST:\n            $xfer += $this->_writeList($elem, $espec, $output, false);\n            break;\n          case TType::SET:\n            $xfer += $this->_writeList($elem, $espec, $output, true);\n            break;\n        }\n      }\n    }\n    if ($set) {\n      $xfer += $output->writeSetEnd();\n    } else {\n      $xfer += $output->writeListEnd();\n    }\n    return $xfer;\n  }\n\n  protected function _write($class, $spec, $output) {\n    $xfer = 0;\n    $xfer += $output->writeStructBegin($class);\n    foreach ($spec as $fid => $fspec) {\n      $var = $fspec['var'];\n      if ($this->$var !== null) {\n        $ftype = $fspec['type'];\n        $xfer += $output->writeFieldBegin($var, $ftype, $fid);\n        if (isset(TBase::$tmethod[$ftype])) {\n          $func = 'write'.TBase::$tmethod[$ftype];\n          $xfer += $output->$func($this->$var);\n        } else {\n          switch ($ftype) {\n            case TType::STRUCT:\n              $xfer += $this->$var->write($output);\n              break;\n            case TType::MAP:\n              $xfer += $this->_writeMap($this->$var, $fspec, $output);\n              break;\n            case TType::LST:\n              $xfer +=\n                $this->_writeList($this->$var, $fspec, $output, false);\n              break;\n            case TType::SET:\n              $xfer +=\n                $this->_writeList($this->$var, $fspec, $output, true);\n              break;\n          }\n        }\n        $xfer += $output->writeFieldEnd();\n      }\n    }\n    $xfer += $output->writeFieldStop();\n    $xfer += $output->writeStructEnd();\n    return $xfer;\n  }\n\n}\n", "num_lines": 379}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\nclass THandlerShortCircuitException extends Exception {\n  const int R_SUCCESS = 0;\n  const int R_EXPECTED_EX = 1;\n  const int R_UNEXPECTED_EX = 2;\n\n  public function __construct(public $result, public int $resultType) {\n    parent::__construct();\n  }\n}\n", "num_lines": 29}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\nabstract class ThriftAsyncProcessor extends ThriftProcessorBase\n  implements IThriftAsyncProcessor {\n\n  abstract const type TThriftIf as IThriftAsyncIf;\n\n  final public async function processAsync(\n    TProtocol $input,\n    TProtocol $output,\n  ): Awaitable<bool> {\n    $rseqid = 0;\n    $fname = '';\n    $mtype = 0;\n\n    $input->readMessageBegin(inout $fname, inout $mtype, inout $rseqid);\n    $methodname = 'process_'.$fname;\n    if (!method_exists($this, $methodname)) {\n      $handler_ctx = $this->eventHandler_->getHandlerContext($fname);\n      $this->eventHandler_->preRead($handler_ctx, $fname, array());\n      $input->skip(TType::STRUCT);\n      $input->readMessageEnd();\n      $this->eventHandler_->postRead($handler_ctx, $fname, array());\n      $x = new TApplicationException(\n        'Function '.$fname.' not implemented.',\n        TApplicationException::UNKNOWN_METHOD,\n      );\n      $this->eventHandler_->handlerError($handler_ctx, $fname, $x);\n      $output->writeMessageBegin($fname, TMessageType::EXCEPTION, $rseqid);\n      $x->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n      return true;\n    }\n    /* UNSAFE_EXPR[2011]: This is safe */\n    await $this->$methodname($rseqid, $input, $output);\n    return true;\n  }\n\n  final public function process(TProtocol $input, TProtocol $output): bool {\n    return HH\\Asio\\join($this->processAsync($input, $output));\n  }\n}\n", "num_lines": 61}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\n<<__ConsistentConstruct>>\nabstract class ThriftClientBase implements IThriftClient {\n  protected TProtocol $input_;\n  protected TProtocol $output_;\n  protected ?IThriftAsyncChannel $channel_;\n  protected TClientAsyncHandler $asyncHandler_;\n  protected TClientEventHandler $eventHandler_;\n\n  protected int $seqid_ = 0;\n\n  final public static function factory(\n  ): (string, (function(TProtocol, ?TProtocol, ?IThriftAsyncChannel): this)) {\n    return tuple(\n      get_called_class(),\n      function(\n        TProtocol $input,\n        ?TProtocol $output,\n        ?IThriftAsyncChannel $channel,\n      ) {\n        return new static($input, $output, $channel);\n      },\n    );\n  }\n\n  public function __construct(\n    TProtocol $input,\n    ?TProtocol $output = null,\n    ?IThriftAsyncChannel $channel = null,\n  ) {\n    $this->input_ = $input;\n    $this->output_ = $output ?: $input;\n    $this->channel_ = $channel;\n    $this->asyncHandler_ = new TClientAsyncHandler();\n    $this->eventHandler_ = new TClientEventHandler();\n  }\n\n  public function setAsyncHandler(TClientAsyncHandler $async_handler): this {\n    $this->asyncHandler_ = $async_handler;\n    return $this;\n  }\n\n  public function getAsyncHandler(): TClientAsyncHandler {\n    return $this->asyncHandler_;\n  }\n\n  public function setEventHandler(TClientEventHandler $event_handler): this {\n    $this->eventHandler_ = $event_handler;\n    return $this;\n  }\n\n  public function getEventHandler(): TClientEventHandler {\n    return $this->eventHandler_;\n  }\n\n  protected function getNextSequenceID(): int {\n    $currentseqid = $this->seqid_;\n    if ($this->seqid_ >= 0x7fffffff) {\n      $this->seqid_ = 0;\n    } else {\n      $this->seqid_++;\n    }\n    return $currentseqid;\n  }\n\n  <<__Memoize>>\n  protected static function defaultOptions()[read_globals]: RpcOptions {\n    return new RpcOptions();\n  }\n\n  /**\n   * For use when you want to set specific options on THE NEXT RPC invocation\n   * utilizing this client.\n   *\n   * You should call this IMMEDIATELY prior to your rpc call, as in\n   * await $client->onceWithOptions($options)->myApiInvocation();\n   *\n   * IMPORTANT: as part of the next RPC call, these options will be reset, so\n   * if you want to apply these options to multiple RPCs calls, you will need\n   * to utilize this function repeatedly\n   */\n  public function onceWithOptions(RpcOptions $rpc_options)[write_props]: this {\n    invariant(\n      $this->options_ is null,\n      'trying to set options twice on the same client at the same time',\n    );\n    $this->options_ = $rpc_options;\n    return $this;\n  }\n\n  protected function getAndResetOptions()[write_props]: ?RpcOptions {\n    $options = $this->options_;\n    $this->options_ = null;\n    return $options;\n  }\n\n  protected function sendImplHelper(\n    IThriftStruct $args,\n    string $function_name,\n    bool $is_one_way,\n  ): int {\n    $currentseqid = $this->getNextSequenceID();\n    try {\n      $this->eventHandler_->preSend($function_name, $args, $currentseqid);\n      if ($this->output_ is \\TBinaryProtocolAccelerated) {\n        thrift_protocol_write_binary(\n          $this->output_,\n          $function_name,\n          TMessageType::CALL,\n          $args,\n          $currentseqid,\n          $this->output_->isStrictWrite(),\n          $is_one_way,\n        );\n      } else if ($this->output_ is \\TCompactProtocolAccelerated) {\n        thrift_protocol_write_compact(\n          $this->output_,\n          $function_name,\n          TMessageType::CALL,\n          $args,\n          $currentseqid,\n          $is_one_way,\n        );\n      } else {\n        $this->output_->writeMessageBegin(\n          $function_name,\n          TMessageType::CALL,\n          $currentseqid,\n        );\n        $args->write($this->output_);\n        $this->output_->writeMessageEnd();\n        if ($is_one_way) {\n          $this->output_->getTransport()->onewayFlush();\n        } else {\n          $this->output_->getTransport()->flush();\n        }\n      }\n    } catch (\\THandlerShortCircuitException $ex) {\n      switch ($ex->resultType) {\n        case THandlerShortCircuitException::R_EXPECTED_EX:\n        case THandlerShortCircuitException::R_UNEXPECTED_EX:\n          $this->eventHandler_\n            ->sendError($function_name, $args, $currentseqid, $ex->result);\n          throw $ex->result;\n        case THandlerShortCircuitException::R_SUCCESS:\n        default:\n          $this->eventHandler_->postSend($function_name, $args, $currentseqid);\n          return $currentseqid;\n      }\n    } catch (\\Exception $ex) {\n      $this->eventHandler_\n        ->sendError($function_name, $args, $currentseqid, $ex);\n      throw $ex;\n    }\n    $this->eventHandler_->postSend($function_name, $args, $currentseqid);\n    return $currentseqid;\n  }\n\n  protected function recvImplHelper<TResulttype as IResultThriftStruct, TRet>(\n    classname<TResulttype> $result,\n    string $name,\n    bool $is_return_void,\n    ?int $expectedsequenceid,\n    shape(?'read_options' => int) $options = shape(),\n  ): TRet where TRet = TResulttype::TResult {\n    try {\n      $this->eventHandler_->preRecv($name, $expectedsequenceid);\n      if ($this->input_ is \\TBinaryProtocolAccelerated) {\n        $result = thrift_protocol_read_binary(\n          $this->input_,\n          $result,\n          $this->input_->isStrictRead(),\n          Shapes::idx($options, 'read_options', 0),\n        );\n      } else if ($this->input_ is \\TCompactProtocolAccelerated) {\n        $result = thrift_protocol_read_compact(\n          $this->input_,\n          $result,\n          Shapes::idx($options, 'read_options', 0),\n        );\n      } else {\n        $rseqid = 0;\n        $fname = '';\n        $mtype = 0;\n\n        $this->input_\n          ->readMessageBegin(inout $fname, inout $mtype, inout $rseqid);\n        if ($mtype === TMessageType::EXCEPTION) {\n          $x = new \\TApplicationException();\n          $x->read($this->input_);\n          $this->input_->readMessageEnd();\n          throw $x;\n        }\n        $result = $result::withDefaultValues();\n        $result->read($this->input_);\n        $this->input_->readMessageEnd();\n        if ($expectedsequenceid !== null && ($rseqid !== $expectedsequenceid)) {\n          throw new \\TProtocolException(\n            $name.\" failed: sequence id is out of order\",\n          );\n        }\n      }\n    } catch (THandlerShortCircuitException $ex) {\n      switch ($ex->resultType) {\n        case THandlerShortCircuitException::R_EXPECTED_EX:\n          $this->eventHandler_\n            ->recvException($name, $expectedsequenceid, $ex->result);\n          throw $ex->result;\n        case THandlerShortCircuitException::R_UNEXPECTED_EX:\n          $this->eventHandler_\n            ->recvError($name, $expectedsequenceid, $ex->result);\n          throw $ex->result;\n        case THandlerShortCircuitException::R_SUCCESS:\n        default:\n          $this->eventHandler_\n            ->postRecv($name, $expectedsequenceid, $ex->result);\n          // this should just always be null in the ThriftSyncStructWithoutResult case\n          return $ex->result;\n      }\n    } catch (\\Exception $ex) {\n      $this->eventHandler_->recvError($name, $expectedsequenceid, $ex);\n      throw $ex;\n    }\n\n    if (!$is_return_void) {\n      if ($result is ThriftSyncStructWithResult) {\n        $successful_result = $result->success;\n      } else if ($result is ThriftAsyncStructWithResult) {\n        $successful_result = $result->success;\n      } else {\n        $successful_result = null;\n      }\n      if ($successful_result is nonnull) {\n        $this->eventHandler_\n          ->postRecv($name, $expectedsequenceid, $successful_result);\n        return $successful_result;\n      }\n    }\n\n    $exception = $result->checkForException();\n    if ($exception is nonnull) {\n      $this->eventHandler_\n        ->recvException($name, $expectedsequenceid, $exception);\n      throw $exception;\n    }\n\n    if ($is_return_void) {\n      $this->eventHandler_\n        ->postRecv($name, $expectedsequenceid, null);\n      return\n        HH\\FIXME\\UNSAFE_CAST<null, TRet>(null, 'FIXME[4110] TRet is void here');\n    } else {\n      $x = new \\TApplicationException(\n        $name.\" failed: unknown result\",\n        TApplicationException::MISSING_RESULT,\n      );\n      $this->eventHandler_\n        ->recvError($name, $expectedsequenceid, $x);\n      throw $x;\n    }\n  }\n\n  protected async function genAwaitResponse<\n    TResulttype as IResultThriftStruct,\n    TRet,\n  >(\n    classname<TResulttype> $result,\n    string $name,\n    bool $is_return_void,\n    int $expectedsequenceid,\n    RpcOptions $rpc_options,\n    shape(?'read_options' => int) $options = shape(),\n  ): Awaitable<TRet> where TRet = TResulttype::TResult {\n    $channel = $this->channel_;\n    $out_transport = $this->output_->getTransport();\n    $in_transport = $this->input_->getTransport();\n    if (\n      $channel !== null &&\n      $out_transport is \\TMemoryBuffer &&\n      $in_transport is \\TMemoryBuffer\n    ) {\n      $msg = $out_transport->getBuffer();\n      $out_transport->resetBuffer();\n      list($result_msg, $_read_headers) =\n        await $channel->genSendRequestResponse($rpc_options, $msg);\n      $in_transport->resetBuffer();\n      $in_transport->write($result_msg);\n    } else {\n      await $this->asyncHandler_->genWait($expectedsequenceid);\n    }\n    $response = $this->recvImplHelper(\n      $result,\n      $name,\n      $is_return_void,\n      $expectedsequenceid,\n      $options,\n    );\n    await $this->asyncHandler_->genAfter();\n    return $response;\n  }\n\n  protected async function genAwaitNoResponse(\n    RpcOptions $rpc_options,\n  ): Awaitable<void> {\n    $channel = $this->channel_;\n    $out_transport = $this->output_->getTransport();\n    if ($channel !== null && $out_transport is \\TMemoryBuffer) {\n      $msg = $out_transport->getBuffer();\n      $out_transport->resetBuffer();\n      await $channel->genSendRequestNoResponse($rpc_options, $msg);\n    }\n  }\n\n  protected function recvImplStreamDecodeHelper<\n    TStreamResponseType as IResultThriftStruct,\n    TStreamType,\n  >(\n    classname<TStreamResponseType> $stream_response_type,\n    string $name,\n    shape(?'read_options' => int) $_options = shape(),\n  ): (function(?string, ?\\Exception): TStreamType)\n  where\n    TStreamType = TStreamResponseType::TResult {\n    $protocol = $this->input_;\n    return (?string $stream_payload, ?\\Exception $ex) ==> {\n      try {\n        if ($ex !== null) {\n          throw $ex;\n        }\n        $transport = $protocol->getTransport();\n        invariant(\n          $transport is \\TMemoryBuffer,\n          \"Stream methods require TMemoryBuffer transport\",\n        );\n\n        $transport->resetBuffer();\n        $transport->write($stream_payload as nonnull);\n        $result = $stream_response_type::withDefaultValues();\n        $result->read($protocol);\n        $protocol->readMessageEnd();\n      } catch (\\THandlerShortCircuitException $ex) {\n        throw $ex->result;\n      }\n      if ($result is ThriftSyncStructWithResult) {\n        $successful_result = $result->success;\n      } else if ($result is ThriftAsyncStructWithResult) {\n        $successful_result = $result->success;\n      } else {\n        $successful_result = null;\n      }\n      if ($successful_result !== null) {\n        return $successful_result;\n      }\n      throw new \\TApplicationException(\n        $name.\" failed: unknown result\",\n        TApplicationException::MISSING_RESULT,\n      );\n    };\n  }\n\n  protected async function genAwaitStreamResponse<\n    TFirstResponseType as IResultThriftStruct,\n    TFirstType,\n    TStreamResponseType as IResultThriftStruct,\n    TStreamType,\n  >(\n    classname<TFirstResponseType> $first_response_type,\n    classname<TStreamResponseType> $stream_response_type,\n    string $name,\n    bool $is_first_response_null,\n    int $expectedsequenceid,\n    RpcOptions $rpc_options,\n    shape(?'read_options' => int) $options = shape(),\n  ): Awaitable<\\ResponseAndClientStream<TFirstType, TStreamType>>\n  where\n    TFirstType = TFirstResponseType::TResult,\n    TStreamType = TStreamResponseType::TResult {\n\n    $channel = $this->channel_;\n    $out_transport = $this->output_->getTransport();\n    $in_transport = $this->input_->getTransport();\n    invariant(\n      $channel !== null &&\n        $out_transport is \\TMemoryBuffer &&\n        $in_transport is \\TMemoryBuffer,\n      \"Stream methods require nonnull channel and TMemoryBuffer transport\",\n    );\n    $msg = $out_transport->getBuffer();\n    $out_transport->resetBuffer();\n    list($result_msg, $_read_headers, $stream) =\n      await $channel->genSendRequestStreamResponse($rpc_options, $msg);\n\n    $stream_gen = $stream->gen<TStreamType>(\n      $this->recvImplStreamDecodeHelper($stream_response_type, $name, $options),\n    );\n    $in_transport->resetBuffer();\n    $in_transport->write($result_msg);\n    $first_response = $this->recvImplHelper(\n      $first_response_type,\n      $name,\n      $is_first_response_null,\n      $expectedsequenceid,\n      $options,\n    );\n    await $this->asyncHandler_->genAfter();\n    return new \\ResponseAndClientStream<TFirstType, TStreamType>(\n      $first_response,\n      $stream_gen,\n    );\n  }\n\n  protected function sendImplSinkEncodeHelper<\n    TSinkPayloadType as IResultThriftStruct,\n    TSinkType,\n  >(classname<TSinkPayloadType> $sink_payload_type): (function(\n    ?TSinkType,\n    ?\\Exception,\n  ): (string, bool)) where TSinkType = TSinkPayloadType::TResult {\n    $protocol = $this->output_;\n    return (?TSinkType $sink_payload, ?\\Exception $ex) ==> {\n      $transport = $protocol->getTransport();\n      invariant(\n        $transport is \\TMemoryBuffer,\n        \"Sink methods require TMemoryBuffer transport\",\n      );\n\n      $is_application_ex = false;\n      if ($ex !== null) {\n        if ($ex is \\TApplicationException) {\n          $is_application_ex = true;\n          $result = $ex;\n        } else {\n          $result = new \\TApplicationException(\n            $ex->getMessage().\"\\n\".$ex->getTraceAsString(),\n          );\n        }\n      } else {\n        $result = $sink_payload_type::withDefaultValues();\n        if ($result is ThriftSyncStructWithResult) {\n          $result->success = $sink_payload;\n        } else if ($result is ThriftAsyncStructWithResult) {\n          $result->success = $sink_payload;\n        }\n      }\n\n      $result->write($protocol);\n      $protocol->writeMessageEnd();\n      $transport->flush();\n      $msg = $transport->getBuffer();\n      $transport->resetBuffer();\n      return tuple($msg, $is_application_ex);\n    };\n  }\n\n  protected function recvImplFinalResponseHelper<\n    TSinkFinalResponseType as IResultThriftStruct,\n    TSinkFinalType,\n  >(\n    classname<TSinkFinalResponseType> $sink_final_response_type,\n    string $name,\n  ): (function(?string, ?\\Exception): TSinkFinalType)\n  where\n    TSinkFinalType = TSinkFinalResponseType::TResult {\n    $protocol = $this->input_;\n    return (?string $sink_final_response, ?\\Exception $ex) ==> {\n      try {\n        if ($ex !== null) {\n          throw $ex;\n        }\n        $transport = $protocol->getTransport();\n        invariant(\n          $transport is \\TMemoryBuffer,\n          \"Stream methods require TMemoryBuffer transport\",\n        );\n\n        $transport->resetBuffer();\n        $transport->write($sink_final_response as nonnull);\n        $result = $sink_final_response_type::withDefaultValues();\n        $result->read($protocol);\n        $protocol->readMessageEnd();\n      } catch (\\THandlerShortCircuitException $ex) {\n        throw $ex->result;\n      }\n      if ($result is ThriftSyncStructWithResult) {\n        if ($result->success !== null) {\n          return $result->success;\n        }\n      } else if ($result is ThriftAsyncStructWithResult) {\n        if ($result->success !== null) {\n          return $result->success;\n        }\n      }\n      throw new \\TApplicationException(\n        $name.\" failed: unknown result\",\n        TApplicationException::MISSING_RESULT,\n      );\n    };\n  }\n\n  protected async function genAwaitSinkResponse<\n    TSinkFirstResponseType as IResultThriftStruct,\n    TSinkFirstType,\n    TSinkPayloadType as IResultThriftStruct,\n    TSinkType,\n    TSinkFinalResponseType as IResultThriftStruct,\n    TSinkFinalType,\n  >(\n    classname<TSinkFirstResponseType> $first_response_type,\n    classname<TSinkPayloadType> $sink_payload_type,\n    classname<TSinkFinalResponseType> $final_response_type,\n    string $name,\n    bool $is_first_response_null,\n    int $expectedsequenceid,\n    RpcOptions $rpc_options,\n    shape(?'read_options' => int) $options = shape(),\n  ): Awaitable<\n    \\ResponseAndClientSink<TSinkFirstType, TSinkType, TSinkFinalType>,\n  >\n  where\n    TSinkFirstType = TSinkFirstResponseType::TResult,\n    TSinkType = TSinkPayloadType::TResult,\n    TSinkFinalType = TSinkFinalResponseType::TResult {\n\n    $channel = $this->channel_;\n    $out_transport = $this->output_->getTransport();\n    $in_transport = $this->input_->getTransport();\n    invariant(\n      $channel !== null &&\n        $out_transport is \\TMemoryBuffer &&\n        $in_transport is \\TMemoryBuffer,\n      \"Sink methods require nonnull channel and TMemoryBuffer transport\",\n    );\n\n    $msg = $out_transport->getBuffer();\n    $out_transport->resetBuffer();\n    list($result_msg, $_read_headers, $sink) =\n      await $channel->genSendRequestSink($rpc_options, $msg);\n\n    $payload_serializer = $this->sendImplSinkEncodeHelper($sink_payload_type);\n    $final_response_deserializer =\n      $this->recvImplFinalResponseHelper($final_response_type, $name);\n    $client_sink_func = async function(\n      AsyncGenerator<null, TSinkType, void> $pld_generator,\n    ) use ($sink, $payload_serializer, $final_response_deserializer) {\n      return await $sink->genSink<TSinkType, TSinkFinalType>(\n        $pld_generator,\n        $payload_serializer,\n        $final_response_deserializer,\n      );\n    };\n\n    $in_transport->resetBuffer();\n    $in_transport->write($result_msg);\n    $first_response = $this->recvImplHelper(\n      $first_response_type,\n      $name,\n      $is_first_response_null,\n      $expectedsequenceid,\n      $options,\n    );\n\n    await $this->asyncHandler_->genAfter();\n    return new \\ResponseAndClientSink<\n      TSinkFirstType,\n      TSinkType,\n      TSinkFinalType,\n    >($first_response, $client_sink_func);\n  }\n}\n", "num_lines": 588}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\nabstract class ThriftProcessorBase implements IThriftProcessor {\n  abstract const type TThriftIf as IThriftIf;\n  protected TProcessorEventHandler $eventHandler_;\n\n  // This exists so subclasses still using php can still access the handler\n  // Once the migration to hack is complete, this field can be removed safely\n  protected mixed $handler_;\n\n  public function __construct(\n    protected this::TThriftIf $handler,\n  ) {\n    $this->eventHandler_ = new TProcessorEventHandler();\n    $this->handler_ = $handler;\n  }\n\n  public function getHandler(): this::TThriftIf {\n    return $this->handler;\n  }\n\n  public function setEventHandler(TProcessorEventHandler $event_handler): this {\n    $this->eventHandler_ = $event_handler;\n    return $this;\n  }\n\n  public function getEventHandler(): TProcessorEventHandler {\n    return $this->eventHandler_;\n  }\n}\n", "num_lines": 48}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Generic Protocol Reader and Writer\n */\nclass ThriftSerializationHelper {\n  public static function readStruct(\n    TProtocol $protocol,\n    $object,\n  ): int {\n    $field_name = '';\n    $field_type = 0;\n    $field_id = 0;\n\n    $tspec = $object::$_TSPEC;\n    $xfer = $protocol->readStructBegin(inout $field_name);\n    while (true) {\n      $xfer += $protocol->readFieldBegin(\n        inout $field_name,\n        inout $field_type,\n        inout $field_id,\n      );\n\n      // Break once we reach the end of the struct.\n      if ($field_type === TType::STOP) {\n        break;\n      }\n\n      if ($field_id !== null) {\n        // Compact, Binary and JSON:\n        // These protocols only encode the field id.\n\n        // Versioning:\n        // Skip type if there is a mismatch between the tspec and the\n        // type we obtain from the buffer.\n        if (!isset($tspec[$field_id]) ||\n            $field_type !== $tspec[$field_id]['type']) {\n          $xfer += $protocol->skip($field_type);\n          $xfer += $protocol->readFieldEnd();\n          continue;\n        }\n\n        // This uses the TSPEC to find the field name.\n        $field_name = $tspec[$field_id]['var'];\n      } else {\n        // SimpleJSON:\n        // This protocol only encodes the field name.\n\n        // Versioning:\n        // Skip type if there is a mismatch between the tspec and the\n        // type that we obtain from the buffer.\n        if (!array_key_exists($field_name, $object::$_TFIELDMAP)) {\n          $xfer += $protocol->skip($field_type);\n          $xfer += $protocol->readFieldEnd();\n          continue;\n        }\n\n        // This uses the TFIELDMAP to find the field id.\n        $field_id = $object::$_TFIELDMAP[$field_name];\n      }\n\n      $xfer += self::readStructHelper(\n        $protocol,\n        $tspec[$field_id]['type'],\n        &$object->$field_name,\n        $tspec[$field_id]\n      );\n\n      $xfer += $protocol->readFieldEnd();\n    }\n    $xfer += $protocol->readStructEnd();\n    return $xfer;\n  }\n\n  public static function readUnion(\n    TProtocol $protocol,\n    $object,\n    &$union_enum,\n  ): int {\n    $field_name = '';\n    $field_type = 0;\n    $field_id = 0;\n\n    $tspec = $object::$_TSPEC;\n    $union_enum_name = get_class($object) . \"Enum\";\n    $union_enum = $union_enum_name::_EMPTY_;\n    $xfer = $protocol->readStructBegin(inout $field_name);\n    while (true) {\n      $xfer += $protocol->readFieldBegin(\n        inout $field_name,\n        inout $field_type,\n        inout $field_id,\n      );\n\n      // Break once we reach the end of the struct.\n      if ($field_type === TType::STOP) {\n        break;\n      }\n\n      if ($field_id !== null) {\n        // Compact, Binary and JSON:\n        // These protocols only encode the field id.\n\n        // Versioning:\n        // Skip type if there is a mismatch between the tspec and the\n        // type we obtain from the buffer.\n        if (!isset($tspec[$field_id]) ||\n            $field_type !== $tspec[$field_id]['type']) {\n          $xfer += $protocol->skip($field_type);\n          $xfer += $protocol->readFieldEnd();\n          continue;\n        }\n\n        // This uses the TSPEC to find the field name.\n        $field_name = $tspec[$field_id]['var'];\n      } else {\n        // SimpleJSON:\n        // This protocol only encodes the field name.\n\n        // Versioning:\n        // Skip type if there is a mismatch between the tspec and the\n        // type that we obtain from the buffer.\n        // Since SimpleJSON doesn't have a field id, we use reflection\n        // to inspect the object for the element.\n        if (!array_key_exists($field_name, $object::$_TFIELDMAP)) {\n          $xfer += $protocol->skip($field_type);\n          $xfer += $protocol->readFieldEnd();\n          continue;\n        }\n\n        // This uses the TFIELDMAP to find the field id.\n        $field_id = $object::$_TFIELDMAP[$field_name];\n      }\n\n      $field_name_tmp = $object->$field_name;\n      $xfer += self::readStructHelper(\n        $protocol,\n        $tspec[$field_id]['type'],\n        &$field_name_tmp,\n        $tspec[$field_id]\n      );\n      $object->$field_name = $field_name_tmp;\n      $union_enum = $union_enum_name::coerce($object::$_TFIELDMAP[$field_name]);\n      $xfer += $protocol->readFieldEnd();\n    }\n    $xfer += $protocol->readStructEnd();\n    return $xfer;\n  }\n\n  private static function readStructHelper(\n    TProtocol $protocol,\n    $field_type,\n    &$object,\n    $tspec,\n  ): int {\n    $xfer = 0;\n    switch ($field_type) {\n      case TType::BOOL:\n        $xfer += $protocol->readBool(&$object);\n        break;\n      case TType::BYTE:\n        $xfer += $protocol->readByte(&$object);\n        break;\n      case TType::I16:\n        $xfer += $protocol->readI16(&$object);\n        break;\n      case TType::I32:\n        // Enums:\n        // In Hack, enums are encoded as I32s.\n        // This looks into the tspec to distinguish the two of them.\n        // Optimization opportunity: Add a TType of enum and encode that to\n        // the tspec to avoid this if statement.\n        if (isset($tspec['enum'])) {\n          $val = null;\n          $xfer += $protocol->readI32(&$val);\n          $enum_class = $tspec['enum'];\n          $object = $enum_class::coerce($val);\n        } else {\n          $xfer += $protocol->readI32(&$object);\n        }\n        break;\n      case TType::I64:\n        $xfer += $protocol->readI64(&$object);\n        break;\n      case TType::DOUBLE:\n        $xfer += $protocol->readDouble(&$object);\n        break;\n      case TType::FLOAT:\n        $xfer += $protocol->readFloat(&$object);\n        break;\n      case TType::STRING:\n        $xfer += $protocol->readString(&$object);\n        break;\n      case TType::LST:\n        $size = 0;\n        $element_type = 0;\n        $xfer += $protocol->readListBegin(&$element_type, &$size);\n\n        // Use the correct collection.\n        $list = null;\n        if ($tspec['format'] === 'harray') {\n          $list = vec[];\n        } else if ($tspec['format'] === 'collection') {\n          $list = Vector {};\n        } else { // format === 'array'\n          $list = varray[];\n        }\n\n        for ($i = 0; $size === null || $i < $size; ++$i) {\n          if ($size === null && !$protocol->readListHasNext()) {\n            break;\n          }\n\n          $list_element = null;\n          $xfer += self::readStructHelper(\n            $protocol,\n            $tspec['etype'],\n            &$list_element,\n            $tspec['elem']\n          );\n\n          // If the element type is enum and the enum\n          // does not exist, it will return a null.\n          if ($list_element === null) {\n            continue;\n          }\n\n          /* HH_IGNORE_ERROR[4006] type can be Vector, vec, or array */\n          $list[] = $list_element;\n        }\n        $object = $list;\n        $xfer += $protocol->readListEnd();\n        break;\n      case TType::SET:\n        $size = 0;\n        $element_type = 0;\n        $xfer += $protocol->readSetBegin(&$element_type, &$size);\n\n        // Use the correct collection.\n        if ($tspec['format'] === 'harray') {\n          $set = keyset[];\n        } else if ($tspec['format'] === 'collection') {\n          $set = Set {};\n        } else { // format === 'array'\n          $set = array();\n        }\n\n        for ($i = 0; $size === null || $i < $size; ++$i) {\n          if ($size === null && !$protocol->readSetHasNext()) {\n            break;\n          }\n\n          $set_element = null;\n          $xfer += self::readStructHelper(\n            $protocol,\n            $tspec['etype'],\n            &$set_element,\n            $tspec['elem']\n          );\n\n          // If the element type is enum and the enum\n          // does not exist, it will return a null.\n          if ($set_element === null) {\n            continue;\n          }\n\n          // When using a set array(), we can't append in the normal way.\n          // Therefore, we need to distinguish between the two types\n          // before we add the element to the set.\n          if ($tspec['format'] === 'array') {\n            invariant(is_array($set), 'for hack');\n            $set[$set_element] = true;\n          } else {\n            /* HH_IGNORE_ERROR[4006] type will be Set or keyset */\n            $set[] = $set_element;\n          }\n        }\n        $object = $set;\n        $xfer += $protocol->readSetEnd();\n        break;\n      case TType::MAP:\n        $size = 0;\n        $key_type = 0;\n        $value_type = 0;\n        $xfer += $protocol->readMapBegin(\n          inout $key_type,\n          inout $value_type,\n          inout $size,\n        );\n\n        // Use the correct collection.\n        $map = null;\n        if ($tspec['format'] === 'harray') {\n          $map = dict[];\n        } else if ($tspec['format'] === 'collection') {\n          $map = Map {};\n        } else { // format === 'array'\n          $map = array();\n        }\n\n        for ($i = 0; $size === null || $i < $size; ++$i) {\n          if ($size === null && !$protocol->readMapHasNext()) {\n            break;\n          }\n\n          $key = null;\n          $val = null;\n          $xfer += self::readStructHelper(\n            $protocol,\n            $tspec['ktype'],\n            &$key,\n            $tspec['key']\n          );\n          $xfer += self::readStructHelper(\n            $protocol,\n            $tspec['vtype'],\n            &$val,\n            $tspec['val']\n          );\n\n          // If the element type is enum and the enum\n          // does not exist, it will return a null.\n          if ($key === null || $val === null) {\n            continue;\n          }\n\n          $map[$key] = $val;\n        }\n        $object = $map;\n        $xfer += $protocol->readMapEnd();\n        break;\n      case TType::STRUCT:\n        $object = new $tspec['class']();\n        $xfer += $object->read($protocol);\n        break;\n      default:\n        $xfer += $protocol->skip($field_type);\n    }\n    return $xfer;\n  }\n\n  public static function writeStruct(\n    TProtocol $protocol,\n    $object,\n  ): int {\n    $xfer = $protocol->writeStructBegin($object->getName());\n    foreach ($object::$_TSPEC as $field_id => $field) {\n      $field_name = $field['var'];\n\n      // Optionals:\n      // When a field is marked as optional and it's not set then\n      // ignore the field. Otherwise, include default value.\n      // Note: If an optional field has a default value,\n      // it will still be added to the buffer.\n      if (!isset($object->$field_name)) {\n        continue;\n      }\n\n      $field_type = $field['type'];\n      $xfer += $protocol->writeFieldBegin($field_name, $field_type, $field_id);\n      $xfer += self::writeStructHelper(\n        $protocol,\n        $field_type,\n        $object->$field_name,\n        $field,\n      );\n      $xfer += $protocol->writeFieldEnd();\n    }\n    $xfer += $protocol->writeFieldStop();\n    $xfer += $protocol->writeStructEnd();\n    return $xfer;\n  }\n\n  private static function writeStructHelper(\n    TProtocol $protocol,\n    $field_type,\n    $object,\n    $tspec,\n  ): int {\n    $xfer = 0;\n    switch ($field_type) {\n      case TType::BOOL:\n        $xfer += $protocol->writeBool($object);\n        break;\n      case TType::BYTE:\n        $xfer += $protocol->writeByte($object);\n        break;\n      case TType::I16:\n        $xfer += $protocol->writeI16($object);\n        break;\n      case TType::I32:\n        $xfer += $protocol->writeI32($object);\n        break;\n      case TType::I64:\n        $xfer += $protocol->writeI64($object);\n        break;\n      case TType::DOUBLE:\n        $xfer += $protocol->writeDouble($object);\n        break;\n      case TType::FLOAT:\n        $xfer += $protocol->writeFloat($object);\n        break;\n      case TType::STRING:\n        $xfer += $protocol->writeString($object);\n        break;\n      case TType::LST:\n        $xfer += $protocol->writeListBegin($tspec['etype'], count($object));\n        if ($object !== null) {\n          foreach ($object ?? vec[] as $iter) {\n            $xfer += self::writeStructHelper(\n              $protocol,\n              $tspec['etype'],\n              $iter,\n              $tspec['elem'],\n            );\n          }\n        }\n        $xfer += $protocol->writeListEnd();\n        break;\n      case TType::SET:\n        $xfer += $protocol->writeSetBegin($tspec['etype'], count($object));\n        if ($object !== null) {\n          foreach ($object as $kiter => $iter) {\n            $xfer += self::writeStructHelper(\n              $protocol,\n              $tspec['etype'],\n              $tspec['format'] === 'array' ? $kiter : $iter,\n              $tspec['elem'],\n            );\n          }\n        }\n        $xfer += $protocol->writeSetEnd();\n        break;\n      case TType::MAP:\n        $xfer += $protocol->writeMapBegin(\n          $tspec['ktype'],\n          $tspec['vtype'],\n          count($object),\n        );\n        if ($object !== null) {\n          foreach ($object ?? dict[] as $kiter => $viter) {\n            $xfer += self::writeStructHelper(\n              $protocol,\n              $tspec['ktype'],\n              $kiter,\n              $tspec['key'],\n            );\n            $xfer += self::writeStructHelper(\n              $protocol,\n              $tspec['vtype'],\n              $viter,\n              $tspec['val'],\n            );\n          }\n        }\n        $xfer += $protocol->writeMapEnd();\n        break;\n      case TType::STRUCT:\n        if ($object !== null) {\n          $xfer += $object->write($protocol);\n        } else {\n          $xfer += $protocol->writeStructBegin($tspec['class']);\n          $xfer += $protocol->writeStructEnd();\n        }\n        break;\n      default:\n        $xfer += $protocol->skip($field_type);\n    }\n    return $xfer;\n  }\n}\n", "num_lines": 487}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Trait for Thrift Structs to call into the Serialization Helper\n */\ntrait ThriftSerializationTrait implements \\IThriftStruct {\n  public function read(\\TProtocol $protocol) : int {\n    return \\ThriftSerializationHelper::readStruct($protocol, $this);\n  }\n\n  public function write(\\TProtocol $protocol) : int {\n    return \\ThriftSerializationHelper::writeStruct($protocol, $this);\n  }\n}\n", "num_lines": 30}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\nabstract final class ThriftStructTypes {\n  const type TFieldSpec = shape(\n    'var' => string,\n    'type' => \\TType,\n    ?'union' => bool,\n    ?'etype' => \\TType,\n    ?'elem' => self::TElemSpec,\n    ?'ktype' => \\TType,\n    ?'vtype' => \\TType,\n    ?'key' => self::TElemSpec,\n    ?'val' => self::TElemSpec,\n    ?'format' => string,\n    ?'class' => string,\n    ?'enum' => string,\n    ?'type_annotations' => varray<\\IThriftStruct>,\n    ?'field_annotations' => varray<\\IThriftStruct>,\n  );\n  const type TElemSpec = shape(\n    'type' => \\TType,\n    ?'etype' => \\TType,\n    ?'elem' => mixed, // self::TElemSpec once hack supports recursive types\n    ?'ktype' => \\TType,\n    ?'vtype' => \\TType,\n    ?'key' => mixed, // self::TElemSpec once hack supports recursive types\n    ?'val' => mixed, // self::TElemSpec once hack supports recursive types\n    ?'format' => string,\n    ?'class' => string,\n    ?'enum' => string,\n  );\n  const type TGenericSpec = shape(\n    'type' => \\TType,\n    ?'var' => string,\n    ?'union' => bool,\n    ?'etype' => \\TType,\n    ?'elem' => mixed, // self::TElemSpec once hack supports recursive types\n    ?'ktype' => \\TType,\n    ?'vtype' => \\TType,\n    ?'key' => mixed, // self::TElemSpec once hack supports recursive types\n    ?'val' => mixed, // self::TElemSpec once hack supports recursive types\n    ?'format' => string,\n    ?'class' => classname<\\IThriftStruct>,\n    ?'enum' => string, // enumname<int>\n    ...\n  );\n}\n", "num_lines": 65}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\nabstract class ThriftSyncProcessor\n  extends ThriftProcessorBase {\n\n  abstract const type TThriftIf as IThriftSyncIf;\n\n  public function process(TProtocol $input, TProtocol $output): bool {\n    $rseqid = 0;\n    $fname = '';\n    $mtype = 0;\n\n    $input->readMessageBegin(inout $fname, inout $mtype, inout $rseqid);\n    $methodname = 'process_'.$fname;\n    if (!method_exists($this, $methodname)) {\n      $handler_ctx = $this->eventHandler_->getHandlerContext($fname);\n      $this->eventHandler_->preRead($handler_ctx, $fname, array());\n      $input->skip(TType::STRUCT);\n      $input->readMessageEnd();\n      $this->eventHandler_->postRead($handler_ctx, $fname, array());\n      $x = new TApplicationException(\n        'Function '.$fname.' not implemented.',\n        TApplicationException::UNKNOWN_METHOD,\n      );\n      $this->eventHandler_->handlerError($handler_ctx, $fname, $x);\n      $output->writeMessageBegin($fname, TMessageType::EXCEPTION, $rseqid);\n      $x->write($output);\n      $output->writeMessageEnd();\n      $output->getTransport()->flush();\n      return true;\n    }\n    /* UNSAFE_EXPR[2011]: This is safe */\n    $this->$methodname($rseqid, $input, $output);\n    return true;\n  }\n}\n", "num_lines": 54}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Trait for Thrift Unions to call into the Serialization Helper\n */\ntrait ThriftUnionSerializationTrait implements \\IThriftStruct {\n\n  public function read(\\TProtocol $protocol): int {\n    /* HH_IGNORE_ERROR[4053] every thrift union has a _type field */\n    $type = $this->_type;\n    $ret = \\ThriftSerializationHelper::readUnion($protocol, $this, inout $type);\n    /* HH_IGNORE_ERROR[4053] every thrift union has a _type field */\n    $this->_type = $type;\n    return $ret;\n  }\n\n  public function write(\\TProtocol $protocol): int {\n    // Writing Structs and Unions is the same procedure.\n    return \\ThriftSerializationHelper::writeStruct($protocol, $this);\n  }\n}\n", "num_lines": 37}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\nabstract final class ThriftUtil {\n\n  <<__Rx, __AtMostRxAsArgs>>\n  public static function mapDict<Tk as arraykey, Tv1, Tv2>(\n    <<__OnlyRxIfImpl(Rx\\KeyedTraversable::class)>>\n    KeyedTraversable<Tk, Tv1> $traversable,\n    <<__AtMostRxAsFunc>> (function(Tv1): Tv2) $value_func,\n  ): dict<Tk, Tv2> {\n    $result = dict[];\n    foreach ($traversable as $key => $value) {\n      $result[$key] = $value_func($value);\n    }\n    return $result;\n  }\n\n  <<__Rx, __AtMostRxAsArgs>>\n  public static function mapVec<Tv1, Tv2>(\n    <<__OnlyRxIfImpl(Rx\\Traversable::class)>> Traversable<Tv1> $traversable,\n    <<__AtMostRxAsFunc>> (function(Tv1): Tv2) $value_func,\n  ): vec<Tv2> {\n    $result = vec[];\n    foreach ($traversable as $value) {\n      $result[] = $value_func($value);\n    }\n    return $result;\n  }\n\n  <<__Rx, __AtMostRxAsArgs>>\n  public static function mapKeyset<Tv1, Tv2 as arraykey>(\n    <<__OnlyRxIfImpl(Rx\\Traversable::class)>> Traversable<Tv1> $traversable,\n    <<__AtMostRxAsFunc>> (function(Tv1): Tv2) $value_func,\n  ): keyset<Tv2> {\n    $result = keyset[];\n    foreach ($traversable as $value) {\n      $result[] = $value_func($value);\n    }\n    return $result;\n  }\n\n  <<__Rx, __AtMostRxAsArgs>>\n  public static function toDArray<Tk as arraykey, Tv>(\n    <<__OnlyRxIfImpl(Rx\\KeyedTraversable::class)>>\n    KeyedTraversable<Tk, Tv> $traversable,\n  ): darray<Tk, Tv> {\n    $result = darray[];\n    foreach ($traversable as $key => $value) {\n      $result[HH\\array_key_cast($key)] = $value;\n    }\n    /* HH_IGNORE_ERROR[4110] maintain lie */\n    return $result;\n  }\n}\n", "num_lines": 72}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\n/**\n * Message types for RPC\n */\nabstract class TMessageType {\n  const CALL = 1;\n  const REPLY = 2;\n  const EXCEPTION = 3;\n}\n", "num_lines": 28}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\n/**\n * Event handler for thrift processors\n */\nclass TProcessorEventHandler {\n\n  // Called at the start of processing a handler method\n  public function getHandlerContext(string $fn_name): mixed {\n    return null;\n  }\n\n  // Called before the handler method's argument are read\n  public function preRead(\n    mixed $handler_context,\n    string $fn_name,\n    mixed $args,\n  ): void {}\n\n  // Called after the handler method's argument are read\n  public function postRead(\n    mixed $handler_context,\n    string $fn_name,\n    mixed $args,\n  ): void {}\n\n  // Called right before the handler is executed.\n  // Exceptions thrown here are caught by handlerException and handlerError.\n  public function preExec(\n    mixed $handler_context,\n    string $service_name,\n    string $fn_name,\n    mixed $args,\n  ): void {}\n\n  // Called right after the handler is executed.\n  // Exceptions thrown here are caught by handlerException and handlerError.\n  public function postExec(\n    mixed $handler_context,\n    string $fn_name,\n    mixed $result,\n  ): void {}\n\n  // Called before the handler method's $results are written\n  public function preWrite(\n    mixed $handler_context,\n    string $fn_name,\n    mixed $result,\n  ): void {}\n\n  // Called after the handler method's $results are written\n  public function postWrite(\n    mixed $handler_context,\n    string $fn_name,\n    mixed $result,\n  ): void {}\n\n  // Called if (and only if) the handler threw an expected $exception.\n  public function handlerException(\n    mixed $handler_context,\n    string $fn_name,\n    Exception $exception,\n  ): void {}\n\n  /**\n   * Called if (and only if) the handler threw an unexpected $exception.\n   *\n   * Note that this method is NOT called if the handler threw an\n   * exception that is declared in the thrift service specification\n   */\n  public function handlerError(\n    mixed $handler_context,\n    string $fn_name,\n    Exception $exception,\n  ): void {}\n}\n", "num_lines": 94}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\nfinal class TProcessorMultiEventHandler extends TProcessorEventHandler {\n  private Map<string, TProcessorEventHandler> $handlers;\n\n  public function __construct() {\n    $this->handlers = Map {};\n  }\n\n  public function addHandler(\n    string $key,\n    TProcessorEventHandler $handler,\n  ): this {\n    $this->handlers[$key] = $handler;\n    return $this;\n  }\n\n  public function getHandler(string $key): TProcessorEventHandler {\n    return $this->handlers[$key];\n  }\n\n  public function removeHandler(string $key): TProcessorEventHandler {\n    $handler = $this->getHandler($key);\n    $this->handlers->remove($key);\n    return $handler;\n  }\n\n  // Called at the start of processing a handler method\n  public function getHandlerContext(string $fn_name): mixed {\n    $context = Map {};\n    foreach ($this->handlers as $key => $handler) {\n      $context[$key] = $handler->getHandlerContext($fn_name);\n    }\n\n    return $context;\n  }\n\n  // Called before the handler method's argument are read\n  public function preRead(\n    mixed $handler_context,\n    string $fn_name,\n    mixed $args,\n  ): void {\n    invariant($handler_context instanceof Map, 'Context is not a Map');\n    foreach ($this->handlers as $key => $handler) {\n      $handler->preRead($handler_context->at($key), $fn_name, $args);\n    }\n  }\n\n  // Called after the handler method's argument are read\n  public function postRead(\n    mixed $handler_context,\n    string $fn_name,\n    mixed $args,\n  ): void {\n    invariant($handler_context instanceof Map, 'Context is not a Map');\n    foreach ($this->handlers as $key => $handler) {\n      $handler->postRead($handler_context->at($key), $fn_name, $args);\n    }\n  }\n\n  // Called right before the handler is executed.\n  // Exceptions thrown here are caught by handlerException and handlerError.\n  public function preExec(\n    mixed $handler_context,\n    string $service_name,\n    string $fn_name,\n    mixed $args,\n  ): void {\n    invariant($handler_context instanceof Map, 'Context is not a Map');\n    foreach ($this->handlers as $key => $handler) {\n      $handler->preExec(\n        $handler_context->at($key),\n        $service_name,\n        $fn_name,\n        $args\n      );\n    }\n  }\n\n  // Called right after the handler is executed.\n  // Exceptions thrown here are caught by handlerException and handlerError.\n  public function postExec(\n    mixed $handler_context,\n    string $fn_name,\n    mixed $result,\n  ): void {\n    invariant($handler_context instanceof Map, 'Context is not a Map');\n    foreach ($this->handlers as $key => $handler) {\n      $handler->postExec($handler_context->at($key), $fn_name, $result);\n    }\n  }\n\n  // Called before the handler method's $results are written\n  public function preWrite(\n    mixed $handler_context,\n    string $fn_name,\n    mixed $result,\n  ): void {\n    invariant($handler_context instanceof Map, 'Context is not a Map');\n    foreach ($this->handlers as $key => $handler) {\n      $handler->preWrite($handler_context->at($key), $fn_name, $result);\n    }\n  }\n\n  // Called after the handler method's $results are written\n  public function postWrite(\n    mixed $handler_context,\n    string $fn_name,\n    mixed $result,\n  ): void {\n    invariant($handler_context instanceof Map, 'Context is not a Map');\n    foreach ($this->handlers as $key => $handler) {\n      $handler->postWrite($handler_context->at($key), $fn_name, $result);\n    }\n  }\n\n  // Called if (and only if) the handler threw an expected $exception.\n  public function handlerException(\n    mixed $handler_context,\n    string $fn_name,\n    Exception $ex,\n  ): void {\n    invariant($handler_context instanceof Map, 'Context is not a Map');\n    foreach ($this->handlers as $key => $handler) {\n      $handler->handlerException($handler_context->at($key), $fn_name, $ex);\n    }\n  }\n\n  /**\n   * Called if (and only if) the handler threw an unexpected $exception.\n   *\n   * Note that this method is NOT called if the handler threw an\n   * exception that is declared in the thrift service specification\n   */\n  public function handlerError(\n    mixed $handler_context,\n    string $fn_name,\n    Exception $ex,\n  ): void {\n    invariant($handler_context instanceof Map, 'Context is not a Map');\n    foreach ($this->handlers as $key => $handler) {\n      $handler->handlerError($handler_context->at($key), $fn_name, $ex);\n    }\n  }\n}\n", "num_lines": 164}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\n/**\n * Data types that can be sent via Thrift\n */\nenum TType: int as int {\n  STOP = 0;\n  VOID = 1;\n  BOOL = 2;\n  BYTE = 3;\n  DOUBLE = 4;\n  I16 = 6;\n  I32 = 8;\n  I64 = 10;\n  STRING = 11;\n  STRUCT = 12;\n  MAP = 13;\n  SET = 14;\n  LST = 15; // N.B. cannot use LIST keyword in PHP!\n  UTF8 = 16;\n  UTF16 = 17;\n  FLOAT = 19;\n}\n", "num_lines": 41}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift\n */\n\n// Result message and read headers\ntype TAsyncChannelResponse = (string, darray<string, string>);\n\n<<Oncalls('thrift')>>\ninterface IThriftAsyncChannel {\n  public function genSendRequestResponse(\n    \\RpcOptions $options,\n    string $msg,\n  ): Awaitable<TAsyncChannelResponse>;\n\n  public function genSendRequestNoResponse(\n    \\RpcOptions $options,\n    string $msg,\n  ): Awaitable<void>;\n}\n", "num_lines": 35}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol\n */\n\n/**\n * Protocol base class module.\n */\nabstract class TProtocol {\n  // The below may seem silly, but it is to get around the problem that the\n  // \"instanceof\" operator can only take in a T_VARIABLE and not a T_STRING\n  // or T_CONSTANT_ENCAPSED_STRING. Using \"is_a()\" instead of \"instanceof\" is\n  // a workaround but is deprecated in PHP5. This is used in the generated\n  // deserialization code.\n  public static $TBINARYPROTOCOLACCELERATED = 'TBinaryProtocolAccelerated';\n  public static $TCOMPACTPROTOCOLACCELERATED = 'TCompactProtocolAccelerated';\n  public static\n    $TBINARYPROTOCOLUNACCELERATED = 'TBinaryProtocolUnaccelerated';\n  public static\n    $TCOMPACTPROTOCOLUNACCELERATED = 'TCompactProtocolUnaccelerated';\n\n  /**\n   * Underlying transport\n   *\n   * @var TTransport\n   */\n  protected TTransport $trans_;\n\n  /**\n   * Constructor\n   */\n  protected function __construct($trans) {\n    $this->trans_ = $trans;\n  }\n\n  /**\n   * Accessor for transport\n   *\n   * @return TTransport\n   */\n  public function getTransport() {\n    return $this->trans_;\n  }\n\n  // NOTE: These are deprecated\n  public function getOutputTransport() {\n    return $this->trans_;\n  }\n  public function getInputTransport() {\n    return $this->trans_;\n  }\n\n  /**\n   * Writes the message header\n   *\n   * @param string $name Function name\n   * @param int $type message type TMessageType::CALL or TMessageType::REPLY\n   * @param int $seqid The sequence id of this message\n   */\n  public abstract function writeMessageBegin($name, $type, $seqid);\n\n  /**\n   * Close the message\n   */\n  public abstract function writeMessageEnd();\n\n  /**\n   * Writes a struct header.\n   *\n   * @param string     $name Struct name\n   * @throws TException on write error\n   * @return int How many bytes written\n   */\n  public abstract function writeStructBegin($name);\n\n  /**\n   * Close a struct.\n   *\n   * @throws TException on write error\n   * @return int How many bytes written\n   */\n  public abstract function writeStructEnd();\n\n  /*\n   * Starts a field.\n   *\n   * @param string     $name Field name\n   * @param int        $type Field type\n   * @param int        $fid  Field id\n   * @throws TException on write error\n   * @return int How many bytes written\n   */\n  public abstract function writeFieldBegin($fieldName, $fieldType, $fieldId);\n\n  public abstract function writeFieldEnd();\n\n  public abstract function writeFieldStop();\n\n  public abstract function writeMapBegin($keyType, $valType, $size);\n\n  public abstract function writeMapEnd();\n\n  public abstract function writeListBegin($elemType, $size);\n\n  public abstract function writeListEnd();\n\n  public abstract function writeSetBegin($elemType, $size);\n\n  public abstract function writeSetEnd();\n\n  public abstract function writeBool($bool);\n\n  public abstract function writeByte($byte);\n\n  public abstract function writeI16($i16);\n\n  public abstract function writeI32($i32);\n\n  public abstract function writeI64($i64);\n\n  public abstract function writeDouble($dub);\n\n  public abstract function writeFloat($flt);\n\n  public abstract function writeString($str);\n\n  /**\n   * Reads the message header\n   *\n   * @param string $name Function name\n   * @param int $type message type TMessageType::CALL or TMessageType::REPLY\n   * @param int $seqid The sequence id of this message\n   */\n  public abstract function readMessageBegin(\n    inout $name,\n    inout $type,\n    inout $seqid,\n  );\n\n  /**\n   * Read the close of message\n   */\n  public abstract function readMessageEnd();\n\n  public abstract function readStructBegin(inout $name);\n\n  public abstract function readStructEnd();\n\n  public abstract function readFieldBegin(\n    inout $name,\n    inout $fieldType,\n    inout $fieldId,\n  );\n\n  public abstract function readFieldEnd();\n\n  public abstract function readMapBegin(\n    inout $keyType,\n    inout $valType,\n    inout $size,\n  );\n\n  public function readMapHasNext(): bool {\n    throw new TProtocolException(\n      get_called_class().' does not support unknown map sizes',\n    );\n  }\n\n  public abstract function readMapEnd();\n\n  public abstract function readListBegin(&$elemType, &$size);\n\n  public function readListHasNext(): bool {\n    throw new TProtocolException(\n      get_called_class().' does not support unknown list sizes',\n    );\n  }\n\n  public abstract function readListEnd();\n\n  public abstract function readSetBegin(&$elemType, &$size);\n\n  public function readSetHasNext(): bool {\n    throw new TProtocolException(\n      get_called_class().' does not support unknown set sizes',\n    );\n  }\n\n  public abstract function readSetEnd();\n\n  public abstract function readBool(&$bool);\n\n  public abstract function readByte(&$byte);\n\n  public abstract function readI16(&$i16);\n\n  public abstract function readI32(&$i32);\n\n  public abstract function readI64(&$i64);\n\n  public abstract function readDouble(&$dub);\n\n  public abstract function readFloat(&$flt);\n\n  public abstract function readString(&$str);\n\n  /**\n   * The skip function is a utility to parse over unrecognized date without\n   * causing corruption.\n   *\n   * @param TType $type What type is it\n   */\n  public function skip($type) {\n    $_ref = null;\n    switch ($type) {\n      case TType::BOOL:\n        return $this->readBool($_ref);\n      case TType::BYTE:\n        return $this->readByte($_ref);\n      case TType::I16:\n        return $this->readI16($_ref);\n      case TType::I32:\n        return $this->readI32($_ref);\n      case TType::I64:\n        return $this->readI64($_ref);\n      case TType::DOUBLE:\n        return $this->readDouble($_ref);\n      case TType::FLOAT:\n        return $this->readFloat($_ref);\n      case TType::STRING:\n        return $this->readString($_ref);\n      case TType::STRUCT: {\n          $result = $this->readStructBegin(inout $_ref);\n          while (true) {\n            $ftype = null;\n            $result += $this->readFieldBegin(\n              inout $_ref,\n              inout $ftype,\n              inout $_ref,\n            );\n            if ($ftype == TType::STOP) {\n              break;\n            }\n            $result += $this->skip($ftype);\n            $result += $this->readFieldEnd();\n          }\n          $result += $this->readStructEnd();\n          return $result;\n        }\n      case TType::MAP: {\n          $keyType = null;\n          $valType = null;\n          $size = 0;\n          $result = $this->readMapBegin(\n            inout $keyType,\n            inout $valType,\n            inout $size,\n          );\n          for ($i = 0; $size === null || $i < $size; $i++) {\n            if ($size === null && !$this->readMapHasNext()) {\n              break;\n            }\n            $result += $this->skip($keyType);\n            $result += $this->skip($valType);\n          }\n          $result += $this->readMapEnd();\n          return $result;\n        }\n      case TType::SET: {\n          $elemType = null;\n          $size = 0;\n          $result = $this->readSetBegin($elemType, $size);\n          for ($i = 0; $size === null || $i < $size; $i++) {\n            if ($size === null && !$this->readSetHasNext()) {\n              break;\n            }\n            $result += $this->skip($elemType);\n          }\n          $result += $this->readSetEnd();\n          return $result;\n        }\n      case TType::LST: {\n          $elemType = null;\n          $size = 0;\n          $result = $this->readListBegin($elemType, $size);\n          for ($i = 0; $size === null || $i < $size; $i++) {\n            if ($size === null && !$this->readSetHasNext()) {\n              break;\n            }\n            $result += $this->skip($elemType);\n          }\n          $result += $this->readListEnd();\n          return $result;\n        }\n      default:\n        throw new TProtocolException(\n          'Unknown field type: '.$type,\n          TProtocolException::INVALID_DATA,\n        );\n    }\n  }\n\n  /**\n   * Utility for skipping binary data\n   *\n   * @param TTransport $itrans TTransport object\n   * @param int        $type   Field type\n   */\n  public static function skipBinary($itrans, $type) {\n    switch ($type) {\n      case TType::BOOL:\n        return $itrans->readAll(1);\n      case TType::BYTE:\n        return $itrans->readAll(1);\n      case TType::I16:\n        return $itrans->readAll(2);\n      case TType::I32:\n        return $itrans->readAll(4);\n      case TType::I64:\n        return $itrans->readAll(8);\n      case TType::DOUBLE:\n        return $itrans->readAll(8);\n      case TType::FLOAT:\n        return $itrans->readAll(4);\n      case TType::STRING:\n        $len = unpack('N', $itrans->readAll(4));\n        $len = $len[1];\n        if ($len > 0x7fffffff) {\n          $len = 0 - (($len - 1) ^ 0xffffffff);\n        }\n        return 4 + $itrans->readAll($len);\n      case TType::STRUCT: {\n          $result = 0;\n          while (true) {\n            $ftype = 0;\n            $fid = 0;\n            $data = $itrans->readAll(1);\n            $arr = unpack('c', $data);\n            $ftype = $arr[1];\n            if ($ftype == TType::STOP) {\n              break;\n            }\n            // I16 field id\n            $result += $itrans->readAll(2);\n            $result += self::skipBinary($itrans, $ftype);\n          }\n          return $result;\n        }\n      case TType::MAP: {\n          // Ktype\n          $data = $itrans->readAll(1);\n          $arr = unpack('c', $data);\n          $ktype = $arr[1];\n          // Vtype\n          $data = $itrans->readAll(1);\n          $arr = unpack('c', $data);\n          $vtype = $arr[1];\n          // Size\n          $data = $itrans->readAll(4);\n          $arr = unpack('N', $data);\n          $size = $arr[1];\n          if ($size > 0x7fffffff) {\n            $size = 0 - (($size - 1) ^ 0xffffffff);\n          }\n          $result = 6;\n          for ($i = 0; $i < $size; $i++) {\n            $result += self::skipBinary($itrans, $ktype);\n            $result += self::skipBinary($itrans, $vtype);\n          }\n          return $result;\n        }\n      case TType::SET:\n      case TType::LST: {\n          // Vtype\n          $data = $itrans->readAll(1);\n          $arr = unpack('c', $data);\n          $vtype = $arr[1];\n          // Size\n          $data = $itrans->readAll(4);\n          $arr = unpack('N', $data);\n          $size = $arr[1];\n          if ($size > 0x7fffffff) {\n            $size = 0 - (($size - 1) ^ 0xffffffff);\n          }\n          $result = 5;\n          for ($i = 0; $i < $size; $i++) {\n            $result += self::skipBinary($itrans, $vtype);\n          }\n          return $result;\n        }\n      default:\n        throw new TProtocolException(\n          'Unknown field type: '.$type,\n          TProtocolException::INVALID_DATA,\n        );\n    }\n  }\n}\n", "num_lines": 413}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol\n */\n\n/**\n * Protocol module. Contains all the types and definitions needed to implement\n * a protocol encoder/decoder.\n *\n * @package thrift.protocol\n */\n\n/**\n * Protocol exceptions\n */\nclass TProtocolException extends TException {\n  const UNKNOWN = 0;\n  const INVALID_DATA = 1;\n  const NEGATIVE_SIZE = 2;\n  const SIZE_LIMIT = 3;\n  const BAD_VERSION = 4;\n  const NOT_IMPLEMENTED = 5;\n  const MISSING_REQUIRED_FIELD = 6;\n\n  public function __construct(?string $message = null, int $code = 0) {\n    parent::__construct($message, $code);\n  }\n}\n", "num_lines": 43}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol\n */\n\n/**\n * Protocol factory creates protocol objects from transports\n */\ninterface TProtocolFactory {\n  /**\n   * Build a protocol from the base transport\n   *\n   * @return TProtocol protocol\n   */\n  public function getProtocol(TTransport $trans): TProtocol;\n}\n", "num_lines": 31}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol\n */\n\n/**\n * Base class for serializing thrift structs using a TProtocol\n */\n<<__ConsistentConstruct>>\nabstract class TProtocolSerializer {\n  abstract public static function serialize(IThriftStruct $object): string;\n\n  abstract public static function deserialize<T as IThriftStruct>(\n    string $str,\n    T $object,\n  ): T;\n}\n", "num_lines": 32}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.binary\n */\n\n/**\n * Do not use this class.\n *\n * This class exists for backwards compatibility, use TBinaryProtocolAccelerated\n * or TBinaryProtocolUnaccelerated\n * @deprecated\n */\nclass TBinaryProtocol extends TBinaryProtocolAccelerated {\n  public function __construct(\n    $trans,\n    $strict_read = false,\n    $strict_write = true,\n  ) {\n    parent::__construct($trans, $strict_read, $strict_write);\n  }\n}\n", "num_lines": 36}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.binary\n */\n\n/**\n * Accelerated binary protocol: used in conjunction with the thrift_protocol\n * extension for faster deserialization\n */\nclass TBinaryProtocolAccelerated extends TBinaryProtocolBase {\n  public function __construct(\n    $trans,\n    $strict_read = false,\n    $strict_write = true,\n  ) {\n    // If the transport doesn't implement putBack, wrap it in a\n    // TBufferedTransport (which does)\n    if (!($trans instanceof IThriftBufferedTransport)) {\n      $trans = new TBufferedTransport($trans);\n    }\n    parent::__construct($trans, $strict_read, $strict_write);\n  }\n  public function isStrictRead() {\n    return $this->strictRead_;\n  }\n  public function isStrictWrite() {\n    return $this->strictWrite_;\n  }\n}\n", "num_lines": 44}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.binary\n */\n\n/**\n * Binary implementation of the Thrift protocol.\n */\nabstract class TBinaryProtocolBase extends TProtocol {\n\n  const VERSION_MASK = 0xffff0000;\n  const VERSION_1 = 0x80010000;\n\n  protected $strictRead_ = false;\n  protected $strictWrite_ = true;\n  protected $littleendian_ = false;\n  protected $memory_limit = 128000000; //128M, the default\n  protected $sequenceID = null;\n\n  public function __construct(\n    $trans,\n    $strictRead = false,\n    $strictWrite = true,\n  ) {\n    parent::__construct($trans);\n    $this->strictRead_ = $strictRead;\n    $this->strictWrite_ = $strictWrite;\n    if (pack('S', 1) == \"\\x01\\x00\") {\n      $this->littleendian_ = true;\n    }\n    $this->memory_limit = self::getBytes(ini_get('memory_limit'));\n  }\n\n  // helper function to get integer from potential php short notation\n  public static function getBytes($notation) {\n    $val = trim($notation);\n    $last = strtolower($val[strlen($val) - 1]);\n    switch ($last) {\n      // The 'G' modifier is available since PHP 5.1.0\n      case 'g':\n        $val *= 1024;\n        // FALLTHROUGH\n      case 'm':\n        $val *= 1024;\n        // FALLTHROUGH\n      case 'k':\n        $val *= 1024;\n    }\n\n    return $val;\n  }\n\n  public function writeMessageBegin($name, $type, $seqid) {\n    if ($this->strictWrite_) {\n      $version = self::VERSION_1 | $type;\n      return\n        $this->writeI32($version) +\n        $this->writeString($name) +\n        $this->writeI32($seqid);\n    } else {\n      return\n        $this->writeString($name) +\n        $this->writeByte($type) +\n        $this->writeI32($seqid);\n    }\n  }\n\n  public function writeMessageEnd() {\n    return 0;\n  }\n\n  public function writeStructBegin($name) {\n    return 0;\n  }\n\n  public function writeStructEnd() {\n    return 0;\n  }\n\n  public function writeFieldBegin($fieldName, $fieldType, $fieldId) {\n    return $this->writeByte($fieldType) + $this->writeI16($fieldId);\n  }\n\n  public function writeFieldEnd() {\n    return 0;\n  }\n\n  public function writeFieldStop() {\n    return $this->writeByte(TType::STOP);\n  }\n\n  public function writeMapBegin($keyType, $valType, $size) {\n    return\n      $this->writeByte($keyType) +\n      $this->writeByte($valType) +\n      $this->writeI32($size);\n  }\n\n  public function writeMapEnd() {\n    return 0;\n  }\n\n  public function writeListBegin($elemType, $size) {\n    return $this->writeByte($elemType) + $this->writeI32($size);\n  }\n\n  public function writeListEnd() {\n    return 0;\n  }\n\n  public function writeSetBegin($elemType, $size) {\n    return $this->writeByte($elemType) + $this->writeI32($size);\n  }\n\n  public function writeSetEnd() {\n    return 0;\n  }\n\n  public function writeBool($value) {\n    $data = pack('c', $value ? 1 : 0);\n    $this->trans_->write($data);\n    return 1;\n  }\n\n  public function writeByte($value) {\n    $this->trans_->write(chr($value));\n    return 1;\n  }\n\n  public function writeI16($value) {\n    $data = chr($value).chr($value >> 8);\n    if ($this->littleendian_) {\n      $data = strrev($data);\n    }\n    $this->trans_->write($data);\n    return 2;\n  }\n\n  public function writeI32($value) {\n    $data = chr($value).chr($value >> 8).chr($value >> 16).chr($value >> 24);\n    if ($this->littleendian_) {\n      $data = strrev($data);\n    }\n    $this->trans_->write($data);\n    return 4;\n  }\n\n  public function writeI64($value) {\n    $data = '';\n    // If we are on a 32bit architecture we have to explicitly deal with\n    // 64-bit twos-complement arithmetic since PHP wants to treat all ints\n    // as signed and any int over 2^31 - 1 as a float\n    if (PHP_INT_SIZE == 4) {\n      $neg = $value < 0;\n\n      if ($neg) {\n        $value *= -1;\n      }\n\n      $hi = (int) ($value / 4294967296);\n      $lo = (int) $value;\n\n      if ($neg) {\n        $hi = ~$hi;\n        $lo = ~$lo;\n        if (($lo & (int) 0xffffffff) == (int) 0xffffffff) {\n          $lo = 0;\n          $hi++;\n        } else {\n          $lo++;\n        }\n      }\n      $data = pack('N2', $hi, $lo);\n\n    } else {\n      $data =\n        chr($value).\n        chr($value >> 8).\n        chr($value >> 16).\n        chr($value >> 24).\n        chr($value >> 32).\n        chr($value >> 40).\n        chr($value >> 48).\n        chr($value >> 56);\n      if ($this->littleendian_) {\n        $data = strrev($data);\n      }\n    }\n\n    $this->trans_->write($data);\n    return 8;\n  }\n\n  public function writeDouble($value) {\n    $data = pack('d', $value);\n    if ($this->littleendian_) {\n      $data = strrev($data);\n    }\n    $this->trans_->write($data);\n    return 8;\n  }\n\n  public function writeFloat($value) {\n    $data = pack('f', $value);\n    if ($this->littleendian_) {\n      $data = strrev($data);\n    }\n    $this->trans_->write($data);\n    return 4;\n  }\n\n  public function writeString($value) {\n    $len = strlen($value);\n    $result = $this->writeI32($len);\n    if ($len) {\n      $this->trans_->write($value);\n    }\n    return $result + $len;\n  }\n\n  private function unpackI32($data) {\n    $value =\n      ord($data[3]) |\n      (ord($data[2]) << 8) |\n      (ord($data[1]) << 16) |\n      (ord($data[0]) << 24);\n    if ($value > 0x7fffffff) {\n      $value = 0 - (($value - 1) ^ 0xffffffff);\n    }\n    return $value;\n  }\n\n  /**\n   * Returns the sequence ID of the next message; only valid when called\n   * before readMessageBegin()\n   */\n  public function peekSequenceID() {\n    $trans = $this->trans_;\n    if (!($trans instanceof IThriftBufferedTransport)) {\n      throw new TProtocolException(\n        get_class($this->trans_).' does not support peek',\n        TProtocolException::BAD_VERSION,\n      );\n    }\n    if ($this->sequenceID !== null) {\n      throw new TProtocolException(\n        'peekSequenceID can only be called '.'before readMessageBegin',\n        TProtocolException::INVALID_DATA,\n      );\n    }\n\n    $data = $trans->peek(4);\n    $sz = $this->unpackI32($data);\n    $start = 4;\n\n    if ($sz < 0) {\n      $version = $sz & self::VERSION_MASK;\n      if ($version != self::VERSION_1) {\n        throw new TProtocolException(\n          'Bad version identifier: '.$sz,\n          TProtocolException::BAD_VERSION,\n        );\n      }\n      // skip name string\n      $data = $trans->peek(4, $start);\n      $name_len = $this->unpackI32($data);\n      $start += 4 + $name_len;\n      // peek seqId\n      $data = $trans->peek(4, $start);\n      $seqid = $this->unpackI32($data);\n    } else {\n      if ($this->strictRead_) {\n        throw new TProtocolException(\n          'No version identifier, old protocol client?',\n          TProtocolException::BAD_VERSION,\n        );\n      } else {\n        // need to guard the length from mis-configured other type of TCP server\n        // for example, if mis-configure sshd, will read 'SSH-' as the length\n        // if memory limit is -1, means no limit.\n        if ($this->memory_limit > 0 && $sz > $this->memory_limit) {\n          throw new TProtocolException(\n            'Length overflow: '.$sz,\n            TProtocolException::SIZE_LIMIT,\n          );\n        }\n        // Handle pre-versioned input\n        $start += $sz;\n        // skip type byte\n        $start += 1;\n        // peek seqId\n        $data = $trans->peek(4, $start);\n        $seqid = $this->unpackI32($data);\n      }\n    }\n    return $seqid;\n  }\n\n  public function readMessageBegin(inout $name, inout $type, inout $seqid) {\n    $sz = 0;\n    $result = $this->readI32($sz);\n    if ($sz < 0) {\n      $version = $sz & self::VERSION_MASK;\n      if ($version != self::VERSION_1) {\n        throw new TProtocolException(\n          'Bad version identifier: '.$sz,\n          TProtocolException::BAD_VERSION,\n        );\n      }\n      $type = $sz & 0x000000ff;\n      $result += $this->readString($name) + $this->readI32($seqid);\n    } else {\n      if ($this->strictRead_) {\n        throw new TProtocolException(\n          'No version identifier, old protocol client?',\n          TProtocolException::BAD_VERSION,\n        );\n      } else {\n        // need to guard the length from mis-configured other type of TCP server\n        // for example, if mis-configure sshd, will read 'SSH-' as the length\n        // if memory limit is -1, means no limit.\n        if ($this->memory_limit > 0 && $sz > $this->memory_limit) {\n          throw new TProtocolException(\n            'Length overflow: '.$sz,\n            TProtocolException::SIZE_LIMIT,\n          );\n        }\n        // Handle pre-versioned input\n        $name = $this->trans_->readAll($sz);\n        $result += $sz + $this->readByte($type) + $this->readI32($seqid);\n      }\n    }\n    $this->sequenceID = $seqid;\n    return $result;\n  }\n\n  public function readMessageEnd() {\n    $this->sequenceID = null;\n    return 0;\n  }\n\n  public function readStructBegin(inout $name) {\n    $name = '';\n    return 0;\n  }\n\n  public function readStructEnd() {\n    return 0;\n  }\n\n  public function readFieldBegin(\n    inout $name,\n    inout $fieldType,\n    inout $fieldId,\n  ) {\n    $result = $this->readByte($fieldType);\n    if ($fieldType == TType::STOP) {\n      $fieldId = 0;\n      return $result;\n    }\n    $result += $this->readI16($fieldId);\n    return $result;\n  }\n\n  public function readFieldEnd() {\n    return 0;\n  }\n\n  public function readMapBegin(inout $keyType, inout $valType, inout $size) {\n    return\n      $this->readByte($keyType) +\n      $this->readByte($valType) +\n      $this->readI32($size);\n  }\n\n  public function readMapEnd() {\n    return 0;\n  }\n\n  public function readListBegin(&$elemType, &$size) {\n    return $this->readByte($elemType) + $this->readI32($size);\n  }\n\n  public function readListEnd() {\n    return 0;\n  }\n\n  public function readSetBegin(&$elemType, &$size) {\n    return $this->readByte($elemType) + $this->readI32($size);\n  }\n\n  public function readSetEnd() {\n    return 0;\n  }\n\n  public function readBool(&$value) {\n    $data = $this->trans_->readAll(1);\n    $arr = unpack('c', $data);\n    $value = $arr[1] == 1;\n    return 1;\n  }\n\n  public function readByte(&$value) {\n    $data = $this->trans_->readAll(1);\n    $value = ord($data);\n    if ($value > 0x7f) {\n      $value = 0 - (($value - 1) ^ 0xff);\n    }\n    return 1;\n  }\n\n  public function readI16(&$value) {\n    $data = $this->trans_->readAll(2);\n    $value = ord($data[1]) | (ord($data[0]) << 8);\n    if ($value > 0x7fff) {\n      $value = 0 - (($value - 1) ^ 0xffff);\n    }\n    return 2;\n  }\n\n  public function readI32(&$value) {\n    $data = $this->trans_->readAll(4);\n    $value = $this->unpackI32($data);\n    return 4;\n  }\n\n  public function readI64(&$value) {\n    $data = $this->trans_->readAll(8);\n\n    $arr = unpack('N2', $data);\n\n    // If we are on a 32bit architecture we have to explicitly deal with\n    // 64-bit twos-complement arithmetic since PHP wants to treat all ints\n    // as signed and any int over 2^31 - 1 as a float\n    if (PHP_INT_SIZE == 4) {\n\n      $hi = $arr[1];\n      $lo = $arr[2];\n      $isNeg = $hi < 0;\n\n      // Check for a negative\n      if ($isNeg) {\n        $hi = ~$hi & (int) 0xffffffff;\n        $lo = ~$lo & (int) 0xffffffff;\n\n        if ($lo == (int) 0xffffffff) {\n          $hi++;\n          $lo = 0;\n        } else {\n          $lo++;\n        }\n      }\n\n      // Force 32bit words in excess of 2G to pe positive - we deal wigh sign\n      // explicitly below\n\n      if ($hi & (int) 0x80000000) {\n        $hi &= (int) 0x7fffffff;\n        $hi += 0x80000000;\n      }\n\n      if ($lo & (int) 0x80000000) {\n        $lo &= (int) 0x7fffffff;\n        $lo += 0x80000000;\n      }\n\n      $value = $hi * 4294967296 + $lo;\n\n      if ($isNeg) {\n        $value = 0 - $value;\n      }\n    } else {\n\n      // Upcast negatives in LSB bit\n      if ($arr[2] & 0x80000000) {\n        $arr[2] = $arr[2] & 0xffffffff;\n      }\n\n      // Check for a negative\n      if ($arr[1] & 0x80000000) {\n        $arr[1] = $arr[1] & 0xffffffff;\n        $arr[1] = $arr[1] ^ 0xffffffff;\n        $arr[2] = $arr[2] ^ 0xffffffff;\n        $value = 0 - $arr[1] * 4294967296 - $arr[2] - 1;\n      } else {\n        $value = $arr[1] * 4294967296 + $arr[2];\n      }\n    }\n\n    return 8;\n  }\n\n  public function readDouble(&$value) {\n    $data = $this->trans_->readAll(8);\n    if ($this->littleendian_) {\n      $data = strrev($data);\n    }\n    $arr = unpack('d', $data);\n    $value = $arr[1];\n    return 8;\n  }\n\n  public function readFloat(&$value) {\n    $data = $this->trans_->readAll(4);\n    if ($this->littleendian_) {\n      $data = strrev($data);\n    }\n    $arr = unpack('f', $data);\n    $value = $arr[1];\n    return 4;\n  }\n\n  public function readString(&$value) {\n    $len = 0;\n    $result = $this->readI32($len);\n    if ($len) {\n      $value = $this->trans_->readAll($len);\n    } else {\n      $value = '';\n    }\n    return $result + $len;\n  }\n}\n", "num_lines": 538}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.binary\n */\n\n/**\n * Binary Protocol Factory\n */\nclass TBinaryProtocolFactory implements TProtocolFactory {\n  protected bool $strictRead = false;\n  protected bool $strictWrite = true;\n\n  public function __construct(\n    bool $strict_read = false,\n    bool $strict_write = true,\n  ) {\n    $this->strictRead = $strict_read;\n    $this->strictWrite = $strict_write;\n  }\n\n  public function getProtocol(TTransport $trans): TProtocol {\n    return new TBinaryProtocolAccelerated(\n      $trans,\n      $this->strictRead,\n      $this->strictWrite,\n    );\n  }\n}\n", "num_lines": 43}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.binary\n */\n\n/**\n * Old slow unaccelerated protocol.\n */\nclass TBinaryProtocolUnaccelerated extends TBinaryProtocolBase {\n  public function __construct(\n    $trans,\n    $strict_read = false,\n    $strict_write = true,\n  ) {\n    parent::__construct($trans, $strict_read, $strict_write);\n  }\n}\n", "num_lines": 32}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.binary\n */\n\n/**\n * Utility class for serializing and deserializing\n * a thrift object using TBinaryProtocolAccelerated.\n */\nclass TBinarySerializer extends TProtocolSerializer {\n\n  // NOTE(rmarin): Because thrift_protocol_write_binary\n  // adds a begin message prefix, you cannot specify\n  // a transport in which to serialize an object. It has to\n  // be a string. Otherwise we will break the compatibility with\n  // normal deserialization.\n  public static function serialize(\n    IThriftStruct $object,\n    bool $disable_hphp_extension = false,\n  ): string {\n    $transport = new TMemoryBuffer();\n    $protocol = new TBinaryProtocolAccelerated($transport);\n    if (function_exists('thrift_protocol_write_binary') &&\n        !$disable_hphp_extension) {\n      thrift_protocol_write_binary(\n        $protocol,\n        $object->getName(),\n        TMessageType::REPLY,\n        $object,\n        0,\n        $protocol->isStrictWrite(),\n      );\n\n      $unused_name = null;\n      $unused_type = null;\n      $unused_seqid = null;\n      $protocol->readMessageBegin(\n        inout $unused_name,\n        inout $unused_type,\n        inout $unused_seqid,\n      );\n    } else {\n      $object->write($protocol);\n    }\n    return $transport->getBuffer();\n  }\n\n  public static function deserialize<T as IThriftStruct>(\n    string $str,\n    T $object,\n    bool $disable_hphp_extension = false,\n  ): T {\n    $transport = new TMemoryBuffer();\n    $protocol = new TBinaryProtocolAccelerated($transport);\n    if (function_exists('thrift_protocol_read_binary') &&\n        !$disable_hphp_extension) {\n      $protocol->writeMessageBegin('', TMessageType::REPLY, 0);\n      $transport->write($str);\n      $object = thrift_protocol_read_binary(\n        $protocol,\n        get_class($object),\n        $protocol->isStrictRead(),\n      );\n    } else {\n      $transport->write($str);\n      $object->read($protocol);\n    }\n    return $object;\n  }\n}\n", "num_lines": 85}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.compact\n */\n\n/**\n * Do not use this class.\n *\n * This class exists for backwards compatibility, use\n * TCompactProtocolAccelerated or TCompactProtocolUnaccelerated\n * @deprecated\n */\nclass TCompactProtocol extends TCompactProtocolAccelerated {\n  public function __construct($trans) {\n    parent::__construct($trans);\n  }\n}\n", "num_lines": 32}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.compact\n */\n\n/**\n * Accelerated compact protocol: used in conjunction with a Thrift HPHP\n * extension for faster serialization and deserialization. The generated Thrift\n * code uses instanceof to look for this class and call into the extension.\n */\nclass TCompactProtocolAccelerated extends TCompactProtocolBase {\n  // The generated Thrift code calls this as a final check. If it returns true,\n  // the HPHP extension will be used; if it returns false, the above PHP code is\n  // used as a fallback.\n  public static function checkVersion($v) {\n    return $v == 1;\n  }\n\n  public function __construct($trans) {\n    // If the transport doesn't implement putBack, wrap it in a\n    // TBufferedTransport (which does)\n    if (!($trans instanceof IThriftBufferedTransport)) {\n      $trans = new TBufferedTransport($trans);\n    }\n\n    parent::__construct($trans);\n  }\n}\n", "num_lines": 43}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Compact implementation of the Thrift protocol.\n *\n */\nabstract class TCompactProtocolBase extends TProtocol {\n\n  const COMPACT_STOP = 0x00;\n  const COMPACT_TRUE = 0x01;\n  const COMPACT_FALSE = 0x02;\n  const COMPACT_BYTE = 0x03;\n  const COMPACT_I16 = 0x04;\n  const COMPACT_I32 = 0x05;\n  const COMPACT_I64 = 0x06;\n  const COMPACT_DOUBLE = 0x07;\n  const COMPACT_BINARY = 0x08;\n  const COMPACT_LIST = 0x09;\n  const COMPACT_SET = 0x0A;\n  const COMPACT_MAP = 0x0B;\n  const COMPACT_STRUCT = 0x0C;\n  const COMPACT_FLOAT = 0x0D;\n\n  const STATE_CLEAR = 0;\n  const STATE_FIELD_WRITE = 1;\n  const STATE_VALUE_WRITE = 2;\n  const STATE_CONTAINER_WRITE = 3;\n  const STATE_BOOL_WRITE = 4;\n  const STATE_FIELD_READ = 5;\n  const STATE_CONTAINER_READ = 6;\n  const STATE_VALUE_READ = 7;\n  const STATE_BOOL_READ = 8;\n\n  const VERSION_MASK = 0x1f;\n  const VERSION = 2;\n  const VERSION_LOW = 1;\n  const VERSION_DOUBLE_BE = 2;\n  const PROTOCOL_ID = 0x82;\n  const TYPE_MASK = 0xe0;\n  const TYPE_SHIFT_AMOUNT = 5;\n\n  const I16_MIN = -(1 << 15);\n  const I16_MAX = (1 << 15) - 1;\n  const I32_MIN = -(1 << 31);\n  const I32_MAX = (1 << 31) - 1;\n\n  protected static\n    $ctypes = darray[\n      TType::STOP => self::COMPACT_STOP,\n      TType::BOOL => self::COMPACT_TRUE, // used for collection\n      TType::BYTE => self::COMPACT_BYTE,\n      TType::I16 => self::COMPACT_I16,\n      TType::I32 => self::COMPACT_I32,\n      TType::I64 => self::COMPACT_I64,\n      TType::DOUBLE => self::COMPACT_DOUBLE,\n      TType::FLOAT => self::COMPACT_FLOAT,\n      TType::STRING => self::COMPACT_BINARY,\n      TType::STRUCT => self::COMPACT_STRUCT,\n      TType::LST => self::COMPACT_LIST,\n      TType::SET => self::COMPACT_SET,\n      TType::MAP => self::COMPACT_MAP,\n    ];\n\n  protected static\n    $ttypes = darray[\n      self::COMPACT_STOP => TType::STOP,\n      self::COMPACT_TRUE => TType::BOOL, // used for collection\n      self::COMPACT_FALSE => TType::BOOL,\n      self::COMPACT_BYTE => TType::BYTE,\n      self::COMPACT_I16 => TType::I16,\n      self::COMPACT_I32 => TType::I32,\n      self::COMPACT_I64 => TType::I64,\n      self::COMPACT_DOUBLE => TType::DOUBLE,\n      self::COMPACT_FLOAT => TType::FLOAT,\n      self::COMPACT_BINARY => TType::STRING,\n      self::COMPACT_STRUCT => TType::STRUCT,\n      self::COMPACT_LIST => TType::LST,\n      self::COMPACT_SET => TType::SET,\n      self::COMPACT_MAP => TType::MAP,\n    ];\n\n  protected $state = self::STATE_CLEAR;\n  protected $lastFid = 0;\n  protected $boolFid = null;\n  protected $boolValue = null;\n  protected $structs = varray[];\n  protected $containers = varray[];\n  protected $version = self::VERSION;\n\n  public function setWriteVersion($ver) {\n    $this->version = $ver;\n  }\n\n  public function checkRange($value, $min, $max) {\n    if ($value < $min || $value > $max) {\n      throw new TProtocolException(\"Value is out of range\");\n    }\n  }\n\n  // Some varint / zigzag helper methods\n  public function toZigZag($n, $bits) {\n    return ($n << 1) ^ ($n >> ($bits - 1));\n  }\n\n  public function fromZigZag($n) {\n    return ($n >> 1) ^ -($n & 1);\n  }\n\n  public function getVarint($data) {\n    $out = \"\";\n    while (true) {\n      if (($data & ~0x7f) === 0) {\n        $out .= chr($data);\n        break;\n      } else {\n        $out .= chr(($data & 0xff) | 0x80);\n        $data = $data >> 7;\n      }\n    }\n    return $out;\n  }\n\n  public function writeVarint($data) {\n    $out = $this->getVarint($data);\n    $this->trans_->write($out);\n    return strlen($out);\n  }\n\n  public function readVarint(&$result) {\n    $idx = 0;\n    $shift = 0;\n    $result = 0;\n    while (true) {\n      $x = $this->trans_->readAll(1);\n      $byte = ord($x);\n      $idx += 1;\n      $result |= ($byte & 0x7f) << $shift;\n      if (($byte >> 7) === 0) {\n        return $idx;\n      }\n      $shift += 7;\n    }\n\n    return $idx;\n  }\n\n  public function __construct($trans) {\n    parent::__construct($trans);\n  }\n\n  <<__Override>>\n  public function writeMessageBegin($name, $type, $seqid) {\n    $written =\n      $this->writeUByte(self::PROTOCOL_ID) +\n      $this->writeUByte(\n        $this->version | ($type << self::TYPE_SHIFT_AMOUNT),\n      ) +\n      $this->writeVarint($seqid) +\n      $this->writeString($name);\n    $this->state = self::STATE_VALUE_WRITE;\n    return $written;\n  }\n\n  <<__Override>>\n  public function writeMessageEnd() {\n    $this->state = self::STATE_CLEAR;\n    return 0;\n  }\n\n  <<__Override>>\n  public function writeStructBegin($name) {\n    $this->structs[] = varray[$this->state, $this->lastFid];\n    $this->state = self::STATE_FIELD_WRITE;\n    $this->lastFid = 0;\n    return 0;\n  }\n\n  <<__Override>>\n  public function writeStructEnd() {\n    $old_values = array_pop(&$this->structs);\n    $this->state = $old_values[0];\n    $this->lastFid = $old_values[1];\n    return 0;\n  }\n\n  <<__Override>>\n  public function writeFieldStop() {\n    return $this->writeByte(0);\n  }\n\n  public function writeFieldHeader($type, $fid) {\n    $written = 0;\n    $delta = $fid - $this->lastFid;\n    if (0 < $delta && $delta <= 15) {\n      $written = $this->writeUByte(($delta << 4) | $type);\n    } else {\n      $written = $this->writeByte($type) + $this->writeI16($fid);\n    }\n    $this->lastFid = $fid;\n    return $written;\n  }\n\n  <<__Override>>\n  public function writeFieldBegin($field_name, $field_type, $field_id) {\n    if ($field_type == TType::BOOL) {\n      $this->state = self::STATE_BOOL_WRITE;\n      $this->boolFid = $field_id;\n      return 0;\n    } else {\n      $this->state = self::STATE_VALUE_WRITE;\n      return $this->writeFieldHeader(self::$ctypes[$field_type], $field_id);\n    }\n  }\n\n  <<__Override>>\n  public function writeFieldEnd() {\n    $this->state = self::STATE_FIELD_WRITE;\n    return 0;\n  }\n\n  public function writeCollectionBegin($etype, $size) {\n    $written = 0;\n    if ($size <= 14) {\n      $written = $this->writeUByte($size << 4 | self::$ctypes[$etype]);\n    } else {\n      $written =\n        $this->writeUByte(0xf0 | self::$ctypes[$etype]) +\n        $this->writeVarint($size);\n    }\n    $this->containers[] = $this->state;\n    $this->state = self::STATE_CONTAINER_WRITE;\n\n    return $written;\n  }\n\n  <<__Override>>\n  public function writeMapBegin($key_type, $val_type, $size) {\n    $written = 0;\n    if ($size == 0) {\n      $written = $this->writeByte(0);\n    } else {\n      $written =\n        $this->writeVarint($size) +\n        $this->writeUByte(\n          self::$ctypes[$key_type] << 4 | self::$ctypes[$val_type],\n        );\n    }\n    $this->containers[] = $this->state;\n    $this->state = self::STATE_CONTAINER_WRITE;\n    return $written;\n  }\n\n  public function writeCollectionEnd() {\n    $this->state = array_pop(&$this->containers);\n    return 0;\n  }\n\n  <<__Override>>\n  public function writeMapEnd() {\n    return $this->writeCollectionEnd();\n  }\n\n  <<__Override>>\n  public function writeListBegin($elem_type, $size) {\n    return $this->writeCollectionBegin($elem_type, $size);\n  }\n\n  <<__Override>>\n  public function writeListEnd() {\n    return $this->writeCollectionEnd();\n  }\n\n  <<__Override>>\n  public function writeSetBegin($elem_type, $size) {\n    return $this->writeCollectionBegin($elem_type, $size);\n  }\n\n  <<__Override>>\n  public function writeSetEnd() {\n    return $this->writeCollectionEnd();\n  }\n\n  <<__Override>>\n  public function writeBool($value) {\n    if ($this->state == self::STATE_BOOL_WRITE) {\n      $ctype = self::COMPACT_FALSE;\n      if ($value) {\n        $ctype = self::COMPACT_TRUE;\n      }\n      return $this->writeFieldHeader($ctype, $this->boolFid);\n    } else if ($this->state == self::STATE_CONTAINER_WRITE) {\n      return $this->writeByte(\n        $value\n          ? self::COMPACT_TRUE\n          : self::COMPACT_FALSE,\n      );\n    } else {\n      throw new TProtocolException('Invalid state in compact protocol');\n    }\n  }\n\n  <<__Override>>\n  public function writeByte($value) {\n    $this->trans_->write(chr($value));\n    return 1;\n  }\n\n  public function writeUByte($byte) {\n    $this->trans_->write(chr($byte));\n    return 1;\n  }\n\n  <<__Override>>\n  public function writeI16($value) {\n    $this->checkRange($value, self::I16_MIN, self::I16_MAX);\n    $thing = $this->toZigZag($value, 16);\n    return $this->writeVarint($thing);\n  }\n\n  <<__Override>>\n  public function writeI32($value) {\n    $this->checkRange($value, self::I32_MIN, self::I32_MAX);\n    $thing = $this->toZigZag($value, 32);\n    return $this->writeVarint($thing);\n  }\n\n  <<__Override>>\n  public function writeDouble($value) {\n    $data = pack('d', $value);\n    if ($this->version >= self::VERSION_DOUBLE_BE) {\n      $data = strrev($data);\n    }\n    $this->trans_->write($data);\n    return 8;\n  }\n\n  <<__Override>>\n  public function writeFloat($value) {\n    $data = pack('f', $value);\n    $data = strrev($data);\n    $this->trans_->write($data);\n    return 4;\n  }\n\n  <<__Override>>\n  public function writeString($value) {\n    $value = (string) $value;\n    $len = strlen($value);\n    $result = $this->writeVarint($len);\n    if ($len) {\n      $this->trans_->write($value);\n    }\n    return $result + $len;\n  }\n\n  <<__Override>>\n  public function readFieldBegin(\n    inout $name,\n    inout $field_type,\n    inout $field_id,\n  ) {\n    $result = $this->readUByte(&$field_type);\n    $delta = $field_type >> 4;\n    $field_type = $field_type & 0x0f;\n\n    if ($field_type == self::COMPACT_STOP) {\n      $field_id = 0;\n      $field_type = $this->getTType($field_type);\n      return $result;\n    }\n\n    if ($delta == 0) {\n      $result += $this->readI16(&$field_id);\n    } else {\n      $field_id = $this->lastFid + $delta;\n    }\n    $this->lastFid = $field_id;\n\n    if ($field_type == self::COMPACT_TRUE) {\n      $this->state = self::STATE_BOOL_READ;\n      $this->boolValue = true;\n    } else if ($field_type == self::COMPACT_FALSE) {\n      $this->state = self::STATE_BOOL_READ;\n      $this->boolValue = false;\n    } else {\n      $this->state = self::STATE_VALUE_READ;\n    }\n\n    $field_type = $this->getTType($field_type);\n    return $result;\n  }\n\n  <<__Override>>\n  public function readFieldEnd() {\n    $this->state = self::STATE_FIELD_READ;\n    return 0;\n  }\n\n  public function readUByte(&$value) {\n    $data = $this->trans_->readAll(1);\n    $value = ord($data);\n    return 1;\n  }\n\n  <<__Override>>\n  public function readByte(&$value) {\n    $data = $this->trans_->readAll(1);\n    $value = ord($data);\n    if ($value > 0x7f) {\n      $value = 0 - (($value - 1) ^ 0xff);\n    }\n    return 1;\n  }\n\n  public function readZigZag(&$value) {\n    $result = $this->readVarint(&$value);\n    $value = $this->fromZigZag($value);\n    return $result;\n  }\n\n  <<__Override>>\n  public function readMessageBegin(inout $name, inout $type, inout $seqid) {\n    $protoId = 0;\n    $result = $this->readUByte(&$protoId);\n    if ($protoId != self::PROTOCOL_ID) {\n      throw new TProtocolException('Bad protocol id in TCompact message');\n    }\n    $verType = 0;\n    $result += $this->readUByte(&$verType);\n    $type =\n      ($verType & self::TYPE_MASK) >>\n      self::TYPE_SHIFT_AMOUNT;\n    $this->version = $verType & self::VERSION_MASK;\n    if (!($this->version <= self::VERSION &&\n          $this->version >= self::VERSION_LOW)) {\n      throw new TProtocolException('Bad version in TCompact message');\n    }\n    $result += $this->readVarint(&$seqid);\n    $result += $this->readString(&$name);\n\n    return $result;\n  }\n\n  <<__Override>>\n  public function readMessageEnd() {\n    return 0;\n  }\n\n  <<__Override>>\n  public function readStructBegin(inout $name) {\n    $name = ''; // unused\n    $this->structs[] = varray[$this->state, $this->lastFid];\n    $this->state = self::STATE_FIELD_READ;\n    $this->lastFid = 0;\n    return 0;\n  }\n\n  <<__Override>>\n  public function readStructEnd() {\n    $last = array_pop(&$this->structs);\n    $this->state = $last[0];\n    $this->lastFid = $last[1];\n    return 0;\n  }\n\n  public function readCollectionBegin(&$type, &$size) {\n    $sizeType = 0;\n    $result = $this->readUByte(&$sizeType);\n    $size = $sizeType >> 4;\n    $type = $this->getTType($sizeType);\n    if ($size == 15) {\n      $result += $this->readVarint(&$size);\n    }\n    $this->containers[] = $this->state;\n    $this->state = self::STATE_CONTAINER_READ;\n\n    return $result;\n  }\n\n  <<__Override>>\n  public function readMapBegin(inout $key_type, inout $val_type, inout $size) {\n    $result = $this->readVarint(&$size);\n    $types = 0;\n    if ($size > 0) {\n      $result += $this->readUByte(&$types);\n    }\n    $val_type = $this->getTType($types);\n    $key_type = $this->getTType($types >> 4);\n    $this->containers[] = $this->state;\n    $this->state = self::STATE_CONTAINER_READ;\n\n    return $result;\n  }\n\n  public function readCollectionEnd() {\n    $this->state = array_pop(&$this->containers);\n    return 0;\n  }\n\n  <<__Override>>\n  public function readMapEnd() {\n    return $this->readCollectionEnd();\n  }\n\n  <<__Override>>\n  public function readListBegin(&$elem_type, &$size) {\n    return $this->readCollectionBegin(&$elem_type, &$size);\n  }\n\n  <<__Override>>\n  public function readListEnd() {\n    return $this->readCollectionEnd();\n  }\n\n  <<__Override>>\n  public function readSetBegin(&$elem_type, &$size) {\n    return $this->readCollectionBegin(&$elem_type, &$size);\n  }\n\n  <<__Override>>\n  public function readSetEnd() {\n    return $this->readCollectionEnd();\n  }\n\n  <<__Override>>\n  public function readBool(&$value) {\n    if ($this->state == self::STATE_BOOL_READ) {\n      $value = $this->boolValue;\n      return 0;\n    } else if ($this->state == self::STATE_CONTAINER_READ) {\n      $result = $this->readByte(&$value);\n      $value = $value == self::COMPACT_TRUE;\n      return $result;\n    } else {\n      throw new TProtocolException('Invalid state in compact protocol');\n    }\n  }\n\n  <<__Override>>\n  public function readI16(&$value) {\n    return $this->readZigZag(&$value);\n  }\n\n  <<__Override>>\n  public function readI32(&$value) {\n    return $this->readZigZag(&$value);\n  }\n\n  <<__Override>>\n  public function readDouble(&$value) {\n    $data = $this->trans_->readAll(8);\n    if ($this->version >= self::VERSION_DOUBLE_BE) {\n      $data = strrev($data);\n    }\n    $arr = unpack('d', $data);\n    $value = $arr[1];\n    return 8;\n  }\n\n  <<__Override>>\n  public function readFloat(&$value) {\n    $data = $this->trans_->readAll(4);\n    $data = strrev($data);\n    $arr = unpack('f', $data);\n    $value = $arr[1];\n    return 4;\n  }\n\n  <<__Override>>\n  public function readString(&$value) {\n    $len = 0;\n    $result = $this->readVarint(&$len);\n    if ($len) {\n      $value = $this->trans_->readAll($len);\n    } else {\n      $value = '';\n    }\n    return $result + $len;\n  }\n\n  public function getTType($byte) {\n    return self::$ttypes[$byte & 0x0f];\n  }\n\n  // If we are on a 32bit architecture we have to explicitly deal with\n  // 64-bit twos-complement arithmetic since PHP wants to treat all ints\n  // as signed and any int over 2^31 - 1 as a float\n\n  // Read and write I64 as two 32 bit numbers $hi and $lo\n\n  <<__Override>>\n  public function readI64(&$value) {\n    // Read varint from wire\n    $hi = 0;\n    $lo = 0;\n\n    $idx = 0;\n    $shift = 0;\n    $arr = darray[];\n\n    while (true) {\n      $x = $this->trans_->readAll(1);\n      $byte = ord($x);\n      $idx += 1;\n      if ($shift < 32) {\n        $lo |= (($byte & 0x7f) << $shift) & 0x00000000ffffffff;\n      }\n      // Shift hi and lo together.\n      if ($shift >= 32) {\n        $hi |= (($byte & 0x7f) << ($shift - 32));\n      } else if ($shift > 24) {\n        $hi |= (($byte & 0x7f) >> ($shift - 24));\n      }\n      if (($byte >> 7) === 0) {\n        break;\n      }\n      $shift += 7;\n    }\n\n    // Now, unzig it.\n    $xorer = 0;\n    if ($lo & 1) {\n      $xorer = 0xffffffff;\n    }\n    $lo = ($lo >> 1) & 0x7fffffff;\n    $lo = $lo | (($hi & 1) << 31);\n    $hi = ($hi >> 1) ^ $xorer;\n    $lo = $lo ^ $xorer;\n\n    // Now put $hi and $lo back together\n    if (true) {\n      $isNeg = $hi < 0;\n\n      // Check for a negative\n      if ($isNeg) {\n        $hi = ~$hi & (int) 0xffffffff;\n        $lo = ~$lo & (int) 0xffffffff;\n\n        if ($lo == (int) 0xffffffff) {\n          $hi++;\n          $lo = 0;\n        } else {\n          $lo++;\n        }\n      }\n\n      // Force 32bit words in excess of 2G to be positive - we deal with sign\n      // explicitly below\n\n      if ($hi & (int) 0x80000000) {\n        $hi &= (int) 0x7fffffff;\n        $hi += 0x80000000;\n      }\n\n      if ($lo & (int) 0x80000000) {\n        $lo &= (int) 0x7fffffff;\n        $lo += 0x80000000;\n      }\n\n      $value = $hi * 4294967296 + $lo;\n\n      if ($isNeg) {\n        $value = 0 - $value;\n      }\n    } else {\n\n      // Upcast negatives in LSB bit\n      if ($arr[2] & 0x80000000) {\n        $arr[2] = $arr[2] & 0xffffffff;\n      }\n\n      // Check for a negative\n      if ($arr[1] & 0x80000000) {\n        $arr[1] = $arr[1] & 0xffffffff;\n        $arr[1] = $arr[1] ^ 0xffffffff;\n        $arr[2] = $arr[2] ^ 0xffffffff;\n        $value = 0 - $arr[1] * 4294967296 - $arr[2] - 1;\n      } else {\n        $value = $arr[1] * 4294967296 + $arr[2];\n      }\n    }\n\n    return $idx;\n  }\n\n  <<__Override>>\n  public function writeI64($value) {\n    // If we are in an I32 range, use the easy method below.\n    if (($value > 4294967296) || ($value < -4294967296)) {\n      // Convert $value to $hi and $lo\n      $neg = $value < 0;\n\n      if ($neg) {\n        $value *= -1;\n      }\n\n      $hi = (int) $value >> 32;\n      $lo = (int) $value & 0xffffffff;\n\n      if ($neg) {\n        $hi = ~$hi;\n        $lo = ~$lo;\n        if (($lo & (int) 0xffffffff) == (int) 0xffffffff) {\n          $lo = 0;\n          $hi++;\n        } else {\n          $lo++;\n        }\n      }\n\n      // Now do the zigging and zagging.\n      $xorer = 0;\n      if ($neg) {\n        $xorer = 0xffffffff;\n      }\n      $lowbit = ($lo >> 31) & 1;\n      $hi = ($hi << 1) | $lowbit;\n      $lo = ($lo << 1);\n      $lo = ($lo ^ $xorer) & 0xffffffff;\n      $hi = ($hi ^ $xorer) & 0xffffffff;\n\n      // now write out the varint, ensuring we shift both hi and lo\n      $out = \"\";\n      while (true) {\n        if (($lo & ~0x7f) === 0 && $hi === 0) {\n          $out .= chr($lo);\n          break;\n        } else {\n          $out .= chr(($lo & 0xff) | 0x80);\n          $lo = $lo >> 7;\n          $lo = $lo | ($hi << 25);\n          $hi = $hi >> 7;\n          // Right shift carries sign, but we don't want it to.\n          $hi = $hi & (127 << 25);\n        }\n      }\n\n      $this->trans_->write($out);\n\n      return strlen($out);\n    } else {\n      return $this->writeVarint($this->toZigZag($value, 64));\n    }\n  }\n}\n", "num_lines": 761}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.compact\n */\n\n/**\n * Compact Protocol Factory\n */\nclass TCompactProtocolFactory implements TProtocolFactory {\n\n  public function __construct() {}\n\n  public function getProtocol(TTransport $trans): TProtocol {\n    return new TCompactProtocolAccelerated($trans);\n  }\n}\n", "num_lines": 31}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.compact\n */\n\n/**\n * Old slow unaccelerated protocol.\n */\nclass TCompactProtocolUnaccelerated extends TCompactProtocolBase {\n  public function __construct($trans) {\n    parent::__construct($trans);\n  }\n}\n", "num_lines": 28}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.compact\n */\n\n/**\n * Utility class for serializing and deserializing\n * a thrift object using TCompactProtocol.\n */\nclass TCompactSerializer extends TProtocolSerializer {\n\n  public static function serialize(\n    IThriftStruct $object,\n    ?int $override_version = null,\n    bool $disable_hphp_extension = false,\n  ): string {\n    $transport = new TMemoryBuffer();\n    $protocol = new TCompactProtocolAccelerated($transport);\n\n    $use_hphp_extension =\n      function_exists('thrift_protocol_write_compact') &&\n      !$disable_hphp_extension;\n\n    $last_version = null;\n    if ($override_version !== null) {\n      $protocol->setWriteVersion($override_version);\n      if (function_exists('thrift_protocol_set_compact_version')) {\n        $last_version =\n          thrift_protocol_set_compact_version($override_version);\n      } else {\n        $use_hphp_extension = false;\n      }\n    }\n\n    if ($use_hphp_extension) {\n      thrift_protocol_write_compact(\n        $protocol,\n        $object->getName(),\n        TMessageType::REPLY,\n        $object,\n        0,\n      );\n      if ($last_version !== null) {\n        thrift_protocol_set_compact_version($last_version);\n      }\n      $unused_name = null;\n      $unused_type = null;\n      $unused_seqid = null;\n      $protocol->readMessageBegin(\n        inout $unused_name,\n        inout $unused_type,\n        inout $unused_seqid,\n      );\n    } else {\n      $object->write($protocol);\n    }\n    return $transport->getBuffer();\n  }\n\n  public static function deserialize<T as IThriftStruct>(\n    string $str,\n    T $object,\n    ?int $override_version = null,\n    bool $disable_hphp_extension = false,\n  ) {\n    $transport = new TMemoryBuffer();\n    $protocol = new TCompactProtocolAccelerated($transport);\n\n    $use_hphp_extension =\n      function_exists('thrift_protocol_read_compact') &&\n      !$disable_hphp_extension;\n\n    if ($override_version !== null) {\n      $protocol->setWriteVersion($override_version);\n      if (!function_exists('thrift_protocol_set_compact_version')) {\n        $use_hphp_extension = false;\n      }\n    }\n\n    if ($use_hphp_extension) {\n      $protocol->writeMessageBegin('', TMessageType::REPLY, 0);\n      $transport->write($str);\n      $object = thrift_protocol_read_compact($protocol, get_class($object));\n    } else {\n      $transport->write($str);\n      /* HH_FIXME[2060] Trust me, I know what I'm doing */\n      $object->read($protocol);\n    }\n    return $object;\n  }\n}\n", "num_lines": 106}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.simplejson\n */\n\n/**\n * Protocol for encoding/decoding simple json\n */\nclass TSimpleJSONProtocol extends TProtocol {\n  const VERSION_1 = 0x80010000;\n\n  private IThriftBufferedTransport $bufTrans;\n  private Vector<TSimpleJSONProtocolContext> $contexts;\n\n  public function __construct(TTransport $trans) {\n    $this->contexts = Vector {};\n    if (!($trans instanceof IThriftBufferedTransport)) {\n      $trans = new TBufferedTransport($trans);\n    }\n    $this->bufTrans = $trans;\n    parent::__construct($trans);\n    $this->contexts\n      ->add(new TSimpleJSONProtocolContext($this->trans_, $this->bufTrans));\n  }\n\n  private function pushListWriteContext(): int {\n    return $this->pushWriteContext(\n      new TSimpleJSONProtocolListContext($this->trans_, $this->bufTrans),\n    );\n  }\n\n  private function pushMapWriteContext(): int {\n    return $this->pushWriteContext(\n      new TSimpleJSONProtocolMapContext($this->trans_, $this->bufTrans),\n    );\n  }\n\n  private function pushListReadContext(): void {\n    $this->pushReadContext(\n      new TSimpleJSONProtocolListContext($this->trans_, $this->bufTrans),\n    );\n  }\n\n  private function pushMapReadContext(): void {\n    $this->pushReadContext(\n      new TSimpleJSONProtocolMapContext($this->trans_, $this->bufTrans),\n    );\n  }\n\n  private function pushWriteContext(TSimpleJSONProtocolContext $ctx): int {\n    $this->contexts->add($ctx);\n    return $ctx->writeStart();\n  }\n\n  private function popWriteContext(): int {\n    $ctx = $this->contexts->pop();\n    return $ctx->writeEnd();\n  }\n\n  private function pushReadContext(TSimpleJSONProtocolContext $ctx): void {\n    $this->contexts->add($ctx);\n    $ctx->readStart();\n  }\n\n  private function popReadContext(): void {\n    $ctx = $this->contexts->pop();\n    $ctx->readEnd();\n  }\n\n  private function getContext(): TSimpleJSONProtocolContext {\n    return $this->contexts->at($this->contexts->count() - 1);\n  }\n\n  public function writeMessageBegin($name, $type, $seqid) {\n    return\n      $this->getContext()->writeSeparator() +\n      $this->pushListWriteContext() +\n      $this->writeI32(self::VERSION_1) +\n      $this->writeString($name) +\n      $this->writeI32($type) +\n      $this->writeI32($seqid);\n  }\n\n  public function writeMessageEnd() {\n    return $this->popWriteContext();\n  }\n\n  public function writeStructBegin($name) {\n    return\n      $this->getContext()->writeSeparator() + $this->pushMapWriteContext();\n  }\n\n  public function writeStructEnd() {\n    return $this->popWriteContext();\n  }\n\n  public function writeFieldBegin($fieldName, $fieldType, $fieldId) {\n    return $this->writeString($fieldName);\n  }\n\n  public function writeFieldEnd() {\n    return 0;\n  }\n\n  public function writeFieldStop() {\n    return 0;\n  }\n\n  public function writeMapBegin($keyType, $valType, $size) {\n    return\n      $this->getContext()->writeSeparator() + $this->pushMapWriteContext();\n  }\n\n  public function writeMapEnd() {\n    return $this->popWriteContext();\n  }\n\n  public function writeListBegin($elemType, $size) {\n    return\n      $this->getContext()->writeSeparator() + $this->pushListWriteContext();\n  }\n\n  public function writeListEnd() {\n    return $this->popWriteContext();\n  }\n\n  public function writeSetBegin($elemType, $size) {\n    return\n      $this->getContext()->writeSeparator() + $this->pushListWriteContext();\n  }\n\n  public function writeSetEnd() {\n    return $this->popWriteContext();\n  }\n\n  public function writeBool($value) {\n    $x = $this->getContext()->writeSeparator();\n    if ($value) {\n      $this->trans_->write('true');\n      $x += 4;\n    } else {\n      $this->trans_->write('false');\n      $x += 5;\n    }\n    return $x;\n  }\n\n  public function writeByte($value) {\n    return $this->writeNum((int) $value);\n  }\n\n  public function writeI16($value) {\n    return $this->writeNum((int) $value);\n  }\n\n  public function writeI32($value) {\n    return $this->writeNum((int) $value);\n  }\n\n  public function writeI64($value) {\n    return $this->writeNum((int) $value);\n  }\n\n  public function writeDouble($value) {\n    return $this->writeNum((float) $value);\n  }\n\n  public function writeFloat($value) {\n    return $this->writeNum((float) $value);\n  }\n\n  private function writeNum($value) {\n    $ctx = $this->getContext();\n    $ret = $ctx->writeSeparator();\n    if ($ctx->escapeNum()) {\n      $value = (string) $value;\n    }\n\n    $enc = json_encode($value);\n    $this->trans_->write($enc);\n\n    return $ret + strlen($enc);\n  }\n\n  public function writeString($value) {\n    $ctx = $this->getContext();\n    $ret = $ctx->writeSeparator();\n    $value = (string) $value;\n    $sb = '';\n    $sb .= '\"';\n    $len = strlen($value);\n    for ($i = 0; $i < $len; $i++) {\n      $c = $value[$i];\n      $ord = ord($c);\n      switch ($ord) {\n        case 8:\n          $sb .= '\\b';\n          break;\n        case 9:\n          $sb .= '\\t';\n          break;\n        case 10:\n          $sb .= '\\n';\n          break;\n        case 12:\n          $sb .= '\\f';\n          break;\n        case 13:\n          $sb .= '\\r';\n          break;\n        case 34:\n          // \"\n        case 92:\n          // \\\n          $sb .= '\\\\';\n          $sb .= $c;\n          break;\n        default:\n          if ($ord < 32 || $ord > 126) {\n            $sb .= '\\\\u00';\n            $sb .= bin2hex($c);\n          } else {\n            $sb .= $c;\n          }\n          break;\n      }\n    }\n    $sb .= '\"';\n    $enc = $sb;\n    $this->trans_->write($enc);\n\n    return $ret + strlen($enc);\n  }\n\n  public function readMessageBegin(inout $name, inout $type, inout $seqid) {\n    throw new TProtocolException(\n      'Reading with TSimpleJSONProtocol is not supported. '.\n      'Use readFromJSON() on your struct',\n    );\n  }\n\n  public function readMessageEnd() {\n    throw new TProtocolException(\n      'Reading with TSimpleJSONProtocol is not supported. '.\n      'Use readFromJSON() on your struct',\n    );\n  }\n\n  public function readStructBegin(inout $_name) {\n    $this->getContext()->readSeparator();\n    $this->skipWhitespace();\n    $this->pushMapReadContext();\n  }\n\n  public function readStructEnd() {\n    $this->popReadContext();\n  }\n\n  public function readFieldBegin(\n    inout $name,\n    inout $fieldType,\n    inout $fieldId,\n  ) {\n    $fieldId = null;\n    $ctx = $this->getContext();\n    $name = null;\n    while ($name === null) {\n      if ($ctx->readContextOver()) {\n        $fieldType = TType::STOP;\n        break;\n      } else {\n        $ctx->readSeparator();\n        $this->skipWhitespace();\n        $name = $this->readJSONString()[0];\n        // We need to guess the type of the value, in case the name is bogus or we are in a skip method up the stack\n        $offset = $this->skipWhitespace(true);\n        $this->expectChar(':', true, $offset);\n        $offset += 1 + $this->skipWhitespace(true, $offset + 1);\n        $c = $this->bufTrans->peek(1, $offset);\n        if ($c === 'n' && $this->bufTrans->peek(4, $offset) === 'null') {\n          // We actually want to skip this field, but there isn't an appropriate\n          // TType to send back. So instead, we will silently skip\n          $ctx->readSeparator();\n          $this->skipWhitespace();\n          $this->trans_->readAll(4);\n          $name = null;\n          continue;\n        } else {\n          $fieldType = $this->guessFieldTypeBasedOnByte($c);\n        }\n      }\n    }\n  }\n\n  public function readFieldEnd() {\n    // Do nothing\n  }\n\n  public function readMapBegin(inout $keyType, inout $valType, inout $size) {\n    $size = null;\n    $this->getContext()->readSeparator();\n    $this->skipWhitespace();\n    $this->pushMapReadContext();\n    if ($this->readMapHasNext()) {\n      // We need to guess the type of the keys/values, in case we are in a skip method up the stack\n      $keyType = TType::STRING;\n      $this->skipWhitespace(); // This is not a peek, since we can do this safely again\n      $offset = $this->readJSONString(true)[1];\n      $offset += $this->skipWhitespace(true, $offset);\n      $this->expectChar(':', true, $offset);\n      $offset += 1 + $this->skipWhitespace(true, $offset + 1);\n      $c = $this->bufTrans->peek(1, $offset);\n      $valType = $this->guessFieldTypeBasedOnByte($c);\n    }\n  }\n\n  public function readMapHasNext(): bool {\n    return !$this->getContext()->readContextOver();\n  }\n\n  public function readMapEnd() {\n    $this->popReadContext();\n  }\n\n  public function readListBegin(&$elemType, &$size) {\n    $size = null;\n    $this->getContext()->readSeparator();\n    $this->skipWhitespace();\n    $this->pushListReadContext();\n    if ($this->readListHasNext()) {\n      // We need to guess the type of the values, in case we are in a skip method up the stack\n      $this->skipWhitespace(); // This is not a peek, since we can do this safely again\n      $c = $this->bufTrans->peek(1);\n      $elemType = $this->guessFieldTypeBasedOnByte($c);\n    }\n  }\n\n  public function readListHasNext(): bool {\n    return !$this->getContext()->readContextOver();\n  }\n\n  public function readListEnd() {\n    $this->popReadContext();\n  }\n\n  public function readSetBegin(&$elemType, &$size) {\n    $size = null;\n    $this->getContext()->readSeparator();\n    $this->skipWhitespace();\n    $this->pushListReadContext();\n    if ($this->readSetHasNext()) {\n      // We need to guess the type of the values, in case we are in a skip method up the stack\n      $this->skipWhitespace(); // This is not a peek, since we can do this safely again\n      $c = $this->bufTrans->peek(1);\n      $elemType = $this->guessFieldTypeBasedOnByte($c);\n    }\n  }\n\n  public function readSetHasNext(): bool {\n    return !$this->getContext()->readContextOver();\n  }\n\n  public function readSetEnd() {\n    $this->popReadContext();\n  }\n\n  public function readBool(&$value) {\n    $this->getContext()->readSeparator();\n    $this->skipWhitespace();\n    $c = $this->trans_->readAll(1);\n    $target = null;\n    switch ($c) {\n      case 't':\n        $value = true;\n        $target = 'rue';\n        break;\n      case 'f':\n        $value = false;\n        $target = 'alse';\n        break;\n      default:\n        throw new TProtocolException(\n          'TSimpleJSONProtocol: Expected t or f, encountered 0x'.\n          bin2hex($c),\n        );\n    }\n\n    for ($i = 0; $i < strlen($target); $i++) {\n      $this->expectChar($target[$i]);\n    }\n  }\n\n  private function readInteger(?int $min, ?int $max): int {\n    $val = intval($this->readNumStr());\n    if (($min !== null && $max !== null) && ($val < $min || $val > $max)) {\n      throw new TProtocolException(\n        'TProtocolException: value '.\n        $val.\n        ' is outside the expected bounds',\n      );\n    }\n    return $val;\n  }\n\n  private function readNumStr(): string {\n    $ctx = $this->getContext();\n    if ($ctx->escapeNum()) {\n      $this->expectChar('\"');\n    }\n    $count = 0;\n    $reading = true;\n    while ($reading) {\n      $c = $this->bufTrans->peek(1, $count);\n      switch ($c) {\n        case '+':\n        case '-':\n        case '.':\n        case '0':\n        case '1':\n        case '2':\n        case '3':\n        case '4':\n        case '5':\n        case '6':\n        case '7':\n        case '8':\n        case '9':\n        case 'E':\n        case 'e':\n          $count++;\n          break;\n        default:\n          $reading = false;\n          break;\n      }\n    }\n    $str = $this->trans_->readAll($count);\n    if (!preg_match(\n          '/^[+-]?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$/',\n          $str,\n        )) {\n      throw new TProtocolException(\n        'TSimpleJSONProtocol: Invalid json number '.$str,\n      );\n    }\n    if ($ctx->escapeNum()) {\n      $this->expectChar('\"');\n    }\n\n    return $str;\n  }\n\n  public function readByte(&$value) {\n    $this->getContext()->readSeparator();\n    $this->skipWhitespace();\n    $value = $this->readInteger(-0x80, 0x7f);\n  }\n\n  public function readI16(&$value) {\n    $this->getContext()->readSeparator();\n    $this->skipWhitespace();\n    $value = $this->readInteger(-0x8000, 0x7fff);\n  }\n\n  public function readI32(&$value) {\n    $this->getContext()->readSeparator();\n    $this->skipWhitespace();\n    $value = $this->readInteger(-0x80000000, 0x7fffffff);\n  }\n\n  public function readI64(&$value) {\n    $this->getContext()->readSeparator();\n    $this->skipWhitespace();\n    $value = $this->readInteger(null, null);\n  }\n\n  public function readDouble(&$value) {\n    $this->getContext()->readSeparator();\n    $this->skipWhitespace();\n    $value = (float)$this->readNumStr();\n  }\n\n  public function readFloat(&$value) {\n    $this->getContext()->readSeparator();\n    $this->skipWhitespace();\n    $value = (float)$this->readNumStr();\n  }\n\n  public function readString(&$value) {\n    $this->getContext()->readSeparator();\n    $this->skipWhitespace();\n    $value = $this->readJSONString()[0];\n  }\n\n  private function readJSONString(\n    bool $peek = false,\n    int $start = 0,\n  ): Pair<string, int> {\n    if (!$peek) {\n      $start = 0;\n    }\n    $this->expectChar('\"', $peek, $start);\n    $count = $peek ? 1 : 0;\n    $sb = '';\n    $reading = true;\n    while ($reading) {\n      $c = $this->bufTrans->peek(1, $start + $count);\n      switch ($c) {\n        case '\"':\n          $reading = false;\n          break;\n        case '\\\\':\n          $count++;\n          $c = $this->bufTrans->peek(1, $start + $count);\n          switch ($c) {\n            case '\\\\':\n              $count++;\n              $sb .= '\\\\';\n              break;\n            case '\"':\n              $count++;\n              $sb .= '\"';\n              break;\n            case 'b':\n              $count++;\n              $sb .= chr(0x08);\n              break;\n            case '/':\n              $count++;\n              $sb .= '/';\n              break;\n            case 'f':\n              $count++;\n              $sb .= \"\\f\";\n              break;\n            case 'n':\n              $count++;\n              $sb .= \"\\n\";\n              break;\n            case 'r':\n              $count++;\n              $sb .= \"\\r\";\n              break;\n            case 't':\n              $count++;\n              $sb .= \"\\t\";\n              break;\n            case 'u':\n              $count++;\n              $this->expectChar('0', true, $start + $count);\n              $this->expectChar('0', true, $start + $count + 1);\n              $count += 2;\n              $sb .= hex2bin($this->bufTrans->peek(2, $start + $count));\n              $count += 2;\n              break;\n            default:\n              throw new TProtocolException(\n                'TSimpleJSONProtocol: Expected Control Character, found 0x'.\n                bin2hex($c),\n              );\n          }\n          break;\n        case '':\n          // end of buffer, this string is unclosed\n          $reading = false;\n          break;\n        default:\n          $count++;\n          $sb .= $c;\n          break;\n      }\n    }\n\n    if (!$peek) {\n      $this->trans_->readAll($count);\n    }\n\n    $this->expectChar('\"', $peek, $start + $count);\n    return Pair {$sb, $count + 1};\n  }\n\n  private function skipWhitespace(bool $peek = false, int $start = 0): int {\n    if (!$peek) {\n      $start = 0;\n    }\n    $count = 0;\n    $reading = true;\n    while ($reading) {\n      $byte = $this->bufTrans->peek(1, $count + $start);\n      switch ($byte) {\n        case ' ':\n        case \"\\t\":\n        case \"\\n\":\n        case \"\\r\":\n          $count++;\n          break;\n        default:\n          $reading = false;\n          break;\n      }\n    }\n    if (!$peek) {\n      $this->trans_->readAll($count);\n    }\n\n    return $count;\n  }\n\n  private function expectChar(\n    string $char,\n    bool $peek = false,\n    int $start = 0,\n  ): void {\n    if (!$peek) {\n      $start = 0;\n    }\n    $c = null;\n    if ($peek) {\n      $c = $this->bufTrans->peek(1, $start);\n    } else {\n      $c = $this->trans_->readAll(1);\n    }\n\n    if ($c !== $char) {\n      throw new TProtocolException(\n        'TSimpleJSONProtocol: Expected '.\n        $char.\n        ', but encountered 0x'.\n        bin2hex($c),\n      );\n    }\n  }\n\n  private function guessFieldTypeBasedOnByte(string $byte): ?int {\n    switch ($byte) {\n      case '{':\n        return TType::STRUCT;\n      case '[':\n        return TType::LST;\n      case 't':\n      case 'f':\n        return TType::BOOL;\n      case '-':\n      case '0':\n      case '1':\n      case '2':\n      case '3':\n      case '4':\n      case '5':\n      case '6':\n      case '7':\n      case '8':\n      case '9':\n        // These technically aren't allowed to start JSON floats, but are here for backwards compatibility\n      case '+':\n      case '.':\n        return TType::DOUBLE;\n      case '\"':\n        return TType::STRING;\n      case ']':\n      case '}':\n        // We can get here with empty lists/maps, returning a dummy value\n        return TType::STOP;\n    }\n\n    throw new TProtocolException(\n      'TSimpleJSONProtocol: Unable to guess TType for character 0x'.\n      bin2hex($byte),\n    );\n  }\n}\n", "num_lines": 686}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.simplejson\n */\n\nclass TSimpleJSONProtocolContext {\n  final public function __construct(\n    protected TTransport $trans,\n    protected IThriftBufferedTransport $bufTrans,\n  ) {}\n\n  public function writeStart(): int {\n    return 0;\n  }\n\n  public function writeSeparator(): int {\n    return 0;\n  }\n\n  public function writeEnd(): int {\n    return 0;\n  }\n\n  public function readStart(): void {\n    // Do nothing\n  }\n\n  public function readSeparator(): void {\n    // Do nothing\n  }\n\n  public function readContextOver(): bool {\n    return true;\n  }\n\n  public function readEnd(): void {\n    // Do nothing\n  }\n\n  public function escapeNum(): bool {\n    return false;\n  }\n\n  protected function skipWhitespace(bool $skip = true): int {\n    $count = 0;\n    $reading = true;\n    while ($reading) {\n      $byte = $this->bufTrans->peek(1, $count);\n      switch ($byte) {\n        case ' ':\n        case \"\\t\":\n        case \"\\n\":\n        case \"\\r\":\n          $count++;\n          break;\n        default:\n          $reading = false;\n          break;\n      }\n    }\n    if ($skip) {\n      $this->trans->readAll($count);\n    }\n    return $count;\n  }\n}\n", "num_lines": 81}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.simplejson\n */\n\nclass TSimpleJSONProtocolListContext extends TSimpleJSONProtocolContext {\n  private bool $first = true;\n\n  public function writeStart(): int {\n    $this->trans->write('[');\n    return 1;\n  }\n\n  public function writeSeparator(): int {\n    if ($this->first) {\n      $this->first = false;\n      return 0;\n    }\n\n    $this->trans->write(',');\n    return 1;\n  }\n\n  public function writeEnd(): int {\n    $this->trans->write(']');\n    return 1;\n  }\n\n  public function readStart(): void {\n    $this->skipWhitespace();\n    $c = $this->trans->readAll(1);\n    if ($c !== '[') {\n      throw new TProtocolException(\n        'TSimpleJSONProtocol: Expected \"[\", encountered 0x'.bin2hex($c),\n      );\n    }\n  }\n\n  public function readSeparator(): void {\n    if ($this->first) {\n      $this->first = false;\n      return;\n    }\n\n    $this->skipWhitespace();\n    $c = $this->trans->readAll(1);\n    if ($c !== ',') {\n      throw new TProtocolException(\n        'TSimpleJSONProtocol: Expected \",\", encountered 0x'.bin2hex($c),\n      );\n    }\n  }\n\n  public function readContextOver(): bool {\n    $pos = $this->skipWhitespace(false);\n    $c = $this->bufTrans->peek(1, $pos);\n    if (!$this->first && $c !== ',' && $c !== ']') {\n      throw new TProtocolException(\n        'TSimpleJSONProtocol: Expected \",\" or \"]\", encountered 0x'.\n        bin2hex($c),\n      );\n    }\n\n    return ($c === ']');\n  }\n\n  public function readEnd(): void {\n    $this->skipWhitespace();\n    $c = $this->trans->readAll(1);\n    if ($c !== ']') {\n      throw new TProtocolException(\n        'TSimpleJSONProtocol: Expected \"]\", encountered 0x'.bin2hex($c),\n      );\n    }\n  }\n\n  public function escapeNum(): bool {\n    return false;\n  }\n}\n", "num_lines": 95}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.simplejson\n */\n\nclass TSimpleJSONProtocolMapContext extends TSimpleJSONProtocolContext {\n  private bool $first = true;\n  private bool $colon = true;\n\n  public function writeStart(): int {\n    $this->trans->write('{');\n    return 1;\n  }\n\n  public function writeSeparator(): int {\n    if ($this->first) {\n      $this->first = false;\n      return 0;\n    }\n\n    if ($this->colon) {\n      $this->trans->write(':');\n    } else {\n      $this->trans->write(',');\n    }\n\n    $this->colon = !$this->colon;\n    return 1;\n  }\n\n  public function writeEnd(): int {\n    $this->trans->write('}');\n    return 1;\n  }\n\n  public function readStart(): void {\n    $this->skipWhitespace();\n    $c = $this->trans->readAll(1);\n    if ($c !== '{') {\n      throw new TProtocolException(\n        'TSimpleJSONProtocol: Expected \"{\", encountered 0x'.bin2hex($c),\n      );\n    }\n  }\n\n  public function readSeparator(): void {\n    if ($this->first) {\n      $this->first = false;\n      return;\n    }\n\n    $this->skipWhitespace();\n    $c = $this->trans->readAll(1);\n    $target = $this->colon ? ':' : ',';\n\n    if ($c !== $target) {\n      throw new TProtocolException(\n        'TSimpleJSONProtocol: Expected \"'.\n        $target.\n        '\", encountered 0x'.\n        bin2hex($c),\n      );\n    }\n\n    $this->colon = !$this->colon;\n  }\n\n  public function readContextOver(): bool {\n    $pos = $this->skipWhitespace(false);\n    $c = $this->bufTrans->peek(1, $pos);\n    if (!$this->first && $c !== ',' && $c !== '}') {\n      throw new TProtocolException(\n        'TSimpleJSONProtocol: Expected \",\" or \"}\", encountered 0x'.\n        bin2hex($c),\n      );\n    }\n\n    return ($c === '}');\n  }\n\n  public function readEnd(): void {\n    $this->skipWhitespace();\n    $c = $this->trans->readAll(1);\n    if ($c !== '}') {\n      throw new TProtocolException(\n        'TSimpleJSONProtocol: Expected \"}\", encountered 0x'.bin2hex($c),\n      );\n    }\n  }\n\n  public function escapeNum(): bool {\n    return $this->colon;\n  }\n}\n", "num_lines": 109}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.simplejson\n */\n\n/**\n * Utility class for serializing\n * a thrift object using TSimpleJSONProtocol\n */\nclass TSimpleJSONSerializer extends TProtocolSerializer {\n  public static function serialize(IThriftStruct $object): string {\n    $transport = new TMemoryBuffer();\n    $protocol = new TSimpleJSONProtocol($transport);\n    $object->write($protocol);\n    return $transport->getBuffer();\n  }\n\n  public static function deserialize<T as IThriftStruct>(\n    string $str,\n    T $object,\n  ): T {\n    $transport = new TMemoryBuffer($str);\n    $protocol = new TSimpleJSONProtocol($transport);\n    $object->read($protocol);\n    return $object;\n  }\n}\n", "num_lines": 42}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.simplephpobject\n */\n\nclass TSimplePHPObjectProtocol extends TProtocol {\n\n  private Iterator<mixed> $top;\n  private Vector<Iterator<mixed>> $stack;\n\n  public function __construct(mixed $val) {\n    $this->top = new ArrayIterator(array($val));\n    $this->stack = Vector {$this->top};\n    parent::__construct(new TNullTransport());\n  }\n\n  public function readMessageBegin(inout $name, inout $type, inout $seqid) {\n    throw new TProtocolException('Not Supported');\n  }\n\n  public function readMessageEnd() {\n    throw new TProtocolException('Not Supported');\n  }\n\n  public function readStructBegin(inout $name) {\n    $name = null;\n    $val = $this->top->current();\n    $this->top->next();\n    $itr = null;\n    if ($val instanceof Set || $val instanceof ImmSet) {\n      throw new TProtocolException(\n        'Unsupported data structure for struct: '.gettype($val),\n      );\n    } else if ($val instanceof Vector) {\n      if ($val->isEmpty()) {\n        // Empty maps can be (de)serialized incorrectly as vectors\n        $size = 0;\n        $itr = $val->getIterator();\n      } else {\n        throw new TProtocolException(\n          'Unsupported data structure for struct: '.gettype($val),\n        );\n      }\n    } else if ($val instanceof ImmVector) {\n      if ($val->isEmpty()) {\n        // Empty maps can be (de)serialized incorrectly as vectors\n        $size = 0;\n        $itr = $val->getIterator();\n      } else {\n        throw new TProtocolException(\n          'Unsupported data structure for struct: '.gettype($val),\n        );\n      }\n    } else if ($val instanceof Map) {\n      $itr = $val->getIterator();\n    } else if ($val instanceof ImmMap) {\n      $itr = $val->getIterator();\n    } else if (is_array($val)) {\n      $itr = new ArrayIterator($val);\n    } else {\n      $val = (array) $val;\n      $itr = new ArrayIterator($val);\n    }\n    $itr = new TSimplePHPObjectProtocolKeyedIteratorWrapper($itr);\n    $this->stack->add($itr);\n    $this->top = $itr;\n  }\n\n  public function readStructEnd() {\n    $this->stack->pop();\n    $val = $this->stack->lastValue();\n    invariant($val !== null, \"Stack is empty, this shouldn't happen!\");\n    $this->top = $val;\n  }\n\n  public function readFieldBegin(\n    inout $name,\n    inout $fieldType,\n    inout $fieldId,\n  ) {\n    $val = null;\n    while ($val === null) {\n      if (!$this->top->valid()) {\n        $fieldType = TType::STOP;\n        return;\n      }\n\n      $fieldId = null;\n      $name = $this->top->current();\n      $this->top->next();\n      $val = $this->top->current();\n      if ($val === null) {\n        $this->top->next();\n        continue;\n      }\n\n      $fieldType = $this->guessTypeForValue($val);\n    }\n  }\n\n  public function readFieldEnd() {}\n\n  public function readMapBegin(inout $keyType, inout $valType, inout $size) {\n    $val = $this->top->current();\n    $this->top->next();\n    $itr = null;\n    if ($val instanceof Set || $val instanceof ImmSet) {\n      throw new TProtocolException(\n        'Unsupported data structure for map: '.gettype($val),\n      );\n    } else if ($val instanceof Vector) {\n      if ($val->isEmpty()) {\n        // Empty maps can be (de)serialized incorrectly as vectors\n        $size = 0;\n        $itr = $val->getIterator();\n      } else {\n        throw new TProtocolException(\n          'Unsupported data structure for map: '.gettype($val),\n        );\n      }\n    } else if ($val instanceof ImmVector) {\n      if ($val->isEmpty()) {\n        // Empty maps can be (de)serialized incorrectly as vectors\n        $size = 0;\n        $itr = $val->getIterator();\n      } else {\n        throw new TProtocolException(\n          'Unsupported data structure for map: '.gettype($val),\n        );\n      }\n    } else if ($val instanceof Map) {\n      $itr = $val->getIterator();\n      $size = $val->count();\n    } else if ($val instanceof ImmMap) {\n      $itr = $val->getIterator();\n      $size = $val->count();\n    } else if (is_array($val)) {\n      $itr = new ArrayIterator($val);\n      $size = count($val);\n    } else {\n      $val = (array) $val;\n      $itr = new ArrayIterator($val);\n      $size = count($val);\n    }\n    $itr = new TSimplePHPObjectProtocolKeyedIteratorWrapper($itr);\n    $this->stack->add($itr);\n    $this->top = $itr;\n\n    if ($itr->valid()) {\n      $key_sample = $itr->current();\n      $itr->next();\n      $val_sample = $itr->current();\n      $itr->rewind();\n\n      $keyType = $this->guessTypeForValue($key_sample);\n      $valType = $this->guessTypeForValue($val_sample);\n    }\n  }\n\n  public function readMapEnd() {\n    $this->stack->pop();\n    $val = $this->stack->lastValue();\n    invariant($val !== null, \"Stack is empty, this shouldn't happen!\");\n    $this->top = $val;\n  }\n\n  public function readListBegin(&$elemType, &$size) {\n    $val = $this->top->current();\n    $this->top->next();\n    $itr = null;\n    if ($val instanceof Set || $val instanceof ImmSet) {\n      throw new TProtocolException(\n        'Unsupported data structure for list: '.gettype($val),\n      );\n    } else if ($val instanceof Map) {\n      $itr = $val->getIterator();\n      $size = $val->count();\n    } else if ($val instanceof ImmMap) {\n      $itr = $val->getIterator();\n      $size = $val->count();\n    } else if ($val instanceof Vector) {\n      $itr = $val->getIterator();\n      $size = $val->count();\n    } else if ($val instanceof ImmVector) {\n      $itr = $val->getIterator();\n      $size = $val->count();\n    } else if (is_array($val)) {\n      $itr = new ArrayIterator($val);\n      $size = count($val);\n    } else {\n      $val = (array) $val;\n      $itr = new ArrayIterator($val);\n      $size = count($val);\n    }\n    $this->stack->add($itr);\n    $this->top = $itr;\n\n    if ($itr->valid()) {\n      $val_sample = $itr->current();\n      $elemType = $this->guessTypeForValue($val_sample);\n    }\n  }\n\n  public function readListEnd() {\n    $this->stack->pop();\n    $val = $this->stack->lastValue();\n    invariant($val !== null, \"Stack is empty, this shouldn't happen!\");\n    $this->top = $val;\n  }\n\n  public function readSetBegin(&$elemType, &$size) {\n    $val = $this->top->current();\n    $this->top->next();\n    $itr = null;\n    if ($val instanceof Map) {\n      $itr = $val->getIterator();\n      $size = $val->count();\n    } else if ($val instanceof ImmMap) {\n      $itr = $val->getIterator();\n      $size = $val->count();\n    } else if ($val instanceof Vector) {\n      $itr = $val->getIterator();\n      $size = $val->count();\n    } else if ($val instanceof ImmVector) {\n      $itr = $val->getIterator();\n      $size = $val->count();\n    } else if ($val instanceof Set) {\n      $itr = $val->getIterator();\n      $size = $val->count();\n    } else if ($val instanceof ImmSet) {\n      $itr = $val->getIterator();\n      $size = $val->count();\n    } else if (is_array($val)) {\n      $itr = new ArrayIterator($val);\n      $size = count($val);\n    } else {\n      $val = array_keys((array) $val);\n      $itr = new ArrayIterator($val);\n      $size = count($val);\n    }\n    $this->stack->add($itr);\n    $this->top = $itr;\n\n    if ($itr->valid()) {\n      $val_sample = $itr->current();\n      $elemType = $this->guessTypeForValue($val_sample);\n    }\n  }\n\n  public function readSetEnd() {\n    $this->stack->pop();\n    $val = $this->stack->lastValue();\n    invariant($val !== null, \"Stack is empty, this shouldn't happen!\");\n    $this->top = $val;\n  }\n\n  public function readBool(&$value) {\n    $value = (bool) $this->top->current();\n    $this->top->next();\n  }\n\n  public function readByte(&$value) {\n    $value = (int) $this->top->current();\n    $this->top->next();\n    if ($value < -0x80 || $value > 0x7F) {\n      throw new TProtocolException('Value is outside of valid range');\n    }\n  }\n\n  public function readI16(&$value) {\n    $value = (int) $this->top->current();\n    $this->top->next();\n    if ($value < -0x8000 || $value > 0x7FFF) {\n      throw new TProtocolException('Value is outside of valid range');\n    }\n  }\n\n  public function readI32(&$value) {\n    $value = (int) $this->top->current();\n    $this->top->next();\n    if ($value < -0x80000000 || $value > 0x7FFFFFFF) {\n      throw new TProtocolException('Value is outside of valid range');\n    }\n  }\n\n  public function readI64(&$value) {\n    $value = (int) $this->top->current();\n    $this->top->next();\n    if ($value < (-0x80000000 << 32) ||\n        $value > (0x7FFFFFFF << 32 | 0xFFFFFFFF)) {\n      throw new TProtocolException('Value is outside of valid range');\n    }\n  }\n\n  public function readDouble(&$value) {\n    $value = (float) $this->top->current();\n    $this->top->next();\n  }\n\n  public function readFloat(&$value) {\n    $value = (float) $this->top->current();\n    $this->top->next();\n  }\n\n  public function readString(&$value) {\n    $value = (string) $this->top->current();\n    $this->top->next();\n  }\n\n  public function writeMessageBegin($name, $type, $seqid) {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeMessageEnd() {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeStructBegin($name) {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeStructEnd() {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeFieldBegin($fieldName, $fieldType, $fieldId) {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeFieldEnd() {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeFieldStop() {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeMapBegin($keyType, $valType, $size) {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeMapEnd() {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeListBegin($elemType, $size) {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeListEnd() {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeSetBegin($elemType, $size) {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeSetEnd() {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeBool($value) {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeByte($value) {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeI16($value) {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeI32($value) {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeI64($value) {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeDouble($value) {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeFloat($value) {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  public function writeString($value) {\n    throw new TProtocolException('Not Implemented');\n  }\n\n  private function guessTypeForValue(mixed $val): int {\n    if (is_bool($val)) {\n      return TType::BOOL;\n    } else if (is_int($val)) {\n      return TType::I64;\n    } else if (is_float($val)) {\n      return TType::DOUBLE;\n    } else if (is_string($val)) {\n      return TType::STRING;\n    } else if (is_object($val) || is_array($val) || $val instanceof Map) {\n      return TType::STRUCT;\n    } else if ($val instanceof Iterable) {\n      return TType::LST;\n    }\n\n    throw new TProtocolException(\n      'Unable to guess thrift type for '.gettype($val),\n    );\n  }\n}\n", "num_lines": 428}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.protocol.simplephpobject\n */\n\nclass TSimplePHPObjectProtocolKeyedIteratorWrapper\n  implements Iterator<mixed> {\n  private bool $key = true;\n\n  public function __construct(private Iterator<mixed> $itr) {}\n\n  public function key(): string {\n    invariant_violation('Cannot Access Key');\n  }\n\n  public function current(): mixed {\n    if ($this->key) {\n      // UNSAFE_BLOCK\n      return $this->itr->key();\n    } else {\n      return $this->itr->current();\n    }\n  }\n\n  public function next(): void {\n    $this->key = !$this->key;\n    if ($this->key) {\n      $this->itr->next();\n    }\n  }\n\n  public function rewind(): void {\n    $this->key = !$this->key;\n    if (!$this->key) {\n      $this->itr->rewind();\n    }\n  }\n\n  public function valid(): bool {\n    return $this->itr->valid();\n  }\n}\n", "num_lines": 57}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.server\n */\n\n/**\n * Server that can run in non-blocking mode\n */\nclass TNonBlockingServer extends TServer {\n  protected int $clientIdx = 0;\n  protected array<int, TBufferedTransport> $clients = array();\n\n  public function __construct(\n    IThriftProcessor $processor,\n    TServerSocket $serverTransport,\n    TTransportFactory $transportFactory,\n    TProtocolFactory $protocolFactory,\n  ) {\n    parent::__construct(\n      $processor,\n      $serverTransport,\n      $transportFactory,\n      $protocolFactory,\n    );\n  }\n\n  /**\n   * Because our server is non-blocking, don't close this socket\n   * until we need to.\n   *\n   * @return bool true if we should keep the client alive\n   */\n  protected function handle(TBufferedTransport $client): bool {\n    $trans = $this->transportFactory->getTransport($client);\n    $prot = $this->protocolFactory->getProtocol($trans);\n\n    $this->_clientBegin($prot);\n    try {\n      // First check the transport is readable to avoid\n      // blocking on read\n      if (!($trans instanceof TTransportStatus) || $trans->isReadable()) {\n        $this->processor->process($prot, $prot);\n      }\n    } catch (Exception $x) {\n      $md = $client->getMetaData();\n      if ($md['timed_out']) {\n        // keep waiting for the client to send more requests\n      } else if ($md['eof']) {\n        invariant($trans instanceof TTransport, 'Need to make Hack happy');\n        $trans->close();\n        return false;\n      } else {\n        echo 'Handle caught transport exception: '.$x->getMessage().\"\\n\";\n      }\n    }\n    return true;\n  }\n\n  protected function processExistingClients(): void {\n    foreach ($this->clients as $i => $client) {\n      if (!$this->handle($client)) {\n        // remove the client from our list of open clients if\n        // our handler reports that the client is no longer alive\n        unset($this->clients[$i]);\n      }\n    }\n  }\n\n  /*\n   * This method should be called repeately on idle to listen and\n   * process an request. If there is no pending request, it will\n   * return;\n   */\n  public function serve(): void {\n    $this->serverTransport->listen();\n    $this->process();\n  }\n\n  public function process(): void {\n    // 0 timeout is non-blocking\n    $client = $this->serverTransport->accept(0);\n    if ($client) {\n      $this->clients[$this->clientIdx++] = $client;\n    }\n\n    $this->processExistingClients();\n  }\n}\n", "num_lines": 103}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.server\n */\n\n/**\n * Base interface for a server.\n *\n *     The attribute serverEventHandler (default: null) receives\n *     callbacks for various events in the server lifecycle.  It should\n *     be set to an instance of TServerEventHandler.\n */\nabstract class TServer {\n  protected IThriftProcessor $processor;\n  protected TServerSocket $serverTransport;\n  protected TTransportFactory $transportFactory;\n  protected TProtocolFactory $protocolFactory;\n  protected ?TServerEventHandler $serverEventHandler;\n\n  public function __construct(\n    IThriftProcessor $processor,\n    TServerSocket $serverTransport,\n    TTransportFactory $transportFactory,\n    TProtocolFactory $protocolFactory,\n  ) {\n    $this->processor = $processor;\n    $this->serverTransport = $serverTransport;\n    $this->transportFactory = $transportFactory;\n    $this->protocolFactory = $protocolFactory;\n\n    $this->serverEventHandler = null;\n  }\n\n  protected function _clientBegin(TProtocol $prot): void {\n    if ($this->serverEventHandler) {\n      $this->serverEventHandler->clientBegin($prot);\n    }\n  }\n\n  protected function handle(TBufferedTransport $client): bool {\n    $trans = $this->transportFactory->getTransport($client);\n    $prot = $this->protocolFactory->getProtocol($trans);\n\n    $this->_clientBegin($prot);\n    try {\n      $this->processor->process($prot, $prot);\n    } catch (TTransportException $tx) {\n      // ignore\n      return false;\n    } catch (Exception $x) {\n      echo 'Handle caught transport exception: '.$x->getMessage().\"\\n\";\n      return false;\n    }\n\n    $trans->close();\n    return true;\n  }\n\n  public abstract function serve(): void;\n}\n", "num_lines": 75}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.server\n */\n\n/**\n * Event handler base class.  Override selected methods on this class\n * to implement custom event handling\n */\nabstract class TServerEventHandler {\n\n  /**\n   * Called before a new client request is handled\n   */\n  public abstract function clientBegin(TProtocol $prot): void;\n}\n", "num_lines": 31}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\ninterface InstrumentedTTransport {\n  public function getBytesWritten(): int;\n  public function getBytesRead(): int;\n  public function resetBytesWritten(): void;\n  public function resetBytesRead(): void;\n}\n", "num_lines": 26}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/**\n * TTransport subclasses that implement InstrumentedTTransport and use\n * InstrumentedTTransportTrait have a simple set of counters available.\n */\ntrait InstrumentedTTransportTrait {\n  private int $bytesWritten = 0;\n  private int $bytesRead = 0;\n\n  public function getBytesWritten(): int {\n    return $this->bytesWritten;\n  }\n\n  public function getBytesRead(): int {\n    return $this->bytesRead;\n  }\n\n  public function resetBytesWritten(): void {\n    $this->bytesWritten = 0;\n  }\n\n  public function resetBytesRead(): void {\n    $this->bytesRead = 0;\n  }\n\n  protected function onWrite(int $bytes_written): void {\n    $this->bytesWritten += $bytes_written;\n  }\n\n  protected function onRead(int $bytes_read): void {\n    $this->bytesRead += $bytes_read;\n  }\n}\n", "num_lines": 52}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\ninterface IThriftBufferedTransport {\n  public function peek(int $len, int $start = 0);\n  public function putBack(string $data): void;\n  public function minBytesAvailable(): int;\n}\n", "num_lines": 25}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\ninterface IThriftRemoteConn extends TTransportStatus {\n  public function open(): void;\n  public function close(): void;\n  public function flush(): void;\n  public function isOpen(): bool;\n\n  public function read(int $len): string;\n  public function readAll(int $len): string;\n  public function write(string $buf): void;\n\n  public function getRecvTimeout(): int;\n  public function setRecvTimeout(int $timeout): void;\n\n  public function getHost(): string;\n  public function getPort(): int;\n}\n", "num_lines": 36}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/**\n * Buffered transport. Stores data to an internal buffer that it doesn't\n * actually write out until flush is called. For reading, we do a greedy\n * read and then serve data out of the internal buffer.\n *\n * @package thrift.transport\n */\nclass TBufferedTransport extends TTransport\n  implements TTransportStatus, IThriftBufferedTransport {\n\n  /**\n   * Constructor. Creates a buffered transport around an underlying transport\n   */\n  public function __construct(\n    ?TTransport $transport = null,\n    int $rBufSize = 512,\n    int $wBufSize = 512,\n  ) {\n    $this->transport_ = $transport ?: new TNullTransport();\n    $this->rBufSize_ = $rBufSize;\n    $this->wBufSize_ = $wBufSize;\n  }\n\n  /**\n   * The underlying transport\n   *\n   * @var TTransport\n   */\n  protected TTransport $transport_;\n\n  /**\n   * The receive buffer size\n   *\n   * @var int\n   */\n  protected int $rBufSize_ = 512;\n\n  /**\n   * The write buffer size\n   *\n   * @var int\n   */\n  protected int $wBufSize_ = 512;\n\n  /**\n   * The write buffer.\n   *\n   * @var string\n   */\n  protected string $wBuf_ = '';\n\n  /**\n   * The read buffer.\n   *\n   * @var string\n   */\n  protected string $rBuf_ = '';\n\n  public function isOpen(): bool {\n    return $this->transport_->isOpen();\n  }\n\n  public function open(): void {\n    $this->transport_->open();\n  }\n\n  public function close(): void {\n    $this->transport_->close();\n  }\n\n  public function putBack(string $data): void {\n    if (strlen($this->rBuf_) === 0) {\n      $this->rBuf_ = $data;\n    } else {\n      $this->rBuf_ = ($data.$this->rBuf_);\n    }\n  }\n\n  public function getMetaData(): array<string, mixed> {\n    if ($this->transport_ instanceof TSocket) {\n      return $this->transport_->getMetaData();\n    }\n\n    return array();\n  }\n\n  public function isReadable(): bool {\n    if (strlen($this->rBuf_) > 0) {\n      return true;\n    }\n\n    if ($this->transport_ instanceof TTransportStatus) {\n      return $this->transport_->isReadable();\n    }\n\n    return true;\n  }\n\n  public function isWritable(): bool {\n    if ($this->transport_ instanceof TTransportStatus) {\n      return $this->transport_->isWritable();\n    }\n\n    return true;\n  }\n\n  public function minBytesAvailable(): int {\n    return strlen($this->rBuf_);\n  }\n\n  /**\n   * The reason that we customize readAll here is that the majority of PHP\n   * streams are already internally buffered by PHP. The socket stream, for\n   * example, buffers internally and blocks if you call read with $len greater\n   * than the amount of data available, unlike recv() in C.\n   *\n   * Therefore, use the readAll method of the wrapped transport inside\n   * the buffered readAll.\n   */\n  public function readAll(int $len): string {\n    $have = strlen($this->rBuf_);\n    $data = '';\n    if ($have == 0) {\n      $data = $this->transport_->readAll($len);\n    } else if ($have < $len) {\n      $data = $this->rBuf_;\n      $this->rBuf_ = '';\n      $data .= $this->transport_->readAll($len - $have);\n    } else if ($have == $len) {\n      $data = $this->rBuf_;\n      $this->rBuf_ = '';\n    } else if ($have > $len) {\n      $data = substr($this->rBuf_, 0, $len);\n      $this->rBuf_ = substr($this->rBuf_, $len);\n    }\n    return $data;\n  }\n\n  public function read(int $len): string {\n    if (strlen($this->rBuf_) === 0) {\n      $this->rBuf_ = $this->transport_->read($this->rBufSize_);\n    }\n\n    if (strlen($this->rBuf_) <= $len) {\n      $ret = $this->rBuf_;\n      $this->rBuf_ = '';\n      return $ret;\n    }\n\n    $ret = substr($this->rBuf_, 0, $len);\n    $this->rBuf_ = substr($this->rBuf_, $len);\n    return $ret;\n  }\n\n  /**\n   * Peek some bytes in the buffer without removing the bytes from it\n   *\n   * @param int $len   length to peek\n   * @param int $start the start position of the returned string\n   *\n   * @return null on peek failure\n   */\n  public function peek(int $len, int $start = 0): string {\n    $bytes_needed = $len + $start;\n    // read until either timeout OR get enough bytes\n    if (strlen($this->rBuf_) == 0) {\n      $this->rBuf_ = $this->transport_->readAll($bytes_needed);\n    } else if ($bytes_needed > strlen($this->rBuf_)) {\n      $this->rBuf_ .=\n        $this->transport_->readAll($bytes_needed - strlen($this->rBuf_));\n    }\n\n    $ret = substr($this->rBuf_, $start, $len);\n    return $ret;\n  }\n\n  public function write(string $buf): void {\n    $this->wBuf_ .= $buf;\n    if (strlen($this->wBuf_) >= $this->wBufSize_) {\n      $out = $this->wBuf_;\n\n      // Note that we clear the internal wBuf_ prior to the underlying write\n      // to ensure we're in a sane state (i.e. internal buffer cleaned)\n      // if the underlying write throws up an exception\n      $this->wBuf_ = '';\n      $this->transport_->write($out);\n    }\n  }\n\n  public function flush(): void {\n    if (strlen($this->wBuf_) > 0) {\n      $this->transport_->write($this->wBuf_);\n      $this->wBuf_ = '';\n    }\n    $this->transport_->flush();\n  }\n\n}\n\n", "num_lines": 219}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/**\n * Framed transport. Writes and reads data in chunks that are stamped with\n * their length.\n *\n * @package thrift.transport\n */\nclass TFramedTransport extends TTransport\n  implements TTransportStatus, IThriftBufferedTransport {\n\n  /**\n   * Underlying transport object.\n   *\n   * @var TTransport\n   */\n  protected TTransport $transport_;\n\n  /**\n   * Buffer for read data.\n   *\n   * @var string\n   */\n  protected string $rBuf_ = '';\n\n  /**\n   * Position in rBuf_ to read the next char\n   *\n   * @var int\n   */\n  protected int $rIndex_ = 0;\n\n  /**\n   * Buffer for queued output data\n   *\n   * @var string\n   */\n  protected string $wBuf_ = '';\n\n  /**\n   * Whether to frame reads\n   *\n   * @var bool\n   */\n  private bool $read_;\n\n  /**\n   * Whether to frame writes\n   *\n   * @var bool\n   */\n  private bool $write_;\n\n  /**\n   * Constructor.\n   *\n   * @param TTransport $transport Underlying transport\n   */\n  public function __construct(\n    ?TTransport $transport = null,\n    bool $read = true,\n    bool $write = true,\n  ) {\n    $this->transport_ = $transport ?: new TNullTransport();\n    $this->read_ = $read;\n    $this->write_ = $write;\n  }\n\n  public function isOpen(): bool {\n    return $this->transport_->isOpen();\n  }\n\n  public function open(): void {\n    $this->transport_->open();\n  }\n\n  public function close(): void {\n    $this->transport_->close();\n  }\n\n  public function isReadable(): bool {\n    if (strlen($this->rBuf_) > 0) {\n      return true;\n    }\n\n    if ($this->transport_ instanceof TTransportStatus) {\n      return $this->transport_->isReadable();\n    }\n\n    return true;\n  }\n\n  public function isWritable(): bool {\n    if ($this->transport_ instanceof TTransportStatus) {\n      return $this->transport_->isWritable();\n    }\n\n    return true;\n  }\n\n  public function minBytesAvailable(): int {\n    return strlen($this->rBuf_) - $this->rIndex_;\n  }\n\n  /**\n   * Reads from the buffer. When more data is required reads another entire\n   * chunk and serves future reads out of that.\n   *\n   * @param int $len How much data\n   */\n  public function read(int $len): string {\n    if (!$this->read_) {\n      return $this->transport_->read($len);\n    }\n\n    if (strlen($this->rBuf_) === 0) {\n      $this->readFrame();\n    }\n\n    // Return substr\n    $out = substr($this->rBuf_, $this->rIndex_, $len);\n    $this->rIndex_ += $len;\n\n    if (strlen($this->rBuf_) <= $this->rIndex_) {\n      $this->rBuf_ = '';\n      $this->rIndex_ = 0;\n    }\n    return $out;\n  }\n\n  /**\n   * Peek some bytes in the frame without removing the bytes from the buffer\n   *\n   * @param int $len   length to peek\n   * @param int $start the start position of the returned string\n   */\n  public function peek(int $len, int $start = 0): string {\n    if (!$this->read_) {\n      return '';\n    }\n\n    if (strlen($this->rBuf_) === 0) {\n      $this->readFrame();\n    }\n\n    // Return substr\n    $out = substr($this->rBuf_, $this->rIndex_ + $start, $len);\n\n    return $out;\n  }\n\n  /**\n   * Put previously read data back into the buffer\n   *\n   * @param string $data data to return\n   */\n  public function putBack(string $data): void {\n    if (strlen($this->rBuf_) === 0) {\n      $this->rBuf_ = $data;\n    } else {\n      $this->rBuf_ = ($data.(string) substr($this->rBuf_, $this->rIndex_));\n    }\n    $this->rIndex_ = 0;\n  }\n\n  /**\n   * Reads a chunk of data into the internal read buffer.\n   */\n  private function readFrame(): void {\n    $buf = $this->transport_->readAll(4);\n    $val = unpack('N', $buf);\n    $sz = $val[1];\n\n    $this->rBuf_ = $this->transport_->readAll($sz);\n    $this->rIndex_ = 0;\n  }\n\n  /**\n   * Writes some data to the pending output buffer.\n   *\n   * @param string $buf The data\n   * @param int    $len Limit of bytes to write\n   */\n  public function write(string $buf, ?int $len = null): void {\n    if (!$this->write_) {\n      $this->transport_->write($buf);\n      return;\n    }\n\n    if ($len !== null && $len < strlen($buf)) {\n      $buf = substr($buf, 0, $len);\n    }\n    $this->wBuf_ .= $buf;\n  }\n\n  /**\n   * Writes the output buffer to the stream in the format of a 4-byte length\n   * followed by the actual data.\n   */\n  public function flush(): void {\n    if (!$this->write_ || strlen($this->wBuf_) == 0) {\n      $this->transport_->flush();\n      return;\n    }\n\n    $out = (string) pack('N', strlen($this->wBuf_));\n    $out .= $this->wBuf_;\n\n    // Note that we clear the internal wBuf_ prior to the underlying write\n    // to ensure we're in a sane state (i.e. internal buffer cleaned)\n    // if the underlying write throws up an exception\n    $this->wBuf_ = '';\n    $this->transport_->write($out);\n    $this->transport_->flush();\n  }\n\n}\n", "num_lines": 235}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/**\n * Header transport. Writes and reads data with\n *\n * THeaderTransport (any protocol)\n * or TFramedTransport format\n * or unframed TBinaryProtocol.\n * (or TBinary over HTTP if someone wants to implement it)\n *\n * @package thrift.transport\n */\nclass THeaderTransport extends TFramedTransport\n  implements TTransportSupportsHeaders {\n  const int TBINARY_PROTOCOL = 0;\n  const int TJSON_PROTOCOL = 1;\n  const int TCOMPACT_PROTOCOL = 2;\n\n  const int HEADER_MAGIC = 0x0fff;\n  const int HTTP_MAGIC = 0x504f5354; // POST\n  const int MAX_FRAME_SIZE = 0x3fffffff;\n\n  // Transforms\n  const int ZLIB_TRANSFORM = 0x01;\n\n  // Infos\n  const int INFO_KEYVALUE = 0x01;\n\n  // Client types\n  const int HEADER_CLIENT_TYPE = 0x00;\n  const int FRAMED_DEPRECATED = 0x01;\n  const int UNFRAMED_DEPRECATED = 0x02;\n  const int HTTP_CLIENT_TYPE = 0x03;\n  const int UNKNOWN_CLIENT_TYPE = 0x04;\n\n  // default to binary\n  protected int $protoId_ = self::TBINARY_PROTOCOL;\n  protected int $clientType_ = self::HEADER_CLIENT_TYPE;\n  protected Set<int> $supportedProtocols;\n  protected Vector<int> $readTrans_;\n  protected Vector<int> $writeTrans_;\n  protected int $seqId_ = 0;\n  protected int $flags_ = 0;\n\n  protected Map<string, string> $readHeaders;\n  protected Map<string, string> $writeHeaders;\n  protected Map<string, string> $persistentWriteHeaders;\n\n  const string IDENTITY_HEADER = \"identity\";\n  const string ID_VERSION_HEADER = \"id_version\";\n  const int ID_VERSION = 1;\n  protected ?string $identity = null;\n\n  /**\n   * Constructor.\n   *\n   * @param TTransport $transport Underlying transport\n   */\n  public function __construct(\n    ?TTransport $transport = null,\n    ?Traversable<int> $protocols = null,\n  ) {\n    parent::__construct($transport, true, true);\n    $this->readTrans_ = Vector {};\n    $this->writeTrans_ = Vector {};\n    $this->readHeaders = Map {};\n    $this->writeHeaders = Map {};\n    $this->persistentWriteHeaders = Map {};\n    $this->supportedProtocols = Set {\n      self::HEADER_CLIENT_TYPE,\n      self::FRAMED_DEPRECATED,\n      self::UNFRAMED_DEPRECATED,\n      self::HTTP_CLIENT_TYPE,\n    };\n    if ($protocols) {\n      $this->supportedProtocols->addAll($protocols);\n    }\n  }\n\n  public function getProtocolID(): int {\n    return $this->protoId_;\n  }\n\n  public function setProtocolID(int $protoId): this {\n    $this->protoId_ = $protoId;\n    return $this;\n  }\n\n  public function addTransform(int $trans_id): this {\n    $this->writeTrans_[] = $trans_id;\n    return $this;\n  }\n\n  public function resetProtocol(): void {\n    if ($this->clientType_ === self::HTTP_CLIENT_TYPE) {\n      $this->flush();\n    }\n    $this->clientType_ = self::HEADER_CLIENT_TYPE;\n    $this->readFrame(0);\n  }\n\n  public function setHeader(string $str_key, @string $str_value): this {\n    $this->writeHeaders[$str_key] = (string) $str_value;\n    return $this;\n  }\n\n  public function setPersistentHeader(\n    string $str_key,\n    @string $str_value,\n  ): this {\n    $this->persistentWriteHeaders[$str_key] = (string) $str_value;\n    return $this;\n  }\n\n  public function getWriteHeaders(): KeyedContainer<string, string> {\n    return $this->writeHeaders;\n  }\n\n  public function getPersistentWriteHeaders(): KeyedContainer<string, string> {\n    return $this->persistentWriteHeaders;\n  }\n\n  public function getHeaders(): KeyedContainer<string, string> {\n    return $this->readHeaders;\n  }\n\n  public function clearHeaders(): void {\n    $this->writeHeaders = Map {};\n  }\n\n  public function clearPersistentHeaders(): void {\n    $this->persistentWriteHeaders = Map {};\n  }\n\n  public function getPeerIdentity(): ?string {\n    if ($this->readHeaders->contains(self::IDENTITY_HEADER)) {\n      if ((int) $this->readHeaders[self::ID_VERSION_HEADER] ===\n          self::ID_VERSION) {\n        return $this->readHeaders[self::IDENTITY_HEADER];\n      }\n    }\n\n    return null;\n  }\n\n  public function setIdentity(string $identity): this {\n    $this->identity = $identity;\n    return $this;\n  }\n\n  /**\n   * Reads from the buffer. When more data is required reads another entire\n   * chunk and serve future reads out of that.\n   *\n   * @param int $len How much data\n   */\n  public function read(int $len): @string { // Task #5347782\n    if ($this->clientType_ === self::UNFRAMED_DEPRECATED) {\n      return $this->transport_->readAll($len);\n    }\n\n    if (strlen($this->rBuf_) === 0) {\n      $this->readFrame($len);\n    }\n\n    // Return substr\n    $out = substr($this->rBuf_, $this->rIndex_, $len);\n    $this->rIndex_ += $len;\n\n    if (strlen($this->rBuf_) <= $this->rIndex_) {\n      $this->rBuf_ = '';\n      $this->rIndex_ = 0;\n    }\n    return $out;\n  }\n\n  /**\n   * Reads a chunk of data into the internal read buffer.\n   */\n  private function readFrame(int $req_sz): void {\n    $buf = $this->transport_->readAll(4);\n    $val = unpack('N', $buf);\n    $sz = $val[1];\n\n    if (($sz & TBinaryProtocol::VERSION_MASK) === TBinaryProtocol::VERSION_1) {\n      $this->clientType_ = self::UNFRAMED_DEPRECATED;\n      if ($req_sz <= 4) {\n        $this->rBuf_ = $buf;\n      } else {\n        $this->rBuf_ = $buf.$this->transport_->readAll($req_sz - 4);\n      }\n    } else if ($sz === self::HTTP_MAGIC) {\n      throw new TTransportException(\n        'PHP HeaderTransport does not support HTTP',\n        TTransportException::INVALID_CLIENT,\n      );\n    } else {\n      // Either header format or framed. Check next byte\n      $buf2 = $this->transport_->readAll(4);\n      $val2 = unpack('N', $buf2);\n      $version = $val2[1];\n      if (($version & TBinaryProtocol::VERSION_MASK) ===\n          TBinaryProtocol::VERSION_1) {\n        $this->clientType_ = self::FRAMED_DEPRECATED;\n        if ($sz - 4 > self::MAX_FRAME_SIZE) {\n          throw new TTransportException(\n            'Frame size is too large',\n            TTransportException::INVALID_FRAME_SIZE,\n          );\n        }\n        $this->rBuf_ = $buf2.$this->transport_->readAll($sz - 4);\n      } else if (($version & 0xffff0000) === (self::HEADER_MAGIC << 16)) {\n        $this->clientType_ = self::HEADER_CLIENT_TYPE;\n        if ($sz - 4 > self::MAX_FRAME_SIZE) {\n          throw new TTransportException(\n            'Frame size is too large',\n            TTransportException::INVALID_FRAME_SIZE,\n          );\n        }\n        $this->flags_ = ($version & 0x0000ffff);\n        // read seqId\n        $buf3 = $this->transport_->readAll(4);\n        $val3 = unpack('N', $buf3);\n        $this->seqId_ = $val3[1];\n        // read header_size\n        $buf4 = $this->transport_->readAll(2);\n        $val4 = unpack('n', $buf4);\n        $header_size = $val4[1];\n\n        $data = $buf.$buf2.$buf3.$buf4;\n        $index = strlen($data);\n\n        $data .= $this->transport_->readAll($sz - 10);\n        $this->readHeaderFormat($sz - 10, $header_size, $data, $index);\n      } else {\n        $this->clientType_ = self::UNKNOWN_CLIENT_TYPE;\n        throw new TTransportException(\n          'Unknown client type',\n          TTransportException::INVALID_CLIENT,\n        );\n      }\n    }\n\n    if (!$this->supportedProtocols->contains($this->clientType_)) {\n      throw new TTransportException(\n        'Client type not supported on this server',\n        TTransportException::INVALID_CLIENT,\n      );\n    }\n\n  }\n\n  protected function readVarint(string $data, int &$index): int {\n    $result = 0;\n    $shift = 0;\n    while (true) {\n      $x = substr($data, $index++, 1);\n      $byte = ord($x);\n      $result |= ($byte & 0x7f) << $shift;\n      if (($byte >> 7) === 0) {\n        return $result;\n      }\n      $shift += 7;\n    }\n\n    throw new TTransportException(\"THeaderTransport: You shouldn't be here\");\n  }\n\n  protected function getVarint(int $data): string {\n    $out = \"\";\n    while (true) {\n      if (($data & ~0x7f) === 0) {\n        $out .= chr($data);\n        break;\n      } else {\n        $out .= chr(($data & 0xff) | 0x80);\n        $data = $data >> 7;\n      }\n    }\n    return $out;\n  }\n\n  protected function writeString(string $str): string {\n    $buf = $this->getVarint(strlen($str));\n    $buf .= $str;\n    return $buf;\n  }\n\n  protected function readString(\n    string $data,\n    int &$index,\n    int $limit,\n  ): string {\n    $str_sz = $this->readVarint($data, $index);\n    if ($str_sz + $index > $limit) {\n      throw new TTransportException(\n        'String read too long',\n        TTransportException::INVALID_FRAME_SIZE,\n      );\n    }\n\n    $str = substr($data, $index, $str_sz);\n    $index += $str_sz;\n    return $str;\n  }\n\n  protected function readHeaderFormat(\n    int $sz,\n    int $header_size,\n    string $data,\n    int $index,\n  ): void {\n    $this->readTrans_ = Vector {};\n\n    $header_size = $header_size * 4;\n    if ($header_size > $sz) {\n      throw new TTransportException(\n        'Header size is larger than frame',\n        TTransportException::INVALID_FRAME_SIZE,\n      );\n    }\n    $end_of_header = $index + $header_size;\n\n    $this->protoId_ = $this->readVarint($data, $index);\n    $numHeaders = $this->readVarint($data, $index);\n    if ($this->protoId_ === 1 &&\n        $this->clientType_ !== self::HTTP_CLIENT_TYPE) {\n      throw new TTransportException(\n        'Trying to recv JSON encoding over binary',\n        TTransportException::INVALID_CLIENT,\n      );\n    }\n\n    // Read in the headers.  Data for each header varies.\n    for ($i = 0; $i < $numHeaders; $i++) {\n      $transId = $this->readVarint($data, $index);\n      switch ($transId) {\n        case self::ZLIB_TRANSFORM:\n          $this->readTrans_[] = $transId;\n          break;\n\n        default:\n          throw new TApplicationException(\n            'Unknown transform in client request',\n            TApplicationException::INVALID_TRANSFORM,\n          );\n      }\n    }\n    // Make sure that the read transforms are applied in the reverse order\n    // from when the data was written.\n    $this->readTrans_ = array_reverse($this->readTrans_);\n\n    // Read the info headers\n    $this->readHeaders = Map {};\n    while ($index < $end_of_header) {\n      $infoId = $this->readVarint($data, $index);\n      switch ($infoId) {\n        case self::INFO_KEYVALUE:\n          $num_keys = $this->readVarint($data, $index);\n          for ($i = 0; $i < $num_keys; $i++) {\n            $strKey = $this->readString($data, $index, $end_of_header);\n            $strValue = $this->readString($data, $index, $end_of_header);\n            $this->readHeaders[$strKey] = $strValue;\n          }\n          break;\n        default:\n          // End of infos\n          break;\n      }\n    }\n\n    $this->rBuf_ =\n      $this->untransform(substr($data, $end_of_header, $sz - $header_size));\n  }\n\n  protected function transform(string $data): string {\n    // UNSAFE_BLOCK: the only way we know that these possibly iterated compressors\n    // will produce reeasonable results is by complicated promises of the way\n    // thrift sets things up, which Hack has no way to understand.\n    foreach ($this->writeTrans_ as $trans) {\n      switch ($trans) {\n        case self::ZLIB_TRANSFORM:\n          $data = gzcompress($data);\n          break;\n\n        default:\n          throw new TTransportException(\n            'Unknown transform during send',\n            TTransportException::INVALID_TRANSFORM,\n          );\n      }\n    }\n    return $data;\n  }\n\n  protected function untransform(string $data): @string { // Task #5347782\n    // UNSAFE_BLOCK: the only way we know that these possibly iterated compressors\n    // will produce reeasonable results is by complicated promises of the way\n    // thrift sets things up, which Hack has no way to understand.\n    foreach ($this->readTrans_ as $trans) {\n      switch ($trans) {\n        case self::ZLIB_TRANSFORM:\n          $data = gzuncompress($data);\n          break;\n\n        default:\n          throw new TApplicationException(\n            'Unknown transform during recv',\n            TTransportException::INVALID_TRANSFORM,\n          );\n      }\n    }\n    return $data;\n  }\n\n  /**\n   * Writes the output buffer in header format, or format\n   * client responded with (framed, unframed, http)\n   */\n  public function flush(): void {\n    $this->flushImpl(false);\n  }\n\n  public function onewayFlush(): void {\n    $this->flushImpl(true);\n  }\n\n  private function flushImpl(bool $oneway): void {\n    if (strlen($this->wBuf_) == 0) {\n      if ($oneway) {\n        $this->transport_->onewayFlush();\n      } else {\n        $this->transport_->flush();\n      }\n      return;\n    }\n\n    $out = $this->transform($this->wBuf_);\n\n    // Note that we clear the internal wBuf_ prior to the underlying write\n    // to ensure we're in a sane state (i.e. internal buffer cleaned)\n    // if the underlying write throws up an exception\n    $this->wBuf_ = '';\n\n    if ($this->protoId_ === 1 &&\n        $this->clientType_ !== self::HTTP_CLIENT_TYPE) {\n      throw new TTransportException(\n        'Trying to send JSON encoding over binary',\n        TTransportException::INVALID_CLIENT,\n      );\n    }\n\n    $buf = '';\n    if ($this->clientType_ === self::HEADER_CLIENT_TYPE) {\n      $transformData = '';\n\n      $num_headers = 0;\n      // For now, no transform requires data.\n      foreach ($this->writeTrans_ as $trans) {\n        ++$num_headers;\n        $transformData .= $this->getVarint($trans);\n      }\n\n      // Add in special flags.\n      if ($this->identity !== null) {\n        $this->writeHeaders[self::ID_VERSION_HEADER] =\n          (string) self::ID_VERSION;\n        $this->writeHeaders[self::IDENTITY_HEADER] = $this->identity;\n      }\n\n      $infoData = '';\n      if ($this->writeHeaders || $this->persistentWriteHeaders) {\n        $infoData .= $this->getVarint(self::INFO_KEYVALUE);\n        $infoData .= $this->getVarint(\n          count($this->writeHeaders) +\n          count($this->persistentWriteHeaders),\n        );\n        foreach ($this->persistentWriteHeaders as $str_key => $str_value) {\n          $infoData .= $this->writeString($str_key);\n          $infoData .= $this->writeString($str_value);\n        }\n        foreach ($this->writeHeaders as $str_key => $str_value) {\n          $infoData .= $this->writeString($str_key);\n          $infoData .= $this->writeString($str_value);\n        }\n      }\n      $this->writeHeaders = Map {};\n\n      $headerData =\n        $this->getVarint($this->protoId_).$this->getVarint($num_headers);\n      $header_size =\n        strlen($transformData) + strlen($infoData) + strlen($headerData);\n      $paddingSize = 4 - ($header_size % 4);\n      $header_size += $paddingSize;\n\n      $buf = (string) pack('nn', self::HEADER_MAGIC, $this->flags_);\n      $buf .= (string) pack('Nn', $this->seqId_, $header_size / 4);\n\n      $buf .= $headerData.$transformData;\n      $buf .= $infoData;\n\n      // Pad out the header with 0x00\n      for ($i = 0; $i < $paddingSize; $i++) {\n        $buf .= (string) pack('C', '\\0');\n      }\n\n      // Append the data\n      $buf .= $out;\n\n      // Prepend the size.\n      $buf = (string) pack('N', strlen($buf)).$buf;\n    } else if ($this->clientType_ === self::FRAMED_DEPRECATED) {\n      $buf = (string) pack('N', strlen($out));\n      $buf .= $out;\n    } else if ($this->clientType_ === self::UNFRAMED_DEPRECATED) {\n      $buf = $out;\n    } else if ($this->clientType_ === self::HTTP_CLIENT_TYPE) {\n      throw new TTransportException(\n        'HTTP not implemented',\n        TTransportException::INVALID_CLIENT,\n      );\n    } else {\n      throw new TTransportException(\n        'Unknown client type',\n        TTransportException::INVALID_CLIENT,\n      );\n    }\n\n    if (strlen($buf) > self::MAX_FRAME_SIZE) {\n      throw new TTransportException(\n        'Attempting to send oversize frame',\n        TTransportException::INVALID_FRAME_SIZE,\n      );\n    }\n\n    $this->transport_->write($buf);\n    if ($oneway) {\n      $this->transport_->onewayFlush();\n    } else {\n      $this->transport_->flush();\n    }\n  }\n}\n", "num_lines": 561}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\nclass THeaderTransportFactory extends TTransportFactory {\n  /**\n   * @static\n   * @param TTransport $transport\n   * @return TTransport\n   */\n  public function getTransport(TTransport $transport): THeaderTransport {\n    $p = Vector {\n      THeaderTransport::HEADER_CLIENT_TYPE,\n      THeaderTransport::FRAMED_DEPRECATED,\n      THeaderTransport::UNFRAMED_DEPRECATED,\n    };\n    return new THeaderTransport($transport, $p);\n  }\n}\n", "num_lines": 35}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/**\n * HTTP client for Thrift\n *\n * @package thrift.transport\n */\nclass THttpClient extends TTransport implements IThriftRemoteConn {\n\n  /**\n   * The host to connect to\n   *\n   * @var string\n   */\n  protected string $host_;\n\n  /**\n   * The port to connect on\n   *\n   * @var int\n   */\n  protected int $port_;\n\n  /**\n   * The URI to request\n   *\n   * @var string\n   */\n  protected string $uri_;\n\n  /**\n   * The scheme to use for the request, i.e. http, https\n   *\n   * @var string\n   */\n  protected string $scheme_;\n\n  /**\n   * Buffer for the HTTP request data\n   *\n   * @var string\n   */\n  protected string $buf_;\n\n  /**\n   * Input data stream.\n   *\n   * @var resource\n   */\n  protected string $data_;\n\n  /**\n   * Error message\n   *\n   * @var string\n   */\n  protected ?string $errstr_;\n\n  /**\n   * Read timeout\n   *\n   * @var float\n   */\n  protected ?float $timeout_;\n\n  /**\n   * Custom HTTP headers\n   *\n   * @var array\n   */\n  protected ?KeyedContainer<string, string> $custom_headers_;\n\n  /**\n   * Debugging on?\n   *\n   * @var bool\n   */\n  protected bool $debug_ = false;\n\n  /**\n   * Debug handler\n   *\n   * @var mixed\n   */\n  protected (function(string): bool) $debugHandler_;\n\n  /**\n   * Specifies the maximum number of bytes to read\n   * at once from internal stream.\n   */\n  protected ?int $maxReadChunkSize_ = null;\n\n  /**\n   * Path to a custom CA bundle to use when verifying an HTTPS certificate.\n   * Useful when talking to a service with a cert signed by the FB CA.\n   */\n  protected ?string $caInfo_;\n\n  /**\n   * Make a new HTTP client.\n   *\n   * @param string $host\n   * @param int    $port\n   * @param string $uri\n   */\n  public function __construct(\n    string $host,\n    int $port = 80,\n    string $uri = '',\n    string $scheme = 'http',\n    ?(function(string): bool) $debugHandler = null,\n  ) {\n    if ($uri && ($uri[0] != '/')) {\n      $uri = '/'.$uri;\n    }\n    $this->scheme_ = $scheme;\n    $this->host_ = $host;\n    $this->port_ = $port;\n    $this->uri_ = $uri;\n    $this->buf_ = '';\n    $this->data_ = '';\n    $this->errstr_ = '';\n    $this->timeout_ = null;\n    $this->custom_headers_ = null;\n    $this->debugHandler_ = $debugHandler ?: fun('error_log');\n  }\n\n  /**\n   * Sets the internal max read chunk size.\n   * null for no limit (default).\n   */\n  public function setMaxReadChunkSize(int $maxReadChunkSize): void {\n    $this->maxReadChunkSize_ = $maxReadChunkSize;\n  }\n\n  public function setCAInfo(string $path_to_ca_bundle): void {\n    $this->caInfo_ = $path_to_ca_bundle;\n  }\n\n  /**\n   * Set read timeout\n   *\n   * @param float $timeout\n   */\n  public function setTimeoutSecs(float $timeout): void {\n    $this->timeout_ = $timeout;\n  }\n\n  /**\n   * Set custom headers\n   *\n   * @param array of key value pairs of custom headers\n   */\n  public function setCustomHeaders(\n    KeyedContainer<string, string> $custom_headers,\n  ): void {\n    $this->custom_headers_ = $custom_headers;\n  }\n\n  /**\n   * Get custom headers\n   *\n   * @return array key value pairs of custom headers\n   */\n  public function getCustomHeaders(): ?KeyedContainer<string, string> {\n    return $this->custom_headers_;\n  }\n\n  /**\n   * Get the remote host that this transport is connected to.\n   *\n   * @return string host\n   */\n  public function getHost(): string {\n    return $this->host_;\n  }\n\n  /**\n   * Get the remote port that this transport is connected to.\n   *\n   * @return int port\n   */\n  public function getPort(): int {\n    return $this->port_;\n  }\n\n  /**\n   * Get the scheme used to connect to the remote server.\n   *\n   * @return string scheme\n   */\n  public function getScheme(): string {\n    return $this->scheme_;\n  }\n\n  /**\n   * Sets debugging output on or off\n   *\n   * @param bool $debug\n   */\n  public function setDebug(bool $debug): void {\n    $this->debug_ = $debug;\n  }\n\n  /**\n   * Whether this transport is open.\n   *\n   * @return boolean true if open\n   */\n  public function isOpen(): bool {\n    return true;\n  }\n\n  /**\n   * Open the transport for reading/writing\n   *\n   * @throws TTransportException if cannot open\n   */\n  public function open(): void {}\n\n  /**\n   * Close the transport.\n   */\n  public function close(): void {\n    $this->data_ = '';\n  }\n\n  /**\n   * Read some data into the array.\n   *\n   * @param int    $len How much to read\n   * @return string The data that has been read\n   * @throws TTransportException if cannot read any more data\n   */\n  public function read(int $len): string {\n    if ($this->maxReadChunkSize_ !== null) {\n      $len = min($len, $this->maxReadChunkSize_);\n    }\n\n    if (strlen($this->data_) < $len) {\n      $data = $this->data_;\n      $this->data_ = '';\n    } else {\n      $data = substr($this->data_, 0, $len);\n      $this->data_ = substr($this->data_, $len);\n    }\n\n    if ($data === false || $data === '') {\n      throw new TTransportException(\n        'THttpClient: Could not read '.\n        $len.\n        ' bytes from '.\n        $this->host_.\n        ':'.\n        $this->port_.\n        '/'.\n        $this->uri_.\n        \" Reason: \".\n        $this->errstr_,\n        TTransportException::UNKNOWN,\n      );\n    }\n    return $data;\n  }\n\n  /**\n   * Writes some data into the pending buffer\n   *\n   * @param string $buf  The data to write\n   * @throws TTransportException if writing fails\n   */\n  public function write(string $buf): void {\n    $this->buf_ .= $buf;\n  }\n\n  /**\n   * Opens and sends the actual request over the HTTP connection\n   *\n   * @throws TTransportException if a writing error occurs\n   */\n  public function flush(): void {\n    $host = $this->host_.':'.$this->port_;\n    $user_agent = 'PHP/THttpClient';\n    /* HH_FIXME[2050] We know $_SERVER exists, even if Hack doesn't */\n    $script = (string) urlencode(basename($_SERVER['SCRIPT_FILENAME']));\n    if ($script) {\n      $user_agent .= ' ('.$script.')';\n    }\n\n    $curl = curl_init($this->scheme_.'://'.$host.$this->uri_);\n\n    $headers = array(\n      'Host: '.$host,\n      'Accept: application/x-thrift',\n      'User-Agent: '.$user_agent,\n      'Content-Type: application/x-thrift',\n      'Content-Length: '.(string) strlen($this->buf_),\n    );\n\n    if ($this->custom_headers_ !== null) {\n      foreach ($this->custom_headers_ as $header => $value) {\n        $headers[] = $header.': '.$value;\n      }\n    }\n    curl_setopt($curl, CURLOPT_PROXY, '');\n    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n    curl_setopt($curl, CURLOPT_POST, true);\n    curl_setopt($curl, CURLOPT_MAXREDIRS, 1);\n    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);\n    curl_setopt($curl, CURLOPT_POSTFIELDS, $this->buf_);\n    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n    curl_setopt($curl, CURLOPT_BINARYTRANSFER, true);\n    curl_setopt($curl, CURLOPT_TIMEOUT, $this->timeout_);\n    if ($this->caInfo_ !== null) {\n      curl_setopt($curl, CURLOPT_CAINFO, $this->caInfo_);\n    }\n\n    $this->buf_ = '';\n    $this->data_ = curl_exec($curl);\n\n    $this->errstr_ = curl_error($curl);\n    curl_close($curl);\n\n    // Connect failed?\n    if ($this->data_ === false) {\n      $error = 'THttpClient: Could not connect to '.$host.$this->uri_;\n      throw new TTransportException($error, TTransportException::NOT_OPEN);\n    }\n  }\n\n  public function isReadable(): bool {\n    return (bool) $this->data_;\n  }\n\n  public function isWritable(): bool {\n    return true;\n  }\n\n  public function getRecvTimeout(): int {\n    return 0;\n  }\n  public function setRecvTimeout(int $timeout): void { /* do nothing */\n  }\n}\n", "num_lines": 362}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/** Inherits from THttpClient */\n\n/**\n * Multi-IP HTTP client for Thrift. The client randomly selects and uses a host\n * from its pool.\n *\n * @package thrift.transport\n */\nclass THttpClientPool extends THttpClient {\n\n  /**\n   * Servers belonging to this pool. Array of associative arrays with 'host' and\n   * 'port' keys.\n   */\n  protected array<(string, int)> $servers_ = array();\n\n  /**\n   * Try hosts in order? or randomized?\n   *\n   * @var bool\n   */\n  private bool $randomize_ = true;\n\n  /**\n   * The number of times to try to connect to a particular endpoint.\n   *\n   * @var int\n   */\n  private int $numTries_ = 1;\n\n  /**\n   * Make a new multi-IP HTTP client.\n   *\n   * @param array  $hosts   List of remote hostnames or IPs.\n   * @param mixed  $ports   Array of remote ports, or a single\n   *                        common port.\n   * @param string $uri     URI of the endpoint.\n   * @param string $scheme  http or https\n   */\n  public function __construct(\n    KeyedContainer<mixed, string> $hosts,\n    KeyedContainer<mixed, int> $ports,\n    string $uri = '',\n    string $scheme = 'http',\n    ?(function(string): bool) $debugHandler = null,\n  ) {\n    parent::__construct('', 0, $uri, $scheme, $debugHandler);\n\n    foreach ($hosts as $key => $host) {\n      $this->servers_[] = tuple($host, $ports[$key]);\n    }\n  }\n\n  /**\n   * Add a server to the pool. This function does not prevent you from adding a\n   * duplicate server entry.\n   *\n   * @param string $host  hostname or IP\n   * @param int    $port  port\n   */\n  public function addServer(string $host, int $port): void {\n    $this->servers_[] = tuple($host, $port);\n  }\n\n  /**\n   * Turns random endpoint selection on or off.\n   *\n   * @param bool $randomize\n   */\n  public function setRandomize(bool $randomize): void {\n    $this->randomize_ = $randomize;\n  }\n\n  /**\n   * Sets how many times to try to connect to an endpoint before giving up on\n   * it.\n   *\n   * @param int $numTries\n   */\n  public function setNumTries(int $numTries): void {\n    $this->numTries_ = $numTries;\n  }\n\n  /**\n   * Trys to open a connection and send the actual HTTP request to the first\n   * available server in the pool.\n   */\n  public function flush(): void {\n    if ($this->randomize_) {\n      shuffle($this->servers_);\n    }\n\n    foreach ($this->servers_ as $server) {\n      $this->host_ = $server[0];\n      $this->port_ = $server[1];\n\n      $j = $this->numTries_;\n      while ($j > 0) {\n        try {\n          parent::flush();\n          return;\n        } catch (TTransportException $e) {\n          if ($this->debug_) {\n            call_user_func($this->debugHandler_, $e->getMessage());\n          }\n          --$j;\n        }\n      }\n    }\n\n    $this->host_ = '';\n    $this->port_ = 0;\n    $error =\n      'THttpClientPool: Could not connect to any of the servers '.\n      'in the pool';\n    throw new TTransportException($error, TTransportException::NOT_OPEN);\n  }\n}\n", "num_lines": 138}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/**\n * A memory buffer is a tranpsort that simply reads from and writes to an\n * in-memory string buffer. Anytime you call write on it, the data is simply\n * placed into a buffer, and anytime you call read, data is read from that\n * buffer.\n *\n * @package thrift.transport\n */\nclass TMemoryBuffer extends TTransport implements IThriftBufferedTransport {\n\n  private string $buf_ = '';\n  private int $index_ = 0;\n  private ?int $length_ = null;\n\n  /**\n   * Constructor. Optionally pass an initial value\n   * for the buffer.\n   */\n  public function __construct(string $buf = '') {\n    $this->buf_ = (string) $buf;\n  }\n\n  public function isOpen(): bool {\n    return true;\n  }\n\n  public function open(): void {}\n\n  public function close(): void {}\n\n  private function length(): int {\n    if ($this->length_ === null) {\n      $this->length_ = strlen($this->buf_);\n    }\n    return $this->length_;\n  }\n\n  public function available(): int {\n    return $this->length() - $this->index_;\n  }\n\n  public function minBytesAvailable(): int {\n    return $this->available();\n  }\n\n  public function write(string $buf): void {\n    $this->buf_ .= $buf;\n    $this->length_ = null; // reset length\n  }\n\n  public function read(int $len): string {\n    $available = $this->available();\n    if ($available === 0) {\n      $buffer_dump = bin2hex($this->buf_);\n      throw new TTransportException(\n        'TMemoryBuffer: Could not read '.\n        $len.\n        ' bytes from buffer.'.\n        ' Original length is '.\n        $this->length().\n        ' Current index is '.\n        $this->index_.\n        ' Buffer content <start>'.\n        $buffer_dump.\n        '<end>',\n        TTransportException::UNKNOWN,\n      );\n    }\n\n    if ($available < $len) {\n      $len = $available;\n    }\n    $ret = $this->peek($len);\n    $this->index_ += $len;\n    return $ret;\n  }\n\n  public function peek(int $len, int $start = 0): string {\n    return\n      $len === 1\n        ? $this->buf_[$this->index_ + $start]\n        : substr($this->buf_, $this->index_ + $start, $len);\n  }\n\n  public function putBack(string $buf): void {\n    if ($this->available() === 0) {\n      $this->buf_ = $buf;\n    } else {\n      $remaining = (string) substr($this->buf_, $this->index_);\n      $this->buf_ = $buf.$remaining;\n    }\n    $this->length_ = null;\n    $this->index_ = 0;\n  }\n\n  public function getBuffer(): @string { // Task #5347782\n    if ($this->index_ === 0) {\n      return $this->buf_;\n    }\n    return substr($this->buf_, $this->index_);\n  }\n\n  public function resetBuffer(): void {\n    $this->buf_ = '';\n    $this->index_ = 0;\n    $this->length_ = null;\n  }\n}\n", "num_lines": 128}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/**\n * NonBlocking implementation of TSocket. Does internal\n * buffering on sends and recvs. An external socket\n * select loop can drive io. (See ClientSet.php).\n *\n * @package thrift.transport\n */\nclass TNonBlockingSocket extends TTransport implements IThriftRemoteConn {\n\n  /**\n   * Handle to PHP socket\n   *\n   * @var resource\n   */\n  private ?resource $handle_ = null;\n\n  /**\n   * Remote hostname\n   *\n   * @var string\n   */\n  protected string $host_ = 'localhost';\n\n  /**\n   * Remote port\n   *\n   * @var int\n   */\n  protected int $port_ = 9090;\n\n  protected bool $ipV6_ = false;\n\n  /**\n   * The write buffer.\n   *\n   *  @var string\n   */\n  protected string $wBuf_ = '';\n\n  /**\n   * The read buffer and pos.\n   *\n   *  @var string\n   *  @var int\n   */\n  protected string $rBuf_ = '';\n  protected int $rBufPos_ = 0;\n\n  /**\n   * Debug on?\n   *\n   * @var bool\n   */\n  protected bool $debug_ = false;\n\n  /**\n   * Debug handler\n   *\n   * @var mixed\n   */\n  protected (function(string): bool) $debugHandler_;\n\n  /**\n   * Socket recv buffer capacity.\n   * @var int or null.\n   */\n  private ?int $sockRecvCapacity_ = null;\n\n  /**\n   * Socket constructor\n   *\n   * @param string $host         Remote hostname\n   * @param int    $port         Remote port\n   * @param string $debugHandler Function to call for error logging\n   */\n\n  public function __construct(\n    string $host = 'localhost',\n    int $port = 9090,\n    ?(function(string): bool) $debugHandler = null,\n  ) {\n    $this->host_ = $host;\n    $this->port_ = $port;\n    $this->ipV6_ = strlen(@inet_pton($host)) == 16;\n\n    $this->debugHandler_ = $debugHandler ?: fun('error_log');\n  }\n\n  /**\n   * Get the host that this socket is connected to\n   *\n   * @return string host\n   */\n  public function getHost(): string {\n    return $this->host_;\n  }\n\n  /**\n   * Get the remote port that this socket is connected to\n   *\n   * @return int port\n   */\n  public function getPort(): int {\n    return $this->port_;\n  }\n\n  /**\n   * Get the socket for this connection. So we can select on it.\n   *\n   * @return socket resource\n   */\n  public function getSocket(): ?resource {\n    return $this->handle_;\n  }\n\n  /**\n   * Tests whether this is open\n   *\n   * @return bool true if the socket is open\n   */\n  public function isOpen(): bool {\n    return is_resource($this->handle_);\n  }\n\n  /**\n   * These methods are required for IThriftRemoteConn, but are not used\n   */\n  public function getRecvTimeout(): int {\n    return 0;\n  }\n\n  public function setRecvTimeout(int $timeout): void {\n    throw new TTransportException('setRecvTimeout is insupported');\n  }\n\n  public function isReadable(): bool {\n    return $this->isOpen();\n  }\n\n  public function isWritable(): bool {\n    return $this->isOpen();\n  }\n\n  /**\n   * Set debugging\n   *\n   * @param bool on/off\n   */\n  public function setDebug(bool $debug): void {\n    $this->debug_ = $debug;\n  }\n\n  /**\n   * Connects the socket.\n   */\n  public function open(): void {\n    if ($this->ipV6_) {\n      $handle = socket_create(AF_INET6, SOCK_STREAM, SOL_TCP);\n    } else {\n      $handle = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n    }\n\n    if ($handle === false) {\n      $error = 'TNonBlockingSocket: Could not create socket';\n      throw new TTransportException($error);\n    }\n\n    $this->handle_ = $handle;\n\n    if (!socket_set_nonblock($this->handle_)) {\n      $error = 'TNonBlockingSocket: Could not set nonblocking.';\n      throw new TTransportException($error);\n    }\n\n    $res = @socket_connect(\n      $this->handle_,\n      $this->host_,\n      $this->port_,\n    );\n\n    if (!$res) {\n      $errno = socket_last_error($this->handle_);\n      $errstr = socket_strerror($errno);\n      $error =\n        'TNonBlockingSocket: socket_connect error ('.\n        (string) $errstr.'['.(string) $errno.'])';\n      if ($errno != 115) {\n        if ($this->debug_) {\n          call_user_func($this->debugHandler_, $error);\n        }\n      }\n      throw new TTransportException($error);\n    }\n\n    $wBuf_ = '';\n    $rBuf_ = '';\n    $rBufPos_ = 0;\n\n    $this->sockRecvCapacity_ =\n      socket_get_option($this->handle_, SOL_SOCKET, SO_RCVBUF);\n    if ($this->sockRecvCapacity_ == false) {\n      $this->sockRecvCapacity_ = null;\n    }\n  }\n\n  /**\n   * Closes the socket.\n   */\n  public function close(): void {\n    if ($this->handle_ !== null) {\n      @socket_close($this->handle_);\n    }\n    $this->handle_ = null;\n  }\n\n  /**\n   * Do a nonblocking read. If all of $len is not there, throw an exception.\n   * Save unread data to the recv buffer so subsequent reads can retrieve it.\n   *\n   * @param int $len How many bytes\n   * @return string Binary data\n   */\n  public function readAll(int $len): string {\n    // We may already have data for this read in the buffer\n    $ret = (string) substr($this->rBuf_, $this->rBufPos_);\n    // set the buffer to all but this read\n    $this->rBuf_ = (string) substr($this->rBuf_, 0, $this->rBufPos_);\n\n    if ($len <= strlen($ret)) {\n      $this->rBuf_ .= $ret;\n      $this->rBufPos_ += $len;\n\n      return substr($ret, 0, $len);\n    }\n\n    // we already have this much for this read\n    $len -= strlen($ret);\n\n    while (true) {\n      $buf = $this->read($len);\n\n      if ($buf === '') {\n        // Put back what we may have already read for this read.\n        // Don't advance pos\n        $this->rBuf_ .= $ret;\n\n        throw new TTransportException(\n          'TNonBlockingSocket: readAll could not'.\n          ' read '.\n          $len.\n          ' bytes from '.\n          $this->host_.\n          ':'.\n          $this->port_,\n        );\n      } else if (($sz = strlen($buf)) < $len) {\n        $ret .= $buf;\n        $len -= $sz;\n      } else {\n        $ret .= $buf;\n        $this->rBuf_ .= $ret;\n        $this->rBufPos_ += strlen($ret); // advance pos to next read\n\n        return $ret;\n      }\n    }\n\n    throw new TTransportException(\n      \"TNonBlockingSocket: You shouldn't be here\",\n    );\n  }\n\n  /**\n   * Occasionally we will restart several readAlls due to a failure,\n   * EAGAIN for instance, and we want to read all data we already buffered.\n   * In this case call resetBufferPos. This occurs for example when a gen\n   * client does several recevies, and fails on one other than the first.\n   * It then retries all of them\n   */\n  public function resetBufferPos(): void {\n    $this->rBufPos_ = 0;\n  }\n\n  /*\n   * Clear the buffer and reset it\n   */\n  public function clearBuf(): void {\n    $this->rBuf_ = '';\n    $this->rBufPos_ = 0;\n  }\n\n  /**\n   * Read from the socket\n   *\n   * @param int $len How many bytes\n   * @return string Binary data\n   */\n  public function read(int $len): string {\n    if ($this->sockRecvCapacity_ !== null) {\n      $len = min($len, $this->sockRecvCapacity_);\n    }\n\n    $data = @socket_read($this->handle_, $len);\n\n    if ($data === false || $data === '') {\n      $errno = socket_last_error($this->handle_);\n      $errstr = socket_strerror($errno);\n      $error =\n        \"read: no data to be read \".\n        $this->host_.\n        ':'.\n        $this->port_.\n        ' ('.\n        (string) $errstr.' ['.(string) $errno.'])';\n      if ($this->debug_) {\n        call_user_func($this->debugHandler_, $error);\n      }\n\n      return '';\n    }\n\n    return $data;\n  }\n\n  /**\n   * Do a buffered write. Use doWrite to notify when the socket can be written.\n   *\n   * @param string $buf The data to write\n   */\n  public function write(string $buf): void {\n    $this->wBuf_ .= $buf;\n  }\n\n  public function doWrite(): void {\n    $got = @socket_write($this->handle_, $this->wBuf_);\n\n    if ($got === 0 || $got === false) {\n      // Could not write\n      $errno = socket_last_error($this->handle_);\n      $errstr = socket_strerror($errno);\n      $error =\n        'doWrite: write failed ('.\n        (string) $errno.\n        '): '.\n        (string) $errstr.' '.$this->host_.':'.$this->port_;\n      throw new TTransportException($error);\n    }\n\n    $this->wBuf_ = substr($this->wBuf_, $got);\n  }\n\n  /**\n   * Do we have buffered data to send?\n   *\n   * @return bool\n   */\n  public function haveData(): bool {\n    return strlen($this->wBuf_) > 0;\n  }\n\n  /**\n   * No flush implemented.\n   * Generated code will flush on send, we'd like to send as data becomes\n   * available without blocking.\n   */\n  public function flush(): void {}\n}\n", "num_lines": 387}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/**\n * Wrapper class over TNonBlockingSocket that suppresses\n * the exception \"operation in progress 115\" when the open()\n * is called. This is helpful for classes that don't\n * handle properly this event. Ie. TFramedTransport.\n */\nclass TNonBlockingSocketNoThrow extends TNonBlockingSocket {\n  public function open(): void {\n    try {\n      parent::open();\n    } catch (Exception $e) {\n      $op_in_progress =\n        (strpos($e->getMessage(), \"socket_connect error\") !== false) &&\n        (strpos($e->getMessage(), \"[115]\") !== false);\n      if (!$op_in_progress) {\n        throw $e;\n      }\n    }\n  }\n}\n", "num_lines": 40}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/**\n * Transport that only accepts writes and ignores them.\n * This is useful for measuring the serialized size of structures.\n *\n * @package thrift.transport\n */\nclass TNullTransport extends TTransport {\n\n  public function isOpen(): bool {\n    return true;\n  }\n\n  public function open(): void {}\n\n  public function close(): void {}\n\n  public function read(int $len): string {\n    throw new TTransportException(\"Can't read from TNullTransport.\");\n  }\n\n  public function write(string $buf): void {}\n\n}\n", "num_lines": 43}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/**\n * Php stream transport. Reads to and writes from the php standard streams\n * php://input and php://output\n *\n * @package thrift.transport\n */\nclass TPhpStream extends TTransport {\n\n  const int MODE_R = 1;\n  const int MODE_W = 2;\n\n  private ?resource $inStream_ = null;\n\n  private ?resource $outStream_ = null;\n\n  private bool $read_ = false;\n\n  private bool $write_ = false;\n\n  /**\n   * Specifies the maximum number of bytes to read\n   * at once from internal stream.\n   */\n  private ?int $maxReadChunkSize_ = null;\n\n  public function __construct(int $mode) {\n    $this->read_ = (bool) ($mode & self::MODE_R);\n    $this->write_ = (bool) ($mode & self::MODE_W);\n  }\n\n  /**\n   * Sets the internal max read chunk size.\n   * null for no limit (default).\n   */\n  public function setMaxReadChunkSize(int $maxReadChunkSize): void {\n    $this->maxReadChunkSize_ = $maxReadChunkSize;\n  }\n\n  public function open(): void {\n    if ($this->read_) {\n      $this->inStream_ = @fopen(self::inStreamName(), 'r');\n      if (!is_resource($this->inStream_)) {\n        throw new TException('TPhpStream: Could not open php://input');\n      }\n    }\n    if ($this->write_) {\n      $this->outStream_ = @fopen('php://output', 'w');\n      if (!is_resource($this->outStream_)) {\n        throw new TException('TPhpStream: Could not open php://output');\n      }\n    }\n  }\n\n  public function close(): void {\n    if ($this->read_) {\n      @fclose($this->inStream_);\n      $this->inStream_ = null;\n    }\n    if ($this->write_) {\n      @fclose($this->outStream_);\n      $this->outStream_ = null;\n    }\n  }\n\n  public function isOpen(): bool {\n    return\n      (!$this->read_ || is_resource($this->inStream_)) &&\n      (!$this->write_ || is_resource($this->outStream_));\n  }\n\n  public function read(int $len): string {\n    if ($this->maxReadChunkSize_ !== null) {\n      $len = min($len, $this->maxReadChunkSize_);\n    }\n\n    $data = @fread($this->inStream_, $len);\n\n    if ($data === false || $data === '') {\n      throw new TException('TPhpStream: Could not read '.$len.' bytes');\n    }\n    return $data;\n  }\n\n  public function write(string $buf): void {\n    while (strlen($buf) > 0) {\n      $got = @fwrite($this->outStream_, $buf);\n\n      if ($got === 0 || $got === false) {\n        throw new TException(\n          'TPhpStream: Could not write '.(string) strlen($buf).' bytes',\n        );\n      }\n      $buf = substr($buf, $got);\n    }\n  }\n\n  public function flush(): void {\n    @fflush($this->outStream_);\n  }\n\n  private static function inStreamName(): string {\n    if (php_sapi_name() == 'cli') {\n      return 'php://stdin';\n    }\n    return 'php://input';\n  }\n}\n", "num_lines": 127}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/**\n * Server socket class\n */\nclass TServerSocket {\n  protected ?string $host;\n  protected int $port;\n  protected ?resource $handle;\n\n  private int $send_buffer_size;\n  private int $recv_buffer_size;\n  public function __construct(\n    int $port,\n    int $send_buffer_size = 512,\n    int $recv_buffer_size = 512,\n  ) {\n    $this->host = null;\n    $this->port = $port;\n    $this->handle = null;\n    $this->send_buffer_size = $send_buffer_size;\n    $this->recv_buffer_size = $recv_buffer_size;\n  }\n\n  public function listen(): void {\n    foreach (varray['[::]', '0.0.0.0'] as $addr) {\n      $errno = 0;\n      $errstr = '';\n      $this->handle = PHP\\stream_socket_server(\n        'tcp://'.$addr.':'.$this->port,\n        &$errno,\n        &$errstr,\n        STREAM_SERVER_BIND | STREAM_SERVER_LISTEN,\n      );\n\n      if ($this->handle !== false) {\n        if ($this->port === 0) {\n          $address = Str\\split(\n            PHP\\stream_socket_get_name($this->handle, false),\n            ':',\n          );\n          $this->port = PHP\\intval($address[PHP\\count($address) - 1]);\n        }\n        break;\n      }\n    }\n  }\n\n  public function accept(int $timeout = -1): ?TBufferedTransport {\n    if ($timeout !== 0) {\n      $client = PHP\\stream_socket_accept(\n        nullthrows($this->handle),\n        (float)$timeout,\n      );\n    } else {\n      $client = @PHP\\stream_socket_accept(\n        nullthrows($this->handle),\n        (float)$timeout,\n      );\n    }\n\n    if (!$client) {\n      return null;\n    }\n\n    $socket = new TSocket();\n    $socket->setHandle($client);\n\n    // We need to create a buffered transport because TSocket's isReadable\n    // is not reliable in PHP (hphp is fine) and buffered transport is more\n    // efficient (60% faster in my tests)\n    $transport = new TBufferedTransport(\n      $socket,\n      $this->send_buffer_size,\n      $this->recv_buffer_size,\n    );\n\n    return $transport;\n  }\n\n  public function close(): void {\n    /* HH_FIXME[4016] Exposed by banning unset and isset in partial mode */\n    if (isset($this->handle)) {\n      PHP\\fclose($this->handle);\n      $this->handle = null;\n    }\n  }\n\n  public function port(): int {\n    return $this->port;\n  }\n}\n", "num_lines": 110}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/**\n * Sockets implementation of the TTransport interface.\n *\n * @package thrift.transport\n */\nclass TSocket extends TTransport\n  implements TTransportStatus, InstrumentedTTransport, IThriftRemoteConn {\n\n  use InstrumentedTTransportTrait;\n\n  /**\n   * Handle to PHP socket\n   *\n   * @var resource\n   */\n  private ?resource $handle_ = null;\n\n  /**\n   * Remote hostname\n   *\n   * @var string\n   */\n  protected string $host_ = 'localhost';\n\n  /**\n   * Remote port\n   *\n   * @var int\n   */\n  protected int $port_ = 9090;\n\n  /**\n   * Local port\n   *\n   * @var int\n   */\n  protected int $lport_ = 0;\n\n  /**\n   * Send timeout in milliseconds\n   *\n   * @var int\n   */\n  private int $sendTimeout_ = 100;\n\n  /**\n   * Recv timeout in milliseconds\n   *\n   * @var int\n   */\n  private int $recvTimeout_ = 750;\n\n  /**\n   * Is send timeout set?\n   *\n   * @var bool\n   */\n  private bool $sendTimeoutSet_ = false;\n\n  /**\n   * Persistent socket or plain?\n   *\n   * @var bool\n   */\n  private bool $persist_ = false;\n\n  /**\n   * When the current read is started\n   *\n   * @var int, null means no read is started\n   */\n  private ?int $readAttemptStart_ = null;\n\n  /**\n   * When the current write is started\n   *\n   * @var int, null means no write is started\n   */\n  private ?int $writeAttemptStart_ = null;\n\n  /**\n   * Debugging on?\n   *\n   * @var bool\n   */\n  protected bool $debug_ = false;\n\n  /**\n   * Debug handler\n   *\n   * @var mixed\n   */\n  protected (function(string): bool) $debugHandler_;\n\n  /**\n   * error string (in case of open failure)\n   *\n   * @var string or null\n   */\n  protected ?string $errstr_ = null;\n\n  /**\n   * error number (in case of open failure)\n   *\n   * @var int or null\n   */\n  protected ?int $errno_ = null;\n\n  /**\n   * Specifies the maximum number of bytes to read\n   * at once from internal stream.\n   */\n  protected ?int $maxReadChunkSize_ = null;\n\n  /**\n   * Socket constructor\n   *\n   * @param string $host         Remote hostname\n   * @param int    $port         Remote port\n   * @param bool   $persist      Whether to use a persistent socket\n   * @param string $debugHandler Function to call for error logging\n   */\n  public function __construct(\n    string $host = 'localhost',\n    int $port = 9090,\n    bool $persist = false,\n    ?(function(string): bool) $debugHandler = null,\n  ) {\n      $this->host_ = $host;\n    $this->port_ = $port;\n    $this->persist_ = $persist;\n    $this->debugHandler_ = $debugHandler ?: fun('error_log');\n  }\n\n  /**\n   * Sets the internal max read chunk size.\n   * null for no limit (default).\n   */\n  public function setMaxReadChunkSize(int $maxReadChunkSize): void {\n    $this->maxReadChunkSize_ = $maxReadChunkSize;\n  }\n\n  /**\n   * Sets the socket handle\n   * @param resource $handle\n   * @return $this\n   */\n  public function setHandle(resource $handle): this {\n    $this->handle_ = $handle;\n    return $this;\n  }\n\n  /**\n   * Gets the meta_data for the current handle\n   */\n  public function getMetaData(): array<string, mixed> {\n    return stream_get_meta_data($this->handle_);\n  }\n\n  /**\n   * Gets the send timeout.\n   *\n   * @return int timeout\n   */\n  public function getSendTimeout(): int {\n    return $this->sendTimeout_;\n  }\n\n  /**\n   * Sets the send timeout.\n   *\n   * @param int $timeout  Timeout in milliseconds.\n   */\n  public function setSendTimeout(int $timeout): void {\n    $this->sendTimeout_ = $timeout;\n  }\n\n  /**\n   * Gets the receive timeout.\n   *\n   * @return int timeout\n   */\n  public function getRecvTimeout(): int {\n    return $this->recvTimeout_;\n  }\n\n  /**\n   * Sets the receive timeout.\n   *\n   * @param int $timeout  Timeout in milliseconds.\n   */\n  public function setRecvTimeout(int $timeout): void {\n    $this->recvTimeout_ = $timeout;\n  }\n\n  /**\n   * Sets debugging output on or off\n   *\n   * @param bool $debug\n   */\n  public function setDebug(bool $debug): void {\n    $this->debug_ = $debug;\n  }\n\n  /**\n   * Get the host that this socket is connected to\n   *\n   * @return string host\n   */\n  public function getHost(): string {\n    return $this->host_;\n  }\n\n  /**\n   * Get the remote port that this socket is connected to\n   *\n   * @return int port\n   */\n  public function getPort(): int {\n    return $this->port_;\n  }\n\n  /**\n   * Get the error string in case of open failure\n   *\n   * @return errstr_ or null\n   */\n  public function getErrStr(): ?string {\n    return $this->errstr_;\n  }\n\n  /**\n   * Get the error number in case of open failure\n   *\n   * @return errno_ or null\n   */\n  public function getErrNo(): ?int {\n    return $this->errno_;\n  }\n\n  /**\n   * Tests whether this is open\n   *\n   * @return bool true if the socket is open\n   */\n  public function isOpen(): bool {\n    return is_resource($this->handle_);\n  }\n\n  /**\n   * Connects the socket.\n   */\n  public function open(): void {\n    if ($this->isOpen()) {\n      throw new TTransportException(\n        'TSocket: socket already connected',\n        TTransportException::ALREADY_OPEN,\n      );\n    }\n\n    if ($this->host_ === null) {\n      throw new TTransportException(\n        'TSocket: cannot open null host',\n        TTransportException::NOT_OPEN,\n      );\n    }\n\n    if ($this->port_ <= 0) {\n      throw new TTransportException(\n        'TSocket: cannot open without port',\n        TTransportException::NOT_OPEN,\n      );\n    }\n\n    $handle = null;\n    if ($this->persist_) {\n      $handle = @pfsockopen(\n        $this->host_,\n        $this->port_,\n        $this->errno_,\n        $this->errstr_,\n        $this->sendTimeout_ / 1000.0,\n      );\n    } else {\n      $handle = @fsockopen(\n        $this->host_,\n        $this->port_,\n        $this->errno_,\n        $this->errstr_,\n        $this->sendTimeout_ / 1000.0,\n      );\n    }\n\n    // Connect failed?\n    if (!$handle) {\n      $error =\n        'TSocket: could not connect to '.$this->host_.':'.$this->port_;\n      $error .= ' ('.$this->errstr_.' ['.$this->errno_.'])';\n      if ($this->debug_) {\n        call_user_func($this->debugHandler_, $error);\n      }\n      throw new TTransportException(\n        $error,\n        TTransportException::COULD_NOT_CONNECT,\n      );\n    }\n\n    $this->handle_ = $handle;\n\n    $sock_name = stream_socket_get_name($this->handle_, false);\n    // IPv6 is returned [2401:db00:20:702c:face:0:7:0]:port\n    // or when stream_socket_get_name is buggy it is\n    // 2401:db00:20:702c:face:0:7:0:port\n    $this->lport_ = end(explode(\":\", $sock_name));\n\n    stream_set_timeout($this->handle_, 0, $this->sendTimeout_ * 1000);\n    $this->sendTimeoutSet_ = true;\n  }\n\n  /**\n   * Closes the socket.\n   */\n  public function close(): void {\n    if (!$this->persist_) {\n      @fclose($this->handle_);\n      $this->handle_ = null;\n    }\n  }\n\n  /**\n   *  Test to see if the socket is ready for reading. This method returns\n   *  immediately. If calling this method in a loop one should sleep or do\n   *  other work else CPU cycles will be wasted.\n   *\n   *  @return bool  True if a non-blocking read of at least one character can\n   *                be preformed on the socket.\n   */\n  public function isReadable(): bool {\n    return $this->isSocketActionable($this->handle_, $check_read = true);\n  }\n\n  /**\n   *  Test to see if the socket is ready for writing. This method returns\n   *  immediately. If calling this method in a loop one should sleep or do\n   *  other work else CPU cycles will be wasted.\n   *\n   *  @return bool True if a non-blocking write can be preformed on the socket.\n   */\n  public function isWritable(): bool {\n    $writable =\n      $this->isSocketActionable($this->handle_, $check_read = false);\n    if (!$writable && $this->sendTimeout_ > 0) {\n      if ($this->writeAttemptStart_ === null) {\n        $this->writeAttemptStart_ = microtime(true);\n      }\n      if (microtime(true) -\n          (int) $this->writeAttemptStart_ > ($this->sendTimeout_ / 1000.0)) {\n        throw new TTransportException(\n          'TSocket: socket not writable after '.$this->sendTimeout_.'ms',\n          TTransportException::TIMED_OUT,\n        );\n      }\n    }\n    return $writable;\n  }\n\n  private function isSocketActionable(\n    ?resource $socket,\n    bool $check_read,\n  ): bool {\n    // the socket is technically actionable, although any read or write will\n    // fail since close() was already called.\n    if ($socket === null) {\n      return true;\n    }\n\n    $read = $write = array();\n    if ($check_read) {\n      $read = array($socket);\n    } else {\n      $write = array($socket);\n    }\n\n    $excpt = array();\n    $ret = stream_select($read, $write, $excpt, 0, 0);\n    if ($ret === false) {\n      $error = 'TSocket: stream_select failed on socket.';\n      if ($this->debug_) {\n        call_user_func($this->debugHandler_, $error);\n      }\n      throw new TTransportException($error);\n    }\n\n    return $ret !== 0;\n  }\n\n  /**\n   * Reads maximum min($len, $maxReadChunkSize_) bytes\n   * from the stream.\n   */\n  private function readChunk(int $len): ?string {\n    if ($this->maxReadChunkSize_ !== null) {\n      $len = min($len, $this->maxReadChunkSize_);\n    }\n\n    $res = @fread($this->handle_, $len);\n    $size = strlen($res);\n\n    $this->onRead($size);\n    return $res;\n  }\n\n  /**\n   * Uses stream get contents to do the reading\n   *\n   * @param int $len How many bytes\n   * @return string Binary data\n   */\n  public function readAll(int $len): string {\n    if ($this->sendTimeoutSet_) {\n      $sec = 0;\n      if ($this->recvTimeout_ > 1000) {\n        $msec = $this->recvTimeout_ % 1000;\n        $sec = ($this->recvTimeout_ - $msec) / 1000;\n      } else {\n        $msec = $this->recvTimeout_;\n      }\n      stream_set_timeout($this->handle_, $sec, $msec * 1000);\n      $this->sendTimeoutSet_ = false;\n    }\n    // This call does not obey stream_set_timeout values!\n    // $buf = @stream_get_contents($this->handle_, $len);\n    $pre = '';\n    while (true) {\n      $t_start = microtime(true);\n      $buf = $this->readChunk($len);\n      $t_stop = microtime(true);\n      if ($buf === null || $buf === '') {\n        $read_err_detail = sprintf(\n          '%d bytes from %s:%d to localhost:%d. Spent %2.2f ms.',\n          $len,\n          $this->host_,\n          $this->port_,\n          $this->lport_,\n          ($t_stop - $t_start) * 1000,\n        );\n        $md = stream_get_meta_data($this->handle_);\n        if ($md['timed_out']) {\n          throw new TTransportException(\n            'TSocket: timeout while reading '.$read_err_detail,\n            TTransportException::TIMED_OUT,\n          );\n        } else {\n          $md_str = str_replace(\"\\n\", \" \", print_r($md, true));\n          throw new TTransportException(\n            'TSocket: could not read '.$read_err_detail,\n            TTransportException::COULD_NOT_READ,\n          );\n        }\n      } else if (($sz = strlen($buf)) < $len) {\n        $md = stream_get_meta_data($this->handle_);\n        if ($md['timed_out']) {\n          $read_err_detail = sprintf(\n            '%d bytes from %s:%d to localhost:%d. Spent %2.2f ms.',\n            $len,\n            $this->host_,\n            $this->port_,\n            $this->lport_,\n            ($t_stop - $t_start) * 1000,\n          );\n          throw new TTransportException(\n            'TSocket: timeout while reading '.$read_err_detail,\n            TTransportException::TIMED_OUT,\n          );\n        } else {\n          $pre .= $buf;\n          $len -= $sz;\n        }\n      } else {\n        $this->readAttemptStart_ = null;\n        $res = $pre.$buf;\n        $this->onRead(strlen($res));\n        return $res;\n      }\n    }\n\n    throw new TTransportException(\"TSocket: You shouldn't be here\");\n  }\n\n  /**\n   * Read from the socket\n   *\n   * @param int $len How many bytes\n   * @return string Binary data\n   */\n  public function read(int $len): string {\n    if ($this->sendTimeoutSet_) {\n      stream_set_timeout($this->handle_, 0, $this->recvTimeout_ * 1000);\n      $this->sendTimeoutSet_ = false;\n    }\n    $t_start = microtime(true);\n    $data = $this->readChunk($len);\n    $t_stop = microtime(true);\n    if ($data === null || $data === '') {\n      $read_err_detail = sprintf(\n        '%d bytes from %s:%d to localhost:%d. Spent %2.2f ms.',\n        $len,\n        $this->host_,\n        $this->port_,\n        $this->lport_,\n        ($t_stop - $t_start) * 1000,\n      );\n      $md = stream_get_meta_data($this->handle_);\n      if ($md['timed_out']) {\n        throw new TTransportException(\n          'TSocket: timeout while reading '.$read_err_detail,\n          TTransportException::TIMED_OUT,\n        );\n      } else {\n        $md_str = str_replace(\"\\n\", \" \", print_r($md, true));\n        throw new TTransportException(\n          'TSocket: could not read '.$read_err_detail,\n          TTransportException::COULD_NOT_READ,\n        );\n      }\n    } else {\n      $this->readAttemptStart_ = null;\n    }\n\n    $this->onRead(strlen($data));\n    return $data;\n  }\n\n  /**\n   * Perform a nonblocking read.\n   * @param int $len Number of bytes to read\n   * @return string Binary data or '' is no data is read\n   */\n  public function nonBlockingRead(int $len): string {\n    $md = stream_get_meta_data($this->handle_);\n    $is_blocking = $md['blocked'];\n\n    // If the stream is currently blocking, we will set to nonblocking\n    // first\n    if ($is_blocking && !stream_set_blocking($this->handle_, 0)) {\n      throw new TTransportException(\n        'TSocket: '.'cannot set stream to non-blocking',\n      );\n    }\n\n    $data = $this->readChunk($len);\n\n    if ($data === null) {\n      throw new TTransportException('TSocket: failed in non-blocking read');\n    }\n\n    // Switch back to blocking mode is necessary\n    if ($is_blocking && !stream_set_blocking($this->handle_, 1)) {\n      throw new TTransportException(\n        'TSocket: '.'cannot swtich stream back to blocking',\n      );\n    }\n    $this->onRead(strlen($data));\n    return $data;\n  }\n\n  /**\n   * Write to the socket.\n   *\n   * @param string $buf The data to write\n   */\n  public function write(string $buf): void {\n    if ($this->handle_ === null) {\n      throw new TException('TSocket: handle_ is null');\n    }\n\n    $this->onWrite(strlen($buf));\n\n    if (!$this->sendTimeoutSet_) {\n      stream_set_timeout($this->handle_, 0, $this->sendTimeout_ * 1000);\n      $this->sendTimeoutSet_ = true;\n    }\n\n    while (strlen($buf) > 0) {\n      $buflen = strlen($buf);\n      $t_start = microtime(true);\n      $got = @fwrite($this->handle_, $buf);\n      $write_time = microtime(true) - $t_start;\n\n      if ($got === 0 || !is_int($got)) {\n        $read_err_detail = sprintf(\n          '%d bytes from %s:%d to localhost:%d. Spent %2.2f ms.',\n          $buflen,\n          $this->host_,\n          $this->port_,\n          $this->lport_,\n          $write_time * 1000,\n        );\n        $md = stream_get_meta_data($this->handle_);\n        if ($md['timed_out']) {\n          throw new TTransportException(\n            'TSocket: timeout while writing '.$read_err_detail,\n            TTransportException::TIMED_OUT,\n          );\n        } else {\n          $md_str = str_replace(\"\\n\", \" \", print_r($md, true));\n          throw new TTransportException(\n            'TSocket: could not write '.$read_err_detail,\n            TTransportException::COULD_NOT_WRITE,\n          );\n        }\n      }\n      $buf = substr($buf, $got);\n    }\n\n    $this->writeAttemptStart_ = null;\n  }\n\n  /**\n   * Flush output to the socket.\n   */\n  public function flush(): void {\n    $ret = fflush($this->handle_);\n\n    if ($ret === false) {\n      throw new TTransportException(\n        'TSocket: could not flush '.$this->host_.':'.$this->port_,\n      );\n    }\n  }\n}\n", "num_lines": 651}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/** Inherits from Socket */\n\n/**\n * Sockets implementation of the TTransport interface that allows connection\n * to a pool of servers.\n *\n * @package thrift.transport\n */\nclass TSocketPool extends TSocket {\n\n  /**\n   * Custom caching functions for environments without AP\n   */\n  private ?(function(string): mixed) $fakeAPCFetch_ = null;\n  private ?(function(string, mixed, int): bool) $fakeAPCStore_ = null;\n  private ?(function(string): void) $apcLogger_ = null;\n\n  /**\n   * Remote servers. List of host:port pairs.\n   */\n  private array<(string, int)> $servers_ = array();\n\n  /**\n   * How many times to retry each host in connect\n   *\n   * @var int\n   */\n  private int $numRetries_ = 1;\n\n  /**\n   * Retry interval in seconds, how long to not try a host if it has been\n   * marked as down.\n   *\n   * @var int\n   */\n  private int $retryInterval_ = 60;\n\n  /**\n   * Max consecutive failures before marking a host down.\n   *\n   * @var int\n   */\n  private int $maxConsecutiveFailures_ = 1;\n\n  /**\n   * Try hosts in order? or Randomized?\n   *\n   * @var bool\n   */\n  private bool $randomize_ = true;\n\n  /**\n   * Always try last host, even if marked down?\n   *\n   * @var bool\n   */\n  private bool $alwaysTryLast_ = true;\n\n  /**\n   * Always retry the host without wait if there was a transient\n   * connection failure (such as Resource temporarily unavailable).\n   * If this is set, the wait_and_retry mechanism will ignore the\n   * value in $retryInterval_ for transient failures.\n   *\n   * @var bool\n   */\n  private bool $alwaysRetryForTransientFailure_ = false;\n\n  const int ERROR_RESOURCE_TEMPORARILY_UNAVAILABLE = 11;\n\n  /**\n   * Socket pool constructor\n   *\n   * @param array  $hosts        List of remote hostnames\n   * @param mixed  $ports        Array of remote ports, or a single common port\n   * @param bool   $persist      Whether to use a persistent socket\n   * @param mixed  $debugHandler Function for error logging\n   */\n  public function __construct(\n    KeyedContainer<int, string> $hosts = array('localhost'),\n    KeyedContainer<int, int> $ports = array(9090),\n    bool $persist = false,\n    ?(function(string): bool) $debugHandler = null,\n  ) {\n    parent::__construct('', 0, $persist, $debugHandler);\n\n    foreach ($hosts as $key => $host) {\n      $this->servers_[] = tuple((string) $host, (int) $ports[$key]);\n    }\n  }\n\n  /**\n   * Add a server to the pool\n   *\n   * This function does not prevent you from adding a duplicate server entry.\n   *\n   * @param string $host hostname or IP\n   * @param int $port port\n   */\n  public function addServer(string $host, int $port): void {\n    $this->servers_[] = tuple($host, $port);\n  }\n\n  /**\n   * Sets how many time to keep retrying a host in the connect function.\n   *\n   * @param int $numRetries\n   */\n  public function setNumRetries(int $numRetries): void {\n    $this->numRetries_ = $numRetries;\n  }\n\n  /**\n   * Sets how long to wait until retrying a host if it was marked down\n   *\n   * @param int $numRetries\n   */\n  public function setRetryInterval(int $retryInterval): void {\n    $this->retryInterval_ = $retryInterval;\n  }\n\n  /**\n   * Sets how many time to keep retrying a host before marking it as down.\n   *\n   * @param int $numRetries\n   */\n  public function setMaxConsecutiveFailures(\n    int $maxConsecutiveFailures,\n  ): void {\n    $this->maxConsecutiveFailures_ = $maxConsecutiveFailures;\n  }\n\n  /**\n   * Turns randomization in connect order on or off.\n   *\n   * @param bool $randomize\n   */\n  public function setRandomize(bool $randomize): void {\n    $this->randomize_ = $randomize;\n  }\n\n  /**\n   * Whether to always try the last server.\n   *\n   * @param bool $alwaysTryLast\n   */\n  public function setAlwaysTryLast(bool $alwaysTryLast): void {\n    $this->alwaysTryLast_ = $alwaysTryLast;\n  }\n\n  /**\n   * Whether to always retry the host without wait for\n   * transient connection failures\n   *\n   * @param bool $alwaysRetry\n   */\n  public function setAlwaysRetryForTransientFailure(bool $alwaysRetry): void {\n    $this->alwaysRetryForTransientFailure_ = $alwaysRetry;\n  }\n\n  /**\n   * Connects the socket by iterating through all the servers in the pool\n   * and trying to find one that:\n   * 1. is not marked down after consecutive failures\n   * 2. can really be connected to\n   *\n   * @return bool  false: any IP in the pool failed to connect before returning\n   *               true: no failures\n   */\n  public function open(): void {\n    // Check if we want order randomization\n    if ($this->randomize_) {\n      // warning: don't use shuffle here because it leads to uneven\n      // load distribution\n      $n = count($this->servers_);\n      $s = $this->servers_;\n      for ($i = 1; $i < $n; $i++) {\n        $j = mt_rand(0, $i);\n        $tmp = $s[$i];\n        $s[$i] = $s[$j];\n        $s[$j] = $tmp;\n      }\n      $this->servers_ = $s;\n    }\n\n    // Count servers to identify the \"last\" one\n    $numServers = count($this->servers_);\n    $has_conn_errors = false;\n\n    $fail_reason = array(); // reasons of conn failures\n    for ($i = 0; $i < $numServers; ++$i) {\n\n      // host port is stored as an array\n      list($host, $port) = $this->servers_[$i];\n\n      $failtimeKey = TSocketPool::getAPCFailtimeKey($host, $port);\n      // Cache miss? Assume it's OK\n      $lastFailtime = (int) $this->apcFetch($failtimeKey);\n      $this->apcLog(\n        \"TSocketPool: host $host:$port last fail time: \".$lastFailtime,\n      );\n\n      $retryIntervalPassed = false;\n\n      // Cache hit...make sure enough the retry interval has elapsed\n      if ($lastFailtime > 0) {\n        $elapsed = time() - $lastFailtime;\n        if ($elapsed > $this->retryInterval_) {\n          $retryIntervalPassed = true;\n          if ($this->debug_ && $this->debugHandler_ !== null) {\n            $dh = $this->debugHandler_;\n            $dh(\n              'TSocketPool: retryInterval '.\n              '('.\n              $this->retryInterval_.\n              ') '.\n              'has passed for host '.\n              $host.\n              ':'.\n              $port,\n            );\n          }\n        }\n      }\n\n      // Only connect if not in the middle of a fail interval, OR if this\n      // is the LAST server we are trying, just hammer away on it\n      $isLastServer = false;\n      if ($this->alwaysTryLast_) {\n        $isLastServer = ($i == ($numServers - 1));\n      }\n\n      if (($lastFailtime === 0) ||\n          ($isLastServer) ||\n          ($lastFailtime > 0 && $retryIntervalPassed)) {\n\n        // Set underlying TSocket params to this one\n          $this->host_ = $host;\n        $this->port_ = $port;\n\n        // Try up to numRetries_ connections per server\n        for ($attempt = 0; $attempt < $this->numRetries_; $attempt++) {\n          try {\n            // Use the underlying TSocket open function\n            parent::open();\n\n            // Only clear the failure counts if required to do so\n            if ($lastFailtime > 0) {\n              $this->apcStore($failtimeKey, 0);\n            }\n\n            // Successful connection, return now\n            return;\n\n          } catch (TException $tx) {\n            // Connection failed\n            // keep the reason for the last try\n            $errstr = $this->getErrStr();\n            $errno = $this->getErrNo();\n            if ($errstr !== null || $errno !== null) {\n              $fail_reason[$i] = '('.$errstr.'['.$errno.'])';\n            } else {\n              $fail_reason[$i] = '(?)';\n            }\n          }\n        }\n\n        // For transient errors (like Resource temporarily unavailable),\n        // we might want not to cache the failure.\n        if ($this->alwaysRetryForTransientFailure_ &&\n            $this->isTransientConnectFailure($this->getErrNo())) {\n          continue;\n        }\n\n        $dh = ($this->debug_ ? $this->debugHandler_ : null);\n\n        $has_conn_errors = $this->recordFailure(\n          $host,\n          $port,\n          $this->maxConsecutiveFailures_,\n          $this->retryInterval_,\n          $dh,\n        );\n      } else {\n        $fail_reason[$i] = '(cached-down)';\n      }\n    }\n\n    // Holy shit we failed them all. The system is totally ill!\n    $error = 'TSocketPool: All hosts in pool are down. ';\n    $hosts = array();\n    foreach ($this->servers_ as $i => $server) {\n      // array(host, port) (reasons, if exist)\n      list($host, $port) = $server;\n      $h = $host.':'.$port;\n      if (array_key_exists($i, $fail_reason)) {\n        $h .= (string) $fail_reason[$i];\n      }\n      $hosts[] = $h;\n    }\n    $hostlist = implode(',', $hosts);\n    $error .= '('.$hostlist.')';\n    if ($this->debug_ && $this->debugHandler_ !== null) {\n      $dh = $this->debugHandler_;\n      $dh($error);\n    }\n    throw new TTransportException($error);\n  }\n\n  public static function getAPCFailtimeKey(string $host, int $port): string {\n    // Check APC cache for a record of this server being down\n    return 'thrift_failtime:'.$host.':'.$port.'~';\n  }\n\n  /**\n   * Record the failure in APC\n   * @param string  host  dest IP\n   * @param int     port  dest port\n   * @param int     max_failures   max consec errors before mark host/port down\n   * @param int     down_period    how long to mark the host/port down\n   *\n   * @return bool  if mark a host/port down\n   */\n  public function recordFailure(\n    string $host,\n    int $port,\n    int $max_failures,\n    int $down_period,\n    ?(function(string): bool) $log_handler = null,\n  ): bool {\n    $marked_down = false;\n    // Mark failure of this host in the cache\n    $failtimeKey = self::getAPCFailtimeKey($host, $port);\n    $consecfailsKey = 'thrift_consecfails:'.$host.':'.$port.'~';\n\n    // Ignore cache misses\n    $consecfails = $this->apcFetch($consecfailsKey);\n    if ($consecfails === false) {\n      $consecfails = 0;\n    }\n    $consecfails = (int) $consecfails;\n\n    // Increment by one\n    $consecfails++;\n\n    // Log and cache this failure\n    if ($consecfails >= $max_failures) {\n      if ($log_handler !== null) {\n        $log_handler(\n          'TSocketPool: marking '.\n          $host.\n          ':'.\n          $port.\n          ' as down for '.\n          $down_period.\n          ' secs '.\n          'after '.\n          $consecfails.\n          ' failed attempts.',\n        );\n      }\n      // Store the failure time\n      $curr_time = time();\n      $this->apcStore($failtimeKey, $curr_time);\n      $this->apcLog(\n        'TSocketPool: marking '.\n        $host.\n        ':'.\n        $port.\n        ' as down for '.\n        $down_period.\n        ' secs '.\n        'after '.\n        $consecfails.\n        ' failed attempts.('.\n        \"max_failures=$max_failures)\",\n      );\n      $marked_down = true;\n\n      // Clear the count of consecutive failures\n      $this->apcStore($consecfailsKey, 0);\n    } else {\n      $this->apcLog(\n        \"TSocketPool: increased $host:$port consec fails to \".$consecfails,\n      );\n      $this->apcStore($consecfailsKey, $consecfails);\n    }\n\n    return $marked_down;\n  }\n\n  /**\n   * !! To call this API, you must give apc_is_useful() as the last param\n   */\n  public function overrideAPCFunctions(\n    ?(function(string): mixed) $fake_apc_fetch,\n    ?(function(string, mixed, int): bool) $fake_apc_store,\n    ?(function(string): void) $logger,\n    bool $apc_is_useful,\n  ): void {\n    if (!$apc_is_useful) {\n      $this->fakeAPCFetch_ = $fake_apc_fetch;\n      $this->fakeAPCStore_ = $fake_apc_store;\n      $this->apcLogger_ = $logger;\n    }\n  }\n\n  /**\n   * Wrapper function around apc_fetch to be able to fetch from fake APC\n   * when there is no real APC\n   */\n  protected function apcFetch(string $key): mixed {\n    if ($this->fakeAPCFetch_ === null) {\n      return apc_fetch($key);\n    } else {\n      // try fake APC here\n      $ff = $this->fakeAPCFetch_;\n      return $ff($key);\n    }\n  }\n\n  /**\n   * wrapper function around apc_store to be able to store variable to fake APC\n   * when there is no real APC\n   */\n  protected function apcStore(string $key, mixed $value, int $ttl = 0): bool {\n    if ($this->fakeAPCStore_ === null) {\n      return apc_store($key, $value, $ttl);\n    } else {\n      // try fake APC here\n      $fs = $this->fakeAPCStore_;\n      return $fs($key, $value, $ttl);\n    }\n  }\n\n  protected function apcLog(string $message): void {\n    if ($this->apcLogger_ !== null) {\n      $logger = $this->apcLogger_;\n      $logger($message);\n    }\n  }\n\n  /**\n   * Whether a connection failure is a transient failure\n   * based on the error-code\n   *\n   * @param int $error_code\n   * @return bool true or false\n   */\n  private function isTransientConnectFailure(?int $error_code): bool {\n    if ($error_code === null) {\n      return false;\n    }\n    // todo: add more to this list\n    switch ($error_code) {\n      case self::ERROR_RESOURCE_TEMPORARILY_UNAVAILABLE:\n        return true;\n      default:\n        return false;\n    }\n  }\n}\n", "num_lines": 482}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/**\n * Base interface for a transport agent.\n *\n * @package thrift.transport\n */\nabstract class TTransport {\n\n  /**\n   * Name of the service targeted (for logging).\n   */\n  protected ?string $service_ = null;\n\n  /**\n   * Whether this transport is open.\n   *\n   * @return boolean true if open\n   */\n  public abstract function isOpen(): bool;\n\n  /**\n   * Open the transport for reading/writing\n   *\n   * @throws TTransportException if cannot open\n   */\n  public abstract function open(): void;\n\n  /**\n   * Close the transport.\n   */\n  public abstract function close(): void;\n\n  /**\n   * Read some data into the array.\n   *\n   * @param int    $len How much to read\n   * @return string The data that has been read\n   * @throws TTransportException if cannot read any more data\n   */\n  public abstract function read(int $len): string;\n\n  /**\n   * Guarantees that the full amount of data is read.\n   *\n   * @return string The data, of exact length\n   * @throws TTransportException if cannot read data\n   */\n  public function readAll(int $len): string {\n    // return $this->read($len);\n\n    $data = '';\n    $got = 0;\n    while (($got = strlen($data)) < $len) {\n      $data .= $this->read($len - $got);\n    }\n    return $data;\n  }\n\n  /**\n   * Writes the given data out.\n   *\n   * @param string $buf  The data to write\n   * @throws TTransportException if writing fails\n   */\n  public abstract function write(string $buf): void;\n\n  /**\n   * Flushes any pending data out of a buffer\n   *\n   * @throws TTransportException if a writing error occurs\n   */\n  public function flush(): void {}\n\n  /**\n   * Flushes any pending data out of a buffer for a oneway call\n   *\n   * @throws TTransportException if a writing error occurs\n   */\n  public function onewayFlush(): void {\n    // Default to flush()\n    $this->flush();\n  }\n}\n", "num_lines": 102}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/**\n * Transport exceptions\n *\n * Types deriving from TTransport exception may not be able to\n * translate their custom error into the set of error code\n * supported by TTransportException. For that the $shortMessage\n * facility is provided.\n *\n * @param mixed  $message Message (string) or type-spec (array)\n * @param mixed  $code Code (integer) or values (array)\n * @param string $shortMessage (string)\n */\nclass TTransportException extends TException {\n\n  const UNKNOWN = 0;\n  const NOT_OPEN = 1;\n  const ALREADY_OPEN = 2;\n  const TIMED_OUT = 3;\n  const END_OF_FILE = 4;\n  const INVALID_CLIENT = 5;\n  const INVALID_FRAME_SIZE = 6;\n  const INVALID_TRANSFORM = 7;\n  const COULD_NOT_CONNECT = 8;\n  const COULD_NOT_READ = 9;\n  const COULD_NOT_WRITE = 10;\n\n  protected string $shortMessage;\n\n  public function __construct(\n    ?string $message = null,\n    int $code = 0,\n    string $short_message = '',\n  ) {\n    $this->shortMessage = $short_message;\n    parent::__construct($message, $code);\n  }\n\n  public function getShortMessage(): string {\n    return $this->shortMessage;\n  }\n}\n", "num_lines": 61}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\nclass TTransportFactory {\n  /**\n   * @static\n   * @param TTransport $transport\n   * @return TTransport\n   */\n  public function getTransport(TTransport $transport): TTransport {\n    return $transport;\n  }\n}\n", "num_lines": 30}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\n/**\n *  Determine (as best as possible) whether the transport can preform\n *  non-blocking read and write operations.\n */\ninterface TTransportStatus {\n\n  /**\n   *  Test whether the transport is ready for a non-blocking read. It is\n   *  possible, though, that a transport is ready for a partial read, but a full\n   *  read will block.\n   *\n   *  In the case a transport becomes unavailable for reading due to an error\n   *  an exception should be raised. Any timeout logic should also raise an\n   *  exception.\n   *\n   *  @return bool True if a non-blocking read can be preformed on the\n   *               transport.\n   */\n  public function isReadable(): bool;\n\n  /**\n   *  Test whether the transport is ready for a non-blocking write.\n   *\n   *  In the case a transport becomes unavailable for writing due to an error\n   *  an exception should be raised. Any timeout logic should also raise an\n   *  exception.\n   *\n   *  @return bool True if a non-blocking write can be preformed on the\n   *               transport.\n   */\n  public function isWritable(): bool;\n}\n", "num_lines": 52}
{"repo_name": "fbthrift", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?hh\n/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @package thrift.transport\n */\n\ninterface TTransportSupportsHeaders {\n  public function setHeader(string $str_key, @string $str_value): this;\n  public function setPersistentHeader(\n    string $str_key,\n    @string $str_value,\n  ): this;\n  public function getWriteHeaders(): KeyedContainer<string, string>;\n  public function getPersistentWriteHeaders(): KeyedContainer<string, string>;\n  public function getHeaders(): KeyedContainer<string, string>;\n  public function clearHeaders(): void;\n  public function clearPersistentHeaders(): void;\n}\n", "num_lines": 32}
{"repo_name": "lr-with-bins", "repo_creator": "facebook", "programming_language": "PHP", "code": "//Copyright (c) Meta Platforms, Inc. and affiliates.\n//\n//This source code is licensed under the MIT license found in the\n//LICENSE file in the root directory of this source tree.\n\n<?hh\n\nabstract class BinaryClassificationMultistageInference{\n  /**\n   * Returns the combined bin key in which `$data` falls according to the\n   * quantile bins found in `$quantiles`.\n   */\n  private function dataToCombinedBin(\n    vec<vec<float>> $quantiles,\n    vec<float> $data,\n  ): string {\n    $num_quantile_bins = C\\count($quantiles);\n    $num_features = C\\count($quantiles[0]);\n\n    $combined_bin = \"\";\n    for ($j = 0; $j < $num_features; $j++) {\n      $quantile_bin = 0;\n      for ($i = 0; $i < $num_quantile_bins; $i++) {\n        if ($data[$j] > $quantiles[$i][$j]) {\n          $quantile_bin++;\n        }\n      }\n      $combined_bin .= $quantile_bin;\n    }\n    return $combined_bin;\n  }\n\n  /**\n   * Normalizes data to the combined bin metrics found in `$weights_info`. Then,\n   * performs logistic regression inference on `$data`.\n   */\n  private function lrInference(\n    dict<string, vec<float>> $weights_info,\n    vec<float> $data,\n  ): float {\n    $mean = vec($weights_info[\"mean\"]);\n    $std = vec($weights_info[\"std\"]);\n    $eps = vec($weights_info[\"eps\"]);\n    $weights = vec($weights_info[\"weights\"]);\n    $len_data_row = C\\count($data);\n    for ($i = 0; $i < $len_data_row; $i++) {\n      $data[$i] = ($data[$i] - $mean[$i]) / ($std[$i] + $eps[0]);\n    }\n    $sum = 0.0;\n    $sum += $weights[0];\n    for ($i = 0; $i < $len_data_row; $i++) {\n      $sum += $data[$i] * $weights[$i + 1];\n    }\n    $prob = 1 / (1 + Math\\exp(-$sum));\n    return $prob;\n  }\n\n  /**\n   * Return the features values (provided by `$id_to_feature_value`) of the\n   * `$feature_ids` vector in that order. Features not found are set to zero.\n   * Features are normalized according to `$data_mean`, `$data_std`, and `$eps`.\n   */\n  private function getData(\n    dict<string, string> $id_to_feature_value,\n    vec<string> $feature_ids,\n    vec<float> $data_mean,\n    vec<float> $data_std,\n    float $eps,\n  ): vec<float> {\n    $num_features = C\\count($feature_ids);\n    $data = vec[];\n    for ($i = 0; $i < $num_features; $i++) {\n      if (C\\contains_key($id_to_feature_value, $feature_ids[$i])) {\n        $feature_val = (float)$id_to_feature_value[$feature_ids[$i]];\n      } else {\n        $feature_val = 0.0;\n      }\n      $data[] = ($feature_val - $data_mean[$i]) / ($data_std[$i] + $eps);\n    }\n    return $data;\n  }\n\n  /**\n   * This first stage inference is called first by genProbability to attempt a\n   * quick and accurate inference using the LRwBins model. The function returns\n   * the probability of the logistic regression model or -1 if first-stage\n   * inference cannot handle the data.\n   */\n  private async function genFirstStageInference(\n    this::TContext $context,\n  ): Awaitable<?float> {\n    // load in the first-stage inference model\n    $config_name = \"experimental/danielsjohnson/model\";\n    $raw_config = Configerator::getRaw($config_name);\n    $json_a = fb_json_decode($raw_config, true);\n\n    // access the loop features\n    $feature_handler = await $this->genConfigBackedFeatureHandler();\n    $features_wrapper = await $feature_handler->genFeaturesAndContext(\n      new LooperMemoizingWrapper($context),\n    );\n    list($features, $_contexts) = $features_wrapper;\n    $ids = $features->getIDs();\n\n    // map feature ids to feature values\n    $id_to_feature_value = dict[];\n    foreach ($ids as $id) {\n      $id_to_feature_value[(string)$id] =\n        PHP\\strval($features->getFeature($id));\n    }\n\n    // create vector of feature values in the order used to construct the\n    // combined bins (the order found in `$bin_feature_ids`)\n    $eps = (float)$json_a[\"eps\"];\n    $bin_feature_ids = vec($json_a[\"bin_feature_ids\"]);\n    $bin_data_mean = vec($json_a[\"bin_data_mean\"]);\n    $bin_data_std = vec($json_a[\"bin_data_std\"]);\n    $bin_data = $this->getData(\n      $id_to_feature_value,\n      $bin_feature_ids,\n      $bin_data_mean,\n      $bin_data_std,\n      $eps,\n    );\n\n    // get the combined bin key of the combined bin that `$bin_data` falls into\n    $quantiles = vec($json_a[\"quantiles\"]);\n    $combined_bin = $this->dataToCombinedBin($quantiles, $bin_data);\n\n    // check if the first-stage inference model is used for this combined bin\n    $combined_bin_weights = $json_a[\"combined_bins\"];\n    if (C\\contains_key($combined_bin_weights, $combined_bin)) {\n      // first-stage inference is used for this prediction\n      // create vector of feature values in the same order as their corresponding\n      // logistic regression weights (the order found in `$inference_feature_ids`)\n      $inference_feature_ids = vec($json_a[\"inference_feature_ids\"]);\n      $inference_data_mean = vec($json_a[\"inference_data_mean\"]);\n      $inference_data_std = vec($json_a[\"inference_data_std\"]);\n      $inference_data = $this->getData(\n        $id_to_feature_value,\n        $inference_feature_ids,\n        $inference_data_mean,\n        $inference_data_std,\n        $eps,\n      );\n\n      // access the combined bin weights and perform logistic regression\n      // inference on `$inference_data`\n      $prob = $this->lrInference(\n        $combined_bin_weights[$combined_bin],\n        $inference_data,\n      );\n    } else {\n      // first-stage inference is not used for this combined bin\n      $prob = -1.0;\n    }\n    return $prob;\n  }\n}\n\n", "num_lines": 161}
{"repo_name": "mysql-5.6", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n// Copyright 2004-present Facebook.  All rights reserved.\nphutil_register_library('mysql-source-arcanist', __FILE__);\n", "num_lines": 4}
{"repo_name": "mysql-5.6", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n\n/**\n * This file is automatically generated. Use 'arc liberate' to rebuild it.\n * @generated\n * @phutil-library-version 2\n */\n\nphutil_register_library_map(array(\n  '__library_version__' => 2,\n  'class' =>\n  array(\n    'BaseDirectoryScopedFormatLinter' => 'lint/linter/BaseDirectoryScopedFormatLinter.php',\n    'FacebookInnoDBTabLinter' => 'lint/linter/FacebookInnoDBTabLinter.php',\n    'FacebookMySQLArcanistConfiguration' => 'arcanist/FacebookMySQLArcanistConfiguration.php',\n    'FacebookMySQLAssertUsageLinter' => 'lint/linter/FacebookMySQLAssertUsageLinter.php',\n    'FacebookMySQLLintEngine' => 'lint/FacebookMySQLLintEngine.php',\n    'FacebookMySQLLinter' => 'lint/linter/FacebookMySQLLinter.php',\n    'FacebookMySQLPrintfLinter' => 'lint/linter/FacebookMySQLPrintfLinter.php',\n    'FacebookMySQLTestResultLinter' => 'lint/linter/FacebookMySQLTestResultLinter.php',\n  ),\n  'function' =>\n  array(\n  ),\n  'xmap' =>\n  array(\n    'BaseDirectoryScopedFormatLinter' => 'ArcanistLinter',\n    'FacebookInnoDBTabLinter' => 'ArcanistLinter',\n    'FacebookMySQLArcanistConfiguration' => 'ArcanistConfiguration',\n    'FacebookMySQLAssertUsageLinter' => 'ArcanistLinter',\n    'FacebookMySQLClangFormatLinter' => 'BaseDirectoryScopedFormatLinter',\n    'FacebookMySQLLintEngine' => 'ArcanistLintEngine',\n    'FacebookMySQLLinter' => 'ArcanistLinter',\n    'FacebookMySQLPrintfLinter' => 'ArcanistLinter',\n    'FacebookMySQLTestResultLinter' => 'ArcanistLinter',\n  ),\n));\n", "num_lines": 38}
{"repo_name": "mysql-5.6", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n// Copyright 2004-present Facebook. All Rights Reserved.\n\nclass FacebookMySQLArcanistConfiguration extends ArcanistConfiguration {\n  // This hook is called just after this class is instantiated.\n  public function updateConfig($working_copy, $configuration_manager) {\n    $using_sandcastle = self::isUsingSandcastle();\n    $console = PhutilConsole::getConsole();\n\n    $tools_config_file = self::pathInTools(false, $working_copy, '.arcconfig');\n    if (!Filesystem::pathExists($tools_config_file)) {\n      // At this point we have determined that we aren't running in the\n      // environment where there's a `tools` directory at the same level as\n      // MySQL source code. Let's check if we're inside Sandcastle first.\n      if ($using_sandcastle) {\n        $tools_config_file = self::pathInTools(\n          true, $working_copy, '.arcconfig');\n        $console->writeErr(\n          \"Operating in Sandcastle. Using: %s\\n\", $tools_config_file);\n      } else {\n        $console->writeErr(\n          \"Operating in Facebook-external mode. File not found: %s\\n\",\n          $tools_config_file\n        );\n\n        return;\n      }\n    }\n\n    $project_root = $working_copy->getProjectRoot();\n    $configuration_manager->setRuntimeConfig(\"lint.engine\",\n      \"FacebookMySQLLintEngine\");\n    $configuration_manager->setRuntimeConfig(\"lint.cpplint.prefix\",\n      $project_root . \"/arcanist/lint/cpp_linter/\");\n    $configuration_manager->setRuntimeConfig(\"lint.cpplint.options\",\n      \"--filter=-build/include_order,-whitespace/braces,-whitespace/newline\");\n    $console->writeErr(\"Linters are enabled.\\n\");\n\n    $tools_config_data = Filesystem::readFile($tools_config_file);\n    $tools_config = json_decode($tools_config_data, true);\n    if (!is_array($tools_config)) {\n      throw new ArcanistUsageException(\n        $tools_config_file.\" is not a valid JSON file.\"\n      );\n    }\n\n    // Load the tool's libraries too.\n    foreach (idx($tools_config, 'load', array()) as $location) {\n      $full_path = self::pathInTools(\n        $using_sandcastle, $working_copy, $location);\n\n      $console->writeErr(\"Loading library from \".$full_path.\"\\n\");\n      phutil_load_library($full_path);\n    }\n\n    $keys_to_merge = array('unit.engine', 'events.listeners');\n    foreach ($keys_to_merge as $key) {\n      $value = idx($tools_config, $key);\n      if (!is_null($value)) {\n        $configuration_manager->setRuntimeConfig($key, $value);\n      }\n    }\n  }\n\n  public static function isUsingSandcastle() {\n    return getenv(\"SANDCASTLE\");\n  }\n\n  public static function pathInTools($using_sandcastle,\n                                     $working_copy, $suffix) {\n    if ($using_sandcastle) {\n      $project_root = $working_copy->getProjectRoot();\n      return $project_root.'/tools/'.$suffix;\n    } else {\n      $project_root = $working_copy->getProjectRoot();\n      return $project_root.'/../tools/'.$suffix;\n    }\n  }\n\n}\n", "num_lines": 81}
{"repo_name": "mysql-5.6", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n// Copyright 2013-present Facebook.  All rights reserved.\n// @author: rahulgulati (rahulgulati@fb.com)\n\nclass FacebookMySQLLintEngine extends ArcanistLintEngine {\n\n  public function buildLinters() {\n    $linters = array();\n    $paths = $this->getPaths();\n\n    foreach ($paths as $key => $path) {\n      if (!Filesystem::pathExists($this->getFilePathOnDisk($path))) {\n        unset($paths[$key]);\n      }\n    }\n\n    $text_extensions = (\n      '/\\.(cpp|cxx|c|cc|h|hpp|hxx|tcc|txt|py|sh|cmake'.\n      '|css|sql|inc|pl|php|json|java|html|i|ic|yy)$/'\n    );\n\n    // All paths that have a recognizable text extension\n    $text_paths = preg_grep($text_extensions, $paths);\n\n    $cpp_extensions = ('/\\.(cpp|cxx|c|cc|h|hpp|hxx|tcc|i|ic)$/');\n\n    // All paths that have a C++ extension\n    $all_cpp_paths = preg_grep($cpp_extensions, $paths);\n\n    // Run on all C++ files that are in MyRocks (include 'storage/rocksdb')\n    $myrocks_cpp_paths = preg_grep('/storage\\/rocksdb/', $all_cpp_paths);\n\n    // ArcanistGeneratedLinter stops other linters from running on generated\n    // code.\n    $linters[] = id(new ArcanistGeneratedLinter())->setPaths($text_paths);\n\n    // ArcanistNoLintLinter stops other linters from running on code marked\n    // with a nolint annotation.\n    $linters[] = id(new ArcanistNoLintLinter())->setPaths($text_paths);\n\n    // FacebookMySqlLinter enforces the following lint checks: max line length\n    // is 80 characters, use Unix newlines instead of DOS newlines, Files\n    // should end in a new line, and, lines containing trailing whitespace.\n    $linters[] = id(new FacebookMySQLLinter())->setPaths($text_paths);\n\n    // ArcanistCpplintLinter runs cpplint.py\n    $linters[] = id(new ArcanistCpplintLinter())->setPaths($myrocks_cpp_paths);\n\n    // Clang format only MyRocks for the 5.6 codebase\n    $linters[] = id(new ArcanistClangFormatLinter())->setPaths($myrocks_cpp_paths);\n\n    // This linter looks to see if any changes in InnoDB use tabs as most of\n    // the files there expect tabs instead of spaces.\n    // Run on all C++ files that are in InnoDB (include 'storage/innobase')\n    $innodb_cpp_paths = preg_grep('/storage\\/innobase/', $all_cpp_paths);\n    $linters[] = id(new FacebookInnoDBTabLinter())\n        ->setPaths($innodb_cpp_paths);\n\n    // ArcanistSpellingLinter enforces basic spelling. A blacklisted set of\n    // words that are commonly spelled incorrectly are used.\n    $spelling_linter = new ArcanistSpellingLinter();\n    $spelling_linter->setCustomSeverityMap(\n      array(\n        ArcanistSpellingLinter::LINT_SPELLING_PICKY\n          => ArcanistLintSeverity::SEVERITY_WARNING,\n        ArcanistSpellingLinter::LINT_SPELLING_IMPORTANT\n          => ArcanistLintSeverity::SEVERITY_WARNING,\n      )\n    );\n    $spelling_linter->setPaths($text_paths);\n    $linters[] = $spelling_linter;\n\n    // ArcanistFilenameLinter stifles creativity in choosing imaginative file\n    // names.\n    $linters[] = id(new ArcanistFilenameLinter())->setPaths($paths);\n\n    $linters[] = id(new FacebookMySQLPrintfLinter())\n        ->setPaths($all_cpp_paths);\n\n    $linters[] = id(new FacebookMySQLAssertUsageLinter())\n        ->setPaths($myrocks_cpp_paths);\n\n    //\n    // If SKIP_HOWTOEVEN is specified then don't run Howtoeven linter.\n    // Readability note: strcmp() returns a non-zero value if strings aren't\n    // equal.\n    //\n    if (strcmp(getenv(\"SKIP_HOWTOEVEN\"), \"1\")) {\n      // Advanced static analysis will be only applied to MyRocks because the\n      // existing MySQL codebase differs too much from our requirements.\n      $linters[] = id(new FacebookMySQLHowtoevenLinter())\n          ->setPaths($myrocks_cpp_paths);\n    }\n\n    // All paths in mysql-test that have a .test or .result extension\n    $mysql_test_paths = preg_grep('/mysql-test\\/.*\\.(test|result)$/', $paths);\n\n    // This linter validates that new .test files (in mysql-test/) have\n    // have matchine .result files\n    $linters[] = id(new FacebookMySQLTestResultLinter())\n        ->setPaths($mysql_test_paths);\n\n    return $linters;\n  }\n}\n", "num_lines": 106}
{"repo_name": "mysql-5.6", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n// Copyright 2004-present Facebook. All Rights Reserved.\n\nabstract class BaseDirectoryScopedFormatLinter extends ArcanistLinter {\n\n  const LINT_FORMATTING = 1;\n\n  private $changedLines = array();\n  private $rawLintOutput = array();\n  private $pathsThatRaisedLint = array();\n\n  abstract protected function getPathsToLint();\n\n  /**\n   * Override and add paths to exclude subdirectories of paths returned by\n   * `getPathsToLint`. For example, if you want to include `a/*` except for\n   * `a/b`, you can add `a/` to `getPathsToLint` and `a/b` to\n   * `getPathsToExcludeFromLint`.\n   */\n  protected function getPathsToExcludeFromLint() {\n    return array();\n  }\n\n  protected function shouldLintPath($path) {\n    return self::matchPath($path, $this->getPathsToLint()) &&\n      !self::matchPath($path, $this->getPathsToExcludeFromLint());\n  }\n\n  protected static function matchPath($needle, $haystack) {\n    foreach ($haystack as $p) {\n      // check if $path starts with $p\n      if (strncmp($needle, $p, strlen($p)) === 0) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  // API to tell this linter which lines were changed\n  final public function setPathChangedLines($path, $changed) {\n    $this->changedLines[$path] = $changed;\n  }\n\n  final public function willLintPaths(array $paths) {\n    $futures = array();\n\n    $this->prepareFormat();\n\n    foreach ($paths as $path) {\n      if (!$this->shouldLintPath($path)) {\n        continue;\n      }\n\n      $changed = $this->changedLines[$path];\n      if (!isset($changed)) {\n        // do not run linter if there are no changes\n        continue;\n      }\n\n      $futures[$path] = $this->getFormatFuture($path, $changed);\n    }\n\n    foreach (Futures($futures)->limit(8) as $p => $f) {\n      $this->rawLintOutput[$p] = $f->resolvex();\n    }\n  }\n\n  protected function prepareFormat() {}\n  abstract protected function getFormatFuture($path, array $changed);\n  abstract protected function getLintMessage($diff);\n\n  final public function lintPath($path) {\n    if (!isset($this->rawLintOutput[$path])) {\n      return;\n    }\n\n    list($new_content) = $this->rawLintOutput[$path];\n    $old_content = $this->getData($path);\n\n    if ($new_content != $old_content) {\n      $diff = ArcanistDiffUtils::renderDifferences($old_content, $new_content);\n      $this->raiseLintAtOffset(\n        0,\n        self::LINT_FORMATTING,\n        $this->getLintMessage($diff),\n        $old_content,\n        $new_content);\n      $this->setDidModifySource();\n      $this->pathsThatRaisedLint[$path] = true;\n    }\n  }\n\n  final public function hasRaisedLint($path) {\n    return array_key_exists($path, $this->pathsThatRaisedLint);\n  }\n}\n", "num_lines": 97}
{"repo_name": "mysql-5.6", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n// Copyright 2015, Facebook, Inc.  All rights reserved.\n// @author: Jay Edgar (jkedgar@fb.com)\n\nclass FacebookInnoDBTabLinter extends ArcanistLinter {\n\n  const LINT_INCORRECT_TAB = 1;\n  const LINT_TABSTOP = 8;\n\n  public function getLinterName() {\n    return 'InnoDB_tab';\n  }\n\n  public function getLintSeverityMap() {\n    return array(\n      self::LINT_INCORRECT_TAB => ArcanistLintSeverity::SEVERITY_AUTOFIX,\n    );\n  }\n\n  public function getLintNameMap() {\n    return array(\n      self::LINT_INCORRECT_TAB => 'Incorrect tab usage',\n    );\n  }\n\n  public function lintPath($path) {\n    if ($this->didStopAllLinters()) {\n      return;\n    }\n\n    if (!$this->shouldLintBinaryFiles() &&\n        $this->GetEngine()->isBinaryFile($path)) {\n      return;\n    }\n\n    $this->fileData = $this->getData($path);\n\n    if (strpos($this->fileData, \"\\t\")) {\n      // There are a few files in storage/innobase that don't use tabs.\n      // Only check for correct usage of tabs if there is at least one\n      // tab in the file.\n      $this->lintInnoDBTabs();\n    }\n  }\n\n  private function move_to_tabstop($pos) {\n    $past_tabstop = $pos % self::LINT_TABSTOP;\n    if ($past_tabstop > 0) {\n      $pos += self::LINT_TABSTOP - $past_tabstop;\n    }\n\n    return $pos;\n  }\n\n  private function tabify($line) {\n    $adjusted = \"\";    // Adjust result\n    $whitespace = \"\";  // Buffer holding recently seen whitespace chars\n    $pos = 0;          // Current position (when tabs are considered)\n\n    $len = strlen($line);\n    for ($ii = 0; $ii < $len; $ii++) {\n      $char = $line[$ii];\n      // Whenever the current position is at a tabstop we need to see if we\n      // need to make any adjustments.\n      if ($pos % self::LINT_TABSTOP == 0) {\n        $wslen = strlen($whitespace);\n        if ($wslen > 1 || ($wslen > 0 && ($char == \"\\t\" || $char == \" \"))) {\n          // If we have seen 2 or more whitespace chars or a single whitespace\n          // char and the next char is also a whitespace char then replace the\n          // seen whitespace chars with a tab.\n          $adjusted .= \"\\t\";\n        } else {\n          // Otherwise just append whatever whitespace char we have seen.\n          $adjusted .= $whitespace;\n        }\n\n        // Clear out the seen whitespace.\n        $whitespace = \"\";\n      }\n\n      $pos++;\n      if ($char == \"\\t\") {\n        // The current char is a tab - append it to the seen whitespace chars\n        // and adjust the position to the next tab stop.\n        $whitespace .= \"\\t\";\n        $pos = $this->move_to_tabstop($pos);\n      } else if ($char == \" \") {\n        // The current char is a space - append it to the seen whitespace and\n        // increment the position.\n        $whitespace .= \" \";\n      } else {\n        // The current char is not a tab or space - append any seen\n        // whitespace chars and the current char.  Clear out the seen\n        // whitespace and increment the position.\n        $adjusted .= $whitespace . $char;\n        $whitespace = \"\";\n      }\n    }\n\n    // Add any seen whitespace to the end.  This linter is not attempting to\n    // notify about extra whitespace on the end of a line.  Other linters can\n    // handle that job.\n    $adjusted .= $whitespace;\n\n    return $adjusted;\n  }\n\n  private function lintInnoDBTabs() {\n    $lines = explode(\"\\n\", $this->fileData);\n    foreach ($lines as $line_idx => $line) {\n      // Replace spaces with tabs where it is expected.  Compare the result\n      // with the original.  If there are differences then the line does not\n      // follow the convention and is flagged.\n      $tabified = $this->tabify($line);\n      if ($line !== $tabified) {\n        $this->raiseLintAtLine($line_idx + 1, 1, self::LINT_INCORRECT_TAB,\n          'This line does not use tabs in the correct convention',\n          $line, $tabified);\n      }\n    }\n  }\n}\n", "num_lines": 123}
{"repo_name": "mysql-5.6", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n// Copyright 2015, Facebook, Inc.  All rights reserved.\n// @author: Gunnar Kudrjavets (gunnarku@fb.com)\n\nclass FacebookMySQLAssertUsageLinter extends ArcanistLinter {\n  const LINT_ASSERT = 1;\n\n  public function willLintPaths(array $paths) {\n    return;\n  }\n\n  public function getLinterName() {\n    return 'MySQLAssert';\n  }\n\n  public function getLintSeverityMap() {\n    return array(\n      self::LINT_ASSERT\n        => ArcanistLintSeverity::SEVERITY_ADVICE,\n    );\n  }\n\n  public function getLintNameMap() {\n    return array(\n      self::LINT_ASSERT\n        => 'Assertion macro usage',\n    );\n  }\n\n  public function lintPath($path) {\n    if ($this->didStopAllLinters()) {\n      return;\n    }\n\n    $lines = explode(\"\\n\", $this->getData($path));\n\n    foreach ($lines as $line_idx => $line) {\n      $trimmedLine = trim($line);\n\n      // We want to make sure that macros or type definitions like\n      // mysql_mutex_assert_owner or compile_time_assert won't be flagged\n      // by this rule and we'll have an opportunity to turn the warning off\n      // as well when needed.\n\n      // NO_LINT_DEBUG comment can be used to turn off this advice.\n      if (($line_idx > 0 &&\n          strpos($lines[$line_idx - 1], 'NO_LINT_DEBUG') === false) &&\n          !(preg_match('/[\\t ]*static_assert[\\t ]*\\(/', $trimmedLine)) &&\n          (preg_match('/[\\t ]*assert[\\t ]*\\(/', $trimmedLine) === 1)) {\n        $this->raiseLintAtLine(\n          $line_idx + 1,\n          1,\n          self::LINT_ASSERT,\n          'Please use DBUG_ASSERT macro instead of assert() macro. '.\n          'DBUG_ASSERT is a standard MySQL debugging macro and this way '.\n          'the code will look more unified. Once you have made the changes '.\n          'then please verify them with a release build. '.\n          'You can suppress this advice by adding a comment NO_LINT_DEBUG '.\n          'above this line.',\n          $line);\n      }\n    }\n  }\n}\n\n", "num_lines": 66}
{"repo_name": "mysql-5.6", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n// Copyright 2013-present Facebook.  All rights reserved.\n// @author: rahulgulati (rahulgulati@fb.com)\n\nfinal class FacebookMySQLLinter extends ArcanistLinter {\n\n  const LINT_DOS_NEWLINE         = 1;\n  const LINT_LINE_WRAP           = 2;\n  const LINT_EOF_NEWLINE         = 3;\n  const LINT_TRAILING_WHITESPACE = 4;\n\n  private $maxLineLength = 80;\n  private $fileData;\n\n  public function setMaxLineLength($new_length) {\n    $this->maxLineLength = $new_length;\n    return $this;\n  }\n\n  public function willLintPaths(array $paths) {\n    return;\n  }\n\n  public function getLinterName() {\n    return 'MYSQL';\n  }\n\n  public function getLintSeverityMap() {\n    return array(\n      self::LINT_DOS_NEWLINE\n        => ArcanistLintSeverity::SEVERITY_WARNING,\n      self::LINT_LINE_WRAP\n        => ArcanistLintSeverity::SEVERITY_WARNING,\n      self::LINT_EOF_NEWLINE\n        => ArcanistLintSeverity::SEVERITY_WARNING,\n      self::LINT_TRAILING_WHITESPACE\n        => ArcanistLintSeverity::SEVERITY_AUTOFIX,\n      );\n  }\n\n  public function getLintNameMap() {\n    return array(\n      self::LINT_DOS_NEWLINE\n        => 'DOS Newlines',\n      self::LINT_LINE_WRAP\n        => 'Line Too Long',\n      self::LINT_EOF_NEWLINE\n        => 'File Does Not End in Newline',\n      self::LINT_TRAILING_WHITESPACE\n        => 'Trailing Whitespace',\n    );\n  }\n\n  public function lintPath($path) {\n    if ($this->didStopAllLinters()) {\n      return;\n    }\n\n    if (!$this->shouldLintBinaryFiles() &&\n        $this->GetEngine()->isBinaryFile($path)) {\n      return;\n    }\n\n    $this->fileData = $this->getData($path);\n\n    if (!strlen($this->fileData)) {\n      /* If the file is empty, then we don't require to\n      add a new line */\n      return;\n    }\n\n    $this->lintNewLines();\n    $this->lintLineLength();\n    $this->lintEOFNewline();\n    $this->lintTrailingWhitespace();\n  }\n\n  protected function lintNewlines() {\n    $pos = strpos($this->fileData, \"\\r\");\n    if ($pos !== false) {\n      $this->raiseLintAtOffset(\n      $pos,\n      self::LINT_DOS_NEWLINE,\n      'You must only use UNIX linebreaks (\"\\n\") in source code',\n      \"\\r\");\n    }\n  }\n\n  protected function lintLineLength() {\n    $lines = explode(\"\\n\", $this->fileData);\n    $width = $this->maxLineLength;\n    $tabLength = 8;\n    foreach ($lines as $line_idx => $line) {\n      $lineLength = 0;\n      $stringLength = strlen($line);\n      for ($i = 0; $i < $stringLength; $i++) {\n        $curr = $line[$i];\n        if ($curr === \"\\t\") {\n          $lineLength += $tabLength;\n          $lineLength -= ($lineLength % $tabLength);\n        }\n        else\n          $lineLength++;\n      }\n      if ($lineLength > $width) {\n        $this->raiseLintAtLine(\n        $line_idx + 1,\n        1,\n        self::LINT_LINE_WRAP,\n        'This line is '.$lineLength.' characters long, '.\n        'but the convention is '.$width.' characters.',\n        $line);\n      }\n    }\n  }\n\n  protected function lintEOFNewline() {\n    $len = strlen($this->fileData);\n    if (!$len || $this->fileData[$len - 1] != \"\\n\") {\n      $this->raiseLintAtOffset(\n        $len,\n        self::LINT_EOF_NEWLINE,\n        \"Files must end in a newline.\",\n        '',\n        \"\\n\");\n    }\n  }\n\n  protected function lintTrailingWhitespace() {\n    $matches = null;\n    $preg = preg_match_all(\n      '/[ \\t]+$/m',\n      $this->fileData,\n      $matches,\n      PREG_OFFSET_CAPTURE);\n\n    if (!$preg) {\n      return;\n    }\n\n    foreach($matches[0] as $match) {\n      list($string, $offset) = $match;\n      $this->raiseLintAtOffset(\n        $offset,\n        self::LINT_TRAILING_WHITESPACE,\n        'This line contains trailing whitespace.',\n        $string,\n        '');\n\n    }\n  }\n}\n", "num_lines": 153}
{"repo_name": "mysql-5.6", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n// Copyright 2015, Facebook, Inc.  All rights reserved.\n// @author: Santosh Banda (santoshb@fb.com)\n\nclass FacebookMySQLPrintfLinter extends ArcanistLinter {\n  const LINT_PRINTF = 1;\n\n  public function willLintPaths(array $paths) {\n    return;\n  }\n\n  public function getLinterName() {\n    return 'MySQLPrintf';\n  }\n\n  public function getLintSeverityMap() {\n    return array(\n      self::LINT_PRINTF\n        => ArcanistLintSeverity::SEVERITY_ADVICE,\n    );\n  }\n\n  public function getLintNameMap() {\n    return array(\n      self::LINT_PRINTF\n        => 'Error log output',\n    );\n  }\n\n  public function lintPath($path) {\n    if ($this->didStopAllLinters()) {\n      return;\n    }\n    $lines = explode(\"\\n\", $this->getData($path));\n    foreach ($lines as $line_idx => $line) {\n      $trimmedLine = trim($line);\n      // NO_LINT_DEBUG comment can be used to turn off this advice.\n      if (($line_idx > 0 &&\n          strpos($lines[$line_idx-1], 'NO_LINT_DEBUG') === false) &&\n          (preg_match('/fprintf[\\t\\ ]*\\([\\t\\ ]*stderr[.]*/', $trimmedLine) === 1\n          || strpos($trimmedLine, 'sql_print_') === 0)) {\n        $this->raiseLintAtLine(\n          $line_idx + 1,\n          1,\n          self::LINT_PRINTF,\n          'Please ensure this debug output is not going to flood error log. '.\n          'Ignore this advice if you think this is safe. You can suppress '.\n          'this advice by adding a comment NO_LINT_DEBUG above this line.',\n          $line);\n      }\n    }\n  }\n}\n\n", "num_lines": 55}
{"repo_name": "mysql-5.6", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n// Copyright 2016, Facebook, Inc.  All rights reserved.\n// @author: Jay Edgar (jkedgar@fb.com)\n\nclass FacebookMySQLTestResultLinter extends ArcanistLinter {\n\n  const MISSING_RESULT = 1;\n  const MISSING_TEST = 2;\n\n  const TEST_FILE_REGEX = '/(.*mysql-test.*\\/)t(\\/.*)\\.test$/';\n  const RESULT_FILE_REGEX = '/(.*mysql-test.*\\/)r(\\/.*)\\.result/';\n\n  public function getLinterName() {\n    return 'MySQLTestResult';\n  }\n\n  public function willLintPaths(array $paths) {\n    return;\n  }\n\n  public function getLintSeverityMap() {\n    return array(\n      self::MISSING_RESULT => ArcanistLintSeverity::SEVERITY_ERROR,\n      self::MISSING_TEST =>   ArcanistLintSeverity::SEVERITY_ERROR,\n    );\n  }\n\n  public function getLintNameMap() {\n    return array(\n      self::MISSING_RESULT => 'Missing result file',\n      self::MISSING_TEST =>   'Missing test file',\n    );\n  }\n\n  public function lintPath($path) {\n    $project_root = $this->getEngine()->getWorkingCopy()->getProjectRoot();\n\n    if (preg_match_all(self::TEST_FILE_REGEX, $path, $matches)) {\n      $result_path = $project_root . '/' . $matches[1][0] . 'r' .\n        $matches[2][0] . '.result';\n      if (!file_exists($result_path)) {\n        $this->raiseLintAtPath(self::MISSING_RESULT,\n          \"The result file ($result_path) for $path is missing\");\n      }\n    }\n    elseif (preg_match_all(self::RESULT_FILE_REGEX, $path, $matches)) {\n      $test_path = $project_root . '/' . $matches[1][0] . 't' .\n        $matches[2][0] . '.test';\n      if (!file_exists($test_path)) {\n        $this->raiseLintAtPath(self::MISSING_TEST,\n          \"The test file ($test_path) for $path is missing\");\n      }\n    }\n  }\n\n}\n", "num_lines": 57}
{"repo_name": "mysql-8.0", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n\trequire_once(\"./JSON.php\");\n\n\t$filename = \"./logs/analytics.log\";\n\t$json = new Services_JSON;\n\n\t$id = $_REQUEST[\"id\"];\n\t$items = $json->decode($_REQUEST[\"data\"]);\n\n\tif (!$handle = fopen($filename, 'a+')) {\n\t\tprint '{error: \"server error\"}';\n\t\texit;\n\t}\n\n\tforeach($items as $i=>$item){\n\t\t$item->_analyticsId = $id;\n\t\t$item->_analyticsTimeStamp = time();\n\t\t$log = $json->encode($item) . \"\\n\";\n\t\tfwrite($handle, $log);\n\t}\n\t\n\tfclose($handle);\n\n\t$response = \"{'eventsRecieved': '\" . sizeof($items) . \"', 'id': '\" . $id . \"'}\";\n\tif ($_REQUEST[\"callback\"]){\n\t\tprint htmlentities($_REQUEST[\"callback\"]) . \"(\" . $response . \");\";\n\t}else{\n\t\tprint $response;\n\t}\n\t\n?>\n", "num_lines": 32}
{"repo_name": "mysql-8.0", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */\n\n/** \n * Converts to and from JSON format.\n * \n * JSON (JavaScript Object Notation) is a lightweight data-interchange\n * format. It is easy for humans to read and write. It is easy for machines\n * to parse and generate. It is based on a subset of the JavaScript\n * Programming Language, Standard ECMA-262 3rd Edition - December 1999.\n * This feature can also be found in  Python. JSON is a text format that is\n * completely language independent but uses conventions that are familiar\n * to programmers of the C-family of languages, including C, C++, C#, Java,\n * JavaScript, Perl, TCL, and many others. These properties make JSON an\n * ideal data-interchange language.\n * \n * This package provides a simple encoder and decoder for JSON notation. It\n * is intended for use with client-side Javascript applications that make\n * use of HTTPRequest to perform server communication functions - data can\n * be encoded into JSON notation for use in a client-side javascript, or\n * decoded from incoming Javascript requests. JSON format is native to\n * Javascript, and can be directly eval()'ed with no further parsing\n * overhead\n *\n * All strings should be in ASCII or UTF-8 format!\n *\n * LICENSE: Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met: Redistributions of source code must retain the\n * above copyright notice, this list of conditions and the following\n * disclaimer. Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * \n * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN\n * NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\n * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE\n * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE.\n * \n * @category   \n * @package     Services_JSON\n * @author      Michal Migurski <mike-json@teczno.com>\n * @author      Matt Knapp <mdknapp[at]gmail[dot]com>\n * @author      Brett Stimmerman <brettstimmerman[at]gmail[dot]com>\n * @copyright   2005 Michal Migurski\n * @license     http://www.opensource.org/licenses/bsd-license.php\n * @link        http://pear.php.net/pepr/pepr-proposal-show.php?id=198\n */\n\n/**\n * Marker constant for Services_JSON::decode(), used to flag stack state\n */\ndefine('SERVICES_JSON_SLICE',   1);\n\n/**\n * Marker constant for Services_JSON::decode(), used to flag stack state\n */\ndefine('SERVICES_JSON_IN_STR',  2);\n\n/**\n * Marker constant for Services_JSON::decode(), used to flag stack state\n */\ndefine('SERVICES_JSON_IN_ARR',  4);\n\n/**\n * Marker constant for Services_JSON::decode(), used to flag stack state\n */\ndefine('SERVICES_JSON_IN_OBJ',  8);\n\n/**\n * Marker constant for Services_JSON::decode(), used to flag stack state\n */\ndefine('SERVICES_JSON_IN_CMT', 16);\n\n/**\n * Behavior switch for Services_JSON::decode()\n */\ndefine('SERVICES_JSON_LOOSE_TYPE', 10);\n\n/**\n * Behavior switch for Services_JSON::decode()\n */\ndefine('SERVICES_JSON_STRICT_TYPE', 11);\n\n/** \n * Converts to and from JSON format.\n *\n * Brief example of use:\n *\n * <code>\n * // create a new instance of Services_JSON\n * $json = new Services_JSON();\n * \n * // convert a complexe value to JSON notation, and send it to the browser\n * $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4)));\n * $output = $json->encode($value);\n *\n * print($output);\n * // prints: [\"foo\",\"bar\",[1,2,\"baz\"],[3,[4]]]\n * \n * // accept incoming POST data, assumed to be in JSON notation\n * $input = file_get_contents('php://input', 1000000);\n * $value = $json->decode($input);\n * </code>\n */\nclass Services_JSON\n{\n   /**\n    * constructs a new JSON instance\n    *\n    * @param    int     $use    object behavior: when encoding or decoding,\n    *                           be loose or strict about object/array usage\n    *\n    *                           possible values:\n    *                           - SERVICES_JSON_STRICT_TYPE: strict typing, default.\n    *                                                        \"{...}\" syntax creates objects in decode().\n    *                           - SERVICES_JSON_LOOSE_TYPE:  loose typing.\n    *                                                        \"{...}\" syntax creates associative arrays in decode().\n    */\n    function Services_JSON($use = SERVICES_JSON_STRICT_TYPE)\n    {\n        $this->use = $use;\n    }\n\n   /**\n    * convert a string from one UTF-16 char to one UTF-8 char\n    *\n    * Normally should be handled by mb_convert_encoding, but\n    * provides a slower PHP-only method for installations\n    * that lack the multibye string extension.\n    *\n    * @param    string  $utf16  UTF-16 character\n    * @return   string  UTF-8 character\n    * @access   private\n    */\n    function utf162utf8($utf16)\n    {\n        // oh please oh please oh please oh please oh please\n        if(function_exists('mb_convert_encoding'))\n            return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');\n        \n        $bytes = (ord($utf16{0}) << 8) | ord($utf16{1});\n\n        switch(true) {\n            case ((0x7F & $bytes) == $bytes):\n                // this case should never be reached, because we are in ASCII range\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return chr(0x7F & $bytes);\n\n            case (0x07FF & $bytes) == $bytes:\n                // return a 2-byte UTF-8 character\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return chr(0xC0 | (($bytes >> 6) & 0x1F))\n                     . chr(0x80 | ($bytes & 0x3F));\n\n            case (0xFFFF & $bytes) == $bytes:\n                // return a 3-byte UTF-8 character\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return chr(0xE0 | (($bytes >> 12) & 0x0F))\n                     . chr(0x80 | (($bytes >> 6) & 0x3F))\n                     . chr(0x80 | ($bytes & 0x3F));\n        }\n\n        // ignoring UTF-32 for now, sorry\n        return '';\n    }        \n\n   /**\n    * convert a string from one UTF-8 char to one UTF-16 char\n    *\n    * Normally should be handled by mb_convert_encoding, but\n    * provides a slower PHP-only method for installations\n    * that lack the multibye string extension.\n    *\n    * @param    string  $utf8   UTF-8 character\n    * @return   string  UTF-16 character\n    * @access   private\n    */\n    function utf82utf16($utf8)\n    {\n        // oh please oh please oh please oh please oh please\n        if(function_exists('mb_convert_encoding'))\n            return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');\n        \n        switch(strlen($utf8)) {\n            case 1:\n                // this case should never be reached, because we are in ASCII range\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return $utf8;\n\n            case 2:\n                // return a UTF-16 character from a 2-byte UTF-8 char\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return chr(0x07 & (ord($utf8{0}) >> 2))\n                     . chr((0xC0 & (ord($utf8{0}) << 6))\n                         | (0x3F & ord($utf8{1})));\n                \n            case 3:\n                // return a UTF-16 character from a 3-byte UTF-8 char\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return chr((0xF0 & (ord($utf8{0}) << 4))\n                         | (0x0F & (ord($utf8{1}) >> 2)))\n                     . chr((0xC0 & (ord($utf8{1}) << 6))\n                         | (0x7F & ord($utf8{2})));\n        }\n\n        // ignoring UTF-32 for now, sorry\n        return '';\n    }        \n\n   /**\n    * encodes an arbitrary variable into JSON format\n    *\n    * @param    mixed   $var    any number, boolean, string, array, or object to be encoded.\n    *                           see argument 1 to Services_JSON() above for array-parsing behavior.\n    *                           if var is a strng, note that encode() always expects it\n    *                           to be in ASCII or UTF-8 format!\n    *\n    * @return   string  JSON string representation of input var\n    * @access   public\n    */\n    function encode($var)\n    {\n        switch (gettype($var)) {\n            case 'boolean':\n                return $var ? 'true' : 'false';\n            \n            case 'NULL':\n                return 'null';\n            \n            case 'integer':\n                return (int) $var;\n                \n            case 'double':\n            case 'float':\n                return (float) $var;\n                \n            case 'string':\n                // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT\n                $ascii = '';\n                $strlen_var = strlen($var);\n\n               /*\n                * Iterate over every character in the string,\n                * escaping with a slash or encoding to UTF-8 where necessary\n                */\n                for ($c = 0; $c < $strlen_var; ++$c) {\n                    \n                    $ord_var_c = ord($var{$c});\n                    \n                    switch (true) {\n                        case $ord_var_c == 0x08:\n                            $ascii .= '\\b';\n                            break;\n                        case $ord_var_c == 0x09:\n                            $ascii .= '\\t';\n                            break;\n                        case $ord_var_c == 0x0A:\n                            $ascii .= '\\n';\n                            break;\n                        case $ord_var_c == 0x0C:\n                            $ascii .= '\\f';\n                            break;\n                        case $ord_var_c == 0x0D:\n                            $ascii .= '\\r';\n                            break;\n\n                        case $ord_var_c == 0x22:\n                        case $ord_var_c == 0x2F:\n                        case $ord_var_c == 0x5C:\n                            // double quote, slash, slosh\n                            $ascii .= '\\\\'.$var{$c};\n                            break;\n                            \n                        case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):\n                            // characters U-00000000 - U-0000007F (same as ASCII)\n                            $ascii .= $var{$c};\n                            break;\n                        \n                        case (($ord_var_c & 0xE0) == 0xC0):\n                            // characters U-00000080 - U-000007FF, mask 110XXXXX\n                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                            $char = pack('C*', $ord_var_c, ord($var{$c + 1}));\n                            $c += 1;\n                            $utf16 = $this->utf82utf16($char);\n                            $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n                            break;\n    \n                        case (($ord_var_c & 0xF0) == 0xE0):\n                            // characters U-00000800 - U-0000FFFF, mask 1110XXXX\n                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                            $char = pack('C*', $ord_var_c,\n                                         ord($var{$c + 1}),\n                                         ord($var{$c + 2}));\n                            $c += 2;\n                            $utf16 = $this->utf82utf16($char);\n                            $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n                            break;\n    \n                        case (($ord_var_c & 0xF8) == 0xF0):\n                            // characters U-00010000 - U-001FFFFF, mask 11110XXX\n                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                            $char = pack('C*', $ord_var_c,\n                                         ord($var{$c + 1}),\n                                         ord($var{$c + 2}),\n                                         ord($var{$c + 3}));\n                            $c += 3;\n                            $utf16 = $this->utf82utf16($char);\n                            $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n                            break;\n    \n                        case (($ord_var_c & 0xFC) == 0xF8):\n                            // characters U-00200000 - U-03FFFFFF, mask 111110XX\n                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                            $char = pack('C*', $ord_var_c,\n                                         ord($var{$c + 1}),\n                                         ord($var{$c + 2}),\n                                         ord($var{$c + 3}),\n                                         ord($var{$c + 4}));\n                            $c += 4;\n                            $utf16 = $this->utf82utf16($char);\n                            $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n                            break;\n    \n                        case (($ord_var_c & 0xFE) == 0xFC):\n                            // characters U-04000000 - U-7FFFFFFF, mask 1111110X\n                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                            $char = pack('C*', $ord_var_c,\n                                         ord($var{$c + 1}),\n                                         ord($var{$c + 2}),\n                                         ord($var{$c + 3}),\n                                         ord($var{$c + 4}),\n                                         ord($var{$c + 5}));\n                            $c += 5;\n                            $utf16 = $this->utf82utf16($char);\n                            $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n                            break;\n                    }\n                }\n                \n                return '\"'.$ascii.'\"';\n                \n            case 'array':\n               /*\n                * As per JSON spec if any array key is not an integer\n                * we must treat the the whole array as an object. We\n                * also try to catch a sparsely populated associative\n                * array with numeric keys here because some JS engines\n                * will create an array with empty indexes up to\n                * max_index which can cause memory issues and because\n                * the keys, which may be relevant, will be remapped\n                * otherwise.\n                * \n                * As per the ECMA and JSON specification an object may\n                * have any string as a property. Unfortunately due to\n                * a hole in the ECMA specification if the key is a\n                * ECMA reserved word or starts with a digit the\n                * parameter is only accessible using ECMAScript's\n                * bracket notation.\n                */\n                \n                // treat as a JSON object  \n                if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {\n                    return '{' .\n                           join(',', array_map(array($this, 'name_value'),\n                                               array_keys($var),\n                                               array_values($var)))\n                           . '}';\n                }\n\n                // treat it like a regular array\n                return '[' . join(',', array_map(array($this, 'encode'), $var)) . ']';\n                \n            case 'object':\n                $vars = get_object_vars($var);\n                return '{' .\n                       join(',', array_map(array($this, 'name_value'),\n                                           array_keys($vars),\n                                           array_values($vars)))\n                       . '}';\n\n            default:\n                return '';\n        }\n    }\n    \n   /**\n    * array-walking function for use in generating JSON-formatted name-value pairs\n    *\n    * @param    string  $name   name of key to use\n    * @param    mixed   $value  reference to an array element to be encoded\n    *\n    * @return   string  JSON-formatted name-value pair, like '\"name\":value'\n    * @access   private\n    */\n    function name_value($name, $value)\n    {\n        return $this->encode(strval($name)) . ':' . $this->encode($value);\n    }        \n\n   /**\n    * reduce a string by removing leading and trailing comments and whitespace\n    *\n    * @param    $str    string      string value to strip of comments and whitespace\n    *\n    * @return   string  string value stripped of comments and whitespace\n    * @access   private\n    */\n    function reduce_string($str)\n    {\n        $str = preg_replace(array(\n        \n                // eliminate single line comments in '// ...' form\n                '#^\\s*//(.+)$#m',\n    \n                // eliminate multi-line comments in '/* ... */' form, at start of string\n                '#^\\s*/\\*(.+)\\*/#Us',\n    \n                // eliminate multi-line comments in '/* ... */' form, at end of string\n                '#/\\*(.+)\\*/\\s*$#Us'\n    \n            ), '', $str);\n        \n        // eliminate extraneous space\n        return trim($str);\n    }\n\n   /**\n    * decodes a JSON string into appropriate variable\n    *\n    * @param    string  $str    JSON-formatted string\n    *\n    * @return   mixed   number, boolean, string, array, or object\n    *                   corresponding to given JSON input string.\n    *                   See argument 1 to Services_JSON() above for object-output behavior.\n    *                   Note that decode() always returns strings\n    *                   in ASCII or UTF-8 format!\n    * @access   public\n    */\n    function decode($str)\n    {\n        $str = $this->reduce_string($str);\n    \n        switch (strtolower($str)) {\n            case 'true':\n                return true;\n\n            case 'false':\n                return false;\n            \n            case 'null':\n                return null;\n            \n            default:\n                if (is_numeric($str)) {\n                    // Lookie-loo, it's a number\n\n                    // This would work on its own, but I'm trying to be\n                    // good about returning integers where appropriate:\n                    // return (float)$str;\n\n                    // Return float or int, as appropriate\n                    return ((float)$str == (integer)$str)\n                        ? (integer)$str\n                        : (float)$str;\n                    \n                } elseif (preg_match('/^(\"|\\').*(\\1)$/s', $str, $m) && $m[1] == $m[2]) {\n                    // STRINGS RETURNED IN UTF-8 FORMAT\n                    $delim = substr($str, 0, 1);\n                    $chrs = substr($str, 1, -1);\n                    $utf8 = '';\n                    $strlen_chrs = strlen($chrs);\n                    \n                    for ($c = 0; $c < $strlen_chrs; ++$c) {\n                    \n                        $substr_chrs_c_2 = substr($chrs, $c, 2);\n                        $ord_chrs_c = ord($chrs{$c});\n                        \n                        switch (true) {\n                            case $substr_chrs_c_2 == '\\b':\n                                $utf8 .= chr(0x08);\n                                ++$c;\n                                break;\n                            case $substr_chrs_c_2 == '\\t':\n                                $utf8 .= chr(0x09);\n                                ++$c;\n                                break;\n                            case $substr_chrs_c_2 == '\\n':\n                                $utf8 .= chr(0x0A);\n                                ++$c;\n                                break;\n                            case $substr_chrs_c_2 == '\\f':\n                                $utf8 .= chr(0x0C);\n                                ++$c;\n                                break;\n                            case $substr_chrs_c_2 == '\\r':\n                                $utf8 .= chr(0x0D);\n                                ++$c;\n                                break;\n\n                            case $substr_chrs_c_2 == '\\\\\"':\n                            case $substr_chrs_c_2 == '\\\\\\'':\n                            case $substr_chrs_c_2 == '\\\\\\\\':\n                            case $substr_chrs_c_2 == '\\\\/':\n                                if (($delim == '\"' && $substr_chrs_c_2 != '\\\\\\'') ||\n                                   ($delim == \"'\" && $substr_chrs_c_2 != '\\\\\"')) {\n                                    $utf8 .= $chrs{++$c};\n                                }\n                                break;\n                                \n                            case preg_match('/\\\\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):\n                                // single, escaped unicode character\n                                $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))\n                                       . chr(hexdec(substr($chrs, ($c + 4), 2)));\n                                $utf8 .= $this->utf162utf8($utf16);\n                                $c += 5;\n                                break;\n        \n                            case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):\n                                $utf8 .= $chrs{$c};\n                                break;\n        \n                            case ($ord_chrs_c & 0xE0) == 0xC0:\n                                // characters U-00000080 - U-000007FF, mask 110XXXXX\n                                //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                                $utf8 .= substr($chrs, $c, 2);\n                                ++$c;\n                                break;\n    \n                            case ($ord_chrs_c & 0xF0) == 0xE0:\n                                // characters U-00000800 - U-0000FFFF, mask 1110XXXX\n                                // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                                $utf8 .= substr($chrs, $c, 3);\n                                $c += 2;\n                                break;\n    \n                            case ($ord_chrs_c & 0xF8) == 0xF0:\n                                // characters U-00010000 - U-001FFFFF, mask 11110XXX\n                                // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                                $utf8 .= substr($chrs, $c, 4);\n                                $c += 3;\n                                break;\n    \n                            case ($ord_chrs_c & 0xFC) == 0xF8:\n                                // characters U-00200000 - U-03FFFFFF, mask 111110XX\n                                // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                                $utf8 .= substr($chrs, $c, 5);\n                                $c += 4;\n                                break;\n    \n                            case ($ord_chrs_c & 0xFE) == 0xFC:\n                                // characters U-04000000 - U-7FFFFFFF, mask 1111110X\n                                // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                                $utf8 .= substr($chrs, $c, 6);\n                                $c += 5;\n                                break;\n\n                        }\n\n                    }\n                    \n                    return $utf8;\n                \n                } elseif (preg_match('/^\\[.*\\]$/s', $str) || preg_match('/^\\{.*\\}$/s', $str)) {\n                    // array, or object notation\n\n                    if ($str{0} == '[') {\n                        $stk = array(SERVICES_JSON_IN_ARR);\n                        $arr = array();\n                    } else {\n                        if ($this->use == SERVICES_JSON_LOOSE_TYPE) {\n                            $stk = array(SERVICES_JSON_IN_OBJ);\n                            $obj = array();\n                        } else {\n                            $stk = array(SERVICES_JSON_IN_OBJ);\n                            $obj = new stdClass();\n                        }\n                    }\n                    \n                    array_push($stk, array('what'  => SERVICES_JSON_SLICE,\n                                           'where' => 0,\n                                           'delim' => false));\n\n                    $chrs = substr($str, 1, -1);\n                    $chrs = $this->reduce_string($chrs);\n                    \n                    if ($chrs == '') {\n                        if (reset($stk) == SERVICES_JSON_IN_ARR) {\n                            return $arr;\n\n                        } else {\n                            return $obj;\n\n                        }\n                    }\n\n                    //print(\"\\nparsing {$chrs}\\n\");\n                    \n                    $strlen_chrs = strlen($chrs);\n                    \n                    for ($c = 0; $c <= $strlen_chrs; ++$c) {\n                    \n                        $top = end($stk);\n                        $substr_chrs_c_2 = substr($chrs, $c, 2);\n                    \n                        if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {\n                            // found a comma that is not inside a string, array, etc.,\n                            // OR we've reached the end of the character list\n                            $slice = substr($chrs, $top['where'], ($c - $top['where']));\n                            array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));\n                            //print(\"Found split at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n\n                            if (reset($stk) == SERVICES_JSON_IN_ARR) {\n                                // we are in an array, so just push an element onto the stack\n                                array_push($arr, $this->decode($slice));\n\n                            } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {\n                                // we are in an object, so figure\n                                // out the property name and set an\n                                // element in an associative array,\n                                // for now\n                                if (preg_match('/^\\s*([\"\\'].*[^\\\\\\][\"\\'])\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n                                    // \"name\":value pair\n                                    $key = $this->decode($parts[1]);\n                                    $val = $this->decode($parts[2]);\n\n                                    if ($this->use == SERVICES_JSON_LOOSE_TYPE) {\n                                        $obj[$key] = $val;\n                                    } else {\n                                        $obj->$key = $val;\n                                    }\n                                } elseif (preg_match('/^\\s*(\\w+)\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n                                    // name:value pair, where name is unquoted\n                                    $key = $parts[1];\n                                    $val = $this->decode($parts[2]);\n\n                                    if ($this->use == SERVICES_JSON_LOOSE_TYPE) {\n                                        $obj[$key] = $val;\n                                    } else {\n                                        $obj->$key = $val;\n                                    }\n                                }\n\n                            }\n\n                        } elseif ((($chrs{$c} == '\"') || ($chrs{$c} == \"'\")) && ($top['what'] != SERVICES_JSON_IN_STR)) {\n                            // found a quote, and we are not inside a string\n                            array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));\n                            //print(\"Found start of string at {$c}\\n\");\n\n                        } elseif (($chrs{$c} == $top['delim']) &&\n                                 ($top['what'] == SERVICES_JSON_IN_STR) &&\n                                 (($chrs{$c - 1} != '\\\\') ||\n                                 ($chrs{$c - 1} == '\\\\' && $chrs{$c - 2} == '\\\\'))) {\n                            // found a quote, we're in a string, and it's not escaped\n                            array_pop($stk);\n                            //print(\"Found end of string at {$c}: \".substr($chrs, $top['where'], (1 + 1 + $c - $top['where'])).\"\\n\");\n\n                        } elseif (($chrs{$c} == '[') &&\n                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {\n                            // found a left-bracket, and we are in an array, object, or slice\n                            array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));\n                            //print(\"Found start of array at {$c}\\n\");\n\n                        } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {\n                            // found a right-bracket, and we're in an array\n                            array_pop($stk);\n                            //print(\"Found end of array at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n\n                        } elseif (($chrs{$c} == '{') &&\n                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {\n                            // found a left-brace, and we are in an array, object, or slice\n                            array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));\n                            //print(\"Found start of object at {$c}\\n\");\n\n                        } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {\n                            // found a right-brace, and we're in an object\n                            array_pop($stk);\n                            //print(\"Found end of object at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n\n                        } elseif (($substr_chrs_c_2 == '/*') &&\n                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {\n                            // found a comment start, and we are in an array, object, or slice\n                            array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));\n                            $c++;\n                            //print(\"Found start of comment at {$c}\\n\");\n\n                        } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {\n                            // found a comment end, and we're in one now\n                            array_pop($stk);\n                            $c++;\n                            \n                            for ($i = $top['where']; $i <= $c; ++$i)\n                                $chrs = substr_replace($chrs, ' ', $i, 1);\n                            \n                            //print(\"Found end of comment at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n\n                        }\n                    \n                    }\n                    \n                    if (reset($stk) == SERVICES_JSON_IN_ARR) {\n                        return $arr;\n\n                    } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {\n                        return $obj;\n\n                    }\n                \n                }\n        }\n    }\n    \n}\n    \n?>", "num_lines": 724}
{"repo_name": "mysql-8.0", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n\n// THIS IS AN EXAMPLE\n// you will obviously need to do more server side work than I am doing here to check and move your upload.\n// API is up for discussion, jump on http://dojotoolkit.org/forums\n\n// JSON.php is available in dojo svn checkout\nrequire(\"../../../dojo/tests/resources/JSON.php\");\n$json = new Services_JSON();\n\n// fake delay\nsleep(3);\n$name = empty($_REQUEST['name'])? \"default\" : $_REQUEST['name'];\nif(is_array($_FILES)){\n\t$ar = array(\n\t\t// lets just pass lots of stuff back and see what we find.\n\t\t// the _FILES aren't coming through in IE6 (maybe 7)\n\t\t'status' => \"success\",\n\t\t'name' => $name,\n\t\t'request' => $_REQUEST,\n\t\t'postvars' => $_POST,\n\t\t'details' => $_FILES,\n\t\t// and some static subarray just to see\n\t\t'foo' => array('foo'=>\"bar\")\n\t);\n\n}else{\n\t$ar = array(\n\t\t'status' => \"failed\",\n\t\t'details' => \"\"\n\t);\n}\n\n// yeah, seems you have to wrap iframeIO stuff in textareas?\n$foo = $json->encode($ar);\n?>\n<textarea><?php print $foo; ?></textarea>\n", "num_lines": 38}
{"repo_name": "mysql-8.0", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php // IF you don't have PHP5 installed, you can't use this index! ?>\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n\t\"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n\n\t<link rel=\"stylesheet\" href=\"../../dijit/tests/css/dijitTests.css\">\n\t<link rel=\"stylesheet\" href=\"../../dijit/themes/tundra/tundra.css\">\n\t<link rel=\"stylesheet\" href=\"../../dojox/widget/Dialog/Dialog.css\">\n\t<style type=\"text/css\">\n\t\t.innard {\n\t\t\tpadding:12px;\n\t\t\tmargin-top:0;\n\t\t}\n\t</style>\n\t<title>Dojo Toolkit - DojoX Demos and Tests by Project</title>\n\n\t<script src=\"../../dojo/dojo.js\"></script>\n\t<script type=\"text/javascript\">\n\t\tdojo.require('dojox.widget.Dialog');\n\t\tdojo.require(\"dojo.fx.easing\");\n\t\tdojo.addOnLoad(function(){\n\t\t\tvar dialog = new dojox.widget.Dialog({ title: \"About\", viewportPadding:100, fixedSize:true });\n\t\t\tdialog.startup();\n\t\t\tdojo.query(\"span.projectname + a\")\n\t\t\t\t.connect(\"onclick\",function(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tdojo.xhrGet({\n\t\t\t\t\t\turl: e.target.href,\n\t\t\t\t\t\tload: function(data){\n\t\t\t\t\t\t\tvar content = data.replace(/\\</g,\"&lt;\");\n\t\t\t\t\t\t\tdialog.show();\n\t\t\t\t\t\t\tdialog.setContent(\"<pre class='innard'>\" + content + \"</pre>\");\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t;\n\t\t});\n\t</script>\n\n</head>\n<body>\n\n\t<h1 class=\"testTitle\">DojoX test files overview</h1>\n\t\n\t<table id=\"testMatrix\">\n\t\t<thead>\n\t\t\t<tr class=\"top\"><th rowspan=\"2\">Test</th><th colspan=\"4\">Tundra</th><th colspan=\"4\">Nihilo</th><th colspan=\"4\">Soria</th></tr>\n\t\t\t<tr class=\"tests\"><th>Normal</th><th>a11y</th><th>rtl</th><th>a11y + rtl<th>Normal</th><th>a11y</th><th>rtl</th><th>a11y + rtl<th>Normal</th><th>a11y</th><th>rtl</th><th>a11y + rtl</tr>\n\t\t</thead>\n\t\t<tbody><?php\n\n\t\t\tforeach(getprojects() as $project){\n\t\t\t\t$note = \"\";\n\t\t\t\tif($project['readme']){\n\t\t\t\t\t$note = \"<a class='readmeLink' href='\".$project['readme'].\"'>about</a>\"; \n\t\t\t\t}\n\t\t\t\tif($project['tests'] || $project['demos']){\n\t\t\t\t\tprint \"<tr class='spacer'><td colspan='13'><span class='projectname'>dojox.\". $project['name'] . \"</span> \".$note.\"</td></tr>\";\n\n\t\t\t\t\tif($project['tests']){\n\t\t\t\t\t\tprintLinks($project['tests']);\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif($project['demos']){\n\t\t\t\t\t\tprintLinks($project['demos']);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t//\tprintLinks(\"./tree\",\"Dijit Tree Tests\");\n\t\t\t\n\t\t?>\n\t\t</tbody>\n\t</table>\n\n\t<p>* note: All themes and modes included for completeness. Some projects don't even use themes. The \"basic\" link\n\t\tis the direct link to the file with no enhancements. The test file must include _testCommon from dijit to\n\t\tinclude theme / rtl / a11y testing capabilities.</p>\n</body>\n</html>\n<?php\n\nfunction getprojects(){\n\t$projects = array();\n\t$path = \"../../dojox\";\n\t$handle = opendir($path);\n\twhile(false !== ($file = readdir($handle))){\n\t\t$README = \"\";\n\t\t$full = $path.\"/\".$file;\n\t\tif(is_dir($full)){\n\t\t\tif(file_exists($full.\"/README\")){\n\t\t\t\t$README = $full.\"/README\";\n\t\t\t}\n\t\t\t$tests = false; $demos = false;\n\t\t\tif(is_dir($full.\"/tests\")){\n\t\t\t\t$tests = $full.\"/tests\";\n\t\t\t}\n\t\t\tif(is_dir($full.\"/demos\")){\n\t\t\t\t$demos = $full.\"/demos\";\n\t\t\t}\n\t\t\t$projects[] = array(\n\t\t\t\t\"name\" => $file,\n\t\t\t\t\"tests\" => $tests,\n\t\t\t\t\"demos\" => $demos,\n\t\t\t\t\"readme\" => $README\n\t\t\t);\n\t\t}\n\t}\n\treturn $projects;\n}\n\nfunction printLinks($path){\n\t$handle = opendir($path);\n\t$i = 0;\n\n\twhile(false !== ($file = readdir($handle))){\n\t\tif(preg_match(\"/([a-zA-Z])(.*)\\.html/\", $file, $matches)){\n\t\t\t$base = $matches[0];\n\t\t\t$link = $path.\"/\".$matches[0];\n\t\t\tprint \n\t\t\t\"<tr class='testRow \". (++$i % 2 ==0 ? \"alt\" : \"\")   .\"'>\" .\n\n\t\t\t\t\"<td class='label'>\" . $base . \"</td>\" .\n\n\t\t\t    // standard / tundra:\n\t\t\t\t\"<td><a href='\".$link.\"'>basic</a></td>\" .\n\t\t\t\t\"<td><a href='\".$link.\"?a11y=true'>a11y</a></td>\" .\n\t\t\t\t\"<td><a href='\".$link.\"?dir=rtl'>rtl</a></td>\" .\n\t\t\t\t\"<td><a href='\".$link.\"?dir=rtl&amp;a11y=true'>both</a></td>\" .\n\t\t\t\t\n\t\t\t\t// nihilo\n\t\t\t\t\"<td><a href='\".$link.\"?theme=nihilo'>nihilo</a></td>\" .\n\t\t\t\t\"<td><a href='\".$link.\"?theme=nihilo&amp;a11y=true'>a11y</a></td>\" .\n\t\t\t\t\"<td><a href='\".$link.\"?theme=nihilo&amp;dir=rtl'>rtl</a></td>\" .\n\t\t\t\t\"<td><a href='\".$link.\"?theme=nihilo&amp;dir=rtl&amp;a11y=true'>combo</a></td>\" .\n\n\t\t\t\t// soria\n\t\t\t\t\"<td><a href='\".$link.\"?theme=soria'>soria</a></td>\" .\n\t\t\t\t\"<td><a href='\".$link.\"?theme=soria&amp;a11y=true'>a11y</a></td>\" .\n\t\t\t\t\"<td><a href='\".$link.\"?theme=soria&amp;dir=rtl'>rtl</a></td>\" .\n\t\t\t\t\"<td><a href='\".$link.\"?theme=soria&amp;dir=rtl&amp;a11y=true'>combo</a></td>\" .\n\t\t\t\t\t\t\t\t\t\n\t\t\t \"</tr>\";\n\t\t}\n\t}\n}\n\n?>\n", "num_lines": 150}
{"repo_name": "ThreatExchange", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/*\n *  Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\nif (!defined('__ROOT__')) {\n  define('__ROOT__', realpath(dirname(__FILE__)));\n}\nrequire_once(__ROOT__.'/ThreatExchangeConfig.php');\nThreatExchangeConfig::init();\n\nabstract class BaseSearch {\n\n  public abstract function getEndpoint();\n\n  public abstract function getResultsAsCSV($results);\n\n  public static function getSearcher($name) {\n    switch ($name) {\n      case 'malware':\n        return new MalwareSearch();\n      case 'families':\n        return new MalwareFamilySearch();\n      case 'indicators':\n        return new IndicatorSearch();\n      default:\n        throw new Exception(\n          'Search type (-t) must be one of: families, indicators or malware'\n        );\n    }\n  }\n\n  public function getUsage() {\n    return \"\\t-q query string\\n\".\n      \"\\t-m strict match the query string (optional)\\n\".\n      \"\\t-s beginning timestamp or date time string for a time windowed query\\n\".\n      \"\\t-u ending timestamp or date time string for a time windowed query\\n\";\n  }\n\n  public function getOptions() {\n    $options = array(\n      'm' => 'strict_text',\n      'q' => 'text',\n      's' => 'since',\n      'u' => 'until',\n    );\n    return array_merge($options, $this->getAdditionalOptions());\n  }\n\n  public function hasValidOptions($options) {\n    if (isset($options['h'])) {\n      return false;\n    } else if (!(isset($options['q']) xor isset($options['f'])) &&\n               !isset($options['s']) &&\n               !isset($options['u'])) {\n      return false;\n    }\n    return true;\n  }\n\n  public function getAdditionalOptions() {\n    return array();\n  }\n\n  public function buildAPIRequest($query_params, $optional_params=array()) {\n    $uri = ThreatExchangeConfig::FACEBOOK_SERVER.$this->getEndpoint().'/?';\n\n    // build the param array\n    $params = array (\n      'access_token' => ThreatExchangeConfig::getAccessToken(),\n    );\n\n    if (isset($query_params['q'])) {\n      $params['text'] = $query_params['q'];\n    }\n    if (isset($query_params['m'])) {\n      $params['strict_text'] = true;\n    }\n    if (isset($query_params['s'])) {\n      $params['since'] = $query_params['s'];\n    }\n    if (isset($query_params['u'])) {\n      $params['until'] = $query_params['u'];\n    }\n\n    foreach ($optional_params as $cli_opt => $param_name) {\n      if (isset($query_params[$cli_opt])) {\n        $params[$param_name] = $query_params[$cli_opt];\n      }\n    }\n\n    $param_str = http_build_query($params);\n    $uri .= $param_str;\n\n    return $uri;\n  }\n}\n", "num_lines": 103}
{"repo_name": "ThreatExchange", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/*\n *  Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\nif (!defined('__ROOT__')) {\n  define('__ROOT__', realpath(dirname(__FILE__)));\n}\nrequire_once(__ROOT__.'/ThreatExchangeConfig.php');\nThreatExchangeConfig::init();\n\nabstract class BaseUpload {\n\n  private $fields = null;\n\n  public abstract function getEndpoint();\n\n  protected abstract function getTypeSpecificFields();\n\n  protected abstract function getPostDataFromCSV($data_row);\n\n  public function getFields() {\n    if (!$this->fields) {\n      $this->fields = array(\n        'confidence',\n        'description',\n        'privacy_type',\n        'privacy_members',\n        'severity',\n        'share_level',\n        'status',\n      );\n      $this->fields = array_merge(\n        $this->fields,\n        $this->getTypeSpecificFields()\n      );\n    }\n    return $this->fields;\n  }\n\n  public static function getUploader($name) {\n    switch ($name) {\n      case 'indicators':\n        return new IndicatorUpload();\n      case 'malware':\n      case 'families':\n        throw new Exception(\n          'Malware and Malware Family uploads are not supported yet.'\n        );\n      default:\n        throw new Exception(\n          'Search type (-t) must be one of: families, indicators or malware'\n        );\n    }\n  }\n\n  public function getUsage() {\n    return \"\\t-f file containing data to upload (CSV format)\\n\".\n      \"\\t-d default description, if none provided\\n\".\n      \"\\t-g tag to prepend to all descriptions\\n\".\n      \"\\t-m default members for privacy, if none provided\\n\".\n      \"\\t-p default privacy, if none provided\\n\";\n  }\n\n  public function hasValidOptions($options) {\n    return !isset($options['h']) && isset($options['f']);\n  }\n\n  public function parseDataFile($file_name, $options) {\n    if (!file_exists($file_name)) {\n      throw new Exception(\n        \"ERROR: Unable to find/read file '$file_name'\\n\"\n      );\n    }\n    $fh = fopen($file_name, \"r\");\n    $header = null;\n    $entries = array();\n    $def_privacy_data = $this->getPrivacyDataFromOptions($options);\n    $def_description = (isset($options['d']))\n      ? $options['d']\n      : 'No description provided';\n    $def_tag = (isset($options['g'])) ? $options['g'] : '';\n    while (($row = fgetcsv($fh)) !== FALSE) {\n      if (!count($row) || (count($row) === 1 && !trim($row[0]))) {\n        continue; // skip empty rows / queries\n      }\n      if (strpos($row[0], '#') === 0) {\n        continue; // skip lines with comments\n      }\n\n      if (!$header) {\n        $header = $row;\n        continue;\n      }\n\n      $post_data = $this->getPostDataFromCSV(array_combine($header, $row));\n\n      // fold in the defaults provided\n      if (!isset($post_data['description'])) {\n        $post_data['description'] = $def_description;\n      }\n      if ($def_tag) {\n        $post_data['description'] = '['.$def_tag.'] '.$post_data['description'];\n      }\n      if (!isset($post_data['privacy_type']) && count($def_privacy_data) > 0) {\n        $post_data = array_merge($post_data, $def_privacy_data);\n      }\n\n      $entries[] = $post_data;\n    }\n    return $entries;\n  }\n\n  private function getPrivacyDataFromOptions($options) {\n    $privacy_data = array();\n    if (isset($options['p'])) {\n      switch(strtoupper(trim($options['p']))) {\n        case 'HAS_WHITELIST':\n        case 'WHITELIST':\n          $privacy_data['privacy_type'] = 'HAS_WHITELIST';\n          break;\n        default:\n          throw new Exception(\n            'You must set a privacy type!'\n          );\n          break;\n      }\n    }\n    if (isset($options['m'])) {\n      $privacy_data['privacy_members'] = $options['m'];\n    }\n    return $privacy_data;\n  }\n\n  public function buildAPIUploadRequest() {\n    $uri = ThreatExchangeConfig::FACEBOOK_SERVER.$this->getEndpoint().'/?';\n\n    // build the param array\n    $params = array (\n      'access_token' => ThreatExchangeConfig::getAccessToken(),\n    );\n    $param_str = http_build_query($params);\n    $uri .= $param_str;\n\n    return $uri;\n  }\n\n  public function getResultsAsCSV($results) {\n    $csv = \"# ThreatExchange Results - uploaded at \".strftime('%F %T (%z)').\n      \"\\nid,error\\n\";\n    foreach ($results as $result) {\n      $csv .= isset($result['id']) ? $result['id'] : 'NO_ID';\n      $csv .= ',';\n      $csv .= isset($result['error']) ? $result['error'] : 'OK';\n      $csv .= \"\\n\";\n    }\n    return $csv;\n  }\n}\n", "num_lines": 165}
{"repo_name": "ThreatExchange", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/*\n *  Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\nif (!defined('__ROOT__')) {\n  define('__ROOT__', realpath(dirname(__FILE__)));\n}\nrequire_once(__ROOT__.'/ThreatExchangeConfig.php');\nThreatExchangeConfig::init();\n\nfinal class IndicatorSearch extends BaseSearch {\n\n  public function getAdditionalOptions() {\n    return array (\n      'b' => 'type',\n      'o' => 'owner',\n      'r' => 'threat_type',\n    );\n  }\n\n  public function getEndpoint() {\n    return '/threat_descriptors';\n  }\n\n  public function getUsage() {\n    return \"\\t-b type of indicators to search for (optional, see API docs for \".\n        \"full list)\\n\".\n      \"\\t-m strict match the query string (optional)\\n\".\n      \"\\t-o the ThreatExchange ID of the owner (optional)\\n\".\n      \"\\t-r the threat type to search for (optional)\\n\".\n      \"\\t-q query string\\n\".\n      \"\\t-s beginning timestamp or date time string for a time windowed query\\n\".\n      \"\\t-u ending timestamp or date time string for a time windowed query\\n\";\n  }\n\n  public function getResultsAsCSV($results) {\n    $csv = \"# ThreatExchange Results - queried at \".strftime('%c').\"\\n\".\n      \"id,type,indicator,status,description,threat_type,owner,owner_name\\n\";\n    foreach ($results as $result) {\n      $row = array(\n        $result ['id'],\n\tisset ( $result ['indicator'] ) ? $result ['indicator'] ['type'] : '',\n\tisset ( $result ['indicator'] ) ? $result ['indicator'] ['indicator'] : '',\n\tisset ( $result ['status'] ) ? $result ['status'] : '',\n\tisset ( $result ['description'] ) ? $result ['description'] : '',\n\tisset ( $result ['threat_type'] ) ? $result ['threat_type'] : '',\n\tisset ( $result ['owner'] ) ? $result ['owner'] ['id'] : '',\n\tisset ( $result ['owner'] ) ? $result ['owner'] ['name'] : ''\n      );\n      $csv .= implode(',', $row).\"\\n\";\n    }\n    return $csv;\n  }\n}\n", "num_lines": 61}
{"repo_name": "ThreatExchange", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/*\n *  Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\nif (!defined('__ROOT__')) {\n  define('__ROOT__', realpath(dirname(__FILE__)));\n}\nrequire_once(__ROOT__.'/ThreatExchangeConfig.php');\nThreatExchangeConfig::init();\n\nfinal class IndicatorUpload extends BaseUpload {\n\n  public function getEndpoint() {\n    return '/threat_descriptors';\n  }\n\n  protected function getTypeSpecificFields() {\n    return array(\n      'expired_on',\n      'indicator',\n      'passwords',\n      'type',\n      'threat_type',\n    );\n  }\n\n  protected function getPostDataFromCSV($data_row) {\n    $post_data = array();\n    foreach ($this->getFields() as $field_name) {\n      if (isset($data_row[$field_name]) &&\n          $data_row[$field_name] !== '' &&\n          $data_row[$field_name] !== null) {\n        $post_data[$field_name] = $data_row[$field_name];\n      }\n    }\n    return $post_data;\n  }\n}\n", "num_lines": 45}
{"repo_name": "ThreatExchange", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/*\n *  Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\nif (!defined('__ROOT__')) {\n  define('__ROOT__', realpath(dirname(__FILE__)));\n}\nrequire_once(__ROOT__.'/ThreatExchangeConfig.php');\nThreatExchangeConfig::init();\n\n// Get the command line options\n$options = getopt('b:f:hmq:s:u:t:');\nif (!isset($options['t'])) {\n  echo print_usage();\n  exit(1);\n}\n\n// Load user details\n$app_id = ThreatExchangeConfig::getAppID();\n$app_secret = ThreatExchangeConfig::getAppSecret();\n\n$searcher = BaseSearch::getSearcher($options['t']);\nif (!$searcher->hasValidOptions($options)) {\n  echo print_usage().$searcher->getUsage();\n  exit(1);\n}\n\n// Build query sets\n$requests = array();\nif (isset($options['q']) ||\n    (isset($options['s']) && isset($options['u']))) {\n  $requests[] = $searcher->buildAPIRequest($options);\n} else if (isset($options['f'])) {\n  $queries = ThreatExchangeUtils::parseQueryFile($options['f']);\n  foreach ($queries as $query) {\n    $options['q'] = $query;\n    $requests[] = $searcher->buildAPIRequest($options);\n  }\n} else {\n  echo print_usage().$searcher->getUsage();\n  exit(1);\n}\n\n// make the requests via Curl\n$results = array();\nforeach ($requests as $request) {\n  try {\n    $raw_result = ThreatExchangeUtils::makeCurlRequest($request);\n    $json = json_decode(\n      $raw_result,\n      true,\n      512,\n      JSON_BIGINT_AS_STRING\n    );\n    if (isset($json['data'])) {\n      $results = array_merge($results, $json['data']);\n    }\n  } catch (Exception $e) {\n    echo $e->getMessage().\"\\n\";\n    exit(1);\n  }\n}\necho $searcher->getResultsAsCSV($results).\"\\n\";\n\nfunction print_usage() {\n  return \"usage: php threat_exchange/search/search.php\\n\".\n    \"\\t-t search type, one of: 'families', 'indicators', or 'malware'\\n\".\n    \"\\t-f query file (optional, use to bulk search instead of using -q)\\n\";\n}\n", "num_lines": 76}
{"repo_name": "ThreatExchange", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/*\n *  Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\nif (!defined('__ROOT__')) {\n  define('__ROOT__', realpath(dirname(__FILE__)));\n}\n\n/**\n * SET YOUR TX_APP_ID and TX_APP_SECRET ENV VARIABLES BEFORE CONTINUING!!!\n * VALUES FOR BOTH ARE AVAILABLE BY GOING TO\n * https://developers.facebook.com/apps/\n */\nclass ThreatExchangeConfig {\n\n  const FACEBOOK_SERVER = 'https://graph.facebook.com/v2.4';\n\n  private static $appID = 0;\n  private static $appSecret = null;\n\n  public static function getAppID() {\n    if (!self::$appID) {\n      throw new Exception(\n        'Set the TX_APP_ID environment variable before continuing!'\n      );\n    }\n    return self::$appID;\n  }\n\n  public static function getAppSecret() {\n    if (!self::$appSecret) {\n      throw new Exception(\n        'Set the TX_APP_SECRET environment variable before continuing!'\n      );\n    }\n    return self::$appSecret;\n  }\n\n  public static function getAccessToken() {\n    return self::getAppID().'|'.self::getAppSecret();\n  }\n\n  public static function init() {\n    // bootstraping method, forces call to __autoload()\n\n    // load credentials from system environment variables\n    self::$appID = $_ENV['TX_APP_ID'];\n    self::$appSecret = $_ENV['TX_APP_SECRET'];\n  }\n}\n\n/**\n * Handles auto-loading of PHP classes\n *\n * @see http://us1.php.net/manual/en/language.oop5.autoload.php\n */\nfunction __autoload($class) {\n  $dirs = array (\n      __ROOT__,\n      __ROOT__.'/search',\n  );\n\n  foreach ($dirs as $dir) {\n    if (file_exists($dir.'/'.$class.'.php')) {\n      require_once($dir.'/'.$class.'.php');\n      return;\n    }\n  }\n  throw new Exception('ERROR: Unable to load '.$class.' make sure the '.\n    'directory where the class resides is listed in __autoload() in '.\n    __ROOT__.'/'.__FILE__\n  );\n}\n", "num_lines": 80}
{"repo_name": "ThreatExchange", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/*\n *  Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\nif (!defined('__ROOT__')) {\n  define('__ROOT__', realpath(dirname(__FILE__)));\n}\nrequire_once(__ROOT__.'/ThreatExchangeConfig.php');\nThreatExchangeConfig::init();\n\nclass ThreatExchangeUtils {\n\n  private static $debugMode = false;\n\n  public static function setDebugMode($debug_mode) {\n    self::$debugMode = $debug_mode;\n  }\n\n  public static function isDebugMode() {\n    return self::$debugMode;\n  }\n\n  /**\n   * @throws Exceptions\n   */\n  public static function parseQueryFile($query_file) {\n    if (!file_exists($query_file)) {\n      throw new Exception(\n        \"ERROR: Unable to find/read query file '$query_file'\\n\"\n      );\n    }\n    $fh = fopen($query_file, \"r\");\n    $queries = array();\n    while (($row = fgetcsv($fh)) !== FALSE) {\n      if (!count($row) || (count($row) === 1 && !trim($row[0]))) {\n        continue; // skip empty rows / queries\n      }\n      if (strpos($row[0], '#') === 0) {\n        continue; // skip lines with comments\n      }\n      $queries[] = trim($row[0]);\n    }\n    return $queries;\n  }\n\n  /**\n   * @throws Exception\n   */\n  public static function makeCurlRequest($uri) {\n    $curler = curl_init($uri);\n    curl_setopt($curler, CURLOPT_RETURNTRANSFER, true);\n    $raw_json = curl_exec($curler);\n    self::checkCurlResults($curler, $raw_json);\n    curl_close($curler);\n\n    if (self::isDebugMode()) {\n      $json_ar = json_decode($json_string, true /* assoc array */);\n      self::debugPrettyPrint($json_ar);\n    }\n    return $raw_json;\n  }\n\n  /**\n   * @throws Exception\n   */\n  public static function makeCurlPostRequest($uri, $post_data) {\n    $curler = curl_init($uri);\n    curl_setopt($curler, CURLOPT_POST, true);\n    curl_setopt($curler, CURLOPT_POSTFIELDS, http_build_query($post_data));\n    curl_setopt($curler, CURLOPT_RETURNTRANSFER, true);\n    $raw_json = curl_exec($curler);\n    self::checkCurlResults($curler, $raw_json);\n    curl_close($curler);\n\n    if (self::isDebugMode()) {\n      $json_ar = json_decode($raw_json, true /* assoc array */);\n      self::debugPrettyPrint($json_ar);\n    }\n    return $raw_json;\n  }\n\n  /**\n   * @throws Exception\n   */\n  protected function checkCurlResults($curler, $results) {\n    $return_code = curl_getinfo($curler, CURLINFO_HTTP_CODE);\n    if ($return_code !== 200) {\n      throw new Exception(\n        \"CURL ERROR: $return_code, \".\n        curl_error($curler).' - '.\n        $results\n      );\n    }\n  }\n\n  public static function debugPrettyPrint($object) {\n    var_dump($object);\n  }\n\n}\n", "num_lines": 107}
{"repo_name": "ThreatExchange", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n/*\n *  Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\nif (!defined('__ROOT__')) {\n  define('__ROOT__', realpath(dirname(__FILE__)));\n}\nrequire_once(__ROOT__.'/ThreatExchangeConfig.php');\nThreatExchangeConfig::init();\n\n// Get the command line options\n$options = getopt('d:f:g:hm:p:t:');\nif (isset($options['h']) || !isset($options['t'])) {\n  echo print_usage();\n  exit(1);\n}\n\n// Load user details\n$app_id = ThreatExchangeConfig::getAppID();\n$app_secret = ThreatExchangeConfig::getAppSecret();\n\n$uploader = BaseUpload::getUploader($options['t']);\nif (!$uploader->hasValidOptions($options)) {\n  echo print_usage().$uploader->getUsage();\n  exit(1);\n}\n\n// Build POST data sets\n$entries = $uploader->parseDataFile($options['f'], $options);\n\n// make the requests via Curl\n$results = array();\nforeach ($entries as $request_uri => $post_data) {\n  try {\n    echo \"Calling $request_uri with \".implode(',',$post_data).\"\\n\";\n    $raw_result = ThreatExchangeUtils::makeCurlPostRequest(\n      $uploader->buildAPIUploadRequest(),\n      $post_data\n    );\n    $json = json_decode(\n      $raw_result,\n      true,\n      512,\n      JSON_BIGINT_AS_STRING\n    );\n    $results[] = $json;\n  } catch (Exception $e) {\n    echo $e->getMessage().\"\\n\";\n  }\n}\necho $uploader->getResultsAsCSV($results).\"\\n\";\n\nfunction print_usage() {\n  return \"usage: php threat_exchange/upload.php\\n\".\n    \"\\t-t upload type, one of: 'families', 'indicators', or 'malware'\\n\".\n    BaseUpload::getUsage();\n}\n", "num_lines": 64}
{"repo_name": "ThreatExchange", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n\n// ================================================================\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n// ================================================================\n\n/**\n * A PDQ hash is simply 256 bits. The only string representation is 64 hex\n * digits. Bit-ordering is a concern, but is a non-issue as long as the\n * to-string and from-string methods in this class are consistent.\n */\n\nclass PDQHash {\n  const PDQHASH_NUM_SLOTS = 16;\n  const PDQHASH_HEX_LENGTH = 64;\n\n  // 16 16-bit words: sliced this way for mutually indexed hashing (MIH).\n  private $slots = array();\n\n  /**\n   * The constructor is private since the only valid representation is\n   * hex-string. Yet we have a PDQHash class, not just strings, due to lessons\n   * learned from other projects. Separating ser/des format (string) from\n   * internal representation helps avoid false negatives.\n   */\n  private function __construct() {\n  }\n\n  public static function makeZeroesHash() {\n    $hash = new PDQHash();\n    for ($i = 0; $i < self::PDQHASH_NUM_SLOTS; $i++) {\n      $hash->slots[$i] = 0;\n    }\n    return $hash;\n  }\n\n  /**\n   * Creates a new instance of the hash from a hexadecimal-formatted PDQ\n   * hash string. Throws MalformedPDQHashException for improperly\n   * formatted hashes.\n   *\n   * @param hex_string string representation of the hash in 'hex' format.\n   * @return PDQHash newly created hash.\n   * @throws MalformedPDQHashException if the given hash is not valid.\n   */\n\n  public static function fromHexString(\n    /*string*/ $hex_string\n  )/*: PDQHash*/ {\n    if (strlen($hex_string) !== self::PDQHASH_HEX_LENGTH) {\n      throw new MalformedPDQHashException(\n        $hex_string,\n        sprintf(\n          'Expected hash to have length %d, received hash with length %d',\n          self::PDQHASH_HEX_LENGTH,\n          strlen($hex_string)\n        )\n      );\n    }\n\n    $hash = new PDQHash();\n\n    try {\n      // Unpack goes 1-up not 0-up\n      $slots = unpack('n*', hex2bin($hex_string));\n\n    } catch (ErrorException $_) {\n      throw new MalformedPDQHashException(\n        $hex_string,\n        'Length is 64 but is not pure hexadecimal.'\n      );\n    }\n\n    $hash->slots = array();\n    $k = self::PDQHASH_NUM_SLOTS - 1;\n    foreach ($slots as $slot) {\n      $hash->slots[$k] = $slot;\n      $k--;\n    }\n\n    return $hash;\n  }\n\n  public function toHexString() {\n    $string = \"\";\n    for ($i = self::PDQHASH_NUM_SLOTS - 1; $i >= 0; $i--) {\n      // dechex doesn't zero-pad\n      $string .= sprintf(\"%04x\", $this->slots[$i]);\n    }\n    return $string;\n  }\n\n  public function to64BitStrings() {\n    $strings = array();\n    for ($i = self::PDQHASH_NUM_SLOTS - 1; $i >= 0; $i-=4) {\n      $strings[] =\n        sprintf(\"%04x\", $this->slots[$i]) .\n        sprintf(\"%04x\", $this->slots[$i-1]) .\n        sprintf(\"%04x\", $this->slots[$i-2]) .\n        sprintf(\"%04x\", $this->slots[$i-3]);\n    }\n    return $strings;\n  }\n  public function to32BitStrings() {\n    $strings = array();\n    for ($i = self::PDQHASH_NUM_SLOTS - 1; $i >= 0; $i-=2) {\n      $strings[] =\n        sprintf(\"%04x\", $this->slots[$i]) .\n        sprintf(\"%04x\", $this->slots[$i-1]);\n    }\n    return $strings;\n  }\n  public function to16BitStrings() {\n    $strings = array();\n    for ($i = self::PDQHASH_NUM_SLOTS - 1; $i >= 0; $i--) {\n      $strings[] = sprintf(\"%04x\", $this->slots[$i]);\n    }\n    return $strings;\n  }\n\n  public function setBit(/*int*/ $bit_index) {\n    $slot_index = (int)($bit_index / self::PDQHASH_NUM_SLOTS);\n    $slot_bit_index = (int)($bit_index % self::PDQHASH_NUM_SLOTS);\n    $this->slots[$slot_index] |= 1 << $slot_bit_index;\n  }\n\n  /**\n   * The Hamming distance between this hash and another.\n   *\n   * @param The hash to compare this hash to.\n   * @return int\n   */\n  public function hammingDistanceTo(PDQHash $that) /*: int*/ {\n    $sum = 0;\n    for ($i = 0; $i < self::PDQHASH_NUM_SLOTS; $i++) {\n      $sum += self::popCount16($this->slots[$i] ^ $that->slots[$i]);\n    }\n    return $sum;\n  }\n\n  public function isWithinHammingDistanceOf(\n    /*PDQHash*/ $that,\n    /*int*/ $threshold\n  )/*: bool*/ {\n    $current = 0;\n    for ($i = 0; $i < self::PDQHASH_NUM_SLOTS; $i++) {\n      $current += self::popCount16($this->slots[$i] ^ $that->slots[$i]);\n      if ($current > $threshold) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  public function hammingNorm()/*: int*/ {\n    $sum = 0;\n    for ($i = 0; $i < self::PDQHASH_NUM_SLOTS; $i++) {\n      $sum += self::popCount16($this->slots[$i]);\n    }\n    return $sum;\n  }\n\n  private static function popCount16(/*int */$n)/*: int*/ {\n    $n -= (($n >> 1) & 0x5555);\n    $n = ((($n >> 2) & 0x3333) + ($n & 0x3333));\n    $n = ((($n >> 4) + $n) & 0x0f0f);\n    $n += ($n >> 8);\n    return($n & 0x1f);\n  }\n\n  private static function popCount16Slow(/*int */$n)/*: int*/ {\n    $count = 0;\n    for ($count = 0; $n != 0; $count++, $n &= $n-1) { }\n    return $count;\n  }\n\n} // class PDQHash\n", "num_lines": 178}
{"repo_name": "ThreatExchange", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n\n// ================================================================\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n// ================================================================\n\n// ================================================================\n// This file is bottom-up: more detailed methods at the top, main\n// entry points at the bottom. Namely:\n//\n// * computeHashAndQualityFromFilename:\n//   Returns an array of PDQHash object and integer 0-100 quality.\n//\n// * computeHashesAndQualityFromFilename:\n//   Returns an array of [array of eight PDQHash objects keyed by rotation/flip\n//   name] and integer 0-100 quality.\n//\n// These first two are pure-PHP. The downsample phase is the most expensive\n// part of PDQ, so these use the GD library to downsample first.\n//\n// * computeStringHashAndQualityFromFilenameUsingExtension:\n//   Returns an array of hex-string hash and integer 0-100 quality.\n//\n// * computeStringHashesAndQualityFromFilenameUsingExtension\n//   Returns array of [array of eight hex-string hashes keyed by rotation/flip\n//   name] and integer 0-100 quality.\n//\n// These last two use a C-language Zend extension to do most of the work.\n// ================================================================\n\nrequire 'pdqhash.php';\n\nclass PDQHasher {\n    const LUMA_FROM_R_COEFF = 0.299;\n    const LUMA_FROM_G_COEFF = 0.587;\n    const LUMA_FROM_B_COEFF = 0.114;\n\n    const PDQ_JAROSZ_WINDOW_SIZE_DIVISOR = 128;\n    const PDQ_NUM_JAROSZ_XY_PASSES = 2;\n\n    // Hashes for various dihedral transformations of the image.\n    // Note, you can also transform the image and hash that.\n    const DIH_ORIGINAL     = 0x01;\n    const DIH_ROTATE_90    = 0x02;\n    const DIH_ROTATE_180   = 0x04;\n    const DIH_ROTATE_270   = 0x08;\n    const DIH_FLIP_X       = 0x10;\n    const DIH_FLIP_Y       = 0x20;\n    const DIH_FLIP_PLUS_1  = 0x40;\n    const DIH_FLIP_MINUS_1 = 0x80;\n    const DIH_ALL          = 0xff;\n\n  // ----------------------------------------------------------------\n  // Handles greyscale or RGB.\n  //\n  // It's not obvious (to me) which is which: for JPEG the channel count is\n  // available from getimagesize() while for PNG it isn't.\n  //\n  // But it doesn't matter due to how PHP handles pixels: for RGB the triples\n  // are OR'ed into a 24-bit value while for greyscale they're the lower 8\n  // bits. So we get greyscale as 'blue', multiplied by an arbitrary scaling\n  // coefficient which doesn't affect the median property of the DCT output.\n\n  static function imageToLumaMatrix(\n    $image, // resource\n    $num_rows,\n    $num_cols\n  ) {\n    $luma_matrix = array();\n    for ($i = 0; $i < $num_rows; $i++) {\n      $row = array();\n      for ($j = 0; $j < $num_cols; $j++) {\n        $pixel = imagecolorat($image, $j, $i);\n        $r = $pixel >> 16;\n        $g = ($pixel >> 8) & 0xff;\n        $b = $pixel & 0xff;\n        $y = self::LUMA_FROM_R_COEFF * $r\n           + self::LUMA_FROM_G_COEFF * $g\n           + self::LUMA_FROM_B_COEFF * $b;\n        $row[$j] = $y;\n      }\n      $luma_matrix[$i] = $row;\n    }\n    return $luma_matrix;\n  }\n\n  // ================================================================\n  // Wojciech Jarosz 'Fast Image Convolutions' ACM SIGGRAPH 2001:\n  // X,Y,X,Y passes of 1-D box filters produces a 2D tent filter.\n  //\n  // Since PDQ uses 64x64 blocks, 1/64th of the image height/width respectively is\n  // a full block. But since we use two passes, we want half that window size per\n  // pass. Example: 1024x1024 full-resolution input. PDQ downsamples to 64x64.\n  // Each 16x16 block of the input produces a single downsample pixel.  X,Y passes\n  // with window size 8 (= 1024/128) average pixels with 8x8 neighbors. The second\n  // X,Y pair of 1D box-filter passes accumulate data from all 16x16.\n\n  // ----------------------------------------------------------------\n  static function computeJaroszFilterWindowSize(\n    $dimension\n  ) {\n\n    return (int)(($dimension + self::PDQ_JAROSZ_WINDOW_SIZE_DIVISOR - 1)\n      / self::PDQ_JAROSZ_WINDOW_SIZE_DIVISOR);\n  }\n\n  // ----------------------------------------------------------------\n  // 7 and 4\n  //\n  //    0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1\n  //    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5\n  //\n  //    .                                PHASE 1: ONLY ADD, NO WRITE, NO SUBTRACT\n  //    . .\n  //    . . .\n  //\n  //  0 * . . .                          PHASE 2: ADD, WRITE, WITH NO SUBTRACTS\n  //  1 . * . . .\n  //  2 . . * . . .\n  //  3 . . . * . . .\n  //\n  //  4   . . . * . . .                  PHASE 3: WRITES WITH ADD & SUBTRACT\n  //  5     . . . * . . .\n  //  6       . . . * . . .\n  //  7         . . . * . . .\n  //  8           . . . * . . .\n  //  9             . . . * . . .\n  // 10               . . . * . . .\n  // 11                 . . . * . . .\n  // 12                   . . . * . . .\n  //\n  // 13                     . . . * . .  PHASE 4: FINAL WRITES WITH NO ADDS\n  // 14                       . . . * .\n  // 15                         . . . *\n  //\n  //         = 0                                     =  0   PHASE 1\n  //         = 0+1                                   =  1\n  //         = 0+1+2                                 =  3\n  //\n  // out[ 0] = 0+1+2+3                               =  6   PHASE 2\n  // out[ 1] = 0+1+2+3+4                             = 10\n  // out[ 2] = 0+1+2+3+4+5                           = 15\n  // out[ 3] = 0+1+2+3+4+5+6                         = 21\n  //\n  // out[ 4] =   1+2+3+4+5+6+7                       = 28   PHASE 3\n  // out[ 5] =     2+3+4+5+6+7+8                     = 35\n  // out[ 6] =       3+4+5+6+7+8+9                   = 42\n  // out[ 7] =         4+5+6+7+8+9+10                = 49\n  // out[ 8] =           5+6+7+8+9+10+11             = 56\n  // out[ 9] =             6+7+8+9+10+11+12          = 63\n  // out[10] =               7+8+9+10+11+12+13       = 70\n  // out[11] =                 8+9+10+11+12+13+14    = 77\n  // out[12] =                   9+10+11+12+13+14+15 = 84\n  //\n  // out[13] =                     10+11+12+13+14+15 = 75  PHASE 4\n  // out[14] =                        11+12+13+14+15 = 65\n  // out[15] =                           12+13+14+15 = 54\n  // ----------------------------------------------------------------\n\n  // ----------------------------------------------------------------\n  // 8 and 5\n  //\n  //    0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1\n  //    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5\n  //\n  //    .                                PHASE 1: ONLY ADD, NO WRITE, NO SUBTRACT\n  //    . .\n  //    . . .\n  //    . . . .\n  //\n  //  0 * . . . .                        PHASE 2: ADD, WRITE, WITH NO SUBTRACTS\n  //  1 . * . . . .\n  //  2 . . * . . . .\n  //  3 . . . * . . . .\n  //\n  //  4   . . . * . . . .                PHASE 3: WRITES WITH ADD & SUBTRACT\n  //  5     . . . * . . . .\n  //  6       . . . * . . . .\n  //  7         . . . * . . . .\n  //  8           . . . * . . . .\n  //  9             . . . * . . . .\n  // 10               . . . * . . . .\n  // 11                 . . . * . . . .\n  //\n  // 12                   . . . * . . .  PHASE 4: FINAL WRITES WITH NO ADDS\n  // 13                     . . . * . .\n  // 14                       . . . * .\n  // 15                         . . . *\n  //\n  //         = 0                                     =  0   PHASE 1\n  //         = 0+1                                   =  1\n  //         = 0+1+2                                 =  3\n  //         = 0+1+2+3                               =  6\n  //\n  // out[ 0] = 0+1+2+3+4                             = 10\n  // out[ 1] = 0+1+2+3+4+5                           = 15\n  // out[ 2] = 0+1+2+3+4+5+6                         = 21\n  // out[ 3] = 0+1+2+3+4+5+6+7                       = 28\n  //\n  // out[ 4] =   1+2+3+4+5+6+7+8                     = 36   PHASE 3\n  // out[ 5] =     2+3+4+5+6+7+8+9                   = 44\n  // out[ 6] =       3+4+5+6+7+8+9+10                = 52\n  // out[ 7] =         4+5+6+7+8+9+10+11             = 60\n  // out[ 8] =           5+6+7+8+9+10+11+12          = 68\n  // out[ 9] =             6+7+8+9+10+11+12+13       = 76\n  // out[10] =               7+8+9+10+11+12+13+14    = 84\n  // out[11] =                 8+9+10+11+12+13+14+15 = 92\n  //\n  // out[12] =                   9+10+11+12+13+14+15 = 84  PHASE 4\n  // out[13] =                     10+11+12+13+14+15 = 75  PHASE 4\n  // out[14] =                        11+12+13+14+15 = 65\n  // out[15] =                           12+13+14+15 = 54\n  // ----------------------------------------------------------------\n\n  // ----------------------------------------------------------------\n  static function boxAlongCols(\n    &$in_image, // 2D array of float\n    &$out_image, // 2D array of float\n    $num_rows,\n    $num_cols,\n    $window_size\n  ) {\n    for ($j = 0; $j < $num_cols; $j++) {\n      $half_window_size = (int)(($window_size + 2) / 2); // 7->4, 8->5\n\n      $phase_1_nreps = $half_window_size - 1;\n      $phase_2_nreps = $window_size - $half_window_size + 1;\n      $phase_3_nreps = $num_rows - $window_size;\n      $phase_4_nreps = $half_window_size - 1;\n\n      $li = 0; // Index of left edge of read window, for subtracts\n      $ri = 0; // Index of right edge of read windows, for adds\n      $oi = 0; // Index into output vector\n\n      $sum = 0.0;\n      $current_window_size = 0;\n\n      // PHASE 1: ACCUMULATE FIRST SUM NO WRITES\n      for ($k = 0; $k < $phase_1_nreps; $k++) {\n        $sum += $in_image[$ri][$j];\n        $current_window_size++;\n        $ri++;\n      }\n\n      // PHASE 2: INITIAL WRITES WITH SMALL WINDOW\n      for ($k = 0; $k < $phase_2_nreps; $k++) {\n        $sum += $in_image[$ri][$j];\n        $current_window_size++;\n        $out_image[$oi][$j] = $sum / $current_window_size;\n        $ri++;\n        $oi++;\n      }\n\n      // PHASE 3: WRITES WITH FULL WINDOW\n      for ($k = 0; $k < $phase_3_nreps; $k++) {\n        $sum += $in_image[$ri][$j];\n        $sum -= $in_image[$li][$j];\n        $out_image[$oi][$j] = $sum / $current_window_size;\n        $li++;\n        $ri++;\n        $oi++;\n      }\n\n      // PHASE 4: FINAL WRITES WITH SMALL WINDOW\n      for ($k = 0; $k < $phase_4_nreps; $k++) {\n        $sum -= $in_image[$li][$j];\n        $current_window_size--;\n        $out_image[$oi][$j] = $sum / $current_window_size;\n        $li++;\n        $oi++;\n      }\n    }\n  }\n\n  static function boxAlongRows(\n    &$in_image, // 2D array of float\n    &$out_image, // 2D array of float\n    $num_rows,\n    $num_cols,\n    $window_size\n  ) {\n    for ($i = 0; $i < $num_rows; $i++) {\n      $half_window_size = (int)(($window_size + 2) / 2); // 7->4, 8->5\n\n      $phase_1_nreps = $half_window_size - 1;\n      $phase_2_nreps = $window_size - $half_window_size + 1;\n      $phase_3_nreps = $num_cols - $window_size;\n      $phase_4_nreps = $half_window_size - 1;\n\n      $li = 0; // Index of left edge of read window, for subtracts\n      $ri = 0; // Index of right edge of read windows, for adds\n      $oi = 0; // Index into output vector\n\n      $sum = 0.0;\n      $current_window_size = 0;\n\n      // PHASE 1: ACCUMULATE FIRST SUM NO WRITES\n      for ($k = 0; $k < $phase_1_nreps; $k++) {\n        $sum += $in_image[$i][$ri];\n        $current_window_size++;\n        $ri++;\n      }\n\n      // PHASE 2: INITIAL WRITES WITH SMALL WINDOW\n      for ($k = 0; $k < $phase_2_nreps; $k++) {\n        $sum += $in_image[$i][$ri];\n        $current_window_size++;\n        $out_image[$i][$oi] = $sum / $current_window_size;\n        $ri++;\n        $oi++;\n      }\n\n      // PHASE 3: WRITES WITH FULL WINDOW\n      for ($k = 0; $k < $phase_3_nreps; $k++) {\n        $sum += $in_image[$i][$ri];\n        $sum -= $in_image[$i][$li];\n        $out_image[$i][$oi] = $sum / $current_window_size;\n        $li++;\n        $ri++;\n        $oi++;\n      }\n\n      // PHASE 4: FINAL WRITES WITH SMALL WINDOW\n      for ($k = 0; $k < $phase_4_nreps; $k++) {\n        $sum -= $in_image[$i][$li];\n        $current_window_size--;\n        $out_image[$i][$oi] = $sum / $current_window_size;\n        $li++;\n        $oi++;\n      }\n    }\n  }\n\n  // ----------------------------------------------------------------\n  static function jaroszFilter(\n    &$luma_matrix, // 2D array of float\n    $num_rows,\n    $num_cols,\n    $window_size_along_rows,\n    $window_size_along_cols\n  ) {\n\n    $other_matrix = array();\n    for ($i = 0; $i < $num_rows; $i++) {\n      $row = array();\n      for ($j = 0; $j < $num_cols; $j++) {\n        $row[$j] = 0;\n      }\n      $other_matrix[$i] = $row;\n    }\n\n    for ($k = 0; $k < self::PDQ_NUM_JAROSZ_XY_PASSES; $k++) {\n      self::boxAlongRows($luma_matrix, $other_matrix, $num_rows, $num_cols, $window_size_along_rows);\n      self::boxAlongCols($other_matrix, $luma_matrix, $num_rows, $num_cols, $window_size_along_cols);\n    }\n\n  }\n\n  // ================================================================\n  // This is all heuristic (see the PDQ hashing doc). Quantization matters since\n  // we want to count *significant* gradients, not just the some of many small\n  // ones. The constants are all manually selected, and tuned as described in the\n  // document.\n  static function computeImageDomainQualityMetric(\n    &$buffer_64x64\n  ) {\n    $int_gradient_sum = 0;\n\n    for ($i = 0; $i < 63; $i++) {\n      for ($j = 0; $j < 64; $j++) {\n        $u = $buffer_64x64[$i][$j];\n        $v = $buffer_64x64[$i+1][$j];\n        $d = (int)((($u - $v) * 100) / 255);\n        $int_gradient_sum += (int)abs($d);\n      }\n    }\n    for ($i = 0; $i < 64; $i++) {\n      for ($j = 0; $j < 63; $j++) {\n        $u = $buffer_64x64[$i][$j];\n        $v = $buffer_64x64[$i][$j+1];\n        $$d = (int)((($u - $v) * 100) / 255);\n        $int_gradient_sum += (int)abs($d);\n      }\n    }\n\n    // Heuristic scaling factor.\n    $quality = (int)($int_gradient_sum / 90);\n    if ($quality > 100) {\n      $quality = 100;\n    }\n\n    return $quality;\n  }\n\n  // ================================================================\n  // Full 64x64 to 64x64 can be optimized e.g. the Lee algorithm.  But here we\n  // only want slots (1-16)x(1-16) of the full 64x64 output. Careful experiments\n  // showed that using Lee along all 64 slots in one dimension, then Lee along 16\n  // slots in the second, followed by extracting slots 1-16 of the output, was\n  // actually slower than the current implementation which is completely\n  // non-clever/non-Lee but computes only what is needed.\n\n  static function computeDCT64To16(\n    &$buffer_64x64,\n    &$buffer_16x64,\n    &$buffer_16x16,\n    &$dct_16x64\n  ) {\n    // A = buffer_64x64\n    // T = buffer_16x64\n    // B = buffer_16x16\n    // D = DCT matrix\n\n    // 2D DCT:\n    //   B = D A Dt\n    // Split out into first product and second:\n    //   B = (D A) Dt ; T = D A\n\n    for ($i = 0; $i < 16; $i++) {\n      for ($j = 0; $j < 64; $j++) {\n        $sumk = 0.0;\n        for ($k = 0; $k < 64; $k++) {\n          $sumk += $dct_16x64[$i][$k] * $buffer_64x64[$k][$j];\n        }\n        $buffer_16x64[$i][$j] = $sumk;\n      }\n    }\n\n    for ($i = 0; $i < 16; $i++) {\n      for ($j = 0; $j < 16; $j++) {\n        $sumk = 0.0;\n          // sumk += T[i][k] * D[j][k];\n        for ($k = 0; $k < 64; $k++) {\n          $sumk += $buffer_16x64[$i][$k] * $dct_16x64[$j][$k];\n        }\n        $buffer_16x16[$i][$j] = $sumk;\n      }\n    }\n  }\n\n  // ----------------------------------------------------------------\n  // orig      rot90     rot180    rot270\n  // noxpose   xpose     noxpose   xpose\n  // + + + +   - + - +   + - + -   - - - -\n  // + + + +   - + - +   - + - +   + + + +\n  // + + + +   - + - +   + - + -   - - - -\n  // + + + +   - + - +   - + - +   + + + +\n  //\n  // flipx     flipy     flipplus  flipminus\n  // noxpose   noxpose   xpose     xpose\n  // - - - -   - + - +   + + + +   + - + -\n  // + + + +   - + - +   + + + +   - + - +\n  // - - - -   - + - +   + + + +   + - + -\n  // + + + +   - + - +   + + + +   - + - +\n\n  static function dct16OriginalToRotate90(&$A, &$B) {\n    for ($i = 0; $i < 16; $i++) {\n      for ($j = 0; $j < 16; $j++) {\n        if ($j & 1) {\n          $B[$j][$i] = $A[$i][$j];\n        } else {\n          $B[$j][$i] = -$A[$i][$j];\n        }\n      }\n    }\n  }\n\n  static function dct16OriginalToRotate180(&$A, &$B) {\n    for ($i = 0; $i < 16; $i++) {\n      for ($j = 0; $j < 16; $j++) {\n        if (($i+$j) & 1) {\n          $B[$i][$j] = -$A[$i][$j];\n        } else {\n          $B[$i][$j] = $A[$i][$j];\n        }\n      }\n    }\n  }\n\n  static function dct16OriginalToRotate270(&$A, &$B) {\n    for ($i = 0; $i < 16; $i++) {\n      for ($j = 0; $j < 16; $j++) {\n        if ($i & 1) {\n          $B[$j][$i] = $A[$i][$j];\n        } else {\n          $B[$j][$i] = -$A[$i][$j];\n        }\n      }\n    }\n  }\n\n  static function dct16OriginalToFlipX(&$A, &$B) {\n    for ($i = 0; $i < 16; $i++) {\n      for ($j = 0; $j < 16; $j++) {\n        if ($i & 1) {\n          $B[$i][$j] = $A[$i][$j];\n        } else {\n          $B[$i][$j] = -$A[$i][$j];\n        }\n      }\n    }\n  }\n\n  static function dct16OriginalToFlipY(&$A, &$B) {\n    for ($i = 0; $i < 16; $i++) {\n      for ($j = 0; $j < 16; $j++) {\n        if ($j & 1) {\n          $B[$i][$j] = $A[$i][$j];\n        } else {\n          $B[$i][$j] = -$A[$i][$j];\n        }\n      }\n    }\n  }\n\n  static function dct16OriginalToFlipPlus1(&$A, &$B) {\n    for ($i = 0; $i < 16; $i++) {\n      for ($j = 0; $j < 16; $j++) {\n        $B[$j][$i] = $A[$i][$j];\n      }\n    }\n  }\n\n  static function dct16OriginalToFlipMinus1(&$A, &$B) {\n    for ($i = 0; $i < 16; $i++) {\n      for ($j = 0; $j < 16; $j++) {\n        if (($i+$j) & 1) {\n          $B[$j][$i] = -$A[$i][$j];\n        } else {\n          $B[$j][$i] = $A[$i][$j];\n        }\n      }\n    }\n  }\n\n  // ----------------------------------------------------------------\n  static function computeHashFromDCTOutput(\n    &$buffer_16x16\n  ) {\n    $flat_matrix = array();\n    for ($k = 0, $i = 0; $i < 16; $i++) {\n      for ($j = 0; $j < 16; $j++, $k++) {\n        $flat_matrix[$k] = $buffer_16x16[$i][$j];\n      }\n    }\n\n    sort($flat_matrix);\n    //print_r($flat_matrix);\n\n    $median = $flat_matrix[127];\n    //echo \"median=$median\\n\";\n\n    $hash = PDQHash::makeZeroesHash();\n    for ($k = 0, $i = 0; $i < 16; $i++) {\n      for ($j = 0; $j < 16; $j++, $k++) {\n        $value = $buffer_16x16[$i][$j];\n        if ($value > $median) {\n          $hash->setBit($k);\n        }\n      }\n    }\n\n    return $hash;\n  }\n\n  // ================================================================\n  static function readImageFromFilename($filename, $downsample_first) {\n    $is_jpeg = false;\n    if (substr_compare($filename,'.jpg', -strlen('.jpg')) === 0) {\n      $orig_image = imagecreatefromjpeg($filename);\n      $is_jpeg = true;\n    } else if (substr_compare($filename,'.jpeg', -strlen('.jpeg')) === 0) {\n      $orig_image = imagecreatefromjpeg($filename);\n      $is_jpeg = true;\n    } else if (substr_compare($filename,'.png', -strlen('.png')) === 0) {\n      $orig_image = imagecreatefrompng($filename);\n    } else {\n      throw new Exception('PDQHasher: could not handle filetype of '.$filename);\n    }\n\n    // The pure-PHP hasher is *really* slow in pure PHP for megapixel images.\n    // So, downsample first. Don't worry about aspect ratio since PDQ will\n    // squarify anyway. For extension use, don't downsample here as it's\n    // redundant.\n    if ($downsample_first) {\n      $orig_height = imagesy($orig_image);\n      $orig_width = imagesx($orig_image);\n      if ($orig_height > 128 || $orig_width > 128) {\n        $image = imagecreatetruecolor(128, 128);\n        imagecopyresampled($image, $orig_image, 0, 0, 0, 0, 128, 128, $orig_width, $orig_height);\n      } else {\n        $image = $orig_image;\n      }\n    } else {\n      $image = $orig_image;\n    }\n\n// NOTE: the PDQ hashes within ThreatExchange aren't respecting EXIF rotation tags\n// so we should likewise ignore them.\n//\n//    if ($is_jpeg) {\n//      $exif = exif_read_data($filename);\n//      if (!empty($exif['Orientation'])) {\n//        switch ($exif['Orientation']) {\n//        case 3:\n//          $image = imagerotate($image, 180, 0);\n//          break;\n//        case 6:\n//          $image = imagerotate($image, -90, 0);\n//          break;\n//        case 8:\n//          $image = imagerotate($image, 90, 0);\n//          break;\n//        }\n//      }\n//    }\n\n    return $image;\n  }\n\n  // ================================================================\n  static function computeDCTAndQualityFromImage(\n    /*resource*/&$image,\n    /*bool*/ $show_timings,\n    /*bool*/ $dump\n  ) {\n    $num_rows = imagesy($image);\n    $num_cols = imagesx($image);\n    if ($dump) {\n      echo \"num_rows=$num_rows\\n\";\n      echo \"num_cols=$num_cols\\n\";\n    }\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    // RGB to luma\n    $t1 = microtime(true);\n    $luma_matrix = self::imageToLumaMatrix($image, $num_rows, $num_cols);\n    $t2 = microtime(true);\n    if ($show_timings) {\n      printf(\"X010-LUMA %.6f\\n\", $t2-$t1);\n    }\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    // Downsample (blur and decimate)\n    $t1 = microtime(true);\n    $window_size_along_rows = self::computeJaroszFilterWindowSize($num_cols);\n    $window_size_along_cols = self::computeJaroszFilterWindowSize($num_rows);\n    self::jaroszFilter($luma_matrix, $num_rows, $num_cols, $window_size_along_rows, $window_size_along_cols);\n    $t2 = microtime(true);\n    if ($show_timings) {\n      printf(\"X020-JRSZ %.6f\\n\", $t2-$t1);\n    }\n\n    // Decimation per se. Target centers not corners.\n    $buffer_64x64 = array();\n    for ($i = 0; $i < 64; $i++) {\n      $row = array();\n      for ($j = 0; $j < 64; $j++) {\n        $row[$j] = 0;\n      }\n      $buffer_64x64[$i] = $row;\n    }\n    $t1 = microtime(true);\n    for ($i = 0; $i < 64; $i++) {\n      $ini = (int)((($i + 0.5) * $num_rows) / 64);\n      for ($j = 0; $j < 64; $j++) {\n        $inj = (int)((($j + 0.5) * $num_cols) / 64);\n        $buffer_64x64[$i][$j] = $luma_matrix[$ini][$inj];\n      }\n    }\n    $t2 = microtime(true);\n    if ($dump) {\n      echo \"DOWNSAMPLE IMAGE:\\n\";\n      print_r($buffer_64x64);\n    }\n    if ($show_timings) {\n      printf(\"X030-DSMP %.6f\\n\", $t2-$t1);\n    }\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    // Quality metric.  Reuse the 64x64 image-domain downsample\n    // since we already have it.\n    $t1 = microtime(true);\n    $quality = self::computeImageDomainQualityMetric($buffer_64x64);\n    $t2 = microtime(true);\n    if ($show_timings) {\n      printf(\"X040-QMTC %.6f\\n\", $t2-$t1);\n    }\n    if ($dump) {\n      echo \"QUALITY:$quality\\n\";\n    }\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    $t1 = microtime(true);\n\n    $buffer_16x64 = array();\n    for ($i = 0; $i < 16; $i++) {\n      $row = array();\n      for ($j = 0; $j < 64; $j++) {\n        $row[$j] = 0;\n      }\n      $buffer_16x64[$i] = $row;\n    }\n\n    $buffer_16x16 = array();\n    for ($i = 0; $i < 16; $i++) {\n      $row = array();\n      for ($j = 0; $j < 16; $j++) {\n        $row[$j] = 0;\n      }\n      $buffer_16x16[$i] = $row;\n    }\n\n    $dct_16x64 = array();\n    for ($i = 0; $i < 16; $i++) {\n      $row = array();\n      for ($j = 0; $j < 64; $j++) {\n        $row[$j] = 0;\n      }\n      $dct_16x64[$i] = $row;\n    }\n    // See comments on dct64To16. Input is (0..63)x(0..63); output is\n    // (1..16)x(1..16) with the latter indexed as (0..15)x(0..15).\n    $matrix_scale_factor = sqrt(2.0 / 64.0);\n    $pi = 3.141592653589793;\n    for ($i = 0; $i < 16; $i++) {\n      for ($j = 0; $j < 64; $j++) {\n        $dct_16x64[$i][$j] = $matrix_scale_factor *\n          cos(($pi / 2 / 64.0) * ($i+1) * (2 * $j + 1));\n      }\n    }\n    $t2 = microtime(true);\n    if ($show_timings) {\n      printf(\"X050-DMTX %.6f\\n\", $t2-$t1);\n    }\n    if ($dump) {\n      echo \"DCT MATRIX:\\n\";\n      print_r($dct_16x64);\n    }\n\n    // 2D DCT\n    $t1 = microtime(true);\n    self::computeDCT64To16($buffer_64x64, $buffer_16x64, $buffer_16x16, $dct_16x64);\n    $t2 = microtime(true);\n    if ($show_timings) {\n      printf(\"X060-CDCT %.6f\\n\", $t2-$t1);\n    }\n    if ($dump) {\n      echo \"DCT OUTPUT:\\n\";\n      print_r($buffer_16x16);\n    }\n\n    return array($buffer_16x16, $quality);\n  }\n\n  // ----------------------------------------------------------------\n  static function computeHashAndQualityFromImage(\n    /*resource*/&$image,\n    /*bool*/ $show_timings,\n    /*bool*/ $dump\n  ) {\n    $t01 = microtime(true);\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    list ($buffer_16x16, $quality) = self:: computeDCTAndQualityFromImage(\n      $image, $show_timings, $dump\n    );\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    $hash = self::computeHashFromDCTOutput($buffer_16x16);\n    if ($dump) {\n      echo \"HASH:\".$hash->toHexString().\"\\n\";\n    }\n    $t02 = microtime(true);\n    if ($show_timings) {\n      printf(\"X999-OVRL %.6f\\n\", $t02-$t01);\n    }\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    return array($hash, $quality);\n  }\n\n  // ----------------------------------------------------------------\n  static function computeHashesAndQualityFromImage(\n    /*resource*/&$image,\n    /*int*/ $which_flags = self::DIH_ALL,\n    /*bool*/ $show_timings,\n    /*bool*/ $dump\n  ) {\n    $t01 = microtime(true);\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    list ($buffer_16x16, $quality) = self:: computeDCTAndQualityFromImage(\n      $image, $show_timings, $dump\n    );\n\n    $buffer_16x16_aux = array();\n    for ($i = 0; $i < 16; $i++) {\n      $row = array();\n      for ($j = 0; $j < 16; $j++) {\n        $row[$j] = 0;\n      }\n      $buffer_16x16_aux[$i] = $row;\n    }\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    $hashes = array();\n\n    if ($which_flags & self::DIH_ORIGINAL) {\n      $hashes['orig'] = self::computeHashFromDCTOutput($buffer_16x16);\n    }\n\n    if ($which_flags & self::DIH_ROTATE_90) {\n      self::dct16OriginalToRotate90($buffer_16x16, $buffer_16x16Aux);\n      $hashes['r090'] = self::computeHashFromDCTOutput($buffer_16x16Aux);\n    }\n\n    if ($which_flags & self::DIH_ROTATE_180) {\n      self::dct16OriginalToRotate180($buffer_16x16, $buffer_16x16Aux);\n      $hashes['r180'] = self::computeHashFromDCTOutput($buffer_16x16Aux);\n    }\n\n    if ($which_flags & self::DIH_ROTATE_270) {\n      self::dct16OriginalToRotate270($buffer_16x16, $buffer_16x16Aux);\n      $hashes['r270'] = self::computeHashFromDCTOutput($buffer_16x16Aux);\n    }\n\n    if ($which_flags & self::DIH_FLIP_X) {\n      self::dct16OriginalToFlipX($buffer_16x16, $buffer_16x16Aux);\n      $hashes['flpx'] = self::computeHashFromDCTOutput($buffer_16x16Aux);\n    }\n\n    if ($which_flags & self::DIH_FLIP_Y) {\n      self::dct16OriginalToFlipY($buffer_16x16, $buffer_16x16Aux);\n      $hashes['flpy'] = self::computeHashFromDCTOutput($buffer_16x16Aux);\n    }\n\n    if ($which_flags & self::DIH_FLIP_PLUS_1) {\n      self::dct16OriginalToFlipPlus1($buffer_16x16, $buffer_16x16Aux);\n      $hashes['flpp'] = self::computeHashFromDCTOutput($buffer_16x16Aux);\n    }\n\n    if ($which_flags & self::DIH_FLIP_MINUS_1) {\n      self::dct16OriginalToFlipMinus1($buffer_16x16, $buffer_16x16Aux);\n      $hashes['flpm'] = self::computeHashFromDCTOutput($buffer_16x16Aux);\n    }\n\n    $t02 = microtime(true);\n    if ($show_timings) {\n      printf(\"X999-OVRL %.6f\\n\", $t02-$t01);\n    }\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    return array($hashes, $quality);\n  }\n\n  // ================================================================\n  static function computeHashAndQualityFromFilename(\n    $filename,\n    $show_timings = false,\n    $dump = false,\n    $downsample = false\n  ) {\n\n    $t01 = microtime(true);\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    $info = getimagesize($filename);\n    if ($dump) {\n      echo \"IMAGE INFO:\\n\";\n      print_r($info);\n    }\n\n    $num_rows = $info[1]; // height\n    $num_cols = $info[0]; // width\n    if ($dump) {\n      echo \"num_rows=$num_rows\\n\";\n      echo \"num_cols=$num_cols\\n\";\n    }\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    $t1 = microtime(true);\n    $image = self::readImageFromFilename($filename, $downsample);\n    $t2 = microtime(true);\n    if ($show_timings) {\n      printf(\"X000-READ %.6f\\n\", $t2-$t1);\n    }\n\n    return self::computeHashAndQualityFromImage($image, $show_timings, $dump);\n  }\n\n  // ----------------------------------------------------------------\n  static function computeHashesAndQualityFromFilename(\n    $filename,\n    $which_flags = self::DIH_ALL,\n    $show_timings = false,\n    $dump = false\n  ) {\n\n    $t01 = microtime(true);\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    $info = getimagesize($filename);\n    if ($dump) {\n      echo \"IMAGE INFO:\\n\";\n      print_r($info);\n    }\n\n    $num_rows = $info[1]; // height\n    $num_cols = $info[0]; // width\n    if ($dump) {\n      echo \"num_rows=$num_rows\\n\";\n      echo \"num_cols=$num_cols\\n\";\n    }\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    $t1 = microtime(true);\n    $image = self::readImageFromFilename($filename, true);\n    $t2 = microtime(true);\n    if ($show_timings) {\n      printf(\"X000-READ %.6f\\n\", $t2-$t1);\n    }\n\n    return self::computeHashesAndQualityFromImage(\n      $image, $which_flags, $show_timings, $dump\n    );\n  }\n\n  // ================================================================\n  // Array of hash and quality.\n  // The hash is a hex-string, not a PDQHash object.\n\n  static function computeStringHashAndQualityFromFilenameUsingExtension(\n    $filename,\n    $show_timings = false,\n    $dump = false\n  ) {\n\n    $t01 = microtime(true);\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    $info = getimagesize($filename);\n    if ($dump) {\n      echo \"IMAGE INFO:\\n\";\n      print_r($info);\n    }\n\n    $num_rows = $info[1]; // height\n    $num_cols = $info[0]; // width\n    if ($dump) {\n      echo \"num_rows=$num_rows\\n\";\n      echo \"num_cols=$num_cols\\n\";\n    }\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    $t1 = microtime(true);\n    $image = self::readImageFromFilename($filename, false);\n    $t2 = microtime(true);\n    if ($show_timings) {\n      printf(\"X000-READ %.6f\\n\", $t2-$t1);\n    }\n\n    // Uses the PDQ Zend-PHP extension\n    $t1 = microtime(true);\n    $retval = pdq_compute_string_hash_and_quality_from_image_resource($image);\n    $t2 = microtime(true);\n    if ($show_timings) {\n      printf(\"X000-EXTN %.6f\\n\", $t2-$t1);\n    }\n\n    return array($retval['hash'], $retval['quality']);\n  }\n\n  // ----------------------------------------------------------------\n  static function computeStringHashesAndQualityFromFilenameUsingExtension(\n    $filename,\n    $which_flags = self::DIH_ALL,\n    $show_timings = false,\n    $dump = false\n  ) {\n\n    $t01 = microtime(true);\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    $info = getimagesize($filename);\n    if ($dump) {\n      echo \"IMAGE INFO:\\n\";\n      print_r($info);\n    }\n\n    $num_rows = $info[1]; // height\n    $num_cols = $info[0]; // width\n    if ($dump) {\n      echo \"num_rows=$num_rows\\n\";\n      echo \"num_cols=$num_cols\\n\";\n    }\n\n    //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n    $t1 = microtime(true);\n    $image = self::readImageFromFilename($filename, false);\n    $t2 = microtime(true);\n    if ($show_timings) {\n      printf(\"X000-READ %.6f\\n\", $t2-$t1);\n    }\n\n    // Uses the PDQ Zend-PHP extension\n    $t1 = microtime(true);\n    $retval = pdq_compute_string_hashes_and_quality_from_image_resource($image);\n    $t2 = microtime(true);\n    if ($show_timings) {\n      printf(\"X000-EXTN %.6f\\n\", $t2-$t1);\n    }\n\n    return array(\n      array(\n        'orig' => $retval['orig'],\n        'r090' => $retval['r090'],\n        'r180' => $retval['r180'],\n        'r270' => $retval['r270'],\n        'flpx' => $retval['flpx'],\n        'flpy' => $retval['flpy'],\n        'flpp' => $retval['flpp'],\n        'flpm' => $retval['flpm'],\n      ),\n      $retval['quality']\n    );\n  }\n\n} // class PDQHasher\n", "num_lines": 1030}
{"repo_name": "ThreatExchange", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n\n// ================================================================\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n// ================================================================\n\nrequire 'pdqhasher.php';\n\n$filenames = array_slice($argv, 1);\nif (empty($filenames)) {\n  fprintf(STDERR, \"%s: need at least one image file name.\\n\", $argv[0]);\n  exit(1);\n}\n\nforeach ($filenames as $filename) {\n\n  list ($hashes, $quality) = PDQHasher::computeHashesAndQualityFromFilename($filename);\n  foreach ($hashes as $type => $hash) {\n    $s = $hash->toHexString();\n    echo \"$s,$type,$quality,purephp,$filename\\n\";\n  }\n\n  list ($hashes, $quality) = PDQHasher::computeStringHashesAndQualityFromFilenameUsingExtension($filename);\n  foreach ($hashes as $type => $hash) {\n    echo \"$hash,$type,$quality,extnphp,$filename\\n\";\n  }\n\n}\n", "num_lines": 29}
{"repo_name": "ThreatExchange", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n// ================================================================\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n// ================================================================\n\nrequire 'pdqhasher.php';\n\n$filenames = array_slice($argv, 1);\nif (empty($filenames)) {\n  fprintf(STDERR, \"%s: need at least one image file name.\\n\", $argv[0]);\n  exit(1);\n}\n$show_timings = false;\n//$show_timings = true;\n$dump = false;\n\n$downsample = false;\n\nforeach ($filenames as $filename) {\n\n  list ($hash, $quality) = PDQHasher::computeHashAndQualityFromFilename($filename, $show_timings, $dump, $downsample);\n  $s = $hash->toHexString();\n  echo \"$s,$quality,purephp,$filename\\n\";\n  if (function_exists('pdq_compute_string_hash_and_quality_from_image_resource')) {\n    list ($hash, $quality) = PDQHasher::computeStringHashAndQualityFromFilenameUsingExtension($filename, $show_timings, $dump);\n    echo \"$hash,$quality,extnphp,$filename\\n\";\n  } else {\n    echo \"php extension not available\";\n  }\n\n}\n", "num_lines": 32}
{"repo_name": "ThreatExchange", "repo_creator": "facebook", "programming_language": "PHP", "code": "<?php\n\n// ================================================================\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n// ================================================================\n\nrequire 'pdqhash.php';\n\nif (count($argv) > 1) {\n  fprintf(STDERR, \"%s: takes no arguments.\\n\", $argv[0]);\n  exit(1);\n}\n\n$hash = PDQHash::makeZeroesHash();\n$s = $hash->toHexString();\necho \"s=$s\\n\";\nfor ($i = 0; $i < 256; $i++) {\n  $hash->setBit($i);\n  $s = $hash->toHexString();\n  $n = $hash->hammingNorm();\n  echo \"s=$s n=$n\\n\";\n}\n$s = 'f8f8f0cce0f4e84d0e370a22028f67f0b36e2ed596623e1d33e6339c4e9c9b22';\necho \"s=$s\\n\";\n$hash = PDQHash::fromHexString($s);\n$s = $hash->toHexString();\necho \"s=$s\\n\";\n\n$strings = $hash->to16BitStrings();\necho \"\\n\";\nforeach ($strings as $string) {\n  echo \"$string\\n\";\n}\n\n$strings = $hash->to32BitStrings();\necho \"\\n\";\nforeach ($strings as $string) {\n  echo \"$string\\n\";\n}\n\n$strings = $hash->to64BitStrings();\necho \"\\n\";\nforeach ($strings as $string) {\n  echo \"$string\\n\";\n}\n\n", "num_lines": 47}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Encrypt given text using caesar cipher.\n *\n * @param string text text to be encrypted\n * @param int shift number of shifts to be applied\n * @return string new encrypted text\n */\nfunction encrypt(string $text, int $shift): string\n{\n    $encryptedText = ''; // Empty string to store encrypted text\n    foreach (str_split($text) as $c) { // Going through each character\n        if (ctype_alpha($c)) {\n            $placeValue = ord($c) - ord(ctype_upper($c) ? 'A' : 'a'); // Getting value of character (i.e. 0-25)\n            $placeValue = ($placeValue + $shift) % 26; // Applying encryption formula\n            $placeValue += ord(ctype_upper($c) ? 'A' : 'a');\n            $newChar = chr($placeValue); // Getting new character from new value (i.e. A-Z)\n            $encryptedText .= $newChar; // Appending encrypted character\n        } else {\n            $encryptedText .= $c; // Appending the original character\n        }\n    }\n\n    return $encryptedText; // Returning encrypted text\n}\n\n/**\n * Decrypt given text using caesar cipher.\n * @param string text text to be decrypted\n * @param int shift number of shifts to be applied\n * @return string new decrypted text\n */\nfunction decrypt(string $text, int $shift): string\n{\n    $decryptedText = ''; // Empty string to store decrypted text\n    foreach (str_split($text) as $c) { // Going through each character\n        if (ctype_alpha($c)) {\n            $placeValue = ord($c) - ord(ctype_upper($c) ? 'A' : 'a'); // Getting value of character (i.e. 0-25)\n            $placeValue = ($placeValue - $shift) % 26; // Applying decryption formula\n            if ($placeValue < 0) { // Handling case where remainder is negative\n                $placeValue += 26;\n            }\n            $placeValue += ord(ctype_upper($c) ? 'A' : 'a');\n            $newChar = chr($placeValue); // Getting new character from new value (i.e. A-Z)\n            $decryptedText .= $newChar; // Appending decrypted character\n        } else {\n            $decryptedText .= $c; // Appending the original character\n        }\n    }\n\n    return $decryptedText; // Returning decrypted text\n}\n", "num_lines": 54}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n// A mono-alphabetic cipher is a simple substitution cipher\n// https://www.101computing.net/mono-alphabetic-substitution-cipher/\n\nfunction monoAlphabeticCipher($key, $alphabet, $text){\n\n    $cipherText = ''; // the cipher text (can be decrypted and encrypted)\n\n    if ( strlen($key) != strlen($alphabet) ) { return false; } // check if the text length matches\n    $text = preg_replace('/[0-9]+/', '', $text); // remove all the numbers\n    \n    for( $i = 0; $i < strlen($text); $i++ ){\n        $index = strripos( $alphabet, $text[$i] );\n        if( $text[$i] == \" \" ){ $cipherText .= \" \"; }\n        else{ $cipherText .= ( ctype_upper($text[$i]) ? strtoupper($key[$index]) : $key[$index] ); }\n    }\n    return $cipherText;\n}\n\nfunction maEncrypt($key, $alphabet, $text){\n\n    return monoAlphabeticCipher($key, $alphabet, $text);\n\n}\n\nfunction maDecrypt($key, $alphabet, $text){\n\n    return monoAlphabeticCipher($alphabet, $key, $text);\n\n}\n\n?> ", "num_lines": 32}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Encode text to Morse Code.\n *\n * @param string text to encode\n * @return string encoded text\n */\nfunction encode(string $text): string\n{\n    $text = strtoupper($text); // Makes sure the string is uppercase\n    $MORSE_CODE = array( // Array containing morse code translations\n        \"A\" => \".-\",\n        \"B\" => \"-...\",\n        \"C\" => \"-.-.\",\n        \"D\" => \"-..\",\n        \"E\" => \".\",\n        \"F\" => \"..-.\",\n        \"G\" => \"--.\",\n        \"H\" => \"....\",\n        \"I\" => \"..\",\n        \"J\" => \".---\",\n        \"K\" => \"-.-\",\n        \"L\" => \".-..\",\n        \"M\" => \"--\",\n        \"N\" => \"-.\",\n        \"O\" => \"---\",\n        \"P\" => \".--.\",\n        \"Q\" => \"--.-\",\n        \"R\" => \".-.\",\n        \"S\" => \"...\",\n        \"T\" => \"-\",\n        \"U\" => \"..-\",\n        \"V\" => \"...-\",\n        \"W\" => \".--\",\n        \"X\" => \"-..-\",\n        \"Y\" => \"-.--\",\n        \"Z\" => \"--..\",\n        \"1\" => \".----\",\n        \"2\" => \"..---\",\n        \"3\" => \"...--\",\n        \"4\" => \"....-\",\n        \"5\" => \".....\",\n        \"6\" => \"-....\",\n        \"7\" => \"--...\",\n        \"8\" => \"---..\",\n        \"9\" => \"----.\",\n        \"0\" => \"-----\",\n        \" \" => \"/\"\n    );\n\n    $encodedText = \"\"; // Stores the encoded text\n    foreach (str_split($text) as $c) { // Going through each character\n        if (array_key_exists($c, $MORSE_CODE)) { // Checks if it is a valid character\n            $encodedText .= $MORSE_CODE[$c] . \" \"; // Appends the correct character\n        } else {\n            throw new \\Exception(\"Invalid character: $c\");\n        }\n    }\n    substr_replace($encodedText ,\"\", -1); // Removes trailing space\n    return $encodedText;\n}\n\n/**\n * Decode Morse Code to text.\n * @param string text to decode\n */\nfunction decode(string $text): string\n{\n    $MORSE_CODE = array( // An array containing morse code to text translations\n        \".-\" => \"A\",\n        \"-...\" => \"B\",\n        \"-.-.\" => \"C\",\n        \"-..\" => \"D\",\n        \".\" => \"E\",\n        \"..-.\" => \"F\",\n        \"--.\" => \"G\",\n        \"....\" => \"H\",\n        \"..\" => \"I\",\n        \".---\" => \"J\",\n        \"-.-\" => \"K\",\n        \".-..\" => \"L\",\n        \"--\" => \"M\",\n        \"-.\" => \"N\",\n        \"---\" => \"O\",\n        \".--.\" => \"P\",\n        \"--.-\" => \"Q\",\n        \".-.\" => \"R\",\n        \"...\" => \"S\",\n        \"-\" => \"T\",\n        \"..-\" => \"U\",\n        \"...-\" => \"V\",\n        \".--\" => \"W\",\n        \"-..-\" => \"X\",\n        \"-.--\" => \"Y\",\n        \"--..\" => \"Z\",\n        \".----\" => \"1\",\n        \"..---\" => \"2\",\n        \"...--\" => \"3\",\n        \"....-\" => \"4\",\n        \".....\" => \"5\",\n        \"-....\" => \"6\",\n        \"--...\" => \"7\",\n        \"---..\" => \"8\",\n        \"----.\" => \"9\",\n        \"-----\" => \"0\",\n        \"/\" => \" \"\n    );\n\n    $decodedText = \"\"; // Stores the decoded text\n    foreach (explode(\" \", $text) as $c) { // Going through each group\n        if (array_key_exists($c, $MORSE_CODE)) { // Checks if it is a valid character\n            $decodedText .= $MORSE_CODE[$c]; // Appends the correct character\n        } else {\n            if ($c) { // Makes sure that the string is not empty to prevent trailing spaces or extra spaces from breaking this\n                throw new \\Exception(\"Invalid character: $c\");\n            }\n        }\n    }\n    return $decodedText;\n}\n", "num_lines": 122}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * The XOR cipher is a type of additive cipher.\n * Each character is bitwise XORed with the key.\n * We loop through the input string, XORing each\n * character with the key.\n * The key is repeated until it is the same length as the input.\n *\n * @param string $input The input string.\n * @param string $key The key to use.\n * @return string The encrypted string.\n */\nfunction xorCipher(string $input_string, string $key)\n{\n\n    $key_len = strlen($key);\n    $result = array();\n\n    for ($idx = 0; $idx < strlen($input_string); $idx++)\n    {\n        array_push($result, $input_string[$idx] ^ $key[$idx % $key_len]);\n    }\n\n    return join(\"\", $result);\n}\n", "num_lines": 27}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * This function converts the\n * submitted Binary Number to\n * Decimal Number.\n *\n * Working of Algorithm\n * (10) base 2\n * (1 * (2 ^ 1) + 0 * (2 ^ 0)) base 10\n * (2 + 0) base 10\n * 2 base 10\n *\n * @param string $binaryNumber\n * @return int\n */\nfunction binaryToDecimal($binaryNumber)\n{\n    if (!is_numeric($binaryNumber)) {\n        throw new \\Exception('Please pass a valid Binary Number for Converting it to a Decimal Number.');\n    }\n\n    $decimalNumber = 0;\n    $binaryDigits  = array_reverse(str_split($binaryNumber));\n\n    foreach ($binaryDigits as $index => $digit) {\n        $decimalNumber += $digit * pow(2, $index);\n    }\n\n    return $decimalNumber;\n}\n", "num_lines": 32}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * This function converts the\n * submitted Decimal Number to\n * Binary Number.\n *\n * @param string $decimalNumber\n * @return string\n */\nfunction decimalToBinary($decimalNumber)\n{\n    if (!is_numeric($decimalNumber)) {\n        throw new \\Exception('Please pass a valid Decimal Number for Converting it to a Binary Number.');\n    }\n\n    $binaryNumber = '';\n\n    while ($decimalNumber > 0) {\n        $binaryNumber = ($decimalNumber % 2) . $binaryNumber;\n        $decimalNumber /= 2;\n    }\n\n    return $binaryNumber;\n}\n", "num_lines": 26}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * This function converts the\n * submitted Octal Number to\n * Decimal Number.\n *\n * Working of Algorithm\n * (AB) base 16\n * (A * (16 ^ 1) + B * (16 ^ 0)) base 10\n * (10 * (16 ^ 1) + 11 * (16 ^ 0)) base 10\n * (160 + 11) base 10\n * 171 base 10\n *\n * @param string $octalNumber\n * @return int\n */\nfunction hexToDecimal($hexNumber)\n{\n    // Using ctype to check all the digits are valid hex digits or not.\n    if (!ctype_xdigit($hexNumber)) {\n        throw new \\Exception('Please pass a valid Hexadecimal Number for Converting it to a Decimal Number.');\n    }\n\n    $decimalNumber = 0;\n\n    // Mapping for Decimal Digits after 9\n    $decimalDigitMappings = [\n        'A' => 10,\n        'B' => 11,\n        'C' => 12,\n        'D' => 13,\n        'E' => 14,\n        'F' => 15,\n    ];\n\n    $hexDigits = str_split($hexNumber);\n    $hexDigits = array_reverse($hexDigits);\n\n    foreach ($hexDigits as $power => $digit) {\n        $hexDigit = $digit;\n        if (!is_numeric($digit)) {\n            $hexDigit = $decimalDigitMappings[$digit];\n        }\n        $decimalNumber += (pow(16, $power) * $hexDigit);\n    }\n    return $decimalNumber;\n}\n\n/**\n * This function converts the\n * submitted Decimal Number to\n * Hexadecimal Number.\n *\n * @param string $decimalNumber\n * @return string\n */\nfunction decimalToHex($decimalNumber)\n{\n    $hexDigits = [];\n\n    // Mapping for HexaDecimal Digits after 9\n    $hexDigitMappings = [\n        10 => 'A',\n        11 => 'B',\n        12 => 'C',\n        13 => 'D',\n        14 => 'E',\n        15 => 'F',\n    ];\n    if (!is_numeric($decimalNumber)) {\n        throw new \\Exception('Please pass a valid Decimal Number for Converting it to a Hexadecimal Number.');\n    }\n\n    while ($decimalNumber > 0) {\n        $remainder = ($decimalNumber % 16);\n        $decimalNumber /= 16;\n        if (empty($hexDigits) && 0 === $remainder) {\n            continue;\n        }\n        $hexDigits[] = $remainder;\n    }\n\n    $hexDigits = array_reverse($hexDigits);\n\n    foreach ($hexDigits as $index => $digit) {\n        if ($digit > 9) {\n            $hexDigits[$index] = $hexDigitMappings[$digit];\n        }\n    }\n\n    $hexNumber = ltrim(implode('', $hexDigits), '0'); // Connecting all the digits and removing leading zeroes.\n\n    return $hexNumber;\n}\n", "num_lines": 96}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * This function converts the\n * submitted Octal Number to\n * Decimal Number.\n *\n * Working of Algorithm\n * (10) base 8\n * (1 * (8 ^ 1) + 0 * (8 ^ 0)) base 10\n * (8 + 0) base 10\n * 9 base 10\n * @param string $octalNumber\n * @return int\n */\nfunction octalToDecimal($octalNumber)\n{\n    if (!is_numeric($octalNumber)) {\n        throw new \\Exception('Please pass a valid Octal Number for Converting it to a Decimal Number.');\n    }\n\n    $decimalNumber = 0;\n    $octalDigits   = array_reverse(str_split($octalNumber));\n\n    foreach ($octalDigits as $index => $digit) {\n        $decimalNumber += $digit * pow(8, $index);\n    }\n\n    return $decimalNumber;\n}\n\n/**\n * This function converts the\n * submitted Decimal Number to\n * Octal Number.\n *\n * @param string $decimalNumber\n * @return string\n */\nfunction decimalToOctal($decimalNumber)\n{\n    if (!is_numeric($decimalNumber)) {\n        throw new \\Exception('Please pass a valid Decimal Number for Converting it to an Octal Number.');\n    }\n\n    $octalNumber = '';\n\n    while ($decimalNumber > 0) {\n        $octalNumber = ($decimalNumber % 8) . $octalNumber;\n        $decimalNumber /= 8;\n    }\n\n    return $octalNumber;\n}\n", "num_lines": 55}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * This function converts the submitted\n * speed from one unit to another\n *\n * Conversion explanation taken from\n * https://www.asknumbers.com/SpeedConversion.aspx\n * Available units for conversion:\n * mph -> miles per hour\n * km/h -> kilometers per hour\n * m/s -> meters per second\n * ft/s -> feet per second\n * kn -> 1 knot which is equal to 1 nautical mile (1852 km/h)\n * The conversion is made using kilometers as base\n *\n * @param float $speed\n * @param string $unitFrom\n * @param string $unitTo\n * @return int\n */\nfunction convertSpeed(float $speed, string $unitFrom, string $unitTo)\n{\n    $speedUnitsFrom = [\n        'mph' => 1.609344,\n        'km/h' => 1,\n        'm/s'=> 3.6,\n        'ft/s'=> 1.097,\n        'kn' => 1.852,\n    ];\n    $speedUnitsTo = [\n        'mph' => 0.6213712,\n        'km/h' => 1,\n        'm/s'=> 0.277778,\n        'ft/s'=> 0.911344,\n        'kn' => 0.539957,\n    ];\n    $availableUnits = array_keys($speedUnitsFrom);\n\n    if (!is_numeric($speed)) {\n        throw new \\Exception(\"Please pass a valid speed number for converting it from one unit to another.\");\n    }\n    if (!in_array($unitFrom, $availableUnits) || !in_array($unitTo, $availableUnits)) {\n        throw new \\Exception(\"Please pass a valid speed unit.\\n\\nAvailable units: \" . implode(', ', $availableUnits));\n    }\n\n    return round($speed * $speedUnitsFrom[$unitFrom] * $speedUnitsTo[$unitTo], 2);\n}\n", "num_lines": 49}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n *  Singly Linked List\n */\n\nclass SinglyLinkedList\n{\n    public ?SinglyLinkedList $next = null;\n    public $data;\n\n    public function __construct($data)\n    {\n        $this->data = $data;\n    }\n\n    public function append($data): void\n    {\n        $current = $this;\n\n        while ($current instanceof SinglyLinkedList && isset($current->next)) {\n            $current = $current->next;\n        }\n\n        $current->next = new SinglyLinkedList($data);\n    }\n\n    public function delete($data): SinglyLinkedList\n    {\n        $current = $this;\n\n        if ($current->data == $data) {\n            return $current->next;\n        }\n\n        while ($current instanceof SinglyLinkedList && isset($current->next)) {\n            if ($current->next->data === $data) {\n                $current->next = $current->next->next;\n\n                return $this;\n            }\n\n            $current = $current->next;\n        }\n\n        return $this;\n    }\n}\n", "num_lines": 48}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Breadth-first search (BFS) is an algorithm for searching a tree data structure for a node that satisfies a given property.\n * (https://en.wikipedia.org/wiki/Breadth-first_search).\n * \n * This is a non recursive implementation.\n * \n * References:\n * https://cp-algorithms.com/graph/breadth-first-search.html\n * \n * https://the-algorithms.com/algorithm/depth-first-search?lang=python\n * \n * @author Aryansh Bhargavan https://github.com/aryanshb\n * @param array $adjList An array representing the grapth as an Adjacent List\n * @param int|string $start The starting vertex\n * @return bool if path between start and end vertex exists\n */\n\nfunction bfs($adjList, $start, $end, $yes = false){\n    $visited = [];\n    $queue = [$start];\n    while (!empty($queue)) {\n        $v = array_shift($queue);\n        $visited[$v] = 1;\n        foreach ($adjList[$v] as $adj) {\n            if (!array_key_exists($adj, $visited)) {\n                array_push($queue, $adj);\n            }\n        }\n    }\n    // return array_key_exists($end, $visited);\n    if (array_key_exists($end, $visited)) {\n        $yes = true;\n    }\n    return $yes;\n}\n", "num_lines": 38}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * The Depth-first Search is an algorithm used for traversing or searching trees or graphs \n * (https://en.wikipedia.org/wiki/Depth-first_search).\n * \n * This is a non recursive implementation.\n * \n * References:\n * https://www.geeksforgeeks.org/depth-first-search-or-dfs-for-a-graph/\n * \n * https://the-algorithms.com/algorithm/depth-first-search?lang=python\n * \n * @author Andre Alves https://github.com/andremralves\n * @param array $adjList An array representing the grapth as an Adjacent List\n * @param int|string $start The starting vertex\n * @return array The visited vertices \n */\nfunction dfs($adjList, $start)\n{\n    $visited = [];\n    $stack = [$start];\n    while (!empty($stack)) {\n        // Removes the ending element from the stack and mark as visited\n        $v = array_pop($stack);\n        $visited[$v] = 1;\n\n        // Checks each adjacent vertex of $v and add to the stack if not visited\n        foreach (array_reverse($adjList[$v]) as $adj) {\n            if (!array_key_exists($adj, $visited))\n                array_push($stack, $adj);\n        }\n    }\n    return array_keys($visited);\n}\n", "num_lines": 36}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n * This function calculates\n * Absolute max values from\n * the different numbers\n * provided\n *\n * @param decimal $numbers A variable sized number input\n * @return decimal $absoluteMax Absolute max value\n */\nfunction absolute_max(...$numbers)\n{\n    if (empty($numbers)) {\n        throw new \\Exception('Please pass values to find absolute max value');\n    }\n\n    $absoluteMax = $numbers[0];\n    for ($loopIndex = 0; $loopIndex < count($numbers); $loopIndex++) {\n        if ($numbers[$loopIndex] > $absoluteMax) {\n            $absoluteMax = $numbers[$loopIndex];\n        }\n    }\n\n    return $absoluteMax;\n}\n", "num_lines": 26}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n * This function calculates\n * Absolute min values from\n * the different numbers\n * provided.\n *\n * @param decimal $numbers A variable sized number input\n * @return decimal $absoluteMin Absolute min value\n */\nfunction absolute_min(...$numbers)\n{\n    if (empty($numbers)) {\n        throw new \\Exception('Please pass values to find absolute min value');\n    }\n\n    $absoluteMin = $numbers[0];\n    for ($loopIndex = 0; $loopIndex < count($numbers); $loopIndex++) {\n        if ($numbers[$loopIndex] < $absoluteMin) {\n            $absoluteMin = $numbers[$loopIndex];\n        }\n    }\n\n    return $absoluteMin;\n}\n", "num_lines": 26}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n * This function checks if given number is Armstrong\n * e.g. 153\n * @param integer $input\n * @return boolean\n */\nfunction isNumberArmstrong(int $input): bool\n{\n  $arr = array_map('intval', str_split($input));\n  $sumOfCubes = 0;\n  foreach ($arr as $num) {\n    $sumOfCubes += $num * $num * $num;\n  }\n  if ($sumOfCubes == $input) {\n    return true;\n  }\n  else {\n    return false;\n  }\n}\n?>\n", "num_lines": 23}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n * This function checks if given number is palindromic\n * e.g. 121\n * @param integer $input\n * @return boolean\n */\nfunction isNumberPalindromic(int $input): bool\n{\n  $arr = array_map('intval', str_split($input));\n  $arrRev = array_reverse($arr);\n  $inputRev = (int)implode(\"\", $arrRev);\n  if ($input == $inputRev) {\n    return true;\n  }\n  else {\n    return false;\n  }\n}\n?>\n", "num_lines": 21}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n * This function check whether\n * the provided integer is a prime\n * number or not.\n *\n * @param Integer $number An integer input\n * @return boolean whether the number is prime or not\n */\nfunction isPrime(int $number)\n{\n    if ($number === 2) {\n        return true;\n    }\n\n    if ($number % 2 === 0 or $number < 2) {\n        return false;\n    }\n\n    $i = 3;\n    while ($i <= sqrt($number)) {\n        if ($number % $i === 0) {\n            return false;\n        }\n        $i += 2;\n    }\n\n    return true;\n}\n", "num_lines": 30}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n * This function calculates\n * and returns the factorial\n * of provided positive integer\n * number.\n *\n * @param Integer $number Integer input\n * @return Integer Factorial of the input\n */\nfunction factorial(int $number)\n{\n    static $cache = [];//internal caching memory for speed\n\n    if ($number < 0) {\n        throw new \\Exception(\"Negative numbers are not allowed for calculating Factorial\");\n    }\n    if ($number === 0) {\n        return 1; // Factorial of 0 is 1\n    }\n    \n    if (isset($cache[$number])) {\n        return $cache[$number];\n    }\n\n    $fact = ($number * factorial($number - 1)); // Recursion since x! = x * (x-1)!\n    $cache[$number] = $fact;\n\n    return $fact;\n}\n", "num_lines": 31}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n * This functions computes an exponent by doing repeated squares\n *\n * @param Integer $base the base\n * @param Integer $exponent the exponent (ie the number of times that the base is multiplied by itself)\n * @return Integer\n */\nfunction fastExponentiation(int $base, int $exponent)\n{\n    if ($exponent == 0) {\n\t\treturn 1;\n\t}\n\n\tif ($exponent == 1) {\n\t\treturn $base;\n\t}\n\n\tif ($exponent % 2 == 0) {\n\t\treturn fastExponentiation($base*$base, $exponent/2);\n\t} else {\n\t\treturn $base * fastExponentiation($base*$base, ($exponent-1)/2);\n\t}\n}\n", "num_lines": 25}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Fibonacci recursive\n *\n * @param int $num\n * @return int\n */\nfunction fibonacciRecursive(int $num)\n{\n    /*\n     * Fibonacci series using recursive approach\n     */\n\n    $fibonacciRecursive = [];\n    for ($i = 0; $i < $num; $i++) {\n        array_push($fibonacciRecursive, recursive($i));\n    }\n    return $fibonacciRecursive;\n}\n\n/**\n * @param int $num\n * @return int\n */\nfunction recursive(int $num)\n{\n    if ($num < 0) {\n        throw new \\Exception(\"Number must be greater than 0.\");\n    } else {\n        if ($num == 0 || $num == 1) {\n            return $num;\n        } else {\n            return recursive($num - 1) + recursive($num - 2);\n        }\n    }\n}\n\nfunction fibonacciWithBinetFormula(int $num)\n{\n    /*\n     * Fibonacci series using Binet's formula given below\n     * binet's formula =  ((1 + sqrt(5) / 2 ) ^ n - (1 - sqrt(5) / 2 ) ^ n ) ) / sqrt(5)\n     * More about Binet's formula found at http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/fibFormula.html#section1\n     */\n\n    $fib_series = [];\n\n    if ($num < 0) {\n        throw new \\Exception(\"Number must be greater than 0.\");\n    } else {\n        $sqrt = sqrt(5);\n        $phi_1 = (1 + $sqrt) / 2;\n        $phi_2 = (1 - $sqrt) / 2;\n\n        foreach (range(0, $num - 1) as $n) {\n            $seriesNumber = (pow($phi_1, $n) - pow($phi_2, $n)) / $sqrt;\n            array_push($fib_series, (int)$seriesNumber);\n        }\n\n    }\n\n    return $fib_series;\n}\n", "num_lines": 65}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/*\n * Print Fibocanni sequence using a generator\n */\n\n /**\n  * @param int $i number of Fibonacci numbers to generate\n  * @param Generator $set Fibonacci calculator\n  */\nfunction loop($i, Generator $set)\n{\n    while($i-- > 0 && $set->valid())\n    {\n        yield $set->current();\n        $set->next();\n    }\n}\n\n/*\n * Fibonacci generator\n */\nfunction fib()\n{\n    yield $i = 0;\n    yield $j = 1;\n\n    while(true)\n    {\n        yield $k = $i + $j;\n        $i = $j;\n        $j = $k;\n    }\n}\n\n/*\n * Generate 100 Fibonacci numbers\n */\nforeach(loop(100, fib()) as $item)\n{\n    print($item.',');\n}", "num_lines": 42}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n * This function calculates\n * The mean value of\n * numbers provided\n * \n * @param decimal $numbers A variable sized number input\n * @return decimal $mean Mean of provided numbers\n */\nfunction mean(...$numbers)\n{\n    if (empty($numbers)) {\n        throw new \\Exception('Please pass values to find mean value');\n    }\n\n    $total = array_sum($numbers);\n    $mean = $total / count($numbers);\n    \n    return $mean;\n}", "num_lines": 20}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n * This function calculates\n * The median value of\n * numbers provided\n * \n * @param decimal $numbers A variable sized number input\n * @return decimal $median Median of provided numbers\n */\nfunction median(...$numbers)\n{\n    if (empty($numbers)) {\n        throw new \\Exception('Please pass values to find mean value');\n    }\n\n    sort($numbers);\n    $length = count($numbers);\n    \n    $middle = ceil($length / 2);\n    if($length % 2 == 0) {\n        return ($numbers[$middle] + $numbers[$middle - 1]) / 2;\n    }\n    \n    return $numbers[$middle - 1];\n}", "num_lines": 25}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n * This function calculates\n * The mode value of\n * numbers provided\n * \n * @param decimal $numbers A variable sized number input\n * @return decimal $mode Mode of provided numbers\n */\nfunction mode(...$numbers)\n{\n    if (empty($numbers)) {\n        throw new \\Exception('Please pass values to find mean value');\n    }\n\n    $values = array_count_values($numbers); \n    $mode = array_search(max($values), $values);\n\n    return $mode;\n}", "num_lines": 20}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\nfunction isNumberNeon($input)\n{\n  $inputSquare = $input * $input;\n  $inputArr = array_map('intval', str_split($inputSquare));\n  $sumOfSquareDigits =0;\n  foreach ($inputArr as $digit) {\n    $sumOfSquareDigits +=$digit;\n  }\n  return $sumOfSquareDigits ==$input;\n}\n?>\n", "num_lines": 13}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n * This function check whether\n * the provided number is a\n * perfect square or not.\n *\n * @param Decimal $number A decimal input\n * @return boolean whether the number is perfect square or not\n */\nfunction isPerfectSquare($number)\n{\n    $root = (int) sqrt($number);\n    return (($root * $root) === $number); // If number's square root is an integer then it's a perfect square else not\n}\n", "num_lines": 15}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Problem:\n *\n * If we list all the natural numbers below 10 that are multiples of 3 or 5,\n * we get 3, 5, 6 and 9. The sum of these multiples is 23.\n *\n * Find the sum of all the multiples of 3 or 5 below 1000.\n *\n *\n * Answer:\n *\n * 233168\n *\n *\n * @link https://projecteuler.net/problem=1\n */\n\n/**\n * @return int\n */\nfunction problem1a(): int\n{\n    $maxNumber = 999; // below 1000\n\n    $numbers = range(1, $maxNumber);\n\n    return array_reduce($numbers, function($carry, $number) {\n        $shouldCarry = $number % 3 == 0 || $number % 5 == 0;\n        return $carry += $shouldCarry ? $number : 0;\n    });\n}\n\n/**\n * @return int\n */\nfunction problem1b(): int\n{\n    $maxNumber = 999; // below 1000\n\n    $numbersMultByThree = range(3, $maxNumber, 3);\n    $numbersMultByFive = range(5, $maxNumber, 5);\n\n    $numbers = array_merge($numbersMultByThree, $numbersMultByFive);\n\n    return array_sum(array_unique($numbers));\n}\n", "num_lines": 49}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/*\n * This function solves the problem 10 of the Project Euler.\n *\n * Problem description:\n * The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.\n * Find the sum of all the primes below two million.\n */\n\n/**\n * @return int\n */\nfunction problem10(): int\n{\n    //Using Sieve of Erastothenes\n    //@see https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes\n\n    $n = 2000000;\n    $isPrime = [];\n\n    for ($i = 2; $i <= $n; $i++){\n        $isPrime[$i] = $i;\n    }\n\n    for ($i = 2; $i*$i <= $n; $i++){\n        if (isset ($isPrime[$i])){\n            for ( $j = $i; $i*$j <= $n; $j++)\n               unset($isPrime[$i*$j]);\n        }\n    }\n\n    return array_sum($isPrime);\n}\n", "num_lines": 34}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n\n/*\n * This function solves the problem 11 of the Project Euler.\n *\n * Problem description:\n * In the 20\u00c3\u201420 grid below, four numbers along a diagonal line have been marked in red.\n\n    08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08\n    49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00\n    81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65\n    52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91\n    22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80\n    24 47 32 60 99 03 45 02 44 75 33 53 78 36 84 20 35 17 12 50\n    32 98 81 28 64 23 67 10 26 38 40 67 59 54 70 66 18 38 64 70\n    67 26 20 68 02 62 12 20 95 63 94 39 63 08 40 91 66 49 94 21\n    24 55 58 05 66 73 99 26 97 17 78 78 96 83 14 88 34 89 63 72\n    21 36 23 09 75 00 76 44 20 45 35 14 00 61 33 97 34 31 33 95\n    78 17 53 28 22 75 31 67 15 94 03 80 04 62 16 14 09 53 56 92\n    16 39 05 42 96 35 31 47 55 58 88 24 00 17 54 24 36 29 85 57\n    86 56 00 48 35 71 89 07 05 44 44 37 44 60 21 58 51 54 17 58\n    19 80 81 68 05 94 47 69 28 73 92 13 86 52 17 77 04 89 55 40\n    04 52 08 83 97 35 99 16 07 97 57 32 16 26 26 79 33 27 98 66\n    88 36 68 87 57 62 20 72 03 46 33 67 46 55 12 32 63 93 53 69\n    04 42 16 73 38 25 39 11 24 94 72 18 08 46 29 32 40 62 76 36\n    20 69 36 41 72 30 23 88 34 62 99 69 82 67 59 85 74 04 36 16\n    20 73 35 29 78 31 90 01 74 31 49 71 48 86 81 16 23 57 05 54\n    01 70 54 71 83 51 54 69 16 92 33 48 61 43 52 01 89 19 67 48\n\n    The product of these numbers is 26 \u00c3\u2014 63 \u00c3\u2014 78 \u00c3\u2014 14 = 1788696.\n\n    What is the greatest product of four adjacent numbers in the same direction (up, down, left, right, or diagonally) in the 20\u00c3\u201420 grid?\n\n    Solution: 70600674\n */\n\n\nfunction horizontalProduct($grid, $row, $col)\n{\n    $product = 1;\n    for ($i = 0; $i < 4; $i++) {\n        $product *= $grid[$row][$col + $i];\n    }\n    return $product;\n}\n\nfunction verticalProduct($grid, $row, $col)\n{\n    $product = 1;\n    for ($i = 0; $i < 4; $i++) {\n        $product *= $grid[$row + $i][$col];\n    }\n    return $product;\n}\n\nfunction diagonalRightProduct($grid, $row, $col)\n{\n    $product = 1;\n    for ($i = 0; $i < 4; $i++) {\n        $product *= $grid[$row + $i][$col + $i];\n    }\n    return $product;\n}\n\nfunction diagonalLeftProduct($grid, $row, $col)\n{\n    $product = 1;\n    for ($i = 0; $i < 4; $i++) {\n        $product *= $grid[$row + $i][$col - $i];\n    }\n    return $product;\n}\n\nfunction problem11()\n{\n    $grid = \"08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 \n49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 \n81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 \n52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91 \n22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80 \n24 47 32 60 99 03 45 02 44 75 33 53 78 36 84 20 35 17 12 50 \n32 98 81 28 64 23 67 10 26 38 40 67 59 54 70 66 18 38 64 70 \n67 26 20 68 02 62 12 20 95 63 94 39 63 08 40 91 66 49 94 21 \n24 55 58 05 66 73 99 26 97 17 78 78 96 83 14 88 34 89 63 72 \n21 36 23 09 75 00 76 44 20 45 35 14 00 61 33 97 34 31 33 95 \n78 17 53 28 22 75 31 67 15 94 03 80 04 62 16 14 09 53 56 92 \n16 39 05 42 96 35 31 47 55 58 88 24 00 17 54 24 36 29 85 57 \n86 56 00 48 35 71 89 07 05 44 44 37 44 60 21 58 51 54 17 58 \n19 80 81 68 05 94 47 69 28 73 92 13 86 52 17 77 04 89 55 40 \n04 52 08 83 97 35 99 16 07 97 57 32 16 26 26 79 33 27 98 66 \n88 36 68 87 57 62 20 72 03 46 33 67 46 55 12 32 63 93 53 69 \n04 42 16 73 38 25 39 11 24 94 72 18 08 46 29 32 40 62 76 36 \n20 69 36 41 72 30 23 88 34 62 99 69 82 67 59 85 74 04 36 16 \n20 73 35 29 78 31 90 01 74 31 49 71 48 86 81 16 23 57 05 54 \n01 70 54 71 83 51 54 69 16 92 33 48 61 43 52 01 89 19 67 48\";\n\n    //Transform the grid string to a matrix data type (nested arrays)\n    $grid = explode(' ', $grid);\n    $grid_matrix = [];\n    $row = [];\n    $i = 0;\n    $matrix_size = 20;\n\n    //Convert string $grid to a matrix\n    foreach ($grid as $g) {\n        $i++;\n        $row[] = (int)trim($g);\n\n        if ($i == $matrix_size) {\n            $grid_matrix[] = $row;\n            $row = [];\n            $i = 0;\n        }\n    }\n    $maxProduct = 0;\n\n    for ($row = 0; $row < $matrix_size; $row++) {\n        for ($col = 0; $col < $matrix_size; $col++) {\n            // horizontal\n            if ($col < $matrix_size - 3) {\n                $product = horizontalProduct($grid_matrix, $row, $col);\n                if ($product > $maxProduct) {\n                    $maxProduct = $product;\n                }\n            }\n            // vertical\n            if ($row < $matrix_size - 3) {\n                $product = verticalProduct($grid_matrix, $row, $col);\n                if ($product > $maxProduct) {\n                    $maxProduct = $product;\n                }\n            }\n            // diagonal right\n            if ($col < $matrix_size - 3 && $row < $matrix_size - 3) {\n                $product = diagonalRightProduct($grid_matrix, $row, $col);\n                if ($product > $maxProduct) {\n                    $maxProduct = $product;\n                }\n            }\n            // diagonal left\n            if ($col > 2 && $row < $matrix_size - 3) {\n                $product = diagonalLeftProduct($grid_matrix, $row, $col);\n                if ($product > $maxProduct) {\n                    $maxProduct = $product;\n                }\n            }\n        }\n    }\n\n    return $maxProduct;\n}\n\n", "num_lines": 154}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Problem:\n *\n * Each new term in the Fibonacci sequence is generated by adding the previous\n * two terms. By starting with 1 and 2, the first 10 terms will be:\n *\n * 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...\n *\n * By considering the terms in the Fibonacci sequence whose values do not\n * exceed four million, find the sum of the even-valued terms.\n *\n *\n * Answer:\n *\n * 4613732\n *\n *\n * @link https://projecteuler.net/problem=2\n */\n\n/**\n * @return int\n */\nfunction problem2(): int\n{\n    $maxNumber = 4000000;\n    $currNumber = 1;\n    $nextNumber = 2;\n    $answer = 0;\n\n    while ($currNumber <= $maxNumber) {\n        $answer += $currNumber % 2 == 0 ? $currNumber : 0;\n        [$currNumber, $nextNumber] = [$nextNumber, $currNumber + $nextNumber];\n    }\n\n    return $answer;\n}\n", "num_lines": 40}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Problem:\n *\n * The prime factors of 13195 are 5, 7, 13 and 29.\n *\n * What is the largest prime factor of the number 600851475143?\n *\n *\n * Answer:\n *\n * 6857\n *\n *\n * @link https://projecteuler.net/problem=3\n */\n\n/**\n * @return int\n */\nfunction problem3(): int\n{\n    $n = 600851475143;\n    $i = 2;\n    while ($i * $i < $n) {\n        while ($n % $i == 0) {\n            $n /= $i;\n        }\n        $i++;\n    }\n\n    return $n;\n}\n", "num_lines": 35}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Problem:\n * A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 \u00c3\u2014 99.\n * Find the largest palindrome made from the product of two 3-digit numbers.\n */\n\n/**\n * @return int\n */\nfunction problem4(): int\n{\n    $largest  = 0;\n\n    for ($i=100; $i<1000; $i++){\n\n        for ($j=$i; $j<1000; $j++) {\n            $product = $i*$j;\n\n            if ( strrev((string)$product) == (string)$product && $product > $largest) {\n                $largest = $product;\n            }\n        }\n    }\n\n    return $largest;\n}\n", "num_lines": 29}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * This function solves the problem 5 of the Project Euler.\n *\n * Problem description:\n * 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.\n * What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?\n */\n\n/**\n * @return int\n */\nfunction problem5(): int\n{\n    $number = 20;\n    while (true) {\n        $isSolution = true;\n        for ($i = 11; $i <= 20; $i++) {\n            if ($number % $i !== 0) {\n                $isSolution = false;\n                break;\n            }\n        }\n        if ($isSolution) {\n            return $number;\n        }\n        $number += 20;\n    }\n}\n", "num_lines": 31}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * This function solves the problem 6 of the Project Euler.\n *\n * Problem description:\n * The sum of the squares of the first ten natural numbers is,\n *              1 ** 2 + 2 ** 2 + ... + 10 ** 2 = 385 \n *\n * The square of the sum of the first ten natural numbers is,\n *              (1 + 2 + ... + 10) ** 2 = 3025 \n *\n * Hence the difference between the sum of the squares of the\n * first ten natural numbers and the square of the sum is .\n *              3025 - 385 = 2640\n *\n * Find the difference between the sum of the squares of the\n * first one hundred natural numbers and the square of the sum.\n *\n * Answer: 25164150\n *\n * @param int $maxNumber Range from 1 to <maxNumber>\n *\n * @return int Difference between the sum of the squares and\n * the square of the sum\n *\n * @link https://projecteuler.net/problem=6\n */\n\n/**\n * @param int $maxNumber Range from 1 to <maxNumber>\n *\n * @return int Difference between the sum of the squares and\n * the square of the sum\n */\nfunction problem6(int $maxNumber = 100): int\n{\n    $sumOfSquares = 0;\n    $sums = 0;\n    for ($i = 1; $i <= $maxNumber; $i++) {\n        $sumOfSquares += $i ** 2; // add squares to the sum of squares\n        $sums += $i; // add number to sum to square later\n    }\n    return ($sums ** 2) - $sumOfSquares; // difference of square of the total sum and sum of squares\n}\n", "num_lines": 46}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * This function solves the problem 7 of the Project Euler.\n *\n * Problem description:\n * By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.\n * What is the 10 001st prime number?\n */\n\n/**\n * @return int\n */\nfunction problem7(): int\n{\n    $numberOfPrimes = 0;\n    $number = 0;\n    while ($numberOfPrimes < 10001) {\n        $number++;\n        if (isPrime($number)) {\n            $numberOfPrimes++;\n        }\n    }\n    return $number;\n}\n", "num_lines": 26}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * This function solves the problem 8 of the Project Euler.\n *\n * Problem description:\n *The four adjacent digits in the 1000-digit number that have the greatest product are 9 \u00c3\u2014 9 \u00c3\u2014 8 \u00c3\u2014 9 = 5832.\n\n *73167176531330624919225119674426574742355349194934\n 96983520312774506326239578318016984801869478851843\n 85861560789112949495459501737958331952853208805511\n 12540698747158523863050715693290963295227443043557\n 66896648950445244523161731856403098711121722383113\n 62229893423380308135336276614282806444486645238749\n 30358907296290491560440772390713810515859307960866\n 70172427121883998797908792274921901699720888093776\n 65727333001053367881220235421809751254540594752243\n 52584907711670556013604839586446706324415722155397\n 53697817977846174064955149290862569321978468622482\n 83972241375657056057490261407972968652414535100474\n 82166370484403199890008895243450658541227588666881\n 16427171479924442928230863465674813919123162824586\n 17866458359124566529476545682848912883142607690042\n 24219022671055626321111109370544217506941658960408\n 07198403850962455444362981230987879927244284909188\n 84580156166097919133875499200524063689912560717606\n 05886116467109405077541002256983155200055935729725\n 71636269561882670428252483600823257530420752963450\n\n *Find the thirteen adjacent digits in the 1000-digit number that have the greatest product. What is the value of this product?\n */\n\n/**\n * @return int\n */\nfunction problem8(): int\n{\n    $theNumber = \"73167176531330624919225119674426574742355349194934\" .\n        \"96983520312774506326239578318016984801869478851843\" .\n        \"85861560789112949495459501737958331952853208805511\" .\n        \"12540698747158523863050715693290963295227443043557\" .\n        \"66896648950445244523161731856403098711121722383113\" .\n        \"62229893423380308135336276614282806444486645238749\" .\n        \"30358907296290491560440772390713810515859307960866\" .\n        \"70172427121883998797908792274921901699720888093776\" .\n        \"65727333001053367881220235421809751254540594752243\" .\n        \"52584907711670556013604839586446706324415722155397\" .\n        \"53697817977846174064955149290862569321978468622482\" .\n        \"83972241375657056057490261407972968652414535100474\" .\n        \"82166370484403199890008895243450658541227588666881\" .\n        \"16427171479924442928230863465674813919123162824586\" .\n        \"17866458359124566529476545682848912883142607690042\" .\n        \"24219022671055626321111109370544217506941658960408\" .\n        \"07198403850962455444362981230987879927244284909188\" .\n        \"84580156166097919133875499200524063689912560717606\" .\n        \"05886116467109405077541002256983155200055935729725\" .\n        \"71636269561882670428252483600823257530420752963450\";\n    $greatestProduct = 0;\n    $substringSize = 13;\n\n    for ($i = 0; $i < strlen($theNumber) - $substringSize; $i++) {\n        $currentSubstring = substr($theNumber,$i,$substringSize);\n        $currentProduct = 0;\n\n        for ($j = 0; $j < strlen ($currentSubstring); $j++) {\n           $currentProduct = ($currentProduct == 0 ? (int)$currentSubstring[$j] : $currentProduct * (int)$currentSubstring[$j]);\n        }\n\n        $greatestProduct = ($greatestProduct < $currentProduct ? $currentProduct : $greatestProduct);\n    }\n\n    return $greatestProduct;\n}\n", "num_lines": 74}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * This function solves the problem 9 of the Project Euler.\n *\n * Problem description:\n * A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,\n *\n * a^2 + b^2 = c^2\n *\n * For example:\n *\n * 3^2 + 4^2 = 9 + 16 = 25 = 5^2.\n *\n * There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc.\n */\n\n/**\n * @return int\n */\nfunction problem9(): int\n{\n    for ($i = 0; $i <= 300; $i++) {\n        for ($j = 0; $j <= 400; $j++) {\n            $k = 1000 - $i - $j;\n            if ($i * $i + $j * $j === $k * $k) {\n                return $i * $j * $k;\n            }\n        }\n    }\n    return 0;\n}\n", "num_lines": 33}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Binary search algorithm iterative approach\n *\n * Be careful collection must be ascending sorted, otherwise result will be unpredictable\n *\n * Examples:\n * binarySearchIterative([0, 5, 7, 10, 15], 0);\n * 0\n * binarySearchIterative([0, 5, 7, 10, 15], 15);\n * 4\n * binarySearchIterative([0, 5, 7, 10, 15], 5);\n * 1\n * binarySearchIterative([0, 5, 7, 10, 15], 6);\n *\n * @param array $list\n * @param int $target\n * @return int\n */\nfunction binarySearchIterative($list, $target)\n{\n    $first = 0;\n    $last = count($list)-1;\n\n\n    while ($first <= $last) {\n        $mid = ($first + $last) >> 1;\n\n\n        if ($list[$mid] == $target) {\n            return $mid;\n        } elseif ($list[$mid] > $target) {\n            $last = $mid - 1;\n        } elseif ($list[$mid] < $target) {\n            $first = $mid + 1;\n        }\n    }\n\n    return null;\n}\n\n/**\n * Binary search algorithm in PHP by recursion\n *\n * Be careful collection must be ascending sorted, otherwise result will be unpredictable\n *\n * Examples:\n * binarySearchByRecursion([0, 5, 7, 10, 15], 0, 0, 4);\n * 0\n * binarySearchByRecursion([0, 5, 7, 10, 15], 15, 0, 4);\n * 4\n * binarySearchByRecursion([0, 5, 7, 10, 15], 5, 0, 4);\n * 1\n * binarySearchByRecursion([0, 5, 7, 10, 15], 6, 0, 4);\n *\n * @param Array $list a sorted array list of integers to search\n * @param integer $target an integer number to search for in the list\n * @param integer $start an integer number where to start searching in the list\n * @param integer $end an integer number where to end searching in the list\n * @return integer the index where the target is found (or null if not found)\n */\nfunction binarySearchByRecursion($list, $target, $start, $end)\n{\n    if (count($list) == 0) {\n        return null;\n    }\n\n    if (count($list) < 2) {\n        return $list[0] == $target ? 0 : null;\n    }\n\n    if ($start > $end)\n        return null;\n\n\n    $mid = ($start + $end) >> 1;\n\n\n    if ($list[$mid] == $target) {\n        return $mid;\n    } elseif ($list[$mid] > $target) {\n        return binarySearchByRecursion($list, $target, $start, $mid-1);\n    } elseif ($list[$mid] < $target) {\n        return binarySearchByRecursion($list, $target, $mid+1, $end);\n    }\n\n    return null;\n}\n", "num_lines": 90}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/*\n * Exponential Search Algorithm\n *\n * The algorithm consists of two stages.\n * The first stage determines a range in which the search key would reside \n **** if it were in the list.\n * In the second stage, a binary search is performed on this range.\n */\n /**\n  * @param Array $arr\n  * @param int $value\n  * @param int $floor\n  * @param int $ceiling\n  * @return int\n  **/\nfunction binarySearch ($arr, $value, $floor, $ceiling) {\n  // Get $middle index\n  $mid = floor(($floor + $ceiling) / 2);\n  // Return position if $value is at the $mid position\n  if ($arr[$mid] === $value) {\n    return (int) $mid;\n  }\n  //Return -1 is range is wrong\n  if ($floor > $ceiling) return -1;\n  // search the left part of the $array\n  // If the $middle element is great than the $value\n  if ($arr[$mid] > $value) {\n    return binarySearch($arr, $value, $floor, $mid - 1);\n  }\n  // search the right part of the $array\n  // If the $middle element is lower than the $value\n  else {\n    return binarySearch($arr, $value, $mid + 1, $ceiling);\n  }\n}\n /**\n  * @param Array $arr\n  * @param int $length\n  * @param int $value\n  * @return int\n  **/\nfunction exponentialSearch ($arr, $value) {\n  // If $value is the first element of the $array return this position\n  if ($arr[0] === $value) {\n    return 0;\n  }\n\n  // Find range for binary search\n  $i = 1;\n  $length = count($arr);\n  while ($i < $length && $arr[$i] <= $value) {\n    $i = $i * 2;\n  }\n  $floor = $i/2;\n  $ceiling = min($i, $length);\n\n  // Call binary search for the range found above\n  return binarySearch($arr, $value, $floor, $ceiling);\n}", "num_lines": 60}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/*\n * Function to find nth number in Fibonacci sequence.\n * Uses a version of memoization and runs very fast!\n */\n\n/**\n * @param int $n position to check\n * @param array $m array to store solved trees\n */\nfunction fibonacciPosition(int $n, array &$m = [])\n{\n    if(isset($m[$n])) return $m[$n];\n    if($n < 2) return $n;\n\n    $m[$n] = fibonacciPosition($n - 1, $m) + fibonacciPosition($n - 2, $m);\n\n    return $m[$n];\n\n}\n\nprint fibonacciPosition(59);\n", "num_lines": 24}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n * Interpolation Search********\n * \n * \n * Description***********\n * Searches for a key in a sorted array\n * \n * \n * How************\n * Loop through the array:\n * Determine the index from the low and high indices\n * if the (value of index in array) is = key return the \"POSITION\", end loop\n * if the (value of index in array) is < key increase the low index\n * if the (value of index in array) is > key decrease the high index\n * repeat the loop\n */\nfunction interpolationSearch($arr, $key) {\n  $length = count($arr) - 1;\n  $low = 0;\n  $high = $length;\n  $position = -1;\n  //loop, between low & high\n  while ($low <= $high && $key >= $arr[$low] && $key <= $arr[$high]) {\n    //GET INDEX\n    $delta = ($key - $arr[$low]) / ($arr[$high] - $arr[$low]);\n    $index = $low + floor(($high - $low) * $delta);\n    //GET VALUE OF INDEX IN ARRAY...\n    $indexValue = $arr[$index];\n    if ($indexValue === $key) {\n      //index value equals key\n      //FOUND TARGET\n      //return index value\n      $position = $index;\n      return (int) $position;\n    }\n    if ($indexValue < $key) {\n      //index value lower than key\n      //increase low index\n      $low = $index + 1;\n    } \n    if ($indexValue > $key) {\n      //index value higher than key\n      //decrease high index\n      $high = $index - 1;\n    }\n  }\n  //when key not found in array or array not sorted\n  return null;\n}", "num_lines": 50}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n   * Jump Search algorithm in PHP\n   * References: https://www.geeksforgeeks.org/jump-search/\n   * The list must be sorted in ascending order before performing jumpSearch\n   *\n   * @param Array $list refers to a sorted list of integer \n   * @param integer $key refers to the integer target to be searched from the sorted list\n   * @return index of $key if found, otherwise -1 is returned\n */\n   \nfunction jumpSearch($list,$key)\n{\n\t/*number of elements in the sorted array*/\n\t$num = count($list);\n\t/*block size to be jumped*/\n\t$step = (int)sqrt($num);\n\t$prev = 0;\n\t\n\twhile ($list[min($step, $num)-1] < $key)\n\t{\n\t\t$prev = $step;\n\t\t$step += (int)sqrt($num);\n\t\tif ($prev >= $num)\n\t\t\treturn -1;\n\t}\n\n\t/*Performing linear search for $key in block*/\n\twhile ($list[$prev] < $key)\n\t{\n\t\t$prev++;\n\t\tif ($prev == min($step, $num))\n\t\t\treturn -1;\n\t}\n\t\n     return $list[$prev] === $key ? $prev : -1;\n}\n\n\n\n", "num_lines": 41}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Linear search in PHP\n *\n * Reference: https://www.geeksforgeeks.org/linear-search/\n *\n * @param Array $list a array of integers to search\n * @param integer $target an integer number to search for in the list\n * @return integer the index where the target is found (or -1 if not found)\n *\n * Examples:\n *  data =  5, 7, 8, 11, 12, 15, 17, 18, 20\n *  x = 15\n *  Element found at position 6\n *\n *  x = 1\n *  Element not found\n *\n *  @param Array $list a array of integers to search\n *  @param integer $target an integer number to search for in the list\n *  @return integer the index where the target is found (or -1 if not found)\n */\nfunction linearSearch($list, $target)\n{\n    $n = sizeof($list);\n    for($i = 0; $i < $n; $i++)\n    {\n        if($list[$i] == $target) {\n            return $i + 1;\n        }\n    }\n\n    return -1;\n}\n", "num_lines": 36}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\nrequire_once __DIR__ . '/../vendor/autoload.php';\nrequire_once __DIR__ . '/../Utils/ArrayHelpers.php';\n\n/**\n * Lower Bound of an element is minimum index that an element would be placed\n * if it is added into that sorted array\n *\n * [C++ Lower Bound](http://www.cplusplus.com/reference/algorithm/lower_bound/)\n *\n * It is assumed that an integer array is provided\n * and the second parameter is also a integer\n *\n * @param array of sorted integers\n * @param integer whose lower bound is to be found\n *\n * @return the index of lower bound of the given element\n */\nfunction lowerBound(array $arr, int $elem){\n    isSortedAscendingInts($arr);\n    $hi = count($arr);\n    $lo = 0;\n\n    while($lo < $hi){\n        $mid = $lo + floor(($hi - $lo)/2);\n\n        if($arr[$mid] < $elem){\n            $lo = $mid+1;\n        }else{\n            $hi = $mid;\n        }\n    }\n\n    return $lo;\n}\n", "num_lines": 37}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/* Ternary search is similar to binary search\n * It rather divides the sorted array into three parts rather than.two parts by using two middle points, $mid1  $mid2.\n * The value of the $key will first be compared with the two $mid points, the value will be returned if there is a match.\n * Then, if the value of the $key is less than $mid1, narrow the interval to the first part.\n * Else, if the value of the $key is greater than $mid2, narrow the interval to the third part.\n * Otherwise, narrow the interval to the $middle part.\n * Repeat the steps until the value is found or the interval is empty (value not found after checking all elements).\n */\n\nfunction ternarySearchByRecursion ($arr, $key, $low, $high) {\n  \n    //Return -1 if high lesser than low, we can't find item in the whole array\n    if ($high < $low) {\n      return null;\n    }\n    \n    \n    //get $mid1 and $mid2\n    $mid1 = floor($low + ($high - $low) / 3);\n    $mid2 = floor($high - ($high - $low) / 3);\n    // check if $key is found at any $mid\n    if ($arr[$mid1] === $key) {\n      // return index of $key if found\n      return $mid1;\n    }\n    if ($arr[$mid2] === $key) {\n      // return index of $key if found\n      return $mid2;\n    }\n    \n    // since the $key is not found at $mid,\n    // check in which region it is present\n    // and repeat the Search operation\n    // in that region\n    if ($key < $arr[$mid1]) {\n      // the $key lies in between $low and $mid1\n      return ternarySearchByRecursion($arr, $key, $low, $mid1 - 1);\n    } else if ($key > $arr[$mid2]) {\n      // the $key lies in between $mid2 and $high\n      return ternarySearchByRecursion($arr, $key, $mid2 + 1, $high);\n    } else {\n      // the $key lies in between $mid1 and $mid2\n      return ternarySearchByRecursion($arr, $key, $mid1 + 1, $mid2 - 1);\n    }\n}\n\nfunction ternarySearchIterative ($arr, $key) {\n  $low = 0; $high = count($arr) - 1;\n  while ($high >= $low) {\n    // find the $mid1 and $mid2\n    $mid1 = floor($low + ($high - $low) / 3);\n    $mid2 = floor($high - ($high - $low) / 3);\n\n    // check if $key is found at any $mid\n    if ($arr[$mid1] === $key) {\n      // return index of $key if found\n      return $mid1;\n    }\n    if ($arr[$mid2] === $key) {\n      // return index of $key if found\n      return $mid2;\n    }\n\n    // since the $key is not found at $mid,\n    // check in which region it is present\n    // and repeat the Search operation\n    // in that region\n    if ($key < $arr[$mid1]) {\n      // the $key lies in between $low and $mid1\n      $high = $mid1 - 1;\n    } else if ($key > $arr[$mid2]) {\n      // the $key lies in between $mid2 and $high\n      $low = $mid2 + 1;\n    } else {\n      // the $key lies in between $mid1 and $mid2\n      $low = $mid1 + 1;\n      $high = $mid2 - 1;\n    }\n  }\n  // the $key was not found\n  return null;\n}\n", "num_lines": 84}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\nrequire_once __DIR__ . '/../vendor/autoload.php';\nrequire_once __DIR__ . '/../Utils/ArrayHelpers.php';\n\n/**\n * Upper Bound of an element is maximum index that an element would be placed\n * if it is added into that sorted array\n *\n * [C++ Lower Bound](http://www.cplusplus.com/reference/algorithm/upper_bound/)\n *\n * It is assumed that an integer array is provided\n * and the second parameter is also a integer\n *\n * @param array of sorted integers\n * @param integer whose upper bound is to be found\n *\n * @return the index of upper bound of the given element\n */\nfunction upperBound(array $arr, int $elem){\n    isSortedAscendingInts($arr);\n    $hi = count($arr);\n    $lo = 0;\n\n    while($lo < $hi){\n        $mid = $lo + floor(($hi - $lo)/2);\n\n        if($arr[$mid] <= $elem){\n            $lo = $mid + 1;\n        }else{\n            $hi = $mid;\n        }\n    }\n\n    return $lo;\n}\n", "num_lines": 37}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n *  Sort an \"Array of objects\" or \"Array of arrays\" by keys\n */\n\nclass ArrayKeysSort\n{\n    public const ORDER_ASC = 'ASC';\n    public const ORDER_DESC = 'DESC';\n\n    /**\n     * @param $collection\n     * @param array $keys\n     * @param string $order\n     * @param bool $isCaseSensitive\n     * @return mixed\n     */\n    public static function sort(\n        $collection,\n        array $keys,\n        string $order = self::ORDER_ASC,\n        bool $isCaseSensitive = false\n    ) {\n        if (!empty($collection) && !empty($keys)) {\n            try {\n                usort(\n                    $collection,\n                    function ($a, $b) use ($keys, $order, $isCaseSensitive) {\n                        $pos = 0;\n                        do {\n                            $key = $keys[$pos];\n                            if (is_array($a)) {\n                                if (!isset($a[$key]) || !isset($b[$key])) {\n                                    $errorMsg = 'The key \"' . $key\n                                        . '\" does not exist in the collection';\n                                    throw new Exception($errorMsg);\n                                }\n                                $item1 = !$isCaseSensitive\n                                    ? strtolower($a[$key]) : $a[$key];\n                                $item2 = !$isCaseSensitive\n                                    ? strtolower($b[$key]) : $b[$key];\n                            } else {\n                                if (!isset($a->$key) || !isset($b->$key)) {\n                                    $errorMsg = 'The key \"' . $key\n                                        . '\" does not exist in the collection';\n                                    throw new Exception($errorMsg);\n                                }\n                                $item1 = !$isCaseSensitive\n                                    ? strtolower($a->$key) : $a->$key;\n                                $item2 = !$isCaseSensitive\n                                    ? strtolower($b->$key) : $b->$key;\n                            }\n                        } while ($item1 === $item2 && !empty($keys[++$pos]));\n\n                        if ($item1 === $item2) {\n                            return 0;\n                        } elseif ($order === self::ORDER_ASC) {\n                            return ($item1 < $item2) ? -1 : 1;\n                        } else {\n                            return ($item1 > $item2) ? -1 : 1;\n                        }\n                    }\n                );\n            } catch (Exception $e) {\n                echo $e->getMessage();\n                die();\n            }\n        }\n\n        return $collection;\n    }\n}\n", "num_lines": 73}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Bubble Sort\n *\n * @param array $array\n * @return array\n */\nfunction bubbleSort($array) {\n    $length = count($array);\n\n    for ($i = $length; $i > 0; $i--) {\n        $swapped = true;\n\n        for ($j=0;$j<$i-1;$j++) {\n            if ($array[$j] > $array[$j + 1]) {\n                $temp = $array[$j];\n                $array[$j] = $array[$j + 1];\n                $array[$j + 1] = $temp;\n                $swapped = false;\n            }\n        }\n\n        if ($swapped) break;\n    }\n\n    return $array;\n}\n", "num_lines": 29}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/*\n * Bubble Sort\n *\n * Compare numbers in an array 2 at a time and switch them if the second number is smaller\n *\n * @param array $input array of random numbers\n * @return array sorted array of numbers\n */\nfunction bubbleSort2(array $input)\n{\n    // Return nothing if input is empty\n    if(!isset($input))\n    {\n        return [];\n    }\n\n    do\n    {\n        $swapped = false;\n\n        for($i = 0, $count = sizeof($input) - 1; $i < $count; $i++)\n        {\n            if($input[$i + 1] < $input[$i])\n            {\n                list($input[$i + 1], $input[$i]) = [$input[$i], $input[$i + 1]];\n                $swapped = true;\n            }\n        }\n    }\n    while($swapped);\n\n    return $input;\n}\n", "num_lines": 35}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n\n/**\n * @param $array\n * @param $min\n * @param $max\n * @return mixed\n */\nfunction countSort($array, $min, $max)\n{\n    $count = array();\n\n    for($i = $min; $i <= $max; $i++)\n    {\n        $count[$i] = 0;\n    }\n\n    foreach($array as $number)\n    {\n        $count[$number]++;\n    }\n\n    $z = 0;\n\n    for($i = $min; $i <= $max; $i++) {\n        while( $count[$i]-- > 0 ) {\n            $array[$z++] = $i;\n        }\n    }\n\n    return $array;\n}\n", "num_lines": 34}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Gnome Sort\n * References:\n * https://www.geeksforgeeks.org/gnome-sort-a-stupid-one/\n * \n * The Gnome algorithm works by\u00c2\u00a0locating\u00c2\u00a0the first instance in which two adjoining elements are arranged incorrectly and swaps with each other.\n * \n * @param array $array refers to the array to be sorted\n * @return array\n */\n\nfunction gnomeSort($array){\n    $a = 1;\n    $b = 2;\n\n    while($a < count($array)){\n\n        if ($array[$a-1] <= $array[$a]){\n            $a = $b;\n            $b++;\n        }else{\n            list($array[$a],$array[$a-1]) = array($array[$a-1],$array[$a]);\n            $a--;\n            if($a == 0){\n                $a = $b;\n                $b++;\n            }\n        }\n    }\n\n    return $array;\n}\n", "num_lines": 35}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Insertion Sort\n *\n * @param array $array\n * @return array\n */\nfunction insertionSort(array $array)\n{\n    for ($i = 1; $i < count($array); $i++)\n    {\n        $currentVal = $array[$i];\n\n        for ($j = $i - 1; $j >= 0 && $array[$j] > $currentVal; $j--)\n        {\n          $array[$j + 1] = $array[$j];\n        }\n\n        $array[$j + 1] = $currentVal;\n    }\n\n    return $array;\n}\n\n\n", "num_lines": 27}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Merge Sort\n *\n * @param array $arr\n * @return array\n */\nfunction mergeSort(array $arr)\n{\n    if (count($arr) <= 1) {\n      return $arr;\n    }\n\n    $mid = floor( count($arr) / 2 );\n    $leftArray = mergeSort( array_slice($arr, 0, $mid) );\n    $rightArray = mergeSort( array_slice($arr, $mid) );\n\n    return merge($leftArray, $rightArray);\n}\n\n/**\n * @param array $leftArray\n * @param array $rightArray\n * @return array\n */\nfunction merge(array $leftArray, array $rightArray)\n{\n    $result = [];\n    $i = 0;\n    $j = 0;\n\n    while ($i < count($leftArray) && $j < count($rightArray)) {\n        if ($rightArray[$j] > $leftArray[$i]) {\n            $result[] = $leftArray[$i];\n            $i++;\n        } else {\n            $result[] = $rightArray[$j];\n            $j++;\n        }\n    }\n\n    while ($i < count($leftArray)) {\n        $result[] = $leftArray[$i];\n        $i++;\n    }\n\n    while ($j < count($rightArray)) {\n        $result[] = $rightArray[$j];\n        $j++;\n    }\n\n    return $result;\n}\n\n\n\n", "num_lines": 58}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n * Quick Sort\n * Compare number in an array to the next number and sets to new array (greater than or less than)\n *\n * @param array $input array of random numbers\n * @return array sorted array of numbers\n */\nfunction quickSort(array $input)\n{\n    // Return nothing if input is empty\n    if(!isset($input))\n    {\n        return [];\n    }\n\n    $lt = [];\n    $gt = [];\n\n    if(sizeof($input) < 2)\n    {\n        return $input;\n    }\n\n    $key = key($input);\n    $shift = array_shift($input);\n\n    foreach($input as $value)\n    {\n        $value <= $shift ? $lt[] = $value : $gt[] = $value;\n    }\n\n    return array_merge(quickSort($lt), [$key => $shift], quickSort($gt));\n}\n", "num_lines": 35}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Radix Sort\n *\n * @param array $arr\n * @return array\n */\nfunction radixSort($nums)\n{\n    $maxDigitsCount = maxDigits($nums);\n    for ($k=0; $k < $maxDigitsCount; $k++)\n    {\n        $digitBucket = array_fill(0,10,[]);\n\n        for ($i=0; $i < count($nums); $i++)\n        {\n            $digitBucket[getDigit($nums[$i], $k)][] = $nums[$i];\n        }\n\n        $nums = concat($digitBucket);\n    }\n\n    return $nums;\n}\n\n\n/*\n * Helper functions\n */\n\n\n/**\n * Get the digits value by it's place\n *\n * @param $num\n * @param $k\n * @return int\n */\nfunction getDigit($num, $i)\n{\n    return floor(abs($num) / pow(10, $i)) % 10;\n}\n\n/**\n * Get the digits count\n *\n * @param $nums\n * @return int\n */\nfunction digitsCount($num)\n{\n    if ($num == 0) return 1;\n    return floor(log10(abs($num))) + 1;\n}\n\n/**\n * Get the max digits count\n *\n * @param $nums\n * @return int\n */\nfunction maxDigits($arr)\n{\n    $maxDigits = 0;\n\n    for ($i=0; $i < count($arr); $i++)\n    {\n        $maxDigits = max($maxDigits, digitsCount($arr[$i]));\n    }\n\n    return $maxDigits;\n}\n\n/**\n * Concat the array\n *\n * @param $arr\n * @return array\n */\nfunction concat(array $array) {\n    $newArray=[];\n\n    for ($i = 0; $i < count($array); $i++)\n    {\n      for ($j = 0; $j<count($array[$i]); $j++)\n      {\n          $newArray[] = $array[$i][$j];\n      }\n    }\n    return $newArray;\n}\n", "num_lines": 93}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Selection Sort\n *\n * @param array $array\n * @return array\n */\nfunction selectionSorting(array $array)\n{\n    $length = count($array);\n\n    for ($i = 0; $i < $length; $i++)\n    {\n        $lowest = $i;\n\n        for ($j = $i + 1; $j < $length; $j++)\n        {\n            if ($array[$j] < $array[$lowest])\n            {\n                $lowest = $j;\n            }\n        }\n\n        if ($i !==$lowest)\n        {\n            $temp = $array[$i];\n            $array[$i] = $array[$lowest];\n            $array[$lowest] = $temp;\n        }\n    }\n\n    return $array;\n}\n", "num_lines": 35}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Checks if two strings are anagrams of each other.\n *\n * @param string $originalString\n * @param string $testString\n * @param bool $caseInsensitive\n * @return bool\n */\nfunction isAnagram(string $originalString, string $testString, bool $caseInsensitive = true)\n{\n    if ($caseInsensitive)\n    {\n        $originalString = strtolower($originalString); // Converting string to lowercase for case-insensitive check\n        $testString = strtolower($testString);\n    }\n\n    // count_chars(string, mode = 1) returns key-value pairs with character as key, frequency as value\n    // We can directly compare the arrays in this case\n    if (count_chars($originalString, 1) == count_chars($testString, 1))\n    {\n        return true;\n    }\n    else\n    {\n        return false;\n    }\n}\n", "num_lines": 30}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Checks if a string is a palindrome\n *\n * @param string $string\n * @param bool $caseInsensitive\n * @return bool\n */\nfunction isPalindrome(string $string, bool $caseInsensitive = true)\n{\n    $string = trim($string); // Removing leading and trailing spaces\n\n    if (empty($string))\n    {\n        return false; // Returning false for an Empty String\n    }\n\n    if ($caseInsensitive)\n    {\n        $string = strtolower($string); // Converting string to lowercase for case-insensitive check\n    }\n\n    $characters = str_split($string);\n\n    for ($i = 0; $i < count($characters); $i++)\n    {\n        if ($characters[$i] !== $characters[count($characters) - ($i + 1)])\n        {\n            return false;\n        }\n    }\n\n    return true;\n}\n", "num_lines": 36}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * This is a simple way to check palindrome string\n * using php strrev() function\n * make it simple\n *\n * @param string $string\n * @param bool $caseInsensitive\n */\nfunction checkPalindromeString(string $string, bool $caseInsensitive = true): String\n{\n    //removing spaces\n    $string = trim($string);\n\n    if (empty($string))\n    {\n        throw new \\Exception('You are given empty string. Please give a non-empty string value');\n    }\n\n    /**\n     * for case-insensitive\n     * lowercase string conversion\n     */\n    if ($caseInsensitive)\n    {\n        $string = strtolower($string);\n    }\n\n    if ($string !== strrev($string))\n    {\n        return $string . \" - not a palindrome string.\" . PHP_EOL;\n    }\n\n    return $string . \" - a palindrome string.\" . PHP_EOL;\n}\n", "num_lines": 37}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * Function returns the total number of consonants present in the given\n * string using a linear search through the string\n *\n * @param string $string\n * @return int\n */\nfunction countConsonants(string $string): Int\n{\n    if (empty($string)) {\n        throw new \\Exception('Please pass a non-empty string value');\n    }\n\n    $vowels     = ['a', 'e', 'i', 'o', 'u']; // Vowels Set\n    $string     = strtolower($string); // For case-insensitive checking\n\n    $consonantCount = 0;\n\n    for ($i = 0; $i < strlen($string); $i++)\n    {\n      if (!in_array($string[$i], $vowels) &&\n        $string[$i] >= 'a' && $string[$i] <= 'z')\n        {\n            $consonantCount++;\n        }\n    }\n\n    return $consonantCount;\n}\n", "num_lines": 32}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * This is a simple way to count sentence\n * using php preg_match_all() function\n *\n * @param string $sentence\n * @return int\n */\nfunction countSentences(string $sentence): int\n{\n    $sentence = trim($sentence);\n\n    return preg_match_all('/[^\\s|^\\...](\\.|\\!|\\?)(?!\\w)/', $sentence);\n}\n", "num_lines": 16}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n * This function returns the total number of vowels present in\n * the given string using a simple method of looping through\n * all the characters present in the string.\n *\n * @param string $string\n * @return int   $numberOfVowels\n */\nfunction countVowelsSimple(string $string)\n{\n    if (empty($string))\n    {\n        throw new \\Exception('Please pass a non-empty string value');\n    }\n\n    $numberOfVowels = 0;\n    $vowels     = ['a', 'e', 'i', 'o', 'u']; // Vowels Set\n    $string     = strtolower($string); // For case-insensitive checking\n    $characters = str_split($string); // Splitting the string to a Character Array.\n\n    foreach ($characters as $character)\n    {\n        if (in_array($character, $vowels))\n        {\n            $numberOfVowels++;\n        }\n    }\n\n    return $numberOfVowels;\n}\n\n/**\n * This function returns the Total number of vowels present in the given\n * string using a regular expression.\n *\n * @param string $string\n * @return int\n */\nfunction countVowelsRegex(string $string)\n{\n    if (empty($string))\n    {\n        throw new \\Exception('Please pass a non-empty string value');\n    }\n    $string = strtolower($string); // For case-insensitive checking\n\n    return preg_match_all('/[a,e,i,o,u]/', $string);\n}\n", "num_lines": 50}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n * Find distance (Levenshtein distance)\n *\n * Compute the difference between two sequences, ie, the minimum number of changes\n * to get to $str2 from $str1\n *\n * @param string $str1\n * @param string $str2\n * @return int the minimum number of changes to transform one string into another\n */\nfunction findDistance($str1, $str2)\n{\n    $lenStr1 = strlen($str1);\n    $lenStr2 = strlen($str2);\n\n    if ($lenStr1 == 0) {\n        return $lenStr2;\n    }\n\n    if ($lenStr2 == 0) {\n        return $lenStr1;\n    }\n\n    $distanceVectorInit = [];\n    $distanceVectorFinal = [];\n\n    for ($i = 0; $i < $lenStr1 + 1; $i++) {\n        $distanceVectorInit[] = 0;\n        $distanceVectorFinal[] = 0;\n    }\n\n    for ($i = 0; $i < $lenStr1 + 1; $i++) {\n        $distanceVectorInit[$i] = $i;\n    }\n\n    for ($i = 0; $i < $lenStr2; $i++) {\n        $distanceVectorFinal[0] = $i + 1;\n\n        // use formula to fill in the rest of the row\n        for ($j = 0; $j < $lenStr1; $j++) {\n            $substitutionCost = 0;\n\n            if ($str1[$j] == $str2[$i]) {\n                $substitutionCost = $distanceVectorInit[$j];\n            } else {\n                $substitutionCost = $distanceVectorInit[$j] + 1;\n            }\n\n            $distanceVectorFinal[$j+1] = min($distanceVectorInit[$j+1] + 1, min($distanceVectorFinal[$j] + 1, $substitutionCost));\n        }\n\n        $distanceVectorInit = $distanceVectorFinal;\n    }\n\n\n    return $distanceVectorFinal[$lenStr1];\n}\n", "num_lines": 59}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n/**\n * This function returns the character which is repeated maximum number of\n * times in the given string.\n *\n * @param string $string\n * @return string\n */\nfunction maxCharacter(string $string)\n{\n    if (empty($string)) {\n        throw new \\Exception('Please pass a non-empty string value');\n    }\n\n    $characterCountTable = []; // A variable to maintain the character counts\n    $string              = strtolower($string); // For case-insensitive checking\n    $characters          = str_split($string); // Splitting the string to a Character Array.\n\n    foreach ($characters as $character) {\n        $currentCharacterCount = 1;\n\n        if (isset($characterCountTable[$character])) {\n            $currentCharacterCount = $characterCountTable[$character] + 1;\n        }\n\n        $characterCountTable[$character] = $currentCharacterCount;\n    }\n\n    arsort($characterCountTable);\n\n    return array_keys($characterCountTable)[0];\n}\n", "num_lines": 33}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * This function returns a given string in reverse order\n *\n * @param string $string\n * @return string\n */\nfunction reverseString(string $string)\n{\n    $string = trim($string); // Removing leading and trailing spaces\n\n    $characters = str_split($string);\n\n    $reversedCharacters = [];\n\n    for ($i = (count($characters) - 1); $i >= 0; $i--) {\n        $reversedCharacters[] = $characters[$i];\n    }\n\n    return implode('', $reversedCharacters);\n}\n", "num_lines": 23}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * This function returns a given sentence with its words\n * in reverse order\n *\n * @param string $string\n * @return string\n */\nfunction reverseWords(string $text)\n{\n    $text          = trim($text);\n    $words         = explode(' ', $text);\n    $reversedWords = [];\n\n    for ($i = (count($words) - 1); $i >= 0; $i--)\n    {\n        $reversedWords[] = $words[$i];\n    }\n\n    return implode(' ', $reversedWords);\n}\n", "num_lines": 23}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\nuse function PHPUnit\\Framework\\assertEquals;\nuse PHPUnit\\Framework\\TestCase;\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\nrequire_once __DIR__ . '/../../Ciphers/CaesarCipher.php';\nrequire_once __DIR__ . '/../../Ciphers/XORCipher.php';\n\nclass CiphersTest extends TestCase\n{\n    public function testCaesarCipher()\n    {\n        $this->assertEquals('Aopz pz h alza.', encrypt('This is a test.', 7));\n        $this->assertEquals('Aopz pz h alza.', encrypt('This is a test.', 7 + 26));\n        $this->assertEquals('This is a test.', decrypt('Aopz pz h alza.', 7));\n        $this->assertEquals('This is a test.', decrypt('Aopz pz h alza.', 7 + 26));\n    }\n\n    public function testXorCipher()\n    {\n        $input_str = \"test@string\";\n        $key = \"test-key\";\n        $invalid_key = \"wrong-key\";\n        $this->assertEquals( $input_str, xorCipher( xorCipher( $input_str , $key) , $key));\n        $this->assertNotEquals( $input_str, xorCipher( xorCipher( $input_str , $key) , $invalid_key));\n    }\n}\n", "num_lines": 29}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\nuse PHPUnit\\Framework\\TestCase;\nuse function PHPUnit\\Framework\\assertEquals;\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\nrequire_once __DIR__ . '/../../Ciphers/MonoAlphabeticCipher.php';\n\nclass MonoAlphabeticCipherTest extends TestCase\n{\n    public function testMonoAlphabeticCipher(){\n        $alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n        $key = \"yhkqgvxfoluapwmtzecjdbsnri\";\n        $text = \"I love1234 GitHub\";\n        $encryptedText = \"O ambg XojFdh\";\n\n        assertEquals(maEncrypt($key, $alphabet, $text), $encryptedText);\n\n        assertEquals(maDecrypt($key, $alphabet, $encryptedText), \"I love GitHub\");\n\n    }\n}\n\n?>\n", "num_lines": 24}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\nuse function PHPUnit\\Framework\\assertEquals;\nuse PHPUnit\\Framework\\TestCase;\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\nrequire_once __DIR__ . '/../../Ciphers/MorseCode.php';\n\nclass MorseCodeTest extends TestCase\n{\n    public function testMorseCodeCipher()\n    {\n        assertEquals('TEST 123', decode(encode('TEST 123')));\n    }\n}\n", "num_lines": 16}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\nuse function PHPUnit\\Framework\\assertEquals;\nuse PHPUnit\\Framework\\TestCase;\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\n\nrequire_once __DIR__ . '/../../Conversions/BinaryToDecimal.php';\nrequire_once __DIR__ . '/../../Conversions/DecimalToBinary.php';\nrequire_once __DIR__ . '/../../Conversions/OctalToDecimal.php';\nrequire_once __DIR__ . '/../../Conversions/HexadecimalToDecimal.php';\nrequire_once __DIR__ . '/../../Conversions/SpeedConversion.php';\n\nclass ConversionsTest extends TestCase\n{\n    public function testBinaryToDecimal()\n    {\n        assertEquals(binaryToDecimal(111), 7);\n        assertEquals(binaryToDecimal(101), 5);\n        $this->expectException(\\Exception::class);\n        $this->expectExceptionMessage('Please pass a valid Binary Number for Converting it to a Decimal Number.');\n        binaryToDecimal(\"this is a string\");\n    }\n\n    public function testDecimalToBinary()\n    {\n        assertEquals(decimalToBinary(7), 111);\n        assertEquals(decimalToBinary(5), 101);\n        $this->expectException(\\Exception::class);\n        $this->expectExceptionMessage('Please pass a valid Decimal Number for Converting it to a Binary Number.');\n        decimalToBinary(\"this is a string\");\n    }\n\n    public function testOctalToDecimal()\n    {\n        assertEquals(octalToDecimal(10), 8);\n        assertEquals(octalToDecimal(11), 9);\n        assertEquals(octalToDecimal(1115), 589);\n        $this->expectException(\\Exception::class);\n        $this->expectExceptionMessage('Please pass a valid Octal Number for Converting it to a Decimal Number.');\n        octalToDecimal(\"this is a string\");\n    }\n\n    public function testDecimalToOctal()\n    {\n        assertEquals(decimalToOctal(8), 10);\n        assertEquals(decimalToOctal(9), 11);\n        assertEquals(decimalToOctal(589), 1115);\n        $this->expectException(\\Exception::class);\n        $this->expectExceptionMessage('Please pass a valid Decimal Number for Converting it to an Octal Number.');\n        decimalToOctal(\"this is a string\");\n    }\n\n    public function testDecimalToHex()\n    {\n        assertEquals(decimalToHex(10), 'A');\n        assertEquals(decimalToHex(489201875), '1D28A0D3');\n        assertEquals(decimalToHex(171), 'AB');\n        $this->expectException(\\Exception::class);\n        $this->expectExceptionMessage('Please pass a valid Decimal Number for Converting it to a Hexadecimal Number.');\n        decimalToHex(\"this is a string\");\n    }\n\n    public function testHexToDecimal()\n    {\n        assertEquals(hexToDecimal('A'), 10);\n        assertEquals(hexToDecimal('1D28A0D3'), 489201875);\n        assertEquals(hexToDecimal('AB'), 171);\n        $this->expectException(\\Exception::class);\n        $this->expectExceptionMessage('Please pass a valid Hexadecimal Number for Converting it to a Decimal Number.');\n        hexToDecimal(\"this is a string\");\n    }\n\n    public function testSpeedConversion()\n    {\n        assertEquals(convertSpeed(5, 'm/s', 'mph'), 11.18);\n        assertEquals(convertSpeed(5, 'ft/s', 'km/h'), 5.49);\n        assertEquals(convertSpeed(3, 'km/h', 'km/h'), 3);\n        assertEquals(convertSpeed(7, 'kn', 'km/h'), 12.96);\n        assertEquals(convertSpeed(12, 'mph', 'km/h'), 19.31);\n        assertEquals(convertSpeed(0.514, 'm/s', 'kn'), 1);\n\n        $this->expectException(\\Exception::class);\n        convertSpeed('1', 'km/h', 'mph');\n\n        $this->expectException(\\Exception::class);\n        convertSpeed(1, 'km/h', 'miles');\n    }\n}\n", "num_lines": 90}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\nuse PHPUnit\\Framework\\TestCase;\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\nrequire_once __DIR__ . '/../../DataStructures/SinglyLinkedList.php';\n\n/**\n * Tests for the Singly Linked Lists class\n */\nclass SinglyLinkedListTest extends TestCase\n{\n    /**\n     * Create a SinglyLinkedList node\n     */\n    private function createNode(string $string): SinglyLinkedList\n    {\n        $node = new SinglyLinkedList($string[0]);\n\n        for ($i = 1; $i < strlen($string); $i++) {\n            $node->append($string[$i]);\n        }\n\n        return $node;\n    }\n\n    /**\n     * Provider of SinglyLinkedList nodes\n     */\n    public function provideNodes()\n    {\n        return [\n            'IsPalindrome' => [\n                'node' => $this->createNode('hannah'),\n                'expected' => true\n            ],\n            'IsPalindrome2' => [\n                'node' => $this->createNode('hanah'),\n                'expected' => true\n            ],\n            'IsNotPalindrome' => [\n                'node' => $this->createNode('hanbah'),\n                'expected' => false\n            ],\n            'IsNotPalindrome2' => [\n                'node' => $this->createNode('han1h'),\n                'expected' => false\n            ],\n        ];\n    }\n\n    /**\n     * Test the if a SinglyLinkedList is a palindrome\n     *\n     * @dataProvider provideNodes\n     */\n    public function testIsPalindrome($node, $expected): void\n    {\n        $this->assertEquals($expected, $this->isPalindrome($node));\n    }\n\n    /**\n     * Supporting method for testing if a linked list is palindrome\n     */\n    private function isPalindrome(SinglyLinkedList $node): bool\n    {\n        $length = $this->length($node);\n        $pairs = 0;\n        $curr = $node;\n\n        while ($curr instanceof SinglyLinkedList) {\n            if ($this->hasPair($curr->next, $curr->data)) {\n                $pairs++;\n            }\n\n            $curr = $curr->next;\n        }\n\n        return $pairs == floor($length / 2);\n    }\n\n    /**\n     * Supporting method for testing if a linked list is palindrome\n     */\n    private function hasPair($node, string $data): bool\n    {\n        if (! $node instanceof SinglyLinkedList) {\n            return false;\n        }\n\n        $curr = $node;\n\n        while ($curr instanceof SinglyLinkedList) {\n            if ($curr->data == $data) {\n                return true;\n            }\n\n            $curr = $curr->next;\n        }\n\n        return false;\n    }\n\n    /**\n     * Supporting method for testing if a linked list is palindrome\n     */\n    private function length(SinglyLinkedList $node): int\n    {\n        $curr = $node;\n        $counter = 0;\n\n        while ($curr instanceof SinglyLinkedList) {\n            $counter++;\n            $curr = $curr->next;\n        }\n\n        return $counter;\n    }\n\n    /**\n     * Test SinglyLinkedList's delete functionality\n     */\n    public function testDelete(): void\n    {\n        $this->assertEquals(\n            $this->createNode('hanah'), // expected node\n            $this->createNode('hannah')->delete('n'), // actual node\n        );\n\n        $this->assertNotEquals(\n            $this->createNode('hanah'), // expected node\n            $this->createNode('hannah')->delete('h'), // actual node\n        );\n    }\n}\n", "num_lines": 136}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\nrequire_once __DIR__ . '/../../Graphs/BreadthFirstSearch.php';\n\nuse PHPUnit\\Framework\\TestCase;\n\nclass BreadthFirstSearchTest extends TestCase\n{\n    public function testBreadthFirstSearch()\n    {\n        $graph = array(\n            \"A\" => [\"B\", \"C\", \"D\"],\n            \"B\" => [\"A\", \"D\", \"E\"],\n            \"C\" => [\"A\", \"F\"],\n            \"D\" => [\"B\", \"D\"],\n            \"E\" => [\"B\", \"F\"],\n            \"F\" => [\"C\", \"E\", \"G\"],\n            \"G\" => [\"F\"],\n        );\n        $ans = bfs($graph, \"A\", \"F\");\n        $this->assertTrue($ans);\n    }\n    public function testBreadthFirstSearch2()\n    {\n        $graph = array(\n            [1, 2],\n            [2],\n            [0, 3],\n            [3],\n        );\n\n        $ans2 = bfs($graph, 3, 0);\n        $this->assertFalse($ans2);\n    }\n    public function testBreadthFirstSearch3()\n    {\n        $graph = array(\n            [2, 3, 1],\n            [0],\n            [0, 4],\n            [0],\n            [2],\n        );\n        $ans = bfs($graph, 0, 3);\n        $this->assertTrue($ans);\n    }\n}\n\n", "num_lines": 50}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\nrequire_once __DIR__ . '/../../Graphs/DepthFirstSearch.php';\n\nuse PHPUnit\\Framework\\TestCase;\n\nclass DepthFirstSearchTest extends TestCase\n{\n    public function testDepthFirstSearch()\n    {\n        $graph = array(\n            \"A\" => [\"B\", \"C\", \"D\"],\n            \"B\" => [\"A\", \"D\", \"E\"],\n            \"C\" => [\"A\", \"F\"],\n            \"D\" => [\"B\", \"D\"],\n            \"E\" => [\"B\", \"F\"],\n            \"F\" => [\"C\", \"E\", \"G\"],\n            \"G\" => [\"F\"],\n        );\n        $visited = dfs($graph, \"A\");\n        $this->assertEquals([\"A\", \"B\", \"D\", \"E\", \"F\", \"C\", \"G\"], $visited);\n    }\n    public function testDepthFirstSearch2()\n    {\n        $graph = array(\n            [1, 2],\n            [2],\n            [0, 3],\n            [3],\n        );\n\n        $visited = dfs($graph, 2);\n        $this->assertEquals([2, 0, 1, 3], $visited);\n    }\n    public function testDepthFirstSearch3()\n    {\n        $graph = array(\n            [2, 3, 1],\n            [0],\n            [0, 4],\n            [0],\n            [2],\n        );\n        $visited = dfs($graph, 0);\n        $this->assertEquals([0, 2, 4, 3, 1], $visited);\n    }\n}\n", "num_lines": 49}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\nuse function PHPUnit\\Framework\\assertEquals;\nuse function PHPUnit\\Framework\\assertFalse;\nuse function PHPUnit\\Framework\\assertTrue;\nuse PHPUnit\\Framework\\TestCase;\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\nrequire_once __DIR__ . '/../../Maths/AbsoluteMax.php';\nrequire_once __DIR__ . '/../../Maths/ArmstrongNumber.php';\nrequire_once __DIR__ . '/../../Maths/AbsoluteMin.php';\nrequire_once __DIR__ . '/../../Maths/CheckPalindrome.php';\nrequire_once __DIR__ . '/../../Maths/CheckPrime.php';\nrequire_once __DIR__ . '/../../Maths/Factorial.php';\nrequire_once __DIR__ . '/../../Maths/FastExponentiation.php';\nrequire_once __DIR__ . '/../../Maths/Fibonacci.php';\nrequire_once __DIR__ . '/../../Maths/Fibonacci2.php';\nrequire_once __DIR__ . '/../../Maths/NeonNumber.php';\nrequire_once __DIR__ . '/../../Maths/PerfectSquare.php';\nrequire_once __DIR__ . '/../../Maths/Mean.php';\nrequire_once __DIR__ . '/../../Maths/Median.php';\nrequire_once __DIR__ . '/../../Maths/Mode.php';\n\nclass MathsTest extends TestCase\n{\n    public function testFactorial()\n    {\n        assertEquals(1, factorial(1));\n        assertEquals(120, factorial(5));\n        assertEquals(1, factorial(0));\n        $this->expectException(\\Exception::class);\n        factorial(-25);\n    }\n\n    public function testIsNumberArmstrong()\n    {\n        assertTrue(isNumberArmstrong(153));\n        assertFalse(isNumberArmstrong(123));\n        assertTrue(isNumberArmstrong(370));\n        assertFalse(isNumberArmstrong(2468));\n    }\n\n    public function testIsNumberPalindromic()\n    {\n        assertTrue(isNumberPalindromic(121));\n        assertFalse(isNumberPalindromic(123));\n        assertTrue(isNumberPalindromic(123321));\n        assertFalse(isNumberPalindromic(2468));\n    }\n\n    public function testIsPrime()\n    {\n        assertTrue(isPrime(73));\n        assertFalse(isPrime(21));\n        assertFalse(isPrime(1));\n        assertTrue(isPrime(997));\n    }\n\n    public function testAbsoluteMax()\n    {\n        assertEquals(50, absolute_max(12, 20, 35, 50, 50, 23));\n        assertEquals(13, absolute_max(13));\n        assertEquals(54, absolute_max(12, 13, 54, 22));\n        $this->expectException(\\Exception::class);\n        absolute_max();\n    }\n\n    public function testAbsoluteMin()\n    {\n        assertEquals(12, absolute_min(12, 20, 35, 50, 50, 23));\n        assertEquals(13, absolute_min(13));\n        assertEquals(12, absolute_min(12, 13, 54, 22));\n        $this->expectException(\\Exception::class);\n        absolute_min();\n    }\n\n    public function testPerfectSquare()\n    {\n        assertTrue(isPerfectSquare(25));\n        assertFalse(isPerfectSquare(43));\n        assertFalse(isPerfectSquare(2));\n        assertTrue(isPerfectSquare(225));\n    }\n\n    public function testFastExponentiation()\n    {\n        assertEquals(fastExponentiation(10, 0), 1);\n        assertEquals(fastExponentiation(10, 1), 10);\n        assertEquals(fastExponentiation(10, 2), 100);\n        assertEquals(fastExponentiation(10, 3), 1000);\n        assertEquals(fastExponentiation(20, 5), 3200000);\n    }\n\n    public function testFibonacciSeries()\n    {\n        assertEquals([0, 1, 1, 2, 3], fibonacciRecursive(5));\n        assertEquals([0, 1, 1, 2, 3, 5, 8, 13, 21, 34], fibonacciRecursive(10));\n\n        assertEquals([0, 1, 1, 2, 3], fibonacciWithBinetFormula(5));\n        assertEquals([0, 1, 1, 2, 3, 5, 8, 13, 21, 34], fibonacciWithBinetFormula(10));\n    }\n\n    public function testNeonNumber()\n    {\n        assertTrue(isNumberNeon(1));\n        assertFalse(isNumberNeon(43));\n        assertFalse(isNumberNeon(123));\n        assertTrue(isNumberNeon(9));\n    }\n    \n    public function testFibonacciGenerator()\n    {\n        assertEquals([0, 1, 1, 2, 3], iterator_to_array(loop(5, fib())));\n        assertEquals([0, 1, 1, 2, 3, 5, 8, 13, 21, 34], iterator_to_array(loop(10, fib())));\n\n        assertEquals([0, 1, 1, 2, 3], iterator_to_array(loop(5, fib())));\n        assertEquals([0, 1, 1, 2, 3, 5, 8, 13, 21, 34], iterator_to_array(loop(10, fib())));\n    }\n\n    public function testMean()\n    {\n        assertEquals(\n            (2 + 4 + 6 + 8 + 20 + 50 + 70) / 7, \n            mean(2, 4, 6, 8, 20, 50, 70)\n        );\n\n        assertEquals(\n            (-5 - 7 + 10) / 3, \n            mean(-5, -7, 10)\n        );\n        \n        assertEquals(-1, mean(-1));\n    }\n\n    public function testMedian()\n    {\n        assertEquals(3, median(1, 2, 3, 4, 5));\n        assertEquals(4.5, median(1, 2, 3, 4, 5, 6, 7, 8));\n        assertEquals(3, median(5, 3, 1, 2, 4));\n    }\n\n    public function testMode()\n    {\n        mode(4,2,7,9,2,9,0,4,2);\n        mode(21,72,40,21,0,99,21,99,0,40);\n        mode(3,3,3,3);\n    }\n}\n", "num_lines": 149}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\nuse PHPUnit\\Framework\\TestCase;\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\nrequire_once __DIR__ . '/../../Maths/ProjectEuler/Problem1.php';\nrequire_once __DIR__ . '/../../Maths/ProjectEuler/Problem2.php';\nrequire_once __DIR__ . '/../../Maths/ProjectEuler/Problem3.php';\nrequire_once __DIR__ . '/../../Maths/ProjectEuler/Problem4.php';\nrequire_once __DIR__ . '/../../Maths/ProjectEuler/Problem5.php';\nrequire_once __DIR__ . '/../../Maths/ProjectEuler/Problem6.php';\nrequire_once __DIR__ . '/../../Maths/ProjectEuler/Problem7.php';\nrequire_once __DIR__ . '/../../Maths/ProjectEuler/Problem8.php';\nrequire_once __DIR__ . '/../../Maths/ProjectEuler/Problem9.php';\nrequire_once __DIR__ . '/../../Maths/ProjectEuler/Problem10.php';\nrequire_once __DIR__ . '/../../Maths/ProjectEuler/Problem11.php';\n\nclass ProjectEulerTest extends TestCase\n{\n    public function testProblem1(): void\n    {\n        $this->assertSame(233168, problem1a());\n        $this->assertSame(233168, problem1b());\n    }\n\n    public function testProblem2(): void\n    {\n        $this->assertSame(4613732, problem2());\n    }\n\n    public function testProblem3(): void\n    {\n        $this->assertSame(6857, problem3());\n    }\n\n    public function testProblem4(): void\n    {\n        $this->assertSame(906609, problem4());\n    }\n\n    public function testProblem5(): void\n    {\n        $this->assertSame(232792560, problem5());\n    }\n\n    public function testProblem6(): void\n    {\n        $this->assertSame(25164150, problem6());\n    }\n\n    public function testProblem7(): void\n    {\n        $this->assertSame(104743, problem7());\n    }\n\n    public function testProblem8(): void\n    {\n        $this->assertSame(23514624000, problem8());\n    }\n\n    public function testProblem9(): void\n    {\n        $this->assertSame(31875000, problem9());\n    }\n    \n    public function testProblem10(): void\n    {\n        $this->assertSame(142913828922, problem10());\n    }\n\n    public function testProblem11(): void\n    {\n        $this->assertSame(70600674, problem11());\n    }\n}\n", "num_lines": 76}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\nuse function PHPUnit\\Framework\\assertEquals;\nuse function PHPUnit\\Framework\\assertFalse;\nuse function PHPUnit\\Framework\\assertTrue;\nuse PHPUnit\\Framework\\TestCase;\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\nrequire_once __DIR__ . '/../../Searches/BinarySearch.php';\nrequire_once __DIR__ . '/../../Searches/FibonacciSearch.php';\nrequire_once __DIR__ . '/../../Searches/LinearSearch.php';\nrequire_once __DIR__ . '/../../Searches/LowerBound.php';\nrequire_once __DIR__ . '/../../Searches/UpperBound.php';\nrequire_once __DIR__ . '/../../Searches/JumpSearch.php';\nrequire_once __DIR__ . '/../../Searches/ExponentialSearch.php';\nrequire_once __DIR__ . '/../../Searches/TernarySearch.php';\nrequire_once __DIR__ . '/../../Searches/InterpolationSearch.php';\n\n\nclass SearchesTest extends TestCase\n{\n    public function testBinarySearchIterative()\n    {\n        $list = [0, 5, 7, 10, 15];\n        $target = 0;\n        $result = binarySearchIterative($list, $target);\n        assertEquals(0, $result);\n        $target = 15;\n        $result = binarySearchIterative($list, $target);\n        assertEquals(4, $result);\n        $target = 5;\n        $result = binarySearchIterative($list, $target);\n        assertEquals(1, $result);\n        $target = 6;\n        $result = binarySearchIterative($list, $target);\n        assertEquals(null, $result);\n    }\n\n    public function testBinarySearchByRecursion()\n    {\n        $list = [0, 5, 7, 10, 15];\n        $target = 0;\n        $result = binarySearchByRecursion($list, $target, 0, 4);\n        assertEquals(0, $result);\n        $target = 15;\n        $result = binarySearchByRecursion($list, $target, 0, 4);\n        assertEquals(4, $result);\n        $target = 5;\n        $result = binarySearchByRecursion($list, $target, 0, 4);\n        assertEquals(1, $result);\n        $target = 6;\n        $result = binarySearchByRecursion($list, $target, 0, 4);\n        assertEquals(null, $result);\n    }\n\n    public function testBinarySearchByRecursionWithEmptyList()\n    {\n        $list = [];\n        $target = 0;\n        $result = binarySearchByRecursion($list, $target, 0, 0);\n        assertEquals(null, $result);\n    }\n\n    public function testBinarySearchByRecursionWithOneElementList()\n    {\n        $list = [0];\n        $target = 0;\n        $result = binarySearchByRecursion($list, $target, 0, 0);\n        assertEquals(0, $result);\n        $target = 1;\n        $result = binarySearchByRecursion($list, $target, 0, 0);\n        assertEquals(null, $result);\n    }\n\n    public function testBinarySearchByRecursionWithTwoElementList()\n    {\n        $list = [0, 1];\n        $target = 0;\n        $result = binarySearchByRecursion($list, $target, 0, 1);\n        assertEquals(0, $result);\n        $target = 1;\n        $result = binarySearchByRecursion($list, $target, 0, 1);\n        assertEquals(1, $result);\n        $target = 2;\n        $result = binarySearchByRecursion($list, $target, 0, 1);\n        assertEquals(null, $result);\n    }\n\n    public function testBinarySearchByRecursionWithThreeElementList()\n    {\n        $list = [0, 1, 2];\n        $target = 0;\n        $result = binarySearchByRecursion($list, $target, 0, 2);\n        assertEquals(0, $result);\n        $target = 1;\n        $result = binarySearchByRecursion($list, $target, 0, 2);\n        assertEquals(1, $result);\n        $target = 2;\n        $result = binarySearchByRecursion($list, $target, 0, 2);\n        assertEquals(2, $result);\n        $target = 3;\n        $result = binarySearchByRecursion($list, $target, 0, 2);\n        assertEquals(null, $result);\n    }\n\n    public function testFibonacciSearch()\n    {\n        $test1 = fibonacciPosition(6);\n        assertEquals(8, $test1);\n\n        $test2 = fibonacciPosition(9);\n        assertEquals(34, $test2);\n\n        $test3 = fibonacciPosition(60);\n        assertEquals(1548008755920, $test3);\n    }\n\n    public function testLinearSearch()\n    {\n        $list = [5, 7, 8, 11, 12, 15, 17, 18, 20];\n        $target = 15;\n        $result = linearSearch($list, $target);\n        assertEquals(6, $result);\n    }\n\n    public function testLowerBound()\n    {\n        $list = [1, 2, 3, 3, 3, 4, 5, 9];\n        $target = 3;\n        $result = lowerBound($list, $target);\n        assertEquals(2, $result);\n    }\n\n    public function testUpperBound()\n    {\n        $list = [1, 2, 3, 3, 3, 4, 5, 9];\n        $target = 3;\n        $result = upperBound($list, $target);\n        assertEquals(5, $result);\n    }\n    \n    public function testJumpSearch()\n    {\n        $list = array( 3,5,6,7,9,10,12,20,22,24);\n        $target = 12;\n        $result = jumpSearch($list, $target);\n        assertEquals(6, $result);\n    }\n\n    public function testExponentialSearch()\n    {\n        $list = array(2,3,4,7,28,35,63,98);\n        $target = 35;\n        $result = exponentialSearch($list, $target);\n        assertEquals(5, $result);\n    }\n\n    public function testTernarySearchIterative()\n    {\n        $list = [0, 5, 7, 10, 15];\n        $target = 0;\n        $result = ternarySearchIterative($list, $target);\n        assertEquals(0, $result);\n        $target = 15;\n        $result = ternarySearchIterative($list, $target);\n        assertEquals(4, $result);\n        $target = 5;\n        $result = ternarySearchIterative($list, $target);\n        assertEquals(1, $result);\n        $target = 6;\n        $result = ternarySearchIterative($list, $target);\n        assertEquals(null, $result);\n    }\n\n    public function testTernarySearchByRecursion()\n    {\n        $list = [0, 5, 7, 10, 15];\n        $target = 0;\n        $result = ternarySearchByRecursion($list, $target, 0, 4);\n        assertEquals(0, $result);\n        $target = 15;\n        $result = ternarySearchByRecursion($list, $target, 0, 4);\n        assertEquals(4, $result);\n        $target = 5;\n        $result = ternarySearchByRecursion($list, $target, 0, 4);\n        assertEquals(1, $result);\n        $target = 6;\n        $result = ternarySearchByRecursion($list, $target, 0, 4);\n        assertEquals(null, $result);\n    }\n\n    public function testInterpolationSearch()\n    {\n        $list = [2, 6, 8, 10, 12, 14, 16, 18, 20, 22, 26, 34, 39];\n        $target = 20;\n        $result = interpolationSearch($list, $target);\n        assertEquals(8, $result);\n        $target = 12;\n        $result = interpolationSearch($list, $target);\n        assertEquals(4, $result);\n        $target = 1000;\n        $result = interpolationSearch($list, $target);\n        assertEquals(null, $result);\n        $target = 39;\n        $result = interpolationSearch($list, $target);\n        assertEquals(12, $result);\n    }\n}\n", "num_lines": 209}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\nrequire_once __DIR__ . '/../../Sorting/ArrayKeysSort.php';\n\nuse PHPUnit\\Framework\\TestCase;\n\nclass ArrayKeysSortTest extends TestCase\n{\n    public function testArrayKeysSort() {\n        //test array of arrays\n        $array1 = [\n            ['fruit' => 'banana', 'color' => 'yellow', 'cant' => 5],\n            ['fruit' => 'apple', 'color' => 'red', 'cant' => 2],\n            ['fruit' => 'apple', 'color' => 'green', 'cant' => 7],\n            ['fruit' => 'grapes', 'color' => 'purple', 'cant' => 4],\n        ];\n\n        $result1 = [\n            ['fruit' => 'apple', 'color' => 'red', 'cant' => 2],\n            ['fruit' => 'grapes', 'color' => 'purple', 'cant' => 4],\n            ['fruit' => 'banana', 'color' => 'yellow', 'cant' => 5],\n            ['fruit' => 'apple', 'color' => 'green', 'cant' => 7],\n        ];\n        $result2 = [\n            ['fruit' => 'apple', 'color' => 'green', 'cant' => 7],\n            ['fruit' => 'apple', 'color' => 'red', 'cant' => 2],\n            ['fruit' => 'banana', 'color' => 'yellow', 'cant' => 5],\n            ['fruit' => 'grapes', 'color' => 'purple', 'cant' => 4],\n        ];\n\n        $test1 = arrayKeysSort::sort($array1, ['cant']);\n        $test2 = arrayKeysSort::sort($array1, ['fruit', 'color']);\n\n        $this->assertEquals($result1, $test1);\n        $this->assertEquals($result2, $test2);\n\n        //test array of objects\n        $object1 = new \\stdClass;\n        $object1->fruit = 'banana';\n        $object1->color = 'yellow';\n        $object1->cant = 5;\n\n        $object2 = new \\stdClass;\n        $object2->fruit = 'apple';\n        $object2->color = 'red';\n        $object2->cant = 2;\n\n        $object3 = new \\stdClass;\n        $object3->fruit = 'apple';\n        $object3->color = 'green';\n        $object3->cant = 7;\n\n        $object4 = new \\stdClass;\n        $object4->fruit = 'grapes';\n        $object4->color = 'purple';\n        $object4->cant = 4;\n\n        $array2 = [$object1, $object2, $object3, $object4];\n\n        $result3 = [$object2, $object4, $object1, $object3];\n        $result4 = [$object3, $object2, $object1, $object4];\n\n        $test3 = arrayKeysSort::sort($array2, ['cant']);\n        $test4 = arrayKeysSort::sort($array2, ['fruit', 'color']);\n\n        $this->assertEquals($result3, $test3);\n        $this->assertEquals($result4, $test4);\n    }\n}\n", "num_lines": 71}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\nrequire_once __DIR__ . '/../../Sorting/GnomeSort.php';\n\nuse PHPUnit\\Framework\\TestCase;\n\nclass GnomeSortTest extends TestCase\n{\n    public function testGnomeSort()\n    {\n        $array = array(3, 0, 2, 5, -1, 4, 1);\n        $sorted = gnomeSort($array);\n        $this->assertEquals([-1, 0, 1, 2, 3, 4, 5], $sorted);\n    }\n\n    public function testGnomeSort2()\n    {\n        $array = array(8, -50, 1, 90, 35, 47, 69, -5);\n        $sorted = gnomeSort($array);\n        $this->assertEquals([-50, -5, 1, 8, 35, 47, 69, 90], $sorted);\n    }\n}\n", "num_lines": 24}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\nuse PHPUnit\\Framework\\TestCase;\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\nrequire_once __DIR__ . '/../../Sorting/BubbleSort.php';\nrequire_once __DIR__ . '/../../Sorting/BubbleSort2.php';\nrequire_once __DIR__ . '/../../Sorting/CountSort.php';\nrequire_once __DIR__ . '/../../Sorting/InsertionSort.php';\nrequire_once __DIR__ . '/../../Sorting/MergeSort.php';\nrequire_once __DIR__ . '/../../Sorting/QuickSort.php';\nrequire_once __DIR__ . '/../../Sorting/RadixSort.php';\nrequire_once __DIR__ . '/../../Sorting/SelectionSort.php';\n\nclass SortingTests extends TestCase\n{\n    public function testBubbleSort()\n    {\n        $array = [1, 5, 4, 2, 3];\n        $sorted = bubbleSort($array);\n        $this->assertEquals([1, 2, 3, 4, 5], $sorted);\n    }\n\n    public function testBubbleSort2()\n    {\n        $array = [51158,1856,8459,67957,59748,58213,90876,39621,66570,64204,79935,27892,47615,94706,34201,74474,63968,4337,43688,42685,31577,5239,25385,56301,94083,23232,67025,44044,74813,34671,90235,65764,49709,12440,21165,20620,38265,12973,25236,93144,13720,4204,77026,42348,19756,97222,78828,73437,48208,69858,19713,29411,49809,66174,5257,43340,40565,9592,52328,16677,38386,55416,99519,13732,84076,52905,47662,31805,46184,2811,35374,50800,53635,51886,49052,75197,3720,75045,28309,63771,71526,16122,36625,44654,86814,98845,44637,54955,24714,81960,78095,49048,99711,272,45755,31919,8181,1392,15352,82656,27760,18362,43780,50209,51433,2847,62310,87450,22874,40789,56841,52928,5523,76474,8935,63245,16387,21746,47596,84402,49168,58223,26993,55908,92837,64208,86309,30819,83638,9508,44628,10786,68125,14123,70474,50596,44518,74872,61968,36828,17860,4605,68756,86070,52068,51830,56992,45799,42422,68514,92559,40206,31263,71774,14202,94807,25774,15003,54211,18708,32074,43836,48964,40742,26281,67338,75786,34925,34649,45519,72472,80188,40858,83246,92215,66178,67452,86198,82300,45894,97156,73907,31159,7018,55549,35245,68975,88246,14098,59973,7762,40459,86358,63178,47489,55515,79488,46528,99272,10867,75190,56963,5520,56494,42310,40171,78105,29724,30110,28493,36141,22479,85799,70466,92106,16868,57402,4813,47432,24689,78533,97577,32178,30258,82785,56063,76277,96407,77849,1807,45344,30298,18158,49935,90728,22192,36852,33982,66206,30948,40372,33446,99156,28651,61591,79028,1689,94257,32158,11122,81097,57981,26277,7515,7873,8350,28229,24105,76818,86897,18456,29373,7853,24932,93070,4696,63015,9358,28302,3938,11754,33679,18492,91503,63395,12029,23954,27230,58336,16544,23606,61349,37348,78629,96145,57954,32392,76201,54616,59992,5676,97799,47910,98758,75043,72849,6466,68831,2246,69091,22296,6506,93729,86968,39583,46186,96782,19074,46574,46704,99211,55295,33963,77977,86805,72686];\n        $sorted = bubbleSort2($array);\n        $this->assertEquals([272, 1392, 1689, 1807, 1856, 2246, 2811, 2847, 3720, 3938, 4204, 4337, 4605, 4696, 4813, 5239, 5257, 5520, 5523, 5676, 6466, 6506, 7018, 7515, 7762, 7853, 7873, 8181, 8350, 8459, 8935, 9358, 9508, 9592, 10786, 10867, 11122, 11754, 12029, 12440, 12973, 13720, 13732, 14098, 14123, 14202, 15003, 15352, 16122, 16387, 16544, 16677, 16868, 17860, 18158, 18362, 18456, 18492, 18708, 19074, 19713, 19756, 20620, 21165, 21746, 22192, 22296, 22479, 22874, 23232, 23606, 23954, 24105, 24689, 24714, 24932, 25236, 25385, 25774, 26277, 26281, 26993, 27230, 27760, 27892, 28229, 28302, 28309, 28493, 28651, 29373, 29411, 29724, 30110, 30258, 30298, 30819, 30948, 31159, 31263, 31577, 31805, 31919, 32074, 32158, 32178, 32392, 33446, 33679, 33963, 33982, 34201, 34649, 34671, 34925, 35245, 35374, 36141, 36625, 36828, 36852, 37348, 38265, 38386, 39583, 39621, 40171, 40206, 40372, 40459, 40565, 40742, 40789, 40858, 42310, 42348, 42422, 42685, 43340, 43688, 43780, 43836, 44044, 44518, 44628, 44637, 44654, 45344, 45519, 45755, 45799, 45894, 46184, 46186, 46528, 46574, 46704, 47432, 47489, 47596, 47615, 47662, 47910, 48208, 48964, 49048, 49052, 49168, 49709, 49809, 49935, 50209, 50596, 50800, 51158, 51433, 51830, 51886, 52068, 52328, 52905, 52928, 53635, 54211, 54616, 54955, 55295, 55416, 55515, 55549, 55908, 56063, 56301, 56494, 56841, 56963, 56992, 57402, 57954, 57981, 58213, 58223, 58336, 59748, 59973, 59992, 61349, 61591, 61968, 62310, 63015, 63178, 63245, 63395, 63771, 63968, 64204, 64208, 65764, 66174, 66178, 66206, 66570, 67025, 67338, 67452, 67957, 68125, 68514, 68756, 68831, 68975, 69091, 69858, 70466, 70474, 71526, 71774, 72472, 72686, 72849, 73437, 73907, 74474, 74813, 74872, 75043, 75045, 75190, 75197, 75786, 76201, 76277, 76474, 76818, 77026, 77849, 77977, 78095, 78105, 78533, 78629, 78828, 79028, 79488, 79935, 80188, 81097, 81960, 82300, 82656, 82785, 83246, 83638, 84076, 84402, 85799, 86070, 86198, 86309, 86358, 86805, 86814, 86897, 86968, 87450, 88246, 90235, 90728, 90876, 91503, 92106, 92215, 92559, 92837, 93070, 93144, 93729, 94083, 94257, 94706, 94807, 96145, 96407, 96782, 97156, 97222, 97577, 97799, 98758, 98845, 99156, 99211, 99272, 99519, 99711], $sorted);\n    }\n\n    public function testCountSort()\n    {\n        $array = [-5, -10, 0, -3, 8, 5, -1, 10];\n        $min = 0;\n        $max = 9;\n        $sorted = countSort($array, 0, 9);\n        $this->assertEquals([-10, -5, -3, -1, 0, 5, 8, 10], $sorted);\n    }\n\n    public function testInsertionSort()\n    {\n        $array = [1, 5, 4, 2, 3];\n        $sorted = insertionSort($array);\n        $this->assertEquals([1, 2, 3, 4, 5], $sorted);\n    }\n\n    public function testMergeSort()\n    {\n        $array = [1, 5, 4, 2, 3];\n        $sorted = mergeSort($array);\n        $this->assertEquals([1, 2, 3, 4, 5], $sorted);\n    }\n\n    public function testQuickSort()\n    {\n        $array = [51158,1856,8459,67957,59748,58213,90876,39621,66570,64204,79935,27892,47615,94706,34201,74474,63968,4337,43688,42685,31577,5239,25385,56301,94083,23232,67025,44044,74813,34671,90235,65764,49709,12440,21165,20620,38265,12973,25236,93144,13720,4204,77026,42348,19756,97222,78828,73437,48208,69858,19713,29411,49809,66174,5257,43340,40565,9592,52328,16677,38386,55416,99519,13732,84076,52905,47662,31805,46184,2811,35374,50800,53635,51886,49052,75197,3720,75045,28309,63771,71526,16122,36625,44654,86814,98845,44637,54955,24714,81960,78095,49048,99711,272,45755,31919,8181,1392,15352,82656,27760,18362,43780,50209,51433,2847,62310,87450,22874,40789,56841,52928,5523,76474,8935,63245,16387,21746,47596,84402,49168,58223,26993,55908,92837,64208,86309,30819,83638,9508,44628,10786,68125,14123,70474,50596,44518,74872,61968,36828,17860,4605,68756,86070,52068,51830,56992,45799,42422,68514,92559,40206,31263,71774,14202,94807,25774,15003,54211,18708,32074,43836,48964,40742,26281,67338,75786,34925,34649,45519,72472,80188,40858,83246,92215,66178,67452,86198,82300,45894,97156,73907,31159,7018,55549,35245,68975,88246,14098,59973,7762,40459,86358,63178,47489,55515,79488,46528,99272,10867,75190,56963,5520,56494,42310,40171,78105,29724,30110,28493,36141,22479,85799,70466,92106,16868,57402,4813,47432,24689,78533,97577,32178,30258,82785,56063,76277,96407,77849,1807,45344,30298,18158,49935,90728,22192,36852,33982,66206,30948,40372,33446,99156,28651,61591,79028,1689,94257,32158,11122,81097,57981,26277,7515,7873,8350,28229,24105,76818,86897,18456,29373,7853,24932,93070,4696,63015,9358,28302,3938,11754,33679,18492,91503,63395,12029,23954,27230,58336,16544,23606,61349,37348,78629,96145,57954,32392,76201,54616,59992,5676,97799,47910,98758,75043,72849,6466,68831,2246,69091,22296,6506,93729,86968,39583,46186,96782,19074,46574,46704,99211,55295,33963,77977,86805,72686];\n        $sorted = quickSort($array);\n        $this->assertEquals([272, 1392, 1689, 1807, 1856, 2246, 2811, 2847, 3720, 3938, 4204, 4337, 4605, 4696, 4813, 5239, 5257, 5520, 5523, 5676, 6466, 6506, 7018, 7515, 7762, 7853, 7873, 8181, 8350, 8459, 8935, 9358, 9508, 9592, 10786, 10867, 11122, 11754, 12029, 12440, 12973, 13720, 13732, 14098, 14123, 14202, 15003, 15352, 16122, 16387, 16544, 16677, 16868, 17860, 18158, 18362, 18456, 18492, 18708, 19074, 19713, 19756, 20620, 21165, 21746, 22192, 22296, 22479, 22874, 23232, 23606, 23954, 24105, 24689, 24714, 24932, 25236, 25385, 25774, 26277, 26281, 26993, 27230, 27760, 27892, 28229, 28302, 28309, 28493, 28651, 29373, 29411, 29724, 30110, 30258, 30298, 30819, 30948, 31159, 31263, 31577, 31805, 31919, 32074, 32158, 32178, 32392, 33446, 33679, 33963, 33982, 34201, 34649, 34671, 34925, 35245, 35374, 36141, 36625, 36828, 36852, 37348, 38265, 38386, 39583, 39621, 40171, 40206, 40372, 40459, 40565, 40742, 40789, 40858, 42310, 42348, 42422, 42685, 43340, 43688, 43780, 43836, 44044, 44518, 44628, 44637, 44654, 45344, 45519, 45755, 45799, 45894, 46184, 46186, 46528, 46574, 46704, 47432, 47489, 47596, 47615, 47662, 47910, 48208, 48964, 49048, 49052, 49168, 49709, 49809, 49935, 50209, 50596, 50800, 51158, 51433, 51830, 51886, 52068, 52328, 52905, 52928, 53635, 54211, 54616, 54955, 55295, 55416, 55515, 55549, 55908, 56063, 56301, 56494, 56841, 56963, 56992, 57402, 57954, 57981, 58213, 58223, 58336, 59748, 59973, 59992, 61349, 61591, 61968, 62310, 63015, 63178, 63245, 63395, 63771, 63968, 64204, 64208, 65764, 66174, 66178, 66206, 66570, 67025, 67338, 67452, 67957, 68125, 68514, 68756, 68831, 68975, 69091, 69858, 70466, 70474, 71526, 71774, 72472, 72686, 72849, 73437, 73907, 74474, 74813, 74872, 75043, 75045, 75190, 75197, 75786, 76201, 76277, 76474, 76818, 77026, 77849, 77977, 78095, 78105, 78533, 78629, 78828, 79028, 79488, 79935, 80188, 81097, 81960, 82300, 82656, 82785, 83246, 83638, 84076, 84402, 85799, 86070, 86198, 86309, 86358, 86805, 86814, 86897, 86968, 87450, 88246, 90235, 90728, 90876, 91503, 92106, 92215, 92559, 92837, 93070, 93144, 93729, 94083, 94257, 94706, 94807, 96145, 96407, 96782, 97156, 97222, 97577, 97799, 98758, 98845, 99156, 99211, 99272, 99519, 99711], $sorted);\n    }\n\n    public function testRadixSort()\n    {\n        $array = [1, 5, 4, 2, 3];\n        $sorted = radixSort($array);\n        $this->assertEquals([1, 2, 3, 4, 5], $sorted);\n    }\n\n    public function testSelectionSort()\n    {\n        $array = [1, 5, 4, 2, 3];\n        $sorted = selectionSort($array);\n        $this->assertEquals([1, 2, 3, 4, 5], $sorted);\n    }\n\n    public function testBubbleSortPerformance()\n    {\n        $array = range(1, 1000000);\n        $start = microtime(true);\n        bubbleSort($array);\n        $end = microtime(true);\n        $this->assertLessThan(1, $end - $start);\n    }\n\n    public function testBubbleSort2Performance()\n    {\n        $array = range(1, 1000000);\n        $start = microtime(true);\n        bubbleSort2($array);\n        $end = microtime(true);\n        $this->assertLessThan(1, $end - $start);\n    }\n\n    public function testCountSortPerformance()\n    {\n        $array = range(1, 1000000);\n        $start = microtime(true);\n        countSort($array);\n        $end = microtime(true);\n        $this->assertLessThan(1, $end - $start);\n    }\n\n    public function testInsertionSortPerformance()\n    {\n        $array = range(1, 1000000);\n        $start = microtime(true);\n        insertionSort($array);\n        $end = microtime(true);\n        $this->assertLessThan(1, $end - $start);\n    }\n\n    public function testMergeSortPerformance()\n    {\n        $array = range(1, 1000000);\n        $start = microtime(true);\n        mergeSort($array);\n        $end = microtime(true);\n        $this->assertLessThan(1, $end - $start);\n    }\n\n    public function testQuickSortPerformance()\n    {\n        $array = range(1, 1000000);\n        $start = microtime(true);\n        quickSort($array);\n        $end = microtime(true);\n        $this->assertLessThan(1, $end - $start);\n    }\n\n    public function testRadixSortPerformance()\n    {\n        $array = range(1, 1000000);\n        $start = microtime(true);\n        radixSort($array);\n        $end = microtime(true);\n        $this->assertLessThan(1, $end - $start);\n    }\n\n    public function testSelectionSortPerformance()\n    {\n        $array = range(1, 1000000);\n        $start = microtime(true);\n        selectionSort($array);\n        $end = microtime(true);\n        $this->assertLessThan(1, $end - $start);\n    }\n\n    public function testCountSortCipher()\n    {\n        $firstArray = array(20, 16, -5, -8, 6, 12, 2, 4, -3, 9);\n        $expectedResultOne = array(-8, -5, -3, 2, 4, 6, 9, 12, 16, 20);\n        $secondArray = array(-6, 12, 14, 17, 5, 4, -9, 15, 0, -8);\n        $expectedResultTwo = array(-9, -8, -6, 0, 4, 5, 12, 14, 15, 17);\n\n        $resultOne = countSort($firstArray, $minRange = -10, $maxRange = 20);\n        $resultTwo = countSort($secondArray, $minRange = -10, $maxRange = 20);\n\n        $this->assertEquals($expectedResultOne, $resultOne);\n        $this->assertEquals($expectedResultTwo, $resultTwo);\n    }\n\n    public function testQuickSortCipher()\n    {\n        $array1 = [20, 16, -5, -8, 6, 12, 2, 4, -3, 9];\n        $array2 = [-6, 12, 14, 17, 5, 4, -9, 15, 0, -8];\n\n        $result1 = [-8, -5, -3, 2, 4, 6, 9, 12, 16, 20];\n        $result2 = [-9, -8, -6, 0, 4, 5, 12, 14, 15, 17];\n\n        $test1 = quickSort($array1);\n        $test2 = quickSort($array2);\n\n        $this->assertEquals($result1, $test1);\n        $this->assertEquals($result2, $test2);\n    }\n}\n", "num_lines": 176}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\nuse function PHPUnit\\Framework\\assertEquals;\nuse function PHPUnit\\Framework\\assertFalse;\nuse function PHPUnit\\Framework\\assertNotEquals;\nuse function PHPUnit\\Framework\\assertTrue;\nuse PHPUnit\\Framework\\TestCase;\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\n\nrequire_once __DIR__ . '/../../Strings/CheckAnagram.php';\nrequire_once __DIR__ . '/../../Strings/CheckPalindrome.php';\nrequire_once __DIR__ . '/../../Strings/CheckPalindrome2.php';\nrequire_once __DIR__ . '/../../Strings/CountConsonants.php';\nrequire_once __DIR__ . '/../../Strings/CountSentences.php';\nrequire_once __DIR__ . '/../../Strings/CountVowels.php';\nrequire_once __DIR__ . '/../../Strings/Distance.php';\nrequire_once __DIR__ . '/../../Strings/MaxCharacter.php';\nrequire_once __DIR__ . '/../../Strings/ReverseString.php';\nrequire_once __DIR__ . '/../../Strings/ReverseWords.php';\n\nclass StringsTest extends TestCase\n{\n    public function testIsPalindrome()\n    {\n        assertTrue(isPalindrome('MaDam')); // true\n        assertFalse(isPalindrome('ThisIsTest')); // false\n        assertFalse(isPalindrome('')); // false\n        assertTrue(isPalindrome('Sator Arepo Tenet Opera Rotas')); // true\n        assertFalse(isPalindrome('Sator Arepo Tenet Opera Rotas', false)); // false since we are doing case-sensitive check\n    }\n\n    public function testCountSentences()\n    {\n        assertEquals(countSentences('Hi! Hello world.'), 2);\n        assertEquals(countSentences('i am testing. test....'), 2);\n        assertEquals(countSentences('How are you?'), 1);\n    }\n\n    public function testReverseString()\n    {\n        assertEquals('txet emos si sihT', reverseString('This is some text'));\n        assertEquals('mADaM', reverseString('MaDAm'));\n        assertNotEquals('MaDAm', reverseString('MaDAm'));\n    }\n\n    public function testReverseWords()\n    {\n        assertEquals('Fun is Coding PHP', reverseWords('PHP Coding is Fun'));\n        assertEquals('OneWord', reverseWords('OneWord'));\n        assertEquals('Text different some is This', reverseWords('This is some different Text'));\n    }\n\n    public function testIsAnagram()\n    {\n        assertTrue(isAnagram(\"php\", \"PHP\")); // By default it's case-insensitive\n        assertFalse(isAnagram(\"php\", \"PHP\", false)); // Make case-sensitive check\n        assertTrue(isAnagram(\"php is fun\", \"pin hpf us\"));\n        assertFalse(isAnagram(\"Hello\", \" Hello\")); //Extra space character\n        assertTrue(isAnagram(\"ScRamble\", \"SRlmcaeb\", false)); // Check with a mixture of upper and lower case\n    }\n\n    public function testMaxCharacter()\n    {\n        assertEquals(maxCharacter(\"this is test for max character repetition\"), 't');\n        assertEquals(maxCharacter(\"This is Test for max characTer repetition\"), 't');\n        assertEquals(maxCharacter(\"           \"), ' ');\n    }\n\n    public function testCountVowels()\n    {\n        assertEquals(countVowelsSimple(\"This is a string with 7 vowels\"), 7);\n        assertEquals(countVowelsSimple(\"hello world\"), 3);\n        assertEquals(countVowelsRegex(\"Just A list of somE aaaaaaaaaa\"), 16);\n\n        assertEquals(countVowelsRegex(\"This is a string with 7 vowels\"), 7);\n        assertEquals(countVowelsRegex(\"hello world\"), 3);\n        assertEquals(countVowelsRegex(\"Just A list of somE aaaaaaaaaa\"), 16);\n    }\n\n    public function testCountConsonants()\n    {\n        assertEquals(countConsonants(\"This is a string with 19 consonants\"), 19);\n        assertEquals(countConsonants(\"hello world\"), 7);\n        assertEquals(countConsonants(\"Just A list of somE aaaaaaaaaa\"), 9);\n    }\n\n    public function testFindDistance()\n    {\n        assertEquals(findDistance(\"hello\", \"hallo\"), 1);\n        assertEquals(findDistance(\"hallo\", \"hello\"), 1);\n        assertEquals(findDistance(\"sunday\", \"sunday\"), 0);\n        assertEquals(findDistance(\"saturday\", \"sunday\"), 3);\n    }\n}\n", "num_lines": 96}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/**\n * @param an array of integers\n * @return is array sorted in ascending\n */\nfunction isSortedAscendingInts(array $arr): void{\n    $len = count($arr);\n\n    if($len == 0){\n        return;\n    }\n\n    if(!is_int($arr[0])){\n        throw UnexpectedValueException;\n    }\n\n    for($i = 1; $i < $len; $i++){\n        // a sorted array is expected\n        if(!is_int($arr[$i]) && $arr[$i] < $arr[$i-1]){\n           throw UnexpectedValueException;\n        }\n    }\n}\n", "num_lines": 25}
{"repo_name": "PHP", "repo_creator": "TheAlgorithms", "programming_language": "PHP", "code": "<?php\n\n/*\n * Run script and test execution time with following script\n        $executionTime = New ExecutionTime();\n        print_r(fibonacciRecursive(10));\n */\nclass ExecutionTime\n{\n    private $start_time = 0;\n    private $end_time = 0;\n    private $execution_time = 0;\n\n    public function __construct()\n    {\n        $this->start_time = microtime(true);\n    }\n\n    public function __destruct()\n    {\n        $this->end_time = microtime(true);\n        $this->execution_time = $this->end_time - $this->start_time;\n        echo \"Executed in $this->execution_time seconds\\n\";\n    }\n}\n", "num_lines": 26}
{"repo_name": "aws-k8s-tester", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n  $x = 0.0001;\n  for ($i = 0; $i <= 1000000; $i++) {\n    $x += sqrt($x);\n  }\n  echo \"OK!\";\n?>\n", "num_lines": 8}
{"repo_name": "aws-k8s-tester", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n  $x = 0.0001;\n  for ($i = 0; $i <= 1000000; $i++) {\n    $x += sqrt($x);\n  }\n  echo \"OK!\";\n?>\n", "num_lines": 8}
{"repo_name": "aws-php-sns-message-validator", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sns;\n\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Represents an SNS message received over http(s).\n */\nclass Message implements \\ArrayAccess, \\IteratorAggregate\n{\n    private static $requiredKeys = [\n        'Message',\n        'MessageId',\n        'Timestamp',\n        'TopicArn',\n        'Type',\n        'Signature',\n        ['SigningCertURL', 'SigningCertUrl'],\n        'SignatureVersion',\n    ];\n\n    private static $subscribeKeys = [\n        ['SubscribeURL', 'SubscribeUrl'],\n        'Token'\n    ];\n\n    /** @var array The message data */\n    private $data;\n\n    /**\n     * Creates a Message object from the raw POST data\n     *\n     * @return Message\n     * @throws \\RuntimeException If the POST data is absent, or not a valid JSON document\n     */\n    public static function fromRawPostData()\n    {\n        // Make sure the SNS-provided header exists.\n        if (!isset($_SERVER['HTTP_X_AMZ_SNS_MESSAGE_TYPE'])) {\n            throw new \\RuntimeException('SNS message type header not provided.');\n        }\n\n        // Read the raw POST data and JSON-decode it into a message.\n        return self::fromJsonString(file_get_contents('php://input'));\n    }\n\n    /**\n     * Creates a Message object from a PSR-7 Request or ServerRequest object.\n     *\n     * @param RequestInterface $request\n     * @return Message\n     */\n    public static function fromPsrRequest(RequestInterface $request)\n    {\n        return self::fromJsonString($request->getBody());\n    }\n\n    /**\n     * Creates a Message object from a JSON-decodable string.\n     *\n     * @param string $requestBody\n     * @return Message\n     */\n    public static function fromJsonString($requestBody)\n    {\n        $data = json_decode($requestBody, true);\n        if (JSON_ERROR_NONE !== json_last_error() || !is_array($data)) {\n            throw new \\RuntimeException('Invalid POST data.');\n        }\n\n        return new Message($data);\n    }\n\n    /**\n     * Creates a Message object from an array of raw message data.\n     *\n     * @param array $data The message data.\n     *\n     * @throws \\InvalidArgumentException If a valid type is not provided or\n     *                                   there are other required keys missing.\n     */\n    public function __construct(array $data)\n    {\n        // Ensure that all the required keys for the message's type are present.\n        $this->validateRequiredKeys($data, self::$requiredKeys);\n        if ($data['Type'] === 'SubscriptionConfirmation'\n            || $data['Type'] === 'UnsubscribeConfirmation'\n        ) {\n            $this->validateRequiredKeys($data, self::$subscribeKeys);\n        }\n\n        $this->data = $data;\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function getIterator()\n    {\n        return new \\ArrayIterator($this->data);\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function offsetExists($key)\n    {\n        return isset($this->data[$key]);\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function offsetGet($key)\n    {\n        return isset($this->data[$key]) ? $this->data[$key] : null;\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function offsetSet($key, $value)\n    {\n        $this->data[$key] = $value;\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function offsetUnset($key)\n    {\n        unset($this->data[$key]);\n    }\n\n    /**\n     * Get all the message data as a plain array.\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        return $this->data;\n    }\n\n    private function validateRequiredKeys(array $data, array $keys)\n    {\n        foreach ($keys as $key) {\n            $keyIsArray = is_array($key);\n            if (!$keyIsArray) {\n                $found = isset($data[$key]);\n            } else {\n                $found = false;\n                foreach ($key as $keyOption) {\n                    if (isset($data[$keyOption])) {\n                        $found = true;\n                        break;\n                    }\n                }\n            }\n\n            if (!$found) {\n                if ($keyIsArray) {\n                    $key = $key[0];\n                }\n                throw new \\InvalidArgumentException(\n                    \"\\\"{$key}\\\" is required to verify the SNS Message.\"\n                );\n            }\n        }\n    }\n}\n", "num_lines": 162}
{"repo_name": "aws-php-sns-message-validator", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sns;\n\nuse Aws\\Sns\\Exception\\InvalidSnsMessageException;\n\n/**\n * Uses openssl to verify SNS messages to ensure that they were sent by AWS.\n */\nclass MessageValidator\n{\n    const SIGNATURE_VERSION_1 = '1';\n    const SIGNATURE_VERSION_2 = '2';\n\n    /**\n     * @var callable Callable used to download the certificate content.\n     */\n    private $certClient;\n\n    /** @var string */\n    private $hostPattern;\n\n    /**\n     * @var string  A pattern that will match all regional SNS endpoints, e.g.:\n     *                  - sns.<region>.amazonaws.com        (AWS)\n     *                  - sns.us-gov-west-1.amazonaws.com   (AWS GovCloud)\n     *                  - sns.cn-north-1.amazonaws.com.cn   (AWS China)\n     */\n    private static $defaultHostPattern\n        = '/^sns\\.[a-zA-Z0-9\\-]{3,}\\.amazonaws\\.com(\\.cn)?$/';\n\n    private static function isLambdaStyle(Message $message)\n    {\n        return isset($message['SigningCertUrl']);\n    }\n\n    private static function convertLambdaMessage(Message $lambdaMessage)\n    {\n        $keyReplacements = [\n            'SigningCertUrl' => 'SigningCertURL',\n            'SubscribeUrl' => 'SubscribeURL',\n            'UnsubscribeUrl' => 'UnsubscribeURL',\n        ];\n\n        $message = clone $lambdaMessage;\n        foreach ($keyReplacements as $lambdaKey => $canonicalKey) {\n            if (isset($message[$lambdaKey])) {\n                $message[$canonicalKey] = $message[$lambdaKey];\n                unset($message[$lambdaKey]);\n            }\n        }\n\n        return $message;\n    }\n\n    /**\n     * Constructs the Message Validator object and ensures that openssl is\n     * installed.\n     *\n     * @param callable $certClient Callable used to download the certificate.\n     *                             Should have the following function signature:\n     *                             `function (string $certUrl) : string|false $certContent`\n     * @param string $hostNamePattern\n     */\n    public function __construct(\n        callable $certClient = null,\n        $hostNamePattern = ''\n    ) {\n        $this->certClient = $certClient ?: function($certUrl) {\n            return @ file_get_contents($certUrl);\n        };\n        $this->hostPattern = $hostNamePattern ?: self::$defaultHostPattern;\n    }\n\n    /**\n     * Validates a message from SNS to ensure that it was delivered by AWS.\n     *\n     * @param Message $message Message to validate.\n     *\n     * @throws InvalidSnsMessageException If the cert cannot be retrieved or its\n     *                                    source verified, or the message\n     *                                    signature is invalid.\n     */\n    public function validate(Message $message)\n    {\n        if (self::isLambdaStyle($message)) {\n            $message = self::convertLambdaMessage($message);\n        }\n\n        // Get the certificate.\n        $this->validateUrl($message['SigningCertURL']);\n        $certificate = call_user_func($this->certClient, $message['SigningCertURL']);\n        if ($certificate === false) {\n            throw new InvalidSnsMessageException(\n                \"Cannot get the certificate from \\\"{$message['SigningCertURL']}\\\".\"\n            );\n        }\n\n        // Extract the public key.\n        $key = openssl_get_publickey($certificate);\n        if (!$key) {\n            throw new InvalidSnsMessageException(\n                'Cannot get the public key from the certificate.'\n            );\n        }\n\n        // Verify the signature of the message.\n        $content = $this->getStringToSign($message);\n        $signature = base64_decode($message['Signature']);\n        $algo = ($message['SignatureVersion'] === self::SIGNATURE_VERSION_1 ? OPENSSL_ALGO_SHA1 : OPENSSL_ALGO_SHA256);\n        if (openssl_verify($content, $signature, $key, $algo) !== 1) {\n            throw new InvalidSnsMessageException(\n                'The message signature is invalid.'\n            );\n        }\n    }\n\n    /**\n     * Determines if a message is valid and that is was delivered by AWS. This\n     * method does not throw exceptions and returns a simple boolean value.\n     *\n     * @param Message $message The message to validate\n     *\n     * @return bool\n     */\n    public function isValid(Message $message)\n    {\n        try {\n            $this->validate($message);\n            return true;\n        } catch (InvalidSnsMessageException $e) {\n            return false;\n        }\n    }\n\n    /**\n     * Builds string-to-sign according to the SNS message spec.\n     *\n     * @param Message $message Message for which to build the string-to-sign.\n     *\n     * @return string\n     * @link http://docs.aws.amazon.com/sns/latest/gsg/SendMessageToHttp.verify.signature.html\n     */\n    public function getStringToSign(Message $message)\n    {\n        static $signableKeys = [\n            'Message',\n            'MessageId',\n            'Subject',\n            'SubscribeURL',\n            'Timestamp',\n            'Token',\n            'TopicArn',\n            'Type',\n        ];\n\n        if ($message['SignatureVersion'] !== self::SIGNATURE_VERSION_1\n            && $message['SignatureVersion'] !== self::SIGNATURE_VERSION_2) {\n            throw new InvalidSnsMessageException(\n                \"The SignatureVersion \\\"{$message['SignatureVersion']}\\\" is not supported.\"\n            );\n        }\n\n        $stringToSign = '';\n        foreach ($signableKeys as $key) {\n            if (isset($message[$key])) {\n                $stringToSign .= \"{$key}\\n{$message[$key]}\\n\";\n            }\n        }\n\n        return $stringToSign;\n    }\n\n    /**\n     * Ensures that the URL of the certificate is one belonging to AWS, and not\n     * just something from the amazonaws domain, which could include S3 buckets.\n     *\n     * @param string $url Certificate URL\n     *\n     * @throws InvalidSnsMessageException if the cert url is invalid.\n     */\n    private function validateUrl($url)\n    {\n        $parsed = parse_url($url);\n        if (empty($parsed['scheme'])\n            || empty($parsed['host'])\n            || $parsed['scheme'] !== 'https'\n            || substr($url, -4) !== '.pem'\n            || !preg_match($this->hostPattern, $parsed['host'])\n        ) {\n            throw new InvalidSnsMessageException(\n                'The certificate is located on an invalid domain.'\n            );\n        }\n    }\n}\n", "num_lines": 196}
{"repo_name": "aws-php-sns-message-validator", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sns\\Exception;\n\n/**\n * Runtime exception thrown by the SNS Message Validator.\n */\nclass InvalidSnsMessageException extends \\RuntimeException\n{\n}\n", "num_lines": 10}
{"repo_name": "aws-php-sns-message-validator", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Sns;\n\n/**\n * @covers Aws\\Sns\\MessageValidator\n * @covers Aws\\Sns\\Message\n */\nclass FunctionalValidationsTest extends \\PHPUnit_Framework_TestCase\n{\n    private static $certificate =\n'-----BEGIN CERTIFICATE-----\nMIIF1zCCBL+gAwIBAgIQB9pYWG3Mi7xej22g9pobJTANBgkqhkiG9w0BAQsFADBG\nMQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRUwEwYDVQQLEwxTZXJ2ZXIg\nQ0EgMUIxDzANBgNVBAMTBkFtYXpvbjAeFw0yMTA5MDcwMDAwMDBaFw0yMjA4MTcy\nMzU5NTlaMBwxGjAYBgNVBAMTEXNucy5hbWF6b25hd3MuY29tMIIBIjANBgkqhkiG\n9w0BAQEFAAOCAQ8AMIIBCgKCAQEAutFqueT3XgP13udzxE6UpbdjOtVO5DwoMpSM\niDNMnGzF1TYH5/R2LPUOBeTB0SkKnR4kpNcUZhicpGD4aKciz/GEZ6wu65xncfT9\nH/KBOQwoXYTuClHwp6fYpGzcGFaFoEYMnijL/o4qmTSd+ukglQUgKpsDw4ofw6rU\nm2CttJo+GQSNQ9NfGR1h/0J+zsApkeSYrXRx5wNlu87z8os1C/6PBrUHwt3xXeaf\nXzfwut8aRRYsS8BySOA9DAgLfNHlfdQCjKPXKrG/ussgReyWD6n/HH+j7Uha3xos\nTzQqJifcxlTq6MxWdPR6fDaJNvqw6DOE7UjUNxHguXHlVfxhlQIDAQABo4IC6TCC\nAuUwHwYDVR0jBBgwFoAUWaRmBlKge5WSPKOUByeWdFv5PdAwHQYDVR0OBBYEFAqz\nC+vyouneE7mWWLbi9i0UsWUbMBwGA1UdEQQVMBOCEXNucy5hbWF6b25hd3MuY29t\nMA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIw\nOwYDVR0fBDQwMjAwoC6gLIYqaHR0cDovL2NybC5zY2ExYi5hbWF6b250cnVzdC5j\nb20vc2NhMWIuY3JsMBMGA1UdIAQMMAowCAYGZ4EMAQIBMHUGCCsGAQUFBwEBBGkw\nZzAtBggrBgEFBQcwAYYhaHR0cDovL29jc3Auc2NhMWIuYW1hem9udHJ1c3QuY29t\nMDYGCCsGAQUFBzAChipodHRwOi8vY3J0LnNjYTFiLmFtYXpvbnRydXN0LmNvbS9z\nY2ExYi5jcnQwDAYDVR0TAQH/BAIwADCCAX0GCisGAQQB1nkCBAIEggFtBIIBaQFn\nAHYAKXm+8J45OSHwVnOfY6V35b5XfZxgCvj5TV0mXCVdx4QAAAF7vfDVkQAABAMA\nRzBFAiEA2XfHuy36aqRFiaL8c3md2mH451go8707+fRE0pEdSRACIE/g5FXTUXUZ\nPFcmOhm9TZ+uMY1i4CIQ/CKVWln6C3t+AHYAUaOw9f0BeZxWbbg3eI8MpHrMGyfL\n956IQpoN/tSLBeUAAAF7vfDVjAAABAMARzBFAiBF1MhhFP0+FQt3daDFfMYoWwnr\nmuTInrjNpwfzlvQBugIhAPYadFzr+LaxSJoiZEbEHBvTts7bT0M3eCQONA2O7w6n\nAHUAQcjKsd8iRkoQxqE6CUKHXk4xixsD6+tLx2jwkGKWBvYAAAF7vfDVdAAABAMA\nRjBEAiAtPapmFAuA71ih4NoSd5hJelzAltNQpxDMcDfDyHyU8gIgWxmaa6+2KbBu\n9xdv379zvnJACFR7jc+4asl08Dn4aagwDQYJKoZIhvcNAQELBQADggEBAA54QX0u\noFWXfMmv02CGZv4NWo5TapyeeixQ2kKpZHRdVZjxZrw+hoF6HD7P3kGjH8ztyJll\ntDxB0qgMltbPhQdScwhA6iTgoaBYqEUC/VHKd4PmmPT6yIsM36NBZVmkGlzl5uNo\n/dBgBaG0SsVJnhr5zro3c2quC7n6fVGEZhf/UgQwRnnvThnvbNKguglDMq4uEqv8\nnjKyleht+glkcmXO0m9qLKt6BOS0amy6U2GlAwRn0Wx02ndJtnRCSC6kPuRWK/SQ\nFEjB7gCK4hdKaAOuWdZpI55vF6ifOeM8toC3g7ofO8qLTnJupAG+ZitY5J3cvHWr\nHqOUdKigPDHYLRo=\n-----END CERTIFICATE-----';\n\n    public function getHttpFixtures()\n    {\n        return [\n            [\n                [\n                    'Type' => \"Notification\",\n                    'MessageId' => \"792cda85-518f-5dd3-9163-81d851212f3a\",\n                    'TopicArn' => \"arn:aws:sns:us-east-2:295079676684:publish-and-verify-892f85fe-4836-424d-8188-ab85bef0f362\",\n                    'Message' => \"Hello world\",\n                    'Timestamp' => \"2022-07-28T21:23:58.317Z\",\n                    'SignatureVersion' => \"1\",\n                    'Signature' => \"ghtf+deOBAzHJJZ6s6CdRLfTQAlcGzq9naoFM1wi0CJiq//uVRuZnamrkWNF0fhouMFvuLVRwcz8PZLUMSfnmd5VpdTKpTyiKmy1qJAZXma0w+yi7G+I33hD1Jyk1Nbym2n0kqp3fVu2aoooiN2ZeLAT2bH0/BtjLSfN1yAOKNoprco4qV9gGUZinXJdj9a1YdNhDR2jKi33ldlsVtEXAtiaDklGEk7DgRKX38GerBPiLg3FdtgY6KC7cdeGpU/dGK+4hjc83Ive1HoFkAwqhpgInM2sMytBosoiXfCmOKmU4xeGD0gHDNZTlJUJQDlzw8Eag0H9f/5zXF9d3uy0YQ==\",\n                    'SigningCertURL' => \"https://sns.us-east-2.amazonaws.com/SimpleNotificationService-7ff5318490ec183fbaddaa2a969abfda.pem\",\n                    'UnsubscribeURL' => \"https://sns.us-east-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-2:295079676684:publish-and-verify-892f85fe-4836-424d-8188-ab85bef0f362:2296bc94-7992-4be1-b15f-b97229b5c1d8\",\n                ]\n            ],\n            [\n                [\n                    'Type' => \"Notification\",\n                    'MessageId' => \"17dea24b-55c2-540b-8362-f916557af765\",\n                    'TopicArn' => \"arn:aws:sns:us-east-2:295079676684:publish-and-verify-62674b1d-4295-426b-88e7-5fb75652a04e\",\n                    'Message' => \"Hello world\",\n                    'Timestamp' => \"2022-07-28T21:24:08.324Z\",\n                    'SignatureVersion' => \"2\",\n                    'Signature' => \"CXVqp9PfZAL+4JHS3Zxo1PFbQsvnOjvmYhtIf17TWpwc+iIVas8kZ8GopuzVzVMdatE7rCl/O4P91Zp05Dwz8lk8dLhfp8gSu3Njlzxlyrmzo9x3va3Jb7zFnedgS2GKnZWHGBdwTXho+TosNUE+3e10OMSlwN5XGDwX7+R3WL+rn+AXmFAqp3alg27sYa55h1dLE9cGszGPjScPdtF3BmZsUDMx9wSdNKsCk+vSvE8yBjnCmUl7laSFj3LzPVrlSwgNYCF3kYnNAkah7NplK4SFhJYLwS0HCVCQJKa8rVbQLf9cBTu60U402mrgy0bN8xWoyimzbYbrOMJjalqkUg==\",\n                    'SigningCertURL' => \"https://sns.us-east-2.amazonaws.com/SimpleNotificationService-7ff5318490ec183fbaddaa2a969abfda.pem\",\n                    'UnsubscribeURL' => \"https://sns.us-east-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-2:295079676684:publish-and-verify-62674b1d-4295-426b-88e7-5fb75652a04e:ad7d16e3-0a7c-46aa-b23e-ffaf02250cbe\",\n                ]\n            ],\n            [\n                [\n                    'Type' => \"Notification\",\n                    'MessageId' => \"11405cc3-9ac7-56d5-b45d-079e8f7a8edf\",\n                    'TopicArn' => \"arn:aws:sns:us-east-2:295079676684:publish-and-verify-6e11fed2-fcdf-4c52-9dc4-36ef43f37f84\",\n                    'Subject' => \"Hello world\",\n                    'Message' => \"Hello world\",\n                    'Timestamp' => \"2022-07-28T22:53:49.654Z\",\n                    'SignatureVersion' => \"1\",\n                    'Signature' => \"AItkS26d8yvnIKJevdirIPW7eM/yKbZy3/CF2EreCHmXWB3etWaV5Fb7SYpGABMpugpDZzNyGY1wCVWaopDoQ+7Q/kI2TpDu8bw1eExbi8U3kduvc/2m2fIrI4gDEY8/v3nzoLcr8pPodqMzrX6SzQou4klfaqbNK+rFmH0LVf2Q1VyOROODoSXmo4jg2Yu12jfxccBl96Drr/ihq4MJ4OcrWh6UzXXlVYjJHx2Ui4anNwNEb+Z4C2CAF1DjQUbhDtaoajDBPY+4d9C1OwbqwQpXsd6tyVcI9nFyEsVK8lfnAV+/3GZQcdXHbIUYBRGcBa4X5TlWJku5nDH2ERtHHw==\",\n                    'SigningCertURL' => \"https://sns.us-east-2.amazonaws.com/SimpleNotificationService-7ff5318490ec183fbaddaa2a969abfda.pem\",\n                    'UnsubscribeURL' => \"https://sns.us-east-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-2:295079676684:publish-and-verify-6e11fed2-fcdf-4c52-9dc4-36ef43f37f84:adb318c3-2234-4c56-905d-c324cf0df874\",\n                ]\n            ],\n            [\n                [\n                  'Type' => \"Notification\",\n                  'MessageId' => \"4504e649-d933-5aa9-8199-bd14ccf05f0b\",\n                  'TopicArn' => \"arn:aws:sns:us-east-2:295079676684:publish-and-verify-530b26da-0687-4fe4-9f71-780bad3181e2\",\n                  'Subject' => \"Hello world\",\n                  'Message' => \"Hello world\",\n                  'Timestamp' => \"2022-07-28T22:53:55.086Z\",\n                  'SignatureVersion' => \"2\",\n                  'Signature' => \"cETcSvmmkt+My05qCLKexyl0+RyG83mSryKPqTfS+tYcxDJWVcjPJAr+qdpElzVaBl1aTGYVWMY64i9JqZ/JES8pylNj8LGvdhuNQKO59/WCoIimZAsNhn0xEgOeeDU+W/0BU4sdpCGMNjo0S/FuIiWaRe4E0YWRVrxeQevaQ70euDdfWgd5v1eCKQz8b367b9XBmMztL/CWUFI6YaKK/MV21eyvJe3Y7CtVYiOKEYiAZnAEkynK7gUGO5TsgDjGNYhj6U3xYsWgI03bmioSl7kdFSUj+AZ7ugas5fghqxgoDsdfqsjMYKRm5KKHQWsgzI619yIzpNKUiSMHxdZXpQ==\",\n                  'SigningCertURL' => \"https://sns.us-east-2.amazonaws.com/SimpleNotificationService-7ff5318490ec183fbaddaa2a969abfda.pem\",\n                  'UnsubscribeURL' => \"https://sns.us-east-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-2:295079676684:publish-and-verify-530b26da-0687-4fe4-9f71-780bad3181e2:db0ad2ad-03d1-48ca-a5da-51f317800a57\"\n                ]\n            ]\n        ];\n    }\n\n    public function getLambdaFixtures()\n    {\n        return [\n            [\n                [\n                    'Type' => \"Notification\",\n                    'MessageId' => \"792cda85-518f-5dd3-9163-81d851212f3a\",\n                    'TopicArn' => \"arn:aws:sns:us-east-2:295079676684:publish-and-verify-892f85fe-4836-424d-8188-ab85bef0f362\",\n                    'Message' => \"Hello world\",\n                    'Timestamp' => \"2022-07-28T21:23:58.317Z\",\n                    'SignatureVersion' => \"1\",\n                    'Signature' => \"ghtf+deOBAzHJJZ6s6CdRLfTQAlcGzq9naoFM1wi0CJiq//uVRuZnamrkWNF0fhouMFvuLVRwcz8PZLUMSfnmd5VpdTKpTyiKmy1qJAZXma0w+yi7G+I33hD1Jyk1Nbym2n0kqp3fVu2aoooiN2ZeLAT2bH0/BtjLSfN1yAOKNoprco4qV9gGUZinXJdj9a1YdNhDR2jKi33ldlsVtEXAtiaDklGEk7DgRKX38GerBPiLg3FdtgY6KC7cdeGpU/dGK+4hjc83Ive1HoFkAwqhpgInM2sMytBosoiXfCmOKmU4xeGD0gHDNZTlJUJQDlzw8Eag0H9f/5zXF9d3uy0YQ==\",\n                    'SigningCertUrl' => \"https://sns.us-east-2.amazonaws.com/SimpleNotificationService-7ff5318490ec183fbaddaa2a969abfda.pem\",\n                    'UnsubscribeUrl' => \"https://sns.us-east-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-2:295079676684:publish-and-verify-892f85fe-4836-424d-8188-ab85bef0f362:2296bc94-7992-4be1-b15f-b97229b5c1d8\",\n                ]\n            ],\n            [\n                [\n                    'Type' => \"Notification\",\n                    'MessageId' => \"17dea24b-55c2-540b-8362-f916557af765\",\n                    'TopicArn' => \"arn:aws:sns:us-east-2:295079676684:publish-and-verify-62674b1d-4295-426b-88e7-5fb75652a04e\",\n                    'Message' => \"Hello world\",\n                    'Timestamp' => \"2022-07-28T21:24:08.324Z\",\n                    'SignatureVersion' => \"2\",\n                    'Signature' => \"CXVqp9PfZAL+4JHS3Zxo1PFbQsvnOjvmYhtIf17TWpwc+iIVas8kZ8GopuzVzVMdatE7rCl/O4P91Zp05Dwz8lk8dLhfp8gSu3Njlzxlyrmzo9x3va3Jb7zFnedgS2GKnZWHGBdwTXho+TosNUE+3e10OMSlwN5XGDwX7+R3WL+rn+AXmFAqp3alg27sYa55h1dLE9cGszGPjScPdtF3BmZsUDMx9wSdNKsCk+vSvE8yBjnCmUl7laSFj3LzPVrlSwgNYCF3kYnNAkah7NplK4SFhJYLwS0HCVCQJKa8rVbQLf9cBTu60U402mrgy0bN8xWoyimzbYbrOMJjalqkUg==\",\n                    'SigningCertUrl' => \"https://sns.us-east-2.amazonaws.com/SimpleNotificationService-7ff5318490ec183fbaddaa2a969abfda.pem\",\n                    'UnsubscribeUrl' => \"https://sns.us-east-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-2:295079676684:publish-and-verify-62674b1d-4295-426b-88e7-5fb75652a04e:ad7d16e3-0a7c-46aa-b23e-ffaf02250cbe\",\n                ]\n            ],\n            [\n                [\n                    'Type' => \"Notification\",\n                    'MessageId' => \"792cda85-518f-5dd3-9163-81d851212f3a\",\n                    'TopicArn' => \"arn:aws:sns:us-east-2:295079676684:publish-and-verify-892f85fe-4836-424d-8188-ab85bef0f362\",\n                    'Subject' => null,\n                    'Message' => \"Hello world\",\n                    'Timestamp' => \"2022-07-28T21:23:58.317Z\",\n                    'SignatureVersion' => \"1\",\n                    'Signature' => \"ghtf+deOBAzHJJZ6s6CdRLfTQAlcGzq9naoFM1wi0CJiq//uVRuZnamrkWNF0fhouMFvuLVRwcz8PZLUMSfnmd5VpdTKpTyiKmy1qJAZXma0w+yi7G+I33hD1Jyk1Nbym2n0kqp3fVu2aoooiN2ZeLAT2bH0/BtjLSfN1yAOKNoprco4qV9gGUZinXJdj9a1YdNhDR2jKi33ldlsVtEXAtiaDklGEk7DgRKX38GerBPiLg3FdtgY6KC7cdeGpU/dGK+4hjc83Ive1HoFkAwqhpgInM2sMytBosoiXfCmOKmU4xeGD0gHDNZTlJUJQDlzw8Eag0H9f/5zXF9d3uy0YQ==\",\n                    'SigningCertUrl' => \"https://sns.us-east-2.amazonaws.com/SimpleNotificationService-7ff5318490ec183fbaddaa2a969abfda.pem\",\n                    'UnsubscribeUrl' => \"https://sns.us-east-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-2:295079676684:publish-and-verify-892f85fe-4836-424d-8188-ab85bef0f362:2296bc94-7992-4be1-b15f-b97229b5c1d8\",\n                ]\n            ],\n            [\n                [\n                    'Type' => \"Notification\",\n                    'MessageId' => \"17dea24b-55c2-540b-8362-f916557af765\",\n                    'TopicArn' => \"arn:aws:sns:us-east-2:295079676684:publish-and-verify-62674b1d-4295-426b-88e7-5fb75652a04e\",\n                    'Subject' => null,\n                    'Message' => \"Hello world\",\n                    'Timestamp' => \"2022-07-28T21:24:08.324Z\",\n                    'SignatureVersion' => \"2\",\n                    'Signature' => \"CXVqp9PfZAL+4JHS3Zxo1PFbQsvnOjvmYhtIf17TWpwc+iIVas8kZ8GopuzVzVMdatE7rCl/O4P91Zp05Dwz8lk8dLhfp8gSu3Njlzxlyrmzo9x3va3Jb7zFnedgS2GKnZWHGBdwTXho+TosNUE+3e10OMSlwN5XGDwX7+R3WL+rn+AXmFAqp3alg27sYa55h1dLE9cGszGPjScPdtF3BmZsUDMx9wSdNKsCk+vSvE8yBjnCmUl7laSFj3LzPVrlSwgNYCF3kYnNAkah7NplK4SFhJYLwS0HCVCQJKa8rVbQLf9cBTu60U402mrgy0bN8xWoyimzbYbrOMJjalqkUg==\",\n                    'SigningCertUrl' => \"https://sns.us-east-2.amazonaws.com/SimpleNotificationService-7ff5318490ec183fbaddaa2a969abfda.pem\",\n                    'UnsubscribeUrl' => \"https://sns.us-east-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-2:295079676684:publish-and-verify-62674b1d-4295-426b-88e7-5fb75652a04e:ad7d16e3-0a7c-46aa-b23e-ffaf02250cbe\",\n                ]\n            ],\n            [\n                [\n                    'Type' => \"Notification\",\n                    'MessageId' => \"11405cc3-9ac7-56d5-b45d-079e8f7a8edf\",\n                    'TopicArn' => \"arn:aws:sns:us-east-2:295079676684:publish-and-verify-6e11fed2-fcdf-4c52-9dc4-36ef43f37f84\",\n                    'Subject' => \"Hello world\",\n                    'Message' => \"Hello world\",\n                    'Timestamp' => \"2022-07-28T22:53:49.654Z\",\n                    'SignatureVersion' => \"1\",\n                    'Signature' => \"AItkS26d8yvnIKJevdirIPW7eM/yKbZy3/CF2EreCHmXWB3etWaV5Fb7SYpGABMpugpDZzNyGY1wCVWaopDoQ+7Q/kI2TpDu8bw1eExbi8U3kduvc/2m2fIrI4gDEY8/v3nzoLcr8pPodqMzrX6SzQou4klfaqbNK+rFmH0LVf2Q1VyOROODoSXmo4jg2Yu12jfxccBl96Drr/ihq4MJ4OcrWh6UzXXlVYjJHx2Ui4anNwNEb+Z4C2CAF1DjQUbhDtaoajDBPY+4d9C1OwbqwQpXsd6tyVcI9nFyEsVK8lfnAV+/3GZQcdXHbIUYBRGcBa4X5TlWJku5nDH2ERtHHw==\",\n                    'SigningCertUrl' => \"https://sns.us-east-2.amazonaws.com/SimpleNotificationService-7ff5318490ec183fbaddaa2a969abfda.pem\",\n                    'UnsubscribeUrl' => \"https://sns.us-east-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-2:295079676684:publish-and-verify-6e11fed2-fcdf-4c52-9dc4-36ef43f37f84:adb318c3-2234-4c56-905d-c324cf0df874\",\n                ]\n            ],\n            [\n                [\n                  'Type' => \"Notification\",\n                  'MessageId' => \"4504e649-d933-5aa9-8199-bd14ccf05f0b\",\n                  'TopicArn' => \"arn:aws:sns:us-east-2:295079676684:publish-and-verify-530b26da-0687-4fe4-9f71-780bad3181e2\",\n                  'Subject' => \"Hello world\",\n                  'Message' => \"Hello world\",\n                  'Timestamp' => \"2022-07-28T22:53:55.086Z\",\n                  'SignatureVersion' => \"2\",\n                  'Signature' => \"cETcSvmmkt+My05qCLKexyl0+RyG83mSryKPqTfS+tYcxDJWVcjPJAr+qdpElzVaBl1aTGYVWMY64i9JqZ/JES8pylNj8LGvdhuNQKO59/WCoIimZAsNhn0xEgOeeDU+W/0BU4sdpCGMNjo0S/FuIiWaRe4E0YWRVrxeQevaQ70euDdfWgd5v1eCKQz8b367b9XBmMztL/CWUFI6YaKK/MV21eyvJe3Y7CtVYiOKEYiAZnAEkynK7gUGO5TsgDjGNYhj6U3xYsWgI03bmioSl7kdFSUj+AZ7ugas5fghqxgoDsdfqsjMYKRm5KKHQWsgzI619yIzpNKUiSMHxdZXpQ==\",\n                  'SigningCertUrl' => \"https://sns.us-east-2.amazonaws.com/SimpleNotificationService-7ff5318490ec183fbaddaa2a969abfda.pem\",\n                  'UnsubscribeUrl' => \"https://sns.us-east-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-2:295079676684:publish-and-verify-530b26da-0687-4fe4-9f71-780bad3181e2:db0ad2ad-03d1-48ca-a5da-51f317800a57\"\n                ]\n            ]\n        ];\n    }\n\n    private function getMockCertServerClient()\n    {\n        return function () {\n            return self::$certificate;\n        };\n    }\n\n    /**\n     * @dataProvider getHttpFixtures\n     *\n     * @param array $messageData\n     */\n    public function testValidatesHttpFixtures($messageData)\n    {\n        $validator = new MessageValidator($this->getMockCertServerClient());\n        $message = new Message($messageData);\n\n        $this->assertTrue($validator->isValid($message));\n        $this->assertNotEmpty($message['SigningCertURL']);\n    }\n\n    /**\n     * @dataProvider getLambdaFixtures\n     *\n     * @param array $messageData\n     */\n    public function testValidatesLambdaFixtures($messageData)\n    {\n        $validator = new MessageValidator($this->getMockCertServerClient());\n        $message = new Message($messageData);\n\n        $this->assertTrue($validator->isValid($message));\n        $this->assertNotEmpty($message['SigningCertUrl']);\n    }\n}\n", "num_lines": 230}
{"repo_name": "aws-php-sns-message-validator", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sns;\n\nuse GuzzleHttp\\Psr7\\Request;\n\n/**\n * @covers \\Aws\\Sns\\Message\n */\nclass MessageTest extends \\PHPUnit_Framework_TestCase\n{\n    public $messageData = array(\n        'Message' => 'a',\n        'MessageId' => 'b',\n        'Timestamp' => 'c',\n        'TopicArn' => 'd',\n        'Type' => 'e',\n        'Subject' => 'f',\n        'Signature' => 'g',\n        'SignatureVersion' => '1',\n        'SigningCertURL' => 'h',\n        'SubscribeURL' => 'i',\n        'Token' => 'j',\n    );\n\n    public function testGetters()\n    {\n        $message = new Message($this->messageData);\n        $this->assertInternalType('array', $message->toArray());\n\n        foreach ($this->messageData as $key => $expectedValue) {\n            $this->assertTrue(isset($message[$key]));\n            $this->assertEquals($expectedValue, $message[$key]);\n        }\n    }\n\n    public function testIterable()\n    {\n        $message = new Message($this->messageData);\n\n        $this->assertInstanceOf('Traversable', $message);\n        foreach ($message as $key => $value) {\n            $this->assertTrue(isset($this->messageData[$key]));\n            $this->assertEquals($value, $this->messageData[$key]);\n        }\n    }\n\n    /**\n     * @dataProvider messageTypeProvider\n     *\n     * @param string $messageType\n     */\n    public function testConstructorSucceedsWithGoodData($messageType)\n    {\n        $this->assertInstanceOf('Aws\\Sns\\Message', new Message(\n            ['Type' => $messageType] + $this->messageData\n        ));\n    }\n\n    public function messageTypeProvider()\n    {\n        return [\n            ['Notification'],\n            ['SubscriptionConfirmation'],\n            ['UnsubscribeConfirmation'],\n        ];\n    }\n\n    /**\n     * @expectedException \\InvalidArgumentException\n     */\n    public function testConstructorFailsWithNoType()\n    {\n        $data = $this->messageData;\n        unset($data['Type']);\n        new Message($data);\n    }\n\n    /**\n     * @expectedException \\InvalidArgumentException\n     */\n    public function testConstructorFailsWithMissingData()\n    {\n        new Message(['Type' => 'Notification']);\n    }\n\n    /**\n     * @expectedException \\InvalidArgumentException\n     */\n    public function testRequiresTokenAndSubscribeUrlForSubscribeMessage()\n    {\n        new Message(\n            ['Type' => 'SubscriptionConfirmation'] + array_diff_key(\n                $this->messageData,\n                array_flip(['Token', 'SubscribeURL'])\n            )\n        );\n    }\n\n    /**\n     * @expectedException \\InvalidArgumentException\n     */\n    public function testRequiresTokenAndSubscribeUrlForUnsubscribeMessage()\n    {\n        new Message(\n            ['Type' => 'UnsubscribeConfirmation'] + array_diff_key(\n                $this->messageData,\n                array_flip(['Token', 'SubscribeURL'])\n            )\n        );\n    }\n\n    public function testCanCreateFromRawPost()\n    {\n        $_SERVER['HTTP_X_AMZ_SNS_MESSAGE_TYPE'] = 'Notification';\n\n        // Prep php://input with mocked data\n        MockPhpStream::setStartingData(json_encode($this->messageData));\n        stream_wrapper_unregister('php');\n        stream_wrapper_register('php', __NAMESPACE__ . '\\MockPhpStream');\n\n        $message = Message::fromRawPostData();\n        $this->assertInstanceOf('Aws\\Sns\\Message', $message);\n\n        stream_wrapper_restore(\"php\");\n        unset($_SERVER['HTTP_X_AMZ_SNS_MESSAGE_TYPE']);\n    }\n\n    /**\n     * @expectedException \\RuntimeException\n     */\n    public function testCreateFromRawPostFailsWithMissingHeader()\n    {\n        Message::fromRawPostData();\n    }\n\n    /**\n     * @expectedException \\RuntimeException\n     */\n    public function testCreateFromRawPostFailsWithMissingData()\n    {\n        $_SERVER['HTTP_X_AMZ_SNS_MESSAGE_TYPE'] = 'Notification';\n        Message::fromRawPostData();\n        unset($_SERVER['HTTP_X_AMZ_SNS_MESSAGE_TYPE']);\n    }\n\n    public function testCanCreateFromPsr7Request()\n    {\n        $request = new Request(\n            'POST',\n            '/',\n            [],\n            json_encode($this->messageData)\n        );\n        $message = Message::fromPsrRequest($request);\n        $this->assertInstanceOf('Aws\\Sns\\Message', $message);\n    }\n\n    /**\n     * @expectedException \\RuntimeException\n     */\n    public function testCreateFromPsr7RequestFailsWithMissingData()\n    {\n        $request = new Request(\n            'POST',\n            '/',\n            [],\n            'Not valid JSON'\n        );\n        Message::fromPsrRequest($request);\n    }\n\n    public function testArrayAccess()\n    {\n        $message = new Message($this->messageData);\n\n        $this->assertInstanceOf('ArrayAccess', $message);\n        $message['foo'] = 'bar';\n        $this->assertTrue(isset($message['foo']));\n        $this->assertTrue($message['foo'] === 'bar');\n        unset($message['foo']);\n        $this->assertFalse(isset($message['foo']));\n    }\n}\n", "num_lines": 184}
{"repo_name": "aws-php-sns-message-validator", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sns;\n\n/**\n * @covers Aws\\Sns\\MessageValidator\n */\nclass MessageValidatorTest extends \\PHPUnit_Framework_TestCase\n{\n    const VALID_CERT_URL = 'https://sns.foo.amazonaws.com/bar.pem';\n\n    private static $pKey;\n    private static $certificate;\n\n    public static function setUpBeforeClass()\n    {\n        self::$pKey = openssl_pkey_new();\n        $csr = openssl_csr_new([], self::$pKey);\n        $x509 = openssl_csr_sign($csr, null, self::$pKey, 1);\n        openssl_x509_export($x509, self::$certificate);\n        openssl_x509_free($x509);\n    }\n\n    public static function tearDownAfterClass()\n    {\n        openssl_pkey_free(self::$pKey);\n    }\n\n    public function testIsValidReturnsFalseOnFailedValidation()\n    {\n        $validator = new MessageValidator($this->getMockHttpClient());\n        $message = $this->getTestMessage([\n            'SignatureVersion' => '2',\n        ]);\n        $this->assertFalse($validator->isValid($message));\n    }\n\n    /**\n     * @expectedException \\Aws\\Sns\\Exception\\InvalidSnsMessageException\n     * @expectedExceptionMessage The SignatureVersion \"3\" is not supported.\n     */\n    public function testValidateFailsWhenSignatureVersionIsInvalid()\n    {\n        $validator = new MessageValidator($this->getMockCertServerClient());\n        $message = $this->getTestMessage([\n            'SignatureVersion' => '3',\n        ]);\n        $validator->validate($message);\n    }\n\n    /**\n     * @expectedException \\Aws\\Sns\\Exception\\InvalidSnsMessageException\n     * @expectedExceptionMessage The certificate is located on an invalid domain.\n     */\n    public function testValidateFailsWhenCertUrlInvalid()\n    {\n        $validator = new MessageValidator();\n        $message = $this->getTestMessage([\n            'SigningCertURL' => 'https://foo.amazonaws.com/bar.pem',\n        ]);\n        $validator->validate($message);\n    }\n\n    /**\n     * @expectedException \\Aws\\Sns\\Exception\\InvalidSnsMessageException\n     * @expectedExceptionMessage The certificate is located on an invalid domain.\n     */\n    public function testValidateFailsWhenCertUrlNotAPemFile()\n    {\n        $validator = new MessageValidator();\n        $message = $this->getTestMessage([\n            'SigningCertURL' => 'https://foo.amazonaws.com/bar',\n        ]);\n        $validator->validate($message);\n    }\n\n    public function testValidatesAgainstCustomDomains()\n    {\n        $validator = new MessageValidator(\n            function () {\n                return self::$certificate;\n            },\n            '/^(foo|bar).example.com$/'\n        );\n        $message = $this->getTestMessage([\n            'SigningCertURL' => 'https://foo.example.com/baz.pem',\n        ]);\n        $message['Signature'] = $this->getSignature($validator->getStringToSign($message));\n        $this->assertTrue($validator->isValid($message));\n    }\n\n    /**\n     * @expectedException \\Aws\\Sns\\Exception\\InvalidSnsMessageException\n     * @expectedExceptionMessageRegExp /Cannot get the certificate from \".+\"./\n     */\n    public function testValidateFailsWhenCannotGetCertificate()\n    {\n        $validator = new MessageValidator($this->getMockHttpClient(false));\n        $message = $this->getTestMessage();\n        $validator->validate($message);\n    }\n\n    /**\n     * @expectedException \\Aws\\Sns\\Exception\\InvalidSnsMessageException\n     * @expectedExceptionMessage Cannot get the public key from the certificate.\n     */\n    public function testValidateFailsWhenCannotDeterminePublicKey()\n    {\n        $validator = new MessageValidator($this->getMockHttpClient());\n        $message = $this->getTestMessage();\n        $validator->validate($message);\n    }\n\n    /**\n     * @expectedException \\Aws\\Sns\\Exception\\InvalidSnsMessageException\n     * @expectedExceptionMessage The message signature is invalid.\n     */\n    public function testValidateFailsWhenMessageIsInvalid()\n    {\n        $validator = new MessageValidator($this->getMockCertServerClient());\n        $message = $this->getTestMessage([\n            'Signature' => $this->getSignature('foo'),\n        ]);\n        $validator->validate($message);\n    }\n\n        /**\n         * @expectedException \\Aws\\Sns\\Exception\\InvalidSnsMessageException\n         * @expectedExceptionMessage The message signature is invalid.\n         */\n        public function testValidateFailsWhenSha256MessageIsInvalid()\n        {\n            $validator = new MessageValidator($this->getMockCertServerClient());\n            $message = $this->getTestMessage([\n                'Signature' => $this->getSignature('foo'),\n                 'SignatureVersion' => '2'\n\n            ]);\n            $validator->validate($message);\n        }\n\n    public function testValidateSucceedsWhenMessageIsValid()\n    {\n        $validator = new MessageValidator($this->getMockCertServerClient());\n        $message = $this->getTestMessage();\n\n        // Get the signature for a real message\n        $message['Signature'] = $this->getSignature($validator->getStringToSign($message));\n\n        // The message should validate\n        $this->assertTrue($validator->isValid($message));\n    }\n\n    public function testValidateSucceedsWhenSha256MessageIsValid()\n    {\n        $validator = new MessageValidator($this->getMockCertServerClient());\n        $message = $this->getTestMessage([\n            'SignatureVersion' => '2'\n        ]);\n\n        // Get the signature for a real message\n        $message['Signature'] = $this->getSignature($validator->getStringToSign($message), '2');\n\n        // The message should validate\n        $this->assertTrue($validator->isValid($message));\n    }\n\n    public function testBuildsStringToSignCorrectly()\n    {\n        $validator = new MessageValidator();\n        $stringToSign = <<< STRINGTOSIGN\nMessage\nfoo\nMessageId\nbar\nTimestamp\n1435697129\nTopicArn\nbaz\nType\nNotification\n\nSTRINGTOSIGN;\n\n        $this->assertEquals(\n            $stringToSign,\n            $validator->getStringToSign($this->getTestMessage())\n        );\n    }\n\n    /**\n     * @param array $customData\n     *\n     * @return Message\n     */\n    private function getTestMessage(array $customData = [])\n    {\n        return new Message($customData + [\n            'Message'          => 'foo',\n            'MessageId'        => 'bar',\n            'Timestamp'        => time(),\n            'TopicArn'         => 'baz',\n            'Type'             => 'Notification',\n            'SigningCertURL'   => self::VALID_CERT_URL,\n            'Signature'        => true,\n            'SignatureVersion' => '1',\n        ]);\n    }\n\n    private function getMockHttpClient($responseBody = '')\n    {\n        return function () use ($responseBody) {\n            return $responseBody;\n        };\n    }\n\n    private function getMockCertServerClient()\n    {\n        return function ($url) {\n            if ($url !== self::VALID_CERT_URL) {\n                return '';\n            }\n\n            return self::$certificate;\n        };\n    }\n\n    private function getSignature($stringToSign, $algo = '1')\n    {\n        if ($algo === '2') {\n            openssl_sign($stringToSign, $signature, self::$pKey, 'SHA256');\n        } else {\n            openssl_sign($stringToSign, $signature, self::$pKey);\n        }\n\n        return base64_encode($signature);\n    }\n}\n\nfunction time()\n{\n    return 1435697129;\n}\n", "num_lines": 243}
{"repo_name": "aws-php-sns-message-validator", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sns;\n\nclass MockPhpStream\n{\n    private static $startingData = '';\n    private $index;\n    private $length;\n    private $data;\n\n    public static function setStartingData($data)\n    {\n        self::$startingData = $data;\n    }\n\n    public function __construct()\n    {\n        $this->data = self::$startingData;\n        $this->index = 0;\n        $this->length = strlen(self::$startingData);\n    }\n\n    public function stream_open($path, $mode, $options, &$opened_path)\n    {\n        return true;\n    }\n\n    public function stream_close()\n    {\n    }\n\n    public function stream_stat()\n    {\n        return array();\n    }\n\n    public function stream_flush()\n    {\n        return true;\n    }\n\n    public function stream_read($count)\n    {\n        $length = min($count, $this->length - $this->index);\n        $data = substr($this->data, $this->index);\n        $this->index = $this->index + $length;\n\n        return $data;\n    }\n\n    public function stream_eof()\n    {\n        return ($this->index >= $this->length);\n    }\n\n    public function stream_write($data)\n    {\n        return 0;\n    }\n}\n", "num_lines": 61}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// Run this script from the command line to see if your system is able to run\n// the AWS SDK for PHP\n\nclass CompatibilityTest\n{\n    protected $isCli;\n    protected $lines = array();\n\n    public function __construct()\n    {\n        $this->isCli = php_sapi_name() == 'cli';\n        $title = 'AWS SDK for PHP Compatibility Test';\n        if ($this->isCli) {\n            $rep = str_repeat('=', strlen($title));\n            $this->lines[] = \"{$rep}\\n{$title}\\n{$rep}\";\n        } else {\n            $this->lines[] = sprintf(\n                '<style type=\"text/css\">%s %s</style>',\n                'html {font-family:verdana;} .OK {color: #166116;}',\n                '.FAIL {margin-top: 1em; color: #A52C27;} .WARNING {margin-top: 1em; color:#6B036B;}'\n            );\n            $this->lines[] = \"<h1>{$title}</h1>\";\n        }\n    }\n\n    public function endTest()\n    {\n        $text = implode(\"\\n\", $this->lines);\n        echo $this->isCli ? $text : \"<html><body>{$text}</body></html>\";\n    }\n\n    public function title($text)\n    {\n        $this->lines[] = $this->isCli\n            ?  \"\\n\" . $text . \"\\n\" . str_repeat('-', strlen($text)) . \"\\n\"\n            : \"<h2>{$text}</h2>\";\n    }\n\n    public function write($text)\n    {\n        $this->lines[] = $text;\n    }\n\n    public function quote($text)\n    {\n        return !$this->isCli\n            ? \"<pre>{$text}</pre>\"\n            : implode(\"\\n\", array_map(function ($t) { return '    ' . $t; }, explode(\"\\n\", $text)));\n    }\n\n    public function check($info, $func, $text, $required)\n    {\n        $level = $func() ? 'OK' : ($required ? 'FAIL' : 'WARNING');\n        if ($this->isCli) {\n            $text = $level == 'OK' ? \"- {$info}: [OK]\" : \"- {$info}: [{$level}]\\n  - {$text}\";\n        } else {\n            $text = $level == 'OK'\n                ? \"<span class=\\\"{$level}\\\">{$info}</span><br />\"\n                : \"<div class=\\\"{$level}\\\">{$info}: [{$level}]<br /><blockquote>{$text}</blockquote></div>\";\n        }\n        $this->write($text);\n    }\n\n    public function addRecommend($info, $func, $text)\n    {\n        $this->check($info, $func, $text, false);\n    }\n\n    public function addRequire($info, $func, $text)\n    {\n        $this->check($info, $func, $text, true);\n    }\n\n    public function iniCheck($info, $setting, $expected, $required = true, $help = null)\n    {\n        $current = ini_get($setting);\n        $cb = function () use ($current, $expected) {\n            return is_callable($expected)\n                ? call_user_func($expected, $current)\n                : $current == $expected;\n        };\n\n        $message = sprintf(\n            '%s in %s is currently set to %s but %s be set to %s.',\n            $setting,\n            php_ini_loaded_file(),\n            var_export($current, true),\n            $required ? 'must' : 'should',\n            var_export($expected, true)\n        ) . ' ' . $help;\n\n        $this->check($info, $cb, trim($message), $required);\n    }\n\n    public function extCheck($ext, $required = true, $help = '')\n    {\n        $info = sprintf('Checking if the %s extension is installed', $ext);\n        $cb = function () use ($ext) { return extension_loaded($ext); };\n        $message = $help ?: sprintf('The %s extension %s be installed', $ext, $required ? 'must' : 'should');\n        $this->check($info, $cb, $message, $required);\n    }\n}\n\n$c = new CompatibilityTest();\n$c->title('System requirements');\n$c->addRequire(\n    'Ensuring that the version of PHP is >= 5.5.0',\n    function () { return version_compare(phpversion(), '5.5.0', '>='); },\n    'You must update your version of PHP to 5.5.0 to run the AWS SDK for PHP'\n);\n\n$c->iniCheck('Ensuring that detect_unicode is disabled', 'detect_unicode', false, true, 'Enabling detect_unicode may cause errors when using phar files. See https://bugs.php.net/bug.php?id=42396');\n$c->iniCheck('Ensuring that session.auto_start is disabled', 'session.auto_start', false);\n\nif (extension_loaded('suhosin')) {\n    $c->addRequire(\n        'Ensuring that phar files can be run with the suhosin patch',\n        function () {\n            return false !== stripos(ini_get('suhosin.executor.include.whitelist'), 'phar');\n        },\n        sprintf('suhosin.executor.include.whitelist must be configured to include \"phar\" in %s so that the phar file works correctly', php_ini_loaded_file())\n    );\n}\n\nforeach (array('pcre', 'spl', 'json', 'simplexml') as $ext) {\n    $c->extCheck($ext, true);\n}\n\nif (function_exists('curl_version')) {\n    $c->addRequire('Ensuring that cURL can send https requests', function () {\n        $version = curl_version();\n        return in_array('https', $version['protocols'], true);\n    }, 'cURL must be able to send https requests');\n}\n\n$c->addRequire('Ensuring that file_get_contents works', function () {\n    return function_exists('file_get_contents');\n}, 'file_get_contents has been disabled');\n\n$c->title('System recommendations');\n\n$c->addRecommend('Checking if you are running on a 64-bit platform', function () {\n    return PHP_INT_MAX === 9223372036854775807;\n}, 'You are not running on a 64-bit installation of PHP. You may run into issues uploading or downloading files larger than 2GB.');\n\n$c->iniCheck('Ensuring that zend.enable_gc is enabled', 'zend.enable_gc', true, false);\n\n$c->check('Ensuring that date.timezone is set', function () {\n    return (bool) ini_get('date.timezone');\n}, 'The date.timezone PHP ini setting has not been set in ' . php_ini_loaded_file(), false);\n\nif (extension_loaded('xdebug')) {\n    $c->addRecommend('Checking if Xdebug is installed', function () { return false; }, 'Xdebug is installed. Consider uninstalling Xdebug to make the SDK run much faster.');\n    $c->iniCheck('Ensuring that Xdebug\\'s infinite recursion detection does not erroneously cause a fatal error', 'xdebug.max_nesting_level', 0, false);\n}\n\n$c->extCheck('dom',false);\n$c->extCheck('curl',false);\n$c->extCheck('openssl', false);\n$c->extCheck('zlib', false);\n$c->iniCheck('Checking if OPCache is enabled', 'opcache.enable', 1, false);\n\n$c->title('PHP information');\nob_start();\nphpinfo(INFO_GENERAL);\n$info = ob_get_clean();\n$c->write($c->quote($info));\n\n$c->endTest();\n", "num_lines": 171}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n/**\n * This file updates the '@method' annotations on the Aws\\Sdk class.\n */\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\n$namespaces = array_map(function (array $manifest) {\n    return $manifest['namespace'];\n}, array_values(Aws\\manifest()));\n\nsort($namespaces);\n$annotations = [];\nforeach ($namespaces as $namespace) {\n    $mrClient = \"\\\\Aws\\\\{$namespace}\\\\{$namespace}MultiRegionClient\";\n    $mrClient = class_exists($mrClient) ? $mrClient : \"\\\\Aws\\\\MultiRegionClient\";\n\n    $annotations []= \" * @method \\\\Aws\\\\{$namespace}\\\\{$namespace}Client\"\n        . \" create{$namespace}(array \\$args = [])\";\n    $annotations []= \" * @method $mrClient\"\n        . \" createMultiRegion{$namespace}(array \\$args = [])\";\n}\n\n$previousAnnotationPattern = '/^\\* @method'\n    . ' \\\\\\\\Aws\\\\\\\\(?:[a-zA-Z0-9\\\\\\\\]+)Client'\n    . ' create(?:[a-zA-Z0-9]+)\\\\(array \\$args = \\\\[\\\\]\\\\)/';\n\n$updater = new ClassAnnotationUpdater(\n    new ReflectionClass(\\Aws\\Sdk::class),\n    $annotations,\n    '',\n    $previousAnnotationPattern\n);\n$updater->update();\n", "num_lines": 35}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n/**\n * This file is responsible for adding @method annotations to each client class.\n */\nrequire __DIR__ . '/../vendor/autoload.php';\n\n// parse out --class, --tag, and --all options\n// You can have multiple --class and --tag flags\n//  e.g. php annotate-clients.php --class=Aws\\S3\\S3Client --class=Aws\\Swf\\SwfClient\n// Use --class to update the annotation on a class\n// Use --tag to update annotations on clients updated since a given git tag\n// Use --tag=latest to do so comparing against the last release\n// Use --all to update annotations on all clients\n// Combine them at will; each class will only be updated once\n$options = getopt('', ['class:', 'tag:', 'all']) + ['class' => [], 'tag' => []];\n\n// make sure all options are arrays\narray_walk($options, function (&$value) {\n    if (!is_array($value)) {\n        $value = [$value];\n    }\n});\n\nfunction get_client_classes($namespace) {\n    $clients = [\"Aws\\\\{$namespace}\\\\{$namespace}Client\"];\n    if (class_exists(\"Aws\\\\{$namespace}\\\\{$namespace}MultiRegionClient\")) {\n        $clients []= \"Aws\\\\{$namespace}\\\\{$namespace}MultiRegionClient\";\n    }\n\n    return $clients;\n};\n\nif (isset($options['all'])) {\n    // Get all client classes and mark them for update\n    $options['class'] = Aws\\flatmap(Aws\\manifest(), function (array $manifest) {\n        return get_client_classes($manifest['namespace']);\n    });\n}\n\nforeach ($options['tag'] as $tag) {\n    // Change 'latest' to the last release\n    if ('latest' === $tag) {\n        $tag = trim(`git tag | tail -n 1`);\n    }\n\n    // Find all api-2.json files changed since a given tag. These are service\n    // API definitions; changes here can mean changes to client annotations.\n    exec(\"git diff-index --name-only --cached $tag\", $files);\n    $alteredApiFiles = array_filter($files, function ($file) {\n        return preg_match('/api-2.json$/', $file);\n    });\n\n    // Find the client classes for each changed API service definition and mark\n    // them for update.\n    $clientsWithChangedApis = Aws\\flatmap($alteredApiFiles, function ($file) {\n        $file = str_replace('src/data/', '', $file);\n        $endpoint = substr($file, 0, strpos($file, '/'));\n        return get_client_classes(Aws\\manifest($endpoint)['namespace']);\n    });\n    $options['class'] = \\Aws\\flatmap(\n        [$options['class'], $clientsWithChangedApis],\n        function ($class) { return $class; }\n    );\n}\n\nforeach ($options['class'] as $classToUpdate) {\n    // Update the @method annotations on a client.\n    $annotator = new ClientAnnotator($classToUpdate);\n\n    if (!$annotator->updateApiMethodAnnotations()) {\n        trigger_error(\n            \"Unable to update annotations on $classToUpdate\",\n            E_USER_WARNING\n        );\n    }\n}\n", "num_lines": 77}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nrequire __DIR__  . '/../vendor/autoload.php';\n\n\\JmesPath\\Env::cleanCompileDir();\n", "num_lines": 5}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n/*\n * This file is responsible for building up the API manifest file, including\n * determining the latest API version and hooking up endpoint prefix names\n * with client namespace names.\n */\n\n$compatibleApiVersions = [\n    'apigateway' => [\n        'latest' => [\n            '2015-06-01',\n        ],\n    ],\n    'cloudfront' => [\n        'latest' => [\n            '2016-01-13',\n            '2015-09-17',\n        ],\n        '2015-07-27' => [\n            '2015-04-17',\n            '2014-11-06'\n        ],\n    ],\n    'ec2' => [\n        'latest' => [\n            '2015-04-15',\n        ],\n    ],\n    'events' => [\n        'latest' => [\n            '2014-02-03',\n        ],\n    ],\n    'inspector' => [\n        'latest' => [\n            '2015-08-18',\n        ]\n    ],\n];\n\n// Create a list of possible namespaces so that we can include it in the\n// manifest.\n$possibleNamespaces = [];\n$skip = ['.', '..', 'Api', 'data', 'Multipart', 'Signature'];\nforeach (scandir(__DIR__ . '/../src') as $dir) {\n    if (!in_array($dir, $skip) && is_dir(__DIR__ . '/../src/' . $dir)) {\n        $possibleNamespaces[strtolower($dir)] = $dir;\n    }\n}\n\n$manifest = [];\nforeach (glob(__DIR__ . '/../src/data/**/**/api-2.json') as $file) {\n    $model = json_decode(file_get_contents($file), true);\n    preg_match('@src/data/([^/]+)/[0-9]{4}-[0-9]{2}-[0-9]{2}/api-2.json$@', $file, $matches);\n    $identifier = $matches[1];\n    $metadata = $model['metadata'] + ['compatibleApiVersions' => []];\n    if (empty($manifest[$identifier])) {\n        // Calculate a namespace for the service.\n        $ns = isset($metadata['serviceAbbreviation'])\n            ? $metadata['serviceAbbreviation']\n            : $metadata['serviceFullName'];\n        $ns = str_replace(['Amazon', 'AWS', 'Beta', '(', ')', ' ', '/', '-'], '', $ns);\n\n        //check if it's a grandfathered namespace\n        $grandfatheredServices = json_decode(\n            file_get_contents(__DIR__ . '/../src/data/grandfathered-services.json'),\n            true\n        )['grandfathered-services'];\n        if (!in_array($ns, $grandfatheredServices)) {\n            $ns = str_replace(' ', '', ucwords($metadata['serviceId']));\n        }\n\n        if (!isset($possibleNamespaces[strtolower($ns)])) {\n            throw new \\Exception('NS not found: ' . $ns);\n        }\n\n        $ns = $possibleNamespaces[strtolower($ns)];\n\n        $manifest[$identifier] = [\n            'namespace' => $ns,\n            'versions' => [],\n        ];\n    }\n\n    $manifest[$identifier]['versions'][$metadata['apiVersion']]\n        = $metadata['apiVersion'];\n}\n\nforeach ($manifest as $identifier => &$metadata) {\n    $metadata['versions']['latest'] = max(array_keys($metadata['versions']));\n    foreach ($metadata['versions'] as $name => $version) {\n        if (isset($compatibleApiVersions[$identifier][$name])) {\n            foreach ($compatibleApiVersions[$identifier][$name] as $compatVersion) {\n                $metadata['versions'][$compatVersion]\n                    = $metadata['versions'][$name];\n            }\n        }\n    }\n\n    krsort($metadata['versions']);\n}\n\n$data = json_encode($manifest, JSON_PRETTY_PRINT);\n$file = __DIR__ . '/../src/data/manifest.json';\nfile_put_contents($file, \"$data\\n\");\n\necho \"Wrote the following data to {$file}:\\n>>>>>\\n{$data}<<<<<\\n\";\n", "num_lines": 108}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// Setup autoloading for SDK and build classes.\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse Aws\\Build\\Docs\\RedirectMapBuilder;\n\n$path = __DIR__ . '/artifacts/docs/package.redirects.conf';\n$apiProvider = \\Aws\\Api\\ApiProvider::defaultProvider();\n\n$builder = new RedirectMapBuilder($apiProvider, $path);\n$builder->build();\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nrequire __DIR__ . '/../vendor/autoload.php';\nrequire __DIR__ . '/ServiceBuilder.php';\n\n$options = getopt('', [\n    'namespace:',\n    'model:',\n    'clientPath:',\n    'exceptionPath:'\n]);\n\nif (empty($options['namespace']) || empty($options['model'])) {\n    throw new LogicException(\n        \"You must specify a namespace (--namespace=) and path to an api model \"\n        . \"(--model=) to build a service\"\n    );\n}\n\n$options['model'] = \\Aws\\load_compiled_json($options['model']);\n$options['namespace'] = ucfirst($options['namespace']);\n\n$options += [\n    'clientPath' => dirname(__DIR__)\n        . \"/src/{$options['namespace']}/{$options['namespace']}Client.php\",\n    'exceptionPath' => dirname(__DIR__)\n        . \"/src/{$options['namespace']}/Exception/{$options['namespace']}Exception.php\",\n];\n\n(new ServiceBuilder(\n    $options['namespace'],\n    $options['model'],\n    $options['clientPath'],\n    $options['exceptionPath']\n))\n    ->buildClient()\n    ->buildException();\n", "num_lines": 38}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\n/**\n * Packages the zip and phar file using a staging directory.\n *\n * @license MIT, Michael Dowling https://github.com/mtdowling\n * @license https://github.com/mtdowling/Burgomaster/LICENSE\n */\nclass Burgomaster\n{\n    /** @var string Base staging directory of the project */\n    public $stageDir;\n\n    /** @var string Root directory of the project */\n    public $projectRoot;\n\n    /** @var array stack of sections */\n    private $sections = array();\n\n    /**\n     * @param string $stageDir    Staging base directory where your packaging\n     *                            takes place. This folder will be created for\n     *                            you if it does not exist. If it exists, it\n     *                            will be deleted and recreated to start fresh.\n     * @param string $projectRoot Root directory of the project.\n     *\n     * @throws \\InvalidArgumentException\n     * @throws \\RuntimeException\n     */\n    public function __construct($stageDir, $projectRoot = null)\n    {\n        $this->startSection('setting_up');\n        $this->stageDir = $stageDir;\n        $this->projectRoot = $projectRoot;\n\n        if (!$this->stageDir || $this->stageDir == '/') {\n            throw new \\InvalidArgumentException('Invalid base directory');\n        }\n\n        if (is_dir($this->stageDir)) {\n            $this->debug(\"Removing existing directory: $this->stageDir\");\n            echo $this->exec(\"rm -rf $this->stageDir\");\n        }\n\n        $this->debug(\"Creating staging directory: $this->stageDir\");\n\n        if (!mkdir($this->stageDir, 0777, true)) {\n            throw new \\RuntimeException(\"Could not create {$this->stageDir}\");\n        }\n\n        $this->stageDir = realpath($this->stageDir);\n        $this->debug(\"Creating staging directory at: {$this->stageDir}\");\n\n        if (!is_dir($this->projectRoot)) {\n            throw new \\InvalidArgumentException(\n                \"Project root not found: $this->projectRoot\"\n            );\n        }\n\n        $this->endSection();\n        $this->startSection('staging');\n\n        chdir($this->projectRoot);\n    }\n\n    /**\n     * Cleanup if the last section was not already closed.\n     */\n    public function __destruct()\n    {\n        if ($this->sections) {\n            $this->endSection();\n        }\n    }\n\n    /**\n     * Call this method when starting a specific section of the packager.\n     *\n     * This makes the debug messages used in your script more meaningful and\n     * adds context when things go wrong. Be sure to call endSection() when\n     * you have finished a section of your packaging script.\n     *\n     * @param string $section Part of the packager that is running\n     */\n    public function startSection($section)\n    {\n        $this->sections[] = $section;\n        $this->debug('Starting');\n    }\n\n    /**\n     * Call this method when leaving the last pushed section of the packager.\n     */\n    public function endSection()\n    {\n        if ($this->sections) {\n            $this->debug('Completed');\n            array_pop($this->sections);\n        }\n    }\n\n    /**\n     * Prints a debug message to STDERR bound to the current section.\n     *\n     * @param string $message Message to echo to STDERR\n     */\n    public function debug($message)\n    {\n        $prefix = date('c') . ': ';\n\n        if ($this->sections) {\n            $prefix .= '[' . end($this->sections) . '] ';\n        }\n\n        fwrite(STDERR, $prefix . $message . \"\\n\");\n    }\n\n    /**\n     * Copies a file and creates the destination directory if needed.\n     *\n     * @param string $from File to copy\n     * @param string $to   Destination to copy the file to, relative to the\n     *                     base staging directory.\n     * @throws \\InvalidArgumentException if the file cannot be found\n     * @throws \\RuntimeException if the directory cannot be created.\n     * @throws \\RuntimeException if the file cannot be copied.\n     */\n    public function deepCopy($from, $to)\n    { \n        if (!is_file($from)) {\n            throw new \\InvalidArgumentException(\"File not found: {$from}\");\n        }\n\n        $to = str_replace('//', '/', $this->stageDir . '/' . $to);\n        $dir = dirname($to);\n\n        if (!is_dir($dir)) {\n            if (!mkdir($dir, 0777, true)) {\n                throw new \\RuntimeException(\"Unable to create directory: $dir\");\n            }\n        }\n\n        if (!copy($from, $to)) {\n            throw new \\RuntimeException(\"Unable to copy $from to $to\");\n        }\n    }\n\n    /**\n     * Recursively copy one folder to another.\n     *\n     * Any LICENSE file is automatically copied.\n     *\n     * @param string    $sourceDir  Source directory to copy from\n     * @param string    $destDir    Directory to copy the files to that is relative\n     *                              to the the stage base directory.\n     * @param array     $extensions File extensions to copy from the $sourceDir.\n     *                              Defaults to \"php\" files only (e.g., ['php']).\n     * @param Iterator|null  $files Files to copy from the source directory, each\n     *                              yielded out as an SplFileInfo object.\n     *                              Defaults to a recursive iterator of $sourceDir\n     * @throws \\InvalidArgumentException if the source directory is invalid.\n     */\n    function recursiveCopy(\n        $sourceDir,\n        $destDir,\n        $extensions = array('php', 'php.gz'),\n        Iterator $files = null\n    ) {\n        if (!realpath($sourceDir)) {\n            throw new \\InvalidArgumentException(\"$sourceDir not found\");\n        }\n\n        if (!$extensions) {\n            throw new \\InvalidArgumentException('$extensions is empty!');\n        }\n\n        $sourceDir = realpath($sourceDir);\n        $exts = array_fill_keys($extensions, true);\n        if (empty($files)) {\n            $files = new \\RecursiveIteratorIterator(\n                new \\RecursiveDirectoryIterator($sourceDir)\n            );\n        }\n        $total = 0;\n\n        $this->startSection('copy');\n        $this->debug(\"Starting to copy files from $sourceDir\");\n        foreach ($files as $file) {\n            $shouldCopyFile = false;\n            if ($file->getBaseName() == 'LICENSE') {\n                $shouldCopyFile = true;\n            } else {\n                foreach ($extensions as $extension) {\n                    if (substr($file->getFilename(), -strlen($extension)) == $extension) {\n                        $shouldCopyFile = true;\n                    }\n                }\n            }\n            if ($shouldCopyFile) {\n                // Remove the source directory from the destination path\n                $toPath = str_replace($sourceDir, '', (string) $file);\n                $toPath = $destDir . '/' . $toPath;\n                $toPath = str_replace('//', '/', $toPath);\n                $this->deepCopy((string) $file, $toPath);\n                $total++;\n            }\n        }\n\n        $this->debug(\"Copied $total files from $sourceDir\");\n        $this->endSection();\n    }\n\n    /**\n     * Execute a command and throw an exception if the return code is not 0.\n     *\n     * @param string $command Command to execute\n     *\n     * @return string Returns the output of the command as a string\n     * @throws \\RuntimeException on error.\n     */\n    public function exec($command)\n    {\n        $this->debug(\"Executing: $command\");\n        $output = $returnValue = null;\n        exec($command, $output, $returnValue);\n\n        if ($returnValue != 0) {\n            throw new \\RuntimeException('Error executing command: '\n                . $command . ' : ' . implode(\"\\n\", $output));\n        }\n\n        return implode(\"\\n\", $output);\n    }\n\n    /**\n     * Creates a class-map autoloader to the staging directory in a file\n     * named autoloader.php\n     *\n     * @param array $files Files to explicitly require in the autoloader. This\n     *                     is similar to Composer's \"files\" \"autoload\" section.\n     * @param string $filename Name of the autoloader file.\n     * @throws \\RuntimeException if the file cannot be written\n     */\n    function createAutoloader($files = array(), $filename = 'autoloader.php') {\n        $sourceDir = realpath($this->stageDir);\n        $iter = new \\RecursiveDirectoryIterator($sourceDir);\n        $iter = new \\RecursiveIteratorIterator($iter);\n\n        $this->startSection('autoloader');\n        $this->debug('Creating classmap autoloader');\n        $this->debug(\"Collecting valid PHP files from {$this->stageDir}\");\n\n        $classMap = array();\n        foreach ($iter as $file) {\n            if ($file->getExtension() == 'php') {\n                $location = str_replace($this->stageDir . '/', '', (string) $file);\n                $className = str_replace('/', '\\\\', $location);\n                $className = substr($className, 0, -4);\n\n                // Remove \"src\\\" or \"lib\\\"\n                if (strpos($className, 'src\\\\') === 0\n                    || strpos($className, 'lib\\\\') === 0\n                ) {\n                    $className = substr($className, 4);\n                }\n\n                $classMap[$className] = \"__DIR__ . '/$location'\";\n                $this->debug(\"Found $className\");\n            }\n        }\n\n        $destFile = $this->stageDir . '/' . $filename;\n        $this->debug(\"Writing autoloader to {$destFile}\");\n\n        if (!($h = fopen($destFile, 'w'))) {\n            throw new \\RuntimeException('Unable to open file for writing');\n        }\n\n        $this->debug('Writing classmap files');\n        fwrite($h, \"<?php\\n\\n\");\n        fwrite($h, \"\\$mapping = array(\\n\");\n        foreach ($classMap as $c => $f) {\n            fwrite($h, \"    '$c' => $f,\\n\");\n        }\n        fwrite($h, \");\\n\\n\");\n        fwrite($h, <<<EOT\nspl_autoload_register(function (\\$class) use (\\$mapping) {\n    if (isset(\\$mapping[\\$class])) {\n        require \\$mapping[\\$class];\n    }\n}, true);\n\nEOT\n        );\n\n        fwrite($h, \"\\n\");\n\n        $this->debug('Writing automatically included files');\n        foreach ($files as $file) {\n            fwrite($h, \"require __DIR__ . '/$file';\\n\");\n        }\n\n        fclose($h);\n\n        $this->endSection();\n    }\n\n    /**\n     * Creates a default stub for the phar that includes the generated\n     * autoloader.\n     *\n     * This phar also registers a constant that can be used to check if you\n     * are running the phar. The constant is the basename of the $dest variable\n     * without the extension, with \"_PHAR\" appended, then converted to all\n     * caps (e.g., \"/foo/guzzle.phar\" gets a contant defined as GUZZLE_PHAR.\n     *\n     * @param $dest\n     * @param string $autoloaderFilename Name of the autoloader file.\n     * @param string $alias The phar alias to use\n     *\n     * @return string\n     */\n    private function createStub($dest, $autoloaderFilename = 'autoloader.php', $alias = null)\n    {\n        $this->startSection('stub');\n        $this->debug(\"Creating phar stub at $dest\");\n\n        $alias = $alias ?: basename($dest);\n        $constName = str_replace('.phar', '', strtoupper($alias)) . '_PHAR';\n        $stub  = \"<?php\\n\";\n        $stub .= \"define('$constName', true);\\n\";\n        $stub .= \"Phar::mapPhar('$alias');\\n\";\n        $stub .= \"require 'phar://$alias/{$autoloaderFilename}';\\n\";\n        $stub .= \"__HALT_COMPILER();\\n\";\n        $this->endSection();\n\n        return $stub;\n    }\n\n    /**\n     * Creates a phar that automatically registers an autoloader.\n     *\n     * Call this only after your staging directory is built.\n     *\n     * @param string $dest Where to save the file. The basename of the file\n     *     is also used as the alias name in the phar\n     *     (e.g., /path/to/guzzle.phar => guzzle.phar).\n     * @param string|bool|null $stub The path to the phar stub file. Pass or\n     *      leave null to automatically have one created for you. Pass false\n     *      to no use a stub in the generated phar.\n     * @param string $autoloaderFilename Name of the autoloader filename.\n     */\n    public function createPhar(\n        $dest,\n        $stub = null,\n        $autoloaderFilename = 'autoloader.php',\n        $alias = null\n    ) {\n        $this->startSection('phar');\n        $this->debug(\"Creating phar file at $dest\");\n        $this->createDirIfNeeded(dirname($dest));\n        $phar = new \\Phar($dest, 0, $alias ?: basename($dest));\n        $phar->buildFromDirectory($this->stageDir);\n\n        if ($stub !== false) {\n            if (!$stub) {\n                $stub = $this->createStub($dest, $autoloaderFilename, $alias);\n            }\n            $phar->setStub($stub);\n        }\n\n        $this->debug(\"Created phar at $dest\");\n        $this->endSection();\n    }\n\n    /**\n     * Creates a zip file containing the staged files of your project.\n     *\n     * Call this only after your staging directory is built.\n     *\n     * @param string $dest Where to save the zip file\n     */\n    public function createZip($dest)\n    {\n        $this->startSection('zip');\n        $this->debug(\"Creating a zip file at $dest\");\n        $this->createDirIfNeeded(dirname($dest));\n        chdir($this->stageDir);\n        $this->exec(\"zip -r $dest ./\");\n        $this->debug(\"  > Created at $dest\");\n        chdir(__DIR__);\n        $this->endSection();\n    }\n\n    private function createDirIfNeeded($dir)\n    {\n        if (!is_dir($dir) && !mkdir($dir, 0755, true)) {\n            throw new \\RuntimeException(\"Could not create dir: $dir\");\n        }\n    }\n}\n", "num_lines": 402}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\n/**\n * Adds and removes annotations to a class.\n *\n * @internal\n */\nclass ClassAnnotationUpdater\n{\n    use PhpFileLinterTrait;\n\n    /** @var ReflectionClass */\n    private $reflection;\n    /** @var string[] */\n    private $linesToAppend;\n    /** @var string */\n    private $defaultDocBlock;\n    /** @var string */\n    private $removeMatching;\n\n    public function __construct(\n        ReflectionClass $reflection,\n        array $linesToAppend,\n        $defaultDocBlock,\n        $removeMatching = ''\n    ) {\n        $this->reflection = $reflection;\n        $this->linesToAppend = $linesToAppend;\n        $this->defaultDocBlock = $defaultDocBlock;\n        $this->removeMatching = $removeMatching;\n    }\n\n    /**\n     * Performs update on class file and lints the output. If the output fails\n     * linting, the change is reverted.\n     *\n     * @return bool TRUE on success, FALSE on failure\n     */\n    public function update()\n    {\n        // copy the code into memory\n        $backup = file($this->reflection->getFileName());\n\n        list($preamble, $class) = $this->splitClassFile($backup);\n        $preamble = $this->stripOutExistingDocBlock($preamble);\n        $preamble .= $this->buildUpdatedDocBlock();\n\n        if ($this->writeClassFile(implode(PHP_EOL, [$preamble, $class]))\n            && $this->commandLineLint($this->reflection->getFileName())\n        ) {\n            return true;\n        }\n\n        $this->writeClassFile(implode('', $backup));\n        return false;\n    }\n\n    private function splitClassFile(array $lines)\n    {\n        $classLineOffset = $this->reflection->getStartLine() - 1;\n        return [\n            implode('', array_slice($lines, 0, $classLineOffset)),\n            implode('', array_slice($lines, $classLineOffset)),\n        ];\n    }\n\n    private function stripOutExistingDocBlock($preamble)\n    {\n        if ($this->reflection->getDocComment()) {\n            return str_replace(\n                $this->reflection->getDocComment() . PHP_EOL,\n                '',\n                $preamble\n            );\n        }\n\n        return $preamble;\n    }\n\n    private function buildUpdatedDocBlock()\n    {\n        $docBlockLines = explode(\n            PHP_EOL,\n            $this->reflection->getDocComment() ?: $this->defaultDocBlock\n        );\n\n        // remove lines matching exclusion patterns\n        if ($this->removeMatching) {\n            $docBlockLines = array_filter($docBlockLines, function ($line) {\n                return !preg_match($this->removeMatching, trim($line));\n            });\n        }\n\n        // hold on to the closing line\n        $lastLine = array_pop($docBlockLines);\n\n        // add a padding line if needed\n        if (' *' !== end($docBlockLines)) {\n            $docLines []= ' *';\n        }\n\n        // append API @method annotations\n        $docBlockLines = array_merge($docBlockLines, $this->linesToAppend);\n\n        // add back the closing line\n        $docBlockLines []= $lastLine;\n\n        // send everything back as a string\n        return implode(PHP_EOL, $docBlockLines);\n    }\n\n    private function writeClassFile($contents)\n    {\n        return (bool) file_put_contents(\n            $this->reflection->getFileName(),\n            $contents,\n            LOCK_EX\n        );\n    }\n}\n", "num_lines": 121}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nuse Aws\\Api\\ApiProvider;\n\nclass ClientAnnotator\n{\n    /** @var ReflectionClass */\n    private $reflection;\n    /** @var string */\n    private $endpoint;\n    /** @var string[] */\n    private $versions;\n    /** @var array */\n    private $methods;\n    /** @var array */\n    private $aliases;\n\n\n    public function __construct($clientClassName)\n    {\n        $this->reflection = new ReflectionClass($clientClassName);\n        $this->aliases = \\Aws\\load_compiled_json(__DIR__ . '/../src/data/aliases.json');\n    }\n\n    /**\n     * Adds @method annotations to a client class.\n     *\n     * @return bool TRUE on success, FALSE on failure\n     */\n    public function updateApiMethodAnnotations()\n    {\n        $updater = new ClassAnnotationUpdater(\n            $this->reflection,\n            $this->getMethodAnnotations(),\n            $this->getDefaultDocComment(),\n            '/^\\* @method (\\\\\\\\Aws\\\\\\\\Result|\\\\\\\\GuzzleHttp\\\\\\\\Promise\\\\\\\\Promise) /'\n        );\n\n        return $updater->update();\n    }\n\n    private function getMethodAnnotations()\n    {\n        $annotations = [];\n\n        foreach ($this->getMethods() as $command => $apiVersions) {\n            $commandMethods = [\n                $command => '\\\\Aws\\\\Result',\n                \"{$command}Async\" => '\\\\GuzzleHttp\\\\Promise\\\\Promise',\n            ];\n            foreach ($commandMethods as $method => $returnType) {\n                $annotations []= $this->getAnnotationLine(\n                    $method,\n                    $returnType,\n                    $apiVersions\n                );\n            }\n        }\n\n        return $annotations;\n    }\n\n    private function getAnnotationLine($method, $return, array $versionsWithSupport)\n    {\n        $signature = lcfirst($method) . '(array $args = [])';\n        $annotation = \" * @method $return $signature\";\n\n        if ($versionsWithSupport !== $this->getVersions()) {\n            $supportedIn = implode(', ', $versionsWithSupport);\n            $annotation .= \" (supported in versions $supportedIn)\";\n        }\n\n        return $annotation;\n    }\n\n    private function getMethods()\n    {\n        if (empty($this->methods)) {\n            $this->methods = [];\n\n            foreach ($this->getVersions() as $version) {\n                $methodsInVersion = array_keys(\n                    $this->getApiDefinition($version)['operations']\n                );\n\n                $api = $this->getApiDefinition($version);\n                $serviceId = !empty($api['metadata']['serviceId'])\n                    ? $api['metadata']['serviceId']\n                    : null;\n\n                foreach ($methodsInVersion as $method) {\n\n                    if (!empty($serviceId)\n                        && !empty($this->aliases['operations'][$serviceId][$version][$method])\n                    ) {\n                        $method = $this->aliases['operations'][$serviceId][$version][$method];\n                    }\n\n                    if (empty($this->methods[$method])) {\n                        $this->methods[$method] = [];\n                    }\n\n                    $this->methods[$method] []= $version;\n                }\n            }\n        }\n\n        return $this->methods;\n    }\n\n    private function getVersions()\n    {\n        if (empty($this->versions)) {\n            $this->versions = ApiProvider::defaultProvider()\n                ->getVersions($this->getEndpoint());\n\n            // ensure that versions are always iterated from oldest to newest\n            sort($this->versions);\n        }\n\n        return $this->versions;\n    }\n\n    private function getApiDefinition($version = 'latest')\n    {\n        $provider = ApiProvider::defaultProvider();\n        return $provider('api', $this->getEndpoint(), $version);\n    }\n\n    private function getEndpoint()\n    {\n        if (empty($this->endpoint)) {\n            $service = strtolower(\n                preg_replace('/(MultiRegion)?Client$/', '', $this->reflection->getShortName())\n            );\n\n            $this->endpoint = Aws\\manifest($service)['endpoint'];\n        }\n\n        return $this->endpoint;\n    }\n\n    private function getDefaultDocComment()\n    {\n        $serviceName = $this->getApiDefinition()['metadata']['serviceFullName'];\n        switch ($this->reflection->getParentClass()->getShortName()) {\n            case 'MultiRegionClient':\n                return <<<EODC\n/**\n * **{$serviceName}** multi-region client.\n *\n */\nEODC;\n            default:\n                return <<<EODC\n/**\n * **{$serviceName}** client.\n *\n */\nEODC;\n        }\n    }\n}\n", "num_lines": 164}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nrequire __DIR__ . '/../vendor/autoload.php';\n\n/**\n * Finds all JSON files in src/data, converts them to PHP files that return\n * arrays, and writes those files to $originalFileName.json.php.  Files for\n * endpoints v2 starting with endpoints- will get zipped.\n */\n$dataFilesIterator = \\Aws\\recursive_dir_iterator(realpath(__DIR__ . '/../src/data'));\nforeach (new RegexIterator($dataFilesIterator, '/\\.json$/') as $dataFile) {\n    (new JsonCompiler($dataFile))\n        ->compile(\"$dataFile.php\");\n}\n", "num_lines": 14}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nuse Aws\\Build\\Docs\\DocsBuilder;\n\n// Setup autoloading for SDK and build classes.\n$loader = require __DIR__ . '/../vendor/autoload.php';\n\n// Setup directories.\n$config = \\Nette\\Neon\\Neon::decode(file_get_contents(__DIR__ . '/docs/apigen.neon'));\n$outputDir = __DIR__ . '/../' . $config['destination'];\n$apiProvider = \\Aws\\Api\\ApiProvider::defaultProvider();\n\n// Extract the built homepage into a template file.\n$xml = new DOMDocument();\n@$xml->loadHTMLFile(__DIR__ . '/artifacts/docs/index.html');\n$ele = $xml->getElementById('content');\n$ele->nodeValue = '{{ contents }}';\n$template = str_replace('class=\"homepage\"', 'class=\"generated-page\"', $xml->saveHTML());\n\n$quickLinkServices = ['s3', 'dynamodb', 'glacier', 'ec2'];\n\n$sourceDirs = array_map(function ($dirRelativeToProjectRoot) {\n    return __DIR__ . '/../' . $dirRelativeToProjectRoot;\n}, is_array($config['source']) ? $config['source'] : [$config['source']]);\n$sourceFiles = [];\nforeach ($sourceDirs as $dir) {\n    $sourceFiles = array_merge(\n        $sourceFiles,\n        array_filter(\n            array_map('realpath', iterator_to_array(\\Aws\\recursive_dir_iterator($dir))),\n            function ($path) {\n                return preg_match('/(?<!\\.json)\\.php/', $path);\n            }\n        )\n    );\n}\n\n$issueLoggingEnabled = isset(getopt(\n    '',\n    array('issue-logging-enabled::')\n)['issue-logging-enabled']);\n\n// Generate API docs\n$builder = new DocsBuilder(\n    $apiProvider,\n    $outputDir,\n    $template,\n    $config['baseUrl'],\n    $quickLinkServices,\n    $sourceFiles,\n    $issueLoggingEnabled\n);\n$builder->build();\n", "num_lines": 53}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n/*\n * Creates a Github API release using the changelog contents. Attaches aws.zip\n * and aws.phar to the release.\n *\n * The OAUTH_TOKEN environment variable is required.\n *\n *     Usage: php gh-release.php X.Y.Z\n */\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse GuzzleHttp\\Psr7\\Uri;\nuse GuzzleHttp\\Psr7;\n\nconst MAX_ATTEMPTS = 3;\n\n$owner = 'aws';\n$repo = 'aws-sdk-php';\n$token = getenv('OAUTH_TOKEN') or die('An OAUTH_TOKEN environment variable is required');\nisset($argv[1]) or die('Usage php gh-release.php X.Y.Z');\n$tag = $argv[1];\n\n// Grab and validate the tag annotation\nchdir(dirname(__DIR__));\n$message = `chag contents -t \"$tag\"` or die('Chag could not find or parse the tag');\n\n// Add retry middleware\n$stack = \\GuzzleHttp\\HandlerStack::create();\n$stack->push(\\GuzzleHttp\\Middleware::retry(\n    function ($retries, $request, $response) {\n        $statusCode = $response->getStatusCode();\n        if ($retries < MAX_ATTEMPTS && !in_array($statusCode, [200, 201, 202])) {\n            echo \"Attempt failed with status code {$statusCode}: \"\n                . $response->getBody();\n            return true;\n        }\n        return false;\n    },\n    function ($retries) {\n        return 1000 * (1 + $retries);\n    }\n));\n\n// Create a GitHub client.\n$client = new GuzzleHttp\\Client([\n    'base_uri' => 'https://api.github.com/',\n    'headers' => ['Authorization' => \"token $token\"],\n    'handler' => $stack,\n]);\n\n// Create a Github client with no retry middleware, to allow for custom retry handling\n$uploadClient = new GuzzleHttp\\Client([\n    'base_uri' => 'https://api.github.com/',\n    'headers' => ['Authorization' => \"token $token\"]\n]);\n\n// Publish the release\n$response = $client->post(\"repos/${owner}/${repo}/releases\", [\n    'json' => [\n        'tag_name'   => $tag,\n        'name'       => \"Version {$tag}\",\n        'body'       => $message,\n    ]\n]);\n$releaseBody = json_decode($response->getBody(), true);\n\n// Grab the location of the new release\n$url = $response->getHeaderLine('Location');\necho \"Release successfully published to: $url\\n\";\n\n// Uploads go to uploads.github.com\n$uploadUrl = new Uri($url);\n$uploadUrl = $uploadUrl->withHost('uploads.github.com');\n\n// Upload aws.zip\n$zipAttempts = retryUpload($client, $uploadClient, $owner, $repo, $releaseBody, $uploadUrl, 'aws.zip');\nif ($zipAttempts === false) {\n    echo \"aws.zip upload failed after \" . MAX_ATTEMPTS . \" attempts.\\n\";\n} else {\n    echo \"aws.zip upload succeeded after {$zipAttempts} attempt(s).\\n\";\n}\n\n// Upload aws.phar\n$pharAttempts = retryUpload($client, $uploadClient, $owner, $repo, $releaseBody, $uploadUrl, 'aws.phar');\nif ($pharAttempts === false) {\n    echo \"aws.phar upload failed after \" . MAX_ATTEMPTS . \" attempts.\\n\";\n} else {\n    echo \"aws.phar upload succeeded after {$pharAttempts} attempt(s).\\n\";\n}\n\n/**\n * Attempts an artifact upload and retries up to MAX_ATTEMPTS times\n *\n * @param $client\n * @param $uploadClient\n * @param $owner\n * @param $repo\n * @param $releaseBody\n * @param $uploadUrl\n * @param $filename\n * @return bool|int\n */\nfunction retryUpload($client, $uploadClient, $owner, $repo, $releaseBody, $uploadUrl, $filename)\n{\n    $isSuccessful = false;\n    $attempts = 0;\n    $filetype = substr($filename, strpos($filename, '.') + 1);\n\n    while (!$isSuccessful && $attempts < MAX_ATTEMPTS) {\n        try {\n            $attempts++;\n            $response = $uploadClient->post(\"{$uploadUrl}/assets?name={$filename}\", [\n                'headers' => ['Content-Type' => \"application/{$filetype}\"],\n                'body'    => Psr7\\Utils::tryFopen(__DIR__ . \"/artifacts/{$filename}\", 'r')\n            ]);\n            echo \"{$filename} uploaded to: \" . json_decode($response->getBody(), true)['browser_download_url'] . \"\\n\";\n            $isSuccessful = true;\n        } catch (\\GuzzleHttp\\Exception\\ServerException $e) {\n            echo \"{$filename} failed to upload:\\n\";\n            var_dump($e->getMessage());\n\n            // Fetch and inspect assets for failed downloads\n            $response = $client->get(\"/repos/{$owner}/{$repo}/releases/{$releaseBody['id']}/assets\", []);\n            $assets = json_decode($response->getBody(), true);\n\n            foreach ($assets as $asset) {\n\n                // Only successful uploads have a state of 'uploaded'\n                if ($asset['state'] !== 'uploaded') {\n                    try {\n\n                        // Failed uploads leave behind a corrupted artifact that must be deleted\n                        $response = $uploadClient->delete(\"/repos/{$owner}/{$repo}/releases/assets/{$asset['id']}\", []);\n\n                        // Currently the successful 204 will trigger an exception due to response formatting,\n                        // but keeping this in case Github changes their API response\n                        if ($response->getStatusCode() == 204) {\n                            echo \"Failed upload of {$asset['name']} at {$asset['browser_download_url']} has successfully been deleted.\\n\";\n                        } else {\n                            echo \"Failed upload of {$asset['name']} at {$asset['browser_download_url']} was unable to be deleted.\\n\";\n                        }\n                    } catch (\\GuzzleHttp\\Exception\\ClientException $e) {\n\n                        // Currently expected to generate an exception every time, even for success\n                        $response = $e->getResponse();\n                        if ($response->getStatusCode() == 204) {\n                            echo \"Failed upload of {$asset['name']} at {$asset['browser_download_url']} has successfully been deleted.\\n\";\n                        } else {\n                            echo \"Failed upload of {$asset['name']} at {$asset['browser_download_url']} was unable to be deleted.\\n\";\n                            var_dump($e);\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    if ($isSuccessful) {\n        return $attempts;\n    }\n\n    return false;\n}\n", "num_lines": 165}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nclass JsonCompiler\n{\n    use PhpFileLinterTrait;\n\n    private static $tokensToReplace = [\n        '(' => '__OPEN_PARENTHESIS__',\n        ')' => '__CLOSE_PARENTHESIS__',\n    ];\n\n    /** @var string */\n    private $path;\n\n    public function __construct($path)\n    {\n        if (!file_exists($path)) {\n            throw new InvalidArgumentException(\"No JSON file found at $path\");\n        }\n\n        $this->path = realpath($path);\n    }\n\n    public function compile($outputPath)\n    {\n        $backup = $this->readPhpFile($outputPath);\n\n        $this->writeFile($outputPath, $this->getTranspiledPhp());\n        if (!$this->lintFile($outputPath)) {\n            $this->writeFile($outputPath, $backup);\n            trigger_error(\n                \"Unable to compile {$this->path} to valid PHP\",\n                E_USER_WARNING\n            );\n        }\n    }\n\n    private function getTranspiledPhp()\n    {\n        // Use var_export as a starting point.\n        $code = var_export($this->getDecodedData(), true);\n\n        // Convert \"array()\" to \"[]\".\n        $code = str_replace('array (', '[', $code);\n        $code = str_replace(')', ']', $code);\n\n        // Removing trailing whitespace.\n        $code = preg_replace('/\\s+$/m', '', $code);\n\n        // Move arrays to the same line.\n        $code = preg_replace('/=>\\s*\\n\\s*\\[/', '=> [', $code);\n\n        // Get rid of numbered array indexes.\n        $code = preg_replace('/(\\s*)(\\d+ => )/', '$1', $code);\n\n        // Make empty arrays span only a single line.\n        $code = preg_replace('/=>\\s*\\[\\n\\s*\\]/', '=> []', $code);\n\n        // Minify the PHP file\n        $code = preg_replace('/\\s+/', ' ', str_replace(\"\\n\", '', $code));\n\n        $originalPath = preg_replace('/^.+?(?=\\/src\\/data\\/)/', '', $this->path);\n\n        return <<<EOPHP\n<?php\n// This file was auto-generated from sdk-root$originalPath\nreturn $code;\n\nEOPHP;\n    }\n\n    private function getDecodedData()\n    {\n        return json_decode(\n            strtr(file_get_contents($this->path), self::$tokensToReplace),\n            true\n        );\n    }\n\n    private function readPhpFile($path)\n    {\n        return file_exists($path) ?\n            file_get_contents($path)\n            : '<?php return [];';\n    }\n\n    private function writeFile($path, $contents)\n    {\n        return file_put_contents(\n            $path,\n            strtr($contents, array_flip(self::$tokensToReplace)),\n            LOCK_EX\n        );\n    }\n}\n", "num_lines": 96}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nrequire __DIR__  . '/../vendor/autoload.php';\n\nfunction generateDocblock(array $args)\n{\n    foreach ($args as $name => $value) {\n        if (!isset($value['doc']) || !empty($value['internal'])) {\n            continue;\n        }\n\n        $docs = $value['doc'];\n        $modifiers = [];\n\n        if (isset($value['valid'])) {\n            $modifiers[] = implode('|', $value['valid']);\n        }\n\n        if (!empty($value['required'])) {\n            $modifiers[] = 'required';\n        }\n\n        if (isset($value['default']) && !is_callable($value['default'])) {\n            $modifiers[] = 'default=' . \\Aws\\describe_type($value['default']);\n        }\n\n        if ($modifiers) {\n            $docs = '(' . implode(', ', $modifiers) . ') ' . $docs;\n        }\n\n        $docs = '* - ' . $name . ': ' . $docs;\n        echo wordwrap($docs, 70, \"\\n*   \") . \"\\n\";\n    }\n}\n\n$clientName = isset($argv[1]) ? $argv[1] : 'Aws\\AwsClient';\n$args = call_user_func([$clientName, 'getArguments']);\nksort($args);\n\n$type = isset($argv[2]) ? $argv[2] : 'docblock';\n\nswitch ($type) {\n    case 'docblock':\n        generateDocblock($args);\n        break;\n    default:\n        die('Unknown type: ' . $type);\n}\n", "num_lines": 48}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nrequire __DIR__ . '/../vendor/autoload.php';\n\n$stageDirectory = __DIR__ . '/artifacts/staging';\n$projectRoot = __DIR__ . '/../';\n$burgomaster = new \\Burgomaster($stageDirectory, $projectRoot);\n$autoloaderFilename = 'aws-autoloader.php';\n\n$metaFiles = ['README.md', 'LICENSE', 'NOTICE', 'CHANGELOG.md'];\nforeach ($metaFiles as $file) {\n    $burgomaster->deepCopy($file, $file);\n}\n\n$sdkFiles = new \\RecursiveIteratorIterator(\n    new \\RecursiveDirectoryIterator(realpath('src'))\n);\n$sdkFiles = new CallbackFilterIterator($sdkFiles, function (SplFileInfo $file) {\n    return !in_array($file->getBasename('.php'), [\n        'docs-2.json',\n        'examples-1.json',\n    ]);\n});\n\n$burgomaster->recursiveCopy('src', 'Aws', ['php', 'php.gz'], $sdkFiles);\n$burgomaster->recursiveCopy('vendor/aws/aws-php-sns-message-validator/src', 'Aws/Sns');\n$burgomaster->recursiveCopy('vendor/mtdowling/jmespath.php/src', 'JmesPath');\n$burgomaster->recursiveCopy('vendor/guzzlehttp/guzzle/src', 'GuzzleHttp');\n$burgomaster->recursiveCopy('vendor/guzzlehttp/psr7/src', 'GuzzleHttp/Psr7');\n$burgomaster->recursiveCopy('vendor/guzzlehttp/promises/src', 'GuzzleHttp/Promise');\n$burgomaster->recursiveCopy('vendor/psr/http-message/src', 'Psr/Http/Message');\n\n$autoloaderContents = [\n    'Aws/functions.php',\n    'GuzzleHttp/functions_include.php',\n    'GuzzleHttp/Psr7/functions_include.php',\n    'GuzzleHttp/Promise/functions_include.php',\n    'JmesPath/JmesPath.php',\n];\n\nif (file_exists($projectRoot . 'vendor/symfony/polyfill-intl-idn')) {\n    $burgomaster->recursiveCopy($projectRoot . 'vendor/symfony/polyfill-intl-idn', 'Symfony/Polyfill/Intl/Idn');\n    array_push($autoloaderContents, 'Symfony/Polyfill/Intl/Idn/bootstrap.php');\n}\n\nif (file_exists($projectRoot . 'vendor/psr/http-client/src')) {\n    $burgomaster->recursiveCopy($projectRoot . 'vendor/psr/http-client/src', 'Psr/Http/Client');\n}\n\n$burgomaster->createAutoloader($autoloaderContents, $autoloaderFilename);\n\n$burgomaster->createZip(__DIR__ . \"/artifacts/aws.zip\");\n$burgomaster->createPhar(\n    __DIR__ . \"/artifacts/aws.phar\",\n    null,\n    $autoloaderFilename,\n    'aws-' . \\Aws\\Sdk::VERSION . '.phar'\n);\n\n$burgomaster->startSection('test-phar');\n$burgomaster->exec('php ' . __DIR__ . '/test-phar.php');\n$burgomaster->endSection();\n", "num_lines": 62}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "#!/usr/bin/env php\n<?php\n\nrequire __DIR__ . '/artifacts/aws.phar';\nrequire __DIR__ . '/artifacts/phpunit.phar';\nrequire __DIR__ . '/artifacts/behat.phar';\n", "num_lines": 7}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\n/**\n * A trait that provides a method for linting a PHP file. It will use\n * `opcache_compile` if available and fall back to shelling out to `php -l`\n * otherwise.\n *\n * @internal\n */\ntrait PhpFileLinterTrait\n{\n    /**\n     * @param string $path\n     *\n     * @return bool\n     */\n    private function lintFile($path)\n    {\n        static $linter;\n\n        if (empty($linter)) {\n            $linter = function_exists('opcache_get_status')\n                && !empty(opcache_get_status(false)['opcache_enabled'])\n                    ? [$this, 'opcacheLint']\n                    : [$this, 'commandLineLint'];\n        }\n\n        return call_user_func($linter, $path);\n    }\n\n    /**\n     * @param string $path\n     *\n     * @return bool\n     */\n    private function commandLineLint($path)\n    {\n        list($output, $exitCode) = [[], 1];\n        exec(\"php -l $path\", $output, $exitCode);\n\n        return 0 === $exitCode;\n    }\n\n    /**\n     * Uses the Zend OPCache control functions to perform an in-process\n     * validation of a file. This function will fail on code that declares new\n     * symbols (e.g., classes or functions) if they have already been loaded\n     * into the current process.\n     *\n     * @param string $path\n     *\n     * @return bool\n     */\n    private function opcacheLint($path)\n    {\n        opcache_invalidate($path, true);\n\n        return @opcache_compile_file($path);\n    }\n}\n", "num_lines": 61}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nclass ServiceBuilder\n{\n    private $namespace;\n    private $model;\n    private $clientPath;\n    private $exceptionPath;\n\n    public function __construct(\n        $namespace,\n        array $model,\n        $clientPath,\n        $exceptionPath\n    ) {\n        $this->namespace = $namespace;\n        $this->model = $model;\n        $this->clientPath = $clientPath;\n        $this->exceptionPath = $exceptionPath;\n    }\n\n    public function buildClient()\n    {\n        return $this->buildFileIfMissing('Client');\n    }\n\n    public function buildException()\n    {\n        return $this->buildFileIfMissing('Exception');\n    }\n\n    private function buildFileIfMissing($fileType)\n    {\n        $property = lcfirst($fileType) . 'Path';\n        $method = 'generateDefault' . $fileType;\n        if (!file_exists($this->{$property})) {\n            if (!is_dir(dirname($this->{$property}))) {\n                mkdir(dirname($this->{$property}), 0755, true);\n            }\n\n            file_put_contents($this->{$property}, $this->{$method}(), LOCK_EX);\n        }\n\n        return $this;\n    }\n\n    private function getFullName()\n    {\n        return $this->model['metadata']['serviceFullName'];\n    }\n\n    private function generateDefaultClient()\n    {\n        return <<<EOPHP\n<?php\nnamespace Aws\\\\{$this->namespace};\n\nuse Aws\\\\AwsClient;\n\n/**\n * This client is used to interact with the **{$this->getFullName()}** service.\n */\nclass {$this->namespace}Client extends AwsClient {}\n\nEOPHP;\n    }\n\n    private function generateDefaultException()\n    {\n        return <<<EOPHP\n<?php\nnamespace Aws\\\\{$this->namespace}\\\\Exception;\n\nuse Aws\\\\Exception\\\\AwsException;\n\n/**\n * Represents an error interacting with the **{$this->getFullName()}** service.\n */\nclass {$this->namespace}Exception extends AwsException {}\n\nEOPHP;\n    }\n}\n", "num_lines": 84}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nrequire __DIR__ . '/artifacts/aws.phar';\n\n$conf = [\n    'credentials' => ['key' => 'foo', 'secret' => 'bar'],\n    'region'      => 'us-west-2',\n    'version'     => 'latest'\n];\n\n// Ensure that a client can be created.\n$s3 = new Aws\\S3\\S3Client($conf);\n// Ensure that waiters can be found.\n$s3->getPaginator('ListObjects');\n\n// Legacy factory instantiation.\nAws\\DynamoDb\\DynamoDbClient::factory($conf);\n\n// JMESPath autoloader\n\\JmesPath\\search('foo', ['foo' => 'bar']);\n\n// React autoloader\n$checks = [\n    'GuzzleHttp\\\\Psr7\\\\stream_for',\n    'GuzzleHttp\\\\Promise\\\\inspect',\n    'JmesPath\\\\search',\n    'Aws\\\\dir_iterator',\n];\n\nforeach ($checks as $check) {\n    if (!function_exists($check)) {\n        echo $check . ' not found';\n        exit(1);\n    }\n}\n\necho 'Version=' . Aws\\Sdk::VERSION;\n", "num_lines": 37}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nrequire __DIR__ . '/ChangelogBuilder.php';\n\nuse Aws\\Build\\Changelog\\ChangelogBuilder;\n\n$params = [];\n\n$options = getopt('v');\n\n$params['verbose'] = isset($option['v']) ? $option['v'] : true;\n\n$changelogBuilder = new ChangelogBuilder($params);\n\n$changelogBuilder->buildChangelog();\n\n$changelogBuilder->fixEndpointFile();\n\n$changelogBuilder->cleanNextReleaseFolder();\n", "num_lines": 20}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Build\\Changelog;\n\n/**\n * @internal\n */\nclass ChangelogBuilder\n{\n    /** @var boolean */\n    private $verbose;\n\n    /** @var string */\n    private $releaseNotesOutputDir;\n\n    /** @var string */\n    private $baseDir;\n\n    /** @var boolean */\n    private $newServiceFlag = false;\n\n    const CHANGELOG_FEATURE = 'feature';\n    const CHANGELOG_API_CHANGE = 'api-change';\n    const CHANGELOG_ENHANCEMENT = 'enhancement';\n    const CHANGELOG_BUGFIX = 'bugfix';\n    const CHANGELOG_DOCUMENTATION = 'documentation';\n\n    /**\n     *  The constructor requires following configure parameters:\n     * - base_dir: (String) Path to the base directory where the `.changes` folder is located. Default is empty string.\n     * - release_notes_output_dir: (String) Path to `.changes` folder where new release json will be put and content of\n     *                              `nextrelease` folder will be deleted\n     * - verbose: (Boolean) Flag to enable(true)/disable(false) verbose mode\n     */\n    public function __construct(array $params)\n    {\n        $this->baseDir = isset($params['base_dir']) ? $params['base_dir'] : '';\n        $this->releaseNotesOutputDir = isset($params['release_notes_output_dir'])\n            ? $params['release_notes_output_dir']\n            : '';\n        $this->verbose = isset($params['verbose']) ? $params['verbose'] : false;\n    }\n\n    public function isNewService()\n    {\n        return $this->newServiceFlag;\n    }\n\n    private function readChangelog()\n    {\n        $releaseDir = $this->baseDir . '.changes/nextrelease/';\n        $changelogEntries = [];\n        if (!is_dir($releaseDir) || !$dh = opendir($releaseDir)) {\n            throw new \\InvalidArgumentException(\n                \"nextrelease directory doesn't exists or is not readable at location $releaseDir\"\n            );\n        }\n        //Ignore any files starting with a (.) dot\n        $files = preg_grep('/^([^.])/', scandir($releaseDir));\n        if (empty($files)) {\n            throw new \\InvalidArgumentException(\"No release notes files found in $releaseDir folder\");\n        }\n        foreach ($files as $file) {\n            $str = file_get_contents($releaseDir . $file);\n            $changelogEntries = array_merge($changelogEntries, $this->cleanJSON(json_decode($str)));\n        }\n        closedir($dh);\n\n        $this->newServiceFlag = count(array_filter($changelogEntries, function ($change) {\n                return $change->type === self::CHANGELOG_FEATURE;\n            })) > 0;\n\n        return $changelogEntries;\n    }\n\n    private function cleanJSON($arr)\n    {\n        if (empty($arr) || !is_array($arr)) {\n            throw new \\RuntimeException('Invalid Input', 2);\n        }\n\n        return $arr;\n    }\n\n    private function createTag($changelogFile)\n    {\n        if (!file_exists($changelogFile)) {\n            throw new \\RuntimeException('Changelog File Not Found', 2);\n        }\n        $lines = file($changelogFile);\n        $tag = explode(\".\", explode(\" \", $lines[2])[1]);\n        if ($tag[0] == 'next') {\n            throw new \\InvalidArgumentException('Untagged changes exits in CHANGELOG.md', 1);\n        }\n        if ($this->newServiceFlag) {\n            //Minor Version Bump if a newservice is being released\n            ++$tag[1];\n            $tag[2] = 0;\n        } else {\n            ++$tag[2];\n        }\n\n        return implode(\".\", $tag);\n    }\n\n    private function createChangelogJson($changelog, $tag)\n    {\n        $fp = fopen($this->releaseNotesOutputDir . \".changes/\" . $tag, 'w');\n        fwrite($fp, json_encode($changelog, JSON_PRETTY_PRINT) . PHP_EOL);\n        fclose($fp);\n    }\n\n    private function writeToChangelog($changelog, $changelogFile)\n    {\n        if (!file_exists($changelogFile)) {\n            throw new \\InvalidArgumentException('Changelog File Not Found', 2);\n        }\n        $newChangeLog = \"## next release\\n\\n\" . $changelog . \"\\n\";\n        $lines = file($changelogFile);\n        $lines[2] = $newChangeLog . $lines[2];\n        file_put_contents($changelogFile, $lines);\n    }\n\n    public function cleanNextReleaseFolder()\n    {\n        $nextReleaseDir = $this->baseDir . '.changes/nextrelease/';\n        $files = preg_grep('/^([^.])/', scandir($nextReleaseDir));\n        foreach ($files as $file) {\n            if (is_file($nextReleaseDir . $file)) {\n                unlink($nextReleaseDir . $file);\n            }\n        }\n    }\n\n    private function generateChangelogString($changelog)\n    {\n        usort($changelog, function ($a, $b) {\n            return strcmp($a->category, $b->category);\n        });\n        $str = \"\";\n        foreach ($changelog as $log) {\n            $str .= \"* `Aws\\\\\" . $log->category . \"` - \" . $log->description . \"\\n\";\n        }\n        return $str;\n    }\n\n    public function buildChangelog()\n    {\n        $changelogFile = $this->baseDir . 'CHANGELOG.md';\n        $newChangelog = $this->readChangelog();\n        $tag = $this->createTag($changelogFile);\n        putenv(\"TAG=$tag\");\n        if ($this->verbose) {\n            echo 'Tag for next release ' . $tag . \"\\n\";\n        }\n        $this->createChangelogJson($newChangelog, $tag);\n        $ChangelogUpdate = $this->generateChangelogString($newChangelog);\n        if ($this->verbose) {\n            echo \"$ChangelogUpdate\";\n        }\n        $this->writeToChangelog($ChangelogUpdate, $this->releaseNotesOutputDir . 'CHANGELOG.md');\n    }\n}\n", "num_lines": 163}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Build\\Docs;\n\nuse Aws\\Api\\ListShape;\nuse Aws\\Api\\MapShape;\nuse Aws\\Api\\Service as SdkService;\nuse Aws\\Api\\Shape;\nuse Aws\\Api\\StructureShape;\n\n/**\n * @internal\n */\nclass CodeSnippetGenerator\n{\n    /** @var SdkService */\n    private $service;\n\n    /** @var bool[][] */\n    private $issues = [];\n\n    public function __construct(SdkService $service)\n    {\n        $this->service = $service;\n    }\n\n    private function logIssue($shapeName, $message, $level=E_WARNING)\n    {\n        if (!isset($this->issues[$shapeName])) {\n            $this->issues[$shapeName] = [];\n        }\n\n        if (!isset($this->issues[$shapeName][$message])) {\n            $this->issues[$shapeName][$level][$message] = true;\n        }\n    }\n\n    public function getIssues()\n    {\n        return $this->issues;\n    }\n\n    public function generateInput($operation, $params, $comments)\n    {\n        $messageShape = $this->service->getOperation($operation)->getInput();\n        $code = $this->visit($messageShape, $params, '', [], $comments);\n\n        return \"\\$result = \\$client->\" . lcfirst($operation) . \"($code);\";\n    }\n\n    public function generateOutput($operation, $params, $comments)\n    {\n        $messageShape = $this->service->getOperation($operation)->getOutput();\n        return $this->visit($messageShape, $params, '', [], $comments);\n    }\n\n    public function __invoke($operation, $params, $comments, $isInput = true)\n    {\n        return $isInput\n            ? $this->generateInput($operation, $params, $comments)\n            : $this->generateOutput($operation, $params, $comments);\n    }\n\n    private static function isTraversableShapeValue($value) {\n        return is_array($value) || $value instanceof \\Traversable;\n    }\n\n    private function visit(Shape $shape, $value, $indent, $path, $comments)\n    {\n        switch ($shape['type']) {\n            case 'structure':\n                return $this->structure($shape, $value, $indent, $path, $comments);\n            case 'list':\n                return $this->arr($shape, $value, $indent, $path, $comments);\n            case 'map':\n                return $this->map($shape, $value, $indent, $path, $comments);\n            case 'string':\n                if (self::isTraversableShapeValue($value)) {\n                    $this->logIssue($shape->getName(), 'Invalid Conversion To String');\n                }\n                return \"'{$value}'\";\n            case 'timestamp':\n                return \"<DateTimeInterface>\";\n            case 'blob':\n                return \"&lt;BLOB&gt;\";\n            default:\n                return $value;\n        }\n    }\n\n    private function structure(StructureShape $shape, $value, $indent, $path, $comments)\n    {\n        if (!self::isTraversableShapeValue($value)) {\n            $this->logIssue($shape->getName(), 'Invalid Conversion to Structure');\n        }\n\n        $lines = ['['];\n        foreach ($value as $key => $val) {\n            $path[] = \".{$key}\";\n            $comment = $this->getCommentFor($path, $comments);\n            try {\n                $shapeVal = $this->visit($shape->getMember($key), $val, \"{$indent}    \", $path, $comments);\n            } catch (\\InvalidArgumentException $e) {\n                $this->logIssue($shape->getName(), 'Example Shape Discrepancy');\n                break;\n            }\n            $lines[] = rtrim(\"{$indent}    '{$key}' => {$shapeVal}, {$comment}\");\n            array_pop($path);\n        }\n        $lines[] = \"{$indent}]\";\n        return implode(\"\\n\", $lines);\n    }\n\n    private function arr(ListShape $shape, $value, $indent, $path, $comments)\n    {\n        if (!self::isTraversableShapeValue($value)) {\n            $this->logIssue($shape->getName(), 'Invalid Conversion to Array');\n        }\n\n        $lines = ['['];\n        foreach ($value as $ind => $val) {\n            $path[] = \"[{ind}]\";\n            $comment = $this->getCommentFor($path, $comments);\n            $shapeVal = $this->visit($shape->getMember(), $val, \"{$indent}    \", $path, $comments);\n            $lines[] = rtrim(\"{$indent}    {$shapeVal}, {$comment}\");\n            array_pop($path);\n        }\n        $lines[] = \"{$indent}]\";\n\n        return implode(\"\\n\", $lines);\n    }\n\n    private function map(MapShape $shape, $value, $indent, $path, $comments)\n    {\n        if (!self::isTraversableShapeValue($value)) {\n            $this->logIssue($shape->getName(), 'Invalid Conversion to Map');\n        }\n\n        $lines = ['['];\n        foreach ($value as $key => $val) {\n            $path[] = \".{$key}\";\n            $comment = $this->getCommentFor($path, $comments);\n            $shapeVal = $this->visit($shape->getValue(), $val, \"{$indent}    \", $path, $comments);\n            $lines[] = rtrim(\"{$indent}    '{$key}' => {$shapeVal}, {$comment}\");\n            array_pop($path);\n        }\n        $lines[] = \"{$indent}]\";\n\n        return implode(\"\\n\", $lines);\n    }\n\n    private function getCommentFor($path, $comments)\n    {\n        $key = preg_replace('/^\\./', '', implode('', $path));\n        if (isset($comments[$key])) {\n            return '// ' . $comments[$key];\n        }\n\n        return '';\n    }\n}\n", "num_lines": 161}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Build\\Docs;\n\nuse Aws\\Api\\AbstractModel;\nuse Aws\\Api\\ApiProvider;\nuse Aws\\Api\\ListShape;\nuse Aws\\Api\\MapShape;\nuse Aws\\Api\\Operation;\nuse Aws\\Api\\Service as Api;\nuse Aws\\Api\\StructureShape;\nuse Aws\\Api\\DocModel;\nuse TokenReflection\\Broker;\nuse TokenReflection\\ReflectionBase;\nuse TokenReflection\\ReflectionFunction;\nuse TokenReflection\\ReflectionMethod;\n\n/**\n * Builds documentation for a given service.\n *\n * @internal\n */\nclass DocsBuilder\n{\n    /** @var string HTML template to replace {{ contents }} */\n    private $template;\n\n    /** @var string */\n    private $outputDir;\n\n    /** @var ApiProvider */\n    private $apiProvider;\n\n    /** @var \\SplObjectStorage Hash of members to skip when generating shape docs. */\n    private $skipMembers;\n\n    /** @var string */\n    private $baseUrl;\n\n    /** @var string[] */\n    private $quickLinks;\n\n    /** @var string[] */\n    private $sources;\n\n    /** @var bool[][][] */\n    private $issues = [];\n\n    /** @var bool Enables writing of build-issues.log file when set. */\n    private $issueLoggingEnabled;\n\n    /** @var array Printable error names for build-issues.log file */\n    private static $ERROR_PRINT_NAMES =[\n        E_ERROR              => 'Error',\n        E_WARNING            => 'Warning',\n        E_PARSE              => 'Parse Error',\n        E_NOTICE             => 'Notice',\n        E_CORE_ERROR         => 'Core Error',\n        E_CORE_WARNING       => 'Core Warning',\n        E_COMPILE_ERROR      => 'Compile Error',\n        E_COMPILE_WARNING    => 'Compile Warning',\n        E_USER_ERROR         => 'User Error',\n        E_USER_WARNING       => 'User Warning',\n        E_USER_NOTICE        => 'User Notice',\n        E_STRICT             => 'Strict Notice',\n        E_RECOVERABLE_ERROR  => 'Recoverable Error'\n    ];\n\n    public function __construct(\n        ApiProvider $provider,\n        $outputDir,\n        $template,\n        $baseUrl,\n        array $quickLinks,\n        array $sources,\n        $issueLoggingEnabled = false\n    ) {\n        $this->apiProvider = $provider;\n        $this->outputDir = $outputDir;\n        $this->template = $template;\n        $this->baseUrl = $baseUrl;\n        $this->quickLinks = $quickLinks;\n        $this->sources = $sources;\n        $this->issueLoggingEnabled = $issueLoggingEnabled;\n    }\n\n    public function build()\n    {\n        $this->skipMembers = new \\SplObjectStorage();\n        fwrite(STDOUT, \"Parsing available service API versions...\\n\");\n        // Collect versions\n        $services = [];\n        $aliases = [];\n\n        foreach ($this->gatherServiceVersions() as $name => $data) {\n            // Skip \"latest\"\n            unset($data['versions']['latest']);\n            $ns = $data['namespace'];\n            foreach ($data['versions'] as $alias => $version) {\n                list($api, $docModel) = call_user_func(\n                    \"Aws\\\\{$ns}\\\\{$ns}Client::applyDocFilters\",\n                    ApiProvider::resolve($this->apiProvider, 'api', $name, $version),\n                    ApiProvider::resolve($this->apiProvider, 'docs', $name, $version)\n                );\n                $service = new Service($api, $docModel);\n                $title = isset($service->shortTitle) && $service->shortTitle !== ''\n                    ? $service->shortTitle\n                    : $service->title;\n\n                if (isset($services[$title][$version])) {\n                    if (empty($aliases[$title][$version])) {\n                        $aliases[$title][$version] = [];\n                    }\n                    $aliases[$title][$version] []= $alias;\n                    continue;\n                }\n                $examples = $this->loadExamples($name, $version);\n                if (method_exists(\"Aws\\\\{$ns}\\\\{$ns}Client\", 'addDocExamples')) {\n                    $examples = call_user_func(\n                        \"Aws\\\\{$ns}\\\\{$ns}Client::addDocExamples\",\n                        $examples\n                    );\n                }\n                $this->renderService($service, $examples);\n                $services[$title][$version] = $service;\n            }\n        }\n\n        uasort($services, function($a, $b) {\n            $serviceA = current($a);\n            $serviceB = current($b);\n            return strcasecmp($serviceA->namespace, $serviceB->namespace);\n        });\n        $this->updateHomepage($services);\n        $this->updateClients($services);\n        $this->updateExceptions($services);\n        $this->updateAliases($services, $aliases);\n        $this->updateSitemap();\n        $this->updateSearch($services);\n        if ($this->issueLoggingEnabled) {\n            $this->updateIssues();\n        }\n    }\n\n    private function updateHomepage(array $services)\n    {\n        $this->updateServiceTable($services);\n        $this->updateQuickLinks($services);\n    }\n\n    private function updateServiceTable(array $services)\n    {\n        fwrite(STDOUT, \"Building homepage service table\\n\");\n        // Build up the list of services for the homepage.\n        $servicesTable = '';\n\n        foreach ($services as $versions) {\n            krsort($versions);\n            $service = reset($versions);\n            $servicesTable .= \"<tr><td><a href=\\\"{$service->serviceLink}\\\">{$service->title}</a></td>\";\n            $servicesTable .= \"<td><a href=\\\"{$service->clientLink}\\\">{$service->client}</a></td>\";\n            $servicesTable .= \"<td><ul class=\\\"list-unstyled\\\">\";\n            $latest = count($versions) > 1 ? ' (latest)' : '';\n            foreach ($versions as $sv) {\n                $servicesTable .= \"<li><a href=\\\"{$sv->serviceLink}\\\">{$sv->version} {$latest}</a></li>\";\n                $latest = '';\n            }\n            $servicesTable .= \"</ul></td></tr>\";\n        }\n\n        $this->replaceInner('index', $servicesTable, ':services:');\n    }\n\n    private function updateQuickLinks(array $services)\n    {\n        fwrite(STDOUT, \"Updating homepage quick links\\n\");\n\n        // Determine which services in the provided array should have a quick link\n        $services = array_filter($services, function (array $versions) {\n            return 0 < count(array_filter($versions, function (Service $service) {\n                return in_array($service->name, $this->quickLinks);\n            }));\n        });\n\n        // Drop all but the latest version of each service from the array\n        $services = array_map(function (array $versions) {\n            return array_shift($versions);\n        }, $services);\n\n        $serviceMap = [];\n        foreach ($services as $service) {\n            $isOlderVersion = isset($serviceMap[$service->name]) &&\n                $service->version < $serviceMap[$service->name]->version;\n            if ($isOlderVersion) {\n                continue;\n            }\n            $serviceMap[$service->name] = $service;\n        }\n        $services = array_values($serviceMap);\n\n        // Sort the services in the order provided in the config\n        usort($services, function (Service $a, Service $b) {\n            return array_search($a->name, $this->quickLinks)\n                - array_search($b->name, $this->quickLinks);\n        });\n\n        // Build up the quick links for the home page\n        $quickLinks = '';\n        foreach ($services as $service) {\n            $title = $service->shortTitle ?: $service->title;\n            $quickLinks .= <<<EOT\n<div class=\"col-md-3\">\n    <a class=\"btn btn-default btn-lg btn-block lead\" href=\"{$service->serviceLink}\" role=\"button\">\n        <span class=\"awsicon awsicon-{$service->name}\"></span> {$title}\n    </a>\n</div>\n\nEOT;\n        }\n\n        $this->replaceInner('index', $quickLinks, ':quickLinks:');\n    }\n\n    private function updateIssues()\n    {\n        $text = '';\n        foreach ($this->issues as $level=>$levelIssues) {\n            foreach ($levelIssues as $serviceName => $versions) {\n                foreach ($versions as $serviceVersion => $messages) {\n                    foreach (array_keys($messages) as $message) {\n                        if (!empty($text)) {\n                            $text .= PHP_EOL;\n                        }\n                        $levelName = isset(DocsBuilder::$ERROR_PRINT_NAMES[$level])\n                            ? DocsBuilder::$ERROR_PRINT_NAMES[$level]\n                            : 'Unknown';\n\n                        $text .= '[' . date(\"Y-m-d H:i:s (T)\") . '] '\n                            . '[' . $levelName . '] '\n                            . $serviceName . '-' . $serviceVersion\n                            . ': ' . $message;\n                    }\n                }\n            }\n        }\n\n        return (bool) file_put_contents(\"{$this->outputDir}/build-issues.log\", $text);\n    }\n\n    private function renderService(Service $service, $examples)\n    {\n        $html = new HtmlDocument;\n        $html->open('div', 'page-header');\n        $html->elem('h1', null, \"$service->title <small>{$service->version}</small>\");\n        $html->close();\n        $metadata = <<<EOT\n<dd><strong>Client:</strong> <a href=\"{$service->clientLink}\">{$service->client}</a></dd>\n<dd><strong>Service ID:</strong> {$service->name}</dd>\n<dd><strong>Version:</strong> {$service->version}</dd>\nEOT;\n        $html->elem('dl', 'tree well', $metadata);\n        $desc = <<<EOT\nThis page describes the parameters and results for the operations of the\n{$service->fullTitle}, and shows how to use the <a href=\"{$service->clientLink}\">{$service->client}</a>\nobject to call the described operations. This documentation is specific to the\n{$service->version} API version of the service.\nEOT;\n        $html->elem('p', null, $desc);\n        $html->elem('h2', null, 'Operation Summary');\n        $desc = <<<EOT\nEach of the following operations can be created from a client using\n<code>\\$client-&gt;getCommand('CommandName')</code>, where \"CommandName\" is the\nname of one of the following operations. Note: a command is a value that\nencapsulates an operation and the parameters used to create an HTTP request.\nEOT;\n        $html->elem('p', null, $desc);\n        $desc = <<<EOT\nYou can also create and send a command immediately using the magic methods\navailable on a client object: <code>\\$client-&gt;commandName(/* parameters */)</code>.\nYou can send the command asynchronously (returning a promise) by appending the\nword \"Async\" to the operation name: <code>\\$client-&gt;commandNameAsync(/* parameters */)</code>.\nEOT;\n        $html->elem('p', null, $desc);\n        $html->append($this->createHtmlForToc($service, $service->api->getOperations()));\n\n        $this->createHtmlForPaginators($html, $service->api);\n        $this->createHtmlForWaiters($html, $service->api);\n\n        $html->section(2, 'Operations');\n        foreach ($service->api->getOperations() as $opName => $operation) {\n            $html->append($this->createHtmlForOperation(\n                $service,\n                $opName,\n                $operation,\n                isset($examples[$opName]) ? $examples[$opName] : []\n            ));\n        }\n\n        $html->section(2, 'Shapes');\n        $map = $service->api->getShapeMap();\n        $keys = array_keys($service->api['shapes']);\n        sort($keys);\n        foreach ($keys as $name) {\n            $shape = $map->resolve(['shape' => $name]);\n            // Do not render top-level input or output shapes.\n            if ($shape['type'] == 'structure'\n                && !isset($this->skipMembers[$shape])\n            ) {\n                $html->section(3, $name, 'shape', 'method-title');\n                $html->append($this->renderShape($service->docs, $shape));\n            }\n        }\n\n        $this->writeThemeFile($service->serviceLink, $html->render());\n    }\n\n    private function createHtmlForToc(Service $service, array $operations)\n    {\n        $html = new HtmlDocument();\n        $html->open('ul', 'methods-summary');\n        foreach ($operations as $opName => $operation) {\n            $item = '<a class=\"method-summary-link\" href=\"#' . $html->slug($opName)\n                . '\"><strong>' . \"{$opName}</strong> ( array \\$params = [] )</a>\";\n\n            if ($description = $service->docs->getOperationDocs($opName)) {\n                $shortened = strip_tags($description);\n                $shortened = strpos($shortened, '.') === false\n                    ? $shortened\n                    : substr($shortened, 0, strpos($shortened, '.') + 1);\n                $item .= '<div class=\"summary-info\"><p>' . $shortened . '</p></div>';\n            }\n\n            $html->elem('li', null, $item);\n        }\n        $html->close();\n\n        return $html;\n    }\n\n    private function writeThemeFile($name, $contents)\n    {\n        $name = str_replace('.html', '', $name);\n        $name .= '.html';\n        fwrite(STDOUT, \"Writing file: {$name}.\\n\");\n        $html = str_replace('{{ contents }}', $contents, $this->template);\n        return (bool) file_put_contents(\"{$this->outputDir}/{$name}\", $html);\n    }\n\n    private function replaceInner($name, $replace, $search = '{{ contents }}')\n    {\n        $name = str_replace('.html', '', $name);\n        fwrite(STDOUT, \"Updating file: {$name}.\\n\");\n        $path = \"{$this->outputDir}/{$name}.html\";\n        $contents = file_get_contents($path);\n        $contents = str_replace($search, $replace, $contents);\n        file_put_contents($path, $contents);\n    }\n\n    private function gatherServiceVersions()\n    {\n        $manifest = __DIR__ . '/../../../src/data/manifest.json';\n\n        return json_decode(file_get_contents($manifest), true);\n    }\n\n    private function loadExamples($name, $version)\n    {\n        $path = __DIR__ . \"/../../../src/data/{$name}/{$version}/examples-1.json\";\n        try {\n            return \\Aws\\load_compiled_json($path)['examples'];\n        } catch (\\InvalidArgumentException $e) {\n            return [];\n        }\n    }\n\n    private function updateClients(array $services)\n    {\n        fwrite(STDOUT, \"Updating client pages with service links\\n\");\n\n        foreach ($services as $versions) {\n            krsort($versions);\n            $service = reset($versions);\n            $html = '<h2>Supported API Versions</h2>';\n            $html .= <<<EOT\n<p>This class uses a <em>service description model</em> that is associated at\nruntime based on the <code>version</code> option given when constructing the\nclient. The <code>version</code> option will determine which API operations,\nwaiters, and paginators are available for a client. Creating a command or a\nspecific API operation can be done using magic methods (e.g.,\n<code>\\$client->commandName(/** parameters */)</code>, or using the\n<code>$\\client->getCommand</code> method of the client.</p>\nEOT;\n\n            $html .= '<div class=\"api-version-list element-summary\"><ul>';\n            $latest = count($versions) > 1 ? ' (latest)' : '';\n            foreach ($versions as $sv) {\n                $html .= \"<li>\";\n                $html .= \"<p><a href=\\\"{$sv->serviceLink}\\\">{$sv->version} {$latest}</a></p>\";\n                $html .= \"<ul class=\\\"container-fluid\\\">\";\n                foreach (array_keys($sv->api->getOperations()) as $operation) {\n                    $html .= \"<div class=\\\"col-xs-12 col-md-6 col-lg-4\\\">\";\n                    $html .= \"<a href=\\\"{$sv->serviceLink}#\" . strtolower($operation) .\"\\\">$operation</a>\";\n                    $html .= \"</div>\";\n                }\n                $html .= \"</ul>\";\n                $html .= \"</li>\";\n                $latest = '';\n            }\n            $html .= '</ul></div>';\n            $this->replaceInner($service->clientLink, $html, '<!-- api -->');\n        }\n    }\n\n    private function updateExceptions(array $services)\n    {\n        fwrite(STDOUT, \"Updating exception pages with modeled exception data...\\n\");\n\n        foreach ($services as $versions) {\n            krsort($versions);\n            $service = reset($versions);\n            $shapes = $service->api->getErrorShapes();\n            if (count($shapes) > 0) {\n                $html = new HtmlDocument;\n                $html->section(2, 'Expected Exception Codes');\n                $desc = <<<EOT\nThe following are the known exception codes and corresponding data shapes that \nthis service may return as part of an error response. \nEOT;\n                $html->elem('div', null, $desc);\n                foreach ($shapes as $shape) {\n                    if ($shape['type'] == 'structure'\n                        && !isset($this->skipMembers[$shape])\n                    ) {\n                        $html->section(3, $shape->getName(), 'shape', 'method-title');\n\n                        // Add error syntax\n                        $outputShapes = new ShapeIterator($shape, $service->docs);\n                        $outputExample = new ExampleBuilder($shape->getName(), false);\n                        foreach ($outputShapes as $outputShape) {\n                            $outputExample->addShape($outputShape);\n                        }\n                        $html->elem('pre', null, htmlentities($outputExample->getCode()));\n\n                        // Add member details\n                        $html->append($this->renderShape($service->docs, $shape));\n                    }\n                }\n                $this->replaceInner($service->exceptionLink, $html->render(), '<!-- modeled_exceptions -->');\n            }\n        }\n    }\n\n    private function updateAliases(array $services, array $compatibleVersions)\n    {\n        fwrite(STDOUT, \"Updating redirects for forward-compatible service versions\\n\");\n\n        foreach ($compatibleVersions as $service => $aliasedVersions) {\n            foreach ($aliasedVersions as $version => $aliases) {\n                $redirectPage = <<<EOHTML\n<!DOCTYPE html>\n<html>\n<head>\n   <!-- HTML meta refresh URL redirection -->\n   <meta\n       http-equiv=\"refresh\"\n       content=\"0; url={$services[$service][$version]->serviceLink}\">\n</head>\n</html>\nEOHTML;\n                foreach ($aliases as $alias) {\n                    $redirectFrom = str_replace($version, $alias, $services[$service][$version]->serviceLink);\n                    file_put_contents(\"{$this->outputDir}/$redirectFrom\", $redirectPage);\n                }\n            }\n        }\n    }\n\n    private function updateSearch(array $services)\n    {\n        fwrite(STDOUT, \"Updating search index\\n\");\n\n        $broker = new Broker(new Broker\\Backend\\Memory());\n        foreach ($this->sources as $sourceFile) {\n            $broker->processFile($sourceFile);\n        }\n        $index = array_merge(\n            $this->getServiceAutocompleteIndex($services),\n            $this->getClassAutocompleteIndex($broker),\n            $this->getFunctionAutocompleteIndex($broker)\n        );\n        $jsonIndex = json_encode($this->utf8Encode($index));\n        $js = <<<EOJS\nvar AWS = AWS || {};\nAWS.searchIndex = $jsonIndex;\nEOJS;\n\n        file_put_contents(\"{$this->outputDir}/searchIndex.js\", $js);\n    }\n\n    private function utf8Encode($mixed)\n    {\n        if (is_array($mixed)) {\n            return array_map([$this, 'utf8Encode'], $mixed);\n        } elseif (is_string($mixed)) {\n            return utf8_encode($mixed);\n        } elseif (empty($mixed)) {\n            return '';\n        }\n\n        throw new \\InvalidArgumentException('Expecting string or array, got ' . gettype($mixed));\n    }\n\n    private function getServiceAutocompleteIndex(array $services)\n    {\n        $autoComplete = [];\n\n        // Drop all but the latest version of each service from the array\n        $services = array_map(function (array $versions) {\n            return array_shift($versions);\n        }, $services);\n        // Add operations from latest version of each service to autocomplete index\n        foreach ($services as $service) {\n            foreach ($service->api->getOperations() as $operation => $def) {\n                $autoComplete []= [\n                    'name' => $service->namespace . '::' . lcfirst($operation),\n                    'match' => $operation,\n                    'link' => $service->serviceLink . '#' . strtolower($operation),\n                    'description' => strip_tags($service->docs->getOperationDocs($operation)),\n                ];\n            }\n        }\n\n        return $autoComplete;\n    }\n\n    private function getClassAutocompleteIndex(Broker $broker)\n    {\n        $methodsToSkip = $this->getMethodsToSkip();\n\n        $autoComplete = [];\n        $classes = array_filter(\n            array_values($broker->getClasses()),\n            [$this, 'filterVisible']\n        );\n        foreach ($classes as $class) {\n            // Add class to autocomplete index\n            $autoComplete []= [\n                'name' => $class->getName(),\n                'match' => $class->getShortName(),\n                'link' => 'class-' . str_replace('\\\\', '.', $class->getName()) . '.html',\n                'description' => $this->shiftDocCommentLine($class->getDocComment()),\n            ];\n\n            $methods = array_filter(\n                $class->getOwnMethods(\\ReflectionMethod::IS_PUBLIC|\\ReflectionMethod::IS_PROTECTED),\n                [$this, 'filterVisible']\n            );\n\n            // Skip over methods implementing base interfaces or that start with\n            // an underscore\n            $methods = array_filter($methods, function (ReflectionMethod $method) use ($methodsToSkip) {\n                $name = $method->getName();\n                return !in_array($name, $methodsToSkip)\n                    && $name{0} !== '_';\n            });\n\n            foreach ($methods as $method) {\n                $autoComplete []= [\n                    'name' => $class->getName() . '::' . $method->getName(),\n                    'match' => $method->getName(),\n                    'link' => 'class-' . str_replace('\\\\', '.', $class->getName()) . '.html'\n                        . '#_' . $method->getName(),\n                    'description' => '',\n                ];\n            }\n        }\n\n        return $autoComplete;\n    }\n\n    private function getMethodsToSkip()\n    {\n        $interfacesToSkip = [\n            '\\\\ArrayAccess',\n            '\\\\Countable',\n            '\\\\Iterator',\n            '\\\\IteratorAggregate',\n            '\\\\JsonSerializable',\n            '\\\\Serializable',\n        ];\n\n\n        $methodsToSkip = [];\n        foreach ($interfacesToSkip as $interfaceToSkip) {\n            $methodsToSkip = array_merge(\n                $methodsToSkip,\n                array_map(function (\\ReflectionMethod $method) {\n                    return $method->getName();\n                }, (new \\ReflectionClass($interfaceToSkip))->getMethods())\n            );\n        }\n\n        return $methodsToSkip;\n    }\n\n    private function getFunctionAutocompleteIndex(Broker $broker)\n    {\n        $functions = array_filter(\n            array_values($broker->getFunctions()),\n            [$this, 'filterVisible']\n        );\n\n        return array_map(function (ReflectionFunction $function) {\n            return [\n                'name' => $function->getName(),\n                'match' => $function->getShortName(),\n                'link' => 'function-' . str_replace('\\\\', '.', $function->getName()) . '.html',\n                'description' => $this->shiftDocCommentLine($function->getDocComment()),\n            ];\n        }, $functions);\n    }\n\n    private function filterVisible(ReflectionBase $reflected)\n    {\n        $annotations = $reflected->getAnnotations();\n\n        return empty($annotations['internal'])\n            && empty($annotations['deprecated']);\n    }\n\n    private function shiftDocCommentLine($comment)\n    {\n        $comment = array_map(function ($line) {\n            return ltrim($line, '/* ');\n        }, explode(\"\\n\", $comment));\n        $comment = array_filter($comment, function ($line) {\n            return !empty($line);\n        });\n\n        return array_shift($comment);\n    }\n\n    private function createHtmlForWaiters(HtmlDocument $html, Api $service)\n    {\n        $waiters = $service->getWaiters();\n\n        if (!$waiters) {\n            return;\n        }\n\n        $desc = <<<EOT\nWaiters allow you to poll a resource until it enters into a desired state.\nA waiter has a name used to describe what it does, and is associated with an\nAPI operation. When creating a waiter, you can provide the API operation\nparameters associated with the corresponding operation. Waiters can be\naccessed using the <a href=\"class-Aws.AwsClientInterface.html#_getWaiter\">\ngetWaiter(\\$waiterName, \\$operationParameters)</a> method of a client object.\nThis client supports the following waiters:\nEOT;\n\n        $html->section(2, 'Waiters');\n        $html->open('div', 'element-summary');\n            $html->elem('p', null, $desc);\n            $html->open('table', 'table table-condensed');\n                $html->open('thead');\n                    $html->open('tr');\n                        $html->elem('th', null, 'Waiter name');\n                        $html->elem('th', null, 'API Operation');\n                        $html->elem('th', null, 'Delay');\n                        $html->elem('th', null, 'Max Attempts');\n                    $html->close();\n                $html->close();\n                $html->open('tbody');\n                    foreach ($waiters as $name => $config) {\n                        $html->open('tr');\n                            $html->elem('td', null, $name);\n                            $html->elem('td', null, '<a href=\"#'\n                                . strtolower($config['operation'])\n                                . '\">' . $config['operation'] . '</a>');\n                            $html->elem('td', null, $config['delay']);\n                            $html->elem('td', null, $config['maxAttempts']);\n                        $html->close();\n                    }\n                $html->close();\n            $html->close();\n        $html->close();\n    }\n\n    private function createHtmlForPaginators(HtmlDocument $html, Api $service)\n    {\n        $paginators = $service->getPaginators();\n\n        if (!$paginators) {\n            return;\n        }\n\n        $desc = <<<EOT\nPaginators handle automatically iterating over paginated API results. Paginators\nare associated with specific API operations, and they accept the parameters\nthat the corresponding API operation accepts. You can get a paginator from a\nclient class using <a href=\"class-Aws.AwsClientInterface.html#_getPaginator\">\ngetPaginator(\\$paginatorName, \\$operationParameters)</a>. This client supports\nthe following paginators:\nEOT;\n\n        $html->section(2, 'Paginators');\n        $html->open('div', 'element-summary');\n            $html->elem('p', null, $desc);\n            $html->open('ul');\n                foreach ($paginators as $name => $config) {\n                    $html->open('li');\n                        $attr = ['href' => '#' . strtolower($name)];\n                        $html->elem('a', $attr, $name);\n                    $html->close();\n                }\n            $html->close();\n        $html->close();\n    }\n\n    private function createHtmlForOperation(Service $service, $name, Operation $operation, $examples)\n    {\n        $html = new HtmlDocument;\n        $html->open('div', 'operation-container');\n\n        // Name\n        $html->section(\n            3,\n            $html->glyph('cog') . ' ' . $name,\n            null,\n            'method-title',\n            $name\n        );\n\n        // Code\n        $html->elem(\n            'pre',\n            'opcode',\n            '$result = $client-&gt;<code>' . lcfirst($name) . '</code>([/* ... */]);' . \"\\n\"\n            . '$promise = $client-&gt;<code>' . lcfirst($name) . 'Async</code>([/* ... */]);' . \"\\n\"\n        );\n\n        // Description\n        if ($description = $service->docs->getOperationDocs($name)) {\n            $html->elem('div', 'operation-docs', $description);\n        }\n\n        // Parameters\n        $input = $operation->getInput();\n        $this->skipMembers->attach($input);\n        $output = $operation->getOutput();\n        $this->skipMembers->attach($output);\n\n        $inputShapes = new ShapeIterator($input, $service->docs);\n        $inputExample = new ExampleBuilder($name);\n        foreach ($inputShapes as $shape) {\n            $inputExample->addShape($shape);\n        }\n\n        $html\n            ->elem('h4', null, 'Parameter Syntax')\n            ->elem('pre', null, htmlentities($inputExample->getCode()))\n            ->elem('h4', null, 'Parameter Details')\n            ->append($this->renderShape($service->docs, $input, false));\n\n        // Results\n        $html->elem('h4', null, 'Result Syntax');\n\n        if (!count($output->getMembers())) {\n            $html->elem('pre', null, '[]');\n            $html->elem('h4', null, 'Result Details');\n            $html->elem('div', 'alert alert-info', 'The results for this operation are always empty.');\n        } else {\n            $outputShapes = new ShapeIterator($output, $service->docs);\n            $eventStreamExample = null;\n            foreach ($outputShapes as $shape) {\n                if (!empty($shape['eventstream'])) {\n                    $eventStreamExample = new EventStreamExampleBuilder($shape['param']);\n                }\n            }\n            $outputExample = new ExampleBuilder($name, false);\n            foreach ($outputShapes as $shape) {\n                $outputExample->addShape($shape);\n                if ($eventStreamExample) {\n                    $eventStreamExample->addShape($shape);\n                }\n            }\n            $html->elem('pre', null, htmlentities($outputExample->getCode()))\n                ->elem('h4', null, 'Result Details')\n                ->append($this->renderShape($service->docs, $output, false));\n            if ($eventStreamExample) {\n                $desc = <<<EOT\nTo use an EventParsingIterator, you will need to loop over the events it will\ngenerate and check the top-level field to determine which type of event it is.\nEOT;\n\n                $html->elem('h5', null, 'Using an EventParsingIterator')\n                    ->elem('p', null, $desc)\n                    ->elem('pre', null, htmlentities($eventStreamExample->getCode()));\n            }\n        }\n\n        // Errors\n        $html->elem('h4', null, 'Errors');\n        $errors = $operation->getErrors();\n        if (!$errors) {\n            $html->elem('p', null, 'There are no errors described for this operation.');\n        } else {\n            $html->open('ul');\n            foreach ($errors as $error) {\n                $desc = $service->docs->getErrorDocs($error->getName())\n                    ?: 'This error does not currently have a description.';\n                $html\n                    ->open('li')\n                        ->open('p')\n                            ->elem(\n                                'a',\n                                [\n                                    'href' => $service->exceptionLink . '#shape-'\n                                        . strtolower($error->getName())\n                                ],\n                                $error['name'] . ': ')\n                            ->elem('p', null, $desc)\n                        ->close()\n                    ->close();\n            }\n            $html->close();\n        }\n\n        // Examples\n        if (!empty($examples)) {\n            $generator = new CodeSnippetGenerator($service->api);\n            $html->elem('h4', null, 'Examples');\n            foreach ($examples as $number => $example) {\n                $exampleNumber = $number + 1;\n                $exampleId = $this->exampleSlug($name, $exampleNumber);\n                $html->open('h5', ['id' => $exampleId]);\n                $html->elem('span', null, 'Example ' . $exampleNumber . ': ' . $example['title']);\n                $html->elem('a', ['href' => '#' . $exampleId], $html->glyph('link'));\n                $html->close();\n                $html->elem('p', null, $example['description']);\n                $comments = $example['comments'];\n                $html->elem('pre', null, $generator->generateInput(\n                    $name, \n                    isset($example['input']) ? $example['input'] : [], \n                    isset($comments['input']) ? $comments['input'] : []\n                ));\n                if (isset($example['output'])) {\n                    $html->elem('p', null, 'Result syntax:');\n                    $html->elem('pre', null, $generator->generateOutput(\n                        $name, \n                        $example['output'], \n                        isset($comments['output'])\n                            ? $comments['output']\n                            : []\n                    ));\n                }\n            }\n\n            $generatorIssues = $generator->getIssues();\n            foreach ($generatorIssues as $shapeName => $levelIssues) {\n                foreach ($levelIssues as $level => $messages) {\n                    foreach (array_keys($messages) as $message) {\n                        $generatorIssues[$shapeName][$level][$message] = $name;\n                    }\n                }\n            }\n            $this->logIssues(\n                $service->api->getServiceName(),\n                $service->api->getApiVersion(),\n                $generatorIssues\n            );\n        }\n\n        $html->close(); // operation-container\n\n        return $html;\n    }\n\n    private function logIssues($serviceName, $serviceVersion, $issuesToLog)\n    {\n        if (!isset($this->issues[$serviceName][$serviceVersion])) {\n            $this->issues[$serviceName][$serviceVersion] = [];\n        }\n\n        foreach ($issuesToLog as $shapeName=>$shapeIssues) {\n            foreach ($shapeIssues as $level => $messages) {\n                foreach ($messages as $message => $exampleName) {\n                    $this->issues[$level][$serviceName][$serviceVersion][\n                        $exampleName . ' has an issue - '\n                        . $message . ' on ' . $shapeName\n                    ] = true;\n                }\n            }\n        }\n    }\n\n    private function renderShape(\n        DocModel $docs,\n        StructureShape $shape,\n        $showTitle = true\n    ) {\n        $html = new HtmlDocument();\n\n        $html->open('div', 'shape-container');\n\n        // Disable show title for input and output parameters.\n        if ($showTitle) {\n            $desc = $docs->getShapeDocs($shape['name'], null, null);\n            if ($desc) {\n                $html->elem('h5', null, 'Description');\n                $html->elem('div', 'shape-description', $desc);\n            }\n        }\n\n        $html->elem('h5', null, 'Members');\n        $html->open('dl', 'shape-members');\n\n        $members = $shape->getMembers();\n        ksort($members);\n        foreach ($members as $name => $member) {\n            $html->open('dt', 'param-def');\n            $html->elem('span', 'term', $name);\n            $html->close();\n            $html->open('dd', 'param-def');\n            $required = !empty($shape['required'])\n                && in_array($name, $shape['required']);\n            $html->append($this->describeParam($member, $required));\n            $desc = $docs->getShapeDocs($member['name'], $shape['name'], $name);\n            $html->elem('div', 'param-def-doc', $desc);\n            $html->close();\n        }\n\n        $html->close();\n        $html->close();\n\n        return $html;\n    }\n\n    private function describeParam(AbstractModel $member, $required = false)\n    {\n        $html = new HtmlDocument();\n        if ($member instanceof StructureShape) {\n            $typeDesc = $this->getMemberText($member);\n        } elseif ($member instanceof ListShape) {\n            $typeDesc = 'Array of ' . $this->getMemberText($member->getMember()) . 's';\n        } elseif ($member instanceof MapShape) {\n            $typeDesc = 'Associative array of custom strings keys ('\n                . $member->getKey()->getName() . ') to '\n                . $this->getMemberText($member->getValue()) . 's';\n        } else {\n            $typeDesc = $this->getPrimitivePhpType($member);\n        }\n\n        $html->open('div', 'param-attributes')->open('ul');\n        if ($required) {\n            $html->elem('li', 'required', 'Required: Yes');\n        }\n        $html->elem('li', '', 'Type: ' . $typeDesc);\n        $html->close();\n        $html->close();\n\n        return $html;\n    }\n\n    private function getMemberText(AbstractModel $member)\n    {\n        if ($member instanceof StructureShape) {\n            if (!empty($member['eventstream'])) {\n                return $this->getEventStreamMemberText($member);\n            }\n            if (!empty($member['document'])) {\n                return $this->getDocumentText($member);\n            }\n            return $this->memberLink($member->getName()) . ' structure';\n        } elseif ($member instanceof ListShape) {\n            switch ($member->getMember()['type']) {\n                case 'string': return 'strings';\n                case 'double': return 'floats';\n                case 'integer': return 'integers';\n                case 'boolean': return 'booleans';\n                case 'structure': return $this->getMemberText($member->getMember()) . 's';\n            }\n        } elseif ($member instanceof MapShape) {\n            switch ($member->getValue()['type']) {\n                case 'string': return 'strings';\n                case 'double': return 'floats';\n                case 'integer': return 'integers';\n                case 'boolean': return 'booleans';\n                case 'structure': return $this->getMemberText($member->getValue()) . 's';\n            }\n        }\n\n        return $this->getPrimitivePhpType($member);\n    }\n\n    private function getEventStreamMemberText(StructureShape $member)\n    {\n        return 'EventParsingIterator supplying the following structures: '\n            . implode(', ',\n                array_map(\n                    [$this, 'memberLink'],\n                    array_reduce(\n                        $member->getMembers(),\n                        function ($carry, $item) {\n                            $carry []= $item['name'];\n                            return $carry;\n                        },\n                        []\n                    )\n                )\n            );\n    }\n\n    private function getDocumentText(StructureShape $member)\n    {\n        return 'document (null|bool|string|numeric) or an (array|associative array)'\n        . ' whose members are all valid documents';\n    }\n\n    private function getPrimitivePhpType($member)\n    {\n        switch ($member['type']) {\n            case 'long': return 'long (int|float)';\n            case 'integer': return 'int';\n            case 'blob': return 'blob (string|resource|Psr\\Http\\Message\\StreamInterface)';\n            case 'char': return 'char (string)';\n            case 'timestamp': return 'timestamp (string|DateTime or anything parsable by strtotime)';\n            case 'string':\n                if ($member['jsonvalue']){\n                    return 'string (string|number|array|map or anything parsable by json_encode)';\n                }\n            default: return $member['type'];\n        }\n    }\n\n    private function exampleSlug($name, $number)\n    {\n        return strtolower($name) . '-example-' . $number;\n    }\n\n    private function memberSlug($name)\n    {\n        return 'shape-' . strtolower($name);\n    }\n\n    private function memberLink($name)\n    {\n        return '<a href=\"#' . $this->memberSlug($name) . '\">' . $name . '</a>';\n    }\n\n    private function updateSitemap()\n    {\n        fwrite(STDOUT, \"Updating sitemap\\n\");\n\n        $writer = new \\SimpleXMLElement(\"<urlset></urlset>\");\n        $writer->addAttribute('xmlns', \"http://www.sitemaps.org/schemas/sitemap/0.9\");\n\n        $linksToIndex = new \\GlobIterator(\"{$this->outputDir}/*.html\", \\FilesystemIterator::CURRENT_AS_FILEINFO);\n        foreach ($linksToIndex as $link) {\n            $url = $writer->addChild('url');\n            $url->addChild('loc', \"{$this->baseUrl}{$link->getBasename()}\");\n        }\n\n        $writer->asXML(\"{$this->outputDir}/sitemap.xml\");\n    }\n}\n", "num_lines": 1066}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Build\\Docs;\n\n/**\n * @internal\n */\nclass EventStreamExampleBuilder\n{\n    private $buffer;\n    private $shapeName;\n    private $skipLevel;\n    private $elseRequired;\n    private $closed;\n    private $tabLevel;\n\n    public function __construct($shapeName)\n    {\n        $this->buffer = '';\n        $this->shapeName = $shapeName;\n        $this->skipLevel = 0;\n        $this->elseRequired = false;\n        $this->closed = true;\n        $this->tabLevel = 1;\n    }\n\n    public function getCode()\n    {\n        $code = 'foreach($result[' . $this->shapeName . '] as $event) {' . \"\\n\";\n        $code .= $this->buffer;\n        $code .= \"\\n}\";\n\n        return str_replace(\"\\t\", '    ', $code);\n    }\n\n    public function addShape(array $shape)\n    {\n        if ($this->tabLevel === 1\n            && !empty($shape['param'])\n            && $shape['param'] === $this->shapeName\n        ) {\n            $this->closed = false;\n            return;\n        }\n        if ($this->closed) {\n            return;\n        }\n        // Handle skips and closers\n        if ($shape['name'] === 'closer') {\n            $this->tabLevel--;\n            if ($this->tabLevel === 2) {\n                $this->tabLevel--;\n                $this->buffer .= $this->tab() . '}';\n                $this->elseRequired = true;\n            } else if ($this->tabLevel === 0) {\n                $this->closed = true;\n            }\n            return;\n        }\n\n        // Write the parameter key.\n        if ($shape['param'] !== '<index>') {\n            if ($this->tabLevel === 1) {\n                if (!$this->elseRequired) {\n                    $this->buffer .= $this->tab();\n                } else {\n                    $this->buffer .= ' else ';\n                }\n                $this->buffer .= 'if (isset($event[' . $shape['param'] . '])) {' . \"\\n\";\n                $this->tabLevel++;\n                $this->buffer .= $this->tab() . '// Handle the ' . $shape['param'] . \" event.\\n\";\n            } else {\n                $this->elseRequired = false;\n            }\n        }\n\n        if ($shape['complex']) {\n            $this->tabLevel++;\n        }\n    }\n\n    private function tab()\n    {\n        return str_repeat(\"\\t\", $this->tabLevel);\n    }\n}\n", "num_lines": 86}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Build\\Docs;\n\n/**\n * @internal\n */\nclass ExampleBuilder\n{\n    private $buffer;\n    private $operation;\n    private $skipLevel;\n    private $tabLevel;\n    private $isInput;\n\n    public function __construct($operation, $isInput = true)\n    {\n        $this->buffer = '';\n        $this->operation = $operation;\n        $this->skipLevel = 0;\n        $this->tabLevel = 1;\n        $this->isInput = $isInput;\n    }\n\n    public function getCode()\n    {\n        if ($this->isInput) {\n            $code = '$result = $client->'\n                . lcfirst($this->operation)\n                . \"([\\n{$this->buffer}]);\\n\";\n        } else {\n            $code = \"[\\n{$this->buffer}]\";\n        }\n\n        return str_replace(\"\\t\", '    ', $code);\n    }\n\n    public function addShape(array $shape)\n    {\n        // Handle skips and closers\n        if ($this->skipLevel) {\n            $this->skipLevel--;\n            return;\n        } elseif ($shape['name'] === 'closer') {\n            if ($shape['type'] === 'list' || $shape['type'] === 'map') {\n                $this->buffer .= $this->tab() . \"// ...\\n\";\n            }\n            $this->tabLevel--;\n            $this->buffer .= $this->tab() . \"],\\n\";\n            return;\n        }\n\n        // Write the parameter key.\n        $this->buffer .= $this->tab();\n        if ($shape['param'] !== '<index>') {\n            $this->buffer .= \"{$shape['param']} => \";\n        }\n\n        // Write the parameter value.\n        if ($shape['complex']) {\n            if ($shape['recursive']) {\n                $this->buffer .= \"[...],\";\n            } elseif (!in_array($shape['complex'], ['structure', 'list', 'map', 'mixed'])) {\n                $this->buffer .= \"[\" . $this->getSimpleValue(['type' => $shape['complex']]) . \", ...],\";\n                $this->skipLevel += 2;\n            } else {\n                $this->buffer .= \"[\";\n                $this->tabLevel++;\n            }\n        } else {\n            $this->buffer .= $this->getSimpleValue($shape) . \",\";\n        }\n\n        $this->buffer .= $this->getTags($shape);\n\n        $this->buffer .= \"\\n\";\n    }\n\n    private function getSimpleValue(array $shape)\n    {\n        switch ($shape['type']) {\n            case 'integer':\n                return '<integer>';\n            case 'string':\n                return isset($shape['enum'])\n                    ? \"'\" . implode('|', $shape['enum']) . \"'\"\n                    : \"'<string>'\";\n            case 'boolean':\n                return 'true || false';\n            case 'stream':\n                return '<string || resource || Psr\\\\Http\\\\Message\\\\StreamInterface>';\n            case 'timestamp':\n                return $this->isInput\n                    ? '<integer || string || DateTime>'\n                    : '<DateTime>';\n            case 'float':\n                return '<float>';\n            default:\n                return '<value>';\n        }\n    }\n\n    private function getTags(array $shape)\n    {\n        $tags = [];\n        if ($this->isInput && $shape['required']) {\n            $tags[] = 'REQUIRED';\n        }\n        if ($shape['recursive']) {\n            $tags[] = 'RECURSIVE';\n        }\n        if (!empty($shape['eventstream'])) {\n            $tags[] = 'EventParsingIterator';\n        }\n\n        return $tags ? ' // ' . implode(', ', $tags) : '';\n    }\n\n    private function tab()\n    {\n        return str_repeat(\"\\t\", $this->tabLevel);\n    }\n}\n", "num_lines": 123}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Build\\Docs;\n\n/**\n * @internal\n */\nclass HtmlDocument\n{\n    /** @var array */\n    private $lines;\n\n    /** @var int */\n    private $currentLine;\n\n    /** @var \\SplStack */\n    private $stack;\n\n    public function __construct()\n    {\n        $this->lines = [];\n        $this->currentLine = 0;\n        $this->stack = new \\SplStack();\n    }\n\n    public function render($baseTabLevel = 0)\n    {\n        return implode(\"\\n\", array_map(function ($line) use ($baseTabLevel) {\n            return str_repeat(\"\\t\", $baseTabLevel) . $line;\n        }, $this->lines));\n    }\n\n    public function section($num, $text, $anchorPrefix = null, $class = null, $label = null)\n    {\n        $anchor = $this->slug($anchorPrefix . '-' . $text);\n        $ariaLabel = empty($label) ? null : 'aria-label=\"Go to ' . $label . '\"';\n        $link = ' <a ' . $ariaLabel . ' href=\"#' . $anchor . '\" class=\"anchor-link\">' . $this->glyph('link') . '</a>';\n        $attrs = ['id' => $anchor];\n        if ($class) {\n            $attrs['class'] = $class;\n        }\n        $this->elem(\"h{$num}\", $attrs, $text . $link);\n\n        return $this;\n    }\n\n    public function open($tag, $attr = null)\n    {\n        $startingLine = $this->currentLine;\n        $this->elem($tag, $attr);\n        $this->stack->push([$tag, $startingLine]);\n\n        return $this;\n    }\n\n    public function close($collapse = false)\n    {\n        list($tag, $startLine) = $this->stack->pop();\n        $this->lines[$this->currentLine++] = $this->getTab() . '</' . $tag . '>';\n\n        if ($collapse) {\n            $this->lines[$startLine] = $this->lines[$startLine] . implode('', array_map('trim',\n                array_slice($this->lines, $startLine + 1, $this->currentLine - $startLine + 1)\n            ));\n            $this->currentLine = $startLine + 1;\n            for ($i = $this->currentLine; isset($this->lines[$i]); $i++) {\n                unset($this->lines[$i]);\n            }\n        }\n\n        return $this;\n    }\n\n    public function elem($tag, $attr = null, $content = null)\n    {\n        $attr = $attr\n            ? (is_string($attr) ? ['class' => $attr] : (array) $attr)\n            : [];\n\n        $buffer = $this->getTab() . '<' . $tag;\n        foreach ($attr as $k => $v) {\n            $buffer .= ' ' . $k . '=\"' . $v . '\"';\n        }\n        $buffer .= '>';\n\n        if ($content !== null) {\n            $buffer .= $content . '</' . $tag . '>';\n        }\n\n        $this->lines[$this->currentLine++] = $buffer;\n\n        return $this;\n    }\n\n    public function slug($text)\n    {\n        $sanitized = preg_replace('/[^A-Za-z0-9-]/', '', strip_tags($text));\n\n        return strtolower(str_replace(' ', '-', trim($sanitized, ' -')));\n    }\n\n    public function glyph($type)\n    {\n        return '<span class=\"glyphicon glyphicon-' . $type . '\"></span>';\n    }\n\n    public function append(HtmlDocument $html)\n    {\n        $this->lines = array_merge($this->lines, $html->lines);\n        $this->currentLine += count($html->lines);\n\n        return $this;\n    }\n\n    private function getTab()\n    {\n        return str_repeat(\"\\t\", count($this->stack));\n    }\n}\n", "num_lines": 119}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Build\\Docs;\n\nuse Aws\\Api\\ApiProvider;\n\n/**\n * Builds redirect map file across services\n *\n * @internal\n */\nclass RedirectMapBuilder\n{\n    /** @var string */\n    private $outputDir;\n\n    /** @var ApiProvider */\n    private $apiProvider;\n\n    public function __construct(ApiProvider $provider, $outputDir)\n    {\n        $this->apiProvider = $provider;\n        $this->outputDir = $outputDir;\n    }\n\n    public function build()\n    {\n        $redirectEntry = [];\n        $reWriteRulePrefix = \"RewriteRule ^/goto/SdkForPHPV3/\";\n        $docPathPrefix = \" /aws-sdk-php/v3/api/\";\n        $flags = \" [L,R,NE]\\n\";\n        $skipCount = 0;\n        // Using latest version per service\n        foreach ($this->gatherServiceVersions() as $name => $data) {\n            $ns = $data['namespace'];\n            $version = $data['versions']['latest'];\n            list($api, $docModel) = call_user_func(\n                \"Aws\\\\{$ns}\\\\{$ns}Client::applyDocFilters\",\n                ApiProvider::resolve($this->apiProvider, 'api', $name, $version),\n                ApiProvider::resolve($this->apiProvider, 'docs', $name, $version)\n            );\n            $service = new Service($api, $docModel);\n            // Add rewrite rule per operation per service\n            foreach ($service->api->getOperations() as $key => $definition) {\n                // Skip rewrite rule if service doesn't has a uid in metadata\n                if ($service->uid) {\n                    $entry = $reWriteRulePrefix . $service->uid . '/' . $key . '$';\n                    $entry .= $docPathPrefix . 'api-' . $service->slug . \".html#\" . strtolower($key);\n\n                    $redirectEntry []= $entry . $flags;\n                    $skipCount++;\n                }\n            }\n            // Fall back to service client main page if version not found\n            if (!empty($service->uid)) {\n                $servicePrefix = $service->uid;\n            } else {\n                $servicePrefix = $service->name;\n            }\n            $redirectEntry []= $reWriteRulePrefix . $servicePrefix . '(.*)'\n                . $docPathPrefix . 'class-Aws.'. $service->namespace . '.'\n                . $service->namespace . 'Client.html' . $flags;\n            $skipCount++;\n        }\n        // Apply skip check at beginning if not PHP SDK related\n        array_unshift($redirectEntry,\n            \"RewriteCond %{REQUEST_URI} !^\\\\/goto\\\\/SdkForPHPV3\\\\/.*$\\n\",\n            \"RewriteRule \\\".*\\\" \\\"-\\\" [S={$skipCount}]\\n\"\n        );\n\n        // Fall back to api main page if service not found\n        $redirectEntry []= $reWriteRulePrefix . '(.*)' . $docPathPrefix . 'index.html' . $flags;\n\n        // Redirect old /AWSSDKforPHP/ paths\n        $reWriteRulePrefix = 'RewriteRule ^/AWSSDKforPHP/';\n        array_unshift($redirectEntry,\n            \"RewriteCond %{REQUEST_URI} !^\\\\/AWSSDKforPHP\\\\/.*$\\n\",\n            \"RewriteRule \\\".*\\\" \\\"-\\\" [S={4}]\\n\",\n            $reWriteRulePrefix . 'latest(.*) /aws-sdk-php/latest/index.html' . $flags,\n            $reWriteRulePrefix . 'v3(.*) /aws-sdk-php/v3/api/index.html' . $flags,\n            $reWriteRulePrefix . 'v2(.*) /aws-sdk-php/v2/api/index.html' . $flags,\n            $reWriteRulePrefix . 'v1(.*) /aws-sdk-php/v1/index.html' . $flags\n        );\n\n        file_put_contents($this->outputDir, $redirectEntry);\n    }\n\n    private function gatherServiceVersions()\n    {\n        $manifest = __DIR__ . '/../../../src/data/manifest.json';\n\n        return json_decode(file_get_contents($manifest), true);\n    }\n}\n", "num_lines": 94}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Build\\Docs;\n\nuse Aws\\Api\\Service as Api;\nuse Aws\\Api\\DocModel;\nuse Aws\\Sdk;\n\n/**\n * Serves as a DTO for information about a service required to build various\n * aspects of the docs.\n *\n * @internal\n */\nclass Service\n{\n    /** @var Api */\n    public $api;\n\n    /** @var string */\n    public $client;\n\n    /** @var string */\n    public $clientName;\n\n    /** @var string */\n    public $clientLink;\n\n    /** @var DocModel */\n    public $docs;\n\n    /** @var string */\n    public $exceptionLink;\n\n    /** @var string */\n    public $fullNamespace;\n\n    /** @var string */\n    public $fullTitle;\n\n    /** @var string */\n    public $name;\n\n    /** @var string */\n    public $namespace;\n\n    /** @var string */\n    public $namespaceLink;\n\n    /** @var string */\n    public $serviceLink;\n\n    /** @var string */\n    public $shortTitle;\n\n    /** @var string */\n    public $slug;\n\n    /** @var string */\n    public $title;\n\n    /** @var string */\n    public $version;\n\n    public function __construct(Api $api, DocModel $docs)\n    {\n        $this->name = $api->getServiceName();\n        $this->api = $api;\n        $this->namespace = $this->getServiceNamespace($this->name);\n        $this->version = $api->getApiVersion();\n        $this->docs = $docs;\n        $this->slug = $this->name . '-' . $this->version;\n        $this->uid = $api->getUid();\n        $this->clientName = $this->namespace . 'Client';\n        $this->client = 'Aws\\\\' . $this->namespace . '\\\\' . $this->clientName;\n        $this->clientLink = 'class-Aws.' . $this->namespace . '.' . $this->namespace . 'Client.html';\n        $this->exceptionLink = 'class-Aws.' . $this->namespace . '.Exception.' . $this->namespace . 'Exception.html';\n        $this->namespaceLink = 'namespace-Aws.' . $this->namespace . '.html';\n        $this->serviceLink = 'api-' . $this->slug . '.html';\n        $this->shortTitle = $api->getMetadata('serviceAbbreviation');\n        $this->title = $api->getServiceFullName();\n        $this->fullNamespace = 'Aws\\\\' . $this->namespace;\n        $this->fullTitle = $this->title . ' (' . $this->version . ')';\n    }\n\n    private function getServiceNamespace($service)\n    {\n        static $namespaces;\n\n        if (!$namespaces) {\n            // Get the namespaces from the directories.\n            foreach (glob(__DIR__ . '/../../../src/*') as $dir) {\n                $base = basename($dir);\n                if (class_exists(\"Aws\\\\{$base}\\\\{$base}Client\")) {\n                    $namespaces[Sdk::getEndpointPrefix($base)] = $base;\n                }\n            }\n        }\n\n        if (!isset($namespaces[$service])) {\n            throw new \\RuntimeException(\"Could not determine the namespace for {$service}.\");\n        }\n\n        return $namespaces[$service];\n    }\n}\n", "num_lines": 106}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Build\\Docs;\n\nuse Aws\\Api\\ListShape;\nuse Aws\\Api\\MapShape;\nuse Aws\\Api\\Shape;\nuse Aws\\Api\\StructureShape;\nuse Aws\\Api\\DocModel;\n\n/**\n * @internal\n */\nclass ShapeIterator implements \\Iterator\n{\n    private static $keys = ['name', 'param', 'type', 'docs', 'recursive',\n        'required', 'min', 'max', 'enum', 'pattern', 'complex'];\n\n    private static $types = [\n        'structure' => 'structure',\n        'map'       => 'map',\n        'list'      => 'list',\n        'integer'   => 'integer',\n        'long'      => 'integer',\n        'string'    => 'string',\n        'character' => 'string',\n        'byte'      => 'string',\n        'blob'      => 'stream',\n        'double'    => 'float',\n        'float'     => 'float',\n        'boolean'   => 'boolean',\n        'timestamp' => 'timestamp',\n    ];\n\n    /** @var DocModel */\n    private $docs;\n\n    /** @var array */\n    private $shapes;\n\n    /** @var int */\n    private $index;\n\n    public function __construct(StructureShape $root, DocModel $docs)\n    {\n        $this->docs = $docs;\n        $this->shapes = [];\n        $this->index = 0;\n        $this->walkStructure($root, [], []);\n        $this->rewind();\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function current()\n    {\n        return $this->shapes[$this->index];\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function next()\n    {\n        $this->index++;\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function key()\n    {\n        return $this->index;\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function valid()\n    {\n        return isset($this->shapes[$this->index]);\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function rewind()\n    {\n        $this->index = 0;\n    }\n\n    private function walkComplexMember(Shape $shape, array $visited, array $path)\n    {\n        // Store the path associated with this shape to aid in recursion detection.\n        $visited[$shape->getName()] = $path;\n\n        // Delegate traversal to the proper method\n        if ($shape instanceof StructureShape) {\n            $this->walkStructure($shape, $visited, $path);\n        } elseif ($shape instanceof MapShape) {\n            $this->walkMap($shape, $visited, $path);\n        } elseif ($shape instanceof ListShape) {\n            $this->walkList($shape, $visited, $path);\n        } else {\n            throw new \\UnexpectedValueException('Expected a complex shape.');\n        }\n\n        // Remove the shape from visited collection. This is also to aid in recursion detection.\n        unset($visited[$shape->getName()]);\n\n        // Add a \"closer shape\" that will be yielded by the iterator. These\n        // shapes indicate the closure of a complex shape, and make it easier\n        // to code the visual representation of the shape tree.\n        $this->shapes[$this->index++] = ['name' => 'closer', 'type' => $shape->getType()];\n    }\n\n    private function walkStructure(StructureShape $shape, array $visited, array $path)\n    {\n        $shapeMembers = $shape->getMembers();\n        ksort($shapeMembers);\n        foreach ($shapeMembers as $ref => $member) {\n            // Create the shape data from the Shape object.\n            $data = $this->createShapeData($member);\n            $path[] = $data['param'] = \"'{$ref}'\";\n            $data['docs'] = $this->docs->getShapeDocs($member->getName(), $shape->getName(), $ref);\n            $data['recursive'] = $this->getRecursionPath($member, $visited);\n            $data['path'] = $path;\n\n            // For structures, we have to see if the member is required.\n            if (isset($shape['required']) && in_array($ref, $shape['required'])) {\n                $data['required'] = true;\n            }\n\n            // Save the shape data.\n            $this->shapes[$this->index++] = $data;\n\n            // If the member is complex and not recursive, traverse it too.\n            if ($data['complex'] && !$data['recursive']) {\n                $this->walkComplexMember($member, $visited, $path);\n            }\n        }\n    }\n\n    private function walkMap(MapShape $shape, array $visited, array $path)\n    {\n        $key = $shape->getKey();\n        $value = $shape->getValue();\n\n        // Create the shape data from the Shape object.\n        $data = $this->createShapeData($value);\n        $path[] = $data['param'] = \"'<{$key['name']}>'\";\n        $data['docs'] = $this->docs->getShapeDocs($value->getName(), $shape->getName(), 'value');\n        $data['recursive'] = $this->getRecursionPath($value, $visited);\n        $data['path'] = $path;\n\n        // Save the shape data.\n        $this->shapes[$this->index++] = $data;\n\n        // If the value is complex and not recursive, traverse it too.\n        if ($data['complex'] && !$data['recursive']) {\n            $this->walkComplexMember($value, $visited, $path);\n        }\n    }\n\n    private function walkList(ListShape $shape, array $visited, array $path)\n    {\n        $member = $shape->getMember();\n\n        // Create the shape data from the Shape object.\n        $data = $this->createShapeData($member);\n        $path[] = $data['param'] = \"<index>\";\n        $data['docs'] = $this->docs->getShapeDocs($member->getName(), $shape->getName(), 'member');\n        $data['recursive'] = $this->getRecursionPath($member, $visited);\n        $data['path'] = $path;\n\n        // Save the shape data.\n        $this->shapes[$this->index++] = $data;\n\n        // If the member is complex and not recursive, traverse it too.\n        if ($data['complex'] && !$data['recursive']) {\n            $this->walkComplexMember($member, $visited, $path);\n        }\n    }\n\n    private function getRecursionPath(Shape $shape, array $visited)\n    {\n        return isset($visited[$shape->getName()])\n            ? $visited[$shape->getName()]\n            : null;\n    }\n\n    private function createShapeData(Shape $shape)\n    {\n        // Get basic data from the shape object\n        $data = $shape->toArray();\n        unset($data['members'], $data['member'], $data['key'], $data['value'], $data['required']);\n        $data += array_fill_keys(self::$keys, null);\n\n        // Determine the type.\n        $data['type'] = self::$types[$shape->getType()];\n\n        // Determine the subtype for complex types.\n        if ($data['type'] === 'structure') {\n            $data['complex'] = 'mixed';\n        } elseif ($data['type'] === 'map') {\n            /** @var MapShape $shape */\n            $data['complex'] = self::$types[$shape->getValue()->getType()];\n        } elseif ($data['type'] === 'list') {\n            /** @var ListShape $shape */\n            $data['complex'] = self::$types[$shape->getMember()->getType()];\n        }\n\n        return $data;\n    }\n}\n", "num_lines": 206}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Test\\Integ;\n\nuse Aws\\Api\\ApiProvider;\nuse Aws\\Api\\Service;\nuse Aws\\AwsClient;\nuse Aws\\ClientSideMonitoring\\ConfigurationProvider;\nuse Aws\\ClientSideMonitoring\\Exception\\ConfigurationException;\nuse Aws\\Command;\nuse Aws\\Credentials\\Credentials;\nuse Aws\\Exception\\AwsException;\nuse Aws\\MockHandler;\nuse Aws\\MonitoringEventsInterface;\nuse Aws\\Result;\nuse Aws\\Sdk;\nuse Behat\\Behat\\Context\\Context;\nuse Behat\\Behat\\Context\\SnippetAcceptingContext;\nuse GuzzleHttp\\Psr7\\Request;\nuse GuzzleHttp\\Psr7\\Response;\nuse PHPUnit\\Framework\\Assert;\nuse Yoast\\PHPUnitPolyfills\\TestCases\\TestCase;\n\nclass ClientSideMonitoringContext extends TestCase\n    implements Context, SnippetAcceptingContext\n{\n\n    /**\n     * Child process ID used by the test UDP server\n     * @var int\n     */\n    private static $childPid;\n\n    /**\n     * Original environment variables before class instantiated\n     * @var array\n     */\n    private static $originalEnv;\n\n    /**\n     * Store output filename for the UDP server's received datagrams\n     * @var string\n     */\n    private static $outputFile;\n\n    /**\n     * @var Sdk\n     */\n    private $sdk;\n\n    private $defaultEnv = [];\n    private $sharedConfig;\n    private $testApiProvider;\n    private $testData;\n    private $testDir;\n    private $testServices = [];\n\n    private $configKeys = [\n        'region' => 'region',\n    ];\n\n    private $udpConfig = [\n        'address' => '127.0.0.1',\n        'port' => 31000,\n        'shutdown' => 'shutdown',\n    ];\n\n    public function __construct()\n    {\n        $this->testDir = __DIR__ . \"/csm\";\n    }\n\n    /**\n     * @BeforeScenario\n     */\n    public static function prepare()\n    {\n        if (!extension_loaded('pcntl') || !function_exists('pcntl_fork')) {\n            throw new \\RuntimeException(\"Test skipped because the 'pcntl' extension is not loaded or enabled.\");\n        }\n        if (!extension_loaded('sockets') || !function_exists('socket_create')) {\n            throw new \\RuntimeException(\"Test skipped because the 'sockets' extension is not loaded or enabled.\");\n        }\n\n        self::$originalEnv = [\n            'enabled' => getenv(ConfigurationProvider::ENV_ENABLED) ?: '',\n            'port' => getenv(ConfigurationProvider::ENV_PORT) ?: '',\n            'client_id' => getenv(ConfigurationProvider::ENV_CLIENT_ID) ?: '',\n            'profile' => getenv(ConfigurationProvider::ENV_PROFILE) ?: '',\n        ];\n\n        $dir = sys_get_temp_dir() . '/.aws';\n        if (!is_dir($dir)) {\n            mkdir($dir, 0777, true);\n        }\n        self::$outputFile = $dir . '/test_datagrams.json';\n    }\n\n    /**\n     * @AfterScenario\n     */\n    public static function cleanup()\n    {\n        putenv(ConfigurationProvider::ENV_ENABLED . '=' .\n            self::$originalEnv['enabled']);\n        putenv(ConfigurationProvider::ENV_PORT . '=' .\n            self::$originalEnv['port']);\n        putenv(ConfigurationProvider::ENV_CLIENT_ID . '=' .\n            self::$originalEnv['client_id']);\n        putenv(ConfigurationProvider::ENV_PROFILE . '=' .\n            self::$originalEnv['profile']);\n\n        if (file_exists(self::$outputFile)) {\n            unlink(self::$outputFile);\n        }\n\n        if (!empty(self::$childPid) && posix_getpgid(self::$childPid) !== false) {\n            if (posix_kill(self::$childPid, SIGTERM) === false) {\n                posix_kill(self::$childPid, SIGKILL);\n            };\n        }\n    }\n\n    /**\n     * @Given I have loaded a test manifest file called :filename\n     */\n    public function iHaveLoadedATestManifestFileCalled($filename)\n    {\n        $manifest = json_decode(\n            file_get_contents(\"{$this->testDir}/data/{$filename}\"),\n            true\n        );\n        $provider = ApiProvider::manifest(\"{$this->testDir}/data/\", $manifest);\n        $serviceDirectories = glob(\"{$this->testDir}/data/*\" , GLOB_ONLYDIR);\n        foreach ($serviceDirectories as $directory) {\n            $definition = $provider('api', basename($directory), 'latest');\n            $service = new Service($definition, $provider);\n            $this->testServices[$service->getServiceId()] = $service;\n        }\n        $this->testApiProvider = $provider;\n    }\n\n    /**\n     * @Given I have loaded a test case file called :filename\n     */\n    public function iHaveLoadedATestCaseFileCalled($filename)\n    {\n        $this->testData = json_decode(\n            file_get_contents(\"{$this->testDir}/{$filename}\"),\n            true\n        );\n\n        if (!empty($this->testData['defaults']['configuration']['environmentVariables'])) {\n            foreach ($this->testData['defaults']['configuration']['environmentVariables']\n                     as $key => $value) {\n                $this->defaultEnv[$key] = $value;\n            }\n        }\n\n        $sharedConfig = [\n            'version' => 'latest'\n        ];\n        foreach ($this->testData['defaults']['configuration'] as $key => $value) {\n            if (array_key_exists($key, $this->configKeys)) {\n                $sharedConfig[$this->configKeys[$key]] = $value;\n            }\n        }\n        if (isset($this->testData['defaults']['configuration']['accessKey'])) {\n            $sharedConfig['credentials'] = $this->createCredentials(\n                $this->testData['defaults']['configuration']\n            );\n        }\n        $this->sharedConfig = $sharedConfig;\n        $this->sdk = new Sdk($sharedConfig);\n    }\n\n    /**\n     * @Then I successfully run the test cases against a test server\n     */\n    public function iSuccessfullyRunTheTestCasesAgainstATestServer()\n    {\n        foreach ($this->testData['cases'] as $case) {\n\n            $pid = pcntl_fork();\n\n            if ($pid === -1) {\n                throw new \\RuntimeException(\"Test failed because 'pcntl_fork' was unable to fork PHP process.\");\n            } elseif ($pid === 0) {\n                try {\n                    $this->startUdpServer();\n                } catch (\\Exception $e) {\n                    exit();\n                }\n            } else {\n                try {\n                    self::$childPid = $pid;\n\n                    usleep(500000);\n\n                    if (isset($case['configuration']['environmentVariables'])) {\n                        $this->clearAndSetEnv($case['configuration']['environmentVariables']);\n                    } else {\n                        $this->clearAndSetEnv($this->defaultEnv);\n                    }\n\n                    $events = [];\n                    $params = $this->prepareTestCaseParams($case);\n\n                    foreach ($case['apiCalls'] as $apiCall) {\n                        $client = $this->createClientForApiCall($apiCall, $params);\n                        $list = $client->getHandlerList();\n                        $command = new Command($apiCall['operationName'], $apiCall['params']);\n                        $request = new Request('POST', (string)$client->getEndpoint());\n                        $handler = new MockHandler();\n                        foreach ($apiCall['attemptResponses'] as $attemptResponse) {\n                            $response = $this->generateResponse($attemptResponse, $command);\n                            if ($response instanceof \\Exception &&\n                                !($response instanceof AwsException)) {\n                                $handler->appendException($response);\n                            } else {\n                                $handler->append($response);\n                            }\n                        }\n                        $list->setHandler($handler);\n                        $handler = $list->resolve();\n\n                        try {\n                            /** @var Result $result */\n                            $result = $handler($command, $request)->wait();\n                            $events = array_merge($events, $result->getMonitoringEvents());\n                        } catch (\\Exception $e) {\n                            if ($e instanceof MonitoringEventsInterface) {\n                                $events = array_merge($events, $e->getMonitoringEvents());\n                            }\n                        }\n                    }\n\n                    $this->sendSocketShutdownMessage();\n                    usleep(500000);\n\n                    $this->compareMonitoringEvents(\n                        $case['expectedMonitoringEvents'],\n                        $events\n                    );\n\n                    $received = file_get_contents(self::$outputFile);\n                    $receivedEvents = json_decode($received, true);\n                    $this->compareMonitoringEvents(\n                        $case['expectedMonitoringEvents'],\n                        $receivedEvents\n                    );\n                } catch (\\Exception $e) {\n                    $this->sendSocketShutdownMessage();\n                    throw $e;\n                }\n            }\n        }\n    }\n\n    private function clearAndSetEnv($env)\n    {\n        putenv(ConfigurationProvider::ENV_ENABLED . '=');\n        putenv(ConfigurationProvider::ENV_PORT . '=');\n        putenv(ConfigurationProvider::ENV_CLIENT_ID . '=');\n        putenv(ConfigurationProvider::ENV_PROFILE . '=');\n\n        foreach ($env as $key => $value) {\n            putenv(\"{$key}={$value}\");\n        }\n    }\n\n    private function compareMonitoringEvents($expected, $actual)\n    {\n        $this->assertSame(count($expected), count($actual));\n        foreach ($expected as $index => $expectedEvent) {\n            $actualEvent = $actual[$index];\n            foreach ($expectedEvent as $key => $value) {\n                $this->assertArrayHasKey($key, $actualEvent);\n                $this->validateEventValue($value, $actualEvent[$key]);\n            }\n            $allowedFields = array_merge(\n                array_keys($expectedEvent),\n                array_keys($this->testData['defaults']['optionalEventFields'][$actualEvent['Type']])\n            );\n            foreach ($actualEvent as $key => $value) {\n                $this->assertTrue(in_array($key, $allowedFields));\n                if (in_array($key, $this->testData['defaults']['optionalEventFields'][$actualEvent['Type']])) {\n                    $this->validateEventValue(\n                        $this->testData['defaults']['optionalEventFields'][$actualEvent['Type']],\n                        $value\n                    );\n                }\n            }\n        }\n    }\n\n    private function createClientForApiCall(array $apiCall, array $params)\n    {\n        /** @var Service $service */\n        if (!empty($service = $this->testServices[$apiCall['serviceId']])) {\n            $params['service'] = $service->getEndpointPrefix();\n            $params['api_provider'] = $this->testApiProvider;\n            $params += $this->sharedConfig;\n            $params += ['retries' => 3];\n            return new AwsClient($params);\n        }\n\n        return $this->sdk->createClient(\n            $apiCall['serviceId'],\n            $params\n        );\n    }\n\n    private function createCredentials(array $configuration)\n    {\n        if (!empty($configuration['sessionToken'])) {\n            $token = $configuration['sessionToken'];\n        } else {\n            $token = null;\n        }\n\n        return new Credentials(\n            $configuration['accessKey'],\n            'test-secret',\n            $token\n        );\n    }\n\n    private function generateResponse($attemptResponse, $command)\n    {\n        $transferStats = [\n            'total_time' => !empty($attemptResponse['totalTime'])\n                ? $attemptResponse['totalTime']\n                : 0.12,\n            'primary_ip' => !empty($attemptResponse['primaryIp'])\n                ? $attemptResponse['primaryIp']\n                : '12.34.56.78',\n            'namelookup_time' => !empty($attemptResponse['namelookupTime'])\n                ? $attemptResponse['namelookupTime']\n                : 0.012,\n        ];\n\n        $headers = [];\n        if (isset($attemptResponse['responseHeaders'])) {\n            foreach($attemptResponse['responseHeaders'] as $header => $value) {\n                $headers[$header] = $value;\n            }\n        }\n\n        if (!empty($attemptResponse['errorCode'])) {\n            $context = [\n                'code' => $attemptResponse['errorCode'],\n                'message' => $attemptResponse['errorMessage'],\n                'response' => new Response($attemptResponse['httpStatus'], $headers),\n                'transfer_stats' => $transferStats,\n            ];\n\n            return new AwsException($attemptResponse['errorMessage'],\n                $command,\n                $context\n            );\n        }\n        if (!empty($attemptResponse['sdkException'])) {\n            return new ConfigurationException(\n                $attemptResponse['sdkException']['message'], 555\n            );\n        }\n        if (!empty($attemptResponse['httpStatus'])) {\n            $params = [\n                '@metadata' => [\n                    'statusCode' => $attemptResponse['httpStatus'],\n                    'headers' => $headers,\n                    'transferStats' => [\n                        'http' => [\n                            $transferStats\n                        ]\n                    ],\n                ],\n            ];\n            return new Result($params);\n        }\n\n        throw new \\InvalidArgumentException('attemptResponse data does not contain required fields.');\n    }\n\n    private function prepareTestCaseParams(array $case)\n    {\n        $params = [];\n        if (!empty($case['configuration']['region'])) {\n            $params['region'] = $case['configuration']['region'];\n        }\n        if (!empty($case['configuration']['accessKey'])) {\n            $params['credentials'] = $this->createCredentials($case['configuration']);\n        }\n        return $params;\n    }\n\n    private function sendSocketShutdownMessage()\n    {\n        $socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);\n        socket_clear_error($socket);\n        socket_connect(\n            $socket,\n            $this->udpConfig['address'],\n            $this->udpConfig['port']\n        );\n        socket_write(\n            $socket,\n            $this->udpConfig['shutdown'],\n            strlen($this->udpConfig['shutdown'])\n        );\n        socket_close($socket);\n    }\n\n    private function startUdpServer()\n    {\n        set_time_limit(60);\n        $localPort = 0;\n        $remoteAddress = 0;\n        $socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);\n        socket_bind($socket, $this->udpConfig['address'], $this->udpConfig['port']);\n        $events = [];\n\n        while (true) {\n            socket_recvfrom($socket, $buf, 8096, 0, $remoteAddress, $localPort);\n\n            if ($buf == $this->udpConfig['shutdown']) {\n                file_put_contents(self::$outputFile, json_encode($events));\n                socket_close($socket);\n                exit();\n            }\n            $events[] = json_decode($buf, true);\n        }\n    }\n\n    private function validateEventValue($expected, $actual)\n    {\n        switch ($expected) {\n            case \"ANY_INT\":\n                $this->assertIsInt($actual);\n                break;\n            case \"ANY_STR\":\n                $this->assertIsString('string', $actual);\n                break;\n            default:\n                $this->assertEquals($expected, $actual);\n        }\n    }\n}\n", "num_lines": 450}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse GuzzleHttp\\Promise;\n\n/**\n * A configuration provider is a function that returns a promise that is\n * fulfilled with a configuration object. This class provides base functionality\n * usable by specific configuration provider implementations\n */\nabstract class AbstractConfigurationProvider\n{\n    const ENV_PROFILE = 'AWS_PROFILE';\n    const ENV_CONFIG_FILE = 'AWS_CONFIG_FILE';\n\n    public static $cacheKey;\n\n    protected static $interfaceClass;\n    protected static $exceptionClass;\n\n    /**\n     * Wraps a config provider and saves provided configuration in an\n     * instance of Aws\\CacheInterface. Forwards calls when no config found\n     * in cache and updates cache with the results.\n     *\n     * @param callable $provider Configuration provider function to wrap\n     * @param CacheInterface $cache Cache to store configuration\n     * @param string|null $cacheKey (optional) Cache key to use\n     *\n     * @return callable\n     */\n    public static function cache(\n        callable $provider,\n        CacheInterface $cache,\n        $cacheKey = null\n    ) {\n        $cacheKey = $cacheKey ?: static::$cacheKey;\n\n        return function () use ($provider, $cache, $cacheKey) {\n            $found = $cache->get($cacheKey);\n            if ($found instanceof static::$interfaceClass) {\n                return Promise\\Create::promiseFor($found);\n            }\n\n            return $provider()\n                ->then(function ($config) use (\n                    $cache,\n                    $cacheKey\n                ) {\n                    $cache->set($cacheKey, $config);\n                    return $config;\n                });\n        };\n    }\n\n    /**\n     * Creates an aggregate configuration provider that invokes the provided\n     * variadic providers one after the other until a provider returns\n     * configuration.\n     *\n     * @return callable\n     */\n    public static function chain()\n    {\n        $links = func_get_args();\n        if (empty($links)) {\n            throw new \\InvalidArgumentException('No providers in chain');\n        }\n\n        return function () use ($links) {\n            /** @var callable $parent */\n            $parent = array_shift($links);\n            $promise = $parent();\n            while ($next = array_shift($links)) {\n                $promise = $promise->otherwise($next);\n            }\n            return $promise;\n        };\n    }\n\n    /**\n     * Gets the environment's HOME directory if available.\n     *\n     * @return null|string\n     */\n    protected static function getHomeDir()\n    {\n        // On Linux/Unix-like systems, use the HOME environment variable\n        if ($homeDir = getenv('HOME')) {\n            return $homeDir;\n        }\n\n        // Get the HOMEDRIVE and HOMEPATH values for Windows hosts\n        $homeDrive = getenv('HOMEDRIVE');\n        $homePath = getenv('HOMEPATH');\n\n        return ($homeDrive && $homePath) ? $homeDrive . $homePath : null;\n    }\n\n    /**\n     * Gets default config file location from environment, falling back to aws\n     * default location\n     *\n     * @return string\n     */\n    protected static function getDefaultConfigFilename()\n    {\n        if ($filename = getenv(self::ENV_CONFIG_FILE)) {\n            return $filename;\n        }\n        return self::getHomeDir() . '/.aws/config';\n    }\n\n    /**\n     * Wraps a config provider and caches previously provided configuration.\n     *\n     * @param callable $provider Config provider function to wrap.\n     *\n     * @return callable\n     */\n    public static function memoize(callable $provider)\n    {\n        return function () use ($provider) {\n            static $result;\n            static $isConstant;\n\n            // Constant config will be returned constantly.\n            if ($isConstant) {\n                return $result;\n            }\n\n            // Create the initial promise that will be used as the cached value\n            if (null === $result) {\n                $result = $provider();\n            }\n\n            // Return config and set flag that provider is already set\n            return $result\n                ->then(function ($config) use (&$isConstant) {\n                    $isConstant = true;\n                    return $config;\n                });\n        };\n    }\n\n    /**\n     * Reject promise with standardized exception.\n     *\n     * @param $msg\n     * @return Promise\\RejectedPromise\n     */\n    protected static function reject($msg)\n    {\n        $exceptionClass = static::$exceptionClass;\n        return new Promise\\RejectedPromise(new $exceptionClass($msg));\n    }\n}\n", "num_lines": 158}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Api\\ApiProvider;\nuse Aws\\Api\\DocModel;\nuse Aws\\Api\\Service;\nuse Aws\\EndpointDiscovery\\EndpointDiscoveryMiddleware;\nuse Aws\\EndpointV2\\EndpointProviderV2;\nuse Aws\\Exception\\AwsException;\nuse Aws\\Signature\\SignatureProvider;\nuse GuzzleHttp\\Psr7\\Uri;\n\n/**\n * Default AWS client implementation\n */\nclass AwsClient implements AwsClientInterface\n{\n    use AwsClientTrait;\n\n    /** @var array */\n    private $aliases;\n\n    /** @var array */\n    private $config;\n\n    /** @var string */\n    private $region;\n\n    /** @var string */\n    private $endpoint;\n\n    /** @var Service */\n    private $api;\n\n    /** @var callable */\n    private $signatureProvider;\n\n    /** @var callable */\n    private $credentialProvider;\n\n    /** @var callable */\n    private $tokenProvider;\n\n    /** @var HandlerList */\n    private $handlerList;\n\n    /** @var array*/\n    private $defaultRequestOptions;\n\n    /** @var array*/\n    private $clientContextParams = [];\n\n    /** @var array*/\n    protected $clientBuiltIns = [];\n\n    /** @var  EndpointProviderV2 | callable */\n    protected $endpointProvider;\n\n    /** @var callable */\n    protected $serializer;\n\n    /**\n     * Get an array of client constructor arguments used by the client.\n     *\n     * @return array\n     */\n    public static function getArguments()\n    {\n        return ClientResolver::getDefaultArguments();\n    }\n\n    /**\n     * The client constructor accepts the following options:\n     *\n     * - api_provider: (callable) An optional PHP callable that accepts a\n     *   type, service, and version argument, and returns an array of\n     *   corresponding configuration data. The type value can be one of api,\n     *   waiter, or paginator.\n     * - credentials:\n     *   (Aws\\Credentials\\CredentialsInterface|array|bool|callable) Specifies\n     *   the credentials used to sign requests. Provide an\n     *   Aws\\Credentials\\CredentialsInterface object, an associative array of\n     *   \"key\", \"secret\", and an optional \"token\" key, `false` to use null\n     *   credentials, or a callable credentials provider used to create\n     *   credentials or return null. See Aws\\Credentials\\CredentialProvider for\n     *   a list of built-in credentials providers. If no credentials are\n     *   provided, the SDK will attempt to load them from the environment.\n     * - token:\n     *   (Aws\\Token\\TokenInterface|array|bool|callable) Specifies\n     *   the token used to authorize requests. Provide an\n     *   Aws\\Token\\TokenInterface object, an associative array of\n     *   \"token\" and an optional \"expires\" key, `false` to use no\n     *   token, or a callable token provider used to create a\n     *   token or return null. See Aws\\Token\\TokenProvider for\n     *   a list of built-in token providers. If no token is\n     *   provided, the SDK will attempt to load one from the environment.\n     * - csm:\n     *   (Aws\\ClientSideMonitoring\\ConfigurationInterface|array|callable) Specifies\n     *   the credentials used to sign requests. Provide an\n     *   Aws\\ClientSideMonitoring\\ConfigurationInterface object, a callable\n     *   configuration provider used to create client-side monitoring configuration,\n     *   `false` to disable csm, or an associative array with the following keys:\n     *   enabled: (bool) Set to true to enable client-side monitoring, defaults\n     *   to false; host: (string) the host location to send monitoring events to,\n     *   defaults to 127.0.0.1; port: (int) The port used for the host connection,\n     *   defaults to 31000; client_id: (string) An identifier for this project\n     * - debug: (bool|array) Set to true to display debug information when\n     *   sending requests. Alternatively, you can provide an associative array\n     *   with the following keys: logfn: (callable) Function that is invoked\n     *   with log messages; stream_size: (int) When the size of a stream is\n     *   greater than this number, the stream data will not be logged (set to\n     *   \"0\" to not log any stream data); scrub_auth: (bool) Set to false to\n     *   disable the scrubbing of auth data from the logged messages; http:\n     *   (bool) Set to false to disable the \"debug\" feature of lower level HTTP\n     *   adapters (e.g., verbose curl output).\n     * - stats: (bool|array) Set to true to gather transfer statistics on\n     *   requests sent. Alternatively, you can provide an associative array with\n     *   the following keys: retries: (bool) Set to false to disable reporting\n     *   on retries attempted; http: (bool) Set to true to enable collecting\n     *   statistics from lower level HTTP adapters (e.g., values returned in\n     *   GuzzleHttp\\TransferStats). HTTP handlers must support an\n     *   `http_stats_receiver` option for this to have an effect; timer: (bool)\n     *   Set to true to enable a command timer that reports the total wall clock\n     *   time spent on an operation in seconds.\n     * - disable_host_prefix_injection: (bool) Set to true to disable host prefix\n     *   injection logic for services that use it. This disables the entire\n     *   prefix injection, including the portions supplied by user-defined\n     *   parameters. Setting this flag will have no effect on services that do\n     *   not use host prefix injection.\n     * - endpoint: (string) The full URI of the webservice. This is only\n     *   required when connecting to a custom endpoint (e.g., a local version\n     *   of S3).\n     * - endpoint_discovery: (Aws\\EndpointDiscovery\\ConfigurationInterface,\n     *   Aws\\CacheInterface, array, callable) Settings for endpoint discovery.\n     *   Provide an instance of Aws\\EndpointDiscovery\\ConfigurationInterface,\n     *   an instance Aws\\CacheInterface, a callable that provides a promise for\n     *   a Configuration object, or an associative array with the following\n     *   keys: enabled: (bool) Set to true to enable endpoint discovery, false\n     *   to explicitly disable it, defaults to false; cache_limit: (int) The\n     *   maximum number of keys in the endpoints cache, defaults to 1000.\n     * - endpoint_provider: (callable) An optional PHP callable that\n     *   accepts a hash of options including a \"service\" and \"region\" key and\n     *   returns NULL or a hash of endpoint data, of which the \"endpoint\" key\n     *   is required. See Aws\\Endpoint\\EndpointProvider for a list of built-in\n     *   providers.\n     * - handler: (callable) A handler that accepts a command object,\n     *   request object and returns a promise that is fulfilled with an\n     *   Aws\\ResultInterface object or rejected with an\n     *   Aws\\Exception\\AwsException. A handler does not accept a next handler\n     *   as it is terminal and expected to fulfill a command. If no handler is\n     *   provided, a default Guzzle handler will be utilized.\n     * - http: (array, default=array(0)) Set to an array of SDK request\n     *   options to apply to each request (e.g., proxy, verify, etc.).\n     * - http_handler: (callable) An HTTP handler is a function that\n     *   accepts a PSR-7 request object and returns a promise that is fulfilled\n     *   with a PSR-7 response object or rejected with an array of exception\n     *   data. NOTE: This option supersedes any provided \"handler\" option.\n     * - idempotency_auto_fill: (bool|callable) Set to false to disable SDK to\n     *   populate parameters that enabled 'idempotencyToken' trait with a random\n     *   UUID v4 value on your behalf. Using default value 'true' still allows\n     *   parameter value to be overwritten when provided. Note: auto-fill only\n     *   works when cryptographically secure random bytes generator functions\n     *   (random_bytes, openssl_random_pseudo_bytes or mcrypt_create_iv) can be\n     *   found. You may also provide a callable source of random bytes.\n     * - profile: (string) Allows you to specify which profile to use when\n     *   credentials are created from the AWS credentials file in your HOME\n     *   directory. This setting overrides the AWS_PROFILE environment\n     *   variable. Note: Specifying \"profile\" will cause the \"credentials\" key\n     *   to be ignored.\n     * - region: (string, required) Region to connect to. See\n     *   http://docs.aws.amazon.com/general/latest/gr/rande.html for a list of\n     *   available regions.\n     * - retries: (int, Aws\\Retry\\ConfigurationInterface, Aws\\CacheInterface,\n     *   array, callable) Configures the retry mode and maximum number of\n     *   allowed retries for a client (pass 0 to disable retries). Provide an\n     *   integer for 'legacy' mode with the specified number of retries.\n     *   Otherwise provide an instance of Aws\\Retry\\ConfigurationInterface, an\n     *   instance of  Aws\\CacheInterface, a callable function, or an array with\n     *   the following keys: mode: (string) Set to 'legacy', 'standard' (uses\n     *   retry quota management), or 'adapative' (an experimental mode that adds\n     *   client-side rate limiting to standard mode); max_attempts (int) The\n     *   maximum number of attempts for a given request.\n     * - scheme: (string, default=string(5) \"https\") URI scheme to use when\n     *   connecting connect. The SDK will utilize \"https\" endpoints (i.e.,\n     *   utilize SSL/TLS connections) by default. You can attempt to connect to\n     *   a service over an unencrypted \"http\" endpoint by setting ``scheme`` to\n     *   \"http\".\n     * - signature_provider: (callable) A callable that accepts a signature\n     *   version name (e.g., \"v4\"), a service name, and region, and\n     *   returns a SignatureInterface object or null. This provider is used to\n     *   create signers utilized by the client. See\n     *   Aws\\Signature\\SignatureProvider for a list of built-in providers\n     * - signature_version: (string) A string representing a custom\n     *   signature version to use with a service (e.g., v4). Note that\n     *   per/operation signature version MAY override this requested signature\n     *   version.\n     * - use_aws_shared_config_files: (bool, default=bool(true)) Set to false to\n     *   disable checking for shared config file in '~/.aws/config' and\n     *   '~/.aws/credentials'.  This will override the AWS_CONFIG_FILE\n     *   environment variable.\n     * - validate: (bool, default=bool(true)) Set to false to disable\n     *   client-side parameter validation.\n     * - version: (string, required) The version of the webservice to\n     *   utilize (e.g., 2006-03-01).\n     *\n     * @param array $args Client configuration arguments.\n     *\n     * @throws \\InvalidArgumentException if any required options are missing or\n     *                                   the service is not supported.\n     */\n    public function __construct(array $args)\n    {\n        list($service, $exceptionClass) = $this->parseClass();\n        if (!isset($args['service'])) {\n            $args['service'] = manifest($service)['endpoint'];\n        }\n        if (!isset($args['exception_class'])) {\n            $args['exception_class'] = $exceptionClass;\n        }\n        $this->handlerList = new HandlerList();\n        $resolver = new ClientResolver(static::getArguments());\n        $config = $resolver->resolve($args, $this->handlerList);\n        $this->api = $config['api'];\n        $this->signatureProvider = $config['signature_provider'];\n        $this->endpoint = new Uri($config['endpoint']);\n        $this->credentialProvider = $config['credentials'];\n        $this->tokenProvider = $config['token'];\n        $this->region = isset($config['region']) ? $config['region'] : null;\n        $this->config = $config['config'];\n        $this->setClientBuiltIns($args);\n        $this->clientContextParams = $this->setClientContextParams($args);\n        $this->defaultRequestOptions = $config['http'];\n        $this->endpointProvider = $config['endpoint_provider'];\n        $this->serializer = $config['serializer'];\n        $this->addSignatureMiddleware();\n        $this->addInvocationId();\n        $this->addEndpointParameterMiddleware($args);\n        $this->addEndpointDiscoveryMiddleware($config, $args);\n        $this->addRequestCompressionMiddleware($config);\n        $this->loadAliases();\n        $this->addStreamRequestPayload();\n        $this->addRecursionDetection();\n        $this->addRequestBuilder();\n\n        if (!$config['suppress_php_deprecation_warning']) {\n            $this->emitDeprecationWarning();\n        }\n\n        if (isset($args['with_resolved'])) {\n            $args['with_resolved']($config);\n        }\n    }\n\n    public function getHandlerList()\n    {\n        return $this->handlerList;\n    }\n\n    public function getConfig($option = null)\n    {\n        return $option === null\n            ? $this->config\n            : (isset($this->config[$option])\n                ? $this->config[$option]\n                : null);\n    }\n\n    public function getCredentials()\n    {\n        $fn = $this->credentialProvider;\n        return $fn();\n    }\n\n\n    public function getEndpoint()\n    {\n        return $this->endpoint;\n    }\n\n    public function getRegion()\n    {\n        return $this->region;\n    }\n\n    public function getApi()\n    {\n        return $this->api;\n    }\n\n    public function getCommand($name, array $args = [])\n    {\n        // Fail fast if the command cannot be found in the description.\n        if (!isset($this->getApi()['operations'][$name])) {\n            $name = ucfirst($name);\n            if (!isset($this->getApi()['operations'][$name])) {\n                throw new \\InvalidArgumentException(\"Operation not found: $name\");\n            }\n        }\n\n        if (!isset($args['@http'])) {\n            $args['@http'] = $this->defaultRequestOptions;\n        } else {\n            $args['@http'] += $this->defaultRequestOptions;\n        }\n\n        return new Command($name, $args, clone $this->getHandlerList());\n    }\n\n    public function getEndpointProvider()\n    {\n        return $this->endpointProvider;\n    }\n\n    /**\n     * Provides the set of service context parameter\n     * key-value pairs used for endpoint resolution.\n     *\n     * @return array\n     */\n    public function getClientContextParams()\n    {\n        return $this->clientContextParams;\n    }\n\n    /**\n     * Provides the set of built-in keys and values\n     * used for endpoint resolution\n     *\n     * @return array\n     */\n    public function getClientBuiltIns()\n    {\n        return $this->clientBuiltIns;\n    }\n\n    public function __sleep()\n    {\n        throw new \\RuntimeException('Instances of ' . static::class\n            . ' cannot be serialized');\n    }\n\n    /**\n     * Get the signature_provider function of the client.\n     *\n     * @return callable\n     */\n    final public function getSignatureProvider()\n    {\n        return $this->signatureProvider;\n    }\n\n    /**\n     * Parse the class name and setup the custom exception class of the client\n     * and return the \"service\" name of the client and \"exception_class\".\n     *\n     * @return array\n     */\n    private function parseClass()\n    {\n        $klass = get_class($this);\n\n        if ($klass === __CLASS__) {\n            return ['', AwsException::class];\n        }\n\n        $service = substr($klass, strrpos($klass, '\\\\') + 1, -6);\n\n        return [\n            strtolower($service),\n            \"Aws\\\\{$service}\\\\Exception\\\\{$service}Exception\"\n        ];\n    }\n\n    private function addEndpointParameterMiddleware($args)\n    {\n        if (empty($args['disable_host_prefix_injection'])) {\n            $list = $this->getHandlerList();\n            $list->appendBuild(\n                EndpointParameterMiddleware::wrap(\n                    $this->api\n                ),\n                'endpoint_parameter'\n            );\n        }\n    }\n\n    private function addEndpointDiscoveryMiddleware($config, $args)\n    {\n        $list = $this->getHandlerList();\n\n        if (!isset($args['endpoint'])) {\n            $list->appendBuild(\n                EndpointDiscoveryMiddleware::wrap(\n                    $this,\n                    $args,\n                    $config['endpoint_discovery']\n                ),\n                'EndpointDiscoveryMiddleware'\n            );\n        }\n    }\n\n    private function addSignatureMiddleware()\n    {\n        $api = $this->getApi();\n        $provider = $this->signatureProvider;\n        $version = $this->config['signature_version'];\n        $name = $this->config['signing_name'];\n        $region = $this->config['signing_region'];\n\n        $resolver = static function (\n            CommandInterface $c\n        ) use ($api, $provider, $name, $region, $version) {\n            if (!empty($c['@context']['signing_region'])) {\n                $region = $c['@context']['signing_region'];\n            }\n            if (!empty($c['@context']['signing_service'])) {\n                $name = $c['@context']['signing_service'];\n            }\n\n            $authType = $api->getOperation($c->getName())['authtype'];\n            switch ($authType){\n                case 'none':\n                    $version = 'anonymous';\n                    break;\n                case 'v4-unsigned-body':\n                    $version = 'v4-unsigned-body';\n                    break;\n                case 'bearer':\n                    $version = 'bearer';\n                    break;\n            }\n            if (isset($c['@context']['signature_version'])) {\n                if ($c['@context']['signature_version'] == 'v4a') {\n                    $version = 'v4a';\n                }\n            }\n            if (!empty($endpointAuthSchemes = $c->getAuthSchemes())) {\n                $version = $endpointAuthSchemes['version'];\n                $name = isset($endpointAuthSchemes['name']) ?\n                    $endpointAuthSchemes['name'] : $name;\n                $region = isset($endpointAuthSchemes['region']) ?\n                    $endpointAuthSchemes['region'] : $region;\n            }\n            return SignatureProvider::resolve($provider, $version, $name, $region);\n        };\n        $this->handlerList->appendSign(\n            Middleware::signer($this->credentialProvider, $resolver, $this->tokenProvider),\n            'signer'\n        );\n    }\n\n    private function addRequestCompressionMiddleware($config)\n    {\n        if (empty($config['disable_request_compression'])) {\n            $list = $this->getHandlerList();\n            $list->appendBuild(\n                RequestCompressionMiddleware::wrap($config),\n                'request-compression'\n            );\n        }\n    }\n\n    private function addInvocationId()\n    {\n        // Add invocation id to each request\n        $this->handlerList->prependSign(Middleware::invocationId(), 'invocation-id');\n    }\n\n    private function loadAliases($file = null)\n    {\n        if (!isset($this->aliases)) {\n            if (is_null($file)) {\n                $file = __DIR__ . '/data/aliases.json';\n            }\n            $aliases = \\Aws\\load_compiled_json($file);\n            $serviceId = $this->api->getServiceId();\n            $version = $this->getApi()->getApiVersion();\n            if (!empty($aliases['operations'][$serviceId][$version])) {\n                $this->aliases = array_flip($aliases['operations'][$serviceId][$version]);\n            }\n        }\n    }\n\n    private function addStreamRequestPayload()\n    {\n        $streamRequestPayloadMiddleware = StreamRequestPayloadMiddleware::wrap(\n            $this->api\n        );\n\n        $this->handlerList->prependSign(\n            $streamRequestPayloadMiddleware,\n            'StreamRequestPayloadMiddleware'\n        );\n    }\n\n    private function addRecursionDetection()\n    {\n        // Add recursion detection header to requests\n        // originating in supported Lambda runtimes\n        $this->handlerList->appendBuild(\n            Middleware::recursionDetection(), 'recursion-detection'\n        );\n    }\n\n    /**\n     * Adds the `builder` middleware such that a client's endpoint\n     * provider and endpoint resolution arguments can be passed.\n     */\n    private function addRequestBuilder()\n    {\n        $handlerList = $this->getHandlerList();\n        $serializer = $this->serializer;\n        $endpointProvider = $this->endpointProvider;\n        $endpointArgs = $this->getEndpointProviderArgs();\n\n        $handlerList->prependBuild(\n            Middleware::requestBuilder(\n                $serializer,\n                $endpointProvider,\n                $endpointArgs\n            ),\n            'builderV2'\n        );\n    }\n\n    /**\n     * Retrieves client context param definition from service model,\n     * creates mapping of client context param names with client-provided\n     * values.\n     *\n     * @return array\n     */\n    private function setClientContextParams($args)\n    {\n        $api = $this->getApi();\n        $resolvedParams = [];\n        if (!empty($paramDefinitions = $api->getClientContextParams())) {\n            foreach($paramDefinitions as $paramName => $paramValue) {\n                if (isset($args[$paramName])) {\n                   $result[$paramName] = $args[$paramName];\n               }\n            }\n        }\n        return $resolvedParams;\n    }\n\n    /**\n     * Retrieves and sets default values used for endpoint resolution.\n     */\n    private function setClientBuiltIns($args)\n    {\n        $builtIns = [];\n        $config = $this->getConfig();\n        $service = $args['service'];\n\n        $builtIns['SDK::Endpoint'] = isset($args['endpoint']) ? $args['endpoint'] : null;\n        $builtIns['AWS::Region'] = $this->getRegion();\n        $builtIns['AWS::UseFIPS'] = $config['use_fips_endpoint']->isUseFipsEndpoint();\n        $builtIns['AWS::UseDualStack'] = $config['use_dual_stack_endpoint']->isUseDualstackEndpoint();\n        if ($service === 's3' || $service === 's3control'){\n            $builtIns['AWS::S3::UseArnRegion'] = $config['use_arn_region']->isUseArnRegion();\n        }\n        if ($service === 's3') {\n            $builtIns['AWS::S3::UseArnRegion'] = $config['use_arn_region']->isUseArnRegion();\n            $builtIns['AWS::S3::Accelerate'] = $config['use_accelerate_endpoint'];\n            $builtIns['AWS::S3::ForcePathStyle'] = $config['use_path_style_endpoint'];\n            $builtIns['AWS::S3::DisableMultiRegionAccessPoints'] = $config['disable_multiregion_access_points'];\n        }\n        $this->clientBuiltIns += $builtIns;\n    }\n\n    /**\n     * Retrieves arguments to be used in endpoint resolution.\n     *\n     * @return array\n     */\n    public function getEndpointProviderArgs()\n    {\n        return $this->normalizeEndpointProviderArgs();\n    }\n\n    /**\n     * Combines built-in and client context parameter values in\n     * order of specificity.  Client context parameter values supersede\n     * built-in values.\n     *\n     * @return array\n     */\n    private function normalizeEndpointProviderArgs()\n    {\n        $normalizedBuiltIns = [];\n\n        foreach($this->clientBuiltIns as $name => $value) {\n            $normalizedName = explode('::', $name);\n            $normalizedName = $normalizedName[count($normalizedName) - 1];\n            $normalizedBuiltIns[$normalizedName] = $value;\n        }\n\n        return array_merge($normalizedBuiltIns, $this->getClientContextParams());\n    }\n\n    protected function isUseEndpointV2()\n    {\n        return $this->endpointProvider instanceof EndpointProviderV2;\n    }\n\n    public static function emitDeprecationWarning() {\n        $phpVersion = PHP_VERSION_ID;\n        if ($phpVersion <  70205) {\n            $phpVersionString = phpversion();\n            @trigger_error(\n                \"This installation of the SDK is using PHP version\"\n                .  \" {$phpVersionString}, which will be deprecated on August\"\n                .  \" 15th, 2023.  Please upgrade your PHP version to a minimum of\"\n                .  \" 7.2.5 before then to continue receiving updates to the AWS\"\n                .  \" SDK for PHP.  To disable this warning, set\"\n                .  \" suppress_php_deprecation_warning to true on the client constructor\"\n                .  \" or set the environment variable AWS_SUPPRESS_PHP_DEPRECATION_WARNING\"\n                .  \" to true.\",\n                E_USER_DEPRECATED\n            );\n        }\n    }\n\n\n    /**\n     * Returns a service model and doc model with any necessary changes\n     * applied.\n     *\n     * @param array $api  Array of service data being documented.\n     * @param array $docs Array of doc model data.\n     *\n     * @return array Tuple containing a [Service, DocModel]\n     *\n     * @internal This should only used to document the service API.\n     * @codeCoverageIgnore\n     */\n    public static function applyDocFilters(array $api, array $docs)\n    {\n        $aliases = \\Aws\\load_compiled_json(__DIR__ . '/data/aliases.json');\n        $serviceId = $api['metadata']['serviceId'];\n        $version = $api['metadata']['apiVersion'];\n\n        // Replace names for any operations with SDK aliases\n        if (!empty($aliases['operations'][$serviceId][$version])) {\n            foreach ($aliases['operations'][$serviceId][$version] as $op => $alias) {\n                $api['operations'][$alias] = $api['operations'][$op];\n                $docs['operations'][$alias] = $docs['operations'][$op];\n                unset($api['operations'][$op], $docs['operations'][$op]);\n            }\n        }\n        ksort($api['operations']);\n\n        return [\n            new Service($api, ApiProvider::defaultProvider()),\n            new DocModel($docs)\n        ];\n    }\n\n    /**\n     * @deprecated\n     * @return static\n     */\n    public static function factory(array $config = [])\n    {\n        return new static($config);\n    }\n}\n", "num_lines": 670}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Psr\\Http\\Message\\UriInterface;\nuse GuzzleHttp\\Promise\\PromiseInterface;\n\n/**\n * Represents an AWS client.\n */\ninterface AwsClientInterface\n{\n    /**\n     * Creates and executes a command for an operation by name.\n     *\n     * Suffixing an operation name with \"Async\" will return a\n     * promise that can be used to execute commands asynchronously.\n     *\n     * @param string $name      Name of the command to execute.\n     * @param array  $arguments Arguments to pass to the getCommand method.\n     *\n     * @return ResultInterface\n     * @throws \\Exception\n     */\n    public function __call($name, array $arguments);\n\n    /**\n     * Create a command for an operation name.\n     *\n     * Special keys may be set on the command to control how it behaves,\n     * including:\n     *\n     * - @http: Associative array of transfer specific options to apply to the\n     *   request that is serialized for this command. Available keys include\n     *   \"proxy\", \"verify\", \"timeout\", \"connect_timeout\", \"debug\", \"delay\", and\n     *   \"headers\".\n     *\n     * @param string $name Name of the operation to use in the command\n     * @param array  $args Arguments to pass to the command\n     *\n     * @return CommandInterface\n     * @throws \\InvalidArgumentException if no command can be found by name\n     */\n    public function getCommand($name, array $args = []);\n\n    /**\n     * Execute a single command.\n     *\n     * @param CommandInterface $command Command to execute\n     *\n     * @return ResultInterface\n     * @throws \\Exception\n     */\n    public function execute(CommandInterface $command);\n\n    /**\n     * Execute a command asynchronously.\n     *\n     * @param CommandInterface $command Command to execute\n     *\n     * @return \\GuzzleHttp\\Promise\\PromiseInterface\n     */\n    public function executeAsync(CommandInterface $command);\n\n    /**\n     * Returns a promise that is fulfilled with an\n     * {@see \\Aws\\Credentials\\CredentialsInterface} object.\n     *\n     * If you need the credentials synchronously, then call the wait() method\n     * on the returned promise.\n     *\n     * @return PromiseInterface\n     */\n    public function getCredentials();\n\n    /**\n     * Get the region to which the client is configured to send requests.\n     *\n     * @return string\n     */\n    public function getRegion();\n\n    /**\n     * Gets the default endpoint, or base URL, used by the client.\n     *\n     * @return UriInterface\n     */\n    public function getEndpoint();\n\n    /**\n     * Get the service description associated with the client.\n     *\n     * @return \\Aws\\Api\\Service\n     */\n    public function getApi();\n\n    /**\n     * Get a client configuration value.\n     *\n     * @param string|null $option The option to retrieve. Pass null to retrieve\n     *                            all options.\n     * @return mixed|null\n     */\n    public function getConfig($option = null);\n\n    /**\n     * Get the handler list used to transfer commands.\n     *\n     * This list can be modified to add middleware or to change the underlying\n     * handler used to send HTTP requests.\n     *\n     * @return HandlerList\n     */\n    public function getHandlerList();\n\n    /**\n     * Get a resource iterator for the specified operation.\n     *\n     * @param string $name Name of the iterator to retrieve.\n     * @param array  $args Command arguments to use with each command.\n     *\n     * @return \\Iterator\n     * @throws \\UnexpectedValueException if the iterator config is invalid.\n     */\n    public function getIterator($name, array $args = []);\n\n    /**\n     * Get a result paginator for the specified operation.\n     *\n     * @param string $name   Name of the operation used for iterator\n     * @param array  $args   Command args to be used with each command\n     *\n     * @return \\Aws\\ResultPaginator\n     * @throws \\UnexpectedValueException if the iterator config is invalid.\n     */\n    public function getPaginator($name, array $args = []);\n\n    /**\n     * Wait until a resource is in a particular state.\n     *\n     * @param string|callable $name Name of the waiter that defines the wait\n     *                              configuration and conditions.\n     * @param array  $args          Args to be used with each command executed\n     *                              by the waiter. Waiter configuration options\n     *                              can be provided in an associative array in\n     *                              the @waiter key.\n     * @return void\n     * @throws \\UnexpectedValueException if the waiter is invalid.\n     */\n    public function waitUntil($name, array $args = []);\n\n    /**\n     * Get a waiter that waits until a resource is in a particular state.\n     *\n     * Retrieving a waiter can be useful when you wish to wait asynchronously:\n     *\n     *     $waiter = $client->getWaiter('foo', ['bar' => 'baz']);\n     *     $waiter->promise()->then(function () { echo 'Done!'; });\n     *\n     * @param string|callable $name Name of the waiter that defines the wait\n     *                              configuration and conditions.\n     * @param array  $args          Args to be used with each command executed\n     *                              by the waiter. Waiter configuration options\n     *                              can be provided in an associative array in\n     *                              the @waiter key.\n     * @return \\Aws\\Waiter\n     * @throws \\UnexpectedValueException if the waiter is invalid.\n     */\n    public function getWaiter($name, array $args = []);\n}\n", "num_lines": 170}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Api\\Service;\n\n/**\n * A trait providing generic functionality for interacting with Amazon Web\n * Services. This is meant to be used in classes implementing\n * \\Aws\\AwsClientInterface\n */\ntrait AwsClientTrait\n{\n    public function getPaginator($name, array $args = [])\n    {\n        $config = $this->getApi()->getPaginatorConfig($name);\n\n        return new ResultPaginator($this, $name, $args, $config);\n    }\n\n    public function getIterator($name, array $args = [])\n    {\n        $config = $this->getApi()->getPaginatorConfig($name);\n        if (!$config['result_key']) {\n            throw new \\UnexpectedValueException(sprintf(\n                'There are no resources to iterate for the %s operation of %s',\n                $name, $this->getApi()['serviceFullName']\n            ));\n        }\n\n        $key = is_array($config['result_key'])\n            ? $config['result_key'][0]\n            : $config['result_key'];\n\n        if ($config['output_token'] && $config['input_token']) {\n            return $this->getPaginator($name, $args)->search($key);\n        }\n\n        $result = $this->execute($this->getCommand($name, $args))->search($key);\n\n        return new \\ArrayIterator((array) $result);\n    }\n\n    public function waitUntil($name, array $args = [])\n    {\n        return $this->getWaiter($name, $args)->promise()->wait();\n    }\n\n    public function getWaiter($name, array $args = [])\n    {\n        $config = isset($args['@waiter']) ? $args['@waiter'] : [];\n        $config += $this->getApi()->getWaiterConfig($name);\n\n        return new Waiter($this, $name, $args, $config);\n    }\n\n    public function execute(CommandInterface $command)\n    {\n        return $this->executeAsync($command)->wait();\n    }\n\n    public function executeAsync(CommandInterface $command)\n    {\n        $handler = $command->getHandlerList()->resolve();\n        return $handler($command);\n    }\n\n    public function __call($name, array $args)\n    {\n        if (substr($name, -5) === 'Async') {\n            $name = substr($name, 0, -5);\n            $isAsync = true;\n        }\n\n        if (!empty($this->aliases[ucfirst($name)])) {\n            $name = $this->aliases[ucfirst($name)];\n        }\n\n        $params = isset($args[0]) ? $args[0] : [];\n\n        if (!empty($isAsync)) {\n            return $this->executeAsync(\n                $this->getCommand($name, $params)\n            );\n        }\n\n        return $this->execute($this->getCommand($name, $params));\n    }\n\n    /**\n     * @param string $name\n     * @param array $args\n     *\n     * @return CommandInterface\n     */\n    abstract public function getCommand($name, array $args = []);\n\n    /**\n     * @return Service\n     */\n    abstract public function getApi();\n}\n", "num_lines": 102}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\n/**\n * Represents a simple cache interface.\n */\ninterface CacheInterface\n{\n    /**\n     * Get a cache item by key.\n     *\n     * @param string $key Key to retrieve.\n     *\n     * @return mixed|null Returns the value or null if not found.\n     */\n    public function get($key);\n\n    /**\n     * Set a cache key value.\n     *\n     * @param string $key   Key to set\n     * @param mixed  $value Value to set.\n     * @param int    $ttl   Number of seconds the item is allowed to live. Set\n     *                      to 0 to allow an unlimited lifetime.\n     */\n    public function set($key, $value, $ttl = 0);\n\n    /**\n     * Remove a cache key.\n     *\n     * @param string $key Key to remove.\n     */\n    public function remove($key);\n}\n", "num_lines": 35}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Api\\ApiProvider;\nuse Aws\\Api\\Service;\nuse Aws\\Api\\Validator;\nuse Aws\\ClientSideMonitoring\\ApiCallAttemptMonitoringMiddleware;\nuse Aws\\ClientSideMonitoring\\ApiCallMonitoringMiddleware;\nuse Aws\\ClientSideMonitoring\\Configuration;\nuse Aws\\Configuration\\ConfigurationResolver;\nuse Aws\\Credentials\\CredentialProvider;\nuse Aws\\Credentials\\Credentials;\nuse Aws\\Credentials\\CredentialsInterface;\nuse Aws\\DefaultsMode\\ConfigurationInterface as ConfigModeInterface;\nuse Aws\\DefaultsMode\\ConfigurationProvider as ConfigModeProvider;\nuse Aws\\Endpoint\\EndpointProvider;\nuse Aws\\Endpoint\\PartitionEndpointProvider;\nuse Aws\\Endpoint\\UseDualstackEndpoint\\Configuration as UseDualStackEndpointConfiguration;\nuse Aws\\Endpoint\\UseDualstackEndpoint\\ConfigurationInterface as UseDualStackEndpointConfigurationInterface;\nuse Aws\\Endpoint\\UseDualstackEndpoint\\ConfigurationProvider as UseDualStackConfigProvider;\nuse Aws\\Endpoint\\UseFipsEndpoint\\Configuration as UseFipsEndpointConfiguration;\nuse Aws\\Endpoint\\UseFipsEndpoint\\ConfigurationInterface as UseFipsEndpointConfigurationInterface;\nuse Aws\\Endpoint\\UseFipsEndpoint\\ConfigurationProvider as UseFipsConfigProvider;\nuse Aws\\EndpointDiscovery\\ConfigurationInterface;\nuse Aws\\EndpointDiscovery\\ConfigurationProvider;\nuse Aws\\EndpointV2\\EndpointDefinitionProvider;\nuse Aws\\Exception\\AwsException;\nuse Aws\\Exception\\InvalidRegionException;\nuse Aws\\Retry\\ConfigurationInterface as RetryConfigInterface;\nuse Aws\\Retry\\ConfigurationProvider as RetryConfigProvider;\nuse Aws\\Signature\\SignatureProvider;\nuse Aws\\Token\\Token;\nuse Aws\\Token\\TokenInterface;\nuse Aws\\Token\\TokenProvider;\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse InvalidArgumentException as IAE;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * @internal Resolves a hash of client arguments to construct a client.\n */\nclass ClientResolver\n{\n    /** @var array */\n    private $argDefinitions;\n\n    /** @var array Map of types to a corresponding function */\n    private static $typeMap = [\n        'resource' => 'is_resource',\n        'callable' => 'is_callable',\n        'int'      => 'is_int',\n        'bool'     => 'is_bool',\n        'boolean'  => 'is_bool',\n        'string'   => 'is_string',\n        'object'   => 'is_object',\n        'array'    => 'is_array',\n    ];\n\n    private static $defaultArgs = [\n        'service' => [\n            'type'     => 'value',\n            'valid'    => ['string'],\n            'doc'      => 'Name of the service to utilize. This value will be supplied by default when using one of the SDK clients (e.g., Aws\\\\S3\\\\S3Client).',\n            'required' => true,\n            'internal' => true\n        ],\n        'exception_class' => [\n            'type'     => 'value',\n            'valid'    => ['string'],\n            'doc'      => 'Exception class to create when an error occurs.',\n            'default'  => AwsException::class,\n            'internal' => true\n        ],\n        'scheme' => [\n            'type'     => 'value',\n            'valid'    => ['string'],\n            'default'  => 'https',\n            'doc'      => 'URI scheme to use when connecting connect. The SDK will utilize \"https\" endpoints (i.e., utilize SSL/TLS connections) by default. You can attempt to connect to a service over an unencrypted \"http\" endpoint by setting ``scheme`` to \"http\".',\n        ],\n        'disable_host_prefix_injection' => [\n            'type'      => 'value',\n            'valid'     => ['bool'],\n            'doc'       => 'Set to true to disable host prefix injection logic for services that use it. This disables the entire prefix injection, including the portions supplied by user-defined parameters. Setting this flag will have no effect on services that do not use host prefix injection.',\n            'default'   => false,\n        ],\n        'endpoint' => [\n            'type'  => 'value',\n            'valid' => ['string'],\n            'doc'   => 'The full URI of the webservice. This is only required when connecting to a custom endpoint (e.g., a local version of S3).',\n            'fn'    => [__CLASS__, '_apply_endpoint'],\n        ],\n        'region' => [\n            'type'     => 'value',\n            'valid'    => ['string'],\n            'required' => [__CLASS__, '_missing_region'],\n            'doc'      => 'Region to connect to. See http://docs.aws.amazon.com/general/latest/gr/rande.html for a list of available regions.',\n        ],\n        'version' => [\n            'type'     => 'value',\n            'valid'    => ['string'],\n            'required' => [__CLASS__, '_missing_version'],\n            'doc'      => 'The version of the webservice to utilize (e.g., 2006-03-01).',\n        ],\n        'signature_provider' => [\n            'type'    => 'value',\n            'valid'   => ['callable'],\n            'doc'     => 'A callable that accepts a signature version name (e.g., \"v4\"), a service name, and region, and  returns a SignatureInterface object or null. This provider is used to create signers utilized by the client. See Aws\\\\Signature\\\\SignatureProvider for a list of built-in providers',\n            'default' => [__CLASS__, '_default_signature_provider'],\n        ],\n        'api_provider' => [\n            'type'     => 'value',\n            'valid'    => ['callable'],\n            'doc'      => 'An optional PHP callable that accepts a type, service, and version argument, and returns an array of corresponding configuration data. The type value can be one of api, waiter, or paginator.',\n            'fn'       => [__CLASS__, '_apply_api_provider'],\n            'default'  => [ApiProvider::class, 'defaultProvider'],\n        ],\n        'configuration_mode' => [\n            'type'    => 'value',\n            'valid'   => [ConfigModeInterface::class, CacheInterface::class, 'string', 'closure'],\n            'doc'     => \"Sets the default configuration mode. Otherwise provide an instance of Aws\\DefaultsMode\\ConfigurationInterface, an instance of  Aws\\CacheInterface, or a string containing a valid mode\",\n            'fn'      => [__CLASS__, '_apply_defaults'],\n            'default' => [ConfigModeProvider::class, 'defaultProvider']\n        ],\n        'use_fips_endpoint' => [\n            'type'      => 'value',\n            'valid'     => ['bool', UseFipsEndpointConfiguration::class, CacheInterface::class, 'callable'],\n            'doc'       => 'Set to true to enable the use of FIPS pseudo regions',\n            'fn'        => [__CLASS__, '_apply_use_fips_endpoint'],\n            'default'   => [__CLASS__, '_default_use_fips_endpoint'],\n        ],\n        'use_dual_stack_endpoint' => [\n            'type'      => 'value',\n            'valid'     => ['bool', UseDualStackEndpointConfiguration::class, CacheInterface::class, 'callable'],\n            'doc'       => 'Set to true to enable the use of dual-stack endpoints',\n            'fn'        => [__CLASS__, '_apply_use_dual_stack_endpoint'],\n            'default'   => [__CLASS__, '_default_use_dual_stack_endpoint'],\n        ],\n        'endpoint_provider' => [\n            'type'     => 'value',\n            'valid'    => ['callable', EndpointV2\\EndpointProviderV2::class],\n            'fn'       => [__CLASS__, '_apply_endpoint_provider'],\n            'doc'      => 'An optional PHP callable that accepts a hash of options including a \"service\" and \"region\" key and returns NULL or a hash of endpoint data, of which the \"endpoint\" key is required. See Aws\\\\Endpoint\\\\EndpointProvider for a list of built-in providers.',\n            'default'  => [__CLASS__, '_default_endpoint_provider'],\n        ],\n        'serializer' => [\n            'default'   => [__CLASS__, '_default_serializer'],\n            'internal'  => true,\n            'type'      => 'value',\n            'valid'     => ['callable'],\n        ],\n        'signature_version' => [\n            'type'    => 'config',\n            'valid'   => ['string'],\n            'doc'     => 'A string representing a custom signature version to use with a service (e.g., v4). Note that per/operation signature version MAY override this requested signature version.',\n            'default' => [__CLASS__, '_default_signature_version'],\n        ],\n        'signing_name' => [\n            'type'    => 'config',\n            'valid'   => ['string'],\n            'doc'     => 'A string representing a custom service name to be used when calculating a request signature.',\n            'default' => [__CLASS__, '_default_signing_name'],\n        ],\n        'signing_region' => [\n            'type'    => 'config',\n            'valid'   => ['string'],\n            'doc'     => 'A string representing a custom region name to be used when calculating a request signature.',\n            'default' => [__CLASS__, '_default_signing_region'],\n        ],\n        'profile' => [\n            'type'  => 'config',\n            'valid' => ['string'],\n            'doc'   => 'Allows you to specify which profile to use when credentials are created from the AWS credentials file in your HOME directory. This setting overrides the AWS_PROFILE environment variable. Note: Specifying \"profile\" will cause the \"credentials\" and \"use_aws_shared_config_files\" keys to be ignored.',\n            'fn'    => [__CLASS__, '_apply_profile'],\n        ],\n        'credentials' => [\n            'type'    => 'value',\n            'valid'   => [CredentialsInterface::class, CacheInterface::class, 'array', 'bool', 'callable'],\n            'doc'     => 'Specifies the credentials used to sign requests. Provide an Aws\\Credentials\\CredentialsInterface object, an associative array of \"key\", \"secret\", and an optional \"token\" key, `false` to use null credentials, or a callable credentials provider used to create credentials or return null. See Aws\\\\Credentials\\\\CredentialProvider for a list of built-in credentials providers. If no credentials are provided, the SDK will attempt to load them from the environment.',\n            'fn'      => [__CLASS__, '_apply_credentials'],\n            'default' => [__CLASS__, '_default_credential_provider'],\n        ],\n        'token' => [\n            'type'    => 'value',\n            'valid'   => [TokenInterface::class, CacheInterface::class, 'array', 'bool', 'callable'],\n            'doc'     => 'Specifies the token used to authorize requests. Provide an Aws\\Token\\TokenInterface object, an associative array of \"token\", and an optional \"expiration\" key, `false` to use a null token, or a callable token provider used to fetch a token or return null. See Aws\\\\Token\\\\TokenProvider for a list of built-in credentials providers. If no token is provided, the SDK will attempt to load one from the environment.',\n            'fn'      => [__CLASS__, '_apply_token'],\n            'default' => [__CLASS__, '_default_token_provider'],\n        ],\n        'endpoint_discovery' => [\n            'type'     => 'value',\n            'valid'    => [ConfigurationInterface::class, CacheInterface::class, 'array', 'callable'],\n            'doc'      => 'Specifies settings for endpoint discovery. Provide an instance of Aws\\EndpointDiscovery\\ConfigurationInterface, an instance Aws\\CacheInterface, a callable that provides a promise for a Configuration object, or an associative array with the following keys: enabled: (bool) Set to true to enable endpoint discovery, false to explicitly disable it. Defaults to false; cache_limit: (int) The maximum number of keys in the endpoints cache. Defaults to 1000.',\n            'fn'       => [__CLASS__, '_apply_endpoint_discovery'],\n            'default'  => [__CLASS__, '_default_endpoint_discovery_provider']\n        ],\n        'stats' => [\n            'type'  => 'value',\n            'valid' => ['bool', 'array'],\n            'default' => false,\n            'doc'   => 'Set to true to gather transfer statistics on requests sent. Alternatively, you can provide an associative array with the following keys: retries: (bool) Set to false to disable reporting on retries attempted; http: (bool) Set to true to enable collecting statistics from lower level HTTP adapters (e.g., values returned in GuzzleHttp\\TransferStats). HTTP handlers must support an http_stats_receiver option for this to have an effect; timer: (bool) Set to true to enable a command timer that reports the total wall clock time spent on an operation in seconds.',\n            'fn'    => [__CLASS__, '_apply_stats'],\n        ],\n        'retries' => [\n            'type'    => 'value',\n            'valid'   => ['int', RetryConfigInterface::class, CacheInterface::class, 'callable', 'array'],\n            'doc'     => \"Configures the retry mode and maximum number of allowed retries for a client (pass 0 to disable retries). Provide an integer for 'legacy' mode with the specified number of retries. Otherwise provide an instance of Aws\\Retry\\ConfigurationInterface, an instance of  Aws\\CacheInterface, a callable function, or an array with the following keys: mode: (string) Set to 'legacy', 'standard' (uses retry quota management), or 'adapative' (an experimental mode that adds client-side rate limiting to standard mode); max_attempts: (int) The maximum number of attempts for a given request. \",\n            'fn'      => [__CLASS__, '_apply_retries'],\n            'default' => [RetryConfigProvider::class, 'defaultProvider']\n        ],\n        'validate' => [\n            'type'    => 'value',\n            'valid'   => ['bool', 'array'],\n            'default' => true,\n            'doc'     => 'Set to false to disable client-side parameter validation. Set to true to utilize default validation constraints. Set to an associative array of validation options to enable specific validation constraints.',\n            'fn'      => [__CLASS__, '_apply_validate'],\n        ],\n        'debug' => [\n            'type'  => 'value',\n            'valid' => ['bool', 'array'],\n            'doc'   => 'Set to true to display debug information when sending requests. Alternatively, you can provide an associative array with the following keys: logfn: (callable) Function that is invoked with log messages; stream_size: (int) When the size of a stream is greater than this number, the stream data will not be logged (set to \"0\" to not log any stream data); scrub_auth: (bool) Set to false to disable the scrubbing of auth data from the logged messages; http: (bool) Set to false to disable the \"debug\" feature of lower level HTTP adapters (e.g., verbose curl output).',\n            'fn'    => [__CLASS__, '_apply_debug'],\n        ],\n        'disable_request_compression' => [\n            'type'      => 'value',\n            'valid'     => ['bool', 'callable'],\n            'doc'       => 'Set to true to disable request compression for supported operations',\n            'fn'        => [__CLASS__, '_apply_disable_request_compression'],\n            'default'   => [__CLASS__, '_default_disable_request_compression'],\n        ],\n        'request_min_compression_size_bytes' => [\n            'type'      => 'value',\n            'valid'     => ['int', 'callable'],\n            'doc'       => 'Set to a value between between 0 and 10485760 bytes, inclusive. This value will be ignored if `disable_request_compression` is set to `true`',\n            'fn'        => [__CLASS__, '_apply_min_compression_size'],\n            'default'   => [__CLASS__, '_default_min_compression_size'],\n        ],\n        'csm' => [\n            'type'     => 'value',\n            'valid'    => [\\Aws\\ClientSideMonitoring\\ConfigurationInterface::class, 'callable', 'array', 'bool'],\n            'doc'      => 'CSM options for the client. Provides a callable wrapping a promise, a boolean \"false\", an instance of ConfigurationInterface, or an associative array of \"enabled\", \"host\", \"port\", and \"client_id\".',\n            'fn'       => [__CLASS__, '_apply_csm'],\n            'default'  => [\\Aws\\ClientSideMonitoring\\ConfigurationProvider::class, 'defaultProvider']\n        ],\n        'http' => [\n            'type'    => 'value',\n            'valid'   => ['array'],\n            'default' => [],\n            'doc'     => 'Set to an array of SDK request options to apply to each request (e.g., proxy, verify, etc.).',\n        ],\n        'http_handler' => [\n            'type'    => 'value',\n            'valid'   => ['callable'],\n            'doc'     => 'An HTTP handler is a function that accepts a PSR-7 request object and returns a promise that is fulfilled with a PSR-7 response object or rejected with an array of exception data. NOTE: This option supersedes any provided \"handler\" option.',\n            'fn'      => [__CLASS__, '_apply_http_handler']\n        ],\n        'handler' => [\n            'type'     => 'value',\n            'valid'    => ['callable'],\n            'doc'      => 'A handler that accepts a command object, request object and returns a promise that is fulfilled with an Aws\\ResultInterface object or rejected with an Aws\\Exception\\AwsException. A handler does not accept a next handler as it is terminal and expected to fulfill a command. If no handler is provided, a default Guzzle handler will be utilized.',\n            'fn'       => [__CLASS__, '_apply_handler'],\n            'default'  => [__CLASS__, '_default_handler']\n        ],\n        'ua_append' => [\n            'type'     => 'value',\n            'valid'    => ['string', 'array'],\n            'doc'      => 'Provide a string or array of strings to send in the User-Agent header.',\n            'fn'       => [__CLASS__, '_apply_user_agent'],\n            'default'  => [],\n        ],\n        'idempotency_auto_fill' => [\n            'type'      => 'value',\n            'valid'     => ['bool', 'callable'],\n            'doc'       => 'Set to false to disable SDK to populate parameters that enabled \\'idempotencyToken\\' trait with a random UUID v4 value on your behalf. Using default value \\'true\\' still allows parameter value to be overwritten when provided. Note: auto-fill only works when cryptographically secure random bytes generator functions(random_bytes, openssl_random_pseudo_bytes or mcrypt_create_iv) can be found. You may also provide a callable source of random bytes.',\n            'default'   => true,\n            'fn'        => [__CLASS__, '_apply_idempotency_auto_fill']\n        ],\n        'use_aws_shared_config_files' => [\n            'type'      => 'value',\n            'valid'     => ['bool'],\n            'doc'       => 'Set to false to disable checking for shared aws config files usually located in \\'~/.aws/config\\' and \\'~/.aws/credentials\\'.  This will be ignored if you set the \\'profile\\' setting.',\n            'default'   => true,\n        ],\n        'suppress_php_deprecation_warning' => [\n            'type'      => 'value',\n            'valid'     => ['bool'],\n            'doc'       => 'Set to false to disable the deprecation warning of PHP versions 7.2.4 and below',\n            'default'   => false,\n            'fn'        => [__CLASS__, '_apply_suppress_php_deprecation_warning']\n        ],\n    ];\n\n    /**\n     * Gets an array of default client arguments, each argument containing a\n     * hash of the following:\n     *\n     * - type: (string, required) option type described as follows:\n     *   - value: The default option type.\n     *   - config: The provided value is made available in the client's\n     *     getConfig() method.\n     * - valid: (array, required) Valid PHP types or class names. Note: null\n     *   is not an allowed type.\n     * - required: (bool, callable) Whether or not the argument is required.\n     *   Provide a function that accepts an array of arguments and returns a\n     *   string to provide a custom error message.\n     * - default: (mixed) The default value of the argument if not provided. If\n     *   a function is provided, then it will be invoked to provide a default\n     *   value. The function is provided the array of options and is expected\n     *   to return the default value of the option. The default value can be a\n     *   closure and can not be a callable string that is not  part of the\n     *   defaultArgs array.\n     * - doc: (string) The argument documentation string.\n     * - fn: (callable) Function used to apply the argument. The function\n     *   accepts the provided value, array of arguments by reference, and an\n     *   event emitter.\n     *\n     * Note: Order is honored and important when applying arguments.\n     *\n     * @return array\n     */\n    public static function getDefaultArguments()\n    {\n        return self::$defaultArgs;\n    }\n\n    /**\n     * @param array $argDefinitions Client arguments.\n     */\n    public function __construct(array $argDefinitions)\n    {\n        $this->argDefinitions = $argDefinitions;\n    }\n\n    /**\n     * Resolves client configuration options and attached event listeners.\n     * Check for missing keys in passed arguments\n     *\n     * @param array       $args Provided constructor arguments.\n     * @param HandlerList $list Handler list to augment.\n     *\n     * @return array Returns the array of provided options.\n     * @throws \\InvalidArgumentException\n     * @see Aws\\AwsClient::__construct for a list of available options.\n     */\n    public function resolve(array $args, HandlerList $list)\n    {\n        $args['config'] = [];\n        foreach ($this->argDefinitions as $key => $a) {\n            // Add defaults, validate required values, and skip if not set.\n            if (!isset($args[$key])) {\n                if (isset($a['default'])) {\n                    // Merge defaults in when not present.\n                    if (is_callable($a['default'])\n                        && (\n                            is_array($a['default'])\n                            || $a['default'] instanceof \\Closure\n                        )\n                    ) {\n                        $args[$key] = $a['default']($args);\n                    } else {\n                        $args[$key] = $a['default'];\n                    }\n                } elseif (empty($a['required'])) {\n                    continue;\n                } else {\n                    $this->throwRequired($args);\n                }\n            }\n\n            // Validate the types against the provided value.\n            foreach ($a['valid'] as $check) {\n                if (isset(self::$typeMap[$check])) {\n                    $fn = self::$typeMap[$check];\n                    if ($fn($args[$key])) {\n                        goto is_valid;\n                    }\n                } elseif ($args[$key] instanceof $check) {\n                    goto is_valid;\n                }\n            }\n\n            $this->invalidType($key, $args[$key]);\n\n            // Apply the value\n            is_valid:\n            if (isset($a['fn'])) {\n                $a['fn']($args[$key], $args, $list);\n            }\n\n            if ($a['type'] === 'config') {\n                $args['config'][$key] = $args[$key];\n            }\n        }\n        $this->_apply_client_context_params($args);\n\n        return $args;\n    }\n\n    /**\n     * Creates a verbose error message for an invalid argument.\n     *\n     * @param string $name        Name of the argument that is missing.\n     * @param array  $args        Provided arguments\n     * @param bool   $useRequired Set to true to show the required fn text if\n     *                            available instead of the documentation.\n     * @return string\n     */\n    private function getArgMessage($name, $args = [], $useRequired = false)\n    {\n        $arg = $this->argDefinitions[$name];\n        $msg = '';\n        $modifiers = [];\n        if (isset($arg['valid'])) {\n            $modifiers[] = implode('|', $arg['valid']);\n        }\n        if (isset($arg['choice'])) {\n            $modifiers[] = 'One of ' . implode(', ', $arg['choice']);\n        }\n        if ($modifiers) {\n            $msg .= '(' . implode('; ', $modifiers) . ')';\n        }\n        $msg = wordwrap(\"{$name}: {$msg}\", 75, \"\\n  \");\n\n        if ($useRequired && is_callable($arg['required'])) {\n            $msg .= \"\\n\\n  \";\n            $msg .= str_replace(\"\\n\", \"\\n  \", call_user_func($arg['required'], $args));\n        } elseif (isset($arg['doc'])) {\n            $msg .= wordwrap(\"\\n\\n  {$arg['doc']}\", 75, \"\\n  \");\n        }\n\n        return $msg;\n    }\n\n    /**\n     * Throw when an invalid type is encountered.\n     *\n     * @param string $name     Name of the value being validated.\n     * @param mixed  $provided The provided value.\n     * @throws \\InvalidArgumentException\n     */\n    private function invalidType($name, $provided)\n    {\n        $expected = implode('|', $this->argDefinitions[$name]['valid']);\n        $msg = \"Invalid configuration value \"\n            . \"provided for \\\"{$name}\\\". Expected {$expected}, but got \"\n            . describe_type($provided) . \"\\n\\n\"\n            . $this->getArgMessage($name);\n        throw new IAE($msg);\n    }\n\n    /**\n     * Throws an exception for missing required arguments.\n     *\n     * @param array $args Passed in arguments.\n     * @throws \\InvalidArgumentException\n     */\n    private function throwRequired(array $args)\n    {\n        $missing = [];\n        foreach ($this->argDefinitions as $k => $a) {\n            if (empty($a['required'])\n                || isset($a['default'])\n                || isset($args[$k])\n            ) {\n                continue;\n            }\n            $missing[] = $this->getArgMessage($k, $args, true);\n        }\n        $msg = \"Missing required client configuration options: \\n\\n\";\n        $msg .= implode(\"\\n\\n\", $missing);\n        throw new IAE($msg);\n    }\n\n    public static function _apply_retries($value, array &$args, HandlerList $list)\n    {\n        // A value of 0 for the config option disables retries\n        if ($value) {\n            $config = RetryConfigProvider::unwrap($value);\n\n            if ($config->getMode() === 'legacy') {\n                // # of retries is 1 less than # of attempts\n                $decider = RetryMiddleware::createDefaultDecider(\n                    $config->getMaxAttempts() - 1\n                );\n                $list->appendSign(\n                    Middleware::retry($decider, null, $args['stats']['retries']),\n                    'retry'\n                );\n            } else {\n                $list->appendSign(\n                    RetryMiddlewareV2::wrap(\n                        $config,\n                        ['collect_stats' => $args['stats']['retries']]\n                    ),\n                    'retry'\n                );\n            }\n        }\n    }\n\n    public static function _apply_defaults($value, array &$args, HandlerList $list)\n    {\n        $config = ConfigModeProvider::unwrap($value);\n        if ($config->getMode() !== 'legacy') {\n            if (!isset($args['retries']) && !is_null($config->getRetryMode())) {\n                $args['retries'] = ['mode' => $config->getRetryMode()];\n            }\n            if (\n                !isset($args['sts_regional_endpoints'])\n                && !is_null($config->getStsRegionalEndpoints())\n            ) {\n                $args['sts_regional_endpoints'] = ['mode' => $config->getStsRegionalEndpoints()];\n            }\n            if (\n                !isset($args['s3_us_east_1_regional_endpoint'])\n                && !is_null($config->getS3UsEast1RegionalEndpoints())\n            ) {\n                $args['s3_us_east_1_regional_endpoint'] = ['mode' => $config->getS3UsEast1RegionalEndpoints()];\n            }\n\n            if (!isset($args['http'])) {\n                $args['http'] = [];\n            }\n            if (\n                !isset($args['http']['connect_timeout'])\n                && !is_null($config->getConnectTimeoutInMillis())\n            ) {\n                $args['http']['connect_timeout'] = $config->getConnectTimeoutInMillis() / 1000;\n            }\n            if (\n                !isset($args['http']['timeout'])\n                && !is_null($config->getHttpRequestTimeoutInMillis())\n            ) {\n                $args['http']['timeout'] = $config->getHttpRequestTimeoutInMillis() / 1000;\n            }\n        }\n    }\n\n    public static function _apply_disable_request_compression($value, array &$args) {\n        if (is_callable($value)) {\n            $value = $value();\n        }\n        if (!is_bool($value)) {\n           throw new IAE(\n              \"Invalid configuration value provided for 'disable_request_compression'.\"\n              . \" value must be a bool.\"\n           );\n        }\n        $args['config']['disable_request_compression'] = $value;\n    }\n\n    public static function _default_disable_request_compression(array &$args) {\n        return ConfigurationResolver::resolve(\n            'disable_request_compression',\n            false,\n            'bool',\n            $args\n        );\n    }\n\n    public static function _apply_min_compression_size($value, array &$args) {\n        if (is_callable($value)) {\n            $value = $value();\n        }\n        if (!is_int($value)\n            || (is_int($value)\n            && ($value < 0 || $value > 10485760))\n        ) {\n            throw new IAE(\" Invalid configuration value provided for 'min_compression_size_bytes'.\"\n            . \" value must be an integer between 0 and 10485760, inclusive.\");\n        }\n        $args['config']['request_min_compression_size_bytes'] = $value;\n    }\n\n    public static function _default_min_compression_size(array &$args) {\n        return ConfigurationResolver::resolve(\n            'request_min_compression_size_bytes',\n            10240,\n            'int',\n            $args\n        );\n    }\n\n    public static function _apply_credentials($value, array &$args)\n    {\n        if (is_callable($value)) {\n            return;\n        }\n\n        if ($value instanceof CredentialsInterface) {\n            $args['credentials'] = CredentialProvider::fromCredentials($value);\n        } elseif (is_array($value)\n            && isset($value['key'])\n            && isset($value['secret'])\n        ) {\n            $args['credentials'] = CredentialProvider::fromCredentials(\n                new Credentials(\n                    $value['key'],\n                    $value['secret'],\n                    isset($value['token']) ? $value['token'] : null,\n                    isset($value['expires']) ? $value['expires'] : null\n                )\n            );\n        } elseif ($value === false) {\n            $args['credentials'] = CredentialProvider::fromCredentials(\n                new Credentials('', '')\n            );\n            $args['config']['signature_version'] = 'anonymous';\n        } elseif ($value instanceof CacheInterface) {\n            $args['credentials'] = CredentialProvider::defaultProvider($args);\n        } else {\n            throw new IAE('Credentials must be an instance of '\n                . \"'\" . CredentialsInterface::class . ', an associative '\n                . 'array that contains \"key\", \"secret\", and an optional \"token\" '\n                . 'key-value pairs, a credentials provider function, or false.');\n        }\n    }\n\n    public static function _default_credential_provider(array $args)\n    {\n        return CredentialProvider::defaultProvider($args);\n    }\n\n    public static function _apply_token($value, array &$args)\n    {\n        if (is_callable($value)) {\n            return;\n        }\n\n        if ($value instanceof Token) {\n            $args['token'] = TokenProvider::fromToken($value);\n        } elseif (is_array($value)\n            && isset($value['token'])\n        ) {\n            $args['token'] = TokenProvider::fromToken(\n                new Token(\n                    $value['token'],\n                    isset($value['expires']) ? $value['expires'] : null\n                )\n            );\n        } elseif ($value instanceof CacheInterface) {\n            $args['token'] = TokenProvider::defaultProvider($args);\n        } else {\n            throw new IAE('Token must be an instance of '\n                . TokenInterface::class . ', an associative '\n                . 'array that contains \"token\" and an optional \"expires\" '\n                . 'key-value pairs, a token provider function, or false.');\n        }\n    }\n\n    public static function _default_token_provider(array $args)\n    {\n        return TokenProvider::defaultProvider($args);\n    }\n\n    public static function _apply_csm($value, array &$args, HandlerList $list)\n    {\n        if ($value === false) {\n            $value = new Configuration(\n                false,\n                \\Aws\\ClientSideMonitoring\\ConfigurationProvider::DEFAULT_HOST,\n                \\Aws\\ClientSideMonitoring\\ConfigurationProvider::DEFAULT_PORT,\n                \\Aws\\ClientSideMonitoring\\ConfigurationProvider::DEFAULT_CLIENT_ID\n            );\n            $args['csm'] = $value;\n        }\n\n        $list->appendBuild(\n            ApiCallMonitoringMiddleware::wrap(\n                $args['credentials'],\n                $value,\n                $args['region'],\n                $args['api']->getServiceId()\n            ),\n            'ApiCallMonitoringMiddleware'\n        );\n\n        $list->appendAttempt(\n            ApiCallAttemptMonitoringMiddleware::wrap(\n                $args['credentials'],\n                $value,\n                $args['region'],\n                $args['api']->getServiceId()\n            ),\n            'ApiCallAttemptMonitoringMiddleware'\n        );\n    }\n\n    public static function _apply_api_provider(callable $value, array &$args)\n    {\n        $api = new Service(\n            ApiProvider::resolve(\n                $value,\n                'api',\n                $args['service'],\n                $args['version']\n            ),\n            $value\n        );\n\n        if (\n            empty($args['config']['signing_name'])\n            && isset($api['metadata']['signingName'])\n        ) {\n            $args['config']['signing_name'] = $api['metadata']['signingName'];\n        }\n\n        $args['api'] = $api;\n        $args['parser'] = Service::createParser($api);\n        $args['error_parser'] = Service::createErrorParser($api->getProtocol(), $api);\n    }\n\n    public static function _apply_endpoint_provider($value, array &$args)\n    {\n        if (!isset($args['endpoint'])) {\n            if ($value instanceof \\Aws\\EndpointV2\\EndpointProviderV2) {\n                $options = self::getEndpointProviderOptions($args);\n                $value = PartitionEndpointProvider::defaultProvider($options)\n                    ->getPartition($args['region'], $args['service']);\n            }\n\n            $endpointPrefix = isset($args['api']['metadata']['endpointPrefix'])\n                ? $args['api']['metadata']['endpointPrefix']\n                : $args['service'];\n\n            // Check region is a valid host label when it is being used to\n            // generate an endpoint\n            if (!self::isValidRegion($args['region'])) {\n                throw new InvalidRegionException('Region must be a valid RFC'\n                    . ' host label.');\n            }\n            $serviceEndpoints =\n                is_array($value) && isset($value['services'][$args['service']]['endpoints'])\n                    ? $value['services'][$args['service']]['endpoints']\n                    : null;\n            if (isset($serviceEndpoints[$args['region']]['deprecated'])) {\n                trigger_error(\"The service \" . $args['service'] . \"has \"\n                    . \" deprecated the region \" . $args['region'] . \".\",\n                    E_USER_WARNING\n                );\n            }\n\n            $args['region'] = \\Aws\\strip_fips_pseudo_regions($args['region']);\n\n            // Invoke the endpoint provider and throw if it does not resolve.\n            $result = EndpointProvider::resolve($value, [\n                'service' => $endpointPrefix,\n                'region'  => $args['region'],\n                'scheme'  => $args['scheme'],\n                'options' => self::getEndpointProviderOptions($args),\n            ]);\n\n            $args['endpoint'] = $result['endpoint'];\n\n            if (empty($args['config']['signature_version'])) {\n                if (\n                    isset($args['api'])\n                    && $args['api']->getSignatureVersion() == 'bearer'\n                ) {\n                    $args['config']['signature_version'] = 'bearer';\n                } elseif (isset($result['signatureVersion'])) {\n                    $args['config']['signature_version'] = $result['signatureVersion'];\n                }\n            }\n\n            if (\n                empty($args['config']['signing_region'])\n                && isset($result['signingRegion'])\n            ) {\n                $args['config']['signing_region'] = $result['signingRegion'];\n            }\n\n            if (\n                empty($args['config']['signing_name'])\n                && isset($result['signingName'])\n            ) {\n                $args['config']['signing_name'] = $result['signingName'];\n            }\n        }\n    }\n\n    public static function _apply_endpoint_discovery($value, array &$args) {\n        $args['endpoint_discovery'] = $value;\n    }\n\n    public static function _default_endpoint_discovery_provider(array $args)\n    {\n        return ConfigurationProvider::defaultProvider($args);\n    }\n\n    public static function _apply_use_fips_endpoint($value, array &$args) {\n        if ($value instanceof CacheInterface) {\n            $value = UseFipsConfigProvider::defaultProvider($args);\n        }\n        if (is_callable($value)) {\n            $value = $value();\n        }\n        if ($value instanceof PromiseInterface) {\n            $value = $value->wait();\n        }\n        if ($value instanceof UseFipsEndpointConfigurationInterface) {\n            $args['config']['use_fips_endpoint'] = $value;\n        } else {\n            // The Configuration class itself will validate other inputs\n            $args['config']['use_fips_endpoint'] = new UseFipsEndpointConfiguration($value);\n        }\n    }\n\n    public static function _default_use_fips_endpoint(array &$args) {\n        return UseFipsConfigProvider::defaultProvider($args);\n    }\n\n    public static function _apply_use_dual_stack_endpoint($value, array &$args) {\n        if ($value instanceof CacheInterface) {\n            $value = UseDualStackConfigProvider::defaultProvider($args);\n        }\n        if (is_callable($value)) {\n            $value = $value();\n        }\n        if ($value instanceof PromiseInterface) {\n            $value = $value->wait();\n        }\n        if ($value instanceof UseDualStackEndpointConfigurationInterface) {\n            $args['config']['use_dual_stack_endpoint'] = $value;\n        } else {\n            // The Configuration class itself will validate other inputs\n            $args['config']['use_dual_stack_endpoint'] =\n                new UseDualStackEndpointConfiguration($value, $args['region']);\n        }\n    }\n\n    public static function _default_use_dual_stack_endpoint(array &$args) {\n        return UseDualStackConfigProvider::defaultProvider($args);\n    }\n\n    public static function _apply_debug($value, array &$args, HandlerList $list)\n    {\n        if ($value !== false) {\n            $list->interpose(\n                new TraceMiddleware(\n                    $value === true ? [] : $value,\n                    $args['api'])\n            );\n        }\n    }\n\n    public static function _apply_stats($value, array &$args, HandlerList $list)\n    {\n        // Create an array of stat collectors that are disabled (set to false)\n        // by default. If the user has passed in true, enable all stat\n        // collectors.\n        $defaults = array_fill_keys(\n            ['http', 'retries', 'timer'],\n            $value === true\n        );\n        $args['stats'] = is_array($value)\n            ? array_replace($defaults, $value)\n            : $defaults;\n\n        if ($args['stats']['timer']) {\n            $list->prependInit(Middleware::timer(), 'timer');\n        }\n    }\n\n    public static function _apply_profile($_, array &$args)\n    {\n        $args['credentials'] = CredentialProvider::ini($args['profile']);\n    }\n\n    public static function _apply_validate($value, array &$args, HandlerList $list)\n    {\n        if ($value === false) {\n            return;\n        }\n\n        $validator = $value === true\n            ? new Validator()\n            : new Validator($value);\n        $list->appendValidate(\n            Middleware::validation($args['api'], $validator),\n            'validation'\n        );\n    }\n\n    public static function _apply_handler($value, array &$args, HandlerList $list)\n    {\n        $list->setHandler($value);\n    }\n\n    public static function _default_handler(array &$args)\n    {\n        return new WrappedHttpHandler(\n            default_http_handler(),\n            $args['parser'],\n            $args['error_parser'],\n            $args['exception_class'],\n            $args['stats']['http']\n        );\n    }\n\n    public static function _apply_http_handler($value, array &$args, HandlerList $list)\n    {\n        $args['handler'] = new WrappedHttpHandler(\n            $value,\n            $args['parser'],\n            $args['error_parser'],\n            $args['exception_class'],\n            $args['stats']['http']\n        );\n    }\n\n    public static function _apply_user_agent($inputUserAgent, array &$args, HandlerList $list)\n    {\n        //Add SDK version\n        $userAgent = ['aws-sdk-php/' . Sdk::VERSION];\n\n        //If on HHVM add the HHVM version\n        if (defined('HHVM_VERSION')) {\n            $userAgent []= 'HHVM/' . HHVM_VERSION;\n        }\n\n        //Add OS version\n        $disabledFunctions = explode(',', ini_get('disable_functions'));\n        if (function_exists('php_uname')\n            && !in_array('php_uname', $disabledFunctions, true)\n        ) {\n            $osName = \"OS/\" . php_uname('s') . '#' . php_uname('r');\n            if (!empty($osName)) {\n                $userAgent []= $osName;\n            }\n        }\n\n        //Add the language version\n        $userAgent []= 'lang/php#' . phpversion();\n\n        //Add exec environment if present\n        if ($executionEnvironment = getenv('AWS_EXECUTION_ENV')) {\n            $userAgent []= $executionEnvironment;\n        }\n\n        //Add endpoint discovery if set\n        if (isset($args['endpoint_discovery'])) {\n            if (($args['endpoint_discovery'] instanceof \\Aws\\EndpointDiscovery\\Configuration\n                && $args['endpoint_discovery']->isEnabled())\n            ) {\n                $userAgent []= 'cfg/endpoint-discovery';\n            } elseif (is_array($args['endpoint_discovery'])\n                && isset($args['endpoint_discovery']['enabled'])\n                && $args['endpoint_discovery']['enabled']\n            ) {\n                $userAgent []= 'cfg/endpoint-discovery';\n            }\n        }\n\n        //Add retry mode if set\n        if (isset($args['retries'])) {\n            if ($args['retries'] instanceof \\Aws\\Retry\\Configuration) {\n                $userAgent []= 'cfg/retry-mode#' . $args[\"retries\"]->getMode();\n            } elseif (is_array($args['retries'])\n                && isset($args[\"retries\"][\"mode\"])\n            ) {\n                $userAgent []= 'cfg/retry-mode#' . $args[\"retries\"][\"mode\"];\n            }\n        }\n        //Add the input to the end\n        if ($inputUserAgent){\n            if (!is_array($inputUserAgent)) {\n                $inputUserAgent = [$inputUserAgent];\n            }\n            $inputUserAgent = array_map('strval', $inputUserAgent);\n            $userAgent = array_merge($userAgent, $inputUserAgent);\n        }\n\n        $args['ua_append'] = $userAgent;\n\n        $list->appendBuild(static function (callable $handler) use ($userAgent) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request\n            ) use ($handler, $userAgent) {\n                return $handler(\n                    $command,\n                    $request->withHeader(\n                        'X-Amz-User-Agent',\n                        implode(' ', array_merge(\n                            $userAgent,\n                            $request->getHeader('X-Amz-User-Agent')\n                        ))\n                    )->withHeader(\n                        'User-Agent',\n                        implode(' ', array_merge(\n                            $userAgent,\n                            $request->getHeader('User-Agent')\n                        ))\n                    )\n                );\n            };\n        });\n    }\n\n    public static function _apply_endpoint($value, array &$args, HandlerList $list)\n    {\n        $args['endpoint'] = $value;\n    }\n\n    public static function _apply_idempotency_auto_fill(\n        $value,\n        array &$args,\n        HandlerList $list\n    ) {\n        $enabled = false;\n        $generator = null;\n\n\n        if (is_bool($value)) {\n            $enabled = $value;\n        } elseif (is_callable($value)) {\n            $enabled = true;\n            $generator = $value;\n        }\n\n        if ($enabled) {\n            $list->prependInit(\n                IdempotencyTokenMiddleware::wrap($args['api'], $generator),\n                'idempotency_auto_fill'\n            );\n        }\n    }\n\n    public static function _apply_suppress_php_deprecation_warning($suppressWarning, array &$args) {\n        if ($suppressWarning) {\n            $args['suppress_php_deprecation_warning'] = true;\n        } elseif (!empty($_ENV[\"AWS_SUPPRESS_PHP_DEPRECATION_WARNING\"])) {\n            $args['suppress_php_deprecation_warning'] =\n                $_ENV[\"AWS_SUPPRESS_PHP_DEPRECATION_WARNING\"];\n        } elseif (!empty($_SERVER[\"AWS_SUPPRESS_PHP_DEPRECATION_WARNING\"])) {\n            $args['suppress_php_deprecation_warning'] =\n                $_SERVER[\"AWS_SUPPRESS_PHP_DEPRECATION_WARNING\"];\n        } elseif (!empty(getenv(\"AWS_SUPPRESS_PHP_DEPRECATION_WARNING\"))) {\n            $args['suppress_php_deprecation_warning']\n                = getenv(\"AWS_SUPPRESS_PHP_DEPRECATION_WARNING\");\n        }\n    }\n\n    public static function _default_endpoint_provider(array $args)\n    {\n        $service =  isset($args['api']) ? $args['api'] : null;\n        $serviceName = isset($service) ? $service->getServiceName() : null;\n        $apiVersion = isset($service) ? $service->getApiVersion() : null;\n\n        if (self::isValidService($serviceName)\n            && self::isValidApiVersion($serviceName, $apiVersion)\n        ) {\n            $ruleset = EndpointDefinitionProvider::getEndpointRuleset(\n                $service->getServiceName(),\n                $service->getApiVersion()\n            );\n            return new \\Aws\\EndpointV2\\EndpointProviderV2(\n                $ruleset,\n                EndpointDefinitionProvider::getPartitions()\n            );\n        }\n        $options = self::getEndpointProviderOptions($args);\n        return PartitionEndpointProvider::defaultProvider($options)\n            ->getPartition($args['region'], $args['service']);\n    }\n\n    public static function _default_serializer(array $args)\n    {\n        return Service::createSerializer(\n            $args['api'],\n            $args['endpoint']\n        );\n    }\n\n    public static function _default_signature_provider()\n    {\n        return SignatureProvider::defaultProvider();\n    }\n\n    public static function _default_signature_version(array &$args)\n    {\n        if (isset($args['config']['signature_version'])) {\n            return $args['config']['signature_version'];\n        }\n\n        $args['__partition_result'] = isset($args['__partition_result'])\n            ? isset($args['__partition_result'])\n            : call_user_func(PartitionEndpointProvider::defaultProvider(), [\n                'service' => $args['service'],\n                'region' => $args['region'],\n            ]);\n\n        return isset($args['__partition_result']['signatureVersion'])\n            ? $args['__partition_result']['signatureVersion']\n            : $args['api']->getSignatureVersion();\n    }\n\n    public static function _default_signing_name(array &$args)\n    {\n        if (isset($args['config']['signing_name'])) {\n            return $args['config']['signing_name'];\n        }\n\n        $args['__partition_result'] = isset($args['__partition_result'])\n            ? isset($args['__partition_result'])\n            : call_user_func(PartitionEndpointProvider::defaultProvider(), [\n                'service' => $args['service'],\n                'region' => $args['region'],\n            ]);\n\n        if (isset($args['__partition_result']['signingName'])) {\n            return $args['__partition_result']['signingName'];\n        }\n\n        if ($signingName = $args['api']->getSigningName()) {\n            return $signingName;\n        }\n\n        return $args['service'];\n    }\n\n    public static function _default_signing_region(array &$args)\n    {\n        if (isset($args['config']['signing_region'])) {\n            return $args['config']['signing_region'];\n        }\n\n        $args['__partition_result'] = isset($args['__partition_result'])\n            ? isset($args['__partition_result'])\n            : call_user_func(PartitionEndpointProvider::defaultProvider(), [\n                'service' => $args['service'],\n                'region' => $args['region'],\n            ]);\n\n        return isset($args['__partition_result']['signingRegion'])\n            ? $args['__partition_result']['signingRegion']\n            : $args['region'];\n    }\n\n    public static function _missing_version(array $args)\n    {\n        $service = isset($args['service']) ? $args['service'] : '';\n        $versions = ApiProvider::defaultProvider()->getVersions($service);\n        $versions = implode(\"\\n\", array_map(function ($v) {\n            return \"* \\\"$v\\\"\";\n        }, $versions)) ?: '* (none found)';\n\n        return <<<EOT\nA \"version\" configuration value is required. Specifying a version constraint\nensures that your code will not be affected by a breaking change made to the\nservice. For example, when using Amazon S3, you can lock your API version to\n\"2006-03-01\".\n\nYour build of the SDK has the following version(s) of \"{$service}\": {$versions}\n\nYou may provide \"latest\" to the \"version\" configuration value to utilize the\nmost recent available API version that your client's API provider can find.\nNote: Using 'latest' in a production application is not recommended.\n\nA list of available API versions can be found on each client's API documentation\npage: http://docs.aws.amazon.com/aws-sdk-php/v3/api/index.html. If you are\nunable to load a specific API version, then you may need to update your copy of\nthe SDK.\nEOT;\n    }\n\n    public static function _missing_region(array $args)\n    {\n        $service = isset($args['service']) ? $args['service'] : '';\n\n        return <<<EOT\nA \"region\" configuration value is required for the \"{$service}\" service\n(e.g., \"us-west-2\"). A list of available public regions and endpoints can be\nfound at http://docs.aws.amazon.com/general/latest/gr/rande.html.\nEOT;\n    }\n\n    /**\n     * Extracts client options for the endpoint provider to its own array\n     *\n     * @param array $args\n     * @return array\n     */\n    private static function getEndpointProviderOptions(array $args)\n    {\n        $options = [];\n        $optionKeys = [\n            'sts_regional_endpoints',\n            's3_us_east_1_regional_endpoint',\n            ];\n        $configKeys = [\n            'use_dual_stack_endpoint',\n            'use_fips_endpoint',\n        ];\n        foreach ($optionKeys as $key) {\n            if (isset($args[$key])) {\n                $options[$key] = $args[$key];\n            }\n        }\n        foreach ($configKeys as $key) {\n            if (isset($args['config'][$key])) {\n                $options[$key] = $args['config'][$key];\n            }\n        }\n        return $options;\n    }\n\n    /**\n     * Validates a region to be used for endpoint construction\n     *\n     * @param $region\n     * @return bool\n     */\n    private static function isValidRegion($region)\n    {\n        return is_valid_hostlabel($region);\n    }\n\n    private function _apply_client_context_params(array $args)\n    {\n        if (isset($args['api'])\n           && !empty($args['api']->getClientContextParams()))\n        {\n            $clientContextParams = $args['api']->getClientContextParams();\n            foreach($clientContextParams as $paramName => $paramDefinition) {\n                $definition = [\n                    'type' => 'value',\n                    'valid' => [$paramDefinition['type']],\n                    'doc' => isset($paramDefinition['documentation']) ?\n                        $paramDefinition['documentation'] : null\n                ];\n                $this->argDefinitions[$paramName] = $definition;\n\n                if (isset($args[$paramName])) {\n                    $fn = self::$typeMap[$paramDefinition['type']];\n                    if (!$fn($args[$paramName])) {\n                        $this->invalidType($paramName, $args[$paramName]);\n                    }\n                }\n            }\n        }\n    }\n\n    private static function isValidService($service) {\n        if (is_null($service)) {\n            return false;\n        }\n        $services = \\Aws\\manifest();\n        return isset($services[$service]);\n    }\n\n    private static function isValidApiVersion($service, $apiVersion) {\n        if (is_null($apiVersion)) {\n            return false;\n        }\n        return is_dir(\n          __DIR__ . \"/data/{$service}/$apiVersion\"\n        );\n    }\n}\n", "num_lines": 1261}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\n/**\n * AWS command object.\n */\nclass Command implements CommandInterface\n{\n    use HasDataTrait;\n\n    /** @var string */\n    private $name;\n\n    /** @var HandlerList */\n    private $handlerList;\n\n    /** @var Array */\n    private $authSchemes;\n\n    /**\n     * Accepts an associative array of command options, including:\n     *\n     * - @http: (array) Associative array of transfer options.\n     *\n     * @param string      $name           Name of the command\n     * @param array       $args           Arguments to pass to the command\n     * @param HandlerList $list           Handler list\n     */\n    public function __construct($name, array $args = [], HandlerList $list = null)\n    {\n        $this->name = $name;\n        $this->data = $args;\n        $this->handlerList = $list ?: new HandlerList();\n\n        if (!isset($this->data['@http'])) {\n            $this->data['@http'] = [];\n        }\n        if (!isset($this->data['@context'])) {\n            $this->data['@context'] = [];\n        }\n    }\n\n    public function __clone()\n    {\n        $this->handlerList = clone $this->handlerList;\n    }\n\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    public function hasParam($name)\n    {\n        return array_key_exists($name, $this->data);\n    }\n\n    public function getHandlerList()\n    {\n        return $this->handlerList;\n    }\n\n    /**\n     * For overriding auth schemes on a per endpoint basis when using\n     * EndpointV2 provider. Intended for internal use only.\n     *\n     * @param array $authSchemes\n     *\n     * @internal\n     */\n    public function setAuthSchemes(array $authSchemes)\n    {\n        $this->authSchemes = $authSchemes;\n    }\n\n    /**\n     * Get auth schemes added to command as required\n     * for endpoint resolution\n     *\n     * @returns array | null\n     */\n    public function getAuthSchemes()\n    {\n        return $this->authSchemes;\n    }\n\n    /** @deprecated */\n    public function get($name)\n    {\n        return $this[$name];\n    }\n}\n", "num_lines": 93}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\n/**\n * A command object encapsulates the input parameters used to control the\n * creation of a HTTP request and processing of a HTTP response.\n *\n * Using the toArray() method will return the input parameters of the command\n * as an associative array.\n */\ninterface CommandInterface extends \\ArrayAccess, \\Countable, \\IteratorAggregate\n{\n    /**\n     * Converts the command parameters to an array\n     *\n     * @return array\n     */\n    public function toArray();\n\n    /**\n     * Get the name of the command\n     *\n     * @return string\n     */\n    public function getName();\n\n    /**\n     * Check if the command has a parameter by name.\n     *\n     * @param string $name Name of the parameter to check\n     *\n     * @return bool\n     */\n    public function hasParam($name);\n\n    /**\n     * Get the handler list used to transfer the command.\n     *\n     * @return HandlerList\n     */\n    public function getHandlerList();\n}\n", "num_lines": 43}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse GuzzleHttp\\Promise\\PromisorInterface;\nuse GuzzleHttp\\Promise\\EachPromise;\n\n/**\n * Sends and iterator of commands concurrently using a capped pool size.\n *\n * The pool will read command objects from an iterator until it is cancelled or\n * until the iterator is consumed.\n */\nclass CommandPool implements PromisorInterface\n{\n    /** @var EachPromise */\n    private $each;\n\n    /**\n     * The CommandPool constructor accepts a hash of configuration options:\n     *\n     * - concurrency: (callable|int) Maximum number of commands to execute\n     *   concurrently. Provide a function to resize the pool dynamically. The\n     *   function will be provided the current number of pending requests and\n     *   is expected to return an integer representing the new pool size limit.\n     * - before: (callable) function to invoke before sending each command. The\n     *   before function accepts the command and the key of the iterator of the\n     *   command. You can mutate the command as needed in the before function\n     *   before sending the command.\n     * - fulfilled: (callable) Function to invoke when a promise is fulfilled.\n     *   The function is provided the result object, id of the iterator that the\n     *   result came from, and the aggregate promise that can be resolved/rejected\n     *   if you need to short-circuit the pool.\n     * - rejected: (callable) Function to invoke when a promise is rejected.\n     *   The function is provided an AwsException object, id of the iterator that\n     *   the exception came from, and the aggregate promise that can be\n     *   resolved/rejected if you need to short-circuit the pool.\n     * - preserve_iterator_keys: (bool) Retain the iterator key when generating\n     *   the commands.\n     *\n     * @param AwsClientInterface $client   Client used to execute commands.\n     * @param array|\\Iterator    $commands Iterable that yields commands.\n     * @param array              $config   Associative array of options.\n     */\n    public function __construct(\n        AwsClientInterface $client,\n        $commands,\n        array $config = []\n    ) {\n        if (!isset($config['concurrency'])) {\n            $config['concurrency'] = 25;\n        }\n\n        $before = $this->getBefore($config);\n        $mapFn = function ($commands) use ($client, $before, $config) {\n            foreach ($commands as $key => $command) {\n                if (!($command instanceof CommandInterface)) {\n                    throw new \\InvalidArgumentException('Each value yielded by '\n                        . 'the iterator must be an Aws\\CommandInterface.');\n                }\n                if ($before) {\n                    $before($command, $key);\n                }\n                if (!empty($config['preserve_iterator_keys'])) {\n                    yield $key => $client->executeAsync($command);\n                } else {\n                    yield $client->executeAsync($command);\n                }\n            }\n        };\n\n        $this->each = new EachPromise($mapFn($commands), $config);\n    }\n\n    /**\n     * @return PromiseInterface\n     */\n    public function promise()\n    {\n        return $this->each->promise();\n    }\n\n    /**\n     * Executes a pool synchronously and aggregates the results of the pool\n     * into an indexed array in the same order as the passed in array.\n     *\n     * @param AwsClientInterface $client   Client used to execute commands.\n     * @param mixed              $commands Iterable that yields commands.\n     * @param array              $config   Configuration options.\n     *\n     * @return array\n     * @see \\Aws\\CommandPool::__construct for available configuration options.\n     */\n    public static function batch(\n        AwsClientInterface $client,\n        $commands,\n        array $config = []\n    ) {\n        $results = [];\n        self::cmpCallback($config, 'fulfilled', $results);\n        self::cmpCallback($config, 'rejected', $results);\n\n        return (new self($client, $commands, $config))\n            ->promise()\n            ->then(static function () use (&$results) {\n                ksort($results);\n                return $results;\n            })\n            ->wait();\n    }\n\n    /**\n     * @return callable\n     */\n    private function getBefore(array $config)\n    {\n        if (!isset($config['before'])) {\n            return null;\n        }\n\n        if (is_callable($config['before'])) {\n            return $config['before'];\n        }\n\n        throw new \\InvalidArgumentException('before must be callable');\n    }\n\n    /**\n     * Adds an onFulfilled or onRejected callback that aggregates results into\n     * an array. If a callback is already present, it is replaced with the\n     * composed function.\n     *\n     * @param array $config\n     * @param       $name\n     * @param array $results\n     */\n    private static function cmpCallback(array &$config, $name, array &$results)\n    {\n        if (!isset($config[$name])) {\n            $config[$name] = function ($v, $k) use (&$results) {\n                $results[$k] = $v;\n            };\n        } else {\n            $currentFn = $config[$name];\n            $config[$name] = function ($v, $k) use (&$results, $currentFn) {\n                $currentFn($v, $k);\n                $results[$k] = $v;\n            };\n        }\n    }\n}\n", "num_lines": 152}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\ninterface ConfigurationProviderInterface\n{\n    /**\n     * Create a default config provider\n     *\n     * @param array $config\n     * @return callable\n     */\n    public static function defaultProvider(array $config = []);\n}\n", "num_lines": 14}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Doctrine\\Common\\Cache\\Cache;\n\nclass DoctrineCacheAdapter implements CacheInterface, Cache\n{\n    /** @var Cache */\n    private $cache;\n\n    public function __construct(Cache $cache)\n    {\n        $this->cache = $cache;\n    }\n\n    public function get($key)\n    {\n        return $this->cache->fetch($key);\n    }\n\n    public function fetch($key)\n    {\n        return $this->get($key);\n    }\n\n    public function set($key, $value, $ttl = 0)\n    {\n        return $this->cache->save($key, $value, $ttl);\n    }\n\n    public function save($key, $value, $ttl = 0)\n    {\n        return $this->set($key, $value, $ttl);\n    }\n\n    public function remove($key)\n    {\n        return $this->cache->delete($key);\n    }\n\n    public function delete($key)\n    {\n        return $this->remove($key);\n    }\n\n    public function contains($key)\n    {\n        return $this->cache->contains($key);\n    }\n\n    public function getStats()\n    {\n        return $this->cache->getStats();\n    }\n}\n", "num_lines": 56}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Api\\Service;\nuse Psr\\Http\\Message\\RequestInterface;\nuse Psr\\Log\\InvalidArgumentException;\n\n/**\n * Used to update the host based on a modeled endpoint trait\n *\n * IMPORTANT: this middleware must be added after the \"build\" step.\n *\n * @internal\n */\nclass EndpointParameterMiddleware\n{\n    /** @var callable */\n    private $nextHandler;\n\n    /** @var Service */\n    private $service;\n\n    /**\n     * Create a middleware wrapper function\n     *\n     * @param Service $service\n     * @param array $args\n     * @return \\Closure\n     */\n    public static function wrap(Service $service)\n    {\n        return function (callable $handler) use ($service) {\n            return new self($handler, $service);\n        };\n    }\n\n    public function __construct(callable $nextHandler, Service $service)\n    {\n        $this->nextHandler = $nextHandler;\n        $this->service = $service;\n    }\n\n    public function __invoke(CommandInterface $command, RequestInterface $request)\n    {\n        $nextHandler = $this->nextHandler;\n\n        $operation = $this->service->getOperation($command->getName());\n\n        if (!empty($operation['endpoint']['hostPrefix'])) {\n            $prefix = $operation['endpoint']['hostPrefix'];\n\n            // Captures endpoint parameters stored in the modeled host.\n            // These are denoted by enclosure in braces, i.e. '{param}'\n            preg_match_all(\"/\\{([a-zA-Z0-9]+)}/\", $prefix, $parameters);\n\n            if (!empty($parameters[1])) {\n\n                // Captured parameters without braces stored in $parameters[1],\n                // which should correspond to members in the Command object\n                foreach ($parameters[1] as $index => $parameter) {\n                    if (empty($command[$parameter])) {\n                        throw new \\InvalidArgumentException(\n                            \"The parameter '{$parameter}' must be set and not empty.\"\n                        );\n                    }\n\n                    // Captured parameters with braces stored in $parameters[0],\n                    // which are replaced by their corresponding Command value\n                    $prefix = str_replace(\n                        $parameters[0][$index],\n                        $command[$parameter],\n                        $prefix\n                    );\n                }\n            }\n\n            $uri = $request->getUri();\n            $host = $prefix . $uri->getHost();\n            if (!\\Aws\\is_valid_hostname($host)) {\n                throw new \\InvalidArgumentException(\n                    \"The supplied parameters result in an invalid hostname: '{$host}'.\"\n                );\n            }\n            $request = $request->withUri($uri->withHost($host));\n        }\n\n        return $nextHandler($command, $request);\n    }\n}\n", "num_lines": 90}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\n/**\n * Builds a single handler function from zero or more middleware functions and\n * a handler. The handler function is then used to send command objects and\n * return a promise that is resolved with an AWS result object.\n *\n * The \"front\" of the list is invoked before the \"end\" of the list. You can add\n * middleware to the front of the list using one of the \"prepend\" method, and\n * the end of the list using one of the \"append\" method. The last function\n * invoked in a handler list is the handler (a function that does not accept a\n * next handler but rather is responsible for returning a promise that is\n * fulfilled with an Aws\\ResultInterface object).\n *\n * Handlers are ordered using a \"step\" that describes the step at which the\n * SDK is when sending a command. The available steps are:\n *\n * - init: The command is being initialized, allowing you to do things like add\n *   default options.\n * - validate: The command is being validated before it is serialized\n * - build: The command is being serialized into an HTTP request. A middleware\n *   in this step MUST serialize an HTTP request and populate the \"@request\"\n *   parameter of a command with the request such that it is available to\n *   subsequent middleware.\n * - sign: The request is being signed and prepared to be sent over the wire.\n *\n * Middleware can be registered with a name to allow you to easily add a\n * middleware before or after another middleware by name. This also allows you\n * to remove a middleware by name (in addition to removing by instance).\n */\nclass HandlerList implements \\Countable\n{\n    const INIT = 'init';\n    const VALIDATE = 'validate';\n    const BUILD = 'build';\n    const SIGN = 'sign';\n    const ATTEMPT = 'attempt';\n\n    /** @var callable */\n    private $handler;\n\n    /** @var array */\n    private $named = [];\n\n    /** @var array */\n    private $sorted;\n\n    /** @var callable|null */\n    private $interposeFn;\n\n    /** @var array Steps (in reverse order) */\n    private $steps = [\n        self::ATTEMPT  => [],\n        self::SIGN     => [],\n        self::BUILD    => [],\n        self::VALIDATE => [],\n        self::INIT     => [],\n    ];\n\n    /**\n     * @param callable $handler HTTP handler.\n     */\n    public function __construct(callable $handler = null)\n    {\n        $this->handler = $handler;\n    }\n\n    /**\n     * Dumps a string representation of the list.\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        $str = '';\n        $i = 0;\n\n        foreach (array_reverse($this->steps) as $k => $step) {\n            foreach (array_reverse($step) as $j => $tuple) {\n                $str .= \"{$i}) Step: {$k}, \";\n                if ($tuple[1]) {\n                    $str .= \"Name: {$tuple[1]}, \";\n                }\n                $str .= \"Function: \" . $this->debugCallable($tuple[0]) . \"\\n\";\n                $i++;\n            }\n        }\n\n        if ($this->handler) {\n            $str .= \"{$i}) Handler: \" . $this->debugCallable($this->handler) . \"\\n\";\n        }\n\n        return $str;\n    }\n\n    /**\n     * Set the HTTP handler that actually returns a response.\n     *\n     * @param callable $handler Function that accepts a request and array of\n     *                          options and returns a Promise.\n     */\n    public function setHandler(callable $handler)\n    {\n        $this->handler = $handler;\n    }\n\n    /**\n     * Returns true if the builder has a handler.\n     *\n     * @return bool\n     */\n    public function hasHandler()\n    {\n        return (bool) $this->handler;\n    }\n\n    /**\n     * Append a middleware to the init step.\n     *\n     * @param callable $middleware Middleware function to add.\n     * @param string   $name       Name of the middleware.\n     */\n    public function appendInit(callable $middleware, $name = null)\n    {\n        $this->add(self::INIT, $name, $middleware);\n    }\n\n    /**\n     * Prepend a middleware to the init step.\n     *\n     * @param callable $middleware Middleware function to add.\n     * @param string   $name       Name of the middleware.\n     */\n    public function prependInit(callable $middleware, $name = null)\n    {\n        $this->add(self::INIT, $name, $middleware, true);\n    }\n\n    /**\n     * Append a middleware to the validate step.\n     *\n     * @param callable $middleware Middleware function to add.\n     * @param string   $name       Name of the middleware.\n     */\n    public function appendValidate(callable $middleware, $name = null)\n    {\n        $this->add(self::VALIDATE, $name, $middleware);\n    }\n\n    /**\n     * Prepend a middleware to the validate step.\n     *\n     * @param callable $middleware Middleware function to add.\n     * @param string   $name       Name of the middleware.\n     */\n    public function prependValidate(callable $middleware, $name = null)\n    {\n        $this->add(self::VALIDATE, $name, $middleware, true);\n    }\n\n    /**\n     * Append a middleware to the build step.\n     *\n     * @param callable $middleware Middleware function to add.\n     * @param string   $name       Name of the middleware.\n     */\n    public function appendBuild(callable $middleware, $name = null)\n    {\n        $this->add(self::BUILD, $name, $middleware);\n    }\n\n    /**\n     * Prepend a middleware to the build step.\n     *\n     * @param callable $middleware Middleware function to add.\n     * @param string   $name       Name of the middleware.\n     */\n    public function prependBuild(callable $middleware, $name = null)\n    {\n        $this->add(self::BUILD, $name, $middleware, true);\n    }\n\n    /**\n     * Append a middleware to the sign step.\n     *\n     * @param callable $middleware Middleware function to add.\n     * @param string   $name       Name of the middleware.\n     */\n    public function appendSign(callable $middleware, $name = null)\n    {\n        $this->add(self::SIGN, $name, $middleware);\n    }\n\n    /**\n     * Prepend a middleware to the sign step.\n     *\n     * @param callable $middleware Middleware function to add.\n     * @param string   $name       Name of the middleware.\n     */\n    public function prependSign(callable $middleware, $name = null)\n    {\n        $this->add(self::SIGN, $name, $middleware, true);\n    }\n\n    /**\n     * Append a middleware to the attempt step.\n     *\n     * @param callable $middleware Middleware function to add.\n     * @param string   $name       Name of the middleware.\n     */\n    public function appendAttempt(callable $middleware, $name = null)\n    {\n        $this->add(self::ATTEMPT, $name, $middleware);\n    }\n\n    /**\n     * Prepend a middleware to the attempt step.\n     *\n     * @param callable $middleware Middleware function to add.\n     * @param string   $name       Name of the middleware.\n     */\n    public function prependAttempt(callable $middleware, $name = null)\n    {\n        $this->add(self::ATTEMPT, $name, $middleware, true);\n    }\n\n    /**\n     * Add a middleware before the given middleware by name.\n     *\n     * @param string|callable $findName   Add before this\n     * @param string          $withName   Optional name to give the middleware\n     * @param callable        $middleware Middleware to add.\n     */\n    public function before($findName, $withName, callable $middleware)\n    {\n        $this->splice($findName, $withName, $middleware, true);\n    }\n\n    /**\n     * Add a middleware after the given middleware by name.\n     *\n     * @param string|callable $findName   Add after this\n     * @param string          $withName   Optional name to give the middleware\n     * @param callable        $middleware Middleware to add.\n     */\n    public function after($findName, $withName, callable $middleware)\n    {\n        $this->splice($findName, $withName, $middleware, false);\n    }\n\n    /**\n     * Remove a middleware by name or by instance from the list.\n     *\n     * @param string|callable $nameOrInstance Middleware to remove.\n     */\n    public function remove($nameOrInstance)\n    {\n        if (is_callable($nameOrInstance)) {\n            $this->removeByInstance($nameOrInstance);\n        } elseif (is_string($nameOrInstance)) {\n            $this->removeByName($nameOrInstance);\n        }\n    }\n\n    /**\n     * Interpose a function between each middleware (e.g., allowing for a trace\n     * through the middleware layers).\n     *\n     * The interpose function is a function that accepts a \"step\" argument as a\n     * string and a \"name\" argument string. This function must then return a\n     * function that accepts the next handler in the list. This function must\n     * then return a function that accepts a CommandInterface and optional\n     * RequestInterface and returns a promise that is fulfilled with an\n     * Aws\\ResultInterface or rejected with an Aws\\Exception\\AwsException\n     * object.\n     *\n     * @param callable|null $fn Pass null to remove any previously set function\n     */\n    public function interpose(callable $fn = null)\n    {\n        $this->sorted = null;\n        $this->interposeFn = $fn;\n    }\n\n    /**\n     * Compose the middleware and handler into a single callable function.\n     *\n     * @return callable\n     */\n    public function resolve()\n    {\n        if (!($prev = $this->handler)) {\n            throw new \\LogicException('No handler has been specified');\n        }\n\n        if ($this->sorted === null) {\n            $this->sortMiddleware();\n        }\n\n        foreach ($this->sorted as $fn) {\n            $prev = $fn($prev);\n        }\n\n        return $prev;\n    }\n\n    /**\n     * @return int\n     */\n    #[\\ReturnTypeWillChange]\n    public function count()\n    {\n        return count($this->steps[self::INIT])\n            + count($this->steps[self::VALIDATE])\n            + count($this->steps[self::BUILD])\n            + count($this->steps[self::SIGN])\n            + count($this->steps[self::ATTEMPT]);\n    }\n\n    /**\n     * Splices a function into the middleware list at a specific position.\n     *\n     * @param          $findName\n     * @param          $withName\n     * @param callable $middleware\n     * @param          $before\n     */\n    private function splice($findName, $withName, callable $middleware, $before)\n    {\n        if (!isset($this->named[$findName])) {\n            throw new \\InvalidArgumentException(\"$findName not found\");\n        }\n\n        $idx = $this->sorted = null;\n        $step = $this->named[$findName];\n\n        if ($withName) {\n            $this->named[$withName] = $step;\n        }\n\n        foreach ($this->steps[$step] as $i => $tuple) {\n            if ($tuple[1] === $findName) {\n                $idx = $i;\n                break;\n            }\n        }\n\n        $replacement = $before\n            ? [$this->steps[$step][$idx], [$middleware, $withName]]\n            : [[$middleware, $withName], $this->steps[$step][$idx]];\n        array_splice($this->steps[$step], $idx, 1, $replacement);\n    }\n\n    /**\n     * Provides a debug string for a given callable.\n     *\n     * @param array|callable $fn Function to write as a string.\n     *\n     * @return string\n     */\n    private function debugCallable($fn)\n    {\n        if (is_string($fn)) {\n            return \"callable({$fn})\";\n        }\n\n        if (is_array($fn)) {\n            $ele = is_string($fn[0]) ? $fn[0] : get_class($fn[0]);\n            return \"callable(['{$ele}', '{$fn[1]}'])\";\n        }\n\n        return 'callable(' . spl_object_hash($fn) . ')';\n    }\n\n    /**\n     * Sort the middleware, and interpose if needed in the sorted list.\n     */\n    private function sortMiddleware()\n    {\n        $this->sorted = [];\n\n        if (!$this->interposeFn) {\n            foreach ($this->steps as $step) {\n                foreach ($step as $fn) {\n                    $this->sorted[] = $fn[0];\n                }\n            }\n            return;\n        }\n\n        $ifn = $this->interposeFn;\n        // Interpose the interposeFn into the handler stack.\n        foreach ($this->steps as $stepName => $step) {\n            foreach ($step as $fn) {\n                $this->sorted[] = $ifn($stepName, $fn[1]);\n                $this->sorted[] = $fn[0];\n            }\n        }\n    }\n\n    private function removeByName($name)\n    {\n        if (!isset($this->named[$name])) {\n            return;\n        }\n\n        $this->sorted = null;\n        $step = $this->named[$name];\n        $this->steps[$step] = array_values(\n            array_filter(\n                $this->steps[$step],\n                function ($tuple) use ($name) {\n                    return $tuple[1] !== $name;\n                }\n            )\n        );\n    }\n\n    private function removeByInstance(callable $fn)\n    {\n        foreach ($this->steps as $k => $step) {\n            foreach ($step as $j => $tuple) {\n                if ($tuple[0] === $fn) {\n                    $this->sorted = null;\n                    unset($this->named[$this->steps[$k][$j][1]]);\n                    unset($this->steps[$k][$j]);\n                }\n            }\n        }\n    }\n\n    /**\n     * Add a middleware to a step.\n     *\n     * @param string   $step       Middleware step.\n     * @param string   $name       Middleware name.\n     * @param callable $middleware Middleware function to add.\n     * @param bool     $prepend    Prepend instead of append.\n     */\n    private function add($step, $name, callable $middleware, $prepend = false)\n    {\n        $this->sorted = null;\n\n        if ($prepend) {\n            $this->steps[$step][] = [$middleware, $name];\n        } else {\n            array_unshift($this->steps[$step], [$middleware, $name]);\n        }\n\n        if ($name) {\n            $this->named[$name] = $step;\n        }\n    }\n}\n", "num_lines": 456}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\n/**\n * Trait implementing ToArrayInterface, \\ArrayAccess, \\Countable, and\n * \\IteratorAggregate\n */\ntrait HasDataTrait\n{\n    /** @var array */\n    private $data = [];\n\n    /**\n     * @return \\Traversable\n     */\n    #[\\ReturnTypeWillChange]\n    public function getIterator()\n    {\n        return new \\ArrayIterator($this->data);\n    }\n\n    /**\n     * This method returns a reference to the variable to allow for indirect\n     * array modification (e.g., $foo['bar']['baz'] = 'qux').\n     *\n     * @param $offset\n     *\n     * @return mixed|null\n     */\n    #[\\ReturnTypeWillChange]\n    public function & offsetGet($offset)\n    {\n        if (isset($this->data[$offset])) {\n            return $this->data[$offset];\n        }\n\n        $value = null;\n        return $value;\n    }\n\n    /**\n     * @return void\n     */\n    #[\\ReturnTypeWillChange]\n    public function offsetSet($offset, $value)\n    {\n        $this->data[$offset] = $value;\n    }\n\n    /**\n     * @return bool\n     */\n    #[\\ReturnTypeWillChange]\n    public function offsetExists($offset)\n    {\n        return isset($this->data[$offset]);\n    }\n\n    /**\n     * @return void\n     */\n    #[\\ReturnTypeWillChange]\n    public function offsetUnset($offset)\n    {\n        unset($this->data[$offset]);\n    }\n\n    public function toArray()\n    {\n        return $this->data;\n    }\n\n    /**\n     * @return int\n     */\n    #[\\ReturnTypeWillChange]\n    public function count()\n    {\n        return count($this->data);\n    }\n}\n", "num_lines": 82}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse GuzzleHttp\\Psr7\\StreamDecoratorTrait;\nuse Psr\\Http\\Message\\StreamInterface;\n\n/**\n * Stream decorator that calculates a rolling hash of the stream as it is read.\n */\nclass HashingStream implements StreamInterface\n{\n    use StreamDecoratorTrait;\n\n    /** @var StreamInterface */\n    private $stream;\n\n    /** @var HashInterface */\n    private $hash;\n\n    /** @var callable|null */\n    private $callback;\n\n    /**\n     * @param StreamInterface $stream     Stream that is being read.\n     * @param HashInterface   $hash       Hash used to calculate checksum.\n     * @param callable        $onComplete Optional function invoked when the\n     *                                    hash calculation is completed.\n     */\n    public function __construct(\n        StreamInterface $stream,\n        HashInterface $hash,\n        callable $onComplete = null\n    ) {\n        $this->stream = $stream;\n        $this->hash = $hash;\n        $this->callback = $onComplete;\n    }\n\n    public function read($length)\n    {\n        $data = $this->stream->read($length);\n        $this->hash->update($data);\n        if ($this->eof()) {\n            $result = $this->hash->complete();\n            if ($this->callback) {\n                call_user_func($this->callback, $result);\n            }\n        }\n\n        return $data;\n    }\n\n    public function seek($offset, $whence = SEEK_SET)\n    {\n        if ($offset === 0) {\n            $this->hash->reset();\n            return $this->stream->seek($offset);\n        }\n\n        // Seeking arbitrarily is not supported.\n        return false;\n    }\n}\n", "num_lines": 64}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\n/**\n * Interface that allows implementing various incremental hashes.\n */\ninterface HashInterface\n{\n    /**\n     * Adds data to the hash.\n     *\n     * @param string $data Data to add to the hash\n     */\n    public function update($data);\n\n    /**\n     * Finalizes the incremental hash and returns the resulting digest.\n     *\n     * @return string\n     */\n    public function complete();\n\n    /**\n     * Removes all data from the hash, effectively starting a new hash.\n     */\n    public function reset();\n}\n", "num_lines": 28}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\n\ntrait HasMonitoringEventsTrait\n{\n    private $monitoringEvents = [];\n\n    /**\n     * Get client-side monitoring events attached to this object. Each event is\n     * represented as an associative array within the returned array.\n     *\n     * @return array\n     */\n    public function getMonitoringEvents()\n    {\n        return $this->monitoringEvents;\n    }\n\n    /**\n     * Prepend a client-side monitoring event to this object's event list\n     *\n     * @param array $event\n     */\n    public function prependMonitoringEvent(array $event)\n    {\n        array_unshift($this->monitoringEvents, $event);\n    }\n\n    /**\n     * Append a client-side monitoring event to this object's event list\n     *\n     * @param array $event\n     */\n    public function appendMonitoringEvent(array $event)\n    {\n        $this->monitoringEvents []= $event;\n    }\n}\n", "num_lines": 40}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Psr\\Http\\Message\\RequestInterface;\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents a history container that is required when using the history\n * middleware.\n */\nclass History implements \\Countable, \\IteratorAggregate\n{\n    private $maxEntries;\n    private $entries = array();\n\n    /**\n     * @param int $maxEntries Maximum number of entries to store.\n     */\n    public function __construct($maxEntries = 10)\n    {\n        $this->maxEntries = $maxEntries;\n    }\n\n    /**\n     * @return int\n     */\n    #[\\ReturnTypeWillChange]\n    public function count()\n    {\n        return count($this->entries);\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function getIterator()\n    {\n        return new \\ArrayIterator(array_values($this->entries));\n    }\n\n    /**\n     * Get the last finished command seen by the history container.\n     *\n     * @return CommandInterface\n     * @throws \\LogicException if no commands have been seen.\n     */\n    public function getLastCommand()\n    {\n        if (!$this->entries) {\n            throw new \\LogicException('No commands received');\n        }\n\n        return end($this->entries)['command'];\n    }\n\n    /**\n     * Get the last finished request seen by the history container.\n     *\n     * @return RequestInterface\n     * @throws \\LogicException if no requests have been seen.\n     */\n    public function getLastRequest()\n    {\n        if (!$this->entries) {\n            throw new \\LogicException('No requests received');\n        }\n\n        return end($this->entries)['request'];\n    }\n\n    /**\n     * Get the last received result or exception.\n     *\n     * @return ResultInterface|AwsException\n     * @throws \\LogicException if no return values have been received.\n     */\n    public function getLastReturn()\n    {\n        if (!$this->entries) {\n            throw new \\LogicException('No entries');\n        }\n\n        $last = end($this->entries);\n\n        if (isset($last['result'])) {\n            return $last['result'];\n        }\n\n        if (isset($last['exception'])) {\n            return $last['exception'];\n        }\n\n        throw new \\LogicException('No return value for last entry.');\n    }\n\n    /**\n     * Initiate an entry being added to the history.\n     *\n     * @param CommandInterface $cmd Command be executed.\n     * @param RequestInterface $req Request being sent.\n     *\n     * @return string Returns the ticket used to finish the entry.\n     */\n    public function start(CommandInterface $cmd, RequestInterface $req)\n    {\n        $ticket = uniqid();\n        $this->entries[$ticket] = [\n            'command'   => $cmd,\n            'request'   => $req,\n            'result'    => null,\n            'exception' => null,\n        ];\n\n        return $ticket;\n    }\n\n    /**\n     * Finish adding an entry to the history container.\n     *\n     * @param string $ticket Ticket returned from the start call.\n     * @param mixed  $result The result (an exception or AwsResult).\n     */\n    public function finish($ticket, $result)\n    {\n        if (!isset($this->entries[$ticket])) {\n            throw new \\InvalidArgumentException('Invalid history ticket');\n        }\n\n        if (isset($this->entries[$ticket]['result'])\n            || isset($this->entries[$ticket]['exception'])\n        ) {\n            throw new \\LogicException('History entry is already finished');\n        }\n\n        if ($result instanceof \\Exception) {\n            $this->entries[$ticket]['exception'] = $result;\n        } else {\n            $this->entries[$ticket]['result'] = $result;\n        }\n\n        if (count($this->entries) >= $this->maxEntries) {\n            $this->entries = array_slice($this->entries, -$this->maxEntries, null, true);\n        }\n    }\n\n    /**\n     * Flush the history\n     */\n    public function clear()\n    {\n        $this->entries = [];\n    }\n\n    /**\n     * Converts the history to an array.\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        return array_values($this->entries);\n    }\n}\n", "num_lines": 162}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Api\\Service;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * @internal Middleware that auto fills parameters with `idempotencyToken` trait\n */\nclass IdempotencyTokenMiddleware\n{\n    /** @var Service */\n    private $service;\n    /** @var string */\n    private $bytesGenerator;\n    /** @var callable */\n    private $nextHandler;\n\n    /**\n     * Creates a middleware that populates operation parameter\n     * with trait 'idempotencyToken' enabled with a random UUIDv4\n     *\n     * One of following functions needs to be available\n     * in order to generate random bytes used for UUID\n     * (SDK will attempt to utilize function in following order):\n     *  - random_bytes (requires PHP 7.0 or above) \n     *  - openssl_random_pseudo_bytes (requires 'openssl' module enabled)\n     *  - mcrypt_create_iv (requires 'mcrypt' module enabled)\n     *\n     * You may also supply a custom bytes generator as an optional second\n     * parameter.\n     *\n     * @param \\Aws\\Api\\Service $service\n     * @param callable|null $bytesGenerator\n     *\n     * @return callable\n     */\n    public static function wrap(\n        Service $service,\n        callable $bytesGenerator = null\n    ) {\n        return function (callable $handler) use ($service, $bytesGenerator) {\n            return new self($handler, $service, $bytesGenerator);\n        };\n    }\n\n    public function __construct(\n        callable $nextHandler,\n        Service $service,\n        callable $bytesGenerator = null\n    ) {\n        $this->bytesGenerator = $bytesGenerator\n            ?: $this->findCompatibleRandomSource();\n        $this->service = $service;\n        $this->nextHandler = $nextHandler;\n    }\n\n    public function __invoke(\n        CommandInterface $command,\n        RequestInterface $request = null\n    ) {\n        $handler = $this->nextHandler;\n        if ($this->bytesGenerator) {\n            $operation = $this->service->getOperation($command->getName());\n            $members = $operation->getInput()->getMembers();\n            foreach ($members as $member => $value) {\n                if ($value['idempotencyToken']) {\n                    $bytes = call_user_func($this->bytesGenerator, 16);\n                    // populating UUIDv4 only when the parameter is not set\n                    $command[$member] = $command[$member]\n                        ?: $this->getUuidV4($bytes);\n                    // only one member could have the trait enabled\n                    break;\n                }\n            }\n        }\n        return $handler($command, $request);\n    }\n\n    /**\n     * This function generates a random UUID v4 string,\n     * which is used as auto filled token value.\n     *\n     * @param string $bytes 16 bytes of pseudo-random bytes\n     * @return string\n     * More information about UUID v4, see:\n     * https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29\n     * https://tools.ietf.org/html/rfc4122#page-14\n     */\n    private static function getUuidV4($bytes)\n    {\n        // set version to 0100\n        $bytes[6] = chr(ord($bytes[6]) & 0x0f | 0x40);\n        // set bits 6-7 to 10\n        $bytes[8] = chr(ord($bytes[8]) & 0x3f | 0x80);\n        return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($bytes), 4));\n    }\n\n    /**\n     * This function decides the PHP function used in generating random bytes.\n     *\n     * @return callable|null\n     */\n    private function findCompatibleRandomSource()\n    {\n        if (function_exists('random_bytes')) {\n            return 'random_bytes';\n        }\n\n        if (function_exists('openssl_random_pseudo_bytes')) {\n            return 'openssl_random_pseudo_bytes';\n        }\n\n        if (function_exists('mcrypt_create_iv')) {\n            return 'mcrypt_create_iv';\n        }\n    }\n}\n", "num_lines": 119}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Api\\Service;\n\n/**\n * Validates the required input parameters of commands are non empty\n *\n * @internal\n */\nclass InputValidationMiddleware\n{\n\n    /** @var callable */\n    private $nextHandler;\n\n    /** @var array */\n    private $mandatoryAttributeList;\n\n    /** @var Service */\n    private $service;\n\n    /**\n     * Create a middleware wrapper function.\n     *\n     * @param Service $service\n     * @param array $mandatoryAttributeList\n     * @return callable     */\n    public static function wrap(Service $service, $mandatoryAttributeList) {\n        if (!is_array($mandatoryAttributeList) ||\n            array_filter($mandatoryAttributeList, 'is_string') !== $mandatoryAttributeList\n        ) {\n            throw new \\InvalidArgumentException(\n                \"The mandatory attribute list must be an array of strings\"\n            );\n        }\n        return function (callable $handler) use ($service, $mandatoryAttributeList) {\n            return new self($handler, $service, $mandatoryAttributeList);\n        };\n    }\n\n    public function __construct(\n        callable $nextHandler,\n        Service $service,\n        $mandatoryAttributeList\n    ) {\n        $this->service = $service;\n        $this->nextHandler = $nextHandler;\n        $this->mandatoryAttributeList = $mandatoryAttributeList;\n    }\n\n    public function __invoke(CommandInterface $cmd) {\n        $nextHandler = $this->nextHandler;\n        $op = $this->service->getOperation($cmd->getName())->toArray();\n        if (!empty($op['input']['shape'])) {\n            $service = $this->service->toArray();\n            if (!empty($input = $service['shapes'][$op['input']['shape']])) {\n                if (!empty($input['required'])) {\n                    foreach ($input['required'] as $key => $member) {\n                        if (in_array($member, $this->mandatoryAttributeList)) {\n                            $argument = is_string($cmd[$member]) ?  trim($cmd[$member]) : $cmd[$member];\n                            if ($argument === '' || $argument === null) {\n                                $commandName = $cmd->getName();\n                                throw new \\InvalidArgumentException(\n                                    \"The {$commandName} operation requires non-empty parameter: {$member}\"\n                                );\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        return $nextHandler($cmd);\n    }\n\n}\n", "num_lines": 77}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\n/**\n * Loads JSON files and compiles them into PHP arrays.\n *\n * @internal Please use json_decode instead.\n * @deprecated\n */\nclass JsonCompiler\n{\n    const CACHE_ENV = 'AWS_PHP_CACHE_DIR';\n\n    /**\n     * Loads a JSON file from cache or from the JSON file directly.\n     *\n     * @param string $path Path to the JSON file to load.\n     *\n     * @return mixed\n     */\n    public function load($path)\n    {\n        return load_compiled_json($path);\n    }\n}\n", "num_lines": 26}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\n/**\n * Simple in-memory LRU cache that limits the number of cached entries.\n *\n * The LRU cache is implemented using PHP's ordered associative array. When\n * accessing an element, the element is removed from the hash and re-added to\n * ensure that recently used items are always at the end of the list while\n * least recently used are at the beginning. When a value is added to the\n * cache, if the number of cached items exceeds the allowed number, the first\n * N number of items are removed from the array.\n */\nclass LruArrayCache implements CacheInterface, \\Countable\n{\n    /** @var int */\n    private $maxItems;\n\n    /** @var array */\n    private $items = array();\n\n    /**\n     * @param int $maxItems Maximum number of allowed cache items.\n     */\n    public function __construct($maxItems = 1000)\n    {\n        $this->maxItems = $maxItems;\n    }\n\n    public function get($key)\n    {\n        if (!isset($this->items[$key])) {\n            return null;\n        }\n\n        $entry = $this->items[$key];\n\n        // Ensure the item is not expired.\n        if (!$entry[1] || time() < $entry[1]) {\n            // LRU: remove the item and push it to the end of the array.\n            unset($this->items[$key]);\n            $this->items[$key] = $entry;\n            return $entry[0];\n        }\n\n        unset($this->items[$key]);\n        return null;\n    }\n\n    public function set($key, $value, $ttl = 0)\n    {\n        // Only call time() if the TTL is not 0/false/null\n        $ttl = $ttl ? time() + $ttl : 0;\n        $this->items[$key] = [$value, $ttl];\n\n        // Determine if there are more items in the cache than allowed.\n        $diff = count($this->items) - $this->maxItems;\n\n        // Clear out least recently used items.\n        if ($diff > 0) {\n            // Reset to the beginning of the array and begin unsetting.\n            reset($this->items);\n            for ($i = 0; $i < $diff; $i++) {\n                unset($this->items[key($this->items)]);\n                next($this->items);\n            }\n        }\n    }\n\n    public function remove($key)\n    {\n        unset($this->items[$key]);\n    }\n\n    /**\n     * @return int\n     */\n    #[\\ReturnTypeWillChange]\n    public function count()\n    {\n        return count($this->items);\n    }\n}\n", "num_lines": 84}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Api\\Service;\nuse Aws\\Api\\Validator;\nuse Aws\\Credentials\\CredentialsInterface;\nuse Aws\\EndpointV2\\EndpointProviderV2;\nuse Aws\\Exception\\AwsException;\nuse Aws\\Token\\TokenAuthorization;\nuse Aws\\Token\\TokenInterface;\nuse GuzzleHttp\\Promise;\nuse GuzzleHttp\\Psr7;\nuse GuzzleHttp\\Psr7\\LazyOpenStream;\nuse Psr\\Http\\Message\\RequestInterface;\n\nfinal class Middleware\n{\n    /**\n     * Middleware used to allow a command parameter (e.g., \"SourceFile\") to\n     * be used to specify the source of data for an upload operation.\n     *\n     * @param Service $api\n     * @param string  $bodyParameter\n     * @param string  $sourceParameter\n     *\n     * @return callable\n     */\n    public static function sourceFile(\n        Service $api,\n        $bodyParameter = 'Body',\n        $sourceParameter = 'SourceFile'\n    ) {\n        return function (callable $handler) use (\n            $api,\n            $bodyParameter,\n            $sourceParameter\n        ) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request = null)\n            use (\n                $handler,\n                $api,\n                $bodyParameter,\n                $sourceParameter\n            ) {\n                $operation = $api->getOperation($command->getName());\n                $source = $command[$sourceParameter];\n\n                if ($source !== null\n                    && $operation->getInput()->hasMember($bodyParameter)\n                ) {\n                    $command[$bodyParameter] = new LazyOpenStream($source, 'r');\n                    unset($command[$sourceParameter]);\n                }\n\n                return $handler($command, $request);\n            };\n        };\n    }\n\n    /**\n     * Adds a middleware that uses client-side validation.\n     *\n     * @param Service $api API being accessed.\n     *\n     * @return callable\n     */\n    public static function validation(Service $api, Validator $validator = null)\n    {\n        $validator = $validator ?: new Validator();\n        return function (callable $handler) use ($api, $validator) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request = null\n            ) use ($api, $validator, $handler) {\n                if ($api->isModifiedModel()) {\n                    $api = new Service(\n                        $api->getDefinition(),\n                        $api->getProvider()\n                    );\n                }\n                $operation = $api->getOperation($command->getName());\n                $validator->validate(\n                    $command->getName(),\n                    $operation->getInput(),\n                    $command->toArray()\n                );\n                return $handler($command, $request);\n            };\n        };\n    }\n\n    /**\n     * Builds an HTTP request for a command.\n     *\n     * @param callable $serializer Function used to serialize a request for a\n     *                             command.\n     * @param EndpointProviderV2 | null $endpointProvider\n     * @param array $providerArgs\n     * @return callable\n     */\n    public static function requestBuilder(\n        $serializer,\n        $endpointProvider = null,\n        array $providerArgs = null\n    )\n    {\n        return function (callable $handler) use ($serializer, $endpointProvider, $providerArgs) {\n            return function (CommandInterface $command) use ($serializer, $handler, $endpointProvider, $providerArgs) {\n                return $handler($command, $serializer($command, $endpointProvider, $providerArgs));\n            };\n        };\n    }\n\n    /**\n     * Creates a middleware that signs requests for a command.\n     *\n     * @param callable $credProvider      Credentials provider function that\n     *                                    returns a promise that is resolved\n     *                                    with a CredentialsInterface object.\n     * @param callable $signatureFunction Function that accepts a Command\n     *                                    object and returns a\n     *                                    SignatureInterface.\n     *\n     * @return callable\n     */\n    public static function signer(callable $credProvider, callable $signatureFunction, $tokenProvider = null)\n    {\n        return function (callable $handler) use ($signatureFunction, $credProvider, $tokenProvider) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request\n            ) use ($handler, $signatureFunction, $credProvider, $tokenProvider) {\n                $signer = $signatureFunction($command);\n                if ($signer instanceof TokenAuthorization) {\n                    return $tokenProvider()->then(\n                        function (TokenInterface $token)\n                        use ($handler, $command, $signer, $request) {\n                            return $handler(\n                                $command,\n                                $signer->authorizeRequest($request, $token)\n                            );\n                        }\n                    );\n                } else {\n                    return $credProvider()->then(\n                        function (CredentialsInterface $creds)\n                        use ($handler, $command, $signer, $request) {\n                            return $handler(\n                                $command,\n                                $signer->signRequest($request, $creds)\n                            );\n                        }\n                    );\n                }\n            };\n        };\n    }\n\n    /**\n     * Creates a middleware that invokes a callback at a given step.\n     *\n     * The tap callback accepts a CommandInterface and RequestInterface as\n     * arguments but is not expected to return a new value or proxy to\n     * downstream middleware. It's simply a way to \"tap\" into the handler chain\n     * to debug or get an intermediate value.\n     *\n     * @param callable $fn Tap function\n     *\n     * @return callable\n     */\n    public static function tap(callable $fn)\n    {\n        return function (callable $handler) use ($fn) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request = null\n            ) use ($handler, $fn) {\n                $fn($command, $request);\n                return $handler($command, $request);\n            };\n        };\n    }\n\n    /**\n     * Middleware wrapper function that retries requests based on the boolean\n     * result of invoking the provided \"decider\" function.\n     *\n     * If no delay function is provided, a simple implementation of exponential\n     * backoff will be utilized.\n     *\n     * @param callable $decider Function that accepts the number of retries,\n     *                          a request, [result], and [exception] and\n     *                          returns true if the command is to be retried.\n     * @param callable $delay   Function that accepts the number of retries and\n     *                          returns the number of milliseconds to delay.\n     * @param bool $stats       Whether to collect statistics on retries and the\n     *                          associated delay.\n     *\n     * @return callable\n     */\n    public static function retry(\n        callable $decider = null,\n        callable $delay = null,\n        $stats = false\n    ) {\n        $decider = $decider ?: RetryMiddleware::createDefaultDecider();\n        $delay = $delay ?: [RetryMiddleware::class, 'exponentialDelay'];\n\n        return function (callable $handler) use ($decider, $delay, $stats) {\n            return new RetryMiddleware($decider, $delay, $handler, $stats);\n        };\n    }\n    /**\n     * Middleware wrapper function that adds an invocation id header to\n     * requests, which is only applied after the build step.\n     *\n     * This is a uniquely generated UUID to identify initial and subsequent\n     * retries as part of a complete request lifecycle.\n     *\n     * @return callable\n     */\n    public static function invocationId()\n    {\n        return function (callable $handler) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request\n            ) use ($handler){\n                return $handler($command, $request->withHeader(\n                    'aws-sdk-invocation-id',\n                    md5(uniqid(gethostname(), true))\n                ));\n            };\n        };\n    }\n    /**\n     * Middleware wrapper function that adds a Content-Type header to requests.\n     * This is only done when the Content-Type has not already been set, and the\n     * request body's URI is available. It then checks the file extension of the\n     * URI to determine the mime-type.\n     *\n     * @param array $operations Operations that Content-Type should be added to.\n     *\n     * @return callable\n     */\n    public static function contentType(array $operations)\n    {\n        return function (callable $handler) use ($operations) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request = null\n            ) use ($handler, $operations) {\n                if (!$request->hasHeader('Content-Type')\n                    && in_array($command->getName(), $operations, true)\n                    && ($uri = $request->getBody()->getMetadata('uri'))\n                ) {\n                    $request = $request->withHeader(\n                        'Content-Type',\n                        Psr7\\MimeType::fromFilename($uri) ?: 'application/octet-stream'\n                    );\n                }\n\n                return $handler($command, $request);\n            };\n        };\n    }\n    /**\n     * Middleware wrapper function that adds a trace id header to requests\n     * from clients instantiated in supported Lambda runtime environments.\n     *\n     * The purpose for this header is to track and stop Lambda functions\n     * from being recursively invoked due to misconfigured resources.\n     *\n     * @return callable\n     */\n    public static function recursionDetection()\n    {\n        return function (callable $handler) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request\n            ) use ($handler){\n                $isLambda = getenv('AWS_LAMBDA_FUNCTION_NAME');\n                $traceId = str_replace('\\e', '\\x1b', getenv('_X_AMZN_TRACE_ID'));\n\n                if ($isLambda && $traceId) {\n                    if (!$request->hasHeader('X-Amzn-Trace-Id')) {\n                        $ignoreChars = ['=', ';', ':', '+', '&', '[', ']', '{', '}', '\"', '\\'', ','];\n                        $traceIdEncoded = rawurlencode(stripcslashes($traceId));\n\n                        foreach($ignoreChars as $char) {\n                            $encodedChar = rawurlencode($char);\n                            $traceIdEncoded = str_replace($encodedChar, $char,  $traceIdEncoded);\n                        }\n\n                        return $handler($command, $request->withHeader(\n                            'X-Amzn-Trace-Id',\n                            $traceIdEncoded\n                        ));\n                    }\n                }\n                return $handler($command, $request);\n            };\n        };\n    }\n    /**\n     * Tracks command and request history using a history container.\n     *\n     * This is useful for testing.\n     *\n     * @param History $history History container to store entries.\n     *\n     * @return callable\n     */\n    public static function history(History $history)\n    {\n        return function (callable $handler) use ($history) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request = null\n            ) use ($handler, $history) {\n                $ticket = $history->start($command, $request);\n                return $handler($command, $request)\n                    ->then(\n                        function ($result) use ($history, $ticket) {\n                            $history->finish($ticket, $result);\n                            return $result;\n                        },\n                        function ($reason) use ($history, $ticket) {\n                            $history->finish($ticket, $reason);\n                            return Promise\\Create::rejectionFor($reason);\n                        }\n                    );\n            };\n        };\n    }\n\n    /**\n     * Creates a middleware that applies a map function to requests as they\n     * pass through the middleware.\n     *\n     * @param callable $f Map function that accepts a RequestInterface and\n     *                    returns a RequestInterface.\n     *\n     * @return callable\n     */\n    public static function mapRequest(callable $f)\n    {\n        return function (callable $handler) use ($f) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request = null\n            ) use ($handler, $f) {\n                return $handler($command, $f($request));\n            };\n        };\n    }\n\n    /**\n     * Creates a middleware that applies a map function to commands as they\n     * pass through the middleware.\n     *\n     * @param callable $f Map function that accepts a command and returns a\n     *                    command.\n     *\n     * @return callable\n     */\n    public static function mapCommand(callable $f)\n    {\n        return function (callable $handler) use ($f) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request = null\n            ) use ($handler, $f) {\n                return $handler($f($command), $request);\n            };\n        };\n    }\n\n    /**\n     * Creates a middleware that applies a map function to results.\n     *\n     * @param callable $f Map function that accepts an Aws\\ResultInterface and\n     *                    returns an Aws\\ResultInterface.\n     *\n     * @return callable\n     */\n    public static function mapResult(callable $f)\n    {\n        return function (callable $handler) use ($f) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request = null\n            ) use ($handler, $f) {\n                return $handler($command, $request)->then($f);\n            };\n        };\n    }\n\n    public static function timer()\n    {\n        return function (callable $handler) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request = null\n            ) use ($handler) {\n                $start = microtime(true);\n                return $handler($command, $request)\n                    ->then(\n                        function (ResultInterface $res) use ($start) {\n                            if (!isset($res['@metadata'])) {\n                                $res['@metadata'] = [];\n                            }\n                            if (!isset($res['@metadata']['transferStats'])) {\n                                $res['@metadata']['transferStats'] = [];\n                            }\n\n                            $res['@metadata']['transferStats']['total_time']\n                                = microtime(true) - $start;\n\n                            return $res;\n                        },\n                        function ($err) use ($start) {\n                            if ($err instanceof AwsException) {\n                                $err->setTransferInfo([\n                                    'total_time' => microtime(true) - $start,\n                                ] + $err->getTransferInfo());\n                            }\n                            return Promise\\Create::rejectionFor($err);\n                        }\n                    );\n            };\n        };\n    }\n}\n", "num_lines": 438}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Exception\\AwsException;\nuse GuzzleHttp\\Promise;\nuse GuzzleHttp\\Promise\\RejectedPromise;\nuse Psr\\Http\\Message\\RequestInterface;\nuse Exception;\n\n/**\n * Returns promises that are rejected or fulfilled using a queue of\n * Aws\\ResultInterface and Aws\\Exception\\AwsException objects.\n */\nclass MockHandler implements \\Countable\n{\n    private $queue;\n    private $lastCommand;\n    private $lastRequest;\n    private $onFulfilled;\n    private $onRejected;\n\n    /**\n     * The passed in value must be an array of {@see Aws\\ResultInterface} or\n     * {@see AwsException} objects that acts as a queue of results or\n     * exceptions to return each time the handler is invoked.\n     *\n     * @param array    $resultOrQueue\n     * @param callable $onFulfilled Callback to invoke when the return value is fulfilled.\n     * @param callable $onRejected  Callback to invoke when the return value is rejected.\n     */\n    public function __construct(\n        array $resultOrQueue = [],\n        callable $onFulfilled = null,\n        callable $onRejected = null\n    ) {\n        $this->queue = [];\n        $this->onFulfilled = $onFulfilled;\n        $this->onRejected = $onRejected;\n\n        if ($resultOrQueue) {\n            call_user_func_array([$this, 'append'], array_values($resultOrQueue));\n        }\n    }\n\n    /**\n     * Adds one or more variadic ResultInterface or AwsException objects to the\n     * queue.\n     */\n    public function append()\n    {\n        foreach (func_get_args() as $value) {\n            if ($value instanceof ResultInterface\n                || $value instanceof Exception\n                || is_callable($value)\n            ) {\n                $this->queue[] = $value;\n            } else {\n                throw new \\InvalidArgumentException('Expected an Aws\\ResultInterface or Exception.');\n            }\n        }\n    }\n\n    /**\n     * Adds one or more \\Exception or \\Throwable to the queue\n     */\n    public function appendException()\n    {\n        foreach (func_get_args() as $value) {\n            if ($value instanceof \\Exception || $value instanceof \\Throwable) {\n                $this->queue[] = $value;\n            } else {\n                throw new \\InvalidArgumentException('Expected an \\Exception or \\Throwable.');\n            }\n        }\n    }\n\n    public function __invoke(\n        CommandInterface $command,\n        RequestInterface $request\n    ) {\n        if (!$this->queue) {\n            $last = $this->lastCommand\n                ? ' The last command sent was ' . $this->lastCommand->getName() . '.'\n                : '';\n            throw new \\RuntimeException('Mock queue is empty. Trying to send a '\n                . $command->getName() . ' command failed.' . $last);\n        }\n\n        $this->lastCommand = $command;\n        $this->lastRequest = $request;\n\n        $result = array_shift($this->queue);\n\n        if (is_callable($result)) {\n            $result = $result($command, $request);\n        }\n\n        if ($result instanceof \\Exception) {\n            $result = new RejectedPromise($result);\n        } else {\n            // Add an effective URI and statusCode if not present.\n            $meta = $result['@metadata'];\n            if (!isset($meta['effectiveUri'])) {\n                $meta['effectiveUri'] = (string) $request->getUri();\n            }\n            if (!isset($meta['statusCode'])) {\n                $meta['statusCode'] = 200;\n            }\n            $result['@metadata'] = $meta;\n            $result = Promise\\Create::promiseFor($result);\n        }\n\n        $result->then($this->onFulfilled, $this->onRejected);\n\n        return $result;\n    }\n\n    /**\n     * Get the last received request.\n     *\n     * @return RequestInterface\n     */\n    public function getLastRequest()\n    {\n        return $this->lastRequest;\n    }\n\n    /**\n     * Get the last received command.\n     *\n     * @return CommandInterface\n     */\n    public function getLastCommand()\n    {\n        return $this->lastCommand;\n    }\n\n    /**\n     * Returns the number of remaining items in the queue.\n     *\n     * @return int\n     */\n    #[\\ReturnTypeWillChange]\n    public function count()\n    {\n        return count($this->queue);\n    }\n}\n", "num_lines": 149}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\n/**\n * Interface for adding and retrieving client-side monitoring events\n */\ninterface MonitoringEventsInterface\n{\n\n    /**\n     * Get client-side monitoring events attached to this object. Each event is\n     * represented as an associative array within the returned array.\n     *\n     * @return array\n     */\n    public function getMonitoringEvents();\n\n    /**\n     * Prepend a client-side monitoring event to this object's event list\n     *\n     * @param array $event\n     */\n    public function prependMonitoringEvent(array $event);\n\n    /**\n     * Append a client-side monitoring event to this object's event list\n     *\n     * @param array $event\n     */\n    public function appendMonitoringEvent(array $event);\n\n}\n", "num_lines": 33}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Endpoint\\PartitionEndpointProvider;\nuse Aws\\Endpoint\\PartitionInterface;\nuse Aws\\EndpointV2\\EndpointProviderV2;\nuse Aws\\EndpointV2\\EndpointDefinitionProvider;\n\nclass MultiRegionClient implements AwsClientInterface\n{\n    use AwsClientTrait;\n\n    /** @var AwsClientInterface[] A pool of clients keyed by region. */\n    private $clientPool = [];\n    /** @var callable */\n    private $factory;\n    /** @var PartitionInterface */\n    private $partition;\n    /** @var array */\n    private $args;\n    /** @var array */\n    private $config;\n    /** @var HandlerList */\n    private $handlerList;\n    /** @var array */\n    private $aliases;\n    /** @var callable */\n    private $customHandler;\n\n    public static function getArguments()\n    {\n        $args = array_intersect_key(\n            ClientResolver::getDefaultArguments(),\n            ['service' => true, 'region' => true]\n        );\n        $args['region']['required'] = false;\n\n        return $args + [\n            'client_factory' => [\n                'type' => 'config',\n                'valid' => ['callable'],\n                'doc' => 'A callable that takes an array of client'\n                    . ' configuration arguments and returns a regionalized'\n                    . ' client.',\n                'required' => true,\n                'internal' => true,\n                'default' => function (array $args) {\n                    $namespace = manifest($args['service'])['namespace'];\n                    $klass = \"Aws\\\\{$namespace}\\\\{$namespace}Client\";\n                    $region = isset($args['region']) ? $args['region'] : null;\n\n                    return function (array $args) use ($klass, $region) {\n                        if ($region && empty($args['region'])) {\n                            $args['region'] = $region;\n                        }\n\n                        return new $klass($args);\n                    };\n                },\n            ],\n            'partition' => [\n                'type'    => 'config',\n                'valid'   => ['string', PartitionInterface::class],\n                'doc'     => 'AWS partition to connect to. Valid partitions'\n                    . ' include \"aws,\" \"aws-cn,\" and \"aws-us-gov.\" Used to'\n                    . ' restrict the scope of the mapRegions method.',\n                'default' => function (array $args) {\n                    $region = isset($args['region']) ? $args['region'] : '';\n                    return PartitionEndpointProvider::defaultProvider()\n                        ->getPartition($region, $args['service']);\n                },\n                'fn'      => function ($value, array &$args) {\n                    if (is_string($value)) {\n                        $value = PartitionEndpointProvider::defaultProvider()\n                            ->getPartitionByName($value);\n                    }\n\n                    if (!$value instanceof PartitionInterface) {\n                        throw new \\InvalidArgumentException('No valid partition'\n                            . ' was provided. Provide a concrete partition or'\n                            . ' the name of a partition (e.g., \"aws,\" \"aws-cn,\"'\n                            . ' or \"aws-us-gov\").'\n                        );\n                    }\n                    $ruleset = EndpointDefinitionProvider::getEndpointRuleset(\n                        $args['service'],\n                        isset($args['version']) ? $args['version'] : 'latest'\n                    );\n                    $partitions = EndpointDefinitionProvider::getPartitions();\n                    $args['endpoint_provider'] = new EndpointProviderV2($ruleset, $partitions);\n                }\n            ],\n        ];\n    }\n\n    /**\n     * The multi-region client constructor accepts the following options:\n     *\n     * - client_factory: (callable) An optional callable that takes an array of\n     *   client configuration arguments and returns a regionalized client.\n     * - partition: (Aws\\Endpoint\\Partition|string) AWS partition to connect to.\n     *   Valid partitions include \"aws,\" \"aws-cn,\" and \"aws-us-gov.\" Used to\n     *   restrict the scope of the mapRegions method.\n     * - region: (string) Region to connect to when no override is provided.\n     *   Used to create the default client factory and determine the appropriate\n     *   AWS partition when present.\n     *\n     * @param array $args Client configuration arguments.\n     */\n    public function __construct(array $args = [])\n    {\n        if (!isset($args['service'])) {\n            $args['service'] = $this->parseClass();\n        }\n\n        $this->handlerList = new HandlerList(function (\n            CommandInterface $command\n        ) {\n            list($region, $args) = $this->getRegionFromArgs($command->toArray());\n            $command = $this->getClientFromPool($region)\n                ->getCommand($command->getName(), $args);\n\n            if ($this->isUseCustomHandler()) {\n                $command->getHandlerList()->setHandler($this->customHandler);\n            }\n\n            return $this->executeAsync($command);\n        });\n\n        $argDefinitions = static::getArguments();\n        $resolver = new ClientResolver($argDefinitions);\n        $args = $resolver->resolve($args, $this->handlerList);\n        $this->config = $args['config'];\n        $this->factory = $args['client_factory'];\n        $this->partition = $args['partition'];\n        $this->args = array_diff_key($args, $args['config']);\n    }\n\n    /**\n     * Get the region to which the client is configured to send requests by\n     * default.\n     *\n     * @return string\n     */\n    public function getRegion()\n    {\n        return $this->getClientFromPool()->getRegion();\n    }\n\n    /**\n     * Create a command for an operation name.\n     *\n     * Special keys may be set on the command to control how it behaves,\n     * including:\n     *\n     * - @http: Associative array of transfer specific options to apply to the\n     *   request that is serialized for this command. Available keys include\n     *   \"proxy\", \"verify\", \"timeout\", \"connect_timeout\", \"debug\", \"delay\", and\n     *   \"headers\".\n     * - @region: The region to which the command should be sent.\n     *\n     * @param string $name Name of the operation to use in the command\n     * @param array  $args Arguments to pass to the command\n     *\n     * @return CommandInterface\n     * @throws \\InvalidArgumentException if no command can be found by name\n     */\n    public function getCommand($name, array $args = [])\n    {\n        return new Command($name, $args, clone $this->getHandlerList());\n    }\n\n    public function getConfig($option = null)\n    {\n        if (null === $option) {\n            return $this->config;\n        }\n\n        if (isset($this->config[$option])) {\n            return $this->config[$option];\n        }\n\n        return $this->getClientFromPool()->getConfig($option);\n    }\n\n    public function getCredentials()\n    {\n        return $this->getClientFromPool()->getCredentials();\n    }\n\n    public function getHandlerList()\n    {\n        return $this->handlerList;\n    }\n\n    public function getApi()\n    {\n        return $this->getClientFromPool()->getApi();\n    }\n\n    public function getEndpoint()\n    {\n        return $this->getClientFromPool()->getEndpoint();\n    }\n\n    public function useCustomHandler(callable $handler)\n    {\n        $this->customHandler = $handler;\n    }\n\n    private function isUseCustomHandler()\n    {\n        return isset($this->customHandler);\n    }\n\n    /**\n     * @param string $region    Omit this argument or pass in an empty string to\n     *                          allow the configured client factory to apply the\n     *                          region.\n     *\n     * @return AwsClientInterface\n     */\n    protected function getClientFromPool($region = '')\n    {\n        if (empty($this->clientPool[$region])) {\n            $factory = $this->factory;\n            $this->clientPool[$region] = $factory(\n                array_replace($this->args, array_filter(['region' => $region]))\n            );\n        }\n\n        return $this->clientPool[$region];\n    }\n\n    /**\n     * Parse the class name and return the \"service\" name of the client.\n     *\n     * @return string\n     */\n    private function parseClass()\n    {\n        $klass = get_class($this);\n\n        if ($klass === __CLASS__) {\n            return '';\n        }\n\n        return strtolower(substr($klass, strrpos($klass, '\\\\') + 1, -17));\n    }\n\n    private function getRegionFromArgs(array $args)\n    {\n        $region = isset($args['@region'])\n            ? $args['@region']\n            : $this->getRegion();\n        unset($args['@region']);\n\n        return [$region, $args];\n    }\n}\n", "num_lines": 261}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\n/**\n * Incremental hashing using PHP's hash functions.\n */\nclass PhpHash implements HashInterface\n{\n    /** @var resource|\\HashContext */\n    private $context;\n\n    /** @var string */\n    private $algo;\n\n    /** @var array */\n    private $options;\n\n    /** @var string */\n    private $hash;\n\n    /**\n     * @param string $algo Hashing algorithm. One of PHP's hash_algos()\n     *     return values (e.g. md5, sha1, etc...).\n     * @param array  $options Associative array of hashing options:\n     *     - key: Secret key used with the hashing algorithm.\n     *     - base64: Set to true to base64 encode the value when complete.\n     */\n    public function __construct($algo, array $options = [])\n    {\n        $this->algo = $algo;\n        $this->options = $options;\n    }\n\n    public function update($data)\n    {\n        if ($this->hash !== null) {\n            $this->reset();\n        }\n\n        hash_update($this->getContext(), $data);\n    }\n\n    public function complete()\n    {\n        if ($this->hash) {\n            return $this->hash;\n        }\n\n        $this->hash = hash_final($this->getContext(), true);\n\n        if (isset($this->options['base64']) && $this->options['base64']) {\n            $this->hash = base64_encode($this->hash);\n        }\n\n        return $this->hash;\n    }\n\n    public function reset()\n    {\n        $this->context = $this->hash = null;\n    }\n\n    /**\n     * Get a hash context or create one if needed\n     *\n     * @return resource|\\HashContext \n     */\n    private function getContext()\n    {\n        if (!$this->context) {\n            $key = isset($this->options['key']) ? $this->options['key'] : '';\n            $this->context = hash_init(\n                $this->algo,\n                $key ? HASH_HMAC : 0,\n                $key\n            );\n        }\n\n        return $this->context;\n    }\n}\n", "num_lines": 82}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Signature\\SignatureV4;\nuse Aws\\Endpoint\\EndpointProvider;\nuse GuzzleHttp\\Psr7\\Uri;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * @internal Adds computed values to service operations that need presigned url.\n */\nclass PresignUrlMiddleware\n{\n    private $client;\n    private $endpointProvider;\n    private $nextHandler;\n    /** @var array names of operations that require presign url */\n    private $commandPool;\n    /** @var array query params that are not on the operation's model to add before signing */\n    private $extraQueryParams;\n    /** @var string */\n    private $serviceName;\n    /** @var string */\n    private $presignParam;\n    /** @var bool */\n    private $requireDifferentRegion;\n\n    public function __construct(\n        array $options,\n        $endpointProvider,\n        AwsClientInterface $client,\n        callable $nextHandler\n    ) {\n        $this->endpointProvider = $endpointProvider;\n        $this->client = $client;\n        $this->nextHandler = $nextHandler;\n        $this->commandPool = $options['operations'];\n        $this->serviceName = $options['service'];\n        $this->presignParam = !empty($options['presign_param'])\n            ? $options['presign_param']\n            : 'PresignedUrl';\n        $this->extraQueryParams = !empty($options['extra_query_params'])\n            ? $options['extra_query_params']\n            : [];\n        $this->requireDifferentRegion = !empty($options['require_different_region']);\n    }\n\n    public static function wrap(\n        AwsClientInterface $client,\n        $endpointProvider,\n        array $options = []\n    ) {\n        return function (callable $handler) use ($endpointProvider, $client, $options) {\n            $f = new PresignUrlMiddleware($options, $endpointProvider, $client, $handler);\n            return $f;\n        };\n    }\n\n    public function __invoke(CommandInterface $cmd, RequestInterface $request = null)\n    {\n        if (in_array($cmd->getName(), $this->commandPool)\n            && (!isset($cmd->{'__skip' . $cmd->getName()}))\n        ) {\n            $cmd['DestinationRegion'] = $this->client->getRegion();\n            if (!empty($cmd['SourceRegion']) && !empty($cmd[$this->presignParam])) {\n                goto nexthandler;\n            }\n            if (!$this->requireDifferentRegion\n                || (!empty($cmd['SourceRegion'])\n                    && $cmd['SourceRegion'] !== $cmd['DestinationRegion'])\n            ) {\n                $cmd[$this->presignParam] = $this->createPresignedUrl($this->client, $cmd);\n            }\n        }\n        nexthandler:\n        $nextHandler = $this->nextHandler;\n        return $nextHandler($cmd, $request);\n    }\n\n    private function createPresignedUrl(\n        AwsClientInterface $client,\n        CommandInterface $cmd\n    ) {\n        $cmdName = $cmd->getName();\n        $newCmd = $client->getCommand($cmdName, $cmd->toArray());\n        // Avoid infinite recursion by flagging the new command.\n        $newCmd->{'__skip' . $cmdName} = true;\n\n        // Serialize a request for the operation.\n        $request = \\Aws\\serialize($newCmd);\n        // Create the new endpoint for the target endpoint.\n        if ($this->endpointProvider instanceof \\Aws\\EndpointV2\\EndpointProviderV2) {\n            $providerArgs = array_merge(\n                $this->client->getEndpointProviderArgs(),\n                ['Region' => $cmd['SourceRegion']]\n            );\n            $endpoint = $this->endpointProvider->resolveEndpoint($providerArgs)->getUrl();\n        } else {\n            $endpoint = EndpointProvider::resolve($this->endpointProvider, [\n                'region'  => $cmd['SourceRegion'],\n                'service' => $this->serviceName,\n            ])['endpoint'];\n        }\n\n        // Set the request to hit the target endpoint.\n        $uri = $request->getUri()->withHost((new Uri($endpoint))->getHost());\n        $request = $request->withUri($uri);\n\n        // Create a presigned URL for our generated request.\n        $signer = new SignatureV4($this->serviceName, $cmd['SourceRegion']);\n\n        $currentQueryParams = (string) $request->getBody();\n        $paramsToAdd = false;\n        if (!empty($this->extraQueryParams[$cmdName])) {\n            foreach ($this->extraQueryParams[$cmdName] as $param) {\n                if (!strpos($currentQueryParams, $param)) {\n                    $paramsToAdd =  \"&{$param}={$cmd[$param]}\";\n                }\n            }\n        }\n\n        return (string) $signer->presign(\n            SignatureV4::convertPostToGet($request, $paramsToAdd ?: \"\"),\n            $client->getCredentials()->wait(),\n            '+1 hour'\n        )->getUri();\n    }\n}\n", "num_lines": 129}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Psr\\SimpleCache\\CacheInterface as SimpleCacheInterface;\n\nclass Psr16CacheAdapter implements CacheInterface\n{\n    /** @var SimpleCacheInterface */\n    private $cache;\n\n    public function __construct(SimpleCacheInterface $cache)\n    {\n        $this->cache = $cache;\n    }\n\n    public function get($key)\n    {\n        return $this->cache->get($key);\n    }\n\n    public function set($key, $value, $ttl = 0)\n    {\n        $this->cache->set($key, $value, $ttl);\n    }\n\n    public function remove($key)\n    {\n        $this->cache->delete($key);\n    }\n}\n", "num_lines": 31}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Psr\\Cache\\CacheItemPoolInterface;\n\nclass PsrCacheAdapter implements CacheInterface\n{\n    /** @var CacheItemPoolInterface */\n    private $pool;\n\n    public function __construct(CacheItemPoolInterface $pool)\n    {\n        $this->pool = $pool;\n    }\n\n    public function get($key)\n    {\n        $item = $this->pool->getItem($key);\n\n        return $item->isHit() ? $item->get() : null;\n    }\n\n    public function set($key, $value, $ttl = 0)\n    {\n        $item = $this->pool->getItem($key);\n        $item->set($value);\n        if ($ttl > 0) {\n            $item->expiresAfter($ttl);\n        }\n\n        $this->pool->save($item);\n    }\n\n    public function remove($key)\n    {\n        $this->pool->deleteItem($key);\n    }\n}\n", "num_lines": 39}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse GuzzleHttp\\Psr7;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Used to compress request payloads if the service/operation support it.\n *\n * IMPORTANT: this middleware must be added after the \"build\" step.\n *\n * @internal\n */\nclass RequestCompressionMiddleware\n{\n    private $api;\n    private $minimumCompressionSize;\n    private $nextHandler;\n    private $encodings;\n    private $encoding;\n    private $encodingMap = [\n        'gzip' => 'gzencode'\n    ];\n\n    /**\n     * Create a middleware wrapper function.\n     *\n     * @return callable\n     */\n    public static function wrap(array $config)\n    {\n        return function (callable $handler) use ($config) {\n            return new self($handler, $config);\n        };\n    }\n\n    public function __construct(callable $nextHandler, $config)\n    {\n        $this->minimumCompressionSize = $this->determineMinimumCompressionSize($config);\n        $this->api = $config['api'];\n        $this->nextHandler = $nextHandler;\n    }\n\n    public function __invoke(CommandInterface $command, RequestInterface $request)\n    {\n        if (isset($command['@request_min_compression_size_bytes'])\n            && is_int($command['@request_min_compression_size_bytes'])\n            && $this->isValidCompressionSize($command['@request_min_compression_size_bytes'])\n        ) {\n            $this->minimumCompressionSize = $command['@request_min_compression_size_bytes'];\n        }\n        $nextHandler = $this->nextHandler;\n        $operation = $this->api->getOperation($command->getName());\n        $requestBodySize = $request->getBody()->getSize();\n        $compressionInfo = isset($operation['requestcompression'])\n            ? $operation['requestcompression']\n            : null;\n\n        if (!$this->shouldCompressRequestBody(\n            $compressionInfo,\n            $command,\n            $operation,\n            $requestBodySize\n        )) {\n            return $nextHandler($command, $request);\n        }\n\n        $this->encodings = $compressionInfo['encodings'];\n        $request = $this->compressRequestBody($request);\n\n        return $nextHandler($command, $request);\n    }\n\n    private function compressRequestBody(\n        RequestInterface $request\n    ) {\n        $fn = $this->determineEncoding();\n        if (is_null($fn)) {\n            return $request;\n        }\n\n        $body = $request->getBody()->getContents();\n        $compressedBody = $fn($body);\n\n        return $request->withBody(Psr7\\Utils::streamFor($compressedBody))\n            ->withHeader('content-encoding', $this->encoding);\n    }\n\n    private function determineEncoding()\n    {\n        foreach ($this->encodings as $encoding) {\n            if (isset($this->encodingMap[$encoding])) {\n                $this->encoding = $encoding;\n                return $this->encodingMap[$encoding];\n            }\n        }\n        return null;\n    }\n\n    private function shouldCompressRequestBody(\n        $compressionInfo,\n        $command,\n        $operation,\n        $requestBodySize\n    ){\n        if ($compressionInfo) {\n            if (isset($command['@disable_request_compression'])\n                && $command['@disable_request_compression'] === true\n            ) {\n                return false;\n            } elseif ($this->hasStreamingTraitWithoutRequiresLength($command, $operation)\n                || $requestBodySize >= $this->minimumCompressionSize\n            ) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    private function hasStreamingTraitWithoutRequiresLength($command, $operation)\n    {\n        foreach ($operation->getInput()->getMembers() as $name => $member) {\n            if (isset($command[$name])\n                && !empty($member['streaming'])\n                && empty($member['requiresLength'])\n            ){\n                return true;\n            }\n        }\n        return false;\n    }\n\n    private function determineMinimumCompressionSize($config) {\n        if (is_callable($config['request_min_compression_size_bytes'])) {\n            $minCompressionSz = $config['request_min_compression_size_bytes']();\n        } else {\n            $minCompressionSz = $config['request_min_compression_size_bytes'];\n        }\n\n        if ($this->isValidCompressionSize($minCompressionSz)) {\n            return $minCompressionSz;\n        }\n    }\n\n    private function isValidCompressionSize($compressionSize)\n    {\n        if (is_numeric($compressionSize)\n            && ($compressionSize >= 0 && $compressionSize <= 10485760)\n        ) {\n            return true;\n        }\n\n        throw new \\InvalidArgumentException(\n            'The minimum request compression size must be a '\n            . 'non-negative integer value between 0 and 10485760 bytes, inclusive.'\n        );\n    }\n}", "num_lines": 158}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws;\n\nuse Psr\\Http\\Message\\ResponseInterface;\n\ninterface ResponseContainerInterface\n{\n    /**\n     * Get the received HTTP response if any.\n     *\n     * @return ResponseInterface|null\n     */\n    public function getResponse();\n}", "num_lines": 15}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse JmesPath\\Env as JmesPath;\n\n/**\n * AWS result.\n */\nclass Result implements ResultInterface, MonitoringEventsInterface\n{\n    use HasDataTrait;\n    use HasMonitoringEventsTrait;\n\n    public function __construct(array $data = [])\n    {\n        $this->data = $data;\n    }\n\n    public function hasKey($name)\n    {\n        return isset($this->data[$name]);\n    }\n\n    public function get($key)\n    {\n        return $this[$key];\n    }\n\n    public function search($expression)\n    {\n        return JmesPath::search($expression, $this->toArray());\n    }\n\n    public function __toString()\n    {\n        $jsonData = json_encode($this->toArray(), JSON_PRETTY_PRINT);\n        return <<<EOT\nModel Data\n----------\nData can be retrieved from the model object using the get() method of the\nmodel (e.g., `\\$result->get(\\$key)`) or \"accessing the result like an\nassociative array (e.g. `\\$result['key']`). You can also execute JMESPath\nexpressions on the result data using the search() method.\n\n{$jsonData}\n\nEOT;\n    }\n\n    /**\n     * @deprecated\n     */\n    public function getPath($path)\n    {\n        return $this->search(str_replace('/', '.', $path));\n    }\n}\n", "num_lines": 58}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\n/**\n * Represents an AWS result object that is returned from executing an operation.\n */\ninterface ResultInterface extends \\ArrayAccess, \\IteratorAggregate, \\Countable\n{\n    /**\n     * Provides debug information about the result object\n     *\n     * @return string\n     */\n    public function __toString();\n\n    /**\n     * Convert the result to an array.\n     *\n     * @return array\n     */\n    public function toArray();\n\n    /**\n     * Check if the model contains a key by name\n     *\n     * @param string $name Name of the key to retrieve\n     *\n     * @return bool\n     */\n    public function hasKey($name);\n\n    /**\n     * Get a specific key value from the result model.\n     *\n     * @param string $key Key to retrieve.\n     *\n     * @return mixed|null Value of the key or NULL if not found.\n     */\n    public function get($key);\n\n    /**\n     * Returns the result of executing a JMESPath expression on the contents\n     * of the Result model.\n     *\n     *     $result = $client->execute($command);\n     *     $jpResult = $result->search('foo.*.bar[?baz > `10`]');\n     *\n     * @param string $expression JMESPath expression to execute\n     *\n     * @return mixed Returns the result of the JMESPath expression.\n     * @link http://jmespath.readthedocs.org/en/latest/ JMESPath documentation\n     */\n    public function search($expression);\n};\n", "num_lines": 55}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse GuzzleHttp\\Promise;\n\n/**\n * Iterator that yields each page of results of a pageable operation.\n */\nclass ResultPaginator implements \\Iterator\n{\n    /** @var AwsClientInterface Client performing operations. */\n    private $client;\n\n    /** @var string Name of the operation being paginated. */\n    private $operation;\n\n    /** @var array Args for the operation. */\n    private $args;\n\n    /** @var array Configuration for the paginator. */\n    private $config;\n\n    /** @var Result Most recent result from the client. */\n    private $result;\n\n    /** @var string|array Next token to use for pagination. */\n    private $nextToken;\n\n    /** @var int Number of operations/requests performed. */\n    private $requestCount = 0;\n\n    /**\n     * @param AwsClientInterface $client\n     * @param string             $operation\n     * @param array              $args\n     * @param array              $config\n     */\n    public function __construct(\n        AwsClientInterface $client,\n        $operation,\n        array $args,\n        array $config\n    ) {\n        $this->client = $client;\n        $this->operation = $operation;\n        $this->args = $args;\n        $this->config = $config;\n    }\n\n    /**\n     * Runs a paginator asynchronously and uses a callback to handle results.\n     *\n     * The callback should have the signature: function (Aws\\Result $result).\n     * A non-null return value from the callback will be yielded by the\n     * promise. This means that you can return promises from the callback that\n     * will need to be resolved before continuing iteration over the remaining\n     * items, essentially merging in other promises to the iteration. The last\n     * non-null value returned by the callback will be the result that fulfills\n     * the promise to any downstream promises.\n     *\n     * @param callable $handleResult Callback for handling each page of results.\n     *                               The callback accepts the result that was\n     *                               yielded as a single argument. If the\n     *                               callback returns a promise, the promise\n     *                               will be merged into the coroutine.\n     *\n     * @return Promise\\Promise\n     */\n    public function each(callable $handleResult)\n    {\n        return Promise\\Coroutine::of(function () use ($handleResult) {\n            $nextToken = null;\n            do {\n                $command = $this->createNextCommand($this->args, $nextToken);\n                $result = (yield $this->client->executeAsync($command));\n                $nextToken = $this->determineNextToken($result);\n                $retVal = $handleResult($result);\n                if ($retVal !== null) {\n                    yield Promise\\Create::promiseFor($retVal);\n                }\n            } while ($nextToken);\n        });\n    }\n\n    /**\n     * Returns an iterator that iterates over the values of applying a JMESPath\n     * search to each result yielded by the iterator as a flat sequence.\n     *\n     * @param string $expression JMESPath expression to apply to each result.\n     *\n     * @return \\Iterator\n     */\n    public function search($expression)\n    {\n        // Apply JMESPath expression on each result, but as a flat sequence.\n        return flatmap($this, function (Result $result) use ($expression) {\n            return (array) $result->search($expression);\n        });\n    }\n\n    /**\n     * @return Result\n     */\n    #[\\ReturnTypeWillChange]\n    public function current()\n    {\n        return $this->valid() ? $this->result : false;\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function key()\n    {\n        return $this->valid() ? $this->requestCount - 1 : null;\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function next()\n    {\n        $this->result = null;\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function valid()\n    {\n        if ($this->result) {\n            return true;\n        }\n\n        if ($this->nextToken || !$this->requestCount) {\n            //Forward/backward paging can result in a case where the last page's nextforwardtoken\n            //is the same as the one that came before it.  This can cause an infinite loop.\n            $hasBidirectionalPaging = $this->config['output_token'] === 'nextForwardToken';\n            if ($hasBidirectionalPaging && $this->nextToken) {\n                $tokenKey = $this->config['input_token'];\n                $previousToken = $this->nextToken[$tokenKey];\n            }\n\n            $this->result = $this->client->execute(\n                $this->createNextCommand($this->args, $this->nextToken)\n            );\n\n            $this->nextToken = $this->determineNextToken($this->result);\n\n            if (isset($previousToken)\n                && $previousToken === $this->nextToken[$tokenKey]\n            ) {\n                return false;\n            }\n\n            $this->requestCount++;\n            return true;\n        }\n\n        return false;\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function rewind()\n    {\n        $this->requestCount = 0;\n        $this->nextToken = null;\n        $this->result = null;\n    }\n\n    private function createNextCommand(array $args, array $nextToken = null)\n    {\n        return $this->client->getCommand($this->operation, array_merge($args, ($nextToken ?: [])));\n    }\n\n    private function determineNextToken(Result $result)\n    {\n        if (!$this->config['output_token']) {\n            return null;\n        }\n\n        if ($this->config['more_results']\n            && !$result->search($this->config['more_results'])\n        ) {\n            return null;\n        }\n\n        $nextToken = is_scalar($this->config['output_token'])\n            ? [$this->config['input_token'] => $this->config['output_token']]\n            : array_combine($this->config['input_token'], $this->config['output_token']);\n\n        return array_filter(array_map(function ($outputToken) use ($result) {\n            return $result->search($outputToken);\n        }, $nextToken));\n    }\n}\n", "num_lines": 191}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Exception\\AwsException;\nuse Aws\\Retry\\RetryHelperTrait;\nuse GuzzleHttp\\Exception\\RequestException;\nuse Psr\\Http\\Message\\RequestInterface;\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse GuzzleHttp\\Promise;\n\n/**\n * Middleware that retries failures. V1 implemention that supports 'legacy' mode.\n *\n * @internal\n */\nclass RetryMiddleware\n{\n    use RetryHelperTrait;\n\n    private static $retryStatusCodes = [\n        500 => true,\n        502 => true,\n        503 => true,\n        504 => true\n    ];\n\n    private static $retryCodes = [\n        // Throttling error\n        'RequestLimitExceeded'                   => true,\n        'Throttling'                             => true,\n        'ThrottlingException'                    => true,\n        'ThrottledException'                     => true,\n        'ProvisionedThroughputExceededException' => true,\n        'RequestThrottled'                       => true,\n        'BandwidthLimitExceeded'                 => true,\n        'RequestThrottledException'              => true,\n        'TooManyRequestsException'               => true,\n        'IDPCommunicationError'                  => true,\n        'EC2ThrottledException'                  => true,\n    ];\n\n    private $decider;\n    private $delay;\n    private $nextHandler;\n    private $collectStats;\n\n    public function __construct(\n        callable $decider,\n        callable $delay,\n        callable $nextHandler,\n        $collectStats = false\n    ) {\n        $this->decider = $decider;\n        $this->delay = $delay;\n        $this->nextHandler = $nextHandler;\n        $this->collectStats = (bool) $collectStats;\n    }\n\n    /**\n     * Creates a default AWS retry decider function.\n     *\n     * The optional $extraConfig parameter is an associative array\n     * that specifies additional retry conditions on top of the ones specified\n     * by default by the Aws\\RetryMiddleware class, with the following keys:\n     *\n     * - errorCodes: (string[]) An indexed array of AWS exception codes to retry.\n     *   Optional.\n     * - statusCodes: (int[]) An indexed array of HTTP status codes to retry.\n     *   Optional.\n     * - curlErrors: (int[]) An indexed array of Curl error codes to retry. Note\n     *   these should be valid Curl constants. Optional.\n     *\n     * @param int $maxRetries\n     * @param array $extraConfig\n     * @return callable\n     */\n    public static function createDefaultDecider(\n        $maxRetries = 3,\n        $extraConfig = []\n    ) {\n        $retryCurlErrors = [];\n        if (extension_loaded('curl')) {\n            $retryCurlErrors[CURLE_RECV_ERROR] = true;\n        }\n\n        return function (\n            $retries,\n            CommandInterface $command,\n            RequestInterface $request,\n            ResultInterface $result = null,\n            $error = null\n        ) use ($maxRetries, $retryCurlErrors, $extraConfig) {\n            // Allow command-level options to override this value\n            $maxRetries = null !== $command['@retries'] ?\n                $command['@retries']\n                : $maxRetries;\n\n            $isRetryable = self::isRetryable(\n                $result,\n                $error,\n                $retryCurlErrors,\n                $extraConfig\n            );\n\n            if ($retries >= $maxRetries) {\n                if (!empty($error)\n                    && $error instanceof AwsException\n                    && $isRetryable\n                ) {\n                    $error->setMaxRetriesExceeded();\n                }\n                return false;\n            }\n\n            return $isRetryable;\n        };\n    }\n\n    private static function isRetryable(\n        $result,\n        $error,\n        $retryCurlErrors,\n        $extraConfig = []\n    ) {\n        $errorCodes = self::$retryCodes;\n        if (!empty($extraConfig['error_codes'])\n            && is_array($extraConfig['error_codes'])\n        ) {\n            foreach($extraConfig['error_codes'] as $code) {\n                $errorCodes[$code] = true;\n            }\n        }\n\n        $statusCodes = self::$retryStatusCodes;\n        if (!empty($extraConfig['status_codes'])\n            && is_array($extraConfig['status_codes'])\n        ) {\n            foreach($extraConfig['status_codes'] as $code) {\n                $statusCodes[$code] = true;\n            }\n        }\n\n        if (!empty($extraConfig['curl_errors'])\n            && is_array($extraConfig['curl_errors'])\n        ) {\n            foreach($extraConfig['curl_errors'] as $code) {\n                $retryCurlErrors[$code] = true;\n            }\n        }\n\n        if (!$error) {\n            if (!isset($result['@metadata']['statusCode'])) {\n                return false;\n            }\n            return isset($statusCodes[$result['@metadata']['statusCode']]);\n        }\n\n        if (!($error instanceof AwsException)) {\n            return false;\n        }\n\n        if ($error->isConnectionError()) {\n            return true;\n        }\n\n        if (isset($errorCodes[$error->getAwsErrorCode()])) {\n            return true;\n        }\n\n        if (isset($statusCodes[$error->getStatusCode()])) {\n            return true;\n        }\n\n        if (count($retryCurlErrors)\n            && ($previous = $error->getPrevious())\n            && $previous instanceof RequestException\n        ) {\n            if (method_exists($previous, 'getHandlerContext')) {\n                $context = $previous->getHandlerContext();\n                return !empty($context['errno'])\n                    && isset($retryCurlErrors[$context['errno']]);\n            }\n\n            $message = $previous->getMessage();\n            foreach (array_keys($retryCurlErrors) as $curlError) {\n                if (strpos($message, 'cURL error ' . $curlError . ':') === 0) {\n                    return true;\n                }\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Delay function that calculates an exponential delay.\n     *\n     * Exponential backoff with jitter, 100ms base, 20 sec ceiling\n     *\n     * @param $retries - The number of retries that have already been attempted\n     *\n     * @return int\n     *\n     * @link https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/\n     */\n    public static function exponentialDelay($retries)\n    {\n        return mt_rand(0, (int) min(20000, (int) pow(2, $retries) * 100));\n    }\n\n    /**\n     * @param CommandInterface $command\n     * @param RequestInterface $request\n     *\n     * @return PromiseInterface\n     */\n    public function __invoke(\n        CommandInterface $command,\n        RequestInterface $request = null\n    ) {\n        $retries = 0;\n        $requestStats = [];\n        $monitoringEvents = [];\n        $handler = $this->nextHandler;\n        $decider = $this->decider;\n        $delay = $this->delay;\n\n        $request = $this->addRetryHeader($request, 0, 0);\n\n        $g = function ($value) use (\n            $handler,\n            $decider,\n            $delay,\n            $command,\n            $request,\n            &$retries,\n            &$requestStats,\n            &$monitoringEvents,\n            &$g\n        ) {\n            $this->updateHttpStats($value, $requestStats);\n\n            if ($value instanceof MonitoringEventsInterface) {\n                $reversedEvents = array_reverse($monitoringEvents);\n                $monitoringEvents = array_merge($monitoringEvents, $value->getMonitoringEvents());\n                foreach ($reversedEvents as $event) {\n                    $value->prependMonitoringEvent($event);\n                }\n            }\n            if ($value instanceof \\Exception || $value instanceof \\Throwable) {\n                if (!$decider($retries, $command, $request, null, $value)) {\n                    return Promise\\Create::rejectionFor(\n                        $this->bindStatsToReturn($value, $requestStats)\n                    );\n                }\n            } elseif ($value instanceof ResultInterface\n                && !$decider($retries, $command, $request, $value, null)\n            ) {\n                return $this->bindStatsToReturn($value, $requestStats);\n            }\n\n            // Delay fn is called with 0, 1, ... so increment after the call.\n            $delayBy = $delay($retries++);\n            $command['@http']['delay'] = $delayBy;\n            if ($this->collectStats) {\n                $this->updateStats($retries, $delayBy, $requestStats);\n            }\n\n            // Update retry header with retry count and delayBy\n            $request = $this->addRetryHeader($request, $retries, $delayBy);\n\n            return $handler($command, $request)->then($g, $g);\n        };\n\n        return $handler($command, $request)->then($g, $g);\n    }\n}\n", "num_lines": 278}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Exception\\AwsException;\nuse Aws\\Retry\\ConfigurationInterface;\nuse Aws\\Retry\\QuotaManager;\nuse Aws\\Retry\\RateLimiter;\nuse Aws\\Retry\\RetryHelperTrait;\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\Promise;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Middleware that retries failures. V2 implementation that supports 'standard'\n * and 'adaptive' modes.\n *\n * @internal\n */\nclass RetryMiddlewareV2\n{\n    use RetryHelperTrait;\n\n    private static $standardThrottlingErrors = [\n        'Throttling'                                => true,\n        'ThrottlingException'                       => true,\n        'ThrottledException'                        => true,\n        'RequestThrottledException'                 => true,\n        'TooManyRequestsException'                  => true,\n        'ProvisionedThroughputExceededException'    => true,\n        'TransactionInProgressException'            => true,\n        'RequestLimitExceeded'                      => true,\n        'BandwidthLimitExceeded'                    => true,\n        'LimitExceededException'                    => true,\n        'RequestThrottled'                          => true,\n        'SlowDown'                                  => true,\n        'PriorRequestNotComplete'                   => true,\n        'EC2ThrottledException'                     => true,\n    ];\n\n    private static $standardTransientErrors = [\n        'RequestTimeout'            => true,\n        'RequestTimeoutException'   => true,\n    ];\n\n    private static $standardTransientStatusCodes = [\n        500 => true,\n        502 => true,\n        503 => true,\n        504 => true,\n    ];\n\n    private $collectStats;\n    private $decider;\n    private $delayer;\n    private $maxAttempts;\n    private $maxBackoff;\n    private $mode;\n    private $nextHandler;\n    private $options;\n    private $quotaManager;\n    private $rateLimiter;\n\n    public static function wrap($config, $options)\n    {\n        return function (callable $handler) use (\n            $config,\n            $options\n        ) {\n            return new static(\n                $config,\n                $handler,\n                $options\n            );\n        };\n    }\n\n    public static function createDefaultDecider(\n        QuotaManager $quotaManager,\n        $maxAttempts = 3,\n        $options = []\n    ) {\n        $retryCurlErrors = [];\n        if (extension_loaded('curl')) {\n            $retryCurlErrors[CURLE_RECV_ERROR] = true;\n        }\n\n        return function(\n            $attempts,\n            CommandInterface $command,\n            $result\n        ) use ($options, $quotaManager, $retryCurlErrors, $maxAttempts) {\n\n            // Release retry tokens back to quota on a successful result\n            $quotaManager->releaseToQuota($result);\n\n            // Allow command-level option to override this value\n            // # of attempts = # of retries + 1\n            $maxAttempts = (null !== $command['@retries'])\n                ? $command['@retries'] + 1\n                : $maxAttempts;\n\n            $isRetryable = self::isRetryable(\n                $result,\n                $retryCurlErrors,\n                $options\n            );\n\n            if ($isRetryable) {\n\n                // Retrieve retry tokens and check if quota has been exceeded\n                if (!$quotaManager->hasRetryQuota($result)) {\n                    return false;\n                }\n\n                if ($attempts >= $maxAttempts) {\n                    if (!empty($result) && $result instanceof AwsException) {\n                        $result->setMaxRetriesExceeded();\n                    }\n                    return false;\n                }\n            }\n\n            return $isRetryable;\n        };\n    }\n\n    public function __construct(\n        ConfigurationInterface $config,\n        callable $handler,\n        $options = []\n    ) {\n        $this->options = $options;\n        $this->maxAttempts = $config->getMaxAttempts();\n        $this->mode = $config->getMode();\n        $this->nextHandler = $handler;\n        $this->quotaManager = new QuotaManager();\n\n        $this->maxBackoff = isset($options['max_backoff'])\n            ? $options['max_backoff']\n            : 20000;\n\n        $this->collectStats = isset($options['collect_stats'])\n            ? (bool) $options['collect_stats']\n            : false;\n\n        $this->decider = isset($options['decider'])\n            ? $options['decider']\n            : self::createDefaultDecider(\n                $this->quotaManager,\n                $this->maxAttempts,\n                $options\n            );\n\n        $this->delayer = isset($options['delayer'])\n            ? $options['delayer']\n            : function ($attempts) {\n                return $this->exponentialDelayWithJitter($attempts);\n            };\n\n        if ($this->mode === 'adaptive') {\n            $this->rateLimiter = isset($options['rate_limiter'])\n                ? $options['rate_limiter']\n                : new RateLimiter();\n        }\n    }\n\n    public function __invoke(CommandInterface $cmd, RequestInterface $req)\n    {\n        $decider = $this->decider;\n        $delayer = $this->delayer;\n        $handler = $this->nextHandler;\n\n        $attempts = 1;\n        $monitoringEvents = [];\n        $requestStats = [];\n\n        $req = $this->addRetryHeader($req, 0, 0);\n\n        $callback = function ($value) use (\n            $handler,\n            $cmd,\n            $req,\n            $decider,\n            $delayer,\n            &$attempts,\n            &$requestStats,\n            &$monitoringEvents,\n            &$callback\n        ) {\n            if ($this->mode === 'adaptive') {\n                $this->rateLimiter->updateSendingRate($this->isThrottlingError($value));\n            }\n\n            $this->updateHttpStats($value, $requestStats);\n\n            if ($value instanceof MonitoringEventsInterface) {\n                $reversedEvents = array_reverse($monitoringEvents);\n                $monitoringEvents = array_merge($monitoringEvents, $value->getMonitoringEvents());\n                foreach ($reversedEvents as $event) {\n                    $value->prependMonitoringEvent($event);\n                }\n            }\n            if ($value instanceof \\Exception || $value instanceof \\Throwable) {\n                if (!$decider($attempts, $cmd, $value)) {\n                    return Promise\\Create::rejectionFor(\n                        $this->bindStatsToReturn($value, $requestStats)\n                    );\n                }\n            } elseif ($value instanceof ResultInterface\n                && !$decider($attempts, $cmd, $value)\n            ) {\n                return $this->bindStatsToReturn($value, $requestStats);\n            }\n\n            $delayBy = $delayer($attempts++);\n            $cmd['@http']['delay'] = $delayBy;\n            if ($this->collectStats) {\n                $this->updateStats($attempts - 1, $delayBy, $requestStats);\n            }\n\n            // Update retry header with retry count and delayBy\n            $req = $this->addRetryHeader($req, $attempts - 1, $delayBy);\n\n            // Get token from rate limiter, which will sleep if necessary\n            if ($this->mode === 'adaptive') {\n                $this->rateLimiter->getSendToken();\n            }\n\n            return $handler($cmd, $req)->then($callback, $callback);\n        };\n\n        // Get token from rate limiter, which will sleep if necessary\n        if ($this->mode === 'adaptive') {\n            $this->rateLimiter->getSendToken();\n        }\n\n        return $handler($cmd, $req)->then($callback, $callback);\n    }\n\n    /**\n     * Amount of milliseconds to delay as a function of attempt number\n     *\n     * @param $attempts\n     * @return mixed\n     */\n    public function exponentialDelayWithJitter($attempts)\n    {\n        $rand = mt_rand() / mt_getrandmax();\n        return min(1000 * $rand * pow(2, $attempts) , $this->maxBackoff);\n    }\n\n    private static function isRetryable(\n        $result,\n        $retryCurlErrors,\n        $options = []\n    ) {\n        $errorCodes = self::$standardThrottlingErrors + self::$standardTransientErrors;\n        if (!empty($options['transient_error_codes'])\n            && is_array($options['transient_error_codes'])\n        ) {\n            foreach($options['transient_error_codes'] as $code) {\n                $errorCodes[$code] = true;\n            }\n        }\n        if (!empty($options['throttling_error_codes'])\n            && is_array($options['throttling_error_codes'])\n        ) {\n            foreach($options['throttling_error_codes'] as $code) {\n                $errorCodes[$code] = true;\n            }\n        }\n\n        $statusCodes = self::$standardTransientStatusCodes;\n        if (!empty($options['status_codes'])\n            && is_array($options['status_codes'])\n        ) {\n            foreach($options['status_codes'] as $code) {\n                $statusCodes[$code] = true;\n            }\n        }\n\n        if (!empty($options['curl_errors'])\n            && is_array($options['curl_errors'])\n        ) {\n            foreach($options['curl_errors'] as $code) {\n                $retryCurlErrors[$code] = true;\n            }\n        }\n\n        if ($result instanceof \\Exception || $result instanceof \\Throwable) {\n            $isError = true;\n        } else {\n            $isError = false;\n        }\n\n        if (!$isError) {\n            if (!isset($result['@metadata']['statusCode'])) {\n                return false;\n            }\n            return isset($statusCodes[$result['@metadata']['statusCode']]);\n        }\n\n        if (!($result instanceof AwsException)) {\n            return false;\n        }\n\n        if ($result->isConnectionError()) {\n            return true;\n        }\n\n        if (!empty($errorCodes[$result->getAwsErrorCode()])) {\n            return true;\n        }\n\n        if (!empty($statusCodes[$result->getStatusCode()])) {\n            return true;\n        }\n\n        if (count($retryCurlErrors)\n            && ($previous = $result->getPrevious())\n            && $previous instanceof RequestException\n        ) {\n            if (method_exists($previous, 'getHandlerContext')) {\n                $context = $previous->getHandlerContext();\n                return !empty($context['errno'])\n                    && isset($retryCurlErrors[$context['errno']]);\n            }\n\n            $message = $previous->getMessage();\n            foreach (array_keys($retryCurlErrors) as $curlError) {\n                if (strpos($message, 'cURL error ' . $curlError . ':') === 0) {\n                    return true;\n                }\n            }\n        }\n\n        // Check error shape for the retryable trait\n        if (!empty($errorShape = $result->getAwsErrorShape())) {\n            $definition = $errorShape->toArray();\n            if (!empty($definition['retryable'])) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    private function isThrottlingError($result)\n    {\n        if ($result instanceof AwsException) {\n            // Check pre-defined throttling errors\n            $throttlingErrors = self::$standardThrottlingErrors;\n            if (!empty($this->options['throttling_error_codes'])\n                && is_array($this->options['throttling_error_codes'])\n            ) {\n                foreach($this->options['throttling_error_codes'] as $code) {\n                    $throttlingErrors[$code] = true;\n                }\n            }\n            if (!empty($result->getAwsErrorCode())\n                && !empty($throttlingErrors[$result->getAwsErrorCode()])\n            ) {\n                return true;\n            }\n\n            // Check error shape for the throttling trait\n            if (!empty($errorShape = $result->getAwsErrorShape())) {\n                $definition = $errorShape->toArray();\n                if (!empty($definition['retryable']['throttling'])) {\n                    return true;\n                }\n            }\n        }\n\n        return false;\n    }\n}\n", "num_lines": 378}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\n/**\n * Builds AWS clients based on configuration settings.\n *\n * @method \\Aws\\ACMPCA\\ACMPCAClient createACMPCA(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionACMPCA(array $args = [])\n * @method \\Aws\\ARCZonalShift\\ARCZonalShiftClient createARCZonalShift(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionARCZonalShift(array $args = [])\n * @method \\Aws\\AccessAnalyzer\\AccessAnalyzerClient createAccessAnalyzer(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAccessAnalyzer(array $args = [])\n * @method \\Aws\\Account\\AccountClient createAccount(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAccount(array $args = [])\n * @method \\Aws\\Acm\\AcmClient createAcm(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAcm(array $args = [])\n * @method \\Aws\\AlexaForBusiness\\AlexaForBusinessClient createAlexaForBusiness(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAlexaForBusiness(array $args = [])\n * @method \\Aws\\Amplify\\AmplifyClient createAmplify(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAmplify(array $args = [])\n * @method \\Aws\\AmplifyBackend\\AmplifyBackendClient createAmplifyBackend(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAmplifyBackend(array $args = [])\n * @method \\Aws\\AmplifyUIBuilder\\AmplifyUIBuilderClient createAmplifyUIBuilder(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAmplifyUIBuilder(array $args = [])\n * @method \\Aws\\ApiGateway\\ApiGatewayClient createApiGateway(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionApiGateway(array $args = [])\n * @method \\Aws\\ApiGatewayManagementApi\\ApiGatewayManagementApiClient createApiGatewayManagementApi(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionApiGatewayManagementApi(array $args = [])\n * @method \\Aws\\ApiGatewayV2\\ApiGatewayV2Client createApiGatewayV2(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionApiGatewayV2(array $args = [])\n * @method \\Aws\\AppConfig\\AppConfigClient createAppConfig(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAppConfig(array $args = [])\n * @method \\Aws\\AppConfigData\\AppConfigDataClient createAppConfigData(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAppConfigData(array $args = [])\n * @method \\Aws\\AppFabric\\AppFabricClient createAppFabric(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAppFabric(array $args = [])\n * @method \\Aws\\AppIntegrationsService\\AppIntegrationsServiceClient createAppIntegrationsService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAppIntegrationsService(array $args = [])\n * @method \\Aws\\AppMesh\\AppMeshClient createAppMesh(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAppMesh(array $args = [])\n * @method \\Aws\\AppRegistry\\AppRegistryClient createAppRegistry(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAppRegistry(array $args = [])\n * @method \\Aws\\AppRunner\\AppRunnerClient createAppRunner(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAppRunner(array $args = [])\n * @method \\Aws\\AppSync\\AppSyncClient createAppSync(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAppSync(array $args = [])\n * @method \\Aws\\Appflow\\AppflowClient createAppflow(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAppflow(array $args = [])\n * @method \\Aws\\ApplicationAutoScaling\\ApplicationAutoScalingClient createApplicationAutoScaling(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionApplicationAutoScaling(array $args = [])\n * @method \\Aws\\ApplicationCostProfiler\\ApplicationCostProfilerClient createApplicationCostProfiler(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionApplicationCostProfiler(array $args = [])\n * @method \\Aws\\ApplicationDiscoveryService\\ApplicationDiscoveryServiceClient createApplicationDiscoveryService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionApplicationDiscoveryService(array $args = [])\n * @method \\Aws\\ApplicationInsights\\ApplicationInsightsClient createApplicationInsights(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionApplicationInsights(array $args = [])\n * @method \\Aws\\Appstream\\AppstreamClient createAppstream(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAppstream(array $args = [])\n * @method \\Aws\\Athena\\AthenaClient createAthena(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAthena(array $args = [])\n * @method \\Aws\\AuditManager\\AuditManagerClient createAuditManager(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAuditManager(array $args = [])\n * @method \\Aws\\AugmentedAIRuntime\\AugmentedAIRuntimeClient createAugmentedAIRuntime(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAugmentedAIRuntime(array $args = [])\n * @method \\Aws\\AutoScaling\\AutoScalingClient createAutoScaling(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAutoScaling(array $args = [])\n * @method \\Aws\\AutoScalingPlans\\AutoScalingPlansClient createAutoScalingPlans(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionAutoScalingPlans(array $args = [])\n * @method \\Aws\\Backup\\BackupClient createBackup(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionBackup(array $args = [])\n * @method \\Aws\\BackupGateway\\BackupGatewayClient createBackupGateway(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionBackupGateway(array $args = [])\n * @method \\Aws\\BackupStorage\\BackupStorageClient createBackupStorage(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionBackupStorage(array $args = [])\n * @method \\Aws\\Batch\\BatchClient createBatch(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionBatch(array $args = [])\n * @method \\Aws\\BillingConductor\\BillingConductorClient createBillingConductor(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionBillingConductor(array $args = [])\n * @method \\Aws\\Braket\\BraketClient createBraket(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionBraket(array $args = [])\n * @method \\Aws\\Budgets\\BudgetsClient createBudgets(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionBudgets(array $args = [])\n * @method \\Aws\\Chime\\ChimeClient createChime(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionChime(array $args = [])\n * @method \\Aws\\ChimeSDKIdentity\\ChimeSDKIdentityClient createChimeSDKIdentity(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionChimeSDKIdentity(array $args = [])\n * @method \\Aws\\ChimeSDKMediaPipelines\\ChimeSDKMediaPipelinesClient createChimeSDKMediaPipelines(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionChimeSDKMediaPipelines(array $args = [])\n * @method \\Aws\\ChimeSDKMeetings\\ChimeSDKMeetingsClient createChimeSDKMeetings(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionChimeSDKMeetings(array $args = [])\n * @method \\Aws\\ChimeSDKMessaging\\ChimeSDKMessagingClient createChimeSDKMessaging(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionChimeSDKMessaging(array $args = [])\n * @method \\Aws\\ChimeSDKVoice\\ChimeSDKVoiceClient createChimeSDKVoice(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionChimeSDKVoice(array $args = [])\n * @method \\Aws\\CleanRooms\\CleanRoomsClient createCleanRooms(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCleanRooms(array $args = [])\n * @method \\Aws\\Cloud9\\Cloud9Client createCloud9(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCloud9(array $args = [])\n * @method \\Aws\\CloudControlApi\\CloudControlApiClient createCloudControlApi(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCloudControlApi(array $args = [])\n * @method \\Aws\\CloudDirectory\\CloudDirectoryClient createCloudDirectory(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCloudDirectory(array $args = [])\n * @method \\Aws\\CloudFormation\\CloudFormationClient createCloudFormation(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCloudFormation(array $args = [])\n * @method \\Aws\\CloudFront\\CloudFrontClient createCloudFront(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCloudFront(array $args = [])\n * @method \\Aws\\CloudHSMV2\\CloudHSMV2Client createCloudHSMV2(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCloudHSMV2(array $args = [])\n * @method \\Aws\\CloudHsm\\CloudHsmClient createCloudHsm(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCloudHsm(array $args = [])\n * @method \\Aws\\CloudSearch\\CloudSearchClient createCloudSearch(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCloudSearch(array $args = [])\n * @method \\Aws\\CloudSearchDomain\\CloudSearchDomainClient createCloudSearchDomain(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCloudSearchDomain(array $args = [])\n * @method \\Aws\\CloudTrail\\CloudTrailClient createCloudTrail(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCloudTrail(array $args = [])\n * @method \\Aws\\CloudTrailData\\CloudTrailDataClient createCloudTrailData(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCloudTrailData(array $args = [])\n * @method \\Aws\\CloudWatch\\CloudWatchClient createCloudWatch(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCloudWatch(array $args = [])\n * @method \\Aws\\CloudWatchEvents\\CloudWatchEventsClient createCloudWatchEvents(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCloudWatchEvents(array $args = [])\n * @method \\Aws\\CloudWatchEvidently\\CloudWatchEvidentlyClient createCloudWatchEvidently(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCloudWatchEvidently(array $args = [])\n * @method \\Aws\\CloudWatchLogs\\CloudWatchLogsClient createCloudWatchLogs(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCloudWatchLogs(array $args = [])\n * @method \\Aws\\CloudWatchRUM\\CloudWatchRUMClient createCloudWatchRUM(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCloudWatchRUM(array $args = [])\n * @method \\Aws\\CodeArtifact\\CodeArtifactClient createCodeArtifact(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCodeArtifact(array $args = [])\n * @method \\Aws\\CodeBuild\\CodeBuildClient createCodeBuild(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCodeBuild(array $args = [])\n * @method \\Aws\\CodeCatalyst\\CodeCatalystClient createCodeCatalyst(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCodeCatalyst(array $args = [])\n * @method \\Aws\\CodeCommit\\CodeCommitClient createCodeCommit(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCodeCommit(array $args = [])\n * @method \\Aws\\CodeDeploy\\CodeDeployClient createCodeDeploy(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCodeDeploy(array $args = [])\n * @method \\Aws\\CodeGuruProfiler\\CodeGuruProfilerClient createCodeGuruProfiler(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCodeGuruProfiler(array $args = [])\n * @method \\Aws\\CodeGuruReviewer\\CodeGuruReviewerClient createCodeGuruReviewer(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCodeGuruReviewer(array $args = [])\n * @method \\Aws\\CodeGuruSecurity\\CodeGuruSecurityClient createCodeGuruSecurity(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCodeGuruSecurity(array $args = [])\n * @method \\Aws\\CodePipeline\\CodePipelineClient createCodePipeline(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCodePipeline(array $args = [])\n * @method \\Aws\\CodeStar\\CodeStarClient createCodeStar(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCodeStar(array $args = [])\n * @method \\Aws\\CodeStarNotifications\\CodeStarNotificationsClient createCodeStarNotifications(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCodeStarNotifications(array $args = [])\n * @method \\Aws\\CodeStarconnections\\CodeStarconnectionsClient createCodeStarconnections(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCodeStarconnections(array $args = [])\n * @method \\Aws\\CognitoIdentity\\CognitoIdentityClient createCognitoIdentity(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCognitoIdentity(array $args = [])\n * @method \\Aws\\CognitoIdentityProvider\\CognitoIdentityProviderClient createCognitoIdentityProvider(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCognitoIdentityProvider(array $args = [])\n * @method \\Aws\\CognitoSync\\CognitoSyncClient createCognitoSync(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCognitoSync(array $args = [])\n * @method \\Aws\\Comprehend\\ComprehendClient createComprehend(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionComprehend(array $args = [])\n * @method \\Aws\\ComprehendMedical\\ComprehendMedicalClient createComprehendMedical(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionComprehendMedical(array $args = [])\n * @method \\Aws\\ComputeOptimizer\\ComputeOptimizerClient createComputeOptimizer(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionComputeOptimizer(array $args = [])\n * @method \\Aws\\ConfigService\\ConfigServiceClient createConfigService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionConfigService(array $args = [])\n * @method \\Aws\\Connect\\ConnectClient createConnect(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionConnect(array $args = [])\n * @method \\Aws\\ConnectCampaignService\\ConnectCampaignServiceClient createConnectCampaignService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionConnectCampaignService(array $args = [])\n * @method \\Aws\\ConnectCases\\ConnectCasesClient createConnectCases(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionConnectCases(array $args = [])\n * @method \\Aws\\ConnectContactLens\\ConnectContactLensClient createConnectContactLens(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionConnectContactLens(array $args = [])\n * @method \\Aws\\ConnectParticipant\\ConnectParticipantClient createConnectParticipant(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionConnectParticipant(array $args = [])\n * @method \\Aws\\ConnectWisdomService\\ConnectWisdomServiceClient createConnectWisdomService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionConnectWisdomService(array $args = [])\n * @method \\Aws\\ControlTower\\ControlTowerClient createControlTower(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionControlTower(array $args = [])\n * @method \\Aws\\CostExplorer\\CostExplorerClient createCostExplorer(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCostExplorer(array $args = [])\n * @method \\Aws\\CostandUsageReportService\\CostandUsageReportServiceClient createCostandUsageReportService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCostandUsageReportService(array $args = [])\n * @method \\Aws\\CustomerProfiles\\CustomerProfilesClient createCustomerProfiles(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionCustomerProfiles(array $args = [])\n * @method \\Aws\\DAX\\DAXClient createDAX(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionDAX(array $args = [])\n * @method \\Aws\\DLM\\DLMClient createDLM(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionDLM(array $args = [])\n * @method \\Aws\\DataExchange\\DataExchangeClient createDataExchange(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionDataExchange(array $args = [])\n * @method \\Aws\\DataPipeline\\DataPipelineClient createDataPipeline(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionDataPipeline(array $args = [])\n * @method \\Aws\\DataSync\\DataSyncClient createDataSync(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionDataSync(array $args = [])\n * @method \\Aws\\DatabaseMigrationService\\DatabaseMigrationServiceClient createDatabaseMigrationService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionDatabaseMigrationService(array $args = [])\n * @method \\Aws\\Detective\\DetectiveClient createDetective(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionDetective(array $args = [])\n * @method \\Aws\\DevOpsGuru\\DevOpsGuruClient createDevOpsGuru(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionDevOpsGuru(array $args = [])\n * @method \\Aws\\DeviceFarm\\DeviceFarmClient createDeviceFarm(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionDeviceFarm(array $args = [])\n * @method \\Aws\\DirectConnect\\DirectConnectClient createDirectConnect(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionDirectConnect(array $args = [])\n * @method \\Aws\\DirectoryService\\DirectoryServiceClient createDirectoryService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionDirectoryService(array $args = [])\n * @method \\Aws\\DocDB\\DocDBClient createDocDB(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionDocDB(array $args = [])\n * @method \\Aws\\DocDBElastic\\DocDBElasticClient createDocDBElastic(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionDocDBElastic(array $args = [])\n * @method \\Aws\\DynamoDb\\DynamoDbClient createDynamoDb(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionDynamoDb(array $args = [])\n * @method \\Aws\\DynamoDbStreams\\DynamoDbStreamsClient createDynamoDbStreams(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionDynamoDbStreams(array $args = [])\n * @method \\Aws\\EBS\\EBSClient createEBS(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionEBS(array $args = [])\n * @method \\Aws\\EC2InstanceConnect\\EC2InstanceConnectClient createEC2InstanceConnect(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionEC2InstanceConnect(array $args = [])\n * @method \\Aws\\ECRPublic\\ECRPublicClient createECRPublic(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionECRPublic(array $args = [])\n * @method \\Aws\\EKS\\EKSClient createEKS(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionEKS(array $args = [])\n * @method \\Aws\\EMRContainers\\EMRContainersClient createEMRContainers(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionEMRContainers(array $args = [])\n * @method \\Aws\\EMRServerless\\EMRServerlessClient createEMRServerless(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionEMRServerless(array $args = [])\n * @method \\Aws\\Ec2\\Ec2Client createEc2(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionEc2(array $args = [])\n * @method \\Aws\\Ecr\\EcrClient createEcr(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionEcr(array $args = [])\n * @method \\Aws\\Ecs\\EcsClient createEcs(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionEcs(array $args = [])\n * @method \\Aws\\Efs\\EfsClient createEfs(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionEfs(array $args = [])\n * @method \\Aws\\ElastiCache\\ElastiCacheClient createElastiCache(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionElastiCache(array $args = [])\n * @method \\Aws\\ElasticBeanstalk\\ElasticBeanstalkClient createElasticBeanstalk(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionElasticBeanstalk(array $args = [])\n * @method \\Aws\\ElasticInference\\ElasticInferenceClient createElasticInference(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionElasticInference(array $args = [])\n * @method \\Aws\\ElasticLoadBalancing\\ElasticLoadBalancingClient createElasticLoadBalancing(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionElasticLoadBalancing(array $args = [])\n * @method \\Aws\\ElasticLoadBalancingV2\\ElasticLoadBalancingV2Client createElasticLoadBalancingV2(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionElasticLoadBalancingV2(array $args = [])\n * @method \\Aws\\ElasticTranscoder\\ElasticTranscoderClient createElasticTranscoder(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionElasticTranscoder(array $args = [])\n * @method \\Aws\\ElasticsearchService\\ElasticsearchServiceClient createElasticsearchService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionElasticsearchService(array $args = [])\n * @method \\Aws\\Emr\\EmrClient createEmr(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionEmr(array $args = [])\n * @method \\Aws\\EventBridge\\EventBridgeClient createEventBridge(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionEventBridge(array $args = [])\n * @method \\Aws\\FIS\\FISClient createFIS(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionFIS(array $args = [])\n * @method \\Aws\\FMS\\FMSClient createFMS(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionFMS(array $args = [])\n * @method \\Aws\\FSx\\FSxClient createFSx(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionFSx(array $args = [])\n * @method \\Aws\\FinSpaceData\\FinSpaceDataClient createFinSpaceData(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionFinSpaceData(array $args = [])\n * @method \\Aws\\Firehose\\FirehoseClient createFirehose(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionFirehose(array $args = [])\n * @method \\Aws\\ForecastQueryService\\ForecastQueryServiceClient createForecastQueryService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionForecastQueryService(array $args = [])\n * @method \\Aws\\ForecastService\\ForecastServiceClient createForecastService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionForecastService(array $args = [])\n * @method \\Aws\\FraudDetector\\FraudDetectorClient createFraudDetector(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionFraudDetector(array $args = [])\n * @method \\Aws\\GameLift\\GameLiftClient createGameLift(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionGameLift(array $args = [])\n * @method \\Aws\\GameSparks\\GameSparksClient createGameSparks(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionGameSparks(array $args = [])\n * @method \\Aws\\Glacier\\GlacierClient createGlacier(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionGlacier(array $args = [])\n * @method \\Aws\\GlobalAccelerator\\GlobalAcceleratorClient createGlobalAccelerator(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionGlobalAccelerator(array $args = [])\n * @method \\Aws\\Glue\\GlueClient createGlue(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionGlue(array $args = [])\n * @method \\Aws\\GlueDataBrew\\GlueDataBrewClient createGlueDataBrew(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionGlueDataBrew(array $args = [])\n * @method \\Aws\\Greengrass\\GreengrassClient createGreengrass(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionGreengrass(array $args = [])\n * @method \\Aws\\GreengrassV2\\GreengrassV2Client createGreengrassV2(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionGreengrassV2(array $args = [])\n * @method \\Aws\\GroundStation\\GroundStationClient createGroundStation(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionGroundStation(array $args = [])\n * @method \\Aws\\GuardDuty\\GuardDutyClient createGuardDuty(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionGuardDuty(array $args = [])\n * @method \\Aws\\Health\\HealthClient createHealth(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionHealth(array $args = [])\n * @method \\Aws\\HealthLake\\HealthLakeClient createHealthLake(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionHealthLake(array $args = [])\n * @method \\Aws\\Honeycode\\HoneycodeClient createHoneycode(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionHoneycode(array $args = [])\n * @method \\Aws\\IVS\\IVSClient createIVS(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIVS(array $args = [])\n * @method \\Aws\\IVSRealTime\\IVSRealTimeClient createIVSRealTime(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIVSRealTime(array $args = [])\n * @method \\Aws\\Iam\\IamClient createIam(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIam(array $args = [])\n * @method \\Aws\\IdentityStore\\IdentityStoreClient createIdentityStore(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIdentityStore(array $args = [])\n * @method \\Aws\\ImportExport\\ImportExportClient createImportExport(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionImportExport(array $args = [])\n * @method \\Aws\\Inspector\\InspectorClient createInspector(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionInspector(array $args = [])\n * @method \\Aws\\Inspector2\\Inspector2Client createInspector2(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionInspector2(array $args = [])\n * @method \\Aws\\InternetMonitor\\InternetMonitorClient createInternetMonitor(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionInternetMonitor(array $args = [])\n * @method \\Aws\\IoT1ClickDevicesService\\IoT1ClickDevicesServiceClient createIoT1ClickDevicesService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIoT1ClickDevicesService(array $args = [])\n * @method \\Aws\\IoT1ClickProjects\\IoT1ClickProjectsClient createIoT1ClickProjects(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIoT1ClickProjects(array $args = [])\n * @method \\Aws\\IoTAnalytics\\IoTAnalyticsClient createIoTAnalytics(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIoTAnalytics(array $args = [])\n * @method \\Aws\\IoTDeviceAdvisor\\IoTDeviceAdvisorClient createIoTDeviceAdvisor(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIoTDeviceAdvisor(array $args = [])\n * @method \\Aws\\IoTEvents\\IoTEventsClient createIoTEvents(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIoTEvents(array $args = [])\n * @method \\Aws\\IoTEventsData\\IoTEventsDataClient createIoTEventsData(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIoTEventsData(array $args = [])\n * @method \\Aws\\IoTFleetHub\\IoTFleetHubClient createIoTFleetHub(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIoTFleetHub(array $args = [])\n * @method \\Aws\\IoTFleetWise\\IoTFleetWiseClient createIoTFleetWise(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIoTFleetWise(array $args = [])\n * @method \\Aws\\IoTJobsDataPlane\\IoTJobsDataPlaneClient createIoTJobsDataPlane(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIoTJobsDataPlane(array $args = [])\n * @method \\Aws\\IoTRoboRunner\\IoTRoboRunnerClient createIoTRoboRunner(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIoTRoboRunner(array $args = [])\n * @method \\Aws\\IoTSecureTunneling\\IoTSecureTunnelingClient createIoTSecureTunneling(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIoTSecureTunneling(array $args = [])\n * @method \\Aws\\IoTSiteWise\\IoTSiteWiseClient createIoTSiteWise(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIoTSiteWise(array $args = [])\n * @method \\Aws\\IoTThingsGraph\\IoTThingsGraphClient createIoTThingsGraph(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIoTThingsGraph(array $args = [])\n * @method \\Aws\\IoTTwinMaker\\IoTTwinMakerClient createIoTTwinMaker(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIoTTwinMaker(array $args = [])\n * @method \\Aws\\IoTWireless\\IoTWirelessClient createIoTWireless(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIoTWireless(array $args = [])\n * @method \\Aws\\Iot\\IotClient createIot(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIot(array $args = [])\n * @method \\Aws\\IotDataPlane\\IotDataPlaneClient createIotDataPlane(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionIotDataPlane(array $args = [])\n * @method \\Aws\\Kafka\\KafkaClient createKafka(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionKafka(array $args = [])\n * @method \\Aws\\KafkaConnect\\KafkaConnectClient createKafkaConnect(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionKafkaConnect(array $args = [])\n * @method \\Aws\\KendraRanking\\KendraRankingClient createKendraRanking(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionKendraRanking(array $args = [])\n * @method \\Aws\\Keyspaces\\KeyspacesClient createKeyspaces(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionKeyspaces(array $args = [])\n * @method \\Aws\\Kinesis\\KinesisClient createKinesis(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionKinesis(array $args = [])\n * @method \\Aws\\KinesisAnalytics\\KinesisAnalyticsClient createKinesisAnalytics(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionKinesisAnalytics(array $args = [])\n * @method \\Aws\\KinesisAnalyticsV2\\KinesisAnalyticsV2Client createKinesisAnalyticsV2(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionKinesisAnalyticsV2(array $args = [])\n * @method \\Aws\\KinesisVideo\\KinesisVideoClient createKinesisVideo(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionKinesisVideo(array $args = [])\n * @method \\Aws\\KinesisVideoArchivedMedia\\KinesisVideoArchivedMediaClient createKinesisVideoArchivedMedia(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionKinesisVideoArchivedMedia(array $args = [])\n * @method \\Aws\\KinesisVideoMedia\\KinesisVideoMediaClient createKinesisVideoMedia(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionKinesisVideoMedia(array $args = [])\n * @method \\Aws\\KinesisVideoSignalingChannels\\KinesisVideoSignalingChannelsClient createKinesisVideoSignalingChannels(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionKinesisVideoSignalingChannels(array $args = [])\n * @method \\Aws\\KinesisVideoWebRTCStorage\\KinesisVideoWebRTCStorageClient createKinesisVideoWebRTCStorage(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionKinesisVideoWebRTCStorage(array $args = [])\n * @method \\Aws\\Kms\\KmsClient createKms(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionKms(array $args = [])\n * @method \\Aws\\LakeFormation\\LakeFormationClient createLakeFormation(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionLakeFormation(array $args = [])\n * @method \\Aws\\Lambda\\LambdaClient createLambda(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionLambda(array $args = [])\n * @method \\Aws\\LexModelBuildingService\\LexModelBuildingServiceClient createLexModelBuildingService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionLexModelBuildingService(array $args = [])\n * @method \\Aws\\LexModelsV2\\LexModelsV2Client createLexModelsV2(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionLexModelsV2(array $args = [])\n * @method \\Aws\\LexRuntimeService\\LexRuntimeServiceClient createLexRuntimeService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionLexRuntimeService(array $args = [])\n * @method \\Aws\\LexRuntimeV2\\LexRuntimeV2Client createLexRuntimeV2(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionLexRuntimeV2(array $args = [])\n * @method \\Aws\\LicenseManager\\LicenseManagerClient createLicenseManager(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionLicenseManager(array $args = [])\n * @method \\Aws\\LicenseManagerLinuxSubscriptions\\LicenseManagerLinuxSubscriptionsClient createLicenseManagerLinuxSubscriptions(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionLicenseManagerLinuxSubscriptions(array $args = [])\n * @method \\Aws\\LicenseManagerUserSubscriptions\\LicenseManagerUserSubscriptionsClient createLicenseManagerUserSubscriptions(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionLicenseManagerUserSubscriptions(array $args = [])\n * @method \\Aws\\Lightsail\\LightsailClient createLightsail(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionLightsail(array $args = [])\n * @method \\Aws\\LocationService\\LocationServiceClient createLocationService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionLocationService(array $args = [])\n * @method \\Aws\\LookoutEquipment\\LookoutEquipmentClient createLookoutEquipment(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionLookoutEquipment(array $args = [])\n * @method \\Aws\\LookoutMetrics\\LookoutMetricsClient createLookoutMetrics(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionLookoutMetrics(array $args = [])\n * @method \\Aws\\LookoutforVision\\LookoutforVisionClient createLookoutforVision(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionLookoutforVision(array $args = [])\n * @method \\Aws\\MQ\\MQClient createMQ(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMQ(array $args = [])\n * @method \\Aws\\MTurk\\MTurkClient createMTurk(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMTurk(array $args = [])\n * @method \\Aws\\MWAA\\MWAAClient createMWAA(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMWAA(array $args = [])\n * @method \\Aws\\MachineLearning\\MachineLearningClient createMachineLearning(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMachineLearning(array $args = [])\n * @method \\Aws\\Macie\\MacieClient createMacie(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMacie(array $args = [])\n * @method \\Aws\\Macie2\\Macie2Client createMacie2(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMacie2(array $args = [])\n * @method \\Aws\\MainframeModernization\\MainframeModernizationClient createMainframeModernization(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMainframeModernization(array $args = [])\n * @method \\Aws\\ManagedBlockchain\\ManagedBlockchainClient createManagedBlockchain(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionManagedBlockchain(array $args = [])\n * @method \\Aws\\ManagedGrafana\\ManagedGrafanaClient createManagedGrafana(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionManagedGrafana(array $args = [])\n * @method \\Aws\\MarketplaceCatalog\\MarketplaceCatalogClient createMarketplaceCatalog(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMarketplaceCatalog(array $args = [])\n * @method \\Aws\\MarketplaceCommerceAnalytics\\MarketplaceCommerceAnalyticsClient createMarketplaceCommerceAnalytics(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMarketplaceCommerceAnalytics(array $args = [])\n * @method \\Aws\\MarketplaceEntitlementService\\MarketplaceEntitlementServiceClient createMarketplaceEntitlementService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMarketplaceEntitlementService(array $args = [])\n * @method \\Aws\\MarketplaceMetering\\MarketplaceMeteringClient createMarketplaceMetering(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMarketplaceMetering(array $args = [])\n * @method \\Aws\\MediaConnect\\MediaConnectClient createMediaConnect(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMediaConnect(array $args = [])\n * @method \\Aws\\MediaConvert\\MediaConvertClient createMediaConvert(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMediaConvert(array $args = [])\n * @method \\Aws\\MediaLive\\MediaLiveClient createMediaLive(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMediaLive(array $args = [])\n * @method \\Aws\\MediaPackage\\MediaPackageClient createMediaPackage(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMediaPackage(array $args = [])\n * @method \\Aws\\MediaPackageV2\\MediaPackageV2Client createMediaPackageV2(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMediaPackageV2(array $args = [])\n * @method \\Aws\\MediaPackageVod\\MediaPackageVodClient createMediaPackageVod(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMediaPackageVod(array $args = [])\n * @method \\Aws\\MediaStore\\MediaStoreClient createMediaStore(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMediaStore(array $args = [])\n * @method \\Aws\\MediaStoreData\\MediaStoreDataClient createMediaStoreData(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMediaStoreData(array $args = [])\n * @method \\Aws\\MediaTailor\\MediaTailorClient createMediaTailor(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMediaTailor(array $args = [])\n * @method \\Aws\\MemoryDB\\MemoryDBClient createMemoryDB(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMemoryDB(array $args = [])\n * @method \\Aws\\MigrationHub\\MigrationHubClient createMigrationHub(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMigrationHub(array $args = [])\n * @method \\Aws\\MigrationHubConfig\\MigrationHubConfigClient createMigrationHubConfig(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMigrationHubConfig(array $args = [])\n * @method \\Aws\\MigrationHubOrchestrator\\MigrationHubOrchestratorClient createMigrationHubOrchestrator(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMigrationHubOrchestrator(array $args = [])\n * @method \\Aws\\MigrationHubRefactorSpaces\\MigrationHubRefactorSpacesClient createMigrationHubRefactorSpaces(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMigrationHubRefactorSpaces(array $args = [])\n * @method \\Aws\\MigrationHubStrategyRecommendations\\MigrationHubStrategyRecommendationsClient createMigrationHubStrategyRecommendations(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMigrationHubStrategyRecommendations(array $args = [])\n * @method \\Aws\\Mobile\\MobileClient createMobile(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionMobile(array $args = [])\n * @method \\Aws\\Neptune\\NeptuneClient createNeptune(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionNeptune(array $args = [])\n * @method \\Aws\\NetworkFirewall\\NetworkFirewallClient createNetworkFirewall(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionNetworkFirewall(array $args = [])\n * @method \\Aws\\NetworkManager\\NetworkManagerClient createNetworkManager(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionNetworkManager(array $args = [])\n * @method \\Aws\\NimbleStudio\\NimbleStudioClient createNimbleStudio(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionNimbleStudio(array $args = [])\n * @method \\Aws\\OAM\\OAMClient createOAM(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionOAM(array $args = [])\n * @method \\Aws\\OSIS\\OSISClient createOSIS(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionOSIS(array $args = [])\n * @method \\Aws\\Omics\\OmicsClient createOmics(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionOmics(array $args = [])\n * @method \\Aws\\OpenSearchServerless\\OpenSearchServerlessClient createOpenSearchServerless(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionOpenSearchServerless(array $args = [])\n * @method \\Aws\\OpenSearchService\\OpenSearchServiceClient createOpenSearchService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionOpenSearchService(array $args = [])\n * @method \\Aws\\OpsWorks\\OpsWorksClient createOpsWorks(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionOpsWorks(array $args = [])\n * @method \\Aws\\OpsWorksCM\\OpsWorksCMClient createOpsWorksCM(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionOpsWorksCM(array $args = [])\n * @method \\Aws\\Organizations\\OrganizationsClient createOrganizations(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionOrganizations(array $args = [])\n * @method \\Aws\\Outposts\\OutpostsClient createOutposts(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionOutposts(array $args = [])\n * @method \\Aws\\PI\\PIClient createPI(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionPI(array $args = [])\n * @method \\Aws\\Panorama\\PanoramaClient createPanorama(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionPanorama(array $args = [])\n * @method \\Aws\\PaymentCryptography\\PaymentCryptographyClient createPaymentCryptography(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionPaymentCryptography(array $args = [])\n * @method \\Aws\\PaymentCryptographyData\\PaymentCryptographyDataClient createPaymentCryptographyData(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionPaymentCryptographyData(array $args = [])\n * @method \\Aws\\Personalize\\PersonalizeClient createPersonalize(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionPersonalize(array $args = [])\n * @method \\Aws\\PersonalizeEvents\\PersonalizeEventsClient createPersonalizeEvents(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionPersonalizeEvents(array $args = [])\n * @method \\Aws\\PersonalizeRuntime\\PersonalizeRuntimeClient createPersonalizeRuntime(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionPersonalizeRuntime(array $args = [])\n * @method \\Aws\\Pinpoint\\PinpointClient createPinpoint(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionPinpoint(array $args = [])\n * @method \\Aws\\PinpointEmail\\PinpointEmailClient createPinpointEmail(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionPinpointEmail(array $args = [])\n * @method \\Aws\\PinpointSMSVoice\\PinpointSMSVoiceClient createPinpointSMSVoice(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionPinpointSMSVoice(array $args = [])\n * @method \\Aws\\PinpointSMSVoiceV2\\PinpointSMSVoiceV2Client createPinpointSMSVoiceV2(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionPinpointSMSVoiceV2(array $args = [])\n * @method \\Aws\\Pipes\\PipesClient createPipes(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionPipes(array $args = [])\n * @method \\Aws\\Polly\\PollyClient createPolly(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionPolly(array $args = [])\n * @method \\Aws\\Pricing\\PricingClient createPricing(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionPricing(array $args = [])\n * @method \\Aws\\PrivateNetworks\\PrivateNetworksClient createPrivateNetworks(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionPrivateNetworks(array $args = [])\n * @method \\Aws\\PrometheusService\\PrometheusServiceClient createPrometheusService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionPrometheusService(array $args = [])\n * @method \\Aws\\Proton\\ProtonClient createProton(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionProton(array $args = [])\n * @method \\Aws\\QLDB\\QLDBClient createQLDB(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionQLDB(array $args = [])\n * @method \\Aws\\QLDBSession\\QLDBSessionClient createQLDBSession(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionQLDBSession(array $args = [])\n * @method \\Aws\\QuickSight\\QuickSightClient createQuickSight(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionQuickSight(array $args = [])\n * @method \\Aws\\RAM\\RAMClient createRAM(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionRAM(array $args = [])\n * @method \\Aws\\RDSDataService\\RDSDataServiceClient createRDSDataService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionRDSDataService(array $args = [])\n * @method \\Aws\\Rds\\RdsClient createRds(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionRds(array $args = [])\n * @method \\Aws\\RecycleBin\\RecycleBinClient createRecycleBin(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionRecycleBin(array $args = [])\n * @method \\Aws\\Redshift\\RedshiftClient createRedshift(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionRedshift(array $args = [])\n * @method \\Aws\\RedshiftDataAPIService\\RedshiftDataAPIServiceClient createRedshiftDataAPIService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionRedshiftDataAPIService(array $args = [])\n * @method \\Aws\\RedshiftServerless\\RedshiftServerlessClient createRedshiftServerless(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionRedshiftServerless(array $args = [])\n * @method \\Aws\\Rekognition\\RekognitionClient createRekognition(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionRekognition(array $args = [])\n * @method \\Aws\\ResilienceHub\\ResilienceHubClient createResilienceHub(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionResilienceHub(array $args = [])\n * @method \\Aws\\ResourceExplorer2\\ResourceExplorer2Client createResourceExplorer2(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionResourceExplorer2(array $args = [])\n * @method \\Aws\\ResourceGroups\\ResourceGroupsClient createResourceGroups(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionResourceGroups(array $args = [])\n * @method \\Aws\\ResourceGroupsTaggingAPI\\ResourceGroupsTaggingAPIClient createResourceGroupsTaggingAPI(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionResourceGroupsTaggingAPI(array $args = [])\n * @method \\Aws\\RoboMaker\\RoboMakerClient createRoboMaker(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionRoboMaker(array $args = [])\n * @method \\Aws\\RolesAnywhere\\RolesAnywhereClient createRolesAnywhere(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionRolesAnywhere(array $args = [])\n * @method \\Aws\\Route53\\Route53Client createRoute53(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionRoute53(array $args = [])\n * @method \\Aws\\Route53Domains\\Route53DomainsClient createRoute53Domains(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionRoute53Domains(array $args = [])\n * @method \\Aws\\Route53RecoveryCluster\\Route53RecoveryClusterClient createRoute53RecoveryCluster(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionRoute53RecoveryCluster(array $args = [])\n * @method \\Aws\\Route53RecoveryControlConfig\\Route53RecoveryControlConfigClient createRoute53RecoveryControlConfig(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionRoute53RecoveryControlConfig(array $args = [])\n * @method \\Aws\\Route53RecoveryReadiness\\Route53RecoveryReadinessClient createRoute53RecoveryReadiness(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionRoute53RecoveryReadiness(array $args = [])\n * @method \\Aws\\Route53Resolver\\Route53ResolverClient createRoute53Resolver(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionRoute53Resolver(array $args = [])\n * @method \\Aws\\S3\\S3Client createS3(array $args = [])\n * @method \\Aws\\S3\\S3MultiRegionClient createMultiRegionS3(array $args = [])\n * @method \\Aws\\S3Control\\S3ControlClient createS3Control(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionS3Control(array $args = [])\n * @method \\Aws\\S3Outposts\\S3OutpostsClient createS3Outposts(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionS3Outposts(array $args = [])\n * @method \\Aws\\SSMContacts\\SSMContactsClient createSSMContacts(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSSMContacts(array $args = [])\n * @method \\Aws\\SSMIncidents\\SSMIncidentsClient createSSMIncidents(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSSMIncidents(array $args = [])\n * @method \\Aws\\SSO\\SSOClient createSSO(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSSO(array $args = [])\n * @method \\Aws\\SSOAdmin\\SSOAdminClient createSSOAdmin(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSSOAdmin(array $args = [])\n * @method \\Aws\\SSOOIDC\\SSOOIDCClient createSSOOIDC(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSSOOIDC(array $args = [])\n * @method \\Aws\\SageMaker\\SageMakerClient createSageMaker(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSageMaker(array $args = [])\n * @method \\Aws\\SageMakerFeatureStoreRuntime\\SageMakerFeatureStoreRuntimeClient createSageMakerFeatureStoreRuntime(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSageMakerFeatureStoreRuntime(array $args = [])\n * @method \\Aws\\SageMakerGeospatial\\SageMakerGeospatialClient createSageMakerGeospatial(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSageMakerGeospatial(array $args = [])\n * @method \\Aws\\SageMakerMetrics\\SageMakerMetricsClient createSageMakerMetrics(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSageMakerMetrics(array $args = [])\n * @method \\Aws\\SageMakerRuntime\\SageMakerRuntimeClient createSageMakerRuntime(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSageMakerRuntime(array $args = [])\n * @method \\Aws\\SagemakerEdgeManager\\SagemakerEdgeManagerClient createSagemakerEdgeManager(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSagemakerEdgeManager(array $args = [])\n * @method \\Aws\\SavingsPlans\\SavingsPlansClient createSavingsPlans(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSavingsPlans(array $args = [])\n * @method \\Aws\\Scheduler\\SchedulerClient createScheduler(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionScheduler(array $args = [])\n * @method \\Aws\\Schemas\\SchemasClient createSchemas(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSchemas(array $args = [])\n * @method \\Aws\\SecretsManager\\SecretsManagerClient createSecretsManager(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSecretsManager(array $args = [])\n * @method \\Aws\\SecurityHub\\SecurityHubClient createSecurityHub(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSecurityHub(array $args = [])\n * @method \\Aws\\SecurityLake\\SecurityLakeClient createSecurityLake(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSecurityLake(array $args = [])\n * @method \\Aws\\ServerlessApplicationRepository\\ServerlessApplicationRepositoryClient createServerlessApplicationRepository(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionServerlessApplicationRepository(array $args = [])\n * @method \\Aws\\ServiceCatalog\\ServiceCatalogClient createServiceCatalog(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionServiceCatalog(array $args = [])\n * @method \\Aws\\ServiceDiscovery\\ServiceDiscoveryClient createServiceDiscovery(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionServiceDiscovery(array $args = [])\n * @method \\Aws\\ServiceQuotas\\ServiceQuotasClient createServiceQuotas(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionServiceQuotas(array $args = [])\n * @method \\Aws\\Ses\\SesClient createSes(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSes(array $args = [])\n * @method \\Aws\\SesV2\\SesV2Client createSesV2(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSesV2(array $args = [])\n * @method \\Aws\\Sfn\\SfnClient createSfn(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSfn(array $args = [])\n * @method \\Aws\\Shield\\ShieldClient createShield(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionShield(array $args = [])\n * @method \\Aws\\SimSpaceWeaver\\SimSpaceWeaverClient createSimSpaceWeaver(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSimSpaceWeaver(array $args = [])\n * @method \\Aws\\Sms\\SmsClient createSms(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSms(array $args = [])\n * @method \\Aws\\SnowBall\\SnowBallClient createSnowBall(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSnowBall(array $args = [])\n * @method \\Aws\\SnowDeviceManagement\\SnowDeviceManagementClient createSnowDeviceManagement(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSnowDeviceManagement(array $args = [])\n * @method \\Aws\\Sns\\SnsClient createSns(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSns(array $args = [])\n * @method \\Aws\\Sqs\\SqsClient createSqs(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSqs(array $args = [])\n * @method \\Aws\\Ssm\\SsmClient createSsm(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSsm(array $args = [])\n * @method \\Aws\\SsmSap\\SsmSapClient createSsmSap(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSsmSap(array $args = [])\n * @method \\Aws\\StorageGateway\\StorageGatewayClient createStorageGateway(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionStorageGateway(array $args = [])\n * @method \\Aws\\Sts\\StsClient createSts(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSts(array $args = [])\n * @method \\Aws\\Support\\SupportClient createSupport(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSupport(array $args = [])\n * @method \\Aws\\SupportApp\\SupportAppClient createSupportApp(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSupportApp(array $args = [])\n * @method \\Aws\\Swf\\SwfClient createSwf(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSwf(array $args = [])\n * @method \\Aws\\Synthetics\\SyntheticsClient createSynthetics(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionSynthetics(array $args = [])\n * @method \\Aws\\Textract\\TextractClient createTextract(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionTextract(array $args = [])\n * @method \\Aws\\TimestreamQuery\\TimestreamQueryClient createTimestreamQuery(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionTimestreamQuery(array $args = [])\n * @method \\Aws\\TimestreamWrite\\TimestreamWriteClient createTimestreamWrite(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionTimestreamWrite(array $args = [])\n * @method \\Aws\\Tnb\\TnbClient createTnb(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionTnb(array $args = [])\n * @method \\Aws\\TranscribeService\\TranscribeServiceClient createTranscribeService(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionTranscribeService(array $args = [])\n * @method \\Aws\\Transfer\\TransferClient createTransfer(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionTransfer(array $args = [])\n * @method \\Aws\\Translate\\TranslateClient createTranslate(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionTranslate(array $args = [])\n * @method \\Aws\\VPCLattice\\VPCLatticeClient createVPCLattice(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionVPCLattice(array $args = [])\n * @method \\Aws\\VerifiedPermissions\\VerifiedPermissionsClient createVerifiedPermissions(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionVerifiedPermissions(array $args = [])\n * @method \\Aws\\VoiceID\\VoiceIDClient createVoiceID(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionVoiceID(array $args = [])\n * @method \\Aws\\WAFV2\\WAFV2Client createWAFV2(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionWAFV2(array $args = [])\n * @method \\Aws\\Waf\\WafClient createWaf(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionWaf(array $args = [])\n * @method \\Aws\\WafRegional\\WafRegionalClient createWafRegional(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionWafRegional(array $args = [])\n * @method \\Aws\\WellArchitected\\WellArchitectedClient createWellArchitected(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionWellArchitected(array $args = [])\n * @method \\Aws\\WorkDocs\\WorkDocsClient createWorkDocs(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionWorkDocs(array $args = [])\n * @method \\Aws\\WorkLink\\WorkLinkClient createWorkLink(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionWorkLink(array $args = [])\n * @method \\Aws\\WorkMail\\WorkMailClient createWorkMail(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionWorkMail(array $args = [])\n * @method \\Aws\\WorkMailMessageFlow\\WorkMailMessageFlowClient createWorkMailMessageFlow(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionWorkMailMessageFlow(array $args = [])\n * @method \\Aws\\WorkSpaces\\WorkSpacesClient createWorkSpaces(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionWorkSpaces(array $args = [])\n * @method \\Aws\\WorkSpacesWeb\\WorkSpacesWebClient createWorkSpacesWeb(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionWorkSpacesWeb(array $args = [])\n * @method \\Aws\\XRay\\XRayClient createXRay(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionXRay(array $args = [])\n * @method \\Aws\\drs\\drsClient createdrs(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegiondrs(array $args = [])\n * @method \\Aws\\finspace\\finspaceClient createfinspace(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionfinspace(array $args = [])\n * @method \\Aws\\imagebuilder\\imagebuilderClient createimagebuilder(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionimagebuilder(array $args = [])\n * @method \\Aws\\ivschat\\ivschatClient createivschat(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionivschat(array $args = [])\n * @method \\Aws\\kendra\\kendraClient createkendra(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionkendra(array $args = [])\n * @method \\Aws\\mgn\\mgnClient createmgn(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionmgn(array $args = [])\n * @method \\Aws\\signer\\signerClient createsigner(array $args = [])\n * @method \\Aws\\MultiRegionClient createMultiRegionsigner(array $args = [])\n */\nclass Sdk\n{\n    const VERSION = '3.275.1';\n\n    /** @var array Arguments for creating clients */\n    private $args;\n\n    /**\n     * Constructs a new SDK object with an associative array of default\n     * client settings.\n     *\n     * @param array $args\n     *\n     * @throws \\InvalidArgumentException\n     * @see Aws\\AwsClient::__construct for a list of available options.\n     */\n    public function __construct(array $args = [])\n    {\n        $this->args = $args;\n\n        if (!isset($args['handler']) && !isset($args['http_handler'])) {\n            $this->args['http_handler'] = default_http_handler();\n        }\n    }\n\n    public function __call($name, array $args)\n    {\n        $args = isset($args[0]) ? $args[0] : [];\n        if (strpos($name, 'createMultiRegion') === 0) {\n            return $this->createMultiRegionClient(substr($name, 17), $args);\n        }\n\n        if (strpos($name, 'create') === 0) {\n            return $this->createClient(substr($name, 6), $args);\n        }\n\n        throw new \\BadMethodCallException(\"Unknown method: {$name}.\");\n    }\n\n    /**\n     * Get a client by name using an array of constructor options.\n     *\n     * @param string $name Service name or namespace (e.g., DynamoDb, s3).\n     * @param array  $args Arguments to configure the client.\n     *\n     * @return AwsClientInterface\n     * @throws \\InvalidArgumentException if any required options are missing or\n     *                                   the service is not supported.\n     * @see Aws\\AwsClient::__construct for a list of available options for args.\n     */\n    public function createClient($name, array $args = [])\n    {\n        // Get information about the service from the manifest file.\n        $service = manifest($name);\n        $namespace = $service['namespace'];\n\n        // Instantiate the client class.\n        $client = \"Aws\\\\{$namespace}\\\\{$namespace}Client\";\n        return new $client($this->mergeArgs($namespace, $service, $args));\n    }\n\n    public function createMultiRegionClient($name, array $args = [])\n    {\n        // Get information about the service from the manifest file.\n        $service = manifest($name);\n        $namespace = $service['namespace'];\n\n        $klass = \"Aws\\\\{$namespace}\\\\{$namespace}MultiRegionClient\";\n        $klass = class_exists($klass) ? $klass : MultiRegionClient::class;\n\n        return new $klass($this->mergeArgs($namespace, $service, $args));\n    }\n\n    /**\n     * Clone existing SDK instance with ability to pass an associative array\n     * of extra client settings.\n     *\n     * @param array $args\n     *\n     * @return self\n     */\n    public function copy(array $args = [])\n    {\n        return new self($args + $this->args);\n    }\n\n    private function mergeArgs($namespace, array $manifest, array $args = [])\n    {\n        // Merge provided args with stored, service-specific args.\n        if (isset($this->args[$namespace])) {\n            $args += $this->args[$namespace];\n        }\n\n        // Provide the endpoint prefix in the args.\n        if (!isset($args['service'])) {\n            $args['service'] = $manifest['endpoint'];\n        }\n\n        return $args + $this->args;\n    }\n\n    /**\n     * Determine the endpoint prefix from a client namespace.\n     *\n     * @param string $name Namespace name\n     *\n     * @return string\n     * @internal\n     * @deprecated Use the `\\Aws\\manifest()` function instead.\n     */\n    public static function getEndpointPrefix($name)\n    {\n        return manifest($name)['endpoint'];\n    }\n}\n", "num_lines": 821}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Api\\Service;\nuse Aws\\Exception\\IncalculablePayloadException;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * @internal\n */\nclass StreamRequestPayloadMiddleware\n{\n    private $nextHandler;\n    private $service;\n\n    /**\n     * Create a middleware wrapper function\n     *\n     * @param Service $service\n     * @return \\Closure\n     */\n    public static function wrap(Service $service)\n    {\n        return function (callable $handler) use ($service) {\n            return new self($handler, $service);\n        };\n    }\n\n    public function __construct(callable $nextHandler, Service $service)\n    {\n        $this->nextHandler = $nextHandler;\n        $this->service = $service;\n    }\n\n    public function __invoke(CommandInterface $command, RequestInterface $request)\n    {\n        $nextHandler = $this->nextHandler;\n\n        $operation = $this->service->getOperation($command->getName());\n        $contentLength = $request->getHeader('content-length');\n        $hasStreaming = false;\n        $requiresLength = false;\n\n        // Check if any present input member is a stream and requires the\n        // content length\n        foreach ($operation->getInput()->getMembers() as $name => $member) {\n            if (!empty($member['streaming']) && isset($command[$name])) {\n                $hasStreaming = true;\n                if (!empty($member['requiresLength'])) {\n                    $requiresLength = true;\n                }\n            }\n        }\n\n        if ($hasStreaming) {\n\n            // Add 'transfer-encoding' header if payload size not required to\n            // to be calculated and not already known\n            if (empty($requiresLength)\n                && empty($contentLength)\n                && isset($operation['authtype'])\n                && $operation['authtype'] == 'v4-unsigned-body'\n            ) {\n                $request = $request->withHeader('transfer-encoding', 'chunked');\n\n            // Otherwise, make sure 'content-length' header is added\n            } else {\n                if (empty($contentLength)) {\n                    $size = $request->getBody()->getSize();\n                    if (is_null($size)) {\n                        throw new IncalculablePayloadException('Payload'\n                            . ' content length is required and can not be'\n                            . ' calculated.');\n                    }\n                    $request = $request->withHeader(\n                        'content-length',\n                        $size\n                    );\n                }\n            }\n        }\n\n        return $nextHandler($command, $request);\n    }\n}\n", "num_lines": 86}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Api\\Service;\nuse Aws\\Exception\\AwsException;\nuse GuzzleHttp\\Promise\\RejectedPromise;\nuse Psr\\Http\\Message\\RequestInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Psr\\Http\\Message\\StreamInterface;\nuse RecursiveArrayIterator;\nuse RecursiveIteratorIterator;\n\n/**\n * Traces state changes between middlewares.\n */\nclass TraceMiddleware\n{\n    private $prevOutput;\n    private $prevInput;\n    private $config;\n\n    /** @var Service */\n    private $service;\n\n    private static $authHeaders = [\n        'X-Amz-Security-Token' => '[TOKEN]',\n    ];\n\n    private static $authStrings = [\n        // S3Signature\n        '/AWSAccessKeyId=[A-Z0-9]{20}&/i' => 'AWSAccessKeyId=[KEY]&',\n        // SignatureV4 Signature and S3Signature\n        '/Signature=.+/i' => 'Signature=[SIGNATURE]',\n        // SignatureV4 access key ID\n        '/Credential=[A-Z0-9]{20}\\//i' => 'Credential=[KEY]/',\n        // S3 signatures\n        '/AWS [A-Z0-9]{20}:.+/' => 'AWS AKI[KEY]:[SIGNATURE]',\n        // STS Presigned URLs\n        '/X-Amz-Security-Token=[^&]+/i' => 'X-Amz-Security-Token=[TOKEN]',\n        // Crypto *Stream Keys\n        '/\\[\"key.{27,36}Stream.{9}\\]=>\\s+.{7}\\d{2}\\) \"\\X{16,64}\"/U' => '[\"key\":[CONTENT KEY]]',\n    ];\n\n    /**\n     * Configuration array can contain the following key value pairs.\n     *\n     * - logfn: (callable) Function that is invoked with log messages. By\n     *   default, PHP's \"echo\" function will be utilized.\n     * - stream_size: (int) When the size of a stream is greater than this\n     *   number, the stream data will not be logged. Set to \"0\" to not log any\n     *   stream data.\n     * - scrub_auth: (bool) Set to false to disable the scrubbing of auth data\n     *   from the logged messages.\n     * - http: (bool) Set to false to disable the \"debug\" feature of lower\n     *   level HTTP adapters (e.g., verbose curl output).\n     * - auth_strings: (array) A mapping of authentication string regular\n     *   expressions to scrubbed strings. These mappings are passed directly to\n     *   preg_replace (e.g., preg_replace($key, $value, $debugOutput) if\n     *   \"scrub_auth\" is set to true.\n     * - auth_headers: (array) A mapping of header names known to contain\n     *   sensitive data to what the scrubbed value should be. The value of any\n     *   headers contained in this array will be replaced with the if\n     *   \"scrub_auth\" is set to true.\n     */\n    public function __construct(array $config = [], Service $service = null)\n    {\n        $this->config = $config + [\n            'logfn'        => function ($value) { echo $value; },\n            'stream_size'  => 524288,\n            'scrub_auth'   => true,\n            'http'         => true,\n            'auth_strings' => [],\n            'auth_headers' => [],\n        ];\n\n        $this->config['auth_strings'] += self::$authStrings;\n        $this->config['auth_headers'] += self::$authHeaders;\n        $this->service = $service;\n    }\n\n    public function __invoke($step, $name)\n    {\n        $this->prevOutput = $this->prevInput = [];\n\n        return function (callable $next) use ($step, $name) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request = null\n            ) use ($next, $step, $name) {\n                $this->createHttpDebug($command);\n                $start = microtime(true);\n                $this->stepInput([\n                    'step'    => $step,\n                    'name'    => $name,\n                    'request' => $this->requestArray($request),\n                    'command' => $this->commandArray($command)\n                ]);\n\n                return $next($command, $request)->then(\n                    function ($value) use ($step, $name, $command, $start) {\n                        $this->flushHttpDebug($command);\n                        $this->stepOutput($start, [\n                            'step'   => $step,\n                            'name'   => $name,\n                            'result' => $this->resultArray($value),\n                            'error'  => null\n                        ]);\n                        return $value;\n                    },\n                    function ($reason) use ($step, $name, $start, $command) {\n                        $this->flushHttpDebug($command);\n                        $this->stepOutput($start, [\n                            'step'   => $step,\n                            'name'   => $name,\n                            'result' => null,\n                            'error'  => $this->exceptionArray($reason)\n                        ]);\n                        return new RejectedPromise($reason);\n                    }\n                );\n            };\n        };\n    }\n\n    private function stepInput($entry)\n    {\n        static $keys = ['command', 'request'];\n        $this->compareStep($this->prevInput, $entry, '-> Entering', $keys);\n        $this->write(\"\\n\");\n        $this->prevInput = $entry;\n    }\n\n    private function stepOutput($start, $entry)\n    {\n        static $keys = ['result', 'error'];\n        $this->compareStep($this->prevOutput, $entry, '<- Leaving', $keys);\n        $totalTime = microtime(true) - $start;\n        $this->write(\"  Inclusive step time: \" . $totalTime . \"\\n\\n\");\n        $this->prevOutput = $entry;\n    }\n\n    private function compareStep(array $a, array $b, $title, array $keys)\n    {\n        $changes = [];\n        foreach ($keys as $key) {\n            $av = isset($a[$key]) ? $a[$key] : null;\n            $bv = isset($b[$key]) ? $b[$key] : null;\n            $this->compareArray($av, $bv, $key, $changes);\n        }\n        $str = \"\\n{$title} step {$b['step']}, name '{$b['name']}'\";\n        $str .= \"\\n\" . str_repeat('-', strlen($str) - 1) . \"\\n\\n  \";\n        $str .= $changes\n            ? implode(\"\\n  \", str_replace(\"\\n\", \"\\n  \", $changes))\n            : 'no changes';\n        $this->write($str . \"\\n\");\n    }\n\n    private function commandArray(CommandInterface $cmd)\n    {\n        return [\n            'instance' => spl_object_hash($cmd),\n            'name'     => $cmd->getName(),\n            'params'   => $this->getRedactedArray($cmd)\n        ];\n    }\n\n    private function requestArray(RequestInterface $request = null)\n    {\n        return !$request ? [] : array_filter([\n            'instance' => spl_object_hash($request),\n            'method'   => $request->getMethod(),\n            'headers'  => $this->redactHeaders($request->getHeaders()),\n            'body'     => $this->streamStr($request->getBody()),\n            'scheme'   => $request->getUri()->getScheme(),\n            'port'     => $request->getUri()->getPort(),\n            'path'     => $request->getUri()->getPath(),\n            'query'    => $request->getUri()->getQuery(),\n        ]);\n    }\n\n    private function responseArray(ResponseInterface $response = null)\n    {\n        return !$response ? [] : [\n            'instance'   => spl_object_hash($response),\n            'statusCode' => $response->getStatusCode(),\n            'headers'    => $this->redactHeaders($response->getHeaders()),\n            'body'       => $this->streamStr($response->getBody())\n        ];\n    }\n\n    private function resultArray($value)\n    {\n        return $value instanceof ResultInterface\n            ? [\n                'instance' => spl_object_hash($value),\n                'data'     => $value->toArray()\n            ] : $value;\n    }\n\n    private function exceptionArray($e)\n    {\n        if (!($e instanceof \\Exception)) {\n            return $e;\n        }\n\n        $result = [\n            'instance'   => spl_object_hash($e),\n            'class'      => get_class($e),\n            'message'    => $e->getMessage(),\n            'file'       => $e->getFile(),\n            'line'       => $e->getLine(),\n            'trace'      => $e->getTraceAsString(),\n        ];\n\n        if ($e instanceof AwsException) {\n            $result += [\n                'type'       => $e->getAwsErrorType(),\n                'code'       => $e->getAwsErrorCode(),\n                'requestId'  => $e->getAwsRequestId(),\n                'statusCode' => $e->getStatusCode(),\n                'result'     => $this->resultArray($e->getResult()),\n                'request'    => $this->requestArray($e->getRequest()),\n                'response'   => $this->responseArray($e->getResponse()),\n            ];\n        }\n\n        return $result;\n    }\n\n    private function compareArray($a, $b, $path, array &$diff)\n    {\n        if ($a === $b) {\n            return;\n        }\n\n        if (is_array($a)) {\n            $b = (array) $b;\n            $keys = array_unique(array_merge(array_keys($a), array_keys($b)));\n            foreach ($keys as $k) {\n                if (!array_key_exists($k, $a)) {\n                    $this->compareArray(null, $b[$k], \"{$path}.{$k}\", $diff);\n                } elseif (!array_key_exists($k, $b)) {\n                    $this->compareArray($a[$k], null, \"{$path}.{$k}\", $diff);\n                } else {\n                    $this->compareArray($a[$k], $b[$k], \"{$path}.{$k}\", $diff);\n                }\n            }\n        } elseif ($a !== null && $b === null) {\n            $diff[] = \"{$path} was unset\";\n        } elseif ($a === null && $b !== null) {\n            $diff[] = sprintf(\"%s was set to %s\", $path, $this->str($b));\n        } else {\n            $diff[] = sprintf(\"%s changed from %s to %s\", $path, $this->str($a), $this->str($b));\n        }\n    }\n\n    private function str($value)\n    {\n        if (is_scalar($value)) {\n            return (string) $value;\n        }\n\n        if ($value instanceof \\Exception) {\n            $value = $this->exceptionArray($value);\n        }\n\n        ob_start();\n        var_dump($value);\n        return ob_get_clean();\n    }\n\n    private function streamStr(StreamInterface $body)\n    {\n        return $body->getSize() < $this->config['stream_size']\n            ? (string) $body\n            : 'stream(size=' . $body->getSize() . ')';\n    }\n\n    private function createHttpDebug(CommandInterface $command)\n    {\n        if ($this->config['http'] && !isset($command['@http']['debug'])) {\n            $command['@http']['debug'] = fopen('php://temp', 'w+');\n        }\n    }\n\n    private function flushHttpDebug(CommandInterface $command)\n    {\n        if ($res = $command['@http']['debug']) {\n            if (is_resource($res)) {\n                rewind($res);\n                $this->write(stream_get_contents($res));\n                fclose($res);\n            }\n            $command['@http']['debug'] = null;\n        }\n    }\n\n    private function write($value)\n    {\n        if ($this->config['scrub_auth']) {\n            foreach ($this->config['auth_strings'] as $pattern => $replacement) {\n                $value = preg_replace_callback(\n                    $pattern,\n                    function ($matches) use ($replacement) {\n                        return $replacement;\n                    },\n                    $value\n                );\n            }\n        }\n\n        call_user_func($this->config['logfn'], $value);\n    }\n\n    private function redactHeaders(array $headers)\n    {\n        if ($this->config['scrub_auth']) {\n            $headers = $this->config['auth_headers'] + $headers;\n        }\n\n        return $headers;\n    }\n\n    /**\n     * @param CommandInterface $cmd\n     * @return array\n     */\n    private function getRedactedArray(CommandInterface $cmd)\n    {\n        if (!isset($this->service[\"shapes\"])) {\n            return $cmd->toArray();\n        }\n        $shapes = $this->service[\"shapes\"];\n        $cmdArray = $cmd->toArray();\n        $iterator = new RecursiveIteratorIterator(\n            new RecursiveArrayIterator($cmdArray),\n            RecursiveIteratorIterator::SELF_FIRST\n        );\n        foreach ($iterator as $parameter => $value) {\n           if (isset($shapes[$parameter]['sensitive']) &&\n               $shapes[$parameter]['sensitive'] === true\n           ) {\n               $redactedValue = is_string($value) ? \"[{$parameter}]\" : [\"[{$parameter}]\"];\n               $currentDepth = $iterator->getDepth();\n               for ($subDepth = $currentDepth; $subDepth >= 0; $subDepth--) {\n                   $subIterator = $iterator->getSubIterator($subDepth);\n                   $subIterator->offsetSet(\n                       $subIterator->key(),\n                       ($subDepth === $currentDepth\n                           ? $redactedValue\n                           : $iterator->getSubIterator(($subDepth+1))->getArrayCopy()\n                       )\n                   );\n               }\n           }\n        }\n        return $iterator->getArrayCopy();\n    }\n}\n", "num_lines": 360}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Exception\\AwsException;\nuse GuzzleHttp\\Promise\\Coroutine;\nuse GuzzleHttp\\Promise\\PromisorInterface;\nuse GuzzleHttp\\Promise\\RejectedPromise;\n\n/**\n * \"Waiters\" are associated with an AWS resource (e.g., EC2 instance), and poll\n * that resource and until it is in a particular state.\n\n * The Waiter object produces a promise that is either a.) resolved once the\n * waiting conditions are met, or b.) rejected if the waiting conditions cannot\n * be met or has exceeded the number of allowed attempts at meeting the\n * conditions. You can use waiters in a blocking or non-blocking way, depending\n * on whether you call wait() on the promise.\n\n * The configuration for the waiter must include information about the operation\n * and the conditions for wait completion.\n */\nclass Waiter implements PromisorInterface\n{\n    /** @var AwsClientInterface Client used to execute each attempt. */\n    private $client;\n\n    /** @var string Name of the waiter. */\n    private $name;\n\n    /** @var array Params to use with each attempt operation. */\n    private $args;\n\n    /** @var array Waiter configuration. */\n    private $config;\n\n    /** @var array Default configuration options. */\n    private static $defaults = ['initDelay' => 0, 'before' => null];\n\n    /** @var array Required configuration options. */\n    private static $required = [\n        'acceptors',\n        'delay',\n        'maxAttempts',\n        'operation',\n    ];\n\n    /**\n     * The array of configuration options include:\n     *\n     * - acceptors: (array) Array of acceptor options\n     * - delay: (int) Number of seconds to delay between attempts\n     * - maxAttempts: (int) Maximum number of attempts before failing\n     * - operation: (string) Name of the API operation to use for polling\n     * - before: (callable) Invoked before attempts. Accepts command and tries.\n     *\n     * @param AwsClientInterface $client Client used to execute commands.\n     * @param string             $name   Waiter name.\n     * @param array              $args   Command arguments.\n     * @param array              $config Waiter config that overrides defaults.\n     *\n     * @throws \\InvalidArgumentException if the configuration is incomplete.\n     */\n    public function __construct(\n        AwsClientInterface $client,\n        $name,\n        array $args = [],\n        array $config = []\n    ) {\n        $this->client = $client;\n        $this->name = $name;\n        $this->args = $args;\n\n        // Prepare and validate config.\n        $this->config = $config + self::$defaults;\n        foreach (self::$required as $key) {\n            if (!isset($this->config[$key])) {\n                throw new \\InvalidArgumentException(\n                    'The provided waiter configuration was incomplete.'\n                );\n            }\n        }\n        if ($this->config['before'] && !is_callable($this->config['before'])) {\n            throw new \\InvalidArgumentException(\n                'The provided \"before\" callback is not callable.'\n            );\n        }\n    }\n\n    /**\n     * @return Coroutine\n     */\n    public function promise()\n    {\n        return Coroutine::of(function () {\n            $name = $this->config['operation'];\n            for ($state = 'retry', $attempt = 1; $state === 'retry'; $attempt++) {\n                // Execute the operation.\n                $args = $this->getArgsForAttempt($attempt);\n                $command = $this->client->getCommand($name, $args);\n                try {\n                    if ($this->config['before']) {\n                        $this->config['before']($command, $attempt);\n                    }\n                    $result = (yield $this->client->executeAsync($command));\n                } catch (AwsException $e) {\n                    $result = $e;\n                }\n\n                // Determine the waiter's state and what to do next.\n                $state = $this->determineState($result);\n                if ($state === 'success') {\n                    yield $command;\n                } elseif ($state === 'failed') {\n                    $msg = \"The {$this->name} waiter entered a failure state.\";\n                    if ($result instanceof \\Exception) {\n                        $msg .= ' Reason: ' . $result->getMessage();\n                    }\n                    yield new RejectedPromise(new \\RuntimeException($msg));\n                } elseif ($state === 'retry'\n                    && $attempt >= $this->config['maxAttempts']\n                ) {\n                    $state = 'failed';\n                    yield new RejectedPromise(new \\RuntimeException(\n                        \"The {$this->name} waiter failed after attempt #{$attempt}.\"\n                    ));\n                }\n            }\n        });\n    }\n\n    /**\n     * Gets the operation arguments for the attempt, including the delay.\n     *\n     * @param $attempt Number of the current attempt.\n     *\n     * @return mixed integer\n     */\n    private function getArgsForAttempt($attempt)\n    {\n        $args = $this->args;\n\n        // Determine the delay.\n        $delay = ($attempt === 1)\n            ? $this->config['initDelay']\n            : $this->config['delay'];\n        if (is_callable($delay)) {\n            $delay = $delay($attempt);\n        }\n\n        // Set the delay. (Note: handlers except delay in milliseconds.)\n        if (!isset($args['@http'])) {\n            $args['@http'] = [];\n        }\n        $args['@http']['delay'] = $delay * 1000;\n\n        return $args;\n    }\n\n    /**\n     * Determines the state of the waiter attempt, based on the result of\n     * polling the resource. A waiter can have the state of \"success\", \"failed\",\n     * or \"retry\".\n     *\n     * @param mixed $result\n     *\n     * @return string Will be \"success\", \"failed\", or \"retry\"\n     */\n    private function determineState($result)\n    {\n        foreach ($this->config['acceptors'] as $acceptor) {\n            $matcher = 'matches' . ucfirst($acceptor['matcher']);\n            if ($this->{$matcher}($result, $acceptor)) {\n                return $acceptor['state'];\n            }\n        }\n\n        return $result instanceof \\Exception ? 'failed' : 'retry';\n    }\n\n    /**\n     * @param Result $result   Result or exception.\n     * @param array  $acceptor Acceptor configuration being checked.\n     *\n     * @return bool\n     */\n    private function matchesPath($result, array $acceptor)\n    {\n        return !($result instanceof ResultInterface)\n            ? false\n            : $acceptor['expected'] == $result->search($acceptor['argument']);\n    }\n\n    /**\n     * @param Result $result   Result or exception.\n     * @param array  $acceptor Acceptor configuration being checked.\n     *\n     * @return bool\n     */\n    private function matchesPathAll($result, array $acceptor)\n    {\n        if (!($result instanceof ResultInterface)) {\n            return false;\n        }\n\n        $actuals = $result->search($acceptor['argument']) ?: [];\n        foreach ($actuals as $actual) {\n            if ($actual != $acceptor['expected']) {\n                return false;\n            }\n        }\n\n        return true;\n    }\n\n    /**\n     * @param Result $result   Result or exception.\n     * @param array  $acceptor Acceptor configuration being checked.\n     *\n     * @return bool\n     */\n    private function matchesPathAny($result, array $acceptor)\n    {\n        if (!($result instanceof ResultInterface)) {\n            return false;\n        }\n\n        $actuals = $result->search($acceptor['argument']) ?: [];\n        return in_array($acceptor['expected'], $actuals);\n    }\n\n    /**\n     * @param Result $result   Result or exception.\n     * @param array  $acceptor Acceptor configuration being checked.\n     *\n     * @return bool\n     */\n    private function matchesStatus($result, array $acceptor)\n    {\n        if ($result instanceof ResultInterface) {\n            return $acceptor['expected'] == $result['@metadata']['statusCode'];\n        }\n\n        if ($result instanceof AwsException && $response = $result->getResponse()) {\n            return $acceptor['expected'] == $response->getStatusCode();\n        }\n\n        return false;\n    }\n\n    /**\n     * @param Result $result   Result or exception.\n     * @param array  $acceptor Acceptor configuration being checked.\n     *\n     * @return bool\n     */\n    private function matchesError($result, array $acceptor)\n    {\n        if ($result instanceof AwsException) {\n            return $result->isConnectionError()\n                || $result->getAwsErrorCode() == $acceptor['expected'];\n        }\n\n        return false;\n    }\n}\n", "num_lines": 266}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Api\\Parser\\Exception\\ParserException;\nuse Aws\\Exception\\AwsException;\nuse GuzzleHttp\\Promise;\nuse Psr\\Http\\Message\\RequestInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\n\n/**\n * Converts an HTTP handler into a Command HTTP handler.\n *\n * HTTP handlers have the following signature:\n *     function(RequestInterface $request, array $options) : PromiseInterface\n *\n * The promise returned form an HTTP handler must resolve to a PSR-7 response\n * object when fulfilled or an error array when rejected. The error array\n * can contain the following data:\n *\n * - exception: (required, Exception) Exception that was encountered.\n * - response: (ResponseInterface) PSR-7 response that was received (if a\n *   response) was received.\n * - connection_error: (bool) True if the error is the result of failing to\n *   connect.\n */\nclass WrappedHttpHandler\n{\n    private $httpHandler;\n    private $parser;\n    private $errorParser;\n    private $exceptionClass;\n    private $collectStats;\n\n    /**\n     * @param callable $httpHandler    Function that accepts a request and array\n     *                                 of request options and returns a promise\n     *                                 that fulfills with a response or rejects\n     *                                 with an error array.\n     * @param callable $parser         Function that accepts a response object\n     *                                 and returns an AWS result object.\n     * @param callable $errorParser    Function that parses a response object\n     *                                 into AWS error data.\n     * @param string   $exceptionClass Exception class to throw.\n     * @param bool     $collectStats   Whether to collect HTTP transfer\n     *                                 information.\n     */\n    public function __construct(\n        callable $httpHandler,\n        callable $parser,\n        callable $errorParser,\n        $exceptionClass = AwsException::class,\n        $collectStats = false\n    ) {\n        $this->httpHandler = $httpHandler;\n        $this->parser = $parser;\n        $this->errorParser = $errorParser;\n        $this->exceptionClass = $exceptionClass;\n        $this->collectStats = $collectStats;\n    }\n\n    /**\n     * Calls the simpler HTTP specific handler and wraps the returned promise\n     * with AWS specific values (e.g., a result object or AWS exception).\n     *\n     * @param CommandInterface $command Command being executed.\n     * @param RequestInterface $request Request to send.\n     *\n     * @return Promise\\PromiseInterface\n     */\n    public function __invoke(\n        CommandInterface $command,\n        RequestInterface $request\n    ) {\n        $fn = $this->httpHandler;\n        $options = $command['@http'] ?: [];\n        $stats = [];\n        if ($this->collectStats || !empty($options['collect_stats'])) {\n            $options['http_stats_receiver'] = static function (\n                array $transferStats\n            ) use (&$stats) {\n                $stats = $transferStats;\n            };\n        } elseif (isset($options['http_stats_receiver'])) {\n            throw new \\InvalidArgumentException('Providing a custom HTTP stats'\n                . ' receiver to Aws\\WrappedHttpHandler is not supported.');\n        }\n\n        return Promise\\Create::promiseFor($fn($request, $options))\n            ->then(\n                function (\n                    ResponseInterface $res\n                ) use ($command, $request, &$stats) {\n                    return $this->parseResponse($command, $request, $res, $stats);\n                },\n                function ($err) use ($request, $command, &$stats) {\n                    if (is_array($err)) {\n                        $err = $this->parseError(\n                            $err,\n                            $request,\n                            $command,\n                            $stats\n                        );\n                    }\n                    return new Promise\\RejectedPromise($err);\n                }\n            );\n    }\n\n    /**\n     * @param CommandInterface  $command\n     * @param RequestInterface  $request\n     * @param ResponseInterface $response\n     * @param array             $stats\n     *\n     * @return ResultInterface\n     */\n    private function parseResponse(\n        CommandInterface $command,\n        RequestInterface $request,\n        ResponseInterface $response,\n        array $stats\n    ) {\n        $parser = $this->parser;\n        $status = $response->getStatusCode();\n        $result = $status < 300\n            ? $parser($command, $response)\n            : new Result();\n\n        $metadata = [\n            'statusCode'    => $status,\n            'effectiveUri'  => (string) $request->getUri(),\n            'headers'       => [],\n            'transferStats' => [],\n        ];\n        if (!empty($stats)) {\n            $metadata['transferStats']['http'] = [$stats];\n        }\n\n        // Bring headers into the metadata array.\n        foreach ($response->getHeaders() as $name => $values) {\n            $metadata['headers'][strtolower($name)] = $values[0];\n        }\n\n        $result['@metadata'] = $metadata;\n\n        return $result;\n    }\n\n    /**\n     * Parses a rejection into an AWS error.\n     *\n     * @param array            $err     Rejection error array.\n     * @param RequestInterface $request Request that was sent.\n     * @param CommandInterface $command Command being sent.\n     * @param array            $stats   Transfer statistics\n     *\n     * @return \\Exception\n     */\n    private function parseError(\n        array $err,\n        RequestInterface $request,\n        CommandInterface $command,\n        array $stats\n    ) {\n        if (!isset($err['exception'])) {\n            throw new \\RuntimeException('The HTTP handler was rejected without an \"exception\" key value pair.');\n        }\n\n        $serviceError = \"AWS HTTP error: \" . $err['exception']->getMessage();\n\n        if (!isset($err['response'])) {\n            $parts = ['response' => null];\n        } else {\n            try {\n                $parts = call_user_func(\n                    $this->errorParser,\n                    $err['response'],\n                    $command\n                );\n                $serviceError .= \" {$parts['code']} ({$parts['type']}): \"\n                    . \"{$parts['message']} - \" . $err['response']->getBody();\n            } catch (ParserException $e) {\n                $parts = [];\n                $serviceError .= ' Unable to parse error information from '\n                    . \"response - {$e->getMessage()}\";\n            }\n\n            $parts['response'] = $err['response'];\n        }\n\n        $parts['exception'] = $err['exception'];\n        $parts['request'] = $request;\n        $parts['connection_error'] = !empty($err['connection_error']);\n        $parts['transfer_stats'] = $stats;\n\n        return new $this->exceptionClass(\n            sprintf(\n                'Error executing \"%s\" on \"%s\"; %s',\n                $command->getName(),\n                $request->getUri(),\n                $serviceError\n            ),\n            $command,\n            $parts,\n            $err['exception']\n        );\n    }\n}\n", "num_lines": 209}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AccessAnalyzer;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Access Analyzer** service.\n * @method \\Aws\\Result applyArchiveRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise applyArchiveRuleAsync(array $args = [])\n * @method \\Aws\\Result cancelPolicyGeneration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelPolicyGenerationAsync(array $args = [])\n * @method \\Aws\\Result createAccessPreview(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccessPreviewAsync(array $args = [])\n * @method \\Aws\\Result createAnalyzer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAnalyzerAsync(array $args = [])\n * @method \\Aws\\Result createArchiveRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createArchiveRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteAnalyzer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAnalyzerAsync(array $args = [])\n * @method \\Aws\\Result deleteArchiveRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteArchiveRuleAsync(array $args = [])\n * @method \\Aws\\Result getAccessPreview(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccessPreviewAsync(array $args = [])\n * @method \\Aws\\Result getAnalyzedResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAnalyzedResourceAsync(array $args = [])\n * @method \\Aws\\Result getAnalyzer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAnalyzerAsync(array $args = [])\n * @method \\Aws\\Result getArchiveRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getArchiveRuleAsync(array $args = [])\n * @method \\Aws\\Result getFinding(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFindingAsync(array $args = [])\n * @method \\Aws\\Result getGeneratedPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGeneratedPolicyAsync(array $args = [])\n * @method \\Aws\\Result listAccessPreviewFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccessPreviewFindingsAsync(array $args = [])\n * @method \\Aws\\Result listAccessPreviews(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccessPreviewsAsync(array $args = [])\n * @method \\Aws\\Result listAnalyzedResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAnalyzedResourcesAsync(array $args = [])\n * @method \\Aws\\Result listAnalyzers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAnalyzersAsync(array $args = [])\n * @method \\Aws\\Result listArchiveRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listArchiveRulesAsync(array $args = [])\n * @method \\Aws\\Result listFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFindingsAsync(array $args = [])\n * @method \\Aws\\Result listPolicyGenerations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPolicyGenerationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startPolicyGeneration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startPolicyGenerationAsync(array $args = [])\n * @method \\Aws\\Result startResourceScan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startResourceScanAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateArchiveRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateArchiveRuleAsync(array $args = [])\n * @method \\Aws\\Result updateFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFindingsAsync(array $args = [])\n * @method \\Aws\\Result validatePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise validatePolicyAsync(array $args = [])\n */\nclass AccessAnalyzerClient extends AwsClient {}\n", "num_lines": 66}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AccessAnalyzer\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Access Analyzer** service.\n */\nclass AccessAnalyzerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Account;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Account** service.\n * @method \\Aws\\Result deleteAlternateContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAlternateContactAsync(array $args = [])\n * @method \\Aws\\Result disableRegion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableRegionAsync(array $args = [])\n * @method \\Aws\\Result enableRegion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableRegionAsync(array $args = [])\n * @method \\Aws\\Result getAlternateContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAlternateContactAsync(array $args = [])\n * @method \\Aws\\Result getContactInformation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContactInformationAsync(array $args = [])\n * @method \\Aws\\Result getRegionOptStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRegionOptStatusAsync(array $args = [])\n * @method \\Aws\\Result listRegions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRegionsAsync(array $args = [])\n * @method \\Aws\\Result putAlternateContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAlternateContactAsync(array $args = [])\n * @method \\Aws\\Result putContactInformation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putContactInformationAsync(array $args = [])\n */\nclass AccountClient extends AwsClient {}\n", "num_lines": 28}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Account\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Account** service.\n */\nclass AccountException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Acm;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Certificate Manager** service.\n *\n * @method \\Aws\\Result addTagsToCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsToCertificateAsync(array $args = [])\n * @method \\Aws\\Result deleteCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCertificateAsync(array $args = [])\n * @method \\Aws\\Result describeCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCertificateAsync(array $args = [])\n * @method \\Aws\\Result exportCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportCertificateAsync(array $args = [])\n * @method \\Aws\\Result getAccountConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCertificateAsync(array $args = [])\n * @method \\Aws\\Result importCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importCertificateAsync(array $args = [])\n * @method \\Aws\\Result listCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCertificatesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForCertificateAsync(array $args = [])\n * @method \\Aws\\Result putAccountConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccountConfigurationAsync(array $args = [])\n * @method \\Aws\\Result removeTagsFromCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsFromCertificateAsync(array $args = [])\n * @method \\Aws\\Result renewCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise renewCertificateAsync(array $args = [])\n * @method \\Aws\\Result requestCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise requestCertificateAsync(array $args = [])\n * @method \\Aws\\Result resendValidationEmail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resendValidationEmailAsync(array $args = [])\n * @method \\Aws\\Result updateCertificateOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCertificateOptionsAsync(array $args = [])\n */\nclass AcmClient extends AwsClient {}\n", "num_lines": 41}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Acm\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Certificate Manager** service.\n */\nclass AcmException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ACMPCA;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Certificate Manager Private Certificate Authority** service.\n * @method \\Aws\\Result createCertificateAuthority(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCertificateAuthorityAsync(array $args = [])\n * @method \\Aws\\Result createCertificateAuthorityAuditReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCertificateAuthorityAuditReportAsync(array $args = [])\n * @method \\Aws\\Result createPermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPermissionAsync(array $args = [])\n * @method \\Aws\\Result deleteCertificateAuthority(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCertificateAuthorityAsync(array $args = [])\n * @method \\Aws\\Result deletePermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePermissionAsync(array $args = [])\n * @method \\Aws\\Result deletePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePolicyAsync(array $args = [])\n * @method \\Aws\\Result describeCertificateAuthority(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCertificateAuthorityAsync(array $args = [])\n * @method \\Aws\\Result describeCertificateAuthorityAuditReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCertificateAuthorityAuditReportAsync(array $args = [])\n * @method \\Aws\\Result getCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCertificateAsync(array $args = [])\n * @method \\Aws\\Result getCertificateAuthorityCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCertificateAuthorityCertificateAsync(array $args = [])\n * @method \\Aws\\Result getCertificateAuthorityCsr(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCertificateAuthorityCsrAsync(array $args = [])\n * @method \\Aws\\Result getPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPolicyAsync(array $args = [])\n * @method \\Aws\\Result importCertificateAuthorityCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importCertificateAuthorityCertificateAsync(array $args = [])\n * @method \\Aws\\Result issueCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise issueCertificateAsync(array $args = [])\n * @method \\Aws\\Result listCertificateAuthorities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCertificateAuthoritiesAsync(array $args = [])\n * @method \\Aws\\Result listPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPermissionsAsync(array $args = [])\n * @method \\Aws\\Result listTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsAsync(array $args = [])\n * @method \\Aws\\Result putPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPolicyAsync(array $args = [])\n * @method \\Aws\\Result restoreCertificateAuthority(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreCertificateAuthorityAsync(array $args = [])\n * @method \\Aws\\Result revokeCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeCertificateAsync(array $args = [])\n * @method \\Aws\\Result tagCertificateAuthority(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagCertificateAuthorityAsync(array $args = [])\n * @method \\Aws\\Result untagCertificateAuthority(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagCertificateAuthorityAsync(array $args = [])\n * @method \\Aws\\Result updateCertificateAuthority(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCertificateAuthorityAsync(array $args = [])\n */\nclass ACMPCAClient extends AwsClient {}\n", "num_lines": 56}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ACMPCA\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Certificate Manager Private Certificate Authority** service.\n */\nclass ACMPCAException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AlexaForBusiness;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Alexa For Business** service.\n * @method \\Aws\\Result approveSkill(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise approveSkillAsync(array $args = [])\n * @method \\Aws\\Result associateContactWithAddressBook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateContactWithAddressBookAsync(array $args = [])\n * @method \\Aws\\Result associateDeviceWithNetworkProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateDeviceWithNetworkProfileAsync(array $args = [])\n * @method \\Aws\\Result associateDeviceWithRoom(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateDeviceWithRoomAsync(array $args = [])\n * @method \\Aws\\Result associateSkillGroupWithRoom(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateSkillGroupWithRoomAsync(array $args = [])\n * @method \\Aws\\Result associateSkillWithSkillGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateSkillWithSkillGroupAsync(array $args = [])\n * @method \\Aws\\Result associateSkillWithUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateSkillWithUsersAsync(array $args = [])\n * @method \\Aws\\Result createAddressBook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAddressBookAsync(array $args = [])\n * @method \\Aws\\Result createBusinessReportSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBusinessReportScheduleAsync(array $args = [])\n * @method \\Aws\\Result createConferenceProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConferenceProviderAsync(array $args = [])\n * @method \\Aws\\Result createContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createContactAsync(array $args = [])\n * @method \\Aws\\Result createGatewayGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGatewayGroupAsync(array $args = [])\n * @method \\Aws\\Result createNetworkProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNetworkProfileAsync(array $args = [])\n * @method \\Aws\\Result createProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProfileAsync(array $args = [])\n * @method \\Aws\\Result createRoom(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRoomAsync(array $args = [])\n * @method \\Aws\\Result createSkillGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSkillGroupAsync(array $args = [])\n * @method \\Aws\\Result createUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserAsync(array $args = [])\n * @method \\Aws\\Result deleteAddressBook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAddressBookAsync(array $args = [])\n * @method \\Aws\\Result deleteBusinessReportSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBusinessReportScheduleAsync(array $args = [])\n * @method \\Aws\\Result deleteConferenceProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConferenceProviderAsync(array $args = [])\n * @method \\Aws\\Result deleteContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteContactAsync(array $args = [])\n * @method \\Aws\\Result deleteDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDeviceAsync(array $args = [])\n * @method \\Aws\\Result deleteDeviceUsageData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDeviceUsageDataAsync(array $args = [])\n * @method \\Aws\\Result deleteGatewayGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGatewayGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteNetworkProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNetworkProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteRoom(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRoomAsync(array $args = [])\n * @method \\Aws\\Result deleteRoomSkillParameter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRoomSkillParameterAsync(array $args = [])\n * @method \\Aws\\Result deleteSkillAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSkillAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result deleteSkillGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSkillGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserAsync(array $args = [])\n * @method \\Aws\\Result disassociateContactFromAddressBook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateContactFromAddressBookAsync(array $args = [])\n * @method \\Aws\\Result disassociateDeviceFromRoom(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateDeviceFromRoomAsync(array $args = [])\n * @method \\Aws\\Result disassociateSkillFromSkillGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateSkillFromSkillGroupAsync(array $args = [])\n * @method \\Aws\\Result disassociateSkillFromUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateSkillFromUsersAsync(array $args = [])\n * @method \\Aws\\Result disassociateSkillGroupFromRoom(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateSkillGroupFromRoomAsync(array $args = [])\n * @method \\Aws\\Result forgetSmartHomeAppliances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise forgetSmartHomeAppliancesAsync(array $args = [])\n * @method \\Aws\\Result getAddressBook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAddressBookAsync(array $args = [])\n * @method \\Aws\\Result getConferencePreference(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConferencePreferenceAsync(array $args = [])\n * @method \\Aws\\Result getConferenceProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConferenceProviderAsync(array $args = [])\n * @method \\Aws\\Result getContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContactAsync(array $args = [])\n * @method \\Aws\\Result getDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeviceAsync(array $args = [])\n * @method \\Aws\\Result getGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGatewayAsync(array $args = [])\n * @method \\Aws\\Result getGatewayGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGatewayGroupAsync(array $args = [])\n * @method \\Aws\\Result getInvitationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInvitationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getNetworkProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNetworkProfileAsync(array $args = [])\n * @method \\Aws\\Result getProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProfileAsync(array $args = [])\n * @method \\Aws\\Result getRoom(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRoomAsync(array $args = [])\n * @method \\Aws\\Result getRoomSkillParameter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRoomSkillParameterAsync(array $args = [])\n * @method \\Aws\\Result getSkillGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSkillGroupAsync(array $args = [])\n * @method \\Aws\\Result listBusinessReportSchedules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBusinessReportSchedulesAsync(array $args = [])\n * @method \\Aws\\Result listConferenceProviders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConferenceProvidersAsync(array $args = [])\n * @method \\Aws\\Result listDeviceEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeviceEventsAsync(array $args = [])\n * @method \\Aws\\Result listGatewayGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGatewayGroupsAsync(array $args = [])\n * @method \\Aws\\Result listGateways(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGatewaysAsync(array $args = [])\n * @method \\Aws\\Result listSkills(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSkillsAsync(array $args = [])\n * @method \\Aws\\Result listSkillsStoreCategories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSkillsStoreCategoriesAsync(array $args = [])\n * @method \\Aws\\Result listSkillsStoreSkillsByCategory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSkillsStoreSkillsByCategoryAsync(array $args = [])\n * @method \\Aws\\Result listSmartHomeAppliances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSmartHomeAppliancesAsync(array $args = [])\n * @method \\Aws\\Result listTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsAsync(array $args = [])\n * @method \\Aws\\Result putConferencePreference(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConferencePreferenceAsync(array $args = [])\n * @method \\Aws\\Result putInvitationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putInvitationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putRoomSkillParameter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRoomSkillParameterAsync(array $args = [])\n * @method \\Aws\\Result putSkillAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSkillAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result registerAVSDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerAVSDeviceAsync(array $args = [])\n * @method \\Aws\\Result rejectSkill(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectSkillAsync(array $args = [])\n * @method \\Aws\\Result resolveRoom(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resolveRoomAsync(array $args = [])\n * @method \\Aws\\Result revokeInvitation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeInvitationAsync(array $args = [])\n * @method \\Aws\\Result searchAddressBooks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchAddressBooksAsync(array $args = [])\n * @method \\Aws\\Result searchContacts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchContactsAsync(array $args = [])\n * @method \\Aws\\Result searchDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchDevicesAsync(array $args = [])\n * @method \\Aws\\Result searchNetworkProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchNetworkProfilesAsync(array $args = [])\n * @method \\Aws\\Result searchProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchProfilesAsync(array $args = [])\n * @method \\Aws\\Result searchRooms(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchRoomsAsync(array $args = [])\n * @method \\Aws\\Result searchSkillGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchSkillGroupsAsync(array $args = [])\n * @method \\Aws\\Result searchUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchUsersAsync(array $args = [])\n * @method \\Aws\\Result sendAnnouncement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendAnnouncementAsync(array $args = [])\n * @method \\Aws\\Result sendInvitation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendInvitationAsync(array $args = [])\n * @method \\Aws\\Result startDeviceSync(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDeviceSyncAsync(array $args = [])\n * @method \\Aws\\Result startSmartHomeApplianceDiscovery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSmartHomeApplianceDiscoveryAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAddressBook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAddressBookAsync(array $args = [])\n * @method \\Aws\\Result updateBusinessReportSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBusinessReportScheduleAsync(array $args = [])\n * @method \\Aws\\Result updateConferenceProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConferenceProviderAsync(array $args = [])\n * @method \\Aws\\Result updateContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContactAsync(array $args = [])\n * @method \\Aws\\Result updateDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDeviceAsync(array $args = [])\n * @method \\Aws\\Result updateGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGatewayAsync(array $args = [])\n * @method \\Aws\\Result updateGatewayGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGatewayGroupAsync(array $args = [])\n * @method \\Aws\\Result updateNetworkProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNetworkProfileAsync(array $args = [])\n * @method \\Aws\\Result updateProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProfileAsync(array $args = [])\n * @method \\Aws\\Result updateRoom(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRoomAsync(array $args = [])\n * @method \\Aws\\Result updateSkillGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSkillGroupAsync(array $args = [])\n */\nclass AlexaForBusinessClient extends AwsClient {}\n", "num_lines": 196}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AlexaForBusiness\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Alexa For Business** service.\n */\nclass AlexaForBusinessException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Amplify;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Amplify** service.\n * @method \\Aws\\Result createApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppAsync(array $args = [])\n * @method \\Aws\\Result createBackendEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBackendEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result createBranch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBranchAsync(array $args = [])\n * @method \\Aws\\Result createDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeploymentAsync(array $args = [])\n * @method \\Aws\\Result createDomainAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDomainAssociationAsync(array $args = [])\n * @method \\Aws\\Result createWebhook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWebhookAsync(array $args = [])\n * @method \\Aws\\Result deleteApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppAsync(array $args = [])\n * @method \\Aws\\Result deleteBackendEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBackendEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result deleteBranch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBranchAsync(array $args = [])\n * @method \\Aws\\Result deleteDomainAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainAssociationAsync(array $args = [])\n * @method \\Aws\\Result deleteJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteJobAsync(array $args = [])\n * @method \\Aws\\Result deleteWebhook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWebhookAsync(array $args = [])\n * @method \\Aws\\Result generateAccessLogs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateAccessLogsAsync(array $args = [])\n * @method \\Aws\\Result getApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppAsync(array $args = [])\n * @method \\Aws\\Result getArtifactUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getArtifactUrlAsync(array $args = [])\n * @method \\Aws\\Result getBackendEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBackendEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result getBranch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBranchAsync(array $args = [])\n * @method \\Aws\\Result getDomainAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainAssociationAsync(array $args = [])\n * @method \\Aws\\Result getJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobAsync(array $args = [])\n * @method \\Aws\\Result getWebhook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWebhookAsync(array $args = [])\n * @method \\Aws\\Result listApps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppsAsync(array $args = [])\n * @method \\Aws\\Result listArtifacts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listArtifactsAsync(array $args = [])\n * @method \\Aws\\Result listBackendEnvironments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBackendEnvironmentsAsync(array $args = [])\n * @method \\Aws\\Result listBranches(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBranchesAsync(array $args = [])\n * @method \\Aws\\Result listDomainAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWebhooks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWebhooksAsync(array $args = [])\n * @method \\Aws\\Result startDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDeploymentAsync(array $args = [])\n * @method \\Aws\\Result startJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startJobAsync(array $args = [])\n * @method \\Aws\\Result stopJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopJobAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppAsync(array $args = [])\n * @method \\Aws\\Result updateBranch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBranchAsync(array $args = [])\n * @method \\Aws\\Result updateDomainAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDomainAssociationAsync(array $args = [])\n * @method \\Aws\\Result updateWebhook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWebhookAsync(array $args = [])\n */\nclass AmplifyClient extends AwsClient {}\n", "num_lines": 84}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Amplify\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Amplify** service.\n */\nclass AmplifyException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AmplifyBackend;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AmplifyBackend** service.\n * @method \\Aws\\Result cloneBackend(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cloneBackendAsync(array $args = [])\n * @method \\Aws\\Result createBackend(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBackendAsync(array $args = [])\n * @method \\Aws\\Result createBackendAPI(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBackendAPIAsync(array $args = [])\n * @method \\Aws\\Result createBackendAuth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBackendAuthAsync(array $args = [])\n * @method \\Aws\\Result createBackendConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBackendConfigAsync(array $args = [])\n * @method \\Aws\\Result createBackendStorage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBackendStorageAsync(array $args = [])\n * @method \\Aws\\Result createToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTokenAsync(array $args = [])\n * @method \\Aws\\Result deleteBackend(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBackendAsync(array $args = [])\n * @method \\Aws\\Result deleteBackendAPI(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBackendAPIAsync(array $args = [])\n * @method \\Aws\\Result deleteBackendAuth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBackendAuthAsync(array $args = [])\n * @method \\Aws\\Result deleteBackendStorage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBackendStorageAsync(array $args = [])\n * @method \\Aws\\Result deleteToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTokenAsync(array $args = [])\n * @method \\Aws\\Result generateBackendAPIModels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateBackendAPIModelsAsync(array $args = [])\n * @method \\Aws\\Result getBackend(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBackendAsync(array $args = [])\n * @method \\Aws\\Result getBackendAPI(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBackendAPIAsync(array $args = [])\n * @method \\Aws\\Result getBackendAPIModels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBackendAPIModelsAsync(array $args = [])\n * @method \\Aws\\Result getBackendAuth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBackendAuthAsync(array $args = [])\n * @method \\Aws\\Result getBackendJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBackendJobAsync(array $args = [])\n * @method \\Aws\\Result getBackendStorage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBackendStorageAsync(array $args = [])\n * @method \\Aws\\Result getToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTokenAsync(array $args = [])\n * @method \\Aws\\Result importBackendAuth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importBackendAuthAsync(array $args = [])\n * @method \\Aws\\Result importBackendStorage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importBackendStorageAsync(array $args = [])\n * @method \\Aws\\Result listBackendJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBackendJobsAsync(array $args = [])\n * @method \\Aws\\Result listS3Buckets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listS3BucketsAsync(array $args = [])\n * @method \\Aws\\Result removeAllBackends(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeAllBackendsAsync(array $args = [])\n * @method \\Aws\\Result removeBackendConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeBackendConfigAsync(array $args = [])\n * @method \\Aws\\Result updateBackendAPI(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBackendAPIAsync(array $args = [])\n * @method \\Aws\\Result updateBackendAuth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBackendAuthAsync(array $args = [])\n * @method \\Aws\\Result updateBackendConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBackendConfigAsync(array $args = [])\n * @method \\Aws\\Result updateBackendJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBackendJobAsync(array $args = [])\n * @method \\Aws\\Result updateBackendStorage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBackendStorageAsync(array $args = [])\n */\nclass AmplifyBackendClient extends AwsClient {}\n", "num_lines": 72}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AmplifyBackend\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AmplifyBackend** service.\n */\nclass AmplifyBackendException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AmplifyUIBuilder;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Amplify UI Builder** service.\n * @method \\Aws\\Result createComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createComponentAsync(array $args = [])\n * @method \\Aws\\Result createForm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFormAsync(array $args = [])\n * @method \\Aws\\Result createTheme(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createThemeAsync(array $args = [])\n * @method \\Aws\\Result deleteComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteComponentAsync(array $args = [])\n * @method \\Aws\\Result deleteForm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFormAsync(array $args = [])\n * @method \\Aws\\Result deleteTheme(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteThemeAsync(array $args = [])\n * @method \\Aws\\Result exchangeCodeForToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exchangeCodeForTokenAsync(array $args = [])\n * @method \\Aws\\Result exportComponents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportComponentsAsync(array $args = [])\n * @method \\Aws\\Result exportForms(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportFormsAsync(array $args = [])\n * @method \\Aws\\Result exportThemes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportThemesAsync(array $args = [])\n * @method \\Aws\\Result getCodegenJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCodegenJobAsync(array $args = [])\n * @method \\Aws\\Result getComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getComponentAsync(array $args = [])\n * @method \\Aws\\Result getForm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFormAsync(array $args = [])\n * @method \\Aws\\Result getMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMetadataAsync(array $args = [])\n * @method \\Aws\\Result getTheme(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getThemeAsync(array $args = [])\n * @method \\Aws\\Result listCodegenJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCodegenJobsAsync(array $args = [])\n * @method \\Aws\\Result listComponents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listComponentsAsync(array $args = [])\n * @method \\Aws\\Result listForms(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFormsAsync(array $args = [])\n * @method \\Aws\\Result listThemes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listThemesAsync(array $args = [])\n * @method \\Aws\\Result putMetadataFlag(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putMetadataFlagAsync(array $args = [])\n * @method \\Aws\\Result refreshToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise refreshTokenAsync(array $args = [])\n * @method \\Aws\\Result startCodegenJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startCodegenJobAsync(array $args = [])\n * @method \\Aws\\Result updateComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateComponentAsync(array $args = [])\n * @method \\Aws\\Result updateForm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFormAsync(array $args = [])\n * @method \\Aws\\Result updateTheme(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateThemeAsync(array $args = [])\n */\nclass AmplifyUIBuilderClient extends AwsClient {}\n", "num_lines": 60}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AmplifyUIBuilder\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Amplify UI Builder** service.\n */\nclass AmplifyUIBuilderException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api;\n\n/**\n * Base class that is used by most API shapes\n */\nabstract class AbstractModel implements \\ArrayAccess\n{\n    /** @var array */\n    protected $definition;\n\n    /** @var ShapeMap */\n    protected $shapeMap;\n\n    /** @var array */\n    protected $contextParam;\n\n    /**\n     * @param array    $definition Service description\n     * @param ShapeMap $shapeMap   Shapemap used for creating shapes\n     */\n    public function __construct(array $definition, ShapeMap $shapeMap)\n    {\n        $this->definition = $definition;\n        $this->shapeMap = $shapeMap;\n        if (isset($definition['contextParam'])) {\n            $this->contextParam = $definition['contextParam'];\n        }\n    }\n\n    public function toArray()\n    {\n        return $this->definition;\n    }\n\n    /**\n     * @return mixed|null\n     */\n    #[\\ReturnTypeWillChange]\n    public function offsetGet($offset)\n    {\n        return isset($this->definition[$offset])\n            ? $this->definition[$offset] : null;\n    }\n\n    /**\n     * @return void\n     */\n    #[\\ReturnTypeWillChange]\n    public function offsetSet($offset, $value)\n    {\n        $this->definition[$offset] = $value;\n    }\n\n    /**\n     * @return bool\n     */\n    #[\\ReturnTypeWillChange]\n    public function offsetExists($offset)\n    {\n        return isset($this->definition[$offset]);\n    }\n\n    /**\n     * @return void\n     */\n    #[\\ReturnTypeWillChange]\n    public function offsetUnset($offset)\n    {\n        unset($this->definition[$offset]);\n    }\n\n    protected function shapeAt($key)\n    {\n        if (!isset($this->definition[$key])) {\n            throw new \\InvalidArgumentException('Expected shape definition at '\n                . $key);\n        }\n\n        return $this->shapeFor($this->definition[$key]);\n    }\n\n    protected function shapeFor(array $definition)\n    {\n        return isset($definition['shape'])\n            ? $this->shapeMap->resolve($definition)\n            : Shape::create($definition, $this->shapeMap);\n    }\n}\n", "num_lines": 90}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api;\n\nuse Aws\\Exception\\UnresolvedApiException;\n\n/**\n * API providers.\n *\n * An API provider is a function that accepts a type, service, and version and\n * returns an array of API data on success or NULL if no API data can be created\n * for the provided arguments.\n *\n * You can wrap your calls to an API provider with the\n * {@see ApiProvider::resolve} method to ensure that API data is created. If the\n * API data is not created, then the resolve() method will throw a\n * {@see Aws\\Exception\\UnresolvedApiException}.\n *\n *     use Aws\\Api\\ApiProvider;\n *     $provider = ApiProvider::defaultProvider();\n *     // Returns an array or NULL.\n *     $data = $provider('api', 's3', '2006-03-01');\n *     // Returns an array or throws.\n *     $data = ApiProvider::resolve($provider, 'api', 'elasticfood', '2020-01-01');\n *\n * You can compose multiple providers into a single provider using\n * {@see Aws\\or_chain}. This method accepts providers as arguments and\n * returns a new function that will invoke each provider until a non-null value\n * is returned.\n *\n *     $a = ApiProvider::filesystem(sys_get_temp_dir() . '/aws-beta-models');\n *     $b = ApiProvider::manifest();\n *\n *     $c = \\Aws\\or_chain($a, $b);\n *     $data = $c('api', 'betaservice', '2015-08-08'); // $a handles this.\n *     $data = $c('api', 's3', '2006-03-01');          // $b handles this.\n *     $data = $c('api', 'invalid', '2014-12-15');     // Neither handles this.\n */\nclass ApiProvider\n{\n    /** @var array A map of public API type names to their file suffix. */\n    private static $typeMap = [\n        'api'       => 'api-2',\n        'paginator' => 'paginators-1',\n        'waiter'    => 'waiters-2',\n        'docs'      => 'docs-2',\n    ];\n\n    /** @var array API manifest */\n    private $manifest;\n\n    /** @var string The directory containing service models. */\n    private $modelsDir;\n\n    /**\n     * Resolves an API provider and ensures a non-null return value.\n     *\n     * @param callable $provider Provider function to invoke.\n     * @param string   $type     Type of data ('api', 'waiter', 'paginator').\n     * @param string   $service  Service name.\n     * @param string   $version  API version.\n     *\n     * @return array\n     * @throws UnresolvedApiException\n     */\n    public static function resolve(callable $provider, $type, $service, $version)\n    {\n        // Execute the provider and return the result, if there is one.\n        $result = $provider($type, $service, $version);\n        if (is_array($result)) {\n            if (!isset($result['metadata']['serviceIdentifier'])) {\n                $result['metadata']['serviceIdentifier'] = $service;\n            }\n            return $result;\n        }\n\n        // Throw an exception with a message depending on the inputs.\n        if (!isset(self::$typeMap[$type])) {\n            $msg = \"The type must be one of: \" . implode(', ', self::$typeMap);\n        } elseif ($service) {\n            $msg = \"The {$service} service does not have version: {$version}.\";\n        } else {\n            $msg = \"You must specify a service name to retrieve its API data.\";\n        }\n\n        throw new UnresolvedApiException($msg);\n    }\n\n    /**\n     * Default SDK API provider.\n     *\n     * This provider loads pre-built manifest data from the `data` directory.\n     *\n     * @return self\n     */\n    public static function defaultProvider()\n    {\n        return new self(__DIR__ . '/../data', \\Aws\\manifest());\n    }\n\n    /**\n     * Loads API data after resolving the version to the latest, compatible,\n     * available version based on the provided manifest data.\n     *\n     * Manifest data is essentially an associative array of service names to\n     * associative arrays of API version aliases.\n     *\n     * [\n     *   ...\n     *   'ec2' => [\n     *     'latest'     => '2014-10-01',\n     *     '2014-10-01' => '2014-10-01',\n     *     '2014-09-01' => '2014-10-01',\n     *     '2014-06-15' => '2014-10-01',\n     *     ...\n     *   ],\n     *   'ecs' => [...],\n     *   'elasticache' => [...],\n     *   ...\n     * ]\n     *\n     * @param string $dir      Directory containing service models.\n     * @param array  $manifest The API version manifest data.\n     *\n     * @return self\n     */\n    public static function manifest($dir, array $manifest)\n    {\n        return new self($dir, $manifest);\n    }\n\n    /**\n     * Loads API data from the specified directory.\n     *\n     * If \"latest\" is specified as the version, this provider must glob the\n     * directory to find which is the latest available version.\n     *\n     * @param string $dir Directory containing service models.\n     *\n     * @return self\n     * @throws \\InvalidArgumentException if the provided `$dir` is invalid.\n     */\n    public static function filesystem($dir)\n    {\n        return new self($dir);\n    }\n\n    /**\n     * Retrieves a list of valid versions for the specified service.\n     *\n     * @param string $service Service name\n     *\n     * @return array\n     */\n    public function getVersions($service)\n    {\n        if (!isset($this->manifest)) {\n            $this->buildVersionsList($service);\n        }\n\n        if (!isset($this->manifest[$service]['versions'])) {\n            return [];\n        }\n\n        return array_values(array_unique($this->manifest[$service]['versions']));\n    }\n\n    /**\n     * Execute the provider.\n     *\n     * @param string $type    Type of data ('api', 'waiter', 'paginator').\n     * @param string $service Service name.\n     * @param string $version API version.\n     *\n     * @return array|null\n     */\n    public function __invoke($type, $service, $version)\n    {\n        // Resolve the type or return null.\n        if (isset(self::$typeMap[$type])) {\n            $type = self::$typeMap[$type];\n        } else {\n            return null;\n        }\n\n        // Resolve the version or return null.\n        if (!isset($this->manifest)) {\n            $this->buildVersionsList($service);\n        }\n\n        if (!isset($this->manifest[$service]['versions'][$version])) {\n            return null;\n        }\n\n        $version = $this->manifest[$service]['versions'][$version];\n        $path = \"{$this->modelsDir}/{$service}/{$version}/{$type}.json\";\n\n        try {\n            return \\Aws\\load_compiled_json($path);\n        } catch (\\InvalidArgumentException $e) {\n            return null;\n        }\n    }\n\n    /**\n     * @param string $modelsDir Directory containing service models.\n     * @param array  $manifest  The API version manifest data.\n     */\n    private function __construct($modelsDir, array $manifest = null)\n    {\n        $this->manifest = $manifest;\n        $this->modelsDir = rtrim($modelsDir, '/');\n        if (!is_dir($this->modelsDir)) {\n            throw new \\InvalidArgumentException(\n                \"The specified models directory, {$modelsDir}, was not found.\"\n            );\n        }\n    }\n\n    /**\n     * Build the versions list for the specified service by globbing the dir.\n     */\n    private function buildVersionsList($service)\n    {\n        $dir = \"{$this->modelsDir}/{$service}/\";\n\n        if (!is_dir($dir)) {\n            return;\n        }\n\n        // Get versions, remove . and .., and sort in descending order.\n        $results = array_diff(scandir($dir, SCANDIR_SORT_DESCENDING), ['..', '.']);\n\n        if (!$results) {\n            $this->manifest[$service] = ['versions' => []];\n        } else {\n            $this->manifest[$service] = [\n                'versions' => [\n                    'latest' => $results[0]\n                ]\n            ];\n            $this->manifest[$service]['versions'] += array_combine($results, $results);\n        }\n    }\n}\n", "num_lines": 245}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Api;\n\nuse Aws\\Api\\Parser\\Exception\\ParserException;\nuse DateTime;\nuse DateTimeZone;\nuse Exception;\n\n/**\n * DateTime overrides that make DateTime work more seamlessly as a string,\n * with JSON documents, and with JMESPath.\n */\nclass DateTimeResult extends \\DateTime implements \\JsonSerializable\n{\n    /**\n     * Create a new DateTimeResult from a unix timestamp.\n     * The Unix epoch (or Unix time or POSIX time or Unix\n     * timestamp) is the number of seconds that have elapsed since\n     * January 1, 1970 (midnight UTC/GMT).\n     *\n     * @return DateTimeResult\n     * @throws Exception\n     */\n    public static function fromEpoch($unixTimestamp)\n    {\n        if (!is_numeric($unixTimestamp)) {\n            throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromEpoch');\n        }\n\n        // PHP 5.5 does not support sub-second precision\n        if (\\PHP_VERSION_ID < 56000) {\n            return new self(gmdate('c', $unixTimestamp));\n        }\n\n        $decimalSeparator = isset(localeconv()['decimal_point']) ? localeconv()['decimal_point'] : \".\";\n        $formatString = \"U\" . $decimalSeparator . \"u\";\n        $dateTime = DateTime::createFromFormat(\n            $formatString,\n            sprintf('%0.6f', $unixTimestamp),\n            new DateTimeZone('UTC')\n        );\n\n        if (false === $dateTime) {\n            throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromEpoch');\n        }\n\n        return new self(\n            $dateTime->format('Y-m-d H:i:s.u'),\n            new DateTimeZone('UTC')\n        );\n    }\n\n    /**\n     * @return DateTimeResult\n     */\n    public static function fromISO8601($iso8601Timestamp)\n    {\n        if (is_numeric($iso8601Timestamp) || !is_string($iso8601Timestamp)) {\n            throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromISO8601');\n        }\n\n        return new DateTimeResult($iso8601Timestamp);\n    }\n\n    /**\n     * Create a new DateTimeResult from an unknown timestamp.\n     *\n     * @return DateTimeResult\n     * @throws Exception\n     */\n    public static function fromTimestamp($timestamp, $expectedFormat = null)\n    {\n        if (empty($timestamp)) {\n            return self::fromEpoch(0);\n        }\n\n        if (!(is_string($timestamp) || is_numeric($timestamp))) {\n            throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromTimestamp');\n        }\n\n        try {\n            if ($expectedFormat == 'iso8601') {\n                try {\n                    return self::fromISO8601($timestamp);\n                } catch (Exception $exception) {\n                    return self::fromEpoch($timestamp);\n                }\n            } else if ($expectedFormat == 'unixTimestamp') {\n                try {\n                    return self::fromEpoch($timestamp);\n                } catch (Exception $exception) {\n                    return self::fromISO8601($timestamp);\n                }\n            } else if (\\Aws\\is_valid_epoch($timestamp)) {\n                return self::fromEpoch($timestamp);\n            }\n            return self::fromISO8601($timestamp);\n        } catch (Exception $exception) {\n            throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromTimestamp');\n        }\n    }\n\n    /**\n     * Serialize the DateTimeResult as an ISO 8601 date string.\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return $this->format('c');\n    }\n\n    /**\n     * Serialize the date as an ISO 8601 date when serializing as JSON.\n     *\n     * @return string\n     */\n    #[\\ReturnTypeWillChange]\n    public function jsonSerialize()\n    {\n        return (string) $this;\n    }\n}\n", "num_lines": 125}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api;\n\n/**\n * Encapsulates the documentation strings for a given service-version and\n * provides methods for extracting the desired parts related to a service,\n * operation, error, or shape (i.e., parameter).\n */\nclass DocModel\n{\n    /** @var array */\n    private $docs;\n\n    /**\n     * @param array $docs\n     *\n     * @throws \\RuntimeException\n     */\n    public function __construct(array $docs)\n    {\n        if (!extension_loaded('tidy')) {\n            throw new \\RuntimeException('The \"tidy\" PHP extension is required.');\n        }\n\n        $this->docs = $docs;\n    }\n\n    /**\n     * Convert the doc model to an array.\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        return $this->docs;\n    }\n\n    /**\n     * Retrieves documentation about the service.\n     *\n     * @return null|string\n     */\n    public function getServiceDocs()\n    {\n        return isset($this->docs['service']) ? $this->docs['service'] : null;\n    }\n\n    /**\n     * Retrieves documentation about an operation.\n     *\n     * @param string $operation Name of the operation\n     *\n     * @return null|string\n     */\n    public function getOperationDocs($operation)\n    {\n        return isset($this->docs['operations'][$operation])\n            ? $this->docs['operations'][$operation]\n            : null;\n    }\n\n    /**\n     * Retrieves documentation about an error.\n     *\n     * @param string $error Name of the error\n     *\n     * @return null|string\n     */\n    public function getErrorDocs($error)\n    {\n        return isset($this->docs['shapes'][$error]['base'])\n            ? $this->docs['shapes'][$error]['base']\n            : null;\n    }\n\n    /**\n     * Retrieves documentation about a shape, specific to the context.\n     *\n     * @param string $shapeName  Name of the shape.\n     * @param string $parentName Name of the parent/context shape.\n     * @param string $ref        Name used by the context to reference the shape.\n     *\n     * @return null|string\n     */\n    public function getShapeDocs($shapeName, $parentName, $ref)\n    {\n        if (!isset($this->docs['shapes'][$shapeName])) {\n            return '';\n        }\n\n        $result = '';\n        $d = $this->docs['shapes'][$shapeName];\n        if (isset($d['refs'][\"{$parentName}\\$${ref}\"])) {\n            $result = $d['refs'][\"{$parentName}\\$${ref}\"];\n        } elseif (isset($d['base'])) {\n            $result = $d['base'];\n        }\n\n        if (isset($d['append'])) {\n            if (!isset($d['excludeAppend'])\n                || !in_array($parentName, $d['excludeAppend'])\n            ) {\n                $result .= $d['append'];\n            }\n        }\n\n        if (isset($d['appendOnly'])\n           && in_array($parentName, $d['appendOnly']['shapes'])\n        ) {\n            $result .= $d['appendOnly']['message'];\n        }\n\n        return $this->clean($result);\n    }\n\n    private function clean($content)\n    {\n        if (!$content) {\n            return '';\n        }\n\n        $tidy = new \\tidy();\n        $tidy->parseString($content, [\n            'indent' => true,\n            'doctype' => 'omit',\n            'output-html' => true,\n            'show-body-only' => true,\n            'drop-empty-paras' => true,\n            'drop-font-tags' => true,\n            'drop-proprietary-attributes' => true,\n            'hide-comments' => true,\n            'logical-emphasis' => true\n        ]);\n        $tidy->cleanRepair();\n\n        return (string) $content;\n    }\n}\n", "num_lines": 139}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api;\n\n/**\n * Represents a list shape.\n */\nclass ListShape extends Shape\n{\n    private $member;\n\n    public function __construct(array $definition, ShapeMap $shapeMap)\n    {\n        $definition['type'] = 'list';\n        parent::__construct($definition, $shapeMap);\n    }\n\n    /**\n     * @return Shape\n     * @throws \\RuntimeException if no member is specified\n     */\n    public function getMember()\n    {\n        if (!$this->member) {\n            if (!isset($this->definition['member'])) {\n                throw new \\RuntimeException('No member attribute specified');\n            }\n            $this->member = Shape::create(\n                $this->definition['member'],\n                $this->shapeMap\n            );\n        }\n\n        return $this->member;\n    }\n}\n", "num_lines": 36}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api;\n\n/**\n * Represents a map shape.\n */\nclass MapShape extends Shape\n{\n    /** @var Shape */\n    private $value;\n\n    /** @var Shape */\n    private $key;\n\n    public function __construct(array $definition, ShapeMap $shapeMap)\n    {\n        $definition['type'] = 'map';\n        parent::__construct($definition, $shapeMap);\n    }\n\n    /**\n     * @return Shape\n     * @throws \\RuntimeException if no value is specified\n     */\n    public function getValue()\n    {\n        if (!$this->value) {\n            if (!isset($this->definition['value'])) {\n                throw new \\RuntimeException('No value specified');\n            }\n\n            $this->value = Shape::create(\n                $this->definition['value'],\n                $this->shapeMap\n            );\n        }\n\n        return $this->value;\n    }\n\n    /**\n     * @return Shape\n     */\n    public function getKey()\n    {\n        if (!$this->key) {\n            $this->key = isset($this->definition['key'])\n                ? Shape::create($this->definition['key'], $this->shapeMap)\n                : new Shape(['type' => 'string'], $this->shapeMap);\n        }\n\n        return $this->key;\n    }\n}\n", "num_lines": 55}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api;\n\n/**\n * Represents an API operation.\n */\nclass Operation extends AbstractModel\n{\n    private $input;\n    private $output;\n    private $errors;\n    private $staticContextParams = [];\n    private $contextParams;\n\n    public function __construct(array $definition, ShapeMap $shapeMap)\n    {\n        $definition['type'] = 'structure';\n\n        if (!isset($definition['http']['method'])) {\n            $definition['http']['method'] = 'POST';\n        }\n\n        if (!isset($definition['http']['requestUri'])) {\n            $definition['http']['requestUri'] = '/';\n        }\n\n        if (isset($definition['staticContextParams'])) {\n            $this->staticContextParams = $definition['staticContextParams'];\n        }\n\n        parent::__construct($definition, $shapeMap);\n        $this->contextParams = $this->setContextParams();\n    }\n\n    /**\n     * Returns an associative array of the HTTP attribute of the operation:\n     *\n     * - method: HTTP method of the operation\n     * - requestUri: URI of the request (can include URI template placeholders)\n     *\n     * @return array\n     */\n    public function getHttp()\n    {\n        return $this->definition['http'];\n    }\n\n    /**\n     * Get the input shape of the operation.\n     *\n     * @return StructureShape\n     */\n    public function getInput()\n    {\n        if (!$this->input) {\n            if ($input = $this['input']) {\n                $this->input = $this->shapeFor($input);\n            } else {\n                $this->input = new StructureShape([], $this->shapeMap);\n            }\n        }\n\n        return $this->input;\n    }\n\n    /**\n     * Get the output shape of the operation.\n     *\n     * @return StructureShape\n     */\n    public function getOutput()\n    {\n        if (!$this->output) {\n            if ($output = $this['output']) {\n                $this->output = $this->shapeFor($output);\n            } else {\n                $this->output = new StructureShape([], $this->shapeMap);\n            }\n        }\n\n        return $this->output;\n    }\n\n    /**\n     * Get an array of operation error shapes.\n     *\n     * @return Shape[]\n     */\n    public function getErrors()\n    {\n        if ($this->errors === null) {\n            if ($errors = $this['errors']) {\n                foreach ($errors as $key => $error) {\n                    $errors[$key] = $this->shapeFor($error);\n                }\n                $this->errors = $errors;\n            } else {\n                $this->errors = [];\n            }\n        }\n\n        return $this->errors;\n    }\n\n    /**\n     * Gets static modeled static values used for\n     * endpoint resolution.\n     *\n     * @return array\n     */\n    public function getStaticContextParams()\n    {\n        return $this->staticContextParams;\n    }\n\n    /**\n     * Gets definition of modeled dynamic values used\n     * for endpoint resolution\n     *\n     * @return array\n     */\n    public function getContextParams()\n    {\n        return $this->contextParams;\n    }\n\n    private function setContextParams()\n    {\n        $members = $this->getInput()->getMembers();\n        $contextParams = [];\n\n        foreach($members as $name => $shape) {\n            if (!empty($contextParam = $shape->getContextParam())) {\n                $contextParams[$contextParam['name']] = [\n                    'shape' => $name,\n                    'type' => $shape->getType()\n                ];\n            }\n        }\n        return $contextParams;\n    }\n}\n", "num_lines": 143}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api;\n\n/**\n * Represents a web service API model.\n */\nclass Service extends AbstractModel\n{\n    /** @var callable */\n    private $apiProvider;\n\n    /** @var string */\n    private $serviceName;\n\n    /** @var string */\n    private $apiVersion;\n\n    /** @var array */\n    private $clientContextParams = [];\n\n    /** @var Operation[] */\n    private $operations = [];\n\n    /** @var array */\n    private $paginators = null;\n\n    /** @var array */\n    private $waiters = null;\n\n    /** @var boolean */\n    private $modifiedModel = false;\n\n    /**\n     * @param array    $definition\n     * @param callable $provider\n     *\n     * @internal param array $definition Service description\n     */\n    public function __construct(array $definition, callable $provider)\n    {\n        static $defaults = [\n            'operations' => [],\n            'shapes'     => [],\n            'metadata'   => [],\n            'clientContextParams' => []\n        ], $defaultMeta = [\n            'apiVersion'       => null,\n            'serviceFullName'  => null,\n            'serviceId'        => null,\n            'endpointPrefix'   => null,\n            'signingName'      => null,\n            'signatureVersion' => null,\n            'protocol'         => null,\n            'uid'              => null\n        ];\n\n        $definition += $defaults;\n        $definition['metadata'] += $defaultMeta;\n        $this->definition = $definition;\n        $this->apiProvider = $provider;\n        parent::__construct($definition, new ShapeMap($definition['shapes']));\n\n        if (isset($definition['metadata']['serviceIdentifier'])) {\n            $this->serviceName = $this->getServiceName();\n        } else {\n            $this->serviceName = $this->getEndpointPrefix();\n        }\n        $this->apiVersion = $this->getApiVersion();\n        if (isset($definition['clientContextParams'])) {\n           $this->clientContextParams = $definition['clientContextParams'];\n        }\n    }\n\n    /**\n     * Creates a request serializer for the provided API object.\n     *\n     * @param Service $api      API that contains a protocol.\n     * @param string  $endpoint Endpoint to send requests to.\n     *\n     * @return callable\n     * @throws \\UnexpectedValueException\n     */\n    public static function createSerializer(Service $api, $endpoint)\n    {\n        static $mapping = [\n            'json'      => Serializer\\JsonRpcSerializer::class,\n            'query'     => Serializer\\QuerySerializer::class,\n            'rest-json' => Serializer\\RestJsonSerializer::class,\n            'rest-xml'  => Serializer\\RestXmlSerializer::class\n        ];\n\n        $proto = $api->getProtocol();\n\n        if (isset($mapping[$proto])) {\n            return new $mapping[$proto]($api, $endpoint);\n        }\n\n        if ($proto == 'ec2') {\n            return new Serializer\\QuerySerializer($api, $endpoint, new Serializer\\Ec2ParamBuilder());\n        }\n\n        throw new \\UnexpectedValueException(\n            'Unknown protocol: ' . $api->getProtocol()\n        );\n    }\n\n    /**\n     * Creates an error parser for the given protocol.\n     *\n     * Redundant method signature to preserve backwards compatibility.\n     *\n     * @param string $protocol Protocol to parse (e.g., query, json, etc.)\n     *\n     * @return callable\n     * @throws \\UnexpectedValueException\n     */\n    public static function createErrorParser($protocol, Service $api = null)\n    {\n        static $mapping = [\n            'json'      => ErrorParser\\JsonRpcErrorParser::class,\n            'query'     => ErrorParser\\XmlErrorParser::class,\n            'rest-json' => ErrorParser\\RestJsonErrorParser::class,\n            'rest-xml'  => ErrorParser\\XmlErrorParser::class,\n            'ec2'       => ErrorParser\\XmlErrorParser::class\n        ];\n\n        if (isset($mapping[$protocol])) {\n            return new $mapping[$protocol]($api);\n        }\n\n        throw new \\UnexpectedValueException(\"Unknown protocol: $protocol\");\n    }\n\n    /**\n     * Applies the listeners needed to parse client models.\n     *\n     * @param Service $api API to create a parser for\n     * @return callable\n     * @throws \\UnexpectedValueException\n     */\n    public static function createParser(Service $api)\n    {\n        static $mapping = [\n            'json'      => Parser\\JsonRpcParser::class,\n            'query'     => Parser\\QueryParser::class,\n            'rest-json' => Parser\\RestJsonParser::class,\n            'rest-xml'  => Parser\\RestXmlParser::class\n        ];\n\n        $proto = $api->getProtocol();\n        if (isset($mapping[$proto])) {\n            return new $mapping[$proto]($api);\n        }\n\n        if ($proto == 'ec2') {\n            return new Parser\\QueryParser($api, null, false);\n        }\n\n        throw new \\UnexpectedValueException(\n            'Unknown protocol: ' . $api->getProtocol()\n        );\n    }\n\n    /**\n     * Get the full name of the service\n     *\n     * @return string\n     */\n    public function getServiceFullName()\n    {\n        return $this->definition['metadata']['serviceFullName'];\n    }\n\n    /**\n     * Get the service id\n     *\n     * @return string\n     */\n    public function getServiceId()\n    {\n        return $this->definition['metadata']['serviceId'];\n    }\n\n    /**\n     * Get the API version of the service\n     *\n     * @return string\n     */\n    public function getApiVersion()\n    {\n        return $this->definition['metadata']['apiVersion'];\n    }\n\n    /**\n     * Get the API version of the service\n     *\n     * @return string\n     */\n    public function getEndpointPrefix()\n    {\n        return $this->definition['metadata']['endpointPrefix'];\n    }\n\n    /**\n     * Get the signing name used by the service.\n     *\n     * @return string\n     */\n    public function getSigningName()\n    {\n        return $this->definition['metadata']['signingName']\n            ?: $this->definition['metadata']['endpointPrefix'];\n    }\n\n    /**\n     * Get the service name.\n     *\n     * @return string\n     */\n    public function getServiceName()\n    {\n        return $this->definition['metadata']['serviceIdentifier'];\n    }\n\n    /**\n     * Get the default signature version of the service.\n     *\n     * Note: this method assumes \"v4\" when not specified in the model.\n     *\n     * @return string\n     */\n    public function getSignatureVersion()\n    {\n        return $this->definition['metadata']['signatureVersion'] ?: 'v4';\n    }\n\n    /**\n     * Get the protocol used by the service.\n     *\n     * @return string\n     */\n    public function getProtocol()\n    {\n        return $this->definition['metadata']['protocol'];\n    }\n\n    /**\n     * Get the uid string used by the service\n     *\n     * @return string\n     */\n    public function getUid()\n    {\n        return $this->definition['metadata']['uid'];\n    }\n\n    /**\n     * Check if the description has a specific operation by name.\n     *\n     * @param string $name Operation to check by name\n     *\n     * @return bool\n     */\n    public function hasOperation($name)\n    {\n        return isset($this['operations'][$name]);\n    }\n\n    /**\n     * Get an operation by name.\n     *\n     * @param string $name Operation to retrieve by name\n     *\n     * @return Operation\n     * @throws \\InvalidArgumentException If the operation is not found\n     */\n    public function getOperation($name)\n    {\n        if (!isset($this->operations[$name])) {\n            if (!isset($this->definition['operations'][$name])) {\n                throw new \\InvalidArgumentException(\"Unknown operation: $name\");\n            }\n            $this->operations[$name] = new Operation(\n                $this->definition['operations'][$name],\n                $this->shapeMap\n            );\n        } else if ($this->modifiedModel) {\n            $this->operations[$name] = new Operation(\n                $this->definition['operations'][$name],\n                $this->shapeMap\n            );\n        }\n\n        return $this->operations[$name];\n    }\n\n    /**\n     * Get all of the operations of the description.\n     *\n     * @return Operation[]\n     */\n    public function getOperations()\n    {\n        $result = [];\n        foreach ($this->definition['operations'] as $name => $definition) {\n            $result[$name] = $this->getOperation($name);\n        }\n\n        return $result;\n    }\n\n    /**\n     * Get all of the error shapes of the service\n     *\n     * @return array\n     */\n    public function getErrorShapes()\n    {\n        $result = [];\n        foreach ($this->definition['shapes'] as $name => $definition) {\n            if (!empty($definition['exception'])) {\n                $definition['name'] = $name;\n                $result[] = new StructureShape($definition, $this->getShapeMap());\n            }\n        }\n\n        return $result;\n    }\n\n    /**\n     * Get all of the service metadata or a specific metadata key value.\n     *\n     * @param string|null $key Key to retrieve or null to retrieve all metadata\n     *\n     * @return mixed Returns the result or null if the key is not found\n     */\n    public function getMetadata($key = null)\n    {\n        if (!$key) {\n            return $this['metadata'];\n        }\n\n        if (isset($this->definition['metadata'][$key])) {\n            return $this->definition['metadata'][$key];\n        }\n\n        return null;\n    }\n\n    /**\n     * Gets an associative array of available paginator configurations where\n     * the key is the name of the paginator, and the value is the paginator\n     * configuration.\n     *\n     * @return array\n     * @unstable The configuration format of paginators may change in the future\n     */\n    public function getPaginators()\n    {\n        if (!isset($this->paginators)) {\n            $res = call_user_func(\n                $this->apiProvider,\n                'paginator',\n                $this->serviceName,\n                $this->apiVersion\n            );\n            $this->paginators = isset($res['pagination'])\n                ? $res['pagination']\n                : [];\n        }\n\n        return $this->paginators;\n    }\n\n    /**\n     * Determines if the service has a paginator by name.\n     *\n     * @param string $name Name of the paginator.\n     *\n     * @return bool\n     */\n    public function hasPaginator($name)\n    {\n        return isset($this->getPaginators()[$name]);\n    }\n\n    /**\n     * Retrieve a paginator by name.\n     *\n     * @param string $name Paginator to retrieve by name. This argument is\n     *                     typically the operation name.\n     * @return array\n     * @throws \\UnexpectedValueException if the paginator does not exist.\n     * @unstable The configuration format of paginators may change in the future\n     */\n    public function getPaginatorConfig($name)\n    {\n        static $defaults = [\n            'input_token'  => null,\n            'output_token' => null,\n            'limit_key'    => null,\n            'result_key'   => null,\n            'more_results' => null,\n        ];\n\n        if ($this->hasPaginator($name)) {\n            return $this->paginators[$name] + $defaults;\n        }\n\n        throw new \\UnexpectedValueException(\"There is no {$name} \"\n            . \"paginator defined for the {$this->serviceName} service.\");\n    }\n\n    /**\n     * Gets an associative array of available waiter configurations where the\n     * key is the name of the waiter, and the value is the waiter\n     * configuration.\n     *\n     * @return array\n     */\n    public function getWaiters()\n    {\n        if (!isset($this->waiters)) {\n            $res = call_user_func(\n                $this->apiProvider,\n                'waiter',\n                $this->serviceName,\n                $this->apiVersion\n            );\n            $this->waiters = isset($res['waiters'])\n                ? $res['waiters']\n                : [];\n        }\n\n        return $this->waiters;\n    }\n\n    /**\n     * Determines if the service has a waiter by name.\n     *\n     * @param string $name Name of the waiter.\n     *\n     * @return bool\n     */\n    public function hasWaiter($name)\n    {\n        return isset($this->getWaiters()[$name]);\n    }\n\n    /**\n     * Get a waiter configuration by name.\n     *\n     * @param string $name Name of the waiter by name.\n     *\n     * @return array\n     * @throws \\UnexpectedValueException if the waiter does not exist.\n     */\n    public function getWaiterConfig($name)\n    {\n        // Error if the waiter is not defined\n        if ($this->hasWaiter($name)) {\n            return $this->waiters[$name];\n        }\n\n        throw new \\UnexpectedValueException(\"There is no {$name} waiter \"\n            . \"defined for the {$this->serviceName} service.\");\n    }\n\n    /**\n     * Get the shape map used by the API.\n     *\n     * @return ShapeMap\n     */\n    public function getShapeMap()\n    {\n        return $this->shapeMap;\n    }\n\n    /**\n     * Get all the context params of the description.\n     *\n     * @return array\n     */\n    public function getClientContextParams()\n    {\n        return $this->clientContextParams;\n    }\n\n    /**\n     * Get the service's api provider.\n     *\n     * @return callable\n     */\n    public function getProvider()\n    {\n        return $this->apiProvider;\n    }\n\n    /**\n     * Get the service's definition.\n     *\n     * @return callable\n     */\n    public function getDefinition()\n    {\n        return $this->definition;\n    }\n\n    /**\n     * Sets the service's api definition.\n     * Intended for internal use only.\n     *\n     * @return void\n     *\n     * @internal\n     */\n    public function setDefinition($definition)\n    {\n        $this->definition = $definition;\n        $this->modifiedModel = true;\n    }\n\n    /**\n     * Denotes whether or not a service's definition has\n     * been modified.  Intended for internal use only.\n     *\n     * @return bool\n     *\n     * @internal\n     */\n    public function isModifiedModel()\n    {\n        return $this->modifiedModel;\n    }\n}\n", "num_lines": 536}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api;\n\n/**\n * Base class representing a modeled shape.\n */\nclass Shape extends AbstractModel\n{\n    /**\n     * Get a concrete shape for the given definition.\n     *\n     * @param array    $definition\n     * @param ShapeMap $shapeMap\n     *\n     * @return mixed\n     * @throws \\RuntimeException if the type is invalid\n     */\n    public static function create(array $definition, ShapeMap $shapeMap)\n    {\n        static $map = [\n            'structure' => StructureShape::class,\n            'map'       => MapShape::class,\n            'list'      => ListShape::class,\n            'timestamp' => TimestampShape::class,\n            'integer'   => Shape::class,\n            'double'    => Shape::class,\n            'float'     => Shape::class,\n            'long'      => Shape::class,\n            'string'    => Shape::class,\n            'byte'      => Shape::class,\n            'character' => Shape::class,\n            'blob'      => Shape::class,\n            'boolean'   => Shape::class\n        ];\n\n        if (isset($definition['shape'])) {\n            return $shapeMap->resolve($definition);\n        }\n\n        if (!isset($map[$definition['type']])) {\n            throw new \\RuntimeException('Invalid type: '\n                . print_r($definition, true));\n        }\n\n        $type = $map[$definition['type']];\n\n        return new $type($definition, $shapeMap);\n    }\n\n    /**\n     * Get the type of the shape\n     *\n     * @return string\n     */\n    public function getType()\n    {\n        return $this->definition['type'];\n    }\n\n    /**\n     * Get the name of the shape\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        return $this->definition['name'];\n    }\n\n    /**\n     * Get a context param definition.\n     */\n    public function getContextParam()\n    {\n        return $this->contextParam;\n    }\n}\n", "num_lines": 78}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api;\n\n/**\n * Builds shape based on shape references.\n */\nclass ShapeMap\n{\n    /** @var array */\n    private $definitions;\n\n    /** @var Shape[] */\n    private $simple;\n\n    /**\n     * @param array $shapeModels Associative array of shape definitions.\n     */\n    public function __construct(array $shapeModels)\n    {\n        $this->definitions = $shapeModels;\n    }\n\n    /**\n     * Get an array of shape names.\n     *\n     * @return array\n     */\n    public function getShapeNames()\n    {\n        return array_keys($this->definitions);\n    }\n\n    /**\n     * Resolve a shape reference\n     *\n     * @param array $shapeRef Shape reference shape\n     *\n     * @return Shape\n     * @throws \\InvalidArgumentException\n     */\n    public function resolve(array $shapeRef)\n    {\n        $shape = $shapeRef['shape'];\n\n        if (!isset($this->definitions[$shape])) {\n            throw new \\InvalidArgumentException('Shape not found: ' . $shape);\n        }\n\n        $isSimple = count($shapeRef) == 1;\n        if ($isSimple && isset($this->simple[$shape])) {\n            return $this->simple[$shape];\n        }\n\n        $definition = $shapeRef + $this->definitions[$shape];\n        $definition['name'] = $definition['shape'];\n        if (isset($definition['shape'])) {\n            unset($definition['shape']);\n        }\n\n        $result = Shape::create($definition, $this);\n\n        if ($isSimple) {\n            $this->simple[$shape] = $result;\n        }\n\n        return $result;\n    }\n}\n", "num_lines": 69}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api;\n\n/**\n * Represents a structure shape and resolve member shape references.\n */\nclass StructureShape extends Shape\n{\n    /**\n     * @var Shape[]\n     */\n    private $members;\n\n    public function __construct(array $definition, ShapeMap $shapeMap)\n    {\n        $definition['type'] = 'structure';\n\n        if (!isset($definition['members'])) {\n            $definition['members'] = [];\n        }\n\n        parent::__construct($definition, $shapeMap);\n    }\n\n    /**\n     * Gets a list of all members\n     *\n     * @return Shape[]\n     */\n    public function getMembers()\n    {\n        if (empty($this->members)) {\n            $this->generateMembersHash();\n        }\n\n        return $this->members;\n    }\n\n    /**\n     * Check if a specific member exists by name.\n     *\n     * @param string $name Name of the member to check\n     *\n     * @return bool\n     */\n    public function hasMember($name)\n    {\n        return isset($this->definition['members'][$name]);\n    }\n\n    /**\n     * Retrieve a member by name.\n     *\n     * @param string $name Name of the member to retrieve\n     *\n     * @return Shape\n     * @throws \\InvalidArgumentException if the member is not found.\n     */\n    public function getMember($name)\n    {\n        $members = $this->getMembers();\n\n        if (!isset($members[$name])) {\n            throw new \\InvalidArgumentException('Unknown member ' . $name);\n        }\n\n        return $members[$name];\n    }\n\n\n    private function generateMembersHash()\n    {\n        $this->members = [];\n\n        foreach ($this->definition['members'] as $name => $definition) {\n            $this->members[$name] = $this->shapeFor($definition);\n        }\n    }\n}\n", "num_lines": 80}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api;\n\n/**\n * Represents a timestamp shape.\n */\nclass TimestampShape extends Shape\n{\n    public function __construct(array $definition, ShapeMap $shapeMap)\n    {\n        $definition['type'] = 'timestamp';\n        parent::__construct($definition, $shapeMap);\n    }\n\n    /**\n     * Formats a timestamp value for a service.\n     *\n     * @param mixed  $value  Value to format\n     * @param string $format Format used to serialize the value\n     *\n     * @return int|string\n     * @throws \\UnexpectedValueException if the format is unknown.\n     * @throws \\InvalidArgumentException if the value is an unsupported type.\n     */\n    public static function format($value, $format)\n    {\n        if ($value instanceof \\DateTimeInterface) {\n            $value = $value->getTimestamp();\n        } elseif (is_string($value)) {\n            $value = strtotime($value);\n        } elseif (!is_int($value)) {\n            throw new \\InvalidArgumentException('Unable to handle the provided'\n                . ' timestamp type: ' . gettype($value));\n        }\n\n        switch ($format) {\n            case 'iso8601':\n                return gmdate('Y-m-d\\TH:i:s\\Z', $value);\n            case 'rfc822':\n                return gmdate('D, d M Y H:i:s \\G\\M\\T', $value);\n            case 'unixTimestamp':\n                return $value;\n            default:\n                throw new \\UnexpectedValueException('Unknown timestamp format: '\n                    . $format);\n        }\n    }\n}\n", "num_lines": 49}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api;\n\nuse Aws;\n\n/**\n * Validates a schema against a hash of input.\n */\nclass Validator\n{\n    private $path = [];\n    private $errors = [];\n    private $constraints = [];\n\n    private static $defaultConstraints = [\n        'required' => true,\n        'min'      => true,\n        'max'      => false,\n        'pattern'  => false\n    ];\n\n    /**\n     * @param array $constraints Associative array of constraints to enforce.\n     *                           Accepts the following keys: \"required\", \"min\",\n     *                           \"max\", and \"pattern\". If a key is not\n     *                           provided, the constraint will assume false.\n     */\n    public function __construct(array $constraints = null)\n    {\n        static $assumedFalseValues = [\n            'required' => false,\n            'min'      => false,\n            'max'      => false,\n            'pattern'  => false\n        ];\n        $this->constraints = empty($constraints)\n            ? self::$defaultConstraints\n            : $constraints + $assumedFalseValues;\n    }\n\n    /**\n     * Validates the given input against the schema.\n     *\n     * @param string $name  Operation name\n     * @param Shape  $shape Shape to validate\n     * @param array  $input Input to validate\n     *\n     * @throws \\InvalidArgumentException if the input is invalid.\n     */\n    public function validate($name, Shape $shape, array $input)\n    {\n        $this->dispatch($shape, $input);\n\n        if ($this->errors) {\n            $message = sprintf(\n                \"Found %d error%s while validating the input provided for the \"\n                    . \"%s operation:\\n%s\",\n                count($this->errors),\n                count($this->errors) > 1 ? 's' : '',\n                $name,\n                implode(\"\\n\", $this->errors)\n            );\n            $this->errors = [];\n\n            throw new \\InvalidArgumentException($message);\n        }\n    }\n\n    private function dispatch(Shape $shape, $value)\n    {\n        static $methods = [\n            'structure' => 'check_structure',\n            'list'      => 'check_list',\n            'map'       => 'check_map',\n            'blob'      => 'check_blob',\n            'boolean'   => 'check_boolean',\n            'integer'   => 'check_numeric',\n            'float'     => 'check_numeric',\n            'long'      => 'check_numeric',\n            'string'    => 'check_string',\n            'byte'      => 'check_string',\n            'char'      => 'check_string'\n        ];\n\n        $type = $shape->getType();\n        if (isset($methods[$type])) {\n            $this->{$methods[$type]}($shape, $value);\n        }\n    }\n\n    private function check_structure(StructureShape $shape, $value)\n    {\n        $isDocument = (isset($shape['document']) && $shape['document']);\n        $isUnion = (isset($shape['union']) && $shape['union']);\n        if ($isDocument) {\n            if (!$this->checkDocumentType($value)) {\n                $this->addError(\"is not a valid document type\");\n                return;\n            }\n        } elseif ($isUnion) {\n            if (!$this->checkUnion($value)) {\n                $this->addError(\"is a union type and must have exactly one non null value\");\n                return;\n            }\n        } elseif (!$this->checkAssociativeArray($value)) {\n            return;\n        }\n\n        if ($this->constraints['required'] && $shape['required']) {\n            foreach ($shape['required'] as $req) {\n                if (!isset($value[$req])) {\n                    $this->path[] = $req;\n                    $this->addError('is missing and is a required parameter');\n                    array_pop($this->path);\n                }\n            }\n        }\n        if (!$isDocument) {\n            foreach ($value as $name => $v) {\n                if ($shape->hasMember($name)) {\n                    $this->path[] = $name;\n                    $this->dispatch(\n                        $shape->getMember($name),\n                        isset($value[$name]) ? $value[$name] : null\n                    );\n                    array_pop($this->path);\n                }\n            }\n        }\n    }\n\n    private function check_list(ListShape $shape, $value)\n    {\n        if (!is_array($value)) {\n            $this->addError('must be an array. Found '\n                . Aws\\describe_type($value));\n            return;\n        }\n\n        $this->validateRange($shape, count($value), \"list element count\");\n\n        $items = $shape->getMember();\n        foreach ($value as $index => $v) {\n            $this->path[] = $index;\n            $this->dispatch($items, $v);\n            array_pop($this->path);\n        }\n    }\n\n    private function check_map(MapShape $shape, $value)\n    {\n        if (!$this->checkAssociativeArray($value)) {\n            return;\n        }\n\n        $values = $shape->getValue();\n        foreach ($value as $key => $v) {\n            $this->path[] = $key;\n            $this->dispatch($values, $v);\n            array_pop($this->path);\n        }\n    }\n\n    private function check_blob(Shape $shape, $value)\n    {\n        static $valid = [\n            'string' => true,\n            'integer' => true,\n            'double' => true,\n            'resource' => true\n        ];\n\n        $type = gettype($value);\n        if (!isset($valid[$type])) {\n            if ($type != 'object' || !method_exists($value, '__toString')) {\n                $this->addError('must be an fopen resource, a '\n                    . 'GuzzleHttp\\Stream\\StreamInterface object, or something '\n                    . 'that can be cast to a string. Found '\n                    . Aws\\describe_type($value));\n            }\n        }\n    }\n\n    private function check_numeric(Shape $shape, $value)\n    {\n        if (!is_numeric($value)) {\n            $this->addError('must be numeric. Found '\n                . Aws\\describe_type($value));\n            return;\n        }\n\n        $this->validateRange($shape, $value, \"numeric value\");\n    }\n\n    private function check_boolean(Shape $shape, $value)\n    {\n        if (!is_bool($value)) {\n            $this->addError('must be a boolean. Found '\n                . Aws\\describe_type($value));\n        }\n    }\n\n    private function check_string(Shape $shape, $value)\n    {\n        if ($shape['jsonvalue']) {\n            if (!self::canJsonEncode($value)) {\n                $this->addError('must be a value encodable with \\'json_encode\\'.'\n                    . ' Found ' . Aws\\describe_type($value));\n            }\n            return;\n        }\n\n        if (!$this->checkCanString($value)) {\n            $this->addError('must be a string or an object that implements '\n                . '__toString(). Found ' . Aws\\describe_type($value));\n            return;\n        }\n\n        $value = isset($value) ? $value : '';\n        $this->validateRange($shape, strlen($value), \"string length\");\n\n        if ($this->constraints['pattern']) {\n            $pattern = $shape['pattern'];\n            if ($pattern && !preg_match(\"/$pattern/\", $value)) {\n                $this->addError(\"Pattern /$pattern/ failed to match '$value'\");\n            }\n        }\n    }\n\n    private function validateRange(Shape $shape, $length, $descriptor)\n    {\n        if ($this->constraints['min']) {\n            $min = $shape['min'];\n            if ($min && $length < $min) {\n                $this->addError(\"expected $descriptor to be >= $min, but \"\n                    . \"found $descriptor of $length\");\n            }\n        }\n\n        if ($this->constraints['max']) {\n            $max = $shape['max'];\n            if ($max && $length > $max) {\n                $this->addError(\"expected $descriptor to be <= $max, but \"\n                    . \"found $descriptor of $length\");\n            }\n        }\n    }\n\n    private function checkArray($arr)\n    {\n        return $this->isIndexed($arr) || $this->isAssociative($arr);\n    }\n\n    private function isAssociative($arr)\n    {\n        return count(array_filter(array_keys($arr), \"is_string\")) == count($arr);\n    }\n\n    private function isIndexed(array $arr)\n    {\n        return $arr == array_values($arr);\n    }\n\n    private function checkCanString($value)\n    {\n        static $valid = [\n            'string'  => true,\n            'integer' => true,\n            'double'  => true,\n            'NULL'    => true,\n        ];\n\n        $type = gettype($value);\n\n        return isset($valid[$type]) ||\n            ($type == 'object' && method_exists($value, '__toString'));\n    }\n\n    private function checkAssociativeArray($value)\n    {\n        $isAssociative = false;\n\n        if (is_array($value)) {\n            $expectedIndex = 0;\n            $key = key($value);\n\n            do {\n                $isAssociative = $key !== $expectedIndex++;\n                next($value);\n                $key = key($value);\n            } while (!$isAssociative && null !== $key);\n        }\n\n        if (!$isAssociative) {\n            $this->addError('must be an associative array. Found '\n                . Aws\\describe_type($value));\n            return false;\n        }\n\n        return true;\n    }\n\n    private function checkDocumentType($value)\n    {\n        if (is_array($value)) {\n            $typeOfFirstKey = gettype(key($value));\n            foreach ($value as $key => $val) {\n               if (!$this->checkDocumentType($val) || gettype($key) != $typeOfFirstKey) {\n                   return false;\n               }\n            }\n            return $this->checkArray($value);\n        }\n        return is_null($value)\n            || is_numeric($value)\n            || is_string($value)\n            || is_bool($value);\n    }\n\n    private function checkUnion($value)\n    {\n        if (is_array($value)) {\n            $nonNullCount = 0;\n            foreach ($value as $key => $val) {\n                if (!is_null($val) && !(strpos($key, \"@\") === 0)) {\n                    $nonNullCount++;\n                }\n            }\n            return $nonNullCount == 1;\n        }\n        return !is_null($value);\n    }\n\n    private function addError($message)\n    {\n        $this->errors[] =\n            implode('', array_map(function ($s) { return \"[{$s}]\"; }, $this->path))\n            . ' '\n            . $message;\n    }\n\n    private function canJsonEncode($data)\n    {\n        return !is_resource($data);\n    }\n}\n", "num_lines": 347}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\ErrorParser;\n\nuse Aws\\Api\\Parser\\MetadataParserTrait;\nuse Aws\\Api\\Parser\\PayloadParserTrait;\nuse Aws\\Api\\Service;\nuse Aws\\Api\\StructureShape;\nuse Aws\\CommandInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\n\nabstract class AbstractErrorParser\n{\n    use MetadataParserTrait;\n    use PayloadParserTrait;\n\n    /**\n     * @var Service\n     */\n    protected $api;\n\n    /**\n     * @param Service $api\n     */\n    public function __construct(Service $api = null)\n    {\n        $this->api = $api;\n    }\n\n    abstract protected function payload(\n        ResponseInterface $response,\n        StructureShape $member\n    );\n\n    protected function extractPayload(\n        StructureShape $member,\n        ResponseInterface $response\n    ) {\n        if ($member instanceof StructureShape) {\n            // Structure members parse top-level data into a specific key.\n            return $this->payload($response, $member);\n        } else {\n            // Streaming data is just the stream from the response body.\n            return $response->getBody();\n        }\n    }\n\n    protected function populateShape(\n        array &$data,\n        ResponseInterface $response,\n        CommandInterface $command = null\n    ) {\n        $data['body'] = [];\n\n        if (!empty($command) && !empty($this->api)) {\n\n            // If modeled error code is indicated, check for known error shape\n            if (!empty($data['code'])) {\n\n                $errors = $this->api->getOperation($command->getName())->getErrors();\n                foreach ($errors as $key => $error) {\n\n                    // If error code matches a known error shape, populate the body\n                    if ($data['code'] == $error['name']\n                        && $error instanceof StructureShape\n                    ) {\n                        $modeledError = $error;\n                        $data['body'] = $this->extractPayload(\n                            $modeledError,\n                            $response\n                        );\n                        $data['error_shape'] = $modeledError;\n\n                        foreach ($error->getMembers() as $name => $member) {\n                            switch ($member['location']) {\n                                case 'header':\n                                    $this->extractHeader($name, $member, $response, $data['body']);\n                                    break;\n                                case 'headers':\n                                    $this->extractHeaders($name, $member, $response, $data['body']);\n                                    break;\n                                case 'statusCode':\n                                    $this->extractStatus($name, $response, $data['body']);\n                                    break;\n                            }\n                        }\n\n                        break;\n                    }\n                }\n            }\n        }\n\n        return $data;\n    }\n}", "num_lines": 95}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\ErrorParser;\n\nuse Aws\\Api\\Parser\\PayloadParserTrait;\nuse Aws\\Api\\StructureShape;\nuse Psr\\Http\\Message\\ResponseInterface;\n\n/**\n * Provides basic JSON error parsing functionality.\n */\ntrait JsonParserTrait\n{\n    use PayloadParserTrait;\n\n    private function genericHandler(ResponseInterface $response)\n    {\n        $code = (string) $response->getStatusCode();\n        if ($this->api\n            && !is_null($this->api->getMetadata('awsQueryCompatible'))\n            && $response->getHeaderLine('x-amzn-query-error')\n        ) {\n            $queryError = $response->getHeaderLine('x-amzn-query-error');\n            $parts = explode(';', $queryError);\n            if (isset($parts) && count($parts) == 2 && $parts[0] && $parts[1]) {\n                $error_code = $parts[0];\n                $error_type = $parts[1];\n            }\n        }\n        if (!isset($error_type)) {\n            $error_type = $code[0] == '4' ? 'client' : 'server';\n        }\n\n        return [\n            'request_id'  => (string) $response->getHeaderLine('x-amzn-requestid'),\n            'code'        => isset($error_code) ? $error_code : null,\n            'message'     => null,\n            'type'        => $error_type,\n            'parsed'      => $this->parseJson($response->getBody(), $response)\n        ];\n    }\n\n    protected function payload(\n        ResponseInterface $response,\n        StructureShape $member\n    ) {\n        $jsonBody = $this->parseJson($response->getBody(), $response);\n\n        if ($jsonBody) {\n            return $this->parser->parse($member, $jsonBody);\n        }\n    }\n}\n", "num_lines": 53}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\ErrorParser;\n\nuse Aws\\Api\\Parser\\JsonParser;\nuse Aws\\Api\\Service;\nuse Aws\\CommandInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\n\n/**\n * Parsers JSON-RPC errors.\n */\nclass JsonRpcErrorParser extends AbstractErrorParser\n{\n    use JsonParserTrait;\n\n    private $parser;\n\n    public function __construct(Service $api = null, JsonParser $parser = null)\n    {\n        parent::__construct($api);\n        $this->parser = $parser ?: new JsonParser();\n    }\n\n    public function __invoke(\n        ResponseInterface $response,\n        CommandInterface $command = null\n    ) {\n        $data = $this->genericHandler($response);\n\n        // Make the casing consistent across services.\n        if ($data['parsed']) {\n            $data['parsed'] = array_change_key_case($data['parsed']);\n        }\n\n        if (isset($data['parsed']['__type'])) {\n            if (!isset($data['code'])) {\n                $parts = explode('#', $data['parsed']['__type']);\n                $data['code'] = isset($parts[1]) ? $parts[1] : $parts[0];\n            }\n            $data['message'] = isset($data['parsed']['message'])\n                ? $data['parsed']['message']\n                : null;\n        }\n\n        $this->populateShape($data, $response, $command);\n\n        return $data;\n    }\n}\n", "num_lines": 50}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\ErrorParser;\n\nuse Aws\\Api\\Parser\\JsonParser;\nuse Aws\\Api\\Service;\nuse Aws\\Api\\StructureShape;\nuse Aws\\CommandInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\n\n/**\n * Parses JSON-REST errors.\n */\nclass RestJsonErrorParser extends AbstractErrorParser\n{\n    use JsonParserTrait;\n\n    private $parser;\n\n    public function __construct(Service $api = null, JsonParser $parser = null)\n    {\n        parent::__construct($api);\n        $this->parser = $parser ?: new JsonParser();\n    }\n\n    public function __invoke(\n        ResponseInterface $response,\n        CommandInterface $command = null\n    ) {\n        $data = $this->genericHandler($response);\n\n        // Merge in error data from the JSON body\n        if ($json = $data['parsed']) {\n            $data = array_replace($data, $json);\n        }\n\n        // Correct error type from services like Amazon Glacier\n        if (!empty($data['type'])) {\n            $data['type'] = strtolower($data['type']);\n        }\n\n        // Retrieve the error code from services like Amazon Elastic Transcoder\n        if ($code = $response->getHeaderLine('x-amzn-errortype')) {\n            $colon = strpos($code, ':');\n            $data['code'] = $colon ? substr($code, 0, $colon) : $code;\n        }\n\n        // Retrieve error message directly\n        $data['message'] = isset($data['parsed']['message'])\n            ? $data['parsed']['message']\n            : (isset($data['parsed']['Message'])\n                ? $data['parsed']['Message']\n                : null);\n\n        $this->populateShape($data, $response, $command);\n\n        return $data;\n    }\n}\n", "num_lines": 59}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\ErrorParser;\n\nuse Aws\\Api\\Parser\\PayloadParserTrait;\nuse Aws\\Api\\Parser\\XmlParser;\nuse Aws\\Api\\Service;\nuse Aws\\Api\\StructureShape;\nuse Aws\\CommandInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\n\n/**\n * Parses XML errors.\n */\nclass XmlErrorParser extends AbstractErrorParser\n{\n    use PayloadParserTrait;\n\n    protected $parser;\n\n    public function __construct(Service $api = null, XmlParser $parser = null)\n    {\n        parent::__construct($api);\n        $this->parser = $parser ?: new XmlParser();\n    }\n\n    public function __invoke(\n        ResponseInterface $response,\n        CommandInterface $command = null\n    ) {\n        $code = (string) $response->getStatusCode();\n\n        $data = [\n            'type' => $code[0] == '4' ? 'client' : 'server',\n            'request_id' => null,\n            'code' => null,\n            'message' => null,\n            'parsed' => null\n        ];\n\n        $body = $response->getBody();\n        if ($body->getSize() > 0) {\n            $this->parseBody($this->parseXml($body, $response), $data);\n        } else {\n            $this->parseHeaders($response, $data);\n        }\n\n        $this->populateShape($data, $response, $command);\n\n        return $data;\n    }\n\n    private function parseHeaders(ResponseInterface $response, array &$data)\n    {\n        if ($response->getStatusCode() == '404') {\n            $data['code'] = 'NotFound';\n        }\n\n        $data['message'] = $response->getStatusCode() . ' '\n            . $response->getReasonPhrase();\n\n        if ($requestId = $response->getHeaderLine('x-amz-request-id')) {\n            $data['request_id'] = $requestId;\n            $data['message'] .= \" (Request-ID: $requestId)\";\n        }\n    }\n\n    private function parseBody(\\SimpleXMLElement $body, array &$data)\n    {\n        $data['parsed'] = $body;\n        $prefix = $this->registerNamespacePrefix($body);\n\n        if ($tempXml = $body->xpath(\"//{$prefix}Code[1]\")) {\n            $data['code'] = (string) $tempXml[0];\n        }\n\n        if ($tempXml = $body->xpath(\"//{$prefix}Message[1]\")) {\n            $data['message'] = (string) $tempXml[0];\n        }\n\n        $tempXml = $body->xpath(\"//{$prefix}RequestId[1]\");\n        if (isset($tempXml[0])) {\n            $data['request_id'] = (string)$tempXml[0];\n        }\n    }\n\n    protected function registerNamespacePrefix(\\SimpleXMLElement $element)\n    {\n        $namespaces = $element->getDocNamespaces();\n        if (!isset($namespaces[''])) {\n            return '';\n        } \n        \n        // Account for the default namespace being defined and PHP not\n        // being able to handle it :(.\n        $element->registerXPathNamespace('ns', $namespaces['']);\n        return 'ns:';\n    }\n\n    protected function payload(\n        ResponseInterface $response,\n        StructureShape $member\n    ) {\n        $xmlBody = $this->parseXml($response->getBody(), $response);\n        $prefix = $this->registerNamespacePrefix($xmlBody);\n        $errorBody = $xmlBody->xpath(\"//{$prefix}Error\");\n\n        if (is_array($errorBody) && !empty($errorBody[0])) {\n            return $this->parser->parse($member, $errorBody[0]);\n        }\n    }\n}\n", "num_lines": 112}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Parser;\n\nuse Aws\\Api\\Service;\nuse Aws\\Api\\StructureShape;\nuse Aws\\CommandInterface;\nuse Aws\\ResultInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Psr\\Http\\Message\\StreamInterface;\n\n/**\n * @internal\n */\nabstract class AbstractParser\n{\n    /** @var \\Aws\\Api\\Service Representation of the service API*/\n    protected $api;\n\n    /** @var callable */\n    protected $parser;\n\n    /**\n     * @param Service $api Service description.\n     */\n    public function __construct(Service $api)\n    {\n        $this->api = $api;\n    }\n\n    /**\n     * @param CommandInterface  $command  Command that was executed.\n     * @param ResponseInterface $response Response that was received.\n     *\n     * @return ResultInterface\n     */\n    abstract public function __invoke(\n        CommandInterface $command,\n        ResponseInterface $response\n    );\n\n    abstract public function parseMemberFromStream(\n        StreamInterface $stream,\n        StructureShape $member,\n        $response\n    );\n}\n", "num_lines": 47}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Parser;\n\nuse Aws\\Api\\DateTimeResult;\nuse Aws\\Api\\Shape;\nuse Aws\\Api\\StructureShape;\nuse Aws\\Result;\nuse Aws\\CommandInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\n\n/**\n * @internal\n */\nabstract class AbstractRestParser extends AbstractParser\n{\n    use PayloadParserTrait;\n\n    /**\n     * Parses a payload from a response.\n     *\n     * @param ResponseInterface $response Response to parse.\n     * @param StructureShape    $member   Member to parse\n     * @param array             $result   Result value\n     *\n     * @return mixed\n     */\n    abstract protected function payload(\n        ResponseInterface $response,\n        StructureShape $member,\n        array &$result\n    );\n\n    public function __invoke(\n        CommandInterface $command,\n        ResponseInterface $response\n    ) {\n        $output = $this->api->getOperation($command->getName())->getOutput();\n        $result = [];\n\n        if ($payload = $output['payload']) {\n            $this->extractPayload($payload, $output, $response, $result);\n        }\n\n        foreach ($output->getMembers() as $name => $member) {\n            switch ($member['location']) {\n                case 'header':\n                    $this->extractHeader($name, $member, $response, $result);\n                    break;\n                case 'headers':\n                    $this->extractHeaders($name, $member, $response, $result);\n                    break;\n                case 'statusCode':\n                    $this->extractStatus($name, $response, $result);\n                    break;\n            }\n        }\n\n        if (!$payload\n            && $response->getBody()->getSize() > 0\n            && count($output->getMembers()) > 0\n        ) {\n            // if no payload was found, then parse the contents of the body\n            $this->payload($response, $output, $result);\n        }\n\n        return new Result($result);\n    }\n\n    private function extractPayload(\n        $payload,\n        StructureShape $output,\n        ResponseInterface $response,\n        array &$result\n    ) {\n        $member = $output->getMember($payload);\n\n        if (!empty($member['eventstream'])) {\n            $result[$payload] = new EventParsingIterator(\n                $response->getBody(),\n                $member,\n                $this\n            );\n        } else if ($member instanceof StructureShape) {\n            // Structure members parse top-level data into a specific key.\n            $result[$payload] = [];\n            $this->payload($response, $member, $result[$payload]);\n        } else {\n            // Streaming data is just the stream from the response body.\n            $result[$payload] = $response->getBody();\n        }\n    }\n\n    /**\n     * Extract a single header from the response into the result.\n     */\n    private function extractHeader(\n        $name,\n        Shape $shape,\n        ResponseInterface $response,\n        &$result\n    ) {\n        $value = $response->getHeaderLine($shape['locationName'] ?: $name);\n\n        switch ($shape->getType()) {\n            case 'float':\n            case 'double':\n                $value = (float) $value;\n                break;\n            case 'long':\n                $value = (int) $value;\n                break;\n            case 'boolean':\n                $value = filter_var($value, FILTER_VALIDATE_BOOLEAN);\n                break;\n            case 'blob':\n                $value = base64_decode($value);\n                break;\n            case 'timestamp':\n                try {\n                    $value = DateTimeResult::fromTimestamp(\n                        $value,\n                        !empty($shape['timestampFormat']) ? $shape['timestampFormat'] : null\n                    );\n                    break;\n                } catch (\\Exception $e) {\n                    // If the value cannot be parsed, then do not add it to the\n                    // output structure.\n                    return;\n                }\n            case 'string':\n                try {\n                    if ($shape['jsonvalue']) {\n                        $value = $this->parseJson(base64_decode($value), $response);\n                    }\n\n                    // If value is not set, do not add to output structure.\n                    if (!isset($value)) {\n                        return;\n                    }\n                    break;\n                } catch (\\Exception $e) {\n                    //If the value cannot be parsed, then do not add it to the\n                    //output structure.\n                    return;\n                }\n        }\n\n        $result[$name] = $value;\n    }\n\n    /**\n     * Extract a map of headers with an optional prefix from the response.\n     */\n    private function extractHeaders(\n        $name,\n        Shape $shape,\n        ResponseInterface $response,\n        &$result\n    ) {\n        // Check if the headers are prefixed by a location name\n        $result[$name] = [];\n        $prefix = $shape['locationName'];\n        $prefixLen = $prefix !== null ? strlen($prefix) : 0;\n\n        foreach ($response->getHeaders() as $k => $values) {\n            if (!$prefixLen) {\n                $result[$name][$k] = implode(', ', $values);\n            } elseif (stripos($k, $prefix) === 0) {\n                $result[$name][substr($k, $prefixLen)] = implode(', ', $values);\n            }\n        }\n    }\n\n    /**\n     * Places the status code of the response into the result array.\n     */\n    private function extractStatus(\n        $name,\n        ResponseInterface $response,\n        array &$result\n    ) {\n        $result[$name] = (int) $response->getStatusCode();\n    }\n}\n", "num_lines": 185}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Parser;\n\nuse Aws\\Api\\StructureShape;\nuse Aws\\CommandInterface;\nuse Aws\\Exception\\AwsException;\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Psr\\Http\\Message\\StreamInterface;\nuse GuzzleHttp\\Psr7;\n\n/**\n * @internal Decorates a parser and validates the x-amz-crc32 header.\n */\nclass Crc32ValidatingParser extends AbstractParser\n{\n    /**\n     * @param callable $parser Parser to wrap.\n     */\n    public function __construct(callable $parser)\n    {\n        $this->parser = $parser;\n    }\n\n    public function __invoke(\n        CommandInterface $command,\n        ResponseInterface $response\n    ) {\n        if ($expected = $response->getHeaderLine('x-amz-crc32')) {\n            $hash = hexdec(Psr7\\Utils::hash($response->getBody(), 'crc32b'));\n            if ($expected != $hash) {\n                throw new AwsException(\n                    \"crc32 mismatch. Expected {$expected}, found {$hash}.\",\n                    $command,\n                    [\n                        'code'             => 'ClientChecksumMismatch',\n                        'connection_error' => true,\n                        'response'         => $response\n                    ]\n                );\n            }\n        }\n\n        $fn = $this->parser;\n        return $fn($command, $response);\n    }\n\n    public function parseMemberFromStream(\n        StreamInterface $stream,\n        StructureShape $member,\n        $response\n    ) {\n        return $this->parser->parseMemberFromStream($stream, $member, $response);\n    }\n}\n", "num_lines": 55}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Api\\Parser;\n\nuse \\Iterator;\nuse Aws\\Api\\DateTimeResult;\nuse GuzzleHttp\\Psr7;\nuse Psr\\Http\\Message\\StreamInterface;\nuse Aws\\Api\\Parser\\Exception\\ParserException;\n\n/**\n * @internal Implements a decoder for a binary encoded event stream that will\n * decode, validate, and provide individual events from the stream.\n */\nclass DecodingEventStreamIterator implements Iterator\n{\n    const HEADERS = 'headers';\n    const PAYLOAD = 'payload';\n\n    const LENGTH_TOTAL = 'total_length';\n    const LENGTH_HEADERS = 'headers_length';\n\n    const CRC_PRELUDE = 'prelude_crc';\n\n    const BYTES_PRELUDE = 12;\n    const BYTES_TRAILING = 4;\n\n    private static $preludeFormat = [\n        self::LENGTH_TOTAL => 'decodeUint32',\n        self::LENGTH_HEADERS => 'decodeUint32',\n        self::CRC_PRELUDE => 'decodeUint32',\n    ];\n\n    private static $lengthFormatMap = [\n        1 => 'decodeUint8',\n        2 => 'decodeUint16',\n        4 => 'decodeUint32',\n        8 => 'decodeUint64',\n    ];\n\n    private static $headerTypeMap = [\n        0 => 'decodeBooleanTrue',\n        1 => 'decodeBooleanFalse',\n        2 => 'decodeInt8',\n        3 => 'decodeInt16',\n        4 => 'decodeInt32',\n        5 => 'decodeInt64',\n        6 => 'decodeBytes',\n        7 => 'decodeString',\n        8 => 'decodeTimestamp',\n        9 => 'decodeUuid',\n    ];\n\n    /** @var StreamInterface Stream of eventstream shape to parse. */\n    private $stream;\n\n    /** @var array Currently parsed event. */\n    private $currentEvent;\n\n    /** @var int Current in-order event key. */\n    private $key;\n\n    /** @var resource|\\HashContext CRC32 hash context for event validation */\n    private $hashContext;\n\n    /** @var int $currentPosition */\n    private $currentPosition;\n\n    /**\n     * DecodingEventStreamIterator constructor.\n     *\n     * @param StreamInterface $stream\n     */\n    public function __construct(StreamInterface $stream)\n    {\n        $this->stream = $stream;\n        $this->rewind();\n    }\n\n    private function parseHeaders($headerBytes)\n    {\n        $headers = [];\n        $bytesRead = 0;\n\n        while ($bytesRead < $headerBytes) {\n            list($key, $numBytes) = $this->decodeString(1);\n            $bytesRead += $numBytes;\n\n            list($type, $numBytes) = $this->decodeUint8();\n            $bytesRead += $numBytes;\n\n            $f = self::$headerTypeMap[$type];\n            list($value, $numBytes) = $this->{$f}();\n            $bytesRead += $numBytes;\n\n            if (isset($headers[$key])) {\n                throw new ParserException('Duplicate key in event headers.');\n            }\n            $headers[$key] = $value;\n        }\n\n        return [$headers, $bytesRead];\n    }\n\n    private function parsePrelude()\n    {\n        $prelude = [];\n        $bytesRead = 0;\n\n        $calculatedCrc = null;\n        foreach (self::$preludeFormat as $key => $decodeFunction) {\n            if ($key === self::CRC_PRELUDE) {\n                $hashCopy = hash_copy($this->hashContext);\n                $calculatedCrc = hash_final($this->hashContext, true);\n                $this->hashContext = $hashCopy;\n            }\n            list($value, $numBytes) = $this->{$decodeFunction}();\n            $bytesRead += $numBytes;\n\n            $prelude[$key] = $value;\n        }\n\n        if (unpack('N', $calculatedCrc)[1] !== $prelude[self::CRC_PRELUDE]) {\n            throw new ParserException('Prelude checksum mismatch.');\n        }\n\n        return [$prelude, $bytesRead];\n    }\n\n    private function parseEvent()\n    {\n        $event = [];\n\n        if ($this->stream->tell() < $this->stream->getSize()) {\n            $this->hashContext = hash_init('crc32b');\n\n            $bytesLeft = $this->stream->getSize() - $this->stream->tell();\n            list($prelude, $numBytes) = $this->parsePrelude();\n            if ($prelude[self::LENGTH_TOTAL] > $bytesLeft) {\n                throw new ParserException('Message length too long.');\n            }\n            $bytesLeft -= $numBytes;\n\n            if ($prelude[self::LENGTH_HEADERS] > $bytesLeft) {\n                throw new ParserException('Headers length too long.');\n            }\n\n            list(\n                $event[self::HEADERS],\n                $numBytes\n            ) = $this->parseHeaders($prelude[self::LENGTH_HEADERS]);\n\n            $event[self::PAYLOAD] = Psr7\\Utils::streamFor(\n                $this->readAndHashBytes(\n                    $prelude[self::LENGTH_TOTAL] - self::BYTES_PRELUDE\n                    - $numBytes - self::BYTES_TRAILING\n                )\n            );\n\n            $calculatedCrc = hash_final($this->hashContext, true);\n            $messageCrc = $this->stream->read(4);\n            if ($calculatedCrc !== $messageCrc) {\n                throw new ParserException('Message checksum mismatch.');\n            }\n        }\n\n        return $event;\n    }\n\n    // Iterator Functionality\n\n    /**\n     * @return array\n     */\n    #[\\ReturnTypeWillChange]\n    public function current()\n    {\n        return $this->currentEvent;\n    }\n\n    /**\n     * @return int\n     */\n    #[\\ReturnTypeWillChange]\n    public function key()\n    {\n        return $this->key;\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function next()\n    {\n        $this->currentPosition = $this->stream->tell();\n        if ($this->valid()) {\n            $this->key++;\n            $this->currentEvent = $this->parseEvent();\n        }\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function rewind()\n    {\n        $this->stream->rewind();\n        $this->key = 0;\n        $this->currentPosition = 0;\n        $this->currentEvent = $this->parseEvent();\n    }\n\n    /**\n     * @return bool\n     */\n    #[\\ReturnTypeWillChange]\n    public function valid()\n    {\n        return $this->currentPosition < $this->stream->getSize();\n    }\n\n    // Decoding Utilities\n\n    private function readAndHashBytes($num)\n    {\n        $bytes = $this->stream->read($num);\n        hash_update($this->hashContext, $bytes);\n        return $bytes;\n    }\n\n    private function decodeBooleanTrue()\n    {\n        return [true, 0];\n    }\n\n    private function decodeBooleanFalse()\n    {\n        return [false, 0];\n    }\n\n    private function uintToInt($val, $size)\n    {\n        $signedCap = pow(2, $size - 1);\n        if ($val > $signedCap) {\n            $val -= (2 * $signedCap);\n        }\n        return $val;\n    }\n\n    private function decodeInt8()\n    {\n        $val = (int)unpack('C', $this->readAndHashBytes(1))[1];\n        return [$this->uintToInt($val, 8), 1];\n    }\n\n    private function decodeUint8()\n    {\n        return [unpack('C', $this->readAndHashBytes(1))[1], 1];\n    }\n\n    private function decodeInt16()\n    {\n        $val = (int)unpack('n', $this->readAndHashBytes(2))[1];\n        return [$this->uintToInt($val, 16), 2];\n    }\n\n    private function decodeUint16()\n    {\n        return [unpack('n', $this->readAndHashBytes(2))[1], 2];\n    }\n\n    private function decodeInt32()\n    {\n        $val = (int)unpack('N', $this->readAndHashBytes(4))[1];\n        return [$this->uintToInt($val, 32), 4];\n    }\n\n    private function decodeUint32()\n    {\n        return [unpack('N', $this->readAndHashBytes(4))[1], 4];\n    }\n\n    private function decodeInt64()\n    {\n        $val = $this->unpackInt64($this->readAndHashBytes(8))[1];\n        return [$this->uintToInt($val, 64), 8];\n    }\n\n    private function decodeUint64()\n    {\n        return [$this->unpackInt64($this->readAndHashBytes(8))[1], 8];\n    }\n\n    private function unpackInt64($bytes)\n    {\n        if (version_compare(PHP_VERSION, '5.6.3', '<')) {\n            $d = unpack('N2', $bytes);\n            return [1 => $d[1] << 32 | $d[2]];\n        }\n        return unpack('J', $bytes);\n    }\n\n    private function decodeBytes($lengthBytes=2)\n    {\n        if (!isset(self::$lengthFormatMap[$lengthBytes])) {\n            throw new ParserException('Undefined variable length format.');\n        }\n        $f = self::$lengthFormatMap[$lengthBytes];\n        list($len, $bytes) = $this->{$f}();\n        return [$this->readAndHashBytes($len), $len + $bytes];\n    }\n\n    private function decodeString($lengthBytes=2)\n    {\n        if (!isset(self::$lengthFormatMap[$lengthBytes])) {\n            throw new ParserException('Undefined variable length format.');\n        }\n        $f = self::$lengthFormatMap[$lengthBytes];\n        list($len, $bytes) = $this->{$f}();\n        return [$this->readAndHashBytes($len), $len + $bytes];\n    }\n\n    private function decodeTimestamp()\n    {\n        list($val, $bytes) = $this->decodeInt64();\n        return [\n            DateTimeResult::createFromFormat('U.u', $val / 1000),\n            $bytes\n        ];\n    }\n\n    private function decodeUuid()\n    {\n        $val = unpack('H32', $this->readAndHashBytes(16))[1];\n        return [\n            substr($val, 0, 8) . '-'\n            . substr($val, 8, 4) . '-'\n            . substr($val, 12, 4) . '-'\n            . substr($val, 16, 4) . '-'\n            . substr($val, 20, 12),\n            16\n        ];\n    }\n}\n", "num_lines": 341}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Api\\Parser;\n\nuse \\Iterator;\nuse Aws\\Exception\\EventStreamDataException;\nuse Aws\\Api\\Parser\\Exception\\ParserException;\nuse Aws\\Api\\StructureShape;\nuse Psr\\Http\\Message\\StreamInterface;\n\n/**\n * @internal Implements a decoder for a binary encoded event stream that will\n * decode, validate, and provide individual events from the stream.\n */\nclass EventParsingIterator implements Iterator\n{\n    /** @var StreamInterface */\n    private $decodingIterator;\n\n    /** @var StructureShape */\n    private $shape;\n\n    /** @var AbstractParser */\n    private $parser;\n\n    public function __construct(\n        StreamInterface $stream,\n        StructureShape $shape,\n        AbstractParser $parser\n    ) {\n        $this->decodingIterator = new DecodingEventStreamIterator($stream);\n        $this->shape = $shape;\n        $this->parser = $parser;\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function current()\n    {\n        return $this->parseEvent($this->decodingIterator->current());\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function key()\n    {\n        return $this->decodingIterator->key();\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function next()\n    {\n        $this->decodingIterator->next();\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function rewind()\n    {\n        $this->decodingIterator->rewind();\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function valid()\n    {\n        return $this->decodingIterator->valid();\n    }\n\n    private function parseEvent(array $event)\n    {\n        if (!empty($event['headers'][':message-type'])) {\n            if ($event['headers'][':message-type'] === 'error') {\n                return $this->parseError($event);\n            }\n            if ($event['headers'][':message-type'] !== 'event') {\n                throw new ParserException('Failed to parse unknown message type.');\n            }\n        }\n\n        if (empty($event['headers'][':event-type'])) {\n            throw new ParserException('Failed to parse without event type.');\n        }\n        $eventShape = $this->shape->getMember($event['headers'][':event-type']);\n\n        $parsedEvent = [];\n        foreach ($eventShape['members'] as $shape => $details) {\n            if (!empty($details['eventpayload'])) {\n                $payloadShape = $eventShape->getMember($shape);\n                if ($payloadShape['type'] === 'blob') {\n                    $parsedEvent[$shape] = $event['payload'];\n                } else {\n                    $parsedEvent[$shape] = $this->parser->parseMemberFromStream(\n                        $event['payload'],\n                        $payloadShape,\n                        null\n                    );\n                }\n            } else {\n                $parsedEvent[$shape] = $event['headers'][$shape];\n            }\n        }\n\n        return [\n            $event['headers'][':event-type'] => $parsedEvent\n        ];\n    }\n\n    private function parseError(array $event)\n    {\n        throw new EventStreamDataException(\n            $event['headers'][':error-code'],\n            $event['headers'][':error-message']\n        );\n    }\n}", "num_lines": 112}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Parser;\n\nuse Aws\\Api\\DateTimeResult;\nuse Aws\\Api\\Shape;\n\n/**\n * @internal Implements standard JSON parsing.\n */\nclass JsonParser\n{\n    public function parse(Shape $shape, $value)\n    {\n        if ($value === null) {\n            return $value;\n        }\n\n        switch ($shape['type']) {\n            case 'structure':\n                if (isset($shape['document']) && $shape['document']) {\n                    return $value;\n                }\n                $target = [];\n                foreach ($shape->getMembers() as $name => $member) {\n                    $locationName = $member['locationName'] ?: $name;\n                    if (isset($value[$locationName])) {\n                        $target[$name] = $this->parse($member, $value[$locationName]);\n                    }\n                }\n                if (isset($shape['union'])\n                    && $shape['union']\n                    && is_array($value)\n                    && empty($target)\n                ) {\n                    foreach ($value as $key => $val) {\n                        $target['Unknown'][$key] = $val;\n                    }\n                }\n                return $target;\n\n            case 'list':\n                $member = $shape->getMember();\n                $target = [];\n                foreach ($value as $v) {\n                    $target[] = $this->parse($member, $v);\n                }\n                return $target;\n\n            case 'map':\n                $values = $shape->getValue();\n                $target = [];\n                foreach ($value as $k => $v) {\n                    $target[$k] = $this->parse($values, $v);\n                }\n                return $target;\n\n            case 'timestamp':\n                return DateTimeResult::fromTimestamp(\n                    $value,\n                    !empty($shape['timestampFormat']) ? $shape['timestampFormat'] : null\n                );\n\n            case 'blob':\n                return base64_decode($value);\n\n            default:\n                return $value;\n        }\n    }\n}\n\n", "num_lines": 72}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Parser;\n\nuse Aws\\Api\\StructureShape;\nuse Aws\\Api\\Service;\nuse Aws\\Result;\nuse Aws\\CommandInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Psr\\Http\\Message\\StreamInterface;\n\n/**\n * @internal Implements JSON-RPC parsing (e.g., DynamoDB)\n */\nclass JsonRpcParser extends AbstractParser\n{\n    use PayloadParserTrait;\n\n    /**\n     * @param Service    $api    Service description\n     * @param JsonParser $parser JSON body builder\n     */\n    public function __construct(Service $api, JsonParser $parser = null)\n    {\n        parent::__construct($api);\n        $this->parser = $parser ?: new JsonParser();\n    }\n\n    public function __invoke(\n        CommandInterface $command,\n        ResponseInterface $response\n    ) {\n        $operation = $this->api->getOperation($command->getName());\n        $result = null === $operation['output']\n            ? null\n            : $this->parseMemberFromStream(\n                $response->getBody(),\n                $operation->getOutput(),\n                $response\n            );\n\n        return new Result($result ?: []);\n    }\n\n    public function parseMemberFromStream(\n        StreamInterface $stream,\n        StructureShape $member,\n        $response\n    ) {\n        return $this->parser->parse($member, $this->parseJson($stream, $response));\n    }\n}\n", "num_lines": 52}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Parser;\n\nuse Aws\\Api\\DateTimeResult;\nuse Aws\\Api\\Shape;\nuse Psr\\Http\\Message\\ResponseInterface;\n\ntrait MetadataParserTrait\n{\n    /**\n     * Extract a single header from the response into the result.\n     */\n    protected function extractHeader(\n        $name,\n        Shape $shape,\n        ResponseInterface $response,\n        &$result\n    ) {\n        $value = $response->getHeaderLine($shape['locationName'] ?: $name);\n\n        switch ($shape->getType()) {\n            case 'float':\n            case 'double':\n                $value = (float) $value;\n                break;\n            case 'long':\n                $value = (int) $value;\n                break;\n            case 'boolean':\n                $value = filter_var($value, FILTER_VALIDATE_BOOLEAN);\n                break;\n            case 'blob':\n                $value = base64_decode($value);\n                break;\n            case 'timestamp':\n                try {\n                    $value = DateTimeResult::fromTimestamp(\n                        $value,\n                        !empty($shape['timestampFormat']) ? $shape['timestampFormat'] : null\n                    );\n                    break;\n                } catch (\\Exception $e) {\n                    // If the value cannot be parsed, then do not add it to the\n                    // output structure.\n                    return;\n                }\n            case 'string':\n                if ($shape['jsonvalue']) {\n                    $value = $this->parseJson(base64_decode($value), $response);\n                }\n                break;\n        }\n\n        $result[$name] = $value;\n    }\n\n    /**\n     * Extract a map of headers with an optional prefix from the response.\n     */\n    protected function extractHeaders(\n        $name,\n        Shape $shape,\n        ResponseInterface $response,\n        &$result\n    ) {\n        // Check if the headers are prefixed by a location name\n        $result[$name] = [];\n        $prefix = $shape['locationName'];\n        $prefixLen = strlen($prefix);\n\n        foreach ($response->getHeaders() as $k => $values) {\n            if (!$prefixLen) {\n                $result[$name][$k] = implode(', ', $values);\n            } elseif (stripos($k, $prefix) === 0) {\n                $result[$name][substr($k, $prefixLen)] = implode(', ', $values);\n            }\n        }\n    }\n\n    /**\n     * Places the status code of the response into the result array.\n     */\n    protected function extractStatus(\n        $name,\n        ResponseInterface $response,\n        array &$result\n    ) {\n        $result[$name] = (int) $response->getStatusCode();\n    }\n}\n", "num_lines": 91}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Parser;\n\nuse Aws\\Api\\Parser\\Exception\\ParserException;\nuse Psr\\Http\\Message\\ResponseInterface;\n\ntrait PayloadParserTrait\n{\n    /**\n     * @param string $json\n     *\n     * @throws ParserException\n     *\n     * @return array\n     */\n    private function parseJson($json, $response)\n    {\n        $jsonPayload = json_decode($json, true);\n\n        if (JSON_ERROR_NONE !== json_last_error()) {\n            throw new ParserException(\n                'Error parsing JSON: ' . json_last_error_msg(),\n                0,\n                null,\n                ['response' => $response]\n            );\n        }\n\n        return $jsonPayload;\n    }\n\n    /**\n     * @param string $xml\n     *\n     * @throws ParserException\n     *\n     * @return \\SimpleXMLElement\n     */\n    protected function parseXml($xml, $response)\n    {\n        $priorSetting = libxml_use_internal_errors(true);\n        try {\n            libxml_clear_errors();\n            $xmlPayload = new \\SimpleXMLElement($xml);\n            if ($error = libxml_get_last_error()) {\n                throw new \\RuntimeException($error->message);\n            }\n        } catch (\\Exception $e) {\n            throw new ParserException(\n                \"Error parsing XML: {$e->getMessage()}\",\n                0,\n                $e,\n                ['response' => $response]\n            );\n        } finally {\n            libxml_use_internal_errors($priorSetting);\n        }\n\n        return $xmlPayload;\n    }\n}\n", "num_lines": 62}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Parser;\n\nuse Aws\\Api\\Service;\nuse Aws\\Api\\StructureShape;\nuse Aws\\Result;\nuse Aws\\CommandInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Psr\\Http\\Message\\StreamInterface;\n\n/**\n * @internal Parses query (XML) responses (e.g., EC2, SQS, and many others)\n */\nclass QueryParser extends AbstractParser\n{\n    use PayloadParserTrait;\n\n    /** @var bool */\n    private $honorResultWrapper;\n\n    /**\n     * @param Service   $api                Service description\n     * @param XmlParser $xmlParser          Optional XML parser\n     * @param bool      $honorResultWrapper Set to false to disable the peeling\n     *                                      back of result wrappers from the\n     *                                      output structure.\n     */\n    public function __construct(\n        Service $api,\n        XmlParser $xmlParser = null,\n        $honorResultWrapper = true\n    ) {\n        parent::__construct($api);\n        $this->parser = $xmlParser ?: new XmlParser();\n        $this->honorResultWrapper = $honorResultWrapper;\n    }\n\n    public function __invoke(\n        CommandInterface $command,\n        ResponseInterface $response\n    ) {\n        $output = $this->api->getOperation($command->getName())->getOutput();\n        $xml = $this->parseXml($response->getBody(), $response);\n\n        if ($this->honorResultWrapper && $output['resultWrapper']) {\n            $xml = $xml->{$output['resultWrapper']};\n        }\n\n        return new Result($this->parser->parse($output, $xml));\n    }\n\n    public function parseMemberFromStream(\n        StreamInterface $stream,\n        StructureShape $member,\n        $response\n    ) {\n        $xml = $this->parseXml($stream, $response);\n        return $this->parser->parse($member, $xml);\n    }\n}\n", "num_lines": 61}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Parser;\n\nuse Aws\\Api\\Service;\nuse Aws\\Api\\StructureShape;\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Psr\\Http\\Message\\StreamInterface;\n\n/**\n * @internal Implements REST-JSON parsing (e.g., Glacier, Elastic Transcoder)\n */\nclass RestJsonParser extends AbstractRestParser\n{\n    use PayloadParserTrait;\n\n    /**\n     * @param Service    $api    Service description\n     * @param JsonParser $parser JSON body builder\n     */\n    public function __construct(Service $api, JsonParser $parser = null)\n    {\n        parent::__construct($api);\n        $this->parser = $parser ?: new JsonParser();\n    }\n\n    protected function payload(\n        ResponseInterface $response,\n        StructureShape $member,\n        array &$result\n    ) {\n        $jsonBody = $this->parseJson($response->getBody(), $response);\n\n        if ($jsonBody) {\n            $result += $this->parser->parse($member, $jsonBody);\n        }\n    }\n\n    public function parseMemberFromStream(\n        StreamInterface $stream,\n        StructureShape $member,\n        $response\n    ) {\n        $jsonBody = $this->parseJson($stream, $response);\n        if ($jsonBody) {\n            return $this->parser->parse($member, $jsonBody);\n        }\n        return [];\n    }\n}\n", "num_lines": 50}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Parser;\n\nuse Aws\\Api\\StructureShape;\nuse Aws\\Api\\Service;\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Psr\\Http\\Message\\StreamInterface;\n\n/**\n * @internal Implements REST-XML parsing (e.g., S3, CloudFront, etc...)\n */\nclass RestXmlParser extends AbstractRestParser\n{\n    use PayloadParserTrait;\n\n    /**\n     * @param Service   $api    Service description\n     * @param XmlParser $parser XML body parser\n     */\n    public function __construct(Service $api, XmlParser $parser = null)\n    {\n        parent::__construct($api);\n        $this->parser = $parser ?: new XmlParser();\n    }\n\n    protected function payload(\n        ResponseInterface $response,\n        StructureShape $member,\n        array &$result\n    ) {\n        $result += $this->parseMemberFromStream($response->getBody(), $member, $response);\n    }\n\n    public function parseMemberFromStream(\n        StreamInterface $stream,\n        StructureShape $member,\n        $response\n    ) {\n        $xml = $this->parseXml($stream, $response);\n        return $this->parser->parse($member, $xml);\n    }\n}\n", "num_lines": 43}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Parser;\n\nuse Aws\\Api\\DateTimeResult;\nuse Aws\\Api\\ListShape;\nuse Aws\\Api\\MapShape;\nuse Aws\\Api\\Parser\\Exception\\ParserException;\nuse Aws\\Api\\Shape;\nuse Aws\\Api\\StructureShape;\n\n/**\n * @internal Implements standard XML parsing for REST-XML and Query protocols.\n */\nclass XmlParser\n{\n    public function parse(StructureShape $shape, \\SimpleXMLElement $value)\n    {\n        return $this->dispatch($shape, $value);\n    }\n\n    private function dispatch($shape, \\SimpleXMLElement $value)\n    {\n        static $methods = [\n            'structure' => 'parse_structure',\n            'list'      => 'parse_list',\n            'map'       => 'parse_map',\n            'blob'      => 'parse_blob',\n            'boolean'   => 'parse_boolean',\n            'integer'   => 'parse_integer',\n            'float'     => 'parse_float',\n            'double'    => 'parse_float',\n            'timestamp' => 'parse_timestamp',\n        ];\n\n        $type = $shape['type'];\n        if (isset($methods[$type])) {\n            return $this->{$methods[$type]}($shape, $value);\n        }\n\n        return (string) $value;\n    }\n\n    private function parse_structure(\n        StructureShape $shape,\n        \\SimpleXMLElement $value\n    ) {\n        $target = [];\n\n        foreach ($shape->getMembers() as $name => $member) {\n            // Extract the name of the XML node\n            $node = $this->memberKey($member, $name);\n            if (isset($value->{$node})) {\n                $target[$name] = $this->dispatch($member, $value->{$node});\n            } else {\n                $memberShape = $shape->getMember($name);\n                if (!empty($memberShape['xmlAttribute'])) {\n                    $target[$name] = $this->parse_xml_attribute(\n                        $shape,\n                        $memberShape,\n                        $value\n                    );\n                }\n            }\n        }\n        if (isset($shape['union'])\n            && $shape['union']\n            && empty($target)\n        ) {\n            foreach ($value as $key => $val) {\n                $name = $val->children()->getName();\n                $target['Unknown'][$name] = $val->$name;\n            }\n        }\n        return $target;\n    }\n\n    private function memberKey(Shape $shape, $name)\n    {\n        if (null !== $shape['locationName']) {\n            return $shape['locationName'];\n        }\n\n        if ($shape instanceof ListShape && $shape['flattened']) {\n            return $shape->getMember()['locationName'] ?: $name;\n        }\n\n        return $name;\n    }\n\n    private function parse_list(ListShape $shape, \\SimpleXMLElement  $value)\n    {\n        $target = [];\n        $member = $shape->getMember();\n\n        if (!$shape['flattened']) {\n            $value = $value->{$member['locationName'] ?: 'member'};\n        }\n\n        foreach ($value as $v) {\n            $target[] = $this->dispatch($member, $v);\n        }\n\n        return $target;\n    }\n\n    private function parse_map(MapShape $shape, \\SimpleXMLElement $value)\n    {\n        $target = [];\n\n        if (!$shape['flattened']) {\n            $value = $value->entry;\n        }\n\n        $mapKey = $shape->getKey();\n        $mapValue = $shape->getValue();\n        $keyName = $shape->getKey()['locationName'] ?: 'key';\n        $valueName = $shape->getValue()['locationName'] ?: 'value';\n\n        foreach ($value as $node) {\n            $key = $this->dispatch($mapKey, $node->{$keyName});\n            $value = $this->dispatch($mapValue, $node->{$valueName});\n            $target[$key] = $value;\n        }\n\n        return $target;\n    }\n\n    private function parse_blob(Shape $shape, $value)\n    {\n        return base64_decode((string) $value);\n    }\n\n    private function parse_float(Shape $shape, $value)\n    {\n        return (float) (string) $value;\n    }\n\n    private function parse_integer(Shape $shape, $value)\n    {\n        return (int) (string) $value;\n    }\n\n    private function parse_boolean(Shape $shape, $value)\n    {\n        return $value == 'true';\n    }\n\n    private function parse_timestamp(Shape $shape, $value)\n    {\n        if (is_string($value)\n            || is_int($value)\n            || (is_object($value)\n                && method_exists($value, '__toString'))\n        ) {\n            return DateTimeResult::fromTimestamp(\n                (string) $value,\n                !empty($shape['timestampFormat']) ? $shape['timestampFormat'] : null\n            );\n        }\n        throw new ParserException('Invalid timestamp value passed to XmlParser::parse_timestamp');\n    }\n\n    private function parse_xml_attribute(Shape $shape, Shape $memberShape, $value)\n    {\n        $namespace = $shape['xmlNamespace']['uri']\n            ? $shape['xmlNamespace']['uri']\n            : '';\n        $prefix = $shape['xmlNamespace']['prefix']\n            ? $shape['xmlNamespace']['prefix']\n            : '';\n        if (!empty($prefix)) {\n            $prefix .= ':';\n        }\n        $key = str_replace($prefix, '', $memberShape['locationName']);\n\n        $attributes = $value->attributes($namespace);\n        return isset($attributes[$key]) ? (string) $attributes[$key] : null;\n    }\n}\n", "num_lines": 180}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Parser\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\nuse Aws\\ResponseContainerInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\n\nclass ParserException extends \\RuntimeException implements\n    MonitoringEventsInterface,\n    ResponseContainerInterface\n{\n    use HasMonitoringEventsTrait;\n\n    private $errorCode;\n    private $requestId;\n    private $response;\n\n    public function __construct($message = '', $code = 0, $previous = null, array $context = [])\n    {\n        $this->errorCode = isset($context['error_code']) ? $context['error_code'] : null;\n        $this->requestId = isset($context['request_id']) ? $context['request_id'] : null;\n        $this->response = isset($context['response']) ? $context['response'] : null;\n        parent::__construct($message, $code, $previous);\n    }\n\n    /**\n     * Get the error code, if any.\n     *\n     * @return string|null\n     */\n    public function getErrorCode()\n    {\n        return $this->errorCode;\n    }\n\n    /**\n     * Get the request ID, if any.\n     *\n     * @return string|null\n     */\n    public function getRequestId()\n    {\n        return $this->requestId;\n    }\n\n    /**\n     * Get the received HTTP response if any.\n     *\n     * @return ResponseInterface|null\n     */\n    public function getResponse()\n    {\n        return $this->response;\n    }\n}\n", "num_lines": 57}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Serializer;\n\nuse Aws\\Api\\Shape;\nuse Aws\\Api\\ListShape;\n\n/**\n * @internal\n */\nclass Ec2ParamBuilder extends QueryParamBuilder\n{\n    protected function queryName(Shape $shape, $default = null)\n    {\n        return ($shape['queryName']\n            ?: ucfirst(@$shape['locationName'] ?: \"\"))\n                ?: $default;\n    }\n\n    protected function isFlat(Shape $shape)\n    {\n        return false;\n    }\n\n    protected function format_list(\n        ListShape $shape,\n        array $value,\n        $prefix,\n        &$query\n    ) {\n        // Handle empty list serialization\n        if (!$value) {\n            $query[$prefix] = false;\n        } else {\n            $items = $shape->getMember();\n            foreach ($value as $k => $v) {\n                $this->format($items, $v, $prefix . '.' . ($k + 1), $query);\n            }\n        }\n    }\n}\n", "num_lines": 41}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Serializer;\n\nuse Aws\\Api\\Service;\nuse Aws\\Api\\Shape;\nuse Aws\\Api\\TimestampShape;\nuse Aws\\Exception\\InvalidJsonException;\n\n/**\n * Formats the JSON body of a JSON-REST or JSON-RPC operation.\n * @internal\n */\nclass JsonBody\n{\n    private $api;\n\n    public function __construct(Service $api)\n    {\n        $this->api = $api;\n    }\n\n    /**\n     * Gets the JSON Content-Type header for a service API\n     *\n     * @param Service $service\n     *\n     * @return string\n     */\n    public static function getContentType(Service $service)\n    {\n        if ($service->getMetadata('protocol') === 'rest-json') {\n            return 'application/json';\n        }\n\n        $jsonVersion = $service->getMetadata('jsonVersion');\n        if (empty($jsonVersion)) {\n            throw new \\InvalidArgumentException('invalid json');\n        } else {\n            return 'application/x-amz-json-'\n                . @number_format($service->getMetadata('jsonVersion'), 1);\n        }\n    }\n\n    /**\n     * Builds the JSON body based on an array of arguments.\n     *\n     * @param Shape $shape Operation being constructed\n     * @param array $args  Associative array of arguments\n     *\n     * @return string\n     */\n    public function build(Shape $shape, array $args)\n    {\n        $result = json_encode($this->format($shape, $args));\n        return $result == '[]' ? '{}' : $result;\n    }\n\n    private function format(Shape $shape, $value)\n    {\n        switch ($shape['type']) {\n            case 'structure':\n                $data = [];\n                if (isset($shape['document']) && $shape['document']) {\n                    return $value;\n                }\n                foreach ($value as $k => $v) {\n                    if ($v !== null && $shape->hasMember($k)) {\n                        $valueShape = $shape->getMember($k);\n                        $data[$valueShape['locationName'] ?: $k]\n                            = $this->format($valueShape, $v);\n                    }\n                }\n                if (empty($data)) {\n                    return new \\stdClass;\n                }\n                return $data;\n\n            case 'list':\n                $items = $shape->getMember();\n                foreach ($value as $k => $v) {\n                    $value[$k] = $this->format($items, $v);\n                }\n                return $value;\n\n            case 'map':\n                if (empty($value)) {\n                    return new \\stdClass;\n                }\n                $values = $shape->getValue();\n                foreach ($value as $k => $v) {\n                    $value[$k] = $this->format($values, $v);\n                }\n                return $value;\n\n            case 'blob':\n                return base64_encode($value);\n\n            case 'timestamp':\n                $timestampFormat = !empty($shape['timestampFormat'])\n                    ? $shape['timestampFormat']\n                    : 'unixTimestamp';\n                return TimestampShape::format($value, $timestampFormat);\n\n            default:\n                return $value;\n        }\n    }\n}\n", "num_lines": 109}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Serializer;\n\nuse Aws\\Api\\Service;\nuse Aws\\CommandInterface;\nuse Aws\\EndpointV2\\EndpointProviderV2;\nuse Aws\\EndpointV2\\EndpointV2SerializerTrait;\nuse GuzzleHttp\\Psr7\\Request;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Prepares a JSON-RPC request for transfer.\n * @internal\n */\nclass JsonRpcSerializer\n{\n    use EndpointV2SerializerTrait;\n\n    /** @var JsonBody */\n    private $jsonFormatter;\n\n    /** @var string */\n    private $endpoint;\n\n    /** @var Service */\n    private $api;\n\n    /** @var string */\n    private $contentType;\n\n    /**\n     * @param Service  $api           Service description\n     * @param string   $endpoint      Endpoint to connect to\n     * @param JsonBody $jsonFormatter Optional JSON formatter to use\n     */\n    public function __construct(\n        Service $api,\n        $endpoint,\n        JsonBody $jsonFormatter = null\n    ) {\n        $this->endpoint = $endpoint;\n        $this->api = $api;\n        $this->jsonFormatter = $jsonFormatter ?: new JsonBody($this->api);\n        $this->contentType = JsonBody::getContentType($api);\n    }\n\n    /**\n     * When invoked with an AWS command, returns a serialization array\n     * containing \"method\", \"uri\", \"headers\", and \"body\" key value pairs.\n     *\n     * @param CommandInterface $command Command to serialize into a request.\n     * @param $endpointProvider Provider used for dynamic endpoint resolution.\n     * @param $clientArgs Client arguments used for dynamic endpoint resolution.\n     *\n     * @return RequestInterface\n     */\n    public function __invoke(\n        CommandInterface $command,\n        $endpointProvider = null,\n        $clientArgs = null\n    )\n    {\n        $operationName = $command->getName();\n        $operation = $this->api->getOperation($operationName);\n        $commandArgs = $command->toArray();\n        $headers = [\n                'X-Amz-Target' => $this->api->getMetadata('targetPrefix') . '.' . $operationName,\n                'Content-Type' => $this->contentType\n            ];\n\n        if ($endpointProvider instanceof EndpointProviderV2) {\n            $this->setRequestOptions(\n                $endpointProvider,\n                $command,\n                $operation,\n                $commandArgs,\n                $clientArgs,\n                $headers\n            );\n        }\n\n        return new Request(\n            $operation['http']['method'],\n            $this->endpoint,\n            $headers,\n            $this->jsonFormatter->build(\n                $operation->getInput(),\n                $commandArgs\n            )\n        );\n    }\n}\n", "num_lines": 93}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Serializer;\n\nuse Aws\\Api\\StructureShape;\nuse Aws\\Api\\ListShape;\nuse Aws\\Api\\MapShape;\nuse Aws\\Api\\Shape;\nuse Aws\\Api\\TimestampShape;\n\n/**\n * @internal\n */\nclass QueryParamBuilder\n{\n    private $methods;\n\n    protected function queryName(Shape $shape, $default = null)\n    {\n        if (null !== $shape['queryName']) {\n            return $shape['queryName'];\n        }\n\n        if (null !== $shape['locationName']) {\n            return $shape['locationName'];\n        }\n\n        if ($this->isFlat($shape) && !empty($shape['member']['locationName'])) {\n            return $shape['member']['locationName'];\n        }\n\n        return $default;\n    }\n\n    protected function isFlat(Shape $shape)\n    {\n        return $shape['flattened'] === true;\n    }\n\n    public function __invoke(StructureShape $shape, array $params)\n    {\n        if (!$this->methods) {\n            $this->methods = array_fill_keys(get_class_methods($this), true);\n        }\n\n        $query = [];\n        $this->format_structure($shape, $params, '', $query);\n\n        return $query;\n    }\n\n    protected function format(Shape $shape, $value, $prefix, array &$query)\n    {\n        $type = 'format_' . $shape['type'];\n        if (isset($this->methods[$type])) {\n            $this->{$type}($shape, $value, $prefix, $query);\n        } else {\n            $query[$prefix] = (string) $value;\n        }\n    }\n\n    protected function format_structure(\n        StructureShape $shape,\n        array $value,\n        $prefix,\n        &$query\n    ) {\n        if ($prefix) {\n            $prefix .= '.';\n        }\n\n        foreach ($value as $k => $v) {\n            if ($shape->hasMember($k)) {\n                $member = $shape->getMember($k);\n                $this->format(\n                    $member,\n                    $v,\n                    $prefix . $this->queryName($member, $k),\n                    $query\n                );\n            }\n        }\n    }\n\n    protected function format_list(\n        ListShape $shape,\n        array $value,\n        $prefix,\n        &$query\n    ) {\n        // Handle empty list serialization\n        if (!$value) {\n            $query[$prefix] = '';\n            return;\n        }\n\n        $items = $shape->getMember();\n\n        if (!$this->isFlat($shape)) {\n            $locationName = $shape->getMember()['locationName'] ?: 'member';\n            $prefix .= \".$locationName\";\n        } elseif ($name = $this->queryName($items)) {\n            $parts = explode('.', $prefix);\n            $parts[count($parts) - 1] = $name;\n            $prefix = implode('.', $parts);\n        }\n\n        foreach ($value as $k => $v) {\n            $this->format($items, $v, $prefix . '.' . ($k + 1), $query);\n        }\n    }\n\n    protected function format_map(\n        MapShape $shape,\n        array $value,\n        $prefix,\n        array &$query\n    ) {\n        $vals = $shape->getValue();\n        $keys = $shape->getKey();\n\n        if (!$this->isFlat($shape)) {\n            $prefix .= '.entry';\n        }\n\n        $i = 0;\n        $keyName = '%s.%d.' . $this->queryName($keys, 'key');\n        $valueName = '%s.%s.' . $this->queryName($vals, 'value');\n\n        foreach ($value as $k => $v) {\n            $i++;\n            $this->format($keys, $k, sprintf($keyName, $prefix, $i), $query);\n            $this->format($vals, $v, sprintf($valueName, $prefix, $i), $query);\n        }\n    }\n\n    protected function format_blob(Shape $shape, $value, $prefix, array &$query)\n    {\n        $query[$prefix] = base64_encode($value);\n    }\n\n    protected function format_timestamp(\n        TimestampShape $shape,\n        $value,\n        $prefix,\n        array &$query\n    ) {\n        $timestampFormat = !empty($shape['timestampFormat'])\n            ? $shape['timestampFormat']\n            : 'iso8601';\n        $query[$prefix] = TimestampShape::format($value, $timestampFormat);\n    }\n\n    protected function format_boolean(Shape $shape, $value, $prefix, array &$query)\n    {\n        $query[$prefix] = ($value) ? 'true' : 'false';\n    }\n}\n", "num_lines": 158}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Serializer;\n\nuse Aws\\Api\\Service;\nuse Aws\\CommandInterface;\nuse Aws\\EndpointV2\\EndpointProviderV2;\nuse Aws\\EndpointV2\\EndpointV2SerializerTrait;\nuse GuzzleHttp\\Psr7\\Request;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Serializes a query protocol request.\n * @internal\n */\nclass QuerySerializer\n{\n    use EndpointV2SerializerTrait;\n\n    private $endpoint;\n    private $api;\n    private $paramBuilder;\n\n    public function __construct(\n        Service $api,\n        $endpoint,\n        callable $paramBuilder = null\n    ) {\n        $this->api = $api;\n        $this->endpoint = $endpoint;\n        $this->paramBuilder = $paramBuilder ?: new QueryParamBuilder();\n    }\n\n    /**\n     * When invoked with an AWS command, returns a serialization array\n     * containing \"method\", \"uri\", \"headers\", and \"body\" key value pairs.\n     *\n     * @param CommandInterface $command Command to serialize into a request.\n     * @param $endpointProvider Provider used for dynamic endpoint resolution.\n     * @param $clientArgs Client arguments used for dynamic endpoint resolution.\n     *\n     * @return RequestInterface\n     */\n    public function __invoke(\n        CommandInterface $command,\n        $endpointProvider = null,\n        $clientArgs = null\n    )\n    {\n        $operation = $this->api->getOperation($command->getName());\n        $body = [\n            'Action'  => $command->getName(),\n            'Version' => $this->api->getMetadata('apiVersion')\n        ];\n        $commandArgs = $command->toArray();\n\n        // Only build up the parameters when there are parameters to build\n        if ($commandArgs) {\n            $body += call_user_func(\n                $this->paramBuilder,\n                $operation->getInput(),\n                $commandArgs\n            );\n        }\n        $body = http_build_query($body, '', '&', PHP_QUERY_RFC3986);\n        $headers = [\n            'Content-Length' => strlen($body),\n            'Content-Type'   => 'application/x-www-form-urlencoded'\n        ];\n\n        if ($endpointProvider instanceof EndpointProviderV2) {\n            $this->setRequestOptions(\n                $endpointProvider,\n                $command,\n                $operation,\n                $commandArgs,\n                $clientArgs,\n                $headers\n            );\n        }\n\n        return new Request(\n            'POST',\n            $this->endpoint,\n            $headers,\n            $body\n        );\n    }\n}\n", "num_lines": 89}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Serializer;\n\nuse Aws\\Api\\Service;\nuse Aws\\Api\\StructureShape;\n\n/**\n * Serializes requests for the REST-JSON protocol.\n * @internal\n */\nclass RestJsonSerializer extends RestSerializer\n{\n    /** @var JsonBody */\n    private $jsonFormatter;\n\n    /** @var string */\n    private $contentType;\n\n    /**\n     * @param Service  $api           Service API description\n     * @param string   $endpoint      Endpoint to connect to\n     * @param JsonBody $jsonFormatter Optional JSON formatter to use\n     */\n    public function __construct(\n        Service $api,\n        $endpoint,\n        JsonBody $jsonFormatter = null\n    ) {\n        parent::__construct($api, $endpoint);\n        $this->contentType = JsonBody::getContentType($api);\n        $this->jsonFormatter = $jsonFormatter ?: new JsonBody($api);\n    }\n\n    protected function payload(StructureShape $member, array $value, array &$opts)\n    {\n        $body = isset($value) ?\n            ((string) $this->jsonFormatter->build($member, $value))\n            : \"{}\";\n        $opts['headers']['Content-Type'] = $this->contentType;\n        $opts['body'] = $body;\n    }\n}\n", "num_lines": 43}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Serializer;\n\nuse Aws\\Api\\MapShape;\nuse Aws\\Api\\Service;\nuse Aws\\Api\\Operation;\nuse Aws\\Api\\Shape;\nuse Aws\\Api\\StructureShape;\nuse Aws\\Api\\TimestampShape;\nuse Aws\\CommandInterface;\nuse Aws\\EndpointV2\\EndpointProviderV2;\nuse Aws\\EndpointV2\\EndpointV2SerializerTrait;\nuse GuzzleHttp\\Psr7;\nuse GuzzleHttp\\Psr7\\Request;\nuse GuzzleHttp\\Psr7\\Uri;\nuse GuzzleHttp\\Psr7\\UriResolver;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Serializes HTTP locations like header, uri, payload, etc...\n * @internal\n */\nabstract class RestSerializer\n{\n    use EndpointV2SerializerTrait;\n\n    /** @var Service */\n    private $api;\n\n    /** @var Uri */\n    private $endpoint;\n\n    /**\n     * @param Service $api      Service API description\n     * @param string  $endpoint Endpoint to connect to\n     */\n    public function __construct(Service $api, $endpoint)\n    {\n        $this->api = $api;\n        $this->endpoint = Psr7\\Utils::uriFor($endpoint);\n    }\n\n    /**\n     * @param CommandInterface $command Command to serialize into a request.\n     * @param $endpointProvider Provider used for dynamic endpoint resolution.\n     * @param $clientArgs Client arguments used for dynamic endpoint resolution.\n     *\n     * @return RequestInterface\n     */\n    public function __invoke(\n        CommandInterface $command,\n        $endpointProvider = null,\n        $clientArgs = null\n    )\n    {\n        $operation = $this->api->getOperation($command->getName());\n        $commandArgs = $command->toArray();\n        $opts = $this->serialize($operation, $commandArgs);\n        $headers = isset($opts['headers']) ? $opts['headers'] : [];\n\n        if ($endpointProvider instanceof EndpointProviderV2) {\n            $this->setRequestOptions(\n                $endpointProvider,\n                $command,\n                $operation,\n                $commandArgs,\n                $clientArgs,\n                $headers\n            );\n            $this->endpoint = new Uri($this->endpoint);\n        }\n        $uri = $this->buildEndpoint($operation, $commandArgs, $opts);\n\n        return new Request(\n            $operation['http']['method'],\n            $uri,\n            $headers,\n            isset($opts['body']) ? $opts['body'] : null\n        );\n    }\n\n    /**\n     * Modifies a hash of request options for a payload body.\n     *\n     * @param StructureShape   $member  Member to serialize\n     * @param array            $value   Value to serialize\n     * @param array            $opts    Request options to modify.\n     */\n    abstract protected function payload(\n        StructureShape $member,\n        array $value,\n        array &$opts\n    );\n\n    private function serialize(Operation $operation, array $args)\n    {\n        $opts = [];\n        $input = $operation->getInput();\n\n        // Apply the payload trait if present\n        if ($payload = $input['payload']) {\n            $this->applyPayload($input, $payload, $args, $opts);\n        }\n\n        foreach ($args as $name => $value) {\n            if ($input->hasMember($name)) {\n                $member = $input->getMember($name);\n                $location = $member['location'];\n                if (!$payload && !$location) {\n                    $bodyMembers[$name] = $value;\n                } elseif ($location == 'header') {\n                    $this->applyHeader($name, $member, $value, $opts);\n                } elseif ($location == 'querystring') {\n                    $this->applyQuery($name, $member, $value, $opts);\n                } elseif ($location == 'headers') {\n                    $this->applyHeaderMap($name, $member, $value, $opts);\n                }\n            }\n        }\n\n        if (isset($bodyMembers)) {\n            $this->payload($operation->getInput(), $bodyMembers, $opts);\n        } else if (!isset($opts['body']) && $this->hasPayloadParam($input, $payload)) {\n            $this->payload($operation->getInput(), [], $opts);\n        }\n\n        return $opts;\n    }\n\n    private function applyPayload(StructureShape $input, $name, array $args, array &$opts)\n    {\n        if (!isset($args[$name])) {\n            return;\n        }\n\n        $m = $input->getMember($name);\n\n        if ($m['streaming'] ||\n           ($m['type'] == 'string' || $m['type'] == 'blob')\n        ) {\n            // Streaming bodies or payloads that are strings are\n            // always just a stream of data.\n            $opts['body'] = Psr7\\Utils::streamFor($args[$name]);\n            return;\n        }\n\n        $this->payload($m, $args[$name], $opts);\n    }\n\n    private function applyHeader($name, Shape $member, $value, array &$opts)\n    {\n        if ($member->getType() === 'timestamp') {\n            $timestampFormat = !empty($member['timestampFormat'])\n                ? $member['timestampFormat']\n                : 'rfc822';\n            $value = TimestampShape::format($value, $timestampFormat);\n        } elseif ($member->getType() === 'boolean') {\n            $value = $value ? 'true' : 'false';\n        }\n\n        if ($member['jsonvalue']) {\n            $value = json_encode($value);\n            if (empty($value) && JSON_ERROR_NONE !== json_last_error()) {\n                throw new \\InvalidArgumentException('Unable to encode the provided value'\n                    . ' with \\'json_encode\\'. ' . json_last_error_msg());\n            }\n\n            $value = base64_encode($value);\n        }\n\n        $opts['headers'][$member['locationName'] ?: $name] = $value;\n    }\n\n    /**\n     * Note: This is currently only present in the Amazon S3 model.\n     */\n    private function applyHeaderMap($name, Shape $member, array $value, array &$opts)\n    {\n        $prefix = $member['locationName'];\n        foreach ($value as $k => $v) {\n            $opts['headers'][$prefix . $k] = $v;\n        }\n    }\n\n    private function applyQuery($name, Shape $member, $value, array &$opts)\n    {\n        if ($member instanceof MapShape) {\n            $opts['query'] = isset($opts['query']) && is_array($opts['query'])\n                ? $opts['query'] + $value\n                : $value;\n        } elseif ($value !== null) {\n            $type = $member->getType();\n            if ($type === 'boolean') {\n                $value = $value ? 'true' : 'false';\n            } elseif ($type === 'timestamp') {\n                $timestampFormat = !empty($member['timestampFormat'])\n                    ? $member['timestampFormat']\n                    : 'iso8601';\n                $value = TimestampShape::format($value, $timestampFormat);\n            }\n\n            $opts['query'][$member['locationName'] ?: $name] = $value;\n        }\n    }\n\n    private function buildEndpoint(Operation $operation, array $args, array $opts)\n    {\n        // Create an associative array of variable definitions used in expansions\n        $varDefinitions = $this->getVarDefinitions($operation, $args);\n\n        $relative = preg_replace_callback(\n            '/\\{([^\\}]+)\\}/',\n            function (array $matches) use ($varDefinitions) {\n                $isGreedy = substr($matches[1], -1, 1) == '+';\n                $k = $isGreedy ? substr($matches[1], 0, -1) : $matches[1];\n                if (!isset($varDefinitions[$k])) {\n                    return '';\n                }\n\n                if ($isGreedy) {\n                    return str_replace('%2F', '/', rawurlencode($varDefinitions[$k]));\n                }\n\n                return rawurlencode($varDefinitions[$k]);\n            },\n            $operation['http']['requestUri']\n        );\n\n        // Add the query string variables or appending to one if needed.\n        if (!empty($opts['query'])) {\n           $relative = $this->appendQuery($opts['query'], $relative);\n        }\n\n        $path = $this->endpoint->getPath();\n\n        //Accounts for trailing '/' in path when custom endpoint\n        //is provided to endpointProviderV2\n        if ($this->api->isModifiedModel()\n            && $this->api->getServiceName() === 's3'\n        ) {\n            if (substr($path, -1) === '/' && $relative[0] === '/') {\n                $path = rtrim($path, '/');\n            }\n            $relative = $path . $relative;\n        }\n        // If endpoint has path, remove leading '/' to preserve URI resolution.\n        if ($path && $relative[0] === '/') {\n            $relative = substr($relative, 1);\n        }\n\n        //Append path to endpoint when leading '//...' present\n        // as uri cannot be properly resolved\n        if ($this->api->isModifiedModel()\n            && strpos($relative, '//') === 0\n        ) {\n            return new Uri($this->endpoint . $relative);\n        }\n\n        // Expand path place holders using Amazon's slightly different URI\n        // template syntax.\n        return UriResolver::resolve($this->endpoint, new Uri($relative));\n    }\n\n    /**\n     * @param StructureShape $input\n     */\n    private function hasPayloadParam(StructureShape $input, $payload)\n    {\n        if ($payload) {\n            $potentiallyEmptyTypes = ['blob','string'];\n            if ($this->api->getMetadata('protocol') == 'rest-xml') {\n                $potentiallyEmptyTypes[] = 'structure';\n            }\n            $payloadMember = $input->getMember($payload);\n            if (in_array($payloadMember['type'], $potentiallyEmptyTypes)) {\n                return false;\n            }\n        }\n        foreach ($input->getMembers() as $member) {\n            if (!isset($member['location'])) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    private function appendQuery($query, $endpoint)\n    {\n        $append = Psr7\\Query::build($query);\n        return $endpoint .= strpos($endpoint, '?') !== false ? \"&{$append}\" : \"?{$append}\";\n    }\n\n    private function getVarDefinitions($command, $args)\n    {\n        $varDefinitions = [];\n\n        foreach ($command->getInput()->getMembers() as $name => $member) {\n            if ($member['location'] == 'uri') {\n                $varDefinitions[$member['locationName'] ?: $name] =\n                    isset($args[$name])\n                        ? $args[$name]\n                        : null;\n            }\n        }\n        return $varDefinitions;\n    }\n}\n", "num_lines": 308}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Serializer;\n\nuse Aws\\Api\\StructureShape;\nuse Aws\\Api\\Service;\n\n/**\n * @internal\n */\nclass RestXmlSerializer extends RestSerializer\n{\n    /** @var XmlBody */\n    private $xmlBody;\n\n    /**\n     * @param Service $api      Service API description\n     * @param string  $endpoint Endpoint to connect to\n     * @param XmlBody $xmlBody  Optional XML formatter to use\n     */\n    public function __construct(\n        Service $api,\n        $endpoint,\n        XmlBody $xmlBody = null\n    ) {\n        parent::__construct($api, $endpoint);\n        $this->xmlBody = $xmlBody ?: new XmlBody($api);\n    }\n\n    protected function payload(StructureShape $member, array $value, array &$opts)\n    {\n        $opts['headers']['Content-Type'] = 'application/xml';\n        $opts['body'] = $this->getXmlBody($member, $value);\n    }\n\n    /**\n     * @param StructureShape $member\n     * @param array $value\n     * @return string\n     */\n    private function getXmlBody(StructureShape $member, array $value)\n    {\n        $xmlBody = (string)$this->xmlBody->build($member, $value);\n        $xmlBody = str_replace(\"'\", \"&apos;\", $xmlBody);\n        $xmlBody = str_replace('\\r', \"&#13;\", $xmlBody);\n        $xmlBody = str_replace('\\n', \"&#10;\", $xmlBody);\n        return $xmlBody;\n    }\n}\n", "num_lines": 49}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api\\Serializer;\n\nuse Aws\\Api\\MapShape;\nuse Aws\\Api\\Service;\nuse Aws\\Api\\Shape;\nuse Aws\\Api\\StructureShape;\nuse Aws\\Api\\ListShape;\nuse Aws\\Api\\TimestampShape;\nuse XMLWriter;\n\n/**\n * @internal Formats the XML body of a REST-XML services.\n */\nclass XmlBody\n{\n    /** @var \\Aws\\Api\\Service */\n    private $api;\n\n    /**\n     * @param Service $api API being used to create the XML body.\n     */\n    public function __construct(Service $api)\n    {\n        $this->api = $api;\n    }\n\n    /**\n     * Builds the XML body based on an array of arguments.\n     *\n     * @param Shape $shape Operation being constructed\n     * @param array $args  Associative array of arguments\n     *\n     * @return string\n     */\n    public function build(Shape $shape, array $args)\n    {\n        $xml = new XMLWriter();\n        $xml->openMemory();\n        $xml->startDocument('1.0', 'UTF-8');\n        $this->format($shape, $shape['locationName'] ?: $shape['name'], $args, $xml);\n        $xml->endDocument();\n\n        return $xml->outputMemory();\n    }\n\n    private function startElement(Shape $shape, $name, XMLWriter $xml)\n    {\n        $xml->startElement($name);\n\n        if ($ns = $shape['xmlNamespace']) {\n            $xml->writeAttribute(\n                isset($ns['prefix']) ? \"xmlns:{$ns['prefix']}\" : 'xmlns',\n                $shape['xmlNamespace']['uri']\n            );\n        }\n    }\n\n    private function format(Shape $shape, $name, $value, XMLWriter $xml)\n    {\n        // Any method mentioned here has a custom serialization handler.\n        static $methods = [\n            'add_structure' => true,\n            'add_list'      => true,\n            'add_blob'      => true,\n            'add_timestamp' => true,\n            'add_boolean'   => true,\n            'add_map'       => true,\n            'add_string'    => true\n        ];\n\n        $type = 'add_' . $shape['type'];\n        if (isset($methods[$type])) {\n            $this->{$type}($shape, $name, $value, $xml);\n        } else {\n            $this->defaultShape($shape, $name, $value, $xml);\n        }\n    }\n\n    private function defaultShape(Shape $shape, $name, $value, XMLWriter $xml)\n    {\n        $this->startElement($shape, $name, $xml);\n        $xml->text($value);\n        $xml->endElement();\n    }\n\n    private function add_structure(\n        StructureShape $shape,\n        $name,\n        array $value,\n        \\XMLWriter $xml\n    ) {\n        $this->startElement($shape, $name, $xml);\n\n        foreach ($this->getStructureMembers($shape, $value) as $k => $definition) {\n            $this->format(\n                $definition['member'],\n                $definition['member']['locationName'] ?: $k,\n                $definition['value'],\n                $xml\n            );\n        }\n\n        $xml->endElement();\n    }\n\n    private function getStructureMembers(StructureShape $shape, array $value)\n    {\n        $members = [];\n\n        foreach ($value as $k => $v) {\n            if ($v !== null && $shape->hasMember($k)) {\n                $definition = [\n                    'member' => $shape->getMember($k),\n                    'value'  => $v,\n                ];\n\n                if ($definition['member']['xmlAttribute']) {\n                    // array_unshift_associative\n                    $members = [$k => $definition] + $members;\n                } else {\n                    $members[$k] = $definition;\n                }\n            }\n        }\n\n        return $members;\n    }\n\n    private function add_list(\n        ListShape $shape,\n        $name,\n        array $value,\n        XMLWriter $xml\n    ) {\n        $items = $shape->getMember();\n\n        if ($shape['flattened']) {\n            $elementName = $name;\n        } else {\n            $this->startElement($shape, $name, $xml);\n            $elementName = $items['locationName'] ?: 'member';\n        }\n\n        foreach ($value as $v) {\n            $this->format($items, $elementName, $v, $xml);\n        }\n\n        if (!$shape['flattened']) {\n            $xml->endElement();\n        }\n    }\n\n    private function add_map(\n        MapShape $shape,\n        $name,\n        array $value,\n        XMLWriter $xml\n    ) {\n        $xmlEntry = $shape['flattened'] ? $shape['locationName'] : 'entry';\n        $xmlKey = $shape->getKey()['locationName'] ?: 'key';\n        $xmlValue = $shape->getValue()['locationName'] ?: 'value';\n\n        $this->startElement($shape, $name, $xml);\n\n        foreach ($value as $key => $v) {\n            $this->startElement($shape, $xmlEntry, $xml);\n            $this->format($shape->getKey(), $xmlKey, $key, $xml);\n            $this->format($shape->getValue(), $xmlValue, $v, $xml);\n            $xml->endElement();\n        }\n\n        $xml->endElement();\n    }\n\n    private function add_blob(Shape $shape, $name, $value, XMLWriter $xml)\n    {\n        $this->startElement($shape, $name, $xml);\n        $xml->writeRaw(base64_encode($value));\n        $xml->endElement();\n    }\n\n    private function add_timestamp(\n        TimestampShape $shape,\n        $name,\n        $value,\n        XMLWriter $xml\n    ) {\n        $this->startElement($shape, $name, $xml);\n        $timestampFormat = !empty($shape['timestampFormat'])\n            ? $shape['timestampFormat']\n            : 'iso8601';\n        $xml->writeRaw(TimestampShape::format($value, $timestampFormat));\n        $xml->endElement();\n    }\n\n    private function add_boolean(\n        Shape $shape,\n        $name,\n        $value,\n        XMLWriter $xml\n    ) {\n        $this->startElement($shape, $name, $xml);\n        $xml->writeRaw($value ? 'true' : 'false');\n        $xml->endElement();\n    }\n\n    private function add_string(\n        Shape $shape,\n        $name,\n        $value,\n        XMLWriter $xml\n    ) {\n        if ($shape['xmlAttribute']) {\n            $xml->writeAttribute($shape['locationName'] ?: $name, $value);\n        } else {\n            $this->defaultShape($shape, $name, $value, $xml);\n        }\n    }\n}\n", "num_lines": 221}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ApiGateway;\n\nuse Aws\\AwsClient;\nuse Aws\\CommandInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * This client is used to interact with the **AWS API Gateway** service.\n *\n * @method \\Aws\\Result createApiKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApiKeyAsync(array $args = [])\n * @method \\Aws\\Result createAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result createBasePathMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBasePathMappingAsync(array $args = [])\n * @method \\Aws\\Result createDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeploymentAsync(array $args = [])\n * @method \\Aws\\Result createDocumentationPart(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDocumentationPartAsync(array $args = [])\n * @method \\Aws\\Result createDocumentationVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDocumentationVersionAsync(array $args = [])\n * @method \\Aws\\Result createDomainName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDomainNameAsync(array $args = [])\n * @method \\Aws\\Result createModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createModelAsync(array $args = [])\n * @method \\Aws\\Result createRequestValidator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRequestValidatorAsync(array $args = [])\n * @method \\Aws\\Result createResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResourceAsync(array $args = [])\n * @method \\Aws\\Result createRestApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRestApiAsync(array $args = [])\n * @method \\Aws\\Result createStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStageAsync(array $args = [])\n * @method \\Aws\\Result createUsagePlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUsagePlanAsync(array $args = [])\n * @method \\Aws\\Result createUsagePlanKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUsagePlanKeyAsync(array $args = [])\n * @method \\Aws\\Result createVpcLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpcLinkAsync(array $args = [])\n * @method \\Aws\\Result deleteApiKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApiKeyAsync(array $args = [])\n * @method \\Aws\\Result deleteAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result deleteBasePathMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBasePathMappingAsync(array $args = [])\n * @method \\Aws\\Result deleteClientCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClientCertificateAsync(array $args = [])\n * @method \\Aws\\Result deleteDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDeploymentAsync(array $args = [])\n * @method \\Aws\\Result deleteDocumentationPart(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDocumentationPartAsync(array $args = [])\n * @method \\Aws\\Result deleteDocumentationVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDocumentationVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteDomainName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainNameAsync(array $args = [])\n * @method \\Aws\\Result deleteGatewayResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGatewayResponseAsync(array $args = [])\n * @method \\Aws\\Result deleteIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIntegrationAsync(array $args = [])\n * @method \\Aws\\Result deleteIntegrationResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIntegrationResponseAsync(array $args = [])\n * @method \\Aws\\Result deleteMethod(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMethodAsync(array $args = [])\n * @method \\Aws\\Result deleteMethodResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMethodResponseAsync(array $args = [])\n * @method \\Aws\\Result deleteModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteModelAsync(array $args = [])\n * @method \\Aws\\Result deleteRequestValidator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRequestValidatorAsync(array $args = [])\n * @method \\Aws\\Result deleteResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourceAsync(array $args = [])\n * @method \\Aws\\Result deleteRestApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRestApiAsync(array $args = [])\n * @method \\Aws\\Result deleteStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStageAsync(array $args = [])\n * @method \\Aws\\Result deleteUsagePlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUsagePlanAsync(array $args = [])\n * @method \\Aws\\Result deleteUsagePlanKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUsagePlanKeyAsync(array $args = [])\n * @method \\Aws\\Result deleteVpcLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpcLinkAsync(array $args = [])\n * @method \\Aws\\Result flushStageAuthorizersCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise flushStageAuthorizersCacheAsync(array $args = [])\n * @method \\Aws\\Result flushStageCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise flushStageCacheAsync(array $args = [])\n * @method \\Aws\\Result generateClientCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateClientCertificateAsync(array $args = [])\n * @method \\Aws\\Result getAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountAsync(array $args = [])\n * @method \\Aws\\Result getApiKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApiKeyAsync(array $args = [])\n * @method \\Aws\\Result getApiKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApiKeysAsync(array $args = [])\n * @method \\Aws\\Result getAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result getAuthorizers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAuthorizersAsync(array $args = [])\n * @method \\Aws\\Result getBasePathMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBasePathMappingAsync(array $args = [])\n * @method \\Aws\\Result getBasePathMappings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBasePathMappingsAsync(array $args = [])\n * @method \\Aws\\Result getClientCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getClientCertificateAsync(array $args = [])\n * @method \\Aws\\Result getClientCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getClientCertificatesAsync(array $args = [])\n * @method \\Aws\\Result getDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeploymentAsync(array $args = [])\n * @method \\Aws\\Result getDeployments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeploymentsAsync(array $args = [])\n * @method \\Aws\\Result getDocumentationPart(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDocumentationPartAsync(array $args = [])\n * @method \\Aws\\Result getDocumentationParts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDocumentationPartsAsync(array $args = [])\n * @method \\Aws\\Result getDocumentationVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDocumentationVersionAsync(array $args = [])\n * @method \\Aws\\Result getDocumentationVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDocumentationVersionsAsync(array $args = [])\n * @method \\Aws\\Result getDomainName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainNameAsync(array $args = [])\n * @method \\Aws\\Result getDomainNames(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainNamesAsync(array $args = [])\n * @method \\Aws\\Result getExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExportAsync(array $args = [])\n * @method \\Aws\\Result getGatewayResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGatewayResponseAsync(array $args = [])\n * @method \\Aws\\Result getGatewayResponses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGatewayResponsesAsync(array $args = [])\n * @method \\Aws\\Result getIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIntegrationAsync(array $args = [])\n * @method \\Aws\\Result getIntegrationResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIntegrationResponseAsync(array $args = [])\n * @method \\Aws\\Result getMethod(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMethodAsync(array $args = [])\n * @method \\Aws\\Result getMethodResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMethodResponseAsync(array $args = [])\n * @method \\Aws\\Result getModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getModelAsync(array $args = [])\n * @method \\Aws\\Result getModelTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getModelTemplateAsync(array $args = [])\n * @method \\Aws\\Result getModels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getModelsAsync(array $args = [])\n * @method \\Aws\\Result getRequestValidator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRequestValidatorAsync(array $args = [])\n * @method \\Aws\\Result getRequestValidators(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRequestValidatorsAsync(array $args = [])\n * @method \\Aws\\Result getResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceAsync(array $args = [])\n * @method \\Aws\\Result getResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcesAsync(array $args = [])\n * @method \\Aws\\Result getRestApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRestApiAsync(array $args = [])\n * @method \\Aws\\Result getRestApis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRestApisAsync(array $args = [])\n * @method \\Aws\\Result getSdk(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSdkAsync(array $args = [])\n * @method \\Aws\\Result getSdkType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSdkTypeAsync(array $args = [])\n * @method \\Aws\\Result getSdkTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSdkTypesAsync(array $args = [])\n * @method \\Aws\\Result getStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStageAsync(array $args = [])\n * @method \\Aws\\Result getStages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStagesAsync(array $args = [])\n * @method \\Aws\\Result getTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTagsAsync(array $args = [])\n * @method \\Aws\\Result getUsage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUsageAsync(array $args = [])\n * @method \\Aws\\Result getUsagePlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUsagePlanAsync(array $args = [])\n * @method \\Aws\\Result getUsagePlanKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUsagePlanKeyAsync(array $args = [])\n * @method \\Aws\\Result getUsagePlanKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUsagePlanKeysAsync(array $args = [])\n * @method \\Aws\\Result getUsagePlans(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUsagePlansAsync(array $args = [])\n * @method \\Aws\\Result getVpcLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVpcLinkAsync(array $args = [])\n * @method \\Aws\\Result getVpcLinks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVpcLinksAsync(array $args = [])\n * @method \\Aws\\Result importApiKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importApiKeysAsync(array $args = [])\n * @method \\Aws\\Result importDocumentationParts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importDocumentationPartsAsync(array $args = [])\n * @method \\Aws\\Result importRestApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importRestApiAsync(array $args = [])\n * @method \\Aws\\Result putGatewayResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putGatewayResponseAsync(array $args = [])\n * @method \\Aws\\Result putIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putIntegrationAsync(array $args = [])\n * @method \\Aws\\Result putIntegrationResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putIntegrationResponseAsync(array $args = [])\n * @method \\Aws\\Result putMethod(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putMethodAsync(array $args = [])\n * @method \\Aws\\Result putMethodResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putMethodResponseAsync(array $args = [])\n * @method \\Aws\\Result putRestApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRestApiAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result testInvokeAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testInvokeAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result testInvokeMethod(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testInvokeMethodAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccountAsync(array $args = [])\n * @method \\Aws\\Result updateApiKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApiKeyAsync(array $args = [])\n * @method \\Aws\\Result updateAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result updateBasePathMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBasePathMappingAsync(array $args = [])\n * @method \\Aws\\Result updateClientCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateClientCertificateAsync(array $args = [])\n * @method \\Aws\\Result updateDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDeploymentAsync(array $args = [])\n * @method \\Aws\\Result updateDocumentationPart(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDocumentationPartAsync(array $args = [])\n * @method \\Aws\\Result updateDocumentationVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDocumentationVersionAsync(array $args = [])\n * @method \\Aws\\Result updateDomainName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDomainNameAsync(array $args = [])\n * @method \\Aws\\Result updateGatewayResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGatewayResponseAsync(array $args = [])\n * @method \\Aws\\Result updateIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIntegrationAsync(array $args = [])\n * @method \\Aws\\Result updateIntegrationResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIntegrationResponseAsync(array $args = [])\n * @method \\Aws\\Result updateMethod(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMethodAsync(array $args = [])\n * @method \\Aws\\Result updateMethodResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMethodResponseAsync(array $args = [])\n * @method \\Aws\\Result updateModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateModelAsync(array $args = [])\n * @method \\Aws\\Result updateRequestValidator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRequestValidatorAsync(array $args = [])\n * @method \\Aws\\Result updateResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResourceAsync(array $args = [])\n * @method \\Aws\\Result updateRestApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRestApiAsync(array $args = [])\n * @method \\Aws\\Result updateStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStageAsync(array $args = [])\n * @method \\Aws\\Result updateUsage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUsageAsync(array $args = [])\n * @method \\Aws\\Result updateUsagePlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUsagePlanAsync(array $args = [])\n * @method \\Aws\\Result updateVpcLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVpcLinkAsync(array $args = [])\n */\nclass ApiGatewayClient extends AwsClient\n{\n    public function __construct(array $args)\n    {\n        parent::__construct($args);\n        $stack = $this->getHandlerList();\n        $stack->appendBuild([__CLASS__, '_add_accept_header']);\n    }\n\n    public static function _add_accept_header(callable $handler)\n    {\n        return function (\n            CommandInterface $command,\n            RequestInterface $request\n        ) use ($handler) {\n            $request = $request->withHeader('Accept', 'application/json');\n\n            return $handler($command, $request);\n        };\n    }\n}\n", "num_lines": 273}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ApiGateway\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS API Gateway** service.\n */\nclass ApiGatewayException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ApiGatewayManagementApi;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AmazonApiGatewayManagementApi** service.\n * @method \\Aws\\Result deleteConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectionAsync(array $args = [])\n * @method \\Aws\\Result getConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConnectionAsync(array $args = [])\n * @method \\Aws\\Result postToConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise postToConnectionAsync(array $args = [])\n */\nclass ApiGatewayManagementApiClient extends AwsClient {}\n", "num_lines": 16}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ApiGatewayManagementApi\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AmazonApiGatewayManagementApi** service.\n */\nclass ApiGatewayManagementApiException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ApiGatewayV2;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AmazonApiGatewayV2** service.\n * @method \\Aws\\Result createApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApiAsync(array $args = [])\n * @method \\Aws\\Result createApiMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApiMappingAsync(array $args = [])\n * @method \\Aws\\Result createAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result createDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeploymentAsync(array $args = [])\n * @method \\Aws\\Result createDomainName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDomainNameAsync(array $args = [])\n * @method \\Aws\\Result createIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIntegrationAsync(array $args = [])\n * @method \\Aws\\Result createIntegrationResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIntegrationResponseAsync(array $args = [])\n * @method \\Aws\\Result createModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createModelAsync(array $args = [])\n * @method \\Aws\\Result createRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRouteAsync(array $args = [])\n * @method \\Aws\\Result createRouteResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRouteResponseAsync(array $args = [])\n * @method \\Aws\\Result createStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStageAsync(array $args = [])\n * @method \\Aws\\Result createVpcLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpcLinkAsync(array $args = [])\n * @method \\Aws\\Result deleteAccessLogSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccessLogSettingsAsync(array $args = [])\n * @method \\Aws\\Result deleteApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApiAsync(array $args = [])\n * @method \\Aws\\Result deleteApiMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApiMappingAsync(array $args = [])\n * @method \\Aws\\Result deleteAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result deleteCorsConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCorsConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDeploymentAsync(array $args = [])\n * @method \\Aws\\Result deleteDomainName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainNameAsync(array $args = [])\n * @method \\Aws\\Result deleteIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIntegrationAsync(array $args = [])\n * @method \\Aws\\Result deleteIntegrationResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIntegrationResponseAsync(array $args = [])\n * @method \\Aws\\Result deleteModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteModelAsync(array $args = [])\n * @method \\Aws\\Result deleteRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRouteAsync(array $args = [])\n * @method \\Aws\\Result deleteRouteRequestParameter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRouteRequestParameterAsync(array $args = [])\n * @method \\Aws\\Result deleteRouteResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRouteResponseAsync(array $args = [])\n * @method \\Aws\\Result deleteRouteSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRouteSettingsAsync(array $args = [])\n * @method \\Aws\\Result deleteStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStageAsync(array $args = [])\n * @method \\Aws\\Result deleteVpcLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpcLinkAsync(array $args = [])\n * @method \\Aws\\Result exportApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportApiAsync(array $args = [])\n * @method \\Aws\\Result resetAuthorizersCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetAuthorizersCacheAsync(array $args = [])\n * @method \\Aws\\Result getApiResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApiResourceAsync(array $args = [])\n * @method \\Aws\\Result getApiMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApiMappingAsync(array $args = [])\n * @method \\Aws\\Result getApiMappings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApiMappingsAsync(array $args = [])\n * @method \\Aws\\Result getApis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApisAsync(array $args = [])\n * @method \\Aws\\Result getAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result getAuthorizers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAuthorizersAsync(array $args = [])\n * @method \\Aws\\Result getDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeploymentAsync(array $args = [])\n * @method \\Aws\\Result getDeployments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeploymentsAsync(array $args = [])\n * @method \\Aws\\Result getDomainName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainNameAsync(array $args = [])\n * @method \\Aws\\Result getDomainNames(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainNamesAsync(array $args = [])\n * @method \\Aws\\Result getIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIntegrationAsync(array $args = [])\n * @method \\Aws\\Result getIntegrationResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIntegrationResponseAsync(array $args = [])\n * @method \\Aws\\Result getIntegrationResponses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIntegrationResponsesAsync(array $args = [])\n * @method \\Aws\\Result getIntegrations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIntegrationsAsync(array $args = [])\n * @method \\Aws\\Result getModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getModelAsync(array $args = [])\n * @method \\Aws\\Result getModelTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getModelTemplateAsync(array $args = [])\n * @method \\Aws\\Result getModels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getModelsAsync(array $args = [])\n * @method \\Aws\\Result getRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRouteAsync(array $args = [])\n * @method \\Aws\\Result getRouteResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRouteResponseAsync(array $args = [])\n * @method \\Aws\\Result getRouteResponses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRouteResponsesAsync(array $args = [])\n * @method \\Aws\\Result getRoutes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRoutesAsync(array $args = [])\n * @method \\Aws\\Result getStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStageAsync(array $args = [])\n * @method \\Aws\\Result getStages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStagesAsync(array $args = [])\n * @method \\Aws\\Result getTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTagsAsync(array $args = [])\n * @method \\Aws\\Result getVpcLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVpcLinkAsync(array $args = [])\n * @method \\Aws\\Result getVpcLinks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVpcLinksAsync(array $args = [])\n * @method \\Aws\\Result importApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importApiAsync(array $args = [])\n * @method \\Aws\\Result reimportApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise reimportApiAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApiAsync(array $args = [])\n * @method \\Aws\\Result updateApiMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApiMappingAsync(array $args = [])\n * @method \\Aws\\Result updateAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result updateDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDeploymentAsync(array $args = [])\n * @method \\Aws\\Result updateDomainName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDomainNameAsync(array $args = [])\n * @method \\Aws\\Result updateIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIntegrationAsync(array $args = [])\n * @method \\Aws\\Result updateIntegrationResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIntegrationResponseAsync(array $args = [])\n * @method \\Aws\\Result updateModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateModelAsync(array $args = [])\n * @method \\Aws\\Result updateRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRouteAsync(array $args = [])\n * @method \\Aws\\Result updateRouteResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRouteResponseAsync(array $args = [])\n * @method \\Aws\\Result updateStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStageAsync(array $args = [])\n * @method \\Aws\\Result updateVpcLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVpcLinkAsync(array $args = [])\n */\nclass ApiGatewayV2Client extends AwsClient {}\n", "num_lines": 154}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ApiGatewayV2\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AmazonApiGatewayV2** service.\n */\nclass ApiGatewayV2Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AppConfig;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon AppConfig** service.\n * @method \\Aws\\Result createApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationAsync(array $args = [])\n * @method \\Aws\\Result createConfigurationProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfigurationProfileAsync(array $args = [])\n * @method \\Aws\\Result createDeploymentStrategy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeploymentStrategyAsync(array $args = [])\n * @method \\Aws\\Result createEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result createExtension(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createExtensionAsync(array $args = [])\n * @method \\Aws\\Result createExtensionAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createExtensionAssociationAsync(array $args = [])\n * @method \\Aws\\Result createHostedConfigurationVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHostedConfigurationVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteConfigurationProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigurationProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteDeploymentStrategy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDeploymentStrategyAsync(array $args = [])\n * @method \\Aws\\Result deleteEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result deleteExtension(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteExtensionAsync(array $args = [])\n * @method \\Aws\\Result deleteExtensionAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteExtensionAssociationAsync(array $args = [])\n * @method \\Aws\\Result deleteHostedConfigurationVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHostedConfigurationVersionAsync(array $args = [])\n * @method \\Aws\\Result getApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApplicationAsync(array $args = [])\n * @method \\Aws\\Result getConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getConfigurationProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConfigurationProfileAsync(array $args = [])\n * @method \\Aws\\Result getDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeploymentAsync(array $args = [])\n * @method \\Aws\\Result getDeploymentStrategy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeploymentStrategyAsync(array $args = [])\n * @method \\Aws\\Result getEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result getExtension(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExtensionAsync(array $args = [])\n * @method \\Aws\\Result getExtensionAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExtensionAssociationAsync(array $args = [])\n * @method \\Aws\\Result getHostedConfigurationVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getHostedConfigurationVersionAsync(array $args = [])\n * @method \\Aws\\Result listApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listConfigurationProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConfigurationProfilesAsync(array $args = [])\n * @method \\Aws\\Result listDeploymentStrategies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeploymentStrategiesAsync(array $args = [])\n * @method \\Aws\\Result listDeployments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeploymentsAsync(array $args = [])\n * @method \\Aws\\Result listEnvironments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEnvironmentsAsync(array $args = [])\n * @method \\Aws\\Result listExtensionAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExtensionAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listExtensions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExtensionsAsync(array $args = [])\n * @method \\Aws\\Result listHostedConfigurationVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHostedConfigurationVersionsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDeploymentAsync(array $args = [])\n * @method \\Aws\\Result stopDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopDeploymentAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationAsync(array $args = [])\n * @method \\Aws\\Result updateConfigurationProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConfigurationProfileAsync(array $args = [])\n * @method \\Aws\\Result updateDeploymentStrategy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDeploymentStrategyAsync(array $args = [])\n * @method \\Aws\\Result updateEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result updateExtension(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateExtensionAsync(array $args = [])\n * @method \\Aws\\Result updateExtensionAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateExtensionAssociationAsync(array $args = [])\n * @method \\Aws\\Result validateConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise validateConfigurationAsync(array $args = [])\n */\nclass AppConfigClient extends AwsClient {}\n", "num_lines": 96}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AppConfig\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon AppConfig** service.\n */\nclass AppConfigException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AppConfigData;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS AppConfig Data** service.\n * @method \\Aws\\Result getLatestConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLatestConfigurationAsync(array $args = [])\n * @method \\Aws\\Result startConfigurationSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startConfigurationSessionAsync(array $args = [])\n */\nclass AppConfigDataClient extends AwsClient {}\n", "num_lines": 14}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AppConfigData\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS AppConfig Data** service.\n */\nclass AppConfigDataException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AppFabric;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AppFabric** service.\n * @method \\Aws\\Result batchGetUserAccessTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetUserAccessTasksAsync(array $args = [])\n * @method \\Aws\\Result connectAppAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise connectAppAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result createAppAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result createAppBundle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppBundleAsync(array $args = [])\n * @method \\Aws\\Result createIngestion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIngestionAsync(array $args = [])\n * @method \\Aws\\Result createIngestionDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIngestionDestinationAsync(array $args = [])\n * @method \\Aws\\Result deleteAppAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result deleteAppBundle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppBundleAsync(array $args = [])\n * @method \\Aws\\Result deleteIngestion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIngestionAsync(array $args = [])\n * @method \\Aws\\Result deleteIngestionDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIngestionDestinationAsync(array $args = [])\n * @method \\Aws\\Result getAppAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result getAppBundle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppBundleAsync(array $args = [])\n * @method \\Aws\\Result getIngestion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIngestionAsync(array $args = [])\n * @method \\Aws\\Result getIngestionDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIngestionDestinationAsync(array $args = [])\n * @method \\Aws\\Result listAppAuthorizations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppAuthorizationsAsync(array $args = [])\n * @method \\Aws\\Result listAppBundles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppBundlesAsync(array $args = [])\n * @method \\Aws\\Result listIngestionDestinations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIngestionDestinationsAsync(array $args = [])\n * @method \\Aws\\Result listIngestions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIngestionsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startIngestion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startIngestionAsync(array $args = [])\n * @method \\Aws\\Result startUserAccessTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startUserAccessTasksAsync(array $args = [])\n * @method \\Aws\\Result stopIngestion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopIngestionAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAppAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result updateIngestionDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIngestionDestinationAsync(array $args = [])\n */\nclass AppFabricClient extends AwsClient {}\n", "num_lines": 62}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AppFabric\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AppFabric** service.\n */\nclass AppFabricException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Appflow;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Appflow** service.\n * @method \\Aws\\Result cancelFlowExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelFlowExecutionsAsync(array $args = [])\n * @method \\Aws\\Result createConnectorProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConnectorProfileAsync(array $args = [])\n * @method \\Aws\\Result createFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFlowAsync(array $args = [])\n * @method \\Aws\\Result deleteConnectorProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectorProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFlowAsync(array $args = [])\n * @method \\Aws\\Result describeConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConnectorAsync(array $args = [])\n * @method \\Aws\\Result describeConnectorEntity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConnectorEntityAsync(array $args = [])\n * @method \\Aws\\Result describeConnectorProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConnectorProfilesAsync(array $args = [])\n * @method \\Aws\\Result describeConnectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConnectorsAsync(array $args = [])\n * @method \\Aws\\Result describeFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFlowAsync(array $args = [])\n * @method \\Aws\\Result describeFlowExecutionRecords(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFlowExecutionRecordsAsync(array $args = [])\n * @method \\Aws\\Result listConnectorEntities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConnectorEntitiesAsync(array $args = [])\n * @method \\Aws\\Result listConnectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConnectorsAsync(array $args = [])\n * @method \\Aws\\Result listFlows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFlowsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result registerConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerConnectorAsync(array $args = [])\n * @method \\Aws\\Result resetConnectorMetadataCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetConnectorMetadataCacheAsync(array $args = [])\n * @method \\Aws\\Result startFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startFlowAsync(array $args = [])\n * @method \\Aws\\Result stopFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopFlowAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result unregisterConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unregisterConnectorAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateConnectorProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConnectorProfileAsync(array $args = [])\n * @method \\Aws\\Result updateConnectorRegistration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConnectorRegistrationAsync(array $args = [])\n * @method \\Aws\\Result updateFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFlowAsync(array $args = [])\n */\nclass AppflowClient extends AwsClient {}\n", "num_lines": 60}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Appflow\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Appflow** service.\n */\nclass AppflowException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AppIntegrationsService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon AppIntegrations Service** service.\n * @method \\Aws\\Result createDataIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataIntegrationAsync(array $args = [])\n * @method \\Aws\\Result createEventIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEventIntegrationAsync(array $args = [])\n * @method \\Aws\\Result deleteDataIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataIntegrationAsync(array $args = [])\n * @method \\Aws\\Result deleteEventIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventIntegrationAsync(array $args = [])\n * @method \\Aws\\Result getDataIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataIntegrationAsync(array $args = [])\n * @method \\Aws\\Result getEventIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEventIntegrationAsync(array $args = [])\n * @method \\Aws\\Result listDataIntegrationAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataIntegrationAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listDataIntegrations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataIntegrationsAsync(array $args = [])\n * @method \\Aws\\Result listEventIntegrationAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventIntegrationAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listEventIntegrations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventIntegrationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDataIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDataIntegrationAsync(array $args = [])\n * @method \\Aws\\Result updateEventIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEventIntegrationAsync(array $args = [])\n */\nclass AppIntegrationsServiceClient extends AwsClient {}\n", "num_lines": 40}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AppIntegrationsService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon AppIntegrations Service** service.\n */\nclass AppIntegrationsServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ApplicationAutoScaling;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Application Auto Scaling** service.\n * @method \\Aws\\Result deleteScalingPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteScalingPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteScheduledAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteScheduledActionAsync(array $args = [])\n * @method \\Aws\\Result deregisterScalableTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterScalableTargetAsync(array $args = [])\n * @method \\Aws\\Result describeScalableTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScalableTargetsAsync(array $args = [])\n * @method \\Aws\\Result describeScalingActivities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScalingActivitiesAsync(array $args = [])\n * @method \\Aws\\Result describeScalingPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScalingPoliciesAsync(array $args = [])\n * @method \\Aws\\Result describeScheduledActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScheduledActionsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putScalingPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putScalingPolicyAsync(array $args = [])\n * @method \\Aws\\Result putScheduledAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putScheduledActionAsync(array $args = [])\n * @method \\Aws\\Result registerScalableTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerScalableTargetAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass ApplicationAutoScalingClient extends AwsClient {}\n", "num_lines": 36}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ApplicationAutoScaling\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Application Auto Scaling** service.\n */\nclass ApplicationAutoScalingException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ApplicationCostProfiler;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Application Cost Profiler** service.\n * @method \\Aws\\Result deleteReportDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReportDefinitionAsync(array $args = [])\n * @method \\Aws\\Result getReportDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReportDefinitionAsync(array $args = [])\n * @method \\Aws\\Result importApplicationUsage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importApplicationUsageAsync(array $args = [])\n * @method \\Aws\\Result listReportDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReportDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result putReportDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putReportDefinitionAsync(array $args = [])\n * @method \\Aws\\Result updateReportDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateReportDefinitionAsync(array $args = [])\n */\nclass ApplicationCostProfilerClient extends AwsClient {}\n", "num_lines": 22}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ApplicationCostProfiler\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Application Cost Profiler** service.\n */\nclass ApplicationCostProfilerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ApplicationDiscoveryService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Application Discovery Service** service.\n * @method \\Aws\\Result associateConfigurationItemsToApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateConfigurationItemsToApplicationAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteImportData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteImportDataAsync(array $args = [])\n * @method \\Aws\\Result createApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationAsync(array $args = [])\n * @method \\Aws\\Result createTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTagsAsync(array $args = [])\n * @method \\Aws\\Result deleteApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationsAsync(array $args = [])\n * @method \\Aws\\Result deleteTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTagsAsync(array $args = [])\n * @method \\Aws\\Result describeAgents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAgentsAsync(array $args = [])\n * @method \\Aws\\Result describeConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result describeContinuousExports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeContinuousExportsAsync(array $args = [])\n * @method \\Aws\\Result describeExportConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeExportConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result describeExportTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeExportTasksAsync(array $args = [])\n * @method \\Aws\\Result describeImportTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImportTasksAsync(array $args = [])\n * @method \\Aws\\Result describeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTagsAsync(array $args = [])\n * @method \\Aws\\Result disassociateConfigurationItemsFromApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateConfigurationItemsFromApplicationAsync(array $args = [])\n * @method \\Aws\\Result exportConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result getDiscoverySummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDiscoverySummaryAsync(array $args = [])\n * @method \\Aws\\Result listConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listServerNeighbors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServerNeighborsAsync(array $args = [])\n * @method \\Aws\\Result startContinuousExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startContinuousExportAsync(array $args = [])\n * @method \\Aws\\Result startDataCollectionByAgentIds(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDataCollectionByAgentIdsAsync(array $args = [])\n * @method \\Aws\\Result startExportTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startExportTaskAsync(array $args = [])\n * @method \\Aws\\Result startImportTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startImportTaskAsync(array $args = [])\n * @method \\Aws\\Result stopContinuousExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopContinuousExportAsync(array $args = [])\n * @method \\Aws\\Result stopDataCollectionByAgentIds(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopDataCollectionByAgentIdsAsync(array $args = [])\n * @method \\Aws\\Result updateApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationAsync(array $args = [])\n */\nclass ApplicationDiscoveryServiceClient extends AwsClient {}\n", "num_lines": 60}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ApplicationDiscoveryService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Application Discovery Service** service.\n */\nclass ApplicationDiscoveryServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ApplicationInsights;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon CloudWatch Application Insights** service.\n * @method \\Aws\\Result createApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationAsync(array $args = [])\n * @method \\Aws\\Result createComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createComponentAsync(array $args = [])\n * @method \\Aws\\Result createLogPattern(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLogPatternAsync(array $args = [])\n * @method \\Aws\\Result deleteApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteComponentAsync(array $args = [])\n * @method \\Aws\\Result deleteLogPattern(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLogPatternAsync(array $args = [])\n * @method \\Aws\\Result describeApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeApplicationAsync(array $args = [])\n * @method \\Aws\\Result describeComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeComponentAsync(array $args = [])\n * @method \\Aws\\Result describeComponentConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeComponentConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeComponentConfigurationRecommendation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeComponentConfigurationRecommendationAsync(array $args = [])\n * @method \\Aws\\Result describeLogPattern(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLogPatternAsync(array $args = [])\n * @method \\Aws\\Result describeObservation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeObservationAsync(array $args = [])\n * @method \\Aws\\Result describeProblem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProblemAsync(array $args = [])\n * @method \\Aws\\Result describeProblemObservations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProblemObservationsAsync(array $args = [])\n * @method \\Aws\\Result listApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listComponents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listComponentsAsync(array $args = [])\n * @method \\Aws\\Result listConfigurationHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConfigurationHistoryAsync(array $args = [])\n * @method \\Aws\\Result listLogPatternSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLogPatternSetsAsync(array $args = [])\n * @method \\Aws\\Result listLogPatterns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLogPatternsAsync(array $args = [])\n * @method \\Aws\\Result listProblems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProblemsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationAsync(array $args = [])\n * @method \\Aws\\Result updateComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateComponentAsync(array $args = [])\n * @method \\Aws\\Result updateComponentConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateComponentConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateLogPattern(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLogPatternAsync(array $args = [])\n */\nclass ApplicationInsightsClient extends AwsClient {}\n", "num_lines": 64}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ApplicationInsights\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon CloudWatch Application Insights** service.\n */\nclass ApplicationInsightsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AppMesh;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS App Mesh** service.\n * @method \\Aws\\Result createMesh(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMeshAsync(array $args = [])\n * @method \\Aws\\Result createRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRouteAsync(array $args = [])\n * @method \\Aws\\Result createVirtualNode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVirtualNodeAsync(array $args = [])\n * @method \\Aws\\Result createVirtualRouter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVirtualRouterAsync(array $args = [])\n * @method \\Aws\\Result deleteMesh(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMeshAsync(array $args = [])\n * @method \\Aws\\Result deleteRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRouteAsync(array $args = [])\n * @method \\Aws\\Result deleteVirtualNode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVirtualNodeAsync(array $args = [])\n * @method \\Aws\\Result deleteVirtualRouter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVirtualRouterAsync(array $args = [])\n * @method \\Aws\\Result describeMesh(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMeshAsync(array $args = [])\n * @method \\Aws\\Result describeRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRouteAsync(array $args = [])\n * @method \\Aws\\Result describeVirtualNode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVirtualNodeAsync(array $args = [])\n * @method \\Aws\\Result describeVirtualRouter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVirtualRouterAsync(array $args = [])\n * @method \\Aws\\Result listMeshes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMeshesAsync(array $args = [])\n * @method \\Aws\\Result listRoutes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRoutesAsync(array $args = [])\n * @method \\Aws\\Result listVirtualNodes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVirtualNodesAsync(array $args = [])\n * @method \\Aws\\Result listVirtualRouters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVirtualRoutersAsync(array $args = [])\n * @method \\Aws\\Result updateRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRouteAsync(array $args = [])\n * @method \\Aws\\Result updateVirtualNode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVirtualNodeAsync(array $args = [])\n * @method \\Aws\\Result updateVirtualRouter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVirtualRouterAsync(array $args = [])\n * @method \\Aws\\Result createGatewayRoute(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise createGatewayRouteAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result createVirtualGateway(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise createVirtualGatewayAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result createVirtualService(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise createVirtualServiceAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result deleteGatewayRoute(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise deleteGatewayRouteAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result deleteVirtualGateway(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise deleteVirtualGatewayAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result deleteVirtualService(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise deleteVirtualServiceAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result describeGatewayRoute(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise describeGatewayRouteAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result describeVirtualGateway(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise describeVirtualGatewayAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result describeVirtualService(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise describeVirtualServiceAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result listGatewayRoutes(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise listGatewayRoutesAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result listTagsForResource(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result listVirtualGateways(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise listVirtualGatewaysAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result listVirtualServices(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise listVirtualServicesAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result tagResource(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result untagResource(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result updateGatewayRoute(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise updateGatewayRouteAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result updateMesh(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise updateMeshAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result updateVirtualGateway(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise updateVirtualGatewayAsync(array $args = []) (supported in versions 2019-01-25)\n * @method \\Aws\\Result updateVirtualService(array $args = []) (supported in versions 2019-01-25)\n * @method \\GuzzleHttp\\Promise\\Promise updateVirtualServiceAsync(array $args = []) (supported in versions 2019-01-25)\n */\nclass AppMeshClient extends AwsClient {}\n", "num_lines": 86}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AppMesh\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS App Mesh** service.\n */\nclass AppMeshException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AppRegistry;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Service Catalog App Registry** service.\n * @method \\Aws\\Result associateAttributeGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateAttributeGroupAsync(array $args = [])\n * @method \\Aws\\Result associateResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateResourceAsync(array $args = [])\n * @method \\Aws\\Result createApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationAsync(array $args = [])\n * @method \\Aws\\Result createAttributeGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAttributeGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteAttributeGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAttributeGroupAsync(array $args = [])\n * @method \\Aws\\Result disassociateAttributeGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateAttributeGroupAsync(array $args = [])\n * @method \\Aws\\Result disassociateResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateResourceAsync(array $args = [])\n * @method \\Aws\\Result getApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApplicationAsync(array $args = [])\n * @method \\Aws\\Result getAssociatedResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAssociatedResourceAsync(array $args = [])\n * @method \\Aws\\Result getAttributeGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAttributeGroupAsync(array $args = [])\n * @method \\Aws\\Result getConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConfigurationAsync(array $args = [])\n * @method \\Aws\\Result listApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listAssociatedAttributeGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssociatedAttributeGroupsAsync(array $args = [])\n * @method \\Aws\\Result listAssociatedResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssociatedResourcesAsync(array $args = [])\n * @method \\Aws\\Result listAttributeGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAttributeGroupsAsync(array $args = [])\n * @method \\Aws\\Result listAttributeGroupsForApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAttributeGroupsForApplicationAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConfigurationAsync(array $args = [])\n * @method \\Aws\\Result syncResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise syncResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationAsync(array $args = [])\n * @method \\Aws\\Result updateAttributeGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAttributeGroupAsync(array $args = [])\n */\nclass AppRegistryClient extends AwsClient {}\n", "num_lines": 58}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AppRegistry\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Service Catalog App Registry** service.\n */\nclass AppRegistryException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AppRunner;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS App Runner** service.\n * @method \\Aws\\Result associateCustomDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateCustomDomainAsync(array $args = [])\n * @method \\Aws\\Result createAutoScalingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAutoScalingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConnectionAsync(array $args = [])\n * @method \\Aws\\Result createObservabilityConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createObservabilityConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceAsync(array $args = [])\n * @method \\Aws\\Result createVpcConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpcConnectorAsync(array $args = [])\n * @method \\Aws\\Result createVpcIngressConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpcIngressConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteAutoScalingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAutoScalingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteObservabilityConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteObservabilityConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceAsync(array $args = [])\n * @method \\Aws\\Result deleteVpcConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpcConnectorAsync(array $args = [])\n * @method \\Aws\\Result deleteVpcIngressConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpcIngressConnectionAsync(array $args = [])\n * @method \\Aws\\Result describeAutoScalingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAutoScalingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeCustomDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCustomDomainsAsync(array $args = [])\n * @method \\Aws\\Result describeObservabilityConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeObservabilityConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeServiceAsync(array $args = [])\n * @method \\Aws\\Result describeVpcConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcConnectorAsync(array $args = [])\n * @method \\Aws\\Result describeVpcIngressConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcIngressConnectionAsync(array $args = [])\n * @method \\Aws\\Result disassociateCustomDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateCustomDomainAsync(array $args = [])\n * @method \\Aws\\Result listAutoScalingConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAutoScalingConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConnectionsAsync(array $args = [])\n * @method \\Aws\\Result listObservabilityConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listObservabilityConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listOperations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOperationsAsync(array $args = [])\n * @method \\Aws\\Result listServices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServicesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listVpcConnectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVpcConnectorsAsync(array $args = [])\n * @method \\Aws\\Result listVpcIngressConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVpcIngressConnectionsAsync(array $args = [])\n * @method \\Aws\\Result pauseService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise pauseServiceAsync(array $args = [])\n * @method \\Aws\\Result resumeService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resumeServiceAsync(array $args = [])\n * @method \\Aws\\Result startDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDeploymentAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceAsync(array $args = [])\n * @method \\Aws\\Result updateVpcIngressConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVpcIngressConnectionAsync(array $args = [])\n */\nclass AppRunnerClient extends AwsClient {}\n", "num_lines": 80}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AppRunner\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS App Runner** service.\n */\nclass AppRunnerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Appstream;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon AppStream** service.\n * @method \\Aws\\Result associateAppBlockBuilderAppBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateAppBlockBuilderAppBlockAsync(array $args = [])\n * @method \\Aws\\Result associateApplicationFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateApplicationFleetAsync(array $args = [])\n * @method \\Aws\\Result associateApplicationToEntitlement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateApplicationToEntitlementAsync(array $args = [])\n * @method \\Aws\\Result associateFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateFleetAsync(array $args = [])\n * @method \\Aws\\Result batchAssociateUserStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchAssociateUserStackAsync(array $args = [])\n * @method \\Aws\\Result batchDisassociateUserStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDisassociateUserStackAsync(array $args = [])\n * @method \\Aws\\Result copyImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyImageAsync(array $args = [])\n * @method \\Aws\\Result createAppBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppBlockAsync(array $args = [])\n * @method \\Aws\\Result createAppBlockBuilder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppBlockBuilderAsync(array $args = [])\n * @method \\Aws\\Result createAppBlockBuilderStreamingURL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppBlockBuilderStreamingURLAsync(array $args = [])\n * @method \\Aws\\Result createApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationAsync(array $args = [])\n * @method \\Aws\\Result createDirectoryConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDirectoryConfigAsync(array $args = [])\n * @method \\Aws\\Result createEntitlement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEntitlementAsync(array $args = [])\n * @method \\Aws\\Result createFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFleetAsync(array $args = [])\n * @method \\Aws\\Result createImageBuilder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createImageBuilderAsync(array $args = [])\n * @method \\Aws\\Result createImageBuilderStreamingURL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createImageBuilderStreamingURLAsync(array $args = [])\n * @method \\Aws\\Result createStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStackAsync(array $args = [])\n * @method \\Aws\\Result createStreamingURL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStreamingURLAsync(array $args = [])\n * @method \\Aws\\Result createUpdatedImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUpdatedImageAsync(array $args = [])\n * @method \\Aws\\Result createUsageReportSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUsageReportSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result createUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserAsync(array $args = [])\n * @method \\Aws\\Result deleteAppBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppBlockAsync(array $args = [])\n * @method \\Aws\\Result deleteAppBlockBuilder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppBlockBuilderAsync(array $args = [])\n * @method \\Aws\\Result deleteApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteDirectoryConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDirectoryConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteEntitlement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEntitlementAsync(array $args = [])\n * @method \\Aws\\Result deleteFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFleetAsync(array $args = [])\n * @method \\Aws\\Result deleteImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteImageAsync(array $args = [])\n * @method \\Aws\\Result deleteImageBuilder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteImageBuilderAsync(array $args = [])\n * @method \\Aws\\Result deleteImagePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteImagePermissionsAsync(array $args = [])\n * @method \\Aws\\Result deleteStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStackAsync(array $args = [])\n * @method \\Aws\\Result deleteUsageReportSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUsageReportSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result deleteUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserAsync(array $args = [])\n * @method \\Aws\\Result describeAppBlockBuilderAppBlockAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppBlockBuilderAppBlockAssociationsAsync(array $args = [])\n * @method \\Aws\\Result describeAppBlockBuilders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppBlockBuildersAsync(array $args = [])\n * @method \\Aws\\Result describeAppBlocks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppBlocksAsync(array $args = [])\n * @method \\Aws\\Result describeApplicationFleetAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeApplicationFleetAssociationsAsync(array $args = [])\n * @method \\Aws\\Result describeApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeApplicationsAsync(array $args = [])\n * @method \\Aws\\Result describeDirectoryConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDirectoryConfigsAsync(array $args = [])\n * @method \\Aws\\Result describeEntitlements(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEntitlementsAsync(array $args = [])\n * @method \\Aws\\Result describeFleets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetsAsync(array $args = [])\n * @method \\Aws\\Result describeImageBuilders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImageBuildersAsync(array $args = [])\n * @method \\Aws\\Result describeImagePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImagePermissionsAsync(array $args = [])\n * @method \\Aws\\Result describeImages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImagesAsync(array $args = [])\n * @method \\Aws\\Result describeSessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSessionsAsync(array $args = [])\n * @method \\Aws\\Result describeStacks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStacksAsync(array $args = [])\n * @method \\Aws\\Result describeUsageReportSubscriptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUsageReportSubscriptionsAsync(array $args = [])\n * @method \\Aws\\Result describeUserStackAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserStackAssociationsAsync(array $args = [])\n * @method \\Aws\\Result describeUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUsersAsync(array $args = [])\n * @method \\Aws\\Result disableUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableUserAsync(array $args = [])\n * @method \\Aws\\Result disassociateAppBlockBuilderAppBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateAppBlockBuilderAppBlockAsync(array $args = [])\n * @method \\Aws\\Result disassociateApplicationFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateApplicationFleetAsync(array $args = [])\n * @method \\Aws\\Result disassociateApplicationFromEntitlement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateApplicationFromEntitlementAsync(array $args = [])\n * @method \\Aws\\Result disassociateFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateFleetAsync(array $args = [])\n * @method \\Aws\\Result enableUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableUserAsync(array $args = [])\n * @method \\Aws\\Result expireSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise expireSessionAsync(array $args = [])\n * @method \\Aws\\Result listAssociatedFleets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssociatedFleetsAsync(array $args = [])\n * @method \\Aws\\Result listAssociatedStacks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssociatedStacksAsync(array $args = [])\n * @method \\Aws\\Result listEntitledApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEntitledApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startAppBlockBuilder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startAppBlockBuilderAsync(array $args = [])\n * @method \\Aws\\Result startFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startFleetAsync(array $args = [])\n * @method \\Aws\\Result startImageBuilder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startImageBuilderAsync(array $args = [])\n * @method \\Aws\\Result stopAppBlockBuilder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopAppBlockBuilderAsync(array $args = [])\n * @method \\Aws\\Result stopFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopFleetAsync(array $args = [])\n * @method \\Aws\\Result stopImageBuilder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopImageBuilderAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAppBlockBuilder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppBlockBuilderAsync(array $args = [])\n * @method \\Aws\\Result updateApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationAsync(array $args = [])\n * @method \\Aws\\Result updateDirectoryConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDirectoryConfigAsync(array $args = [])\n * @method \\Aws\\Result updateEntitlement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEntitlementAsync(array $args = [])\n * @method \\Aws\\Result updateFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFleetAsync(array $args = [])\n * @method \\Aws\\Result updateImagePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateImagePermissionsAsync(array $args = [])\n * @method \\Aws\\Result updateStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStackAsync(array $args = [])\n */\nclass AppstreamClient extends AwsClient {}\n", "num_lines": 160}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Appstream\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon AppStream** service.\n */\nclass AppstreamException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AppSync;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS AppSync** service.\n * @method \\Aws\\Result associateApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateApiAsync(array $args = [])\n * @method \\Aws\\Result associateMergedGraphqlApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateMergedGraphqlApiAsync(array $args = [])\n * @method \\Aws\\Result associateSourceGraphqlApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateSourceGraphqlApiAsync(array $args = [])\n * @method \\Aws\\Result createApiCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApiCacheAsync(array $args = [])\n * @method \\Aws\\Result createApiKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApiKeyAsync(array $args = [])\n * @method \\Aws\\Result createDataSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataSourceAsync(array $args = [])\n * @method \\Aws\\Result createDomainName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDomainNameAsync(array $args = [])\n * @method \\Aws\\Result createFunction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFunctionAsync(array $args = [])\n * @method \\Aws\\Result createGraphqlApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGraphqlApiAsync(array $args = [])\n * @method \\Aws\\Result createResolver(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResolverAsync(array $args = [])\n * @method \\Aws\\Result createType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTypeAsync(array $args = [])\n * @method \\Aws\\Result deleteApiCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApiCacheAsync(array $args = [])\n * @method \\Aws\\Result deleteApiKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApiKeyAsync(array $args = [])\n * @method \\Aws\\Result deleteDataSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataSourceAsync(array $args = [])\n * @method \\Aws\\Result deleteDomainName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainNameAsync(array $args = [])\n * @method \\Aws\\Result deleteFunction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFunctionAsync(array $args = [])\n * @method \\Aws\\Result deleteGraphqlApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGraphqlApiAsync(array $args = [])\n * @method \\Aws\\Result deleteResolver(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResolverAsync(array $args = [])\n * @method \\Aws\\Result deleteType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTypeAsync(array $args = [])\n * @method \\Aws\\Result disassociateApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateApiAsync(array $args = [])\n * @method \\Aws\\Result disassociateMergedGraphqlApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateMergedGraphqlApiAsync(array $args = [])\n * @method \\Aws\\Result disassociateSourceGraphqlApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateSourceGraphqlApiAsync(array $args = [])\n * @method \\Aws\\Result evaluateCode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise evaluateCodeAsync(array $args = [])\n * @method \\Aws\\Result evaluateMappingTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise evaluateMappingTemplateAsync(array $args = [])\n * @method \\Aws\\Result flushApiCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise flushApiCacheAsync(array $args = [])\n * @method \\Aws\\Result getApiAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApiAssociationAsync(array $args = [])\n * @method \\Aws\\Result getApiCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApiCacheAsync(array $args = [])\n * @method \\Aws\\Result getDataSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataSourceAsync(array $args = [])\n * @method \\Aws\\Result getDomainName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainNameAsync(array $args = [])\n * @method \\Aws\\Result getFunction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFunctionAsync(array $args = [])\n * @method \\Aws\\Result getGraphqlApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGraphqlApiAsync(array $args = [])\n * @method \\Aws\\Result getIntrospectionSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIntrospectionSchemaAsync(array $args = [])\n * @method \\Aws\\Result getResolver(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResolverAsync(array $args = [])\n * @method \\Aws\\Result getSchemaCreationStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSchemaCreationStatusAsync(array $args = [])\n * @method \\Aws\\Result getSourceApiAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSourceApiAssociationAsync(array $args = [])\n * @method \\Aws\\Result getType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTypeAsync(array $args = [])\n * @method \\Aws\\Result listApiKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApiKeysAsync(array $args = [])\n * @method \\Aws\\Result listDataSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataSourcesAsync(array $args = [])\n * @method \\Aws\\Result listDomainNames(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainNamesAsync(array $args = [])\n * @method \\Aws\\Result listFunctions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFunctionsAsync(array $args = [])\n * @method \\Aws\\Result listGraphqlApis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGraphqlApisAsync(array $args = [])\n * @method \\Aws\\Result listResolvers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResolversAsync(array $args = [])\n * @method \\Aws\\Result listResolversByFunction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResolversByFunctionAsync(array $args = [])\n * @method \\Aws\\Result listSourceApiAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSourceApiAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTypesAsync(array $args = [])\n * @method \\Aws\\Result listTypesByAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTypesByAssociationAsync(array $args = [])\n * @method \\Aws\\Result startSchemaCreation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSchemaCreationAsync(array $args = [])\n * @method \\Aws\\Result startSchemaMerge(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSchemaMergeAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApiCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApiCacheAsync(array $args = [])\n * @method \\Aws\\Result updateApiKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApiKeyAsync(array $args = [])\n * @method \\Aws\\Result updateDataSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDataSourceAsync(array $args = [])\n * @method \\Aws\\Result updateDomainName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDomainNameAsync(array $args = [])\n * @method \\Aws\\Result updateFunction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFunctionAsync(array $args = [])\n * @method \\Aws\\Result updateGraphqlApi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGraphqlApiAsync(array $args = [])\n * @method \\Aws\\Result updateResolver(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResolverAsync(array $args = [])\n * @method \\Aws\\Result updateSourceApiAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSourceApiAssociationAsync(array $args = [])\n * @method \\Aws\\Result updateType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTypeAsync(array $args = [])\n */\nclass AppSyncClient extends AwsClient {}\n", "num_lines": 130}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AppSync\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS AppSync** service.\n */\nclass AppSyncException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ARCZonalShift;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS ARC - Zonal Shift** service.\n * @method \\Aws\\Result cancelZonalShift(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelZonalShiftAsync(array $args = [])\n * @method \\Aws\\Result getManagedResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getManagedResourceAsync(array $args = [])\n * @method \\Aws\\Result listManagedResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listManagedResourcesAsync(array $args = [])\n * @method \\Aws\\Result listZonalShifts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listZonalShiftsAsync(array $args = [])\n * @method \\Aws\\Result startZonalShift(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startZonalShiftAsync(array $args = [])\n * @method \\Aws\\Result updateZonalShift(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateZonalShiftAsync(array $args = [])\n */\nclass ARCZonalShiftClient extends AwsClient {}\n", "num_lines": 22}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ARCZonalShift\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS ARC - Zonal Shift** service.\n */\nclass ARCZonalShiftException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Arn;\n\nuse Aws\\Arn\\Exception\\InvalidArnException;\n\n/**\n * @internal\n */\nclass AccessPointArn extends Arn implements AccessPointArnInterface\n{\n    use ResourceTypeAndIdTrait;\n\n    /**\n     * AccessPointArn constructor\n     *\n     * @param $data\n     */\n    public function __construct($data)\n    {\n        parent::__construct($data);\n        static::validate($this->data);\n    }\n\n    public static function parse($string)\n    {\n        $data = parent::parse($string);\n        $data = self::parseResourceTypeAndId($data);\n        $data['accesspoint_name'] = $data['resource_id'];\n        return $data;\n    }\n\n    public function getAccesspointName()\n    {\n        return $this->data['accesspoint_name'];\n    }\n\n    /**\n     * Validation specific to AccessPointArn\n     *\n     * @param array $data\n     */\n    protected static function validate(array $data)\n    {\n        self::validateRegion($data, 'access point ARN');\n        self::validateAccountId($data, 'access point ARN');\n\n        if ($data['resource_type'] !== 'accesspoint') {\n            throw new InvalidArnException(\"The 6th component of an access point ARN\"\n                . \" represents the resource type and must be 'accesspoint'.\");\n        }\n\n        if (empty($data['resource_id'])) {\n            throw new InvalidArnException(\"The 7th component of an access point ARN\"\n                . \" represents the resource ID and must not be empty.\");\n        }\n        if (strpos($data['resource_id'], ':') !== false) {\n            throw new InvalidArnException(\"The resource ID component of an access\"\n                . \" point ARN must not contain additional components\"\n                . \" (delimited by ':').\");\n        }\n        if (!self::isValidHostLabel($data['resource_id'])) {\n            throw new InvalidArnException(\"The resource ID in an access point ARN\"\n                . \" must be a valid host label value.\");\n        }\n    }\n}\n", "num_lines": 67}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Arn;\n\n/**\n * @internal\n */\ninterface AccessPointArnInterface extends ArnInterface\n{\n    public function getAccesspointName();\n}\n", "num_lines": 11}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Arn;\n\nuse Aws\\Arn\\Exception\\InvalidArnException;\n\n/**\n * Amazon Resource Names (ARNs) uniquely identify AWS resources. The Arn class\n * parses and stores a generic ARN object representation that can apply to any\n * service resource.\n *\n * @internal\n */\nclass Arn implements ArnInterface\n{\n    protected $data;\n    protected $string;\n\n    public static function parse($string)\n    {\n        $data = [\n            'arn' => null,\n            'partition' => null,\n            'service' => null,\n            'region' => null,\n            'account_id' => null,\n            'resource' => null,\n        ];\n\n        $length = strlen($string);\n        $lastDelim = 0;\n        $numComponents = 0;\n        for ($i = 0; $i < $length; $i++) {\n\n            if (($numComponents < 5 && $string[$i] === ':')) {\n                // Split components between delimiters\n                $data[key($data)] = substr($string, $lastDelim, $i - $lastDelim);\n\n                // Do not include delimiter character itself\n                $lastDelim = $i + 1;\n                next($data);\n                $numComponents++;\n            }\n\n            if ($i === $length - 1) {\n                // Put the remainder in the last component.\n                if (in_array($numComponents, [5])) {\n                    $data['resource'] = substr($string, $lastDelim);\n                } else {\n                    // If there are < 5 components, put remainder in current\n                    // component.\n                    $data[key($data)] = substr($string, $lastDelim);\n                }\n            }\n        }\n\n        return $data;\n    }\n\n    public function __construct($data)\n    {\n        if (is_array($data)) {\n            $this->data = $data;\n        } elseif (is_string($data)) {\n            $this->data = static::parse($data);\n        } else {\n            throw new InvalidArnException('Constructor accepts a string or an'\n                . ' array as an argument.');\n        }\n\n        static::validate($this->data);\n    }\n\n    public function __toString()\n    {\n        if (!isset($this->string)) {\n            $components = [\n                $this->getPrefix(),\n                $this->getPartition(),\n                $this->getService(),\n                $this->getRegion(),\n                $this->getAccountId(),\n                $this->getResource(),\n            ];\n\n            $this->string = implode(':', $components);\n        }\n        return $this->string;\n    }\n\n    public function getPrefix()\n    {\n        return $this->data['arn'];\n    }\n\n    public function getPartition()\n    {\n        return $this->data['partition'];\n    }\n\n    public function getService()\n    {\n        return $this->data['service'];\n    }\n\n    public function getRegion()\n    {\n        return $this->data['region'];\n    }\n\n    public function getAccountId()\n    {\n        return $this->data['account_id'];\n    }\n\n    public function getResource()\n    {\n        return $this->data['resource'];\n    }\n\n    public function toArray()\n    {\n        return $this->data;\n    }\n\n    /**\n     * Minimally restrictive generic ARN validation\n     *\n     * @param array $data\n     */\n    protected static function validate(array $data)\n    {\n        if ($data['arn'] !== 'arn') {\n            throw new InvalidArnException(\"The 1st component of an ARN must be\"\n                . \" 'arn'.\");\n        }\n\n        if (empty($data['partition'])) {\n            throw new InvalidArnException(\"The 2nd component of an ARN\"\n                . \" represents the partition and must not be empty.\");\n        }\n\n        if (empty($data['service'])) {\n            throw new InvalidArnException(\"The 3rd component of an ARN\"\n                . \" represents the service and must not be empty.\");\n        }\n\n        if (empty($data['resource'])) {\n            throw new InvalidArnException(\"The 6th component of an ARN\"\n                . \" represents the resource information and must not be empty.\"\n                . \" Individual service ARNs may include additional delimiters\"\n                . \" to further qualify resources.\");\n        }\n    }\n\n    protected static function validateAccountId($data, $arnName)\n    {\n        if (!self::isValidHostLabel($data['account_id'])) {\n            throw new InvalidArnException(\"The 5th component of a {$arnName}\"\n                . \" is required, represents the account ID, and\"\n                . \" must be a valid host label.\");\n        }\n    }\n\n    protected static function validateRegion($data, $arnName)\n    {\n        if (empty($data['region'])) {\n            throw new InvalidArnException(\"The 4th component of a {$arnName}\"\n                . \" represents the region and must not be empty.\");\n        }\n    }\n\n    /**\n     * Validates whether a string component is a valid host label\n     *\n     * @param $string\n     * @return bool\n     */\n    protected static function isValidHostLabel($string)\n    {\n        if (empty($string) || strlen($string) > 63) {\n            return false;\n        }\n        if ($value = preg_match(\"/^[a-zA-Z0-9-]+$/\", $string)) {\n            return true;\n        }\n        return false;\n    }\n}", "num_lines": 188}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Arn;\n\n/**\n * Amazon Resource Names (ARNs) uniquely identify AWS resources. Classes\n * implementing ArnInterface parse and store an ARN object representation.\n *\n * Valid ARN formats include:\n *\n *   arn:partition:service:region:account-id:resource-id\n *   arn:partition:service:region:account-id:resource-type/resource-id\n *   arn:partition:service:region:account-id:resource-type:resource-id\n *\n * Some components may be omitted, depending on the service and resource type.\n *\n * @internal\n */\ninterface ArnInterface\n{\n    public static function parse($string);\n\n    public function __toString();\n\n    public function getPrefix();\n\n    public function getPartition();\n\n    public function getService();\n\n    public function getRegion();\n\n    public function getAccountId();\n\n    public function getResource();\n\n    public function toArray();\n}", "num_lines": 37}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Arn;\n\nuse Aws\\Arn\\S3\\AccessPointArn as S3AccessPointArn;\nuse Aws\\Arn\\ObjectLambdaAccessPointArn;\nuse Aws\\Arn\\S3\\MultiRegionAccessPointArn;\nuse Aws\\Arn\\S3\\OutpostsBucketArn;\nuse Aws\\Arn\\S3\\RegionalBucketArn;\nuse Aws\\Arn\\S3\\OutpostsAccessPointArn;\n\n/**\n * This class provides functionality to parse ARN strings and return a\n * corresponding ARN object. ARN-parsing logic may be subject to change in the\n * future, so this should not be relied upon for external customer usage.\n *\n * @internal\n */\nclass ArnParser\n{\n    /**\n     * @param $string\n     * @return bool\n     */\n    public static function isArn($string)\n    {\n        return $string !== null && strpos($string, 'arn:') === 0;\n    }\n\n    /**\n     * Parses a string and returns an instance of ArnInterface. Returns a\n     * specific type of Arn object if it has a specific class representation\n     * or a generic Arn object if not.\n     *\n     * @param $string\n     * @return ArnInterface\n     */\n    public static function parse($string)\n    {\n        $data = Arn::parse($string);\n        if ($data['service'] === 's3-object-lambda') {\n            return new ObjectLambdaAccessPointArn($string);\n        }\n        $resource = self::explodeResourceComponent($data['resource']);\n        if ($resource[0] === 'outpost') {\n            if (isset($resource[2]) && $resource[2] === 'bucket') {\n                return new OutpostsBucketArn($string);\n            }\n            if (isset($resource[2]) && $resource[2] === 'accesspoint') {\n                return new OutpostsAccessPointArn($string);\n            }\n        }\n        if (empty($data['region'])) {\n            return new MultiRegionAccessPointArn($string);\n        }\n        if ($resource[0] === 'accesspoint') {\n            if ($data['service'] === 's3') {\n                return new S3AccessPointArn($string);\n            }\n            return new AccessPointArn($string);\n        }\n\n        return new Arn($data);\n    }\n\n    private static function explodeResourceComponent($resource)\n    {\n        return preg_split(\"/[\\/:]/\", $resource);\n    }\n}\n", "num_lines": 70}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Arn;\n\n/**\n * This class represents an S3 Object bucket ARN, which is in the\n * following format:\n *\n * @internal\n */\nclass ObjectLambdaAccessPointArn extends AccessPointArn\n{\n    /**\n     * Parses a string into an associative array of components that represent\n     * a ObjectLambdaAccessPointArn\n     *\n     * @param $string\n     * @return array\n     */\n    public static function parse($string)\n    {\n        $data = parent::parse($string);\n        return parent::parseResourceTypeAndId($data);\n    }\n\n    /**\n     *\n     * @param array $data\n     */\n    protected static function validate(array $data)\n    {\n        parent::validate($data);\n        self::validateRegion($data, 'S3 Object Lambda ARN');\n        self::validateAccountId($data, 'S3 Object Lambda ARN');\n    }\n}\n", "num_lines": 36}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Arn;\n\n/**\n * @internal\n */\ntrait ResourceTypeAndIdTrait\n{\n    public function getResourceType()\n    {\n        return $this->data['resource_type'];\n    }\n\n    public function getResourceId()\n    {\n        return $this->data['resource_id'];\n    }\n\n    protected static function parseResourceTypeAndId(array $data)\n    {\n        $resourceData = preg_split(\"/[\\/:]/\", $data['resource'], 2);\n        $data['resource_type'] = isset($resourceData[0])\n            ? $resourceData[0]\n            : null;\n        $data['resource_id'] = isset($resourceData[1])\n            ? $resourceData[1]\n            : null;\n        return $data;\n    }\n}", "num_lines": 30}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Arn\\Exception;\n\n/**\n * Represents a failed attempt to construct an Arn\n */\nclass InvalidArnException extends \\RuntimeException {}\n", "num_lines": 8}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Arn\\S3;\n\nuse Aws\\Arn\\AccessPointArn as BaseAccessPointArn;\nuse Aws\\Arn\\AccessPointArnInterface;\nuse Aws\\Arn\\ArnInterface;\nuse Aws\\Arn\\Exception\\InvalidArnException;\n\n/**\n * @internal\n */\nclass AccessPointArn extends BaseAccessPointArn implements AccessPointArnInterface\n{\n    /**\n     * Validation specific to AccessPointArn\n     *\n     * @param array $data\n     */\n    public static function validate(array $data)\n    {\n        parent::validate($data);\n        if ($data['service'] !== 's3') {\n            throw new InvalidArnException(\"The 3rd component of an S3 access\"\n                . \" point ARN represents the region and must be 's3'.\");\n        }\n    }\n}", "num_lines": 27}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Arn\\S3;\n\nuse Aws\\Arn\\ArnInterface;\n\n/**\n * @internal\n */\ninterface BucketArnInterface extends ArnInterface\n{\n    public function getBucketName();\n}\n", "num_lines": 13}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Arn\\S3;\n\nuse Aws\\Arn\\Arn;\nuse Aws\\Arn\\ResourceTypeAndIdTrait;\n\n/**\n * This class represents an S3 multi-region bucket ARN, which is in the\n * following format:\n *\n * @internal\n */\nclass MultiRegionAccessPointArn extends AccessPointArn\n{\n    use ResourceTypeAndIdTrait;\n\n    /**\n     * Parses a string into an associative array of components that represent\n     * a MultiRegionArn\n     *\n     * @param $string\n     * @return array\n     */\n    public static function parse($string)\n    {\n        return parent::parse($string);\n    }\n\n    /**\n     *\n     * @param array $data\n     */\n    public static function validate(array $data)\n    {\n        Arn::validate($data);\n    }\n\n}\n", "num_lines": 39}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Arn\\S3;\n\nuse Aws\\Arn\\AccessPointArn as BaseAccessPointArn;\nuse Aws\\Arn\\AccessPointArnInterface;\nuse Aws\\Arn\\Arn;\nuse Aws\\Arn\\Exception\\InvalidArnException;\n\n/**\n * This class represents an S3 Outposts access point ARN, which is in the\n * following format:\n *\n * arn:{partition}:s3-outposts:{region}:{accountId}:outpost:{outpostId}:accesspoint:{accesspointName}\n *\n * ':' and '/' can be used interchangeably as delimiters for components after\n * the account ID.\n *\n * @internal\n */\nclass OutpostsAccessPointArn extends BaseAccessPointArn implements\n    AccessPointArnInterface,\n    OutpostsArnInterface\n{\n    public static function parse($string)\n    {\n        $data = parent::parse($string);\n        return self::parseOutpostData($data);\n    }\n\n    public function getOutpostId()\n    {\n        return $this->data['outpost_id'];\n    }\n\n    public function getAccesspointName()\n    {\n        return $this->data['accesspoint_name'];\n    }\n\n    private static function parseOutpostData(array $data)\n    {\n        $resourceData = preg_split(\"/[\\/:]/\", $data['resource_id']);\n\n        $data['outpost_id'] = isset($resourceData[0])\n            ? $resourceData[0]\n            : null;\n        $data['accesspoint_type'] = isset($resourceData[1])\n            ? $resourceData[1]\n            : null;\n        $data['accesspoint_name'] = isset($resourceData[2])\n            ? $resourceData[2]\n            : null;\n        if (isset($resourceData[3])) {\n            $data['resource_extra'] = implode(':', array_slice($resourceData, 3));\n        }\n\n        return $data;\n    }\n\n    /**\n     * Validation specific to OutpostsAccessPointArn. Note this uses the base Arn\n     * class validation instead of the direct parent due to it having slightly\n     * differing requirements from its parent.\n     *\n     * @param array $data\n     */\n    public static function validate(array $data)\n    {\n        Arn::validate($data);\n\n        if (($data['service'] !== 's3-outposts')) {\n            throw new InvalidArnException(\"The 3rd component of an S3 Outposts\"\n                . \" access point ARN represents the service and must be\"\n                . \" 's3-outposts'.\");\n        }\n\n        self::validateRegion($data, 'S3 Outposts access point ARN');\n        self::validateAccountId($data, 'S3 Outposts access point ARN');\n\n        if (($data['resource_type'] !== 'outpost')) {\n            throw new InvalidArnException(\"The 6th component of an S3 Outposts\"\n                . \" access point ARN represents the resource type and must be\"\n                . \" 'outpost'.\");\n        }\n\n        if (!self::isValidHostLabel($data['outpost_id'])) {\n            throw new InvalidArnException(\"The 7th component of an S3 Outposts\"\n                . \" access point ARN is required, represents the outpost ID, and\"\n                . \" must be a valid host label.\");\n        }\n\n        if ($data['accesspoint_type'] !== 'accesspoint') {\n            throw new InvalidArnException(\"The 8th component of an S3 Outposts\"\n                . \" access point ARN must be 'accesspoint'\");\n        }\n\n        if (!self::isValidHostLabel($data['accesspoint_name'])) {\n            throw new InvalidArnException(\"The 9th component of an S3 Outposts\"\n                . \" access point ARN is required, represents the accesspoint name,\"\n                . \" and must be a valid host label.\");\n        }\n\n        if (!empty($data['resource_extra'])) {\n            throw new InvalidArnException(\"An S3 Outposts access point ARN\"\n                . \" should only have 9 components, delimited by the characters\"\n                . \" ':' and '/'. '{$data['resource_extra']}' was found after the\"\n                . \" 9th component.\");\n        }\n    }\n}\n", "num_lines": 111}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Arn\\S3;\n\nuse Aws\\Arn\\ArnInterface;\n\n/**\n * @internal\n */\ninterface OutpostsArnInterface extends ArnInterface\n{\n    public function getOutpostId();\n}\n", "num_lines": 13}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Arn\\S3;\n\nuse Aws\\Arn\\Arn;\nuse Aws\\Arn\\Exception\\InvalidArnException;\nuse Aws\\Arn\\ResourceTypeAndIdTrait;\n\n/**\n * This class represents an S3 Outposts bucket ARN, which is in the\n * following format:\n *\n * @internal\n */\nclass OutpostsBucketArn extends Arn implements\n    BucketArnInterface,\n    OutpostsArnInterface\n{\n    use ResourceTypeAndIdTrait;\n\n    /**\n     * Parses a string into an associative array of components that represent\n     * a OutpostsBucketArn\n     *\n     * @param $string\n     * @return array\n     */\n    public static function parse($string)\n    {\n        $data = parent::parse($string);\n        $data = self::parseResourceTypeAndId($data);\n        return self::parseOutpostData($data);\n    }\n\n    public function getBucketName()\n    {\n        return $this->data['bucket_name'];\n    }\n\n    public function getOutpostId()\n    {\n        return $this->data['outpost_id'];\n    }\n\n    private static function parseOutpostData(array $data)\n    {\n        $resourceData = preg_split(\"/[\\/:]/\", $data['resource_id'], 3);\n\n        $data['outpost_id'] = isset($resourceData[0])\n            ? $resourceData[0]\n            : null;\n        $data['bucket_label'] = isset($resourceData[1])\n            ? $resourceData[1]\n            : null;\n        $data['bucket_name'] = isset($resourceData[2])\n            ? $resourceData[2]\n            : null;\n\n        return $data;\n    }\n\n    /**\n     *\n     * @param array $data\n     */\n    public static function validate(array $data)\n    {\n        Arn::validate($data);\n\n        if (($data['service'] !== 's3-outposts')) {\n            throw new InvalidArnException(\"The 3rd component of an S3 Outposts\"\n                . \" bucket ARN represents the service and must be 's3-outposts'.\");\n        }\n\n        self::validateRegion($data, 'S3 Outposts bucket ARN');\n        self::validateAccountId($data, 'S3 Outposts bucket ARN');\n\n        if (($data['resource_type'] !== 'outpost')) {\n            throw new InvalidArnException(\"The 6th component of an S3 Outposts\"\n                . \" bucket ARN represents the resource type and must be\"\n                . \" 'outpost'.\");\n        }\n\n        if (!self::isValidHostLabel($data['outpost_id'])) {\n            throw new InvalidArnException(\"The 7th component of an S3 Outposts\"\n                . \" bucket ARN is required, represents the outpost ID, and\"\n                . \" must be a valid host label.\");\n        }\n\n        if ($data['bucket_label'] !== 'bucket') {\n            throw new InvalidArnException(\"The 8th component of an S3 Outposts\"\n                . \" bucket ARN must be 'bucket'\");\n        }\n\n        if (empty($data['bucket_name'])) {\n            throw new InvalidArnException(\"The 9th component of an S3 Outposts\"\n                . \" bucket ARN represents the bucket name and must not be empty.\");\n        }\n    }\n}\n", "num_lines": 100}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Athena;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Athena** service.\n * @method \\Aws\\Result batchGetNamedQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetNamedQueryAsync(array $args = [])\n * @method \\Aws\\Result batchGetPreparedStatement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetPreparedStatementAsync(array $args = [])\n * @method \\Aws\\Result batchGetQueryExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetQueryExecutionAsync(array $args = [])\n * @method \\Aws\\Result cancelCapacityReservation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelCapacityReservationAsync(array $args = [])\n * @method \\Aws\\Result createCapacityReservation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCapacityReservationAsync(array $args = [])\n * @method \\Aws\\Result createDataCatalog(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataCatalogAsync(array $args = [])\n * @method \\Aws\\Result createNamedQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNamedQueryAsync(array $args = [])\n * @method \\Aws\\Result createNotebook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNotebookAsync(array $args = [])\n * @method \\Aws\\Result createPreparedStatement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPreparedStatementAsync(array $args = [])\n * @method \\Aws\\Result createPresignedNotebookUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPresignedNotebookUrlAsync(array $args = [])\n * @method \\Aws\\Result createWorkGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteCapacityReservation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCapacityReservationAsync(array $args = [])\n * @method \\Aws\\Result deleteDataCatalog(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataCatalogAsync(array $args = [])\n * @method \\Aws\\Result deleteNamedQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNamedQueryAsync(array $args = [])\n * @method \\Aws\\Result deleteNotebook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNotebookAsync(array $args = [])\n * @method \\Aws\\Result deletePreparedStatement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePreparedStatementAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkGroupAsync(array $args = [])\n * @method \\Aws\\Result exportNotebook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportNotebookAsync(array $args = [])\n * @method \\Aws\\Result getCalculationExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCalculationExecutionAsync(array $args = [])\n * @method \\Aws\\Result getCalculationExecutionCode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCalculationExecutionCodeAsync(array $args = [])\n * @method \\Aws\\Result getCalculationExecutionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCalculationExecutionStatusAsync(array $args = [])\n * @method \\Aws\\Result getCapacityAssignmentConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCapacityAssignmentConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getCapacityReservation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCapacityReservationAsync(array $args = [])\n * @method \\Aws\\Result getDataCatalog(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataCatalogAsync(array $args = [])\n * @method \\Aws\\Result getDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDatabaseAsync(array $args = [])\n * @method \\Aws\\Result getNamedQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNamedQueryAsync(array $args = [])\n * @method \\Aws\\Result getNotebookMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNotebookMetadataAsync(array $args = [])\n * @method \\Aws\\Result getPreparedStatement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPreparedStatementAsync(array $args = [])\n * @method \\Aws\\Result getQueryExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getQueryExecutionAsync(array $args = [])\n * @method \\Aws\\Result getQueryResults(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getQueryResultsAsync(array $args = [])\n * @method \\Aws\\Result getQueryRuntimeStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getQueryRuntimeStatisticsAsync(array $args = [])\n * @method \\Aws\\Result getSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSessionAsync(array $args = [])\n * @method \\Aws\\Result getSessionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSessionStatusAsync(array $args = [])\n * @method \\Aws\\Result getTableMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTableMetadataAsync(array $args = [])\n * @method \\Aws\\Result getWorkGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkGroupAsync(array $args = [])\n * @method \\Aws\\Result importNotebook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importNotebookAsync(array $args = [])\n * @method \\Aws\\Result listApplicationDPUSizes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationDPUSizesAsync(array $args = [])\n * @method \\Aws\\Result listCalculationExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCalculationExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listCapacityReservations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCapacityReservationsAsync(array $args = [])\n * @method \\Aws\\Result listDataCatalogs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataCatalogsAsync(array $args = [])\n * @method \\Aws\\Result listDatabases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatabasesAsync(array $args = [])\n * @method \\Aws\\Result listEngineVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEngineVersionsAsync(array $args = [])\n * @method \\Aws\\Result listExecutors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExecutorsAsync(array $args = [])\n * @method \\Aws\\Result listNamedQueries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNamedQueriesAsync(array $args = [])\n * @method \\Aws\\Result listNotebookMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNotebookMetadataAsync(array $args = [])\n * @method \\Aws\\Result listNotebookSessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNotebookSessionsAsync(array $args = [])\n * @method \\Aws\\Result listPreparedStatements(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPreparedStatementsAsync(array $args = [])\n * @method \\Aws\\Result listQueryExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listQueryExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listSessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSessionsAsync(array $args = [])\n * @method \\Aws\\Result listTableMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTableMetadataAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWorkGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkGroupsAsync(array $args = [])\n * @method \\Aws\\Result putCapacityAssignmentConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putCapacityAssignmentConfigurationAsync(array $args = [])\n * @method \\Aws\\Result startCalculationExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startCalculationExecutionAsync(array $args = [])\n * @method \\Aws\\Result startQueryExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startQueryExecutionAsync(array $args = [])\n * @method \\Aws\\Result startSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSessionAsync(array $args = [])\n * @method \\Aws\\Result stopCalculationExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopCalculationExecutionAsync(array $args = [])\n * @method \\Aws\\Result stopQueryExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopQueryExecutionAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result terminateSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise terminateSessionAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateCapacityReservation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCapacityReservationAsync(array $args = [])\n * @method \\Aws\\Result updateDataCatalog(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDataCatalogAsync(array $args = [])\n * @method \\Aws\\Result updateNamedQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNamedQueryAsync(array $args = [])\n * @method \\Aws\\Result updateNotebook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNotebookAsync(array $args = [])\n * @method \\Aws\\Result updateNotebookMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNotebookMetadataAsync(array $args = [])\n * @method \\Aws\\Result updatePreparedStatement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePreparedStatementAsync(array $args = [])\n * @method \\Aws\\Result updateWorkGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkGroupAsync(array $args = [])\n */\nclass AthenaClient extends AwsClient {}\n", "num_lines": 146}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Athena\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Athena** service.\n */\nclass AthenaException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AuditManager;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Audit Manager** service.\n * @method \\Aws\\Result associateAssessmentReportEvidenceFolder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateAssessmentReportEvidenceFolderAsync(array $args = [])\n * @method \\Aws\\Result batchAssociateAssessmentReportEvidence(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchAssociateAssessmentReportEvidenceAsync(array $args = [])\n * @method \\Aws\\Result batchCreateDelegationByAssessment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchCreateDelegationByAssessmentAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteDelegationByAssessment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteDelegationByAssessmentAsync(array $args = [])\n * @method \\Aws\\Result batchDisassociateAssessmentReportEvidence(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDisassociateAssessmentReportEvidenceAsync(array $args = [])\n * @method \\Aws\\Result batchImportEvidenceToAssessmentControl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchImportEvidenceToAssessmentControlAsync(array $args = [])\n * @method \\Aws\\Result createAssessment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAssessmentAsync(array $args = [])\n * @method \\Aws\\Result createAssessmentFramework(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAssessmentFrameworkAsync(array $args = [])\n * @method \\Aws\\Result createAssessmentReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAssessmentReportAsync(array $args = [])\n * @method \\Aws\\Result createControl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createControlAsync(array $args = [])\n * @method \\Aws\\Result deleteAssessment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAssessmentAsync(array $args = [])\n * @method \\Aws\\Result deleteAssessmentFramework(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAssessmentFrameworkAsync(array $args = [])\n * @method \\Aws\\Result deleteAssessmentFrameworkShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAssessmentFrameworkShareAsync(array $args = [])\n * @method \\Aws\\Result deleteAssessmentReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAssessmentReportAsync(array $args = [])\n * @method \\Aws\\Result deleteControl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteControlAsync(array $args = [])\n * @method \\Aws\\Result deregisterAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterAccountAsync(array $args = [])\n * @method \\Aws\\Result deregisterOrganizationAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterOrganizationAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result disassociateAssessmentReportEvidenceFolder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateAssessmentReportEvidenceFolderAsync(array $args = [])\n * @method \\Aws\\Result getAccountStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountStatusAsync(array $args = [])\n * @method \\Aws\\Result getAssessment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAssessmentAsync(array $args = [])\n * @method \\Aws\\Result getAssessmentFramework(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAssessmentFrameworkAsync(array $args = [])\n * @method \\Aws\\Result getAssessmentReportUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAssessmentReportUrlAsync(array $args = [])\n * @method \\Aws\\Result getChangeLogs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChangeLogsAsync(array $args = [])\n * @method \\Aws\\Result getControl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getControlAsync(array $args = [])\n * @method \\Aws\\Result getDelegations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDelegationsAsync(array $args = [])\n * @method \\Aws\\Result getEvidence(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEvidenceAsync(array $args = [])\n * @method \\Aws\\Result getEvidenceByEvidenceFolder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEvidenceByEvidenceFolderAsync(array $args = [])\n * @method \\Aws\\Result getEvidenceFileUploadUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEvidenceFileUploadUrlAsync(array $args = [])\n * @method \\Aws\\Result getEvidenceFolder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEvidenceFolderAsync(array $args = [])\n * @method \\Aws\\Result getEvidenceFoldersByAssessment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEvidenceFoldersByAssessmentAsync(array $args = [])\n * @method \\Aws\\Result getEvidenceFoldersByAssessmentControl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEvidenceFoldersByAssessmentControlAsync(array $args = [])\n * @method \\Aws\\Result getInsights(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInsightsAsync(array $args = [])\n * @method \\Aws\\Result getInsightsByAssessment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInsightsByAssessmentAsync(array $args = [])\n * @method \\Aws\\Result getOrganizationAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOrganizationAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result getServicesInScope(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServicesInScopeAsync(array $args = [])\n * @method \\Aws\\Result getSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSettingsAsync(array $args = [])\n * @method \\Aws\\Result listAssessmentControlInsightsByControlDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssessmentControlInsightsByControlDomainAsync(array $args = [])\n * @method \\Aws\\Result listAssessmentFrameworkShareRequests(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssessmentFrameworkShareRequestsAsync(array $args = [])\n * @method \\Aws\\Result listAssessmentFrameworks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssessmentFrameworksAsync(array $args = [])\n * @method \\Aws\\Result listAssessmentReports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssessmentReportsAsync(array $args = [])\n * @method \\Aws\\Result listAssessments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssessmentsAsync(array $args = [])\n * @method \\Aws\\Result listControlDomainInsights(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listControlDomainInsightsAsync(array $args = [])\n * @method \\Aws\\Result listControlDomainInsightsByAssessment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listControlDomainInsightsByAssessmentAsync(array $args = [])\n * @method \\Aws\\Result listControlInsightsByControlDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listControlInsightsByControlDomainAsync(array $args = [])\n * @method \\Aws\\Result listControls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listControlsAsync(array $args = [])\n * @method \\Aws\\Result listKeywordsForDataSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listKeywordsForDataSourceAsync(array $args = [])\n * @method \\Aws\\Result listNotifications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNotificationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result registerAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerAccountAsync(array $args = [])\n * @method \\Aws\\Result registerOrganizationAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerOrganizationAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result startAssessmentFrameworkShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startAssessmentFrameworkShareAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAssessment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAssessmentAsync(array $args = [])\n * @method \\Aws\\Result updateAssessmentControl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAssessmentControlAsync(array $args = [])\n * @method \\Aws\\Result updateAssessmentControlSetStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAssessmentControlSetStatusAsync(array $args = [])\n * @method \\Aws\\Result updateAssessmentFramework(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAssessmentFrameworkAsync(array $args = [])\n * @method \\Aws\\Result updateAssessmentFrameworkShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAssessmentFrameworkShareAsync(array $args = [])\n * @method \\Aws\\Result updateAssessmentStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAssessmentStatusAsync(array $args = [])\n * @method \\Aws\\Result updateControl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateControlAsync(array $args = [])\n * @method \\Aws\\Result updateSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSettingsAsync(array $args = [])\n * @method \\Aws\\Result validateAssessmentReportIntegrity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise validateAssessmentReportIntegrityAsync(array $args = [])\n */\nclass AuditManagerClient extends AwsClient {}\n", "num_lines": 134}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AuditManager\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Audit Manager** service.\n */\nclass AuditManagerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AugmentedAIRuntime;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Augmented AI Runtime** service.\n * @method \\Aws\\Result deleteHumanLoop(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHumanLoopAsync(array $args = [])\n * @method \\Aws\\Result describeHumanLoop(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHumanLoopAsync(array $args = [])\n * @method \\Aws\\Result listHumanLoops(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHumanLoopsAsync(array $args = [])\n * @method \\Aws\\Result startHumanLoop(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startHumanLoopAsync(array $args = [])\n * @method \\Aws\\Result stopHumanLoop(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopHumanLoopAsync(array $args = [])\n */\nclass AugmentedAIRuntimeClient extends AwsClient {}\n", "num_lines": 20}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AugmentedAIRuntime\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Augmented AI Runtime** service.\n */\nclass AugmentedAIRuntimeException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AutoScaling;\n\nuse Aws\\AwsClient;\n\n/**\n * Auto Scaling client.\n *\n * @method \\Aws\\Result attachInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachInstancesAsync(array $args = [])\n * @method \\Aws\\Result attachLoadBalancerTargetGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachLoadBalancerTargetGroupsAsync(array $args = [])\n * @method \\Aws\\Result attachLoadBalancers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachLoadBalancersAsync(array $args = [])\n * @method \\Aws\\Result attachTrafficSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachTrafficSourcesAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteScheduledAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteScheduledActionAsync(array $args = [])\n * @method \\Aws\\Result batchPutScheduledUpdateGroupAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchPutScheduledUpdateGroupActionAsync(array $args = [])\n * @method \\Aws\\Result cancelInstanceRefresh(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelInstanceRefreshAsync(array $args = [])\n * @method \\Aws\\Result completeLifecycleAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise completeLifecycleActionAsync(array $args = [])\n * @method \\Aws\\Result createAutoScalingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAutoScalingGroupAsync(array $args = [])\n * @method \\Aws\\Result createLaunchConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLaunchConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createOrUpdateTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createOrUpdateTagsAsync(array $args = [])\n * @method \\Aws\\Result deleteAutoScalingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAutoScalingGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteLaunchConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLaunchConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteLifecycleHook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLifecycleHookAsync(array $args = [])\n * @method \\Aws\\Result deleteNotificationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNotificationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deletePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteScheduledAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteScheduledActionAsync(array $args = [])\n * @method \\Aws\\Result deleteTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTagsAsync(array $args = [])\n * @method \\Aws\\Result deleteWarmPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWarmPoolAsync(array $args = [])\n * @method \\Aws\\Result describeAccountLimits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountLimitsAsync(array $args = [])\n * @method \\Aws\\Result describeAdjustmentTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAdjustmentTypesAsync(array $args = [])\n * @method \\Aws\\Result describeAutoScalingGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAutoScalingGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeAutoScalingInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAutoScalingInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeAutoScalingNotificationTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAutoScalingNotificationTypesAsync(array $args = [])\n * @method \\Aws\\Result describeInstanceRefreshes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceRefreshesAsync(array $args = [])\n * @method \\Aws\\Result describeLaunchConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLaunchConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result describeLifecycleHookTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLifecycleHookTypesAsync(array $args = [])\n * @method \\Aws\\Result describeLifecycleHooks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLifecycleHooksAsync(array $args = [])\n * @method \\Aws\\Result describeLoadBalancerTargetGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLoadBalancerTargetGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeLoadBalancers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLoadBalancersAsync(array $args = [])\n * @method \\Aws\\Result describeMetricCollectionTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMetricCollectionTypesAsync(array $args = [])\n * @method \\Aws\\Result describeNotificationConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNotificationConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result describePolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePoliciesAsync(array $args = [])\n * @method \\Aws\\Result describeScalingActivities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScalingActivitiesAsync(array $args = [])\n * @method \\Aws\\Result describeScalingProcessTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScalingProcessTypesAsync(array $args = [])\n * @method \\Aws\\Result describeScheduledActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScheduledActionsAsync(array $args = [])\n * @method \\Aws\\Result describeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTagsAsync(array $args = [])\n * @method \\Aws\\Result describeTerminationPolicyTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTerminationPolicyTypesAsync(array $args = [])\n * @method \\Aws\\Result describeTrafficSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTrafficSourcesAsync(array $args = [])\n * @method \\Aws\\Result describeWarmPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWarmPoolAsync(array $args = [])\n * @method \\Aws\\Result detachInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachInstancesAsync(array $args = [])\n * @method \\Aws\\Result detachLoadBalancerTargetGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachLoadBalancerTargetGroupsAsync(array $args = [])\n * @method \\Aws\\Result detachLoadBalancers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachLoadBalancersAsync(array $args = [])\n * @method \\Aws\\Result detachTrafficSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachTrafficSourcesAsync(array $args = [])\n * @method \\Aws\\Result disableMetricsCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableMetricsCollectionAsync(array $args = [])\n * @method \\Aws\\Result enableMetricsCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableMetricsCollectionAsync(array $args = [])\n * @method \\Aws\\Result enterStandby(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enterStandbyAsync(array $args = [])\n * @method \\Aws\\Result executePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise executePolicyAsync(array $args = [])\n * @method \\Aws\\Result exitStandby(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exitStandbyAsync(array $args = [])\n * @method \\Aws\\Result getPredictiveScalingForecast(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPredictiveScalingForecastAsync(array $args = [])\n * @method \\Aws\\Result putLifecycleHook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putLifecycleHookAsync(array $args = [])\n * @method \\Aws\\Result putNotificationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putNotificationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putScalingPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putScalingPolicyAsync(array $args = [])\n * @method \\Aws\\Result putScheduledUpdateGroupAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putScheduledUpdateGroupActionAsync(array $args = [])\n * @method \\Aws\\Result putWarmPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putWarmPoolAsync(array $args = [])\n * @method \\Aws\\Result recordLifecycleActionHeartbeat(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise recordLifecycleActionHeartbeatAsync(array $args = [])\n * @method \\Aws\\Result resumeProcesses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resumeProcessesAsync(array $args = [])\n * @method \\Aws\\Result rollbackInstanceRefresh(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rollbackInstanceRefreshAsync(array $args = [])\n * @method \\Aws\\Result setDesiredCapacity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setDesiredCapacityAsync(array $args = [])\n * @method \\Aws\\Result setInstanceHealth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setInstanceHealthAsync(array $args = [])\n * @method \\Aws\\Result setInstanceProtection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setInstanceProtectionAsync(array $args = [])\n * @method \\Aws\\Result startInstanceRefresh(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startInstanceRefreshAsync(array $args = [])\n * @method \\Aws\\Result suspendProcesses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise suspendProcessesAsync(array $args = [])\n * @method \\Aws\\Result terminateInstanceInAutoScalingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise terminateInstanceInAutoScalingGroupAsync(array $args = [])\n * @method \\Aws\\Result updateAutoScalingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAutoScalingGroupAsync(array $args = [])\n */\nclass AutoScalingClient extends AwsClient {}\n", "num_lines": 141}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AutoScaling\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error while interacting with the Auto Scaling service.\n */\nclass AutoScalingException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AutoScalingPlans;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Auto Scaling Plans** service.\n * @method \\Aws\\Result createScalingPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createScalingPlanAsync(array $args = [])\n * @method \\Aws\\Result deleteScalingPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteScalingPlanAsync(array $args = [])\n * @method \\Aws\\Result describeScalingPlanResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScalingPlanResourcesAsync(array $args = [])\n * @method \\Aws\\Result describeScalingPlans(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScalingPlansAsync(array $args = [])\n * @method \\Aws\\Result getScalingPlanResourceForecastData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getScalingPlanResourceForecastDataAsync(array $args = [])\n * @method \\Aws\\Result updateScalingPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateScalingPlanAsync(array $args = [])\n */\nclass AutoScalingPlansClient extends AwsClient {}\n", "num_lines": 22}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\AutoScalingPlans\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Auto Scaling Plans** service.\n */\nclass AutoScalingPlansException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Backup;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Backup** service.\n * @method \\Aws\\Result cancelLegalHold(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelLegalHoldAsync(array $args = [])\n * @method \\Aws\\Result createBackupPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBackupPlanAsync(array $args = [])\n * @method \\Aws\\Result createBackupSelection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBackupSelectionAsync(array $args = [])\n * @method \\Aws\\Result createBackupVault(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBackupVaultAsync(array $args = [])\n * @method \\Aws\\Result createFramework(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFrameworkAsync(array $args = [])\n * @method \\Aws\\Result createLegalHold(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLegalHoldAsync(array $args = [])\n * @method \\Aws\\Result createReportPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReportPlanAsync(array $args = [])\n * @method \\Aws\\Result deleteBackupPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBackupPlanAsync(array $args = [])\n * @method \\Aws\\Result deleteBackupSelection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBackupSelectionAsync(array $args = [])\n * @method \\Aws\\Result deleteBackupVault(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBackupVaultAsync(array $args = [])\n * @method \\Aws\\Result deleteBackupVaultAccessPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBackupVaultAccessPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteBackupVaultLockConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBackupVaultLockConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteBackupVaultNotifications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBackupVaultNotificationsAsync(array $args = [])\n * @method \\Aws\\Result deleteFramework(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFrameworkAsync(array $args = [])\n * @method \\Aws\\Result deleteRecoveryPoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRecoveryPointAsync(array $args = [])\n * @method \\Aws\\Result deleteReportPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReportPlanAsync(array $args = [])\n * @method \\Aws\\Result describeBackupJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBackupJobAsync(array $args = [])\n * @method \\Aws\\Result describeBackupVault(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBackupVaultAsync(array $args = [])\n * @method \\Aws\\Result describeCopyJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCopyJobAsync(array $args = [])\n * @method \\Aws\\Result describeFramework(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFrameworkAsync(array $args = [])\n * @method \\Aws\\Result describeGlobalSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGlobalSettingsAsync(array $args = [])\n * @method \\Aws\\Result describeProtectedResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProtectedResourceAsync(array $args = [])\n * @method \\Aws\\Result describeRecoveryPoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRecoveryPointAsync(array $args = [])\n * @method \\Aws\\Result describeRegionSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRegionSettingsAsync(array $args = [])\n * @method \\Aws\\Result describeReportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReportJobAsync(array $args = [])\n * @method \\Aws\\Result describeReportPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReportPlanAsync(array $args = [])\n * @method \\Aws\\Result describeRestoreJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRestoreJobAsync(array $args = [])\n * @method \\Aws\\Result disassociateRecoveryPoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateRecoveryPointAsync(array $args = [])\n * @method \\Aws\\Result disassociateRecoveryPointFromParent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateRecoveryPointFromParentAsync(array $args = [])\n * @method \\Aws\\Result exportBackupPlanTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportBackupPlanTemplateAsync(array $args = [])\n * @method \\Aws\\Result getBackupPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBackupPlanAsync(array $args = [])\n * @method \\Aws\\Result getBackupPlanFromJSON(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBackupPlanFromJSONAsync(array $args = [])\n * @method \\Aws\\Result getBackupPlanFromTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBackupPlanFromTemplateAsync(array $args = [])\n * @method \\Aws\\Result getBackupSelection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBackupSelectionAsync(array $args = [])\n * @method \\Aws\\Result getBackupVaultAccessPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBackupVaultAccessPolicyAsync(array $args = [])\n * @method \\Aws\\Result getBackupVaultNotifications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBackupVaultNotificationsAsync(array $args = [])\n * @method \\Aws\\Result getLegalHold(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLegalHoldAsync(array $args = [])\n * @method \\Aws\\Result getRecoveryPointRestoreMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRecoveryPointRestoreMetadataAsync(array $args = [])\n * @method \\Aws\\Result getSupportedResourceTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSupportedResourceTypesAsync(array $args = [])\n * @method \\Aws\\Result listBackupJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBackupJobsAsync(array $args = [])\n * @method \\Aws\\Result listBackupPlanTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBackupPlanTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listBackupPlanVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBackupPlanVersionsAsync(array $args = [])\n * @method \\Aws\\Result listBackupPlans(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBackupPlansAsync(array $args = [])\n * @method \\Aws\\Result listBackupSelections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBackupSelectionsAsync(array $args = [])\n * @method \\Aws\\Result listBackupVaults(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBackupVaultsAsync(array $args = [])\n * @method \\Aws\\Result listCopyJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCopyJobsAsync(array $args = [])\n * @method \\Aws\\Result listFrameworks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFrameworksAsync(array $args = [])\n * @method \\Aws\\Result listLegalHolds(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLegalHoldsAsync(array $args = [])\n * @method \\Aws\\Result listProtectedResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProtectedResourcesAsync(array $args = [])\n * @method \\Aws\\Result listRecoveryPointsByBackupVault(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecoveryPointsByBackupVaultAsync(array $args = [])\n * @method \\Aws\\Result listRecoveryPointsByLegalHold(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecoveryPointsByLegalHoldAsync(array $args = [])\n * @method \\Aws\\Result listRecoveryPointsByResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecoveryPointsByResourceAsync(array $args = [])\n * @method \\Aws\\Result listReportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReportJobsAsync(array $args = [])\n * @method \\Aws\\Result listReportPlans(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReportPlansAsync(array $args = [])\n * @method \\Aws\\Result listRestoreJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRestoreJobsAsync(array $args = [])\n * @method \\Aws\\Result listTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsAsync(array $args = [])\n * @method \\Aws\\Result putBackupVaultAccessPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBackupVaultAccessPolicyAsync(array $args = [])\n * @method \\Aws\\Result putBackupVaultLockConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBackupVaultLockConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putBackupVaultNotifications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBackupVaultNotificationsAsync(array $args = [])\n * @method \\Aws\\Result startBackupJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startBackupJobAsync(array $args = [])\n * @method \\Aws\\Result startCopyJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startCopyJobAsync(array $args = [])\n * @method \\Aws\\Result startReportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startReportJobAsync(array $args = [])\n * @method \\Aws\\Result startRestoreJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startRestoreJobAsync(array $args = [])\n * @method \\Aws\\Result stopBackupJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopBackupJobAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateBackupPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBackupPlanAsync(array $args = [])\n * @method \\Aws\\Result updateFramework(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFrameworkAsync(array $args = [])\n * @method \\Aws\\Result updateGlobalSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGlobalSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateRecoveryPointLifecycle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRecoveryPointLifecycleAsync(array $args = [])\n * @method \\Aws\\Result updateRegionSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRegionSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateReportPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateReportPlanAsync(array $args = [])\n */\nclass BackupClient extends AwsClient {}\n", "num_lines": 154}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Backup\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Backup** service.\n */\nclass BackupException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\BackupGateway;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Backup Gateway** service.\n * @method \\Aws\\Result associateGatewayToServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateGatewayToServerAsync(array $args = [])\n * @method \\Aws\\Result createGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGatewayAsync(array $args = [])\n * @method \\Aws\\Result deleteGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGatewayAsync(array $args = [])\n * @method \\Aws\\Result deleteHypervisor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHypervisorAsync(array $args = [])\n * @method \\Aws\\Result disassociateGatewayFromServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateGatewayFromServerAsync(array $args = [])\n * @method \\Aws\\Result getBandwidthRateLimitSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBandwidthRateLimitScheduleAsync(array $args = [])\n * @method \\Aws\\Result getGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGatewayAsync(array $args = [])\n * @method \\Aws\\Result getHypervisor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getHypervisorAsync(array $args = [])\n * @method \\Aws\\Result getHypervisorPropertyMappings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getHypervisorPropertyMappingsAsync(array $args = [])\n * @method \\Aws\\Result getVirtualMachine(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVirtualMachineAsync(array $args = [])\n * @method \\Aws\\Result importHypervisorConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importHypervisorConfigurationAsync(array $args = [])\n * @method \\Aws\\Result listGateways(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGatewaysAsync(array $args = [])\n * @method \\Aws\\Result listHypervisors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHypervisorsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listVirtualMachines(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVirtualMachinesAsync(array $args = [])\n * @method \\Aws\\Result putBandwidthRateLimitSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBandwidthRateLimitScheduleAsync(array $args = [])\n * @method \\Aws\\Result putHypervisorPropertyMappings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putHypervisorPropertyMappingsAsync(array $args = [])\n * @method \\Aws\\Result putMaintenanceStartTime(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putMaintenanceStartTimeAsync(array $args = [])\n * @method \\Aws\\Result startVirtualMachinesMetadataSync(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startVirtualMachinesMetadataSyncAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result testHypervisorConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testHypervisorConfigurationAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateGatewayInformation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGatewayInformationAsync(array $args = [])\n * @method \\Aws\\Result updateGatewaySoftwareNow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGatewaySoftwareNowAsync(array $args = [])\n * @method \\Aws\\Result updateHypervisor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateHypervisorAsync(array $args = [])\n */\nclass BackupGatewayClient extends AwsClient {}\n", "num_lines": 60}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\BackupGateway\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Backup Gateway** service.\n */\nclass BackupGatewayException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\BackupStorage;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Backup Storage** service.\n * @method \\Aws\\Result deleteObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteObjectAsync(array $args = [])\n * @method \\Aws\\Result getChunk(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChunkAsync(array $args = [])\n * @method \\Aws\\Result getObjectMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectMetadataAsync(array $args = [])\n * @method \\Aws\\Result listChunks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChunksAsync(array $args = [])\n * @method \\Aws\\Result listObjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listObjectsAsync(array $args = [])\n * @method \\Aws\\Result notifyObjectComplete(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise notifyObjectCompleteAsync(array $args = [])\n * @method \\Aws\\Result putChunk(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putChunkAsync(array $args = [])\n * @method \\Aws\\Result putObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putObjectAsync(array $args = [])\n * @method \\Aws\\Result startObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startObjectAsync(array $args = [])\n */\nclass BackupStorageClient extends AwsClient {}\n", "num_lines": 28}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\BackupStorage\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Backup Storage** service.\n */\nclass BackupStorageException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Batch;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Batch** service.\n * @method \\Aws\\Result cancelJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelJobAsync(array $args = [])\n * @method \\Aws\\Result createComputeEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createComputeEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result createJobQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createJobQueueAsync(array $args = [])\n * @method \\Aws\\Result createSchedulingPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSchedulingPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteComputeEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteComputeEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result deleteJobQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteJobQueueAsync(array $args = [])\n * @method \\Aws\\Result deleteSchedulingPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSchedulingPolicyAsync(array $args = [])\n * @method \\Aws\\Result deregisterJobDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterJobDefinitionAsync(array $args = [])\n * @method \\Aws\\Result describeComputeEnvironments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeComputeEnvironmentsAsync(array $args = [])\n * @method \\Aws\\Result describeJobDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJobDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result describeJobQueues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJobQueuesAsync(array $args = [])\n * @method \\Aws\\Result describeJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJobsAsync(array $args = [])\n * @method \\Aws\\Result describeSchedulingPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSchedulingPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobsAsync(array $args = [])\n * @method \\Aws\\Result listSchedulingPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSchedulingPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result registerJobDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerJobDefinitionAsync(array $args = [])\n * @method \\Aws\\Result submitJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise submitJobAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result terminateJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise terminateJobAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateComputeEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateComputeEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result updateJobQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateJobQueueAsync(array $args = [])\n * @method \\Aws\\Result updateSchedulingPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSchedulingPolicyAsync(array $args = [])\n */\nclass BatchClient extends AwsClient {}\n", "num_lines": 58}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Batch\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Batch** service.\n */\nclass BatchException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\BillingConductor;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWSBillingConductor** service.\n * @method \\Aws\\Result associateAccounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateAccountsAsync(array $args = [])\n * @method \\Aws\\Result associatePricingRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associatePricingRulesAsync(array $args = [])\n * @method \\Aws\\Result batchAssociateResourcesToCustomLineItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchAssociateResourcesToCustomLineItemAsync(array $args = [])\n * @method \\Aws\\Result batchDisassociateResourcesFromCustomLineItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDisassociateResourcesFromCustomLineItemAsync(array $args = [])\n * @method \\Aws\\Result createBillingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBillingGroupAsync(array $args = [])\n * @method \\Aws\\Result createCustomLineItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCustomLineItemAsync(array $args = [])\n * @method \\Aws\\Result createPricingPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPricingPlanAsync(array $args = [])\n * @method \\Aws\\Result createPricingRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPricingRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteBillingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBillingGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomLineItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomLineItemAsync(array $args = [])\n * @method \\Aws\\Result deletePricingPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePricingPlanAsync(array $args = [])\n * @method \\Aws\\Result deletePricingRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePricingRuleAsync(array $args = [])\n * @method \\Aws\\Result disassociateAccounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateAccountsAsync(array $args = [])\n * @method \\Aws\\Result disassociatePricingRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociatePricingRulesAsync(array $args = [])\n * @method \\Aws\\Result listAccountAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccountAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listBillingGroupCostReports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBillingGroupCostReportsAsync(array $args = [])\n * @method \\Aws\\Result listBillingGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBillingGroupsAsync(array $args = [])\n * @method \\Aws\\Result listCustomLineItemVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCustomLineItemVersionsAsync(array $args = [])\n * @method \\Aws\\Result listCustomLineItems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCustomLineItemsAsync(array $args = [])\n * @method \\Aws\\Result listPricingPlans(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPricingPlansAsync(array $args = [])\n * @method \\Aws\\Result listPricingPlansAssociatedWithPricingRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPricingPlansAssociatedWithPricingRuleAsync(array $args = [])\n * @method \\Aws\\Result listPricingRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPricingRulesAsync(array $args = [])\n * @method \\Aws\\Result listPricingRulesAssociatedToPricingPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPricingRulesAssociatedToPricingPlanAsync(array $args = [])\n * @method \\Aws\\Result listResourcesAssociatedToCustomLineItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourcesAssociatedToCustomLineItemAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateBillingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBillingGroupAsync(array $args = [])\n * @method \\Aws\\Result updateCustomLineItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCustomLineItemAsync(array $args = [])\n * @method \\Aws\\Result updatePricingPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePricingPlanAsync(array $args = [])\n * @method \\Aws\\Result updatePricingRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePricingRuleAsync(array $args = [])\n */\nclass BillingConductorClient extends AwsClient {}\n", "num_lines": 72}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\BillingConductor\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWSBillingConductor** service.\n */\nclass BillingConductorException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Braket;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Braket** service.\n * @method \\Aws\\Result cancelJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelJobAsync(array $args = [])\n * @method \\Aws\\Result cancelQuantumTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelQuantumTaskAsync(array $args = [])\n * @method \\Aws\\Result createJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createJobAsync(array $args = [])\n * @method \\Aws\\Result createQuantumTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createQuantumTaskAsync(array $args = [])\n * @method \\Aws\\Result getDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeviceAsync(array $args = [])\n * @method \\Aws\\Result getJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobAsync(array $args = [])\n * @method \\Aws\\Result getQuantumTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getQuantumTaskAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result searchDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchDevicesAsync(array $args = [])\n * @method \\Aws\\Result searchJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchJobsAsync(array $args = [])\n * @method \\Aws\\Result searchQuantumTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchQuantumTasksAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass BraketClient extends AwsClient {}\n", "num_lines": 36}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Braket\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Braket** service.\n */\nclass BraketException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Budgets;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Budgets** service.\n * @method \\Aws\\Result createBudget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBudgetAsync(array $args = [])\n * @method \\Aws\\Result createBudgetAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBudgetActionAsync(array $args = [])\n * @method \\Aws\\Result createNotification(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNotificationAsync(array $args = [])\n * @method \\Aws\\Result createSubscriber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSubscriberAsync(array $args = [])\n * @method \\Aws\\Result deleteBudget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBudgetAsync(array $args = [])\n * @method \\Aws\\Result deleteBudgetAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBudgetActionAsync(array $args = [])\n * @method \\Aws\\Result deleteNotification(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNotificationAsync(array $args = [])\n * @method \\Aws\\Result deleteSubscriber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSubscriberAsync(array $args = [])\n * @method \\Aws\\Result describeBudget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBudgetAsync(array $args = [])\n * @method \\Aws\\Result describeBudgetAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBudgetActionAsync(array $args = [])\n * @method \\Aws\\Result describeBudgetActionHistories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBudgetActionHistoriesAsync(array $args = [])\n * @method \\Aws\\Result describeBudgetActionsForAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBudgetActionsForAccountAsync(array $args = [])\n * @method \\Aws\\Result describeBudgetActionsForBudget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBudgetActionsForBudgetAsync(array $args = [])\n * @method \\Aws\\Result describeBudgetNotificationsForAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBudgetNotificationsForAccountAsync(array $args = [])\n * @method \\Aws\\Result describeBudgetPerformanceHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBudgetPerformanceHistoryAsync(array $args = [])\n * @method \\Aws\\Result describeBudgets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBudgetsAsync(array $args = [])\n * @method \\Aws\\Result describeNotificationsForBudget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNotificationsForBudgetAsync(array $args = [])\n * @method \\Aws\\Result describeSubscribersForNotification(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSubscribersForNotificationAsync(array $args = [])\n * @method \\Aws\\Result executeBudgetAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise executeBudgetActionAsync(array $args = [])\n * @method \\Aws\\Result updateBudget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBudgetAsync(array $args = [])\n * @method \\Aws\\Result updateBudgetAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBudgetActionAsync(array $args = [])\n * @method \\Aws\\Result updateNotification(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNotificationAsync(array $args = [])\n * @method \\Aws\\Result updateSubscriber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSubscriberAsync(array $args = [])\n */\nclass BudgetsClient extends AwsClient {}\n", "num_lines": 56}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Budgets\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Budgets** service.\n */\nclass BudgetsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Chime;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Chime** service.\n * @method \\Aws\\Result associatePhoneNumberWithUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associatePhoneNumberWithUserAsync(array $args = [])\n * @method \\Aws\\Result associatePhoneNumbersWithVoiceConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associatePhoneNumbersWithVoiceConnectorAsync(array $args = [])\n * @method \\Aws\\Result associatePhoneNumbersWithVoiceConnectorGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associatePhoneNumbersWithVoiceConnectorGroupAsync(array $args = [])\n * @method \\Aws\\Result associateSigninDelegateGroupsWithAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateSigninDelegateGroupsWithAccountAsync(array $args = [])\n * @method \\Aws\\Result batchCreateAttendee(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchCreateAttendeeAsync(array $args = [])\n * @method \\Aws\\Result batchCreateChannelMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchCreateChannelMembershipAsync(array $args = [])\n * @method \\Aws\\Result batchCreateRoomMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchCreateRoomMembershipAsync(array $args = [])\n * @method \\Aws\\Result batchDeletePhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeletePhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result batchSuspendUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchSuspendUserAsync(array $args = [])\n * @method \\Aws\\Result batchUnsuspendUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUnsuspendUserAsync(array $args = [])\n * @method \\Aws\\Result batchUpdatePhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdatePhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result batchUpdateUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdateUserAsync(array $args = [])\n * @method \\Aws\\Result createAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccountAsync(array $args = [])\n * @method \\Aws\\Result createAppInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppInstanceAsync(array $args = [])\n * @method \\Aws\\Result createAppInstanceAdmin(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppInstanceAdminAsync(array $args = [])\n * @method \\Aws\\Result createAppInstanceUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppInstanceUserAsync(array $args = [])\n * @method \\Aws\\Result createAttendee(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAttendeeAsync(array $args = [])\n * @method \\Aws\\Result createBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBotAsync(array $args = [])\n * @method \\Aws\\Result createChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelAsync(array $args = [])\n * @method \\Aws\\Result createChannelBan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelBanAsync(array $args = [])\n * @method \\Aws\\Result createChannelMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelMembershipAsync(array $args = [])\n * @method \\Aws\\Result createChannelModerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelModeratorAsync(array $args = [])\n * @method \\Aws\\Result createMediaCapturePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMediaCapturePipelineAsync(array $args = [])\n * @method \\Aws\\Result createMeeting(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMeetingAsync(array $args = [])\n * @method \\Aws\\Result createMeetingDialOut(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMeetingDialOutAsync(array $args = [])\n * @method \\Aws\\Result createMeetingWithAttendees(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMeetingWithAttendeesAsync(array $args = [])\n * @method \\Aws\\Result createPhoneNumberOrder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPhoneNumberOrderAsync(array $args = [])\n * @method \\Aws\\Result createProxySession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProxySessionAsync(array $args = [])\n * @method \\Aws\\Result createRoom(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRoomAsync(array $args = [])\n * @method \\Aws\\Result createRoomMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRoomMembershipAsync(array $args = [])\n * @method \\Aws\\Result createSipMediaApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSipMediaApplicationAsync(array $args = [])\n * @method \\Aws\\Result createSipMediaApplicationCall(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSipMediaApplicationCallAsync(array $args = [])\n * @method \\Aws\\Result createSipRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSipRuleAsync(array $args = [])\n * @method \\Aws\\Result createUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserAsync(array $args = [])\n * @method \\Aws\\Result createVoiceConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVoiceConnectorAsync(array $args = [])\n * @method \\Aws\\Result createVoiceConnectorGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVoiceConnectorGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccountAsync(array $args = [])\n * @method \\Aws\\Result deleteAppInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppInstanceAsync(array $args = [])\n * @method \\Aws\\Result deleteAppInstanceAdmin(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppInstanceAdminAsync(array $args = [])\n * @method \\Aws\\Result deleteAppInstanceStreamingConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppInstanceStreamingConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result deleteAppInstanceUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppInstanceUserAsync(array $args = [])\n * @method \\Aws\\Result deleteAttendee(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAttendeeAsync(array $args = [])\n * @method \\Aws\\Result deleteChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteChannelBan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelBanAsync(array $args = [])\n * @method \\Aws\\Result deleteChannelMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelMembershipAsync(array $args = [])\n * @method \\Aws\\Result deleteChannelMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelMessageAsync(array $args = [])\n * @method \\Aws\\Result deleteChannelModerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelModeratorAsync(array $args = [])\n * @method \\Aws\\Result deleteEventsConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventsConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteMediaCapturePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMediaCapturePipelineAsync(array $args = [])\n * @method \\Aws\\Result deleteMeeting(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMeetingAsync(array $args = [])\n * @method \\Aws\\Result deletePhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result deleteProxySession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProxySessionAsync(array $args = [])\n * @method \\Aws\\Result deleteRoom(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRoomAsync(array $args = [])\n * @method \\Aws\\Result deleteRoomMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRoomMembershipAsync(array $args = [])\n * @method \\Aws\\Result deleteSipMediaApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSipMediaApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteSipRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSipRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceConnectorAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceConnectorEmergencyCallingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceConnectorEmergencyCallingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceConnectorGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceConnectorGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceConnectorOrigination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceConnectorOriginationAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceConnectorProxy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceConnectorProxyAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceConnectorStreamingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceConnectorStreamingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceConnectorTermination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceConnectorTerminationAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceConnectorTerminationCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceConnectorTerminationCredentialsAsync(array $args = [])\n * @method \\Aws\\Result describeAppInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppInstanceAsync(array $args = [])\n * @method \\Aws\\Result describeAppInstanceAdmin(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppInstanceAdminAsync(array $args = [])\n * @method \\Aws\\Result describeAppInstanceUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppInstanceUserAsync(array $args = [])\n * @method \\Aws\\Result describeChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelAsync(array $args = [])\n * @method \\Aws\\Result describeChannelBan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelBanAsync(array $args = [])\n * @method \\Aws\\Result describeChannelMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelMembershipAsync(array $args = [])\n * @method \\Aws\\Result describeChannelMembershipForAppInstanceUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelMembershipForAppInstanceUserAsync(array $args = [])\n * @method \\Aws\\Result describeChannelModeratedByAppInstanceUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelModeratedByAppInstanceUserAsync(array $args = [])\n * @method \\Aws\\Result describeChannelModerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelModeratorAsync(array $args = [])\n * @method \\Aws\\Result disassociatePhoneNumberFromUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociatePhoneNumberFromUserAsync(array $args = [])\n * @method \\Aws\\Result disassociatePhoneNumbersFromVoiceConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociatePhoneNumbersFromVoiceConnectorAsync(array $args = [])\n * @method \\Aws\\Result disassociatePhoneNumbersFromVoiceConnectorGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociatePhoneNumbersFromVoiceConnectorGroupAsync(array $args = [])\n * @method \\Aws\\Result disassociateSigninDelegateGroupsFromAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateSigninDelegateGroupsFromAccountAsync(array $args = [])\n * @method \\Aws\\Result getAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountAsync(array $args = [])\n * @method \\Aws\\Result getAccountSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountSettingsAsync(array $args = [])\n * @method \\Aws\\Result getAppInstanceRetentionSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppInstanceRetentionSettingsAsync(array $args = [])\n * @method \\Aws\\Result getAppInstanceStreamingConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppInstanceStreamingConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result getAttendee(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAttendeeAsync(array $args = [])\n * @method \\Aws\\Result getBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBotAsync(array $args = [])\n * @method \\Aws\\Result getChannelMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChannelMessageAsync(array $args = [])\n * @method \\Aws\\Result getEventsConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEventsConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getGlobalSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGlobalSettingsAsync(array $args = [])\n * @method \\Aws\\Result getMediaCapturePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMediaCapturePipelineAsync(array $args = [])\n * @method \\Aws\\Result getMeeting(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMeetingAsync(array $args = [])\n * @method \\Aws\\Result getMessagingSessionEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMessagingSessionEndpointAsync(array $args = [])\n * @method \\Aws\\Result getPhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result getPhoneNumberOrder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPhoneNumberOrderAsync(array $args = [])\n * @method \\Aws\\Result getPhoneNumberSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPhoneNumberSettingsAsync(array $args = [])\n * @method \\Aws\\Result getProxySession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProxySessionAsync(array $args = [])\n * @method \\Aws\\Result getRetentionSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRetentionSettingsAsync(array $args = [])\n * @method \\Aws\\Result getRoom(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRoomAsync(array $args = [])\n * @method \\Aws\\Result getSipMediaApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSipMediaApplicationAsync(array $args = [])\n * @method \\Aws\\Result getSipMediaApplicationLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSipMediaApplicationLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getSipRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSipRuleAsync(array $args = [])\n * @method \\Aws\\Result getUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUserAsync(array $args = [])\n * @method \\Aws\\Result getUserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUserSettingsAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnectorEmergencyCallingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorEmergencyCallingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnectorGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorGroupAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnectorLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnectorOrigination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorOriginationAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnectorProxy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorProxyAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnectorStreamingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorStreamingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnectorTermination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorTerminationAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnectorTerminationHealth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorTerminationHealthAsync(array $args = [])\n * @method \\Aws\\Result inviteUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise inviteUsersAsync(array $args = [])\n * @method \\Aws\\Result listAccounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccountsAsync(array $args = [])\n * @method \\Aws\\Result listAppInstanceAdmins(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppInstanceAdminsAsync(array $args = [])\n * @method \\Aws\\Result listAppInstanceUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppInstanceUsersAsync(array $args = [])\n * @method \\Aws\\Result listAppInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppInstancesAsync(array $args = [])\n * @method \\Aws\\Result listAttendeeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAttendeeTagsAsync(array $args = [])\n * @method \\Aws\\Result listAttendees(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAttendeesAsync(array $args = [])\n * @method \\Aws\\Result listBots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBotsAsync(array $args = [])\n * @method \\Aws\\Result listChannelBans(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelBansAsync(array $args = [])\n * @method \\Aws\\Result listChannelMemberships(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelMembershipsAsync(array $args = [])\n * @method \\Aws\\Result listChannelMembershipsForAppInstanceUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelMembershipsForAppInstanceUserAsync(array $args = [])\n * @method \\Aws\\Result listChannelMessages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelMessagesAsync(array $args = [])\n * @method \\Aws\\Result listChannelModerators(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelModeratorsAsync(array $args = [])\n * @method \\Aws\\Result listChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelsAsync(array $args = [])\n * @method \\Aws\\Result listChannelsModeratedByAppInstanceUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelsModeratedByAppInstanceUserAsync(array $args = [])\n * @method \\Aws\\Result listMediaCapturePipelines(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMediaCapturePipelinesAsync(array $args = [])\n * @method \\Aws\\Result listMeetingTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMeetingTagsAsync(array $args = [])\n * @method \\Aws\\Result listMeetings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMeetingsAsync(array $args = [])\n * @method \\Aws\\Result listPhoneNumberOrders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPhoneNumberOrdersAsync(array $args = [])\n * @method \\Aws\\Result listPhoneNumbers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPhoneNumbersAsync(array $args = [])\n * @method \\Aws\\Result listProxySessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProxySessionsAsync(array $args = [])\n * @method \\Aws\\Result listRoomMemberships(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRoomMembershipsAsync(array $args = [])\n * @method \\Aws\\Result listRooms(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRoomsAsync(array $args = [])\n * @method \\Aws\\Result listSipMediaApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSipMediaApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listSipRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSipRulesAsync(array $args = [])\n * @method \\Aws\\Result listSupportedPhoneNumberCountries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSupportedPhoneNumberCountriesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUsersAsync(array $args = [])\n * @method \\Aws\\Result listVoiceConnectorGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVoiceConnectorGroupsAsync(array $args = [])\n * @method \\Aws\\Result listVoiceConnectorTerminationCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVoiceConnectorTerminationCredentialsAsync(array $args = [])\n * @method \\Aws\\Result listVoiceConnectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVoiceConnectorsAsync(array $args = [])\n * @method \\Aws\\Result logoutUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise logoutUserAsync(array $args = [])\n * @method \\Aws\\Result putAppInstanceRetentionSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAppInstanceRetentionSettingsAsync(array $args = [])\n * @method \\Aws\\Result putAppInstanceStreamingConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAppInstanceStreamingConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result putEventsConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEventsConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putRetentionSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRetentionSettingsAsync(array $args = [])\n * @method \\Aws\\Result putSipMediaApplicationLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSipMediaApplicationLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putVoiceConnectorEmergencyCallingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putVoiceConnectorEmergencyCallingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putVoiceConnectorLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putVoiceConnectorLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putVoiceConnectorOrigination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putVoiceConnectorOriginationAsync(array $args = [])\n * @method \\Aws\\Result putVoiceConnectorProxy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putVoiceConnectorProxyAsync(array $args = [])\n * @method \\Aws\\Result putVoiceConnectorStreamingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putVoiceConnectorStreamingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putVoiceConnectorTermination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putVoiceConnectorTerminationAsync(array $args = [])\n * @method \\Aws\\Result putVoiceConnectorTerminationCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putVoiceConnectorTerminationCredentialsAsync(array $args = [])\n * @method \\Aws\\Result redactChannelMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise redactChannelMessageAsync(array $args = [])\n * @method \\Aws\\Result redactConversationMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise redactConversationMessageAsync(array $args = [])\n * @method \\Aws\\Result redactRoomMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise redactRoomMessageAsync(array $args = [])\n * @method \\Aws\\Result regenerateSecurityToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise regenerateSecurityTokenAsync(array $args = [])\n * @method \\Aws\\Result resetPersonalPIN(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetPersonalPINAsync(array $args = [])\n * @method \\Aws\\Result restorePhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restorePhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result searchAvailablePhoneNumbers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchAvailablePhoneNumbersAsync(array $args = [])\n * @method \\Aws\\Result sendChannelMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendChannelMessageAsync(array $args = [])\n * @method \\Aws\\Result startMeetingTranscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMeetingTranscriptionAsync(array $args = [])\n * @method \\Aws\\Result stopMeetingTranscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopMeetingTranscriptionAsync(array $args = [])\n * @method \\Aws\\Result tagAttendee(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagAttendeeAsync(array $args = [])\n * @method \\Aws\\Result tagMeeting(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagMeetingAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagAttendee(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagAttendeeAsync(array $args = [])\n * @method \\Aws\\Result untagMeeting(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagMeetingAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccountAsync(array $args = [])\n * @method \\Aws\\Result updateAccountSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccountSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateAppInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppInstanceAsync(array $args = [])\n * @method \\Aws\\Result updateAppInstanceUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppInstanceUserAsync(array $args = [])\n * @method \\Aws\\Result updateBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBotAsync(array $args = [])\n * @method \\Aws\\Result updateChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChannelAsync(array $args = [])\n * @method \\Aws\\Result updateChannelMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChannelMessageAsync(array $args = [])\n * @method \\Aws\\Result updateChannelReadMarker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChannelReadMarkerAsync(array $args = [])\n * @method \\Aws\\Result updateGlobalSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGlobalSettingsAsync(array $args = [])\n * @method \\Aws\\Result updatePhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result updatePhoneNumberSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePhoneNumberSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateProxySession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProxySessionAsync(array $args = [])\n * @method \\Aws\\Result updateRoom(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRoomAsync(array $args = [])\n * @method \\Aws\\Result updateRoomMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRoomMembershipAsync(array $args = [])\n * @method \\Aws\\Result updateSipMediaApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSipMediaApplicationAsync(array $args = [])\n * @method \\Aws\\Result updateSipMediaApplicationCall(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSipMediaApplicationCallAsync(array $args = [])\n * @method \\Aws\\Result updateSipRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSipRuleAsync(array $args = [])\n * @method \\Aws\\Result updateUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserAsync(array $args = [])\n * @method \\Aws\\Result updateUserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateVoiceConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVoiceConnectorAsync(array $args = [])\n * @method \\Aws\\Result updateVoiceConnectorGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVoiceConnectorGroupAsync(array $args = [])\n * @method \\Aws\\Result validateE911Address(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise validateE911AddressAsync(array $args = [])\n */\nclass ChimeClient extends AwsClient {}\n", "num_lines": 392}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Chime\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Chime** service.\n */\nclass ChimeException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ChimeSDKIdentity;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Chime SDK Identity** service.\n * @method \\Aws\\Result createAppInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppInstanceAsync(array $args = [])\n * @method \\Aws\\Result createAppInstanceAdmin(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppInstanceAdminAsync(array $args = [])\n * @method \\Aws\\Result createAppInstanceBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppInstanceBotAsync(array $args = [])\n * @method \\Aws\\Result createAppInstanceUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppInstanceUserAsync(array $args = [])\n * @method \\Aws\\Result deleteAppInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppInstanceAsync(array $args = [])\n * @method \\Aws\\Result deleteAppInstanceAdmin(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppInstanceAdminAsync(array $args = [])\n * @method \\Aws\\Result deleteAppInstanceBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppInstanceBotAsync(array $args = [])\n * @method \\Aws\\Result deleteAppInstanceUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppInstanceUserAsync(array $args = [])\n * @method \\Aws\\Result deregisterAppInstanceUserEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterAppInstanceUserEndpointAsync(array $args = [])\n * @method \\Aws\\Result describeAppInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppInstanceAsync(array $args = [])\n * @method \\Aws\\Result describeAppInstanceAdmin(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppInstanceAdminAsync(array $args = [])\n * @method \\Aws\\Result describeAppInstanceBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppInstanceBotAsync(array $args = [])\n * @method \\Aws\\Result describeAppInstanceUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppInstanceUserAsync(array $args = [])\n * @method \\Aws\\Result describeAppInstanceUserEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppInstanceUserEndpointAsync(array $args = [])\n * @method \\Aws\\Result getAppInstanceRetentionSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppInstanceRetentionSettingsAsync(array $args = [])\n * @method \\Aws\\Result listAppInstanceAdmins(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppInstanceAdminsAsync(array $args = [])\n * @method \\Aws\\Result listAppInstanceBots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppInstanceBotsAsync(array $args = [])\n * @method \\Aws\\Result listAppInstanceUserEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppInstanceUserEndpointsAsync(array $args = [])\n * @method \\Aws\\Result listAppInstanceUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppInstanceUsersAsync(array $args = [])\n * @method \\Aws\\Result listAppInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppInstancesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putAppInstanceRetentionSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAppInstanceRetentionSettingsAsync(array $args = [])\n * @method \\Aws\\Result putAppInstanceUserExpirationSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAppInstanceUserExpirationSettingsAsync(array $args = [])\n * @method \\Aws\\Result registerAppInstanceUserEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerAppInstanceUserEndpointAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAppInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppInstanceAsync(array $args = [])\n * @method \\Aws\\Result updateAppInstanceBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppInstanceBotAsync(array $args = [])\n * @method \\Aws\\Result updateAppInstanceUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppInstanceUserAsync(array $args = [])\n * @method \\Aws\\Result updateAppInstanceUserEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppInstanceUserEndpointAsync(array $args = [])\n */\nclass ChimeSDKIdentityClient extends AwsClient {}\n", "num_lines": 70}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ChimeSDKIdentity\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Chime SDK Identity** service.\n */\nclass ChimeSDKIdentityException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ChimeSDKMediaPipelines;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Chime SDK Media Pipelines** service.\n * @method \\Aws\\Result createMediaCapturePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMediaCapturePipelineAsync(array $args = [])\n * @method \\Aws\\Result createMediaConcatenationPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMediaConcatenationPipelineAsync(array $args = [])\n * @method \\Aws\\Result createMediaInsightsPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMediaInsightsPipelineAsync(array $args = [])\n * @method \\Aws\\Result createMediaInsightsPipelineConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMediaInsightsPipelineConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createMediaLiveConnectorPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMediaLiveConnectorPipelineAsync(array $args = [])\n * @method \\Aws\\Result deleteMediaCapturePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMediaCapturePipelineAsync(array $args = [])\n * @method \\Aws\\Result deleteMediaInsightsPipelineConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMediaInsightsPipelineConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteMediaPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMediaPipelineAsync(array $args = [])\n * @method \\Aws\\Result getMediaCapturePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMediaCapturePipelineAsync(array $args = [])\n * @method \\Aws\\Result getMediaInsightsPipelineConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMediaInsightsPipelineConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getMediaPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMediaPipelineAsync(array $args = [])\n * @method \\Aws\\Result listMediaCapturePipelines(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMediaCapturePipelinesAsync(array $args = [])\n * @method \\Aws\\Result listMediaInsightsPipelineConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMediaInsightsPipelineConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listMediaPipelines(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMediaPipelinesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateMediaInsightsPipelineConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMediaInsightsPipelineConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateMediaInsightsPipelineStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMediaInsightsPipelineStatusAsync(array $args = [])\n */\nclass ChimeSDKMediaPipelinesClient extends AwsClient {}\n", "num_lines": 48}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ChimeSDKMediaPipelines\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Chime SDK Media Pipelines** service.\n */\nclass ChimeSDKMediaPipelinesException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ChimeSDKMeetings;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Chime SDK Meetings** service.\n * @method \\Aws\\Result batchCreateAttendee(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchCreateAttendeeAsync(array $args = [])\n * @method \\Aws\\Result batchUpdateAttendeeCapabilitiesExcept(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdateAttendeeCapabilitiesExceptAsync(array $args = [])\n * @method \\Aws\\Result createAttendee(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAttendeeAsync(array $args = [])\n * @method \\Aws\\Result createMeeting(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMeetingAsync(array $args = [])\n * @method \\Aws\\Result createMeetingWithAttendees(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMeetingWithAttendeesAsync(array $args = [])\n * @method \\Aws\\Result deleteAttendee(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAttendeeAsync(array $args = [])\n * @method \\Aws\\Result deleteMeeting(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMeetingAsync(array $args = [])\n * @method \\Aws\\Result getAttendee(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAttendeeAsync(array $args = [])\n * @method \\Aws\\Result getMeeting(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMeetingAsync(array $args = [])\n * @method \\Aws\\Result listAttendees(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAttendeesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startMeetingTranscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMeetingTranscriptionAsync(array $args = [])\n * @method \\Aws\\Result stopMeetingTranscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopMeetingTranscriptionAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAttendeeCapabilities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAttendeeCapabilitiesAsync(array $args = [])\n */\nclass ChimeSDKMeetingsClient extends AwsClient {}\n", "num_lines": 42}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ChimeSDKMeetings\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Chime SDK Meetings** service.\n */\nclass ChimeSDKMeetingsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ChimeSDKMessaging;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Chime SDK Messaging** service.\n * @method \\Aws\\Result associateChannelFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateChannelFlowAsync(array $args = [])\n * @method \\Aws\\Result batchCreateChannelMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchCreateChannelMembershipAsync(array $args = [])\n * @method \\Aws\\Result channelFlowCallback(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise channelFlowCallbackAsync(array $args = [])\n * @method \\Aws\\Result createChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelAsync(array $args = [])\n * @method \\Aws\\Result createChannelBan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelBanAsync(array $args = [])\n * @method \\Aws\\Result createChannelFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelFlowAsync(array $args = [])\n * @method \\Aws\\Result createChannelMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelMembershipAsync(array $args = [])\n * @method \\Aws\\Result createChannelModerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelModeratorAsync(array $args = [])\n * @method \\Aws\\Result deleteChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteChannelBan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelBanAsync(array $args = [])\n * @method \\Aws\\Result deleteChannelFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelFlowAsync(array $args = [])\n * @method \\Aws\\Result deleteChannelMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelMembershipAsync(array $args = [])\n * @method \\Aws\\Result deleteChannelMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelMessageAsync(array $args = [])\n * @method \\Aws\\Result deleteChannelModerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelModeratorAsync(array $args = [])\n * @method \\Aws\\Result deleteMessagingStreamingConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMessagingStreamingConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result describeChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelAsync(array $args = [])\n * @method \\Aws\\Result describeChannelBan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelBanAsync(array $args = [])\n * @method \\Aws\\Result describeChannelFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelFlowAsync(array $args = [])\n * @method \\Aws\\Result describeChannelMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelMembershipAsync(array $args = [])\n * @method \\Aws\\Result describeChannelMembershipForAppInstanceUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelMembershipForAppInstanceUserAsync(array $args = [])\n * @method \\Aws\\Result describeChannelModeratedByAppInstanceUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelModeratedByAppInstanceUserAsync(array $args = [])\n * @method \\Aws\\Result describeChannelModerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelModeratorAsync(array $args = [])\n * @method \\Aws\\Result disassociateChannelFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateChannelFlowAsync(array $args = [])\n * @method \\Aws\\Result getChannelMembershipPreferences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChannelMembershipPreferencesAsync(array $args = [])\n * @method \\Aws\\Result getChannelMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChannelMessageAsync(array $args = [])\n * @method \\Aws\\Result getChannelMessageStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChannelMessageStatusAsync(array $args = [])\n * @method \\Aws\\Result getMessagingSessionEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMessagingSessionEndpointAsync(array $args = [])\n * @method \\Aws\\Result getMessagingStreamingConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMessagingStreamingConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listChannelBans(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelBansAsync(array $args = [])\n * @method \\Aws\\Result listChannelFlows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelFlowsAsync(array $args = [])\n * @method \\Aws\\Result listChannelMemberships(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelMembershipsAsync(array $args = [])\n * @method \\Aws\\Result listChannelMembershipsForAppInstanceUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelMembershipsForAppInstanceUserAsync(array $args = [])\n * @method \\Aws\\Result listChannelMessages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelMessagesAsync(array $args = [])\n * @method \\Aws\\Result listChannelModerators(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelModeratorsAsync(array $args = [])\n * @method \\Aws\\Result listChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelsAsync(array $args = [])\n * @method \\Aws\\Result listChannelsAssociatedWithChannelFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelsAssociatedWithChannelFlowAsync(array $args = [])\n * @method \\Aws\\Result listChannelsModeratedByAppInstanceUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelsModeratedByAppInstanceUserAsync(array $args = [])\n * @method \\Aws\\Result listSubChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSubChannelsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putChannelExpirationSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putChannelExpirationSettingsAsync(array $args = [])\n * @method \\Aws\\Result putChannelMembershipPreferences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putChannelMembershipPreferencesAsync(array $args = [])\n * @method \\Aws\\Result putMessagingStreamingConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putMessagingStreamingConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result redactChannelMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise redactChannelMessageAsync(array $args = [])\n * @method \\Aws\\Result searchChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchChannelsAsync(array $args = [])\n * @method \\Aws\\Result sendChannelMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendChannelMessageAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChannelAsync(array $args = [])\n * @method \\Aws\\Result updateChannelFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChannelFlowAsync(array $args = [])\n * @method \\Aws\\Result updateChannelMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChannelMessageAsync(array $args = [])\n * @method \\Aws\\Result updateChannelReadMarker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChannelReadMarkerAsync(array $args = [])\n */\nclass ChimeSDKMessagingClient extends AwsClient {}\n", "num_lines": 112}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ChimeSDKMessaging\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Chime SDK Messaging** service.\n */\nclass ChimeSDKMessagingException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ChimeSDKVoice;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Chime SDK Voice** service.\n * @method \\Aws\\Result associatePhoneNumbersWithVoiceConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associatePhoneNumbersWithVoiceConnectorAsync(array $args = [])\n * @method \\Aws\\Result associatePhoneNumbersWithVoiceConnectorGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associatePhoneNumbersWithVoiceConnectorGroupAsync(array $args = [])\n * @method \\Aws\\Result batchDeletePhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeletePhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result batchUpdatePhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdatePhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result createPhoneNumberOrder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPhoneNumberOrderAsync(array $args = [])\n * @method \\Aws\\Result createProxySession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProxySessionAsync(array $args = [])\n * @method \\Aws\\Result createSipMediaApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSipMediaApplicationAsync(array $args = [])\n * @method \\Aws\\Result createSipMediaApplicationCall(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSipMediaApplicationCallAsync(array $args = [])\n * @method \\Aws\\Result createSipRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSipRuleAsync(array $args = [])\n * @method \\Aws\\Result createVoiceConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVoiceConnectorAsync(array $args = [])\n * @method \\Aws\\Result createVoiceConnectorGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVoiceConnectorGroupAsync(array $args = [])\n * @method \\Aws\\Result createVoiceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVoiceProfileAsync(array $args = [])\n * @method \\Aws\\Result createVoiceProfileDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVoiceProfileDomainAsync(array $args = [])\n * @method \\Aws\\Result deletePhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result deleteProxySession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProxySessionAsync(array $args = [])\n * @method \\Aws\\Result deleteSipMediaApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSipMediaApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteSipRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSipRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceConnectorAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceConnectorEmergencyCallingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceConnectorEmergencyCallingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceConnectorGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceConnectorGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceConnectorOrigination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceConnectorOriginationAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceConnectorProxy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceConnectorProxyAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceConnectorStreamingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceConnectorStreamingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceConnectorTermination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceConnectorTerminationAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceConnectorTerminationCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceConnectorTerminationCredentialsAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceProfileDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceProfileDomainAsync(array $args = [])\n * @method \\Aws\\Result disassociatePhoneNumbersFromVoiceConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociatePhoneNumbersFromVoiceConnectorAsync(array $args = [])\n * @method \\Aws\\Result disassociatePhoneNumbersFromVoiceConnectorGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociatePhoneNumbersFromVoiceConnectorGroupAsync(array $args = [])\n * @method \\Aws\\Result getGlobalSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGlobalSettingsAsync(array $args = [])\n * @method \\Aws\\Result getPhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result getPhoneNumberOrder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPhoneNumberOrderAsync(array $args = [])\n * @method \\Aws\\Result getPhoneNumberSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPhoneNumberSettingsAsync(array $args = [])\n * @method \\Aws\\Result getProxySession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProxySessionAsync(array $args = [])\n * @method \\Aws\\Result getSipMediaApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSipMediaApplicationAsync(array $args = [])\n * @method \\Aws\\Result getSipMediaApplicationAlexaSkillConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSipMediaApplicationAlexaSkillConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getSipMediaApplicationLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSipMediaApplicationLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getSipRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSipRuleAsync(array $args = [])\n * @method \\Aws\\Result getSpeakerSearchTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSpeakerSearchTaskAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnectorEmergencyCallingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorEmergencyCallingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnectorGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorGroupAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnectorLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnectorOrigination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorOriginationAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnectorProxy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorProxyAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnectorStreamingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorStreamingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnectorTermination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorTerminationAsync(array $args = [])\n * @method \\Aws\\Result getVoiceConnectorTerminationHealth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceConnectorTerminationHealthAsync(array $args = [])\n * @method \\Aws\\Result getVoiceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceProfileAsync(array $args = [])\n * @method \\Aws\\Result getVoiceProfileDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceProfileDomainAsync(array $args = [])\n * @method \\Aws\\Result getVoiceToneAnalysisTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceToneAnalysisTaskAsync(array $args = [])\n * @method \\Aws\\Result listAvailableVoiceConnectorRegions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAvailableVoiceConnectorRegionsAsync(array $args = [])\n * @method \\Aws\\Result listPhoneNumberOrders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPhoneNumberOrdersAsync(array $args = [])\n * @method \\Aws\\Result listPhoneNumbers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPhoneNumbersAsync(array $args = [])\n * @method \\Aws\\Result listProxySessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProxySessionsAsync(array $args = [])\n * @method \\Aws\\Result listSipMediaApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSipMediaApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listSipRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSipRulesAsync(array $args = [])\n * @method \\Aws\\Result listSupportedPhoneNumberCountries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSupportedPhoneNumberCountriesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listVoiceConnectorGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVoiceConnectorGroupsAsync(array $args = [])\n * @method \\Aws\\Result listVoiceConnectorTerminationCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVoiceConnectorTerminationCredentialsAsync(array $args = [])\n * @method \\Aws\\Result listVoiceConnectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVoiceConnectorsAsync(array $args = [])\n * @method \\Aws\\Result listVoiceProfileDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVoiceProfileDomainsAsync(array $args = [])\n * @method \\Aws\\Result listVoiceProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVoiceProfilesAsync(array $args = [])\n * @method \\Aws\\Result putSipMediaApplicationAlexaSkillConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSipMediaApplicationAlexaSkillConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putSipMediaApplicationLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSipMediaApplicationLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putVoiceConnectorEmergencyCallingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putVoiceConnectorEmergencyCallingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putVoiceConnectorLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putVoiceConnectorLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putVoiceConnectorOrigination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putVoiceConnectorOriginationAsync(array $args = [])\n * @method \\Aws\\Result putVoiceConnectorProxy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putVoiceConnectorProxyAsync(array $args = [])\n * @method \\Aws\\Result putVoiceConnectorStreamingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putVoiceConnectorStreamingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putVoiceConnectorTermination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putVoiceConnectorTerminationAsync(array $args = [])\n * @method \\Aws\\Result putVoiceConnectorTerminationCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putVoiceConnectorTerminationCredentialsAsync(array $args = [])\n * @method \\Aws\\Result restorePhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restorePhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result searchAvailablePhoneNumbers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchAvailablePhoneNumbersAsync(array $args = [])\n * @method \\Aws\\Result startSpeakerSearchTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSpeakerSearchTaskAsync(array $args = [])\n * @method \\Aws\\Result startVoiceToneAnalysisTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startVoiceToneAnalysisTaskAsync(array $args = [])\n * @method \\Aws\\Result stopSpeakerSearchTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopSpeakerSearchTaskAsync(array $args = [])\n * @method \\Aws\\Result stopVoiceToneAnalysisTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopVoiceToneAnalysisTaskAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateGlobalSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGlobalSettingsAsync(array $args = [])\n * @method \\Aws\\Result updatePhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result updatePhoneNumberSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePhoneNumberSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateProxySession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProxySessionAsync(array $args = [])\n * @method \\Aws\\Result updateSipMediaApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSipMediaApplicationAsync(array $args = [])\n * @method \\Aws\\Result updateSipMediaApplicationCall(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSipMediaApplicationCallAsync(array $args = [])\n * @method \\Aws\\Result updateSipRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSipRuleAsync(array $args = [])\n * @method \\Aws\\Result updateVoiceConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVoiceConnectorAsync(array $args = [])\n * @method \\Aws\\Result updateVoiceConnectorGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVoiceConnectorGroupAsync(array $args = [])\n * @method \\Aws\\Result updateVoiceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVoiceProfileAsync(array $args = [])\n * @method \\Aws\\Result updateVoiceProfileDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVoiceProfileDomainAsync(array $args = [])\n * @method \\Aws\\Result validateE911Address(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise validateE911AddressAsync(array $args = [])\n */\nclass ChimeSDKVoiceClient extends AwsClient {}\n", "num_lines": 196}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ChimeSDKVoice\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Chime SDK Voice** service.\n */\nclass ChimeSDKVoiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CleanRooms;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Clean Rooms Service** service.\n * @method \\Aws\\Result batchGetSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetSchemaAsync(array $args = [])\n * @method \\Aws\\Result createCollaboration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCollaborationAsync(array $args = [])\n * @method \\Aws\\Result createConfiguredTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfiguredTableAsync(array $args = [])\n * @method \\Aws\\Result createConfiguredTableAnalysisRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfiguredTableAnalysisRuleAsync(array $args = [])\n * @method \\Aws\\Result createConfiguredTableAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfiguredTableAssociationAsync(array $args = [])\n * @method \\Aws\\Result createMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMembershipAsync(array $args = [])\n * @method \\Aws\\Result deleteCollaboration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCollaborationAsync(array $args = [])\n * @method \\Aws\\Result deleteConfiguredTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfiguredTableAsync(array $args = [])\n * @method \\Aws\\Result deleteConfiguredTableAnalysisRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfiguredTableAnalysisRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteConfiguredTableAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfiguredTableAssociationAsync(array $args = [])\n * @method \\Aws\\Result deleteMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMemberAsync(array $args = [])\n * @method \\Aws\\Result deleteMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMembershipAsync(array $args = [])\n * @method \\Aws\\Result getCollaboration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCollaborationAsync(array $args = [])\n * @method \\Aws\\Result getConfiguredTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConfiguredTableAsync(array $args = [])\n * @method \\Aws\\Result getConfiguredTableAnalysisRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConfiguredTableAnalysisRuleAsync(array $args = [])\n * @method \\Aws\\Result getConfiguredTableAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConfiguredTableAssociationAsync(array $args = [])\n * @method \\Aws\\Result getMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMembershipAsync(array $args = [])\n * @method \\Aws\\Result getProtectedQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProtectedQueryAsync(array $args = [])\n * @method \\Aws\\Result getSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSchemaAsync(array $args = [])\n * @method \\Aws\\Result getSchemaAnalysisRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSchemaAnalysisRuleAsync(array $args = [])\n * @method \\Aws\\Result listCollaborations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCollaborationsAsync(array $args = [])\n * @method \\Aws\\Result listConfiguredTableAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConfiguredTableAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listConfiguredTables(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConfiguredTablesAsync(array $args = [])\n * @method \\Aws\\Result listMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMembersAsync(array $args = [])\n * @method \\Aws\\Result listMemberships(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMembershipsAsync(array $args = [])\n * @method \\Aws\\Result listProtectedQueries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProtectedQueriesAsync(array $args = [])\n * @method \\Aws\\Result listSchemas(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSchemasAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startProtectedQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startProtectedQueryAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateCollaboration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCollaborationAsync(array $args = [])\n * @method \\Aws\\Result updateConfiguredTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConfiguredTableAsync(array $args = [])\n * @method \\Aws\\Result updateConfiguredTableAnalysisRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConfiguredTableAnalysisRuleAsync(array $args = [])\n * @method \\Aws\\Result updateConfiguredTableAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConfiguredTableAssociationAsync(array $args = [])\n * @method \\Aws\\Result updateMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMembershipAsync(array $args = [])\n * @method \\Aws\\Result updateProtectedQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProtectedQueryAsync(array $args = [])\n */\nclass CleanRoomsClient extends AwsClient {}\n", "num_lines": 84}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CleanRooms\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Clean Rooms Service** service.\n */\nclass CleanRoomsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\ClientSideMonitoring;\n\nuse Aws\\CommandInterface;\nuse Aws\\Exception\\AwsException;\nuse Aws\\MonitoringEventsInterface;\nuse Aws\\ResponseContainerInterface;\nuse Aws\\ResultInterface;\nuse GuzzleHttp\\Promise;\nuse Psr\\Http\\Message\\RequestInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\n\n/**\n * @internal\n */\nabstract class AbstractMonitoringMiddleware\n    implements MonitoringMiddlewareInterface\n{\n    private static $socket;\n\n    private $nextHandler;\n    private $options;\n    protected $credentialProvider;\n    protected $region;\n    protected $service;\n\n    protected static function getAwsExceptionHeader(AwsException $e, $headerName)\n    {\n        $response = $e->getResponse();\n        if ($response !== null) {\n            $header = $response->getHeader($headerName);\n            if (!empty($header[0])) {\n                return $header[0];\n            }\n        }\n        return null;\n    }\n\n    protected static function getResultHeader(ResultInterface $result, $headerName)\n    {\n        if (isset($result['@metadata']['headers'][$headerName])) {\n            return $result['@metadata']['headers'][$headerName];\n        }\n        return null;\n    }\n\n    protected static function getExceptionHeader(\\Exception $e, $headerName)\n    {\n        if ($e instanceof ResponseContainerInterface) {\n            $response = $e->getResponse();\n            if ($response instanceof ResponseInterface) {\n                $header = $response->getHeader($headerName);\n                if (!empty($header[0])) {\n                    return $header[0];\n                }\n            }\n        }\n        return null;\n    }\n\n    /**\n     * Constructor stores the passed in handler and options.\n     *\n     * @param callable $handler\n     * @param callable $credentialProvider\n     * @param $options\n     * @param $region\n     * @param $service\n     */\n    public function __construct(\n        callable $handler,\n        callable $credentialProvider,\n        $options,\n        $region,\n        $service\n    ) {\n        $this->nextHandler = $handler;\n        $this->credentialProvider = $credentialProvider;\n        $this->options = $options;\n        $this->region = $region;\n        $this->service = $service;\n    }\n\n    /**\n     * Standard invoke pattern for middleware execution to be implemented by\n     * child classes.\n     *\n     * @param  CommandInterface $cmd\n     * @param  RequestInterface $request\n     * @return Promise\\PromiseInterface\n     */\n    public function __invoke(CommandInterface $cmd, RequestInterface $request)\n    {\n        $handler = $this->nextHandler;\n        $eventData = null;\n        $enabled = $this->isEnabled();\n\n        if ($enabled) {\n            $cmd['@http']['collect_stats'] = true;\n            $eventData = $this->populateRequestEventData(\n                $cmd,\n                $request,\n                $this->getNewEvent($cmd, $request)\n            );\n        }\n\n        $g = function ($value) use ($eventData, $enabled) {\n            if ($enabled) {\n                $eventData = $this->populateResultEventData(\n                    $value,\n                    $eventData\n                );\n                $this->sendEventData($eventData);\n\n                if ($value instanceof MonitoringEventsInterface) {\n                    $value->appendMonitoringEvent($eventData);\n                }\n            }\n            if ($value instanceof \\Exception || $value instanceof \\Throwable) {\n                return Promise\\Create::rejectionFor($value);\n            }\n            return $value;\n        };\n\n        return Promise\\Create::promiseFor($handler($cmd, $request))->then($g, $g);\n    }\n\n    private function getClientId()\n    {\n        return $this->unwrappedOptions()->getClientId();\n    }\n\n    private function getNewEvent(\n        CommandInterface $cmd,\n        RequestInterface $request\n    ) {\n        $event = [\n            'Api' => $cmd->getName(),\n            'ClientId' => $this->getClientId(),\n            'Region' => $this->getRegion(),\n            'Service' => $this->getService(),\n            'Timestamp' => (int) floor(microtime(true) * 1000),\n            'UserAgent' => substr(\n                $request->getHeaderLine('User-Agent') . ' ' . \\Aws\\default_user_agent(),\n                0,\n                256\n            ),\n            'Version' => 1\n        ];\n        return $event;\n    }\n\n    private function getHost()\n    {\n        return $this->unwrappedOptions()->getHost();\n    }\n\n    private function getPort()\n    {\n        return $this->unwrappedOptions()->getPort();\n    }\n\n    private function getRegion()\n    {\n        return $this->region;\n    }\n\n    private function getService()\n    {\n        return $this->service;\n    }\n\n    /**\n     * Returns enabled flag from options, unwrapping options if necessary.\n     *\n     * @return bool\n     */\n    private function isEnabled()\n    {\n        return $this->unwrappedOptions()->isEnabled();\n    }\n\n    /**\n     * Returns $eventData array with information from the request and command.\n     *\n     * @param CommandInterface $cmd\n     * @param RequestInterface $request\n     * @param array $event\n     * @return array\n     */\n    protected function populateRequestEventData(\n        CommandInterface $cmd,\n        RequestInterface $request,\n        array $event\n    ) {\n        $dataFormat = static::getRequestData($request);\n        foreach ($dataFormat as $eventKey => $value) {\n            if ($value !== null) {\n                $event[$eventKey] = $value;\n            }\n        }\n        return $event;\n    }\n\n    /**\n     * Returns $eventData array with information from the response, including\n     * the calculation for attempt latency.\n     *\n     * @param ResultInterface|\\Exception $result\n     * @param array $event\n     * @return array\n     */\n    protected function populateResultEventData(\n        $result,\n        array $event\n    ) {\n        $dataFormat = static::getResponseData($result);\n        foreach ($dataFormat as $eventKey => $value) {\n            if ($value !== null) {\n                $event[$eventKey] = $value;\n            }\n        }\n        return $event;\n    }\n\n    /**\n     * Creates a UDP socket resource and stores it with the class, or retrieves\n     * it if already instantiated and connected. Handles error-checking and\n     * re-connecting if necessary. If $forceNewConnection is set to true, a new\n     * socket will be created.\n     *\n     * @param bool $forceNewConnection\n     * @return Resource\n     */\n    private function prepareSocket($forceNewConnection = false)\n    {\n        if (!is_resource(self::$socket)\n            || $forceNewConnection\n            || socket_last_error(self::$socket)\n        ) {\n            self::$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);\n            socket_clear_error(self::$socket);\n            socket_connect(self::$socket, $this->getHost(), $this->getPort());\n        }\n\n        return self::$socket;\n    }\n\n    /**\n     * Sends formatted monitoring event data via the UDP socket connection to\n     * the CSM agent endpoint.\n     *\n     * @param array $eventData\n     * @return int\n     */\n    private function sendEventData(array $eventData)\n    {\n        $socket = $this->prepareSocket();\n        $datagram = json_encode($eventData);\n        $result = socket_write($socket, $datagram, strlen($datagram));\n        if ($result === false) {\n            $this->prepareSocket(true);\n        }\n        return $result;\n    }\n\n    /**\n     * Unwraps options, if needed, and returns them.\n     *\n     * @return ConfigurationInterface\n     */\n    private function unwrappedOptions()\n    {\n        if (!($this->options instanceof ConfigurationInterface)) {\n            try {\n                $this->options = ConfigurationProvider::unwrap($this->options);\n            } catch (\\Exception $e) {\n                // Errors unwrapping CSM config defaults to disabling it\n                $this->options = new Configuration(\n                    false,\n                    ConfigurationProvider::DEFAULT_HOST,\n                    ConfigurationProvider::DEFAULT_PORT\n                );\n            }\n        }\n        return $this->options;\n    }\n}", "num_lines": 289}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\ClientSideMonitoring;\n\nuse Aws\\CommandInterface;\nuse Aws\\Credentials\\CredentialsInterface;\nuse Aws\\Exception\\AwsException;\nuse Aws\\ResponseContainerInterface;\nuse Aws\\ResultInterface;\nuse Psr\\Http\\Message\\RequestInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\n\n/**\n * @internal\n */\nclass ApiCallAttemptMonitoringMiddleware extends AbstractMonitoringMiddleware\n{\n\n    /**\n     * Standard middleware wrapper function with CSM options passed in.\n     *\n     * @param callable $credentialProvider\n     * @param mixed  $options\n     * @param string $region\n     * @param string $service\n     * @return callable\n     */\n    public static function wrap(\n        callable $credentialProvider,\n        $options,\n        $region,\n        $service\n    ) {\n        return function (callable $handler) use (\n            $credentialProvider,\n            $options,\n            $region,\n            $service\n        ) {\n            return new static(\n                $handler,\n                $credentialProvider,\n                $options,\n                $region,\n                $service\n            );\n        };\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public static function getRequestData(RequestInterface $request)\n    {\n        return [\n            'Fqdn' => $request->getUri()->getHost(),\n        ];\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public static function getResponseData($klass)\n    {\n        if ($klass instanceof ResultInterface) {\n            return [\n                'AttemptLatency' => self::getResultAttemptLatency($klass),\n                'DestinationIp' => self::getResultDestinationIp($klass),\n                'DnsLatency' => self::getResultDnsLatency($klass),\n                'HttpStatusCode' => self::getResultHttpStatusCode($klass),\n                'XAmzId2' => self::getResultHeader($klass, 'x-amz-id-2'),\n                'XAmzRequestId' => self::getResultHeader($klass, 'x-amz-request-id'),\n                'XAmznRequestId' => self::getResultHeader($klass, 'x-amzn-RequestId'),\n            ];\n        }\n        if ($klass instanceof AwsException) {\n            return [\n                'AttemptLatency' => self::getAwsExceptionAttemptLatency($klass),\n                'AwsException' => substr(\n                    self::getAwsExceptionErrorCode($klass),\n                    0,\n                    128\n                ),\n                'AwsExceptionMessage' => substr(\n                    self::getAwsExceptionMessage($klass),\n                    0,\n                    512\n                ),\n                'DestinationIp' => self::getAwsExceptionDestinationIp($klass),\n                'DnsLatency' => self::getAwsExceptionDnsLatency($klass),\n                'HttpStatusCode' => self::getAwsExceptionHttpStatusCode($klass),\n                'XAmzId2' => self::getAwsExceptionHeader($klass, 'x-amz-id-2'),\n                'XAmzRequestId' => self::getAwsExceptionHeader(\n                    $klass,\n                    'x-amz-request-id'\n                ),\n                'XAmznRequestId' => self::getAwsExceptionHeader(\n                    $klass,\n                    'x-amzn-RequestId'\n                ),\n            ];\n        }\n        if ($klass instanceof \\Exception) {\n            return [\n                'HttpStatusCode' => self::getExceptionHttpStatusCode($klass),\n                'SdkException' => substr(\n                    self::getExceptionCode($klass),\n                    0,\n                    128\n                ),\n                'SdkExceptionMessage' => substr(\n                    self::getExceptionMessage($klass),\n                    0,\n                    512\n                ),\n                'XAmzId2' => self::getExceptionHeader($klass, 'x-amz-id-2'),\n                'XAmzRequestId' => self::getExceptionHeader($klass, 'x-amz-request-id'),\n                'XAmznRequestId' => self::getExceptionHeader($klass, 'x-amzn-RequestId'),\n            ];\n        }\n\n        throw new \\InvalidArgumentException('Parameter must be an instance of ResultInterface, AwsException or Exception.');\n    }\n\n    private static function getResultAttemptLatency(ResultInterface $result)\n    {\n        if (isset($result['@metadata']['transferStats']['http'])) {\n            $attempt = end($result['@metadata']['transferStats']['http']);\n            if (isset($attempt['total_time'])) {\n                return (int) floor($attempt['total_time'] * 1000);\n            }\n        }\n        return null;\n    }\n\n    private static function getResultDestinationIp(ResultInterface $result)\n    {\n        if (isset($result['@metadata']['transferStats']['http'])) {\n            $attempt = end($result['@metadata']['transferStats']['http']);\n            if (isset($attempt['primary_ip'])) {\n                return $attempt['primary_ip'];\n            }\n        }\n        return null;\n    }\n\n    private static function getResultDnsLatency(ResultInterface $result)\n    {\n        if (isset($result['@metadata']['transferStats']['http'])) {\n            $attempt = end($result['@metadata']['transferStats']['http']);\n            if (isset($attempt['namelookup_time'])) {\n                return (int) floor($attempt['namelookup_time'] * 1000);\n            }\n        }\n        return null;\n    }\n\n    private static function getResultHttpStatusCode(ResultInterface $result)\n    {\n        return $result['@metadata']['statusCode'];\n    }\n\n    private static function getAwsExceptionAttemptLatency(AwsException $e) {\n        $attempt = $e->getTransferInfo();\n        if (isset($attempt['total_time'])) {\n            return (int) floor($attempt['total_time'] * 1000);\n        }\n        return null;\n    }\n\n    private static function getAwsExceptionErrorCode(AwsException $e) {\n        return $e->getAwsErrorCode();\n    }\n\n    private static function getAwsExceptionMessage(AwsException $e) {\n        return $e->getAwsErrorMessage();\n    }\n\n    private static function getAwsExceptionDestinationIp(AwsException $e) {\n        $attempt = $e->getTransferInfo();\n        if (isset($attempt['primary_ip'])) {\n            return $attempt['primary_ip'];\n        }\n        return null;\n    }\n\n    private static function getAwsExceptionDnsLatency(AwsException $e) {\n        $attempt = $e->getTransferInfo();\n        if (isset($attempt['namelookup_time'])) {\n            return (int) floor($attempt['namelookup_time'] * 1000);\n        }\n        return null;\n    }\n\n    private static function getAwsExceptionHttpStatusCode(AwsException $e) {\n        $response = $e->getResponse();\n        if ($response !== null) {\n            return $response->getStatusCode();\n        }\n        return null;\n    }\n\n    private static function getExceptionHttpStatusCode(\\Exception $e) {\n        if ($e instanceof ResponseContainerInterface) {\n            $response = $e->getResponse();\n            if ($response instanceof ResponseInterface) {\n                return $response->getStatusCode();\n            }\n        }\n        return null;\n    }\n\n    private static function getExceptionCode(\\Exception $e) {\n        if (!($e instanceof AwsException)) {\n            return get_class($e);\n        }\n        return null;\n    }\n\n    private static function getExceptionMessage(\\Exception $e) {\n        if (!($e instanceof AwsException)) {\n            return $e->getMessage();\n        }\n        return null;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    protected function populateRequestEventData(\n        CommandInterface $cmd,\n        RequestInterface $request,\n        array $event\n    ) {\n        $event = parent::populateRequestEventData($cmd, $request, $event);\n        $event['Type'] = 'ApiCallAttempt';\n        return $event;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    protected function populateResultEventData(\n        $result,\n        array $event\n    ) {\n        $event = parent::populateResultEventData($result, $event);\n\n        $provider = $this->credentialProvider;\n        /** @var CredentialsInterface $credentials */\n        $credentials = $provider()->wait();\n        $event['AccessKey'] = $credentials->getAccessKeyId();\n        $sessionToken = $credentials->getSecurityToken();\n        if ($sessionToken !== null) {\n            $event['SessionToken'] = $sessionToken;\n        }\n        if (empty($event['AttemptLatency'])) {\n            $event['AttemptLatency'] = (int) (floor(microtime(true) * 1000) - $event['Timestamp']);\n        }\n        return $event;\n    }\n}\n", "num_lines": 263}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\ClientSideMonitoring;\n\nuse Aws\\CommandInterface;\nuse Aws\\Exception\\AwsException;\nuse Aws\\MonitoringEventsInterface;\nuse Aws\\ResultInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * @internal\n */\nclass ApiCallMonitoringMiddleware extends AbstractMonitoringMiddleware\n{\n\n    /**\n     * Api Call Attempt event keys for each Api Call event key\n     *\n     * @var array\n     */\n    private static $eventKeys = [\n        'FinalAwsException' => 'AwsException',\n        'FinalAwsExceptionMessage' => 'AwsExceptionMessage',\n        'FinalSdkException' => 'SdkException',\n        'FinalSdkExceptionMessage' => 'SdkExceptionMessage',\n        'FinalHttpStatusCode' => 'HttpStatusCode',\n    ];\n\n    /**\n     * Standard middleware wrapper function with CSM options passed in.\n     *\n     * @param callable $credentialProvider\n     * @param mixed  $options\n     * @param string $region\n     * @param string $service\n     * @return callable\n     */\n    public static function wrap(\n        callable $credentialProvider,\n        $options,\n        $region,\n        $service\n    ) {\n        return function (callable $handler) use (\n            $credentialProvider,\n            $options,\n            $region,\n            $service\n        ) {\n            return new static(\n                $handler,\n                $credentialProvider,\n                $options,\n                $region,\n                $service\n            );\n        };\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public static function getRequestData(RequestInterface $request)\n    {\n        return [];\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public static function getResponseData($klass)\n    {\n        if ($klass instanceof ResultInterface) {\n            $data = [\n                'AttemptCount' => self::getResultAttemptCount($klass),\n                'MaxRetriesExceeded' => 0,\n            ];\n        } elseif ($klass instanceof \\Exception) {\n            $data = [\n                'AttemptCount' => self::getExceptionAttemptCount($klass),\n                'MaxRetriesExceeded' => self::getMaxRetriesExceeded($klass),\n            ];\n        } else {\n            throw new \\InvalidArgumentException('Parameter must be an instance of ResultInterface or Exception.');\n        }\n\n        return $data + self::getFinalAttemptData($klass);\n    }\n\n    private static function getResultAttemptCount(ResultInterface $result) {\n        if (isset($result['@metadata']['transferStats']['http'])) {\n            return count($result['@metadata']['transferStats']['http']);\n        }\n        return 1;\n    }\n\n    private static function getExceptionAttemptCount(\\Exception $e) {\n        $attemptCount = 0;\n        if ($e instanceof MonitoringEventsInterface) {\n            foreach ($e->getMonitoringEvents() as $event) {\n                if (isset($event['Type']) &&\n                    $event['Type'] === 'ApiCallAttempt') {\n                    $attemptCount++;\n                }\n            }\n\n        }\n        return $attemptCount;\n    }\n\n    private static function getFinalAttemptData($klass)\n    {\n        $data = [];\n        if ($klass instanceof MonitoringEventsInterface) {\n            $finalAttempt = self::getFinalAttempt($klass->getMonitoringEvents());\n\n            if (!empty($finalAttempt)) {\n                foreach (self::$eventKeys as $callKey => $attemptKey) {\n                    if (isset($finalAttempt[$attemptKey])) {\n                        $data[$callKey] = $finalAttempt[$attemptKey];\n                    }\n                }\n            }\n        }\n\n        return $data;\n    }\n\n    private static function getFinalAttempt(array $events)\n    {\n        for (end($events); key($events) !== null; prev($events)) {\n            $current = current($events);\n            if (isset($current['Type'])\n                && $current['Type'] === 'ApiCallAttempt'\n            ) {\n                return $current;\n            }\n        }\n\n        return null;\n    }\n\n    private static function getMaxRetriesExceeded($klass)\n    {\n        if ($klass instanceof AwsException && $klass->isMaxRetriesExceeded()) {\n            return 1;\n        }\n        return 0;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    protected function populateRequestEventData(\n        CommandInterface $cmd,\n        RequestInterface $request,\n        array $event\n    ) {\n        $event = parent::populateRequestEventData($cmd, $request, $event);\n        $event['Type'] = 'ApiCall';\n        return $event;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    protected function populateResultEventData(\n        $result,\n        array $event\n    ) {\n        $event = parent::populateResultEventData($result, $event);\n        $event['Latency'] = (int) (floor(microtime(true) * 1000) - $event['Timestamp']);\n        return $event;\n    }\n}\n", "num_lines": 177}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ClientSideMonitoring;\n\nclass Configuration implements ConfigurationInterface\n{\n    private $clientId;\n    private $enabled;\n    private $host;\n    private $port;\n\n    /**\n     * Constructs a new Configuration object with the specified CSM options set.\n     *\n     * @param mixed $enabled\n     * @param string $host\n     * @param string|int $port\n     * @param string $clientId\n     */\n    public function __construct($enabled, $host, $port, $clientId = '')\n    {\n        $this->host = $host;\n        $this->port = filter_var($port, FILTER_VALIDATE_INT);\n        if ($this->port === false) {\n            throw new \\InvalidArgumentException(\n                \"CSM 'port' value must be an integer!\");\n        }\n\n        // Unparsable $enabled flag errors on the side of disabling CSM\n        $this->enabled = filter_var($enabled, FILTER_VALIDATE_BOOLEAN);\n        $this->clientId = trim($clientId);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function isEnabled()\n    {\n        return $this->enabled;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getClientId()\n    {\n        return $this->clientId;\n    }\n\n    /**\n     * /{@inheritdoc}\n     */\n    public function getHost()\n    {\n        return $this->host;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getPort()\n    {\n        return $this->port;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function toArray()\n    {\n        return [\n            'client_id' => $this->getClientId(),\n            'enabled' => $this->isEnabled(),\n            'host' => $this->getHost(),\n            'port' => $this->getPort()\n        ];\n    }\n}", "num_lines": 77}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ClientSideMonitoring;\n\n/**\n * Provides access to client-side monitoring configuration options:\n * 'client_id', 'enabled', 'host', 'port'\n */\ninterface ConfigurationInterface\n{\n    /**\n     * Checks whether or not client-side monitoring is enabled.\n     *\n     * @return bool\n     */\n    public function isEnabled();\n\n    /**\n     * Returns the Client ID, if available.\n     *\n     * @return string|null\n     */\n    public function getClientId();\n\n    /**\n     * Returns the configured host.\n     *\n     * @return string|null\n     */\n    public function getHost();\n\n    /**\n     * Returns the configured port.\n     *\n     * @return int|null\n     */\n    public function getPort();\n\n    /**\n     * Returns the configuration as an associative array.\n     *\n     * @return array\n     */\n    public function toArray();\n}\n", "num_lines": 45}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ClientSideMonitoring;\n\nuse Aws\\AbstractConfigurationProvider;\nuse Aws\\CacheInterface;\nuse Aws\\ClientSideMonitoring\\Exception\\ConfigurationException;\nuse Aws\\ConfigurationProviderInterface;\nuse GuzzleHttp\\Promise;\nuse GuzzleHttp\\Promise\\PromiseInterface;\n\n/**\n * A configuration provider is a function that accepts no arguments and returns\n * a promise that is fulfilled with a {@see \\Aws\\ClientSideMonitoring\\ConfigurationInterface}\n * or rejected with an {@see \\Aws\\ClientSideMonitoring\\Exception\\ConfigurationException}.\n *\n * <code>\n * use Aws\\ClientSideMonitoring\\ConfigurationProvider;\n * $provider = ConfigurationProvider::defaultProvider();\n * // Returns a ConfigurationInterface or throws.\n * $config = $provider()->wait();\n * </code>\n *\n * Configuration providers can be composed to create configuration using\n * conditional logic that can create different configurations in different\n * environments. You can compose multiple providers into a single provider using\n * {@see Aws\\ClientSideMonitoring\\ConfigurationProvider::chain}. This function\n * accepts providers as variadic arguments and returns a new function that will\n * invoke each provider until a successful configuration is returned.\n *\n * <code>\n * // First try an INI file at this location.\n * $a = ConfigurationProvider::ini(null, '/path/to/file.ini');\n * // Then try an INI file at this location.\n * $b = ConfigurationProvider::ini(null, '/path/to/other-file.ini');\n * // Then try loading from environment variables.\n * $c = ConfigurationProvider::env();\n * // Combine the three providers together.\n * $composed = ConfigurationProvider::chain($a, $b, $c);\n * // Returns a promise that is fulfilled with a configuration or throws.\n * $promise = $composed();\n * // Wait on the configuration to resolve.\n * $config = $promise->wait();\n * </code>\n */\nclass ConfigurationProvider extends AbstractConfigurationProvider\n    implements ConfigurationProviderInterface\n{\n    const DEFAULT_CLIENT_ID = '';\n    const DEFAULT_ENABLED = false;\n    const DEFAULT_HOST = '127.0.0.1';\n    const DEFAULT_PORT = 31000;\n    const ENV_CLIENT_ID = 'AWS_CSM_CLIENT_ID';\n    const ENV_ENABLED = 'AWS_CSM_ENABLED';\n    const ENV_HOST = 'AWS_CSM_HOST';\n    const ENV_PORT = 'AWS_CSM_PORT';\n    const ENV_PROFILE = 'AWS_PROFILE';\n\n    public static $cacheKey = 'aws_cached_csm_config';\n\n    protected static $interfaceClass = ConfigurationInterface::class;\n    protected static $exceptionClass = ConfigurationException::class;\n\n    /**\n     * Create a default config provider that first checks for environment\n     * variables, then checks for a specified profile in the environment-defined\n     * config file location (env variable is 'AWS_CONFIG_FILE', file location\n     * defaults to ~/.aws/config), then checks for the \"default\" profile in the\n     * environment-defined config file location, and failing those uses a default\n     * fallback set of configuration options.\n     *\n     * This provider is automatically wrapped in a memoize function that caches\n     * previously provided config options.\n     *\n     * @param array $config\n     *\n     * @return callable\n     */\n    public static function defaultProvider(array $config = [])\n    {\n        $configProviders = [self::env()];\n        if (\n            !isset($config['use_aws_shared_config_files'])\n            || $config['use_aws_shared_config_files'] != false\n        ) {\n            $configProviders[] = self::ini();\n        }\n        $configProviders[] = self::fallback();\n\n        $memo = self::memoize(\n            call_user_func_array([ConfigurationProvider::class, 'chain'], $configProviders)\n        );\n\n        if (isset($config['csm']) && $config['csm'] instanceof CacheInterface) {\n            return self::cache($memo, $config['csm'], self::$cacheKey);\n        }\n\n        return $memo;\n    }\n\n    /**\n     * Provider that creates CSM config from environment variables.\n     *\n     * @return callable\n     */\n    public static function env()\n    {\n        return function () {\n            // Use credentials from environment variables, if available\n            $enabled = getenv(self::ENV_ENABLED);\n            if ($enabled !== false) {\n                return Promise\\Create::promiseFor(\n                    new Configuration(\n                        $enabled,\n                        getenv(self::ENV_HOST) ?: self::DEFAULT_HOST,\n                        getenv(self::ENV_PORT) ?: self::DEFAULT_PORT,\n                        getenv(self:: ENV_CLIENT_ID) ?: self::DEFAULT_CLIENT_ID\n                     )\n                );\n            }\n\n            return self::reject('Could not find environment variable CSM config'\n                . ' in ' . self::ENV_ENABLED. '/' . self::ENV_HOST . '/'\n                . self::ENV_PORT . '/' . self::ENV_CLIENT_ID);\n        };\n    }\n\n    /**\n     * Fallback config options when other sources are not set.\n     *\n     * @return callable\n     */\n    public static function fallback()\n    {\n        return function() {\n            return Promise\\Create::promiseFor(\n                new Configuration(\n                    self::DEFAULT_ENABLED,\n                    self::DEFAULT_HOST,\n                    self::DEFAULT_PORT,\n                    self::DEFAULT_CLIENT_ID\n                )\n            );\n        };\n    }\n\n    /**\n     * Config provider that creates config using a config file whose location\n     * is specified by an environment variable 'AWS_CONFIG_FILE', defaulting to\n     * ~/.aws/config if not specified\n     *\n     * @param string|null $profile  Profile to use. If not specified will use\n     *                              the \"default\" profile.\n     * @param string|null $filename If provided, uses a custom filename rather\n     *                              than looking in the default directory.\n     *\n     * @return callable\n     */\n    public static function ini($profile = null, $filename = null)\n    {\n        $filename = $filename ?: (self::getDefaultConfigFilename());\n        $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'aws_csm');\n\n        return function () use ($profile, $filename) {\n            if (!@is_readable($filename)) {\n                return self::reject(\"Cannot read CSM config from $filename\");\n            }\n            $data = \\Aws\\parse_ini_file($filename, true);\n            if ($data === false) {\n                return self::reject(\"Invalid config file: $filename\");\n            }\n            if (!isset($data[$profile])) {\n                return self::reject(\"'$profile' not found in config file\");\n            }\n            if (!isset($data[$profile]['csm_enabled'])) {\n                return self::reject(\"Required CSM config values not present in\n                    INI profile '{$profile}' ({$filename})\");\n            }\n\n            // host is optional\n            if (empty($data[$profile]['csm_host'])) {\n                $data[$profile]['csm_host'] = self::DEFAULT_HOST;\n            }\n\n            // port is optional\n            if (empty($data[$profile]['csm_port'])) {\n                $data[$profile]['csm_port'] = self::DEFAULT_PORT;\n            }\n\n            // client_id is optional\n            if (empty($data[$profile]['csm_client_id'])) {\n                $data[$profile]['csm_client_id'] = self::DEFAULT_CLIENT_ID;\n            }\n\n            return Promise\\Create::promiseFor(\n                new Configuration(\n                    $data[$profile]['csm_enabled'],\n                    $data[$profile]['csm_host'],\n                    $data[$profile]['csm_port'],\n                    $data[$profile]['csm_client_id']\n                )\n            );\n        };\n    }\n\n    /**\n     * Unwraps a configuration object in whatever valid form it is in,\n     * always returning a ConfigurationInterface object.\n     *\n     * @param  mixed $config\n     * @return ConfigurationInterface\n     * @throws \\InvalidArgumentException\n     */\n    public static function unwrap($config)\n    {\n        if (is_callable($config)) {\n            $config = $config();\n        }\n        if ($config instanceof PromiseInterface) {\n            $config = $config->wait();\n        }\n        if ($config instanceof ConfigurationInterface) {\n            return $config;\n        } elseif (is_array($config) && isset($config['enabled'])) {\n            $client_id = isset($config['client_id']) ? $config['client_id']\n                : self::DEFAULT_CLIENT_ID;\n            $host = isset($config['host']) ? $config['host']\n                : self::DEFAULT_HOST;\n            $port = isset($config['port']) ? $config['port']\n                : self::DEFAULT_PORT;\n            return new Configuration($config['enabled'], $host, $port, $client_id);\n        }\n\n        throw new \\InvalidArgumentException('Not a valid CSM configuration '\n            . 'argument.');\n    }\n}\n", "num_lines": 237}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\ClientSideMonitoring;\n\nuse Aws\\CommandInterface;\nuse Aws\\Exception\\AwsException;\nuse Aws\\ResultInterface;\nuse GuzzleHttp\\Psr7\\Request;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * @internal\n */\ninterface MonitoringMiddlewareInterface\n{\n\n    /**\n     * Data for event properties to be sent to the monitoring agent.\n     *\n     * @param RequestInterface $request\n     * @return array\n     */\n    public static function getRequestData(RequestInterface $request);\n\n\n    /**\n     * Data for event properties to be sent to the monitoring agent.\n     *\n     * @param ResultInterface|AwsException|\\Exception $klass\n     * @return array\n     */\n    public static function getResponseData($klass);\n\n    public function __invoke(CommandInterface $cmd, RequestInterface $request);\n}", "num_lines": 35}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ClientSideMonitoring\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\n\n/**\n * Represents an error interacting with configuration for client-side monitoring.\n */\nclass ConfigurationException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 16}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Cloud9;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Cloud9** service.\n * @method \\Aws\\Result createEnvironmentEC2(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEnvironmentEC2Async(array $args = [])\n * @method \\Aws\\Result createEnvironmentMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEnvironmentMembershipAsync(array $args = [])\n * @method \\Aws\\Result deleteEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result deleteEnvironmentMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEnvironmentMembershipAsync(array $args = [])\n * @method \\Aws\\Result describeEnvironmentMemberships(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEnvironmentMembershipsAsync(array $args = [])\n * @method \\Aws\\Result describeEnvironmentStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEnvironmentStatusAsync(array $args = [])\n * @method \\Aws\\Result describeEnvironments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEnvironmentsAsync(array $args = [])\n * @method \\Aws\\Result listEnvironments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEnvironmentsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result updateEnvironmentMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEnvironmentMembershipAsync(array $args = [])\n */\nclass Cloud9Client extends AwsClient {}\n", "num_lines": 36}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Cloud9\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Cloud9** service.\n */\nclass Cloud9Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudControlApi;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Cloud Control API** service.\n * @method \\Aws\\Result cancelResourceRequest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelResourceRequestAsync(array $args = [])\n * @method \\Aws\\Result createResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResourceAsync(array $args = [])\n * @method \\Aws\\Result deleteResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourceAsync(array $args = [])\n * @method \\Aws\\Result getResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceAsync(array $args = [])\n * @method \\Aws\\Result getResourceRequestStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceRequestStatusAsync(array $args = [])\n * @method \\Aws\\Result listResourceRequests(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceRequestsAsync(array $args = [])\n * @method \\Aws\\Result listResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourcesAsync(array $args = [])\n * @method \\Aws\\Result updateResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResourceAsync(array $args = [])\n */\nclass CloudControlApiClient extends AwsClient {}\n", "num_lines": 26}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudControlApi\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Cloud Control API** service.\n */\nclass CloudControlApiException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudDirectory;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon CloudDirectory** service.\n * @method \\Aws\\Result addFacetToObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addFacetToObjectAsync(array $args = [])\n * @method \\Aws\\Result applySchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise applySchemaAsync(array $args = [])\n * @method \\Aws\\Result attachObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachObjectAsync(array $args = [])\n * @method \\Aws\\Result attachPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachPolicyAsync(array $args = [])\n * @method \\Aws\\Result attachToIndex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachToIndexAsync(array $args = [])\n * @method \\Aws\\Result attachTypedLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachTypedLinkAsync(array $args = [])\n * @method \\Aws\\Result batchRead(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchReadAsync(array $args = [])\n * @method \\Aws\\Result batchWrite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchWriteAsync(array $args = [])\n * @method \\Aws\\Result createDirectory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDirectoryAsync(array $args = [])\n * @method \\Aws\\Result createFacet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFacetAsync(array $args = [])\n * @method \\Aws\\Result createIndex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIndexAsync(array $args = [])\n * @method \\Aws\\Result createObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createObjectAsync(array $args = [])\n * @method \\Aws\\Result createSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSchemaAsync(array $args = [])\n * @method \\Aws\\Result createTypedLinkFacet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTypedLinkFacetAsync(array $args = [])\n * @method \\Aws\\Result deleteDirectory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDirectoryAsync(array $args = [])\n * @method \\Aws\\Result deleteFacet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFacetAsync(array $args = [])\n * @method \\Aws\\Result deleteObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteObjectAsync(array $args = [])\n * @method \\Aws\\Result deleteSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSchemaAsync(array $args = [])\n * @method \\Aws\\Result deleteTypedLinkFacet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTypedLinkFacetAsync(array $args = [])\n * @method \\Aws\\Result detachFromIndex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachFromIndexAsync(array $args = [])\n * @method \\Aws\\Result detachObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachObjectAsync(array $args = [])\n * @method \\Aws\\Result detachPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachPolicyAsync(array $args = [])\n * @method \\Aws\\Result detachTypedLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachTypedLinkAsync(array $args = [])\n * @method \\Aws\\Result disableDirectory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableDirectoryAsync(array $args = [])\n * @method \\Aws\\Result enableDirectory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableDirectoryAsync(array $args = [])\n * @method \\Aws\\Result getAppliedSchemaVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppliedSchemaVersionAsync(array $args = [])\n * @method \\Aws\\Result getDirectory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDirectoryAsync(array $args = [])\n * @method \\Aws\\Result getFacet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFacetAsync(array $args = [])\n * @method \\Aws\\Result getLinkAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLinkAttributesAsync(array $args = [])\n * @method \\Aws\\Result getObjectAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectAttributesAsync(array $args = [])\n * @method \\Aws\\Result getObjectInformation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectInformationAsync(array $args = [])\n * @method \\Aws\\Result getSchemaAsJson(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSchemaAsJsonAsync(array $args = [])\n * @method \\Aws\\Result getTypedLinkFacetInformation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTypedLinkFacetInformationAsync(array $args = [])\n * @method \\Aws\\Result listAppliedSchemaArns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppliedSchemaArnsAsync(array $args = [])\n * @method \\Aws\\Result listAttachedIndices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAttachedIndicesAsync(array $args = [])\n * @method \\Aws\\Result listDevelopmentSchemaArns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDevelopmentSchemaArnsAsync(array $args = [])\n * @method \\Aws\\Result listDirectories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDirectoriesAsync(array $args = [])\n * @method \\Aws\\Result listFacetAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFacetAttributesAsync(array $args = [])\n * @method \\Aws\\Result listFacetNames(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFacetNamesAsync(array $args = [])\n * @method \\Aws\\Result listIncomingTypedLinks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIncomingTypedLinksAsync(array $args = [])\n * @method \\Aws\\Result listIndex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIndexAsync(array $args = [])\n * @method \\Aws\\Result listObjectAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listObjectAttributesAsync(array $args = [])\n * @method \\Aws\\Result listObjectChildren(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listObjectChildrenAsync(array $args = [])\n * @method \\Aws\\Result listObjectParentPaths(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listObjectParentPathsAsync(array $args = [])\n * @method \\Aws\\Result listObjectParents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listObjectParentsAsync(array $args = [])\n * @method \\Aws\\Result listObjectPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listObjectPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listOutgoingTypedLinks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOutgoingTypedLinksAsync(array $args = [])\n * @method \\Aws\\Result listPolicyAttachments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPolicyAttachmentsAsync(array $args = [])\n * @method \\Aws\\Result listPublishedSchemaArns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPublishedSchemaArnsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTypedLinkFacetAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTypedLinkFacetAttributesAsync(array $args = [])\n * @method \\Aws\\Result listTypedLinkFacetNames(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTypedLinkFacetNamesAsync(array $args = [])\n * @method \\Aws\\Result lookupPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise lookupPolicyAsync(array $args = [])\n * @method \\Aws\\Result publishSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise publishSchemaAsync(array $args = [])\n * @method \\Aws\\Result putSchemaFromJson(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSchemaFromJsonAsync(array $args = [])\n * @method \\Aws\\Result removeFacetFromObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeFacetFromObjectAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateFacet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFacetAsync(array $args = [])\n * @method \\Aws\\Result updateLinkAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLinkAttributesAsync(array $args = [])\n * @method \\Aws\\Result updateObjectAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateObjectAttributesAsync(array $args = [])\n * @method \\Aws\\Result updateSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSchemaAsync(array $args = [])\n * @method \\Aws\\Result updateTypedLinkFacet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTypedLinkFacetAsync(array $args = [])\n * @method \\Aws\\Result upgradeAppliedSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise upgradeAppliedSchemaAsync(array $args = [])\n * @method \\Aws\\Result upgradePublishedSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise upgradePublishedSchemaAsync(array $args = [])\n * @method \\Aws\\Result listManagedSchemaArns(array $args = []) (supported in versions 2017-01-11)\n * @method \\GuzzleHttp\\Promise\\Promise listManagedSchemaArnsAsync(array $args = []) (supported in versions 2017-01-11)\n */\nclass CloudDirectoryClient extends AwsClient {}\n", "num_lines": 142}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudDirectory\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon CloudDirectory** service.\n */\nclass CloudDirectoryException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudFormation;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS CloudFormation** service.\n *\n * @method \\Aws\\Result activateOrganizationsAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise activateOrganizationsAccessAsync(array $args = [])\n * @method \\Aws\\Result activateType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise activateTypeAsync(array $args = [])\n * @method \\Aws\\Result batchDescribeTypeConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDescribeTypeConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result cancelUpdateStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelUpdateStackAsync(array $args = [])\n * @method \\Aws\\Result continueUpdateRollback(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise continueUpdateRollbackAsync(array $args = [])\n * @method \\Aws\\Result createChangeSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChangeSetAsync(array $args = [])\n * @method \\Aws\\Result createStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStackAsync(array $args = [])\n * @method \\Aws\\Result createStackInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStackInstancesAsync(array $args = [])\n * @method \\Aws\\Result createStackSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStackSetAsync(array $args = [])\n * @method \\Aws\\Result deactivateOrganizationsAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deactivateOrganizationsAccessAsync(array $args = [])\n * @method \\Aws\\Result deactivateType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deactivateTypeAsync(array $args = [])\n * @method \\Aws\\Result deleteChangeSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChangeSetAsync(array $args = [])\n * @method \\Aws\\Result deleteStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStackAsync(array $args = [])\n * @method \\Aws\\Result deleteStackInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStackInstancesAsync(array $args = [])\n * @method \\Aws\\Result deleteStackSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStackSetAsync(array $args = [])\n * @method \\Aws\\Result deregisterType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterTypeAsync(array $args = [])\n * @method \\Aws\\Result describeAccountLimits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountLimitsAsync(array $args = [])\n * @method \\Aws\\Result describeChangeSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChangeSetAsync(array $args = [])\n * @method \\Aws\\Result describeChangeSetHooks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChangeSetHooksAsync(array $args = [])\n * @method \\Aws\\Result describeOrganizationsAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrganizationsAccessAsync(array $args = [])\n * @method \\Aws\\Result describePublisher(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePublisherAsync(array $args = [])\n * @method \\Aws\\Result describeStackDriftDetectionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStackDriftDetectionStatusAsync(array $args = [])\n * @method \\Aws\\Result describeStackEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStackEventsAsync(array $args = [])\n * @method \\Aws\\Result describeStackInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStackInstanceAsync(array $args = [])\n * @method \\Aws\\Result describeStackResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStackResourceAsync(array $args = [])\n * @method \\Aws\\Result describeStackResourceDrifts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStackResourceDriftsAsync(array $args = [])\n * @method \\Aws\\Result describeStackResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStackResourcesAsync(array $args = [])\n * @method \\Aws\\Result describeStackSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStackSetAsync(array $args = [])\n * @method \\Aws\\Result describeStackSetOperation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStackSetOperationAsync(array $args = [])\n * @method \\Aws\\Result describeStacks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStacksAsync(array $args = [])\n * @method \\Aws\\Result describeType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTypeAsync(array $args = [])\n * @method \\Aws\\Result describeTypeRegistration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTypeRegistrationAsync(array $args = [])\n * @method \\Aws\\Result detectStackDrift(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectStackDriftAsync(array $args = [])\n * @method \\Aws\\Result detectStackResourceDrift(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectStackResourceDriftAsync(array $args = [])\n * @method \\Aws\\Result detectStackSetDrift(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectStackSetDriftAsync(array $args = [])\n * @method \\Aws\\Result estimateTemplateCost(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise estimateTemplateCostAsync(array $args = [])\n * @method \\Aws\\Result executeChangeSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise executeChangeSetAsync(array $args = [])\n * @method \\Aws\\Result getStackPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStackPolicyAsync(array $args = [])\n * @method \\Aws\\Result getTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTemplateAsync(array $args = [])\n * @method \\Aws\\Result getTemplateSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTemplateSummaryAsync(array $args = [])\n * @method \\Aws\\Result importStacksToStackSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importStacksToStackSetAsync(array $args = [])\n * @method \\Aws\\Result listChangeSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChangeSetsAsync(array $args = [])\n * @method \\Aws\\Result listExports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExportsAsync(array $args = [])\n * @method \\Aws\\Result listImports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listImportsAsync(array $args = [])\n * @method \\Aws\\Result listStackInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStackInstancesAsync(array $args = [])\n * @method \\Aws\\Result listStackResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStackResourcesAsync(array $args = [])\n * @method \\Aws\\Result listStackSetOperationResults(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStackSetOperationResultsAsync(array $args = [])\n * @method \\Aws\\Result listStackSetOperations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStackSetOperationsAsync(array $args = [])\n * @method \\Aws\\Result listStackSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStackSetsAsync(array $args = [])\n * @method \\Aws\\Result listStacks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStacksAsync(array $args = [])\n * @method \\Aws\\Result listTypeRegistrations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTypeRegistrationsAsync(array $args = [])\n * @method \\Aws\\Result listTypeVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTypeVersionsAsync(array $args = [])\n * @method \\Aws\\Result listTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTypesAsync(array $args = [])\n * @method \\Aws\\Result publishType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise publishTypeAsync(array $args = [])\n * @method \\Aws\\Result recordHandlerProgress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise recordHandlerProgressAsync(array $args = [])\n * @method \\Aws\\Result registerPublisher(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerPublisherAsync(array $args = [])\n * @method \\Aws\\Result registerType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerTypeAsync(array $args = [])\n * @method \\Aws\\Result rollbackStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rollbackStackAsync(array $args = [])\n * @method \\Aws\\Result setStackPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setStackPolicyAsync(array $args = [])\n * @method \\Aws\\Result setTypeConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setTypeConfigurationAsync(array $args = [])\n * @method \\Aws\\Result setTypeDefaultVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setTypeDefaultVersionAsync(array $args = [])\n * @method \\Aws\\Result signalResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise signalResourceAsync(array $args = [])\n * @method \\Aws\\Result stopStackSetOperation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopStackSetOperationAsync(array $args = [])\n * @method \\Aws\\Result testType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testTypeAsync(array $args = [])\n * @method \\Aws\\Result updateStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStackAsync(array $args = [])\n * @method \\Aws\\Result updateStackInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStackInstancesAsync(array $args = [])\n * @method \\Aws\\Result updateStackSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStackSetAsync(array $args = [])\n * @method \\Aws\\Result updateTerminationProtection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTerminationProtectionAsync(array $args = [])\n * @method \\Aws\\Result validateTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise validateTemplateAsync(array $args = [])\n */\nclass CloudFormationClient extends AwsClient {}\n", "num_lines": 149}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudFormation\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the AWS CloudFormation service.\n */\nclass CloudFormationException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudFront;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon CloudFront** service.\n *\n * @method \\Aws\\Result createCloudFrontOriginAccessIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCloudFrontOriginAccessIdentityAsync(array $args = [])\n * @method \\Aws\\Result createDistribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDistributionAsync(array $args = [])\n * @method \\Aws\\Result createInvalidation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInvalidationAsync(array $args = [])\n * @method \\Aws\\Result createStreamingDistribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStreamingDistributionAsync(array $args = [])\n * @method \\Aws\\Result deleteCloudFrontOriginAccessIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCloudFrontOriginAccessIdentityAsync(array $args = [])\n * @method \\Aws\\Result deleteDistribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDistributionAsync(array $args = [])\n * @method \\Aws\\Result deleteStreamingDistribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStreamingDistributionAsync(array $args = [])\n * @method \\Aws\\Result getCloudFrontOriginAccessIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCloudFrontOriginAccessIdentityAsync(array $args = [])\n * @method \\Aws\\Result getCloudFrontOriginAccessIdentityConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCloudFrontOriginAccessIdentityConfigAsync(array $args = [])\n * @method \\Aws\\Result getDistribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDistributionAsync(array $args = [])\n * @method \\Aws\\Result getDistributionConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDistributionConfigAsync(array $args = [])\n * @method \\Aws\\Result getInvalidation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInvalidationAsync(array $args = [])\n * @method \\Aws\\Result getStreamingDistribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStreamingDistributionAsync(array $args = [])\n * @method \\Aws\\Result getStreamingDistributionConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStreamingDistributionConfigAsync(array $args = [])\n * @method \\Aws\\Result listCloudFrontOriginAccessIdentities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCloudFrontOriginAccessIdentitiesAsync(array $args = [])\n * @method \\Aws\\Result listDistributions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDistributionsAsync(array $args = [])\n * @method \\Aws\\Result listDistributionsByWebACLId(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDistributionsByWebACLIdAsync(array $args = [])\n * @method \\Aws\\Result listInvalidations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInvalidationsAsync(array $args = [])\n * @method \\Aws\\Result listStreamingDistributions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStreamingDistributionsAsync(array $args = [])\n * @method \\Aws\\Result updateCloudFrontOriginAccessIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCloudFrontOriginAccessIdentityAsync(array $args = [])\n * @method \\Aws\\Result updateDistribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDistributionAsync(array $args = [])\n * @method \\Aws\\Result updateStreamingDistribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStreamingDistributionAsync(array $args = [])\n * @method \\Aws\\Result createDistributionWithTags(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise createDistributionWithTagsAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result createStreamingDistributionWithTags(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise createStreamingDistributionWithTagsAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result listTagsForResource(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result tagResource(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result untagResource(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result deleteServiceLinkedRole(array $args = []) (supported in versions 2017-03-25)\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceLinkedRoleAsync(array $args = []) (supported in versions 2017-03-25)\n * @method \\Aws\\Result createFieldLevelEncryptionConfig(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise createFieldLevelEncryptionConfigAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result createFieldLevelEncryptionProfile(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise createFieldLevelEncryptionProfileAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result createPublicKey(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise createPublicKeyAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result deleteFieldLevelEncryptionConfig(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteFieldLevelEncryptionConfigAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result deleteFieldLevelEncryptionProfile(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteFieldLevelEncryptionProfileAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result deletePublicKey(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise deletePublicKeyAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result getFieldLevelEncryption(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getFieldLevelEncryptionAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result getFieldLevelEncryptionConfig(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getFieldLevelEncryptionConfigAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result getFieldLevelEncryptionProfile(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getFieldLevelEncryptionProfileAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result getFieldLevelEncryptionProfileConfig(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getFieldLevelEncryptionProfileConfigAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result getPublicKey(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getPublicKeyAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result getPublicKeyConfig(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getPublicKeyConfigAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result listFieldLevelEncryptionConfigs(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listFieldLevelEncryptionConfigsAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result listFieldLevelEncryptionProfiles(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listFieldLevelEncryptionProfilesAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result listPublicKeys(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listPublicKeysAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result updateFieldLevelEncryptionConfig(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise updateFieldLevelEncryptionConfigAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result updateFieldLevelEncryptionProfile(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise updateFieldLevelEncryptionProfileAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result updatePublicKey(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise updatePublicKeyAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)\n * @method \\Aws\\Result associateAlias(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise associateAliasAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result copyDistribution(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise copyDistributionAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result createCachePolicy(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise createCachePolicyAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result createContinuousDeploymentPolicy(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise createContinuousDeploymentPolicyAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result createFunction(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise createFunctionAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result createKeyGroup(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise createKeyGroupAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result createMonitoringSubscription(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise createMonitoringSubscriptionAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result createOriginAccessControl(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise createOriginAccessControlAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result createOriginRequestPolicy(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise createOriginRequestPolicyAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result createRealtimeLogConfig(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise createRealtimeLogConfigAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result createResponseHeadersPolicy(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise createResponseHeadersPolicyAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result deleteCachePolicy(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteCachePolicyAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result deleteContinuousDeploymentPolicy(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteContinuousDeploymentPolicyAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result deleteFunction(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteFunctionAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result deleteKeyGroup(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteKeyGroupAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result deleteMonitoringSubscription(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteMonitoringSubscriptionAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result deleteOriginAccessControl(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteOriginAccessControlAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result deleteOriginRequestPolicy(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteOriginRequestPolicyAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result deleteRealtimeLogConfig(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteRealtimeLogConfigAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result deleteResponseHeadersPolicy(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteResponseHeadersPolicyAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result describeFunction(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeFunctionAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result getCachePolicy(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getCachePolicyAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result getCachePolicyConfig(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getCachePolicyConfigAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result getContinuousDeploymentPolicy(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getContinuousDeploymentPolicyAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result getContinuousDeploymentPolicyConfig(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getContinuousDeploymentPolicyConfigAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result getFunction(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getFunctionAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result getKeyGroup(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getKeyGroupAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result getKeyGroupConfig(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getKeyGroupConfigAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result getMonitoringSubscription(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getMonitoringSubscriptionAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result getOriginAccessControl(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getOriginAccessControlAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result getOriginAccessControlConfig(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getOriginAccessControlConfigAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result getOriginRequestPolicy(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getOriginRequestPolicyAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result getOriginRequestPolicyConfig(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getOriginRequestPolicyConfigAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result getRealtimeLogConfig(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getRealtimeLogConfigAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result getResponseHeadersPolicy(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getResponseHeadersPolicyAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result getResponseHeadersPolicyConfig(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise getResponseHeadersPolicyConfigAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result listCachePolicies(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listCachePoliciesAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result listConflictingAliases(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listConflictingAliasesAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result listContinuousDeploymentPolicies(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listContinuousDeploymentPoliciesAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result listDistributionsByCachePolicyId(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listDistributionsByCachePolicyIdAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result listDistributionsByKeyGroup(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listDistributionsByKeyGroupAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result listDistributionsByOriginRequestPolicyId(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listDistributionsByOriginRequestPolicyIdAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result listDistributionsByRealtimeLogConfig(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listDistributionsByRealtimeLogConfigAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result listDistributionsByResponseHeadersPolicyId(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listDistributionsByResponseHeadersPolicyIdAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result listFunctions(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listFunctionsAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result listKeyGroups(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listKeyGroupsAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result listOriginAccessControls(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listOriginAccessControlsAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result listOriginRequestPolicies(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listOriginRequestPoliciesAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result listRealtimeLogConfigs(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listRealtimeLogConfigsAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result listResponseHeadersPolicies(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise listResponseHeadersPoliciesAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result publishFunction(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise publishFunctionAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result testFunction(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise testFunctionAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result updateCachePolicy(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise updateCachePolicyAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result updateContinuousDeploymentPolicy(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise updateContinuousDeploymentPolicyAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result updateDistributionWithStagingConfig(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise updateDistributionWithStagingConfigAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result updateFunction(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise updateFunctionAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result updateKeyGroup(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise updateKeyGroupAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result updateOriginAccessControl(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise updateOriginAccessControlAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result updateOriginRequestPolicy(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise updateOriginRequestPolicyAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result updateRealtimeLogConfig(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise updateRealtimeLogConfigAsync(array $args = []) (supported in versions 2020-05-31)\n * @method \\Aws\\Result updateResponseHeadersPolicy(array $args = []) (supported in versions 2020-05-31)\n * @method \\GuzzleHttp\\Promise\\Promise updateResponseHeadersPolicyAsync(array $args = []) (supported in versions 2020-05-31)\n */\nclass CloudFrontClient extends AwsClient\n{\n    /**\n     * Create a signed Amazon CloudFront URL.\n     *\n     * This method accepts an array of configuration options:\n     *\n     * - url: (string)  URL of the resource being signed (can include query\n     *   string and wildcards). For example: rtmp://s5c39gqb8ow64r.cloudfront.net/videos/mp3_name.mp3\n     *   http://d111111abcdef8.cloudfront.net/images/horizon.jpg?size=large&license=yes\n     * - policy: (string) JSON policy. Use this option when creating a signed\n     *   URL for a custom policy.\n     * - expires: (int) UTC Unix timestamp used when signing with a canned\n     *   policy. Not required when passing a custom 'policy' option.\n     * - key_pair_id: (string) The ID of the key pair used to sign CloudFront\n     *   URLs for private distributions.\n     * - private_key: (string) The filepath ot the private key used to sign\n     *   CloudFront URLs for private distributions.\n     *\n     * @param array $options Array of configuration options used when signing\n     *\n     * @return string Signed URL with authentication parameters\n     * @throws \\InvalidArgumentException if url, key_pair_id, or private_key\n     *     were not specified.\n     * @link http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/WorkingWithStreamingDistributions.html\n     */\n    public function getSignedUrl(array $options)\n    {\n        foreach (['url', 'key_pair_id', 'private_key'] as $required) {\n            if (!isset($options[$required])) {\n                throw new \\InvalidArgumentException(\"$required is required\");\n            }\n        }\n\n        $urlSigner = new UrlSigner(\n            $options['key_pair_id'],\n            $options['private_key']\n        );\n\n        return $urlSigner->getSignedUrl(\n            $options['url'],\n            isset($options['expires']) ? $options['expires'] : null,\n            isset($options['policy']) ? $options['policy'] : null\n        );\n    }\n\n    /**\n     * Create a signed Amazon CloudFront cookie.\n     *\n     * This method accepts an array of configuration options:\n     *\n     * - url: (string)  URL of the resource being signed (can include query\n     *   string and wildcards). For example: http://d111111abcdef8.cloudfront.net/images/horizon.jpg?size=large&license=yes\n     * - policy: (string) JSON policy. Use this option when creating a signed\n     *   URL for a custom policy.\n     * - expires: (int) UTC Unix timestamp used when signing with a canned\n     *   policy. Not required when passing a custom 'policy' option.\n     * - key_pair_id: (string) The ID of the key pair used to sign CloudFront\n     *   URLs for private distributions.\n     * - private_key: (string) The filepath ot the private key used to sign\n     *   CloudFront URLs for private distributions.\n     *\n     * @param array $options Array of configuration options used when signing\n     *\n     * @return array Key => value pairs of signed cookies to set\n     * @throws \\InvalidArgumentException if url, key_pair_id, or private_key\n     *     were not specified.\n     * @link http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/WorkingWithStreamingDistributions.html\n     */\n    public function getSignedCookie(array $options)\n    {\n        foreach (['key_pair_id', 'private_key'] as $required) {\n            if (!isset($options[$required])) {\n                throw new \\InvalidArgumentException(\"$required is required\");\n            }\n        }\n\n        $cookieSigner = new CookieSigner(\n            $options['key_pair_id'],\n            $options['private_key']\n        );\n\n        return $cookieSigner->getSignedCookie(\n            isset($options['url']) ? $options['url'] : null,\n            isset($options['expires']) ? $options['expires'] : null,\n            isset($options['policy']) ? $options['policy'] : null\n        );\n    }\n}\n", "num_lines": 313}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudFront;\n\nclass CookieSigner\n{\n    /** @var Signer */\n    private $signer;\n\n    private static $schemes = [\n        'http' => true,\n        'https' => true,\n    ];\n\n    /**\n     * @param $keyPairId  string ID of the key pair\n     * @param $privateKey string Path to the private key used for signing\n     *\n     * @throws \\RuntimeException if the openssl extension is missing\n     * @throws \\InvalidArgumentException if the private key cannot be found.\n     */\n    public function __construct($keyPairId, $privateKey)\n    {\n        $this->signer = new Signer($keyPairId, $privateKey);\n    }\n\n    /**\n     * Create a signed Amazon CloudFront Cookie.\n     *\n     * @param string              $url     URL to sign (can include query string\n     *                                     and wildcards). Not required\n     *                                     when passing a custom $policy.\n     * @param string|integer|null $expires UTC Unix timestamp used when signing\n     *                                     with a canned policy. Not required\n     *                                     when passing a custom $policy.\n     * @param string              $policy  JSON policy. Use this option when\n     *                                     creating a signed cookie for a custom\n     *                                     policy.\n     *\n     * @return array The authenticated cookie parameters\n     * @throws \\InvalidArgumentException if the URL provided is invalid\n     * @link http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-cookies.html\n     */\n    public function getSignedCookie($url = null, $expires = null, $policy = null)\n    {\n        if ($url) {\n            $this->validateUrl($url);\n        }\n\n        $cookieParameters = [];\n        $signature = $this->signer->getSignature($url, $expires, $policy);\n        foreach ($signature as $key => $value) {\n            $cookieParameters[\"CloudFront-$key\"] = $value;\n        }\n\n        return $cookieParameters;\n    }\n\n    private function validateUrl($url)\n    {\n        $scheme = str_replace('*', '', explode('://', $url)[0]);\n        if (empty(self::$schemes[strtolower($scheme)])) {\n            throw new \\InvalidArgumentException('Invalid or missing URI scheme');\n        }\n    }\n}\n", "num_lines": 66}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudFront;\n\n/**\n * @internal\n */\nclass Signer\n{\n    private $keyPairId;\n    private $pkHandle;\n\n    /**\n     * A signer for creating the signature values used in CloudFront signed URLs\n     * and signed cookies.\n     *\n     * @param $keyPairId  string ID of the key pair\n     * @param $privateKey string Path to the private key used for signing\n     * @param $passphrase string Passphrase to private key file, if one exists\n     *\n     * @throws \\RuntimeException if the openssl extension is missing\n     * @throws \\InvalidArgumentException if the private key cannot be found.\n     */\n    public function __construct($keyPairId, $privateKey, $passphrase = \"\")\n    {\n        if (!extension_loaded('openssl')) {\n            //@codeCoverageIgnoreStart\n            throw new \\RuntimeException('The openssl extension is required to '\n                . 'sign CloudFront urls.');\n            //@codeCoverageIgnoreEnd\n        }\n\n        $this->keyPairId = $keyPairId;\n\n        if (!$this->pkHandle = openssl_pkey_get_private($privateKey, $passphrase)) {\n            if (!file_exists($privateKey)) {\n                throw new \\InvalidArgumentException(\"PK file not found: $privateKey\");\n            }\n\n            $this->pkHandle = openssl_pkey_get_private(\"file://$privateKey\", $passphrase);\n            if (!$this->pkHandle) {\n                $errorMessages = [];\n                while(($newMessage = openssl_error_string()) !== false){\n                    $errorMessages[] = $newMessage;\n                }\n                throw new \\InvalidArgumentException(implode(\"\\n\",$errorMessages));\n            }\n        }\n    }\n\n    public function __destruct()\n    {\n        if (PHP_MAJOR_VERSION < 8) {\n            $this->pkHandle && openssl_pkey_free($this->pkHandle);\n        }\n    }\n\n    /**\n     * Create the values used to construct signed URLs and cookies.\n     *\n     * @param string              $resource     The CloudFront resource to which\n     *                                          this signature will grant access.\n     *                                          Not used when a custom policy is\n     *                                          provided.\n     * @param string|integer|null $expires      UTC Unix timestamp used when\n     *                                          signing with a canned policy.\n     *                                          Not required when passing a\n     *                                          custom $policy.\n     * @param string              $policy       JSON policy. Use this option when\n     *                                          creating a signature for a custom\n     *                                          policy.\n     *\n     * @return array The values needed to construct a signed URL or cookie\n     * @throws \\InvalidArgumentException  when not provided either a policy or a\n     *                                    resource and a expires\n     *\n     * @link http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-cookies.html\n     */\n    public function getSignature($resource = null, $expires = null, $policy = null)\n    {\n        $signatureHash = [];\n        if ($policy) {\n            $policy = preg_replace('/\\s/s', '', $policy);\n            $signatureHash['Policy'] = $this->encode($policy);\n        } elseif ($resource && $expires) {\n            $expires = (int) $expires; // Handle epoch passed as string\n            $policy = $this->createCannedPolicy($resource, $expires);\n            $signatureHash['Expires'] = $expires;\n        } else {\n            throw new \\InvalidArgumentException('Either a policy or a resource'\n                . ' and an expiration time must be provided.');\n        }\n\n        $signatureHash['Signature'] = $this->encode($this->sign($policy));\n        $signatureHash['Key-Pair-Id'] = $this->keyPairId;\n\n        return $signatureHash;\n    }\n\n    private function createCannedPolicy($resource, $expiration)\n    {\n        return json_encode([\n            'Statement' => [\n                [\n                    'Resource' => $resource,\n                    'Condition' => [\n                        'DateLessThan' => ['AWS:EpochTime' => $expiration],\n                    ],\n                ],\n            ],\n        ], JSON_UNESCAPED_SLASHES);\n    }\n\n    private function sign($policy)\n    {\n        $signature = '';\n        openssl_sign($policy, $signature, $this->pkHandle);\n\n        return $signature;\n    }\n\n    private function encode($policy)\n    {\n        return strtr(base64_encode($policy), '+=/', '-_~');\n    }\n}\n", "num_lines": 126}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudFront;\n\nuse GuzzleHttp\\Psr7;\nuse GuzzleHttp\\Psr7\\Uri;\nuse Psr\\Http\\Message\\UriInterface;\n\n/**\n * Creates signed URLs for Amazon CloudFront resources.\n */\nclass UrlSigner\n{\n    private $signer;\n\n    /**\n     * @param $keyPairId  string ID of the key pair\n     * @param $privateKey string Path to the private key used for signing\n     *\n     * @throws \\RuntimeException if the openssl extension is missing\n     * @throws \\InvalidArgumentException if the private key cannot be found.\n     */\n    public function __construct($keyPairId, $privateKey)\n    {\n        $this->signer = new Signer($keyPairId, $privateKey);\n    }\n\n    /**\n     * Create a signed Amazon CloudFront URL.\n     *\n     * Keep in mind that URLs meant for use in media/flash players may have\n     * different requirements for URL formats (e.g. some require that the\n     * extension be removed, some require the file name to be prefixed\n     * - mp4:<path>, some require you to add \"/cfx/st\" into your URL).\n     *\n     * @param string              $url     URL to sign (can include query\n     *                                     string string and wildcards)\n     * @param string|integer|null $expires UTC Unix timestamp used when signing\n     *                                     with a canned policy. Not required\n     *                                     when passing a custom $policy.\n     * @param string              $policy  JSON policy. Use this option when\n     *                                     creating a signed URL for a custom\n     *                                     policy.\n     *\n     * @return string The file URL with authentication parameters\n     * @throws \\InvalidArgumentException if the URL provided is invalid\n     * @link http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/WorkingWithStreamingDistributions.html\n     */\n    public function getSignedUrl($url, $expires = null, $policy = null)\n    {\n        // Determine the scheme of the url\n        $urlSections = explode('://', $url);\n\n        if (count($urlSections) < 2) {\n            throw new \\InvalidArgumentException(\"Invalid URL: {$url}\");\n        }\n\n        // Get the real scheme by removing wildcards from the scheme\n        $scheme = str_replace('*', '', $urlSections[0]);\n        $uri = new Uri($scheme . '://' . $urlSections[1]);\n        $query = Psr7\\Query::parse($uri->getQuery(), PHP_QUERY_RFC3986);\n        $signature = $this->signer->getSignature(\n            $this->createResource($scheme, (string) $uri),\n            $expires,\n            $policy\n        );\n        $uri = $uri->withQuery(\n            http_build_query($query + $signature, '', '&', PHP_QUERY_RFC3986)\n        );\n\n        return $scheme === 'rtmp'\n            ? $this->createRtmpUrl($uri)\n            : (string) $uri;\n    }\n\n    private function createRtmpUrl(UriInterface $uri)\n    {\n        // Use a relative URL when creating Flash player URLs\n        $result = ltrim($uri->getPath(), '/');\n\n        if ($query = $uri->getQuery()) {\n            $result .= '?' . $query;\n        }\n\n        return $result;\n    }\n\n    /**\n     * @param $scheme\n     * @param $url\n     *\n     * @return string\n     */\n    private function createResource($scheme, $url)\n    {\n        switch ($scheme) {\n            case 'http':\n            case 'http*':\n            case 'https':\n                return $url;\n            case 'rtmp':\n                $parts = parse_url($url);\n                $pathParts = pathinfo($parts['path']);\n                $resource = ltrim(\n                    $pathParts['dirname'] . '/' . $pathParts['basename'],\n                    '/'\n                );\n\n                // Add a query string if present.\n                if (isset($parts['query'])) {\n                    $resource .= \"?{$parts['query']}\";\n                }\n\n                return $resource;\n        }\n\n        throw new \\InvalidArgumentException(\"Invalid URI scheme: {$scheme}. \"\n            . \"Scheme must be one of: http, https, or rtmp\");\n    }\n}\n", "num_lines": 120}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudFront\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon CloudFront service.\n */\nclass CloudFrontException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudHsm;\n\nuse Aws\\Api\\ApiProvider;\nuse Aws\\Api\\DocModel;\nuse Aws\\Api\\Service;\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with **AWS CloudHSM**.\n *\n * @method \\Aws\\Result addTagsToResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsToResourceAsync(array $args = [])\n * @method \\Aws\\Result createHapg(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHapgAsync(array $args = [])\n * @method \\Aws\\Result createHsm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHsmAsync(array $args = [])\n * @method \\Aws\\Result createLunaClient(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLunaClientAsync(array $args = [])\n * @method \\Aws\\Result deleteHapg(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHapgAsync(array $args = [])\n * @method \\Aws\\Result deleteHsm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHsmAsync(array $args = [])\n * @method \\Aws\\Result deleteLunaClient(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLunaClientAsync(array $args = [])\n * @method \\Aws\\Result describeHapg(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHapgAsync(array $args = [])\n * @method \\Aws\\Result describeHsm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHsmAsync(array $args = [])\n * @method \\Aws\\Result describeLunaClient(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLunaClientAsync(array $args = [])\n * @method \\Aws\\Result getConfigFiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConfigFilesAsync(array $args = [])\n * @method \\Aws\\Result listAvailableZones(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAvailableZonesAsync(array $args = [])\n * @method \\Aws\\Result listHapgs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHapgsAsync(array $args = [])\n * @method \\Aws\\Result listHsms(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHsmsAsync(array $args = [])\n * @method \\Aws\\Result listLunaClients(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLunaClientsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result modifyHapg(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyHapgAsync(array $args = [])\n * @method \\Aws\\Result modifyHsm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyHsmAsync(array $args = [])\n * @method \\Aws\\Result modifyLunaClient(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyLunaClientAsync(array $args = [])\n * @method \\Aws\\Result removeTagsFromResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsFromResourceAsync(array $args = [])\n */\nclass CloudHsmClient extends AwsClient {}\n", "num_lines": 54}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudHsm\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * AWS CloudHSM exception.\n */\nclass CloudHsmException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudHSMV2;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS CloudHSM V2** service.\n * @method \\Aws\\Result copyBackupToRegion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyBackupToRegionAsync(array $args = [])\n * @method \\Aws\\Result createCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClusterAsync(array $args = [])\n * @method \\Aws\\Result createHsm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHsmAsync(array $args = [])\n * @method \\Aws\\Result deleteBackup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBackupAsync(array $args = [])\n * @method \\Aws\\Result deleteCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClusterAsync(array $args = [])\n * @method \\Aws\\Result deleteHsm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHsmAsync(array $args = [])\n * @method \\Aws\\Result describeBackups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBackupsAsync(array $args = [])\n * @method \\Aws\\Result describeClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClustersAsync(array $args = [])\n * @method \\Aws\\Result initializeCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise initializeClusterAsync(array $args = [])\n * @method \\Aws\\Result listTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsAsync(array $args = [])\n * @method \\Aws\\Result modifyBackupAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyBackupAttributesAsync(array $args = [])\n * @method \\Aws\\Result modifyCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyClusterAsync(array $args = [])\n * @method \\Aws\\Result restoreBackup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreBackupAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass CloudHSMV2Client extends AwsClient {}\n", "num_lines": 40}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudHSMV2\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS CloudHSM V2** service.\n */\nclass CloudHSMV2Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudSearch;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon CloudSearch** service.\n *\n * @method \\Aws\\Result buildSuggesters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise buildSuggestersAsync(array $args = [])\n * @method \\Aws\\Result createDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDomainAsync(array $args = [])\n * @method \\Aws\\Result defineAnalysisScheme(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise defineAnalysisSchemeAsync(array $args = [])\n * @method \\Aws\\Result defineExpression(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise defineExpressionAsync(array $args = [])\n * @method \\Aws\\Result defineIndexField(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise defineIndexFieldAsync(array $args = [])\n * @method \\Aws\\Result defineSuggester(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise defineSuggesterAsync(array $args = [])\n * @method \\Aws\\Result deleteAnalysisScheme(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAnalysisSchemeAsync(array $args = [])\n * @method \\Aws\\Result deleteDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainAsync(array $args = [])\n * @method \\Aws\\Result deleteExpression(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteExpressionAsync(array $args = [])\n * @method \\Aws\\Result deleteIndexField(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIndexFieldAsync(array $args = [])\n * @method \\Aws\\Result deleteSuggester(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSuggesterAsync(array $args = [])\n * @method \\Aws\\Result describeAnalysisSchemes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAnalysisSchemesAsync(array $args = [])\n * @method \\Aws\\Result describeAvailabilityOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAvailabilityOptionsAsync(array $args = [])\n * @method \\Aws\\Result describeDomainEndpointOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainEndpointOptionsAsync(array $args = [])\n * @method \\Aws\\Result describeDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainsAsync(array $args = [])\n * @method \\Aws\\Result describeExpressions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeExpressionsAsync(array $args = [])\n * @method \\Aws\\Result describeIndexFields(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeIndexFieldsAsync(array $args = [])\n * @method \\Aws\\Result describeScalingParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScalingParametersAsync(array $args = [])\n * @method \\Aws\\Result describeServiceAccessPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeServiceAccessPoliciesAsync(array $args = [])\n * @method \\Aws\\Result describeSuggesters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSuggestersAsync(array $args = [])\n * @method \\Aws\\Result indexDocuments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise indexDocumentsAsync(array $args = [])\n * @method \\Aws\\Result listDomainNames(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainNamesAsync(array $args = [])\n * @method \\Aws\\Result updateAvailabilityOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAvailabilityOptionsAsync(array $args = [])\n * @method \\Aws\\Result updateDomainEndpointOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDomainEndpointOptionsAsync(array $args = [])\n * @method \\Aws\\Result updateScalingParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateScalingParametersAsync(array $args = [])\n * @method \\Aws\\Result updateServiceAccessPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceAccessPoliciesAsync(array $args = [])\n */\nclass CloudSearchClient extends AwsClient {}\n", "num_lines": 63}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudSearch\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon CloudSearch service.\n */\nclass CloudSearchException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudSearchDomain;\n\nuse Aws\\AwsClient;\nuse Aws\\CommandInterface;\nuse GuzzleHttp\\Psr7\\Uri;\nuse Psr\\Http\\Message\\RequestInterface;\nuse GuzzleHttp\\Psr7;\n\n/**\n * This client is used to search and upload documents to an **Amazon CloudSearch** Domain.\n *\n * @method \\Aws\\Result search(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchAsync(array $args = [])\n * @method \\Aws\\Result suggest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise suggestAsync(array $args = [])\n * @method \\Aws\\Result uploadDocuments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise uploadDocumentsAsync(array $args = [])\n */\nclass CloudSearchDomainClient extends AwsClient\n{\n    public function __construct(array $args)\n    {\n        parent::__construct($args);\n        $list = $this->getHandlerList();\n        $list->appendBuild($this->searchByPost(), 'cloudsearchdomain.search_by_POST');\n    }\n\n    public static function getArguments()\n    {\n        $args = parent::getArguments();\n        $args['endpoint']['required'] = true;\n        $args['region']['default'] = function (array $args) {\n            // Determine the region from the provided endpoint.\n            // (e.g. http://search-blah.{region}.cloudsearch.amazonaws.com)\n            return explode('.', new Uri($args['endpoint']))[1];\n        };\n\n        return $args;\n    }\n\n    /**\n     * Use POST for search command\n     *\n     * Useful when query string is too long\n     */\n    private function searchByPost()\n    {\n        return static function (callable $handler) {\n            return function (\n                CommandInterface $c,\n                RequestInterface $r = null\n            ) use ($handler) {\n                if ($c->getName() !== 'Search') {\n                    return $handler($c, $r);\n                }\n                return $handler($c, self::convertGetToPost($r));\n            };\n        };\n    }\n\n    /**\n     * Converts default GET request to a POST request\n     *\n     * Avoiding length restriction in query\n     *\n     * @param RequestInterface $r GET request to be converted\n     * @return RequestInterface $req converted POST request\n     */\n    public static function convertGetToPost(RequestInterface $r)\n    {\n        if ($r->getMethod() === 'POST') {\n            return $r;\n        }\n\n        $query = $r->getUri()->getQuery();\n        $req = $r->withMethod('POST')\n            ->withBody(Psr7\\Utils::streamFor($query))\n            ->withHeader('Content-Length', strlen($query))\n            ->withHeader('Content-Type', 'application/x-www-form-urlencoded')\n            ->withUri($r->getUri()->withQuery(''));\n        return $req;\n    }\n}\n", "num_lines": 85}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudSearchDomain\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with an Amazon CloudSearch Domain.\n */\nclass CloudSearchDomainException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudTrail;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS CloudTrail** service.\n *\n * @method \\Aws\\Result addTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsAsync(array $args = [])\n * @method \\Aws\\Result cancelQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelQueryAsync(array $args = [])\n * @method \\Aws\\Result createChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelAsync(array $args = [])\n * @method \\Aws\\Result createEventDataStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEventDataStoreAsync(array $args = [])\n * @method \\Aws\\Result createTrail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTrailAsync(array $args = [])\n * @method \\Aws\\Result deleteChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteEventDataStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventDataStoreAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteTrail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTrailAsync(array $args = [])\n * @method \\Aws\\Result deregisterOrganizationDelegatedAdmin(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterOrganizationDelegatedAdminAsync(array $args = [])\n * @method \\Aws\\Result describeQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeQueryAsync(array $args = [])\n * @method \\Aws\\Result describeTrails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTrailsAsync(array $args = [])\n * @method \\Aws\\Result getChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChannelAsync(array $args = [])\n * @method \\Aws\\Result getEventDataStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEventDataStoreAsync(array $args = [])\n * @method \\Aws\\Result getEventSelectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEventSelectorsAsync(array $args = [])\n * @method \\Aws\\Result getImport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getImportAsync(array $args = [])\n * @method \\Aws\\Result getInsightSelectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInsightSelectorsAsync(array $args = [])\n * @method \\Aws\\Result getQueryResults(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getQueryResultsAsync(array $args = [])\n * @method \\Aws\\Result getResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result getTrail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTrailAsync(array $args = [])\n * @method \\Aws\\Result getTrailStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTrailStatusAsync(array $args = [])\n * @method \\Aws\\Result listChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelsAsync(array $args = [])\n * @method \\Aws\\Result listEventDataStores(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventDataStoresAsync(array $args = [])\n * @method \\Aws\\Result listImportFailures(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listImportFailuresAsync(array $args = [])\n * @method \\Aws\\Result listImports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listImportsAsync(array $args = [])\n * @method \\Aws\\Result listPublicKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPublicKeysAsync(array $args = [])\n * @method \\Aws\\Result listQueries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listQueriesAsync(array $args = [])\n * @method \\Aws\\Result listTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsAsync(array $args = [])\n * @method \\Aws\\Result listTrails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTrailsAsync(array $args = [])\n * @method \\Aws\\Result lookupEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise lookupEventsAsync(array $args = [])\n * @method \\Aws\\Result putEventSelectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEventSelectorsAsync(array $args = [])\n * @method \\Aws\\Result putInsightSelectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putInsightSelectorsAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result registerOrganizationDelegatedAdmin(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerOrganizationDelegatedAdminAsync(array $args = [])\n * @method \\Aws\\Result removeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsAsync(array $args = [])\n * @method \\Aws\\Result restoreEventDataStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreEventDataStoreAsync(array $args = [])\n * @method \\Aws\\Result startEventDataStoreIngestion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startEventDataStoreIngestionAsync(array $args = [])\n * @method \\Aws\\Result startImport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startImportAsync(array $args = [])\n * @method \\Aws\\Result startLogging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startLoggingAsync(array $args = [])\n * @method \\Aws\\Result startQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startQueryAsync(array $args = [])\n * @method \\Aws\\Result stopEventDataStoreIngestion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopEventDataStoreIngestionAsync(array $args = [])\n * @method \\Aws\\Result stopImport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopImportAsync(array $args = [])\n * @method \\Aws\\Result stopLogging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopLoggingAsync(array $args = [])\n * @method \\Aws\\Result updateChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChannelAsync(array $args = [])\n * @method \\Aws\\Result updateEventDataStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEventDataStoreAsync(array $args = [])\n * @method \\Aws\\Result updateTrail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTrailAsync(array $args = [])\n */\nclass CloudTrailClient extends AwsClient {}\n", "num_lines": 103}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudTrail;\n\nuse Aws\\S3\\S3Client;\nuse Aws\\CloudTrail\\Exception\\CloudTrailException;\n\n/**\n * The `Aws\\CloudTrail\\LogFileIterator` provides an easy way to iterate over\n * log file generated by AWS CloudTrail.\n *\n * CloudTrail log files contain data about your AWS API calls and are stored in\n * Amazon S3 at a predictable path based on a bucket name, a key prefix, an\n * account ID, a region, and date information. This class allows you to specify\n * options, including a date range, and emits each log file that match the\n * provided options.\n *\n * Yields an array containing the Amazon S3 bucket and key of the log file.\n */\nclass LogFileIterator extends \\IteratorIterator\n{\n    // For internal use\n    const DEFAULT_TRAIL_NAME = 'Default';\n    const PREFIX_TEMPLATE = 'prefix/AWSLogs/account/CloudTrail/region/date/';\n    const PREFIX_WILDCARD = '*';\n\n    // Option names used internally or externally\n    const TRAIL_NAME = 'trail_name';\n    const KEY_PREFIX = 'key_prefix';\n    const START_DATE = 'start_date';\n    const END_DATE = 'end_date';\n    const ACCOUNT_ID = 'account_id';\n    const LOG_REGION = 'log_region';\n\n    /** @var S3Client S3 client used to perform ListObjects operations */\n    private $s3Client;\n\n    /** @var string S3 bucket that contains the log files */\n    private $s3BucketName;\n\n    /**\n     * Constructs a LogRecordIterator. This factory method is used if the name\n     * of the S3 bucket containing your logs is not known. This factory method\n     * uses a CloudTrail client and the trail name (or \"Default\") to find the\n     * information about the trail necessary for constructing the\n     * LogRecordIterator.\n     *\n     * @param S3Client         $s3Client\n     * @param CloudTrailClient $cloudTrailClient\n     * @param array            $options\n     *\n     * @return LogRecordIterator\n     * @throws \\InvalidArgumentException\n     * @see LogRecordIterator::__contruct\n     */\n    public static function forTrail(\n        S3Client $s3Client,\n        CloudTrailClient $cloudTrailClient,\n        array $options = []\n    ) {\n        $trailName = isset($options[self::TRAIL_NAME])\n            ? $options[self::TRAIL_NAME]\n            : self::DEFAULT_TRAIL_NAME;\n\n        $s3BucketName = null;\n\n        // Use the CloudTrail client to get information about the trail,\n        // including the bucket name.\n        try {\n            $result = $cloudTrailClient->describeTrails([\n                'trailNameList' => [$trailName]\n            ]);\n            $s3BucketName = $result->search('trailList[0].S3BucketName');\n            $options[self::KEY_PREFIX] = $result->search(\n                'trailList[0].S3KeyPrefix'\n            );\n        } catch (CloudTrailException $e) {\n            // There was an error describing the trail\n        }\n\n        // If the bucket name is still unknown, then throw an exception\n        if (!$s3BucketName) {\n            $prev = isset($e) ? $e : null;\n            throw new \\InvalidArgumentException('The bucket name could not '\n                . 'be determined from the trail.', 0, $prev);\n        }\n\n        return new self($s3Client, $s3BucketName, $options);\n    }\n\n    /**\n     * Constructs a LogFileIterator using the specified options:\n     *\n     * - trail_name: The name of the trail that is generating our logs. If\n     *   none is provided, then \"Default\" will be used, since that is the name\n     *   of the trail created in the AWS Management Console.\n     * - key_prefix: The S3 key prefix of your log files. This value will be\n     *   overwritten when using the `fromTrail()` method. However, if you are\n     *   using the constructor, then this value will be used.\n     * - start_date: The timestamp of the beginning of date range of the log\n     *   records you want to read. You can pass this in as a `DateTime` object,\n     *   integer (unix timestamp), or a string compatible with `strtotime()`.\n     * - end_date: The timestamp of the end of date range of the log records\n     *   you want to read. You can pass this in as a `DateTime` object, integer\n     *   (unix timestamp), or a string compatible with `strtotime()`.\n     * - account_id: This is your AWS account ID, which is the 12-digit number\n     *   found on the *Account Identifiers* section of the *AWS Security\n     *   Credentials* page. See https://console.aws.amazon.com/iam/home?#security_credential\n     * - log_region: Region of the services of the log records you want to read.\n     *\n     * @param S3Client $s3Client\n     * @param string   $s3BucketName\n     * @param array    $options\n     */\n    public function __construct(\n        S3Client $s3Client,\n        $s3BucketName,\n        array $options = []\n    ) {\n        $this->s3Client = $s3Client;\n        $this->s3BucketName = $s3BucketName;\n        parent::__construct($this->buildListObjectsIterator($options));\n    }\n\n    /**\n     * An override of the typical current behavior of \\IteratorIterator to\n     * format the output such that the bucket and key are returned in an array\n     *\n     * @return array|bool\n     */\n    #[\\ReturnTypeWillChange]\n    public function current()\n    {\n        if ($object = parent::current()) {\n            return [\n                'Bucket' => $this->s3BucketName,\n                'Key'    => $object['Key']\n            ];\n        }\n\n        return false;\n    }\n\n    /**\n     * Constructs an S3 ListObjects iterator, optionally decorated with\n     * FilterIterators, based on the provided options.\n     *\n     * @param array $options\n     *\n     * @return \\Iterator\n     */\n    private function buildListObjectsIterator(array $options)\n    {\n        // Extract and normalize the date values from the options\n        $startDate = isset($options[self::START_DATE])\n            ? $this->normalizeDateValue($options[self::START_DATE])\n            : null;\n        $endDate = isset($options[self::END_DATE])\n            ? $this->normalizeDateValue($options[self::END_DATE])\n            : null;\n\n        // Determine the parts of the key prefix of the log files being read\n        $parts = [\n            'prefix' => isset($options[self::KEY_PREFIX])\n                    ? $options[self::KEY_PREFIX]\n                    : null,\n            'account' => isset($options[self::ACCOUNT_ID])\n                    ? $options[self::ACCOUNT_ID]\n                    : self::PREFIX_WILDCARD,\n            'region' => isset($options[self::LOG_REGION])\n                    ? $options[self::LOG_REGION]\n                    : self::PREFIX_WILDCARD,\n            'date' => $this->determineDateForPrefix($startDate, $endDate),\n        ];\n\n        // Determine the longest key prefix that can be used to retrieve all\n        // of the relevant log files.\n        $candidatePrefix = ltrim(strtr(self::PREFIX_TEMPLATE, $parts), '/');\n        $logKeyPrefix = $candidatePrefix;\n        $index = strpos($candidatePrefix, self::PREFIX_WILDCARD);\n\n        if ($index !== false) {\n            $logKeyPrefix = substr($candidatePrefix, 0, $index);\n        }\n\n        // Create an iterator that will emit all of the objects matching the\n        // key prefix.\n        $objectsIterator = $this->s3Client->getIterator('ListObjects', [\n            'Bucket' => $this->s3BucketName,\n            'Prefix' => $logKeyPrefix,\n        ]);\n\n        // Apply regex and/or date filters to the objects iterator to emit only\n        // log files matching the options.\n        $objectsIterator = $this->applyRegexFilter(\n            $objectsIterator,\n            $logKeyPrefix,\n            $candidatePrefix\n        );\n\n        $objectsIterator = $this->applyDateFilter(\n            $objectsIterator,\n            $startDate,\n            $endDate\n        );\n\n        return $objectsIterator;\n    }\n\n    /**\n     * Normalizes a date value to a unix timestamp\n     *\n     * @param int|string|\\DateTimeInterface $date\n     *\n     * @return int\n     * @throws \\InvalidArgumentException if the value cannot be converted to\n     *     a timestamp\n     */\n    private function normalizeDateValue($date)\n    {\n        if (is_string($date)) {\n            $date = strtotime($date);\n        } elseif ($date instanceof \\DateTimeInterface) {\n            $date = $date->format('U');\n        } elseif (!is_int($date)) {\n            throw new \\InvalidArgumentException('Date values must be a '\n                . 'string, an int, or a DateTime object.');\n        }\n\n        return $date;\n    }\n\n    /**\n     * Uses the provided date values to determine the date portion of the prefix\n     */\n    private function determineDateForPrefix($startDate, $endDate)\n    {\n        // The default date value should look like \"*/*/*\" after joining\n        $dateParts = array_fill_keys(['Y', 'm', 'd'], self::PREFIX_WILDCARD);\n\n        // Narrow down the date by replacing the WILDCARDs with values if they\n        // are the same for the start and end date.\n        if ($startDate && $endDate) {\n            foreach ($dateParts as $key => &$value) {\n                $candidateValue = date($key, $startDate);\n                if ($candidateValue === date($key, $endDate)) {\n                    $value = $candidateValue;\n                } else {\n                    break;\n                }\n            }\n        }\n\n        return join('/', $dateParts);\n    }\n\n    /**\n     * Applies a regex iterator filter that limits the ListObjects result set\n     * based on the provided options.\n     *\n     * @param \\Iterator $objectsIterator\n     * @param string    $logKeyPrefix\n     * @param string    $candidatePrefix\n     *\n     * @return \\Iterator\n     */\n    private function applyRegexFilter(\n        $objectsIterator,\n        $logKeyPrefix,\n        $candidatePrefix\n    ) {\n        // If the prefix and candidate prefix are not the same, then there were\n        // WILDCARDs.\n        if ($logKeyPrefix !== $candidatePrefix) {\n            // Turn the candidate prefix into a regex by trimming and\n            // converting WILDCARDs to regex notation.\n            $regex = rtrim($candidatePrefix, '/' . self::PREFIX_WILDCARD) . '/';\n            $regex = strtr($regex, [self::PREFIX_WILDCARD => '[^/]+']);\n\n            // After trimming WILDCARDs or the end, if the regex is the same as\n            // the prefix, then no regex is needed.\n            if ($logKeyPrefix !== $regex) {\n                // Apply a regex filter iterator to remove files that don't\n                // match the provided options.\n                $objectsIterator = new \\CallbackFilterIterator(\n                    $objectsIterator,\n                    function ($object) use ($regex) {\n                        return preg_match(\"#{$regex}#\", $object['Key']);\n                    }\n                );\n            }\n        }\n\n        return $objectsIterator;\n    }\n\n    /**\n     * Applies an iterator filter to restrict the ListObjects result set to the\n     * specified date range.\n     *\n     * @param \\Iterator $objectsIterator\n     * @param int       $startDate\n     * @param int       $endDate\n     *\n     * @return \\Iterator\n     */\n    private function applyDateFilter($objectsIterator, $startDate, $endDate)\n    {\n        // If either a start or end date was provided, filter out dates that\n        // don't match the date range.\n        if ($startDate || $endDate) {\n            $fn = function ($object) use ($startDate, $endDate) {\n                if (!preg_match('/[0-9]{8}T[0-9]{4}Z/', $object['Key'], $m)) {\n                    return false;\n                }\n                $date = strtotime($m[0]);\n\n                return (!$startDate || $date >= $startDate)\n                    && (!$endDate || $date <= $endDate);\n            };\n            $objectsIterator = new \\CallbackFilterIterator($objectsIterator, $fn);\n        }\n\n        return $objectsIterator;\n    }\n}\n", "num_lines": 326}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudTrail;\n\nuse Aws\\S3\\S3Client;\n\n/**\n * This class provides an easy way to read log files generated by AWS\n * CloudTrail.\n *\n * CloudTrail log files contain data about your AWS API calls and are stored in\n * Amazon S3. The log files are gzipped and contain structured data in JSON\n * format. This class will automatically ungzip and decode the data, and return\n * the data as an array of log records\n */\nclass LogFileReader\n{\n    /** @var S3Client S3 client used to perform GetObject operations */\n    private $s3Client;\n\n    /**\n     * @param S3Client $s3Client S3 client used to retrieve objects\n     */\n    public function __construct(S3Client $s3Client)\n    {\n        $this->s3Client = $s3Client;\n    }\n\n    /**\n     * Downloads, unzips, and reads a CloudTrail log file from Amazon S3\n     *\n     * @param string $s3BucketName The bucket name of the log file in Amazon S3\n     * @param string $logFileKey   The key of the log file in Amazon S3\n     *\n     * @return array\n     */\n    public function read($s3BucketName, $logFileKey)\n    {\n        // Create a command for getting the log file object\n        $command = $this->s3Client->getCommand('GetObject', [\n            'Bucket' => (string) $s3BucketName,\n            'Key' => (string) $logFileKey,\n            'ResponseContentEncoding' => 'x-gzip'\n        ]);\n\n        // Make sure gzip encoding header is sent and accepted in order to\n        // inflate the response data.\n        $command['@http']['headers']['Accept-Encoding'] = 'gzip';\n\n        // Get the JSON response data and extract the log records\n        $result = $this->s3Client->execute($command);\n        $logData = json_decode($result['Body'], true);\n\n        return isset($logData['Records']) ? $logData['Records'] : [];\n    }\n}\n", "num_lines": 56}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudTrail;\n\nuse Aws\\S3\\S3Client;\n\n/**\n * The `Aws\\CloudTrail\\LogRecordIterator` provides an easy way to iterate over\n * log records from log files generated by AWS CloudTrail.\n *\n * CloudTrail log files contain data about your AWS API calls and are stored in\n * Amazon S3 at a predictable path based on a bucket name, a key prefix, an\n * account ID, a region, and date information. The files are gzipped and\n * contain structured data in JSON format. This class allows you to specify\n * options via its factory methods, including a date range, and emits each log\n * record from any log files that match the provided options.\n *\n * A log record containing data about an AWS API call is yielded for each\n * iteration on this object.\n */\nclass LogRecordIterator implements \\OuterIterator\n{\n    /** @var LogFileReader */\n    private $logFileReader;\n\n    /** @var \\Iterator */\n    private $logFileIterator;\n\n    /** @var array */\n    private $records;\n\n    /** @var int */\n    private $recordIndex;\n\n    /**\n     * @param S3Client         $s3Client\n     * @param CloudTrailClient $cloudTrailClient\n     * @param array            $options\n     *\n     * @return LogRecordIterator\n     */\n    public static function forTrail(\n        S3Client $s3Client,\n        CloudTrailClient $cloudTrailClient,\n        array $options = []\n    ) {\n        $logFileIterator = LogFileIterator::forTrail(\n            $s3Client,\n            $cloudTrailClient,\n            $options\n        );\n\n        return new self(new LogFileReader($s3Client), $logFileIterator);\n    }\n\n    /**\n     * @param S3Client $s3Client\n     * @param string   $s3BucketName\n     * @param array    $options\n     *\n     * @return LogRecordIterator\n     */\n    public static function forBucket(\n        S3Client $s3Client,\n        $s3BucketName,\n        array $options = []\n    ) {\n        $logFileReader = new LogFileReader($s3Client);\n        $iter = new LogFileIterator($s3Client, $s3BucketName, $options);\n\n        return new self($logFileReader, $iter);\n    }\n\n    /**\n     * @param S3Client $s3Client\n     * @param string   $s3BucketName\n     * @param string   $s3ObjectKey\n     *\n     * @return LogRecordIterator\n     */\n    public static function forFile(\n        S3Client $s3Client,\n        $s3BucketName,\n        $s3ObjectKey\n    ) {\n        $logFileReader = new LogFileReader($s3Client);\n        $logFileIterator = new \\ArrayIterator([[\n            'Bucket' => $s3BucketName,\n            'Key'    => $s3ObjectKey,\n        ]]);\n\n        return new self($logFileReader, $logFileIterator);\n    }\n\n    /**\n     * @param LogFileReader $logFileReader\n     * @param \\Iterator     $logFileIterator\n     */\n    public function __construct(\n        LogFileReader $logFileReader,\n        \\Iterator $logFileIterator\n    ) {\n        $this->logFileReader = $logFileReader;\n        $this->logFileIterator = $logFileIterator;\n        $this->records = array();\n        $this->recordIndex = 0;\n    }\n\n    /**\n     * Returns the current log record as an array.\n     *\n     * @return array|false\n     */\n    #[\\ReturnTypeWillChange]\n    public function current()\n    {\n        return $this->valid() ? $this->records[$this->recordIndex] : false;\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function next()\n    {\n        $this->recordIndex++;\n\n        // If all the records have been exhausted, get more records from the\n        // next log file.\n        while (!$this->valid()) {\n            $this->logFileIterator->next();\n            $success = $this->loadRecordsFromCurrentLogFile();\n            if (!$success) {\n                // The objects iterator is exhausted as well, so stop trying\n                break;\n           }\n        }\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function key()\n    {\n        if ($logFile = $this->logFileIterator->current()) {\n            return $logFile['Key'] . '.' . $this->recordIndex;\n        }\n\n        return null;\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function valid()\n    {\n        return isset($this->records[$this->recordIndex]);\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function rewind()\n    {\n        $this->logFileIterator->rewind();\n        $this->loadRecordsFromCurrentLogFile();\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function getInnerIterator()\n    {\n        return $this->logFileIterator;\n    }\n\n    /**\n     * Examines the current file in the `logFileIterator` and attempts to read\n     * it and load log records from it using the `logFileReader`. This method\n     * expects that items pulled from the iterator will take the form:\n     *\n     *     [\n     *         'Bucket' => '...',\n     *         'Key'    => '...',\n     *     ]\n     *\n     * @return bool Returns `true` if records were loaded and `false` if no\n     *     records were found\n     */\n    private function loadRecordsFromCurrentLogFile()\n    {\n        $this->recordIndex = 0;\n        $this->records = array();\n\n        $logFile = $this->logFileIterator->current();\n        if ($logFile && isset($logFile['Bucket']) && isset($logFile['Key'])) {\n            $this->records = $this->logFileReader->read(\n                $logFile['Bucket'],\n                $logFile['Key']\n            );\n        }\n\n        return (bool) $logFile;\n    }\n}\n", "num_lines": 194}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudTrail\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the AWS CloudTrail service.\n */\nclass CloudTrailException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudTrailData;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS CloudTrail Data Service** service.\n * @method \\Aws\\Result putAuditEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAuditEventsAsync(array $args = [])\n */\nclass CloudTrailDataClient extends AwsClient {}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudTrailData\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS CloudTrail Data Service** service.\n */\nclass CloudTrailDataException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudWatch;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon CloudWatch** service.\n *\n * @method \\Aws\\Result deleteAlarms(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAlarmsAsync(array $args = [])\n * @method \\Aws\\Result deleteAnomalyDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAnomalyDetectorAsync(array $args = [])\n * @method \\Aws\\Result deleteDashboards(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDashboardsAsync(array $args = [])\n * @method \\Aws\\Result deleteInsightRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInsightRulesAsync(array $args = [])\n * @method \\Aws\\Result deleteMetricStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMetricStreamAsync(array $args = [])\n * @method \\Aws\\Result describeAlarmHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAlarmHistoryAsync(array $args = [])\n * @method \\Aws\\Result describeAlarms(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAlarmsAsync(array $args = [])\n * @method \\Aws\\Result describeAlarmsForMetric(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAlarmsForMetricAsync(array $args = [])\n * @method \\Aws\\Result describeAnomalyDetectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAnomalyDetectorsAsync(array $args = [])\n * @method \\Aws\\Result describeInsightRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInsightRulesAsync(array $args = [])\n * @method \\Aws\\Result disableAlarmActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableAlarmActionsAsync(array $args = [])\n * @method \\Aws\\Result disableInsightRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableInsightRulesAsync(array $args = [])\n * @method \\Aws\\Result enableAlarmActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableAlarmActionsAsync(array $args = [])\n * @method \\Aws\\Result enableInsightRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableInsightRulesAsync(array $args = [])\n * @method \\Aws\\Result getDashboard(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDashboardAsync(array $args = [])\n * @method \\Aws\\Result getInsightRuleReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInsightRuleReportAsync(array $args = [])\n * @method \\Aws\\Result getMetricData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMetricDataAsync(array $args = [])\n * @method \\Aws\\Result getMetricStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMetricStatisticsAsync(array $args = [])\n * @method \\Aws\\Result getMetricStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMetricStreamAsync(array $args = [])\n * @method \\Aws\\Result getMetricWidgetImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMetricWidgetImageAsync(array $args = [])\n * @method \\Aws\\Result listDashboards(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDashboardsAsync(array $args = [])\n * @method \\Aws\\Result listManagedInsightRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listManagedInsightRulesAsync(array $args = [])\n * @method \\Aws\\Result listMetricStreams(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMetricStreamsAsync(array $args = [])\n * @method \\Aws\\Result listMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMetricsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putAnomalyDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAnomalyDetectorAsync(array $args = [])\n * @method \\Aws\\Result putCompositeAlarm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putCompositeAlarmAsync(array $args = [])\n * @method \\Aws\\Result putDashboard(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDashboardAsync(array $args = [])\n * @method \\Aws\\Result putInsightRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putInsightRuleAsync(array $args = [])\n * @method \\Aws\\Result putManagedInsightRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putManagedInsightRulesAsync(array $args = [])\n * @method \\Aws\\Result putMetricAlarm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putMetricAlarmAsync(array $args = [])\n * @method \\Aws\\Result putMetricData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putMetricDataAsync(array $args = [])\n * @method \\Aws\\Result putMetricStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putMetricStreamAsync(array $args = [])\n * @method \\Aws\\Result setAlarmState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setAlarmStateAsync(array $args = [])\n * @method \\Aws\\Result startMetricStreams(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMetricStreamsAsync(array $args = [])\n * @method \\Aws\\Result stopMetricStreams(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopMetricStreamsAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass CloudWatchClient extends AwsClient {}\n", "num_lines": 87}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudWatch\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon CloudWatch service.\n */\nclass CloudWatchException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudWatchEvents;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon CloudWatch Events** service.\n *\n * @method \\Aws\\Result activateEventSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise activateEventSourceAsync(array $args = [])\n * @method \\Aws\\Result cancelReplay(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelReplayAsync(array $args = [])\n * @method \\Aws\\Result createApiDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApiDestinationAsync(array $args = [])\n * @method \\Aws\\Result createArchive(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createArchiveAsync(array $args = [])\n * @method \\Aws\\Result createConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConnectionAsync(array $args = [])\n * @method \\Aws\\Result createEventBus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEventBusAsync(array $args = [])\n * @method \\Aws\\Result createPartnerEventSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPartnerEventSourceAsync(array $args = [])\n * @method \\Aws\\Result deactivateEventSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deactivateEventSourceAsync(array $args = [])\n * @method \\Aws\\Result deauthorizeConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deauthorizeConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteApiDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApiDestinationAsync(array $args = [])\n * @method \\Aws\\Result deleteArchive(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteArchiveAsync(array $args = [])\n * @method \\Aws\\Result deleteConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteEventBus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventBusAsync(array $args = [])\n * @method \\Aws\\Result deletePartnerEventSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePartnerEventSourceAsync(array $args = [])\n * @method \\Aws\\Result deleteRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRuleAsync(array $args = [])\n * @method \\Aws\\Result describeApiDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeApiDestinationAsync(array $args = [])\n * @method \\Aws\\Result describeArchive(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeArchiveAsync(array $args = [])\n * @method \\Aws\\Result describeConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConnectionAsync(array $args = [])\n * @method \\Aws\\Result describeEventBus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventBusAsync(array $args = [])\n * @method \\Aws\\Result describeEventSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventSourceAsync(array $args = [])\n * @method \\Aws\\Result describePartnerEventSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePartnerEventSourceAsync(array $args = [])\n * @method \\Aws\\Result describeReplay(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReplayAsync(array $args = [])\n * @method \\Aws\\Result describeRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRuleAsync(array $args = [])\n * @method \\Aws\\Result disableRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableRuleAsync(array $args = [])\n * @method \\Aws\\Result enableRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableRuleAsync(array $args = [])\n * @method \\Aws\\Result listApiDestinations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApiDestinationsAsync(array $args = [])\n * @method \\Aws\\Result listArchives(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listArchivesAsync(array $args = [])\n * @method \\Aws\\Result listConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConnectionsAsync(array $args = [])\n * @method \\Aws\\Result listEventBuses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventBusesAsync(array $args = [])\n * @method \\Aws\\Result listEventSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventSourcesAsync(array $args = [])\n * @method \\Aws\\Result listPartnerEventSourceAccounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPartnerEventSourceAccountsAsync(array $args = [])\n * @method \\Aws\\Result listPartnerEventSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPartnerEventSourcesAsync(array $args = [])\n * @method \\Aws\\Result listReplays(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReplaysAsync(array $args = [])\n * @method \\Aws\\Result listRuleNamesByTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRuleNamesByTargetAsync(array $args = [])\n * @method \\Aws\\Result listRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRulesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTargetsByRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTargetsByRuleAsync(array $args = [])\n * @method \\Aws\\Result putEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEventsAsync(array $args = [])\n * @method \\Aws\\Result putPartnerEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPartnerEventsAsync(array $args = [])\n * @method \\Aws\\Result putPermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPermissionAsync(array $args = [])\n * @method \\Aws\\Result putRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRuleAsync(array $args = [])\n * @method \\Aws\\Result putTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putTargetsAsync(array $args = [])\n * @method \\Aws\\Result removePermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removePermissionAsync(array $args = [])\n * @method \\Aws\\Result removeTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTargetsAsync(array $args = [])\n * @method \\Aws\\Result startReplay(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startReplayAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result testEventPattern(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testEventPatternAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApiDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApiDestinationAsync(array $args = [])\n * @method \\Aws\\Result updateArchive(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateArchiveAsync(array $args = [])\n * @method \\Aws\\Result updateConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConnectionAsync(array $args = [])\n */\nclass CloudWatchEventsClient extends AwsClient {}\n", "num_lines": 113}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudWatchEvents\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon CloudWatch Events** service.\n */\nclass CloudWatchEventsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudWatchEvidently;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon CloudWatch Evidently** service.\n * @method \\Aws\\Result batchEvaluateFeature(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchEvaluateFeatureAsync(array $args = [])\n * @method \\Aws\\Result createExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createExperimentAsync(array $args = [])\n * @method \\Aws\\Result createFeature(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFeatureAsync(array $args = [])\n * @method \\Aws\\Result createLaunch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLaunchAsync(array $args = [])\n * @method \\Aws\\Result createProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProjectAsync(array $args = [])\n * @method \\Aws\\Result createSegment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSegmentAsync(array $args = [])\n * @method \\Aws\\Result deleteExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteExperimentAsync(array $args = [])\n * @method \\Aws\\Result deleteFeature(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFeatureAsync(array $args = [])\n * @method \\Aws\\Result deleteLaunch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLaunchAsync(array $args = [])\n * @method \\Aws\\Result deleteProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProjectAsync(array $args = [])\n * @method \\Aws\\Result deleteSegment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSegmentAsync(array $args = [])\n * @method \\Aws\\Result evaluateFeature(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise evaluateFeatureAsync(array $args = [])\n * @method \\Aws\\Result getExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExperimentAsync(array $args = [])\n * @method \\Aws\\Result getExperimentResults(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExperimentResultsAsync(array $args = [])\n * @method \\Aws\\Result getFeature(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFeatureAsync(array $args = [])\n * @method \\Aws\\Result getLaunch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLaunchAsync(array $args = [])\n * @method \\Aws\\Result getProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProjectAsync(array $args = [])\n * @method \\Aws\\Result getSegment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSegmentAsync(array $args = [])\n * @method \\Aws\\Result listExperiments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExperimentsAsync(array $args = [])\n * @method \\Aws\\Result listFeatures(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFeaturesAsync(array $args = [])\n * @method \\Aws\\Result listLaunches(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLaunchesAsync(array $args = [])\n * @method \\Aws\\Result listProjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProjectsAsync(array $args = [])\n * @method \\Aws\\Result listSegmentReferences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSegmentReferencesAsync(array $args = [])\n * @method \\Aws\\Result listSegments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSegmentsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putProjectEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putProjectEventsAsync(array $args = [])\n * @method \\Aws\\Result startExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startExperimentAsync(array $args = [])\n * @method \\Aws\\Result startLaunch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startLaunchAsync(array $args = [])\n * @method \\Aws\\Result stopExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopExperimentAsync(array $args = [])\n * @method \\Aws\\Result stopLaunch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopLaunchAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result testSegmentPattern(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testSegmentPatternAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateExperimentAsync(array $args = [])\n * @method \\Aws\\Result updateFeature(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFeatureAsync(array $args = [])\n * @method \\Aws\\Result updateLaunch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLaunchAsync(array $args = [])\n * @method \\Aws\\Result updateProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProjectAsync(array $args = [])\n * @method \\Aws\\Result updateProjectDataDelivery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProjectDataDeliveryAsync(array $args = [])\n */\nclass CloudWatchEvidentlyClient extends AwsClient {}\n", "num_lines": 86}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudWatchEvidently\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon CloudWatch Evidently** service.\n */\nclass CloudWatchEvidentlyException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudWatchLogs;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon CloudWatch Logs** service.\n *\n * @method \\Aws\\Result associateKmsKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateKmsKeyAsync(array $args = [])\n * @method \\Aws\\Result cancelExportTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelExportTaskAsync(array $args = [])\n * @method \\Aws\\Result createExportTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createExportTaskAsync(array $args = [])\n * @method \\Aws\\Result createLogGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLogGroupAsync(array $args = [])\n * @method \\Aws\\Result createLogStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLogStreamAsync(array $args = [])\n * @method \\Aws\\Result deleteAccountPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccountPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteDataProtectionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataProtectionPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDestinationAsync(array $args = [])\n * @method \\Aws\\Result deleteLogGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLogGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteLogStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLogStreamAsync(array $args = [])\n * @method \\Aws\\Result deleteMetricFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMetricFilterAsync(array $args = [])\n * @method \\Aws\\Result deleteQueryDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteQueryDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteRetentionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRetentionPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteSubscriptionFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSubscriptionFilterAsync(array $args = [])\n * @method \\Aws\\Result describeAccountPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountPoliciesAsync(array $args = [])\n * @method \\Aws\\Result describeDestinations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDestinationsAsync(array $args = [])\n * @method \\Aws\\Result describeExportTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeExportTasksAsync(array $args = [])\n * @method \\Aws\\Result describeLogGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLogGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeLogStreams(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLogStreamsAsync(array $args = [])\n * @method \\Aws\\Result describeMetricFilters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMetricFiltersAsync(array $args = [])\n * @method \\Aws\\Result describeQueries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeQueriesAsync(array $args = [])\n * @method \\Aws\\Result describeQueryDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeQueryDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result describeResourcePolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeResourcePoliciesAsync(array $args = [])\n * @method \\Aws\\Result describeSubscriptionFilters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSubscriptionFiltersAsync(array $args = [])\n * @method \\Aws\\Result disassociateKmsKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateKmsKeyAsync(array $args = [])\n * @method \\Aws\\Result filterLogEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise filterLogEventsAsync(array $args = [])\n * @method \\Aws\\Result getDataProtectionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataProtectionPolicyAsync(array $args = [])\n * @method \\Aws\\Result getLogEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLogEventsAsync(array $args = [])\n * @method \\Aws\\Result getLogGroupFields(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLogGroupFieldsAsync(array $args = [])\n * @method \\Aws\\Result getLogRecord(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLogRecordAsync(array $args = [])\n * @method \\Aws\\Result getQueryResults(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getQueryResultsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTagsLogGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsLogGroupAsync(array $args = [])\n * @method \\Aws\\Result putAccountPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccountPolicyAsync(array $args = [])\n * @method \\Aws\\Result putDataProtectionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDataProtectionPolicyAsync(array $args = [])\n * @method \\Aws\\Result putDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDestinationAsync(array $args = [])\n * @method \\Aws\\Result putDestinationPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDestinationPolicyAsync(array $args = [])\n * @method \\Aws\\Result putLogEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putLogEventsAsync(array $args = [])\n * @method \\Aws\\Result putMetricFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putMetricFilterAsync(array $args = [])\n * @method \\Aws\\Result putQueryDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putQueryDefinitionAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result putRetentionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRetentionPolicyAsync(array $args = [])\n * @method \\Aws\\Result putSubscriptionFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSubscriptionFilterAsync(array $args = [])\n * @method \\Aws\\Result startQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startQueryAsync(array $args = [])\n * @method \\Aws\\Result stopQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopQueryAsync(array $args = [])\n * @method \\Aws\\Result tagLogGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagLogGroupAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result testMetricFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testMetricFilterAsync(array $args = [])\n * @method \\Aws\\Result untagLogGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagLogGroupAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass CloudWatchLogsClient extends AwsClient {}\n", "num_lines": 113}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudWatchLogs\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon CloudWatch Logs service.\n */\nclass CloudWatchLogsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudWatchRUM;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **CloudWatch RUM** service.\n * @method \\Aws\\Result batchCreateRumMetricDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchCreateRumMetricDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteRumMetricDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteRumMetricDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result batchGetRumMetricDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetRumMetricDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result createAppMonitor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppMonitorAsync(array $args = [])\n * @method \\Aws\\Result deleteAppMonitor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppMonitorAsync(array $args = [])\n * @method \\Aws\\Result deleteRumMetricsDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRumMetricsDestinationAsync(array $args = [])\n * @method \\Aws\\Result getAppMonitor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppMonitorAsync(array $args = [])\n * @method \\Aws\\Result getAppMonitorData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppMonitorDataAsync(array $args = [])\n * @method \\Aws\\Result listAppMonitors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppMonitorsAsync(array $args = [])\n * @method \\Aws\\Result listRumMetricsDestinations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRumMetricsDestinationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putRumEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRumEventsAsync(array $args = [])\n * @method \\Aws\\Result putRumMetricsDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRumMetricsDestinationAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAppMonitor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppMonitorAsync(array $args = [])\n * @method \\Aws\\Result updateRumMetricDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRumMetricDefinitionAsync(array $args = [])\n */\nclass CloudWatchRUMClient extends AwsClient {}\n", "num_lines": 44}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CloudWatchRUM\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **CloudWatch RUM** service.\n */\nclass CloudWatchRUMException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeArtifact;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **CodeArtifact** service.\n * @method \\Aws\\Result associateExternalConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateExternalConnectionAsync(array $args = [])\n * @method \\Aws\\Result copyPackageVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyPackageVersionsAsync(array $args = [])\n * @method \\Aws\\Result createDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDomainAsync(array $args = [])\n * @method \\Aws\\Result createRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRepositoryAsync(array $args = [])\n * @method \\Aws\\Result deleteDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainAsync(array $args = [])\n * @method \\Aws\\Result deleteDomainPermissionsPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainPermissionsPolicyAsync(array $args = [])\n * @method \\Aws\\Result deletePackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePackageAsync(array $args = [])\n * @method \\Aws\\Result deletePackageVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePackageVersionsAsync(array $args = [])\n * @method \\Aws\\Result deleteRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRepositoryAsync(array $args = [])\n * @method \\Aws\\Result deleteRepositoryPermissionsPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRepositoryPermissionsPolicyAsync(array $args = [])\n * @method \\Aws\\Result describeDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainAsync(array $args = [])\n * @method \\Aws\\Result describePackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePackageAsync(array $args = [])\n * @method \\Aws\\Result describePackageVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePackageVersionAsync(array $args = [])\n * @method \\Aws\\Result describeRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRepositoryAsync(array $args = [])\n * @method \\Aws\\Result disassociateExternalConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateExternalConnectionAsync(array $args = [])\n * @method \\Aws\\Result disposePackageVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disposePackageVersionsAsync(array $args = [])\n * @method \\Aws\\Result getAuthorizationToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAuthorizationTokenAsync(array $args = [])\n * @method \\Aws\\Result getDomainPermissionsPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainPermissionsPolicyAsync(array $args = [])\n * @method \\Aws\\Result getPackageVersionAsset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPackageVersionAssetAsync(array $args = [])\n * @method \\Aws\\Result getPackageVersionReadme(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPackageVersionReadmeAsync(array $args = [])\n * @method \\Aws\\Result getRepositoryEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRepositoryEndpointAsync(array $args = [])\n * @method \\Aws\\Result getRepositoryPermissionsPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRepositoryPermissionsPolicyAsync(array $args = [])\n * @method \\Aws\\Result listDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainsAsync(array $args = [])\n * @method \\Aws\\Result listPackageVersionAssets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPackageVersionAssetsAsync(array $args = [])\n * @method \\Aws\\Result listPackageVersionDependencies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPackageVersionDependenciesAsync(array $args = [])\n * @method \\Aws\\Result listPackageVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPackageVersionsAsync(array $args = [])\n * @method \\Aws\\Result listPackages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPackagesAsync(array $args = [])\n * @method \\Aws\\Result listRepositories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRepositoriesAsync(array $args = [])\n * @method \\Aws\\Result listRepositoriesInDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRepositoriesInDomainAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result publishPackageVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise publishPackageVersionAsync(array $args = [])\n * @method \\Aws\\Result putDomainPermissionsPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDomainPermissionsPolicyAsync(array $args = [])\n * @method \\Aws\\Result putPackageOriginConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPackageOriginConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putRepositoryPermissionsPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRepositoryPermissionsPolicyAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updatePackageVersionsStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePackageVersionsStatusAsync(array $args = [])\n * @method \\Aws\\Result updateRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRepositoryAsync(array $args = [])\n */\nclass CodeArtifactClient extends AwsClient {}\n", "num_lines": 86}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeArtifact\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **CodeArtifact** service.\n */\nclass CodeArtifactException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeBuild;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS CodeBuild** service.\n * @method \\Aws\\Result batchDeleteBuilds(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteBuildsAsync(array $args = [])\n * @method \\Aws\\Result batchGetBuildBatches(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetBuildBatchesAsync(array $args = [])\n * @method \\Aws\\Result batchGetBuilds(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetBuildsAsync(array $args = [])\n * @method \\Aws\\Result batchGetProjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetProjectsAsync(array $args = [])\n * @method \\Aws\\Result batchGetReportGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetReportGroupsAsync(array $args = [])\n * @method \\Aws\\Result batchGetReports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetReportsAsync(array $args = [])\n * @method \\Aws\\Result createProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProjectAsync(array $args = [])\n * @method \\Aws\\Result createReportGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReportGroupAsync(array $args = [])\n * @method \\Aws\\Result createWebhook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWebhookAsync(array $args = [])\n * @method \\Aws\\Result deleteBuildBatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBuildBatchAsync(array $args = [])\n * @method \\Aws\\Result deleteProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProjectAsync(array $args = [])\n * @method \\Aws\\Result deleteReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReportAsync(array $args = [])\n * @method \\Aws\\Result deleteReportGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReportGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteSourceCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSourceCredentialsAsync(array $args = [])\n * @method \\Aws\\Result deleteWebhook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWebhookAsync(array $args = [])\n * @method \\Aws\\Result describeCodeCoverages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCodeCoveragesAsync(array $args = [])\n * @method \\Aws\\Result describeTestCases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTestCasesAsync(array $args = [])\n * @method \\Aws\\Result getReportGroupTrend(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReportGroupTrendAsync(array $args = [])\n * @method \\Aws\\Result getResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result importSourceCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importSourceCredentialsAsync(array $args = [])\n * @method \\Aws\\Result invalidateProjectCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise invalidateProjectCacheAsync(array $args = [])\n * @method \\Aws\\Result listBuildBatches(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBuildBatchesAsync(array $args = [])\n * @method \\Aws\\Result listBuildBatchesForProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBuildBatchesForProjectAsync(array $args = [])\n * @method \\Aws\\Result listBuilds(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBuildsAsync(array $args = [])\n * @method \\Aws\\Result listBuildsForProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBuildsForProjectAsync(array $args = [])\n * @method \\Aws\\Result listCuratedEnvironmentImages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCuratedEnvironmentImagesAsync(array $args = [])\n * @method \\Aws\\Result listProjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProjectsAsync(array $args = [])\n * @method \\Aws\\Result listReportGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReportGroupsAsync(array $args = [])\n * @method \\Aws\\Result listReports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReportsAsync(array $args = [])\n * @method \\Aws\\Result listReportsForReportGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReportsForReportGroupAsync(array $args = [])\n * @method \\Aws\\Result listSharedProjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSharedProjectsAsync(array $args = [])\n * @method \\Aws\\Result listSharedReportGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSharedReportGroupsAsync(array $args = [])\n * @method \\Aws\\Result listSourceCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSourceCredentialsAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result retryBuild(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise retryBuildAsync(array $args = [])\n * @method \\Aws\\Result retryBuildBatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise retryBuildBatchAsync(array $args = [])\n * @method \\Aws\\Result startBuild(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startBuildAsync(array $args = [])\n * @method \\Aws\\Result startBuildBatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startBuildBatchAsync(array $args = [])\n * @method \\Aws\\Result stopBuild(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopBuildAsync(array $args = [])\n * @method \\Aws\\Result stopBuildBatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopBuildBatchAsync(array $args = [])\n * @method \\Aws\\Result updateProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProjectAsync(array $args = [])\n * @method \\Aws\\Result updateProjectVisibility(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProjectVisibilityAsync(array $args = [])\n * @method \\Aws\\Result updateReportGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateReportGroupAsync(array $args = [])\n * @method \\Aws\\Result updateWebhook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWebhookAsync(array $args = [])\n */\nclass CodeBuildClient extends AwsClient {}\n", "num_lines": 100}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeBuild\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS CodeBuild** service.\n */\nclass CodeBuildException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeCatalyst;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon CodeCatalyst** service.\n * @method \\Aws\\Result createAccessToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccessTokenAsync(array $args = [])\n * @method \\Aws\\Result createDevEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDevEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result createProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProjectAsync(array $args = [])\n * @method \\Aws\\Result createSourceRepositoryBranch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSourceRepositoryBranchAsync(array $args = [])\n * @method \\Aws\\Result deleteAccessToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccessTokenAsync(array $args = [])\n * @method \\Aws\\Result deleteDevEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDevEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result getDevEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDevEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result getProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProjectAsync(array $args = [])\n * @method \\Aws\\Result getSourceRepositoryCloneUrls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSourceRepositoryCloneUrlsAsync(array $args = [])\n * @method \\Aws\\Result getSpace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSpaceAsync(array $args = [])\n * @method \\Aws\\Result getSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result getUserDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUserDetailsAsync(array $args = [])\n * @method \\Aws\\Result listAccessTokens(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccessTokensAsync(array $args = [])\n * @method \\Aws\\Result listDevEnvironmentSessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDevEnvironmentSessionsAsync(array $args = [])\n * @method \\Aws\\Result listDevEnvironments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDevEnvironmentsAsync(array $args = [])\n * @method \\Aws\\Result listEventLogs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventLogsAsync(array $args = [])\n * @method \\Aws\\Result listProjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProjectsAsync(array $args = [])\n * @method \\Aws\\Result listSourceRepositories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSourceRepositoriesAsync(array $args = [])\n * @method \\Aws\\Result listSourceRepositoryBranches(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSourceRepositoryBranchesAsync(array $args = [])\n * @method \\Aws\\Result listSpaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSpacesAsync(array $args = [])\n * @method \\Aws\\Result startDevEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDevEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result startDevEnvironmentSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDevEnvironmentSessionAsync(array $args = [])\n * @method \\Aws\\Result stopDevEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopDevEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result stopDevEnvironmentSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopDevEnvironmentSessionAsync(array $args = [])\n * @method \\Aws\\Result updateDevEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDevEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result verifySession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise verifySessionAsync(array $args = [])\n */\nclass CodeCatalystClient extends AwsClient {}\n", "num_lines": 62}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeCatalyst\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon CodeCatalyst** service.\n */\nclass CodeCatalystException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeCommit;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS CodeCommit** service.\n *\n * @method \\Aws\\Result associateApprovalRuleTemplateWithRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateApprovalRuleTemplateWithRepositoryAsync(array $args = [])\n * @method \\Aws\\Result batchAssociateApprovalRuleTemplateWithRepositories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchAssociateApprovalRuleTemplateWithRepositoriesAsync(array $args = [])\n * @method \\Aws\\Result batchDescribeMergeConflicts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDescribeMergeConflictsAsync(array $args = [])\n * @method \\Aws\\Result batchDisassociateApprovalRuleTemplateFromRepositories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDisassociateApprovalRuleTemplateFromRepositoriesAsync(array $args = [])\n * @method \\Aws\\Result batchGetCommits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetCommitsAsync(array $args = [])\n * @method \\Aws\\Result batchGetRepositories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetRepositoriesAsync(array $args = [])\n * @method \\Aws\\Result createApprovalRuleTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApprovalRuleTemplateAsync(array $args = [])\n * @method \\Aws\\Result createBranch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBranchAsync(array $args = [])\n * @method \\Aws\\Result createCommit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCommitAsync(array $args = [])\n * @method \\Aws\\Result createPullRequest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPullRequestAsync(array $args = [])\n * @method \\Aws\\Result createPullRequestApprovalRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPullRequestApprovalRuleAsync(array $args = [])\n * @method \\Aws\\Result createRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRepositoryAsync(array $args = [])\n * @method \\Aws\\Result createUnreferencedMergeCommit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUnreferencedMergeCommitAsync(array $args = [])\n * @method \\Aws\\Result deleteApprovalRuleTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApprovalRuleTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteBranch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBranchAsync(array $args = [])\n * @method \\Aws\\Result deleteCommentContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCommentContentAsync(array $args = [])\n * @method \\Aws\\Result deleteFile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFileAsync(array $args = [])\n * @method \\Aws\\Result deletePullRequestApprovalRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePullRequestApprovalRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRepositoryAsync(array $args = [])\n * @method \\Aws\\Result describeMergeConflicts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMergeConflictsAsync(array $args = [])\n * @method \\Aws\\Result describePullRequestEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePullRequestEventsAsync(array $args = [])\n * @method \\Aws\\Result disassociateApprovalRuleTemplateFromRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateApprovalRuleTemplateFromRepositoryAsync(array $args = [])\n * @method \\Aws\\Result evaluatePullRequestApprovalRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise evaluatePullRequestApprovalRulesAsync(array $args = [])\n * @method \\Aws\\Result getApprovalRuleTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApprovalRuleTemplateAsync(array $args = [])\n * @method \\Aws\\Result getBlob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBlobAsync(array $args = [])\n * @method \\Aws\\Result getBranch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBranchAsync(array $args = [])\n * @method \\Aws\\Result getComment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCommentAsync(array $args = [])\n * @method \\Aws\\Result getCommentReactions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCommentReactionsAsync(array $args = [])\n * @method \\Aws\\Result getCommentsForComparedCommit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCommentsForComparedCommitAsync(array $args = [])\n * @method \\Aws\\Result getCommentsForPullRequest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCommentsForPullRequestAsync(array $args = [])\n * @method \\Aws\\Result getCommit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCommitAsync(array $args = [])\n * @method \\Aws\\Result getDifferences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDifferencesAsync(array $args = [])\n * @method \\Aws\\Result getFile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFileAsync(array $args = [])\n * @method \\Aws\\Result getFolder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFolderAsync(array $args = [])\n * @method \\Aws\\Result getMergeCommit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMergeCommitAsync(array $args = [])\n * @method \\Aws\\Result getMergeConflicts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMergeConflictsAsync(array $args = [])\n * @method \\Aws\\Result getMergeOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMergeOptionsAsync(array $args = [])\n * @method \\Aws\\Result getPullRequest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPullRequestAsync(array $args = [])\n * @method \\Aws\\Result getPullRequestApprovalStates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPullRequestApprovalStatesAsync(array $args = [])\n * @method \\Aws\\Result getPullRequestOverrideState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPullRequestOverrideStateAsync(array $args = [])\n * @method \\Aws\\Result getRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRepositoryAsync(array $args = [])\n * @method \\Aws\\Result getRepositoryTriggers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRepositoryTriggersAsync(array $args = [])\n * @method \\Aws\\Result listApprovalRuleTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApprovalRuleTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listAssociatedApprovalRuleTemplatesForRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssociatedApprovalRuleTemplatesForRepositoryAsync(array $args = [])\n * @method \\Aws\\Result listBranches(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBranchesAsync(array $args = [])\n * @method \\Aws\\Result listPullRequests(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPullRequestsAsync(array $args = [])\n * @method \\Aws\\Result listRepositories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRepositoriesAsync(array $args = [])\n * @method \\Aws\\Result listRepositoriesForApprovalRuleTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRepositoriesForApprovalRuleTemplateAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result mergeBranchesByFastForward(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise mergeBranchesByFastForwardAsync(array $args = [])\n * @method \\Aws\\Result mergeBranchesBySquash(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise mergeBranchesBySquashAsync(array $args = [])\n * @method \\Aws\\Result mergeBranchesByThreeWay(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise mergeBranchesByThreeWayAsync(array $args = [])\n * @method \\Aws\\Result mergePullRequestByFastForward(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise mergePullRequestByFastForwardAsync(array $args = [])\n * @method \\Aws\\Result mergePullRequestBySquash(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise mergePullRequestBySquashAsync(array $args = [])\n * @method \\Aws\\Result mergePullRequestByThreeWay(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise mergePullRequestByThreeWayAsync(array $args = [])\n * @method \\Aws\\Result overridePullRequestApprovalRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise overridePullRequestApprovalRulesAsync(array $args = [])\n * @method \\Aws\\Result postCommentForComparedCommit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise postCommentForComparedCommitAsync(array $args = [])\n * @method \\Aws\\Result postCommentForPullRequest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise postCommentForPullRequestAsync(array $args = [])\n * @method \\Aws\\Result postCommentReply(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise postCommentReplyAsync(array $args = [])\n * @method \\Aws\\Result putCommentReaction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putCommentReactionAsync(array $args = [])\n * @method \\Aws\\Result putFile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putFileAsync(array $args = [])\n * @method \\Aws\\Result putRepositoryTriggers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRepositoryTriggersAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result testRepositoryTriggers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testRepositoryTriggersAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApprovalRuleTemplateContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApprovalRuleTemplateContentAsync(array $args = [])\n * @method \\Aws\\Result updateApprovalRuleTemplateDescription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApprovalRuleTemplateDescriptionAsync(array $args = [])\n * @method \\Aws\\Result updateApprovalRuleTemplateName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApprovalRuleTemplateNameAsync(array $args = [])\n * @method \\Aws\\Result updateComment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCommentAsync(array $args = [])\n * @method \\Aws\\Result updateDefaultBranch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDefaultBranchAsync(array $args = [])\n * @method \\Aws\\Result updatePullRequestApprovalRuleContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePullRequestApprovalRuleContentAsync(array $args = [])\n * @method \\Aws\\Result updatePullRequestApprovalState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePullRequestApprovalStateAsync(array $args = [])\n * @method \\Aws\\Result updatePullRequestDescription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePullRequestDescriptionAsync(array $args = [])\n * @method \\Aws\\Result updatePullRequestStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePullRequestStatusAsync(array $args = [])\n * @method \\Aws\\Result updatePullRequestTitle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePullRequestTitleAsync(array $args = [])\n * @method \\Aws\\Result updateRepositoryDescription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRepositoryDescriptionAsync(array $args = [])\n * @method \\Aws\\Result updateRepositoryName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRepositoryNameAsync(array $args = [])\n */\nclass CodeCommitClient extends AwsClient {}\n", "num_lines": 165}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeCommit\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS CodeCommit** service.\n */\nclass CodeCommitException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeDeploy;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with AWS CodeDeploy\n *\n * @method \\Aws\\Result addTagsToOnPremisesInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsToOnPremisesInstancesAsync(array $args = [])\n * @method \\Aws\\Result batchGetApplicationRevisions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetApplicationRevisionsAsync(array $args = [])\n * @method \\Aws\\Result batchGetApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetApplicationsAsync(array $args = [])\n * @method \\Aws\\Result batchGetDeploymentGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetDeploymentGroupsAsync(array $args = [])\n * @method \\Aws\\Result batchGetDeploymentInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetDeploymentInstancesAsync(array $args = [])\n * @method \\Aws\\Result batchGetDeploymentTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetDeploymentTargetsAsync(array $args = [])\n * @method \\Aws\\Result batchGetDeployments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetDeploymentsAsync(array $args = [])\n * @method \\Aws\\Result batchGetOnPremisesInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetOnPremisesInstancesAsync(array $args = [])\n * @method \\Aws\\Result continueDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise continueDeploymentAsync(array $args = [])\n * @method \\Aws\\Result createApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationAsync(array $args = [])\n * @method \\Aws\\Result createDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeploymentAsync(array $args = [])\n * @method \\Aws\\Result createDeploymentConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeploymentConfigAsync(array $args = [])\n * @method \\Aws\\Result createDeploymentGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeploymentGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteDeploymentConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDeploymentConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteDeploymentGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDeploymentGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteGitHubAccountToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGitHubAccountTokenAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcesByExternalId(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcesByExternalIdAsync(array $args = [])\n * @method \\Aws\\Result deregisterOnPremisesInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterOnPremisesInstanceAsync(array $args = [])\n * @method \\Aws\\Result getApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApplicationAsync(array $args = [])\n * @method \\Aws\\Result getApplicationRevision(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApplicationRevisionAsync(array $args = [])\n * @method \\Aws\\Result getDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeploymentAsync(array $args = [])\n * @method \\Aws\\Result getDeploymentConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeploymentConfigAsync(array $args = [])\n * @method \\Aws\\Result getDeploymentGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeploymentGroupAsync(array $args = [])\n * @method \\Aws\\Result getDeploymentInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeploymentInstanceAsync(array $args = [])\n * @method \\Aws\\Result getDeploymentTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeploymentTargetAsync(array $args = [])\n * @method \\Aws\\Result getOnPremisesInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOnPremisesInstanceAsync(array $args = [])\n * @method \\Aws\\Result listApplicationRevisions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationRevisionsAsync(array $args = [])\n * @method \\Aws\\Result listApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listDeploymentConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeploymentConfigsAsync(array $args = [])\n * @method \\Aws\\Result listDeploymentGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeploymentGroupsAsync(array $args = [])\n * @method \\Aws\\Result listDeploymentInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeploymentInstancesAsync(array $args = [])\n * @method \\Aws\\Result listDeploymentTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeploymentTargetsAsync(array $args = [])\n * @method \\Aws\\Result listDeployments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeploymentsAsync(array $args = [])\n * @method \\Aws\\Result listGitHubAccountTokenNames(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGitHubAccountTokenNamesAsync(array $args = [])\n * @method \\Aws\\Result listOnPremisesInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOnPremisesInstancesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putLifecycleEventHookExecutionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putLifecycleEventHookExecutionStatusAsync(array $args = [])\n * @method \\Aws\\Result registerApplicationRevision(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerApplicationRevisionAsync(array $args = [])\n * @method \\Aws\\Result registerOnPremisesInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerOnPremisesInstanceAsync(array $args = [])\n * @method \\Aws\\Result removeTagsFromOnPremisesInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsFromOnPremisesInstancesAsync(array $args = [])\n * @method \\Aws\\Result skipWaitTimeForInstanceTermination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise skipWaitTimeForInstanceTerminationAsync(array $args = [])\n * @method \\Aws\\Result stopDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopDeploymentAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationAsync(array $args = [])\n * @method \\Aws\\Result updateDeploymentGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDeploymentGroupAsync(array $args = [])\n */\nclass CodeDeployClient extends AwsClient {}\n", "num_lines": 105}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeDeploy\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with AWS CodeDeploy.\n */\nclass CodeDeployException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeGuruProfiler;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon CodeGuru Profiler** service.\n * @method \\Aws\\Result addNotificationChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addNotificationChannelsAsync(array $args = [])\n * @method \\Aws\\Result batchGetFrameMetricData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetFrameMetricDataAsync(array $args = [])\n * @method \\Aws\\Result configureAgent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise configureAgentAsync(array $args = [])\n * @method \\Aws\\Result createProfilingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProfilingGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteProfilingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProfilingGroupAsync(array $args = [])\n * @method \\Aws\\Result describeProfilingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProfilingGroupAsync(array $args = [])\n * @method \\Aws\\Result getFindingsReportAccountSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFindingsReportAccountSummaryAsync(array $args = [])\n * @method \\Aws\\Result getNotificationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNotificationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPolicyAsync(array $args = [])\n * @method \\Aws\\Result getProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProfileAsync(array $args = [])\n * @method \\Aws\\Result getRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result listFindingsReports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFindingsReportsAsync(array $args = [])\n * @method \\Aws\\Result listProfileTimes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProfileTimesAsync(array $args = [])\n * @method \\Aws\\Result listProfilingGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProfilingGroupsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result postAgentProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise postAgentProfileAsync(array $args = [])\n * @method \\Aws\\Result putPermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPermissionAsync(array $args = [])\n * @method \\Aws\\Result removeNotificationChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeNotificationChannelAsync(array $args = [])\n * @method \\Aws\\Result removePermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removePermissionAsync(array $args = [])\n * @method \\Aws\\Result submitFeedback(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise submitFeedbackAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateProfilingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProfilingGroupAsync(array $args = [])\n */\nclass CodeGuruProfilerClient extends AwsClient {}\n", "num_lines": 56}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeGuruProfiler\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon CodeGuru Profiler** service.\n */\nclass CodeGuruProfilerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeGuruReviewer;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon CodeGuru Reviewer** service.\n * @method \\Aws\\Result associateRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateRepositoryAsync(array $args = [])\n * @method \\Aws\\Result createCodeReview(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCodeReviewAsync(array $args = [])\n * @method \\Aws\\Result describeCodeReview(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCodeReviewAsync(array $args = [])\n * @method \\Aws\\Result describeRecommendationFeedback(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRecommendationFeedbackAsync(array $args = [])\n * @method \\Aws\\Result describeRepositoryAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRepositoryAssociationAsync(array $args = [])\n * @method \\Aws\\Result disassociateRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateRepositoryAsync(array $args = [])\n * @method \\Aws\\Result listCodeReviews(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCodeReviewsAsync(array $args = [])\n * @method \\Aws\\Result listRecommendationFeedback(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecommendationFeedbackAsync(array $args = [])\n * @method \\Aws\\Result listRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result listRepositoryAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRepositoryAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putRecommendationFeedback(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRecommendationFeedbackAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass CodeGuruReviewerClient extends AwsClient {}\n", "num_lines": 38}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeGuruReviewer\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon CodeGuru Reviewer** service.\n */\nclass CodeGuruReviewerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeGuruSecurity;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon CodeGuru Security** service.\n * @method \\Aws\\Result batchGetFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetFindingsAsync(array $args = [])\n * @method \\Aws\\Result createScan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createScanAsync(array $args = [])\n * @method \\Aws\\Result createUploadUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUploadUrlAsync(array $args = [])\n * @method \\Aws\\Result getAccountConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFindingsAsync(array $args = [])\n * @method \\Aws\\Result getMetricsSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMetricsSummaryAsync(array $args = [])\n * @method \\Aws\\Result getScan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getScanAsync(array $args = [])\n * @method \\Aws\\Result listFindingsMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFindingsMetricsAsync(array $args = [])\n * @method \\Aws\\Result listScans(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listScansAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAccountConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccountConfigurationAsync(array $args = [])\n */\nclass CodeGuruSecurityClient extends AwsClient {}\n", "num_lines": 36}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeGuruSecurity\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon CodeGuru Security** service.\n */\nclass CodeGuruSecurityException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodePipeline;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon CodePipeline** service.\n *\n * @method \\Aws\\Result acknowledgeJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acknowledgeJobAsync(array $args = [])\n * @method \\Aws\\Result acknowledgeThirdPartyJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acknowledgeThirdPartyJobAsync(array $args = [])\n * @method \\Aws\\Result createCustomActionType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCustomActionTypeAsync(array $args = [])\n * @method \\Aws\\Result createPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPipelineAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomActionType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomActionTypeAsync(array $args = [])\n * @method \\Aws\\Result deletePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePipelineAsync(array $args = [])\n * @method \\Aws\\Result deleteWebhook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWebhookAsync(array $args = [])\n * @method \\Aws\\Result deregisterWebhookWithThirdParty(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterWebhookWithThirdPartyAsync(array $args = [])\n * @method \\Aws\\Result disableStageTransition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableStageTransitionAsync(array $args = [])\n * @method \\Aws\\Result enableStageTransition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableStageTransitionAsync(array $args = [])\n * @method \\Aws\\Result getActionType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getActionTypeAsync(array $args = [])\n * @method \\Aws\\Result getJobDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobDetailsAsync(array $args = [])\n * @method \\Aws\\Result getPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPipelineAsync(array $args = [])\n * @method \\Aws\\Result getPipelineExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPipelineExecutionAsync(array $args = [])\n * @method \\Aws\\Result getPipelineState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPipelineStateAsync(array $args = [])\n * @method \\Aws\\Result getThirdPartyJobDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getThirdPartyJobDetailsAsync(array $args = [])\n * @method \\Aws\\Result listActionExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listActionExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listActionTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listActionTypesAsync(array $args = [])\n * @method \\Aws\\Result listPipelineExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPipelineExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listPipelines(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPipelinesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWebhooks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWebhooksAsync(array $args = [])\n * @method \\Aws\\Result pollForJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise pollForJobsAsync(array $args = [])\n * @method \\Aws\\Result pollForThirdPartyJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise pollForThirdPartyJobsAsync(array $args = [])\n * @method \\Aws\\Result putActionRevision(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putActionRevisionAsync(array $args = [])\n * @method \\Aws\\Result putApprovalResult(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putApprovalResultAsync(array $args = [])\n * @method \\Aws\\Result putJobFailureResult(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putJobFailureResultAsync(array $args = [])\n * @method \\Aws\\Result putJobSuccessResult(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putJobSuccessResultAsync(array $args = [])\n * @method \\Aws\\Result putThirdPartyJobFailureResult(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putThirdPartyJobFailureResultAsync(array $args = [])\n * @method \\Aws\\Result putThirdPartyJobSuccessResult(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putThirdPartyJobSuccessResultAsync(array $args = [])\n * @method \\Aws\\Result putWebhook(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putWebhookAsync(array $args = [])\n * @method \\Aws\\Result registerWebhookWithThirdParty(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerWebhookWithThirdPartyAsync(array $args = [])\n * @method \\Aws\\Result retryStageExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise retryStageExecutionAsync(array $args = [])\n * @method \\Aws\\Result startPipelineExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startPipelineExecutionAsync(array $args = [])\n * @method \\Aws\\Result stopPipelineExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopPipelineExecutionAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateActionType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateActionTypeAsync(array $args = [])\n * @method \\Aws\\Result updatePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePipelineAsync(array $args = [])\n */\nclass CodePipelineClient extends AwsClient {}", "num_lines": 88}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodePipeline\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon CodePipeline service.\n */\nclass CodePipelineException extends AwsException {}", "num_lines": 9}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeStar;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS CodeStar** service.\n * @method \\Aws\\Result associateTeamMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateTeamMemberAsync(array $args = [])\n * @method \\Aws\\Result createProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProjectAsync(array $args = [])\n * @method \\Aws\\Result createUserProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProjectAsync(array $args = [])\n * @method \\Aws\\Result deleteUserProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserProfileAsync(array $args = [])\n * @method \\Aws\\Result describeProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProjectAsync(array $args = [])\n * @method \\Aws\\Result describeUserProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserProfileAsync(array $args = [])\n * @method \\Aws\\Result disassociateTeamMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateTeamMemberAsync(array $args = [])\n * @method \\Aws\\Result listProjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProjectsAsync(array $args = [])\n * @method \\Aws\\Result listResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourcesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForProjectAsync(array $args = [])\n * @method \\Aws\\Result listTeamMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTeamMembersAsync(array $args = [])\n * @method \\Aws\\Result listUserProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUserProfilesAsync(array $args = [])\n * @method \\Aws\\Result tagProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagProjectAsync(array $args = [])\n * @method \\Aws\\Result untagProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagProjectAsync(array $args = [])\n * @method \\Aws\\Result updateProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProjectAsync(array $args = [])\n * @method \\Aws\\Result updateTeamMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTeamMemberAsync(array $args = [])\n * @method \\Aws\\Result updateUserProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserProfileAsync(array $args = [])\n */\nclass CodeStarClient extends AwsClient {}\n", "num_lines": 46}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeStar\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS CodeStar** service.\n */\nclass CodeStarException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeStarconnections;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS CodeStar connections** service.\n * @method \\Aws\\Result createConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConnectionAsync(array $args = [])\n * @method \\Aws\\Result createHost(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHostAsync(array $args = [])\n * @method \\Aws\\Result deleteConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteHost(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHostAsync(array $args = [])\n * @method \\Aws\\Result getConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConnectionAsync(array $args = [])\n * @method \\Aws\\Result getHost(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getHostAsync(array $args = [])\n * @method \\Aws\\Result listConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConnectionsAsync(array $args = [])\n * @method \\Aws\\Result listHosts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHostsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateHost(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateHostAsync(array $args = [])\n */\nclass CodeStarconnectionsClient extends AwsClient {}\n", "num_lines": 34}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeStarconnections\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS CodeStar connections** service.\n */\nclass CodeStarconnectionsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeStarNotifications;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS CodeStar Notifications** service.\n * @method \\Aws\\Result createNotificationRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNotificationRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteNotificationRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNotificationRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTargetAsync(array $args = [])\n * @method \\Aws\\Result describeNotificationRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNotificationRuleAsync(array $args = [])\n * @method \\Aws\\Result listEventTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventTypesAsync(array $args = [])\n * @method \\Aws\\Result listNotificationRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNotificationRulesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTargetsAsync(array $args = [])\n * @method \\Aws\\Result subscribe(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise subscribeAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result unsubscribe(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unsubscribeAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateNotificationRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNotificationRuleAsync(array $args = [])\n */\nclass CodeStarNotificationsClient extends AwsClient {}\n", "num_lines": 36}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CodeStarNotifications\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS CodeStar Notifications** service.\n */\nclass CodeStarNotificationsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CognitoIdentity;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Cognito Identity** service.\n *\n * @method \\Aws\\Result createIdentityPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIdentityPoolAsync(array $args = [])\n * @method \\Aws\\Result deleteIdentities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIdentitiesAsync(array $args = [])\n * @method \\Aws\\Result deleteIdentityPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIdentityPoolAsync(array $args = [])\n * @method \\Aws\\Result describeIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeIdentityAsync(array $args = [])\n * @method \\Aws\\Result describeIdentityPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeIdentityPoolAsync(array $args = [])\n * @method \\Aws\\Result getCredentialsForIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCredentialsForIdentityAsync(array $args = [])\n * @method \\Aws\\Result getId(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIdAsync(array $args = [])\n * @method \\Aws\\Result getIdentityPoolRoles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIdentityPoolRolesAsync(array $args = [])\n * @method \\Aws\\Result getOpenIdToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOpenIdTokenAsync(array $args = [])\n * @method \\Aws\\Result getOpenIdTokenForDeveloperIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOpenIdTokenForDeveloperIdentityAsync(array $args = [])\n * @method \\Aws\\Result getPrincipalTagAttributeMap(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPrincipalTagAttributeMapAsync(array $args = [])\n * @method \\Aws\\Result listIdentities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIdentitiesAsync(array $args = [])\n * @method \\Aws\\Result listIdentityPools(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIdentityPoolsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result lookupDeveloperIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise lookupDeveloperIdentityAsync(array $args = [])\n * @method \\Aws\\Result mergeDeveloperIdentities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise mergeDeveloperIdentitiesAsync(array $args = [])\n * @method \\Aws\\Result setIdentityPoolRoles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setIdentityPoolRolesAsync(array $args = [])\n * @method \\Aws\\Result setPrincipalTagAttributeMap(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setPrincipalTagAttributeMapAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result unlinkDeveloperIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unlinkDeveloperIdentityAsync(array $args = [])\n * @method \\Aws\\Result unlinkIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unlinkIdentityAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateIdentityPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIdentityPoolAsync(array $args = [])\n */\nclass CognitoIdentityClient extends AwsClient {}\n", "num_lines": 57}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CognitoIdentity;\n\nuse Aws\\Credentials\\Credentials;\nuse GuzzleHttp\\Promise;\n\nclass CognitoIdentityProvider\n{\n    /** @var CognitoIdentityClient */\n    private $client;\n    /** @var string */\n    private $identityPoolId;\n    /** @var string|null */\n    private $accountId;\n    /** @var array */\n    private $logins;\n\n    public function __construct(\n        $poolId,\n        array $clientOptions,\n        array $logins = [],\n        $accountId = null\n    ) {\n        $this->identityPoolId = $poolId;\n        $this->logins = $logins;\n        $this->accountId = $accountId;\n        $this->client = new CognitoIdentityClient($clientOptions + [\n            'credentials' => false,\n        ]);\n    }\n\n    public function __invoke()\n    {\n        return Promise\\Coroutine::of(function () {\n            $params = $this->logins ? ['Logins' => $this->logins] : [];\n            $getIdParams = $params + ['IdentityPoolId' => $this->identityPoolId];\n            if ($this->accountId) {\n                $getIdParams['AccountId'] = $this->accountId;\n            }\n\n            $id = (yield $this->client->getId($getIdParams));\n            $result = (yield $this->client->getCredentialsForIdentity([\n                'IdentityId' => $id['IdentityId'],\n            ] + $params));\n\n            yield new Credentials(\n                $result['Credentials']['AccessKeyId'],\n                $result['Credentials']['SecretKey'],\n                $result['Credentials']['SessionToken'],\n                (int) $result['Credentials']['Expiration']->format('U')\n            );\n        });\n    }\n\n    public function updateLogin($key, $value)\n    {\n        $this->logins[$key] = $value;\n\n        return $this;\n    }\n}\n", "num_lines": 62}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CognitoIdentity\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon Cognito Identity Logs service.\n */\nclass CognitoIdentityException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CognitoIdentityProvider;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Cognito Identity Provider** service.\n * \n * @method \\Aws\\Result addCustomAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addCustomAttributesAsync(array $args = [])\n * @method \\Aws\\Result adminAddUserToGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminAddUserToGroupAsync(array $args = [])\n * @method \\Aws\\Result adminConfirmSignUp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminConfirmSignUpAsync(array $args = [])\n * @method \\Aws\\Result adminCreateUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminCreateUserAsync(array $args = [])\n * @method \\Aws\\Result adminDeleteUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminDeleteUserAsync(array $args = [])\n * @method \\Aws\\Result adminDeleteUserAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminDeleteUserAttributesAsync(array $args = [])\n * @method \\Aws\\Result adminDisableProviderForUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminDisableProviderForUserAsync(array $args = [])\n * @method \\Aws\\Result adminDisableUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminDisableUserAsync(array $args = [])\n * @method \\Aws\\Result adminEnableUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminEnableUserAsync(array $args = [])\n * @method \\Aws\\Result adminForgetDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminForgetDeviceAsync(array $args = [])\n * @method \\Aws\\Result adminGetDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminGetDeviceAsync(array $args = [])\n * @method \\Aws\\Result adminGetUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminGetUserAsync(array $args = [])\n * @method \\Aws\\Result adminInitiateAuth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminInitiateAuthAsync(array $args = [])\n * @method \\Aws\\Result adminLinkProviderForUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminLinkProviderForUserAsync(array $args = [])\n * @method \\Aws\\Result adminListDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminListDevicesAsync(array $args = [])\n * @method \\Aws\\Result adminListGroupsForUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminListGroupsForUserAsync(array $args = [])\n * @method \\Aws\\Result adminListUserAuthEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminListUserAuthEventsAsync(array $args = [])\n * @method \\Aws\\Result adminRemoveUserFromGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminRemoveUserFromGroupAsync(array $args = [])\n * @method \\Aws\\Result adminResetUserPassword(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminResetUserPasswordAsync(array $args = [])\n * @method \\Aws\\Result adminRespondToAuthChallenge(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminRespondToAuthChallengeAsync(array $args = [])\n * @method \\Aws\\Result adminSetUserMFAPreference(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminSetUserMFAPreferenceAsync(array $args = [])\n * @method \\Aws\\Result adminSetUserPassword(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminSetUserPasswordAsync(array $args = [])\n * @method \\Aws\\Result adminSetUserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminSetUserSettingsAsync(array $args = [])\n * @method \\Aws\\Result adminUpdateAuthEventFeedback(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminUpdateAuthEventFeedbackAsync(array $args = [])\n * @method \\Aws\\Result adminUpdateDeviceStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminUpdateDeviceStatusAsync(array $args = [])\n * @method \\Aws\\Result adminUpdateUserAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminUpdateUserAttributesAsync(array $args = [])\n * @method \\Aws\\Result adminUserGlobalSignOut(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise adminUserGlobalSignOutAsync(array $args = [])\n * @method \\Aws\\Result associateSoftwareToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateSoftwareTokenAsync(array $args = [])\n * @method \\Aws\\Result changePassword(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise changePasswordAsync(array $args = [])\n * @method \\Aws\\Result confirmDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise confirmDeviceAsync(array $args = [])\n * @method \\Aws\\Result confirmForgotPassword(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise confirmForgotPasswordAsync(array $args = [])\n * @method \\Aws\\Result confirmSignUp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise confirmSignUpAsync(array $args = [])\n * @method \\Aws\\Result createGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGroupAsync(array $args = [])\n * @method \\Aws\\Result createIdentityProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIdentityProviderAsync(array $args = [])\n * @method \\Aws\\Result createResourceServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResourceServerAsync(array $args = [])\n * @method \\Aws\\Result createUserImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserImportJobAsync(array $args = [])\n * @method \\Aws\\Result createUserPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserPoolAsync(array $args = [])\n * @method \\Aws\\Result createUserPoolClient(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserPoolClientAsync(array $args = [])\n * @method \\Aws\\Result createUserPoolDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserPoolDomainAsync(array $args = [])\n * @method \\Aws\\Result deleteGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteIdentityProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIdentityProviderAsync(array $args = [])\n * @method \\Aws\\Result deleteResourceServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourceServerAsync(array $args = [])\n * @method \\Aws\\Result deleteUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserAsync(array $args = [])\n * @method \\Aws\\Result deleteUserAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserAttributesAsync(array $args = [])\n * @method \\Aws\\Result deleteUserPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserPoolAsync(array $args = [])\n * @method \\Aws\\Result deleteUserPoolClient(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserPoolClientAsync(array $args = [])\n * @method \\Aws\\Result deleteUserPoolDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserPoolDomainAsync(array $args = [])\n * @method \\Aws\\Result describeIdentityProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeIdentityProviderAsync(array $args = [])\n * @method \\Aws\\Result describeResourceServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeResourceServerAsync(array $args = [])\n * @method \\Aws\\Result describeRiskConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRiskConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeUserImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserImportJobAsync(array $args = [])\n * @method \\Aws\\Result describeUserPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserPoolAsync(array $args = [])\n * @method \\Aws\\Result describeUserPoolClient(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserPoolClientAsync(array $args = [])\n * @method \\Aws\\Result describeUserPoolDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserPoolDomainAsync(array $args = [])\n * @method \\Aws\\Result forgetDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise forgetDeviceAsync(array $args = [])\n * @method \\Aws\\Result forgotPassword(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise forgotPasswordAsync(array $args = [])\n * @method \\Aws\\Result getCSVHeader(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCSVHeaderAsync(array $args = [])\n * @method \\Aws\\Result getDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeviceAsync(array $args = [])\n * @method \\Aws\\Result getGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGroupAsync(array $args = [])\n * @method \\Aws\\Result getIdentityProviderByIdentifier(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIdentityProviderByIdentifierAsync(array $args = [])\n * @method \\Aws\\Result getSigningCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSigningCertificateAsync(array $args = [])\n * @method \\Aws\\Result getUICustomization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUICustomizationAsync(array $args = [])\n * @method \\Aws\\Result getUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUserAsync(array $args = [])\n * @method \\Aws\\Result getUserAttributeVerificationCode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUserAttributeVerificationCodeAsync(array $args = [])\n * @method \\Aws\\Result getUserPoolMfaConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUserPoolMfaConfigAsync(array $args = [])\n * @method \\Aws\\Result globalSignOut(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise globalSignOutAsync(array $args = [])\n * @method \\Aws\\Result initiateAuth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise initiateAuthAsync(array $args = [])\n * @method \\Aws\\Result listDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDevicesAsync(array $args = [])\n * @method \\Aws\\Result listGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupsAsync(array $args = [])\n * @method \\Aws\\Result listIdentityProviders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIdentityProvidersAsync(array $args = [])\n * @method \\Aws\\Result listResourceServers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceServersAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listUserImportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUserImportJobsAsync(array $args = [])\n * @method \\Aws\\Result listUserPoolClients(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUserPoolClientsAsync(array $args = [])\n * @method \\Aws\\Result listUserPools(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUserPoolsAsync(array $args = [])\n * @method \\Aws\\Result listUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUsersAsync(array $args = [])\n * @method \\Aws\\Result listUsersInGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUsersInGroupAsync(array $args = [])\n * @method \\Aws\\Result resendConfirmationCode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resendConfirmationCodeAsync(array $args = [])\n * @method \\Aws\\Result respondToAuthChallenge(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise respondToAuthChallengeAsync(array $args = [])\n * @method \\Aws\\Result revokeToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeTokenAsync(array $args = [])\n * @method \\Aws\\Result setRiskConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setRiskConfigurationAsync(array $args = [])\n * @method \\Aws\\Result setUICustomization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setUICustomizationAsync(array $args = [])\n * @method \\Aws\\Result setUserMFAPreference(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setUserMFAPreferenceAsync(array $args = [])\n * @method \\Aws\\Result setUserPoolMfaConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setUserPoolMfaConfigAsync(array $args = [])\n * @method \\Aws\\Result setUserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setUserSettingsAsync(array $args = [])\n * @method \\Aws\\Result signUp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise signUpAsync(array $args = [])\n * @method \\Aws\\Result startUserImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startUserImportJobAsync(array $args = [])\n * @method \\Aws\\Result stopUserImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopUserImportJobAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAuthEventFeedback(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAuthEventFeedbackAsync(array $args = [])\n * @method \\Aws\\Result updateDeviceStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDeviceStatusAsync(array $args = [])\n * @method \\Aws\\Result updateGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGroupAsync(array $args = [])\n * @method \\Aws\\Result updateIdentityProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIdentityProviderAsync(array $args = [])\n * @method \\Aws\\Result updateResourceServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResourceServerAsync(array $args = [])\n * @method \\Aws\\Result updateUserAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserAttributesAsync(array $args = [])\n * @method \\Aws\\Result updateUserPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserPoolAsync(array $args = [])\n * @method \\Aws\\Result updateUserPoolClient(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserPoolClientAsync(array $args = [])\n * @method \\Aws\\Result updateUserPoolDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserPoolDomainAsync(array $args = [])\n * @method \\Aws\\Result verifySoftwareToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise verifySoftwareTokenAsync(array $args = [])\n * @method \\Aws\\Result verifyUserAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise verifyUserAttributeAsync(array $args = [])\n */\nclass CognitoIdentityProviderClient extends AwsClient {}\n", "num_lines": 213}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CognitoIdentityProvider\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Cognito Identity Provider** service.\n */\nclass CognitoIdentityProviderException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CognitoSync;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Cognito Sync** service.\n *\n * @method \\Aws\\Result bulkPublish(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise bulkPublishAsync(array $args = [])\n * @method \\Aws\\Result deleteDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDatasetAsync(array $args = [])\n * @method \\Aws\\Result describeDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDatasetAsync(array $args = [])\n * @method \\Aws\\Result describeIdentityPoolUsage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeIdentityPoolUsageAsync(array $args = [])\n * @method \\Aws\\Result describeIdentityUsage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeIdentityUsageAsync(array $args = [])\n * @method \\Aws\\Result getBulkPublishDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBulkPublishDetailsAsync(array $args = [])\n * @method \\Aws\\Result getCognitoEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCognitoEventsAsync(array $args = [])\n * @method \\Aws\\Result getIdentityPoolConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIdentityPoolConfigurationAsync(array $args = [])\n * @method \\Aws\\Result listDatasets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetsAsync(array $args = [])\n * @method \\Aws\\Result listIdentityPoolUsage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIdentityPoolUsageAsync(array $args = [])\n * @method \\Aws\\Result listRecords(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecordsAsync(array $args = [])\n * @method \\Aws\\Result registerDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerDeviceAsync(array $args = [])\n * @method \\Aws\\Result setCognitoEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setCognitoEventsAsync(array $args = [])\n * @method \\Aws\\Result setIdentityPoolConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setIdentityPoolConfigurationAsync(array $args = [])\n * @method \\Aws\\Result subscribeToDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise subscribeToDatasetAsync(array $args = [])\n * @method \\Aws\\Result unsubscribeFromDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unsubscribeFromDatasetAsync(array $args = [])\n * @method \\Aws\\Result updateRecords(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRecordsAsync(array $args = [])\n */\nclass CognitoSyncClient extends AwsClient {}\n", "num_lines": 45}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CognitoSync\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon Cognito Sync service.\n */\nclass CognitoSyncException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Comprehend;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Comprehend** service.\n * @method \\Aws\\Result batchDetectDominantLanguage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDetectDominantLanguageAsync(array $args = [])\n * @method \\Aws\\Result batchDetectEntities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDetectEntitiesAsync(array $args = [])\n * @method \\Aws\\Result batchDetectKeyPhrases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDetectKeyPhrasesAsync(array $args = [])\n * @method \\Aws\\Result batchDetectSentiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDetectSentimentAsync(array $args = [])\n * @method \\Aws\\Result batchDetectSyntax(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDetectSyntaxAsync(array $args = [])\n * @method \\Aws\\Result batchDetectTargetedSentiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDetectTargetedSentimentAsync(array $args = [])\n * @method \\Aws\\Result classifyDocument(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise classifyDocumentAsync(array $args = [])\n * @method \\Aws\\Result containsPiiEntities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise containsPiiEntitiesAsync(array $args = [])\n * @method \\Aws\\Result createDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatasetAsync(array $args = [])\n * @method \\Aws\\Result createDocumentClassifier(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDocumentClassifierAsync(array $args = [])\n * @method \\Aws\\Result createEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEndpointAsync(array $args = [])\n * @method \\Aws\\Result createEntityRecognizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEntityRecognizerAsync(array $args = [])\n * @method \\Aws\\Result createFlywheel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFlywheelAsync(array $args = [])\n * @method \\Aws\\Result deleteDocumentClassifier(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDocumentClassifierAsync(array $args = [])\n * @method \\Aws\\Result deleteEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteEntityRecognizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEntityRecognizerAsync(array $args = [])\n * @method \\Aws\\Result deleteFlywheel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFlywheelAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result describeDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDatasetAsync(array $args = [])\n * @method \\Aws\\Result describeDocumentClassificationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDocumentClassificationJobAsync(array $args = [])\n * @method \\Aws\\Result describeDocumentClassifier(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDocumentClassifierAsync(array $args = [])\n * @method \\Aws\\Result describeDominantLanguageDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDominantLanguageDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result describeEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEndpointAsync(array $args = [])\n * @method \\Aws\\Result describeEntitiesDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEntitiesDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result describeEntityRecognizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEntityRecognizerAsync(array $args = [])\n * @method \\Aws\\Result describeEventsDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventsDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result describeFlywheel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFlywheelAsync(array $args = [])\n * @method \\Aws\\Result describeFlywheelIteration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFlywheelIterationAsync(array $args = [])\n * @method \\Aws\\Result describeKeyPhrasesDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeKeyPhrasesDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result describePiiEntitiesDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePiiEntitiesDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result describeResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result describeSentimentDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSentimentDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result describeTargetedSentimentDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTargetedSentimentDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result describeTopicsDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTopicsDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result detectDominantLanguage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectDominantLanguageAsync(array $args = [])\n * @method \\Aws\\Result detectEntities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectEntitiesAsync(array $args = [])\n * @method \\Aws\\Result detectKeyPhrases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectKeyPhrasesAsync(array $args = [])\n * @method \\Aws\\Result detectPiiEntities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectPiiEntitiesAsync(array $args = [])\n * @method \\Aws\\Result detectSentiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectSentimentAsync(array $args = [])\n * @method \\Aws\\Result detectSyntax(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectSyntaxAsync(array $args = [])\n * @method \\Aws\\Result detectTargetedSentiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectTargetedSentimentAsync(array $args = [])\n * @method \\Aws\\Result importModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importModelAsync(array $args = [])\n * @method \\Aws\\Result listDatasets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetsAsync(array $args = [])\n * @method \\Aws\\Result listDocumentClassificationJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDocumentClassificationJobsAsync(array $args = [])\n * @method \\Aws\\Result listDocumentClassifierSummaries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDocumentClassifierSummariesAsync(array $args = [])\n * @method \\Aws\\Result listDocumentClassifiers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDocumentClassifiersAsync(array $args = [])\n * @method \\Aws\\Result listDominantLanguageDetectionJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDominantLanguageDetectionJobsAsync(array $args = [])\n * @method \\Aws\\Result listEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEndpointsAsync(array $args = [])\n * @method \\Aws\\Result listEntitiesDetectionJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEntitiesDetectionJobsAsync(array $args = [])\n * @method \\Aws\\Result listEntityRecognizerSummaries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEntityRecognizerSummariesAsync(array $args = [])\n * @method \\Aws\\Result listEntityRecognizers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEntityRecognizersAsync(array $args = [])\n * @method \\Aws\\Result listEventsDetectionJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventsDetectionJobsAsync(array $args = [])\n * @method \\Aws\\Result listFlywheelIterationHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFlywheelIterationHistoryAsync(array $args = [])\n * @method \\Aws\\Result listFlywheels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFlywheelsAsync(array $args = [])\n * @method \\Aws\\Result listKeyPhrasesDetectionJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listKeyPhrasesDetectionJobsAsync(array $args = [])\n * @method \\Aws\\Result listPiiEntitiesDetectionJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPiiEntitiesDetectionJobsAsync(array $args = [])\n * @method \\Aws\\Result listSentimentDetectionJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSentimentDetectionJobsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTargetedSentimentDetectionJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTargetedSentimentDetectionJobsAsync(array $args = [])\n * @method \\Aws\\Result listTopicsDetectionJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTopicsDetectionJobsAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result startDocumentClassificationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDocumentClassificationJobAsync(array $args = [])\n * @method \\Aws\\Result startDominantLanguageDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDominantLanguageDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result startEntitiesDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startEntitiesDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result startEventsDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startEventsDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result startFlywheelIteration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startFlywheelIterationAsync(array $args = [])\n * @method \\Aws\\Result startKeyPhrasesDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startKeyPhrasesDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result startPiiEntitiesDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startPiiEntitiesDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result startSentimentDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSentimentDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result startTargetedSentimentDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startTargetedSentimentDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result startTopicsDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startTopicsDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result stopDominantLanguageDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopDominantLanguageDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result stopEntitiesDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopEntitiesDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result stopEventsDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopEventsDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result stopKeyPhrasesDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopKeyPhrasesDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result stopPiiEntitiesDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopPiiEntitiesDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result stopSentimentDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopSentimentDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result stopTargetedSentimentDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopTargetedSentimentDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result stopTrainingDocumentClassifier(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopTrainingDocumentClassifierAsync(array $args = [])\n * @method \\Aws\\Result stopTrainingEntityRecognizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopTrainingEntityRecognizerAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEndpointAsync(array $args = [])\n * @method \\Aws\\Result updateFlywheel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFlywheelAsync(array $args = [])\n */\nclass ComprehendClient extends AwsClient {}\n", "num_lines": 178}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Comprehend\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Comprehend** service.\n */\nclass ComprehendException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ComprehendMedical;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Comprehend Medical** service.\n * @method \\Aws\\Result describeEntitiesDetectionV2Job(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEntitiesDetectionV2JobAsync(array $args = [])\n * @method \\Aws\\Result describeICD10CMInferenceJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeICD10CMInferenceJobAsync(array $args = [])\n * @method \\Aws\\Result describePHIDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePHIDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result describeRxNormInferenceJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRxNormInferenceJobAsync(array $args = [])\n * @method \\Aws\\Result describeSNOMEDCTInferenceJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSNOMEDCTInferenceJobAsync(array $args = [])\n * @method \\Aws\\Result detectEntities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectEntitiesAsync(array $args = [])\n * @method \\Aws\\Result detectEntitiesV2(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectEntitiesV2Async(array $args = [])\n * @method \\Aws\\Result detectPHI(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectPHIAsync(array $args = [])\n * @method \\Aws\\Result inferICD10CM(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise inferICD10CMAsync(array $args = [])\n * @method \\Aws\\Result inferRxNorm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise inferRxNormAsync(array $args = [])\n * @method \\Aws\\Result inferSNOMEDCT(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise inferSNOMEDCTAsync(array $args = [])\n * @method \\Aws\\Result listEntitiesDetectionV2Jobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEntitiesDetectionV2JobsAsync(array $args = [])\n * @method \\Aws\\Result listICD10CMInferenceJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listICD10CMInferenceJobsAsync(array $args = [])\n * @method \\Aws\\Result listPHIDetectionJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPHIDetectionJobsAsync(array $args = [])\n * @method \\Aws\\Result listRxNormInferenceJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRxNormInferenceJobsAsync(array $args = [])\n * @method \\Aws\\Result listSNOMEDCTInferenceJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSNOMEDCTInferenceJobsAsync(array $args = [])\n * @method \\Aws\\Result startEntitiesDetectionV2Job(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startEntitiesDetectionV2JobAsync(array $args = [])\n * @method \\Aws\\Result startICD10CMInferenceJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startICD10CMInferenceJobAsync(array $args = [])\n * @method \\Aws\\Result startPHIDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startPHIDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result startRxNormInferenceJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startRxNormInferenceJobAsync(array $args = [])\n * @method \\Aws\\Result startSNOMEDCTInferenceJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSNOMEDCTInferenceJobAsync(array $args = [])\n * @method \\Aws\\Result stopEntitiesDetectionV2Job(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopEntitiesDetectionV2JobAsync(array $args = [])\n * @method \\Aws\\Result stopICD10CMInferenceJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopICD10CMInferenceJobAsync(array $args = [])\n * @method \\Aws\\Result stopPHIDetectionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopPHIDetectionJobAsync(array $args = [])\n * @method \\Aws\\Result stopRxNormInferenceJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopRxNormInferenceJobAsync(array $args = [])\n * @method \\Aws\\Result stopSNOMEDCTInferenceJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopSNOMEDCTInferenceJobAsync(array $args = [])\n */\nclass ComprehendMedicalClient extends AwsClient {}\n", "num_lines": 62}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ComprehendMedical\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Comprehend Medical** service.\n */\nclass ComprehendMedicalException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ComputeOptimizer;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Compute Optimizer** service.\n * @method \\Aws\\Result deleteRecommendationPreferences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRecommendationPreferencesAsync(array $args = [])\n * @method \\Aws\\Result describeRecommendationExportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRecommendationExportJobsAsync(array $args = [])\n * @method \\Aws\\Result exportAutoScalingGroupRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportAutoScalingGroupRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result exportEBSVolumeRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportEBSVolumeRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result exportEC2InstanceRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportEC2InstanceRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result exportECSServiceRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportECSServiceRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result exportLambdaFunctionRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportLambdaFunctionRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result getAutoScalingGroupRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAutoScalingGroupRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result getEBSVolumeRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEBSVolumeRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result getEC2InstanceRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEC2InstanceRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result getEC2RecommendationProjectedMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEC2RecommendationProjectedMetricsAsync(array $args = [])\n * @method \\Aws\\Result getECSServiceRecommendationProjectedMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getECSServiceRecommendationProjectedMetricsAsync(array $args = [])\n * @method \\Aws\\Result getECSServiceRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getECSServiceRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result getEffectiveRecommendationPreferences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEffectiveRecommendationPreferencesAsync(array $args = [])\n * @method \\Aws\\Result getEnrollmentStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEnrollmentStatusAsync(array $args = [])\n * @method \\Aws\\Result getEnrollmentStatusesForOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEnrollmentStatusesForOrganizationAsync(array $args = [])\n * @method \\Aws\\Result getLambdaFunctionRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLambdaFunctionRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result getRecommendationPreferences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRecommendationPreferencesAsync(array $args = [])\n * @method \\Aws\\Result getRecommendationSummaries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRecommendationSummariesAsync(array $args = [])\n * @method \\Aws\\Result putRecommendationPreferences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRecommendationPreferencesAsync(array $args = [])\n * @method \\Aws\\Result updateEnrollmentStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEnrollmentStatusAsync(array $args = [])\n */\nclass ComputeOptimizerClient extends AwsClient {}\n", "num_lines": 52}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ComputeOptimizer\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Compute Optimizer** service.\n */\nclass ComputeOptimizerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ConfigService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with AWS Config.\n *\n * @method \\Aws\\Result batchGetAggregateResourceConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetAggregateResourceConfigAsync(array $args = [])\n * @method \\Aws\\Result batchGetResourceConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetResourceConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteAggregationAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAggregationAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result deleteConfigRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteConfigurationAggregator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigurationAggregatorAsync(array $args = [])\n * @method \\Aws\\Result deleteConfigurationRecorder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigurationRecorderAsync(array $args = [])\n * @method \\Aws\\Result deleteConformancePack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConformancePackAsync(array $args = [])\n * @method \\Aws\\Result deleteDeliveryChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDeliveryChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteEvaluationResults(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEvaluationResultsAsync(array $args = [])\n * @method \\Aws\\Result deleteOrganizationConfigRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOrganizationConfigRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteOrganizationConformancePack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOrganizationConformancePackAsync(array $args = [])\n * @method \\Aws\\Result deletePendingAggregationRequest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePendingAggregationRequestAsync(array $args = [])\n * @method \\Aws\\Result deleteRemediationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRemediationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteRemediationExceptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRemediationExceptionsAsync(array $args = [])\n * @method \\Aws\\Result deleteResourceConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourceConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteRetentionConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRetentionConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteStoredQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStoredQueryAsync(array $args = [])\n * @method \\Aws\\Result deliverConfigSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deliverConfigSnapshotAsync(array $args = [])\n * @method \\Aws\\Result describeAggregateComplianceByConfigRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAggregateComplianceByConfigRulesAsync(array $args = [])\n * @method \\Aws\\Result describeAggregateComplianceByConformancePacks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAggregateComplianceByConformancePacksAsync(array $args = [])\n * @method \\Aws\\Result describeAggregationAuthorizations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAggregationAuthorizationsAsync(array $args = [])\n * @method \\Aws\\Result describeComplianceByConfigRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeComplianceByConfigRuleAsync(array $args = [])\n * @method \\Aws\\Result describeComplianceByResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeComplianceByResourceAsync(array $args = [])\n * @method \\Aws\\Result describeConfigRuleEvaluationStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConfigRuleEvaluationStatusAsync(array $args = [])\n * @method \\Aws\\Result describeConfigRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConfigRulesAsync(array $args = [])\n * @method \\Aws\\Result describeConfigurationAggregatorSourcesStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConfigurationAggregatorSourcesStatusAsync(array $args = [])\n * @method \\Aws\\Result describeConfigurationAggregators(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConfigurationAggregatorsAsync(array $args = [])\n * @method \\Aws\\Result describeConfigurationRecorderStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConfigurationRecorderStatusAsync(array $args = [])\n * @method \\Aws\\Result describeConfigurationRecorders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConfigurationRecordersAsync(array $args = [])\n * @method \\Aws\\Result describeConformancePackCompliance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConformancePackComplianceAsync(array $args = [])\n * @method \\Aws\\Result describeConformancePackStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConformancePackStatusAsync(array $args = [])\n * @method \\Aws\\Result describeConformancePacks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConformancePacksAsync(array $args = [])\n * @method \\Aws\\Result describeDeliveryChannelStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDeliveryChannelStatusAsync(array $args = [])\n * @method \\Aws\\Result describeDeliveryChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDeliveryChannelsAsync(array $args = [])\n * @method \\Aws\\Result describeOrganizationConfigRuleStatuses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrganizationConfigRuleStatusesAsync(array $args = [])\n * @method \\Aws\\Result describeOrganizationConfigRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrganizationConfigRulesAsync(array $args = [])\n * @method \\Aws\\Result describeOrganizationConformancePackStatuses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrganizationConformancePackStatusesAsync(array $args = [])\n * @method \\Aws\\Result describeOrganizationConformancePacks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrganizationConformancePacksAsync(array $args = [])\n * @method \\Aws\\Result describePendingAggregationRequests(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePendingAggregationRequestsAsync(array $args = [])\n * @method \\Aws\\Result describeRemediationConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRemediationConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result describeRemediationExceptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRemediationExceptionsAsync(array $args = [])\n * @method \\Aws\\Result describeRemediationExecutionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRemediationExecutionStatusAsync(array $args = [])\n * @method \\Aws\\Result describeRetentionConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRetentionConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result getAggregateComplianceDetailsByConfigRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAggregateComplianceDetailsByConfigRuleAsync(array $args = [])\n * @method \\Aws\\Result getAggregateConfigRuleComplianceSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAggregateConfigRuleComplianceSummaryAsync(array $args = [])\n * @method \\Aws\\Result getAggregateConformancePackComplianceSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAggregateConformancePackComplianceSummaryAsync(array $args = [])\n * @method \\Aws\\Result getAggregateDiscoveredResourceCounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAggregateDiscoveredResourceCountsAsync(array $args = [])\n * @method \\Aws\\Result getAggregateResourceConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAggregateResourceConfigAsync(array $args = [])\n * @method \\Aws\\Result getComplianceDetailsByConfigRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getComplianceDetailsByConfigRuleAsync(array $args = [])\n * @method \\Aws\\Result getComplianceDetailsByResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getComplianceDetailsByResourceAsync(array $args = [])\n * @method \\Aws\\Result getComplianceSummaryByConfigRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getComplianceSummaryByConfigRuleAsync(array $args = [])\n * @method \\Aws\\Result getComplianceSummaryByResourceType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getComplianceSummaryByResourceTypeAsync(array $args = [])\n * @method \\Aws\\Result getConformancePackComplianceDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConformancePackComplianceDetailsAsync(array $args = [])\n * @method \\Aws\\Result getConformancePackComplianceSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConformancePackComplianceSummaryAsync(array $args = [])\n * @method \\Aws\\Result getCustomRulePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCustomRulePolicyAsync(array $args = [])\n * @method \\Aws\\Result getDiscoveredResourceCounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDiscoveredResourceCountsAsync(array $args = [])\n * @method \\Aws\\Result getOrganizationConfigRuleDetailedStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOrganizationConfigRuleDetailedStatusAsync(array $args = [])\n * @method \\Aws\\Result getOrganizationConformancePackDetailedStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOrganizationConformancePackDetailedStatusAsync(array $args = [])\n * @method \\Aws\\Result getOrganizationCustomRulePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOrganizationCustomRulePolicyAsync(array $args = [])\n * @method \\Aws\\Result getResourceConfigHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceConfigHistoryAsync(array $args = [])\n * @method \\Aws\\Result getResourceEvaluationSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceEvaluationSummaryAsync(array $args = [])\n * @method \\Aws\\Result getStoredQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStoredQueryAsync(array $args = [])\n * @method \\Aws\\Result listAggregateDiscoveredResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAggregateDiscoveredResourcesAsync(array $args = [])\n * @method \\Aws\\Result listConformancePackComplianceScores(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConformancePackComplianceScoresAsync(array $args = [])\n * @method \\Aws\\Result listDiscoveredResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDiscoveredResourcesAsync(array $args = [])\n * @method \\Aws\\Result listResourceEvaluations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceEvaluationsAsync(array $args = [])\n * @method \\Aws\\Result listStoredQueries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStoredQueriesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putAggregationAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAggregationAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result putConfigRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConfigRuleAsync(array $args = [])\n * @method \\Aws\\Result putConfigurationAggregator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConfigurationAggregatorAsync(array $args = [])\n * @method \\Aws\\Result putConfigurationRecorder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConfigurationRecorderAsync(array $args = [])\n * @method \\Aws\\Result putConformancePack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConformancePackAsync(array $args = [])\n * @method \\Aws\\Result putDeliveryChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDeliveryChannelAsync(array $args = [])\n * @method \\Aws\\Result putEvaluations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEvaluationsAsync(array $args = [])\n * @method \\Aws\\Result putExternalEvaluation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putExternalEvaluationAsync(array $args = [])\n * @method \\Aws\\Result putOrganizationConfigRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putOrganizationConfigRuleAsync(array $args = [])\n * @method \\Aws\\Result putOrganizationConformancePack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putOrganizationConformancePackAsync(array $args = [])\n * @method \\Aws\\Result putRemediationConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRemediationConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result putRemediationExceptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRemediationExceptionsAsync(array $args = [])\n * @method \\Aws\\Result putResourceConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourceConfigAsync(array $args = [])\n * @method \\Aws\\Result putRetentionConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRetentionConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putStoredQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putStoredQueryAsync(array $args = [])\n * @method \\Aws\\Result selectAggregateResourceConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise selectAggregateResourceConfigAsync(array $args = [])\n * @method \\Aws\\Result selectResourceConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise selectResourceConfigAsync(array $args = [])\n * @method \\Aws\\Result startConfigRulesEvaluation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startConfigRulesEvaluationAsync(array $args = [])\n * @method \\Aws\\Result startConfigurationRecorder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startConfigurationRecorderAsync(array $args = [])\n * @method \\Aws\\Result startRemediationExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startRemediationExecutionAsync(array $args = [])\n * @method \\Aws\\Result startResourceEvaluation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startResourceEvaluationAsync(array $args = [])\n * @method \\Aws\\Result stopConfigurationRecorder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopConfigurationRecorderAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass ConfigServiceClient extends AwsClient {}\n", "num_lines": 195}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ConfigService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the AWS Config service.\n */\nclass ConfigServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Configuration;\n\nclass ConfigurationResolver\n{\n    const ENV_PROFILE = 'AWS_PROFILE';\n    const ENV_CONFIG_FILE = 'AWS_CONFIG_FILE';\n\n    public static $envPrefix = 'AWS_';\n\n    /**\n     * Generic configuration resolver that first checks for environment\n     * variables, then checks for a specified profile in the environment-defined\n     * config file location (env variable is 'AWS_CONFIG_FILE', file location\n     * defaults to ~/.aws/config), then checks for the \"default\" profile in the\n     * environment-defined config file location, and failing those uses a default\n     * fallback value.\n     *\n     * @param string $key      Configuration key to be used when attempting\n     *                         to retrieve value from the environment or ini file.\n     * @param mixed $defaultValue\n     * @param string $expectedType  The expected type of the retrieved value.\n     * @param array $config\n     * @param array $additionalArgs\n     *\n     * @return mixed\n     */\n    public static function resolve(\n        $key,\n        $defaultValue,\n        $expectedType,\n        $config = []\n    )\n    {\n        $envValue = self::env($key, $expectedType);\n        if (!is_null($envValue)) {\n            return $envValue;\n        }\n\n        if (!isset($config['use_aws_shared_config_files'])\n            || $config['use_aws_shared_config_files'] != false\n        ) {\n            $iniValue = self::ini($key, $expectedType);\n            if(!is_null($iniValue)) {\n                return $iniValue;\n            }\n        }\n\n        return $defaultValue;\n    }\n\n    /**\n     * Resolves config values from environment variables.\n     *\n     * @param string $key      Configuration key to be used when attempting\n     *                         to retrieve value from the environment.\n     * @param string $expectedType  The expected type of the retrieved value.\n     *\n     * @return null | mixed\n     */\n    public static function env($key, $expectedType)\n    {\n        // Use config from environment variables, if available\n        $envValue = getenv(self::$envPrefix . strtoupper($key));\n        if (!empty($envValue)) {\n            if ($expectedType) {\n                $envValue = self::convertType($envValue, $expectedType);\n            }\n            return $envValue;\n        }\n\n        return null;\n    }\n\n    /**\n     * Gets config values from a config file whose location\n     * is specified by an environment variable 'AWS_CONFIG_FILE', defaulting to\n     * ~/.aws/config if not specified\n     *\n     *\n     * @param string $key      Configuration key to be used when attempting\n     *                         to retrieve value from ini file.\n     * @param string $expectedType  The expected type of the retrieved value.\n     * @param string|null $profile  Profile to use. If not specified will use\n     *                              the \"default\" profile.\n     * @param string|null $filename If provided, uses a custom filename rather\n     *                              than looking in the default directory.\n     *\n     * @return null | mixed\n     */\n    public static function ini($key, $expectedType, $profile = null, $filename = null)\n    {\n        $filename = $filename ?: (self::getDefaultConfigFilename());\n        $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');\n\n        if (!@is_readable($filename)) {\n            return null;\n        }\n        // Use INI_SCANNER_NORMAL instead of INI_SCANNER_TYPED for PHP 5.5 compatibility\n        //TODO change after deprecation\n        $data = @\\Aws\\parse_ini_file($filename, true, INI_SCANNER_NORMAL);\n        if ($data === false\n            || !isset($data[$profile])\n            || !isset($data[$profile][$key])\n        ) {\n            return null;\n        }\n\n        // INI_SCANNER_NORMAL parses false-y values as an empty string\n        if ($data[$profile][$key] === \"\") {\n            if ($expectedType === 'bool') {\n                $data[$profile][$key] = false;\n            } elseif ($expectedType === 'int') {\n                $data[$profile][$key] = 0;\n            }\n        }\n\n        return self::convertType($data[$profile][$key], $expectedType);\n    }\n\n    /**\n     * Gets the environment's HOME directory if available.\n     *\n     * @return null | string\n     */\n    private static function getHomeDir()\n    {\n        // On Linux/Unix-like systems, use the HOME environment variable\n        if ($homeDir = getenv('HOME')) {\n            return $homeDir;\n        }\n\n        // Get the HOMEDRIVE and HOMEPATH values for Windows hosts\n        $homeDrive = getenv('HOMEDRIVE');\n        $homePath = getenv('HOMEPATH');\n\n        return ($homeDrive && $homePath) ? $homeDrive . $homePath : null;\n    }\n\n    /**\n     * Gets default config file location from environment, falling back to aws\n     * default location\n     *\n     * @return string\n     */\n    private static function getDefaultConfigFilename()\n    {\n        if ($filename = getenv(self::ENV_CONFIG_FILE)) {\n            return $filename;\n        }\n        return self::getHomeDir() . '/.aws/config';\n    }\n\n    /**\n     * Normalizes string values pulled out of ini files and\n     * environment variables.\n     *\n     * @param string $value The value retrieved from the environment or\n     *                      ini file.\n     * @param $type $string The type that the value needs to be converted to.\n     *\n     * @return mixed\n     */\n    private static function convertType($value, $type)\n    {\n        if ($type === 'bool'\n            && !is_null($convertedValue = \\Aws\\boolean_value($value))\n        ) {\n            return $convertedValue;\n        }\n\n        if ($type === 'int'\n            && filter_var($value, FILTER_VALIDATE_INT)\n        ) {\n            $value = intVal($value);\n        }\n        return $value;\n    }\n}", "num_lines": 180}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Connect;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Connect Service** service.\n * @method \\Aws\\Result activateEvaluationForm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise activateEvaluationFormAsync(array $args = [])\n * @method \\Aws\\Result associateApprovedOrigin(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateApprovedOriginAsync(array $args = [])\n * @method \\Aws\\Result associateBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateBotAsync(array $args = [])\n * @method \\Aws\\Result associateDefaultVocabulary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateDefaultVocabularyAsync(array $args = [])\n * @method \\Aws\\Result associateInstanceStorageConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateInstanceStorageConfigAsync(array $args = [])\n * @method \\Aws\\Result associateLambdaFunction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateLambdaFunctionAsync(array $args = [])\n * @method \\Aws\\Result associateLexBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateLexBotAsync(array $args = [])\n * @method \\Aws\\Result associatePhoneNumberContactFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associatePhoneNumberContactFlowAsync(array $args = [])\n * @method \\Aws\\Result associateQueueQuickConnects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateQueueQuickConnectsAsync(array $args = [])\n * @method \\Aws\\Result associateRoutingProfileQueues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateRoutingProfileQueuesAsync(array $args = [])\n * @method \\Aws\\Result associateSecurityKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateSecurityKeyAsync(array $args = [])\n * @method \\Aws\\Result claimPhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise claimPhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result createAgentStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAgentStatusAsync(array $args = [])\n * @method \\Aws\\Result createContactFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createContactFlowAsync(array $args = [])\n * @method \\Aws\\Result createContactFlowModule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createContactFlowModuleAsync(array $args = [])\n * @method \\Aws\\Result createEvaluationForm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEvaluationFormAsync(array $args = [])\n * @method \\Aws\\Result createHoursOfOperation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHoursOfOperationAsync(array $args = [])\n * @method \\Aws\\Result createInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInstanceAsync(array $args = [])\n * @method \\Aws\\Result createIntegrationAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIntegrationAssociationAsync(array $args = [])\n * @method \\Aws\\Result createParticipant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createParticipantAsync(array $args = [])\n * @method \\Aws\\Result createPrompt(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPromptAsync(array $args = [])\n * @method \\Aws\\Result createQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createQueueAsync(array $args = [])\n * @method \\Aws\\Result createQuickConnect(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createQuickConnectAsync(array $args = [])\n * @method \\Aws\\Result createRoutingProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRoutingProfileAsync(array $args = [])\n * @method \\Aws\\Result createRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRuleAsync(array $args = [])\n * @method \\Aws\\Result createSecurityProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSecurityProfileAsync(array $args = [])\n * @method \\Aws\\Result createTaskTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTaskTemplateAsync(array $args = [])\n * @method \\Aws\\Result createTrafficDistributionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTrafficDistributionGroupAsync(array $args = [])\n * @method \\Aws\\Result createUseCase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUseCaseAsync(array $args = [])\n * @method \\Aws\\Result createUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserAsync(array $args = [])\n * @method \\Aws\\Result createUserHierarchyGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserHierarchyGroupAsync(array $args = [])\n * @method \\Aws\\Result createVocabulary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVocabularyAsync(array $args = [])\n * @method \\Aws\\Result deactivateEvaluationForm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deactivateEvaluationFormAsync(array $args = [])\n * @method \\Aws\\Result deleteContactEvaluation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteContactEvaluationAsync(array $args = [])\n * @method \\Aws\\Result deleteContactFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteContactFlowAsync(array $args = [])\n * @method \\Aws\\Result deleteContactFlowModule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteContactFlowModuleAsync(array $args = [])\n * @method \\Aws\\Result deleteEvaluationForm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEvaluationFormAsync(array $args = [])\n * @method \\Aws\\Result deleteHoursOfOperation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHoursOfOperationAsync(array $args = [])\n * @method \\Aws\\Result deleteInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInstanceAsync(array $args = [])\n * @method \\Aws\\Result deleteIntegrationAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIntegrationAssociationAsync(array $args = [])\n * @method \\Aws\\Result deletePrompt(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePromptAsync(array $args = [])\n * @method \\Aws\\Result deleteQuickConnect(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteQuickConnectAsync(array $args = [])\n * @method \\Aws\\Result deleteRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteSecurityProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSecurityProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteTaskTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTaskTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteTrafficDistributionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTrafficDistributionGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteUseCase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUseCaseAsync(array $args = [])\n * @method \\Aws\\Result deleteUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserAsync(array $args = [])\n * @method \\Aws\\Result deleteUserHierarchyGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserHierarchyGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteVocabulary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVocabularyAsync(array $args = [])\n * @method \\Aws\\Result describeAgentStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAgentStatusAsync(array $args = [])\n * @method \\Aws\\Result describeContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeContactAsync(array $args = [])\n * @method \\Aws\\Result describeContactEvaluation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeContactEvaluationAsync(array $args = [])\n * @method \\Aws\\Result describeContactFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeContactFlowAsync(array $args = [])\n * @method \\Aws\\Result describeContactFlowModule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeContactFlowModuleAsync(array $args = [])\n * @method \\Aws\\Result describeEvaluationForm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEvaluationFormAsync(array $args = [])\n * @method \\Aws\\Result describeHoursOfOperation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHoursOfOperationAsync(array $args = [])\n * @method \\Aws\\Result describeInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceAsync(array $args = [])\n * @method \\Aws\\Result describeInstanceAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceAttributeAsync(array $args = [])\n * @method \\Aws\\Result describeInstanceStorageConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceStorageConfigAsync(array $args = [])\n * @method \\Aws\\Result describePhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result describePrompt(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePromptAsync(array $args = [])\n * @method \\Aws\\Result describeQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeQueueAsync(array $args = [])\n * @method \\Aws\\Result describeQuickConnect(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeQuickConnectAsync(array $args = [])\n * @method \\Aws\\Result describeRoutingProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRoutingProfileAsync(array $args = [])\n * @method \\Aws\\Result describeRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRuleAsync(array $args = [])\n * @method \\Aws\\Result describeSecurityProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSecurityProfileAsync(array $args = [])\n * @method \\Aws\\Result describeTrafficDistributionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTrafficDistributionGroupAsync(array $args = [])\n * @method \\Aws\\Result describeUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserAsync(array $args = [])\n * @method \\Aws\\Result describeUserHierarchyGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserHierarchyGroupAsync(array $args = [])\n * @method \\Aws\\Result describeUserHierarchyStructure(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserHierarchyStructureAsync(array $args = [])\n * @method \\Aws\\Result describeVocabulary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVocabularyAsync(array $args = [])\n * @method \\Aws\\Result disassociateApprovedOrigin(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateApprovedOriginAsync(array $args = [])\n * @method \\Aws\\Result disassociateBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateBotAsync(array $args = [])\n * @method \\Aws\\Result disassociateInstanceStorageConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateInstanceStorageConfigAsync(array $args = [])\n * @method \\Aws\\Result disassociateLambdaFunction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateLambdaFunctionAsync(array $args = [])\n * @method \\Aws\\Result disassociateLexBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateLexBotAsync(array $args = [])\n * @method \\Aws\\Result disassociatePhoneNumberContactFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociatePhoneNumberContactFlowAsync(array $args = [])\n * @method \\Aws\\Result disassociateQueueQuickConnects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateQueueQuickConnectsAsync(array $args = [])\n * @method \\Aws\\Result disassociateRoutingProfileQueues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateRoutingProfileQueuesAsync(array $args = [])\n * @method \\Aws\\Result disassociateSecurityKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateSecurityKeyAsync(array $args = [])\n * @method \\Aws\\Result dismissUserContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise dismissUserContactAsync(array $args = [])\n * @method \\Aws\\Result getContactAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContactAttributesAsync(array $args = [])\n * @method \\Aws\\Result getCurrentMetricData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCurrentMetricDataAsync(array $args = [])\n * @method \\Aws\\Result getCurrentUserData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCurrentUserDataAsync(array $args = [])\n * @method \\Aws\\Result getFederationToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFederationTokenAsync(array $args = [])\n * @method \\Aws\\Result getMetricData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMetricDataAsync(array $args = [])\n * @method \\Aws\\Result getMetricDataV2(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMetricDataV2Async(array $args = [])\n * @method \\Aws\\Result getPromptFile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPromptFileAsync(array $args = [])\n * @method \\Aws\\Result getTaskTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTaskTemplateAsync(array $args = [])\n * @method \\Aws\\Result getTrafficDistribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTrafficDistributionAsync(array $args = [])\n * @method \\Aws\\Result listAgentStatuses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAgentStatusesAsync(array $args = [])\n * @method \\Aws\\Result listApprovedOrigins(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApprovedOriginsAsync(array $args = [])\n * @method \\Aws\\Result listBots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBotsAsync(array $args = [])\n * @method \\Aws\\Result listContactEvaluations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listContactEvaluationsAsync(array $args = [])\n * @method \\Aws\\Result listContactFlowModules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listContactFlowModulesAsync(array $args = [])\n * @method \\Aws\\Result listContactFlows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listContactFlowsAsync(array $args = [])\n * @method \\Aws\\Result listContactReferences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listContactReferencesAsync(array $args = [])\n * @method \\Aws\\Result listDefaultVocabularies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDefaultVocabulariesAsync(array $args = [])\n * @method \\Aws\\Result listEvaluationFormVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEvaluationFormVersionsAsync(array $args = [])\n * @method \\Aws\\Result listEvaluationForms(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEvaluationFormsAsync(array $args = [])\n * @method \\Aws\\Result listHoursOfOperations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHoursOfOperationsAsync(array $args = [])\n * @method \\Aws\\Result listInstanceAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInstanceAttributesAsync(array $args = [])\n * @method \\Aws\\Result listInstanceStorageConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInstanceStorageConfigsAsync(array $args = [])\n * @method \\Aws\\Result listInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInstancesAsync(array $args = [])\n * @method \\Aws\\Result listIntegrationAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIntegrationAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listLambdaFunctions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLambdaFunctionsAsync(array $args = [])\n * @method \\Aws\\Result listLexBots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLexBotsAsync(array $args = [])\n * @method \\Aws\\Result listPhoneNumbers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPhoneNumbersAsync(array $args = [])\n * @method \\Aws\\Result listPhoneNumbersV2(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPhoneNumbersV2Async(array $args = [])\n * @method \\Aws\\Result listPrompts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPromptsAsync(array $args = [])\n * @method \\Aws\\Result listQueueQuickConnects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listQueueQuickConnectsAsync(array $args = [])\n * @method \\Aws\\Result listQueues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listQueuesAsync(array $args = [])\n * @method \\Aws\\Result listQuickConnects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listQuickConnectsAsync(array $args = [])\n * @method \\Aws\\Result listRoutingProfileQueues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRoutingProfileQueuesAsync(array $args = [])\n * @method \\Aws\\Result listRoutingProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRoutingProfilesAsync(array $args = [])\n * @method \\Aws\\Result listRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRulesAsync(array $args = [])\n * @method \\Aws\\Result listSecurityKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSecurityKeysAsync(array $args = [])\n * @method \\Aws\\Result listSecurityProfilePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSecurityProfilePermissionsAsync(array $args = [])\n * @method \\Aws\\Result listSecurityProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSecurityProfilesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTaskTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTaskTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listTrafficDistributionGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTrafficDistributionGroupsAsync(array $args = [])\n * @method \\Aws\\Result listUseCases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUseCasesAsync(array $args = [])\n * @method \\Aws\\Result listUserHierarchyGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUserHierarchyGroupsAsync(array $args = [])\n * @method \\Aws\\Result listUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUsersAsync(array $args = [])\n * @method \\Aws\\Result monitorContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise monitorContactAsync(array $args = [])\n * @method \\Aws\\Result putUserStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putUserStatusAsync(array $args = [])\n * @method \\Aws\\Result releasePhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise releasePhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result replicateInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise replicateInstanceAsync(array $args = [])\n * @method \\Aws\\Result resumeContactRecording(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resumeContactRecordingAsync(array $args = [])\n * @method \\Aws\\Result searchAvailablePhoneNumbers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchAvailablePhoneNumbersAsync(array $args = [])\n * @method \\Aws\\Result searchHoursOfOperations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchHoursOfOperationsAsync(array $args = [])\n * @method \\Aws\\Result searchPrompts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchPromptsAsync(array $args = [])\n * @method \\Aws\\Result searchQueues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchQueuesAsync(array $args = [])\n * @method \\Aws\\Result searchQuickConnects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchQuickConnectsAsync(array $args = [])\n * @method \\Aws\\Result searchResourceTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchResourceTagsAsync(array $args = [])\n * @method \\Aws\\Result searchRoutingProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchRoutingProfilesAsync(array $args = [])\n * @method \\Aws\\Result searchSecurityProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchSecurityProfilesAsync(array $args = [])\n * @method \\Aws\\Result searchUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchUsersAsync(array $args = [])\n * @method \\Aws\\Result searchVocabularies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchVocabulariesAsync(array $args = [])\n * @method \\Aws\\Result startChatContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startChatContactAsync(array $args = [])\n * @method \\Aws\\Result startContactEvaluation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startContactEvaluationAsync(array $args = [])\n * @method \\Aws\\Result startContactRecording(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startContactRecordingAsync(array $args = [])\n * @method \\Aws\\Result startContactStreaming(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startContactStreamingAsync(array $args = [])\n * @method \\Aws\\Result startOutboundVoiceContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startOutboundVoiceContactAsync(array $args = [])\n * @method \\Aws\\Result startTaskContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startTaskContactAsync(array $args = [])\n * @method \\Aws\\Result stopContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopContactAsync(array $args = [])\n * @method \\Aws\\Result stopContactRecording(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopContactRecordingAsync(array $args = [])\n * @method \\Aws\\Result stopContactStreaming(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopContactStreamingAsync(array $args = [])\n * @method \\Aws\\Result submitContactEvaluation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise submitContactEvaluationAsync(array $args = [])\n * @method \\Aws\\Result suspendContactRecording(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise suspendContactRecordingAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result transferContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise transferContactAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAgentStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAgentStatusAsync(array $args = [])\n * @method \\Aws\\Result updateContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContactAsync(array $args = [])\n * @method \\Aws\\Result updateContactAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContactAttributesAsync(array $args = [])\n * @method \\Aws\\Result updateContactEvaluation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContactEvaluationAsync(array $args = [])\n * @method \\Aws\\Result updateContactFlowContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContactFlowContentAsync(array $args = [])\n * @method \\Aws\\Result updateContactFlowMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContactFlowMetadataAsync(array $args = [])\n * @method \\Aws\\Result updateContactFlowModuleContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContactFlowModuleContentAsync(array $args = [])\n * @method \\Aws\\Result updateContactFlowModuleMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContactFlowModuleMetadataAsync(array $args = [])\n * @method \\Aws\\Result updateContactFlowName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContactFlowNameAsync(array $args = [])\n * @method \\Aws\\Result updateContactSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContactScheduleAsync(array $args = [])\n * @method \\Aws\\Result updateEvaluationForm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEvaluationFormAsync(array $args = [])\n * @method \\Aws\\Result updateHoursOfOperation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateHoursOfOperationAsync(array $args = [])\n * @method \\Aws\\Result updateInstanceAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateInstanceAttributeAsync(array $args = [])\n * @method \\Aws\\Result updateInstanceStorageConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateInstanceStorageConfigAsync(array $args = [])\n * @method \\Aws\\Result updateParticipantRoleConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateParticipantRoleConfigAsync(array $args = [])\n * @method \\Aws\\Result updatePhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result updatePrompt(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePromptAsync(array $args = [])\n * @method \\Aws\\Result updateQueueHoursOfOperation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateQueueHoursOfOperationAsync(array $args = [])\n * @method \\Aws\\Result updateQueueMaxContacts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateQueueMaxContactsAsync(array $args = [])\n * @method \\Aws\\Result updateQueueName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateQueueNameAsync(array $args = [])\n * @method \\Aws\\Result updateQueueOutboundCallerConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateQueueOutboundCallerConfigAsync(array $args = [])\n * @method \\Aws\\Result updateQueueStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateQueueStatusAsync(array $args = [])\n * @method \\Aws\\Result updateQuickConnectConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateQuickConnectConfigAsync(array $args = [])\n * @method \\Aws\\Result updateQuickConnectName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateQuickConnectNameAsync(array $args = [])\n * @method \\Aws\\Result updateRoutingProfileConcurrency(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRoutingProfileConcurrencyAsync(array $args = [])\n * @method \\Aws\\Result updateRoutingProfileDefaultOutboundQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRoutingProfileDefaultOutboundQueueAsync(array $args = [])\n * @method \\Aws\\Result updateRoutingProfileName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRoutingProfileNameAsync(array $args = [])\n * @method \\Aws\\Result updateRoutingProfileQueues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRoutingProfileQueuesAsync(array $args = [])\n * @method \\Aws\\Result updateRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRuleAsync(array $args = [])\n * @method \\Aws\\Result updateSecurityProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSecurityProfileAsync(array $args = [])\n * @method \\Aws\\Result updateTaskTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTaskTemplateAsync(array $args = [])\n * @method \\Aws\\Result updateTrafficDistribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTrafficDistributionAsync(array $args = [])\n * @method \\Aws\\Result updateUserHierarchy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserHierarchyAsync(array $args = [])\n * @method \\Aws\\Result updateUserHierarchyGroupName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserHierarchyGroupNameAsync(array $args = [])\n * @method \\Aws\\Result updateUserHierarchyStructure(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserHierarchyStructureAsync(array $args = [])\n * @method \\Aws\\Result updateUserIdentityInfo(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserIdentityInfoAsync(array $args = [])\n * @method \\Aws\\Result updateUserPhoneConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserPhoneConfigAsync(array $args = [])\n * @method \\Aws\\Result updateUserRoutingProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserRoutingProfileAsync(array $args = [])\n * @method \\Aws\\Result updateUserSecurityProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserSecurityProfilesAsync(array $args = [])\n */\nclass ConnectClient extends AwsClient {}\n", "num_lines": 398}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Connect\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Connect Service** service.\n */\nclass ConnectException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ConnectCampaignService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AmazonConnectCampaignService** service.\n * @method \\Aws\\Result createCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCampaignAsync(array $args = [])\n * @method \\Aws\\Result deleteCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCampaignAsync(array $args = [])\n * @method \\Aws\\Result deleteConnectInstanceConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectInstanceConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteInstanceOnboardingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInstanceOnboardingJobAsync(array $args = [])\n * @method \\Aws\\Result describeCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCampaignAsync(array $args = [])\n * @method \\Aws\\Result getCampaignState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCampaignStateAsync(array $args = [])\n * @method \\Aws\\Result getCampaignStateBatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCampaignStateBatchAsync(array $args = [])\n * @method \\Aws\\Result getConnectInstanceConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConnectInstanceConfigAsync(array $args = [])\n * @method \\Aws\\Result getInstanceOnboardingJobStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInstanceOnboardingJobStatusAsync(array $args = [])\n * @method \\Aws\\Result listCampaigns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCampaignsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result pauseCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise pauseCampaignAsync(array $args = [])\n * @method \\Aws\\Result putDialRequestBatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDialRequestBatchAsync(array $args = [])\n * @method \\Aws\\Result resumeCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resumeCampaignAsync(array $args = [])\n * @method \\Aws\\Result startCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startCampaignAsync(array $args = [])\n * @method \\Aws\\Result startInstanceOnboardingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startInstanceOnboardingJobAsync(array $args = [])\n * @method \\Aws\\Result stopCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopCampaignAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateCampaignDialerConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCampaignDialerConfigAsync(array $args = [])\n * @method \\Aws\\Result updateCampaignName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCampaignNameAsync(array $args = [])\n * @method \\Aws\\Result updateCampaignOutboundCallConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCampaignOutboundCallConfigAsync(array $args = [])\n */\nclass ConnectCampaignServiceClient extends AwsClient {}\n", "num_lines": 54}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ConnectCampaignService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AmazonConnectCampaignService** service.\n */\nclass ConnectCampaignServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ConnectCases;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Connect Cases** service.\n * @method \\Aws\\Result batchGetField(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetFieldAsync(array $args = [])\n * @method \\Aws\\Result batchPutFieldOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchPutFieldOptionsAsync(array $args = [])\n * @method \\Aws\\Result createCase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCaseAsync(array $args = [])\n * @method \\Aws\\Result createDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDomainAsync(array $args = [])\n * @method \\Aws\\Result createField(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFieldAsync(array $args = [])\n * @method \\Aws\\Result createLayout(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLayoutAsync(array $args = [])\n * @method \\Aws\\Result createRelatedItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRelatedItemAsync(array $args = [])\n * @method \\Aws\\Result createTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainAsync(array $args = [])\n * @method \\Aws\\Result getCase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCaseAsync(array $args = [])\n * @method \\Aws\\Result getCaseEventConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCaseEventConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainAsync(array $args = [])\n * @method \\Aws\\Result getLayout(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLayoutAsync(array $args = [])\n * @method \\Aws\\Result getTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTemplateAsync(array $args = [])\n * @method \\Aws\\Result listCasesForContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCasesForContactAsync(array $args = [])\n * @method \\Aws\\Result listDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainsAsync(array $args = [])\n * @method \\Aws\\Result listFieldOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFieldOptionsAsync(array $args = [])\n * @method \\Aws\\Result listFields(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFieldsAsync(array $args = [])\n * @method \\Aws\\Result listLayouts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLayoutsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTemplatesAsync(array $args = [])\n * @method \\Aws\\Result putCaseEventConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putCaseEventConfigurationAsync(array $args = [])\n * @method \\Aws\\Result searchCases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchCasesAsync(array $args = [])\n * @method \\Aws\\Result searchRelatedItems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchRelatedItemsAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateCase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCaseAsync(array $args = [])\n * @method \\Aws\\Result updateField(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFieldAsync(array $args = [])\n * @method \\Aws\\Result updateLayout(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLayoutAsync(array $args = [])\n * @method \\Aws\\Result updateTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTemplateAsync(array $args = [])\n */\nclass ConnectCasesClient extends AwsClient {}\n", "num_lines": 70}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ConnectCases\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Connect Cases** service.\n */\nclass ConnectCasesException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ConnectContactLens;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Connect Contact Lens** service.\n * @method \\Aws\\Result listRealtimeContactAnalysisSegments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRealtimeContactAnalysisSegmentsAsync(array $args = [])\n */\nclass ConnectContactLensClient extends AwsClient {}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ConnectContactLens\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Connect Contact Lens** service.\n */\nclass ConnectContactLensException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ConnectParticipant;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Connect Participant Service** service.\n * @method \\Aws\\Result completeAttachmentUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise completeAttachmentUploadAsync(array $args = [])\n * @method \\Aws\\Result createParticipantConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createParticipantConnectionAsync(array $args = [])\n * @method \\Aws\\Result disconnectParticipant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disconnectParticipantAsync(array $args = [])\n * @method \\Aws\\Result getAttachment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAttachmentAsync(array $args = [])\n * @method \\Aws\\Result getTranscript(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTranscriptAsync(array $args = [])\n * @method \\Aws\\Result sendEvent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendEventAsync(array $args = [])\n * @method \\Aws\\Result sendMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendMessageAsync(array $args = [])\n * @method \\Aws\\Result startAttachmentUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startAttachmentUploadAsync(array $args = [])\n */\nclass ConnectParticipantClient extends AwsClient {}\n", "num_lines": 26}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ConnectParticipant\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Connect Participant Service** service.\n */\nclass ConnectParticipantException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ConnectWisdomService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Connect Wisdom Service** service.\n * @method \\Aws\\Result createAssistant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAssistantAsync(array $args = [])\n * @method \\Aws\\Result createAssistantAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAssistantAssociationAsync(array $args = [])\n * @method \\Aws\\Result createContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createContentAsync(array $args = [])\n * @method \\Aws\\Result createKnowledgeBase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createKnowledgeBaseAsync(array $args = [])\n * @method \\Aws\\Result createSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSessionAsync(array $args = [])\n * @method \\Aws\\Result deleteAssistant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAssistantAsync(array $args = [])\n * @method \\Aws\\Result deleteAssistantAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAssistantAssociationAsync(array $args = [])\n * @method \\Aws\\Result deleteContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteContentAsync(array $args = [])\n * @method \\Aws\\Result deleteKnowledgeBase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteKnowledgeBaseAsync(array $args = [])\n * @method \\Aws\\Result getAssistant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAssistantAsync(array $args = [])\n * @method \\Aws\\Result getAssistantAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAssistantAssociationAsync(array $args = [])\n * @method \\Aws\\Result getContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContentAsync(array $args = [])\n * @method \\Aws\\Result getContentSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContentSummaryAsync(array $args = [])\n * @method \\Aws\\Result getKnowledgeBase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getKnowledgeBaseAsync(array $args = [])\n * @method \\Aws\\Result getRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result getSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSessionAsync(array $args = [])\n * @method \\Aws\\Result listAssistantAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssistantAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listAssistants(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssistantsAsync(array $args = [])\n * @method \\Aws\\Result listContents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listContentsAsync(array $args = [])\n * @method \\Aws\\Result listKnowledgeBases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listKnowledgeBasesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result notifyRecommendationsReceived(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise notifyRecommendationsReceivedAsync(array $args = [])\n * @method \\Aws\\Result queryAssistant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise queryAssistantAsync(array $args = [])\n * @method \\Aws\\Result removeKnowledgeBaseTemplateUri(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeKnowledgeBaseTemplateUriAsync(array $args = [])\n * @method \\Aws\\Result searchContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchContentAsync(array $args = [])\n * @method \\Aws\\Result searchSessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchSessionsAsync(array $args = [])\n * @method \\Aws\\Result startContentUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startContentUploadAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContentAsync(array $args = [])\n * @method \\Aws\\Result updateKnowledgeBaseTemplateUri(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateKnowledgeBaseTemplateUriAsync(array $args = [])\n */\nclass ConnectWisdomServiceClient extends AwsClient {}\n", "num_lines": 72}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ConnectWisdomService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Connect Wisdom Service** service.\n */\nclass ConnectWisdomServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ControlTower;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Control Tower** service.\n * @method \\Aws\\Result disableControl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableControlAsync(array $args = [])\n * @method \\Aws\\Result enableControl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableControlAsync(array $args = [])\n * @method \\Aws\\Result getControlOperation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getControlOperationAsync(array $args = [])\n * @method \\Aws\\Result listEnabledControls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEnabledControlsAsync(array $args = [])\n */\nclass ControlTowerClient extends AwsClient {}\n", "num_lines": 18}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ControlTower\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Control Tower** service.\n */\nclass ControlTowerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CostandUsageReportService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Cost and Usage Report Service** service.\n * @method \\Aws\\Result deleteReportDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReportDefinitionAsync(array $args = [])\n * @method \\Aws\\Result describeReportDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReportDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result modifyReportDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyReportDefinitionAsync(array $args = [])\n * @method \\Aws\\Result putReportDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putReportDefinitionAsync(array $args = [])\n */\nclass CostandUsageReportServiceClient extends AwsClient {}\n", "num_lines": 18}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CostandUsageReportService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Cost and Usage Report Service** service.\n */\nclass CostandUsageReportServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CostExplorer;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Cost Explorer Service** service.\n * @method \\Aws\\Result createAnomalyMonitor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAnomalyMonitorAsync(array $args = [])\n * @method \\Aws\\Result createAnomalySubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAnomalySubscriptionAsync(array $args = [])\n * @method \\Aws\\Result createCostCategoryDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCostCategoryDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteAnomalyMonitor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAnomalyMonitorAsync(array $args = [])\n * @method \\Aws\\Result deleteAnomalySubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAnomalySubscriptionAsync(array $args = [])\n * @method \\Aws\\Result deleteCostCategoryDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCostCategoryDefinitionAsync(array $args = [])\n * @method \\Aws\\Result describeCostCategoryDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCostCategoryDefinitionAsync(array $args = [])\n * @method \\Aws\\Result getAnomalies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAnomaliesAsync(array $args = [])\n * @method \\Aws\\Result getAnomalyMonitors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAnomalyMonitorsAsync(array $args = [])\n * @method \\Aws\\Result getAnomalySubscriptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAnomalySubscriptionsAsync(array $args = [])\n * @method \\Aws\\Result getCostAndUsage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCostAndUsageAsync(array $args = [])\n * @method \\Aws\\Result getCostAndUsageWithResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCostAndUsageWithResourcesAsync(array $args = [])\n * @method \\Aws\\Result getCostCategories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCostCategoriesAsync(array $args = [])\n * @method \\Aws\\Result getCostForecast(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCostForecastAsync(array $args = [])\n * @method \\Aws\\Result getDimensionValues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDimensionValuesAsync(array $args = [])\n * @method \\Aws\\Result getReservationCoverage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReservationCoverageAsync(array $args = [])\n * @method \\Aws\\Result getReservationPurchaseRecommendation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReservationPurchaseRecommendationAsync(array $args = [])\n * @method \\Aws\\Result getReservationUtilization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReservationUtilizationAsync(array $args = [])\n * @method \\Aws\\Result getRightsizingRecommendation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRightsizingRecommendationAsync(array $args = [])\n * @method \\Aws\\Result getSavingsPlansCoverage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSavingsPlansCoverageAsync(array $args = [])\n * @method \\Aws\\Result getSavingsPlansPurchaseRecommendation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSavingsPlansPurchaseRecommendationAsync(array $args = [])\n * @method \\Aws\\Result getSavingsPlansUtilization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSavingsPlansUtilizationAsync(array $args = [])\n * @method \\Aws\\Result getSavingsPlansUtilizationDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSavingsPlansUtilizationDetailsAsync(array $args = [])\n * @method \\Aws\\Result getTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTagsAsync(array $args = [])\n * @method \\Aws\\Result getUsageForecast(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUsageForecastAsync(array $args = [])\n * @method \\Aws\\Result listCostAllocationTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCostAllocationTagsAsync(array $args = [])\n * @method \\Aws\\Result listCostCategoryDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCostCategoryDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listSavingsPlansPurchaseRecommendationGeneration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSavingsPlansPurchaseRecommendationGenerationAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result provideAnomalyFeedback(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise provideAnomalyFeedbackAsync(array $args = [])\n * @method \\Aws\\Result startSavingsPlansPurchaseRecommendationGeneration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSavingsPlansPurchaseRecommendationGenerationAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAnomalyMonitor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAnomalyMonitorAsync(array $args = [])\n * @method \\Aws\\Result updateAnomalySubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAnomalySubscriptionAsync(array $args = [])\n * @method \\Aws\\Result updateCostAllocationTagsStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCostAllocationTagsStatusAsync(array $args = [])\n * @method \\Aws\\Result updateCostCategoryDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCostCategoryDefinitionAsync(array $args = [])\n */\nclass CostExplorerClient extends AwsClient {}\n", "num_lines": 84}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CostExplorer\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Cost Explorer Service** service.\n */\nclass CostExplorerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Credentials;\n\nuse Aws\\Exception\\CredentialsException;\nuse Aws\\Result;\nuse Aws\\Sts\\StsClient;\nuse GuzzleHttp\\Promise\\PromiseInterface;\n\n/**\n * Credential provider that provides credentials via assuming a role\n * More Information, see: http://docs.aws.amazon.com/aws-sdk-php/v3/api/api-sts-2011-06-15.html#assumerole\n */\nclass AssumeRoleCredentialProvider\n{\n    const ERROR_MSG = \"Missing required 'AssumeRoleCredentialProvider' configuration option: \";\n\n    /** @var StsClient */\n    private $client;\n\n    /** @var array */\n    private $assumeRoleParams;\n\n    /**\n     * The constructor requires following configure parameters:\n     *  - client: a StsClient\n     *  - assume_role_params: Parameters used to make assumeRole call\n     *\n     * @param array $config Configuration options\n     * @throws \\InvalidArgumentException\n     */\n    public function __construct(array $config = [])\n    {\n        if (!isset($config['assume_role_params'])) {\n            throw new \\InvalidArgumentException(self::ERROR_MSG . \"'assume_role_params'.\");\n        }\n\n        if (!isset($config['client'])) {\n            throw new \\InvalidArgumentException(self::ERROR_MSG . \"'client'.\");\n        }\n\n        $this->client = $config['client'];\n        $this->assumeRoleParams = $config['assume_role_params'];\n    }\n\n    /**\n     * Loads assume role credentials.\n     *\n     * @return PromiseInterface\n     */\n    public function __invoke()\n    {\n        $client = $this->client;\n        return $client->assumeRoleAsync($this->assumeRoleParams)\n            ->then(function (Result $result) {\n                return $this->client->createCredentials($result);\n            })->otherwise(function (\\RuntimeException $exception) {\n                throw new CredentialsException(\n                    \"Error in retrieving assume role credentials.\",\n                    0,\n                    $exception\n                );\n            });\n    }\n}\n", "num_lines": 65}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Credentials;\n\nuse Aws\\Exception\\AwsException;\nuse Aws\\Exception\\CredentialsException;\nuse Aws\\Result;\nuse Aws\\Sts\\StsClient;\nuse GuzzleHttp\\Promise;\n\n/**\n * Credential provider that provides credentials via assuming a role with a web identity\n * More Information, see: https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-sts-2011-06-15.html#assumerolewithwebidentity\n */\nclass AssumeRoleWithWebIdentityCredentialProvider\n{\n    const ERROR_MSG = \"Missing required 'AssumeRoleWithWebIdentityCredentialProvider' configuration option: \";\n    const ENV_RETRIES = 'AWS_METADATA_SERVICE_NUM_ATTEMPTS';\n\n    /** @var string */\n    private $tokenFile;\n\n    /** @var string */\n    private $arn;\n\n    /** @var string */\n    private $session;\n\n    /** @var StsClient */\n    private $client;\n\n    /** @var integer */\n    private $retries;\n\n    /** @var integer */\n    private $authenticationAttempts;\n\n    /** @var integer */\n    private $tokenFileReadAttempts;\n\n    /**\n     * The constructor attempts to load config from environment variables.\n     * If not set, the following config options are used:\n     *  - WebIdentityTokenFile: full path of token filename\n     *  - RoleArn: arn of role to be assumed\n     *  - SessionName: (optional) set by SDK if not provided\n     *\n     * @param array $config Configuration options\n     * @throws \\InvalidArgumentException\n     */\n    public function __construct(array $config = [])\n    {\n        if (!isset($config['RoleArn'])) {\n            throw new \\InvalidArgumentException(self::ERROR_MSG . \"'RoleArn'.\");\n        }\n        $this->arn = $config['RoleArn'];\n\n        if (!isset($config['WebIdentityTokenFile'])) {\n            throw new \\InvalidArgumentException(self::ERROR_MSG . \"'WebIdentityTokenFile'.\");\n        }\n        $this->tokenFile = $config['WebIdentityTokenFile'];\n\n        if (!preg_match(\"/^\\w\\:|^\\/|^\\\\\\/\", $this->tokenFile)) {\n            throw new \\InvalidArgumentException(\"'WebIdentityTokenFile' must be an absolute path.\");\n        }\n\n        $this->retries = (int) getenv(self::ENV_RETRIES) ?: (isset($config['retries']) ? $config['retries'] : 3);\n        $this->authenticationAttempts = 0;\n        $this->tokenFileReadAttempts = 0;\n\n        $this->session = isset($config['SessionName'])\n            ? $config['SessionName']\n            : 'aws-sdk-php-' . round(microtime(true) * 1000);\n\n        $region = isset($config['region'])\n            ? $config['region']\n            : 'us-east-1';\n\n        if (isset($config['client'])) {\n            $this->client = $config['client'];\n        } else {\n            $this->client = new StsClient([\n                'credentials' => false,\n                'region' => $region,\n                'version' => 'latest'\n            ]);\n        }\n    }\n\n    /**\n     * Loads assume role with web identity credentials.\n     *\n     * @return Promise\\PromiseInterface\n     */\n    public function __invoke()\n    {\n        return Promise\\Coroutine::of(function () {\n            $client = $this->client;\n            $result = null;\n            while ($result == null) {\n                try {\n                    $token = @file_get_contents($this->tokenFile);\n                    if (false === $token) {\n                        clearstatcache(true, dirname($this->tokenFile) . \"/\" . readlink($this->tokenFile));\n                        clearstatcache(true, dirname($this->tokenFile) . \"/\" . dirname(readlink($this->tokenFile)));\n                        clearstatcache(true, $this->tokenFile);\n                        if (!@is_readable($this->tokenFile)) {\n                            throw new CredentialsException(\n                                \"Unreadable tokenfile at location {$this->tokenFile}\"\n                            );\n                        }\n\n                        $token = @file_get_contents($this->tokenFile);\n                    }\n                    if (empty($token)) {\n                        if ($this->tokenFileReadAttempts < $this->retries) {\n                            sleep((int) pow(1.2, $this->tokenFileReadAttempts));\n                            $this->tokenFileReadAttempts++;\n                            continue;\n                        }\n                        throw new CredentialsException(\"InvalidIdentityToken from file: {$this->tokenFile}\");\n                    }\n                } catch (\\Exception $exception) {\n                    throw new CredentialsException(\n                        \"Error reading WebIdentityTokenFile from \" . $this->tokenFile,\n                        0,\n                        $exception\n                    );\n                }\n\n                $assumeParams = [\n                    'RoleArn' => $this->arn,\n                    'RoleSessionName' => $this->session,\n                    'WebIdentityToken' => $token\n                ];\n\n                try {\n                    $result = $client->assumeRoleWithWebIdentity($assumeParams);\n                } catch (AwsException $e) {\n                    if ($e->getAwsErrorCode() == 'InvalidIdentityToken') {\n                        if ($this->authenticationAttempts < $this->retries) {\n                            sleep((int) pow(1.2, $this->authenticationAttempts));\n                        } else {\n                            throw new CredentialsException(\n                                \"InvalidIdentityToken, retries exhausted\"\n                            );\n                        }\n                    } else {\n                        throw new CredentialsException(\n                            \"Error assuming role from web identity credentials\",\n                            0,\n                            $e\n                        );\n                    }\n                } catch (\\Exception $e) {\n                    throw new CredentialsException(\n                        \"Error retrieving web identity credentials: \" . $e->getMessage()\n                        . \" (\" . $e->getCode() . \")\"\n                    );\n                }\n                $this->authenticationAttempts++;\n            }\n\n            yield $this->client->createCredentials($result);\n        });\n    }\n}\n", "num_lines": 167}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Credentials;\n\nuse Aws;\nuse Aws\\Api\\DateTimeResult;\nuse Aws\\CacheInterface;\nuse Aws\\Exception\\CredentialsException;\nuse Aws\\Sts\\StsClient;\nuse GuzzleHttp\\Promise;\n/**\n * Credential providers are functions that accept no arguments and return a\n * promise that is fulfilled with an {@see \\Aws\\Credentials\\CredentialsInterface}\n * or rejected with an {@see \\Aws\\Exception\\CredentialsException}.\n *\n * <code>\n * use Aws\\Credentials\\CredentialProvider;\n * $provider = CredentialProvider::defaultProvider();\n * // Returns a CredentialsInterface or throws.\n * $creds = $provider()->wait();\n * </code>\n *\n * Credential providers can be composed to create credentials using conditional\n * logic that can create different credentials in different environments. You\n * can compose multiple providers into a single provider using\n * {@see Aws\\Credentials\\CredentialProvider::chain}. This function accepts\n * providers as variadic arguments and returns a new function that will invoke\n * each provider until a successful set of credentials is returned.\n *\n * <code>\n * // First try an INI file at this location.\n * $a = CredentialProvider::ini(null, '/path/to/file.ini');\n * // Then try an INI file at this location.\n * $b = CredentialProvider::ini(null, '/path/to/other-file.ini');\n * // Then try loading from environment variables.\n * $c = CredentialProvider::env();\n * // Combine the three providers together.\n * $composed = CredentialProvider::chain($a, $b, $c);\n * // Returns a promise that is fulfilled with credentials or throws.\n * $promise = $composed();\n * // Wait on the credentials to resolve.\n * $creds = $promise->wait();\n * </code>\n */\nclass CredentialProvider\n{\n    const ENV_ARN = 'AWS_ROLE_ARN';\n    const ENV_KEY = 'AWS_ACCESS_KEY_ID';\n    const ENV_PROFILE = 'AWS_PROFILE';\n    const ENV_ROLE_SESSION_NAME = 'AWS_ROLE_SESSION_NAME';\n    const ENV_SECRET = 'AWS_SECRET_ACCESS_KEY';\n    const ENV_SESSION = 'AWS_SESSION_TOKEN';\n    const ENV_TOKEN_FILE = 'AWS_WEB_IDENTITY_TOKEN_FILE';\n    const ENV_SHARED_CREDENTIALS_FILE = 'AWS_SHARED_CREDENTIALS_FILE';\n\n    /**\n     * Create a default credential provider that\n     * first checks for environment variables,\n     * then checks for assumed role via web identity,\n     * then checks for cached SSO credentials from the CLI,\n     * then check for credential_process in the \"default\" profile in ~/.aws/credentials,\n     * then checks for the \"default\" profile in ~/.aws/credentials,\n     * then for credential_process in the \"default profile\" profile in ~/.aws/config,\n     * then checks for \"profile default\" profile in ~/.aws/config (which is\n     * the default profile of AWS CLI),\n     * then tries to make a GET Request to fetch credentials if ECS environment variable is presented,\n     * finally checks for EC2 instance profile credentials.\n     *\n     * This provider is automatically wrapped in a memoize function that caches\n     * previously provided credentials.\n     *\n     * @param array $config Optional array of ecs/instance profile credentials\n     *                      provider options.\n     *\n     * @return callable\n     */\n    public static function defaultProvider(array $config = [])\n    {\n        $cacheable = [\n            'web_identity',\n            'sso',\n            'process_credentials',\n            'process_config',\n            'ecs',\n            'instance'\n        ];\n\n        $profileName = getenv(self::ENV_PROFILE) ?: 'default';\n\n        $defaultChain = [\n            'env' => self::env(),\n            'web_identity' => self::assumeRoleWithWebIdentityCredentialProvider($config),\n        ];\n        if (\n            !isset($config['use_aws_shared_config_files'])\n            || $config['use_aws_shared_config_files'] !== false\n        ) {\n            $defaultChain['sso'] = self::sso(\n                $profileName,\n                self::getHomeDir() . '/.aws/config',\n                $config\n            );\n            $defaultChain['process_credentials'] = self::process();\n            $defaultChain['ini'] = self::ini();\n            $defaultChain['process_config'] = self::process(\n                'profile ' . $profileName,\n                self::getHomeDir() . '/.aws/config'\n            );\n            $defaultChain['ini_config'] = self::ini(\n                'profile '. $profileName,\n                self::getHomeDir() . '/.aws/config'\n            );\n        }\n\n        if (self::shouldUseEcs()) {\n            $defaultChain['ecs'] = self::ecsCredentials($config);\n        } else {\n            $defaultChain['instance'] = self::instanceProfile($config);\n        }\n\n        if (isset($config['credentials'])\n            && $config['credentials'] instanceof CacheInterface\n        ) {\n            foreach ($cacheable as $provider) {\n                if (isset($defaultChain[$provider])) {\n                    $defaultChain[$provider] = self::cache(\n                        $defaultChain[$provider],\n                        $config['credentials'],\n                        'aws_cached_' . $provider . '_credentials'\n                    );\n                }\n            }\n        }\n\n        return self::memoize(\n            call_user_func_array(\n                [CredentialProvider::class, 'chain'],\n                array_values($defaultChain)\n            )\n        );\n    }\n\n    /**\n     * Create a credential provider function from a set of static credentials.\n     *\n     * @param CredentialsInterface $creds\n     *\n     * @return callable\n     */\n    public static function fromCredentials(CredentialsInterface $creds)\n    {\n        $promise = Promise\\Create::promiseFor($creds);\n\n        return function () use ($promise) {\n            return $promise;\n        };\n    }\n\n    /**\n     * Creates an aggregate credentials provider that invokes the provided\n     * variadic providers one after the other until a provider returns\n     * credentials.\n     *\n     * @return callable\n     */\n    public static function chain()\n    {\n        $links = func_get_args();\n        if (empty($links)) {\n            throw new \\InvalidArgumentException('No providers in chain');\n        }\n\n        return function ($previousCreds = null) use ($links) {\n            /** @var callable $parent */\n            $parent = array_shift($links);\n            $promise = $parent();\n            while ($next = array_shift($links)) {\n                if ($next instanceof InstanceProfileProvider\n                    && $previousCreds instanceof Credentials\n                ) {\n                    $promise = $promise->otherwise(\n                        function () use ($next, $previousCreds) {return $next($previousCreds);}\n                    );\n                } else {\n                    $promise = $promise->otherwise($next);\n                }\n            }\n            return $promise;\n        };\n    }\n\n    /**\n     * Wraps a credential provider and caches previously provided credentials.\n     *\n     * Ensures that cached credentials are refreshed when they expire.\n     *\n     * @param callable $provider Credentials provider function to wrap.\n     *\n     * @return callable\n     */\n    public static function memoize(callable $provider)\n    {\n        return function () use ($provider) {\n            static $result;\n            static $isConstant;\n\n            // Constant credentials will be returned constantly.\n            if ($isConstant) {\n                return $result;\n            }\n\n            // Create the initial promise that will be used as the cached value\n            // until it expires.\n            if (null === $result) {\n                $result = $provider();\n            }\n\n            // Return credentials that could expire and refresh when needed.\n            return $result\n                ->then(function (CredentialsInterface $creds) use ($provider, &$isConstant, &$result) {\n                    // Determine if these are constant credentials.\n                    if (!$creds->getExpiration()) {\n                        $isConstant = true;\n                        return $creds;\n                    }\n\n                    // Refresh expired credentials.\n                    if (!$creds->isExpired()) {\n                        return $creds;\n                    }\n                    // Refresh the result and forward the promise.\n                    return $result = $provider($creds);\n                })\n                ->otherwise(function($reason) use (&$result) {\n                    // Cleanup rejected promise.\n                    $result = null;\n                    return new Promise\\RejectedPromise($reason);\n                });\n        };\n    }\n\n    /**\n     * Wraps a credential provider and saves provided credentials in an\n     * instance of Aws\\CacheInterface. Forwards calls when no credentials found\n     * in cache and updates cache with the results.\n     *\n     * @param callable $provider Credentials provider function to wrap\n     * @param CacheInterface $cache Cache to store credentials\n     * @param string|null $cacheKey (optional) Cache key to use\n     *\n     * @return callable\n     */\n    public static function cache(\n        callable $provider,\n        CacheInterface $cache,\n        $cacheKey = null\n    ) {\n        $cacheKey = $cacheKey ?: 'aws_cached_credentials';\n\n        return function () use ($provider, $cache, $cacheKey) {\n            $found = $cache->get($cacheKey);\n            if ($found instanceof CredentialsInterface && !$found->isExpired()) {\n                return Promise\\Create::promiseFor($found);\n            }\n\n            return $provider()\n                ->then(function (CredentialsInterface $creds) use (\n                    $cache,\n                    $cacheKey\n                ) {\n                    $cache->set(\n                        $cacheKey,\n                        $creds,\n                        null === $creds->getExpiration() ?\n                            0 : $creds->getExpiration() - time()\n                    );\n\n                    return $creds;\n                });\n        };\n    }\n\n    /**\n     * Provider that creates credentials from environment variables\n     * AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN.\n     *\n     * @return callable\n     */\n    public static function env()\n    {\n        return function () {\n            // Use credentials from environment variables, if available\n            $key = getenv(self::ENV_KEY);\n            $secret = getenv(self::ENV_SECRET);\n            if ($key && $secret) {\n                return Promise\\Create::promiseFor(\n                    new Credentials($key, $secret, getenv(self::ENV_SESSION) ?: NULL)\n                );\n            }\n\n            return self::reject('Could not find environment variable '\n                . 'credentials in ' . self::ENV_KEY . '/' . self::ENV_SECRET);\n        };\n    }\n\n    /**\n     * Credential provider that creates credentials using instance profile\n     * credentials.\n     *\n     * @param array $config Array of configuration data.\n     *\n     * @return InstanceProfileProvider\n     * @see Aws\\Credentials\\InstanceProfileProvider for $config details.\n     */\n    public static function instanceProfile(array $config = [])\n    {\n        return new InstanceProfileProvider($config);\n    }\n\n    /**\n     * Credential provider that retrieves cached SSO credentials from the CLI\n     *\n     * @return callable\n     */\n    public static function sso($ssoProfileName = 'default',\n                               $filename = null,\n                               $config = []\n    ) {\n        $filename = $filename ?: (self::getHomeDir() . '/.aws/config');\n\n        return function () use ($ssoProfileName, $filename, $config) {\n            if (!@is_readable($filename)) {\n                return self::reject(\"Cannot read credentials from $filename\");\n            }\n            $profiles = self::loadProfiles($filename);\n\n            if (isset($profiles[$ssoProfileName])) {\n                $ssoProfile = $profiles[$ssoProfileName];\n            } elseif (isset($profiles['profile ' . $ssoProfileName])) {\n                $ssoProfileName = 'profile ' . $ssoProfileName;\n                $ssoProfile = $profiles[$ssoProfileName];\n            } else {\n                return self::reject(\"Profile {$ssoProfileName} does not exist in {$filename}.\");\n            }\n\n            if (!empty($ssoProfile['sso_session'])) {\n                return CredentialProvider::getSsoCredentials($profiles, $ssoProfileName, $filename, $config);\n            } else {\n                return CredentialProvider::getSsoCredentialsLegacy($profiles, $ssoProfileName, $filename, $config);\n            }\n        };\n    }\n\n    /**\n     * Credential provider that creates credentials using\n     * ecs credentials by a GET request, whose uri is specified\n     * by environment variable\n     *\n     * @param array $config Array of configuration data.\n     *\n     * @return EcsCredentialProvider\n     * @see Aws\\Credentials\\EcsCredentialProvider for $config details.\n     */\n    public static function ecsCredentials(array $config = [])\n    {\n        return new EcsCredentialProvider($config);\n    }\n\n    /**\n     * Credential provider that creates credentials using assume role\n     *\n     * @param array $config Array of configuration data\n     * @return callable\n     * @see Aws\\Credentials\\AssumeRoleCredentialProvider for $config details.\n     */\n    public static function assumeRole(array $config=[])\n    {\n        return new AssumeRoleCredentialProvider($config);\n    }\n\n    /**\n     * Credential provider that creates credentials by assuming role from a\n     * Web Identity Token\n     *\n     * @param array $config Array of configuration data\n     * @return callable\n     * @see Aws\\Credentials\\AssumeRoleWithWebIdentityCredentialProvider for\n     * $config details.\n     */\n    public static function assumeRoleWithWebIdentityCredentialProvider(array $config = [])\n    {\n        return function () use ($config) {\n            $arnFromEnv = getenv(self::ENV_ARN);\n            $tokenFromEnv = getenv(self::ENV_TOKEN_FILE);\n            $stsClient = isset($config['stsClient'])\n                ? $config['stsClient']\n                : null;\n            $region = isset($config['region'])\n                ? $config['region']\n                : null;\n\n            if ($tokenFromEnv && $arnFromEnv) {\n                $sessionName = getenv(self::ENV_ROLE_SESSION_NAME)\n                    ? getenv(self::ENV_ROLE_SESSION_NAME)\n                    : null;\n                $provider = new AssumeRoleWithWebIdentityCredentialProvider([\n                    'RoleArn' => $arnFromEnv,\n                    'WebIdentityTokenFile' => $tokenFromEnv,\n                    'SessionName' => $sessionName,\n                    'client' => $stsClient,\n                    'region' => $region\n                ]);\n\n                return $provider();\n            }\n\n            $profileName = getenv(self::ENV_PROFILE) ?: 'default';\n            if (isset($config['filename'])) {\n                $profiles = self::loadProfiles($config['filename']);\n            } else {\n                $profiles = self::loadDefaultProfiles();\n            }\n\n            if (isset($profiles[$profileName])) {\n                $profile = $profiles[$profileName];\n                if (isset($profile['region'])) {\n                    $region = $profile['region'];\n                }\n                if (isset($profile['web_identity_token_file'])\n                    && isset($profile['role_arn'])\n                ) {\n                    $sessionName = isset($profile['role_session_name'])\n                        ? $profile['role_session_name']\n                        : null;\n                    $provider = new AssumeRoleWithWebIdentityCredentialProvider([\n                        'RoleArn' => $profile['role_arn'],\n                        'WebIdentityTokenFile' => $profile['web_identity_token_file'],\n                        'SessionName' => $sessionName,\n                        'client' => $stsClient,\n                        'region' => $region\n                    ]);\n\n                    return $provider();\n                }\n            } else {\n                return self::reject(\"Unknown profile: $profileName\");\n            }\n            return self::reject(\"No RoleArn or WebIdentityTokenFile specified\");\n        };\n    }\n\n    /**\n     * Credentials provider that creates credentials using an ini file stored\n     * in the current user's home directory.  A source can be provided\n     * in this file for assuming a role using the credential_source config option.\n     *\n     * @param string|null $profile  Profile to use. If not specified will use\n     *                              the \"default\" profile in \"~/.aws/credentials\".\n     * @param string|null $filename If provided, uses a custom filename rather\n     *                              than looking in the home directory.\n     * @param array|null $config If provided, may contain the following:\n     *                           preferStaticCredentials: If true, prefer static\n     *                           credentials to role_arn if both are present\n     *                           disableAssumeRole: If true, disable support for\n     *                           roles that assume an IAM role. If true and role profile\n     *                           is selected, an error is raised.\n     *                           stsClient: StsClient used to assume role specified in profile\n     *\n     * @return callable\n     */\n    public static function ini($profile = null, $filename = null, array $config = [])\n    {\n        $filename = self::getFileName($filename);\n        $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');\n\n        return function () use ($profile, $filename, $config) {\n            $preferStaticCredentials = isset($config['preferStaticCredentials'])\n                ? $config['preferStaticCredentials']\n                : false;\n            $disableAssumeRole = isset($config['disableAssumeRole'])\n                ? $config['disableAssumeRole']\n                : false;\n            $stsClient = isset($config['stsClient']) ? $config['stsClient'] : null;\n\n            if (!@is_readable($filename)) {\n                return self::reject(\"Cannot read credentials from $filename\");\n            }\n            $data = self::loadProfiles($filename);\n            if ($data === false) {\n                return self::reject(\"Invalid credentials file: $filename\");\n            }\n            if (!isset($data[$profile])) {\n                return self::reject(\"'$profile' not found in credentials file\");\n            }\n\n            /*\n            In the CLI, the presence of both a role_arn and static credentials have\n            different meanings depending on how many profiles have been visited. For\n            the first profile processed, role_arn takes precedence over any static\n            credentials, but for all subsequent profiles, static credentials are\n            used if present, and only in their absence will the profile's\n            source_profile and role_arn keys be used to load another set of\n            credentials. This bool is intended to yield compatible behaviour in this\n            sdk.\n            */\n            $preferStaticCredentialsToRoleArn = ($preferStaticCredentials\n                && isset($data[$profile]['aws_access_key_id'])\n                && isset($data[$profile]['aws_secret_access_key']));\n\n            if (isset($data[$profile]['role_arn'])\n                && !$preferStaticCredentialsToRoleArn\n            ) {\n                if ($disableAssumeRole) {\n                    return self::reject(\n                        \"Role assumption profiles are disabled. \"\n                        . \"Failed to load profile \" . $profile);\n                }\n                return self::loadRoleProfile(\n                    $data,\n                    $profile,\n                    $filename,\n                    $stsClient,\n                    $config\n                );\n            }\n\n            if (!isset($data[$profile]['aws_access_key_id'])\n                || !isset($data[$profile]['aws_secret_access_key'])\n            ) {\n                return self::reject(\"No credentials present in INI profile \"\n                    . \"'$profile' ($filename)\");\n            }\n\n            if (empty($data[$profile]['aws_session_token'])) {\n                $data[$profile]['aws_session_token']\n                    = isset($data[$profile]['aws_security_token'])\n                    ? $data[$profile]['aws_security_token']\n                    : null;\n            }\n\n            return Promise\\Create::promiseFor(\n                new Credentials(\n                    $data[$profile]['aws_access_key_id'],\n                    $data[$profile]['aws_secret_access_key'],\n                    $data[$profile]['aws_session_token']\n                )\n            );\n        };\n    }\n\n    /**\n     * Credentials provider that creates credentials using a process configured in\n     * ini file stored in the current user's home directory.\n     *\n     * @param string|null $profile  Profile to use. If not specified will use\n     *                              the \"default\" profile in \"~/.aws/credentials\".\n     * @param string|null $filename If provided, uses a custom filename rather\n     *                              than looking in the home directory.\n     *\n     * @return callable\n     */\n    public static function process($profile = null, $filename = null)\n    {\n        $filename = self::getFileName($filename);\n        $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');\n\n        return function () use ($profile, $filename) {\n            if (!@is_readable($filename)) {\n                return self::reject(\"Cannot read process credentials from $filename\");\n            }\n            $data = \\Aws\\parse_ini_file($filename, true, INI_SCANNER_RAW);\n            if ($data === false) {\n                return self::reject(\"Invalid credentials file: $filename\");\n            }\n            if (!isset($data[$profile])) {\n                return self::reject(\"'$profile' not found in credentials file\");\n            }\n            if (!isset($data[$profile]['credential_process'])) {\n                return self::reject(\"No credential_process present in INI profile \"\n                    . \"'$profile' ($filename)\");\n            }\n\n            $credentialProcess = $data[$profile]['credential_process'];\n            $json = shell_exec($credentialProcess);\n\n            $processData = json_decode($json, true);\n\n            // Only support version 1\n            if (isset($processData['Version'])) {\n                if ($processData['Version'] !== 1) {\n                    return self::reject(\"credential_process does not return Version == 1\");\n                }\n            }\n\n            if (!isset($processData['AccessKeyId'])\n                || !isset($processData['SecretAccessKey']))\n            {\n                return self::reject(\"credential_process does not return valid credentials\");\n            }\n\n            if (isset($processData['Expiration'])) {\n                try {\n                    $expiration = new DateTimeResult($processData['Expiration']);\n                } catch (\\Exception $e) {\n                    return self::reject(\"credential_process returned invalid expiration\");\n                }\n                $now = new DateTimeResult();\n                if ($expiration < $now) {\n                    return self::reject(\"credential_process returned expired credentials\");\n                }\n                $expires = $expiration->getTimestamp();\n            } else {\n                $expires = null;\n            }\n\n            if (empty($processData['SessionToken'])) {\n                $processData['SessionToken'] = null;\n            }\n\n            return Promise\\Create::promiseFor(\n                new Credentials(\n                    $processData['AccessKeyId'],\n                    $processData['SecretAccessKey'],\n                    $processData['SessionToken'],\n                    $expires\n                )\n            );\n        };\n    }\n\n    /**\n     * Assumes role for profile that includes role_arn\n     *\n     * @return callable\n     */\n    private static function loadRoleProfile(\n        $profiles,\n        $profileName,\n        $filename,\n        $stsClient,\n        $config = []\n    ) {\n        $roleProfile = $profiles[$profileName];\n        $roleArn = isset($roleProfile['role_arn']) ? $roleProfile['role_arn'] : '';\n        $roleSessionName = isset($roleProfile['role_session_name'])\n            ? $roleProfile['role_session_name']\n            : 'aws-sdk-php-' . round(microtime(true) * 1000);\n\n        if (\n            empty($roleProfile['source_profile'])\n            == empty($roleProfile['credential_source'])\n        ) {\n            return self::reject(\"Either source_profile or credential_source must be set \" .\n                \"using profile \" . $profileName . \", but not both.\"\n            );\n        }\n\n        $sourceProfileName = \"\";\n        if (!empty($roleProfile['source_profile'])) {\n            $sourceProfileName = $roleProfile['source_profile'];\n            if (!isset($profiles[$sourceProfileName])) {\n                return self::reject(\"source_profile \" . $sourceProfileName\n                    . \" using profile \" . $profileName . \" does not exist\"\n                );\n            }\n            if (isset($config['visited_profiles']) &&\n                in_array($roleProfile['source_profile'], $config['visited_profiles'])\n            ) {\n                return self::reject(\"Circular source_profile reference found.\");\n            }\n            $config['visited_profiles'] [] = $roleProfile['source_profile'];\n        } else {\n            if (empty($roleArn)) {\n                return self::reject(\n                    \"A role_arn must be provided with credential_source in \" .\n                    \"file {$filename} under profile {$profileName} \"\n                );\n            }\n        }\n\n        if (empty($stsClient)) {\n            $sourceRegion = isset($profiles[$sourceProfileName]['region'])\n                ? $profiles[$sourceProfileName]['region']\n                : 'us-east-1';\n            $config['preferStaticCredentials'] = true;\n            $sourceCredentials = null;\n            if (!empty($roleProfile['source_profile'])){\n                $sourceCredentials = call_user_func(\n                    CredentialProvider::ini($sourceProfileName, $filename, $config)\n                )->wait();\n            } else {\n                $sourceCredentials = self::getCredentialsFromSource(\n                    $profileName,\n                    $filename\n                );\n            }\n            $stsClient = new StsClient([\n                'credentials' => $sourceCredentials,\n                'region' => $sourceRegion,\n                'version' => '2011-06-15',\n            ]);\n        }\n\n        $result = $stsClient->assumeRole([\n            'RoleArn' => $roleArn,\n            'RoleSessionName' => $roleSessionName\n        ]);\n\n        $credentials = $stsClient->createCredentials($result);\n        return Promise\\Create::promiseFor($credentials);\n    }\n\n    /**\n     * Gets the environment's HOME directory if available.\n     *\n     * @return null|string\n     */\n    private static function getHomeDir()\n    {\n        // On Linux/Unix-like systems, use the HOME environment variable\n        if ($homeDir = getenv('HOME')) {\n            return $homeDir;\n        }\n\n        // Get the HOMEDRIVE and HOMEPATH values for Windows hosts\n        $homeDrive = getenv('HOMEDRIVE');\n        $homePath = getenv('HOMEPATH');\n\n        return ($homeDrive && $homePath) ? $homeDrive . $homePath : null;\n    }\n\n    /**\n     * Gets profiles from specified $filename, or default ini files.\n     */\n    private static function loadProfiles($filename)\n    {\n        $profileData = \\Aws\\parse_ini_file($filename, true, INI_SCANNER_RAW);\n\n        // If loading .aws/credentials, also load .aws/config when AWS_SDK_LOAD_NONDEFAULT_CONFIG is set\n        if ($filename === self::getHomeDir() . '/.aws/credentials'\n            && getenv('AWS_SDK_LOAD_NONDEFAULT_CONFIG')\n        ) {\n            $configFilename = self::getHomeDir() . '/.aws/config';\n            $configProfileData = \\Aws\\parse_ini_file($configFilename, true, INI_SCANNER_RAW);\n            foreach ($configProfileData as $name => $profile) {\n                // standardize config profile names\n                $name = str_replace('profile ', '', $name);\n                if (!isset($profileData[$name])) {\n                    $profileData[$name] = $profile;\n                }\n            }\n        }\n\n        return $profileData;\n    }\n\n    /**\n     * Gets profiles from ~/.aws/credentials and ~/.aws/config ini files\n     */\n    private static function loadDefaultProfiles() {\n        $profiles = [];\n        $credFile = self::getHomeDir() . '/.aws/credentials';\n        $configFile = self::getHomeDir() . '/.aws/config';\n        if (file_exists($credFile)) {\n            $profiles = \\Aws\\parse_ini_file($credFile, true, INI_SCANNER_RAW);\n        }\n\n        if (file_exists($configFile)) {\n            $configProfileData = \\Aws\\parse_ini_file($configFile, true, INI_SCANNER_RAW);\n            foreach ($configProfileData as $name => $profile) {\n                // standardize config profile names\n                $name = str_replace('profile ', '', $name);\n                if (!isset($profiles[$name])) {\n                    $profiles[$name] = $profile;\n                }\n            }\n        }\n\n        return $profiles;\n    }\n\n    public static function getCredentialsFromSource(\n        $profileName = '',\n        $filename = '',\n        $config = []\n    ) {\n        $data = self::loadProfiles($filename);\n        $credentialSource = !empty($data[$profileName]['credential_source'])\n            ? $data[$profileName]['credential_source']\n            : null;\n        $credentialsPromise = null;\n\n        switch ($credentialSource) {\n            case 'Environment':\n                $credentialsPromise = self::env();\n                break;\n            case 'Ec2InstanceMetadata':\n                $credentialsPromise = self::instanceProfile($config);\n                break;\n            case 'EcsContainer':\n                $credentialsPromise = self::ecsCredentials($config);\n                break;\n            default:\n                throw new CredentialsException(\n                    \"Invalid credential_source found in config file: {$credentialSource}. Valid inputs \"\n                    . \"include Environment, Ec2InstanceMetadata, and EcsContainer.\"\n                );\n        }\n\n        $credentialsResult = null;\n        try {\n            $credentialsResult = $credentialsPromise()->wait();\n        } catch (\\Exception $reason) {\n            return self::reject(\n                \"Unable to successfully retrieve credentials from the source specified in the\"\n                . \" credentials file: {$credentialSource}; failure message was: \"\n                . $reason->getMessage()\n            );\n        }\n        return function () use ($credentialsResult) {\n            return Promise\\Create::promiseFor($credentialsResult);\n        };\n    }\n\n    private static function reject($msg)\n    {\n        return new Promise\\RejectedPromise(new CredentialsException($msg));\n    }\n\n    /**\n     * @param $filename\n     * @return string\n     */\n    private static function getFileName($filename)\n    {\n        if (!isset($filename)) {\n            $filename = getenv(self::ENV_SHARED_CREDENTIALS_FILE) ?:\n                (self::getHomeDir() . '/.aws/credentials');\n        }\n        return $filename;\n    }\n\n    /**\n     * @return boolean\n     */\n    public static function shouldUseEcs()\n    {\n        //Check for relative uri. if not, then full uri.\n        //fall back to server for each as getenv is not thread-safe.\n        return !empty(getenv(EcsCredentialProvider::ENV_URI))\n            || !empty($_SERVER[EcsCredentialProvider::ENV_URI])\n            || !empty(getenv(EcsCredentialProvider::ENV_FULL_URI))\n            || !empty($_SERVER[EcsCredentialProvider::ENV_FULL_URI]);\n    }\n\n    /**\n     * @param $profiles\n     * @param $ssoProfileName\n     * @param $filename\n     * @param $config\n     * @return Promise\\PromiseInterface\n     */\n    private static function getSsoCredentials($profiles, $ssoProfileName, $filename, $config)\n    {\n        if (empty($config['ssoOidcClient'])) {\n            $ssoProfile = $profiles[$ssoProfileName];\n            $sessionName = $ssoProfile['sso_session'];\n            if (empty($profiles['sso-session ' . $sessionName])) {\n                return self::reject(\n                    \"Could not find sso-session {$sessionName} in {$filename}\"\n                );\n            }\n            $ssoSession = $profiles['sso-session ' . $ssoProfile['sso_session']];\n            $ssoOidcClient = new Aws\\SSOOIDC\\SSOOIDCClient([\n                'region' => $ssoSession['sso_region'],\n                'version' => '2019-06-10',\n                'credentials' => false\n            ]);\n        } else {\n            $ssoOidcClient = $config['ssoClient'];\n        }\n\n        $tokenPromise = new Aws\\Token\\SsoTokenProvider(\n            $ssoProfileName,\n            $filename,\n            $ssoOidcClient\n        );\n        $token = $tokenPromise()->wait();\n        $ssoCredentials = CredentialProvider::getCredentialsFromSsoService(\n            $ssoProfile,\n            $ssoSession['sso_region'],\n            $token->getToken(),\n            $config\n        );\n        $expiration = $ssoCredentials['expiration'];\n        return Promise\\Create::promiseFor(\n            new Credentials(\n                $ssoCredentials['accessKeyId'],\n                $ssoCredentials['secretAccessKey'],\n                $ssoCredentials['sessionToken'],\n                $expiration\n            )\n        );\n    }\n\n    /**\n     * @param $profiles\n     * @param $ssoProfileName\n     * @param $filename\n     * @param $config\n     * @return Promise\\PromiseInterface\n     */\n    private static function getSsoCredentialsLegacy($profiles, $ssoProfileName, $filename, $config)\n    {\n        $ssoProfile = $profiles[$ssoProfileName];\n        if (empty($ssoProfile['sso_start_url'])\n            || empty($ssoProfile['sso_region'])\n            || empty($ssoProfile['sso_account_id'])\n            || empty($ssoProfile['sso_role_name'])\n        ) {\n            return self::reject(\n                \"Profile {$ssoProfileName} in {$filename} must contain the following keys: \"\n                . \"sso_start_url, sso_region, sso_account_id, and sso_role_name.\"\n            );\n        }\n        $tokenLocation = self::getHomeDir()\n            . '/.aws/sso/cache/'\n            . sha1($ssoProfile['sso_start_url'])\n            . \".json\";\n\n        if (!@is_readable($tokenLocation)) {\n            return self::reject(\"Unable to read token file at $tokenLocation\");\n        }\n        $tokenData = json_decode(file_get_contents($tokenLocation), true);\n        if (empty($tokenData['accessToken']) || empty($tokenData['expiresAt'])) {\n            return self::reject(\n                \"Token file at {$tokenLocation} must contain an access token and an expiration\"\n            );\n        }\n        try {\n            $expiration = (new DateTimeResult($tokenData['expiresAt']))->getTimestamp();\n        } catch (\\Exception $e) {\n            return self::reject(\"Cached SSO credentials returned an invalid expiration\");\n        }\n        $now = time();\n        if ($expiration < $now) {\n            return self::reject(\"Cached SSO credentials returned expired credentials\");\n        }\n        $ssoCredentials = CredentialProvider::getCredentialsFromSsoService(\n            $ssoProfile,\n            $ssoProfile['sso_region'],\n            $tokenData['accessToken'],\n            $config\n        );\n        return Promise\\Create::promiseFor(\n            new Credentials(\n                $ssoCredentials['accessKeyId'],\n                $ssoCredentials['secretAccessKey'],\n                $ssoCredentials['sessionToken'],\n                $expiration\n            )\n        );\n    }\n    /**\n     * @param array $ssoProfile\n     * @param string $clientRegion\n     * @param string $accessToken\n     * @param array $config\n     * @return array|null\n     */\n    private static function getCredentialsFromSsoService($ssoProfile, $clientRegion, $accessToken, $config)\n    {\n        if (empty($config['ssoClient'])) {\n            $ssoClient = new Aws\\SSO\\SSOClient([\n                'region' => $clientRegion,\n                'version' => '2019-06-10',\n                'credentials' => false\n            ]);\n        } else {\n            $ssoClient = $config['ssoClient'];\n        }\n        $ssoResponse = $ssoClient->getRoleCredentials([\n            'accessToken' => $accessToken,\n            'accountId' => $ssoProfile['sso_account_id'],\n            'roleName' => $ssoProfile['sso_role_name']\n        ]);\n\n        $ssoCredentials = $ssoResponse['roleCredentials'];\n        return $ssoCredentials;\n    }\n}\n\n", "num_lines": 992}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Credentials;\n\n/**\n * Basic implementation of the AWS Credentials interface that allows callers to\n * pass in the AWS Access Key and AWS Secret Access Key in the constructor.\n */\nclass Credentials implements CredentialsInterface, \\Serializable\n{\n    private $key;\n    private $secret;\n    private $token;\n    private $expires;\n\n    /**\n     * Constructs a new BasicAWSCredentials object, with the specified AWS\n     * access key and AWS secret key\n     *\n     * @param string $key     AWS access key ID\n     * @param string $secret  AWS secret access key\n     * @param string $token   Security token to use\n     * @param int    $expires UNIX timestamp for when credentials expire\n     */\n    public function __construct($key, $secret, $token = null, $expires = null)\n    {\n        $this->key = trim($key);\n        $this->secret = trim($secret);\n        $this->token = $token;\n        $this->expires = $expires;\n    }\n\n    public static function __set_state(array $state)\n    {\n        return new self(\n            $state['key'],\n            $state['secret'],\n            $state['token'],\n            $state['expires']\n        );\n    }\n\n    public function getAccessKeyId()\n    {\n        return $this->key;\n    }\n\n    public function getSecretKey()\n    {\n        return $this->secret;\n    }\n\n    public function getSecurityToken()\n    {\n        return $this->token;\n    }\n\n    public function getExpiration()\n    {\n        return $this->expires;\n    }\n\n    public function isExpired()\n    {\n        return $this->expires !== null && time() >= $this->expires;\n    }\n\n    public function toArray()\n    {\n        return [\n            'key'     => $this->key,\n            'secret'  => $this->secret,\n            'token'   => $this->token,\n            'expires' => $this->expires\n        ];\n    }\n\n    public function serialize()\n    {\n        return json_encode($this->__serialize());\n    }\n\n    public function unserialize($serialized)\n    {\n        $data = json_decode($serialized, true);\n\n        $this->__unserialize($data);\n    }\n\n    public function __serialize()\n    {\n        return $this->toArray();\n    }\n\n    public function __unserialize($data)\n    {\n        $this->key = $data['key'];\n        $this->secret = $data['secret'];\n        $this->token = $data['token'];\n        $this->expires = $data['expires'];\n    }\n\n    /**\n     * Internal-only. Used when IMDS is unreachable\n     * or returns expires credentials.\n     *\n     * @internal\n     */\n    public function extendExpiration() {\n        $extension = mt_rand(5, 10);\n        $this->expires = time() + $extension * 60;\n\n        $message = <<<EOT\nAttempting credential expiration extension due to a credential service \navailability issue. A refresh of these credentials will be attempted again \nafter {$extension} minutes.\\n\nEOT;\n        trigger_error($message, E_USER_WARNING);\n    }\n}\n", "num_lines": 120}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Credentials;\n\n/**\n * Provides access to the AWS credentials used for accessing AWS services: AWS\n * access key ID, secret access key, and security token. These credentials are\n * used to securely sign requests to AWS services.\n */\ninterface CredentialsInterface\n{\n    /**\n     * Returns the AWS access key ID for this credentials object.\n     *\n     * @return string\n     */\n    public function getAccessKeyId();\n\n    /**\n     * Returns the AWS secret access key for this credentials object.\n     *\n     * @return string\n     */\n    public function getSecretKey();\n\n    /**\n     * Get the associated security token if available\n     *\n     * @return string|null\n     */\n    public function getSecurityToken();\n\n    /**\n     * Get the UNIX timestamp in which the credentials will expire\n     *\n     * @return int|null\n     */\n    public function getExpiration();\n\n    /**\n     * Check if the credentials are expired\n     *\n     * @return bool\n     */\n    public function isExpired();\n\n    /**\n     * Converts the credentials to an associative array.\n     *\n     * @return array\n     */\n    public function toArray();\n}\n", "num_lines": 53}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Credentials;\n\nuse Aws\\Exception\\CredentialsException;\nuse GuzzleHttp\\Psr7\\Request;\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\n\n/**\n * Credential provider that fetches credentials with GET request.\n * ECS environment variable is used in constructing request URI.\n */\nclass EcsCredentialProvider\n{\n    const SERVER_URI = 'http://169.254.170.2';\n    const ENV_URI = \"AWS_CONTAINER_CREDENTIALS_RELATIVE_URI\";\n    const ENV_FULL_URI = \"AWS_CONTAINER_CREDENTIALS_FULL_URI\";\n    const ENV_AUTH_TOKEN = \"AWS_CONTAINER_AUTHORIZATION_TOKEN\";\n    const ENV_TIMEOUT = 'AWS_METADATA_SERVICE_TIMEOUT';\n\n    /** @var callable */\n    private $client;\n\n    /** @var float|mixed */\n    private $timeout;\n\n    /**\n     *  The constructor accepts following options:\n     *  - timeout: (optional) Connection timeout, in seconds, default 1.0\n     *  - client: An EcsClient to make request from\n     *\n     * @param array $config Configuration options\n     */\n    public function __construct(array $config = [])\n    {\n        $timeout = getenv(self::ENV_TIMEOUT);\n\n        if (!$timeout) {\n            $timeout = isset($_SERVER[self::ENV_TIMEOUT])\n                ? $_SERVER[self::ENV_TIMEOUT]\n                : (isset($config['timeout']) ? $config['timeout'] : 1.0);\n        }\n\n        $this->timeout = (float) $timeout;\n        $this->client = isset($config['client'])\n            ? $config['client']\n            : \\Aws\\default_http_handler();\n    }\n\n    /**\n     * Load ECS credentials\n     *\n     * @return PromiseInterface\n     */\n    public function __invoke()\n    {\n        $client = $this->client;\n        $request = new Request('GET', self::getEcsUri());\n        \n        $headers = $this->setHeaderForAuthToken();\n        return $client(\n            $request,\n            [\n                'timeout' => $this->timeout,\n                'proxy' => '',\n                'headers' => $headers\n            ]\n        )->then(function (ResponseInterface $response) {\n            $result = $this->decodeResult((string) $response->getBody());\n            return new Credentials(\n                $result['AccessKeyId'],\n                $result['SecretAccessKey'],\n                $result['Token'],\n                strtotime($result['Expiration'])\n            );\n        })->otherwise(function ($reason) {\n            $reason = is_array($reason) ? $reason['exception'] : $reason;\n            $msg = $reason->getMessage();\n            throw new CredentialsException(\n                \"Error retrieving credential from ECS ($msg)\"\n            );\n        });\n    }\n    \n    private function getEcsAuthToken()\n    {\n        return getenv(self::ENV_AUTH_TOKEN);\n    }\n\n    public function setHeaderForAuthToken(){\n        $authToken = self::getEcsAuthToken();\n        $headers = [];\n        if(!empty($authToken))\n            $headers = ['Authorization' => $authToken];\n\n        return $headers;\n    }\n\n    /**\n     * Fetch credential URI from ECS environment variable\n     *\n     * @return string Returns ECS URI\n     */\n    private function getEcsUri()\n    {\n        $credsUri = getenv(self::ENV_URI);\n\n        if ($credsUri === false) {\n            $credsUri = isset($_SERVER[self::ENV_URI]) ? $_SERVER[self::ENV_URI] : '';\n        }\n\n        if(empty($credsUri)){\n            $credFullUri = getenv(self::ENV_FULL_URI);\n            if($credFullUri === false){\n                $credFullUri = isset($_SERVER[self::ENV_FULL_URI]) ? $_SERVER[self::ENV_FULL_URI] : '';\n            }\n\n            if(!empty($credFullUri))\n                return $credFullUri;\n        }\n        \n        return self::SERVER_URI . $credsUri;\n    }\n\n    private function decodeResult($response)\n    {\n        $result = json_decode($response, true);\n\n        if (!isset($result['AccessKeyId'])) {\n            throw new CredentialsException('Unexpected ECS credential value');\n        }\n        return $result;\n    }\n}\n", "num_lines": 135}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Credentials;\n\nuse Aws\\Exception\\CredentialsException;\nuse Aws\\Exception\\InvalidJsonException;\nuse Aws\\Sdk;\nuse GuzzleHttp\\Exception\\TransferException;\nuse GuzzleHttp\\Promise;\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\Psr7\\Request;\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\n\n/**\n * Credential provider that provides credentials from the EC2 metadata service.\n */\nclass InstanceProfileProvider\n{\n    const SERVER_URI = 'http://169.254.169.254/latest/';\n    const CRED_PATH = 'meta-data/iam/security-credentials/';\n    const TOKEN_PATH = 'api/token';\n\n    const ENV_DISABLE = 'AWS_EC2_METADATA_DISABLED';\n    const ENV_TIMEOUT = 'AWS_METADATA_SERVICE_TIMEOUT';\n    const ENV_RETRIES = 'AWS_METADATA_SERVICE_NUM_ATTEMPTS';\n\n    /** @var string */\n    private $profile;\n\n    /** @var callable */\n    private $client;\n\n    /** @var int */\n    private $retries;\n\n    /** @var int */\n    private $attempts;\n\n    /** @var float|mixed */\n    private $timeout;\n\n    /** @var bool */\n    private $secureMode = true;\n\n    /**\n     * The constructor accepts the following options:\n     *\n     * - timeout: Connection timeout, in seconds.\n     * - profile: Optional EC2 profile name, if known.\n     * - retries: Optional number of retries to be attempted.\n     *\n     * @param array $config Configuration options.\n     */\n    public function __construct(array $config = [])\n    {\n        $this->timeout = (float) getenv(self::ENV_TIMEOUT) ?: (isset($config['timeout']) ? $config['timeout'] : 1.0);\n        $this->profile = isset($config['profile']) ? $config['profile'] : null;\n        $this->retries = (int) getenv(self::ENV_RETRIES) ?: (isset($config['retries']) ? $config['retries'] : 3);\n        $this->client = isset($config['client'])\n            ? $config['client'] // internal use only\n            : \\Aws\\default_http_handler();\n    }\n\n    /**\n     * Loads instance profile credentials.\n     *\n     * @return PromiseInterface\n     */\n    public function __invoke($previousCredentials = null)\n    {\n        $this->attempts = 0;\n        return Promise\\Coroutine::of(function () use ($previousCredentials) {\n\n            // Retrieve token or switch out of secure mode\n            $token = null;\n            while ($this->secureMode && is_null($token)) {\n                try {\n                    $token = (yield $this->request(\n                        self::TOKEN_PATH,\n                        'PUT',\n                        [\n                            'x-aws-ec2-metadata-token-ttl-seconds' => 21600\n                        ]\n                    ));\n                } catch (TransferException $e) {\n                    if ($this->getExceptionStatusCode($e) === 500\n                        && $previousCredentials instanceof Credentials\n                    ) {\n                        goto generateCredentials;\n                    }\n                    else if (!method_exists($e, 'getResponse')\n                        || empty($e->getResponse())\n                        || !in_array(\n                            $e->getResponse()->getStatusCode(),\n                            [400, 500, 502, 503, 504]\n                        )\n                    ) {\n                        $this->secureMode = false;\n                    } else {\n                        $this->handleRetryableException(\n                            $e,\n                            [],\n                            $this->createErrorMessage(\n                                'Error retrieving metadata token'\n                            )\n                        );\n                    }\n                }\n                $this->attempts++;\n            }\n\n            // Set token header only for secure mode\n            $headers = [];\n            if ($this->secureMode) {\n                $headers = [\n                    'x-aws-ec2-metadata-token' => $token\n                ];\n            }\n\n            // Retrieve profile\n            while (!$this->profile) {\n                try {\n                    $this->profile = (yield $this->request(\n                        self::CRED_PATH,\n                        'GET',\n                        $headers\n                    ));\n                } catch (TransferException $e) {\n                    // 401 indicates insecure flow not supported, switch to\n                    // attempting secure mode for subsequent calls\n                    if (!empty($this->getExceptionStatusCode($e))\n                        && $this->getExceptionStatusCode($e) === 401\n                    ) {\n                        $this->secureMode = true;\n                    }\n                    $this->handleRetryableException(\n                        $e,\n                        [ 'blacklist' => [401, 403] ],\n                        $this->createErrorMessage($e->getMessage())\n                    );\n                }\n\n                $this->attempts++;\n            }\n\n            // Retrieve credentials\n            $result = null;\n            while ($result == null) {\n                try {\n                    $json = (yield $this->request(\n                        self::CRED_PATH . $this->profile,\n                        'GET',\n                        $headers\n                    ));\n                    $result = $this->decodeResult($json);\n                } catch (InvalidJsonException $e) {\n                    $this->handleRetryableException(\n                        $e,\n                        [ 'blacklist' => [401, 403] ],\n                        $this->createErrorMessage(\n                            'Invalid JSON response, retries exhausted'\n                        )\n                    );\n                } catch (TransferException $e) {\n                    // 401 indicates insecure flow not supported, switch to\n                    // attempting secure mode for subsequent calls\n                    if (($this->getExceptionStatusCode($e) === 500\n                            || strpos($e->getMessage(), \"cURL error 28\") !== false)\n                        && $previousCredentials instanceof Credentials\n                    ) {\n                        goto generateCredentials;\n                    } else if (!empty($this->getExceptionStatusCode($e))\n                        && $this->getExceptionStatusCode($e) === 401\n                    ) {\n                        $this->secureMode = true;\n                    }\n                    $this->handleRetryableException(\n                        $e,\n                        [ 'blacklist' => [401, 403] ],\n                        $this->createErrorMessage($e->getMessage())\n                    );\n                }\n                $this->attempts++;\n            }\n            generateCredentials:\n\n            if (!isset($result)) {\n                $credentials = $previousCredentials;\n            } else {\n                $credentials = new Credentials(\n                    $result['AccessKeyId'],\n                    $result['SecretAccessKey'],\n                    $result['Token'],\n                    strtotime($result['Expiration'])\n                );\n            }\n\n            if ($credentials->isExpired()) {\n                $credentials->extendExpiration();\n            }\n\n            yield $credentials;\n        });\n    }\n\n    /**\n     * @param string $url\n     * @param string $method\n     * @param array $headers\n     * @return PromiseInterface Returns a promise that is fulfilled with the\n     *                          body of the response as a string.\n     */\n    private function request($url, $method = 'GET', $headers = [])\n    {\n        $disabled = getenv(self::ENV_DISABLE) ?: false;\n        if (strcasecmp($disabled, 'true') === 0) {\n            throw new CredentialsException(\n                $this->createErrorMessage('EC2 metadata service access disabled')\n            );\n        }\n\n        $fn = $this->client;\n        $request = new Request($method, self::SERVER_URI . $url);\n        $userAgent = 'aws-sdk-php/' . Sdk::VERSION;\n        if (defined('HHVM_VERSION')) {\n            $userAgent .= ' HHVM/' . HHVM_VERSION;\n        }\n        $userAgent .= ' ' . \\Aws\\default_user_agent();\n        $request = $request->withHeader('User-Agent', $userAgent);\n        foreach ($headers as $key => $value) {\n            $request = $request->withHeader($key, $value);\n        }\n\n        return $fn($request, ['timeout' => $this->timeout])\n            ->then(function (ResponseInterface $response) {\n                return (string) $response->getBody();\n            })->otherwise(function (array $reason) {\n                $reason = $reason['exception'];\n                if ($reason instanceof TransferException) {\n                    throw $reason;\n                }\n                $msg = $reason->getMessage();\n                throw new CredentialsException(\n                    $this->createErrorMessage($msg)\n                );\n            });\n    }\n\n    private function handleRetryableException(\n        \\Exception $e,\n        $retryOptions,\n        $message\n    ) {\n        $isRetryable = true;\n        if (!empty($status = $this->getExceptionStatusCode($e))\n            && isset($retryOptions['blacklist'])\n            && in_array($status, $retryOptions['blacklist'])\n        ) {\n            $isRetryable = false;\n        }\n        if ($isRetryable && $this->attempts < $this->retries) {\n            sleep((int) pow(1.2, $this->attempts));\n        } else {\n            throw new CredentialsException($message);\n        }\n    }\n\n    private function getExceptionStatusCode(\\Exception $e)\n    {\n        if (method_exists($e, 'getResponse')\n            && !empty($e->getResponse())\n        ) {\n            return $e->getResponse()->getStatusCode();\n        }\n        return null;\n    }\n\n    private function createErrorMessage($previous)\n    {\n        return \"Error retrieving credentials from the instance profile \"\n            . \"metadata service. ({$previous})\";\n    }\n\n    private function decodeResult($response)\n    {\n        $result = json_decode($response, true);\n\n        if (json_last_error() > 0) {\n            throw new InvalidJsonException();\n        }\n\n        if ($result['Code'] !== 'Success') {\n            throw new CredentialsException('Unexpected instance profile '\n                .  'response code: ' . $result['Code']);\n        }\n\n        return $result;\n    }\n}\n", "num_lines": 300}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nuse Aws\\Crypto\\Cipher\\CipherMethod;\nuse Aws\\Crypto\\Cipher\\Cbc;\nuse GuzzleHttp\\Psr7\\Stream;\n\n/**\n * Legacy abstract encryption client. New workflows should use\n * AbstractCryptoClientV2.\n *\n * @deprecated\n * @internal\n */\nabstract class AbstractCryptoClient\n{\n    public static $supportedCiphers = ['cbc', 'gcm'];\n\n    public static $supportedKeyWraps = [\n        KmsMaterialsProvider::WRAP_ALGORITHM_NAME\n    ];\n\n    /**\n     * Returns if the passed cipher name is supported for encryption by the SDK.\n     *\n     * @param string $cipherName The name of a cipher to verify is registered.\n     *\n     * @return bool If the cipher passed is in our supported list.\n     */\n    public static function isSupportedCipher($cipherName)\n    {\n        return in_array($cipherName, self::$supportedCiphers);\n    }\n\n    /**\n     * Returns an identifier recognizable by `openssl_*` functions, such as\n     * `aes-256-cbc` or `aes-128-ctr`.\n     *\n     * @param string $cipherName Name of the cipher being used for encrypting\n     *                           or decrypting.\n     * @param int $keySize Size of the encryption key, in bits, that will be\n     *                     used.\n     *\n     * @return string\n     */\n    abstract protected function getCipherOpenSslName($cipherName, $keySize);\n\n    /**\n     * Constructs a CipherMethod for the given name, initialized with the other\n     * data passed for use in encrypting or decrypting.\n     *\n     * @param string $cipherName Name of the cipher to generate for encrypting.\n     * @param string $iv Base Initialization Vector for the cipher.\n     * @param int $keySize Size of the encryption key, in bits, that will be\n     *                     used.\n     *\n     * @return CipherMethod\n     *\n     * @internal\n     */\n    abstract protected function buildCipherMethod($cipherName, $iv, $keySize);\n\n    /**\n     * Performs a reverse lookup to get the openssl_* cipher name from the\n     * AESName passed in from the MetadataEnvelope.\n     *\n     * @param $aesName\n     *\n     * @return string\n     *\n     * @internal\n     */\n    abstract protected function getCipherFromAesName($aesName);\n\n    /**\n     * Dependency to provide an interface for building an encryption stream for\n     * data given cipher details, metadata, and materials to do so.\n     *\n     * @param Stream $plaintext Plain-text data to be encrypted using the\n     *                          materials, algorithm, and data provided.\n     * @param array $cipherOptions Options for use in determining the cipher to\n     *                             be used for encrypting data.\n     * @param MaterialsProvider $provider A provider to supply and encrypt\n     *                                    materials used in encryption.\n     * @param MetadataEnvelope $envelope A storage envelope for encryption\n     *                                   metadata to be added to.\n     *\n     * @return AesStreamInterface\n     *\n     * @internal\n     */\n    abstract public function encrypt(\n        Stream $plaintext,\n        array $cipherOptions,\n        MaterialsProvider $provider,\n        MetadataEnvelope $envelope\n    );\n\n    /**\n     * Dependency to provide an interface for building a decryption stream for\n     * cipher text given metadata and materials to do so.\n     *\n     * @param string $cipherText Plain-text data to be decrypted using the\n     *                           materials, algorithm, and data provided.\n     * @param MaterialsProviderInterface $provider A provider to supply and encrypt\n     *                                             materials used in encryption.\n     * @param MetadataEnvelope $envelope A storage envelope for encryption\n     *                                   metadata to be read from.\n     * @param array $cipherOptions Additional verification options.\n     *\n     * @return AesStreamInterface\n     *\n     * @internal\n     */\n    abstract public function decrypt(\n        $cipherText,\n        MaterialsProviderInterface $provider,\n        MetadataEnvelope $envelope,\n        array $cipherOptions = []\n    );\n}\n", "num_lines": 122}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nuse Aws\\Crypto\\Cipher\\CipherMethod;\nuse GuzzleHttp\\Psr7\\Stream;\n\n/**\n * @internal\n */\nabstract class AbstractCryptoClientV2\n{\n    public static $supportedCiphers = ['gcm'];\n\n    public static $supportedKeyWraps = [\n        KmsMaterialsProviderV2::WRAP_ALGORITHM_NAME\n    ];\n\n    public static $supportedSecurityProfiles = ['V2', 'V2_AND_LEGACY'];\n\n    public static $legacySecurityProfiles = ['V2_AND_LEGACY'];\n\n    /**\n     * Returns if the passed cipher name is supported for encryption by the SDK.\n     *\n     * @param string $cipherName The name of a cipher to verify is registered.\n     *\n     * @return bool If the cipher passed is in our supported list.\n     */\n    public static function isSupportedCipher($cipherName)\n    {\n        return in_array($cipherName, self::$supportedCiphers, true);\n    }\n\n    /**\n     * Returns an identifier recognizable by `openssl_*` functions, such as\n     * `aes-256-gcm`\n     *\n     * @param string $cipherName Name of the cipher being used for encrypting\n     *                           or decrypting.\n     * @param int $keySize Size of the encryption key, in bits, that will be\n     *                     used.\n     *\n     * @return string\n     */\n    abstract protected function getCipherOpenSslName($cipherName, $keySize);\n\n    /**\n     * Constructs a CipherMethod for the given name, initialized with the other\n     * data passed for use in encrypting or decrypting.\n     *\n     * @param string $cipherName Name of the cipher to generate for encrypting.\n     * @param string $iv Base Initialization Vector for the cipher.\n     * @param int $keySize Size of the encryption key, in bits, that will be\n     *                     used.\n     *\n     * @return CipherMethod\n     *\n     * @internal\n     */\n    abstract protected function buildCipherMethod($cipherName, $iv, $keySize);\n\n    /**\n     * Performs a reverse lookup to get the openssl_* cipher name from the\n     * AESName passed in from the MetadataEnvelope.\n     *\n     * @param $aesName\n     *\n     * @return string\n     *\n     * @internal\n     */\n    abstract protected function getCipherFromAesName($aesName);\n\n    /**\n     * Dependency to provide an interface for building an encryption stream for\n     * data given cipher details, metadata, and materials to do so.\n     *\n     * @param Stream $plaintext Plain-text data to be encrypted using the\n     *                          materials, algorithm, and data provided.\n     * @param array $options Options for use in encryption.\n     * @param MaterialsProviderV2 $provider A provider to supply and encrypt\n     *                                      materials used in encryption.\n     * @param MetadataEnvelope $envelope A storage envelope for encryption\n     *                                   metadata to be added to.\n     *\n     * @return AesStreamInterface\n     *\n     * @internal\n     */\n    abstract public function encrypt(\n        Stream $plaintext,\n        array $options,\n        MaterialsProviderV2 $provider,\n        MetadataEnvelope $envelope\n    );\n\n    /**\n     * Dependency to provide an interface for building a decryption stream for\n     * cipher text given metadata and materials to do so.\n     *\n     * @param string $cipherText Plain-text data to be decrypted using the\n     *                           materials, algorithm, and data provided.\n     * @param MaterialsProviderInterface $provider A provider to supply and encrypt\n     *                                             materials used in encryption.\n     * @param MetadataEnvelope $envelope A storage envelope for encryption\n     *                                   metadata to be read from.\n     * @param array $options Options used for decryption.\n     *\n     * @return AesStreamInterface\n     *\n     * @internal\n     */\n    abstract public function decrypt(\n        $cipherText,\n        MaterialsProviderInterfaceV2 $provider,\n        MetadataEnvelope $envelope,\n        array $options = []\n    );\n}\n", "num_lines": 120}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nuse GuzzleHttp\\Psr7\\StreamDecoratorTrait;\nuse \\LogicException;\nuse Psr\\Http\\Message\\StreamInterface;\nuse Aws\\Crypto\\Cipher\\CipherMethod;\n\n/**\n * @internal Represents a stream of data to be decrypted with passed cipher.\n */\nclass AesDecryptingStream implements AesStreamInterface\n{\n    const BLOCK_SIZE = 16; // 128 bits\n\n    use StreamDecoratorTrait;\n\n    /**\n     * @var string\n     */\n    private $buffer = '';\n\n    /**\n     * @var CipherMethod\n     */\n    private $cipherMethod;\n\n    /**\n     * @var string\n     */\n    private $key;\n\n    /**\n     * @var StreamInterface\n     */\n    private $stream;\n\n    /**\n     * @param StreamInterface $cipherText\n     * @param string $key\n     * @param CipherMethod $cipherMethod\n     */\n    public function __construct(\n        StreamInterface $cipherText,\n        $key,\n        CipherMethod $cipherMethod\n    ) {\n        $this->stream = $cipherText;\n        $this->key = $key;\n        $this->cipherMethod = clone $cipherMethod;\n    }\n\n    public function getOpenSslName()\n    {\n        return $this->cipherMethod->getOpenSslName();\n    }\n\n    public function getAesName()\n    {\n        return $this->cipherMethod->getAesName();\n    }\n\n    public function getCurrentIv()\n    {\n        return $this->cipherMethod->getCurrentIv();\n    }\n\n    public function getSize()\n    {\n        $plainTextSize = $this->stream->getSize();\n\n        if ($this->cipherMethod->requiresPadding()) {\n            // PKCS7 padding requires that between 1 and self::BLOCK_SIZE be\n            // added to the plaintext to make it an even number of blocks. The\n            // plaintext is between strlen($cipherText) - self::BLOCK_SIZE and\n            // strlen($cipherText) - 1\n            return null;\n        }\n\n        return $plainTextSize;\n    }\n\n    public function isWritable()\n    {\n        return false;\n    }\n\n    public function read($length)\n    {\n        if ($length > strlen($this->buffer)) {\n            $this->buffer .= $this->decryptBlock(\n                (int) (\n                        self::BLOCK_SIZE * ceil(($length - strlen($this->buffer)) / self::BLOCK_SIZE)\n                )\n            );\n        }\n\n        $data = substr($this->buffer, 0, $length);\n        $this->buffer = substr($this->buffer, $length);\n\n        return $data ? $data : '';\n    }\n\n    public function seek($offset, $whence = SEEK_SET)\n    {\n        if ($offset === 0 && $whence === SEEK_SET) {\n            $this->buffer = '';\n            $this->cipherMethod->seek(0, SEEK_SET);\n            $this->stream->seek(0, SEEK_SET);\n        } else {\n            throw new LogicException('AES encryption streams only support being'\n                . ' rewound, not arbitrary seeking.');\n        }\n    }\n\n    private function decryptBlock($length)\n    {\n        if ($this->stream->eof()) {\n            return '';\n        }\n\n        $cipherText = '';\n        do {\n            $cipherText .= $this->stream->read((int) ($length - strlen($cipherText)));\n        } while (strlen($cipherText) < $length && !$this->stream->eof());\n\n        $options = OPENSSL_RAW_DATA;\n        if (!$this->stream->eof()\n            && $this->stream->getSize() !== $this->stream->tell()\n        ) {\n            $options |= OPENSSL_ZERO_PADDING;\n        }\n\n        $plaintext = openssl_decrypt(\n            $cipherText,\n            $this->cipherMethod->getOpenSslName(),\n            $this->key,\n            $options,\n            $this->cipherMethod->getCurrentIv()\n        );\n\n        $this->cipherMethod->update($cipherText);\n\n        return $plaintext;\n    }\n}\n", "num_lines": 147}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nuse GuzzleHttp\\Psr7\\StreamDecoratorTrait;\nuse \\LogicException;\nuse Psr\\Http\\Message\\StreamInterface;\nuse Aws\\Crypto\\Cipher\\CipherMethod;\n\n/**\n * @internal Represents a stream of data to be encrypted with a passed cipher.\n */\nclass AesEncryptingStream implements AesStreamInterface\n{\n    const BLOCK_SIZE = 16; // 128 bits\n\n    use StreamDecoratorTrait;\n\n    /**\n     * @var string\n     */\n    private $buffer = '';\n\n    /**\n     * @var CipherMethod\n     */\n    private $cipherMethod;\n\n    /**\n     * @var string\n     */\n    private $key;\n\n    /**\n     * @var StreamInterface\n     */\n    private $stream;\n\n    /**\n     * @param StreamInterface $plainText\n     * @param string $key\n     * @param CipherMethod $cipherMethod\n     */\n    public function __construct(\n        StreamInterface $plainText,\n        $key,\n        CipherMethod $cipherMethod\n    ) {\n        $this->stream = $plainText;\n        $this->key = $key;\n        $this->cipherMethod = clone $cipherMethod;\n    }\n\n    public function getOpenSslName()\n    {\n        return $this->cipherMethod->getOpenSslName();\n    }\n\n    public function getAesName()\n    {\n        return $this->cipherMethod->getAesName();\n    }\n\n    public function getCurrentIv()\n    {\n        return $this->cipherMethod->getCurrentIv();\n    }\n\n    public function getSize()\n    {\n        $plainTextSize = $this->stream->getSize();\n\n        if ($this->cipherMethod->requiresPadding() && $plainTextSize !== null) {\n            // PKCS7 padding requires that between 1 and self::BLOCK_SIZE be\n            // added to the plaintext to make it an even number of blocks.\n            $padding = self::BLOCK_SIZE - $plainTextSize % self::BLOCK_SIZE;\n            return $plainTextSize + $padding;\n        }\n\n        return $plainTextSize;\n    }\n\n    public function isWritable()\n    {\n        return false;\n    }\n\n    public function read($length)\n    {\n        if ($length > strlen($this->buffer)) {\n            $this->buffer .= $this->encryptBlock(\n                (int)\n                self::BLOCK_SIZE * ceil(($length - strlen($this->buffer)) / self::BLOCK_SIZE)\n            );\n        }\n\n        $data = substr($this->buffer, 0, $length);\n        $this->buffer = substr($this->buffer, $length);\n\n        return $data ? $data : '';\n    }\n\n    public function seek($offset, $whence = SEEK_SET)\n    {\n        if ($whence === SEEK_CUR) {\n            $offset = $this->tell() + $offset;\n            $whence = SEEK_SET;\n        }\n\n        if ($whence === SEEK_SET) {\n            $this->buffer = '';\n            $wholeBlockOffset\n                = (int) ($offset / self::BLOCK_SIZE) * self::BLOCK_SIZE;\n            $this->stream->seek($wholeBlockOffset);\n            $this->cipherMethod->seek($wholeBlockOffset);\n            $this->read($offset - $wholeBlockOffset);\n        } else {\n            throw new LogicException('Unrecognized whence.');\n        }\n    }\n\n    private function encryptBlock($length)\n    {\n        if ($this->stream->eof()) {\n            return '';\n        }\n\n        $plainText = '';\n        do {\n            $plainText .= $this->stream->read((int) ($length - strlen($plainText)));\n        } while (strlen($plainText) < $length && !$this->stream->eof());\n\n        $options = OPENSSL_RAW_DATA;\n        if (!$this->stream->eof()\n            || $this->stream->getSize() !== $this->stream->tell()\n        ) {\n            $options |= OPENSSL_ZERO_PADDING;\n        }\n\n        $cipherText = openssl_encrypt(\n            $plainText,\n            $this->cipherMethod->getOpenSslName(),\n            $this->key,\n            $options,\n            $this->cipherMethod->getCurrentIv()\n        );\n\n        $this->cipherMethod->update($cipherText);\n\n        return $cipherText;\n    }\n}\n", "num_lines": 152}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nuse Aws\\Exception\\CryptoException;\nuse GuzzleHttp\\Psr7;\nuse GuzzleHttp\\Psr7\\StreamDecoratorTrait;\nuse Psr\\Http\\Message\\StreamInterface;\nuse Aws\\Crypto\\Polyfill\\AesGcm;\nuse Aws\\Crypto\\Polyfill\\Key;\n\n/**\n * @internal Represents a stream of data to be gcm decrypted.\n */\nclass AesGcmDecryptingStream implements AesStreamInterface\n{\n    use StreamDecoratorTrait;\n\n    private $aad;\n\n    private $initializationVector;\n\n    private $key;\n\n    private $keySize;\n\n    private $cipherText;\n\n    private $tag;\n\n    private $tagLength;\n\n    /**\n     * @param StreamInterface $cipherText\n     * @param string $key\n     * @param string $initializationVector\n     * @param string $tag\n     * @param string $aad\n     * @param int $tagLength\n     * @param int $keySize\n     */\n    public function __construct(\n        StreamInterface $cipherText,\n        $key,\n        $initializationVector,\n        $tag,\n        $aad = '',\n        $tagLength = 128,\n        $keySize = 256\n    ) {\n        $this->cipherText = $cipherText;\n        $this->key = $key;\n        $this->initializationVector = $initializationVector;\n        $this->tag = $tag;\n        $this->aad = $aad;\n        $this->tagLength = $tagLength;\n        $this->keySize = $keySize;\n    }\n\n    public function getOpenSslName()\n    {\n        return \"aes-{$this->keySize}-gcm\";\n    }\n\n    public function getAesName()\n    {\n        return 'AES/GCM/NoPadding';\n    }\n\n    public function getCurrentIv()\n    {\n        return $this->initializationVector;\n    }\n\n    public function createStream()\n    {\n        if (version_compare(PHP_VERSION, '7.1', '<')) {\n            return Psr7\\Utils::streamFor(AesGcm::decrypt(\n                (string) $this->cipherText,\n                $this->initializationVector,\n                new Key($this->key),\n                $this->aad,\n                $this->tag,\n                $this->keySize\n            ));\n        } else {\n            $result = \\openssl_decrypt(\n                (string)$this->cipherText,\n                $this->getOpenSslName(),\n                $this->key,\n                OPENSSL_RAW_DATA,\n                $this->initializationVector,\n                $this->tag,\n                $this->aad\n            );\n            if ($result === false) {\n                throw new CryptoException('The requested object could not be'\n                    . ' decrypted due to an invalid authentication tag.');\n            }\n            return Psr7\\Utils::streamFor($result);\n        }\n    }\n\n    public function isWritable()\n    {\n        return false;\n    }\n}\n", "num_lines": 108}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nuse Aws\\Crypto\\Polyfill\\AesGcm;\nuse Aws\\Crypto\\Polyfill\\Key;\nuse GuzzleHttp\\Psr7;\nuse GuzzleHttp\\Psr7\\StreamDecoratorTrait;\nuse Psr\\Http\\Message\\StreamInterface;\nuse \\RuntimeException;\n\n/**\n * @internal Represents a stream of data to be gcm encrypted.\n */\nclass AesGcmEncryptingStream implements AesStreamInterface, AesStreamInterfaceV2\n{\n    use StreamDecoratorTrait;\n\n    private $aad;\n\n    private $initializationVector;\n\n    private $key;\n\n    private $keySize;\n\n    private $plaintext;\n\n    private $tag = '';\n\n    private $tagLength;\n\n    /**\n     * Same as non-static 'getAesName' method, allowing calls in a static\n     * context.\n     *\n     * @return string\n     */\n    public static function getStaticAesName()\n    {\n        return 'AES/GCM/NoPadding';\n    }\n\n    /**\n     * @param StreamInterface $plaintext\n     * @param string $key\n     * @param string $initializationVector\n     * @param string $aad\n     * @param int $tagLength\n     * @param int $keySize\n     */\n    public function __construct(\n        StreamInterface $plaintext,\n        $key,\n        $initializationVector,\n        $aad = '',\n        $tagLength = 16,\n        $keySize = 256\n    ) {\n\n        $this->plaintext = $plaintext;\n        $this->key = $key;\n        $this->initializationVector = $initializationVector;\n        $this->aad = $aad;\n        $this->tagLength = $tagLength;\n        $this->keySize = $keySize;\n    }\n\n    public function getOpenSslName()\n    {\n        return \"aes-{$this->keySize}-gcm\";\n    }\n\n    /**\n     * Same as static method and retained for backwards compatibility\n     *\n     * @return string\n     */\n    public function getAesName()\n    {\n        return self::getStaticAesName();\n    }\n\n    public function getCurrentIv()\n    {\n        return $this->initializationVector;\n    }\n\n    public function createStream()\n    {\n        if (version_compare(PHP_VERSION, '7.1', '<')) {\n            return Psr7\\Utils::streamFor(AesGcm::encrypt(\n                (string) $this->plaintext,\n                $this->initializationVector,\n                new Key($this->key),\n                $this->aad,\n                $this->tag,\n                $this->keySize\n            ));\n        } else {\n            return Psr7\\Utils::streamFor(\\openssl_encrypt(\n                (string)$this->plaintext,\n                $this->getOpenSslName(),\n                $this->key,\n                OPENSSL_RAW_DATA,\n                $this->initializationVector,\n                $this->tag,\n                $this->aad,\n                $this->tagLength\n            ));\n        }\n    }\n\n    /**\n     * @return string\n     */\n    public function getTag()\n    {\n        return $this->tag;\n    }\n\n    public function isWritable()\n    {\n        return false;\n    }\n}\n", "num_lines": 126}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nuse Psr\\Http\\Message\\StreamInterface;\n\ninterface AesStreamInterface extends StreamInterface\n{\n    /**\n     * Returns an identifier recognizable by `openssl_*` functions, such as\n     * `aes-256-cbc` or `aes-128-ctr`.\n     *\n     * @return string\n     */\n    public function getOpenSslName();\n\n    /**\n     * Returns an AES recognizable name, such as 'AES/GCM/NoPadding'.\n     *\n     * @return string\n     */\n    public function getAesName();\n\n    /**\n     * Returns the IV that should be used to initialize the next block in\n     * encrypt or decrypt.\n     *\n     * @return string\n     */\n    public function getCurrentIv();\n}\n", "num_lines": 31}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nuse Psr\\Http\\Message\\StreamInterface;\n\ninterface AesStreamInterfaceV2 extends StreamInterface\n{\n    /**\n     * Returns an AES recognizable name, such as 'AES/GCM/NoPadding'. V2\n     * interface is accessible from a static context.\n     *\n     * @return string\n     */\n    public static function getStaticAesName();\n\n    /**\n     * Returns an identifier recognizable by `openssl_*` functions, such as\n     * `aes-256-cbc` or `aes-128-ctr`.\n     *\n     * @return string\n     */\n    public function getOpenSslName();\n\n    /**\n     * Returns the IV that should be used to initialize the next block in\n     * encrypt or decrypt.\n     *\n     * @return string\n     */\n    public function getCurrentIv();\n}\n", "num_lines": 32}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nuse GuzzleHttp\\Psr7;\nuse GuzzleHttp\\Psr7\\LimitStream;\nuse Psr\\Http\\Message\\StreamInterface;\n\ntrait DecryptionTrait\n{\n    /**\n     * Dependency to reverse lookup the openssl_* cipher name from the AESName\n     * in the MetadataEnvelope.\n     *\n     * @param $aesName\n     *\n     * @return string\n     *\n     * @internal\n     */\n    abstract protected function getCipherFromAesName($aesName);\n\n    /**\n     * Dependency to generate a CipherMethod from a set of inputs for loading\n     * in to an AesDecryptingStream.\n     *\n     * @param string $cipherName Name of the cipher to generate for decrypting.\n     * @param string $iv Base Initialization Vector for the cipher.\n     * @param int $keySize Size of the encryption key, in bits, that will be\n     *                     used.\n     *\n     * @return Cipher\\CipherMethod\n     *\n     * @internal\n     */\n    abstract protected function buildCipherMethod($cipherName, $iv, $keySize);\n\n    /**\n     * Builds an AesStreamInterface using cipher options loaded from the\n     * MetadataEnvelope and MaterialsProvider. Can decrypt data from both the\n     * legacy and V2 encryption client workflows.\n     *\n     * @param string $cipherText Plain-text data to be encrypted using the\n     *                           materials, algorithm, and data provided.\n     * @param MaterialsProviderInterface $provider A provider to supply and encrypt\n     *                                             materials used in encryption.\n     * @param MetadataEnvelope $envelope A storage envelope for encryption\n     *                                   metadata to be read from.\n     * @param array $cipherOptions Additional verification options.\n     *\n     * @return AesStreamInterface\n     *\n     * @throws \\InvalidArgumentException Thrown when a value in $cipherOptions\n     *                                   is not valid.\n     *\n     * @internal\n     */\n    public function decrypt(\n        $cipherText,\n        MaterialsProviderInterface $provider,\n        MetadataEnvelope $envelope,\n        array $cipherOptions = []\n    ) {\n        $cipherOptions['Iv'] = base64_decode(\n            $envelope[MetadataEnvelope::IV_HEADER]\n        );\n\n        $cipherOptions['TagLength'] =\n            $envelope[MetadataEnvelope::CRYPTO_TAG_LENGTH_HEADER] / 8;\n\n        $cek = $provider->decryptCek(\n            base64_decode(\n                $envelope[MetadataEnvelope::CONTENT_KEY_V2_HEADER]\n            ),\n            json_decode(\n                $envelope[MetadataEnvelope::MATERIALS_DESCRIPTION_HEADER],\n                true\n            )\n        );\n        $cipherOptions['KeySize'] = strlen($cek) * 8;\n        $cipherOptions['Cipher'] = $this->getCipherFromAesName(\n            $envelope[MetadataEnvelope::CONTENT_CRYPTO_SCHEME_HEADER]\n        );\n\n        $decryptionStream = $this->getDecryptingStream(\n            $cipherText,\n            $cek,\n            $cipherOptions\n        );\n        unset($cek);\n\n        return $decryptionStream;\n    }\n\n    private function getTagFromCiphertextStream(\n        StreamInterface $cipherText,\n        $tagLength\n    ) {\n        $cipherTextSize = $cipherText->getSize();\n        if ($cipherTextSize == null || $cipherTextSize <= 0) {\n            throw new \\RuntimeException('Cannot decrypt a stream of unknown'\n                . ' size.');\n        }\n        return (string) new LimitStream(\n            $cipherText,\n            $tagLength,\n            $cipherTextSize - $tagLength\n        );\n    }\n\n    private function getStrippedCiphertextStream(\n        StreamInterface $cipherText,\n        $tagLength\n    ) {\n        $cipherTextSize = $cipherText->getSize();\n        if ($cipherTextSize == null || $cipherTextSize <= 0) {\n            throw new \\RuntimeException('Cannot decrypt a stream of unknown'\n                . ' size.');\n        }\n        return new LimitStream(\n            $cipherText,\n            $cipherTextSize - $tagLength,\n            0\n        );\n    }\n\n    /**\n     * Generates a stream that wraps the cipher text with the proper cipher and\n     * uses the content encryption key (CEK) to decrypt the data when read.\n     *\n     * @param string $cipherText Plain-text data to be encrypted using the\n     *                           materials, algorithm, and data provided.\n     * @param string $cek A content encryption key for use by the stream for\n     *                    encrypting the plaintext data.\n     * @param array $cipherOptions Options for use in determining the cipher to\n     *                             be used for encrypting data.\n     *\n     * @return AesStreamInterface\n     *\n     * @internal\n     */\n    protected function getDecryptingStream(\n        $cipherText,\n        $cek,\n        $cipherOptions\n    ) {\n        $cipherTextStream = Psr7\\Utils::streamFor($cipherText);\n        switch ($cipherOptions['Cipher']) {\n            case 'gcm':\n                $cipherOptions['Tag'] = $this->getTagFromCiphertextStream(\n                        $cipherTextStream,\n                        $cipherOptions['TagLength']\n                    );\n\n                return new AesGcmDecryptingStream(\n                    $this->getStrippedCiphertextStream(\n                        $cipherTextStream,\n                        $cipherOptions['TagLength']\n                    ),\n                    $cek,\n                    $cipherOptions['Iv'],\n                    $cipherOptions['Tag'],\n                    $cipherOptions['Aad'] = isset($cipherOptions['Aad'])\n                        ? $cipherOptions['Aad']\n                        : '',\n                    $cipherOptions['TagLength'] ?: null,\n                    $cipherOptions['KeySize']\n                );\n            default:\n                $cipherMethod = $this->buildCipherMethod(\n                    $cipherOptions['Cipher'],\n                    $cipherOptions['Iv'],\n                    $cipherOptions['KeySize']\n                );\n                return new AesDecryptingStream(\n                    $cipherTextStream,\n                    $cek,\n                    $cipherMethod\n                );\n        }\n    }\n}\n", "num_lines": 182}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nuse Aws\\Exception\\CryptoException;\nuse GuzzleHttp\\Psr7;\nuse GuzzleHttp\\Psr7\\LimitStream;\nuse Psr\\Http\\Message\\StreamInterface;\n\ntrait DecryptionTraitV2\n{\n    /**\n     * Dependency to reverse lookup the openssl_* cipher name from the AESName\n     * in the MetadataEnvelope.\n     *\n     * @param $aesName\n     *\n     * @return string\n     *\n     * @internal\n     */\n    abstract protected function getCipherFromAesName($aesName);\n\n    /**\n     * Dependency to generate a CipherMethod from a set of inputs for loading\n     * in to an AesDecryptingStream.\n     *\n     * @param string $cipherName Name of the cipher to generate for decrypting.\n     * @param string $iv Base Initialization Vector for the cipher.\n     * @param int $keySize Size of the encryption key, in bits, that will be\n     *                     used.\n     *\n     * @return Cipher\\CipherMethod\n     *\n     * @internal\n     */\n    abstract protected function buildCipherMethod($cipherName, $iv, $keySize);\n\n    /**\n     * Builds an AesStreamInterface using cipher options loaded from the\n     * MetadataEnvelope and MaterialsProvider. Can decrypt data from both the\n     * legacy and V2 encryption client workflows.\n     *\n     * @param string $cipherText Plain-text data to be encrypted using the\n     *                           materials, algorithm, and data provided.\n     * @param MaterialsProviderInterfaceV2 $provider A provider to supply and encrypt\n     *                                             materials used in encryption.\n     * @param MetadataEnvelope $envelope A storage envelope for encryption\n     *                                   metadata to be read from.\n     * @param array $options Options used for decryption.\n     *\n     * @return AesStreamInterface\n     *\n     * @throws \\InvalidArgumentException Thrown when a value in $cipherOptions\n     *                                   is not valid.\n     *\n     * @internal\n     */\n    public function decrypt(\n        $cipherText,\n        MaterialsProviderInterfaceV2 $provider,\n        MetadataEnvelope $envelope,\n        array $options = []\n    ) {\n        $options['@CipherOptions'] = !empty($options['@CipherOptions'])\n            ? $options['@CipherOptions']\n            : [];\n        $options['@CipherOptions']['Iv'] = base64_decode(\n            $envelope[MetadataEnvelope::IV_HEADER]\n        );\n\n        $options['@CipherOptions']['TagLength'] =\n            $envelope[MetadataEnvelope::CRYPTO_TAG_LENGTH_HEADER] / 8;\n\n        $cek = $provider->decryptCek(\n            base64_decode(\n                $envelope[MetadataEnvelope::CONTENT_KEY_V2_HEADER]\n            ),\n            json_decode(\n                $envelope[MetadataEnvelope::MATERIALS_DESCRIPTION_HEADER],\n                true\n            ),\n            $options\n        );\n        $options['@CipherOptions']['KeySize'] = strlen($cek) * 8;\n        $options['@CipherOptions']['Cipher'] = $this->getCipherFromAesName(\n            $envelope[MetadataEnvelope::CONTENT_CRYPTO_SCHEME_HEADER]\n        );\n\n        $this->validateOptionsAndEnvelope($options, $envelope);\n\n        $decryptionStream = $this->getDecryptingStream(\n            $cipherText,\n            $cek,\n            $options['@CipherOptions']\n        );\n        unset($cek);\n\n        return $decryptionStream;\n    }\n\n    private function getTagFromCiphertextStream(\n        StreamInterface $cipherText,\n        $tagLength\n    ) {\n        $cipherTextSize = $cipherText->getSize();\n        if ($cipherTextSize == null || $cipherTextSize <= 0) {\n            throw new \\RuntimeException('Cannot decrypt a stream of unknown'\n                . ' size.');\n        }\n        return (string) new LimitStream(\n            $cipherText,\n            $tagLength,\n            $cipherTextSize - $tagLength\n        );\n    }\n\n    private function getStrippedCiphertextStream(\n        StreamInterface $cipherText,\n        $tagLength\n    ) {\n        $cipherTextSize = $cipherText->getSize();\n        if ($cipherTextSize == null || $cipherTextSize <= 0) {\n            throw new \\RuntimeException('Cannot decrypt a stream of unknown'\n                . ' size.');\n        }\n        return new LimitStream(\n            $cipherText,\n            $cipherTextSize - $tagLength,\n            0\n        );\n    }\n\n    private function validateOptionsAndEnvelope($options, $envelope)\n    {\n        $allowedCiphers = AbstractCryptoClientV2::$supportedCiphers;\n        $allowedKeywraps = AbstractCryptoClientV2::$supportedKeyWraps;\n        if ($options['@SecurityProfile'] == 'V2_AND_LEGACY') {\n            $allowedCiphers = array_unique(array_merge(\n                $allowedCiphers,\n                AbstractCryptoClient::$supportedCiphers\n            ));\n            $allowedKeywraps = array_unique(array_merge(\n                $allowedKeywraps,\n                AbstractCryptoClient::$supportedKeyWraps\n            ));\n        }\n\n        $v1SchemaException = new CryptoException(\"The requested object is encrypted\"\n            . \" with V1 encryption schemas that have been disabled by\"\n            . \" client configuration @SecurityProfile=V2. Retry with\"\n            . \" V2_AND_LEGACY enabled or reencrypt the object.\");\n\n        if (!in_array($options['@CipherOptions']['Cipher'], $allowedCiphers)) {\n            if (in_array($options['@CipherOptions']['Cipher'], AbstractCryptoClient::$supportedCiphers)) {\n                throw $v1SchemaException;\n            }\n            throw new CryptoException(\"The requested object is encrypted with\"\n                . \" the cipher '{$options['@CipherOptions']['Cipher']}', which is not\"\n                . \" supported for decryption with the selected security profile.\"\n                . \" This profile allows decryption with: \"\n                . implode(\", \", $allowedCiphers));\n        }\n        if (!in_array(\n            $envelope[MetadataEnvelope::KEY_WRAP_ALGORITHM_HEADER],\n            $allowedKeywraps\n        )) {\n            if (in_array(\n                $envelope[MetadataEnvelope::KEY_WRAP_ALGORITHM_HEADER],\n                AbstractCryptoClient::$supportedKeyWraps)\n            ) {\n                throw $v1SchemaException;\n            }\n            throw new CryptoException(\"The requested object is encrypted with\"\n                . \" the keywrap schema '{$envelope[MetadataEnvelope::KEY_WRAP_ALGORITHM_HEADER]}',\"\n                . \" which is not supported for decryption with the current security\"\n                . \" profile.\");\n        }\n\n        $matdesc = json_decode(\n            $envelope[MetadataEnvelope::MATERIALS_DESCRIPTION_HEADER],\n            true\n        );\n        if (isset($matdesc['aws:x-amz-cek-alg'])\n            && $envelope[MetadataEnvelope::CONTENT_CRYPTO_SCHEME_HEADER] !==\n                $matdesc['aws:x-amz-cek-alg']\n        ) {\n            throw new CryptoException(\"There is a mismatch in specified content\"\n                . \" encryption algrithm between the materials description value\"\n                . \" and the metadata envelope value: {$matdesc['aws:x-amz-cek-alg']}\"\n                . \" vs. {$envelope[MetadataEnvelope::CONTENT_CRYPTO_SCHEME_HEADER]}.\");\n        }\n    }\n\n    /**\n     * Generates a stream that wraps the cipher text with the proper cipher and\n     * uses the content encryption key (CEK) to decrypt the data when read.\n     *\n     * @param string $cipherText Plain-text data to be encrypted using the\n     *                           materials, algorithm, and data provided.\n     * @param string $cek A content encryption key for use by the stream for\n     *                    encrypting the plaintext data.\n     * @param array $cipherOptions Options for use in determining the cipher to\n     *                             be used for encrypting data.\n     *\n     * @return AesStreamInterface\n     *\n     * @internal\n     */\n    protected function getDecryptingStream(\n        $cipherText,\n        $cek,\n        $cipherOptions\n    ) {\n        $cipherTextStream = Psr7\\Utils::streamFor($cipherText);\n        switch ($cipherOptions['Cipher']) {\n            case 'gcm':\n                $cipherOptions['Tag'] = $this->getTagFromCiphertextStream(\n                        $cipherTextStream,\n                        $cipherOptions['TagLength']\n                    );\n\n                return new AesGcmDecryptingStream(\n                    $this->getStrippedCiphertextStream(\n                        $cipherTextStream,\n                        $cipherOptions['TagLength']\n                    ),\n                    $cek,\n                    $cipherOptions['Iv'],\n                    $cipherOptions['Tag'],\n                    $cipherOptions['Aad'] = isset($cipherOptions['Aad'])\n                        ? $cipherOptions['Aad']\n                        : '',\n                    $cipherOptions['TagLength'] ?: null,\n                    $cipherOptions['KeySize']\n                );\n            default:\n                $cipherMethod = $this->buildCipherMethod(\n                    $cipherOptions['Cipher'],\n                    $cipherOptions['Iv'],\n                    $cipherOptions['KeySize']\n                );\n                return new AesDecryptingStream(\n                    $cipherTextStream,\n                    $cek,\n                    $cipherMethod\n                );\n        }\n    }\n}\n", "num_lines": 250}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nuse GuzzleHttp\\Psr7;\nuse GuzzleHttp\\Psr7\\AppendStream;\nuse GuzzleHttp\\Psr7\\Stream;\n\ntrait EncryptionTrait\n{\n    private static $allowedOptions = [\n        'Cipher' => true,\n        'KeySize' => true,\n        'Aad' => true,\n    ];\n\n    /**\n     * Dependency to generate a CipherMethod from a set of inputs for loading\n     * in to an AesEncryptingStream.\n     *\n     * @param string $cipherName Name of the cipher to generate for encrypting.\n     * @param string $iv Base Initialization Vector for the cipher.\n     * @param int $keySize Size of the encryption key, in bits, that will be\n     *                     used.\n     *\n     * @return Cipher\\CipherMethod\n     *\n     * @internal\n     */\n    abstract protected function buildCipherMethod($cipherName, $iv, $keySize);\n\n    /**\n     * Builds an AesStreamInterface and populates encryption metadata into the\n     * supplied envelope.\n     *\n     * @param Stream $plaintext Plain-text data to be encrypted using the\n     *                          materials, algorithm, and data provided.\n     * @param array $cipherOptions Options for use in determining the cipher to\n     *                             be used for encrypting data.\n     * @param MaterialsProvider $provider A provider to supply and encrypt\n     *                                    materials used in encryption.\n     * @param MetadataEnvelope $envelope A storage envelope for encryption\n     *                                   metadata to be added to.\n     *\n     * @return AesStreamInterface\n     *\n     * @throws \\InvalidArgumentException Thrown when a value in $cipherOptions\n     *                                   is not valid.\n     *\n     * @internal\n     */\n    public function encrypt(\n        Stream $plaintext,\n        array $cipherOptions,\n        MaterialsProvider $provider,\n        MetadataEnvelope $envelope\n    ) {\n        $materialsDescription = $provider->getMaterialsDescription();\n\n        $cipherOptions = array_intersect_key(\n            $cipherOptions,\n            self::$allowedOptions\n        );\n\n        if (empty($cipherOptions['Cipher'])) {\n            throw new \\InvalidArgumentException('An encryption cipher must be'\n                . ' specified in the \"cipher_options\".');\n        }\n\n        if (!self::isSupportedCipher($cipherOptions['Cipher'])) {\n            throw new \\InvalidArgumentException('The cipher requested is not'\n                . ' supported by the SDK.');\n        }\n\n        if (empty($cipherOptions['KeySize'])) {\n            $cipherOptions['KeySize'] = 256;\n        }\n        if (!is_int($cipherOptions['KeySize'])) {\n            throw new \\InvalidArgumentException('The cipher \"KeySize\" must be'\n                . ' an integer.');\n        }\n\n        if (!MaterialsProvider::isSupportedKeySize(\n            $cipherOptions['KeySize']\n        )) {\n            throw new \\InvalidArgumentException('The cipher \"KeySize\" requested'\n                . ' is not supported by AES (128, 192, or 256).');\n        }\n\n        $cipherOptions['Iv'] = $provider->generateIv(\n            $this->getCipherOpenSslName(\n                $cipherOptions['Cipher'],\n                $cipherOptions['KeySize']\n            )\n        );\n\n        $cek = $provider->generateCek($cipherOptions['KeySize']);\n\n        list($encryptingStream, $aesName) = $this->getEncryptingStream(\n            $plaintext,\n            $cek,\n            $cipherOptions\n        );\n\n        // Populate envelope data\n        $envelope[MetadataEnvelope::CONTENT_KEY_V2_HEADER] =\n            $provider->encryptCek(\n                $cek,\n                $materialsDescription\n            );\n        unset($cek);\n\n        $envelope[MetadataEnvelope::IV_HEADER] =\n            base64_encode($cipherOptions['Iv']);\n        $envelope[MetadataEnvelope::KEY_WRAP_ALGORITHM_HEADER] =\n            $provider->getWrapAlgorithmName();\n        $envelope[MetadataEnvelope::CONTENT_CRYPTO_SCHEME_HEADER] = $aesName;\n        $envelope[MetadataEnvelope::UNENCRYPTED_CONTENT_LENGTH_HEADER] =\n            strlen($plaintext);\n        $envelope[MetadataEnvelope::MATERIALS_DESCRIPTION_HEADER] =\n            json_encode($materialsDescription);\n        if (!empty($cipherOptions['Tag'])) {\n            $envelope[MetadataEnvelope::CRYPTO_TAG_LENGTH_HEADER] =\n                strlen($cipherOptions['Tag']) * 8;\n        }\n\n        return $encryptingStream;\n    }\n\n    /**\n     * Generates a stream that wraps the plaintext with the proper cipher and\n     * uses the content encryption key (CEK) to encrypt the data when read.\n     *\n     * @param Stream $plaintext Plain-text data to be encrypted using the\n     *                          materials, algorithm, and data provided.\n     * @param string $cek A content encryption key for use by the stream for\n     *                    encrypting the plaintext data.\n     * @param array $cipherOptions Options for use in determining the cipher to\n     *                             be used for encrypting data.\n     *\n     * @return [AesStreamInterface, string]\n     *\n     * @internal\n     */\n    protected function getEncryptingStream(\n        Stream $plaintext,\n        $cek,\n        &$cipherOptions\n    ) {\n        switch ($cipherOptions['Cipher']) {\n            case 'gcm':\n                $cipherOptions['TagLength'] = 16;\n\n                $cipherTextStream = new AesGcmEncryptingStream(\n                    $plaintext,\n                    $cek,\n                    $cipherOptions['Iv'],\n                    $cipherOptions['Aad'] = isset($cipherOptions['Aad'])\n                        ? $cipherOptions['Aad']\n                        : '',\n                    $cipherOptions['TagLength'],\n                    $cipherOptions['KeySize']\n                );\n\n                if (!empty($cipherOptions['Aad'])) {\n                    trigger_error(\"'Aad' has been supplied for content encryption\"\n                        . \" with \" . $cipherTextStream->getAesName() . \". The\"\n                        . \" PHP SDK encryption client can decrypt an object\"\n                        . \" encrypted in this way, but other AWS SDKs may not be\"\n                        . \" able to.\", E_USER_WARNING);\n                }\n\n                $appendStream = new AppendStream([\n                    $cipherTextStream->createStream()\n                ]);\n                $cipherOptions['Tag'] = $cipherTextStream->getTag();\n                $appendStream->addStream(Psr7\\Utils::streamFor($cipherOptions['Tag']));\n                return [$appendStream, $cipherTextStream->getAesName()];\n            default:\n                $cipherMethod = $this->buildCipherMethod(\n                    $cipherOptions['Cipher'],\n                    $cipherOptions['Iv'],\n                    $cipherOptions['KeySize']\n                );\n                $cipherTextStream = new AesEncryptingStream(\n                    $plaintext,\n                    $cek,\n                    $cipherMethod\n                );\n                return [$cipherTextStream, $cipherTextStream->getAesName()];\n        }\n    }\n}\n", "num_lines": 193}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nuse GuzzleHttp\\Psr7;\nuse GuzzleHttp\\Psr7\\AppendStream;\nuse GuzzleHttp\\Psr7\\Stream;\nuse Psr\\Http\\Message\\StreamInterface;\n\ntrait EncryptionTraitV2\n{\n    private static $allowedOptions = [\n        'Cipher' => true,\n        'KeySize' => true,\n        'Aad' => true,\n    ];\n\n    private static $encryptClasses = [\n        'gcm' => AesGcmEncryptingStream::class\n    ];\n\n    /**\n     * Dependency to generate a CipherMethod from a set of inputs for loading\n     * in to an AesEncryptingStream.\n     *\n     * @param string $cipherName Name of the cipher to generate for encrypting.\n     * @param string $iv Base Initialization Vector for the cipher.\n     * @param int $keySize Size of the encryption key, in bits, that will be\n     *                     used.\n     *\n     * @return Cipher\\CipherMethod\n     *\n     * @internal\n     */\n    abstract protected function buildCipherMethod($cipherName, $iv, $keySize);\n\n    /**\n     * Builds an AesStreamInterface and populates encryption metadata into the\n     * supplied envelope.\n     *\n     * @param Stream $plaintext Plain-text data to be encrypted using the\n     *                          materials, algorithm, and data provided.\n     * @param array $options    Options for use in encryption, including cipher\n     *                          options, and encryption context.\n     * @param MaterialsProviderV2 $provider A provider to supply and encrypt\n     *                                      materials used in encryption.\n     * @param MetadataEnvelope $envelope A storage envelope for encryption\n     *                                   metadata to be added to.\n     *\n     * @return StreamInterface\n     *\n     * @throws \\InvalidArgumentException Thrown when a value in $options['@CipherOptions']\n     *                                   is not valid.\n     *s\n     * @internal\n     */\n    public function encrypt(\n        Stream $plaintext,\n        array $options,\n        MaterialsProviderV2 $provider,\n        MetadataEnvelope $envelope\n    ) {\n        $options = array_change_key_case($options);\n        $cipherOptions = array_intersect_key(\n            $options['@cipheroptions'],\n            self::$allowedOptions\n        );\n\n        if (empty($cipherOptions['Cipher'])) {\n            throw new \\InvalidArgumentException('An encryption cipher must be'\n                . ' specified in @CipherOptions[\"Cipher\"].');\n        }\n\n        $cipherOptions['Cipher'] = strtolower($cipherOptions['Cipher']);\n\n        if (!self::isSupportedCipher($cipherOptions['Cipher'])) {\n            throw new \\InvalidArgumentException('The cipher requested is not'\n                . ' supported by the SDK.');\n        }\n\n        if (empty($cipherOptions['KeySize'])) {\n            $cipherOptions['KeySize'] = 256;\n        }\n        if (!is_int($cipherOptions['KeySize'])) {\n            throw new \\InvalidArgumentException('The cipher \"KeySize\" must be'\n                . ' an integer.');\n        }\n\n        if (!MaterialsProviderV2::isSupportedKeySize(\n            $cipherOptions['KeySize']\n        )) {\n            throw new \\InvalidArgumentException('The cipher \"KeySize\" requested'\n                . ' is not supported by AES (128 or 256).');\n        }\n\n        $cipherOptions['Iv'] = $provider->generateIv(\n            $this->getCipherOpenSslName(\n                $cipherOptions['Cipher'],\n                $cipherOptions['KeySize']\n            )\n        );\n\n        $encryptClass = self::$encryptClasses[$cipherOptions['Cipher']];\n        $aesName = $encryptClass::getStaticAesName();\n        $materialsDescription = ['aws:x-amz-cek-alg' => $aesName];\n\n        $keys = $provider->generateCek(\n            $cipherOptions['KeySize'],\n            $materialsDescription,\n            $options\n        );\n\n        // Some providers modify materials description based on options\n        if (isset($keys['UpdatedContext'])) {\n            $materialsDescription = $keys['UpdatedContext'];\n        }\n\n        $encryptingStream = $this->getEncryptingStream(\n            $plaintext,\n            $keys['Plaintext'],\n            $cipherOptions\n        );\n\n        // Populate envelope data\n        $envelope[MetadataEnvelope::CONTENT_KEY_V2_HEADER] = $keys['Ciphertext'];\n        unset($keys);\n\n        $envelope[MetadataEnvelope::IV_HEADER] =\n            base64_encode($cipherOptions['Iv']);\n        $envelope[MetadataEnvelope::KEY_WRAP_ALGORITHM_HEADER] =\n            $provider->getWrapAlgorithmName();\n        $envelope[MetadataEnvelope::CONTENT_CRYPTO_SCHEME_HEADER] = $aesName;\n        $envelope[MetadataEnvelope::UNENCRYPTED_CONTENT_LENGTH_HEADER] =\n            strlen($plaintext);\n        $envelope[MetadataEnvelope::MATERIALS_DESCRIPTION_HEADER] =\n            json_encode($materialsDescription);\n        if (!empty($cipherOptions['Tag'])) {\n            $envelope[MetadataEnvelope::CRYPTO_TAG_LENGTH_HEADER] =\n                strlen($cipherOptions['Tag']) * 8;\n        }\n\n        return $encryptingStream;\n    }\n\n    /**\n     * Generates a stream that wraps the plaintext with the proper cipher and\n     * uses the content encryption key (CEK) to encrypt the data when read.\n     *\n     * @param Stream $plaintext Plain-text data to be encrypted using the\n     *                          materials, algorithm, and data provided.\n     * @param string $cek A content encryption key for use by the stream for\n     *                    encrypting the plaintext data.\n     * @param array $cipherOptions Options for use in determining the cipher to\n     *                             be used for encrypting data.\n     *\n     * @return [AesStreamInterface, string]\n     *\n     * @internal\n     */\n    protected function getEncryptingStream(\n        Stream $plaintext,\n        $cek,\n        &$cipherOptions\n    ) {\n        switch ($cipherOptions['Cipher']) {\n            // Only 'gcm' is supported for encryption currently\n            case 'gcm':\n                $cipherOptions['TagLength'] = 16;\n                $encryptClass = self::$encryptClasses['gcm'];\n                $cipherTextStream = new $encryptClass(\n                    $plaintext,\n                    $cek,\n                    $cipherOptions['Iv'],\n                    $cipherOptions['Aad'] = isset($cipherOptions['Aad'])\n                        ? $cipherOptions['Aad']\n                        : '',\n                    $cipherOptions['TagLength'],\n                    $cipherOptions['KeySize']\n                );\n\n                if (!empty($cipherOptions['Aad'])) {\n                    trigger_error(\"'Aad' has been supplied for content encryption\"\n                        . \" with \" . $cipherTextStream->getAesName() . \". The\"\n                        . \" PHP SDK encryption client can decrypt an object\"\n                        . \" encrypted in this way, but other AWS SDKs may not be\"\n                        . \" able to.\", E_USER_WARNING);\n                }\n\n                $appendStream = new AppendStream([\n                    $cipherTextStream->createStream()\n                ]);\n                $cipherOptions['Tag'] = $cipherTextStream->getTag();\n                $appendStream->addStream(Psr7\\Utils::streamFor($cipherOptions['Tag']));\n                return $appendStream;\n        }\n    }\n}\n", "num_lines": 197}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nuse Aws\\Kms\\KmsClient;\n\n/**\n * Uses KMS to supply materials for encrypting and decrypting data.\n *\n * Legacy implementation that supports legacy S3EncryptionClient and\n * S3EncryptionMultipartUploader, which use an older encryption workflow. Use\n * KmsMaterialsProviderV2 with S3EncryptionClientV2 or\n * S3EncryptionMultipartUploaderV2 if possible.\n *\n * @deprecated\n */\nclass KmsMaterialsProvider extends MaterialsProvider implements MaterialsProviderInterface\n{\n    const WRAP_ALGORITHM_NAME = 'kms';\n\n    private $kmsClient;\n    private $kmsKeyId;\n\n    /**\n     * @param KmsClient $kmsClient A KMS Client for use encrypting and\n     *                             decrypting keys.\n     * @param string $kmsKeyId The private KMS key id to be used for encrypting\n     *                         and decrypting keys.\n     */\n    public function __construct(\n        KmsClient $kmsClient,\n        $kmsKeyId = null\n    ) {\n        $this->kmsClient = $kmsClient;\n        $this->kmsKeyId = $kmsKeyId;\n    }\n\n    public function fromDecryptionEnvelope(MetadataEnvelope $envelope)\n    {\n        if (empty($envelope[MetadataEnvelope::MATERIALS_DESCRIPTION_HEADER])) {\n            throw new \\RuntimeException('Not able to detect the materials description.');\n        }\n\n        $materialsDescription = json_decode(\n            $envelope[MetadataEnvelope::MATERIALS_DESCRIPTION_HEADER],\n            true\n        );\n\n        if (empty($materialsDescription['kms_cmk_id'])\n            && empty($materialsDescription['aws:x-amz-cek-alg'])) {\n            throw new \\RuntimeException('Not able to detect kms_cmk_id (legacy'\n                . ' implementation) or aws:x-amz-cek-alg (current implementation)'\n                . ' from kms materials description.');\n        }\n\n        return new self(\n            $this->kmsClient,\n            isset($materialsDescription['kms_cmk_id'])\n                ? $materialsDescription['kms_cmk_id']\n                : null\n        );\n    }\n\n    /**\n     * The KMS key id for use in matching this Provider to its keys,\n     * consistently with other SDKs as 'kms_cmk_id'.\n     *\n     * @return array\n     */\n    public function getMaterialsDescription()\n    {\n        return ['kms_cmk_id' => $this->kmsKeyId];\n    }\n\n    public function getWrapAlgorithmName()\n    {\n        return self::WRAP_ALGORITHM_NAME;\n    }\n\n    /**\n     * Takes a content encryption key (CEK) and description to return an encrypted\n     * key by using KMS' Encrypt API.\n     *\n     * @param string $unencryptedCek Key for use in encrypting other data\n     *                               that itself needs to be encrypted by the\n     *                               Provider.\n     * @param string $materialDescription Material Description for use in\n     *                                    encrypting the $cek.\n     *\n     * @return string\n     */\n    public function encryptCek($unencryptedCek, $materialDescription)\n    {\n        $encryptedDataKey = $this->kmsClient->encrypt([\n            'Plaintext' => $unencryptedCek,\n            'KeyId' => $this->kmsKeyId,\n            'EncryptionContext' => $materialDescription\n        ]);\n        return base64_encode($encryptedDataKey['CiphertextBlob']);\n    }\n\n    /**\n     * Takes an encrypted content encryption key (CEK) and material description\n     * for use decrypting the key by using KMS' Decrypt API.\n     *\n     * @param string $encryptedCek Encrypted key to be decrypted by the Provider\n     *                             for use decrypting other data.\n     * @param string $materialDescription Material Description for use in\n     *                                    encrypting the $cek.\n     *\n     * @return string\n     */\n    public function decryptCek($encryptedCek, $materialDescription)\n    {\n        $result = $this->kmsClient->decrypt([\n            'CiphertextBlob' => $encryptedCek,\n            'EncryptionContext' => $materialDescription\n        ]);\n\n        return $result['Plaintext'];\n    }\n}\n", "num_lines": 122}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nuse Aws\\Exception\\CryptoException;\nuse Aws\\Kms\\KmsClient;\n\n/**\n * Uses KMS to supply materials for encrypting and decrypting data. This\n * V2 implementation should be used with the V2 encryption clients (i.e.\n * S3EncryptionClientV2).\n */\nclass KmsMaterialsProviderV2 extends MaterialsProviderV2 implements MaterialsProviderInterfaceV2\n{\n    const WRAP_ALGORITHM_NAME = 'kms+context';\n\n    private $kmsClient;\n    private $kmsKeyId;\n\n    /**\n     * @param KmsClient $kmsClient A KMS Client for use encrypting and\n     *                             decrypting keys.\n     * @param string $kmsKeyId The private KMS key id to be used for encrypting\n     *                         and decrypting keys.\n     */\n    public function __construct(\n        KmsClient $kmsClient,\n        $kmsKeyId = null\n    ) {\n        $this->kmsClient = $kmsClient;\n        $this->kmsKeyId = $kmsKeyId;\n    }\n\n    /**\n     * @inheritDoc\n     */\n    public function getWrapAlgorithmName()\n    {\n        return self::WRAP_ALGORITHM_NAME;\n    }\n\n    /**\n     * @inheritDoc\n     */\n    public function decryptCek($encryptedCek, $materialDescription, $options)\n    {\n        $params = [\n            'CiphertextBlob' => $encryptedCek,\n            'EncryptionContext' => $materialDescription\n        ];\n        if (empty($options['@KmsAllowDecryptWithAnyCmk'])) {\n            if (empty($this->kmsKeyId)) {\n                throw new CryptoException('KMS CMK ID was not specified and the'\n                    . ' operation is not opted-in to attempting to use any valid'\n                    . ' CMK it discovers. Please specify a CMK ID, or explicitly'\n                    . ' enable attempts to use any valid KMS CMK with the'\n                    . ' @KmsAllowDecryptWithAnyCmk option.');\n            }\n            $params['KeyId'] = $this->kmsKeyId;\n        }\n\n        $result = $this->kmsClient->decrypt($params);\n        return $result['Plaintext'];\n    }\n\n    /**\n     * @inheritDoc\n     */\n    public function generateCek($keySize, $context, $options)\n    {\n        if (empty($this->kmsKeyId)) {\n            throw new CryptoException('A KMS key id is required for encryption'\n                . ' with KMS keywrap. Use a KmsMaterialsProviderV2 that has been'\n                . ' instantiated with a KMS key id.');\n        }\n        $options = array_change_key_case($options);\n        if (!isset($options['@kmsencryptioncontext'])\n            || !is_array($options['@kmsencryptioncontext'])\n        ) {\n            throw new CryptoException(\"'@KmsEncryptionContext' is a\"\n                . \" required argument when using KmsMaterialsProviderV2, and\"\n                . \" must be an associative array (or empty array).\");\n        }\n        if (isset($options['@kmsencryptioncontext']['aws:x-amz-cek-alg'])) {\n            throw new CryptoException(\"Conflict in reserved @KmsEncryptionContext\"\n                . \" key aws:x-amz-cek-alg. This value is reserved for the S3\"\n                . \" Encryption Client and cannot be set by the user.\");\n        }\n        $context = array_merge($options['@kmsencryptioncontext'], $context);\n        $result = $this->kmsClient->generateDataKey([\n            'KeyId' => $this->kmsKeyId,\n            'KeySpec' => \"AES_{$keySize}\",\n            'EncryptionContext' => $context\n        ]);\n        return [\n            'Plaintext' => $result['Plaintext'],\n            'Ciphertext' => base64_encode($result['CiphertextBlob']),\n            'UpdatedContext' => $context\n        ];\n    }\n}\n", "num_lines": 101}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nabstract class MaterialsProvider implements MaterialsProviderInterface\n{\n    private static $supportedKeySizes = [\n        128 => true,\n        192 => true,\n        256 => true,\n    ];\n\n    /**\n     * Returns if the requested size is supported by AES.\n     *\n     * @param int $keySize Size of the requested key in bits.\n     *\n     * @return bool\n     */\n    public static function isSupportedKeySize($keySize)\n    {\n        return isset(self::$supportedKeySizes[$keySize]);\n    }\n\n    /**\n     * Performs further initialization of the MaterialsProvider based on the\n     * data inside the MetadataEnvelope.\n     *\n     * @param MetadataEnvelope $envelope A storage envelope for encryption\n     *                                   metadata to be read from.\n     *\n     * @return MaterialsProvider\n     *\n     * @throws \\RuntimeException Thrown when there is an empty or improperly\n     *                           formed materials description in the envelope.\n     *\n     * @internal\n     */\n    abstract public function fromDecryptionEnvelope(MetadataEnvelope $envelope);\n\n    /**\n     * Returns the material description for this Provider so it can be verified\n     * by encryption mechanisms.\n     *\n     * @return string\n     */\n    abstract public function getMaterialsDescription();\n\n    /**\n     * Returns the wrap algorithm name for this Provider.\n     *\n     * @return string\n     */\n    abstract public function getWrapAlgorithmName();\n\n    /**\n     * Takes a content encryption key (CEK) and description to return an\n     * encrypted key according to the Provider's specifications.\n     *\n     * @param string $unencryptedCek Key for use in encrypting other data\n     *                               that itself needs to be encrypted by the\n     *                               Provider.\n     * @param string $materialDescription Material Description for use in\n     *                                    encrypting the $cek.\n     *\n     * @return string\n     */\n    abstract public function encryptCek($unencryptedCek, $materialDescription);\n\n    /**\n     * Takes an encrypted content encryption key (CEK) and material description\n     * for use decrypting the key according to the Provider's specifications.\n     *\n     * @param string $encryptedCek Encrypted key to be decrypted by the Provider\n     *                             for use decrypting other data.\n     * @param string $materialDescription Material Description for use in\n     *                                    encrypting the $cek.\n     *\n     * @return string\n     */\n    abstract public function decryptCek($encryptedCek, $materialDescription);\n\n    /**\n     * @param string $keySize Length of a cipher key in bits for generating a\n     *                        random content encryption key (CEK).\n     *\n     * @return string\n     */\n    public function generateCek($keySize)\n    {\n        return openssl_random_pseudo_bytes($keySize / 8);\n    }\n\n    /**\n     * @param string $openSslName Cipher OpenSSL name to use for generating\n     *                            an initialization vector.\n     *\n     * @return string\n     */\n    public function generateIv($openSslName)\n    {\n        return openssl_random_pseudo_bytes(\n            openssl_cipher_iv_length($openSslName)\n        );\n    }\n}\n", "num_lines": 106}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\ninterface MaterialsProviderInterface\n{\n    /**\n     * Returns if the requested size is supported by AES.\n     *\n     * @param int $keySize Size of the requested key in bits.\n     *\n     * @return bool\n     */\n    public static function isSupportedKeySize($keySize);\n\n    /**\n     * Performs further initialization of the MaterialsProvider based on the\n     * data inside the MetadataEnvelope.\n     *\n     * @param MetadataEnvelope $envelope A storage envelope for encryption\n     *                                   metadata to be read from.\n     *\n     * @internal\n     */\n    public function fromDecryptionEnvelope(MetadataEnvelope $envelope);\n\n    /**\n     * Returns the wrap algorithm name for this Provider.\n     *\n     * @return string\n     */\n    public function getWrapAlgorithmName();\n\n    /**\n     * Takes an encrypted content encryption key (CEK) and material description\n     * for use decrypting the key according to the Provider's specifications.\n     *\n     * @param string $encryptedCek Encrypted key to be decrypted by the Provider\n     *                             for use decrypting other data.\n     * @param string $materialDescription Material Description for use in\n     *                                    encrypting the $cek.\n     *\n     * @return string\n     */\n    public function decryptCek($encryptedCek, $materialDescription);\n\n    /**\n     * @param string $keySize Length of a cipher key in bits for generating a\n     *                        random content encryption key (CEK).\n     *\n     * @return string\n     */\n    public function generateCek($keySize);\n\n    /**\n     * @param string $openSslName Cipher OpenSSL name to use for generating\n     *                            an initialization vector.\n     *\n     * @return string\n     */\n    public function generateIv($openSslName);\n}\n", "num_lines": 62}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\ninterface MaterialsProviderInterfaceV2\n{\n    /**\n     * Returns if the requested size is supported by AES.\n     *\n     * @param int $keySize Size of the requested key in bits.\n     *\n     * @return bool\n     */\n    public static function isSupportedKeySize($keySize);\n\n    /**\n     * Returns the wrap algorithm name for this Provider.\n     *\n     * @return string\n     */\n    public function getWrapAlgorithmName();\n\n    /**\n     * Takes an encrypted content encryption key (CEK) and material description\n     * for use decrypting the key according to the Provider's specifications.\n     *\n     * @param string $encryptedCek Encrypted key to be decrypted by the Provider\n     *                             for use decrypting other data.\n     * @param string $materialDescription Material Description for use in\n     *                                    decrypting the CEK.\n     * @param array $options Options for use in decrypting the CEK.\n     *\n     * @return string\n     */\n    public function decryptCek($encryptedCek, $materialDescription, $options);\n\n    /**\n     * @param string $keySize Length of a cipher key in bits for generating a\n     *                        random content encryption key (CEK).\n     * @param array $context Context map needed for key encryption\n     * @param array $options Additional options to be used in CEK generation\n     *\n     * @return array\n     */\n    public function generateCek($keySize, $context, $options);\n\n    /**\n     * @param string $openSslName Cipher OpenSSL name to use for generating\n     *                            an initialization vector.\n     *\n     * @return string\n     */\n    public function generateIv($openSslName);\n}\n", "num_lines": 54}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nabstract class MaterialsProviderV2 implements MaterialsProviderInterfaceV2\n{\n    private static $supportedKeySizes = [\n        128 => true,\n        256 => true,\n    ];\n\n    /**\n     * Returns if the requested size is supported by AES.\n     *\n     * @param int $keySize Size of the requested key in bits.\n     *\n     * @return bool\n     */\n    public static function isSupportedKeySize($keySize)\n    {\n        return isset(self::$supportedKeySizes[$keySize]);\n    }\n\n    /**\n     * Returns the wrap algorithm name for this Provider.\n     *\n     * @return string\n     */\n    abstract public function getWrapAlgorithmName();\n\n    /**\n     * Takes an encrypted content encryption key (CEK) and material description\n     * for use decrypting the key according to the Provider's specifications.\n     *\n     * @param string $encryptedCek Encrypted key to be decrypted by the Provider\n     *                             for use decrypting other data.\n     * @param string $materialDescription Material Description for use in\n     *                                    decrypting the CEK.\n     * @param string $options Options for use in decrypting the CEK.\n     *\n     * @return string\n     */\n    abstract public function decryptCek($encryptedCek, $materialDescription, $options);\n\n    /**\n     * @param string $keySize Length of a cipher key in bits for generating a\n     *                        random content encryption key (CEK).\n     * @param array $context Context map needed for key encryption\n     * @param array $options Additional options to be used in CEK generation\n     *\n     * @return array\n     */\n    abstract public function generateCek($keySize, $context, $options);\n\n    /**\n     * @param string $openSslName Cipher OpenSSL name to use for generating\n     *                            an initialization vector.\n     *\n     * @return string\n     */\n    public function generateIv($openSslName)\n    {\n        return openssl_random_pseudo_bytes(\n            openssl_cipher_iv_length($openSslName)\n        );\n    }\n}\n", "num_lines": 67}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\nuse Aws\\HasDataTrait;\nuse \\ArrayAccess;\nuse \\IteratorAggregate;\nuse \\InvalidArgumentException;\nuse \\JsonSerializable;\n\n/**\n * Stores encryption metadata for reading and writing.\n *\n * @internal\n */\nclass MetadataEnvelope implements ArrayAccess, IteratorAggregate, JsonSerializable\n{\n    use HasDataTrait;\n\n    const CONTENT_KEY_V2_HEADER = 'x-amz-key-v2';\n    const IV_HEADER = 'x-amz-iv';\n    const MATERIALS_DESCRIPTION_HEADER = 'x-amz-matdesc';\n    const KEY_WRAP_ALGORITHM_HEADER = 'x-amz-wrap-alg';\n    const CONTENT_CRYPTO_SCHEME_HEADER = 'x-amz-cek-alg';\n    const CRYPTO_TAG_LENGTH_HEADER = 'x-amz-tag-len';\n    const UNENCRYPTED_CONTENT_LENGTH_HEADER = 'x-amz-unencrypted-content-length';\n\n    private static $constants = [];\n\n    public static function getConstantValues()\n    {\n        if (empty(self::$constants)) {\n            $reflection = new \\ReflectionClass(static::class);\n            foreach (array_values($reflection->getConstants()) as $constant) {\n                self::$constants[$constant] = true;\n            }\n        }\n\n        return array_keys(self::$constants);\n    }\n\n    /**\n     * @return void\n     */\n    #[\\ReturnTypeWillChange]\n    public function offsetSet($name, $value)\n    {\n        $constants = self::getConstantValues();\n        if (is_null($name) || !in_array($name, $constants)) {\n            throw new InvalidArgumentException('MetadataEnvelope fields must'\n                . ' must match a predefined offset; use the header constants.');\n        }\n\n        $this->data[$name] = $value;\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function jsonSerialize()\n    {\n        return $this->data;\n    }\n}\n", "num_lines": 62}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto;\n\ninterface MetadataStrategyInterface\n{\n    /**\n     * Places the information in the MetadataEnvelope to the strategy specific\n     * location. Populates the PutObject arguments with any information\n     * necessary for loading.\n     *\n     * @param MetadataEnvelope $envelope Encryption data to save according to\n     *                                   the strategy.\n     * @param array $args Starting arguments for PutObject.\n     *\n     * @return array Updated arguments for PutObject.\n     */\n    public function save(MetadataEnvelope $envelope, array $args);\n\n    /**\n     * Generates a MetadataEnvelope according to the specific strategy using the\n     * passed arguments.\n     *\n     * @param array $args Arguments from Command and Result that contains\n     *                    S3 Object information, relevant headers, and command\n     *                    configuration.\n     *\n     * @return MetadataEnvelope\n     */\n    public function load(array $args);\n}\n", "num_lines": 31}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto\\Cipher;\n\nuse \\InvalidArgumentException;\nuse \\LogicException;\n\n/**\n * An implementation of the CBC cipher for use with an AesEncryptingStream or\n * AesDecrypting stream.\n *\n * This cipher method is deprecated and in maintenance mode - no new updates will be\n * released. Please see https://docs.aws.amazon.com/general/latest/gr/aws_sdk_cryptography.html\n * for more information.\n *\n * @deprecated\n */\nclass Cbc implements CipherMethod\n{\n    const BLOCK_SIZE = 16;\n\n    /**\n     * @var string\n     */\n    private $baseIv;\n\n    /**\n     * @var string\n     */\n    private $iv;\n\n    /**\n     * @var int\n     */\n    private $keySize;\n\n    /**\n     * @param string $iv Base Initialization Vector for the cipher.\n     * @param int $keySize Size of the encryption key, in bits, that will be\n     *                     used.\n     *\n     * @throws InvalidArgumentException Thrown if the passed iv does not match\n     *                                  the iv length required by the cipher.\n     */\n    public function __construct($iv, $keySize = 256)\n    {\n        $this->baseIv = $this->iv = $iv;\n        $this->keySize = $keySize;\n\n        if (strlen($iv) !== openssl_cipher_iv_length($this->getOpenSslName())) {\n            throw new InvalidArgumentException('Invalid initialization vector');\n        }\n    }\n\n    public function getOpenSslName()\n    {\n        return \"aes-{$this->keySize}-cbc\";\n    }\n\n    public function getAesName()\n    {\n        return 'AES/CBC/PKCS5Padding';\n    }\n\n    public function getCurrentIv()\n    {\n        return $this->iv;\n    }\n\n    public function requiresPadding()\n    {\n        return true;\n    }\n\n    public function seek($offset, $whence = SEEK_SET)\n    {\n        if ($offset === 0 && $whence === SEEK_SET) {\n            $this->iv = $this->baseIv;\n        } else {\n            throw new LogicException('CBC initialization only support being'\n                . ' rewound, not arbitrary seeking.');\n        }\n    }\n\n    public function update($cipherTextBlock)\n    {\n        $this->iv = substr($cipherTextBlock, self::BLOCK_SIZE * -1);\n    }\n}\n", "num_lines": 89}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto\\Cipher;\n\nuse Aws\\Exception\\CryptoException;\n\ntrait CipherBuilderTrait\n{\n    /**\n     * Returns an identifier recognizable by `openssl_*` functions, such as\n     * `aes-256-cbc` or `aes-128-ctr`.\n     *\n     * @param string $cipherName Name of the cipher being used for encrypting\n     *                           or decrypting.\n     * @param int $keySize Size of the encryption key, in bits, that will be\n     *                     used.\n     *\n     * @return string\n     */\n    protected function getCipherOpenSslName($cipherName, $keySize)\n    {\n        return \"aes-{$keySize}-{$cipherName}\";\n    }\n\n    /**\n     * Constructs a CipherMethod for the given name, initialized with the other\n     * data passed for use in encrypting or decrypting.\n     *\n     * @param string $cipherName Name of the cipher to generate for encrypting.\n     * @param string $iv Base Initialization Vector for the cipher.\n     * @param int $keySize Size of the encryption key, in bits, that will be\n     *                     used.\n     *\n     * @return CipherMethod\n     *\n     * @internal\n     */\n    protected function buildCipherMethod($cipherName, $iv, $keySize)\n    {\n        switch ($cipherName) {\n            case 'cbc':\n                return new Cbc(\n                    $iv,\n                    $keySize\n                );\n            default:\n                return null;\n        }\n    }\n\n    /**\n     * Performs a reverse lookup to get the openssl_* cipher name from the\n     * AESName passed in from the MetadataEnvelope.\n     *\n     * @param $aesName\n     *\n     * @return string\n     *\n     * @internal\n     */\n    protected function getCipherFromAesName($aesName)\n    {\n        switch ($aesName) {\n            case 'AES/GCM/NoPadding':\n                return 'gcm';\n            case 'AES/CBC/PKCS5Padding':\n                return 'cbc';\n            default:\n                throw new CryptoException('Unrecognized or unsupported'\n                    . ' AESName for reverse lookup.');\n        }\n    }\n}", "num_lines": 72}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto\\Cipher;\n\ninterface CipherMethod\n{\n    /**\n     * Returns an identifier recognizable by `openssl_*` functions, such as\n     * `aes-256-cbc` or `aes-128-ctr`.\n     *\n     * @return string\n     */\n    public function getOpenSslName();\n\n    /**\n     * Returns an AES recognizable name, such as 'AES/GCM/NoPadding'.\n     *\n     * @return string\n     */\n    public function getAesName();\n\n    /**\n     * Returns the IV that should be used to initialize the next block in\n     * encrypt or decrypt.\n     *\n     * @return string\n     */\n    public function getCurrentIv();\n\n    /**\n     * Indicates whether the cipher method used with this IV requires padding\n     * the final block to make sure the plaintext is evenly divisible by the\n     * block size.\n     *\n     * @return boolean\n     */\n    public function requiresPadding();\n\n    /**\n     * Adjust the return of this::getCurrentIv to reflect a seek performed on\n     * the encryption stream using this IV object.\n     *\n     * @param int $offset\n     * @param int $whence\n     *\n     * @throws LogicException   Thrown if the requested seek is not supported by\n     *                          this IV implementation. For example, a CBC IV\n     *                          only supports a full rewind ($offset === 0 &&\n     *                          $whence === SEEK_SET)\n     */\n    public function seek($offset, $whence = SEEK_SET);\n\n    /**\n     * Take account of the last cipher text block to adjust the return of\n     * this::getCurrentIv\n     *\n     * @param string $cipherTextBlock\n     */\n    public function update($cipherTextBlock);\n}\n", "num_lines": 60}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto\\Polyfill;\n\nuse Aws\\Exception\\CryptoPolyfillException;\nuse InvalidArgumentException;\nuse RangeException;\n\n/**\n * Class AesGcm\n *\n * This provides a polyfill for AES-GCM encryption/decryption, with caveats:\n *\n * 1. Only 96-bit nonces are supported.\n * 2. Only 128-bit authentication tags are supported. (i.e. non-truncated)\n *\n * Supports AES key sizes of 128-bit, 192-bit, and 256-bit.\n *\n * @package Aws\\Crypto\\Polyfill\n */\nclass AesGcm\n{\n    use NeedsTrait;\n\n    /** @var Key $aesKey */\n    private $aesKey;\n\n    /** @var int $keySize */\n    private $keySize;\n\n    /** @var int $blockSize */\n    protected $blockSize = 8192;\n\n    /**\n     * AesGcm constructor.\n     *\n     * @param Key $aesKey\n     * @param int $keySize\n     * @param int $blockSize\n     *\n     * @throws CryptoPolyfillException\n     * @throws InvalidArgumentException\n     * @throws RangeException\n     */\n    public function __construct(Key $aesKey, $keySize = 256, $blockSize = 8192)\n    {\n        /* Preconditions: */\n        self::needs(\n            \\in_array($keySize, [128, 192, 256], true),\n            \"Key size must be 128, 192, or 256 bits; {$keySize} given\",\n            InvalidArgumentException::class\n        );\n        self::needs(\n            \\is_int($blockSize) && $blockSize > 0 && $blockSize <= PHP_INT_MAX,\n            'Block size must be a positive integer.',\n            RangeException::class\n        );\n        self::needs(\n            $aesKey->length() << 3 === $keySize,\n            'Incorrect key size; expected ' . $keySize . ' bits, got ' . ($aesKey->length() << 3) . ' bits.'\n        );\n        $this->aesKey = $aesKey;\n        $this->keySize = $keySize;\n    }\n\n    /**\n     * Encryption interface for AES-GCM\n     *\n     * @param string $plaintext  Message to be encrypted\n     * @param string $nonce      Number to be used ONCE\n     * @param Key $key           AES Key\n     * @param string $aad        Additional authenticated data\n     * @param string &$tag       Reference to variable to hold tag\n     * @param int $keySize       Key size (bits)\n     * @param int $blockSize     Block size (bytes) -- How much memory to buffer\n     * @return string\n     * @throws InvalidArgumentException\n     */\n    public static function encrypt(\n        $plaintext,\n        $nonce,\n        Key $key,\n        $aad,\n        &$tag,\n        $keySize = 256,\n        $blockSize = 8192\n    ) {\n        self::needs(\n            self::strlen($nonce) === 12,\n            'Nonce must be exactly 12 bytes',\n            InvalidArgumentException::class\n        );\n\n        $encryptor = new AesGcm($key, $keySize, $blockSize);\n        list($aadLength, $gmac) = $encryptor->gmacInit($nonce, $aad);\n\n        $ciphertext = \\openssl_encrypt(\n            $plaintext,\n            \"aes-{$encryptor->keySize}-ctr\",\n            $key->get(),\n            OPENSSL_NO_PADDING | OPENSSL_RAW_DATA,\n            $nonce . \"\\x00\\x00\\x00\\x02\"\n        );\n\n        /* Calculate auth tag in a streaming fashion to minimize memory usage: */\n        $ciphertextLength = self::strlen($ciphertext);\n        for ($i = 0; $i < $ciphertextLength; $i += $encryptor->blockSize) {\n            $cBlock = new ByteArray(self::substr($ciphertext, $i, $encryptor->blockSize));\n            $gmac->update($cBlock);\n        }\n        $tag = $gmac->finish($aadLength, $ciphertextLength)->toString();\n        return $ciphertext;\n    }\n\n    /**\n     * Decryption interface for AES-GCM\n     *\n     * @param string $ciphertext Ciphertext to decrypt\n     * @param string $nonce      Number to be used ONCE\n     * @param Key $key           AES key\n     * @param string $aad        Additional authenticated data\n     * @param string $tag        Authentication tag\n     * @param int $keySize       Key size (bits)\n     * @param int $blockSize     Block size (bytes) -- How much memory to buffer\n     * @return string            Plaintext\n     *\n     * @throws CryptoPolyfillException\n     * @throws InvalidArgumentException\n     */\n    public static function decrypt(\n        $ciphertext,\n        $nonce,\n        Key $key,\n        $aad,\n        &$tag,\n        $keySize = 256,\n        $blockSize = 8192\n    ) {\n        /* Precondition: */\n        self::needs(\n            self::strlen($nonce) === 12,\n            'Nonce must be exactly 12 bytes',\n            InvalidArgumentException::class\n        );\n\n        $encryptor = new AesGcm($key, $keySize, $blockSize);\n        list($aadLength, $gmac) = $encryptor->gmacInit($nonce, $aad);\n\n        /* Calculate auth tag in a streaming fashion to minimize memory usage: */\n        $ciphertextLength = self::strlen($ciphertext);\n        for ($i = 0; $i < $ciphertextLength; $i += $encryptor->blockSize) {\n            $cBlock = new ByteArray(self::substr($ciphertext, $i, $encryptor->blockSize));\n            $gmac->update($cBlock);\n        }\n\n        /* Validate auth tag in constant-time: */\n        $calc = $gmac->finish($aadLength, $ciphertextLength);\n        $expected = new ByteArray($tag);\n        self::needs($calc->equals($expected), 'Invalid authentication tag');\n\n        /* Return plaintext if auth tag check succeeded: */\n        return \\openssl_decrypt(\n            $ciphertext,\n            \"aes-{$encryptor->keySize}-ctr\",\n            $key->get(),\n            OPENSSL_NO_PADDING | OPENSSL_RAW_DATA,\n            $nonce . \"\\x00\\x00\\x00\\x02\"\n        );\n    }\n\n    /**\n     * Initialize a Gmac object with the nonce and this object's key.\n     *\n     * @param string $nonce     Must be exactly 12 bytes long.\n     * @param string|null $aad\n     * @return array\n     */\n    protected function gmacInit($nonce, $aad = null)\n    {\n        $gmac = new Gmac(\n            $this->aesKey,\n            $nonce . \"\\x00\\x00\\x00\\x01\",\n            $this->keySize\n        );\n        $aadBlock = new ByteArray($aad);\n        $aadLength = $aadBlock->count();\n        $gmac->update($aadBlock);\n        $gmac->flush();\n        return [$aadLength, $gmac];\n    }\n\n    /**\n     * Calculate the length of a string.\n     *\n     * Uses the appropriate PHP function without being brittle to\n     * mbstring.func_overload.\n     *\n     * @param string $string\n     * @return int\n     */\n    protected static function strlen($string)\n    {\n        if (\\is_callable('\\\\mb_strlen')) {\n            return (int) \\mb_strlen($string, '8bit');\n        }\n        return (int) \\strlen($string);\n    }\n\n    /**\n     * Return a substring of the provided string.\n     *\n     * Uses the appropriate PHP function without being brittle to\n     * mbstring.func_overload.\n     *\n     * @param string $string\n     * @param int $offset\n     * @param int|null $length\n     * @return string\n     */\n    protected static function substr($string, $offset = 0, $length = null)\n    {\n        if (\\is_callable('\\\\mb_substr')) {\n            return \\mb_substr($string, $offset, $length, '8bit');\n        } elseif (!\\is_null($length)) {\n            return \\substr($string, $offset, $length);\n        }\n        return \\substr($string, $offset);\n    }\n}\n", "num_lines": 229}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto\\Polyfill;\n\n/**\n * Class ByteArray\n * @package Aws\\Crypto\\Polyfill\n */\nclass ByteArray extends \\SplFixedArray\n{\n    use NeedsTrait;\n\n    /**\n     * ByteArray constructor.\n     *\n     * @param int|string|int[] $size\n     *     If you pass in an integer, it creates a ByteArray of that size.\n     *     If you pass in a string or array, it converts it to an array of\n     *       integers between 0 and 255.\n     * @throws \\InvalidArgumentException\n     */\n    public function __construct($size = 0)\n    {\n        $arr = null;\n        // Integer? This behaves just like SplFixedArray.\n        if (\\is_array($size)) {\n            // Array? We need to pass the count to parent::__construct() then populate\n            $arr = $size;\n            $size = \\count($arr);\n        } elseif (\\is_string($size)) {\n            // We need to avoid mbstring.func_overload\n            if (\\is_callable('\\\\mb_str_split')) {\n                $tmp = \\mb_str_split($size, 1, '8bit');\n            } else {\n                $tmp = \\str_split($size, 1);\n            }\n            // Let's convert each character to an 8-bit integer and store in $arr\n            $arr = [];\n            if (!empty($tmp)) {\n                foreach ($tmp as $t) {\n                    if (strlen($t) < 1) {\n                        continue;\n                    }\n                    $arr []= \\unpack('C', $t)[1] & 0xff;\n                }\n            }\n            $size = \\count($arr);\n        } elseif ($size instanceof ByteArray) {\n            $arr = $size->toArray();\n            $size = $size->count();\n        } elseif (!\\is_int($size)) {\n            throw new \\InvalidArgumentException(\n                'Argument must be an integer, string, or array of integers.'\n            );\n        }\n\n        parent::__construct($size);\n\n        if (!empty($arr)) {\n            // Populate this object with values from constructor argument\n            foreach ($arr as $i => $v) {\n                $this->offsetSet($i, $v);\n            }\n        } else {\n            // Initialize to zero.\n            for ($i = 0; $i < $size; ++$i) {\n                $this->offsetSet($i, 0);\n            }\n        }\n    }\n\n    /**\n     * Encode an integer into a byte array. 32-bit (unsigned), big endian byte order.\n     *\n     * @param int $num\n     * @return self\n     */\n    public static function enc32be($num)\n    {\n        return new ByteArray(\\pack('N', $num));\n    }\n\n    /**\n     * @param ByteArray $other\n     * @return bool\n     */\n    public function equals(ByteArray $other)\n    {\n        if ($this->count() !== $other->count()) {\n            return false;\n        }\n        $d = 0;\n        for ($i = $this->count() - 1; $i >= 0; --$i) {\n            $d |= $this[$i] ^ $other[$i];\n        }\n        return $d === 0;\n    }\n\n    /**\n     * @param ByteArray $array\n     * @return ByteArray\n     */\n    public function exclusiveOr(ByteArray $array)\n    {\n        self::needs(\n            $this->count() === $array->count(),\n            'Both ByteArrays must be equal size for exclusiveOr()'\n        );\n        $out = clone $this;\n        for ($i = 0; $i < $this->count(); ++$i) {\n            $out[$i] = $array[$i] ^ $out[$i];\n        }\n        return $out;\n    }\n\n    /**\n     * Returns a new ByteArray incremented by 1 (big endian byte order).\n     *\n     * @param int $increase\n     * @return self\n     */\n    public function getIncremented($increase = 1)\n    {\n        $clone = clone $this;\n        $index = $clone->count();\n        while ($index > 0) {\n            --$index;\n            $tmp = ($clone[$index] + $increase) & PHP_INT_MAX;\n            $clone[$index] = $tmp & 0xff;\n            $increase = $tmp >> 8;\n        }\n        return $clone;\n    }\n\n    /**\n     * Sets a value. See SplFixedArray for more.\n     *\n     * @param int $index\n     * @param int $newval\n     * @return void\n     */\n    public function offsetSet($index, $newval)\n    {\n        parent::offsetSet($index, $newval & 0xff);\n    }\n\n    /**\n     * Return a copy of this ByteArray, bitshifted to the right by 1.\n     * Used in Gmac.\n     *\n     * @return self\n     */\n    public function rshift()\n    {\n        $out = clone $this;\n        for ($j = $this->count() - 1; $j > 0; --$j) {\n            $out[$j] = (($out[$j - 1] & 1) << 7) | ($out[$j] >> 1);\n        }\n        $out[0] >>= 1;\n        return $out;\n    }\n\n    /**\n     * Constant-time conditional select. This is meant to read like a ternary operator.\n     *\n     * $z = ByteArray::select(1, $x, $y); // $z is equal to $x\n     * $z = ByteArray::select(0, $x, $y); // $z is equal to $y\n     *\n     * @param int $select\n     * @param ByteArray $left\n     * @param ByteArray $right\n     * @return ByteArray\n     */\n    public static function select($select, ByteArray $left, ByteArray $right)\n    {\n        self::needs(\n            $left->count() === $right->count(),\n            'Both ByteArrays must be equal size for select()'\n        );\n        $rightLength = $right->count();\n        $out = clone $right;\n        $mask = (-($select & 1)) & 0xff;\n        for ($i = 0; $i < $rightLength;  $i++) {\n            $out[$i] = $out[$i] ^ (($left[$i] ^ $right[$i]) & $mask);\n        }\n        return $out;\n    }\n\n    /**\n     * Overwrite values of this ByteArray based on a separate ByteArray, with\n     * a given starting offset and length.\n     *\n     * See JavaScript's Uint8Array.set() for more information.\n     *\n     * @param ByteArray $input\n     * @param int $offset\n     * @param int|null $length\n     * @return self\n     */\n    public function set(ByteArray $input, $offset = 0, $length = null)\n    {\n        self::needs(\n            is_int($offset) && $offset >= 0,\n            'Offset must be a positive integer or zero'\n        );\n        if (is_null($length)) {\n            $length = $input->count();\n        }\n\n        $i = 0; $j = $offset;\n        while ($i < $length && $j < $this->count()) {\n            $this[$j] = $input[$i];\n            ++$i;\n            ++$j;\n        }\n        return $this;\n    }\n\n    /**\n     * Returns a slice of this ByteArray.\n     *\n     * @param int $start\n     * @param null $length\n     * @return self\n     */\n    public function slice($start = 0, $length = null)\n    {\n        return new ByteArray(\\array_slice($this->toArray(), $start, $length));\n    }\n\n    /**\n     * Mutates the current state and sets all values to zero.\n     *\n     * @return void\n     */\n    public function zeroize()\n    {\n        for ($i = $this->count() - 1; $i >= 0; --$i) {\n            $this->offsetSet($i, 0);\n        }\n    }\n\n    /**\n     * Converts the ByteArray to a raw binary string.\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        $count = $this->count();\n        if ($count === 0) {\n            return '';\n        }\n        $args = $this->toArray();\n        \\array_unshift($args, \\str_repeat('C', $count));\n        // constant-time, PHP <5.6 equivalent to pack('C*', ...$args);\n        return \\call_user_func_array('\\\\pack', $args);\n    }\n}\n", "num_lines": 259}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto\\Polyfill;\n\n/**\n * Class Gmac\n *\n * @package Aws\\Crypto\\Polyfill\n */\nclass Gmac\n{\n    use NeedsTrait;\n\n    const BLOCK_SIZE = 16;\n\n    /** @var ByteArray $buf */\n    protected $buf;\n\n    /** @var int $bufLength */\n    protected $bufLength = 0;\n\n    /** @var ByteArray $h */\n    protected $h;\n\n    /** @var ByteArray $hf */\n    protected $hf;\n\n    /** @var Key $key */\n    protected $key;\n\n    /** @var ByteArray $x */\n    protected $x;\n\n    /**\n     * Gmac constructor.\n     *\n     * @param Key $aesKey\n     * @param string $nonce\n     * @param int $keySize\n     */\n    public function __construct(Key $aesKey, $nonce, $keySize = 256)\n    {\n        $this->buf = new ByteArray(16);\n        $this->h = new ByteArray(\n            \\openssl_encrypt(\n                \\str_repeat(\"\\0\", 16),\n                \"aes-{$keySize}-ecb\",\n                $aesKey->get(),\n                OPENSSL_RAW_DATA | OPENSSL_NO_PADDING\n            )\n        );\n        $this->key = $aesKey;\n        $this->x = new ByteArray(16);\n        $this->hf = new ByteArray(\n            \\openssl_encrypt(\n                $nonce,\n                \"aes-{$keySize}-ecb\",\n                $aesKey->get(),\n                OPENSSL_RAW_DATA | OPENSSL_NO_PADDING\n            )\n        );\n    }\n\n    /**\n     * Update the object with some data.\n     *\n     * This method mutates this Gmac object.\n     *\n     * @param ByteArray $blocks\n     * @return self\n     */\n    public function update(ByteArray $blocks)\n    {\n        if (($blocks->count() + $this->bufLength) < self::BLOCK_SIZE) {\n            // Write to internal buffer until we reach enough to write.\n            $this->buf->set($blocks, $this->bufLength);\n            $this->bufLength += $blocks->count();\n            return $this;\n        }\n\n        // Process internal buffer first.\n        if ($this->bufLength > 0) {\n            // 0 <= state.buf_len < BLOCK_SIZE is an invariant\n            $tmp = new ByteArray(self::BLOCK_SIZE);\n            $tmp->set($this->buf->slice(0, $this->bufLength));\n            $remainingBlockLength = self::BLOCK_SIZE - $this->bufLength;\n            $tmp->set($blocks->slice(0, $remainingBlockLength), $this->bufLength);\n            $blocks = $blocks->slice($remainingBlockLength);\n            $this->bufLength = 0;\n            $this->x = $this->blockMultiply($this->x->exclusiveOr($tmp), $this->h);\n        }\n\n        // Process full blocks.\n        $numBlocks = $blocks->count() >> 4;\n        for ($i = 0; $i < $numBlocks; ++$i) {\n            $tmp = $blocks->slice($i << 4, self::BLOCK_SIZE);\n            $this->x = $this->blockMultiply($this->x->exclusiveOr($tmp), $this->h);\n        }\n        $last = $numBlocks << 4;\n\n        // Zero-fill buffer\n        for ($i = 0; $i < 16; ++$i) {\n            $this->buf[$i] = 0;\n        }\n        // Feed leftover into buffer.\n        if ($last < $blocks->count()) {\n            $tmp = $blocks->slice($last);\n            $this->buf->set($tmp);\n            $this->bufLength += ($blocks->count() - $last);\n        }\n        return $this;\n    }\n\n    /**\n     * Finish processing the authentication tag.\n     *\n     * This method mutates this Gmac object (effectively resetting it).\n     *\n     * @param int $aadLength\n     * @param int $ciphertextLength\n     * @return ByteArray\n     */\n    public function finish($aadLength, $ciphertextLength)\n    {\n        $lengthBlock = new ByteArray(16);\n        $state = $this->flush();\n\n        // AES-GCM expects bit lengths, not byte lengths.\n        $lengthBlock->set(ByteArray::enc32be($aadLength >> 29), 0);\n        $lengthBlock->set(ByteArray::enc32be($aadLength << 3), 4);\n        $lengthBlock->set(ByteArray::enc32be($ciphertextLength >> 29), 8);\n        $lengthBlock->set(ByteArray::enc32be($ciphertextLength << 3), 12);\n\n        $state->update($lengthBlock);\n        $output = $state->x->exclusiveOr($state->hf);\n\n        // Zeroize the internal values as a best-effort.\n        $state->buf->zeroize();\n        $state->x->zeroize();\n        $state->h->zeroize();\n        $state->hf->zeroize();\n        return $output;\n    }\n\n    /**\n     * Get a specific bit from the provided array, at the given index.\n     *\n     * [01234567], 8+[01234567], 16+[01234567], ...\n     *\n     * @param ByteArray $x\n     * @param int $i\n     * @return int\n     */\n    protected function bit(ByteArray $x, $i)\n    {\n        $byte = $i >> 3;\n        return ($x[$byte] >> ((7 - $i) & 7)) & 1;\n    }\n\n    /**\n     * Galois Field Multiplication\n     *\n     * This function is the critical path that must be constant-time in order to\n     * avoid timing side-channels against AES-GCM.\n     *\n     * The contents of each are always calculated, regardless of the branching\n     * condition, to prevent another kind of timing leak.\n     *\n     * @param ByteArray $x\n     * @param ByteArray $y\n     * @return ByteArray\n     */\n    protected function blockMultiply(ByteArray $x, ByteArray $y)\n    {\n        static $fieldPolynomial = null;\n        if (!$fieldPolynomial) {\n            $fieldPolynomial = new ByteArray([\n                0xe1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n            ]);\n        }\n        self::needs($x->count() === 16, 'Argument 1 must be a ByteArray of exactly 16 bytes');\n        self::needs($y->count() === 16, 'Argument 2 must be a ByteArray of exactly 16 bytes');\n\n        $v = clone $y;\n        $z = new ByteArray(16);\n\n        for ($i = 0; $i < 128; ++$i) {\n            // if ($b) $z = $z->exclusiveOr($v);\n            $b = $this->bit($x, $i);\n            $z = ByteArray::select(\n                $b,\n                $z->exclusiveOr($v),\n                $z\n            );\n\n            // if ($b) $v = $v->exclusiveOr($fieldPolynomial);\n            $b = $v[15] & 1;\n            $v = $v->rshift();\n            $v = ByteArray::select(\n                $b,\n                $v->exclusiveOr($fieldPolynomial),\n                $v\n            );\n        }\n        return $z;\n    }\n\n    /**\n     * Finish processing any leftover bytes in the internal buffer.\n     *\n     * @return self\n     */\n    public function flush()\n    {\n        if ($this->bufLength !== 0) {\n            $this->x = $this->blockMultiply(\n                $this->x->exclusiveOr($this->buf),\n                $this->h\n            );\n            $this->bufLength = 0;\n        }\n        return $this;\n    }\n}\n", "num_lines": 224}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto\\Polyfill;\n\n/**\n * Class Key\n *\n * Wraps a string to keep it hidden from stack traces.\n *\n * @package Aws\\Crypto\\Polyfill\n */\nclass Key\n{\n    /**\n     * @var string $internalString\n     */\n    private $internalString;\n\n    /**\n     * Hide contents of \n     *\n     * @return array\n     */\n    public function __debugInfo()\n    {\n        return [];\n    }\n\n    /**\n     * Key constructor.\n     * @param string $str\n     */\n    public function __construct($str)\n    {\n        $this->internalString = $str;\n    }\n\n    /**\n     * Defense in depth:\n     *\n     * PHP 7.2 includes the Sodium cryptography library, which (among other things)\n     * exposes a function called sodium_memzero() that we can use to zero-fill strings\n     * to minimize the risk of sensitive cryptographic materials persisting in memory.\n     *\n     * If this function is not available, we XOR the string in-place with itself as a\n     * best-effort attempt.\n     */\n    public function __destruct()\n    {\n        if (extension_loaded('sodium') && function_exists('sodium_memzero')) {\n            try {\n                \\sodium_memzero($this->internalString);\n            } catch (\\SodiumException $ex) {\n                // This is a best effort, but does not provide the same guarantees as sodium_memzero():\n                $this->internalString ^= $this->internalString;\n            }\n        }\n    }\n\n    /**\n     * @return string\n     */\n    public function get()\n    {\n        return $this->internalString;\n    }\n\n    /**\n     * @return int\n     */\n    public function length()\n    {\n        if (\\is_callable('\\\\mb_strlen')) {\n            return (int) \\mb_strlen($this->internalString, '8bit');\n        }\n        return (int) \\strlen($this->internalString);\n    }\n}\n", "num_lines": 78}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Crypto\\Polyfill;\n\nuse Aws\\Exception\\CryptoPolyfillException;\n\n/**\n * Trait NeedsTrait\n * @package Aws\\Crypto\\Polyfill\n */\ntrait NeedsTrait\n{\n    /**\n     * Preconditions, postconditions, and loop invariants are very\n     * useful for safe programing.  They also document the specifications.\n     * This function is to help simplify the semantic burden of parsing\n     * these constructions.\n     *\n     * Instead of constructions like\n     *     if (!(GOOD CONDITION)) {\n     *         throw new \\Exception('condition not true');\n     *     }\n     *\n     * you can write:\n     *     needs(GOOD CONDITION, 'condition not true');\n     * @param $condition\n     * @param $errorMessage\n     * @param null $exceptionClass\n     */\n    public static function needs($condition, $errorMessage, $exceptionClass = null)\n    {\n        if (!$condition) {\n            if (!$exceptionClass) {\n                $exceptionClass = CryptoPolyfillException::class;\n            }\n            throw new $exceptionClass($errorMessage);\n        }\n    }\n}\n", "num_lines": 39}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CustomerProfiles;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Connect Customer Profiles** service.\n * @method \\Aws\\Result addProfileKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addProfileKeyAsync(array $args = [])\n * @method \\Aws\\Result createCalculatedAttributeDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCalculatedAttributeDefinitionAsync(array $args = [])\n * @method \\Aws\\Result createDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDomainAsync(array $args = [])\n * @method \\Aws\\Result createEventStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEventStreamAsync(array $args = [])\n * @method \\Aws\\Result createIntegrationWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIntegrationWorkflowAsync(array $args = [])\n * @method \\Aws\\Result createProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteCalculatedAttributeDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCalculatedAttributeDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainAsync(array $args = [])\n * @method \\Aws\\Result deleteEventStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventStreamAsync(array $args = [])\n * @method \\Aws\\Result deleteIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIntegrationAsync(array $args = [])\n * @method \\Aws\\Result deleteProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteProfileKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProfileKeyAsync(array $args = [])\n * @method \\Aws\\Result deleteProfileObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProfileObjectAsync(array $args = [])\n * @method \\Aws\\Result deleteProfileObjectType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProfileObjectTypeAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkflowAsync(array $args = [])\n * @method \\Aws\\Result getAutoMergingPreview(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAutoMergingPreviewAsync(array $args = [])\n * @method \\Aws\\Result getCalculatedAttributeDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCalculatedAttributeDefinitionAsync(array $args = [])\n * @method \\Aws\\Result getCalculatedAttributeForProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCalculatedAttributeForProfileAsync(array $args = [])\n * @method \\Aws\\Result getDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainAsync(array $args = [])\n * @method \\Aws\\Result getEventStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEventStreamAsync(array $args = [])\n * @method \\Aws\\Result getIdentityResolutionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIdentityResolutionJobAsync(array $args = [])\n * @method \\Aws\\Result getIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIntegrationAsync(array $args = [])\n * @method \\Aws\\Result getMatches(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMatchesAsync(array $args = [])\n * @method \\Aws\\Result getProfileObjectType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProfileObjectTypeAsync(array $args = [])\n * @method \\Aws\\Result getProfileObjectTypeTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProfileObjectTypeTemplateAsync(array $args = [])\n * @method \\Aws\\Result getWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkflowAsync(array $args = [])\n * @method \\Aws\\Result getWorkflowSteps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkflowStepsAsync(array $args = [])\n * @method \\Aws\\Result listAccountIntegrations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccountIntegrationsAsync(array $args = [])\n * @method \\Aws\\Result listCalculatedAttributeDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCalculatedAttributeDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listCalculatedAttributesForProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCalculatedAttributesForProfileAsync(array $args = [])\n * @method \\Aws\\Result listDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainsAsync(array $args = [])\n * @method \\Aws\\Result listEventStreams(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventStreamsAsync(array $args = [])\n * @method \\Aws\\Result listIdentityResolutionJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIdentityResolutionJobsAsync(array $args = [])\n * @method \\Aws\\Result listIntegrations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIntegrationsAsync(array $args = [])\n * @method \\Aws\\Result listProfileObjectTypeTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProfileObjectTypeTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listProfileObjectTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProfileObjectTypesAsync(array $args = [])\n * @method \\Aws\\Result listProfileObjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProfileObjectsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWorkflows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkflowsAsync(array $args = [])\n * @method \\Aws\\Result mergeProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise mergeProfilesAsync(array $args = [])\n * @method \\Aws\\Result putIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putIntegrationAsync(array $args = [])\n * @method \\Aws\\Result putProfileObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putProfileObjectAsync(array $args = [])\n * @method \\Aws\\Result putProfileObjectType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putProfileObjectTypeAsync(array $args = [])\n * @method \\Aws\\Result searchProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchProfilesAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateCalculatedAttributeDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCalculatedAttributeDefinitionAsync(array $args = [])\n * @method \\Aws\\Result updateDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDomainAsync(array $args = [])\n * @method \\Aws\\Result updateProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProfileAsync(array $args = [])\n */\nclass CustomerProfilesClient extends AwsClient {}\n", "num_lines": 108}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\CustomerProfiles\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Connect Customer Profiles** service.\n */\nclass CustomerProfilesException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/aliases.json\nreturn [ 'operations' => [ 'ApiGatewayV2' => [ '2018-11-29' => [ 'GetApi' => 'GetApiResource', ], ], 'CloudHSM' => [ '2014-05-30' => [ 'GetConfig' => 'GetConfigFiles', ], ], 'GroundStation' => [ '2019-05-23' => [ 'GetConfig' => 'GetMissionProfileConfig', ], ], 'Pinpoint' => [ '2016-12-01' => [ 'GetEndpoint' => 'GetUserEndpoint', 'UpdateEndpoint' => 'UpdateUserEndpoint', 'UpdateEndpointsBatch' => 'UpdateUserEndpointsBatch', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/accessanalyzer/2019-11-01/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2019-11-01', 'endpointPrefix' => 'access-analyzer', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'Access Analyzer', 'serviceId' => 'AccessAnalyzer', 'signatureVersion' => 'v4', 'signingName' => 'access-analyzer', 'uid' => 'accessanalyzer-2019-11-01', ], 'operations' => [ 'ApplyArchiveRule' => [ 'name' => 'ApplyArchiveRule', 'http' => [ 'method' => 'PUT', 'requestUri' => '/archive-rule', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ApplyArchiveRuleRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'CancelPolicyGeneration' => [ 'name' => 'CancelPolicyGeneration', 'http' => [ 'method' => 'PUT', 'requestUri' => '/policy/generation/{jobId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CancelPolicyGenerationRequest', ], 'output' => [ 'shape' => 'CancelPolicyGenerationResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'CreateAccessPreview' => [ 'name' => 'CreateAccessPreview', 'http' => [ 'method' => 'PUT', 'requestUri' => '/access-preview', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateAccessPreviewRequest', ], 'output' => [ 'shape' => 'CreateAccessPreviewResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'CreateAnalyzer' => [ 'name' => 'CreateAnalyzer', 'http' => [ 'method' => 'PUT', 'requestUri' => '/analyzer', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateAnalyzerRequest', ], 'output' => [ 'shape' => 'CreateAnalyzerResponse', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'CreateArchiveRule' => [ 'name' => 'CreateArchiveRule', 'http' => [ 'method' => 'PUT', 'requestUri' => '/analyzer/{analyzerName}/archive-rule', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateArchiveRuleRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'DeleteAnalyzer' => [ 'name' => 'DeleteAnalyzer', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/analyzer/{analyzerName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteAnalyzerRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'DeleteArchiveRule' => [ 'name' => 'DeleteArchiveRule', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/analyzer/{analyzerName}/archive-rule/{ruleName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteArchiveRuleRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'GetAccessPreview' => [ 'name' => 'GetAccessPreview', 'http' => [ 'method' => 'GET', 'requestUri' => '/access-preview/{accessPreviewId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetAccessPreviewRequest', ], 'output' => [ 'shape' => 'GetAccessPreviewResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetAnalyzedResource' => [ 'name' => 'GetAnalyzedResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/analyzed-resource', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetAnalyzedResourceRequest', ], 'output' => [ 'shape' => 'GetAnalyzedResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetAnalyzer' => [ 'name' => 'GetAnalyzer', 'http' => [ 'method' => 'GET', 'requestUri' => '/analyzer/{analyzerName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetAnalyzerRequest', ], 'output' => [ 'shape' => 'GetAnalyzerResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetArchiveRule' => [ 'name' => 'GetArchiveRule', 'http' => [ 'method' => 'GET', 'requestUri' => '/analyzer/{analyzerName}/archive-rule/{ruleName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetArchiveRuleRequest', ], 'output' => [ 'shape' => 'GetArchiveRuleResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetFinding' => [ 'name' => 'GetFinding', 'http' => [ 'method' => 'GET', 'requestUri' => '/finding/{id}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetFindingRequest', ], 'output' => [ 'shape' => 'GetFindingResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetGeneratedPolicy' => [ 'name' => 'GetGeneratedPolicy', 'http' => [ 'method' => 'GET', 'requestUri' => '/policy/generation/{jobId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetGeneratedPolicyRequest', ], 'output' => [ 'shape' => 'GetGeneratedPolicyResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListAccessPreviewFindings' => [ 'name' => 'ListAccessPreviewFindings', 'http' => [ 'method' => 'POST', 'requestUri' => '/access-preview/{accessPreviewId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAccessPreviewFindingsRequest', ], 'output' => [ 'shape' => 'ListAccessPreviewFindingsResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListAccessPreviews' => [ 'name' => 'ListAccessPreviews', 'http' => [ 'method' => 'GET', 'requestUri' => '/access-preview', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAccessPreviewsRequest', ], 'output' => [ 'shape' => 'ListAccessPreviewsResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListAnalyzedResources' => [ 'name' => 'ListAnalyzedResources', 'http' => [ 'method' => 'POST', 'requestUri' => '/analyzed-resource', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAnalyzedResourcesRequest', ], 'output' => [ 'shape' => 'ListAnalyzedResourcesResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListAnalyzers' => [ 'name' => 'ListAnalyzers', 'http' => [ 'method' => 'GET', 'requestUri' => '/analyzer', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAnalyzersRequest', ], 'output' => [ 'shape' => 'ListAnalyzersResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListArchiveRules' => [ 'name' => 'ListArchiveRules', 'http' => [ 'method' => 'GET', 'requestUri' => '/analyzer/{analyzerName}/archive-rule', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListArchiveRulesRequest', ], 'output' => [ 'shape' => 'ListArchiveRulesResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListFindings' => [ 'name' => 'ListFindings', 'http' => [ 'method' => 'POST', 'requestUri' => '/finding', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListFindingsRequest', ], 'output' => [ 'shape' => 'ListFindingsResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListPolicyGenerations' => [ 'name' => 'ListPolicyGenerations', 'http' => [ 'method' => 'GET', 'requestUri' => '/policy/generation', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListPolicyGenerationsRequest', ], 'output' => [ 'shape' => 'ListPolicyGenerationsResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags/{resourceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'StartPolicyGeneration' => [ 'name' => 'StartPolicyGeneration', 'http' => [ 'method' => 'PUT', 'requestUri' => '/policy/generation', 'responseCode' => 200, ], 'input' => [ 'shape' => 'StartPolicyGenerationRequest', ], 'output' => [ 'shape' => 'StartPolicyGenerationResponse', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'StartResourceScan' => [ 'name' => 'StartResourceScan', 'http' => [ 'method' => 'POST', 'requestUri' => '/resource/scan', 'responseCode' => 200, ], 'input' => [ 'shape' => 'StartResourceScanRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags/{resourceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/tags/{resourceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'UpdateArchiveRule' => [ 'name' => 'UpdateArchiveRule', 'http' => [ 'method' => 'PUT', 'requestUri' => '/analyzer/{analyzerName}/archive-rule/{ruleName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateArchiveRuleRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'UpdateFindings' => [ 'name' => 'UpdateFindings', 'http' => [ 'method' => 'PUT', 'requestUri' => '/finding', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateFindingsRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'ValidatePolicy' => [ 'name' => 'ValidatePolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/policy/validation', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ValidatePolicyRequest', ], 'output' => [ 'shape' => 'ValidatePolicyResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 403, 'senderFault' => true, ], 'exception' => true, ], 'AccessPointArn' => [ 'type' => 'string', 'pattern' => 'arn:[^:]*:s3:[^:]*:[^:]*:accesspoint/.*', ], 'AccessPointPolicy' => [ 'type' => 'string', ], 'AccessPreview' => [ 'type' => 'structure', 'required' => [ 'id', 'analyzerArn', 'configurations', 'createdAt', 'status', ], 'members' => [ 'id' => [ 'shape' => 'AccessPreviewId', ], 'analyzerArn' => [ 'shape' => 'AnalyzerArn', ], 'configurations' => [ 'shape' => 'ConfigurationsMap', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'status' => [ 'shape' => 'AccessPreviewStatus', ], 'statusReason' => [ 'shape' => 'AccessPreviewStatusReason', ], ], ], 'AccessPreviewFinding' => [ 'type' => 'structure', 'required' => [ 'id', 'resourceType', 'createdAt', 'changeType', 'status', 'resourceOwnerAccount', ], 'members' => [ 'id' => [ 'shape' => 'AccessPreviewFindingId', ], 'existingFindingId' => [ 'shape' => 'FindingId', ], 'existingFindingStatus' => [ 'shape' => 'FindingStatus', ], 'principal' => [ 'shape' => 'PrincipalMap', ], 'action' => [ 'shape' => 'ActionList', ], 'condition' => [ 'shape' => 'ConditionKeyMap', ], 'resource' => [ 'shape' => 'String', ], 'isPublic' => [ 'shape' => 'Boolean', ], 'resourceType' => [ 'shape' => 'ResourceType', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'changeType' => [ 'shape' => 'FindingChangeType', ], 'status' => [ 'shape' => 'FindingStatus', ], 'resourceOwnerAccount' => [ 'shape' => 'String', ], 'error' => [ 'shape' => 'String', ], 'sources' => [ 'shape' => 'FindingSourceList', ], ], ], 'AccessPreviewFindingId' => [ 'type' => 'string', ], 'AccessPreviewFindingsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AccessPreviewFinding', ], ], 'AccessPreviewId' => [ 'type' => 'string', 'pattern' => '[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}', ], 'AccessPreviewStatus' => [ 'type' => 'string', 'enum' => [ 'COMPLETED', 'CREATING', 'FAILED', ], ], 'AccessPreviewStatusReason' => [ 'type' => 'structure', 'required' => [ 'code', ], 'members' => [ 'code' => [ 'shape' => 'AccessPreviewStatusReasonCode', ], ], ], 'AccessPreviewStatusReasonCode' => [ 'type' => 'string', 'enum' => [ 'INTERNAL_ERROR', 'INVALID_CONFIGURATION', ], ], 'AccessPreviewSummary' => [ 'type' => 'structure', 'required' => [ 'id', 'analyzerArn', 'createdAt', 'status', ], 'members' => [ 'id' => [ 'shape' => 'AccessPreviewId', ], 'analyzerArn' => [ 'shape' => 'AnalyzerArn', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'status' => [ 'shape' => 'AccessPreviewStatus', ], 'statusReason' => [ 'shape' => 'AccessPreviewStatusReason', ], ], ], 'AccessPreviewsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AccessPreviewSummary', ], ], 'AclCanonicalId' => [ 'type' => 'string', ], 'AclGrantee' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'AclCanonicalId', ], 'uri' => [ 'shape' => 'AclUri', ], ], 'union' => true, ], 'AclPermission' => [ 'type' => 'string', 'enum' => [ 'READ', 'WRITE', 'READ_ACP', 'WRITE_ACP', 'FULL_CONTROL', ], ], 'AclUri' => [ 'type' => 'string', ], 'ActionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'AnalyzedResource' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'resourceType', 'createdAt', 'analyzedAt', 'updatedAt', 'isPublic', 'resourceOwnerAccount', ], 'members' => [ 'resourceArn' => [ 'shape' => 'ResourceArn', ], 'resourceType' => [ 'shape' => 'ResourceType', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'analyzedAt' => [ 'shape' => 'Timestamp', ], 'updatedAt' => [ 'shape' => 'Timestamp', ], 'isPublic' => [ 'shape' => 'Boolean', ], 'actions' => [ 'shape' => 'ActionList', ], 'sharedVia' => [ 'shape' => 'SharedViaList', ], 'status' => [ 'shape' => 'FindingStatus', ], 'resourceOwnerAccount' => [ 'shape' => 'String', ], 'error' => [ 'shape' => 'String', ], ], ], 'AnalyzedResourceSummary' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'resourceOwnerAccount', 'resourceType', ], 'members' => [ 'resourceArn' => [ 'shape' => 'ResourceArn', ], 'resourceOwnerAccount' => [ 'shape' => 'String', ], 'resourceType' => [ 'shape' => 'ResourceType', ], ], ], 'AnalyzedResourcesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AnalyzedResourceSummary', ], ], 'AnalyzerArn' => [ 'type' => 'string', 'pattern' => '[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:analyzer/.{1,255}', ], 'AnalyzerStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'CREATING', 'DISABLED', 'FAILED', ], ], 'AnalyzerSummary' => [ 'type' => 'structure', 'required' => [ 'arn', 'name', 'type', 'createdAt', 'status', ], 'members' => [ 'arn' => [ 'shape' => 'AnalyzerArn', ], 'name' => [ 'shape' => 'Name', ], 'type' => [ 'shape' => 'Type', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'lastResourceAnalyzed' => [ 'shape' => 'String', ], 'lastResourceAnalyzedAt' => [ 'shape' => 'Timestamp', ], 'tags' => [ 'shape' => 'TagsMap', ], 'status' => [ 'shape' => 'AnalyzerStatus', ], 'statusReason' => [ 'shape' => 'StatusReason', ], ], ], 'AnalyzersList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AnalyzerSummary', ], ], 'ApplyArchiveRuleRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerArn', 'ruleName', ], 'members' => [ 'analyzerArn' => [ 'shape' => 'AnalyzerArn', ], 'ruleName' => [ 'shape' => 'Name', ], 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], ], ], 'ArchiveRuleSummary' => [ 'type' => 'structure', 'required' => [ 'ruleName', 'filter', 'createdAt', 'updatedAt', ], 'members' => [ 'ruleName' => [ 'shape' => 'Name', ], 'filter' => [ 'shape' => 'FilterCriteriaMap', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'updatedAt' => [ 'shape' => 'Timestamp', ], ], ], 'ArchiveRulesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ArchiveRuleSummary', ], ], 'Boolean' => [ 'type' => 'boolean', 'box' => true, ], 'CancelPolicyGenerationRequest' => [ 'type' => 'structure', 'required' => [ 'jobId', ], 'members' => [ 'jobId' => [ 'shape' => 'JobId', 'location' => 'uri', 'locationName' => 'jobId', ], ], ], 'CancelPolicyGenerationResponse' => [ 'type' => 'structure', 'members' => [], ], 'CloudTrailArn' => [ 'type' => 'string', 'pattern' => 'arn:[^:]*:cloudtrail:[^:]*:[^:]*:trail/.{1,576}', ], 'CloudTrailDetails' => [ 'type' => 'structure', 'required' => [ 'trails', 'accessRole', 'startTime', ], 'members' => [ 'trails' => [ 'shape' => 'TrailList', ], 'accessRole' => [ 'shape' => 'RoleArn', ], 'startTime' => [ 'shape' => 'Timestamp', ], 'endTime' => [ 'shape' => 'Timestamp', ], ], ], 'CloudTrailProperties' => [ 'type' => 'structure', 'required' => [ 'trailProperties', 'startTime', 'endTime', ], 'members' => [ 'trailProperties' => [ 'shape' => 'TrailPropertiesList', ], 'startTime' => [ 'shape' => 'Timestamp', ], 'endTime' => [ 'shape' => 'Timestamp', ], ], ], 'ConditionKeyMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], 'Configuration' => [ 'type' => 'structure', 'members' => [ 'ebsSnapshot' => [ 'shape' => 'EbsSnapshotConfiguration', ], 'ecrRepository' => [ 'shape' => 'EcrRepositoryConfiguration', ], 'iamRole' => [ 'shape' => 'IamRoleConfiguration', ], 'efsFileSystem' => [ 'shape' => 'EfsFileSystemConfiguration', ], 'kmsKey' => [ 'shape' => 'KmsKeyConfiguration', ], 'rdsDbClusterSnapshot' => [ 'shape' => 'RdsDbClusterSnapshotConfiguration', ], 'rdsDbSnapshot' => [ 'shape' => 'RdsDbSnapshotConfiguration', ], 'secretsManagerSecret' => [ 'shape' => 'SecretsManagerSecretConfiguration', ], 's3Bucket' => [ 'shape' => 'S3BucketConfiguration', ], 'snsTopic' => [ 'shape' => 'SnsTopicConfiguration', ], 'sqsQueue' => [ 'shape' => 'SqsQueueConfiguration', ], ], 'union' => true, ], 'ConfigurationsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'ConfigurationsMapKey', ], 'value' => [ 'shape' => 'Configuration', ], ], 'ConfigurationsMapKey' => [ 'type' => 'string', ], 'ConflictException' => [ 'type' => 'structure', 'required' => [ 'message', 'resourceId', 'resourceType', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'resourceId' => [ 'shape' => 'String', ], 'resourceType' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'CreateAccessPreviewRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerArn', 'configurations', ], 'members' => [ 'analyzerArn' => [ 'shape' => 'AnalyzerArn', ], 'configurations' => [ 'shape' => 'ConfigurationsMap', ], 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], ], ], 'CreateAccessPreviewResponse' => [ 'type' => 'structure', 'required' => [ 'id', ], 'members' => [ 'id' => [ 'shape' => 'AccessPreviewId', ], ], ], 'CreateAnalyzerRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerName', 'type', ], 'members' => [ 'analyzerName' => [ 'shape' => 'Name', ], 'type' => [ 'shape' => 'Type', ], 'archiveRules' => [ 'shape' => 'InlineArchiveRulesList', ], 'tags' => [ 'shape' => 'TagsMap', ], 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], ], ], 'CreateAnalyzerResponse' => [ 'type' => 'structure', 'members' => [ 'arn' => [ 'shape' => 'AnalyzerArn', ], ], ], 'CreateArchiveRuleRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerName', 'ruleName', 'filter', ], 'members' => [ 'analyzerName' => [ 'shape' => 'Name', 'location' => 'uri', 'locationName' => 'analyzerName', ], 'ruleName' => [ 'shape' => 'Name', ], 'filter' => [ 'shape' => 'FilterCriteriaMap', ], 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], ], ], 'Criterion' => [ 'type' => 'structure', 'members' => [ 'eq' => [ 'shape' => 'ValueList', ], 'neq' => [ 'shape' => 'ValueList', ], 'contains' => [ 'shape' => 'ValueList', ], 'exists' => [ 'shape' => 'Boolean', ], ], ], 'DeleteAnalyzerRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerName', ], 'members' => [ 'analyzerName' => [ 'shape' => 'Name', 'location' => 'uri', 'locationName' => 'analyzerName', ], 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, 'location' => 'querystring', 'locationName' => 'clientToken', ], ], ], 'DeleteArchiveRuleRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerName', 'ruleName', ], 'members' => [ 'analyzerName' => [ 'shape' => 'Name', 'location' => 'uri', 'locationName' => 'analyzerName', ], 'ruleName' => [ 'shape' => 'Name', 'location' => 'uri', 'locationName' => 'ruleName', ], 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, 'location' => 'querystring', 'locationName' => 'clientToken', ], ], ], 'EbsGroup' => [ 'type' => 'string', ], 'EbsGroupList' => [ 'type' => 'list', 'member' => [ 'shape' => 'EbsGroup', ], ], 'EbsSnapshotConfiguration' => [ 'type' => 'structure', 'members' => [ 'userIds' => [ 'shape' => 'EbsUserIdList', ], 'groups' => [ 'shape' => 'EbsGroupList', ], 'kmsKeyId' => [ 'shape' => 'EbsSnapshotDataEncryptionKeyId', ], ], ], 'EbsSnapshotDataEncryptionKeyId' => [ 'type' => 'string', ], 'EbsUserId' => [ 'type' => 'string', ], 'EbsUserIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'EbsUserId', ], ], 'EcrRepositoryConfiguration' => [ 'type' => 'structure', 'members' => [ 'repositoryPolicy' => [ 'shape' => 'EcrRepositoryPolicy', ], ], ], 'EcrRepositoryPolicy' => [ 'type' => 'string', ], 'EfsFileSystemConfiguration' => [ 'type' => 'structure', 'members' => [ 'fileSystemPolicy' => [ 'shape' => 'EfsFileSystemPolicy', ], ], ], 'EfsFileSystemPolicy' => [ 'type' => 'string', ], 'FilterCriteriaMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'Criterion', ], ], 'Finding' => [ 'type' => 'structure', 'required' => [ 'id', 'resourceType', 'condition', 'createdAt', 'analyzedAt', 'updatedAt', 'status', 'resourceOwnerAccount', ], 'members' => [ 'id' => [ 'shape' => 'FindingId', ], 'principal' => [ 'shape' => 'PrincipalMap', ], 'action' => [ 'shape' => 'ActionList', ], 'resource' => [ 'shape' => 'String', ], 'isPublic' => [ 'shape' => 'Boolean', ], 'resourceType' => [ 'shape' => 'ResourceType', ], 'condition' => [ 'shape' => 'ConditionKeyMap', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'analyzedAt' => [ 'shape' => 'Timestamp', ], 'updatedAt' => [ 'shape' => 'Timestamp', ], 'status' => [ 'shape' => 'FindingStatus', ], 'resourceOwnerAccount' => [ 'shape' => 'String', ], 'error' => [ 'shape' => 'String', ], 'sources' => [ 'shape' => 'FindingSourceList', ], ], ], 'FindingChangeType' => [ 'type' => 'string', 'enum' => [ 'CHANGED', 'NEW', 'UNCHANGED', ], ], 'FindingId' => [ 'type' => 'string', ], 'FindingIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'FindingId', ], ], 'FindingSource' => [ 'type' => 'structure', 'required' => [ 'type', ], 'members' => [ 'type' => [ 'shape' => 'FindingSourceType', ], 'detail' => [ 'shape' => 'FindingSourceDetail', ], ], ], 'FindingSourceDetail' => [ 'type' => 'structure', 'members' => [ 'accessPointArn' => [ 'shape' => 'String', ], 'accessPointAccount' => [ 'shape' => 'String', ], ], ], 'FindingSourceList' => [ 'type' => 'list', 'member' => [ 'shape' => 'FindingSource', ], ], 'FindingSourceType' => [ 'type' => 'string', 'enum' => [ 'POLICY', 'BUCKET_ACL', 'S3_ACCESS_POINT', 'S3_ACCESS_POINT_ACCOUNT', ], ], 'FindingStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'ARCHIVED', 'RESOLVED', ], ], 'FindingStatusUpdate' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'ARCHIVED', ], ], 'FindingSummary' => [ 'type' => 'structure', 'required' => [ 'id', 'resourceType', 'condition', 'createdAt', 'analyzedAt', 'updatedAt', 'status', 'resourceOwnerAccount', ], 'members' => [ 'id' => [ 'shape' => 'FindingId', ], 'principal' => [ 'shape' => 'PrincipalMap', ], 'action' => [ 'shape' => 'ActionList', ], 'resource' => [ 'shape' => 'String', ], 'isPublic' => [ 'shape' => 'Boolean', ], 'resourceType' => [ 'shape' => 'ResourceType', ], 'condition' => [ 'shape' => 'ConditionKeyMap', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'analyzedAt' => [ 'shape' => 'Timestamp', ], 'updatedAt' => [ 'shape' => 'Timestamp', ], 'status' => [ 'shape' => 'FindingStatus', ], 'resourceOwnerAccount' => [ 'shape' => 'String', ], 'error' => [ 'shape' => 'String', ], 'sources' => [ 'shape' => 'FindingSourceList', ], ], ], 'FindingsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'FindingSummary', ], ], 'GeneratedPolicy' => [ 'type' => 'structure', 'required' => [ 'policy', ], 'members' => [ 'policy' => [ 'shape' => 'String', ], ], ], 'GeneratedPolicyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'GeneratedPolicy', ], ], 'GeneratedPolicyProperties' => [ 'type' => 'structure', 'required' => [ 'principalArn', ], 'members' => [ 'isComplete' => [ 'shape' => 'Boolean', ], 'principalArn' => [ 'shape' => 'PrincipalArn', ], 'cloudTrailProperties' => [ 'shape' => 'CloudTrailProperties', ], ], ], 'GeneratedPolicyResult' => [ 'type' => 'structure', 'required' => [ 'properties', ], 'members' => [ 'properties' => [ 'shape' => 'GeneratedPolicyProperties', ], 'generatedPolicies' => [ 'shape' => 'GeneratedPolicyList', ], ], ], 'GetAccessPreviewRequest' => [ 'type' => 'structure', 'required' => [ 'accessPreviewId', 'analyzerArn', ], 'members' => [ 'accessPreviewId' => [ 'shape' => 'AccessPreviewId', 'location' => 'uri', 'locationName' => 'accessPreviewId', ], 'analyzerArn' => [ 'shape' => 'AnalyzerArn', 'location' => 'querystring', 'locationName' => 'analyzerArn', ], ], ], 'GetAccessPreviewResponse' => [ 'type' => 'structure', 'required' => [ 'accessPreview', ], 'members' => [ 'accessPreview' => [ 'shape' => 'AccessPreview', ], ], ], 'GetAnalyzedResourceRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerArn', 'resourceArn', ], 'members' => [ 'analyzerArn' => [ 'shape' => 'AnalyzerArn', 'location' => 'querystring', 'locationName' => 'analyzerArn', ], 'resourceArn' => [ 'shape' => 'ResourceArn', 'location' => 'querystring', 'locationName' => 'resourceArn', ], ], ], 'GetAnalyzedResourceResponse' => [ 'type' => 'structure', 'members' => [ 'resource' => [ 'shape' => 'AnalyzedResource', ], ], ], 'GetAnalyzerRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerName', ], 'members' => [ 'analyzerName' => [ 'shape' => 'Name', 'location' => 'uri', 'locationName' => 'analyzerName', ], ], ], 'GetAnalyzerResponse' => [ 'type' => 'structure', 'required' => [ 'analyzer', ], 'members' => [ 'analyzer' => [ 'shape' => 'AnalyzerSummary', ], ], ], 'GetArchiveRuleRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerName', 'ruleName', ], 'members' => [ 'analyzerName' => [ 'shape' => 'Name', 'location' => 'uri', 'locationName' => 'analyzerName', ], 'ruleName' => [ 'shape' => 'Name', 'location' => 'uri', 'locationName' => 'ruleName', ], ], ], 'GetArchiveRuleResponse' => [ 'type' => 'structure', 'required' => [ 'archiveRule', ], 'members' => [ 'archiveRule' => [ 'shape' => 'ArchiveRuleSummary', ], ], ], 'GetFindingRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerArn', 'id', ], 'members' => [ 'analyzerArn' => [ 'shape' => 'AnalyzerArn', 'location' => 'querystring', 'locationName' => 'analyzerArn', ], 'id' => [ 'shape' => 'FindingId', 'location' => 'uri', 'locationName' => 'id', ], ], ], 'GetFindingResponse' => [ 'type' => 'structure', 'members' => [ 'finding' => [ 'shape' => 'Finding', ], ], ], 'GetGeneratedPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'jobId', ], 'members' => [ 'jobId' => [ 'shape' => 'JobId', 'location' => 'uri', 'locationName' => 'jobId', ], 'includeResourcePlaceholders' => [ 'shape' => 'Boolean', 'location' => 'querystring', 'locationName' => 'includeResourcePlaceholders', ], 'includeServiceLevelTemplate' => [ 'shape' => 'Boolean', 'location' => 'querystring', 'locationName' => 'includeServiceLevelTemplate', ], ], ], 'GetGeneratedPolicyResponse' => [ 'type' => 'structure', 'required' => [ 'jobDetails', 'generatedPolicyResult', ], 'members' => [ 'jobDetails' => [ 'shape' => 'JobDetails', ], 'generatedPolicyResult' => [ 'shape' => 'GeneratedPolicyResult', ], ], ], 'GranteePrincipal' => [ 'type' => 'string', ], 'IamRoleConfiguration' => [ 'type' => 'structure', 'members' => [ 'trustPolicy' => [ 'shape' => 'IamTrustPolicy', ], ], ], 'IamTrustPolicy' => [ 'type' => 'string', ], 'InlineArchiveRule' => [ 'type' => 'structure', 'required' => [ 'ruleName', 'filter', ], 'members' => [ 'ruleName' => [ 'shape' => 'Name', ], 'filter' => [ 'shape' => 'FilterCriteriaMap', ], ], ], 'InlineArchiveRulesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'InlineArchiveRule', ], ], 'Integer' => [ 'type' => 'integer', 'box' => true, ], 'InternalServerException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'retryAfterSeconds' => [ 'shape' => 'Integer', 'location' => 'header', 'locationName' => 'Retry-After', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, 'retryable' => [ 'throttling' => false, ], ], 'InternetConfiguration' => [ 'type' => 'structure', 'members' => [], ], 'IssueCode' => [ 'type' => 'string', ], 'IssuingAccount' => [ 'type' => 'string', ], 'JobDetails' => [ 'type' => 'structure', 'required' => [ 'jobId', 'status', 'startedOn', ], 'members' => [ 'jobId' => [ 'shape' => 'JobId', ], 'status' => [ 'shape' => 'JobStatus', ], 'startedOn' => [ 'shape' => 'Timestamp', ], 'completedOn' => [ 'shape' => 'Timestamp', ], 'jobError' => [ 'shape' => 'JobError', ], ], ], 'JobError' => [ 'type' => 'structure', 'required' => [ 'code', 'message', ], 'members' => [ 'code' => [ 'shape' => 'JobErrorCode', ], 'message' => [ 'shape' => 'String', ], ], ], 'JobErrorCode' => [ 'type' => 'string', 'enum' => [ 'AUTHORIZATION_ERROR', 'RESOURCE_NOT_FOUND_ERROR', 'SERVICE_QUOTA_EXCEEDED_ERROR', 'SERVICE_ERROR', ], ], 'JobId' => [ 'type' => 'string', ], 'JobStatus' => [ 'type' => 'string', 'enum' => [ 'IN_PROGRESS', 'SUCCEEDED', 'FAILED', 'CANCELED', ], ], 'KmsConstraintsKey' => [ 'type' => 'string', ], 'KmsConstraintsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'KmsConstraintsKey', ], 'value' => [ 'shape' => 'KmsConstraintsValue', ], ], 'KmsConstraintsValue' => [ 'type' => 'string', ], 'KmsGrantConfiguration' => [ 'type' => 'structure', 'required' => [ 'operations', 'granteePrincipal', 'issuingAccount', ], 'members' => [ 'operations' => [ 'shape' => 'KmsGrantOperationsList', ], 'granteePrincipal' => [ 'shape' => 'GranteePrincipal', ], 'retiringPrincipal' => [ 'shape' => 'RetiringPrincipal', ], 'constraints' => [ 'shape' => 'KmsGrantConstraints', ], 'issuingAccount' => [ 'shape' => 'IssuingAccount', ], ], ], 'KmsGrantConfigurationsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'KmsGrantConfiguration', ], ], 'KmsGrantConstraints' => [ 'type' => 'structure', 'members' => [ 'encryptionContextEquals' => [ 'shape' => 'KmsConstraintsMap', ], 'encryptionContextSubset' => [ 'shape' => 'KmsConstraintsMap', ], ], ], 'KmsGrantOperation' => [ 'type' => 'string', 'enum' => [ 'CreateGrant', 'Decrypt', 'DescribeKey', 'Encrypt', 'GenerateDataKey', 'GenerateDataKeyPair', 'GenerateDataKeyPairWithoutPlaintext', 'GenerateDataKeyWithoutPlaintext', 'GetPublicKey', 'ReEncryptFrom', 'ReEncryptTo', 'RetireGrant', 'Sign', 'Verify', ], ], 'KmsGrantOperationsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'KmsGrantOperation', ], ], 'KmsKeyConfiguration' => [ 'type' => 'structure', 'members' => [ 'keyPolicies' => [ 'shape' => 'KmsKeyPoliciesMap', ], 'grants' => [ 'shape' => 'KmsGrantConfigurationsList', ], ], ], 'KmsKeyPoliciesMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'PolicyName', ], 'value' => [ 'shape' => 'KmsKeyPolicy', ], ], 'KmsKeyPolicy' => [ 'type' => 'string', ], 'LearnMoreLink' => [ 'type' => 'string', ], 'ListAccessPreviewFindingsRequest' => [ 'type' => 'structure', 'required' => [ 'accessPreviewId', 'analyzerArn', ], 'members' => [ 'accessPreviewId' => [ 'shape' => 'AccessPreviewId', 'location' => 'uri', 'locationName' => 'accessPreviewId', ], 'analyzerArn' => [ 'shape' => 'AnalyzerArn', ], 'filter' => [ 'shape' => 'FilterCriteriaMap', ], 'nextToken' => [ 'shape' => 'Token', ], 'maxResults' => [ 'shape' => 'Integer', ], ], ], 'ListAccessPreviewFindingsResponse' => [ 'type' => 'structure', 'required' => [ 'findings', ], 'members' => [ 'findings' => [ 'shape' => 'AccessPreviewFindingsList', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListAccessPreviewsRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerArn', ], 'members' => [ 'analyzerArn' => [ 'shape' => 'AnalyzerArn', 'location' => 'querystring', 'locationName' => 'analyzerArn', ], 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'Integer', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListAccessPreviewsResponse' => [ 'type' => 'structure', 'required' => [ 'accessPreviews', ], 'members' => [ 'accessPreviews' => [ 'shape' => 'AccessPreviewsList', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListAnalyzedResourcesRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerArn', ], 'members' => [ 'analyzerArn' => [ 'shape' => 'AnalyzerArn', ], 'resourceType' => [ 'shape' => 'ResourceType', ], 'nextToken' => [ 'shape' => 'Token', ], 'maxResults' => [ 'shape' => 'Integer', ], ], ], 'ListAnalyzedResourcesResponse' => [ 'type' => 'structure', 'required' => [ 'analyzedResources', ], 'members' => [ 'analyzedResources' => [ 'shape' => 'AnalyzedResourcesList', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListAnalyzersRequest' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'Integer', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'type' => [ 'shape' => 'Type', 'location' => 'querystring', 'locationName' => 'type', ], ], ], 'ListAnalyzersResponse' => [ 'type' => 'structure', 'required' => [ 'analyzers', ], 'members' => [ 'analyzers' => [ 'shape' => 'AnalyzersList', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListArchiveRulesRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerName', ], 'members' => [ 'analyzerName' => [ 'shape' => 'Name', 'location' => 'uri', 'locationName' => 'analyzerName', ], 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'Integer', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListArchiveRulesResponse' => [ 'type' => 'structure', 'required' => [ 'archiveRules', ], 'members' => [ 'archiveRules' => [ 'shape' => 'ArchiveRulesList', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListFindingsRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerArn', ], 'members' => [ 'analyzerArn' => [ 'shape' => 'AnalyzerArn', ], 'filter' => [ 'shape' => 'FilterCriteriaMap', ], 'sort' => [ 'shape' => 'SortCriteria', ], 'nextToken' => [ 'shape' => 'Token', ], 'maxResults' => [ 'shape' => 'Integer', ], ], ], 'ListFindingsResponse' => [ 'type' => 'structure', 'required' => [ 'findings', ], 'members' => [ 'findings' => [ 'shape' => 'FindingsList', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListPolicyGenerationsRequest' => [ 'type' => 'structure', 'members' => [ 'principalArn' => [ 'shape' => 'PrincipalArn', 'location' => 'querystring', 'locationName' => 'principalArn', ], 'maxResults' => [ 'shape' => 'ListPolicyGenerationsRequestMaxResultsInteger', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'ListPolicyGenerationsRequestMaxResultsInteger' => [ 'type' => 'integer', 'box' => true, 'min' => 1, ], 'ListPolicyGenerationsResponse' => [ 'type' => 'structure', 'required' => [ 'policyGenerations', ], 'members' => [ 'policyGenerations' => [ 'shape' => 'PolicyGenerationList', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', ], 'members' => [ 'resourceArn' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resourceArn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'tags' => [ 'shape' => 'TagsMap', ], ], ], 'Locale' => [ 'type' => 'string', 'enum' => [ 'DE', 'EN', 'ES', 'FR', 'IT', 'JA', 'KO', 'PT_BR', 'ZH_CN', 'ZH_TW', ], ], 'Location' => [ 'type' => 'structure', 'required' => [ 'path', 'span', ], 'members' => [ 'path' => [ 'shape' => 'PathElementList', ], 'span' => [ 'shape' => 'Span', ], ], ], 'LocationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Location', ], ], 'Name' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '[A-Za-z][A-Za-z0-9_.-]*', ], 'NetworkOriginConfiguration' => [ 'type' => 'structure', 'members' => [ 'vpcConfiguration' => [ 'shape' => 'VpcConfiguration', ], 'internetConfiguration' => [ 'shape' => 'InternetConfiguration', ], ], 'union' => true, ], 'OrderBy' => [ 'type' => 'string', 'enum' => [ 'ASC', 'DESC', ], ], 'PathElement' => [ 'type' => 'structure', 'members' => [ 'index' => [ 'shape' => 'Integer', ], 'key' => [ 'shape' => 'String', ], 'substring' => [ 'shape' => 'Substring', ], 'value' => [ 'shape' => 'String', ], ], 'union' => true, ], 'PathElementList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PathElement', ], ], 'PolicyDocument' => [ 'type' => 'string', ], 'PolicyGeneration' => [ 'type' => 'structure', 'required' => [ 'jobId', 'principalArn', 'status', 'startedOn', ], 'members' => [ 'jobId' => [ 'shape' => 'JobId', ], 'principalArn' => [ 'shape' => 'PrincipalArn', ], 'status' => [ 'shape' => 'JobStatus', ], 'startedOn' => [ 'shape' => 'Timestamp', ], 'completedOn' => [ 'shape' => 'Timestamp', ], ], ], 'PolicyGenerationDetails' => [ 'type' => 'structure', 'required' => [ 'principalArn', ], 'members' => [ 'principalArn' => [ 'shape' => 'PrincipalArn', ], ], ], 'PolicyGenerationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PolicyGeneration', ], ], 'PolicyName' => [ 'type' => 'string', ], 'PolicyType' => [ 'type' => 'string', 'enum' => [ 'IDENTITY_POLICY', 'RESOURCE_POLICY', 'SERVICE_CONTROL_POLICY', ], ], 'Position' => [ 'type' => 'structure', 'required' => [ 'line', 'column', 'offset', ], 'members' => [ 'line' => [ 'shape' => 'Integer', ], 'column' => [ 'shape' => 'Integer', ], 'offset' => [ 'shape' => 'Integer', ], ], ], 'PrincipalArn' => [ 'type' => 'string', 'pattern' => 'arn:[^:]*:iam::[^:]*:(role|user)/.{1,576}', ], 'PrincipalMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], 'RdsDbClusterSnapshotAccountId' => [ 'type' => 'string', ], 'RdsDbClusterSnapshotAccountIdsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RdsDbClusterSnapshotAccountId', ], ], 'RdsDbClusterSnapshotAttributeName' => [ 'type' => 'string', ], 'RdsDbClusterSnapshotAttributeValue' => [ 'type' => 'structure', 'members' => [ 'accountIds' => [ 'shape' => 'RdsDbClusterSnapshotAccountIdsList', ], ], 'union' => true, ], 'RdsDbClusterSnapshotAttributesMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'RdsDbClusterSnapshotAttributeName', ], 'value' => [ 'shape' => 'RdsDbClusterSnapshotAttributeValue', ], ], 'RdsDbClusterSnapshotConfiguration' => [ 'type' => 'structure', 'members' => [ 'attributes' => [ 'shape' => 'RdsDbClusterSnapshotAttributesMap', ], 'kmsKeyId' => [ 'shape' => 'RdsDbClusterSnapshotKmsKeyId', ], ], ], 'RdsDbClusterSnapshotKmsKeyId' => [ 'type' => 'string', ], 'RdsDbSnapshotAccountId' => [ 'type' => 'string', ], 'RdsDbSnapshotAccountIdsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RdsDbSnapshotAccountId', ], ], 'RdsDbSnapshotAttributeName' => [ 'type' => 'string', ], 'RdsDbSnapshotAttributeValue' => [ 'type' => 'structure', 'members' => [ 'accountIds' => [ 'shape' => 'RdsDbSnapshotAccountIdsList', ], ], 'union' => true, ], 'RdsDbSnapshotAttributesMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'RdsDbSnapshotAttributeName', ], 'value' => [ 'shape' => 'RdsDbSnapshotAttributeValue', ], ], 'RdsDbSnapshotConfiguration' => [ 'type' => 'structure', 'members' => [ 'attributes' => [ 'shape' => 'RdsDbSnapshotAttributesMap', ], 'kmsKeyId' => [ 'shape' => 'RdsDbSnapshotKmsKeyId', ], ], ], 'RdsDbSnapshotKmsKeyId' => [ 'type' => 'string', ], 'ReasonCode' => [ 'type' => 'string', 'enum' => [ 'AWS_SERVICE_ACCESS_DISABLED', 'DELEGATED_ADMINISTRATOR_DEREGISTERED', 'ORGANIZATION_DELETED', 'SERVICE_LINKED_ROLE_CREATION_FAILED', ], ], 'RegionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'ResourceArn' => [ 'type' => 'string', 'pattern' => 'arn:[^:]*:[^:]*:[^:]*:[^:]*:.*', ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'required' => [ 'message', 'resourceId', 'resourceType', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'resourceId' => [ 'shape' => 'String', ], 'resourceType' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'ResourceType' => [ 'type' => 'string', 'enum' => [ 'AWS::S3::Bucket', 'AWS::IAM::Role', 'AWS::SQS::Queue', 'AWS::Lambda::Function', 'AWS::Lambda::LayerVersion', 'AWS::KMS::Key', 'AWS::SecretsManager::Secret', 'AWS::EFS::FileSystem', 'AWS::EC2::Snapshot', 'AWS::ECR::Repository', 'AWS::RDS::DBSnapshot', 'AWS::RDS::DBClusterSnapshot', 'AWS::SNS::Topic', ], ], 'RetiringPrincipal' => [ 'type' => 'string', ], 'RoleArn' => [ 'type' => 'string', 'pattern' => 'arn:[^:]*:iam::[^:]*:role/.{1,576}', ], 'S3AccessPointConfiguration' => [ 'type' => 'structure', 'members' => [ 'accessPointPolicy' => [ 'shape' => 'AccessPointPolicy', ], 'publicAccessBlock' => [ 'shape' => 'S3PublicAccessBlockConfiguration', ], 'networkOrigin' => [ 'shape' => 'NetworkOriginConfiguration', ], ], ], 'S3AccessPointConfigurationsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'AccessPointArn', ], 'value' => [ 'shape' => 'S3AccessPointConfiguration', ], ], 'S3BucketAclGrantConfiguration' => [ 'type' => 'structure', 'required' => [ 'permission', 'grantee', ], 'members' => [ 'permission' => [ 'shape' => 'AclPermission', ], 'grantee' => [ 'shape' => 'AclGrantee', ], ], ], 'S3BucketAclGrantConfigurationsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'S3BucketAclGrantConfiguration', ], ], 'S3BucketConfiguration' => [ 'type' => 'structure', 'members' => [ 'bucketPolicy' => [ 'shape' => 'S3BucketPolicy', ], 'bucketAclGrants' => [ 'shape' => 'S3BucketAclGrantConfigurationsList', ], 'bucketPublicAccessBlock' => [ 'shape' => 'S3PublicAccessBlockConfiguration', ], 'accessPoints' => [ 'shape' => 'S3AccessPointConfigurationsMap', ], ], ], 'S3BucketPolicy' => [ 'type' => 'string', ], 'S3PublicAccessBlockConfiguration' => [ 'type' => 'structure', 'required' => [ 'ignorePublicAcls', 'restrictPublicBuckets', ], 'members' => [ 'ignorePublicAcls' => [ 'shape' => 'Boolean', ], 'restrictPublicBuckets' => [ 'shape' => 'Boolean', ], ], ], 'SecretsManagerSecretConfiguration' => [ 'type' => 'structure', 'members' => [ 'kmsKeyId' => [ 'shape' => 'SecretsManagerSecretKmsId', ], 'secretPolicy' => [ 'shape' => 'SecretsManagerSecretPolicy', ], ], ], 'SecretsManagerSecretKmsId' => [ 'type' => 'string', ], 'SecretsManagerSecretPolicy' => [ 'type' => 'string', ], 'ServiceQuotaExceededException' => [ 'type' => 'structure', 'required' => [ 'message', 'resourceId', 'resourceType', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'resourceId' => [ 'shape' => 'String', ], 'resourceType' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 402, 'senderFault' => true, ], 'exception' => true, ], 'SharedViaList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'SnsTopicConfiguration' => [ 'type' => 'structure', 'members' => [ 'topicPolicy' => [ 'shape' => 'SnsTopicPolicy', ], ], ], 'SnsTopicPolicy' => [ 'type' => 'string', 'max' => 30720, 'min' => 0, ], 'SortCriteria' => [ 'type' => 'structure', 'members' => [ 'attributeName' => [ 'shape' => 'String', ], 'orderBy' => [ 'shape' => 'OrderBy', ], ], ], 'Span' => [ 'type' => 'structure', 'required' => [ 'start', 'end', ], 'members' => [ 'start' => [ 'shape' => 'Position', ], 'end' => [ 'shape' => 'Position', ], ], ], 'SqsQueueConfiguration' => [ 'type' => 'structure', 'members' => [ 'queuePolicy' => [ 'shape' => 'SqsQueuePolicy', ], ], ], 'SqsQueuePolicy' => [ 'type' => 'string', ], 'StartPolicyGenerationRequest' => [ 'type' => 'structure', 'required' => [ 'policyGenerationDetails', ], 'members' => [ 'policyGenerationDetails' => [ 'shape' => 'PolicyGenerationDetails', ], 'cloudTrailDetails' => [ 'shape' => 'CloudTrailDetails', ], 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], ], ], 'StartPolicyGenerationResponse' => [ 'type' => 'structure', 'required' => [ 'jobId', ], 'members' => [ 'jobId' => [ 'shape' => 'JobId', ], ], ], 'StartResourceScanRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerArn', 'resourceArn', ], 'members' => [ 'analyzerArn' => [ 'shape' => 'AnalyzerArn', ], 'resourceArn' => [ 'shape' => 'ResourceArn', ], 'resourceOwnerAccount' => [ 'shape' => 'String', ], ], ], 'StatusReason' => [ 'type' => 'structure', 'required' => [ 'code', ], 'members' => [ 'code' => [ 'shape' => 'ReasonCode', ], ], ], 'String' => [ 'type' => 'string', ], 'Substring' => [ 'type' => 'structure', 'required' => [ 'start', 'length', ], 'members' => [ 'start' => [ 'shape' => 'Integer', ], 'length' => [ 'shape' => 'Integer', ], ], ], 'TagKeys' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tags', ], 'members' => [ 'resourceArn' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tags' => [ 'shape' => 'TagsMap', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], 'ThrottlingException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'retryAfterSeconds' => [ 'shape' => 'Integer', 'location' => 'header', 'locationName' => 'Retry-After', ], ], 'error' => [ 'httpStatusCode' => 429, 'senderFault' => true, ], 'exception' => true, 'retryable' => [ 'throttling' => true, ], ], 'Timestamp' => [ 'type' => 'timestamp', 'timestampFormat' => 'iso8601', ], 'Token' => [ 'type' => 'string', ], 'Trail' => [ 'type' => 'structure', 'required' => [ 'cloudTrailArn', ], 'members' => [ 'cloudTrailArn' => [ 'shape' => 'CloudTrailArn', ], 'regions' => [ 'shape' => 'RegionList', ], 'allRegions' => [ 'shape' => 'Boolean', ], ], ], 'TrailList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Trail', ], ], 'TrailProperties' => [ 'type' => 'structure', 'required' => [ 'cloudTrailArn', ], 'members' => [ 'cloudTrailArn' => [ 'shape' => 'CloudTrailArn', ], 'regions' => [ 'shape' => 'RegionList', ], 'allRegions' => [ 'shape' => 'Boolean', ], ], ], 'TrailPropertiesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TrailProperties', ], ], 'Type' => [ 'type' => 'string', 'enum' => [ 'ACCOUNT', 'ORGANIZATION', ], ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tagKeys', ], 'members' => [ 'resourceArn' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tagKeys' => [ 'shape' => 'TagKeys', 'location' => 'querystring', 'locationName' => 'tagKeys', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateArchiveRuleRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerName', 'ruleName', 'filter', ], 'members' => [ 'analyzerName' => [ 'shape' => 'Name', 'location' => 'uri', 'locationName' => 'analyzerName', ], 'ruleName' => [ 'shape' => 'Name', 'location' => 'uri', 'locationName' => 'ruleName', ], 'filter' => [ 'shape' => 'FilterCriteriaMap', ], 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], ], ], 'UpdateFindingsRequest' => [ 'type' => 'structure', 'required' => [ 'analyzerArn', 'status', ], 'members' => [ 'analyzerArn' => [ 'shape' => 'AnalyzerArn', ], 'status' => [ 'shape' => 'FindingStatusUpdate', ], 'ids' => [ 'shape' => 'FindingIdList', ], 'resourceArn' => [ 'shape' => 'ResourceArn', ], 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], ], ], 'ValidatePolicyFinding' => [ 'type' => 'structure', 'required' => [ 'findingDetails', 'findingType', 'issueCode', 'learnMoreLink', 'locations', ], 'members' => [ 'findingDetails' => [ 'shape' => 'String', ], 'findingType' => [ 'shape' => 'ValidatePolicyFindingType', ], 'issueCode' => [ 'shape' => 'IssueCode', ], 'learnMoreLink' => [ 'shape' => 'LearnMoreLink', ], 'locations' => [ 'shape' => 'LocationList', ], ], ], 'ValidatePolicyFindingList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ValidatePolicyFinding', ], ], 'ValidatePolicyFindingType' => [ 'type' => 'string', 'enum' => [ 'ERROR', 'SECURITY_WARNING', 'SUGGESTION', 'WARNING', ], ], 'ValidatePolicyRequest' => [ 'type' => 'structure', 'required' => [ 'policyDocument', 'policyType', ], 'members' => [ 'locale' => [ 'shape' => 'Locale', ], 'maxResults' => [ 'shape' => 'Integer', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'policyDocument' => [ 'shape' => 'PolicyDocument', ], 'policyType' => [ 'shape' => 'PolicyType', ], 'validatePolicyResourceType' => [ 'shape' => 'ValidatePolicyResourceType', ], ], ], 'ValidatePolicyResourceType' => [ 'type' => 'string', 'enum' => [ 'AWS::S3::Bucket', 'AWS::S3::AccessPoint', 'AWS::S3::MultiRegionAccessPoint', 'AWS::S3ObjectLambda::AccessPoint', 'AWS::IAM::AssumeRolePolicyDocument', ], ], 'ValidatePolicyResponse' => [ 'type' => 'structure', 'required' => [ 'findings', ], 'members' => [ 'findings' => [ 'shape' => 'ValidatePolicyFindingList', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ValidationException' => [ 'type' => 'structure', 'required' => [ 'message', 'reason', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'reason' => [ 'shape' => 'ValidationExceptionReason', ], 'fieldList' => [ 'shape' => 'ValidationExceptionFieldList', ], ], 'error' => [ 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'ValidationExceptionField' => [ 'type' => 'structure', 'required' => [ 'name', 'message', ], 'members' => [ 'name' => [ 'shape' => 'String', ], 'message' => [ 'shape' => 'String', ], ], ], 'ValidationExceptionFieldList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ValidationExceptionField', ], ], 'ValidationExceptionReason' => [ 'type' => 'string', 'enum' => [ 'unknownOperation', 'cannotParse', 'fieldValidationFailed', 'other', ], ], 'ValueList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], 'max' => 20, 'min' => 1, ], 'VpcConfiguration' => [ 'type' => 'structure', 'required' => [ 'vpcId', ], 'members' => [ 'vpcId' => [ 'shape' => 'VpcId', ], ], ], 'VpcId' => [ 'type' => 'string', 'pattern' => 'vpc-([0-9a-f]){8}(([0-9a-f]){9})?', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/accessanalyzer/2019-11-01/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>Identity and Access Management Access Analyzer helps identify potential resource-access risks by enabling you to identify any policies that grant access to an external principal. It does this by using logic-based reasoning to analyze resource-based policies in your Amazon Web Services environment. An external principal can be another Amazon Web Services account, a root user, an IAM user or role, a federated user, an Amazon Web Services service, or an anonymous user. You can also use IAM Access Analyzer to preview and validate public and cross-account access to your resources before deploying permissions changes. This guide describes the Identity and Access Management Access Analyzer operations that you can call programmatically. For general information about IAM Access Analyzer, see <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html\">Identity and Access Management Access Analyzer</a> in the <b>IAM User Guide</b>.</p> <p>To start using IAM Access Analyzer, you first need to create an analyzer.</p>', 'operations' => [ 'ApplyArchiveRule' => '<p>Retroactively applies the archive rule to existing findings that meet the archive rule criteria.</p>', 'CancelPolicyGeneration' => '<p>Cancels the requested policy generation.</p>', 'CreateAccessPreview' => '<p>Creates an access preview that allows you to preview IAM Access Analyzer findings for your resource before deploying resource permissions.</p>', 'CreateAnalyzer' => '<p>Creates an analyzer for your account.</p>', 'CreateArchiveRule' => '<p>Creates an archive rule for the specified analyzer. Archive rules automatically archive new findings that meet the criteria you define when you create the rule.</p> <p>To learn about filter keys that you can use to create an archive rule, see <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-filter-keys.html\">IAM Access Analyzer filter keys</a> in the <b>IAM User Guide</b>.</p>', 'DeleteAnalyzer' => '<p>Deletes the specified analyzer. When you delete an analyzer, IAM Access Analyzer is disabled for the account or organization in the current or specific Region. All findings that were generated by the analyzer are deleted. You cannot undo this action.</p>', 'DeleteArchiveRule' => '<p>Deletes the specified archive rule.</p>', 'GetAccessPreview' => '<p>Retrieves information about an access preview for the specified analyzer.</p>', 'GetAnalyzedResource' => '<p>Retrieves information about a resource that was analyzed.</p>', 'GetAnalyzer' => '<p>Retrieves information about the specified analyzer.</p>', 'GetArchiveRule' => '<p>Retrieves information about an archive rule.</p> <p>To learn about filter keys that you can use to create an archive rule, see <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-filter-keys.html\">IAM Access Analyzer filter keys</a> in the <b>IAM User Guide</b>.</p>', 'GetFinding' => '<p>Retrieves information about the specified finding.</p>', 'GetGeneratedPolicy' => '<p>Retrieves the policy that was generated using <code>StartPolicyGeneration</code>. </p>', 'ListAccessPreviewFindings' => '<p>Retrieves a list of access preview findings generated by the specified access preview.</p>', 'ListAccessPreviews' => '<p>Retrieves a list of access previews for the specified analyzer.</p>', 'ListAnalyzedResources' => '<p>Retrieves a list of resources of the specified type that have been analyzed by the specified analyzer..</p>', 'ListAnalyzers' => '<p>Retrieves a list of analyzers.</p>', 'ListArchiveRules' => '<p>Retrieves a list of archive rules created for the specified analyzer.</p>', 'ListFindings' => '<p>Retrieves a list of findings generated by the specified analyzer.</p> <p>To learn about filter keys that you can use to retrieve a list of findings, see <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-filter-keys.html\">IAM Access Analyzer filter keys</a> in the <b>IAM User Guide</b>.</p>', 'ListPolicyGenerations' => '<p>Lists all of the policy generations requested in the last seven days.</p>', 'ListTagsForResource' => '<p>Retrieves a list of tags applied to the specified resource.</p>', 'StartPolicyGeneration' => '<p>Starts the policy generation request.</p>', 'StartResourceScan' => '<p>Immediately starts a scan of the policies applied to the specified resource.</p>', 'TagResource' => '<p>Adds a tag to the specified resource.</p>', 'UntagResource' => '<p>Removes a tag from the specified resource.</p>', 'UpdateArchiveRule' => '<p>Updates the criteria and values for the specified archive rule.</p>', 'UpdateFindings' => '<p>Updates the status for the specified findings.</p>', 'ValidatePolicy' => '<p>Requests the validation of a policy and returns a list of findings. The findings help you identify issues and provide actionable recommendations to resolve the issue and enable you to author functional policies that meet security best practices. </p>', ], 'shapes' => [ 'AccessDeniedException' => [ 'base' => '<p>You do not have sufficient access to perform this action.</p>', 'refs' => [], ], 'AccessPointArn' => [ 'base' => NULL, 'refs' => [ 'S3AccessPointConfigurationsMap$key' => NULL, ], ], 'AccessPointPolicy' => [ 'base' => NULL, 'refs' => [ 'S3AccessPointConfiguration$accessPointPolicy' => '<p>The access point or multi-region access point policy.</p>', ], ], 'AccessPreview' => [ 'base' => '<p>Contains information about an access preview.</p>', 'refs' => [ 'GetAccessPreviewResponse$accessPreview' => '<p>An object that contains information about the access preview.</p>', ], ], 'AccessPreviewFinding' => [ 'base' => '<p>An access preview finding generated by the access preview.</p>', 'refs' => [ 'AccessPreviewFindingsList$member' => NULL, ], ], 'AccessPreviewFindingId' => [ 'base' => NULL, 'refs' => [ 'AccessPreviewFinding$id' => '<p>The ID of the access preview finding. This ID uniquely identifies the element in the list of access preview findings and is not related to the finding ID in Access Analyzer.</p>', ], ], 'AccessPreviewFindingsList' => [ 'base' => NULL, 'refs' => [ 'ListAccessPreviewFindingsResponse$findings' => '<p>A list of access preview findings that match the specified filter criteria.</p>', ], ], 'AccessPreviewId' => [ 'base' => NULL, 'refs' => [ 'AccessPreview$id' => '<p>The unique ID for the access preview.</p>', 'AccessPreviewSummary$id' => '<p>The unique ID for the access preview.</p>', 'CreateAccessPreviewResponse$id' => '<p>The unique ID for the access preview.</p>', 'GetAccessPreviewRequest$accessPreviewId' => '<p>The unique ID for the access preview.</p>', 'ListAccessPreviewFindingsRequest$accessPreviewId' => '<p>The unique ID for the access preview.</p>', ], ], 'AccessPreviewStatus' => [ 'base' => NULL, 'refs' => [ 'AccessPreview$status' => '<p>The status of the access preview.</p> <ul> <li> <p> <code>Creating</code> - The access preview creation is in progress.</p> </li> <li> <p> <code>Completed</code> - The access preview is complete. You can preview findings for external access to the resource.</p> </li> <li> <p> <code>Failed</code> - The access preview creation has failed.</p> </li> </ul>', 'AccessPreviewSummary$status' => '<p>The status of the access preview.</p> <ul> <li> <p> <code>Creating</code> - The access preview creation is in progress.</p> </li> <li> <p> <code>Completed</code> - The access preview is complete and previews the findings for external access to the resource.</p> </li> <li> <p> <code>Failed</code> - The access preview creation has failed.</p> </li> </ul>', ], ], 'AccessPreviewStatusReason' => [ 'base' => '<p>Provides more details about the current status of the access preview. For example, if the creation of the access preview fails, a <code>Failed</code> status is returned. This failure can be due to an internal issue with the analysis or due to an invalid proposed resource configuration.</p>', 'refs' => [ 'AccessPreview$statusReason' => '<p>Provides more details about the current status of the access preview.</p> <p>For example, if the creation of the access preview fails, a <code>Failed</code> status is returned. This failure can be due to an internal issue with the analysis or due to an invalid resource configuration.</p>', 'AccessPreviewSummary$statusReason' => NULL, ], ], 'AccessPreviewStatusReasonCode' => [ 'base' => NULL, 'refs' => [ 'AccessPreviewStatusReason$code' => '<p>The reason code for the current status of the access preview.</p>', ], ], 'AccessPreviewSummary' => [ 'base' => '<p>Contains a summary of information about an access preview.</p>', 'refs' => [ 'AccessPreviewsList$member' => NULL, ], ], 'AccessPreviewsList' => [ 'base' => NULL, 'refs' => [ 'ListAccessPreviewsResponse$accessPreviews' => '<p>A list of access previews retrieved for the analyzer.</p>', ], ], 'AclCanonicalId' => [ 'base' => NULL, 'refs' => [ 'AclGrantee$id' => '<p>The value specified is the canonical user ID of an Amazon Web Services account.</p>', ], ], 'AclGrantee' => [ 'base' => '<p>You specify each grantee as a type-value pair using one of these types. You can specify only one type of grantee. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAcl.html\">PutBucketAcl</a>.</p>', 'refs' => [ 'S3BucketAclGrantConfiguration$grantee' => '<p>The grantee to whom you\u00e2\u20ac\u2122re assigning access rights.</p>', ], ], 'AclPermission' => [ 'base' => NULL, 'refs' => [ 'S3BucketAclGrantConfiguration$permission' => '<p>The permissions being granted.</p>', ], ], 'AclUri' => [ 'base' => NULL, 'refs' => [ 'AclGrantee$uri' => '<p>Used for granting permissions to a predefined group.</p>', ], ], 'ActionList' => [ 'base' => NULL, 'refs' => [ 'AccessPreviewFinding$action' => '<p>The action in the analyzed policy statement that an external principal has permission to perform.</p>', 'AnalyzedResource$actions' => '<p>The actions that an external principal is granted permission to use by the policy that generated the finding.</p>', 'Finding$action' => '<p>The action in the analyzed policy statement that an external principal has permission to use.</p>', 'FindingSummary$action' => '<p>The action in the analyzed policy statement that an external principal has permission to use.</p>', ], ], 'AnalyzedResource' => [ 'base' => '<p>Contains details about the analyzed resource.</p>', 'refs' => [ 'GetAnalyzedResourceResponse$resource' => '<p>An <code>AnalyzedResource</code> object that contains information that IAM Access Analyzer found when it analyzed the resource.</p>', ], ], 'AnalyzedResourceSummary' => [ 'base' => '<p>Contains the ARN of the analyzed resource.</p>', 'refs' => [ 'AnalyzedResourcesList$member' => NULL, ], ], 'AnalyzedResourcesList' => [ 'base' => NULL, 'refs' => [ 'ListAnalyzedResourcesResponse$analyzedResources' => '<p>A list of resources that were analyzed.</p>', ], ], 'AnalyzerArn' => [ 'base' => NULL, 'refs' => [ 'AccessPreview$analyzerArn' => '<p>The ARN of the analyzer used to generate the access preview.</p>', 'AccessPreviewSummary$analyzerArn' => '<p>The ARN of the analyzer used to generate the access preview.</p>', 'AnalyzerSummary$arn' => '<p>The ARN of the analyzer.</p>', 'ApplyArchiveRuleRequest$analyzerArn' => '<p>The Amazon resource name (ARN) of the analyzer.</p>', 'CreateAccessPreviewRequest$analyzerArn' => '<p>The <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources\">ARN of the account analyzer</a> used to generate the access preview. You can only create an access preview for analyzers with an <code>Account</code> type and <code>Active</code> status.</p>', 'CreateAnalyzerResponse$arn' => '<p>The ARN of the analyzer that was created by the request.</p>', 'GetAccessPreviewRequest$analyzerArn' => '<p>The <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources\">ARN of the analyzer</a> used to generate the access preview.</p>', 'GetAnalyzedResourceRequest$analyzerArn' => '<p>The <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources\">ARN of the analyzer</a> to retrieve information from.</p>', 'GetFindingRequest$analyzerArn' => '<p>The <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources\">ARN of the analyzer</a> that generated the finding.</p>', 'ListAccessPreviewFindingsRequest$analyzerArn' => '<p>The <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources\">ARN of the analyzer</a> used to generate the access.</p>', 'ListAccessPreviewsRequest$analyzerArn' => '<p>The <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources\">ARN of the analyzer</a> used to generate the access preview.</p>', 'ListAnalyzedResourcesRequest$analyzerArn' => '<p>The <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources\">ARN of the analyzer</a> to retrieve a list of analyzed resources from.</p>', 'ListFindingsRequest$analyzerArn' => '<p>The <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources\">ARN of the analyzer</a> to retrieve findings from.</p>', 'StartResourceScanRequest$analyzerArn' => '<p>The <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources\">ARN of the analyzer</a> to use to scan the policies applied to the specified resource.</p>', 'UpdateFindingsRequest$analyzerArn' => '<p>The <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources\">ARN of the analyzer</a> that generated the findings to update.</p>', ], ], 'AnalyzerStatus' => [ 'base' => NULL, 'refs' => [ 'AnalyzerSummary$status' => '<p>The status of the analyzer. An <code>Active</code> analyzer successfully monitors supported resources and generates new findings. The analyzer is <code>Disabled</code> when a user action, such as removing trusted access for Identity and Access Management Access Analyzer from Organizations, causes the analyzer to stop generating new findings. The status is <code>Creating</code> when the analyzer creation is in progress and <code>Failed</code> when the analyzer creation has failed. </p>', ], ], 'AnalyzerSummary' => [ 'base' => '<p>Contains information about the analyzer.</p>', 'refs' => [ 'AnalyzersList$member' => NULL, 'GetAnalyzerResponse$analyzer' => '<p>An <code>AnalyzerSummary</code> object that contains information about the analyzer.</p>', ], ], 'AnalyzersList' => [ 'base' => NULL, 'refs' => [ 'ListAnalyzersResponse$analyzers' => '<p>The analyzers retrieved.</p>', ], ], 'ApplyArchiveRuleRequest' => [ 'base' => '<p>Retroactively applies an archive rule.</p>', 'refs' => [], ], 'ArchiveRuleSummary' => [ 'base' => '<p>Contains information about an archive rule.</p>', 'refs' => [ 'ArchiveRulesList$member' => NULL, 'GetArchiveRuleResponse$archiveRule' => NULL, ], ], 'ArchiveRulesList' => [ 'base' => NULL, 'refs' => [ 'ListArchiveRulesResponse$archiveRules' => '<p>A list of archive rules created for the specified analyzer.</p>', ], ], 'Boolean' => [ 'base' => NULL, 'refs' => [ 'AccessPreviewFinding$isPublic' => '<p>Indicates whether the policy that generated the finding allows public access to the resource.</p>', 'AnalyzedResource$isPublic' => '<p>Indicates whether the policy that generated the finding grants public access to the resource.</p>', 'Criterion$exists' => '<p>An \"exists\" operator to match for the filter used to create the rule. </p>', 'Finding$isPublic' => '<p>Indicates whether the policy that generated the finding allows public access to the resource.</p>', 'FindingSummary$isPublic' => '<p>Indicates whether the finding reports a resource that has a policy that allows public access.</p>', 'GeneratedPolicyProperties$isComplete' => '<p>This value is set to <code>true</code> if the generated policy contains all possible actions for a service that IAM Access Analyzer identified from the CloudTrail trail that you specified, and <code>false</code> otherwise.</p>', 'GetGeneratedPolicyRequest$includeResourcePlaceholders' => '<p>The level of detail that you want to generate. You can specify whether to generate policies with placeholders for resource ARNs for actions that support resource level granularity in policies.</p> <p>For example, in the resource section of a policy, you can receive a placeholder such as <code>\"Resource\":\"arn:aws:s3:::${BucketName}\"</code> instead of <code>\"*\"</code>.</p>', 'GetGeneratedPolicyRequest$includeServiceLevelTemplate' => '<p>The level of detail that you want to generate. You can specify whether to generate service-level policies. </p> <p>IAM Access Analyzer uses <code>iam:servicelastaccessed</code> to identify services that have been used recently to create this service-level template.</p>', 'S3PublicAccessBlockConfiguration$ignorePublicAcls' => '<p> Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket. </p>', 'S3PublicAccessBlockConfiguration$restrictPublicBuckets' => '<p> Specifies whether Amazon S3 should restrict public bucket policies for this bucket. </p>', 'Trail$allRegions' => '<p>Possible values are <code>true</code> or <code>false</code>. If set to <code>true</code>, IAM Access Analyzer retrieves CloudTrail data from all regions to analyze and generate a policy.</p>', 'TrailProperties$allRegions' => '<p>Possible values are <code>true</code> or <code>false</code>. If set to <code>true</code>, IAM Access Analyzer retrieves CloudTrail data from all regions to analyze and generate a policy.</p>', ], ], 'CancelPolicyGenerationRequest' => [ 'base' => NULL, 'refs' => [], ], 'CancelPolicyGenerationResponse' => [ 'base' => NULL, 'refs' => [], ], 'CloudTrailArn' => [ 'base' => NULL, 'refs' => [ 'Trail$cloudTrailArn' => '<p>Specifies the ARN of the trail. The format of a trail ARN is <code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code>.</p>', 'TrailProperties$cloudTrailArn' => '<p>Specifies the ARN of the trail. The format of a trail ARN is <code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code>.</p>', ], ], 'CloudTrailDetails' => [ 'base' => '<p>Contains information about CloudTrail access.</p>', 'refs' => [ 'StartPolicyGenerationRequest$cloudTrailDetails' => '<p>A <code>CloudTrailDetails</code> object that contains details about a <code>Trail</code> that you want to analyze to generate policies.</p>', ], ], 'CloudTrailProperties' => [ 'base' => '<p>Contains information about CloudTrail access.</p>', 'refs' => [ 'GeneratedPolicyProperties$cloudTrailProperties' => '<p>Lists details about the <code>Trail</code> used to generated policy.</p>', ], ], 'ConditionKeyMap' => [ 'base' => NULL, 'refs' => [ 'AccessPreviewFinding$condition' => '<p>The condition in the analyzed policy statement that resulted in a finding.</p>', 'Finding$condition' => '<p>The condition in the analyzed policy statement that resulted in a finding.</p>', 'FindingSummary$condition' => '<p>The condition in the analyzed policy statement that resulted in a finding.</p>', ], ], 'Configuration' => [ 'base' => '<p>Access control configuration structures for your resource. You specify the configuration as a type-value pair. You can specify only one type of access control configuration.</p>', 'refs' => [ 'ConfigurationsMap$value' => NULL, ], ], 'ConfigurationsMap' => [ 'base' => NULL, 'refs' => [ 'AccessPreview$configurations' => '<p>A map of resource ARNs for the proposed resource configuration.</p>', 'CreateAccessPreviewRequest$configurations' => '<p>Access control configuration for your resource that is used to generate the access preview. The access preview includes findings for external access allowed to the resource with the proposed access control configuration. The configuration must contain exactly one element.</p>', ], ], 'ConfigurationsMapKey' => [ 'base' => NULL, 'refs' => [ 'ConfigurationsMap$key' => NULL, ], ], 'ConflictException' => [ 'base' => '<p>A conflict exception error.</p>', 'refs' => [], ], 'CreateAccessPreviewRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAccessPreviewResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateAnalyzerRequest' => [ 'base' => '<p>Creates an analyzer.</p>', 'refs' => [], ], 'CreateAnalyzerResponse' => [ 'base' => '<p>The response to the request to create an analyzer.</p>', 'refs' => [], ], 'CreateArchiveRuleRequest' => [ 'base' => '<p>Creates an archive rule.</p>', 'refs' => [], ], 'Criterion' => [ 'base' => '<p>The criteria to use in the filter that defines the archive rule. For more information on available filter keys, see <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-filter-keys.html\">IAM Access Analyzer filter keys</a>.</p>', 'refs' => [ 'FilterCriteriaMap$value' => NULL, ], ], 'DeleteAnalyzerRequest' => [ 'base' => '<p>Deletes an analyzer.</p>', 'refs' => [], ], 'DeleteArchiveRuleRequest' => [ 'base' => '<p>Deletes an archive rule.</p>', 'refs' => [], ], 'EbsGroup' => [ 'base' => NULL, 'refs' => [ 'EbsGroupList$member' => NULL, ], ], 'EbsGroupList' => [ 'base' => NULL, 'refs' => [ 'EbsSnapshotConfiguration$groups' => '<p>The groups that have access to the Amazon EBS volume snapshot. If the value <code>all</code> is specified, then the Amazon EBS volume snapshot is public.</p> <ul> <li> <p>If the configuration is for an existing Amazon EBS volume snapshot and you do not specify the <code>groups</code>, then the access preview uses the existing shared <code>groups</code> for the snapshot.</p> </li> <li> <p>If the access preview is for a new resource and you do not specify the <code>groups</code>, then the access preview considers the snapshot without any <code>groups</code>.</p> </li> <li> <p>To propose deletion of existing shared <code>groups</code>, you can specify an empty list for <code>groups</code>.</p> </li> </ul>', ], ], 'EbsSnapshotConfiguration' => [ 'base' => '<p>The proposed access control configuration for an Amazon EBS volume snapshot. You can propose a configuration for a new Amazon EBS volume snapshot or an Amazon EBS volume snapshot that you own by specifying the user IDs, groups, and optional KMS encryption key. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifySnapshotAttribute.html\">ModifySnapshotAttribute</a>.</p>', 'refs' => [ 'Configuration$ebsSnapshot' => '<p>The access control configuration is for an Amazon EBS volume snapshot.</p>', ], ], 'EbsSnapshotDataEncryptionKeyId' => [ 'base' => NULL, 'refs' => [ 'EbsSnapshotConfiguration$kmsKeyId' => '<p>The KMS key identifier for an encrypted Amazon EBS volume snapshot. The KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key.</p> <ul> <li> <p>If the configuration is for an existing Amazon EBS volume snapshot and you do not specify the <code>kmsKeyId</code>, or you specify an empty string, then the access preview uses the existing <code>kmsKeyId</code> of the snapshot.</p> </li> <li> <p>If the access preview is for a new resource and you do not specify the <code>kmsKeyId</code>, the access preview considers the snapshot as unencrypted.</p> </li> </ul>', ], ], 'EbsUserId' => [ 'base' => NULL, 'refs' => [ 'EbsUserIdList$member' => NULL, ], ], 'EbsUserIdList' => [ 'base' => NULL, 'refs' => [ 'EbsSnapshotConfiguration$userIds' => '<p>The IDs of the Amazon Web Services accounts that have access to the Amazon EBS volume snapshot.</p> <ul> <li> <p>If the configuration is for an existing Amazon EBS volume snapshot and you do not specify the <code>userIds</code>, then the access preview uses the existing shared <code>userIds</code> for the snapshot.</p> </li> <li> <p>If the access preview is for a new resource and you do not specify the <code>userIds</code>, then the access preview considers the snapshot without any <code>userIds</code>.</p> </li> <li> <p>To propose deletion of existing shared <code>accountIds</code>, you can specify an empty list for <code>userIds</code>.</p> </li> </ul>', ], ], 'EcrRepositoryConfiguration' => [ 'base' => '<p>The proposed access control configuration for an Amazon ECR repository. You can propose a configuration for a new Amazon ECR repository or an existing Amazon ECR repository that you own by specifying the Amazon ECR policy. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_Repository.html\">Repository</a>.</p> <ul> <li> <p>If the configuration is for an existing Amazon ECR repository and you do not specify the Amazon ECR policy, then the access preview uses the existing Amazon ECR policy for the repository.</p> </li> <li> <p>If the access preview is for a new resource and you do not specify the policy, then the access preview assumes an Amazon ECR repository without a policy.</p> </li> <li> <p>To propose deletion of an existing Amazon ECR repository policy, you can specify an empty string for the Amazon ECR policy.</p> </li> </ul>', 'refs' => [ 'Configuration$ecrRepository' => '<p>The access control configuration is for an Amazon ECR repository.</p>', ], ], 'EcrRepositoryPolicy' => [ 'base' => NULL, 'refs' => [ 'EcrRepositoryConfiguration$repositoryPolicy' => '<p>The JSON repository policy text to apply to the Amazon ECR repository. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policy-examples.html\">Private repository policy examples</a> in the <i>Amazon ECR User Guide</i>.</p>', ], ], 'EfsFileSystemConfiguration' => [ 'base' => '<p>The proposed access control configuration for an Amazon EFS file system. You can propose a configuration for a new Amazon EFS file system or an existing Amazon EFS file system that you own by specifying the Amazon EFS policy. For more information, see <a href=\"https://docs.aws.amazon.com/efs/latest/ug/using-fs.html\">Using file systems in Amazon EFS</a>.</p> <ul> <li> <p>If the configuration is for an existing Amazon EFS file system and you do not specify the Amazon EFS policy, then the access preview uses the existing Amazon EFS policy for the file system.</p> </li> <li> <p>If the access preview is for a new resource and you do not specify the policy, then the access preview assumes an Amazon EFS file system without a policy.</p> </li> <li> <p>To propose deletion of an existing Amazon EFS file system policy, you can specify an empty string for the Amazon EFS policy.</p> </li> </ul>', 'refs' => [ 'Configuration$efsFileSystem' => '<p>The access control configuration is for an Amazon EFS file system.</p>', ], ], 'EfsFileSystemPolicy' => [ 'base' => NULL, 'refs' => [ 'EfsFileSystemConfiguration$fileSystemPolicy' => '<p>The JSON policy definition to apply to the Amazon EFS file system. For more information on the elements that make up a file system policy, see <a href=\"https://docs.aws.amazon.com/efs/latest/ug/access-control-overview.html#access-control-manage-access-intro-resource-policies\">Amazon EFS Resource-based policies</a>.</p>', ], ], 'FilterCriteriaMap' => [ 'base' => NULL, 'refs' => [ 'ArchiveRuleSummary$filter' => '<p>A filter used to define the archive rule.</p>', 'CreateArchiveRuleRequest$filter' => '<p>The criteria for the rule.</p>', 'InlineArchiveRule$filter' => '<p>The condition and values for a criterion.</p>', 'ListAccessPreviewFindingsRequest$filter' => '<p>Criteria to filter the returned findings.</p>', 'ListFindingsRequest$filter' => '<p>A filter to match for the findings to return.</p>', 'UpdateArchiveRuleRequest$filter' => '<p>A filter to match for the rules to update. Only rules that match the filter are updated.</p>', ], ], 'Finding' => [ 'base' => '<p>Contains information about a finding.</p>', 'refs' => [ 'GetFindingResponse$finding' => '<p>A <code>finding</code> object that contains finding details.</p>', ], ], 'FindingChangeType' => [ 'base' => NULL, 'refs' => [ 'AccessPreviewFinding$changeType' => '<p>Provides context on how the access preview finding compares to existing access identified in IAM Access Analyzer.</p> <ul> <li> <p> <code>New</code> - The finding is for newly-introduced access.</p> </li> <li> <p> <code>Unchanged</code> - The preview finding is an existing finding that would remain unchanged.</p> </li> <li> <p> <code>Changed</code> - The preview finding is an existing finding with a change in status.</p> </li> </ul> <p>For example, a <code>Changed</code> finding with preview status <code>Resolved</code> and existing status <code>Active</code> indicates the existing <code>Active</code> finding would become <code>Resolved</code> as a result of the proposed permissions change.</p>', ], ], 'FindingId' => [ 'base' => NULL, 'refs' => [ 'AccessPreviewFinding$existingFindingId' => '<p>The existing ID of the finding in IAM Access Analyzer, provided only for existing findings.</p>', 'Finding$id' => '<p>The ID of the finding.</p>', 'FindingIdList$member' => NULL, 'FindingSummary$id' => '<p>The ID of the finding.</p>', 'GetFindingRequest$id' => '<p>The ID of the finding to retrieve.</p>', ], ], 'FindingIdList' => [ 'base' => NULL, 'refs' => [ 'UpdateFindingsRequest$ids' => '<p>The IDs of the findings to update.</p>', ], ], 'FindingSource' => [ 'base' => '<p>The source of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.</p>', 'refs' => [ 'FindingSourceList$member' => NULL, ], ], 'FindingSourceDetail' => [ 'base' => '<p>Includes details about how the access that generated the finding is granted. This is populated for Amazon S3 bucket findings.</p>', 'refs' => [ 'FindingSource$detail' => '<p>Includes details about how the access that generated the finding is granted. This is populated for Amazon S3 bucket findings.</p>', ], ], 'FindingSourceList' => [ 'base' => NULL, 'refs' => [ 'AccessPreviewFinding$sources' => '<p>The sources of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.</p>', 'Finding$sources' => '<p>The sources of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.</p>', 'FindingSummary$sources' => '<p>The sources of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.</p>', ], ], 'FindingSourceType' => [ 'base' => NULL, 'refs' => [ 'FindingSource$type' => '<p>Indicates the type of access that generated the finding.</p>', ], ], 'FindingStatus' => [ 'base' => NULL, 'refs' => [ 'AccessPreviewFinding$existingFindingStatus' => '<p>The existing status of the finding, provided only for existing findings.</p>', 'AccessPreviewFinding$status' => '<p>The preview status of the finding. This is what the status of the finding would be after permissions deployment. For example, a <code>Changed</code> finding with preview status <code>Resolved</code> and existing status <code>Active</code> indicates the existing <code>Active</code> finding would become <code>Resolved</code> as a result of the proposed permissions change.</p>', 'AnalyzedResource$status' => '<p>The current status of the finding generated from the analyzed resource.</p>', 'Finding$status' => '<p>The current status of the finding.</p>', 'FindingSummary$status' => '<p>The status of the finding.</p>', ], ], 'FindingStatusUpdate' => [ 'base' => NULL, 'refs' => [ 'UpdateFindingsRequest$status' => '<p>The state represents the action to take to update the finding Status. Use <code>ARCHIVE</code> to change an Active finding to an Archived finding. Use <code>ACTIVE</code> to change an Archived finding to an Active finding.</p>', ], ], 'FindingSummary' => [ 'base' => '<p>Contains information about a finding.</p>', 'refs' => [ 'FindingsList$member' => NULL, ], ], 'FindingsList' => [ 'base' => NULL, 'refs' => [ 'ListFindingsResponse$findings' => '<p>A list of findings retrieved from the analyzer that match the filter criteria specified, if any.</p>', ], ], 'GeneratedPolicy' => [ 'base' => '<p>Contains the text for the generated policy.</p>', 'refs' => [ 'GeneratedPolicyList$member' => NULL, ], ], 'GeneratedPolicyList' => [ 'base' => NULL, 'refs' => [ 'GeneratedPolicyResult$generatedPolicies' => '<p>The text to use as the content for the new policy. The policy is created using the <a href=\"https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreatePolicy.html\">CreatePolicy</a> action.</p>', ], ], 'GeneratedPolicyProperties' => [ 'base' => '<p>Contains the generated policy details.</p>', 'refs' => [ 'GeneratedPolicyResult$properties' => '<p>A <code>GeneratedPolicyProperties</code> object that contains properties of the generated policy.</p>', ], ], 'GeneratedPolicyResult' => [ 'base' => '<p>Contains the text for the generated policy and its details.</p>', 'refs' => [ 'GetGeneratedPolicyResponse$generatedPolicyResult' => '<p>A <code>GeneratedPolicyResult</code> object that contains the generated policies and associated details.</p>', ], ], 'GetAccessPreviewRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetAccessPreviewResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetAnalyzedResourceRequest' => [ 'base' => '<p>Retrieves an analyzed resource.</p>', 'refs' => [], ], 'GetAnalyzedResourceResponse' => [ 'base' => '<p>The response to the request.</p>', 'refs' => [], ], 'GetAnalyzerRequest' => [ 'base' => '<p>Retrieves an analyzer.</p>', 'refs' => [], ], 'GetAnalyzerResponse' => [ 'base' => '<p>The response to the request.</p>', 'refs' => [], ], 'GetArchiveRuleRequest' => [ 'base' => '<p>Retrieves an archive rule.</p>', 'refs' => [], ], 'GetArchiveRuleResponse' => [ 'base' => '<p>The response to the request.</p>', 'refs' => [], ], 'GetFindingRequest' => [ 'base' => '<p>Retrieves a finding.</p>', 'refs' => [], ], 'GetFindingResponse' => [ 'base' => '<p>The response to the request.</p>', 'refs' => [], ], 'GetGeneratedPolicyRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetGeneratedPolicyResponse' => [ 'base' => NULL, 'refs' => [], ], 'GranteePrincipal' => [ 'base' => NULL, 'refs' => [ 'KmsGrantConfiguration$granteePrincipal' => '<p>The principal that is given permission to perform the operations that the grant permits.</p>', ], ], 'IamRoleConfiguration' => [ 'base' => '<p>The proposed access control configuration for an IAM role. You can propose a configuration for a new IAM role or an existing IAM role that you own by specifying the trust policy. If the configuration is for a new IAM role, you must specify the trust policy. If the configuration is for an existing IAM role that you own and you do not propose the trust policy, the access preview uses the existing trust policy for the role. The proposed trust policy cannot be an empty string. For more information about role trust policy limits, see <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html\">IAM and STS quotas</a>.</p>', 'refs' => [ 'Configuration$iamRole' => '<p>The access control configuration is for an IAM role. </p>', ], ], 'IamTrustPolicy' => [ 'base' => NULL, 'refs' => [ 'IamRoleConfiguration$trustPolicy' => '<p>The proposed trust policy for the IAM role.</p>', ], ], 'InlineArchiveRule' => [ 'base' => '<p>An criterion statement in an archive rule. Each archive rule may have multiple criteria.</p>', 'refs' => [ 'InlineArchiveRulesList$member' => NULL, ], ], 'InlineArchiveRulesList' => [ 'base' => NULL, 'refs' => [ 'CreateAnalyzerRequest$archiveRules' => '<p>Specifies the archive rules to add for the analyzer. Archive rules automatically archive findings that meet the criteria you define for the rule.</p>', ], ], 'Integer' => [ 'base' => NULL, 'refs' => [ 'InternalServerException$retryAfterSeconds' => '<p>The seconds to wait to retry.</p>', 'ListAccessPreviewFindingsRequest$maxResults' => '<p>The maximum number of results to return in the response.</p>', 'ListAccessPreviewsRequest$maxResults' => '<p>The maximum number of results to return in the response.</p>', 'ListAnalyzedResourcesRequest$maxResults' => '<p>The maximum number of results to return in the response.</p>', 'ListAnalyzersRequest$maxResults' => '<p>The maximum number of results to return in the response.</p>', 'ListArchiveRulesRequest$maxResults' => '<p>The maximum number of results to return in the request.</p>', 'ListFindingsRequest$maxResults' => '<p>The maximum number of results to return in the response.</p>', 'PathElement$index' => '<p>Refers to an index in a JSON array.</p>', 'Position$line' => '<p>The line of the position, starting from 1.</p>', 'Position$column' => '<p>The column of the position, starting from 0.</p>', 'Position$offset' => '<p>The offset within the policy that corresponds to the position, starting from 0.</p>', 'Substring$start' => '<p>The start index of the substring, starting from 0.</p>', 'Substring$length' => '<p>The length of the substring.</p>', 'ThrottlingException$retryAfterSeconds' => '<p>The seconds to wait to retry.</p>', 'ValidatePolicyRequest$maxResults' => '<p>The maximum number of results to return in the response.</p>', ], ], 'InternalServerException' => [ 'base' => '<p>Internal server error.</p>', 'refs' => [], ], 'InternetConfiguration' => [ 'base' => '<p>This configuration sets the network origin for the Amazon S3 access point or multi-region access point to <code>Internet</code>.</p>', 'refs' => [ 'NetworkOriginConfiguration$internetConfiguration' => '<p>The configuration for the Amazon S3 access point or multi-region access point with an <code>Internet</code> origin.</p>', ], ], 'IssueCode' => [ 'base' => NULL, 'refs' => [ 'ValidatePolicyFinding$issueCode' => '<p>The issue code provides an identifier of the issue associated with this finding.</p>', ], ], 'IssuingAccount' => [ 'base' => NULL, 'refs' => [ 'KmsGrantConfiguration$issuingAccount' => '<p> The Amazon Web Services account under which the grant was issued. The account is used to propose KMS grants issued by accounts other than the owner of the key.</p>', ], ], 'JobDetails' => [ 'base' => '<p>Contains details about the policy generation request.</p>', 'refs' => [ 'GetGeneratedPolicyResponse$jobDetails' => '<p>A <code>GeneratedPolicyDetails</code> object that contains details about the generated policy.</p>', ], ], 'JobError' => [ 'base' => '<p>Contains the details about the policy generation error.</p>', 'refs' => [ 'JobDetails$jobError' => '<p>The job error for the policy generation request.</p>', ], ], 'JobErrorCode' => [ 'base' => NULL, 'refs' => [ 'JobError$code' => '<p>The job error code.</p>', ], ], 'JobId' => [ 'base' => NULL, 'refs' => [ 'CancelPolicyGenerationRequest$jobId' => '<p>The <code>JobId</code> that is returned by the <code>StartPolicyGeneration</code> operation. The <code>JobId</code> can be used with <code>GetGeneratedPolicy</code> to retrieve the generated policies or used with <code>CancelPolicyGeneration</code> to cancel the policy generation request.</p>', 'GetGeneratedPolicyRequest$jobId' => '<p>The <code>JobId</code> that is returned by the <code>StartPolicyGeneration</code> operation. The <code>JobId</code> can be used with <code>GetGeneratedPolicy</code> to retrieve the generated policies or used with <code>CancelPolicyGeneration</code> to cancel the policy generation request.</p>', 'JobDetails$jobId' => '<p>The <code>JobId</code> that is returned by the <code>StartPolicyGeneration</code> operation. The <code>JobId</code> can be used with <code>GetGeneratedPolicy</code> to retrieve the generated policies or used with <code>CancelPolicyGeneration</code> to cancel the policy generation request.</p>', 'PolicyGeneration$jobId' => '<p>The <code>JobId</code> that is returned by the <code>StartPolicyGeneration</code> operation. The <code>JobId</code> can be used with <code>GetGeneratedPolicy</code> to retrieve the generated policies or used with <code>CancelPolicyGeneration</code> to cancel the policy generation request.</p>', 'StartPolicyGenerationResponse$jobId' => '<p>The <code>JobId</code> that is returned by the <code>StartPolicyGeneration</code> operation. The <code>JobId</code> can be used with <code>GetGeneratedPolicy</code> to retrieve the generated policies or used with <code>CancelPolicyGeneration</code> to cancel the policy generation request.</p>', ], ], 'JobStatus' => [ 'base' => NULL, 'refs' => [ 'JobDetails$status' => '<p>The status of the job request.</p>', 'PolicyGeneration$status' => '<p>The status of the policy generation request.</p>', ], ], 'KmsConstraintsKey' => [ 'base' => NULL, 'refs' => [ 'KmsConstraintsMap$key' => NULL, ], ], 'KmsConstraintsMap' => [ 'base' => NULL, 'refs' => [ 'KmsGrantConstraints$encryptionContextEquals' => '<p>A list of key-value pairs that must match the encryption context in the <a href=\"https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations\">cryptographic operation</a> request. The grant allows the operation only when the encryption context in the request is the same as the encryption context specified in this constraint.</p>', 'KmsGrantConstraints$encryptionContextSubset' => '<p>A list of key-value pairs that must be included in the encryption context of the <a href=\"https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations\">cryptographic operation</a> request. The grant allows the cryptographic operation only when the encryption context in the request includes the key-value pairs specified in this constraint, although it can include additional key-value pairs.</p>', ], ], 'KmsConstraintsValue' => [ 'base' => NULL, 'refs' => [ 'KmsConstraintsMap$value' => NULL, ], ], 'KmsGrantConfiguration' => [ 'base' => '<p>A proposed grant configuration for a KMS key. For more information, see <a href=\"https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateGrant.html\">CreateGrant</a>.</p>', 'refs' => [ 'KmsGrantConfigurationsList$member' => NULL, ], ], 'KmsGrantConfigurationsList' => [ 'base' => NULL, 'refs' => [ 'KmsKeyConfiguration$grants' => '<p>A list of proposed grant configurations for the KMS key. If the proposed grant configuration is for an existing key, the access preview uses the proposed list of grant configurations in place of the existing grants. Otherwise, the access preview uses the existing grants for the key.</p>', ], ], 'KmsGrantConstraints' => [ 'base' => '<p>Use this structure to propose allowing <a href=\"https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations\">cryptographic operations</a> in the grant only when the operation request includes the specified <a href=\"https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context\">encryption context</a>. You can specify only one type of encryption context. An empty map is treated as not specified. For more information, see <a href=\"https://docs.aws.amazon.com/kms/latest/APIReference/API_GrantConstraints.html\">GrantConstraints</a>.</p>', 'refs' => [ 'KmsGrantConfiguration$constraints' => '<p>Use this structure to propose allowing <a href=\"https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations\">cryptographic operations</a> in the grant only when the operation request includes the specified <a href=\"https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context\">encryption context</a>.</p>', ], ], 'KmsGrantOperation' => [ 'base' => NULL, 'refs' => [ 'KmsGrantOperationsList$member' => NULL, ], ], 'KmsGrantOperationsList' => [ 'base' => NULL, 'refs' => [ 'KmsGrantConfiguration$operations' => '<p>A list of operations that the grant permits.</p>', ], ], 'KmsKeyConfiguration' => [ 'base' => '<p>Proposed access control configuration for a KMS key. You can propose a configuration for a new KMS key or an existing KMS key that you own by specifying the key policy and KMS grant configuration. If the configuration is for an existing key and you do not specify the key policy, the access preview uses the existing policy for the key. If the access preview is for a new resource and you do not specify the key policy, then the access preview uses the default key policy. The proposed key policy cannot be an empty string. For more information, see <a href=\"https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default\">Default key policy</a>. For more information about key policy limits, see <a href=\"https://docs.aws.amazon.com/kms/latest/developerguide/resource-limits.html\">Resource quotas</a>.</p> <p/>', 'refs' => [ 'Configuration$kmsKey' => '<p>The access control configuration is for a KMS key. </p>', ], ], 'KmsKeyPoliciesMap' => [ 'base' => NULL, 'refs' => [ 'KmsKeyConfiguration$keyPolicies' => '<p>Resource policy configuration for the KMS key. The only valid value for the name of the key policy is <code>default</code>. For more information, see <a href=\"https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default\">Default key policy</a>.</p>', ], ], 'KmsKeyPolicy' => [ 'base' => NULL, 'refs' => [ 'KmsKeyPoliciesMap$value' => NULL, ], ], 'LearnMoreLink' => [ 'base' => NULL, 'refs' => [ 'ValidatePolicyFinding$learnMoreLink' => '<p>A link to additional documentation about the type of finding.</p>', ], ], 'ListAccessPreviewFindingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAccessPreviewFindingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListAccessPreviewsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAccessPreviewsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListAnalyzedResourcesRequest' => [ 'base' => '<p>Retrieves a list of resources that have been analyzed.</p>', 'refs' => [], ], 'ListAnalyzedResourcesResponse' => [ 'base' => '<p>The response to the request.</p>', 'refs' => [], ], 'ListAnalyzersRequest' => [ 'base' => '<p>Retrieves a list of analyzers.</p>', 'refs' => [], ], 'ListAnalyzersResponse' => [ 'base' => '<p>The response to the request.</p>', 'refs' => [], ], 'ListArchiveRulesRequest' => [ 'base' => '<p>Retrieves a list of archive rules created for the specified analyzer.</p>', 'refs' => [], ], 'ListArchiveRulesResponse' => [ 'base' => '<p>The response to the request.</p>', 'refs' => [], ], 'ListFindingsRequest' => [ 'base' => '<p>Retrieves a list of findings generated by the specified analyzer.</p>', 'refs' => [], ], 'ListFindingsResponse' => [ 'base' => '<p>The response to the request.</p>', 'refs' => [], ], 'ListPolicyGenerationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListPolicyGenerationsRequestMaxResultsInteger' => [ 'base' => NULL, 'refs' => [ 'ListPolicyGenerationsRequest$maxResults' => '<p>The maximum number of results to return in the response.</p>', ], ], 'ListPolicyGenerationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => '<p>Retrieves a list of tags applied to the specified resource.</p>', 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => '<p>The response to the request.</p>', 'refs' => [], ], 'Locale' => [ 'base' => NULL, 'refs' => [ 'ValidatePolicyRequest$locale' => '<p>The locale to use for localizing the findings.</p>', ], ], 'Location' => [ 'base' => '<p>A location in a policy that is represented as a path through the JSON representation and a corresponding span.</p>', 'refs' => [ 'LocationList$member' => NULL, ], ], 'LocationList' => [ 'base' => NULL, 'refs' => [ 'ValidatePolicyFinding$locations' => '<p>The list of locations in the policy document that are related to the finding. The issue code provides a summary of an issue identified by the finding.</p>', ], ], 'Name' => [ 'base' => NULL, 'refs' => [ 'AnalyzerSummary$name' => '<p>The name of the analyzer.</p>', 'ApplyArchiveRuleRequest$ruleName' => '<p>The name of the rule to apply.</p>', 'ArchiveRuleSummary$ruleName' => '<p>The name of the archive rule.</p>', 'CreateAnalyzerRequest$analyzerName' => '<p>The name of the analyzer to create.</p>', 'CreateArchiveRuleRequest$analyzerName' => '<p>The name of the created analyzer.</p>', 'CreateArchiveRuleRequest$ruleName' => '<p>The name of the rule to create.</p>', 'DeleteAnalyzerRequest$analyzerName' => '<p>The name of the analyzer to delete.</p>', 'DeleteArchiveRuleRequest$analyzerName' => '<p>The name of the analyzer that associated with the archive rule to delete.</p>', 'DeleteArchiveRuleRequest$ruleName' => '<p>The name of the rule to delete.</p>', 'GetAnalyzerRequest$analyzerName' => '<p>The name of the analyzer retrieved.</p>', 'GetArchiveRuleRequest$analyzerName' => '<p>The name of the analyzer to retrieve rules from.</p>', 'GetArchiveRuleRequest$ruleName' => '<p>The name of the rule to retrieve.</p>', 'InlineArchiveRule$ruleName' => '<p>The name of the rule.</p>', 'ListArchiveRulesRequest$analyzerName' => '<p>The name of the analyzer to retrieve rules from.</p>', 'UpdateArchiveRuleRequest$analyzerName' => '<p>The name of the analyzer to update the archive rules for.</p>', 'UpdateArchiveRuleRequest$ruleName' => '<p>The name of the rule to update.</p>', ], ], 'NetworkOriginConfiguration' => [ 'base' => '<p>The proposed <code>InternetConfiguration</code> or <code>VpcConfiguration</code> to apply to the Amazon S3 access point. <code>VpcConfiguration</code> does not apply to multi-region access points. You can make the access point accessible from the internet, or you can specify that all requests made through that access point must originate from a specific virtual private cloud (VPC). You can specify only one type of network configuration. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/dev/creating-access-points.html\">Creating access points</a>.</p>', 'refs' => [ 'S3AccessPointConfiguration$networkOrigin' => '<p>The proposed <code>Internet</code> and <code>VpcConfiguration</code> to apply to this Amazon S3 access point. <code>VpcConfiguration</code> does not apply to multi-region access points. If the access preview is for a new resource and neither is specified, the access preview uses <code>Internet</code> for the network origin. If the access preview is for an existing resource and neither is specified, the access preview uses the exiting network origin.</p>', ], ], 'OrderBy' => [ 'base' => NULL, 'refs' => [ 'SortCriteria$orderBy' => '<p>The sort order, ascending or descending.</p>', ], ], 'PathElement' => [ 'base' => '<p>A single element in a path through the JSON representation of a policy.</p>', 'refs' => [ 'PathElementList$member' => NULL, ], ], 'PathElementList' => [ 'base' => NULL, 'refs' => [ 'Location$path' => '<p>A path in a policy, represented as a sequence of path elements.</p>', ], ], 'PolicyDocument' => [ 'base' => NULL, 'refs' => [ 'ValidatePolicyRequest$policyDocument' => '<p>The JSON policy document to use as the content for the policy.</p>', ], ], 'PolicyGeneration' => [ 'base' => '<p>Contains details about the policy generation status and properties.</p>', 'refs' => [ 'PolicyGenerationList$member' => NULL, ], ], 'PolicyGenerationDetails' => [ 'base' => '<p>Contains the ARN details about the IAM entity for which the policy is generated.</p>', 'refs' => [ 'StartPolicyGenerationRequest$policyGenerationDetails' => '<p>Contains the ARN of the IAM entity (user or role) for which you are generating a policy.</p>', ], ], 'PolicyGenerationList' => [ 'base' => NULL, 'refs' => [ 'ListPolicyGenerationsResponse$policyGenerations' => '<p>A <code>PolicyGeneration</code> object that contains details about the generated policy.</p>', ], ], 'PolicyName' => [ 'base' => NULL, 'refs' => [ 'KmsKeyPoliciesMap$key' => NULL, ], ], 'PolicyType' => [ 'base' => NULL, 'refs' => [ 'ValidatePolicyRequest$policyType' => '<p>The type of policy to validate. Identity policies grant permissions to IAM principals. Identity policies include managed and inline policies for IAM roles, users, and groups. They also include service-control policies (SCPs) that are attached to an Amazon Web Services organization, organizational unit (OU), or an account.</p> <p>Resource policies grant permissions on Amazon Web Services resources. Resource policies include trust policies for IAM roles and bucket policies for Amazon S3 buckets. You can provide a generic input such as identity policy or resource policy or a specific input such as managed policy or Amazon S3 bucket policy. </p>', ], ], 'Position' => [ 'base' => '<p>A position in a policy.</p>', 'refs' => [ 'Span$start' => '<p>The start position of the span (inclusive).</p>', 'Span$end' => '<p>The end position of the span (exclusive).</p>', ], ], 'PrincipalArn' => [ 'base' => NULL, 'refs' => [ 'GeneratedPolicyProperties$principalArn' => '<p>The ARN of the IAM entity (user or role) for which you are generating a policy.</p>', 'ListPolicyGenerationsRequest$principalArn' => '<p>The ARN of the IAM entity (user or role) for which you are generating a policy. Use this with <code>ListGeneratedPolicies</code> to filter the results to only include results for a specific principal.</p>', 'PolicyGeneration$principalArn' => '<p>The ARN of the IAM entity (user or role) for which you are generating a policy.</p>', 'PolicyGenerationDetails$principalArn' => '<p>The ARN of the IAM entity (user or role) for which you are generating a policy.</p>', ], ], 'PrincipalMap' => [ 'base' => NULL, 'refs' => [ 'AccessPreviewFinding$principal' => '<p>The external principal that has access to a resource within the zone of trust.</p>', 'Finding$principal' => '<p>The external principal that access to a resource within the zone of trust.</p>', 'FindingSummary$principal' => '<p>The external principal that has access to a resource within the zone of trust.</p>', ], ], 'RdsDbClusterSnapshotAccountId' => [ 'base' => NULL, 'refs' => [ 'RdsDbClusterSnapshotAccountIdsList$member' => NULL, ], ], 'RdsDbClusterSnapshotAccountIdsList' => [ 'base' => NULL, 'refs' => [ 'RdsDbClusterSnapshotAttributeValue$accountIds' => '<p>The Amazon Web Services account IDs that have access to the manual Amazon RDS DB cluster snapshot. If the value <code>all</code> is specified, then the Amazon RDS DB cluster snapshot is public and can be copied or restored by all Amazon Web Services accounts.</p> <ul> <li> <p>If the configuration is for an existing Amazon RDS DB cluster snapshot and you do not specify the <code>accountIds</code> in <code>RdsDbClusterSnapshotAttributeValue</code>, then the access preview uses the existing shared <code>accountIds</code> for the snapshot.</p> </li> <li> <p>If the access preview is for a new resource and you do not specify the specify the <code>accountIds</code> in <code>RdsDbClusterSnapshotAttributeValue</code>, then the access preview considers the snapshot without any attributes.</p> </li> <li> <p>To propose deletion of existing shared <code>accountIds</code>, you can specify an empty list for <code>accountIds</code> in the <code>RdsDbClusterSnapshotAttributeValue</code>.</p> </li> </ul>', ], ], 'RdsDbClusterSnapshotAttributeName' => [ 'base' => NULL, 'refs' => [ 'RdsDbClusterSnapshotAttributesMap$key' => NULL, ], ], 'RdsDbClusterSnapshotAttributeValue' => [ 'base' => '<p>The values for a manual Amazon RDS DB cluster snapshot attribute.</p>', 'refs' => [ 'RdsDbClusterSnapshotAttributesMap$value' => NULL, ], ], 'RdsDbClusterSnapshotAttributesMap' => [ 'base' => NULL, 'refs' => [ 'RdsDbClusterSnapshotConfiguration$attributes' => '<p>The names and values of manual DB cluster snapshot attributes. Manual DB cluster snapshot attributes are used to authorize other Amazon Web Services accounts to restore a manual DB cluster snapshot. The only valid value for <code>AttributeName</code> for the attribute map is <code>restore</code> </p>', ], ], 'RdsDbClusterSnapshotConfiguration' => [ 'base' => '<p>The proposed access control configuration for an Amazon RDS DB cluster snapshot. You can propose a configuration for a new Amazon RDS DB cluster snapshot or an Amazon RDS DB cluster snapshot that you own by specifying the <code>RdsDbClusterSnapshotAttributeValue</code> and optional KMS encryption key. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBClusterSnapshotAttribute.html\">ModifyDBClusterSnapshotAttribute</a>.</p>', 'refs' => [ 'Configuration$rdsDbClusterSnapshot' => '<p>The access control configuration is for an Amazon RDS DB cluster snapshot.</p>', ], ], 'RdsDbClusterSnapshotKmsKeyId' => [ 'base' => NULL, 'refs' => [ 'RdsDbClusterSnapshotConfiguration$kmsKeyId' => '<p>The KMS key identifier for an encrypted Amazon RDS DB cluster snapshot. The KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key.</p> <ul> <li> <p>If the configuration is for an existing Amazon RDS DB cluster snapshot and you do not specify the <code>kmsKeyId</code>, or you specify an empty string, then the access preview uses the existing <code>kmsKeyId</code> of the snapshot.</p> </li> <li> <p>If the access preview is for a new resource and you do not specify the specify the <code>kmsKeyId</code>, then the access preview considers the snapshot as unencrypted.</p> </li> </ul>', ], ], 'RdsDbSnapshotAccountId' => [ 'base' => NULL, 'refs' => [ 'RdsDbSnapshotAccountIdsList$member' => NULL, ], ], 'RdsDbSnapshotAccountIdsList' => [ 'base' => NULL, 'refs' => [ 'RdsDbSnapshotAttributeValue$accountIds' => '<p>The Amazon Web Services account IDs that have access to the manual Amazon RDS DB snapshot. If the value <code>all</code> is specified, then the Amazon RDS DB snapshot is public and can be copied or restored by all Amazon Web Services accounts.</p> <ul> <li> <p>If the configuration is for an existing Amazon RDS DB snapshot and you do not specify the <code>accountIds</code> in <code>RdsDbSnapshotAttributeValue</code>, then the access preview uses the existing shared <code>accountIds</code> for the snapshot.</p> </li> <li> <p>If the access preview is for a new resource and you do not specify the specify the <code>accountIds</code> in <code>RdsDbSnapshotAttributeValue</code>, then the access preview considers the snapshot without any attributes.</p> </li> <li> <p>To propose deletion of an existing shared <code>accountIds</code>, you can specify an empty list for <code>accountIds</code> in the <code>RdsDbSnapshotAttributeValue</code>.</p> </li> </ul>', ], ], 'RdsDbSnapshotAttributeName' => [ 'base' => NULL, 'refs' => [ 'RdsDbSnapshotAttributesMap$key' => NULL, ], ], 'RdsDbSnapshotAttributeValue' => [ 'base' => '<p>The name and values of a manual Amazon RDS DB snapshot attribute. Manual DB snapshot attributes are used to authorize other Amazon Web Services accounts to restore a manual DB snapshot.</p>', 'refs' => [ 'RdsDbSnapshotAttributesMap$value' => NULL, ], ], 'RdsDbSnapshotAttributesMap' => [ 'base' => NULL, 'refs' => [ 'RdsDbSnapshotConfiguration$attributes' => '<p>The names and values of manual DB snapshot attributes. Manual DB snapshot attributes are used to authorize other Amazon Web Services accounts to restore a manual DB snapshot. The only valid value for <code>attributeName</code> for the attribute map is restore.</p>', ], ], 'RdsDbSnapshotConfiguration' => [ 'base' => '<p>The proposed access control configuration for an Amazon RDS DB snapshot. You can propose a configuration for a new Amazon RDS DB snapshot or an Amazon RDS DB snapshot that you own by specifying the <code>RdsDbSnapshotAttributeValue</code> and optional KMS encryption key. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBSnapshotAttribute.html\">ModifyDBSnapshotAttribute</a>.</p>', 'refs' => [ 'Configuration$rdsDbSnapshot' => '<p>The access control configuration is for an Amazon RDS DB snapshot.</p>', ], ], 'RdsDbSnapshotKmsKeyId' => [ 'base' => NULL, 'refs' => [ 'RdsDbSnapshotConfiguration$kmsKeyId' => '<p>The KMS key identifier for an encrypted Amazon RDS DB snapshot. The KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key.</p> <ul> <li> <p>If the configuration is for an existing Amazon RDS DB snapshot and you do not specify the <code>kmsKeyId</code>, or you specify an empty string, then the access preview uses the existing <code>kmsKeyId</code> of the snapshot.</p> </li> <li> <p>If the access preview is for a new resource and you do not specify the specify the <code>kmsKeyId</code>, then the access preview considers the snapshot as unencrypted.</p> </li> </ul>', ], ], 'ReasonCode' => [ 'base' => NULL, 'refs' => [ 'StatusReason$code' => '<p>The reason code for the current status of the analyzer.</p>', ], ], 'RegionList' => [ 'base' => NULL, 'refs' => [ 'Trail$regions' => '<p>A list of regions to get CloudTrail data from and analyze to generate a policy.</p>', 'TrailProperties$regions' => '<p>A list of regions to get CloudTrail data from and analyze to generate a policy.</p>', ], ], 'ResourceArn' => [ 'base' => NULL, 'refs' => [ 'AnalyzedResource$resourceArn' => '<p>The ARN of the resource that was analyzed.</p>', 'AnalyzedResourceSummary$resourceArn' => '<p>The ARN of the analyzed resource.</p>', 'GetAnalyzedResourceRequest$resourceArn' => '<p>The ARN of the resource to retrieve information about.</p>', 'StartResourceScanRequest$resourceArn' => '<p>The ARN of the resource to scan.</p>', 'UpdateFindingsRequest$resourceArn' => '<p>The ARN of the resource identified in the finding.</p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p>The specified resource could not be found.</p>', 'refs' => [], ], 'ResourceType' => [ 'base' => NULL, 'refs' => [ 'AccessPreviewFinding$resourceType' => '<p>The type of the resource that can be accessed in the finding.</p>', 'AnalyzedResource$resourceType' => '<p>The type of the resource that was analyzed.</p>', 'AnalyzedResourceSummary$resourceType' => '<p>The type of resource that was analyzed.</p>', 'Finding$resourceType' => '<p>The type of the resource identified in the finding.</p>', 'FindingSummary$resourceType' => '<p>The type of the resource that the external principal has access to.</p>', 'ListAnalyzedResourcesRequest$resourceType' => '<p>The type of resource.</p>', ], ], 'RetiringPrincipal' => [ 'base' => NULL, 'refs' => [ 'KmsGrantConfiguration$retiringPrincipal' => '<p>The principal that is given permission to retire the grant by using <a href=\"https://docs.aws.amazon.com/kms/latest/APIReference/API_RetireGrant.html\">RetireGrant</a> operation.</p>', ], ], 'RoleArn' => [ 'base' => NULL, 'refs' => [ 'CloudTrailDetails$accessRole' => '<p>The ARN of the service role that IAM Access Analyzer uses to access your CloudTrail trail and service last accessed information.</p>', ], ], 'S3AccessPointConfiguration' => [ 'base' => '<p>The configuration for an Amazon S3 access point or multi-region access point for the bucket. You can propose up to 10 access points or multi-region access points per bucket. If the proposed Amazon S3 access point configuration is for an existing bucket, the access preview uses the proposed access point configuration in place of the existing access points. To propose an access point without a policy, you can provide an empty string as the access point policy. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/dev/creating-access-points.html\">Creating access points</a>. For more information about access point policy limits, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/dev/access-points-restrictions-limitations.html\">Access points restrictions and limitations</a>.</p>', 'refs' => [ 'S3AccessPointConfigurationsMap$value' => NULL, ], ], 'S3AccessPointConfigurationsMap' => [ 'base' => NULL, 'refs' => [ 'S3BucketConfiguration$accessPoints' => '<p>The configuration of Amazon S3 access points or multi-region access points for the bucket. You can propose up to 10 new access points per bucket.</p>', ], ], 'S3BucketAclGrantConfiguration' => [ 'base' => '<p>A proposed access control list grant configuration for an Amazon S3 bucket. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#setting-acls\">How to Specify an ACL</a>.</p>', 'refs' => [ 'S3BucketAclGrantConfigurationsList$member' => NULL, ], ], 'S3BucketAclGrantConfigurationsList' => [ 'base' => NULL, 'refs' => [ 'S3BucketConfiguration$bucketAclGrants' => '<p>The proposed list of ACL grants for the Amazon S3 bucket. You can propose up to 100 ACL grants per bucket. If the proposed grant configuration is for an existing bucket, the access preview uses the proposed list of grant configurations in place of the existing grants. Otherwise, the access preview uses the existing grants for the bucket.</p>', ], ], 'S3BucketConfiguration' => [ 'base' => '<p>Proposed access control configuration for an Amazon S3 bucket. You can propose a configuration for a new Amazon S3 bucket or an existing Amazon S3 bucket that you own by specifying the Amazon S3 bucket policy, bucket ACLs, bucket BPA settings, Amazon S3 access points, and multi-region access points attached to the bucket. If the configuration is for an existing Amazon S3 bucket and you do not specify the Amazon S3 bucket policy, the access preview uses the existing policy attached to the bucket. If the access preview is for a new resource and you do not specify the Amazon S3 bucket policy, the access preview assumes a bucket without a policy. To propose deletion of an existing bucket policy, you can specify an empty string. For more information about bucket policy limits, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html\">Bucket Policy Examples</a>.</p>', 'refs' => [ 'Configuration$s3Bucket' => '<p>The access control configuration is for an Amazon S3 Bucket. </p>', ], ], 'S3BucketPolicy' => [ 'base' => NULL, 'refs' => [ 'S3BucketConfiguration$bucketPolicy' => '<p>The proposed bucket policy for the Amazon S3 bucket.</p>', ], ], 'S3PublicAccessBlockConfiguration' => [ 'base' => '<p>The <code>PublicAccessBlock</code> configuration to apply to this Amazon S3 bucket. If the proposed configuration is for an existing Amazon S3 bucket and the configuration is not specified, the access preview uses the existing setting. If the proposed configuration is for a new bucket and the configuration is not specified, the access preview uses <code>false</code>. If the proposed configuration is for a new access point or multi-region access point and the access point BPA configuration is not specified, the access preview uses <code>true</code>. For more information, see <a href=\"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-publicaccessblockconfiguration.html\">PublicAccessBlockConfiguration</a>. </p>', 'refs' => [ 'S3AccessPointConfiguration$publicAccessBlock' => '<p>The proposed <code>S3PublicAccessBlock</code> configuration to apply to this Amazon S3 access point or multi-region access point.</p>', 'S3BucketConfiguration$bucketPublicAccessBlock' => '<p>The proposed block public access configuration for the Amazon S3 bucket.</p>', ], ], 'SecretsManagerSecretConfiguration' => [ 'base' => '<p>The configuration for a Secrets Manager secret. For more information, see <a href=\"https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_CreateSecret.html\">CreateSecret</a>.</p> <p>You can propose a configuration for a new secret or an existing secret that you own by specifying the secret policy and optional KMS encryption key. If the configuration is for an existing secret and you do not specify the secret policy, the access preview uses the existing policy for the secret. If the access preview is for a new resource and you do not specify the policy, the access preview assumes a secret without a policy. To propose deletion of an existing policy, you can specify an empty string. If the proposed configuration is for a new secret and you do not specify the KMS key ID, the access preview uses the Amazon Web Services managed key <code>aws/secretsmanager</code>. If you specify an empty string for the KMS key ID, the access preview uses the Amazon Web Services managed key of the Amazon Web Services account. For more information about secret policy limits, see <a href=\"https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_limits.html\">Quotas for Secrets Manager.</a>.</p>', 'refs' => [ 'Configuration$secretsManagerSecret' => '<p>The access control configuration is for a Secrets Manager secret.</p>', ], ], 'SecretsManagerSecretKmsId' => [ 'base' => NULL, 'refs' => [ 'SecretsManagerSecretConfiguration$kmsKeyId' => '<p>The proposed ARN, key ID, or alias of the KMS key.</p>', ], ], 'SecretsManagerSecretPolicy' => [ 'base' => NULL, 'refs' => [ 'SecretsManagerSecretConfiguration$secretPolicy' => '<p>The proposed resource policy defining who can access or manage the secret.</p>', ], ], 'ServiceQuotaExceededException' => [ 'base' => '<p>Service quote met error.</p>', 'refs' => [], ], 'SharedViaList' => [ 'base' => NULL, 'refs' => [ 'AnalyzedResource$sharedVia' => '<p>Indicates how the access that generated the finding is granted. This is populated for Amazon S3 bucket findings.</p>', ], ], 'SnsTopicConfiguration' => [ 'base' => '<p>The proposed access control configuration for an Amazon SNS topic. You can propose a configuration for a new Amazon SNS topic or an existing Amazon SNS topic that you own by specifying the policy. If the configuration is for an existing Amazon SNS topic and you do not specify the Amazon SNS policy, then the access preview uses the existing Amazon SNS policy for the topic. If the access preview is for a new resource and you do not specify the policy, then the access preview assumes an Amazon SNS topic without a policy. To propose deletion of an existing Amazon SNS topic policy, you can specify an empty string for the Amazon SNS policy. For more information, see <a href=\"https://docs.aws.amazon.com/sns/latest/api/API_Topic.html\">Topic</a>.</p>', 'refs' => [ 'Configuration$snsTopic' => '<p>The access control configuration is for an Amazon SNS topic</p>', ], ], 'SnsTopicPolicy' => [ 'base' => NULL, 'refs' => [ 'SnsTopicConfiguration$topicPolicy' => '<p>The JSON policy text that defines who can access an Amazon SNS topic. For more information, see <a href=\"https://docs.aws.amazon.com/sns/latest/dg/sns-access-policy-use-cases.html\">Example cases for Amazon SNS access control</a> in the <i>Amazon SNS Developer Guide</i>.</p>', ], ], 'SortCriteria' => [ 'base' => '<p>The criteria used to sort.</p>', 'refs' => [ 'ListFindingsRequest$sort' => '<p>The sort order for the findings returned.</p>', ], ], 'Span' => [ 'base' => '<p>A span in a policy. The span consists of a start position (inclusive) and end position (exclusive).</p>', 'refs' => [ 'Location$span' => '<p>A span in a policy.</p>', ], ], 'SqsQueueConfiguration' => [ 'base' => '<p>The proposed access control configuration for an Amazon SQS queue. You can propose a configuration for a new Amazon SQS queue or an existing Amazon SQS queue that you own by specifying the Amazon SQS policy. If the configuration is for an existing Amazon SQS queue and you do not specify the Amazon SQS policy, the access preview uses the existing Amazon SQS policy for the queue. If the access preview is for a new resource and you do not specify the policy, the access preview assumes an Amazon SQS queue without a policy. To propose deletion of an existing Amazon SQS queue policy, you can specify an empty string for the Amazon SQS policy. For more information about Amazon SQS policy limits, see <a href=\"https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-policies.html\">Quotas related to policies</a>.</p>', 'refs' => [ 'Configuration$sqsQueue' => '<p>The access control configuration is for an Amazon SQS queue. </p>', ], ], 'SqsQueuePolicy' => [ 'base' => NULL, 'refs' => [ 'SqsQueueConfiguration$queuePolicy' => '<p> The proposed resource policy for the Amazon SQS queue. </p>', ], ], 'StartPolicyGenerationRequest' => [ 'base' => NULL, 'refs' => [], ], 'StartPolicyGenerationResponse' => [ 'base' => NULL, 'refs' => [], ], 'StartResourceScanRequest' => [ 'base' => '<p>Starts a scan of the policies applied to the specified resource.</p>', 'refs' => [], ], 'StatusReason' => [ 'base' => '<p>Provides more details about the current status of the analyzer. For example, if the creation for the analyzer fails, a <code>Failed</code> status is returned. For an analyzer with organization as the type, this failure can be due to an issue with creating the service-linked roles required in the member accounts of the Amazon Web Services organization.</p>', 'refs' => [ 'AnalyzerSummary$statusReason' => '<p>The <code>statusReason</code> provides more details about the current status of the analyzer. For example, if the creation for the analyzer fails, a <code>Failed</code> status is returned. For an analyzer with organization as the type, this failure can be due to an issue with creating the service-linked roles required in the member accounts of the Amazon Web Services organization.</p>', ], ], 'String' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$message' => NULL, 'AccessPreviewFinding$resource' => '<p>The resource that an external principal has access to. This is the resource associated with the access preview.</p>', 'AccessPreviewFinding$resourceOwnerAccount' => '<p>The Amazon Web Services account ID that owns the resource. For most Amazon Web Services resources, the owning account is the account in which the resource was created.</p>', 'AccessPreviewFinding$error' => '<p>An error.</p>', 'ActionList$member' => NULL, 'AnalyzedResource$resourceOwnerAccount' => '<p>The Amazon Web Services account ID that owns the resource.</p>', 'AnalyzedResource$error' => '<p>An error message.</p>', 'AnalyzedResourceSummary$resourceOwnerAccount' => '<p>The Amazon Web Services account ID that owns the resource.</p>', 'AnalyzerSummary$lastResourceAnalyzed' => '<p>The resource that was most recently analyzed by the analyzer.</p>', 'ApplyArchiveRuleRequest$clientToken' => '<p>A client token.</p>', 'ConditionKeyMap$key' => NULL, 'ConditionKeyMap$value' => NULL, 'ConflictException$message' => NULL, 'ConflictException$resourceId' => '<p>The ID of the resource.</p>', 'ConflictException$resourceType' => '<p>The resource type.</p>', 'CreateAccessPreviewRequest$clientToken' => '<p>A client token.</p>', 'CreateAnalyzerRequest$clientToken' => '<p>A client token.</p>', 'CreateArchiveRuleRequest$clientToken' => '<p>A client token.</p>', 'DeleteAnalyzerRequest$clientToken' => '<p>A client token.</p>', 'DeleteArchiveRuleRequest$clientToken' => '<p>A client token.</p>', 'FilterCriteriaMap$key' => NULL, 'Finding$resource' => '<p>The resource that an external principal has access to.</p>', 'Finding$resourceOwnerAccount' => '<p>The Amazon Web Services account ID that owns the resource.</p>', 'Finding$error' => '<p>An error.</p>', 'FindingSourceDetail$accessPointArn' => '<p>The ARN of the access point that generated the finding. The ARN format depends on whether the ARN represents an access point or a multi-region access point.</p>', 'FindingSourceDetail$accessPointAccount' => '<p>The account of the cross-account access point that generated the finding.</p>', 'FindingSummary$resource' => '<p>The resource that the external principal has access to.</p>', 'FindingSummary$resourceOwnerAccount' => '<p>The Amazon Web Services account ID that owns the resource.</p>', 'FindingSummary$error' => '<p>The error that resulted in an Error finding.</p>', 'GeneratedPolicy$policy' => '<p>The text to use as the content for the new policy. The policy is created using the <a href=\"https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreatePolicy.html\">CreatePolicy</a> action.</p>', 'InternalServerException$message' => NULL, 'JobError$message' => '<p>Specific information about the error. For example, which service quota was exceeded or which resource was not found.</p>', 'ListTagsForResourceRequest$resourceArn' => '<p>The ARN of the resource to retrieve tags from.</p>', 'PathElement$key' => '<p>Refers to a key in a JSON object.</p>', 'PathElement$value' => '<p>Refers to the value associated with a given key in a JSON object.</p>', 'PrincipalMap$key' => NULL, 'PrincipalMap$value' => NULL, 'RegionList$member' => NULL, 'ResourceNotFoundException$message' => NULL, 'ResourceNotFoundException$resourceId' => '<p>The ID of the resource.</p>', 'ResourceNotFoundException$resourceType' => '<p>The type of the resource.</p>', 'ServiceQuotaExceededException$message' => NULL, 'ServiceQuotaExceededException$resourceId' => '<p>The resource ID.</p>', 'ServiceQuotaExceededException$resourceType' => '<p>The resource type.</p>', 'SharedViaList$member' => NULL, 'SortCriteria$attributeName' => '<p>The name of the attribute to sort on.</p>', 'StartPolicyGenerationRequest$clientToken' => '<p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p> <p>If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.</p>', 'StartResourceScanRequest$resourceOwnerAccount' => '<p>The Amazon Web Services account ID that owns the resource. For most Amazon Web Services resources, the owning account is the account in which the resource was created.</p>', 'TagKeys$member' => NULL, 'TagResourceRequest$resourceArn' => '<p>The ARN of the resource to add the tag to.</p>', 'TagsMap$key' => NULL, 'TagsMap$value' => NULL, 'ThrottlingException$message' => NULL, 'UntagResourceRequest$resourceArn' => '<p>The ARN of the resource to remove the tag from.</p>', 'UpdateArchiveRuleRequest$clientToken' => '<p>A client token.</p>', 'UpdateFindingsRequest$clientToken' => '<p>A client token.</p>', 'ValidatePolicyFinding$findingDetails' => '<p>A localized message that explains the finding and provides guidance on how to address it.</p>', 'ValidationException$message' => NULL, 'ValidationExceptionField$name' => '<p>The name of the validation exception.</p>', 'ValidationExceptionField$message' => '<p>A message about the validation exception.</p>', 'ValueList$member' => NULL, ], ], 'Substring' => [ 'base' => '<p>A reference to a substring of a literal string in a JSON document.</p>', 'refs' => [ 'PathElement$substring' => '<p>Refers to a substring of a literal string in a JSON object.</p>', ], ], 'TagKeys' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$tagKeys' => '<p>The key for the tag to add.</p>', ], ], 'TagResourceRequest' => [ 'base' => '<p>Adds a tag to the specified resource.</p>', 'refs' => [], ], 'TagResourceResponse' => [ 'base' => '<p>The response to the request.</p>', 'refs' => [], ], 'TagsMap' => [ 'base' => NULL, 'refs' => [ 'AnalyzerSummary$tags' => '<p>The tags added to the analyzer.</p>', 'CreateAnalyzerRequest$tags' => '<p>The tags to apply to the analyzer.</p>', 'ListTagsForResourceResponse$tags' => '<p>The tags that are applied to the specified resource.</p>', 'TagResourceRequest$tags' => '<p>The tags to add to the resource.</p>', ], ], 'ThrottlingException' => [ 'base' => '<p>Throttling limit exceeded error.</p>', 'refs' => [], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [ 'AccessPreview$createdAt' => '<p>The time at which the access preview was created.</p>', 'AccessPreviewFinding$createdAt' => '<p>The time at which the access preview finding was created.</p>', 'AccessPreviewSummary$createdAt' => '<p>The time at which the access preview was created.</p>', 'AnalyzedResource$createdAt' => '<p>The time at which the finding was created.</p>', 'AnalyzedResource$analyzedAt' => '<p>The time at which the resource was analyzed.</p>', 'AnalyzedResource$updatedAt' => '<p>The time at which the finding was updated.</p>', 'AnalyzerSummary$createdAt' => '<p>A timestamp for the time at which the analyzer was created.</p>', 'AnalyzerSummary$lastResourceAnalyzedAt' => '<p>The time at which the most recently analyzed resource was analyzed.</p>', 'ArchiveRuleSummary$createdAt' => '<p>The time at which the archive rule was created.</p>', 'ArchiveRuleSummary$updatedAt' => '<p>The time at which the archive rule was last updated.</p>', 'CloudTrailDetails$startTime' => '<p>The start of the time range for which IAM Access Analyzer reviews your CloudTrail events. Events with a timestamp before this time are not considered to generate a policy.</p>', 'CloudTrailDetails$endTime' => '<p>The end of the time range for which IAM Access Analyzer reviews your CloudTrail events. Events with a timestamp after this time are not considered to generate a policy. If this is not included in the request, the default value is the current time.</p>', 'CloudTrailProperties$startTime' => '<p>The start of the time range for which IAM Access Analyzer reviews your CloudTrail events. Events with a timestamp before this time are not considered to generate a policy.</p>', 'CloudTrailProperties$endTime' => '<p>The end of the time range for which IAM Access Analyzer reviews your CloudTrail events. Events with a timestamp after this time are not considered to generate a policy. If this is not included in the request, the default value is the current time.</p>', 'Finding$createdAt' => '<p>The time at which the finding was generated.</p>', 'Finding$analyzedAt' => '<p>The time at which the resource was analyzed.</p>', 'Finding$updatedAt' => '<p>The time at which the finding was updated.</p>', 'FindingSummary$createdAt' => '<p>The time at which the finding was created.</p>', 'FindingSummary$analyzedAt' => '<p>The time at which the resource-based policy that generated the finding was analyzed.</p>', 'FindingSummary$updatedAt' => '<p>The time at which the finding was most recently updated.</p>', 'JobDetails$startedOn' => '<p>A timestamp of when the job was started.</p>', 'JobDetails$completedOn' => '<p>A timestamp of when the job was completed.</p>', 'PolicyGeneration$startedOn' => '<p>A timestamp of when the policy generation started.</p>', 'PolicyGeneration$completedOn' => '<p>A timestamp of when the policy generation was completed.</p>', ], ], 'Token' => [ 'base' => NULL, 'refs' => [ 'ListAccessPreviewFindingsRequest$nextToken' => '<p>A token used for pagination of results returned.</p>', 'ListAccessPreviewFindingsResponse$nextToken' => '<p>A token used for pagination of results returned.</p>', 'ListAccessPreviewsRequest$nextToken' => '<p>A token used for pagination of results returned.</p>', 'ListAccessPreviewsResponse$nextToken' => '<p>A token used for pagination of results returned.</p>', 'ListAnalyzedResourcesRequest$nextToken' => '<p>A token used for pagination of results returned.</p>', 'ListAnalyzedResourcesResponse$nextToken' => '<p>A token used for pagination of results returned.</p>', 'ListAnalyzersRequest$nextToken' => '<p>A token used for pagination of results returned.</p>', 'ListAnalyzersResponse$nextToken' => '<p>A token used for pagination of results returned.</p>', 'ListArchiveRulesRequest$nextToken' => '<p>A token used for pagination of results returned.</p>', 'ListArchiveRulesResponse$nextToken' => '<p>A token used for pagination of results returned.</p>', 'ListFindingsRequest$nextToken' => '<p>A token used for pagination of results returned.</p>', 'ListFindingsResponse$nextToken' => '<p>A token used for pagination of results returned.</p>', 'ListPolicyGenerationsRequest$nextToken' => '<p>A token used for pagination of results returned.</p>', 'ListPolicyGenerationsResponse$nextToken' => '<p>A token used for pagination of results returned.</p>', 'ValidatePolicyRequest$nextToken' => '<p>A token used for pagination of results returned.</p>', 'ValidatePolicyResponse$nextToken' => '<p>A token used for pagination of results returned.</p>', ], ], 'Trail' => [ 'base' => '<p>Contains details about the CloudTrail trail being analyzed to generate a policy.</p>', 'refs' => [ 'TrailList$member' => NULL, ], ], 'TrailList' => [ 'base' => NULL, 'refs' => [ 'CloudTrailDetails$trails' => '<p>A <code>Trail</code> object that contains settings for a trail.</p>', ], ], 'TrailProperties' => [ 'base' => '<p>Contains details about the CloudTrail trail being analyzed to generate a policy.</p>', 'refs' => [ 'TrailPropertiesList$member' => NULL, ], ], 'TrailPropertiesList' => [ 'base' => NULL, 'refs' => [ 'CloudTrailProperties$trailProperties' => '<p>A <code>TrailProperties</code> object that contains settings for trail properties.</p>', ], ], 'Type' => [ 'base' => NULL, 'refs' => [ 'AnalyzerSummary$type' => '<p>The type of analyzer, which corresponds to the zone of trust chosen for the analyzer.</p>', 'CreateAnalyzerRequest$type' => '<p>The type of analyzer to create. Only ACCOUNT and ORGANIZATION analyzers are supported. You can create only one analyzer per account per Region. You can create up to 5 analyzers per organization per Region.</p>', 'ListAnalyzersRequest$type' => '<p>The type of analyzer.</p>', ], ], 'UntagResourceRequest' => [ 'base' => '<p>Removes a tag from the specified resource.</p>', 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => '<p>The response to the request.</p>', 'refs' => [], ], 'UpdateArchiveRuleRequest' => [ 'base' => '<p>Updates the specified archive rule.</p>', 'refs' => [], ], 'UpdateFindingsRequest' => [ 'base' => '<p>Updates findings with the new values provided in the request.</p>', 'refs' => [], ], 'ValidatePolicyFinding' => [ 'base' => '<p>A finding in a policy. Each finding is an actionable recommendation that can be used to improve the policy.</p>', 'refs' => [ 'ValidatePolicyFindingList$member' => NULL, ], ], 'ValidatePolicyFindingList' => [ 'base' => NULL, 'refs' => [ 'ValidatePolicyResponse$findings' => '<p>The list of findings in a policy returned by IAM Access Analyzer based on its suite of policy checks.</p>', ], ], 'ValidatePolicyFindingType' => [ 'base' => NULL, 'refs' => [ 'ValidatePolicyFinding$findingType' => '<p>The impact of the finding.</p> <p>Security warnings report when the policy allows access that we consider overly permissive.</p> <p>Errors report when a part of the policy is not functional.</p> <p>Warnings report non-security issues when a policy does not conform to policy writing best practices.</p> <p>Suggestions recommend stylistic improvements in the policy that do not impact access.</p>', ], ], 'ValidatePolicyRequest' => [ 'base' => NULL, 'refs' => [], ], 'ValidatePolicyResourceType' => [ 'base' => NULL, 'refs' => [ 'ValidatePolicyRequest$validatePolicyResourceType' => '<p>The type of resource to attach to your resource policy. Specify a value for the policy validation resource type only if the policy type is <code>RESOURCE_POLICY</code>. For example, to validate a resource policy to attach to an Amazon S3 bucket, you can choose <code>AWS::S3::Bucket</code> for the policy validation resource type.</p> <p>For resource types not supported as valid values, IAM Access Analyzer runs policy checks that apply to all resource policies. For example, to validate a resource policy to attach to a KMS key, do not specify a value for the policy validation resource type and IAM Access Analyzer will run policy checks that apply to all resource policies.</p>', ], ], 'ValidatePolicyResponse' => [ 'base' => NULL, 'refs' => [], ], 'ValidationException' => [ 'base' => '<p>Validation exception error.</p>', 'refs' => [], ], 'ValidationExceptionField' => [ 'base' => '<p>Contains information about a validation exception.</p>', 'refs' => [ 'ValidationExceptionFieldList$member' => NULL, ], ], 'ValidationExceptionFieldList' => [ 'base' => NULL, 'refs' => [ 'ValidationException$fieldList' => '<p>A list of fields that didn\\'t validate.</p>', ], ], 'ValidationExceptionReason' => [ 'base' => NULL, 'refs' => [ 'ValidationException$reason' => '<p>The reason for the exception.</p>', ], ], 'ValueList' => [ 'base' => NULL, 'refs' => [ 'Criterion$eq' => '<p>An \"equals\" operator to match for the filter used to create the rule.</p>', 'Criterion$neq' => '<p>A \"not equals\" operator to match for the filter used to create the rule.</p>', 'Criterion$contains' => '<p>A \"contains\" operator to match for the filter used to create the rule.</p>', ], ], 'VpcConfiguration' => [ 'base' => '<p>The proposed virtual private cloud (VPC) configuration for the Amazon S3 access point. VPC configuration does not apply to multi-region access points. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_VpcConfiguration.html\">VpcConfiguration</a>. </p>', 'refs' => [ 'NetworkOriginConfiguration$vpcConfiguration' => NULL, ], ], 'VpcId' => [ 'base' => NULL, 'refs' => [ 'VpcConfiguration$vpcId' => '<p> If this field is specified, this access point will only allow connections from the specified VPC ID. </p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/accessanalyzer/2019-11-01/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => true, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://access-analyzer-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ 'aws-us-gov', [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], ], ], ], 'endpoint' => [ 'url' => 'https://access-analyzer.{Region}.amazonaws.com', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://access-analyzer-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://access-analyzer.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'ref' => 'Region', ], 'us-gov-east-1', ], ], ], 'endpoint' => [ 'url' => 'https://access-analyzer.us-gov-east-1.amazonaws.com', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'ref' => 'Region', ], 'us-gov-west-1', ], ], ], 'endpoint' => [ 'url' => 'https://access-analyzer.us-gov-west-1.amazonaws.com', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://access-analyzer.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/accessanalyzer/2019-11-01/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.af-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'af-south-1', ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.ap-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ap-east-1', ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ap-northeast-1', ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ap-northeast-2', ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ap-northeast-3', ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.ap-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ap-south-1', ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ap-southeast-1', ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ap-southeast-2', ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ap-southeast-3', ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.ca-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ca-central-1', ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer-fips.ca-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'ca-central-1', ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.eu-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'eu-central-1', ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.eu-north-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'eu-north-1', ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.eu-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'eu-south-1', ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.eu-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'eu-west-1', ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.eu-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'eu-west-2', ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.eu-west-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'eu-west-3', ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.me-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'me-south-1', ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.sa-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'sa-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-east-2', ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-east-2', ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.us-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-west-1', ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-west-1', ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-west-2', ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-west-2', ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer-fips.us-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.us-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'cn-north-1', ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'cn-northwest-1', ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'cn-north-1', ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'cn-north-1', ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'cn-north-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-gov-west-1', ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-gov-west-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-iso-east-1', ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-iso-east-1', ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-isob-east-1', ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://access-analyzer.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-isob-east-1', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/accessanalyzer/2019-11-01/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/accessanalyzer/2019-11-01/paginators-1.json\nreturn [ 'pagination' => [ 'ListAccessPreviewFindings' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'findings', ], 'ListAccessPreviews' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'accessPreviews', ], 'ListAnalyzedResources' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'analyzedResources', ], 'ListAnalyzers' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'analyzers', ], 'ListArchiveRules' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'archiveRules', ], 'ListFindings' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'findings', ], 'ListPolicyGenerations' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'policyGenerations', ], 'ValidatePolicy' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'findings', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/account/2021-02-01/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2021-02-01', 'endpointPrefix' => 'account', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'AWS Account', 'serviceId' => 'Account', 'signatureVersion' => 'v4', 'signingName' => 'account', 'uid' => 'account-2021-02-01', ], 'operations' => [ 'DeleteAlternateContact' => [ 'name' => 'DeleteAlternateContact', 'http' => [ 'method' => 'POST', 'requestUri' => '/deleteAlternateContact', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteAlternateContactRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'DisableRegion' => [ 'name' => 'DisableRegion', 'http' => [ 'method' => 'POST', 'requestUri' => '/disableRegion', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DisableRegionRequest', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'InternalServerException', ], ], ], 'EnableRegion' => [ 'name' => 'EnableRegion', 'http' => [ 'method' => 'POST', 'requestUri' => '/enableRegion', 'responseCode' => 200, ], 'input' => [ 'shape' => 'EnableRegionRequest', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetAlternateContact' => [ 'name' => 'GetAlternateContact', 'http' => [ 'method' => 'POST', 'requestUri' => '/getAlternateContact', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetAlternateContactRequest', ], 'output' => [ 'shape' => 'GetAlternateContactResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetContactInformation' => [ 'name' => 'GetContactInformation', 'http' => [ 'method' => 'POST', 'requestUri' => '/getContactInformation', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetContactInformationRequest', ], 'output' => [ 'shape' => 'GetContactInformationResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetRegionOptStatus' => [ 'name' => 'GetRegionOptStatus', 'http' => [ 'method' => 'POST', 'requestUri' => '/getRegionOptStatus', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetRegionOptStatusRequest', ], 'output' => [ 'shape' => 'GetRegionOptStatusResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListRegions' => [ 'name' => 'ListRegions', 'http' => [ 'method' => 'POST', 'requestUri' => '/listRegions', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListRegionsRequest', ], 'output' => [ 'shape' => 'ListRegionsResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'InternalServerException', ], ], ], 'PutAlternateContact' => [ 'name' => 'PutAlternateContact', 'http' => [ 'method' => 'POST', 'requestUri' => '/putAlternateContact', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutAlternateContactRequest', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'PutContactInformation' => [ 'name' => 'PutContactInformation', 'http' => [ 'method' => 'POST', 'requestUri' => '/putContactInformation', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutContactInformationRequest', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 403, 'senderFault' => true, ], 'exception' => true, ], 'AccountId' => [ 'type' => 'string', 'pattern' => '^\\\\d{12}$', ], 'AddressLine' => [ 'type' => 'string', 'max' => 60, 'min' => 1, 'sensitive' => true, ], 'AlternateContact' => [ 'type' => 'structure', 'members' => [ 'AlternateContactType' => [ 'shape' => 'AlternateContactType', ], 'EmailAddress' => [ 'shape' => 'EmailAddress', ], 'Name' => [ 'shape' => 'Name', ], 'PhoneNumber' => [ 'shape' => 'PhoneNumber', ], 'Title' => [ 'shape' => 'Title', ], ], ], 'AlternateContactType' => [ 'type' => 'string', 'enum' => [ 'BILLING', 'OPERATIONS', 'SECURITY', ], ], 'City' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'sensitive' => true, ], 'CompanyName' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'sensitive' => true, ], 'ConflictException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'ContactInformation' => [ 'type' => 'structure', 'required' => [ 'AddressLine1', 'City', 'CountryCode', 'FullName', 'PhoneNumber', 'PostalCode', ], 'members' => [ 'AddressLine1' => [ 'shape' => 'AddressLine', ], 'AddressLine2' => [ 'shape' => 'AddressLine', ], 'AddressLine3' => [ 'shape' => 'AddressLine', ], 'City' => [ 'shape' => 'City', ], 'CompanyName' => [ 'shape' => 'CompanyName', ], 'CountryCode' => [ 'shape' => 'CountryCode', ], 'DistrictOrCounty' => [ 'shape' => 'DistrictOrCounty', ], 'FullName' => [ 'shape' => 'FullName', ], 'PhoneNumber' => [ 'shape' => 'ContactInformationPhoneNumber', ], 'PostalCode' => [ 'shape' => 'PostalCode', ], 'StateOrRegion' => [ 'shape' => 'StateOrRegion', ], 'WebsiteUrl' => [ 'shape' => 'WebsiteUrl', ], ], ], 'ContactInformationPhoneNumber' => [ 'type' => 'string', 'max' => 20, 'min' => 1, 'pattern' => '^[+][\\\\s0-9()-]+$', 'sensitive' => true, ], 'CountryCode' => [ 'type' => 'string', 'max' => 2, 'min' => 2, 'sensitive' => true, ], 'DeleteAlternateContactRequest' => [ 'type' => 'structure', 'required' => [ 'AlternateContactType', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'AlternateContactType' => [ 'shape' => 'AlternateContactType', ], ], ], 'DisableRegionRequest' => [ 'type' => 'structure', 'required' => [ 'RegionName', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'RegionName' => [ 'shape' => 'RegionName', ], ], ], 'DistrictOrCounty' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'sensitive' => true, ], 'EmailAddress' => [ 'type' => 'string', 'max' => 254, 'min' => 1, 'pattern' => '^[\\\\s]*[\\\\w+=.#|!&-]+@[\\\\w.-]+\\\\.[\\\\w]+[\\\\s]*$', 'sensitive' => true, ], 'EnableRegionRequest' => [ 'type' => 'structure', 'required' => [ 'RegionName', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'RegionName' => [ 'shape' => 'RegionName', ], ], ], 'FullName' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'sensitive' => true, ], 'GetAlternateContactRequest' => [ 'type' => 'structure', 'required' => [ 'AlternateContactType', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'AlternateContactType' => [ 'shape' => 'AlternateContactType', ], ], ], 'GetAlternateContactResponse' => [ 'type' => 'structure', 'members' => [ 'AlternateContact' => [ 'shape' => 'AlternateContact', ], ], ], 'GetContactInformationRequest' => [ 'type' => 'structure', 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], ], ], 'GetContactInformationResponse' => [ 'type' => 'structure', 'members' => [ 'ContactInformation' => [ 'shape' => 'ContactInformation', ], ], ], 'GetRegionOptStatusRequest' => [ 'type' => 'structure', 'required' => [ 'RegionName', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'RegionName' => [ 'shape' => 'RegionName', ], ], ], 'GetRegionOptStatusResponse' => [ 'type' => 'structure', 'members' => [ 'RegionName' => [ 'shape' => 'RegionName', ], 'RegionOptStatus' => [ 'shape' => 'RegionOptStatus', ], ], ], 'InternalServerException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, 'retryable' => [ 'throttling' => false, ], ], 'ListRegionsRequest' => [ 'type' => 'structure', 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'MaxResults' => [ 'shape' => 'ListRegionsRequestMaxResultsInteger', ], 'NextToken' => [ 'shape' => 'ListRegionsRequestNextTokenString', ], 'RegionOptStatusContains' => [ 'shape' => 'RegionOptStatusList', ], ], ], 'ListRegionsRequestMaxResultsInteger' => [ 'type' => 'integer', 'box' => true, 'max' => 50, 'min' => 1, ], 'ListRegionsRequestNextTokenString' => [ 'type' => 'string', 'max' => 1000, 'min' => 0, ], 'ListRegionsResponse' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'String', ], 'Regions' => [ 'shape' => 'RegionOptList', ], ], ], 'Name' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'sensitive' => true, ], 'PhoneNumber' => [ 'type' => 'string', 'max' => 25, 'min' => 1, 'pattern' => '^[\\\\s0-9()+-]+$', 'sensitive' => true, ], 'PostalCode' => [ 'type' => 'string', 'max' => 20, 'min' => 1, 'sensitive' => true, ], 'PutAlternateContactRequest' => [ 'type' => 'structure', 'required' => [ 'AlternateContactType', 'EmailAddress', 'Name', 'PhoneNumber', 'Title', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'AlternateContactType' => [ 'shape' => 'AlternateContactType', ], 'EmailAddress' => [ 'shape' => 'EmailAddress', ], 'Name' => [ 'shape' => 'Name', ], 'PhoneNumber' => [ 'shape' => 'PhoneNumber', ], 'Title' => [ 'shape' => 'Title', ], ], ], 'PutContactInformationRequest' => [ 'type' => 'structure', 'required' => [ 'ContactInformation', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'ContactInformation' => [ 'shape' => 'ContactInformation', ], ], ], 'Region' => [ 'type' => 'structure', 'members' => [ 'RegionName' => [ 'shape' => 'RegionName', ], 'RegionOptStatus' => [ 'shape' => 'RegionOptStatus', ], ], ], 'RegionName' => [ 'type' => 'string', 'max' => 50, 'min' => 1, ], 'RegionOptList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Region', ], ], 'RegionOptStatus' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'ENABLING', 'DISABLING', 'DISABLED', 'ENABLED_BY_DEFAULT', ], ], 'RegionOptStatusList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RegionOptStatus', ], ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'SensitiveString' => [ 'type' => 'string', 'sensitive' => true, ], 'StateOrRegion' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'sensitive' => true, ], 'String' => [ 'type' => 'string', ], 'Title' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'sensitive' => true, ], 'TooManyRequestsException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 429, 'senderFault' => true, ], 'exception' => true, 'retryable' => [ 'throttling' => true, ], ], 'ValidationException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'fieldList' => [ 'shape' => 'ValidationExceptionFieldList', ], 'message' => [ 'shape' => 'SensitiveString', ], 'reason' => [ 'shape' => 'ValidationExceptionReason', ], ], 'error' => [ 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'ValidationExceptionField' => [ 'type' => 'structure', 'required' => [ 'message', 'name', ], 'members' => [ 'message' => [ 'shape' => 'SensitiveString', ], 'name' => [ 'shape' => 'String', ], ], ], 'ValidationExceptionFieldList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ValidationExceptionField', ], ], 'ValidationExceptionReason' => [ 'type' => 'string', 'enum' => [ 'invalidRegionOptTarget', 'fieldValidationFailed', ], ], 'WebsiteUrl' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'sensitive' => true, ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/account/2021-02-01/defaults-1.json\nreturn [ 'added' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/account/2021-02-01/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>Operations for Amazon Web Services Account Management</p>', 'operations' => [ 'DeleteAlternateContact' => '<p>Deletes the specified alternate contact from an Amazon Web Services account.</p> <p>For complete details about how to use the alternate contact operations, see <a href=\"https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html\">Access or updating the alternate contacts</a>.</p> <note> <p>Before you can update the alternate contact information for an Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management and Organizations. For more information, see <a href=\"https://docs.aws.amazon.com/accounts/latest/reference/using-orgs-trusted-access.html\">Enabling trusted access for Amazon Web Services Account Management</a>.</p> </note>', 'DisableRegion' => '<p>Disables (opts-out) a particular Region for an account.</p>', 'EnableRegion' => '<p>Enables (opts-in) a particular Region for an account.</p>', 'GetAlternateContact' => '<p>Retrieves the specified alternate contact attached to an Amazon Web Services account.</p> <p>For complete details about how to use the alternate contact operations, see <a href=\"https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html\">Access or updating the alternate contacts</a>.</p> <note> <p>Before you can update the alternate contact information for an Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management and Organizations. For more information, see <a href=\"https://docs.aws.amazon.com/accounts/latest/reference/using-orgs-trusted-access.html\">Enabling trusted access for Amazon Web Services Account Management</a>.</p> </note>', 'GetContactInformation' => '<p>Retrieves the primary contact information of an Amazon Web Services account.</p> <p>For complete details about how to use the primary contact operations, see <a href=\"https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html\">Update the primary and alternate contact information</a>.</p>', 'GetRegionOptStatus' => '<p>Retrieves the opt-in status of a particular Region.</p>', 'ListRegions' => '<p>Lists all the Regions for a given account and their respective opt-in statuses. Optionally, this list can be filtered by the <code>region-opt-status-contains</code> parameter. </p>', 'PutAlternateContact' => '<p>Modifies the specified alternate contact attached to an Amazon Web Services account.</p> <p>For complete details about how to use the alternate contact operations, see <a href=\"https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html\">Access or updating the alternate contacts</a>.</p> <note> <p>Before you can update the alternate contact information for an Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management and Organizations. For more information, see <a href=\"https://docs.aws.amazon.com/accounts/latest/reference/using-orgs-trusted-access.html\">Enabling trusted access for Amazon Web Services Account Management</a>.</p> </note>', 'PutContactInformation' => '<p>Updates the primary contact information of an Amazon Web Services account.</p> <p>For complete details about how to use the primary contact operations, see <a href=\"https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html\">Update the primary and alternate contact information</a>.</p>', ], 'shapes' => [ 'AccessDeniedException' => [ 'base' => '<p>The operation failed because the calling identity doesn\\'t have the minimum required permissions.</p>', 'refs' => [], ], 'AccountId' => [ 'base' => NULL, 'refs' => [ 'DeleteAlternateContactRequest$AccountId' => '<p>Specifies the 12 digit account ID number of the Amazon Web Services account that you want to access or modify with this operation.</p> <p>If you do not specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation.</p> <p>To use this parameter, the caller must be an identity in the <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#account\">organization\\'s management account</a> or a delegated administrator account, and the specified account ID must be a member account in the same organization. The organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html\">all features enabled</a>, and the organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-trusted-access.html\">trusted access</a> enabled for the Account Management service, and optionally a <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-delegated-admin.html\">delegated admin</a> account assigned.</p> <note> <p>The management account can\\'t specify its own <code>AccountId</code>; it must call the operation in standalone context by not including the <code>AccountId</code> parameter.</p> </note> <p>To call this operation on an account that is not a member of an organization, then don\\'t specify this parameter, and call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify.</p>', 'DisableRegionRequest$AccountId' => '<p>Specifies the 12-digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you don\\'t specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#account\">organization\\'s management account</a> or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html\">all features enabled</a>, and the organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-trusted-access.html\">trusted access</a> enabled for the Account Management service, and optionally a <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-delegated-admin.html\">delegated admin</a> account assigned.</p> <note> <p>The management account can\\'t specify its own <code>AccountId</code>. It must call the operation in standalone context by not including the <code>AccountId</code> parameter.</p> </note> <p>To call this operation on an account that is not a member of an organization, don\\'t specify this parameter. Instead, call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify.</p>', 'EnableRegionRequest$AccountId' => '<p>Specifies the 12-digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you don\\'t specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#account\">organization\\'s management account</a> or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html\">all features enabled</a>, and the organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-trusted-access.html\">trusted access</a> enabled for the Account Management service, and optionally a <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-delegated-admin.html\">delegated admin</a> account assigned.</p> <note> <p>The management account can\\'t specify its own <code>AccountId</code>. It must call the operation in standalone context by not including the <code>AccountId</code> parameter.</p> </note> <p>To call this operation on an account that is not a member of an organization, don\\'t specify this parameter. Instead, call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify.</p>', 'GetAlternateContactRequest$AccountId' => '<p>Specifies the 12 digit account ID number of the Amazon Web Services account that you want to access or modify with this operation.</p> <p>If you do not specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation.</p> <p>To use this parameter, the caller must be an identity in the <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#account\">organization\\'s management account</a> or a delegated administrator account, and the specified account ID must be a member account in the same organization. The organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html\">all features enabled</a>, and the organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-trusted-access.html\">trusted access</a> enabled for the Account Management service, and optionally a <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-delegated-admin.html\">delegated admin</a> account assigned.</p> <note> <p>The management account can\\'t specify its own <code>AccountId</code>; it must call the operation in standalone context by not including the <code>AccountId</code> parameter.</p> </note> <p>To call this operation on an account that is not a member of an organization, then don\\'t specify this parameter, and call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify.</p>', 'GetContactInformationRequest$AccountId' => '<p>Specifies the 12-digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you don\\'t specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#account\">organization\\'s management account</a> or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html\">all features enabled</a>, and the organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-trusted-access.html\">trusted access</a> enabled for the Account Management service, and optionally a <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-delegated-admin.html\">delegated admin</a> account assigned.</p> <note> <p>The management account can\\'t specify its own <code>AccountId</code>. It must call the operation in standalone context by not including the <code>AccountId</code> parameter.</p> </note> <p>To call this operation on an account that is not a member of an organization, don\\'t specify this parameter. Instead, call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify.</p>', 'GetRegionOptStatusRequest$AccountId' => '<p>Specifies the 12-digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you don\\'t specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#account\">organization\\'s management account</a> or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html\">all features enabled</a>, and the organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-trusted-access.html\">trusted access</a> enabled for the Account Management service, and optionally a <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-delegated-admin.html\">delegated admin</a> account assigned.</p> <note> <p>The management account can\\'t specify its own <code>AccountId</code>. It must call the operation in standalone context by not including the <code>AccountId</code> parameter.</p> </note> <p>To call this operation on an account that is not a member of an organization, don\\'t specify this parameter. Instead, call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify.</p>', 'ListRegionsRequest$AccountId' => '<p>Specifies the 12-digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you don\\'t specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#account\">organization\\'s management account</a> or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html\">all features enabled</a>, and the organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-trusted-access.html\">trusted access</a> enabled for the Account Management service, and optionally a <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-delegated-admin.html\">delegated admin</a> account assigned.</p> <note> <p>The management account can\\'t specify its own <code>AccountId</code>. It must call the operation in standalone context by not including the <code>AccountId</code> parameter.</p> </note> <p>To call this operation on an account that is not a member of an organization, don\\'t specify this parameter. Instead, call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify.</p>', 'PutAlternateContactRequest$AccountId' => '<p>Specifies the 12 digit account ID number of the Amazon Web Services account that you want to access or modify with this operation.</p> <p>If you do not specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation.</p> <p>To use this parameter, the caller must be an identity in the <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#account\">organization\\'s management account</a> or a delegated administrator account, and the specified account ID must be a member account in the same organization. The organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html\">all features enabled</a>, and the organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-trusted-access.html\">trusted access</a> enabled for the Account Management service, and optionally a <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-delegated-admin.html\">delegated admin</a> account assigned.</p> <note> <p>The management account can\\'t specify its own <code>AccountId</code>; it must call the operation in standalone context by not including the <code>AccountId</code> parameter.</p> </note> <p>To call this operation on an account that is not a member of an organization, then don\\'t specify this parameter, and call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify.</p>', 'PutContactInformationRequest$AccountId' => '<p>Specifies the 12-digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you don\\'t specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#account\">organization\\'s management account</a> or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html\">all features enabled</a>, and the organization must have <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-trusted-access.html\">trusted access</a> enabled for the Account Management service, and optionally a <a href=\"https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-delegated-admin.html\">delegated admin</a> account assigned.</p> <note> <p>The management account can\\'t specify its own <code>AccountId</code>. It must call the operation in standalone context by not including the <code>AccountId</code> parameter.</p> </note> <p>To call this operation on an account that is not a member of an organization, don\\'t specify this parameter. Instead, call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify.</p>', ], ], 'AddressLine' => [ 'base' => NULL, 'refs' => [ 'ContactInformation$AddressLine1' => '<p>The first line of the primary contact address.</p>', 'ContactInformation$AddressLine2' => '<p>The second line of the primary contact address, if any.</p>', 'ContactInformation$AddressLine3' => '<p>The third line of the primary contact address, if any.</p>', ], ], 'AlternateContact' => [ 'base' => '<p>A structure that contains the details of an alternate contact associated with an Amazon Web Services account</p>', 'refs' => [ 'GetAlternateContactResponse$AlternateContact' => '<p>A structure that contains the details for the specified alternate contact.</p>', ], ], 'AlternateContactType' => [ 'base' => NULL, 'refs' => [ 'AlternateContact$AlternateContactType' => '<p>The type of alternate contact.</p>', 'DeleteAlternateContactRequest$AlternateContactType' => '<p>Specifies which of the alternate contacts to delete. </p>', 'GetAlternateContactRequest$AlternateContactType' => '<p>Specifies which alternate contact you want to retrieve.</p>', 'PutAlternateContactRequest$AlternateContactType' => '<p>Specifies which alternate contact you want to create or update.</p>', ], ], 'City' => [ 'base' => NULL, 'refs' => [ 'ContactInformation$City' => '<p>The city of the primary contact address.</p>', ], ], 'CompanyName' => [ 'base' => NULL, 'refs' => [ 'ContactInformation$CompanyName' => '<p>The name of the company associated with the primary contact information, if any.</p>', ], ], 'ConflictException' => [ 'base' => '<p>The request could not be processed because of a conflict in the current status of the resource. For example, this happens if you try to enable a Region that is currently being disabled (in a status of DISABLING).</p>', 'refs' => [], ], 'ContactInformation' => [ 'base' => '<p>Contains the details of the primary contact information associated with an Amazon Web Services account.</p>', 'refs' => [ 'GetContactInformationResponse$ContactInformation' => '<p>Contains the details of the primary contact information associated with an Amazon Web Services account.</p>', 'PutContactInformationRequest$ContactInformation' => '<p>Contains the details of the primary contact information associated with an Amazon Web Services account.</p>', ], ], 'ContactInformationPhoneNumber' => [ 'base' => NULL, 'refs' => [ 'ContactInformation$PhoneNumber' => '<p>The phone number of the primary contact information. The number will be validated and, in some countries, checked for activation.</p>', ], ], 'CountryCode' => [ 'base' => NULL, 'refs' => [ 'ContactInformation$CountryCode' => '<p>The ISO-3166 two-letter country code for the primary contact address.</p>', ], ], 'DeleteAlternateContactRequest' => [ 'base' => NULL, 'refs' => [], ], 'DisableRegionRequest' => [ 'base' => NULL, 'refs' => [], ], 'DistrictOrCounty' => [ 'base' => NULL, 'refs' => [ 'ContactInformation$DistrictOrCounty' => '<p>The district or county of the primary contact address, if any.</p>', ], ], 'EmailAddress' => [ 'base' => NULL, 'refs' => [ 'AlternateContact$EmailAddress' => '<p>The email address associated with this alternate contact.</p>', 'PutAlternateContactRequest$EmailAddress' => '<p>Specifies an email address for the alternate contact. </p>', ], ], 'EnableRegionRequest' => [ 'base' => NULL, 'refs' => [], ], 'FullName' => [ 'base' => NULL, 'refs' => [ 'ContactInformation$FullName' => '<p>The full name of the primary contact address.</p>', ], ], 'GetAlternateContactRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetAlternateContactResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetContactInformationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetContactInformationResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetRegionOptStatusRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetRegionOptStatusResponse' => [ 'base' => NULL, 'refs' => [], ], 'InternalServerException' => [ 'base' => '<p>The operation failed because of an error internal to Amazon Web Services. Try your operation again later.</p>', 'refs' => [], ], 'ListRegionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListRegionsRequestMaxResultsInteger' => [ 'base' => NULL, 'refs' => [ 'ListRegionsRequest$MaxResults' => '<p>The total number of items to return in the command\u00e2\u20ac\u2122s output. If the total number of items available is more than the value specified, a <code>NextToken</code> is provided in the command\u00e2\u20ac\u2122s output. To resume pagination, provide the <code>NextToken</code> value in the <code>starting-token</code> argument of a subsequent command. Do not use the <code>NextToken</code> response element directly outside of the Amazon Web Services CLI. For usage examples, see <a href=\"http://docs.aws.amazon.com/cli/latest/userguide/pagination.html\">Pagination</a> in the <i>Amazon Web Services Command Line Interface User Guide</i>. </p>', ], ], 'ListRegionsRequestNextTokenString' => [ 'base' => NULL, 'refs' => [ 'ListRegionsRequest$NextToken' => '<p>A token used to specify where to start paginating. This is the <code>NextToken</code> from a previously truncated response. For usage examples, see <a href=\"http://docs.aws.amazon.com/cli/latest/userguide/pagination.html\">Pagination</a> in the <i>Amazon Web Services Command Line Interface User Guide</i>.</p>', ], ], 'ListRegionsResponse' => [ 'base' => NULL, 'refs' => [], ], 'Name' => [ 'base' => NULL, 'refs' => [ 'AlternateContact$Name' => '<p>The name associated with this alternate contact.</p>', 'PutAlternateContactRequest$Name' => '<p>Specifies a name for the alternate contact.</p>', ], ], 'PhoneNumber' => [ 'base' => NULL, 'refs' => [ 'AlternateContact$PhoneNumber' => '<p>The phone number associated with this alternate contact.</p>', 'PutAlternateContactRequest$PhoneNumber' => '<p>Specifies a phone number for the alternate contact.</p>', ], ], 'PostalCode' => [ 'base' => NULL, 'refs' => [ 'ContactInformation$PostalCode' => '<p>The postal code of the primary contact address.</p>', ], ], 'PutAlternateContactRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutContactInformationRequest' => [ 'base' => NULL, 'refs' => [], ], 'Region' => [ 'base' => '<p>This is a structure that expresses the Region for a given account, consisting of a name and opt-in status.</p>', 'refs' => [ 'RegionOptList$member' => NULL, ], ], 'RegionName' => [ 'base' => NULL, 'refs' => [ 'DisableRegionRequest$RegionName' => '<p>Specifies the Region-code for a given Region name (for example, <code>af-south-1</code>). When you disable a Region, Amazon Web Services performs actions to deactivate that Region in your account, such as destroying IAM resources in the Region. This process takes a few minutes for most accounts, but this can take several hours. You cannot enable the Region until the disabling process is fully completed.</p>', 'EnableRegionRequest$RegionName' => '<p>Specifies the Region-code for a given Region name (for example, <code>af-south-1</code>). When you enable a Region, Amazon Web Services performs actions to prepare your account in that Region, such as distributing your IAM resources to the Region. This process takes a few minutes for most accounts, but it can take several hours. You cannot use the Region until this process is complete. Furthermore, you cannot disable the Region until the enabling process is fully completed.</p>', 'GetRegionOptStatusRequest$RegionName' => '<p>Specifies the Region-code for a given Region name (for example, <code>af-south-1</code>). This function will return the status of whatever Region you pass into this parameter. </p>', 'GetRegionOptStatusResponse$RegionName' => '<p>The Region code that was passed in.</p>', 'Region$RegionName' => '<p>The Region code of a given Region (for example, <code>us-east-1</code>).</p>', ], ], 'RegionOptList' => [ 'base' => NULL, 'refs' => [ 'ListRegionsResponse$Regions' => '<p>This is a list of Regions for a given account, or if the filtered parameter was used, a list of Regions that match the filter criteria set in the <code>filter</code> parameter.</p>', ], ], 'RegionOptStatus' => [ 'base' => NULL, 'refs' => [ 'GetRegionOptStatusResponse$RegionOptStatus' => '<p>One of the potential statuses a Region can undergo (Enabled, Enabling, Disabled, Disabling, Enabled_By_Default).</p>', 'Region$RegionOptStatus' => '<p>One of potential statuses a Region can undergo (Enabled, Enabling, Disabled, Disabling, Enabled_By_Default).</p>', 'RegionOptStatusList$member' => NULL, ], ], 'RegionOptStatusList' => [ 'base' => NULL, 'refs' => [ 'ListRegionsRequest$RegionOptStatusContains' => '<p>A list of Region statuses (Enabling, Enabled, Disabling, Disabled, Enabled_by_default) to use to filter the list of Regions for a given account. For example, passing in a value of ENABLING will only return a list of Regions with a Region status of ENABLING.</p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p>The operation failed because it specified a resource that can\\'t be found.</p>', 'refs' => [], ], 'SensitiveString' => [ 'base' => NULL, 'refs' => [ 'ValidationException$message' => '<p>The message that informs you about what was invalid about the request.</p>', 'ValidationExceptionField$message' => '<p>A message about the validation exception.</p>', ], ], 'StateOrRegion' => [ 'base' => NULL, 'refs' => [ 'ContactInformation$StateOrRegion' => '<p>The state or region of the primary contact address. This field is required in selected countries.</p>', ], ], 'String' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$message' => NULL, 'ConflictException$message' => NULL, 'InternalServerException$message' => NULL, 'ListRegionsResponse$NextToken' => '<p>If there is more data to be returned, this will be populated. It should be passed into the <code>next-token</code> request parameter of <code>list-regions</code>.</p>', 'ResourceNotFoundException$message' => NULL, 'TooManyRequestsException$message' => NULL, 'ValidationExceptionField$name' => '<p>The field name where the invalid entry was detected.</p>', ], ], 'Title' => [ 'base' => NULL, 'refs' => [ 'AlternateContact$Title' => '<p>The title associated with this alternate contact.</p>', 'PutAlternateContactRequest$Title' => '<p>Specifies a title for the alternate contact.</p>', ], ], 'TooManyRequestsException' => [ 'base' => '<p>The operation failed because it was called too frequently and exceeded a throttle limit.</p>', 'refs' => [], ], 'ValidationException' => [ 'base' => '<p>The operation failed because one of the input parameters was invalid.</p>', 'refs' => [], ], 'ValidationExceptionField' => [ 'base' => '<p>The input failed to meet the constraints specified by the Amazon Web Services service in a specified field.</p>', 'refs' => [ 'ValidationExceptionFieldList$member' => NULL, ], ], 'ValidationExceptionFieldList' => [ 'base' => NULL, 'refs' => [ 'ValidationException$fieldList' => '<p>The field where the invalid entry was detected.</p>', ], ], 'ValidationExceptionReason' => [ 'base' => NULL, 'refs' => [ 'ValidationException$reason' => '<p>The reason that validation failed.</p>', ], ], 'WebsiteUrl' => [ 'base' => NULL, 'refs' => [ 'ContactInformation$WebsiteUrl' => '<p>The URL of the website associated with the primary contact information, if any.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/account/2021-02-01/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], 'aws', ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], false, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], false, ], ], ], 'endpoint' => [ 'url' => 'https://account.us-east-1.amazonaws.com', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'account', 'signingRegion' => 'us-east-1', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], 'aws-cn', ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], false, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], false, ], ], ], 'endpoint' => [ 'url' => 'https://account.cn-northwest-1.amazonaws.com.cn', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'account', 'signingRegion' => 'cn-northwest-1', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://account-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://account-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://account.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://account.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/account/2021-02-01/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region aws-global with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'account', 'signingRegion' => 'us-east-1', ], ], ], 'url' => 'https://account.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'aws-global', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://account-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://account-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://account.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'account', 'signingRegion' => 'us-east-1', ], ], ], 'url' => 'https://account.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region aws-cn-global with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'account', 'signingRegion' => 'cn-northwest-1', ], ], ], 'url' => 'https://account.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'aws-cn-global', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://account-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://account-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://account.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'account', 'signingRegion' => 'cn-northwest-1', ], ], ], 'url' => 'https://account.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://account-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://account-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://account.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://account.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://account-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://account.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://account-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://account.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/account/2021-02-01/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/account/2021-02-01/paginators-1.json\nreturn [ 'pagination' => [ 'ListRegions' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'Regions', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/acm/2015-12-08/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2015-12-08', 'endpointPrefix' => 'acm', 'jsonVersion' => '1.1', 'protocol' => 'json', 'serviceAbbreviation' => 'ACM', 'serviceFullName' => 'AWS Certificate Manager', 'serviceId' => 'ACM', 'signatureVersion' => 'v4', 'targetPrefix' => 'CertificateManager', 'uid' => 'acm-2015-12-08', ], 'operations' => [ 'AddTagsToCertificate' => [ 'name' => 'AddTagsToCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AddTagsToCertificateRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidTagException', ], [ 'shape' => 'TooManyTagsException', ], [ 'shape' => 'TagPolicyException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DeleteCertificate' => [ 'name' => 'DeleteCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteCertificateRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InvalidArnException', ], ], ], 'DescribeCertificate' => [ 'name' => 'DescribeCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeCertificateRequest', ], 'output' => [ 'shape' => 'DescribeCertificateResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], ], ], 'ExportCertificate' => [ 'name' => 'ExportCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ExportCertificateRequest', ], 'output' => [ 'shape' => 'ExportCertificateResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'RequestInProgressException', ], [ 'shape' => 'InvalidArnException', ], ], ], 'GetAccountConfiguration' => [ 'name' => 'GetAccountConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'output' => [ 'shape' => 'GetAccountConfigurationResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'GetCertificate' => [ 'name' => 'GetCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetCertificateRequest', ], 'output' => [ 'shape' => 'GetCertificateResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'RequestInProgressException', ], [ 'shape' => 'InvalidArnException', ], ], ], 'ImportCertificate' => [ 'name' => 'ImportCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ImportCertificateRequest', ], 'output' => [ 'shape' => 'ImportCertificateResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidTagException', ], [ 'shape' => 'TooManyTagsException', ], [ 'shape' => 'TagPolicyException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'InvalidArnException', ], ], ], 'ListCertificates' => [ 'name' => 'ListCertificates', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListCertificatesRequest', ], 'output' => [ 'shape' => 'ListCertificatesResponse', ], 'errors' => [ [ 'shape' => 'InvalidArgsException', ], [ 'shape' => 'ValidationException', ], ], ], 'ListTagsForCertificate' => [ 'name' => 'ListTagsForCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListTagsForCertificateRequest', ], 'output' => [ 'shape' => 'ListTagsForCertificateResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], ], ], 'PutAccountConfiguration' => [ 'name' => 'PutAccountConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutAccountConfigurationRequest', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ConflictException', ], ], ], 'RemoveTagsFromCertificate' => [ 'name' => 'RemoveTagsFromCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'RemoveTagsFromCertificateRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidTagException', ], [ 'shape' => 'TagPolicyException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'RenewCertificate' => [ 'name' => 'RenewCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'RenewCertificateRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], ], ], 'RequestCertificate' => [ 'name' => 'RequestCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'RequestCertificateRequest', ], 'output' => [ 'shape' => 'RequestCertificateResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidDomainValidationOptionsException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidTagException', ], [ 'shape' => 'TooManyTagsException', ], [ 'shape' => 'TagPolicyException', ], [ 'shape' => 'InvalidParameterException', ], ], ], 'ResendValidationEmail' => [ 'name' => 'ResendValidationEmail', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ResendValidationEmailRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidDomainValidationOptionsException', ], ], ], 'UpdateCertificateOptions' => [ 'name' => 'UpdateCertificateOptions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateCertificateOptionsRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'InvalidArnException', ], ], ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ServiceErrorMessage', ], ], 'exception' => true, 'synthetic' => true, ], 'AddTagsToCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateArn', 'Tags', ], 'members' => [ 'CertificateArn' => [ 'shape' => 'Arn', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'Arn' => [ 'type' => 'string', 'max' => 2048, 'min' => 20, 'pattern' => 'arn:[\\\\w+=/,.@-]+:acm:[\\\\w+=/,.@-]*:[0-9]+:[\\\\w+=,.@-]+(/[\\\\w+=,.@-]+)*', ], 'AvailabilityErrorMessage' => [ 'type' => 'string', ], 'CertificateBody' => [ 'type' => 'string', 'max' => 32768, 'min' => 1, 'pattern' => '-{5}BEGIN CERTIFICATE-{5}\\\\u000D?\\\\u000A([A-Za-z0-9/+]{64}\\\\u000D?\\\\u000A)*[A-Za-z0-9/+]{1,64}={0,2}\\\\u000D?\\\\u000A-{5}END CERTIFICATE-{5}(\\\\u000D?\\\\u000A)?', ], 'CertificateBodyBlob' => [ 'type' => 'blob', 'max' => 32768, 'min' => 1, ], 'CertificateChain' => [ 'type' => 'string', 'max' => 2097152, 'min' => 1, 'pattern' => '(-{5}BEGIN CERTIFICATE-{5}\\\\u000D?\\\\u000A([A-Za-z0-9/+]{64}\\\\u000D?\\\\u000A)*[A-Za-z0-9/+]{1,64}={0,2}\\\\u000D?\\\\u000A-{5}END CERTIFICATE-{5}\\\\u000D?\\\\u000A)*-{5}BEGIN CERTIFICATE-{5}\\\\u000D?\\\\u000A([A-Za-z0-9/+]{64}\\\\u000D?\\\\u000A)*[A-Za-z0-9/+]{1,64}={0,2}\\\\u000D?\\\\u000A-{5}END CERTIFICATE-{5}(\\\\u000D?\\\\u000A)?', ], 'CertificateChainBlob' => [ 'type' => 'blob', 'max' => 2097152, 'min' => 1, ], 'CertificateDetail' => [ 'type' => 'structure', 'members' => [ 'CertificateArn' => [ 'shape' => 'Arn', ], 'DomainName' => [ 'shape' => 'DomainNameString', ], 'SubjectAlternativeNames' => [ 'shape' => 'DomainList', ], 'DomainValidationOptions' => [ 'shape' => 'DomainValidationList', ], 'Serial' => [ 'shape' => 'String', ], 'Subject' => [ 'shape' => 'String', ], 'Issuer' => [ 'shape' => 'String', ], 'CreatedAt' => [ 'shape' => 'TStamp', ], 'IssuedAt' => [ 'shape' => 'TStamp', ], 'ImportedAt' => [ 'shape' => 'TStamp', ], 'Status' => [ 'shape' => 'CertificateStatus', ], 'RevokedAt' => [ 'shape' => 'TStamp', ], 'RevocationReason' => [ 'shape' => 'RevocationReason', ], 'NotBefore' => [ 'shape' => 'TStamp', ], 'NotAfter' => [ 'shape' => 'TStamp', ], 'KeyAlgorithm' => [ 'shape' => 'KeyAlgorithm', ], 'SignatureAlgorithm' => [ 'shape' => 'String', ], 'InUseBy' => [ 'shape' => 'InUseList', ], 'FailureReason' => [ 'shape' => 'FailureReason', ], 'Type' => [ 'shape' => 'CertificateType', ], 'RenewalSummary' => [ 'shape' => 'RenewalSummary', ], 'KeyUsages' => [ 'shape' => 'KeyUsageList', ], 'ExtendedKeyUsages' => [ 'shape' => 'ExtendedKeyUsageList', ], 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'RenewalEligibility' => [ 'shape' => 'RenewalEligibility', ], 'Options' => [ 'shape' => 'CertificateOptions', ], ], ], 'CertificateOptions' => [ 'type' => 'structure', 'members' => [ 'CertificateTransparencyLoggingPreference' => [ 'shape' => 'CertificateTransparencyLoggingPreference', ], ], ], 'CertificateStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING_VALIDATION', 'ISSUED', 'INACTIVE', 'EXPIRED', 'VALIDATION_TIMED_OUT', 'REVOKED', 'FAILED', ], ], 'CertificateStatuses' => [ 'type' => 'list', 'member' => [ 'shape' => 'CertificateStatus', ], ], 'CertificateSummary' => [ 'type' => 'structure', 'members' => [ 'CertificateArn' => [ 'shape' => 'Arn', ], 'DomainName' => [ 'shape' => 'DomainNameString', ], 'SubjectAlternativeNameSummaries' => [ 'shape' => 'DomainList', ], 'HasAdditionalSubjectAlternativeNames' => [ 'shape' => 'NullableBoolean', 'box' => true, ], 'Status' => [ 'shape' => 'CertificateStatus', ], 'Type' => [ 'shape' => 'CertificateType', ], 'KeyAlgorithm' => [ 'shape' => 'KeyAlgorithm', ], 'KeyUsages' => [ 'shape' => 'KeyUsageNames', ], 'ExtendedKeyUsages' => [ 'shape' => 'ExtendedKeyUsageNames', ], 'InUse' => [ 'shape' => 'NullableBoolean', 'box' => true, ], 'Exported' => [ 'shape' => 'NullableBoolean', 'box' => true, ], 'RenewalEligibility' => [ 'shape' => 'RenewalEligibility', ], 'NotBefore' => [ 'shape' => 'TStamp', ], 'NotAfter' => [ 'shape' => 'TStamp', ], 'CreatedAt' => [ 'shape' => 'TStamp', ], 'IssuedAt' => [ 'shape' => 'TStamp', ], 'ImportedAt' => [ 'shape' => 'TStamp', ], 'RevokedAt' => [ 'shape' => 'TStamp', ], ], ], 'CertificateSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CertificateSummary', ], ], 'CertificateTransparencyLoggingPreference' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'DISABLED', ], ], 'CertificateType' => [ 'type' => 'string', 'enum' => [ 'IMPORTED', 'AMAZON_ISSUED', 'PRIVATE', ], ], 'ConflictException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'DeleteCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateArn', ], 'members' => [ 'CertificateArn' => [ 'shape' => 'Arn', ], ], ], 'DescribeCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateArn', ], 'members' => [ 'CertificateArn' => [ 'shape' => 'Arn', ], ], ], 'DescribeCertificateResponse' => [ 'type' => 'structure', 'members' => [ 'Certificate' => [ 'shape' => 'CertificateDetail', ], ], ], 'DomainList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DomainNameString', ], 'max' => 100, 'min' => 1, ], 'DomainNameString' => [ 'type' => 'string', 'max' => 253, 'min' => 1, 'pattern' => '^(\\\\*\\\\.)?(((?!-)[A-Za-z0-9-]{0,62}[A-Za-z0-9])\\\\.)+((?!-)[A-Za-z0-9-]{1,62}[A-Za-z0-9])$', ], 'DomainStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING_VALIDATION', 'SUCCESS', 'FAILED', ], ], 'DomainValidation' => [ 'type' => 'structure', 'required' => [ 'DomainName', ], 'members' => [ 'DomainName' => [ 'shape' => 'DomainNameString', ], 'ValidationEmails' => [ 'shape' => 'ValidationEmailList', ], 'ValidationDomain' => [ 'shape' => 'DomainNameString', ], 'ValidationStatus' => [ 'shape' => 'DomainStatus', ], 'ResourceRecord' => [ 'shape' => 'ResourceRecord', ], 'ValidationMethod' => [ 'shape' => 'ValidationMethod', ], ], ], 'DomainValidationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DomainValidation', ], 'max' => 1000, 'min' => 1, ], 'DomainValidationOption' => [ 'type' => 'structure', 'required' => [ 'DomainName', 'ValidationDomain', ], 'members' => [ 'DomainName' => [ 'shape' => 'DomainNameString', ], 'ValidationDomain' => [ 'shape' => 'DomainNameString', ], ], ], 'DomainValidationOptionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DomainValidationOption', ], 'max' => 100, 'min' => 1, ], 'ExpiryEventsConfiguration' => [ 'type' => 'structure', 'members' => [ 'DaysBeforeExpiry' => [ 'shape' => 'PositiveInteger', ], ], ], 'ExportCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateArn', 'Passphrase', ], 'members' => [ 'CertificateArn' => [ 'shape' => 'Arn', ], 'Passphrase' => [ 'shape' => 'PassphraseBlob', ], ], ], 'ExportCertificateResponse' => [ 'type' => 'structure', 'members' => [ 'Certificate' => [ 'shape' => 'CertificateBody', ], 'CertificateChain' => [ 'shape' => 'CertificateChain', ], 'PrivateKey' => [ 'shape' => 'PrivateKey', ], ], ], 'ExtendedKeyUsage' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'ExtendedKeyUsageName', ], 'OID' => [ 'shape' => 'String', ], ], ], 'ExtendedKeyUsageFilterList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ExtendedKeyUsageName', ], ], 'ExtendedKeyUsageList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ExtendedKeyUsage', ], ], 'ExtendedKeyUsageName' => [ 'type' => 'string', 'enum' => [ 'TLS_WEB_SERVER_AUTHENTICATION', 'TLS_WEB_CLIENT_AUTHENTICATION', 'CODE_SIGNING', 'EMAIL_PROTECTION', 'TIME_STAMPING', 'OCSP_SIGNING', 'IPSEC_END_SYSTEM', 'IPSEC_TUNNEL', 'IPSEC_USER', 'ANY', 'NONE', 'CUSTOM', ], ], 'ExtendedKeyUsageNames' => [ 'type' => 'list', 'member' => [ 'shape' => 'ExtendedKeyUsageName', ], ], 'FailureReason' => [ 'type' => 'string', 'enum' => [ 'NO_AVAILABLE_CONTACTS', 'ADDITIONAL_VERIFICATION_REQUIRED', 'DOMAIN_NOT_ALLOWED', 'INVALID_PUBLIC_DOMAIN', 'DOMAIN_VALIDATION_DENIED', 'CAA_ERROR', 'PCA_LIMIT_EXCEEDED', 'PCA_INVALID_ARN', 'PCA_INVALID_STATE', 'PCA_REQUEST_FAILED', 'PCA_NAME_CONSTRAINTS_VALIDATION', 'PCA_RESOURCE_NOT_FOUND', 'PCA_INVALID_ARGS', 'PCA_INVALID_DURATION', 'PCA_ACCESS_DENIED', 'SLR_NOT_FOUND', 'OTHER', ], ], 'Filters' => [ 'type' => 'structure', 'members' => [ 'extendedKeyUsage' => [ 'shape' => 'ExtendedKeyUsageFilterList', ], 'keyUsage' => [ 'shape' => 'KeyUsageFilterList', ], 'keyTypes' => [ 'shape' => 'KeyAlgorithmList', ], ], ], 'GetAccountConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'ExpiryEvents' => [ 'shape' => 'ExpiryEventsConfiguration', ], ], ], 'GetCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateArn', ], 'members' => [ 'CertificateArn' => [ 'shape' => 'Arn', ], ], ], 'GetCertificateResponse' => [ 'type' => 'structure', 'members' => [ 'Certificate' => [ 'shape' => 'CertificateBody', ], 'CertificateChain' => [ 'shape' => 'CertificateChain', ], ], ], 'IdempotencyToken' => [ 'type' => 'string', 'max' => 32, 'min' => 1, 'pattern' => '\\\\w+', ], 'ImportCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'Certificate', 'PrivateKey', ], 'members' => [ 'CertificateArn' => [ 'shape' => 'Arn', ], 'Certificate' => [ 'shape' => 'CertificateBodyBlob', ], 'PrivateKey' => [ 'shape' => 'PrivateKeyBlob', ], 'CertificateChain' => [ 'shape' => 'CertificateChainBlob', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'ImportCertificateResponse' => [ 'type' => 'structure', 'members' => [ 'CertificateArn' => [ 'shape' => 'Arn', ], ], ], 'InUseList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'InvalidArgsException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'InvalidArnException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'InvalidDomainValidationOptionsException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'InvalidParameterException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'InvalidStateException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'InvalidTagException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'KeyAlgorithm' => [ 'type' => 'string', 'enum' => [ 'RSA_1024', 'RSA_2048', 'RSA_3072', 'RSA_4096', 'EC_prime256v1', 'EC_secp384r1', 'EC_secp521r1', ], ], 'KeyAlgorithmList' => [ 'type' => 'list', 'member' => [ 'shape' => 'KeyAlgorithm', ], ], 'KeyUsage' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'KeyUsageName', ], ], ], 'KeyUsageFilterList' => [ 'type' => 'list', 'member' => [ 'shape' => 'KeyUsageName', ], ], 'KeyUsageList' => [ 'type' => 'list', 'member' => [ 'shape' => 'KeyUsage', ], ], 'KeyUsageName' => [ 'type' => 'string', 'enum' => [ 'DIGITAL_SIGNATURE', 'NON_REPUDIATION', 'KEY_ENCIPHERMENT', 'DATA_ENCIPHERMENT', 'KEY_AGREEMENT', 'CERTIFICATE_SIGNING', 'CRL_SIGNING', 'ENCIPHER_ONLY', 'DECIPHER_ONLY', 'ANY', 'CUSTOM', ], ], 'KeyUsageNames' => [ 'type' => 'list', 'member' => [ 'shape' => 'KeyUsageName', ], ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'ListCertificatesRequest' => [ 'type' => 'structure', 'members' => [ 'CertificateStatuses' => [ 'shape' => 'CertificateStatuses', ], 'Includes' => [ 'shape' => 'Filters', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxItems' => [ 'shape' => 'MaxItems', ], 'SortBy' => [ 'shape' => 'SortBy', ], 'SortOrder' => [ 'shape' => 'SortOrder', ], ], ], 'ListCertificatesResponse' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'CertificateSummaryList' => [ 'shape' => 'CertificateSummaryList', ], ], ], 'ListTagsForCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateArn', ], 'members' => [ 'CertificateArn' => [ 'shape' => 'Arn', ], ], ], 'ListTagsForCertificateResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], ], ], 'MaxItems' => [ 'type' => 'integer', 'max' => 1000, 'min' => 1, ], 'NextToken' => [ 'type' => 'string', 'max' => 10000, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u00FF]*', ], 'NullableBoolean' => [ 'type' => 'boolean', ], 'PassphraseBlob' => [ 'type' => 'blob', 'max' => 128, 'min' => 4, 'sensitive' => true, ], 'PcaArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 20, 'pattern' => 'arn:[\\\\w+=/,.@-]+:acm-pca:[\\\\w+=/,.@-]*:[0-9]+:[\\\\w+=,.@-]+(/[\\\\w+=,.@-]+)*', ], 'PositiveInteger' => [ 'type' => 'integer', 'min' => 1, ], 'PrivateKey' => [ 'type' => 'string', 'max' => 524288, 'min' => 1, 'pattern' => '-{5}BEGIN PRIVATE KEY-{5}\\\\u000D?\\\\u000A([A-Za-z0-9/+]{64}\\\\u000D?\\\\u000A)*[A-Za-z0-9/+]{1,64}={0,2}\\\\u000D?\\\\u000A-{5}END PRIVATE KEY-{5}(\\\\u000D?\\\\u000A)?', 'sensitive' => true, ], 'PrivateKeyBlob' => [ 'type' => 'blob', 'max' => 5120, 'min' => 1, 'sensitive' => true, ], 'PutAccountConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'IdempotencyToken', ], 'members' => [ 'ExpiryEvents' => [ 'shape' => 'ExpiryEventsConfiguration', ], 'IdempotencyToken' => [ 'shape' => 'IdempotencyToken', ], ], ], 'RecordType' => [ 'type' => 'string', 'enum' => [ 'CNAME', ], ], 'RemoveTagsFromCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateArn', 'Tags', ], 'members' => [ 'CertificateArn' => [ 'shape' => 'Arn', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'RenewCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateArn', ], 'members' => [ 'CertificateArn' => [ 'shape' => 'Arn', ], ], ], 'RenewalEligibility' => [ 'type' => 'string', 'enum' => [ 'ELIGIBLE', 'INELIGIBLE', ], ], 'RenewalStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING_AUTO_RENEWAL', 'PENDING_VALIDATION', 'SUCCESS', 'FAILED', ], ], 'RenewalSummary' => [ 'type' => 'structure', 'required' => [ 'RenewalStatus', 'DomainValidationOptions', 'UpdatedAt', ], 'members' => [ 'RenewalStatus' => [ 'shape' => 'RenewalStatus', ], 'DomainValidationOptions' => [ 'shape' => 'DomainValidationList', ], 'RenewalStatusReason' => [ 'shape' => 'FailureReason', ], 'UpdatedAt' => [ 'shape' => 'TStamp', ], ], ], 'RequestCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'DomainName', ], 'members' => [ 'DomainName' => [ 'shape' => 'DomainNameString', ], 'ValidationMethod' => [ 'shape' => 'ValidationMethod', ], 'SubjectAlternativeNames' => [ 'shape' => 'DomainList', ], 'IdempotencyToken' => [ 'shape' => 'IdempotencyToken', ], 'DomainValidationOptions' => [ 'shape' => 'DomainValidationOptionList', ], 'Options' => [ 'shape' => 'CertificateOptions', ], 'CertificateAuthorityArn' => [ 'shape' => 'PcaArn', ], 'Tags' => [ 'shape' => 'TagList', ], 'KeyAlgorithm' => [ 'shape' => 'KeyAlgorithm', ], ], ], 'RequestCertificateResponse' => [ 'type' => 'structure', 'members' => [ 'CertificateArn' => [ 'shape' => 'Arn', ], ], ], 'RequestInProgressException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'ResendValidationEmailRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateArn', 'Domain', 'ValidationDomain', ], 'members' => [ 'CertificateArn' => [ 'shape' => 'Arn', ], 'Domain' => [ 'shape' => 'DomainNameString', ], 'ValidationDomain' => [ 'shape' => 'DomainNameString', ], ], ], 'ResourceInUseException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'ResourceRecord' => [ 'type' => 'structure', 'required' => [ 'Name', 'Type', 'Value', ], 'members' => [ 'Name' => [ 'shape' => 'String', ], 'Type' => [ 'shape' => 'RecordType', ], 'Value' => [ 'shape' => 'String', ], ], ], 'RevocationReason' => [ 'type' => 'string', 'enum' => [ 'UNSPECIFIED', 'KEY_COMPROMISE', 'CA_COMPROMISE', 'AFFILIATION_CHANGED', 'SUPERCEDED', 'CESSATION_OF_OPERATION', 'CERTIFICATE_HOLD', 'REMOVE_FROM_CRL', 'PRIVILEGE_WITHDRAWN', 'A_A_COMPROMISE', ], ], 'ServiceErrorMessage' => [ 'type' => 'string', ], 'SortBy' => [ 'type' => 'string', 'enum' => [ 'CREATED_AT', ], ], 'SortOrder' => [ 'type' => 'string', 'enum' => [ 'ASCENDING', 'DESCENDING', ], ], 'String' => [ 'type' => 'string', ], 'TStamp' => [ 'type' => 'timestamp', ], 'Tag' => [ 'type' => 'structure', 'required' => [ 'Key', ], 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[\\\\p{L}\\\\p{Z}\\\\p{N}_.:\\\\/=+\\\\-@]*', ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], 'max' => 50, 'min' => 1, ], 'TagPolicyException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => '[\\\\p{L}\\\\p{Z}\\\\p{N}_.:\\\\/=+\\\\-@]*', ], 'ThrottlingException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'AvailabilityErrorMessage', ], ], 'exception' => true, 'synthetic' => true, ], 'TooManyTagsException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'UpdateCertificateOptionsRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateArn', 'Options', ], 'members' => [ 'CertificateArn' => [ 'shape' => 'Arn', ], 'Options' => [ 'shape' => 'CertificateOptions', ], ], ], 'ValidationEmailList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'ValidationException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ValidationExceptionMessage', ], ], 'exception' => true, 'synthetic' => true, ], 'ValidationExceptionMessage' => [ 'type' => 'string', ], 'ValidationMethod' => [ 'type' => 'string', 'enum' => [ 'EMAIL', 'DNS', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/acm/2015-12-08/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<fullname>Certificate Manager</fullname> <p>You can use Certificate Manager (ACM) to manage SSL/TLS certificates for your Amazon Web Services-based websites and applications. For more information about using ACM, see the <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/\">Certificate Manager User Guide</a>.</p>', 'operations' => [ 'AddTagsToCertificate' => '<p>Adds one or more tags to an ACM certificate. Tags are labels that you can use to identify and organize your Amazon Web Services resources. Each tag consists of a <code>key</code> and an optional <code>value</code>. You specify the certificate on input by its Amazon Resource Name (ARN). You specify the tag by using a key-value pair. </p> <p>You can apply a tag to just one certificate if you want to identify a specific characteristic of that certificate, or you can apply the same tag to multiple certificates if you want to filter for a common relationship among those certificates. Similarly, you can apply the same tag to multiple resources if you want to specify a relationship among those resources. For example, you can add the same tag to an ACM certificate and an Elastic Load Balancing load balancer to indicate that they are both used by the same website. For more information, see <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/tags.html\">Tagging ACM certificates</a>. </p> <p>To remove one or more tags, use the <a>RemoveTagsFromCertificate</a> action. To view all of the tags that have been applied to the certificate, use the <a>ListTagsForCertificate</a> action. </p>', 'DeleteCertificate' => '<p>Deletes a certificate and its associated private key. If this action succeeds, the certificate no longer appears in the list that can be displayed by calling the <a>ListCertificates</a> action or be retrieved by calling the <a>GetCertificate</a> action. The certificate will not be available for use by Amazon Web Services services integrated with ACM. </p> <note> <p>You cannot delete an ACM certificate that is being used by another Amazon Web Services service. To delete a certificate that is in use, the certificate association must first be removed.</p> </note>', 'DescribeCertificate' => '<p>Returns detailed metadata about the specified ACM certificate.</p> <p>If you have just created a certificate using the <code>RequestCertificate</code> action, there is a delay of several seconds before you can retrieve information about it.</p>', 'ExportCertificate' => '<p>Exports a private certificate issued by a private certificate authority (CA) for use anywhere. The exported file contains the certificate, the certificate chain, and the encrypted private 2048-bit RSA key associated with the public key that is embedded in the certificate. For security, you must assign a passphrase for the private key when exporting it. </p> <p>For information about exporting and formatting a certificate using the ACM console or CLI, see <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-export-private.html\">Export a Private Certificate</a>.</p>', 'GetAccountConfiguration' => '<p>Returns the account configuration options associated with an Amazon Web Services account.</p>', 'GetCertificate' => '<p>Retrieves an Amazon-issued certificate and its certificate chain. The chain consists of the certificate of the issuing CA and the intermediate certificates of any other subordinate CAs. All of the certificates are base64 encoded. You can use <a href=\"https://wiki.openssl.org/index.php/Command_Line_Utilities\">OpenSSL</a> to decode the certificates and inspect individual fields.</p>', 'ImportCertificate' => '<p>Imports a certificate into Certificate Manager (ACM) to use with services that are integrated with ACM. Note that <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/acm-services.html\">integrated services</a> allow only certificate types and keys they support to be associated with their resources. Further, their support differs depending on whether the certificate is imported into IAM or into ACM. For more information, see the documentation for each service. For more information about importing certificates into ACM, see <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html\">Importing Certificates</a> in the <i>Certificate Manager User Guide</i>. </p> <note> <p>ACM does not provide <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html\">managed renewal</a> for certificates that you import.</p> </note> <p>Note the following guidelines when importing third party certificates:</p> <ul> <li> <p>You must enter the private key that matches the certificate you are importing.</p> </li> <li> <p>The private key must be unencrypted. You cannot import a private key that is protected by a password or a passphrase.</p> </li> <li> <p>The private key must be no larger than 5 KB (5,120 bytes).</p> </li> <li> <p>If the certificate you are importing is not self-signed, you must enter its certificate chain.</p> </li> <li> <p>If a certificate chain is included, the issuer must be the subject of one of the certificates in the chain.</p> </li> <li> <p>The certificate, private key, and certificate chain must be PEM-encoded.</p> </li> <li> <p>The current time must be between the <code>Not Before</code> and <code>Not After</code> certificate fields.</p> </li> <li> <p>The <code>Issuer</code> field must not be empty.</p> </li> <li> <p>The OCSP authority URL, if present, must not exceed 1000 characters.</p> </li> <li> <p>To import a new certificate, omit the <code>CertificateArn</code> argument. Include this argument only when you want to replace a previously imported certificate.</p> </li> <li> <p>When you import a certificate by using the CLI, you must specify the certificate, the certificate chain, and the private key by their file names preceded by <code>fileb://</code>. For example, you can specify a certificate saved in the <code>C:\\\\temp</code> folder as <code>fileb://C:\\\\temp\\\\certificate_to_import.pem</code>. If you are making an HTTP or HTTPS Query request, include these arguments as BLOBs. </p> </li> <li> <p>When you import a certificate by using an SDK, you must specify the certificate, the certificate chain, and the private key files in the manner required by the programming language you\\'re using. </p> </li> <li> <p>The cryptographic algorithm of an imported certificate must match the algorithm of the signing CA. For example, if the signing CA key type is RSA, then the certificate key type must also be RSA.</p> </li> </ul> <p>This operation returns the <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Name (ARN)</a> of the imported certificate.</p>', 'ListCertificates' => '<p>Retrieves a list of certificate ARNs and domain names. You can request that only certificates that match a specific status be listed. You can also filter by specific attributes of the certificate. Default filtering returns only <code>RSA_2048</code> certificates. For more information, see <a>Filters</a>.</p>', 'ListTagsForCertificate' => '<p>Lists the tags that have been applied to the ACM certificate. Use the certificate\\'s Amazon Resource Name (ARN) to specify the certificate. To add a tag to an ACM certificate, use the <a>AddTagsToCertificate</a> action. To delete a tag, use the <a>RemoveTagsFromCertificate</a> action. </p>', 'PutAccountConfiguration' => '<p>Adds or modifies account-level configurations in ACM. </p> <p>The supported configuration option is <code>DaysBeforeExpiry</code>. This option specifies the number of days prior to certificate expiration when ACM starts generating <code>EventBridge</code> events. ACM sends one event per day per certificate until the certificate expires. By default, accounts receive events starting 45 days before certificate expiration.</p>', 'RemoveTagsFromCertificate' => '<p>Remove one or more tags from an ACM certificate. A tag consists of a key-value pair. If you do not specify the value portion of the tag when calling this function, the tag will be removed regardless of value. If you specify a value, the tag is removed only if it is associated with the specified value. </p> <p>To add tags to a certificate, use the <a>AddTagsToCertificate</a> action. To view all of the tags that have been applied to a specific ACM certificate, use the <a>ListTagsForCertificate</a> action. </p>', 'RenewCertificate' => '<p>Renews an eligible ACM certificate. At this time, only exported private certificates can be renewed with this operation. In order to renew your Amazon Web Services Private CA certificates with ACM, you must first <a href=\"https://docs.aws.amazon.com/privateca/latest/userguide/PcaPermissions.html\">grant the ACM service principal permission to do so</a>. For more information, see <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/manual-renewal.html\">Testing Managed Renewal</a> in the ACM User Guide.</p>', 'RequestCertificate' => '<p>Requests an ACM certificate for use with other Amazon Web Services services. To request an ACM certificate, you must specify a fully qualified domain name (FQDN) in the <code>DomainName</code> parameter. You can also specify additional FQDNs in the <code>SubjectAlternativeNames</code> parameter. </p> <p>If you are requesting a private certificate, domain validation is not required. If you are requesting a public certificate, each domain name that you specify must be validated to verify that you own or control the domain. You can use <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html\">DNS validation</a> or <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-email.html\">email validation</a>. We recommend that you use DNS validation. ACM issues public certificates after receiving approval from the domain owner. </p> <note> <p>ACM behavior differs from the <a href=\"https://datatracker.ietf.org/doc/html/rfc6125#appendix-B.2\">RFC 6125</a> specification of the certificate validation process. ACM first checks for a Subject Alternative Name, and, if it finds one, ignores the common name (CN).</p> </note> <p>After successful completion of the <code>RequestCertificate</code> action, there is a delay of several seconds before you can retrieve information about the new certificate.</p>', 'ResendValidationEmail' => '<p>Resends the email that requests domain ownership validation. The domain owner or an authorized representative must approve the ACM certificate before it can be issued. The certificate can be approved by clicking a link in the mail to navigate to the Amazon certificate approval website and then clicking <b>I Approve</b>. However, the validation email can be blocked by spam filters. Therefore, if you do not receive the original mail, you can request that the mail be resent within 72 hours of requesting the ACM certificate. If more than 72 hours have elapsed since your original request or since your last attempt to resend validation mail, you must request a new certificate. For more information about setting up your contact email addresses, see <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/setup-email.html\">Configure Email for your Domain</a>. </p>', 'UpdateCertificateOptions' => '<p>Updates a certificate. Currently, you can use this function to specify whether to opt in to or out of recording your certificate in a certificate transparency log. For more information, see <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/acm-bestpractices.html#best-practices-transparency\"> Opting Out of Certificate Transparency Logging</a>. </p>', ], 'shapes' => [ 'AccessDeniedException' => [ 'base' => '<p>You do not have access required to perform this action.</p>', 'refs' => [], ], 'AddTagsToCertificateRequest' => [ 'base' => NULL, 'refs' => [], ], 'Arn' => [ 'base' => NULL, 'refs' => [ 'AddTagsToCertificateRequest$CertificateArn' => '<p>String that contains the ARN of the ACM certificate to which the tag is to be applied. This must be of the form:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Names (ARNs)</a>.</p>', 'CertificateDetail$CertificateArn' => '<p>The Amazon Resource Name (ARN) of the certificate. For more information about ARNs, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>', 'CertificateDetail$CertificateAuthorityArn' => '<p>The Amazon Resource Name (ARN) of the private certificate authority (CA) that issued the certificate. This has the following format: </p> <p> <code>arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012</code> </p>', 'CertificateSummary$CertificateArn' => '<p>Amazon Resource Name (ARN) of the certificate. This is of the form:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Names (ARNs)</a>.</p>', 'DeleteCertificateRequest$CertificateArn' => '<p>String that contains the ARN of the ACM certificate to be deleted. This must be of the form:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Names (ARNs)</a>.</p>', 'DescribeCertificateRequest$CertificateArn' => '<p>The Amazon Resource Name (ARN) of the ACM certificate. The ARN must have the following form:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Names (ARNs)</a>.</p>', 'ExportCertificateRequest$CertificateArn' => '<p>An Amazon Resource Name (ARN) of the issued certificate. This must be of the form:</p> <p> <code>arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012</code> </p>', 'GetCertificateRequest$CertificateArn' => '<p>String that contains a certificate ARN in the following format:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Names (ARNs)</a>.</p>', 'ImportCertificateRequest$CertificateArn' => '<p>The <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Name (ARN)</a> of an imported certificate to replace. To import a new certificate, omit this field. </p>', 'ImportCertificateResponse$CertificateArn' => '<p>The <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Name (ARN)</a> of the imported certificate.</p>', 'ListTagsForCertificateRequest$CertificateArn' => '<p>String that contains the ARN of the ACM certificate for which you want to list the tags. This must have the following form:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Names (ARNs)</a>.</p>', 'RemoveTagsFromCertificateRequest$CertificateArn' => '<p>String that contains the ARN of the ACM Certificate with one or more tags that you want to remove. This must be of the form:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Names (ARNs)</a>.</p>', 'RenewCertificateRequest$CertificateArn' => '<p>String that contains the ARN of the ACM certificate to be renewed. This must be of the form:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Names (ARNs)</a>.</p>', 'RequestCertificateResponse$CertificateArn' => '<p>String that contains the ARN of the issued certificate. This must be of the form:</p> <p> <code>arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p>', 'ResendValidationEmailRequest$CertificateArn' => '<p>String that contains the ARN of the requested certificate. The certificate ARN is generated and returned by the <a>RequestCertificate</a> action as soon as the request is made. By default, using this parameter causes email to be sent to all top-level domains you specified in the certificate request. The ARN must be of the form: </p> <p> <code>arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p>', 'UpdateCertificateOptionsRequest$CertificateArn' => '<p>ARN of the requested certificate to update. This must be of the form:</p> <p> <code>arn:aws:acm:us-east-1:<i>account</i>:certificate/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>', ], ], 'AvailabilityErrorMessage' => [ 'base' => NULL, 'refs' => [ 'ThrottlingException$message' => NULL, ], ], 'CertificateBody' => [ 'base' => NULL, 'refs' => [ 'ExportCertificateResponse$Certificate' => '<p>The base64 PEM-encoded certificate.</p>', 'GetCertificateResponse$Certificate' => '<p>The ACM-issued certificate corresponding to the ARN specified as input.</p>', ], ], 'CertificateBodyBlob' => [ 'base' => NULL, 'refs' => [ 'ImportCertificateRequest$Certificate' => '<p>The certificate to import.</p>', ], ], 'CertificateChain' => [ 'base' => NULL, 'refs' => [ 'ExportCertificateResponse$CertificateChain' => '<p>The base64 PEM-encoded certificate chain. This does not include the certificate that you are exporting.</p>', 'GetCertificateResponse$CertificateChain' => '<p>Certificates forming the requested certificate\\'s chain of trust. The chain consists of the certificate of the issuing CA and the intermediate certificates of any other subordinate CAs. </p>', ], ], 'CertificateChainBlob' => [ 'base' => NULL, 'refs' => [ 'ImportCertificateRequest$CertificateChain' => '<p>The PEM encoded certificate chain.</p>', ], ], 'CertificateDetail' => [ 'base' => '<p>Contains metadata about an ACM certificate. This structure is returned in the response to a <a>DescribeCertificate</a> request. </p>', 'refs' => [ 'DescribeCertificateResponse$Certificate' => '<p>Metadata about an ACM certificate.</p>', ], ], 'CertificateOptions' => [ 'base' => '<p>Structure that contains options for your certificate. Currently, you can use this only to specify whether to opt in to or out of certificate transparency logging. Some browsers require that public certificates issued for your domain be recorded in a log. Certificates that are not logged typically generate a browser error. Transparency makes it possible for you to detect SSL/TLS certificates that have been mistakenly or maliciously issued for your domain. For general information, see <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/acm-concepts.html#concept-transparency\">Certificate Transparency Logging</a>. </p>', 'refs' => [ 'CertificateDetail$Options' => '<p>Value that specifies whether to add the certificate to a transparency log. Certificate transparency makes it possible to detect SSL certificates that have been mistakenly or maliciously issued. A browser might respond to certificate that has not been logged by showing an error message. The logs are cryptographically secure. </p>', 'RequestCertificateRequest$Options' => '<p>Currently, you can use this parameter to specify whether to add the certificate to a certificate transparency log. Certificate transparency makes it possible to detect SSL/TLS certificates that have been mistakenly or maliciously issued. Certificates that have not been logged typically produce an error message in a browser. For more information, see <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/acm-bestpractices.html#best-practices-transparency\">Opting Out of Certificate Transparency Logging</a>.</p>', 'UpdateCertificateOptionsRequest$Options' => '<p>Use to update the options for your certificate. Currently, you can specify whether to add your certificate to a transparency log. Certificate transparency makes it possible to detect SSL/TLS certificates that have been mistakenly or maliciously issued. Certificates that have not been logged typically produce an error message in a browser. </p>', ], ], 'CertificateStatus' => [ 'base' => NULL, 'refs' => [ 'CertificateDetail$Status' => '<p>The status of the certificate.</p> <p>A certificate enters status PENDING_VALIDATION upon being requested, unless it fails for any of the reasons given in the troubleshooting topic <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/troubleshooting-failed.html\">Certificate request fails</a>. ACM makes repeated attempts to validate a certificate for 72 hours and then times out. If a certificate shows status FAILED or VALIDATION_TIMED_OUT, delete the request, correct the issue with <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/dns-validation.html\">DNS validation</a> or <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/email-validation.html\">Email validation</a>, and try again. If validation succeeds, the certificate enters status ISSUED. </p>', 'CertificateStatuses$member' => NULL, 'CertificateSummary$Status' => '<p>The status of the certificate.</p> <p>A certificate enters status PENDING_VALIDATION upon being requested, unless it fails for any of the reasons given in the troubleshooting topic <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/troubleshooting-failed.html\">Certificate request fails</a>. ACM makes repeated attempts to validate a certificate for 72 hours and then times out. If a certificate shows status FAILED or VALIDATION_TIMED_OUT, delete the request, correct the issue with <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/dns-validation.html\">DNS validation</a> or <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/email-validation.html\">Email validation</a>, and try again. If validation succeeds, the certificate enters status ISSUED. </p>', ], ], 'CertificateStatuses' => [ 'base' => NULL, 'refs' => [ 'ListCertificatesRequest$CertificateStatuses' => '<p>Filter the certificate list by status value.</p>', ], ], 'CertificateSummary' => [ 'base' => '<p>This structure is returned in the response object of <a>ListCertificates</a> action. </p>', 'refs' => [ 'CertificateSummaryList$member' => NULL, ], ], 'CertificateSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListCertificatesResponse$CertificateSummaryList' => '<p>A list of ACM certificates.</p>', ], ], 'CertificateTransparencyLoggingPreference' => [ 'base' => NULL, 'refs' => [ 'CertificateOptions$CertificateTransparencyLoggingPreference' => '<p>You can opt out of certificate transparency logging by specifying the <code>DISABLED</code> option. Opt in by specifying <code>ENABLED</code>. </p>', ], ], 'CertificateType' => [ 'base' => NULL, 'refs' => [ 'CertificateDetail$Type' => '<p>The source of the certificate. For certificates provided by ACM, this value is <code>AMAZON_ISSUED</code>. For certificates that you imported with <a>ImportCertificate</a>, this value is <code>IMPORTED</code>. ACM does not provide <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html\">managed renewal</a> for imported certificates. For more information about the differences between certificates that you import and those that ACM provides, see <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html\">Importing Certificates</a> in the <i>Certificate Manager User Guide</i>. </p>', 'CertificateSummary$Type' => '<p>The source of the certificate. For certificates provided by ACM, this value is <code>AMAZON_ISSUED</code>. For certificates that you imported with <a>ImportCertificate</a>, this value is <code>IMPORTED</code>. ACM does not provide <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html\">managed renewal</a> for imported certificates. For more information about the differences between certificates that you import and those that ACM provides, see <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html\">Importing Certificates</a> in the <i>Certificate Manager User Guide</i>. </p>', ], ], 'ConflictException' => [ 'base' => '<p>You are trying to update a resource or configuration that is already being created or updated. Wait for the previous operation to finish and try again.</p>', 'refs' => [], ], 'DeleteCertificateRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeCertificateRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeCertificateResponse' => [ 'base' => NULL, 'refs' => [], ], 'DomainList' => [ 'base' => NULL, 'refs' => [ 'CertificateDetail$SubjectAlternativeNames' => '<p>One or more domain names (subject alternative names) included in the certificate. This list contains the domain names that are bound to the public key that is contained in the certificate. The subject alternative names include the canonical domain name (CN) of the certificate and additional domain names that can be used to connect to the website. </p>', 'CertificateSummary$SubjectAlternativeNameSummaries' => '<p>One or more domain names (subject alternative names) included in the certificate. This list contains the domain names that are bound to the public key that is contained in the certificate. The subject alternative names include the canonical domain name (CN) of the certificate and additional domain names that can be used to connect to the website. </p> <p>When called by <a href=\"https://docs.aws.amazon.com/acm/latestAPIReference/API_ListCertificates.html\">ListCertificates</a>, this parameter will only return the first 100 subject alternative names included in the certificate. To display the full list of subject alternative names, use <a href=\"https://docs.aws.amazon.com/acm/latestAPIReference/API_DescribeCertificate.html\">DescribeCertificate</a>.</p>', 'RequestCertificateRequest$SubjectAlternativeNames' => '<p>Additional FQDNs to be included in the Subject Alternative Name extension of the ACM certificate. For example, add the name www.example.net to a certificate for which the <code>DomainName</code> field is www.example.com if users can reach your site by using either name. The maximum number of domain names that you can add to an ACM certificate is 100. However, the initial quota is 10 domain names. If you need more than 10 names, you must request a quota increase. For more information, see <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/acm-limits.html\">Quotas</a>.</p> <p> The maximum length of a SAN DNS name is 253 octets. The name is made up of multiple labels separated by periods. No label can be longer than 63 octets. Consider the following examples: </p> <ul> <li> <p> <code>(63 octets).(63 octets).(63 octets).(61 octets)</code> is legal because the total length is 253 octets (63+1+63+1+63+1+61) and no label exceeds 63 octets.</p> </li> <li> <p> <code>(64 octets).(63 octets).(63 octets).(61 octets)</code> is not legal because the total length exceeds 253 octets (64+1+63+1+63+1+61) and the first label exceeds 63 octets.</p> </li> <li> <p> <code>(63 octets).(63 octets).(63 octets).(62 octets)</code> is not legal because the total length of the DNS name (63+1+63+1+63+1+62) exceeds 253 octets.</p> </li> </ul>', ], ], 'DomainNameString' => [ 'base' => NULL, 'refs' => [ 'CertificateDetail$DomainName' => '<p>The fully qualified domain name for the certificate, such as www.example.com or example.com.</p>', 'CertificateSummary$DomainName' => '<p>Fully qualified domain name (FQDN), such as www.example.com or example.com, for the certificate.</p>', 'DomainList$member' => NULL, 'DomainValidation$DomainName' => '<p>A fully qualified domain name (FQDN) in the certificate. For example, <code>www.example.com</code> or <code>example.com</code>. </p>', 'DomainValidation$ValidationDomain' => '<p>The domain name that ACM used to send domain validation emails.</p>', 'DomainValidationOption$DomainName' => '<p>A fully qualified domain name (FQDN) in the certificate request.</p>', 'DomainValidationOption$ValidationDomain' => '<p>The domain name that you want ACM to use to send you validation emails. This domain name is the suffix of the email addresses that you want ACM to use. This must be the same as the <code>DomainName</code> value or a superdomain of the <code>DomainName</code> value. For example, if you request a certificate for <code>testing.example.com</code>, you can specify <code>example.com</code> for this value. In that case, ACM sends domain validation emails to the following five addresses:</p> <ul> <li> <p>admin@example.com</p> </li> <li> <p>administrator@example.com</p> </li> <li> <p>hostmaster@example.com</p> </li> <li> <p>postmaster@example.com</p> </li> <li> <p>webmaster@example.com</p> </li> </ul>', 'RequestCertificateRequest$DomainName' => '<p>Fully qualified domain name (FQDN), such as www.example.com, that you want to secure with an ACM certificate. Use an asterisk (*) to create a wildcard certificate that protects several sites in the same domain. For example, *.example.com protects www.example.com, site.example.com, and images.example.com. </p> <p>In compliance with <a href=\"https://datatracker.ietf.org/doc/html/rfc5280\">RFC 5280</a>, the length of the domain name (technically, the Common Name) that you provide cannot exceed 64 octets (characters), including periods. To add a longer domain name, specify it in the Subject Alternative Name field, which supports names up to 253 octets in length. </p>', 'ResendValidationEmailRequest$Domain' => '<p>The fully qualified domain name (FQDN) of the certificate that needs to be validated.</p>', 'ResendValidationEmailRequest$ValidationDomain' => '<p>The base validation domain that will act as the suffix of the email addresses that are used to send the emails. This must be the same as the <code>Domain</code> value or a superdomain of the <code>Domain</code> value. For example, if you requested a certificate for <code>site.subdomain.example.com</code> and specify a <b>ValidationDomain</b> of <code>subdomain.example.com</code>, ACM sends email to the domain registrant, technical contact, and administrative contact in WHOIS and the following five addresses:</p> <ul> <li> <p>admin@subdomain.example.com</p> </li> <li> <p>administrator@subdomain.example.com</p> </li> <li> <p>hostmaster@subdomain.example.com</p> </li> <li> <p>postmaster@subdomain.example.com</p> </li> <li> <p>webmaster@subdomain.example.com</p> </li> </ul>', ], ], 'DomainStatus' => [ 'base' => NULL, 'refs' => [ 'DomainValidation$ValidationStatus' => '<p>The validation status of the domain name. This can be one of the following values:</p> <ul> <li> <p> <code>PENDING_VALIDATION</code> </p> </li> <li> <p> <code/>SUCCESS</p> </li> <li> <p> <code/>FAILED</p> </li> </ul>', ], ], 'DomainValidation' => [ 'base' => '<p>Contains information about the validation of each domain name in the certificate.</p>', 'refs' => [ 'DomainValidationList$member' => NULL, ], ], 'DomainValidationList' => [ 'base' => NULL, 'refs' => [ 'CertificateDetail$DomainValidationOptions' => '<p>Contains information about the initial validation of each domain name that occurs as a result of the <a>RequestCertificate</a> request. This field exists only when the certificate type is <code>AMAZON_ISSUED</code>. </p>', 'RenewalSummary$DomainValidationOptions' => '<p>Contains information about the validation of each domain name in the certificate, as it pertains to ACM\\'s <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html\">managed renewal</a>. This is different from the initial validation that occurs as a result of the <a>RequestCertificate</a> request. This field exists only when the certificate type is <code>AMAZON_ISSUED</code>.</p>', ], ], 'DomainValidationOption' => [ 'base' => '<p>Contains information about the domain names that you want ACM to use to send you emails that enable you to validate domain ownership.</p>', 'refs' => [ 'DomainValidationOptionList$member' => NULL, ], ], 'DomainValidationOptionList' => [ 'base' => NULL, 'refs' => [ 'RequestCertificateRequest$DomainValidationOptions' => '<p>The domain name that you want ACM to use to send you emails so that you can validate domain ownership.</p>', ], ], 'ExpiryEventsConfiguration' => [ 'base' => '<p>Object containing expiration events options associated with an Amazon Web Services account.</p>', 'refs' => [ 'GetAccountConfigurationResponse$ExpiryEvents' => '<p>Expiration events configuration options associated with the Amazon Web Services account.</p>', 'PutAccountConfigurationRequest$ExpiryEvents' => '<p>Specifies expiration events associated with an account.</p>', ], ], 'ExportCertificateRequest' => [ 'base' => NULL, 'refs' => [], ], 'ExportCertificateResponse' => [ 'base' => NULL, 'refs' => [], ], 'ExtendedKeyUsage' => [ 'base' => '<p>The Extended Key Usage X.509 v3 extension defines one or more purposes for which the public key can be used. This is in addition to or in place of the basic purposes specified by the Key Usage extension. </p>', 'refs' => [ 'ExtendedKeyUsageList$member' => NULL, ], ], 'ExtendedKeyUsageFilterList' => [ 'base' => NULL, 'refs' => [ 'Filters$extendedKeyUsage' => '<p>Specify one or more <a>ExtendedKeyUsage</a> extension values.</p>', ], ], 'ExtendedKeyUsageList' => [ 'base' => NULL, 'refs' => [ 'CertificateDetail$ExtendedKeyUsages' => '<p>Contains a list of Extended Key Usage X.509 v3 extension objects. Each object specifies a purpose for which the certificate public key can be used and consists of a name and an object identifier (OID). </p>', ], ], 'ExtendedKeyUsageName' => [ 'base' => NULL, 'refs' => [ 'ExtendedKeyUsage$Name' => '<p>The name of an Extended Key Usage value.</p>', 'ExtendedKeyUsageFilterList$member' => NULL, 'ExtendedKeyUsageNames$member' => NULL, ], ], 'ExtendedKeyUsageNames' => [ 'base' => NULL, 'refs' => [ 'CertificateSummary$ExtendedKeyUsages' => '<p>Contains a list of Extended Key Usage X.509 v3 extension objects. Each object specifies a purpose for which the certificate public key can be used and consists of a name and an object identifier (OID). </p>', ], ], 'FailureReason' => [ 'base' => NULL, 'refs' => [ 'CertificateDetail$FailureReason' => '<p>The reason the certificate request failed. This value exists only when the certificate status is <code>FAILED</code>. For more information, see <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/troubleshooting.html#troubleshooting-failed\">Certificate Request Failed</a> in the <i>Certificate Manager User Guide</i>. </p>', 'RenewalSummary$RenewalStatusReason' => '<p>The reason that a renewal request was unsuccessful.</p>', ], ], 'Filters' => [ 'base' => '<p>This structure can be used in the <a>ListCertificates</a> action to filter the output of the certificate list. </p>', 'refs' => [ 'ListCertificatesRequest$Includes' => '<p>Filter the certificate list. For more information, see the <a>Filters</a> structure.</p>', ], ], 'GetAccountConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetCertificateRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetCertificateResponse' => [ 'base' => NULL, 'refs' => [], ], 'IdempotencyToken' => [ 'base' => NULL, 'refs' => [ 'PutAccountConfigurationRequest$IdempotencyToken' => '<p>Customer-chosen string used to distinguish between calls to <code>PutAccountConfiguration</code>. Idempotency tokens time out after one hour. If you call <code>PutAccountConfiguration</code> multiple times with the same unexpired idempotency token, ACM treats it as the same request and returns the original result. If you change the idempotency token for each call, ACM treats each call as a new request.</p>', 'RequestCertificateRequest$IdempotencyToken' => '<p>Customer chosen string that can be used to distinguish between calls to <code>RequestCertificate</code>. Idempotency tokens time out after one hour. Therefore, if you call <code>RequestCertificate</code> multiple times with the same idempotency token within one hour, ACM recognizes that you are requesting only one certificate and will issue only one. If you change the idempotency token for each call, ACM recognizes that you are requesting multiple certificates.</p>', ], ], 'ImportCertificateRequest' => [ 'base' => NULL, 'refs' => [], ], 'ImportCertificateResponse' => [ 'base' => NULL, 'refs' => [], ], 'InUseList' => [ 'base' => NULL, 'refs' => [ 'CertificateDetail$InUseBy' => '<p>A list of ARNs for the Amazon Web Services resources that are using the certificate. A certificate can be used by multiple Amazon Web Services resources. </p>', ], ], 'InvalidArgsException' => [ 'base' => '<p>One or more of of request parameters specified is not valid.</p>', 'refs' => [], ], 'InvalidArnException' => [ 'base' => '<p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>', 'refs' => [], ], 'InvalidDomainValidationOptionsException' => [ 'base' => '<p>One or more values in the <a>DomainValidationOption</a> structure is incorrect.</p>', 'refs' => [], ], 'InvalidParameterException' => [ 'base' => '<p>An input parameter was invalid.</p>', 'refs' => [], ], 'InvalidStateException' => [ 'base' => '<p>Processing has reached an invalid state.</p>', 'refs' => [], ], 'InvalidTagException' => [ 'base' => '<p>One or both of the values that make up the key-value pair is not valid. For example, you cannot specify a tag value that begins with <code>aws:</code>.</p>', 'refs' => [], ], 'KeyAlgorithm' => [ 'base' => NULL, 'refs' => [ 'CertificateDetail$KeyAlgorithm' => '<p>The algorithm that was used to generate the public-private key pair.</p>', 'CertificateSummary$KeyAlgorithm' => '<p>The algorithm that was used to generate the public-private key pair.</p>', 'KeyAlgorithmList$member' => NULL, 'RequestCertificateRequest$KeyAlgorithm' => '<p>Specifies the algorithm of the public and private key pair that your certificate uses to encrypt data. RSA is the default key algorithm for ACM certificates. Elliptic Curve Digital Signature Algorithm (ECDSA) keys are smaller, offering security comparable to RSA keys but with greater computing efficiency. However, ECDSA is not supported by all network clients. Some AWS services may require RSA keys, or only support ECDSA keys of a particular size, while others allow the use of either RSA and ECDSA keys to ensure that compatibility is not broken. Check the requirements for the AWS service where you plan to deploy your certificate.</p> <p>Default: RSA_2048</p>', ], ], 'KeyAlgorithmList' => [ 'base' => NULL, 'refs' => [ 'Filters$keyTypes' => '<p>Specify one or more algorithms that can be used to generate key pairs.</p> <p>Default filtering returns only <code>RSA_1024</code> and <code>RSA_2048</code> certificates that have at least one domain. To return other certificate types, provide the desired type signatures in a comma-separated list. For example, <code>\"keyTypes\": [\"RSA_2048\",\"RSA_4096\"]</code> returns both <code>RSA_2048</code> and <code>RSA_4096</code> certificates.</p>', ], ], 'KeyUsage' => [ 'base' => '<p>The Key Usage X.509 v3 extension defines the purpose of the public key contained in the certificate.</p>', 'refs' => [ 'KeyUsageList$member' => NULL, ], ], 'KeyUsageFilterList' => [ 'base' => NULL, 'refs' => [ 'Filters$keyUsage' => '<p>Specify one or more <a>KeyUsage</a> extension values.</p>', ], ], 'KeyUsageList' => [ 'base' => NULL, 'refs' => [ 'CertificateDetail$KeyUsages' => '<p>A list of Key Usage X.509 v3 extension objects. Each object is a string value that identifies the purpose of the public key contained in the certificate. Possible extension values include DIGITAL_SIGNATURE, KEY_ENCHIPHERMENT, NON_REPUDIATION, and more.</p>', ], ], 'KeyUsageName' => [ 'base' => NULL, 'refs' => [ 'KeyUsage$Name' => '<p>A string value that contains a Key Usage extension name.</p>', 'KeyUsageFilterList$member' => NULL, 'KeyUsageNames$member' => NULL, ], ], 'KeyUsageNames' => [ 'base' => NULL, 'refs' => [ 'CertificateSummary$KeyUsages' => '<p>A list of Key Usage X.509 v3 extension objects. Each object is a string value that identifies the purpose of the public key contained in the certificate. Possible extension values include DIGITAL_SIGNATURE, KEY_ENCHIPHERMENT, NON_REPUDIATION, and more.</p>', ], ], 'LimitExceededException' => [ 'base' => '<p>An ACM quota has been exceeded.</p>', 'refs' => [], ], 'ListCertificatesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListCertificatesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForCertificateRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForCertificateResponse' => [ 'base' => NULL, 'refs' => [], ], 'MaxItems' => [ 'base' => NULL, 'refs' => [ 'ListCertificatesRequest$MaxItems' => '<p>Use this parameter when paginating results to specify the maximum number of items to return in the response. If additional items exist beyond the number you specify, the <code>NextToken</code> element is sent in the response. Use this <code>NextToken</code> value in a subsequent request to retrieve additional items.</p>', ], ], 'NextToken' => [ 'base' => NULL, 'refs' => [ 'ListCertificatesRequest$NextToken' => '<p>Use this parameter only when paginating results and only in a subsequent request after you receive a response with truncated results. Set it to the value of <code>NextToken</code> from the response you just received.</p>', 'ListCertificatesResponse$NextToken' => '<p>When the list is truncated, this value is present and contains the value to use for the <code>NextToken</code> parameter in a subsequent pagination request.</p>', ], ], 'NullableBoolean' => [ 'base' => NULL, 'refs' => [ 'CertificateSummary$HasAdditionalSubjectAlternativeNames' => '<p>When called by <a href=\"https://docs.aws.amazon.com/acm/latestAPIReference/API_ListCertificates.html\">ListCertificates</a>, indicates whether the full list of subject alternative names has been included in the response. If false, the response includes all of the subject alternative names included in the certificate. If true, the response only includes the first 100 subject alternative names included in the certificate. To display the full list of subject alternative names, use <a href=\"https://docs.aws.amazon.com/acm/latestAPIReference/API_DescribeCertificate.html\">DescribeCertificate</a>.</p>', 'CertificateSummary$InUse' => '<p>Indicates whether the certificate is currently in use by any Amazon Web Services resources.</p>', 'CertificateSummary$Exported' => '<p>Indicates whether the certificate has been exported. This value exists only when the certificate type is <code>PRIVATE</code>.</p>', ], ], 'PassphraseBlob' => [ 'base' => NULL, 'refs' => [ 'ExportCertificateRequest$Passphrase' => '<p>Passphrase to associate with the encrypted exported private key. </p> <note> <p>When creating your passphrase, you can use any ASCII character except #, $, or %.</p> </note> <p>If you want to later decrypt the private key, you must have the passphrase. You can use the following OpenSSL command to decrypt a private key. After entering the command, you are prompted for the passphrase.</p> <p> <code>openssl rsa -in encrypted_key.pem -out decrypted_key.pem</code> </p>', ], ], 'PcaArn' => [ 'base' => NULL, 'refs' => [ 'RequestCertificateRequest$CertificateAuthorityArn' => '<p>The Amazon Resource Name (ARN) of the private certificate authority (CA) that will be used to issue the certificate. If you do not provide an ARN and you are trying to request a private certificate, ACM will attempt to issue a public certificate. For more information about private CAs, see the <a href=\"https://docs.aws.amazon.com/privateca/latest/userguide/PcaWelcome.html\">Amazon Web Services Private Certificate Authority</a> user guide. The ARN must have the following form: </p> <p> <code>arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012</code> </p>', ], ], 'PositiveInteger' => [ 'base' => NULL, 'refs' => [ 'ExpiryEventsConfiguration$DaysBeforeExpiry' => '<p>Specifies the number of days prior to certificate expiration when ACM starts generating <code>EventBridge</code> events. ACM sends one event per day per certificate until the certificate expires. By default, accounts receive events starting 45 days before certificate expiration.</p>', ], ], 'PrivateKey' => [ 'base' => NULL, 'refs' => [ 'ExportCertificateResponse$PrivateKey' => '<p>The encrypted private key associated with the public key in the certificate. The key is output in PKCS #8 format and is base64 PEM-encoded. </p>', ], ], 'PrivateKeyBlob' => [ 'base' => NULL, 'refs' => [ 'ImportCertificateRequest$PrivateKey' => '<p>The private key that matches the public key in the certificate.</p>', ], ], 'PutAccountConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'RecordType' => [ 'base' => NULL, 'refs' => [ 'ResourceRecord$Type' => '<p>The type of DNS record. Currently this can be <code>CNAME</code>.</p>', ], ], 'RemoveTagsFromCertificateRequest' => [ 'base' => NULL, 'refs' => [], ], 'RenewCertificateRequest' => [ 'base' => NULL, 'refs' => [], ], 'RenewalEligibility' => [ 'base' => NULL, 'refs' => [ 'CertificateDetail$RenewalEligibility' => '<p>Specifies whether the certificate is eligible for renewal. At this time, only exported private certificates can be renewed with the <a>RenewCertificate</a> command.</p>', 'CertificateSummary$RenewalEligibility' => '<p>Specifies whether the certificate is eligible for renewal. At this time, only exported private certificates can be renewed with the <a>RenewCertificate</a> command.</p>', ], ], 'RenewalStatus' => [ 'base' => NULL, 'refs' => [ 'RenewalSummary$RenewalStatus' => '<p>The status of ACM\\'s <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html\">managed renewal</a> of the certificate.</p>', ], ], 'RenewalSummary' => [ 'base' => '<p>Contains information about the status of ACM\\'s <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html\">managed renewal</a> for the certificate. This structure exists only when the certificate type is <code>AMAZON_ISSUED</code>.</p>', 'refs' => [ 'CertificateDetail$RenewalSummary' => '<p>Contains information about the status of ACM\\'s <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html\">managed renewal</a> for the certificate. This field exists only when the certificate type is <code>AMAZON_ISSUED</code>.</p>', ], ], 'RequestCertificateRequest' => [ 'base' => NULL, 'refs' => [], ], 'RequestCertificateResponse' => [ 'base' => NULL, 'refs' => [], ], 'RequestInProgressException' => [ 'base' => '<p>The certificate request is in process and the certificate in your account has not yet been issued.</p>', 'refs' => [], ], 'ResendValidationEmailRequest' => [ 'base' => NULL, 'refs' => [], ], 'ResourceInUseException' => [ 'base' => '<p>The certificate is in use by another Amazon Web Services service in the caller\\'s account. Remove the association and try again.</p>', 'refs' => [], ], 'ResourceNotFoundException' => [ 'base' => '<p>The specified certificate cannot be found in the caller\\'s account or the caller\\'s account cannot be found.</p>', 'refs' => [], ], 'ResourceRecord' => [ 'base' => '<p>Contains a DNS record value that you can use to validate ownership or control of a domain. This is used by the <a>DescribeCertificate</a> action. </p>', 'refs' => [ 'DomainValidation$ResourceRecord' => '<p>Contains the CNAME record that you add to your DNS database for domain validation. For more information, see <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html\">Use DNS to Validate Domain Ownership</a>.</p> <p>Note: The CNAME information that you need does not include the name of your domain. If you include&#x2028; your domain name in the DNS database CNAME record, validation fails.&#x2028; For example, if the name is \"_a79865eb4cd1a6ab990a45779b4e0b96.yourdomain.com\", only \"_a79865eb4cd1a6ab990a45779b4e0b96\" must be used.</p>', ], ], 'RevocationReason' => [ 'base' => NULL, 'refs' => [ 'CertificateDetail$RevocationReason' => '<p>The reason the certificate was revoked. This value exists only when the certificate status is <code>REVOKED</code>. </p>', ], ], 'ServiceErrorMessage' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$Message' => NULL, ], ], 'SortBy' => [ 'base' => NULL, 'refs' => [ 'ListCertificatesRequest$SortBy' => '<p>Specifies the field to sort results by. If you specify <code>SortBy</code>, you must also specify <code>SortOrder</code>.</p>', ], ], 'SortOrder' => [ 'base' => NULL, 'refs' => [ 'ListCertificatesRequest$SortOrder' => '<p>Specifies the order of sorted results. If you specify <code>SortOrder</code>, you must also specify <code>SortBy</code>.</p>', ], ], 'String' => [ 'base' => NULL, 'refs' => [ 'CertificateDetail$Serial' => '<p>The serial number of the certificate.</p>', 'CertificateDetail$Subject' => '<p>The name of the entity that is associated with the public key contained in the certificate.</p>', 'CertificateDetail$Issuer' => '<p>The name of the certificate authority that issued and signed the certificate.</p>', 'CertificateDetail$SignatureAlgorithm' => '<p>The algorithm that was used to sign the certificate.</p>', 'ConflictException$message' => NULL, 'ExtendedKeyUsage$OID' => '<p>An object identifier (OID) for the extension value. OIDs are strings of numbers separated by periods. The following OIDs are defined in RFC 3280 and RFC 5280. </p> <ul> <li> <p> <code>1.3.6.1.5.5.7.3.1 (TLS_WEB_SERVER_AUTHENTICATION)</code> </p> </li> <li> <p> <code>1.3.6.1.5.5.7.3.2 (TLS_WEB_CLIENT_AUTHENTICATION)</code> </p> </li> <li> <p> <code>1.3.6.1.5.5.7.3.3 (CODE_SIGNING)</code> </p> </li> <li> <p> <code>1.3.6.1.5.5.7.3.4 (EMAIL_PROTECTION)</code> </p> </li> <li> <p> <code>1.3.6.1.5.5.7.3.8 (TIME_STAMPING)</code> </p> </li> <li> <p> <code>1.3.6.1.5.5.7.3.9 (OCSP_SIGNING)</code> </p> </li> <li> <p> <code>1.3.6.1.5.5.7.3.5 (IPSEC_END_SYSTEM)</code> </p> </li> <li> <p> <code>1.3.6.1.5.5.7.3.6 (IPSEC_TUNNEL)</code> </p> </li> <li> <p> <code>1.3.6.1.5.5.7.3.7 (IPSEC_USER)</code> </p> </li> </ul>', 'InUseList$member' => NULL, 'InvalidArgsException$message' => NULL, 'InvalidArnException$message' => NULL, 'InvalidDomainValidationOptionsException$message' => NULL, 'InvalidParameterException$message' => NULL, 'InvalidStateException$message' => NULL, 'InvalidTagException$message' => NULL, 'LimitExceededException$message' => NULL, 'RequestInProgressException$message' => NULL, 'ResourceInUseException$message' => NULL, 'ResourceNotFoundException$message' => NULL, 'ResourceRecord$Name' => '<p>The name of the DNS record to create in your domain. This is supplied by ACM.</p>', 'ResourceRecord$Value' => '<p>The value of the CNAME record to add to your DNS database. This is supplied by ACM.</p>', 'TagPolicyException$message' => NULL, 'TooManyTagsException$message' => NULL, 'ValidationEmailList$member' => NULL, ], ], 'TStamp' => [ 'base' => NULL, 'refs' => [ 'CertificateDetail$CreatedAt' => '<p>The time at which the certificate was requested.</p>', 'CertificateDetail$IssuedAt' => '<p>The time at which the certificate was issued. This value exists only when the certificate type is <code>AMAZON_ISSUED</code>. </p>', 'CertificateDetail$ImportedAt' => '<p>The date and time when the certificate was imported. This value exists only when the certificate type is <code>IMPORTED</code>. </p>', 'CertificateDetail$RevokedAt' => '<p>The time at which the certificate was revoked. This value exists only when the certificate status is <code>REVOKED</code>. </p>', 'CertificateDetail$NotBefore' => '<p>The time before which the certificate is not valid.</p>', 'CertificateDetail$NotAfter' => '<p>The time after which the certificate is not valid.</p>', 'CertificateSummary$NotBefore' => '<p>The time before which the certificate is not valid.</p>', 'CertificateSummary$NotAfter' => '<p>The time after which the certificate is not valid.</p>', 'CertificateSummary$CreatedAt' => '<p>The time at which the certificate was requested.</p>', 'CertificateSummary$IssuedAt' => '<p>The time at which the certificate was issued. This value exists only when the certificate type is <code>AMAZON_ISSUED</code>. </p>', 'CertificateSummary$ImportedAt' => '<p>The date and time when the certificate was imported. This value exists only when the certificate type is <code>IMPORTED</code>. </p>', 'CertificateSummary$RevokedAt' => '<p>The time at which the certificate was revoked. This value exists only when the certificate status is <code>REVOKED</code>. </p>', 'RenewalSummary$UpdatedAt' => '<p>The time at which the renewal summary was last updated.</p>', ], ], 'Tag' => [ 'base' => '<p>A key-value pair that identifies or specifies metadata about an ACM resource.</p>', 'refs' => [ 'TagList$member' => NULL, ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'Tag$Key' => '<p>The key of the tag.</p>', ], ], 'TagList' => [ 'base' => NULL, 'refs' => [ 'AddTagsToCertificateRequest$Tags' => '<p>The key-value pair that defines the tag. The tag value is optional.</p>', 'ImportCertificateRequest$Tags' => '<p>One or more resource tags to associate with the imported certificate. </p> <p>Note: You cannot apply tags when reimporting a certificate.</p>', 'ListTagsForCertificateResponse$Tags' => '<p>The key-value pairs that define the applied tags.</p>', 'RemoveTagsFromCertificateRequest$Tags' => '<p>The key-value pair that defines the tag to remove.</p>', 'RequestCertificateRequest$Tags' => '<p>One or more resource tags to associate with the certificate.</p>', ], ], 'TagPolicyException' => [ 'base' => '<p>A specified tag did not comply with an existing tag policy and was rejected.</p>', 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'Tag$Value' => '<p>The value of the tag.</p>', ], ], 'ThrottlingException' => [ 'base' => '<p>The request was denied because it exceeded a quota.</p>', 'refs' => [], ], 'TooManyTagsException' => [ 'base' => '<p>The request contains too many tags. Try the request again with fewer tags.</p>', 'refs' => [], ], 'UpdateCertificateOptionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ValidationEmailList' => [ 'base' => NULL, 'refs' => [ 'DomainValidation$ValidationEmails' => '<p>A list of email addresses that ACM used to send domain validation emails.</p>', ], ], 'ValidationException' => [ 'base' => '<p>The supplied input failed to satisfy constraints of an Amazon Web Services service.</p>', 'refs' => [], ], 'ValidationExceptionMessage' => [ 'base' => NULL, 'refs' => [ 'ValidationException$message' => NULL, ], ], 'ValidationMethod' => [ 'base' => NULL, 'refs' => [ 'DomainValidation$ValidationMethod' => '<p>Specifies the domain validation method.</p>', 'RequestCertificateRequest$ValidationMethod' => '<p>The method you want to use if you are requesting a public certificate to validate that you own or control domain. You can <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html\">validate with DNS</a> or <a href=\"https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-email.html\">validate with email</a>. We recommend that you use DNS validation. </p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/acm/2015-12-08/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], [ 'fn' => 'parseURL', 'argv' => [ [ 'ref' => 'Endpoint', ], ], 'assign' => 'url', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://acm-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ 'aws-us-gov', [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], ], ], ], 'endpoint' => [ 'url' => 'https://acm.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://acm-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://acm.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://acm.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/acm/2015-12-08/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-south-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-south-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-south-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-south-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-south-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-south-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-south-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-south-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-south-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-south-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-south-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.eu-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.eu-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.eu-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.eu-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.eu-south-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-south-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.eu-south-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-south-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.eu-south-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-south-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.eu-south-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-south-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-gov-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-gov-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-gov-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-gov-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.me-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'me-central-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region me-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.me-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'me-central-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.me-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'me-central-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region me-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.me-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'me-central-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ca-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ca-central-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ca-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ca-central-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ca-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ca-central-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ca-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ca-central-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.eu-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-central-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.eu-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-central-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.eu-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-central-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.eu-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-central-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-iso-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.us-iso-west-1.c2s.ic.gov', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-iso-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-iso-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-iso-west-1.c2s.ic.gov', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-iso-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.eu-central-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-central-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-central-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.eu-central-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-central-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.eu-central-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-central-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-central-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.eu-central-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-central-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.us-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.us-west-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-west-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-west-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-west-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-west-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-west-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.af-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'af-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.af-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'af-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.af-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'af-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.af-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'af-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.eu-north-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-north-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.eu-north-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-north-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.eu-north-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-north-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.eu-north-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-north-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.eu-west-3.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-3', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.eu-west-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-3', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.eu-west-3.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-3', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.eu-west-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-3', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.eu-west-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.eu-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.eu-west-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.eu-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.eu-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.eu-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.eu-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.eu-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-northeast-3.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-3', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-3', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-northeast-3.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-3', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-3', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-northeast-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-northeast-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-northeast-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-northeast-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.me-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'me-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.me-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'me-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.me-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'me-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.me-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'me-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.sa-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'sa-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.sa-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'sa-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.sa-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'sa-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.sa-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'sa-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'cn-north-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'cn-north-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'cn-north-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'cn-north-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.us-gov-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-gov-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-gov-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-gov-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-gov-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-gov-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-southeast-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-southeast-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-southeast-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-southeast-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-iso-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-iso-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-iso-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-iso-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-southeast-3.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-3', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-3', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-southeast-3.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-3', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-3', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-4 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-southeast-4.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-4', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-4 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.ap-southeast-4.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-4', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-4 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-southeast-4.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-4', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-4 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.ap-southeast-4.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-4', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.us-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.us-east-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-east-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'cn-northwest-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'cn-northwest-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'cn-northwest-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'cn-northwest-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-isob-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-isob-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-isob-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-isob-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-1', 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-1', 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-1', 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/acm/2015-12-08/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/acm/2015-12-08/paginators-1.json\nreturn [ 'pagination' => [ 'ListCertificates' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxItems', 'output_token' => 'NextToken', 'result_key' => 'CertificateSummaryList', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/acm/2015-12-08/smoke.json\nreturn [ 'version' => 1, 'defaultRegion' => 'us-west-2', 'testCases' => [ [ 'operationName' => 'ListCertificates', 'input' => [], 'errorExpectedFromService' => false, ], [ 'operationName' => 'GetCertificate', 'input' => [ 'CertificateArn' => 'arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012', ], 'errorExpectedFromService' => true, ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/acm/2015-12-08/waiters-2.json\nreturn [ 'version' => 2, 'waiters' => [ 'CertificateValidated' => [ 'delay' => 60, 'maxAttempts' => 40, 'operation' => 'DescribeCertificate', 'acceptors' => [ [ 'matcher' => 'pathAll', 'expected' => 'SUCCESS', 'argument' => 'Certificate.DomainValidationOptions[].ValidationStatus', 'state' => 'success', ], [ 'matcher' => 'pathAny', 'expected' => 'PENDING_VALIDATION', 'argument' => 'Certificate.DomainValidationOptions[].ValidationStatus', 'state' => 'retry', ], [ 'matcher' => 'path', 'expected' => 'FAILED', 'argument' => 'Certificate.Status', 'state' => 'failure', ], [ 'matcher' => 'error', 'expected' => 'ResourceNotFoundException', 'state' => 'failure', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/acm-pca/2017-08-22/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2017-08-22', 'endpointPrefix' => 'acm-pca', 'jsonVersion' => '1.1', 'protocol' => 'json', 'serviceAbbreviation' => 'ACM-PCA', 'serviceFullName' => 'AWS Certificate Manager Private Certificate Authority', 'serviceId' => 'ACM PCA', 'signatureVersion' => 'v4', 'targetPrefix' => 'ACMPrivateCA', 'uid' => 'acm-pca-2017-08-22', ], 'operations' => [ 'CreateCertificateAuthority' => [ 'name' => 'CreateCertificateAuthority', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateCertificateAuthorityRequest', ], 'output' => [ 'shape' => 'CreateCertificateAuthorityResponse', ], 'errors' => [ [ 'shape' => 'InvalidArgsException', ], [ 'shape' => 'InvalidPolicyException', ], [ 'shape' => 'InvalidTagException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], 'CreateCertificateAuthorityAuditReport' => [ 'name' => 'CreateCertificateAuthorityAuditReport', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateCertificateAuthorityAuditReportRequest', ], 'output' => [ 'shape' => 'CreateCertificateAuthorityAuditReportResponse', ], 'errors' => [ [ 'shape' => 'RequestInProgressException', ], [ 'shape' => 'RequestFailedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidArgsException', ], [ 'shape' => 'InvalidStateException', ], ], 'idempotent' => true, ], 'CreatePermission' => [ 'name' => 'CreatePermission', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreatePermissionRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'PermissionAlreadyExistsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'RequestFailedException', ], ], ], 'DeleteCertificateAuthority' => [ 'name' => 'DeleteCertificateAuthority', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteCertificateAuthorityRequest', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidStateException', ], ], ], 'DeletePermission' => [ 'name' => 'DeletePermission', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeletePermissionRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'RequestFailedException', ], ], ], 'DeletePolicy' => [ 'name' => 'DeletePolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeletePolicyRequest', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'LockoutPreventedException', ], [ 'shape' => 'RequestFailedException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeCertificateAuthority' => [ 'name' => 'DescribeCertificateAuthority', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeCertificateAuthorityRequest', ], 'output' => [ 'shape' => 'DescribeCertificateAuthorityResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], ], ], 'DescribeCertificateAuthorityAuditReport' => [ 'name' => 'DescribeCertificateAuthorityAuditReport', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeCertificateAuthorityAuditReportRequest', ], 'output' => [ 'shape' => 'DescribeCertificateAuthorityAuditReportResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidArgsException', ], ], ], 'GetCertificate' => [ 'name' => 'GetCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetCertificateRequest', ], 'output' => [ 'shape' => 'GetCertificateResponse', ], 'errors' => [ [ 'shape' => 'RequestInProgressException', ], [ 'shape' => 'RequestFailedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidStateException', ], ], ], 'GetCertificateAuthorityCertificate' => [ 'name' => 'GetCertificateAuthorityCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetCertificateAuthorityCertificateRequest', ], 'output' => [ 'shape' => 'GetCertificateAuthorityCertificateResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'InvalidArnException', ], ], ], 'GetCertificateAuthorityCsr' => [ 'name' => 'GetCertificateAuthorityCsr', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetCertificateAuthorityCsrRequest', ], 'output' => [ 'shape' => 'GetCertificateAuthorityCsrResponse', ], 'errors' => [ [ 'shape' => 'RequestInProgressException', ], [ 'shape' => 'RequestFailedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidStateException', ], ], ], 'GetPolicy' => [ 'name' => 'GetPolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetPolicyRequest', ], 'output' => [ 'shape' => 'GetPolicyResponse', ], 'errors' => [ [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'RequestFailedException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ImportCertificateAuthorityCertificate' => [ 'name' => 'ImportCertificateAuthorityCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ImportCertificateAuthorityCertificateRequest', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'RequestInProgressException', ], [ 'shape' => 'RequestFailedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'MalformedCertificateException', ], [ 'shape' => 'CertificateMismatchException', ], ], ], 'IssueCertificate' => [ 'name' => 'IssueCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'IssueCertificateRequest', ], 'output' => [ 'shape' => 'IssueCertificateResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidArgsException', ], [ 'shape' => 'MalformedCSRException', ], ], 'idempotent' => true, ], 'ListCertificateAuthorities' => [ 'name' => 'ListCertificateAuthorities', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListCertificateAuthoritiesRequest', ], 'output' => [ 'shape' => 'ListCertificateAuthoritiesResponse', ], 'errors' => [ [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListPermissions' => [ 'name' => 'ListPermissions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListPermissionsRequest', ], 'output' => [ 'shape' => 'ListPermissionsResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'RequestFailedException', ], ], ], 'ListTags' => [ 'name' => 'ListTags', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListTagsRequest', ], 'output' => [ 'shape' => 'ListTagsResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidStateException', ], ], ], 'PutPolicy' => [ 'name' => 'PutPolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutPolicyRequest', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'InvalidPolicyException', ], [ 'shape' => 'LockoutPreventedException', ], [ 'shape' => 'RequestFailedException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'RestoreCertificateAuthority' => [ 'name' => 'RestoreCertificateAuthority', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'RestoreCertificateAuthorityRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'InvalidArnException', ], ], ], 'RevokeCertificate' => [ 'name' => 'RevokeCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'RevokeCertificateRequest', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'RequestAlreadyProcessedException', ], [ 'shape' => 'RequestInProgressException', ], [ 'shape' => 'RequestFailedException', ], ], ], 'TagCertificateAuthority' => [ 'name' => 'TagCertificateAuthority', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'TagCertificateAuthorityRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'InvalidTagException', ], [ 'shape' => 'TooManyTagsException', ], ], ], 'UntagCertificateAuthority' => [ 'name' => 'UntagCertificateAuthority', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UntagCertificateAuthorityRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'InvalidTagException', ], ], ], 'UpdateCertificateAuthority' => [ 'name' => 'UpdateCertificateAuthority', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateCertificateAuthorityRequest', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidArgsException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'InvalidPolicyException', ], ], ], ], 'shapes' => [ 'ASN1PrintableString64' => [ 'type' => 'string', 'max' => 64, 'min' => 0, 'pattern' => '[a-zA-Z0-9\\'()+-.?:/= ]*', ], 'ASN1Subject' => [ 'type' => 'structure', 'members' => [ 'Country' => [ 'shape' => 'CountryCodeString', ], 'Organization' => [ 'shape' => 'String64', ], 'OrganizationalUnit' => [ 'shape' => 'String64', ], 'DistinguishedNameQualifier' => [ 'shape' => 'ASN1PrintableString64', ], 'State' => [ 'shape' => 'String128', ], 'CommonName' => [ 'shape' => 'String64', ], 'SerialNumber' => [ 'shape' => 'ASN1PrintableString64', ], 'Locality' => [ 'shape' => 'String128', ], 'Title' => [ 'shape' => 'String64', ], 'Surname' => [ 'shape' => 'String40', ], 'GivenName' => [ 'shape' => 'String16', ], 'Initials' => [ 'shape' => 'String5', ], 'Pseudonym' => [ 'shape' => 'String128', ], 'GenerationQualifier' => [ 'shape' => 'String3', ], 'CustomAttributes' => [ 'shape' => 'CustomAttributeList', ], ], ], 'AWSPolicy' => [ 'type' => 'string', 'max' => 20480, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u00FF]+', ], 'AccessDescription' => [ 'type' => 'structure', 'required' => [ 'AccessMethod', 'AccessLocation', ], 'members' => [ 'AccessMethod' => [ 'shape' => 'AccessMethod', ], 'AccessLocation' => [ 'shape' => 'GeneralName', ], ], 'box' => true, ], 'AccessDescriptionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AccessDescription', ], ], 'AccessMethod' => [ 'type' => 'structure', 'members' => [ 'CustomObjectIdentifier' => [ 'shape' => 'CustomObjectIdentifier', ], 'AccessMethodType' => [ 'shape' => 'AccessMethodType', ], ], ], 'AccessMethodType' => [ 'type' => 'string', 'enum' => [ 'CA_REPOSITORY', 'RESOURCE_PKI_MANIFEST', 'RESOURCE_PKI_NOTIFY', ], ], 'AccountId' => [ 'type' => 'string', 'max' => 12, 'min' => 12, 'pattern' => '[0-9]+', ], 'ActionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ActionType', ], 'max' => 3, 'min' => 1, ], 'ActionType' => [ 'type' => 'string', 'enum' => [ 'IssueCertificate', 'GetCertificate', 'ListPermissions', ], ], 'ApiPassthrough' => [ 'type' => 'structure', 'members' => [ 'Extensions' => [ 'shape' => 'Extensions', ], 'Subject' => [ 'shape' => 'ASN1Subject', ], ], ], 'Arn' => [ 'type' => 'string', 'max' => 200, 'min' => 5, 'pattern' => 'arn:[\\\\w+=/,.@-]+:[\\\\w+=/,.@-]+:[\\\\w+=/,.@-]*:[0-9]*:[\\\\w+=,.@-]+(/[\\\\w+=,.@-]+)*', ], 'AuditReportId' => [ 'type' => 'string', 'max' => 36, 'min' => 36, 'pattern' => '[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}', ], 'AuditReportResponseFormat' => [ 'type' => 'string', 'enum' => [ 'JSON', 'CSV', ], ], 'AuditReportStatus' => [ 'type' => 'string', 'enum' => [ 'CREATING', 'SUCCESS', 'FAILED', ], ], 'Base64String1To4096' => [ 'type' => 'string', 'max' => 4096, 'min' => 1, 'pattern' => '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$', ], 'Boolean' => [ 'type' => 'boolean', ], 'CertificateAuthorities' => [ 'type' => 'list', 'member' => [ 'shape' => 'CertificateAuthority', ], ], 'CertificateAuthority' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'OwnerAccount' => [ 'shape' => 'AccountId', ], 'CreatedAt' => [ 'shape' => 'TStamp', ], 'LastStateChangeAt' => [ 'shape' => 'TStamp', ], 'Type' => [ 'shape' => 'CertificateAuthorityType', ], 'Serial' => [ 'shape' => 'String', ], 'Status' => [ 'shape' => 'CertificateAuthorityStatus', ], 'NotBefore' => [ 'shape' => 'TStamp', ], 'NotAfter' => [ 'shape' => 'TStamp', ], 'FailureReason' => [ 'shape' => 'FailureReason', ], 'CertificateAuthorityConfiguration' => [ 'shape' => 'CertificateAuthorityConfiguration', ], 'RevocationConfiguration' => [ 'shape' => 'RevocationConfiguration', ], 'RestorableUntil' => [ 'shape' => 'TStamp', ], 'KeyStorageSecurityStandard' => [ 'shape' => 'KeyStorageSecurityStandard', ], 'UsageMode' => [ 'shape' => 'CertificateAuthorityUsageMode', ], ], ], 'CertificateAuthorityConfiguration' => [ 'type' => 'structure', 'required' => [ 'KeyAlgorithm', 'SigningAlgorithm', 'Subject', ], 'members' => [ 'KeyAlgorithm' => [ 'shape' => 'KeyAlgorithm', ], 'SigningAlgorithm' => [ 'shape' => 'SigningAlgorithm', ], 'Subject' => [ 'shape' => 'ASN1Subject', ], 'CsrExtensions' => [ 'shape' => 'CsrExtensions', ], ], ], 'CertificateAuthorityStatus' => [ 'type' => 'string', 'enum' => [ 'CREATING', 'PENDING_CERTIFICATE', 'ACTIVE', 'DELETED', 'DISABLED', 'EXPIRED', 'FAILED', ], ], 'CertificateAuthorityType' => [ 'type' => 'string', 'enum' => [ 'ROOT', 'SUBORDINATE', ], ], 'CertificateAuthorityUsageMode' => [ 'type' => 'string', 'enum' => [ 'GENERAL_PURPOSE', 'SHORT_LIVED_CERTIFICATE', ], ], 'CertificateBody' => [ 'type' => 'string', ], 'CertificateBodyBlob' => [ 'type' => 'blob', 'max' => 32768, 'min' => 1, ], 'CertificateChain' => [ 'type' => 'string', ], 'CertificateChainBlob' => [ 'type' => 'blob', 'max' => 2097152, 'min' => 0, ], 'CertificateMismatchException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'CertificatePolicyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PolicyInformation', ], 'max' => 20, 'min' => 1, ], 'CnameString' => [ 'type' => 'string', 'max' => 253, 'min' => 0, 'pattern' => '^[-a-zA-Z0-9;/?:@&=+$,%_.!~*()\\']*$', ], 'ConcurrentModificationException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'CountryCodeString' => [ 'type' => 'string', 'max' => 2, 'min' => 2, 'pattern' => '[A-Za-z]{2}', ], 'CreateCertificateAuthorityAuditReportRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', 'S3BucketName', 'AuditReportResponseFormat', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'S3BucketName' => [ 'shape' => 'S3BucketName', ], 'AuditReportResponseFormat' => [ 'shape' => 'AuditReportResponseFormat', ], ], ], 'CreateCertificateAuthorityAuditReportResponse' => [ 'type' => 'structure', 'members' => [ 'AuditReportId' => [ 'shape' => 'AuditReportId', ], 'S3Key' => [ 'shape' => 'S3Key', ], ], ], 'CreateCertificateAuthorityRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityConfiguration', 'CertificateAuthorityType', ], 'members' => [ 'CertificateAuthorityConfiguration' => [ 'shape' => 'CertificateAuthorityConfiguration', ], 'RevocationConfiguration' => [ 'shape' => 'RevocationConfiguration', ], 'CertificateAuthorityType' => [ 'shape' => 'CertificateAuthorityType', ], 'IdempotencyToken' => [ 'shape' => 'IdempotencyToken', ], 'KeyStorageSecurityStandard' => [ 'shape' => 'KeyStorageSecurityStandard', ], 'Tags' => [ 'shape' => 'TagList', ], 'UsageMode' => [ 'shape' => 'CertificateAuthorityUsageMode', ], ], ], 'CreateCertificateAuthorityResponse' => [ 'type' => 'structure', 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], ], ], 'CreatePermissionRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', 'Principal', 'Actions', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'Principal' => [ 'shape' => 'Principal', ], 'SourceAccount' => [ 'shape' => 'AccountId', ], 'Actions' => [ 'shape' => 'ActionList', ], ], ], 'CrlConfiguration' => [ 'type' => 'structure', 'required' => [ 'Enabled', ], 'members' => [ 'Enabled' => [ 'shape' => 'Boolean', 'box' => true, ], 'ExpirationInDays' => [ 'shape' => 'Integer1To5000', 'box' => true, ], 'CustomCname' => [ 'shape' => 'CnameString', ], 'S3BucketName' => [ 'shape' => 'S3BucketName3To255', ], 'S3ObjectAcl' => [ 'shape' => 'S3ObjectAcl', ], ], ], 'CsrBlob' => [ 'type' => 'blob', 'max' => 32768, 'min' => 1, ], 'CsrBody' => [ 'type' => 'string', ], 'CsrExtensions' => [ 'type' => 'structure', 'members' => [ 'KeyUsage' => [ 'shape' => 'KeyUsage', ], 'SubjectInformationAccess' => [ 'shape' => 'AccessDescriptionList', ], ], ], 'CustomAttribute' => [ 'type' => 'structure', 'required' => [ 'ObjectIdentifier', 'Value', ], 'members' => [ 'ObjectIdentifier' => [ 'shape' => 'CustomObjectIdentifier', ], 'Value' => [ 'shape' => 'String1To256', ], ], ], 'CustomAttributeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CustomAttribute', ], 'max' => 30, 'min' => 1, ], 'CustomExtension' => [ 'type' => 'structure', 'required' => [ 'ObjectIdentifier', 'Value', ], 'members' => [ 'ObjectIdentifier' => [ 'shape' => 'CustomObjectIdentifier', ], 'Value' => [ 'shape' => 'Base64String1To4096', ], 'Critical' => [ 'shape' => 'Boolean', 'box' => true, ], ], ], 'CustomExtensionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CustomExtension', ], 'max' => 20, 'min' => 1, ], 'CustomObjectIdentifier' => [ 'type' => 'string', 'max' => 64, 'min' => 0, 'pattern' => '^([0-2])\\\\.([0-9]|([0-3][0-9]))((\\\\.([0-9]+)){0,126})$', ], 'DeleteCertificateAuthorityRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'PermanentDeletionTimeInDays' => [ 'shape' => 'PermanentDeletionTimeInDays', ], ], ], 'DeletePermissionRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', 'Principal', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'Principal' => [ 'shape' => 'Principal', ], 'SourceAccount' => [ 'shape' => 'AccountId', ], ], ], 'DeletePolicyRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', ], ], ], 'DescribeCertificateAuthorityAuditReportRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', 'AuditReportId', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'AuditReportId' => [ 'shape' => 'AuditReportId', ], ], ], 'DescribeCertificateAuthorityAuditReportResponse' => [ 'type' => 'structure', 'members' => [ 'AuditReportStatus' => [ 'shape' => 'AuditReportStatus', ], 'S3BucketName' => [ 'shape' => 'S3BucketName', ], 'S3Key' => [ 'shape' => 'S3Key', ], 'CreatedAt' => [ 'shape' => 'TStamp', ], ], ], 'DescribeCertificateAuthorityRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], ], ], 'DescribeCertificateAuthorityResponse' => [ 'type' => 'structure', 'members' => [ 'CertificateAuthority' => [ 'shape' => 'CertificateAuthority', ], ], ], 'EdiPartyName' => [ 'type' => 'structure', 'required' => [ 'PartyName', ], 'members' => [ 'PartyName' => [ 'shape' => 'String256', ], 'NameAssigner' => [ 'shape' => 'String256', ], ], ], 'ExtendedKeyUsage' => [ 'type' => 'structure', 'members' => [ 'ExtendedKeyUsageType' => [ 'shape' => 'ExtendedKeyUsageType', ], 'ExtendedKeyUsageObjectIdentifier' => [ 'shape' => 'CustomObjectIdentifier', ], ], ], 'ExtendedKeyUsageList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ExtendedKeyUsage', ], 'max' => 20, 'min' => 1, ], 'ExtendedKeyUsageType' => [ 'type' => 'string', 'enum' => [ 'SERVER_AUTH', 'CLIENT_AUTH', 'CODE_SIGNING', 'EMAIL_PROTECTION', 'TIME_STAMPING', 'OCSP_SIGNING', 'SMART_CARD_LOGIN', 'DOCUMENT_SIGNING', 'CERTIFICATE_TRANSPARENCY', ], ], 'Extensions' => [ 'type' => 'structure', 'members' => [ 'CertificatePolicies' => [ 'shape' => 'CertificatePolicyList', ], 'ExtendedKeyUsage' => [ 'shape' => 'ExtendedKeyUsageList', ], 'KeyUsage' => [ 'shape' => 'KeyUsage', ], 'SubjectAlternativeNames' => [ 'shape' => 'GeneralNameList', ], 'CustomExtensions' => [ 'shape' => 'CustomExtensionList', ], ], ], 'FailureReason' => [ 'type' => 'string', 'enum' => [ 'REQUEST_TIMED_OUT', 'UNSUPPORTED_ALGORITHM', 'OTHER', ], ], 'GeneralName' => [ 'type' => 'structure', 'members' => [ 'OtherName' => [ 'shape' => 'OtherName', ], 'Rfc822Name' => [ 'shape' => 'String256', ], 'DnsName' => [ 'shape' => 'String253', ], 'DirectoryName' => [ 'shape' => 'ASN1Subject', ], 'EdiPartyName' => [ 'shape' => 'EdiPartyName', ], 'UniformResourceIdentifier' => [ 'shape' => 'String253', ], 'IpAddress' => [ 'shape' => 'String39', ], 'RegisteredId' => [ 'shape' => 'CustomObjectIdentifier', ], ], ], 'GeneralNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'GeneralName', ], 'max' => 20, 'min' => 1, ], 'GetCertificateAuthorityCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], ], ], 'GetCertificateAuthorityCertificateResponse' => [ 'type' => 'structure', 'members' => [ 'Certificate' => [ 'shape' => 'CertificateBody', ], 'CertificateChain' => [ 'shape' => 'CertificateChain', ], ], ], 'GetCertificateAuthorityCsrRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], ], ], 'GetCertificateAuthorityCsrResponse' => [ 'type' => 'structure', 'members' => [ 'Csr' => [ 'shape' => 'CsrBody', ], ], ], 'GetCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', 'CertificateArn', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'CertificateArn' => [ 'shape' => 'Arn', ], ], ], 'GetCertificateResponse' => [ 'type' => 'structure', 'members' => [ 'Certificate' => [ 'shape' => 'CertificateBody', ], 'CertificateChain' => [ 'shape' => 'CertificateChain', ], ], ], 'GetPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', ], ], ], 'GetPolicyResponse' => [ 'type' => 'structure', 'members' => [ 'Policy' => [ 'shape' => 'AWSPolicy', ], ], ], 'IdempotencyToken' => [ 'type' => 'string', 'max' => 36, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u00FF]*', ], 'ImportCertificateAuthorityCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', 'Certificate', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'Certificate' => [ 'shape' => 'CertificateBodyBlob', ], 'CertificateChain' => [ 'shape' => 'CertificateChainBlob', ], ], ], 'Integer1To5000' => [ 'type' => 'integer', 'max' => 5000, 'min' => 1, ], 'InvalidArgsException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'InvalidArnException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'InvalidNextTokenException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'InvalidPolicyException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'InvalidRequestException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'InvalidStateException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'InvalidTagException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'IssueCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', 'Csr', 'SigningAlgorithm', 'Validity', ], 'members' => [ 'ApiPassthrough' => [ 'shape' => 'ApiPassthrough', ], 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'Csr' => [ 'shape' => 'CsrBlob', ], 'SigningAlgorithm' => [ 'shape' => 'SigningAlgorithm', ], 'TemplateArn' => [ 'shape' => 'Arn', ], 'Validity' => [ 'shape' => 'Validity', ], 'ValidityNotBefore' => [ 'shape' => 'Validity', ], 'IdempotencyToken' => [ 'shape' => 'IdempotencyToken', ], ], ], 'IssueCertificateResponse' => [ 'type' => 'structure', 'members' => [ 'CertificateArn' => [ 'shape' => 'Arn', ], ], ], 'KeyAlgorithm' => [ 'type' => 'string', 'enum' => [ 'RSA_2048', 'RSA_4096', 'EC_prime256v1', 'EC_secp384r1', ], ], 'KeyStorageSecurityStandard' => [ 'type' => 'string', 'enum' => [ 'FIPS_140_2_LEVEL_2_OR_HIGHER', 'FIPS_140_2_LEVEL_3_OR_HIGHER', ], ], 'KeyUsage' => [ 'type' => 'structure', 'members' => [ 'DigitalSignature' => [ 'shape' => 'Boolean', ], 'NonRepudiation' => [ 'shape' => 'Boolean', ], 'KeyEncipherment' => [ 'shape' => 'Boolean', ], 'DataEncipherment' => [ 'shape' => 'Boolean', ], 'KeyAgreement' => [ 'shape' => 'Boolean', ], 'KeyCertSign' => [ 'shape' => 'Boolean', ], 'CRLSign' => [ 'shape' => 'Boolean', ], 'EncipherOnly' => [ 'shape' => 'Boolean', ], 'DecipherOnly' => [ 'shape' => 'Boolean', ], ], ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'ListCertificateAuthoritiesRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'ResourceOwner' => [ 'shape' => 'ResourceOwner', ], ], ], 'ListCertificateAuthoritiesResponse' => [ 'type' => 'structure', 'members' => [ 'CertificateAuthorities' => [ 'shape' => 'CertificateAuthorities', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListPermissionsRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], ], ], 'ListPermissionsResponse' => [ 'type' => 'structure', 'members' => [ 'Permissions' => [ 'shape' => 'PermissionList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTagsRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], ], ], 'ListTagsResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'LockoutPreventedException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'MalformedCSRException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'MalformedCertificateException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'MaxResults' => [ 'type' => 'integer', 'max' => 1000, 'min' => 1, ], 'NextToken' => [ 'type' => 'string', 'max' => 500, 'min' => 1, ], 'OcspConfiguration' => [ 'type' => 'structure', 'required' => [ 'Enabled', ], 'members' => [ 'Enabled' => [ 'shape' => 'Boolean', 'box' => true, ], 'OcspCustomCname' => [ 'shape' => 'CnameString', ], ], ], 'OtherName' => [ 'type' => 'structure', 'required' => [ 'TypeId', 'Value', ], 'members' => [ 'TypeId' => [ 'shape' => 'CustomObjectIdentifier', ], 'Value' => [ 'shape' => 'String256', ], ], ], 'PermanentDeletionTimeInDays' => [ 'type' => 'integer', 'max' => 30, 'min' => 7, ], 'Permission' => [ 'type' => 'structure', 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'CreatedAt' => [ 'shape' => 'TStamp', ], 'Principal' => [ 'shape' => 'Principal', ], 'SourceAccount' => [ 'shape' => 'AccountId', ], 'Actions' => [ 'shape' => 'ActionList', ], 'Policy' => [ 'shape' => 'AWSPolicy', ], ], ], 'PermissionAlreadyExistsException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'PermissionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Permission', ], 'min' => 0, ], 'PolicyInformation' => [ 'type' => 'structure', 'required' => [ 'CertPolicyId', ], 'members' => [ 'CertPolicyId' => [ 'shape' => 'CustomObjectIdentifier', ], 'PolicyQualifiers' => [ 'shape' => 'PolicyQualifierInfoList', ], ], ], 'PolicyQualifierId' => [ 'type' => 'string', 'enum' => [ 'CPS', ], ], 'PolicyQualifierInfo' => [ 'type' => 'structure', 'required' => [ 'PolicyQualifierId', 'Qualifier', ], 'members' => [ 'PolicyQualifierId' => [ 'shape' => 'PolicyQualifierId', ], 'Qualifier' => [ 'shape' => 'Qualifier', ], ], ], 'PolicyQualifierInfoList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PolicyQualifierInfo', ], 'max' => 20, 'min' => 1, ], 'PositiveLong' => [ 'type' => 'long', 'min' => 1, ], 'Principal' => [ 'type' => 'string', 'max' => 128, 'min' => 0, 'pattern' => '^[^*]+$', ], 'PutPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'Policy', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', ], 'Policy' => [ 'shape' => 'AWSPolicy', ], ], ], 'Qualifier' => [ 'type' => 'structure', 'required' => [ 'CpsUri', ], 'members' => [ 'CpsUri' => [ 'shape' => 'String256', ], ], ], 'RequestAlreadyProcessedException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'RequestFailedException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'RequestInProgressException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'ResourceOwner' => [ 'type' => 'string', 'enum' => [ 'SELF', 'OTHER_ACCOUNTS', ], ], 'RestoreCertificateAuthorityRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], ], ], 'RevocationConfiguration' => [ 'type' => 'structure', 'members' => [ 'CrlConfiguration' => [ 'shape' => 'CrlConfiguration', ], 'OcspConfiguration' => [ 'shape' => 'OcspConfiguration', ], ], ], 'RevocationReason' => [ 'type' => 'string', 'enum' => [ 'UNSPECIFIED', 'KEY_COMPROMISE', 'CERTIFICATE_AUTHORITY_COMPROMISE', 'AFFILIATION_CHANGED', 'SUPERSEDED', 'CESSATION_OF_OPERATION', 'PRIVILEGE_WITHDRAWN', 'A_A_COMPROMISE', ], ], 'RevokeCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', 'CertificateSerial', 'RevocationReason', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'CertificateSerial' => [ 'shape' => 'String128', ], 'RevocationReason' => [ 'shape' => 'RevocationReason', ], ], ], 'S3BucketName' => [ 'type' => 'string', 'max' => 63, 'min' => 3, ], 'S3BucketName3To255' => [ 'type' => 'string', 'max' => 255, 'min' => 3, 'pattern' => '^[-a-zA-Z0-9._/]+$', ], 'S3Key' => [ 'type' => 'string', 'max' => 1024, ], 'S3ObjectAcl' => [ 'type' => 'string', 'enum' => [ 'PUBLIC_READ', 'BUCKET_OWNER_FULL_CONTROL', ], ], 'SigningAlgorithm' => [ 'type' => 'string', 'enum' => [ 'SHA256WITHECDSA', 'SHA384WITHECDSA', 'SHA512WITHECDSA', 'SHA256WITHRSA', 'SHA384WITHRSA', 'SHA512WITHRSA', ], ], 'String' => [ 'type' => 'string', ], 'String128' => [ 'type' => 'string', 'max' => 128, 'min' => 0, ], 'String16' => [ 'type' => 'string', 'max' => 16, 'min' => 0, ], 'String1To256' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'String253' => [ 'type' => 'string', 'max' => 253, 'min' => 0, ], 'String256' => [ 'type' => 'string', 'max' => 256, 'min' => 0, ], 'String3' => [ 'type' => 'string', 'max' => 3, 'min' => 0, ], 'String39' => [ 'type' => 'string', 'max' => 39, 'min' => 0, ], 'String40' => [ 'type' => 'string', 'max' => 40, 'min' => 0, ], 'String5' => [ 'type' => 'string', 'max' => 5, 'min' => 0, ], 'String64' => [ 'type' => 'string', 'max' => 64, 'min' => 0, ], 'TStamp' => [ 'type' => 'timestamp', ], 'Tag' => [ 'type' => 'structure', 'required' => [ 'Key', ], 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], ], 'TagCertificateAuthorityRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', 'Tags', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$', ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], 'max' => 50, 'min' => 1, ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => '^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$', ], 'TooManyTagsException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, ], 'UntagCertificateAuthorityRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', 'Tags', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'UpdateCertificateAuthorityRequest' => [ 'type' => 'structure', 'required' => [ 'CertificateAuthorityArn', ], 'members' => [ 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'RevocationConfiguration' => [ 'shape' => 'RevocationConfiguration', ], 'Status' => [ 'shape' => 'CertificateAuthorityStatus', ], ], ], 'Validity' => [ 'type' => 'structure', 'required' => [ 'Value', 'Type', ], 'members' => [ 'Value' => [ 'shape' => 'PositiveLong', 'box' => true, ], 'Type' => [ 'shape' => 'ValidityPeriodType', ], ], ], 'ValidityPeriodType' => [ 'type' => 'string', 'enum' => [ 'END_DATE', 'ABSOLUTE', 'DAYS', 'MONTHS', 'YEARS', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/acm-pca/2017-08-22/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://acm-pca-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ 'aws-us-gov', [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], ], ], ], 'endpoint' => [ 'url' => 'https://acm-pca.{Region}.amazonaws.com', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://acm-pca-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://acm-pca.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://acm-pca.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/acm-pca/2017-08-22/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca-fips.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://acm-pca.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/acm-pca/2017-08-22/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/acm-pca/2017-08-22/paginators-1.json\nreturn [ 'pagination' => [ 'ListCertificateAuthorities' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'CertificateAuthorities', ], 'ListPermissions' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'Permissions', ], 'ListTags' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'Tags', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/acm-pca/2017-08-22/waiters-2.json\nreturn [ 'version' => 2, 'waiters' => [ 'CertificateAuthorityCSRCreated' => [ 'description' => 'Wait until a Certificate Authority CSR is created', 'operation' => 'GetCertificateAuthorityCsr', 'delay' => 3, 'maxAttempts' => 60, 'acceptors' => [ [ 'state' => 'success', 'matcher' => 'status', 'expected' => 200, ], [ 'state' => 'retry', 'matcher' => 'error', 'expected' => 'RequestInProgressException', ], ], ], 'CertificateIssued' => [ 'description' => 'Wait until a certificate is issued', 'operation' => 'GetCertificate', 'delay' => 3, 'maxAttempts' => 60, 'acceptors' => [ [ 'state' => 'success', 'matcher' => 'status', 'expected' => 200, ], [ 'state' => 'retry', 'matcher' => 'error', 'expected' => 'RequestInProgressException', ], ], ], 'AuditReportCreated' => [ 'description' => 'Wait until a Audit Report is created', 'operation' => 'DescribeCertificateAuthorityAuditReport', 'delay' => 3, 'maxAttempts' => 60, 'acceptors' => [ [ 'state' => 'success', 'matcher' => 'path', 'argument' => 'AuditReportStatus', 'expected' => 'SUCCESS', ], [ 'state' => 'failure', 'matcher' => 'path', 'argument' => 'AuditReportStatus', 'expected' => 'FAILED', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/alexaforbusiness/2017-11-09/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2017-11-09', 'endpointPrefix' => 'a4b', 'jsonVersion' => '1.1', 'protocol' => 'json', 'serviceFullName' => 'Alexa For Business', 'serviceId' => 'Alexa For Business', 'signatureVersion' => 'v4', 'targetPrefix' => 'AlexaForBusiness', 'uid' => 'alexaforbusiness-2017-11-09', ], 'operations' => [ 'ApproveSkill' => [ 'name' => 'ApproveSkill', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ApproveSkillRequest', ], 'output' => [ 'shape' => 'ApproveSkillResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'AssociateContactWithAddressBook' => [ 'name' => 'AssociateContactWithAddressBook', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AssociateContactWithAddressBookRequest', ], 'output' => [ 'shape' => 'AssociateContactWithAddressBookResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'AssociateDeviceWithNetworkProfile' => [ 'name' => 'AssociateDeviceWithNetworkProfile', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AssociateDeviceWithNetworkProfileRequest', ], 'output' => [ 'shape' => 'AssociateDeviceWithNetworkProfileResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'DeviceNotRegisteredException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'AssociateDeviceWithRoom' => [ 'name' => 'AssociateDeviceWithRoom', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AssociateDeviceWithRoomRequest', ], 'output' => [ 'shape' => 'AssociateDeviceWithRoomResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'DeviceNotRegisteredException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'AssociateSkillGroupWithRoom' => [ 'name' => 'AssociateSkillGroupWithRoom', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AssociateSkillGroupWithRoomRequest', ], 'output' => [ 'shape' => 'AssociateSkillGroupWithRoomResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'AssociateSkillWithSkillGroup' => [ 'name' => 'AssociateSkillWithSkillGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AssociateSkillWithSkillGroupRequest', ], 'output' => [ 'shape' => 'AssociateSkillWithSkillGroupResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'SkillNotLinkedException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'AssociateSkillWithUsers' => [ 'name' => 'AssociateSkillWithUsers', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AssociateSkillWithUsersRequest', ], 'output' => [ 'shape' => 'AssociateSkillWithUsersResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'CreateAddressBook' => [ 'name' => 'CreateAddressBook', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateAddressBookRequest', ], 'output' => [ 'shape' => 'CreateAddressBookResponse', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'LimitExceededException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'CreateBusinessReportSchedule' => [ 'name' => 'CreateBusinessReportSchedule', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateBusinessReportScheduleRequest', ], 'output' => [ 'shape' => 'CreateBusinessReportScheduleResponse', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'CreateConferenceProvider' => [ 'name' => 'CreateConferenceProvider', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateConferenceProviderRequest', ], 'output' => [ 'shape' => 'CreateConferenceProviderResponse', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'CreateContact' => [ 'name' => 'CreateContact', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateContactRequest', ], 'output' => [ 'shape' => 'CreateContactResponse', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'LimitExceededException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'CreateGatewayGroup' => [ 'name' => 'CreateGatewayGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateGatewayGroupRequest', ], 'output' => [ 'shape' => 'CreateGatewayGroupResponse', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'LimitExceededException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'CreateNetworkProfile' => [ 'name' => 'CreateNetworkProfile', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateNetworkProfileRequest', ], 'output' => [ 'shape' => 'CreateNetworkProfileResponse', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InvalidCertificateAuthorityException', ], [ 'shape' => 'InvalidServiceLinkedRoleStateException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'CreateProfile' => [ 'name' => 'CreateProfile', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateProfileRequest', ], 'output' => [ 'shape' => 'CreateProfileResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'CreateRoom' => [ 'name' => 'CreateRoom', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateRoomRequest', ], 'output' => [ 'shape' => 'CreateRoomResponse', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'LimitExceededException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'CreateSkillGroup' => [ 'name' => 'CreateSkillGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateSkillGroupRequest', ], 'output' => [ 'shape' => 'CreateSkillGroupResponse', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'CreateUser' => [ 'name' => 'CreateUser', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateUserRequest', ], 'output' => [ 'shape' => 'CreateUserResponse', ], 'errors' => [ [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DeleteAddressBook' => [ 'name' => 'DeleteAddressBook', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteAddressBookRequest', ], 'output' => [ 'shape' => 'DeleteAddressBookResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DeleteBusinessReportSchedule' => [ 'name' => 'DeleteBusinessReportSchedule', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteBusinessReportScheduleRequest', ], 'output' => [ 'shape' => 'DeleteBusinessReportScheduleResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DeleteConferenceProvider' => [ 'name' => 'DeleteConferenceProvider', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteConferenceProviderRequest', ], 'output' => [ 'shape' => 'DeleteConferenceProviderResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DeleteContact' => [ 'name' => 'DeleteContact', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteContactRequest', ], 'output' => [ 'shape' => 'DeleteContactResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DeleteDevice' => [ 'name' => 'DeleteDevice', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteDeviceRequest', ], 'output' => [ 'shape' => 'DeleteDeviceResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InvalidCertificateAuthorityException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DeleteDeviceUsageData' => [ 'name' => 'DeleteDeviceUsageData', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteDeviceUsageDataRequest', ], 'output' => [ 'shape' => 'DeleteDeviceUsageDataResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'DeviceNotRegisteredException', ], [ 'shape' => 'LimitExceededException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DeleteGatewayGroup' => [ 'name' => 'DeleteGatewayGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteGatewayGroupRequest', ], 'output' => [ 'shape' => 'DeleteGatewayGroupResponse', ], 'errors' => [ [ 'shape' => 'ResourceAssociatedException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DeleteNetworkProfile' => [ 'name' => 'DeleteNetworkProfile', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteNetworkProfileRequest', ], 'output' => [ 'shape' => 'DeleteNetworkProfileResponse', ], 'errors' => [ [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DeleteProfile' => [ 'name' => 'DeleteProfile', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteProfileRequest', ], 'output' => [ 'shape' => 'DeleteProfileResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DeleteRoom' => [ 'name' => 'DeleteRoom', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteRoomRequest', ], 'output' => [ 'shape' => 'DeleteRoomResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DeleteRoomSkillParameter' => [ 'name' => 'DeleteRoomSkillParameter', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteRoomSkillParameterRequest', ], 'output' => [ 'shape' => 'DeleteRoomSkillParameterResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DeleteSkillAuthorization' => [ 'name' => 'DeleteSkillAuthorization', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteSkillAuthorizationRequest', ], 'output' => [ 'shape' => 'DeleteSkillAuthorizationResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DeleteSkillGroup' => [ 'name' => 'DeleteSkillGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteSkillGroupRequest', ], 'output' => [ 'shape' => 'DeleteSkillGroupResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DeleteUser' => [ 'name' => 'DeleteUser', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteUserRequest', ], 'output' => [ 'shape' => 'DeleteUserResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DisassociateContactFromAddressBook' => [ 'name' => 'DisassociateContactFromAddressBook', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DisassociateContactFromAddressBookRequest', ], 'output' => [ 'shape' => 'DisassociateContactFromAddressBookResponse', ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DisassociateDeviceFromRoom' => [ 'name' => 'DisassociateDeviceFromRoom', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DisassociateDeviceFromRoomRequest', ], 'output' => [ 'shape' => 'DisassociateDeviceFromRoomResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'DeviceNotRegisteredException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DisassociateSkillFromSkillGroup' => [ 'name' => 'DisassociateSkillFromSkillGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DisassociateSkillFromSkillGroupRequest', ], 'output' => [ 'shape' => 'DisassociateSkillFromSkillGroupResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DisassociateSkillFromUsers' => [ 'name' => 'DisassociateSkillFromUsers', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DisassociateSkillFromUsersRequest', ], 'output' => [ 'shape' => 'DisassociateSkillFromUsersResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'DisassociateSkillGroupFromRoom' => [ 'name' => 'DisassociateSkillGroupFromRoom', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DisassociateSkillGroupFromRoomRequest', ], 'output' => [ 'shape' => 'DisassociateSkillGroupFromRoomResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'ForgetSmartHomeAppliances' => [ 'name' => 'ForgetSmartHomeAppliances', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ForgetSmartHomeAppliancesRequest', ], 'output' => [ 'shape' => 'ForgetSmartHomeAppliancesResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'GetAddressBook' => [ 'name' => 'GetAddressBook', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetAddressBookRequest', ], 'output' => [ 'shape' => 'GetAddressBookResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'GetConferencePreference' => [ 'name' => 'GetConferencePreference', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetConferencePreferenceRequest', ], 'output' => [ 'shape' => 'GetConferencePreferenceResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'GetConferenceProvider' => [ 'name' => 'GetConferenceProvider', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetConferenceProviderRequest', ], 'output' => [ 'shape' => 'GetConferenceProviderResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'GetContact' => [ 'name' => 'GetContact', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetContactRequest', ], 'output' => [ 'shape' => 'GetContactResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'GetDevice' => [ 'name' => 'GetDevice', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetDeviceRequest', ], 'output' => [ 'shape' => 'GetDeviceResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'GetGateway' => [ 'name' => 'GetGateway', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetGatewayRequest', ], 'output' => [ 'shape' => 'GetGatewayResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'GetGatewayGroup' => [ 'name' => 'GetGatewayGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetGatewayGroupRequest', ], 'output' => [ 'shape' => 'GetGatewayGroupResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'GetInvitationConfiguration' => [ 'name' => 'GetInvitationConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetInvitationConfigurationRequest', ], 'output' => [ 'shape' => 'GetInvitationConfigurationResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'GetNetworkProfile' => [ 'name' => 'GetNetworkProfile', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetNetworkProfileRequest', ], 'output' => [ 'shape' => 'GetNetworkProfileResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InvalidSecretsManagerResourceException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'GetProfile' => [ 'name' => 'GetProfile', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetProfileRequest', ], 'output' => [ 'shape' => 'GetProfileResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'GetRoom' => [ 'name' => 'GetRoom', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetRoomRequest', ], 'output' => [ 'shape' => 'GetRoomResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'GetRoomSkillParameter' => [ 'name' => 'GetRoomSkillParameter', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetRoomSkillParameterRequest', ], 'output' => [ 'shape' => 'GetRoomSkillParameterResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'GetSkillGroup' => [ 'name' => 'GetSkillGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetSkillGroupRequest', ], 'output' => [ 'shape' => 'GetSkillGroupResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'ListBusinessReportSchedules' => [ 'name' => 'ListBusinessReportSchedules', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListBusinessReportSchedulesRequest', ], 'output' => [ 'shape' => 'ListBusinessReportSchedulesResponse', ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'ListConferenceProviders' => [ 'name' => 'ListConferenceProviders', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListConferenceProvidersRequest', ], 'output' => [ 'shape' => 'ListConferenceProvidersResponse', ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'ListDeviceEvents' => [ 'name' => 'ListDeviceEvents', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListDeviceEventsRequest', ], 'output' => [ 'shape' => 'ListDeviceEventsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'ListGatewayGroups' => [ 'name' => 'ListGatewayGroups', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListGatewayGroupsRequest', ], 'output' => [ 'shape' => 'ListGatewayGroupsResponse', ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'ListGateways' => [ 'name' => 'ListGateways', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListGatewaysRequest', ], 'output' => [ 'shape' => 'ListGatewaysResponse', ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'ListSkills' => [ 'name' => 'ListSkills', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListSkillsRequest', ], 'output' => [ 'shape' => 'ListSkillsResponse', ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'ListSkillsStoreCategories' => [ 'name' => 'ListSkillsStoreCategories', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListSkillsStoreCategoriesRequest', ], 'output' => [ 'shape' => 'ListSkillsStoreCategoriesResponse', ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'ListSkillsStoreSkillsByCategory' => [ 'name' => 'ListSkillsStoreSkillsByCategory', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListSkillsStoreSkillsByCategoryRequest', ], 'output' => [ 'shape' => 'ListSkillsStoreSkillsByCategoryResponse', ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'ListSmartHomeAppliances' => [ 'name' => 'ListSmartHomeAppliances', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListSmartHomeAppliancesRequest', ], 'output' => [ 'shape' => 'ListSmartHomeAppliancesResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'ListTags' => [ 'name' => 'ListTags', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListTagsRequest', ], 'output' => [ 'shape' => 'ListTagsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'PutConferencePreference' => [ 'name' => 'PutConferencePreference', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutConferencePreferenceRequest', ], 'output' => [ 'shape' => 'PutConferencePreferenceResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'PutInvitationConfiguration' => [ 'name' => 'PutInvitationConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutInvitationConfigurationRequest', ], 'output' => [ 'shape' => 'PutInvitationConfigurationResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'PutRoomSkillParameter' => [ 'name' => 'PutRoomSkillParameter', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutRoomSkillParameterRequest', ], 'output' => [ 'shape' => 'PutRoomSkillParameterResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'PutSkillAuthorization' => [ 'name' => 'PutSkillAuthorization', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutSkillAuthorizationRequest', ], 'output' => [ 'shape' => 'PutSkillAuthorizationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'RegisterAVSDevice' => [ 'name' => 'RegisterAVSDevice', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'RegisterAVSDeviceRequest', ], 'output' => [ 'shape' => 'RegisterAVSDeviceResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InvalidDeviceException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'RejectSkill' => [ 'name' => 'RejectSkill', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'RejectSkillRequest', ], 'output' => [ 'shape' => 'RejectSkillResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'ResolveRoom' => [ 'name' => 'ResolveRoom', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ResolveRoomRequest', ], 'output' => [ 'shape' => 'ResolveRoomResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'RevokeInvitation' => [ 'name' => 'RevokeInvitation', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'RevokeInvitationRequest', ], 'output' => [ 'shape' => 'RevokeInvitationResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'SearchAddressBooks' => [ 'name' => 'SearchAddressBooks', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SearchAddressBooksRequest', ], 'output' => [ 'shape' => 'SearchAddressBooksResponse', ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'SearchContacts' => [ 'name' => 'SearchContacts', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SearchContactsRequest', ], 'output' => [ 'shape' => 'SearchContactsResponse', ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'SearchDevices' => [ 'name' => 'SearchDevices', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SearchDevicesRequest', ], 'output' => [ 'shape' => 'SearchDevicesResponse', ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'SearchNetworkProfiles' => [ 'name' => 'SearchNetworkProfiles', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SearchNetworkProfilesRequest', ], 'output' => [ 'shape' => 'SearchNetworkProfilesResponse', ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'SearchProfiles' => [ 'name' => 'SearchProfiles', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SearchProfilesRequest', ], 'output' => [ 'shape' => 'SearchProfilesResponse', ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'SearchRooms' => [ 'name' => 'SearchRooms', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SearchRoomsRequest', ], 'output' => [ 'shape' => 'SearchRoomsResponse', ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'SearchSkillGroups' => [ 'name' => 'SearchSkillGroups', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SearchSkillGroupsRequest', ], 'output' => [ 'shape' => 'SearchSkillGroupsResponse', ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'SearchUsers' => [ 'name' => 'SearchUsers', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SearchUsersRequest', ], 'output' => [ 'shape' => 'SearchUsersResponse', ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'SendAnnouncement' => [ 'name' => 'SendAnnouncement', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SendAnnouncementRequest', ], 'output' => [ 'shape' => 'SendAnnouncementResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AlreadyExistsException', ], ], ], 'SendInvitation' => [ 'name' => 'SendInvitation', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SendInvitationRequest', ], 'output' => [ 'shape' => 'SendInvitationResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InvalidUserStatusException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'StartDeviceSync' => [ 'name' => 'StartDeviceSync', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StartDeviceSyncRequest', ], 'output' => [ 'shape' => 'StartDeviceSyncResponse', ], 'errors' => [ [ 'shape' => 'DeviceNotRegisteredException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'StartSmartHomeApplianceDiscovery' => [ 'name' => 'StartSmartHomeApplianceDiscovery', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StartSmartHomeApplianceDiscoveryRequest', ], 'output' => [ 'shape' => 'StartSmartHomeApplianceDiscoveryResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'UpdateAddressBook' => [ 'name' => 'UpdateAddressBook', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateAddressBookRequest', ], 'output' => [ 'shape' => 'UpdateAddressBookResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'NameInUseException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'UpdateBusinessReportSchedule' => [ 'name' => 'UpdateBusinessReportSchedule', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateBusinessReportScheduleRequest', ], 'output' => [ 'shape' => 'UpdateBusinessReportScheduleResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'UpdateConferenceProvider' => [ 'name' => 'UpdateConferenceProvider', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateConferenceProviderRequest', ], 'output' => [ 'shape' => 'UpdateConferenceProviderResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'UpdateContact' => [ 'name' => 'UpdateContact', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateContactRequest', ], 'output' => [ 'shape' => 'UpdateContactResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'UpdateDevice' => [ 'name' => 'UpdateDevice', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateDeviceRequest', ], 'output' => [ 'shape' => 'UpdateDeviceResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'DeviceNotRegisteredException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'UpdateGateway' => [ 'name' => 'UpdateGateway', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateGatewayRequest', ], 'output' => [ 'shape' => 'UpdateGatewayResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'NameInUseException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'UpdateGatewayGroup' => [ 'name' => 'UpdateGatewayGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateGatewayGroupRequest', ], 'output' => [ 'shape' => 'UpdateGatewayGroupResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'NameInUseException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'UpdateNetworkProfile' => [ 'name' => 'UpdateNetworkProfile', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateNetworkProfileRequest', ], 'output' => [ 'shape' => 'UpdateNetworkProfileResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'NameInUseException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InvalidCertificateAuthorityException', ], [ 'shape' => 'InvalidSecretsManagerResourceException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'UpdateProfile' => [ 'name' => 'UpdateProfile', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateProfileRequest', ], 'output' => [ 'shape' => 'UpdateProfileResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'NameInUseException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'UpdateRoom' => [ 'name' => 'UpdateRoom', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateRoomRequest', ], 'output' => [ 'shape' => 'UpdateRoomResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'NameInUseException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], 'UpdateSkillGroup' => [ 'name' => 'UpdateSkillGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateSkillGroupRequest', ], 'output' => [ 'shape' => 'UpdateSkillGroupResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'NameInUseException', ], [ 'shape' => 'ConcurrentModificationException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported', ], ], 'shapes' => [ 'Address' => [ 'type' => 'string', 'max' => 500, 'min' => 1, ], 'AddressBook' => [ 'type' => 'structure', 'members' => [ 'AddressBookArn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'AddressBookName', ], 'Description' => [ 'shape' => 'AddressBookDescription', ], ], ], 'AddressBookData' => [ 'type' => 'structure', 'members' => [ 'AddressBookArn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'AddressBookName', ], 'Description' => [ 'shape' => 'AddressBookDescription', ], ], ], 'AddressBookDataList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AddressBookData', ], ], 'AddressBookDescription' => [ 'type' => 'string', 'max' => 200, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'AddressBookName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'AlreadyExistsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'AmazonId' => [ 'type' => 'string', 'pattern' => '[a-zA-Z0-9]{1,18}', ], 'ApplianceDescription' => [ 'type' => 'string', ], 'ApplianceFriendlyName' => [ 'type' => 'string', ], 'ApplianceManufacturerName' => [ 'type' => 'string', ], 'ApproveSkillRequest' => [ 'type' => 'structure', 'required' => [ 'SkillId', ], 'members' => [ 'SkillId' => [ 'shape' => 'SkillId', ], ], ], 'ApproveSkillResponse' => [ 'type' => 'structure', 'members' => [], ], 'Arn' => [ 'type' => 'string', 'pattern' => 'arn:[a-z0-9-\\\\.]{1,63}:[a-z0-9-\\\\.]{0,63}:[a-z0-9-\\\\.]{0,63}:[a-z0-9-\\\\.]{0,63}:[^/].{0,1023}', ], 'AssociateContactWithAddressBookRequest' => [ 'type' => 'structure', 'required' => [ 'ContactArn', 'AddressBookArn', ], 'members' => [ 'ContactArn' => [ 'shape' => 'Arn', ], 'AddressBookArn' => [ 'shape' => 'Arn', ], ], ], 'AssociateContactWithAddressBookResponse' => [ 'type' => 'structure', 'members' => [], ], 'AssociateDeviceWithNetworkProfileRequest' => [ 'type' => 'structure', 'required' => [ 'DeviceArn', 'NetworkProfileArn', ], 'members' => [ 'DeviceArn' => [ 'shape' => 'Arn', ], 'NetworkProfileArn' => [ 'shape' => 'Arn', ], ], ], 'AssociateDeviceWithNetworkProfileResponse' => [ 'type' => 'structure', 'members' => [], ], 'AssociateDeviceWithRoomRequest' => [ 'type' => 'structure', 'members' => [ 'DeviceArn' => [ 'shape' => 'Arn', ], 'RoomArn' => [ 'shape' => 'Arn', ], ], ], 'AssociateDeviceWithRoomResponse' => [ 'type' => 'structure', 'members' => [], ], 'AssociateSkillGroupWithRoomRequest' => [ 'type' => 'structure', 'members' => [ 'SkillGroupArn' => [ 'shape' => 'Arn', ], 'RoomArn' => [ 'shape' => 'Arn', ], ], ], 'AssociateSkillGroupWithRoomResponse' => [ 'type' => 'structure', 'members' => [], ], 'AssociateSkillWithSkillGroupRequest' => [ 'type' => 'structure', 'required' => [ 'SkillId', ], 'members' => [ 'SkillGroupArn' => [ 'shape' => 'Arn', ], 'SkillId' => [ 'shape' => 'SkillId', ], ], ], 'AssociateSkillWithSkillGroupResponse' => [ 'type' => 'structure', 'members' => [], ], 'AssociateSkillWithUsersRequest' => [ 'type' => 'structure', 'required' => [ 'SkillId', ], 'members' => [ 'SkillId' => [ 'shape' => 'SkillId', ], ], ], 'AssociateSkillWithUsersResponse' => [ 'type' => 'structure', 'members' => [], ], 'Audio' => [ 'type' => 'structure', 'required' => [ 'Locale', 'Location', ], 'members' => [ 'Locale' => [ 'shape' => 'Locale', ], 'Location' => [ 'shape' => 'AudioLocation', ], ], ], 'AudioList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Audio', ], 'max' => 1, ], 'AudioLocation' => [ 'type' => 'string', 'max' => 1200, 'min' => 0, 'pattern' => 'https://([A-Za-z0-9_.-]+)?(s3-[A-Za-z0-9-]+|s3\\\\.([A-Za-z0-9-])+|s3|s3.dualstack\\\\.([A-Za-z0-9-])+)+.amazonaws.com/.*', ], 'AuthorizationResult' => [ 'type' => 'map', 'key' => [ 'shape' => 'Key', ], 'value' => [ 'shape' => 'Value', ], 'sensitive' => true, ], 'Boolean' => [ 'type' => 'boolean', ], 'BulletPoint' => [ 'type' => 'string', ], 'BulletPoints' => [ 'type' => 'list', 'member' => [ 'shape' => 'BulletPoint', ], ], 'BusinessReport' => [ 'type' => 'structure', 'members' => [ 'Status' => [ 'shape' => 'BusinessReportStatus', ], 'FailureCode' => [ 'shape' => 'BusinessReportFailureCode', ], 'S3Location' => [ 'shape' => 'BusinessReportS3Location', ], 'DeliveryTime' => [ 'shape' => 'BusinessReportDeliveryTime', ], 'DownloadUrl' => [ 'shape' => 'BusinessReportDownloadUrl', ], ], ], 'BusinessReportContentRange' => [ 'type' => 'structure', 'required' => [ 'Interval', ], 'members' => [ 'Interval' => [ 'shape' => 'BusinessReportInterval', ], ], ], 'BusinessReportDeliveryTime' => [ 'type' => 'timestamp', ], 'BusinessReportDownloadUrl' => [ 'type' => 'string', ], 'BusinessReportFailureCode' => [ 'type' => 'string', 'enum' => [ 'ACCESS_DENIED', 'NO_SUCH_BUCKET', 'INTERNAL_FAILURE', ], ], 'BusinessReportFormat' => [ 'type' => 'string', 'enum' => [ 'CSV', 'CSV_ZIP', ], ], 'BusinessReportInterval' => [ 'type' => 'string', 'enum' => [ 'ONE_DAY', 'ONE_WEEK', 'THIRTY_DAYS', ], ], 'BusinessReportRecurrence' => [ 'type' => 'structure', 'members' => [ 'StartDate' => [ 'shape' => 'Date', ], ], ], 'BusinessReportS3Location' => [ 'type' => 'structure', 'members' => [ 'Path' => [ 'shape' => 'BusinessReportS3Path', ], 'BucketName' => [ 'shape' => 'CustomerS3BucketName', ], ], ], 'BusinessReportS3Path' => [ 'type' => 'string', ], 'BusinessReportSchedule' => [ 'type' => 'structure', 'members' => [ 'ScheduleArn' => [ 'shape' => 'Arn', ], 'ScheduleName' => [ 'shape' => 'BusinessReportScheduleName', ], 'S3BucketName' => [ 'shape' => 'CustomerS3BucketName', ], 'S3KeyPrefix' => [ 'shape' => 'S3KeyPrefix', ], 'Format' => [ 'shape' => 'BusinessReportFormat', ], 'ContentRange' => [ 'shape' => 'BusinessReportContentRange', ], 'Recurrence' => [ 'shape' => 'BusinessReportRecurrence', ], 'LastBusinessReport' => [ 'shape' => 'BusinessReport', ], ], ], 'BusinessReportScheduleList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BusinessReportSchedule', ], ], 'BusinessReportScheduleName' => [ 'type' => 'string', 'max' => 64, 'min' => 0, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'BusinessReportStatus' => [ 'type' => 'string', 'enum' => [ 'RUNNING', 'SUCCEEDED', 'FAILED', ], ], 'Category' => [ 'type' => 'structure', 'members' => [ 'CategoryId' => [ 'shape' => 'CategoryId', ], 'CategoryName' => [ 'shape' => 'CategoryName', ], ], ], 'CategoryId' => [ 'type' => 'long', 'min' => 1, ], 'CategoryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Category', ], ], 'CategoryName' => [ 'type' => 'string', ], 'CertificateTime' => [ 'type' => 'timestamp', ], 'ClientId' => [ 'type' => 'string', 'pattern' => '^\\\\S+{1,256}$', ], 'ClientRequestToken' => [ 'type' => 'string', 'max' => 150, 'min' => 10, 'pattern' => '[a-zA-Z0-9][a-zA-Z0-9_-]*', ], 'CommsProtocol' => [ 'type' => 'string', 'enum' => [ 'SIP', 'SIPS', 'H323', ], ], 'ConcurrentModificationException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ConferencePreference' => [ 'type' => 'structure', 'members' => [ 'DefaultConferenceProviderArn' => [ 'shape' => 'Arn', ], ], ], 'ConferenceProvider' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'ConferenceProviderName', ], 'Type' => [ 'shape' => 'ConferenceProviderType', ], 'IPDialIn' => [ 'shape' => 'IPDialIn', ], 'PSTNDialIn' => [ 'shape' => 'PSTNDialIn', ], 'MeetingSetting' => [ 'shape' => 'MeetingSetting', ], ], ], 'ConferenceProviderName' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'ConferenceProviderType' => [ 'type' => 'string', 'enum' => [ 'CHIME', 'BLUEJEANS', 'FUZE', 'GOOGLE_HANGOUTS', 'POLYCOM', 'RINGCENTRAL', 'SKYPE_FOR_BUSINESS', 'WEBEX', 'ZOOM', 'CUSTOM', ], ], 'ConferenceProvidersList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConferenceProvider', ], ], 'ConnectionStatus' => [ 'type' => 'string', 'enum' => [ 'ONLINE', 'OFFLINE', ], ], 'ConnectionStatusUpdatedTime' => [ 'type' => 'timestamp', ], 'Contact' => [ 'type' => 'structure', 'members' => [ 'ContactArn' => [ 'shape' => 'Arn', ], 'DisplayName' => [ 'shape' => 'ContactName', ], 'FirstName' => [ 'shape' => 'ContactName', ], 'LastName' => [ 'shape' => 'ContactName', ], 'PhoneNumber' => [ 'shape' => 'RawPhoneNumber', ], 'PhoneNumbers' => [ 'shape' => 'PhoneNumberList', ], 'SipAddresses' => [ 'shape' => 'SipAddressList', ], ], ], 'ContactData' => [ 'type' => 'structure', 'members' => [ 'ContactArn' => [ 'shape' => 'Arn', ], 'DisplayName' => [ 'shape' => 'ContactName', ], 'FirstName' => [ 'shape' => 'ContactName', ], 'LastName' => [ 'shape' => 'ContactName', ], 'PhoneNumber' => [ 'shape' => 'RawPhoneNumber', ], 'PhoneNumbers' => [ 'shape' => 'PhoneNumberList', ], 'SipAddresses' => [ 'shape' => 'SipAddressList', ], ], ], 'ContactDataList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ContactData', ], ], 'ContactName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'Content' => [ 'type' => 'structure', 'members' => [ 'TextList' => [ 'shape' => 'TextList', ], 'SsmlList' => [ 'shape' => 'SsmlList', ], 'AudioList' => [ 'shape' => 'AudioList', ], ], ], 'CountryCode' => [ 'type' => 'string', 'pattern' => '\\\\d{1,3}', ], 'CreateAddressBookRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'AddressBookName', ], 'Description' => [ 'shape' => 'AddressBookDescription', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateAddressBookResponse' => [ 'type' => 'structure', 'members' => [ 'AddressBookArn' => [ 'shape' => 'Arn', ], ], ], 'CreateBusinessReportScheduleRequest' => [ 'type' => 'structure', 'required' => [ 'Format', 'ContentRange', ], 'members' => [ 'ScheduleName' => [ 'shape' => 'BusinessReportScheduleName', ], 'S3BucketName' => [ 'shape' => 'CustomerS3BucketName', ], 'S3KeyPrefix' => [ 'shape' => 'S3KeyPrefix', ], 'Format' => [ 'shape' => 'BusinessReportFormat', ], 'ContentRange' => [ 'shape' => 'BusinessReportContentRange', ], 'Recurrence' => [ 'shape' => 'BusinessReportRecurrence', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateBusinessReportScheduleResponse' => [ 'type' => 'structure', 'members' => [ 'ScheduleArn' => [ 'shape' => 'Arn', ], ], ], 'CreateConferenceProviderRequest' => [ 'type' => 'structure', 'required' => [ 'ConferenceProviderName', 'ConferenceProviderType', 'MeetingSetting', ], 'members' => [ 'ConferenceProviderName' => [ 'shape' => 'ConferenceProviderName', ], 'ConferenceProviderType' => [ 'shape' => 'ConferenceProviderType', ], 'IPDialIn' => [ 'shape' => 'IPDialIn', ], 'PSTNDialIn' => [ 'shape' => 'PSTNDialIn', ], 'MeetingSetting' => [ 'shape' => 'MeetingSetting', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateConferenceProviderResponse' => [ 'type' => 'structure', 'members' => [ 'ConferenceProviderArn' => [ 'shape' => 'Arn', ], ], ], 'CreateContactRequest' => [ 'type' => 'structure', 'required' => [ 'FirstName', ], 'members' => [ 'DisplayName' => [ 'shape' => 'ContactName', ], 'FirstName' => [ 'shape' => 'ContactName', ], 'LastName' => [ 'shape' => 'ContactName', ], 'PhoneNumber' => [ 'shape' => 'RawPhoneNumber', ], 'PhoneNumbers' => [ 'shape' => 'PhoneNumberList', ], 'SipAddresses' => [ 'shape' => 'SipAddressList', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateContactResponse' => [ 'type' => 'structure', 'members' => [ 'ContactArn' => [ 'shape' => 'Arn', ], ], ], 'CreateEndOfMeetingReminder' => [ 'type' => 'structure', 'required' => [ 'ReminderAtMinutes', 'ReminderType', 'Enabled', ], 'members' => [ 'ReminderAtMinutes' => [ 'shape' => 'EndOfMeetingReminderMinutesList', ], 'ReminderType' => [ 'shape' => 'EndOfMeetingReminderType', ], 'Enabled' => [ 'shape' => 'Boolean', ], ], ], 'CreateGatewayGroupRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'ClientRequestToken', ], 'members' => [ 'Name' => [ 'shape' => 'GatewayGroupName', ], 'Description' => [ 'shape' => 'GatewayGroupDescription', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateGatewayGroupResponse' => [ 'type' => 'structure', 'members' => [ 'GatewayGroupArn' => [ 'shape' => 'Arn', ], ], ], 'CreateInstantBooking' => [ 'type' => 'structure', 'required' => [ 'DurationInMinutes', 'Enabled', ], 'members' => [ 'DurationInMinutes' => [ 'shape' => 'Minutes', ], 'Enabled' => [ 'shape' => 'Boolean', ], ], ], 'CreateMeetingRoomConfiguration' => [ 'type' => 'structure', 'members' => [ 'RoomUtilizationMetricsEnabled' => [ 'shape' => 'Boolean', ], 'EndOfMeetingReminder' => [ 'shape' => 'CreateEndOfMeetingReminder', ], 'InstantBooking' => [ 'shape' => 'CreateInstantBooking', ], 'RequireCheckIn' => [ 'shape' => 'CreateRequireCheckIn', ], 'ProactiveJoin' => [ 'shape' => 'CreateProactiveJoin', ], ], ], 'CreateNetworkProfileRequest' => [ 'type' => 'structure', 'required' => [ 'NetworkProfileName', 'Ssid', 'SecurityType', 'ClientRequestToken', ], 'members' => [ 'NetworkProfileName' => [ 'shape' => 'NetworkProfileName', ], 'Description' => [ 'shape' => 'NetworkProfileDescription', ], 'Ssid' => [ 'shape' => 'NetworkSsid', ], 'SecurityType' => [ 'shape' => 'NetworkSecurityType', ], 'EapMethod' => [ 'shape' => 'NetworkEapMethod', ], 'CurrentPassword' => [ 'shape' => 'CurrentWiFiPassword', ], 'NextPassword' => [ 'shape' => 'NextWiFiPassword', ], 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'TrustAnchors' => [ 'shape' => 'TrustAnchorList', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateNetworkProfileResponse' => [ 'type' => 'structure', 'members' => [ 'NetworkProfileArn' => [ 'shape' => 'Arn', ], ], ], 'CreateProactiveJoin' => [ 'type' => 'structure', 'required' => [ 'EnabledByMotion', ], 'members' => [ 'EnabledByMotion' => [ 'shape' => 'Boolean', ], ], ], 'CreateProfileRequest' => [ 'type' => 'structure', 'required' => [ 'ProfileName', 'Timezone', 'Address', 'DistanceUnit', 'TemperatureUnit', 'WakeWord', ], 'members' => [ 'ProfileName' => [ 'shape' => 'ProfileName', ], 'Timezone' => [ 'shape' => 'Timezone', ], 'Address' => [ 'shape' => 'Address', ], 'DistanceUnit' => [ 'shape' => 'DistanceUnit', ], 'TemperatureUnit' => [ 'shape' => 'TemperatureUnit', ], 'WakeWord' => [ 'shape' => 'WakeWord', ], 'Locale' => [ 'shape' => 'DeviceLocale', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'SetupModeDisabled' => [ 'shape' => 'Boolean', ], 'MaxVolumeLimit' => [ 'shape' => 'MaxVolumeLimit', ], 'PSTNEnabled' => [ 'shape' => 'Boolean', ], 'DataRetentionOptIn' => [ 'shape' => 'Boolean', ], 'MeetingRoomConfiguration' => [ 'shape' => 'CreateMeetingRoomConfiguration', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateProfileResponse' => [ 'type' => 'structure', 'members' => [ 'ProfileArn' => [ 'shape' => 'Arn', ], ], ], 'CreateRequireCheckIn' => [ 'type' => 'structure', 'required' => [ 'ReleaseAfterMinutes', 'Enabled', ], 'members' => [ 'ReleaseAfterMinutes' => [ 'shape' => 'Minutes', ], 'Enabled' => [ 'shape' => 'Boolean', ], ], ], 'CreateRoomRequest' => [ 'type' => 'structure', 'required' => [ 'RoomName', ], 'members' => [ 'RoomName' => [ 'shape' => 'RoomName', ], 'Description' => [ 'shape' => 'RoomDescription', ], 'ProfileArn' => [ 'shape' => 'Arn', ], 'ProviderCalendarId' => [ 'shape' => 'ProviderCalendarId', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateRoomResponse' => [ 'type' => 'structure', 'members' => [ 'RoomArn' => [ 'shape' => 'Arn', ], ], ], 'CreateSkillGroupRequest' => [ 'type' => 'structure', 'required' => [ 'SkillGroupName', ], 'members' => [ 'SkillGroupName' => [ 'shape' => 'SkillGroupName', ], 'Description' => [ 'shape' => 'SkillGroupDescription', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateSkillGroupResponse' => [ 'type' => 'structure', 'members' => [ 'SkillGroupArn' => [ 'shape' => 'Arn', ], ], ], 'CreateUserRequest' => [ 'type' => 'structure', 'required' => [ 'UserId', ], 'members' => [ 'UserId' => [ 'shape' => 'user_UserId', ], 'FirstName' => [ 'shape' => 'user_FirstName', ], 'LastName' => [ 'shape' => 'user_LastName', ], 'Email' => [ 'shape' => 'Email', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateUserResponse' => [ 'type' => 'structure', 'members' => [ 'UserArn' => [ 'shape' => 'Arn', ], ], ], 'CurrentWiFiPassword' => [ 'type' => 'string', 'max' => 128, 'min' => 5, 'pattern' => '[\\\\x00-\\\\x7F]*', 'sensitive' => true, ], 'CustomerS3BucketName' => [ 'type' => 'string', 'pattern' => '[a-z0-9-\\\\.]{3,63}', ], 'Date' => [ 'type' => 'string', 'pattern' => '^\\\\d{4}\\\\-(0?[1-9]|1[012])\\\\-(0?[1-9]|[12][0-9]|3[01])$', ], 'DeleteAddressBookRequest' => [ 'type' => 'structure', 'required' => [ 'AddressBookArn', ], 'members' => [ 'AddressBookArn' => [ 'shape' => 'Arn', ], ], ], 'DeleteAddressBookResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteBusinessReportScheduleRequest' => [ 'type' => 'structure', 'required' => [ 'ScheduleArn', ], 'members' => [ 'ScheduleArn' => [ 'shape' => 'Arn', ], ], ], 'DeleteBusinessReportScheduleResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteConferenceProviderRequest' => [ 'type' => 'structure', 'required' => [ 'ConferenceProviderArn', ], 'members' => [ 'ConferenceProviderArn' => [ 'shape' => 'Arn', ], ], ], 'DeleteConferenceProviderResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteContactRequest' => [ 'type' => 'structure', 'required' => [ 'ContactArn', ], 'members' => [ 'ContactArn' => [ 'shape' => 'Arn', ], ], ], 'DeleteContactResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteDeviceRequest' => [ 'type' => 'structure', 'required' => [ 'DeviceArn', ], 'members' => [ 'DeviceArn' => [ 'shape' => 'Arn', ], ], ], 'DeleteDeviceResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteDeviceUsageDataRequest' => [ 'type' => 'structure', 'required' => [ 'DeviceArn', 'DeviceUsageType', ], 'members' => [ 'DeviceArn' => [ 'shape' => 'Arn', ], 'DeviceUsageType' => [ 'shape' => 'DeviceUsageType', ], ], ], 'DeleteDeviceUsageDataResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteGatewayGroupRequest' => [ 'type' => 'structure', 'required' => [ 'GatewayGroupArn', ], 'members' => [ 'GatewayGroupArn' => [ 'shape' => 'Arn', ], ], ], 'DeleteGatewayGroupResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteNetworkProfileRequest' => [ 'type' => 'structure', 'required' => [ 'NetworkProfileArn', ], 'members' => [ 'NetworkProfileArn' => [ 'shape' => 'Arn', ], ], ], 'DeleteNetworkProfileResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteProfileRequest' => [ 'type' => 'structure', 'members' => [ 'ProfileArn' => [ 'shape' => 'Arn', ], ], ], 'DeleteProfileResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteRoomRequest' => [ 'type' => 'structure', 'members' => [ 'RoomArn' => [ 'shape' => 'Arn', ], ], ], 'DeleteRoomResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteRoomSkillParameterRequest' => [ 'type' => 'structure', 'required' => [ 'SkillId', 'ParameterKey', ], 'members' => [ 'RoomArn' => [ 'shape' => 'Arn', ], 'SkillId' => [ 'shape' => 'SkillId', ], 'ParameterKey' => [ 'shape' => 'RoomSkillParameterKey', ], ], ], 'DeleteRoomSkillParameterResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteSkillAuthorizationRequest' => [ 'type' => 'structure', 'required' => [ 'SkillId', ], 'members' => [ 'SkillId' => [ 'shape' => 'SkillId', ], 'RoomArn' => [ 'shape' => 'Arn', ], ], ], 'DeleteSkillAuthorizationResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteSkillGroupRequest' => [ 'type' => 'structure', 'members' => [ 'SkillGroupArn' => [ 'shape' => 'Arn', ], ], ], 'DeleteSkillGroupResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteUserRequest' => [ 'type' => 'structure', 'required' => [ 'EnrollmentId', ], 'members' => [ 'UserArn' => [ 'shape' => 'Arn', ], 'EnrollmentId' => [ 'shape' => 'EnrollmentId', ], ], ], 'DeleteUserResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeveloperInfo' => [ 'type' => 'structure', 'members' => [ 'DeveloperName' => [ 'shape' => 'DeveloperName', ], 'PrivacyPolicy' => [ 'shape' => 'PrivacyPolicy', ], 'Email' => [ 'shape' => 'Email', ], 'Url' => [ 'shape' => 'Url', ], ], ], 'DeveloperName' => [ 'type' => 'string', ], 'Device' => [ 'type' => 'structure', 'members' => [ 'DeviceArn' => [ 'shape' => 'Arn', ], 'DeviceSerialNumber' => [ 'shape' => 'DeviceSerialNumber', ], 'DeviceType' => [ 'shape' => 'DeviceType', ], 'DeviceName' => [ 'shape' => 'DeviceName', ], 'SoftwareVersion' => [ 'shape' => 'SoftwareVersion', ], 'MacAddress' => [ 'shape' => 'MacAddress', ], 'RoomArn' => [ 'shape' => 'Arn', ], 'DeviceStatus' => [ 'shape' => 'DeviceStatus', ], 'DeviceStatusInfo' => [ 'shape' => 'DeviceStatusInfo', ], 'NetworkProfileInfo' => [ 'shape' => 'DeviceNetworkProfileInfo', ], ], ], 'DeviceData' => [ 'type' => 'structure', 'members' => [ 'DeviceArn' => [ 'shape' => 'Arn', ], 'DeviceSerialNumber' => [ 'shape' => 'DeviceSerialNumber', ], 'DeviceType' => [ 'shape' => 'DeviceType', ], 'DeviceName' => [ 'shape' => 'DeviceName', ], 'SoftwareVersion' => [ 'shape' => 'SoftwareVersion', ], 'MacAddress' => [ 'shape' => 'MacAddress', ], 'DeviceStatus' => [ 'shape' => 'DeviceStatus', ], 'NetworkProfileArn' => [ 'shape' => 'Arn', ], 'NetworkProfileName' => [ 'shape' => 'NetworkProfileName', ], 'RoomArn' => [ 'shape' => 'Arn', ], 'RoomName' => [ 'shape' => 'DeviceRoomName', ], 'DeviceStatusInfo' => [ 'shape' => 'DeviceStatusInfo', ], 'CreatedTime' => [ 'shape' => 'DeviceDataCreatedTime', ], ], ], 'DeviceDataCreatedTime' => [ 'type' => 'timestamp', ], 'DeviceDataList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DeviceData', ], ], 'DeviceEvent' => [ 'type' => 'structure', 'members' => [ 'Type' => [ 'shape' => 'DeviceEventType', ], 'Value' => [ 'shape' => 'DeviceEventValue', ], 'Timestamp' => [ 'shape' => 'DeviceEventTime', ], ], ], 'DeviceEventList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DeviceEvent', ], ], 'DeviceEventTime' => [ 'type' => 'timestamp', ], 'DeviceEventType' => [ 'type' => 'string', 'enum' => [ 'CONNECTION_STATUS', 'DEVICE_STATUS', ], ], 'DeviceEventValue' => [ 'type' => 'string', ], 'DeviceLocale' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'DeviceName' => [ 'type' => 'string', 'max' => 100, 'min' => 2, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'DeviceNetworkProfileInfo' => [ 'type' => 'structure', 'members' => [ 'NetworkProfileArn' => [ 'shape' => 'Arn', ], 'CertificateArn' => [ 'shape' => 'Arn', ], 'CertificateExpirationTime' => [ 'shape' => 'CertificateTime', ], ], ], 'DeviceNotRegisteredException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'DeviceRoomName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'DeviceSerialNumber' => [ 'type' => 'string', 'pattern' => '[a-zA-Z0-9]{1,200}', ], 'DeviceSerialNumberForAVS' => [ 'type' => 'string', 'pattern' => '^[a-zA-Z0-9]{1,50}$', ], 'DeviceStatus' => [ 'type' => 'string', 'enum' => [ 'READY', 'PENDING', 'WAS_OFFLINE', 'DEREGISTERED', 'FAILED', ], ], 'DeviceStatusDetail' => [ 'type' => 'structure', 'members' => [ 'Feature' => [ 'shape' => 'Feature', ], 'Code' => [ 'shape' => 'DeviceStatusDetailCode', ], ], ], 'DeviceStatusDetailCode' => [ 'type' => 'string', 'enum' => [ 'DEVICE_SOFTWARE_UPDATE_NEEDED', 'DEVICE_WAS_OFFLINE', 'CREDENTIALS_ACCESS_FAILURE', 'TLS_VERSION_MISMATCH', 'ASSOCIATION_REJECTION', 'AUTHENTICATION_FAILURE', 'DHCP_FAILURE', 'INTERNET_UNAVAILABLE', 'DNS_FAILURE', 'UNKNOWN_FAILURE', 'CERTIFICATE_ISSUING_LIMIT_EXCEEDED', 'INVALID_CERTIFICATE_AUTHORITY', 'NETWORK_PROFILE_NOT_FOUND', 'INVALID_PASSWORD_STATE', 'PASSWORD_NOT_FOUND', 'PASSWORD_MANAGER_ACCESS_DENIED', 'CERTIFICATE_AUTHORITY_ACCESS_DENIED', ], ], 'DeviceStatusDetails' => [ 'type' => 'list', 'member' => [ 'shape' => 'DeviceStatusDetail', ], ], 'DeviceStatusInfo' => [ 'type' => 'structure', 'members' => [ 'DeviceStatusDetails' => [ 'shape' => 'DeviceStatusDetails', ], 'ConnectionStatus' => [ 'shape' => 'ConnectionStatus', ], 'ConnectionStatusUpdatedTime' => [ 'shape' => 'ConnectionStatusUpdatedTime', ], ], ], 'DeviceType' => [ 'type' => 'string', 'pattern' => '[a-zA-Z0-9]{1,200}', ], 'DeviceUsageType' => [ 'type' => 'string', 'enum' => [ 'VOICE', ], ], 'DisassociateContactFromAddressBookRequest' => [ 'type' => 'structure', 'required' => [ 'ContactArn', 'AddressBookArn', ], 'members' => [ 'ContactArn' => [ 'shape' => 'Arn', ], 'AddressBookArn' => [ 'shape' => 'Arn', ], ], ], 'DisassociateContactFromAddressBookResponse' => [ 'type' => 'structure', 'members' => [], ], 'DisassociateDeviceFromRoomRequest' => [ 'type' => 'structure', 'members' => [ 'DeviceArn' => [ 'shape' => 'Arn', ], ], ], 'DisassociateDeviceFromRoomResponse' => [ 'type' => 'structure', 'members' => [], ], 'DisassociateSkillFromSkillGroupRequest' => [ 'type' => 'structure', 'required' => [ 'SkillId', ], 'members' => [ 'SkillGroupArn' => [ 'shape' => 'Arn', ], 'SkillId' => [ 'shape' => 'SkillId', ], ], ], 'DisassociateSkillFromSkillGroupResponse' => [ 'type' => 'structure', 'members' => [], ], 'DisassociateSkillFromUsersRequest' => [ 'type' => 'structure', 'required' => [ 'SkillId', ], 'members' => [ 'SkillId' => [ 'shape' => 'SkillId', ], ], ], 'DisassociateSkillFromUsersResponse' => [ 'type' => 'structure', 'members' => [], ], 'DisassociateSkillGroupFromRoomRequest' => [ 'type' => 'structure', 'members' => [ 'SkillGroupArn' => [ 'shape' => 'Arn', ], 'RoomArn' => [ 'shape' => 'Arn', ], ], ], 'DisassociateSkillGroupFromRoomResponse' => [ 'type' => 'structure', 'members' => [], ], 'DistanceUnit' => [ 'type' => 'string', 'enum' => [ 'METRIC', 'IMPERIAL', ], ], 'Email' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '\\\\w[+-.\\\\w]*@\\\\w[\\\\w\\\\.\\\\-]+\\\\.[0-9a-zA-Z]{2,24}', ], 'EnablementType' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'PENDING', ], ], 'EnablementTypeFilter' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'PENDING', ], ], 'EndOfMeetingReminder' => [ 'type' => 'structure', 'members' => [ 'ReminderAtMinutes' => [ 'shape' => 'EndOfMeetingReminderMinutesList', ], 'ReminderType' => [ 'shape' => 'EndOfMeetingReminderType', ], 'Enabled' => [ 'shape' => 'Boolean', ], ], ], 'EndOfMeetingReminderMinutesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Minutes', ], 'max' => 1, 'min' => 1, ], 'EndOfMeetingReminderType' => [ 'type' => 'string', 'enum' => [ 'ANNOUNCEMENT_TIME_CHECK', 'ANNOUNCEMENT_VARIABLE_TIME_LEFT', 'CHIME', 'KNOCK', ], ], 'EndUserLicenseAgreement' => [ 'type' => 'string', ], 'Endpoint' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'EnrollmentId' => [ 'type' => 'string', 'max' => 128, 'min' => 0, ], 'EnrollmentStatus' => [ 'type' => 'string', 'enum' => [ 'INITIALIZED', 'PENDING', 'REGISTERED', 'DISASSOCIATING', 'DEREGISTERING', ], ], 'ErrorMessage' => [ 'type' => 'string', ], 'Feature' => [ 'type' => 'string', 'enum' => [ 'BLUETOOTH', 'VOLUME', 'NOTIFICATIONS', 'LISTS', 'SKILLS', 'NETWORK_PROFILE', 'SETTINGS', 'ALL', ], ], 'Features' => [ 'type' => 'list', 'member' => [ 'shape' => 'Feature', ], ], 'Filter' => [ 'type' => 'structure', 'required' => [ 'Key', 'Values', ], 'members' => [ 'Key' => [ 'shape' => 'FilterKey', ], 'Values' => [ 'shape' => 'FilterValueList', ], ], ], 'FilterKey' => [ 'type' => 'string', 'max' => 500, 'min' => 1, ], 'FilterList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Filter', ], 'max' => 25, ], 'FilterValue' => [ 'type' => 'string', 'max' => 500, 'min' => 1, ], 'FilterValueList' => [ 'type' => 'list', 'member' => [ 'shape' => 'FilterValue', ], 'max' => 50, ], 'ForgetSmartHomeAppliancesRequest' => [ 'type' => 'structure', 'required' => [ 'RoomArn', ], 'members' => [ 'RoomArn' => [ 'shape' => 'Arn', ], ], ], 'ForgetSmartHomeAppliancesResponse' => [ 'type' => 'structure', 'members' => [], ], 'Gateway' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'GatewayName', ], 'Description' => [ 'shape' => 'GatewayDescription', ], 'GatewayGroupArn' => [ 'shape' => 'Arn', ], 'SoftwareVersion' => [ 'shape' => 'GatewayVersion', ], ], ], 'GatewayDescription' => [ 'type' => 'string', 'max' => 200, 'min' => 0, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'GatewayGroup' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'GatewayGroupName', ], 'Description' => [ 'shape' => 'GatewayGroupDescription', ], ], ], 'GatewayGroupDescription' => [ 'type' => 'string', 'max' => 200, 'min' => 0, ], 'GatewayGroupName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'GatewayGroupSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'GatewayGroupSummary', ], ], 'GatewayGroupSummary' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'GatewayGroupName', ], 'Description' => [ 'shape' => 'GatewayGroupDescription', ], ], ], 'GatewayName' => [ 'type' => 'string', 'max' => 253, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'GatewaySummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'GatewaySummary', ], ], 'GatewaySummary' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'GatewayName', ], 'Description' => [ 'shape' => 'GatewayDescription', ], 'GatewayGroupArn' => [ 'shape' => 'Arn', ], 'SoftwareVersion' => [ 'shape' => 'GatewayVersion', ], ], ], 'GatewayVersion' => [ 'type' => 'string', 'max' => 50, 'min' => 1, ], 'GenericKeyword' => [ 'type' => 'string', ], 'GenericKeywords' => [ 'type' => 'list', 'member' => [ 'shape' => 'GenericKeyword', ], ], 'GetAddressBookRequest' => [ 'type' => 'structure', 'required' => [ 'AddressBookArn', ], 'members' => [ 'AddressBookArn' => [ 'shape' => 'Arn', ], ], ], 'GetAddressBookResponse' => [ 'type' => 'structure', 'members' => [ 'AddressBook' => [ 'shape' => 'AddressBook', ], ], ], 'GetConferencePreferenceRequest' => [ 'type' => 'structure', 'members' => [], ], 'GetConferencePreferenceResponse' => [ 'type' => 'structure', 'members' => [ 'Preference' => [ 'shape' => 'ConferencePreference', ], ], ], 'GetConferenceProviderRequest' => [ 'type' => 'structure', 'required' => [ 'ConferenceProviderArn', ], 'members' => [ 'ConferenceProviderArn' => [ 'shape' => 'Arn', ], ], ], 'GetConferenceProviderResponse' => [ 'type' => 'structure', 'members' => [ 'ConferenceProvider' => [ 'shape' => 'ConferenceProvider', ], ], ], 'GetContactRequest' => [ 'type' => 'structure', 'required' => [ 'ContactArn', ], 'members' => [ 'ContactArn' => [ 'shape' => 'Arn', ], ], ], 'GetContactResponse' => [ 'type' => 'structure', 'members' => [ 'Contact' => [ 'shape' => 'Contact', ], ], ], 'GetDeviceRequest' => [ 'type' => 'structure', 'members' => [ 'DeviceArn' => [ 'shape' => 'Arn', ], ], ], 'GetDeviceResponse' => [ 'type' => 'structure', 'members' => [ 'Device' => [ 'shape' => 'Device', ], ], ], 'GetGatewayGroupRequest' => [ 'type' => 'structure', 'required' => [ 'GatewayGroupArn', ], 'members' => [ 'GatewayGroupArn' => [ 'shape' => 'Arn', ], ], ], 'GetGatewayGroupResponse' => [ 'type' => 'structure', 'members' => [ 'GatewayGroup' => [ 'shape' => 'GatewayGroup', ], ], ], 'GetGatewayRequest' => [ 'type' => 'structure', 'required' => [ 'GatewayArn', ], 'members' => [ 'GatewayArn' => [ 'shape' => 'Arn', ], ], ], 'GetGatewayResponse' => [ 'type' => 'structure', 'members' => [ 'Gateway' => [ 'shape' => 'Gateway', ], ], ], 'GetInvitationConfigurationRequest' => [ 'type' => 'structure', 'members' => [], ], 'GetInvitationConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'OrganizationName' => [ 'shape' => 'OrganizationName', ], 'ContactEmail' => [ 'shape' => 'Email', ], 'PrivateSkillIds' => [ 'shape' => 'ShortSkillIdList', ], ], ], 'GetNetworkProfileRequest' => [ 'type' => 'structure', 'required' => [ 'NetworkProfileArn', ], 'members' => [ 'NetworkProfileArn' => [ 'shape' => 'Arn', ], ], ], 'GetNetworkProfileResponse' => [ 'type' => 'structure', 'members' => [ 'NetworkProfile' => [ 'shape' => 'NetworkProfile', ], ], ], 'GetProfileRequest' => [ 'type' => 'structure', 'members' => [ 'ProfileArn' => [ 'shape' => 'Arn', ], ], ], 'GetProfileResponse' => [ 'type' => 'structure', 'members' => [ 'Profile' => [ 'shape' => 'Profile', ], ], ], 'GetRoomRequest' => [ 'type' => 'structure', 'members' => [ 'RoomArn' => [ 'shape' => 'Arn', ], ], ], 'GetRoomResponse' => [ 'type' => 'structure', 'members' => [ 'Room' => [ 'shape' => 'Room', ], ], ], 'GetRoomSkillParameterRequest' => [ 'type' => 'structure', 'required' => [ 'SkillId', 'ParameterKey', ], 'members' => [ 'RoomArn' => [ 'shape' => 'Arn', ], 'SkillId' => [ 'shape' => 'SkillId', ], 'ParameterKey' => [ 'shape' => 'RoomSkillParameterKey', ], ], ], 'GetRoomSkillParameterResponse' => [ 'type' => 'structure', 'members' => [ 'RoomSkillParameter' => [ 'shape' => 'RoomSkillParameter', ], ], ], 'GetSkillGroupRequest' => [ 'type' => 'structure', 'members' => [ 'SkillGroupArn' => [ 'shape' => 'Arn', ], ], ], 'GetSkillGroupResponse' => [ 'type' => 'structure', 'members' => [ 'SkillGroup' => [ 'shape' => 'SkillGroup', ], ], ], 'IPDialIn' => [ 'type' => 'structure', 'required' => [ 'Endpoint', 'CommsProtocol', ], 'members' => [ 'Endpoint' => [ 'shape' => 'Endpoint', ], 'CommsProtocol' => [ 'shape' => 'CommsProtocol', ], ], ], 'IconUrl' => [ 'type' => 'string', ], 'InstantBooking' => [ 'type' => 'structure', 'members' => [ 'DurationInMinutes' => [ 'shape' => 'Minutes', ], 'Enabled' => [ 'shape' => 'Boolean', ], ], ], 'InvalidCertificateAuthorityException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'InvalidDeviceException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'InvalidSecretsManagerResourceException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'InvalidServiceLinkedRoleStateException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'InvalidUserStatusException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'InvocationPhrase' => [ 'type' => 'string', ], 'Key' => [ 'type' => 'string', 'min' => 1, ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ListBusinessReportSchedulesRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], ], ], 'ListBusinessReportSchedulesResponse' => [ 'type' => 'structure', 'members' => [ 'BusinessReportSchedules' => [ 'shape' => 'BusinessReportScheduleList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListConferenceProvidersRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], ], ], 'ListConferenceProvidersResponse' => [ 'type' => 'structure', 'members' => [ 'ConferenceProviders' => [ 'shape' => 'ConferenceProvidersList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListDeviceEventsRequest' => [ 'type' => 'structure', 'required' => [ 'DeviceArn', ], 'members' => [ 'DeviceArn' => [ 'shape' => 'Arn', ], 'EventType' => [ 'shape' => 'DeviceEventType', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], ], ], 'ListDeviceEventsResponse' => [ 'type' => 'structure', 'members' => [ 'DeviceEvents' => [ 'shape' => 'DeviceEventList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListGatewayGroupsRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], ], ], 'ListGatewayGroupsResponse' => [ 'type' => 'structure', 'members' => [ 'GatewayGroups' => [ 'shape' => 'GatewayGroupSummaries', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListGatewaysRequest' => [ 'type' => 'structure', 'members' => [ 'GatewayGroupArn' => [ 'shape' => 'Arn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], ], ], 'ListGatewaysResponse' => [ 'type' => 'structure', 'members' => [ 'Gateways' => [ 'shape' => 'GatewaySummaries', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListSkillsRequest' => [ 'type' => 'structure', 'members' => [ 'SkillGroupArn' => [ 'shape' => 'Arn', ], 'EnablementType' => [ 'shape' => 'EnablementTypeFilter', ], 'SkillType' => [ 'shape' => 'SkillTypeFilter', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'SkillListMaxResults', ], ], ], 'ListSkillsResponse' => [ 'type' => 'structure', 'members' => [ 'SkillSummaries' => [ 'shape' => 'SkillSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListSkillsStoreCategoriesRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], ], ], 'ListSkillsStoreCategoriesResponse' => [ 'type' => 'structure', 'members' => [ 'CategoryList' => [ 'shape' => 'CategoryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListSkillsStoreSkillsByCategoryRequest' => [ 'type' => 'structure', 'required' => [ 'CategoryId', ], 'members' => [ 'CategoryId' => [ 'shape' => 'CategoryId', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'SkillListMaxResults', ], ], ], 'ListSkillsStoreSkillsByCategoryResponse' => [ 'type' => 'structure', 'members' => [ 'SkillsStoreSkills' => [ 'shape' => 'SkillsStoreSkillList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListSmartHomeAppliancesRequest' => [ 'type' => 'structure', 'required' => [ 'RoomArn', ], 'members' => [ 'RoomArn' => [ 'shape' => 'Arn', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListSmartHomeAppliancesResponse' => [ 'type' => 'structure', 'members' => [ 'SmartHomeAppliances' => [ 'shape' => 'SmartHomeApplianceList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTagsRequest' => [ 'type' => 'structure', 'required' => [ 'Arn', ], 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], ], ], 'ListTagsResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'Locale' => [ 'type' => 'string', 'enum' => [ 'en-US', ], ], 'MacAddress' => [ 'type' => 'string', ], 'MaxResults' => [ 'type' => 'integer', 'max' => 50, 'min' => 1, ], 'MaxVolumeLimit' => [ 'type' => 'integer', ], 'MeetingRoomConfiguration' => [ 'type' => 'structure', 'members' => [ 'RoomUtilizationMetricsEnabled' => [ 'shape' => 'Boolean', ], 'EndOfMeetingReminder' => [ 'shape' => 'EndOfMeetingReminder', ], 'InstantBooking' => [ 'shape' => 'InstantBooking', ], 'RequireCheckIn' => [ 'shape' => 'RequireCheckIn', ], 'ProactiveJoin' => [ 'shape' => 'ProactiveJoin', ], ], ], 'MeetingSetting' => [ 'type' => 'structure', 'required' => [ 'RequirePin', ], 'members' => [ 'RequirePin' => [ 'shape' => 'RequirePin', ], ], ], 'Minutes' => [ 'type' => 'integer', ], 'NameInUseException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'NetworkEapMethod' => [ 'type' => 'string', 'enum' => [ 'EAP_TLS', ], ], 'NetworkProfile' => [ 'type' => 'structure', 'members' => [ 'NetworkProfileArn' => [ 'shape' => 'Arn', ], 'NetworkProfileName' => [ 'shape' => 'NetworkProfileName', ], 'Description' => [ 'shape' => 'NetworkProfileDescription', ], 'Ssid' => [ 'shape' => 'NetworkSsid', ], 'SecurityType' => [ 'shape' => 'NetworkSecurityType', ], 'EapMethod' => [ 'shape' => 'NetworkEapMethod', ], 'CurrentPassword' => [ 'shape' => 'CurrentWiFiPassword', ], 'NextPassword' => [ 'shape' => 'NextWiFiPassword', ], 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'TrustAnchors' => [ 'shape' => 'TrustAnchorList', ], ], ], 'NetworkProfileData' => [ 'type' => 'structure', 'members' => [ 'NetworkProfileArn' => [ 'shape' => 'Arn', ], 'NetworkProfileName' => [ 'shape' => 'NetworkProfileName', ], 'Description' => [ 'shape' => 'NetworkProfileDescription', ], 'Ssid' => [ 'shape' => 'NetworkSsid', ], 'SecurityType' => [ 'shape' => 'NetworkSecurityType', ], 'EapMethod' => [ 'shape' => 'NetworkEapMethod', ], 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], ], ], 'NetworkProfileDataList' => [ 'type' => 'list', 'member' => [ 'shape' => 'NetworkProfileData', ], ], 'NetworkProfileDescription' => [ 'type' => 'string', 'max' => 200, 'min' => 0, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'NetworkProfileName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'NetworkSecurityType' => [ 'type' => 'string', 'enum' => [ 'OPEN', 'WEP', 'WPA_PSK', 'WPA2_PSK', 'WPA2_ENTERPRISE', ], ], 'NetworkSsid' => [ 'type' => 'string', 'max' => 32, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'NewInThisVersionBulletPoints' => [ 'type' => 'list', 'member' => [ 'shape' => 'BulletPoint', ], ], 'NextToken' => [ 'type' => 'string', 'max' => 1100, 'min' => 1, ], 'NextWiFiPassword' => [ 'type' => 'string', 'max' => 128, 'min' => 0, 'pattern' => '(^$)|([\\\\x00-\\\\x7F]{5,})', 'sensitive' => true, ], 'NotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'OneClickIdDelay' => [ 'type' => 'string', 'max' => 2, 'min' => 1, ], 'OneClickPinDelay' => [ 'type' => 'string', 'max' => 2, 'min' => 1, ], 'OrganizationName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'OutboundPhoneNumber' => [ 'type' => 'string', 'pattern' => '\\\\d{10}', ], 'PSTNDialIn' => [ 'type' => 'structure', 'required' => [ 'CountryCode', 'PhoneNumber', 'OneClickIdDelay', 'OneClickPinDelay', ], 'members' => [ 'CountryCode' => [ 'shape' => 'CountryCode', ], 'PhoneNumber' => [ 'shape' => 'OutboundPhoneNumber', ], 'OneClickIdDelay' => [ 'shape' => 'OneClickIdDelay', ], 'OneClickPinDelay' => [ 'shape' => 'OneClickPinDelay', ], ], ], 'PhoneNumber' => [ 'type' => 'structure', 'required' => [ 'Number', 'Type', ], 'members' => [ 'Number' => [ 'shape' => 'RawPhoneNumber', ], 'Type' => [ 'shape' => 'PhoneNumberType', ], ], ], 'PhoneNumberList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PhoneNumber', ], 'max' => 3, 'min' => 0, ], 'PhoneNumberType' => [ 'type' => 'string', 'enum' => [ 'MOBILE', 'WORK', 'HOME', ], 'sensitive' => true, ], 'PrivacyPolicy' => [ 'type' => 'string', ], 'ProactiveJoin' => [ 'type' => 'structure', 'members' => [ 'EnabledByMotion' => [ 'shape' => 'Boolean', ], ], ], 'ProductDescription' => [ 'type' => 'string', ], 'ProductId' => [ 'type' => 'string', 'pattern' => '^[a-zA-Z0-9_]{1,256}$', ], 'Profile' => [ 'type' => 'structure', 'members' => [ 'ProfileArn' => [ 'shape' => 'Arn', ], 'ProfileName' => [ 'shape' => 'ProfileName', ], 'IsDefault' => [ 'shape' => 'Boolean', ], 'Address' => [ 'shape' => 'Address', ], 'Timezone' => [ 'shape' => 'Timezone', ], 'DistanceUnit' => [ 'shape' => 'DistanceUnit', ], 'TemperatureUnit' => [ 'shape' => 'TemperatureUnit', ], 'WakeWord' => [ 'shape' => 'WakeWord', ], 'Locale' => [ 'shape' => 'DeviceLocale', ], 'SetupModeDisabled' => [ 'shape' => 'Boolean', ], 'MaxVolumeLimit' => [ 'shape' => 'MaxVolumeLimit', ], 'PSTNEnabled' => [ 'shape' => 'Boolean', ], 'DataRetentionOptIn' => [ 'shape' => 'Boolean', ], 'AddressBookArn' => [ 'shape' => 'Arn', ], 'MeetingRoomConfiguration' => [ 'shape' => 'MeetingRoomConfiguration', ], ], ], 'ProfileData' => [ 'type' => 'structure', 'members' => [ 'ProfileArn' => [ 'shape' => 'Arn', ], 'ProfileName' => [ 'shape' => 'ProfileName', ], 'IsDefault' => [ 'shape' => 'Boolean', ], 'Address' => [ 'shape' => 'Address', ], 'Timezone' => [ 'shape' => 'Timezone', ], 'DistanceUnit' => [ 'shape' => 'DistanceUnit', ], 'TemperatureUnit' => [ 'shape' => 'TemperatureUnit', ], 'WakeWord' => [ 'shape' => 'WakeWord', ], 'Locale' => [ 'shape' => 'DeviceLocale', ], ], ], 'ProfileDataList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ProfileData', ], ], 'ProfileName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'ProviderCalendarId' => [ 'type' => 'string', 'max' => 100, 'min' => 0, ], 'PutConferencePreferenceRequest' => [ 'type' => 'structure', 'required' => [ 'ConferencePreference', ], 'members' => [ 'ConferencePreference' => [ 'shape' => 'ConferencePreference', ], ], ], 'PutConferencePreferenceResponse' => [ 'type' => 'structure', 'members' => [], ], 'PutInvitationConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'OrganizationName', ], 'members' => [ 'OrganizationName' => [ 'shape' => 'OrganizationName', ], 'ContactEmail' => [ 'shape' => 'Email', ], 'PrivateSkillIds' => [ 'shape' => 'ShortSkillIdList', ], ], ], 'PutInvitationConfigurationResponse' => [ 'type' => 'structure', 'members' => [], ], 'PutRoomSkillParameterRequest' => [ 'type' => 'structure', 'required' => [ 'SkillId', 'RoomSkillParameter', ], 'members' => [ 'RoomArn' => [ 'shape' => 'Arn', ], 'SkillId' => [ 'shape' => 'SkillId', ], 'RoomSkillParameter' => [ 'shape' => 'RoomSkillParameter', ], ], ], 'PutRoomSkillParameterResponse' => [ 'type' => 'structure', 'members' => [], ], 'PutSkillAuthorizationRequest' => [ 'type' => 'structure', 'required' => [ 'AuthorizationResult', 'SkillId', ], 'members' => [ 'AuthorizationResult' => [ 'shape' => 'AuthorizationResult', ], 'SkillId' => [ 'shape' => 'SkillId', ], 'RoomArn' => [ 'shape' => 'Arn', ], ], ], 'PutSkillAuthorizationResponse' => [ 'type' => 'structure', 'members' => [], ], 'RawPhoneNumber' => [ 'type' => 'string', 'max' => 50, 'min' => 0, 'pattern' => '^[\\\\+0-9\\\\#\\\\,\\\\(][\\\\+0-9\\\\-\\\\.\\\\/\\\\(\\\\)\\\\,\\\\#\\\\s]+$', 'sensitive' => true, ], 'RegisterAVSDeviceRequest' => [ 'type' => 'structure', 'required' => [ 'ClientId', 'UserCode', 'ProductId', 'AmazonId', ], 'members' => [ 'ClientId' => [ 'shape' => 'ClientId', ], 'UserCode' => [ 'shape' => 'UserCode', ], 'ProductId' => [ 'shape' => 'ProductId', ], 'DeviceSerialNumber' => [ 'shape' => 'DeviceSerialNumberForAVS', ], 'AmazonId' => [ 'shape' => 'AmazonId', ], 'RoomArn' => [ 'shape' => 'Arn', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'RegisterAVSDeviceResponse' => [ 'type' => 'structure', 'members' => [ 'DeviceArn' => [ 'shape' => 'Arn', ], ], ], 'RejectSkillRequest' => [ 'type' => 'structure', 'required' => [ 'SkillId', ], 'members' => [ 'SkillId' => [ 'shape' => 'SkillId', ], ], ], 'RejectSkillResponse' => [ 'type' => 'structure', 'members' => [], ], 'ReleaseDate' => [ 'type' => 'string', ], 'RequireCheckIn' => [ 'type' => 'structure', 'members' => [ 'ReleaseAfterMinutes' => [ 'shape' => 'Minutes', ], 'Enabled' => [ 'shape' => 'Boolean', ], ], ], 'RequirePin' => [ 'type' => 'string', 'enum' => [ 'YES', 'NO', 'OPTIONAL', ], ], 'ResolveRoomRequest' => [ 'type' => 'structure', 'required' => [ 'UserId', 'SkillId', ], 'members' => [ 'UserId' => [ 'shape' => 'UserId', ], 'SkillId' => [ 'shape' => 'SkillId', ], ], ], 'ResolveRoomResponse' => [ 'type' => 'structure', 'members' => [ 'RoomArn' => [ 'shape' => 'Arn', ], 'RoomName' => [ 'shape' => 'RoomName', ], 'RoomSkillParameters' => [ 'shape' => 'RoomSkillParameters', ], ], ], 'ResourceAssociatedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ResourceInUseException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', ], ], 'exception' => true, ], 'ReviewKey' => [ 'type' => 'string', ], 'ReviewValue' => [ 'type' => 'string', ], 'Reviews' => [ 'type' => 'map', 'key' => [ 'shape' => 'ReviewKey', ], 'value' => [ 'shape' => 'ReviewValue', ], ], 'RevokeInvitationRequest' => [ 'type' => 'structure', 'members' => [ 'UserArn' => [ 'shape' => 'Arn', ], 'EnrollmentId' => [ 'shape' => 'EnrollmentId', ], ], ], 'RevokeInvitationResponse' => [ 'type' => 'structure', 'members' => [], ], 'Room' => [ 'type' => 'structure', 'members' => [ 'RoomArn' => [ 'shape' => 'Arn', ], 'RoomName' => [ 'shape' => 'RoomName', ], 'Description' => [ 'shape' => 'RoomDescription', ], 'ProviderCalendarId' => [ 'shape' => 'ProviderCalendarId', ], 'ProfileArn' => [ 'shape' => 'Arn', ], ], ], 'RoomData' => [ 'type' => 'structure', 'members' => [ 'RoomArn' => [ 'shape' => 'Arn', ], 'RoomName' => [ 'shape' => 'RoomName', ], 'Description' => [ 'shape' => 'RoomDescription', ], 'ProviderCalendarId' => [ 'shape' => 'ProviderCalendarId', ], 'ProfileArn' => [ 'shape' => 'Arn', ], 'ProfileName' => [ 'shape' => 'ProfileName', ], ], ], 'RoomDataList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RoomData', ], ], 'RoomDescription' => [ 'type' => 'string', 'max' => 200, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'RoomName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'RoomSkillParameter' => [ 'type' => 'structure', 'required' => [ 'ParameterKey', 'ParameterValue', ], 'members' => [ 'ParameterKey' => [ 'shape' => 'RoomSkillParameterKey', ], 'ParameterValue' => [ 'shape' => 'RoomSkillParameterValue', ], ], ], 'RoomSkillParameterKey' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'RoomSkillParameterValue' => [ 'type' => 'string', 'max' => 512, 'min' => 1, ], 'RoomSkillParameters' => [ 'type' => 'list', 'member' => [ 'shape' => 'RoomSkillParameter', ], ], 'S3KeyPrefix' => [ 'type' => 'string', 'max' => 100, 'min' => 0, 'pattern' => '[A-Za-z0-9!_\\\\-\\\\.\\\\*\\'()/]*', ], 'SampleUtterances' => [ 'type' => 'list', 'member' => [ 'shape' => 'Utterance', ], ], 'SearchAddressBooksRequest' => [ 'type' => 'structure', 'members' => [ 'Filters' => [ 'shape' => 'FilterList', ], 'SortCriteria' => [ 'shape' => 'SortList', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], ], ], 'SearchAddressBooksResponse' => [ 'type' => 'structure', 'members' => [ 'AddressBooks' => [ 'shape' => 'AddressBookDataList', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'TotalCount' => [ 'shape' => 'TotalCount', ], ], ], 'SearchContactsRequest' => [ 'type' => 'structure', 'members' => [ 'Filters' => [ 'shape' => 'FilterList', ], 'SortCriteria' => [ 'shape' => 'SortList', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], ], ], 'SearchContactsResponse' => [ 'type' => 'structure', 'members' => [ 'Contacts' => [ 'shape' => 'ContactDataList', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'TotalCount' => [ 'shape' => 'TotalCount', ], ], ], 'SearchDevicesRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'Filters' => [ 'shape' => 'FilterList', ], 'SortCriteria' => [ 'shape' => 'SortList', ], ], ], 'SearchDevicesResponse' => [ 'type' => 'structure', 'members' => [ 'Devices' => [ 'shape' => 'DeviceDataList', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'TotalCount' => [ 'shape' => 'TotalCount', ], ], ], 'SearchNetworkProfilesRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'Filters' => [ 'shape' => 'FilterList', ], 'SortCriteria' => [ 'shape' => 'SortList', ], ], ], 'SearchNetworkProfilesResponse' => [ 'type' => 'structure', 'members' => [ 'NetworkProfiles' => [ 'shape' => 'NetworkProfileDataList', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'TotalCount' => [ 'shape' => 'TotalCount', ], ], ], 'SearchProfilesRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'Filters' => [ 'shape' => 'FilterList', ], 'SortCriteria' => [ 'shape' => 'SortList', ], ], ], 'SearchProfilesResponse' => [ 'type' => 'structure', 'members' => [ 'Profiles' => [ 'shape' => 'ProfileDataList', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'TotalCount' => [ 'shape' => 'TotalCount', ], ], ], 'SearchRoomsRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'Filters' => [ 'shape' => 'FilterList', ], 'SortCriteria' => [ 'shape' => 'SortList', ], ], ], 'SearchRoomsResponse' => [ 'type' => 'structure', 'members' => [ 'Rooms' => [ 'shape' => 'RoomDataList', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'TotalCount' => [ 'shape' => 'TotalCount', ], ], ], 'SearchSkillGroupsRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'Filters' => [ 'shape' => 'FilterList', ], 'SortCriteria' => [ 'shape' => 'SortList', ], ], ], 'SearchSkillGroupsResponse' => [ 'type' => 'structure', 'members' => [ 'SkillGroups' => [ 'shape' => 'SkillGroupDataList', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'TotalCount' => [ 'shape' => 'TotalCount', ], ], ], 'SearchUsersRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'Filters' => [ 'shape' => 'FilterList', ], 'SortCriteria' => [ 'shape' => 'SortList', ], ], ], 'SearchUsersResponse' => [ 'type' => 'structure', 'members' => [ 'Users' => [ 'shape' => 'UserDataList', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'TotalCount' => [ 'shape' => 'TotalCount', ], ], ], 'SendAnnouncementRequest' => [ 'type' => 'structure', 'required' => [ 'RoomFilters', 'Content', 'ClientRequestToken', ], 'members' => [ 'RoomFilters' => [ 'shape' => 'FilterList', ], 'Content' => [ 'shape' => 'Content', ], 'TimeToLiveInSeconds' => [ 'shape' => 'TimeToLiveInSeconds', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], ], ], 'SendAnnouncementResponse' => [ 'type' => 'structure', 'members' => [ 'AnnouncementArn' => [ 'shape' => 'Arn', ], ], ], 'SendInvitationRequest' => [ 'type' => 'structure', 'members' => [ 'UserArn' => [ 'shape' => 'Arn', ], ], ], 'SendInvitationResponse' => [ 'type' => 'structure', 'members' => [], ], 'ShortDescription' => [ 'type' => 'string', ], 'ShortSkillIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SkillId', ], 'max' => 3, 'min' => 0, ], 'SipAddress' => [ 'type' => 'structure', 'required' => [ 'Uri', 'Type', ], 'members' => [ 'Uri' => [ 'shape' => 'SipUri', ], 'Type' => [ 'shape' => 'SipType', ], ], ], 'SipAddressList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SipAddress', ], 'max' => 1, 'min' => 0, ], 'SipType' => [ 'type' => 'string', 'enum' => [ 'WORK', ], 'sensitive' => true, ], 'SipUri' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '^sip[s]?:([^@:]+)\\\\@([^@]+)$', 'sensitive' => true, ], 'SkillDetails' => [ 'type' => 'structure', 'members' => [ 'ProductDescription' => [ 'shape' => 'ProductDescription', ], 'InvocationPhrase' => [ 'shape' => 'InvocationPhrase', ], 'ReleaseDate' => [ 'shape' => 'ReleaseDate', ], 'EndUserLicenseAgreement' => [ 'shape' => 'EndUserLicenseAgreement', ], 'GenericKeywords' => [ 'shape' => 'GenericKeywords', ], 'BulletPoints' => [ 'shape' => 'BulletPoints', ], 'NewInThisVersionBulletPoints' => [ 'shape' => 'NewInThisVersionBulletPoints', ], 'SkillTypes' => [ 'shape' => 'SkillTypes', ], 'Reviews' => [ 'shape' => 'Reviews', ], 'DeveloperInfo' => [ 'shape' => 'DeveloperInfo', ], ], ], 'SkillGroup' => [ 'type' => 'structure', 'members' => [ 'SkillGroupArn' => [ 'shape' => 'Arn', ], 'SkillGroupName' => [ 'shape' => 'SkillGroupName', ], 'Description' => [ 'shape' => 'SkillGroupDescription', ], ], ], 'SkillGroupData' => [ 'type' => 'structure', 'members' => [ 'SkillGroupArn' => [ 'shape' => 'Arn', ], 'SkillGroupName' => [ 'shape' => 'SkillGroupName', ], 'Description' => [ 'shape' => 'SkillGroupDescription', ], ], ], 'SkillGroupDataList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SkillGroupData', ], ], 'SkillGroupDescription' => [ 'type' => 'string', 'max' => 200, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'SkillGroupName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'SkillId' => [ 'type' => 'string', 'pattern' => '(^amzn1\\\\.ask\\\\.skill\\\\.[0-9a-f\\\\-]{1,200})|(^amzn1\\\\.echo-sdk-ams\\\\.app\\\\.[0-9a-f\\\\-]{1,200})', ], 'SkillListMaxResults' => [ 'type' => 'integer', 'max' => 10, 'min' => 1, ], 'SkillName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'SkillNotLinkedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'SkillStoreType' => [ 'type' => 'string', ], 'SkillSummary' => [ 'type' => 'structure', 'members' => [ 'SkillId' => [ 'shape' => 'SkillId', ], 'SkillName' => [ 'shape' => 'SkillName', ], 'SupportsLinking' => [ 'shape' => 'boolean', ], 'EnablementType' => [ 'shape' => 'EnablementType', ], 'SkillType' => [ 'shape' => 'SkillType', ], ], ], 'SkillSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SkillSummary', ], ], 'SkillType' => [ 'type' => 'string', 'enum' => [ 'PUBLIC', 'PRIVATE', ], 'max' => 100, 'min' => 1, 'pattern' => '[a-zA-Z0-9][a-zA-Z0-9_-]*', ], 'SkillTypeFilter' => [ 'type' => 'string', 'enum' => [ 'PUBLIC', 'PRIVATE', 'ALL', ], ], 'SkillTypes' => [ 'type' => 'list', 'member' => [ 'shape' => 'SkillStoreType', ], ], 'SkillsStoreSkill' => [ 'type' => 'structure', 'members' => [ 'SkillId' => [ 'shape' => 'SkillId', ], 'SkillName' => [ 'shape' => 'SkillName', ], 'ShortDescription' => [ 'shape' => 'ShortDescription', ], 'IconUrl' => [ 'shape' => 'IconUrl', ], 'SampleUtterances' => [ 'shape' => 'SampleUtterances', ], 'SkillDetails' => [ 'shape' => 'SkillDetails', ], 'SupportsLinking' => [ 'shape' => 'boolean', ], ], ], 'SkillsStoreSkillList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SkillsStoreSkill', ], ], 'SmartHomeAppliance' => [ 'type' => 'structure', 'members' => [ 'FriendlyName' => [ 'shape' => 'ApplianceFriendlyName', ], 'Description' => [ 'shape' => 'ApplianceDescription', ], 'ManufacturerName' => [ 'shape' => 'ApplianceManufacturerName', ], ], ], 'SmartHomeApplianceList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SmartHomeAppliance', ], ], 'SoftwareVersion' => [ 'type' => 'string', ], 'Sort' => [ 'type' => 'structure', 'required' => [ 'Key', 'Value', ], 'members' => [ 'Key' => [ 'shape' => 'SortKey', ], 'Value' => [ 'shape' => 'SortValue', ], ], ], 'SortKey' => [ 'type' => 'string', 'max' => 500, 'min' => 1, ], 'SortList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Sort', ], 'max' => 25, ], 'SortValue' => [ 'type' => 'string', 'enum' => [ 'ASC', 'DESC', ], ], 'Ssml' => [ 'type' => 'structure', 'required' => [ 'Locale', 'Value', ], 'members' => [ 'Locale' => [ 'shape' => 'Locale', ], 'Value' => [ 'shape' => 'SsmlValue', ], ], ], 'SsmlList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Ssml', ], 'max' => 1, ], 'SsmlValue' => [ 'type' => 'string', 'max' => 4096, 'min' => 0, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'StartDeviceSyncRequest' => [ 'type' => 'structure', 'required' => [ 'Features', ], 'members' => [ 'RoomArn' => [ 'shape' => 'Arn', ], 'DeviceArn' => [ 'shape' => 'Arn', ], 'Features' => [ 'shape' => 'Features', ], ], ], 'StartDeviceSyncResponse' => [ 'type' => 'structure', 'members' => [], ], 'StartSmartHomeApplianceDiscoveryRequest' => [ 'type' => 'structure', 'required' => [ 'RoomArn', ], 'members' => [ 'RoomArn' => [ 'shape' => 'Arn', ], ], ], 'StartSmartHomeApplianceDiscoveryResponse' => [ 'type' => 'structure', 'members' => [], ], 'Tag' => [ 'type' => 'structure', 'required' => [ 'Key', 'Value', ], 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$', ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'Arn', 'Tags', ], 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => '^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$', ], 'TemperatureUnit' => [ 'type' => 'string', 'enum' => [ 'FAHRENHEIT', 'CELSIUS', ], ], 'Text' => [ 'type' => 'structure', 'required' => [ 'Locale', 'Value', ], 'members' => [ 'Locale' => [ 'shape' => 'Locale', ], 'Value' => [ 'shape' => 'TextValue', ], ], ], 'TextList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Text', ], 'max' => 1, ], 'TextValue' => [ 'type' => 'string', 'max' => 4096, 'min' => 0, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', ], 'TimeToLiveInSeconds' => [ 'type' => 'integer', 'max' => 3600, 'min' => 1, ], 'Timezone' => [ 'type' => 'string', 'max' => 100, 'min' => 1, ], 'TotalCount' => [ 'type' => 'integer', ], 'TrustAnchor' => [ 'type' => 'string', 'pattern' => '-{5}BEGIN CERTIFICATE-{5}\\\\u000D?\\\\u000A([A-Za-z0-9/+]{64}\\\\u000D?\\\\u000A)*[A-Za-z0-9/+]{1,64}={0,2}\\\\u000D?\\\\u000A-{5}END CERTIFICATE-{5}(\\\\u000D?\\\\u000A)?', ], 'TrustAnchorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TrustAnchor', ], 'max' => 5, 'min' => 1, ], 'UnauthorizedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'Arn', 'TagKeys', ], 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'TagKeys' => [ 'shape' => 'TagKeyList', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateAddressBookRequest' => [ 'type' => 'structure', 'required' => [ 'AddressBookArn', ], 'members' => [ 'AddressBookArn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'AddressBookName', ], 'Description' => [ 'shape' => 'AddressBookDescription', ], ], ], 'UpdateAddressBookResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateBusinessReportScheduleRequest' => [ 'type' => 'structure', 'required' => [ 'ScheduleArn', ], 'members' => [ 'ScheduleArn' => [ 'shape' => 'Arn', ], 'S3BucketName' => [ 'shape' => 'CustomerS3BucketName', ], 'S3KeyPrefix' => [ 'shape' => 'S3KeyPrefix', ], 'Format' => [ 'shape' => 'BusinessReportFormat', ], 'ScheduleName' => [ 'shape' => 'BusinessReportScheduleName', ], 'Recurrence' => [ 'shape' => 'BusinessReportRecurrence', ], ], ], 'UpdateBusinessReportScheduleResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateConferenceProviderRequest' => [ 'type' => 'structure', 'required' => [ 'ConferenceProviderArn', 'ConferenceProviderType', 'MeetingSetting', ], 'members' => [ 'ConferenceProviderArn' => [ 'shape' => 'Arn', ], 'ConferenceProviderType' => [ 'shape' => 'ConferenceProviderType', ], 'IPDialIn' => [ 'shape' => 'IPDialIn', ], 'PSTNDialIn' => [ 'shape' => 'PSTNDialIn', ], 'MeetingSetting' => [ 'shape' => 'MeetingSetting', ], ], ], 'UpdateConferenceProviderResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateContactRequest' => [ 'type' => 'structure', 'required' => [ 'ContactArn', ], 'members' => [ 'ContactArn' => [ 'shape' => 'Arn', ], 'DisplayName' => [ 'shape' => 'ContactName', ], 'FirstName' => [ 'shape' => 'ContactName', ], 'LastName' => [ 'shape' => 'ContactName', ], 'PhoneNumber' => [ 'shape' => 'RawPhoneNumber', ], 'PhoneNumbers' => [ 'shape' => 'PhoneNumberList', ], 'SipAddresses' => [ 'shape' => 'SipAddressList', ], ], ], 'UpdateContactResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateDeviceRequest' => [ 'type' => 'structure', 'members' => [ 'DeviceArn' => [ 'shape' => 'Arn', ], 'DeviceName' => [ 'shape' => 'DeviceName', ], ], ], 'UpdateDeviceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateEndOfMeetingReminder' => [ 'type' => 'structure', 'members' => [ 'ReminderAtMinutes' => [ 'shape' => 'EndOfMeetingReminderMinutesList', ], 'ReminderType' => [ 'shape' => 'EndOfMeetingReminderType', ], 'Enabled' => [ 'shape' => 'Boolean', ], ], ], 'UpdateGatewayGroupRequest' => [ 'type' => 'structure', 'required' => [ 'GatewayGroupArn', ], 'members' => [ 'GatewayGroupArn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'GatewayGroupName', ], 'Description' => [ 'shape' => 'GatewayGroupDescription', ], ], ], 'UpdateGatewayGroupResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateGatewayRequest' => [ 'type' => 'structure', 'required' => [ 'GatewayArn', ], 'members' => [ 'GatewayArn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'GatewayName', ], 'Description' => [ 'shape' => 'GatewayDescription', ], 'SoftwareVersion' => [ 'shape' => 'GatewayVersion', ], ], ], 'UpdateGatewayResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateInstantBooking' => [ 'type' => 'structure', 'members' => [ 'DurationInMinutes' => [ 'shape' => 'Minutes', ], 'Enabled' => [ 'shape' => 'Boolean', ], ], ], 'UpdateMeetingRoomConfiguration' => [ 'type' => 'structure', 'members' => [ 'RoomUtilizationMetricsEnabled' => [ 'shape' => 'Boolean', ], 'EndOfMeetingReminder' => [ 'shape' => 'UpdateEndOfMeetingReminder', ], 'InstantBooking' => [ 'shape' => 'UpdateInstantBooking', ], 'RequireCheckIn' => [ 'shape' => 'UpdateRequireCheckIn', ], 'ProactiveJoin' => [ 'shape' => 'UpdateProactiveJoin', ], ], ], 'UpdateNetworkProfileRequest' => [ 'type' => 'structure', 'required' => [ 'NetworkProfileArn', ], 'members' => [ 'NetworkProfileArn' => [ 'shape' => 'Arn', ], 'NetworkProfileName' => [ 'shape' => 'NetworkProfileName', ], 'Description' => [ 'shape' => 'NetworkProfileDescription', ], 'CurrentPassword' => [ 'shape' => 'CurrentWiFiPassword', ], 'NextPassword' => [ 'shape' => 'NextWiFiPassword', ], 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], 'TrustAnchors' => [ 'shape' => 'TrustAnchorList', ], ], ], 'UpdateNetworkProfileResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateProactiveJoin' => [ 'type' => 'structure', 'required' => [ 'EnabledByMotion', ], 'members' => [ 'EnabledByMotion' => [ 'shape' => 'Boolean', ], ], ], 'UpdateProfileRequest' => [ 'type' => 'structure', 'members' => [ 'ProfileArn' => [ 'shape' => 'Arn', ], 'ProfileName' => [ 'shape' => 'ProfileName', ], 'IsDefault' => [ 'shape' => 'Boolean', ], 'Timezone' => [ 'shape' => 'Timezone', ], 'Address' => [ 'shape' => 'Address', ], 'DistanceUnit' => [ 'shape' => 'DistanceUnit', ], 'TemperatureUnit' => [ 'shape' => 'TemperatureUnit', ], 'WakeWord' => [ 'shape' => 'WakeWord', ], 'Locale' => [ 'shape' => 'DeviceLocale', ], 'SetupModeDisabled' => [ 'shape' => 'Boolean', ], 'MaxVolumeLimit' => [ 'shape' => 'MaxVolumeLimit', ], 'PSTNEnabled' => [ 'shape' => 'Boolean', ], 'DataRetentionOptIn' => [ 'shape' => 'Boolean', ], 'MeetingRoomConfiguration' => [ 'shape' => 'UpdateMeetingRoomConfiguration', ], ], ], 'UpdateProfileResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateRequireCheckIn' => [ 'type' => 'structure', 'members' => [ 'ReleaseAfterMinutes' => [ 'shape' => 'Minutes', ], 'Enabled' => [ 'shape' => 'Boolean', ], ], ], 'UpdateRoomRequest' => [ 'type' => 'structure', 'members' => [ 'RoomArn' => [ 'shape' => 'Arn', ], 'RoomName' => [ 'shape' => 'RoomName', ], 'Description' => [ 'shape' => 'RoomDescription', ], 'ProviderCalendarId' => [ 'shape' => 'ProviderCalendarId', ], 'ProfileArn' => [ 'shape' => 'Arn', ], ], ], 'UpdateRoomResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateSkillGroupRequest' => [ 'type' => 'structure', 'members' => [ 'SkillGroupArn' => [ 'shape' => 'Arn', ], 'SkillGroupName' => [ 'shape' => 'SkillGroupName', ], 'Description' => [ 'shape' => 'SkillGroupDescription', ], ], ], 'UpdateSkillGroupResponse' => [ 'type' => 'structure', 'members' => [], ], 'Url' => [ 'type' => 'string', ], 'UserCode' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'UserData' => [ 'type' => 'structure', 'members' => [ 'UserArn' => [ 'shape' => 'Arn', ], 'FirstName' => [ 'shape' => 'user_FirstName', ], 'LastName' => [ 'shape' => 'user_LastName', ], 'Email' => [ 'shape' => 'Email', ], 'EnrollmentStatus' => [ 'shape' => 'EnrollmentStatus', ], 'EnrollmentId' => [ 'shape' => 'EnrollmentId', ], ], ], 'UserDataList' => [ 'type' => 'list', 'member' => [ 'shape' => 'UserData', ], ], 'UserId' => [ 'type' => 'string', 'pattern' => 'amzn1\\\\.[A-Za-z0-9+-\\\\/=.]{1,300}', ], 'Utterance' => [ 'type' => 'string', ], 'Value' => [ 'type' => 'string', 'min' => 1, ], 'WakeWord' => [ 'type' => 'string', 'enum' => [ 'ALEXA', 'AMAZON', 'ECHO', 'COMPUTER', ], ], 'boolean' => [ 'type' => 'boolean', ], 'user_FirstName' => [ 'type' => 'string', 'max' => 30, 'min' => 0, 'pattern' => '([A-Za-z\\\\-\\' 0-9._]|\\\\p{IsLetter})*', ], 'user_LastName' => [ 'type' => 'string', 'max' => 30, 'min' => 0, 'pattern' => '([A-Za-z\\\\-\\' 0-9._]|\\\\p{IsLetter})*', ], 'user_UserId' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[a-zA-Z0-9@_+.-]*', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Alexa For Business is no longer supported',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/alexaforbusiness/2017-11-09/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://a4b-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://a4b-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://a4b.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://a4b.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/alexaforbusiness/2017-11-09/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://a4b.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://a4b-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://a4b-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://a4b.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://a4b-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://a4b-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://a4b.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://a4b.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://a4b-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://a4b-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://a4b.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://a4b.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://a4b-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://a4b.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://a4b-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://a4b.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/alexaforbusiness/2017-11-09/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/alexaforbusiness/2017-11-09/paginators-1.json\nreturn [ 'pagination' => [ 'ListBusinessReportSchedules' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListConferenceProviders' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListDeviceEvents' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListGatewayGroups' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListGateways' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListSkills' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListSkillsStoreCategories' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListSkillsStoreSkillsByCategory' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListSmartHomeAppliances' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListTags' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'SearchAddressBooks' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'SearchContacts' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'SearchDevices' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'SearchNetworkProfiles' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'SearchProfiles' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'SearchRooms' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'SearchSkillGroups' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'SearchUsers' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amp/2020-08-01/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2020-08-01', 'endpointPrefix' => 'aps', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'Amazon Prometheus Service', 'serviceId' => 'amp', 'signatureVersion' => 'v4', 'signingName' => 'aps', 'uid' => 'amp-2020-08-01', ], 'operations' => [ 'CreateAlertManagerDefinition' => [ 'name' => 'CreateAlertManagerDefinition', 'http' => [ 'method' => 'POST', 'requestUri' => '/workspaces/{workspaceId}/alertmanager/definition', 'responseCode' => 202, ], 'input' => [ 'shape' => 'CreateAlertManagerDefinitionRequest', ], 'output' => [ 'shape' => 'CreateAlertManagerDefinitionResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], 'idempotent' => true, ], 'CreateLoggingConfiguration' => [ 'name' => 'CreateLoggingConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/workspaces/{workspaceId}/logging', 'responseCode' => 202, ], 'input' => [ 'shape' => 'CreateLoggingConfigurationRequest', ], 'output' => [ 'shape' => 'CreateLoggingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'CreateRuleGroupsNamespace' => [ 'name' => 'CreateRuleGroupsNamespace', 'http' => [ 'method' => 'POST', 'requestUri' => '/workspaces/{workspaceId}/rulegroupsnamespaces', 'responseCode' => 202, ], 'input' => [ 'shape' => 'CreateRuleGroupsNamespaceRequest', ], 'output' => [ 'shape' => 'CreateRuleGroupsNamespaceResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], 'idempotent' => true, ], 'CreateWorkspace' => [ 'name' => 'CreateWorkspace', 'http' => [ 'method' => 'POST', 'requestUri' => '/workspaces', 'responseCode' => 202, ], 'input' => [ 'shape' => 'CreateWorkspaceRequest', ], 'output' => [ 'shape' => 'CreateWorkspaceResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], 'idempotent' => true, ], 'DeleteAlertManagerDefinition' => [ 'name' => 'DeleteAlertManagerDefinition', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/workspaces/{workspaceId}/alertmanager/definition', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteAlertManagerDefinitionRequest', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'DeleteLoggingConfiguration' => [ 'name' => 'DeleteLoggingConfiguration', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/workspaces/{workspaceId}/logging', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteLoggingConfigurationRequest', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'DeleteRuleGroupsNamespace' => [ 'name' => 'DeleteRuleGroupsNamespace', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/workspaces/{workspaceId}/rulegroupsnamespaces/{name}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteRuleGroupsNamespaceRequest', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'DeleteWorkspace' => [ 'name' => 'DeleteWorkspace', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/workspaces/{workspaceId}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteWorkspaceRequest', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'DescribeAlertManagerDefinition' => [ 'name' => 'DescribeAlertManagerDefinition', 'http' => [ 'method' => 'GET', 'requestUri' => '/workspaces/{workspaceId}/alertmanager/definition', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeAlertManagerDefinitionRequest', ], 'output' => [ 'shape' => 'DescribeAlertManagerDefinitionResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DescribeLoggingConfiguration' => [ 'name' => 'DescribeLoggingConfiguration', 'http' => [ 'method' => 'GET', 'requestUri' => '/workspaces/{workspaceId}/logging', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeLoggingConfigurationRequest', ], 'output' => [ 'shape' => 'DescribeLoggingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DescribeRuleGroupsNamespace' => [ 'name' => 'DescribeRuleGroupsNamespace', 'http' => [ 'method' => 'GET', 'requestUri' => '/workspaces/{workspaceId}/rulegroupsnamespaces/{name}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeRuleGroupsNamespaceRequest', ], 'output' => [ 'shape' => 'DescribeRuleGroupsNamespaceResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DescribeWorkspace' => [ 'name' => 'DescribeWorkspace', 'http' => [ 'method' => 'GET', 'requestUri' => '/workspaces/{workspaceId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeWorkspaceRequest', ], 'output' => [ 'shape' => 'DescribeWorkspaceResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListRuleGroupsNamespaces' => [ 'name' => 'ListRuleGroupsNamespaces', 'http' => [ 'method' => 'GET', 'requestUri' => '/workspaces/{workspaceId}/rulegroupsnamespaces', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListRuleGroupsNamespacesRequest', ], 'output' => [ 'shape' => 'ListRuleGroupsNamespacesResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags/{resourceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListWorkspaces' => [ 'name' => 'ListWorkspaces', 'http' => [ 'method' => 'GET', 'requestUri' => '/workspaces', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListWorkspacesRequest', ], 'output' => [ 'shape' => 'ListWorkspacesResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'PutAlertManagerDefinition' => [ 'name' => 'PutAlertManagerDefinition', 'http' => [ 'method' => 'PUT', 'requestUri' => '/workspaces/{workspaceId}/alertmanager/definition', 'responseCode' => 202, ], 'input' => [ 'shape' => 'PutAlertManagerDefinitionRequest', ], 'output' => [ 'shape' => 'PutAlertManagerDefinitionResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], 'idempotent' => true, ], 'PutRuleGroupsNamespace' => [ 'name' => 'PutRuleGroupsNamespace', 'http' => [ 'method' => 'PUT', 'requestUri' => '/workspaces/{workspaceId}/rulegroupsnamespaces/{name}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'PutRuleGroupsNamespaceRequest', ], 'output' => [ 'shape' => 'PutRuleGroupsNamespaceResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], 'idempotent' => true, ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags/{resourceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/tags/{resourceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'UpdateLoggingConfiguration' => [ 'name' => 'UpdateLoggingConfiguration', 'http' => [ 'method' => 'PUT', 'requestUri' => '/workspaces/{workspaceId}/logging', 'responseCode' => 202, ], 'input' => [ 'shape' => 'UpdateLoggingConfigurationRequest', ], 'output' => [ 'shape' => 'UpdateLoggingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'UpdateWorkspaceAlias' => [ 'name' => 'UpdateWorkspaceAlias', 'http' => [ 'method' => 'POST', 'requestUri' => '/workspaces/{workspaceId}/alias', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UpdateWorkspaceAliasRequest', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], 'idempotent' => true, ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 403, 'senderFault' => true, ], 'exception' => true, ], 'AlertManagerDefinitionData' => [ 'type' => 'blob', ], 'AlertManagerDefinitionDescription' => [ 'type' => 'structure', 'required' => [ 'status', 'data', 'createdAt', 'modifiedAt', ], 'members' => [ 'status' => [ 'shape' => 'AlertManagerDefinitionStatus', ], 'data' => [ 'shape' => 'AlertManagerDefinitionData', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'modifiedAt' => [ 'shape' => 'Timestamp', ], ], ], 'AlertManagerDefinitionStatus' => [ 'type' => 'structure', 'required' => [ 'statusCode', ], 'members' => [ 'statusCode' => [ 'shape' => 'AlertManagerDefinitionStatusCode', ], 'statusReason' => [ 'shape' => 'String', ], ], ], 'AlertManagerDefinitionStatusCode' => [ 'type' => 'string', 'enum' => [ 'CREATING', 'ACTIVE', 'UPDATING', 'DELETING', 'CREATION_FAILED', 'UPDATE_FAILED', ], ], 'ConflictException' => [ 'type' => 'structure', 'required' => [ 'message', 'resourceId', 'resourceType', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'resourceId' => [ 'shape' => 'String', ], 'resourceType' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'CreateAlertManagerDefinitionRequest' => [ 'type' => 'structure', 'required' => [ 'workspaceId', 'data', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', 'location' => 'uri', 'locationName' => 'workspaceId', ], 'data' => [ 'shape' => 'AlertManagerDefinitionData', ], 'clientToken' => [ 'shape' => 'IdempotencyToken', 'idempotencyToken' => true, ], ], ], 'CreateAlertManagerDefinitionResponse' => [ 'type' => 'structure', 'required' => [ 'status', ], 'members' => [ 'status' => [ 'shape' => 'AlertManagerDefinitionStatus', ], ], ], 'CreateLoggingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'workspaceId', 'logGroupArn', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', 'location' => 'uri', 'locationName' => 'workspaceId', ], 'logGroupArn' => [ 'shape' => 'LogGroupArn', ], 'clientToken' => [ 'shape' => 'IdempotencyToken', 'idempotencyToken' => true, ], ], ], 'CreateLoggingConfigurationResponse' => [ 'type' => 'structure', 'required' => [ 'status', ], 'members' => [ 'status' => [ 'shape' => 'LoggingConfigurationStatus', ], ], ], 'CreateRuleGroupsNamespaceRequest' => [ 'type' => 'structure', 'required' => [ 'workspaceId', 'name', 'data', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', 'location' => 'uri', 'locationName' => 'workspaceId', ], 'name' => [ 'shape' => 'RuleGroupsNamespaceName', ], 'data' => [ 'shape' => 'RuleGroupsNamespaceData', ], 'clientToken' => [ 'shape' => 'IdempotencyToken', 'idempotencyToken' => true, ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'CreateRuleGroupsNamespaceResponse' => [ 'type' => 'structure', 'required' => [ 'name', 'arn', 'status', ], 'members' => [ 'name' => [ 'shape' => 'RuleGroupsNamespaceName', ], 'arn' => [ 'shape' => 'RuleGroupsNamespaceArn', ], 'status' => [ 'shape' => 'RuleGroupsNamespaceStatus', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'CreateWorkspaceRequest' => [ 'type' => 'structure', 'members' => [ 'alias' => [ 'shape' => 'WorkspaceAlias', ], 'clientToken' => [ 'shape' => 'IdempotencyToken', 'idempotencyToken' => true, ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'CreateWorkspaceResponse' => [ 'type' => 'structure', 'required' => [ 'workspaceId', 'arn', 'status', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', ], 'arn' => [ 'shape' => 'WorkspaceArn', ], 'status' => [ 'shape' => 'WorkspaceStatus', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'DeleteAlertManagerDefinitionRequest' => [ 'type' => 'structure', 'required' => [ 'workspaceId', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', 'location' => 'uri', 'locationName' => 'workspaceId', ], 'clientToken' => [ 'shape' => 'IdempotencyToken', 'idempotencyToken' => true, 'location' => 'querystring', 'locationName' => 'clientToken', ], ], ], 'DeleteLoggingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'workspaceId', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', 'location' => 'uri', 'locationName' => 'workspaceId', ], 'clientToken' => [ 'shape' => 'IdempotencyToken', 'idempotencyToken' => true, 'location' => 'querystring', 'locationName' => 'clientToken', ], ], ], 'DeleteRuleGroupsNamespaceRequest' => [ 'type' => 'structure', 'required' => [ 'workspaceId', 'name', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', 'location' => 'uri', 'locationName' => 'workspaceId', ], 'name' => [ 'shape' => 'RuleGroupsNamespaceName', 'location' => 'uri', 'locationName' => 'name', ], 'clientToken' => [ 'shape' => 'IdempotencyToken', 'idempotencyToken' => true, 'location' => 'querystring', 'locationName' => 'clientToken', ], ], ], 'DeleteWorkspaceRequest' => [ 'type' => 'structure', 'required' => [ 'workspaceId', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', 'location' => 'uri', 'locationName' => 'workspaceId', ], 'clientToken' => [ 'shape' => 'IdempotencyToken', 'idempotencyToken' => true, 'location' => 'querystring', 'locationName' => 'clientToken', ], ], ], 'DescribeAlertManagerDefinitionRequest' => [ 'type' => 'structure', 'required' => [ 'workspaceId', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', 'location' => 'uri', 'locationName' => 'workspaceId', ], ], ], 'DescribeAlertManagerDefinitionResponse' => [ 'type' => 'structure', 'required' => [ 'alertManagerDefinition', ], 'members' => [ 'alertManagerDefinition' => [ 'shape' => 'AlertManagerDefinitionDescription', ], ], ], 'DescribeLoggingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'workspaceId', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', 'location' => 'uri', 'locationName' => 'workspaceId', ], ], ], 'DescribeLoggingConfigurationResponse' => [ 'type' => 'structure', 'required' => [ 'loggingConfiguration', ], 'members' => [ 'loggingConfiguration' => [ 'shape' => 'LoggingConfigurationMetadata', ], ], ], 'DescribeRuleGroupsNamespaceRequest' => [ 'type' => 'structure', 'required' => [ 'workspaceId', 'name', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', 'location' => 'uri', 'locationName' => 'workspaceId', ], 'name' => [ 'shape' => 'RuleGroupsNamespaceName', 'location' => 'uri', 'locationName' => 'name', ], ], ], 'DescribeRuleGroupsNamespaceResponse' => [ 'type' => 'structure', 'required' => [ 'ruleGroupsNamespace', ], 'members' => [ 'ruleGroupsNamespace' => [ 'shape' => 'RuleGroupsNamespaceDescription', ], ], ], 'DescribeWorkspaceRequest' => [ 'type' => 'structure', 'required' => [ 'workspaceId', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', 'location' => 'uri', 'locationName' => 'workspaceId', ], ], ], 'DescribeWorkspaceResponse' => [ 'type' => 'structure', 'required' => [ 'workspace', ], 'members' => [ 'workspace' => [ 'shape' => 'WorkspaceDescription', ], ], ], 'IdempotencyToken' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '[!-~]+', ], 'Integer' => [ 'type' => 'integer', 'box' => true, ], 'InternalServerException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'retryAfterSeconds' => [ 'shape' => 'Integer', 'location' => 'header', 'locationName' => 'Retry-After', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, 'retryable' => [ 'throttling' => false, ], ], 'ListRuleGroupsNamespacesRequest' => [ 'type' => 'structure', 'required' => [ 'workspaceId', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', 'location' => 'uri', 'locationName' => 'workspaceId', ], 'name' => [ 'shape' => 'RuleGroupsNamespaceName', 'location' => 'querystring', 'locationName' => 'name', ], 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'ListRuleGroupsNamespacesRequestMaxResultsInteger', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListRuleGroupsNamespacesRequestMaxResultsInteger' => [ 'type' => 'integer', 'box' => true, 'max' => 1000, 'min' => 1, ], 'ListRuleGroupsNamespacesResponse' => [ 'type' => 'structure', 'required' => [ 'ruleGroupsNamespaces', ], 'members' => [ 'ruleGroupsNamespaces' => [ 'shape' => 'RuleGroupsNamespaceSummaryList', ], 'nextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', ], 'members' => [ 'resourceArn' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resourceArn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'tags' => [ 'shape' => 'TagMap', ], ], ], 'ListWorkspacesRequest' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'alias' => [ 'shape' => 'WorkspaceAlias', 'location' => 'querystring', 'locationName' => 'alias', ], 'maxResults' => [ 'shape' => 'ListWorkspacesRequestMaxResultsInteger', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListWorkspacesRequestMaxResultsInteger' => [ 'type' => 'integer', 'box' => true, 'max' => 1000, 'min' => 1, ], 'ListWorkspacesResponse' => [ 'type' => 'structure', 'required' => [ 'workspaces', ], 'members' => [ 'workspaces' => [ 'shape' => 'WorkspaceSummaryList', ], 'nextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'LogGroupArn' => [ 'type' => 'string', 'pattern' => 'arn:aws[a-z0-9-]*:logs:[a-z0-9-]+:\\\\d{12}:log-group:[A-Za-z0-9\\\\.\\\\-\\\\_\\\\#/]{1,512}\\\\:\\\\*', ], 'LoggingConfigurationMetadata' => [ 'type' => 'structure', 'required' => [ 'status', 'workspace', 'logGroupArn', 'createdAt', 'modifiedAt', ], 'members' => [ 'status' => [ 'shape' => 'LoggingConfigurationStatus', ], 'workspace' => [ 'shape' => 'WorkspaceId', ], 'logGroupArn' => [ 'shape' => 'LogGroupArn', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'modifiedAt' => [ 'shape' => 'Timestamp', ], ], ], 'LoggingConfigurationStatus' => [ 'type' => 'structure', 'required' => [ 'statusCode', ], 'members' => [ 'statusCode' => [ 'shape' => 'LoggingConfigurationStatusCode', ], 'statusReason' => [ 'shape' => 'String', ], ], ], 'LoggingConfigurationStatusCode' => [ 'type' => 'string', 'enum' => [ 'CREATING', 'ACTIVE', 'UPDATING', 'DELETING', 'CREATION_FAILED', 'UPDATE_FAILED', ], ], 'PaginationToken' => [ 'type' => 'string', ], 'PutAlertManagerDefinitionRequest' => [ 'type' => 'structure', 'required' => [ 'workspaceId', 'data', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', 'location' => 'uri', 'locationName' => 'workspaceId', ], 'data' => [ 'shape' => 'AlertManagerDefinitionData', ], 'clientToken' => [ 'shape' => 'IdempotencyToken', 'idempotencyToken' => true, ], ], ], 'PutAlertManagerDefinitionResponse' => [ 'type' => 'structure', 'required' => [ 'status', ], 'members' => [ 'status' => [ 'shape' => 'AlertManagerDefinitionStatus', ], ], ], 'PutRuleGroupsNamespaceRequest' => [ 'type' => 'structure', 'required' => [ 'workspaceId', 'name', 'data', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', 'location' => 'uri', 'locationName' => 'workspaceId', ], 'name' => [ 'shape' => 'RuleGroupsNamespaceName', 'location' => 'uri', 'locationName' => 'name', ], 'data' => [ 'shape' => 'RuleGroupsNamespaceData', ], 'clientToken' => [ 'shape' => 'IdempotencyToken', 'idempotencyToken' => true, ], ], ], 'PutRuleGroupsNamespaceResponse' => [ 'type' => 'structure', 'required' => [ 'name', 'arn', 'status', ], 'members' => [ 'name' => [ 'shape' => 'RuleGroupsNamespaceName', ], 'arn' => [ 'shape' => 'RuleGroupsNamespaceArn', ], 'status' => [ 'shape' => 'RuleGroupsNamespaceStatus', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'required' => [ 'message', 'resourceId', 'resourceType', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'resourceId' => [ 'shape' => 'String', ], 'resourceType' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'RuleGroupsNamespaceArn' => [ 'type' => 'string', ], 'RuleGroupsNamespaceData' => [ 'type' => 'blob', ], 'RuleGroupsNamespaceDescription' => [ 'type' => 'structure', 'required' => [ 'arn', 'name', 'status', 'data', 'createdAt', 'modifiedAt', ], 'members' => [ 'arn' => [ 'shape' => 'RuleGroupsNamespaceArn', ], 'name' => [ 'shape' => 'RuleGroupsNamespaceName', ], 'status' => [ 'shape' => 'RuleGroupsNamespaceStatus', ], 'data' => [ 'shape' => 'RuleGroupsNamespaceData', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'modifiedAt' => [ 'shape' => 'Timestamp', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'RuleGroupsNamespaceName' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '.*[0-9A-Za-z][-.0-9A-Z_a-z]*.*', ], 'RuleGroupsNamespaceStatus' => [ 'type' => 'structure', 'required' => [ 'statusCode', ], 'members' => [ 'statusCode' => [ 'shape' => 'RuleGroupsNamespaceStatusCode', ], 'statusReason' => [ 'shape' => 'String', ], ], ], 'RuleGroupsNamespaceStatusCode' => [ 'type' => 'string', 'enum' => [ 'CREATING', 'ACTIVE', 'UPDATING', 'DELETING', 'CREATION_FAILED', 'UPDATE_FAILED', ], ], 'RuleGroupsNamespaceSummary' => [ 'type' => 'structure', 'required' => [ 'arn', 'name', 'status', 'createdAt', 'modifiedAt', ], 'members' => [ 'arn' => [ 'shape' => 'RuleGroupsNamespaceArn', ], 'name' => [ 'shape' => 'RuleGroupsNamespaceName', ], 'status' => [ 'shape' => 'RuleGroupsNamespaceStatus', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'modifiedAt' => [ 'shape' => 'Timestamp', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'RuleGroupsNamespaceSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RuleGroupsNamespaceSummary', ], ], 'ServiceQuotaExceededException' => [ 'type' => 'structure', 'required' => [ 'message', 'resourceId', 'resourceType', 'serviceCode', 'quotaCode', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'resourceId' => [ 'shape' => 'String', ], 'resourceType' => [ 'shape' => 'String', ], 'serviceCode' => [ 'shape' => 'String', ], 'quotaCode' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 402, 'senderFault' => true, ], 'exception' => true, ], 'String' => [ 'type' => 'string', ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)', ], 'TagKeys' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], ], 'TagMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'TagKey', ], 'value' => [ 'shape' => 'TagValue', ], 'max' => 50, 'min' => 0, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tags', ], 'members' => [ 'resourceArn' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => '([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)', ], 'ThrottlingException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'serviceCode' => [ 'shape' => 'String', ], 'quotaCode' => [ 'shape' => 'String', ], 'retryAfterSeconds' => [ 'shape' => 'Integer', 'location' => 'header', 'locationName' => 'Retry-After', ], ], 'error' => [ 'httpStatusCode' => 429, 'senderFault' => true, ], 'exception' => true, 'retryable' => [ 'throttling' => false, ], ], 'Timestamp' => [ 'type' => 'timestamp', ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tagKeys', ], 'members' => [ 'resourceArn' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tagKeys' => [ 'shape' => 'TagKeys', 'location' => 'querystring', 'locationName' => 'tagKeys', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateLoggingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'workspaceId', 'logGroupArn', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', 'location' => 'uri', 'locationName' => 'workspaceId', ], 'logGroupArn' => [ 'shape' => 'LogGroupArn', ], 'clientToken' => [ 'shape' => 'IdempotencyToken', 'idempotencyToken' => true, ], ], ], 'UpdateLoggingConfigurationResponse' => [ 'type' => 'structure', 'required' => [ 'status', ], 'members' => [ 'status' => [ 'shape' => 'LoggingConfigurationStatus', ], ], ], 'UpdateWorkspaceAliasRequest' => [ 'type' => 'structure', 'required' => [ 'workspaceId', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', 'location' => 'uri', 'locationName' => 'workspaceId', ], 'alias' => [ 'shape' => 'WorkspaceAlias', ], 'clientToken' => [ 'shape' => 'IdempotencyToken', 'idempotencyToken' => true, ], ], ], 'Uri' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, ], 'ValidationException' => [ 'type' => 'structure', 'required' => [ 'message', 'reason', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'reason' => [ 'shape' => 'ValidationExceptionReason', ], 'fieldList' => [ 'shape' => 'ValidationExceptionFieldList', ], ], 'error' => [ 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'ValidationExceptionField' => [ 'type' => 'structure', 'required' => [ 'name', 'message', ], 'members' => [ 'name' => [ 'shape' => 'String', ], 'message' => [ 'shape' => 'String', ], ], ], 'ValidationExceptionFieldList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ValidationExceptionField', ], ], 'ValidationExceptionReason' => [ 'type' => 'string', 'enum' => [ 'UNKNOWN_OPERATION', 'CANNOT_PARSE', 'FIELD_VALIDATION_FAILED', 'OTHER', ], ], 'WorkspaceAlias' => [ 'type' => 'string', 'max' => 100, 'min' => 1, ], 'WorkspaceArn' => [ 'type' => 'string', ], 'WorkspaceDescription' => [ 'type' => 'structure', 'required' => [ 'workspaceId', 'arn', 'status', 'createdAt', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', ], 'alias' => [ 'shape' => 'WorkspaceAlias', ], 'arn' => [ 'shape' => 'WorkspaceArn', ], 'status' => [ 'shape' => 'WorkspaceStatus', ], 'prometheusEndpoint' => [ 'shape' => 'Uri', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'WorkspaceId' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '.*[0-9A-Za-z][-.0-9A-Z_a-z]*.*', ], 'WorkspaceStatus' => [ 'type' => 'structure', 'required' => [ 'statusCode', ], 'members' => [ 'statusCode' => [ 'shape' => 'WorkspaceStatusCode', ], ], ], 'WorkspaceStatusCode' => [ 'type' => 'string', 'enum' => [ 'CREATING', 'ACTIVE', 'UPDATING', 'DELETING', 'CREATION_FAILED', ], ], 'WorkspaceSummary' => [ 'type' => 'structure', 'required' => [ 'workspaceId', 'arn', 'status', 'createdAt', ], 'members' => [ 'workspaceId' => [ 'shape' => 'WorkspaceId', ], 'alias' => [ 'shape' => 'WorkspaceAlias', ], 'arn' => [ 'shape' => 'WorkspaceArn', ], 'status' => [ 'shape' => 'WorkspaceStatus', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'WorkspaceSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'WorkspaceSummary', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amp/2020-08-01/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>Amazon Managed Service for Prometheus</p>', 'operations' => [ 'CreateAlertManagerDefinition' => '<p>Create an alert manager definition.</p>', 'CreateLoggingConfiguration' => '<p>Create logging configuration.</p>', 'CreateRuleGroupsNamespace' => '<p>Create a rule group namespace.</p>', 'CreateWorkspace' => '<p>Creates a new AMP workspace.</p>', 'DeleteAlertManagerDefinition' => '<p>Deletes an alert manager definition.</p>', 'DeleteLoggingConfiguration' => '<p>Delete logging configuration.</p>', 'DeleteRuleGroupsNamespace' => '<p>Delete a rule groups namespace.</p>', 'DeleteWorkspace' => '<p>Deletes an AMP workspace.</p>', 'DescribeAlertManagerDefinition' => '<p>Describes an alert manager definition.</p>', 'DescribeLoggingConfiguration' => '<p>Describes logging configuration.</p>', 'DescribeRuleGroupsNamespace' => '<p>Describe a rule groups namespace.</p>', 'DescribeWorkspace' => '<p>Describes an existing AMP workspace.</p>', 'ListRuleGroupsNamespaces' => '<p>Lists rule groups namespaces.</p>', 'ListTagsForResource' => '<p>Lists the tags you have assigned to the resource.</p>', 'ListWorkspaces' => '<p>Lists all AMP workspaces, including workspaces being created or deleted.</p>', 'PutAlertManagerDefinition' => '<p>Update an alert manager definition.</p>', 'PutRuleGroupsNamespace' => '<p>Update a rule groups namespace.</p>', 'TagResource' => '<p>Creates tags for the specified resource.</p>', 'UntagResource' => '<p>Deletes tags from the specified resource.</p>', 'UpdateLoggingConfiguration' => '<p>Update logging configuration.</p>', 'UpdateWorkspaceAlias' => '<p>Updates an AMP workspace alias.</p>', ], 'shapes' => [ 'AccessDeniedException' => [ 'base' => '<p>User does not have sufficient access to perform this action.</p>', 'refs' => [], ], 'AlertManagerDefinitionData' => [ 'base' => '<p>The alert manager definition data.</p>', 'refs' => [ 'AlertManagerDefinitionDescription$data' => '<p>The alert manager definition.</p>', 'CreateAlertManagerDefinitionRequest$data' => '<p>The alert manager definition data.</p>', 'PutAlertManagerDefinitionRequest$data' => '<p>The alert manager definition data.</p>', ], ], 'AlertManagerDefinitionDescription' => [ 'base' => '<p>Represents the properties of an alert manager definition.</p>', 'refs' => [ 'DescribeAlertManagerDefinitionResponse$alertManagerDefinition' => '<p>The properties of the selected workspace\\'s alert manager definition.</p>', ], ], 'AlertManagerDefinitionStatus' => [ 'base' => '<p>Represents the status of a definition.</p>', 'refs' => [ 'AlertManagerDefinitionDescription$status' => '<p>The status of alert manager definition.</p>', 'CreateAlertManagerDefinitionResponse$status' => '<p>The status of alert manager definition.</p>', 'PutAlertManagerDefinitionResponse$status' => '<p>The status of alert manager definition.</p>', ], ], 'AlertManagerDefinitionStatusCode' => [ 'base' => '<p>State of an alert manager definition.</p>', 'refs' => [ 'AlertManagerDefinitionStatus$statusCode' => '<p>Status code of this definition.</p>', ], ], 'ConflictException' => [ 'base' => '<p>Updating or deleting a resource can cause an inconsistent state.</p>', 'refs' => [], ], 'CreateAlertManagerDefinitionRequest' => [ 'base' => '<p>Represents the input of a CreateAlertManagerDefinition operation.</p>', 'refs' => [], ], 'CreateAlertManagerDefinitionResponse' => [ 'base' => '<p>Represents the output of a CreateAlertManagerDefinition operation.</p>', 'refs' => [], ], 'CreateLoggingConfigurationRequest' => [ 'base' => '<p>Represents the input of a CreateLoggingConfiguration operation.</p>', 'refs' => [], ], 'CreateLoggingConfigurationResponse' => [ 'base' => '<p>Represents the output of a CreateLoggingConfiguration operation.</p>', 'refs' => [], ], 'CreateRuleGroupsNamespaceRequest' => [ 'base' => '<p>Represents the input of a CreateRuleGroupsNamespace operation.</p>', 'refs' => [], ], 'CreateRuleGroupsNamespaceResponse' => [ 'base' => '<p>Represents the output of a CreateRuleGroupsNamespace operation.</p>', 'refs' => [], ], 'CreateWorkspaceRequest' => [ 'base' => '<p>Represents the input of a CreateWorkspace operation.</p>', 'refs' => [], ], 'CreateWorkspaceResponse' => [ 'base' => '<p>Represents the output of a CreateWorkspace operation.</p>', 'refs' => [], ], 'DeleteAlertManagerDefinitionRequest' => [ 'base' => '<p>Represents the input of a DeleteAlertManagerDefinition operation.</p>', 'refs' => [], ], 'DeleteLoggingConfigurationRequest' => [ 'base' => '<p>Represents the input of a DeleteLoggingConfiguration operation.</p>', 'refs' => [], ], 'DeleteRuleGroupsNamespaceRequest' => [ 'base' => '<p>Represents the input of a DeleteRuleGroupsNamespace operation.</p>', 'refs' => [], ], 'DeleteWorkspaceRequest' => [ 'base' => '<p>Represents the input of a DeleteWorkspace operation.</p>', 'refs' => [], ], 'DescribeAlertManagerDefinitionRequest' => [ 'base' => '<p>Represents the input of a DescribeAlertManagerDefinition operation.</p>', 'refs' => [], ], 'DescribeAlertManagerDefinitionResponse' => [ 'base' => '<p>Represents the output of a DescribeAlertManagerDefinition operation.</p>', 'refs' => [], ], 'DescribeLoggingConfigurationRequest' => [ 'base' => '<p>Represents the input of a DescribeLoggingConfiguration operation.</p>', 'refs' => [], ], 'DescribeLoggingConfigurationResponse' => [ 'base' => '<p>Represents the output of a DescribeLoggingConfiguration operation.</p>', 'refs' => [], ], 'DescribeRuleGroupsNamespaceRequest' => [ 'base' => '<p>Represents the input of a DescribeRuleGroupsNamespace operation.</p>', 'refs' => [], ], 'DescribeRuleGroupsNamespaceResponse' => [ 'base' => '<p>Represents the output of a DescribeRuleGroupsNamespace operation.</p>', 'refs' => [], ], 'DescribeWorkspaceRequest' => [ 'base' => '<p>Represents the input of a DescribeWorkspace operation.</p>', 'refs' => [], ], 'DescribeWorkspaceResponse' => [ 'base' => '<p>Represents the output of a DescribeWorkspace operation.</p>', 'refs' => [], ], 'IdempotencyToken' => [ 'base' => '<p>An identifier used to ensure the idempotency of a write request.</p>', 'refs' => [ 'CreateAlertManagerDefinitionRequest$clientToken' => '<p>Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.</p>', 'CreateLoggingConfigurationRequest$clientToken' => '<p>Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.</p>', 'CreateRuleGroupsNamespaceRequest$clientToken' => '<p>Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.</p>', 'CreateWorkspaceRequest$clientToken' => '<p>Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.</p>', 'DeleteAlertManagerDefinitionRequest$clientToken' => '<p>Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.</p>', 'DeleteLoggingConfigurationRequest$clientToken' => '<p>Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.</p>', 'DeleteRuleGroupsNamespaceRequest$clientToken' => '<p>Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.</p>', 'DeleteWorkspaceRequest$clientToken' => '<p>Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.</p>', 'PutAlertManagerDefinitionRequest$clientToken' => '<p>Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.</p>', 'PutRuleGroupsNamespaceRequest$clientToken' => '<p>Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.</p>', 'UpdateLoggingConfigurationRequest$clientToken' => '<p>Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.</p>', 'UpdateWorkspaceAliasRequest$clientToken' => '<p>Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.</p>', ], ], 'Integer' => [ 'base' => NULL, 'refs' => [ 'InternalServerException$retryAfterSeconds' => '<p>Advice to clients on when the call can be safely retried.</p>', 'ThrottlingException$retryAfterSeconds' => '<p>Advice to clients on when the call can be safely retried.</p>', ], ], 'InternalServerException' => [ 'base' => '<p>Unexpected error during processing of request.</p>', 'refs' => [], ], 'ListRuleGroupsNamespacesRequest' => [ 'base' => '<p>Represents the input of a ListRuleGroupsNamespaces operation.</p>', 'refs' => [], ], 'ListRuleGroupsNamespacesRequestMaxResultsInteger' => [ 'base' => NULL, 'refs' => [ 'ListRuleGroupsNamespacesRequest$maxResults' => '<p>Maximum results to return in response (default=100, maximum=1000).</p>', ], ], 'ListRuleGroupsNamespacesResponse' => [ 'base' => '<p>Represents the output of a ListRuleGroupsNamespaces operation.</p>', 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListWorkspacesRequest' => [ 'base' => '<p>Represents the input of a ListWorkspaces operation.</p>', 'refs' => [], ], 'ListWorkspacesRequestMaxResultsInteger' => [ 'base' => NULL, 'refs' => [ 'ListWorkspacesRequest$maxResults' => '<p>Maximum results to return in response (default=100, maximum=1000).</p>', ], ], 'ListWorkspacesResponse' => [ 'base' => '<p>Represents the output of a ListWorkspaces operation.</p>', 'refs' => [], ], 'LogGroupArn' => [ 'base' => NULL, 'refs' => [ 'CreateLoggingConfigurationRequest$logGroupArn' => '<p>The ARN of the CW log group to which the vended log data will be published.</p>', 'LoggingConfigurationMetadata$logGroupArn' => '<p>The ARN of the CW log group to which the vended log data will be published.</p>', 'UpdateLoggingConfigurationRequest$logGroupArn' => '<p>The ARN of the CW log group to which the vended log data will be published.</p>', ], ], 'LoggingConfigurationMetadata' => [ 'base' => '<p>Represents the properties of a logging configuration metadata.</p>', 'refs' => [ 'DescribeLoggingConfigurationResponse$loggingConfiguration' => '<p>Metadata object containing information about the logging configuration of a workspace.</p>', ], ], 'LoggingConfigurationStatus' => [ 'base' => '<p>Represents the status of a logging configuration.</p>', 'refs' => [ 'CreateLoggingConfigurationResponse$status' => '<p>The status of the logging configuration.</p>', 'LoggingConfigurationMetadata$status' => '<p>The status of the logging configuration.</p>', 'UpdateLoggingConfigurationResponse$status' => '<p>The status of the logging configuration.</p>', ], ], 'LoggingConfigurationStatusCode' => [ 'base' => '<p>State of a logging configuration.</p>', 'refs' => [ 'LoggingConfigurationStatus$statusCode' => '<p>Status code of the logging configuration.</p>', ], ], 'PaginationToken' => [ 'base' => '<p>A token used to access the next page in a paginated result set.</p>', 'refs' => [ 'ListRuleGroupsNamespacesRequest$nextToken' => '<p>Pagination token to request the next page in a paginated list. This token is obtained from the output of the previous ListRuleGroupsNamespaces request.</p>', 'ListRuleGroupsNamespacesResponse$nextToken' => '<p>Pagination token to use when requesting the next page in this list.</p>', 'ListWorkspacesRequest$nextToken' => '<p>Pagination token to request the next page in a paginated list. This token is obtained from the output of the previous ListWorkspaces request.</p>', 'ListWorkspacesResponse$nextToken' => '<p>Pagination token to use when requesting the next page in this list.</p>', ], ], 'PutAlertManagerDefinitionRequest' => [ 'base' => '<p>Represents the input of a PutAlertManagerDefinition operation.</p>', 'refs' => [], ], 'PutAlertManagerDefinitionResponse' => [ 'base' => '<p>Represents the output of a PutAlertManagerDefinition operation.</p>', 'refs' => [], ], 'PutRuleGroupsNamespaceRequest' => [ 'base' => '<p>Represents the input of a PutRuleGroupsNamespace operation.</p>', 'refs' => [], ], 'PutRuleGroupsNamespaceResponse' => [ 'base' => '<p>Represents the output of a PutRuleGroupsNamespace operation.</p>', 'refs' => [], ], 'ResourceNotFoundException' => [ 'base' => '<p>Request references a resource which does not exist.</p>', 'refs' => [], ], 'RuleGroupsNamespaceArn' => [ 'base' => '<p>An ARN identifying a rule groups namespace.</p>', 'refs' => [ 'CreateRuleGroupsNamespaceResponse$arn' => '<p>The Amazon Resource Name (ARN) of this rule groups namespace.</p>', 'PutRuleGroupsNamespaceResponse$arn' => '<p>The Amazon Resource Name (ARN) of this rule groups namespace.</p>', 'RuleGroupsNamespaceDescription$arn' => '<p>The Amazon Resource Name (ARN) of this rule groups namespace.</p>', 'RuleGroupsNamespaceSummary$arn' => '<p>The Amazon Resource Name (ARN) of this rule groups namespace.</p>', ], ], 'RuleGroupsNamespaceData' => [ 'base' => '<p>The rule groups namespace data.</p>', 'refs' => [ 'CreateRuleGroupsNamespaceRequest$data' => '<p>The namespace data that define the rule groups.</p>', 'PutRuleGroupsNamespaceRequest$data' => '<p>The namespace data that define the rule groups.</p>', 'RuleGroupsNamespaceDescription$data' => '<p>The rule groups namespace data.</p>', ], ], 'RuleGroupsNamespaceDescription' => [ 'base' => '<p>Represents a description of the rule groups namespace.</p>', 'refs' => [ 'DescribeRuleGroupsNamespaceResponse$ruleGroupsNamespace' => '<p>The selected rule groups namespace.</p>', ], ], 'RuleGroupsNamespaceName' => [ 'base' => '<p>The namespace name that the rule group belong to.</p>', 'refs' => [ 'CreateRuleGroupsNamespaceRequest$name' => '<p>The rule groups namespace name.</p>', 'CreateRuleGroupsNamespaceResponse$name' => '<p>The rule groups namespace name.</p>', 'DeleteRuleGroupsNamespaceRequest$name' => '<p>The rule groups namespace name.</p>', 'DescribeRuleGroupsNamespaceRequest$name' => '<p>The rule groups namespace.</p>', 'ListRuleGroupsNamespacesRequest$name' => '<p>Optional filter for rule groups namespace name. Only the rule groups namespace that begin with this value will be returned.</p>', 'PutRuleGroupsNamespaceRequest$name' => '<p>The rule groups namespace name.</p>', 'PutRuleGroupsNamespaceResponse$name' => '<p>The rule groups namespace name.</p>', 'RuleGroupsNamespaceDescription$name' => '<p>The rule groups namespace name.</p>', 'RuleGroupsNamespaceSummary$name' => '<p>The rule groups namespace name.</p>', ], ], 'RuleGroupsNamespaceStatus' => [ 'base' => '<p>Represents the status of a namespace.</p>', 'refs' => [ 'CreateRuleGroupsNamespaceResponse$status' => '<p>The status of rule groups namespace.</p>', 'PutRuleGroupsNamespaceResponse$status' => '<p>The status of rule groups namespace.</p>', 'RuleGroupsNamespaceDescription$status' => '<p>The status of rule groups namespace.</p>', 'RuleGroupsNamespaceSummary$status' => '<p>The status of rule groups namespace.</p>', ], ], 'RuleGroupsNamespaceStatusCode' => [ 'base' => '<p>State of a namespace.</p>', 'refs' => [ 'RuleGroupsNamespaceStatus$statusCode' => '<p>Status code of this namespace.</p>', ], ], 'RuleGroupsNamespaceSummary' => [ 'base' => '<p>Represents a summary of the rule groups namespace.</p>', 'refs' => [ 'RuleGroupsNamespaceSummaryList$member' => NULL, ], ], 'RuleGroupsNamespaceSummaryList' => [ 'base' => '<p>A list of rule groups namespace summary.</p>', 'refs' => [ 'ListRuleGroupsNamespacesResponse$ruleGroupsNamespaces' => '<p>The list of the selected rule groups namespaces.</p>', ], ], 'ServiceQuotaExceededException' => [ 'base' => '<p>Request would cause a service quota to be exceeded.</p>', 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$message' => '<p>Description of the error.</p>', 'AlertManagerDefinitionStatus$statusReason' => '<p>The reason for failure if any.</p>', 'ConflictException$message' => '<p>Description of the error.</p>', 'ConflictException$resourceId' => '<p>Identifier of the resource affected.</p>', 'ConflictException$resourceType' => '<p>Type of the resource affected.</p>', 'InternalServerException$message' => '<p>Description of the error.</p>', 'ListTagsForResourceRequest$resourceArn' => '<p>The ARN of the resource.</p>', 'LoggingConfigurationStatus$statusReason' => '<p>The reason for failure if any.</p>', 'ResourceNotFoundException$message' => '<p>Description of the error.</p>', 'ResourceNotFoundException$resourceId' => '<p>Identifier of the resource affected.</p>', 'ResourceNotFoundException$resourceType' => '<p>Type of the resource affected.</p>', 'RuleGroupsNamespaceStatus$statusReason' => '<p>The reason for failure if any.</p>', 'ServiceQuotaExceededException$message' => '<p>Description of the error.</p>', 'ServiceQuotaExceededException$resourceId' => '<p>Identifier of the resource affected.</p>', 'ServiceQuotaExceededException$resourceType' => '<p>Type of the resource affected.</p>', 'ServiceQuotaExceededException$serviceCode' => '<p>Service Quotas requirement to identify originating service.</p>', 'ServiceQuotaExceededException$quotaCode' => '<p>Service Quotas requirement to identify originating quota.</p>', 'TagResourceRequest$resourceArn' => '<p>The ARN of the resource.</p>', 'ThrottlingException$message' => '<p>Description of the error.</p>', 'ThrottlingException$serviceCode' => '<p>Service Quotas requirement to identify originating service.</p>', 'ThrottlingException$quotaCode' => '<p>Service Quotas requirement to identify originating quota.</p>', 'UntagResourceRequest$resourceArn' => '<p>The ARN of the resource.</p>', 'ValidationException$message' => '<p>Description of the error.</p>', 'ValidationExceptionField$name' => '<p>The field name.</p>', 'ValidationExceptionField$message' => '<p>Message describing why the field failed validation.</p>', ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'TagKeys$member' => NULL, 'TagMap$key' => '<p>The key of the tag.</p> <p>Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with <code>aws:</code>.</p>', ], ], 'TagKeys' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$tagKeys' => '<p>One or more tag keys</p>', ], ], 'TagMap' => [ 'base' => '<p>The list of tags assigned to the resource.</p>', 'refs' => [ 'CreateRuleGroupsNamespaceRequest$tags' => '<p>Optional, user-provided tags for this rule groups namespace.</p>', 'CreateRuleGroupsNamespaceResponse$tags' => '<p>The tags of this rule groups namespace.</p>', 'CreateWorkspaceRequest$tags' => '<p>Optional, user-provided tags for this workspace.</p>', 'CreateWorkspaceResponse$tags' => '<p>The tags of this workspace.</p>', 'ListTagsForResourceResponse$tags' => NULL, 'PutRuleGroupsNamespaceResponse$tags' => '<p>The tags of this rule groups namespace.</p>', 'RuleGroupsNamespaceDescription$tags' => '<p>The tags of this rule groups namespace.</p>', 'RuleGroupsNamespaceSummary$tags' => '<p>The tags of this rule groups namespace.</p>', 'TagResourceRequest$tags' => NULL, 'WorkspaceDescription$tags' => '<p>The tags of this workspace.</p>', 'WorkspaceSummary$tags' => '<p>The tags of this workspace.</p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'TagMap$value' => '<p>The value of the tag.</p> <p>Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @</p>', ], ], 'ThrottlingException' => [ 'base' => '<p>Request was denied due to request throttling.</p>', 'refs' => [], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [ 'AlertManagerDefinitionDescription$createdAt' => '<p>The time when the alert manager definition was created.</p>', 'AlertManagerDefinitionDescription$modifiedAt' => '<p>The time when the alert manager definition was modified.</p>', 'LoggingConfigurationMetadata$createdAt' => '<p>The time when the logging configuration was created.</p>', 'LoggingConfigurationMetadata$modifiedAt' => '<p>The time when the logging configuration was modified.</p>', 'RuleGroupsNamespaceDescription$createdAt' => '<p>The time when the rule groups namespace was created.</p>', 'RuleGroupsNamespaceDescription$modifiedAt' => '<p>The time when the rule groups namespace was modified.</p>', 'RuleGroupsNamespaceSummary$createdAt' => '<p>The time when the rule groups namespace was created.</p>', 'RuleGroupsNamespaceSummary$modifiedAt' => '<p>The time when the rule groups namespace was modified.</p>', 'WorkspaceDescription$createdAt' => '<p>The time when the workspace was created.</p>', 'WorkspaceSummary$createdAt' => '<p>The time when the workspace was created.</p>', ], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateLoggingConfigurationRequest' => [ 'base' => '<p>Represents the input of an UpdateLoggingConfiguration operation.</p>', 'refs' => [], ], 'UpdateLoggingConfigurationResponse' => [ 'base' => '<p>Represents the output of an UpdateLoggingConfiguration operation.</p>', 'refs' => [], ], 'UpdateWorkspaceAliasRequest' => [ 'base' => '<p>Represents the input of an UpdateWorkspaceAlias operation.</p>', 'refs' => [], ], 'Uri' => [ 'base' => NULL, 'refs' => [ 'WorkspaceDescription$prometheusEndpoint' => '<p>Prometheus endpoint URI.</p>', ], ], 'ValidationException' => [ 'base' => '<p>The input fails to satisfy the constraints specified by an AWS service.</p>', 'refs' => [], ], 'ValidationExceptionField' => [ 'base' => '<p>Stores information about a field passed inside a request that resulted in an exception.</p>', 'refs' => [ 'ValidationExceptionFieldList$member' => NULL, ], ], 'ValidationExceptionFieldList' => [ 'base' => '<p>A list of fields.</p>', 'refs' => [ 'ValidationException$fieldList' => '<p>The field that caused the error, if applicable. If more than one field caused the error, pick one and elaborate in the message.</p>', ], ], 'ValidationExceptionReason' => [ 'base' => '<p>Possible reasons a request failed validation.</p>', 'refs' => [ 'ValidationException$reason' => '<p>Reason the request failed validation.</p>', ], ], 'WorkspaceAlias' => [ 'base' => '<p>A user-assigned workspace alias.</p>', 'refs' => [ 'CreateWorkspaceRequest$alias' => '<p>An optional user-assigned alias for this workspace. This alias is for user reference and does not need to be unique.</p>', 'ListWorkspacesRequest$alias' => '<p>Optional filter for workspace alias. Only the workspaces with aliases that begin with this value will be returned.</p>', 'UpdateWorkspaceAliasRequest$alias' => '<p>The new alias of the workspace.</p>', 'WorkspaceDescription$alias' => '<p>Alias of this workspace.</p>', 'WorkspaceSummary$alias' => '<p>Alias of this workspace.</p>', ], ], 'WorkspaceArn' => [ 'base' => '<p>An ARN identifying a Workspace.</p>', 'refs' => [ 'CreateWorkspaceResponse$arn' => '<p>The ARN of the workspace that was just created.</p>', 'WorkspaceDescription$arn' => '<p>The Amazon Resource Name (ARN) of this workspace.</p>', 'WorkspaceSummary$arn' => '<p>The AmazonResourceName of this workspace.</p>', ], ], 'WorkspaceDescription' => [ 'base' => '<p>Represents the properties of a workspace.</p>', 'refs' => [ 'DescribeWorkspaceResponse$workspace' => '<p>The properties of the selected workspace.</p>', ], ], 'WorkspaceId' => [ 'base' => '<p>A workspace ID.</p>', 'refs' => [ 'CreateAlertManagerDefinitionRequest$workspaceId' => '<p>The ID of the workspace in which to create the alert manager definition.</p>', 'CreateLoggingConfigurationRequest$workspaceId' => '<p>The ID of the workspace to vend logs to.</p>', 'CreateRuleGroupsNamespaceRequest$workspaceId' => '<p>The ID of the workspace in which to create the rule group namespace.</p>', 'CreateWorkspaceResponse$workspaceId' => '<p>The generated ID of the workspace that was just created.</p>', 'DeleteAlertManagerDefinitionRequest$workspaceId' => '<p>The ID of the workspace in which to delete the alert manager definition.</p>', 'DeleteLoggingConfigurationRequest$workspaceId' => '<p>The ID of the workspace to vend logs to.</p>', 'DeleteRuleGroupsNamespaceRequest$workspaceId' => '<p>The ID of the workspace to delete rule group definition.</p>', 'DeleteWorkspaceRequest$workspaceId' => '<p>The ID of the workspace to delete.</p>', 'DescribeAlertManagerDefinitionRequest$workspaceId' => '<p>The ID of the workspace to describe.</p>', 'DescribeLoggingConfigurationRequest$workspaceId' => '<p>The ID of the workspace to vend logs to.</p>', 'DescribeRuleGroupsNamespaceRequest$workspaceId' => '<p>The ID of the workspace to describe.</p>', 'DescribeWorkspaceRequest$workspaceId' => '<p>The ID of the workspace to describe.</p>', 'ListRuleGroupsNamespacesRequest$workspaceId' => '<p>The ID of the workspace.</p>', 'LoggingConfigurationMetadata$workspace' => '<p>The workspace where the logging configuration exists.</p>', 'PutAlertManagerDefinitionRequest$workspaceId' => '<p>The ID of the workspace in which to update the alert manager definition.</p>', 'PutRuleGroupsNamespaceRequest$workspaceId' => '<p>The ID of the workspace in which to update the rule group namespace.</p>', 'UpdateLoggingConfigurationRequest$workspaceId' => '<p>The ID of the workspace to vend logs to.</p>', 'UpdateWorkspaceAliasRequest$workspaceId' => '<p>The ID of the workspace being updated.</p>', 'WorkspaceDescription$workspaceId' => '<p>Unique string identifying this workspace.</p>', 'WorkspaceSummary$workspaceId' => '<p>Unique string identifying this workspace.</p>', ], ], 'WorkspaceStatus' => [ 'base' => '<p>Represents the status of a workspace.</p>', 'refs' => [ 'CreateWorkspaceResponse$status' => '<p>The status of the workspace that was just created (usually CREATING).</p>', 'WorkspaceDescription$status' => '<p>The status of this workspace.</p>', 'WorkspaceSummary$status' => '<p>The status of this workspace.</p>', ], ], 'WorkspaceStatusCode' => [ 'base' => '<p>State of a workspace.</p>', 'refs' => [ 'WorkspaceStatus$statusCode' => '<p>Status code of this workspace.</p>', ], ], 'WorkspaceSummary' => [ 'base' => '<p>Represents a summary of the properties of a workspace.</p>', 'refs' => [ 'WorkspaceSummaryList$member' => NULL, ], ], 'WorkspaceSummaryList' => [ 'base' => '<p>A list of workspace summaries.</p>', 'refs' => [ 'ListWorkspacesResponse$workspaces' => '<p>The list of existing workspaces, including those undergoing creation or deletion.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amp/2020-08-01/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://aps-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://aps-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://aps.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://aps.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amp/2020-08-01/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://aps.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amp/2020-08-01/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amp/2020-08-01/paginators-1.json\nreturn [ 'pagination' => [ 'ListRuleGroupsNamespaces' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'ruleGroupsNamespaces', ], 'ListWorkspaces' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'workspaces', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amp/2020-08-01/waiters-2.json\nreturn [ 'version' => 2, 'waiters' => [ 'WorkspaceActive' => [ 'description' => 'Wait until a workspace reaches ACTIVE status', 'delay' => 2, 'maxAttempts' => 60, 'operation' => 'DescribeWorkspace', 'acceptors' => [ [ 'matcher' => 'path', 'argument' => 'workspace.status.statusCode', 'state' => 'success', 'expected' => 'ACTIVE', ], [ 'matcher' => 'path', 'argument' => 'workspace.status.statusCode', 'state' => 'retry', 'expected' => 'UPDATING', ], [ 'matcher' => 'path', 'argument' => 'workspace.status.statusCode', 'state' => 'retry', 'expected' => 'CREATING', ], ], ], 'WorkspaceDeleted' => [ 'description' => 'Wait until a workspace reaches DELETED status', 'delay' => 2, 'maxAttempts' => 60, 'operation' => 'DescribeWorkspace', 'acceptors' => [ [ 'matcher' => 'error', 'state' => 'success', 'expected' => 'ResourceNotFoundException', ], [ 'matcher' => 'path', 'argument' => 'workspace.status.statusCode', 'state' => 'retry', 'expected' => 'DELETING', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplify/2017-07-25/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2017-07-25', 'endpointPrefix' => 'amplify', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceAbbreviation' => 'Amplify', 'serviceFullName' => 'AWS Amplify', 'serviceId' => 'Amplify', 'signatureVersion' => 'v4', 'signingName' => 'amplify', 'uid' => 'amplify-2017-07-25', ], 'operations' => [ 'CreateApp' => [ 'name' => 'CreateApp', 'http' => [ 'method' => 'POST', 'requestUri' => '/apps', ], 'input' => [ 'shape' => 'CreateAppRequest', ], 'output' => [ 'shape' => 'CreateAppResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'DependentServiceFailureException', ], ], ], 'CreateBackendEnvironment' => [ 'name' => 'CreateBackendEnvironment', 'http' => [ 'method' => 'POST', 'requestUri' => '/apps/{appId}/backendenvironments', ], 'input' => [ 'shape' => 'CreateBackendEnvironmentRequest', ], 'output' => [ 'shape' => 'CreateBackendEnvironmentResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'CreateBranch' => [ 'name' => 'CreateBranch', 'http' => [ 'method' => 'POST', 'requestUri' => '/apps/{appId}/branches', ], 'input' => [ 'shape' => 'CreateBranchRequest', ], 'output' => [ 'shape' => 'CreateBranchResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'DependentServiceFailureException', ], ], ], 'CreateDeployment' => [ 'name' => 'CreateDeployment', 'http' => [ 'method' => 'POST', 'requestUri' => '/apps/{appId}/branches/{branchName}/deployments', ], 'input' => [ 'shape' => 'CreateDeploymentRequest', ], 'output' => [ 'shape' => 'CreateDeploymentResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'CreateDomainAssociation' => [ 'name' => 'CreateDomainAssociation', 'http' => [ 'method' => 'POST', 'requestUri' => '/apps/{appId}/domains', ], 'input' => [ 'shape' => 'CreateDomainAssociationRequest', ], 'output' => [ 'shape' => 'CreateDomainAssociationResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'DependentServiceFailureException', ], ], ], 'CreateWebhook' => [ 'name' => 'CreateWebhook', 'http' => [ 'method' => 'POST', 'requestUri' => '/apps/{appId}/webhooks', ], 'input' => [ 'shape' => 'CreateWebhookRequest', ], 'output' => [ 'shape' => 'CreateWebhookResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'DependentServiceFailureException', ], ], ], 'DeleteApp' => [ 'name' => 'DeleteApp', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/apps/{appId}', ], 'input' => [ 'shape' => 'DeleteAppRequest', ], 'output' => [ 'shape' => 'DeleteAppResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'DependentServiceFailureException', ], ], ], 'DeleteBackendEnvironment' => [ 'name' => 'DeleteBackendEnvironment', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/apps/{appId}/backendenvironments/{environmentName}', ], 'input' => [ 'shape' => 'DeleteBackendEnvironmentRequest', ], 'output' => [ 'shape' => 'DeleteBackendEnvironmentResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'DependentServiceFailureException', ], ], ], 'DeleteBranch' => [ 'name' => 'DeleteBranch', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/apps/{appId}/branches/{branchName}', ], 'input' => [ 'shape' => 'DeleteBranchRequest', ], 'output' => [ 'shape' => 'DeleteBranchResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'DependentServiceFailureException', ], ], ], 'DeleteDomainAssociation' => [ 'name' => 'DeleteDomainAssociation', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/apps/{appId}/domains/{domainName}', ], 'input' => [ 'shape' => 'DeleteDomainAssociationRequest', ], 'output' => [ 'shape' => 'DeleteDomainAssociationResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'DependentServiceFailureException', ], ], ], 'DeleteJob' => [ 'name' => 'DeleteJob', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/apps/{appId}/branches/{branchName}/jobs/{jobId}', ], 'input' => [ 'shape' => 'DeleteJobRequest', ], 'output' => [ 'shape' => 'DeleteJobResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'DeleteWebhook' => [ 'name' => 'DeleteWebhook', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/webhooks/{webhookId}', ], 'input' => [ 'shape' => 'DeleteWebhookRequest', ], 'output' => [ 'shape' => 'DeleteWebhookResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'GenerateAccessLogs' => [ 'name' => 'GenerateAccessLogs', 'http' => [ 'method' => 'POST', 'requestUri' => '/apps/{appId}/accesslogs', ], 'input' => [ 'shape' => 'GenerateAccessLogsRequest', ], 'output' => [ 'shape' => 'GenerateAccessLogsResult', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'GetApp' => [ 'name' => 'GetApp', 'http' => [ 'method' => 'GET', 'requestUri' => '/apps/{appId}', ], 'input' => [ 'shape' => 'GetAppRequest', ], 'output' => [ 'shape' => 'GetAppResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'GetArtifactUrl' => [ 'name' => 'GetArtifactUrl', 'http' => [ 'method' => 'GET', 'requestUri' => '/artifacts/{artifactId}', ], 'input' => [ 'shape' => 'GetArtifactUrlRequest', ], 'output' => [ 'shape' => 'GetArtifactUrlResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'GetBackendEnvironment' => [ 'name' => 'GetBackendEnvironment', 'http' => [ 'method' => 'GET', 'requestUri' => '/apps/{appId}/backendenvironments/{environmentName}', ], 'input' => [ 'shape' => 'GetBackendEnvironmentRequest', ], 'output' => [ 'shape' => 'GetBackendEnvironmentResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'GetBranch' => [ 'name' => 'GetBranch', 'http' => [ 'method' => 'GET', 'requestUri' => '/apps/{appId}/branches/{branchName}', ], 'input' => [ 'shape' => 'GetBranchRequest', ], 'output' => [ 'shape' => 'GetBranchResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'GetDomainAssociation' => [ 'name' => 'GetDomainAssociation', 'http' => [ 'method' => 'GET', 'requestUri' => '/apps/{appId}/domains/{domainName}', ], 'input' => [ 'shape' => 'GetDomainAssociationRequest', ], 'output' => [ 'shape' => 'GetDomainAssociationResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'GetJob' => [ 'name' => 'GetJob', 'http' => [ 'method' => 'GET', 'requestUri' => '/apps/{appId}/branches/{branchName}/jobs/{jobId}', ], 'input' => [ 'shape' => 'GetJobRequest', ], 'output' => [ 'shape' => 'GetJobResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'GetWebhook' => [ 'name' => 'GetWebhook', 'http' => [ 'method' => 'GET', 'requestUri' => '/webhooks/{webhookId}', ], 'input' => [ 'shape' => 'GetWebhookRequest', ], 'output' => [ 'shape' => 'GetWebhookResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'ListApps' => [ 'name' => 'ListApps', 'http' => [ 'method' => 'GET', 'requestUri' => '/apps', ], 'input' => [ 'shape' => 'ListAppsRequest', ], 'output' => [ 'shape' => 'ListAppsResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'ListArtifacts' => [ 'name' => 'ListArtifacts', 'http' => [ 'method' => 'GET', 'requestUri' => '/apps/{appId}/branches/{branchName}/jobs/{jobId}/artifacts', ], 'input' => [ 'shape' => 'ListArtifactsRequest', ], 'output' => [ 'shape' => 'ListArtifactsResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'ListBackendEnvironments' => [ 'name' => 'ListBackendEnvironments', 'http' => [ 'method' => 'GET', 'requestUri' => '/apps/{appId}/backendenvironments', ], 'input' => [ 'shape' => 'ListBackendEnvironmentsRequest', ], 'output' => [ 'shape' => 'ListBackendEnvironmentsResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'ListBranches' => [ 'name' => 'ListBranches', 'http' => [ 'method' => 'GET', 'requestUri' => '/apps/{appId}/branches', ], 'input' => [ 'shape' => 'ListBranchesRequest', ], 'output' => [ 'shape' => 'ListBranchesResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'ListDomainAssociations' => [ 'name' => 'ListDomainAssociations', 'http' => [ 'method' => 'GET', 'requestUri' => '/apps/{appId}/domains', ], 'input' => [ 'shape' => 'ListDomainAssociationsRequest', ], 'output' => [ 'shape' => 'ListDomainAssociationsResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'ListJobs' => [ 'name' => 'ListJobs', 'http' => [ 'method' => 'GET', 'requestUri' => '/apps/{appId}/branches/{branchName}/jobs', ], 'input' => [ 'shape' => 'ListJobsRequest', ], 'output' => [ 'shape' => 'ListJobsResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags/{resourceArn}', ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListWebhooks' => [ 'name' => 'ListWebhooks', 'http' => [ 'method' => 'GET', 'requestUri' => '/apps/{appId}/webhooks', ], 'input' => [ 'shape' => 'ListWebhooksRequest', ], 'output' => [ 'shape' => 'ListWebhooksResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'StartDeployment' => [ 'name' => 'StartDeployment', 'http' => [ 'method' => 'POST', 'requestUri' => '/apps/{appId}/branches/{branchName}/deployments/start', ], 'input' => [ 'shape' => 'StartDeploymentRequest', ], 'output' => [ 'shape' => 'StartDeploymentResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'StartJob' => [ 'name' => 'StartJob', 'http' => [ 'method' => 'POST', 'requestUri' => '/apps/{appId}/branches/{branchName}/jobs', ], 'input' => [ 'shape' => 'StartJobRequest', ], 'output' => [ 'shape' => 'StartJobResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'StopJob' => [ 'name' => 'StopJob', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/apps/{appId}/branches/{branchName}/jobs/{jobId}/stop', ], 'input' => [ 'shape' => 'StopJobRequest', ], 'output' => [ 'shape' => 'StopJobResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags/{resourceArn}', ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/tags/{resourceArn}', ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UpdateApp' => [ 'name' => 'UpdateApp', 'http' => [ 'method' => 'POST', 'requestUri' => '/apps/{appId}', ], 'input' => [ 'shape' => 'UpdateAppRequest', ], 'output' => [ 'shape' => 'UpdateAppResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'UpdateBranch' => [ 'name' => 'UpdateBranch', 'http' => [ 'method' => 'POST', 'requestUri' => '/apps/{appId}/branches/{branchName}', ], 'input' => [ 'shape' => 'UpdateBranchRequest', ], 'output' => [ 'shape' => 'UpdateBranchResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'DependentServiceFailureException', ], ], ], 'UpdateDomainAssociation' => [ 'name' => 'UpdateDomainAssociation', 'http' => [ 'method' => 'POST', 'requestUri' => '/apps/{appId}/domains/{domainName}', ], 'input' => [ 'shape' => 'UpdateDomainAssociationRequest', ], 'output' => [ 'shape' => 'UpdateDomainAssociationResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'DependentServiceFailureException', ], ], ], 'UpdateWebhook' => [ 'name' => 'UpdateWebhook', 'http' => [ 'method' => 'POST', 'requestUri' => '/webhooks/{webhookId}', ], 'input' => [ 'shape' => 'UpdateWebhookRequest', ], 'output' => [ 'shape' => 'UpdateWebhookResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'DependentServiceFailureException', ], ], ], ], 'shapes' => [ 'AccessToken' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '(?s).+', 'sensitive' => true, ], 'ActiveJobId' => [ 'type' => 'string', 'max' => 1000, ], 'App' => [ 'type' => 'structure', 'required' => [ 'appId', 'appArn', 'name', 'description', 'repository', 'platform', 'createTime', 'updateTime', 'environmentVariables', 'defaultDomain', 'enableBranchAutoBuild', 'enableBasicAuth', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', ], 'appArn' => [ 'shape' => 'AppArn', ], 'name' => [ 'shape' => 'Name', ], 'tags' => [ 'shape' => 'TagMap', ], 'description' => [ 'shape' => 'Description', ], 'repository' => [ 'shape' => 'Repository', ], 'platform' => [ 'shape' => 'Platform', ], 'createTime' => [ 'shape' => 'CreateTime', ], 'updateTime' => [ 'shape' => 'UpdateTime', ], 'iamServiceRoleArn' => [ 'shape' => 'ServiceRoleArn', ], 'environmentVariables' => [ 'shape' => 'EnvironmentVariables', ], 'defaultDomain' => [ 'shape' => 'DefaultDomain', ], 'enableBranchAutoBuild' => [ 'shape' => 'EnableBranchAutoBuild', ], 'enableBranchAutoDeletion' => [ 'shape' => 'EnableBranchAutoDeletion', ], 'enableBasicAuth' => [ 'shape' => 'EnableBasicAuth', ], 'basicAuthCredentials' => [ 'shape' => 'BasicAuthCredentials', ], 'customRules' => [ 'shape' => 'CustomRules', ], 'productionBranch' => [ 'shape' => 'ProductionBranch', ], 'buildSpec' => [ 'shape' => 'BuildSpec', ], 'customHeaders' => [ 'shape' => 'CustomHeaders', ], 'enableAutoBranchCreation' => [ 'shape' => 'EnableAutoBranchCreation', ], 'autoBranchCreationPatterns' => [ 'shape' => 'AutoBranchCreationPatterns', ], 'autoBranchCreationConfig' => [ 'shape' => 'AutoBranchCreationConfig', ], 'repositoryCloneMethod' => [ 'shape' => 'RepositoryCloneMethod', ], ], ], 'AppArn' => [ 'type' => 'string', 'max' => 1000, ], 'AppId' => [ 'type' => 'string', 'max' => 20, 'min' => 1, 'pattern' => 'd[a-z0-9]+', ], 'Apps' => [ 'type' => 'list', 'member' => [ 'shape' => 'App', ], ], 'Artifact' => [ 'type' => 'structure', 'required' => [ 'artifactFileName', 'artifactId', ], 'members' => [ 'artifactFileName' => [ 'shape' => 'ArtifactFileName', ], 'artifactId' => [ 'shape' => 'ArtifactId', ], ], ], 'ArtifactFileName' => [ 'type' => 'string', 'max' => 1000, ], 'ArtifactId' => [ 'type' => 'string', 'max' => 255, 'pattern' => '(?s).*', ], 'ArtifactUrl' => [ 'type' => 'string', 'max' => 1000, ], 'Artifacts' => [ 'type' => 'list', 'member' => [ 'shape' => 'Artifact', ], ], 'ArtifactsUrl' => [ 'type' => 'string', 'max' => 1000, ], 'AssociatedResource' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, ], 'AssociatedResources' => [ 'type' => 'list', 'member' => [ 'shape' => 'AssociatedResource', ], ], 'AutoBranchCreationConfig' => [ 'type' => 'structure', 'members' => [ 'stage' => [ 'shape' => 'Stage', ], 'framework' => [ 'shape' => 'Framework', ], 'enableAutoBuild' => [ 'shape' => 'EnableAutoBuild', ], 'environmentVariables' => [ 'shape' => 'EnvironmentVariables', ], 'basicAuthCredentials' => [ 'shape' => 'BasicAuthCredentials', ], 'enableBasicAuth' => [ 'shape' => 'EnableBasicAuth', ], 'enablePerformanceMode' => [ 'shape' => 'EnablePerformanceMode', ], 'buildSpec' => [ 'shape' => 'BuildSpec', ], 'enablePullRequestPreview' => [ 'shape' => 'EnablePullRequestPreview', ], 'pullRequestEnvironmentName' => [ 'shape' => 'PullRequestEnvironmentName', ], ], ], 'AutoBranchCreationPattern' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, 'pattern' => '(?s).+', ], 'AutoBranchCreationPatterns' => [ 'type' => 'list', 'member' => [ 'shape' => 'AutoBranchCreationPattern', ], ], 'AutoSubDomainCreationPattern' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, 'pattern' => '(?s).+', ], 'AutoSubDomainCreationPatterns' => [ 'type' => 'list', 'member' => [ 'shape' => 'AutoSubDomainCreationPattern', ], ], 'AutoSubDomainIAMRole' => [ 'type' => 'string', 'max' => 1000, 'pattern' => '^$|^arn:aws:iam::\\\\d{12}:role.+', ], 'BackendEnvironment' => [ 'type' => 'structure', 'required' => [ 'backendEnvironmentArn', 'environmentName', 'createTime', 'updateTime', ], 'members' => [ 'backendEnvironmentArn' => [ 'shape' => 'BackendEnvironmentArn', ], 'environmentName' => [ 'shape' => 'EnvironmentName', ], 'stackName' => [ 'shape' => 'StackName', ], 'deploymentArtifacts' => [ 'shape' => 'DeploymentArtifacts', ], 'createTime' => [ 'shape' => 'CreateTime', ], 'updateTime' => [ 'shape' => 'UpdateTime', ], ], ], 'BackendEnvironmentArn' => [ 'type' => 'string', 'max' => 1000, 'min' => 0, 'pattern' => '(?s).*', ], 'BackendEnvironments' => [ 'type' => 'list', 'member' => [ 'shape' => 'BackendEnvironment', ], ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'BasicAuthCredentials' => [ 'type' => 'string', 'max' => 2000, 'pattern' => '(?s).*', 'sensitive' => true, ], 'Branch' => [ 'type' => 'structure', 'required' => [ 'branchArn', 'branchName', 'description', 'stage', 'displayName', 'enableNotification', 'createTime', 'updateTime', 'environmentVariables', 'enableAutoBuild', 'customDomains', 'framework', 'activeJobId', 'totalNumberOfJobs', 'enableBasicAuth', 'ttl', 'enablePullRequestPreview', ], 'members' => [ 'branchArn' => [ 'shape' => 'BranchArn', ], 'branchName' => [ 'shape' => 'BranchName', ], 'description' => [ 'shape' => 'Description', ], 'tags' => [ 'shape' => 'TagMap', ], 'stage' => [ 'shape' => 'Stage', ], 'displayName' => [ 'shape' => 'DisplayName', ], 'enableNotification' => [ 'shape' => 'EnableNotification', ], 'createTime' => [ 'shape' => 'CreateTime', ], 'updateTime' => [ 'shape' => 'UpdateTime', ], 'environmentVariables' => [ 'shape' => 'EnvironmentVariables', ], 'enableAutoBuild' => [ 'shape' => 'EnableAutoBuild', ], 'customDomains' => [ 'shape' => 'CustomDomains', ], 'framework' => [ 'shape' => 'Framework', ], 'activeJobId' => [ 'shape' => 'ActiveJobId', ], 'totalNumberOfJobs' => [ 'shape' => 'TotalNumberOfJobs', ], 'enableBasicAuth' => [ 'shape' => 'EnableBasicAuth', ], 'enablePerformanceMode' => [ 'shape' => 'EnablePerformanceMode', ], 'thumbnailUrl' => [ 'shape' => 'ThumbnailUrl', ], 'basicAuthCredentials' => [ 'shape' => 'BasicAuthCredentials', ], 'buildSpec' => [ 'shape' => 'BuildSpec', ], 'ttl' => [ 'shape' => 'TTL', ], 'associatedResources' => [ 'shape' => 'AssociatedResources', ], 'enablePullRequestPreview' => [ 'shape' => 'EnablePullRequestPreview', ], 'pullRequestEnvironmentName' => [ 'shape' => 'PullRequestEnvironmentName', ], 'destinationBranch' => [ 'shape' => 'BranchName', ], 'sourceBranch' => [ 'shape' => 'BranchName', ], 'backendEnvironmentArn' => [ 'shape' => 'BackendEnvironmentArn', ], ], ], 'BranchArn' => [ 'type' => 'string', 'max' => 1000, 'pattern' => '(?s).*', ], 'BranchName' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '(?s).+', ], 'Branches' => [ 'type' => 'list', 'member' => [ 'shape' => 'Branch', ], 'max' => 255, ], 'BuildSpec' => [ 'type' => 'string', 'max' => 25000, 'min' => 1, 'pattern' => '(?s).+', 'sensitive' => true, ], 'CertificateVerificationDNSRecord' => [ 'type' => 'string', 'max' => 1000, ], 'Code' => [ 'type' => 'string', ], 'CommitId' => [ 'type' => 'string', 'max' => 255, 'pattern' => '(?s).*', ], 'CommitMessage' => [ 'type' => 'string', 'max' => 10000, 'pattern' => '(?s).*', ], 'CommitTime' => [ 'type' => 'timestamp', ], 'Condition' => [ 'type' => 'string', 'max' => 2048, 'min' => 0, 'pattern' => '(?s).*', ], 'Context' => [ 'type' => 'string', ], 'CreateAppRequest' => [ 'type' => 'structure', 'required' => [ 'name', ], 'members' => [ 'name' => [ 'shape' => 'Name', ], 'description' => [ 'shape' => 'Description', ], 'repository' => [ 'shape' => 'Repository', ], 'platform' => [ 'shape' => 'Platform', ], 'iamServiceRoleArn' => [ 'shape' => 'ServiceRoleArn', ], 'oauthToken' => [ 'shape' => 'OauthToken', ], 'accessToken' => [ 'shape' => 'AccessToken', ], 'environmentVariables' => [ 'shape' => 'EnvironmentVariables', ], 'enableBranchAutoBuild' => [ 'shape' => 'EnableBranchAutoBuild', ], 'enableBranchAutoDeletion' => [ 'shape' => 'EnableBranchAutoDeletion', ], 'enableBasicAuth' => [ 'shape' => 'EnableBasicAuth', ], 'basicAuthCredentials' => [ 'shape' => 'BasicAuthCredentials', ], 'customRules' => [ 'shape' => 'CustomRules', ], 'tags' => [ 'shape' => 'TagMap', ], 'buildSpec' => [ 'shape' => 'BuildSpec', ], 'customHeaders' => [ 'shape' => 'CustomHeaders', ], 'enableAutoBranchCreation' => [ 'shape' => 'EnableAutoBranchCreation', ], 'autoBranchCreationPatterns' => [ 'shape' => 'AutoBranchCreationPatterns', ], 'autoBranchCreationConfig' => [ 'shape' => 'AutoBranchCreationConfig', ], ], ], 'CreateAppResult' => [ 'type' => 'structure', 'required' => [ 'app', ], 'members' => [ 'app' => [ 'shape' => 'App', ], ], ], 'CreateBackendEnvironmentRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'EnvironmentName', ], 'stackName' => [ 'shape' => 'StackName', ], 'deploymentArtifacts' => [ 'shape' => 'DeploymentArtifacts', ], ], ], 'CreateBackendEnvironmentResult' => [ 'type' => 'structure', 'required' => [ 'backendEnvironment', ], 'members' => [ 'backendEnvironment' => [ 'shape' => 'BackendEnvironment', ], ], ], 'CreateBranchRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'branchName', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'branchName' => [ 'shape' => 'BranchName', ], 'description' => [ 'shape' => 'Description', ], 'stage' => [ 'shape' => 'Stage', ], 'framework' => [ 'shape' => 'Framework', ], 'enableNotification' => [ 'shape' => 'EnableNotification', ], 'enableAutoBuild' => [ 'shape' => 'EnableAutoBuild', ], 'environmentVariables' => [ 'shape' => 'EnvironmentVariables', ], 'basicAuthCredentials' => [ 'shape' => 'BasicAuthCredentials', ], 'enableBasicAuth' => [ 'shape' => 'EnableBasicAuth', ], 'enablePerformanceMode' => [ 'shape' => 'EnablePerformanceMode', ], 'tags' => [ 'shape' => 'TagMap', ], 'buildSpec' => [ 'shape' => 'BuildSpec', ], 'ttl' => [ 'shape' => 'TTL', ], 'displayName' => [ 'shape' => 'DisplayName', ], 'enablePullRequestPreview' => [ 'shape' => 'EnablePullRequestPreview', ], 'pullRequestEnvironmentName' => [ 'shape' => 'PullRequestEnvironmentName', ], 'backendEnvironmentArn' => [ 'shape' => 'BackendEnvironmentArn', ], ], ], 'CreateBranchResult' => [ 'type' => 'structure', 'required' => [ 'branch', ], 'members' => [ 'branch' => [ 'shape' => 'Branch', ], ], ], 'CreateDeploymentRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'branchName', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'branchName' => [ 'shape' => 'BranchName', 'location' => 'uri', 'locationName' => 'branchName', ], 'fileMap' => [ 'shape' => 'FileMap', ], ], ], 'CreateDeploymentResult' => [ 'type' => 'structure', 'required' => [ 'fileUploadUrls', 'zipUploadUrl', ], 'members' => [ 'jobId' => [ 'shape' => 'JobId', ], 'fileUploadUrls' => [ 'shape' => 'FileUploadUrls', ], 'zipUploadUrl' => [ 'shape' => 'UploadUrl', ], ], ], 'CreateDomainAssociationRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'domainName', 'subDomainSettings', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'domainName' => [ 'shape' => 'DomainName', ], 'enableAutoSubDomain' => [ 'shape' => 'EnableAutoSubDomain', ], 'subDomainSettings' => [ 'shape' => 'SubDomainSettings', ], 'autoSubDomainCreationPatterns' => [ 'shape' => 'AutoSubDomainCreationPatterns', ], 'autoSubDomainIAMRole' => [ 'shape' => 'AutoSubDomainIAMRole', ], ], ], 'CreateDomainAssociationResult' => [ 'type' => 'structure', 'required' => [ 'domainAssociation', ], 'members' => [ 'domainAssociation' => [ 'shape' => 'DomainAssociation', ], ], ], 'CreateTime' => [ 'type' => 'timestamp', ], 'CreateWebhookRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'branchName', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'branchName' => [ 'shape' => 'BranchName', ], 'description' => [ 'shape' => 'Description', ], ], ], 'CreateWebhookResult' => [ 'type' => 'structure', 'required' => [ 'webhook', ], 'members' => [ 'webhook' => [ 'shape' => 'Webhook', ], ], ], 'CustomDomain' => [ 'type' => 'string', 'max' => 255, ], 'CustomDomains' => [ 'type' => 'list', 'member' => [ 'shape' => 'CustomDomain', ], 'max' => 255, ], 'CustomHeaders' => [ 'type' => 'string', 'max' => 25000, 'min' => 0, 'pattern' => '(?s).*', ], 'CustomRule' => [ 'type' => 'structure', 'required' => [ 'source', 'target', ], 'members' => [ 'source' => [ 'shape' => 'Source', ], 'target' => [ 'shape' => 'Target', ], 'status' => [ 'shape' => 'Status', ], 'condition' => [ 'shape' => 'Condition', ], ], ], 'CustomRules' => [ 'type' => 'list', 'member' => [ 'shape' => 'CustomRule', ], ], 'DNSRecord' => [ 'type' => 'string', 'max' => 1000, ], 'DefaultDomain' => [ 'type' => 'string', 'max' => 1000, 'min' => 1, ], 'DeleteAppRequest' => [ 'type' => 'structure', 'required' => [ 'appId', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], ], ], 'DeleteAppResult' => [ 'type' => 'structure', 'required' => [ 'app', ], 'members' => [ 'app' => [ 'shape' => 'App', ], ], ], 'DeleteBackendEnvironmentRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'EnvironmentName', 'location' => 'uri', 'locationName' => 'environmentName', ], ], ], 'DeleteBackendEnvironmentResult' => [ 'type' => 'structure', 'required' => [ 'backendEnvironment', ], 'members' => [ 'backendEnvironment' => [ 'shape' => 'BackendEnvironment', ], ], ], 'DeleteBranchRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'branchName', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'branchName' => [ 'shape' => 'BranchName', 'location' => 'uri', 'locationName' => 'branchName', ], ], ], 'DeleteBranchResult' => [ 'type' => 'structure', 'required' => [ 'branch', ], 'members' => [ 'branch' => [ 'shape' => 'Branch', ], ], ], 'DeleteDomainAssociationRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'domainName', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'domainName' => [ 'shape' => 'DomainName', 'location' => 'uri', 'locationName' => 'domainName', ], ], ], 'DeleteDomainAssociationResult' => [ 'type' => 'structure', 'required' => [ 'domainAssociation', ], 'members' => [ 'domainAssociation' => [ 'shape' => 'DomainAssociation', ], ], ], 'DeleteJobRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'branchName', 'jobId', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'branchName' => [ 'shape' => 'BranchName', 'location' => 'uri', 'locationName' => 'branchName', ], 'jobId' => [ 'shape' => 'JobId', 'location' => 'uri', 'locationName' => 'jobId', ], ], ], 'DeleteJobResult' => [ 'type' => 'structure', 'required' => [ 'jobSummary', ], 'members' => [ 'jobSummary' => [ 'shape' => 'JobSummary', ], ], ], 'DeleteWebhookRequest' => [ 'type' => 'structure', 'required' => [ 'webhookId', ], 'members' => [ 'webhookId' => [ 'shape' => 'WebhookId', 'location' => 'uri', 'locationName' => 'webhookId', ], ], ], 'DeleteWebhookResult' => [ 'type' => 'structure', 'required' => [ 'webhook', ], 'members' => [ 'webhook' => [ 'shape' => 'Webhook', ], ], ], 'DependentServiceFailureException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, ], 'DeploymentArtifacts' => [ 'type' => 'string', 'max' => 1000, 'min' => 1, 'pattern' => '(?s).+', ], 'Description' => [ 'type' => 'string', 'max' => 1000, 'pattern' => '(?s).*', ], 'DisplayName' => [ 'type' => 'string', 'max' => 255, 'pattern' => '(?s).*', ], 'DomainAssociation' => [ 'type' => 'structure', 'required' => [ 'domainAssociationArn', 'domainName', 'enableAutoSubDomain', 'domainStatus', 'statusReason', 'subDomains', ], 'members' => [ 'domainAssociationArn' => [ 'shape' => 'DomainAssociationArn', ], 'domainName' => [ 'shape' => 'DomainName', ], 'enableAutoSubDomain' => [ 'shape' => 'EnableAutoSubDomain', ], 'autoSubDomainCreationPatterns' => [ 'shape' => 'AutoSubDomainCreationPatterns', ], 'autoSubDomainIAMRole' => [ 'shape' => 'AutoSubDomainIAMRole', ], 'domainStatus' => [ 'shape' => 'DomainStatus', ], 'statusReason' => [ 'shape' => 'StatusReason', ], 'certificateVerificationDNSRecord' => [ 'shape' => 'CertificateVerificationDNSRecord', ], 'subDomains' => [ 'shape' => 'SubDomains', ], ], ], 'DomainAssociationArn' => [ 'type' => 'string', 'max' => 1000, ], 'DomainAssociations' => [ 'type' => 'list', 'member' => [ 'shape' => 'DomainAssociation', ], 'max' => 255, ], 'DomainName' => [ 'type' => 'string', 'max' => 64, 'pattern' => '^(((?!-)[A-Za-z0-9-]{0,62}[A-Za-z0-9])\\\\.)+((?!-)[A-Za-z0-9-]{1,62}[A-Za-z0-9])(\\\\.)?$', ], 'DomainPrefix' => [ 'type' => 'string', 'max' => 255, 'pattern' => '(?s).*', ], 'DomainStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING_VERIFICATION', 'IN_PROGRESS', 'AVAILABLE', 'PENDING_DEPLOYMENT', 'FAILED', 'CREATING', 'REQUESTING_CERTIFICATE', 'UPDATING', ], ], 'EnableAutoBranchCreation' => [ 'type' => 'boolean', ], 'EnableAutoBuild' => [ 'type' => 'boolean', ], 'EnableAutoSubDomain' => [ 'type' => 'boolean', ], 'EnableBasicAuth' => [ 'type' => 'boolean', ], 'EnableBranchAutoBuild' => [ 'type' => 'boolean', ], 'EnableBranchAutoDeletion' => [ 'type' => 'boolean', ], 'EnableNotification' => [ 'type' => 'boolean', ], 'EnablePerformanceMode' => [ 'type' => 'boolean', ], 'EnablePullRequestPreview' => [ 'type' => 'boolean', ], 'EndTime' => [ 'type' => 'timestamp', ], 'EnvKey' => [ 'type' => 'string', 'max' => 255, 'pattern' => '(?s).*', ], 'EnvValue' => [ 'type' => 'string', 'max' => 5500, 'pattern' => '(?s).*', ], 'EnvironmentName' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '(?s).+', ], 'EnvironmentVariables' => [ 'type' => 'map', 'key' => [ 'shape' => 'EnvKey', ], 'value' => [ 'shape' => 'EnvValue', ], ], 'ErrorMessage' => [ 'type' => 'string', 'max' => 255, ], 'FileMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'FileName', ], 'value' => [ 'shape' => 'MD5Hash', ], ], 'FileName' => [ 'type' => 'string', 'max' => 255, 'pattern' => '(?s).*', ], 'FileUploadUrls' => [ 'type' => 'map', 'key' => [ 'shape' => 'FileName', ], 'value' => [ 'shape' => 'UploadUrl', ], ], 'Framework' => [ 'type' => 'string', 'max' => 255, 'pattern' => '(?s).*', ], 'GenerateAccessLogsRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', 'appId', ], 'members' => [ 'startTime' => [ 'shape' => 'StartTime', ], 'endTime' => [ 'shape' => 'EndTime', ], 'domainName' => [ 'shape' => 'DomainName', ], 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], ], ], 'GenerateAccessLogsResult' => [ 'type' => 'structure', 'members' => [ 'logUrl' => [ 'shape' => 'LogUrl', ], ], ], 'GetAppRequest' => [ 'type' => 'structure', 'required' => [ 'appId', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], ], ], 'GetAppResult' => [ 'type' => 'structure', 'required' => [ 'app', ], 'members' => [ 'app' => [ 'shape' => 'App', ], ], ], 'GetArtifactUrlRequest' => [ 'type' => 'structure', 'required' => [ 'artifactId', ], 'members' => [ 'artifactId' => [ 'shape' => 'ArtifactId', 'location' => 'uri', 'locationName' => 'artifactId', ], ], ], 'GetArtifactUrlResult' => [ 'type' => 'structure', 'required' => [ 'artifactId', 'artifactUrl', ], 'members' => [ 'artifactId' => [ 'shape' => 'ArtifactId', ], 'artifactUrl' => [ 'shape' => 'ArtifactUrl', ], ], ], 'GetBackendEnvironmentRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'EnvironmentName', 'location' => 'uri', 'locationName' => 'environmentName', ], ], ], 'GetBackendEnvironmentResult' => [ 'type' => 'structure', 'required' => [ 'backendEnvironment', ], 'members' => [ 'backendEnvironment' => [ 'shape' => 'BackendEnvironment', ], ], ], 'GetBranchRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'branchName', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'branchName' => [ 'shape' => 'BranchName', 'location' => 'uri', 'locationName' => 'branchName', ], ], ], 'GetBranchResult' => [ 'type' => 'structure', 'required' => [ 'branch', ], 'members' => [ 'branch' => [ 'shape' => 'Branch', ], ], ], 'GetDomainAssociationRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'domainName', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'domainName' => [ 'shape' => 'DomainName', 'location' => 'uri', 'locationName' => 'domainName', ], ], ], 'GetDomainAssociationResult' => [ 'type' => 'structure', 'required' => [ 'domainAssociation', ], 'members' => [ 'domainAssociation' => [ 'shape' => 'DomainAssociation', ], ], ], 'GetJobRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'branchName', 'jobId', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'branchName' => [ 'shape' => 'BranchName', 'location' => 'uri', 'locationName' => 'branchName', ], 'jobId' => [ 'shape' => 'JobId', 'location' => 'uri', 'locationName' => 'jobId', ], ], ], 'GetJobResult' => [ 'type' => 'structure', 'required' => [ 'job', ], 'members' => [ 'job' => [ 'shape' => 'Job', ], ], ], 'GetWebhookRequest' => [ 'type' => 'structure', 'required' => [ 'webhookId', ], 'members' => [ 'webhookId' => [ 'shape' => 'WebhookId', 'location' => 'uri', 'locationName' => 'webhookId', ], ], ], 'GetWebhookResult' => [ 'type' => 'structure', 'required' => [ 'webhook', ], 'members' => [ 'webhook' => [ 'shape' => 'Webhook', ], ], ], 'InternalFailureException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'Job' => [ 'type' => 'structure', 'required' => [ 'summary', 'steps', ], 'members' => [ 'summary' => [ 'shape' => 'JobSummary', ], 'steps' => [ 'shape' => 'Steps', ], ], ], 'JobArn' => [ 'type' => 'string', 'max' => 1000, ], 'JobId' => [ 'type' => 'string', 'max' => 255, 'pattern' => '[0-9]+', ], 'JobReason' => [ 'type' => 'string', 'max' => 255, 'pattern' => '(?s).*', ], 'JobStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING', 'PROVISIONING', 'RUNNING', 'FAILED', 'SUCCEED', 'CANCELLING', 'CANCELLED', ], ], 'JobSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'JobSummary', ], ], 'JobSummary' => [ 'type' => 'structure', 'required' => [ 'jobArn', 'jobId', 'commitId', 'commitMessage', 'commitTime', 'startTime', 'status', 'jobType', ], 'members' => [ 'jobArn' => [ 'shape' => 'JobArn', ], 'jobId' => [ 'shape' => 'JobId', ], 'commitId' => [ 'shape' => 'CommitId', ], 'commitMessage' => [ 'shape' => 'CommitMessage', ], 'commitTime' => [ 'shape' => 'CommitTime', ], 'startTime' => [ 'shape' => 'StartTime', ], 'status' => [ 'shape' => 'JobStatus', ], 'endTime' => [ 'shape' => 'EndTime', ], 'jobType' => [ 'shape' => 'JobType', ], ], ], 'JobType' => [ 'type' => 'string', 'enum' => [ 'RELEASE', 'RETRY', 'MANUAL', 'WEB_HOOK', ], 'max' => 10, ], 'LastDeployTime' => [ 'type' => 'timestamp', ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], 'ListAppsRequest' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListAppsResult' => [ 'type' => 'structure', 'required' => [ 'apps', ], 'members' => [ 'apps' => [ 'shape' => 'Apps', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListArtifactsRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'branchName', 'jobId', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'branchName' => [ 'shape' => 'BranchName', 'location' => 'uri', 'locationName' => 'branchName', ], 'jobId' => [ 'shape' => 'JobId', 'location' => 'uri', 'locationName' => 'jobId', ], 'nextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListArtifactsResult' => [ 'type' => 'structure', 'required' => [ 'artifacts', ], 'members' => [ 'artifacts' => [ 'shape' => 'Artifacts', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListBackendEnvironmentsRequest' => [ 'type' => 'structure', 'required' => [ 'appId', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'EnvironmentName', 'location' => 'querystring', 'locationName' => 'environmentName', ], 'nextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListBackendEnvironmentsResult' => [ 'type' => 'structure', 'required' => [ 'backendEnvironments', ], 'members' => [ 'backendEnvironments' => [ 'shape' => 'BackendEnvironments', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListBranchesRequest' => [ 'type' => 'structure', 'required' => [ 'appId', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'nextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListBranchesResult' => [ 'type' => 'structure', 'required' => [ 'branches', ], 'members' => [ 'branches' => [ 'shape' => 'Branches', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListDomainAssociationsRequest' => [ 'type' => 'structure', 'required' => [ 'appId', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'nextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListDomainAssociationsResult' => [ 'type' => 'structure', 'required' => [ 'domainAssociations', ], 'members' => [ 'domainAssociations' => [ 'shape' => 'DomainAssociations', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListJobsRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'branchName', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'branchName' => [ 'shape' => 'BranchName', 'location' => 'uri', 'locationName' => 'branchName', ], 'nextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListJobsResult' => [ 'type' => 'structure', 'required' => [ 'jobSummaries', ], 'members' => [ 'jobSummaries' => [ 'shape' => 'JobSummaries', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', ], 'members' => [ 'resourceArn' => [ 'shape' => 'ResourceArn', 'location' => 'uri', 'locationName' => 'resourceArn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'tags' => [ 'shape' => 'TagMap', ], ], ], 'ListWebhooksRequest' => [ 'type' => 'structure', 'required' => [ 'appId', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'nextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListWebhooksResult' => [ 'type' => 'structure', 'required' => [ 'webhooks', ], 'members' => [ 'webhooks' => [ 'shape' => 'Webhooks', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'LogUrl' => [ 'type' => 'string', 'max' => 1000, ], 'MD5Hash' => [ 'type' => 'string', 'max' => 32, 'pattern' => '(?s).*', ], 'MaxResults' => [ 'type' => 'integer', 'max' => 100, 'min' => 0, ], 'Name' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '(?s).+', ], 'NextToken' => [ 'type' => 'string', 'max' => 2000, 'pattern' => '(?s).*', ], 'NotFoundException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'OauthToken' => [ 'type' => 'string', 'max' => 1000, 'pattern' => '(?s).*', 'sensitive' => true, ], 'Platform' => [ 'type' => 'string', 'enum' => [ 'WEB', 'WEB_DYNAMIC', 'WEB_COMPUTE', ], ], 'ProductionBranch' => [ 'type' => 'structure', 'members' => [ 'lastDeployTime' => [ 'shape' => 'LastDeployTime', ], 'status' => [ 'shape' => 'Status', ], 'thumbnailUrl' => [ 'shape' => 'ThumbnailUrl', ], 'branchName' => [ 'shape' => 'BranchName', ], ], ], 'PullRequestEnvironmentName' => [ 'type' => 'string', 'max' => 20, 'pattern' => '(?s).*', ], 'Repository' => [ 'type' => 'string', 'max' => 1000, 'pattern' => '(?s).*', ], 'RepositoryCloneMethod' => [ 'type' => 'string', 'enum' => [ 'SSH', 'TOKEN', 'SIGV4', ], ], 'ResourceArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 0, 'pattern' => '^arn:aws:amplify:.*', ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'required' => [ 'code', 'message', ], 'members' => [ 'code' => [ 'shape' => 'Code', ], 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'Screenshots' => [ 'type' => 'map', 'key' => [ 'shape' => 'ThumbnailName', ], 'value' => [ 'shape' => 'ThumbnailUrl', ], ], 'ServiceRoleArn' => [ 'type' => 'string', 'max' => 1000, 'min' => 0, 'pattern' => '(?s).*', ], 'Source' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, 'pattern' => '(?s).+', ], 'SourceUrl' => [ 'type' => 'string', 'max' => 3000, 'pattern' => '(?s).*', ], 'StackName' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '(?s).+', ], 'Stage' => [ 'type' => 'string', 'enum' => [ 'PRODUCTION', 'BETA', 'DEVELOPMENT', 'EXPERIMENTAL', 'PULL_REQUEST', ], ], 'StartDeploymentRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'branchName', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'branchName' => [ 'shape' => 'BranchName', 'location' => 'uri', 'locationName' => 'branchName', ], 'jobId' => [ 'shape' => 'JobId', ], 'sourceUrl' => [ 'shape' => 'SourceUrl', ], ], ], 'StartDeploymentResult' => [ 'type' => 'structure', 'required' => [ 'jobSummary', ], 'members' => [ 'jobSummary' => [ 'shape' => 'JobSummary', ], ], ], 'StartJobRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'branchName', 'jobType', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'branchName' => [ 'shape' => 'BranchName', 'location' => 'uri', 'locationName' => 'branchName', ], 'jobId' => [ 'shape' => 'JobId', ], 'jobType' => [ 'shape' => 'JobType', ], 'jobReason' => [ 'shape' => 'JobReason', ], 'commitId' => [ 'shape' => 'CommitId', ], 'commitMessage' => [ 'shape' => 'CommitMessage', ], 'commitTime' => [ 'shape' => 'CommitTime', ], ], ], 'StartJobResult' => [ 'type' => 'structure', 'required' => [ 'jobSummary', ], 'members' => [ 'jobSummary' => [ 'shape' => 'JobSummary', ], ], ], 'StartTime' => [ 'type' => 'timestamp', ], 'Status' => [ 'type' => 'string', 'max' => 7, 'min' => 3, 'pattern' => '.{3,7}', ], 'StatusReason' => [ 'type' => 'string', 'max' => 1000, ], 'Step' => [ 'type' => 'structure', 'required' => [ 'stepName', 'startTime', 'status', 'endTime', ], 'members' => [ 'stepName' => [ 'shape' => 'StepName', ], 'startTime' => [ 'shape' => 'StartTime', ], 'status' => [ 'shape' => 'JobStatus', ], 'endTime' => [ 'shape' => 'EndTime', ], 'logUrl' => [ 'shape' => 'LogUrl', ], 'artifactsUrl' => [ 'shape' => 'ArtifactsUrl', ], 'testArtifactsUrl' => [ 'shape' => 'TestArtifactsUrl', ], 'testConfigUrl' => [ 'shape' => 'TestConfigUrl', ], 'screenshots' => [ 'shape' => 'Screenshots', ], 'statusReason' => [ 'shape' => 'StatusReason', ], 'context' => [ 'shape' => 'Context', ], ], ], 'StepName' => [ 'type' => 'string', 'max' => 255, ], 'Steps' => [ 'type' => 'list', 'member' => [ 'shape' => 'Step', ], ], 'StopJobRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'branchName', 'jobId', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'branchName' => [ 'shape' => 'BranchName', 'location' => 'uri', 'locationName' => 'branchName', ], 'jobId' => [ 'shape' => 'JobId', 'location' => 'uri', 'locationName' => 'jobId', ], ], ], 'StopJobResult' => [ 'type' => 'structure', 'required' => [ 'jobSummary', ], 'members' => [ 'jobSummary' => [ 'shape' => 'JobSummary', ], ], ], 'SubDomain' => [ 'type' => 'structure', 'required' => [ 'subDomainSetting', 'verified', 'dnsRecord', ], 'members' => [ 'subDomainSetting' => [ 'shape' => 'SubDomainSetting', ], 'verified' => [ 'shape' => 'Verified', ], 'dnsRecord' => [ 'shape' => 'DNSRecord', ], ], ], 'SubDomainSetting' => [ 'type' => 'structure', 'required' => [ 'prefix', 'branchName', ], 'members' => [ 'prefix' => [ 'shape' => 'DomainPrefix', ], 'branchName' => [ 'shape' => 'BranchName', ], ], ], 'SubDomainSettings' => [ 'type' => 'list', 'member' => [ 'shape' => 'SubDomainSetting', ], 'max' => 500, ], 'SubDomains' => [ 'type' => 'list', 'member' => [ 'shape' => 'SubDomain', ], 'max' => 500, ], 'TTL' => [ 'type' => 'string', 'max' => 32, 'min' => 0, 'pattern' => '\\\\d*', ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^(?!aws:)[a-zA-Z+-=._:/]+$', ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 50, 'min' => 1, ], 'TagMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'TagKey', ], 'value' => [ 'shape' => 'TagValue', ], 'max' => 50, 'min' => 0, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tags', ], 'members' => [ 'resourceArn' => [ 'shape' => 'ResourceArn', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'pattern' => '^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$', ], 'Target' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, 'pattern' => '(?s).+', ], 'TestArtifactsUrl' => [ 'type' => 'string', 'max' => 1000, ], 'TestConfigUrl' => [ 'type' => 'string', 'max' => 1000, ], 'ThumbnailName' => [ 'type' => 'string', 'max' => 256, ], 'ThumbnailUrl' => [ 'type' => 'string', 'max' => 2000, 'min' => 1, ], 'TotalNumberOfJobs' => [ 'type' => 'string', 'max' => 1000, ], 'UnauthorizedException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tagKeys', ], 'members' => [ 'resourceArn' => [ 'shape' => 'ResourceArn', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tagKeys' => [ 'shape' => 'TagKeyList', 'location' => 'querystring', 'locationName' => 'tagKeys', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateAppRequest' => [ 'type' => 'structure', 'required' => [ 'appId', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'name' => [ 'shape' => 'Name', ], 'description' => [ 'shape' => 'Description', ], 'platform' => [ 'shape' => 'Platform', ], 'iamServiceRoleArn' => [ 'shape' => 'ServiceRoleArn', ], 'environmentVariables' => [ 'shape' => 'EnvironmentVariables', ], 'enableBranchAutoBuild' => [ 'shape' => 'EnableAutoBuild', ], 'enableBranchAutoDeletion' => [ 'shape' => 'EnableBranchAutoDeletion', ], 'enableBasicAuth' => [ 'shape' => 'EnableBasicAuth', ], 'basicAuthCredentials' => [ 'shape' => 'BasicAuthCredentials', ], 'customRules' => [ 'shape' => 'CustomRules', ], 'buildSpec' => [ 'shape' => 'BuildSpec', ], 'customHeaders' => [ 'shape' => 'CustomHeaders', ], 'enableAutoBranchCreation' => [ 'shape' => 'EnableAutoBranchCreation', ], 'autoBranchCreationPatterns' => [ 'shape' => 'AutoBranchCreationPatterns', ], 'autoBranchCreationConfig' => [ 'shape' => 'AutoBranchCreationConfig', ], 'repository' => [ 'shape' => 'Repository', ], 'oauthToken' => [ 'shape' => 'OauthToken', ], 'accessToken' => [ 'shape' => 'AccessToken', ], ], ], 'UpdateAppResult' => [ 'type' => 'structure', 'required' => [ 'app', ], 'members' => [ 'app' => [ 'shape' => 'App', ], ], ], 'UpdateBranchRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'branchName', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'branchName' => [ 'shape' => 'BranchName', 'location' => 'uri', 'locationName' => 'branchName', ], 'description' => [ 'shape' => 'Description', ], 'framework' => [ 'shape' => 'Framework', ], 'stage' => [ 'shape' => 'Stage', ], 'enableNotification' => [ 'shape' => 'EnableNotification', ], 'enableAutoBuild' => [ 'shape' => 'EnableAutoBuild', ], 'environmentVariables' => [ 'shape' => 'EnvironmentVariables', ], 'basicAuthCredentials' => [ 'shape' => 'BasicAuthCredentials', ], 'enableBasicAuth' => [ 'shape' => 'EnableBasicAuth', ], 'enablePerformanceMode' => [ 'shape' => 'EnablePerformanceMode', ], 'buildSpec' => [ 'shape' => 'BuildSpec', ], 'ttl' => [ 'shape' => 'TTL', ], 'displayName' => [ 'shape' => 'DisplayName', ], 'enablePullRequestPreview' => [ 'shape' => 'EnablePullRequestPreview', ], 'pullRequestEnvironmentName' => [ 'shape' => 'PullRequestEnvironmentName', ], 'backendEnvironmentArn' => [ 'shape' => 'BackendEnvironmentArn', ], ], ], 'UpdateBranchResult' => [ 'type' => 'structure', 'required' => [ 'branch', ], 'members' => [ 'branch' => [ 'shape' => 'Branch', ], ], ], 'UpdateDomainAssociationRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'domainName', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'domainName' => [ 'shape' => 'DomainName', 'location' => 'uri', 'locationName' => 'domainName', ], 'enableAutoSubDomain' => [ 'shape' => 'EnableAutoSubDomain', ], 'subDomainSettings' => [ 'shape' => 'SubDomainSettings', ], 'autoSubDomainCreationPatterns' => [ 'shape' => 'AutoSubDomainCreationPatterns', ], 'autoSubDomainIAMRole' => [ 'shape' => 'AutoSubDomainIAMRole', ], ], ], 'UpdateDomainAssociationResult' => [ 'type' => 'structure', 'required' => [ 'domainAssociation', ], 'members' => [ 'domainAssociation' => [ 'shape' => 'DomainAssociation', ], ], ], 'UpdateTime' => [ 'type' => 'timestamp', ], 'UpdateWebhookRequest' => [ 'type' => 'structure', 'required' => [ 'webhookId', ], 'members' => [ 'webhookId' => [ 'shape' => 'WebhookId', 'location' => 'uri', 'locationName' => 'webhookId', ], 'branchName' => [ 'shape' => 'BranchName', ], 'description' => [ 'shape' => 'Description', ], ], ], 'UpdateWebhookResult' => [ 'type' => 'structure', 'required' => [ 'webhook', ], 'members' => [ 'webhook' => [ 'shape' => 'Webhook', ], ], ], 'UploadUrl' => [ 'type' => 'string', 'max' => 1000, ], 'Verified' => [ 'type' => 'boolean', ], 'Webhook' => [ 'type' => 'structure', 'required' => [ 'webhookArn', 'webhookId', 'webhookUrl', 'branchName', 'description', 'createTime', 'updateTime', ], 'members' => [ 'webhookArn' => [ 'shape' => 'WebhookArn', ], 'webhookId' => [ 'shape' => 'WebhookId', ], 'webhookUrl' => [ 'shape' => 'WebhookUrl', ], 'branchName' => [ 'shape' => 'BranchName', ], 'description' => [ 'shape' => 'Description', ], 'createTime' => [ 'shape' => 'CreateTime', ], 'updateTime' => [ 'shape' => 'UpdateTime', ], ], ], 'WebhookArn' => [ 'type' => 'string', 'max' => 1000, ], 'WebhookId' => [ 'type' => 'string', 'max' => 255, 'pattern' => '(?s).*', ], 'WebhookUrl' => [ 'type' => 'string', 'max' => 1000, ], 'Webhooks' => [ 'type' => 'list', 'member' => [ 'shape' => 'Webhook', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplify/2017-07-25/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>Amplify enables developers to develop and deploy cloud-powered mobile and web apps. The Amplify Console provides a continuous delivery and hosting service for web applications. For more information, see the <a href=\"https://docs.aws.amazon.com/amplify/latest/userguide/welcome.html\">Amplify Console User Guide</a>. The Amplify Framework is a comprehensive set of SDKs, libraries, tools, and documentation for client app development. For more information, see the <a href=\"https://docs.amplify.aws/\">Amplify Framework.</a> </p>', 'operations' => [ 'CreateApp' => '<p> Creates a new Amplify app. </p>', 'CreateBackendEnvironment' => '<p> Creates a new backend environment for an Amplify app. </p>', 'CreateBranch' => '<p> Creates a new branch for an Amplify app. </p>', 'CreateDeployment' => '<p> Creates a deployment for a manually deployed Amplify app. Manually deployed apps are not connected to a repository. </p>', 'CreateDomainAssociation' => '<p> Creates a new domain association for an Amplify app. This action associates a custom domain with the Amplify app </p>', 'CreateWebhook' => '<p> Creates a new webhook on an Amplify app. </p>', 'DeleteApp' => '<p> Deletes an existing Amplify app specified by an app ID. </p>', 'DeleteBackendEnvironment' => '<p> Deletes a backend environment for an Amplify app. </p>', 'DeleteBranch' => '<p> Deletes a branch for an Amplify app. </p>', 'DeleteDomainAssociation' => '<p> Deletes a domain association for an Amplify app. </p>', 'DeleteJob' => '<p> Deletes a job for a branch of an Amplify app. </p>', 'DeleteWebhook' => '<p> Deletes a webhook. </p>', 'GenerateAccessLogs' => '<p> Returns the website access logs for a specific time range using a presigned URL. </p>', 'GetApp' => '<p> Returns an existing Amplify app by appID. </p>', 'GetArtifactUrl' => '<p> Returns the artifact info that corresponds to an artifact id. </p>', 'GetBackendEnvironment' => '<p> Returns a backend environment for an Amplify app. </p>', 'GetBranch' => '<p> Returns a branch for an Amplify app. </p>', 'GetDomainAssociation' => '<p> Returns the domain information for an Amplify app. </p>', 'GetJob' => '<p> Returns a job for a branch of an Amplify app. </p>', 'GetWebhook' => '<p> Returns the webhook information that corresponds to a specified webhook ID. </p>', 'ListApps' => '<p> Returns a list of the existing Amplify apps. </p>', 'ListArtifacts' => '<p> Returns a list of artifacts for a specified app, branch, and job. </p>', 'ListBackendEnvironments' => '<p> Lists the backend environments for an Amplify app. </p>', 'ListBranches' => '<p> Lists the branches of an Amplify app. </p>', 'ListDomainAssociations' => '<p> Returns the domain associations for an Amplify app. </p>', 'ListJobs' => '<p> Lists the jobs for a branch of an Amplify app. </p>', 'ListTagsForResource' => '<p> Returns a list of tags for a specified Amazon Resource Name (ARN). </p>', 'ListWebhooks' => '<p> Returns a list of webhooks for an Amplify app. </p>', 'StartDeployment' => '<p> Starts a deployment for a manually deployed app. Manually deployed apps are not connected to a repository. </p>', 'StartJob' => '<p> Starts a new job for a branch of an Amplify app. </p>', 'StopJob' => '<p> Stops a job that is in progress for a branch of an Amplify app. </p>', 'TagResource' => '<p> Tags the resource with a tag key and value. </p>', 'UntagResource' => '<p> Untags a resource with a specified Amazon Resource Name (ARN). </p>', 'UpdateApp' => '<p> Updates an existing Amplify app. </p>', 'UpdateBranch' => '<p> Updates a branch for an Amplify app. </p>', 'UpdateDomainAssociation' => '<p> Creates a new domain association for an Amplify app.</p>', 'UpdateWebhook' => '<p> Updates a webhook. </p>', ], 'shapes' => [ 'AccessToken' => [ 'base' => NULL, 'refs' => [ 'CreateAppRequest$accessToken' => '<p>The personal access token for a GitHub repository for an Amplify app. The personal access token is used to authorize access to a GitHub repository using the Amplify GitHub App. The token is not stored.</p> <p>Use <code>accessToken</code> for GitHub repositories only. To authorize access to a repository provider such as Bitbucket or CodeCommit, use <code>oauthToken</code>.</p> <p>You must specify either <code>accessToken</code> or <code>oauthToken</code> when you create a new app.</p> <p>Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see <a href=\"https://docs.aws.amazon.com/amplify/latest/UserGuide/setting-up-GitHub-access.html#migrating-to-github-app-auth\">Migrating an existing OAuth app to the Amplify GitHub App</a> in the <i>Amplify User Guide</i> .</p>', 'UpdateAppRequest$accessToken' => '<p>The personal access token for a GitHub repository for an Amplify app. The personal access token is used to authorize access to a GitHub repository using the Amplify GitHub App. The token is not stored.</p> <p>Use <code>accessToken</code> for GitHub repositories only. To authorize access to a repository provider such as Bitbucket or CodeCommit, use <code>oauthToken</code>.</p> <p>You must specify either <code>accessToken</code> or <code>oauthToken</code> when you update an app.</p> <p>Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see <a href=\"https://docs.aws.amazon.com/amplify/latest/UserGuide/setting-up-GitHub-access.html#migrating-to-github-app-auth\">Migrating an existing OAuth app to the Amplify GitHub App</a> in the <i>Amplify User Guide</i> .</p>', ], ], 'ActiveJobId' => [ 'base' => NULL, 'refs' => [ 'Branch$activeJobId' => '<p> The ID of the active job for a branch of an Amplify app. </p>', ], ], 'App' => [ 'base' => '<p> Represents the different branches of a repository for building, deploying, and hosting an Amplify app. </p>', 'refs' => [ 'Apps$member' => NULL, 'CreateAppResult$app' => NULL, 'DeleteAppResult$app' => NULL, 'GetAppResult$app' => NULL, 'UpdateAppResult$app' => '<p> Represents the updated Amplify app. </p>', ], ], 'AppArn' => [ 'base' => NULL, 'refs' => [ 'App$appArn' => '<p> The Amazon Resource Name (ARN) of the Amplify app. </p>', ], ], 'AppId' => [ 'base' => NULL, 'refs' => [ 'App$appId' => '<p> The unique ID of the Amplify app. </p>', 'CreateBackendEnvironmentRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'CreateBranchRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'CreateDeploymentRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'CreateDomainAssociationRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'CreateWebhookRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'DeleteAppRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'DeleteBackendEnvironmentRequest$appId' => '<p> The unique ID of an Amplify app. </p>', 'DeleteBranchRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'DeleteDomainAssociationRequest$appId' => '<p> The unique id for an Amplify app. </p>', 'DeleteJobRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'GenerateAccessLogsRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'GetAppRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'GetBackendEnvironmentRequest$appId' => '<p> The unique id for an Amplify app. </p>', 'GetBranchRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'GetDomainAssociationRequest$appId' => '<p> The unique id for an Amplify app. </p>', 'GetJobRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'ListArtifactsRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'ListBackendEnvironmentsRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'ListBranchesRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'ListDomainAssociationsRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'ListJobsRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'ListWebhooksRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'StartDeploymentRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'StartJobRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'StopJobRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'UpdateAppRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'UpdateBranchRequest$appId' => '<p> The unique ID for an Amplify app. </p>', 'UpdateDomainAssociationRequest$appId' => '<p> The unique ID for an Amplify app. </p>', ], ], 'Apps' => [ 'base' => NULL, 'refs' => [ 'ListAppsResult$apps' => '<p> A list of Amplify apps. </p>', ], ], 'Artifact' => [ 'base' => '<p> Describes an artifact. </p>', 'refs' => [ 'Artifacts$member' => NULL, ], ], 'ArtifactFileName' => [ 'base' => NULL, 'refs' => [ 'Artifact$artifactFileName' => '<p> The file name for the artifact. </p>', ], ], 'ArtifactId' => [ 'base' => NULL, 'refs' => [ 'Artifact$artifactId' => '<p> The unique ID for the artifact. </p>', 'GetArtifactUrlRequest$artifactId' => '<p> The unique ID for an artifact. </p>', 'GetArtifactUrlResult$artifactId' => '<p> The unique ID for an artifact. </p>', ], ], 'ArtifactUrl' => [ 'base' => NULL, 'refs' => [ 'GetArtifactUrlResult$artifactUrl' => '<p> The presigned URL for the artifact. </p>', ], ], 'Artifacts' => [ 'base' => NULL, 'refs' => [ 'ListArtifactsResult$artifacts' => '<p> A list of artifacts. </p>', ], ], 'ArtifactsUrl' => [ 'base' => NULL, 'refs' => [ 'Step$artifactsUrl' => '<p> The URL to the artifact for the execution step. </p>', ], ], 'AssociatedResource' => [ 'base' => NULL, 'refs' => [ 'AssociatedResources$member' => NULL, ], ], 'AssociatedResources' => [ 'base' => NULL, 'refs' => [ 'Branch$associatedResources' => '<p> A list of custom resources that are linked to this branch. </p>', ], ], 'AutoBranchCreationConfig' => [ 'base' => '<p> Describes the automated branch creation configuration. </p>', 'refs' => [ 'App$autoBranchCreationConfig' => '<p> Describes the automated branch creation configuration for the Amplify app. </p>', 'CreateAppRequest$autoBranchCreationConfig' => '<p> The automated branch creation configuration for an Amplify app. </p>', 'UpdateAppRequest$autoBranchCreationConfig' => '<p> The automated branch creation configuration for an Amplify app. </p>', ], ], 'AutoBranchCreationPattern' => [ 'base' => NULL, 'refs' => [ 'AutoBranchCreationPatterns$member' => NULL, ], ], 'AutoBranchCreationPatterns' => [ 'base' => NULL, 'refs' => [ 'App$autoBranchCreationPatterns' => '<p> Describes the automated branch creation glob patterns for the Amplify app. </p>', 'CreateAppRequest$autoBranchCreationPatterns' => '<p> The automated branch creation glob patterns for an Amplify app. </p>', 'UpdateAppRequest$autoBranchCreationPatterns' => '<p> Describes the automated branch creation glob patterns for an Amplify app. </p>', ], ], 'AutoSubDomainCreationPattern' => [ 'base' => NULL, 'refs' => [ 'AutoSubDomainCreationPatterns$member' => NULL, ], ], 'AutoSubDomainCreationPatterns' => [ 'base' => NULL, 'refs' => [ 'CreateDomainAssociationRequest$autoSubDomainCreationPatterns' => '<p> Sets the branch patterns for automatic subdomain creation. </p>', 'DomainAssociation$autoSubDomainCreationPatterns' => '<p> Sets branch patterns for automatic subdomain creation. </p>', 'UpdateDomainAssociationRequest$autoSubDomainCreationPatterns' => '<p> Sets the branch patterns for automatic subdomain creation. </p>', ], ], 'AutoSubDomainIAMRole' => [ 'base' => NULL, 'refs' => [ 'CreateDomainAssociationRequest$autoSubDomainIAMRole' => '<p> The required AWS Identity and Access Management (IAM) service role for the Amazon Resource Name (ARN) for automatically creating subdomains. </p>', 'DomainAssociation$autoSubDomainIAMRole' => '<p> The required AWS Identity and Access Management (IAM) service role for the Amazon Resource Name (ARN) for automatically creating subdomains. </p>', 'UpdateDomainAssociationRequest$autoSubDomainIAMRole' => '<p> The required AWS Identity and Access Management (IAM) service role for the Amazon Resource Name (ARN) for automatically creating subdomains. </p>', ], ], 'BackendEnvironment' => [ 'base' => '<p> Describes the backend environment for an Amplify app. </p>', 'refs' => [ 'BackendEnvironments$member' => NULL, 'CreateBackendEnvironmentResult$backendEnvironment' => '<p> Describes the backend environment for an Amplify app. </p>', 'DeleteBackendEnvironmentResult$backendEnvironment' => '<p> Describes the backend environment for an Amplify app. </p>', 'GetBackendEnvironmentResult$backendEnvironment' => '<p> Describes the backend environment for an Amplify app. </p>', ], ], 'BackendEnvironmentArn' => [ 'base' => NULL, 'refs' => [ 'BackendEnvironment$backendEnvironmentArn' => '<p> The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app. </p>', 'Branch$backendEnvironmentArn' => '<p> The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app. </p>', 'CreateBranchRequest$backendEnvironmentArn' => '<p> The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app. </p>', 'UpdateBranchRequest$backendEnvironmentArn' => '<p> The Amazon Resource Name (ARN) for a backend environment that is part of an Amplify app. </p>', ], ], 'BackendEnvironments' => [ 'base' => NULL, 'refs' => [ 'ListBackendEnvironmentsResult$backendEnvironments' => '<p> The list of backend environments for an Amplify app. </p>', ], ], 'BadRequestException' => [ 'base' => '<p> A request contains unexpected data. </p>', 'refs' => [], ], 'BasicAuthCredentials' => [ 'base' => NULL, 'refs' => [ 'App$basicAuthCredentials' => '<p> The basic authorization credentials for branches for the Amplify app. You must base64-encode the authorization credentials and provide them in the format <code>user:password</code>.</p>', 'AutoBranchCreationConfig$basicAuthCredentials' => '<p> The basic authorization credentials for the autocreated branch. You must base64-encode the authorization credentials and provide them in the format <code>user:password</code>.</p>', 'Branch$basicAuthCredentials' => '<p> The basic authorization credentials for a branch of an Amplify app. You must base64-encode the authorization credentials and provide them in the format <code>user:password</code>.</p>', 'CreateAppRequest$basicAuthCredentials' => '<p> The credentials for basic authorization for an Amplify app. You must base64-encode the authorization credentials and provide them in the format <code>user:password</code>.</p>', 'CreateBranchRequest$basicAuthCredentials' => '<p> The basic authorization credentials for the branch. You must base64-encode the authorization credentials and provide them in the format <code>user:password</code>.</p>', 'UpdateAppRequest$basicAuthCredentials' => '<p> The basic authorization credentials for an Amplify app. You must base64-encode the authorization credentials and provide them in the format <code>user:password</code>.</p>', 'UpdateBranchRequest$basicAuthCredentials' => '<p> The basic authorization credentials for the branch. You must base64-encode the authorization credentials and provide them in the format <code>user:password</code>.</p>', ], ], 'Branch' => [ 'base' => '<p> The branch for an Amplify app, which maps to a third-party repository branch. </p>', 'refs' => [ 'Branches$member' => NULL, 'CreateBranchResult$branch' => '<p> Describes the branch for an Amplify app, which maps to a third-party repository branch. </p>', 'DeleteBranchResult$branch' => '<p> The branch for an Amplify app, which maps to a third-party repository branch. </p>', 'GetBranchResult$branch' => NULL, 'UpdateBranchResult$branch' => '<p> The branch for an Amplify app, which maps to a third-party repository branch. </p>', ], ], 'BranchArn' => [ 'base' => NULL, 'refs' => [ 'Branch$branchArn' => '<p> The Amazon Resource Name (ARN) for a branch that is part of an Amplify app. </p>', ], ], 'BranchName' => [ 'base' => NULL, 'refs' => [ 'Branch$branchName' => '<p> The name for the branch that is part of an Amplify app. </p>', 'Branch$destinationBranch' => '<p> The destination branch if the branch is a pull request branch. </p>', 'Branch$sourceBranch' => '<p> The source branch if the branch is a pull request branch. </p>', 'CreateBranchRequest$branchName' => '<p> The name for the branch. </p>', 'CreateDeploymentRequest$branchName' => '<p> The name for the branch, for the job. </p>', 'CreateWebhookRequest$branchName' => '<p> The name for a branch that is part of an Amplify app. </p>', 'DeleteBranchRequest$branchName' => '<p> The name for the branch. </p>', 'DeleteJobRequest$branchName' => '<p> The name for the branch, for the job. </p>', 'GetBranchRequest$branchName' => '<p> The name for the branch. </p>', 'GetJobRequest$branchName' => '<p> The branch name for the job. </p>', 'ListArtifactsRequest$branchName' => '<p> The name of a branch that is part of an Amplify app. </p>', 'ListJobsRequest$branchName' => '<p> The name for a branch. </p>', 'ProductionBranch$branchName' => '<p> The branch name for the production branch. </p>', 'StartDeploymentRequest$branchName' => '<p> The name for the branch, for the job. </p>', 'StartJobRequest$branchName' => '<p> The branch name for the job. </p>', 'StopJobRequest$branchName' => '<p> The name for the branch, for the job. </p>', 'SubDomainSetting$branchName' => '<p> The branch name setting for the subdomain. </p>', 'UpdateBranchRequest$branchName' => '<p> The name for the branch. </p>', 'UpdateWebhookRequest$branchName' => '<p> The name for a branch that is part of an Amplify app. </p>', 'Webhook$branchName' => '<p> The name for a branch that is part of an Amplify app. </p>', ], ], 'Branches' => [ 'base' => NULL, 'refs' => [ 'ListBranchesResult$branches' => '<p> A list of branches for an Amplify app. </p>', ], ], 'BuildSpec' => [ 'base' => '<p> The build specification (build spec) file for an Amplify app build. </p>', 'refs' => [ 'App$buildSpec' => '<p> Describes the content of the build specification (build spec) for the Amplify app. </p>', 'AutoBranchCreationConfig$buildSpec' => '<p> The build specification (build spec) for the autocreated branch. </p>', 'Branch$buildSpec' => '<p> The build specification (build spec) content for the branch of an Amplify app. </p>', 'CreateAppRequest$buildSpec' => '<p> The build specification (build spec) for an Amplify app. </p>', 'CreateBranchRequest$buildSpec' => '<p> The build specification (build spec) for the branch. </p>', 'UpdateAppRequest$buildSpec' => '<p> The build specification (build spec) for an Amplify app. </p>', 'UpdateBranchRequest$buildSpec' => '<p> The build specification (build spec) for the branch. </p>', ], ], 'CertificateVerificationDNSRecord' => [ 'base' => NULL, 'refs' => [ 'DomainAssociation$certificateVerificationDNSRecord' => '<p> The DNS record for certificate verification. </p>', ], ], 'Code' => [ 'base' => NULL, 'refs' => [ 'ResourceNotFoundException$code' => NULL, ], ], 'CommitId' => [ 'base' => NULL, 'refs' => [ 'JobSummary$commitId' => '<p> The commit ID from a third-party repository provider for the job. </p>', 'StartJobRequest$commitId' => '<p> The commit ID from a third-party repository provider for the job. </p>', ], ], 'CommitMessage' => [ 'base' => NULL, 'refs' => [ 'JobSummary$commitMessage' => '<p> The commit message from a third-party repository provider for the job. </p>', 'StartJobRequest$commitMessage' => '<p> The commit message from a third-party repository provider for the job. </p>', ], ], 'CommitTime' => [ 'base' => NULL, 'refs' => [ 'JobSummary$commitTime' => '<p> The commit date and time for the job. </p>', 'StartJobRequest$commitTime' => '<p> The commit date and time for the job. </p>', ], ], 'Condition' => [ 'base' => NULL, 'refs' => [ 'CustomRule$condition' => '<p> The condition for a URL rewrite or redirect rule, such as a country code. </p>', ], ], 'Context' => [ 'base' => NULL, 'refs' => [ 'Step$context' => '<p> The context for the current step. Includes a build image if the step is build. </p>', ], ], 'CreateAppRequest' => [ 'base' => '<p> The request structure used to create apps in Amplify. </p>', 'refs' => [], ], 'CreateAppResult' => [ 'base' => NULL, 'refs' => [], ], 'CreateBackendEnvironmentRequest' => [ 'base' => '<p> The request structure for the backend environment create request. </p>', 'refs' => [], ], 'CreateBackendEnvironmentResult' => [ 'base' => '<p> The result structure for the create backend environment request. </p>', 'refs' => [], ], 'CreateBranchRequest' => [ 'base' => '<p> The request structure for the create branch request. </p>', 'refs' => [], ], 'CreateBranchResult' => [ 'base' => '<p> The result structure for create branch request. </p>', 'refs' => [], ], 'CreateDeploymentRequest' => [ 'base' => '<p> The request structure for the create a new deployment request. </p>', 'refs' => [], ], 'CreateDeploymentResult' => [ 'base' => '<p> The result structure for the create a new deployment request. </p>', 'refs' => [], ], 'CreateDomainAssociationRequest' => [ 'base' => '<p> The request structure for the create domain association request. </p>', 'refs' => [], ], 'CreateDomainAssociationResult' => [ 'base' => '<p> The result structure for the create domain association request. </p>', 'refs' => [], ], 'CreateTime' => [ 'base' => NULL, 'refs' => [ 'App$createTime' => '<p> Creates a date and time for the Amplify app. </p>', 'BackendEnvironment$createTime' => '<p> The creation date and time for a backend environment that is part of an Amplify app. </p>', 'Branch$createTime' => '<p> The creation date and time for a branch that is part of an Amplify app. </p>', 'Webhook$createTime' => '<p> The create date and time for a webhook. </p>', ], ], 'CreateWebhookRequest' => [ 'base' => '<p> The request structure for the create webhook request. </p>', 'refs' => [], ], 'CreateWebhookResult' => [ 'base' => '<p> The result structure for the create webhook request. </p>', 'refs' => [], ], 'CustomDomain' => [ 'base' => NULL, 'refs' => [ 'CustomDomains$member' => NULL, ], ], 'CustomDomains' => [ 'base' => NULL, 'refs' => [ 'Branch$customDomains' => '<p> The custom domains for a branch of an Amplify app. </p>', ], ], 'CustomHeaders' => [ 'base' => NULL, 'refs' => [ 'App$customHeaders' => '<p>Describes the custom HTTP headers for the Amplify app.</p>', 'CreateAppRequest$customHeaders' => '<p>The custom HTTP headers for an Amplify app.</p>', 'UpdateAppRequest$customHeaders' => '<p>The custom HTTP headers for an Amplify app.</p>', ], ], 'CustomRule' => [ 'base' => '<p> Describes a custom rewrite or redirect rule. </p>', 'refs' => [ 'CustomRules$member' => NULL, ], ], 'CustomRules' => [ 'base' => NULL, 'refs' => [ 'App$customRules' => '<p> Describes the custom redirect and rewrite rules for the Amplify app. </p>', 'CreateAppRequest$customRules' => '<p> The custom rewrite and redirect rules for an Amplify app. </p>', 'UpdateAppRequest$customRules' => '<p> The custom redirect and rewrite rules for an Amplify app. </p>', ], ], 'DNSRecord' => [ 'base' => NULL, 'refs' => [ 'SubDomain$dnsRecord' => '<p> The DNS record for the subdomain. </p>', ], ], 'DefaultDomain' => [ 'base' => NULL, 'refs' => [ 'App$defaultDomain' => '<p> The default domain for the Amplify app. </p>', ], ], 'DeleteAppRequest' => [ 'base' => '<p> Describes the request structure for the delete app request. </p>', 'refs' => [], ], 'DeleteAppResult' => [ 'base' => '<p> The result structure for the delete app request. </p>', 'refs' => [], ], 'DeleteBackendEnvironmentRequest' => [ 'base' => '<p> The request structure for the delete backend environment request. </p>', 'refs' => [], ], 'DeleteBackendEnvironmentResult' => [ 'base' => '<p> The result structure of the delete backend environment result. </p>', 'refs' => [], ], 'DeleteBranchRequest' => [ 'base' => '<p> The request structure for the delete branch request. </p>', 'refs' => [], ], 'DeleteBranchResult' => [ 'base' => '<p> The result structure for the delete branch request. </p>', 'refs' => [], ], 'DeleteDomainAssociationRequest' => [ 'base' => '<p> The request structure for the delete domain association request. </p>', 'refs' => [], ], 'DeleteDomainAssociationResult' => [ 'base' => NULL, 'refs' => [], ], 'DeleteJobRequest' => [ 'base' => '<p> The request structure for the delete job request. </p>', 'refs' => [], ], 'DeleteJobResult' => [ 'base' => '<p> The result structure for the delete job request. </p>', 'refs' => [], ], 'DeleteWebhookRequest' => [ 'base' => '<p> The request structure for the delete webhook request. </p>', 'refs' => [], ], 'DeleteWebhookResult' => [ 'base' => '<p> The result structure for the delete webhook request. </p>', 'refs' => [], ], 'DependentServiceFailureException' => [ 'base' => '<p> An operation failed because a dependent service threw an exception. </p>', 'refs' => [], ], 'DeploymentArtifacts' => [ 'base' => NULL, 'refs' => [ 'BackendEnvironment$deploymentArtifacts' => '<p> The name of deployment artifacts. </p>', 'CreateBackendEnvironmentRequest$deploymentArtifacts' => '<p> The name of deployment artifacts. </p>', ], ], 'Description' => [ 'base' => NULL, 'refs' => [ 'App$description' => '<p> The description for the Amplify app. </p>', 'Branch$description' => '<p> The description for the branch that is part of an Amplify app. </p>', 'CreateAppRequest$description' => '<p> The description for an Amplify app. </p>', 'CreateBranchRequest$description' => '<p> The description for the branch. </p>', 'CreateWebhookRequest$description' => '<p> The description for a webhook. </p>', 'UpdateAppRequest$description' => '<p> The description for an Amplify app. </p>', 'UpdateBranchRequest$description' => '<p> The description for the branch. </p>', 'UpdateWebhookRequest$description' => '<p> The description for a webhook. </p>', 'Webhook$description' => '<p> The description for a webhook. </p>', ], ], 'DisplayName' => [ 'base' => NULL, 'refs' => [ 'Branch$displayName' => '<p> The display name for the branch. This is used as the default domain prefix. </p>', 'CreateBranchRequest$displayName' => '<p> The display name for a branch. This is used as the default domain prefix. </p>', 'UpdateBranchRequest$displayName' => '<p> The display name for a branch. This is used as the default domain prefix. </p>', ], ], 'DomainAssociation' => [ 'base' => '<p> Describes a domain association that associates a custom domain with an Amplify app. </p>', 'refs' => [ 'CreateDomainAssociationResult$domainAssociation' => '<p> Describes the structure of a domain association, which associates a custom domain with an Amplify app. </p>', 'DeleteDomainAssociationResult$domainAssociation' => NULL, 'DomainAssociations$member' => NULL, 'GetDomainAssociationResult$domainAssociation' => '<p> Describes the structure of a domain association, which associates a custom domain with an Amplify app. </p>', 'UpdateDomainAssociationResult$domainAssociation' => '<p> Describes a domain association, which associates a custom domain with an Amplify app. </p>', ], ], 'DomainAssociationArn' => [ 'base' => NULL, 'refs' => [ 'DomainAssociation$domainAssociationArn' => '<p> The Amazon Resource Name (ARN) for the domain association. </p>', ], ], 'DomainAssociations' => [ 'base' => NULL, 'refs' => [ 'ListDomainAssociationsResult$domainAssociations' => '<p> A list of domain associations. </p>', ], ], 'DomainName' => [ 'base' => NULL, 'refs' => [ 'CreateDomainAssociationRequest$domainName' => '<p> The domain name for the domain association. </p>', 'DeleteDomainAssociationRequest$domainName' => '<p> The name of the domain. </p>', 'DomainAssociation$domainName' => '<p> The name of the domain. </p>', 'GenerateAccessLogsRequest$domainName' => '<p> The name of the domain. </p>', 'GetDomainAssociationRequest$domainName' => '<p> The name of the domain. </p>', 'UpdateDomainAssociationRequest$domainName' => '<p> The name of the domain. </p>', ], ], 'DomainPrefix' => [ 'base' => NULL, 'refs' => [ 'SubDomainSetting$prefix' => '<p> The prefix setting for the subdomain. </p>', ], ], 'DomainStatus' => [ 'base' => NULL, 'refs' => [ 'DomainAssociation$domainStatus' => '<p> The current status of the domain association. </p>', ], ], 'EnableAutoBranchCreation' => [ 'base' => NULL, 'refs' => [ 'App$enableAutoBranchCreation' => '<p> Enables automated branch creation for the Amplify app. </p>', 'CreateAppRequest$enableAutoBranchCreation' => '<p> Enables automated branch creation for an Amplify app. </p>', 'UpdateAppRequest$enableAutoBranchCreation' => '<p> Enables automated branch creation for an Amplify app. </p>', ], ], 'EnableAutoBuild' => [ 'base' => NULL, 'refs' => [ 'AutoBranchCreationConfig$enableAutoBuild' => '<p> Enables auto building for the autocreated branch. </p>', 'Branch$enableAutoBuild' => '<p> Enables auto-building on push for a branch of an Amplify app. </p>', 'CreateBranchRequest$enableAutoBuild' => '<p> Enables auto building for the branch. </p>', 'UpdateAppRequest$enableBranchAutoBuild' => '<p> Enables branch auto-building for an Amplify app. </p>', 'UpdateBranchRequest$enableAutoBuild' => '<p> Enables auto building for the branch. </p>', ], ], 'EnableAutoSubDomain' => [ 'base' => NULL, 'refs' => [ 'CreateDomainAssociationRequest$enableAutoSubDomain' => '<p> Enables the automated creation of subdomains for branches. </p>', 'DomainAssociation$enableAutoSubDomain' => '<p> Enables the automated creation of subdomains for branches. </p>', 'UpdateDomainAssociationRequest$enableAutoSubDomain' => '<p> Enables the automated creation of subdomains for branches. </p>', ], ], 'EnableBasicAuth' => [ 'base' => NULL, 'refs' => [ 'App$enableBasicAuth' => '<p> Enables basic authorization for the Amplify app\\'s branches. </p>', 'AutoBranchCreationConfig$enableBasicAuth' => '<p> Enables basic authorization for the autocreated branch. </p>', 'Branch$enableBasicAuth' => '<p> Enables basic authorization for a branch of an Amplify app. </p>', 'CreateAppRequest$enableBasicAuth' => '<p> Enables basic authorization for an Amplify app. This will apply to all branches that are part of this app. </p>', 'CreateBranchRequest$enableBasicAuth' => '<p> Enables basic authorization for the branch. </p>', 'UpdateAppRequest$enableBasicAuth' => '<p> Enables basic authorization for an Amplify app. </p>', 'UpdateBranchRequest$enableBasicAuth' => '<p> Enables basic authorization for the branch. </p>', ], ], 'EnableBranchAutoBuild' => [ 'base' => NULL, 'refs' => [ 'App$enableBranchAutoBuild' => '<p> Enables the auto-building of branches for the Amplify app. </p>', 'CreateAppRequest$enableBranchAutoBuild' => '<p> Enables the auto building of branches for an Amplify app. </p>', ], ], 'EnableBranchAutoDeletion' => [ 'base' => NULL, 'refs' => [ 'App$enableBranchAutoDeletion' => '<p> Automatically disconnect a branch in the Amplify Console when you delete a branch from your Git repository. </p>', 'CreateAppRequest$enableBranchAutoDeletion' => '<p> Automatically disconnects a branch in the Amplify Console when you delete a branch from your Git repository. </p>', 'UpdateAppRequest$enableBranchAutoDeletion' => '<p> Automatically disconnects a branch in the Amplify Console when you delete a branch from your Git repository. </p>', ], ], 'EnableNotification' => [ 'base' => NULL, 'refs' => [ 'Branch$enableNotification' => '<p> Enables notifications for a branch that is part of an Amplify app. </p>', 'CreateBranchRequest$enableNotification' => '<p> Enables notifications for the branch. </p>', 'UpdateBranchRequest$enableNotification' => '<p> Enables notifications for the branch. </p>', ], ], 'EnablePerformanceMode' => [ 'base' => NULL, 'refs' => [ 'AutoBranchCreationConfig$enablePerformanceMode' => '<p>Enables performance mode for the branch.</p> <p>Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out. </p>', 'Branch$enablePerformanceMode' => '<p>Enables performance mode for the branch.</p> <p>Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out. </p>', 'CreateBranchRequest$enablePerformanceMode' => '<p>Enables performance mode for the branch.</p> <p>Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out. </p>', 'UpdateBranchRequest$enablePerformanceMode' => '<p>Enables performance mode for the branch.</p> <p>Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out. </p>', ], ], 'EnablePullRequestPreview' => [ 'base' => NULL, 'refs' => [ 'AutoBranchCreationConfig$enablePullRequestPreview' => '<p> Enables pull request previews for the autocreated branch. </p>', 'Branch$enablePullRequestPreview' => '<p> Enables pull request previews for the branch. </p>', 'CreateBranchRequest$enablePullRequestPreview' => '<p> Enables pull request previews for this branch. </p>', 'UpdateBranchRequest$enablePullRequestPreview' => '<p> Enables pull request previews for this branch. </p>', ], ], 'EndTime' => [ 'base' => NULL, 'refs' => [ 'GenerateAccessLogsRequest$endTime' => '<p> The time at which the logs should end. The time range specified is inclusive of the end time. </p>', 'JobSummary$endTime' => '<p> The end date and time for the job. </p>', 'Step$endTime' => '<p> The end date and time of the execution step. </p>', ], ], 'EnvKey' => [ 'base' => NULL, 'refs' => [ 'EnvironmentVariables$key' => NULL, ], ], 'EnvValue' => [ 'base' => NULL, 'refs' => [ 'EnvironmentVariables$value' => NULL, ], ], 'EnvironmentName' => [ 'base' => NULL, 'refs' => [ 'BackendEnvironment$environmentName' => '<p> The name for a backend environment that is part of an Amplify app. </p>', 'CreateBackendEnvironmentRequest$environmentName' => '<p> The name for the backend environment. </p>', 'DeleteBackendEnvironmentRequest$environmentName' => '<p> The name of a backend environment of an Amplify app. </p>', 'GetBackendEnvironmentRequest$environmentName' => '<p> The name for the backend environment. </p>', 'ListBackendEnvironmentsRequest$environmentName' => '<p> The name of the backend environment </p>', ], ], 'EnvironmentVariables' => [ 'base' => NULL, 'refs' => [ 'App$environmentVariables' => '<p> The environment variables for the Amplify app. </p>', 'AutoBranchCreationConfig$environmentVariables' => '<p> The environment variables for the autocreated branch. </p>', 'Branch$environmentVariables' => '<p> The environment variables specific to a branch of an Amplify app. </p>', 'CreateAppRequest$environmentVariables' => '<p> The environment variables map for an Amplify app. </p>', 'CreateBranchRequest$environmentVariables' => '<p> The environment variables for the branch. </p>', 'UpdateAppRequest$environmentVariables' => '<p> The environment variables for an Amplify app. </p>', 'UpdateBranchRequest$environmentVariables' => '<p> The environment variables for the branch. </p>', ], ], 'ErrorMessage' => [ 'base' => NULL, 'refs' => [ 'BadRequestException$message' => NULL, 'DependentServiceFailureException$message' => NULL, 'InternalFailureException$message' => NULL, 'LimitExceededException$message' => NULL, 'NotFoundException$message' => NULL, 'ResourceNotFoundException$message' => NULL, 'UnauthorizedException$message' => NULL, ], ], 'FileMap' => [ 'base' => NULL, 'refs' => [ 'CreateDeploymentRequest$fileMap' => '<p> An optional file map that contains the file name as the key and the file content md5 hash as the value. If this argument is provided, the service will generate a unique upload URL per file. Otherwise, the service will only generate a single upload URL for the zipped files. </p>', ], ], 'FileName' => [ 'base' => NULL, 'refs' => [ 'FileMap$key' => NULL, 'FileUploadUrls$key' => NULL, ], ], 'FileUploadUrls' => [ 'base' => NULL, 'refs' => [ 'CreateDeploymentResult$fileUploadUrls' => '<p> When the <code>fileMap</code> argument is provided in the request, <code>fileUploadUrls</code> will contain a map of file names to upload URLs. </p>', ], ], 'Framework' => [ 'base' => NULL, 'refs' => [ 'AutoBranchCreationConfig$framework' => '<p> The framework for the autocreated branch. </p>', 'Branch$framework' => '<p> The framework for a branch of an Amplify app. </p>', 'CreateBranchRequest$framework' => '<p> The framework for the branch. </p>', 'UpdateBranchRequest$framework' => '<p> The framework for the branch. </p>', ], ], 'GenerateAccessLogsRequest' => [ 'base' => '<p> The request structure for the generate access logs request. </p>', 'refs' => [], ], 'GenerateAccessLogsResult' => [ 'base' => '<p> The result structure for the generate access logs request. </p>', 'refs' => [], ], 'GetAppRequest' => [ 'base' => '<p> The request structure for the get app request. </p>', 'refs' => [], ], 'GetAppResult' => [ 'base' => NULL, 'refs' => [], ], 'GetArtifactUrlRequest' => [ 'base' => '<p> Returns the request structure for the get artifact request. </p>', 'refs' => [], ], 'GetArtifactUrlResult' => [ 'base' => '<p> Returns the result structure for the get artifact request. </p>', 'refs' => [], ], 'GetBackendEnvironmentRequest' => [ 'base' => '<p> The request structure for the get backend environment request. </p>', 'refs' => [], ], 'GetBackendEnvironmentResult' => [ 'base' => '<p> The result structure for the get backend environment result. </p>', 'refs' => [], ], 'GetBranchRequest' => [ 'base' => '<p> The request structure for the get branch request. </p>', 'refs' => [], ], 'GetBranchResult' => [ 'base' => NULL, 'refs' => [], ], 'GetDomainAssociationRequest' => [ 'base' => '<p> The request structure for the get domain association request. </p>', 'refs' => [], ], 'GetDomainAssociationResult' => [ 'base' => '<p> The result structure for the get domain association request. </p>', 'refs' => [], ], 'GetJobRequest' => [ 'base' => '<p> The request structure for the get job request. </p>', 'refs' => [], ], 'GetJobResult' => [ 'base' => NULL, 'refs' => [], ], 'GetWebhookRequest' => [ 'base' => '<p> The request structure for the get webhook request. </p>', 'refs' => [], ], 'GetWebhookResult' => [ 'base' => '<p> The result structure for the get webhook request. </p>', 'refs' => [], ], 'InternalFailureException' => [ 'base' => '<p> The service failed to perform an operation due to an internal issue. </p>', 'refs' => [], ], 'Job' => [ 'base' => '<p> Describes an execution job for an Amplify app. </p>', 'refs' => [ 'GetJobResult$job' => NULL, ], ], 'JobArn' => [ 'base' => NULL, 'refs' => [ 'JobSummary$jobArn' => '<p> The Amazon Resource Name (ARN) for the job. </p>', ], ], 'JobId' => [ 'base' => NULL, 'refs' => [ 'CreateDeploymentResult$jobId' => '<p> The job ID for this deployment. will supply to start deployment api. </p>', 'DeleteJobRequest$jobId' => '<p> The unique ID for the job. </p>', 'GetJobRequest$jobId' => '<p> The unique ID for the job. </p>', 'JobSummary$jobId' => '<p> The unique ID for the job. </p>', 'ListArtifactsRequest$jobId' => '<p> The unique ID for a job. </p>', 'StartDeploymentRequest$jobId' => '<p> The job ID for this deployment, generated by the create deployment request. </p>', 'StartJobRequest$jobId' => '<p> The unique ID for an existing job. This is required if the value of <code>jobType</code> is <code>RETRY</code>. </p>', 'StopJobRequest$jobId' => '<p> The unique id for the job. </p>', ], ], 'JobReason' => [ 'base' => NULL, 'refs' => [ 'StartJobRequest$jobReason' => '<p> A descriptive reason for starting this job. </p>', ], ], 'JobStatus' => [ 'base' => NULL, 'refs' => [ 'JobSummary$status' => '<p> The current status for the job. </p>', 'Step$status' => '<p> The status of the execution step. </p>', ], ], 'JobSummaries' => [ 'base' => NULL, 'refs' => [ 'ListJobsResult$jobSummaries' => '<p> The result structure for the list job result request. </p>', ], ], 'JobSummary' => [ 'base' => '<p> Describes the summary for an execution job for an Amplify app. </p>', 'refs' => [ 'DeleteJobResult$jobSummary' => NULL, 'Job$summary' => '<p> Describes the summary for an execution job for an Amplify app. </p>', 'JobSummaries$member' => NULL, 'StartDeploymentResult$jobSummary' => '<p> The summary for the job. </p>', 'StartJobResult$jobSummary' => '<p> The summary for the job. </p>', 'StopJobResult$jobSummary' => '<p> The summary for the job. </p>', ], ], 'JobType' => [ 'base' => NULL, 'refs' => [ 'JobSummary$jobType' => '<p> The type for the job. If the value is <code>RELEASE</code>, the job was manually released from its source by using the <code>StartJob</code> API. If the value is <code>RETRY</code>, the job was manually retried using the <code>StartJob</code> API. If the value is <code>WEB_HOOK</code>, the job was automatically triggered by webhooks. </p>', 'StartJobRequest$jobType' => '<p> Describes the type for the job. The job type <code>RELEASE</code> starts a new job with the latest change from the specified branch. This value is available only for apps that are connected to a repository. The job type <code>RETRY</code> retries an existing job. If the job type value is <code>RETRY</code>, the <code>jobId</code> is also required. </p>', ], ], 'LastDeployTime' => [ 'base' => NULL, 'refs' => [ 'ProductionBranch$lastDeployTime' => '<p> The last deploy time of the production branch. </p>', ], ], 'LimitExceededException' => [ 'base' => '<p> A resource could not be created because service quotas were exceeded. </p>', 'refs' => [], ], 'ListAppsRequest' => [ 'base' => '<p> The request structure for the list apps request. </p>', 'refs' => [], ], 'ListAppsResult' => [ 'base' => '<p> The result structure for an Amplify app list request. </p>', 'refs' => [], ], 'ListArtifactsRequest' => [ 'base' => '<p> Describes the request structure for the list artifacts request. </p>', 'refs' => [], ], 'ListArtifactsResult' => [ 'base' => '<p> The result structure for the list artifacts request. </p>', 'refs' => [], ], 'ListBackendEnvironmentsRequest' => [ 'base' => '<p> The request structure for the list backend environments request. </p>', 'refs' => [], ], 'ListBackendEnvironmentsResult' => [ 'base' => '<p> The result structure for the list backend environments result. </p>', 'refs' => [], ], 'ListBranchesRequest' => [ 'base' => '<p> The request structure for the list branches request. </p>', 'refs' => [], ], 'ListBranchesResult' => [ 'base' => '<p> The result structure for the list branches request. </p>', 'refs' => [], ], 'ListDomainAssociationsRequest' => [ 'base' => '<p> The request structure for the list domain associations request. </p>', 'refs' => [], ], 'ListDomainAssociationsResult' => [ 'base' => '<p> The result structure for the list domain association request. </p>', 'refs' => [], ], 'ListJobsRequest' => [ 'base' => '<p> The request structure for the list jobs request. </p>', 'refs' => [], ], 'ListJobsResult' => [ 'base' => '<p> The maximum number of records to list in a single response. </p>', 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => '<p> The request structure to use to list tags for a resource. </p>', 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => '<p> The response for the list tags for resource request. </p>', 'refs' => [], ], 'ListWebhooksRequest' => [ 'base' => '<p> The request structure for the list webhooks request. </p>', 'refs' => [], ], 'ListWebhooksResult' => [ 'base' => '<p> The result structure for the list webhooks request. </p>', 'refs' => [], ], 'LogUrl' => [ 'base' => NULL, 'refs' => [ 'GenerateAccessLogsResult$logUrl' => '<p> The pre-signed URL for the requested access logs. </p>', 'Step$logUrl' => '<p> The URL to the logs for the execution step. </p>', ], ], 'MD5Hash' => [ 'base' => NULL, 'refs' => [ 'FileMap$value' => NULL, ], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'ListAppsRequest$maxResults' => '<p> The maximum number of records to list in a single response. </p>', 'ListArtifactsRequest$maxResults' => '<p> The maximum number of records to list in a single response. </p>', 'ListBackendEnvironmentsRequest$maxResults' => '<p> The maximum number of records to list in a single response. </p>', 'ListBranchesRequest$maxResults' => '<p> The maximum number of records to list in a single response. </p>', 'ListDomainAssociationsRequest$maxResults' => '<p> The maximum number of records to list in a single response. </p>', 'ListJobsRequest$maxResults' => '<p> The maximum number of records to list in a single response. </p>', 'ListWebhooksRequest$maxResults' => '<p> The maximum number of records to list in a single response. </p>', ], ], 'Name' => [ 'base' => NULL, 'refs' => [ 'App$name' => '<p> The name for the Amplify app. </p>', 'CreateAppRequest$name' => '<p> The name for an Amplify app. </p>', 'UpdateAppRequest$name' => '<p> The name for an Amplify app. </p>', ], ], 'NextToken' => [ 'base' => NULL, 'refs' => [ 'ListAppsRequest$nextToken' => '<p> A pagination token. If non-null, the pagination token is returned in a result. Pass its value in another request to retrieve more entries. </p>', 'ListAppsResult$nextToken' => '<p> A pagination token. Set to null to start listing apps from start. If non-null, the pagination token is returned in a result. Pass its value in here to list more projects. </p>', 'ListArtifactsRequest$nextToken' => '<p> A pagination token. Set to null to start listing artifacts from start. If a non-null pagination token is returned in a result, pass its value in here to list more artifacts. </p>', 'ListArtifactsResult$nextToken' => '<p> A pagination token. If a non-null pagination token is returned in a result, pass its value in another request to retrieve more entries. </p>', 'ListBackendEnvironmentsRequest$nextToken' => '<p> A pagination token. Set to null to start listing backend environments from the start. If a non-null pagination token is returned in a result, pass its value in here to list more backend environments. </p>', 'ListBackendEnvironmentsResult$nextToken' => '<p> A pagination token. If a non-null pagination token is returned in a result, pass its value in another request to retrieve more entries. </p>', 'ListBranchesRequest$nextToken' => '<p> A pagination token. Set to null to start listing branches from the start. If a non-null pagination token is returned in a result, pass its value in here to list more branches. </p>', 'ListBranchesResult$nextToken' => '<p> A pagination token. If a non-null pagination token is returned in a result, pass its value in another request to retrieve more entries. </p>', 'ListDomainAssociationsRequest$nextToken' => '<p> A pagination token. Set to null to start listing apps from the start. If non-null, a pagination token is returned in a result. Pass its value in here to list more projects. </p>', 'ListDomainAssociationsResult$nextToken' => '<p> A pagination token. If non-null, a pagination token is returned in a result. Pass its value in another request to retrieve more entries. </p>', 'ListJobsRequest$nextToken' => '<p> A pagination token. Set to null to start listing steps from the start. If a non-null pagination token is returned in a result, pass its value in here to list more steps. </p>', 'ListJobsResult$nextToken' => '<p> A pagination token. If non-null the pagination token is returned in a result. Pass its value in another request to retrieve more entries. </p>', 'ListWebhooksRequest$nextToken' => '<p> A pagination token. Set to null to start listing webhooks from the start. If non-null,the pagination token is returned in a result. Pass its value in here to list more webhooks. </p>', 'ListWebhooksResult$nextToken' => '<p> A pagination token. If non-null, the pagination token is returned in a result. Pass its value in another request to retrieve more entries. </p>', ], ], 'NotFoundException' => [ 'base' => '<p> An entity was not found during an operation. </p>', 'refs' => [], ], 'OauthToken' => [ 'base' => NULL, 'refs' => [ 'CreateAppRequest$oauthToken' => '<p>The OAuth token for a third-party source control system for an Amplify app. The OAuth token is used to create a webhook and a read-only deploy key using SSH cloning. The OAuth token is not stored.</p> <p>Use <code>oauthToken</code> for repository providers other than GitHub, such as Bitbucket or CodeCommit. To authorize access to GitHub as your repository provider, use <code>accessToken</code>.</p> <p>You must specify either <code>oauthToken</code> or <code>accessToken</code> when you create a new app.</p> <p>Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see <a href=\"https://docs.aws.amazon.com/amplify/latest/UserGuide/setting-up-GitHub-access.html#migrating-to-github-app-auth\">Migrating an existing OAuth app to the Amplify GitHub App</a> in the <i>Amplify User Guide</i> .</p>', 'UpdateAppRequest$oauthToken' => '<p>The OAuth token for a third-party source control system for an Amplify app. The OAuth token is used to create a webhook and a read-only deploy key using SSH cloning. The OAuth token is not stored.</p> <p>Use <code>oauthToken</code> for repository providers other than GitHub, such as Bitbucket or CodeCommit.</p> <p>To authorize access to GitHub as your repository provider, use <code>accessToken</code>.</p> <p>You must specify either <code>oauthToken</code> or <code>accessToken</code> when you update an app.</p> <p>Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see <a href=\"https://docs.aws.amazon.com/amplify/latest/UserGuide/setting-up-GitHub-access.html#migrating-to-github-app-auth\">Migrating an existing OAuth app to the Amplify GitHub App</a> in the <i>Amplify User Guide</i> .</p>', ], ], 'Platform' => [ 'base' => NULL, 'refs' => [ 'App$platform' => '<p> The platform for the Amplify app. For a static app, set the platform type to <code>WEB</code>. For a dynamic server-side rendered (SSR) app, set the platform type to <code>WEB_COMPUTE</code>. For an app requiring Amplify Hosting\\'s original SSR support only, set the platform type to <code>WEB_DYNAMIC</code>.</p>', 'CreateAppRequest$platform' => '<p> The platform for the Amplify app. For a static app, set the platform type to <code>WEB</code>. For a dynamic server-side rendered (SSR) app, set the platform type to <code>WEB_COMPUTE</code>. For an app requiring Amplify Hosting\\'s original SSR support only, set the platform type to <code>WEB_DYNAMIC</code>.</p>', 'UpdateAppRequest$platform' => '<p> The platform for the Amplify app. For a static app, set the platform type to <code>WEB</code>. For a dynamic server-side rendered (SSR) app, set the platform type to <code>WEB_COMPUTE</code>. For an app requiring Amplify Hosting\\'s original SSR support only, set the platform type to <code>WEB_DYNAMIC</code>.</p>', ], ], 'ProductionBranch' => [ 'base' => '<p> Describes the information about a production branch for an Amplify app. </p>', 'refs' => [ 'App$productionBranch' => '<p> Describes the information about a production branch of the Amplify app. </p>', ], ], 'PullRequestEnvironmentName' => [ 'base' => NULL, 'refs' => [ 'AutoBranchCreationConfig$pullRequestEnvironmentName' => '<p> The Amplify environment name for the pull request. </p>', 'Branch$pullRequestEnvironmentName' => '<p> The Amplify environment name for the pull request. </p>', 'CreateBranchRequest$pullRequestEnvironmentName' => '<p> The Amplify environment name for the pull request. </p>', 'UpdateBranchRequest$pullRequestEnvironmentName' => '<p> The Amplify environment name for the pull request. </p>', ], ], 'Repository' => [ 'base' => NULL, 'refs' => [ 'App$repository' => '<p> The Git repository for the Amplify app. </p>', 'CreateAppRequest$repository' => '<p> The repository for an Amplify app. </p>', 'UpdateAppRequest$repository' => '<p> The name of the repository for an Amplify app </p>', ], ], 'RepositoryCloneMethod' => [ 'base' => NULL, 'refs' => [ 'App$repositoryCloneMethod' => '<note> <p>This is for internal use.</p> </note> <p>The Amplify service uses this parameter to specify the authentication protocol to use to access the Git repository for an Amplify app. Amplify specifies <code>TOKEN</code> for a GitHub repository, <code>SIGV4</code> for an Amazon Web Services CodeCommit repository, and <code>SSH</code> for GitLab and Bitbucket repositories.</p>', ], ], 'ResourceArn' => [ 'base' => NULL, 'refs' => [ 'ListTagsForResourceRequest$resourceArn' => '<p> The Amazon Resource Name (ARN) to use to list tags. </p>', 'TagResourceRequest$resourceArn' => '<p> The Amazon Resource Name (ARN) to use to tag a resource. </p>', 'UntagResourceRequest$resourceArn' => '<p> The Amazon Resource Name (ARN) to use to untag a resource. </p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p> An operation failed due to a non-existent resource. </p>', 'refs' => [], ], 'Screenshots' => [ 'base' => NULL, 'refs' => [ 'Step$screenshots' => '<p> The list of screenshot URLs for the execution step, if relevant. </p>', ], ], 'ServiceRoleArn' => [ 'base' => NULL, 'refs' => [ 'App$iamServiceRoleArn' => '<p> The AWS Identity and Access Management (IAM) service role for the Amazon Resource Name (ARN) of the Amplify app. </p>', 'CreateAppRequest$iamServiceRoleArn' => '<p> The AWS Identity and Access Management (IAM) service role for an Amplify app. </p>', 'UpdateAppRequest$iamServiceRoleArn' => '<p> The AWS Identity and Access Management (IAM) service role for an Amplify app. </p>', ], ], 'Source' => [ 'base' => NULL, 'refs' => [ 'CustomRule$source' => '<p> The source pattern for a URL rewrite or redirect rule. </p>', ], ], 'SourceUrl' => [ 'base' => NULL, 'refs' => [ 'StartDeploymentRequest$sourceUrl' => '<p> The source URL for this deployment, used when calling start deployment without create deployment. The source URL can be any HTTP GET URL that is publicly accessible and downloads a single .zip file. </p>', ], ], 'StackName' => [ 'base' => NULL, 'refs' => [ 'BackendEnvironment$stackName' => '<p> The AWS CloudFormation stack name of a backend environment. </p>', 'CreateBackendEnvironmentRequest$stackName' => '<p> The AWS CloudFormation stack name of a backend environment. </p>', ], ], 'Stage' => [ 'base' => NULL, 'refs' => [ 'AutoBranchCreationConfig$stage' => '<p> Describes the current stage for the autocreated branch. </p>', 'Branch$stage' => '<p> The current stage for the branch that is part of an Amplify app. </p>', 'CreateBranchRequest$stage' => '<p> Describes the current stage for the branch. </p>', 'UpdateBranchRequest$stage' => '<p> Describes the current stage for the branch. </p>', ], ], 'StartDeploymentRequest' => [ 'base' => '<p> The request structure for the start a deployment request. </p>', 'refs' => [], ], 'StartDeploymentResult' => [ 'base' => '<p> The result structure for the start a deployment request. </p>', 'refs' => [], ], 'StartJobRequest' => [ 'base' => '<p> The request structure for the start job request. </p>', 'refs' => [], ], 'StartJobResult' => [ 'base' => '<p> The result structure for the run job request. </p>', 'refs' => [], ], 'StartTime' => [ 'base' => NULL, 'refs' => [ 'GenerateAccessLogsRequest$startTime' => '<p> The time at which the logs should start. The time range specified is inclusive of the start time. </p>', 'JobSummary$startTime' => '<p> The start date and time for the job. </p>', 'Step$startTime' => '<p> The start date and time of the execution step. </p>', ], ], 'Status' => [ 'base' => NULL, 'refs' => [ 'CustomRule$status' => '<p> The status code for a URL rewrite or redirect rule. </p> <dl> <dt>200</dt> <dd> <p>Represents a 200 rewrite rule.</p> </dd> <dt>301</dt> <dd> <p>Represents a 301 (moved pemanently) redirect rule. This and all future requests should be directed to the target URL. </p> </dd> <dt>302</dt> <dd> <p>Represents a 302 temporary redirect rule.</p> </dd> <dt>404</dt> <dd> <p>Represents a 404 redirect rule.</p> </dd> <dt>404-200</dt> <dd> <p>Represents a 404 rewrite rule.</p> </dd> </dl>', 'ProductionBranch$status' => '<p> The status of the production branch. </p>', ], ], 'StatusReason' => [ 'base' => NULL, 'refs' => [ 'DomainAssociation$statusReason' => '<p> The reason for the current status of the domain association. </p>', 'Step$statusReason' => '<p> The reason for the current step status. </p>', ], ], 'Step' => [ 'base' => '<p> Describes an execution step, for an execution job, for an Amplify app. </p>', 'refs' => [ 'Steps$member' => NULL, ], ], 'StepName' => [ 'base' => NULL, 'refs' => [ 'Step$stepName' => '<p> The name of the execution step. </p>', ], ], 'Steps' => [ 'base' => NULL, 'refs' => [ 'Job$steps' => '<p> The execution steps for an execution job, for an Amplify app. </p>', ], ], 'StopJobRequest' => [ 'base' => '<p> The request structure for the stop job request. </p>', 'refs' => [], ], 'StopJobResult' => [ 'base' => '<p> The result structure for the stop job request. </p>', 'refs' => [], ], 'SubDomain' => [ 'base' => '<p> The subdomain for the domain association. </p>', 'refs' => [ 'SubDomains$member' => NULL, ], ], 'SubDomainSetting' => [ 'base' => '<p> Describes the settings for the subdomain. </p>', 'refs' => [ 'SubDomain$subDomainSetting' => '<p> Describes the settings for the subdomain. </p>', 'SubDomainSettings$member' => NULL, ], ], 'SubDomainSettings' => [ 'base' => NULL, 'refs' => [ 'CreateDomainAssociationRequest$subDomainSettings' => '<p> The setting for the subdomain. </p>', 'UpdateDomainAssociationRequest$subDomainSettings' => '<p> Describes the settings for the subdomain. </p>', ], ], 'SubDomains' => [ 'base' => NULL, 'refs' => [ 'DomainAssociation$subDomains' => '<p> The subdomains for the domain association. </p>', ], ], 'TTL' => [ 'base' => '<p> The content Time to Live (TTL) for the website in seconds. </p>', 'refs' => [ 'Branch$ttl' => '<p> The content Time to Live (TTL) for the website in seconds. </p>', 'CreateBranchRequest$ttl' => '<p> The content Time To Live (TTL) for the website in seconds. </p>', 'UpdateBranchRequest$ttl' => '<p> The content Time to Live (TTL) for the website in seconds. </p>', ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'TagKeyList$member' => NULL, 'TagMap$key' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$tagKeys' => '<p> The tag keys to use to untag a resource. </p>', ], ], 'TagMap' => [ 'base' => NULL, 'refs' => [ 'App$tags' => '<p> The tag for the Amplify app. </p>', 'Branch$tags' => '<p> The tag for the branch of an Amplify app. </p>', 'CreateAppRequest$tags' => '<p> The tag for an Amplify app. </p>', 'CreateBranchRequest$tags' => '<p> The tag for the branch. </p>', 'ListTagsForResourceResponse$tags' => '<p> A list of tags for the specified The Amazon Resource Name (ARN). </p>', 'TagResourceRequest$tags' => '<p> The tags used to tag the resource. </p>', ], ], 'TagResourceRequest' => [ 'base' => '<p> The request structure to tag a resource with a tag key and value. </p>', 'refs' => [], ], 'TagResourceResponse' => [ 'base' => '<p> The response for the tag resource request. </p>', 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'TagMap$value' => NULL, ], ], 'Target' => [ 'base' => NULL, 'refs' => [ 'CustomRule$target' => '<p> The target pattern for a URL rewrite or redirect rule. </p>', ], ], 'TestArtifactsUrl' => [ 'base' => NULL, 'refs' => [ 'Step$testArtifactsUrl' => '<p> The URL to the test artifact for the execution step. </p>', ], ], 'TestConfigUrl' => [ 'base' => NULL, 'refs' => [ 'Step$testConfigUrl' => '<p> The URL to the test configuration for the execution step. </p>', ], ], 'ThumbnailName' => [ 'base' => NULL, 'refs' => [ 'Screenshots$key' => NULL, ], ], 'ThumbnailUrl' => [ 'base' => NULL, 'refs' => [ 'Branch$thumbnailUrl' => '<p> The thumbnail URL for the branch of an Amplify app. </p>', 'ProductionBranch$thumbnailUrl' => '<p> The thumbnail URL for the production branch. </p>', 'Screenshots$value' => NULL, ], ], 'TotalNumberOfJobs' => [ 'base' => NULL, 'refs' => [ 'Branch$totalNumberOfJobs' => '<p> The total number of jobs that are part of an Amplify app. </p>', ], ], 'UnauthorizedException' => [ 'base' => '<p> An operation failed due to a lack of access. </p>', 'refs' => [], ], 'UntagResourceRequest' => [ 'base' => '<p> The request structure for the untag resource request. </p>', 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => '<p> The response for the untag resource request. </p>', 'refs' => [], ], 'UpdateAppRequest' => [ 'base' => '<p> The request structure for the update app request. </p>', 'refs' => [], ], 'UpdateAppResult' => [ 'base' => '<p> The result structure for an Amplify app update request. </p>', 'refs' => [], ], 'UpdateBranchRequest' => [ 'base' => '<p> The request structure for the update branch request. </p>', 'refs' => [], ], 'UpdateBranchResult' => [ 'base' => '<p> The result structure for the update branch request. </p>', 'refs' => [], ], 'UpdateDomainAssociationRequest' => [ 'base' => '<p> The request structure for the update domain association request. </p>', 'refs' => [], ], 'UpdateDomainAssociationResult' => [ 'base' => '<p> The result structure for the update domain association request. </p>', 'refs' => [], ], 'UpdateTime' => [ 'base' => NULL, 'refs' => [ 'App$updateTime' => '<p> Updates the date and time for the Amplify app. </p>', 'BackendEnvironment$updateTime' => '<p> The last updated date and time for a backend environment that is part of an Amplify app. </p>', 'Branch$updateTime' => '<p> The last updated date and time for a branch that is part of an Amplify app. </p>', 'Webhook$updateTime' => '<p> Updates the date and time for a webhook. </p>', ], ], 'UpdateWebhookRequest' => [ 'base' => '<p> The request structure for the update webhook request. </p>', 'refs' => [], ], 'UpdateWebhookResult' => [ 'base' => '<p> The result structure for the update webhook request. </p>', 'refs' => [], ], 'UploadUrl' => [ 'base' => NULL, 'refs' => [ 'CreateDeploymentResult$zipUploadUrl' => '<p> When the <code>fileMap</code> argument is not provided in the request, this <code>zipUploadUrl</code> is returned. </p>', 'FileUploadUrls$value' => NULL, ], ], 'Verified' => [ 'base' => NULL, 'refs' => [ 'SubDomain$verified' => '<p> The verified status of the subdomain </p>', ], ], 'Webhook' => [ 'base' => '<p> Describes a webhook that connects repository events to an Amplify app. </p>', 'refs' => [ 'CreateWebhookResult$webhook' => '<p> Describes a webhook that connects repository events to an Amplify app. </p>', 'DeleteWebhookResult$webhook' => '<p> Describes a webhook that connects repository events to an Amplify app. </p>', 'GetWebhookResult$webhook' => '<p> Describes the structure of a webhook. </p>', 'UpdateWebhookResult$webhook' => '<p> Describes a webhook that connects repository events to an Amplify app. </p>', 'Webhooks$member' => NULL, ], ], 'WebhookArn' => [ 'base' => NULL, 'refs' => [ 'Webhook$webhookArn' => '<p> The Amazon Resource Name (ARN) for the webhook. </p>', ], ], 'WebhookId' => [ 'base' => NULL, 'refs' => [ 'DeleteWebhookRequest$webhookId' => '<p> The unique ID for a webhook. </p>', 'GetWebhookRequest$webhookId' => '<p> The unique ID for a webhook. </p>', 'UpdateWebhookRequest$webhookId' => '<p> The unique ID for a webhook. </p>', 'Webhook$webhookId' => '<p> The ID of the webhook. </p>', ], ], 'WebhookUrl' => [ 'base' => NULL, 'refs' => [ 'Webhook$webhookUrl' => '<p> The URL of the webhook. </p>', ], ], 'Webhooks' => [ 'base' => NULL, 'refs' => [ 'ListWebhooksResult$webhooks' => '<p> A list of webhooks. </p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplify/2017-07-25/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], [ 'fn' => 'parseURL', 'argv' => [ [ 'ref' => 'Endpoint', ], ], 'assign' => 'url', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://amplify-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://amplify-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://amplify.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://amplify.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplify/2017-07-25/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.ap-south-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'ap-south-1', ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.ap-south-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'ap-south-1', ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.ap-south-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'ap-south-1', ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.ap-south-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'ap-south-1', ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.eu-south-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'eu-south-1', ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.eu-south-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'eu-south-1', ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.eu-south-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'eu-south-1', ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.eu-south-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'eu-south-1', ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.ca-central-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'ca-central-1', ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.ca-central-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'ca-central-1', ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.ca-central-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'ca-central-1', ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.ca-central-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'ca-central-1', ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.eu-central-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'eu-central-1', ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.eu-central-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'eu-central-1', ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.eu-central-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'eu-central-1', ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.eu-central-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'eu-central-1', ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.us-west-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'us-west-1', ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'us-west-1', ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.us-west-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'us-west-1', ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.us-west-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-west-1', ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.us-west-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'us-west-2', ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'us-west-2', ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.us-west-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'us-west-2', ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-west-2', ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.eu-north-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'eu-north-1', ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.eu-north-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'eu-north-1', ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.eu-north-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'eu-north-1', ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.eu-north-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'eu-north-1', ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.eu-west-3.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'eu-west-3', ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.eu-west-3.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'eu-west-3', ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.eu-west-3.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'eu-west-3', ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.eu-west-3.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'eu-west-3', ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.eu-west-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'eu-west-2', ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.eu-west-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'eu-west-2', ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.eu-west-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'eu-west-2', ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.eu-west-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'eu-west-2', ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.eu-west-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'eu-west-1', ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.eu-west-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'eu-west-1', ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.eu-west-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'eu-west-1', ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.eu-west-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'eu-west-1', ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.ap-northeast-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'ap-northeast-2', ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'ap-northeast-2', ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.ap-northeast-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'ap-northeast-2', ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'ap-northeast-2', ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.ap-northeast-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'ap-northeast-1', ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'ap-northeast-1', ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.ap-northeast-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'ap-northeast-1', ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'ap-northeast-1', ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.me-south-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'me-south-1', ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.me-south-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'me-south-1', ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.me-south-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'me-south-1', ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.me-south-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'me-south-1', ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.sa-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'sa-east-1', ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.sa-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'sa-east-1', ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.sa-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'sa-east-1', ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.sa-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'sa-east-1', ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.ap-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'ap-east-1', ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.ap-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'ap-east-1', ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.ap-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'ap-east-1', ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.ap-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'ap-east-1', ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.ap-southeast-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'ap-southeast-1', ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'ap-southeast-1', ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.ap-southeast-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'ap-southeast-1', ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'ap-southeast-1', ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.ap-southeast-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'ap-southeast-2', ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'ap-southeast-2', ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.ap-southeast-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'ap-southeast-2', ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'ap-southeast-2', ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.us-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.us-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.us-east-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'us-east-2', ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'us-east-2', ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.us-east-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'us-east-2', ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplify.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-east-2', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplify/2017-07-25/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplify/2017-07-25/paginators-1.json\nreturn [ 'pagination' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplifybackend/2020-08-11/api-2.json\nreturn [ 'metadata' => [ 'apiVersion' => '2020-08-11', 'endpointPrefix' => 'amplifybackend', 'signingName' => 'amplifybackend', 'serviceFullName' => 'AmplifyBackend', 'serviceId' => 'AmplifyBackend', 'protocol' => 'rest-json', 'jsonVersion' => '1.1', 'uid' => 'amplifybackend-2020-08-11', 'signatureVersion' => 'v4', ], 'operations' => [ 'CloneBackend' => [ 'name' => 'CloneBackend', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/environments/{backendEnvironmentName}/clone', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CloneBackendRequest', ], 'output' => [ 'shape' => 'CloneBackendResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'CreateBackend' => [ 'name' => 'CreateBackend', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateBackendRequest', ], 'output' => [ 'shape' => 'CreateBackendResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'CreateBackendAPI' => [ 'name' => 'CreateBackendAPI', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/api', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateBackendAPIRequest', ], 'output' => [ 'shape' => 'CreateBackendAPIResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'CreateBackendAuth' => [ 'name' => 'CreateBackendAuth', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/auth', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateBackendAuthRequest', ], 'output' => [ 'shape' => 'CreateBackendAuthResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'CreateBackendConfig' => [ 'name' => 'CreateBackendConfig', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/config', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateBackendConfigRequest', ], 'output' => [ 'shape' => 'CreateBackendConfigResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'CreateBackendStorage' => [ 'name' => 'CreateBackendStorage', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/storage', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateBackendStorageRequest', ], 'output' => [ 'shape' => 'CreateBackendStorageResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'CreateToken' => [ 'name' => 'CreateToken', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/challenge', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateTokenRequest', ], 'output' => [ 'shape' => 'CreateTokenResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'DeleteBackend' => [ 'name' => 'DeleteBackend', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/environments/{backendEnvironmentName}/remove', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteBackendRequest', ], 'output' => [ 'shape' => 'DeleteBackendResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'DeleteBackendAPI' => [ 'name' => 'DeleteBackendAPI', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/api/{backendEnvironmentName}/remove', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteBackendAPIRequest', ], 'output' => [ 'shape' => 'DeleteBackendAPIResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'DeleteBackendAuth' => [ 'name' => 'DeleteBackendAuth', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/auth/{backendEnvironmentName}/remove', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteBackendAuthRequest', ], 'output' => [ 'shape' => 'DeleteBackendAuthResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'DeleteBackendStorage' => [ 'name' => 'DeleteBackendStorage', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/storage/{backendEnvironmentName}/remove', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteBackendStorageRequest', ], 'output' => [ 'shape' => 'DeleteBackendStorageResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'DeleteToken' => [ 'name' => 'DeleteToken', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/challenge/{sessionId}/remove', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteTokenRequest', ], 'output' => [ 'shape' => 'DeleteTokenResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GenerateBackendAPIModels' => [ 'name' => 'GenerateBackendAPIModels', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/api/{backendEnvironmentName}/generateModels', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GenerateBackendAPIModelsRequest', ], 'output' => [ 'shape' => 'GenerateBackendAPIModelsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetBackend' => [ 'name' => 'GetBackend', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/details', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetBackendRequest', ], 'output' => [ 'shape' => 'GetBackendResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetBackendAPI' => [ 'name' => 'GetBackendAPI', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/api/{backendEnvironmentName}/details', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetBackendAPIRequest', ], 'output' => [ 'shape' => 'GetBackendAPIResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetBackendAPIModels' => [ 'name' => 'GetBackendAPIModels', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/api/{backendEnvironmentName}/getModels', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetBackendAPIModelsRequest', ], 'output' => [ 'shape' => 'GetBackendAPIModelsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetBackendAuth' => [ 'name' => 'GetBackendAuth', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/auth/{backendEnvironmentName}/details', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetBackendAuthRequest', ], 'output' => [ 'shape' => 'GetBackendAuthResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetBackendJob' => [ 'name' => 'GetBackendJob', 'http' => [ 'method' => 'GET', 'requestUri' => '/backend/{appId}/job/{backendEnvironmentName}/{jobId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetBackendJobRequest', ], 'output' => [ 'shape' => 'GetBackendJobResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetBackendStorage' => [ 'name' => 'GetBackendStorage', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/storage/{backendEnvironmentName}/details', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetBackendStorageRequest', ], 'output' => [ 'shape' => 'GetBackendStorageResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetToken' => [ 'name' => 'GetToken', 'http' => [ 'method' => 'GET', 'requestUri' => '/backend/{appId}/challenge/{sessionId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetTokenRequest', ], 'output' => [ 'shape' => 'GetTokenResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'ImportBackendAuth' => [ 'name' => 'ImportBackendAuth', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/auth/{backendEnvironmentName}/import', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ImportBackendAuthRequest', ], 'output' => [ 'shape' => 'ImportBackendAuthResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'ImportBackendStorage' => [ 'name' => 'ImportBackendStorage', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/storage/{backendEnvironmentName}/import', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ImportBackendStorageRequest', ], 'output' => [ 'shape' => 'ImportBackendStorageResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'ListBackendJobs' => [ 'name' => 'ListBackendJobs', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/job/{backendEnvironmentName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListBackendJobsRequest', ], 'output' => [ 'shape' => 'ListBackendJobsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'ListS3Buckets' => [ 'name' => 'ListS3Buckets', 'http' => [ 'method' => 'POST', 'requestUri' => '/s3Buckets', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListS3BucketsRequest', ], 'output' => [ 'shape' => 'ListS3BucketsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'RemoveAllBackends' => [ 'name' => 'RemoveAllBackends', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/remove', 'responseCode' => 200, ], 'input' => [ 'shape' => 'RemoveAllBackendsRequest', ], 'output' => [ 'shape' => 'RemoveAllBackendsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'RemoveBackendConfig' => [ 'name' => 'RemoveBackendConfig', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/config/remove', 'responseCode' => 200, ], 'input' => [ 'shape' => 'RemoveBackendConfigRequest', ], 'output' => [ 'shape' => 'RemoveBackendConfigResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'UpdateBackendAPI' => [ 'name' => 'UpdateBackendAPI', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/api/{backendEnvironmentName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateBackendAPIRequest', ], 'output' => [ 'shape' => 'UpdateBackendAPIResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'UpdateBackendAuth' => [ 'name' => 'UpdateBackendAuth', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/auth/{backendEnvironmentName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateBackendAuthRequest', ], 'output' => [ 'shape' => 'UpdateBackendAuthResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'UpdateBackendConfig' => [ 'name' => 'UpdateBackendConfig', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/config/update', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateBackendConfigRequest', ], 'output' => [ 'shape' => 'UpdateBackendConfigResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'UpdateBackendJob' => [ 'name' => 'UpdateBackendJob', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/job/{backendEnvironmentName}/{jobId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateBackendJobRequest', ], 'output' => [ 'shape' => 'UpdateBackendJobResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'UpdateBackendStorage' => [ 'name' => 'UpdateBackendStorage', 'http' => [ 'method' => 'POST', 'requestUri' => '/backend/{appId}/storage/{backendEnvironmentName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateBackendStorageRequest', ], 'output' => [ 'shape' => 'UpdateBackendStorageResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'GatewayTimeoutException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], ], 'shapes' => [ 'AuthResources' => [ 'type' => 'string', 'enum' => [ 'USER_POOL_ONLY', 'IDENTITY_POOL_AND_USER_POOL', ], ], 'BackendAPIAppSyncAuthSettings' => [ 'type' => 'structure', 'members' => [ 'CognitoUserPoolId' => [ 'shape' => '__string', 'locationName' => 'cognitoUserPoolId', ], 'Description' => [ 'shape' => '__string', 'locationName' => 'description', ], 'ExpirationTime' => [ 'shape' => '__double', 'locationName' => 'expirationTime', ], 'OpenIDAuthTTL' => [ 'shape' => '__string', 'locationName' => 'openIDAuthTTL', ], 'OpenIDClientId' => [ 'shape' => '__string', 'locationName' => 'openIDClientId', ], 'OpenIDIatTTL' => [ 'shape' => '__string', 'locationName' => 'openIDIatTTL', ], 'OpenIDIssueURL' => [ 'shape' => '__string', 'locationName' => 'openIDIssueURL', ], 'OpenIDProviderName' => [ 'shape' => '__string', 'locationName' => 'openIDProviderName', ], ], ], 'BackendAPIAuthType' => [ 'type' => 'structure', 'members' => [ 'Mode' => [ 'shape' => 'Mode', 'locationName' => 'mode', ], 'Settings' => [ 'shape' => 'BackendAPIAppSyncAuthSettings', 'locationName' => 'settings', ], ], ], 'BackendAPICodegenReqObj' => [ 'type' => 'structure', 'members' => [ 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'ResourceName', ], ], 'BackendAPICodegenRespObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', ], ], 'BackendAPIConflictResolution' => [ 'type' => 'structure', 'members' => [ 'ResolutionStrategy' => [ 'shape' => 'ResolutionStrategy', 'locationName' => 'resolutionStrategy', ], ], ], 'BackendAPIReqObj' => [ 'type' => 'structure', 'members' => [ 'ResourceConfig' => [ 'shape' => 'BackendAPIResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'ResourceName', ], ], 'BackendAPIResourceConfig' => [ 'type' => 'structure', 'members' => [ 'AdditionalAuthTypes' => [ 'shape' => 'ListOfBackendAPIAuthType', 'locationName' => 'additionalAuthTypes', ], 'ApiName' => [ 'shape' => '__string', 'locationName' => 'apiName', ], 'ConflictResolution' => [ 'shape' => 'BackendAPIConflictResolution', 'locationName' => 'conflictResolution', ], 'DefaultAuthType' => [ 'shape' => 'BackendAPIAuthType', 'locationName' => 'defaultAuthType', ], 'Service' => [ 'shape' => '__string', 'locationName' => 'service', ], 'TransformSchema' => [ 'shape' => '__string', 'locationName' => 'transformSchema', ], ], ], 'BackendAPIRespObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', ], ], 'BackendAuthAppleProviderConfig' => [ 'type' => 'structure', 'members' => [ 'ClientId' => [ 'shape' => '__string', 'locationName' => 'client_id', ], 'KeyId' => [ 'shape' => '__string', 'locationName' => 'key_id', ], 'PrivateKey' => [ 'shape' => '__string', 'locationName' => 'private_key', ], 'TeamId' => [ 'shape' => '__string', 'locationName' => 'team_id', ], ], ], 'BackendAuthRespObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', ], ], 'BackendAuthSocialProviderConfig' => [ 'type' => 'structure', 'members' => [ 'ClientId' => [ 'shape' => '__string', 'locationName' => 'client_id', ], 'ClientSecret' => [ 'shape' => '__string', 'locationName' => 'client_secret', ], ], ], 'BackendConfigRespObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendManagerAppId' => [ 'shape' => '__string', 'locationName' => 'backendManagerAppId', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'LoginAuthConfig' => [ 'shape' => 'LoginAuthConfigReqObj', 'locationName' => 'loginAuthConfig', ], ], ], 'BackendJobReqObj' => [ 'type' => 'structure', 'members' => [ 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'BackendJobRespObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'CreateTime' => [ 'shape' => '__string', 'locationName' => 'createTime', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], 'UpdateTime' => [ 'shape' => '__string', 'locationName' => 'updateTime', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', ], ], 'BackendStoragePermissions' => [ 'type' => 'structure', 'members' => [ 'Authenticated' => [ 'shape' => 'ListOfAuthenticatedElement', 'locationName' => 'authenticated', ], 'UnAuthenticated' => [ 'shape' => 'ListOfUnAuthenticatedElement', 'locationName' => 'unAuthenticated', ], ], 'required' => [ 'Authenticated', ], ], 'BackendStorageRespObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], 'required' => [ 'Status', 'AppId', 'BackendEnvironmentName', 'JobId', ], ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => '__string', 'locationName' => 'message', ], ], 'exception' => true, 'error' => [ 'httpStatusCode' => 400, ], ], 'CloneBackendReqObj' => [ 'type' => 'structure', 'members' => [ 'TargetEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'targetEnvironmentName', ], ], 'required' => [ 'TargetEnvironmentName', ], ], 'CloneBackendRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'TargetEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'targetEnvironmentName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'TargetEnvironmentName', ], ], 'CloneBackendRespObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', ], ], 'CloneBackendResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'CreateBackendAPIReqObj' => [ 'type' => 'structure', 'members' => [ 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'ResourceConfig' => [ 'shape' => 'BackendAPIResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'ResourceName', 'BackendEnvironmentName', 'ResourceConfig', ], ], 'CreateBackendAPIRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'ResourceConfig' => [ 'shape' => 'BackendAPIResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'ResourceName', 'BackendEnvironmentName', 'ResourceConfig', ], ], 'CreateBackendAPIResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'CreateBackendAuthForgotPasswordConfig' => [ 'type' => 'structure', 'members' => [ 'DeliveryMethod' => [ 'shape' => 'DeliveryMethod', 'locationName' => 'deliveryMethod', ], 'EmailSettings' => [ 'shape' => 'EmailSettings', 'locationName' => 'emailSettings', ], 'SmsSettings' => [ 'shape' => 'SmsSettings', 'locationName' => 'smsSettings', ], ], 'required' => [ 'DeliveryMethod', ], ], 'CreateBackendAuthIdentityPoolConfig' => [ 'type' => 'structure', 'members' => [ 'IdentityPoolName' => [ 'shape' => '__string', 'locationName' => 'identityPoolName', ], 'UnauthenticatedLogin' => [ 'shape' => '__boolean', 'locationName' => 'unauthenticatedLogin', ], ], 'required' => [ 'UnauthenticatedLogin', 'IdentityPoolName', ], ], 'CreateBackendAuthMFAConfig' => [ 'type' => 'structure', 'members' => [ 'MFAMode' => [ 'shape' => 'MFAMode', ], 'Settings' => [ 'shape' => 'Settings', 'locationName' => 'settings', ], ], 'required' => [ 'MFAMode', ], ], 'CreateBackendAuthOAuthConfig' => [ 'type' => 'structure', 'members' => [ 'DomainPrefix' => [ 'shape' => '__string', 'locationName' => 'domainPrefix', ], 'OAuthGrantType' => [ 'shape' => 'OAuthGrantType', 'locationName' => 'oAuthGrantType', ], 'OAuthScopes' => [ 'shape' => 'ListOfOAuthScopesElement', 'locationName' => 'oAuthScopes', ], 'RedirectSignInURIs' => [ 'shape' => 'ListOf__string', 'locationName' => 'redirectSignInURIs', ], 'RedirectSignOutURIs' => [ 'shape' => 'ListOf__string', 'locationName' => 'redirectSignOutURIs', ], 'SocialProviderSettings' => [ 'shape' => 'SocialProviderSettings', 'locationName' => 'socialProviderSettings', ], ], 'required' => [ 'RedirectSignOutURIs', 'RedirectSignInURIs', 'OAuthGrantType', 'OAuthScopes', ], ], 'CreateBackendAuthPasswordPolicyConfig' => [ 'type' => 'structure', 'members' => [ 'AdditionalConstraints' => [ 'shape' => 'ListOfAdditionalConstraintsElement', 'locationName' => 'additionalConstraints', ], 'MinimumLength' => [ 'shape' => '__double', 'locationName' => 'minimumLength', ], ], 'required' => [ 'MinimumLength', ], ], 'CreateBackendAuthReqObj' => [ 'type' => 'structure', 'members' => [ 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'ResourceConfig' => [ 'shape' => 'CreateBackendAuthResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'ResourceName', 'BackendEnvironmentName', 'ResourceConfig', ], ], 'CreateBackendAuthRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'ResourceConfig' => [ 'shape' => 'CreateBackendAuthResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'ResourceName', 'BackendEnvironmentName', 'ResourceConfig', ], ], 'CreateBackendAuthResourceConfig' => [ 'type' => 'structure', 'members' => [ 'AuthResources' => [ 'shape' => 'AuthResources', 'locationName' => 'authResources', ], 'IdentityPoolConfigs' => [ 'shape' => 'CreateBackendAuthIdentityPoolConfig', 'locationName' => 'identityPoolConfigs', ], 'Service' => [ 'shape' => 'Service', 'locationName' => 'service', ], 'UserPoolConfigs' => [ 'shape' => 'CreateBackendAuthUserPoolConfig', 'locationName' => 'userPoolConfigs', ], ], 'required' => [ 'AuthResources', 'UserPoolConfigs', 'Service', ], ], 'CreateBackendAuthResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'CreateBackendAuthUserPoolConfig' => [ 'type' => 'structure', 'members' => [ 'ForgotPassword' => [ 'shape' => 'CreateBackendAuthForgotPasswordConfig', 'locationName' => 'forgotPassword', ], 'Mfa' => [ 'shape' => 'CreateBackendAuthMFAConfig', 'locationName' => 'mfa', ], 'OAuth' => [ 'shape' => 'CreateBackendAuthOAuthConfig', 'locationName' => 'oAuth', ], 'PasswordPolicy' => [ 'shape' => 'CreateBackendAuthPasswordPolicyConfig', 'locationName' => 'passwordPolicy', ], 'RequiredSignUpAttributes' => [ 'shape' => 'ListOfRequiredSignUpAttributesElement', 'locationName' => 'requiredSignUpAttributes', ], 'SignInMethod' => [ 'shape' => 'SignInMethod', 'locationName' => 'signInMethod', ], 'UserPoolName' => [ 'shape' => '__string', 'locationName' => 'userPoolName', ], 'VerificationMessage' => [ 'shape' => 'CreateBackendAuthVerificationMessageConfig', 'locationName' => 'verificationMessage', ], ], 'required' => [ 'RequiredSignUpAttributes', 'SignInMethod', 'UserPoolName', ], ], 'CreateBackendAuthVerificationMessageConfig' => [ 'type' => 'structure', 'members' => [ 'DeliveryMethod' => [ 'shape' => 'DeliveryMethod', 'locationName' => 'deliveryMethod', ], 'EmailSettings' => [ 'shape' => 'EmailSettings', 'locationName' => 'emailSettings', ], 'SmsSettings' => [ 'shape' => 'SmsSettings', 'locationName' => 'smsSettings', ], ], 'required' => [ 'DeliveryMethod', ], ], 'CreateBackendConfigReqObj' => [ 'type' => 'structure', 'members' => [ 'BackendManagerAppId' => [ 'shape' => '__string', 'locationName' => 'backendManagerAppId', ], ], ], 'CreateBackendConfigRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendManagerAppId' => [ 'shape' => '__string', 'locationName' => 'backendManagerAppId', ], ], 'required' => [ 'AppId', ], ], 'CreateBackendConfigRespObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], 'required' => [ 'AppId', ], ], 'CreateBackendConfigResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'CreateBackendReqObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'AppName' => [ 'shape' => '__string', 'locationName' => 'appName', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'ResourceConfig' => [ 'shape' => 'ResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'AppName', ], ], 'CreateBackendRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'AppName' => [ 'shape' => '__string', 'locationName' => 'appName', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'ResourceConfig' => [ 'shape' => 'ResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'AppName', ], ], 'CreateBackendRespObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', ], ], 'CreateBackendResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'CreateBackendStorageReqObj' => [ 'type' => 'structure', 'members' => [ 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'ResourceConfig' => [ 'shape' => 'CreateBackendStorageResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'ResourceName', 'BackendEnvironmentName', 'ResourceConfig', ], ], 'CreateBackendStorageRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'ResourceConfig' => [ 'shape' => 'CreateBackendStorageResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'ResourceName', 'BackendEnvironmentName', 'ResourceConfig', ], ], 'CreateBackendStorageResourceConfig' => [ 'type' => 'structure', 'members' => [ 'BucketName' => [ 'shape' => '__string', 'locationName' => 'bucketName', ], 'Permissions' => [ 'shape' => 'BackendStoragePermissions', 'locationName' => 'permissions', ], 'ServiceName' => [ 'shape' => 'ServiceName', 'locationName' => 'serviceName', ], ], 'required' => [ 'ServiceName', 'Permissions', ], ], 'CreateBackendStorageResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'CreateTokenRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], ], 'required' => [ 'AppId', ], ], 'CreateTokenRespObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'ChallengeCode' => [ 'shape' => '__string', 'locationName' => 'challengeCode', ], 'SessionId' => [ 'shape' => '__string', 'locationName' => 'sessionId', ], 'Ttl' => [ 'shape' => '__string', 'locationName' => 'ttl', ], ], 'required' => [ 'AppId', 'Ttl', 'SessionId', 'ChallengeCode', ], ], 'CreateTokenResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'ChallengeCode' => [ 'shape' => '__string', 'locationName' => 'challengeCode', ], 'SessionId' => [ 'shape' => '__string', 'locationName' => 'sessionId', ], 'Ttl' => [ 'shape' => '__string', 'locationName' => 'ttl', ], ], ], 'DeleteBackendAPIRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'ResourceConfig' => [ 'shape' => 'BackendAPIResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'ResourceName', ], ], 'DeleteBackendAPIResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'DeleteBackendAuthRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'ResourceName', ], ], 'DeleteBackendAuthResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'DeleteBackendRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', ], ], 'DeleteBackendRespObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', ], ], 'DeleteBackendResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'DeleteBackendStorageRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], 'ServiceName' => [ 'shape' => 'ServiceName', 'locationName' => 'serviceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'ServiceName', 'ResourceName', ], ], 'DeleteBackendStorageResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'DeleteTokenRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'SessionId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'sessionId', ], ], 'required' => [ 'SessionId', 'AppId', ], ], 'DeleteTokenRespObj' => [ 'type' => 'structure', 'members' => [ 'IsSuccess' => [ 'shape' => '__boolean', 'locationName' => 'isSuccess', ], ], 'required' => [ 'IsSuccess', ], ], 'DeleteTokenResponse' => [ 'type' => 'structure', 'members' => [ 'IsSuccess' => [ 'shape' => '__boolean', 'locationName' => 'isSuccess', ], ], ], 'DeliveryMethod' => [ 'type' => 'string', 'enum' => [ 'EMAIL', 'SMS', ], ], 'EmailSettings' => [ 'type' => 'structure', 'members' => [ 'EmailMessage' => [ 'shape' => '__string', 'locationName' => 'emailMessage', ], 'EmailSubject' => [ 'shape' => '__string', 'locationName' => 'emailSubject', ], ], ], 'GatewayTimeoutException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => '__string', 'locationName' => 'message', ], ], 'exception' => true, 'error' => [ 'httpStatusCode' => 504, ], ], 'GenerateBackendAPIModelsRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'ResourceName', ], ], 'GenerateBackendAPIModelsResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'GetBackendAPIModelsRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'ResourceName', ], ], 'GetBackendAPIModelsResponse' => [ 'type' => 'structure', 'members' => [ 'Models' => [ 'shape' => '__string', 'locationName' => 'models', ], 'Status' => [ 'shape' => 'Status', 'locationName' => 'status', ], 'ModelIntrospectionSchema' => [ 'shape' => '__string', 'locationName' => 'modelIntrospectionSchema', ], ], ], 'GetBackendAPIRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'ResourceConfig' => [ 'shape' => 'BackendAPIResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'ResourceName', ], ], 'GetBackendAPIRespObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'ResourceConfig' => [ 'shape' => 'BackendAPIResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', ], ], 'GetBackendAPIResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'ResourceConfig' => [ 'shape' => 'BackendAPIResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], ], 'GetBackendAuthReqObj' => [ 'type' => 'structure', 'members' => [ 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'ResourceName', ], ], 'GetBackendAuthRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'ResourceName', ], ], 'GetBackendAuthRespObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'ResourceConfig' => [ 'shape' => 'CreateBackendAuthResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', ], ], 'GetBackendAuthResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'ResourceConfig' => [ 'shape' => 'CreateBackendAuthResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], ], 'GetBackendJobRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'JobId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'jobId', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'JobId', ], ], 'GetBackendJobResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'CreateTime' => [ 'shape' => '__string', 'locationName' => 'createTime', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], 'UpdateTime' => [ 'shape' => '__string', 'locationName' => 'updateTime', ], ], ], 'GetBackendReqObj' => [ 'type' => 'structure', 'members' => [ 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], ], ], 'GetBackendRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], ], 'required' => [ 'AppId', ], ], 'GetBackendRespObj' => [ 'type' => 'structure', 'members' => [ 'AmplifyFeatureFlags' => [ 'shape' => '__string', 'locationName' => 'amplifyFeatureFlags', ], 'AmplifyMetaConfig' => [ 'shape' => '__string', 'locationName' => 'amplifyMetaConfig', ], 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'AppName' => [ 'shape' => '__string', 'locationName' => 'appName', ], 'BackendEnvironmentList' => [ 'shape' => 'ListOf__string', 'locationName' => 'backendEnvironmentList', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], ], 'required' => [ 'AppId', ], ], 'GetBackendResponse' => [ 'type' => 'structure', 'members' => [ 'AmplifyFeatureFlags' => [ 'shape' => '__string', 'locationName' => 'amplifyFeatureFlags', ], 'AmplifyMetaConfig' => [ 'shape' => '__string', 'locationName' => 'amplifyMetaConfig', ], 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'AppName' => [ 'shape' => '__string', 'locationName' => 'appName', ], 'BackendEnvironmentList' => [ 'shape' => 'ListOf__string', 'locationName' => 'backendEnvironmentList', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], ], ], 'GetBackendStorageReqObj' => [ 'type' => 'structure', 'members' => [ 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'ResourceName', ], ], 'GetBackendStorageRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'ResourceName', ], ], 'GetBackendStorageResourceConfig' => [ 'type' => 'structure', 'members' => [ 'BucketName' => [ 'shape' => '__string', 'locationName' => 'bucketName', ], 'Imported' => [ 'shape' => '__boolean', 'locationName' => 'imported', ], 'Permissions' => [ 'shape' => 'BackendStoragePermissions', 'locationName' => 'permissions', ], 'ServiceName' => [ 'shape' => 'ServiceName', 'locationName' => 'serviceName', ], ], 'required' => [ 'ServiceName', 'Imported', ], ], 'GetBackendStorageRespObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'ResourceConfig' => [ 'shape' => 'GetBackendStorageResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', ], ], 'GetBackendStorageResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'ResourceConfig' => [ 'shape' => 'GetBackendStorageResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], ], 'GetTokenRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'SessionId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'sessionId', ], ], 'required' => [ 'SessionId', 'AppId', ], ], 'GetTokenRespObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'ChallengeCode' => [ 'shape' => '__string', 'locationName' => 'challengeCode', ], 'SessionId' => [ 'shape' => '__string', 'locationName' => 'sessionId', ], 'Ttl' => [ 'shape' => '__string', 'locationName' => 'ttl', ], ], 'required' => [ 'AppId', 'Ttl', 'SessionId', 'ChallengeCode', ], ], 'GetTokenResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'ChallengeCode' => [ 'shape' => '__string', 'locationName' => 'challengeCode', ], 'SessionId' => [ 'shape' => '__string', 'locationName' => 'sessionId', ], 'Ttl' => [ 'shape' => '__string', 'locationName' => 'ttl', ], ], ], 'ImportBackendAuthReqObj' => [ 'type' => 'structure', 'members' => [ 'IdentityPoolId' => [ 'shape' => '__string', 'locationName' => 'identityPoolId', ], 'NativeClientId' => [ 'shape' => '__string', 'locationName' => 'nativeClientId', ], 'UserPoolId' => [ 'shape' => '__string', 'locationName' => 'userPoolId', ], 'WebClientId' => [ 'shape' => '__string', 'locationName' => 'webClientId', ], ], 'required' => [ 'UserPoolId', 'NativeClientId', 'WebClientId', ], ], 'ImportBackendAuthRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'IdentityPoolId' => [ 'shape' => '__string', 'locationName' => 'identityPoolId', ], 'NativeClientId' => [ 'shape' => '__string', 'locationName' => 'nativeClientId', ], 'UserPoolId' => [ 'shape' => '__string', 'locationName' => 'userPoolId', ], 'WebClientId' => [ 'shape' => '__string', 'locationName' => 'webClientId', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'UserPoolId', 'NativeClientId', 'WebClientId', ], ], 'ImportBackendAuthResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'ImportBackendStorageReqObj' => [ 'type' => 'structure', 'members' => [ 'BucketName' => [ 'shape' => '__string', 'locationName' => 'bucketName', ], 'ServiceName' => [ 'shape' => 'ServiceName', 'locationName' => 'serviceName', ], ], 'required' => [ 'ServiceName', ], ], 'ImportBackendStorageRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'BucketName' => [ 'shape' => '__string', 'locationName' => 'bucketName', ], 'ServiceName' => [ 'shape' => 'ServiceName', 'locationName' => 'serviceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'ServiceName', ], ], 'ImportBackendStorageResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'InternalServiceException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => '__string', 'locationName' => 'message', ], ], ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'LimitType' => [ 'shape' => '__string', 'locationName' => 'limitType', ], 'Message' => [ 'shape' => '__string', 'locationName' => 'message', ], ], ], 'ListBackendJobReqObj' => [ 'type' => 'structure', 'members' => [ 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'MaxResults' => [ 'shape' => '__integerMin1Max25', 'locationName' => 'maxResults', ], 'NextToken' => [ 'shape' => '__string', 'locationName' => 'nextToken', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'ListBackendJobRespObj' => [ 'type' => 'structure', 'members' => [ 'Jobs' => [ 'shape' => 'ListOfBackendJobRespObj', 'locationName' => 'jobs', ], 'NextToken' => [ 'shape' => '__string', 'locationName' => 'nextToken', ], ], ], 'ListBackendJobsRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'MaxResults' => [ 'shape' => '__integerMin1Max25', 'locationName' => 'maxResults', ], 'NextToken' => [ 'shape' => '__string', 'locationName' => 'nextToken', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', ], ], 'ListBackendJobsResponse' => [ 'type' => 'structure', 'members' => [ 'Jobs' => [ 'shape' => 'ListOfBackendJobRespObj', 'locationName' => 'jobs', ], 'NextToken' => [ 'shape' => '__string', 'locationName' => 'nextToken', ], ], ], 'ListS3BucketsReqObj' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => '__string', 'locationName' => 'nextToken', ], ], ], 'ListS3BucketsRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => '__string', 'locationName' => 'nextToken', ], ], ], 'ListS3BucketsRespObj' => [ 'type' => 'structure', 'members' => [ 'Buckets' => [ 'shape' => 'ListOfS3BucketInfo', 'locationName' => 'buckets', ], 'NextToken' => [ 'shape' => '__string', 'locationName' => 'nextToken', ], ], 'required' => [ 'Buckets', ], ], 'ListS3BucketsResponse' => [ 'type' => 'structure', 'members' => [ 'Buckets' => [ 'shape' => 'ListOfS3BucketInfo', 'locationName' => 'buckets', ], 'NextToken' => [ 'shape' => '__string', 'locationName' => 'nextToken', ], ], ], 'LoginAuthConfigReqObj' => [ 'type' => 'structure', 'members' => [ 'AwsCognitoIdentityPoolId' => [ 'shape' => '__string', 'locationName' => 'aws_cognito_identity_pool_id', ], 'AwsCognitoRegion' => [ 'shape' => '__string', 'locationName' => 'aws_cognito_region', ], 'AwsUserPoolsId' => [ 'shape' => '__string', 'locationName' => 'aws_user_pools_id', ], 'AwsUserPoolsWebClientId' => [ 'shape' => '__string', 'locationName' => 'aws_user_pools_web_client_id', ], ], ], 'MFAMode' => [ 'type' => 'string', 'enum' => [ 'ON', 'OFF', 'OPTIONAL', ], ], 'Mode' => [ 'type' => 'string', 'enum' => [ 'API_KEY', 'AWS_IAM', 'AMAZON_COGNITO_USER_POOLS', 'OPENID_CONNECT', ], ], 'NotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => '__string', 'locationName' => 'message', ], 'ResourceType' => [ 'shape' => '__string', 'locationName' => 'resourceType', ], ], 'exception' => true, 'error' => [ 'httpStatusCode' => 404, ], ], 'OAuthGrantType' => [ 'type' => 'string', 'enum' => [ 'CODE', 'IMPLICIT', ], ], 'RemoveAllBackendsReqObj' => [ 'type' => 'structure', 'members' => [ 'CleanAmplifyApp' => [ 'shape' => '__boolean', 'locationName' => 'cleanAmplifyApp', ], ], ], 'RemoveAllBackendsRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'CleanAmplifyApp' => [ 'shape' => '__boolean', 'locationName' => 'cleanAmplifyApp', ], ], 'required' => [ 'AppId', ], ], 'RemoveAllBackendsRespObj' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], 'required' => [ 'AppId', ], ], 'RemoveAllBackendsResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'RemoveBackendAuthReqObj' => [ 'type' => 'structure', 'members' => [ 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'ResourceName', ], ], 'RemoveBackendConfigRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], ], 'required' => [ 'AppId', ], ], 'RemoveBackendConfigRespObj' => [ 'type' => 'structure', 'members' => [ 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], ], ], 'RemoveBackendConfigResponse' => [ 'type' => 'structure', 'members' => [ 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], ], ], 'RemoveBackendStorageReqObj' => [ 'type' => 'structure', 'members' => [ 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], 'ServiceName' => [ 'shape' => 'ServiceName', 'locationName' => 'serviceName', ], ], 'required' => [ 'ServiceName', 'ResourceName', ], ], 'ResolutionStrategy' => [ 'type' => 'string', 'enum' => [ 'OPTIMISTIC_CONCURRENCY', 'LAMBDA', 'AUTOMERGE', 'NONE', ], ], 'ResourceConfig' => [ 'type' => 'structure', 'members' => [], ], 'S3BucketInfo' => [ 'type' => 'structure', 'members' => [ 'CreationDate' => [ 'shape' => '__string', 'locationName' => 'creationDate', ], 'Name' => [ 'shape' => '__string', 'locationName' => 'name', ], ], ], 'Service' => [ 'type' => 'string', 'enum' => [ 'COGNITO', ], ], 'ServiceName' => [ 'type' => 'string', 'enum' => [ 'S3', ], ], 'Settings' => [ 'type' => 'structure', 'members' => [ 'MfaTypes' => [ 'shape' => 'ListOfMfaTypesElement', 'locationName' => 'mfaTypes', ], 'SmsMessage' => [ 'shape' => '__string', 'locationName' => 'smsMessage', ], ], ], 'SignInMethod' => [ 'type' => 'string', 'enum' => [ 'EMAIL', 'EMAIL_AND_PHONE_NUMBER', 'PHONE_NUMBER', 'USERNAME', ], ], 'SmsSettings' => [ 'type' => 'structure', 'members' => [ 'SmsMessage' => [ 'shape' => '__string', 'locationName' => 'smsMessage', ], ], ], 'SocialProviderSettings' => [ 'type' => 'structure', 'members' => [ 'Facebook' => [ 'shape' => 'BackendAuthSocialProviderConfig', ], 'Google' => [ 'shape' => 'BackendAuthSocialProviderConfig', ], 'LoginWithAmazon' => [ 'shape' => 'BackendAuthSocialProviderConfig', ], 'SignInWithApple' => [ 'shape' => 'BackendAuthAppleProviderConfig', ], ], ], 'Status' => [ 'type' => 'string', 'enum' => [ 'LATEST', 'STALE', ], ], 'TooManyRequestsException' => [ 'type' => 'structure', 'members' => [ 'LimitType' => [ 'shape' => '__string', 'locationName' => 'limitType', ], 'Message' => [ 'shape' => '__string', 'locationName' => 'message', ], ], 'exception' => true, 'error' => [ 'httpStatusCode' => 429, ], ], 'UpdateBackendAPIRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'ResourceConfig' => [ 'shape' => 'BackendAPIResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'ResourceName', ], ], 'UpdateBackendAPIResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'UpdateBackendAuthForgotPasswordConfig' => [ 'type' => 'structure', 'members' => [ 'DeliveryMethod' => [ 'shape' => 'DeliveryMethod', 'locationName' => 'deliveryMethod', ], 'EmailSettings' => [ 'shape' => 'EmailSettings', 'locationName' => 'emailSettings', ], 'SmsSettings' => [ 'shape' => 'SmsSettings', 'locationName' => 'smsSettings', ], ], ], 'UpdateBackendAuthIdentityPoolConfig' => [ 'type' => 'structure', 'members' => [ 'UnauthenticatedLogin' => [ 'shape' => '__boolean', 'locationName' => 'unauthenticatedLogin', ], ], ], 'UpdateBackendAuthMFAConfig' => [ 'type' => 'structure', 'members' => [ 'MFAMode' => [ 'shape' => 'MFAMode', ], 'Settings' => [ 'shape' => 'Settings', 'locationName' => 'settings', ], ], ], 'UpdateBackendAuthOAuthConfig' => [ 'type' => 'structure', 'members' => [ 'DomainPrefix' => [ 'shape' => '__string', 'locationName' => 'domainPrefix', ], 'OAuthGrantType' => [ 'shape' => 'OAuthGrantType', 'locationName' => 'oAuthGrantType', ], 'OAuthScopes' => [ 'shape' => 'ListOfOAuthScopesElement', 'locationName' => 'oAuthScopes', ], 'RedirectSignInURIs' => [ 'shape' => 'ListOf__string', 'locationName' => 'redirectSignInURIs', ], 'RedirectSignOutURIs' => [ 'shape' => 'ListOf__string', 'locationName' => 'redirectSignOutURIs', ], 'SocialProviderSettings' => [ 'shape' => 'SocialProviderSettings', 'locationName' => 'socialProviderSettings', ], ], ], 'UpdateBackendAuthPasswordPolicyConfig' => [ 'type' => 'structure', 'members' => [ 'AdditionalConstraints' => [ 'shape' => 'ListOfAdditionalConstraintsElement', 'locationName' => 'additionalConstraints', ], 'MinimumLength' => [ 'shape' => '__double', 'locationName' => 'minimumLength', ], ], ], 'UpdateBackendAuthReqObj' => [ 'type' => 'structure', 'members' => [ 'ResourceConfig' => [ 'shape' => 'UpdateBackendAuthResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'ResourceName', 'ResourceConfig', ], ], 'UpdateBackendAuthRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'ResourceConfig' => [ 'shape' => 'UpdateBackendAuthResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'ResourceName', 'ResourceConfig', ], ], 'UpdateBackendAuthResourceConfig' => [ 'type' => 'structure', 'members' => [ 'AuthResources' => [ 'shape' => 'AuthResources', 'locationName' => 'authResources', ], 'IdentityPoolConfigs' => [ 'shape' => 'UpdateBackendAuthIdentityPoolConfig', 'locationName' => 'identityPoolConfigs', ], 'Service' => [ 'shape' => 'Service', 'locationName' => 'service', ], 'UserPoolConfigs' => [ 'shape' => 'UpdateBackendAuthUserPoolConfig', 'locationName' => 'userPoolConfigs', ], ], 'required' => [ 'AuthResources', 'UserPoolConfigs', 'Service', ], ], 'UpdateBackendAuthResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'UpdateBackendAuthUserPoolConfig' => [ 'type' => 'structure', 'members' => [ 'ForgotPassword' => [ 'shape' => 'UpdateBackendAuthForgotPasswordConfig', 'locationName' => 'forgotPassword', ], 'Mfa' => [ 'shape' => 'UpdateBackendAuthMFAConfig', 'locationName' => 'mfa', ], 'OAuth' => [ 'shape' => 'UpdateBackendAuthOAuthConfig', 'locationName' => 'oAuth', ], 'PasswordPolicy' => [ 'shape' => 'UpdateBackendAuthPasswordPolicyConfig', 'locationName' => 'passwordPolicy', ], 'VerificationMessage' => [ 'shape' => 'UpdateBackendAuthVerificationMessageConfig', 'locationName' => 'verificationMessage', ], ], ], 'UpdateBackendAuthVerificationMessageConfig' => [ 'type' => 'structure', 'members' => [ 'DeliveryMethod' => [ 'shape' => 'DeliveryMethod', 'locationName' => 'deliveryMethod', ], 'EmailSettings' => [ 'shape' => 'EmailSettings', 'locationName' => 'emailSettings', ], 'SmsSettings' => [ 'shape' => 'SmsSettings', 'locationName' => 'smsSettings', ], ], 'required' => [ 'DeliveryMethod', ], ], 'UpdateBackendConfigReqObj' => [ 'type' => 'structure', 'members' => [ 'LoginAuthConfig' => [ 'shape' => 'LoginAuthConfigReqObj', 'locationName' => 'loginAuthConfig', ], ], ], 'UpdateBackendConfigRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'LoginAuthConfig' => [ 'shape' => 'LoginAuthConfigReqObj', 'locationName' => 'loginAuthConfig', ], ], 'required' => [ 'AppId', ], ], 'UpdateBackendConfigResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendManagerAppId' => [ 'shape' => '__string', 'locationName' => 'backendManagerAppId', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'LoginAuthConfig' => [ 'shape' => 'LoginAuthConfigReqObj', 'locationName' => 'loginAuthConfig', ], ], ], 'UpdateBackendJobRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'JobId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'JobId', ], ], 'UpdateBackendJobResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'CreateTime' => [ 'shape' => '__string', 'locationName' => 'createTime', ], 'Error' => [ 'shape' => '__string', 'locationName' => 'error', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Operation' => [ 'shape' => '__string', 'locationName' => 'operation', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], 'UpdateTime' => [ 'shape' => '__string', 'locationName' => 'updateTime', ], ], ], 'UpdateBackendStorageReqObj' => [ 'type' => 'structure', 'members' => [ 'ResourceConfig' => [ 'shape' => 'UpdateBackendStorageResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'ResourceName', 'ResourceConfig', ], ], 'UpdateBackendStorageRequest' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'backendEnvironmentName', ], 'ResourceConfig' => [ 'shape' => 'UpdateBackendStorageResourceConfig', 'locationName' => 'resourceConfig', ], 'ResourceName' => [ 'shape' => '__string', 'locationName' => 'resourceName', ], ], 'required' => [ 'AppId', 'BackendEnvironmentName', 'ResourceName', 'ResourceConfig', ], ], 'UpdateBackendStorageResourceConfig' => [ 'type' => 'structure', 'members' => [ 'Permissions' => [ 'shape' => 'BackendStoragePermissions', 'locationName' => 'permissions', ], 'ServiceName' => [ 'shape' => 'ServiceName', 'locationName' => 'serviceName', ], ], 'required' => [ 'ServiceName', 'Permissions', ], ], 'UpdateBackendStorageResponse' => [ 'type' => 'structure', 'members' => [ 'AppId' => [ 'shape' => '__string', 'locationName' => 'appId', ], 'BackendEnvironmentName' => [ 'shape' => '__string', 'locationName' => 'backendEnvironmentName', ], 'JobId' => [ 'shape' => '__string', 'locationName' => 'jobId', ], 'Status' => [ 'shape' => '__string', 'locationName' => 'status', ], ], ], 'AdditionalConstraintsElement' => [ 'type' => 'string', 'enum' => [ 'REQUIRE_DIGIT', 'REQUIRE_LOWERCASE', 'REQUIRE_SYMBOL', 'REQUIRE_UPPERCASE', ], ], 'AuthenticatedElement' => [ 'type' => 'string', 'enum' => [ 'READ', 'CREATE_AND_UPDATE', 'DELETE', ], ], 'MfaTypesElement' => [ 'type' => 'string', 'enum' => [ 'SMS', 'TOTP', ], ], 'OAuthScopesElement' => [ 'type' => 'string', 'enum' => [ 'PHONE', 'EMAIL', 'OPENID', 'PROFILE', 'AWS_COGNITO_SIGNIN_USER_ADMIN', ], ], 'RequiredSignUpAttributesElement' => [ 'type' => 'string', 'enum' => [ 'ADDRESS', 'BIRTHDATE', 'EMAIL', 'FAMILY_NAME', 'GENDER', 'GIVEN_NAME', 'LOCALE', 'MIDDLE_NAME', 'NAME', 'NICKNAME', 'PHONE_NUMBER', 'PICTURE', 'PREFERRED_USERNAME', 'PROFILE', 'UPDATED_AT', 'WEBSITE', 'ZONE_INFO', ], ], 'UnAuthenticatedElement' => [ 'type' => 'string', 'enum' => [ 'READ', 'CREATE_AND_UPDATE', 'DELETE', ], ], '__boolean' => [ 'type' => 'boolean', ], '__double' => [ 'type' => 'double', ], '__integer' => [ 'type' => 'integer', ], '__integerMin1Max25' => [ 'type' => 'integer', 'min' => 1, 'max' => 25, ], 'ListOfBackendAPIAuthType' => [ 'type' => 'list', 'member' => [ 'shape' => 'BackendAPIAuthType', ], ], 'ListOfBackendJobRespObj' => [ 'type' => 'list', 'member' => [ 'shape' => 'BackendJobRespObj', ], ], 'ListOfS3BucketInfo' => [ 'type' => 'list', 'member' => [ 'shape' => 'S3BucketInfo', ], ], 'ListOfAdditionalConstraintsElement' => [ 'type' => 'list', 'member' => [ 'shape' => 'AdditionalConstraintsElement', ], ], 'ListOfAuthenticatedElement' => [ 'type' => 'list', 'member' => [ 'shape' => 'AuthenticatedElement', ], ], 'ListOfMfaTypesElement' => [ 'type' => 'list', 'member' => [ 'shape' => 'MfaTypesElement', ], ], 'ListOfOAuthScopesElement' => [ 'type' => 'list', 'member' => [ 'shape' => 'OAuthScopesElement', ], ], 'ListOfRequiredSignUpAttributesElement' => [ 'type' => 'list', 'member' => [ 'shape' => 'RequiredSignUpAttributesElement', ], ], 'ListOfUnAuthenticatedElement' => [ 'type' => 'list', 'member' => [ 'shape' => 'UnAuthenticatedElement', ], ], 'ListOf__string' => [ 'type' => 'list', 'member' => [ 'shape' => '__string', ], ], '__long' => [ 'type' => 'long', ], '__string' => [ 'type' => 'string', ], '__timestampIso8601' => [ 'type' => 'timestamp', 'timestampFormat' => 'iso8601', ], '__timestampUnix' => [ 'type' => 'timestamp', 'timestampFormat' => 'unixTimestamp', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplifybackend/2020-08-11/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>AWS Amplify Admin API</p>', 'operations' => [ 'CloneBackend' => '<p>This operation clones an existing backend.</p>', 'CreateBackend' => '<p>This operation creates a backend for an Amplify app. Backends are automatically created at the time of app creation.</p>', 'CreateBackendAPI' => '<p>Creates a new backend API resource.</p>', 'CreateBackendAuth' => '<p>Creates a new backend authentication resource.</p>', 'CreateBackendConfig' => '<p>Creates a config object for a backend.</p>', 'CreateBackendStorage' => '<p>Creates a backend storage resource.</p>', 'CreateToken' => '<p>Generates a one-time challenge code to authenticate a user into your Amplify Admin UI.</p>', 'DeleteBackend' => '<p>Removes an existing environment from your Amplify project.</p>', 'DeleteBackendAPI' => '<p>Deletes an existing backend API resource.</p>', 'DeleteBackendAuth' => '<p>Deletes an existing backend authentication resource.</p>', 'DeleteBackendStorage' => '<p>Removes the specified backend storage resource.</p>', 'DeleteToken' => '<p>Deletes the challenge token based on the given appId and sessionId.</p>', 'GenerateBackendAPIModels' => '<p>Generates a model schema for an existing backend API resource.</p>', 'GetBackend' => '<p>Provides project-level details for your Amplify UI project.</p>', 'GetBackendAPI' => '<p>Gets the details for a backend API.</p>', 'GetBackendAPIModels' => '<p>Gets a model introspection schema for an existing backend API resource.</p>', 'GetBackendAuth' => '<p>Gets a backend auth details.</p>', 'GetBackendJob' => '<p>Returns information about a specific job.</p>', 'GetBackendStorage' => '<p>Gets details for a backend storage resource.</p>', 'GetToken' => '<p>Gets the challenge token based on the given appId and sessionId.</p>', 'ImportBackendAuth' => '<p>Imports an existing backend authentication resource.</p>', 'ImportBackendStorage' => '<p>Imports an existing backend storage resource.</p>', 'ListBackendJobs' => '<p>Lists the jobs for the backend of an Amplify app.</p>', 'ListS3Buckets' => '<p>The list of S3 buckets in your account.</p>', 'RemoveAllBackends' => '<p>Removes all backend environments from your Amplify project.</p>', 'RemoveBackendConfig' => '<p>Removes the AWS resources required to access the Amplify Admin UI.</p>', 'UpdateBackendAPI' => '<p>Updates an existing backend API resource.</p>', 'UpdateBackendAuth' => '<p>Updates an existing backend authentication resource.</p>', 'UpdateBackendConfig' => '<p>Updates the AWS resources required to access the Amplify Admin UI.</p>', 'UpdateBackendJob' => '<p>Updates a specific job.</p>', 'UpdateBackendStorage' => '<p>Updates an existing backend storage resource.</p>', ], 'shapes' => [ 'AuthResources' => [ 'base' => NULL, 'refs' => [ 'CreateBackendAuthResourceConfig$AuthResources' => '<p>Defines whether you want to configure only authentication or both authentication and authorization settings.</p>', 'UpdateBackendAuthResourceConfig$AuthResources' => '<p>Defines the service name to use when configuring an authentication resource in your Amplify project.</p>', ], ], 'BackendAPIAppSyncAuthSettings' => [ 'base' => '<p>The authentication settings for accessing provisioned data models in your Amplify project.</p>', 'refs' => [ 'BackendAPIAuthType$Settings' => '<p>Describes settings for the authentication mode.</p>', ], ], 'BackendAPIAuthType' => [ 'base' => '<p>Describes the auth types for your configured data models.</p>', 'refs' => [ 'BackendAPIResourceConfig$DefaultAuthType' => '<p>The default authentication type for interacting with the configured data models in your Amplify project.</p>', 'ListOfBackendAPIAuthType$member' => NULL, ], ], 'BackendAPICodegenReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'BackendAPICodegenRespObj' => [ 'base' => '<p>The response object sent when a backend is created.</p>', 'refs' => [], ], 'BackendAPIConflictResolution' => [ 'base' => '<p>Describes the conflict resolution configuration for your data model configured in your Amplify project.</p>', 'refs' => [ 'BackendAPIResourceConfig$ConflictResolution' => '<p>The conflict resolution strategy for your data stored in the data models.</p>', ], ], 'BackendAPIReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'BackendAPIResourceConfig' => [ 'base' => '<p>The resource config for the data model, configured as a part of the Amplify project.</p>', 'refs' => [ 'BackendAPIReqObj$ResourceConfig' => '<p>Defines the resource configuration for the data model in your Amplify project.</p>', 'CreateBackendAPIReqObj$ResourceConfig' => '<p>The resource configuration for this request.</p>', 'GetBackendAPIRespObj$ResourceConfig' => '<p>The resource configuration for this response object.</p>', ], ], 'BackendAPIRespObj' => [ 'base' => '<p>The response object sent when a backend is created.</p>', 'refs' => [], ], 'BackendAuthAppleProviderConfig' => [ 'base' => '<p>Describes Apple social federation configurations for allowing your app users to sign in using OAuth.</p>', 'refs' => [ 'SocialProviderSettings$SignInWithApple' => NULL, ], ], 'BackendAuthRespObj' => [ 'base' => '<p>The response object for this operation.</p>', 'refs' => [], ], 'BackendAuthSocialProviderConfig' => [ 'base' => '<p>Describes third-party social federation configurations for allowing your app users to sign in using OAuth.</p>', 'refs' => [ 'SocialProviderSettings$Facebook' => NULL, 'SocialProviderSettings$Google' => NULL, 'SocialProviderSettings$LoginWithAmazon' => NULL, ], ], 'BackendConfigRespObj' => [ 'base' => '<p>The response object for this operation.</p>', 'refs' => [], ], 'BackendJobReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'BackendJobRespObj' => [ 'base' => '<p>The response object for this operation.</p>', 'refs' => [ 'ListOfBackendJobRespObj$member' => NULL, ], ], 'BackendStoragePermissions' => [ 'base' => '<p>Describes the read, write, and delete permissions users have against your storage S3 bucket.</p>', 'refs' => [ 'CreateBackendStorageResourceConfig$Permissions' => '<p>The authorization configuration for the storage S3 bucket.</p>', 'GetBackendStorageResourceConfig$Permissions' => '<p>The authorization configuration for the storage S3 bucket.</p>', 'UpdateBackendStorageResourceConfig$Permissions' => '<p>The authorization configuration for the storage S3 bucket.</p>', ], ], 'BackendStorageRespObj' => [ 'base' => '<p>The response object for this operation.</p>', 'refs' => [], ], 'BadRequestException' => [ 'base' => '<p>An error returned if a request is not formed properly.</p>', 'refs' => [], ], 'CloneBackendReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'CloneBackendRespObj' => [ 'base' => '<p>The response object sent when a backend is created.</p>', 'refs' => [], ], 'CreateBackendAPIReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'CreateBackendAuthForgotPasswordConfig' => [ 'base' => '<p><b>(DEPRECATED)</b> Describes the forgot password policy for authenticating into the Amplify app.</p>', 'refs' => [ 'CreateBackendAuthUserPoolConfig$ForgotPassword' => '<p><b>(DEPRECATED)</b> Describes the forgotten password policy for your Amazon Cognito user pool, configured as a part of your Amplify project.</p>', ], ], 'CreateBackendAuthIdentityPoolConfig' => [ 'base' => '<p>Describes authorization configurations for the auth resources, configured as a part of your Amplify project.</p>', 'refs' => [ 'CreateBackendAuthResourceConfig$IdentityPoolConfigs' => '<p>Describes the authorization configuration for the Amazon Cognito identity pool, provisioned as a part of your auth resource in the Amplify project.</p>', ], ], 'CreateBackendAuthMFAConfig' => [ 'base' => '<p>Describes whether to apply multi-factor authentication policies for your Amazon Cognito user pool configured as a part of your Amplify project.</p>', 'refs' => [ 'CreateBackendAuthUserPoolConfig$Mfa' => '<p>Describes whether to apply multi-factor authentication policies for your Amazon Cognito user pool configured as a part of your Amplify project.</p>', ], ], 'CreateBackendAuthOAuthConfig' => [ 'base' => '<p>Creates the OAuth configuration for your Amplify project.</p>', 'refs' => [ 'CreateBackendAuthUserPoolConfig$OAuth' => '<p>Describes the OAuth policy and rules for your Amazon Cognito user pool, configured as a part of your Amplify project.</p>', ], ], 'CreateBackendAuthPasswordPolicyConfig' => [ 'base' => '<p>The password policy configuration for the backend to your Amplify project.</p>', 'refs' => [ 'CreateBackendAuthUserPoolConfig$PasswordPolicy' => '<p>Describes the password policy for your Amazon Cognito user pool, configured as a part of your Amplify project.</p>', ], ], 'CreateBackendAuthReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'CreateBackendAuthResourceConfig' => [ 'base' => '<p>Defines the resource configuration when creating an auth resource in your Amplify project.</p>', 'refs' => [ 'CreateBackendAuthReqObj$ResourceConfig' => '<p>The resource configuration for this request object.</p>', 'GetBackendAuthRespObj$ResourceConfig' => '<p>The resource configuration for authorization requests to the backend of your Amplify project.</p>', ], ], 'CreateBackendAuthUserPoolConfig' => [ 'base' => '<p>Describes the Amazon Cognito user pool configuration for the auth resource to be configured for your Amplify project.</p>', 'refs' => [ 'CreateBackendAuthResourceConfig$UserPoolConfigs' => '<p>Describes authentication configuration for the Amazon Cognito user pool, provisioned as a part of your auth resource in the Amplify project.</p>', ], ], 'CreateBackendAuthVerificationMessageConfig' => [ 'base' => '<p>Creates an email or SMS verification message for the auth resource configured for your Amplify project.</p>', 'refs' => [ 'CreateBackendAuthUserPoolConfig$VerificationMessage' => '<p>Describes the email or SMS verification message for your Amazon Cognito user pool, configured as a part of your Amplify project.</p>', ], ], 'CreateBackendConfigReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'CreateBackendConfigRespObj' => [ 'base' => '<p>The response object for this operation.</p>', 'refs' => [], ], 'CreateBackendReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'CreateBackendRespObj' => [ 'base' => '<p>The response object sent when a backend is created.</p>', 'refs' => [], ], 'CreateBackendStorageReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'CreateBackendStorageResourceConfig' => [ 'base' => '<p>The resource configuration for creating backend storage.</p>', 'refs' => [ 'CreateBackendStorageReqObj$ResourceConfig' => '<p>The resource configuration for creating backend storage.</p>', ], ], 'CreateTokenRespObj' => [ 'base' => '<p>The response object for this operation.</p>', 'refs' => [], ], 'DeleteBackendRespObj' => [ 'base' => '<p>The returned object for a request to delete a backend.</p>', 'refs' => [], ], 'DeleteTokenRespObj' => [ 'base' => '<p>The response object for this operation.</p>', 'refs' => [], ], 'DeliveryMethod' => [ 'base' => '<p>The type of verification message to send.</p>', 'refs' => [ 'CreateBackendAuthForgotPasswordConfig$DeliveryMethod' => '<p><b>(DEPRECATED)</b> Describes which mode to use (either SMS or email) to deliver messages to app users who want to recover their password.</p>', 'CreateBackendAuthVerificationMessageConfig$DeliveryMethod' => '<p>The type of verification message to send.</p>', 'UpdateBackendAuthForgotPasswordConfig$DeliveryMethod' => '<p><b>(DEPRECATED)</b> Describes which mode to use (either SMS or email) to deliver messages to app users that want to recover their password.</p>', 'UpdateBackendAuthVerificationMessageConfig$DeliveryMethod' => '<p>The type of verification message to send.</p>', ], ], 'EmailSettings' => [ 'base' => '<p>The settings for the email message.</p>', 'refs' => [ 'CreateBackendAuthForgotPasswordConfig$EmailSettings' => '<p><b>(DEPRECATED)</b> The configuration for the email sent when an app user forgets their password.</p>', 'CreateBackendAuthVerificationMessageConfig$EmailSettings' => '<p>The settings for the email message.</p>', 'UpdateBackendAuthForgotPasswordConfig$EmailSettings' => '<p><b>(DEPRECATED)</b> The configuration for the email sent when an app user forgets their password.</p>', 'UpdateBackendAuthVerificationMessageConfig$EmailSettings' => '<p>The settings for the email message.</p>', ], ], 'GatewayTimeoutException' => [ 'base' => '<p>An error returned if there\\'s a temporary issue with the service.</p>', 'refs' => [], ], 'GetBackendAPIModelsResponse' => [ 'base' => '<p>The response object for this operation.</p>', 'refs' => [], ], 'GetBackendAPIRespObj' => [ 'base' => '<p>The response object for this operation.</p>', 'refs' => [], ], 'GetBackendAuthReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'GetBackendAuthRespObj' => [ 'base' => '<p>The response object for this operation.</p>', 'refs' => [], ], 'GetBackendReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'GetBackendRespObj' => [ 'base' => '<p>The response object for this operation.</p>', 'refs' => [], ], 'GetBackendStorageReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'GetBackendStorageResourceConfig' => [ 'base' => '<p>The details for a backend storage resource.</p>', 'refs' => [ 'GetBackendStorageRespObj$ResourceConfig' => '<p>The resource configuration for the backend storage resource.</p>', ], ], 'GetBackendStorageRespObj' => [ 'base' => '<p>The response object for this operation.</p>', 'refs' => [], ], 'GetTokenRespObj' => [ 'base' => '<p>The response object for this operation.</p>', 'refs' => [], ], 'ImportBackendAuthReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'ImportBackendStorageReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'InternalServiceException' => [ 'base' => '<p>An error returned if there\\'s a temporary issue with the service.</p>', 'refs' => [], ], 'LimitExceededException' => [ 'base' => '<p>An error that is returned when a limit of a specific type has been exceeded.</p>', 'refs' => [], ], 'ListBackendJobReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'ListBackendJobRespObj' => [ 'base' => '<p>The returned list of backend jobs.</p>', 'refs' => [], ], 'ListS3BucketsReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'ListS3BucketsRespObj' => [ 'base' => '<p>The response object for this operation.</p>', 'refs' => [], ], 'LoginAuthConfigReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [ 'BackendConfigRespObj$LoginAuthConfig' => '<p>Describes the Amazon Cognito configurations for the Admin UI auth resource to log in with.</p>', 'UpdateBackendConfigReqObj$LoginAuthConfig' => '<p>Describes the Amazon Cognito configuration for Admin UI access.</p>', ], ], 'MFAMode' => [ 'base' => NULL, 'refs' => [ 'CreateBackendAuthMFAConfig$MFAMode' => '<p>Describes whether MFA should be [ON, OFF, or OPTIONAL] for authentication in your Amplify project.</p>', 'UpdateBackendAuthMFAConfig$MFAMode' => '<p>The MFA mode for the backend of your Amplify project.</p>', ], ], 'Mode' => [ 'base' => NULL, 'refs' => [ 'BackendAPIAuthType$Mode' => '<p>Describes the authentication mode.</p>', ], ], 'NotFoundException' => [ 'base' => '<p>An error returned when a specific resource type is not found.</p>', 'refs' => [], ], 'OAuthGrantType' => [ 'base' => NULL, 'refs' => [ 'CreateBackendAuthOAuthConfig$OAuthGrantType' => '<p>The OAuth grant type that you use to allow app users to authenticate from your Amplify app.</p>', 'UpdateBackendAuthOAuthConfig$OAuthGrantType' => '<p>The OAuth grant type to allow app users to authenticate from your Amplify app.</p>', ], ], 'RemoveAllBackendsReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'RemoveAllBackendsRespObj' => [ 'base' => '<p>The response object for this operation.</p>', 'refs' => [], ], 'RemoveBackendAuthReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'RemoveBackendConfigRespObj' => [ 'base' => '<p>The response object for this operation.</p>', 'refs' => [], ], 'RemoveBackendStorageReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'ResolutionStrategy' => [ 'base' => NULL, 'refs' => [ 'BackendAPIConflictResolution$ResolutionStrategy' => '<p>The strategy for conflict resolution.</p>', ], ], 'ResourceConfig' => [ 'base' => NULL, 'refs' => [ 'CreateBackendReqObj$ResourceConfig' => '<p>The resource configuration for creating a backend.</p>', ], ], 'S3BucketInfo' => [ 'base' => '<p>Describes the metadata of the S3 bucket.</p>', 'refs' => [ 'ListOfS3BucketInfo$member' => NULL, ], ], 'Service' => [ 'base' => NULL, 'refs' => [ 'CreateBackendAuthResourceConfig$Service' => '<p>Defines the service name to use when configuring an authentication resource in your Amplify project.</p>', 'UpdateBackendAuthResourceConfig$Service' => '<p>Defines the service name to use when configuring an authentication resource in your Amplify project.</p>', ], ], 'ServiceName' => [ 'base' => NULL, 'refs' => [ 'CreateBackendStorageResourceConfig$ServiceName' => '<p>The name of the storage service.</p>', 'GetBackendStorageResourceConfig$ServiceName' => '<p>The name of the storage service.</p>', 'ImportBackendStorageReqObj$ServiceName' => '<p>The name of the storage service.</p>', 'RemoveBackendStorageReqObj$ServiceName' => '<p>The name of the storage service.</p>', 'UpdateBackendStorageResourceConfig$ServiceName' => '<p>The name of the storage service.</p>', ], ], 'Settings' => [ 'base' => NULL, 'refs' => [ 'CreateBackendAuthMFAConfig$Settings' => '<p>Describes the configuration settings and methods for your Amplify app users to use MFA.</p>', 'UpdateBackendAuthMFAConfig$Settings' => '<p>The settings of your MFA configuration for the backend of your Amplify project.</p>', ], ], 'SignInMethod' => [ 'base' => NULL, 'refs' => [ 'CreateBackendAuthUserPoolConfig$SignInMethod' => '<p>Describes the sign-in methods that your Amplify app users use to log in using the Amazon Cognito user pool, configured as a part of your Amplify project.</p>', ], ], 'SmsSettings' => [ 'base' => '<p>The settings for the SMS message.</p>', 'refs' => [ 'CreateBackendAuthForgotPasswordConfig$SmsSettings' => '<p><b>(DEPRECATED)</b> The configuration for the SMS message sent when an app user forgets their password.</p>', 'CreateBackendAuthVerificationMessageConfig$SmsSettings' => '<p>The settings for the SMS message.</p>', 'UpdateBackendAuthForgotPasswordConfig$SmsSettings' => '<p><b>(DEPRECATED)</b> The configuration for the SMS message sent when an Amplify app user forgets their password.</p>', 'UpdateBackendAuthVerificationMessageConfig$SmsSettings' => '<p>The settings for the SMS message.</p>', ], ], 'SocialProviderSettings' => [ 'base' => NULL, 'refs' => [ 'CreateBackendAuthOAuthConfig$SocialProviderSettings' => '<p>The settings for using social providers to access your Amplify app.</p>', 'UpdateBackendAuthOAuthConfig$SocialProviderSettings' => '<p>Describes third-party social federation configurations for allowing your users to sign in with OAuth.</p>', ], ], 'Status' => [ 'base' => NULL, 'refs' => [ 'GetBackendAPIModelsResponse$Status' => '<p>The current status of the request.</p>', ], ], 'TooManyRequestsException' => [ 'base' => '<p>An error that is returned when a limit of a specific type has been exceeded.</p>', 'refs' => [], ], 'UpdateBackendAuthForgotPasswordConfig' => [ 'base' => '<p><b>(DEPRECATED)</b> Describes the forgot password policy for authenticating into the Amplify app.</p>', 'refs' => [ 'UpdateBackendAuthUserPoolConfig$ForgotPassword' => '<p><b>(DEPRECATED)</b> Describes the forgot password policy for your Amazon Cognito user pool, configured as a part of your Amplify project.</p>', ], ], 'UpdateBackendAuthIdentityPoolConfig' => [ 'base' => '<p>Describes the authorization configuration for the Amazon Cognito identity pool, provisioned as a part of your auth resource in the Amplify project.</p>', 'refs' => [ 'UpdateBackendAuthResourceConfig$IdentityPoolConfigs' => '<p>Describes the authorization configuration for the Amazon Cognito identity pool, provisioned as a part of your auth resource in the Amplify project.</p>', ], ], 'UpdateBackendAuthMFAConfig' => [ 'base' => '<p>Updates the multi-factor authentication (MFA) configuration for the backend of your Amplify project.</p>', 'refs' => [ 'UpdateBackendAuthUserPoolConfig$Mfa' => '<p>Describes whether to apply multi-factor authentication policies for your Amazon Cognito user pool configured as a part of your Amplify project.</p>', ], ], 'UpdateBackendAuthOAuthConfig' => [ 'base' => '<p>The OAuth configurations for authenticating users into your Amplify app.</p>', 'refs' => [ 'UpdateBackendAuthUserPoolConfig$OAuth' => '<p>Describes the OAuth policy and rules for your Amazon Cognito user pool, configured as a part of your Amplify project.</p>', ], ], 'UpdateBackendAuthPasswordPolicyConfig' => [ 'base' => '<p>Describes the password policy for your Amazon Cognito user pool configured as a part of your Amplify project.</p>', 'refs' => [ 'UpdateBackendAuthUserPoolConfig$PasswordPolicy' => '<p>Describes the password policy for your Amazon Cognito user pool, configured as a part of your Amplify project.</p>', ], ], 'UpdateBackendAuthReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'UpdateBackendAuthResourceConfig' => [ 'base' => '<p>Defines the resource configuration when updating an authentication resource in your Amplify project.</p>', 'refs' => [ 'UpdateBackendAuthReqObj$ResourceConfig' => '<p>The resource configuration for this request object.</p>', ], ], 'UpdateBackendAuthUserPoolConfig' => [ 'base' => '<p>Describes the Amazon Cognito user pool configuration for the authorization resource to be configured for your Amplify project on an update.</p>', 'refs' => [ 'UpdateBackendAuthResourceConfig$UserPoolConfigs' => '<p>Describes the authentication configuration for the Amazon Cognito user pool, provisioned as a part of your auth resource in the Amplify project.</p>', ], ], 'UpdateBackendAuthVerificationMessageConfig' => [ 'base' => '<p>Updates the configuration of the email or SMS message for the auth resource configured for your Amplify project.</p>', 'refs' => [ 'UpdateBackendAuthUserPoolConfig$VerificationMessage' => '<p>Describes the email or SMS verification message for your Amazon Cognito user pool, configured as a part of your Amplify project.</p>', ], ], 'UpdateBackendConfigReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'UpdateBackendStorageReqObj' => [ 'base' => '<p>The request object for this operation.</p>', 'refs' => [], ], 'UpdateBackendStorageResourceConfig' => [ 'base' => '<p>The resource configuration for updating backend storage.</p>', 'refs' => [ 'UpdateBackendStorageReqObj$ResourceConfig' => '<p>The resource configuration for updating backend storage.</p>', ], ], 'AdditionalConstraintsElement' => [ 'base' => NULL, 'refs' => [ 'ListOfAdditionalConstraintsElement$member' => NULL, ], ], 'AuthenticatedElement' => [ 'base' => NULL, 'refs' => [ 'ListOfAuthenticatedElement$member' => NULL, ], ], 'MfaTypesElement' => [ 'base' => NULL, 'refs' => [ 'ListOfMfaTypesElement$member' => NULL, ], ], 'OAuthScopesElement' => [ 'base' => NULL, 'refs' => [ 'ListOfOAuthScopesElement$member' => NULL, ], ], 'RequiredSignUpAttributesElement' => [ 'base' => NULL, 'refs' => [ 'ListOfRequiredSignUpAttributesElement$member' => NULL, ], ], 'UnAuthenticatedElement' => [ 'base' => NULL, 'refs' => [ 'ListOfUnAuthenticatedElement$member' => NULL, ], ], '__boolean' => [ 'base' => NULL, 'refs' => [ 'CreateBackendAuthIdentityPoolConfig$UnauthenticatedLogin' => '<p>Set to true or false based on whether you want to enable guest authorization to your Amplify app.</p>', 'DeleteTokenRespObj$IsSuccess' => '<p>Indicates whether the request succeeded or failed.</p>', 'GetBackendStorageResourceConfig$Imported' => '<p>Returns True if the storage resource has been imported.</p>', 'RemoveAllBackendsReqObj$CleanAmplifyApp' => '<p>Cleans up the Amplify Console app if this value is set to true.</p>', 'UpdateBackendAuthIdentityPoolConfig$UnauthenticatedLogin' => '<p>A boolean value that can be set to allow or disallow guest-level authorization into your Amplify app.</p>', ], ], '__double' => [ 'base' => NULL, 'refs' => [ 'BackendAPIAppSyncAuthSettings$ExpirationTime' => '<p>The API key expiration time for API_KEY, if it was used as an authentication mechanism to access your data models.</p>', 'CreateBackendAuthPasswordPolicyConfig$MinimumLength' => '<p>The minimum length of the password used to access the backend of your Amplify project.</p>', 'UpdateBackendAuthPasswordPolicyConfig$MinimumLength' => '<p>Describes the minimum length of the password required to sign in to the auth resource, configured as a part of your Amplify project.</p>', ], ], '__integerMin1Max25' => [ 'base' => NULL, 'refs' => [ 'ListBackendJobReqObj$MaxResults' => '<p>The maximum number of results that you want in the response.</p>', ], ], 'ListOfBackendAPIAuthType' => [ 'base' => NULL, 'refs' => [ 'BackendAPIResourceConfig$AdditionalAuthTypes' => '<p>Additional authentication methods used to interact with your data models.</p>', ], ], 'ListOfBackendJobRespObj' => [ 'base' => NULL, 'refs' => [ 'ListBackendJobRespObj$Jobs' => '<p>An array of jobs and their properties.</p>', ], ], 'ListOfS3BucketInfo' => [ 'base' => NULL, 'refs' => [ 'ListS3BucketsRespObj$Buckets' => '<p>The list of S3 buckets.</p>', ], ], 'ListOfAdditionalConstraintsElement' => [ 'base' => NULL, 'refs' => [ 'CreateBackendAuthPasswordPolicyConfig$AdditionalConstraints' => '<p>Additional constraints for the password used to access the backend of your Amplify project.</p>', 'UpdateBackendAuthPasswordPolicyConfig$AdditionalConstraints' => '<p>Describes additional constraints on password requirements to sign in to the auth resource, configured as a part of your Amplify project.</p>', ], ], 'ListOfAuthenticatedElement' => [ 'base' => NULL, 'refs' => [ 'BackendStoragePermissions$Authenticated' => '<p>Lists all authenticated user read, write, and delete permissions for your S3 bucket.</p>', ], ], 'ListOfMfaTypesElement' => [ 'base' => NULL, 'refs' => [ 'Settings$MfaTypes' => NULL, ], ], 'ListOfOAuthScopesElement' => [ 'base' => NULL, 'refs' => [ 'CreateBackendAuthOAuthConfig$OAuthScopes' => '<p>List of OAuth-related flows used to allow your app users to authenticate from your Amplify app.</p>', 'UpdateBackendAuthOAuthConfig$OAuthScopes' => '<p>The list of OAuth-related flows that can allow users to authenticate from your Amplify app.</p>', ], ], 'ListOfRequiredSignUpAttributesElement' => [ 'base' => NULL, 'refs' => [ 'CreateBackendAuthUserPoolConfig$RequiredSignUpAttributes' => '<p>The required attributes to sign up new users in the user pool.</p>', ], ], 'ListOfUnAuthenticatedElement' => [ 'base' => NULL, 'refs' => [ 'BackendStoragePermissions$UnAuthenticated' => '<p>Lists all unauthenticated user read, write, and delete permissions for your S3 bucket.</p>', ], ], 'ListOf__string' => [ 'base' => NULL, 'refs' => [ 'CreateBackendAuthOAuthConfig$RedirectSignInURIs' => '<p>The redirected URI for signing in to your Amplify app.</p>', 'CreateBackendAuthOAuthConfig$RedirectSignOutURIs' => '<p>Redirect URLs that OAuth uses when a user signs out of an Amplify app.</p>', 'GetBackendRespObj$BackendEnvironmentList' => '<p>A list of backend environments in an array.</p>', 'UpdateBackendAuthOAuthConfig$RedirectSignInURIs' => '<p>Redirect URLs that OAuth uses when a user signs in to an Amplify app.</p>', 'UpdateBackendAuthOAuthConfig$RedirectSignOutURIs' => '<p>Redirect URLs that OAuth uses when a user signs out of an Amplify app.</p>', ], ], '__string' => [ 'base' => NULL, 'refs' => [ 'BackendAPIAppSyncAuthSettings$CognitoUserPoolId' => '<p>The Amazon Cognito user pool ID, if Amazon Cognito was used as an authentication setting to access your data models.</p>', 'BackendAPIAppSyncAuthSettings$Description' => '<p>The API key description for API_KEY, if it was used as an authentication mechanism to access your data models.</p>', 'BackendAPIAppSyncAuthSettings$OpenIDAuthTTL' => '<p>The expiry time for the OpenID authentication mechanism.</p>', 'BackendAPIAppSyncAuthSettings$OpenIDClientId' => '<p>The clientID for openID, if openID was used as an authentication setting to access your data models.</p>', 'BackendAPIAppSyncAuthSettings$OpenIDIatTTL' => '<p>The expiry time for the OpenID authentication mechanism.</p>', 'BackendAPIAppSyncAuthSettings$OpenIDIssueURL' => '<p>The openID issuer URL, if openID was used as an authentication setting to access your data models.</p>', 'BackendAPIAppSyncAuthSettings$OpenIDProviderName' => '<p>The OpenID provider name, if OpenID was used as an authentication mechanism to access your data models.</p>', 'BackendAPICodegenReqObj$ResourceName' => '<p>The name of this resource.</p>', 'BackendAPICodegenRespObj$AppId' => '<p>The app ID.</p>', 'BackendAPICodegenRespObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'BackendAPICodegenRespObj$Error' => '<p>If the request fails, this error is returned.</p>', 'BackendAPICodegenRespObj$JobId' => '<p>The ID for the job.</p>', 'BackendAPICodegenRespObj$Operation' => '<p>The name of the operation.</p>', 'BackendAPICodegenRespObj$Status' => '<p>The current status of the request.</p>', 'BackendAPIReqObj$ResourceName' => '<p>The name of this resource.</p>', 'BackendAPIResourceConfig$ApiName' => '<p>The API name used to interact with the data model, configured as a part of your Amplify project.</p>', 'BackendAPIResourceConfig$Service' => '<p>The service used to provision and interact with the data model.</p>', 'BackendAPIResourceConfig$TransformSchema' => '<p>The definition of the data model in the annotated transform of the GraphQL schema.</p>', 'BackendAPIRespObj$AppId' => '<p>The app ID.</p>', 'BackendAPIRespObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'BackendAPIRespObj$Error' => '<p>If the request fails, this error is returned.</p>', 'BackendAPIRespObj$JobId' => '<p>The ID for the job.</p>', 'BackendAPIRespObj$Operation' => '<p>The name of the operation.</p>', 'BackendAPIRespObj$Status' => '<p>The current status of the request.</p>', 'BackendAuthAppleProviderConfig$ClientId' => '<p>Describes the client_id (also called Services ID) that comes from Apple.</p>', 'BackendAuthAppleProviderConfig$KeyId' => '<p>Describes the key_id that comes from Apple.</p>', 'BackendAuthAppleProviderConfig$PrivateKey' => '<p>Describes the private_key that comes from Apple.</p>', 'BackendAuthAppleProviderConfig$TeamId' => '<p>Describes the team_id that comes from Apple.</p>', 'BackendAuthRespObj$AppId' => '<p>The app ID.</p>', 'BackendAuthRespObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'BackendAuthRespObj$Error' => '<p>If the request fails, this error is returned.</p>', 'BackendAuthRespObj$JobId' => '<p>The ID for the job.</p>', 'BackendAuthRespObj$Operation' => '<p>The name of the operation.</p>', 'BackendAuthRespObj$Status' => '<p>The current status of the request.</p>', 'BackendAuthSocialProviderConfig$ClientId' => '<p>Describes the client_id, which can be obtained from the third-party social federation provider.</p>', 'BackendAuthSocialProviderConfig$ClientSecret' => '<p>Describes the client_secret, which can be obtained from third-party social federation providers.</p>', 'BackendConfigRespObj$AppId' => '<p>The app ID.</p>', 'BackendConfigRespObj$BackendManagerAppId' => '<p>The app ID for the backend manager.</p>', 'BackendConfigRespObj$Error' => '<p>If the request fails, this error is returned.</p>', 'BackendJobReqObj$Operation' => '<p>Filters the list of response objects to include only those with the specified operation name.</p>', 'BackendJobReqObj$Status' => '<p>Filters the list of response objects to include only those with the specified status.</p>', 'BackendJobRespObj$AppId' => '<p>The app ID.</p>', 'BackendJobRespObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'BackendJobRespObj$CreateTime' => '<p>The time when the job was created.</p>', 'BackendJobRespObj$Error' => '<p>If the request fails, this error is returned.</p>', 'BackendJobRespObj$JobId' => '<p>The ID for the job.</p>', 'BackendJobRespObj$Operation' => '<p>The name of the operation.</p>', 'BackendJobRespObj$Status' => '<p>The current status of the request.</p>', 'BackendJobRespObj$UpdateTime' => '<p>The time when the job was last updated.</p>', 'BackendStorageRespObj$AppId' => '<p>The app ID.</p>', 'BackendStorageRespObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'BackendStorageRespObj$JobId' => '<p>The ID for the job.</p>', 'BackendStorageRespObj$Status' => '<p>The current status of the request.</p>', 'BadRequestException$Message' => '<p>An error message to inform that the request failed.</p>', 'CloneBackendReqObj$TargetEnvironmentName' => '<p>The name of the destination backend environment to be created.</p>', 'CloneBackendRespObj$AppId' => '<p>The app ID.</p>', 'CloneBackendRespObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'CloneBackendRespObj$Error' => '<p>If the request fails, this error is returned.</p>', 'CloneBackendRespObj$JobId' => '<p>The ID for the job.</p>', 'CloneBackendRespObj$Operation' => '<p>The name of the operation.</p>', 'CloneBackendRespObj$Status' => '<p>The current status of the request.</p>', 'CreateBackendAPIReqObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'CreateBackendAPIReqObj$ResourceName' => '<p>The name of this resource.</p>', 'CreateBackendAuthIdentityPoolConfig$IdentityPoolName' => '<p>Name of the Amazon Cognito identity pool used for authorization.</p>', 'CreateBackendAuthOAuthConfig$DomainPrefix' => '<p>The domain prefix for your Amplify app.</p>', 'CreateBackendAuthReqObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'CreateBackendAuthReqObj$ResourceName' => '<p>The name of this resource.</p>', 'CreateBackendAuthUserPoolConfig$UserPoolName' => '<p>The Amazon Cognito user pool name.</p>', 'CreateBackendConfigReqObj$BackendManagerAppId' => '<p>The app ID for the backend manager.</p>', 'CreateBackendConfigRespObj$AppId' => '<p>The app ID.</p>', 'CreateBackendConfigRespObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'CreateBackendConfigRespObj$JobId' => '<p>The ID for the job.</p>', 'CreateBackendConfigRespObj$Status' => '<p>The current status of the request.</p>', 'CreateBackendReqObj$AppId' => '<p>The app ID.</p>', 'CreateBackendReqObj$AppName' => '<p>The name of the app.</p>', 'CreateBackendReqObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'CreateBackendReqObj$ResourceName' => '<p>The name of the resource.</p>', 'CreateBackendRespObj$AppId' => '<p>The app ID.</p>', 'CreateBackendRespObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'CreateBackendRespObj$Error' => '<p>If the request fails, this error is returned.</p>', 'CreateBackendRespObj$JobId' => '<p>The ID for the job.</p>', 'CreateBackendRespObj$Operation' => '<p>The name of the operation.</p>', 'CreateBackendRespObj$Status' => '<p>The current status of the request.</p>', 'CreateBackendStorageReqObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'CreateBackendStorageReqObj$ResourceName' => '<p>The name of the storage resource.</p>', 'CreateBackendStorageResourceConfig$BucketName' => '<p>The name of the S3 bucket.</p>', 'CreateTokenRespObj$AppId' => '<p>The app ID.</p>', 'CreateTokenRespObj$ChallengeCode' => '<p>One-time challenge code for authenticating into the Amplify Admin UI.</p>', 'CreateTokenRespObj$SessionId' => '<p>A unique ID provided when creating a new challenge token.</p>', 'CreateTokenRespObj$Ttl' => '<p>The expiry time for the one-time generated token code.</p>', 'DeleteBackendRespObj$AppId' => '<p>The app ID.</p>', 'DeleteBackendRespObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'DeleteBackendRespObj$Error' => '<p>If the request fails, this error is returned.</p>', 'DeleteBackendRespObj$JobId' => '<p>The ID for the job.</p>', 'DeleteBackendRespObj$Operation' => '<p>The name of the operation.</p>', 'DeleteBackendRespObj$Status' => '<p>The current status of the request.</p>', 'EmailSettings$EmailMessage' => '<p>The contents of the email message.</p>', 'EmailSettings$EmailSubject' => '<p>The contents of the subject line of the email message.</p>', 'GetBackendAPIModelsResponse$ModelIntrospectionSchema' => '<p>Stringified JSON of the model introspection schema for an existing backend API resource.</p>', 'GetBackendAPIModelsResponse$Models' => '<p>Stringified JSON of the datastore model.</p>', 'GetBackendAPIRespObj$AppId' => '<p>The app ID.</p>', 'GetBackendAPIRespObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'GetBackendAPIRespObj$Error' => '<p>If the request fails, this error is returned.</p>', 'GetBackendAPIRespObj$ResourceName' => '<p>The name of this resource.</p>', 'GetBackendAuthReqObj$ResourceName' => '<p>The name of this resource.</p>', 'GetBackendAuthRespObj$AppId' => '<p>The app ID.</p>', 'GetBackendAuthRespObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'GetBackendAuthRespObj$Error' => '<p>If the request fails, this error is returned.</p>', 'GetBackendAuthRespObj$ResourceName' => '<p>The name of this resource.</p>', 'GetBackendReqObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'GetBackendRespObj$AmplifyFeatureFlags' => '<p>A stringified version of the cli.json file for your Amplify project.</p>', 'GetBackendRespObj$AmplifyMetaConfig' => '<p>A stringified version of the current configs for your Amplify project.</p>', 'GetBackendRespObj$AppId' => '<p>The app ID.</p>', 'GetBackendRespObj$AppName' => '<p>The name of the app.</p>', 'GetBackendRespObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'GetBackendRespObj$Error' => '<p>If the request failed, this is the returned error.</p>', 'GetBackendStorageReqObj$ResourceName' => '<p>The name of the storage resource.</p>', 'GetBackendStorageResourceConfig$BucketName' => '<p>The name of the S3 bucket.</p>', 'GetBackendStorageRespObj$AppId' => '<p>The app ID.</p>', 'GetBackendStorageRespObj$BackendEnvironmentName' => '<p>The name of the backend environment.</p>', 'GetBackendStorageRespObj$ResourceName' => '<p>The name of the storage resource.</p>', 'GetTokenRespObj$AppId' => '<p>The app ID.</p>', 'GetTokenRespObj$ChallengeCode' => '<p>The one-time challenge code for authenticating into the Amplify Admin UI.</p>', 'GetTokenRespObj$SessionId' => '<p>A unique ID provided when creating a new challenge token.</p>', 'GetTokenRespObj$Ttl' => '<p>The expiry time for the one-time generated token code.</p>', 'ImportBackendAuthReqObj$IdentityPoolId' => '<p>The ID of the Amazon Cognito identity pool.</p>', 'ImportBackendAuthReqObj$NativeClientId' => '<p>The ID of the Amazon Cognito native client.</p>', 'ImportBackendAuthReqObj$UserPoolId' => '<p>The ID of the Amazon Cognito user pool.</p>', 'ImportBackendAuthReqObj$WebClientId' => '<p>The ID of the Amazon Cognito web client.</p>', 'ImportBackendStorageReqObj$BucketName' => '<p>The name of the S3 bucket.</p>', 'InternalServiceException$Message' => '<p>An error message to inform that the request failed.</p>', 'LimitExceededException$LimitType' => '<p>The type of limit that was exceeded.</p>', 'LimitExceededException$Message' => '<p>An error message to inform that the request has failed.</p>', 'ListBackendJobReqObj$JobId' => '<p>The ID for the job.</p>', 'ListBackendJobReqObj$NextToken' => '<p>The token for the next set of results.</p>', 'ListBackendJobReqObj$Operation' => '<p>Filters the list of response objects to include only those with the specified operation name.</p>', 'ListBackendJobReqObj$Status' => '<p>Filters the list of response objects to include only those with the specified status.</p>', 'ListBackendJobRespObj$NextToken' => '<p>The token for the next set of results.</p>', 'ListS3BucketsReqObj$NextToken' => '<p>Reserved for future use.</p>', 'ListS3BucketsRespObj$NextToken' => '<p>Reserved for future use.</p>', 'LoginAuthConfigReqObj$AwsCognitoIdentityPoolId' => '<p>The Amazon Cognito identity pool ID used for the Amplify Admin UI login authorization.</p>', 'LoginAuthConfigReqObj$AwsCognitoRegion' => '<p>The AWS Region for the Amplify Admin UI login.</p>', 'LoginAuthConfigReqObj$AwsUserPoolsId' => '<p>The Amazon Cognito user pool ID used for Amplify Admin UI login authentication.</p>', 'LoginAuthConfigReqObj$AwsUserPoolsWebClientId' => '<p>The web client ID for the Amazon Cognito user pools.</p>', 'NotFoundException$Message' => '<p>An error message to inform that the request has failed.</p>', 'NotFoundException$ResourceType' => '<p>The type of resource that is not found.</p>', 'RemoveAllBackendsRespObj$AppId' => '<p>The app ID.</p>', 'RemoveAllBackendsRespObj$Error' => '<p>If the request fails, this error is returned.</p>', 'RemoveAllBackendsRespObj$JobId' => '<p>The ID for the job.</p>', 'RemoveAllBackendsRespObj$Operation' => '<p>The name of the operation.</p>', 'RemoveAllBackendsRespObj$Status' => '<p>The current status of the request.</p>', 'RemoveBackendAuthReqObj$ResourceName' => '<p>The name of this resource.</p>', 'RemoveBackendConfigRespObj$Error' => '<p>If the request fails, this error is returned.</p>', 'RemoveBackendStorageReqObj$ResourceName' => '<p>The name of the storage resource.</p>', 'S3BucketInfo$CreationDate' => '<p>The creation date of the S3 bucket.</p>', 'S3BucketInfo$Name' => '<p>The name of the S3 bucket.</p>', 'Settings$SmsMessage' => '<p>The body of the SMS message.</p>', 'SmsSettings$SmsMessage' => '<p>The contents of the SMS message.</p>', 'UpdateBackendAuthOAuthConfig$DomainPrefix' => '<p>The Amazon Cognito domain prefix used to create a hosted UI for authentication.</p>', 'UpdateBackendAuthReqObj$ResourceName' => '<p>The name of this resource.</p>', 'UpdateBackendStorageReqObj$ResourceName' => '<p>The name of the storage resource.</p>', 'ListOf__string$member' => NULL, ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplifybackend/2020-08-11/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => true, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://amplifybackend-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://amplifybackend-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://amplifybackend.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://amplifybackend.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplifybackend/2020-08-11/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.ap-south-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'ap-south-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.ap-south-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-south-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.ap-south-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'ap-south-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.ap-south-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-south-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.ca-central-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'ca-central-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.ca-central-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ca-central-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.ca-central-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'ca-central-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.ca-central-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ca-central-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.eu-central-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'eu-central-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.eu-central-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'eu-central-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.eu-central-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'eu-central-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.eu-central-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'eu-central-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.us-west-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-west-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-west-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.us-west-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-west-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.us-west-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-west-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.us-west-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-west-2', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-west-2', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.us-west-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-west-2', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-west-2', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.eu-north-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'eu-north-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.eu-north-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'eu-north-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.eu-north-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'eu-north-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.eu-north-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'eu-north-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.eu-west-3.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'eu-west-3', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.eu-west-3.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'eu-west-3', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.eu-west-3.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'eu-west-3', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.eu-west-3.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'eu-west-3', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.eu-west-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'eu-west-2', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.eu-west-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'eu-west-2', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.eu-west-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'eu-west-2', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.eu-west-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'eu-west-2', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.eu-west-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'eu-west-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.eu-west-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'eu-west-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.eu-west-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'eu-west-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.eu-west-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'eu-west-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.ap-northeast-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'ap-northeast-2', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-northeast-2', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.ap-northeast-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'ap-northeast-2', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-northeast-2', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.ap-northeast-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'ap-northeast-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-northeast-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.ap-northeast-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'ap-northeast-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-northeast-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.me-south-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'me-south-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.me-south-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'me-south-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.me-south-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'me-south-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.me-south-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'me-south-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.sa-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'sa-east-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.sa-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'sa-east-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.sa-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'sa-east-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.sa-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'sa-east-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.ap-southeast-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'ap-southeast-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-southeast-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.ap-southeast-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'ap-southeast-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-southeast-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.ap-southeast-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'ap-southeast-2', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-southeast-2', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.ap-southeast-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'ap-southeast-2', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-southeast-2', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.us-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-east-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-east-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.us-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-east-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-east-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.us-east-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-east-2', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-east-2', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.us-east-2.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-east-2', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifybackend.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-east-2', 'UseFIPS' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-east-1', 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-east-1', 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-east-1', 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplifybackend/2020-08-11/paginators-1.json\nreturn [ 'pagination' => [ 'ListBackendJobs' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'Jobs', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplifyuibuilder/2021-08-11/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2021-08-11', 'endpointPrefix' => 'amplifyuibuilder', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'AWS Amplify UI Builder', 'serviceId' => 'AmplifyUIBuilder', 'signatureVersion' => 'v4', 'signingName' => 'amplifyuibuilder', 'uid' => 'amplifyuibuilder-2021-08-11', ], 'operations' => [ 'CreateComponent' => [ 'name' => 'CreateComponent', 'http' => [ 'method' => 'POST', 'requestUri' => '/app/{appId}/environment/{environmentName}/components', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateComponentRequest', ], 'output' => [ 'shape' => 'CreateComponentResponse', ], 'errors' => [ [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ResourceConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], ], 'idempotent' => true, ], 'CreateForm' => [ 'name' => 'CreateForm', 'http' => [ 'method' => 'POST', 'requestUri' => '/app/{appId}/environment/{environmentName}/forms', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateFormRequest', ], 'output' => [ 'shape' => 'CreateFormResponse', ], 'errors' => [ [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ResourceConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], ], 'idempotent' => true, ], 'CreateTheme' => [ 'name' => 'CreateTheme', 'http' => [ 'method' => 'POST', 'requestUri' => '/app/{appId}/environment/{environmentName}/themes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateThemeRequest', ], 'output' => [ 'shape' => 'CreateThemeResponse', ], 'errors' => [ [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ResourceConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], ], 'idempotent' => true, ], 'DeleteComponent' => [ 'name' => 'DeleteComponent', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/app/{appId}/environment/{environmentName}/components/{id}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteComponentRequest', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'DeleteForm' => [ 'name' => 'DeleteForm', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/app/{appId}/environment/{environmentName}/forms/{id}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteFormRequest', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'DeleteTheme' => [ 'name' => 'DeleteTheme', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/app/{appId}/environment/{environmentName}/themes/{id}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteThemeRequest', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'ExchangeCodeForToken' => [ 'name' => 'ExchangeCodeForToken', 'http' => [ 'method' => 'POST', 'requestUri' => '/tokens/{provider}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ExchangeCodeForTokenRequest', ], 'output' => [ 'shape' => 'ExchangeCodeForTokenResponse', ], 'errors' => [ [ 'shape' => 'InvalidParameterException', ], ], ], 'ExportComponents' => [ 'name' => 'ExportComponents', 'http' => [ 'method' => 'GET', 'requestUri' => '/export/app/{appId}/environment/{environmentName}/components', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ExportComponentsRequest', ], 'output' => [ 'shape' => 'ExportComponentsResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], ], ], 'ExportForms' => [ 'name' => 'ExportForms', 'http' => [ 'method' => 'GET', 'requestUri' => '/export/app/{appId}/environment/{environmentName}/forms', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ExportFormsRequest', ], 'output' => [ 'shape' => 'ExportFormsResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], ], ], 'ExportThemes' => [ 'name' => 'ExportThemes', 'http' => [ 'method' => 'GET', 'requestUri' => '/export/app/{appId}/environment/{environmentName}/themes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ExportThemesRequest', ], 'output' => [ 'shape' => 'ExportThemesResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], ], ], 'GetCodegenJob' => [ 'name' => 'GetCodegenJob', 'http' => [ 'method' => 'GET', 'requestUri' => '/app/{appId}/environment/{environmentName}/codegen-jobs/{id}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetCodegenJobRequest', ], 'output' => [ 'shape' => 'GetCodegenJobResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetComponent' => [ 'name' => 'GetComponent', 'http' => [ 'method' => 'GET', 'requestUri' => '/app/{appId}/environment/{environmentName}/components/{id}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetComponentRequest', ], 'output' => [ 'shape' => 'GetComponentResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetForm' => [ 'name' => 'GetForm', 'http' => [ 'method' => 'GET', 'requestUri' => '/app/{appId}/environment/{environmentName}/forms/{id}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetFormRequest', ], 'output' => [ 'shape' => 'GetFormResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetMetadata' => [ 'name' => 'GetMetadata', 'http' => [ 'method' => 'GET', 'requestUri' => '/app/{appId}/environment/{environmentName}/metadata', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetMetadataRequest', ], 'output' => [ 'shape' => 'GetMetadataResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InvalidParameterException', ], ], ], 'GetTheme' => [ 'name' => 'GetTheme', 'http' => [ 'method' => 'GET', 'requestUri' => '/app/{appId}/environment/{environmentName}/themes/{id}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetThemeRequest', ], 'output' => [ 'shape' => 'GetThemeResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListCodegenJobs' => [ 'name' => 'ListCodegenJobs', 'http' => [ 'method' => 'GET', 'requestUri' => '/app/{appId}/environment/{environmentName}/codegen-jobs', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListCodegenJobsRequest', ], 'output' => [ 'shape' => 'ListCodegenJobsResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'ListComponents' => [ 'name' => 'ListComponents', 'http' => [ 'method' => 'GET', 'requestUri' => '/app/{appId}/environment/{environmentName}/components', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListComponentsRequest', ], 'output' => [ 'shape' => 'ListComponentsResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], ], ], 'ListForms' => [ 'name' => 'ListForms', 'http' => [ 'method' => 'GET', 'requestUri' => '/app/{appId}/environment/{environmentName}/forms', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListFormsRequest', ], 'output' => [ 'shape' => 'ListFormsResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], ], ], 'ListThemes' => [ 'name' => 'ListThemes', 'http' => [ 'method' => 'GET', 'requestUri' => '/app/{appId}/environment/{environmentName}/themes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListThemesRequest', ], 'output' => [ 'shape' => 'ListThemesResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], ], ], 'PutMetadataFlag' => [ 'name' => 'PutMetadataFlag', 'http' => [ 'method' => 'PUT', 'requestUri' => '/app/{appId}/environment/{environmentName}/metadata/features/{featureName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutMetadataFlagRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InvalidParameterException', ], ], ], 'RefreshToken' => [ 'name' => 'RefreshToken', 'http' => [ 'method' => 'POST', 'requestUri' => '/tokens/{provider}/refresh', 'responseCode' => 200, ], 'input' => [ 'shape' => 'RefreshTokenRequest', ], 'output' => [ 'shape' => 'RefreshTokenResponse', ], 'errors' => [ [ 'shape' => 'InvalidParameterException', ], ], ], 'StartCodegenJob' => [ 'name' => 'StartCodegenJob', 'http' => [ 'method' => 'POST', 'requestUri' => '/app/{appId}/environment/{environmentName}/codegen-jobs', 'responseCode' => 200, ], 'input' => [ 'shape' => 'StartCodegenJobRequest', ], 'output' => [ 'shape' => 'StartCodegenJobResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'UpdateComponent' => [ 'name' => 'UpdateComponent', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/app/{appId}/environment/{environmentName}/components/{id}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateComponentRequest', ], 'output' => [ 'shape' => 'UpdateComponentResponse', ], 'errors' => [ [ 'shape' => 'ResourceConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], ], 'idempotent' => true, ], 'UpdateForm' => [ 'name' => 'UpdateForm', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/app/{appId}/environment/{environmentName}/forms/{id}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateFormRequest', ], 'output' => [ 'shape' => 'UpdateFormResponse', ], 'errors' => [ [ 'shape' => 'ResourceConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], ], 'idempotent' => true, ], 'UpdateTheme' => [ 'name' => 'UpdateTheme', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/app/{appId}/environment/{environmentName}/themes/{id}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateThemeRequest', ], 'output' => [ 'shape' => 'UpdateThemeResponse', ], 'errors' => [ [ 'shape' => 'ResourceConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidParameterException', ], ], 'idempotent' => true, ], ], 'shapes' => [ 'ActionParameters' => [ 'type' => 'structure', 'members' => [ 'type' => [ 'shape' => 'ComponentProperty', ], 'url' => [ 'shape' => 'ComponentProperty', ], 'anchor' => [ 'shape' => 'ComponentProperty', ], 'target' => [ 'shape' => 'ComponentProperty', ], 'global' => [ 'shape' => 'ComponentProperty', ], 'model' => [ 'shape' => 'String', ], 'id' => [ 'shape' => 'ComponentProperty', ], 'fields' => [ 'shape' => 'ComponentProperties', ], 'state' => [ 'shape' => 'MutationActionSetStateParameter', ], ], ], 'AppId' => [ 'type' => 'string', 'max' => 20, 'min' => 1, 'pattern' => 'd[a-z0-9]+', ], 'AssociatedFieldsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'Boolean' => [ 'type' => 'boolean', 'box' => true, ], 'CodegenFeatureFlags' => [ 'type' => 'structure', 'members' => [ 'isRelationshipSupported' => [ 'shape' => 'Boolean', ], 'isNonModelSupported' => [ 'shape' => 'Boolean', ], ], ], 'CodegenGenericDataEnum' => [ 'type' => 'structure', 'required' => [ 'values', ], 'members' => [ 'values' => [ 'shape' => 'CodegenGenericDataEnumValuesList', ], ], ], 'CodegenGenericDataEnumValuesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'CodegenGenericDataEnums' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'CodegenGenericDataEnum', ], ], 'CodegenGenericDataField' => [ 'type' => 'structure', 'required' => [ 'dataType', 'dataTypeValue', 'required', 'readOnly', 'isArray', ], 'members' => [ 'dataType' => [ 'shape' => 'CodegenGenericDataFieldDataType', ], 'dataTypeValue' => [ 'shape' => 'String', ], 'required' => [ 'shape' => 'Boolean', ], 'readOnly' => [ 'shape' => 'Boolean', ], 'isArray' => [ 'shape' => 'Boolean', ], 'relationship' => [ 'shape' => 'CodegenGenericDataRelationshipType', ], ], ], 'CodegenGenericDataFieldDataType' => [ 'type' => 'string', 'enum' => [ 'ID', 'String', 'Int', 'Float', 'AWSDate', 'AWSTime', 'AWSDateTime', 'AWSTimestamp', 'AWSEmail', 'AWSURL', 'AWSIPAddress', 'Boolean', 'AWSJSON', 'AWSPhone', 'Enum', 'Model', 'NonModel', ], ], 'CodegenGenericDataFields' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'CodegenGenericDataField', ], ], 'CodegenGenericDataModel' => [ 'type' => 'structure', 'required' => [ 'fields', 'primaryKeys', ], 'members' => [ 'fields' => [ 'shape' => 'CodegenGenericDataFields', ], 'isJoinTable' => [ 'shape' => 'Boolean', ], 'primaryKeys' => [ 'shape' => 'CodegenPrimaryKeysList', ], ], ], 'CodegenGenericDataModels' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'CodegenGenericDataModel', ], ], 'CodegenGenericDataNonModel' => [ 'type' => 'structure', 'required' => [ 'fields', ], 'members' => [ 'fields' => [ 'shape' => 'CodegenGenericDataNonModelFields', ], ], ], 'CodegenGenericDataNonModelFields' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'CodegenGenericDataField', ], ], 'CodegenGenericDataNonModels' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'CodegenGenericDataNonModel', ], ], 'CodegenGenericDataRelationshipType' => [ 'type' => 'structure', 'required' => [ 'type', 'relatedModelName', ], 'members' => [ 'type' => [ 'shape' => 'GenericDataRelationshipType', ], 'relatedModelName' => [ 'shape' => 'String', ], 'relatedModelFields' => [ 'shape' => 'RelatedModelFieldsList', ], 'canUnlinkAssociatedModel' => [ 'shape' => 'Boolean', ], 'relatedJoinFieldName' => [ 'shape' => 'String', ], 'relatedJoinTableName' => [ 'shape' => 'String', ], 'belongsToFieldOnRelatedModel' => [ 'shape' => 'String', ], 'associatedFields' => [ 'shape' => 'AssociatedFieldsList', ], 'isHasManyIndex' => [ 'shape' => 'Boolean', ], ], ], 'CodegenJob' => [ 'type' => 'structure', 'required' => [ 'id', 'appId', 'environmentName', ], 'members' => [ 'id' => [ 'shape' => 'Uuid', ], 'appId' => [ 'shape' => 'AppId', ], 'environmentName' => [ 'shape' => 'String', ], 'renderConfig' => [ 'shape' => 'CodegenJobRenderConfig', ], 'genericDataSchema' => [ 'shape' => 'CodegenJobGenericDataSchema', ], 'autoGenerateForms' => [ 'shape' => 'Boolean', ], 'features' => [ 'shape' => 'CodegenFeatureFlags', ], 'status' => [ 'shape' => 'CodegenJobStatus', ], 'statusMessage' => [ 'shape' => 'String', ], 'asset' => [ 'shape' => 'CodegenJobAsset', ], 'tags' => [ 'shape' => 'Tags', ], 'createdAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], 'modifiedAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], ], ], 'CodegenJobAsset' => [ 'type' => 'structure', 'members' => [ 'downloadUrl' => [ 'shape' => 'String', ], ], ], 'CodegenJobGenericDataSchema' => [ 'type' => 'structure', 'required' => [ 'dataSourceType', 'models', 'enums', 'nonModels', ], 'members' => [ 'dataSourceType' => [ 'shape' => 'CodegenJobGenericDataSourceType', ], 'models' => [ 'shape' => 'CodegenGenericDataModels', ], 'enums' => [ 'shape' => 'CodegenGenericDataEnums', ], 'nonModels' => [ 'shape' => 'CodegenGenericDataNonModels', ], ], ], 'CodegenJobGenericDataSourceType' => [ 'type' => 'string', 'enum' => [ 'DataStore', ], ], 'CodegenJobRenderConfig' => [ 'type' => 'structure', 'members' => [ 'react' => [ 'shape' => 'ReactStartCodegenJobData', ], ], 'union' => true, ], 'CodegenJobStatus' => [ 'type' => 'string', 'enum' => [ 'in_progress', 'failed', 'succeeded', ], ], 'CodegenJobSummary' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'id', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', ], 'environmentName' => [ 'shape' => 'String', ], 'id' => [ 'shape' => 'Uuid', ], 'createdAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], 'modifiedAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], ], ], 'CodegenJobSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CodegenJobSummary', ], ], 'CodegenPrimaryKeysList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'Component' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'id', 'name', 'componentType', 'properties', 'variants', 'overrides', 'bindingProperties', 'createdAt', ], 'members' => [ 'appId' => [ 'shape' => 'String', ], 'environmentName' => [ 'shape' => 'String', ], 'sourceId' => [ 'shape' => 'String', ], 'id' => [ 'shape' => 'Uuid', ], 'name' => [ 'shape' => 'ComponentName', ], 'componentType' => [ 'shape' => 'ComponentType', ], 'properties' => [ 'shape' => 'ComponentProperties', ], 'children' => [ 'shape' => 'ComponentChildList', ], 'variants' => [ 'shape' => 'ComponentVariants', ], 'overrides' => [ 'shape' => 'ComponentOverrides', ], 'bindingProperties' => [ 'shape' => 'ComponentBindingProperties', ], 'collectionProperties' => [ 'shape' => 'ComponentCollectionProperties', ], 'createdAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], 'modifiedAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], 'tags' => [ 'shape' => 'Tags', ], 'events' => [ 'shape' => 'ComponentEvents', ], 'schemaVersion' => [ 'shape' => 'String', ], ], ], 'ComponentBindingProperties' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'ComponentBindingPropertiesValue', ], ], 'ComponentBindingPropertiesValue' => [ 'type' => 'structure', 'members' => [ 'type' => [ 'shape' => 'String', ], 'bindingProperties' => [ 'shape' => 'ComponentBindingPropertiesValueProperties', ], 'defaultValue' => [ 'shape' => 'String', ], ], ], 'ComponentBindingPropertiesValueProperties' => [ 'type' => 'structure', 'members' => [ 'model' => [ 'shape' => 'String', ], 'field' => [ 'shape' => 'String', ], 'predicates' => [ 'shape' => 'PredicateList', ], 'userAttribute' => [ 'shape' => 'String', ], 'bucket' => [ 'shape' => 'String', ], 'key' => [ 'shape' => 'String', ], 'defaultValue' => [ 'shape' => 'String', ], 'slotName' => [ 'shape' => 'String', ], ], ], 'ComponentChild' => [ 'type' => 'structure', 'required' => [ 'componentType', 'name', 'properties', ], 'members' => [ 'componentType' => [ 'shape' => 'String', ], 'name' => [ 'shape' => 'String', ], 'properties' => [ 'shape' => 'ComponentProperties', ], 'children' => [ 'shape' => 'ComponentChildList', ], 'events' => [ 'shape' => 'ComponentEvents', ], 'sourceId' => [ 'shape' => 'String', ], ], ], 'ComponentChildList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ComponentChild', ], ], 'ComponentCollectionProperties' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'ComponentDataConfiguration', ], ], 'ComponentConditionProperty' => [ 'type' => 'structure', 'members' => [ 'property' => [ 'shape' => 'String', ], 'field' => [ 'shape' => 'String', ], 'operator' => [ 'shape' => 'String', ], 'operand' => [ 'shape' => 'String', ], 'then' => [ 'shape' => 'ComponentProperty', ], 'else' => [ 'shape' => 'ComponentProperty', ], 'operandType' => [ 'shape' => 'String', ], ], ], 'ComponentDataConfiguration' => [ 'type' => 'structure', 'required' => [ 'model', ], 'members' => [ 'model' => [ 'shape' => 'String', ], 'sort' => [ 'shape' => 'SortPropertyList', ], 'predicate' => [ 'shape' => 'Predicate', ], 'identifiers' => [ 'shape' => 'IdentifierList', ], ], ], 'ComponentEvent' => [ 'type' => 'structure', 'members' => [ 'action' => [ 'shape' => 'String', ], 'parameters' => [ 'shape' => 'ActionParameters', ], 'bindingEvent' => [ 'shape' => 'String', ], ], ], 'ComponentEvents' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'ComponentEvent', ], ], 'ComponentList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Component', ], ], 'ComponentName' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'ComponentOverrides' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'ComponentOverridesValue', ], ], 'ComponentOverridesValue' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], 'ComponentProperties' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'ComponentProperty', ], ], 'ComponentProperty' => [ 'type' => 'structure', 'members' => [ 'value' => [ 'shape' => 'String', ], 'bindingProperties' => [ 'shape' => 'ComponentPropertyBindingProperties', ], 'collectionBindingProperties' => [ 'shape' => 'ComponentPropertyBindingProperties', ], 'defaultValue' => [ 'shape' => 'String', ], 'model' => [ 'shape' => 'String', ], 'bindings' => [ 'shape' => 'FormBindings', ], 'event' => [ 'shape' => 'String', ], 'userAttribute' => [ 'shape' => 'String', ], 'concat' => [ 'shape' => 'ComponentPropertyList', ], 'condition' => [ 'shape' => 'ComponentConditionProperty', ], 'configured' => [ 'shape' => 'Boolean', ], 'type' => [ 'shape' => 'String', ], 'importedValue' => [ 'shape' => 'String', ], 'componentName' => [ 'shape' => 'String', ], 'property' => [ 'shape' => 'String', ], ], ], 'ComponentPropertyBindingProperties' => [ 'type' => 'structure', 'required' => [ 'property', ], 'members' => [ 'property' => [ 'shape' => 'String', ], 'field' => [ 'shape' => 'String', ], ], ], 'ComponentPropertyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ComponentProperty', ], ], 'ComponentSummary' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'id', 'name', 'componentType', ], 'members' => [ 'appId' => [ 'shape' => 'String', ], 'environmentName' => [ 'shape' => 'String', ], 'id' => [ 'shape' => 'Uuid', ], 'name' => [ 'shape' => 'ComponentName', ], 'componentType' => [ 'shape' => 'ComponentType', ], ], ], 'ComponentSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ComponentSummary', ], ], 'ComponentType' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'ComponentVariant' => [ 'type' => 'structure', 'members' => [ 'variantValues' => [ 'shape' => 'ComponentVariantValues', ], 'overrides' => [ 'shape' => 'ComponentOverrides', ], ], ], 'ComponentVariantValues' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], 'ComponentVariants' => [ 'type' => 'list', 'member' => [ 'shape' => 'ComponentVariant', ], ], 'CreateComponentData' => [ 'type' => 'structure', 'required' => [ 'name', 'componentType', 'properties', 'variants', 'overrides', 'bindingProperties', ], 'members' => [ 'name' => [ 'shape' => 'ComponentName', ], 'sourceId' => [ 'shape' => 'String', ], 'componentType' => [ 'shape' => 'ComponentType', ], 'properties' => [ 'shape' => 'ComponentProperties', ], 'children' => [ 'shape' => 'ComponentChildList', ], 'variants' => [ 'shape' => 'ComponentVariants', ], 'overrides' => [ 'shape' => 'ComponentOverrides', ], 'bindingProperties' => [ 'shape' => 'ComponentBindingProperties', ], 'collectionProperties' => [ 'shape' => 'ComponentCollectionProperties', ], 'tags' => [ 'shape' => 'Tags', ], 'events' => [ 'shape' => 'ComponentEvents', ], 'schemaVersion' => [ 'shape' => 'String', ], ], ], 'CreateComponentRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'componentToCreate', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, 'location' => 'querystring', 'locationName' => 'clientToken', ], 'componentToCreate' => [ 'shape' => 'CreateComponentData', ], ], 'payload' => 'componentToCreate', ], 'CreateComponentResponse' => [ 'type' => 'structure', 'members' => [ 'entity' => [ 'shape' => 'Component', ], ], 'payload' => 'entity', ], 'CreateFormData' => [ 'type' => 'structure', 'required' => [ 'name', 'dataType', 'formActionType', 'fields', 'style', 'sectionalElements', 'schemaVersion', ], 'members' => [ 'name' => [ 'shape' => 'FormName', ], 'dataType' => [ 'shape' => 'FormDataTypeConfig', ], 'formActionType' => [ 'shape' => 'FormActionType', ], 'fields' => [ 'shape' => 'FieldsMap', ], 'style' => [ 'shape' => 'FormStyle', ], 'sectionalElements' => [ 'shape' => 'SectionalElementMap', ], 'schemaVersion' => [ 'shape' => 'String', ], 'cta' => [ 'shape' => 'FormCTA', ], 'tags' => [ 'shape' => 'Tags', ], 'labelDecorator' => [ 'shape' => 'LabelDecorator', ], ], ], 'CreateFormRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'formToCreate', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, 'location' => 'querystring', 'locationName' => 'clientToken', ], 'formToCreate' => [ 'shape' => 'CreateFormData', ], ], 'payload' => 'formToCreate', ], 'CreateFormResponse' => [ 'type' => 'structure', 'members' => [ 'entity' => [ 'shape' => 'Form', ], ], 'payload' => 'entity', ], 'CreateThemeData' => [ 'type' => 'structure', 'required' => [ 'name', 'values', ], 'members' => [ 'name' => [ 'shape' => 'ThemeName', ], 'values' => [ 'shape' => 'ThemeValuesList', ], 'overrides' => [ 'shape' => 'ThemeValuesList', ], 'tags' => [ 'shape' => 'Tags', ], ], ], 'CreateThemeRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'themeToCreate', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, 'location' => 'querystring', 'locationName' => 'clientToken', ], 'themeToCreate' => [ 'shape' => 'CreateThemeData', ], ], 'payload' => 'themeToCreate', ], 'CreateThemeResponse' => [ 'type' => 'structure', 'members' => [ 'entity' => [ 'shape' => 'Theme', ], ], 'payload' => 'entity', ], 'DeleteComponentRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'id', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'id' => [ 'shape' => 'Uuid', 'location' => 'uri', 'locationName' => 'id', ], ], ], 'DeleteFormRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'id', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'id' => [ 'shape' => 'Uuid', 'location' => 'uri', 'locationName' => 'id', ], ], ], 'DeleteThemeRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'id', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'id' => [ 'shape' => 'Uuid', 'location' => 'uri', 'locationName' => 'id', ], ], ], 'ExchangeCodeForTokenRequest' => [ 'type' => 'structure', 'required' => [ 'provider', 'request', ], 'members' => [ 'provider' => [ 'shape' => 'TokenProviders', 'location' => 'uri', 'locationName' => 'provider', ], 'request' => [ 'shape' => 'ExchangeCodeForTokenRequestBody', ], ], 'payload' => 'request', ], 'ExchangeCodeForTokenRequestBody' => [ 'type' => 'structure', 'required' => [ 'code', 'redirectUri', ], 'members' => [ 'code' => [ 'shape' => 'SensitiveString', ], 'redirectUri' => [ 'shape' => 'String', ], 'clientId' => [ 'shape' => 'SensitiveString', ], ], ], 'ExchangeCodeForTokenResponse' => [ 'type' => 'structure', 'required' => [ 'accessToken', 'expiresIn', 'refreshToken', ], 'members' => [ 'accessToken' => [ 'shape' => 'SensitiveString', ], 'expiresIn' => [ 'shape' => 'Integer', ], 'refreshToken' => [ 'shape' => 'SensitiveString', ], ], ], 'ExportComponentsRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'ExportComponentsResponse' => [ 'type' => 'structure', 'required' => [ 'entities', ], 'members' => [ 'entities' => [ 'shape' => 'ComponentList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'ExportFormsRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'ExportFormsResponse' => [ 'type' => 'structure', 'required' => [ 'entities', ], 'members' => [ 'entities' => [ 'shape' => 'FormList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'ExportThemesRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'ExportThemesResponse' => [ 'type' => 'structure', 'required' => [ 'entities', ], 'members' => [ 'entities' => [ 'shape' => 'ThemeList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'FeaturesMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], 'FieldConfig' => [ 'type' => 'structure', 'members' => [ 'label' => [ 'shape' => 'String', ], 'position' => [ 'shape' => 'FieldPosition', ], 'excluded' => [ 'shape' => 'Boolean', ], 'inputType' => [ 'shape' => 'FieldInputConfig', ], 'validations' => [ 'shape' => 'ValidationsList', ], ], ], 'FieldInputConfig' => [ 'type' => 'structure', 'required' => [ 'type', ], 'members' => [ 'type' => [ 'shape' => 'String', ], 'required' => [ 'shape' => 'Boolean', ], 'readOnly' => [ 'shape' => 'Boolean', ], 'placeholder' => [ 'shape' => 'String', ], 'defaultValue' => [ 'shape' => 'String', ], 'descriptiveText' => [ 'shape' => 'String', ], 'defaultChecked' => [ 'shape' => 'Boolean', ], 'defaultCountryCode' => [ 'shape' => 'String', ], 'valueMappings' => [ 'shape' => 'ValueMappings', ], 'name' => [ 'shape' => 'String', ], 'minValue' => [ 'shape' => 'Float', ], 'maxValue' => [ 'shape' => 'Float', ], 'step' => [ 'shape' => 'Float', ], 'value' => [ 'shape' => 'String', ], 'isArray' => [ 'shape' => 'Boolean', ], 'fileUploaderConfig' => [ 'shape' => 'FileUploaderFieldConfig', ], ], ], 'FieldPosition' => [ 'type' => 'structure', 'members' => [ 'fixed' => [ 'shape' => 'FixedPosition', ], 'rightOf' => [ 'shape' => 'String', ], 'below' => [ 'shape' => 'String', ], ], 'union' => true, ], 'FieldValidationConfiguration' => [ 'type' => 'structure', 'required' => [ 'type', ], 'members' => [ 'type' => [ 'shape' => 'String', ], 'strValues' => [ 'shape' => 'StrValues', ], 'numValues' => [ 'shape' => 'NumValues', ], 'validationMessage' => [ 'shape' => 'String', ], ], ], 'FieldsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'FieldConfig', ], ], 'FileUploaderFieldConfig' => [ 'type' => 'structure', 'required' => [ 'accessLevel', 'acceptedFileTypes', ], 'members' => [ 'accessLevel' => [ 'shape' => 'StorageAccessLevel', ], 'acceptedFileTypes' => [ 'shape' => 'StrValues', ], 'showThumbnails' => [ 'shape' => 'Boolean', ], 'isResumable' => [ 'shape' => 'Boolean', ], 'maxFileCount' => [ 'shape' => 'Integer', ], 'maxSize' => [ 'shape' => 'Integer', ], ], ], 'FixedPosition' => [ 'type' => 'string', 'enum' => [ 'first', ], ], 'Float' => [ 'type' => 'float', 'box' => true, ], 'Form' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'id', 'name', 'formActionType', 'style', 'dataType', 'fields', 'sectionalElements', 'schemaVersion', ], 'members' => [ 'appId' => [ 'shape' => 'String', ], 'environmentName' => [ 'shape' => 'String', ], 'id' => [ 'shape' => 'Uuid', ], 'name' => [ 'shape' => 'FormName', ], 'formActionType' => [ 'shape' => 'FormActionType', ], 'style' => [ 'shape' => 'FormStyle', ], 'dataType' => [ 'shape' => 'FormDataTypeConfig', ], 'fields' => [ 'shape' => 'FieldsMap', ], 'sectionalElements' => [ 'shape' => 'SectionalElementMap', ], 'schemaVersion' => [ 'shape' => 'String', ], 'tags' => [ 'shape' => 'Tags', ], 'cta' => [ 'shape' => 'FormCTA', ], 'labelDecorator' => [ 'shape' => 'LabelDecorator', ], ], ], 'FormActionType' => [ 'type' => 'string', 'enum' => [ 'create', 'update', ], ], 'FormBindingElement' => [ 'type' => 'structure', 'required' => [ 'element', 'property', ], 'members' => [ 'element' => [ 'shape' => 'String', ], 'property' => [ 'shape' => 'String', ], ], ], 'FormBindings' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'FormBindingElement', ], ], 'FormButton' => [ 'type' => 'structure', 'members' => [ 'excluded' => [ 'shape' => 'Boolean', ], 'children' => [ 'shape' => 'String', ], 'position' => [ 'shape' => 'FieldPosition', ], ], ], 'FormButtonsPosition' => [ 'type' => 'string', 'enum' => [ 'top', 'bottom', 'top_and_bottom', ], ], 'FormCTA' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'FormButtonsPosition', ], 'clear' => [ 'shape' => 'FormButton', ], 'cancel' => [ 'shape' => 'FormButton', ], 'submit' => [ 'shape' => 'FormButton', ], ], ], 'FormDataSourceType' => [ 'type' => 'string', 'enum' => [ 'DataStore', 'Custom', ], ], 'FormDataTypeConfig' => [ 'type' => 'structure', 'required' => [ 'dataSourceType', 'dataTypeName', ], 'members' => [ 'dataSourceType' => [ 'shape' => 'FormDataSourceType', ], 'dataTypeName' => [ 'shape' => 'String', ], ], ], 'FormInputBindingProperties' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'FormInputBindingPropertiesValue', ], ], 'FormInputBindingPropertiesValue' => [ 'type' => 'structure', 'members' => [ 'type' => [ 'shape' => 'String', ], 'bindingProperties' => [ 'shape' => 'FormInputBindingPropertiesValueProperties', ], ], ], 'FormInputBindingPropertiesValueProperties' => [ 'type' => 'structure', 'members' => [ 'model' => [ 'shape' => 'String', ], ], ], 'FormInputValueProperty' => [ 'type' => 'structure', 'members' => [ 'value' => [ 'shape' => 'String', ], 'bindingProperties' => [ 'shape' => 'FormInputValuePropertyBindingProperties', ], 'concat' => [ 'shape' => 'FormInputValuePropertyList', ], ], ], 'FormInputValuePropertyBindingProperties' => [ 'type' => 'structure', 'required' => [ 'property', ], 'members' => [ 'property' => [ 'shape' => 'String', ], 'field' => [ 'shape' => 'String', ], ], ], 'FormInputValuePropertyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'FormInputValueProperty', ], ], 'FormList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Form', ], ], 'FormName' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'FormStyle' => [ 'type' => 'structure', 'members' => [ 'horizontalGap' => [ 'shape' => 'FormStyleConfig', ], 'verticalGap' => [ 'shape' => 'FormStyleConfig', ], 'outerPadding' => [ 'shape' => 'FormStyleConfig', ], ], ], 'FormStyleConfig' => [ 'type' => 'structure', 'members' => [ 'tokenReference' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], 'union' => true, ], 'FormSummary' => [ 'type' => 'structure', 'required' => [ 'appId', 'dataType', 'environmentName', 'formActionType', 'id', 'name', ], 'members' => [ 'appId' => [ 'shape' => 'String', ], 'dataType' => [ 'shape' => 'FormDataTypeConfig', ], 'environmentName' => [ 'shape' => 'String', ], 'formActionType' => [ 'shape' => 'FormActionType', ], 'id' => [ 'shape' => 'Uuid', ], 'name' => [ 'shape' => 'FormName', ], ], ], 'FormSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'FormSummary', ], ], 'GenericDataRelationshipType' => [ 'type' => 'string', 'enum' => [ 'HAS_MANY', 'HAS_ONE', 'BELONGS_TO', ], ], 'GetCodegenJobRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'id', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'id' => [ 'shape' => 'Uuid', 'location' => 'uri', 'locationName' => 'id', ], ], ], 'GetCodegenJobResponse' => [ 'type' => 'structure', 'members' => [ 'job' => [ 'shape' => 'CodegenJob', ], ], 'payload' => 'job', ], 'GetComponentRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'id', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'id' => [ 'shape' => 'Uuid', 'location' => 'uri', 'locationName' => 'id', ], ], ], 'GetComponentResponse' => [ 'type' => 'structure', 'members' => [ 'component' => [ 'shape' => 'Component', ], ], 'payload' => 'component', ], 'GetFormRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'id', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'id' => [ 'shape' => 'Uuid', 'location' => 'uri', 'locationName' => 'id', ], ], ], 'GetFormResponse' => [ 'type' => 'structure', 'members' => [ 'form' => [ 'shape' => 'Form', ], ], 'payload' => 'form', ], 'GetMetadataRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], ], ], 'GetMetadataResponse' => [ 'type' => 'structure', 'required' => [ 'features', ], 'members' => [ 'features' => [ 'shape' => 'FeaturesMap', ], ], ], 'GetThemeRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'id', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'id' => [ 'shape' => 'Uuid', 'location' => 'uri', 'locationName' => 'id', ], ], ], 'GetThemeResponse' => [ 'type' => 'structure', 'members' => [ 'theme' => [ 'shape' => 'Theme', ], ], 'payload' => 'theme', ], 'IdentifierList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'Integer' => [ 'type' => 'integer', 'box' => true, ], 'InternalServerException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'InvalidParameterException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'JSModule' => [ 'type' => 'string', 'enum' => [ 'es2020', 'esnext', ], ], 'JSScript' => [ 'type' => 'string', 'enum' => [ 'jsx', 'tsx', 'js', ], ], 'JSTarget' => [ 'type' => 'string', 'enum' => [ 'es2015', 'es2020', ], ], 'LabelDecorator' => [ 'type' => 'string', 'enum' => [ 'required', 'optional', 'none', ], ], 'ListCodegenJobsLimit' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'ListCodegenJobsRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'ListCodegenJobsLimit', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListCodegenJobsResponse' => [ 'type' => 'structure', 'required' => [ 'entities', ], 'members' => [ 'entities' => [ 'shape' => 'CodegenJobSummaryList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'ListComponentsLimit' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'ListComponentsRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'ListComponentsLimit', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListComponentsResponse' => [ 'type' => 'structure', 'required' => [ 'entities', ], 'members' => [ 'entities' => [ 'shape' => 'ComponentSummaryList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'ListFormsLimit' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'ListFormsRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'ListFormsLimit', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListFormsResponse' => [ 'type' => 'structure', 'required' => [ 'entities', ], 'members' => [ 'entities' => [ 'shape' => 'FormSummaryList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'ListThemesLimit' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'ListThemesRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'ListThemesLimit', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListThemesResponse' => [ 'type' => 'structure', 'required' => [ 'entities', ], 'members' => [ 'entities' => [ 'shape' => 'ThemeSummaryList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'MutationActionSetStateParameter' => [ 'type' => 'structure', 'required' => [ 'componentName', 'property', 'set', ], 'members' => [ 'componentName' => [ 'shape' => 'String', ], 'property' => [ 'shape' => 'String', ], 'set' => [ 'shape' => 'ComponentProperty', ], ], ], 'NumValues' => [ 'type' => 'list', 'member' => [ 'shape' => 'Integer', ], ], 'OperandType' => [ 'type' => 'string', 'pattern' => 'boolean|string|number', ], 'Predicate' => [ 'type' => 'structure', 'members' => [ 'or' => [ 'shape' => 'PredicateList', ], 'and' => [ 'shape' => 'PredicateList', ], 'field' => [ 'shape' => 'String', ], 'operator' => [ 'shape' => 'String', ], 'operand' => [ 'shape' => 'String', ], 'operandType' => [ 'shape' => 'OperandType', ], ], ], 'PredicateList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Predicate', ], ], 'PutMetadataFlagBody' => [ 'type' => 'structure', 'required' => [ 'newValue', ], 'members' => [ 'newValue' => [ 'shape' => 'String', ], ], ], 'PutMetadataFlagRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'featureName', 'body', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'featureName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'featureName', ], 'body' => [ 'shape' => 'PutMetadataFlagBody', ], ], 'payload' => 'body', ], 'ReactStartCodegenJobData' => [ 'type' => 'structure', 'members' => [ 'module' => [ 'shape' => 'JSModule', ], 'target' => [ 'shape' => 'JSTarget', ], 'script' => [ 'shape' => 'JSScript', ], 'renderTypeDeclarations' => [ 'shape' => 'Boolean', ], 'inlineSourceMap' => [ 'shape' => 'Boolean', ], ], ], 'RefreshTokenRequest' => [ 'type' => 'structure', 'required' => [ 'provider', 'refreshTokenBody', ], 'members' => [ 'provider' => [ 'shape' => 'TokenProviders', 'location' => 'uri', 'locationName' => 'provider', ], 'refreshTokenBody' => [ 'shape' => 'RefreshTokenRequestBody', ], ], 'payload' => 'refreshTokenBody', ], 'RefreshTokenRequestBody' => [ 'type' => 'structure', 'required' => [ 'token', ], 'members' => [ 'token' => [ 'shape' => 'SensitiveString', ], 'clientId' => [ 'shape' => 'SensitiveString', ], ], ], 'RefreshTokenResponse' => [ 'type' => 'structure', 'required' => [ 'accessToken', 'expiresIn', ], 'members' => [ 'accessToken' => [ 'shape' => 'SensitiveString', ], 'expiresIn' => [ 'shape' => 'Integer', ], ], ], 'RelatedModelFieldsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'ResourceConflictException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'SectionalElement' => [ 'type' => 'structure', 'required' => [ 'type', ], 'members' => [ 'type' => [ 'shape' => 'String', ], 'position' => [ 'shape' => 'FieldPosition', ], 'text' => [ 'shape' => 'String', ], 'level' => [ 'shape' => 'Integer', ], 'orientation' => [ 'shape' => 'String', ], 'excluded' => [ 'shape' => 'Boolean', ], ], ], 'SectionalElementMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'SectionalElement', ], ], 'SensitiveString' => [ 'type' => 'string', 'sensitive' => true, ], 'ServiceQuotaExceededException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 402, 'senderFault' => true, ], 'exception' => true, ], 'SortDirection' => [ 'type' => 'string', 'enum' => [ 'ASC', 'DESC', ], ], 'SortProperty' => [ 'type' => 'structure', 'required' => [ 'field', 'direction', ], 'members' => [ 'field' => [ 'shape' => 'String', ], 'direction' => [ 'shape' => 'SortDirection', ], ], ], 'SortPropertyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SortProperty', ], ], 'StartCodegenJobData' => [ 'type' => 'structure', 'required' => [ 'renderConfig', ], 'members' => [ 'renderConfig' => [ 'shape' => 'CodegenJobRenderConfig', ], 'genericDataSchema' => [ 'shape' => 'CodegenJobGenericDataSchema', ], 'autoGenerateForms' => [ 'shape' => 'Boolean', ], 'features' => [ 'shape' => 'CodegenFeatureFlags', ], 'tags' => [ 'shape' => 'Tags', ], ], ], 'StartCodegenJobRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'codegenJobToCreate', ], 'members' => [ 'appId' => [ 'shape' => 'AppId', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, 'location' => 'querystring', 'locationName' => 'clientToken', ], 'codegenJobToCreate' => [ 'shape' => 'StartCodegenJobData', ], ], 'payload' => 'codegenJobToCreate', ], 'StartCodegenJobResponse' => [ 'type' => 'structure', 'members' => [ 'entity' => [ 'shape' => 'CodegenJob', ], ], 'payload' => 'entity', ], 'StorageAccessLevel' => [ 'type' => 'string', 'enum' => [ 'public', 'protected', 'private', ], ], 'StrValues' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'String' => [ 'type' => 'string', ], 'SyntheticTimestamp_date_time' => [ 'type' => 'timestamp', 'timestampFormat' => 'iso8601', ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '(?!aws:)[a-zA-Z+-=._:/]+', ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'Tags' => [ 'type' => 'map', 'key' => [ 'shape' => 'TagKey', ], 'value' => [ 'shape' => 'TagValue', ], ], 'Theme' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'id', 'name', 'createdAt', 'values', ], 'members' => [ 'appId' => [ 'shape' => 'String', ], 'environmentName' => [ 'shape' => 'String', ], 'id' => [ 'shape' => 'Uuid', ], 'name' => [ 'shape' => 'ThemeName', ], 'createdAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], 'modifiedAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], 'values' => [ 'shape' => 'ThemeValuesList', ], 'overrides' => [ 'shape' => 'ThemeValuesList', ], 'tags' => [ 'shape' => 'Tags', ], ], ], 'ThemeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Theme', ], ], 'ThemeName' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'ThemeSummary' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'id', 'name', ], 'members' => [ 'appId' => [ 'shape' => 'String', ], 'environmentName' => [ 'shape' => 'String', ], 'id' => [ 'shape' => 'Uuid', ], 'name' => [ 'shape' => 'ThemeName', ], ], ], 'ThemeSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ThemeSummary', ], ], 'ThemeValue' => [ 'type' => 'structure', 'members' => [ 'value' => [ 'shape' => 'String', ], 'children' => [ 'shape' => 'ThemeValuesList', ], ], ], 'ThemeValues' => [ 'type' => 'structure', 'members' => [ 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'ThemeValue', ], ], ], 'ThemeValuesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ThemeValues', ], ], 'ThrottlingException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 429, 'senderFault' => true, ], 'exception' => true, ], 'TokenProviders' => [ 'type' => 'string', 'enum' => [ 'figma', ], ], 'UnauthorizedException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 401, 'senderFault' => true, ], 'exception' => true, ], 'UpdateComponentData' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'Uuid', ], 'name' => [ 'shape' => 'ComponentName', ], 'sourceId' => [ 'shape' => 'String', ], 'componentType' => [ 'shape' => 'ComponentType', ], 'properties' => [ 'shape' => 'ComponentProperties', ], 'children' => [ 'shape' => 'ComponentChildList', ], 'variants' => [ 'shape' => 'ComponentVariants', ], 'overrides' => [ 'shape' => 'ComponentOverrides', ], 'bindingProperties' => [ 'shape' => 'ComponentBindingProperties', ], 'collectionProperties' => [ 'shape' => 'ComponentCollectionProperties', ], 'events' => [ 'shape' => 'ComponentEvents', ], 'schemaVersion' => [ 'shape' => 'String', ], ], ], 'UpdateComponentRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'id', 'updatedComponent', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'id' => [ 'shape' => 'Uuid', 'location' => 'uri', 'locationName' => 'id', ], 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, 'location' => 'querystring', 'locationName' => 'clientToken', ], 'updatedComponent' => [ 'shape' => 'UpdateComponentData', ], ], 'payload' => 'updatedComponent', ], 'UpdateComponentResponse' => [ 'type' => 'structure', 'members' => [ 'entity' => [ 'shape' => 'Component', ], ], 'payload' => 'entity', ], 'UpdateFormData' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'FormName', ], 'dataType' => [ 'shape' => 'FormDataTypeConfig', ], 'formActionType' => [ 'shape' => 'FormActionType', ], 'fields' => [ 'shape' => 'FieldsMap', ], 'style' => [ 'shape' => 'FormStyle', ], 'sectionalElements' => [ 'shape' => 'SectionalElementMap', ], 'schemaVersion' => [ 'shape' => 'String', ], 'cta' => [ 'shape' => 'FormCTA', ], 'labelDecorator' => [ 'shape' => 'LabelDecorator', ], ], ], 'UpdateFormRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'id', 'updatedForm', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'id' => [ 'shape' => 'Uuid', 'location' => 'uri', 'locationName' => 'id', ], 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, 'location' => 'querystring', 'locationName' => 'clientToken', ], 'updatedForm' => [ 'shape' => 'UpdateFormData', ], ], 'payload' => 'updatedForm', ], 'UpdateFormResponse' => [ 'type' => 'structure', 'members' => [ 'entity' => [ 'shape' => 'Form', ], ], 'payload' => 'entity', ], 'UpdateThemeData' => [ 'type' => 'structure', 'required' => [ 'values', ], 'members' => [ 'id' => [ 'shape' => 'Uuid', ], 'name' => [ 'shape' => 'ThemeName', ], 'values' => [ 'shape' => 'ThemeValuesList', ], 'overrides' => [ 'shape' => 'ThemeValuesList', ], ], ], 'UpdateThemeRequest' => [ 'type' => 'structure', 'required' => [ 'appId', 'environmentName', 'id', 'updatedTheme', ], 'members' => [ 'appId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'appId', ], 'environmentName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'environmentName', ], 'id' => [ 'shape' => 'Uuid', 'location' => 'uri', 'locationName' => 'id', ], 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, 'location' => 'querystring', 'locationName' => 'clientToken', ], 'updatedTheme' => [ 'shape' => 'UpdateThemeData', ], ], 'payload' => 'updatedTheme', ], 'UpdateThemeResponse' => [ 'type' => 'structure', 'members' => [ 'entity' => [ 'shape' => 'Theme', ], ], 'payload' => 'entity', ], 'Uuid' => [ 'type' => 'string', ], 'ValidationsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'FieldValidationConfiguration', ], ], 'ValueMapping' => [ 'type' => 'structure', 'required' => [ 'value', ], 'members' => [ 'displayValue' => [ 'shape' => 'FormInputValueProperty', ], 'value' => [ 'shape' => 'FormInputValueProperty', ], ], ], 'ValueMappingList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ValueMapping', ], ], 'ValueMappings' => [ 'type' => 'structure', 'required' => [ 'values', ], 'members' => [ 'values' => [ 'shape' => 'ValueMappingList', ], 'bindingProperties' => [ 'shape' => 'FormInputBindingProperties', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplifyuibuilder/2021-08-11/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://amplifyuibuilder-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://amplifyuibuilder-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://amplifyuibuilder.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://amplifyuibuilder.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplifyuibuilder/2021-08-11/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://amplifyuibuilder.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplifyuibuilder/2021-08-11/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplifyuibuilder/2021-08-11/paginators-1.json\nreturn [ 'pagination' => [ 'ExportComponents' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'result_key' => 'entities', ], 'ExportForms' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'result_key' => 'entities', ], 'ExportThemes' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'result_key' => 'entities', ], 'ListCodegenJobs' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'entities', ], 'ListComponents' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'entities', ], 'ListForms' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'entities', ], 'ListThemes' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'entities', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplifyuibuilder/2021-08-11/smoke.json\nreturn [ 'version' => 1, 'defaultRegion' => 'us-west-2', 'testCases' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/amplifyuibuilder/2021-08-11/waiters-2.json\nreturn [ 'version' => 2, 'waiters' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigateway/2015-07-09/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2015-07-09', 'endpointPrefix' => 'apigateway', 'protocol' => 'rest-json', 'serviceFullName' => 'Amazon API Gateway', 'serviceId' => 'API Gateway', 'signatureVersion' => 'v4', 'uid' => 'apigateway-2015-07-09', ], 'operations' => [ 'CreateApiKey' => [ 'name' => 'CreateApiKey', 'http' => [ 'method' => 'POST', 'requestUri' => '/apikeys', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateApiKeyRequest', ], 'output' => [ 'shape' => 'ApiKey', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'CreateAuthorizer' => [ 'name' => 'CreateAuthorizer', 'http' => [ 'method' => 'POST', 'requestUri' => '/restapis/{restapi_id}/authorizers', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateAuthorizerRequest', ], 'output' => [ 'shape' => 'Authorizer', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'CreateBasePathMapping' => [ 'name' => 'CreateBasePathMapping', 'http' => [ 'method' => 'POST', 'requestUri' => '/domainnames/{domain_name}/basepathmappings', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateBasePathMappingRequest', ], 'output' => [ 'shape' => 'BasePathMapping', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'CreateDeployment' => [ 'name' => 'CreateDeployment', 'http' => [ 'method' => 'POST', 'requestUri' => '/restapis/{restapi_id}/deployments', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateDeploymentRequest', ], 'output' => [ 'shape' => 'Deployment', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ServiceUnavailableException', ], ], ], 'CreateDocumentationPart' => [ 'name' => 'CreateDocumentationPart', 'http' => [ 'method' => 'POST', 'requestUri' => '/restapis/{restapi_id}/documentation/parts', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateDocumentationPartRequest', ], 'output' => [ 'shape' => 'DocumentationPart', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'CreateDocumentationVersion' => [ 'name' => 'CreateDocumentationVersion', 'http' => [ 'method' => 'POST', 'requestUri' => '/restapis/{restapi_id}/documentation/versions', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateDocumentationVersionRequest', ], 'output' => [ 'shape' => 'DocumentationVersion', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'CreateDomainName' => [ 'name' => 'CreateDomainName', 'http' => [ 'method' => 'POST', 'requestUri' => '/domainnames', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateDomainNameRequest', ], 'output' => [ 'shape' => 'DomainName', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'CreateModel' => [ 'name' => 'CreateModel', 'http' => [ 'method' => 'POST', 'requestUri' => '/restapis/{restapi_id}/models', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateModelRequest', ], 'output' => [ 'shape' => 'Model', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'CreateRequestValidator' => [ 'name' => 'CreateRequestValidator', 'http' => [ 'method' => 'POST', 'requestUri' => '/restapis/{restapi_id}/requestvalidators', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateRequestValidatorRequest', ], 'output' => [ 'shape' => 'RequestValidator', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'CreateResource' => [ 'name' => 'CreateResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/restapis/{restapi_id}/resources/{parent_id}', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateResourceRequest', ], 'output' => [ 'shape' => 'Resource', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'CreateRestApi' => [ 'name' => 'CreateRestApi', 'http' => [ 'method' => 'POST', 'requestUri' => '/restapis', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateRestApiRequest', ], 'output' => [ 'shape' => 'RestApi', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'CreateStage' => [ 'name' => 'CreateStage', 'http' => [ 'method' => 'POST', 'requestUri' => '/restapis/{restapi_id}/stages', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateStageRequest', ], 'output' => [ 'shape' => 'Stage', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'CreateUsagePlan' => [ 'name' => 'CreateUsagePlan', 'http' => [ 'method' => 'POST', 'requestUri' => '/usageplans', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateUsagePlanRequest', ], 'output' => [ 'shape' => 'UsagePlan', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'CreateUsagePlanKey' => [ 'name' => 'CreateUsagePlanKey', 'http' => [ 'method' => 'POST', 'requestUri' => '/usageplans/{usageplanId}/keys', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateUsagePlanKeyRequest', ], 'output' => [ 'shape' => 'UsagePlanKey', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'CreateVpcLink' => [ 'name' => 'CreateVpcLink', 'http' => [ 'method' => 'POST', 'requestUri' => '/vpclinks', 'responseCode' => 202, ], 'input' => [ 'shape' => 'CreateVpcLinkRequest', ], 'output' => [ 'shape' => 'VpcLink', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteApiKey' => [ 'name' => 'DeleteApiKey', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/apikeys/{api_Key}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteApiKeyRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteAuthorizer' => [ 'name' => 'DeleteAuthorizer', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/restapis/{restapi_id}/authorizers/{authorizer_id}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteAuthorizerRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteBasePathMapping' => [ 'name' => 'DeleteBasePathMapping', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/domainnames/{domain_name}/basepathmappings/{base_path}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteBasePathMappingRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteClientCertificate' => [ 'name' => 'DeleteClientCertificate', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/clientcertificates/{clientcertificate_id}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteClientCertificateRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteDeployment' => [ 'name' => 'DeleteDeployment', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/restapis/{restapi_id}/deployments/{deployment_id}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteDeploymentRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteDocumentationPart' => [ 'name' => 'DeleteDocumentationPart', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/restapis/{restapi_id}/documentation/parts/{part_id}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteDocumentationPartRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteDocumentationVersion' => [ 'name' => 'DeleteDocumentationVersion', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/restapis/{restapi_id}/documentation/versions/{doc_version}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteDocumentationVersionRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteDomainName' => [ 'name' => 'DeleteDomainName', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/domainnames/{domain_name}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteDomainNameRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteGatewayResponse' => [ 'name' => 'DeleteGatewayResponse', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/restapis/{restapi_id}/gatewayresponses/{response_type}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteGatewayResponseRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteIntegration' => [ 'name' => 'DeleteIntegration', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/integration', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteIntegrationRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteIntegrationResponse' => [ 'name' => 'DeleteIntegrationResponse', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/integration/responses/{status_code}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteIntegrationResponseRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteMethod' => [ 'name' => 'DeleteMethod', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteMethodRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ConflictException', ], ], ], 'DeleteMethodResponse' => [ 'name' => 'DeleteMethodResponse', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/responses/{status_code}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteMethodResponseRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'DeleteModel' => [ 'name' => 'DeleteModel', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/restapis/{restapi_id}/models/{model_name}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteModelRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteRequestValidator' => [ 'name' => 'DeleteRequestValidator', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/restapis/{restapi_id}/requestvalidators/{requestvalidator_id}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteRequestValidatorRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteResource' => [ 'name' => 'DeleteResource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteResourceRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteRestApi' => [ 'name' => 'DeleteRestApi', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/restapis/{restapi_id}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteRestApiRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteStage' => [ 'name' => 'DeleteStage', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/restapis/{restapi_id}/stages/{stage_name}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteStageRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteUsagePlan' => [ 'name' => 'DeleteUsagePlan', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/usageplans/{usageplanId}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteUsagePlanRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteUsagePlanKey' => [ 'name' => 'DeleteUsagePlanKey', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/usageplans/{usageplanId}/keys/{keyId}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteUsagePlanKeyRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteVpcLink' => [ 'name' => 'DeleteVpcLink', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/vpclinks/{vpclink_id}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteVpcLinkRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'FlushStageAuthorizersCache' => [ 'name' => 'FlushStageAuthorizersCache', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/restapis/{restapi_id}/stages/{stage_name}/cache/authorizers', 'responseCode' => 202, ], 'input' => [ 'shape' => 'FlushStageAuthorizersCacheRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'FlushStageCache' => [ 'name' => 'FlushStageCache', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/restapis/{restapi_id}/stages/{stage_name}/cache/data', 'responseCode' => 202, ], 'input' => [ 'shape' => 'FlushStageCacheRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GenerateClientCertificate' => [ 'name' => 'GenerateClientCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/clientcertificates', 'responseCode' => 201, ], 'input' => [ 'shape' => 'GenerateClientCertificateRequest', ], 'output' => [ 'shape' => 'ClientCertificate', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetAccount' => [ 'name' => 'GetAccount', 'http' => [ 'method' => 'GET', 'requestUri' => '/account', ], 'input' => [ 'shape' => 'GetAccountRequest', ], 'output' => [ 'shape' => 'Account', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetApiKey' => [ 'name' => 'GetApiKey', 'http' => [ 'method' => 'GET', 'requestUri' => '/apikeys/{api_Key}', ], 'input' => [ 'shape' => 'GetApiKeyRequest', ], 'output' => [ 'shape' => 'ApiKey', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetApiKeys' => [ 'name' => 'GetApiKeys', 'http' => [ 'method' => 'GET', 'requestUri' => '/apikeys', ], 'input' => [ 'shape' => 'GetApiKeysRequest', ], 'output' => [ 'shape' => 'ApiKeys', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetAuthorizer' => [ 'name' => 'GetAuthorizer', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/authorizers/{authorizer_id}', ], 'input' => [ 'shape' => 'GetAuthorizerRequest', ], 'output' => [ 'shape' => 'Authorizer', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetAuthorizers' => [ 'name' => 'GetAuthorizers', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/authorizers', ], 'input' => [ 'shape' => 'GetAuthorizersRequest', ], 'output' => [ 'shape' => 'Authorizers', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetBasePathMapping' => [ 'name' => 'GetBasePathMapping', 'http' => [ 'method' => 'GET', 'requestUri' => '/domainnames/{domain_name}/basepathmappings/{base_path}', ], 'input' => [ 'shape' => 'GetBasePathMappingRequest', ], 'output' => [ 'shape' => 'BasePathMapping', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetBasePathMappings' => [ 'name' => 'GetBasePathMappings', 'http' => [ 'method' => 'GET', 'requestUri' => '/domainnames/{domain_name}/basepathmappings', ], 'input' => [ 'shape' => 'GetBasePathMappingsRequest', ], 'output' => [ 'shape' => 'BasePathMappings', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetClientCertificate' => [ 'name' => 'GetClientCertificate', 'http' => [ 'method' => 'GET', 'requestUri' => '/clientcertificates/{clientcertificate_id}', ], 'input' => [ 'shape' => 'GetClientCertificateRequest', ], 'output' => [ 'shape' => 'ClientCertificate', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetClientCertificates' => [ 'name' => 'GetClientCertificates', 'http' => [ 'method' => 'GET', 'requestUri' => '/clientcertificates', ], 'input' => [ 'shape' => 'GetClientCertificatesRequest', ], 'output' => [ 'shape' => 'ClientCertificates', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetDeployment' => [ 'name' => 'GetDeployment', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/deployments/{deployment_id}', ], 'input' => [ 'shape' => 'GetDeploymentRequest', ], 'output' => [ 'shape' => 'Deployment', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ServiceUnavailableException', ], ], ], 'GetDeployments' => [ 'name' => 'GetDeployments', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/deployments', ], 'input' => [ 'shape' => 'GetDeploymentsRequest', ], 'output' => [ 'shape' => 'Deployments', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ServiceUnavailableException', ], ], ], 'GetDocumentationPart' => [ 'name' => 'GetDocumentationPart', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/documentation/parts/{part_id}', ], 'input' => [ 'shape' => 'GetDocumentationPartRequest', ], 'output' => [ 'shape' => 'DocumentationPart', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetDocumentationParts' => [ 'name' => 'GetDocumentationParts', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/documentation/parts', ], 'input' => [ 'shape' => 'GetDocumentationPartsRequest', ], 'output' => [ 'shape' => 'DocumentationParts', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetDocumentationVersion' => [ 'name' => 'GetDocumentationVersion', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/documentation/versions/{doc_version}', ], 'input' => [ 'shape' => 'GetDocumentationVersionRequest', ], 'output' => [ 'shape' => 'DocumentationVersion', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetDocumentationVersions' => [ 'name' => 'GetDocumentationVersions', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/documentation/versions', ], 'input' => [ 'shape' => 'GetDocumentationVersionsRequest', ], 'output' => [ 'shape' => 'DocumentationVersions', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetDomainName' => [ 'name' => 'GetDomainName', 'http' => [ 'method' => 'GET', 'requestUri' => '/domainnames/{domain_name}', ], 'input' => [ 'shape' => 'GetDomainNameRequest', ], 'output' => [ 'shape' => 'DomainName', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetDomainNames' => [ 'name' => 'GetDomainNames', 'http' => [ 'method' => 'GET', 'requestUri' => '/domainnames', ], 'input' => [ 'shape' => 'GetDomainNamesRequest', ], 'output' => [ 'shape' => 'DomainNames', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetExport' => [ 'name' => 'GetExport', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/stages/{stage_name}/exports/{export_type}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetExportRequest', ], 'output' => [ 'shape' => 'ExportResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetGatewayResponse' => [ 'name' => 'GetGatewayResponse', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/gatewayresponses/{response_type}', ], 'input' => [ 'shape' => 'GetGatewayResponseRequest', ], 'output' => [ 'shape' => 'GatewayResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetGatewayResponses' => [ 'name' => 'GetGatewayResponses', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/gatewayresponses', ], 'input' => [ 'shape' => 'GetGatewayResponsesRequest', ], 'output' => [ 'shape' => 'GatewayResponses', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetIntegration' => [ 'name' => 'GetIntegration', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/integration', ], 'input' => [ 'shape' => 'GetIntegrationRequest', ], 'output' => [ 'shape' => 'Integration', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetIntegrationResponse' => [ 'name' => 'GetIntegrationResponse', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/integration/responses/{status_code}', ], 'input' => [ 'shape' => 'GetIntegrationResponseRequest', ], 'output' => [ 'shape' => 'IntegrationResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetMethod' => [ 'name' => 'GetMethod', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}', ], 'input' => [ 'shape' => 'GetMethodRequest', ], 'output' => [ 'shape' => 'Method', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetMethodResponse' => [ 'name' => 'GetMethodResponse', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/responses/{status_code}', ], 'input' => [ 'shape' => 'GetMethodResponseRequest', ], 'output' => [ 'shape' => 'MethodResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetModel' => [ 'name' => 'GetModel', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/models/{model_name}', ], 'input' => [ 'shape' => 'GetModelRequest', ], 'output' => [ 'shape' => 'Model', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetModelTemplate' => [ 'name' => 'GetModelTemplate', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/models/{model_name}/default_template', ], 'input' => [ 'shape' => 'GetModelTemplateRequest', ], 'output' => [ 'shape' => 'Template', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetModels' => [ 'name' => 'GetModels', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/models', ], 'input' => [ 'shape' => 'GetModelsRequest', ], 'output' => [ 'shape' => 'Models', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetRequestValidator' => [ 'name' => 'GetRequestValidator', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/requestvalidators/{requestvalidator_id}', ], 'input' => [ 'shape' => 'GetRequestValidatorRequest', ], 'output' => [ 'shape' => 'RequestValidator', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetRequestValidators' => [ 'name' => 'GetRequestValidators', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/requestvalidators', ], 'input' => [ 'shape' => 'GetRequestValidatorsRequest', ], 'output' => [ 'shape' => 'RequestValidators', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetResource' => [ 'name' => 'GetResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}', ], 'input' => [ 'shape' => 'GetResourceRequest', ], 'output' => [ 'shape' => 'Resource', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetResources' => [ 'name' => 'GetResources', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/resources', ], 'input' => [ 'shape' => 'GetResourcesRequest', ], 'output' => [ 'shape' => 'Resources', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetRestApi' => [ 'name' => 'GetRestApi', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}', ], 'input' => [ 'shape' => 'GetRestApiRequest', ], 'output' => [ 'shape' => 'RestApi', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetRestApis' => [ 'name' => 'GetRestApis', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis', ], 'input' => [ 'shape' => 'GetRestApisRequest', ], 'output' => [ 'shape' => 'RestApis', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetSdk' => [ 'name' => 'GetSdk', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/stages/{stage_name}/sdks/{sdk_type}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetSdkRequest', ], 'output' => [ 'shape' => 'SdkResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetSdkType' => [ 'name' => 'GetSdkType', 'http' => [ 'method' => 'GET', 'requestUri' => '/sdktypes/{sdktype_id}', ], 'input' => [ 'shape' => 'GetSdkTypeRequest', ], 'output' => [ 'shape' => 'SdkType', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetSdkTypes' => [ 'name' => 'GetSdkTypes', 'http' => [ 'method' => 'GET', 'requestUri' => '/sdktypes', ], 'input' => [ 'shape' => 'GetSdkTypesRequest', ], 'output' => [ 'shape' => 'SdkTypes', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetStage' => [ 'name' => 'GetStage', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/stages/{stage_name}', ], 'input' => [ 'shape' => 'GetStageRequest', ], 'output' => [ 'shape' => 'Stage', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetStages' => [ 'name' => 'GetStages', 'http' => [ 'method' => 'GET', 'requestUri' => '/restapis/{restapi_id}/stages', ], 'input' => [ 'shape' => 'GetStagesRequest', ], 'output' => [ 'shape' => 'Stages', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetTags' => [ 'name' => 'GetTags', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags/{resource_arn}', ], 'input' => [ 'shape' => 'GetTagsRequest', ], 'output' => [ 'shape' => 'Tags', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetUsage' => [ 'name' => 'GetUsage', 'http' => [ 'method' => 'GET', 'requestUri' => '/usageplans/{usageplanId}/usage', ], 'input' => [ 'shape' => 'GetUsageRequest', ], 'output' => [ 'shape' => 'Usage', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetUsagePlan' => [ 'name' => 'GetUsagePlan', 'http' => [ 'method' => 'GET', 'requestUri' => '/usageplans/{usageplanId}', ], 'input' => [ 'shape' => 'GetUsagePlanRequest', ], 'output' => [ 'shape' => 'UsagePlan', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetUsagePlanKey' => [ 'name' => 'GetUsagePlanKey', 'http' => [ 'method' => 'GET', 'requestUri' => '/usageplans/{usageplanId}/keys/{keyId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetUsagePlanKeyRequest', ], 'output' => [ 'shape' => 'UsagePlanKey', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetUsagePlanKeys' => [ 'name' => 'GetUsagePlanKeys', 'http' => [ 'method' => 'GET', 'requestUri' => '/usageplans/{usageplanId}/keys', ], 'input' => [ 'shape' => 'GetUsagePlanKeysRequest', ], 'output' => [ 'shape' => 'UsagePlanKeys', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetUsagePlans' => [ 'name' => 'GetUsagePlans', 'http' => [ 'method' => 'GET', 'requestUri' => '/usageplans', ], 'input' => [ 'shape' => 'GetUsagePlansRequest', ], 'output' => [ 'shape' => 'UsagePlans', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetVpcLink' => [ 'name' => 'GetVpcLink', 'http' => [ 'method' => 'GET', 'requestUri' => '/vpclinks/{vpclink_id}', ], 'input' => [ 'shape' => 'GetVpcLinkRequest', ], 'output' => [ 'shape' => 'VpcLink', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetVpcLinks' => [ 'name' => 'GetVpcLinks', 'http' => [ 'method' => 'GET', 'requestUri' => '/vpclinks', ], 'input' => [ 'shape' => 'GetVpcLinksRequest', ], 'output' => [ 'shape' => 'VpcLinks', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'ImportApiKeys' => [ 'name' => 'ImportApiKeys', 'http' => [ 'method' => 'POST', 'requestUri' => '/apikeys?mode=import', 'responseCode' => 201, ], 'input' => [ 'shape' => 'ImportApiKeysRequest', ], 'output' => [ 'shape' => 'ApiKeyIds', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'ImportDocumentationParts' => [ 'name' => 'ImportDocumentationParts', 'http' => [ 'method' => 'PUT', 'requestUri' => '/restapis/{restapi_id}/documentation/parts', ], 'input' => [ 'shape' => 'ImportDocumentationPartsRequest', ], 'output' => [ 'shape' => 'DocumentationPartIds', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'ImportRestApi' => [ 'name' => 'ImportRestApi', 'http' => [ 'method' => 'POST', 'requestUri' => '/restapis?mode=import', 'responseCode' => 201, ], 'input' => [ 'shape' => 'ImportRestApiRequest', ], 'output' => [ 'shape' => 'RestApi', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'PutGatewayResponse' => [ 'name' => 'PutGatewayResponse', 'http' => [ 'method' => 'PUT', 'requestUri' => '/restapis/{restapi_id}/gatewayresponses/{response_type}', 'responseCode' => 201, ], 'input' => [ 'shape' => 'PutGatewayResponseRequest', ], 'output' => [ 'shape' => 'GatewayResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'PutIntegration' => [ 'name' => 'PutIntegration', 'http' => [ 'method' => 'PUT', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/integration', 'responseCode' => 201, ], 'input' => [ 'shape' => 'PutIntegrationRequest', ], 'output' => [ 'shape' => 'Integration', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'PutIntegrationResponse' => [ 'name' => 'PutIntegrationResponse', 'http' => [ 'method' => 'PUT', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/integration/responses/{status_code}', 'responseCode' => 201, ], 'input' => [ 'shape' => 'PutIntegrationResponseRequest', ], 'output' => [ 'shape' => 'IntegrationResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'PutMethod' => [ 'name' => 'PutMethod', 'http' => [ 'method' => 'PUT', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}', 'responseCode' => 201, ], 'input' => [ 'shape' => 'PutMethodRequest', ], 'output' => [ 'shape' => 'Method', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'PutMethodResponse' => [ 'name' => 'PutMethodResponse', 'http' => [ 'method' => 'PUT', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/responses/{status_code}', 'responseCode' => 201, ], 'input' => [ 'shape' => 'PutMethodResponseRequest', ], 'output' => [ 'shape' => 'MethodResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'PutRestApi' => [ 'name' => 'PutRestApi', 'http' => [ 'method' => 'PUT', 'requestUri' => '/restapis/{restapi_id}', ], 'input' => [ 'shape' => 'PutRestApiRequest', ], 'output' => [ 'shape' => 'RestApi', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'PUT', 'requestUri' => '/tags/{resource_arn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'TestInvokeAuthorizer' => [ 'name' => 'TestInvokeAuthorizer', 'http' => [ 'method' => 'POST', 'requestUri' => '/restapis/{restapi_id}/authorizers/{authorizer_id}', ], 'input' => [ 'shape' => 'TestInvokeAuthorizerRequest', ], 'output' => [ 'shape' => 'TestInvokeAuthorizerResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'TestInvokeMethod' => [ 'name' => 'TestInvokeMethod', 'http' => [ 'method' => 'POST', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}', ], 'input' => [ 'shape' => 'TestInvokeMethodRequest', ], 'output' => [ 'shape' => 'TestInvokeMethodResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/tags/{resource_arn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateAccount' => [ 'name' => 'UpdateAccount', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/account', ], 'input' => [ 'shape' => 'UpdateAccountRequest', ], 'output' => [ 'shape' => 'Account', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateApiKey' => [ 'name' => 'UpdateApiKey', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/apikeys/{api_Key}', ], 'input' => [ 'shape' => 'UpdateApiKeyRequest', ], 'output' => [ 'shape' => 'ApiKey', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateAuthorizer' => [ 'name' => 'UpdateAuthorizer', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/restapis/{restapi_id}/authorizers/{authorizer_id}', ], 'input' => [ 'shape' => 'UpdateAuthorizerRequest', ], 'output' => [ 'shape' => 'Authorizer', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateBasePathMapping' => [ 'name' => 'UpdateBasePathMapping', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/domainnames/{domain_name}/basepathmappings/{base_path}', ], 'input' => [ 'shape' => 'UpdateBasePathMappingRequest', ], 'output' => [ 'shape' => 'BasePathMapping', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateClientCertificate' => [ 'name' => 'UpdateClientCertificate', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/clientcertificates/{clientcertificate_id}', ], 'input' => [ 'shape' => 'UpdateClientCertificateRequest', ], 'output' => [ 'shape' => 'ClientCertificate', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateDeployment' => [ 'name' => 'UpdateDeployment', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/restapis/{restapi_id}/deployments/{deployment_id}', ], 'input' => [ 'shape' => 'UpdateDeploymentRequest', ], 'output' => [ 'shape' => 'Deployment', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ServiceUnavailableException', ], ], ], 'UpdateDocumentationPart' => [ 'name' => 'UpdateDocumentationPart', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/restapis/{restapi_id}/documentation/parts/{part_id}', ], 'input' => [ 'shape' => 'UpdateDocumentationPartRequest', ], 'output' => [ 'shape' => 'DocumentationPart', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateDocumentationVersion' => [ 'name' => 'UpdateDocumentationVersion', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/restapis/{restapi_id}/documentation/versions/{doc_version}', ], 'input' => [ 'shape' => 'UpdateDocumentationVersionRequest', ], 'output' => [ 'shape' => 'DocumentationVersion', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateDomainName' => [ 'name' => 'UpdateDomainName', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/domainnames/{domain_name}', ], 'input' => [ 'shape' => 'UpdateDomainNameRequest', ], 'output' => [ 'shape' => 'DomainName', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateGatewayResponse' => [ 'name' => 'UpdateGatewayResponse', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/restapis/{restapi_id}/gatewayresponses/{response_type}', ], 'input' => [ 'shape' => 'UpdateGatewayResponseRequest', ], 'output' => [ 'shape' => 'GatewayResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateIntegration' => [ 'name' => 'UpdateIntegration', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/integration', ], 'input' => [ 'shape' => 'UpdateIntegrationRequest', ], 'output' => [ 'shape' => 'Integration', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateIntegrationResponse' => [ 'name' => 'UpdateIntegrationResponse', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/integration/responses/{status_code}', ], 'input' => [ 'shape' => 'UpdateIntegrationResponseRequest', ], 'output' => [ 'shape' => 'IntegrationResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateMethod' => [ 'name' => 'UpdateMethod', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}', ], 'input' => [ 'shape' => 'UpdateMethodRequest', ], 'output' => [ 'shape' => 'Method', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateMethodResponse' => [ 'name' => 'UpdateMethodResponse', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}/responses/{status_code}', 'responseCode' => 201, ], 'input' => [ 'shape' => 'UpdateMethodResponseRequest', ], 'output' => [ 'shape' => 'MethodResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateModel' => [ 'name' => 'UpdateModel', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/restapis/{restapi_id}/models/{model_name}', ], 'input' => [ 'shape' => 'UpdateModelRequest', ], 'output' => [ 'shape' => 'Model', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateRequestValidator' => [ 'name' => 'UpdateRequestValidator', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/restapis/{restapi_id}/requestvalidators/{requestvalidator_id}', ], 'input' => [ 'shape' => 'UpdateRequestValidatorRequest', ], 'output' => [ 'shape' => 'RequestValidator', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateResource' => [ 'name' => 'UpdateResource', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/restapis/{restapi_id}/resources/{resource_id}', ], 'input' => [ 'shape' => 'UpdateResourceRequest', ], 'output' => [ 'shape' => 'Resource', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateRestApi' => [ 'name' => 'UpdateRestApi', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/restapis/{restapi_id}', ], 'input' => [ 'shape' => 'UpdateRestApiRequest', ], 'output' => [ 'shape' => 'RestApi', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateStage' => [ 'name' => 'UpdateStage', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/restapis/{restapi_id}/stages/{stage_name}', ], 'input' => [ 'shape' => 'UpdateStageRequest', ], 'output' => [ 'shape' => 'Stage', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateUsage' => [ 'name' => 'UpdateUsage', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/usageplans/{usageplanId}/keys/{keyId}/usage', ], 'input' => [ 'shape' => 'UpdateUsageRequest', ], 'output' => [ 'shape' => 'Usage', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateUsagePlan' => [ 'name' => 'UpdateUsagePlan', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/usageplans/{usageplanId}', ], 'input' => [ 'shape' => 'UpdateUsagePlanRequest', ], 'output' => [ 'shape' => 'UsagePlan', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateVpcLink' => [ 'name' => 'UpdateVpcLink', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/vpclinks/{vpclink_id}', ], 'input' => [ 'shape' => 'UpdateVpcLinkRequest', ], 'output' => [ 'shape' => 'VpcLink', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], ], 'shapes' => [ 'AccessLogSettings' => [ 'type' => 'structure', 'members' => [ 'format' => [ 'shape' => 'String', ], 'destinationArn' => [ 'shape' => 'String', ], ], ], 'Account' => [ 'type' => 'structure', 'members' => [ 'cloudwatchRoleArn' => [ 'shape' => 'String', ], 'throttleSettings' => [ 'shape' => 'ThrottleSettings', ], 'features' => [ 'shape' => 'ListOfString', ], 'apiKeyVersion' => [ 'shape' => 'String', ], ], ], 'ApiKey' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], 'name' => [ 'shape' => 'String', ], 'customerId' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'enabled' => [ 'shape' => 'Boolean', ], 'createdDate' => [ 'shape' => 'Timestamp', ], 'lastUpdatedDate' => [ 'shape' => 'Timestamp', ], 'stageKeys' => [ 'shape' => 'ListOfString', ], 'tags' => [ 'shape' => 'MapOfStringToString', ], ], ], 'ApiKeyIds' => [ 'type' => 'structure', 'members' => [ 'ids' => [ 'shape' => 'ListOfString', ], 'warnings' => [ 'shape' => 'ListOfString', ], ], ], 'ApiKeySourceType' => [ 'type' => 'string', 'enum' => [ 'HEADER', 'AUTHORIZER', ], ], 'ApiKeys' => [ 'type' => 'structure', 'members' => [ 'warnings' => [ 'shape' => 'ListOfString', ], 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfApiKey', 'locationName' => 'item', ], ], ], 'ApiKeysFormat' => [ 'type' => 'string', 'enum' => [ 'csv', ], ], 'ApiStage' => [ 'type' => 'structure', 'members' => [ 'apiId' => [ 'shape' => 'String', ], 'stage' => [ 'shape' => 'String', ], 'throttle' => [ 'shape' => 'MapOfApiStageThrottleSettings', ], ], ], 'Authorizer' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'String', ], 'name' => [ 'shape' => 'String', ], 'type' => [ 'shape' => 'AuthorizerType', ], 'providerARNs' => [ 'shape' => 'ListOfARNs', ], 'authType' => [ 'shape' => 'String', ], 'authorizerUri' => [ 'shape' => 'String', ], 'authorizerCredentials' => [ 'shape' => 'String', ], 'identitySource' => [ 'shape' => 'String', ], 'identityValidationExpression' => [ 'shape' => 'String', ], 'authorizerResultTtlInSeconds' => [ 'shape' => 'NullableInteger', ], ], ], 'AuthorizerType' => [ 'type' => 'string', 'enum' => [ 'TOKEN', 'REQUEST', 'COGNITO_USER_POOLS', ], ], 'Authorizers' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfAuthorizer', 'locationName' => 'item', ], ], ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'BasePathMapping' => [ 'type' => 'structure', 'members' => [ 'basePath' => [ 'shape' => 'String', ], 'restApiId' => [ 'shape' => 'String', ], 'stage' => [ 'shape' => 'String', ], ], ], 'BasePathMappings' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfBasePathMapping', 'locationName' => 'item', ], ], ], 'Blob' => [ 'type' => 'blob', ], 'Boolean' => [ 'type' => 'boolean', ], 'CacheClusterSize' => [ 'type' => 'string', 'enum' => [ '0.5', '1.6', '6.1', '13.5', '28.4', '58.2', '118', '237', ], ], 'CacheClusterStatus' => [ 'type' => 'string', 'enum' => [ 'CREATE_IN_PROGRESS', 'AVAILABLE', 'DELETE_IN_PROGRESS', 'NOT_AVAILABLE', 'FLUSH_IN_PROGRESS', ], ], 'CanarySettings' => [ 'type' => 'structure', 'members' => [ 'percentTraffic' => [ 'shape' => 'Double', ], 'deploymentId' => [ 'shape' => 'String', ], 'stageVariableOverrides' => [ 'shape' => 'MapOfStringToString', ], 'useStageCache' => [ 'shape' => 'Boolean', ], ], ], 'ClientCertificate' => [ 'type' => 'structure', 'members' => [ 'clientCertificateId' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'pemEncodedCertificate' => [ 'shape' => 'String', ], 'createdDate' => [ 'shape' => 'Timestamp', ], 'expirationDate' => [ 'shape' => 'Timestamp', ], 'tags' => [ 'shape' => 'MapOfStringToString', ], ], ], 'ClientCertificates' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfClientCertificate', 'locationName' => 'item', ], ], ], 'ConflictException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'ConnectionType' => [ 'type' => 'string', 'enum' => [ 'INTERNET', 'VPC_LINK', ], ], 'ContentHandlingStrategy' => [ 'type' => 'string', 'enum' => [ 'CONVERT_TO_BINARY', 'CONVERT_TO_TEXT', ], ], 'CreateApiKeyRequest' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'enabled' => [ 'shape' => 'Boolean', ], 'generateDistinctId' => [ 'shape' => 'Boolean', ], 'value' => [ 'shape' => 'String', ], 'stageKeys' => [ 'shape' => 'ListOfStageKeys', ], 'customerId' => [ 'shape' => 'String', ], 'tags' => [ 'shape' => 'MapOfStringToString', ], ], ], 'CreateAuthorizerRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'name', 'type', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'name' => [ 'shape' => 'String', ], 'type' => [ 'shape' => 'AuthorizerType', ], 'providerARNs' => [ 'shape' => 'ListOfARNs', ], 'authType' => [ 'shape' => 'String', ], 'authorizerUri' => [ 'shape' => 'String', ], 'authorizerCredentials' => [ 'shape' => 'String', ], 'identitySource' => [ 'shape' => 'String', ], 'identityValidationExpression' => [ 'shape' => 'String', ], 'authorizerResultTtlInSeconds' => [ 'shape' => 'NullableInteger', ], ], ], 'CreateBasePathMappingRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', 'restApiId', ], 'members' => [ 'domainName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'domain_name', ], 'basePath' => [ 'shape' => 'String', ], 'restApiId' => [ 'shape' => 'String', ], 'stage' => [ 'shape' => 'String', ], ], ], 'CreateDeploymentRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'stageName' => [ 'shape' => 'String', ], 'stageDescription' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'cacheClusterEnabled' => [ 'shape' => 'NullableBoolean', ], 'cacheClusterSize' => [ 'shape' => 'CacheClusterSize', ], 'variables' => [ 'shape' => 'MapOfStringToString', ], 'canarySettings' => [ 'shape' => 'DeploymentCanarySettings', ], 'tracingEnabled' => [ 'shape' => 'NullableBoolean', ], ], ], 'CreateDocumentationPartRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'location', 'properties', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'location' => [ 'shape' => 'DocumentationPartLocation', ], 'properties' => [ 'shape' => 'String', ], ], ], 'CreateDocumentationVersionRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'documentationVersion', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'documentationVersion' => [ 'shape' => 'String', ], 'stageName' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], ], ], 'CreateDomainNameRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', ], 'members' => [ 'domainName' => [ 'shape' => 'String', ], 'certificateName' => [ 'shape' => 'String', ], 'certificateBody' => [ 'shape' => 'String', ], 'certificatePrivateKey' => [ 'shape' => 'String', ], 'certificateChain' => [ 'shape' => 'String', ], 'certificateArn' => [ 'shape' => 'String', ], 'regionalCertificateName' => [ 'shape' => 'String', ], 'regionalCertificateArn' => [ 'shape' => 'String', ], 'endpointConfiguration' => [ 'shape' => 'EndpointConfiguration', ], 'tags' => [ 'shape' => 'MapOfStringToString', ], 'securityPolicy' => [ 'shape' => 'SecurityPolicy', ], 'mutualTlsAuthentication' => [ 'shape' => 'MutualTlsAuthenticationInput', ], 'ownershipVerificationCertificateArn' => [ 'shape' => 'String', ], ], ], 'CreateModelRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'name', 'contentType', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'name' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'schema' => [ 'shape' => 'String', ], 'contentType' => [ 'shape' => 'String', ], ], ], 'CreateRequestValidatorRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'name' => [ 'shape' => 'String', ], 'validateRequestBody' => [ 'shape' => 'Boolean', ], 'validateRequestParameters' => [ 'shape' => 'Boolean', ], ], ], 'CreateResourceRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'parentId', 'pathPart', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'parentId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'parent_id', ], 'pathPart' => [ 'shape' => 'String', ], ], ], 'CreateRestApiRequest' => [ 'type' => 'structure', 'required' => [ 'name', ], 'members' => [ 'name' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'version' => [ 'shape' => 'String', ], 'cloneFrom' => [ 'shape' => 'String', ], 'binaryMediaTypes' => [ 'shape' => 'ListOfString', ], 'minimumCompressionSize' => [ 'shape' => 'NullableInteger', ], 'apiKeySource' => [ 'shape' => 'ApiKeySourceType', ], 'endpointConfiguration' => [ 'shape' => 'EndpointConfiguration', ], 'policy' => [ 'shape' => 'String', ], 'tags' => [ 'shape' => 'MapOfStringToString', ], 'disableExecuteApiEndpoint' => [ 'shape' => 'Boolean', ], ], ], 'CreateStageRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'stageName', 'deploymentId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'stageName' => [ 'shape' => 'String', ], 'deploymentId' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'cacheClusterEnabled' => [ 'shape' => 'Boolean', ], 'cacheClusterSize' => [ 'shape' => 'CacheClusterSize', ], 'variables' => [ 'shape' => 'MapOfStringToString', ], 'documentationVersion' => [ 'shape' => 'String', ], 'canarySettings' => [ 'shape' => 'CanarySettings', ], 'tracingEnabled' => [ 'shape' => 'Boolean', ], 'tags' => [ 'shape' => 'MapOfStringToString', ], ], ], 'CreateUsagePlanKeyRequest' => [ 'type' => 'structure', 'required' => [ 'usagePlanId', 'keyId', 'keyType', ], 'members' => [ 'usagePlanId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'usageplanId', ], 'keyId' => [ 'shape' => 'String', ], 'keyType' => [ 'shape' => 'String', ], ], ], 'CreateUsagePlanRequest' => [ 'type' => 'structure', 'required' => [ 'name', ], 'members' => [ 'name' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'apiStages' => [ 'shape' => 'ListOfApiStage', ], 'throttle' => [ 'shape' => 'ThrottleSettings', ], 'quota' => [ 'shape' => 'QuotaSettings', ], 'tags' => [ 'shape' => 'MapOfStringToString', ], ], ], 'CreateVpcLinkRequest' => [ 'type' => 'structure', 'required' => [ 'name', 'targetArns', ], 'members' => [ 'name' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'targetArns' => [ 'shape' => 'ListOfString', ], 'tags' => [ 'shape' => 'MapOfStringToString', ], ], ], 'DeleteApiKeyRequest' => [ 'type' => 'structure', 'required' => [ 'apiKey', ], 'members' => [ 'apiKey' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'api_Key', ], ], ], 'DeleteAuthorizerRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'authorizerId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'authorizerId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'authorizer_id', ], ], ], 'DeleteBasePathMappingRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', 'basePath', ], 'members' => [ 'domainName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'domain_name', ], 'basePath' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'base_path', ], ], ], 'DeleteClientCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'clientCertificateId', ], 'members' => [ 'clientCertificateId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'clientcertificate_id', ], ], ], 'DeleteDeploymentRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'deploymentId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'deploymentId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'deployment_id', ], ], ], 'DeleteDocumentationPartRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'documentationPartId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'documentationPartId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'part_id', ], ], ], 'DeleteDocumentationVersionRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'documentationVersion', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'documentationVersion' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'doc_version', ], ], ], 'DeleteDomainNameRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', ], 'members' => [ 'domainName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'domain_name', ], ], ], 'DeleteGatewayResponseRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'responseType', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'responseType' => [ 'shape' => 'GatewayResponseType', 'location' => 'uri', 'locationName' => 'response_type', ], ], ], 'DeleteIntegrationRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], ], ], 'DeleteIntegrationResponseRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', 'statusCode', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], 'statusCode' => [ 'shape' => 'StatusCode', 'location' => 'uri', 'locationName' => 'status_code', ], ], ], 'DeleteMethodRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], ], ], 'DeleteMethodResponseRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', 'statusCode', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], 'statusCode' => [ 'shape' => 'StatusCode', 'location' => 'uri', 'locationName' => 'status_code', ], ], ], 'DeleteModelRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'modelName', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'modelName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'model_name', ], ], ], 'DeleteRequestValidatorRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'requestValidatorId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'requestValidatorId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'requestvalidator_id', ], ], ], 'DeleteResourceRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], ], ], 'DeleteRestApiRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], ], ], 'DeleteStageRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'stageName', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'stageName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'stage_name', ], ], ], 'DeleteUsagePlanKeyRequest' => [ 'type' => 'structure', 'required' => [ 'usagePlanId', 'keyId', ], 'members' => [ 'usagePlanId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'usageplanId', ], 'keyId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'keyId', ], ], ], 'DeleteUsagePlanRequest' => [ 'type' => 'structure', 'required' => [ 'usagePlanId', ], 'members' => [ 'usagePlanId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'usageplanId', ], ], ], 'DeleteVpcLinkRequest' => [ 'type' => 'structure', 'required' => [ 'vpcLinkId', ], 'members' => [ 'vpcLinkId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'vpclink_id', ], ], ], 'Deployment' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'createdDate' => [ 'shape' => 'Timestamp', ], 'apiSummary' => [ 'shape' => 'PathToMapOfMethodSnapshot', ], ], ], 'DeploymentCanarySettings' => [ 'type' => 'structure', 'members' => [ 'percentTraffic' => [ 'shape' => 'Double', ], 'stageVariableOverrides' => [ 'shape' => 'MapOfStringToString', ], 'useStageCache' => [ 'shape' => 'Boolean', ], ], ], 'Deployments' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfDeployment', 'locationName' => 'item', ], ], ], 'DocumentationPart' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'String', ], 'location' => [ 'shape' => 'DocumentationPartLocation', ], 'properties' => [ 'shape' => 'String', ], ], ], 'DocumentationPartIds' => [ 'type' => 'structure', 'members' => [ 'ids' => [ 'shape' => 'ListOfString', ], 'warnings' => [ 'shape' => 'ListOfString', ], ], ], 'DocumentationPartLocation' => [ 'type' => 'structure', 'required' => [ 'type', ], 'members' => [ 'type' => [ 'shape' => 'DocumentationPartType', ], 'path' => [ 'shape' => 'String', ], 'method' => [ 'shape' => 'String', ], 'statusCode' => [ 'shape' => 'DocumentationPartLocationStatusCode', ], 'name' => [ 'shape' => 'String', ], ], ], 'DocumentationPartLocationStatusCode' => [ 'type' => 'string', 'pattern' => '^([1-5]\\\\d\\\\d|\\\\*|\\\\s*)$', ], 'DocumentationPartType' => [ 'type' => 'string', 'enum' => [ 'API', 'AUTHORIZER', 'MODEL', 'RESOURCE', 'METHOD', 'PATH_PARAMETER', 'QUERY_PARAMETER', 'REQUEST_HEADER', 'REQUEST_BODY', 'RESPONSE', 'RESPONSE_HEADER', 'RESPONSE_BODY', ], ], 'DocumentationParts' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfDocumentationPart', 'locationName' => 'item', ], ], ], 'DocumentationVersion' => [ 'type' => 'structure', 'members' => [ 'version' => [ 'shape' => 'String', ], 'createdDate' => [ 'shape' => 'Timestamp', ], 'description' => [ 'shape' => 'String', ], ], ], 'DocumentationVersions' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfDocumentationVersion', 'locationName' => 'item', ], ], ], 'DomainName' => [ 'type' => 'structure', 'members' => [ 'domainName' => [ 'shape' => 'String', ], 'certificateName' => [ 'shape' => 'String', ], 'certificateArn' => [ 'shape' => 'String', ], 'certificateUploadDate' => [ 'shape' => 'Timestamp', ], 'regionalDomainName' => [ 'shape' => 'String', ], 'regionalHostedZoneId' => [ 'shape' => 'String', ], 'regionalCertificateName' => [ 'shape' => 'String', ], 'regionalCertificateArn' => [ 'shape' => 'String', ], 'distributionDomainName' => [ 'shape' => 'String', ], 'distributionHostedZoneId' => [ 'shape' => 'String', ], 'endpointConfiguration' => [ 'shape' => 'EndpointConfiguration', ], 'domainNameStatus' => [ 'shape' => 'DomainNameStatus', ], 'domainNameStatusMessage' => [ 'shape' => 'String', ], 'securityPolicy' => [ 'shape' => 'SecurityPolicy', ], 'tags' => [ 'shape' => 'MapOfStringToString', ], 'mutualTlsAuthentication' => [ 'shape' => 'MutualTlsAuthentication', ], 'ownershipVerificationCertificateArn' => [ 'shape' => 'String', ], ], ], 'DomainNameStatus' => [ 'type' => 'string', 'enum' => [ 'AVAILABLE', 'UPDATING', 'PENDING', 'PENDING_CERTIFICATE_REIMPORT', 'PENDING_OWNERSHIP_VERIFICATION', ], ], 'DomainNames' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfDomainName', 'locationName' => 'item', ], ], ], 'Double' => [ 'type' => 'double', ], 'EndpointConfiguration' => [ 'type' => 'structure', 'members' => [ 'types' => [ 'shape' => 'ListOfEndpointType', ], 'vpcEndpointIds' => [ 'shape' => 'ListOfString', ], ], ], 'EndpointType' => [ 'type' => 'string', 'enum' => [ 'REGIONAL', 'EDGE', 'PRIVATE', ], ], 'ExportResponse' => [ 'type' => 'structure', 'members' => [ 'contentType' => [ 'shape' => 'String', 'location' => 'header', 'locationName' => 'Content-Type', ], 'contentDisposition' => [ 'shape' => 'String', 'location' => 'header', 'locationName' => 'Content-Disposition', ], 'body' => [ 'shape' => 'Blob', ], ], 'payload' => 'body', ], 'FlushStageAuthorizersCacheRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'stageName', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'stageName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'stage_name', ], ], ], 'FlushStageCacheRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'stageName', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'stageName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'stage_name', ], ], ], 'GatewayResponse' => [ 'type' => 'structure', 'members' => [ 'responseType' => [ 'shape' => 'GatewayResponseType', ], 'statusCode' => [ 'shape' => 'StatusCode', ], 'responseParameters' => [ 'shape' => 'MapOfStringToString', ], 'responseTemplates' => [ 'shape' => 'MapOfStringToString', ], 'defaultResponse' => [ 'shape' => 'Boolean', ], ], ], 'GatewayResponseType' => [ 'type' => 'string', 'enum' => [ 'DEFAULT_4XX', 'DEFAULT_5XX', 'RESOURCE_NOT_FOUND', 'UNAUTHORIZED', 'INVALID_API_KEY', 'ACCESS_DENIED', 'AUTHORIZER_FAILURE', 'AUTHORIZER_CONFIGURATION_ERROR', 'INVALID_SIGNATURE', 'EXPIRED_TOKEN', 'MISSING_AUTHENTICATION_TOKEN', 'INTEGRATION_FAILURE', 'INTEGRATION_TIMEOUT', 'API_CONFIGURATION_ERROR', 'UNSUPPORTED_MEDIA_TYPE', 'BAD_REQUEST_PARAMETERS', 'BAD_REQUEST_BODY', 'REQUEST_TOO_LARGE', 'THROTTLED', 'QUOTA_EXCEEDED', 'WAF_FILTERED', ], ], 'GatewayResponses' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfGatewayResponse', 'locationName' => 'item', ], ], ], 'GenerateClientCertificateRequest' => [ 'type' => 'structure', 'members' => [ 'description' => [ 'shape' => 'String', ], 'tags' => [ 'shape' => 'MapOfStringToString', ], ], ], 'GetAccountRequest' => [ 'type' => 'structure', 'members' => [], ], 'GetApiKeyRequest' => [ 'type' => 'structure', 'required' => [ 'apiKey', ], 'members' => [ 'apiKey' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'api_Key', ], 'includeValue' => [ 'shape' => 'NullableBoolean', 'location' => 'querystring', 'locationName' => 'includeValue', ], ], ], 'GetApiKeysRequest' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], 'nameQuery' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'name', ], 'customerId' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'customerId', ], 'includeValues' => [ 'shape' => 'NullableBoolean', 'location' => 'querystring', 'locationName' => 'includeValues', ], ], ], 'GetAuthorizerRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'authorizerId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'authorizerId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'authorizer_id', ], ], ], 'GetAuthorizersRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], ], ], 'GetBasePathMappingRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', 'basePath', ], 'members' => [ 'domainName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'domain_name', ], 'basePath' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'base_path', ], ], ], 'GetBasePathMappingsRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', ], 'members' => [ 'domainName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'domain_name', ], 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], ], ], 'GetClientCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'clientCertificateId', ], 'members' => [ 'clientCertificateId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'clientcertificate_id', ], ], ], 'GetClientCertificatesRequest' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], ], ], 'GetDeploymentRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'deploymentId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'deploymentId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'deployment_id', ], 'embed' => [ 'shape' => 'ListOfString', 'location' => 'querystring', 'locationName' => 'embed', ], ], ], 'GetDeploymentsRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], ], ], 'GetDocumentationPartRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'documentationPartId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'documentationPartId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'part_id', ], ], ], 'GetDocumentationPartsRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'type' => [ 'shape' => 'DocumentationPartType', 'location' => 'querystring', 'locationName' => 'type', ], 'nameQuery' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'name', ], 'path' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'path', ], 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], 'locationStatus' => [ 'shape' => 'LocationStatusType', 'location' => 'querystring', 'locationName' => 'locationStatus', ], ], ], 'GetDocumentationVersionRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'documentationVersion', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'documentationVersion' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'doc_version', ], ], ], 'GetDocumentationVersionsRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], ], ], 'GetDomainNameRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', ], 'members' => [ 'domainName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'domain_name', ], ], ], 'GetDomainNamesRequest' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], ], ], 'GetExportRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'stageName', 'exportType', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'stageName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'stage_name', ], 'exportType' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'export_type', ], 'parameters' => [ 'shape' => 'MapOfStringToString', 'location' => 'querystring', ], 'accepts' => [ 'shape' => 'String', 'location' => 'header', 'locationName' => 'Accept', ], ], ], 'GetGatewayResponseRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'responseType', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'responseType' => [ 'shape' => 'GatewayResponseType', 'location' => 'uri', 'locationName' => 'response_type', ], ], ], 'GetGatewayResponsesRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], ], ], 'GetIntegrationRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], ], ], 'GetIntegrationResponseRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', 'statusCode', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], 'statusCode' => [ 'shape' => 'StatusCode', 'location' => 'uri', 'locationName' => 'status_code', ], ], ], 'GetMethodRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], ], ], 'GetMethodResponseRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', 'statusCode', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], 'statusCode' => [ 'shape' => 'StatusCode', 'location' => 'uri', 'locationName' => 'status_code', ], ], ], 'GetModelRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'modelName', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'modelName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'model_name', ], 'flatten' => [ 'shape' => 'Boolean', 'location' => 'querystring', 'locationName' => 'flatten', ], ], ], 'GetModelTemplateRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'modelName', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'modelName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'model_name', ], ], ], 'GetModelsRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], ], ], 'GetRequestValidatorRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'requestValidatorId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'requestValidatorId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'requestvalidator_id', ], ], ], 'GetRequestValidatorsRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], ], ], 'GetResourceRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'embed' => [ 'shape' => 'ListOfString', 'location' => 'querystring', 'locationName' => 'embed', ], ], ], 'GetResourcesRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], 'embed' => [ 'shape' => 'ListOfString', 'location' => 'querystring', 'locationName' => 'embed', ], ], ], 'GetRestApiRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], ], ], 'GetRestApisRequest' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], ], ], 'GetSdkRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'stageName', 'sdkType', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'stageName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'stage_name', ], 'sdkType' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'sdk_type', ], 'parameters' => [ 'shape' => 'MapOfStringToString', 'location' => 'querystring', ], ], ], 'GetSdkTypeRequest' => [ 'type' => 'structure', 'required' => [ 'id', ], 'members' => [ 'id' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'sdktype_id', ], ], ], 'GetSdkTypesRequest' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], ], ], 'GetStageRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'stageName', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'stageName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'stage_name', ], ], ], 'GetStagesRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'deploymentId' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'deploymentId', ], ], ], 'GetTagsRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', ], 'members' => [ 'resourceArn' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_arn', ], 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], ], ], 'GetUsagePlanKeyRequest' => [ 'type' => 'structure', 'required' => [ 'usagePlanId', 'keyId', ], 'members' => [ 'usagePlanId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'usageplanId', ], 'keyId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'keyId', ], ], ], 'GetUsagePlanKeysRequest' => [ 'type' => 'structure', 'required' => [ 'usagePlanId', ], 'members' => [ 'usagePlanId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'usageplanId', ], 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], 'nameQuery' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'name', ], ], ], 'GetUsagePlanRequest' => [ 'type' => 'structure', 'required' => [ 'usagePlanId', ], 'members' => [ 'usagePlanId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'usageplanId', ], ], ], 'GetUsagePlansRequest' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'keyId' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'keyId', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], ], ], 'GetUsageRequest' => [ 'type' => 'structure', 'required' => [ 'usagePlanId', 'startDate', 'endDate', ], 'members' => [ 'usagePlanId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'usageplanId', ], 'keyId' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'keyId', ], 'startDate' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'startDate', ], 'endDate' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'endDate', ], 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], ], ], 'GetVpcLinkRequest' => [ 'type' => 'structure', 'required' => [ 'vpcLinkId', ], 'members' => [ 'vpcLinkId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'vpclink_id', ], ], ], 'GetVpcLinksRequest' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'position', ], 'limit' => [ 'shape' => 'NullableInteger', 'location' => 'querystring', 'locationName' => 'limit', ], ], ], 'ImportApiKeysRequest' => [ 'type' => 'structure', 'required' => [ 'body', 'format', ], 'members' => [ 'body' => [ 'shape' => 'Blob', ], 'format' => [ 'shape' => 'ApiKeysFormat', 'location' => 'querystring', 'locationName' => 'format', ], 'failOnWarnings' => [ 'shape' => 'Boolean', 'location' => 'querystring', 'locationName' => 'failonwarnings', ], ], 'payload' => 'body', ], 'ImportDocumentationPartsRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'body', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'mode' => [ 'shape' => 'PutMode', 'location' => 'querystring', 'locationName' => 'mode', ], 'failOnWarnings' => [ 'shape' => 'Boolean', 'location' => 'querystring', 'locationName' => 'failonwarnings', ], 'body' => [ 'shape' => 'Blob', ], ], 'payload' => 'body', ], 'ImportRestApiRequest' => [ 'type' => 'structure', 'required' => [ 'body', ], 'members' => [ 'failOnWarnings' => [ 'shape' => 'Boolean', 'location' => 'querystring', 'locationName' => 'failonwarnings', ], 'parameters' => [ 'shape' => 'MapOfStringToString', 'location' => 'querystring', ], 'body' => [ 'shape' => 'Blob', ], ], 'payload' => 'body', ], 'Integer' => [ 'type' => 'integer', ], 'Integration' => [ 'type' => 'structure', 'members' => [ 'type' => [ 'shape' => 'IntegrationType', ], 'httpMethod' => [ 'shape' => 'String', ], 'uri' => [ 'shape' => 'String', ], 'connectionType' => [ 'shape' => 'ConnectionType', ], 'connectionId' => [ 'shape' => 'String', ], 'credentials' => [ 'shape' => 'String', ], 'requestParameters' => [ 'shape' => 'MapOfStringToString', ], 'requestTemplates' => [ 'shape' => 'MapOfStringToString', ], 'passthroughBehavior' => [ 'shape' => 'String', ], 'contentHandling' => [ 'shape' => 'ContentHandlingStrategy', ], 'timeoutInMillis' => [ 'shape' => 'Integer', ], 'cacheNamespace' => [ 'shape' => 'String', ], 'cacheKeyParameters' => [ 'shape' => 'ListOfString', ], 'integrationResponses' => [ 'shape' => 'MapOfIntegrationResponse', ], 'tlsConfig' => [ 'shape' => 'TlsConfig', ], ], ], 'IntegrationResponse' => [ 'type' => 'structure', 'members' => [ 'statusCode' => [ 'shape' => 'StatusCode', ], 'selectionPattern' => [ 'shape' => 'String', ], 'responseParameters' => [ 'shape' => 'MapOfStringToString', ], 'responseTemplates' => [ 'shape' => 'MapOfStringToString', ], 'contentHandling' => [ 'shape' => 'ContentHandlingStrategy', ], ], ], 'IntegrationType' => [ 'type' => 'string', 'enum' => [ 'HTTP', 'AWS', 'MOCK', 'HTTP_PROXY', 'AWS_PROXY', ], ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'retryAfterSeconds' => [ 'shape' => 'String', 'location' => 'header', 'locationName' => 'Retry-After', ], 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], 'ListOfARNs' => [ 'type' => 'list', 'member' => [ 'shape' => 'ProviderARN', ], ], 'ListOfApiKey' => [ 'type' => 'list', 'member' => [ 'shape' => 'ApiKey', ], ], 'ListOfApiStage' => [ 'type' => 'list', 'member' => [ 'shape' => 'ApiStage', ], ], 'ListOfAuthorizer' => [ 'type' => 'list', 'member' => [ 'shape' => 'Authorizer', ], ], 'ListOfBasePathMapping' => [ 'type' => 'list', 'member' => [ 'shape' => 'BasePathMapping', ], ], 'ListOfClientCertificate' => [ 'type' => 'list', 'member' => [ 'shape' => 'ClientCertificate', ], ], 'ListOfDeployment' => [ 'type' => 'list', 'member' => [ 'shape' => 'Deployment', ], ], 'ListOfDocumentationPart' => [ 'type' => 'list', 'member' => [ 'shape' => 'DocumentationPart', ], ], 'ListOfDocumentationVersion' => [ 'type' => 'list', 'member' => [ 'shape' => 'DocumentationVersion', ], ], 'ListOfDomainName' => [ 'type' => 'list', 'member' => [ 'shape' => 'DomainName', ], ], 'ListOfEndpointType' => [ 'type' => 'list', 'member' => [ 'shape' => 'EndpointType', ], ], 'ListOfGatewayResponse' => [ 'type' => 'list', 'member' => [ 'shape' => 'GatewayResponse', ], ], 'ListOfLong' => [ 'type' => 'list', 'member' => [ 'shape' => 'Long', ], ], 'ListOfModel' => [ 'type' => 'list', 'member' => [ 'shape' => 'Model', ], ], 'ListOfPatchOperation' => [ 'type' => 'list', 'member' => [ 'shape' => 'PatchOperation', ], ], 'ListOfRequestValidator' => [ 'type' => 'list', 'member' => [ 'shape' => 'RequestValidator', ], ], 'ListOfResource' => [ 'type' => 'list', 'member' => [ 'shape' => 'Resource', ], ], 'ListOfRestApi' => [ 'type' => 'list', 'member' => [ 'shape' => 'RestApi', ], ], 'ListOfSdkConfigurationProperty' => [ 'type' => 'list', 'member' => [ 'shape' => 'SdkConfigurationProperty', ], ], 'ListOfSdkType' => [ 'type' => 'list', 'member' => [ 'shape' => 'SdkType', ], ], 'ListOfStage' => [ 'type' => 'list', 'member' => [ 'shape' => 'Stage', ], ], 'ListOfStageKeys' => [ 'type' => 'list', 'member' => [ 'shape' => 'StageKey', ], ], 'ListOfString' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'ListOfUsage' => [ 'type' => 'list', 'member' => [ 'shape' => 'ListOfLong', ], ], 'ListOfUsagePlan' => [ 'type' => 'list', 'member' => [ 'shape' => 'UsagePlan', ], ], 'ListOfUsagePlanKey' => [ 'type' => 'list', 'member' => [ 'shape' => 'UsagePlanKey', ], ], 'ListOfVpcLink' => [ 'type' => 'list', 'member' => [ 'shape' => 'VpcLink', ], ], 'LocationStatusType' => [ 'type' => 'string', 'enum' => [ 'DOCUMENTED', 'UNDOCUMENTED', ], ], 'Long' => [ 'type' => 'long', ], 'MapOfApiStageThrottleSettings' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'ThrottleSettings', ], ], 'MapOfIntegrationResponse' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'IntegrationResponse', ], ], 'MapOfKeyUsages' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'ListOfUsage', ], ], 'MapOfMethod' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'Method', ], ], 'MapOfMethodResponse' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'MethodResponse', ], ], 'MapOfMethodSettings' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'MethodSetting', ], ], 'MapOfMethodSnapshot' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'MethodSnapshot', ], ], 'MapOfStringToBoolean' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'NullableBoolean', ], ], 'MapOfStringToList' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'ListOfString', ], ], 'MapOfStringToString' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], 'Method' => [ 'type' => 'structure', 'members' => [ 'httpMethod' => [ 'shape' => 'String', ], 'authorizationType' => [ 'shape' => 'String', ], 'authorizerId' => [ 'shape' => 'String', ], 'apiKeyRequired' => [ 'shape' => 'NullableBoolean', ], 'requestValidatorId' => [ 'shape' => 'String', ], 'operationName' => [ 'shape' => 'String', ], 'requestParameters' => [ 'shape' => 'MapOfStringToBoolean', ], 'requestModels' => [ 'shape' => 'MapOfStringToString', ], 'methodResponses' => [ 'shape' => 'MapOfMethodResponse', ], 'methodIntegration' => [ 'shape' => 'Integration', ], 'authorizationScopes' => [ 'shape' => 'ListOfString', ], ], ], 'MethodResponse' => [ 'type' => 'structure', 'members' => [ 'statusCode' => [ 'shape' => 'StatusCode', ], 'responseParameters' => [ 'shape' => 'MapOfStringToBoolean', ], 'responseModels' => [ 'shape' => 'MapOfStringToString', ], ], ], 'MethodSetting' => [ 'type' => 'structure', 'members' => [ 'metricsEnabled' => [ 'shape' => 'Boolean', ], 'loggingLevel' => [ 'shape' => 'String', ], 'dataTraceEnabled' => [ 'shape' => 'Boolean', ], 'throttlingBurstLimit' => [ 'shape' => 'Integer', ], 'throttlingRateLimit' => [ 'shape' => 'Double', ], 'cachingEnabled' => [ 'shape' => 'Boolean', ], 'cacheTtlInSeconds' => [ 'shape' => 'Integer', ], 'cacheDataEncrypted' => [ 'shape' => 'Boolean', ], 'requireAuthorizationForCacheControl' => [ 'shape' => 'Boolean', ], 'unauthorizedCacheControlHeaderStrategy' => [ 'shape' => 'UnauthorizedCacheControlHeaderStrategy', ], ], ], 'MethodSnapshot' => [ 'type' => 'structure', 'members' => [ 'authorizationType' => [ 'shape' => 'String', ], 'apiKeyRequired' => [ 'shape' => 'Boolean', ], ], ], 'Model' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'String', ], 'name' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'schema' => [ 'shape' => 'String', ], 'contentType' => [ 'shape' => 'String', ], ], ], 'Models' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfModel', 'locationName' => 'item', ], ], ], 'MutualTlsAuthentication' => [ 'type' => 'structure', 'members' => [ 'truststoreUri' => [ 'shape' => 'String', ], 'truststoreVersion' => [ 'shape' => 'String', ], 'truststoreWarnings' => [ 'shape' => 'ListOfString', ], ], ], 'MutualTlsAuthenticationInput' => [ 'type' => 'structure', 'members' => [ 'truststoreUri' => [ 'shape' => 'String', ], 'truststoreVersion' => [ 'shape' => 'String', ], ], ], 'NotFoundException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'NullableBoolean' => [ 'type' => 'boolean', ], 'NullableInteger' => [ 'type' => 'integer', ], 'Op' => [ 'type' => 'string', 'enum' => [ 'add', 'remove', 'replace', 'move', 'copy', 'test', ], ], 'PatchOperation' => [ 'type' => 'structure', 'members' => [ 'op' => [ 'shape' => 'Op', ], 'path' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], 'from' => [ 'shape' => 'String', ], ], ], 'PathToMapOfMethodSnapshot' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'MapOfMethodSnapshot', ], ], 'ProviderARN' => [ 'type' => 'string', ], 'PutGatewayResponseRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'responseType', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'responseType' => [ 'shape' => 'GatewayResponseType', 'location' => 'uri', 'locationName' => 'response_type', ], 'statusCode' => [ 'shape' => 'StatusCode', ], 'responseParameters' => [ 'shape' => 'MapOfStringToString', ], 'responseTemplates' => [ 'shape' => 'MapOfStringToString', ], ], ], 'PutIntegrationRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', 'type', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], 'type' => [ 'shape' => 'IntegrationType', ], 'integrationHttpMethod' => [ 'shape' => 'String', 'locationName' => 'httpMethod', ], 'uri' => [ 'shape' => 'String', ], 'connectionType' => [ 'shape' => 'ConnectionType', ], 'connectionId' => [ 'shape' => 'String', ], 'credentials' => [ 'shape' => 'String', ], 'requestParameters' => [ 'shape' => 'MapOfStringToString', ], 'requestTemplates' => [ 'shape' => 'MapOfStringToString', ], 'passthroughBehavior' => [ 'shape' => 'String', ], 'cacheNamespace' => [ 'shape' => 'String', ], 'cacheKeyParameters' => [ 'shape' => 'ListOfString', ], 'contentHandling' => [ 'shape' => 'ContentHandlingStrategy', ], 'timeoutInMillis' => [ 'shape' => 'NullableInteger', ], 'tlsConfig' => [ 'shape' => 'TlsConfig', ], ], ], 'PutIntegrationResponseRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', 'statusCode', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], 'statusCode' => [ 'shape' => 'StatusCode', 'location' => 'uri', 'locationName' => 'status_code', ], 'selectionPattern' => [ 'shape' => 'String', ], 'responseParameters' => [ 'shape' => 'MapOfStringToString', ], 'responseTemplates' => [ 'shape' => 'MapOfStringToString', ], 'contentHandling' => [ 'shape' => 'ContentHandlingStrategy', ], ], ], 'PutMethodRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', 'authorizationType', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], 'authorizationType' => [ 'shape' => 'String', ], 'authorizerId' => [ 'shape' => 'String', ], 'apiKeyRequired' => [ 'shape' => 'Boolean', ], 'operationName' => [ 'shape' => 'String', ], 'requestParameters' => [ 'shape' => 'MapOfStringToBoolean', ], 'requestModels' => [ 'shape' => 'MapOfStringToString', ], 'requestValidatorId' => [ 'shape' => 'String', ], 'authorizationScopes' => [ 'shape' => 'ListOfString', ], ], ], 'PutMethodResponseRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', 'statusCode', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], 'statusCode' => [ 'shape' => 'StatusCode', 'location' => 'uri', 'locationName' => 'status_code', ], 'responseParameters' => [ 'shape' => 'MapOfStringToBoolean', ], 'responseModels' => [ 'shape' => 'MapOfStringToString', ], ], ], 'PutMode' => [ 'type' => 'string', 'enum' => [ 'merge', 'overwrite', ], ], 'PutRestApiRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'body', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'mode' => [ 'shape' => 'PutMode', 'location' => 'querystring', 'locationName' => 'mode', ], 'failOnWarnings' => [ 'shape' => 'Boolean', 'location' => 'querystring', 'locationName' => 'failonwarnings', ], 'parameters' => [ 'shape' => 'MapOfStringToString', 'location' => 'querystring', ], 'body' => [ 'shape' => 'Blob', ], ], 'payload' => 'body', ], 'QuotaPeriodType' => [ 'type' => 'string', 'enum' => [ 'DAY', 'WEEK', 'MONTH', ], ], 'QuotaSettings' => [ 'type' => 'structure', 'members' => [ 'limit' => [ 'shape' => 'Integer', ], 'offset' => [ 'shape' => 'Integer', ], 'period' => [ 'shape' => 'QuotaPeriodType', ], ], ], 'RequestValidator' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'String', ], 'name' => [ 'shape' => 'String', ], 'validateRequestBody' => [ 'shape' => 'Boolean', ], 'validateRequestParameters' => [ 'shape' => 'Boolean', ], ], ], 'RequestValidators' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfRequestValidator', 'locationName' => 'item', ], ], ], 'Resource' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'String', ], 'parentId' => [ 'shape' => 'String', ], 'pathPart' => [ 'shape' => 'String', ], 'path' => [ 'shape' => 'String', ], 'resourceMethods' => [ 'shape' => 'MapOfMethod', ], ], ], 'Resources' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfResource', 'locationName' => 'item', ], ], ], 'RestApi' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'String', ], 'name' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'createdDate' => [ 'shape' => 'Timestamp', ], 'version' => [ 'shape' => 'String', ], 'warnings' => [ 'shape' => 'ListOfString', ], 'binaryMediaTypes' => [ 'shape' => 'ListOfString', ], 'minimumCompressionSize' => [ 'shape' => 'NullableInteger', ], 'apiKeySource' => [ 'shape' => 'ApiKeySourceType', ], 'endpointConfiguration' => [ 'shape' => 'EndpointConfiguration', ], 'policy' => [ 'shape' => 'String', ], 'tags' => [ 'shape' => 'MapOfStringToString', ], 'disableExecuteApiEndpoint' => [ 'shape' => 'Boolean', ], ], ], 'RestApis' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfRestApi', 'locationName' => 'item', ], ], ], 'SdkConfigurationProperty' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'String', ], 'friendlyName' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'required' => [ 'shape' => 'Boolean', ], 'defaultValue' => [ 'shape' => 'String', ], ], ], 'SdkResponse' => [ 'type' => 'structure', 'members' => [ 'contentType' => [ 'shape' => 'String', 'location' => 'header', 'locationName' => 'Content-Type', ], 'contentDisposition' => [ 'shape' => 'String', 'location' => 'header', 'locationName' => 'Content-Disposition', ], 'body' => [ 'shape' => 'Blob', ], ], 'payload' => 'body', ], 'SdkType' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'String', ], 'friendlyName' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'configurationProperties' => [ 'shape' => 'ListOfSdkConfigurationProperty', ], ], ], 'SdkTypes' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfSdkType', 'locationName' => 'item', ], ], ], 'SecurityPolicy' => [ 'type' => 'string', 'enum' => [ 'TLS_1_0', 'TLS_1_2', ], ], 'ServiceUnavailableException' => [ 'type' => 'structure', 'members' => [ 'retryAfterSeconds' => [ 'shape' => 'String', 'location' => 'header', 'locationName' => 'Retry-After', ], 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], 'Stage' => [ 'type' => 'structure', 'members' => [ 'deploymentId' => [ 'shape' => 'String', ], 'clientCertificateId' => [ 'shape' => 'String', ], 'stageName' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'cacheClusterEnabled' => [ 'shape' => 'Boolean', ], 'cacheClusterSize' => [ 'shape' => 'CacheClusterSize', ], 'cacheClusterStatus' => [ 'shape' => 'CacheClusterStatus', ], 'methodSettings' => [ 'shape' => 'MapOfMethodSettings', ], 'variables' => [ 'shape' => 'MapOfStringToString', ], 'documentationVersion' => [ 'shape' => 'String', ], 'accessLogSettings' => [ 'shape' => 'AccessLogSettings', ], 'canarySettings' => [ 'shape' => 'CanarySettings', ], 'tracingEnabled' => [ 'shape' => 'Boolean', ], 'webAclArn' => [ 'shape' => 'String', ], 'tags' => [ 'shape' => 'MapOfStringToString', ], 'createdDate' => [ 'shape' => 'Timestamp', ], 'lastUpdatedDate' => [ 'shape' => 'Timestamp', ], ], ], 'StageKey' => [ 'type' => 'structure', 'members' => [ 'restApiId' => [ 'shape' => 'String', ], 'stageName' => [ 'shape' => 'String', ], ], ], 'Stages' => [ 'type' => 'structure', 'members' => [ 'item' => [ 'shape' => 'ListOfStage', ], ], ], 'StatusCode' => [ 'type' => 'string', 'pattern' => '[1-5]\\\\d\\\\d', ], 'String' => [ 'type' => 'string', ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tags', ], 'members' => [ 'resourceArn' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_arn', ], 'tags' => [ 'shape' => 'MapOfStringToString', ], ], ], 'Tags' => [ 'type' => 'structure', 'members' => [ 'tags' => [ 'shape' => 'MapOfStringToString', ], ], ], 'Template' => [ 'type' => 'structure', 'members' => [ 'value' => [ 'shape' => 'String', ], ], ], 'TestInvokeAuthorizerRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'authorizerId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'authorizerId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'authorizer_id', ], 'headers' => [ 'shape' => 'MapOfStringToString', ], 'multiValueHeaders' => [ 'shape' => 'MapOfStringToList', ], 'pathWithQueryString' => [ 'shape' => 'String', ], 'body' => [ 'shape' => 'String', ], 'stageVariables' => [ 'shape' => 'MapOfStringToString', ], 'additionalContext' => [ 'shape' => 'MapOfStringToString', ], ], ], 'TestInvokeAuthorizerResponse' => [ 'type' => 'structure', 'members' => [ 'clientStatus' => [ 'shape' => 'Integer', ], 'log' => [ 'shape' => 'String', ], 'latency' => [ 'shape' => 'Long', ], 'principalId' => [ 'shape' => 'String', ], 'policy' => [ 'shape' => 'String', ], 'authorization' => [ 'shape' => 'MapOfStringToList', ], 'claims' => [ 'shape' => 'MapOfStringToString', ], ], ], 'TestInvokeMethodRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], 'pathWithQueryString' => [ 'shape' => 'String', ], 'body' => [ 'shape' => 'String', ], 'headers' => [ 'shape' => 'MapOfStringToString', ], 'multiValueHeaders' => [ 'shape' => 'MapOfStringToList', ], 'clientCertificateId' => [ 'shape' => 'String', ], 'stageVariables' => [ 'shape' => 'MapOfStringToString', ], ], ], 'TestInvokeMethodResponse' => [ 'type' => 'structure', 'members' => [ 'status' => [ 'shape' => 'Integer', ], 'body' => [ 'shape' => 'String', ], 'headers' => [ 'shape' => 'MapOfStringToString', ], 'multiValueHeaders' => [ 'shape' => 'MapOfStringToList', ], 'log' => [ 'shape' => 'String', ], 'latency' => [ 'shape' => 'Long', ], ], ], 'ThrottleSettings' => [ 'type' => 'structure', 'members' => [ 'burstLimit' => [ 'shape' => 'Integer', ], 'rateLimit' => [ 'shape' => 'Double', ], ], ], 'Timestamp' => [ 'type' => 'timestamp', ], 'TlsConfig' => [ 'type' => 'structure', 'members' => [ 'insecureSkipVerification' => [ 'shape' => 'Boolean', ], ], ], 'TooManyRequestsException' => [ 'type' => 'structure', 'members' => [ 'retryAfterSeconds' => [ 'shape' => 'String', 'location' => 'header', 'locationName' => 'Retry-After', ], 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], 'UnauthorizedCacheControlHeaderStrategy' => [ 'type' => 'string', 'enum' => [ 'FAIL_WITH_403', 'SUCCEED_WITH_RESPONSE_HEADER', 'SUCCEED_WITHOUT_RESPONSE_HEADER', ], ], 'UnauthorizedException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tagKeys', ], 'members' => [ 'resourceArn' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_arn', ], 'tagKeys' => [ 'shape' => 'ListOfString', 'location' => 'querystring', 'locationName' => 'tagKeys', ], ], ], 'UpdateAccountRequest' => [ 'type' => 'structure', 'members' => [ 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateApiKeyRequest' => [ 'type' => 'structure', 'required' => [ 'apiKey', ], 'members' => [ 'apiKey' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'api_Key', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateAuthorizerRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'authorizerId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'authorizerId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'authorizer_id', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateBasePathMappingRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', 'basePath', ], 'members' => [ 'domainName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'domain_name', ], 'basePath' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'base_path', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateClientCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'clientCertificateId', ], 'members' => [ 'clientCertificateId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'clientcertificate_id', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateDeploymentRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'deploymentId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'deploymentId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'deployment_id', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateDocumentationPartRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'documentationPartId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'documentationPartId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'part_id', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateDocumentationVersionRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'documentationVersion', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'documentationVersion' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'doc_version', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateDomainNameRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', ], 'members' => [ 'domainName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'domain_name', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateGatewayResponseRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'responseType', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'responseType' => [ 'shape' => 'GatewayResponseType', 'location' => 'uri', 'locationName' => 'response_type', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateIntegrationRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateIntegrationResponseRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', 'statusCode', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], 'statusCode' => [ 'shape' => 'StatusCode', 'location' => 'uri', 'locationName' => 'status_code', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateMethodRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateMethodResponseRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', 'httpMethod', 'statusCode', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'httpMethod' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'http_method', ], 'statusCode' => [ 'shape' => 'StatusCode', 'location' => 'uri', 'locationName' => 'status_code', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateModelRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'modelName', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'modelName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'model_name', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateRequestValidatorRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'requestValidatorId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'requestValidatorId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'requestvalidator_id', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateResourceRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'resourceId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'resourceId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resource_id', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateRestApiRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateStageRequest' => [ 'type' => 'structure', 'required' => [ 'restApiId', 'stageName', ], 'members' => [ 'restApiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'restapi_id', ], 'stageName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'stage_name', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateUsagePlanRequest' => [ 'type' => 'structure', 'required' => [ 'usagePlanId', ], 'members' => [ 'usagePlanId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'usageplanId', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateUsageRequest' => [ 'type' => 'structure', 'required' => [ 'usagePlanId', 'keyId', ], 'members' => [ 'usagePlanId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'usageplanId', ], 'keyId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'keyId', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'UpdateVpcLinkRequest' => [ 'type' => 'structure', 'required' => [ 'vpcLinkId', ], 'members' => [ 'vpcLinkId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'vpclink_id', ], 'patchOperations' => [ 'shape' => 'ListOfPatchOperation', ], ], ], 'Usage' => [ 'type' => 'structure', 'members' => [ 'usagePlanId' => [ 'shape' => 'String', ], 'startDate' => [ 'shape' => 'String', ], 'endDate' => [ 'shape' => 'String', ], 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'MapOfKeyUsages', 'locationName' => 'values', ], ], ], 'UsagePlan' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'String', ], 'name' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'apiStages' => [ 'shape' => 'ListOfApiStage', ], 'throttle' => [ 'shape' => 'ThrottleSettings', ], 'quota' => [ 'shape' => 'QuotaSettings', ], 'productCode' => [ 'shape' => 'String', ], 'tags' => [ 'shape' => 'MapOfStringToString', ], ], ], 'UsagePlanKey' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'String', ], 'type' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], 'name' => [ 'shape' => 'String', ], ], ], 'UsagePlanKeys' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfUsagePlanKey', 'locationName' => 'item', ], ], ], 'UsagePlans' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfUsagePlan', 'locationName' => 'item', ], ], ], 'VpcLink' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'String', ], 'name' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'targetArns' => [ 'shape' => 'ListOfString', ], 'status' => [ 'shape' => 'VpcLinkStatus', ], 'statusMessage' => [ 'shape' => 'String', ], 'tags' => [ 'shape' => 'MapOfStringToString', ], ], ], 'VpcLinkStatus' => [ 'type' => 'string', 'enum' => [ 'AVAILABLE', 'PENDING', 'DELETING', 'FAILED', ], ], 'VpcLinks' => [ 'type' => 'structure', 'members' => [ 'position' => [ 'shape' => 'String', ], 'items' => [ 'shape' => 'ListOfVpcLink', 'locationName' => 'item', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigateway/2015-07-09/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<fullname>Amazon API Gateway</fullname> <p>Amazon API Gateway helps developers deliver robust, secure, and scalable mobile and web application back ends. API Gateway allows developers to securely connect mobile and web applications to APIs that run on AWS Lambda, Amazon EC2, or other publicly addressable web services that are hosted outside of AWS.</p>', 'operations' => [ 'CreateApiKey' => '<p>Create an ApiKey resource. </p>', 'CreateAuthorizer' => '<p>Adds a new Authorizer resource to an existing RestApi resource.</p>', 'CreateBasePathMapping' => '<p>Creates a new BasePathMapping resource.</p>', 'CreateDeployment' => '<p>Creates a Deployment resource, which makes a specified RestApi callable over the internet.</p>', 'CreateDocumentationPart' => '<p>Creates a documentation part.</p>', 'CreateDocumentationVersion' => '<p>Creates a documentation version</p>', 'CreateDomainName' => '<p>Creates a new domain name.</p>', 'CreateModel' => '<p>Adds a new Model resource to an existing RestApi resource.</p>', 'CreateRequestValidator' => '<p>Creates a RequestValidator of a given RestApi.</p>', 'CreateResource' => '<p>Creates a Resource resource.</p>', 'CreateRestApi' => '<p>Creates a new RestApi resource.</p>', 'CreateStage' => '<p>Creates a new Stage resource that references a pre-existing Deployment for the API. </p>', 'CreateUsagePlan' => '<p>Creates a usage plan with the throttle and quota limits, as well as the associated API stages, specified in the payload. </p>', 'CreateUsagePlanKey' => '<p>Creates a usage plan key for adding an existing API key to a usage plan.</p>', 'CreateVpcLink' => '<p>Creates a VPC link, under the caller\\'s account in a selected region, in an asynchronous operation that typically takes 2-4 minutes to complete and become operational. The caller must have permissions to create and update VPC Endpoint services.</p>', 'DeleteApiKey' => '<p>Deletes the ApiKey resource.</p>', 'DeleteAuthorizer' => '<p>Deletes an existing Authorizer resource.</p>', 'DeleteBasePathMapping' => '<p>Deletes the BasePathMapping resource.</p>', 'DeleteClientCertificate' => '<p>Deletes the ClientCertificate resource.</p>', 'DeleteDeployment' => '<p>Deletes a Deployment resource. Deleting a deployment will only succeed if there are no Stage resources associated with it.</p>', 'DeleteDocumentationPart' => '<p>Deletes a documentation part</p>', 'DeleteDocumentationVersion' => '<p>Deletes a documentation version.</p>', 'DeleteDomainName' => '<p>Deletes the DomainName resource.</p>', 'DeleteGatewayResponse' => '<p>Clears any customization of a GatewayResponse of a specified response type on the given RestApi and resets it with the default settings.</p>', 'DeleteIntegration' => '<p>Represents a delete integration.</p>', 'DeleteIntegrationResponse' => '<p>Represents a delete integration response.</p>', 'DeleteMethod' => '<p>Deletes an existing Method resource.</p>', 'DeleteMethodResponse' => '<p>Deletes an existing MethodResponse resource.</p>', 'DeleteModel' => '<p>Deletes a model.</p>', 'DeleteRequestValidator' => '<p>Deletes a RequestValidator of a given RestApi.</p>', 'DeleteResource' => '<p>Deletes a Resource resource.</p>', 'DeleteRestApi' => '<p>Deletes the specified API.</p>', 'DeleteStage' => '<p>Deletes a Stage resource.</p>', 'DeleteUsagePlan' => '<p>Deletes a usage plan of a given plan Id.</p>', 'DeleteUsagePlanKey' => '<p>Deletes a usage plan key and remove the underlying API key from the associated usage plan.</p>', 'DeleteVpcLink' => '<p>Deletes an existing VpcLink of a specified identifier.</p>', 'FlushStageAuthorizersCache' => '<p>Flushes all authorizer cache entries on a stage.</p>', 'FlushStageCache' => '<p>Flushes a stage\\'s cache.</p>', 'GenerateClientCertificate' => '<p>Generates a ClientCertificate resource.</p>', 'GetAccount' => '<p>Gets information about the current Account resource.</p>', 'GetApiKey' => '<p>Gets information about the current ApiKey resource.</p>', 'GetApiKeys' => '<p>Gets information about the current ApiKeys resource.</p>', 'GetAuthorizer' => '<p>Describe an existing Authorizer resource.</p>', 'GetAuthorizers' => '<p>Describe an existing Authorizers resource.</p>', 'GetBasePathMapping' => '<p>Describe a BasePathMapping resource.</p>', 'GetBasePathMappings' => '<p>Represents a collection of BasePathMapping resources.</p>', 'GetClientCertificate' => '<p>Gets information about the current ClientCertificate resource.</p>', 'GetClientCertificates' => '<p>Gets a collection of ClientCertificate resources.</p>', 'GetDeployment' => '<p>Gets information about a Deployment resource.</p>', 'GetDeployments' => '<p>Gets information about a Deployments collection.</p>', 'GetDocumentationPart' => '<p>Gets a documentation part.</p>', 'GetDocumentationParts' => '<p>Gets documentation parts.</p>', 'GetDocumentationVersion' => '<p>Gets a documentation version.</p>', 'GetDocumentationVersions' => '<p>Gets documentation versions.</p>', 'GetDomainName' => '<p>Represents a domain name that is contained in a simpler, more intuitive URL that can be called.</p>', 'GetDomainNames' => '<p>Represents a collection of DomainName resources.</p>', 'GetExport' => '<p>Exports a deployed version of a RestApi in a specified format.</p>', 'GetGatewayResponse' => '<p>Gets a GatewayResponse of a specified response type on the given RestApi.</p>', 'GetGatewayResponses' => '<p>Gets the GatewayResponses collection on the given RestApi. If an API developer has not added any definitions for gateway responses, the result will be the API Gateway-generated default GatewayResponses collection for the supported response types.</p>', 'GetIntegration' => '<p>Get the integration settings.</p>', 'GetIntegrationResponse' => '<p>Represents a get integration response.</p>', 'GetMethod' => '<p>Describe an existing Method resource.</p>', 'GetMethodResponse' => '<p>Describes a MethodResponse resource.</p>', 'GetModel' => '<p>Describes an existing model defined for a RestApi resource.</p>', 'GetModelTemplate' => '<p>Generates a sample mapping template that can be used to transform a payload into the structure of a model.</p>', 'GetModels' => '<p>Describes existing Models defined for a RestApi resource.</p>', 'GetRequestValidator' => '<p>Gets a RequestValidator of a given RestApi.</p>', 'GetRequestValidators' => '<p>Gets the RequestValidators collection of a given RestApi.</p>', 'GetResource' => '<p>Lists information about a resource.</p>', 'GetResources' => '<p>Lists information about a collection of Resource resources.</p>', 'GetRestApi' => '<p>Lists the RestApi resource in the collection.</p>', 'GetRestApis' => '<p>Lists the RestApis resources for your collection.</p>', 'GetSdk' => '<p>Generates a client SDK for a RestApi and Stage.</p>', 'GetSdkType' => '<p>Gets an SDK type.</p>', 'GetSdkTypes' => '<p>Gets SDK types</p>', 'GetStage' => '<p>Gets information about a Stage resource.</p>', 'GetStages' => '<p>Gets information about one or more Stage resources.</p>', 'GetTags' => '<p>Gets the Tags collection for a given resource.</p>', 'GetUsage' => '<p>Gets the usage data of a usage plan in a specified time interval.</p>', 'GetUsagePlan' => '<p>Gets a usage plan of a given plan identifier.</p>', 'GetUsagePlanKey' => '<p>Gets a usage plan key of a given key identifier.</p>', 'GetUsagePlanKeys' => '<p>Gets all the usage plan keys representing the API keys added to a specified usage plan.</p>', 'GetUsagePlans' => '<p>Gets all the usage plans of the caller\\'s account.</p>', 'GetVpcLink' => '<p>Gets a specified VPC link under the caller\\'s account in a region.</p>', 'GetVpcLinks' => '<p>Gets the VpcLinks collection under the caller\\'s account in a selected region.</p>', 'ImportApiKeys' => '<p>Import API keys from an external source, such as a CSV-formatted file.</p>', 'ImportDocumentationParts' => '<p>Imports documentation parts</p>', 'ImportRestApi' => '<p>A feature of the API Gateway control service for creating a new API from an external API definition file.</p>', 'PutGatewayResponse' => '<p>Creates a customization of a GatewayResponse of a specified response type and status code on the given RestApi.</p>', 'PutIntegration' => '<p>Sets up a method\\'s integration.</p>', 'PutIntegrationResponse' => '<p>Represents a put integration.</p>', 'PutMethod' => '<p>Add a method to an existing Resource resource.</p>', 'PutMethodResponse' => '<p>Adds a MethodResponse to an existing Method resource.</p>', 'PutRestApi' => '<p>A feature of the API Gateway control service for updating an existing API with an input of external API definitions. The update can take the form of merging the supplied definition into the existing API or overwriting the existing API.</p>', 'TagResource' => '<p>Adds or updates a tag on a given resource.</p>', 'TestInvokeAuthorizer' => '<p>Simulate the execution of an Authorizer in your RestApi with headers, parameters, and an incoming request body.</p>', 'TestInvokeMethod' => '<p>Simulate the invocation of a Method in your RestApi with headers, parameters, and an incoming request body.</p>', 'UntagResource' => '<p>Removes a tag from a given resource.</p>', 'UpdateAccount' => '<p>Changes information about the current Account resource.</p>', 'UpdateApiKey' => '<p>Changes information about an ApiKey resource.</p>', 'UpdateAuthorizer' => '<p>Updates an existing Authorizer resource.</p>', 'UpdateBasePathMapping' => '<p>Changes information about the BasePathMapping resource.</p>', 'UpdateClientCertificate' => '<p>Changes information about an ClientCertificate resource.</p>', 'UpdateDeployment' => '<p>Changes information about a Deployment resource.</p>', 'UpdateDocumentationPart' => '<p>Updates a documentation part.</p>', 'UpdateDocumentationVersion' => '<p>Updates a documentation version.</p>', 'UpdateDomainName' => '<p>Changes information about the DomainName resource.</p>', 'UpdateGatewayResponse' => '<p>Updates a GatewayResponse of a specified response type on the given RestApi.</p>', 'UpdateIntegration' => '<p>Represents an update integration.</p>', 'UpdateIntegrationResponse' => '<p>Represents an update integration response.</p>', 'UpdateMethod' => '<p>Updates an existing Method resource.</p>', 'UpdateMethodResponse' => '<p>Updates an existing MethodResponse resource.</p>', 'UpdateModel' => '<p>Changes information about a model.</p>', 'UpdateRequestValidator' => '<p>Updates a RequestValidator of a given RestApi.</p>', 'UpdateResource' => '<p>Changes information about a Resource resource.</p>', 'UpdateRestApi' => '<p>Changes information about the specified API.</p>', 'UpdateStage' => '<p>Changes information about a Stage resource.</p>', 'UpdateUsage' => '<p>Grants a temporary extension to the remaining quota of a usage plan associated with a specified API key.</p>', 'UpdateUsagePlan' => '<p>Updates a usage plan of a given plan Id.</p>', 'UpdateVpcLink' => '<p>Updates an existing VpcLink of a specified identifier.</p>', ], 'shapes' => [ 'AccessLogSettings' => [ 'base' => '<p>Access log settings, including the access log format and access log destination ARN.</p>', 'refs' => [ 'Stage$accessLogSettings' => '<p>Settings for logging access in this stage.</p>', ], ], 'Account' => [ 'base' => '<p>Represents an AWS account that is associated with API Gateway.</p>', 'refs' => [], ], 'ApiKey' => [ 'base' => '<p>A resource that can be distributed to callers for executing Method resources that require an API key. API keys can be mapped to any Stage on any RestApi, which indicates that the callers with the API key can make requests to that stage.</p>', 'refs' => [ 'ListOfApiKey$member' => NULL, ], ], 'ApiKeyIds' => [ 'base' => '<p>The identifier of an ApiKey used in a UsagePlan.</p>', 'refs' => [], ], 'ApiKeySourceType' => [ 'base' => NULL, 'refs' => [ 'CreateRestApiRequest$apiKeySource' => '<p>The source of the API key for metering requests according to a usage plan. Valid values are: &gt;<code>HEADER</code> to read the API key from the <code>X-API-Key</code> header of a request. <code>AUTHORIZER</code> to read the API key from the <code>UsageIdentifierKey</code> from a custom authorizer.</p>', 'RestApi$apiKeySource' => '<p>The source of the API key for metering requests according to a usage plan. Valid values are: &gt;<code>HEADER</code> to read the API key from the <code>X-API-Key</code> header of a request. <code>AUTHORIZER</code> to read the API key from the <code>UsageIdentifierKey</code> from a custom authorizer.</p>', ], ], 'ApiKeys' => [ 'base' => '<p>Represents a collection of API keys as represented by an ApiKeys resource.</p>', 'refs' => [], ], 'ApiKeysFormat' => [ 'base' => NULL, 'refs' => [ 'ImportApiKeysRequest$format' => '<p>A query parameter to specify the input format to imported API keys. Currently, only the <code>csv</code> format is supported.</p>', ], ], 'ApiStage' => [ 'base' => '<p>API stage name of the associated API stage in a usage plan.</p>', 'refs' => [ 'ListOfApiStage$member' => NULL, ], ], 'Authorizer' => [ 'base' => '<p>Represents an authorization layer for methods. If enabled on a method, API Gateway will activate the authorizer when a client calls the method.</p>', 'refs' => [ 'ListOfAuthorizer$member' => NULL, ], ], 'AuthorizerType' => [ 'base' => '<p>The authorizer type. Valid values are <code>TOKEN</code> for a Lambda function using a single authorization token submitted in a custom header, <code>REQUEST</code> for a Lambda function using incoming request parameters, and <code>COGNITO_USER_POOLS</code> for using an Amazon Cognito user pool.</p>', 'refs' => [ 'Authorizer$type' => '<p>The authorizer type. Valid values are <code>TOKEN</code> for a Lambda function using a single authorization token submitted in a custom header, <code>REQUEST</code> for a Lambda function using incoming request parameters, and <code>COGNITO_USER_POOLS</code> for using an Amazon Cognito user pool.</p>', 'CreateAuthorizerRequest$type' => '<p>The authorizer type. Valid values are <code>TOKEN</code> for a Lambda function using a single authorization token submitted in a custom header, <code>REQUEST</code> for a Lambda function using incoming request parameters, and <code>COGNITO_USER_POOLS</code> for using an Amazon Cognito user pool.</p>', ], ], 'Authorizers' => [ 'base' => '<p>Represents a collection of Authorizer resources.</p>', 'refs' => [], ], 'BadRequestException' => [ 'base' => '<p>The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.</p>', 'refs' => [], ], 'BasePathMapping' => [ 'base' => '<p>Represents the base path that callers of the API must provide as part of the URL after the domain name.</p>', 'refs' => [ 'ListOfBasePathMapping$member' => NULL, ], ], 'BasePathMappings' => [ 'base' => '<p>Represents a collection of BasePathMapping resources.</p>', 'refs' => [], ], 'Blob' => [ 'base' => NULL, 'refs' => [ 'ExportResponse$body' => '<p>The binary blob response to GetExport, which contains the export.</p>', 'ImportApiKeysRequest$body' => '<p>The payload of the POST request to import API keys. For the payload format, see API Key File Format.</p>', 'ImportDocumentationPartsRequest$body' => '<p>Raw byte array representing the to-be-imported documentation parts. To import from an OpenAPI file, this is a JSON object.</p>', 'ImportRestApiRequest$body' => '<p>The POST request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.</p>', 'PutRestApiRequest$body' => '<p>The PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.</p>', 'SdkResponse$body' => '<p>The binary blob response to GetSdk, which contains the generated SDK.</p>', ], ], 'Boolean' => [ 'base' => NULL, 'refs' => [ 'ApiKey$enabled' => '<p>Specifies whether the API Key can be used by callers.</p>', 'CanarySettings$useStageCache' => '<p>A Boolean flag to indicate whether the canary deployment uses the stage cache or not.</p>', 'CreateApiKeyRequest$enabled' => '<p>Specifies whether the ApiKey can be used by callers.</p>', 'CreateApiKeyRequest$generateDistinctId' => '<p>Specifies whether (<code>true</code>) or not (<code>false</code>) the key identifier is distinct from the created API key value. This parameter is deprecated and should not be used.</p>', 'CreateRequestValidatorRequest$validateRequestBody' => '<p>A Boolean flag to indicate whether to validate request body according to the configured model schema for the method (<code>true</code>) or not (<code>false</code>).</p>', 'CreateRequestValidatorRequest$validateRequestParameters' => '<p>A Boolean flag to indicate whether to validate request parameters, <code>true</code>, or not <code>false</code>.</p>', 'CreateRestApiRequest$disableExecuteApiEndpoint' => '<p>Specifies whether clients can invoke your API by using the default <code>execute-api</code> endpoint. By default, clients can invoke your API with the default <code>https://{api_id}.execute-api.{region}.amazonaws.com</code> endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint</p>', 'CreateStageRequest$cacheClusterEnabled' => '<p>Whether cache clustering is enabled for the stage.</p>', 'CreateStageRequest$tracingEnabled' => '<p>Specifies whether active tracing with X-ray is enabled for the Stage.</p>', 'DeploymentCanarySettings$useStageCache' => '<p>A Boolean flag to indicate whether the canary release deployment uses the stage cache or not.</p>', 'GatewayResponse$defaultResponse' => '<p>A Boolean flag to indicate whether this GatewayResponse is the default gateway response (<code>true</code>) or not (<code>false</code>). A default gateway response is one generated by API Gateway without any customization by an API developer. </p>', 'GetModelRequest$flatten' => '<p>A query parameter of a Boolean value to resolve (<code>true</code>) all external model references and returns a flattened model schema or not (<code>false</code>) The default is <code>false</code>.</p>', 'ImportApiKeysRequest$failOnWarnings' => '<p>A query parameter to indicate whether to rollback ApiKey importation (<code>true</code>) or not (<code>false</code>) when error is encountered.</p>', 'ImportDocumentationPartsRequest$failOnWarnings' => '<p>A query parameter to specify whether to rollback the documentation importation (<code>true</code>) or not (<code>false</code>) when a warning is encountered. The default value is <code>false</code>.</p>', 'ImportRestApiRequest$failOnWarnings' => '<p>A query parameter to indicate whether to rollback the API creation (<code>true</code>) or not (<code>false</code>) when a warning is encountered. The default value is <code>false</code>.</p>', 'MethodSetting$metricsEnabled' => '<p>Specifies whether Amazon CloudWatch metrics are enabled for this method. The PATCH path for this setting is <code>/{method_setting_key}/metrics/enabled</code>, and the value is a Boolean.</p>', 'MethodSetting$dataTraceEnabled' => '<p>Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is <code>/{method_setting_key}/logging/dataTrace</code>, and the value is a Boolean.</p>', 'MethodSetting$cachingEnabled' => '<p>Specifies whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached. The PATCH path for this setting is <code>/{method_setting_key}/caching/enabled</code>, and the value is a Boolean.</p>', 'MethodSetting$cacheDataEncrypted' => '<p>Specifies whether the cached responses are encrypted. The PATCH path for this setting is <code>/{method_setting_key}/caching/dataEncrypted</code>, and the value is a Boolean.</p>', 'MethodSetting$requireAuthorizationForCacheControl' => '<p>Specifies whether authorization is required for a cache invalidation request. The PATCH path for this setting is <code>/{method_setting_key}/caching/requireAuthorizationForCacheControl</code>, and the value is a Boolean.</p>', 'MethodSnapshot$apiKeyRequired' => '<p>Specifies whether the method requires a valid ApiKey.</p>', 'PutMethodRequest$apiKeyRequired' => '<p>Specifies whether the method required a valid ApiKey.</p>', 'PutRestApiRequest$failOnWarnings' => '<p>A query parameter to indicate whether to rollback the API update (<code>true</code>) or not (<code>false</code>) when a warning is encountered. The default value is <code>false</code>.</p>', 'RequestValidator$validateRequestBody' => '<p>A Boolean flag to indicate whether to validate a request body according to the configured Model schema.</p>', 'RequestValidator$validateRequestParameters' => '<p>A Boolean flag to indicate whether to validate request parameters (<code>true</code>) or not (<code>false</code>).</p>', 'RestApi$disableExecuteApiEndpoint' => '<p>Specifies whether clients can invoke your API by using the default <code>execute-api</code> endpoint. By default, clients can invoke your API with the default <code>https://{api_id}.execute-api.{region}.amazonaws.com</code> endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.</p>', 'SdkConfigurationProperty$required' => '<p>A boolean flag of an SdkType configuration property to indicate if the associated SDK configuration property is required (<code>true</code>) or not (<code>false</code>).</p>', 'Stage$cacheClusterEnabled' => '<p>Specifies whether a cache cluster is enabled for the stage.</p>', 'Stage$tracingEnabled' => '<p>Specifies whether active tracing with X-ray is enabled for the Stage.</p>', 'TlsConfig$insecureSkipVerification' => '<p>Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority. This isn\u00e2\u20ac\u2122t recommended, but it enables you to use certificates that are signed by private certificate authorities, or certificates that are self-signed. If enabled, API Gateway still performs basic certificate validation, which includes checking the certificate\\'s expiration date, hostname, and presence of a root certificate authority. Supported only for <code>HTTP</code> and <code>HTTP_PROXY</code> integrations.</p> <important> <p>Enabling <code>insecureSkipVerification</code> isn\\'t recommended, especially for integrations with public HTTPS endpoints. If you enable <code>insecureSkipVerification</code>, you increase the risk of man-in-the-middle attacks.</p> </important>', ], ], 'CacheClusterSize' => [ 'base' => '<p>Returns the size of the CacheCluster.</p>', 'refs' => [ 'CreateDeploymentRequest$cacheClusterSize' => '<p>The stage\\'s cache capacity in GB. For more information about choosing a cache size, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html\">Enabling API caching to enhance responsiveness</a>.</p>', 'CreateStageRequest$cacheClusterSize' => '<p>The stage\\'s cache capacity in GB. For more information about choosing a cache size, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html\">Enabling API caching to enhance responsiveness</a>.</p>', 'Stage$cacheClusterSize' => '<p>The stage\\'s cache capacity in GB. For more information about choosing a cache size, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html\">Enabling API caching to enhance responsiveness</a>.</p>', ], ], 'CacheClusterStatus' => [ 'base' => '<p>Returns the status of the CacheCluster.</p>', 'refs' => [ 'Stage$cacheClusterStatus' => '<p>The status of the cache cluster for the stage, if enabled.</p>', ], ], 'CanarySettings' => [ 'base' => '<p>Configuration settings of a canary deployment.</p>', 'refs' => [ 'CreateStageRequest$canarySettings' => '<p>The canary deployment settings of this stage.</p>', 'Stage$canarySettings' => '<p>Settings for the canary deployment in this stage.</p>', ], ], 'ClientCertificate' => [ 'base' => '<p>Represents a client certificate used to configure client-side SSL authentication while sending requests to the integration endpoint.</p>', 'refs' => [ 'ListOfClientCertificate$member' => NULL, ], ], 'ClientCertificates' => [ 'base' => '<p>Represents a collection of ClientCertificate resources.</p>', 'refs' => [], ], 'ConflictException' => [ 'base' => '<p>The request configuration has conflicts. For details, see the accompanying error message.</p>', 'refs' => [], ], 'ConnectionType' => [ 'base' => NULL, 'refs' => [ 'Integration$connectionType' => '<p>The type of the network connection to the integration endpoint. The valid value is <code>INTERNET</code> for connections through the public routable internet or <code>VPC_LINK</code> for private connections between API Gateway and a network load balancer in a VPC. The default value is <code>INTERNET</code>.</p>', 'PutIntegrationRequest$connectionType' => '<p>The type of the network connection to the integration endpoint. The valid value is <code>INTERNET</code> for connections through the public routable internet or <code>VPC_LINK</code> for private connections between API Gateway and a network load balancer in a VPC. The default value is <code>INTERNET</code>.</p>', ], ], 'ContentHandlingStrategy' => [ 'base' => NULL, 'refs' => [ 'Integration$contentHandling' => '<p>Specifies how to handle request payload content type conversions. Supported values are <code>CONVERT_TO_BINARY</code> and <code>CONVERT_TO_TEXT</code>, with the following behaviors:</p> <p>If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the <code>passthroughBehavior</code> is configured to support payload pass-through.</p>', 'IntegrationResponse$contentHandling' => '<p>Specifies how to handle response payload content type conversions. Supported values are <code>CONVERT_TO_BINARY</code> and <code>CONVERT_TO_TEXT</code>, with the following behaviors:</p> <p>If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.</p>', 'PutIntegrationRequest$contentHandling' => '<p>Specifies how to handle request payload content type conversions. Supported values are <code>CONVERT_TO_BINARY</code> and <code>CONVERT_TO_TEXT</code>, with the following behaviors:</p> <p>If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the <code>passthroughBehavior</code> is configured to support payload pass-through.</p>', 'PutIntegrationResponseRequest$contentHandling' => '<p>Specifies how to handle response payload content type conversions. Supported values are <code>CONVERT_TO_BINARY</code> and <code>CONVERT_TO_TEXT</code>, with the following behaviors:</p> <p>If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.</p>', ], ], 'CreateApiKeyRequest' => [ 'base' => '<p>Request to create an ApiKey resource.</p>', 'refs' => [], ], 'CreateAuthorizerRequest' => [ 'base' => '<p>Request to add a new Authorizer to an existing RestApi resource.</p>', 'refs' => [], ], 'CreateBasePathMappingRequest' => [ 'base' => '<p>Requests API Gateway to create a new BasePathMapping resource.</p>', 'refs' => [], ], 'CreateDeploymentRequest' => [ 'base' => '<p>Requests API Gateway to create a Deployment resource.</p>', 'refs' => [], ], 'CreateDocumentationPartRequest' => [ 'base' => '<p>Creates a new documentation part of a given API.</p>', 'refs' => [], ], 'CreateDocumentationVersionRequest' => [ 'base' => '<p>Creates a new documentation version of a given API.</p>', 'refs' => [], ], 'CreateDomainNameRequest' => [ 'base' => '<p>A request to create a new domain name.</p>', 'refs' => [], ], 'CreateModelRequest' => [ 'base' => '<p>Request to add a new Model to an existing RestApi resource.</p>', 'refs' => [], ], 'CreateRequestValidatorRequest' => [ 'base' => '<p>Creates a RequestValidator of a given RestApi.</p>', 'refs' => [], ], 'CreateResourceRequest' => [ 'base' => '<p>Requests API Gateway to create a Resource resource.</p>', 'refs' => [], ], 'CreateRestApiRequest' => [ 'base' => '<p>The POST Request to add a new RestApi resource to your collection.</p>', 'refs' => [], ], 'CreateStageRequest' => [ 'base' => '<p>Requests API Gateway to create a Stage resource.</p>', 'refs' => [], ], 'CreateUsagePlanKeyRequest' => [ 'base' => '<p>The POST request to create a usage plan key for adding an existing API key to a usage plan.</p>', 'refs' => [], ], 'CreateUsagePlanRequest' => [ 'base' => '<p>The POST request to create a usage plan with the name, description, throttle limits and quota limits, as well as the associated API stages, specified in the payload.</p>', 'refs' => [], ], 'CreateVpcLinkRequest' => [ 'base' => '<p>Creates a VPC link, under the caller\\'s account in a selected region, in an asynchronous operation that typically takes 2-4 minutes to complete and become operational. The caller must have permissions to create and update VPC Endpoint services.</p>', 'refs' => [], ], 'DeleteApiKeyRequest' => [ 'base' => '<p>A request to delete the ApiKey resource.</p>', 'refs' => [], ], 'DeleteAuthorizerRequest' => [ 'base' => '<p>Request to delete an existing Authorizer resource.</p>', 'refs' => [], ], 'DeleteBasePathMappingRequest' => [ 'base' => '<p>A request to delete the BasePathMapping resource.</p>', 'refs' => [], ], 'DeleteClientCertificateRequest' => [ 'base' => '<p>A request to delete the ClientCertificate resource.</p>', 'refs' => [], ], 'DeleteDeploymentRequest' => [ 'base' => '<p>Requests API Gateway to delete a Deployment resource.</p>', 'refs' => [], ], 'DeleteDocumentationPartRequest' => [ 'base' => '<p>Deletes an existing documentation part of an API.</p>', 'refs' => [], ], 'DeleteDocumentationVersionRequest' => [ 'base' => '<p>Deletes an existing documentation version of an API.</p>', 'refs' => [], ], 'DeleteDomainNameRequest' => [ 'base' => '<p>A request to delete the DomainName resource.</p>', 'refs' => [], ], 'DeleteGatewayResponseRequest' => [ 'base' => '<p>Clears any customization of a GatewayResponse of a specified response type on the given RestApi and resets it with the default settings.</p>', 'refs' => [], ], 'DeleteIntegrationRequest' => [ 'base' => '<p>Represents a delete integration request.</p>', 'refs' => [], ], 'DeleteIntegrationResponseRequest' => [ 'base' => '<p>Represents a delete integration response request.</p>', 'refs' => [], ], 'DeleteMethodRequest' => [ 'base' => '<p>Request to delete an existing Method resource.</p>', 'refs' => [], ], 'DeleteMethodResponseRequest' => [ 'base' => '<p>A request to delete an existing MethodResponse resource.</p>', 'refs' => [], ], 'DeleteModelRequest' => [ 'base' => '<p>Request to delete an existing model in an existing RestApi resource.</p>', 'refs' => [], ], 'DeleteRequestValidatorRequest' => [ 'base' => '<p>Deletes a specified RequestValidator of a given RestApi.</p>', 'refs' => [], ], 'DeleteResourceRequest' => [ 'base' => '<p>Request to delete a Resource.</p>', 'refs' => [], ], 'DeleteRestApiRequest' => [ 'base' => '<p>Request to delete the specified API from your collection.</p>', 'refs' => [], ], 'DeleteStageRequest' => [ 'base' => '<p>Requests API Gateway to delete a Stage resource.</p>', 'refs' => [], ], 'DeleteUsagePlanKeyRequest' => [ 'base' => '<p>The DELETE request to delete a usage plan key and remove the underlying API key from the associated usage plan.</p>', 'refs' => [], ], 'DeleteUsagePlanRequest' => [ 'base' => '<p>The DELETE request to delete a usage plan of a given plan Id.</p>', 'refs' => [], ], 'DeleteVpcLinkRequest' => [ 'base' => '<p>Deletes an existing VpcLink of a specified identifier.</p>', 'refs' => [], ], 'Deployment' => [ 'base' => '<p>An immutable representation of a RestApi resource that can be called by users using Stages. A deployment must be associated with a Stage for it to be callable over the Internet.</p>', 'refs' => [ 'ListOfDeployment$member' => NULL, ], ], 'DeploymentCanarySettings' => [ 'base' => '<p>The input configuration for a canary deployment.</p>', 'refs' => [ 'CreateDeploymentRequest$canarySettings' => '<p>The input configuration for the canary deployment when the deployment is a canary release deployment. </p>', ], ], 'Deployments' => [ 'base' => '<p>Represents a collection resource that contains zero or more references to your existing deployments, and links that guide you on how to interact with your collection. The collection offers a paginated view of the contained deployments.</p>', 'refs' => [], ], 'DocumentationPart' => [ 'base' => '<p>A documentation part for a targeted API entity.</p>', 'refs' => [ 'ListOfDocumentationPart$member' => NULL, ], ], 'DocumentationPartIds' => [ 'base' => '<p>A collection of the imported DocumentationPart identifiers.</p>', 'refs' => [], ], 'DocumentationPartLocation' => [ 'base' => '<p>Specifies the target API entity to which the documentation applies.</p>', 'refs' => [ 'CreateDocumentationPartRequest$location' => '<p>The location of the targeted API entity of the to-be-created documentation part.</p>', 'DocumentationPart$location' => '<p>The location of the API entity to which the documentation applies. Valid fields depend on the targeted API entity type. All the valid location fields are not required. If not explicitly specified, a valid location field is treated as a wildcard and associated documentation content may be inherited by matching entities, unless overridden.</p>', ], ], 'DocumentationPartLocationStatusCode' => [ 'base' => NULL, 'refs' => [ 'DocumentationPartLocation$statusCode' => '<p>The HTTP status code of a response. It is a valid field for the API entity types of <code>RESPONSE</code>, <code>RESPONSE_HEADER</code>, and <code>RESPONSE_BODY</code>. The default value is <code>*</code> for any status code. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other <code>location</code> attributes, the child entity\\'s <code>statusCode</code> attribute must match that of the parent entity exactly.</p>', ], ], 'DocumentationPartType' => [ 'base' => NULL, 'refs' => [ 'DocumentationPartLocation$type' => '<p>The type of API entity to which the documentation content applies. Valid values are <code>API</code>, <code>AUTHORIZER</code>, <code>MODEL</code>, <code>RESOURCE</code>, <code>METHOD</code>, <code>PATH_PARAMETER</code>, <code>QUERY_PARAMETER</code>, <code>REQUEST_HEADER</code>, <code>REQUEST_BODY</code>, <code>RESPONSE</code>, <code>RESPONSE_HEADER</code>, and <code>RESPONSE_BODY</code>. Content inheritance does not apply to any entity of the <code>API</code>, <code>AUTHORIZER</code>, <code>METHOD</code>, <code>MODEL</code>, <code>REQUEST_BODY</code>, or <code>RESOURCE</code> type.</p>', 'GetDocumentationPartsRequest$type' => '<p>The type of API entities of the to-be-retrieved documentation parts. </p>', ], ], 'DocumentationParts' => [ 'base' => '<p>The collection of documentation parts of an API.</p>', 'refs' => [], ], 'DocumentationVersion' => [ 'base' => '<p>A snapshot of the documentation of an API.</p>', 'refs' => [ 'ListOfDocumentationVersion$member' => NULL, ], ], 'DocumentationVersions' => [ 'base' => '<p>The collection of documentation snapshots of an API. </p>', 'refs' => [], ], 'DomainName' => [ 'base' => '<p>Represents a custom domain name as a user-friendly host name of an API (RestApi).</p>', 'refs' => [ 'ListOfDomainName$member' => NULL, ], ], 'DomainNameStatus' => [ 'base' => NULL, 'refs' => [ 'DomainName$domainNameStatus' => '<p>The status of the DomainName migration. The valid values are <code>AVAILABLE</code> and <code>UPDATING</code>. If the status is <code>UPDATING</code>, the domain cannot be modified further until the existing operation is complete. If it is <code>AVAILABLE</code>, the domain can be updated.</p>', ], ], 'DomainNames' => [ 'base' => '<p>Represents a collection of DomainName resources.</p>', 'refs' => [], ], 'Double' => [ 'base' => NULL, 'refs' => [ 'CanarySettings$percentTraffic' => '<p>The percent (0-100) of traffic diverted to a canary deployment.</p>', 'DeploymentCanarySettings$percentTraffic' => '<p>The percentage (0.0-100.0) of traffic routed to the canary deployment.</p>', 'MethodSetting$throttlingRateLimit' => '<p>Specifies the throttling rate limit. The PATCH path for this setting is <code>/{method_setting_key}/throttling/rateLimit</code>, and the value is a double.</p>', 'ThrottleSettings$rateLimit' => '<p>The API target request rate limit.</p>', ], ], 'EndpointConfiguration' => [ 'base' => '<p>The endpoint configuration to indicate the types of endpoints an API (RestApi) or its custom domain name (DomainName) has. </p>', 'refs' => [ 'CreateDomainNameRequest$endpointConfiguration' => '<p>The endpoint configuration of this DomainName showing the endpoint types of the domain name. </p>', 'CreateRestApiRequest$endpointConfiguration' => '<p>The endpoint configuration of this RestApi showing the endpoint types of the API. </p>', 'DomainName$endpointConfiguration' => '<p>The endpoint configuration of this DomainName showing the endpoint types of the domain name. </p>', 'RestApi$endpointConfiguration' => '<p>The endpoint configuration of this RestApi showing the endpoint types of the API. </p>', ], ], 'EndpointType' => [ 'base' => '<p>The endpoint type. The valid values are <code>EDGE</code> for edge-optimized API setup, most suitable for mobile applications; <code>REGIONAL</code> for regional API endpoint setup, most suitable for calling from AWS Region; and <code>PRIVATE</code> for private APIs.</p>', 'refs' => [ 'ListOfEndpointType$member' => NULL, ], ], 'ExportResponse' => [ 'base' => '<p>The binary blob response to GetExport, which contains the generated SDK.</p>', 'refs' => [], ], 'FlushStageAuthorizersCacheRequest' => [ 'base' => '<p>Request to flush authorizer cache entries on a specified stage.</p>', 'refs' => [], ], 'FlushStageCacheRequest' => [ 'base' => '<p>Requests API Gateway to flush a stage\\'s cache.</p>', 'refs' => [], ], 'GatewayResponse' => [ 'base' => '<p>A gateway response of a given response type and status code, with optional response parameters and mapping templates.</p>', 'refs' => [ 'ListOfGatewayResponse$member' => NULL, ], ], 'GatewayResponseType' => [ 'base' => NULL, 'refs' => [ 'DeleteGatewayResponseRequest$responseType' => '<p>The response type of the associated GatewayResponse.</p>', 'GatewayResponse$responseType' => '<p>The response type of the associated GatewayResponse.</p>', 'GetGatewayResponseRequest$responseType' => '<p>The response type of the associated GatewayResponse.</p>', 'PutGatewayResponseRequest$responseType' => '<p>The response type of the associated GatewayResponse</p>', 'UpdateGatewayResponseRequest$responseType' => '<p>The response type of the associated GatewayResponse.</p>', ], ], 'GatewayResponses' => [ 'base' => '<p>The collection of the GatewayResponse instances of a RestApi as a <code>responseType</code>-to-GatewayResponse object map of key-value pairs. As such, pagination is not supported for querying this collection.</p>', 'refs' => [], ], 'GenerateClientCertificateRequest' => [ 'base' => '<p>A request to generate a ClientCertificate resource.</p>', 'refs' => [], ], 'GetAccountRequest' => [ 'base' => '<p>Requests API Gateway to get information about the current Account resource.</p>', 'refs' => [], ], 'GetApiKeyRequest' => [ 'base' => '<p>A request to get information about the current ApiKey resource.</p>', 'refs' => [], ], 'GetApiKeysRequest' => [ 'base' => '<p>A request to get information about the current ApiKeys resource.</p>', 'refs' => [], ], 'GetAuthorizerRequest' => [ 'base' => '<p>Request to describe an existing Authorizer resource.</p>', 'refs' => [], ], 'GetAuthorizersRequest' => [ 'base' => '<p>Request to describe an existing Authorizers resource.</p>', 'refs' => [], ], 'GetBasePathMappingRequest' => [ 'base' => '<p>Request to describe a BasePathMapping resource.</p>', 'refs' => [], ], 'GetBasePathMappingsRequest' => [ 'base' => '<p>A request to get information about a collection of BasePathMapping resources.</p>', 'refs' => [], ], 'GetClientCertificateRequest' => [ 'base' => '<p>A request to get information about the current ClientCertificate resource.</p>', 'refs' => [], ], 'GetClientCertificatesRequest' => [ 'base' => '<p>A request to get information about a collection of ClientCertificate resources.</p>', 'refs' => [], ], 'GetDeploymentRequest' => [ 'base' => '<p>Requests API Gateway to get information about a Deployment resource.</p>', 'refs' => [], ], 'GetDeploymentsRequest' => [ 'base' => '<p>Requests API Gateway to get information about a Deployments collection.</p>', 'refs' => [], ], 'GetDocumentationPartRequest' => [ 'base' => '<p>Gets a specified documentation part of a given API.</p>', 'refs' => [], ], 'GetDocumentationPartsRequest' => [ 'base' => '<p>Gets the documentation parts of an API. The result may be filtered by the type, name, or path of API entities (targets).</p>', 'refs' => [], ], 'GetDocumentationVersionRequest' => [ 'base' => '<p>Gets a documentation snapshot of an API.</p>', 'refs' => [], ], 'GetDocumentationVersionsRequest' => [ 'base' => '<p>Gets the documentation versions of an API.</p>', 'refs' => [], ], 'GetDomainNameRequest' => [ 'base' => '<p>Request to get the name of a DomainName resource.</p>', 'refs' => [], ], 'GetDomainNamesRequest' => [ 'base' => '<p>Request to describe a collection of DomainName resources.</p>', 'refs' => [], ], 'GetExportRequest' => [ 'base' => '<p>Request a new export of a RestApi for a particular Stage.</p>', 'refs' => [], ], 'GetGatewayResponseRequest' => [ 'base' => '<p>Gets a GatewayResponse of a specified response type on the given RestApi.</p>', 'refs' => [], ], 'GetGatewayResponsesRequest' => [ 'base' => '<p>Gets the GatewayResponses collection on the given RestApi. If an API developer has not added any definitions for gateway responses, the result will be the API Gateway-generated default GatewayResponses collection for the supported response types.</p>', 'refs' => [], ], 'GetIntegrationRequest' => [ 'base' => '<p>Represents a request to get the integration configuration.</p>', 'refs' => [], ], 'GetIntegrationResponseRequest' => [ 'base' => '<p>Represents a get integration response request.</p>', 'refs' => [], ], 'GetMethodRequest' => [ 'base' => '<p>Request to describe an existing Method resource.</p>', 'refs' => [], ], 'GetMethodResponseRequest' => [ 'base' => '<p>Request to describe a MethodResponse resource.</p>', 'refs' => [], ], 'GetModelRequest' => [ 'base' => '<p>Request to list information about a model in an existing RestApi resource.</p>', 'refs' => [], ], 'GetModelTemplateRequest' => [ 'base' => '<p>Request to generate a sample mapping template used to transform the payload.</p>', 'refs' => [], ], 'GetModelsRequest' => [ 'base' => '<p>Request to list existing Models defined for a RestApi resource.</p>', 'refs' => [], ], 'GetRequestValidatorRequest' => [ 'base' => '<p>Gets a RequestValidator of a given RestApi.</p>', 'refs' => [], ], 'GetRequestValidatorsRequest' => [ 'base' => '<p>Gets the RequestValidators collection of a given RestApi.</p>', 'refs' => [], ], 'GetResourceRequest' => [ 'base' => '<p>Request to list information about a resource.</p>', 'refs' => [], ], 'GetResourcesRequest' => [ 'base' => '<p>Request to list information about a collection of resources.</p>', 'refs' => [], ], 'GetRestApiRequest' => [ 'base' => '<p>The GET request to list an existing RestApi defined for your collection. </p>', 'refs' => [], ], 'GetRestApisRequest' => [ 'base' => '<p>The GET request to list existing RestApis defined for your collection.</p>', 'refs' => [], ], 'GetSdkRequest' => [ 'base' => '<p>Request a new generated client SDK for a RestApi and Stage.</p>', 'refs' => [], ], 'GetSdkTypeRequest' => [ 'base' => '<p>Get an SdkType instance.</p>', 'refs' => [], ], 'GetSdkTypesRequest' => [ 'base' => '<p>Get the SdkTypes collection.</p>', 'refs' => [], ], 'GetStageRequest' => [ 'base' => '<p>Requests API Gateway to get information about a Stage resource.</p>', 'refs' => [], ], 'GetStagesRequest' => [ 'base' => '<p>Requests API Gateway to get information about one or more Stage resources.</p>', 'refs' => [], ], 'GetTagsRequest' => [ 'base' => '<p>Gets the Tags collection for a given resource.</p>', 'refs' => [], ], 'GetUsagePlanKeyRequest' => [ 'base' => '<p>The GET request to get a usage plan key of a given key identifier.</p>', 'refs' => [], ], 'GetUsagePlanKeysRequest' => [ 'base' => '<p>The GET request to get all the usage plan keys representing the API keys added to a specified usage plan.</p>', 'refs' => [], ], 'GetUsagePlanRequest' => [ 'base' => '<p>The GET request to get a usage plan of a given plan identifier.</p>', 'refs' => [], ], 'GetUsagePlansRequest' => [ 'base' => '<p>The GET request to get all the usage plans of the caller\\'s account.</p>', 'refs' => [], ], 'GetUsageRequest' => [ 'base' => '<p>The GET request to get the usage data of a usage plan in a specified time interval.</p>', 'refs' => [], ], 'GetVpcLinkRequest' => [ 'base' => '<p>Gets a specified VPC link under the caller\\'s account in a region.</p>', 'refs' => [], ], 'GetVpcLinksRequest' => [ 'base' => '<p>Gets the VpcLinks collection under the caller\\'s account in a selected region.</p>', 'refs' => [], ], 'ImportApiKeysRequest' => [ 'base' => '<p>The POST request to import API keys from an external source, such as a CSV-formatted file.</p>', 'refs' => [], ], 'ImportDocumentationPartsRequest' => [ 'base' => '<p>Import documentation parts from an external (e.g., OpenAPI) definition file. </p>', 'refs' => [], ], 'ImportRestApiRequest' => [ 'base' => '<p>A POST request to import an API to API Gateway using an input of an API definition file.</p>', 'refs' => [], ], 'Integer' => [ 'base' => NULL, 'refs' => [ 'Integration$timeoutInMillis' => '<p>Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.</p>', 'MethodSetting$throttlingBurstLimit' => '<p>Specifies the throttling burst limit. The PATCH path for this setting is <code>/{method_setting_key}/throttling/burstLimit</code>, and the value is an integer.</p>', 'MethodSetting$cacheTtlInSeconds' => '<p>Specifies the time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached. The PATCH path for this setting is <code>/{method_setting_key}/caching/ttlInSeconds</code>, and the value is an integer.</p>', 'QuotaSettings$limit' => '<p>The target maximum number of requests that can be made in a given time period.</p>', 'QuotaSettings$offset' => '<p>The number of requests subtracted from the given limit in the initial time period.</p>', 'TestInvokeAuthorizerResponse$clientStatus' => '<p>The HTTP status code that the client would have received. Value is 0 if the authorizer succeeded.</p>', 'TestInvokeMethodResponse$status' => '<p>The HTTP status code.</p>', 'ThrottleSettings$burstLimit' => '<p>The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.</p>', ], ], 'Integration' => [ 'base' => '<p>Represents an HTTP, HTTP_PROXY, AWS, AWS_PROXY, or Mock integration.</p>', 'refs' => [ 'Method$methodIntegration' => '<p>Gets the method\\'s integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.</p>', ], ], 'IntegrationResponse' => [ 'base' => '<p>Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.</p>', 'refs' => [ 'MapOfIntegrationResponse$value' => NULL, ], ], 'IntegrationType' => [ 'base' => '<p>The integration type. The valid value is <code>HTTP</code> for integrating an API method with an HTTP backend; <code>AWS</code> with any AWS service endpoints; <code>MOCK</code> for testing without actually invoking the backend; <code>HTTP_PROXY</code> for integrating with the HTTP proxy integration; <code>AWS_PROXY</code> for integrating with the Lambda proxy integration. </p>', 'refs' => [ 'Integration$type' => '<p>Specifies an API method integration type. The valid value is one of the following:</p> <p>For the HTTP and HTTP proxy integrations, each integration can specify a protocol (<code>http/https</code>), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a <code>connectionType</code> of <code>VPC_LINK</code> is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.</p>', 'PutIntegrationRequest$type' => '<p>Specifies a put integration input\\'s type.</p>', ], ], 'LimitExceededException' => [ 'base' => '<p>The request exceeded the rate limit. Retry after the specified time period.</p>', 'refs' => [], ], 'ListOfARNs' => [ 'base' => NULL, 'refs' => [ 'Authorizer$providerARNs' => '<p>A list of the Amazon Cognito user pool ARNs for the <code>COGNITO_USER_POOLS</code> authorizer. Each element is of this format: <code>arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}</code>. For a <code>TOKEN</code> or <code>REQUEST</code> authorizer, this is not defined. </p>', 'CreateAuthorizerRequest$providerARNs' => '<p>A list of the Amazon Cognito user pool ARNs for the <code>COGNITO_USER_POOLS</code> authorizer. Each element is of this format: <code>arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}</code>. For a <code>TOKEN</code> or <code>REQUEST</code> authorizer, this is not defined. </p>', ], ], 'ListOfApiKey' => [ 'base' => NULL, 'refs' => [ 'ApiKeys$items' => '<p>The current page of elements from this collection.</p>', ], ], 'ListOfApiStage' => [ 'base' => NULL, 'refs' => [ 'CreateUsagePlanRequest$apiStages' => '<p>The associated API stages of the usage plan.</p>', 'UsagePlan$apiStages' => '<p>The associated API stages of a usage plan.</p>', ], ], 'ListOfAuthorizer' => [ 'base' => NULL, 'refs' => [ 'Authorizers$items' => '<p>The current page of elements from this collection.</p>', ], ], 'ListOfBasePathMapping' => [ 'base' => NULL, 'refs' => [ 'BasePathMappings$items' => '<p>The current page of elements from this collection.</p>', ], ], 'ListOfClientCertificate' => [ 'base' => NULL, 'refs' => [ 'ClientCertificates$items' => '<p>The current page of elements from this collection.</p>', ], ], 'ListOfDeployment' => [ 'base' => NULL, 'refs' => [ 'Deployments$items' => '<p>The current page of elements from this collection.</p>', ], ], 'ListOfDocumentationPart' => [ 'base' => NULL, 'refs' => [ 'DocumentationParts$items' => '<p>The current page of elements from this collection.</p>', ], ], 'ListOfDocumentationVersion' => [ 'base' => NULL, 'refs' => [ 'DocumentationVersions$items' => '<p>The current page of elements from this collection.</p>', ], ], 'ListOfDomainName' => [ 'base' => NULL, 'refs' => [ 'DomainNames$items' => '<p>The current page of elements from this collection.</p>', ], ], 'ListOfEndpointType' => [ 'base' => NULL, 'refs' => [ 'EndpointConfiguration$types' => '<p>A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is <code>\"EDGE\"</code>. For a regional API and its custom domain name, the endpoint type is <code>REGIONAL</code>. For a private API, the endpoint type is <code>PRIVATE</code>.</p>', ], ], 'ListOfGatewayResponse' => [ 'base' => NULL, 'refs' => [ 'GatewayResponses$items' => '<p>Returns the entire collection, because of no pagination support.</p>', ], ], 'ListOfLong' => [ 'base' => NULL, 'refs' => [ 'ListOfUsage$member' => NULL, ], ], 'ListOfModel' => [ 'base' => NULL, 'refs' => [ 'Models$items' => '<p>The current page of elements from this collection.</p>', ], ], 'ListOfPatchOperation' => [ 'base' => '<p>A list of operations describing the updates to apply to the specified resource. The patches are applied in the order specified in the list.</p>', 'refs' => [ 'UpdateAccountRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateApiKeyRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateAuthorizerRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateBasePathMappingRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateClientCertificateRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateDeploymentRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateDocumentationPartRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateDocumentationVersionRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateDomainNameRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateGatewayResponseRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateIntegrationRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateIntegrationResponseRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateMethodRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateMethodResponseRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateModelRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateRequestValidatorRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateResourceRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateRestApiRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateStageRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateUsagePlanRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateUsageRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'UpdateVpcLinkRequest$patchOperations' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', ], ], 'ListOfRequestValidator' => [ 'base' => NULL, 'refs' => [ 'RequestValidators$items' => '<p>The current page of elements from this collection.</p>', ], ], 'ListOfResource' => [ 'base' => NULL, 'refs' => [ 'Resources$items' => '<p>The current page of elements from this collection.</p>', ], ], 'ListOfRestApi' => [ 'base' => NULL, 'refs' => [ 'RestApis$items' => '<p>The current page of elements from this collection.</p>', ], ], 'ListOfSdkConfigurationProperty' => [ 'base' => NULL, 'refs' => [ 'SdkType$configurationProperties' => '<p>A list of configuration properties of an SdkType.</p>', ], ], 'ListOfSdkType' => [ 'base' => NULL, 'refs' => [ 'SdkTypes$items' => '<p>The current page of elements from this collection.</p>', ], ], 'ListOfStage' => [ 'base' => NULL, 'refs' => [ 'Stages$item' => '<p>The current page of elements from this collection.</p>', ], ], 'ListOfStageKeys' => [ 'base' => NULL, 'refs' => [ 'CreateApiKeyRequest$stageKeys' => '<p>DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API key.</p>', ], ], 'ListOfString' => [ 'base' => NULL, 'refs' => [ 'Account$features' => '<p>A list of features supported for the account. When usage plans are enabled, the features list will include an entry of <code>\"UsagePlans\"</code>.</p>', 'ApiKey$stageKeys' => '<p>A list of Stage resources that are associated with the ApiKey resource.</p>', 'ApiKeyIds$ids' => '<p>A list of all the ApiKey identifiers.</p>', 'ApiKeyIds$warnings' => '<p>A list of warning messages.</p>', 'ApiKeys$warnings' => '<p>A list of warning messages logged during the import of API keys when the <code>failOnWarnings</code> option is set to true.</p>', 'CreateRestApiRequest$binaryMediaTypes' => '<p>The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.</p>', 'CreateVpcLinkRequest$targetArns' => '<p>The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same AWS account of the API owner.</p>', 'DocumentationPartIds$ids' => '<p>A list of the returned documentation part identifiers.</p>', 'DocumentationPartIds$warnings' => '<p>A list of warning messages reported during import of documentation parts.</p>', 'EndpointConfiguration$vpcEndpointIds' => '<p>A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for <code>PRIVATE</code> endpoint type.</p>', 'GetDeploymentRequest$embed' => '<p>A query parameter to retrieve the specified embedded resources of the returned Deployment resource in the response. In a REST API call, this <code>embed</code> parameter value is a list of comma-separated strings, as in <code>GET /restapis/{restapi_id}/deployments/{deployment_id}?embed=var1,var2</code>. The SDK and other platform-dependent libraries might use a different format for the list. Currently, this request supports only retrieval of the embedded API summary this way. Hence, the parameter value must be a single-valued list containing only the <code>\"apisummary\"</code> string. For example, <code>GET /restapis/{restapi_id}/deployments/{deployment_id}?embed=apisummary</code>.</p>', 'GetResourceRequest$embed' => '<p>A query parameter to retrieve the specified resources embedded in the returned Resource representation in the response. This <code>embed</code> parameter value is a list of comma-separated strings. Currently, the request supports only retrieval of the embedded Method resources this way. The query parameter value must be a single-valued list and contain the <code>\"methods\"</code> string. For example, <code>GET /restapis/{restapi_id}/resources/{resource_id}?embed=methods</code>.</p>', 'GetResourcesRequest$embed' => '<p>A query parameter used to retrieve the specified resources embedded in the returned Resources resource in the response. This <code>embed</code> parameter value is a list of comma-separated strings. Currently, the request supports only retrieval of the embedded Method resources this way. The query parameter value must be a single-valued list and contain the <code>\"methods\"</code> string. For example, <code>GET /restapis/{restapi_id}/resources?embed=methods</code>.</p>', 'Integration$cacheKeyParameters' => '<p>A list of request parameters whose values API Gateway caches. To be valid values for <code>cacheKeyParameters</code>, these parameters must also be specified for Method <code>requestParameters</code>.</p>', 'MapOfStringToList$value' => NULL, 'Method$authorizationScopes' => '<p>A list of authorization scopes configured on the method. The scopes are used with a <code>COGNITO_USER_POOLS</code> authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.</p>', 'MutualTlsAuthentication$truststoreWarnings' => '<p>A list of warnings that API Gateway returns while processing your truststore. Invalid certificates produce warnings. Mutual TLS is still enabled, but some clients might not be able to access your API. To resolve warnings, upload a new truststore to S3, and then update you domain name to use the new version.</p>', 'PutIntegrationRequest$cacheKeyParameters' => '<p>A list of request parameters whose values API Gateway caches. To be valid values for <code>cacheKeyParameters</code>, these parameters must also be specified for Method <code>requestParameters</code>.</p>', 'PutMethodRequest$authorizationScopes' => '<p>A list of authorization scopes configured on the method. The scopes are used with a <code>COGNITO_USER_POOLS</code> authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.</p>', 'RestApi$warnings' => '<p>The warning messages reported when <code>failonwarnings</code> is turned on during API import.</p>', 'RestApi$binaryMediaTypes' => '<p>The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.</p>', 'UntagResourceRequest$tagKeys' => '<p>The Tag keys to delete.</p>', 'VpcLink$targetArns' => '<p>The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same AWS account of the API owner.</p>', ], ], 'ListOfUsage' => [ 'base' => NULL, 'refs' => [ 'MapOfKeyUsages$value' => NULL, ], ], 'ListOfUsagePlan' => [ 'base' => NULL, 'refs' => [ 'UsagePlans$items' => '<p>The current page of elements from this collection.</p>', ], ], 'ListOfUsagePlanKey' => [ 'base' => NULL, 'refs' => [ 'UsagePlanKeys$items' => '<p>The current page of elements from this collection.</p>', ], ], 'ListOfVpcLink' => [ 'base' => NULL, 'refs' => [ 'VpcLinks$items' => '<p>The current page of elements from this collection.</p>', ], ], 'LocationStatusType' => [ 'base' => NULL, 'refs' => [ 'GetDocumentationPartsRequest$locationStatus' => '<p>The status of the API documentation parts to retrieve. Valid values are <code>DOCUMENTED</code> for retrieving DocumentationPart resources with content and <code>UNDOCUMENTED</code> for DocumentationPart resources without content.</p>', ], ], 'Long' => [ 'base' => NULL, 'refs' => [ 'ListOfLong$member' => NULL, 'TestInvokeAuthorizerResponse$latency' => '<p>The execution latency of the test authorizer request.</p>', 'TestInvokeMethodResponse$latency' => '<p>The execution latency of the test invoke request.</p>', ], ], 'MapOfApiStageThrottleSettings' => [ 'base' => NULL, 'refs' => [ 'ApiStage$throttle' => '<p>Map containing method level throttling information for API stage in a usage plan.</p>', ], ], 'MapOfIntegrationResponse' => [ 'base' => NULL, 'refs' => [ 'Integration$integrationResponses' => '<p>Specifies the integration\\'s responses.</p>', ], ], 'MapOfKeyUsages' => [ 'base' => NULL, 'refs' => [ 'Usage$items' => '<p>The usage data, as daily logs of used and remaining quotas, over the specified time interval indexed over the API keys in a usage plan. For example, <code>{..., \"values\" : { \"{api_key}\" : [ [0, 100], [10, 90], [100, 10]]}</code>, where <code>{api_key}</code> stands for an API key value and the daily log entry is of the format <code>[used quota, remaining quota]</code>.</p>', ], ], 'MapOfMethod' => [ 'base' => NULL, 'refs' => [ 'Resource$resourceMethods' => '<p>Gets an API resource\\'s method of a given HTTP verb.</p>', ], ], 'MapOfMethodResponse' => [ 'base' => NULL, 'refs' => [ 'Method$methodResponses' => '<p>Gets a method response associated with a given HTTP status code. </p>', ], ], 'MapOfMethodSettings' => [ 'base' => NULL, 'refs' => [ 'Stage$methodSettings' => '<p>A map that defines the method settings for a Stage resource. Keys (designated as <code>/{method_setting_key</code> below) are method paths defined as <code>{resource_path}/{http_method}</code> for an individual method override, or <code>/\\\\*/\\\\*</code> for overriding all methods in the stage. </p>', ], ], 'MapOfMethodSnapshot' => [ 'base' => NULL, 'refs' => [ 'PathToMapOfMethodSnapshot$value' => NULL, ], ], 'MapOfStringToBoolean' => [ 'base' => NULL, 'refs' => [ 'Method$requestParameters' => '<p>A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of <code>method.request.{location}.{name}</code>, where <code>location</code> is <code>querystring</code>, <code>path</code>, or <code>header</code> and <code>name</code> is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required (<code>true</code>) or optional (<code>false</code>). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.</p>', 'MethodResponse$responseParameters' => '<p>A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern <code>method.response.header.{name}</code>, where <code>name</code> is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API\\'s IntegrationResponse. The integration response data that can be mapped include an integration response header expressed in <code>integration.response.header.{name}</code>, a static value enclosed within a pair of single quotes (e.g., <code>\\'application/json\\'</code>), or a JSON expression from the back-end response payload in the form of <code>integration.response.body.{JSON-expression}</code>, where <code>JSON-expression</code> is a valid JSON expression without the <code>$</code> prefix.)</p>', 'PutMethodRequest$requestParameters' => '<p>A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key defines a method request parameter name matching the pattern of <code>method.request.{location}.{name}</code>, where <code>location</code> is <code>querystring</code>, <code>path</code>, or <code>header</code> and <code>name</code> is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required (<code>true</code>) or optional (<code>false</code>). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or body-mapping templates.</p>', 'PutMethodResponseRequest$responseParameters' => '<p>A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header name and the associated value is a Boolean flag indicating whether the method response parameter is required or not. The method response header names must match the pattern of <code>method.response.header.{name}</code>, where <code>name</code> is a valid and unique header name. The response parameter names defined here are available in the integration response to be mapped from an integration response header expressed in <code>integration.response.header.{name}</code>, a static value enclosed within a pair of single quotes (e.g., <code>\\'application/json\\'</code>), or a JSON expression from the back-end response payload in the form of <code>integration.response.body.{JSON-expression}</code>, where <code>JSON-expression</code> is a valid JSON expression without the <code>$</code> prefix.)</p>', ], ], 'MapOfStringToList' => [ 'base' => NULL, 'refs' => [ 'TestInvokeAuthorizerRequest$multiValueHeaders' => '<p>The headers as a map from string to list of values to simulate an incoming invocation request. This is where the incoming authorization token, or identity source, may be specified.</p>', 'TestInvokeAuthorizerResponse$authorization' => '<p>The authorization response.</p>', 'TestInvokeMethodRequest$multiValueHeaders' => '<p>The headers as a map from string to list of values to simulate an incoming invocation request.</p>', 'TestInvokeMethodResponse$multiValueHeaders' => '<p>The headers of the HTTP response as a map from string to list of values.</p>', ], ], 'MapOfStringToString' => [ 'base' => NULL, 'refs' => [ 'ApiKey$tags' => '<p>The collection of tags. Each tag element is associated with a given resource.</p>', 'CanarySettings$stageVariableOverrides' => '<p>Stage variables overridden for a canary release deployment, including new stage variables introduced in the canary. These stage variables are represented as a string-to-string map between stage variable names and their values.</p>', 'ClientCertificate$tags' => '<p>The collection of tags. Each tag element is associated with a given resource.</p>', 'CreateApiKeyRequest$tags' => '<p>The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with <code>aws:</code>. The tag value can be up to 256 characters.</p>', 'CreateDeploymentRequest$variables' => '<p>A map that defines the stage variables for the Stage resource that is associated with the new deployment. Variable names can have alphanumeric and underscore characters, and the values must match <code>[A-Za-z0-9-._~:/?#&amp;=,]+</code>.</p>', 'CreateDomainNameRequest$tags' => '<p>The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with <code>aws:</code>. The tag value can be up to 256 characters.</p>', 'CreateRestApiRequest$tags' => '<p>The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with <code>aws:</code>. The tag value can be up to 256 characters.</p>', 'CreateStageRequest$variables' => '<p>A map that defines the stage variables for the new Stage resource. Variable names can have alphanumeric and underscore characters, and the values must match <code>[A-Za-z0-9-._~:/?#&amp;=,]+</code>.</p>', 'CreateStageRequest$tags' => '<p>The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with <code>aws:</code>. The tag value can be up to 256 characters.</p>', 'CreateUsagePlanRequest$tags' => '<p>The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with <code>aws:</code>. The tag value can be up to 256 characters.</p>', 'CreateVpcLinkRequest$tags' => '<p>The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with <code>aws:</code>. The tag value can be up to 256 characters.</p>', 'DeploymentCanarySettings$stageVariableOverrides' => '<p>A stage variable overrides used for the canary release deployment. They can override existing stage variables or add new stage variables for the canary release deployment. These stage variables are represented as a string-to-string map between stage variable names and their values.</p>', 'DomainName$tags' => '<p>The collection of tags. Each tag element is associated with a given resource.</p>', 'GatewayResponse$responseParameters' => '<p>Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.</p>', 'GatewayResponse$responseTemplates' => '<p>Response templates of the GatewayResponse as a string-to-string map of key-value pairs.</p>', 'GenerateClientCertificateRequest$tags' => '<p>The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with <code>aws:</code>. The tag value can be up to 256 characters.</p>', 'GetExportRequest$parameters' => '<p>A key-value map of query string parameters that specify properties of the export, depending on the requested <code>exportType</code>. For <code>exportType</code> <code>oas30</code> and <code>swagger</code>, any combination of the following parameters are supported: <code>extensions=\\'integrations\\'</code> or <code>extensions=\\'apigateway\\'</code> will export the API with x-amazon-apigateway-integration extensions. <code>extensions=\\'authorizers\\'</code> will export the API with x-amazon-apigateway-authorizer extensions. <code>postman</code> will export the API with Postman extensions, allowing for import to the Postman tool</p>', 'GetSdkRequest$parameters' => '<p>A string-to-string key-value map of query parameters <code>sdkType</code>-dependent properties of the SDK. For <code>sdkType</code> of <code>objectivec</code> or <code>swift</code>, a parameter named <code>classPrefix</code> is required. For <code>sdkType</code> of <code>android</code>, parameters named <code>groupId</code>, <code>artifactId</code>, <code>artifactVersion</code>, and <code>invokerPackage</code> are required. For <code>sdkType</code> of <code>java</code>, parameters named <code>serviceName</code> and <code>javaPackageName</code> are required. </p>', 'ImportRestApiRequest$parameters' => '<p>A key-value map of context-specific query string parameters specifying the behavior of different API importing operations. The following shows operation-specific parameters and their supported values.</p> <p> To exclude DocumentationParts from the import, set <code>parameters</code> as <code>ignore=documentation</code>.</p> <p> To configure the endpoint type, set <code>parameters</code> as <code>endpointConfigurationTypes=EDGE</code>, <code>endpointConfigurationTypes=REGIONAL</code>, or <code>endpointConfigurationTypes=PRIVATE</code>. The default endpoint type is <code>EDGE</code>.</p> <p> To handle imported <code>basepath</code>, set <code>parameters</code> as <code>basepath=ignore</code>, <code>basepath=prepend</code> or <code>basepath=split</code>.</p> <p>For example, the AWS CLI command to exclude documentation from the imported API is:</p> <p>The AWS CLI command to set the regional endpoint on the imported API is:</p>', 'Integration$requestParameters' => '<p>A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of <code>method.request.{location}.{name}</code>, where <code>location</code> is <code>querystring</code>, <code>path</code>, or <code>header</code> and <code>name</code> must be a valid and unique method request parameter name.</p>', 'Integration$requestTemplates' => '<p>Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.</p>', 'IntegrationResponse$responseParameters' => '<p>A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of <code>method.response.header.{name}</code>, where <code>name</code> is a valid and unique header name. The mapped non-static value must match the pattern of <code>integration.response.header.{name}</code> or <code>integration.response.body.{JSON-expression}</code>, where <code>name</code> is a valid and unique response header name and <code>JSON-expression</code> is a valid JSON expression without the <code>$</code> prefix.</p>', 'IntegrationResponse$responseTemplates' => '<p>Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.</p>', 'Method$requestModels' => '<p>A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).</p>', 'MethodResponse$responseModels' => '<p>Specifies the Model resources used for the response\\'s content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.</p>', 'PutGatewayResponseRequest$responseParameters' => '<p>Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.</p>', 'PutGatewayResponseRequest$responseTemplates' => '<p>Response templates of the GatewayResponse as a string-to-string map of key-value pairs.</p>', 'PutIntegrationRequest$requestParameters' => '<p>A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of <code>method.request.{location}.{name}</code>, where <code>location</code> is <code>querystring</code>, <code>path</code>, or <code>header</code> and <code>name</code> must be a valid and unique method request parameter name.</p>', 'PutIntegrationRequest$requestTemplates' => '<p>Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.</p>', 'PutIntegrationResponseRequest$responseParameters' => '<p>A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of <code>method.response.header.{name}</code>, where <code>name</code> is a valid and unique header name. The mapped non-static value must match the pattern of <code>integration.response.header.{name}</code> or <code>integration.response.body.{JSON-expression}</code>, where <code>name</code> must be a valid and unique response header name and <code>JSON-expression</code> a valid JSON expression without the <code>$</code> prefix.</p>', 'PutIntegrationResponseRequest$responseTemplates' => '<p>Specifies a put integration response\\'s templates.</p>', 'PutMethodRequest$requestModels' => '<p>Specifies the Model resources used for the request\\'s content type. Request models are represented as a key/value map, with a content type as the key and a Model name as the value.</p>', 'PutMethodResponseRequest$responseModels' => '<p>Specifies the Model resources used for the response\\'s content type. Response models are represented as a key/value map, with a content type as the key and a Model name as the value.</p>', 'PutRestApiRequest$parameters' => '<p>Custom header parameters as part of the request. For example, to exclude DocumentationParts from an imported API, set <code>ignore=documentation</code> as a <code>parameters</code> value, as in the AWS CLI command of <code>aws apigateway import-rest-api --parameters ignore=documentation --body \\'file:///path/to/imported-api-body.json\\'</code>.</p>', 'RestApi$tags' => '<p>The collection of tags. Each tag element is associated with a given resource.</p>', 'Stage$variables' => '<p>A map that defines the stage variables for a Stage resource. Variable names can have alphanumeric and underscore characters, and the values must match <code>[A-Za-z0-9-._~:/?#&amp;=,]+</code>.</p>', 'Stage$tags' => '<p>The collection of tags. Each tag element is associated with a given resource.</p>', 'TagResourceRequest$tags' => '<p>The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with <code>aws:</code>. The tag value can be up to 256 characters.</p>', 'Tags$tags' => '<p>The collection of tags. Each tag element is associated with a given resource.</p>', 'TestInvokeAuthorizerRequest$headers' => '<p>A key-value map of headers to simulate an incoming invocation request. This is where the incoming authorization token, or identity source, should be specified.</p>', 'TestInvokeAuthorizerRequest$stageVariables' => '<p>A key-value map of stage variables to simulate an invocation on a deployed Stage.</p>', 'TestInvokeAuthorizerRequest$additionalContext' => '<p>A key-value map of additional context variables.</p>', 'TestInvokeAuthorizerResponse$claims' => '<p>The open identity claims, with any supported custom attributes, returned from the Cognito Your User Pool configured for the API.</p>', 'TestInvokeMethodRequest$headers' => '<p>A key-value map of headers to simulate an incoming invocation request.</p>', 'TestInvokeMethodRequest$stageVariables' => '<p>A key-value map of stage variables to simulate an invocation on a deployed Stage.</p>', 'TestInvokeMethodResponse$headers' => '<p>The headers of the HTTP response.</p>', 'UsagePlan$tags' => '<p>The collection of tags. Each tag element is associated with a given resource.</p>', 'VpcLink$tags' => '<p>The collection of tags. Each tag element is associated with a given resource.</p>', ], ], 'Method' => [ 'base' => '<p> Represents a client-facing interface by which the client calls the API to access back-end resources. A Method resource is integrated with an Integration resource. Both consist of a request and one or more responses. The method request takes the client input that is passed to the back end through the integration request. A method response returns the output from the back end to the client through an integration response. A method request is embodied in a Method resource, whereas an integration request is embodied in an Integration resource. On the other hand, a method response is represented by a MethodResponse resource, whereas an integration response is represented by an IntegrationResponse resource. </p>', 'refs' => [ 'MapOfMethod$value' => NULL, ], ], 'MethodResponse' => [ 'base' => '<p>Represents a method response of a given HTTP status code returned to the client. The method response is passed from the back end through the associated integration response that can be transformed using a mapping template. </p>', 'refs' => [ 'MapOfMethodResponse$value' => NULL, ], ], 'MethodSetting' => [ 'base' => '<p>Specifies the method setting properties.</p>', 'refs' => [ 'MapOfMethodSettings$value' => NULL, ], ], 'MethodSnapshot' => [ 'base' => '<p>Represents a summary of a Method resource, given a particular date and time.</p>', 'refs' => [ 'MapOfMethodSnapshot$value' => NULL, ], ], 'Model' => [ 'base' => '<p>Represents the data structure of a method\\'s request or response payload.</p>', 'refs' => [ 'ListOfModel$member' => NULL, ], ], 'Models' => [ 'base' => '<p>Represents a collection of Model resources.</p>', 'refs' => [], ], 'MutualTlsAuthentication' => [ 'base' => '<p>The mutual TLS authentication configuration for a custom domain name. If specified, API Gateway performs two-way authentication between the client and the server. Clients must present a trusted certificate to access your API.</p>', 'refs' => [ 'DomainName$mutualTlsAuthentication' => '<p>The mutual TLS authentication configuration for a custom domain name. If specified, API Gateway performs two-way authentication between the client and the server. Clients must present a trusted certificate to access your API.</p>', ], ], 'MutualTlsAuthenticationInput' => [ 'base' => '<p>The mutual TLS authentication configuration for a custom domain name. If specified, API Gateway performs two-way authentication between the client and the server. Clients must present a trusted certificate to access your API.</p>', 'refs' => [ 'CreateDomainNameRequest$mutualTlsAuthentication' => NULL, ], ], 'NotFoundException' => [ 'base' => '<p>The requested resource is not found. Make sure that the request URI is correct.</p>', 'refs' => [], ], 'NullableBoolean' => [ 'base' => NULL, 'refs' => [ 'CreateDeploymentRequest$cacheClusterEnabled' => '<p>Enables a cache cluster for the Stage resource specified in the input.</p>', 'CreateDeploymentRequest$tracingEnabled' => '<p>Specifies whether active tracing with X-ray is enabled for the Stage.</p>', 'GetApiKeyRequest$includeValue' => '<p>A boolean flag to specify whether (<code>true</code>) or not (<code>false</code>) the result contains the key value.</p>', 'GetApiKeysRequest$includeValues' => '<p>A boolean flag to specify whether (<code>true</code>) or not (<code>false</code>) the result contains key values.</p>', 'MapOfStringToBoolean$value' => NULL, 'Method$apiKeyRequired' => '<p>A boolean flag specifying whether a valid ApiKey is required to invoke this method.</p>', ], ], 'NullableInteger' => [ 'base' => NULL, 'refs' => [ 'Authorizer$authorizerResultTtlInSeconds' => '<p>The TTL in seconds of cached authorizer results. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.</p>', 'CreateAuthorizerRequest$authorizerResultTtlInSeconds' => '<p>The TTL in seconds of cached authorizer results. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.</p>', 'CreateRestApiRequest$minimumCompressionSize' => '<p>A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.</p>', 'GetApiKeysRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetAuthorizersRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetBasePathMappingsRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetClientCertificatesRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetDeploymentsRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetDocumentationPartsRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetDocumentationVersionsRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetDomainNamesRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetGatewayResponsesRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500. The GatewayResponses collection does not support pagination and the limit does not apply here.</p>', 'GetModelsRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetRequestValidatorsRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetResourcesRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetRestApisRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetSdkTypesRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetTagsRequest$limit' => '<p>(Not currently supported) The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetUsagePlanKeysRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetUsagePlansRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetUsageRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'GetVpcLinksRequest$limit' => '<p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>', 'PutIntegrationRequest$timeoutInMillis' => '<p>Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.</p>', 'RestApi$minimumCompressionSize' => '<p>A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.</p>', ], ], 'Op' => [ 'base' => NULL, 'refs' => [ 'PatchOperation$op' => '<p>An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..</p>', ], ], 'PatchOperation' => [ 'base' => '<p>For more information about supported patch operations, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html\">Patch Operations</a>.</p>', 'refs' => [ 'ListOfPatchOperation$member' => NULL, ], ], 'PathToMapOfMethodSnapshot' => [ 'base' => NULL, 'refs' => [ 'Deployment$apiSummary' => '<p>A summary of the RestApi at the date and time that the deployment resource was created.</p>', ], ], 'ProviderARN' => [ 'base' => NULL, 'refs' => [ 'ListOfARNs$member' => NULL, ], ], 'PutGatewayResponseRequest' => [ 'base' => '<p>Creates a customization of a GatewayResponse of a specified response type and status code on the given RestApi.</p>', 'refs' => [], ], 'PutIntegrationRequest' => [ 'base' => '<p>Sets up a method\\'s integration.</p>', 'refs' => [], ], 'PutIntegrationResponseRequest' => [ 'base' => '<p>Represents a put integration response request.</p>', 'refs' => [], ], 'PutMethodRequest' => [ 'base' => '<p>Request to add a method to an existing Resource resource.</p>', 'refs' => [], ], 'PutMethodResponseRequest' => [ 'base' => '<p>Request to add a MethodResponse to an existing Method resource.</p>', 'refs' => [], ], 'PutMode' => [ 'base' => NULL, 'refs' => [ 'ImportDocumentationPartsRequest$mode' => '<p>A query parameter to indicate whether to overwrite (<code>OVERWRITE</code>) any existing DocumentationParts definition or to merge (<code>MERGE</code>) the new definition into the existing one. The default value is <code>MERGE</code>.</p>', 'PutRestApiRequest$mode' => '<p>The <code>mode</code> query parameter to specify the update mode. Valid values are \"merge\" and \"overwrite\". By default, the update mode is \"merge\".</p>', ], ], 'PutRestApiRequest' => [ 'base' => '<p>A PUT request to update an existing API, with external API definitions specified as the request body.</p>', 'refs' => [], ], 'QuotaPeriodType' => [ 'base' => NULL, 'refs' => [ 'QuotaSettings$period' => '<p>The time period in which the limit applies. Valid values are \"DAY\", \"WEEK\" or \"MONTH\".</p>', ], ], 'QuotaSettings' => [ 'base' => '<p>Quotas configured for a usage plan.</p>', 'refs' => [ 'CreateUsagePlanRequest$quota' => '<p>The quota of the usage plan.</p>', 'UsagePlan$quota' => '<p>The target maximum number of permitted requests per a given unit time interval.</p>', ], ], 'RequestValidator' => [ 'base' => '<p>A set of validation rules for incoming Method requests.</p>', 'refs' => [ 'ListOfRequestValidator$member' => NULL, ], ], 'RequestValidators' => [ 'base' => '<p>A collection of RequestValidator resources of a given RestApi.</p>', 'refs' => [], ], 'Resource' => [ 'base' => '<p>Represents an API resource.</p>', 'refs' => [ 'ListOfResource$member' => NULL, ], ], 'Resources' => [ 'base' => '<p>Represents a collection of Resource resources.</p>', 'refs' => [], ], 'RestApi' => [ 'base' => '<p>Represents a REST API.</p>', 'refs' => [ 'ListOfRestApi$member' => NULL, ], ], 'RestApis' => [ 'base' => '<p>Contains references to your APIs and links that guide you in how to interact with your collection. A collection offers a paginated view of your APIs.</p>', 'refs' => [], ], 'SdkConfigurationProperty' => [ 'base' => '<p>A configuration property of an SDK type.</p>', 'refs' => [ 'ListOfSdkConfigurationProperty$member' => NULL, ], ], 'SdkResponse' => [ 'base' => '<p>The binary blob response to GetSdk, which contains the generated SDK.</p>', 'refs' => [], ], 'SdkType' => [ 'base' => '<p>A type of SDK that API Gateway can generate.</p>', 'refs' => [ 'ListOfSdkType$member' => NULL, ], ], 'SdkTypes' => [ 'base' => '<p>The collection of SdkType instances.</p>', 'refs' => [], ], 'SecurityPolicy' => [ 'base' => NULL, 'refs' => [ 'CreateDomainNameRequest$securityPolicy' => '<p>The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are <code>TLS_1_0</code> and <code>TLS_1_2</code>.</p>', 'DomainName$securityPolicy' => '<p>The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are <code>TLS_1_0</code> and <code>TLS_1_2</code>.</p>', ], ], 'ServiceUnavailableException' => [ 'base' => '<p>The requested service is not available. For details see the accompanying error message. Retry after the specified time period.</p>', 'refs' => [], ], 'Stage' => [ 'base' => '<p>Represents a unique identifier for a version of a deployed RestApi that is callable by users.</p>', 'refs' => [ 'ListOfStage$member' => NULL, ], ], 'StageKey' => [ 'base' => '<p>A reference to a unique stage identified in the format <code>{restApiId}/{stage}</code>.</p>', 'refs' => [ 'ListOfStageKeys$member' => NULL, ], ], 'Stages' => [ 'base' => '<p>A list of Stage resources that are associated with the ApiKey resource.</p>', 'refs' => [], ], 'StatusCode' => [ 'base' => '<p>The status code.</p>', 'refs' => [ 'DeleteIntegrationResponseRequest$statusCode' => '<p>Specifies a delete integration response request\\'s status code.</p>', 'DeleteMethodResponseRequest$statusCode' => '<p>The status code identifier for the MethodResponse resource.</p>', 'GatewayResponse$statusCode' => '<p>The HTTP status code for this GatewayResponse.</p>', 'GetIntegrationResponseRequest$statusCode' => '<p>Specifies a get integration response request\\'s status code.</p>', 'GetMethodResponseRequest$statusCode' => '<p>The status code for the MethodResponse resource.</p>', 'IntegrationResponse$statusCode' => '<p>Specifies the status code that is used to map the integration response to an existing MethodResponse.</p>', 'MethodResponse$statusCode' => '<p>The method response\\'s status code.</p>', 'PutGatewayResponseRequest$statusCode' => '<p>The HTTP status code of the GatewayResponse.</p>', 'PutIntegrationResponseRequest$statusCode' => '<p>Specifies the status code that is used to map the integration response to an existing MethodResponse.</p>', 'PutMethodResponseRequest$statusCode' => '<p>The method response\\'s status code.</p>', 'UpdateIntegrationResponseRequest$statusCode' => '<p>Specifies an update integration response request\\'s status code.</p>', 'UpdateMethodResponseRequest$statusCode' => '<p>The status code for the MethodResponse resource.</p>', ], ], 'String' => [ 'base' => NULL, 'refs' => [ 'AccessLogSettings$format' => '<p>A single line format of the access logs of data, as specified by selected $context variables. The format must include at least <code>$context.requestId</code>.</p>', 'AccessLogSettings$destinationArn' => '<p>The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the stream name must begin with <code>amazon-apigateway-</code>.</p>', 'Account$cloudwatchRoleArn' => '<p>The ARN of an Amazon CloudWatch role for the current Account. </p>', 'Account$apiKeyVersion' => '<p>The version of the API keys used for the account.</p>', 'ApiKey$id' => '<p>The identifier of the API Key.</p>', 'ApiKey$value' => '<p>The value of the API Key.</p>', 'ApiKey$name' => '<p>The name of the API Key.</p>', 'ApiKey$customerId' => '<p>An AWS Marketplace customer identifier , when integrating with the AWS SaaS Marketplace.</p>', 'ApiKey$description' => '<p>The description of the API Key.</p>', 'ApiKeys$position' => NULL, 'ApiStage$apiId' => '<p>API Id of the associated API stage in a usage plan.</p>', 'ApiStage$stage' => '<p>API stage name of the associated API stage in a usage plan.</p>', 'Authorizer$id' => '<p>The identifier for the authorizer resource.</p>', 'Authorizer$name' => '<p>The name of the authorizer.</p>', 'Authorizer$authType' => '<p>Optional customer-defined field, used in OpenAPI imports and exports without functional impact.</p>', 'Authorizer$authorizerUri' => '<p>Specifies the authorizer\\'s Uniform Resource Identifier (URI). For <code>TOKEN</code> or <code>REQUEST</code> authorizers, this must be a well-formed Lambda function URI, for example, <code>arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations</code>. In general, the URI has this form <code>arn:aws:apigateway:{region}:lambda:path/{service_api}</code>, where <code>{region}</code> is the same as the region hosting the Lambda function, <code>path</code> indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial <code>/</code>. For Lambda functions, this is usually of the form <code>/2015-03-31/functions/[FunctionARN]/invocations</code>.</p>', 'Authorizer$authorizerCredentials' => '<p>Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role\\'s Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.</p>', 'Authorizer$identitySource' => '<p>The identity source for which authorization is requested. For a <code>TOKEN</code> or <code>COGNITO_USER_POOLS</code> authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name is <code>Auth</code>, the header mapping expression is <code>method.request.header.Auth</code>. For the <code>REQUEST</code> authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if an <code>Auth</code> header, a <code>Name</code> query string parameter are defined as identity sources, this value is <code>method.request.header.Auth</code>, <code>method.request.querystring.Name</code>. These parameters will be used to derive the authorization caching key and to perform runtime validation of the <code>REQUEST</code> authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional. </p>', 'Authorizer$identityValidationExpression' => '<p>A validation expression for the incoming identity token. For <code>TOKEN</code> authorizers, this value is a regular expression. For <code>COGNITO_USER_POOLS</code> authorizers, API Gateway will match the <code>aud</code> field of the incoming token from the client against the specified regular expression. It will invoke the authorizer\\'s Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to the <code>REQUEST</code> authorizer.</p>', 'Authorizers$position' => NULL, 'BadRequestException$message' => NULL, 'BasePathMapping$basePath' => '<p>The base path name that callers of the API must provide as part of the URL after the domain name.</p>', 'BasePathMapping$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'BasePathMapping$stage' => '<p>The name of the associated stage.</p>', 'BasePathMappings$position' => NULL, 'CanarySettings$deploymentId' => '<p>The ID of the canary deployment.</p>', 'ClientCertificate$clientCertificateId' => '<p>The identifier of the client certificate.</p>', 'ClientCertificate$description' => '<p>The description of the client certificate.</p>', 'ClientCertificate$pemEncodedCertificate' => '<p>The PEM-encoded public key of the client certificate, which can be used to configure certificate authentication in the integration endpoint .</p>', 'ClientCertificates$position' => NULL, 'ConflictException$message' => NULL, 'CreateApiKeyRequest$name' => '<p>The name of the ApiKey.</p>', 'CreateApiKeyRequest$description' => '<p>The description of the ApiKey.</p>', 'CreateApiKeyRequest$value' => '<p>Specifies a value of the API key.</p>', 'CreateApiKeyRequest$customerId' => '<p>An AWS Marketplace customer identifier , when integrating with the AWS SaaS Marketplace.</p>', 'CreateAuthorizerRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'CreateAuthorizerRequest$name' => '<p>The name of the authorizer.</p>', 'CreateAuthorizerRequest$authType' => '<p>Optional customer-defined field, used in OpenAPI imports and exports without functional impact.</p>', 'CreateAuthorizerRequest$authorizerUri' => '<p>Specifies the authorizer\\'s Uniform Resource Identifier (URI). For <code>TOKEN</code> or <code>REQUEST</code> authorizers, this must be a well-formed Lambda function URI, for example, <code>arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations</code>. In general, the URI has this form <code>arn:aws:apigateway:{region}:lambda:path/{service_api}</code>, where <code>{region}</code> is the same as the region hosting the Lambda function, <code>path</code> indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial <code>/</code>. For Lambda functions, this is usually of the form <code>/2015-03-31/functions/[FunctionARN]/invocations</code>.</p>', 'CreateAuthorizerRequest$authorizerCredentials' => '<p>Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role\\'s Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.</p>', 'CreateAuthorizerRequest$identitySource' => '<p>The identity source for which authorization is requested. For a <code>TOKEN</code> or <code>COGNITO_USER_POOLS</code> authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name is <code>Auth</code>, the header mapping expression is <code>method.request.header.Auth</code>. For the <code>REQUEST</code> authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if an <code>Auth</code> header, a <code>Name</code> query string parameter are defined as identity sources, this value is <code>method.request.header.Auth, method.request.querystring.Name</code>. These parameters will be used to derive the authorization caching key and to perform runtime validation of the <code>REQUEST</code> authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional.</p>', 'CreateAuthorizerRequest$identityValidationExpression' => '<p>A validation expression for the incoming identity token. For <code>TOKEN</code> authorizers, this value is a regular expression. For <code>COGNITO_USER_POOLS</code> authorizers, API Gateway will match the <code>aud</code> field of the incoming token from the client against the specified regular expression. It will invoke the authorizer\\'s Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to the <code>REQUEST</code> authorizer.</p>', 'CreateBasePathMappingRequest$domainName' => '<p>The domain name of the BasePathMapping resource to create.</p>', 'CreateBasePathMappingRequest$basePath' => '<p>The base path name that callers of the API must provide as part of the URL after the domain name. This value must be unique for all of the mappings across a single API. Specify \\'(none)\\' if you do not want callers to specify a base path name after the domain name.</p>', 'CreateBasePathMappingRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'CreateBasePathMappingRequest$stage' => '<p>The name of the API\\'s stage that you want to use for this mapping. Specify \\'(none)\\' if you want callers to explicitly specify the stage name after any base path name.</p>', 'CreateDeploymentRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'CreateDeploymentRequest$stageName' => '<p>The name of the Stage resource for the Deployment resource to create.</p>', 'CreateDeploymentRequest$stageDescription' => '<p>The description of the Stage resource for the Deployment resource to create.</p>', 'CreateDeploymentRequest$description' => '<p>The description for the Deployment resource to create.</p>', 'CreateDocumentationPartRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'CreateDocumentationPartRequest$properties' => '<p>The new documentation content map of the targeted API entity. Enclosed key-value pairs are API-specific, but only OpenAPI-compliant key-value pairs can be exported and, hence, published.</p>', 'CreateDocumentationVersionRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'CreateDocumentationVersionRequest$documentationVersion' => '<p>The version identifier of the new snapshot.</p>', 'CreateDocumentationVersionRequest$stageName' => '<p>The stage name to be associated with the new documentation snapshot.</p>', 'CreateDocumentationVersionRequest$description' => '<p>A description about the new documentation snapshot.</p>', 'CreateDomainNameRequest$domainName' => '<p>The name of the DomainName resource.</p>', 'CreateDomainNameRequest$certificateName' => '<p>The user-friendly name of the certificate that will be used by edge-optimized endpoint for this domain name.</p>', 'CreateDomainNameRequest$certificateBody' => '<p>[Deprecated] The body of the server certificate that will be used by edge-optimized endpoint for this domain name provided by your certificate authority.</p>', 'CreateDomainNameRequest$certificatePrivateKey' => '<p>[Deprecated] Your edge-optimized endpoint\\'s domain name certificate\\'s private key.</p>', 'CreateDomainNameRequest$certificateChain' => '<p>[Deprecated] The intermediate certificates and optionally the root certificate, one after the other without any blank lines, used by an edge-optimized endpoint for this domain name. If you include the root certificate, your certificate chain must start with intermediate certificates and end with the root certificate. Use the intermediate certificates that were provided by your certificate authority. Do not include any intermediaries that are not in the chain of trust path.</p>', 'CreateDomainNameRequest$certificateArn' => '<p>The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain name. AWS Certificate Manager is the only supported source.</p>', 'CreateDomainNameRequest$regionalCertificateName' => '<p>The user-friendly name of the certificate that will be used by regional endpoint for this domain name.</p>', 'CreateDomainNameRequest$regionalCertificateArn' => '<p>The reference to an AWS-managed certificate that will be used by regional endpoint for this domain name. AWS Certificate Manager is the only supported source.</p>', 'CreateDomainNameRequest$ownershipVerificationCertificateArn' => '<p>The ARN of the public certificate issued by ACM to validate ownership of your custom domain. Only required when configuring mutual TLS and using an ACM imported or private CA certificate ARN as the regionalCertificateArn.</p>', 'CreateModelRequest$restApiId' => '<p>The RestApi identifier under which the Model will be created.</p>', 'CreateModelRequest$name' => '<p>The name of the model. Must be alphanumeric.</p>', 'CreateModelRequest$description' => '<p>The description of the model.</p>', 'CreateModelRequest$schema' => '<p>The schema for the model. For <code>application/json</code> models, this should be JSON schema draft 4 model.</p>', 'CreateModelRequest$contentType' => '<p>The content-type for the model.</p>', 'CreateRequestValidatorRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'CreateRequestValidatorRequest$name' => '<p>The name of the to-be-created RequestValidator.</p>', 'CreateResourceRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'CreateResourceRequest$parentId' => '<p>The parent resource\\'s identifier.</p>', 'CreateResourceRequest$pathPart' => '<p>The last path segment for this resource.</p>', 'CreateRestApiRequest$name' => '<p>The name of the RestApi.</p>', 'CreateRestApiRequest$description' => '<p>The description of the RestApi.</p>', 'CreateRestApiRequest$version' => '<p>A version identifier for the API.</p>', 'CreateRestApiRequest$cloneFrom' => '<p>The ID of the RestApi that you want to clone from.</p>', 'CreateRestApiRequest$policy' => '<p>A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.</p>', 'CreateStageRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'CreateStageRequest$stageName' => '<p>The name for the Stage resource. Stage names can only contain alphanumeric characters, hyphens, and underscores. Maximum length is 128 characters.</p>', 'CreateStageRequest$deploymentId' => '<p>The identifier of the Deployment resource for the Stage resource.</p>', 'CreateStageRequest$description' => '<p>The description of the Stage resource.</p>', 'CreateStageRequest$documentationVersion' => '<p>The version of the associated API documentation.</p>', 'CreateUsagePlanKeyRequest$usagePlanId' => '<p>The Id of the UsagePlan resource representing the usage plan containing the to-be-created UsagePlanKey resource representing a plan customer.</p>', 'CreateUsagePlanKeyRequest$keyId' => '<p>The identifier of a UsagePlanKey resource for a plan customer.</p>', 'CreateUsagePlanKeyRequest$keyType' => '<p>The type of a UsagePlanKey resource for a plan customer.</p>', 'CreateUsagePlanRequest$name' => '<p>The name of the usage plan.</p>', 'CreateUsagePlanRequest$description' => '<p>The description of the usage plan.</p>', 'CreateVpcLinkRequest$name' => '<p>The name used to label and identify the VPC link.</p>', 'CreateVpcLinkRequest$description' => '<p>The description of the VPC link.</p>', 'DeleteApiKeyRequest$apiKey' => '<p>The identifier of the ApiKey resource to be deleted.</p>', 'DeleteAuthorizerRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'DeleteAuthorizerRequest$authorizerId' => '<p>The identifier of the Authorizer resource.</p>', 'DeleteBasePathMappingRequest$domainName' => '<p>The domain name of the BasePathMapping resource to delete.</p>', 'DeleteBasePathMappingRequest$basePath' => '<p>The base path name of the BasePathMapping resource to delete.</p> <p>To specify an empty base path, set this parameter to <code>\\'(none)\\'</code>.</p>', 'DeleteClientCertificateRequest$clientCertificateId' => '<p>The identifier of the ClientCertificate resource to be deleted.</p>', 'DeleteDeploymentRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'DeleteDeploymentRequest$deploymentId' => '<p>The identifier of the Deployment resource to delete.</p>', 'DeleteDocumentationPartRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'DeleteDocumentationPartRequest$documentationPartId' => '<p>The identifier of the to-be-deleted documentation part.</p>', 'DeleteDocumentationVersionRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'DeleteDocumentationVersionRequest$documentationVersion' => '<p>The version identifier of a to-be-deleted documentation snapshot.</p>', 'DeleteDomainNameRequest$domainName' => '<p>The name of the DomainName resource to be deleted.</p>', 'DeleteGatewayResponseRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'DeleteIntegrationRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'DeleteIntegrationRequest$resourceId' => '<p>Specifies a delete integration request\\'s resource identifier.</p>', 'DeleteIntegrationRequest$httpMethod' => '<p>Specifies a delete integration request\\'s HTTP method.</p>', 'DeleteIntegrationResponseRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'DeleteIntegrationResponseRequest$resourceId' => '<p>Specifies a delete integration response request\\'s resource identifier.</p>', 'DeleteIntegrationResponseRequest$httpMethod' => '<p>Specifies a delete integration response request\\'s HTTP method.</p>', 'DeleteMethodRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'DeleteMethodRequest$resourceId' => '<p>The Resource identifier for the Method resource.</p>', 'DeleteMethodRequest$httpMethod' => '<p>The HTTP verb of the Method resource.</p>', 'DeleteMethodResponseRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'DeleteMethodResponseRequest$resourceId' => '<p>The Resource identifier for the MethodResponse resource.</p>', 'DeleteMethodResponseRequest$httpMethod' => '<p>The HTTP verb of the Method resource.</p>', 'DeleteModelRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'DeleteModelRequest$modelName' => '<p>The name of the model to delete.</p>', 'DeleteRequestValidatorRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'DeleteRequestValidatorRequest$requestValidatorId' => '<p>The identifier of the RequestValidator to be deleted.</p>', 'DeleteResourceRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'DeleteResourceRequest$resourceId' => '<p>The identifier of the Resource resource.</p>', 'DeleteRestApiRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'DeleteStageRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'DeleteStageRequest$stageName' => '<p>The name of the Stage resource to delete.</p>', 'DeleteUsagePlanKeyRequest$usagePlanId' => '<p>The Id of the UsagePlan resource representing the usage plan containing the to-be-deleted UsagePlanKey resource representing a plan customer.</p>', 'DeleteUsagePlanKeyRequest$keyId' => '<p>The Id of the UsagePlanKey resource to be deleted.</p>', 'DeleteUsagePlanRequest$usagePlanId' => '<p>The Id of the to-be-deleted usage plan.</p>', 'DeleteVpcLinkRequest$vpcLinkId' => '<p>The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.</p>', 'Deployment$id' => '<p>The identifier for the deployment resource.</p>', 'Deployment$description' => '<p>The description for the deployment resource.</p>', 'Deployments$position' => NULL, 'DocumentationPart$id' => '<p>The DocumentationPart identifier, generated by API Gateway when the <code>DocumentationPart</code> is created.</p>', 'DocumentationPart$properties' => '<p>A content map of API-specific key-value pairs describing the targeted API entity. The map must be encoded as a JSON string, e.g., <code>\"{ \\\\\"description\\\\\": \\\\\"The API does ...\\\\\" }\"</code>. Only OpenAPI-compliant documentation-related fields from the properties map are exported and, hence, published as part of the API entity definitions, while the original documentation parts are exported in a OpenAPI extension of <code>x-amazon-apigateway-documentation</code>.</p>', 'DocumentationPartLocation$path' => '<p>The URL path of the target. It is a valid field for the API entity types of <code>RESOURCE</code>, <code>METHOD</code>, <code>PATH_PARAMETER</code>, <code>QUERY_PARAMETER</code>, <code>REQUEST_HEADER</code>, <code>REQUEST_BODY</code>, <code>RESPONSE</code>, <code>RESPONSE_HEADER</code>, and <code>RESPONSE_BODY</code>. The default value is <code>/</code> for the root resource. When an applicable child entity inherits the content of another entity of the same type with more general specifications of the other <code>location</code> attributes, the child entity\\'s <code>path</code> attribute must match that of the parent entity as a prefix.</p>', 'DocumentationPartLocation$method' => '<p>The HTTP verb of a method. It is a valid field for the API entity types of <code>METHOD</code>, <code>PATH_PARAMETER</code>, <code>QUERY_PARAMETER</code>, <code>REQUEST_HEADER</code>, <code>REQUEST_BODY</code>, <code>RESPONSE</code>, <code>RESPONSE_HEADER</code>, and <code>RESPONSE_BODY</code>. The default value is <code>*</code> for any method. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other <code>location</code> attributes, the child entity\\'s <code>method</code> attribute must match that of the parent entity exactly.</p>', 'DocumentationPartLocation$name' => '<p>The name of the targeted API entity. It is a valid and required field for the API entity types of <code>AUTHORIZER</code>, <code>MODEL</code>, <code>PATH_PARAMETER</code>, <code>QUERY_PARAMETER</code>, <code>REQUEST_HEADER</code>, <code>REQUEST_BODY</code> and <code>RESPONSE_HEADER</code>. It is an invalid field for any other entity type.</p>', 'DocumentationParts$position' => NULL, 'DocumentationVersion$version' => '<p>The version identifier of the API documentation snapshot.</p>', 'DocumentationVersion$description' => '<p>The description of the API documentation snapshot.</p>', 'DocumentationVersions$position' => NULL, 'DomainName$domainName' => '<p>The custom domain name as an API host name, for example, <code>my-api.example.com</code>.</p>', 'DomainName$certificateName' => '<p>The name of the certificate that will be used by edge-optimized endpoint for this domain name.</p>', 'DomainName$certificateArn' => '<p>The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain name. AWS Certificate Manager is the only supported source.</p>', 'DomainName$regionalDomainName' => '<p>The domain name associated with the regional endpoint for this custom domain name. You set up this association by adding a DNS record that points the custom domain name to this regional domain name. The regional domain name is returned by API Gateway when you create a regional endpoint.</p>', 'DomainName$regionalHostedZoneId' => '<p>The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway. </p>', 'DomainName$regionalCertificateName' => '<p>The name of the certificate that will be used for validating the regional domain name.</p>', 'DomainName$regionalCertificateArn' => '<p>The reference to an AWS-managed certificate that will be used for validating the regional domain name. AWS Certificate Manager is the only supported source.</p>', 'DomainName$distributionDomainName' => '<p>The domain name of the Amazon CloudFront distribution associated with this custom domain name for an edge-optimized endpoint. You set up this association when adding a DNS record pointing the custom domain name to this distribution name. For more information about CloudFront distributions, see the Amazon CloudFront documentation.</p>', 'DomainName$distributionHostedZoneId' => '<p>The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized endpoint. The valid value is <code>Z2FDTNDATAQYW2</code> for all the regions. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway. </p>', 'DomainName$domainNameStatusMessage' => '<p>An optional text message containing detailed information about status of the DomainName migration.</p>', 'DomainName$ownershipVerificationCertificateArn' => '<p>The ARN of the public certificate issued by ACM to validate ownership of your custom domain. Only required when configuring mutual TLS and using an ACM imported or private CA certificate ARN as the regionalCertificateArn.</p>', 'DomainNames$position' => NULL, 'ExportResponse$contentType' => '<p>The content-type header value in the HTTP response. This will correspond to a valid \\'accept\\' type in the request.</p>', 'ExportResponse$contentDisposition' => '<p>The content-disposition header value in the HTTP response.</p>', 'FlushStageAuthorizersCacheRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'FlushStageAuthorizersCacheRequest$stageName' => '<p>The name of the stage to flush.</p>', 'FlushStageCacheRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'FlushStageCacheRequest$stageName' => '<p>The name of the stage to flush its cache.</p>', 'GatewayResponses$position' => NULL, 'GenerateClientCertificateRequest$description' => '<p>The description of the ClientCertificate.</p>', 'GetApiKeyRequest$apiKey' => '<p>The identifier of the ApiKey resource.</p>', 'GetApiKeysRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'GetApiKeysRequest$nameQuery' => '<p>The name of queried API keys.</p>', 'GetApiKeysRequest$customerId' => '<p>The identifier of a customer in AWS Marketplace or an external system, such as a developer portal.</p>', 'GetAuthorizerRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetAuthorizerRequest$authorizerId' => '<p>The identifier of the Authorizer resource.</p>', 'GetAuthorizersRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetAuthorizersRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'GetBasePathMappingRequest$domainName' => '<p>The domain name of the BasePathMapping resource to be described.</p>', 'GetBasePathMappingRequest$basePath' => '<p>The base path name that callers of the API must provide as part of the URL after the domain name. This value must be unique for all of the mappings across a single API. Specify \\'(none)\\' if you do not want callers to specify any base path name after the domain name.</p>', 'GetBasePathMappingsRequest$domainName' => '<p>The domain name of a BasePathMapping resource.</p>', 'GetBasePathMappingsRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'GetClientCertificateRequest$clientCertificateId' => '<p>The identifier of the ClientCertificate resource to be described.</p>', 'GetClientCertificatesRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'GetDeploymentRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetDeploymentRequest$deploymentId' => '<p>The identifier of the Deployment resource to get information about.</p>', 'GetDeploymentsRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetDeploymentsRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'GetDocumentationPartRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetDocumentationPartRequest$documentationPartId' => '<p>The string identifier of the associated RestApi.</p>', 'GetDocumentationPartsRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetDocumentationPartsRequest$nameQuery' => '<p>The name of API entities of the to-be-retrieved documentation parts.</p>', 'GetDocumentationPartsRequest$path' => '<p>The path of API entities of the to-be-retrieved documentation parts.</p>', 'GetDocumentationPartsRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'GetDocumentationVersionRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetDocumentationVersionRequest$documentationVersion' => '<p>The version identifier of the to-be-retrieved documentation snapshot.</p>', 'GetDocumentationVersionsRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetDocumentationVersionsRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'GetDomainNameRequest$domainName' => '<p>The name of the DomainName resource.</p>', 'GetDomainNamesRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'GetExportRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetExportRequest$stageName' => '<p>The name of the Stage that will be exported.</p>', 'GetExportRequest$exportType' => '<p>The type of export. Acceptable values are \\'oas30\\' for OpenAPI 3.0.x and \\'swagger\\' for Swagger/OpenAPI 2.0.</p>', 'GetExportRequest$accepts' => '<p>The content-type of the export, for example <code>application/json</code>. Currently <code>application/json</code> and <code>application/yaml</code> are supported for <code>exportType</code> of<code>oas30</code> and <code>swagger</code>. This should be specified in the <code>Accept</code> header for direct API requests.</p>', 'GetGatewayResponseRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetGatewayResponsesRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetGatewayResponsesRequest$position' => '<p>The current pagination position in the paged result set. The GatewayResponse collection does not support pagination and the position does not apply here.</p>', 'GetIntegrationRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetIntegrationRequest$resourceId' => '<p>Specifies a get integration request\\'s resource identifier</p>', 'GetIntegrationRequest$httpMethod' => '<p>Specifies a get integration request\\'s HTTP method.</p>', 'GetIntegrationResponseRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetIntegrationResponseRequest$resourceId' => '<p>Specifies a get integration response request\\'s resource identifier.</p>', 'GetIntegrationResponseRequest$httpMethod' => '<p>Specifies a get integration response request\\'s HTTP method.</p>', 'GetMethodRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetMethodRequest$resourceId' => '<p>The Resource identifier for the Method resource.</p>', 'GetMethodRequest$httpMethod' => '<p>Specifies the method request\\'s HTTP method type.</p>', 'GetMethodResponseRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetMethodResponseRequest$resourceId' => '<p>The Resource identifier for the MethodResponse resource.</p>', 'GetMethodResponseRequest$httpMethod' => '<p>The HTTP verb of the Method resource.</p>', 'GetModelRequest$restApiId' => '<p>The RestApi identifier under which the Model exists.</p>', 'GetModelRequest$modelName' => '<p>The name of the model as an identifier.</p>', 'GetModelTemplateRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetModelTemplateRequest$modelName' => '<p>The name of the model for which to generate a template.</p>', 'GetModelsRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetModelsRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'GetRequestValidatorRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetRequestValidatorRequest$requestValidatorId' => '<p>The identifier of the RequestValidator to be retrieved.</p>', 'GetRequestValidatorsRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetRequestValidatorsRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'GetResourceRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetResourceRequest$resourceId' => '<p>The identifier for the Resource resource.</p>', 'GetResourcesRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetResourcesRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'GetRestApiRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetRestApisRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'GetSdkRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetSdkRequest$stageName' => '<p>The name of the Stage that the SDK will use.</p>', 'GetSdkRequest$sdkType' => '<p>The language for the generated SDK. Currently <code>java</code>, <code>javascript</code>, <code>android</code>, <code>objectivec</code> (for iOS), <code>swift</code> (for iOS), and <code>ruby</code> are supported.</p>', 'GetSdkTypeRequest$id' => '<p>The identifier of the queried SdkType instance.</p>', 'GetSdkTypesRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'GetStageRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetStageRequest$stageName' => '<p>The name of the Stage resource to get information about.</p>', 'GetStagesRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'GetStagesRequest$deploymentId' => '<p>The stages\\' deployment identifiers.</p>', 'GetTagsRequest$resourceArn' => '<p>The ARN of a resource that can be tagged.</p>', 'GetTagsRequest$position' => '<p>(Not currently supported) The current pagination position in the paged result set.</p>', 'GetUsagePlanKeyRequest$usagePlanId' => '<p>The Id of the UsagePlan resource representing the usage plan containing the to-be-retrieved UsagePlanKey resource representing a plan customer.</p>', 'GetUsagePlanKeyRequest$keyId' => '<p>The key Id of the to-be-retrieved UsagePlanKey resource representing a plan customer.</p>', 'GetUsagePlanKeysRequest$usagePlanId' => '<p>The Id of the UsagePlan resource representing the usage plan containing the to-be-retrieved UsagePlanKey resource representing a plan customer.</p>', 'GetUsagePlanKeysRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'GetUsagePlanKeysRequest$nameQuery' => '<p>A query parameter specifying the name of the to-be-returned usage plan keys.</p>', 'GetUsagePlanRequest$usagePlanId' => '<p>The identifier of the UsagePlan resource to be retrieved.</p>', 'GetUsagePlansRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'GetUsagePlansRequest$keyId' => '<p>The identifier of the API key associated with the usage plans.</p>', 'GetUsageRequest$usagePlanId' => '<p>The Id of the usage plan associated with the usage data.</p>', 'GetUsageRequest$keyId' => '<p>The Id of the API key associated with the resultant usage data.</p>', 'GetUsageRequest$startDate' => '<p>The starting date (e.g., 2016-01-01) of the usage data.</p>', 'GetUsageRequest$endDate' => '<p>The ending date (e.g., 2016-12-31) of the usage data.</p>', 'GetUsageRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'GetVpcLinkRequest$vpcLinkId' => '<p>The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.</p>', 'GetVpcLinksRequest$position' => '<p>The current pagination position in the paged result set.</p>', 'ImportDocumentationPartsRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'Integration$httpMethod' => '<p>Specifies the integration\\'s HTTP method type.</p>', 'Integration$uri' => '<p>Specifies Uniform Resource Identifier (URI) of the integration endpoint.</p> <p>For <code>HTTP</code> or <code>HTTP_PROXY</code> integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where <code>connectionType</code> is not <code>VPC_LINK</code>, or private integration, where <code>connectionType</code> is <code>VPC_LINK</code>. For a private HTTP integration, the URI is not used for routing. For <code>AWS</code> or <code>AWS_PROXY</code> integrations, the URI is of the form <code>arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}</code>. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&amp;{p1}={v1}&amp;p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an AWS service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either <code>arn:aws:apigateway:us-west-2:s3:action/GetObject&amp;Bucket={bucket}&amp;Key={key}</code> or <code>arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}</code> </p>', 'Integration$connectionId' => '<p>The ID of the VpcLink used for the integration when <code>connectionType=VPC_LINK</code> and undefined, otherwise.</p>', 'Integration$credentials' => '<p>Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role\\'s Amazon Resource Name (ARN). To require that the caller\\'s identity be passed through from the request, specify the string <code>arn:aws:iam::\\\\*:user/\\\\*</code>. To use resource-based permissions on supported AWS services, specify null.</p>', 'Integration$passthroughBehavior' => '<p>Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in <code>requestTemplates</code>. The valid value is one of the following: <code>WHEN_NO_MATCH</code>: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. <code>WHEN_NO_TEMPLATES</code>: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. <code>NEVER</code>: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.</p>', 'Integration$cacheNamespace' => '<p>Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the <code>cacheNamespace</code>. You can specify the same <code>cacheNamespace</code> across resources to return the same cached data for requests to different resources.</p>', 'IntegrationResponse$selectionPattern' => '<p>Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the <code>.+</code> regex to match error response. However, make sure that the error response does not contain any newline (<code>\\\\n</code>) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.</p>', 'LimitExceededException$retryAfterSeconds' => NULL, 'LimitExceededException$message' => NULL, 'ListOfString$member' => NULL, 'MapOfApiStageThrottleSettings$key' => NULL, 'MapOfIntegrationResponse$key' => NULL, 'MapOfKeyUsages$key' => NULL, 'MapOfMethod$key' => NULL, 'MapOfMethodResponse$key' => NULL, 'MapOfMethodSettings$key' => NULL, 'MapOfMethodSnapshot$key' => NULL, 'MapOfStringToBoolean$key' => NULL, 'MapOfStringToList$key' => NULL, 'MapOfStringToString$key' => NULL, 'MapOfStringToString$value' => NULL, 'Method$httpMethod' => '<p>The method\\'s HTTP verb.</p>', 'Method$authorizationType' => '<p>The method\\'s authorization type. Valid values are <code>NONE</code> for open access, <code>AWS_IAM</code> for using AWS IAM permissions, <code>CUSTOM</code> for using a custom authorizer, or <code>COGNITO_USER_POOLS</code> for using a Cognito user pool.</p>', 'Method$authorizerId' => '<p>The identifier of an Authorizer to use on this method. The <code>authorizationType</code> must be <code>CUSTOM</code>.</p>', 'Method$requestValidatorId' => '<p>The identifier of a RequestValidator for request validation.</p>', 'Method$operationName' => '<p>A human-friendly operation identifier for the method. For example, you can assign the <code>operationName</code> of <code>ListPets</code> for the <code>GET /pets</code> method in the <code>PetStore</code> example.</p>', 'MethodSetting$loggingLevel' => '<p>Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is <code>/{method_setting_key}/logging/loglevel</code>, and the available levels are <code>OFF</code>, <code>ERROR</code>, and <code>INFO</code>. Choose <code>ERROR</code> to write only error-level entries to CloudWatch Logs, or choose <code>INFO</code> to include all <code>ERROR</code> events as well as extra informational events.</p>', 'MethodSnapshot$authorizationType' => '<p>The method\\'s authorization type. Valid values are <code>NONE</code> for open access, <code>AWS_IAM</code> for using AWS IAM permissions, <code>CUSTOM</code> for using a custom authorizer, or <code>COGNITO_USER_POOLS</code> for using a Cognito user pool.</p>', 'Model$id' => '<p>The identifier for the model resource.</p>', 'Model$name' => '<p>The name of the model. Must be an alphanumeric string.</p>', 'Model$description' => '<p>The description of the model.</p>', 'Model$schema' => '<p>The schema for the model. For <code>application/json</code> models, this should be JSON schema draft 4 model. Do not include \"\\\\*/\" characters in the description of any properties because such \"\\\\*/\" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API\\'s SDK generated by API Gateway to fail.</p>', 'Model$contentType' => '<p>The content-type for the model.</p>', 'Models$position' => NULL, 'MutualTlsAuthentication$truststoreUri' => '<p>An Amazon S3 URL that specifies the truststore for mutual TLS authentication, for example <code>s3://bucket-name/key-name</code>. The truststore can contain certificates from public or private certificate authorities. To update the truststore, upload a new version to S3, and then update your custom domain name to use the new version. To update the truststore, you must have permissions to access the S3 object.</p>', 'MutualTlsAuthentication$truststoreVersion' => '<p>The version of the S3 object that contains your truststore. To specify a version, you must have versioning enabled for the S3 bucket.</p>', 'MutualTlsAuthenticationInput$truststoreUri' => '<p>An Amazon S3 URL that specifies the truststore for mutual TLS authentication, for example <code>s3://bucket-name/key-name</code>. The truststore can contain certificates from public or private certificate authorities. To update the truststore, upload a new version to S3, and then update your custom domain name to use the new version. To update the truststore, you must have permissions to access the S3 object.</p>', 'MutualTlsAuthenticationInput$truststoreVersion' => '<p>The version of the S3 object that contains your truststore. To specify a version, you must have versioning enabled for the S3 bucket</p>', 'NotFoundException$message' => NULL, 'PatchOperation$path' => '<p>The op operation\\'s target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {\"name\":\"value\"}, the path for this property is /name. If the name property value is a JSON object (e.g., {\"name\": {\"child/name\": \"child-value\"}}), the path for the child/name property will be /name/child~1name. Any slash (\"/\") character appearing in path names must be escaped with \"~1\", as shown in the example above. Each op operation can have only one path associated with it.</p>', 'PatchOperation$value' => '<p>The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., \\'{\"a\": ...}\\'.</p>', 'PatchOperation$from' => '<p>The copy update operation\\'s source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with \"op\":\"copy\", \"from\":\"/canarySettings/deploymentId\" and \"path\":\"/deploymentId\".</p>', 'PathToMapOfMethodSnapshot$key' => NULL, 'PutGatewayResponseRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'PutIntegrationRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'PutIntegrationRequest$resourceId' => '<p>Specifies a put integration request\\'s resource ID.</p>', 'PutIntegrationRequest$httpMethod' => '<p>Specifies the HTTP method for the integration.</p>', 'PutIntegrationRequest$integrationHttpMethod' => '<p>The HTTP method for the integration.</p>', 'PutIntegrationRequest$uri' => '<p>Specifies Uniform Resource Identifier (URI) of the integration endpoint. For HTTP or <code>HTTP_PROXY</code> integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where <code>connectionType</code> is not <code>VPC_LINK</code>, or private integration, where <code>connectionType</code> is <code>VPC_LINK</code>. For a private HTTP integration, the URI is not used for routing. For <code>AWS</code> or <code>AWS_PROXY</code> integrations, the URI is of the form <code>arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api</code>}. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&amp;{p1}={v1}&amp;p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an Amazon Web Services service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of <code>GetObject</code>, the <code>uri</code> can be either <code>arn:aws:apigateway:us-west-2:s3:action/GetObject&amp;Bucket={bucket}&amp;Key={key}</code> or <code>arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}</code>.</p>', 'PutIntegrationRequest$connectionId' => '<p>The ID of the VpcLink used for the integration. Specify this value only if you specify <code>VPC_LINK</code> as the connection type.</p>', 'PutIntegrationRequest$credentials' => '<p>Specifies whether credentials are required for a put integration.</p>', 'PutIntegrationRequest$passthroughBehavior' => '<p>Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the <code>requestTemplates</code> property on the Integration resource. There are three valid values: <code>WHEN_NO_MATCH</code>, <code>WHEN_NO_TEMPLATES</code>, and <code>NEVER</code>. </p>', 'PutIntegrationRequest$cacheNamespace' => '<p>Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the <code>cacheNamespace</code>. You can specify the same <code>cacheNamespace</code> across resources to return the same cached data for requests to different resources.</p>', 'PutIntegrationResponseRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'PutIntegrationResponseRequest$resourceId' => '<p>Specifies a put integration response request\\'s resource identifier.</p>', 'PutIntegrationResponseRequest$httpMethod' => '<p>Specifies a put integration response request\\'s HTTP method.</p>', 'PutIntegrationResponseRequest$selectionPattern' => '<p>Specifies the selection pattern of a put integration response.</p>', 'PutMethodRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'PutMethodRequest$resourceId' => '<p>The Resource identifier for the new Method resource.</p>', 'PutMethodRequest$httpMethod' => '<p>Specifies the method request\\'s HTTP method type.</p>', 'PutMethodRequest$authorizationType' => '<p>The method\\'s authorization type. Valid values are <code>NONE</code> for open access, <code>AWS_IAM</code> for using AWS IAM permissions, <code>CUSTOM</code> for using a custom authorizer, or <code>COGNITO_USER_POOLS</code> for using a Cognito user pool.</p>', 'PutMethodRequest$authorizerId' => '<p>Specifies the identifier of an Authorizer to use on this Method, if the type is CUSTOM or COGNITO_USER_POOLS. The authorizer identifier is generated by API Gateway when you created the authorizer.</p>', 'PutMethodRequest$operationName' => '<p>A human-friendly operation identifier for the method. For example, you can assign the <code>operationName</code> of <code>ListPets</code> for the <code>GET /pets</code> method in the <code>PetStore</code> example.</p>', 'PutMethodRequest$requestValidatorId' => '<p>The identifier of a RequestValidator for validating the method request.</p>', 'PutMethodResponseRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'PutMethodResponseRequest$resourceId' => '<p>The Resource identifier for the Method resource.</p>', 'PutMethodResponseRequest$httpMethod' => '<p>The HTTP verb of the Method resource.</p>', 'PutRestApiRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'RequestValidator$id' => '<p>The identifier of this RequestValidator.</p>', 'RequestValidator$name' => '<p>The name of this RequestValidator</p>', 'RequestValidators$position' => NULL, 'Resource$id' => '<p>The resource\\'s identifier.</p>', 'Resource$parentId' => '<p>The parent resource\\'s identifier.</p>', 'Resource$pathPart' => '<p>The last path segment for this resource.</p>', 'Resource$path' => '<p>The full path for this resource.</p>', 'Resources$position' => NULL, 'RestApi$id' => '<p>The API\\'s identifier. This identifier is unique across all of your APIs in API Gateway.</p>', 'RestApi$name' => '<p>The API\\'s name.</p>', 'RestApi$description' => '<p>The API\\'s description.</p>', 'RestApi$version' => '<p>A version identifier for the API.</p>', 'RestApi$policy' => '<p>A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.</p>', 'RestApis$position' => NULL, 'SdkConfigurationProperty$name' => '<p>The name of a an SdkType configuration property.</p>', 'SdkConfigurationProperty$friendlyName' => '<p>The user-friendly name of an SdkType configuration property.</p>', 'SdkConfigurationProperty$description' => '<p>The description of an SdkType configuration property.</p>', 'SdkConfigurationProperty$defaultValue' => '<p>The default value of an SdkType configuration property.</p>', 'SdkResponse$contentType' => '<p>The content-type header value in the HTTP response.</p>', 'SdkResponse$contentDisposition' => '<p>The content-disposition header value in the HTTP response.</p>', 'SdkType$id' => '<p>The identifier of an SdkType instance.</p>', 'SdkType$friendlyName' => '<p>The user-friendly name of an SdkType instance.</p>', 'SdkType$description' => '<p>The description of an SdkType.</p>', 'SdkTypes$position' => NULL, 'ServiceUnavailableException$retryAfterSeconds' => NULL, 'ServiceUnavailableException$message' => NULL, 'Stage$deploymentId' => '<p>The identifier of the Deployment that the stage points to.</p>', 'Stage$clientCertificateId' => '<p>The identifier of a client certificate for an API stage.</p>', 'Stage$stageName' => '<p>The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to API Gateway. Stage names can only contain alphanumeric characters, hyphens, and underscores. Maximum length is 128 characters.</p>', 'Stage$description' => '<p>The stage\\'s description.</p>', 'Stage$documentationVersion' => '<p>The version of the associated API documentation.</p>', 'Stage$webAclArn' => '<p>The ARN of the WebAcl associated with the Stage.</p>', 'StageKey$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'StageKey$stageName' => '<p>The stage name associated with the stage key.</p>', 'TagResourceRequest$resourceArn' => '<p>The ARN of a resource that can be tagged.</p>', 'Template$value' => '<p>The Apache Velocity Template Language (VTL) template content used for the template resource.</p>', 'TestInvokeAuthorizerRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'TestInvokeAuthorizerRequest$authorizerId' => '<p>Specifies a test invoke authorizer request\\'s Authorizer ID.</p>', 'TestInvokeAuthorizerRequest$pathWithQueryString' => '<p>The URI path, including query string, of the simulated invocation request. Use this to specify path parameters and query string parameters.</p>', 'TestInvokeAuthorizerRequest$body' => '<p>The simulated request body of an incoming invocation request.</p>', 'TestInvokeAuthorizerResponse$log' => '<p>The API Gateway execution log for the test authorizer request.</p>', 'TestInvokeAuthorizerResponse$principalId' => '<p>The principal identity returned by the Authorizer</p>', 'TestInvokeAuthorizerResponse$policy' => '<p>The JSON policy document returned by the Authorizer</p>', 'TestInvokeMethodRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'TestInvokeMethodRequest$resourceId' => '<p>Specifies a test invoke method request\\'s resource ID.</p>', 'TestInvokeMethodRequest$httpMethod' => '<p>Specifies a test invoke method request\\'s HTTP method.</p>', 'TestInvokeMethodRequest$pathWithQueryString' => '<p>The URI path, including query string, of the simulated invocation request. Use this to specify path parameters and query string parameters.</p>', 'TestInvokeMethodRequest$body' => '<p>The simulated request body of an incoming invocation request.</p>', 'TestInvokeMethodRequest$clientCertificateId' => '<p>A ClientCertificate identifier to use in the test invocation. API Gateway will use the certificate when making the HTTPS request to the defined back-end endpoint.</p>', 'TestInvokeMethodResponse$body' => '<p>The body of the HTTP response.</p>', 'TestInvokeMethodResponse$log' => '<p>The API Gateway execution log for the test invoke request.</p>', 'TooManyRequestsException$retryAfterSeconds' => NULL, 'TooManyRequestsException$message' => NULL, 'UnauthorizedException$message' => NULL, 'UntagResourceRequest$resourceArn' => '<p>The ARN of a resource that can be tagged.</p>', 'UpdateApiKeyRequest$apiKey' => '<p>The identifier of the ApiKey resource to be updated.</p>', 'UpdateAuthorizerRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'UpdateAuthorizerRequest$authorizerId' => '<p>The identifier of the Authorizer resource.</p>', 'UpdateBasePathMappingRequest$domainName' => '<p>The domain name of the BasePathMapping resource to change.</p>', 'UpdateBasePathMappingRequest$basePath' => '<p>The base path of the BasePathMapping resource to change.</p> <p>To specify an empty base path, set this parameter to <code>\\'(none)\\'</code>.</p>', 'UpdateClientCertificateRequest$clientCertificateId' => '<p>The identifier of the ClientCertificate resource to be updated.</p>', 'UpdateDeploymentRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'UpdateDeploymentRequest$deploymentId' => '<p>The replacement identifier for the Deployment resource to change information about.</p>', 'UpdateDocumentationPartRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'UpdateDocumentationPartRequest$documentationPartId' => '<p>The identifier of the to-be-updated documentation part.</p>', 'UpdateDocumentationVersionRequest$restApiId' => '<p>The string identifier of the associated RestApi..</p>', 'UpdateDocumentationVersionRequest$documentationVersion' => '<p>The version identifier of the to-be-updated documentation version.</p>', 'UpdateDomainNameRequest$domainName' => '<p>The name of the DomainName resource to be changed.</p>', 'UpdateGatewayResponseRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'UpdateIntegrationRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'UpdateIntegrationRequest$resourceId' => '<p>Represents an update integration request\\'s resource identifier.</p>', 'UpdateIntegrationRequest$httpMethod' => '<p>Represents an update integration request\\'s HTTP method.</p>', 'UpdateIntegrationResponseRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'UpdateIntegrationResponseRequest$resourceId' => '<p>Specifies an update integration response request\\'s resource identifier.</p>', 'UpdateIntegrationResponseRequest$httpMethod' => '<p>Specifies an update integration response request\\'s HTTP method.</p>', 'UpdateMethodRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'UpdateMethodRequest$resourceId' => '<p>The Resource identifier for the Method resource.</p>', 'UpdateMethodRequest$httpMethod' => '<p>The HTTP verb of the Method resource.</p>', 'UpdateMethodResponseRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'UpdateMethodResponseRequest$resourceId' => '<p>The Resource identifier for the MethodResponse resource.</p>', 'UpdateMethodResponseRequest$httpMethod' => '<p>The HTTP verb of the Method resource.</p>', 'UpdateModelRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'UpdateModelRequest$modelName' => '<p>The name of the model to update.</p>', 'UpdateRequestValidatorRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'UpdateRequestValidatorRequest$requestValidatorId' => '<p>The identifier of RequestValidator to be updated.</p>', 'UpdateResourceRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'UpdateResourceRequest$resourceId' => '<p>The identifier of the Resource resource.</p>', 'UpdateRestApiRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'UpdateStageRequest$restApiId' => '<p>The string identifier of the associated RestApi.</p>', 'UpdateStageRequest$stageName' => '<p>The name of the Stage resource to change information about.</p>', 'UpdateUsagePlanRequest$usagePlanId' => '<p>The Id of the to-be-updated usage plan.</p>', 'UpdateUsageRequest$usagePlanId' => '<p>The Id of the usage plan associated with the usage data.</p>', 'UpdateUsageRequest$keyId' => '<p>The identifier of the API key associated with the usage plan in which a temporary extension is granted to the remaining quota.</p>', 'UpdateVpcLinkRequest$vpcLinkId' => '<p>The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.</p>', 'Usage$usagePlanId' => '<p>The plan Id associated with this usage data.</p>', 'Usage$startDate' => '<p>The starting date of the usage data.</p>', 'Usage$endDate' => '<p>The ending date of the usage data.</p>', 'Usage$position' => NULL, 'UsagePlan$id' => '<p>The identifier of a UsagePlan resource.</p>', 'UsagePlan$name' => '<p>The name of a usage plan.</p>', 'UsagePlan$description' => '<p>The description of a usage plan.</p>', 'UsagePlan$productCode' => '<p>The AWS Markeplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.</p>', 'UsagePlanKey$id' => '<p>The Id of a usage plan key.</p>', 'UsagePlanKey$type' => '<p>The type of a usage plan key. Currently, the valid key type is <code>API_KEY</code>.</p>', 'UsagePlanKey$value' => '<p>The value of a usage plan key.</p>', 'UsagePlanKey$name' => '<p>The name of a usage plan key.</p>', 'UsagePlanKeys$position' => NULL, 'UsagePlans$position' => NULL, 'VpcLink$id' => '<p>The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.</p>', 'VpcLink$name' => '<p>The name used to label and identify the VPC link.</p>', 'VpcLink$description' => '<p>The description of the VPC link.</p>', 'VpcLink$statusMessage' => '<p>A description about the VPC link status.</p>', 'VpcLinks$position' => NULL, ], ], 'TagResourceRequest' => [ 'base' => '<p>Adds or updates a tag on a given resource.</p>', 'refs' => [], ], 'Tags' => [ 'base' => '<p>The collection of tags. Each tag element is associated with a given resource.</p>', 'refs' => [], ], 'Template' => [ 'base' => '<p>Represents a mapping template used to transform a payload.</p>', 'refs' => [], ], 'TestInvokeAuthorizerRequest' => [ 'base' => '<p>Make a request to simulate the invocation of an Authorizer.</p>', 'refs' => [], ], 'TestInvokeAuthorizerResponse' => [ 'base' => '<p>Represents the response of the test invoke request for a custom Authorizer</p>', 'refs' => [], ], 'TestInvokeMethodRequest' => [ 'base' => '<p>Make a request to simulate the invocation of a Method.</p>', 'refs' => [], ], 'TestInvokeMethodResponse' => [ 'base' => '<p>Represents the response of the test invoke request in the HTTP method.</p>', 'refs' => [], ], 'ThrottleSettings' => [ 'base' => '<p> The API request rate limits.</p>', 'refs' => [ 'Account$throttleSettings' => '<p>Specifies the API request limits configured for the current Account.</p>', 'CreateUsagePlanRequest$throttle' => '<p>The throttling limits of the usage plan.</p>', 'MapOfApiStageThrottleSettings$value' => NULL, 'UsagePlan$throttle' => '<p>A map containing method level throttling information for API stage in a usage plan.</p>', ], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [ 'ApiKey$createdDate' => '<p>The timestamp when the API Key was created.</p>', 'ApiKey$lastUpdatedDate' => '<p>The timestamp when the API Key was last updated.</p>', 'ClientCertificate$createdDate' => '<p>The timestamp when the client certificate was created.</p>', 'ClientCertificate$expirationDate' => '<p>The timestamp when the client certificate will expire.</p>', 'Deployment$createdDate' => '<p>The date and time that the deployment resource was created.</p>', 'DocumentationVersion$createdDate' => '<p>The date when the API documentation snapshot is created.</p>', 'DomainName$certificateUploadDate' => '<p>The timestamp when the certificate that was used by edge-optimized endpoint for this domain name was uploaded.</p>', 'RestApi$createdDate' => '<p>The timestamp when the API was created.</p>', 'Stage$createdDate' => '<p>The timestamp when the stage was created.</p>', 'Stage$lastUpdatedDate' => '<p>The timestamp when the stage last updated.</p>', ], ], 'TlsConfig' => [ 'base' => '<p>Specifies the TLS configuration for an integration.</p>', 'refs' => [ 'Integration$tlsConfig' => '<p>Specifies the TLS configuration for an integration.</p>', 'PutIntegrationRequest$tlsConfig' => NULL, ], ], 'TooManyRequestsException' => [ 'base' => '<p>The request has reached its throttling limit. Retry after the specified time period.</p>', 'refs' => [], ], 'UnauthorizedCacheControlHeaderStrategy' => [ 'base' => NULL, 'refs' => [ 'MethodSetting$unauthorizedCacheControlHeaderStrategy' => '<p>Specifies how to handle unauthorized requests for cache invalidation. The PATCH path for this setting is <code>/{method_setting_key}/caching/unauthorizedCacheControlHeaderStrategy</code>, and the available values are <code>FAIL_WITH_403</code>, <code>SUCCEED_WITH_RESPONSE_HEADER</code>, <code>SUCCEED_WITHOUT_RESPONSE_HEADER</code>.</p>', ], ], 'UnauthorizedException' => [ 'base' => '<p>The request is denied because the caller has insufficient permissions.</p>', 'refs' => [], ], 'UntagResourceRequest' => [ 'base' => '<p>Removes a tag from a given resource.</p>', 'refs' => [], ], 'UpdateAccountRequest' => [ 'base' => '<p>Requests API Gateway to change information about the current Account resource.</p>', 'refs' => [], ], 'UpdateApiKeyRequest' => [ 'base' => '<p>A request to change information about an ApiKey resource.</p>', 'refs' => [], ], 'UpdateAuthorizerRequest' => [ 'base' => '<p>Request to update an existing Authorizer resource.</p>', 'refs' => [], ], 'UpdateBasePathMappingRequest' => [ 'base' => '<p>A request to change information about the BasePathMapping resource.</p>', 'refs' => [], ], 'UpdateClientCertificateRequest' => [ 'base' => '<p>A request to change information about an ClientCertificate resource.</p>', 'refs' => [], ], 'UpdateDeploymentRequest' => [ 'base' => '<p>Requests API Gateway to change information about a Deployment resource.</p>', 'refs' => [], ], 'UpdateDocumentationPartRequest' => [ 'base' => '<p>Updates an existing documentation part of a given API.</p>', 'refs' => [], ], 'UpdateDocumentationVersionRequest' => [ 'base' => '<p>Updates an existing documentation version of an API.</p>', 'refs' => [], ], 'UpdateDomainNameRequest' => [ 'base' => '<p>A request to change information about the DomainName resource.</p>', 'refs' => [], ], 'UpdateGatewayResponseRequest' => [ 'base' => '<p>Updates a GatewayResponse of a specified response type on the given RestApi.</p>', 'refs' => [], ], 'UpdateIntegrationRequest' => [ 'base' => '<p>Represents an update integration request.</p>', 'refs' => [], ], 'UpdateIntegrationResponseRequest' => [ 'base' => '<p>Represents an update integration response request.</p>', 'refs' => [], ], 'UpdateMethodRequest' => [ 'base' => '<p>Request to update an existing Method resource.</p>', 'refs' => [], ], 'UpdateMethodResponseRequest' => [ 'base' => '<p>A request to update an existing MethodResponse resource.</p>', 'refs' => [], ], 'UpdateModelRequest' => [ 'base' => '<p>Request to update an existing model in an existing RestApi resource.</p>', 'refs' => [], ], 'UpdateRequestValidatorRequest' => [ 'base' => '<p>Updates a RequestValidator of a given RestApi.</p>', 'refs' => [], ], 'UpdateResourceRequest' => [ 'base' => '<p>Request to change information about a Resource resource.</p>', 'refs' => [], ], 'UpdateRestApiRequest' => [ 'base' => '<p>Request to update an existing RestApi resource in your collection.</p>', 'refs' => [], ], 'UpdateStageRequest' => [ 'base' => '<p>Requests API Gateway to change information about a Stage resource.</p>', 'refs' => [], ], 'UpdateUsagePlanRequest' => [ 'base' => '<p>The PATCH request to update a usage plan of a given plan Id.</p>', 'refs' => [], ], 'UpdateUsageRequest' => [ 'base' => '<p>The PATCH request to grant a temporary extension to the remaining quota of a usage plan associated with a specified API key.</p>', 'refs' => [], ], 'UpdateVpcLinkRequest' => [ 'base' => '<p>Updates an existing VpcLink of a specified identifier.</p>', 'refs' => [], ], 'Usage' => [ 'base' => '<p>Represents the usage data of a usage plan.</p>', 'refs' => [], ], 'UsagePlan' => [ 'base' => '<p>Represents a usage plan used to specify who can assess associated API stages. Optionally, target request rate and quota limits can be set. In some cases clients can exceed the targets that you set. Don\u00e2\u20ac\u2122t rely on usage plans to control costs. Consider using <a href=\"https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html\">Amazon Web Services Budgets</a> to monitor costs and <a href=\"https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html\">WAF</a> to manage API requests.</p>', 'refs' => [ 'ListOfUsagePlan$member' => NULL, ], ], 'UsagePlanKey' => [ 'base' => '<p>Represents a usage plan key to identify a plan customer.</p>', 'refs' => [ 'ListOfUsagePlanKey$member' => NULL, ], ], 'UsagePlanKeys' => [ 'base' => '<p>Represents the collection of usage plan keys added to usage plans for the associated API keys and, possibly, other types of keys.</p>', 'refs' => [], ], 'UsagePlans' => [ 'base' => '<p>Represents a collection of usage plans for an AWS account.</p>', 'refs' => [], ], 'VpcLink' => [ 'base' => '<p>An API Gateway VPC link for a RestApi to access resources in an Amazon Virtual Private Cloud (VPC).</p>', 'refs' => [ 'ListOfVpcLink$member' => NULL, ], ], 'VpcLinkStatus' => [ 'base' => NULL, 'refs' => [ 'VpcLink$status' => '<p>The status of the VPC link. The valid values are <code>AVAILABLE</code>, <code>PENDING</code>, <code>DELETING</code>, or <code>FAILED</code>. Deploying an API will wait if the status is <code>PENDING</code> and will fail if the status is <code>DELETING</code>. </p>', ], ], 'VpcLinks' => [ 'base' => '<p>The collection of VPC links under the caller\\'s account in a region.</p>', 'refs' => [], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigateway/2015-07-09/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => true, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://apigateway-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://apigateway-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://apigateway.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://apigateway.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigateway/2015-07-09/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-south-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-south-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-south-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-south-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-south-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-south-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-south-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-south-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-south-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-south-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-south-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-south-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-south-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-south-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-south-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-south-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-south-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-south-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-south-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-gov-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-gov-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-gov-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-gov-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.me-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'me-central-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region me-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.me-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'me-central-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.me-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'me-central-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region me-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.me-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'me-central-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ca-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ca-central-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ca-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ca-central-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ca-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ca-central-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ca-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ca-central-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-central-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-central-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-central-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-central-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-central-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-central-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-central-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-central-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-central-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-central-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-central-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-central-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-central-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-central-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-west-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-west-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-west-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-west-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-west-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-west-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.af-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'af-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.af-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'af-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.af-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'af-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.af-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'af-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-north-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-north-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-north-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-north-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-north-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-north-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-north-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-north-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-west-3.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-3', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-west-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-3', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-west-3.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-3', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-west-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-3', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-west-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-west-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-northeast-3.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-3', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-3', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-northeast-3.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-3', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-3', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-northeast-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-northeast-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-northeast-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-northeast-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.me-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'me-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.me-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'me-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.me-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'me-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.me-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'me-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.sa-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'sa-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.sa-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'sa-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.sa-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'sa-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.sa-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'sa-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'cn-north-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'cn-north-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'cn-north-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'cn-north-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-gov-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-gov-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-gov-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-gov-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-gov-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-gov-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-southeast-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-southeast-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-southeast-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-southeast-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-iso-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-iso-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-iso-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-iso-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-southeast-3.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-3', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-3', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-southeast-3.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-3', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-3', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-4 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-southeast-4.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-4', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-4 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-southeast-4.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-4', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-4 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-southeast-4.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-4', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-4 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-southeast-4.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-4', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-east-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-east-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'cn-northwest-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'cn-northwest-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'cn-northwest-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'cn-northwest-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-isob-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-isob-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-isob-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-isob-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-1', 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-1', 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-1', 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigateway/2015-07-09/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigateway/2015-07-09/paginators-1.json\nreturn [ 'pagination' => [ 'GetApiKeys' => [ 'input_token' => 'position', 'limit_key' => 'limit', 'output_token' => 'position', 'result_key' => 'items', ], 'GetBasePathMappings' => [ 'input_token' => 'position', 'limit_key' => 'limit', 'output_token' => 'position', 'result_key' => 'items', ], 'GetClientCertificates' => [ 'input_token' => 'position', 'limit_key' => 'limit', 'output_token' => 'position', 'result_key' => 'items', ], 'GetDeployments' => [ 'input_token' => 'position', 'limit_key' => 'limit', 'output_token' => 'position', 'result_key' => 'items', ], 'GetDomainNames' => [ 'input_token' => 'position', 'limit_key' => 'limit', 'output_token' => 'position', 'result_key' => 'items', ], 'GetModels' => [ 'input_token' => 'position', 'limit_key' => 'limit', 'output_token' => 'position', 'result_key' => 'items', ], 'GetResources' => [ 'input_token' => 'position', 'limit_key' => 'limit', 'output_token' => 'position', 'result_key' => 'items', ], 'GetRestApis' => [ 'input_token' => 'position', 'limit_key' => 'limit', 'output_token' => 'position', 'result_key' => 'items', ], 'GetUsage' => [ 'input_token' => 'position', 'limit_key' => 'limit', 'non_aggregate_keys' => [ 'usagePlanId', 'startDate', 'endDate', ], 'output_token' => 'position', 'result_key' => 'items', ], 'GetUsagePlanKeys' => [ 'input_token' => 'position', 'limit_key' => 'limit', 'output_token' => 'position', 'result_key' => 'items', ], 'GetUsagePlans' => [ 'input_token' => 'position', 'limit_key' => 'limit', 'output_token' => 'position', 'result_key' => 'items', ], 'GetVpcLinks' => [ 'input_token' => 'position', 'limit_key' => 'limit', 'output_token' => 'position', 'result_key' => 'items', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigateway/2015-07-09/smoke.json\nreturn [ 'version' => 1, 'defaultRegion' => 'us-west-2', 'testCases' => [ [ 'operationName' => 'GetDomainNames', 'input' => [], 'errorExpectedFromService' => false, ], [ 'operationName' => 'CreateUsagePlanKey', 'input' => [ 'usagePlanId' => 'foo', 'keyId' => 'bar', 'keyType' => 'fixx', ], 'errorExpectedFromService' => true, ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigatewaymanagementapi/2018-11-29/api-2.json\nreturn [ 'metadata' => [ 'apiVersion' => '2018-11-29', 'endpointPrefix' => 'execute-api', 'signingName' => 'execute-api', 'serviceFullName' => 'AmazonApiGatewayManagementApi', 'serviceId' => 'ApiGatewayManagementApi', 'protocol' => 'rest-json', 'jsonVersion' => '1.1', 'uid' => 'apigatewaymanagementapi-2018-11-29', 'signatureVersion' => 'v4', ], 'operations' => [ 'DeleteConnection' => [ 'name' => 'DeleteConnection', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/@connections/{connectionId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteConnectionRequest', ], 'errors' => [ [ 'shape' => 'GoneException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ForbiddenException', ], ], ], 'GetConnection' => [ 'name' => 'GetConnection', 'http' => [ 'method' => 'GET', 'requestUri' => '/@connections/{connectionId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetConnectionRequest', ], 'output' => [ 'shape' => 'GetConnectionResponse', ], 'errors' => [ [ 'shape' => 'GoneException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ForbiddenException', ], ], ], 'PostToConnection' => [ 'name' => 'PostToConnection', 'http' => [ 'method' => 'POST', 'requestUri' => '/@connections/{connectionId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PostToConnectionRequest', ], 'errors' => [ [ 'shape' => 'GoneException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'PayloadTooLargeException', ], [ 'shape' => 'ForbiddenException', ], ], ], ], 'shapes' => [ 'Data' => [ 'type' => 'blob', 'max' => 131072, ], 'DeleteConnectionRequest' => [ 'type' => 'structure', 'members' => [ 'ConnectionId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'connectionId', ], ], 'required' => [ 'ConnectionId', ], ], 'ForbiddenException' => [ 'type' => 'structure', 'members' => [], 'exception' => true, 'error' => [ 'httpStatusCode' => 403, ], ], 'GetConnectionRequest' => [ 'type' => 'structure', 'members' => [ 'ConnectionId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'connectionId', ], ], 'required' => [ 'ConnectionId', ], ], 'GetConnectionResponse' => [ 'type' => 'structure', 'members' => [ 'ConnectedAt' => [ 'shape' => '__timestampIso8601', 'locationName' => 'connectedAt', ], 'Identity' => [ 'shape' => 'Identity', 'locationName' => 'identity', ], 'LastActiveAt' => [ 'shape' => '__timestampIso8601', 'locationName' => 'lastActiveAt', ], ], ], 'GoneException' => [ 'type' => 'structure', 'members' => [], 'exception' => true, 'error' => [ 'httpStatusCode' => 410, ], ], 'Identity' => [ 'type' => 'structure', 'members' => [ 'SourceIp' => [ 'shape' => '__string', 'locationName' => 'sourceIp', ], 'UserAgent' => [ 'shape' => '__string', 'locationName' => 'userAgent', ], ], 'required' => [ 'SourceIp', 'UserAgent', ], ], 'PayloadTooLargeException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => '__string', 'locationName' => 'message', ], ], 'exception' => true, 'error' => [ 'httpStatusCode' => 413, ], ], 'PostToConnectionRequest' => [ 'type' => 'structure', 'members' => [ 'Data' => [ 'shape' => 'Data', ], 'ConnectionId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'connectionId', ], ], 'required' => [ 'ConnectionId', 'Data', ], 'payload' => 'Data', ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [], 'exception' => true, 'error' => [ 'httpStatusCode' => 429, ], ], '__string' => [ 'type' => 'string', ], '__timestampIso8601' => [ 'type' => 'timestamp', 'timestampFormat' => 'iso8601', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigatewaymanagementapi/2018-11-29/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>The Amazon API Gateway Management API allows you to directly manage runtime aspects of your deployed APIs. To use it, you must explicitly set the SDK\\'s endpoint to point to the endpoint of your deployed API. The endpoint will be of the form https://{api-id}.execute-api.{region}.amazonaws.com/{stage}, or will be the endpoint corresponding to your API\\'s custom domain and base path, if applicable.</p>', 'operations' => [ 'DeleteConnection' => '<p>Delete the connection with the provided id.</p>', 'GetConnection' => '<p>Get information about the connection with the provided id.</p>', 'PostToConnection' => '<p>Sends the provided data to the specified connection.</p>', ], 'shapes' => [ 'Connection' => [ 'base' => '<p>The information about the connection</p>', 'refs' => [], ], 'Data' => [ 'base' => '<p>The data to be sent to the client specified by its connection id.</p>', 'refs' => [], ], 'ForbiddenException' => [ 'base' => '<p>The caller is not authorized to invoke this operation.</p>', 'refs' => [], ], 'GoneException' => [ 'base' => '<p>The connection with the provided id no longer exists.</p>', 'refs' => [], ], 'Identity' => [ 'base' => NULL, 'refs' => [ 'Connection$Identity' => NULL, ], ], 'LimitExceededException' => [ 'base' => '<p>The client is sending more than the allowed number of requests per unit of time or the WebSocket client side buffer is full.</p>', 'refs' => [], ], 'PayloadTooLargeException' => [ 'base' => '<p>The data has exceeded the maximum size allowed.</p>', 'refs' => [], ], '__string' => [ 'base' => NULL, 'refs' => [ 'Data$Message' => NULL, 'Identity$SourceIp' => '<p>The source IP address of the TCP connection making the request to API Gateway.</p>', 'Identity$UserAgent' => '<p>The User Agent of the API caller.</p>', 'PayloadTooLargeException$Message' => NULL, ], ], '__timestampIso8601' => [ 'base' => NULL, 'refs' => [ 'Connection$ConnectedAt' => '<p>The time in ISO 8601 format for when the connection was established.</p>', 'Connection$LastActiveAt' => '<p>The time in ISO 8601 format for when the connection was last active.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigatewaymanagementapi/2018-11-29/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], [ 'fn' => 'parseURL', 'argv' => [ [ 'ref' => 'Endpoint', ], ], 'assign' => 'url', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://execute-api-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://execute-api-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://execute-api.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://execute-api.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigatewaymanagementapi/2018-11-29/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.ap-south-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.ap-south-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.eu-south-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.eu-south-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.eu-south-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.eu-south-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.eu-south-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.eu-south-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.me-central-1.api.aws', ], ], 'params' => [ 'Region' => 'me-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.me-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.me-central-1.api.aws', ], ], 'params' => [ 'Region' => 'me-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.me-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.ca-central-1.api.aws', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.ca-central-1.api.aws', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.eu-central-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.eu-central-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-iso-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-iso-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.us-iso-west-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-iso-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-iso-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.us-iso-west-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.af-south-1.api.aws', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.af-south-1.api.aws', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.eu-north-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.eu-north-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.eu-west-3.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.eu-west-3.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.ap-northeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.ap-northeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.ap-northeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.ap-northeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.ap-northeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.ap-northeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.me-south-1.api.aws', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.me-south-1.api.aws', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.sa-east-1.api.aws', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.sa-east-1.api.aws', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.ap-east-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.ap-east-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.us-gov-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.us-gov-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.ap-southeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.ap-southeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.ap-southeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.ap-southeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://execute-api.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigatewaymanagementapi/2018-11-29/paginators-1.json\nreturn [ 'pagination' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigatewayv2/2018-11-29/api-2.json\nreturn [ 'metadata' => [ 'apiVersion' => '2018-11-29', 'endpointPrefix' => 'apigateway', 'signingName' => 'apigateway', 'serviceFullName' => 'AmazonApiGatewayV2', 'serviceId' => 'ApiGatewayV2', 'protocol' => 'rest-json', 'jsonVersion' => '1.1', 'uid' => 'apigatewayv2-2018-11-29', 'signatureVersion' => 'v4', ], 'operations' => [ 'CreateApi' => [ 'name' => 'CreateApi', 'http' => [ 'method' => 'POST', 'requestUri' => '/v2/apis', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateApiRequest', ], 'output' => [ 'shape' => 'CreateApiResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'CreateApiMapping' => [ 'name' => 'CreateApiMapping', 'http' => [ 'method' => 'POST', 'requestUri' => '/v2/domainnames/{domainName}/apimappings', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateApiMappingRequest', ], 'output' => [ 'shape' => 'CreateApiMappingResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'CreateAuthorizer' => [ 'name' => 'CreateAuthorizer', 'http' => [ 'method' => 'POST', 'requestUri' => '/v2/apis/{apiId}/authorizers', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateAuthorizerRequest', ], 'output' => [ 'shape' => 'CreateAuthorizerResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'CreateDeployment' => [ 'name' => 'CreateDeployment', 'http' => [ 'method' => 'POST', 'requestUri' => '/v2/apis/{apiId}/deployments', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateDeploymentRequest', ], 'output' => [ 'shape' => 'CreateDeploymentResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'CreateDomainName' => [ 'name' => 'CreateDomainName', 'http' => [ 'method' => 'POST', 'requestUri' => '/v2/domainnames', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateDomainNameRequest', ], 'output' => [ 'shape' => 'CreateDomainNameResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'CreateIntegration' => [ 'name' => 'CreateIntegration', 'http' => [ 'method' => 'POST', 'requestUri' => '/v2/apis/{apiId}/integrations', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateIntegrationRequest', ], 'output' => [ 'shape' => 'CreateIntegrationResult', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'CreateIntegrationResponse' => [ 'name' => 'CreateIntegrationResponse', 'http' => [ 'method' => 'POST', 'requestUri' => '/v2/apis/{apiId}/integrations/{integrationId}/integrationresponses', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateIntegrationResponseRequest', ], 'output' => [ 'shape' => 'CreateIntegrationResponseResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'CreateModel' => [ 'name' => 'CreateModel', 'http' => [ 'method' => 'POST', 'requestUri' => '/v2/apis/{apiId}/models', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateModelRequest', ], 'output' => [ 'shape' => 'CreateModelResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'CreateRoute' => [ 'name' => 'CreateRoute', 'http' => [ 'method' => 'POST', 'requestUri' => '/v2/apis/{apiId}/routes', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateRouteRequest', ], 'output' => [ 'shape' => 'CreateRouteResult', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'CreateRouteResponse' => [ 'name' => 'CreateRouteResponse', 'http' => [ 'method' => 'POST', 'requestUri' => '/v2/apis/{apiId}/routes/{routeId}/routeresponses', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateRouteResponseRequest', ], 'output' => [ 'shape' => 'CreateRouteResponseResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'CreateStage' => [ 'name' => 'CreateStage', 'http' => [ 'method' => 'POST', 'requestUri' => '/v2/apis/{apiId}/stages', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateStageRequest', ], 'output' => [ 'shape' => 'CreateStageResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'CreateVpcLink' => [ 'name' => 'CreateVpcLink', 'http' => [ 'method' => 'POST', 'requestUri' => '/v2/vpclinks', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateVpcLinkRequest', ], 'output' => [ 'shape' => 'CreateVpcLinkResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteAccessLogSettings' => [ 'name' => 'DeleteAccessLogSettings', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/apis/{apiId}/stages/{stageName}/accesslogsettings', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteAccessLogSettingsRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteApi' => [ 'name' => 'DeleteApi', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/apis/{apiId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteApiRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteApiMapping' => [ 'name' => 'DeleteApiMapping', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/domainnames/{domainName}/apimappings/{apiMappingId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteApiMappingRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'DeleteAuthorizer' => [ 'name' => 'DeleteAuthorizer', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/apis/{apiId}/authorizers/{authorizerId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteAuthorizerRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteCorsConfiguration' => [ 'name' => 'DeleteCorsConfiguration', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/apis/{apiId}/cors', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteCorsConfigurationRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteDeployment' => [ 'name' => 'DeleteDeployment', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/apis/{apiId}/deployments/{deploymentId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteDeploymentRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteDomainName' => [ 'name' => 'DeleteDomainName', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/domainnames/{domainName}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteDomainNameRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteIntegration' => [ 'name' => 'DeleteIntegration', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/apis/{apiId}/integrations/{integrationId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteIntegrationRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteIntegrationResponse' => [ 'name' => 'DeleteIntegrationResponse', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/apis/{apiId}/integrations/{integrationId}/integrationresponses/{integrationResponseId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteIntegrationResponseRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteModel' => [ 'name' => 'DeleteModel', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/apis/{apiId}/models/{modelId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteModelRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteRoute' => [ 'name' => 'DeleteRoute', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/apis/{apiId}/routes/{routeId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteRouteRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteRouteRequestParameter' => [ 'name' => 'DeleteRouteRequestParameter', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/apis/{apiId}/routes/{routeId}/requestparameters/{requestParameterKey}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteRouteRequestParameterRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteRouteResponse' => [ 'name' => 'DeleteRouteResponse', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/apis/{apiId}/routes/{routeId}/routeresponses/{routeResponseId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteRouteResponseRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteRouteSettings' => [ 'name' => 'DeleteRouteSettings', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/apis/{apiId}/stages/{stageName}/routesettings/{routeKey}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteRouteSettingsRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteStage' => [ 'name' => 'DeleteStage', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/apis/{apiId}/stages/{stageName}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteStageRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeleteVpcLink' => [ 'name' => 'DeleteVpcLink', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/vpclinks/{vpcLinkId}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'DeleteVpcLinkRequest', ], 'output' => [ 'shape' => 'DeleteVpcLinkResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'ExportApi' => [ 'name' => 'ExportApi', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/exports/{specification}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ExportApiRequest', ], 'output' => [ 'shape' => 'ExportApiResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'ResetAuthorizersCache' => [ 'name' => 'ResetAuthorizersCache', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/apis/{apiId}/stages/{stageName}/cache/authorizers', 'responseCode' => 204, ], 'input' => [ 'shape' => 'ResetAuthorizersCacheRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetApi' => [ 'name' => 'GetApi', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetApiRequest', ], 'output' => [ 'shape' => 'GetApiResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetApiMapping' => [ 'name' => 'GetApiMapping', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/domainnames/{domainName}/apimappings/{apiMappingId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetApiMappingRequest', ], 'output' => [ 'shape' => 'GetApiMappingResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetApiMappings' => [ 'name' => 'GetApiMappings', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/domainnames/{domainName}/apimappings', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetApiMappingsRequest', ], 'output' => [ 'shape' => 'GetApiMappingsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetApis' => [ 'name' => 'GetApis', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetApisRequest', ], 'output' => [ 'shape' => 'GetApisResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetAuthorizer' => [ 'name' => 'GetAuthorizer', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/authorizers/{authorizerId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetAuthorizerRequest', ], 'output' => [ 'shape' => 'GetAuthorizerResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetAuthorizers' => [ 'name' => 'GetAuthorizers', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/authorizers', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetAuthorizersRequest', ], 'output' => [ 'shape' => 'GetAuthorizersResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetDeployment' => [ 'name' => 'GetDeployment', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/deployments/{deploymentId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetDeploymentRequest', ], 'output' => [ 'shape' => 'GetDeploymentResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetDeployments' => [ 'name' => 'GetDeployments', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/deployments', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetDeploymentsRequest', ], 'output' => [ 'shape' => 'GetDeploymentsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetDomainName' => [ 'name' => 'GetDomainName', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/domainnames/{domainName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetDomainNameRequest', ], 'output' => [ 'shape' => 'GetDomainNameResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetDomainNames' => [ 'name' => 'GetDomainNames', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/domainnames', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetDomainNamesRequest', ], 'output' => [ 'shape' => 'GetDomainNamesResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetIntegration' => [ 'name' => 'GetIntegration', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/integrations/{integrationId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetIntegrationRequest', ], 'output' => [ 'shape' => 'GetIntegrationResult', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetIntegrationResponse' => [ 'name' => 'GetIntegrationResponse', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/integrations/{integrationId}/integrationresponses/{integrationResponseId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetIntegrationResponseRequest', ], 'output' => [ 'shape' => 'GetIntegrationResponseResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetIntegrationResponses' => [ 'name' => 'GetIntegrationResponses', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/integrations/{integrationId}/integrationresponses', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetIntegrationResponsesRequest', ], 'output' => [ 'shape' => 'GetIntegrationResponsesResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetIntegrations' => [ 'name' => 'GetIntegrations', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/integrations', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetIntegrationsRequest', ], 'output' => [ 'shape' => 'GetIntegrationsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetModel' => [ 'name' => 'GetModel', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/models/{modelId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetModelRequest', ], 'output' => [ 'shape' => 'GetModelResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetModelTemplate' => [ 'name' => 'GetModelTemplate', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/models/{modelId}/template', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetModelTemplateRequest', ], 'output' => [ 'shape' => 'GetModelTemplateResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetModels' => [ 'name' => 'GetModels', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/models', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetModelsRequest', ], 'output' => [ 'shape' => 'GetModelsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetRoute' => [ 'name' => 'GetRoute', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/routes/{routeId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetRouteRequest', ], 'output' => [ 'shape' => 'GetRouteResult', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetRouteResponse' => [ 'name' => 'GetRouteResponse', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/routes/{routeId}/routeresponses/{routeResponseId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetRouteResponseRequest', ], 'output' => [ 'shape' => 'GetRouteResponseResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetRouteResponses' => [ 'name' => 'GetRouteResponses', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/routes/{routeId}/routeresponses', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetRouteResponsesRequest', ], 'output' => [ 'shape' => 'GetRouteResponsesResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetRoutes' => [ 'name' => 'GetRoutes', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/routes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetRoutesRequest', ], 'output' => [ 'shape' => 'GetRoutesResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetStage' => [ 'name' => 'GetStage', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/stages/{stageName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetStageRequest', ], 'output' => [ 'shape' => 'GetStageResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetStages' => [ 'name' => 'GetStages', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/apis/{apiId}/stages', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetStagesRequest', ], 'output' => [ 'shape' => 'GetStagesResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetTags' => [ 'name' => 'GetTags', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/tags/{resource-arn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetTagsRequest', ], 'output' => [ 'shape' => 'GetTagsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'GetVpcLink' => [ 'name' => 'GetVpcLink', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/vpclinks/{vpcLinkId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVpcLinkRequest', ], 'output' => [ 'shape' => 'GetVpcLinkResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetVpcLinks' => [ 'name' => 'GetVpcLinks', 'http' => [ 'method' => 'GET', 'requestUri' => '/v2/vpclinks', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVpcLinksRequest', ], 'output' => [ 'shape' => 'GetVpcLinksResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'ImportApi' => [ 'name' => 'ImportApi', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v2/apis', 'responseCode' => 201, ], 'input' => [ 'shape' => 'ImportApiRequest', ], 'output' => [ 'shape' => 'ImportApiResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'ReimportApi' => [ 'name' => 'ReimportApi', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v2/apis/{apiId}', 'responseCode' => 201, ], 'input' => [ 'shape' => 'ReimportApiRequest', ], 'output' => [ 'shape' => 'ReimportApiResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/v2/tags/{resource-arn}', 'responseCode' => 201, ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v2/tags/{resource-arn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'UpdateApi' => [ 'name' => 'UpdateApi', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/v2/apis/{apiId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateApiRequest', ], 'output' => [ 'shape' => 'UpdateApiResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'UpdateApiMapping' => [ 'name' => 'UpdateApiMapping', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/v2/domainnames/{domainName}/apimappings/{apiMappingId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateApiMappingRequest', ], 'output' => [ 'shape' => 'UpdateApiMappingResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'UpdateAuthorizer' => [ 'name' => 'UpdateAuthorizer', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/v2/apis/{apiId}/authorizers/{authorizerId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateAuthorizerRequest', ], 'output' => [ 'shape' => 'UpdateAuthorizerResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'UpdateDeployment' => [ 'name' => 'UpdateDeployment', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/v2/apis/{apiId}/deployments/{deploymentId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateDeploymentRequest', ], 'output' => [ 'shape' => 'UpdateDeploymentResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'UpdateDomainName' => [ 'name' => 'UpdateDomainName', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/v2/domainnames/{domainName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateDomainNameRequest', ], 'output' => [ 'shape' => 'UpdateDomainNameResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'UpdateIntegration' => [ 'name' => 'UpdateIntegration', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/v2/apis/{apiId}/integrations/{integrationId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateIntegrationRequest', ], 'output' => [ 'shape' => 'UpdateIntegrationResult', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'UpdateIntegrationResponse' => [ 'name' => 'UpdateIntegrationResponse', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/v2/apis/{apiId}/integrations/{integrationId}/integrationresponses/{integrationResponseId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateIntegrationResponseRequest', ], 'output' => [ 'shape' => 'UpdateIntegrationResponseResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'UpdateModel' => [ 'name' => 'UpdateModel', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/v2/apis/{apiId}/models/{modelId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateModelRequest', ], 'output' => [ 'shape' => 'UpdateModelResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'UpdateRoute' => [ 'name' => 'UpdateRoute', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/v2/apis/{apiId}/routes/{routeId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateRouteRequest', ], 'output' => [ 'shape' => 'UpdateRouteResult', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'UpdateRouteResponse' => [ 'name' => 'UpdateRouteResponse', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/v2/apis/{apiId}/routes/{routeId}/routeresponses/{routeResponseId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateRouteResponseRequest', ], 'output' => [ 'shape' => 'UpdateRouteResponseResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'UpdateStage' => [ 'name' => 'UpdateStage', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/v2/apis/{apiId}/stages/{stageName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateStageRequest', ], 'output' => [ 'shape' => 'UpdateStageResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], ], ], 'UpdateVpcLink' => [ 'name' => 'UpdateVpcLink', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/v2/vpclinks/{vpcLinkId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateVpcLinkRequest', ], 'output' => [ 'shape' => 'UpdateVpcLinkResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'BadRequestException', ], ], ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => '__string', 'locationName' => 'message', ], ], 'exception' => true, 'error' => [ 'httpStatusCode' => 403, ], ], 'AccessLogSettings' => [ 'type' => 'structure', 'members' => [ 'DestinationArn' => [ 'shape' => 'Arn', 'locationName' => 'destinationArn', ], 'Format' => [ 'shape' => 'StringWithLengthBetween1And1024', 'locationName' => 'format', ], ], ], 'Api' => [ 'type' => 'structure', 'members' => [ 'ApiEndpoint' => [ 'shape' => '__string', 'locationName' => 'apiEndpoint', ], 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'ApiId' => [ 'shape' => 'Id', 'locationName' => 'apiId', ], 'ApiKeySelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'apiKeySelectionExpression', ], 'CorsConfiguration' => [ 'shape' => 'Cors', 'locationName' => 'corsConfiguration', ], 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'DisableSchemaValidation' => [ 'shape' => '__boolean', 'locationName' => 'disableSchemaValidation', ], 'DisableExecuteApiEndpoint' => [ 'shape' => '__boolean', 'locationName' => 'disableExecuteApiEndpoint', ], 'ImportInfo' => [ 'shape' => '__listOf__string', 'locationName' => 'importInfo', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'ProtocolType' => [ 'shape' => 'ProtocolType', 'locationName' => 'protocolType', ], 'RouteSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeSelectionExpression', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], 'Version' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'version', ], 'Warnings' => [ 'shape' => '__listOf__string', 'locationName' => 'warnings', ], ], 'required' => [ 'RouteSelectionExpression', 'Name', 'ProtocolType', ], ], 'ApiMapping' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => 'Id', 'locationName' => 'apiId', ], 'ApiMappingId' => [ 'shape' => 'Id', 'locationName' => 'apiMappingId', ], 'ApiMappingKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'apiMappingKey', ], 'Stage' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'stage', ], ], 'required' => [ 'Stage', 'ApiId', ], ], 'ApiMappings' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfApiMapping', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'Apis' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfApi', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'Arn' => [ 'type' => 'string', ], 'AuthorizationScopes' => [ 'type' => 'list', 'member' => [ 'shape' => 'StringWithLengthBetween1And64', ], ], 'AuthorizationType' => [ 'type' => 'string', 'enum' => [ 'NONE', 'AWS_IAM', 'CUSTOM', 'JWT', ], ], 'Authorizer' => [ 'type' => 'structure', 'members' => [ 'AuthorizerCredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'authorizerCredentialsArn', ], 'AuthorizerId' => [ 'shape' => 'Id', 'locationName' => 'authorizerId', ], 'AuthorizerResultTtlInSeconds' => [ 'shape' => 'IntegerWithLengthBetween0And3600', 'locationName' => 'authorizerResultTtlInSeconds', ], 'AuthorizerType' => [ 'shape' => 'AuthorizerType', 'locationName' => 'authorizerType', ], 'AuthorizerUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'authorizerUri', ], 'IdentitySource' => [ 'shape' => 'IdentitySourceList', 'locationName' => 'identitySource', ], 'IdentityValidationExpression' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'identityValidationExpression', ], 'JwtConfiguration' => [ 'shape' => 'JWTConfiguration', 'locationName' => 'jwtConfiguration', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'AuthorizerPayloadFormatVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'authorizerPayloadFormatVersion', ], 'EnableSimpleResponses' => [ 'shape' => '__boolean', 'locationName' => 'enableSimpleResponses', ], ], 'required' => [ 'Name', ], ], 'AuthorizerType' => [ 'type' => 'string', 'enum' => [ 'REQUEST', 'JWT', ], ], 'Authorizers' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfAuthorizer', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => '__string', 'locationName' => 'message', ], ], 'exception' => true, 'error' => [ 'httpStatusCode' => 400, ], ], 'ConflictException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => '__string', 'locationName' => 'message', ], ], 'exception' => true, 'error' => [ 'httpStatusCode' => 409, ], ], 'ConnectionType' => [ 'type' => 'string', 'enum' => [ 'INTERNET', 'VPC_LINK', ], ], 'ContentHandlingStrategy' => [ 'type' => 'string', 'enum' => [ 'CONVERT_TO_BINARY', 'CONVERT_TO_TEXT', ], ], 'Cors' => [ 'type' => 'structure', 'members' => [ 'AllowCredentials' => [ 'shape' => '__boolean', 'locationName' => 'allowCredentials', ], 'AllowHeaders' => [ 'shape' => 'CorsHeaderList', 'locationName' => 'allowHeaders', ], 'AllowMethods' => [ 'shape' => 'CorsMethodList', 'locationName' => 'allowMethods', ], 'AllowOrigins' => [ 'shape' => 'CorsOriginList', 'locationName' => 'allowOrigins', ], 'ExposeHeaders' => [ 'shape' => 'CorsHeaderList', 'locationName' => 'exposeHeaders', ], 'MaxAge' => [ 'shape' => 'IntegerWithLengthBetweenMinus1And86400', 'locationName' => 'maxAge', ], ], ], 'CorsHeaderList' => [ 'type' => 'list', 'member' => [ 'shape' => '__string', ], ], 'CorsMethodList' => [ 'type' => 'list', 'member' => [ 'shape' => 'StringWithLengthBetween1And64', ], ], 'CorsOriginList' => [ 'type' => 'list', 'member' => [ 'shape' => '__string', ], ], 'CreateApiInput' => [ 'type' => 'structure', 'members' => [ 'ApiKeySelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'apiKeySelectionExpression', ], 'CorsConfiguration' => [ 'shape' => 'Cors', 'locationName' => 'corsConfiguration', ], 'CredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'credentialsArn', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'DisableSchemaValidation' => [ 'shape' => '__boolean', 'locationName' => 'disableSchemaValidation', ], 'DisableExecuteApiEndpoint' => [ 'shape' => '__boolean', 'locationName' => 'disableExecuteApiEndpoint', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'ProtocolType' => [ 'shape' => 'ProtocolType', 'locationName' => 'protocolType', ], 'RouteKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeKey', ], 'RouteSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeSelectionExpression', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], 'Target' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'target', ], 'Version' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'version', ], ], 'required' => [ 'ProtocolType', 'Name', ], ], 'CreateApiMappingInput' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => 'Id', 'locationName' => 'apiId', ], 'ApiMappingKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'apiMappingKey', ], 'Stage' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'stage', ], ], 'required' => [ 'Stage', 'ApiId', ], ], 'CreateApiMappingRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => 'Id', 'locationName' => 'apiId', ], 'ApiMappingKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'apiMappingKey', ], 'DomainName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'domainName', ], 'Stage' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'stage', ], ], 'required' => [ 'DomainName', 'Stage', 'ApiId', ], ], 'CreateApiMappingResponse' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => 'Id', 'locationName' => 'apiId', ], 'ApiMappingId' => [ 'shape' => 'Id', 'locationName' => 'apiMappingId', ], 'ApiMappingKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'apiMappingKey', ], 'Stage' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'stage', ], ], ], 'CreateApiRequest' => [ 'type' => 'structure', 'members' => [ 'ApiKeySelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'apiKeySelectionExpression', ], 'CorsConfiguration' => [ 'shape' => 'Cors', 'locationName' => 'corsConfiguration', ], 'CredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'credentialsArn', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'DisableSchemaValidation' => [ 'shape' => '__boolean', 'locationName' => 'disableSchemaValidation', ], 'DisableExecuteApiEndpoint' => [ 'shape' => '__boolean', 'locationName' => 'disableExecuteApiEndpoint', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'ProtocolType' => [ 'shape' => 'ProtocolType', 'locationName' => 'protocolType', ], 'RouteKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeKey', ], 'RouteSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeSelectionExpression', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], 'Target' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'target', ], 'Version' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'version', ], ], 'required' => [ 'ProtocolType', 'Name', ], ], 'CreateApiResponse' => [ 'type' => 'structure', 'members' => [ 'ApiEndpoint' => [ 'shape' => '__string', 'locationName' => 'apiEndpoint', ], 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'ApiId' => [ 'shape' => 'Id', 'locationName' => 'apiId', ], 'ApiKeySelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'apiKeySelectionExpression', ], 'CorsConfiguration' => [ 'shape' => 'Cors', 'locationName' => 'corsConfiguration', ], 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'DisableSchemaValidation' => [ 'shape' => '__boolean', 'locationName' => 'disableSchemaValidation', ], 'DisableExecuteApiEndpoint' => [ 'shape' => '__boolean', 'locationName' => 'disableExecuteApiEndpoint', ], 'ImportInfo' => [ 'shape' => '__listOf__string', 'locationName' => 'importInfo', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'ProtocolType' => [ 'shape' => 'ProtocolType', 'locationName' => 'protocolType', ], 'RouteSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeSelectionExpression', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], 'Version' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'version', ], 'Warnings' => [ 'shape' => '__listOf__string', 'locationName' => 'warnings', ], ], ], 'CreateAuthorizerInput' => [ 'type' => 'structure', 'members' => [ 'AuthorizerCredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'authorizerCredentialsArn', ], 'AuthorizerResultTtlInSeconds' => [ 'shape' => 'IntegerWithLengthBetween0And3600', 'locationName' => 'authorizerResultTtlInSeconds', ], 'AuthorizerType' => [ 'shape' => 'AuthorizerType', 'locationName' => 'authorizerType', ], 'AuthorizerUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'authorizerUri', ], 'IdentitySource' => [ 'shape' => 'IdentitySourceList', 'locationName' => 'identitySource', ], 'IdentityValidationExpression' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'identityValidationExpression', ], 'JwtConfiguration' => [ 'shape' => 'JWTConfiguration', 'locationName' => 'jwtConfiguration', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'AuthorizerPayloadFormatVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'authorizerPayloadFormatVersion', ], 'EnableSimpleResponses' => [ 'shape' => '__boolean', 'locationName' => 'enableSimpleResponses', ], ], 'required' => [ 'AuthorizerType', 'IdentitySource', 'Name', ], ], 'CreateAuthorizerRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'AuthorizerCredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'authorizerCredentialsArn', ], 'AuthorizerResultTtlInSeconds' => [ 'shape' => 'IntegerWithLengthBetween0And3600', 'locationName' => 'authorizerResultTtlInSeconds', ], 'AuthorizerType' => [ 'shape' => 'AuthorizerType', 'locationName' => 'authorizerType', ], 'AuthorizerUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'authorizerUri', ], 'IdentitySource' => [ 'shape' => 'IdentitySourceList', 'locationName' => 'identitySource', ], 'IdentityValidationExpression' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'identityValidationExpression', ], 'JwtConfiguration' => [ 'shape' => 'JWTConfiguration', 'locationName' => 'jwtConfiguration', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'AuthorizerPayloadFormatVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'authorizerPayloadFormatVersion', ], 'EnableSimpleResponses' => [ 'shape' => '__boolean', 'locationName' => 'enableSimpleResponses', ], ], 'required' => [ 'ApiId', 'AuthorizerType', 'IdentitySource', 'Name', ], ], 'CreateAuthorizerResponse' => [ 'type' => 'structure', 'members' => [ 'AuthorizerCredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'authorizerCredentialsArn', ], 'AuthorizerId' => [ 'shape' => 'Id', 'locationName' => 'authorizerId', ], 'AuthorizerResultTtlInSeconds' => [ 'shape' => 'IntegerWithLengthBetween0And3600', 'locationName' => 'authorizerResultTtlInSeconds', ], 'AuthorizerType' => [ 'shape' => 'AuthorizerType', 'locationName' => 'authorizerType', ], 'AuthorizerUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'authorizerUri', ], 'IdentitySource' => [ 'shape' => 'IdentitySourceList', 'locationName' => 'identitySource', ], 'IdentityValidationExpression' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'identityValidationExpression', ], 'JwtConfiguration' => [ 'shape' => 'JWTConfiguration', 'locationName' => 'jwtConfiguration', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'AuthorizerPayloadFormatVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'authorizerPayloadFormatVersion', ], 'EnableSimpleResponses' => [ 'shape' => '__boolean', 'locationName' => 'enableSimpleResponses', ], ], ], 'CreateDeploymentInput' => [ 'type' => 'structure', 'members' => [ 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'StageName' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'stageName', ], ], ], 'CreateDeploymentRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'StageName' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'stageName', ], ], 'required' => [ 'ApiId', ], ], 'CreateDeploymentResponse' => [ 'type' => 'structure', 'members' => [ 'AutoDeployed' => [ 'shape' => '__boolean', 'locationName' => 'autoDeployed', ], 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'DeploymentId' => [ 'shape' => 'Id', 'locationName' => 'deploymentId', ], 'DeploymentStatus' => [ 'shape' => 'DeploymentStatus', 'locationName' => 'deploymentStatus', ], 'DeploymentStatusMessage' => [ 'shape' => '__string', 'locationName' => 'deploymentStatusMessage', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], ], ], 'CreateDomainNameInput' => [ 'type' => 'structure', 'members' => [ 'DomainName' => [ 'shape' => 'StringWithLengthBetween1And512', 'locationName' => 'domainName', ], 'DomainNameConfigurations' => [ 'shape' => 'DomainNameConfigurations', 'locationName' => 'domainNameConfigurations', ], 'MutualTlsAuthentication' => [ 'shape' => 'MutualTlsAuthenticationInput', 'locationName' => 'mutualTlsAuthentication', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], 'required' => [ 'DomainName', ], ], 'CreateDomainNameRequest' => [ 'type' => 'structure', 'members' => [ 'DomainName' => [ 'shape' => 'StringWithLengthBetween1And512', 'locationName' => 'domainName', ], 'DomainNameConfigurations' => [ 'shape' => 'DomainNameConfigurations', 'locationName' => 'domainNameConfigurations', ], 'MutualTlsAuthentication' => [ 'shape' => 'MutualTlsAuthenticationInput', 'locationName' => 'mutualTlsAuthentication', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], 'required' => [ 'DomainName', ], ], 'CreateDomainNameResponse' => [ 'type' => 'structure', 'members' => [ 'ApiMappingSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'apiMappingSelectionExpression', ], 'DomainName' => [ 'shape' => 'StringWithLengthBetween1And512', 'locationName' => 'domainName', ], 'DomainNameConfigurations' => [ 'shape' => 'DomainNameConfigurations', 'locationName' => 'domainNameConfigurations', ], 'MutualTlsAuthentication' => [ 'shape' => 'MutualTlsAuthentication', 'locationName' => 'mutualTlsAuthentication', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], ], 'CreateIntegrationInput' => [ 'type' => 'structure', 'members' => [ 'ConnectionId' => [ 'shape' => 'StringWithLengthBetween1And1024', 'locationName' => 'connectionId', ], 'ConnectionType' => [ 'shape' => 'ConnectionType', 'locationName' => 'connectionType', ], 'ContentHandlingStrategy' => [ 'shape' => 'ContentHandlingStrategy', 'locationName' => 'contentHandlingStrategy', ], 'CredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'credentialsArn', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'IntegrationMethod' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'integrationMethod', ], 'IntegrationSubtype' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'integrationSubtype', ], 'IntegrationType' => [ 'shape' => 'IntegrationType', 'locationName' => 'integrationType', ], 'IntegrationUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'integrationUri', ], 'PassthroughBehavior' => [ 'shape' => 'PassthroughBehavior', 'locationName' => 'passthroughBehavior', ], 'PayloadFormatVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'payloadFormatVersion', ], 'RequestParameters' => [ 'shape' => 'IntegrationParameters', 'locationName' => 'requestParameters', ], 'ResponseParameters' => [ 'shape' => 'ResponseParameters', 'locationName' => 'responseParameters', ], 'RequestTemplates' => [ 'shape' => 'TemplateMap', 'locationName' => 'requestTemplates', ], 'TemplateSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'templateSelectionExpression', ], 'TimeoutInMillis' => [ 'shape' => 'IntegerWithLengthBetween50And30000', 'locationName' => 'timeoutInMillis', ], 'TlsConfig' => [ 'shape' => 'TlsConfigInput', 'locationName' => 'tlsConfig', ], ], 'required' => [ 'IntegrationType', ], ], 'CreateIntegrationRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'ConnectionId' => [ 'shape' => 'StringWithLengthBetween1And1024', 'locationName' => 'connectionId', ], 'ConnectionType' => [ 'shape' => 'ConnectionType', 'locationName' => 'connectionType', ], 'ContentHandlingStrategy' => [ 'shape' => 'ContentHandlingStrategy', 'locationName' => 'contentHandlingStrategy', ], 'CredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'credentialsArn', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'IntegrationMethod' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'integrationMethod', ], 'IntegrationSubtype' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'integrationSubtype', ], 'IntegrationType' => [ 'shape' => 'IntegrationType', 'locationName' => 'integrationType', ], 'IntegrationUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'integrationUri', ], 'PassthroughBehavior' => [ 'shape' => 'PassthroughBehavior', 'locationName' => 'passthroughBehavior', ], 'PayloadFormatVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'payloadFormatVersion', ], 'RequestParameters' => [ 'shape' => 'IntegrationParameters', 'locationName' => 'requestParameters', ], 'ResponseParameters' => [ 'shape' => 'ResponseParameters', 'locationName' => 'responseParameters', ], 'RequestTemplates' => [ 'shape' => 'TemplateMap', 'locationName' => 'requestTemplates', ], 'TemplateSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'templateSelectionExpression', ], 'TimeoutInMillis' => [ 'shape' => 'IntegerWithLengthBetween50And30000', 'locationName' => 'timeoutInMillis', ], 'TlsConfig' => [ 'shape' => 'TlsConfigInput', 'locationName' => 'tlsConfig', ], ], 'required' => [ 'ApiId', 'IntegrationType', ], ], 'CreateIntegrationResult' => [ 'type' => 'structure', 'members' => [ 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'ConnectionId' => [ 'shape' => 'StringWithLengthBetween1And1024', 'locationName' => 'connectionId', ], 'ConnectionType' => [ 'shape' => 'ConnectionType', 'locationName' => 'connectionType', ], 'ContentHandlingStrategy' => [ 'shape' => 'ContentHandlingStrategy', 'locationName' => 'contentHandlingStrategy', ], 'CredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'credentialsArn', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'IntegrationId' => [ 'shape' => 'Id', 'locationName' => 'integrationId', ], 'IntegrationMethod' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'integrationMethod', ], 'IntegrationResponseSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'integrationResponseSelectionExpression', ], 'IntegrationSubtype' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'integrationSubtype', ], 'IntegrationType' => [ 'shape' => 'IntegrationType', 'locationName' => 'integrationType', ], 'IntegrationUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'integrationUri', ], 'PassthroughBehavior' => [ 'shape' => 'PassthroughBehavior', 'locationName' => 'passthroughBehavior', ], 'PayloadFormatVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'payloadFormatVersion', ], 'RequestParameters' => [ 'shape' => 'IntegrationParameters', 'locationName' => 'requestParameters', ], 'ResponseParameters' => [ 'shape' => 'ResponseParameters', 'locationName' => 'responseParameters', ], 'RequestTemplates' => [ 'shape' => 'TemplateMap', 'locationName' => 'requestTemplates', ], 'TemplateSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'templateSelectionExpression', ], 'TimeoutInMillis' => [ 'shape' => 'IntegerWithLengthBetween50And30000', 'locationName' => 'timeoutInMillis', ], 'TlsConfig' => [ 'shape' => 'TlsConfig', 'locationName' => 'tlsConfig', ], ], ], 'CreateIntegrationResponseInput' => [ 'type' => 'structure', 'members' => [ 'ContentHandlingStrategy' => [ 'shape' => 'ContentHandlingStrategy', 'locationName' => 'contentHandlingStrategy', ], 'IntegrationResponseKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'integrationResponseKey', ], 'ResponseParameters' => [ 'shape' => 'IntegrationParameters', 'locationName' => 'responseParameters', ], 'ResponseTemplates' => [ 'shape' => 'TemplateMap', 'locationName' => 'responseTemplates', ], 'TemplateSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'templateSelectionExpression', ], ], 'required' => [ 'IntegrationResponseKey', ], ], 'CreateIntegrationResponseRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'ContentHandlingStrategy' => [ 'shape' => 'ContentHandlingStrategy', 'locationName' => 'contentHandlingStrategy', ], 'IntegrationId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'integrationId', ], 'IntegrationResponseKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'integrationResponseKey', ], 'ResponseParameters' => [ 'shape' => 'IntegrationParameters', 'locationName' => 'responseParameters', ], 'ResponseTemplates' => [ 'shape' => 'TemplateMap', 'locationName' => 'responseTemplates', ], 'TemplateSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'templateSelectionExpression', ], ], 'required' => [ 'ApiId', 'IntegrationId', 'IntegrationResponseKey', ], ], 'CreateIntegrationResponseResponse' => [ 'type' => 'structure', 'members' => [ 'ContentHandlingStrategy' => [ 'shape' => 'ContentHandlingStrategy', 'locationName' => 'contentHandlingStrategy', ], 'IntegrationResponseId' => [ 'shape' => 'Id', 'locationName' => 'integrationResponseId', ], 'IntegrationResponseKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'integrationResponseKey', ], 'ResponseParameters' => [ 'shape' => 'IntegrationParameters', 'locationName' => 'responseParameters', ], 'ResponseTemplates' => [ 'shape' => 'TemplateMap', 'locationName' => 'responseTemplates', ], 'TemplateSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'templateSelectionExpression', ], ], ], 'CreateModelInput' => [ 'type' => 'structure', 'members' => [ 'ContentType' => [ 'shape' => 'StringWithLengthBetween1And256', 'locationName' => 'contentType', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'Schema' => [ 'shape' => 'StringWithLengthBetween0And32K', 'locationName' => 'schema', ], ], 'required' => [ 'Schema', 'Name', ], ], 'CreateModelRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'ContentType' => [ 'shape' => 'StringWithLengthBetween1And256', 'locationName' => 'contentType', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'Schema' => [ 'shape' => 'StringWithLengthBetween0And32K', 'locationName' => 'schema', ], ], 'required' => [ 'ApiId', 'Schema', 'Name', ], ], 'CreateModelResponse' => [ 'type' => 'structure', 'members' => [ 'ContentType' => [ 'shape' => 'StringWithLengthBetween1And256', 'locationName' => 'contentType', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'ModelId' => [ 'shape' => 'Id', 'locationName' => 'modelId', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'Schema' => [ 'shape' => 'StringWithLengthBetween0And32K', 'locationName' => 'schema', ], ], ], 'CreateRouteInput' => [ 'type' => 'structure', 'members' => [ 'ApiKeyRequired' => [ 'shape' => '__boolean', 'locationName' => 'apiKeyRequired', ], 'AuthorizationScopes' => [ 'shape' => 'AuthorizationScopes', 'locationName' => 'authorizationScopes', ], 'AuthorizationType' => [ 'shape' => 'AuthorizationType', 'locationName' => 'authorizationType', ], 'AuthorizerId' => [ 'shape' => 'Id', 'locationName' => 'authorizerId', ], 'ModelSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'modelSelectionExpression', ], 'OperationName' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'operationName', ], 'RequestModels' => [ 'shape' => 'RouteModels', 'locationName' => 'requestModels', ], 'RequestParameters' => [ 'shape' => 'RouteParameters', 'locationName' => 'requestParameters', ], 'RouteKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeKey', ], 'RouteResponseSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeResponseSelectionExpression', ], 'Target' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'target', ], ], 'required' => [ 'RouteKey', ], ], 'CreateRouteRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'ApiKeyRequired' => [ 'shape' => '__boolean', 'locationName' => 'apiKeyRequired', ], 'AuthorizationScopes' => [ 'shape' => 'AuthorizationScopes', 'locationName' => 'authorizationScopes', ], 'AuthorizationType' => [ 'shape' => 'AuthorizationType', 'locationName' => 'authorizationType', ], 'AuthorizerId' => [ 'shape' => 'Id', 'locationName' => 'authorizerId', ], 'ModelSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'modelSelectionExpression', ], 'OperationName' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'operationName', ], 'RequestModels' => [ 'shape' => 'RouteModels', 'locationName' => 'requestModels', ], 'RequestParameters' => [ 'shape' => 'RouteParameters', 'locationName' => 'requestParameters', ], 'RouteKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeKey', ], 'RouteResponseSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeResponseSelectionExpression', ], 'Target' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'target', ], ], 'required' => [ 'ApiId', 'RouteKey', ], ], 'CreateRouteResult' => [ 'type' => 'structure', 'members' => [ 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'ApiKeyRequired' => [ 'shape' => '__boolean', 'locationName' => 'apiKeyRequired', ], 'AuthorizationScopes' => [ 'shape' => 'AuthorizationScopes', 'locationName' => 'authorizationScopes', ], 'AuthorizationType' => [ 'shape' => 'AuthorizationType', 'locationName' => 'authorizationType', ], 'AuthorizerId' => [ 'shape' => 'Id', 'locationName' => 'authorizerId', ], 'ModelSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'modelSelectionExpression', ], 'OperationName' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'operationName', ], 'RequestModels' => [ 'shape' => 'RouteModels', 'locationName' => 'requestModels', ], 'RequestParameters' => [ 'shape' => 'RouteParameters', 'locationName' => 'requestParameters', ], 'RouteId' => [ 'shape' => 'Id', 'locationName' => 'routeId', ], 'RouteKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeKey', ], 'RouteResponseSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeResponseSelectionExpression', ], 'Target' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'target', ], ], ], 'CreateRouteResponseInput' => [ 'type' => 'structure', 'members' => [ 'ModelSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'modelSelectionExpression', ], 'ResponseModels' => [ 'shape' => 'RouteModels', 'locationName' => 'responseModels', ], 'ResponseParameters' => [ 'shape' => 'RouteParameters', 'locationName' => 'responseParameters', ], 'RouteResponseKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeResponseKey', ], ], 'required' => [ 'RouteResponseKey', ], ], 'CreateRouteResponseRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'ModelSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'modelSelectionExpression', ], 'ResponseModels' => [ 'shape' => 'RouteModels', 'locationName' => 'responseModels', ], 'ResponseParameters' => [ 'shape' => 'RouteParameters', 'locationName' => 'responseParameters', ], 'RouteId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'routeId', ], 'RouteResponseKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeResponseKey', ], ], 'required' => [ 'ApiId', 'RouteId', 'RouteResponseKey', ], ], 'CreateRouteResponseResponse' => [ 'type' => 'structure', 'members' => [ 'ModelSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'modelSelectionExpression', ], 'ResponseModels' => [ 'shape' => 'RouteModels', 'locationName' => 'responseModels', ], 'ResponseParameters' => [ 'shape' => 'RouteParameters', 'locationName' => 'responseParameters', ], 'RouteResponseId' => [ 'shape' => 'Id', 'locationName' => 'routeResponseId', ], 'RouteResponseKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeResponseKey', ], ], ], 'CreateStageInput' => [ 'type' => 'structure', 'members' => [ 'AccessLogSettings' => [ 'shape' => 'AccessLogSettings', 'locationName' => 'accessLogSettings', ], 'AutoDeploy' => [ 'shape' => '__boolean', 'locationName' => 'autoDeploy', ], 'ClientCertificateId' => [ 'shape' => 'Id', 'locationName' => 'clientCertificateId', ], 'DefaultRouteSettings' => [ 'shape' => 'RouteSettings', 'locationName' => 'defaultRouteSettings', ], 'DeploymentId' => [ 'shape' => 'Id', 'locationName' => 'deploymentId', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'RouteSettings' => [ 'shape' => 'RouteSettingsMap', 'locationName' => 'routeSettings', ], 'StageName' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'stageName', ], 'StageVariables' => [ 'shape' => 'StageVariablesMap', 'locationName' => 'stageVariables', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], 'required' => [ 'StageName', ], ], 'CreateStageRequest' => [ 'type' => 'structure', 'members' => [ 'AccessLogSettings' => [ 'shape' => 'AccessLogSettings', 'locationName' => 'accessLogSettings', ], 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'AutoDeploy' => [ 'shape' => '__boolean', 'locationName' => 'autoDeploy', ], 'ClientCertificateId' => [ 'shape' => 'Id', 'locationName' => 'clientCertificateId', ], 'DefaultRouteSettings' => [ 'shape' => 'RouteSettings', 'locationName' => 'defaultRouteSettings', ], 'DeploymentId' => [ 'shape' => 'Id', 'locationName' => 'deploymentId', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'RouteSettings' => [ 'shape' => 'RouteSettingsMap', 'locationName' => 'routeSettings', ], 'StageName' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'stageName', ], 'StageVariables' => [ 'shape' => 'StageVariablesMap', 'locationName' => 'stageVariables', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], 'required' => [ 'ApiId', 'StageName', ], ], 'CreateStageResponse' => [ 'type' => 'structure', 'members' => [ 'AccessLogSettings' => [ 'shape' => 'AccessLogSettings', 'locationName' => 'accessLogSettings', ], 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'AutoDeploy' => [ 'shape' => '__boolean', 'locationName' => 'autoDeploy', ], 'ClientCertificateId' => [ 'shape' => 'Id', 'locationName' => 'clientCertificateId', ], 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'DefaultRouteSettings' => [ 'shape' => 'RouteSettings', 'locationName' => 'defaultRouteSettings', ], 'DeploymentId' => [ 'shape' => 'Id', 'locationName' => 'deploymentId', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'LastDeploymentStatusMessage' => [ 'shape' => '__string', 'locationName' => 'lastDeploymentStatusMessage', ], 'LastUpdatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'lastUpdatedDate', ], 'RouteSettings' => [ 'shape' => 'RouteSettingsMap', 'locationName' => 'routeSettings', ], 'StageName' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'stageName', ], 'StageVariables' => [ 'shape' => 'StageVariablesMap', 'locationName' => 'stageVariables', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], ], 'CreateVpcLinkInput' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'SecurityGroupIds' => [ 'shape' => 'SecurityGroupIdList', 'locationName' => 'securityGroupIds', ], 'SubnetIds' => [ 'shape' => 'SubnetIdList', 'locationName' => 'subnetIds', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], 'required' => [ 'SubnetIds', 'Name', ], ], 'CreateVpcLinkRequest' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'SecurityGroupIds' => [ 'shape' => 'SecurityGroupIdList', 'locationName' => 'securityGroupIds', ], 'SubnetIds' => [ 'shape' => 'SubnetIdList', 'locationName' => 'subnetIds', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], 'required' => [ 'SubnetIds', 'Name', ], ], 'CreateVpcLinkResponse' => [ 'type' => 'structure', 'members' => [ 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'SecurityGroupIds' => [ 'shape' => 'SecurityGroupIdList', 'locationName' => 'securityGroupIds', ], 'SubnetIds' => [ 'shape' => 'SubnetIdList', 'locationName' => 'subnetIds', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], 'VpcLinkId' => [ 'shape' => 'Id', 'locationName' => 'vpcLinkId', ], 'VpcLinkStatus' => [ 'shape' => 'VpcLinkStatus', 'locationName' => 'vpcLinkStatus', ], 'VpcLinkStatusMessage' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'vpcLinkStatusMessage', ], 'VpcLinkVersion' => [ 'shape' => 'VpcLinkVersion', 'locationName' => 'vpcLinkVersion', ], ], ], 'DeleteAccessLogSettingsRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'StageName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'stageName', ], ], 'required' => [ 'StageName', 'ApiId', ], ], 'DeleteApiMappingRequest' => [ 'type' => 'structure', 'members' => [ 'ApiMappingId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiMappingId', ], 'DomainName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'domainName', ], ], 'required' => [ 'ApiMappingId', 'DomainName', ], ], 'DeleteApiRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], ], 'required' => [ 'ApiId', ], ], 'DeleteAuthorizerRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'AuthorizerId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'authorizerId', ], ], 'required' => [ 'AuthorizerId', 'ApiId', ], ], 'DeleteCorsConfigurationRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], ], 'required' => [ 'ApiId', ], ], 'DeleteDeploymentRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'DeploymentId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'deploymentId', ], ], 'required' => [ 'ApiId', 'DeploymentId', ], ], 'DeleteDomainNameRequest' => [ 'type' => 'structure', 'members' => [ 'DomainName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'domainName', ], ], 'required' => [ 'DomainName', ], ], 'DeleteIntegrationRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'IntegrationId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'integrationId', ], ], 'required' => [ 'ApiId', 'IntegrationId', ], ], 'DeleteIntegrationResponseRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'IntegrationId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'integrationId', ], 'IntegrationResponseId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'integrationResponseId', ], ], 'required' => [ 'ApiId', 'IntegrationResponseId', 'IntegrationId', ], ], 'DeleteModelRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'ModelId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'modelId', ], ], 'required' => [ 'ModelId', 'ApiId', ], ], 'DeleteRouteRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'RouteId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'routeId', ], ], 'required' => [ 'ApiId', 'RouteId', ], ], 'DeleteRouteRequestParameterRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'RequestParameterKey' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'requestParameterKey', ], 'RouteId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'routeId', ], ], 'required' => [ 'RequestParameterKey', 'ApiId', 'RouteId', ], ], 'DeleteRouteResponseRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'RouteId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'routeId', ], 'RouteResponseId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'routeResponseId', ], ], 'required' => [ 'RouteResponseId', 'ApiId', 'RouteId', ], ], 'DeleteRouteSettingsRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'RouteKey' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'routeKey', ], 'StageName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'stageName', ], ], 'required' => [ 'StageName', 'RouteKey', 'ApiId', ], ], 'DeleteStageRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'StageName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'stageName', ], ], 'required' => [ 'StageName', 'ApiId', ], ], 'DeleteVpcLinkRequest' => [ 'type' => 'structure', 'members' => [ 'VpcLinkId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'vpcLinkId', ], ], 'required' => [ 'VpcLinkId', ], ], 'DeleteVpcLinkResponse' => [ 'type' => 'structure', 'members' => [], ], 'Deployment' => [ 'type' => 'structure', 'members' => [ 'AutoDeployed' => [ 'shape' => '__boolean', 'locationName' => 'autoDeployed', ], 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'DeploymentId' => [ 'shape' => 'Id', 'locationName' => 'deploymentId', ], 'DeploymentStatus' => [ 'shape' => 'DeploymentStatus', 'locationName' => 'deploymentStatus', ], 'DeploymentStatusMessage' => [ 'shape' => '__string', 'locationName' => 'deploymentStatusMessage', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], ], ], 'DeploymentStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING', 'FAILED', 'DEPLOYED', ], ], 'Deployments' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfDeployment', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'DomainName' => [ 'type' => 'structure', 'members' => [ 'ApiMappingSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'apiMappingSelectionExpression', ], 'DomainName' => [ 'shape' => 'StringWithLengthBetween1And512', 'locationName' => 'domainName', ], 'DomainNameConfigurations' => [ 'shape' => 'DomainNameConfigurations', 'locationName' => 'domainNameConfigurations', ], 'MutualTlsAuthentication' => [ 'shape' => 'MutualTlsAuthentication', 'locationName' => 'mutualTlsAuthentication', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], 'required' => [ 'DomainName', ], ], 'DomainNameConfiguration' => [ 'type' => 'structure', 'members' => [ 'ApiGatewayDomainName' => [ 'shape' => '__string', 'locationName' => 'apiGatewayDomainName', ], 'CertificateArn' => [ 'shape' => 'Arn', 'locationName' => 'certificateArn', ], 'CertificateName' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'certificateName', ], 'CertificateUploadDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'certificateUploadDate', ], 'DomainNameStatus' => [ 'shape' => 'DomainNameStatus', 'locationName' => 'domainNameStatus', ], 'DomainNameStatusMessage' => [ 'shape' => '__string', 'locationName' => 'domainNameStatusMessage', ], 'EndpointType' => [ 'shape' => 'EndpointType', 'locationName' => 'endpointType', ], 'HostedZoneId' => [ 'shape' => '__string', 'locationName' => 'hostedZoneId', ], 'SecurityPolicy' => [ 'shape' => 'SecurityPolicy', 'locationName' => 'securityPolicy', ], 'OwnershipVerificationCertificateArn' => [ 'shape' => 'Arn', 'locationName' => 'ownershipVerificationCertificateArn', ], ], ], 'DomainNameConfigurations' => [ 'type' => 'list', 'member' => [ 'shape' => 'DomainNameConfiguration', ], ], 'DomainNameStatus' => [ 'type' => 'string', 'enum' => [ 'AVAILABLE', 'UPDATING', 'PENDING_CERTIFICATE_REIMPORT', 'PENDING_OWNERSHIP_VERIFICATION', ], ], 'DomainNames' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfDomainName', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'EndpointType' => [ 'type' => 'string', 'enum' => [ 'REGIONAL', 'EDGE', ], ], 'ExportApiRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'ExportVersion' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'exportVersion', ], 'IncludeExtensions' => [ 'shape' => '__boolean', 'location' => 'querystring', 'locationName' => 'includeExtensions', ], 'OutputType' => [ 'shape' => '__string', 'enum' => [ 'YAML', 'JSON', ], 'location' => 'querystring', 'locationName' => 'outputType', ], 'Specification' => [ 'shape' => '__string', 'enum' => [ 'OAS30', ], 'location' => 'uri', 'locationName' => 'specification', ], 'StageName' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'stageName', ], ], 'required' => [ 'Specification', 'OutputType', 'ApiId', ], ], 'ExportApiResponse' => [ 'type' => 'structure', 'members' => [ 'body' => [ 'shape' => 'ExportedApi', ], ], 'payload' => 'body', ], 'ExportedApi' => [ 'type' => 'blob', ], 'ResetAuthorizersCacheRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'StageName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'stageName', ], ], 'required' => [ 'StageName', 'ApiId', ], ], 'GetApiMappingRequest' => [ 'type' => 'structure', 'members' => [ 'ApiMappingId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiMappingId', ], 'DomainName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'domainName', ], ], 'required' => [ 'ApiMappingId', 'DomainName', ], ], 'GetApiMappingResponse' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => 'Id', 'locationName' => 'apiId', ], 'ApiMappingId' => [ 'shape' => 'Id', 'locationName' => 'apiMappingId', ], 'ApiMappingKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'apiMappingKey', ], 'Stage' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'stage', ], ], ], 'GetApiMappingsRequest' => [ 'type' => 'structure', 'members' => [ 'DomainName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'domainName', ], 'MaxResults' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'NextToken' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], 'required' => [ 'DomainName', ], ], 'GetApiMappingsResponse' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfApiMapping', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'GetApiRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], ], 'required' => [ 'ApiId', ], ], 'GetApiResponse' => [ 'type' => 'structure', 'members' => [ 'ApiEndpoint' => [ 'shape' => '__string', 'locationName' => 'apiEndpoint', ], 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'ApiId' => [ 'shape' => 'Id', 'locationName' => 'apiId', ], 'ApiKeySelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'apiKeySelectionExpression', ], 'CorsConfiguration' => [ 'shape' => 'Cors', 'locationName' => 'corsConfiguration', ], 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'DisableSchemaValidation' => [ 'shape' => '__boolean', 'locationName' => 'disableSchemaValidation', ], 'DisableExecuteApiEndpoint' => [ 'shape' => '__boolean', 'locationName' => 'disableExecuteApiEndpoint', ], 'ImportInfo' => [ 'shape' => '__listOf__string', 'locationName' => 'importInfo', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'ProtocolType' => [ 'shape' => 'ProtocolType', 'locationName' => 'protocolType', ], 'RouteSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeSelectionExpression', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], 'Version' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'version', ], 'Warnings' => [ 'shape' => '__listOf__string', 'locationName' => 'warnings', ], ], ], 'GetApisRequest' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'NextToken' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'GetApisResponse' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfApi', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'GetAuthorizerRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'AuthorizerId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'authorizerId', ], ], 'required' => [ 'AuthorizerId', 'ApiId', ], ], 'GetAuthorizerResponse' => [ 'type' => 'structure', 'members' => [ 'AuthorizerCredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'authorizerCredentialsArn', ], 'AuthorizerId' => [ 'shape' => 'Id', 'locationName' => 'authorizerId', ], 'AuthorizerResultTtlInSeconds' => [ 'shape' => 'IntegerWithLengthBetween0And3600', 'locationName' => 'authorizerResultTtlInSeconds', ], 'AuthorizerType' => [ 'shape' => 'AuthorizerType', 'locationName' => 'authorizerType', ], 'AuthorizerUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'authorizerUri', ], 'IdentitySource' => [ 'shape' => 'IdentitySourceList', 'locationName' => 'identitySource', ], 'IdentityValidationExpression' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'identityValidationExpression', ], 'JwtConfiguration' => [ 'shape' => 'JWTConfiguration', 'locationName' => 'jwtConfiguration', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'AuthorizerPayloadFormatVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'authorizerPayloadFormatVersion', ], 'EnableSimpleResponses' => [ 'shape' => '__boolean', 'locationName' => 'enableSimpleResponses', ], ], ], 'GetAuthorizersRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'MaxResults' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'NextToken' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], 'required' => [ 'ApiId', ], ], 'GetAuthorizersResponse' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfAuthorizer', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'GetDeploymentRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'DeploymentId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'deploymentId', ], ], 'required' => [ 'ApiId', 'DeploymentId', ], ], 'GetDeploymentResponse' => [ 'type' => 'structure', 'members' => [ 'AutoDeployed' => [ 'shape' => '__boolean', 'locationName' => 'autoDeployed', ], 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'DeploymentId' => [ 'shape' => 'Id', 'locationName' => 'deploymentId', ], 'DeploymentStatus' => [ 'shape' => 'DeploymentStatus', 'locationName' => 'deploymentStatus', ], 'DeploymentStatusMessage' => [ 'shape' => '__string', 'locationName' => 'deploymentStatusMessage', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], ], ], 'GetDeploymentsRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'MaxResults' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'NextToken' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], 'required' => [ 'ApiId', ], ], 'GetDeploymentsResponse' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfDeployment', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'GetDomainNameRequest' => [ 'type' => 'structure', 'members' => [ 'DomainName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'domainName', ], ], 'required' => [ 'DomainName', ], ], 'GetDomainNameResponse' => [ 'type' => 'structure', 'members' => [ 'ApiMappingSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'apiMappingSelectionExpression', ], 'DomainName' => [ 'shape' => 'StringWithLengthBetween1And512', 'locationName' => 'domainName', ], 'DomainNameConfigurations' => [ 'shape' => 'DomainNameConfigurations', 'locationName' => 'domainNameConfigurations', ], 'MutualTlsAuthentication' => [ 'shape' => 'MutualTlsAuthentication', 'locationName' => 'mutualTlsAuthentication', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], ], 'GetDomainNamesRequest' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'NextToken' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'GetDomainNamesResponse' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfDomainName', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'GetIntegrationRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'IntegrationId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'integrationId', ], ], 'required' => [ 'ApiId', 'IntegrationId', ], ], 'GetIntegrationResult' => [ 'type' => 'structure', 'members' => [ 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'ConnectionId' => [ 'shape' => 'StringWithLengthBetween1And1024', 'locationName' => 'connectionId', ], 'ConnectionType' => [ 'shape' => 'ConnectionType', 'locationName' => 'connectionType', ], 'ContentHandlingStrategy' => [ 'shape' => 'ContentHandlingStrategy', 'locationName' => 'contentHandlingStrategy', ], 'CredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'credentialsArn', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'IntegrationId' => [ 'shape' => 'Id', 'locationName' => 'integrationId', ], 'IntegrationMethod' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'integrationMethod', ], 'IntegrationResponseSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'integrationResponseSelectionExpression', ], 'IntegrationSubtype' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'integrationSubtype', ], 'IntegrationType' => [ 'shape' => 'IntegrationType', 'locationName' => 'integrationType', ], 'IntegrationUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'integrationUri', ], 'PassthroughBehavior' => [ 'shape' => 'PassthroughBehavior', 'locationName' => 'passthroughBehavior', ], 'PayloadFormatVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'payloadFormatVersion', ], 'RequestParameters' => [ 'shape' => 'IntegrationParameters', 'locationName' => 'requestParameters', ], 'ResponseParameters' => [ 'shape' => 'ResponseParameters', 'locationName' => 'responseParameters', ], 'RequestTemplates' => [ 'shape' => 'TemplateMap', 'locationName' => 'requestTemplates', ], 'TemplateSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'templateSelectionExpression', ], 'TimeoutInMillis' => [ 'shape' => 'IntegerWithLengthBetween50And30000', 'locationName' => 'timeoutInMillis', ], 'TlsConfig' => [ 'shape' => 'TlsConfig', 'locationName' => 'tlsConfig', ], ], ], 'GetIntegrationResponseRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'IntegrationId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'integrationId', ], 'IntegrationResponseId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'integrationResponseId', ], ], 'required' => [ 'ApiId', 'IntegrationResponseId', 'IntegrationId', ], ], 'GetIntegrationResponseResponse' => [ 'type' => 'structure', 'members' => [ 'ContentHandlingStrategy' => [ 'shape' => 'ContentHandlingStrategy', 'locationName' => 'contentHandlingStrategy', ], 'IntegrationResponseId' => [ 'shape' => 'Id', 'locationName' => 'integrationResponseId', ], 'IntegrationResponseKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'integrationResponseKey', ], 'ResponseParameters' => [ 'shape' => 'IntegrationParameters', 'locationName' => 'responseParameters', ], 'ResponseTemplates' => [ 'shape' => 'TemplateMap', 'locationName' => 'responseTemplates', ], 'TemplateSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'templateSelectionExpression', ], ], ], 'GetIntegrationResponsesRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'IntegrationId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'integrationId', ], 'MaxResults' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'NextToken' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], 'required' => [ 'IntegrationId', 'ApiId', ], ], 'GetIntegrationResponsesResponse' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfIntegrationResponse', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'GetIntegrationsRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'MaxResults' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'NextToken' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], 'required' => [ 'ApiId', ], ], 'GetIntegrationsResponse' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfIntegration', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'GetModelRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'ModelId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'modelId', ], ], 'required' => [ 'ModelId', 'ApiId', ], ], 'GetModelResponse' => [ 'type' => 'structure', 'members' => [ 'ContentType' => [ 'shape' => 'StringWithLengthBetween1And256', 'locationName' => 'contentType', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'ModelId' => [ 'shape' => 'Id', 'locationName' => 'modelId', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'Schema' => [ 'shape' => 'StringWithLengthBetween0And32K', 'locationName' => 'schema', ], ], ], 'GetModelTemplateRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'ModelId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'modelId', ], ], 'required' => [ 'ModelId', 'ApiId', ], ], 'GetModelTemplateResponse' => [ 'type' => 'structure', 'members' => [ 'Value' => [ 'shape' => '__string', 'locationName' => 'value', ], ], ], 'GetModelsRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'MaxResults' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'NextToken' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], 'required' => [ 'ApiId', ], ], 'GetModelsResponse' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfModel', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'GetRouteRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'RouteId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'routeId', ], ], 'required' => [ 'ApiId', 'RouteId', ], ], 'GetRouteResult' => [ 'type' => 'structure', 'members' => [ 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'ApiKeyRequired' => [ 'shape' => '__boolean', 'locationName' => 'apiKeyRequired', ], 'AuthorizationScopes' => [ 'shape' => 'AuthorizationScopes', 'locationName' => 'authorizationScopes', ], 'AuthorizationType' => [ 'shape' => 'AuthorizationType', 'locationName' => 'authorizationType', ], 'AuthorizerId' => [ 'shape' => 'Id', 'locationName' => 'authorizerId', ], 'ModelSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'modelSelectionExpression', ], 'OperationName' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'operationName', ], 'RequestModels' => [ 'shape' => 'RouteModels', 'locationName' => 'requestModels', ], 'RequestParameters' => [ 'shape' => 'RouteParameters', 'locationName' => 'requestParameters', ], 'RouteId' => [ 'shape' => 'Id', 'locationName' => 'routeId', ], 'RouteKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeKey', ], 'RouteResponseSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeResponseSelectionExpression', ], 'Target' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'target', ], ], ], 'GetRouteResponseRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'RouteId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'routeId', ], 'RouteResponseId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'routeResponseId', ], ], 'required' => [ 'RouteResponseId', 'ApiId', 'RouteId', ], ], 'GetRouteResponseResponse' => [ 'type' => 'structure', 'members' => [ 'ModelSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'modelSelectionExpression', ], 'ResponseModels' => [ 'shape' => 'RouteModels', 'locationName' => 'responseModels', ], 'ResponseParameters' => [ 'shape' => 'RouteParameters', 'locationName' => 'responseParameters', ], 'RouteResponseId' => [ 'shape' => 'Id', 'locationName' => 'routeResponseId', ], 'RouteResponseKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeResponseKey', ], ], ], 'GetRouteResponsesRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'MaxResults' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'NextToken' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'RouteId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'routeId', ], ], 'required' => [ 'RouteId', 'ApiId', ], ], 'GetRouteResponsesResponse' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfRouteResponse', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'GetRoutesRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'MaxResults' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'NextToken' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], 'required' => [ 'ApiId', ], ], 'GetRoutesResponse' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfRoute', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'GetStageRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'StageName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'stageName', ], ], 'required' => [ 'StageName', 'ApiId', ], ], 'GetStageResponse' => [ 'type' => 'structure', 'members' => [ 'AccessLogSettings' => [ 'shape' => 'AccessLogSettings', 'locationName' => 'accessLogSettings', ], 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'AutoDeploy' => [ 'shape' => '__boolean', 'locationName' => 'autoDeploy', ], 'ClientCertificateId' => [ 'shape' => 'Id', 'locationName' => 'clientCertificateId', ], 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'DefaultRouteSettings' => [ 'shape' => 'RouteSettings', 'locationName' => 'defaultRouteSettings', ], 'DeploymentId' => [ 'shape' => 'Id', 'locationName' => 'deploymentId', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'LastDeploymentStatusMessage' => [ 'shape' => '__string', 'locationName' => 'lastDeploymentStatusMessage', ], 'LastUpdatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'lastUpdatedDate', ], 'RouteSettings' => [ 'shape' => 'RouteSettingsMap', 'locationName' => 'routeSettings', ], 'StageName' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'stageName', ], 'StageVariables' => [ 'shape' => 'StageVariablesMap', 'locationName' => 'stageVariables', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], ], 'GetStagesRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'MaxResults' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'NextToken' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], 'required' => [ 'ApiId', ], ], 'GetStagesResponse' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfStage', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'GetTagsRequest' => [ 'type' => 'structure', 'members' => [ 'ResourceArn' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'resource-arn', ], ], 'required' => [ 'ResourceArn', ], ], 'GetTagsResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], ], 'GetVpcLinkRequest' => [ 'type' => 'structure', 'members' => [ 'VpcLinkId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'vpcLinkId', ], ], 'required' => [ 'VpcLinkId', ], ], 'GetVpcLinkResponse' => [ 'type' => 'structure', 'members' => [ 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'SecurityGroupIds' => [ 'shape' => 'SecurityGroupIdList', 'locationName' => 'securityGroupIds', ], 'SubnetIds' => [ 'shape' => 'SubnetIdList', 'locationName' => 'subnetIds', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], 'VpcLinkId' => [ 'shape' => 'Id', 'locationName' => 'vpcLinkId', ], 'VpcLinkStatus' => [ 'shape' => 'VpcLinkStatus', 'locationName' => 'vpcLinkStatus', ], 'VpcLinkStatusMessage' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'vpcLinkStatusMessage', ], 'VpcLinkVersion' => [ 'shape' => 'VpcLinkVersion', 'locationName' => 'vpcLinkVersion', ], ], ], 'GetVpcLinksRequest' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'NextToken' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'GetVpcLinksResponse' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfVpcLink', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'Id' => [ 'type' => 'string', ], 'IdentitySourceList' => [ 'type' => 'list', 'member' => [ 'shape' => '__string', ], ], 'ImportApiInput' => [ 'type' => 'structure', 'members' => [ 'Body' => [ 'shape' => '__string', 'locationName' => 'body', ], ], 'required' => [ 'Body', ], ], 'ImportApiRequest' => [ 'type' => 'structure', 'members' => [ 'Basepath' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'basepath', ], 'Body' => [ 'shape' => '__string', 'locationName' => 'body', ], 'FailOnWarnings' => [ 'shape' => '__boolean', 'location' => 'querystring', 'locationName' => 'failOnWarnings', ], ], 'required' => [ 'Body', ], ], 'ImportApiResponse' => [ 'type' => 'structure', 'members' => [ 'ApiEndpoint' => [ 'shape' => '__string', 'locationName' => 'apiEndpoint', ], 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'ApiId' => [ 'shape' => 'Id', 'locationName' => 'apiId', ], 'ApiKeySelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'apiKeySelectionExpression', ], 'CorsConfiguration' => [ 'shape' => 'Cors', 'locationName' => 'corsConfiguration', ], 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'DisableSchemaValidation' => [ 'shape' => '__boolean', 'locationName' => 'disableSchemaValidation', ], 'DisableExecuteApiEndpoint' => [ 'shape' => '__boolean', 'locationName' => 'disableExecuteApiEndpoint', ], 'ImportInfo' => [ 'shape' => '__listOf__string', 'locationName' => 'importInfo', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'ProtocolType' => [ 'shape' => 'ProtocolType', 'locationName' => 'protocolType', ], 'RouteSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeSelectionExpression', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], 'Version' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'version', ], 'Warnings' => [ 'shape' => '__listOf__string', 'locationName' => 'warnings', ], ], ], 'IntegerWithLengthBetween0And3600' => [ 'type' => 'integer', 'min' => 0, 'max' => 3600, ], 'IntegerWithLengthBetween50And30000' => [ 'type' => 'integer', 'min' => 50, 'max' => 30000, ], 'IntegerWithLengthBetweenMinus1And86400' => [ 'type' => 'integer', 'min' => -1, 'max' => 86400, ], 'Integration' => [ 'type' => 'structure', 'members' => [ 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'ConnectionId' => [ 'shape' => 'StringWithLengthBetween1And1024', 'locationName' => 'connectionId', ], 'ConnectionType' => [ 'shape' => 'ConnectionType', 'locationName' => 'connectionType', ], 'ContentHandlingStrategy' => [ 'shape' => 'ContentHandlingStrategy', 'locationName' => 'contentHandlingStrategy', ], 'CredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'credentialsArn', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'IntegrationId' => [ 'shape' => 'Id', 'locationName' => 'integrationId', ], 'IntegrationMethod' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'integrationMethod', ], 'IntegrationResponseSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'integrationResponseSelectionExpression', ], 'IntegrationSubtype' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'integrationSubtype', ], 'IntegrationType' => [ 'shape' => 'IntegrationType', 'locationName' => 'integrationType', ], 'IntegrationUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'integrationUri', ], 'PassthroughBehavior' => [ 'shape' => 'PassthroughBehavior', 'locationName' => 'passthroughBehavior', ], 'PayloadFormatVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'payloadFormatVersion', ], 'RequestParameters' => [ 'shape' => 'IntegrationParameters', 'locationName' => 'requestParameters', ], 'ResponseParameters' => [ 'shape' => 'ResponseParameters', 'locationName' => 'responseParameters', ], 'RequestTemplates' => [ 'shape' => 'TemplateMap', 'locationName' => 'requestTemplates', ], 'TemplateSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'templateSelectionExpression', ], 'TimeoutInMillis' => [ 'shape' => 'IntegerWithLengthBetween50And30000', 'locationName' => 'timeoutInMillis', ], 'TlsConfig' => [ 'shape' => 'TlsConfig', 'locationName' => 'tlsConfig', ], ], ], 'IntegrationParameters' => [ 'type' => 'map', 'key' => [ 'shape' => '__string', ], 'value' => [ 'shape' => 'StringWithLengthBetween1And512', ], ], 'ResponseParameters' => [ 'type' => 'map', 'key' => [ 'shape' => '__string', ], 'value' => [ 'shape' => 'IntegrationParameters', ], ], 'IntegrationResponse' => [ 'type' => 'structure', 'members' => [ 'ContentHandlingStrategy' => [ 'shape' => 'ContentHandlingStrategy', 'locationName' => 'contentHandlingStrategy', ], 'IntegrationResponseId' => [ 'shape' => 'Id', 'locationName' => 'integrationResponseId', ], 'IntegrationResponseKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'integrationResponseKey', ], 'ResponseParameters' => [ 'shape' => 'IntegrationParameters', 'locationName' => 'responseParameters', ], 'ResponseTemplates' => [ 'shape' => 'TemplateMap', 'locationName' => 'responseTemplates', ], 'TemplateSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'templateSelectionExpression', ], ], 'required' => [ 'IntegrationResponseKey', ], ], 'IntegrationResponses' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfIntegrationResponse', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'IntegrationType' => [ 'type' => 'string', 'enum' => [ 'AWS', 'HTTP', 'MOCK', 'HTTP_PROXY', 'AWS_PROXY', ], ], 'Integrations' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfIntegration', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'JWTConfiguration' => [ 'type' => 'structure', 'members' => [ 'Audience' => [ 'shape' => '__listOf__string', 'locationName' => 'audience', ], 'Issuer' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'issuer', ], ], ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'LimitType' => [ 'shape' => '__string', 'locationName' => 'limitType', ], 'Message' => [ 'shape' => '__string', 'locationName' => 'message', ], ], ], 'LoggingLevel' => [ 'type' => 'string', 'enum' => [ 'ERROR', 'INFO', 'OFF', ], ], 'Model' => [ 'type' => 'structure', 'members' => [ 'ContentType' => [ 'shape' => 'StringWithLengthBetween1And256', 'locationName' => 'contentType', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'ModelId' => [ 'shape' => 'Id', 'locationName' => 'modelId', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'Schema' => [ 'shape' => 'StringWithLengthBetween0And32K', 'locationName' => 'schema', ], ], 'required' => [ 'Name', ], ], 'Models' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfModel', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'MutualTlsAuthentication' => [ 'type' => 'structure', 'members' => [ 'TruststoreUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'truststoreUri', ], 'TruststoreVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'truststoreVersion', ], 'TruststoreWarnings' => [ 'shape' => '__listOf__string', 'locationName' => 'truststoreWarnings', ], ], ], 'MutualTlsAuthenticationInput' => [ 'type' => 'structure', 'members' => [ 'TruststoreUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'truststoreUri', ], 'TruststoreVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'truststoreVersion', ], ], ], 'NextToken' => [ 'type' => 'string', ], 'NotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => '__string', 'locationName' => 'message', ], 'ResourceType' => [ 'shape' => '__string', 'locationName' => 'resourceType', ], ], 'exception' => true, 'error' => [ 'httpStatusCode' => 404, ], ], 'ParameterConstraints' => [ 'type' => 'structure', 'members' => [ 'Required' => [ 'shape' => '__boolean', 'locationName' => 'required', ], ], ], 'PassthroughBehavior' => [ 'type' => 'string', 'enum' => [ 'WHEN_NO_MATCH', 'NEVER', 'WHEN_NO_TEMPLATES', ], ], 'ProtocolType' => [ 'type' => 'string', 'enum' => [ 'WEBSOCKET', 'HTTP', ], ], 'ReimportApiInput' => [ 'type' => 'structure', 'members' => [ 'Body' => [ 'shape' => '__string', 'locationName' => 'body', ], ], 'required' => [ 'Body', ], ], 'ReimportApiRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'Basepath' => [ 'shape' => '__string', 'location' => 'querystring', 'locationName' => 'basepath', ], 'Body' => [ 'shape' => '__string', 'locationName' => 'body', ], 'FailOnWarnings' => [ 'shape' => '__boolean', 'location' => 'querystring', 'locationName' => 'failOnWarnings', ], ], 'required' => [ 'ApiId', 'Body', ], ], 'ReimportApiResponse' => [ 'type' => 'structure', 'members' => [ 'ApiEndpoint' => [ 'shape' => '__string', 'locationName' => 'apiEndpoint', ], 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'ApiId' => [ 'shape' => 'Id', 'locationName' => 'apiId', ], 'ApiKeySelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'apiKeySelectionExpression', ], 'CorsConfiguration' => [ 'shape' => 'Cors', 'locationName' => 'corsConfiguration', ], 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'DisableSchemaValidation' => [ 'shape' => '__boolean', 'locationName' => 'disableSchemaValidation', ], 'DisableExecuteApiEndpoint' => [ 'shape' => '__boolean', 'locationName' => 'disableExecuteApiEndpoint', ], 'ImportInfo' => [ 'shape' => '__listOf__string', 'locationName' => 'importInfo', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'ProtocolType' => [ 'shape' => 'ProtocolType', 'locationName' => 'protocolType', ], 'RouteSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeSelectionExpression', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], 'Version' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'version', ], 'Warnings' => [ 'shape' => '__listOf__string', 'locationName' => 'warnings', ], ], ], 'Route' => [ 'type' => 'structure', 'members' => [ 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'ApiKeyRequired' => [ 'shape' => '__boolean', 'locationName' => 'apiKeyRequired', ], 'AuthorizationScopes' => [ 'shape' => 'AuthorizationScopes', 'locationName' => 'authorizationScopes', ], 'AuthorizationType' => [ 'shape' => 'AuthorizationType', 'locationName' => 'authorizationType', ], 'AuthorizerId' => [ 'shape' => 'Id', 'locationName' => 'authorizerId', ], 'ModelSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'modelSelectionExpression', ], 'OperationName' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'operationName', ], 'RequestModels' => [ 'shape' => 'RouteModels', 'locationName' => 'requestModels', ], 'RequestParameters' => [ 'shape' => 'RouteParameters', 'locationName' => 'requestParameters', ], 'RouteId' => [ 'shape' => 'Id', 'locationName' => 'routeId', ], 'RouteKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeKey', ], 'RouteResponseSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeResponseSelectionExpression', ], 'Target' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'target', ], ], 'required' => [ 'RouteKey', ], ], 'RouteModels' => [ 'type' => 'map', 'key' => [ 'shape' => '__string', ], 'value' => [ 'shape' => 'StringWithLengthBetween1And128', ], ], 'RouteParameters' => [ 'type' => 'map', 'key' => [ 'shape' => '__string', ], 'value' => [ 'shape' => 'ParameterConstraints', ], ], 'RouteResponse' => [ 'type' => 'structure', 'members' => [ 'ModelSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'modelSelectionExpression', ], 'ResponseModels' => [ 'shape' => 'RouteModels', 'locationName' => 'responseModels', ], 'ResponseParameters' => [ 'shape' => 'RouteParameters', 'locationName' => 'responseParameters', ], 'RouteResponseId' => [ 'shape' => 'Id', 'locationName' => 'routeResponseId', ], 'RouteResponseKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeResponseKey', ], ], 'required' => [ 'RouteResponseKey', ], ], 'RouteResponses' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfRouteResponse', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'RouteSettings' => [ 'type' => 'structure', 'members' => [ 'DataTraceEnabled' => [ 'shape' => '__boolean', 'locationName' => 'dataTraceEnabled', ], 'DetailedMetricsEnabled' => [ 'shape' => '__boolean', 'locationName' => 'detailedMetricsEnabled', ], 'LoggingLevel' => [ 'shape' => 'LoggingLevel', 'locationName' => 'loggingLevel', ], 'ThrottlingBurstLimit' => [ 'shape' => '__integer', 'locationName' => 'throttlingBurstLimit', ], 'ThrottlingRateLimit' => [ 'shape' => '__double', 'locationName' => 'throttlingRateLimit', ], ], ], 'RouteSettingsMap' => [ 'type' => 'map', 'key' => [ 'shape' => '__string', ], 'value' => [ 'shape' => 'RouteSettings', ], ], 'Routes' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfRoute', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'SecurityGroupIdList' => [ 'type' => 'list', 'member' => [ 'shape' => '__string', ], ], 'SecurityPolicy' => [ 'type' => 'string', 'enum' => [ 'TLS_1_0', 'TLS_1_2', ], ], 'SelectionExpression' => [ 'type' => 'string', ], 'SelectionKey' => [ 'type' => 'string', ], 'Stage' => [ 'type' => 'structure', 'members' => [ 'AccessLogSettings' => [ 'shape' => 'AccessLogSettings', 'locationName' => 'accessLogSettings', ], 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'AutoDeploy' => [ 'shape' => '__boolean', 'locationName' => 'autoDeploy', ], 'ClientCertificateId' => [ 'shape' => 'Id', 'locationName' => 'clientCertificateId', ], 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'DefaultRouteSettings' => [ 'shape' => 'RouteSettings', 'locationName' => 'defaultRouteSettings', ], 'DeploymentId' => [ 'shape' => 'Id', 'locationName' => 'deploymentId', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'LastDeploymentStatusMessage' => [ 'shape' => '__string', 'locationName' => 'lastDeploymentStatusMessage', ], 'LastUpdatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'lastUpdatedDate', ], 'RouteSettings' => [ 'shape' => 'RouteSettingsMap', 'locationName' => 'routeSettings', ], 'StageName' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'stageName', ], 'StageVariables' => [ 'shape' => 'StageVariablesMap', 'locationName' => 'stageVariables', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], 'required' => [ 'StageName', ], ], 'StageVariablesMap' => [ 'type' => 'map', 'key' => [ 'shape' => '__string', ], 'value' => [ 'shape' => 'StringWithLengthBetween0And2048', ], ], 'Stages' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfStage', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], 'StringWithLengthBetween0And1024' => [ 'type' => 'string', ], 'StringWithLengthBetween0And2048' => [ 'type' => 'string', ], 'StringWithLengthBetween0And32K' => [ 'type' => 'string', ], 'StringWithLengthBetween1And1024' => [ 'type' => 'string', ], 'StringWithLengthBetween1And128' => [ 'type' => 'string', ], 'StringWithLengthBetween1And1600' => [ 'type' => 'string', ], 'StringWithLengthBetween1And256' => [ 'type' => 'string', ], 'StringWithLengthBetween1And512' => [ 'type' => 'string', ], 'StringWithLengthBetween1And64' => [ 'type' => 'string', ], 'SubnetIdList' => [ 'type' => 'list', 'member' => [ 'shape' => '__string', ], ], 'TagResourceInput' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], ], 'TagResourceRequest' => [ 'type' => 'structure', 'members' => [ 'ResourceArn' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'resource-arn', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], 'required' => [ 'ResourceArn', ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'Tags' => [ 'type' => 'map', 'key' => [ 'shape' => '__string', ], 'value' => [ 'shape' => 'StringWithLengthBetween1And1600', ], ], 'Template' => [ 'type' => 'structure', 'members' => [ 'Value' => [ 'shape' => '__string', 'locationName' => 'value', ], ], ], 'TemplateMap' => [ 'type' => 'map', 'key' => [ 'shape' => '__string', ], 'value' => [ 'shape' => 'StringWithLengthBetween0And32K', ], ], 'TlsConfig' => [ 'type' => 'structure', 'members' => [ 'ServerNameToVerify' => [ 'shape' => 'StringWithLengthBetween1And512', 'locationName' => 'serverNameToVerify', ], ], ], 'TlsConfigInput' => [ 'type' => 'structure', 'members' => [ 'ServerNameToVerify' => [ 'shape' => 'StringWithLengthBetween1And512', 'locationName' => 'serverNameToVerify', ], ], ], 'TooManyRequestsException' => [ 'type' => 'structure', 'members' => [ 'LimitType' => [ 'shape' => '__string', 'locationName' => 'limitType', ], 'Message' => [ 'shape' => '__string', 'locationName' => 'message', ], ], 'exception' => true, 'error' => [ 'httpStatusCode' => 429, ], ], 'UntagResourceRequest' => [ 'type' => 'structure', 'members' => [ 'ResourceArn' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'resource-arn', ], 'TagKeys' => [ 'shape' => '__listOf__string', 'location' => 'querystring', 'locationName' => 'tagKeys', ], ], 'required' => [ 'ResourceArn', 'TagKeys', ], ], 'UpdateApiInput' => [ 'type' => 'structure', 'members' => [ 'ApiKeySelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'apiKeySelectionExpression', ], 'CorsConfiguration' => [ 'shape' => 'Cors', 'locationName' => 'corsConfiguration', ], 'CredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'credentialsArn', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'DisableSchemaValidation' => [ 'shape' => '__boolean', 'locationName' => 'disableSchemaValidation', ], 'DisableExecuteApiEndpoint' => [ 'shape' => '__boolean', 'locationName' => 'disableExecuteApiEndpoint', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'RouteKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeKey', ], 'RouteSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeSelectionExpression', ], 'Target' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'target', ], 'Version' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'version', ], ], ], 'UpdateApiMappingInput' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => 'Id', 'locationName' => 'apiId', ], 'ApiMappingKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'apiMappingKey', ], 'Stage' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'stage', ], ], ], 'UpdateApiMappingRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => 'Id', 'locationName' => 'apiId', ], 'ApiMappingId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiMappingId', ], 'ApiMappingKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'apiMappingKey', ], 'DomainName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'domainName', ], 'Stage' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'stage', ], ], 'required' => [ 'ApiMappingId', 'ApiId', 'DomainName', ], ], 'UpdateApiMappingResponse' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => 'Id', 'locationName' => 'apiId', ], 'ApiMappingId' => [ 'shape' => 'Id', 'locationName' => 'apiMappingId', ], 'ApiMappingKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'apiMappingKey', ], 'Stage' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'stage', ], ], ], 'UpdateApiRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'ApiKeySelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'apiKeySelectionExpression', ], 'CorsConfiguration' => [ 'shape' => 'Cors', 'locationName' => 'corsConfiguration', ], 'CredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'credentialsArn', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'DisableSchemaValidation' => [ 'shape' => '__boolean', 'locationName' => 'disableSchemaValidation', ], 'DisableExecuteApiEndpoint' => [ 'shape' => '__boolean', 'locationName' => 'disableExecuteApiEndpoint', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'RouteKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeKey', ], 'RouteSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeSelectionExpression', ], 'Target' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'target', ], 'Version' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'version', ], ], 'required' => [ 'ApiId', ], ], 'UpdateApiResponse' => [ 'type' => 'structure', 'members' => [ 'ApiEndpoint' => [ 'shape' => '__string', 'locationName' => 'apiEndpoint', ], 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'ApiId' => [ 'shape' => 'Id', 'locationName' => 'apiId', ], 'ApiKeySelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'apiKeySelectionExpression', ], 'CorsConfiguration' => [ 'shape' => 'Cors', 'locationName' => 'corsConfiguration', ], 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'DisableSchemaValidation' => [ 'shape' => '__boolean', 'locationName' => 'disableSchemaValidation', ], 'DisableExecuteApiEndpoint' => [ 'shape' => '__boolean', 'locationName' => 'disableExecuteApiEndpoint', ], 'ImportInfo' => [ 'shape' => '__listOf__string', 'locationName' => 'importInfo', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'ProtocolType' => [ 'shape' => 'ProtocolType', 'locationName' => 'protocolType', ], 'RouteSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeSelectionExpression', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], 'Version' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'version', ], 'Warnings' => [ 'shape' => '__listOf__string', 'locationName' => 'warnings', ], ], ], 'UpdateAuthorizerInput' => [ 'type' => 'structure', 'members' => [ 'AuthorizerCredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'authorizerCredentialsArn', ], 'AuthorizerResultTtlInSeconds' => [ 'shape' => 'IntegerWithLengthBetween0And3600', 'locationName' => 'authorizerResultTtlInSeconds', ], 'AuthorizerType' => [ 'shape' => 'AuthorizerType', 'locationName' => 'authorizerType', ], 'AuthorizerUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'authorizerUri', ], 'IdentitySource' => [ 'shape' => 'IdentitySourceList', 'locationName' => 'identitySource', ], 'IdentityValidationExpression' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'identityValidationExpression', ], 'JwtConfiguration' => [ 'shape' => 'JWTConfiguration', 'locationName' => 'jwtConfiguration', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'AuthorizerPayloadFormatVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'authorizerPayloadFormatVersion', ], 'EnableSimpleResponses' => [ 'shape' => '__boolean', 'locationName' => 'enableSimpleResponses', ], ], ], 'UpdateAuthorizerRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'AuthorizerCredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'authorizerCredentialsArn', ], 'AuthorizerId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'authorizerId', ], 'AuthorizerResultTtlInSeconds' => [ 'shape' => 'IntegerWithLengthBetween0And3600', 'locationName' => 'authorizerResultTtlInSeconds', ], 'AuthorizerType' => [ 'shape' => 'AuthorizerType', 'locationName' => 'authorizerType', ], 'AuthorizerUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'authorizerUri', ], 'IdentitySource' => [ 'shape' => 'IdentitySourceList', 'locationName' => 'identitySource', ], 'IdentityValidationExpression' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'identityValidationExpression', ], 'JwtConfiguration' => [ 'shape' => 'JWTConfiguration', 'locationName' => 'jwtConfiguration', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'AuthorizerPayloadFormatVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'authorizerPayloadFormatVersion', ], 'EnableSimpleResponses' => [ 'shape' => '__boolean', 'locationName' => 'enableSimpleResponses', ], ], 'required' => [ 'AuthorizerId', 'ApiId', ], ], 'UpdateAuthorizerResponse' => [ 'type' => 'structure', 'members' => [ 'AuthorizerCredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'authorizerCredentialsArn', ], 'AuthorizerId' => [ 'shape' => 'Id', 'locationName' => 'authorizerId', ], 'AuthorizerResultTtlInSeconds' => [ 'shape' => 'IntegerWithLengthBetween0And3600', 'locationName' => 'authorizerResultTtlInSeconds', ], 'AuthorizerType' => [ 'shape' => 'AuthorizerType', 'locationName' => 'authorizerType', ], 'AuthorizerUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'authorizerUri', ], 'IdentitySource' => [ 'shape' => 'IdentitySourceList', 'locationName' => 'identitySource', ], 'IdentityValidationExpression' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'identityValidationExpression', ], 'JwtConfiguration' => [ 'shape' => 'JWTConfiguration', 'locationName' => 'jwtConfiguration', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'AuthorizerPayloadFormatVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'authorizerPayloadFormatVersion', ], 'EnableSimpleResponses' => [ 'shape' => '__boolean', 'locationName' => 'enableSimpleResponses', ], ], ], 'UpdateDeploymentInput' => [ 'type' => 'structure', 'members' => [ 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], ], ], 'UpdateDeploymentRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'DeploymentId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'deploymentId', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], ], 'required' => [ 'ApiId', 'DeploymentId', ], ], 'UpdateDeploymentResponse' => [ 'type' => 'structure', 'members' => [ 'AutoDeployed' => [ 'shape' => '__boolean', 'locationName' => 'autoDeployed', ], 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'DeploymentId' => [ 'shape' => 'Id', 'locationName' => 'deploymentId', ], 'DeploymentStatus' => [ 'shape' => 'DeploymentStatus', 'locationName' => 'deploymentStatus', ], 'DeploymentStatusMessage' => [ 'shape' => '__string', 'locationName' => 'deploymentStatusMessage', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], ], ], 'UpdateDomainNameInput' => [ 'type' => 'structure', 'members' => [ 'DomainNameConfigurations' => [ 'shape' => 'DomainNameConfigurations', 'locationName' => 'domainNameConfigurations', ], 'MutualTlsAuthentication' => [ 'shape' => 'MutualTlsAuthenticationInput', 'locationName' => 'mutualTlsAuthentication', ], ], ], 'UpdateDomainNameRequest' => [ 'type' => 'structure', 'members' => [ 'DomainName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'domainName', ], 'DomainNameConfigurations' => [ 'shape' => 'DomainNameConfigurations', 'locationName' => 'domainNameConfigurations', ], 'MutualTlsAuthentication' => [ 'shape' => 'MutualTlsAuthenticationInput', 'locationName' => 'mutualTlsAuthentication', ], ], 'required' => [ 'DomainName', ], ], 'UpdateDomainNameResponse' => [ 'type' => 'structure', 'members' => [ 'ApiMappingSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'apiMappingSelectionExpression', ], 'DomainName' => [ 'shape' => 'StringWithLengthBetween1And512', 'locationName' => 'domainName', ], 'DomainNameConfigurations' => [ 'shape' => 'DomainNameConfigurations', 'locationName' => 'domainNameConfigurations', ], 'MutualTlsAuthentication' => [ 'shape' => 'MutualTlsAuthentication', 'locationName' => 'mutualTlsAuthentication', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], ], 'UpdateIntegrationInput' => [ 'type' => 'structure', 'members' => [ 'ConnectionId' => [ 'shape' => 'StringWithLengthBetween1And1024', 'locationName' => 'connectionId', ], 'ConnectionType' => [ 'shape' => 'ConnectionType', 'locationName' => 'connectionType', ], 'ContentHandlingStrategy' => [ 'shape' => 'ContentHandlingStrategy', 'locationName' => 'contentHandlingStrategy', ], 'CredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'credentialsArn', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'IntegrationMethod' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'integrationMethod', ], 'IntegrationSubtype' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'integrationSubtype', ], 'IntegrationType' => [ 'shape' => 'IntegrationType', 'locationName' => 'integrationType', ], 'IntegrationUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'integrationUri', ], 'PassthroughBehavior' => [ 'shape' => 'PassthroughBehavior', 'locationName' => 'passthroughBehavior', ], 'PayloadFormatVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'payloadFormatVersion', ], 'RequestParameters' => [ 'shape' => 'IntegrationParameters', 'locationName' => 'requestParameters', ], 'ResponseParameters' => [ 'shape' => 'ResponseParameters', 'locationName' => 'responseParameters', ], 'RequestTemplates' => [ 'shape' => 'TemplateMap', 'locationName' => 'requestTemplates', ], 'TemplateSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'templateSelectionExpression', ], 'TimeoutInMillis' => [ 'shape' => 'IntegerWithLengthBetween50And30000', 'locationName' => 'timeoutInMillis', ], 'TlsConfig' => [ 'shape' => 'TlsConfigInput', 'locationName' => 'tlsConfig', ], ], ], 'UpdateIntegrationRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'ConnectionId' => [ 'shape' => 'StringWithLengthBetween1And1024', 'locationName' => 'connectionId', ], 'ConnectionType' => [ 'shape' => 'ConnectionType', 'locationName' => 'connectionType', ], 'ContentHandlingStrategy' => [ 'shape' => 'ContentHandlingStrategy', 'locationName' => 'contentHandlingStrategy', ], 'CredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'credentialsArn', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'IntegrationId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'integrationId', ], 'IntegrationMethod' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'integrationMethod', ], 'IntegrationSubtype' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'integrationSubtype', ], 'IntegrationType' => [ 'shape' => 'IntegrationType', 'locationName' => 'integrationType', ], 'IntegrationUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'integrationUri', ], 'PassthroughBehavior' => [ 'shape' => 'PassthroughBehavior', 'locationName' => 'passthroughBehavior', ], 'PayloadFormatVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'payloadFormatVersion', ], 'RequestParameters' => [ 'shape' => 'IntegrationParameters', 'locationName' => 'requestParameters', ], 'ResponseParameters' => [ 'shape' => 'ResponseParameters', 'locationName' => 'responseParameters', ], 'RequestTemplates' => [ 'shape' => 'TemplateMap', 'locationName' => 'requestTemplates', ], 'TemplateSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'templateSelectionExpression', ], 'TimeoutInMillis' => [ 'shape' => 'IntegerWithLengthBetween50And30000', 'locationName' => 'timeoutInMillis', ], 'TlsConfig' => [ 'shape' => 'TlsConfigInput', 'locationName' => 'tlsConfig', ], ], 'required' => [ 'ApiId', 'IntegrationId', ], ], 'UpdateIntegrationResult' => [ 'type' => 'structure', 'members' => [ 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'ConnectionId' => [ 'shape' => 'StringWithLengthBetween1And1024', 'locationName' => 'connectionId', ], 'ConnectionType' => [ 'shape' => 'ConnectionType', 'locationName' => 'connectionType', ], 'ContentHandlingStrategy' => [ 'shape' => 'ContentHandlingStrategy', 'locationName' => 'contentHandlingStrategy', ], 'CredentialsArn' => [ 'shape' => 'Arn', 'locationName' => 'credentialsArn', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'IntegrationId' => [ 'shape' => 'Id', 'locationName' => 'integrationId', ], 'IntegrationMethod' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'integrationMethod', ], 'IntegrationResponseSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'integrationResponseSelectionExpression', ], 'IntegrationSubtype' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'integrationSubtype', ], 'IntegrationType' => [ 'shape' => 'IntegrationType', 'locationName' => 'integrationType', ], 'IntegrationUri' => [ 'shape' => 'UriWithLengthBetween1And2048', 'locationName' => 'integrationUri', ], 'PassthroughBehavior' => [ 'shape' => 'PassthroughBehavior', 'locationName' => 'passthroughBehavior', ], 'PayloadFormatVersion' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'payloadFormatVersion', ], 'RequestParameters' => [ 'shape' => 'IntegrationParameters', 'locationName' => 'requestParameters', ], 'ResponseParameters' => [ 'shape' => 'ResponseParameters', 'locationName' => 'responseParameters', ], 'RequestTemplates' => [ 'shape' => 'TemplateMap', 'locationName' => 'requestTemplates', ], 'TemplateSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'templateSelectionExpression', ], 'TimeoutInMillis' => [ 'shape' => 'IntegerWithLengthBetween50And30000', 'locationName' => 'timeoutInMillis', ], 'TlsConfig' => [ 'shape' => 'TlsConfig', 'locationName' => 'tlsConfig', ], ], ], 'UpdateIntegrationResponseInput' => [ 'type' => 'structure', 'members' => [ 'ContentHandlingStrategy' => [ 'shape' => 'ContentHandlingStrategy', 'locationName' => 'contentHandlingStrategy', ], 'IntegrationResponseKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'integrationResponseKey', ], 'ResponseParameters' => [ 'shape' => 'IntegrationParameters', 'locationName' => 'responseParameters', ], 'ResponseTemplates' => [ 'shape' => 'TemplateMap', 'locationName' => 'responseTemplates', ], 'TemplateSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'templateSelectionExpression', ], ], ], 'UpdateIntegrationResponseRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'ContentHandlingStrategy' => [ 'shape' => 'ContentHandlingStrategy', 'locationName' => 'contentHandlingStrategy', ], 'IntegrationId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'integrationId', ], 'IntegrationResponseId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'integrationResponseId', ], 'IntegrationResponseKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'integrationResponseKey', ], 'ResponseParameters' => [ 'shape' => 'IntegrationParameters', 'locationName' => 'responseParameters', ], 'ResponseTemplates' => [ 'shape' => 'TemplateMap', 'locationName' => 'responseTemplates', ], 'TemplateSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'templateSelectionExpression', ], ], 'required' => [ 'ApiId', 'IntegrationResponseId', 'IntegrationId', ], ], 'UpdateIntegrationResponseResponse' => [ 'type' => 'structure', 'members' => [ 'ContentHandlingStrategy' => [ 'shape' => 'ContentHandlingStrategy', 'locationName' => 'contentHandlingStrategy', ], 'IntegrationResponseId' => [ 'shape' => 'Id', 'locationName' => 'integrationResponseId', ], 'IntegrationResponseKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'integrationResponseKey', ], 'ResponseParameters' => [ 'shape' => 'IntegrationParameters', 'locationName' => 'responseParameters', ], 'ResponseTemplates' => [ 'shape' => 'TemplateMap', 'locationName' => 'responseTemplates', ], 'TemplateSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'templateSelectionExpression', ], ], ], 'UpdateModelInput' => [ 'type' => 'structure', 'members' => [ 'ContentType' => [ 'shape' => 'StringWithLengthBetween1And256', 'locationName' => 'contentType', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'Schema' => [ 'shape' => 'StringWithLengthBetween0And32K', 'locationName' => 'schema', ], ], ], 'UpdateModelRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'ContentType' => [ 'shape' => 'StringWithLengthBetween1And256', 'locationName' => 'contentType', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'ModelId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'modelId', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'Schema' => [ 'shape' => 'StringWithLengthBetween0And32K', 'locationName' => 'schema', ], ], 'required' => [ 'ModelId', 'ApiId', ], ], 'UpdateModelResponse' => [ 'type' => 'structure', 'members' => [ 'ContentType' => [ 'shape' => 'StringWithLengthBetween1And256', 'locationName' => 'contentType', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'ModelId' => [ 'shape' => 'Id', 'locationName' => 'modelId', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'Schema' => [ 'shape' => 'StringWithLengthBetween0And32K', 'locationName' => 'schema', ], ], ], 'UpdateRouteInput' => [ 'type' => 'structure', 'members' => [ 'ApiKeyRequired' => [ 'shape' => '__boolean', 'locationName' => 'apiKeyRequired', ], 'AuthorizationScopes' => [ 'shape' => 'AuthorizationScopes', 'locationName' => 'authorizationScopes', ], 'AuthorizationType' => [ 'shape' => 'AuthorizationType', 'locationName' => 'authorizationType', ], 'AuthorizerId' => [ 'shape' => 'Id', 'locationName' => 'authorizerId', ], 'ModelSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'modelSelectionExpression', ], 'OperationName' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'operationName', ], 'RequestModels' => [ 'shape' => 'RouteModels', 'locationName' => 'requestModels', ], 'RequestParameters' => [ 'shape' => 'RouteParameters', 'locationName' => 'requestParameters', ], 'RouteKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeKey', ], 'RouteResponseSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeResponseSelectionExpression', ], 'Target' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'target', ], ], ], 'UpdateRouteRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'ApiKeyRequired' => [ 'shape' => '__boolean', 'locationName' => 'apiKeyRequired', ], 'AuthorizationScopes' => [ 'shape' => 'AuthorizationScopes', 'locationName' => 'authorizationScopes', ], 'AuthorizationType' => [ 'shape' => 'AuthorizationType', 'locationName' => 'authorizationType', ], 'AuthorizerId' => [ 'shape' => 'Id', 'locationName' => 'authorizerId', ], 'ModelSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'modelSelectionExpression', ], 'OperationName' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'operationName', ], 'RequestModels' => [ 'shape' => 'RouteModels', 'locationName' => 'requestModels', ], 'RequestParameters' => [ 'shape' => 'RouteParameters', 'locationName' => 'requestParameters', ], 'RouteId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'routeId', ], 'RouteKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeKey', ], 'RouteResponseSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeResponseSelectionExpression', ], 'Target' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'target', ], ], 'required' => [ 'ApiId', 'RouteId', ], ], 'UpdateRouteResult' => [ 'type' => 'structure', 'members' => [ 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'ApiKeyRequired' => [ 'shape' => '__boolean', 'locationName' => 'apiKeyRequired', ], 'AuthorizationScopes' => [ 'shape' => 'AuthorizationScopes', 'locationName' => 'authorizationScopes', ], 'AuthorizationType' => [ 'shape' => 'AuthorizationType', 'locationName' => 'authorizationType', ], 'AuthorizerId' => [ 'shape' => 'Id', 'locationName' => 'authorizerId', ], 'ModelSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'modelSelectionExpression', ], 'OperationName' => [ 'shape' => 'StringWithLengthBetween1And64', 'locationName' => 'operationName', ], 'RequestModels' => [ 'shape' => 'RouteModels', 'locationName' => 'requestModels', ], 'RequestParameters' => [ 'shape' => 'RouteParameters', 'locationName' => 'requestParameters', ], 'RouteId' => [ 'shape' => 'Id', 'locationName' => 'routeId', ], 'RouteKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeKey', ], 'RouteResponseSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'routeResponseSelectionExpression', ], 'Target' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'target', ], ], ], 'UpdateRouteResponseInput' => [ 'type' => 'structure', 'members' => [ 'ModelSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'modelSelectionExpression', ], 'ResponseModels' => [ 'shape' => 'RouteModels', 'locationName' => 'responseModels', ], 'ResponseParameters' => [ 'shape' => 'RouteParameters', 'locationName' => 'responseParameters', ], 'RouteResponseKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeResponseKey', ], ], ], 'UpdateRouteResponseRequest' => [ 'type' => 'structure', 'members' => [ 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'ModelSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'modelSelectionExpression', ], 'ResponseModels' => [ 'shape' => 'RouteModels', 'locationName' => 'responseModels', ], 'ResponseParameters' => [ 'shape' => 'RouteParameters', 'locationName' => 'responseParameters', ], 'RouteId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'routeId', ], 'RouteResponseId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'routeResponseId', ], 'RouteResponseKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeResponseKey', ], ], 'required' => [ 'RouteResponseId', 'ApiId', 'RouteId', ], ], 'UpdateRouteResponseResponse' => [ 'type' => 'structure', 'members' => [ 'ModelSelectionExpression' => [ 'shape' => 'SelectionExpression', 'locationName' => 'modelSelectionExpression', ], 'ResponseModels' => [ 'shape' => 'RouteModels', 'locationName' => 'responseModels', ], 'ResponseParameters' => [ 'shape' => 'RouteParameters', 'locationName' => 'responseParameters', ], 'RouteResponseId' => [ 'shape' => 'Id', 'locationName' => 'routeResponseId', ], 'RouteResponseKey' => [ 'shape' => 'SelectionKey', 'locationName' => 'routeResponseKey', ], ], ], 'UpdateStageInput' => [ 'type' => 'structure', 'members' => [ 'AccessLogSettings' => [ 'shape' => 'AccessLogSettings', 'locationName' => 'accessLogSettings', ], 'AutoDeploy' => [ 'shape' => '__boolean', 'locationName' => 'autoDeploy', ], 'ClientCertificateId' => [ 'shape' => 'Id', 'locationName' => 'clientCertificateId', ], 'DefaultRouteSettings' => [ 'shape' => 'RouteSettings', 'locationName' => 'defaultRouteSettings', ], 'DeploymentId' => [ 'shape' => 'Id', 'locationName' => 'deploymentId', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'RouteSettings' => [ 'shape' => 'RouteSettingsMap', 'locationName' => 'routeSettings', ], 'StageVariables' => [ 'shape' => 'StageVariablesMap', 'locationName' => 'stageVariables', ], ], ], 'UpdateStageRequest' => [ 'type' => 'structure', 'members' => [ 'AccessLogSettings' => [ 'shape' => 'AccessLogSettings', 'locationName' => 'accessLogSettings', ], 'ApiId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'apiId', ], 'AutoDeploy' => [ 'shape' => '__boolean', 'locationName' => 'autoDeploy', ], 'ClientCertificateId' => [ 'shape' => 'Id', 'locationName' => 'clientCertificateId', ], 'DefaultRouteSettings' => [ 'shape' => 'RouteSettings', 'locationName' => 'defaultRouteSettings', ], 'DeploymentId' => [ 'shape' => 'Id', 'locationName' => 'deploymentId', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'RouteSettings' => [ 'shape' => 'RouteSettingsMap', 'locationName' => 'routeSettings', ], 'StageName' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'stageName', ], 'StageVariables' => [ 'shape' => 'StageVariablesMap', 'locationName' => 'stageVariables', ], ], 'required' => [ 'StageName', 'ApiId', ], ], 'UpdateStageResponse' => [ 'type' => 'structure', 'members' => [ 'AccessLogSettings' => [ 'shape' => 'AccessLogSettings', 'locationName' => 'accessLogSettings', ], 'ApiGatewayManaged' => [ 'shape' => '__boolean', 'locationName' => 'apiGatewayManaged', ], 'AutoDeploy' => [ 'shape' => '__boolean', 'locationName' => 'autoDeploy', ], 'ClientCertificateId' => [ 'shape' => 'Id', 'locationName' => 'clientCertificateId', ], 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'DefaultRouteSettings' => [ 'shape' => 'RouteSettings', 'locationName' => 'defaultRouteSettings', ], 'DeploymentId' => [ 'shape' => 'Id', 'locationName' => 'deploymentId', ], 'Description' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'description', ], 'LastDeploymentStatusMessage' => [ 'shape' => '__string', 'locationName' => 'lastDeploymentStatusMessage', ], 'LastUpdatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'lastUpdatedDate', ], 'RouteSettings' => [ 'shape' => 'RouteSettingsMap', 'locationName' => 'routeSettings', ], 'StageName' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'stageName', ], 'StageVariables' => [ 'shape' => 'StageVariablesMap', 'locationName' => 'stageVariables', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], ], ], 'UpdateVpcLinkInput' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], ], ], 'UpdateVpcLinkRequest' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'VpcLinkId' => [ 'shape' => '__string', 'location' => 'uri', 'locationName' => 'vpcLinkId', ], ], 'required' => [ 'VpcLinkId', ], ], 'UpdateVpcLinkResponse' => [ 'type' => 'structure', 'members' => [ 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'SecurityGroupIds' => [ 'shape' => 'SecurityGroupIdList', 'locationName' => 'securityGroupIds', ], 'SubnetIds' => [ 'shape' => 'SubnetIdList', 'locationName' => 'subnetIds', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], 'VpcLinkId' => [ 'shape' => 'Id', 'locationName' => 'vpcLinkId', ], 'VpcLinkStatus' => [ 'shape' => 'VpcLinkStatus', 'locationName' => 'vpcLinkStatus', ], 'VpcLinkStatusMessage' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'vpcLinkStatusMessage', ], 'VpcLinkVersion' => [ 'shape' => 'VpcLinkVersion', 'locationName' => 'vpcLinkVersion', ], ], ], 'UriWithLengthBetween1And2048' => [ 'type' => 'string', ], 'VpcLink' => [ 'type' => 'structure', 'members' => [ 'CreatedDate' => [ 'shape' => '__timestampIso8601', 'locationName' => 'createdDate', ], 'Name' => [ 'shape' => 'StringWithLengthBetween1And128', 'locationName' => 'name', ], 'SecurityGroupIds' => [ 'shape' => 'SecurityGroupIdList', 'locationName' => 'securityGroupIds', ], 'SubnetIds' => [ 'shape' => 'SubnetIdList', 'locationName' => 'subnetIds', ], 'Tags' => [ 'shape' => 'Tags', 'locationName' => 'tags', ], 'VpcLinkId' => [ 'shape' => 'Id', 'locationName' => 'vpcLinkId', ], 'VpcLinkStatus' => [ 'shape' => 'VpcLinkStatus', 'locationName' => 'vpcLinkStatus', ], 'VpcLinkStatusMessage' => [ 'shape' => 'StringWithLengthBetween0And1024', 'locationName' => 'vpcLinkStatusMessage', ], 'VpcLinkVersion' => [ 'shape' => 'VpcLinkVersion', 'locationName' => 'vpcLinkVersion', ], ], 'required' => [ 'VpcLinkId', 'SecurityGroupIds', 'SubnetIds', 'Name', ], ], 'VpcLinkStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING', 'AVAILABLE', 'DELETING', 'FAILED', 'INACTIVE', ], ], 'VpcLinkVersion' => [ 'type' => 'string', 'enum' => [ 'V2', ], ], 'VpcLinks' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => '__listOfVpcLink', 'locationName' => 'items', ], 'NextToken' => [ 'shape' => 'NextToken', 'locationName' => 'nextToken', ], ], ], '__boolean' => [ 'type' => 'boolean', ], '__double' => [ 'type' => 'double', ], '__integer' => [ 'type' => 'integer', ], '__listOfApi' => [ 'type' => 'list', 'member' => [ 'shape' => 'Api', ], ], '__listOfApiMapping' => [ 'type' => 'list', 'member' => [ 'shape' => 'ApiMapping', ], ], '__listOfAuthorizer' => [ 'type' => 'list', 'member' => [ 'shape' => 'Authorizer', ], ], '__listOfDeployment' => [ 'type' => 'list', 'member' => [ 'shape' => 'Deployment', ], ], '__listOfDomainName' => [ 'type' => 'list', 'member' => [ 'shape' => 'DomainName', ], ], '__listOfIntegration' => [ 'type' => 'list', 'member' => [ 'shape' => 'Integration', ], ], '__listOfIntegrationResponse' => [ 'type' => 'list', 'member' => [ 'shape' => 'IntegrationResponse', ], ], '__listOfModel' => [ 'type' => 'list', 'member' => [ 'shape' => 'Model', ], ], '__listOfRoute' => [ 'type' => 'list', 'member' => [ 'shape' => 'Route', ], ], '__listOfRouteResponse' => [ 'type' => 'list', 'member' => [ 'shape' => 'RouteResponse', ], ], '__listOfStage' => [ 'type' => 'list', 'member' => [ 'shape' => 'Stage', ], ], '__listOfVpcLink' => [ 'type' => 'list', 'member' => [ 'shape' => 'VpcLink', ], ], '__listOf__string' => [ 'type' => 'list', 'member' => [ 'shape' => '__string', ], ], '__long' => [ 'type' => 'long', ], '__string' => [ 'type' => 'string', ], '__timestampIso8601' => [ 'type' => 'timestamp', 'timestampFormat' => 'iso8601', ], '__timestampUnix' => [ 'type' => 'timestamp', 'timestampFormat' => 'unixTimestamp', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigatewayv2/2018-11-29/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>Amazon API Gateway V2</p>', 'operations' => [ 'CreateApi' => '<p>Creates an Api resource.</p>', 'CreateApiMapping' => '<p>Creates an API mapping.</p>', 'CreateAuthorizer' => '<p>Creates an Authorizer for an API.</p>', 'CreateDeployment' => '<p>Creates a Deployment for an API.</p>', 'CreateDomainName' => '<p>Creates a domain name.</p>', 'CreateIntegration' => '<p>Creates an Integration.</p>', 'CreateIntegrationResponse' => '<p>Creates an IntegrationResponses.</p>', 'CreateModel' => '<p>Creates a Model for an API.</p>', 'CreateRoute' => '<p>Creates a Route for an API.</p>', 'CreateRouteResponse' => '<p>Creates a RouteResponse for a Route.</p>', 'CreateStage' => '<p>Creates a Stage for an API.</p>', 'CreateVpcLink' => '<p>Creates a VPC link.</p>', 'DeleteAccessLogSettings' => '<p>Deletes the AccessLogSettings for a Stage. To disable access logging for a Stage, delete its AccessLogSettings.</p>', 'DeleteApi' => '<p>Deletes an Api resource.</p>', 'DeleteApiMapping' => '<p>Deletes an API mapping.</p>', 'DeleteAuthorizer' => '<p>Deletes an Authorizer.</p>', 'DeleteCorsConfiguration' => '<p>Deletes a CORS configuration.</p>', 'DeleteDeployment' => '<p>Deletes a Deployment.</p>', 'DeleteDomainName' => '<p>Deletes a domain name.</p>', 'DeleteIntegration' => '<p>Deletes an Integration.</p>', 'DeleteIntegrationResponse' => '<p>Deletes an IntegrationResponses.</p>', 'DeleteModel' => '<p>Deletes a Model.</p>', 'DeleteRoute' => '<p>Deletes a Route.</p>', 'DeleteRouteRequestParameter' => '<p>Deletes a route request parameter.</p>', 'DeleteRouteResponse' => '<p>Deletes a RouteResponse.</p>', 'DeleteRouteSettings' => '<p>Deletes the RouteSettings for a stage.</p>', 'DeleteStage' => '<p>Deletes a Stage.</p>', 'DeleteVpcLink' => '<p>Deletes a VPC link.</p>', 'ExportApi' => '<p>Exports a definition of an API in a particular output format and specification.</p>', 'ResetAuthorizersCache' => '<p>Resets all authorizer cache entries for the specified stage. Supported only for HTTP API Lambda authorizers.</p>', 'GetApi' => '<p>Gets an Api resource.</p>', 'GetApiMapping' => '<p>Gets an API mapping.</p>', 'GetApiMappings' => '<p>Gets API mappings.</p>', 'GetApis' => '<p>Gets a collection of Api resources.</p>', 'GetAuthorizer' => '<p>Gets an Authorizer.</p>', 'GetAuthorizers' => '<p>Gets the Authorizers for an API.</p>', 'GetDeployment' => '<p>Gets a Deployment.</p>', 'GetDeployments' => '<p>Gets the Deployments for an API.</p>', 'GetDomainName' => '<p>Gets a domain name.</p>', 'GetDomainNames' => '<p>Gets the domain names for an AWS account.</p>', 'GetIntegration' => '<p>Gets an Integration.</p>', 'GetIntegrationResponse' => '<p>Gets an IntegrationResponses.</p>', 'GetIntegrationResponses' => '<p>Gets the IntegrationResponses for an Integration.</p>', 'GetIntegrations' => '<p>Gets the Integrations for an API.</p>', 'GetModel' => '<p>Gets a Model.</p>', 'GetModelTemplate' => '<p>Gets a model template.</p>', 'GetModels' => '<p>Gets the Models for an API.</p>', 'GetRoute' => '<p>Gets a Route.</p>', 'GetRouteResponse' => '<p>Gets a RouteResponse.</p>', 'GetRouteResponses' => '<p>Gets the RouteResponses for a Route.</p>', 'GetRoutes' => '<p>Gets the Routes for an API.</p>', 'GetStage' => '<p>Gets a Stage.</p>', 'GetStages' => '<p>Gets the Stages for an API.</p>', 'GetTags' => '<p>Gets a collection of Tag resources.</p>', 'GetVpcLink' => '<p>Gets a VPC link.</p>', 'GetVpcLinks' => '<p>Gets a collection of VPC links.</p>', 'ImportApi' => '<p>Imports an API.</p>', 'ReimportApi' => '<p>Puts an Api resource.</p>', 'TagResource' => '<p>Creates a new Tag resource to represent a tag.</p>', 'UntagResource' => '<p>Deletes a Tag.</p>', 'UpdateApi' => '<p>Updates an Api resource.</p>', 'UpdateApiMapping' => '<p>The API mapping.</p>', 'UpdateAuthorizer' => '<p>Updates an Authorizer.</p>', 'UpdateDeployment' => '<p>Updates a Deployment.</p>', 'UpdateDomainName' => '<p>Updates a domain name.</p>', 'UpdateIntegration' => '<p>Updates an Integration.</p>', 'UpdateIntegrationResponse' => '<p>Updates an IntegrationResponses.</p>', 'UpdateModel' => '<p>Updates a Model.</p>', 'UpdateRoute' => '<p>Updates a Route.</p>', 'UpdateRouteResponse' => '<p>Updates a RouteResponse.</p>', 'UpdateStage' => '<p>Updates a Stage.</p>', 'UpdateVpcLink' => '<p>Updates a VPC link.</p>', ], 'shapes' => [ 'AccessDeniedException' => [ 'base' => NULL, 'refs' => [], ], 'AccessLogSettings' => [ 'base' => '<p>Settings for logging access in a stage.</p>', 'refs' => [ 'CreateStageInput$AccessLogSettings' => '<p>Settings for logging access in this stage.</p>', 'Stage$AccessLogSettings' => '<p>Settings for logging access in this stage.</p>', 'UpdateStageInput$AccessLogSettings' => '<p>Settings for logging access in this stage.</p>', ], ], 'Api' => [ 'base' => '<p>Represents an API.</p>', 'refs' => [ '__listOfApi$member' => NULL, ], ], 'ApiMapping' => [ 'base' => '<p>Represents an API mapping.</p>', 'refs' => [ '__listOfApiMapping$member' => NULL, ], ], 'ApiMappings' => [ 'base' => '<p>Represents a collection of ApiMappings resources.</p>', 'refs' => [], ], 'Apis' => [ 'base' => '<p>Represents a collection of APIs.</p>', 'refs' => [], ], 'Arn' => [ 'base' => '<p>Represents an Amazon Resource Name (ARN).</p>', 'refs' => [ 'AccessLogSettings$DestinationArn' => '<p>The ARN of the CloudWatch Logs log group to receive access logs.</p>', 'Authorizer$AuthorizerCredentialsArn' => '<p>Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role\\'s Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, don\\'t specify this parameter. Supported only for REQUEST authorizers.</p>', 'CreateApiInput$CredentialsArn' => '<p>This property is part of quick create. It specifies the credentials required for the integration, if any. For a Lambda integration, three options are available. To specify an IAM Role for API Gateway to assume, use the role\\'s Amazon Resource Name (ARN). To require that the caller\\'s identity be passed through from the request, specify arn:aws:iam::*:user/*. To use resource-based permissions on supported AWS services, specify null. Currently, this property is not used for HTTP integrations. Supported only for HTTP APIs.</p>', 'CreateAuthorizerInput$AuthorizerCredentialsArn' => '<p>Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role\\'s Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, don\\'t specify this parameter. Supported only for REQUEST authorizers.</p>', 'CreateIntegrationInput$CredentialsArn' => '<p>Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role\\'s Amazon Resource Name (ARN). To require that the caller\\'s identity be passed through from the request, specify the string arn:aws:iam::*:user/*. To use resource-based permissions on supported AWS services, specify null.</p>', 'DomainNameConfiguration$CertificateArn' => '<p>An AWS-managed certificate that will be used by the edge-optimized endpoint for this domain name. AWS Certificate Manager is the only supported source.</p>', 'DomainNameConfiguration$OwnershipVerificationCertificateArn' => '<p>The ARN of the public certificate issued by ACM to validate ownership of your custom domain. Only required when configuring mutual TLS and using an ACM imported or private CA certificate ARN as the regionalCertificateArn</p>', 'Integration$CredentialsArn' => '<p>Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role\\'s Amazon Resource Name (ARN). To require that the caller\\'s identity be passed through from the request, specify the string arn:aws:iam::*:user/*. To use resource-based permissions on supported AWS services, specify null.</p>', 'UpdateApiInput$CredentialsArn' => '<p>This property is part of quick create. It specifies the credentials required for the integration, if any. For a Lambda integration, three options are available. To specify an IAM Role for API Gateway to assume, use the role\\'s Amazon Resource Name (ARN). To require that the caller\\'s identity be passed through from the request, specify arn:aws:iam::*:user/*. To use resource-based permissions on supported AWS services, specify null. Currently, this property is not used for HTTP integrations. If provided, this value replaces the credentials associated with the quick create integration. Supported only for HTTP APIs.</p>', 'UpdateAuthorizerInput$AuthorizerCredentialsArn' => '<p>Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role\\'s Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.</p>', 'UpdateIntegrationInput$CredentialsArn' => '<p>Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role\\'s Amazon Resource Name (ARN). To require that the caller\\'s identity be passed through from the request, specify the string arn:aws:iam::*:user/*. To use resource-based permissions on supported AWS services, specify null.</p>', ], ], 'AuthorizationScopes' => [ 'base' => '<p>A list of authorization scopes configured on a route. The scopes are used with a JWT authorizer to authorize the method invocation. The authorization works by matching the route scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any route scope matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the route scope is configured, the client must provide an access token instead of an identity token for authorization purposes.</p>', 'refs' => [ 'CreateRouteInput$AuthorizationScopes' => '<p>The authorization scopes supported by this route.</p>', 'Route$AuthorizationScopes' => '<p>A list of authorization scopes configured on a route. The scopes are used with a JWT authorizer to authorize the method invocation. The authorization works by matching the route scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any route scope matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the route scope is configured, the client must provide an access token instead of an identity token for authorization purposes.</p>', 'UpdateRouteInput$AuthorizationScopes' => '<p>The authorization scopes supported by this route.</p>', ], ], 'AuthorizationType' => [ 'base' => '<p>The authorization type. For WebSocket APIs, valid values are NONE for open access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer. For HTTP APIs, valid values are NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer.</p>', 'refs' => [ 'CreateRouteInput$AuthorizationType' => '<p>The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer.</p>', 'Route$AuthorizationType' => '<p>The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer.</p>', 'UpdateRouteInput$AuthorizationType' => '<p>The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer.</p>', ], ], 'Authorizer' => [ 'base' => '<p>Represents an authorizer.</p>', 'refs' => [ '__listOfAuthorizer$member' => NULL, ], ], 'AuthorizerType' => [ 'base' => '<p>The authorizer type. Specify REQUEST for a Lambda function using incoming request parameters. Specify JWT to use JSON Web Tokens (supported only for HTTP APIs).</p>', 'refs' => [ 'Authorizer$AuthorizerType' => '<p>The authorizer type. Specify REQUEST for a Lambda function using incoming request parameters. Specify JWT to use JSON Web Tokens (supported only for HTTP APIs).</p>', 'CreateAuthorizerInput$AuthorizerType' => '<p>The authorizer type. Specify REQUEST for a Lambda function using incoming request parameters. Specify JWT to use JSON Web Tokens (supported only for HTTP APIs).</p>', 'UpdateAuthorizerInput$AuthorizerType' => '<p>The authorizer type. Specify REQUEST for a Lambda function using incoming request parameters. Specify JWT to use JSON Web Tokens (supported only for HTTP APIs).</p>', ], ], 'Authorizers' => [ 'base' => '<p>Represents a collection of authorizers.</p>', 'refs' => [], ], 'BadRequestException' => [ 'base' => '<p>The request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.</p>', 'refs' => [], ], 'ConflictException' => [ 'base' => '<p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. See the accompanying error message for details.</p>', 'refs' => [], ], 'ConnectionType' => [ 'base' => '<p>Represents a connection type.</p>', 'refs' => [ 'CreateIntegrationInput$ConnectionType' => '<p>The type of the network connection to the integration endpoint. Specify INTERNET for connections through the public routable internet or VPC_LINK for private connections between API Gateway and resources in a VPC. The default value is INTERNET.</p>', 'Integration$ConnectionType' => '<p>The type of the network connection to the integration endpoint. Specify INTERNET for connections through the public routable internet or VPC_LINK for private connections between API Gateway and resources in a VPC. The default value is INTERNET.</p>', 'UpdateIntegrationInput$ConnectionType' => '<p>The type of the network connection to the integration endpoint. Specify INTERNET for connections through the public routable internet or VPC_LINK for private connections between API Gateway and resources in a VPC. The default value is INTERNET.</p>', ], ], 'ContentHandlingStrategy' => [ 'base' => '<p>Specifies how to handle response payload content type conversions. Supported only for WebSocket APIs.</p>', 'refs' => [ 'CreateIntegrationInput$ContentHandlingStrategy' => '<p>Supported only for WebSocket APIs. Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following behaviors:</p> <p>CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary blob.</p> <p>CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string.</p> <p>If this property is not defined, the response payload will be passed through from the integration response to the route response or method response without modification.</p>', 'CreateIntegrationResponseInput$ContentHandlingStrategy' => '<p>Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following behaviors:</p> <p>CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary blob.</p> <p>CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string.</p> <p>If this property is not defined, the response payload will be passed through from the integration response to the route response or method response without modification.</p>', 'Integration$ContentHandlingStrategy' => '<p>Supported only for WebSocket APIs. Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following behaviors:</p> <p>CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary blob.</p> <p>CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string.</p> <p>If this property is not defined, the response payload will be passed through from the integration response to the route response or method response without modification.</p>', 'IntegrationResponse$ContentHandlingStrategy' => '<p>Supported only for WebSocket APIs. Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following behaviors:</p> <p>CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary blob.</p> <p>CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string.</p> <p>If this property is not defined, the response payload will be passed through from the integration response to the route response or method response without modification.</p>', 'UpdateIntegrationInput$ContentHandlingStrategy' => '<p>Supported only for WebSocket APIs. Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following behaviors:</p> <p>CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary blob.</p> <p>CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string.</p> <p>If this property is not defined, the response payload will be passed through from the integration response to the route response or method response without modification.</p>', 'UpdateIntegrationResponseInput$ContentHandlingStrategy' => '<p>Supported only for WebSocket APIs. Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following behaviors:</p> <p>CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary blob.</p> <p>CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string.</p> <p>If this property is not defined, the response payload will be passed through from the integration response to the route response or method response without modification.</p>', ], ], 'Cors' => [ 'base' => '<p>Represents a CORS configuration. Supported only for HTTP APIs. See <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html\">Configuring CORS</a> for more information.</p>', 'refs' => [ 'Api$CorsConfiguration' => '<p>A CORS configuration. Supported only for HTTP APIs.</p>', 'CreateApiInput$CorsConfiguration' => '<p>A CORS configuration. Supported only for HTTP APIs. See <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html\">Configuring CORS</a> for more information.</p>', 'UpdateApiInput$CorsConfiguration' => '<p>A CORS configuration. Supported only for HTTP APIs.</p>', ], ], 'CorsHeaderList' => [ 'base' => '<p>Represents a collection of allowed headers. Supported only for HTTP APIs.</p>', 'refs' => [ 'Cors$AllowHeaders' => '<p>Represents a collection of allowed headers. Supported only for HTTP APIs.</p>', 'Cors$ExposeHeaders' => '<p>Represents a collection of exposed headers. Supported only for HTTP APIs.</p>', ], ], 'CorsMethodList' => [ 'base' => '<p>Represents a collection of methods. Supported only for HTTP APIs.</p>', 'refs' => [ 'Cors$AllowMethods' => '<p>Represents a collection of allowed HTTP methods. Supported only for HTTP APIs.</p>', ], ], 'CorsOriginList' => [ 'base' => '<p>Represents a collection of origins. Supported only for HTTP APIs.</p>', 'refs' => [ 'Cors$AllowOrigins' => '<p>Represents a collection of allowed origins. Supported only for HTTP APIs.</p>', ], ], 'CreateApiInput' => [ 'base' => '<p>Represents the input parameters for a CreateApi request.</p>', 'refs' => [], ], 'CreateApiMappingInput' => [ 'base' => '<p>Represents the input parameters for a CreateApiMapping request.</p>', 'refs' => [], ], 'CreateAuthorizerInput' => [ 'base' => '<p>Represents the input parameters for a CreateAuthorizer request.</p>', 'refs' => [], ], 'CreateDeploymentInput' => [ 'base' => '<p>Represents the input parameters for a CreateDeployment request.</p>', 'refs' => [], ], 'CreateDomainNameInput' => [ 'base' => '<p>Represents the input parameters for a CreateDomainName request.</p>', 'refs' => [], ], 'CreateIntegrationInput' => [ 'base' => '<p>Represents the input parameters for a CreateIntegration request.</p>', 'refs' => [], ], 'CreateIntegrationResponseInput' => [ 'base' => '<p>Represents the input parameters for a CreateIntegrationResponse request.</p>', 'refs' => [], ], 'CreateModelInput' => [ 'base' => '<p>Represents the input parameters for a CreateModel request.</p>', 'refs' => [], ], 'CreateRouteInput' => [ 'base' => '<p>Represents the input parameters for a CreateRoute request.</p>', 'refs' => [], ], 'CreateRouteResponseInput' => [ 'base' => '<p>Represents the input parameters for an CreateRouteResponse request.</p>', 'refs' => [], ], 'CreateStageInput' => [ 'base' => '<p>Represents the input parameters for a CreateStage request.</p>', 'refs' => [], ], 'CreateVpcLinkInput' => [ 'base' => '<p>Represents the input parameters for a CreateVpcLink request.</p>', 'refs' => [], ], 'Deployment' => [ 'base' => '<p>An immutable representation of an API that can be called by users. A Deployment must be associated with a Stage for it to be callable over the internet.</p>', 'refs' => [ '__listOfDeployment$member' => NULL, ], ], 'DeploymentStatus' => [ 'base' => '<p>Represents a deployment status.</p>', 'refs' => [ 'Deployment$DeploymentStatus' => '<p>The status of the deployment: PENDING, FAILED, or SUCCEEDED.</p>', ], ], 'Deployments' => [ 'base' => '<p>A collection resource that contains zero or more references to your existing deployments, and links that guide you on how to interact with your collection. The collection offers a paginated view of the contained deployments.</p>', 'refs' => [], ], 'DomainName' => [ 'base' => '<p>Represents a domain name.</p>', 'refs' => [ '__listOfDomainName$member' => NULL, ], ], 'DomainNameConfiguration' => [ 'base' => '<p>The domain name configuration.</p>', 'refs' => [ 'DomainNameConfigurations$member' => NULL, ], ], 'DomainNameConfigurations' => [ 'base' => '<p>The domain name configurations.</p>', 'refs' => [ 'CreateDomainNameInput$DomainNameConfigurations' => '<p>The domain name configurations.</p>', 'DomainName$DomainNameConfigurations' => '<p>The domain name configurations.</p>', 'UpdateDomainNameInput$DomainNameConfigurations' => '<p>The domain name configurations.</p>', ], ], 'DomainNameStatus' => [ 'base' => '<p>The status of the domain name migration. The valid values are AVAILABLE, UPDATING, PENDING_CERTIFICATE_REIMPORT, and PENDING_OWNERSHIP_VERIFICATION. If the status is UPDATING, the domain cannot be modified further until the existing operation is complete. If it is AVAILABLE, the domain can be updated.</p>', 'refs' => [ 'DomainNameConfiguration$DomainNameStatus' => '<p>The status of the domain name migration. The valid values are AVAILABLE, UPDATING, PENDING_CERTIFICATE_REIMPORT, and PENDING_OWNERSHIP_VERIFICATION. If the status is UPDATING, the domain cannot be modified further until the existing operation is complete. If it is AVAILABLE, the domain can be updated.</p>', ], ], 'DomainNames' => [ 'base' => '<p>Represents a collection of domain names.</p>', 'refs' => [], ], 'EndpointType' => [ 'base' => '<p>Represents an endpoint type.</p>', 'refs' => [ 'DomainNameConfiguration$EndpointType' => '<p>The endpoint type.</p>', ], ], 'ExportedApi' => [ 'base' => '<p>Represents an exported definition of an API in a particular output format, for example, YAML. The API is serialized to the requested specification, for example, OpenAPI 3.0.</p>', 'refs' => [], ], 'Id' => [ 'base' => '<p>The identifier.</p>', 'refs' => [ 'Api$ApiId' => '<p>The API ID.</p>', 'ApiMapping$ApiId' => '<p>The API identifier.</p>', 'ApiMapping$ApiMappingId' => '<p>The API mapping identifier.</p>', 'Authorizer$AuthorizerId' => '<p>The authorizer identifier.</p>', 'CreateApiMappingInput$ApiId' => '<p>The API identifier.</p>', 'CreateRouteInput$AuthorizerId' => '<p>The identifier of the Authorizer resource to be associated with this route. The authorizer identifier is generated by API Gateway when you created the authorizer.</p>', 'CreateStageInput$ClientCertificateId' => '<p>The identifier of a client certificate for a Stage. Supported only for WebSocket APIs.</p>', 'CreateStageInput$DeploymentId' => '<p>The deployment identifier of the API stage.</p>', 'Deployment$DeploymentId' => '<p>The identifier for the deployment.</p>', 'Integration$IntegrationId' => '<p>Represents the identifier of an integration.</p>', 'IntegrationResponse$IntegrationResponseId' => '<p>The integration response ID.</p>', 'Model$ModelId' => '<p>The model identifier.</p>', 'Route$AuthorizerId' => '<p>The identifier of the Authorizer resource to be associated with this route. The authorizer identifier is generated by API Gateway when you created the authorizer.</p>', 'Route$RouteId' => '<p>The route ID.</p>', 'RouteResponse$RouteResponseId' => '<p>Represents the identifier of a route response.</p>', 'Stage$ClientCertificateId' => '<p>The identifier of a client certificate for a Stage. Supported only for WebSocket APIs.</p>', 'Stage$DeploymentId' => '<p>The identifier of the Deployment that the Stage is associated with. Can\\'t be updated if autoDeploy is enabled.</p>', 'UpdateApiMappingInput$ApiId' => '<p>The API identifier.</p>', 'UpdateRouteInput$AuthorizerId' => '<p>The identifier of the Authorizer resource to be associated with this route. The authorizer identifier is generated by API Gateway when you created the authorizer.</p>', 'UpdateStageInput$ClientCertificateId' => '<p>The identifier of a client certificate for a Stage.</p>', 'UpdateStageInput$DeploymentId' => '<p>The deployment identifier for the API stage. Can\\'t be updated if autoDeploy is enabled.</p>', 'VpcLink$VpcLinkId' => '<p>The ID of the VPC link.</p>', ], ], 'IdentitySourceList' => [ 'base' => '<p>The identity source for which authorization is requested. For the REQUEST authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if an Auth header, a Name query string parameter are defined as identity sources, this value is $method.request.header.Auth, $method.request.querystring.Name. These parameters will be used to derive the authorization caching key and to perform runtime validation of the REQUEST authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional.</p>', 'refs' => [ 'Authorizer$IdentitySource' => '<p>The identity source for which authorization is requested.</p> <p>For a REQUEST authorizer, this is optional. The value is a set of one or more mapping expressions of the specified request parameters. The identity source can be headers, query string parameters, stage variables, and context parameters. For example, if an Auth header and a Name query string parameter are defined as identity sources, this value is route.request.header.Auth, route.request.querystring.Name for WebSocket APIs. For HTTP APIs, use selection expressions prefixed with $, for example, $request.header.Auth, $request.querystring.Name. These parameters are used to perform runtime validation for Lambda-based authorizers by verifying all of the identity-related request parameters are present in the request, not null, and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function. Otherwise, it returns a 401 Unauthorized response without calling the Lambda function. For HTTP APIs, identity sources are also used as the cache key when caching is enabled. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html\">Working with AWS Lambda authorizers for HTTP APIs</a>.</p> <p>For JWT, a single entry that specifies where to extract the JSON Web Token (JWT) from inbound requests. Currently only header-based and query parameter-based selections are supported, for example $request.header.Authorization.</p>', 'CreateAuthorizerInput$IdentitySource' => '<p>The identity source for which authorization is requested.</p> <p>For a REQUEST authorizer, this is optional. The value is a set of one or more mapping expressions of the specified request parameters. The identity source can be headers, query string parameters, stage variables, and context parameters. For example, if an Auth header and a Name query string parameter are defined as identity sources, this value is route.request.header.Auth, route.request.querystring.Name for WebSocket APIs. For HTTP APIs, use selection expressions prefixed with $, for example, $request.header.Auth, $request.querystring.Name. These parameters are used to perform runtime validation for Lambda-based authorizers by verifying all of the identity-related request parameters are present in the request, not null, and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function. Otherwise, it returns a 401 Unauthorized response without calling the Lambda function. For HTTP APIs, identity sources are also used as the cache key when caching is enabled. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html\">Working with AWS Lambda authorizers for HTTP APIs</a>.</p> <p>For JWT, a single entry that specifies where to extract the JSON Web Token (JWT) from inbound requests. Currently only header-based and query parameter-based selections are supported, for example $request.header.Authorization.</p>', 'UpdateAuthorizerInput$IdentitySource' => '<p>The identity source for which authorization is requested.</p> <p>For a REQUEST authorizer, this is optional. The value is a set of one or more mapping expressions of the specified request parameters. The identity source can be headers, query string parameters, stage variables, and context parameters. For example, if an Auth header and a Name query string parameter are defined as identity sources, this value is route.request.header.Auth, route.request.querystring.Name for WebSocket APIs. For HTTP APIs, use selection expressions prefixed with $, for example, $request.header.Auth, $request.querystring.Name. These parameters are used to perform runtime validation for Lambda-based authorizers by verifying all of the identity-related request parameters are present in the request, not null, and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function. Otherwise, it returns a 401 Unauthorized response without calling the Lambda function. For HTTP APIs, identity sources are also used as the cache key when caching is enabled. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html\">Working with AWS Lambda authorizers for HTTP APIs</a>.</p> <p>For JWT, a single entry that specifies where to extract the JSON Web Token (JWT) from inbound requests. Currently only header-based and query parameter-based selections are supported, for example $request.header.Authorization.</p>', ], ], 'ImportApiInput' => [ 'base' => '<p>Represents the input to ImportAPI. Supported only for HTTP APIs.</p>', 'refs' => [], ], 'IntegerWithLengthBetween0And3600' => [ 'base' => '<p>An integer with a value between [0-3600].</p>', 'refs' => [ 'Authorizer$AuthorizerResultTtlInSeconds' => '<p>The time to live (TTL) for cached authorizer results, in seconds. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway caches authorizer responses. The maximum value is 3600, or 1 hour. Supported only for HTTP API Lambda authorizers.</p>', 'CreateAuthorizerInput$AuthorizerResultTtlInSeconds' => '<p>The time to live (TTL) for cached authorizer results, in seconds. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway caches authorizer responses. The maximum value is 3600, or 1 hour. Supported only for HTTP API Lambda authorizers.</p>', 'UpdateAuthorizerInput$AuthorizerResultTtlInSeconds' => '<p>The time to live (TTL) for cached authorizer results, in seconds. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway caches authorizer responses. The maximum value is 3600, or 1 hour. Supported only for HTTP API Lambda authorizers.</p>', ], ], 'IntegerWithLengthBetween50And30000' => [ 'base' => '<p>An integer with a value between [50-30000].</p>', 'refs' => [ 'CreateIntegrationInput$TimeoutInMillis' => '<p>Custom timeout between 50 and 29,000 milliseconds for WebSocket APIs and between 50 and 30,000 milliseconds for HTTP APIs. The default timeout is 29 seconds for WebSocket APIs and 30 seconds for HTTP APIs.</p>', 'Integration$TimeoutInMillis' => '<p>Custom timeout between 50 and 29,000 milliseconds for WebSocket APIs and between 50 and 30,000 milliseconds for HTTP APIs. The default timeout is 29 seconds for WebSocket APIs and 30 seconds for HTTP APIs.</p>', 'UpdateIntegrationInput$TimeoutInMillis' => '<p>Custom timeout between 50 and 29,000 milliseconds for WebSocket APIs and between 50 and 30,000 milliseconds for HTTP APIs. The default timeout is 29 seconds for WebSocket APIs and 30 seconds for HTTP APIs.</p>', ], ], 'IntegerWithLengthBetweenMinus1And86400' => [ 'base' => '<p>An integer with a value between -1 and 86400. Supported only for HTTP APIs.</p>', 'refs' => [ 'Cors$MaxAge' => '<p>The number of seconds that the browser should cache preflight request results. Supported only for HTTP APIs.</p>', ], ], 'Integration' => [ 'base' => '<p>Represents an integration.</p>', 'refs' => [ '__listOfIntegration$member' => NULL, ], ], 'IntegrationParameters' => [ 'base' => '<p>For WebSocket APIs, a key-value map specifying request parameters that are passed from the method request to the backend. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the backend. The method request parameter value must match the pattern of method.request.<replaceable>{location}</replaceable>.<replaceable>{name}</replaceable> , where <replaceable>{location}</replaceable> is querystring, path, or header; and <replaceable>{name}</replaceable> must be a valid and unique method request parameter name.</p> <p>For HTTP API integrations with a specified integrationSubtype, request parameters are a key-value map specifying parameters that are passed to AWS_PROXY integrations. You can provide static values, or map request data, stage variables, or context variables that are evaluated at runtime. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services.html\">Working with AWS service integrations for HTTP APIs</a>.</p> <p>For HTTP API integrations without a specified integrationSubtype request parameters are a key-value map specifying how to transform HTTP requests before sending them to the backend. The key should follow the pattern &lt;action&gt;:&lt;header|querystring|path&gt;.&lt;location&gt; where action can be append, overwrite or remove. For values, you can provide static values, or map request data, stage variables, or context variables that are evaluated at runtime. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html\">Transforming API requests and responses</a>.</p>', 'refs' => [ 'CreateIntegrationInput$RequestParameters' => '<p>For WebSocket APIs, a key-value map specifying request parameters that are passed from the method request to the backend. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the backend. The method request parameter value must match the pattern of method.request.<replaceable>{location}</replaceable>.<replaceable>{name}</replaceable> , where <replaceable>{location}</replaceable> is querystring, path, or header; and <replaceable>{name}</replaceable> must be a valid and unique method request parameter name.</p> <p>For HTTP API integrations with a specified integrationSubtype, request parameters are a key-value map specifying parameters that are passed to AWS_PROXY integrations. You can provide static values, or map request data, stage variables, or context variables that are evaluated at runtime. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services.html\">Working with AWS service integrations for HTTP APIs</a>.</p> <p>For HTTP API integrations without a specified integrationSubtype request parameters are a key-value map specifying how to transform HTTP requests before sending them to the backend. The key should follow the pattern &lt;action&gt;:&lt;header|querystring|path&gt;.&lt;location&gt; where action can be append, overwrite or remove. For values, you can provide static values, or map request data, stage variables, or context variables that are evaluated at runtime. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html\">Transforming API requests and responses</a>.</p>', 'CreateIntegrationResponseInput$ResponseParameters' => '<p>A key-value map specifying response parameters that are passed to the method response from the backend. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}, where {name} is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name} or integration.response.body.{JSON-expression}, where {name} is a valid and unique response header name and {JSON-expression} is a valid JSON expression without the $ prefix.</p>', 'Integration$RequestParameters' => '<p>For WebSocket APIs, a key-value map specifying request parameters that are passed from the method request to the backend. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the backend. The method request parameter value must match the pattern of method.request.<replaceable>{location}</replaceable>.<replaceable>{name}</replaceable> , where <replaceable>{location}</replaceable> is querystring, path, or header; and <replaceable>{name}</replaceable> must be a valid and unique method request parameter name.</p> <p>For HTTP API integrations with a specified integrationSubtype, request parameters are a key-value map specifying parameters that are passed to AWS_PROXY integrations. You can provide static values, or map request data, stage variables, or context variables that are evaluated at runtime. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services.html\">Working with AWS service integrations for HTTP APIs</a>.</p> <p>For HTTP API itegrations, without a specified integrationSubtype request parameters are a key-value map specifying how to transform HTTP requests before sending them to backend integrations. The key should follow the pattern &lt;action&gt;:&lt;header|querystring|path&gt;.&lt;location&gt;. The action can be append, overwrite or remove. For values, you can provide static values, or map request data, stage variables, or context variables that are evaluated at runtime. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html\">Transforming API requests and responses</a>.</p>', 'IntegrationResponse$ResponseParameters' => '<p>A key-value map specifying response parameters that are passed to the method response from the backend. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}, where name is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name} or integration.response.body.{JSON-expression}, where name is a valid and unique response header name and JSON-expression is a valid JSON expression without the $ prefix.</p>', 'ResponseParameters$member' => NULL, 'UpdateIntegrationInput$RequestParameters' => '<p>For WebSocket APIs, a key-value map specifying request parameters that are passed from the method request to the backend. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the backend. The method request parameter value must match the pattern of method.request.<replaceable>{location}</replaceable>.<replaceable>{name}</replaceable> , where <replaceable>{location}</replaceable> is querystring, path, or header; and <replaceable>{name}</replaceable> must be a valid and unique method request parameter name.</p> <p>For HTTP API integrations with a specified integrationSubtype, request parameters are a key-value map specifying parameters that are passed to AWS_PROXY integrations. You can provide static values, or map request data, stage variables, or context variables that are evaluated at runtime. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services.html\">Working with AWS service integrations for HTTP APIs</a>.</p> <p>For HTTP API integrations, without a specified integrationSubtype request parameters are a key-value map specifying how to transform HTTP requests before sending them to the backend. The key should follow the pattern &lt;action&gt;:&lt;header|querystring|path&gt;.&lt;location&gt; where action can be append, overwrite or remove. For values, you can provide static values, or map request data, stage variables, or context variables that are evaluated at runtime. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.\">Transforming API requests and responses</a>.</p>', 'UpdateIntegrationResponseInput$ResponseParameters' => '<p>A key-value map specifying response parameters that are passed to the method response from the backend. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.<replaceable>{name}</replaceable> , where name is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.<replaceable>{name}</replaceable> or integration.response.body.<replaceable>{JSON-expression}</replaceable> , where <replaceable>{name}</replaceable> is a valid and unique response header name and <replaceable>{JSON-expression}</replaceable> is a valid JSON expression without the $ prefix.</p>', ], ], 'IntegrationResponse' => [ 'base' => '<p>Represents an integration response.</p>', 'refs' => [ '__listOfIntegrationResponse$member' => NULL, ], ], 'IntegrationResponses' => [ 'base' => '<p>Represents a collection of integration responses.</p>', 'refs' => [], ], 'IntegrationType' => [ 'base' => '<p>Represents an API method integration type.</p>', 'refs' => [ 'CreateIntegrationInput$IntegrationType' => '<p>The integration type of an integration. One of the following:</p> <p>AWS: for integrating the route or method request with an AWS service action, including the Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom integration. With any other AWS service action, this is known as AWS integration. Supported only for WebSocket APIs.</p> <p>AWS_PROXY: for integrating the route or method request with a Lambda function or other AWS service action. This integration is also referred to as a Lambda proxy integration.</p> <p>HTTP: for integrating the route or method request with an HTTP endpoint. This integration is also referred to as the HTTP custom integration. Supported only for WebSocket APIs.</p> <p>HTTP_PROXY: for integrating the route or method request with an HTTP endpoint, with the client request passed through as-is. This is also referred to as HTTP proxy integration. For HTTP API private integrations, use an HTTP_PROXY integration.</p> <p>MOCK: for integrating the route or method request with API Gateway as a \"loopback\" endpoint without invoking any backend. Supported only for WebSocket APIs.</p>', 'Integration$IntegrationType' => '<p>The integration type of an integration. One of the following:</p> <p>AWS: for integrating the route or method request with an AWS service action, including the Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom integration. With any other AWS service action, this is known as AWS integration. Supported only for WebSocket APIs.</p> <p>AWS_PROXY: for integrating the route or method request with a Lambda function or other AWS service action. This integration is also referred to as a Lambda proxy integration.</p> <p>HTTP: for integrating the route or method request with an HTTP endpoint. This integration is also referred to as the HTTP custom integration. Supported only for WebSocket APIs.</p> <p>HTTP_PROXY: for integrating the route or method request with an HTTP endpoint, with the client request passed through as-is. This is also referred to as HTTP proxy integration.</p> <p>MOCK: for integrating the route or method request with API Gateway as a \"loopback\" endpoint without invoking any backend. Supported only for WebSocket APIs.</p>', 'UpdateIntegrationInput$IntegrationType' => '<p>The integration type of an integration. One of the following:</p> <p>AWS: for integrating the route or method request with an AWS service action, including the Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom integration. With any other AWS service action, this is known as AWS integration. Supported only for WebSocket APIs.</p> <p>AWS_PROXY: for integrating the route or method request with a Lambda function or other AWS service action. This integration is also referred to as a Lambda proxy integration.</p> <p>HTTP: for integrating the route or method request with an HTTP endpoint. This integration is also referred to as the HTTP custom integration. Supported only for WebSocket APIs.</p> <p>HTTP_PROXY: for integrating the route or method request with an HTTP endpoint, with the client request passed through as-is. This is also referred to as HTTP proxy integration. For HTTP API private integrations, use an HTTP_PROXY integration.</p> <p>MOCK: for integrating the route or method request with API Gateway as a \"loopback\" endpoint without invoking any backend. Supported only for WebSocket APIs.</p>', ], ], 'Integrations' => [ 'base' => '<p>Represents a collection of integrations.</p>', 'refs' => [], ], 'JWTConfiguration' => [ 'base' => '<p>Represents the configuration of a JWT authorizer. Required for the JWT authorizer type. Supported only for HTTP APIs.</p>', 'refs' => [ 'Authorizer$JwtConfiguration' => '<p>Represents the configuration of a JWT authorizer. Required for the JWT authorizer type. Supported only for HTTP APIs.</p>', 'CreateAuthorizerInput$JwtConfiguration' => '<p>Represents the configuration of a JWT authorizer. Required for the JWT authorizer type. Supported only for HTTP APIs.</p>', 'UpdateAuthorizerInput$JwtConfiguration' => '<p>Represents the configuration of a JWT authorizer. Required for the JWT authorizer type. Supported only for HTTP APIs.</p>', ], ], 'LimitExceededException' => [ 'base' => '<p>A limit has been exceeded. See the accompanying error message for details.</p>', 'refs' => [], ], 'LoggingLevel' => [ 'base' => '<p>The logging level.</p>', 'refs' => [ 'RouteSettings$LoggingLevel' => '<p>Specifies the logging level for this route: INFO, ERROR, or OFF. This property affects the log entries pushed to Amazon CloudWatch Logs. Supported only for WebSocket APIs.</p>', ], ], 'Model' => [ 'base' => '<p>Represents a data model for an API. Supported only for WebSocket APIs. See <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/models-mappings.html\">Create Models and Mapping Templates for Request and Response Mappings</a>.</p>', 'refs' => [ '__listOfModel$member' => NULL, ], ], 'Models' => [ 'base' => '<p>Represents a collection of data models. See <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/models-mappings.html\">Create Models and Mapping Templates for Request and Response Mappings</a>.</p>', 'refs' => [], ], 'MutualTlsAuthentication' => [ 'base' => '<p>If specified, API Gateway performs two-way authentication between the client and the server. Clients must present a trusted certificate to access your API.</p>', 'refs' => [ 'DomainName$MutualTlsAuthentication' => '<p>The mutual TLS authentication configuration for a custom domain name.</p>', ], ], 'MutualTlsAuthenticationInput' => [ 'base' => '<p>If specified, API Gateway performs two-way authentication between the client and the server. Clients must present a trusted certificate to access your API.</p>', 'refs' => [ 'CreateDomainNameInput$MutualTlsAuthentication' => '<p>The mutual TLS authentication configuration for a custom domain name.</p>', 'UpdateDomainNameInput$MutualTlsAuthentication' => '<p>The mutual TLS authentication configuration for a custom domain name.</p>', ], ], 'NextToken' => [ 'base' => '<p>The next page of elements from this collection. Not valid for the last element of the collection.</p>', 'refs' => [ 'ApiMappings$NextToken' => '<p>The next page of elements from this collection. Not valid for the last element of the collection.</p>', 'Apis$NextToken' => '<p>The next page of elements from this collection. Not valid for the last element of the collection.</p>', 'Authorizers$NextToken' => '<p>The next page of elements from this collection. Not valid for the last element of the collection.</p>', 'Deployments$NextToken' => '<p>The next page of elements from this collection. Not valid for the last element of the collection.</p>', 'DomainNames$NextToken' => '<p>The next page of elements from this collection. Not valid for the last element of the collection.</p>', 'IntegrationResponses$NextToken' => '<p>The next page of elements from this collection. Not valid for the last element of the collection.</p>', 'Integrations$NextToken' => '<p>The next page of elements from this collection. Not valid for the last element of the collection.</p>', 'Models$NextToken' => '<p>The next page of elements from this collection. Not valid for the last element of the collection.</p>', 'RouteResponses$NextToken' => '<p>The next page of elements from this collection. Not valid for the last element of the collection.</p>', 'Routes$NextToken' => '<p>The next page of elements from this collection. Not valid for the last element of the collection.</p>', 'Stages$NextToken' => '<p>The next page of elements from this collection. Not valid for the last element of the collection.</p>', 'VpcLinks$NextToken' => '<p>The next page of elements from this collection. Not valid for the last element of the collection.</p>', ], ], 'NotFoundException' => [ 'base' => '<p>The resource specified in the request was not found. See the message field for more information.</p>', 'refs' => [], ], 'ParameterConstraints' => [ 'base' => '<p>Validation constraints imposed on parameters of a request (path, query string, headers).</p>', 'refs' => [ 'RouteParameters$member' => NULL, ], ], 'PassthroughBehavior' => [ 'base' => '<p>Represents passthrough behavior for an integration response. Supported only for WebSocket APIs.</p>', 'refs' => [ 'CreateIntegrationInput$PassthroughBehavior' => '<p>Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the requestTemplates property on the Integration resource. There are three valid values: WHEN_NO_MATCH, WHEN_NO_TEMPLATES, and NEVER. Supported only for WebSocket APIs.</p> <p>WHEN_NO_MATCH passes the request body for unmapped content types through to the integration backend without transformation.</p> <p>NEVER rejects unmapped content types with an HTTP 415 Unsupported Media Type response.</p> <p>WHEN_NO_TEMPLATES allows pass-through when the integration has no content types mapped to templates. However, if there is at least one content type defined, unmapped content types will be rejected with the same HTTP 415 Unsupported Media Type response.</p>', 'Integration$PassthroughBehavior' => '<p>Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the requestTemplates property on the Integration resource. There are three valid values: WHEN_NO_MATCH, WHEN_NO_TEMPLATES, and NEVER. Supported only for WebSocket APIs.</p> <p>WHEN_NO_MATCH passes the request body for unmapped content types through to the integration backend without transformation.</p> <p>NEVER rejects unmapped content types with an HTTP 415 Unsupported Media Type response.</p> <p>WHEN_NO_TEMPLATES allows pass-through when the integration has no content types mapped to templates. However, if there is at least one content type defined, unmapped content types will be rejected with the same HTTP 415 Unsupported Media Type response.</p>', 'UpdateIntegrationInput$PassthroughBehavior' => '<p>Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the requestTemplates property on the Integration resource. There are three valid values: WHEN_NO_MATCH, WHEN_NO_TEMPLATES, and NEVER. Supported only for WebSocket APIs.</p> <p>WHEN_NO_MATCH passes the request body for unmapped content types through to the integration backend without transformation.</p> <p>NEVER rejects unmapped content types with an HTTP 415 Unsupported Media Type response.</p> <p>WHEN_NO_TEMPLATES allows pass-through when the integration has no content types mapped to templates. However, if there is at least one content type defined, unmapped content types will be rejected with the same HTTP 415 Unsupported Media Type response.</p>', ], ], 'ProtocolType' => [ 'base' => 'Represents a protocol type.', 'refs' => [ 'Api$ProtocolType' => '<p>The API protocol.</p>', 'CreateApiInput$ProtocolType' => '<p>The API protocol.</p>', ], ], 'ReimportApiInput' => [ 'base' => '<p>Overwrites the configuration of an existing API using the provided definition. Supported only for HTTP APIs.</p>', 'refs' => [], ], 'ResponseParameters' => [ 'base' => '<p>Supported only for HTTP APIs. You use response parameters to transform the HTTP response from a backend integration before returning the response to clients.</p>', 'refs' => [ 'CreateIntegrationInput$ResponseParameters' => '<p>Supported only for HTTP APIs. You use response parameters to transform the HTTP response from a backend integration before returning the response to clients. Specify a key-value map from a selection key to response parameters. The selection key must be a valid HTTP status code within the range of 200-599. Response parameters are a key-value map. The key must match pattern &lt;action&gt;:&lt;header&gt;.&lt;location&gt; or overwrite.statuscode. The action can be append, overwrite or remove. The value can be a static value, or map to response data, stage variables, or context variables that are evaluated at runtime. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html\">Transforming API requests and responses</a>.</p>', 'Integration$ResponseParameters' => '<p>Supported only for HTTP APIs. You use response parameters to transform the HTTP response from a backend integration before returning the response to clients. Specify a key-value map from a selection key to response parameters. The selection key must be a valid HTTP status code within the range of 200-599. Response parameters are a key-value map. The key must match pattern &lt;action&gt;:&lt;header&gt;.&lt;location&gt; or overwrite.statuscode. The action can be append, overwrite or remove. The value can be a static value, or map to response data, stage variables, or context variables that are evaluated at runtime. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html\">Transforming API requests and responses</a>.</p>', 'UpdateIntegrationInput$ResponseParameters' => '<p>Supported only for HTTP APIs. You use response parameters to transform the HTTP response from a backend integration before returning the response to clients. Specify a key-value map from a selection key to response parameters. The selection key must be a valid HTTP status code within the range of 200-599. Response parameters are a key-value map. The key must match pattern &lt;action&gt;:&lt;header&gt;.&lt;location&gt; or overwrite.statuscode. The action can be append, overwrite or remove. The value can be a static value, or map to response data, stage variables, or context variables that are evaluated at runtime. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html\">Transforming API requests and responses</a>.</p>', ], ], 'Route' => [ 'base' => '<p>Represents a route.</p>', 'refs' => [ '__listOfRoute$member' => NULL, ], ], 'RouteModels' => [ 'base' => '<p>The route models.</p>', 'refs' => [ 'CreateRouteInput$RequestModels' => '<p>The request models for the route. Supported only for WebSocket APIs.</p>', 'CreateRouteResponseInput$ResponseModels' => '<p>The response models for the route response.</p>', 'Route$RequestModels' => '<p>The request models for the route. Supported only for WebSocket APIs.</p>', 'RouteResponse$ResponseModels' => '<p>Represents the response models of a route response.</p>', 'UpdateRouteInput$RequestModels' => '<p>The request models for the route. Supported only for WebSocket APIs.</p>', 'UpdateRouteResponseInput$ResponseModels' => '<p>The response models for the route response.</p>', ], ], 'RouteParameters' => [ 'base' => '<p>The route parameters.</p>', 'refs' => [ 'CreateRouteInput$RequestParameters' => '<p>The request parameters for the route. Supported only for WebSocket APIs.</p>', 'CreateRouteResponseInput$ResponseParameters' => '<p>The route response parameters.</p>', 'Route$RequestParameters' => '<p>The request parameters for the route. Supported only for WebSocket APIs.</p>', 'RouteResponse$ResponseParameters' => '<p>Represents the response parameters of a route response.</p>', 'UpdateRouteInput$RequestParameters' => '<p>The request parameters for the route. Supported only for WebSocket APIs.</p>', 'UpdateRouteResponseInput$ResponseParameters' => '<p>The route response parameters.</p>', ], ], 'RouteResponse' => [ 'base' => '<p>Represents a route response.</p>', 'refs' => [ '__listOfRouteResponse$member' => NULL, ], ], 'RouteResponses' => [ 'base' => '<p>Represents a collection of route responses.</p>', 'refs' => [], ], 'RouteSettings' => [ 'base' => '<p>Represents a collection of route settings.</p>', 'refs' => [ 'CreateStageInput$DefaultRouteSettings' => '<p>The default route settings for the stage.</p>', 'RouteSettingsMap$member' => NULL, 'Stage$DefaultRouteSettings' => '<p>Default route settings for the stage.</p>', 'UpdateStageInput$DefaultRouteSettings' => '<p>The default route settings for the stage.</p>', ], ], 'RouteSettingsMap' => [ 'base' => '<p>The route settings map.</p>', 'refs' => [ 'CreateStageInput$RouteSettings' => '<p>Route settings for the stage, by routeKey.</p>', 'Stage$RouteSettings' => '<p>Route settings for the stage, by routeKey.</p>', 'UpdateStageInput$RouteSettings' => '<p>Route settings for the stage.</p>', ], ], 'Routes' => [ 'base' => '<p>Represents a collection of routes.</p>', 'refs' => [], ], 'SecurityGroupIdList' => [ 'base' => '<p>A list of security group IDs for the VPC link.</p>', 'refs' => [ 'CreateVpcLinkInput$SecurityGroupIds' => '<p>A list of security group IDs for the VPC link.</p>', 'VpcLink$SecurityGroupIds' => '<p>A list of security group IDs for the VPC link.</p>', ], ], 'SecurityPolicy' => [ 'base' => '<p>The Transport Layer Security (TLS) version of the security policy for this domain name. The valid values are TLS_1_0 and TLS_1_2.</p>', 'refs' => [ 'DomainNameConfiguration$SecurityPolicy' => '<p>The Transport Layer Security (TLS) version of the security policy for this domain name. The valid values are TLS_1_0 and TLS_1_2.</p>', ], ], 'SelectionExpression' => [ 'base' => '<p>An expression used to extract information at runtime. See <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions\">Selection Expressions</a> for more information.</p>', 'refs' => [ 'Api$ApiKeySelectionExpression' => '<p>An API key selection expression. Supported only for WebSocket APIs. See <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions\">API Key Selection Expressions</a>.</p>', 'Api$RouteSelectionExpression' => '<p>The route selection expression for the API. For HTTP APIs, the routeSelectionExpression must be ${request.method} ${request.path}. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.</p>', 'CreateApiInput$ApiKeySelectionExpression' => '<p>An API key selection expression. Supported only for WebSocket APIs. See <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions\">API Key Selection Expressions</a>.</p>', 'CreateApiInput$RouteSelectionExpression' => '<p>The route selection expression for the API. For HTTP APIs, the routeSelectionExpression must be ${request.method} ${request.path}. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.</p>', 'CreateIntegrationInput$TemplateSelectionExpression' => '<p>The template selection expression for the integration.</p>', 'CreateIntegrationResponseInput$TemplateSelectionExpression' => '<p>The template selection expression for the integration response. Supported only for WebSocket APIs.</p>', 'CreateRouteInput$ModelSelectionExpression' => '<p>The model selection expression for the route. Supported only for WebSocket APIs.</p>', 'CreateRouteInput$RouteResponseSelectionExpression' => '<p>The route response selection expression for the route. Supported only for WebSocket APIs.</p>', 'CreateRouteResponseInput$ModelSelectionExpression' => '<p>The model selection expression for the route response. Supported only for WebSocket APIs.</p>', 'DomainName$ApiMappingSelectionExpression' => '<p>The API mapping selection expression.</p>', 'Integration$IntegrationResponseSelectionExpression' => '<p>The integration response selection expression for the integration. Supported only for WebSocket APIs. See <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-integration-response-selection-expressions\">Integration Response Selection Expressions</a>.</p>', 'Integration$TemplateSelectionExpression' => '<p>The template selection expression for the integration. Supported only for WebSocket APIs.</p>', 'IntegrationResponse$TemplateSelectionExpression' => '<p>The template selection expressions for the integration response.</p>', 'Route$ModelSelectionExpression' => '<p>The model selection expression for the route. Supported only for WebSocket APIs.</p>', 'Route$RouteResponseSelectionExpression' => '<p>The route response selection expression for the route. Supported only for WebSocket APIs.</p>', 'RouteResponse$ModelSelectionExpression' => '<p>Represents the model selection expression of a route response. Supported only for WebSocket APIs.</p>', 'UpdateApiInput$ApiKeySelectionExpression' => '<p>An API key selection expression. Supported only for WebSocket APIs. See <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions\">API Key Selection Expressions</a>.</p>', 'UpdateApiInput$RouteSelectionExpression' => '<p>The route selection expression for the API. For HTTP APIs, the routeSelectionExpression must be ${request.method} ${request.path}. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.</p>', 'UpdateIntegrationInput$TemplateSelectionExpression' => '<p>The template selection expression for the integration.</p>', 'UpdateIntegrationResponseInput$TemplateSelectionExpression' => '<p>The template selection expression for the integration response. Supported only for WebSocket APIs.</p>', 'UpdateRouteInput$ModelSelectionExpression' => '<p>The model selection expression for the route. Supported only for WebSocket APIs.</p>', 'UpdateRouteInput$RouteResponseSelectionExpression' => '<p>The route response selection expression for the route. Supported only for WebSocket APIs.</p>', 'UpdateRouteResponseInput$ModelSelectionExpression' => '<p>The model selection expression for the route response. Supported only for WebSocket APIs.</p>', ], ], 'SelectionKey' => [ 'base' => '<p>After evaluating a selection expression, the result is compared against one or more selection keys to find a matching key. See <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions\">Selection Expressions</a> for a list of expressions and each expression\\'s associated selection key type.</p>', 'refs' => [ 'ApiMapping$ApiMappingKey' => '<p>The API mapping key.</p>', 'CreateApiInput$RouteKey' => '<p>This property is part of quick create. If you don\\'t specify a routeKey, a default route of $default is created. The $default route acts as a catch-all for any request made to your API, for a particular stage. The $default route key can\\'t be modified. You can add routes after creating the API, and you can update the route keys of additional routes. Supported only for HTTP APIs.</p>', 'CreateApiMappingInput$ApiMappingKey' => 'The API mapping key.', 'CreateIntegrationResponseInput$IntegrationResponseKey' => '<p>The integration response key.</p>', 'CreateRouteInput$RouteKey' => '<p>The route key for the route.</p>', 'CreateRouteResponseInput$RouteResponseKey' => '<p>The route response key.</p>', 'IntegrationResponse$IntegrationResponseKey' => '<p>The integration response key.</p>', 'Route$RouteKey' => '<p>The route key for the route.</p>', 'RouteResponse$RouteResponseKey' => '<p>Represents the route response key of a route response.</p>', 'UpdateApiInput$RouteKey' => '<p>This property is part of quick create. If not specified, the route created using quick create is kept. Otherwise, this value replaces the route key of the quick create route. Additional routes may still be added after the API is updated. Supported only for HTTP APIs.</p>', 'UpdateApiMappingInput$ApiMappingKey' => '<p>The API mapping key.</p>', 'UpdateIntegrationResponseInput$IntegrationResponseKey' => '<p>The integration response key.</p>', 'UpdateRouteInput$RouteKey' => '<p>The route key for the route.</p>', 'UpdateRouteResponseInput$RouteResponseKey' => '<p>The route response key.</p>', ], ], 'Stage' => [ 'base' => '<p>Represents an API stage.</p>', 'refs' => [ '__listOfStage$member' => NULL, ], ], 'StageVariablesMap' => [ 'base' => '<p>The stage variable map.</p>', 'refs' => [ 'CreateStageInput$StageVariables' => '<p>A map that defines the stage variables for a Stage. Variable names can have alphanumeric and underscore characters, and the values must match [A-Za-z0-9-._~:/?#&amp;=,]+.</p>', 'Stage$StageVariables' => '<p>A map that defines the stage variables for a stage resource. Variable names can have alphanumeric and underscore characters, and the values must match [A-Za-z0-9-._~:/?#&amp;=,]+.</p>', 'UpdateStageInput$StageVariables' => '<p>A map that defines the stage variables for a Stage. Variable names can have alphanumeric and underscore characters, and the values must match [A-Za-z0-9-._~:/?#&amp;=,]+.</p>', ], ], 'Stages' => [ 'base' => '<p>A collection of Stage resources that are associated with the ApiKey resource.</p>', 'refs' => [], ], 'StringWithLengthBetween0And1024' => [ 'base' => '<p>A string with a length between [0-1024].</p>', 'refs' => [ 'Api$Description' => '<p>The description of the API.</p>', 'Authorizer$IdentityValidationExpression' => '<p>The validation expression does not apply to the REQUEST authorizer.</p>', 'CreateApiInput$Description' => '<p>The description of the API.</p>', 'CreateAuthorizerInput$IdentityValidationExpression' => '<p>This parameter is not used.</p>', 'CreateDeploymentInput$Description' => '<p>The description for the deployment resource.</p>', 'CreateIntegrationInput$Description' => '<p>The description of the integration.</p>', 'CreateModelInput$Description' => '<p>The description of the model.</p>', 'CreateStageInput$Description' => '<p>The description for the API stage.</p>', 'Deployment$Description' => '<p>The description for the deployment.</p>', 'Integration$Description' => '<p>Represents the description of an integration.</p>', 'Model$Description' => '<p>The description of the model.</p>', 'Stage$Description' => '<p>The description of the stage.</p>', 'UpdateApiInput$Description' => '<p>The description of the API.</p>', 'UpdateAuthorizerInput$IdentityValidationExpression' => '<p>This parameter is not used.</p>', 'UpdateDeploymentInput$Description' => '<p>The description for the deployment resource.</p>', 'UpdateIntegrationInput$Description' => '<p>The description of the integration</p>', 'UpdateModelInput$Description' => '<p>The description of the model.</p>', 'UpdateStageInput$Description' => '<p>The description for the API stage.</p>', 'VpcLink$VpcLinkStatusMessage' => '<p>A message summarizing the cause of the status of the VPC link.</p>', ], ], 'StringWithLengthBetween0And2048' => [ 'base' => '<p>A string with a length between [0-2048].</p>', 'refs' => [ 'StageVariablesMap$member' => NULL, ], ], 'StringWithLengthBetween0And32K' => [ 'base' => '<p>A string with a length between [0-32768].</p>', 'refs' => [ 'CreateModelInput$Schema' => '<p>The schema for the model. For application/json models, this should be JSON schema draft 4 model.</p>', 'Model$Schema' => '<p>The schema for the model. For application/json models, this should be JSON schema draft 4 model.</p>', 'TemplateMap$member' => NULL, 'UpdateModelInput$Schema' => '<p>The schema for the model. For application/json models, this should be JSON schema draft 4 model.</p>', ], ], 'StringWithLengthBetween1And1024' => [ 'base' => '<p>A string with a length between [1-1024].</p>', 'refs' => [ 'AccessLogSettings$Format' => '<p>A single line format of the access logs of data, as specified by selected $context variables. The format must include at least $context.requestId.</p>', 'CreateIntegrationInput$ConnectionId' => '<p>The ID of the VPC link for a private integration. Supported only for HTTP APIs.</p>', 'Integration$ConnectionId' => '<p>The ID of the VPC link for a private integration. Supported only for HTTP APIs.</p>', 'UpdateIntegrationInput$ConnectionId' => '<p>The ID of the VPC link for a private integration. Supported only for HTTP APIs.</p>', ], ], 'StringWithLengthBetween1And128' => [ 'base' => '<p>A string with a length between [1-128].</p>', 'refs' => [ 'Api$Name' => '<p>The name of the API.</p>', 'ApiMapping$Stage' => '<p>The API stage.</p>', 'Authorizer$Name' => '<p>The name of the authorizer.</p>', 'CreateApiInput$Name' => '<p>The name of the API.</p>', 'CreateApiMappingInput$Stage' => '<p>The API stage.</p>', 'CreateAuthorizerInput$Name' => '<p>The name of the authorizer.</p>', 'CreateDeploymentInput$StageName' => '<p>The name of the Stage resource for the Deployment resource to create.</p>', 'CreateIntegrationInput$IntegrationSubtype' => '<p>Supported only for HTTP API AWS_PROXY integrations. Specifies the AWS service action to invoke. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services-reference.html\">Integration subtype reference</a>.</p>', 'CreateModelInput$Name' => '<p>The name of the model. Must be alphanumeric.</p>', 'CreateRouteInput$Target' => '<p>The target for the route.</p>', 'CreateStageInput$StageName' => '<p>The name of the stage.</p>', 'CreateVpcLinkInput$Name' => '<p>The name of the VPC link.</p>', 'DomainNameConfiguration$CertificateName' => '<p>The user-friendly name of the certificate that will be used by the edge-optimized endpoint for this domain name.</p>', 'Integration$IntegrationSubtype' => '<p>Supported only for HTTP API AWS_PROXY integrations. Specifies the AWS service action to invoke. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services-reference.html\">Integration subtype reference</a>.</p>', 'Model$Name' => '<p>The name of the model. Must be alphanumeric.</p>', 'Route$Target' => '<p>The target for the route.</p>', 'RouteModels$member' => NULL, 'Stage$StageName' => '<p>The name of the stage.</p>', 'UpdateApiInput$Name' => '<p>The name of the API.</p>', 'UpdateApiMappingInput$Stage' => '<p>The API stage.</p>', 'UpdateAuthorizerInput$Name' => '<p>The name of the authorizer.</p>', 'UpdateIntegrationInput$IntegrationSubtype' => '<p>Supported only for HTTP API AWS_PROXY integrations. Specifies the AWS service action to invoke. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services-reference.html\">Integration subtype reference</a>.</p>', 'UpdateModelInput$Name' => '<p>The name of the model.</p>', 'UpdateRouteInput$Target' => '<p>The target for the route.</p>', 'UpdateVpcLinkInput$Name' => '<p>The name of the VPC link.</p>', 'VpcLink$Name' => '<p>The name of the VPC link.</p>', ], ], 'StringWithLengthBetween1And1600' => [ 'base' => '<p>A string with a length between [0-1600].</p>', 'refs' => [ 'Tags$member' => NULL, ], ], 'StringWithLengthBetween1And256' => [ 'base' => '<p>A string with a length between [1-256].</p>', 'refs' => [ 'CreateModelInput$ContentType' => '<p>The content-type for the model, for example, \"application/json\".</p>', 'Model$ContentType' => '<p>The content-type for the model, for example, \"application/json\".</p>', 'UpdateModelInput$ContentType' => '<p>The content-type for the model, for example, \"application/json\".</p>', ], ], 'StringWithLengthBetween1And512' => [ 'base' => '<p>A string with a length between [1-512].</p>', 'refs' => [ 'CreateDomainNameInput$DomainName' => '<p>The domain name.</p>', 'DomainName$DomainName' => '<p>The name of the DomainName resource.</p>', 'IntegrationParameters$member' => NULL, 'TlsConfig$ServerNameToVerify' => '<p>If you specify a server name, API Gateway uses it to verify the hostname on the integration\\'s certificate. The server name is also included in the TLS handshake to support Server Name Indication (SNI) or virtual hosting.</p>', 'TlsConfigInput$ServerNameToVerify' => '<p>If you specify a server name, API Gateway uses it to verify the hostname on the integration\\'s certificate. The server name is also included in the TLS handshake to support Server Name Indication (SNI) or virtual hosting.</p>', ], ], 'StringWithLengthBetween1And64' => [ 'base' => '<p>A string with a length between [1-64].</p>', 'refs' => [ 'Api$Version' => '<p>A version identifier for the API.</p>', 'AuthorizationScopes$member' => NULL, 'Authorizer$AuthorizerPayloadFormatVersion' => '<p>Specifies the format of the payload sent to an HTTP API Lambda authorizer. Required for HTTP API Lambda authorizers. Supported values are 1.0 and 2.0. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html\">Working with AWS Lambda authorizers for HTTP APIs</a>.</p>', 'CorsMethodList$member' => NULL, 'CreateApiInput$Version' => '<p>A version identifier for the API.</p>', 'CreateAuthorizerInput$AuthorizerPayloadFormatVersion' => '<p>Specifies the format of the payload sent to an HTTP API Lambda authorizer. Required for HTTP API Lambda authorizers. Supported values are 1.0 and 2.0. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html\">Working with AWS Lambda authorizers for HTTP APIs</a>.</p>', 'CreateIntegrationInput$IntegrationMethod' => '<p>Specifies the integration\\'s HTTP method type.</p>', 'CreateIntegrationInput$PayloadFormatVersion' => '<p>Specifies the format of the payload sent to an integration. Required for HTTP APIs.</p>', 'CreateRouteInput$OperationName' => '<p>The operation name for the route.</p>', 'Integration$IntegrationMethod' => '<p>Specifies the integration\\'s HTTP method type.</p>', 'Integration$PayloadFormatVersion' => '<p>Specifies the format of the payload sent to an integration. Required for HTTP APIs.</p>', 'MutualTlsAuthentication$TruststoreVersion' => '<p>The version of the S3 object that contains your truststore. To specify a version, you must have versioning enabled for the S3 bucket.</p>', 'MutualTlsAuthenticationInput$TruststoreVersion' => '<p>The version of the S3 object that contains your truststore. To specify a version, you must have versioning enabled for the S3 bucket.</p>', 'Route$OperationName' => '<p>The operation name for the route.</p>', 'UpdateApiInput$Version' => '<p>A version identifier for the API.</p>', 'UpdateAuthorizerInput$AuthorizerPayloadFormatVersion' => '<p>Specifies the format of the payload sent to an HTTP API Lambda authorizer. Required for HTTP API Lambda authorizers. Supported values are 1.0 and 2.0. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html\">Working with AWS Lambda authorizers for HTTP APIs</a>.</p>', 'UpdateIntegrationInput$IntegrationMethod' => '<p>Specifies the integration\\'s HTTP method type.</p>', 'UpdateIntegrationInput$PayloadFormatVersion' => '<p>Specifies the format of the payload sent to an integration. Required for HTTP APIs.</p>', 'UpdateRouteInput$OperationName' => '<p>The operation name for the route.</p>', ], ], 'SubnetIdList' => [ 'base' => '<p>A list of subnet IDs to include in the VPC link.</p>', 'refs' => [ 'CreateVpcLinkInput$SubnetIds' => '<p>A list of subnet IDs to include in the VPC link.</p>', 'VpcLink$SubnetIds' => '<p>A list of subnet IDs to include in the VPC link.</p>', ], ], 'TagResourceInput' => [ 'base' => '<p>Represents the input parameters for a TagResource request.</p>', 'refs' => [], ], 'Tags' => [ 'base' => '<p>Represents a collection of tags associated with the resource.</p>', 'refs' => [ 'Api$Tags' => '<p>A collection of tags associated with the API.</p>', 'CreateApiInput$Tags' => '<p>The collection of tags. Each tag element is associated with a given resource.</p>', 'CreateDomainNameInput$Tags' => '<p>The collection of tags associated with a domain name.</p>', 'CreateStageInput$Tags' => '<p>The collection of tags. Each tag element is associated with a given resource.</p>', 'CreateVpcLinkInput$Tags' => '<p>A list of tags.</p>', 'DomainName$Tags' => '<p>The collection of tags associated with a domain name.</p>', 'Stage$Tags' => '<p>The collection of tags. Each tag element is associated with a given resource.</p>', 'TagResourceInput$Tags' => '<p>The collection of tags. Each tag element is associated with a given resource.</p>', 'VpcLink$Tags' => '<p>Tags for the VPC link.</p>', ], ], 'Template' => [ 'base' => '<p>Represents a template.</p>', 'refs' => [], ], 'TemplateMap' => [ 'base' => '<p>A mapping of identifier keys to templates. The value is an actual template script. The key is typically a SelectionKey which is chosen based on evaluating a selection expression.</p>', 'refs' => [ 'CreateIntegrationInput$RequestTemplates' => '<p>Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value. Supported only for WebSocket APIs.</p>', 'CreateIntegrationResponseInput$ResponseTemplates' => '<p>The collection of response templates for the integration response as a string-to-string map of key-value pairs. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.</p>', 'Integration$RequestTemplates' => '<p>Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value. Supported only for WebSocket APIs.</p>', 'IntegrationResponse$ResponseTemplates' => '<p>The collection of response templates for the integration response as a string-to-string map of key-value pairs. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.</p>', 'UpdateIntegrationInput$RequestTemplates' => '<p>Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value. Supported only for WebSocket APIs.</p>', 'UpdateIntegrationResponseInput$ResponseTemplates' => '<p>The collection of response templates for the integration response as a string-to-string map of key-value pairs. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.</p>', ], ], 'TlsConfig' => [ 'base' => '<p>The TLS configuration for a private integration. If you specify a TLS configuration, private integration traffic uses the HTTPS protocol. Supported only for HTTP APIs.</p>', 'refs' => [ 'Integration$TlsConfig' => '<p>The TLS configuration for a private integration. If you specify a TLS configuration, private integration traffic uses the HTTPS protocol. Supported only for HTTP APIs.</p>', ], ], 'TlsConfigInput' => [ 'base' => '<p>The TLS configuration for a private integration. If you specify a TLS configuration, private integration traffic uses the HTTPS protocol. Supported only for HTTP APIs.</p>', 'refs' => [ 'CreateIntegrationInput$TlsConfig' => '<p>The TLS configuration for a private integration. If you specify a TLS configuration, private integration traffic uses the HTTPS protocol. Supported only for HTTP APIs.</p>', 'UpdateIntegrationInput$TlsConfig' => '<p>The TLS configuration for a private integration. If you specify a TLS configuration, private integration traffic uses the HTTPS protocol. Supported only for HTTP APIs.</p>', ], ], 'TooManyRequestsException' => [ 'base' => '<p>A limit has been exceeded. See the accompanying error message for details.</p>', 'refs' => [], ], 'UpdateApiInput' => [ 'base' => '<p>Represents the input parameters for an UpdateApi request.</p>', 'refs' => [], ], 'UpdateApiMappingInput' => [ 'base' => '<p>Represents the input parameters for an UpdateApiMapping request.</p>', 'refs' => [], ], 'UpdateAuthorizerInput' => [ 'base' => '<p>The input parameters for an UpdateAuthorizer request.</p>', 'refs' => [], ], 'UpdateDeploymentInput' => [ 'base' => '<p>Represents the input parameters for an UpdateDeployment request.</p>', 'refs' => [], ], 'UpdateDomainNameInput' => [ 'base' => '<p>Represents the input parameters for an UpdateDomainName request.</p>', 'refs' => [], ], 'UpdateIntegrationInput' => [ 'base' => '<p>Represents the input parameters for an UpdateIntegration request.</p>', 'refs' => [], ], 'UpdateIntegrationResponseInput' => [ 'base' => '<p>Represents the input parameters for an UpdateIntegrationResponse request.</p>', 'refs' => [], ], 'UpdateModelInput' => [ 'base' => '<p>Represents the input parameters for an UpdateModel request. Supported only for WebSocket APIs.</p>', 'refs' => [], ], 'UpdateRouteInput' => [ 'base' => '<p>Represents the input parameters for an UpdateRoute request.</p>', 'refs' => [], ], 'UpdateRouteResponseInput' => [ 'base' => '<p>Represents the input parameters for an UpdateRouteResponse request.</p>', 'refs' => [], ], 'UpdateStageInput' => [ 'base' => '<p>Represents the input parameters for an UpdateStage request.</p>', 'refs' => [], ], 'UpdateVpcLinkInput' => [ 'base' => '<p>Represents the input parameters for an UpdateVpcLink request.</p>', 'refs' => [], ], 'UriWithLengthBetween1And2048' => [ 'base' => '<p>A string representation of a URI with a length between [1-2048].</p>', 'refs' => [ 'Authorizer$AuthorizerUri' => '<p>The authorizer\\'s Uniform Resource Identifier (URI). For REQUEST authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:<replaceable>{account_id}</replaceable>:function:<replaceable>{lambda_function_name}</replaceable>/invocations. In general, the URI has this form: arn:aws:apigateway:<replaceable>{region}</replaceable>:lambda:path/<replaceable>{service_api}</replaceable> , where <replaceable></replaceable>{region} is the same as the region hosting the Lambda function, path indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /. For Lambda functions, this is usually of the form /2015-03-31/functions/[FunctionARN]/invocations. Supported only for REQUEST authorizers.</p>', 'CreateApiInput$Target' => '<p>This property is part of quick create. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. Supported only for HTTP APIs.</p>', 'CreateAuthorizerInput$AuthorizerUri' => '<p>The authorizer\\'s Uniform Resource Identifier (URI). For REQUEST authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:<replaceable>{account_id}</replaceable>:function:<replaceable>{lambda_function_name}</replaceable>/invocations. In general, the URI has this form: arn:aws:apigateway:<replaceable>{region}</replaceable>:lambda:path/<replaceable>{service_api}</replaceable> , where <replaceable></replaceable>{region} is the same as the region hosting the Lambda function, path indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /. For Lambda functions, this is usually of the form /2015-03-31/functions/[FunctionARN]/invocations. Supported only for REQUEST authorizers.</p>', 'CreateIntegrationInput$IntegrationUri' => '<p>For a Lambda integration, specify the URI of a Lambda function.</p> <p>For an HTTP integration, specify a fully-qualified URL.</p> <p>For an HTTP API private integration, specify the ARN of an Application Load Balancer listener, Network Load Balancer listener, or AWS Cloud Map service. If you specify the ARN of an AWS Cloud Map service, API Gateway uses DiscoverInstances to identify resources. You can use query parameters to target specific resources. To learn more, see <a href=\"https://docs.aws.amazon.com/cloud-map/latest/api/API_DiscoverInstances.html\">DiscoverInstances</a>. For private integrations, all resources must be owned by the same AWS account.</p>', 'Integration$IntegrationUri' => '<p>For a Lambda integration, specify the URI of a Lambda function.</p> <p>For an HTTP integration, specify a fully-qualified URL.</p> <p>For an HTTP API private integration, specify the ARN of an Application Load Balancer listener, Network Load Balancer listener, or AWS Cloud Map service. If you specify the ARN of an AWS Cloud Map service, API Gateway uses DiscoverInstances to identify resources. You can use query parameters to target specific resources. To learn more, see <a href=\"https://docs.aws.amazon.com/cloud-map/latest/api/API_DiscoverInstances.html\">DiscoverInstances</a>. For private integrations, all resources must be owned by the same AWS account.</p>', 'JWTConfiguration$Issuer' => '<p>The base domain of the identity provider that issues JSON Web Tokens. For example, an Amazon Cognito user pool has the following format: https://cognito-idp.<replaceable>{region}</replaceable>.amazonaws.com/<replaceable>{userPoolId}</replaceable> . Required for the JWT authorizer type. Supported only for HTTP APIs.</p>', 'MutualTlsAuthentication$TruststoreUri' => '<p>An Amazon S3 URL that specifies the truststore for mutual TLS authentication, for example, s3://<replaceable>bucket-name</replaceable>/<replaceable>key-name</replaceable> . The truststore can contain certificates from public or private certificate authorities. To update the truststore, upload a new version to S3, and then update your custom domain name to use the new version. To update the truststore, you must have permissions to access the S3 object.</p>', 'MutualTlsAuthenticationInput$TruststoreUri' => '<p>An Amazon S3 URL that specifies the truststore for mutual TLS authentication, for example, s3://<replaceable>bucket-name</replaceable>/<replaceable>key-name</replaceable> . The truststore can contain certificates from public or private certificate authorities. To update the truststore, upload a new version to S3, and then update your custom domain name to use the new version. To update the truststore, you must have permissions to access the S3 object.</p>', 'UpdateApiInput$Target' => '<p>This property is part of quick create. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. The value provided updates the integration URI and integration type. You can update a quick-created target, but you can\\'t remove it from an API. Supported only for HTTP APIs.</p>', 'UpdateAuthorizerInput$AuthorizerUri' => '<p>The authorizer\\'s Uniform Resource Identifier (URI). For REQUEST authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:<replaceable>{account_id}</replaceable>:function:<replaceable>{lambda_function_name}</replaceable>/invocations. In general, the URI has this form: arn:aws:apigateway:<replaceable>{region}</replaceable>:lambda:path/<replaceable>{service_api}</replaceable> , where <replaceable></replaceable>{region} is the same as the region hosting the Lambda function, path indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /. For Lambda functions, this is usually of the form /2015-03-31/functions/[FunctionARN]/invocations. Supported only for REQUEST authorizers.</p>', 'UpdateIntegrationInput$IntegrationUri' => '<p>For a Lambda integration, specify the URI of a Lambda function.</p> <p>For an HTTP integration, specify a fully-qualified URL.</p> <p>For an HTTP API private integration, specify the ARN of an Application Load Balancer listener, Network Load Balancer listener, or AWS Cloud Map service. If you specify the ARN of an AWS Cloud Map service, API Gateway uses DiscoverInstances to identify resources. You can use query parameters to target specific resources. To learn more, see <a href=\"https://docs.aws.amazon.com/cloud-map/latest/api/API_DiscoverInstances.html\">DiscoverInstances</a>. For private integrations, all resources must be owned by the same AWS account.</p>', ], ], 'VpcLink' => [ 'base' => '<p>Represents a VPC link.</p>', 'refs' => [ '__listOfVpcLink$member' => NULL, ], ], 'VpcLinkStatus' => [ 'base' => '<p>The status of the VPC link.</p>', 'refs' => [ 'VpcLink$VpcLinkStatus' => '<p>The status of the VPC link.</p>', ], ], 'VpcLinkVersion' => [ 'base' => '<p>The version of the VPC link.</p>', 'refs' => [ 'VpcLink$VpcLinkVersion' => '<p>The version of the VPC link.</p>', ], ], 'VpcLinks' => [ 'base' => '<p>Represents a collection of VPCLinks.</p>', 'refs' => [], ], '__boolean' => [ 'base' => NULL, 'refs' => [ 'Api$ApiGatewayManaged' => '<p>Specifies whether an API is managed by API Gateway. You can\\'t update or delete a managed API by using API Gateway. A managed API can be deleted only through the tooling or service that created it.</p>', 'Api$DisableSchemaValidation' => '<p>Avoid validating models when creating a deployment. Supported only for WebSocket APIs.</p>', 'Authorizer$EnableSimpleResponses' => '<p>Specifies whether a Lambda authorizer returns a response in a simple format. If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy. Supported only for HTTP APIs. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html\">Working with AWS Lambda authorizers for HTTP APIs</a></p>', 'Api$DisableExecuteApiEndpoint' => '<p>Specifies whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.</p>', 'Cors$AllowCredentials' => '<p>Specifies whether credentials are included in the CORS request. Supported only for HTTP APIs.</p>', 'CreateApiInput$DisableSchemaValidation' => '<p>Avoid validating models when creating a deployment. Supported only for WebSocket APIs.</p>', 'CreateAuthorizerInput$EnableSimpleResponses' => '<p>Specifies whether a Lambda authorizer returns a response in a simple format. By default, a Lambda authorizer must return an IAM policy. If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy. Supported only for HTTP APIs. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html\">Working with AWS Lambda authorizers for HTTP APIs</a></p>', 'CreateRouteInput$ApiKeyRequired' => '<p>Specifies whether an API key is required for the route. Supported only for WebSocket APIs.</p>', 'CreateStageInput$AutoDeploy' => '<p>Specifies whether updates to an API automatically trigger a new deployment. The default value is false.</p>', 'Deployment$AutoDeployed' => '<p>Specifies whether a deployment was automatically released.</p>', 'Integration$ApiGatewayManaged' => '<p>Specifies whether an integration is managed by API Gateway. If you created an API using using quick create, the resulting integration is managed by API Gateway. You can update a managed integration, but you can\\'t delete it.</p>', 'ParameterConstraints$Required' => '<p>Whether or not the parameter is required.</p>', 'Route$ApiGatewayManaged' => '<p>Specifies whether a route is managed by API Gateway. If you created an API using quick create, the $default route is managed by API Gateway. You can\\'t modify the $default route key.</p>', 'Route$ApiKeyRequired' => '<p>Specifies whether an API key is required for this route. Supported only for WebSocket APIs.</p>', 'RouteSettings$DataTraceEnabled' => '<p>Specifies whether (true) or not (false) data trace logging is enabled for this route. This property affects the log entries pushed to Amazon CloudWatch Logs. Supported only for WebSocket APIs.</p>', 'RouteSettings$DetailedMetricsEnabled' => '<p>Specifies whether detailed metrics are enabled.</p>', 'Stage$ApiGatewayManaged' => '<p>Specifies whether a stage is managed by API Gateway. If you created an API using quick create, the $default stage is managed by API Gateway. You can\\'t modify the $default stage.</p>', 'Stage$AutoDeploy' => '<p>Specifies whether updates to an API automatically trigger a new deployment. The default value is false.</p>', 'UpdateApiInput$DisableSchemaValidation' => '<p>Avoid validating models when creating a deployment. Supported only for WebSocket APIs.</p>', 'UpdateAuthorizerInput$EnableSimpleResponses' => '<p>Specifies whether a Lambda authorizer returns a response in a simple format. By default, a Lambda authorizer must return an IAM policy. If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy. Supported only for HTTP APIs. To learn more, see <a href=\"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html\">Working with AWS Lambda authorizers for HTTP APIs</a></p>', 'UpdateRouteInput$ApiKeyRequired' => '<p>Specifies whether an API key is required for the route. Supported only for WebSocket APIs.</p>', 'UpdateStageInput$AutoDeploy' => '<p>Specifies whether updates to an API automatically trigger a new deployment. The default value is false.</p>', ], ], '__double' => [ 'base' => NULL, 'refs' => [ 'RouteSettings$ThrottlingRateLimit' => '<p>Specifies the throttling rate limit.</p>', ], ], '__integer' => [ 'base' => NULL, 'refs' => [ 'RouteSettings$ThrottlingBurstLimit' => '<p>Specifies the throttling burst limit.</p>', ], ], '__listOfApi' => [ 'base' => NULL, 'refs' => [ 'Apis$Items' => '<p>The elements from this collection.</p>', ], ], '__listOfApiMapping' => [ 'base' => NULL, 'refs' => [ 'ApiMappings$Items' => '<p>The elements from this collection.</p>', ], ], '__listOfAuthorizer' => [ 'base' => NULL, 'refs' => [ 'Authorizers$Items' => '<p>The elements from this collection.</p>', ], ], '__listOfDeployment' => [ 'base' => NULL, 'refs' => [ 'Deployments$Items' => '<p>The elements from this collection.</p>', ], ], '__listOfDomainName' => [ 'base' => NULL, 'refs' => [ 'DomainNames$Items' => '<p>The elements from this collection.</p>', ], ], '__listOfIntegration' => [ 'base' => NULL, 'refs' => [ 'Integrations$Items' => '<p>The elements from this collection.</p>', ], ], '__listOfIntegrationResponse' => [ 'base' => NULL, 'refs' => [ 'IntegrationResponses$Items' => '<p>The elements from this collection.</p>', ], ], '__listOfModel' => [ 'base' => NULL, 'refs' => [ 'Models$Items' => '<p>The elements from this collection.</p>', ], ], '__listOfRoute' => [ 'base' => NULL, 'refs' => [ 'Routes$Items' => '<p>The elements from this collection.</p>', ], ], '__listOfRouteResponse' => [ 'base' => NULL, 'refs' => [ 'RouteResponses$Items' => '<p>The elements from this collection.</p>', ], ], '__listOfStage' => [ 'base' => NULL, 'refs' => [ 'Stages$Items' => '<p>The elements from this collection.</p>', ], ], '__listOfVpcLink' => [ 'base' => NULL, 'refs' => [ 'VpcLinks$Items' => '<p>A collection of VPC links.</p>', ], ], '__listOf__string' => [ 'base' => NULL, 'refs' => [ 'Api$ImportInfo' => '<p>The validation information during API import. This may include particular properties of your OpenAPI definition which are ignored during import. Supported only for HTTP APIs.</p>', 'Api$Warnings' => '<p>The warning messages reported when failonwarnings is turned on during API import.</p>', 'JWTConfiguration$Audience' => '<p>A list of the intended recipients of the JWT. A valid JWT must provide an aud that matches at least one entry in this list. See <a href=\"https://tools.ietf.org/html/rfc7519#section-4.1.3\">RFC 7519</a>. Supported only for HTTP APIs.</p>', 'MutualTlsAuthentication$TruststoreWarnings' => '<p>A list of warnings that API Gateway returns while processing your truststore. Invalid certificates produce warnings. Mutual TLS is still enabled, but some clients might not be able to access your API. To resolve warnings, upload a new truststore to S3, and then update you domain name to use the new version.</p>', ], ], '__string' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$Message' => NULL, 'Api$ApiEndpoint' => '<p>The URI of the API, of the form {api-id}.execute-api.{region}.amazonaws.com. The stage name is typically appended to this URI to form a complete path to a deployed API stage.</p>', 'BadRequestException$Message' => '<p>Describes the error encountered.</p>', 'ConflictException$Message' => '<p>Describes the error encountered.</p>', 'CorsHeaderList$member' => NULL, 'CorsOriginList$member' => NULL, 'Deployment$DeploymentStatusMessage' => '<p>May contain additional feedback on the status of an API deployment.</p>', 'DomainNameConfiguration$ApiGatewayDomainName' => '<p>A domain name for the API.</p>', 'DomainNameConfiguration$DomainNameStatusMessage' => '<p>An optional text message containing detailed information about status of the domain name migration.</p>', 'DomainNameConfiguration$HostedZoneId' => '<p>The Amazon Route 53 Hosted Zone ID of the endpoint.</p>', 'IdentitySourceList$member' => NULL, 'ImportApiInput$Body' => '<p>The OpenAPI definition. Supported only for HTTP APIs.</p>', 'LimitExceededException$LimitType' => '<p>The limit type.</p>', 'LimitExceededException$Message' => '<p>Describes the error encountered.</p>', 'NotFoundException$Message' => '<p>Describes the error encountered.</p>', 'NotFoundException$ResourceType' => '<p>The resource type.</p>', 'ReimportApiInput$Body' => '<p>The OpenAPI definition. Supported only for HTTP APIs.</p>', 'SecurityGroupIdList$member' => NULL, 'Stage$LastDeploymentStatusMessage' => '<p>Describes the status of the last deployment of a stage. Supported only for stages with autoDeploy enabled.</p>', 'SubnetIdList$member' => NULL, 'Template$Value' => '<p>The template value.</p>', '__listOf__string$member' => NULL, ], ], '__timestampIso8601' => [ 'base' => NULL, 'refs' => [ 'Api$CreatedDate' => '<p>The timestamp when the API was created.</p>', 'Deployment$CreatedDate' => '<p>The date and time when the Deployment resource was created.</p>', 'DomainNameConfiguration$CertificateUploadDate' => '<p>The timestamp when the certificate that was used by edge-optimized endpoint for this domain name was uploaded.</p>', 'Stage$CreatedDate' => '<p>The timestamp when the stage was created.</p>', 'Stage$LastUpdatedDate' => '<p>The timestamp when the stage was last updated.</p>', 'VpcLink$CreatedDate' => '<p>The timestamp when the VPC link was created.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigatewayv2/2018-11-29/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], [ 'fn' => 'parseURL', 'argv' => [ [ 'ref' => 'Endpoint', ], ], 'assign' => 'url', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://apigateway-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://apigateway-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://apigateway.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://apigateway.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigatewayv2/2018-11-29/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-south-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-south-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-south-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-south-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-south-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-south-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-south-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-south-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-south-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-south-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-south-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-south-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-south-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-south-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.me-central-1.api.aws', ], ], 'params' => [ 'Region' => 'me-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.me-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.me-central-1.api.aws', ], ], 'params' => [ 'Region' => 'me-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.me-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ca-central-1.api.aws', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ca-central-1.api.aws', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-central-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-central-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-central-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-central-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-central-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-central-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.af-south-1.api.aws', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.af-south-1.api.aws', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-north-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-north-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-west-3.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-west-3.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-northeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-northeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-northeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-northeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-northeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-northeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.me-south-1.api.aws', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.me-south-1.api.aws', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.sa-east-1.api.aws', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.sa-east-1.api.aws', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-east-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-east-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-gov-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-gov-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-southeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-southeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-southeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-southeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-southeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-southeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-4 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-southeast-4.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-4', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-4 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.ap-southeast-4.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-4', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-4 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-southeast-4.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-4', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-4 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.ap-southeast-4.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-4', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apigateway.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apigatewayv2/2018-11-29/paginators-1.json\nreturn [ 'pagination' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appconfig/2019-10-09/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2019-10-09', 'endpointPrefix' => 'appconfig', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceAbbreviation' => 'AppConfig', 'serviceFullName' => 'Amazon AppConfig', 'serviceId' => 'AppConfig', 'signatureVersion' => 'v4', 'signingName' => 'appconfig', 'uid' => 'appconfig-2019-10-09', ], 'operations' => [ 'CreateApplication' => [ 'name' => 'CreateApplication', 'http' => [ 'method' => 'POST', 'requestUri' => '/applications', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateApplicationRequest', ], 'output' => [ 'shape' => 'Application', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalServerException', ], ], ], 'CreateConfigurationProfile' => [ 'name' => 'CreateConfigurationProfile', 'http' => [ 'method' => 'POST', 'requestUri' => '/applications/{ApplicationId}/configurationprofiles', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateConfigurationProfileRequest', ], 'output' => [ 'shape' => 'ConfigurationProfile', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], ], ], 'CreateDeploymentStrategy' => [ 'name' => 'CreateDeploymentStrategy', 'http' => [ 'method' => 'POST', 'requestUri' => '/deploymentstrategies', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateDeploymentStrategyRequest', ], 'output' => [ 'shape' => 'DeploymentStrategy', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'CreateEnvironment' => [ 'name' => 'CreateEnvironment', 'http' => [ 'method' => 'POST', 'requestUri' => '/applications/{ApplicationId}/environments', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateEnvironmentRequest', ], 'output' => [ 'shape' => 'Environment', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'BadRequestException', ], ], ], 'CreateExtension' => [ 'name' => 'CreateExtension', 'http' => [ 'method' => 'POST', 'requestUri' => '/extensions', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateExtensionRequest', ], 'output' => [ 'shape' => 'Extension', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'InternalServerException', ], ], ], 'CreateExtensionAssociation' => [ 'name' => 'CreateExtensionAssociation', 'http' => [ 'method' => 'POST', 'requestUri' => '/extensionassociations', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateExtensionAssociationRequest', ], 'output' => [ 'shape' => 'ExtensionAssociation', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], ], 'CreateHostedConfigurationVersion' => [ 'name' => 'CreateHostedConfigurationVersion', 'http' => [ 'method' => 'POST', 'requestUri' => '/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}/hostedconfigurationversions', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateHostedConfigurationVersionRequest', ], 'output' => [ 'shape' => 'HostedConfigurationVersion', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'PayloadTooLargeException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DeleteApplication' => [ 'name' => 'DeleteApplication', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/applications/{ApplicationId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteApplicationRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'DeleteConfigurationProfile' => [ 'name' => 'DeleteConfigurationProfile', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteConfigurationProfileRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'DeleteDeploymentStrategy' => [ 'name' => 'DeleteDeploymentStrategy', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/deployementstrategies/{DeploymentStrategyId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteDeploymentStrategyRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'DeleteEnvironment' => [ 'name' => 'DeleteEnvironment', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/applications/{ApplicationId}/environments/{EnvironmentId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteEnvironmentRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'DeleteExtension' => [ 'name' => 'DeleteExtension', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/extensions/{ExtensionIdentifier}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteExtensionRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'DeleteExtensionAssociation' => [ 'name' => 'DeleteExtensionAssociation', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/extensionassociations/{ExtensionAssociationId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteExtensionAssociationRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DeleteHostedConfigurationVersion' => [ 'name' => 'DeleteHostedConfigurationVersion', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}/hostedconfigurationversions/{VersionNumber}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteHostedConfigurationVersionRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetApplication' => [ 'name' => 'GetApplication', 'http' => [ 'method' => 'GET', 'requestUri' => '/applications/{ApplicationId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetApplicationRequest', ], 'output' => [ 'shape' => 'Application', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetConfiguration' => [ 'name' => 'GetConfiguration', 'http' => [ 'method' => 'GET', 'requestUri' => '/applications/{Application}/environments/{Environment}/configurations/{Configuration}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetConfigurationRequest', ], 'output' => [ 'shape' => 'Configuration', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'This API has been deprecated in favor of the GetLatestConfiguration API used in conjunction with StartConfigurationSession.', ], 'GetConfigurationProfile' => [ 'name' => 'GetConfigurationProfile', 'http' => [ 'method' => 'GET', 'requestUri' => '/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetConfigurationProfileRequest', ], 'output' => [ 'shape' => 'ConfigurationProfile', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetDeployment' => [ 'name' => 'GetDeployment', 'http' => [ 'method' => 'GET', 'requestUri' => '/applications/{ApplicationId}/environments/{EnvironmentId}/deployments/{DeploymentNumber}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetDeploymentRequest', ], 'output' => [ 'shape' => 'Deployment', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetDeploymentStrategy' => [ 'name' => 'GetDeploymentStrategy', 'http' => [ 'method' => 'GET', 'requestUri' => '/deploymentstrategies/{DeploymentStrategyId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetDeploymentStrategyRequest', ], 'output' => [ 'shape' => 'DeploymentStrategy', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetEnvironment' => [ 'name' => 'GetEnvironment', 'http' => [ 'method' => 'GET', 'requestUri' => '/applications/{ApplicationId}/environments/{EnvironmentId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetEnvironmentRequest', ], 'output' => [ 'shape' => 'Environment', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetExtension' => [ 'name' => 'GetExtension', 'http' => [ 'method' => 'GET', 'requestUri' => '/extensions/{ExtensionIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetExtensionRequest', ], 'output' => [ 'shape' => 'Extension', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'GetExtensionAssociation' => [ 'name' => 'GetExtensionAssociation', 'http' => [ 'method' => 'GET', 'requestUri' => '/extensionassociations/{ExtensionAssociationId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetExtensionAssociationRequest', ], 'output' => [ 'shape' => 'ExtensionAssociation', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetHostedConfigurationVersion' => [ 'name' => 'GetHostedConfigurationVersion', 'http' => [ 'method' => 'GET', 'requestUri' => '/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}/hostedconfigurationversions/{VersionNumber}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetHostedConfigurationVersionRequest', ], 'output' => [ 'shape' => 'HostedConfigurationVersion', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListApplications' => [ 'name' => 'ListApplications', 'http' => [ 'method' => 'GET', 'requestUri' => '/applications', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListApplicationsRequest', ], 'output' => [ 'shape' => 'Applications', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'ListConfigurationProfiles' => [ 'name' => 'ListConfigurationProfiles', 'http' => [ 'method' => 'GET', 'requestUri' => '/applications/{ApplicationId}/configurationprofiles', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListConfigurationProfilesRequest', ], 'output' => [ 'shape' => 'ConfigurationProfiles', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'ListDeploymentStrategies' => [ 'name' => 'ListDeploymentStrategies', 'http' => [ 'method' => 'GET', 'requestUri' => '/deploymentstrategies', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListDeploymentStrategiesRequest', ], 'output' => [ 'shape' => 'DeploymentStrategies', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'ListDeployments' => [ 'name' => 'ListDeployments', 'http' => [ 'method' => 'GET', 'requestUri' => '/applications/{ApplicationId}/environments/{EnvironmentId}/deployments', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListDeploymentsRequest', ], 'output' => [ 'shape' => 'Deployments', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'ListEnvironments' => [ 'name' => 'ListEnvironments', 'http' => [ 'method' => 'GET', 'requestUri' => '/applications/{ApplicationId}/environments', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListEnvironmentsRequest', ], 'output' => [ 'shape' => 'Environments', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'ListExtensionAssociations' => [ 'name' => 'ListExtensionAssociations', 'http' => [ 'method' => 'GET', 'requestUri' => '/extensionassociations', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListExtensionAssociationsRequest', ], 'output' => [ 'shape' => 'ExtensionAssociations', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'ListExtensions' => [ 'name' => 'ListExtensions', 'http' => [ 'method' => 'GET', 'requestUri' => '/extensions', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListExtensionsRequest', ], 'output' => [ 'shape' => 'Extensions', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'ListHostedConfigurationVersions' => [ 'name' => 'ListHostedConfigurationVersions', 'http' => [ 'method' => 'GET', 'requestUri' => '/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}/hostedconfigurationversions', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListHostedConfigurationVersionsRequest', ], 'output' => [ 'shape' => 'HostedConfigurationVersions', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags/{ResourceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ResourceTags', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalServerException', ], ], ], 'StartDeployment' => [ 'name' => 'StartDeployment', 'http' => [ 'method' => 'POST', 'requestUri' => '/applications/{ApplicationId}/environments/{EnvironmentId}/deployments', 'responseCode' => 201, ], 'input' => [ 'shape' => 'StartDeploymentRequest', ], 'output' => [ 'shape' => 'Deployment', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], ], ], 'StopDeployment' => [ 'name' => 'StopDeployment', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/applications/{ApplicationId}/environments/{EnvironmentId}/deployments/{DeploymentNumber}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'StopDeploymentRequest', ], 'output' => [ 'shape' => 'Deployment', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'BadRequestException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags/{ResourceArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/tags/{ResourceArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UpdateApplication' => [ 'name' => 'UpdateApplication', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/applications/{ApplicationId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateApplicationRequest', ], 'output' => [ 'shape' => 'Application', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UpdateConfigurationProfile' => [ 'name' => 'UpdateConfigurationProfile', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateConfigurationProfileRequest', ], 'output' => [ 'shape' => 'ConfigurationProfile', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UpdateDeploymentStrategy' => [ 'name' => 'UpdateDeploymentStrategy', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/deploymentstrategies/{DeploymentStrategyId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateDeploymentStrategyRequest', ], 'output' => [ 'shape' => 'DeploymentStrategy', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UpdateEnvironment' => [ 'name' => 'UpdateEnvironment', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/applications/{ApplicationId}/environments/{EnvironmentId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateEnvironmentRequest', ], 'output' => [ 'shape' => 'Environment', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UpdateExtension' => [ 'name' => 'UpdateExtension', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/extensions/{ExtensionIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateExtensionRequest', ], 'output' => [ 'shape' => 'Extension', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UpdateExtensionAssociation' => [ 'name' => 'UpdateExtensionAssociation', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/extensionassociations/{ExtensionAssociationId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateExtensionAssociationRequest', ], 'output' => [ 'shape' => 'ExtensionAssociation', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ValidateConfiguration' => [ 'name' => 'ValidateConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}/validators', 'responseCode' => 204, ], 'input' => [ 'shape' => 'ValidateConfigurationRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], ], ], ], 'shapes' => [ 'Action' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'Uri' => [ 'shape' => 'Uri', ], 'RoleArn' => [ 'shape' => 'Arn', ], ], ], 'ActionInvocation' => [ 'type' => 'structure', 'members' => [ 'ExtensionIdentifier' => [ 'shape' => 'Identifier', ], 'ActionName' => [ 'shape' => 'Name', ], 'Uri' => [ 'shape' => 'Uri', ], 'RoleArn' => [ 'shape' => 'Arn', ], 'ErrorMessage' => [ 'shape' => 'String', ], 'ErrorCode' => [ 'shape' => 'String', ], 'InvocationId' => [ 'shape' => 'Id', ], ], ], 'ActionInvocations' => [ 'type' => 'list', 'member' => [ 'shape' => 'ActionInvocation', ], ], 'ActionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Action', ], 'max' => 1, 'min' => 1, ], 'ActionPoint' => [ 'type' => 'string', 'enum' => [ 'PRE_CREATE_HOSTED_CONFIGURATION_VERSION', 'PRE_START_DEPLOYMENT', 'ON_DEPLOYMENT_START', 'ON_DEPLOYMENT_STEP', 'ON_DEPLOYMENT_BAKING', 'ON_DEPLOYMENT_COMPLETE', 'ON_DEPLOYMENT_ROLLED_BACK', ], ], 'ActionsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'ActionPoint', ], 'value' => [ 'shape' => 'ActionList', ], 'max' => 5, 'min' => 1, ], 'Application' => [ 'type' => 'structure', 'members' => [ 'Id' => [ 'shape' => 'Id', ], 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], ], ], 'ApplicationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Application', ], ], 'Applications' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => 'ApplicationList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'AppliedExtension' => [ 'type' => 'structure', 'members' => [ 'ExtensionId' => [ 'shape' => 'Id', ], 'ExtensionAssociationId' => [ 'shape' => 'Id', ], 'VersionNumber' => [ 'shape' => 'Integer', ], 'Parameters' => [ 'shape' => 'ParameterValueMap', ], ], ], 'AppliedExtensions' => [ 'type' => 'list', 'member' => [ 'shape' => 'AppliedExtension', ], ], 'Arn' => [ 'type' => 'string', 'max' => 2048, 'min' => 20, 'pattern' => 'arn:(aws[a-zA-Z-]*)?:[a-z]+:([a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\\\d{1})?:(\\\\d{12})?:[a-zA-Z0-9-_/:.]+', ], 'BadRequestDetails' => [ 'type' => 'structure', 'members' => [ 'InvalidConfiguration' => [ 'shape' => 'InvalidConfigurationDetailList', ], ], 'union' => true, ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'String', ], 'Reason' => [ 'shape' => 'BadRequestReason', ], 'Details' => [ 'shape' => 'BadRequestDetails', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'BadRequestReason' => [ 'type' => 'string', 'enum' => [ 'InvalidConfiguration', ], ], 'Blob' => [ 'type' => 'blob', 'sensitive' => true, ], 'Boolean' => [ 'type' => 'boolean', ], 'BytesMeasure' => [ 'type' => 'string', 'enum' => [ 'KILOBYTES', ], ], 'Configuration' => [ 'type' => 'structure', 'members' => [ 'Content' => [ 'shape' => 'Blob', ], 'ConfigurationVersion' => [ 'shape' => 'Version', 'location' => 'header', 'locationName' => 'Configuration-Version', ], 'ContentType' => [ 'shape' => 'String', 'location' => 'header', 'locationName' => 'Content-Type', ], ], 'payload' => 'Content', ], 'ConfigurationProfile' => [ 'type' => 'structure', 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', ], 'Id' => [ 'shape' => 'Id', ], 'Name' => [ 'shape' => 'LongName', ], 'Description' => [ 'shape' => 'Description', ], 'LocationUri' => [ 'shape' => 'Uri', ], 'RetrievalRoleArn' => [ 'shape' => 'RoleArn', ], 'Validators' => [ 'shape' => 'ValidatorList', ], 'Type' => [ 'shape' => 'ConfigurationProfileType', ], ], ], 'ConfigurationProfileSummary' => [ 'type' => 'structure', 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', ], 'Id' => [ 'shape' => 'Id', ], 'Name' => [ 'shape' => 'LongName', ], 'LocationUri' => [ 'shape' => 'Uri', ], 'ValidatorTypes' => [ 'shape' => 'ValidatorTypeList', ], 'Type' => [ 'shape' => 'ConfigurationProfileType', ], ], ], 'ConfigurationProfileSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConfigurationProfileSummary', ], ], 'ConfigurationProfileType' => [ 'type' => 'string', 'pattern' => '^[a-zA-Z\\\\.]+', ], 'ConfigurationProfiles' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => 'ConfigurationProfileSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ConflictException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'CreateApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'Tags' => [ 'shape' => 'TagMap', ], ], ], 'CreateConfigurationProfileRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'Name', 'LocationUri', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'Name' => [ 'shape' => 'LongName', ], 'Description' => [ 'shape' => 'Description', ], 'LocationUri' => [ 'shape' => 'Uri', ], 'RetrievalRoleArn' => [ 'shape' => 'RoleArn', ], 'Validators' => [ 'shape' => 'ValidatorList', ], 'Tags' => [ 'shape' => 'TagMap', ], 'Type' => [ 'shape' => 'ConfigurationProfileType', ], ], ], 'CreateDeploymentStrategyRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'DeploymentDurationInMinutes', 'GrowthFactor', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'DeploymentDurationInMinutes' => [ 'shape' => 'MinutesBetween0And24Hours', 'box' => true, ], 'FinalBakeTimeInMinutes' => [ 'shape' => 'MinutesBetween0And24Hours', ], 'GrowthFactor' => [ 'shape' => 'GrowthFactor', 'box' => true, ], 'GrowthType' => [ 'shape' => 'GrowthType', ], 'ReplicateTo' => [ 'shape' => 'ReplicateTo', ], 'Tags' => [ 'shape' => 'TagMap', ], ], ], 'CreateEnvironmentRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'Name', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'Monitors' => [ 'shape' => 'MonitorList', ], 'Tags' => [ 'shape' => 'TagMap', ], ], ], 'CreateExtensionAssociationRequest' => [ 'type' => 'structure', 'required' => [ 'ExtensionIdentifier', 'ResourceIdentifier', ], 'members' => [ 'ExtensionIdentifier' => [ 'shape' => 'Identifier', ], 'ExtensionVersionNumber' => [ 'shape' => 'Integer', 'box' => true, ], 'ResourceIdentifier' => [ 'shape' => 'Identifier', ], 'Parameters' => [ 'shape' => 'ParameterValueMap', ], 'Tags' => [ 'shape' => 'TagMap', ], ], ], 'CreateExtensionRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'Actions', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'Actions' => [ 'shape' => 'ActionsMap', ], 'Parameters' => [ 'shape' => 'ParameterMap', ], 'Tags' => [ 'shape' => 'TagMap', ], 'LatestVersionNumber' => [ 'shape' => 'Integer', 'box' => true, 'location' => 'header', 'locationName' => 'Latest-Version-Number', ], ], ], 'CreateHostedConfigurationVersionRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'ConfigurationProfileId', 'Content', 'ContentType', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'ConfigurationProfileId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ConfigurationProfileId', ], 'Description' => [ 'shape' => 'Description', 'location' => 'header', 'locationName' => 'Description', ], 'Content' => [ 'shape' => 'Blob', ], 'ContentType' => [ 'shape' => 'StringWithLengthBetween1And255', 'location' => 'header', 'locationName' => 'Content-Type', ], 'LatestVersionNumber' => [ 'shape' => 'Integer', 'box' => true, 'location' => 'header', 'locationName' => 'Latest-Version-Number', ], 'VersionLabel' => [ 'shape' => 'VersionLabel', 'location' => 'header', 'locationName' => 'VersionLabel', ], ], 'payload' => 'Content', ], 'DeleteApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], ], ], 'DeleteConfigurationProfileRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'ConfigurationProfileId', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'ConfigurationProfileId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ConfigurationProfileId', ], ], ], 'DeleteDeploymentStrategyRequest' => [ 'type' => 'structure', 'required' => [ 'DeploymentStrategyId', ], 'members' => [ 'DeploymentStrategyId' => [ 'shape' => 'DeploymentStrategyId', 'location' => 'uri', 'locationName' => 'DeploymentStrategyId', ], ], ], 'DeleteEnvironmentRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'EnvironmentId', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'EnvironmentId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'EnvironmentId', ], ], ], 'DeleteExtensionAssociationRequest' => [ 'type' => 'structure', 'required' => [ 'ExtensionAssociationId', ], 'members' => [ 'ExtensionAssociationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ExtensionAssociationId', ], ], ], 'DeleteExtensionRequest' => [ 'type' => 'structure', 'required' => [ 'ExtensionIdentifier', ], 'members' => [ 'ExtensionIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'ExtensionIdentifier', ], 'VersionNumber' => [ 'shape' => 'Integer', 'box' => true, 'location' => 'querystring', 'locationName' => 'version', ], ], ], 'DeleteHostedConfigurationVersionRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'ConfigurationProfileId', 'VersionNumber', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'ConfigurationProfileId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ConfigurationProfileId', ], 'VersionNumber' => [ 'shape' => 'Integer', 'location' => 'uri', 'locationName' => 'VersionNumber', ], ], ], 'Deployment' => [ 'type' => 'structure', 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', ], 'EnvironmentId' => [ 'shape' => 'Id', ], 'DeploymentStrategyId' => [ 'shape' => 'Id', ], 'ConfigurationProfileId' => [ 'shape' => 'Id', ], 'DeploymentNumber' => [ 'shape' => 'Integer', ], 'ConfigurationName' => [ 'shape' => 'Name', ], 'ConfigurationLocationUri' => [ 'shape' => 'Uri', ], 'ConfigurationVersion' => [ 'shape' => 'Version', ], 'Description' => [ 'shape' => 'Description', ], 'DeploymentDurationInMinutes' => [ 'shape' => 'MinutesBetween0And24Hours', ], 'GrowthType' => [ 'shape' => 'GrowthType', ], 'GrowthFactor' => [ 'shape' => 'Percentage', ], 'FinalBakeTimeInMinutes' => [ 'shape' => 'MinutesBetween0And24Hours', ], 'State' => [ 'shape' => 'DeploymentState', ], 'EventLog' => [ 'shape' => 'DeploymentEvents', ], 'PercentageComplete' => [ 'shape' => 'Percentage', ], 'StartedAt' => [ 'shape' => 'Iso8601DateTime', ], 'CompletedAt' => [ 'shape' => 'Iso8601DateTime', ], 'AppliedExtensions' => [ 'shape' => 'AppliedExtensions', ], 'KmsKeyArn' => [ 'shape' => 'Arn', ], 'KmsKeyIdentifier' => [ 'shape' => 'Identifier', ], ], ], 'DeploymentEvent' => [ 'type' => 'structure', 'members' => [ 'EventType' => [ 'shape' => 'DeploymentEventType', ], 'TriggeredBy' => [ 'shape' => 'TriggeredBy', ], 'Description' => [ 'shape' => 'Description', ], 'ActionInvocations' => [ 'shape' => 'ActionInvocations', ], 'OccurredAt' => [ 'shape' => 'Iso8601DateTime', ], ], ], 'DeploymentEventType' => [ 'type' => 'string', 'enum' => [ 'PERCENTAGE_UPDATED', 'ROLLBACK_STARTED', 'ROLLBACK_COMPLETED', 'BAKE_TIME_STARTED', 'DEPLOYMENT_STARTED', 'DEPLOYMENT_COMPLETED', ], ], 'DeploymentEvents' => [ 'type' => 'list', 'member' => [ 'shape' => 'DeploymentEvent', ], ], 'DeploymentList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DeploymentSummary', ], ], 'DeploymentState' => [ 'type' => 'string', 'enum' => [ 'BAKING', 'VALIDATING', 'DEPLOYING', 'COMPLETE', 'ROLLING_BACK', 'ROLLED_BACK', ], ], 'DeploymentStrategies' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => 'DeploymentStrategyList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'DeploymentStrategy' => [ 'type' => 'structure', 'members' => [ 'Id' => [ 'shape' => 'Id', ], 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'DeploymentDurationInMinutes' => [ 'shape' => 'MinutesBetween0And24Hours', ], 'GrowthType' => [ 'shape' => 'GrowthType', ], 'GrowthFactor' => [ 'shape' => 'Percentage', ], 'FinalBakeTimeInMinutes' => [ 'shape' => 'MinutesBetween0And24Hours', ], 'ReplicateTo' => [ 'shape' => 'ReplicateTo', ], ], ], 'DeploymentStrategyId' => [ 'type' => 'string', 'pattern' => '(^[a-z0-9]{4,7}$|^AppConfig\\\\.[A-Za-z0-9]{9,40}$)', ], 'DeploymentStrategyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DeploymentStrategy', ], ], 'DeploymentSummary' => [ 'type' => 'structure', 'members' => [ 'DeploymentNumber' => [ 'shape' => 'Integer', ], 'ConfigurationName' => [ 'shape' => 'Name', ], 'ConfigurationVersion' => [ 'shape' => 'Version', ], 'DeploymentDurationInMinutes' => [ 'shape' => 'MinutesBetween0And24Hours', ], 'GrowthType' => [ 'shape' => 'GrowthType', ], 'GrowthFactor' => [ 'shape' => 'Percentage', ], 'FinalBakeTimeInMinutes' => [ 'shape' => 'MinutesBetween0And24Hours', ], 'State' => [ 'shape' => 'DeploymentState', ], 'PercentageComplete' => [ 'shape' => 'Percentage', ], 'StartedAt' => [ 'shape' => 'Iso8601DateTime', ], 'CompletedAt' => [ 'shape' => 'Iso8601DateTime', ], ], ], 'Deployments' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => 'DeploymentList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'Description' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, ], 'Environment' => [ 'type' => 'structure', 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', ], 'Id' => [ 'shape' => 'Id', ], 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'State' => [ 'shape' => 'EnvironmentState', ], 'Monitors' => [ 'shape' => 'MonitorList', ], ], ], 'EnvironmentList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Environment', ], ], 'EnvironmentState' => [ 'type' => 'string', 'enum' => [ 'READY_FOR_DEPLOYMENT', 'DEPLOYING', 'ROLLING_BACK', 'ROLLED_BACK', ], ], 'Environments' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => 'EnvironmentList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'Extension' => [ 'type' => 'structure', 'members' => [ 'Id' => [ 'shape' => 'Id', ], 'Name' => [ 'shape' => 'Name', ], 'VersionNumber' => [ 'shape' => 'Integer', ], 'Arn' => [ 'shape' => 'Arn', ], 'Description' => [ 'shape' => 'Description', ], 'Actions' => [ 'shape' => 'ActionsMap', ], 'Parameters' => [ 'shape' => 'ParameterMap', ], ], ], 'ExtensionAssociation' => [ 'type' => 'structure', 'members' => [ 'Id' => [ 'shape' => 'Identifier', ], 'ExtensionArn' => [ 'shape' => 'Arn', ], 'ResourceArn' => [ 'shape' => 'Arn', ], 'Arn' => [ 'shape' => 'Arn', ], 'Parameters' => [ 'shape' => 'ParameterValueMap', ], 'ExtensionVersionNumber' => [ 'shape' => 'Integer', ], ], ], 'ExtensionAssociationSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'ExtensionAssociationSummary', ], ], 'ExtensionAssociationSummary' => [ 'type' => 'structure', 'members' => [ 'Id' => [ 'shape' => 'Identifier', ], 'ExtensionArn' => [ 'shape' => 'Arn', ], 'ResourceArn' => [ 'shape' => 'Arn', ], ], ], 'ExtensionAssociations' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => 'ExtensionAssociationSummaries', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ExtensionSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'ExtensionSummary', ], ], 'ExtensionSummary' => [ 'type' => 'structure', 'members' => [ 'Id' => [ 'shape' => 'Id', ], 'Name' => [ 'shape' => 'Name', ], 'VersionNumber' => [ 'shape' => 'Integer', ], 'Arn' => [ 'shape' => 'Arn', ], 'Description' => [ 'shape' => 'Description', ], ], ], 'Extensions' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => 'ExtensionSummaries', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'Float' => [ 'type' => 'float', ], 'GetApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], ], ], 'GetConfigurationProfileRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'ConfigurationProfileId', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'ConfigurationProfileId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ConfigurationProfileId', ], ], ], 'GetConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'Application', 'Environment', 'Configuration', 'ClientId', ], 'members' => [ 'Application' => [ 'shape' => 'StringWithLengthBetween1And64', 'location' => 'uri', 'locationName' => 'Application', ], 'Environment' => [ 'shape' => 'StringWithLengthBetween1And64', 'location' => 'uri', 'locationName' => 'Environment', ], 'Configuration' => [ 'shape' => 'StringWithLengthBetween1And64', 'location' => 'uri', 'locationName' => 'Configuration', ], 'ClientId' => [ 'shape' => 'StringWithLengthBetween1And64', 'location' => 'querystring', 'locationName' => 'client_id', ], 'ClientConfigurationVersion' => [ 'shape' => 'Version', 'location' => 'querystring', 'locationName' => 'client_configuration_version', ], ], ], 'GetDeploymentRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'EnvironmentId', 'DeploymentNumber', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'EnvironmentId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'EnvironmentId', ], 'DeploymentNumber' => [ 'shape' => 'Integer', 'box' => true, 'location' => 'uri', 'locationName' => 'DeploymentNumber', ], ], ], 'GetDeploymentStrategyRequest' => [ 'type' => 'structure', 'required' => [ 'DeploymentStrategyId', ], 'members' => [ 'DeploymentStrategyId' => [ 'shape' => 'DeploymentStrategyId', 'location' => 'uri', 'locationName' => 'DeploymentStrategyId', ], ], ], 'GetEnvironmentRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'EnvironmentId', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'EnvironmentId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'EnvironmentId', ], ], ], 'GetExtensionAssociationRequest' => [ 'type' => 'structure', 'required' => [ 'ExtensionAssociationId', ], 'members' => [ 'ExtensionAssociationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ExtensionAssociationId', ], ], ], 'GetExtensionRequest' => [ 'type' => 'structure', 'required' => [ 'ExtensionIdentifier', ], 'members' => [ 'ExtensionIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'ExtensionIdentifier', ], 'VersionNumber' => [ 'shape' => 'Integer', 'box' => true, 'location' => 'querystring', 'locationName' => 'version_number', ], ], ], 'GetHostedConfigurationVersionRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'ConfigurationProfileId', 'VersionNumber', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'ConfigurationProfileId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ConfigurationProfileId', ], 'VersionNumber' => [ 'shape' => 'Integer', 'location' => 'uri', 'locationName' => 'VersionNumber', ], ], ], 'GrowthFactor' => [ 'type' => 'float', 'max' => 100, 'min' => 1, ], 'GrowthType' => [ 'type' => 'string', 'enum' => [ 'LINEAR', 'EXPONENTIAL', ], ], 'HostedConfigurationVersion' => [ 'type' => 'structure', 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'header', 'locationName' => 'Application-Id', ], 'ConfigurationProfileId' => [ 'shape' => 'Id', 'location' => 'header', 'locationName' => 'Configuration-Profile-Id', ], 'VersionNumber' => [ 'shape' => 'Integer', 'location' => 'header', 'locationName' => 'Version-Number', ], 'Description' => [ 'shape' => 'Description', 'location' => 'header', 'locationName' => 'Description', ], 'Content' => [ 'shape' => 'Blob', ], 'ContentType' => [ 'shape' => 'StringWithLengthBetween1And255', 'location' => 'header', 'locationName' => 'Content-Type', ], 'VersionLabel' => [ 'shape' => 'VersionLabel', 'location' => 'header', 'locationName' => 'VersionLabel', ], ], 'payload' => 'Content', ], 'HostedConfigurationVersionSummary' => [ 'type' => 'structure', 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', ], 'ConfigurationProfileId' => [ 'shape' => 'Id', ], 'VersionNumber' => [ 'shape' => 'Integer', ], 'Description' => [ 'shape' => 'Description', ], 'ContentType' => [ 'shape' => 'StringWithLengthBetween1And255', ], 'VersionLabel' => [ 'shape' => 'VersionLabel', ], ], ], 'HostedConfigurationVersionSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'HostedConfigurationVersionSummary', ], ], 'HostedConfigurationVersions' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => 'HostedConfigurationVersionSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'Id' => [ 'type' => 'string', 'pattern' => '[a-z0-9]{4,7}', ], 'Identifier' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, ], 'Integer' => [ 'type' => 'integer', ], 'InternalServerException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'InvalidConfigurationDetail' => [ 'type' => 'structure', 'members' => [ 'Constraint' => [ 'shape' => 'String', ], 'Location' => [ 'shape' => 'String', ], 'Reason' => [ 'shape' => 'String', ], 'Type' => [ 'shape' => 'String', ], 'Value' => [ 'shape' => 'String', ], ], ], 'InvalidConfigurationDetailList' => [ 'type' => 'list', 'member' => [ 'shape' => 'InvalidConfigurationDetail', ], ], 'Iso8601DateTime' => [ 'type' => 'timestamp', 'timestampFormat' => 'iso8601', ], 'ListApplicationsRequest' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => 'MaxResults', 'box' => true, 'location' => 'querystring', 'locationName' => 'max_results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next_token', ], ], ], 'ListConfigurationProfilesRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'box' => true, 'location' => 'querystring', 'locationName' => 'max_results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next_token', ], 'Type' => [ 'shape' => 'ConfigurationProfileType', 'location' => 'querystring', 'locationName' => 'type', ], ], ], 'ListDeploymentStrategiesRequest' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => 'MaxResults', 'box' => true, 'location' => 'querystring', 'locationName' => 'max_results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next_token', ], ], ], 'ListDeploymentsRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'EnvironmentId', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'EnvironmentId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'EnvironmentId', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'box' => true, 'location' => 'querystring', 'locationName' => 'max_results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next_token', ], ], ], 'ListEnvironmentsRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'box' => true, 'location' => 'querystring', 'locationName' => 'max_results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next_token', ], ], ], 'ListExtensionAssociationsRequest' => [ 'type' => 'structure', 'members' => [ 'ResourceIdentifier' => [ 'shape' => 'Arn', 'location' => 'querystring', 'locationName' => 'resource_identifier', ], 'ExtensionIdentifier' => [ 'shape' => 'Identifier', 'location' => 'querystring', 'locationName' => 'extension_identifier', ], 'ExtensionVersionNumber' => [ 'shape' => 'Integer', 'box' => true, 'location' => 'querystring', 'locationName' => 'extension_version_number', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'box' => true, 'location' => 'querystring', 'locationName' => 'max_results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next_token', ], ], ], 'ListExtensionsRequest' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => 'MaxResults', 'box' => true, 'location' => 'querystring', 'locationName' => 'max_results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next_token', ], 'Name' => [ 'shape' => 'QueryName', 'location' => 'querystring', 'locationName' => 'name', ], ], ], 'ListHostedConfigurationVersionsRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'ConfigurationProfileId', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'ConfigurationProfileId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ConfigurationProfileId', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'box' => true, 'location' => 'querystring', 'locationName' => 'max_results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next_token', ], 'VersionLabel' => [ 'shape' => 'QueryName', 'location' => 'querystring', 'locationName' => 'version_label', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', 'location' => 'uri', 'locationName' => 'ResourceArn', ], ], ], 'LongName' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'MaxResults' => [ 'type' => 'integer', 'max' => 50, 'min' => 1, ], 'MinutesBetween0And24Hours' => [ 'type' => 'integer', 'max' => 1440, 'min' => 0, ], 'Monitor' => [ 'type' => 'structure', 'required' => [ 'AlarmArn', ], 'members' => [ 'AlarmArn' => [ 'shape' => 'StringWithLengthBetween1And2048', ], 'AlarmRoleArn' => [ 'shape' => 'RoleArn', ], ], ], 'MonitorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Monitor', ], 'max' => 5, 'min' => 0, ], 'Name' => [ 'type' => 'string', 'max' => 64, 'min' => 1, ], 'NextToken' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, ], 'Parameter' => [ 'type' => 'structure', 'members' => [ 'Description' => [ 'shape' => 'Description', ], 'Required' => [ 'shape' => 'Boolean', ], ], ], 'ParameterMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'Name', ], 'value' => [ 'shape' => 'Parameter', ], 'max' => 5, 'min' => 1, ], 'ParameterValueMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'Name', ], 'value' => [ 'shape' => 'StringWithLengthBetween1And2048', ], 'max' => 5, 'min' => 0, ], 'PayloadTooLargeException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'String', ], 'Measure' => [ 'shape' => 'BytesMeasure', ], 'Limit' => [ 'shape' => 'Float', ], 'Size' => [ 'shape' => 'Float', ], ], 'error' => [ 'httpStatusCode' => 413, ], 'exception' => true, ], 'Percentage' => [ 'type' => 'float', 'max' => 100, 'min' => 1, ], 'QueryName' => [ 'type' => 'string', 'max' => 64, 'min' => 1, ], 'ReplicateTo' => [ 'type' => 'string', 'enum' => [ 'NONE', 'SSM_DOCUMENT', ], ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'String', ], 'ResourceName' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'ResourceTags' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagMap', ], ], ], 'RoleArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 20, 'pattern' => '^((arn):(aws|aws-cn|aws-iso|aws-iso-[a-z]{1}|aws-us-gov):(iam)::\\\\d{12}:role[/].*)$', ], 'ServiceQuotaExceededException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 402, ], 'exception' => true, ], 'StartDeploymentRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'EnvironmentId', 'DeploymentStrategyId', 'ConfigurationProfileId', 'ConfigurationVersion', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'EnvironmentId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'EnvironmentId', ], 'DeploymentStrategyId' => [ 'shape' => 'DeploymentStrategyId', ], 'ConfigurationProfileId' => [ 'shape' => 'Id', ], 'ConfigurationVersion' => [ 'shape' => 'Version', ], 'Description' => [ 'shape' => 'Description', ], 'Tags' => [ 'shape' => 'TagMap', ], 'KmsKeyIdentifier' => [ 'shape' => 'Identifier', ], ], ], 'StopDeploymentRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'EnvironmentId', 'DeploymentNumber', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'EnvironmentId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'EnvironmentId', ], 'DeploymentNumber' => [ 'shape' => 'Integer', 'box' => true, 'location' => 'uri', 'locationName' => 'DeploymentNumber', ], ], ], 'String' => [ 'type' => 'string', ], 'StringWithLengthBetween0And32768' => [ 'type' => 'string', 'max' => 32768, 'min' => 0, 'sensitive' => true, ], 'StringWithLengthBetween1And2048' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, ], 'StringWithLengthBetween1And255' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'StringWithLengthBetween1And64' => [ 'type' => 'string', 'max' => 64, 'min' => 1, ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 50, 'min' => 0, ], 'TagMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'TagKey', ], 'value' => [ 'shape' => 'TagValue', ], 'max' => 50, 'min' => 0, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'Tags', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', 'location' => 'uri', 'locationName' => 'ResourceArn', ], 'Tags' => [ 'shape' => 'TagMap', ], ], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, ], 'TriggeredBy' => [ 'type' => 'string', 'enum' => [ 'USER', 'APPCONFIG', 'CLOUDWATCH_ALARM', 'INTERNAL_ERROR', ], ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'TagKeys', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', 'location' => 'uri', 'locationName' => 'ResourceArn', ], 'TagKeys' => [ 'shape' => 'TagKeyList', 'location' => 'querystring', 'locationName' => 'tagKeys', ], ], ], 'UpdateApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], ], ], 'UpdateConfigurationProfileRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'ConfigurationProfileId', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'ConfigurationProfileId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ConfigurationProfileId', ], 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'RetrievalRoleArn' => [ 'shape' => 'RoleArn', ], 'Validators' => [ 'shape' => 'ValidatorList', ], ], ], 'UpdateDeploymentStrategyRequest' => [ 'type' => 'structure', 'required' => [ 'DeploymentStrategyId', ], 'members' => [ 'DeploymentStrategyId' => [ 'shape' => 'DeploymentStrategyId', 'location' => 'uri', 'locationName' => 'DeploymentStrategyId', ], 'Description' => [ 'shape' => 'Description', ], 'DeploymentDurationInMinutes' => [ 'shape' => 'MinutesBetween0And24Hours', 'box' => true, ], 'FinalBakeTimeInMinutes' => [ 'shape' => 'MinutesBetween0And24Hours', 'box' => true, ], 'GrowthFactor' => [ 'shape' => 'GrowthFactor', 'box' => true, ], 'GrowthType' => [ 'shape' => 'GrowthType', ], ], ], 'UpdateEnvironmentRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'EnvironmentId', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'EnvironmentId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'EnvironmentId', ], 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'Monitors' => [ 'shape' => 'MonitorList', ], ], ], 'UpdateExtensionAssociationRequest' => [ 'type' => 'structure', 'required' => [ 'ExtensionAssociationId', ], 'members' => [ 'ExtensionAssociationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ExtensionAssociationId', ], 'Parameters' => [ 'shape' => 'ParameterValueMap', ], ], ], 'UpdateExtensionRequest' => [ 'type' => 'structure', 'required' => [ 'ExtensionIdentifier', ], 'members' => [ 'ExtensionIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'ExtensionIdentifier', ], 'Description' => [ 'shape' => 'Description', ], 'Actions' => [ 'shape' => 'ActionsMap', ], 'Parameters' => [ 'shape' => 'ParameterMap', ], 'VersionNumber' => [ 'shape' => 'Integer', 'box' => true, ], ], ], 'Uri' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, ], 'ValidateConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationId', 'ConfigurationProfileId', 'ConfigurationVersion', ], 'members' => [ 'ApplicationId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ApplicationId', ], 'ConfigurationProfileId' => [ 'shape' => 'Id', 'location' => 'uri', 'locationName' => 'ConfigurationProfileId', ], 'ConfigurationVersion' => [ 'shape' => 'Version', 'location' => 'querystring', 'locationName' => 'configuration_version', ], ], ], 'Validator' => [ 'type' => 'structure', 'required' => [ 'Type', 'Content', ], 'members' => [ 'Type' => [ 'shape' => 'ValidatorType', ], 'Content' => [ 'shape' => 'StringWithLengthBetween0And32768', ], ], ], 'ValidatorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Validator', ], 'max' => 2, 'min' => 0, ], 'ValidatorType' => [ 'type' => 'string', 'enum' => [ 'JSON_SCHEMA', 'LAMBDA', ], ], 'ValidatorTypeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ValidatorType', ], 'max' => 2, 'min' => 0, ], 'Version' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, ], 'VersionLabel' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '.*[^0-9].*', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appconfig/2019-10-09/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>Use AppConfig, a capability of Amazon Web Services Systems Manager, to create, manage, and quickly deploy application configurations. AppConfig supports controlled deployments to applications of any size and includes built-in validation checks and monitoring. You can use AppConfig with applications hosted on Amazon EC2 instances, Lambda, containers, mobile applications, or IoT devices.</p> <p>To prevent errors when deploying application configurations, especially for production systems where a simple typo could cause an unexpected outage, AppConfig includes validators. A validator provides a syntactic or semantic check to ensure that the configuration you want to deploy works as intended. To validate your application configuration data, you provide a schema or an Amazon Web Services Lambda function that runs against the configuration. The configuration deployment or update can only proceed when the configuration data is valid.</p> <p>During a configuration deployment, AppConfig monitors the application to ensure that the deployment is successful. If the system encounters an error, AppConfig rolls back the change to minimize impact for your application users. You can configure a deployment strategy for each application or environment that includes deployment criteria, including velocity, bake time, and alarms to monitor. Similar to error monitoring, if a deployment triggers an alarm, AppConfig automatically rolls back to the previous version. </p> <p>AppConfig supports multiple use cases. Here are some examples:</p> <ul> <li> <p> <b>Feature flags</b>: Use AppConfig to turn on new features that require a timely deployment, such as a product launch or announcement. </p> </li> <li> <p> <b>Application tuning</b>: Use AppConfig to carefully introduce changes to your application that can only be tested with production traffic.</p> </li> <li> <p> <b>Allow list</b>: Use AppConfig to allow premium subscribers to access paid content. </p> </li> <li> <p> <b>Operational issues</b>: Use AppConfig to reduce stress on your application when a dependency or other external factor impacts the system.</p> </li> </ul> <p>This reference is intended to be used with the <a href=\"http://docs.aws.amazon.com/appconfig/latest/userguide/what-is-appconfig.html\">AppConfig User Guide</a>.</p>', 'operations' => [ 'CreateApplication' => '<p>Creates an application. In AppConfig, an application is simply an organizational construct like a folder. This organizational construct has a relationship with some unit of executable code. For example, you could create an application called MyMobileApp to organize and manage configuration data for a mobile application installed by your users.</p>', 'CreateConfigurationProfile' => '<p>Creates a configuration profile, which is information that enables AppConfig to access the configuration source. Valid configuration sources include the following:</p> <ul> <li> <p>Configuration data in YAML, JSON, and other formats stored in the AppConfig hosted configuration store</p> </li> <li> <p>Configuration data stored as objects in an Amazon Simple Storage Service (Amazon S3) bucket</p> </li> <li> <p>Pipelines stored in CodePipeline</p> </li> <li> <p>Secrets stored in Secrets Manager</p> </li> <li> <p>Standard and secure string parameters stored in Amazon Web Services Systems Manager Parameter Store</p> </li> <li> <p>Configuration data in SSM documents stored in the Systems Manager document store</p> </li> </ul> <p>A configuration profile includes the following information:</p> <ul> <li> <p>The URI location of the configuration data.</p> </li> <li> <p>The Identity and Access Management (IAM) role that provides access to the configuration data.</p> </li> <li> <p>A validator for the configuration data. Available validators include either a JSON Schema or an Amazon Web Services Lambda function.</p> </li> </ul> <p>For more information, see <a href=\"http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-configuration-and-profile.html\">Create a Configuration and a Configuration Profile</a> in the <i>AppConfig User Guide</i>.</p>', 'CreateDeploymentStrategy' => '<p>Creates a deployment strategy that defines important criteria for rolling out your configuration to the designated targets. A deployment strategy includes the overall duration required, a percentage of targets to receive the deployment during each interval, an algorithm that defines how percentage grows, and bake time.</p>', 'CreateEnvironment' => '<p>Creates an environment. For each application, you define one or more environments. An environment is a deployment group of AppConfig targets, such as applications in a <code>Beta</code> or <code>Production</code> environment. You can also define environments for application subcomponents such as the <code>Web</code>, <code>Mobile</code> and <code>Back-end</code> components for your application. You can configure Amazon CloudWatch alarms for each environment. The system monitors alarms during a configuration deployment. If an alarm is triggered, the system rolls back the configuration.</p>', 'CreateExtension' => '<p>Creates an AppConfig extension. An extension augments your ability to inject logic or behavior at different points during the AppConfig workflow of creating or deploying a configuration.</p> <p>You can create your own extensions or use the Amazon Web Services authored extensions provided by AppConfig. For most use cases, to create your own extension, you must create an Lambda function to perform any computation and processing defined in the extension. For more information about extensions, see <a href=\"https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html\">Working with AppConfig extensions</a> in the <i>AppConfig User Guide</i>.</p>', 'CreateExtensionAssociation' => '<p>When you create an extension or configure an Amazon Web Services authored extension, you associate the extension with an AppConfig application, environment, or configuration profile. For example, you can choose to run the <code>AppConfig deployment events to Amazon SNS</code> Amazon Web Services authored extension and receive notifications on an Amazon SNS topic anytime a configuration deployment is started for a specific application. Defining which extension to associate with an AppConfig resource is called an <i>extension association</i>. An extension association is a specified relationship between an extension and an AppConfig resource, such as an application or a configuration profile. For more information about extensions and associations, see <a href=\"https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html\">Working with AppConfig extensions</a> in the <i>AppConfig User Guide</i>.</p>', 'CreateHostedConfigurationVersion' => '<p>Creates a new configuration in the AppConfig hosted configuration store.</p>', 'DeleteApplication' => '<p>Deletes an application. Deleting an application does not delete a configuration from a host.</p>', 'DeleteConfigurationProfile' => '<p>Deletes a configuration profile. Deleting a configuration profile does not delete a configuration from a host.</p>', 'DeleteDeploymentStrategy' => '<p>Deletes a deployment strategy. Deleting a deployment strategy does not delete a configuration from a host.</p>', 'DeleteEnvironment' => '<p>Deletes an environment. Deleting an environment does not delete a configuration from a host.</p>', 'DeleteExtension' => '<p>Deletes an AppConfig extension. You must delete all associations to an extension before you delete the extension.</p>', 'DeleteExtensionAssociation' => '<p>Deletes an extension association. This action doesn\\'t delete extensions defined in the association.</p>', 'DeleteHostedConfigurationVersion' => '<p>Deletes a version of a configuration from the AppConfig hosted configuration store.</p>', 'GetApplication' => '<p>Retrieves information about an application.</p>', 'GetConfiguration' => '<p>(Deprecated) Retrieves the latest deployed configuration.</p> <important> <p>Note the following important information.</p> <ul> <li> <p>This API action is deprecated. Calls to receive configuration data should use the <a href=\"https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_StartConfigurationSession.html\">StartConfigurationSession</a> and <a href=\"https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_GetLatestConfiguration.html\">GetLatestConfiguration</a> APIs instead. </p> </li> <li> <p> <code>GetConfiguration</code> is a priced call. For more information, see <a href=\"https://aws.amazon.com/systems-manager/pricing/\">Pricing</a>.</p> </li> </ul> </important>', 'GetConfigurationProfile' => '<p>Retrieves information about a configuration profile.</p>', 'GetDeployment' => '<p>Retrieves information about a configuration deployment.</p>', 'GetDeploymentStrategy' => '<p>Retrieves information about a deployment strategy. A deployment strategy defines important criteria for rolling out your configuration to the designated targets. A deployment strategy includes the overall duration required, a percentage of targets to receive the deployment during each interval, an algorithm that defines how percentage grows, and bake time.</p>', 'GetEnvironment' => '<p>Retrieves information about an environment. An environment is a deployment group of AppConfig applications, such as applications in a <code>Production</code> environment or in an <code>EU_Region</code> environment. Each configuration deployment targets an environment. You can enable one or more Amazon CloudWatch alarms for an environment. If an alarm is triggered during a deployment, AppConfig roles back the configuration.</p>', 'GetExtension' => '<p>Returns information about an AppConfig extension.</p>', 'GetExtensionAssociation' => '<p>Returns information about an AppConfig extension association. For more information about extensions and associations, see <a href=\"https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html\">Working with AppConfig extensions</a> in the <i>AppConfig User Guide</i>.</p>', 'GetHostedConfigurationVersion' => '<p>Retrieves information about a specific configuration version.</p>', 'ListApplications' => '<p>Lists all applications in your Amazon Web Services account.</p>', 'ListConfigurationProfiles' => '<p>Lists the configuration profiles for an application.</p>', 'ListDeploymentStrategies' => '<p>Lists deployment strategies.</p>', 'ListDeployments' => '<p>Lists the deployments for an environment in descending deployment number order.</p>', 'ListEnvironments' => '<p>Lists the environments for an application.</p>', 'ListExtensionAssociations' => '<p>Lists all AppConfig extension associations in the account. For more information about extensions and associations, see <a href=\"https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html\">Working with AppConfig extensions</a> in the <i>AppConfig User Guide</i>.</p>', 'ListExtensions' => '<p>Lists all custom and Amazon Web Services authored AppConfig extensions in the account. For more information about extensions, see <a href=\"https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html\">Working with AppConfig extensions</a> in the <i>AppConfig User Guide</i>.</p>', 'ListHostedConfigurationVersions' => '<p>Lists configurations stored in the AppConfig hosted configuration store by version.</p>', 'ListTagsForResource' => '<p>Retrieves the list of key-value tags assigned to the resource.</p>', 'StartDeployment' => '<p>Starts a deployment.</p>', 'StopDeployment' => '<p>Stops a deployment. This API action works only on deployments that have a status of <code>DEPLOYING</code>. This action moves the deployment to a status of <code>ROLLED_BACK</code>.</p>', 'TagResource' => '<p>Assigns metadata to an AppConfig resource. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define. You can specify a maximum of 50 tags for a resource.</p>', 'UntagResource' => '<p>Deletes a tag key and value from an AppConfig resource.</p>', 'UpdateApplication' => '<p>Updates an application.</p>', 'UpdateConfigurationProfile' => '<p>Updates a configuration profile.</p>', 'UpdateDeploymentStrategy' => '<p>Updates a deployment strategy.</p>', 'UpdateEnvironment' => '<p>Updates an environment.</p>', 'UpdateExtension' => '<p>Updates an AppConfig extension. For more information about extensions, see <a href=\"https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html\">Working with AppConfig extensions</a> in the <i>AppConfig User Guide</i>.</p>', 'UpdateExtensionAssociation' => '<p>Updates an association. For more information about extensions and associations, see <a href=\"https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html\">Working with AppConfig extensions</a> in the <i>AppConfig User Guide</i>.</p>', 'ValidateConfiguration' => '<p>Uses the validators in a configuration profile to validate a configuration.</p>', ], 'shapes' => [ 'Action' => [ 'base' => '<p>An action defines the tasks that the extension performs during the AppConfig workflow. Each action includes an action point such as <code>ON_CREATE_HOSTED_CONFIGURATION</code>, <code>PRE_DEPLOYMENT</code>, or <code>ON_DEPLOYMENT</code>. Each action also includes a name, a URI to an Lambda function, and an Amazon Resource Name (ARN) for an Identity and Access Management assume role. You specify the name, URI, and ARN for each <i>action point</i> defined in the extension. You can specify the following actions for an extension:</p> <ul> <li> <p> <code>PRE_CREATE_HOSTED_CONFIGURATION_VERSION</code> </p> </li> <li> <p> <code>PRE_START_DEPLOYMENT</code> </p> </li> <li> <p> <code>ON_DEPLOYMENT_START</code> </p> </li> <li> <p> <code>ON_DEPLOYMENT_STEP</code> </p> </li> <li> <p> <code>ON_DEPLOYMENT_BAKING</code> </p> </li> <li> <p> <code>ON_DEPLOYMENT_COMPLETE</code> </p> </li> <li> <p> <code>ON_DEPLOYMENT_ROLLED_BACK</code> </p> </li> </ul>', 'refs' => [ 'ActionList$member' => NULL, ], ], 'ActionInvocation' => [ 'base' => '<p>An extension that was invoked as part of a deployment event.</p>', 'refs' => [ 'ActionInvocations$member' => NULL, ], ], 'ActionInvocations' => [ 'base' => NULL, 'refs' => [ 'DeploymentEvent$ActionInvocations' => '<p>The list of extensions that were invoked as part of the deployment.</p>', ], ], 'ActionList' => [ 'base' => NULL, 'refs' => [ 'ActionsMap$value' => NULL, ], ], 'ActionPoint' => [ 'base' => NULL, 'refs' => [ 'ActionsMap$key' => NULL, ], ], 'ActionsMap' => [ 'base' => NULL, 'refs' => [ 'CreateExtensionRequest$Actions' => '<p>The actions defined in the extension.</p>', 'Extension$Actions' => '<p>The actions defined in the extension.</p>', 'UpdateExtensionRequest$Actions' => '<p>The actions defined in the extension.</p>', ], ], 'Application' => [ 'base' => NULL, 'refs' => [ 'ApplicationList$member' => NULL, ], ], 'ApplicationList' => [ 'base' => NULL, 'refs' => [ 'Applications$Items' => '<p>The elements from this collection.</p>', ], ], 'Applications' => [ 'base' => NULL, 'refs' => [], ], 'AppliedExtension' => [ 'base' => '<p>An extension that was invoked during a deployment.</p>', 'refs' => [ 'AppliedExtensions$member' => NULL, ], ], 'AppliedExtensions' => [ 'base' => NULL, 'refs' => [ 'Deployment$AppliedExtensions' => '<p>A list of extensions that were processed as part of the deployment. The extensions that were previously associated to the configuration profile, environment, or the application when <code>StartDeployment</code> was called.</p>', ], ], 'Arn' => [ 'base' => NULL, 'refs' => [ 'Action$RoleArn' => '<p>An Amazon Resource Name (ARN) for an Identity and Access Management assume role.</p>', 'ActionInvocation$RoleArn' => '<p>An Amazon Resource Name (ARN) for an Identity and Access Management assume role.</p>', 'Deployment$KmsKeyArn' => '<p>The Amazon Resource Name of the Key Management Service key used to encrypt configuration data. You can encrypt secrets stored in Secrets Manager, Amazon Simple Storage Service (Amazon S3) objects encrypted with SSE-KMS, or secure string parameters stored in Amazon Web Services Systems Manager Parameter Store. </p>', 'Extension$Arn' => '<p>The system-generated Amazon Resource Name (ARN) for the extension.</p>', 'ExtensionAssociation$ExtensionArn' => '<p>The ARN of the extension defined in the association.</p>', 'ExtensionAssociation$ResourceArn' => '<p>The ARNs of applications, configuration profiles, or environments defined in the association.</p>', 'ExtensionAssociation$Arn' => '<p>The system-generated Amazon Resource Name (ARN) for the extension.</p>', 'ExtensionAssociationSummary$ExtensionArn' => '<p>The system-generated Amazon Resource Name (ARN) for the extension.</p>', 'ExtensionAssociationSummary$ResourceArn' => '<p>The ARNs of applications, configuration profiles, or environments defined in the association.</p>', 'ExtensionSummary$Arn' => '<p>The system-generated Amazon Resource Name (ARN) for the extension.</p>', 'ListExtensionAssociationsRequest$ResourceIdentifier' => '<p>The ARN of an application, configuration profile, or environment.</p>', 'ListTagsForResourceRequest$ResourceArn' => '<p>The resource ARN.</p>', 'TagResourceRequest$ResourceArn' => '<p>The ARN of the resource for which to retrieve tags.</p>', 'UntagResourceRequest$ResourceArn' => '<p>The ARN of the resource for which to remove tags.</p>', ], ], 'BadRequestDetails' => [ 'base' => '<p>Detailed information about the input that failed to satisfy the constraints specified by a call.</p>', 'refs' => [ 'BadRequestException$Details' => NULL, ], ], 'BadRequestException' => [ 'base' => '<p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>', 'refs' => [], ], 'BadRequestReason' => [ 'base' => NULL, 'refs' => [ 'BadRequestException$Reason' => NULL, ], ], 'Blob' => [ 'base' => NULL, 'refs' => [ 'Configuration$Content' => '<p>The content of the configuration or the configuration data.</p> <important> <p>The <code>Content</code> attribute only contains data if the system finds new or updated configuration data. If there is no new or updated data and <code>ClientConfigurationVersion</code> matches the version of the current configuration, AppConfig returns a <code>204 No Content</code> HTTP response code and the <code>Content</code> value will be empty.</p> </important>', 'CreateHostedConfigurationVersionRequest$Content' => '<p>The content of the configuration or the configuration data.</p>', 'HostedConfigurationVersion$Content' => '<p>The content of the configuration or the configuration data.</p>', ], ], 'Boolean' => [ 'base' => NULL, 'refs' => [ 'Parameter$Required' => '<p>A parameter value must be specified in the extension association.</p>', ], ], 'BytesMeasure' => [ 'base' => NULL, 'refs' => [ 'PayloadTooLargeException$Measure' => NULL, ], ], 'Configuration' => [ 'base' => NULL, 'refs' => [], ], 'ConfigurationProfile' => [ 'base' => NULL, 'refs' => [], ], 'ConfigurationProfileSummary' => [ 'base' => '<p>A summary of a configuration profile.</p>', 'refs' => [ 'ConfigurationProfileSummaryList$member' => NULL, ], ], 'ConfigurationProfileSummaryList' => [ 'base' => NULL, 'refs' => [ 'ConfigurationProfiles$Items' => '<p>The elements from this collection.</p>', ], ], 'ConfigurationProfileType' => [ 'base' => NULL, 'refs' => [ 'ConfigurationProfile$Type' => '<p>The type of configurations contained in the profile. AppConfig supports <code>feature flags</code> and <code>freeform</code> configurations. We recommend you create feature flag configurations to enable or disable new features and freeform configurations to distribute configurations to an application. When calling this API, enter one of the following values for <code>Type</code>:</p> <p> <code>AWS.AppConfig.FeatureFlags</code> </p> <p> <code>AWS.Freeform</code> </p>', 'ConfigurationProfileSummary$Type' => '<p>The type of configurations contained in the profile. AppConfig supports <code>feature flags</code> and <code>freeform</code> configurations. We recommend you create feature flag configurations to enable or disable new features and freeform configurations to distribute configurations to an application. When calling this API, enter one of the following values for <code>Type</code>:</p> <p> <code>AWS.AppConfig.FeatureFlags</code> </p> <p> <code>AWS.Freeform</code> </p>', 'CreateConfigurationProfileRequest$Type' => '<p>The type of configurations contained in the profile. AppConfig supports <code>feature flags</code> and <code>freeform</code> configurations. We recommend you create feature flag configurations to enable or disable new features and freeform configurations to distribute configurations to an application. When calling this API, enter one of the following values for <code>Type</code>:</p> <p> <code>AWS.AppConfig.FeatureFlags</code> </p> <p> <code>AWS.Freeform</code> </p>', 'ListConfigurationProfilesRequest$Type' => '<p>A filter based on the type of configurations that the configuration profile contains. A configuration can be a feature flag or a freeform configuration.</p>', ], ], 'ConfigurationProfiles' => [ 'base' => NULL, 'refs' => [], ], 'ConflictException' => [ 'base' => '<p>The request could not be processed because of conflict in the current state of the resource.</p>', 'refs' => [], ], 'CreateApplicationRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateConfigurationProfileRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateDeploymentStrategyRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateEnvironmentRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateExtensionAssociationRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateExtensionRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateHostedConfigurationVersionRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteApplicationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteConfigurationProfileRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteDeploymentStrategyRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteEnvironmentRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteExtensionAssociationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteExtensionRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteHostedConfigurationVersionRequest' => [ 'base' => NULL, 'refs' => [], ], 'Deployment' => [ 'base' => NULL, 'refs' => [], ], 'DeploymentEvent' => [ 'base' => '<p>An object that describes a deployment event.</p>', 'refs' => [ 'DeploymentEvents$member' => NULL, ], ], 'DeploymentEventType' => [ 'base' => NULL, 'refs' => [ 'DeploymentEvent$EventType' => '<p>The type of deployment event. Deployment event types include the start, stop, or completion of a deployment; a percentage update; the start or stop of a bake period; and the start or completion of a rollback.</p>', ], ], 'DeploymentEvents' => [ 'base' => NULL, 'refs' => [ 'Deployment$EventLog' => '<p>A list containing all events related to a deployment. The most recent events are displayed first.</p>', ], ], 'DeploymentList' => [ 'base' => NULL, 'refs' => [ 'Deployments$Items' => '<p>The elements from this collection.</p>', ], ], 'DeploymentState' => [ 'base' => NULL, 'refs' => [ 'Deployment$State' => '<p>The state of the deployment.</p>', 'DeploymentSummary$State' => '<p>The state of the deployment.</p>', ], ], 'DeploymentStrategies' => [ 'base' => NULL, 'refs' => [], ], 'DeploymentStrategy' => [ 'base' => NULL, 'refs' => [ 'DeploymentStrategyList$member' => NULL, ], ], 'DeploymentStrategyId' => [ 'base' => NULL, 'refs' => [ 'DeleteDeploymentStrategyRequest$DeploymentStrategyId' => '<p>The ID of the deployment strategy you want to delete.</p>', 'GetDeploymentStrategyRequest$DeploymentStrategyId' => '<p>The ID of the deployment strategy to get.</p>', 'StartDeploymentRequest$DeploymentStrategyId' => '<p>The deployment strategy ID.</p>', 'UpdateDeploymentStrategyRequest$DeploymentStrategyId' => '<p>The deployment strategy ID.</p>', ], ], 'DeploymentStrategyList' => [ 'base' => NULL, 'refs' => [ 'DeploymentStrategies$Items' => '<p>The elements from this collection.</p>', ], ], 'DeploymentSummary' => [ 'base' => '<p>Information about the deployment.</p>', 'refs' => [ 'DeploymentList$member' => NULL, ], ], 'Deployments' => [ 'base' => NULL, 'refs' => [], ], 'Description' => [ 'base' => NULL, 'refs' => [ 'Action$Description' => '<p>Information about the action.</p>', 'Application$Description' => '<p>The description of the application.</p>', 'ConfigurationProfile$Description' => '<p>The configuration profile description.</p>', 'CreateApplicationRequest$Description' => '<p>A description of the application.</p>', 'CreateConfigurationProfileRequest$Description' => '<p>A description of the configuration profile.</p>', 'CreateDeploymentStrategyRequest$Description' => '<p>A description of the deployment strategy.</p>', 'CreateEnvironmentRequest$Description' => '<p>A description of the environment.</p>', 'CreateExtensionRequest$Description' => '<p>Information about the extension.</p>', 'CreateHostedConfigurationVersionRequest$Description' => '<p>A description of the configuration.</p>', 'Deployment$Description' => '<p>The description of the deployment.</p>', 'DeploymentEvent$Description' => '<p>A description of the deployment event. Descriptions include, but are not limited to, the user account or the Amazon CloudWatch alarm ARN that initiated a rollback, the percentage of hosts that received the deployment, or in the case of an internal error, a recommendation to attempt a new deployment.</p>', 'DeploymentStrategy$Description' => '<p>The description of the deployment strategy.</p>', 'Environment$Description' => '<p>The description of the environment.</p>', 'Extension$Description' => '<p>Information about the extension.</p>', 'ExtensionSummary$Description' => '<p>Information about the extension.</p>', 'HostedConfigurationVersion$Description' => '<p>A description of the configuration.</p>', 'HostedConfigurationVersionSummary$Description' => '<p>A description of the configuration.</p>', 'Parameter$Description' => '<p>Information about the parameter.</p>', 'StartDeploymentRequest$Description' => '<p>A description of the deployment.</p>', 'UpdateApplicationRequest$Description' => '<p>A description of the application.</p>', 'UpdateConfigurationProfileRequest$Description' => '<p>A description of the configuration profile.</p>', 'UpdateDeploymentStrategyRequest$Description' => '<p>A description of the deployment strategy.</p>', 'UpdateEnvironmentRequest$Description' => '<p>A description of the environment.</p>', 'UpdateExtensionRequest$Description' => '<p>Information about the extension.</p>', ], ], 'Environment' => [ 'base' => NULL, 'refs' => [ 'EnvironmentList$member' => NULL, ], ], 'EnvironmentList' => [ 'base' => NULL, 'refs' => [ 'Environments$Items' => '<p>The elements from this collection.</p>', ], ], 'EnvironmentState' => [ 'base' => NULL, 'refs' => [ 'Environment$State' => '<p>The state of the environment. An environment can be in one of the following states: <code>READY_FOR_DEPLOYMENT</code>, <code>DEPLOYING</code>, <code>ROLLING_BACK</code>, or <code>ROLLED_BACK</code> </p>', ], ], 'Environments' => [ 'base' => NULL, 'refs' => [], ], 'Extension' => [ 'base' => NULL, 'refs' => [], ], 'ExtensionAssociation' => [ 'base' => NULL, 'refs' => [], ], 'ExtensionAssociationSummaries' => [ 'base' => NULL, 'refs' => [ 'ExtensionAssociations$Items' => '<p>The list of extension associations. Each item represents an extension association to an application, environment, or configuration profile. </p>', ], ], 'ExtensionAssociationSummary' => [ 'base' => '<p>Information about an association between an extension and an AppConfig resource such as an application, environment, or configuration profile. Call <code>GetExtensionAssociation</code> to get more information about an association.</p>', 'refs' => [ 'ExtensionAssociationSummaries$member' => NULL, ], ], 'ExtensionAssociations' => [ 'base' => NULL, 'refs' => [], ], 'ExtensionSummaries' => [ 'base' => NULL, 'refs' => [ 'Extensions$Items' => '<p>The list of available extensions. The list includes Amazon Web Services authored and user-created extensions.</p>', ], ], 'ExtensionSummary' => [ 'base' => '<p>Information about an extension. Call <code>GetExtension</code> to get more information about an extension.</p>', 'refs' => [ 'ExtensionSummaries$member' => NULL, ], ], 'Extensions' => [ 'base' => NULL, 'refs' => [], ], 'Float' => [ 'base' => NULL, 'refs' => [ 'PayloadTooLargeException$Limit' => NULL, 'PayloadTooLargeException$Size' => NULL, ], ], 'GetApplicationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetConfigurationProfileRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetDeploymentRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetDeploymentStrategyRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetEnvironmentRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetExtensionAssociationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetExtensionRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetHostedConfigurationVersionRequest' => [ 'base' => NULL, 'refs' => [], ], 'GrowthFactor' => [ 'base' => NULL, 'refs' => [ 'CreateDeploymentStrategyRequest$GrowthFactor' => '<p>The percentage of targets to receive a deployed configuration during each interval.</p>', 'UpdateDeploymentStrategyRequest$GrowthFactor' => '<p>The percentage of targets to receive a deployed configuration during each interval.</p>', ], ], 'GrowthType' => [ 'base' => NULL, 'refs' => [ 'CreateDeploymentStrategyRequest$GrowthType' => '<p>The algorithm used to define how percentage grows over time. AppConfig supports the following growth types:</p> <p> <b>Linear</b>: For this type, AppConfig processes the deployment by dividing the total number of targets by the value specified for <code>Step percentage</code>. For example, a linear deployment that uses a <code>Step percentage</code> of 10 deploys the configuration to 10 percent of the hosts. After those deployments are complete, the system deploys the configuration to the next 10 percent. This continues until 100% of the targets have successfully received the configuration.</p> <p> <b>Exponential</b>: For this type, AppConfig processes the deployment exponentially using the following formula: <code>G*(2^N)</code>. In this formula, <code>G</code> is the growth factor specified by the user and <code>N</code> is the number of steps until the configuration is deployed to all targets. For example, if you specify a growth factor of 2, then the system rolls out the configuration as follows:</p> <p> <code>2*(2^0)</code> </p> <p> <code>2*(2^1)</code> </p> <p> <code>2*(2^2)</code> </p> <p>Expressed numerically, the deployment rolls out as follows: 2% of the targets, 4% of the targets, 8% of the targets, and continues until the configuration has been deployed to all targets.</p>', 'Deployment$GrowthType' => '<p>The algorithm used to define how percentage grew over time.</p>', 'DeploymentStrategy$GrowthType' => '<p>The algorithm used to define how percentage grew over time.</p>', 'DeploymentSummary$GrowthType' => '<p>The algorithm used to define how percentage grows over time.</p>', 'UpdateDeploymentStrategyRequest$GrowthType' => '<p>The algorithm used to define how percentage grows over time. AppConfig supports the following growth types:</p> <p> <b>Linear</b>: For this type, AppConfig processes the deployment by increments of the growth factor evenly distributed over the deployment time. For example, a linear deployment that uses a growth factor of 20 initially makes the configuration available to 20 percent of the targets. After 1/5th of the deployment time has passed, the system updates the percentage to 40 percent. This continues until 100% of the targets are set to receive the deployed configuration.</p> <p> <b>Exponential</b>: For this type, AppConfig processes the deployment exponentially using the following formula: <code>G*(2^N)</code>. In this formula, <code>G</code> is the growth factor specified by the user and <code>N</code> is the number of steps until the configuration is deployed to all targets. For example, if you specify a growth factor of 2, then the system rolls out the configuration as follows:</p> <p> <code>2*(2^0)</code> </p> <p> <code>2*(2^1)</code> </p> <p> <code>2*(2^2)</code> </p> <p>Expressed numerically, the deployment rolls out as follows: 2% of the targets, 4% of the targets, 8% of the targets, and continues until the configuration has been deployed to all targets.</p>', ], ], 'HostedConfigurationVersion' => [ 'base' => NULL, 'refs' => [], ], 'HostedConfigurationVersionSummary' => [ 'base' => '<p>Information about the configuration.</p>', 'refs' => [ 'HostedConfigurationVersionSummaryList$member' => NULL, ], ], 'HostedConfigurationVersionSummaryList' => [ 'base' => NULL, 'refs' => [ 'HostedConfigurationVersions$Items' => '<p>The elements from this collection.</p>', ], ], 'HostedConfigurationVersions' => [ 'base' => NULL, 'refs' => [], ], 'Id' => [ 'base' => NULL, 'refs' => [ 'ActionInvocation$InvocationId' => '<p>A system-generated ID for this invocation.</p>', 'Application$Id' => '<p>The application ID.</p>', 'AppliedExtension$ExtensionId' => '<p>The system-generated ID of the extension.</p>', 'AppliedExtension$ExtensionAssociationId' => '<p>The system-generated ID for the association.</p>', 'ConfigurationProfile$ApplicationId' => '<p>The application ID.</p>', 'ConfigurationProfile$Id' => '<p>The configuration profile ID.</p>', 'ConfigurationProfileSummary$ApplicationId' => '<p>The application ID.</p>', 'ConfigurationProfileSummary$Id' => '<p>The ID of the configuration profile.</p>', 'CreateConfigurationProfileRequest$ApplicationId' => '<p>The application ID.</p>', 'CreateEnvironmentRequest$ApplicationId' => '<p>The application ID.</p>', 'CreateHostedConfigurationVersionRequest$ApplicationId' => '<p>The application ID.</p>', 'CreateHostedConfigurationVersionRequest$ConfigurationProfileId' => '<p>The configuration profile ID.</p>', 'DeleteApplicationRequest$ApplicationId' => '<p>The ID of the application to delete.</p>', 'DeleteConfigurationProfileRequest$ApplicationId' => '<p>The application ID that includes the configuration profile you want to delete.</p>', 'DeleteConfigurationProfileRequest$ConfigurationProfileId' => '<p>The ID of the configuration profile you want to delete.</p>', 'DeleteEnvironmentRequest$ApplicationId' => '<p>The application ID that includes the environment that you want to delete.</p>', 'DeleteEnvironmentRequest$EnvironmentId' => '<p>The ID of the environment that you want to delete.</p>', 'DeleteExtensionAssociationRequest$ExtensionAssociationId' => '<p>The ID of the extension association to delete.</p>', 'DeleteHostedConfigurationVersionRequest$ApplicationId' => '<p>The application ID.</p>', 'DeleteHostedConfigurationVersionRequest$ConfigurationProfileId' => '<p>The configuration profile ID.</p>', 'Deployment$ApplicationId' => '<p>The ID of the application that was deployed.</p>', 'Deployment$EnvironmentId' => '<p>The ID of the environment that was deployed.</p>', 'Deployment$DeploymentStrategyId' => '<p>The ID of the deployment strategy that was deployed.</p>', 'Deployment$ConfigurationProfileId' => '<p>The ID of the configuration profile that was deployed.</p>', 'DeploymentStrategy$Id' => '<p>The deployment strategy ID.</p>', 'Environment$ApplicationId' => '<p>The application ID.</p>', 'Environment$Id' => '<p>The environment ID.</p>', 'Extension$Id' => '<p>The system-generated ID of the extension.</p>', 'ExtensionSummary$Id' => '<p>The system-generated ID of the extension.</p>', 'GetApplicationRequest$ApplicationId' => '<p>The ID of the application you want to get.</p>', 'GetConfigurationProfileRequest$ApplicationId' => '<p>The ID of the application that includes the configuration profile you want to get.</p>', 'GetConfigurationProfileRequest$ConfigurationProfileId' => '<p>The ID of the configuration profile that you want to get.</p>', 'GetDeploymentRequest$ApplicationId' => '<p>The ID of the application that includes the deployment you want to get. </p>', 'GetDeploymentRequest$EnvironmentId' => '<p>The ID of the environment that includes the deployment you want to get. </p>', 'GetEnvironmentRequest$ApplicationId' => '<p>The ID of the application that includes the environment you want to get.</p>', 'GetEnvironmentRequest$EnvironmentId' => '<p>The ID of the environment that you want to get.</p>', 'GetExtensionAssociationRequest$ExtensionAssociationId' => '<p>The extension association ID to get.</p>', 'GetHostedConfigurationVersionRequest$ApplicationId' => '<p>The application ID.</p>', 'GetHostedConfigurationVersionRequest$ConfigurationProfileId' => '<p>The configuration profile ID.</p>', 'HostedConfigurationVersion$ApplicationId' => '<p>The application ID.</p>', 'HostedConfigurationVersion$ConfigurationProfileId' => '<p>The configuration profile ID.</p>', 'HostedConfigurationVersionSummary$ApplicationId' => '<p>The application ID.</p>', 'HostedConfigurationVersionSummary$ConfigurationProfileId' => '<p>The configuration profile ID.</p>', 'ListConfigurationProfilesRequest$ApplicationId' => '<p>The application ID.</p>', 'ListDeploymentsRequest$ApplicationId' => '<p>The application ID.</p>', 'ListDeploymentsRequest$EnvironmentId' => '<p>The environment ID.</p>', 'ListEnvironmentsRequest$ApplicationId' => '<p>The application ID.</p>', 'ListHostedConfigurationVersionsRequest$ApplicationId' => '<p>The application ID.</p>', 'ListHostedConfigurationVersionsRequest$ConfigurationProfileId' => '<p>The configuration profile ID.</p>', 'StartDeploymentRequest$ApplicationId' => '<p>The application ID.</p>', 'StartDeploymentRequest$EnvironmentId' => '<p>The environment ID.</p>', 'StartDeploymentRequest$ConfigurationProfileId' => '<p>The configuration profile ID.</p>', 'StopDeploymentRequest$ApplicationId' => '<p>The application ID.</p>', 'StopDeploymentRequest$EnvironmentId' => '<p>The environment ID.</p>', 'UpdateApplicationRequest$ApplicationId' => '<p>The application ID.</p>', 'UpdateConfigurationProfileRequest$ApplicationId' => '<p>The application ID.</p>', 'UpdateConfigurationProfileRequest$ConfigurationProfileId' => '<p>The ID of the configuration profile.</p>', 'UpdateEnvironmentRequest$ApplicationId' => '<p>The application ID.</p>', 'UpdateEnvironmentRequest$EnvironmentId' => '<p>The environment ID.</p>', 'UpdateExtensionAssociationRequest$ExtensionAssociationId' => '<p>The system-generated ID for the association.</p>', 'ValidateConfigurationRequest$ApplicationId' => '<p>The application ID.</p>', 'ValidateConfigurationRequest$ConfigurationProfileId' => '<p>The configuration profile ID.</p>', ], ], 'Identifier' => [ 'base' => NULL, 'refs' => [ 'ActionInvocation$ExtensionIdentifier' => '<p>The name, the ID, or the Amazon Resource Name (ARN) of the extension.</p>', 'CreateExtensionAssociationRequest$ExtensionIdentifier' => '<p>The name, the ID, or the Amazon Resource Name (ARN) of the extension.</p>', 'CreateExtensionAssociationRequest$ResourceIdentifier' => '<p>The ARN of an application, configuration profile, or environment.</p>', 'DeleteExtensionRequest$ExtensionIdentifier' => '<p>The name, ID, or Amazon Resource Name (ARN) of the extension you want to delete.</p>', 'Deployment$KmsKeyIdentifier' => '<p>The KMS key identifier (key ID, key alias, or key ARN). AppConfig uses this ID to encrypt the configuration data using a customer managed key. </p>', 'ExtensionAssociation$Id' => '<p>The system-generated ID for the association.</p>', 'ExtensionAssociationSummary$Id' => '<p>The extension association ID. This ID is used to call other <code>ExtensionAssociation</code> API actions such as <code>GetExtensionAssociation</code> or <code>DeleteExtensionAssociation</code>.</p>', 'GetExtensionRequest$ExtensionIdentifier' => '<p>The name, the ID, or the Amazon Resource Name (ARN) of the extension.</p>', 'ListExtensionAssociationsRequest$ExtensionIdentifier' => '<p>The name, the ID, or the Amazon Resource Name (ARN) of the extension.</p>', 'StartDeploymentRequest$KmsKeyIdentifier' => '<p>The KMS key identifier (key ID, key alias, or key ARN). AppConfig uses this ID to encrypt the configuration data using a customer managed key. </p>', 'UpdateExtensionRequest$ExtensionIdentifier' => '<p>The name, the ID, or the Amazon Resource Name (ARN) of the extension.</p>', ], ], 'Integer' => [ 'base' => NULL, 'refs' => [ 'AppliedExtension$VersionNumber' => '<p>The extension version number.</p>', 'CreateExtensionAssociationRequest$ExtensionVersionNumber' => '<p>The version number of the extension. If not specified, AppConfig uses the maximum version of the extension.</p>', 'CreateExtensionRequest$LatestVersionNumber' => '<p>You can omit this field when you create an extension. When you create a new version, specify the most recent current version number. For example, you create version 3, enter 2 for this field.</p>', 'CreateHostedConfigurationVersionRequest$LatestVersionNumber' => '<p>An optional locking token used to prevent race conditions from overwriting configuration updates when creating a new version. To ensure your data is not overwritten when creating multiple hosted configuration versions in rapid succession, specify the version number of the latest hosted configuration version.</p>', 'DeleteExtensionRequest$VersionNumber' => '<p>A specific version of an extension to delete. If omitted, the highest version is deleted.</p>', 'DeleteHostedConfigurationVersionRequest$VersionNumber' => '<p>The versions number to delete.</p>', 'Deployment$DeploymentNumber' => '<p>The sequence number of the deployment.</p>', 'DeploymentSummary$DeploymentNumber' => '<p>The sequence number of the deployment.</p>', 'Extension$VersionNumber' => '<p>The extension version number.</p>', 'ExtensionAssociation$ExtensionVersionNumber' => '<p>The version number for the extension defined in the association.</p>', 'ExtensionSummary$VersionNumber' => '<p>The extension version number.</p>', 'GetDeploymentRequest$DeploymentNumber' => '<p>The sequence number of the deployment.</p>', 'GetExtensionRequest$VersionNumber' => '<p>The extension version number. If no version number was defined, AppConfig uses the highest version.</p>', 'GetHostedConfigurationVersionRequest$VersionNumber' => '<p>The version.</p>', 'HostedConfigurationVersion$VersionNumber' => '<p>The configuration version.</p>', 'HostedConfigurationVersionSummary$VersionNumber' => '<p>The configuration version.</p>', 'ListExtensionAssociationsRequest$ExtensionVersionNumber' => '<p>The version number for the extension defined in the association.</p>', 'StopDeploymentRequest$DeploymentNumber' => '<p>The sequence number of the deployment.</p>', 'UpdateExtensionRequest$VersionNumber' => '<p>The extension version number.</p>', ], ], 'InternalServerException' => [ 'base' => '<p>There was an internal failure in the AppConfig service.</p>', 'refs' => [], ], 'InvalidConfigurationDetail' => [ 'base' => '<p>Detailed information about the bad request exception error when creating a hosted configuration version.</p>', 'refs' => [ 'InvalidConfigurationDetailList$member' => NULL, ], ], 'InvalidConfigurationDetailList' => [ 'base' => NULL, 'refs' => [ 'BadRequestDetails$InvalidConfiguration' => '<p>Detailed information about the bad request exception error when creating a hosted configuration version.</p>', ], ], 'Iso8601DateTime' => [ 'base' => NULL, 'refs' => [ 'Deployment$StartedAt' => '<p>The time the deployment started.</p>', 'Deployment$CompletedAt' => '<p>The time the deployment completed. </p>', 'DeploymentEvent$OccurredAt' => '<p>The date and time the event occurred.</p>', 'DeploymentSummary$StartedAt' => '<p>Time the deployment started.</p>', 'DeploymentSummary$CompletedAt' => '<p>Time the deployment completed.</p>', ], ], 'ListApplicationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListConfigurationProfilesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListDeploymentStrategiesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListDeploymentsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListEnvironmentsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListExtensionAssociationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListExtensionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListHostedConfigurationVersionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'LongName' => [ 'base' => NULL, 'refs' => [ 'ConfigurationProfile$Name' => '<p>The name of the configuration profile.</p>', 'ConfigurationProfileSummary$Name' => '<p>The name of the configuration profile.</p>', 'CreateConfigurationProfileRequest$Name' => '<p>A name for the configuration profile.</p>', ], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'ListApplicationsRequest$MaxResults' => '<p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>', 'ListConfigurationProfilesRequest$MaxResults' => '<p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>', 'ListDeploymentStrategiesRequest$MaxResults' => '<p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>', 'ListDeploymentsRequest$MaxResults' => '<p>The maximum number of items that may be returned for this call. If there are items that have not yet been returned, the response will include a non-null <code>NextToken</code> that you can provide in a subsequent call to get the next set of results.</p>', 'ListEnvironmentsRequest$MaxResults' => '<p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>', 'ListExtensionAssociationsRequest$MaxResults' => '<p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>', 'ListExtensionsRequest$MaxResults' => '<p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>', 'ListHostedConfigurationVersionsRequest$MaxResults' => '<p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>', ], ], 'MinutesBetween0And24Hours' => [ 'base' => NULL, 'refs' => [ 'CreateDeploymentStrategyRequest$DeploymentDurationInMinutes' => '<p>Total amount of time for a deployment to last.</p>', 'CreateDeploymentStrategyRequest$FinalBakeTimeInMinutes' => '<p>Specifies the amount of time AppConfig monitors for Amazon CloudWatch alarms after the configuration has been deployed to 100% of its targets, before considering the deployment to be complete. If an alarm is triggered during this time, AppConfig rolls back the deployment. You must configure permissions for AppConfig to roll back based on CloudWatch alarms. For more information, see <a href=\"https://docs.aws.amazon.com/appconfig/latest/userguide/getting-started-with-appconfig-cloudwatch-alarms-permissions.html\">Configuring permissions for rollback based on Amazon CloudWatch alarms</a> in the <i>AppConfig User Guide</i>.</p>', 'Deployment$DeploymentDurationInMinutes' => '<p>Total amount of time the deployment lasted.</p>', 'Deployment$FinalBakeTimeInMinutes' => '<p>The amount of time that AppConfig monitored for alarms before considering the deployment to be complete and no longer eligible for automatic rollback.</p>', 'DeploymentStrategy$DeploymentDurationInMinutes' => '<p>Total amount of time the deployment lasted.</p>', 'DeploymentStrategy$FinalBakeTimeInMinutes' => '<p>The amount of time that AppConfig monitored for alarms before considering the deployment to be complete and no longer eligible for automatic rollback.</p>', 'DeploymentSummary$DeploymentDurationInMinutes' => '<p>Total amount of time the deployment lasted.</p>', 'DeploymentSummary$FinalBakeTimeInMinutes' => '<p>The amount of time that AppConfig monitors for alarms before considering the deployment to be complete and no longer eligible for automatic rollback.</p>', 'UpdateDeploymentStrategyRequest$DeploymentDurationInMinutes' => '<p>Total amount of time for a deployment to last.</p>', 'UpdateDeploymentStrategyRequest$FinalBakeTimeInMinutes' => '<p>The amount of time that AppConfig monitors for alarms before considering the deployment to be complete and no longer eligible for automatic rollback.</p>', ], ], 'Monitor' => [ 'base' => '<p>Amazon CloudWatch alarms to monitor during the deployment process.</p>', 'refs' => [ 'MonitorList$member' => NULL, ], ], 'MonitorList' => [ 'base' => NULL, 'refs' => [ 'CreateEnvironmentRequest$Monitors' => '<p>Amazon CloudWatch alarms to monitor during the deployment process.</p>', 'Environment$Monitors' => '<p>Amazon CloudWatch alarms monitored during the deployment.</p>', 'UpdateEnvironmentRequest$Monitors' => '<p>Amazon CloudWatch alarms to monitor during the deployment process.</p>', ], ], 'Name' => [ 'base' => NULL, 'refs' => [ 'Action$Name' => '<p>The action name.</p>', 'ActionInvocation$ActionName' => '<p>The name of the action.</p>', 'Application$Name' => '<p>The application name.</p>', 'CreateApplicationRequest$Name' => '<p>A name for the application.</p>', 'CreateDeploymentStrategyRequest$Name' => '<p>A name for the deployment strategy.</p>', 'CreateEnvironmentRequest$Name' => '<p>A name for the environment.</p>', 'CreateExtensionRequest$Name' => '<p>A name for the extension. Each extension name in your account must be unique. Extension versions use the same name.</p>', 'Deployment$ConfigurationName' => '<p>The name of the configuration.</p>', 'DeploymentStrategy$Name' => '<p>The name of the deployment strategy.</p>', 'DeploymentSummary$ConfigurationName' => '<p>The name of the configuration.</p>', 'Environment$Name' => '<p>The name of the environment.</p>', 'Extension$Name' => '<p>The extension name.</p>', 'ExtensionSummary$Name' => '<p>The extension name.</p>', 'ParameterMap$key' => NULL, 'ParameterValueMap$key' => NULL, 'UpdateApplicationRequest$Name' => '<p>The name of the application.</p>', 'UpdateConfigurationProfileRequest$Name' => '<p>The name of the configuration profile.</p>', 'UpdateEnvironmentRequest$Name' => '<p>The name of the environment.</p>', ], ], 'NextToken' => [ 'base' => NULL, 'refs' => [ 'Applications$NextToken' => '<p>The token for the next set of items to return. Use this token to get the next set of results.</p>', 'ConfigurationProfiles$NextToken' => '<p>The token for the next set of items to return. Use this token to get the next set of results.</p>', 'DeploymentStrategies$NextToken' => '<p>The token for the next set of items to return. Use this token to get the next set of results.</p>', 'Deployments$NextToken' => '<p>The token for the next set of items to return. Use this token to get the next set of results.</p>', 'Environments$NextToken' => '<p>The token for the next set of items to return. Use this token to get the next set of results.</p>', 'ExtensionAssociations$NextToken' => '<p>The token for the next set of items to return. Use this token to get the next set of results.</p>', 'Extensions$NextToken' => '<p>The token for the next set of items to return. Use this token to get the next set of results.</p>', 'HostedConfigurationVersions$NextToken' => '<p>The token for the next set of items to return. Use this token to get the next set of results.</p>', 'ListApplicationsRequest$NextToken' => '<p>A token to start the list. Next token is a pagination token generated by AppConfig to describe what page the previous List call ended on. For the first List request, the nextToken should not be set. On subsequent calls, the nextToken parameter should be set to the previous responses nextToken value. Use this token to get the next set of results. </p>', 'ListConfigurationProfilesRequest$NextToken' => '<p>A token to start the list. Use this token to get the next set of results.</p>', 'ListDeploymentStrategiesRequest$NextToken' => '<p>A token to start the list. Use this token to get the next set of results.</p>', 'ListDeploymentsRequest$NextToken' => '<p>The token returned by a prior call to this operation indicating the next set of results to be returned. If not specified, the operation will return the first set of results.</p>', 'ListEnvironmentsRequest$NextToken' => '<p>A token to start the list. Use this token to get the next set of results.</p>', 'ListExtensionAssociationsRequest$NextToken' => '<p>A token to start the list. Use this token to get the next set of results or pass null to get the first set of results. </p>', 'ListExtensionsRequest$NextToken' => '<p>A token to start the list. Use this token to get the next set of results. </p>', 'ListHostedConfigurationVersionsRequest$NextToken' => '<p>A token to start the list. Use this token to get the next set of results. </p>', ], ], 'Parameter' => [ 'base' => '<p>A value such as an Amazon Resource Name (ARN) or an Amazon Simple Notification Service topic entered in an extension when invoked. Parameter values are specified in an extension association. For more information about extensions, see <a href=\"https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html\">Working with AppConfig extensions</a> in the <i>AppConfig User Guide</i>.</p>', 'refs' => [ 'ParameterMap$value' => NULL, ], ], 'ParameterMap' => [ 'base' => NULL, 'refs' => [ 'CreateExtensionRequest$Parameters' => '<p>The parameters accepted by the extension. You specify parameter values when you associate the extension to an AppConfig resource by using the <code>CreateExtensionAssociation</code> API action. For Lambda extension actions, these parameters are included in the Lambda request object.</p>', 'Extension$Parameters' => '<p>The parameters accepted by the extension. You specify parameter values when you associate the extension to an AppConfig resource by using the <code>CreateExtensionAssociation</code> API action. For Lambda extension actions, these parameters are included in the Lambda request object.</p>', 'UpdateExtensionRequest$Parameters' => '<p>One or more parameters for the actions called by the extension.</p>', ], ], 'ParameterValueMap' => [ 'base' => NULL, 'refs' => [ 'AppliedExtension$Parameters' => '<p>One or more parameters for the actions called by the extension.</p>', 'CreateExtensionAssociationRequest$Parameters' => '<p>The parameter names and values defined in the extensions. Extension parameters marked <code>Required</code> must be entered for this field.</p>', 'ExtensionAssociation$Parameters' => '<p>The parameter names and values defined in the association.</p>', 'UpdateExtensionAssociationRequest$Parameters' => '<p>The parameter names and values defined in the extension.</p>', ], ], 'PayloadTooLargeException' => [ 'base' => '<p>The configuration size is too large.</p>', 'refs' => [], ], 'Percentage' => [ 'base' => NULL, 'refs' => [ 'Deployment$GrowthFactor' => '<p>The percentage of targets to receive a deployed configuration during each interval.</p>', 'Deployment$PercentageComplete' => '<p>The percentage of targets for which the deployment is available.</p>', 'DeploymentStrategy$GrowthFactor' => '<p>The percentage of targets that received a deployed configuration during each interval.</p>', 'DeploymentSummary$GrowthFactor' => '<p>The percentage of targets to receive a deployed configuration during each interval.</p>', 'DeploymentSummary$PercentageComplete' => '<p>The percentage of targets for which the deployment is available.</p>', ], ], 'QueryName' => [ 'base' => NULL, 'refs' => [ 'ListExtensionsRequest$Name' => '<p>The extension name.</p>', 'ListHostedConfigurationVersionsRequest$VersionLabel' => '<p>An optional filter that can be used to specify the version label of an AppConfig hosted configuration version. This parameter supports filtering by prefix using a wildcard, for example \"v2*\". If you don\\'t specify an asterisk at the end of the value, only an exact match is returned.</p>', ], ], 'ReplicateTo' => [ 'base' => NULL, 'refs' => [ 'CreateDeploymentStrategyRequest$ReplicateTo' => '<p>Save the deployment strategy to a Systems Manager (SSM) document.</p>', 'DeploymentStrategy$ReplicateTo' => '<p>Save the deployment strategy to a Systems Manager (SSM) document.</p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p>The requested resource could not be found.</p>', 'refs' => [], ], 'ResourceTags' => [ 'base' => NULL, 'refs' => [], ], 'RoleArn' => [ 'base' => NULL, 'refs' => [ 'ConfigurationProfile$RetrievalRoleArn' => '<p>The ARN of an IAM role with permission to access the configuration at the specified <code>LocationUri</code>.</p>', 'CreateConfigurationProfileRequest$RetrievalRoleArn' => '<p>The ARN of an IAM role with permission to access the configuration at the specified <code>LocationUri</code>.</p> <important> <p>A retrieval role ARN is not required for configurations stored in the AppConfig hosted configuration store. It is required for all other sources that store your configuration. </p> </important>', 'Monitor$AlarmRoleArn' => '<p>ARN of an Identity and Access Management (IAM) role for AppConfig to monitor <code>AlarmArn</code>.</p>', 'UpdateConfigurationProfileRequest$RetrievalRoleArn' => '<p>The ARN of an IAM role with permission to access the configuration at the specified <code>LocationUri</code>.</p>', ], ], 'ServiceQuotaExceededException' => [ 'base' => '<p>The number of hosted configuration versions exceeds the limit for the AppConfig hosted configuration store. Delete one or more versions and try again.</p>', 'refs' => [], ], 'StartDeploymentRequest' => [ 'base' => NULL, 'refs' => [], ], 'StopDeploymentRequest' => [ 'base' => NULL, 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [ 'ActionInvocation$ErrorMessage' => '<p>The error message when an extension invocation fails.</p>', 'ActionInvocation$ErrorCode' => '<p>The error code when an extension invocation fails.</p>', 'BadRequestException$Message' => NULL, 'Configuration$ContentType' => '<p>A standard MIME type describing the format of the configuration content. For more information, see <a href=\"http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17\">Content-Type</a>.</p>', 'ConflictException$Message' => NULL, 'InternalServerException$Message' => NULL, 'InvalidConfigurationDetail$Constraint' => '<p>The invalid or out-of-range validation constraint in your JSON schema that failed validation.</p>', 'InvalidConfigurationDetail$Location' => '<p>Location of the validation constraint in the configuration JSON schema that failed validation.</p>', 'InvalidConfigurationDetail$Reason' => '<p>The reason for an invalid configuration error.</p>', 'InvalidConfigurationDetail$Type' => '<p>The type of error for an invalid configuration.</p>', 'InvalidConfigurationDetail$Value' => '<p>Details about an error with Lambda when a synchronous extension experiences an error during an invocation.</p>', 'PayloadTooLargeException$Message' => NULL, 'ResourceNotFoundException$Message' => NULL, 'ResourceNotFoundException$ResourceName' => NULL, 'ServiceQuotaExceededException$Message' => NULL, ], ], 'StringWithLengthBetween0And32768' => [ 'base' => NULL, 'refs' => [ 'Validator$Content' => '<p>Either the JSON Schema content or the Amazon Resource Name (ARN) of an Lambda function.</p>', ], ], 'StringWithLengthBetween1And2048' => [ 'base' => NULL, 'refs' => [ 'Monitor$AlarmArn' => '<p>Amazon Resource Name (ARN) of the Amazon CloudWatch alarm.</p>', 'ParameterValueMap$value' => NULL, ], ], 'StringWithLengthBetween1And255' => [ 'base' => NULL, 'refs' => [ 'CreateHostedConfigurationVersionRequest$ContentType' => '<p>A standard MIME type describing the format of the configuration content. For more information, see <a href=\"https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17\">Content-Type</a>.</p>', 'HostedConfigurationVersion$ContentType' => '<p>A standard MIME type describing the format of the configuration content. For more information, see <a href=\"https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17\">Content-Type</a>.</p>', 'HostedConfigurationVersionSummary$ContentType' => '<p>A standard MIME type describing the format of the configuration content. For more information, see <a href=\"https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17\">Content-Type</a>.</p>', ], ], 'StringWithLengthBetween1And64' => [ 'base' => NULL, 'refs' => [ 'GetConfigurationRequest$Application' => '<p>The application to get. Specify either the application name or the application ID.</p>', 'GetConfigurationRequest$Environment' => '<p>The environment to get. Specify either the environment name or the environment ID.</p>', 'GetConfigurationRequest$Configuration' => '<p>The configuration to get. Specify either the configuration name or the configuration ID.</p>', 'GetConfigurationRequest$ClientId' => '<p>The clientId parameter in the following command is a unique, user-specified ID to identify the client for the configuration. This ID enables AppConfig to deploy the configuration in intervals, as defined in the deployment strategy. </p>', ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'TagKeyList$member' => NULL, 'TagMap$key' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$TagKeys' => '<p>The tag keys to delete.</p>', ], ], 'TagMap' => [ 'base' => NULL, 'refs' => [ 'CreateApplicationRequest$Tags' => '<p>Metadata to assign to the application. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>', 'CreateConfigurationProfileRequest$Tags' => '<p>Metadata to assign to the configuration profile. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>', 'CreateDeploymentStrategyRequest$Tags' => '<p>Metadata to assign to the deployment strategy. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>', 'CreateEnvironmentRequest$Tags' => '<p>Metadata to assign to the environment. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>', 'CreateExtensionAssociationRequest$Tags' => '<p>Adds one or more tags for the specified extension association. Tags are metadata that help you categorize resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value, both of which you define. </p>', 'CreateExtensionRequest$Tags' => '<p>Adds one or more tags for the specified extension. Tags are metadata that help you categorize resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value, both of which you define. </p>', 'ResourceTags$Tags' => '<p>Metadata to assign to AppConfig resources. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>', 'StartDeploymentRequest$Tags' => '<p>Metadata to assign to the deployment. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>', 'TagResourceRequest$Tags' => '<p>The key-value string map. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with <code>aws:</code>. The tag value can be up to 256 characters.</p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'TagMap$value' => NULL, ], ], 'TriggeredBy' => [ 'base' => NULL, 'refs' => [ 'DeploymentEvent$TriggeredBy' => '<p>The entity that triggered the deployment event. Events can be triggered by a user, AppConfig, an Amazon CloudWatch alarm, or an internal error.</p>', ], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateApplicationRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateConfigurationProfileRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateDeploymentStrategyRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateEnvironmentRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateExtensionAssociationRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateExtensionRequest' => [ 'base' => NULL, 'refs' => [], ], 'Uri' => [ 'base' => NULL, 'refs' => [ 'Action$Uri' => '<p>The extension URI associated to the action point in the extension definition. The URI can be an Amazon Resource Name (ARN) for one of the following: an Lambda function, an Amazon Simple Queue Service queue, an Amazon Simple Notification Service topic, or the Amazon EventBridge default event bus.</p>', 'ActionInvocation$Uri' => '<p>The extension URI associated to the action point in the extension definition. The URI can be an Amazon Resource Name (ARN) for one of the following: an Lambda function, an Amazon Simple Queue Service queue, an Amazon Simple Notification Service topic, or the Amazon EventBridge default event bus.</p>', 'ConfigurationProfile$LocationUri' => '<p>The URI location of the configuration.</p>', 'ConfigurationProfileSummary$LocationUri' => '<p>The URI location of the configuration.</p>', 'CreateConfigurationProfileRequest$LocationUri' => '<p>A URI to locate the configuration. You can specify the following:</p> <ul> <li> <p>For the AppConfig hosted configuration store and for feature flags, specify <code>hosted</code>.</p> </li> <li> <p>For an Amazon Web Services Systems Manager Parameter Store parameter, specify either the parameter name in the format <code>ssm-parameter://&lt;parameter name&gt;</code> or the ARN.</p> </li> <li> <p>For an Secrets Manager secret, specify the URI in the following format: <code>secrets-manager</code>://&lt;secret name&gt;.</p> </li> <li> <p>For an Amazon S3 object, specify the URI in the following format: <code>s3://&lt;bucket&gt;/&lt;objectKey&gt; </code>. Here is an example: <code>s3://my-bucket/my-app/us-east-1/my-config.json</code> </p> </li> <li> <p>For an SSM document, specify either the document name in the format <code>ssm-document://&lt;document name&gt;</code> or the Amazon Resource Name (ARN).</p> </li> </ul>', 'Deployment$ConfigurationLocationUri' => '<p>Information about the source location of the configuration.</p>', ], ], 'ValidateConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'Validator' => [ 'base' => '<p>A validator provides a syntactic or semantic check to ensure the configuration that you want to deploy functions as intended. To validate your application configuration data, you provide a schema or an Amazon Web Services Lambda function that runs against the configuration. The configuration deployment or update can only proceed when the configuration data is valid.</p>', 'refs' => [ 'ValidatorList$member' => NULL, ], ], 'ValidatorList' => [ 'base' => NULL, 'refs' => [ 'ConfigurationProfile$Validators' => '<p>A list of methods for validating the configuration.</p>', 'CreateConfigurationProfileRequest$Validators' => '<p>A list of methods for validating the configuration.</p>', 'UpdateConfigurationProfileRequest$Validators' => '<p>A list of methods for validating the configuration.</p>', ], ], 'ValidatorType' => [ 'base' => NULL, 'refs' => [ 'Validator$Type' => '<p>AppConfig supports validators of type <code>JSON_SCHEMA</code> and <code>LAMBDA</code> </p>', 'ValidatorTypeList$member' => NULL, ], ], 'ValidatorTypeList' => [ 'base' => NULL, 'refs' => [ 'ConfigurationProfileSummary$ValidatorTypes' => '<p>The types of validators in the configuration profile.</p>', ], ], 'Version' => [ 'base' => NULL, 'refs' => [ 'Configuration$ConfigurationVersion' => '<p>The configuration version.</p>', 'Deployment$ConfigurationVersion' => '<p>The configuration version that was deployed.</p>', 'DeploymentSummary$ConfigurationVersion' => '<p>The version of the configuration.</p>', 'GetConfigurationRequest$ClientConfigurationVersion' => '<p>The configuration version returned in the most recent <code>GetConfiguration</code> response.</p> <important> <p>AppConfig uses the value of the <code>ClientConfigurationVersion</code> parameter to identify the configuration version on your clients. If you don\u00e2\u20ac\u2122t send <code>ClientConfigurationVersion</code> with each call to <code>GetConfiguration</code>, your clients receive the current configuration. You are charged each time your clients receive a configuration.</p> <p>To avoid excess charges, we recommend you use the <a href=\"https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/StartConfigurationSession.html\">StartConfigurationSession</a> and <a href=\"https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/GetLatestConfiguration.html\">GetLatestConfiguration</a> APIs, which track the client configuration version on your behalf. If you choose to continue using <code>GetConfiguration</code>, we recommend that you include the <code>ClientConfigurationVersion</code> value with every call to <code>GetConfiguration</code>. The value to use for <code>ClientConfigurationVersion</code> comes from the <code>ConfigurationVersion</code> attribute returned by <code>GetConfiguration</code> when there is new or updated data, and should be saved for subsequent calls to <code>GetConfiguration</code>.</p> </important> <p>For more information about working with configurations, see <a href=\"http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration.html\">Retrieving the Configuration</a> in the <i>AppConfig User Guide</i>.</p>', 'StartDeploymentRequest$ConfigurationVersion' => '<p>The configuration version to deploy. If deploying an AppConfig hosted configuration version, you can specify either the version number or version label.</p>', 'ValidateConfigurationRequest$ConfigurationVersion' => '<p>The version of the configuration to validate.</p>', ], ], 'VersionLabel' => [ 'base' => NULL, 'refs' => [ 'CreateHostedConfigurationVersionRequest$VersionLabel' => '<p>An optional, user-defined label for the AppConfig hosted configuration version. This value must contain at least one non-numeric character. For example, \"v2.2.0\".</p>', 'HostedConfigurationVersion$VersionLabel' => '<p>A user-defined label for an AppConfig hosted configuration version.</p>', 'HostedConfigurationVersionSummary$VersionLabel' => '<p>A user-defined label for an AppConfig hosted configuration version.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appconfig/2019-10-09/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appconfig-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'ref' => 'Region', ], 'us-gov-east-1', ], ], ], 'endpoint' => [ 'url' => 'https://appconfig.us-gov-east-1.amazonaws.com', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'ref' => 'Region', ], 'us-gov-west-1', ], ], ], 'endpoint' => [ 'url' => 'https://appconfig.us-gov-west-1.amazonaws.com', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appconfig-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appconfig.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appconfig.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appconfig/2019-10-09/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-iso-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.us-iso-west-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfig-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appconfig/2019-10-09/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [ 'CreateApplication' => [ [ 'input' => [ 'Description' => 'An application used for creating an example.', 'Name' => 'example-application', ], 'output' => [ 'Description' => 'An application used for creating an example.', 'Id' => '339ohji', 'Name' => 'example-application', ], 'comments' => [], 'description' => 'The following create-application example creates an application in AWS AppConfig.', 'id' => 'to-create-an-application-1632264511615', 'title' => 'To create an application', ], ], 'CreateConfigurationProfile' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'LocationUri' => 'ssm-parameter://Example-Parameter', 'Name' => 'Example-Configuration-Profile', 'RetrievalRoleArn' => 'arn:aws:iam::111122223333:role/Example-App-Config-Role', ], 'output' => [ 'ApplicationId' => '339ohji', 'Id' => 'ur8hx2f', 'LocationUri' => 'ssm-parameter://Example-Parameter', 'Name' => 'Example-Configuration-Profile', 'RetrievalRoleArn' => 'arn:aws:iam::111122223333:role/Example-App-Config-Role', ], 'comments' => [], 'description' => 'The following create-configuration-profile example creates a configuration profile using a configuration stored in Parameter Store, a capability of Systems Manager.', 'id' => 'to-create-a-configuration-profile-1632264580336', 'title' => 'To create a configuration profile', ], ], 'CreateDeploymentStrategy' => [ [ 'input' => [ 'DeploymentDurationInMinutes' => 15, 'GrowthFactor' => 25, 'Name' => 'Example-Deployment', 'ReplicateTo' => 'SSM_DOCUMENT', ], 'output' => [ 'DeploymentDurationInMinutes' => 15, 'FinalBakeTimeInMinutes' => 0, 'GrowthFactor' => 25, 'GrowthType' => 'LINEAR', 'Id' => '1225qzk', 'Name' => 'Example-Deployment', 'ReplicateTo' => 'SSM_DOCUMENT', ], 'comments' => [], 'description' => 'The following create-deployment-strategy example creates a deployment strategy called Example-Deployment that takes 15 minutes and deploys the configuration to 25% of the application at a time. The strategy is also copied to an SSM Document.', 'id' => 'to-create-a-deployment-strategy-1632264783812', 'title' => 'To create a deployment strategy', ], ], 'CreateEnvironment' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'Name' => 'Example-Environment', ], 'output' => [ 'ApplicationId' => '339ohji', 'Id' => '54j1r29', 'Name' => 'Example-Environment', 'State' => 'READY_FOR_DEPLOYMENT', ], 'comments' => [], 'description' => 'The following create-environment example creates an AWS AppConfig environment named Example-Environment using the application you created using create-application', 'id' => 'to-create-an-environment-1632265124975', 'title' => 'To create an environment', ], ], 'CreateHostedConfigurationVersion' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'ConfigurationProfileId' => 'ur8hx2f', 'Content' => 'eyAiTmFtZSI6ICJFeGFtcGxlQXBwbGljYXRpb24iLCAiSWQiOiBFeGFtcGxlSUQsICJSYW5rIjogNyB9', 'ContentType' => 'text', 'LatestVersionNumber' => 1, ], 'output' => [ 'ApplicationId' => '339ohji', 'ConfigurationProfileId' => 'ur8hx2f', 'ContentType' => 'text', 'VersionNumber' => 1, ], 'comments' => [], 'description' => 'The following create-hosted-configuration-version example creates a new configuration in the AWS AppConfig configuration store.', 'id' => 'to-create-a-hosted-configuration-version-1632265196980', 'title' => 'To create a hosted configuration version', ], ], 'DeleteApplication' => [ [ 'input' => [ 'ApplicationId' => '339ohji', ], 'comments' => [], 'description' => 'The following delete-application example deletes the specified application.', 'id' => 'to-delete-an-application-1632265343951', 'title' => 'To delete an application', ], ], 'DeleteConfigurationProfile' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'ConfigurationProfileId' => 'ur8hx2f', ], 'comments' => [], 'description' => 'The following delete-configuration-profile example deletes the specified configuration profile.', 'id' => 'to-delete-a-configuration-profile-1632265401308', 'title' => 'To delete a configuration profile', ], ], 'DeleteDeploymentStrategy' => [ [ 'input' => [ 'DeploymentStrategyId' => '1225qzk', ], 'comments' => [], 'description' => 'The following delete-deployment-strategy example deletes the specified deployment strategy.', 'id' => 'to-delete-a-deployment-strategy-1632265473708', 'title' => 'To delete a deployment strategy', ], ], 'DeleteEnvironment' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'EnvironmentId' => '54j1r29', ], 'comments' => [], 'description' => 'The following delete-environment example deletes the specified application environment.', 'id' => 'to-delete-an-environment-1632265641044', 'title' => 'To delete an environment', ], ], 'DeleteHostedConfigurationVersion' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'ConfigurationProfileId' => 'ur8hx2f', 'VersionNumber' => 1, ], 'comments' => [], 'description' => 'The following delete-hosted-configuration-version example deletes a configuration version hosted in the AWS AppConfig configuration store.', 'id' => 'to-delete-a-hosted-configuration-version-1632265720740', 'title' => 'To delete a hosted configuration version', ], ], 'GetApplication' => [ [ 'input' => [ 'ApplicationId' => '339ohji', ], 'output' => [ 'Id' => '339ohji', 'Name' => 'example-application', ], 'comments' => [], 'description' => 'The following get-application example lists the details of the specified application.', 'id' => 'to-list-details-of-an-application-1632265864702', 'title' => 'To list details of an application', ], ], 'GetConfiguration' => [ [ 'input' => [ 'Application' => 'example-application', 'ClientId' => 'example-id', 'Configuration' => 'Example-Configuration-Profile', 'Environment' => 'Example-Environment', ], 'output' => [ 'ConfigurationVersion' => '1', 'ContentType' => 'application/octet-stream', ], 'comments' => [], 'description' => 'The following get-configuration example returns the configuration details of the example application. On subsequent calls to get-configuration, use the client-configuration-version parameter to only update the configuration of your application if the version has changed. Only updating the configuration when the version has changed avoids excess charges incurred by calling get-configuration.', 'id' => 'to-retrieve-configuration-details-1632265954314', 'title' => 'To retrieve configuration details', ], ], 'GetConfigurationProfile' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'ConfigurationProfileId' => 'ur8hx2f', ], 'output' => [ 'ApplicationId' => '339ohji', 'Id' => 'ur8hx2f', 'LocationUri' => 'ssm-parameter://Example-Parameter', 'Name' => 'Example-Configuration-Profile', 'RetrievalRoleArn' => 'arn:aws:iam::111122223333:role/Example-App-Config-Role', ], 'comments' => [], 'description' => 'The following get-configuration-profile example returns the details of the specified configuration profile.', 'id' => 'to-retrieve-configuration-profile-details-1632266081013', 'title' => 'To retrieve configuration profile details', ], ], 'GetDeployment' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'DeploymentNumber' => 1, 'EnvironmentId' => '54j1r29', ], 'output' => [ 'ApplicationId' => '339ohji', 'CompletedAt' => '2021-09-17T21:59:03.888000+00:00', 'ConfigurationLocationUri' => 'ssm-parameter://Example-Parameter', 'ConfigurationName' => 'Example-Configuration-Profile', 'ConfigurationProfileId' => 'ur8hx2f', 'ConfigurationVersion' => '1', 'DeploymentDurationInMinutes' => 15, 'DeploymentNumber' => 1, 'DeploymentStrategyId' => '1225qzk', 'EnvironmentId' => '54j1r29', 'EventLog' => [ [ 'Description' => 'Deployment completed', 'EventType' => 'DEPLOYMENT_COMPLETED', 'OccurredAt' => '2021-09-17T21:59:03.888000+00:00', 'TriggeredBy' => 'APPCONFIG', ], [ 'Description' => 'Deployment bake time started', 'EventType' => 'BAKE_TIME_STARTED', 'OccurredAt' => '2021-09-17T21:58:57.722000+00:00', 'TriggeredBy' => 'APPCONFIG', ], [ 'Description' => 'Configuration available to 100.00% of clients', 'EventType' => 'PERCENTAGE_UPDATED', 'OccurredAt' => '2021-09-17T21:55:56.816000+00:00', 'TriggeredBy' => 'APPCONFIG', ], [ 'Description' => 'Configuration available to 75.00% of clients', 'EventType' => 'PERCENTAGE_UPDATED', 'OccurredAt' => '2021-09-17T21:52:56.567000+00:00', 'TriggeredBy' => 'APPCONFIG', ], [ 'Description' => 'Configuration available to 50.00% of clients', 'EventType' => 'PERCENTAGE_UPDATED', 'OccurredAt' => '2021-09-17T21:49:55.737000+00:00', 'TriggeredBy' => 'APPCONFIG', ], [ 'Description' => 'Configuration available to 25.00% of clients', 'EventType' => 'PERCENTAGE_UPDATED', 'OccurredAt' => '2021-09-17T21:46:55.187000+00:00', 'TriggeredBy' => 'APPCONFIG', ], [ 'Description' => 'Deployment started', 'EventType' => 'DEPLOYMENT_STARTED', 'OccurredAt' => '2021-09-17T21:43:54.205000+00:00', 'TriggeredBy' => 'USER', ], ], 'FinalBakeTimeInMinutes' => 0, 'GrowthFactor' => 25, 'GrowthType' => 'LINEAR', 'PercentageComplete' => 100, 'StartedAt' => '2021-09-17T21:43:54.205000+00:00', 'State' => 'COMPLETE', ], 'comments' => [], 'description' => 'The following get-deployment example lists details of the deployment to the application in the specified environment and deployment.', 'id' => 'to-retrieve-deployment-details-1633976766883', 'title' => 'To retrieve deployment details', ], ], 'GetDeploymentStrategy' => [ [ 'input' => [ 'DeploymentStrategyId' => '1225qzk', ], 'output' => [ 'DeploymentDurationInMinutes' => 15, 'FinalBakeTimeInMinutes' => 0, 'GrowthFactor' => 25, 'GrowthType' => 'LINEAR', 'Id' => '1225qzk', 'Name' => 'Example-Deployment', 'ReplicateTo' => 'SSM_DOCUMENT', ], 'comments' => [], 'description' => 'The following get-deployment-strategy example lists the details of the specified deployment strategy.', 'id' => 'to-retrieve-details-of-a-deployment-strategy-1632266385805', 'title' => 'To retrieve details of a deployment strategy', ], ], 'GetEnvironment' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'EnvironmentId' => '54j1r29', ], 'output' => [ 'ApplicationId' => '339ohji', 'Id' => '54j1r29', 'Name' => 'Example-Environment', 'State' => 'READY_FOR_DEPLOYMENT', ], 'comments' => [], 'description' => 'The following get-environment example returns the details and state of the specified environment.', 'id' => 'to-retrieve-environment-details-1632266924806', 'title' => 'To retrieve environment details', ], ], 'GetHostedConfigurationVersion' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'ConfigurationProfileId' => 'ur8hx2f', 'VersionNumber' => 1, ], 'output' => [ 'ApplicationId' => '339ohji', 'ConfigurationProfileId' => 'ur8hx2f', 'ContentType' => 'application/json', 'VersionNumber' => 1, ], 'comments' => [], 'description' => 'The following get-hosted-configuration-version example retrieves the configuration details of the AWS AppConfig hosted configuration.', 'id' => 'to-retrieve-hosted-configuration-details-1632267003527', 'title' => 'To retrieve hosted configuration details', ], ], 'ListApplications' => [ [ 'input' => [], 'output' => [ 'Items' => [ [ 'Description' => 'An application used for creating an example.', 'Id' => '339ohji', 'Name' => 'test-application', ], [ 'Id' => 'rwalwu7', 'Name' => 'Test-Application', ], ], ], 'comments' => [], 'description' => 'The following list-applications example lists the available applications in your AWS account.', 'id' => 'to-list-the-available-applications-1632267111131', 'title' => 'To list the available applications', ], ], 'ListConfigurationProfiles' => [ [ 'input' => [ 'ApplicationId' => '339ohji', ], 'output' => [ 'Items' => [ [ 'ApplicationId' => '339ohji', 'Id' => 'ur8hx2f', 'LocationUri' => 'ssm-parameter://Example-Parameter', 'Name' => 'Example-Configuration-Profile', ], ], ], 'comments' => [], 'description' => 'The following list-configuration-profiles example lists the available configuration profiles for the specified application.', 'id' => 'to-list-the-available-configuration-profiles-1632267193265', 'title' => 'To list the available configuration profiles', ], ], 'ListDeploymentStrategies' => [ [ 'input' => [], 'output' => [ 'Items' => [ [ 'DeploymentDurationInMinutes' => 15, 'FinalBakeTimeInMinutes' => 0, 'GrowthFactor' => 25, 'GrowthType' => 'LINEAR', 'Id' => '1225qzk', 'Name' => 'Example-Deployment', 'ReplicateTo' => 'SSM_DOCUMENT', ], ], ], 'comments' => [], 'description' => 'The following list-deployment-strategies example lists the available deployment strategies in your AWS account.', 'id' => 'to-list-the-available-deployment-strategies-1632267364180', 'title' => 'To list the available deployment strategies', ], ], 'ListDeployments' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'EnvironmentId' => '54j1r29', ], 'output' => [ 'Items' => [ [ 'CompletedAt' => '2021-09-17T21:59:03.888000+00:00', 'ConfigurationName' => 'Example-Configuration-Profile', 'ConfigurationVersion' => '1', 'DeploymentDurationInMinutes' => 15, 'DeploymentNumber' => 1, 'FinalBakeTimeInMinutes' => 0, 'GrowthFactor' => 25, 'GrowthType' => 'LINEAR', 'PercentageComplete' => 100, 'StartedAt' => '2021-09-17T21:43:54.205000+00:00', 'State' => 'COMPLETE', ], ], ], 'comments' => [], 'description' => 'The following list-deployments example lists the available deployments in your AWS account for the specified application and environment.', 'id' => 'to-list-the-available-deployments-1632267282025', 'title' => 'To list the available deployments', ], ], 'ListEnvironments' => [ [ 'input' => [ 'ApplicationId' => '339ohji', ], 'output' => [ 'Items' => [ [ 'ApplicationId' => '339ohji', 'Id' => '54j1r29', 'Name' => 'Example-Environment', 'State' => 'READY_FOR_DEPLOYMENT', ], ], ], 'comments' => [], 'description' => 'The following list-environments example lists the available environments in your AWS account for the specified application.', 'id' => 'to-list-the-available-environments-1632267474389', 'title' => 'To list the available environments', ], ], 'ListHostedConfigurationVersions' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'ConfigurationProfileId' => 'ur8hx2f', ], 'output' => [ 'Items' => [ [ 'ApplicationId' => '339ohji', 'ConfigurationProfileId' => 'ur8hx2f', 'ContentType' => 'application/json', 'VersionNumber' => 1, ], ], ], 'comments' => [], 'description' => 'The following list-hosted-configuration-versions example lists the configurations versions hosted in the AWS AppConfig hosted configuration store for the specified application and configuration profile.', 'id' => 'to-list-the-available-hosted-configuration-versions-1632267647667', 'title' => 'To list the available hosted configuration versions', ], ], 'ListTagsForResource' => [ [ 'input' => [ 'ResourceArn' => 'arn:aws:appconfig:us-east-1:111122223333:application/339ohji', ], 'output' => [ 'Tags' => [ 'group1' => '1', ], ], 'comments' => [], 'description' => 'The following list-tags-for-resource example lists the tags of a specified application.', 'id' => 'to-list-the-tags-of-an-application-1632328796560', 'title' => 'To list the tags of an application', ], ], 'StartDeployment' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'ConfigurationProfileId' => 'ur8hx2f', 'ConfigurationVersion' => '1', 'DeploymentStrategyId' => '1225qzk', 'Description' => '', 'EnvironmentId' => '54j1r29', 'Tags' => [], ], 'output' => [ 'ApplicationId' => '339ohji', 'ConfigurationLocationUri' => 'ssm-parameter://Example-Parameter', 'ConfigurationName' => 'Example-Configuration-Profile', 'ConfigurationProfileId' => 'ur8hx2f', 'ConfigurationVersion' => '1', 'DeploymentDurationInMinutes' => 15, 'DeploymentNumber' => 1, 'DeploymentStrategyId' => '1225qzk', 'EnvironmentId' => '54j1r29', 'EventLog' => [ [ 'Description' => 'Deployment started', 'EventType' => 'DEPLOYMENT_STARTED', 'OccurredAt' => '2021-09-17T21:43:54.205000+00:00', 'TriggeredBy' => 'USER', ], ], 'FinalBakeTimeInMinutes' => 0, 'GrowthFactor' => 25, 'GrowthType' => 'LINEAR', 'PercentageComplete' => 1, 'StartedAt' => '2021-09-17T21:43:54.205000+00:00', 'State' => 'DEPLOYING', ], 'comments' => [], 'description' => 'The following start-deployment example starts a deployment to the application using the specified environment, deployment strategy, and configuration profile.', 'id' => 'to-start-a-configuration-deployment-1632328956790', 'title' => 'To start a configuration deployment', ], ], 'StopDeployment' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'DeploymentNumber' => 2, 'EnvironmentId' => '54j1r29', ], 'output' => [ 'DeploymentDurationInMinutes' => 15, 'DeploymentNumber' => 2, 'FinalBakeTimeInMinutes' => 0, 'GrowthFactor' => 25, 'PercentageComplete' => 1, ], 'comments' => [], 'description' => 'The following stop-deployment example stops the deployment of an application configuration to the specified environment.', 'id' => 'to-stop-configuration-deployment-1632329139126', 'title' => 'To stop configuration deployment', ], ], 'TagResource' => [ [ 'input' => [ 'ResourceArn' => 'arn:aws:appconfig:us-east-1:111122223333:application/339ohji', 'Tags' => [ 'group1' => '1', ], ], 'comments' => [], 'description' => 'The following tag-resource example tags an application resource.', 'id' => 'to-tag-an-application-1632330350645', 'title' => 'To tag an application', ], ], 'UntagResource' => [ [ 'input' => [ 'ResourceArn' => 'arn:aws:appconfig:us-east-1:111122223333:application/339ohji', 'TagKeys' => [ 'group1', ], ], 'comments' => [], 'description' => 'The following untag-resource example removes the group1 tag from the specified application.', 'id' => 'to-remove-a-tag-from-an-application-1632330429881', 'title' => 'To remove a tag from an application', ], ], 'UpdateApplication' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'Description' => '', 'Name' => 'Example-Application', ], 'output' => [ 'Description' => 'An application used for creating an example.', 'Id' => '339ohji', 'Name' => 'Example-Application', ], 'comments' => [], 'description' => 'The following update-application example updates the name of the specified application.', 'id' => 'to-update-an-application-1632330585893', 'title' => 'To update an application', ], ], 'UpdateConfigurationProfile' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'ConfigurationProfileId' => 'ur8hx2f', 'Description' => 'Configuration profile used for examples.', ], 'output' => [ 'ApplicationId' => '339ohji', 'Description' => 'Configuration profile used for examples.', 'Id' => 'ur8hx2f', 'LocationUri' => 'ssm-parameter://Example-Parameter', 'Name' => 'Example-Configuration-Profile', 'RetrievalRoleArn' => 'arn:aws:iam::111122223333:role/Example-App-Config-Role', ], 'comments' => [], 'description' => 'The following update-configuration-profile example updates the description of the specified configuration profile.', 'id' => 'to-update-a-configuration-profile-1632330721974', 'title' => 'To update a configuration profile', ], ], 'UpdateDeploymentStrategy' => [ [ 'input' => [ 'DeploymentStrategyId' => '1225qzk', 'FinalBakeTimeInMinutes' => 20, ], 'output' => [ 'DeploymentDurationInMinutes' => 15, 'FinalBakeTimeInMinutes' => 20, 'GrowthFactor' => 25, 'GrowthType' => 'LINEAR', 'Id' => '1225qzk', 'Name' => 'Example-Deployment', 'ReplicateTo' => 'SSM_DOCUMENT', ], 'comments' => [], 'description' => 'The following update-deployment-strategy example updates final bake time to 20 minutes in the specified deployment strategy. ::', 'id' => 'to-update-a-deployment-strategy-1632330896602', 'title' => 'To update a deployment strategy', ], ], 'UpdateEnvironment' => [ [ 'input' => [ 'ApplicationId' => '339ohji', 'Description' => 'An environment for examples.', 'EnvironmentId' => '54j1r29', ], 'output' => [ 'ApplicationId' => '339ohji', 'Description' => 'An environment for examples.', 'Id' => '54j1r29', 'Name' => 'Example-Environment', 'State' => 'ROLLED_BACK', ], 'comments' => [], 'description' => 'The following update-environment example updates an environment\\'s description.', 'id' => 'to-update-an-environment-1632331382428', 'title' => 'To update an environment', ], ], 'ValidateConfiguration' => [ [ 'input' => [ 'ApplicationId' => 'abc1234', 'ConfigurationProfileId' => 'ur8hx2f', 'ConfigurationVersion' => '1', ], 'comments' => [], 'description' => 'The following validate-configuration example uses the validators in a configuration profile to validate a configuration.', 'id' => 'to-validate-a-configuration-1632331491365', 'title' => 'To validate a configuration', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appconfig/2019-10-09/paginators-1.json\nreturn [ 'pagination' => [ 'ListApplications' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListConfigurationProfiles' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListDeploymentStrategies' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListDeployments' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListEnvironments' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListExtensionAssociations' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListExtensions' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListHostedConfigurationVersions' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appconfigdata/2021-11-11/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2021-11-11', 'endpointPrefix' => 'appconfigdata', 'jsonVersion' => '1.0', 'protocol' => 'rest-json', 'serviceFullName' => 'AWS AppConfig Data', 'serviceId' => 'AppConfigData', 'signatureVersion' => 'v4', 'signingName' => 'appconfig', 'uid' => 'appconfigdata-2021-11-11', ], 'operations' => [ 'GetLatestConfiguration' => [ 'name' => 'GetLatestConfiguration', 'http' => [ 'method' => 'GET', 'requestUri' => '/configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetLatestConfigurationRequest', ], 'output' => [ 'shape' => 'GetLatestConfigurationResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalServerException', ], ], ], 'StartConfigurationSession' => [ 'name' => 'StartConfigurationSession', 'http' => [ 'method' => 'POST', 'requestUri' => '/configurationsessions', 'responseCode' => 201, ], 'input' => [ 'shape' => 'StartConfigurationSessionRequest', ], 'output' => [ 'shape' => 'StartConfigurationSessionResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalServerException', ], ], ], ], 'shapes' => [ 'BadRequestDetails' => [ 'type' => 'structure', 'members' => [ 'InvalidParameters' => [ 'shape' => 'InvalidParameterMap', ], ], 'union' => true, ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'String', ], 'Reason' => [ 'shape' => 'BadRequestReason', ], 'Details' => [ 'shape' => 'BadRequestDetails', ], ], 'error' => [ 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'BadRequestReason' => [ 'type' => 'string', 'enum' => [ 'InvalidParameters', ], ], 'GetLatestConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'ConfigurationToken', ], 'members' => [ 'ConfigurationToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'configuration_token', ], ], ], 'GetLatestConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'NextPollConfigurationToken' => [ 'shape' => 'Token', 'location' => 'header', 'locationName' => 'Next-Poll-Configuration-Token', ], 'NextPollIntervalInSeconds' => [ 'shape' => 'Integer', 'location' => 'header', 'locationName' => 'Next-Poll-Interval-In-Seconds', ], 'ContentType' => [ 'shape' => 'String', 'location' => 'header', 'locationName' => 'Content-Type', ], 'Configuration' => [ 'shape' => 'SensitiveBlob', ], 'VersionLabel' => [ 'shape' => 'String', 'location' => 'header', 'locationName' => 'Version-Label', ], ], 'payload' => 'Configuration', ], 'Identifier' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'Integer' => [ 'type' => 'integer', ], 'InternalServerException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'InvalidParameterDetail' => [ 'type' => 'structure', 'members' => [ 'Problem' => [ 'shape' => 'InvalidParameterProblem', ], ], ], 'InvalidParameterMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'InvalidParameterDetail', ], ], 'InvalidParameterProblem' => [ 'type' => 'string', 'enum' => [ 'Corrupted', 'Expired', 'PollIntervalNotSatisfied', ], ], 'OptionalPollSeconds' => [ 'type' => 'integer', 'box' => true, 'max' => 86400, 'min' => 15, ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'String', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'ReferencedBy' => [ 'shape' => 'StringMap', ], ], 'error' => [ 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'ResourceType' => [ 'type' => 'string', 'enum' => [ 'Application', 'ConfigurationProfile', 'Deployment', 'Environment', 'Configuration', ], ], 'SensitiveBlob' => [ 'type' => 'blob', 'sensitive' => true, ], 'StartConfigurationSessionRequest' => [ 'type' => 'structure', 'required' => [ 'ApplicationIdentifier', 'EnvironmentIdentifier', 'ConfigurationProfileIdentifier', ], 'members' => [ 'ApplicationIdentifier' => [ 'shape' => 'Identifier', ], 'EnvironmentIdentifier' => [ 'shape' => 'Identifier', ], 'ConfigurationProfileIdentifier' => [ 'shape' => 'Identifier', ], 'RequiredMinimumPollIntervalInSeconds' => [ 'shape' => 'OptionalPollSeconds', ], ], ], 'StartConfigurationSessionResponse' => [ 'type' => 'structure', 'members' => [ 'InitialConfigurationToken' => [ 'shape' => 'Token', ], ], ], 'String' => [ 'type' => 'string', ], 'StringMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], 'ThrottlingException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 429, 'senderFault' => true, ], 'exception' => true, ], 'Token' => [ 'type' => 'string', 'pattern' => '\\\\S{1,8192}', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appconfigdata/2021-11-11/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>AppConfig Data provides the data plane APIs your application uses to retrieve configuration data. Here\\'s how it works:</p> <p>Your application retrieves configuration data by first establishing a configuration session using the AppConfig Data <a>StartConfigurationSession</a> API action. Your session\\'s client then makes periodic calls to <a>GetLatestConfiguration</a> to check for and retrieve the latest data available.</p> <p>When calling <code>StartConfigurationSession</code>, your code sends the following information:</p> <ul> <li> <p>Identifiers (ID or name) of an AppConfig application, environment, and configuration profile that the session tracks.</p> </li> <li> <p>(Optional) The minimum amount of time the session\\'s client must wait between calls to <code>GetLatestConfiguration</code>.</p> </li> </ul> <p>In response, AppConfig provides an <code>InitialConfigurationToken</code> to be given to the session\\'s client and used the first time it calls <code>GetLatestConfiguration</code> for that session.</p> <important> <p>This token should only be used once in your first call to <code>GetLatestConfiguration</code>. You <i>must</i> use the new token in the <code>GetLatestConfiguration</code> response (<code>NextPollConfigurationToken</code>) in each subsequent call to <code>GetLatestConfiguration</code>.</p> </important> <p>When calling <code>GetLatestConfiguration</code>, your client code sends the most recent <code>ConfigurationToken</code> value it has and receives in response:</p> <ul> <li> <p> <code>NextPollConfigurationToken</code>: the <code>ConfigurationToken</code> value to use on the next call to <code>GetLatestConfiguration</code>.</p> </li> <li> <p> <code>NextPollIntervalInSeconds</code>: the duration the client should wait before making its next call to <code>GetLatestConfiguration</code>. This duration may vary over the course of the session, so it should be used instead of the value sent on the <code>StartConfigurationSession</code> call.</p> </li> <li> <p>The configuration: the latest data intended for the session. This may be empty if the client already has the latest version of the configuration.</p> </li> </ul> <important> <p>The <code>InitialConfigurationToken</code> and <code>NextPollConfigurationToken</code> should only be used once. To support long poll use cases, the tokens are valid for up to 24 hours. If a <code>GetLatestConfiguration</code> call uses an expired token, the system returns <code>BadRequestException</code>.</p> </important> <p>For more information and to view example CLI commands that show how to retrieve a configuration using the AppConfig Data <code>StartConfigurationSession</code> and <code>GetLatestConfiguration</code> API actions, see <a href=\"http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration\">Retrieving the configuration</a> in the <i>AppConfig User Guide</i>.</p>', 'operations' => [ 'GetLatestConfiguration' => '<p>Retrieves the latest deployed configuration. This API may return empty configuration data if the client already has the latest version. For more information about this API action and to view example CLI commands that show how to use it with the <a>StartConfigurationSession</a> API action, see <a href=\"http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration\">Retrieving the configuration</a> in the <i>AppConfig User Guide</i>. </p> <important> <p>Note the following important information.</p> <ul> <li> <p>Each configuration token is only valid for one call to <code>GetLatestConfiguration</code>. The <code>GetLatestConfiguration</code> response includes a <code>NextPollConfigurationToken</code> that should always replace the token used for the just-completed call in preparation for the next one. </p> </li> <li> <p> <code>GetLatestConfiguration</code> is a priced call. For more information, see <a href=\"https://aws.amazon.com/systems-manager/pricing/\">Pricing</a>.</p> </li> </ul> </important>', 'StartConfigurationSession' => '<p>Starts a configuration session used to retrieve a deployed configuration. For more information about this API action and to view example CLI commands that show how to use it with the <a>GetLatestConfiguration</a> API action, see <a href=\"http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration\">Retrieving the configuration</a> in the <i>AppConfig User Guide</i>. </p>', ], 'shapes' => [ 'BadRequestDetails' => [ 'base' => '<p>Detailed information about the input that failed to satisfy the constraints specified by a call.</p>', 'refs' => [ 'BadRequestException$Details' => '<p>Details describing why the request was invalid.</p>', ], ], 'BadRequestException' => [ 'base' => '<p>The input fails to satisfy the constraints specified by the service.</p>', 'refs' => [], ], 'BadRequestReason' => [ 'base' => NULL, 'refs' => [ 'BadRequestException$Reason' => '<p>Code indicating the reason the request was invalid.</p>', ], ], 'GetLatestConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetLatestConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'Identifier' => [ 'base' => NULL, 'refs' => [ 'StartConfigurationSessionRequest$ApplicationIdentifier' => '<p>The application ID or the application name.</p>', 'StartConfigurationSessionRequest$EnvironmentIdentifier' => '<p>The environment ID or the environment name.</p>', 'StartConfigurationSessionRequest$ConfigurationProfileIdentifier' => '<p>The configuration profile ID or the configuration profile name.</p>', ], ], 'Integer' => [ 'base' => NULL, 'refs' => [ 'GetLatestConfigurationResponse$NextPollIntervalInSeconds' => '<p>The amount of time the client should wait before polling for configuration updates again. Use <code>RequiredMinimumPollIntervalInSeconds</code> to set the desired poll interval.</p>', ], ], 'InternalServerException' => [ 'base' => '<p>There was an internal failure in the service.</p>', 'refs' => [], ], 'InvalidParameterDetail' => [ 'base' => '<p>Information about an invalid parameter.</p>', 'refs' => [ 'InvalidParameterMap$value' => NULL, ], ], 'InvalidParameterMap' => [ 'base' => NULL, 'refs' => [ 'BadRequestDetails$InvalidParameters' => '<p>One or more specified parameters are not valid for the call.</p>', ], ], 'InvalidParameterProblem' => [ 'base' => NULL, 'refs' => [ 'InvalidParameterDetail$Problem' => '<p>The reason the parameter is invalid.</p>', ], ], 'OptionalPollSeconds' => [ 'base' => NULL, 'refs' => [ 'StartConfigurationSessionRequest$RequiredMinimumPollIntervalInSeconds' => '<p>Sets a constraint on a session. If you specify a value of, for example, 60 seconds, then the client that established the session can\\'t call <a>GetLatestConfiguration</a> more frequently than every 60 seconds.</p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p>The requested resource could not be found.</p>', 'refs' => [], ], 'ResourceType' => [ 'base' => NULL, 'refs' => [ 'ResourceNotFoundException$ResourceType' => '<p>The type of resource that was not found.</p>', ], ], 'SensitiveBlob' => [ 'base' => NULL, 'refs' => [ 'GetLatestConfigurationResponse$Configuration' => '<p>The data of the configuration. This may be empty if the client already has the latest version of configuration.</p>', ], ], 'StartConfigurationSessionRequest' => [ 'base' => NULL, 'refs' => [], ], 'StartConfigurationSessionResponse' => [ 'base' => NULL, 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [ 'BadRequestException$Message' => NULL, 'GetLatestConfigurationResponse$ContentType' => '<p>A standard MIME type describing the format of the configuration content.</p>', 'GetLatestConfigurationResponse$VersionLabel' => '<p>The user-defined label for the AppConfig hosted configuration version. This attribute doesn\\'t apply if the configuration is not from an AppConfig hosted configuration version. If the client already has the latest version of the configuration data, this value is empty.</p>', 'InternalServerException$Message' => NULL, 'InvalidParameterMap$key' => NULL, 'ResourceNotFoundException$Message' => NULL, 'StringMap$key' => NULL, 'StringMap$value' => NULL, 'ThrottlingException$Message' => NULL, ], ], 'StringMap' => [ 'base' => NULL, 'refs' => [ 'ResourceNotFoundException$ReferencedBy' => '<p>A map indicating which parameters in the request reference the resource that was not found.</p>', ], ], 'ThrottlingException' => [ 'base' => '<p>The request was denied due to request throttling.</p>', 'refs' => [], ], 'Token' => [ 'base' => NULL, 'refs' => [ 'GetLatestConfigurationRequest$ConfigurationToken' => '<p>Token describing the current state of the configuration session. To obtain a token, first call the <a>StartConfigurationSession</a> API. Note that every call to <code>GetLatestConfiguration</code> will return a new <code>ConfigurationToken</code> (<code>NextPollConfigurationToken</code> in the response) and <i>must</i> be provided to subsequent <code>GetLatestConfiguration</code> API calls.</p> <important> <p>This token should only be used once. To support long poll use cases, the token is valid for up to 24 hours. If a <code>GetLatestConfiguration</code> call uses an expired token, the system returns <code>BadRequestException</code>.</p> </important>', 'GetLatestConfigurationResponse$NextPollConfigurationToken' => '<p>The latest token describing the current state of the configuration session. This <i>must</i> be provided to the next call to <code>GetLatestConfiguration.</code> </p> <important> <p>This token should only be used once. To support long poll use cases, the token is valid for up to 24 hours. If a <code>GetLatestConfiguration</code> call uses an expired token, the system returns <code>BadRequestException</code>.</p> </important>', 'StartConfigurationSessionResponse$InitialConfigurationToken' => '<p>Token encapsulating state about the configuration session. Provide this token to the <code>GetLatestConfiguration</code> API to retrieve configuration data.</p> <important> <p>This token should only be used once in your first call to <code>GetLatestConfiguration</code>. You <i>must</i> use the new token in the <code>GetLatestConfiguration</code> response (<code>NextPollConfigurationToken</code>) in each subsequent call to <code>GetLatestConfiguration</code>.</p> <p>The <code>InitialConfigurationToken</code> and <code>NextPollConfigurationToken</code> should only be used once. To support long poll use cases, the tokens are valid for up to 24 hours. If a <code>GetLatestConfiguration</code> call uses an expired token, the system returns <code>BadRequestException</code>.</p> </important>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appconfigdata/2021-11-11/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appconfigdata-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appconfigdata-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appconfigdata.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appconfigdata.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appconfigdata/2021-11-11/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-iso-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.us-iso-west-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appconfigdata.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appconfigdata/2021-11-11/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appconfigdata/2021-11-11/paginators-1.json\nreturn [ 'pagination' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appfabric/2023-05-19/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2023-05-19', 'endpointPrefix' => 'appfabric', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'AppFabric', 'serviceId' => 'AppFabric', 'signatureVersion' => 'v4', 'signingName' => 'appfabric', 'uid' => 'appfabric-2023-05-19', ], 'operations' => [ 'BatchGetUserAccessTasks' => [ 'name' => 'BatchGetUserAccessTasks', 'http' => [ 'method' => 'POST', 'requestUri' => '/useraccess/batchget', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchGetUserAccessTasksRequest', ], 'output' => [ 'shape' => 'BatchGetUserAccessTasksResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ConnectAppAuthorization' => [ 'name' => 'ConnectAppAuthorization', 'http' => [ 'method' => 'POST', 'requestUri' => '/appbundles/{appBundleIdentifier}/appauthorizations/{appAuthorizationIdentifier}/connect', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ConnectAppAuthorizationRequest', ], 'output' => [ 'shape' => 'ConnectAppAuthorizationResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'CreateAppAuthorization' => [ 'name' => 'CreateAppAuthorization', 'http' => [ 'method' => 'POST', 'requestUri' => '/appbundles/{appBundleIdentifier}/appauthorizations', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateAppAuthorizationRequest', ], 'output' => [ 'shape' => 'CreateAppAuthorizationResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'CreateAppBundle' => [ 'name' => 'CreateAppBundle', 'http' => [ 'method' => 'POST', 'requestUri' => '/appbundles', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateAppBundleRequest', ], 'output' => [ 'shape' => 'CreateAppBundleResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'CreateIngestion' => [ 'name' => 'CreateIngestion', 'http' => [ 'method' => 'POST', 'requestUri' => '/appbundles/{appBundleIdentifier}/ingestions', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateIngestionRequest', ], 'output' => [ 'shape' => 'CreateIngestionResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'CreateIngestionDestination' => [ 'name' => 'CreateIngestionDestination', 'http' => [ 'method' => 'POST', 'requestUri' => '/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/ingestiondestinations', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateIngestionDestinationRequest', ], 'output' => [ 'shape' => 'CreateIngestionDestinationResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'DeleteAppAuthorization' => [ 'name' => 'DeleteAppAuthorization', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/appbundles/{appBundleIdentifier}/appauthorizations/{appAuthorizationIdentifier}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteAppAuthorizationRequest', ], 'output' => [ 'shape' => 'DeleteAppAuthorizationResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'DeleteAppBundle' => [ 'name' => 'DeleteAppBundle', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/appbundles/{appBundleIdentifier}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteAppBundleRequest', ], 'output' => [ 'shape' => 'DeleteAppBundleResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'DeleteIngestion' => [ 'name' => 'DeleteIngestion', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteIngestionRequest', ], 'output' => [ 'shape' => 'DeleteIngestionResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'DeleteIngestionDestination' => [ 'name' => 'DeleteIngestionDestination', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/ingestiondestinations/{ingestionDestinationIdentifier}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteIngestionDestinationRequest', ], 'output' => [ 'shape' => 'DeleteIngestionDestinationResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'GetAppAuthorization' => [ 'name' => 'GetAppAuthorization', 'http' => [ 'method' => 'GET', 'requestUri' => '/appbundles/{appBundleIdentifier}/appauthorizations/{appAuthorizationIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetAppAuthorizationRequest', ], 'output' => [ 'shape' => 'GetAppAuthorizationResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetAppBundle' => [ 'name' => 'GetAppBundle', 'http' => [ 'method' => 'GET', 'requestUri' => '/appbundles/{appBundleIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetAppBundleRequest', ], 'output' => [ 'shape' => 'GetAppBundleResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetIngestion' => [ 'name' => 'GetIngestion', 'http' => [ 'method' => 'GET', 'requestUri' => '/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetIngestionRequest', ], 'output' => [ 'shape' => 'GetIngestionResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetIngestionDestination' => [ 'name' => 'GetIngestionDestination', 'http' => [ 'method' => 'GET', 'requestUri' => '/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/ingestiondestinations/{ingestionDestinationIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetIngestionDestinationRequest', ], 'output' => [ 'shape' => 'GetIngestionDestinationResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListAppAuthorizations' => [ 'name' => 'ListAppAuthorizations', 'http' => [ 'method' => 'GET', 'requestUri' => '/appbundles/{appBundleIdentifier}/appauthorizations', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAppAuthorizationsRequest', ], 'output' => [ 'shape' => 'ListAppAuthorizationsResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListAppBundles' => [ 'name' => 'ListAppBundles', 'http' => [ 'method' => 'GET', 'requestUri' => '/appbundles', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAppBundlesRequest', ], 'output' => [ 'shape' => 'ListAppBundlesResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListIngestionDestinations' => [ 'name' => 'ListIngestionDestinations', 'http' => [ 'method' => 'GET', 'requestUri' => '/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/ingestiondestinations', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListIngestionDestinationsRequest', ], 'output' => [ 'shape' => 'ListIngestionDestinationsResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListIngestions' => [ 'name' => 'ListIngestions', 'http' => [ 'method' => 'GET', 'requestUri' => '/appbundles/{appBundleIdentifier}/ingestions', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListIngestionsRequest', ], 'output' => [ 'shape' => 'ListIngestionsResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags/{resourceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'StartIngestion' => [ 'name' => 'StartIngestion', 'http' => [ 'method' => 'POST', 'requestUri' => '/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/start', 'responseCode' => 200, ], 'input' => [ 'shape' => 'StartIngestionRequest', ], 'output' => [ 'shape' => 'StartIngestionResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'StartUserAccessTasks' => [ 'name' => 'StartUserAccessTasks', 'http' => [ 'method' => 'POST', 'requestUri' => '/useraccess/start', 'responseCode' => 201, ], 'input' => [ 'shape' => 'StartUserAccessTasksRequest', ], 'output' => [ 'shape' => 'StartUserAccessTasksResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'StopIngestion' => [ 'name' => 'StopIngestion', 'http' => [ 'method' => 'POST', 'requestUri' => '/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/stop', 'responseCode' => 200, ], 'input' => [ 'shape' => 'StopIngestionRequest', ], 'output' => [ 'shape' => 'StopIngestionResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags/{resourceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/tags/{resourceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'UpdateAppAuthorization' => [ 'name' => 'UpdateAppAuthorization', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/appbundles/{appBundleIdentifier}/appauthorizations/{appAuthorizationIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateAppAuthorizationRequest', ], 'output' => [ 'shape' => 'UpdateAppAuthorizationResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'UpdateIngestionDestination' => [ 'name' => 'UpdateIngestionDestination', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/ingestiondestinations/{ingestionDestinationIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateIngestionDestinationRequest', ], 'output' => [ 'shape' => 'UpdateIngestionDestinationResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], ], ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 403, 'senderFault' => true, ], 'exception' => true, ], 'ApiKeyCredential' => [ 'type' => 'structure', 'required' => [ 'apiKey', ], 'members' => [ 'apiKey' => [ 'shape' => 'SensitiveString2048', ], ], ], 'AppAuthorization' => [ 'type' => 'structure', 'required' => [ 'appAuthorizationArn', 'appBundleArn', 'app', 'tenant', 'authType', 'status', 'createdAt', 'updatedAt', ], 'members' => [ 'appAuthorizationArn' => [ 'shape' => 'Arn', ], 'appBundleArn' => [ 'shape' => 'Arn', ], 'app' => [ 'shape' => 'String255', ], 'tenant' => [ 'shape' => 'Tenant', ], 'authType' => [ 'shape' => 'AuthType', ], 'status' => [ 'shape' => 'AppAuthorizationStatus', ], 'createdAt' => [ 'shape' => 'DateTime', ], 'updatedAt' => [ 'shape' => 'DateTime', ], 'persona' => [ 'shape' => 'Persona', ], 'authUrl' => [ 'shape' => 'String', ], ], ], 'AppAuthorizationStatus' => [ 'type' => 'string', 'enum' => [ 'PendingConnect', 'Connected', 'ConnectionValidationFailed', 'TokenAutoRotationFailed', ], ], 'AppAuthorizationSummary' => [ 'type' => 'structure', 'required' => [ 'appAuthorizationArn', 'appBundleArn', 'app', 'tenant', 'status', 'updatedAt', ], 'members' => [ 'appAuthorizationArn' => [ 'shape' => 'Arn', ], 'appBundleArn' => [ 'shape' => 'Arn', ], 'app' => [ 'shape' => 'String255', ], 'tenant' => [ 'shape' => 'Tenant', ], 'status' => [ 'shape' => 'AppAuthorizationStatus', ], 'updatedAt' => [ 'shape' => 'DateTime', ], ], ], 'AppAuthorizationSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AppAuthorizationSummary', ], ], 'AppBundle' => [ 'type' => 'structure', 'required' => [ 'arn', ], 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'customerManagedKeyArn' => [ 'shape' => 'Arn', ], ], ], 'AppBundleSummary' => [ 'type' => 'structure', 'required' => [ 'arn', ], 'members' => [ 'arn' => [ 'shape' => 'Arn', ], ], ], 'AppBundleSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AppBundleSummary', ], ], 'Arn' => [ 'type' => 'string', 'max' => 1011, 'min' => 1, 'pattern' => 'arn:.+', ], 'AuditLogDestinationConfiguration' => [ 'type' => 'structure', 'required' => [ 'destination', ], 'members' => [ 'destination' => [ 'shape' => 'Destination', ], ], ], 'AuditLogProcessingConfiguration' => [ 'type' => 'structure', 'required' => [ 'schema', 'format', ], 'members' => [ 'schema' => [ 'shape' => 'Schema', ], 'format' => [ 'shape' => 'Format', ], ], ], 'AuthRequest' => [ 'type' => 'structure', 'required' => [ 'redirectUri', 'code', ], 'members' => [ 'redirectUri' => [ 'shape' => 'RedirectUri', ], 'code' => [ 'shape' => 'SensitiveString2048', ], ], ], 'AuthType' => [ 'type' => 'string', 'enum' => [ 'oauth2', 'apiKey', ], ], 'BatchGetUserAccessTasksRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', 'taskIdList', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', ], 'taskIdList' => [ 'shape' => 'TaskIdList', ], ], ], 'BatchGetUserAccessTasksResponse' => [ 'type' => 'structure', 'members' => [ 'userAccessResultsList' => [ 'shape' => 'UserAccessResultsList', ], ], ], 'ConflictException' => [ 'type' => 'structure', 'required' => [ 'message', 'resourceId', 'resourceType', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'resourceId' => [ 'shape' => 'String', ], 'resourceType' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'ConnectAppAuthorizationRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', 'appAuthorizationIdentifier', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], 'appAuthorizationIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appAuthorizationIdentifier', ], 'authRequest' => [ 'shape' => 'AuthRequest', ], ], ], 'ConnectAppAuthorizationResponse' => [ 'type' => 'structure', 'required' => [ 'appAuthorizationSummary', ], 'members' => [ 'appAuthorizationSummary' => [ 'shape' => 'AppAuthorizationSummary', ], ], ], 'CreateAppAuthorizationRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', 'app', 'credential', 'tenant', 'authType', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], 'app' => [ 'shape' => 'String255', ], 'credential' => [ 'shape' => 'Credential', ], 'tenant' => [ 'shape' => 'Tenant', ], 'authType' => [ 'shape' => 'AuthType', ], 'clientToken' => [ 'shape' => 'UUID', 'idempotencyToken' => true, ], 'tags' => [ 'shape' => 'TagList', ], ], ], 'CreateAppAuthorizationResponse' => [ 'type' => 'structure', 'required' => [ 'appAuthorization', ], 'members' => [ 'appAuthorization' => [ 'shape' => 'AppAuthorization', ], ], ], 'CreateAppBundleRequest' => [ 'type' => 'structure', 'members' => [ 'clientToken' => [ 'shape' => 'UUID', 'idempotencyToken' => true, ], 'customerManagedKeyIdentifier' => [ 'shape' => 'Identifier', ], 'tags' => [ 'shape' => 'TagList', ], ], ], 'CreateAppBundleResponse' => [ 'type' => 'structure', 'required' => [ 'appBundle', ], 'members' => [ 'appBundle' => [ 'shape' => 'AppBundle', ], ], ], 'CreateIngestionDestinationRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', 'ingestionIdentifier', 'processingConfiguration', 'destinationConfiguration', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], 'ingestionIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'ingestionIdentifier', ], 'processingConfiguration' => [ 'shape' => 'ProcessingConfiguration', ], 'destinationConfiguration' => [ 'shape' => 'DestinationConfiguration', ], 'clientToken' => [ 'shape' => 'UUID', 'idempotencyToken' => true, ], 'tags' => [ 'shape' => 'TagList', ], ], ], 'CreateIngestionDestinationResponse' => [ 'type' => 'structure', 'required' => [ 'ingestionDestination', ], 'members' => [ 'ingestionDestination' => [ 'shape' => 'IngestionDestination', ], ], ], 'CreateIngestionRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', 'app', 'tenantId', 'ingestionType', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], 'app' => [ 'shape' => 'String255', ], 'tenantId' => [ 'shape' => 'TenantIdentifier', ], 'ingestionType' => [ 'shape' => 'IngestionType', ], 'clientToken' => [ 'shape' => 'UUID', 'idempotencyToken' => true, ], 'tags' => [ 'shape' => 'TagList', ], ], ], 'CreateIngestionResponse' => [ 'type' => 'structure', 'required' => [ 'ingestion', ], 'members' => [ 'ingestion' => [ 'shape' => 'Ingestion', ], ], ], 'Credential' => [ 'type' => 'structure', 'members' => [ 'oauth2Credential' => [ 'shape' => 'Oauth2Credential', ], 'apiKeyCredential' => [ 'shape' => 'ApiKeyCredential', ], ], 'union' => true, ], 'DateTime' => [ 'type' => 'timestamp', 'timestampFormat' => 'iso8601', ], 'DeleteAppAuthorizationRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', 'appAuthorizationIdentifier', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], 'appAuthorizationIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appAuthorizationIdentifier', ], ], ], 'DeleteAppAuthorizationResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteAppBundleRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], ], ], 'DeleteAppBundleResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteIngestionDestinationRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', 'ingestionIdentifier', 'ingestionDestinationIdentifier', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], 'ingestionIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'ingestionIdentifier', ], 'ingestionDestinationIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'ingestionDestinationIdentifier', ], ], ], 'DeleteIngestionDestinationResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteIngestionRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', 'ingestionIdentifier', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], 'ingestionIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'ingestionIdentifier', ], ], ], 'DeleteIngestionResponse' => [ 'type' => 'structure', 'members' => [], ], 'Destination' => [ 'type' => 'structure', 'members' => [ 's3Bucket' => [ 'shape' => 'S3Bucket', ], 'firehoseStream' => [ 'shape' => 'FirehoseStream', ], ], 'union' => true, ], 'DestinationConfiguration' => [ 'type' => 'structure', 'members' => [ 'auditLog' => [ 'shape' => 'AuditLogDestinationConfiguration', ], ], 'union' => true, ], 'Email' => [ 'type' => 'string', 'max' => 320, 'min' => 0, 'pattern' => '[a-zA-Z0-9.!#$%&\u00e2\u20ac\u2122*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\\\.[a-zA-Z0-9-]+)*', 'sensitive' => true, ], 'FirehoseStream' => [ 'type' => 'structure', 'required' => [ 'streamName', ], 'members' => [ 'streamName' => [ 'shape' => 'String64', ], ], ], 'Format' => [ 'type' => 'string', 'enum' => [ 'json', 'parquet', ], ], 'GetAppAuthorizationRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', 'appAuthorizationIdentifier', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], 'appAuthorizationIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appAuthorizationIdentifier', ], ], ], 'GetAppAuthorizationResponse' => [ 'type' => 'structure', 'required' => [ 'appAuthorization', ], 'members' => [ 'appAuthorization' => [ 'shape' => 'AppAuthorization', ], ], ], 'GetAppBundleRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], ], ], 'GetAppBundleResponse' => [ 'type' => 'structure', 'required' => [ 'appBundle', ], 'members' => [ 'appBundle' => [ 'shape' => 'AppBundle', ], ], ], 'GetIngestionDestinationRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', 'ingestionIdentifier', 'ingestionDestinationIdentifier', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], 'ingestionIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'ingestionIdentifier', ], 'ingestionDestinationIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'ingestionDestinationIdentifier', ], ], ], 'GetIngestionDestinationResponse' => [ 'type' => 'structure', 'required' => [ 'ingestionDestination', ], 'members' => [ 'ingestionDestination' => [ 'shape' => 'IngestionDestination', ], ], ], 'GetIngestionRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', 'ingestionIdentifier', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], 'ingestionIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'ingestionIdentifier', ], ], ], 'GetIngestionResponse' => [ 'type' => 'structure', 'required' => [ 'ingestion', ], 'members' => [ 'ingestion' => [ 'shape' => 'Ingestion', ], ], ], 'Identifier' => [ 'type' => 'string', 'max' => 1011, 'min' => 1, 'pattern' => 'arn:.+$|^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}', ], 'Ingestion' => [ 'type' => 'structure', 'required' => [ 'arn', 'appBundleArn', 'app', 'tenantId', 'createdAt', 'updatedAt', 'state', 'ingestionType', ], 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'appBundleArn' => [ 'shape' => 'Arn', ], 'app' => [ 'shape' => 'String255', ], 'tenantId' => [ 'shape' => 'TenantIdentifier', ], 'createdAt' => [ 'shape' => 'DateTime', ], 'updatedAt' => [ 'shape' => 'DateTime', ], 'state' => [ 'shape' => 'IngestionState', ], 'ingestionType' => [ 'shape' => 'IngestionType', ], ], ], 'IngestionDestination' => [ 'type' => 'structure', 'required' => [ 'arn', 'ingestionArn', 'processingConfiguration', 'destinationConfiguration', ], 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'ingestionArn' => [ 'shape' => 'Arn', ], 'processingConfiguration' => [ 'shape' => 'ProcessingConfiguration', ], 'destinationConfiguration' => [ 'shape' => 'DestinationConfiguration', ], 'status' => [ 'shape' => 'IngestionDestinationStatus', ], 'statusReason' => [ 'shape' => 'String', ], 'createdAt' => [ 'shape' => 'DateTime', ], 'updatedAt' => [ 'shape' => 'DateTime', ], ], ], 'IngestionDestinationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'IngestionDestinationSummary', ], ], 'IngestionDestinationStatus' => [ 'type' => 'string', 'enum' => [ 'Active', 'Failed', ], ], 'IngestionDestinationSummary' => [ 'type' => 'structure', 'required' => [ 'arn', ], 'members' => [ 'arn' => [ 'shape' => 'Arn', ], ], ], 'IngestionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'IngestionSummary', ], ], 'IngestionState' => [ 'type' => 'string', 'enum' => [ 'enabled', 'disabled', ], ], 'IngestionSummary' => [ 'type' => 'structure', 'required' => [ 'arn', 'app', 'tenantId', 'state', ], 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'app' => [ 'shape' => 'String255', ], 'tenantId' => [ 'shape' => 'TenantIdentifier', ], 'state' => [ 'shape' => 'IngestionState', ], ], ], 'IngestionType' => [ 'type' => 'string', 'enum' => [ 'auditLog', ], ], 'Integer' => [ 'type' => 'integer', 'box' => true, ], 'InternalServerException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'retryAfterSeconds' => [ 'shape' => 'Integer', 'location' => 'header', 'locationName' => 'Retry-After', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, 'retryable' => [ 'throttling' => false, ], ], 'ListAppAuthorizationsRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'nextToken' => [ 'shape' => 'String2048', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'ListAppAuthorizationsResponse' => [ 'type' => 'structure', 'required' => [ 'appAuthorizationSummaryList', ], 'members' => [ 'appAuthorizationSummaryList' => [ 'shape' => 'AppAuthorizationSummaryList', ], 'nextToken' => [ 'shape' => 'String2048', ], ], ], 'ListAppBundlesRequest' => [ 'type' => 'structure', 'members' => [ 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'nextToken' => [ 'shape' => 'String2048', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'ListAppBundlesResponse' => [ 'type' => 'structure', 'required' => [ 'appBundleSummaryList', ], 'members' => [ 'appBundleSummaryList' => [ 'shape' => 'AppBundleSummaryList', ], 'nextToken' => [ 'shape' => 'String2048', ], ], ], 'ListIngestionDestinationsRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', 'ingestionIdentifier', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], 'ingestionIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'ingestionIdentifier', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'ListIngestionDestinationsResponse' => [ 'type' => 'structure', 'required' => [ 'ingestionDestinations', ], 'members' => [ 'ingestionDestinations' => [ 'shape' => 'IngestionDestinationList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'ListIngestionsRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'ListIngestionsResponse' => [ 'type' => 'structure', 'required' => [ 'ingestions', ], 'members' => [ 'ingestions' => [ 'shape' => 'IngestionList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', ], 'members' => [ 'resourceArn' => [ 'shape' => 'Arn', 'location' => 'uri', 'locationName' => 'resourceArn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'tags' => [ 'shape' => 'TagList', ], ], ], 'MaxResults' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'Oauth2Credential' => [ 'type' => 'structure', 'required' => [ 'clientId', 'clientSecret', ], 'members' => [ 'clientId' => [ 'shape' => 'String2048', ], 'clientSecret' => [ 'shape' => 'SensitiveString2048', ], ], ], 'Persona' => [ 'type' => 'string', 'enum' => [ 'admin', 'endUser', ], ], 'ProcessingConfiguration' => [ 'type' => 'structure', 'members' => [ 'auditLog' => [ 'shape' => 'AuditLogProcessingConfiguration', ], ], 'union' => true, ], 'RedirectUri' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'pattern' => 'https://[-a-zA-Z0-9-._~:/?#@!$&\\'()*+,;=]+', ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'required' => [ 'message', 'resourceId', 'resourceType', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'resourceId' => [ 'shape' => 'String', ], 'resourceType' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'ResultStatus' => [ 'type' => 'string', 'enum' => [ 'IN_PROGRESS', 'COMPLETED', 'FAILED', 'EXPIRED', ], ], 'S3Bucket' => [ 'type' => 'structure', 'required' => [ 'bucketName', ], 'members' => [ 'bucketName' => [ 'shape' => 'String63', ], 'prefix' => [ 'shape' => 'String120', ], ], ], 'Schema' => [ 'type' => 'string', 'enum' => [ 'ocsf', 'raw', ], ], 'SensitiveString2048' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, 'sensitive' => true, ], 'ServiceQuotaExceededException' => [ 'type' => 'structure', 'required' => [ 'message', 'resourceId', 'resourceType', 'serviceCode', 'quotaCode', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'resourceId' => [ 'shape' => 'String', ], 'resourceType' => [ 'shape' => 'String', ], 'serviceCode' => [ 'shape' => 'String', ], 'quotaCode' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 402, 'senderFault' => true, ], 'exception' => true, ], 'StartIngestionRequest' => [ 'type' => 'structure', 'required' => [ 'ingestionIdentifier', 'appBundleIdentifier', ], 'members' => [ 'ingestionIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'ingestionIdentifier', ], 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], ], ], 'StartIngestionResponse' => [ 'type' => 'structure', 'members' => [], ], 'StartUserAccessTasksRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', 'email', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', ], 'email' => [ 'shape' => 'Email', ], ], ], 'StartUserAccessTasksResponse' => [ 'type' => 'structure', 'members' => [ 'userAccessTasksList' => [ 'shape' => 'UserAccessTasksList', ], ], ], 'StopIngestionRequest' => [ 'type' => 'structure', 'required' => [ 'ingestionIdentifier', 'appBundleIdentifier', ], 'members' => [ 'ingestionIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'ingestionIdentifier', ], 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], ], ], 'StopIngestionResponse' => [ 'type' => 'structure', 'members' => [], ], 'String' => [ 'type' => 'string', ], 'String120' => [ 'type' => 'string', 'max' => 120, 'min' => 1, ], 'String2048' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, ], 'String255' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'String63' => [ 'type' => 'string', 'max' => 63, 'min' => 3, ], 'String64' => [ 'type' => 'string', 'max' => 64, 'min' => 3, ], 'Tag' => [ 'type' => 'structure', 'required' => [ 'key', 'value', ], 'members' => [ 'key' => [ 'shape' => 'TagKey', ], 'value' => [ 'shape' => 'TagValue', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 200, 'min' => 0, ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], 'max' => 50, 'min' => 0, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tags', ], 'members' => [ 'resourceArn' => [ 'shape' => 'Arn', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tags' => [ 'shape' => 'TagList', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, ], 'TaskError' => [ 'type' => 'structure', 'members' => [ 'errorCode' => [ 'shape' => 'String', ], 'errorMessage' => [ 'shape' => 'String', ], ], ], 'TaskIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'UUID', ], 'max' => 50, 'min' => 1, ], 'Tenant' => [ 'type' => 'structure', 'required' => [ 'tenantIdentifier', 'tenantDisplayName', ], 'members' => [ 'tenantIdentifier' => [ 'shape' => 'TenantIdentifier', ], 'tenantDisplayName' => [ 'shape' => 'String2048', ], ], ], 'TenantIdentifier' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, ], 'ThrottlingException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'serviceCode' => [ 'shape' => 'String', ], 'quotaCode' => [ 'shape' => 'String', ], 'retryAfterSeconds' => [ 'shape' => 'Integer', 'location' => 'header', 'locationName' => 'Retry-After', ], ], 'error' => [ 'httpStatusCode' => 429, 'senderFault' => true, ], 'exception' => true, 'retryable' => [ 'throttling' => true, ], ], 'UUID' => [ 'type' => 'string', 'pattern' => '[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}', ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tagKeys', ], 'members' => [ 'resourceArn' => [ 'shape' => 'Arn', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tagKeys' => [ 'shape' => 'TagKeyList', 'location' => 'querystring', 'locationName' => 'tagKeys', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateAppAuthorizationRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', 'appAuthorizationIdentifier', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], 'appAuthorizationIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appAuthorizationIdentifier', ], 'credential' => [ 'shape' => 'Credential', ], 'tenant' => [ 'shape' => 'Tenant', ], ], ], 'UpdateAppAuthorizationResponse' => [ 'type' => 'structure', 'required' => [ 'appAuthorization', ], 'members' => [ 'appAuthorization' => [ 'shape' => 'AppAuthorization', ], ], ], 'UpdateIngestionDestinationRequest' => [ 'type' => 'structure', 'required' => [ 'appBundleIdentifier', 'ingestionIdentifier', 'ingestionDestinationIdentifier', 'destinationConfiguration', ], 'members' => [ 'appBundleIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'appBundleIdentifier', ], 'ingestionIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'ingestionIdentifier', ], 'ingestionDestinationIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'ingestionDestinationIdentifier', ], 'destinationConfiguration' => [ 'shape' => 'DestinationConfiguration', ], ], ], 'UpdateIngestionDestinationResponse' => [ 'type' => 'structure', 'required' => [ 'ingestionDestination', ], 'members' => [ 'ingestionDestination' => [ 'shape' => 'IngestionDestination', ], ], ], 'UserAccessResultItem' => [ 'type' => 'structure', 'members' => [ 'app' => [ 'shape' => 'String255', ], 'tenantId' => [ 'shape' => 'TenantIdentifier', ], 'tenantDisplayName' => [ 'shape' => 'String2048', ], 'taskId' => [ 'shape' => 'UUID', ], 'resultStatus' => [ 'shape' => 'ResultStatus', ], 'email' => [ 'shape' => 'Email', ], 'userId' => [ 'shape' => 'SensitiveString2048', ], 'userFullName' => [ 'shape' => 'SensitiveString2048', ], 'userFirstName' => [ 'shape' => 'SensitiveString2048', ], 'userLastName' => [ 'shape' => 'SensitiveString2048', ], 'userStatus' => [ 'shape' => 'String', ], 'taskError' => [ 'shape' => 'TaskError', ], ], ], 'UserAccessResultsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'UserAccessResultItem', ], ], 'UserAccessTaskItem' => [ 'type' => 'structure', 'required' => [ 'app', 'tenantId', ], 'members' => [ 'app' => [ 'shape' => 'String255', ], 'tenantId' => [ 'shape' => 'TenantIdentifier', ], 'taskId' => [ 'shape' => 'UUID', ], 'error' => [ 'shape' => 'TaskError', ], ], ], 'UserAccessTasksList' => [ 'type' => 'list', 'member' => [ 'shape' => 'UserAccessTaskItem', ], ], 'ValidationException' => [ 'type' => 'structure', 'required' => [ 'message', 'reason', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'reason' => [ 'shape' => 'ValidationExceptionReason', ], 'fieldList' => [ 'shape' => 'ValidationExceptionFieldList', ], ], 'error' => [ 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'ValidationExceptionField' => [ 'type' => 'structure', 'required' => [ 'name', 'message', ], 'members' => [ 'name' => [ 'shape' => 'String', ], 'message' => [ 'shape' => 'String', ], ], ], 'ValidationExceptionFieldList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ValidationExceptionField', ], ], 'ValidationExceptionReason' => [ 'type' => 'string', 'enum' => [ 'unknownOperation', 'cannotParse', 'fieldValidationFailed', 'other', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appfabric/2023-05-19/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>Amazon Web Services AppFabric quickly connects software as a service (SaaS) applications across your organization. This allows IT and security teams to easily manage and secure applications using a standard schema, and employees can complete everyday tasks faster using generative artificial intelligence (AI). You can use these APIs to complete AppFabric tasks, such as setting up audit log ingestions or viewing user access. For more information about AppFabric, including the required permissions to use the service, see the <a href=\"https://docs.aws.amazon.com/appfabric/latest/adminguide/\">Amazon Web Services AppFabric Administration Guide</a>. For more information about using the Command Line Interface (CLI) to manage your AppFabric resources, see the <a href=\"https://docs.aws.amazon.com/cli/latest/reference/appfabric/index.html\">AppFabric section of the CLI Reference</a>.</p>', 'operations' => [ 'BatchGetUserAccessTasks' => '<p>Gets user access details in a batch request.</p> <p>This action polls data from the tasks that are kicked off by the <code>StartUserAccessTasks</code> action.</p>', 'ConnectAppAuthorization' => '<p>Establishes a connection between Amazon Web Services AppFabric and an application, which allows AppFabric to call the APIs of the application.</p>', 'CreateAppAuthorization' => '<p>Creates an app authorization within an app bundle, which allows AppFabric to connect to an application.</p>', 'CreateAppBundle' => '<p>Creates an app bundle to collect data from an application using AppFabric.</p>', 'CreateIngestion' => '<p>Creates a data ingestion for an application.</p>', 'CreateIngestionDestination' => '<p>Creates an ingestion destination, which specifies how an application\\'s ingested data is processed by Amazon Web Services AppFabric and where it\\'s delivered.</p>', 'DeleteAppAuthorization' => '<p>Deletes an app authorization. You must delete the associated ingestion before you can delete an app authorization.</p>', 'DeleteAppBundle' => '<p>Deletes an app bundle. You must delete all associated app authorizations before you can delete an app bundle.</p>', 'DeleteIngestion' => '<p>Deletes an ingestion. You must stop (disable) the ingestion and you must delete all associated ingestion destinations before you can delete an app ingestion.</p>', 'DeleteIngestionDestination' => '<p>Deletes an ingestion destination.</p> <p>This deletes the association between an ingestion and it\\'s destination. It doesn\\'t delete previously ingested data or the storage destination, such as the Amazon S3 bucket where the data is delivered. If the ingestion destination is deleted while the associated ingestion is enabled, the ingestion will fail and is eventually disabled.</p>', 'GetAppAuthorization' => '<p>Returns information about an app authorization.</p>', 'GetAppBundle' => '<p>Returns information about an app bundle.</p>', 'GetIngestion' => '<p>Returns information about an ingestion.</p>', 'GetIngestionDestination' => '<p>Returns information about an ingestion destination.</p>', 'ListAppAuthorizations' => '<p>Returns a list of all app authorizations configured for an app bundle.</p>', 'ListAppBundles' => '<p>Returns a list of app bundles.</p>', 'ListIngestionDestinations' => '<p>Returns a list of all ingestion destinations configured for an ingestion.</p>', 'ListIngestions' => '<p>Returns a list of all ingestions configured for an app bundle.</p>', 'ListTagsForResource' => '<p>Returns a list of tags for a resource.</p>', 'StartIngestion' => '<p>Starts (enables) an ingestion, which collects data from an application.</p>', 'StartUserAccessTasks' => '<p>Starts the tasks to search user access status for a specific email address.</p> <p>The tasks are stopped when the user access status data is found. The tasks are terminated when the API calls to the application time out.</p>', 'StopIngestion' => '<p>Stops (disables) an ingestion.</p>', 'TagResource' => '<p>Assigns one or more tags (key-value pairs) to the specified resource.</p>', 'UntagResource' => '<p>Removes a tag or tags from a resource.</p>', 'UpdateAppAuthorization' => '<p>Updates an app authorization within an app bundle, which allows AppFabric to connect to an application.</p> <p>If the app authorization was in a <code>connected</code> state, updating the app authorization will set it back to a <code>PendingConnect</code> state.</p>', 'UpdateIngestionDestination' => '<p>Updates an ingestion destination, which specifies how an application\\'s ingested data is processed by Amazon Web Services AppFabric and where it\\'s delivered.</p>', ], 'shapes' => [ 'AccessDeniedException' => [ 'base' => '<p>You are not authorized to perform this operation.</p>', 'refs' => [], ], 'ApiKeyCredential' => [ 'base' => '<p>Contains API key credential information.</p>', 'refs' => [ 'Credential$apiKeyCredential' => '<p>Contains API key credential information.</p>', ], ], 'AppAuthorization' => [ 'base' => '<p>Contains information about an app authorization.</p>', 'refs' => [ 'CreateAppAuthorizationResponse$appAuthorization' => '<p>Contains information about an app authorization.</p>', 'GetAppAuthorizationResponse$appAuthorization' => '<p>Contains information about an app authorization.</p>', 'UpdateAppAuthorizationResponse$appAuthorization' => '<p>Contains information about an app authorization.</p>', ], ], 'AppAuthorizationStatus' => [ 'base' => NULL, 'refs' => [ 'AppAuthorization$status' => '<p>The state of the app authorization.</p> <p>The following states are possible:</p> <ul> <li> <p> <code>PendingConnect</code>: The initial state of the app authorization. The app authorization is created but not yet connected.</p> </li> <li> <p> <code>Connected</code>: The app authorization is connected to the application, and is ready to be used.</p> </li> <li> <p> <code>ConnectionValidationFailed</code>: The app authorization received a validation exception when trying to connect to the application. If the app authorization is in this state, you should verify the configured credentials and try to connect the app authorization again.</p> </li> <li> <p> <code>TokenAutoRotationFailed</code>: AppFabric failed to refresh the access token. If the app authorization is in this state, you should try to reconnect the app authorization.</p> </li> </ul>', 'AppAuthorizationSummary$status' => '<p>The state of the app authorization.</p> <p>The following states are possible:</p> <ul> <li> <p> <code>PendingConnect</code>: The initial state of the app authorization. The app authorization is created but not yet connected.</p> </li> <li> <p> <code>Connected</code>: The app authorization is connected to the application, and is ready to be used.</p> </li> <li> <p> <code>ConnectionValidationFailed</code>: The app authorization received a validation exception when trying to connect to the application. If the app authorization is in this state, you should verify the configured credentials and try to connect the app authorization again.</p> </li> <li> <p> <code>TokenAutoRotationFailed</code>: AppFabric failed to refresh the access token. If the app authorization is in this state, you should try to reconnect the app authorization.</p> </li> </ul>', ], ], 'AppAuthorizationSummary' => [ 'base' => '<p>Contains a summary of an app authorization.</p>', 'refs' => [ 'AppAuthorizationSummaryList$member' => NULL, 'ConnectAppAuthorizationResponse$appAuthorizationSummary' => '<p>Contains a summary of the app authorization.</p>', ], ], 'AppAuthorizationSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListAppAuthorizationsResponse$appAuthorizationSummaryList' => '<p>Contains a list of app authorization summaries.</p>', ], ], 'AppBundle' => [ 'base' => '<p>Contains information about an app bundle.</p>', 'refs' => [ 'CreateAppBundleResponse$appBundle' => '<p>Contains information about an app bundle.</p>', 'GetAppBundleResponse$appBundle' => '<p>Contains information about an app bundle.</p>', ], ], 'AppBundleSummary' => [ 'base' => '<p>Contains a summary of an app bundle.</p>', 'refs' => [ 'AppBundleSummaryList$member' => NULL, ], ], 'AppBundleSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListAppBundlesResponse$appBundleSummaryList' => '<p>Contains a list of app bundle summaries.</p>', ], ], 'Arn' => [ 'base' => NULL, 'refs' => [ 'AppAuthorization$appAuthorizationArn' => '<p>The Amazon Resource Name (ARN) of the app authorization.</p>', 'AppAuthorization$appBundleArn' => '<p>The Amazon Resource Name (ARN) of the app bundle for the app authorization.</p>', 'AppAuthorizationSummary$appAuthorizationArn' => '<p>The Amazon Resource Name (ARN) of the app authorization.</p>', 'AppAuthorizationSummary$appBundleArn' => '<p>The Amazon Resource Name (ARN) of the app bundle for the app authorization.</p>', 'AppBundle$arn' => '<p>The Amazon Resource Name (ARN) of the app bundle.</p>', 'AppBundle$customerManagedKeyArn' => '<p>The Amazon Resource Name (ARN) of the Key Management Service (KMS) key used to encrypt the application data.</p>', 'AppBundleSummary$arn' => '<p>The Amazon Resource Name (ARN) of the app bundle.</p>', 'Ingestion$arn' => '<p>The Amazon Resource Name (ARN) of the ingestion.</p>', 'Ingestion$appBundleArn' => '<p>The Amazon Resource Name (ARN) of the app bundle for the ingestion.</p>', 'IngestionDestination$arn' => '<p>The Amazon Resource Name (ARN) of the ingestion destination.</p>', 'IngestionDestination$ingestionArn' => '<p>The Amazon Resource Name (ARN) of the ingestion.</p>', 'IngestionDestinationSummary$arn' => '<p>The Amazon Resource Name (ARN) of the ingestion destination.</p>', 'IngestionSummary$arn' => '<p>The Amazon Resource Name (ARN) of the ingestion.</p>', 'ListTagsForResourceRequest$resourceArn' => '<p>The Amazon Resource Name (ARN) of the resource for which you want to retrieve tags.</p>', 'TagResourceRequest$resourceArn' => '<p>The Amazon Resource Name (ARN) of the resource that you want to tag.</p>', 'UntagResourceRequest$resourceArn' => '<p>The Amazon Resource Name (ARN) of the resource that you want to untag.</p>', ], ], 'AuditLogDestinationConfiguration' => [ 'base' => '<p>Contains information about an audit log destination configuration.</p>', 'refs' => [ 'DestinationConfiguration$auditLog' => '<p>Contains information about an audit log destination configuration.</p>', ], ], 'AuditLogProcessingConfiguration' => [ 'base' => '<p>Contains information about an audit log processing configuration.</p>', 'refs' => [ 'ProcessingConfiguration$auditLog' => '<p>Contains information about an audit log processing configuration.</p>', ], ], 'AuthRequest' => [ 'base' => '<p>Contains authorization request information, which is required for Amazon Web Services AppFabric to get the OAuth2 access token for an application.</p>', 'refs' => [ 'ConnectAppAuthorizationRequest$authRequest' => '<p>Contains OAuth2 authorization information.</p> <p>This is required if the app authorization for the request is configured with an OAuth2 (<code>oauth2</code>) authorization type.</p>', ], ], 'AuthType' => [ 'base' => NULL, 'refs' => [ 'AppAuthorization$authType' => '<p>The authorization type.</p>', 'CreateAppAuthorizationRequest$authType' => '<p>The authorization type for the app authorization.</p>', ], ], 'BatchGetUserAccessTasksRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchGetUserAccessTasksResponse' => [ 'base' => NULL, 'refs' => [], ], 'ConflictException' => [ 'base' => '<p>The request has created a conflict. Check the request parameters and try again.</p>', 'refs' => [], ], 'ConnectAppAuthorizationRequest' => [ 'base' => NULL, 'refs' => [], ], 'ConnectAppAuthorizationResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppAuthorizationRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppAuthorizationResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppBundleRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppBundleResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateIngestionDestinationRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateIngestionDestinationResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateIngestionRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateIngestionResponse' => [ 'base' => NULL, 'refs' => [], ], 'Credential' => [ 'base' => '<p>Contains credential information for an application.</p>', 'refs' => [ 'CreateAppAuthorizationRequest$credential' => '<p>Contains credentials for the application, such as an API key or OAuth2 client ID and secret.</p> <p>Specify credentials that match the authorization type for your request. For example, if the authorization type for your request is OAuth2 (<code>oauth2</code>), then you should provide only the OAuth2 credentials.</p>', 'UpdateAppAuthorizationRequest$credential' => '<p>Contains credentials for the application, such as an API key or OAuth2 client ID and secret.</p> <p>Specify credentials that match the authorization type of the app authorization to update. For example, if the authorization type of the app authorization is OAuth2 (<code>oauth2</code>), then you should provide only the OAuth2 credentials.</p>', ], ], 'DateTime' => [ 'base' => NULL, 'refs' => [ 'AppAuthorization$createdAt' => '<p>The timestamp of when the app authorization was created.</p>', 'AppAuthorization$updatedAt' => '<p>The timestamp of when the app authorization was last updated.</p>', 'AppAuthorizationSummary$updatedAt' => '<p>Timestamp for when the app authorization was last updated.</p>', 'Ingestion$createdAt' => '<p>The timestamp of when the ingestion was created.</p>', 'Ingestion$updatedAt' => '<p>The timestamp of when the ingestion was last updated.</p>', 'IngestionDestination$createdAt' => '<p>The timestamp of when the ingestion destination was created.</p>', 'IngestionDestination$updatedAt' => '<p>The timestamp of when the ingestion destination was last updated.</p>', ], ], 'DeleteAppAuthorizationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAppAuthorizationResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAppBundleRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAppBundleResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteIngestionDestinationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteIngestionDestinationResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteIngestionRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteIngestionResponse' => [ 'base' => NULL, 'refs' => [], ], 'Destination' => [ 'base' => '<p>Contains information about an audit log destination.</p>', 'refs' => [ 'AuditLogDestinationConfiguration$destination' => '<p>Contains information about an audit log destination.</p>', ], ], 'DestinationConfiguration' => [ 'base' => '<p>Contains information about the destination of ingested data.</p>', 'refs' => [ 'CreateIngestionDestinationRequest$destinationConfiguration' => '<p>Contains information about the destination of ingested data.</p>', 'IngestionDestination$destinationConfiguration' => '<p>Contains information about the destination of ingested data.</p>', 'UpdateIngestionDestinationRequest$destinationConfiguration' => '<p>Contains information about the destination of ingested data.</p>', ], ], 'Email' => [ 'base' => NULL, 'refs' => [ 'StartUserAccessTasksRequest$email' => '<p>The email address of the target user.</p>', 'UserAccessResultItem$email' => '<p>The email address of the target user.</p>', ], ], 'FirehoseStream' => [ 'base' => '<p>Contains information about an Amazon Kinesis Data Firehose delivery stream.</p>', 'refs' => [ 'Destination$firehoseStream' => '<p>Contains information about an Amazon Kinesis Data Firehose delivery stream.</p>', ], ], 'Format' => [ 'base' => NULL, 'refs' => [ 'AuditLogProcessingConfiguration$format' => '<p>The format in which the audit logs need to be formatted.</p>', ], ], 'GetAppAuthorizationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetAppAuthorizationResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetAppBundleRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetAppBundleResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetIngestionDestinationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetIngestionDestinationResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetIngestionRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetIngestionResponse' => [ 'base' => NULL, 'refs' => [], ], 'Identifier' => [ 'base' => NULL, 'refs' => [ 'BatchGetUserAccessTasksRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'ConnectAppAuthorizationRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle that contains the app authorization to use for the request.</p>', 'ConnectAppAuthorizationRequest$appAuthorizationIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app authorization to use for the request.</p>', 'CreateAppAuthorizationRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'CreateAppBundleRequest$customerManagedKeyIdentifier' => '<p>The Amazon Resource Name (ARN) of the Key Management Service (KMS) key to use to encrypt the application data. If this is not specified, an Amazon Web Services owned key is used for encryption.</p>', 'CreateIngestionDestinationRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'CreateIngestionDestinationRequest$ingestionIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the ingestion to use for the request.</p>', 'CreateIngestionRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'DeleteAppAuthorizationRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'DeleteAppAuthorizationRequest$appAuthorizationIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app authorization to use for the request.</p>', 'DeleteAppBundleRequest$appBundleIdentifier' => '<p>The ID or Amazon Resource Name (ARN) of the app bundle that needs to be deleted.</p>', 'DeleteIngestionDestinationRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'DeleteIngestionDestinationRequest$ingestionIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the ingestion to use for the request.</p>', 'DeleteIngestionDestinationRequest$ingestionDestinationIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the ingestion destination to use for the request.</p>', 'DeleteIngestionRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'DeleteIngestionRequest$ingestionIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the ingestion to use for the request.</p>', 'GetAppAuthorizationRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'GetAppAuthorizationRequest$appAuthorizationIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app authorization to use for the request.</p>', 'GetAppBundleRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'GetIngestionDestinationRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'GetIngestionDestinationRequest$ingestionIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the ingestion to use for the request.</p>', 'GetIngestionDestinationRequest$ingestionDestinationIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the ingestion destination to use for the request.</p>', 'GetIngestionRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'GetIngestionRequest$ingestionIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the ingestion to use for the request.</p>', 'ListAppAuthorizationsRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'ListIngestionDestinationsRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'ListIngestionDestinationsRequest$ingestionIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the ingestion to use for the request.</p>', 'ListIngestionsRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'StartIngestionRequest$ingestionIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the ingestion to use for the request.</p>', 'StartIngestionRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'StartUserAccessTasksRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'StopIngestionRequest$ingestionIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the ingestion to use for the request.</p>', 'StopIngestionRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'UpdateAppAuthorizationRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'UpdateAppAuthorizationRequest$appAuthorizationIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app authorization to use for the request.</p>', 'UpdateIngestionDestinationRequest$appBundleIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>', 'UpdateIngestionDestinationRequest$ingestionIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the ingestion to use for the request.</p>', 'UpdateIngestionDestinationRequest$ingestionDestinationIdentifier' => '<p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the ingestion destination to use for the request.</p>', ], ], 'Ingestion' => [ 'base' => '<p>Contains information about an ingestion.</p>', 'refs' => [ 'CreateIngestionResponse$ingestion' => '<p>Contains information about an ingestion.</p>', 'GetIngestionResponse$ingestion' => '<p>Contains information about an ingestion.</p>', ], ], 'IngestionDestination' => [ 'base' => '<p>Contains information about an ingestion destination.</p>', 'refs' => [ 'CreateIngestionDestinationResponse$ingestionDestination' => '<p>Contains information about an ingestion destination.</p>', 'GetIngestionDestinationResponse$ingestionDestination' => '<p>Contains information about an ingestion destination.</p>', 'UpdateIngestionDestinationResponse$ingestionDestination' => '<p>Contains information about an ingestion destination.</p>', ], ], 'IngestionDestinationList' => [ 'base' => NULL, 'refs' => [ 'ListIngestionDestinationsResponse$ingestionDestinations' => '<p>Contains a list of ingestion destination summaries.</p>', ], ], 'IngestionDestinationStatus' => [ 'base' => NULL, 'refs' => [ 'IngestionDestination$status' => '<p>The state of the ingestion destination.</p> <p>The following states are possible:</p> <ul> <li> <p> <code>Active</code>: The ingestion destination is active and is ready to be used.</p> </li> <li> <p> <code>Failed</code>: The ingestion destination has failed. If the ingestion destination is in this state, you should verify the ingestion destination configuration and try again.</p> </li> </ul>', ], ], 'IngestionDestinationSummary' => [ 'base' => '<p>Contains a summary of an ingestion destination.</p>', 'refs' => [ 'IngestionDestinationList$member' => NULL, ], ], 'IngestionList' => [ 'base' => NULL, 'refs' => [ 'ListIngestionsResponse$ingestions' => '<p>Contains a list of ingestion summaries.</p>', ], ], 'IngestionState' => [ 'base' => NULL, 'refs' => [ 'Ingestion$state' => '<p>The status of the ingestion.</p>', 'IngestionSummary$state' => '<p>The status of the ingestion.</p>', ], ], 'IngestionSummary' => [ 'base' => '<p>Contains a summary of an ingestion.</p>', 'refs' => [ 'IngestionList$member' => NULL, ], ], 'IngestionType' => [ 'base' => NULL, 'refs' => [ 'CreateIngestionRequest$ingestionType' => '<p>The ingestion type.</p>', 'Ingestion$ingestionType' => '<p>The type of the ingestion.</p>', ], ], 'Integer' => [ 'base' => NULL, 'refs' => [ 'InternalServerException$retryAfterSeconds' => '<p>The period of time after which you should retry your request.</p>', 'ThrottlingException$retryAfterSeconds' => '<p>The period of time after which you should retry your request.</p>', ], ], 'InternalServerException' => [ 'base' => '<p>The request processing has failed because of an unknown error, exception, or failure with an internal server.</p>', 'refs' => [], ], 'ListAppAuthorizationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAppAuthorizationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListAppBundlesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAppBundlesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListIngestionDestinationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListIngestionDestinationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListIngestionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListIngestionsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'ListAppAuthorizationsRequest$maxResults' => '<p>The maximum number of results that are returned per call. You can use <code>nextToken</code> to obtain further pages of results.</p> <p>This is only an upper limit. The actual number of results returned per call might be fewer than the specified maximum.</p>', 'ListAppBundlesRequest$maxResults' => '<p>The maximum number of results that are returned per call. You can use <code>nextToken</code> to obtain further pages of results.</p> <p>This is only an upper limit. The actual number of results returned per call might be fewer than the specified maximum.</p>', 'ListIngestionDestinationsRequest$maxResults' => '<p>The maximum number of results that are returned per call. You can use <code>nextToken</code> to obtain further pages of results.</p> <p>This is only an upper limit. The actual number of results returned per call might be fewer than the specified maximum.</p>', 'ListIngestionsRequest$maxResults' => '<p>The maximum number of results that are returned per call. You can use <code>nextToken</code> to obtain further pages of results.</p> <p>This is only an upper limit. The actual number of results returned per call might be fewer than the specified maximum.</p>', ], ], 'Oauth2Credential' => [ 'base' => '<p>Contains OAuth2 client credential information.</p>', 'refs' => [ 'Credential$oauth2Credential' => '<p>Contains OAuth2 client credential information.</p>', ], ], 'Persona' => [ 'base' => NULL, 'refs' => [ 'AppAuthorization$persona' => '<p>The user persona of the app authorization.</p> <p>This field should always be <code>admin</code>.</p>', ], ], 'ProcessingConfiguration' => [ 'base' => '<p>Contains information about how ingested data is processed.</p>', 'refs' => [ 'CreateIngestionDestinationRequest$processingConfiguration' => '<p>Contains information about how ingested data is processed.</p>', 'IngestionDestination$processingConfiguration' => '<p>Contains information about how ingested data is processed.</p>', ], ], 'RedirectUri' => [ 'base' => NULL, 'refs' => [ 'AuthRequest$redirectUri' => '<p>The redirect URL that is specified in the AuthURL and the application client.</p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p>The specified resource does not exist.</p>', 'refs' => [], ], 'ResultStatus' => [ 'base' => NULL, 'refs' => [ 'UserAccessResultItem$resultStatus' => '<p>The status of the user access result item.</p> <p>The following states are possible:</p> <ul> <li> <p> <code>IN_PROGRESS</code>: The user access task is in progress.</p> </li> <li> <p> <code>COMPLETED</code>: The user access task completed successfully.</p> </li> <li> <p> <code>FAILED</code>: The user access task failed.</p> </li> <li> <p> <code>EXPIRED</code>: The user access task expired.</p> </li> </ul>', ], ], 'S3Bucket' => [ 'base' => '<p>Contains information about an Amazon S3 bucket.</p>', 'refs' => [ 'Destination$s3Bucket' => '<p>Contains information about an Amazon S3 bucket.</p>', ], ], 'Schema' => [ 'base' => NULL, 'refs' => [ 'AuditLogProcessingConfiguration$schema' => '<p>The event schema in which the audit logs need to be formatted.</p>', ], ], 'SensitiveString2048' => [ 'base' => NULL, 'refs' => [ 'ApiKeyCredential$apiKey' => '<p>An API key for an application.</p>', 'AuthRequest$code' => '<p>The authorization code returned by the application after permission is granted in the application OAuth page (after clicking on the AuthURL).</p>', 'Oauth2Credential$clientSecret' => '<p>The client secret of the client application.</p>', 'UserAccessResultItem$userId' => '<p>The unique ID of user.</p>', 'UserAccessResultItem$userFullName' => '<p>The full name of the user.</p>', 'UserAccessResultItem$userFirstName' => '<p>The first name of the user.</p>', 'UserAccessResultItem$userLastName' => '<p>The last name of the user.</p>', ], ], 'ServiceQuotaExceededException' => [ 'base' => '<p>The request exceeds a service quota.</p>', 'refs' => [], ], 'StartIngestionRequest' => [ 'base' => NULL, 'refs' => [], ], 'StartIngestionResponse' => [ 'base' => NULL, 'refs' => [], ], 'StartUserAccessTasksRequest' => [ 'base' => NULL, 'refs' => [], ], 'StartUserAccessTasksResponse' => [ 'base' => NULL, 'refs' => [], ], 'StopIngestionRequest' => [ 'base' => NULL, 'refs' => [], ], 'StopIngestionResponse' => [ 'base' => NULL, 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$message' => NULL, 'AppAuthorization$authUrl' => '<p>The application URL for the OAuth flow.</p>', 'ConflictException$message' => NULL, 'ConflictException$resourceId' => '<p>The resource ID.</p>', 'ConflictException$resourceType' => '<p>The resource type.</p>', 'IngestionDestination$statusReason' => '<p>The reason for the current status of the ingestion destination.</p> <p>Only present when the <code>status</code> of ingestion destination is <code>Failed</code>.</p>', 'InternalServerException$message' => NULL, 'ListIngestionDestinationsRequest$nextToken' => '<p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken error</i>.</p>', 'ListIngestionDestinationsResponse$nextToken' => '<p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken error</i>.</p>', 'ListIngestionsRequest$nextToken' => '<p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken error</i>.</p>', 'ListIngestionsResponse$nextToken' => '<p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken error</i>.</p>', 'ResourceNotFoundException$message' => NULL, 'ResourceNotFoundException$resourceId' => '<p>The resource ID.</p>', 'ResourceNotFoundException$resourceType' => '<p>The resource type.</p>', 'ServiceQuotaExceededException$message' => NULL, 'ServiceQuotaExceededException$resourceId' => '<p>The resource ID.</p>', 'ServiceQuotaExceededException$resourceType' => '<p>The resource type.</p>', 'ServiceQuotaExceededException$serviceCode' => '<p>The code of the service.</p>', 'ServiceQuotaExceededException$quotaCode' => '<p>The code for the quota exceeded.</p>', 'TaskError$errorCode' => '<p>The code of the error.</p>', 'TaskError$errorMessage' => '<p>The message of the error.</p>', 'ThrottlingException$message' => NULL, 'ThrottlingException$serviceCode' => '<p>The code of the service.</p>', 'ThrottlingException$quotaCode' => '<p>The code for the quota exceeded.</p>', 'UserAccessResultItem$userStatus' => '<p>The status of the user returned by the application.</p>', 'ValidationException$message' => NULL, 'ValidationExceptionField$name' => '<p>The field name where the invalid entry was detected.</p>', 'ValidationExceptionField$message' => '<p>A message about the validation exception.</p>', ], ], 'String120' => [ 'base' => NULL, 'refs' => [ 'S3Bucket$prefix' => '<p>The object key to use.</p>', ], ], 'String2048' => [ 'base' => NULL, 'refs' => [ 'ListAppAuthorizationsRequest$nextToken' => '<p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken error</i>.</p>', 'ListAppAuthorizationsResponse$nextToken' => '<p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken error</i>.</p>', 'ListAppBundlesRequest$nextToken' => '<p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken error</i>.</p>', 'ListAppBundlesResponse$nextToken' => '<p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken error</i>.</p>', 'Oauth2Credential$clientId' => '<p>The client ID of the client application.</p>', 'Tenant$tenantDisplayName' => '<p>The display name of the tenant.</p>', 'UserAccessResultItem$tenantDisplayName' => '<p>The display name of the tenant.</p>', ], ], 'String255' => [ 'base' => NULL, 'refs' => [ 'AppAuthorization$app' => '<p>The name of the application.</p>', 'AppAuthorizationSummary$app' => '<p>The name of the application.</p>', 'CreateAppAuthorizationRequest$app' => '<p>The name of the application.</p> <p>Valid values are:</p> <ul> <li> <p> <code>SLACK</code> </p> </li> <li> <p> <code>ASANA</code> </p> </li> <li> <p> <code>JIRA</code> </p> </li> <li> <p> <code>M365</code> </p> </li> <li> <p> <code>M365AUDITLOGS</code> </p> </li> <li> <p> <code>ZOOM</code> </p> </li> <li> <p> <code>ZENDESK</code> </p> </li> <li> <p> <code>OKTA</code> </p> </li> <li> <p> <code>GOOGLE</code> </p> </li> <li> <p> <code>DROPBOX</code> </p> </li> <li> <p> <code>SMARTSHEET</code> </p> </li> <li> <p> <code>CISCO</code> </p> </li> </ul>', 'CreateIngestionRequest$app' => '<p>The name of the application.</p> <p>Valid values are:</p> <ul> <li> <p> <code>SLACK</code> </p> </li> <li> <p> <code>ASANA</code> </p> </li> <li> <p> <code>JIRA</code> </p> </li> <li> <p> <code>M365</code> </p> </li> <li> <p> <code>M365AUDITLOGS</code> </p> </li> <li> <p> <code>ZOOM</code> </p> </li> <li> <p> <code>ZENDESK</code> </p> </li> <li> <p> <code>OKTA</code> </p> </li> <li> <p> <code>GOOGLE</code> </p> </li> <li> <p> <code>DROPBOX</code> </p> </li> <li> <p> <code>SMARTSHEET</code> </p> </li> <li> <p> <code>CISCO</code> </p> </li> </ul>', 'Ingestion$app' => '<p>The name of the application.</p>', 'IngestionSummary$app' => '<p>The name of the application.</p>', 'UserAccessResultItem$app' => '<p>The name of the application.</p>', 'UserAccessTaskItem$app' => '<p>The name of the application.</p>', ], ], 'String63' => [ 'base' => NULL, 'refs' => [ 'S3Bucket$bucketName' => '<p>The name of the Amazon S3 bucket.</p>', ], ], 'String64' => [ 'base' => NULL, 'refs' => [ 'FirehoseStream$streamName' => '<p>The name of the Amazon Kinesis Data Firehose delivery stream.</p>', ], ], 'Tag' => [ 'base' => '<p>The key or keys of the key-value pairs for the tag or tags assigned to a resource.</p>', 'refs' => [ 'TagList$member' => NULL, ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'Tag$key' => '<p>Tag key.</p>', 'TagKeyList$member' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$tagKeys' => '<p>The keys of the key-value pairs for the tag or tags you want to remove from the specified resource.</p>', ], ], 'TagList' => [ 'base' => NULL, 'refs' => [ 'CreateAppAuthorizationRequest$tags' => '<p>A map of the key-value pairs of the tag or tags to assign to the resource.</p>', 'CreateAppBundleRequest$tags' => '<p>A map of the key-value pairs of the tag or tags to assign to the resource.</p>', 'CreateIngestionDestinationRequest$tags' => '<p>A map of the key-value pairs of the tag or tags to assign to the resource.</p>', 'CreateIngestionRequest$tags' => '<p>A map of the key-value pairs of the tag or tags to assign to the resource.</p>', 'ListTagsForResourceResponse$tags' => '<p>A map of the key-value pairs for the tag or tags assigned to the specified resource.</p>', 'TagResourceRequest$tags' => '<p>A map of the key-value pairs of the tag or tags to assign to the resource.</p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'Tag$value' => '<p>Tag value.</p>', ], ], 'TaskError' => [ 'base' => '<p>Contains information about an error returned from a user access task.</p>', 'refs' => [ 'UserAccessResultItem$taskError' => '<p>Contains information about an error returned from a user access task.</p>', 'UserAccessTaskItem$error' => '<p>Error from the task, if any.</p>', ], ], 'TaskIdList' => [ 'base' => NULL, 'refs' => [ 'BatchGetUserAccessTasksRequest$taskIdList' => '<p>The tasks IDs to use for the request.</p>', ], ], 'Tenant' => [ 'base' => '<p>Contains information about an application tenant.</p>', 'refs' => [ 'AppAuthorization$tenant' => '<p>Contains information about an application tenant, such as the application display name and identifier.</p>', 'AppAuthorizationSummary$tenant' => '<p>Contains information about an application tenant, such as the application display name and identifier.</p>', 'CreateAppAuthorizationRequest$tenant' => '<p>Contains information about an application tenant, such as the application display name and identifier.</p>', 'UpdateAppAuthorizationRequest$tenant' => '<p>Contains information about an application tenant, such as the application display name and identifier.</p>', ], ], 'TenantIdentifier' => [ 'base' => NULL, 'refs' => [ 'CreateIngestionRequest$tenantId' => '<p>The ID of the application tenant.</p>', 'Ingestion$tenantId' => '<p>The ID of the application tenant.</p>', 'IngestionSummary$tenantId' => '<p>The ID of the application tenant.</p>', 'Tenant$tenantIdentifier' => '<p>The ID of the application tenant.</p>', 'UserAccessResultItem$tenantId' => '<p>The ID of the application tenant.</p>', 'UserAccessTaskItem$tenantId' => '<p>The ID of the application tenant.</p>', ], ], 'ThrottlingException' => [ 'base' => '<p>The request rate exceeds the limit.</p>', 'refs' => [], ], 'UUID' => [ 'base' => NULL, 'refs' => [ 'CreateAppAuthorizationRequest$clientToken' => '<p>Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href=\"https://wikipedia.org/wiki/Universally_unique_identifier\">UUID type of value</a>.</p> <p>If you don\\'t provide this value, then Amazon Web Services generates a random one for you.</p> <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>', 'CreateAppBundleRequest$clientToken' => '<p>Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href=\"https://wikipedia.org/wiki/Universally_unique_identifier\">UUID type of value</a>.</p> <p>If you don\\'t provide this value, then Amazon Web Services generates a random one for you.</p> <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>', 'CreateIngestionDestinationRequest$clientToken' => '<p>Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href=\"https://wikipedia.org/wiki/Universally_unique_identifier\">UUID type of value</a>.</p> <p>If you don\\'t provide this value, then Amazon Web Services generates a random one for you.</p> <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>', 'CreateIngestionRequest$clientToken' => '<p>Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href=\"https://wikipedia.org/wiki/Universally_unique_identifier\">UUID type of value</a>.</p> <p>If you don\\'t provide this value, then Amazon Web Services generates a random one for you.</p> <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>', 'TaskIdList$member' => NULL, 'UserAccessResultItem$taskId' => '<p>The unique ID of the task.</p>', 'UserAccessTaskItem$taskId' => '<p>The unique ID of the task.</p>', ], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAppAuthorizationRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAppAuthorizationResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateIngestionDestinationRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateIngestionDestinationResponse' => [ 'base' => NULL, 'refs' => [], ], 'UserAccessResultItem' => [ 'base' => '<p>Contains information about a user\\'s access to an application.</p>', 'refs' => [ 'UserAccessResultsList$member' => NULL, ], ], 'UserAccessResultsList' => [ 'base' => NULL, 'refs' => [ 'BatchGetUserAccessTasksResponse$userAccessResultsList' => '<p>Contains a list of user access results.</p>', ], ], 'UserAccessTaskItem' => [ 'base' => '<p>Contains information about a user access task.</p>', 'refs' => [ 'UserAccessTasksList$member' => NULL, ], ], 'UserAccessTasksList' => [ 'base' => NULL, 'refs' => [ 'StartUserAccessTasksResponse$userAccessTasksList' => '<p>Contains a list of user access task information.</p>', ], ], 'ValidationException' => [ 'base' => '<p>The request has invalid or missing parameters.</p>', 'refs' => [], ], 'ValidationExceptionField' => [ 'base' => '<p>The input failed to meet the constraints specified by the Amazon Web Services service in a specified field.</p>', 'refs' => [ 'ValidationExceptionFieldList$member' => NULL, ], ], 'ValidationExceptionFieldList' => [ 'base' => NULL, 'refs' => [ 'ValidationException$fieldList' => '<p>The field list.</p>', ], ], 'ValidationExceptionReason' => [ 'base' => NULL, 'refs' => [ 'ValidationException$reason' => '<p>The reason for the exception.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appfabric/2023-05-19/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appfabric-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appfabric-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appfabric.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appfabric.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appfabric/2023-05-19/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appfabric-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-gov-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appfabric-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-gov-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appfabric.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-gov-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appfabric.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-gov-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appfabric-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'cn-north-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appfabric-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'cn-north-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appfabric.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'cn-north-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appfabric.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'cn-north-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-iso-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appfabric-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-iso-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-iso-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appfabric.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-iso-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appfabric-fips.us-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appfabric-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appfabric.us-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appfabric.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-isob-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appfabric-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-isob-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-isob-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appfabric.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-isob-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-1', 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-1', 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-1', 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appfabric/2023-05-19/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appfabric/2023-05-19/paginators-1.json\nreturn [ 'pagination' => [ 'ListAppAuthorizations' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'appAuthorizationSummaryList', ], 'ListAppBundles' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'appBundleSummaryList', ], 'ListIngestionDestinations' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'ingestionDestinations', ], 'ListIngestions' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'ingestions', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appfabric/2023-05-19/smoke.json\nreturn [ 'version' => 1, 'defaultRegion' => 'us-west-2', 'testCases' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appfabric/2023-05-19/waiters-2.json\nreturn [ 'version' => 2, 'waiters' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appflow/2020-08-23/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2020-08-23', 'endpointPrefix' => 'appflow', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'Amazon Appflow', 'serviceId' => 'Appflow', 'signatureVersion' => 'v4', 'signingName' => 'appflow', 'uid' => 'appflow-2020-08-23', ], 'operations' => [ 'CancelFlowExecutions' => [ 'name' => 'CancelFlowExecutions', 'http' => [ 'method' => 'POST', 'requestUri' => '/cancel-flow-executions', ], 'input' => [ 'shape' => 'CancelFlowExecutionsRequest', ], 'output' => [ 'shape' => 'CancelFlowExecutionsResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'InternalServerException', ], ], ], 'CreateConnectorProfile' => [ 'name' => 'CreateConnectorProfile', 'http' => [ 'method' => 'POST', 'requestUri' => '/create-connector-profile', ], 'input' => [ 'shape' => 'CreateConnectorProfileRequest', ], 'output' => [ 'shape' => 'CreateConnectorProfileResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ConnectorAuthenticationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'CreateFlow' => [ 'name' => 'CreateFlow', 'http' => [ 'method' => 'POST', 'requestUri' => '/create-flow', ], 'input' => [ 'shape' => 'CreateFlowRequest', ], 'output' => [ 'shape' => 'CreateFlowResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ConnectorAuthenticationException', ], [ 'shape' => 'ConnectorServerException', ], ], ], 'DeleteConnectorProfile' => [ 'name' => 'DeleteConnectorProfile', 'http' => [ 'method' => 'POST', 'requestUri' => '/delete-connector-profile', ], 'input' => [ 'shape' => 'DeleteConnectorProfileRequest', ], 'output' => [ 'shape' => 'DeleteConnectorProfileResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DeleteFlow' => [ 'name' => 'DeleteFlow', 'http' => [ 'method' => 'POST', 'requestUri' => '/delete-flow', ], 'input' => [ 'shape' => 'DeleteFlowRequest', ], 'output' => [ 'shape' => 'DeleteFlowResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DescribeConnector' => [ 'name' => 'DescribeConnector', 'http' => [ 'method' => 'POST', 'requestUri' => '/describe-connector', ], 'input' => [ 'shape' => 'DescribeConnectorRequest', ], 'output' => [ 'shape' => 'DescribeConnectorResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeConnectorEntity' => [ 'name' => 'DescribeConnectorEntity', 'http' => [ 'method' => 'POST', 'requestUri' => '/describe-connector-entity', ], 'input' => [ 'shape' => 'DescribeConnectorEntityRequest', ], 'output' => [ 'shape' => 'DescribeConnectorEntityResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConnectorAuthenticationException', ], [ 'shape' => 'ConnectorServerException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DescribeConnectorProfiles' => [ 'name' => 'DescribeConnectorProfiles', 'http' => [ 'method' => 'POST', 'requestUri' => '/describe-connector-profiles', ], 'input' => [ 'shape' => 'DescribeConnectorProfilesRequest', ], 'output' => [ 'shape' => 'DescribeConnectorProfilesResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DescribeConnectors' => [ 'name' => 'DescribeConnectors', 'http' => [ 'method' => 'POST', 'requestUri' => '/describe-connectors', ], 'input' => [ 'shape' => 'DescribeConnectorsRequest', ], 'output' => [ 'shape' => 'DescribeConnectorsResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DescribeFlow' => [ 'name' => 'DescribeFlow', 'http' => [ 'method' => 'POST', 'requestUri' => '/describe-flow', ], 'input' => [ 'shape' => 'DescribeFlowRequest', ], 'output' => [ 'shape' => 'DescribeFlowResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DescribeFlowExecutionRecords' => [ 'name' => 'DescribeFlowExecutionRecords', 'http' => [ 'method' => 'POST', 'requestUri' => '/describe-flow-execution-records', ], 'input' => [ 'shape' => 'DescribeFlowExecutionRecordsRequest', ], 'output' => [ 'shape' => 'DescribeFlowExecutionRecordsResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListConnectorEntities' => [ 'name' => 'ListConnectorEntities', 'http' => [ 'method' => 'POST', 'requestUri' => '/list-connector-entities', ], 'input' => [ 'shape' => 'ListConnectorEntitiesRequest', ], 'output' => [ 'shape' => 'ListConnectorEntitiesResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConnectorAuthenticationException', ], [ 'shape' => 'ConnectorServerException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListConnectors' => [ 'name' => 'ListConnectors', 'http' => [ 'method' => 'POST', 'requestUri' => '/list-connectors', ], 'input' => [ 'shape' => 'ListConnectorsRequest', ], 'output' => [ 'shape' => 'ListConnectorsResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListFlows' => [ 'name' => 'ListFlows', 'http' => [ 'method' => 'POST', 'requestUri' => '/list-flows', ], 'input' => [ 'shape' => 'ListFlowsRequest', ], 'output' => [ 'shape' => 'ListFlowsResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags/{resourceArn}', ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'RegisterConnector' => [ 'name' => 'RegisterConnector', 'http' => [ 'method' => 'POST', 'requestUri' => '/register-connector', ], 'input' => [ 'shape' => 'RegisterConnectorRequest', ], 'output' => [ 'shape' => 'RegisterConnectorResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ConnectorServerException', ], [ 'shape' => 'ConnectorAuthenticationException', ], ], ], 'ResetConnectorMetadataCache' => [ 'name' => 'ResetConnectorMetadataCache', 'http' => [ 'method' => 'POST', 'requestUri' => '/reset-connector-metadata-cache', ], 'input' => [ 'shape' => 'ResetConnectorMetadataCacheRequest', ], 'output' => [ 'shape' => 'ResetConnectorMetadataCacheResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], ], ], 'StartFlow' => [ 'name' => 'StartFlow', 'http' => [ 'method' => 'POST', 'requestUri' => '/start-flow', ], 'input' => [ 'shape' => 'StartFlowRequest', ], 'output' => [ 'shape' => 'StartFlowResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ConflictException', ], ], ], 'StopFlow' => [ 'name' => 'StopFlow', 'http' => [ 'method' => 'POST', 'requestUri' => '/stop-flow', ], 'input' => [ 'shape' => 'StopFlowRequest', ], 'output' => [ 'shape' => 'StopFlowResponse', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'UnsupportedOperationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags/{resourceArn}', ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UnregisterConnector' => [ 'name' => 'UnregisterConnector', 'http' => [ 'method' => 'POST', 'requestUri' => '/unregister-connector', ], 'input' => [ 'shape' => 'UnregisterConnectorRequest', ], 'output' => [ 'shape' => 'UnregisterConnectorResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/tags/{resourceArn}', ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UpdateConnectorProfile' => [ 'name' => 'UpdateConnectorProfile', 'http' => [ 'method' => 'POST', 'requestUri' => '/update-connector-profile', ], 'input' => [ 'shape' => 'UpdateConnectorProfileRequest', ], 'output' => [ 'shape' => 'UpdateConnectorProfileResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ConnectorAuthenticationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UpdateConnectorRegistration' => [ 'name' => 'UpdateConnectorRegistration', 'http' => [ 'method' => 'POST', 'requestUri' => '/update-connector-registration', ], 'input' => [ 'shape' => 'UpdateConnectorRegistrationRequest', ], 'output' => [ 'shape' => 'UpdateConnectorRegistrationResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ConnectorServerException', ], [ 'shape' => 'ConnectorAuthenticationException', ], ], ], 'UpdateFlow' => [ 'name' => 'UpdateFlow', 'http' => [ 'method' => 'POST', 'requestUri' => '/update-flow', ], 'input' => [ 'shape' => 'UpdateFlowRequest', ], 'output' => [ 'shape' => 'UpdateFlowResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ConnectorAuthenticationException', ], [ 'shape' => 'ConnectorServerException', ], [ 'shape' => 'InternalServerException', ], ], ], ], 'shapes' => [ 'ARN' => [ 'type' => 'string', 'max' => 512, 'pattern' => 'arn:aws:.*:.*:[0-9]+:.*', ], 'AccessDeniedException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 403, ], 'exception' => true, ], 'AccessKeyId' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', 'sensitive' => true, ], 'AccessToken' => [ 'type' => 'string', 'max' => 4096, 'pattern' => '\\\\S+', 'sensitive' => true, ], 'AccountName' => [ 'type' => 'string', 'max' => 512, 'pattern' => '\\\\S+', ], 'AggregationConfig' => [ 'type' => 'structure', 'members' => [ 'aggregationType' => [ 'shape' => 'AggregationType', ], 'targetFileSize' => [ 'shape' => 'Long', ], ], ], 'AggregationType' => [ 'type' => 'string', 'enum' => [ 'None', 'SingleFile', ], ], 'AmplitudeConnectorOperator' => [ 'type' => 'string', 'enum' => [ 'BETWEEN', ], ], 'AmplitudeConnectorProfileCredentials' => [ 'type' => 'structure', 'required' => [ 'apiKey', 'secretKey', ], 'members' => [ 'apiKey' => [ 'shape' => 'ApiKey', ], 'secretKey' => [ 'shape' => 'SecretKey', ], ], ], 'AmplitudeConnectorProfileProperties' => [ 'type' => 'structure', 'members' => [], ], 'AmplitudeMetadata' => [ 'type' => 'structure', 'members' => [], ], 'AmplitudeSourceProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], ], ], 'ApiKey' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', 'sensitive' => true, ], 'ApiKeyCredentials' => [ 'type' => 'structure', 'required' => [ 'apiKey', ], 'members' => [ 'apiKey' => [ 'shape' => 'ApiKey', ], 'apiSecretKey' => [ 'shape' => 'ApiSecretKey', ], ], ], 'ApiSecretKey' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', 'sensitive' => true, ], 'ApiToken' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', ], 'ApiVersion' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', ], 'ApplicationHostUrl' => [ 'type' => 'string', 'max' => 256, 'pattern' => '^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]', ], 'ApplicationKey' => [ 'type' => 'string', 'max' => 512, 'pattern' => '\\\\S+', ], 'ApplicationServicePath' => [ 'type' => 'string', 'max' => 512, 'pattern' => '\\\\S+', ], 'ApplicationType' => [ 'type' => 'string', 'max' => 512, 'pattern' => '\\\\S+', ], 'AuthCode' => [ 'type' => 'string', 'max' => 4096, 'pattern' => '\\\\S+', ], 'AuthCodeUrl' => [ 'type' => 'string', 'max' => 256, 'pattern' => '^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]', ], 'AuthCodeUrlList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AuthCodeUrl', ], ], 'AuthParameter' => [ 'type' => 'structure', 'members' => [ 'key' => [ 'shape' => 'Key', ], 'isRequired' => [ 'shape' => 'Boolean', ], 'label' => [ 'shape' => 'Label', ], 'description' => [ 'shape' => 'Description', ], 'isSensitiveField' => [ 'shape' => 'Boolean', ], 'connectorSuppliedValues' => [ 'shape' => 'ConnectorSuppliedValueList', ], ], ], 'AuthParameterList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AuthParameter', ], ], 'AuthenticationConfig' => [ 'type' => 'structure', 'members' => [ 'isBasicAuthSupported' => [ 'shape' => 'Boolean', ], 'isApiKeyAuthSupported' => [ 'shape' => 'Boolean', ], 'isOAuth2Supported' => [ 'shape' => 'Boolean', ], 'isCustomAuthSupported' => [ 'shape' => 'Boolean', ], 'oAuth2Defaults' => [ 'shape' => 'OAuth2Defaults', ], 'customAuthConfigs' => [ 'shape' => 'CustomAuthConfigList', ], ], ], 'AuthenticationType' => [ 'type' => 'string', 'enum' => [ 'OAUTH2', 'APIKEY', 'BASIC', 'CUSTOM', ], ], 'BasicAuthCredentials' => [ 'type' => 'structure', 'required' => [ 'username', 'password', ], 'members' => [ 'username' => [ 'shape' => 'Username', ], 'password' => [ 'shape' => 'Password', ], ], ], 'Boolean' => [ 'type' => 'boolean', ], 'BucketName' => [ 'type' => 'string', 'max' => 63, 'min' => 3, 'pattern' => '\\\\S+', ], 'BucketPrefix' => [ 'type' => 'string', 'max' => 512, 'pattern' => '.*', ], 'BusinessUnitId' => [ 'type' => 'string', 'max' => 18, 'pattern' => '\\\\S+', ], 'CancelFlowExecutionsRequest' => [ 'type' => 'structure', 'required' => [ 'flowName', ], 'members' => [ 'flowName' => [ 'shape' => 'FlowName', ], 'executionIds' => [ 'shape' => 'ExecutionIds', ], ], ], 'CancelFlowExecutionsResponse' => [ 'type' => 'structure', 'members' => [ 'invalidExecutions' => [ 'shape' => 'ExecutionIds', ], ], ], 'CatalogType' => [ 'type' => 'string', 'enum' => [ 'GLUE', ], ], 'ClientCredentialsArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 20, 'pattern' => 'arn:aws:secretsmanager:.*:[0-9]+:.*', 'sensitive' => true, ], 'ClientId' => [ 'type' => 'string', 'max' => 512, 'pattern' => '\\\\S+', ], 'ClientNumber' => [ 'type' => 'string', 'max' => 3, 'min' => 3, 'pattern' => '^\\\\d{3}$', ], 'ClientSecret' => [ 'type' => 'string', 'max' => 512, 'pattern' => '\\\\S+', 'sensitive' => true, ], 'ClientToken' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '[ -~]+', ], 'ClusterIdentifier' => [ 'type' => 'string', 'max' => 512, 'pattern' => '\\\\S+', ], 'ConflictException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'ConnectionMode' => [ 'type' => 'string', 'enum' => [ 'Public', 'Private', ], ], 'ConnectorAuthenticationException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], 'ConnectorConfiguration' => [ 'type' => 'structure', 'members' => [ 'canUseAsSource' => [ 'shape' => 'Boolean', ], 'canUseAsDestination' => [ 'shape' => 'Boolean', ], 'supportedDestinationConnectors' => [ 'shape' => 'ConnectorTypeList', ], 'supportedSchedulingFrequencies' => [ 'shape' => 'SchedulingFrequencyTypeList', ], 'isPrivateLinkEnabled' => [ 'shape' => 'Boolean', ], 'isPrivateLinkEndpointUrlRequired' => [ 'shape' => 'Boolean', ], 'supportedTriggerTypes' => [ 'shape' => 'TriggerTypeList', ], 'connectorMetadata' => [ 'shape' => 'ConnectorMetadata', ], 'connectorType' => [ 'shape' => 'ConnectorType', ], 'connectorLabel' => [ 'shape' => 'ConnectorLabel', ], 'connectorDescription' => [ 'shape' => 'ConnectorDescription', ], 'connectorOwner' => [ 'shape' => 'ConnectorOwner', ], 'connectorName' => [ 'shape' => 'ConnectorName', ], 'connectorVersion' => [ 'shape' => 'ConnectorVersion', ], 'connectorArn' => [ 'shape' => 'ARN', ], 'connectorModes' => [ 'shape' => 'ConnectorModeList', ], 'authenticationConfig' => [ 'shape' => 'AuthenticationConfig', ], 'connectorRuntimeSettings' => [ 'shape' => 'ConnectorRuntimeSettingList', ], 'supportedApiVersions' => [ 'shape' => 'SupportedApiVersionList', ], 'supportedOperators' => [ 'shape' => 'SupportedOperatorList', ], 'supportedWriteOperations' => [ 'shape' => 'SupportedWriteOperationList', ], 'connectorProvisioningType' => [ 'shape' => 'ConnectorProvisioningType', ], 'connectorProvisioningConfig' => [ 'shape' => 'ConnectorProvisioningConfig', ], 'logoURL' => [ 'shape' => 'LogoURL', ], 'registeredAt' => [ 'shape' => 'Date', ], 'registeredBy' => [ 'shape' => 'RegisteredBy', ], 'supportedDataTransferTypes' => [ 'shape' => 'SupportedDataTransferTypeList', ], 'supportedDataTransferApis' => [ 'shape' => 'SupportedDataTransferApis', ], ], ], 'ConnectorConfigurationsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'ConnectorType', ], 'value' => [ 'shape' => 'ConnectorConfiguration', ], ], 'ConnectorDescription' => [ 'type' => 'string', 'max' => 2048, 'pattern' => '[\\\\w!@#\\\\-.?,\\\\s]*', ], 'ConnectorDetail' => [ 'type' => 'structure', 'members' => [ 'connectorDescription' => [ 'shape' => 'ConnectorDescription', ], 'connectorName' => [ 'shape' => 'ConnectorName', ], 'connectorOwner' => [ 'shape' => 'ConnectorOwner', ], 'connectorVersion' => [ 'shape' => 'ConnectorVersion', ], 'applicationType' => [ 'shape' => 'ApplicationType', ], 'connectorType' => [ 'shape' => 'ConnectorType', ], 'connectorLabel' => [ 'shape' => 'ConnectorLabel', ], 'registeredAt' => [ 'shape' => 'Date', ], 'registeredBy' => [ 'shape' => 'RegisteredBy', ], 'connectorProvisioningType' => [ 'shape' => 'ConnectorProvisioningType', ], 'connectorModes' => [ 'shape' => 'ConnectorModeList', ], 'supportedDataTransferTypes' => [ 'shape' => 'SupportedDataTransferTypeList', ], ], ], 'ConnectorEntity' => [ 'type' => 'structure', 'required' => [ 'name', ], 'members' => [ 'name' => [ 'shape' => 'Name', ], 'label' => [ 'shape' => 'Label', ], 'hasNestedEntities' => [ 'shape' => 'Boolean', ], ], ], 'ConnectorEntityField' => [ 'type' => 'structure', 'required' => [ 'identifier', ], 'members' => [ 'identifier' => [ 'shape' => 'Identifier', ], 'parentIdentifier' => [ 'shape' => 'Identifier', ], 'label' => [ 'shape' => 'Label', ], 'isPrimaryKey' => [ 'shape' => 'Boolean', ], 'defaultValue' => [ 'shape' => 'String', ], 'isDeprecated' => [ 'shape' => 'Boolean', ], 'supportedFieldTypeDetails' => [ 'shape' => 'SupportedFieldTypeDetails', ], 'description' => [ 'shape' => 'Description', ], 'sourceProperties' => [ 'shape' => 'SourceFieldProperties', ], 'destinationProperties' => [ 'shape' => 'DestinationFieldProperties', ], 'customProperties' => [ 'shape' => 'CustomProperties', ], ], ], 'ConnectorEntityFieldList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConnectorEntityField', ], ], 'ConnectorEntityList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConnectorEntity', ], ], 'ConnectorEntityMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'Group', ], 'value' => [ 'shape' => 'ConnectorEntityList', ], ], 'ConnectorLabel' => [ 'type' => 'string', 'max' => 256, 'pattern' => '[a-zA-Z0-9][\\\\w!@#.-]+', ], 'ConnectorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConnectorDetail', ], ], 'ConnectorMetadata' => [ 'type' => 'structure', 'members' => [ 'Amplitude' => [ 'shape' => 'AmplitudeMetadata', ], 'Datadog' => [ 'shape' => 'DatadogMetadata', ], 'Dynatrace' => [ 'shape' => 'DynatraceMetadata', ], 'GoogleAnalytics' => [ 'shape' => 'GoogleAnalyticsMetadata', ], 'InforNexus' => [ 'shape' => 'InforNexusMetadata', ], 'Marketo' => [ 'shape' => 'MarketoMetadata', ], 'Redshift' => [ 'shape' => 'RedshiftMetadata', ], 'S3' => [ 'shape' => 'S3Metadata', ], 'Salesforce' => [ 'shape' => 'SalesforceMetadata', ], 'ServiceNow' => [ 'shape' => 'ServiceNowMetadata', ], 'Singular' => [ 'shape' => 'SingularMetadata', ], 'Slack' => [ 'shape' => 'SlackMetadata', ], 'Snowflake' => [ 'shape' => 'SnowflakeMetadata', ], 'Trendmicro' => [ 'shape' => 'TrendmicroMetadata', ], 'Veeva' => [ 'shape' => 'VeevaMetadata', ], 'Zendesk' => [ 'shape' => 'ZendeskMetadata', ], 'EventBridge' => [ 'shape' => 'EventBridgeMetadata', ], 'Upsolver' => [ 'shape' => 'UpsolverMetadata', ], 'CustomerProfiles' => [ 'shape' => 'CustomerProfilesMetadata', ], 'Honeycode' => [ 'shape' => 'HoneycodeMetadata', ], 'SAPOData' => [ 'shape' => 'SAPODataMetadata', ], 'Pardot' => [ 'shape' => 'PardotMetadata', ], ], ], 'ConnectorMode' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', ], 'ConnectorModeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConnectorMode', ], ], 'ConnectorName' => [ 'type' => 'string', 'max' => 256, 'pattern' => '.*', ], 'ConnectorOAuthRequest' => [ 'type' => 'structure', 'members' => [ 'authCode' => [ 'shape' => 'AuthCode', ], 'redirectUri' => [ 'shape' => 'RedirectUri', ], ], ], 'ConnectorOperator' => [ 'type' => 'structure', 'members' => [ 'Amplitude' => [ 'shape' => 'AmplitudeConnectorOperator', ], 'Datadog' => [ 'shape' => 'DatadogConnectorOperator', ], 'Dynatrace' => [ 'shape' => 'DynatraceConnectorOperator', ], 'GoogleAnalytics' => [ 'shape' => 'GoogleAnalyticsConnectorOperator', ], 'InforNexus' => [ 'shape' => 'InforNexusConnectorOperator', ], 'Marketo' => [ 'shape' => 'MarketoConnectorOperator', ], 'S3' => [ 'shape' => 'S3ConnectorOperator', ], 'Salesforce' => [ 'shape' => 'SalesforceConnectorOperator', ], 'ServiceNow' => [ 'shape' => 'ServiceNowConnectorOperator', ], 'Singular' => [ 'shape' => 'SingularConnectorOperator', ], 'Slack' => [ 'shape' => 'SlackConnectorOperator', ], 'Trendmicro' => [ 'shape' => 'TrendmicroConnectorOperator', ], 'Veeva' => [ 'shape' => 'VeevaConnectorOperator', ], 'Zendesk' => [ 'shape' => 'ZendeskConnectorOperator', ], 'SAPOData' => [ 'shape' => 'SAPODataConnectorOperator', ], 'CustomConnector' => [ 'shape' => 'Operator', ], 'Pardot' => [ 'shape' => 'PardotConnectorOperator', ], ], ], 'ConnectorOwner' => [ 'type' => 'string', 'max' => 256, 'pattern' => '.*', ], 'ConnectorProfile' => [ 'type' => 'structure', 'members' => [ 'connectorProfileArn' => [ 'shape' => 'ConnectorProfileArn', ], 'connectorProfileName' => [ 'shape' => 'ConnectorProfileName', ], 'connectorType' => [ 'shape' => 'ConnectorType', ], 'connectorLabel' => [ 'shape' => 'ConnectorLabel', ], 'connectionMode' => [ 'shape' => 'ConnectionMode', ], 'credentialsArn' => [ 'shape' => 'ARN', ], 'connectorProfileProperties' => [ 'shape' => 'ConnectorProfileProperties', ], 'createdAt' => [ 'shape' => 'Date', ], 'lastUpdatedAt' => [ 'shape' => 'Date', ], 'privateConnectionProvisioningState' => [ 'shape' => 'PrivateConnectionProvisioningState', ], ], ], 'ConnectorProfileArn' => [ 'type' => 'string', 'max' => 512, 'pattern' => 'arn:aws:appflow:.*:[0-9]+:.*', ], 'ConnectorProfileConfig' => [ 'type' => 'structure', 'required' => [ 'connectorProfileProperties', ], 'members' => [ 'connectorProfileProperties' => [ 'shape' => 'ConnectorProfileProperties', ], 'connectorProfileCredentials' => [ 'shape' => 'ConnectorProfileCredentials', ], ], ], 'ConnectorProfileCredentials' => [ 'type' => 'structure', 'members' => [ 'Amplitude' => [ 'shape' => 'AmplitudeConnectorProfileCredentials', ], 'Datadog' => [ 'shape' => 'DatadogConnectorProfileCredentials', ], 'Dynatrace' => [ 'shape' => 'DynatraceConnectorProfileCredentials', ], 'GoogleAnalytics' => [ 'shape' => 'GoogleAnalyticsConnectorProfileCredentials', ], 'Honeycode' => [ 'shape' => 'HoneycodeConnectorProfileCredentials', ], 'InforNexus' => [ 'shape' => 'InforNexusConnectorProfileCredentials', ], 'Marketo' => [ 'shape' => 'MarketoConnectorProfileCredentials', ], 'Redshift' => [ 'shape' => 'RedshiftConnectorProfileCredentials', ], 'Salesforce' => [ 'shape' => 'SalesforceConnectorProfileCredentials', ], 'ServiceNow' => [ 'shape' => 'ServiceNowConnectorProfileCredentials', ], 'Singular' => [ 'shape' => 'SingularConnectorProfileCredentials', ], 'Slack' => [ 'shape' => 'SlackConnectorProfileCredentials', ], 'Snowflake' => [ 'shape' => 'SnowflakeConnectorProfileCredentials', ], 'Trendmicro' => [ 'shape' => 'TrendmicroConnectorProfileCredentials', ], 'Veeva' => [ 'shape' => 'VeevaConnectorProfileCredentials', ], 'Zendesk' => [ 'shape' => 'ZendeskConnectorProfileCredentials', ], 'SAPOData' => [ 'shape' => 'SAPODataConnectorProfileCredentials', ], 'CustomConnector' => [ 'shape' => 'CustomConnectorProfileCredentials', ], 'Pardot' => [ 'shape' => 'PardotConnectorProfileCredentials', ], ], ], 'ConnectorProfileDetailList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConnectorProfile', ], ], 'ConnectorProfileName' => [ 'type' => 'string', 'max' => 256, 'pattern' => '[\\\\w/!@#+=.-]+', ], 'ConnectorProfileNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConnectorProfileName', ], 'max' => 100, 'min' => 0, ], 'ConnectorProfileProperties' => [ 'type' => 'structure', 'members' => [ 'Amplitude' => [ 'shape' => 'AmplitudeConnectorProfileProperties', ], 'Datadog' => [ 'shape' => 'DatadogConnectorProfileProperties', ], 'Dynatrace' => [ 'shape' => 'DynatraceConnectorProfileProperties', ], 'GoogleAnalytics' => [ 'shape' => 'GoogleAnalyticsConnectorProfileProperties', ], 'Honeycode' => [ 'shape' => 'HoneycodeConnectorProfileProperties', ], 'InforNexus' => [ 'shape' => 'InforNexusConnectorProfileProperties', ], 'Marketo' => [ 'shape' => 'MarketoConnectorProfileProperties', ], 'Redshift' => [ 'shape' => 'RedshiftConnectorProfileProperties', ], 'Salesforce' => [ 'shape' => 'SalesforceConnectorProfileProperties', ], 'ServiceNow' => [ 'shape' => 'ServiceNowConnectorProfileProperties', ], 'Singular' => [ 'shape' => 'SingularConnectorProfileProperties', ], 'Slack' => [ 'shape' => 'SlackConnectorProfileProperties', ], 'Snowflake' => [ 'shape' => 'SnowflakeConnectorProfileProperties', ], 'Trendmicro' => [ 'shape' => 'TrendmicroConnectorProfileProperties', ], 'Veeva' => [ 'shape' => 'VeevaConnectorProfileProperties', ], 'Zendesk' => [ 'shape' => 'ZendeskConnectorProfileProperties', ], 'SAPOData' => [ 'shape' => 'SAPODataConnectorProfileProperties', ], 'CustomConnector' => [ 'shape' => 'CustomConnectorProfileProperties', ], 'Pardot' => [ 'shape' => 'PardotConnectorProfileProperties', ], ], ], 'ConnectorProvisioningConfig' => [ 'type' => 'structure', 'members' => [ 'lambda' => [ 'shape' => 'LambdaConnectorProvisioningConfig', ], ], ], 'ConnectorProvisioningType' => [ 'type' => 'string', 'enum' => [ 'LAMBDA', ], ], 'ConnectorRuntimeSetting' => [ 'type' => 'structure', 'members' => [ 'key' => [ 'shape' => 'Key', ], 'dataType' => [ 'shape' => 'ConnectorRuntimeSettingDataType', ], 'isRequired' => [ 'shape' => 'Boolean', ], 'label' => [ 'shape' => 'Label', ], 'description' => [ 'shape' => 'Description', ], 'scope' => [ 'shape' => 'ConnectorRuntimeSettingScope', ], 'connectorSuppliedValueOptions' => [ 'shape' => 'ConnectorSuppliedValueOptionList', ], ], ], 'ConnectorRuntimeSettingDataType' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', ], 'ConnectorRuntimeSettingList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConnectorRuntimeSetting', ], ], 'ConnectorRuntimeSettingScope' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', ], 'ConnectorServerException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ConnectorSuppliedValue' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', ], 'ConnectorSuppliedValueList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConnectorSuppliedValue', ], ], 'ConnectorSuppliedValueOptionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConnectorSuppliedValue', ], ], 'ConnectorType' => [ 'type' => 'string', 'enum' => [ 'Salesforce', 'Singular', 'Slack', 'Redshift', 'S3', 'Marketo', 'Googleanalytics', 'Zendesk', 'Servicenow', 'Datadog', 'Trendmicro', 'Snowflake', 'Dynatrace', 'Infornexus', 'Amplitude', 'Veeva', 'EventBridge', 'LookoutMetrics', 'Upsolver', 'Honeycode', 'CustomerProfiles', 'SAPOData', 'CustomConnector', 'Pardot', ], ], 'ConnectorTypeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConnectorType', ], 'max' => 100, 'min' => 0, ], 'ConnectorVersion' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', ], 'CreateConnectorProfileRequest' => [ 'type' => 'structure', 'required' => [ 'connectorProfileName', 'connectorType', 'connectionMode', 'connectorProfileConfig', ], 'members' => [ 'connectorProfileName' => [ 'shape' => 'ConnectorProfileName', ], 'kmsArn' => [ 'shape' => 'KMSArn', ], 'connectorType' => [ 'shape' => 'ConnectorType', ], 'connectorLabel' => [ 'shape' => 'ConnectorLabel', ], 'connectionMode' => [ 'shape' => 'ConnectionMode', ], 'connectorProfileConfig' => [ 'shape' => 'ConnectorProfileConfig', ], 'clientToken' => [ 'shape' => 'ClientToken', 'idempotencyToken' => true, ], ], ], 'CreateConnectorProfileResponse' => [ 'type' => 'structure', 'members' => [ 'connectorProfileArn' => [ 'shape' => 'ConnectorProfileArn', ], ], ], 'CreateFlowRequest' => [ 'type' => 'structure', 'required' => [ 'flowName', 'triggerConfig', 'sourceFlowConfig', 'destinationFlowConfigList', 'tasks', ], 'members' => [ 'flowName' => [ 'shape' => 'FlowName', ], 'description' => [ 'shape' => 'FlowDescription', ], 'kmsArn' => [ 'shape' => 'KMSArn', ], 'triggerConfig' => [ 'shape' => 'TriggerConfig', ], 'sourceFlowConfig' => [ 'shape' => 'SourceFlowConfig', ], 'destinationFlowConfigList' => [ 'shape' => 'DestinationFlowConfigList', ], 'tasks' => [ 'shape' => 'Tasks', ], 'tags' => [ 'shape' => 'TagMap', ], 'metadataCatalogConfig' => [ 'shape' => 'MetadataCatalogConfig', ], 'clientToken' => [ 'shape' => 'ClientToken', 'idempotencyToken' => true, ], ], ], 'CreateFlowResponse' => [ 'type' => 'structure', 'members' => [ 'flowArn' => [ 'shape' => 'FlowArn', ], 'flowStatus' => [ 'shape' => 'FlowStatus', ], ], ], 'CreatedBy' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', ], 'CredentialsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'CredentialsMapKey', ], 'value' => [ 'shape' => 'CredentialsMapValue', ], 'max' => 50, 'min' => 0, ], 'CredentialsMapKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[\\\\w]+', 'sensitive' => true, ], 'CredentialsMapValue' => [ 'type' => 'string', 'max' => 2048, 'pattern' => '\\\\S+', 'sensitive' => true, ], 'CustomAuthConfig' => [ 'type' => 'structure', 'members' => [ 'customAuthenticationType' => [ 'shape' => 'CustomAuthenticationType', ], 'authParameters' => [ 'shape' => 'AuthParameterList', ], ], ], 'CustomAuthConfigList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CustomAuthConfig', ], ], 'CustomAuthCredentials' => [ 'type' => 'structure', 'required' => [ 'customAuthenticationType', ], 'members' => [ 'customAuthenticationType' => [ 'shape' => 'CustomAuthenticationType', ], 'credentialsMap' => [ 'shape' => 'CredentialsMap', ], ], ], 'CustomAuthenticationType' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', ], 'CustomConnectorDestinationProperties' => [ 'type' => 'structure', 'required' => [ 'entityName', ], 'members' => [ 'entityName' => [ 'shape' => 'EntityName', ], 'errorHandlingConfig' => [ 'shape' => 'ErrorHandlingConfig', ], 'writeOperationType' => [ 'shape' => 'WriteOperationType', ], 'idFieldNames' => [ 'shape' => 'IdFieldNameList', ], 'customProperties' => [ 'shape' => 'CustomProperties', ], ], ], 'CustomConnectorProfileCredentials' => [ 'type' => 'structure', 'required' => [ 'authenticationType', ], 'members' => [ 'authenticationType' => [ 'shape' => 'AuthenticationType', ], 'basic' => [ 'shape' => 'BasicAuthCredentials', ], 'oauth2' => [ 'shape' => 'OAuth2Credentials', ], 'apiKey' => [ 'shape' => 'ApiKeyCredentials', ], 'custom' => [ 'shape' => 'CustomAuthCredentials', ], ], ], 'CustomConnectorProfileProperties' => [ 'type' => 'structure', 'members' => [ 'profileProperties' => [ 'shape' => 'ProfilePropertiesMap', ], 'oAuth2Properties' => [ 'shape' => 'OAuth2Properties', ], ], ], 'CustomConnectorSourceProperties' => [ 'type' => 'structure', 'required' => [ 'entityName', ], 'members' => [ 'entityName' => [ 'shape' => 'EntityName', ], 'customProperties' => [ 'shape' => 'CustomProperties', ], 'dataTransferApi' => [ 'shape' => 'DataTransferApi', ], ], ], 'CustomProperties' => [ 'type' => 'map', 'key' => [ 'shape' => 'CustomPropertyKey', ], 'value' => [ 'shape' => 'CustomPropertyValue', ], 'max' => 50, 'min' => 0, ], 'CustomPropertyKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[\\\\w]+', ], 'CustomPropertyValue' => [ 'type' => 'string', 'max' => 2048, 'pattern' => '\\\\S+', ], 'CustomerProfilesDestinationProperties' => [ 'type' => 'structure', 'required' => [ 'domainName', ], 'members' => [ 'domainName' => [ 'shape' => 'DomainName', ], 'objectTypeName' => [ 'shape' => 'ObjectTypeName', ], ], ], 'CustomerProfilesMetadata' => [ 'type' => 'structure', 'members' => [], ], 'DataApiRoleArn' => [ 'type' => 'string', 'max' => 512, 'pattern' => 'arn:aws:iam:.*:[0-9]+:.*', ], 'DataPullMode' => [ 'type' => 'string', 'enum' => [ 'Incremental', 'Complete', ], ], 'DataTransferApi' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'DataTransferApiTypeName', ], 'Type' => [ 'shape' => 'DataTransferApiType', ], ], ], 'DataTransferApiType' => [ 'type' => 'string', 'enum' => [ 'SYNC', 'ASYNC', 'AUTOMATIC', ], ], 'DataTransferApiTypeName' => [ 'type' => 'string', 'max' => 64, 'pattern' => '[\\\\w/-]+', ], 'DatabaseName' => [ 'type' => 'string', 'max' => 512, 'pattern' => '\\\\S+', ], 'DatabaseUrl' => [ 'type' => 'string', 'max' => 512, 'pattern' => '\\\\S+', ], 'DatadogConnectorOperator' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'BETWEEN', 'EQUAL_TO', 'ADDITION', 'MULTIPLICATION', 'DIVISION', 'SUBTRACTION', 'MASK_ALL', 'MASK_FIRST_N', 'MASK_LAST_N', 'VALIDATE_NON_NULL', 'VALIDATE_NON_ZERO', 'VALIDATE_NON_NEGATIVE', 'VALIDATE_NUMERIC', 'NO_OP', ], ], 'DatadogConnectorProfileCredentials' => [ 'type' => 'structure', 'required' => [ 'apiKey', 'applicationKey', ], 'members' => [ 'apiKey' => [ 'shape' => 'ApiKey', ], 'applicationKey' => [ 'shape' => 'ApplicationKey', ], ], ], 'DatadogConnectorProfileProperties' => [ 'type' => 'structure', 'required' => [ 'instanceUrl', ], 'members' => [ 'instanceUrl' => [ 'shape' => 'InstanceUrl', ], ], ], 'DatadogMetadata' => [ 'type' => 'structure', 'members' => [], ], 'DatadogSourceProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], ], ], 'Date' => [ 'type' => 'timestamp', ], 'DatetimeTypeFieldName' => [ 'type' => 'string', 'max' => 256, 'pattern' => '.*', ], 'DeleteConnectorProfileRequest' => [ 'type' => 'structure', 'required' => [ 'connectorProfileName', ], 'members' => [ 'connectorProfileName' => [ 'shape' => 'ConnectorProfileName', ], 'forceDelete' => [ 'shape' => 'Boolean', ], ], ], 'DeleteConnectorProfileResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteFlowRequest' => [ 'type' => 'structure', 'required' => [ 'flowName', ], 'members' => [ 'flowName' => [ 'shape' => 'FlowName', ], 'forceDelete' => [ 'shape' => 'Boolean', ], ], ], 'DeleteFlowResponse' => [ 'type' => 'structure', 'members' => [], ], 'DescribeConnectorEntityRequest' => [ 'type' => 'structure', 'required' => [ 'connectorEntityName', ], 'members' => [ 'connectorEntityName' => [ 'shape' => 'EntityName', ], 'connectorType' => [ 'shape' => 'ConnectorType', ], 'connectorProfileName' => [ 'shape' => 'ConnectorProfileName', ], 'apiVersion' => [ 'shape' => 'ApiVersion', ], ], ], 'DescribeConnectorEntityResponse' => [ 'type' => 'structure', 'required' => [ 'connectorEntityFields', ], 'members' => [ 'connectorEntityFields' => [ 'shape' => 'ConnectorEntityFieldList', ], ], ], 'DescribeConnectorProfilesRequest' => [ 'type' => 'structure', 'members' => [ 'connectorProfileNames' => [ 'shape' => 'ConnectorProfileNameList', ], 'connectorType' => [ 'shape' => 'ConnectorType', ], 'connectorLabel' => [ 'shape' => 'ConnectorLabel', ], 'maxResults' => [ 'shape' => 'MaxResults', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeConnectorProfilesResponse' => [ 'type' => 'structure', 'members' => [ 'connectorProfileDetails' => [ 'shape' => 'ConnectorProfileDetailList', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'connectorType', ], 'members' => [ 'connectorType' => [ 'shape' => 'ConnectorType', ], 'connectorLabel' => [ 'shape' => 'ConnectorLabel', ], ], ], 'DescribeConnectorResponse' => [ 'type' => 'structure', 'members' => [ 'connectorConfiguration' => [ 'shape' => 'ConnectorConfiguration', ], ], ], 'DescribeConnectorsRequest' => [ 'type' => 'structure', 'members' => [ 'connectorTypes' => [ 'shape' => 'ConnectorTypeList', ], 'maxResults' => [ 'shape' => 'MaxResults', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeConnectorsResponse' => [ 'type' => 'structure', 'members' => [ 'connectorConfigurations' => [ 'shape' => 'ConnectorConfigurationsMap', ], 'connectors' => [ 'shape' => 'ConnectorList', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeFlowExecutionRecordsRequest' => [ 'type' => 'structure', 'required' => [ 'flowName', ], 'members' => [ 'flowName' => [ 'shape' => 'FlowName', ], 'maxResults' => [ 'shape' => 'MaxResults', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeFlowExecutionRecordsResponse' => [ 'type' => 'structure', 'members' => [ 'flowExecutions' => [ 'shape' => 'FlowExecutionList', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeFlowRequest' => [ 'type' => 'structure', 'required' => [ 'flowName', ], 'members' => [ 'flowName' => [ 'shape' => 'FlowName', ], ], ], 'DescribeFlowResponse' => [ 'type' => 'structure', 'members' => [ 'flowArn' => [ 'shape' => 'FlowArn', ], 'description' => [ 'shape' => 'FlowDescription', ], 'flowName' => [ 'shape' => 'FlowName', ], 'kmsArn' => [ 'shape' => 'KMSArn', ], 'flowStatus' => [ 'shape' => 'FlowStatus', ], 'flowStatusMessage' => [ 'shape' => 'FlowStatusMessage', ], 'sourceFlowConfig' => [ 'shape' => 'SourceFlowConfig', ], 'destinationFlowConfigList' => [ 'shape' => 'DestinationFlowConfigList', ], 'lastRunExecutionDetails' => [ 'shape' => 'ExecutionDetails', ], 'triggerConfig' => [ 'shape' => 'TriggerConfig', ], 'tasks' => [ 'shape' => 'Tasks', ], 'createdAt' => [ 'shape' => 'Date', ], 'lastUpdatedAt' => [ 'shape' => 'Date', ], 'createdBy' => [ 'shape' => 'CreatedBy', ], 'lastUpdatedBy' => [ 'shape' => 'UpdatedBy', ], 'tags' => [ 'shape' => 'TagMap', ], 'metadataCatalogConfig' => [ 'shape' => 'MetadataCatalogConfig', ], 'lastRunMetadataCatalogDetails' => [ 'shape' => 'MetadataCatalogDetails', ], 'schemaVersion' => [ 'shape' => 'Long', ], ], ], 'Description' => [ 'type' => 'string', 'max' => 1024, 'pattern' => '[\\\\s\\\\w/!@#+=.-]*', ], 'DestinationConnectorProperties' => [ 'type' => 'structure', 'members' => [ 'Redshift' => [ 'shape' => 'RedshiftDestinationProperties', ], 'S3' => [ 'shape' => 'S3DestinationProperties', ], 'Salesforce' => [ 'shape' => 'SalesforceDestinationProperties', ], 'Snowflake' => [ 'shape' => 'SnowflakeDestinationProperties', ], 'EventBridge' => [ 'shape' => 'EventBridgeDestinationProperties', ], 'LookoutMetrics' => [ 'shape' => 'LookoutMetricsDestinationProperties', ], 'Upsolver' => [ 'shape' => 'UpsolverDestinationProperties', ], 'Honeycode' => [ 'shape' => 'HoneycodeDestinationProperties', ], 'CustomerProfiles' => [ 'shape' => 'CustomerProfilesDestinationProperties', ], 'Zendesk' => [ 'shape' => 'ZendeskDestinationProperties', ], 'Marketo' => [ 'shape' => 'MarketoDestinationProperties', ], 'CustomConnector' => [ 'shape' => 'CustomConnectorDestinationProperties', ], 'SAPOData' => [ 'shape' => 'SAPODataDestinationProperties', ], ], ], 'DestinationField' => [ 'type' => 'string', 'max' => 256, 'pattern' => '.*', ], 'DestinationFieldProperties' => [ 'type' => 'structure', 'members' => [ 'isCreatable' => [ 'shape' => 'Boolean', ], 'isNullable' => [ 'shape' => 'Boolean', ], 'isUpsertable' => [ 'shape' => 'Boolean', ], 'isUpdatable' => [ 'shape' => 'Boolean', ], 'isDefaultedOnCreate' => [ 'shape' => 'Boolean', ], 'supportedWriteOperations' => [ 'shape' => 'SupportedWriteOperationList', ], ], ], 'DestinationFlowConfig' => [ 'type' => 'structure', 'required' => [ 'connectorType', 'destinationConnectorProperties', ], 'members' => [ 'connectorType' => [ 'shape' => 'ConnectorType', ], 'apiVersion' => [ 'shape' => 'ApiVersion', ], 'connectorProfileName' => [ 'shape' => 'ConnectorProfileName', ], 'destinationConnectorProperties' => [ 'shape' => 'DestinationConnectorProperties', ], ], ], 'DestinationFlowConfigList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DestinationFlowConfig', ], ], 'DocumentType' => [ 'type' => 'string', 'max' => 512, 'pattern' => '[\\\\s\\\\w_-]+', ], 'DomainName' => [ 'type' => 'string', 'max' => 64, 'pattern' => '\\\\S+', ], 'Double' => [ 'type' => 'double', ], 'DynatraceConnectorOperator' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'BETWEEN', 'EQUAL_TO', 'ADDITION', 'MULTIPLICATION', 'DIVISION', 'SUBTRACTION', 'MASK_ALL', 'MASK_FIRST_N', 'MASK_LAST_N', 'VALIDATE_NON_NULL', 'VALIDATE_NON_ZERO', 'VALIDATE_NON_NEGATIVE', 'VALIDATE_NUMERIC', 'NO_OP', ], ], 'DynatraceConnectorProfileCredentials' => [ 'type' => 'structure', 'required' => [ 'apiToken', ], 'members' => [ 'apiToken' => [ 'shape' => 'ApiToken', ], ], ], 'DynatraceConnectorProfileProperties' => [ 'type' => 'structure', 'required' => [ 'instanceUrl', ], 'members' => [ 'instanceUrl' => [ 'shape' => 'InstanceUrl', ], ], ], 'DynatraceMetadata' => [ 'type' => 'structure', 'members' => [], ], 'DynatraceSourceProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], ], ], 'EntitiesPath' => [ 'type' => 'string', 'max' => 256, 'pattern' => '[\\\\s\\\\w/!@#+=,.-]*', ], 'EntityName' => [ 'type' => 'string', 'max' => 1024, 'pattern' => '\\\\S+', ], 'ErrorHandlingConfig' => [ 'type' => 'structure', 'members' => [ 'failOnFirstDestinationError' => [ 'shape' => 'Boolean', ], 'bucketPrefix' => [ 'shape' => 'BucketPrefix', ], 'bucketName' => [ 'shape' => 'BucketName', ], ], ], 'ErrorInfo' => [ 'type' => 'structure', 'members' => [ 'putFailuresCount' => [ 'shape' => 'Long', ], 'executionMessage' => [ 'shape' => 'ExecutionMessage', ], ], ], 'ErrorMessage' => [ 'type' => 'string', 'max' => 2048, 'pattern' => '[\\\\s\\\\w/!@#+=.-]*', ], 'EventBridgeDestinationProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], 'errorHandlingConfig' => [ 'shape' => 'ErrorHandlingConfig', ], ], ], 'EventBridgeMetadata' => [ 'type' => 'structure', 'members' => [], ], 'ExecutionDetails' => [ 'type' => 'structure', 'members' => [ 'mostRecentExecutionMessage' => [ 'shape' => 'MostRecentExecutionMessage', ], 'mostRecentExecutionTime' => [ 'shape' => 'Date', ], 'mostRecentExecutionStatus' => [ 'shape' => 'ExecutionStatus', ], ], ], 'ExecutionId' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', ], 'ExecutionIds' => [ 'type' => 'list', 'member' => [ 'shape' => 'ExecutionId', ], 'max' => 100, 'min' => 0, ], 'ExecutionMessage' => [ 'type' => 'string', 'max' => 2048, 'pattern' => '[\\\\s\\\\w/!@#+=.-]*', ], 'ExecutionRecord' => [ 'type' => 'structure', 'members' => [ 'executionId' => [ 'shape' => 'ExecutionId', ], 'executionStatus' => [ 'shape' => 'ExecutionStatus', ], 'executionResult' => [ 'shape' => 'ExecutionResult', ], 'startedAt' => [ 'shape' => 'Date', ], 'lastUpdatedAt' => [ 'shape' => 'Date', ], 'dataPullStartTime' => [ 'shape' => 'Date', ], 'dataPullEndTime' => [ 'shape' => 'Date', ], 'metadataCatalogDetails' => [ 'shape' => 'MetadataCatalogDetails', ], ], ], 'ExecutionResult' => [ 'type' => 'structure', 'members' => [ 'errorInfo' => [ 'shape' => 'ErrorInfo', ], 'bytesProcessed' => [ 'shape' => 'Long', ], 'bytesWritten' => [ 'shape' => 'Long', ], 'recordsProcessed' => [ 'shape' => 'Long', ], ], ], 'ExecutionStatus' => [ 'type' => 'string', 'enum' => [ 'InProgress', 'Successful', 'Error', 'CancelStarted', 'Canceled', ], ], 'FieldType' => [ 'type' => 'string', ], 'FieldTypeDetails' => [ 'type' => 'structure', 'required' => [ 'fieldType', 'filterOperators', ], 'members' => [ 'fieldType' => [ 'shape' => 'FieldType', ], 'filterOperators' => [ 'shape' => 'FilterOperatorList', ], 'supportedValues' => [ 'shape' => 'SupportedValueList', ], 'valueRegexPattern' => [ 'shape' => 'String', ], 'supportedDateFormat' => [ 'shape' => 'String', ], 'fieldValueRange' => [ 'shape' => 'Range', ], 'fieldLengthRange' => [ 'shape' => 'Range', ], ], ], 'FileType' => [ 'type' => 'string', 'enum' => [ 'CSV', 'JSON', 'PARQUET', ], ], 'FilterOperatorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Operator', ], ], 'FlowArn' => [ 'type' => 'string', 'max' => 512, 'pattern' => 'arn:aws:appflow:.*:[0-9]+:.*', ], 'FlowDefinition' => [ 'type' => 'structure', 'members' => [ 'flowArn' => [ 'shape' => 'FlowArn', ], 'description' => [ 'shape' => 'FlowDescription', ], 'flowName' => [ 'shape' => 'FlowName', ], 'flowStatus' => [ 'shape' => 'FlowStatus', ], 'sourceConnectorType' => [ 'shape' => 'ConnectorType', ], 'sourceConnectorLabel' => [ 'shape' => 'ConnectorLabel', ], 'destinationConnectorType' => [ 'shape' => 'ConnectorType', ], 'destinationConnectorLabel' => [ 'shape' => 'ConnectorLabel', ], 'triggerType' => [ 'shape' => 'TriggerType', ], 'createdAt' => [ 'shape' => 'Date', ], 'lastUpdatedAt' => [ 'shape' => 'Date', ], 'createdBy' => [ 'shape' => 'CreatedBy', ], 'lastUpdatedBy' => [ 'shape' => 'UpdatedBy', ], 'tags' => [ 'shape' => 'TagMap', ], 'lastRunExecutionDetails' => [ 'shape' => 'ExecutionDetails', ], ], ], 'FlowDescription' => [ 'type' => 'string', 'max' => 2048, 'pattern' => '[\\\\w!@#\\\\-.?,\\\\s]*', ], 'FlowErrorDeactivationThreshold' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'FlowExecutionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ExecutionRecord', ], ], 'FlowList' => [ 'type' => 'list', 'member' => [ 'shape' => 'FlowDefinition', ], ], 'FlowName' => [ 'type' => 'string', 'max' => 256, 'pattern' => '[a-zA-Z0-9][\\\\w!@#.-]+', ], 'FlowStatus' => [ 'type' => 'string', 'enum' => [ 'Active', 'Deprecated', 'Deleted', 'Draft', 'Errored', 'Suspended', ], ], 'FlowStatusMessage' => [ 'type' => 'string', 'max' => 2048, 'pattern' => '[\\\\s\\\\w/!@#+=.-]*', ], 'GlueDataCatalogConfig' => [ 'type' => 'structure', 'required' => [ 'roleArn', 'databaseName', 'tablePrefix', ], 'members' => [ 'roleArn' => [ 'shape' => 'GlueDataCatalogIAMRole', ], 'databaseName' => [ 'shape' => 'GlueDataCatalogDatabaseName', ], 'tablePrefix' => [ 'shape' => 'GlueDataCatalogTablePrefix', ], ], ], 'GlueDataCatalogDatabaseName' => [ 'type' => 'string', 'max' => 255, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\t]*', ], 'GlueDataCatalogIAMRole' => [ 'type' => 'string', 'max' => 512, 'pattern' => 'arn:aws:iam:.*:[0-9]+:.*', ], 'GlueDataCatalogTablePrefix' => [ 'type' => 'string', 'max' => 128, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\t]*', ], 'GoogleAnalyticsConnectorOperator' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'BETWEEN', ], ], 'GoogleAnalyticsConnectorProfileCredentials' => [ 'type' => 'structure', 'required' => [ 'clientId', 'clientSecret', ], 'members' => [ 'clientId' => [ 'shape' => 'ClientId', ], 'clientSecret' => [ 'shape' => 'ClientSecret', ], 'accessToken' => [ 'shape' => 'AccessToken', ], 'refreshToken' => [ 'shape' => 'RefreshToken', ], 'oAuthRequest' => [ 'shape' => 'ConnectorOAuthRequest', ], ], ], 'GoogleAnalyticsConnectorProfileProperties' => [ 'type' => 'structure', 'members' => [], ], 'GoogleAnalyticsMetadata' => [ 'type' => 'structure', 'members' => [ 'oAuthScopes' => [ 'shape' => 'OAuthScopeList', ], ], ], 'GoogleAnalyticsSourceProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], ], ], 'Group' => [ 'type' => 'string', 'max' => 128, 'pattern' => '\\\\S+', ], 'HoneycodeConnectorProfileCredentials' => [ 'type' => 'structure', 'members' => [ 'accessToken' => [ 'shape' => 'AccessToken', ], 'refreshToken' => [ 'shape' => 'RefreshToken', ], 'oAuthRequest' => [ 'shape' => 'ConnectorOAuthRequest', ], ], ], 'HoneycodeConnectorProfileProperties' => [ 'type' => 'structure', 'members' => [], ], 'HoneycodeDestinationProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], 'errorHandlingConfig' => [ 'shape' => 'ErrorHandlingConfig', ], ], ], 'HoneycodeMetadata' => [ 'type' => 'structure', 'members' => [ 'oAuthScopes' => [ 'shape' => 'OAuthScopeList', ], ], ], 'IdFieldNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Name', ], 'min' => 0, ], 'Identifier' => [ 'type' => 'string', 'max' => 128, 'pattern' => '\\\\S+', ], 'IncrementalPullConfig' => [ 'type' => 'structure', 'members' => [ 'datetimeTypeFieldName' => [ 'shape' => 'DatetimeTypeFieldName', ], ], ], 'InforNexusConnectorOperator' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'BETWEEN', 'EQUAL_TO', 'ADDITION', 'MULTIPLICATION', 'DIVISION', 'SUBTRACTION', 'MASK_ALL', 'MASK_FIRST_N', 'MASK_LAST_N', 'VALIDATE_NON_NULL', 'VALIDATE_NON_ZERO', 'VALIDATE_NON_NEGATIVE', 'VALIDATE_NUMERIC', 'NO_OP', ], ], 'InforNexusConnectorProfileCredentials' => [ 'type' => 'structure', 'required' => [ 'accessKeyId', 'userId', 'secretAccessKey', 'datakey', ], 'members' => [ 'accessKeyId' => [ 'shape' => 'AccessKeyId', ], 'userId' => [ 'shape' => 'Username', ], 'secretAccessKey' => [ 'shape' => 'Key', ], 'datakey' => [ 'shape' => 'Key', ], ], ], 'InforNexusConnectorProfileProperties' => [ 'type' => 'structure', 'required' => [ 'instanceUrl', ], 'members' => [ 'instanceUrl' => [ 'shape' => 'InstanceUrl', ], ], ], 'InforNexusMetadata' => [ 'type' => 'structure', 'members' => [], ], 'InforNexusSourceProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], ], ], 'InstanceUrl' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', ], 'InternalServerException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, ], 'JavaBoolean' => [ 'type' => 'boolean', ], 'JwtToken' => [ 'type' => 'string', 'max' => 8000, 'pattern' => '^([a-zA-Z0-9_=]+)\\\\.([a-zA-Z0-9_=]+)\\\\.([a-zA-Z0-9_\\\\-\\\\+\\\\/=]*)', 'sensitive' => true, ], 'KMSArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 20, 'pattern' => 'arn:aws:kms:.*:[0-9]+:.*', ], 'Key' => [ 'type' => 'string', 'max' => 512, 'pattern' => '\\\\S+', ], 'Label' => [ 'type' => 'string', 'max' => 128, 'pattern' => '.*', ], 'LambdaConnectorProvisioningConfig' => [ 'type' => 'structure', 'required' => [ 'lambdaArn', ], 'members' => [ 'lambdaArn' => [ 'shape' => 'ARN', ], ], ], 'ListConnectorEntitiesRequest' => [ 'type' => 'structure', 'members' => [ 'connectorProfileName' => [ 'shape' => 'ConnectorProfileName', ], 'connectorType' => [ 'shape' => 'ConnectorType', ], 'entitiesPath' => [ 'shape' => 'EntitiesPath', ], 'apiVersion' => [ 'shape' => 'ApiVersion', ], 'maxResults' => [ 'shape' => 'ListEntitiesMaxResults', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListConnectorEntitiesResponse' => [ 'type' => 'structure', 'required' => [ 'connectorEntityMap', ], 'members' => [ 'connectorEntityMap' => [ 'shape' => 'ConnectorEntityMap', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListConnectorsRequest' => [ 'type' => 'structure', 'members' => [ 'maxResults' => [ 'shape' => 'MaxResults', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListConnectorsResponse' => [ 'type' => 'structure', 'members' => [ 'connectors' => [ 'shape' => 'ConnectorList', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListEntitiesMaxResults' => [ 'type' => 'integer', 'max' => 10000, 'min' => 1, ], 'ListFlowsRequest' => [ 'type' => 'structure', 'members' => [ 'maxResults' => [ 'shape' => 'MaxResults', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListFlowsResponse' => [ 'type' => 'structure', 'members' => [ 'flows' => [ 'shape' => 'FlowList', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', ], 'members' => [ 'resourceArn' => [ 'shape' => 'ARN', 'location' => 'uri', 'locationName' => 'resourceArn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'tags' => [ 'shape' => 'TagMap', ], ], ], 'LogoURL' => [ 'type' => 'string', 'max' => 256, 'pattern' => '^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]', ], 'LogonLanguage' => [ 'type' => 'string', 'max' => 2, 'pattern' => '^[a-zA-Z0-9_]*$', ], 'Long' => [ 'type' => 'long', ], 'LookoutMetricsDestinationProperties' => [ 'type' => 'structure', 'members' => [], ], 'MarketoConnectorOperator' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'LESS_THAN', 'GREATER_THAN', 'BETWEEN', 'ADDITION', 'MULTIPLICATION', 'DIVISION', 'SUBTRACTION', 'MASK_ALL', 'MASK_FIRST_N', 'MASK_LAST_N', 'VALIDATE_NON_NULL', 'VALIDATE_NON_ZERO', 'VALIDATE_NON_NEGATIVE', 'VALIDATE_NUMERIC', 'NO_OP', ], ], 'MarketoConnectorProfileCredentials' => [ 'type' => 'structure', 'required' => [ 'clientId', 'clientSecret', ], 'members' => [ 'clientId' => [ 'shape' => 'ClientId', ], 'clientSecret' => [ 'shape' => 'ClientSecret', ], 'accessToken' => [ 'shape' => 'AccessToken', ], 'oAuthRequest' => [ 'shape' => 'ConnectorOAuthRequest', ], ], ], 'MarketoConnectorProfileProperties' => [ 'type' => 'structure', 'required' => [ 'instanceUrl', ], 'members' => [ 'instanceUrl' => [ 'shape' => 'InstanceUrl', ], ], ], 'MarketoDestinationProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], 'errorHandlingConfig' => [ 'shape' => 'ErrorHandlingConfig', ], ], ], 'MarketoMetadata' => [ 'type' => 'structure', 'members' => [], ], 'MarketoSourceProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], ], ], 'MaxResults' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'MetadataCatalogConfig' => [ 'type' => 'structure', 'members' => [ 'glueDataCatalog' => [ 'shape' => 'GlueDataCatalogConfig', ], ], ], 'MetadataCatalogDetail' => [ 'type' => 'structure', 'members' => [ 'catalogType' => [ 'shape' => 'CatalogType', ], 'tableName' => [ 'shape' => 'String', ], 'tableRegistrationOutput' => [ 'shape' => 'RegistrationOutput', ], 'partitionRegistrationOutput' => [ 'shape' => 'RegistrationOutput', ], ], ], 'MetadataCatalogDetails' => [ 'type' => 'list', 'member' => [ 'shape' => 'MetadataCatalogDetail', ], ], 'MostRecentExecutionMessage' => [ 'type' => 'string', 'max' => 2048, 'pattern' => '[\\\\w!@#\\\\-.?,\\\\s]*', ], 'Name' => [ 'type' => 'string', 'max' => 128, 'pattern' => '\\\\S+', ], 'NextToken' => [ 'type' => 'string', 'max' => 2048, 'pattern' => '\\\\S+', ], 'OAuth2Credentials' => [ 'type' => 'structure', 'members' => [ 'clientId' => [ 'shape' => 'ClientId', ], 'clientSecret' => [ 'shape' => 'ClientSecret', ], 'accessToken' => [ 'shape' => 'AccessToken', ], 'refreshToken' => [ 'shape' => 'RefreshToken', ], 'oAuthRequest' => [ 'shape' => 'ConnectorOAuthRequest', ], ], ], 'OAuth2CustomParameter' => [ 'type' => 'structure', 'members' => [ 'key' => [ 'shape' => 'Key', ], 'isRequired' => [ 'shape' => 'Boolean', ], 'label' => [ 'shape' => 'Label', ], 'description' => [ 'shape' => 'Description', ], 'isSensitiveField' => [ 'shape' => 'Boolean', ], 'connectorSuppliedValues' => [ 'shape' => 'ConnectorSuppliedValueList', ], 'type' => [ 'shape' => 'OAuth2CustomPropType', ], ], ], 'OAuth2CustomPropType' => [ 'type' => 'string', 'enum' => [ 'TOKEN_URL', 'AUTH_URL', ], ], 'OAuth2CustomPropertiesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'OAuth2CustomParameter', ], ], 'OAuth2Defaults' => [ 'type' => 'structure', 'members' => [ 'oauthScopes' => [ 'shape' => 'OAuthScopeList', ], 'tokenUrls' => [ 'shape' => 'TokenUrlList', ], 'authCodeUrls' => [ 'shape' => 'AuthCodeUrlList', ], 'oauth2GrantTypesSupported' => [ 'shape' => 'OAuth2GrantTypeSupportedList', ], 'oauth2CustomProperties' => [ 'shape' => 'OAuth2CustomPropertiesList', ], ], ], 'OAuth2GrantType' => [ 'type' => 'string', 'enum' => [ 'CLIENT_CREDENTIALS', 'AUTHORIZATION_CODE', 'JWT_BEARER', ], ], 'OAuth2GrantTypeSupportedList' => [ 'type' => 'list', 'member' => [ 'shape' => 'OAuth2GrantType', ], ], 'OAuth2Properties' => [ 'type' => 'structure', 'required' => [ 'tokenUrl', 'oAuth2GrantType', ], 'members' => [ 'tokenUrl' => [ 'shape' => 'TokenUrl', ], 'oAuth2GrantType' => [ 'shape' => 'OAuth2GrantType', ], 'tokenUrlCustomProperties' => [ 'shape' => 'TokenUrlCustomProperties', ], ], ], 'OAuthCredentials' => [ 'type' => 'structure', 'required' => [ 'clientId', 'clientSecret', ], 'members' => [ 'clientId' => [ 'shape' => 'ClientId', ], 'clientSecret' => [ 'shape' => 'ClientSecret', ], 'accessToken' => [ 'shape' => 'AccessToken', ], 'refreshToken' => [ 'shape' => 'RefreshToken', ], 'oAuthRequest' => [ 'shape' => 'ConnectorOAuthRequest', ], ], ], 'OAuthProperties' => [ 'type' => 'structure', 'required' => [ 'tokenUrl', 'authCodeUrl', 'oAuthScopes', ], 'members' => [ 'tokenUrl' => [ 'shape' => 'TokenUrl', ], 'authCodeUrl' => [ 'shape' => 'AuthCodeUrl', ], 'oAuthScopes' => [ 'shape' => 'OAuthScopeList', ], ], ], 'OAuthScope' => [ 'type' => 'string', 'max' => 128, 'pattern' => '\\\\S+', ], 'OAuthScopeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'OAuthScope', ], ], 'Object' => [ 'type' => 'string', 'max' => 512, 'pattern' => '\\\\S+', ], 'ObjectTypeName' => [ 'type' => 'string', 'max' => 255, 'pattern' => '\\\\S+', ], 'Operator' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'LESS_THAN', 'GREATER_THAN', 'CONTAINS', 'BETWEEN', 'LESS_THAN_OR_EQUAL_TO', 'GREATER_THAN_OR_EQUAL_TO', 'EQUAL_TO', 'NOT_EQUAL_TO', 'ADDITION', 'MULTIPLICATION', 'DIVISION', 'SUBTRACTION', 'MASK_ALL', 'MASK_FIRST_N', 'MASK_LAST_N', 'VALIDATE_NON_NULL', 'VALIDATE_NON_ZERO', 'VALIDATE_NON_NEGATIVE', 'VALIDATE_NUMERIC', 'NO_OP', ], ], 'OperatorPropertiesKeys' => [ 'type' => 'string', 'enum' => [ 'VALUE', 'VALUES', 'DATA_TYPE', 'UPPER_BOUND', 'LOWER_BOUND', 'SOURCE_DATA_TYPE', 'DESTINATION_DATA_TYPE', 'VALIDATION_ACTION', 'MASK_VALUE', 'MASK_LENGTH', 'TRUNCATE_LENGTH', 'MATH_OPERATION_FIELDS_ORDER', 'CONCAT_FORMAT', 'SUBFIELD_CATEGORY_MAP', 'EXCLUDE_SOURCE_FIELDS_LIST', 'INCLUDE_NEW_FIELDS', 'ORDERED_PARTITION_KEYS_LIST', ], ], 'Operators' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'LESS_THAN', 'GREATER_THAN', 'CONTAINS', 'BETWEEN', 'LESS_THAN_OR_EQUAL_TO', 'GREATER_THAN_OR_EQUAL_TO', 'EQUAL_TO', 'NOT_EQUAL_TO', 'ADDITION', 'MULTIPLICATION', 'DIVISION', 'SUBTRACTION', 'MASK_ALL', 'MASK_FIRST_N', 'MASK_LAST_N', 'VALIDATE_NON_NULL', 'VALIDATE_NON_ZERO', 'VALIDATE_NON_NEGATIVE', 'VALIDATE_NUMERIC', 'NO_OP', ], ], 'PardotConnectorOperator' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'EQUAL_TO', 'NO_OP', 'ADDITION', 'MULTIPLICATION', 'DIVISION', 'SUBTRACTION', 'MASK_ALL', 'MASK_FIRST_N', 'MASK_LAST_N', 'VALIDATE_NON_NULL', 'VALIDATE_NON_ZERO', 'VALIDATE_NON_NEGATIVE', 'VALIDATE_NUMERIC', ], ], 'PardotConnectorProfileCredentials' => [ 'type' => 'structure', 'members' => [ 'accessToken' => [ 'shape' => 'AccessToken', ], 'refreshToken' => [ 'shape' => 'RefreshToken', ], 'oAuthRequest' => [ 'shape' => 'ConnectorOAuthRequest', ], 'clientCredentialsArn' => [ 'shape' => 'ClientCredentialsArn', ], ], ], 'PardotConnectorProfileProperties' => [ 'type' => 'structure', 'members' => [ 'instanceUrl' => [ 'shape' => 'InstanceUrl', ], 'isSandboxEnvironment' => [ 'shape' => 'Boolean', ], 'businessUnitId' => [ 'shape' => 'BusinessUnitId', ], ], ], 'PardotMetadata' => [ 'type' => 'structure', 'members' => [], ], 'PardotSourceProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], ], ], 'Password' => [ 'type' => 'string', 'max' => 512, 'pattern' => '.*', 'sensitive' => true, ], 'PathPrefix' => [ 'type' => 'string', 'enum' => [ 'EXECUTION_ID', 'SCHEMA_VERSION', ], ], 'PathPrefixHierarchy' => [ 'type' => 'list', 'member' => [ 'shape' => 'PathPrefix', ], ], 'PortNumber' => [ 'type' => 'integer', 'max' => 65535, 'min' => 1, ], 'PrefixConfig' => [ 'type' => 'structure', 'members' => [ 'prefixType' => [ 'shape' => 'PrefixType', ], 'prefixFormat' => [ 'shape' => 'PrefixFormat', ], 'pathPrefixHierarchy' => [ 'shape' => 'PathPrefixHierarchy', ], ], ], 'PrefixFormat' => [ 'type' => 'string', 'enum' => [ 'YEAR', 'MONTH', 'DAY', 'HOUR', 'MINUTE', ], ], 'PrefixType' => [ 'type' => 'string', 'enum' => [ 'FILENAME', 'PATH', 'PATH_AND_FILENAME', ], ], 'PrivateConnectionProvisioningFailureCause' => [ 'type' => 'string', 'enum' => [ 'CONNECTOR_AUTHENTICATION', 'CONNECTOR_SERVER', 'INTERNAL_SERVER', 'ACCESS_DENIED', 'VALIDATION', ], ], 'PrivateConnectionProvisioningFailureMessage' => [ 'type' => 'string', 'max' => 2048, 'pattern' => '[\\\\s\\\\w/!@#+=.-]*', ], 'PrivateConnectionProvisioningState' => [ 'type' => 'structure', 'members' => [ 'status' => [ 'shape' => 'PrivateConnectionProvisioningStatus', ], 'failureMessage' => [ 'shape' => 'PrivateConnectionProvisioningFailureMessage', ], 'failureCause' => [ 'shape' => 'PrivateConnectionProvisioningFailureCause', ], ], ], 'PrivateConnectionProvisioningStatus' => [ 'type' => 'string', 'enum' => [ 'FAILED', 'PENDING', 'CREATED', ], ], 'PrivateLinkServiceName' => [ 'type' => 'string', 'max' => 512, 'pattern' => '^$|com.amazonaws.vpce.[\\\\w/!:@#.\\\\-]+', ], 'ProfilePropertiesMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'ProfilePropertyKey', ], 'value' => [ 'shape' => 'ProfilePropertyValue', ], 'max' => 50, 'min' => 0, ], 'ProfilePropertyKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[\\\\w]+', ], 'ProfilePropertyValue' => [ 'type' => 'string', 'max' => 2048, 'pattern' => '\\\\S+', ], 'Property' => [ 'type' => 'string', 'max' => 2048, 'pattern' => '.+', ], 'Range' => [ 'type' => 'structure', 'members' => [ 'maximum' => [ 'shape' => 'Double', ], 'minimum' => [ 'shape' => 'Double', ], ], ], 'RedirectUri' => [ 'type' => 'string', 'max' => 512, 'pattern' => '\\\\S+', ], 'RedshiftConnectorProfileCredentials' => [ 'type' => 'structure', 'members' => [ 'username' => [ 'shape' => 'String', ], 'password' => [ 'shape' => 'Password', ], ], ], 'RedshiftConnectorProfileProperties' => [ 'type' => 'structure', 'required' => [ 'bucketName', 'roleArn', ], 'members' => [ 'databaseUrl' => [ 'shape' => 'DatabaseUrl', ], 'bucketName' => [ 'shape' => 'BucketName', ], 'bucketPrefix' => [ 'shape' => 'BucketPrefix', ], 'roleArn' => [ 'shape' => 'RoleArn', ], 'dataApiRoleArn' => [ 'shape' => 'DataApiRoleArn', ], 'isRedshiftServerless' => [ 'shape' => 'Boolean', ], 'clusterIdentifier' => [ 'shape' => 'ClusterIdentifier', ], 'workgroupName' => [ 'shape' => 'WorkgroupName', ], 'databaseName' => [ 'shape' => 'DatabaseName', ], ], ], 'RedshiftDestinationProperties' => [ 'type' => 'structure', 'required' => [ 'object', 'intermediateBucketName', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], 'intermediateBucketName' => [ 'shape' => 'BucketName', ], 'bucketPrefix' => [ 'shape' => 'BucketPrefix', ], 'errorHandlingConfig' => [ 'shape' => 'ErrorHandlingConfig', ], ], ], 'RedshiftMetadata' => [ 'type' => 'structure', 'members' => [], ], 'RefreshToken' => [ 'type' => 'string', 'max' => 4096, 'pattern' => '\\\\S+', ], 'Region' => [ 'type' => 'string', 'max' => 64, 'pattern' => '\\\\S+', ], 'RegionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Region', ], ], 'RegisterConnectorRequest' => [ 'type' => 'structure', 'members' => [ 'connectorLabel' => [ 'shape' => 'ConnectorLabel', ], 'description' => [ 'shape' => 'Description', ], 'connectorProvisioningType' => [ 'shape' => 'ConnectorProvisioningType', ], 'connectorProvisioningConfig' => [ 'shape' => 'ConnectorProvisioningConfig', ], 'clientToken' => [ 'shape' => 'ClientToken', 'idempotencyToken' => true, ], ], ], 'RegisterConnectorResponse' => [ 'type' => 'structure', 'members' => [ 'connectorArn' => [ 'shape' => 'ARN', ], ], ], 'RegisteredBy' => [ 'type' => 'string', 'max' => 512, 'pattern' => '\\\\S+', ], 'RegistrationOutput' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], 'result' => [ 'shape' => 'String', ], 'status' => [ 'shape' => 'ExecutionStatus', ], ], ], 'ResetConnectorMetadataCacheRequest' => [ 'type' => 'structure', 'members' => [ 'connectorProfileName' => [ 'shape' => 'ConnectorProfileName', ], 'connectorType' => [ 'shape' => 'ConnectorType', ], 'connectorEntityName' => [ 'shape' => 'EntityName', ], 'entitiesPath' => [ 'shape' => 'EntitiesPath', ], 'apiVersion' => [ 'shape' => 'ApiVersion', ], ], ], 'ResetConnectorMetadataCacheResponse' => [ 'type' => 'structure', 'members' => [], ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'RoleArn' => [ 'type' => 'string', 'max' => 512, 'pattern' => 'arn:aws:iam:.*:[0-9]+:.*', ], 'S3ConnectorOperator' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'LESS_THAN', 'GREATER_THAN', 'BETWEEN', 'LESS_THAN_OR_EQUAL_TO', 'GREATER_THAN_OR_EQUAL_TO', 'EQUAL_TO', 'NOT_EQUAL_TO', 'ADDITION', 'MULTIPLICATION', 'DIVISION', 'SUBTRACTION', 'MASK_ALL', 'MASK_FIRST_N', 'MASK_LAST_N', 'VALIDATE_NON_NULL', 'VALIDATE_NON_ZERO', 'VALIDATE_NON_NEGATIVE', 'VALIDATE_NUMERIC', 'NO_OP', ], ], 'S3DestinationProperties' => [ 'type' => 'structure', 'required' => [ 'bucketName', ], 'members' => [ 'bucketName' => [ 'shape' => 'BucketName', ], 'bucketPrefix' => [ 'shape' => 'BucketPrefix', ], 's3OutputFormatConfig' => [ 'shape' => 'S3OutputFormatConfig', ], ], ], 'S3InputFileType' => [ 'type' => 'string', 'enum' => [ 'CSV', 'JSON', ], ], 'S3InputFormatConfig' => [ 'type' => 'structure', 'members' => [ 's3InputFileType' => [ 'shape' => 'S3InputFileType', ], ], ], 'S3Metadata' => [ 'type' => 'structure', 'members' => [], ], 'S3OutputFormatConfig' => [ 'type' => 'structure', 'members' => [ 'fileType' => [ 'shape' => 'FileType', ], 'prefixConfig' => [ 'shape' => 'PrefixConfig', ], 'aggregationConfig' => [ 'shape' => 'AggregationConfig', ], 'preserveSourceDataTyping' => [ 'shape' => 'JavaBoolean', ], ], ], 'S3SourceProperties' => [ 'type' => 'structure', 'required' => [ 'bucketName', ], 'members' => [ 'bucketName' => [ 'shape' => 'BucketName', ], 'bucketPrefix' => [ 'shape' => 'BucketPrefix', ], 's3InputFormatConfig' => [ 'shape' => 'S3InputFormatConfig', ], ], ], 'SAPODataConnectorOperator' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'LESS_THAN', 'CONTAINS', 'GREATER_THAN', 'BETWEEN', 'LESS_THAN_OR_EQUAL_TO', 'GREATER_THAN_OR_EQUAL_TO', 'EQUAL_TO', 'NOT_EQUAL_TO', 'ADDITION', 'MULTIPLICATION', 'DIVISION', 'SUBTRACTION', 'MASK_ALL', 'MASK_FIRST_N', 'MASK_LAST_N', 'VALIDATE_NON_NULL', 'VALIDATE_NON_ZERO', 'VALIDATE_NON_NEGATIVE', 'VALIDATE_NUMERIC', 'NO_OP', ], ], 'SAPODataConnectorProfileCredentials' => [ 'type' => 'structure', 'members' => [ 'basicAuthCredentials' => [ 'shape' => 'BasicAuthCredentials', ], 'oAuthCredentials' => [ 'shape' => 'OAuthCredentials', ], ], ], 'SAPODataConnectorProfileProperties' => [ 'type' => 'structure', 'required' => [ 'applicationHostUrl', 'applicationServicePath', 'portNumber', 'clientNumber', ], 'members' => [ 'applicationHostUrl' => [ 'shape' => 'ApplicationHostUrl', ], 'applicationServicePath' => [ 'shape' => 'ApplicationServicePath', ], 'portNumber' => [ 'shape' => 'PortNumber', 'box' => true, ], 'clientNumber' => [ 'shape' => 'ClientNumber', ], 'logonLanguage' => [ 'shape' => 'LogonLanguage', ], 'privateLinkServiceName' => [ 'shape' => 'PrivateLinkServiceName', ], 'oAuthProperties' => [ 'shape' => 'OAuthProperties', ], 'disableSSO' => [ 'shape' => 'Boolean', ], ], ], 'SAPODataDestinationProperties' => [ 'type' => 'structure', 'required' => [ 'objectPath', ], 'members' => [ 'objectPath' => [ 'shape' => 'Object', ], 'successResponseHandlingConfig' => [ 'shape' => 'SuccessResponseHandlingConfig', ], 'idFieldNames' => [ 'shape' => 'IdFieldNameList', ], 'errorHandlingConfig' => [ 'shape' => 'ErrorHandlingConfig', ], 'writeOperationType' => [ 'shape' => 'WriteOperationType', ], ], ], 'SAPODataMetadata' => [ 'type' => 'structure', 'members' => [], ], 'SAPODataSourceProperties' => [ 'type' => 'structure', 'members' => [ 'objectPath' => [ 'shape' => 'Object', ], ], ], 'SalesforceConnectorOperator' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'LESS_THAN', 'CONTAINS', 'GREATER_THAN', 'BETWEEN', 'LESS_THAN_OR_EQUAL_TO', 'GREATER_THAN_OR_EQUAL_TO', 'EQUAL_TO', 'NOT_EQUAL_TO', 'ADDITION', 'MULTIPLICATION', 'DIVISION', 'SUBTRACTION', 'MASK_ALL', 'MASK_FIRST_N', 'MASK_LAST_N', 'VALIDATE_NON_NULL', 'VALIDATE_NON_ZERO', 'VALIDATE_NON_NEGATIVE', 'VALIDATE_NUMERIC', 'NO_OP', ], ], 'SalesforceConnectorProfileCredentials' => [ 'type' => 'structure', 'members' => [ 'accessToken' => [ 'shape' => 'AccessToken', ], 'refreshToken' => [ 'shape' => 'RefreshToken', ], 'oAuthRequest' => [ 'shape' => 'ConnectorOAuthRequest', ], 'clientCredentialsArn' => [ 'shape' => 'ClientCredentialsArn', ], 'oAuth2GrantType' => [ 'shape' => 'OAuth2GrantType', ], 'jwtToken' => [ 'shape' => 'JwtToken', ], ], ], 'SalesforceConnectorProfileProperties' => [ 'type' => 'structure', 'members' => [ 'instanceUrl' => [ 'shape' => 'InstanceUrl', ], 'isSandboxEnvironment' => [ 'shape' => 'Boolean', ], 'usePrivateLinkForMetadataAndAuthorization' => [ 'shape' => 'Boolean', ], ], ], 'SalesforceDataTransferApi' => [ 'type' => 'string', 'enum' => [ 'AUTOMATIC', 'BULKV2', 'REST_SYNC', ], ], 'SalesforceDataTransferApiList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SalesforceDataTransferApi', ], ], 'SalesforceDestinationProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], 'idFieldNames' => [ 'shape' => 'IdFieldNameList', ], 'errorHandlingConfig' => [ 'shape' => 'ErrorHandlingConfig', ], 'writeOperationType' => [ 'shape' => 'WriteOperationType', ], 'dataTransferApi' => [ 'shape' => 'SalesforceDataTransferApi', ], ], ], 'SalesforceMetadata' => [ 'type' => 'structure', 'members' => [ 'oAuthScopes' => [ 'shape' => 'OAuthScopeList', ], 'dataTransferApis' => [ 'shape' => 'SalesforceDataTransferApiList', ], 'oauth2GrantTypesSupported' => [ 'shape' => 'OAuth2GrantTypeSupportedList', ], ], ], 'SalesforceSourceProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], 'enableDynamicFieldUpdate' => [ 'shape' => 'Boolean', ], 'includeDeletedRecords' => [ 'shape' => 'Boolean', ], 'dataTransferApi' => [ 'shape' => 'SalesforceDataTransferApi', ], ], ], 'ScheduleExpression' => [ 'type' => 'string', 'max' => 256, 'pattern' => '.*', ], 'ScheduleFrequencyType' => [ 'type' => 'string', 'enum' => [ 'BYMINUTE', 'HOURLY', 'DAILY', 'WEEKLY', 'MONTHLY', 'ONCE', ], ], 'ScheduleOffset' => [ 'type' => 'long', 'max' => 36000, 'min' => 0, ], 'ScheduledTriggerProperties' => [ 'type' => 'structure', 'required' => [ 'scheduleExpression', ], 'members' => [ 'scheduleExpression' => [ 'shape' => 'ScheduleExpression', ], 'dataPullMode' => [ 'shape' => 'DataPullMode', ], 'scheduleStartTime' => [ 'shape' => 'Date', ], 'scheduleEndTime' => [ 'shape' => 'Date', ], 'timezone' => [ 'shape' => 'Timezone', ], 'scheduleOffset' => [ 'shape' => 'ScheduleOffset', 'box' => true, ], 'firstExecutionFrom' => [ 'shape' => 'Date', ], 'flowErrorDeactivationThreshold' => [ 'shape' => 'FlowErrorDeactivationThreshold', 'box' => true, ], ], ], 'SchedulingFrequencyTypeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ScheduleFrequencyType', ], ], 'SecretKey' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', 'sensitive' => true, ], 'ServiceNowConnectorOperator' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'CONTAINS', 'LESS_THAN', 'GREATER_THAN', 'BETWEEN', 'LESS_THAN_OR_EQUAL_TO', 'GREATER_THAN_OR_EQUAL_TO', 'EQUAL_TO', 'NOT_EQUAL_TO', 'ADDITION', 'MULTIPLICATION', 'DIVISION', 'SUBTRACTION', 'MASK_ALL', 'MASK_FIRST_N', 'MASK_LAST_N', 'VALIDATE_NON_NULL', 'VALIDATE_NON_ZERO', 'VALIDATE_NON_NEGATIVE', 'VALIDATE_NUMERIC', 'NO_OP', ], ], 'ServiceNowConnectorProfileCredentials' => [ 'type' => 'structure', 'required' => [ 'username', 'password', ], 'members' => [ 'username' => [ 'shape' => 'Username', ], 'password' => [ 'shape' => 'Password', ], ], ], 'ServiceNowConnectorProfileProperties' => [ 'type' => 'structure', 'required' => [ 'instanceUrl', ], 'members' => [ 'instanceUrl' => [ 'shape' => 'InstanceUrl', ], ], ], 'ServiceNowMetadata' => [ 'type' => 'structure', 'members' => [], ], 'ServiceNowSourceProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], ], ], 'ServiceQuotaExceededException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 402, ], 'exception' => true, ], 'SingularConnectorOperator' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'EQUAL_TO', 'ADDITION', 'MULTIPLICATION', 'DIVISION', 'SUBTRACTION', 'MASK_ALL', 'MASK_FIRST_N', 'MASK_LAST_N', 'VALIDATE_NON_NULL', 'VALIDATE_NON_ZERO', 'VALIDATE_NON_NEGATIVE', 'VALIDATE_NUMERIC', 'NO_OP', ], ], 'SingularConnectorProfileCredentials' => [ 'type' => 'structure', 'required' => [ 'apiKey', ], 'members' => [ 'apiKey' => [ 'shape' => 'ApiKey', ], ], ], 'SingularConnectorProfileProperties' => [ 'type' => 'structure', 'members' => [], ], 'SingularMetadata' => [ 'type' => 'structure', 'members' => [], ], 'SingularSourceProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], ], ], 'SlackConnectorOperator' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'LESS_THAN', 'GREATER_THAN', 'BETWEEN', 'LESS_THAN_OR_EQUAL_TO', 'GREATER_THAN_OR_EQUAL_TO', 'EQUAL_TO', 'ADDITION', 'MULTIPLICATION', 'DIVISION', 'SUBTRACTION', 'MASK_ALL', 'MASK_FIRST_N', 'MASK_LAST_N', 'VALIDATE_NON_NULL', 'VALIDATE_NON_ZERO', 'VALIDATE_NON_NEGATIVE', 'VALIDATE_NUMERIC', 'NO_OP', ], ], 'SlackConnectorProfileCredentials' => [ 'type' => 'structure', 'required' => [ 'clientId', 'clientSecret', ], 'members' => [ 'clientId' => [ 'shape' => 'ClientId', ], 'clientSecret' => [ 'shape' => 'ClientSecret', ], 'accessToken' => [ 'shape' => 'AccessToken', ], 'oAuthRequest' => [ 'shape' => 'ConnectorOAuthRequest', ], ], ], 'SlackConnectorProfileProperties' => [ 'type' => 'structure', 'required' => [ 'instanceUrl', ], 'members' => [ 'instanceUrl' => [ 'shape' => 'InstanceUrl', ], ], ], 'SlackMetadata' => [ 'type' => 'structure', 'members' => [ 'oAuthScopes' => [ 'shape' => 'OAuthScopeList', ], ], ], 'SlackSourceProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], ], ], 'SnowflakeConnectorProfileCredentials' => [ 'type' => 'structure', 'required' => [ 'username', 'password', ], 'members' => [ 'username' => [ 'shape' => 'Username', ], 'password' => [ 'shape' => 'Password', ], ], ], 'SnowflakeConnectorProfileProperties' => [ 'type' => 'structure', 'required' => [ 'warehouse', 'stage', 'bucketName', ], 'members' => [ 'warehouse' => [ 'shape' => 'Warehouse', ], 'stage' => [ 'shape' => 'Stage', ], 'bucketName' => [ 'shape' => 'BucketName', ], 'bucketPrefix' => [ 'shape' => 'BucketPrefix', ], 'privateLinkServiceName' => [ 'shape' => 'PrivateLinkServiceName', ], 'accountName' => [ 'shape' => 'AccountName', ], 'region' => [ 'shape' => 'Region', ], ], ], 'SnowflakeDestinationProperties' => [ 'type' => 'structure', 'required' => [ 'object', 'intermediateBucketName', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], 'intermediateBucketName' => [ 'shape' => 'BucketName', ], 'bucketPrefix' => [ 'shape' => 'BucketPrefix', ], 'errorHandlingConfig' => [ 'shape' => 'ErrorHandlingConfig', ], ], ], 'SnowflakeMetadata' => [ 'type' => 'structure', 'members' => [ 'supportedRegions' => [ 'shape' => 'RegionList', ], ], ], 'SourceConnectorProperties' => [ 'type' => 'structure', 'members' => [ 'Amplitude' => [ 'shape' => 'AmplitudeSourceProperties', ], 'Datadog' => [ 'shape' => 'DatadogSourceProperties', ], 'Dynatrace' => [ 'shape' => 'DynatraceSourceProperties', ], 'GoogleAnalytics' => [ 'shape' => 'GoogleAnalyticsSourceProperties', ], 'InforNexus' => [ 'shape' => 'InforNexusSourceProperties', ], 'Marketo' => [ 'shape' => 'MarketoSourceProperties', ], 'S3' => [ 'shape' => 'S3SourceProperties', ], 'Salesforce' => [ 'shape' => 'SalesforceSourceProperties', ], 'ServiceNow' => [ 'shape' => 'ServiceNowSourceProperties', ], 'Singular' => [ 'shape' => 'SingularSourceProperties', ], 'Slack' => [ 'shape' => 'SlackSourceProperties', ], 'Trendmicro' => [ 'shape' => 'TrendmicroSourceProperties', ], 'Veeva' => [ 'shape' => 'VeevaSourceProperties', ], 'Zendesk' => [ 'shape' => 'ZendeskSourceProperties', ], 'SAPOData' => [ 'shape' => 'SAPODataSourceProperties', ], 'CustomConnector' => [ 'shape' => 'CustomConnectorSourceProperties', ], 'Pardot' => [ 'shape' => 'PardotSourceProperties', ], ], ], 'SourceFieldProperties' => [ 'type' => 'structure', 'members' => [ 'isRetrievable' => [ 'shape' => 'Boolean', ], 'isQueryable' => [ 'shape' => 'Boolean', ], 'isTimestampFieldForIncrementalQueries' => [ 'shape' => 'Boolean', ], ], ], 'SourceFields' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'SourceFlowConfig' => [ 'type' => 'structure', 'required' => [ 'connectorType', 'sourceConnectorProperties', ], 'members' => [ 'connectorType' => [ 'shape' => 'ConnectorType', ], 'apiVersion' => [ 'shape' => 'ApiVersion', ], 'connectorProfileName' => [ 'shape' => 'ConnectorProfileName', ], 'sourceConnectorProperties' => [ 'shape' => 'SourceConnectorProperties', ], 'incrementalPullConfig' => [ 'shape' => 'IncrementalPullConfig', ], ], ], 'Stage' => [ 'type' => 'string', 'max' => 512, 'pattern' => '\\\\S+', ], 'StartFlowRequest' => [ 'type' => 'structure', 'required' => [ 'flowName', ], 'members' => [ 'flowName' => [ 'shape' => 'FlowName', ], 'clientToken' => [ 'shape' => 'ClientToken', 'idempotencyToken' => true, ], ], ], 'StartFlowResponse' => [ 'type' => 'structure', 'members' => [ 'flowArn' => [ 'shape' => 'FlowArn', ], 'flowStatus' => [ 'shape' => 'FlowStatus', ], 'executionId' => [ 'shape' => 'ExecutionId', ], ], ], 'StopFlowRequest' => [ 'type' => 'structure', 'required' => [ 'flowName', ], 'members' => [ 'flowName' => [ 'shape' => 'FlowName', ], ], ], 'StopFlowResponse' => [ 'type' => 'structure', 'members' => [ 'flowArn' => [ 'shape' => 'FlowArn', ], 'flowStatus' => [ 'shape' => 'FlowStatus', ], ], ], 'String' => [ 'type' => 'string', 'max' => 2048, 'pattern' => '.*', ], 'SuccessResponseHandlingConfig' => [ 'type' => 'structure', 'members' => [ 'bucketPrefix' => [ 'shape' => 'BucketPrefix', ], 'bucketName' => [ 'shape' => 'BucketName', ], ], ], 'SupportedApiVersion' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', ], 'SupportedApiVersionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SupportedApiVersion', ], ], 'SupportedDataTransferApis' => [ 'type' => 'list', 'member' => [ 'shape' => 'DataTransferApi', ], ], 'SupportedDataTransferType' => [ 'type' => 'string', 'enum' => [ 'RECORD', 'FILE', ], ], 'SupportedDataTransferTypeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SupportedDataTransferType', ], ], 'SupportedFieldTypeDetails' => [ 'type' => 'structure', 'required' => [ 'v1', ], 'members' => [ 'v1' => [ 'shape' => 'FieldTypeDetails', ], ], ], 'SupportedOperatorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Operators', ], ], 'SupportedValueList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Value', ], ], 'SupportedWriteOperationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'WriteOperationType', ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^(?!aws:)[a-zA-Z+-=._:/]+$', ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 50, 'min' => 0, ], 'TagMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'TagKey', ], 'value' => [ 'shape' => 'TagValue', ], 'max' => 50, 'min' => 0, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tags', ], 'members' => [ 'resourceArn' => [ 'shape' => 'ARN', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'pattern' => '[\\\\s\\\\w+-=\\\\.:/@]*', ], 'Task' => [ 'type' => 'structure', 'required' => [ 'sourceFields', 'taskType', ], 'members' => [ 'sourceFields' => [ 'shape' => 'SourceFields', ], 'connectorOperator' => [ 'shape' => 'ConnectorOperator', ], 'destinationField' => [ 'shape' => 'DestinationField', ], 'taskType' => [ 'shape' => 'TaskType', ], 'taskProperties' => [ 'shape' => 'TaskPropertiesMap', ], ], ], 'TaskPropertiesMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'OperatorPropertiesKeys', ], 'value' => [ 'shape' => 'Property', ], ], 'TaskType' => [ 'type' => 'string', 'enum' => [ 'Arithmetic', 'Filter', 'Map', 'Map_all', 'Mask', 'Merge', 'Passthrough', 'Truncate', 'Validate', 'Partition', ], ], 'Tasks' => [ 'type' => 'list', 'member' => [ 'shape' => 'Task', ], ], 'ThrottlingException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], 'Timezone' => [ 'type' => 'string', 'max' => 256, 'pattern' => '.*', ], 'TokenUrl' => [ 'type' => 'string', 'max' => 256, 'pattern' => '^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]', ], 'TokenUrlCustomProperties' => [ 'type' => 'map', 'key' => [ 'shape' => 'CustomPropertyKey', ], 'value' => [ 'shape' => 'CustomPropertyValue', ], 'max' => 50, 'min' => 0, ], 'TokenUrlList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TokenUrl', ], ], 'TrendmicroConnectorOperator' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'EQUAL_TO', 'ADDITION', 'MULTIPLICATION', 'DIVISION', 'SUBTRACTION', 'MASK_ALL', 'MASK_FIRST_N', 'MASK_LAST_N', 'VALIDATE_NON_NULL', 'VALIDATE_NON_ZERO', 'VALIDATE_NON_NEGATIVE', 'VALIDATE_NUMERIC', 'NO_OP', ], ], 'TrendmicroConnectorProfileCredentials' => [ 'type' => 'structure', 'required' => [ 'apiSecretKey', ], 'members' => [ 'apiSecretKey' => [ 'shape' => 'ApiSecretKey', ], ], ], 'TrendmicroConnectorProfileProperties' => [ 'type' => 'structure', 'members' => [], ], 'TrendmicroMetadata' => [ 'type' => 'structure', 'members' => [], ], 'TrendmicroSourceProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], ], ], 'TriggerConfig' => [ 'type' => 'structure', 'required' => [ 'triggerType', ], 'members' => [ 'triggerType' => [ 'shape' => 'TriggerType', ], 'triggerProperties' => [ 'shape' => 'TriggerProperties', ], ], ], 'TriggerProperties' => [ 'type' => 'structure', 'members' => [ 'Scheduled' => [ 'shape' => 'ScheduledTriggerProperties', ], ], ], 'TriggerType' => [ 'type' => 'string', 'enum' => [ 'Scheduled', 'Event', 'OnDemand', ], ], 'TriggerTypeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TriggerType', ], ], 'UnregisterConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'connectorLabel', ], 'members' => [ 'connectorLabel' => [ 'shape' => 'ConnectorLabel', ], 'forceDelete' => [ 'shape' => 'Boolean', ], ], ], 'UnregisterConnectorResponse' => [ 'type' => 'structure', 'members' => [], ], 'UnsupportedOperationException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tagKeys', ], 'members' => [ 'resourceArn' => [ 'shape' => 'ARN', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tagKeys' => [ 'shape' => 'TagKeyList', 'location' => 'querystring', 'locationName' => 'tagKeys', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateConnectorProfileRequest' => [ 'type' => 'structure', 'required' => [ 'connectorProfileName', 'connectionMode', 'connectorProfileConfig', ], 'members' => [ 'connectorProfileName' => [ 'shape' => 'ConnectorProfileName', ], 'connectionMode' => [ 'shape' => 'ConnectionMode', ], 'connectorProfileConfig' => [ 'shape' => 'ConnectorProfileConfig', ], 'clientToken' => [ 'shape' => 'ClientToken', 'idempotencyToken' => true, ], ], ], 'UpdateConnectorProfileResponse' => [ 'type' => 'structure', 'members' => [ 'connectorProfileArn' => [ 'shape' => 'ConnectorProfileArn', ], ], ], 'UpdateConnectorRegistrationRequest' => [ 'type' => 'structure', 'required' => [ 'connectorLabel', ], 'members' => [ 'connectorLabel' => [ 'shape' => 'ConnectorLabel', ], 'description' => [ 'shape' => 'Description', ], 'connectorProvisioningConfig' => [ 'shape' => 'ConnectorProvisioningConfig', ], 'clientToken' => [ 'shape' => 'ClientToken', 'idempotencyToken' => true, ], ], ], 'UpdateConnectorRegistrationResponse' => [ 'type' => 'structure', 'members' => [ 'connectorArn' => [ 'shape' => 'ARN', ], ], ], 'UpdateFlowRequest' => [ 'type' => 'structure', 'required' => [ 'flowName', 'triggerConfig', 'sourceFlowConfig', 'destinationFlowConfigList', 'tasks', ], 'members' => [ 'flowName' => [ 'shape' => 'FlowName', ], 'description' => [ 'shape' => 'FlowDescription', ], 'triggerConfig' => [ 'shape' => 'TriggerConfig', ], 'sourceFlowConfig' => [ 'shape' => 'SourceFlowConfig', ], 'destinationFlowConfigList' => [ 'shape' => 'DestinationFlowConfigList', ], 'tasks' => [ 'shape' => 'Tasks', ], 'metadataCatalogConfig' => [ 'shape' => 'MetadataCatalogConfig', ], 'clientToken' => [ 'shape' => 'ClientToken', 'idempotencyToken' => true, ], ], ], 'UpdateFlowResponse' => [ 'type' => 'structure', 'members' => [ 'flowStatus' => [ 'shape' => 'FlowStatus', ], ], ], 'UpdatedBy' => [ 'type' => 'string', 'max' => 256, 'pattern' => '\\\\S+', ], 'UpsolverBucketName' => [ 'type' => 'string', 'max' => 63, 'min' => 16, 'pattern' => '^(upsolver-appflow)\\\\S*', ], 'UpsolverDestinationProperties' => [ 'type' => 'structure', 'required' => [ 'bucketName', 's3OutputFormatConfig', ], 'members' => [ 'bucketName' => [ 'shape' => 'UpsolverBucketName', ], 'bucketPrefix' => [ 'shape' => 'BucketPrefix', ], 's3OutputFormatConfig' => [ 'shape' => 'UpsolverS3OutputFormatConfig', ], ], ], 'UpsolverMetadata' => [ 'type' => 'structure', 'members' => [], ], 'UpsolverS3OutputFormatConfig' => [ 'type' => 'structure', 'required' => [ 'prefixConfig', ], 'members' => [ 'fileType' => [ 'shape' => 'FileType', ], 'prefixConfig' => [ 'shape' => 'PrefixConfig', ], 'aggregationConfig' => [ 'shape' => 'AggregationConfig', ], ], ], 'Username' => [ 'type' => 'string', 'max' => 512, 'pattern' => '\\\\S+', ], 'ValidationException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'Value' => [ 'type' => 'string', 'max' => 128, 'pattern' => '\\\\S+', ], 'VeevaConnectorOperator' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'LESS_THAN', 'GREATER_THAN', 'CONTAINS', 'BETWEEN', 'LESS_THAN_OR_EQUAL_TO', 'GREATER_THAN_OR_EQUAL_TO', 'EQUAL_TO', 'NOT_EQUAL_TO', 'ADDITION', 'MULTIPLICATION', 'DIVISION', 'SUBTRACTION', 'MASK_ALL', 'MASK_FIRST_N', 'MASK_LAST_N', 'VALIDATE_NON_NULL', 'VALIDATE_NON_ZERO', 'VALIDATE_NON_NEGATIVE', 'VALIDATE_NUMERIC', 'NO_OP', ], ], 'VeevaConnectorProfileCredentials' => [ 'type' => 'structure', 'required' => [ 'username', 'password', ], 'members' => [ 'username' => [ 'shape' => 'Username', ], 'password' => [ 'shape' => 'Password', ], ], ], 'VeevaConnectorProfileProperties' => [ 'type' => 'structure', 'required' => [ 'instanceUrl', ], 'members' => [ 'instanceUrl' => [ 'shape' => 'InstanceUrl', ], ], ], 'VeevaMetadata' => [ 'type' => 'structure', 'members' => [], ], 'VeevaSourceProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], 'documentType' => [ 'shape' => 'DocumentType', ], 'includeSourceFiles' => [ 'shape' => 'Boolean', ], 'includeRenditions' => [ 'shape' => 'Boolean', ], 'includeAllVersions' => [ 'shape' => 'Boolean', ], ], ], 'Warehouse' => [ 'type' => 'string', 'max' => 512, 'pattern' => '[\\\\s\\\\w/!@#+=.-]*', ], 'WorkgroupName' => [ 'type' => 'string', 'max' => 512, 'pattern' => '\\\\S+', ], 'WriteOperationType' => [ 'type' => 'string', 'enum' => [ 'INSERT', 'UPSERT', 'UPDATE', 'DELETE', ], ], 'ZendeskConnectorOperator' => [ 'type' => 'string', 'enum' => [ 'PROJECTION', 'GREATER_THAN', 'ADDITION', 'MULTIPLICATION', 'DIVISION', 'SUBTRACTION', 'MASK_ALL', 'MASK_FIRST_N', 'MASK_LAST_N', 'VALIDATE_NON_NULL', 'VALIDATE_NON_ZERO', 'VALIDATE_NON_NEGATIVE', 'VALIDATE_NUMERIC', 'NO_OP', ], ], 'ZendeskConnectorProfileCredentials' => [ 'type' => 'structure', 'required' => [ 'clientId', 'clientSecret', ], 'members' => [ 'clientId' => [ 'shape' => 'ClientId', ], 'clientSecret' => [ 'shape' => 'ClientSecret', ], 'accessToken' => [ 'shape' => 'AccessToken', ], 'oAuthRequest' => [ 'shape' => 'ConnectorOAuthRequest', ], ], ], 'ZendeskConnectorProfileProperties' => [ 'type' => 'structure', 'required' => [ 'instanceUrl', ], 'members' => [ 'instanceUrl' => [ 'shape' => 'InstanceUrl', ], ], ], 'ZendeskDestinationProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], 'idFieldNames' => [ 'shape' => 'IdFieldNameList', ], 'errorHandlingConfig' => [ 'shape' => 'ErrorHandlingConfig', ], 'writeOperationType' => [ 'shape' => 'WriteOperationType', ], ], ], 'ZendeskMetadata' => [ 'type' => 'structure', 'members' => [ 'oAuthScopes' => [ 'shape' => 'OAuthScopeList', ], ], ], 'ZendeskSourceProperties' => [ 'type' => 'structure', 'required' => [ 'object', ], 'members' => [ 'object' => [ 'shape' => 'Object', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appflow/2020-08-23/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>Welcome to the Amazon AppFlow API reference. This guide is for developers who need detailed information about the Amazon AppFlow API operations, data types, and errors. </p> <p>Amazon AppFlow is a fully managed integration service that enables you to securely transfer data between software as a service (SaaS) applications like Salesforce, Marketo, Slack, and ServiceNow, and Amazon Web Services like Amazon S3 and Amazon Redshift. </p> <p>Use the following links to get started on the Amazon AppFlow API:</p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/appflow/1.0/APIReference/API_Operations.html\">Actions</a>: An alphabetical list of all Amazon AppFlow API operations.</p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/appflow/1.0/APIReference/API_Types.html\">Data types</a>: An alphabetical list of all Amazon AppFlow data types.</p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/appflow/1.0/APIReference/CommonParameters.html\">Common parameters</a>: Parameters that all Query operations can use.</p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/appflow/1.0/APIReference/CommonErrors.html\">Common errors</a>: Client and server errors that all operations can return.</p> </li> </ul> <p>If you\\'re new to Amazon AppFlow, we recommend that you review the <a href=\"https://docs.aws.amazon.com/appflow/latest/userguide/what-is-appflow.html\">Amazon AppFlow User Guide</a>.</p> <p>Amazon AppFlow API users can use vendor-specific mechanisms for OAuth, and include applicable OAuth attributes (such as <code>auth-code</code> and <code>redirecturi</code>) with the connector-specific <code>ConnectorProfileProperties</code> when creating a new connector profile using Amazon AppFlow API operations. For example, Salesforce users can refer to the <a href=\"https://help.salesforce.com/articleView?id=remoteaccess_authenticate.htm\"> <i>Authorize Apps with OAuth</i> </a> documentation.</p>', 'operations' => [ 'CancelFlowExecutions' => '<p>Cancels active runs for a flow.</p> <p>You can cancel all of the active runs for a flow, or you can cancel specific runs by providing their IDs.</p> <p>You can cancel a flow run only when the run is in progress. You can\\'t cancel a run that has already completed or failed. You also can\\'t cancel a run that\\'s scheduled to occur but hasn\\'t started yet. To prevent a scheduled run, you can deactivate the flow with the <code>StopFlow</code> action.</p> <p>You cannot resume a run after you cancel it.</p> <p>When you send your request, the status for each run becomes <code>CancelStarted</code>. When the cancellation completes, the status becomes <code>Canceled</code>.</p> <note> <p>When you cancel a run, you still incur charges for any data that the run already processed before the cancellation. If the run had already written some data to the flow destination, then that data remains in the destination. If you configured the flow to use a batch API (such as the Salesforce Bulk API 2.0), then the run will finish reading or writing its entire batch of data after the cancellation. For these operations, the data processing charges for Amazon AppFlow apply. For the pricing information, see <a href=\"http://aws.amazon.com/appflow/pricing/\">Amazon AppFlow pricing</a>.</p> </note>', 'CreateConnectorProfile' => '<p> Creates a new connector profile associated with your Amazon Web Services account. There is a soft quota of 100 connector profiles per Amazon Web Services account. If you need more connector profiles than this quota allows, you can submit a request to the Amazon AppFlow team through the Amazon AppFlow support channel. In each connector profile that you create, you can provide the credentials and properties for only one connector.</p>', 'CreateFlow' => '<p> Enables your application to create a new flow using Amazon AppFlow. You must create a connector profile before calling this API. Please note that the Request Syntax below shows syntax for multiple destinations, however, you can only transfer data to one item in this list at a time. Amazon AppFlow does not currently support flows to multiple destinations at once. </p>', 'DeleteConnectorProfile' => '<p> Enables you to delete an existing connector profile. </p>', 'DeleteFlow' => '<p> Enables your application to delete an existing flow. Before deleting the flow, Amazon AppFlow validates the request by checking the flow configuration and status. You can delete flows one at a time. </p>', 'DescribeConnector' => '<p>Describes the given custom connector registered in your Amazon Web Services account. This API can be used for custom connectors that are registered in your account and also for Amazon authored connectors.</p>', 'DescribeConnectorEntity' => '<p> Provides details regarding the entity used with the connector, with a description of the data model for each field in that entity. </p>', 'DescribeConnectorProfiles' => '<p> Returns a list of <code>connector-profile</code> details matching the provided <code>connector-profile</code> names and <code>connector-types</code>. Both input lists are optional, and you can use them to filter the result. </p> <p>If no names or <code>connector-types</code> are provided, returns all connector profiles in a paginated form. If there is no match, this operation returns an empty list.</p>', 'DescribeConnectors' => '<p> Describes the connectors vended by Amazon AppFlow for specified connector types. If you don\\'t specify a connector type, this operation describes all connectors vended by Amazon AppFlow. If there are more connectors than can be returned in one page, the response contains a <code>nextToken</code> object, which can be be passed in to the next call to the <code>DescribeConnectors</code> API operation to retrieve the next page. </p>', 'DescribeFlow' => '<p> Provides a description of the specified flow. </p>', 'DescribeFlowExecutionRecords' => '<p> Fetches the execution history of the flow. </p>', 'ListConnectorEntities' => '<p> Returns the list of available connector entities supported by Amazon AppFlow. For example, you can query Salesforce for <i>Account</i> and <i>Opportunity</i> entities, or query ServiceNow for the <i>Incident</i> entity. </p>', 'ListConnectors' => '<p>Returns the list of all registered custom connectors in your Amazon Web Services account. This API lists only custom connectors registered in this account, not the Amazon Web Services authored connectors. </p>', 'ListFlows' => '<p> Lists all of the flows associated with your account. </p>', 'ListTagsForResource' => '<p> Retrieves the tags that are associated with a specified flow. </p>', 'RegisterConnector' => '<p>Registers a new custom connector with your Amazon Web Services account. Before you can register the connector, you must deploy the associated AWS lambda function in your account.</p>', 'ResetConnectorMetadataCache' => '<p>Resets metadata about your connector entities that Amazon AppFlow stored in its cache. Use this action when you want Amazon AppFlow to return the latest information about the data that you have in a source application.</p> <p>Amazon AppFlow returns metadata about your entities when you use the ListConnectorEntities or DescribeConnectorEntities actions. Following these actions, Amazon AppFlow caches the metadata to reduce the number of API requests that it must send to the source application. Amazon AppFlow automatically resets the cache once every hour, but you can use this action when you want to get the latest metadata right away.</p>', 'StartFlow' => '<p> Activates an existing flow. For on-demand flows, this operation runs the flow immediately. For schedule and event-triggered flows, this operation activates the flow. </p>', 'StopFlow' => '<p> Deactivates the existing flow. For on-demand flows, this operation returns an <code>unsupportedOperationException</code> error message. For schedule and event-triggered flows, this operation deactivates the flow. </p>', 'TagResource' => '<p> Applies a tag to the specified flow. </p>', 'UnregisterConnector' => '<p>Unregisters the custom connector registered in your account that matches the connector label provided in the request.</p>', 'UntagResource' => '<p> Removes a tag from the specified flow. </p>', 'UpdateConnectorProfile' => '<p> Updates a given connector profile associated with your account. </p>', 'UpdateConnectorRegistration' => '<p>Updates a custom connector that you\\'ve previously registered. This operation updates the connector with one of the following:</p> <ul> <li> <p>The latest version of the AWS Lambda function that\\'s assigned to the connector</p> </li> <li> <p>A new AWS Lambda function that you specify</p> </li> </ul>', 'UpdateFlow' => '<p> Updates an existing flow. </p>', ], 'shapes' => [ 'ARN' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$connectorArn' => '<p>The Amazon Resource Name (ARN) for the registered connector.</p>', 'ConnectorProfile$credentialsArn' => '<p> The Amazon Resource Name (ARN) of the connector profile credentials. </p>', 'LambdaConnectorProvisioningConfig$lambdaArn' => '<p>Lambda ARN of the connector being registered.</p>', 'ListTagsForResourceRequest$resourceArn' => '<p> The Amazon Resource Name (ARN) of the specified flow. </p>', 'RegisterConnectorResponse$connectorArn' => '<p>The ARN of the connector being registered.</p>', 'TagResourceRequest$resourceArn' => '<p> The Amazon Resource Name (ARN) of the flow that you want to tag. </p>', 'UntagResourceRequest$resourceArn' => '<p> The Amazon Resource Name (ARN) of the flow that you want to untag. </p>', 'UpdateConnectorRegistrationResponse$connectorArn' => '<p>The ARN of the connector being updated.</p>', ], ], 'AccessDeniedException' => [ 'base' => '<p>AppFlow/Requester has invalid or missing permissions.</p>', 'refs' => [], ], 'AccessKeyId' => [ 'base' => NULL, 'refs' => [ 'InforNexusConnectorProfileCredentials$accessKeyId' => '<p> The Access Key portion of the credentials. </p>', ], ], 'AccessToken' => [ 'base' => NULL, 'refs' => [ 'GoogleAnalyticsConnectorProfileCredentials$accessToken' => '<p> The credentials used to access protected Google Analytics resources. </p>', 'HoneycodeConnectorProfileCredentials$accessToken' => '<p> The credentials used to access protected Amazon Honeycode resources. </p>', 'MarketoConnectorProfileCredentials$accessToken' => '<p> The credentials used to access protected Marketo resources. </p>', 'OAuth2Credentials$accessToken' => '<p>The access token used to access the connector on your behalf.</p>', 'OAuthCredentials$accessToken' => '<p> The access token used to access protected SAPOData resources. </p>', 'PardotConnectorProfileCredentials$accessToken' => '<p>The credentials used to access protected Salesforce Pardot resources.</p>', 'SalesforceConnectorProfileCredentials$accessToken' => '<p> The credentials used to access protected Salesforce resources. </p>', 'SlackConnectorProfileCredentials$accessToken' => '<p> The credentials used to access protected Slack resources. </p>', 'ZendeskConnectorProfileCredentials$accessToken' => '<p> The credentials used to access protected Zendesk resources. </p>', ], ], 'AccountName' => [ 'base' => NULL, 'refs' => [ 'SnowflakeConnectorProfileProperties$accountName' => '<p> The name of the account. </p>', ], ], 'AggregationConfig' => [ 'base' => '<p> The aggregation settings that you can use to customize the output format of your flow data. </p>', 'refs' => [ 'S3OutputFormatConfig$aggregationConfig' => NULL, 'UpsolverS3OutputFormatConfig$aggregationConfig' => NULL, ], ], 'AggregationType' => [ 'base' => NULL, 'refs' => [ 'AggregationConfig$aggregationType' => '<p> Specifies whether Amazon AppFlow aggregates the flow records into a single file, or leave them unaggregated. </p>', ], ], 'AmplitudeConnectorOperator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$Amplitude' => '<p> The operation to be performed on the provided Amplitude source fields. </p>', ], ], 'AmplitudeConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific credentials required when using Amplitude. </p>', 'refs' => [ 'ConnectorProfileCredentials$Amplitude' => '<p> The connector-specific credentials required when using Amplitude. </p>', ], ], 'AmplitudeConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties required when using Amplitude. </p>', 'refs' => [ 'ConnectorProfileProperties$Amplitude' => '<p> The connector-specific properties required by Amplitude. </p>', ], ], 'AmplitudeMetadata' => [ 'base' => '<p> The connector metadata specific to Amplitude. </p>', 'refs' => [ 'ConnectorMetadata$Amplitude' => '<p> The connector metadata specific to Amplitude. </p>', ], ], 'AmplitudeSourceProperties' => [ 'base' => '<p> The properties that are applied when Amplitude is being used as a source. </p>', 'refs' => [ 'SourceConnectorProperties$Amplitude' => '<p> Specifies the information that is required for querying Amplitude. </p>', ], ], 'ApiKey' => [ 'base' => NULL, 'refs' => [ 'AmplitudeConnectorProfileCredentials$apiKey' => '<p> A unique alphanumeric identifier used to authenticate a user, developer, or calling program to your API. </p>', 'ApiKeyCredentials$apiKey' => '<p>The API key required for API key authentication.</p>', 'DatadogConnectorProfileCredentials$apiKey' => '<p> A unique alphanumeric identifier used to authenticate a user, developer, or calling program to your API. </p>', 'SingularConnectorProfileCredentials$apiKey' => '<p> A unique alphanumeric identifier used to authenticate a user, developer, or calling program to your API. </p>', ], ], 'ApiKeyCredentials' => [ 'base' => '<p>The API key credentials required for API key authentication.</p>', 'refs' => [ 'CustomConnectorProfileCredentials$apiKey' => '<p>The API keys required for the authentication of the user.</p>', ], ], 'ApiSecretKey' => [ 'base' => NULL, 'refs' => [ 'ApiKeyCredentials$apiSecretKey' => '<p>The API secret key required for API key authentication.</p>', 'TrendmicroConnectorProfileCredentials$apiSecretKey' => '<p> The Secret Access Key portion of the credentials. </p>', ], ], 'ApiToken' => [ 'base' => NULL, 'refs' => [ 'DynatraceConnectorProfileCredentials$apiToken' => '<p> The API tokens used by Dynatrace API to authenticate various API calls. </p>', ], ], 'ApiVersion' => [ 'base' => NULL, 'refs' => [ 'DescribeConnectorEntityRequest$apiVersion' => '<p>The version of the API that\\'s used by the connector.</p>', 'DestinationFlowConfig$apiVersion' => '<p>The API version that the destination connector uses.</p>', 'ListConnectorEntitiesRequest$apiVersion' => '<p>The version of the API that\\'s used by the connector.</p>', 'ResetConnectorMetadataCacheRequest$apiVersion' => '<p>The API version that you specified in the connector profile that you\u00e2\u20ac\u2122re resetting cached metadata for. You must use this parameter only if the connector supports multiple API versions or if the connector type is CustomConnector.</p> <p>To look up how many versions a connector supports, use the DescribeConnectors action. In the response, find the value that Amazon AppFlow returns for the connectorVersion parameter.</p> <p>To look up the connector type, use the DescribeConnectorProfiles action. In the response, find the value that Amazon AppFlow returns for the connectorType parameter.</p> <p>To look up the API version that you specified in a connector profile, use the DescribeConnectorProfiles action.</p>', 'SourceFlowConfig$apiVersion' => '<p>The API version of the connector when it\\'s used as a source in the flow.</p>', ], ], 'ApplicationHostUrl' => [ 'base' => NULL, 'refs' => [ 'SAPODataConnectorProfileProperties$applicationHostUrl' => '<p> The location of the SAPOData resource. </p>', ], ], 'ApplicationKey' => [ 'base' => NULL, 'refs' => [ 'DatadogConnectorProfileCredentials$applicationKey' => '<p> Application keys, in conjunction with your API key, give you full access to Datadog\u00e2\u20ac\u2122s programmatic API. Application keys are associated with the user account that created them. The application key is used to log all requests made to the API. </p>', ], ], 'ApplicationServicePath' => [ 'base' => NULL, 'refs' => [ 'SAPODataConnectorProfileProperties$applicationServicePath' => '<p> The application path to catalog service. </p>', ], ], 'ApplicationType' => [ 'base' => NULL, 'refs' => [ 'ConnectorDetail$applicationType' => '<p>The application type of the connector.</p>', ], ], 'AuthCode' => [ 'base' => NULL, 'refs' => [ 'ConnectorOAuthRequest$authCode' => '<p> The code provided by the connector when it has been authenticated via the connected app. </p>', ], ], 'AuthCodeUrl' => [ 'base' => NULL, 'refs' => [ 'AuthCodeUrlList$member' => NULL, 'OAuthProperties$authCodeUrl' => '<p> The authorization code url required to redirect to SAP Login Page to fetch authorization code for OAuth type authentication. </p>', ], ], 'AuthCodeUrlList' => [ 'base' => NULL, 'refs' => [ 'OAuth2Defaults$authCodeUrls' => '<p>Auth code URLs that can be used for OAuth 2.0 authentication.</p>', ], ], 'AuthParameter' => [ 'base' => '<p>Information about required authentication parameters.</p>', 'refs' => [ 'AuthParameterList$member' => NULL, ], ], 'AuthParameterList' => [ 'base' => NULL, 'refs' => [ 'CustomAuthConfig$authParameters' => '<p>Information about authentication parameters required for authentication.</p>', ], ], 'AuthenticationConfig' => [ 'base' => '<p>Contains information about the authentication config that the connector supports.</p>', 'refs' => [ 'ConnectorConfiguration$authenticationConfig' => '<p>The authentication config required for the connector.</p>', ], ], 'AuthenticationType' => [ 'base' => NULL, 'refs' => [ 'CustomConnectorProfileCredentials$authenticationType' => '<p>The authentication type that the custom connector uses for authenticating while creating a connector profile.</p>', ], ], 'BasicAuthCredentials' => [ 'base' => '<p> The basic auth credentials required for basic authentication. </p>', 'refs' => [ 'CustomConnectorProfileCredentials$basic' => '<p>The basic credentials that are required for the authentication of the user.</p>', 'SAPODataConnectorProfileCredentials$basicAuthCredentials' => '<p> The SAPOData basic authentication credentials. </p>', ], ], 'Boolean' => [ 'base' => NULL, 'refs' => [ 'AuthParameter$isRequired' => '<p>Indicates whether this authentication parameter is required.</p>', 'AuthParameter$isSensitiveField' => '<p>Indicates whether this authentication parameter is a sensitive field.</p>', 'AuthenticationConfig$isBasicAuthSupported' => '<p>Indicates whether basic authentication is supported by the connector.</p>', 'AuthenticationConfig$isApiKeyAuthSupported' => '<p>Indicates whether API key authentication is supported by the connector</p>', 'AuthenticationConfig$isOAuth2Supported' => '<p>Indicates whether OAuth 2.0 authentication is supported by the connector.</p>', 'AuthenticationConfig$isCustomAuthSupported' => '<p>Indicates whether custom authentication is supported by the connector</p>', 'ConnectorConfiguration$canUseAsSource' => '<p> Specifies whether the connector can be used as a source. </p>', 'ConnectorConfiguration$canUseAsDestination' => '<p> Specifies whether the connector can be used as a destination. </p>', 'ConnectorConfiguration$isPrivateLinkEnabled' => '<p> Specifies if PrivateLink is enabled for that connector. </p>', 'ConnectorConfiguration$isPrivateLinkEndpointUrlRequired' => '<p> Specifies if a PrivateLink endpoint URL is required. </p>', 'ConnectorEntity$hasNestedEntities' => '<p> Specifies whether the connector entity is a parent or a category and has more entities nested underneath it. If another call is made with <code>entitiesPath = \"the_current_entity_name_with_hasNestedEntities_true\"</code>, then it returns the nested entities underneath it. This provides a way to retrieve all supported entities in a recursive fashion. </p>', 'ConnectorEntityField$isPrimaryKey' => '<p>Booelan value that indicates whether this field can be used as a primary key.</p>', 'ConnectorEntityField$isDeprecated' => '<p>Booelan value that indicates whether this field is deprecated or not.</p>', 'ConnectorRuntimeSetting$isRequired' => '<p>Indicates whether this connector runtime setting is required.</p>', 'DeleteConnectorProfileRequest$forceDelete' => '<p> Indicates whether Amazon AppFlow should delete the profile, even if it is currently in use in one or more flows. </p>', 'DeleteFlowRequest$forceDelete' => '<p> Indicates whether Amazon AppFlow should delete the flow, even if it is currently in use. </p>', 'DestinationFieldProperties$isCreatable' => '<p> Specifies if the destination field can be created by the current user. </p>', 'DestinationFieldProperties$isNullable' => '<p> Specifies if the destination field can have a null value. </p>', 'DestinationFieldProperties$isUpsertable' => '<p> Specifies if the flow run can either insert new rows in the destination field if they do not already exist, or update them if they do. </p>', 'DestinationFieldProperties$isUpdatable' => '<p> Specifies whether the field can be updated during an <code>UPDATE</code> or <code>UPSERT</code> write operation. </p>', 'DestinationFieldProperties$isDefaultedOnCreate' => '<p>Specifies whether the field can use the default value during a Create operation.</p>', 'ErrorHandlingConfig$failOnFirstDestinationError' => '<p> Specifies if the flow should fail after the first instance of a failure when attempting to place data in the destination. </p>', 'OAuth2CustomParameter$isRequired' => '<p>Indicates whether the custom parameter for OAuth 2.0 authentication is required.</p>', 'OAuth2CustomParameter$isSensitiveField' => '<p>Indicates whether this authentication custom parameter is a sensitive field.</p>', 'PardotConnectorProfileProperties$isSandboxEnvironment' => '<p>Indicates whether the connector profile applies to a sandbox or production environment.</p>', 'RedshiftConnectorProfileProperties$isRedshiftServerless' => '<p>Indicates whether the connector profile defines a connection to an Amazon Redshift Serverless data warehouse.</p>', 'SAPODataConnectorProfileProperties$disableSSO' => '<p>If you set this parameter to <code>true</code>, Amazon AppFlow bypasses the single sign-on (SSO) settings in your SAP account when it accesses your SAP OData instance.</p> <p>Whether you need this option depends on the types of credentials that you applied to your SAP OData connection profile. If your profile uses basic authentication credentials, SAP SSO can prevent Amazon AppFlow from connecting to your account with your username and password. In this case, bypassing SSO makes it possible for Amazon AppFlow to connect successfully. However, if your profile uses OAuth credentials, this parameter has no affect.</p>', 'SalesforceConnectorProfileProperties$isSandboxEnvironment' => '<p> Indicates whether the connector profile applies to a sandbox or production environment. </p>', 'SalesforceConnectorProfileProperties$usePrivateLinkForMetadataAndAuthorization' => '<p>If the connection mode for the connector profile is private, this parameter sets whether Amazon AppFlow uses the private network to send metadata and authorization calls to Salesforce. Amazon AppFlow sends private calls through Amazon Web Services PrivateLink. These calls travel through Amazon Web Services infrastructure without being exposed to the public internet.</p> <p>Set either of the following values:</p> <dl> <dt>true</dt> <dd> <p>Amazon AppFlow sends all calls to Salesforce over the private network.</p> <p>These private calls are:</p> <ul> <li> <p>Calls to get metadata about your Salesforce records. This metadata describes your Salesforce objects and their fields.</p> </li> <li> <p>Calls to get or refresh access tokens that allow Amazon AppFlow to access your Salesforce records.</p> </li> <li> <p>Calls to transfer your Salesforce records as part of a flow run.</p> </li> </ul> </dd> <dt>false</dt> <dd> <p>The default value. Amazon AppFlow sends some calls to Salesforce privately and other calls over the public internet.</p> <p>The public calls are: </p> <ul> <li> <p>Calls to get metadata about your Salesforce records.</p> </li> <li> <p>Calls to get or refresh access tokens.</p> </li> </ul> <p>The private calls are:</p> <ul> <li> <p>Calls to transfer your Salesforce records as part of a flow run.</p> </li> </ul> </dd> </dl>', 'SalesforceSourceProperties$enableDynamicFieldUpdate' => '<p> The flag that enables dynamic fetching of new (recently added) fields in the Salesforce objects while running a flow. </p>', 'SalesforceSourceProperties$includeDeletedRecords' => '<p> Indicates whether Amazon AppFlow includes deleted files in the flow run. </p>', 'SourceFieldProperties$isRetrievable' => '<p> Indicates whether the field can be returned in a search result. </p>', 'SourceFieldProperties$isQueryable' => '<p> Indicates if the field can be queried. </p>', 'SourceFieldProperties$isTimestampFieldForIncrementalQueries' => '<p>Indicates if this timestamp field can be used for incremental queries.</p>', 'UnregisterConnectorRequest$forceDelete' => '<p>Indicates whether Amazon AppFlow should unregister the connector, even if it is currently in use in one or more connector profiles. The default value is false.</p>', 'VeevaSourceProperties$includeSourceFiles' => '<p>Boolean value to include source files in Veeva document extract flow.</p>', 'VeevaSourceProperties$includeRenditions' => '<p>Boolean value to include file renditions in Veeva document extract flow.</p>', 'VeevaSourceProperties$includeAllVersions' => '<p>Boolean value to include All Versions of files in Veeva document extract flow.</p>', ], ], 'BucketName' => [ 'base' => NULL, 'refs' => [ 'ErrorHandlingConfig$bucketName' => '<p> Specifies the name of the Amazon S3 bucket. </p>', 'RedshiftConnectorProfileProperties$bucketName' => '<p> A name for the associated Amazon S3 bucket. </p>', 'RedshiftDestinationProperties$intermediateBucketName' => '<p> The intermediate bucket that Amazon AppFlow uses when moving data into Amazon Redshift. </p>', 'S3DestinationProperties$bucketName' => '<p> The Amazon S3 bucket name in which Amazon AppFlow places the transferred data. </p>', 'S3SourceProperties$bucketName' => '<p> The Amazon S3 bucket name where the source files are stored. </p>', 'SnowflakeConnectorProfileProperties$bucketName' => '<p> The name of the Amazon S3 bucket associated with Snowflake. </p>', 'SnowflakeDestinationProperties$intermediateBucketName' => '<p> The intermediate bucket that Amazon AppFlow uses when moving data into Snowflake. </p>', 'SuccessResponseHandlingConfig$bucketName' => '<p>The name of the Amazon S3 bucket.</p>', ], ], 'BucketPrefix' => [ 'base' => NULL, 'refs' => [ 'ErrorHandlingConfig$bucketPrefix' => '<p> Specifies the Amazon S3 bucket prefix. </p>', 'RedshiftConnectorProfileProperties$bucketPrefix' => '<p> The object key for the destination bucket in which Amazon AppFlow places the files. </p>', 'RedshiftDestinationProperties$bucketPrefix' => '<p> The object key for the bucket in which Amazon AppFlow places the destination files. </p>', 'S3DestinationProperties$bucketPrefix' => '<p> The object key for the destination bucket in which Amazon AppFlow places the files. </p>', 'S3SourceProperties$bucketPrefix' => '<p> The object key for the Amazon S3 bucket in which the source files are stored. </p>', 'SnowflakeConnectorProfileProperties$bucketPrefix' => '<p> The bucket path that refers to the Amazon S3 bucket associated with Snowflake. </p>', 'SnowflakeDestinationProperties$bucketPrefix' => '<p> The object key for the destination bucket in which Amazon AppFlow places the files. </p>', 'SuccessResponseHandlingConfig$bucketPrefix' => '<p>The Amazon S3 bucket prefix.</p>', 'UpsolverDestinationProperties$bucketPrefix' => '<p> The object key for the destination Upsolver Amazon S3 bucket in which Amazon AppFlow places the files. </p>', ], ], 'BusinessUnitId' => [ 'base' => NULL, 'refs' => [ 'PardotConnectorProfileProperties$businessUnitId' => '<p>The business unit id of Salesforce Pardot instance.</p>', ], ], 'CancelFlowExecutionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'CancelFlowExecutionsResponse' => [ 'base' => NULL, 'refs' => [], ], 'CatalogType' => [ 'base' => NULL, 'refs' => [ 'MetadataCatalogDetail$catalogType' => '<p>The type of metadata catalog that Amazon AppFlow used for the associated flow run. This parameter returns the following value:</p> <dl> <dt>GLUE</dt> <dd> <p>The metadata catalog is provided by the Glue Data Catalog. Glue includes the Glue Data Catalog as a component.</p> </dd> </dl>', ], ], 'ClientCredentialsArn' => [ 'base' => NULL, 'refs' => [ 'PardotConnectorProfileCredentials$clientCredentialsArn' => '<p>The secret manager ARN, which contains the client ID and client secret of the connected app.</p>', 'SalesforceConnectorProfileCredentials$clientCredentialsArn' => '<p> The secret manager ARN, which contains the client ID and client secret of the connected app. </p>', ], ], 'ClientId' => [ 'base' => NULL, 'refs' => [ 'GoogleAnalyticsConnectorProfileCredentials$clientId' => '<p> The identifier for the desired client. </p>', 'MarketoConnectorProfileCredentials$clientId' => '<p> The identifier for the desired client. </p>', 'OAuth2Credentials$clientId' => '<p>The identifier for the desired client.</p>', 'OAuthCredentials$clientId' => '<p> The identifier for the desired client. </p>', 'SlackConnectorProfileCredentials$clientId' => '<p> The identifier for the client. </p>', 'ZendeskConnectorProfileCredentials$clientId' => '<p> The identifier for the desired client. </p>', ], ], 'ClientNumber' => [ 'base' => NULL, 'refs' => [ 'SAPODataConnectorProfileProperties$clientNumber' => '<p> The client number for the client creating the connection. </p>', ], ], 'ClientSecret' => [ 'base' => NULL, 'refs' => [ 'GoogleAnalyticsConnectorProfileCredentials$clientSecret' => '<p> The client secret used by the OAuth client to authenticate to the authorization server. </p>', 'MarketoConnectorProfileCredentials$clientSecret' => '<p> The client secret used by the OAuth client to authenticate to the authorization server. </p>', 'OAuth2Credentials$clientSecret' => '<p>The client secret used by the OAuth client to authenticate to the authorization server.</p>', 'OAuthCredentials$clientSecret' => '<p> The client secret used by the OAuth client to authenticate to the authorization server. </p>', 'SlackConnectorProfileCredentials$clientSecret' => '<p> The client secret used by the OAuth client to authenticate to the authorization server. </p>', 'ZendeskConnectorProfileCredentials$clientSecret' => '<p> The client secret used by the OAuth client to authenticate to the authorization server. </p>', ], ], 'ClientToken' => [ 'base' => NULL, 'refs' => [ 'CreateConnectorProfileRequest$clientToken' => '<p>The <code>clientToken</code> parameter is an idempotency token. It ensures that your <code>CreateConnectorProfile</code> request completes only once. You choose the value to pass. For example, if you don\\'t receive a response from your request, you can safely retry the request with the same <code>clientToken</code> parameter value.</p> <p>If you omit a <code>clientToken</code> value, the Amazon Web Services SDK that you are using inserts a value for you. This way, the SDK can safely retry requests multiple times after a network error. You must provide your own value for other use cases.</p> <p>If you specify input parameters that differ from your first request, an error occurs. If you use a different value for <code>clientToken</code>, Amazon AppFlow considers it a new call to <code>CreateConnectorProfile</code>. The token is active for 8 hours.</p>', 'CreateFlowRequest$clientToken' => '<p>The <code>clientToken</code> parameter is an idempotency token. It ensures that your <code>CreateFlow</code> request completes only once. You choose the value to pass. For example, if you don\\'t receive a response from your request, you can safely retry the request with the same <code>clientToken</code> parameter value.</p> <p>If you omit a <code>clientToken</code> value, the Amazon Web Services SDK that you are using inserts a value for you. This way, the SDK can safely retry requests multiple times after a network error. You must provide your own value for other use cases.</p> <p>If you specify input parameters that differ from your first request, an error occurs. If you use a different value for <code>clientToken</code>, Amazon AppFlow considers it a new call to <code>CreateFlow</code>. The token is active for 8 hours.</p>', 'RegisterConnectorRequest$clientToken' => '<p>The <code>clientToken</code> parameter is an idempotency token. It ensures that your <code>RegisterConnector</code> request completes only once. You choose the value to pass. For example, if you don\\'t receive a response from your request, you can safely retry the request with the same <code>clientToken</code> parameter value.</p> <p>If you omit a <code>clientToken</code> value, the Amazon Web Services SDK that you are using inserts a value for you. This way, the SDK can safely retry requests multiple times after a network error. You must provide your own value for other use cases.</p> <p>If you specify input parameters that differ from your first request, an error occurs. If you use a different value for <code>clientToken</code>, Amazon AppFlow considers it a new call to <code>RegisterConnector</code>. The token is active for 8 hours.</p>', 'StartFlowRequest$clientToken' => '<p>The <code>clientToken</code> parameter is an idempotency token. It ensures that your <code>StartFlow</code> request completes only once. You choose the value to pass. For example, if you don\\'t receive a response from your request, you can safely retry the request with the same <code>clientToken</code> parameter value.</p> <p>If you omit a <code>clientToken</code> value, the Amazon Web Services SDK that you are using inserts a value for you. This way, the SDK can safely retry requests multiple times after a network error. You must provide your own value for other use cases.</p> <p>If you specify input parameters that differ from your first request, an error occurs for flows that run on a schedule or based on an event. However, the error doesn\\'t occur for flows that run on demand. You set the conditions that initiate your flow for the <code>triggerConfig</code> parameter.</p> <p>If you use a different value for <code>clientToken</code>, Amazon AppFlow considers it a new call to <code>StartFlow</code>. The token is active for 8 hours.</p>', 'UpdateConnectorProfileRequest$clientToken' => '<p>The <code>clientToken</code> parameter is an idempotency token. It ensures that your <code>UpdateConnectorProfile</code> request completes only once. You choose the value to pass. For example, if you don\\'t receive a response from your request, you can safely retry the request with the same <code>clientToken</code> parameter value.</p> <p>If you omit a <code>clientToken</code> value, the Amazon Web Services SDK that you are using inserts a value for you. This way, the SDK can safely retry requests multiple times after a network error. You must provide your own value for other use cases.</p> <p>If you specify input parameters that differ from your first request, an error occurs. If you use a different value for <code>clientToken</code>, Amazon AppFlow considers it a new call to <code>UpdateConnectorProfile</code>. The token is active for 8 hours.</p>', 'UpdateConnectorRegistrationRequest$clientToken' => '<p>The <code>clientToken</code> parameter is an idempotency token. It ensures that your <code>UpdateConnectorRegistration</code> request completes only once. You choose the value to pass. For example, if you don\\'t receive a response from your request, you can safely retry the request with the same <code>clientToken</code> parameter value.</p> <p>If you omit a <code>clientToken</code> value, the Amazon Web Services SDK that you are using inserts a value for you. This way, the SDK can safely retry requests multiple times after a network error. You must provide your own value for other use cases.</p> <p>If you specify input parameters that differ from your first request, an error occurs. If you use a different value for <code>clientToken</code>, Amazon AppFlow considers it a new call to <code>UpdateConnectorRegistration</code>. The token is active for 8 hours.</p>', 'UpdateFlowRequest$clientToken' => '<p>The <code>clientToken</code> parameter is an idempotency token. It ensures that your <code>UpdateFlow</code> request completes only once. You choose the value to pass. For example, if you don\\'t receive a response from your request, you can safely retry the request with the same <code>clientToken</code> parameter value.</p> <p>If you omit a <code>clientToken</code> value, the Amazon Web Services SDK that you are using inserts a value for you. This way, the SDK can safely retry requests multiple times after a network error. You must provide your own value for other use cases.</p> <p>If you specify input parameters that differ from your first request, an error occurs. If you use a different value for <code>clientToken</code>, Amazon AppFlow considers it a new call to <code>UpdateFlow</code>. The token is active for 8 hours.</p>', ], ], 'ClusterIdentifier' => [ 'base' => NULL, 'refs' => [ 'RedshiftConnectorProfileProperties$clusterIdentifier' => '<p>The unique ID that\\'s assigned to an Amazon Redshift cluster.</p>', ], ], 'ConflictException' => [ 'base' => '<p> There was a conflict when processing the request (for example, a flow with the given name already exists within the account. Check for conflicting resource names and try again. </p>', 'refs' => [], ], 'ConnectionMode' => [ 'base' => NULL, 'refs' => [ 'ConnectorProfile$connectionMode' => '<p> Indicates the connection mode and if it is public or private. </p>', 'CreateConnectorProfileRequest$connectionMode' => '<p> Indicates the connection mode and specifies whether it is public or private. Private flows use Amazon Web Services PrivateLink to route data over Amazon Web Services infrastructure without exposing it to the public internet. </p>', 'UpdateConnectorProfileRequest$connectionMode' => '<p> Indicates the connection mode and if it is public or private. </p>', ], ], 'ConnectorAuthenticationException' => [ 'base' => '<p> An error occurred when authenticating with the connector endpoint. </p>', 'refs' => [], ], 'ConnectorConfiguration' => [ 'base' => '<p> The configuration settings related to a given connector. </p>', 'refs' => [ 'ConnectorConfigurationsMap$value' => NULL, 'DescribeConnectorResponse$connectorConfiguration' => '<p>Configuration info of all the connectors that the user requested.</p>', ], ], 'ConnectorConfigurationsMap' => [ 'base' => NULL, 'refs' => [ 'DescribeConnectorsResponse$connectorConfigurations' => '<p> The configuration that is applied to the connectors used in the flow. </p>', ], ], 'ConnectorDescription' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$connectorDescription' => '<p>A description about the connector.</p>', 'ConnectorDetail$connectorDescription' => '<p>A description about the registered connector.</p>', ], ], 'ConnectorDetail' => [ 'base' => '<p>Information about the registered connector.</p>', 'refs' => [ 'ConnectorList$member' => NULL, ], ], 'ConnectorEntity' => [ 'base' => '<p> The high-level entity that can be queried in Amazon AppFlow. For example, a Salesforce entity might be an <i>Account</i> or <i>Opportunity</i>, whereas a ServiceNow entity might be an <i>Incident</i>. </p>', 'refs' => [ 'ConnectorEntityList$member' => NULL, ], ], 'ConnectorEntityField' => [ 'base' => '<p> Describes the data model of a connector field. For example, for an <i>account</i> entity, the fields would be <i>account name</i>, <i>account ID</i>, and so on. </p>', 'refs' => [ 'ConnectorEntityFieldList$member' => NULL, ], ], 'ConnectorEntityFieldList' => [ 'base' => NULL, 'refs' => [ 'DescribeConnectorEntityResponse$connectorEntityFields' => '<p> Describes the fields for that connector entity. For example, for an <i>account</i> entity, the fields would be <i>account name</i>, <i>account ID</i>, and so on. </p>', ], ], 'ConnectorEntityList' => [ 'base' => NULL, 'refs' => [ 'ConnectorEntityMap$value' => NULL, ], ], 'ConnectorEntityMap' => [ 'base' => NULL, 'refs' => [ 'ListConnectorEntitiesResponse$connectorEntityMap' => '<p> The response of <code>ListConnectorEntities</code> lists entities grouped by category. This map\\'s key represents the group name, and its value contains the list of entities belonging to that group. </p>', ], ], 'ConnectorLabel' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$connectorLabel' => '<p>The label used for registering the connector.</p>', 'ConnectorDetail$connectorLabel' => '<p>A label used for the connector.</p>', 'ConnectorProfile$connectorLabel' => '<p>The label for the connector profile being created.</p>', 'CreateConnectorProfileRequest$connectorLabel' => '<p>The label of the connector. The label is unique for each <code>ConnectorRegistration</code> in your Amazon Web Services account. Only needed if calling for CUSTOMCONNECTOR connector type/.</p>', 'DescribeConnectorProfilesRequest$connectorLabel' => '<p>The name of the connector. The name is unique for each <code>ConnectorRegistration</code> in your Amazon Web Services account. Only needed if calling for CUSTOMCONNECTOR connector type/.</p>', 'DescribeConnectorRequest$connectorLabel' => '<p>The label of the connector. The label is unique for each <code>ConnectorRegistration</code> in your Amazon Web Services account. Only needed if calling for CUSTOMCONNECTOR connector type/.</p>', 'FlowDefinition$sourceConnectorLabel' => '<p>The label of the source connector in the flow.</p>', 'FlowDefinition$destinationConnectorLabel' => '<p>The label of the destination connector in the flow.</p>', 'RegisterConnectorRequest$connectorLabel' => '<p> The name of the connector. The name is unique for each <code>ConnectorRegistration</code> in your Amazon Web Services account.</p>', 'UnregisterConnectorRequest$connectorLabel' => '<p>The label of the connector. The label is unique for each <code>ConnectorRegistration</code> in your Amazon Web Services account.</p>', 'UpdateConnectorRegistrationRequest$connectorLabel' => '<p>The name of the connector. The name is unique for each connector registration in your AWS account.</p>', ], ], 'ConnectorList' => [ 'base' => NULL, 'refs' => [ 'DescribeConnectorsResponse$connectors' => '<p>Information about the connectors supported in Amazon AppFlow.</p>', 'ListConnectorsResponse$connectors' => '<p>Contains information about the connectors supported by Amazon AppFlow.</p>', ], ], 'ConnectorMetadata' => [ 'base' => '<p> A structure to specify connector-specific metadata such as <code>oAuthScopes</code>, <code>supportedRegions</code>, <code>privateLinkServiceUrl</code>, and so on. </p>', 'refs' => [ 'ConnectorConfiguration$connectorMetadata' => '<p> Specifies connector-specific metadata such as <code>oAuthScopes</code>, <code>supportedRegions</code>, <code>privateLinkServiceUrl</code>, and so on. </p>', ], ], 'ConnectorMode' => [ 'base' => NULL, 'refs' => [ 'ConnectorModeList$member' => NULL, ], ], 'ConnectorModeList' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$connectorModes' => '<p>The connection modes that the connector supports.</p>', 'ConnectorDetail$connectorModes' => '<p>The connection mode that the connector supports.</p>', ], ], 'ConnectorName' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$connectorName' => '<p>The connector name.</p>', 'ConnectorDetail$connectorName' => '<p>The name of the connector.</p>', ], ], 'ConnectorOAuthRequest' => [ 'base' => '<p> Used by select connectors for which the OAuth workflow is supported, such as Salesforce, Google Analytics, Marketo, Zendesk, and Slack. </p>', 'refs' => [ 'GoogleAnalyticsConnectorProfileCredentials$oAuthRequest' => '<p> The OAuth requirement needed to request security tokens from the connector endpoint. </p>', 'HoneycodeConnectorProfileCredentials$oAuthRequest' => NULL, 'MarketoConnectorProfileCredentials$oAuthRequest' => '<p> The OAuth requirement needed to request security tokens from the connector endpoint. </p>', 'OAuth2Credentials$oAuthRequest' => NULL, 'OAuthCredentials$oAuthRequest' => '<p> The OAuth requirement needed to request security tokens from the connector endpoint. </p>', 'PardotConnectorProfileCredentials$oAuthRequest' => NULL, 'SalesforceConnectorProfileCredentials$oAuthRequest' => '<p> The OAuth requirement needed to request security tokens from the connector endpoint. </p>', 'SlackConnectorProfileCredentials$oAuthRequest' => '<p> The OAuth requirement needed to request security tokens from the connector endpoint. </p>', 'ZendeskConnectorProfileCredentials$oAuthRequest' => '<p> The OAuth requirement needed to request security tokens from the connector endpoint. </p>', ], ], 'ConnectorOperator' => [ 'base' => '<p> The operation to be performed on the provided source fields. </p>', 'refs' => [ 'Task$connectorOperator' => '<p> The operation to be performed on the provided source fields. </p>', ], ], 'ConnectorOwner' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$connectorOwner' => '<p>The owner who developed the connector.</p>', 'ConnectorDetail$connectorOwner' => '<p>The owner of the connector.</p>', ], ], 'ConnectorProfile' => [ 'base' => '<p> Describes an instance of a connector. This includes the provided name, credentials ARN, connection-mode, and so on. To keep the API intuitive and extensible, the fields that are common to all types of connector profiles are explicitly specified at the top level. The rest of the connector-specific properties are available via the <code>connectorProfileProperties</code> field. </p>', 'refs' => [ 'ConnectorProfileDetailList$member' => NULL, ], ], 'ConnectorProfileArn' => [ 'base' => NULL, 'refs' => [ 'ConnectorProfile$connectorProfileArn' => '<p> The Amazon Resource Name (ARN) of the connector profile. </p>', 'CreateConnectorProfileResponse$connectorProfileArn' => '<p> The Amazon Resource Name (ARN) of the connector profile. </p>', 'UpdateConnectorProfileResponse$connectorProfileArn' => '<p> The Amazon Resource Name (ARN) of the connector profile. </p>', ], ], 'ConnectorProfileConfig' => [ 'base' => '<p> Defines the connector-specific configuration and credentials for the connector profile. </p>', 'refs' => [ 'CreateConnectorProfileRequest$connectorProfileConfig' => '<p> Defines the connector-specific configuration and credentials. </p>', 'UpdateConnectorProfileRequest$connectorProfileConfig' => '<p> Defines the connector-specific profile configuration and credentials. </p>', ], ], 'ConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific credentials required by a connector. </p>', 'refs' => [ 'ConnectorProfileConfig$connectorProfileCredentials' => '<p> The connector-specific credentials required by each connector. </p>', ], ], 'ConnectorProfileDetailList' => [ 'base' => NULL, 'refs' => [ 'DescribeConnectorProfilesResponse$connectorProfileDetails' => '<p> Returns information about the connector profiles associated with the flow. </p>', ], ], 'ConnectorProfileName' => [ 'base' => NULL, 'refs' => [ 'ConnectorProfile$connectorProfileName' => '<p> The name of the connector profile. The name is unique for each <code>ConnectorProfile</code> in the Amazon Web Services account. </p>', 'ConnectorProfileNameList$member' => NULL, 'CreateConnectorProfileRequest$connectorProfileName' => '<p> The name of the connector profile. The name is unique for each <code>ConnectorProfile</code> in your Amazon Web Services account. </p>', 'DeleteConnectorProfileRequest$connectorProfileName' => '<p> The name of the connector profile. The name is unique for each <code>ConnectorProfile</code> in your account. </p>', 'DescribeConnectorEntityRequest$connectorProfileName' => '<p> The name of the connector profile. The name is unique for each <code>ConnectorProfile</code> in the Amazon Web Services account. </p>', 'DestinationFlowConfig$connectorProfileName' => '<p> The name of the connector profile. This name must be unique for each connector profile in the Amazon Web Services account. </p>', 'ListConnectorEntitiesRequest$connectorProfileName' => '<p> The name of the connector profile. The name is unique for each <code>ConnectorProfile</code> in the Amazon Web Services account, and is used to query the downstream connector. </p>', 'ResetConnectorMetadataCacheRequest$connectorProfileName' => '<p>The name of the connector profile that you want to reset cached metadata for.</p> <p>You can omit this parameter if you\\'re resetting the cache for any of the following connectors: Amazon Connect, Amazon EventBridge, Amazon Lookout for Metrics, Amazon S3, or Upsolver. If you\\'re resetting the cache for any other connector, you must include this parameter in your request.</p>', 'SourceFlowConfig$connectorProfileName' => '<p> The name of the connector profile. This name must be unique for each connector profile in the Amazon Web Services account. </p>', 'UpdateConnectorProfileRequest$connectorProfileName' => '<p> The name of the connector profile and is unique for each <code>ConnectorProfile</code> in the Amazon Web Services account. </p>', ], ], 'ConnectorProfileNameList' => [ 'base' => NULL, 'refs' => [ 'DescribeConnectorProfilesRequest$connectorProfileNames' => '<p> The name of the connector profile. The name is unique for each <code>ConnectorProfile</code> in the Amazon Web Services account. </p>', ], ], 'ConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties required by each connector. </p>', 'refs' => [ 'ConnectorProfile$connectorProfileProperties' => '<p> The connector-specific properties of the profile configuration. </p>', 'ConnectorProfileConfig$connectorProfileProperties' => '<p> The connector-specific properties of the profile configuration. </p>', ], ], 'ConnectorProvisioningConfig' => [ 'base' => '<p>Contains information about the configuration of the connector being registered.</p>', 'refs' => [ 'ConnectorConfiguration$connectorProvisioningConfig' => '<p>The configuration required for registering the connector.</p>', 'RegisterConnectorRequest$connectorProvisioningConfig' => '<p>The provisioning type of the connector. Currently the only supported value is LAMBDA.</p>', 'UpdateConnectorRegistrationRequest$connectorProvisioningConfig' => NULL, ], ], 'ConnectorProvisioningType' => [ 'base' => '<p>The type of provisioning that the connector supports, such as Lambda.</p>', 'refs' => [ 'ConnectorConfiguration$connectorProvisioningType' => '<p>The provisioning type used to register the connector.</p>', 'ConnectorDetail$connectorProvisioningType' => '<p>The provisioning type that the connector uses.</p>', 'RegisterConnectorRequest$connectorProvisioningType' => '<p>The provisioning type of the connector. Currently the only supported value is LAMBDA. </p>', ], ], 'ConnectorRuntimeSetting' => [ 'base' => '<p>Contains information about the connector runtime settings that are required for flow execution.</p>', 'refs' => [ 'ConnectorRuntimeSettingList$member' => NULL, ], ], 'ConnectorRuntimeSettingDataType' => [ 'base' => NULL, 'refs' => [ 'ConnectorRuntimeSetting$dataType' => '<p>Data type of the connector runtime setting.</p>', ], ], 'ConnectorRuntimeSettingList' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$connectorRuntimeSettings' => '<p>The required connector runtime settings.</p>', ], ], 'ConnectorRuntimeSettingScope' => [ 'base' => NULL, 'refs' => [ 'ConnectorRuntimeSetting$scope' => '<p>Indicates the scope of the connector runtime setting.</p>', ], ], 'ConnectorServerException' => [ 'base' => '<p> An error occurred when retrieving data from the connector endpoint. </p>', 'refs' => [], ], 'ConnectorSuppliedValue' => [ 'base' => NULL, 'refs' => [ 'ConnectorSuppliedValueList$member' => NULL, 'ConnectorSuppliedValueOptionList$member' => NULL, ], ], 'ConnectorSuppliedValueList' => [ 'base' => NULL, 'refs' => [ 'AuthParameter$connectorSuppliedValues' => '<p>Contains default values for this authentication parameter that are supplied by the connector.</p>', 'OAuth2CustomParameter$connectorSuppliedValues' => '<p>Contains default values for this authentication parameter that are supplied by the connector.</p>', ], ], 'ConnectorSuppliedValueOptionList' => [ 'base' => NULL, 'refs' => [ 'ConnectorRuntimeSetting$connectorSuppliedValueOptions' => '<p>Contains default values for the connector runtime setting that are supplied by the connector.</p>', ], ], 'ConnectorType' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$connectorType' => '<p>The connector type.</p>', 'ConnectorConfigurationsMap$key' => NULL, 'ConnectorDetail$connectorType' => '<p>The connector type.</p>', 'ConnectorProfile$connectorType' => '<p> The type of connector, such as Salesforce, Amplitude, and so on. </p>', 'ConnectorTypeList$member' => NULL, 'CreateConnectorProfileRequest$connectorType' => '<p> The type of connector, such as Salesforce, Amplitude, and so on. </p>', 'DescribeConnectorEntityRequest$connectorType' => '<p> The type of connector application, such as Salesforce, Amplitude, and so on. </p>', 'DescribeConnectorProfilesRequest$connectorType' => '<p> The type of connector, such as Salesforce, Amplitude, and so on. </p>', 'DescribeConnectorRequest$connectorType' => '<p>The connector type, such as CUSTOMCONNECTOR, Saleforce, Marketo. Please choose CUSTOMCONNECTOR for Lambda based custom connectors.</p>', 'DestinationFlowConfig$connectorType' => '<p> The type of connector, such as Salesforce, Amplitude, and so on. </p>', 'FlowDefinition$sourceConnectorType' => '<p> Specifies the source connector type, such as Salesforce, Amazon S3, Amplitude, and so on. </p>', 'FlowDefinition$destinationConnectorType' => '<p> Specifies the destination connector type, such as Salesforce, Amazon S3, Amplitude, and so on. </p>', 'ListConnectorEntitiesRequest$connectorType' => '<p> The type of connector, such as Salesforce, Amplitude, and so on. </p>', 'ResetConnectorMetadataCacheRequest$connectorType' => '<p>The type of connector to reset cached metadata for.</p> <p>You must include this parameter in your request if you\\'re resetting the cache for any of the following connectors: Amazon Connect, Amazon EventBridge, Amazon Lookout for Metrics, Amazon S3, or Upsolver. If you\\'re resetting the cache for any other connector, you can omit this parameter from your request. </p>', 'SourceFlowConfig$connectorType' => '<p> The type of connector, such as Salesforce, Amplitude, and so on. </p>', ], ], 'ConnectorTypeList' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$supportedDestinationConnectors' => '<p> Lists the connectors that are available for use as destinations. </p>', 'DescribeConnectorsRequest$connectorTypes' => '<p> The type of connector, such as Salesforce, Amplitude, and so on. </p>', ], ], 'ConnectorVersion' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$connectorVersion' => '<p>The connector version.</p>', 'ConnectorDetail$connectorVersion' => '<p>The connector version.</p>', ], ], 'CreateConnectorProfileRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateConnectorProfileResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateFlowRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateFlowResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreatedBy' => [ 'base' => NULL, 'refs' => [ 'DescribeFlowResponse$createdBy' => '<p> The ARN of the user who created the flow. </p>', 'FlowDefinition$createdBy' => '<p> The ARN of the user who created the flow. </p>', ], ], 'CredentialsMap' => [ 'base' => NULL, 'refs' => [ 'CustomAuthCredentials$credentialsMap' => '<p>A map that holds custom authentication credentials.</p>', ], ], 'CredentialsMapKey' => [ 'base' => NULL, 'refs' => [ 'CredentialsMap$key' => NULL, ], ], 'CredentialsMapValue' => [ 'base' => NULL, 'refs' => [ 'CredentialsMap$value' => NULL, ], ], 'CustomAuthConfig' => [ 'base' => '<p>Configuration information required for custom authentication.</p>', 'refs' => [ 'CustomAuthConfigList$member' => NULL, ], ], 'CustomAuthConfigList' => [ 'base' => NULL, 'refs' => [ 'AuthenticationConfig$customAuthConfigs' => '<p>Contains information required for custom authentication.</p>', ], ], 'CustomAuthCredentials' => [ 'base' => '<p>The custom credentials required for custom authentication.</p>', 'refs' => [ 'CustomConnectorProfileCredentials$custom' => '<p>If the connector uses the custom authentication mechanism, this holds the required credentials.</p>', ], ], 'CustomAuthenticationType' => [ 'base' => NULL, 'refs' => [ 'CustomAuthConfig$customAuthenticationType' => '<p>The authentication type that the custom connector uses.</p>', 'CustomAuthCredentials$customAuthenticationType' => '<p>The custom authentication type that the connector uses.</p>', ], ], 'CustomConnectorDestinationProperties' => [ 'base' => '<p>The properties that are applied when the custom connector is being used as a destination.</p>', 'refs' => [ 'DestinationConnectorProperties$CustomConnector' => '<p>The properties that are required to query the custom Connector.</p>', ], ], 'CustomConnectorProfileCredentials' => [ 'base' => '<p>The connector-specific profile credentials that are required when using the custom connector.</p>', 'refs' => [ 'ConnectorProfileCredentials$CustomConnector' => NULL, ], ], 'CustomConnectorProfileProperties' => [ 'base' => '<p>The profile properties required by the custom connector.</p>', 'refs' => [ 'ConnectorProfileProperties$CustomConnector' => '<p>The properties required by the custom connector.</p>', ], ], 'CustomConnectorSourceProperties' => [ 'base' => '<p>The properties that are applied when the custom connector is being used as a source.</p>', 'refs' => [ 'SourceConnectorProperties$CustomConnector' => NULL, ], ], 'CustomProperties' => [ 'base' => NULL, 'refs' => [ 'ConnectorEntityField$customProperties' => '<p>A map that has specific properties related to the ConnectorEntityField.</p>', 'CustomConnectorDestinationProperties$customProperties' => '<p>The custom properties that are specific to the connector when it\\'s used as a destination in the flow.</p>', 'CustomConnectorSourceProperties$customProperties' => '<p>Custom properties that are required to use the custom connector as a source.</p>', ], ], 'CustomPropertyKey' => [ 'base' => NULL, 'refs' => [ 'CustomProperties$key' => NULL, 'TokenUrlCustomProperties$key' => NULL, ], ], 'CustomPropertyValue' => [ 'base' => NULL, 'refs' => [ 'CustomProperties$value' => NULL, 'TokenUrlCustomProperties$value' => NULL, ], ], 'CustomerProfilesDestinationProperties' => [ 'base' => '<p> The properties that are applied when Amazon Connect Customer Profiles is used as a destination. </p>', 'refs' => [ 'DestinationConnectorProperties$CustomerProfiles' => '<p> The properties required to query Amazon Connect Customer Profiles. </p>', ], ], 'CustomerProfilesMetadata' => [ 'base' => '<p> The connector metadata specific to Amazon Connect Customer Profiles. </p>', 'refs' => [ 'ConnectorMetadata$CustomerProfiles' => '<p> The connector metadata specific to Amazon Connect Customer Profiles. </p>', ], ], 'DataApiRoleArn' => [ 'base' => NULL, 'refs' => [ 'RedshiftConnectorProfileProperties$dataApiRoleArn' => '<p>The Amazon Resource Name (ARN) of an IAM role that permits Amazon AppFlow to access your Amazon Redshift database through the Data API. For more information, and for the polices that you attach to this role, see <a href=\"https://docs.aws.amazon.com/appflow/latest/userguide/security_iam_service-role-policies.html#access-redshift\">Allow Amazon AppFlow to access Amazon Redshift databases with the Data API</a>.</p>', ], ], 'DataPullMode' => [ 'base' => NULL, 'refs' => [ 'ScheduledTriggerProperties$dataPullMode' => '<p> Specifies whether a scheduled flow has an incremental data transfer or a complete data transfer for each flow run. </p>', ], ], 'DataTransferApi' => [ 'base' => '<p>The API of the connector application that Amazon AppFlow uses to transfer your data.</p>', 'refs' => [ 'CustomConnectorSourceProperties$dataTransferApi' => '<p>The API of the connector application that Amazon AppFlow uses to transfer your data.</p>', 'SupportedDataTransferApis$member' => NULL, ], ], 'DataTransferApiType' => [ 'base' => NULL, 'refs' => [ 'DataTransferApi$Type' => '<p>You can specify one of the following types:</p> <dl> <dt>AUTOMATIC</dt> <dd> <p>The default. Optimizes a flow for datasets that fluctuate in size from small to large. For each flow run, Amazon AppFlow chooses to use the SYNC or ASYNC API type based on the amount of data that the run transfers.</p> </dd> <dt>SYNC</dt> <dd> <p>A synchronous API. This type of API optimizes a flow for small to medium-sized datasets.</p> </dd> <dt>ASYNC</dt> <dd> <p>An asynchronous API. This type of API optimizes a flow for large datasets.</p> </dd> </dl>', ], ], 'DataTransferApiTypeName' => [ 'base' => NULL, 'refs' => [ 'DataTransferApi$Name' => '<p>The name of the connector application API.</p>', ], ], 'DatabaseName' => [ 'base' => NULL, 'refs' => [ 'RedshiftConnectorProfileProperties$databaseName' => '<p>The name of an Amazon Redshift database.</p>', ], ], 'DatabaseUrl' => [ 'base' => NULL, 'refs' => [ 'RedshiftConnectorProfileProperties$databaseUrl' => '<p> The JDBC URL of the Amazon Redshift cluster. </p>', ], ], 'DatadogConnectorOperator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$Datadog' => '<p> The operation to be performed on the provided Datadog source fields. </p>', ], ], 'DatadogConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific credentials required by Datadog. </p>', 'refs' => [ 'ConnectorProfileCredentials$Datadog' => '<p> The connector-specific credentials required when using Datadog. </p>', ], ], 'DatadogConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties required by Datadog. </p>', 'refs' => [ 'ConnectorProfileProperties$Datadog' => '<p> The connector-specific properties required by Datadog. </p>', ], ], 'DatadogMetadata' => [ 'base' => '<p> The connector metadata specific to Datadog. </p>', 'refs' => [ 'ConnectorMetadata$Datadog' => '<p> The connector metadata specific to Datadog. </p>', ], ], 'DatadogSourceProperties' => [ 'base' => '<p> The properties that are applied when Datadog is being used as a source. </p>', 'refs' => [ 'SourceConnectorProperties$Datadog' => '<p> Specifies the information that is required for querying Datadog. </p>', ], ], 'Date' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$registeredAt' => '<p>The date on which the connector was registered.</p>', 'ConnectorDetail$registeredAt' => '<p>The time at which the connector was registered.</p>', 'ConnectorProfile$createdAt' => '<p> Specifies when the connector profile was created. </p>', 'ConnectorProfile$lastUpdatedAt' => '<p> Specifies when the connector profile was last updated. </p>', 'DescribeFlowResponse$createdAt' => '<p> Specifies when the flow was created. </p>', 'DescribeFlowResponse$lastUpdatedAt' => '<p> Specifies when the flow was last updated. </p>', 'ExecutionDetails$mostRecentExecutionTime' => '<p> Specifies the time of the most recent flow run. </p>', 'ExecutionRecord$startedAt' => '<p> Specifies the start time of the flow run. </p>', 'ExecutionRecord$lastUpdatedAt' => '<p> Specifies the time of the most recent update. </p>', 'ExecutionRecord$dataPullStartTime' => '<p> The timestamp that determines the first new or updated record to be transferred in the flow run. </p>', 'ExecutionRecord$dataPullEndTime' => '<p> The timestamp that indicates the last new or updated record to be transferred in the flow run. </p>', 'FlowDefinition$createdAt' => '<p> Specifies when the flow was created. </p>', 'FlowDefinition$lastUpdatedAt' => '<p> Specifies when the flow was last updated. </p>', 'ScheduledTriggerProperties$scheduleStartTime' => '<p>The time at which the scheduled flow starts. The time is formatted as a timestamp that follows the ISO 8601 standard, such as <code>2022-04-26T13:00:00-07:00</code>.</p>', 'ScheduledTriggerProperties$scheduleEndTime' => '<p>The time at which the scheduled flow ends. The time is formatted as a timestamp that follows the ISO 8601 standard, such as <code>2022-04-27T13:00:00-07:00</code>.</p>', 'ScheduledTriggerProperties$firstExecutionFrom' => '<p> Specifies the date range for the records to import from the connector in the first flow run. </p>', ], ], 'DatetimeTypeFieldName' => [ 'base' => NULL, 'refs' => [ 'IncrementalPullConfig$datetimeTypeFieldName' => '<p> A field that specifies the date time or timestamp field as the criteria to use when importing incremental records from the source. </p>', ], ], 'DeleteConnectorProfileRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteConnectorProfileResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteFlowRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteFlowResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeConnectorEntityRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeConnectorEntityResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeConnectorProfilesRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeConnectorProfilesResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeConnectorRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeConnectorResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeConnectorsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeConnectorsResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeFlowExecutionRecordsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeFlowExecutionRecordsResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeFlowRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeFlowResponse' => [ 'base' => NULL, 'refs' => [], ], 'Description' => [ 'base' => NULL, 'refs' => [ 'AuthParameter$description' => '<p>A description about the authentication parameter.</p>', 'ConnectorEntityField$description' => '<p> A description of the connector entity field. </p>', 'ConnectorRuntimeSetting$description' => '<p>A description about the connector runtime setting.</p>', 'OAuth2CustomParameter$description' => '<p>A description about the custom parameter used for OAuth 2.0 authentication.</p>', 'RegisterConnectorRequest$description' => '<p>A description about the connector that\\'s being registered.</p>', 'UpdateConnectorRegistrationRequest$description' => '<p>A description about the update that you\\'re applying to the connector.</p>', ], ], 'DestinationConnectorProperties' => [ 'base' => '<p> This stores the information that is required to query a particular connector. </p>', 'refs' => [ 'DestinationFlowConfig$destinationConnectorProperties' => '<p> This stores the information that is required to query a particular connector. </p>', ], ], 'DestinationField' => [ 'base' => NULL, 'refs' => [ 'Task$destinationField' => '<p> A field in a destination connector, or a field value against which Amazon AppFlow validates a source field. </p>', ], ], 'DestinationFieldProperties' => [ 'base' => '<p> The properties that can be applied to a field when connector is being used as a destination. </p>', 'refs' => [ 'ConnectorEntityField$destinationProperties' => '<p> The properties applied to a field when the connector is being used as a destination. </p>', ], ], 'DestinationFlowConfig' => [ 'base' => '<p> Contains information about the configuration of destination connectors present in the flow. </p>', 'refs' => [ 'DestinationFlowConfigList$member' => NULL, ], ], 'DestinationFlowConfigList' => [ 'base' => NULL, 'refs' => [ 'CreateFlowRequest$destinationFlowConfigList' => '<p> The configuration that controls how Amazon AppFlow places data in the destination connector. </p>', 'DescribeFlowResponse$destinationFlowConfigList' => '<p> The configuration that controls how Amazon AppFlow transfers data to the destination connector. </p>', 'UpdateFlowRequest$destinationFlowConfigList' => '<p> The configuration that controls how Amazon AppFlow transfers data to the destination connector. </p>', ], ], 'DocumentType' => [ 'base' => NULL, 'refs' => [ 'VeevaSourceProperties$documentType' => '<p>The document type specified in the Veeva document extract flow.</p>', ], ], 'DomainName' => [ 'base' => NULL, 'refs' => [ 'CustomerProfilesDestinationProperties$domainName' => '<p> The unique name of the Amazon Connect Customer Profiles domain. </p>', ], ], 'Double' => [ 'base' => NULL, 'refs' => [ 'Range$maximum' => '<p>Maximum value supported by the field.</p>', 'Range$minimum' => '<p>Minimum value supported by the field.</p>', ], ], 'DynatraceConnectorOperator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$Dynatrace' => '<p> The operation to be performed on the provided Dynatrace source fields. </p>', ], ], 'DynatraceConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific profile credentials required by Dynatrace. </p>', 'refs' => [ 'ConnectorProfileCredentials$Dynatrace' => '<p> The connector-specific credentials required when using Dynatrace. </p>', ], ], 'DynatraceConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties required by Dynatrace. </p>', 'refs' => [ 'ConnectorProfileProperties$Dynatrace' => '<p> The connector-specific properties required by Dynatrace. </p>', ], ], 'DynatraceMetadata' => [ 'base' => '<p> The connector metadata specific to Dynatrace. </p>', 'refs' => [ 'ConnectorMetadata$Dynatrace' => '<p> The connector metadata specific to Dynatrace. </p>', ], ], 'DynatraceSourceProperties' => [ 'base' => '<p> The properties that are applied when Dynatrace is being used as a source. </p>', 'refs' => [ 'SourceConnectorProperties$Dynatrace' => '<p> Specifies the information that is required for querying Dynatrace. </p>', ], ], 'EntitiesPath' => [ 'base' => NULL, 'refs' => [ 'ListConnectorEntitiesRequest$entitiesPath' => '<p> This optional parameter is specific to connector implementation. Some connectors support multiple levels or categories of entities. You can find out the list of roots for such providers by sending a request without the <code>entitiesPath</code> parameter. If the connector supports entities at different roots, this initial request returns the list of roots. Otherwise, this request returns all entities supported by the provider. </p>', 'ResetConnectorMetadataCacheRequest$entitiesPath' => '<p>Use this parameter only if you\u00e2\u20ac\u2122re resetting the cached metadata about a nested entity. Only some connectors support nested entities. A nested entity is one that has another entity as a parent. To use this parameter, specify the name of the parent entity.</p> <p>To look up the parent-child relationship of entities, you can send a ListConnectorEntities request that omits the entitiesPath parameter. Amazon AppFlow will return a list of top-level entities. For each one, it indicates whether the entity has nested entities. Then, in a subsequent ListConnectorEntities request, you can specify a parent entity name for the entitiesPath parameter. Amazon AppFlow will return a list of the child entities for that parent.</p>', ], ], 'EntityName' => [ 'base' => NULL, 'refs' => [ 'CustomConnectorDestinationProperties$entityName' => '<p>The entity specified in the custom connector as a destination in the flow.</p>', 'CustomConnectorSourceProperties$entityName' => '<p>The entity specified in the custom connector as a source in the flow.</p>', 'DescribeConnectorEntityRequest$connectorEntityName' => '<p> The entity name for that connector. </p>', 'ResetConnectorMetadataCacheRequest$connectorEntityName' => '<p>Use this parameter if you want to reset cached metadata about the details for an individual entity.</p> <p>If you don\\'t include this parameter in your request, Amazon AppFlow only resets cached metadata about entity names, not entity details.</p>', ], ], 'ErrorHandlingConfig' => [ 'base' => '<p> The settings that determine how Amazon AppFlow handles an error when placing data in the destination. For example, this setting would determine if the flow should fail after one insertion error, or continue and attempt to insert every record regardless of the initial failure. <code>ErrorHandlingConfig</code> is a part of the destination connector details. </p>', 'refs' => [ 'CustomConnectorDestinationProperties$errorHandlingConfig' => '<p>The settings that determine how Amazon AppFlow handles an error when placing data in the custom connector as destination.</p>', 'EventBridgeDestinationProperties$errorHandlingConfig' => NULL, 'HoneycodeDestinationProperties$errorHandlingConfig' => NULL, 'MarketoDestinationProperties$errorHandlingConfig' => NULL, 'RedshiftDestinationProperties$errorHandlingConfig' => '<p> The settings that determine how Amazon AppFlow handles an error when placing data in the Amazon Redshift destination. For example, this setting would determine if the flow should fail after one insertion error, or continue and attempt to insert every record regardless of the initial failure. <code>ErrorHandlingConfig</code> is a part of the destination connector details. </p>', 'SAPODataDestinationProperties$errorHandlingConfig' => NULL, 'SalesforceDestinationProperties$errorHandlingConfig' => '<p> The settings that determine how Amazon AppFlow handles an error when placing data in the Salesforce destination. For example, this setting would determine if the flow should fail after one insertion error, or continue and attempt to insert every record regardless of the initial failure. <code>ErrorHandlingConfig</code> is a part of the destination connector details. </p>', 'SnowflakeDestinationProperties$errorHandlingConfig' => '<p> The settings that determine how Amazon AppFlow handles an error when placing data in the Snowflake destination. For example, this setting would determine if the flow should fail after one insertion error, or continue and attempt to insert every record regardless of the initial failure. <code>ErrorHandlingConfig</code> is a part of the destination connector details. </p>', 'ZendeskDestinationProperties$errorHandlingConfig' => NULL, ], ], 'ErrorInfo' => [ 'base' => '<p> Provides details in the event of a failed flow, including the failure count and the related error messages. </p>', 'refs' => [ 'ExecutionResult$errorInfo' => '<p> Provides any error message information related to the flow run. </p>', ], ], 'ErrorMessage' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$message' => NULL, 'ConflictException$message' => NULL, 'ConnectorAuthenticationException$message' => NULL, 'ConnectorServerException$message' => NULL, 'InternalServerException$message' => NULL, 'ResourceNotFoundException$message' => NULL, 'ServiceQuotaExceededException$message' => NULL, 'ThrottlingException$message' => NULL, 'UnsupportedOperationException$message' => NULL, 'ValidationException$message' => NULL, ], ], 'EventBridgeDestinationProperties' => [ 'base' => '<p> The properties that are applied when Amazon EventBridge is being used as a destination. </p>', 'refs' => [ 'DestinationConnectorProperties$EventBridge' => '<p> The properties required to query Amazon EventBridge. </p>', ], ], 'EventBridgeMetadata' => [ 'base' => '<p> The connector metadata specific to Amazon EventBridge. </p>', 'refs' => [ 'ConnectorMetadata$EventBridge' => '<p> The connector metadata specific to Amazon EventBridge. </p>', ], ], 'ExecutionDetails' => [ 'base' => '<p> Describes the details of the flow run, including the timestamp, status, and message. </p>', 'refs' => [ 'DescribeFlowResponse$lastRunExecutionDetails' => '<p> Describes the details of the most recent flow run. </p>', 'FlowDefinition$lastRunExecutionDetails' => '<p> Describes the details of the most recent flow run. </p>', ], ], 'ExecutionId' => [ 'base' => NULL, 'refs' => [ 'ExecutionIds$member' => NULL, 'ExecutionRecord$executionId' => '<p> Specifies the identifier of the given flow run. </p>', 'StartFlowResponse$executionId' => '<p> Returns the internal execution ID of an on-demand flow when the flow is started. For scheduled or event-triggered flows, this value is null. </p>', ], ], 'ExecutionIds' => [ 'base' => NULL, 'refs' => [ 'CancelFlowExecutionsRequest$executionIds' => '<p>The ID of each active run to cancel. These runs must belong to the flow you specify in your request.</p> <p>If you omit this parameter, your request ends all active runs that belong to the flow.</p>', 'CancelFlowExecutionsResponse$invalidExecutions' => '<p>The IDs of runs that Amazon AppFlow couldn\\'t cancel. These runs might be ineligible for canceling because they haven\\'t started yet or have already completed.</p>', ], ], 'ExecutionMessage' => [ 'base' => NULL, 'refs' => [ 'ErrorInfo$executionMessage' => '<p> Specifies the error message that appears if a flow fails. </p>', ], ], 'ExecutionRecord' => [ 'base' => '<p> Specifies information about the past flow run instances for a given flow. </p>', 'refs' => [ 'FlowExecutionList$member' => NULL, ], ], 'ExecutionResult' => [ 'base' => '<p> Specifies the end result of the flow run. </p>', 'refs' => [ 'ExecutionRecord$executionResult' => '<p> Describes the result of the given flow run. </p>', ], ], 'ExecutionStatus' => [ 'base' => NULL, 'refs' => [ 'ExecutionDetails$mostRecentExecutionStatus' => '<p> Specifies the status of the most recent flow run. </p>', 'ExecutionRecord$executionStatus' => '<p> Specifies the flow run status and whether it is in progress, has completed successfully, or has failed. </p>', 'RegistrationOutput$status' => '<p>Indicates the status of the registration attempt from Amazon AppFlow.</p>', ], ], 'FieldType' => [ 'base' => NULL, 'refs' => [ 'FieldTypeDetails$fieldType' => '<p> The type of field, such as string, integer, date, and so on. </p>', ], ], 'FieldTypeDetails' => [ 'base' => '<p> Contains details regarding the supported field type and the operators that can be applied for filtering. </p>', 'refs' => [ 'SupportedFieldTypeDetails$v1' => '<p> The initial supported version for <code>fieldType</code>. If this is later changed to a different version, v2 will be introduced. </p>', ], ], 'FileType' => [ 'base' => NULL, 'refs' => [ 'S3OutputFormatConfig$fileType' => '<p> Indicates the file type that Amazon AppFlow places in the Amazon S3 bucket. </p>', 'UpsolverS3OutputFormatConfig$fileType' => '<p> Indicates the file type that Amazon AppFlow places in the Upsolver Amazon S3 bucket. </p>', ], ], 'FilterOperatorList' => [ 'base' => NULL, 'refs' => [ 'FieldTypeDetails$filterOperators' => '<p> The list of operators supported by a field. </p>', ], ], 'FlowArn' => [ 'base' => NULL, 'refs' => [ 'CreateFlowResponse$flowArn' => '<p> The flow\\'s Amazon Resource Name (ARN). </p>', 'DescribeFlowResponse$flowArn' => '<p> The flow\\'s Amazon Resource Name (ARN). </p>', 'FlowDefinition$flowArn' => '<p> The flow\\'s Amazon Resource Name (ARN). </p>', 'StartFlowResponse$flowArn' => '<p> The flow\\'s Amazon Resource Name (ARN). </p>', 'StopFlowResponse$flowArn' => '<p> The flow\\'s Amazon Resource Name (ARN). </p>', ], ], 'FlowDefinition' => [ 'base' => '<p> The properties of the flow, such as its source, destination, trigger type, and so on. </p>', 'refs' => [ 'FlowList$member' => NULL, ], ], 'FlowDescription' => [ 'base' => NULL, 'refs' => [ 'CreateFlowRequest$description' => '<p> A description of the flow you want to create. </p>', 'DescribeFlowResponse$description' => '<p> A description of the flow. </p>', 'FlowDefinition$description' => '<p> A user-entered description of the flow. </p>', 'UpdateFlowRequest$description' => '<p> A description of the flow. </p>', ], ], 'FlowErrorDeactivationThreshold' => [ 'base' => NULL, 'refs' => [ 'ScheduledTriggerProperties$flowErrorDeactivationThreshold' => '<p>Defines how many times a scheduled flow fails consecutively before Amazon AppFlow deactivates it.</p>', ], ], 'FlowExecutionList' => [ 'base' => NULL, 'refs' => [ 'DescribeFlowExecutionRecordsResponse$flowExecutions' => '<p> Returns a list of all instances when this flow was run. </p>', ], ], 'FlowList' => [ 'base' => NULL, 'refs' => [ 'ListFlowsResponse$flows' => '<p> The list of flows associated with your account. </p>', ], ], 'FlowName' => [ 'base' => NULL, 'refs' => [ 'CancelFlowExecutionsRequest$flowName' => '<p>The name of a flow with active runs that you want to cancel.</p>', 'CreateFlowRequest$flowName' => '<p> The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. </p>', 'DeleteFlowRequest$flowName' => '<p> The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. </p>', 'DescribeFlowExecutionRecordsRequest$flowName' => '<p> The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. </p>', 'DescribeFlowRequest$flowName' => '<p> The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. </p>', 'DescribeFlowResponse$flowName' => '<p> The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. </p>', 'FlowDefinition$flowName' => '<p> The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. </p>', 'StartFlowRequest$flowName' => '<p> The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. </p>', 'StopFlowRequest$flowName' => '<p> The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. </p>', 'UpdateFlowRequest$flowName' => '<p> The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. </p>', ], ], 'FlowStatus' => [ 'base' => NULL, 'refs' => [ 'CreateFlowResponse$flowStatus' => '<p> Indicates the current status of the flow. </p>', 'DescribeFlowResponse$flowStatus' => '<p> Indicates the current status of the flow. </p>', 'FlowDefinition$flowStatus' => '<p> Indicates the current status of the flow. </p>', 'StartFlowResponse$flowStatus' => '<p> Indicates the current status of the flow. </p>', 'StopFlowResponse$flowStatus' => '<p> Indicates the current status of the flow. </p>', 'UpdateFlowResponse$flowStatus' => '<p>Indicates the current status of the flow. </p>', ], ], 'FlowStatusMessage' => [ 'base' => NULL, 'refs' => [ 'DescribeFlowResponse$flowStatusMessage' => '<p> Contains an error message if the flow status is in a suspended or error state. This applies only to scheduled or event-triggered flows. </p>', ], ], 'GlueDataCatalogConfig' => [ 'base' => '<p>Specifies the configuration that Amazon AppFlow uses when it catalogs your data with the Glue Data Catalog. When Amazon AppFlow catalogs your data, it stores metadata in Data Catalog tables. This metadata represents the data that\\'s transferred by the flow that you configure with these settings.</p> <note> <p>You can configure a flow with these settings only when the flow destination is Amazon S3.</p> </note>', 'refs' => [ 'MetadataCatalogConfig$glueDataCatalog' => '<p>Specifies the configuration that Amazon AppFlow uses when it catalogs your data with the Glue Data Catalog.</p>', ], ], 'GlueDataCatalogDatabaseName' => [ 'base' => NULL, 'refs' => [ 'GlueDataCatalogConfig$databaseName' => '<p>The name of the Data Catalog database that stores the metadata tables that Amazon AppFlow creates in your Amazon Web Services account. These tables contain metadata for the data that\\'s transferred by the flow that you configure with this parameter.</p> <note> <p>When you configure a new flow with this parameter, you must specify an existing database.</p> </note>', ], ], 'GlueDataCatalogIAMRole' => [ 'base' => NULL, 'refs' => [ 'GlueDataCatalogConfig$roleArn' => '<p>The Amazon Resource Name (ARN) of an IAM role that grants Amazon AppFlow the permissions it needs to create Data Catalog tables, databases, and partitions.</p> <p>For an example IAM policy that has the required permissions, see <a href=\"https://docs.aws.amazon.com/appflow/latest/userguide/security_iam_id-based-policy-examples.html\">Identity-based policy examples for Amazon AppFlow</a>.</p>', ], ], 'GlueDataCatalogTablePrefix' => [ 'base' => NULL, 'refs' => [ 'GlueDataCatalogConfig$tablePrefix' => '<p>A naming prefix for each Data Catalog table that Amazon AppFlow creates for the flow that you configure with this setting. Amazon AppFlow adds the prefix to the beginning of the each table name.</p>', ], ], 'GoogleAnalyticsConnectorOperator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$GoogleAnalytics' => '<p> The operation to be performed on the provided Google Analytics source fields. </p>', ], ], 'GoogleAnalyticsConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific profile credentials required by Google Analytics. </p>', 'refs' => [ 'ConnectorProfileCredentials$GoogleAnalytics' => '<p> The connector-specific credentials required when using Google Analytics. </p>', ], ], 'GoogleAnalyticsConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties required by Google Analytics. </p>', 'refs' => [ 'ConnectorProfileProperties$GoogleAnalytics' => '<p> The connector-specific properties required Google Analytics. </p>', ], ], 'GoogleAnalyticsMetadata' => [ 'base' => '<p> The connector metadata specific to Google Analytics. </p>', 'refs' => [ 'ConnectorMetadata$GoogleAnalytics' => '<p> The connector metadata specific to Google Analytics. </p>', ], ], 'GoogleAnalyticsSourceProperties' => [ 'base' => '<p> The properties that are applied when Google Analytics is being used as a source. </p>', 'refs' => [ 'SourceConnectorProperties$GoogleAnalytics' => '<p> Specifies the information that is required for querying Google Analytics. </p>', ], ], 'Group' => [ 'base' => NULL, 'refs' => [ 'ConnectorEntityMap$key' => NULL, ], ], 'HoneycodeConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific credentials required when using Amazon Honeycode. </p>', 'refs' => [ 'ConnectorProfileCredentials$Honeycode' => '<p> The connector-specific credentials required when using Amazon Honeycode. </p>', ], ], 'HoneycodeConnectorProfileProperties' => [ 'base' => '<p> The connector-specific properties required when using Amazon Honeycode. </p>', 'refs' => [ 'ConnectorProfileProperties$Honeycode' => '<p> The connector-specific properties required by Amazon Honeycode. </p>', ], ], 'HoneycodeDestinationProperties' => [ 'base' => '<p> The properties that are applied when Amazon Honeycode is used as a destination. </p>', 'refs' => [ 'DestinationConnectorProperties$Honeycode' => '<p> The properties required to query Amazon Honeycode. </p>', ], ], 'HoneycodeMetadata' => [ 'base' => '<p> The connector metadata specific to Amazon Honeycode. </p>', 'refs' => [ 'ConnectorMetadata$Honeycode' => '<p> The connector metadata specific to Amazon Honeycode. </p>', ], ], 'IdFieldNameList' => [ 'base' => '<p> A list of field names that can be used as an ID field when performing a write operation. </p>', 'refs' => [ 'CustomConnectorDestinationProperties$idFieldNames' => '<p>The name of the field that Amazon AppFlow uses as an ID when performing a write operation such as update, delete, or upsert.</p>', 'SAPODataDestinationProperties$idFieldNames' => NULL, 'SalesforceDestinationProperties$idFieldNames' => '<p> The name of the field that Amazon AppFlow uses as an ID when performing a write operation such as update or delete. </p>', 'ZendeskDestinationProperties$idFieldNames' => NULL, ], ], 'Identifier' => [ 'base' => NULL, 'refs' => [ 'ConnectorEntityField$identifier' => '<p> The unique identifier of the connector field. </p>', 'ConnectorEntityField$parentIdentifier' => '<p>The parent identifier of the connector field.</p>', ], ], 'IncrementalPullConfig' => [ 'base' => '<p> Specifies the configuration used when importing incremental records from the source. </p>', 'refs' => [ 'SourceFlowConfig$incrementalPullConfig' => '<p> Defines the configuration for a scheduled incremental data pull. If a valid configuration is provided, the fields specified in the configuration are used when querying for the incremental data pull. </p>', ], ], 'InforNexusConnectorOperator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$InforNexus' => '<p> The operation to be performed on the provided Infor Nexus source fields. </p>', ], ], 'InforNexusConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific profile credentials required by Infor Nexus. </p>', 'refs' => [ 'ConnectorProfileCredentials$InforNexus' => '<p> The connector-specific credentials required when using Infor Nexus. </p>', ], ], 'InforNexusConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties required by Infor Nexus. </p>', 'refs' => [ 'ConnectorProfileProperties$InforNexus' => '<p> The connector-specific properties required by Infor Nexus. </p>', ], ], 'InforNexusMetadata' => [ 'base' => '<p> The connector metadata specific to Infor Nexus. </p>', 'refs' => [ 'ConnectorMetadata$InforNexus' => '<p> The connector metadata specific to Infor Nexus. </p>', ], ], 'InforNexusSourceProperties' => [ 'base' => '<p> The properties that are applied when Infor Nexus is being used as a source. </p>', 'refs' => [ 'SourceConnectorProperties$InforNexus' => '<p> Specifies the information that is required for querying Infor Nexus. </p>', ], ], 'InstanceUrl' => [ 'base' => NULL, 'refs' => [ 'DatadogConnectorProfileProperties$instanceUrl' => '<p> The location of the Datadog resource. </p>', 'DynatraceConnectorProfileProperties$instanceUrl' => '<p> The location of the Dynatrace resource. </p>', 'InforNexusConnectorProfileProperties$instanceUrl' => '<p> The location of the Infor Nexus resource. </p>', 'MarketoConnectorProfileProperties$instanceUrl' => '<p> The location of the Marketo resource. </p>', 'PardotConnectorProfileProperties$instanceUrl' => '<p>The location of the Salesforce Pardot resource.</p>', 'SalesforceConnectorProfileProperties$instanceUrl' => '<p> The location of the Salesforce resource. </p>', 'ServiceNowConnectorProfileProperties$instanceUrl' => '<p> The location of the ServiceNow resource. </p>', 'SlackConnectorProfileProperties$instanceUrl' => '<p> The location of the Slack resource. </p>', 'VeevaConnectorProfileProperties$instanceUrl' => '<p> The location of the Veeva resource. </p>', 'ZendeskConnectorProfileProperties$instanceUrl' => '<p> The location of the Zendesk resource. </p>', ], ], 'InternalServerException' => [ 'base' => '<p> An internal service error occurred during the processing of your request. Try again later. </p>', 'refs' => [], ], 'JavaBoolean' => [ 'base' => NULL, 'refs' => [ 'S3OutputFormatConfig$preserveSourceDataTyping' => '<p>If your file output format is Parquet, use this parameter to set whether Amazon AppFlow preserves the data types in your source data when it writes the output to Amazon S3. </p> <ul> <li> <p> <code>true</code>: Amazon AppFlow preserves the data types when it writes to Amazon S3. For example, an integer or <code>1</code> in your source data is still an integer in your output.</p> </li> <li> <p> <code>false</code>: Amazon AppFlow converts all of the source data into strings when it writes to Amazon S3. For example, an integer of <code>1</code> in your source data becomes the string <code>\"1\"</code> in the output.</p> </li> </ul>', ], ], 'JwtToken' => [ 'base' => NULL, 'refs' => [ 'SalesforceConnectorProfileCredentials$jwtToken' => '<p>A JSON web token (JWT) that authorizes Amazon AppFlow to access your Salesforce records.</p>', ], ], 'KMSArn' => [ 'base' => NULL, 'refs' => [ 'CreateConnectorProfileRequest$kmsArn' => '<p> The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is required if you do not want to use the Amazon AppFlow-managed KMS key. If you don\\'t provide anything here, Amazon AppFlow uses the Amazon AppFlow-managed KMS key. </p>', 'CreateFlowRequest$kmsArn' => '<p> The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is required if you do not want to use the Amazon AppFlow-managed KMS key. If you don\\'t provide anything here, Amazon AppFlow uses the Amazon AppFlow-managed KMS key. </p>', 'DescribeFlowResponse$kmsArn' => '<p> The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is required if you do not want to use the Amazon AppFlow-managed KMS key. If you don\\'t provide anything here, Amazon AppFlow uses the Amazon AppFlow-managed KMS key. </p>', ], ], 'Key' => [ 'base' => NULL, 'refs' => [ 'AuthParameter$key' => '<p>The authentication key required to authenticate with the connector.</p>', 'ConnectorRuntimeSetting$key' => '<p>Contains value information about the connector runtime setting.</p>', 'InforNexusConnectorProfileCredentials$secretAccessKey' => '<p> The secret key used to sign requests. </p>', 'InforNexusConnectorProfileCredentials$datakey' => '<p> The encryption keys used to encrypt data. </p>', 'OAuth2CustomParameter$key' => '<p>The key of the custom parameter required for OAuth 2.0 authentication.</p>', ], ], 'Label' => [ 'base' => NULL, 'refs' => [ 'AuthParameter$label' => '<p>Label used for authentication parameter.</p>', 'ConnectorEntity$label' => '<p> The label applied to the connector entity. </p>', 'ConnectorEntityField$label' => '<p> The label applied to a connector entity field. </p>', 'ConnectorRuntimeSetting$label' => '<p>A label used for connector runtime setting.</p>', 'OAuth2CustomParameter$label' => '<p>The label of the custom parameter used for OAuth 2.0 authentication.</p>', ], ], 'LambdaConnectorProvisioningConfig' => [ 'base' => '<p>Contains information about the configuration of the lambda which is being registered as the connector.</p>', 'refs' => [ 'ConnectorProvisioningConfig$lambda' => '<p>Contains information about the configuration of the lambda which is being registered as the connector.</p>', ], ], 'ListConnectorEntitiesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListConnectorEntitiesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListConnectorsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListConnectorsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListEntitiesMaxResults' => [ 'base' => NULL, 'refs' => [ 'ListConnectorEntitiesRequest$maxResults' => '<p>The maximum number of items that the operation returns in the response.</p>', ], ], 'ListFlowsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListFlowsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'LogoURL' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$logoURL' => '<p>Logo URL of the connector.</p>', ], ], 'LogonLanguage' => [ 'base' => NULL, 'refs' => [ 'SAPODataConnectorProfileProperties$logonLanguage' => '<p> The logon language of SAPOData instance. </p>', ], ], 'Long' => [ 'base' => NULL, 'refs' => [ 'AggregationConfig$targetFileSize' => '<p>The desired file size, in MB, for each output file that Amazon AppFlow writes to the flow destination. For each file, Amazon AppFlow attempts to achieve the size that you specify. The actual file sizes might differ from this target based on the number and size of the records that each file contains.</p>', 'DescribeFlowResponse$schemaVersion' => '<p>The version number of your data schema. Amazon AppFlow assigns this version number. The version number increases by one when you change any of the following settings in your flow configuration:</p> <ul> <li> <p>Source-to-destination field mappings</p> </li> <li> <p>Field data types</p> </li> <li> <p>Partition keys</p> </li> </ul>', 'ErrorInfo$putFailuresCount' => '<p> Specifies the failure count for the attempted flow. </p>', 'ExecutionResult$bytesProcessed' => '<p> The total number of bytes processed by the flow run. </p>', 'ExecutionResult$bytesWritten' => '<p> The total number of bytes written as a result of the flow run. </p>', 'ExecutionResult$recordsProcessed' => '<p> The number of records processed in the flow run. </p>', ], ], 'LookoutMetricsDestinationProperties' => [ 'base' => '<p> The properties that are applied when Amazon Lookout for Metrics is used as a destination. </p>', 'refs' => [ 'DestinationConnectorProperties$LookoutMetrics' => '<p> The properties required to query Amazon Lookout for Metrics. </p>', ], ], 'MarketoConnectorOperator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$Marketo' => '<p> The operation to be performed on the provided Marketo source fields. </p>', ], ], 'MarketoConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific profile credentials required by Marketo. </p>', 'refs' => [ 'ConnectorProfileCredentials$Marketo' => '<p> The connector-specific credentials required when using Marketo. </p>', ], ], 'MarketoConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties required when using Marketo. </p>', 'refs' => [ 'ConnectorProfileProperties$Marketo' => '<p> The connector-specific properties required by Marketo. </p>', ], ], 'MarketoDestinationProperties' => [ 'base' => '<p>The properties that Amazon AppFlow applies when you use Marketo as a flow destination.</p>', 'refs' => [ 'DestinationConnectorProperties$Marketo' => '<p>The properties required to query Marketo.</p>', ], ], 'MarketoMetadata' => [ 'base' => '<p> The connector metadata specific to Marketo. </p>', 'refs' => [ 'ConnectorMetadata$Marketo' => '<p> The connector metadata specific to Marketo. </p>', ], ], 'MarketoSourceProperties' => [ 'base' => '<p> The properties that are applied when Marketo is being used as a source. </p>', 'refs' => [ 'SourceConnectorProperties$Marketo' => '<p> Specifies the information that is required for querying Marketo. </p>', ], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'DescribeConnectorProfilesRequest$maxResults' => '<p> Specifies the maximum number of items that should be returned in the result set. The default for <code>maxResults</code> is 20 (for all paginated API operations). </p>', 'DescribeConnectorsRequest$maxResults' => '<p>The maximum number of items that should be returned in the result set. The default is 20.</p>', 'DescribeFlowExecutionRecordsRequest$maxResults' => '<p> Specifies the maximum number of items that should be returned in the result set. The default for <code>maxResults</code> is 20 (for all paginated API operations). </p>', 'ListConnectorsRequest$maxResults' => '<p>Specifies the maximum number of items that should be returned in the result set. The default for <code>maxResults</code> is 20 (for all paginated API operations).</p>', 'ListFlowsRequest$maxResults' => '<p> Specifies the maximum number of items that should be returned in the result set. </p>', ], ], 'MetadataCatalogConfig' => [ 'base' => '<p>Specifies the configuration that Amazon AppFlow uses when it catalogs your data. When Amazon AppFlow catalogs your data, it stores metadata in a data catalog.</p>', 'refs' => [ 'CreateFlowRequest$metadataCatalogConfig' => '<p>Specifies the configuration that Amazon AppFlow uses when it catalogs the data that\\'s transferred by the associated flow. When Amazon AppFlow catalogs the data from a flow, it stores metadata in a data catalog.</p>', 'DescribeFlowResponse$metadataCatalogConfig' => '<p>Specifies the configuration that Amazon AppFlow uses when it catalogs the data that\\'s transferred by the associated flow. When Amazon AppFlow catalogs the data from a flow, it stores metadata in a data catalog.</p>', 'UpdateFlowRequest$metadataCatalogConfig' => '<p>Specifies the configuration that Amazon AppFlow uses when it catalogs the data that\\'s transferred by the associated flow. When Amazon AppFlow catalogs the data from a flow, it stores metadata in a data catalog.</p>', ], ], 'MetadataCatalogDetail' => [ 'base' => '<p>Describes the metadata catalog, metadata table, and data partitions that Amazon AppFlow used for the associated flow run.</p>', 'refs' => [ 'MetadataCatalogDetails$member' => NULL, ], ], 'MetadataCatalogDetails' => [ 'base' => NULL, 'refs' => [ 'DescribeFlowResponse$lastRunMetadataCatalogDetails' => '<p>Describes the metadata catalog, metadata table, and data partitions that Amazon AppFlow used for the associated flow run.</p>', 'ExecutionRecord$metadataCatalogDetails' => '<p>Describes the metadata catalog, metadata table, and data partitions that Amazon AppFlow used for the associated flow run.</p>', ], ], 'MostRecentExecutionMessage' => [ 'base' => NULL, 'refs' => [ 'ExecutionDetails$mostRecentExecutionMessage' => '<p> Describes the details of the most recent flow run. </p>', ], ], 'Name' => [ 'base' => NULL, 'refs' => [ 'ConnectorEntity$name' => '<p> The name of the connector entity. </p>', 'IdFieldNameList$member' => NULL, ], ], 'NextToken' => [ 'base' => NULL, 'refs' => [ 'DescribeConnectorProfilesRequest$nextToken' => '<p> The pagination token for the next page of data. </p>', 'DescribeConnectorProfilesResponse$nextToken' => '<p> The pagination token for the next page of data. If <code>nextToken=null</code>, this means that all records have been fetched. </p>', 'DescribeConnectorsRequest$nextToken' => '<p> The pagination token for the next page of data. </p>', 'DescribeConnectorsResponse$nextToken' => '<p> The pagination token for the next page of data. </p>', 'DescribeFlowExecutionRecordsRequest$nextToken' => '<p> The pagination token for the next page of data. </p>', 'DescribeFlowExecutionRecordsResponse$nextToken' => '<p> The pagination token for the next page of data. </p>', 'ListConnectorEntitiesRequest$nextToken' => '<p>A token that was provided by your prior <code>ListConnectorEntities</code> operation if the response was too big for the page size. You specify this token to get the next page of results in paginated response.</p>', 'ListConnectorEntitiesResponse$nextToken' => '<p>A token that you specify in your next <code>ListConnectorEntities</code> operation to get the next page of results in paginated response. The <code>ListConnectorEntities</code> operation provides this token if the response is too big for the page size.</p>', 'ListConnectorsRequest$nextToken' => '<p>The pagination token for the next page of data.</p>', 'ListConnectorsResponse$nextToken' => '<p>The pagination token for the next page of data. If nextToken=null, this means that all records have been fetched.</p>', 'ListFlowsRequest$nextToken' => '<p> The pagination token for next page of data. </p>', 'ListFlowsResponse$nextToken' => '<p> The pagination token for next page of data. </p>', ], ], 'OAuth2Credentials' => [ 'base' => '<p>The OAuth 2.0 credentials required for OAuth 2.0 authentication.</p>', 'refs' => [ 'CustomConnectorProfileCredentials$oauth2' => '<p>The OAuth 2.0 credentials required for the authentication of the user.</p>', ], ], 'OAuth2CustomParameter' => [ 'base' => '<p>Custom parameter required for OAuth 2.0 authentication.</p>', 'refs' => [ 'OAuth2CustomPropertiesList$member' => NULL, ], ], 'OAuth2CustomPropType' => [ 'base' => NULL, 'refs' => [ 'OAuth2CustomParameter$type' => '<p>Indicates whether custom parameter is used with TokenUrl or AuthUrl.</p>', ], ], 'OAuth2CustomPropertiesList' => [ 'base' => NULL, 'refs' => [ 'OAuth2Defaults$oauth2CustomProperties' => '<p>List of custom parameters required for OAuth 2.0 authentication.</p>', ], ], 'OAuth2Defaults' => [ 'base' => '<p>Contains the default values required for OAuth 2.0 authentication.</p>', 'refs' => [ 'AuthenticationConfig$oAuth2Defaults' => '<p>Contains the default values required for OAuth 2.0 authentication.</p>', ], ], 'OAuth2GrantType' => [ 'base' => NULL, 'refs' => [ 'OAuth2GrantTypeSupportedList$member' => NULL, 'OAuth2Properties$oAuth2GrantType' => '<p>The OAuth 2.0 grant type used by connector for OAuth 2.0 authentication.</p>', 'SalesforceConnectorProfileCredentials$oAuth2GrantType' => '<p>Specifies the OAuth 2.0 grant type that Amazon AppFlow uses when it requests an access token from Salesforce. Amazon AppFlow requires an access token each time it attempts to access your Salesforce records.</p> <p>You can specify one of the following values:</p> <dl> <dt>AUTHORIZATION_CODE</dt> <dd> <p>Amazon AppFlow passes an authorization code when it requests the access token from Salesforce. Amazon AppFlow receives the authorization code from Salesforce after you log in to your Salesforce account and authorize Amazon AppFlow to access your records.</p> </dd> <dt>CLIENT_CREDENTIALS</dt> <dd> <p>Amazon AppFlow passes client credentials (a client ID and client secret) when it requests the access token from Salesforce. You provide these credentials to Amazon AppFlow when you define the connection to your Salesforce account.</p> </dd> <dt>JWT_BEARER</dt> <dd> <p>Amazon AppFlow passes a JSON web token (JWT) when it requests the access token from Salesforce. You provide the JWT to Amazon AppFlow when you define the connection to your Salesforce account. When you use this grant type, you don\\'t need to log in to your Salesforce account to authorize Amazon AppFlow to access your records.</p> </dd> </dl>', ], ], 'OAuth2GrantTypeSupportedList' => [ 'base' => NULL, 'refs' => [ 'OAuth2Defaults$oauth2GrantTypesSupported' => '<p>OAuth 2.0 grant types supported by the connector.</p>', 'SalesforceMetadata$oauth2GrantTypesSupported' => '<p>The OAuth 2.0 grant types that Amazon AppFlow can use when it requests an access token from Salesforce. Amazon AppFlow requires an access token each time it attempts to access your Salesforce records.</p> <dl> <dt>AUTHORIZATION_CODE</dt> <dd> <p>Amazon AppFlow passes an authorization code when it requests the access token from Salesforce. Amazon AppFlow receives the authorization code from Salesforce after you log in to your Salesforce account and authorize Amazon AppFlow to access your records.</p> </dd> <dt>CLIENT_CREDENTIALS</dt> <dd> <p>Amazon AppFlow passes client credentials (a client ID and client secret) when it requests the access token from Salesforce. You provide these credentials to Amazon AppFlow when you define the connection to your Salesforce account.</p> </dd> <dt>JWT_BEARER</dt> <dd> <p>Amazon AppFlow passes a JSON web token (JWT) when it requests the access token from Salesforce. You provide the JWT to Amazon AppFlow when you define the connection to your Salesforce account. When you use this grant type, you don\\'t need to log in to your Salesforce account to authorize Amazon AppFlow to access your records.</p> </dd> </dl>', ], ], 'OAuth2Properties' => [ 'base' => '<p>The OAuth 2.0 properties required for OAuth 2.0 authentication.</p>', 'refs' => [ 'CustomConnectorProfileProperties$oAuth2Properties' => NULL, ], ], 'OAuthCredentials' => [ 'base' => '<p> The OAuth credentials required for OAuth type authentication. </p>', 'refs' => [ 'SAPODataConnectorProfileCredentials$oAuthCredentials' => '<p> The SAPOData OAuth type authentication credentials. </p>', ], ], 'OAuthProperties' => [ 'base' => '<p> The OAuth properties required for OAuth type authentication. </p>', 'refs' => [ 'SAPODataConnectorProfileProperties$oAuthProperties' => '<p> The SAPOData OAuth properties required for OAuth type authentication. </p>', ], ], 'OAuthScope' => [ 'base' => NULL, 'refs' => [ 'OAuthScopeList$member' => NULL, ], ], 'OAuthScopeList' => [ 'base' => NULL, 'refs' => [ 'GoogleAnalyticsMetadata$oAuthScopes' => '<p> The desired authorization scope for the Google Analytics account. </p>', 'HoneycodeMetadata$oAuthScopes' => '<p> The desired authorization scope for the Amazon Honeycode account. </p>', 'OAuth2Defaults$oauthScopes' => '<p>OAuth 2.0 scopes that the connector supports.</p>', 'OAuthProperties$oAuthScopes' => '<p> The OAuth scopes required for OAuth type authentication. </p>', 'SalesforceMetadata$oAuthScopes' => '<p> The desired authorization scope for the Salesforce account. </p>', 'SlackMetadata$oAuthScopes' => '<p> The desired authorization scope for the Slack account. </p>', 'ZendeskMetadata$oAuthScopes' => '<p> The desired authorization scope for the Zendesk account. </p>', ], ], 'Object' => [ 'base' => NULL, 'refs' => [ 'AmplitudeSourceProperties$object' => '<p> The object specified in the Amplitude flow source. </p>', 'DatadogSourceProperties$object' => '<p> The object specified in the Datadog flow source. </p>', 'DynatraceSourceProperties$object' => '<p> The object specified in the Dynatrace flow source. </p>', 'EventBridgeDestinationProperties$object' => '<p> The object specified in the Amazon EventBridge flow destination. </p>', 'GoogleAnalyticsSourceProperties$object' => '<p> The object specified in the Google Analytics flow source. </p>', 'HoneycodeDestinationProperties$object' => '<p> The object specified in the Amazon Honeycode flow destination. </p>', 'InforNexusSourceProperties$object' => '<p> The object specified in the Infor Nexus flow source. </p>', 'MarketoDestinationProperties$object' => '<p>The object specified in the Marketo flow destination.</p>', 'MarketoSourceProperties$object' => '<p> The object specified in the Marketo flow source. </p>', 'PardotSourceProperties$object' => '<p>The object specified in the Salesforce Pardot flow source.</p>', 'RedshiftDestinationProperties$object' => '<p> The object specified in the Amazon Redshift flow destination. </p>', 'SAPODataDestinationProperties$objectPath' => '<p>The object path specified in the SAPOData flow destination.</p>', 'SAPODataSourceProperties$objectPath' => '<p> The object path specified in the SAPOData flow source. </p>', 'SalesforceDestinationProperties$object' => '<p> The object specified in the Salesforce flow destination. </p>', 'SalesforceSourceProperties$object' => '<p> The object specified in the Salesforce flow source. </p>', 'ServiceNowSourceProperties$object' => '<p> The object specified in the ServiceNow flow source. </p>', 'SingularSourceProperties$object' => '<p> The object specified in the Singular flow source. </p>', 'SlackSourceProperties$object' => '<p> The object specified in the Slack flow source. </p>', 'SnowflakeDestinationProperties$object' => '<p> The object specified in the Snowflake flow destination. </p>', 'TrendmicroSourceProperties$object' => '<p> The object specified in the Trend Micro flow source. </p>', 'VeevaSourceProperties$object' => '<p> The object specified in the Veeva flow source. </p>', 'ZendeskDestinationProperties$object' => '<p>The object specified in the Zendesk flow destination.</p>', 'ZendeskSourceProperties$object' => '<p> The object specified in the Zendesk flow source. </p>', ], ], 'ObjectTypeName' => [ 'base' => NULL, 'refs' => [ 'CustomerProfilesDestinationProperties$objectTypeName' => '<p> The object specified in the Amazon Connect Customer Profiles flow destination. </p>', ], ], 'Operator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$CustomConnector' => '<p>Operators supported by the custom connector.</p>', 'FilterOperatorList$member' => NULL, ], ], 'OperatorPropertiesKeys' => [ 'base' => NULL, 'refs' => [ 'TaskPropertiesMap$key' => NULL, ], ], 'Operators' => [ 'base' => NULL, 'refs' => [ 'SupportedOperatorList$member' => NULL, ], ], 'PardotConnectorOperator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$Pardot' => '<p>The operation to be performed on the provided Salesforce Pardot source fields.</p>', ], ], 'PardotConnectorProfileCredentials' => [ 'base' => '<p>The connector-specific profile credentials required when using Salesforce Pardot.</p>', 'refs' => [ 'ConnectorProfileCredentials$Pardot' => '<p>The connector-specific credentials required when using Salesforce Pardot.</p>', ], ], 'PardotConnectorProfileProperties' => [ 'base' => '<p>The connector-specific profile properties required when using Salesforce Pardot.</p>', 'refs' => [ 'ConnectorProfileProperties$Pardot' => '<p>The connector-specific properties required by Salesforce Pardot.</p>', ], ], 'PardotMetadata' => [ 'base' => '<p>The connector metadata specific to Salesforce Pardot.</p>', 'refs' => [ 'ConnectorMetadata$Pardot' => '<p>The connector metadata specific to Salesforce Pardot.</p>', ], ], 'PardotSourceProperties' => [ 'base' => '<p>The properties that are applied when Salesforce Pardot is being used as a source.</p>', 'refs' => [ 'SourceConnectorProperties$Pardot' => '<p>Specifies the information that is required for querying Salesforce Pardot.</p>', ], ], 'Password' => [ 'base' => NULL, 'refs' => [ 'BasicAuthCredentials$password' => '<p> The password to use to connect to a resource.</p>', 'RedshiftConnectorProfileCredentials$password' => '<p> The password that corresponds to the user name. </p>', 'ServiceNowConnectorProfileCredentials$password' => '<p> The password that corresponds to the user name. </p>', 'SnowflakeConnectorProfileCredentials$password' => '<p> The password that corresponds to the user name. </p>', 'VeevaConnectorProfileCredentials$password' => '<p> The password that corresponds to the user name. </p>', ], ], 'PathPrefix' => [ 'base' => NULL, 'refs' => [ 'PathPrefixHierarchy$member' => NULL, ], ], 'PathPrefixHierarchy' => [ 'base' => NULL, 'refs' => [ 'PrefixConfig$pathPrefixHierarchy' => '<p>Specifies whether the destination file path includes either or both of the following elements:</p> <dl> <dt>EXECUTION_ID</dt> <dd> <p>The ID that Amazon AppFlow assigns to the flow run.</p> </dd> <dt>SCHEMA_VERSION</dt> <dd> <p>The version number of your data schema. Amazon AppFlow assigns this version number. The version number increases by one when you change any of the following settings in your flow configuration:</p> <ul> <li> <p>Source-to-destination field mappings</p> </li> <li> <p>Field data types</p> </li> <li> <p>Partition keys</p> </li> </ul> </dd> </dl>', ], ], 'PortNumber' => [ 'base' => NULL, 'refs' => [ 'SAPODataConnectorProfileProperties$portNumber' => '<p> The port number of the SAPOData instance. </p>', ], ], 'PrefixConfig' => [ 'base' => '<p>Specifies elements that Amazon AppFlow includes in the file and folder names in the flow destination.</p>', 'refs' => [ 'S3OutputFormatConfig$prefixConfig' => '<p> Determines the prefix that Amazon AppFlow applies to the folder name in the Amazon S3 bucket. You can name folders according to the flow frequency and date. </p>', 'UpsolverS3OutputFormatConfig$prefixConfig' => NULL, ], ], 'PrefixFormat' => [ 'base' => NULL, 'refs' => [ 'PrefixConfig$prefixFormat' => '<p>Determines the level of granularity for the date and time that\\'s included in the prefix. </p>', ], ], 'PrefixType' => [ 'base' => NULL, 'refs' => [ 'PrefixConfig$prefixType' => '<p>Determines the format of the prefix, and whether it applies to the file name, file path, or both. </p>', ], ], 'PrivateConnectionProvisioningFailureCause' => [ 'base' => NULL, 'refs' => [ 'PrivateConnectionProvisioningState$failureCause' => '<p> Specifies the private connection provisioning failure cause. </p>', ], ], 'PrivateConnectionProvisioningFailureMessage' => [ 'base' => NULL, 'refs' => [ 'PrivateConnectionProvisioningState$failureMessage' => '<p> Specifies the private connection provisioning failure reason. </p>', ], ], 'PrivateConnectionProvisioningState' => [ 'base' => '<p> Specifies the private connection provisioning state. </p>', 'refs' => [ 'ConnectorProfile$privateConnectionProvisioningState' => '<p> Specifies the private connection provisioning state. </p>', ], ], 'PrivateConnectionProvisioningStatus' => [ 'base' => NULL, 'refs' => [ 'PrivateConnectionProvisioningState$status' => '<p> Specifies the private connection provisioning status. </p>', ], ], 'PrivateLinkServiceName' => [ 'base' => NULL, 'refs' => [ 'SAPODataConnectorProfileProperties$privateLinkServiceName' => '<p> The SAPOData Private Link service name to be used for private data transfers. </p>', 'SnowflakeConnectorProfileProperties$privateLinkServiceName' => '<p> The Snowflake Private Link service name to be used for private data transfers. </p>', ], ], 'ProfilePropertiesMap' => [ 'base' => NULL, 'refs' => [ 'CustomConnectorProfileProperties$profileProperties' => '<p>A map of properties that are required to create a profile for the custom connector.</p>', ], ], 'ProfilePropertyKey' => [ 'base' => NULL, 'refs' => [ 'ProfilePropertiesMap$key' => NULL, ], ], 'ProfilePropertyValue' => [ 'base' => NULL, 'refs' => [ 'ProfilePropertiesMap$value' => NULL, ], ], 'Property' => [ 'base' => NULL, 'refs' => [ 'TaskPropertiesMap$value' => NULL, ], ], 'Range' => [ 'base' => '<p>The range of values that the property supports.</p>', 'refs' => [ 'FieldTypeDetails$fieldValueRange' => '<p>The range of values this field can hold.</p>', 'FieldTypeDetails$fieldLengthRange' => '<p>This is the allowable length range for this field\\'s value.</p>', ], ], 'RedirectUri' => [ 'base' => NULL, 'refs' => [ 'ConnectorOAuthRequest$redirectUri' => '<p> The URL to which the authentication server redirects the browser after authorization has been granted. </p>', ], ], 'RedshiftConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific profile credentials required when using Amazon Redshift. </p>', 'refs' => [ 'ConnectorProfileCredentials$Redshift' => '<p> The connector-specific credentials required when using Amazon Redshift. </p>', ], ], 'RedshiftConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties when using Amazon Redshift. </p>', 'refs' => [ 'ConnectorProfileProperties$Redshift' => '<p> The connector-specific properties required by Amazon Redshift. </p>', ], ], 'RedshiftDestinationProperties' => [ 'base' => '<p> The properties that are applied when Amazon Redshift is being used as a destination. </p>', 'refs' => [ 'DestinationConnectorProperties$Redshift' => '<p> The properties required to query Amazon Redshift. </p>', ], ], 'RedshiftMetadata' => [ 'base' => '<p> The connector metadata specific to Amazon Redshift. </p>', 'refs' => [ 'ConnectorMetadata$Redshift' => '<p> The connector metadata specific to Amazon Redshift. </p>', ], ], 'RefreshToken' => [ 'base' => NULL, 'refs' => [ 'GoogleAnalyticsConnectorProfileCredentials$refreshToken' => '<p> The credentials used to acquire new access tokens. This is required only for OAuth2 access tokens, and is not required for OAuth1 access tokens. </p>', 'HoneycodeConnectorProfileCredentials$refreshToken' => '<p> The credentials used to acquire new access tokens. </p>', 'OAuth2Credentials$refreshToken' => '<p>The refresh token used to refresh an expired access token.</p>', 'OAuthCredentials$refreshToken' => '<p> The refresh token used to refresh expired access token. </p>', 'PardotConnectorProfileCredentials$refreshToken' => '<p>The credentials used to acquire new access tokens.</p>', 'SalesforceConnectorProfileCredentials$refreshToken' => '<p> The credentials used to acquire new access tokens. </p>', ], ], 'Region' => [ 'base' => NULL, 'refs' => [ 'RegionList$member' => NULL, 'SnowflakeConnectorProfileProperties$region' => '<p> The Amazon Web Services Region of the Snowflake account. </p>', ], ], 'RegionList' => [ 'base' => NULL, 'refs' => [ 'SnowflakeMetadata$supportedRegions' => '<p> Specifies the supported Amazon Web Services Regions when using Snowflake. </p>', ], ], 'RegisterConnectorRequest' => [ 'base' => NULL, 'refs' => [], ], 'RegisterConnectorResponse' => [ 'base' => NULL, 'refs' => [], ], 'RegisteredBy' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$registeredBy' => '<p>Information about who registered the connector.</p>', 'ConnectorDetail$registeredBy' => '<p>The user who registered the connector.</p>', ], ], 'RegistrationOutput' => [ 'base' => '<p>Describes the status of an attempt from Amazon AppFlow to register a resource.</p> <p>When you run a flow that you\\'ve configured to use a metadata catalog, Amazon AppFlow registers a metadata table and data partitions with that catalog. This operation provides the status of that registration attempt. The operation also indicates how many related resources Amazon AppFlow created or updated.</p>', 'refs' => [ 'MetadataCatalogDetail$tableRegistrationOutput' => '<p>Describes the status of the attempt from Amazon AppFlow to register the metadata table with the metadata catalog. Amazon AppFlow creates or updates this table for the associated flow run.</p>', 'MetadataCatalogDetail$partitionRegistrationOutput' => '<p>Describes the status of the attempt from Amazon AppFlow to register the data partitions with the metadata catalog. The data partitions organize the flow output into a hierarchical path, such as a folder path in an S3 bucket. Amazon AppFlow creates the partitions (if they don\\'t already exist) based on your flow configuration.</p>', ], ], 'ResetConnectorMetadataCacheRequest' => [ 'base' => NULL, 'refs' => [], ], 'ResetConnectorMetadataCacheResponse' => [ 'base' => NULL, 'refs' => [], ], 'ResourceNotFoundException' => [ 'base' => '<p> The resource specified in the request (such as the source or destination connector profile) is not found. </p>', 'refs' => [], ], 'RoleArn' => [ 'base' => NULL, 'refs' => [ 'RedshiftConnectorProfileProperties$roleArn' => '<p> The Amazon Resource Name (ARN) of IAM role that grants Amazon Redshift read-only access to Amazon S3. For more information, and for the polices that you attach to this role, see <a href=\"https://docs.aws.amazon.com/appflow/latest/userguide/security_iam_service-role-policies.html#redshift-access-s3\">Allow Amazon Redshift to access your Amazon AppFlow data in Amazon S3</a>.</p>', ], ], 'S3ConnectorOperator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$S3' => '<p> The operation to be performed on the provided Amazon S3 source fields. </p>', ], ], 'S3DestinationProperties' => [ 'base' => '<p> The properties that are applied when Amazon S3 is used as a destination. </p>', 'refs' => [ 'DestinationConnectorProperties$S3' => '<p> The properties required to query Amazon S3. </p>', ], ], 'S3InputFileType' => [ 'base' => NULL, 'refs' => [ 'S3InputFormatConfig$s3InputFileType' => '<p> The file type that Amazon AppFlow gets from your Amazon S3 bucket. </p>', ], ], 'S3InputFormatConfig' => [ 'base' => '<p> When you use Amazon S3 as the source, the configuration format that you provide the flow input data. </p>', 'refs' => [ 'S3SourceProperties$s3InputFormatConfig' => NULL, ], ], 'S3Metadata' => [ 'base' => '<p> The connector metadata specific to Amazon S3. </p>', 'refs' => [ 'ConnectorMetadata$S3' => '<p> The connector metadata specific to Amazon S3. </p>', ], ], 'S3OutputFormatConfig' => [ 'base' => '<p> The configuration that determines how Amazon AppFlow should format the flow output data when Amazon S3 is used as the destination. </p>', 'refs' => [ 'S3DestinationProperties$s3OutputFormatConfig' => NULL, ], ], 'S3SourceProperties' => [ 'base' => '<p> The properties that are applied when Amazon S3 is being used as the flow source. </p>', 'refs' => [ 'SourceConnectorProperties$S3' => '<p> Specifies the information that is required for querying Amazon S3. </p>', ], ], 'SAPODataConnectorOperator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$SAPOData' => '<p> The operation to be performed on the provided SAPOData source fields. </p>', ], ], 'SAPODataConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific profile credentials required when using SAPOData. </p>', 'refs' => [ 'ConnectorProfileCredentials$SAPOData' => NULL, ], ], 'SAPODataConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties required when using SAPOData. </p>', 'refs' => [ 'ConnectorProfileProperties$SAPOData' => NULL, ], ], 'SAPODataDestinationProperties' => [ 'base' => '<p>The properties that are applied when using SAPOData as a flow destination</p>', 'refs' => [ 'DestinationConnectorProperties$SAPOData' => '<p>The properties required to query SAPOData.</p>', ], ], 'SAPODataMetadata' => [ 'base' => '<p> The connector metadata specific to SAPOData. </p>', 'refs' => [ 'ConnectorMetadata$SAPOData' => NULL, ], ], 'SAPODataSourceProperties' => [ 'base' => '<p> The properties that are applied when using SAPOData as a flow source. </p>', 'refs' => [ 'SourceConnectorProperties$SAPOData' => NULL, ], ], 'SalesforceConnectorOperator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$Salesforce' => '<p> The operation to be performed on the provided Salesforce source fields. </p>', ], ], 'SalesforceConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific profile credentials required when using Salesforce. </p>', 'refs' => [ 'ConnectorProfileCredentials$Salesforce' => '<p> The connector-specific credentials required when using Salesforce. </p>', ], ], 'SalesforceConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties required when using Salesforce. </p>', 'refs' => [ 'ConnectorProfileProperties$Salesforce' => '<p> The connector-specific properties required by Salesforce. </p>', ], ], 'SalesforceDataTransferApi' => [ 'base' => NULL, 'refs' => [ 'SalesforceDataTransferApiList$member' => NULL, 'SalesforceDestinationProperties$dataTransferApi' => '<p>Specifies which Salesforce API is used by Amazon AppFlow when your flow transfers data to Salesforce.</p> <dl> <dt>AUTOMATIC</dt> <dd> <p>The default. Amazon AppFlow selects which API to use based on the number of records that your flow transfers to Salesforce. If your flow transfers fewer than 1,000 records, Amazon AppFlow uses Salesforce REST API. If your flow transfers 1,000 records or more, Amazon AppFlow uses Salesforce Bulk API 2.0.</p> <p>Each of these Salesforce APIs structures data differently. If Amazon AppFlow selects the API automatically, be aware that, for recurring flows, the data output might vary from one flow run to the next. For example, if a flow runs daily, it might use REST API on one day to transfer 900 records, and it might use Bulk API 2.0 on the next day to transfer 1,100 records. For each of these flow runs, the respective Salesforce API formats the data differently. Some of the differences include how dates are formatted and null values are represented. Also, Bulk API 2.0 doesn\\'t transfer Salesforce compound fields.</p> <p>By choosing this option, you optimize flow performance for both small and large data transfers, but the tradeoff is inconsistent formatting in the output.</p> </dd> <dt>BULKV2</dt> <dd> <p>Amazon AppFlow uses only Salesforce Bulk API 2.0. This API runs asynchronous data transfers, and it\\'s optimal for large sets of data. By choosing this option, you ensure that your flow writes consistent output, but you optimize performance only for large data transfers.</p> <p>Note that Bulk API 2.0 does not transfer Salesforce compound fields.</p> </dd> <dt>REST_SYNC</dt> <dd> <p>Amazon AppFlow uses only Salesforce REST API. By choosing this option, you ensure that your flow writes consistent output, but you decrease performance for large data transfers that are better suited for Bulk API 2.0. In some cases, if your flow attempts to transfer a vary large set of data, it might fail with a timed out error.</p> </dd> </dl>', 'SalesforceSourceProperties$dataTransferApi' => '<p>Specifies which Salesforce API is used by Amazon AppFlow when your flow transfers data from Salesforce.</p> <dl> <dt>AUTOMATIC</dt> <dd> <p>The default. Amazon AppFlow selects which API to use based on the number of records that your flow transfers from Salesforce. If your flow transfers fewer than 1,000,000 records, Amazon AppFlow uses Salesforce REST API. If your flow transfers 1,000,000 records or more, Amazon AppFlow uses Salesforce Bulk API 2.0.</p> <p>Each of these Salesforce APIs structures data differently. If Amazon AppFlow selects the API automatically, be aware that, for recurring flows, the data output might vary from one flow run to the next. For example, if a flow runs daily, it might use REST API on one day to transfer 900,000 records, and it might use Bulk API 2.0 on the next day to transfer 1,100,000 records. For each of these flow runs, the respective Salesforce API formats the data differently. Some of the differences include how dates are formatted and null values are represented. Also, Bulk API 2.0 doesn\\'t transfer Salesforce compound fields.</p> <p>By choosing this option, you optimize flow performance for both small and large data transfers, but the tradeoff is inconsistent formatting in the output.</p> </dd> <dt>BULKV2</dt> <dd> <p>Amazon AppFlow uses only Salesforce Bulk API 2.0. This API runs asynchronous data transfers, and it\\'s optimal for large sets of data. By choosing this option, you ensure that your flow writes consistent output, but you optimize performance only for large data transfers.</p> <p>Note that Bulk API 2.0 does not transfer Salesforce compound fields.</p> </dd> <dt>REST_SYNC</dt> <dd> <p>Amazon AppFlow uses only Salesforce REST API. By choosing this option, you ensure that your flow writes consistent output, but you decrease performance for large data transfers that are better suited for Bulk API 2.0. In some cases, if your flow attempts to transfer a vary large set of data, it might fail wituh a timed out error.</p> </dd> </dl>', ], ], 'SalesforceDataTransferApiList' => [ 'base' => NULL, 'refs' => [ 'SalesforceMetadata$dataTransferApis' => '<p>The Salesforce APIs that you can have Amazon AppFlow use when your flows transfers data to or from Salesforce.</p>', ], ], 'SalesforceDestinationProperties' => [ 'base' => '<p> The properties that are applied when Salesforce is being used as a destination. </p>', 'refs' => [ 'DestinationConnectorProperties$Salesforce' => '<p> The properties required to query Salesforce. </p>', ], ], 'SalesforceMetadata' => [ 'base' => '<p> The connector metadata specific to Salesforce. </p>', 'refs' => [ 'ConnectorMetadata$Salesforce' => '<p> The connector metadata specific to Salesforce. </p>', ], ], 'SalesforceSourceProperties' => [ 'base' => '<p> The properties that are applied when Salesforce is being used as a source. </p>', 'refs' => [ 'SourceConnectorProperties$Salesforce' => '<p> Specifies the information that is required for querying Salesforce. </p>', ], ], 'ScheduleExpression' => [ 'base' => NULL, 'refs' => [ 'ScheduledTriggerProperties$scheduleExpression' => '<p> The scheduling expression that determines the rate at which the schedule will run, for example <code>rate(5minutes)</code>. </p>', ], ], 'ScheduleFrequencyType' => [ 'base' => NULL, 'refs' => [ 'SchedulingFrequencyTypeList$member' => NULL, ], ], 'ScheduleOffset' => [ 'base' => NULL, 'refs' => [ 'ScheduledTriggerProperties$scheduleOffset' => '<p> Specifies the optional offset that is added to the time interval for a schedule-triggered flow. </p>', ], ], 'ScheduledTriggerProperties' => [ 'base' => '<p> Specifies the configuration details of a schedule-triggered flow as defined by the user. Currently, these settings only apply to the <code>Scheduled</code> trigger type. </p>', 'refs' => [ 'TriggerProperties$Scheduled' => '<p> Specifies the configuration details of a schedule-triggered flow as defined by the user. </p>', ], ], 'SchedulingFrequencyTypeList' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$supportedSchedulingFrequencies' => '<p> Specifies the supported flow frequency for that connector. </p>', ], ], 'SecretKey' => [ 'base' => NULL, 'refs' => [ 'AmplitudeConnectorProfileCredentials$secretKey' => '<p> The Secret Access Key portion of the credentials. </p>', ], ], 'ServiceNowConnectorOperator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$ServiceNow' => '<p> The operation to be performed on the provided ServiceNow source fields. </p>', ], ], 'ServiceNowConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific profile credentials required when using ServiceNow. </p>', 'refs' => [ 'ConnectorProfileCredentials$ServiceNow' => '<p> The connector-specific credentials required when using ServiceNow. </p>', ], ], 'ServiceNowConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties required when using ServiceNow. </p>', 'refs' => [ 'ConnectorProfileProperties$ServiceNow' => '<p> The connector-specific properties required by serviceNow. </p>', ], ], 'ServiceNowMetadata' => [ 'base' => '<p> The connector metadata specific to ServiceNow. </p>', 'refs' => [ 'ConnectorMetadata$ServiceNow' => '<p> The connector metadata specific to ServiceNow. </p>', ], ], 'ServiceNowSourceProperties' => [ 'base' => '<p> The properties that are applied when ServiceNow is being used as a source. </p>', 'refs' => [ 'SourceConnectorProperties$ServiceNow' => '<p> Specifies the information that is required for querying ServiceNow. </p>', ], ], 'ServiceQuotaExceededException' => [ 'base' => '<p> The request would cause a service quota (such as the number of flows) to be exceeded. </p>', 'refs' => [], ], 'SingularConnectorOperator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$Singular' => '<p> The operation to be performed on the provided Singular source fields. </p>', ], ], 'SingularConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific profile credentials required when using Singular. </p>', 'refs' => [ 'ConnectorProfileCredentials$Singular' => '<p> The connector-specific credentials required when using Singular. </p>', ], ], 'SingularConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties required when using Singular. </p>', 'refs' => [ 'ConnectorProfileProperties$Singular' => '<p> The connector-specific properties required by Singular. </p>', ], ], 'SingularMetadata' => [ 'base' => '<p> The connector metadata specific to Singular. </p>', 'refs' => [ 'ConnectorMetadata$Singular' => '<p> The connector metadata specific to Singular. </p>', ], ], 'SingularSourceProperties' => [ 'base' => '<p> The properties that are applied when Singular is being used as a source. </p>', 'refs' => [ 'SourceConnectorProperties$Singular' => '<p> Specifies the information that is required for querying Singular. </p>', ], ], 'SlackConnectorOperator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$Slack' => '<p> The operation to be performed on the provided Slack source fields. </p>', ], ], 'SlackConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific profile credentials required when using Slack. </p>', 'refs' => [ 'ConnectorProfileCredentials$Slack' => '<p> The connector-specific credentials required when using Slack. </p>', ], ], 'SlackConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties required when using Slack. </p>', 'refs' => [ 'ConnectorProfileProperties$Slack' => '<p> The connector-specific properties required by Slack. </p>', ], ], 'SlackMetadata' => [ 'base' => '<p> The connector metadata specific to Slack. </p>', 'refs' => [ 'ConnectorMetadata$Slack' => '<p> The connector metadata specific to Slack. </p>', ], ], 'SlackSourceProperties' => [ 'base' => '<p> The properties that are applied when Slack is being used as a source. </p>', 'refs' => [ 'SourceConnectorProperties$Slack' => '<p> Specifies the information that is required for querying Slack. </p>', ], ], 'SnowflakeConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific profile credentials required when using Snowflake. </p>', 'refs' => [ 'ConnectorProfileCredentials$Snowflake' => '<p> The connector-specific credentials required when using Snowflake. </p>', ], ], 'SnowflakeConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties required when using Snowflake. </p>', 'refs' => [ 'ConnectorProfileProperties$Snowflake' => '<p> The connector-specific properties required by Snowflake. </p>', ], ], 'SnowflakeDestinationProperties' => [ 'base' => '<p> The properties that are applied when Snowflake is being used as a destination. </p>', 'refs' => [ 'DestinationConnectorProperties$Snowflake' => '<p> The properties required to query Snowflake. </p>', ], ], 'SnowflakeMetadata' => [ 'base' => '<p> The connector metadata specific to Snowflake. </p>', 'refs' => [ 'ConnectorMetadata$Snowflake' => '<p> The connector metadata specific to Snowflake. </p>', ], ], 'SourceConnectorProperties' => [ 'base' => '<p> Specifies the information that is required to query a particular connector. </p>', 'refs' => [ 'SourceFlowConfig$sourceConnectorProperties' => '<p> Specifies the information that is required to query a particular source connector. </p>', ], ], 'SourceFieldProperties' => [ 'base' => '<p> The properties that can be applied to a field when the connector is being used as a source. </p>', 'refs' => [ 'ConnectorEntityField$sourceProperties' => '<p> The properties that can be applied to a field when the connector is being used as a source. </p>', ], ], 'SourceFields' => [ 'base' => NULL, 'refs' => [ 'Task$sourceFields' => '<p> The source fields to which a particular task is applied. </p>', ], ], 'SourceFlowConfig' => [ 'base' => '<p> Contains information about the configuration of the source connector used in the flow. </p>', 'refs' => [ 'CreateFlowRequest$sourceFlowConfig' => '<p> The configuration that controls how Amazon AppFlow retrieves data from the source connector. </p>', 'DescribeFlowResponse$sourceFlowConfig' => '<p> The configuration that controls how Amazon AppFlow retrieves data from the source connector. </p>', 'UpdateFlowRequest$sourceFlowConfig' => NULL, ], ], 'Stage' => [ 'base' => NULL, 'refs' => [ 'SnowflakeConnectorProfileProperties$stage' => '<p> The name of the Amazon S3 stage that was created while setting up an Amazon S3 stage in the Snowflake account. This is written in the following format: &lt; Database&gt;&lt; Schema&gt;&lt;Stage Name&gt;. </p>', ], ], 'StartFlowRequest' => [ 'base' => NULL, 'refs' => [], ], 'StartFlowResponse' => [ 'base' => NULL, 'refs' => [], ], 'StopFlowRequest' => [ 'base' => NULL, 'refs' => [], ], 'StopFlowResponse' => [ 'base' => NULL, 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [ 'ConnectorEntityField$defaultValue' => '<p>Default value that can be assigned to this field.</p>', 'FieldTypeDetails$valueRegexPattern' => '<p>The regular expression pattern for the field name.</p>', 'FieldTypeDetails$supportedDateFormat' => '<p>The date format that the field supports.</p>', 'MetadataCatalogDetail$tableName' => '<p>The name of the table that stores the metadata for the associated flow run. The table stores metadata that represents the data that the flow transferred. Amazon AppFlow stores the table in the metadata catalog.</p>', 'RedshiftConnectorProfileCredentials$username' => '<p> The name of the user. </p>', 'RegistrationOutput$message' => '<p>Explains the status of the registration attempt from Amazon AppFlow. If the attempt fails, the message explains why.</p>', 'RegistrationOutput$result' => '<p>Indicates the number of resources that Amazon AppFlow created or updated. Possible resources include metadata tables and data partitions.</p>', 'SourceFields$member' => NULL, ], ], 'SuccessResponseHandlingConfig' => [ 'base' => '<p>Determines how Amazon AppFlow handles the success response that it gets from the connector after placing data.</p> <p>For example, this setting would determine where to write the response from the destination connector upon a successful insert operation.</p>', 'refs' => [ 'SAPODataDestinationProperties$successResponseHandlingConfig' => '<p>Determines how Amazon AppFlow handles the success response that it gets from the connector after placing data.</p> <p>For example, this setting would determine where to write the response from a destination connector upon a successful insert operation.</p>', ], ], 'SupportedApiVersion' => [ 'base' => NULL, 'refs' => [ 'SupportedApiVersionList$member' => NULL, ], ], 'SupportedApiVersionList' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$supportedApiVersions' => '<p>A list of API versions that are supported by the connector.</p>', ], ], 'SupportedDataTransferApis' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$supportedDataTransferApis' => '<p>The APIs of the connector application that Amazon AppFlow can use to transfer your data.</p>', ], ], 'SupportedDataTransferType' => [ 'base' => NULL, 'refs' => [ 'SupportedDataTransferTypeList$member' => NULL, ], ], 'SupportedDataTransferTypeList' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$supportedDataTransferTypes' => '<p>The data transfer types that the connector supports.</p> <dl> <dt>RECORD</dt> <dd> <p>Structured records.</p> </dd> <dt>FILE</dt> <dd> <p>Files or binary data.</p> </dd> </dl>', 'ConnectorDetail$supportedDataTransferTypes' => '<p>The data transfer types that the connector supports.</p> <dl> <dt>RECORD</dt> <dd> <p>Structured records.</p> </dd> <dt>FILE</dt> <dd> <p>Files or binary data.</p> </dd> </dl>', ], ], 'SupportedFieldTypeDetails' => [ 'base' => '<p> Contains details regarding all the supported <code>FieldTypes</code> and their corresponding <code>filterOperators</code> and <code>supportedValues</code>. </p>', 'refs' => [ 'ConnectorEntityField$supportedFieldTypeDetails' => '<p> Contains details regarding the supported <code>FieldType</code>, including the corresponding <code>filterOperators</code> and <code>supportedValues</code>. </p>', ], ], 'SupportedOperatorList' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$supportedOperators' => '<p>A list of operators supported by the connector.</p>', ], ], 'SupportedValueList' => [ 'base' => NULL, 'refs' => [ 'FieldTypeDetails$supportedValues' => '<p> The list of values that a field can contain. For example, a Boolean <code>fieldType</code> can have two values: \"true\" and \"false\". </p>', ], ], 'SupportedWriteOperationList' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$supportedWriteOperations' => '<p>A list of write operations supported by the connector.</p>', 'DestinationFieldProperties$supportedWriteOperations' => '<p> A list of supported write operations. For each write operation listed, this field can be used in <code>idFieldNames</code> when that write operation is present as a destination option. </p>', ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'TagKeyList$member' => NULL, 'TagMap$key' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$tagKeys' => '<p> The tag keys associated with the tag that you want to remove from your flow. </p>', ], ], 'TagMap' => [ 'base' => NULL, 'refs' => [ 'CreateFlowRequest$tags' => '<p> The tags used to organize, track, or control access for your flow. </p>', 'DescribeFlowResponse$tags' => '<p> The tags used to organize, track, or control access for your flow. </p>', 'FlowDefinition$tags' => '<p> The tags used to organize, track, or control access for your flow. </p>', 'ListTagsForResourceResponse$tags' => '<p> The tags used to organize, track, or control access for your flow. </p>', 'TagResourceRequest$tags' => '<p> The tags used to organize, track, or control access for your flow. </p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'TagMap$value' => NULL, ], ], 'Task' => [ 'base' => '<p> A class for modeling different type of tasks. Task implementation varies based on the <code>TaskType</code>. </p>', 'refs' => [ 'Tasks$member' => NULL, ], ], 'TaskPropertiesMap' => [ 'base' => NULL, 'refs' => [ 'Task$taskProperties' => '<p> A map used to store task-related information. The execution service looks for particular information based on the <code>TaskType</code>. </p>', ], ], 'TaskType' => [ 'base' => NULL, 'refs' => [ 'Task$taskType' => '<p> Specifies the particular task implementation that Amazon AppFlow performs. </p>', ], ], 'Tasks' => [ 'base' => NULL, 'refs' => [ 'CreateFlowRequest$tasks' => '<p> A list of tasks that Amazon AppFlow performs while transferring the data in the flow run. </p>', 'DescribeFlowResponse$tasks' => '<p> A list of tasks that Amazon AppFlow performs while transferring the data in the flow run. </p>', 'UpdateFlowRequest$tasks' => '<p> A list of tasks that Amazon AppFlow performs while transferring the data in the flow run. </p>', ], ], 'ThrottlingException' => [ 'base' => '<p>API calls have exceeded the maximum allowed API request rate per account and per Region. </p>', 'refs' => [], ], 'Timezone' => [ 'base' => NULL, 'refs' => [ 'ScheduledTriggerProperties$timezone' => '<p>Specifies the time zone used when referring to the dates and times of a scheduled flow, such as <code>America/New_York</code>. This time zone is only a descriptive label. It doesn\\'t affect how Amazon AppFlow interprets the timestamps that you specify to schedule the flow.</p> <p>If you want to schedule a flow by using times in a particular time zone, indicate the time zone as a UTC offset in your timestamps. For example, the UTC offsets for the <code>America/New_York</code> timezone are <code>-04:00</code> EDT and <code>-05:00 EST</code>.</p>', ], ], 'TokenUrl' => [ 'base' => NULL, 'refs' => [ 'OAuth2Properties$tokenUrl' => '<p>The token URL required for OAuth 2.0 authentication.</p>', 'OAuthProperties$tokenUrl' => '<p> The token url required to fetch access/refresh tokens using authorization code and also to refresh expired access token using refresh token.</p>', 'TokenUrlList$member' => NULL, ], ], 'TokenUrlCustomProperties' => [ 'base' => NULL, 'refs' => [ 'OAuth2Properties$tokenUrlCustomProperties' => '<p>Associates your token URL with a map of properties that you define. Use this parameter to provide any additional details that the connector requires to authenticate your request.</p>', ], ], 'TokenUrlList' => [ 'base' => NULL, 'refs' => [ 'OAuth2Defaults$tokenUrls' => '<p>Token URLs that can be used for OAuth 2.0 authentication.</p>', ], ], 'TrendmicroConnectorOperator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$Trendmicro' => '<p> The operation to be performed on the provided Trend Micro source fields. </p>', ], ], 'TrendmicroConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific profile credentials required when using Trend Micro. </p>', 'refs' => [ 'ConnectorProfileCredentials$Trendmicro' => '<p> The connector-specific credentials required when using Trend Micro. </p>', ], ], 'TrendmicroConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties required when using Trend Micro. </p>', 'refs' => [ 'ConnectorProfileProperties$Trendmicro' => '<p> The connector-specific properties required by Trend Micro. </p>', ], ], 'TrendmicroMetadata' => [ 'base' => '<p> The connector metadata specific to Trend Micro. </p>', 'refs' => [ 'ConnectorMetadata$Trendmicro' => '<p> The connector metadata specific to Trend Micro. </p>', ], ], 'TrendmicroSourceProperties' => [ 'base' => '<p> The properties that are applied when using Trend Micro as a flow source. </p>', 'refs' => [ 'SourceConnectorProperties$Trendmicro' => '<p> Specifies the information that is required for querying Trend Micro. </p>', ], ], 'TriggerConfig' => [ 'base' => '<p> The trigger settings that determine how and when Amazon AppFlow runs the specified flow. </p>', 'refs' => [ 'CreateFlowRequest$triggerConfig' => '<p> The trigger settings that determine how and when the flow runs. </p>', 'DescribeFlowResponse$triggerConfig' => '<p> The trigger settings that determine how and when the flow runs. </p>', 'UpdateFlowRequest$triggerConfig' => '<p> The trigger settings that determine how and when the flow runs. </p>', ], ], 'TriggerProperties' => [ 'base' => '<p> Specifies the configuration details that control the trigger for a flow. Currently, these settings only apply to the <code>Scheduled</code> trigger type. </p>', 'refs' => [ 'TriggerConfig$triggerProperties' => '<p> Specifies the configuration details of a schedule-triggered flow as defined by the user. Currently, these settings only apply to the <code>Scheduled</code> trigger type. </p>', ], ], 'TriggerType' => [ 'base' => NULL, 'refs' => [ 'FlowDefinition$triggerType' => '<p> Specifies the type of flow trigger. This can be <code>OnDemand</code>, <code>Scheduled</code>, or <code>Event</code>. </p>', 'TriggerConfig$triggerType' => '<p> Specifies the type of flow trigger. This can be <code>OnDemand</code>, <code>Scheduled</code>, or <code>Event</code>. </p>', 'TriggerTypeList$member' => NULL, ], ], 'TriggerTypeList' => [ 'base' => NULL, 'refs' => [ 'ConnectorConfiguration$supportedTriggerTypes' => '<p> Specifies the supported trigger types for the flow. </p>', ], ], 'UnregisterConnectorRequest' => [ 'base' => NULL, 'refs' => [], ], 'UnregisterConnectorResponse' => [ 'base' => NULL, 'refs' => [], ], 'UnsupportedOperationException' => [ 'base' => '<p> The requested operation is not supported for the current flow. </p>', 'refs' => [], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateConnectorProfileRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateConnectorProfileResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateConnectorRegistrationRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateConnectorRegistrationResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateFlowRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateFlowResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdatedBy' => [ 'base' => NULL, 'refs' => [ 'DescribeFlowResponse$lastUpdatedBy' => '<p> Specifies the user name of the account that performed the most recent update. </p>', 'FlowDefinition$lastUpdatedBy' => '<p> Specifies the account user name that most recently updated the flow. </p>', ], ], 'UpsolverBucketName' => [ 'base' => NULL, 'refs' => [ 'UpsolverDestinationProperties$bucketName' => '<p> The Upsolver Amazon S3 bucket name in which Amazon AppFlow places the transferred data. </p>', ], ], 'UpsolverDestinationProperties' => [ 'base' => '<p> The properties that are applied when Upsolver is used as a destination. </p>', 'refs' => [ 'DestinationConnectorProperties$Upsolver' => '<p> The properties required to query Upsolver. </p>', ], ], 'UpsolverMetadata' => [ 'base' => '<p> The connector metadata specific to Upsolver. </p>', 'refs' => [ 'ConnectorMetadata$Upsolver' => '<p> The connector metadata specific to Upsolver. </p>', ], ], 'UpsolverS3OutputFormatConfig' => [ 'base' => '<p> The configuration that determines how Amazon AppFlow formats the flow output data when Upsolver is used as the destination. </p>', 'refs' => [ 'UpsolverDestinationProperties$s3OutputFormatConfig' => '<p> The configuration that determines how data is formatted when Upsolver is used as the flow destination. </p>', ], ], 'Username' => [ 'base' => NULL, 'refs' => [ 'BasicAuthCredentials$username' => '<p> The username to use to connect to a resource. </p>', 'InforNexusConnectorProfileCredentials$userId' => '<p> The identifier for the user. </p>', 'ServiceNowConnectorProfileCredentials$username' => '<p> The name of the user. </p>', 'SnowflakeConnectorProfileCredentials$username' => '<p> The name of the user. </p>', 'VeevaConnectorProfileCredentials$username' => '<p> The name of the user. </p>', ], ], 'ValidationException' => [ 'base' => '<p> The request has invalid or missing parameters. </p>', 'refs' => [], ], 'Value' => [ 'base' => NULL, 'refs' => [ 'SupportedValueList$member' => NULL, ], ], 'VeevaConnectorOperator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$Veeva' => '<p> The operation to be performed on the provided Veeva source fields. </p>', ], ], 'VeevaConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific profile credentials required when using Veeva. </p>', 'refs' => [ 'ConnectorProfileCredentials$Veeva' => '<p> The connector-specific credentials required when using Veeva. </p>', ], ], 'VeevaConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties required when using Veeva. </p>', 'refs' => [ 'ConnectorProfileProperties$Veeva' => '<p> The connector-specific properties required by Veeva. </p>', ], ], 'VeevaMetadata' => [ 'base' => '<p> The connector metadata specific to Veeva. </p>', 'refs' => [ 'ConnectorMetadata$Veeva' => '<p> The connector metadata specific to Veeva. </p>', ], ], 'VeevaSourceProperties' => [ 'base' => '<p> The properties that are applied when using Veeva as a flow source. </p>', 'refs' => [ 'SourceConnectorProperties$Veeva' => '<p> Specifies the information that is required for querying Veeva. </p>', ], ], 'Warehouse' => [ 'base' => NULL, 'refs' => [ 'SnowflakeConnectorProfileProperties$warehouse' => '<p> The name of the Snowflake warehouse. </p>', ], ], 'WorkgroupName' => [ 'base' => NULL, 'refs' => [ 'RedshiftConnectorProfileProperties$workgroupName' => '<p>The name of an Amazon Redshift workgroup.</p>', ], ], 'WriteOperationType' => [ 'base' => '<p> The possible write operations in the destination connector. When this value is not provided, this defaults to the <code>INSERT</code> operation. </p>', 'refs' => [ 'CustomConnectorDestinationProperties$writeOperationType' => '<p>Specifies the type of write operation to be performed in the custom connector when it\\'s used as destination.</p>', 'SAPODataDestinationProperties$writeOperationType' => NULL, 'SalesforceDestinationProperties$writeOperationType' => '<p> This specifies the type of write operation to be performed in Salesforce. When the value is <code>UPSERT</code>, then <code>idFieldNames</code> is required. </p>', 'SupportedWriteOperationList$member' => NULL, 'ZendeskDestinationProperties$writeOperationType' => NULL, ], ], 'ZendeskConnectorOperator' => [ 'base' => NULL, 'refs' => [ 'ConnectorOperator$Zendesk' => '<p> The operation to be performed on the provided Zendesk source fields. </p>', ], ], 'ZendeskConnectorProfileCredentials' => [ 'base' => '<p> The connector-specific profile credentials required when using Zendesk. </p>', 'refs' => [ 'ConnectorProfileCredentials$Zendesk' => '<p> The connector-specific credentials required when using Zendesk. </p>', ], ], 'ZendeskConnectorProfileProperties' => [ 'base' => '<p> The connector-specific profile properties required when using Zendesk. </p>', 'refs' => [ 'ConnectorProfileProperties$Zendesk' => '<p> The connector-specific properties required by Zendesk. </p>', ], ], 'ZendeskDestinationProperties' => [ 'base' => '<p>The properties that are applied when Zendesk is used as a destination.</p>', 'refs' => [ 'DestinationConnectorProperties$Zendesk' => '<p>The properties required to query Zendesk.</p>', ], ], 'ZendeskMetadata' => [ 'base' => '<p> The connector metadata specific to Zendesk. </p>', 'refs' => [ 'ConnectorMetadata$Zendesk' => '<p> The connector metadata specific to Zendesk. </p>', ], ], 'ZendeskSourceProperties' => [ 'base' => '<p> The properties that are applied when using Zendesk as a flow source. </p>', 'refs' => [ 'SourceConnectorProperties$Zendesk' => '<p> Specifies the information that is required for querying Zendesk. </p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appflow/2020-08-23/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appflow-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appflow-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appflow.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appflow.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appflow/2020-08-23/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appflow.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appflow/2020-08-23/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appflow/2020-08-23/paginators-1.json\nreturn [ 'pagination' => [ 'DescribeConnectorProfiles' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'DescribeConnectors' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'DescribeFlowExecutionRecords' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'ListConnectors' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'ListFlows' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appintegrations/2020-07-29/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2020-07-29', 'endpointPrefix' => 'app-integrations', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'Amazon AppIntegrations Service', 'serviceId' => 'AppIntegrations', 'signatureVersion' => 'v4', 'signingName' => 'app-integrations', 'uid' => 'appintegrations-2020-07-29', ], 'operations' => [ 'CreateDataIntegration' => [ 'name' => 'CreateDataIntegration', 'http' => [ 'method' => 'POST', 'requestUri' => '/dataIntegrations', ], 'input' => [ 'shape' => 'CreateDataIntegrationRequest', ], 'output' => [ 'shape' => 'CreateDataIntegrationResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceError', ], [ 'shape' => 'ResourceQuotaExceededException', ], [ 'shape' => 'DuplicateResourceException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'CreateEventIntegration' => [ 'name' => 'CreateEventIntegration', 'http' => [ 'method' => 'POST', 'requestUri' => '/eventIntegrations', ], 'input' => [ 'shape' => 'CreateEventIntegrationRequest', ], 'output' => [ 'shape' => 'CreateEventIntegrationResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceError', ], [ 'shape' => 'ResourceQuotaExceededException', ], [ 'shape' => 'DuplicateResourceException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'DeleteDataIntegration' => [ 'name' => 'DeleteDataIntegration', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/dataIntegrations/{Identifier}', ], 'input' => [ 'shape' => 'DeleteDataIntegrationRequest', ], 'output' => [ 'shape' => 'DeleteDataIntegrationResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceError', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'DeleteEventIntegration' => [ 'name' => 'DeleteEventIntegration', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/eventIntegrations/{Name}', ], 'input' => [ 'shape' => 'DeleteEventIntegrationRequest', ], 'output' => [ 'shape' => 'DeleteEventIntegrationResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceError', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetDataIntegration' => [ 'name' => 'GetDataIntegration', 'http' => [ 'method' => 'GET', 'requestUri' => '/dataIntegrations/{Identifier}', ], 'input' => [ 'shape' => 'GetDataIntegrationRequest', ], 'output' => [ 'shape' => 'GetDataIntegrationResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceError', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetEventIntegration' => [ 'name' => 'GetEventIntegration', 'http' => [ 'method' => 'GET', 'requestUri' => '/eventIntegrations/{Name}', ], 'input' => [ 'shape' => 'GetEventIntegrationRequest', ], 'output' => [ 'shape' => 'GetEventIntegrationResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceError', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListDataIntegrationAssociations' => [ 'name' => 'ListDataIntegrationAssociations', 'http' => [ 'method' => 'GET', 'requestUri' => '/dataIntegrations/{Identifier}/associations', ], 'input' => [ 'shape' => 'ListDataIntegrationAssociationsRequest', ], 'output' => [ 'shape' => 'ListDataIntegrationAssociationsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceError', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListDataIntegrations' => [ 'name' => 'ListDataIntegrations', 'http' => [ 'method' => 'GET', 'requestUri' => '/dataIntegrations', ], 'input' => [ 'shape' => 'ListDataIntegrationsRequest', ], 'output' => [ 'shape' => 'ListDataIntegrationsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceError', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListEventIntegrationAssociations' => [ 'name' => 'ListEventIntegrationAssociations', 'http' => [ 'method' => 'GET', 'requestUri' => '/eventIntegrations/{Name}/associations', ], 'input' => [ 'shape' => 'ListEventIntegrationAssociationsRequest', ], 'output' => [ 'shape' => 'ListEventIntegrationAssociationsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceError', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListEventIntegrations' => [ 'name' => 'ListEventIntegrations', 'http' => [ 'method' => 'GET', 'requestUri' => '/eventIntegrations', ], 'input' => [ 'shape' => 'ListEventIntegrationsRequest', ], 'output' => [ 'shape' => 'ListEventIntegrationsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceError', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags/{resourceArn}', ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceError', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags/{resourceArn}', ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceError', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/tags/{resourceArn}', ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceError', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'UpdateDataIntegration' => [ 'name' => 'UpdateDataIntegration', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/dataIntegrations/{Identifier}', ], 'input' => [ 'shape' => 'UpdateDataIntegrationRequest', ], 'output' => [ 'shape' => 'UpdateDataIntegrationResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceError', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'UpdateEventIntegration' => [ 'name' => 'UpdateEventIntegration', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/eventIntegrations/{Name}', ], 'input' => [ 'shape' => 'UpdateEventIntegrationRequest', ], 'output' => [ 'shape' => 'UpdateEventIntegrationResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceError', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'AccessDeniedException', ], ], ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'Message', ], ], 'error' => [ 'httpStatusCode' => 403, ], 'exception' => true, ], 'Arn' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, 'pattern' => '^arn:aws:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,1023}$', ], 'ClientAssociationMetadata' => [ 'type' => 'map', 'key' => [ 'shape' => 'NonBlankString', ], 'value' => [ 'shape' => 'NonBlankString', ], ], 'ClientId' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '.*', ], 'CreateDataIntegrationRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'KmsKey', 'SourceURI', 'ScheduleConfig', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'KmsKey' => [ 'shape' => 'NonBlankString', ], 'SourceURI' => [ 'shape' => 'SourceURI', ], 'ScheduleConfig' => [ 'shape' => 'ScheduleConfiguration', ], 'Tags' => [ 'shape' => 'TagMap', ], 'ClientToken' => [ 'shape' => 'IdempotencyToken', 'idempotencyToken' => true, ], 'FileConfiguration' => [ 'shape' => 'FileConfiguration', ], 'ObjectConfiguration' => [ 'shape' => 'ObjectConfiguration', ], ], ], 'CreateDataIntegrationResponse' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'Id' => [ 'shape' => 'UUID', ], 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'KmsKey' => [ 'shape' => 'NonBlankString', ], 'SourceURI' => [ 'shape' => 'SourceURI', ], 'ScheduleConfiguration' => [ 'shape' => 'ScheduleConfiguration', ], 'Tags' => [ 'shape' => 'TagMap', ], 'ClientToken' => [ 'shape' => 'IdempotencyToken', ], 'FileConfiguration' => [ 'shape' => 'FileConfiguration', ], 'ObjectConfiguration' => [ 'shape' => 'ObjectConfiguration', ], ], ], 'CreateEventIntegrationRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'EventFilter', 'EventBridgeBus', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'EventFilter' => [ 'shape' => 'EventFilter', ], 'EventBridgeBus' => [ 'shape' => 'EventBridgeBus', ], 'ClientToken' => [ 'shape' => 'IdempotencyToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagMap', ], ], ], 'CreateEventIntegrationResponse' => [ 'type' => 'structure', 'members' => [ 'EventIntegrationArn' => [ 'shape' => 'Arn', ], ], ], 'DataIntegrationAssociationSummary' => [ 'type' => 'structure', 'members' => [ 'DataIntegrationAssociationArn' => [ 'shape' => 'Arn', ], 'DataIntegrationArn' => [ 'shape' => 'Arn', ], 'ClientId' => [ 'shape' => 'ClientId', ], ], ], 'DataIntegrationAssociationsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DataIntegrationAssociationSummary', ], 'max' => 50, 'min' => 1, ], 'DataIntegrationSummary' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'Name', ], 'SourceURI' => [ 'shape' => 'SourceURI', ], ], ], 'DataIntegrationsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DataIntegrationSummary', ], 'max' => 50, 'min' => 1, ], 'DeleteDataIntegrationRequest' => [ 'type' => 'structure', 'required' => [ 'DataIntegrationIdentifier', ], 'members' => [ 'DataIntegrationIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'Identifier', ], ], ], 'DeleteDataIntegrationResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteEventIntegrationRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'Name', 'location' => 'uri', 'locationName' => 'Name', ], ], ], 'DeleteEventIntegrationResponse' => [ 'type' => 'structure', 'members' => [], ], 'Description' => [ 'type' => 'string', 'max' => 1000, 'min' => 1, 'pattern' => '.*', ], 'DuplicateResourceException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'Message', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'EventBridgeBus' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '^[a-zA-Z0-9\\\\/\\\\._\\\\-]+$', ], 'EventBridgeRuleName' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, 'pattern' => '^[a-zA-Z0-9\\\\/\\\\._\\\\-]+$', ], 'EventFilter' => [ 'type' => 'structure', 'required' => [ 'Source', ], 'members' => [ 'Source' => [ 'shape' => 'Source', ], ], ], 'EventIntegration' => [ 'type' => 'structure', 'members' => [ 'EventIntegrationArn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'EventFilter' => [ 'shape' => 'EventFilter', ], 'EventBridgeBus' => [ 'shape' => 'EventBridgeBus', ], 'Tags' => [ 'shape' => 'TagMap', ], ], ], 'EventIntegrationAssociation' => [ 'type' => 'structure', 'members' => [ 'EventIntegrationAssociationArn' => [ 'shape' => 'Arn', ], 'EventIntegrationAssociationId' => [ 'shape' => 'UUID', ], 'EventIntegrationName' => [ 'shape' => 'Name', ], 'ClientId' => [ 'shape' => 'ClientId', ], 'EventBridgeRuleName' => [ 'shape' => 'EventBridgeRuleName', ], 'ClientAssociationMetadata' => [ 'shape' => 'ClientAssociationMetadata', ], ], ], 'EventIntegrationAssociationsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'EventIntegrationAssociation', ], 'max' => 50, 'min' => 1, ], 'EventIntegrationsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'EventIntegration', ], 'max' => 50, 'min' => 1, ], 'Fields' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '^[a-zA-Z0-9\\\\/\\\\._\\\\-]+$', ], 'FieldsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Fields', ], 'max' => 2048, 'min' => 1, ], 'FieldsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'NonBlankString', ], 'value' => [ 'shape' => 'FieldsList', ], ], 'FileConfiguration' => [ 'type' => 'structure', 'required' => [ 'Folders', ], 'members' => [ 'Folders' => [ 'shape' => 'FolderList', ], 'Filters' => [ 'shape' => 'FieldsMap', ], ], ], 'FolderList' => [ 'type' => 'list', 'member' => [ 'shape' => 'NonBlankLongString', ], 'max' => 10, 'min' => 1, ], 'GetDataIntegrationRequest' => [ 'type' => 'structure', 'required' => [ 'Identifier', ], 'members' => [ 'Identifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'Identifier', ], ], ], 'GetDataIntegrationResponse' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'Id' => [ 'shape' => 'UUID', ], 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'KmsKey' => [ 'shape' => 'NonBlankString', ], 'SourceURI' => [ 'shape' => 'SourceURI', ], 'ScheduleConfiguration' => [ 'shape' => 'ScheduleConfiguration', ], 'Tags' => [ 'shape' => 'TagMap', ], 'FileConfiguration' => [ 'shape' => 'FileConfiguration', ], 'ObjectConfiguration' => [ 'shape' => 'ObjectConfiguration', ], ], ], 'GetEventIntegrationRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'Name', 'location' => 'uri', 'locationName' => 'Name', ], ], ], 'GetEventIntegrationResponse' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'EventIntegrationArn' => [ 'shape' => 'Arn', ], 'EventBridgeBus' => [ 'shape' => 'EventBridgeBus', ], 'EventFilter' => [ 'shape' => 'EventFilter', ], 'Tags' => [ 'shape' => 'TagMap', ], ], ], 'IdempotencyToken' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, 'pattern' => '.*', ], 'Identifier' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '.*\\\\S.*', ], 'InternalServiceError' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'Message', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'InvalidRequestException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'Message', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ListDataIntegrationAssociationsRequest' => [ 'type' => 'structure', 'required' => [ 'DataIntegrationIdentifier', ], 'members' => [ 'DataIntegrationIdentifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'Identifier', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListDataIntegrationAssociationsResponse' => [ 'type' => 'structure', 'members' => [ 'DataIntegrationAssociations' => [ 'shape' => 'DataIntegrationAssociationsList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListDataIntegrationsRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListDataIntegrationsResponse' => [ 'type' => 'structure', 'members' => [ 'DataIntegrations' => [ 'shape' => 'DataIntegrationsList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListEventIntegrationAssociationsRequest' => [ 'type' => 'structure', 'required' => [ 'EventIntegrationName', ], 'members' => [ 'EventIntegrationName' => [ 'shape' => 'Name', 'location' => 'uri', 'locationName' => 'Name', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListEventIntegrationAssociationsResponse' => [ 'type' => 'structure', 'members' => [ 'EventIntegrationAssociations' => [ 'shape' => 'EventIntegrationAssociationsList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListEventIntegrationsRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListEventIntegrationsResponse' => [ 'type' => 'structure', 'members' => [ 'EventIntegrations' => [ 'shape' => 'EventIntegrationsList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', ], 'members' => [ 'resourceArn' => [ 'shape' => 'Arn', 'location' => 'uri', 'locationName' => 'resourceArn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'tags' => [ 'shape' => 'TagMap', ], ], ], 'MaxResults' => [ 'type' => 'integer', 'max' => 50, 'min' => 1, ], 'Message' => [ 'type' => 'string', ], 'Name' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '^[a-zA-Z0-9\\\\/\\\\._\\\\-]+$', ], 'NextToken' => [ 'type' => 'string', 'max' => 1000, 'min' => 1, 'pattern' => '.*', ], 'NonBlankLongString' => [ 'type' => 'string', 'max' => 200, 'min' => 1, 'pattern' => '.*\\\\S.*', ], 'NonBlankString' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '.*\\\\S.*', ], 'Object' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '^[a-zA-Z0-9\\\\/\\\\._\\\\-]+$', ], 'ObjectConfiguration' => [ 'type' => 'map', 'key' => [ 'shape' => 'NonBlankString', ], 'value' => [ 'shape' => 'FieldsMap', ], ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'Message', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'ResourceQuotaExceededException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'Message', ], ], 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], 'ScheduleConfiguration' => [ 'type' => 'structure', 'required' => [ 'ScheduleExpression', ], 'members' => [ 'FirstExecutionFrom' => [ 'shape' => 'NonBlankString', ], 'Object' => [ 'shape' => 'Object', ], 'ScheduleExpression' => [ 'shape' => 'NonBlankString', ], ], ], 'Source' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '^aws\\\\.partner\\\\/.*$', ], 'SourceURI' => [ 'type' => 'string', 'max' => 1000, 'min' => 1, 'pattern' => '^(\\\\w+\\\\:\\\\/\\\\/[\\\\w.-]+[\\\\w/!@#+=.-]+$)|(\\\\w+\\\\:\\\\/\\\\/[\\\\w.-]+[\\\\w/!@#+=.-]+[\\\\w/!@#+=.-]+[\\\\w/!@#+=.,-]+$)', ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^(?!aws:)[a-zA-Z+-=._:/]+$', ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 200, 'min' => 1, ], 'TagMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'TagKey', ], 'value' => [ 'shape' => 'TagValue', ], 'max' => 200, 'min' => 1, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tags', ], 'members' => [ 'resourceArn' => [ 'shape' => 'Arn', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, ], 'ThrottlingException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'Message', ], ], 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], 'UUID' => [ 'type' => 'string', 'pattern' => '[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}', ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tagKeys', ], 'members' => [ 'resourceArn' => [ 'shape' => 'Arn', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tagKeys' => [ 'shape' => 'TagKeyList', 'location' => 'querystring', 'locationName' => 'tagKeys', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateDataIntegrationRequest' => [ 'type' => 'structure', 'required' => [ 'Identifier', ], 'members' => [ 'Identifier' => [ 'shape' => 'Identifier', 'location' => 'uri', 'locationName' => 'Identifier', ], 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], ], ], 'UpdateDataIntegrationResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateEventIntegrationRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'Name', 'location' => 'uri', 'locationName' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], ], ], 'UpdateEventIntegrationResponse' => [ 'type' => 'structure', 'members' => [], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appintegrations/2020-07-29/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>The Amazon AppIntegrations service enables you to configure and reuse connections to external applications.</p> <p>For information about how you can use external applications with Amazon Connect, see <a href=\"https://docs.aws.amazon.com/connect/latest/adminguide/crm.html\">Set up pre-built integrations</a> and <a href=\"https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-wisdom.html\">Deliver information to agents using Amazon Connect Wisdom</a> in the <i>Amazon Connect Administrator Guide</i>.</p>', 'operations' => [ 'CreateDataIntegration' => '<p>Creates and persists a DataIntegration resource.</p> <note> <p>You cannot create a DataIntegration association for a DataIntegration that has been previously associated. Use a different DataIntegration, or recreate the DataIntegration using the <code>CreateDataIntegration</code> API.</p> </note>', 'CreateEventIntegration' => '<p>Creates an EventIntegration, given a specified name, description, and a reference to an Amazon EventBridge bus in your account and a partner event source that pushes events to that bus. No objects are created in the your account, only metadata that is persisted on the EventIntegration control plane.</p>', 'DeleteDataIntegration' => '<p>Deletes the DataIntegration. Only DataIntegrations that don\\'t have any DataIntegrationAssociations can be deleted. Deleting a DataIntegration also deletes the underlying Amazon AppFlow flow and service linked role. </p> <note> <p>You cannot create a DataIntegration association for a DataIntegration that has been previously associated. Use a different DataIntegration, or recreate the DataIntegration using the <a href=\"https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html\">CreateDataIntegration</a> API.</p> </note>', 'DeleteEventIntegration' => '<p>Deletes the specified existing event integration. If the event integration is associated with clients, the request is rejected.</p>', 'GetDataIntegration' => '<p>Returns information about the DataIntegration.</p> <note> <p>You cannot create a DataIntegration association for a DataIntegration that has been previously associated. Use a different DataIntegration, or recreate the DataIntegration using the <a href=\"https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html\">CreateDataIntegration</a> API.</p> </note>', 'GetEventIntegration' => '<p>Returns information about the event integration.</p>', 'ListDataIntegrationAssociations' => '<p>Returns a paginated list of DataIntegration associations in the account.</p> <note> <p>You cannot create a DataIntegration association for a DataIntegration that has been previously associated. Use a different DataIntegration, or recreate the DataIntegration using the <a href=\"https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html\">CreateDataIntegration</a> API.</p> </note>', 'ListDataIntegrations' => '<p>Returns a paginated list of DataIntegrations in the account.</p> <note> <p>You cannot create a DataIntegration association for a DataIntegration that has been previously associated. Use a different DataIntegration, or recreate the DataIntegration using the <a href=\"https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html\">CreateDataIntegration</a> API.</p> </note>', 'ListEventIntegrationAssociations' => '<p>Returns a paginated list of event integration associations in the account. </p>', 'ListEventIntegrations' => '<p>Returns a paginated list of event integrations in the account.</p>', 'ListTagsForResource' => '<p>Lists the tags for the specified resource.</p>', 'TagResource' => '<p>Adds the specified tags to the specified resource.</p>', 'UntagResource' => '<p>Removes the specified tags from the specified resource.</p>', 'UpdateDataIntegration' => '<p>Updates the description of a DataIntegration.</p> <note> <p>You cannot create a DataIntegration association for a DataIntegration that has been previously associated. Use a different DataIntegration, or recreate the DataIntegration using the <a href=\"https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html\">CreateDataIntegration</a> API.</p> </note>', 'UpdateEventIntegration' => '<p>Updates the description of an event integration.</p>', ], 'shapes' => [ 'AccessDeniedException' => [ 'base' => '<p>You do not have sufficient access to perform this action.</p>', 'refs' => [], ], 'Arn' => [ 'base' => NULL, 'refs' => [ 'CreateDataIntegrationResponse$Arn' => '<p>The Amazon Resource Name (ARN)</p>', 'CreateEventIntegrationResponse$EventIntegrationArn' => '<p>The Amazon Resource Name (ARN) of the event integration. </p>', 'DataIntegrationAssociationSummary$DataIntegrationAssociationArn' => '<p>The Amazon Resource Name (ARN) of the DataIntegration association.</p>', 'DataIntegrationAssociationSummary$DataIntegrationArn' => '<p>The Amazon Resource Name (ARN) of the DataIntegration.</p>', 'DataIntegrationSummary$Arn' => '<p>The Amazon Resource Name (ARN) of the DataIntegration.</p>', 'EventIntegration$EventIntegrationArn' => '<p>The Amazon Resource Name (ARN) of the event integration.</p>', 'EventIntegrationAssociation$EventIntegrationAssociationArn' => '<p>The Amazon Resource Name (ARN) for the event integration association.</p>', 'GetDataIntegrationResponse$Arn' => '<p>The Amazon Resource Name (ARN) for the DataIntegration.</p>', 'GetEventIntegrationResponse$EventIntegrationArn' => '<p>The Amazon Resource Name (ARN) for the event integration.</p>', 'ListTagsForResourceRequest$resourceArn' => '<p>The Amazon Resource Name (ARN) of the resource. </p>', 'TagResourceRequest$resourceArn' => '<p>The Amazon Resource Name (ARN) of the resource.</p>', 'UntagResourceRequest$resourceArn' => '<p>The Amazon Resource Name (ARN) of the resource.</p>', ], ], 'ClientAssociationMetadata' => [ 'base' => NULL, 'refs' => [ 'EventIntegrationAssociation$ClientAssociationMetadata' => '<p>The metadata associated with the client.</p>', ], ], 'ClientId' => [ 'base' => NULL, 'refs' => [ 'DataIntegrationAssociationSummary$ClientId' => '<p>The identifier for the client that is associated with the DataIntegration association.</p>', 'EventIntegrationAssociation$ClientId' => '<p>The identifier for the client that is associated with the event integration.</p>', ], ], 'CreateDataIntegrationRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateDataIntegrationResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateEventIntegrationRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateEventIntegrationResponse' => [ 'base' => NULL, 'refs' => [], ], 'DataIntegrationAssociationSummary' => [ 'base' => '<p>Summary information about the DataIntegration association.</p>', 'refs' => [ 'DataIntegrationAssociationsList$member' => NULL, ], ], 'DataIntegrationAssociationsList' => [ 'base' => NULL, 'refs' => [ 'ListDataIntegrationAssociationsResponse$DataIntegrationAssociations' => '<p>The Amazon Resource Name (ARN) and unique ID of the DataIntegration association.</p>', ], ], 'DataIntegrationSummary' => [ 'base' => '<p>Summary information about the DataIntegration.</p>', 'refs' => [ 'DataIntegrationsList$member' => NULL, ], ], 'DataIntegrationsList' => [ 'base' => NULL, 'refs' => [ 'ListDataIntegrationsResponse$DataIntegrations' => '<p>The DataIntegrations associated with this account.</p>', ], ], 'DeleteDataIntegrationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteDataIntegrationResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteEventIntegrationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteEventIntegrationResponse' => [ 'base' => NULL, 'refs' => [], ], 'Description' => [ 'base' => NULL, 'refs' => [ 'CreateDataIntegrationRequest$Description' => '<p>A description of the DataIntegration.</p>', 'CreateDataIntegrationResponse$Description' => '<p>A description of the DataIntegration.</p>', 'CreateEventIntegrationRequest$Description' => '<p>The description of the event integration.</p>', 'EventIntegration$Description' => '<p>The event integration description.</p>', 'GetDataIntegrationResponse$Description' => '<p>The KMS key for the DataIntegration.</p>', 'GetEventIntegrationResponse$Description' => '<p>The description of the event integration.</p>', 'UpdateDataIntegrationRequest$Description' => '<p>A description of the DataIntegration.</p>', 'UpdateEventIntegrationRequest$Description' => '<p>The description of the event inegration.</p>', ], ], 'DuplicateResourceException' => [ 'base' => '<p>A resource with the specified name already exists.</p>', 'refs' => [], ], 'EventBridgeBus' => [ 'base' => NULL, 'refs' => [ 'CreateEventIntegrationRequest$EventBridgeBus' => '<p>The EventBridge bus.</p>', 'EventIntegration$EventBridgeBus' => '<p>The Amazon EventBridge bus for the event integration.</p>', 'GetEventIntegrationResponse$EventBridgeBus' => '<p>The EventBridge bus.</p>', ], ], 'EventBridgeRuleName' => [ 'base' => NULL, 'refs' => [ 'EventIntegrationAssociation$EventBridgeRuleName' => '<p>The name of the EventBridge rule.</p>', ], ], 'EventFilter' => [ 'base' => '<p>The event filter.</p>', 'refs' => [ 'CreateEventIntegrationRequest$EventFilter' => '<p>The event filter.</p>', 'EventIntegration$EventFilter' => '<p>The event integration filter.</p>', 'GetEventIntegrationResponse$EventFilter' => '<p>The event filter.</p>', ], ], 'EventIntegration' => [ 'base' => '<p>The event integration.</p>', 'refs' => [ 'EventIntegrationsList$member' => NULL, ], ], 'EventIntegrationAssociation' => [ 'base' => '<p>The event integration association.</p>', 'refs' => [ 'EventIntegrationAssociationsList$member' => NULL, ], ], 'EventIntegrationAssociationsList' => [ 'base' => NULL, 'refs' => [ 'ListEventIntegrationAssociationsResponse$EventIntegrationAssociations' => '<p>The event integration associations.</p>', ], ], 'EventIntegrationsList' => [ 'base' => NULL, 'refs' => [ 'ListEventIntegrationsResponse$EventIntegrations' => '<p>The event integrations.</p>', ], ], 'Fields' => [ 'base' => NULL, 'refs' => [ 'FieldsList$member' => NULL, ], ], 'FieldsList' => [ 'base' => NULL, 'refs' => [ 'FieldsMap$value' => NULL, ], ], 'FieldsMap' => [ 'base' => NULL, 'refs' => [ 'FileConfiguration$Filters' => '<p>Restrictions for what files should be pulled from the source.</p>', 'ObjectConfiguration$value' => NULL, ], ], 'FileConfiguration' => [ 'base' => '<p>The configuration for what files should be pulled from the source.</p>', 'refs' => [ 'CreateDataIntegrationRequest$FileConfiguration' => '<p>The configuration for what files should be pulled from the source.</p>', 'CreateDataIntegrationResponse$FileConfiguration' => '<p>The configuration for what files should be pulled from the source.</p>', 'GetDataIntegrationResponse$FileConfiguration' => '<p>The configuration for what files should be pulled from the source.</p>', ], ], 'FolderList' => [ 'base' => NULL, 'refs' => [ 'FileConfiguration$Folders' => '<p>Identifiers for the source folders to pull all files from recursively.</p>', ], ], 'GetDataIntegrationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetDataIntegrationResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetEventIntegrationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetEventIntegrationResponse' => [ 'base' => NULL, 'refs' => [], ], 'IdempotencyToken' => [ 'base' => NULL, 'refs' => [ 'CreateDataIntegrationRequest$ClientToken' => '<p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href=\"https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/\">Making retries safe with idempotent APIs</a>.</p>', 'CreateDataIntegrationResponse$ClientToken' => '<p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href=\"https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/\">Making retries safe with idempotent APIs</a>.</p>', 'CreateEventIntegrationRequest$ClientToken' => '<p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href=\"https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/\">Making retries safe with idempotent APIs</a>.</p>', ], ], 'Identifier' => [ 'base' => NULL, 'refs' => [ 'DeleteDataIntegrationRequest$DataIntegrationIdentifier' => '<p>A unique identifier for the DataIntegration.</p>', 'GetDataIntegrationRequest$Identifier' => '<p>A unique identifier.</p>', 'ListDataIntegrationAssociationsRequest$DataIntegrationIdentifier' => '<p>A unique identifier for the DataIntegration.</p>', 'UpdateDataIntegrationRequest$Identifier' => '<p>A unique identifier for the DataIntegration.</p>', ], ], 'InternalServiceError' => [ 'base' => '<p>Request processing failed due to an error or failure with the service.</p>', 'refs' => [], ], 'InvalidRequestException' => [ 'base' => '<p>The request is not valid. </p>', 'refs' => [], ], 'ListDataIntegrationAssociationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListDataIntegrationAssociationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListDataIntegrationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListDataIntegrationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListEventIntegrationAssociationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListEventIntegrationAssociationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListEventIntegrationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListEventIntegrationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'ListDataIntegrationAssociationsRequest$MaxResults' => '<p>The maximum number of results to return per page.</p>', 'ListDataIntegrationsRequest$MaxResults' => '<p>The maximum number of results to return per page.</p>', 'ListEventIntegrationAssociationsRequest$MaxResults' => '<p>The maximum number of results to return per page.</p>', 'ListEventIntegrationsRequest$MaxResults' => '<p>The maximum number of results to return per page.</p>', ], ], 'Message' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$Message' => NULL, 'DuplicateResourceException$Message' => NULL, 'InternalServiceError$Message' => NULL, 'InvalidRequestException$Message' => NULL, 'ResourceNotFoundException$Message' => NULL, 'ResourceQuotaExceededException$Message' => NULL, 'ThrottlingException$Message' => NULL, ], ], 'Name' => [ 'base' => NULL, 'refs' => [ 'CreateDataIntegrationRequest$Name' => '<p>The name of the DataIntegration.</p>', 'CreateDataIntegrationResponse$Name' => '<p>The name of the DataIntegration.</p>', 'CreateEventIntegrationRequest$Name' => '<p>The name of the event integration.</p>', 'DataIntegrationSummary$Name' => '<p>The name of the DataIntegration.</p>', 'DeleteEventIntegrationRequest$Name' => '<p>The name of the event integration.</p>', 'EventIntegration$Name' => '<p>The name of the event integration.</p>', 'EventIntegrationAssociation$EventIntegrationName' => '<p>The name of the event integration.</p>', 'GetDataIntegrationResponse$Name' => '<p>The name of the DataIntegration.</p>', 'GetEventIntegrationRequest$Name' => '<p>The name of the event integration. </p>', 'GetEventIntegrationResponse$Name' => '<p>The name of the event integration. </p>', 'ListEventIntegrationAssociationsRequest$EventIntegrationName' => '<p>The name of the event integration. </p>', 'UpdateDataIntegrationRequest$Name' => '<p>The name of the DataIntegration.</p>', 'UpdateEventIntegrationRequest$Name' => '<p>The name of the event integration.</p>', ], ], 'NextToken' => [ 'base' => NULL, 'refs' => [ 'ListDataIntegrationAssociationsRequest$NextToken' => '<p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>', 'ListDataIntegrationAssociationsResponse$NextToken' => '<p>If there are additional results, this is the token for the next set of results.</p>', 'ListDataIntegrationsRequest$NextToken' => '<p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>', 'ListDataIntegrationsResponse$NextToken' => '<p>If there are additional results, this is the token for the next set of results.</p>', 'ListEventIntegrationAssociationsRequest$NextToken' => '<p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>', 'ListEventIntegrationAssociationsResponse$NextToken' => '<p>If there are additional results, this is the token for the next set of results.</p>', 'ListEventIntegrationsRequest$NextToken' => '<p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>', 'ListEventIntegrationsResponse$NextToken' => '<p>If there are additional results, this is the token for the next set of results.</p>', ], ], 'NonBlankLongString' => [ 'base' => NULL, 'refs' => [ 'FolderList$member' => NULL, ], ], 'NonBlankString' => [ 'base' => NULL, 'refs' => [ 'ClientAssociationMetadata$key' => NULL, 'ClientAssociationMetadata$value' => NULL, 'CreateDataIntegrationRequest$KmsKey' => '<p>The KMS key for the DataIntegration.</p>', 'CreateDataIntegrationResponse$KmsKey' => '<p>The KMS key for the DataIntegration.</p>', 'FieldsMap$key' => NULL, 'GetDataIntegrationResponse$KmsKey' => '<p>The KMS key for the DataIntegration.</p>', 'ObjectConfiguration$key' => NULL, 'ScheduleConfiguration$FirstExecutionFrom' => '<p>The start date for objects to import in the first flow run as an Unix/epoch timestamp in milliseconds or in ISO-8601 format.</p>', 'ScheduleConfiguration$ScheduleExpression' => '<p>How often the data should be pulled from data source.</p>', ], ], 'Object' => [ 'base' => NULL, 'refs' => [ 'ScheduleConfiguration$Object' => '<p>The name of the object to pull from the data source.</p>', ], ], 'ObjectConfiguration' => [ 'base' => '<p>The configuration for what data should be pulled from the source.</p>', 'refs' => [ 'CreateDataIntegrationRequest$ObjectConfiguration' => '<p>The configuration for what data should be pulled from the source.</p>', 'CreateDataIntegrationResponse$ObjectConfiguration' => '<p>The configuration for what data should be pulled from the source.</p>', 'GetDataIntegrationResponse$ObjectConfiguration' => '<p>The configuration for what data should be pulled from the source.</p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p>The specified resource was not found.</p>', 'refs' => [], ], 'ResourceQuotaExceededException' => [ 'base' => '<p>The allowed quota for the resource has been exceeded.</p>', 'refs' => [], ], 'ScheduleConfiguration' => [ 'base' => '<p>The name of the data and how often it should be pulled from the source.</p>', 'refs' => [ 'CreateDataIntegrationRequest$ScheduleConfig' => '<p>The name of the data and how often it should be pulled from the source.</p>', 'CreateDataIntegrationResponse$ScheduleConfiguration' => '<p>The name of the data and how often it should be pulled from the source.</p>', 'GetDataIntegrationResponse$ScheduleConfiguration' => '<p>The name of the data and how often it should be pulled from the source.</p>', ], ], 'Source' => [ 'base' => NULL, 'refs' => [ 'EventFilter$Source' => '<p>The source of the events.</p>', ], ], 'SourceURI' => [ 'base' => NULL, 'refs' => [ 'CreateDataIntegrationRequest$SourceURI' => '<p>The URI of the data source.</p>', 'CreateDataIntegrationResponse$SourceURI' => '<p>The URI of the data source.</p>', 'DataIntegrationSummary$SourceURI' => '<p>The URI of the data source.</p>', 'GetDataIntegrationResponse$SourceURI' => '<p>The URI of the data source.</p>', ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'TagKeyList$member' => NULL, 'TagMap$key' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$tagKeys' => '<p>The tag keys.</p>', ], ], 'TagMap' => [ 'base' => NULL, 'refs' => [ 'CreateDataIntegrationRequest$Tags' => '<p>The tags used to organize, track, or control access for this resource. For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.</p>', 'CreateDataIntegrationResponse$Tags' => '<p>The tags used to organize, track, or control access for this resource. For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.</p>', 'CreateEventIntegrationRequest$Tags' => '<p>The tags used to organize, track, or control access for this resource. For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.</p>', 'EventIntegration$Tags' => '<p>The tags used to organize, track, or control access for this resource. For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.</p>', 'GetDataIntegrationResponse$Tags' => '<p>The tags used to organize, track, or control access for this resource. For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.</p>', 'GetEventIntegrationResponse$Tags' => '<p>The tags used to organize, track, or control access for this resource. For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.</p>', 'ListTagsForResourceResponse$tags' => '<p>Information about the tags.</p>', 'TagResourceRequest$tags' => '<p>The tags used to organize, track, or control access for this resource. For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.</p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'TagMap$value' => NULL, ], ], 'ThrottlingException' => [ 'base' => '<p>The throttling limit has been exceeded.</p>', 'refs' => [], ], 'UUID' => [ 'base' => NULL, 'refs' => [ 'CreateDataIntegrationResponse$Id' => '<p>A unique identifier.</p>', 'EventIntegrationAssociation$EventIntegrationAssociationId' => '<p>The identifier for the event integration association.</p>', 'GetDataIntegrationResponse$Id' => '<p>A unique identifier.</p>', ], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateDataIntegrationRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateDataIntegrationResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateEventIntegrationRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateEventIntegrationResponse' => [ 'base' => NULL, 'refs' => [], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appintegrations/2020-07-29/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://app-integrations-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://app-integrations-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://app-integrations.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://app-integrations.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appintegrations/2020-07-29/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://app-integrations.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appintegrations/2020-07-29/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appintegrations/2020-07-29/paginators-1.json\nreturn [ 'pagination' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/application-autoscaling/2016-02-06/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2016-02-06', 'endpointPrefix' => 'application-autoscaling', 'jsonVersion' => '1.1', 'protocol' => 'json', 'serviceFullName' => 'Application Auto Scaling', 'serviceId' => 'Application Auto Scaling', 'signatureVersion' => 'v4', 'signingName' => 'application-autoscaling', 'targetPrefix' => 'AnyScaleFrontendService', 'uid' => 'application-autoscaling-2016-02-06', ], 'operations' => [ 'DeleteScalingPolicy' => [ 'name' => 'DeleteScalingPolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteScalingPolicyRequest', ], 'output' => [ 'shape' => 'DeleteScalingPolicyResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ObjectNotFoundException', ], [ 'shape' => 'ConcurrentUpdateException', ], [ 'shape' => 'InternalServiceException', ], ], ], 'DeleteScheduledAction' => [ 'name' => 'DeleteScheduledAction', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteScheduledActionRequest', ], 'output' => [ 'shape' => 'DeleteScheduledActionResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ObjectNotFoundException', ], [ 'shape' => 'ConcurrentUpdateException', ], [ 'shape' => 'InternalServiceException', ], ], ], 'DeregisterScalableTarget' => [ 'name' => 'DeregisterScalableTarget', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeregisterScalableTargetRequest', ], 'output' => [ 'shape' => 'DeregisterScalableTargetResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ObjectNotFoundException', ], [ 'shape' => 'ConcurrentUpdateException', ], [ 'shape' => 'InternalServiceException', ], ], ], 'DescribeScalableTargets' => [ 'name' => 'DescribeScalableTargets', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeScalableTargetsRequest', ], 'output' => [ 'shape' => 'DescribeScalableTargetsResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ConcurrentUpdateException', ], [ 'shape' => 'InternalServiceException', ], ], ], 'DescribeScalingActivities' => [ 'name' => 'DescribeScalingActivities', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeScalingActivitiesRequest', ], 'output' => [ 'shape' => 'DescribeScalingActivitiesResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ConcurrentUpdateException', ], [ 'shape' => 'InternalServiceException', ], ], ], 'DescribeScalingPolicies' => [ 'name' => 'DescribeScalingPolicies', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeScalingPoliciesRequest', ], 'output' => [ 'shape' => 'DescribeScalingPoliciesResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'FailedResourceAccessException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ConcurrentUpdateException', ], [ 'shape' => 'InternalServiceException', ], ], ], 'DescribeScheduledActions' => [ 'name' => 'DescribeScheduledActions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeScheduledActionsRequest', ], 'output' => [ 'shape' => 'DescribeScheduledActionsResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ConcurrentUpdateException', ], [ 'shape' => 'InternalServiceException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], ], ], 'PutScalingPolicy' => [ 'name' => 'PutScalingPolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutScalingPolicyRequest', ], 'output' => [ 'shape' => 'PutScalingPolicyResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ObjectNotFoundException', ], [ 'shape' => 'ConcurrentUpdateException', ], [ 'shape' => 'FailedResourceAccessException', ], [ 'shape' => 'InternalServiceException', ], ], ], 'PutScheduledAction' => [ 'name' => 'PutScheduledAction', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutScheduledActionRequest', ], 'output' => [ 'shape' => 'PutScheduledActionResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ObjectNotFoundException', ], [ 'shape' => 'ConcurrentUpdateException', ], [ 'shape' => 'InternalServiceException', ], ], ], 'RegisterScalableTarget' => [ 'name' => 'RegisterScalableTarget', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'RegisterScalableTargetRequest', ], 'output' => [ 'shape' => 'RegisterScalableTargetResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ConcurrentUpdateException', ], [ 'shape' => 'InternalServiceException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'TooManyTagsException', ], [ 'shape' => 'ValidationException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], ], ], ], 'shapes' => [ 'AdjustmentType' => [ 'type' => 'string', 'enum' => [ 'ChangeInCapacity', 'PercentChangeInCapacity', 'ExactCapacity', ], ], 'Alarm' => [ 'type' => 'structure', 'required' => [ 'AlarmName', 'AlarmARN', ], 'members' => [ 'AlarmName' => [ 'shape' => 'ResourceId', ], 'AlarmARN' => [ 'shape' => 'ResourceId', ], ], ], 'Alarms' => [ 'type' => 'list', 'member' => [ 'shape' => 'Alarm', ], ], 'AmazonResourceName' => [ 'type' => 'string', 'max' => 1011, 'min' => 1, 'pattern' => '^arn:.+:application-autoscaling:.+:[0-9]+:scalable-target\\\\/[a-zA-Z0-9-]+$', ], 'ConcurrentUpdateException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'Cooldown' => [ 'type' => 'integer', ], 'CustomizedMetricSpecification' => [ 'type' => 'structure', 'members' => [ 'MetricName' => [ 'shape' => 'MetricName', ], 'Namespace' => [ 'shape' => 'MetricNamespace', ], 'Dimensions' => [ 'shape' => 'MetricDimensions', ], 'Statistic' => [ 'shape' => 'MetricStatistic', ], 'Unit' => [ 'shape' => 'MetricUnit', ], 'Metrics' => [ 'shape' => 'TargetTrackingMetricDataQueries', ], ], ], 'DeleteScalingPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'PolicyName', 'ServiceNamespace', 'ResourceId', 'ScalableDimension', ], 'members' => [ 'PolicyName' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'ResourceId' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], ], ], 'DeleteScalingPolicyResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteScheduledActionRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceNamespace', 'ScheduledActionName', 'ResourceId', 'ScalableDimension', ], 'members' => [ 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'ScheduledActionName' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ResourceId' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], ], ], 'DeleteScheduledActionResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeregisterScalableTargetRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceNamespace', 'ResourceId', 'ScalableDimension', ], 'members' => [ 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'ResourceId' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], ], ], 'DeregisterScalableTargetResponse' => [ 'type' => 'structure', 'members' => [], ], 'DescribeScalableTargetsRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceNamespace', ], 'members' => [ 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'ResourceIds' => [ 'shape' => 'ResourceIdsMaxLen1600', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'DescribeScalableTargetsResponse' => [ 'type' => 'structure', 'members' => [ 'ScalableTargets' => [ 'shape' => 'ScalableTargets', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'DescribeScalingActivitiesRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceNamespace', ], 'members' => [ 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'ResourceId' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'XmlString', ], 'IncludeNotScaledActivities' => [ 'shape' => 'IncludeNotScaledActivities', ], ], ], 'DescribeScalingActivitiesResponse' => [ 'type' => 'structure', 'members' => [ 'ScalingActivities' => [ 'shape' => 'ScalingActivities', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'DescribeScalingPoliciesRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceNamespace', ], 'members' => [ 'PolicyNames' => [ 'shape' => 'ResourceIdsMaxLen1600', ], 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'ResourceId' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'DescribeScalingPoliciesResponse' => [ 'type' => 'structure', 'members' => [ 'ScalingPolicies' => [ 'shape' => 'ScalingPolicies', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'DescribeScheduledActionsRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceNamespace', ], 'members' => [ 'ScheduledActionNames' => [ 'shape' => 'ResourceIdsMaxLen1600', ], 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'ResourceId' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'DescribeScheduledActionsResponse' => [ 'type' => 'structure', 'members' => [ 'ScheduledActions' => [ 'shape' => 'ScheduledActions', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'DisableScaleIn' => [ 'type' => 'boolean', ], 'ErrorMessage' => [ 'type' => 'string', ], 'ExceptionMessage' => [ 'type' => 'string', ], 'Expression' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'FailedResourceAccessException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'Id' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'IncludeNotScaledActivities' => [ 'type' => 'boolean', ], 'InternalServiceException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'InvalidNextTokenException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'AmazonResourceName', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagMap', ], ], ], 'MaxResults' => [ 'type' => 'integer', ], 'MetricAggregationType' => [ 'type' => 'string', 'enum' => [ 'Average', 'Minimum', 'Maximum', ], ], 'MetricDimension' => [ 'type' => 'structure', 'required' => [ 'Name', 'Value', ], 'members' => [ 'Name' => [ 'shape' => 'MetricDimensionName', ], 'Value' => [ 'shape' => 'MetricDimensionValue', ], ], ], 'MetricDimensionName' => [ 'type' => 'string', ], 'MetricDimensionValue' => [ 'type' => 'string', ], 'MetricDimensions' => [ 'type' => 'list', 'member' => [ 'shape' => 'MetricDimension', ], ], 'MetricName' => [ 'type' => 'string', ], 'MetricNamespace' => [ 'type' => 'string', ], 'MetricScale' => [ 'type' => 'double', ], 'MetricStatistic' => [ 'type' => 'string', 'enum' => [ 'Average', 'Minimum', 'Maximum', 'SampleCount', 'Sum', ], ], 'MetricType' => [ 'type' => 'string', 'enum' => [ 'DynamoDBReadCapacityUtilization', 'DynamoDBWriteCapacityUtilization', 'ALBRequestCountPerTarget', 'RDSReaderAverageCPUUtilization', 'RDSReaderAverageDatabaseConnections', 'EC2SpotFleetRequestAverageCPUUtilization', 'EC2SpotFleetRequestAverageNetworkIn', 'EC2SpotFleetRequestAverageNetworkOut', 'SageMakerVariantInvocationsPerInstance', 'ECSServiceAverageCPUUtilization', 'ECSServiceAverageMemoryUtilization', 'AppStreamAverageCapacityUtilization', 'ComprehendInferenceUtilization', 'LambdaProvisionedConcurrencyUtilization', 'CassandraReadCapacityUtilization', 'CassandraWriteCapacityUtilization', 'KafkaBrokerStorageUtilization', 'ElastiCachePrimaryEngineCPUUtilization', 'ElastiCacheReplicaEngineCPUUtilization', 'ElastiCacheDatabaseMemoryUsageCountedForEvictPercentage', 'NeptuneReaderAverageCPUUtilization', 'SageMakerVariantProvisionedConcurrencyUtilization', 'ElastiCacheDatabaseCapacityUsageCountedForEvictPercentage', ], ], 'MetricUnit' => [ 'type' => 'string', ], 'MinAdjustmentMagnitude' => [ 'type' => 'integer', ], 'NotScaledReason' => [ 'type' => 'structure', 'required' => [ 'Code', ], 'members' => [ 'Code' => [ 'shape' => 'XmlString', ], 'MaxCapacity' => [ 'shape' => 'ResourceCapacity', ], 'MinCapacity' => [ 'shape' => 'ResourceCapacity', ], 'CurrentCapacity' => [ 'shape' => 'ResourceCapacity', ], ], ], 'NotScaledReasons' => [ 'type' => 'list', 'member' => [ 'shape' => 'NotScaledReason', ], ], 'ObjectNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'PolicyName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '\\\\p{Print}+', ], 'PolicyType' => [ 'type' => 'string', 'enum' => [ 'StepScaling', 'TargetTrackingScaling', ], ], 'PredefinedMetricSpecification' => [ 'type' => 'structure', 'required' => [ 'PredefinedMetricType', ], 'members' => [ 'PredefinedMetricType' => [ 'shape' => 'MetricType', ], 'ResourceLabel' => [ 'shape' => 'ResourceLabel', ], ], ], 'PutScalingPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'PolicyName', 'ServiceNamespace', 'ResourceId', 'ScalableDimension', ], 'members' => [ 'PolicyName' => [ 'shape' => 'PolicyName', ], 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'ResourceId' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], 'PolicyType' => [ 'shape' => 'PolicyType', ], 'StepScalingPolicyConfiguration' => [ 'shape' => 'StepScalingPolicyConfiguration', ], 'TargetTrackingScalingPolicyConfiguration' => [ 'shape' => 'TargetTrackingScalingPolicyConfiguration', ], ], ], 'PutScalingPolicyResponse' => [ 'type' => 'structure', 'required' => [ 'PolicyARN', ], 'members' => [ 'PolicyARN' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'Alarms' => [ 'shape' => 'Alarms', ], ], ], 'PutScheduledActionRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceNamespace', 'ScheduledActionName', 'ResourceId', 'ScalableDimension', ], 'members' => [ 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'Schedule' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'Timezone' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ScheduledActionName' => [ 'shape' => 'ScheduledActionName', ], 'ResourceId' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], 'StartTime' => [ 'shape' => 'TimestampType', ], 'EndTime' => [ 'shape' => 'TimestampType', ], 'ScalableTargetAction' => [ 'shape' => 'ScalableTargetAction', ], ], ], 'PutScheduledActionResponse' => [ 'type' => 'structure', 'members' => [], ], 'RegisterScalableTargetRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceNamespace', 'ResourceId', 'ScalableDimension', ], 'members' => [ 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'ResourceId' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], 'MinCapacity' => [ 'shape' => 'ResourceCapacity', ], 'MaxCapacity' => [ 'shape' => 'ResourceCapacity', ], 'RoleARN' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'SuspendedState' => [ 'shape' => 'SuspendedState', ], 'Tags' => [ 'shape' => 'TagMap', ], ], ], 'RegisterScalableTargetResponse' => [ 'type' => 'structure', 'members' => [ 'ScalableTargetARN' => [ 'shape' => 'XmlString', ], ], ], 'ResourceCapacity' => [ 'type' => 'integer', ], 'ResourceId' => [ 'type' => 'string', 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'ResourceIdMaxLen1600' => [ 'type' => 'string', 'max' => 1600, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'ResourceIdsMaxLen1600' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'max' => 50, ], 'ResourceLabel' => [ 'type' => 'string', 'max' => 1023, 'min' => 1, ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], 'ResourceName' => [ 'shape' => 'AmazonResourceName', ], ], 'exception' => true, ], 'ReturnData' => [ 'type' => 'boolean', ], 'ScalableDimension' => [ 'type' => 'string', 'enum' => [ 'ecs:service:DesiredCount', 'ec2:spot-fleet-request:TargetCapacity', 'elasticmapreduce:instancegroup:InstanceCount', 'appstream:fleet:DesiredCapacity', 'dynamodb:table:ReadCapacityUnits', 'dynamodb:table:WriteCapacityUnits', 'dynamodb:index:ReadCapacityUnits', 'dynamodb:index:WriteCapacityUnits', 'rds:cluster:ReadReplicaCount', 'sagemaker:variant:DesiredInstanceCount', 'custom-resource:ResourceType:Property', 'comprehend:document-classifier-endpoint:DesiredInferenceUnits', 'comprehend:entity-recognizer-endpoint:DesiredInferenceUnits', 'lambda:function:ProvisionedConcurrency', 'cassandra:table:ReadCapacityUnits', 'cassandra:table:WriteCapacityUnits', 'kafka:broker-storage:VolumeSize', 'elasticache:replication-group:NodeGroups', 'elasticache:replication-group:Replicas', 'neptune:cluster:ReadReplicaCount', 'sagemaker:variant:DesiredProvisionedConcurrency', ], ], 'ScalableTarget' => [ 'type' => 'structure', 'required' => [ 'ServiceNamespace', 'ResourceId', 'ScalableDimension', 'MinCapacity', 'MaxCapacity', 'RoleARN', 'CreationTime', ], 'members' => [ 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'ResourceId' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], 'MinCapacity' => [ 'shape' => 'ResourceCapacity', ], 'MaxCapacity' => [ 'shape' => 'ResourceCapacity', ], 'RoleARN' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'CreationTime' => [ 'shape' => 'TimestampType', ], 'SuspendedState' => [ 'shape' => 'SuspendedState', ], 'ScalableTargetARN' => [ 'shape' => 'XmlString', ], ], ], 'ScalableTargetAction' => [ 'type' => 'structure', 'members' => [ 'MinCapacity' => [ 'shape' => 'ResourceCapacity', ], 'MaxCapacity' => [ 'shape' => 'ResourceCapacity', ], ], ], 'ScalableTargets' => [ 'type' => 'list', 'member' => [ 'shape' => 'ScalableTarget', ], ], 'ScalingActivities' => [ 'type' => 'list', 'member' => [ 'shape' => 'ScalingActivity', ], ], 'ScalingActivity' => [ 'type' => 'structure', 'required' => [ 'ActivityId', 'ServiceNamespace', 'ResourceId', 'ScalableDimension', 'Description', 'Cause', 'StartTime', 'StatusCode', ], 'members' => [ 'ActivityId' => [ 'shape' => 'ResourceId', ], 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'ResourceId' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], 'Description' => [ 'shape' => 'XmlString', ], 'Cause' => [ 'shape' => 'XmlString', ], 'StartTime' => [ 'shape' => 'TimestampType', ], 'EndTime' => [ 'shape' => 'TimestampType', ], 'StatusCode' => [ 'shape' => 'ScalingActivityStatusCode', ], 'StatusMessage' => [ 'shape' => 'XmlString', ], 'Details' => [ 'shape' => 'XmlString', ], 'NotScaledReasons' => [ 'shape' => 'NotScaledReasons', ], ], ], 'ScalingActivityStatusCode' => [ 'type' => 'string', 'enum' => [ 'Pending', 'InProgress', 'Successful', 'Overridden', 'Unfulfilled', 'Failed', ], ], 'ScalingAdjustment' => [ 'type' => 'integer', ], 'ScalingPolicies' => [ 'type' => 'list', 'member' => [ 'shape' => 'ScalingPolicy', ], ], 'ScalingPolicy' => [ 'type' => 'structure', 'required' => [ 'PolicyARN', 'PolicyName', 'ServiceNamespace', 'ResourceId', 'ScalableDimension', 'PolicyType', 'CreationTime', ], 'members' => [ 'PolicyARN' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'PolicyName' => [ 'shape' => 'PolicyName', ], 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'ResourceId' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], 'PolicyType' => [ 'shape' => 'PolicyType', ], 'StepScalingPolicyConfiguration' => [ 'shape' => 'StepScalingPolicyConfiguration', ], 'TargetTrackingScalingPolicyConfiguration' => [ 'shape' => 'TargetTrackingScalingPolicyConfiguration', ], 'Alarms' => [ 'shape' => 'Alarms', ], 'CreationTime' => [ 'shape' => 'TimestampType', ], ], ], 'ScalingSuspended' => [ 'type' => 'boolean', ], 'ScheduledAction' => [ 'type' => 'structure', 'required' => [ 'ScheduledActionName', 'ScheduledActionARN', 'ServiceNamespace', 'Schedule', 'ResourceId', 'CreationTime', ], 'members' => [ 'ScheduledActionName' => [ 'shape' => 'ScheduledActionName', ], 'ScheduledActionARN' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'Schedule' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'Timezone' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ResourceId' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], 'StartTime' => [ 'shape' => 'TimestampType', ], 'EndTime' => [ 'shape' => 'TimestampType', ], 'ScalableTargetAction' => [ 'shape' => 'ScalableTargetAction', ], 'CreationTime' => [ 'shape' => 'TimestampType', ], ], ], 'ScheduledActionName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '(?!((^[ ]+.*)|(.*([\\\\u0000-\\\\u001f]|[\\\\u007f-\\\\u009f]|[:/|])+.*)|(.*[ ]+$))).+', ], 'ScheduledActions' => [ 'type' => 'list', 'member' => [ 'shape' => 'ScheduledAction', ], ], 'ServiceNamespace' => [ 'type' => 'string', 'enum' => [ 'ecs', 'elasticmapreduce', 'ec2', 'appstream', 'dynamodb', 'rds', 'sagemaker', 'custom-resource', 'comprehend', 'lambda', 'cassandra', 'kafka', 'elasticache', 'neptune', ], ], 'StepAdjustment' => [ 'type' => 'structure', 'required' => [ 'ScalingAdjustment', ], 'members' => [ 'MetricIntervalLowerBound' => [ 'shape' => 'MetricScale', ], 'MetricIntervalUpperBound' => [ 'shape' => 'MetricScale', ], 'ScalingAdjustment' => [ 'shape' => 'ScalingAdjustment', ], ], ], 'StepAdjustments' => [ 'type' => 'list', 'member' => [ 'shape' => 'StepAdjustment', ], ], 'StepScalingPolicyConfiguration' => [ 'type' => 'structure', 'members' => [ 'AdjustmentType' => [ 'shape' => 'AdjustmentType', ], 'StepAdjustments' => [ 'shape' => 'StepAdjustments', ], 'MinAdjustmentMagnitude' => [ 'shape' => 'MinAdjustmentMagnitude', ], 'Cooldown' => [ 'shape' => 'Cooldown', ], 'MetricAggregationType' => [ 'shape' => 'MetricAggregationType', ], ], ], 'SuspendedState' => [ 'type' => 'structure', 'members' => [ 'DynamicScalingInSuspended' => [ 'shape' => 'ScalingSuspended', ], 'DynamicScalingOutSuspended' => [ 'shape' => 'ScalingSuspended', ], 'ScheduledScalingSuspended' => [ 'shape' => 'ScalingSuspended', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 200, 'min' => 0, ], 'TagMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'TagKey', ], 'value' => [ 'shape' => 'TagValue', ], ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'Tags', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'AmazonResourceName', ], 'Tags' => [ 'shape' => 'TagMap', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, ], 'TargetTrackingMetric' => [ 'type' => 'structure', 'members' => [ 'Dimensions' => [ 'shape' => 'TargetTrackingMetricDimensions', ], 'MetricName' => [ 'shape' => 'TargetTrackingMetricName', ], 'Namespace' => [ 'shape' => 'TargetTrackingMetricNamespace', ], ], ], 'TargetTrackingMetricDataQueries' => [ 'type' => 'list', 'member' => [ 'shape' => 'TargetTrackingMetricDataQuery', ], ], 'TargetTrackingMetricDataQuery' => [ 'type' => 'structure', 'required' => [ 'Id', ], 'members' => [ 'Expression' => [ 'shape' => 'Expression', ], 'Id' => [ 'shape' => 'Id', ], 'Label' => [ 'shape' => 'XmlString', ], 'MetricStat' => [ 'shape' => 'TargetTrackingMetricStat', ], 'ReturnData' => [ 'shape' => 'ReturnData', ], ], ], 'TargetTrackingMetricDimension' => [ 'type' => 'structure', 'required' => [ 'Name', 'Value', ], 'members' => [ 'Name' => [ 'shape' => 'TargetTrackingMetricDimensionName', ], 'Value' => [ 'shape' => 'TargetTrackingMetricDimensionValue', ], ], ], 'TargetTrackingMetricDimensionName' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'TargetTrackingMetricDimensionValue' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'TargetTrackingMetricDimensions' => [ 'type' => 'list', 'member' => [ 'shape' => 'TargetTrackingMetricDimension', ], ], 'TargetTrackingMetricName' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'TargetTrackingMetricNamespace' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'TargetTrackingMetricStat' => [ 'type' => 'structure', 'required' => [ 'Metric', 'Stat', ], 'members' => [ 'Metric' => [ 'shape' => 'TargetTrackingMetric', ], 'Stat' => [ 'shape' => 'XmlString', ], 'Unit' => [ 'shape' => 'TargetTrackingMetricUnit', ], ], ], 'TargetTrackingMetricUnit' => [ 'type' => 'string', 'max' => 1023, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'TargetTrackingScalingPolicyConfiguration' => [ 'type' => 'structure', 'required' => [ 'TargetValue', ], 'members' => [ 'TargetValue' => [ 'shape' => 'MetricScale', ], 'PredefinedMetricSpecification' => [ 'shape' => 'PredefinedMetricSpecification', ], 'CustomizedMetricSpecification' => [ 'shape' => 'CustomizedMetricSpecification', ], 'ScaleOutCooldown' => [ 'shape' => 'Cooldown', ], 'ScaleInCooldown' => [ 'shape' => 'Cooldown', ], 'DisableScaleIn' => [ 'shape' => 'DisableScaleIn', ], ], ], 'TimestampType' => [ 'type' => 'timestamp', ], 'TooManyTagsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], 'ResourceName' => [ 'shape' => 'AmazonResourceName', ], ], 'exception' => true, ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'TagKeys', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'AmazonResourceName', ], 'TagKeys' => [ 'shape' => 'TagKeyList', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'ValidationException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'XmlString' => [ 'type' => 'string', 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/application-autoscaling/2016-02-06/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>With Application Auto Scaling, you can configure automatic scaling for the following resources:</p> <ul> <li> <p>Amazon AppStream 2.0 fleets</p> </li> <li> <p>Amazon Aurora Replicas</p> </li> <li> <p>Amazon Comprehend document classification and entity recognizer endpoints</p> </li> <li> <p>Amazon DynamoDB tables and global secondary indexes throughput capacity</p> </li> <li> <p>Amazon ECS services</p> </li> <li> <p>Amazon ElastiCache for Redis clusters (replication groups)</p> </li> <li> <p>Amazon EMR clusters</p> </li> <li> <p>Amazon Keyspaces (for Apache Cassandra) tables</p> </li> <li> <p>Lambda function provisioned concurrency</p> </li> <li> <p>Amazon Managed Streaming for Apache Kafka broker storage</p> </li> <li> <p>Amazon Neptune clusters</p> </li> <li> <p>Amazon SageMaker endpoint variants</p> </li> <li> <p>Amazon SageMaker Serverless endpoint provisioned concurrency</p> </li> <li> <p>Spot Fleets (Amazon EC2)</p> </li> <li> <p>Custom resources provided by your own applications or services</p> </li> </ul> <p>To learn more about Application Auto Scaling, see the <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/what-is-application-auto-scaling.html\">Application Auto Scaling User Guide</a>.</p> <p> <b>API Summary</b> </p> <p>The Application Auto Scaling service API includes three key sets of actions: </p> <ul> <li> <p>Register and manage scalable targets - Register Amazon Web Services or custom resources as scalable targets (a resource that Application Auto Scaling can scale), set minimum and maximum capacity limits, and retrieve information on existing scalable targets.</p> </li> <li> <p>Configure and manage automatic scaling - Define scaling policies to dynamically scale your resources in response to CloudWatch alarms, schedule one-time or recurring scaling actions, and retrieve your recent scaling activity history.</p> </li> <li> <p>Suspend and resume scaling - Temporarily suspend and later resume automatic scaling by calling the <a href=\"https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html\">RegisterScalableTarget</a> API action for any Application Auto Scaling scalable target. You can suspend and resume (individually or in combination) scale-out activities that are triggered by a scaling policy, scale-in activities that are triggered by a scaling policy, and scheduled scaling.</p> </li> </ul>', 'operations' => [ 'DeleteScalingPolicy' => '<p>Deletes the specified scaling policy for an Application Auto Scaling scalable target.</p> <p>Deleting a step scaling policy deletes the underlying alarm action, but does not delete the CloudWatch alarm associated with the scaling policy, even if it no longer has an associated action.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-step-scaling-policies.html#delete-step-scaling-policy\">Delete a step scaling policy</a> and <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html#delete-target-tracking-policy\">Delete a target tracking scaling policy</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'DeleteScheduledAction' => '<p>Deletes the specified scheduled action for an Application Auto Scaling scalable target.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/scheduled-scaling-additional-cli-commands.html#delete-scheduled-action\">Delete a scheduled action</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'DeregisterScalableTarget' => '<p>Deregisters an Application Auto Scaling scalable target when you have finished using it. To see which resources have been registered, use <a href=\"https://docs.aws.amazon.com/autoscaling/application/APIReference/API_DescribeScalableTargets.html\">DescribeScalableTargets</a>. </p> <note> <p>Deregistering a scalable target deletes the scaling policies and the scheduled actions that are associated with it.</p> </note>', 'DescribeScalableTargets' => '<p>Gets information about the scalable targets in the specified namespace.</p> <p>You can filter the results using <code>ResourceIds</code> and <code>ScalableDimension</code>.</p>', 'DescribeScalingActivities' => '<p>Provides descriptive information about the scaling activities in the specified namespace from the previous six weeks.</p> <p>You can filter the results using <code>ResourceId</code> and <code>ScalableDimension</code>.</p> <p>For information about viewing scaling activities using the Amazon Web Services CLI, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-scaling-activities.html\">Scaling activities for Application Auto Scaling</a>.</p>', 'DescribeScalingPolicies' => '<p>Describes the Application Auto Scaling scaling policies for the specified service namespace.</p> <p>You can filter the results using <code>ResourceId</code>, <code>ScalableDimension</code>, and <code>PolicyNames</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html\">Target tracking scaling policies</a> and <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-step-scaling-policies.html\">Step scaling policies</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'DescribeScheduledActions' => '<p>Describes the Application Auto Scaling scheduled actions for the specified service namespace.</p> <p>You can filter the results using the <code>ResourceId</code>, <code>ScalableDimension</code>, and <code>ScheduledActionNames</code> parameters.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-scheduled-scaling.html\">Scheduled scaling</a> and <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/scheduled-scaling-additional-cli-commands.html\">Managing scheduled scaling</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'ListTagsForResource' => '<p>Returns all the tags on the specified Application Auto Scaling scalable target.</p> <p>For general information about tags, including the format and syntax, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html\">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference</i>.</p>', 'PutScalingPolicy' => '<p>Creates or updates a scaling policy for an Application Auto Scaling scalable target.</p> <p>Each scalable target is identified by a service namespace, resource ID, and scalable dimension. A scaling policy applies to the scalable target identified by those three attributes. You cannot create a scaling policy until you have registered the resource as a scalable target.</p> <p>Multiple scaling policies can be in force at the same time for the same scalable target. You can have one or more target tracking scaling policies, one or more step scaling policies, or both. However, there is a chance that multiple policies could conflict, instructing the scalable target to scale out or in at the same time. Application Auto Scaling gives precedence to the policy that provides the largest capacity for both scale out and scale in. For example, if one policy increases capacity by 3, another policy increases capacity by 200 percent, and the current capacity is 10, Application Auto Scaling uses the policy with the highest calculated capacity (200% of 10 = 20) and scales out to 30. </p> <p>We recommend caution, however, when using target tracking scaling policies with step scaling policies because conflicts between these policies can cause undesirable behavior. For example, if the step scaling policy initiates a scale-in activity before the target tracking policy is ready to scale in, the scale-in activity will not be blocked. After the scale-in activity completes, the target tracking policy could instruct the scalable target to scale out again. </p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html\">Target tracking scaling policies</a> and <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-step-scaling-policies.html\">Step scaling policies</a> in the <i>Application Auto Scaling User Guide</i>.</p> <note> <p>If a scalable target is deregistered, the scalable target is no longer available to use scaling policies. Any scaling policies that were specified for the scalable target are deleted.</p> </note>', 'PutScheduledAction' => '<p>Creates or updates a scheduled action for an Application Auto Scaling scalable target. </p> <p>Each scalable target is identified by a service namespace, resource ID, and scalable dimension. A scheduled action applies to the scalable target identified by those three attributes. You cannot create a scheduled action until you have registered the resource as a scalable target.</p> <p>When you specify start and end times with a recurring schedule using a cron expression or rates, they form the boundaries for when the recurring action starts and stops.</p> <p>To update a scheduled action, specify the parameters that you want to change. If you don\\'t specify start and end times, the old values are deleted.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-scheduled-scaling.html\">Scheduled scaling</a> in the <i>Application Auto Scaling User Guide</i>.</p> <note> <p>If a scalable target is deregistered, the scalable target is no longer available to run scheduled actions. Any scheduled actions that were specified for the scalable target are deleted.</p> </note>', 'RegisterScalableTarget' => '<p>Registers or updates a scalable target, which is the resource that you want to scale.</p> <p>Scalable targets are uniquely identified by the combination of resource ID, scalable dimension, and namespace, which represents some capacity dimension of the underlying service.</p> <p>When you register a new scalable target, you must specify values for the minimum and maximum capacity. If the specified resource is not active in the target service, this operation does not change the resource\\'s current capacity. Otherwise, it changes the resource\\'s current capacity to a value that is inside of this range.</p> <p>If you add a scaling policy, current capacity is adjustable within the specified range when scaling starts. Application Auto Scaling scaling policies will not scale capacity to values that are outside of the minimum and maximum range.</p> <p>After you register a scalable target, you do not need to register it again to use other Application Auto Scaling operations. To see which resources have been registered, use <a href=\"https://docs.aws.amazon.com/autoscaling/application/APIReference/API_DescribeScalableTargets.html\">DescribeScalableTargets</a>. You can also view the scaling policies for a service namespace by using <a href=\"https://docs.aws.amazon.com/autoscaling/application/APIReference/API_DescribeScalableTargets.html\">DescribeScalableTargets</a>. If you no longer need a scalable target, you can deregister it by using <a href=\"https://docs.aws.amazon.com/autoscaling/application/APIReference/API_DeregisterScalableTarget.html\">DeregisterScalableTarget</a>.</p> <p>To update a scalable target, specify the parameters that you want to change. Include the parameters that identify the scalable target: resource ID, scalable dimension, and namespace. Any parameters that you don\\'t specify are not changed by this update request. </p> <note> <p>If you call the <code>RegisterScalableTarget</code> API operation to create a scalable target, there might be a brief delay until the operation achieves <a href=\"https://en.wikipedia.org/wiki/Eventual_consistency\">eventual consistency</a>. You might become aware of this brief delay if you get unexpected errors when performing sequential operations. The typical strategy is to retry the request, and some Amazon Web Services SDKs include automatic backoff and retry logic.</p> <p>If you call the <code>RegisterScalableTarget</code> API operation to update an existing scalable target, Application Auto Scaling retrieves the current capacity of the resource. If it\\'s below the minimum capacity or above the maximum capacity, Application Auto Scaling adjusts the capacity of the scalable target to place it within these bounds, even if you don\\'t include the <code>MinCapacity</code> or <code>MaxCapacity</code> request parameters.</p> </note>', 'TagResource' => '<p>Adds or edits tags on an Application Auto Scaling scalable target.</p> <p>Each tag consists of a tag key and a tag value, which are both case-sensitive strings. To add a tag, specify a new tag key and a tag value. To edit a tag, specify an existing tag key and a new tag value.</p> <p>You can use this operation to tag an Application Auto Scaling scalable target, but you cannot tag a scaling policy or scheduled action.</p> <p>You can also add tags to an Application Auto Scaling scalable target while creating it (<code>RegisterScalableTarget</code>).</p> <p>For general information about tags, including the format and syntax, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html\">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference</i>.</p> <p>Use tags to control access to a scalable target. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/resource-tagging-support.html\">Tagging support for Application Auto Scaling</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'UntagResource' => '<p>Deletes tags from an Application Auto Scaling scalable target. To delete a tag, specify the tag key and the Application Auto Scaling scalable target.</p>', ], 'shapes' => [ 'AdjustmentType' => [ 'base' => NULL, 'refs' => [ 'StepScalingPolicyConfiguration$AdjustmentType' => '<p>Specifies how the <code>ScalingAdjustment</code> value in a <a href=\"https://docs.aws.amazon.com/autoscaling/application/APIReference/API_StepAdjustment.html\">StepAdjustment</a> is interpreted (for example, an absolute number or a percentage). The valid values are <code>ChangeInCapacity</code>, <code>ExactCapacity</code>, and <code>PercentChangeInCapacity</code>. </p> <p> <code>AdjustmentType</code> is required if you are adding a new step scaling policy configuration.</p>', ], ], 'Alarm' => [ 'base' => '<p>Represents a CloudWatch alarm associated with a scaling policy.</p>', 'refs' => [ 'Alarms$member' => NULL, ], ], 'Alarms' => [ 'base' => NULL, 'refs' => [ 'PutScalingPolicyResponse$Alarms' => '<p>The CloudWatch alarms created for the target tracking scaling policy.</p>', 'ScalingPolicy$Alarms' => '<p>The CloudWatch alarms associated with the scaling policy.</p>', ], ], 'AmazonResourceName' => [ 'base' => NULL, 'refs' => [ 'ListTagsForResourceRequest$ResourceARN' => '<p>Specify the ARN of the scalable target.</p> <p>For example: <code>arn:aws:application-autoscaling:us-east-1:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123</code> </p> <p>To get the ARN for a scalable target, use <a>DescribeScalableTargets</a>.</p>', 'ResourceNotFoundException$ResourceName' => '<p>The name of the Application Auto Scaling resource. This value is an Amazon Resource Name (ARN).</p>', 'TagResourceRequest$ResourceARN' => '<p>Identifies the Application Auto Scaling scalable target that you want to apply tags to.</p> <p>For example: <code>arn:aws:application-autoscaling:us-east-1:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123</code> </p> <p>To get the ARN for a scalable target, use <a>DescribeScalableTargets</a>.</p>', 'TooManyTagsException$ResourceName' => '<p>The name of the Application Auto Scaling resource. This value is an Amazon Resource Name (ARN).</p>', 'UntagResourceRequest$ResourceARN' => '<p>Identifies the Application Auto Scaling scalable target from which to remove tags.</p> <p>For example: <code>arn:aws:application-autoscaling:us-east-1:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123</code> </p> <p>To get the ARN for a scalable target, use <a>DescribeScalableTargets</a>.</p>', ], ], 'ConcurrentUpdateException' => [ 'base' => '<p>Concurrent updates caused an exception, for example, if you request an update to an Application Auto Scaling resource that already has a pending update.</p>', 'refs' => [], ], 'Cooldown' => [ 'base' => NULL, 'refs' => [ 'StepScalingPolicyConfiguration$Cooldown' => '<p>The amount of time, in seconds, to wait for a previous scaling activity to take effect. If not specified, the default value is 300. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-step-scaling-policies.html#step-scaling-cooldown\">Cooldown period</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'TargetTrackingScalingPolicyConfiguration$ScaleOutCooldown' => '<p>The amount of time, in seconds, to wait for a previous scale-out activity to take effect. For more information and for default values, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html#target-tracking-cooldown\">Define cooldown periods</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'TargetTrackingScalingPolicyConfiguration$ScaleInCooldown' => '<p>The amount of time, in seconds, after a scale-in activity completes before another scale-in activity can start. For more information and for default values, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html#target-tracking-cooldown\">Define cooldown periods</a> in the <i>Application Auto Scaling User Guide</i>.</p>', ], ], 'CustomizedMetricSpecification' => [ 'base' => '<p>Represents a CloudWatch metric of your choosing for a target tracking scaling policy to use with Application Auto Scaling.</p> <p>For information about the available metrics for a service, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html\">Amazon Web Services services that publish CloudWatch metrics</a> in the <i>Amazon CloudWatch User Guide</i>.</p> <p>To create your customized metric specification:</p> <ul> <li> <p>Add values for each required parameter from CloudWatch. You can use an existing metric, or a new metric that you create. To use your own metric, you must first publish the metric to CloudWatch. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html\">Publish custom metrics</a> in the <i>Amazon CloudWatch User Guide</i>.</p> </li> <li> <p>Choose a metric that changes proportionally with capacity. The value of the metric should increase or decrease in inverse proportion to the number of capacity units. That is, the value of the metric should decrease when capacity increases, and increase when capacity decreases. </p> </li> </ul> <p>For more information about the CloudWatch terminology below, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html\">Amazon CloudWatch concepts</a> in the <i>Amazon CloudWatch User Guide</i>. </p>', 'refs' => [ 'TargetTrackingScalingPolicyConfiguration$CustomizedMetricSpecification' => '<p>A customized metric. You can specify either a predefined metric or a customized metric.</p>', ], ], 'DeleteScalingPolicyRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteScalingPolicyResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteScheduledActionRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteScheduledActionResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeregisterScalableTargetRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeregisterScalableTargetResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeScalableTargetsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeScalableTargetsResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeScalingActivitiesRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeScalingActivitiesResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeScalingPoliciesRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeScalingPoliciesResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeScheduledActionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeScheduledActionsResponse' => [ 'base' => NULL, 'refs' => [], ], 'DisableScaleIn' => [ 'base' => NULL, 'refs' => [ 'TargetTrackingScalingPolicyConfiguration$DisableScaleIn' => '<p>Indicates whether scale in by the target tracking scaling policy is disabled. If the value is <code>true</code>, scale in is disabled and the target tracking scaling policy won\\'t remove capacity from the scalable target. Otherwise, scale in is enabled and the target tracking scaling policy can remove capacity from the scalable target. The default value is <code>false</code>.</p>', ], ], 'ErrorMessage' => [ 'base' => NULL, 'refs' => [ 'ConcurrentUpdateException$Message' => NULL, 'FailedResourceAccessException$Message' => NULL, 'InternalServiceException$Message' => NULL, 'InvalidNextTokenException$Message' => NULL, 'LimitExceededException$Message' => NULL, 'ObjectNotFoundException$Message' => NULL, 'ValidationException$Message' => NULL, ], ], 'ExceptionMessage' => [ 'base' => NULL, 'refs' => [ 'ResourceNotFoundException$Message' => NULL, 'TooManyTagsException$Message' => NULL, ], ], 'Expression' => [ 'base' => NULL, 'refs' => [ 'TargetTrackingMetricDataQuery$Expression' => '<p>The math expression to perform on the returned data, if this object is performing a math expression. This expression can use the <code>Id</code> of the other metrics to refer to those metrics, and can also use the <code>Id</code> of other expressions to use the result of those expressions. </p> <p>Conditional: Within each <code>TargetTrackingMetricDataQuery</code> object, you must specify either <code>Expression</code> or <code>MetricStat</code>, but not both.</p>', ], ], 'FailedResourceAccessException' => [ 'base' => '<p>Failed access to resources caused an exception. This exception is thrown when Application Auto Scaling is unable to retrieve the alarms associated with a scaling policy due to a client error, for example, if the role ARN specified for a scalable target does not have permission to call the CloudWatch <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html\">DescribeAlarms</a> on your behalf.</p>', 'refs' => [], ], 'Id' => [ 'base' => NULL, 'refs' => [ 'TargetTrackingMetricDataQuery$Id' => '<p>A short name that identifies the object\\'s results in the response. This name must be unique among all <code>MetricDataQuery</code> objects specified for a single scaling policy. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscores. The first character must be a lowercase letter. </p>', ], ], 'IncludeNotScaledActivities' => [ 'base' => NULL, 'refs' => [ 'DescribeScalingActivitiesRequest$IncludeNotScaledActivities' => '<p>Specifies whether to include activities that aren\\'t scaled (<i>not scaled activities</i>) in the response. Not scaled activities are activities that aren\\'t completed or started for various reasons, such as preventing infinite scaling loops. For help interpreting the not scaled reason details in the response, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-scaling-activities.html\">Scaling activities for Application Auto Scaling</a>.</p>', ], ], 'InternalServiceException' => [ 'base' => '<p>The service encountered an internal error.</p>', 'refs' => [], ], 'InvalidNextTokenException' => [ 'base' => '<p>The next token supplied was invalid.</p>', 'refs' => [], ], 'LimitExceededException' => [ 'base' => '<p>A per-account resource limit is exceeded. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-limits.html\">Application Auto Scaling service quotas</a>.</p>', 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'DescribeScalableTargetsRequest$MaxResults' => '<p>The maximum number of scalable targets. This value can be between 1 and 50. The default value is 50.</p> <p>If this parameter is used, the operation returns up to <code>MaxResults</code> results at a time, along with a <code>NextToken</code> value. To get the next set of results, include the <code>NextToken</code> value in a subsequent call. If this parameter is not used, the operation returns up to 50 results and a <code>NextToken</code> value, if applicable.</p>', 'DescribeScalingActivitiesRequest$MaxResults' => '<p>The maximum number of scalable targets. This value can be between 1 and 50. The default value is 50.</p> <p>If this parameter is used, the operation returns up to <code>MaxResults</code> results at a time, along with a <code>NextToken</code> value. To get the next set of results, include the <code>NextToken</code> value in a subsequent call. If this parameter is not used, the operation returns up to 50 results and a <code>NextToken</code> value, if applicable.</p>', 'DescribeScalingPoliciesRequest$MaxResults' => '<p>The maximum number of scalable targets. This value can be between 1 and 10. The default value is 10.</p> <p>If this parameter is used, the operation returns up to <code>MaxResults</code> results at a time, along with a <code>NextToken</code> value. To get the next set of results, include the <code>NextToken</code> value in a subsequent call. If this parameter is not used, the operation returns up to 10 results and a <code>NextToken</code> value, if applicable.</p>', 'DescribeScheduledActionsRequest$MaxResults' => '<p>The maximum number of scheduled action results. This value can be between 1 and 50. The default value is 50.</p> <p>If this parameter is used, the operation returns up to <code>MaxResults</code> results at a time, along with a <code>NextToken</code> value. To get the next set of results, include the <code>NextToken</code> value in a subsequent call. If this parameter is not used, the operation returns up to 50 results and a <code>NextToken</code> value, if applicable.</p>', ], ], 'MetricAggregationType' => [ 'base' => NULL, 'refs' => [ 'StepScalingPolicyConfiguration$MetricAggregationType' => '<p>The aggregation type for the CloudWatch metrics. Valid values are <code>Minimum</code>, <code>Maximum</code>, and <code>Average</code>. If the aggregation type is null, the value is treated as <code>Average</code>.</p>', ], ], 'MetricDimension' => [ 'base' => '<p>Describes the dimension names and values associated with a metric.</p>', 'refs' => [ 'MetricDimensions$member' => NULL, ], ], 'MetricDimensionName' => [ 'base' => NULL, 'refs' => [ 'MetricDimension$Name' => '<p>The name of the dimension.</p>', ], ], 'MetricDimensionValue' => [ 'base' => NULL, 'refs' => [ 'MetricDimension$Value' => '<p>The value of the dimension.</p>', ], ], 'MetricDimensions' => [ 'base' => NULL, 'refs' => [ 'CustomizedMetricSpecification$Dimensions' => '<p>The dimensions of the metric. </p> <p>Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.</p>', ], ], 'MetricName' => [ 'base' => NULL, 'refs' => [ 'CustomizedMetricSpecification$MetricName' => '<p>The name of the metric. To get the exact metric name, namespace, and dimensions, inspect the <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Metric.html\">Metric</a> object that\\'s returned by a call to <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html\">ListMetrics</a>.</p>', ], ], 'MetricNamespace' => [ 'base' => NULL, 'refs' => [ 'CustomizedMetricSpecification$Namespace' => '<p>The namespace of the metric.</p>', ], ], 'MetricScale' => [ 'base' => NULL, 'refs' => [ 'StepAdjustment$MetricIntervalLowerBound' => '<p>The lower bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the lower bound is inclusive (the metric must be greater than or equal to the threshold plus the lower bound). Otherwise, it\\'s exclusive (the metric must be greater than the threshold plus the lower bound). A null value indicates negative infinity.</p>', 'StepAdjustment$MetricIntervalUpperBound' => '<p>The upper bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the upper bound is exclusive (the metric must be less than the threshold plus the upper bound). Otherwise, it\\'s inclusive (the metric must be less than or equal to the threshold plus the upper bound). A null value indicates positive infinity.</p> <p>The upper bound must be greater than the lower bound.</p>', 'TargetTrackingScalingPolicyConfiguration$TargetValue' => '<p>The target value for the metric. Although this property accepts numbers of type Double, it won\\'t accept values that are either too small or too large. Values must be in the range of -2^360 to 2^360. The value must be a valid number based on the choice of metric. For example, if the metric is CPU utilization, then the target value is a percent value that represents how much of the CPU can be used before scaling out. </p> <note> <p>If the scaling policy specifies the <code>ALBRequestCountPerTarget</code> predefined metric, specify the target utilization as the optimal average request count per target during any one-minute interval.</p> </note>', ], ], 'MetricStatistic' => [ 'base' => NULL, 'refs' => [ 'CustomizedMetricSpecification$Statistic' => '<p>The statistic of the metric.</p>', ], ], 'MetricType' => [ 'base' => NULL, 'refs' => [ 'PredefinedMetricSpecification$PredefinedMetricType' => '<p>The metric type. The <code>ALBRequestCountPerTarget</code> metric type applies only to Spot Fleets and ECS services.</p>', ], ], 'MetricUnit' => [ 'base' => NULL, 'refs' => [ 'CustomizedMetricSpecification$Unit' => '<p>The unit of the metric. For a complete list of the units that CloudWatch supports, see the <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html\">MetricDatum</a> data type in the <i>Amazon CloudWatch API Reference</i>.</p>', ], ], 'MinAdjustmentMagnitude' => [ 'base' => NULL, 'refs' => [ 'StepScalingPolicyConfiguration$MinAdjustmentMagnitude' => '<p>The minimum value to scale by when the adjustment type is <code>PercentChangeInCapacity</code>. For example, suppose that you create a step scaling policy to scale out an Amazon ECS service by 25 percent and you specify a <code>MinAdjustmentMagnitude</code> of 2. If the service has 4 tasks and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a <code>MinAdjustmentMagnitude</code> of 2, Application Auto Scaling scales out the service by 2 tasks.</p>', ], ], 'NotScaledReason' => [ 'base' => '<p>Describes the reason for an activity that isn\\'t scaled (<i>not scaled activity</i>), in machine-readable format. For help interpreting the not scaled reason details, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-scaling-activities.html\">Scaling activities for Application Auto Scaling</a>.</p>', 'refs' => [ 'NotScaledReasons$member' => NULL, ], ], 'NotScaledReasons' => [ 'base' => NULL, 'refs' => [ 'ScalingActivity$NotScaledReasons' => '<p>Machine-readable data that describes the reason for a not scaled activity. Only available when <a href=\"https://docs.aws.amazon.com/autoscaling/application/APIReference/API_DescribeScalingActivities.html\">DescribeScalingActivities</a> includes not scaled activities.</p>', ], ], 'ObjectNotFoundException' => [ 'base' => '<p>The specified object could not be found. For any operation that depends on the existence of a scalable target, this exception is thrown if the scalable target with the specified service namespace, resource ID, and scalable dimension does not exist. For any operation that deletes or deregisters a resource, this exception is thrown if the resource cannot be found.</p>', 'refs' => [], ], 'PolicyName' => [ 'base' => NULL, 'refs' => [ 'PutScalingPolicyRequest$PolicyName' => '<p>The name of the scaling policy.</p> <p>You cannot change the name of a scaling policy, but you can delete the original scaling policy and create a new scaling policy with the same settings and a different name.</p>', 'ScalingPolicy$PolicyName' => '<p>The name of the scaling policy.</p>', ], ], 'PolicyType' => [ 'base' => NULL, 'refs' => [ 'PutScalingPolicyRequest$PolicyType' => '<p>The scaling policy type. This parameter is required if you are creating a scaling policy.</p> <p>The following policy types are supported: </p> <p> <code>TargetTrackingScaling</code>\u00e2\u20ac\u201dNot supported for Amazon EMR</p> <p> <code>StepScaling</code>\u00e2\u20ac\u201dNot supported for DynamoDB, Amazon Comprehend, Lambda, Amazon Keyspaces, Amazon MSK, Amazon ElastiCache, or Neptune.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html\">Target tracking scaling policies</a> and <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-step-scaling-policies.html\">Step scaling policies</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'ScalingPolicy$PolicyType' => '<p>The scaling policy type.</p> <p>The following policy types are supported: </p> <p> <code>TargetTrackingScaling</code>\u00e2\u20ac\u201dNot supported for Amazon EMR</p> <p> <code>StepScaling</code>\u00e2\u20ac\u201dNot supported for DynamoDB, Amazon Comprehend, Lambda, Amazon Keyspaces, Amazon MSK, Amazon ElastiCache, or Neptune.</p>', ], ], 'PredefinedMetricSpecification' => [ 'base' => '<p>Represents a predefined metric for a target tracking scaling policy to use with Application Auto Scaling.</p> <p>Only the Amazon Web Services that you\\'re using send metrics to Amazon CloudWatch. To determine whether a desired metric already exists by looking up its namespace and dimension using the CloudWatch metrics dashboard in the console, follow the procedure in <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/monitoring-cloudwatch.html\">Building dashboards with CloudWatch</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'refs' => [ 'TargetTrackingScalingPolicyConfiguration$PredefinedMetricSpecification' => '<p>A predefined metric. You can specify either a predefined metric or a customized metric.</p>', ], ], 'PutScalingPolicyRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutScalingPolicyResponse' => [ 'base' => NULL, 'refs' => [], ], 'PutScheduledActionRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutScheduledActionResponse' => [ 'base' => NULL, 'refs' => [], ], 'RegisterScalableTargetRequest' => [ 'base' => NULL, 'refs' => [], ], 'RegisterScalableTargetResponse' => [ 'base' => NULL, 'refs' => [], ], 'ResourceCapacity' => [ 'base' => NULL, 'refs' => [ 'NotScaledReason$MaxCapacity' => '<p>The maximum capacity.</p>', 'NotScaledReason$MinCapacity' => '<p>The minimum capacity.</p>', 'NotScaledReason$CurrentCapacity' => '<p>The current capacity.</p>', 'RegisterScalableTargetRequest$MinCapacity' => '<p>The minimum value that you plan to scale in to. When a scaling policy is in effect, Application Auto Scaling can scale in (contract) as needed to the minimum capacity limit in response to changing demand. This property is required when registering a new scalable target.</p> <p>For the following resources, the minimum value allowed is 0.</p> <ul> <li> <p>AppStream 2.0 fleets</p> </li> <li> <p> Aurora DB clusters</p> </li> <li> <p>ECS services</p> </li> <li> <p>EMR clusters</p> </li> <li> <p>Lambda provisioned concurrency</p> </li> <li> <p>SageMaker endpoint variants</p> </li> <li> <p>SageMaker Serverless endpoint provisioned concurrency</p> </li> <li> <p>Spot Fleets</p> </li> <li> <p>custom resources</p> </li> </ul> <p>It\\'s strongly recommended that you specify a value greater than 0. A value greater than 0 means that data points are continuously reported to CloudWatch that scaling policies can use to scale on a metric like average CPU utilization.</p> <p>For all other resources, the minimum allowed value depends on the type of resource that you are using. If you provide a value that is lower than what a resource can accept, an error occurs. In which case, the error message will provide the minimum value that the resource can accept.</p>', 'RegisterScalableTargetRequest$MaxCapacity' => '<p>The maximum value that you plan to scale out to. When a scaling policy is in effect, Application Auto Scaling can scale out (expand) as needed to the maximum capacity limit in response to changing demand. This property is required when registering a new scalable target.</p> <p>Although you can specify a large maximum capacity, note that service quotas might impose lower limits. Each service has its own default quotas for the maximum capacity of the resource. If you want to specify a higher limit, you can request an increase. For more information, consult the documentation for that service. For information about the default quotas for each service, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html\">Service endpoints and quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>', 'ScalableTarget$MinCapacity' => '<p>The minimum value to scale to in response to a scale-in activity.</p>', 'ScalableTarget$MaxCapacity' => '<p>The maximum value to scale to in response to a scale-out activity.</p>', 'ScalableTargetAction$MinCapacity' => '<p>The minimum capacity.</p> <p>When the scheduled action runs, the resource will have at least this much capacity, but it might have more depending on other settings, such as the target utilization level of a target tracking scaling policy.</p>', 'ScalableTargetAction$MaxCapacity' => '<p>The maximum capacity.</p> <p>Although you can specify a large maximum capacity, note that service quotas may impose lower limits. Each service has its own default quotas for the maximum capacity of the resource. If you want to specify a higher limit, you can request an increase. For more information, consult the documentation for that service. For information about the default quotas for each service, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html\">Service endpoints and quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>', ], ], 'ResourceId' => [ 'base' => NULL, 'refs' => [ 'Alarm$AlarmName' => '<p>The name of the alarm.</p>', 'Alarm$AlarmARN' => '<p>The Amazon Resource Name (ARN) of the alarm.</p>', 'ScalingActivity$ActivityId' => '<p>The unique identifier of the scaling activity.</p>', ], ], 'ResourceIdMaxLen1600' => [ 'base' => NULL, 'refs' => [ 'DeleteScalingPolicyRequest$PolicyName' => '<p>The name of the scaling policy.</p>', 'DeleteScalingPolicyRequest$ResourceId' => '<p>The identifier of the resource associated with the scalable target. This string consists of the resource type and unique identifier.</p> <ul> <li> <p>ECS service - The resource type is <code>service</code> and the unique identifier is the cluster name and service name. Example: <code>service/default/sample-webapp</code>.</p> </li> <li> <p>Spot Fleet - The resource type is <code>spot-fleet-request</code> and the unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>.</p> </li> <li> <p>EMR cluster - The resource type is <code>instancegroup</code> and the unique identifier is the cluster ID and instance group ID. Example: <code>instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0</code>.</p> </li> <li> <p>AppStream 2.0 fleet - The resource type is <code>fleet</code> and the unique identifier is the fleet name. Example: <code>fleet/sample-fleet</code>.</p> </li> <li> <p>DynamoDB table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>table/my-table</code>.</p> </li> <li> <p>DynamoDB global secondary index - The resource type is <code>index</code> and the unique identifier is the index name. Example: <code>table/my-table/index/my-table-index</code>.</p> </li> <li> <p>Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:my-db-cluster</code>.</p> </li> <li> <p>SageMaker endpoint variant - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> <li> <p>Custom resources are not supported with a resource type. This parameter must specify the <code>OutputValue</code> from the CloudFormation template stack used to access the resources. The unique identifier is defined by the service provider. More information is available in our <a href=\"https://github.com/aws/aws-auto-scaling-custom-resource\">GitHub repository</a>.</p> </li> <li> <p>Amazon Comprehend document classification endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Amazon Comprehend entity recognizer endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Lambda provisioned concurrency - The resource type is <code>function</code> and the unique identifier is the function name with a function version or alias name suffix that is not <code>$LATEST</code>. Example: <code>function:my-function:prod</code> or <code>function:my-function:1</code>.</p> </li> <li> <p>Amazon Keyspaces table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>keyspace/mykeyspace/table/mytable</code>.</p> </li> <li> <p>Amazon MSK cluster - The resource type and unique identifier are specified using the cluster ARN. Example: <code>arn:aws:kafka:us-east-1:123456789012:cluster/demo-cluster-1/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5</code>.</p> </li> <li> <p>Amazon ElastiCache replication group - The resource type is <code>replication-group</code> and the unique identifier is the replication group name. Example: <code>replication-group/mycluster</code>.</p> </li> <li> <p>Neptune cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:mycluster</code>.</p> </li> <li> <p>SageMaker Serverless endpoint - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> </ul>', 'DeleteScheduledActionRequest$ScheduledActionName' => '<p>The name of the scheduled action.</p>', 'DeleteScheduledActionRequest$ResourceId' => '<p>The identifier of the resource associated with the scheduled action. This string consists of the resource type and unique identifier.</p> <ul> <li> <p>ECS service - The resource type is <code>service</code> and the unique identifier is the cluster name and service name. Example: <code>service/default/sample-webapp</code>.</p> </li> <li> <p>Spot Fleet - The resource type is <code>spot-fleet-request</code> and the unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>.</p> </li> <li> <p>EMR cluster - The resource type is <code>instancegroup</code> and the unique identifier is the cluster ID and instance group ID. Example: <code>instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0</code>.</p> </li> <li> <p>AppStream 2.0 fleet - The resource type is <code>fleet</code> and the unique identifier is the fleet name. Example: <code>fleet/sample-fleet</code>.</p> </li> <li> <p>DynamoDB table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>table/my-table</code>.</p> </li> <li> <p>DynamoDB global secondary index - The resource type is <code>index</code> and the unique identifier is the index name. Example: <code>table/my-table/index/my-table-index</code>.</p> </li> <li> <p>Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:my-db-cluster</code>.</p> </li> <li> <p>SageMaker endpoint variant - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> <li> <p>Custom resources are not supported with a resource type. This parameter must specify the <code>OutputValue</code> from the CloudFormation template stack used to access the resources. The unique identifier is defined by the service provider. More information is available in our <a href=\"https://github.com/aws/aws-auto-scaling-custom-resource\">GitHub repository</a>.</p> </li> <li> <p>Amazon Comprehend document classification endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Amazon Comprehend entity recognizer endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Lambda provisioned concurrency - The resource type is <code>function</code> and the unique identifier is the function name with a function version or alias name suffix that is not <code>$LATEST</code>. Example: <code>function:my-function:prod</code> or <code>function:my-function:1</code>.</p> </li> <li> <p>Amazon Keyspaces table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>keyspace/mykeyspace/table/mytable</code>.</p> </li> <li> <p>Amazon MSK cluster - The resource type and unique identifier are specified using the cluster ARN. Example: <code>arn:aws:kafka:us-east-1:123456789012:cluster/demo-cluster-1/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5</code>.</p> </li> <li> <p>Amazon ElastiCache replication group - The resource type is <code>replication-group</code> and the unique identifier is the replication group name. Example: <code>replication-group/mycluster</code>.</p> </li> <li> <p>Neptune cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:mycluster</code>.</p> </li> <li> <p>SageMaker Serverless endpoint - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> </ul>', 'DeregisterScalableTargetRequest$ResourceId' => '<p>The identifier of the resource associated with the scalable target. This string consists of the resource type and unique identifier.</p> <ul> <li> <p>ECS service - The resource type is <code>service</code> and the unique identifier is the cluster name and service name. Example: <code>service/default/sample-webapp</code>.</p> </li> <li> <p>Spot Fleet - The resource type is <code>spot-fleet-request</code> and the unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>.</p> </li> <li> <p>EMR cluster - The resource type is <code>instancegroup</code> and the unique identifier is the cluster ID and instance group ID. Example: <code>instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0</code>.</p> </li> <li> <p>AppStream 2.0 fleet - The resource type is <code>fleet</code> and the unique identifier is the fleet name. Example: <code>fleet/sample-fleet</code>.</p> </li> <li> <p>DynamoDB table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>table/my-table</code>.</p> </li> <li> <p>DynamoDB global secondary index - The resource type is <code>index</code> and the unique identifier is the index name. Example: <code>table/my-table/index/my-table-index</code>.</p> </li> <li> <p>Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:my-db-cluster</code>.</p> </li> <li> <p>SageMaker endpoint variant - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> <li> <p>Custom resources are not supported with a resource type. This parameter must specify the <code>OutputValue</code> from the CloudFormation template stack used to access the resources. The unique identifier is defined by the service provider. More information is available in our <a href=\"https://github.com/aws/aws-auto-scaling-custom-resource\">GitHub repository</a>.</p> </li> <li> <p>Amazon Comprehend document classification endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Amazon Comprehend entity recognizer endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Lambda provisioned concurrency - The resource type is <code>function</code> and the unique identifier is the function name with a function version or alias name suffix that is not <code>$LATEST</code>. Example: <code>function:my-function:prod</code> or <code>function:my-function:1</code>.</p> </li> <li> <p>Amazon Keyspaces table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>keyspace/mykeyspace/table/mytable</code>.</p> </li> <li> <p>Amazon MSK cluster - The resource type and unique identifier are specified using the cluster ARN. Example: <code>arn:aws:kafka:us-east-1:123456789012:cluster/demo-cluster-1/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5</code>.</p> </li> <li> <p>Amazon ElastiCache replication group - The resource type is <code>replication-group</code> and the unique identifier is the replication group name. Example: <code>replication-group/mycluster</code>.</p> </li> <li> <p>Neptune cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:mycluster</code>.</p> </li> <li> <p>SageMaker Serverless endpoint - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> </ul>', 'DescribeScalingActivitiesRequest$ResourceId' => '<p>The identifier of the resource associated with the scaling activity. This string consists of the resource type and unique identifier.</p> <ul> <li> <p>ECS service - The resource type is <code>service</code> and the unique identifier is the cluster name and service name. Example: <code>service/default/sample-webapp</code>.</p> </li> <li> <p>Spot Fleet - The resource type is <code>spot-fleet-request</code> and the unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>.</p> </li> <li> <p>EMR cluster - The resource type is <code>instancegroup</code> and the unique identifier is the cluster ID and instance group ID. Example: <code>instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0</code>.</p> </li> <li> <p>AppStream 2.0 fleet - The resource type is <code>fleet</code> and the unique identifier is the fleet name. Example: <code>fleet/sample-fleet</code>.</p> </li> <li> <p>DynamoDB table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>table/my-table</code>.</p> </li> <li> <p>DynamoDB global secondary index - The resource type is <code>index</code> and the unique identifier is the index name. Example: <code>table/my-table/index/my-table-index</code>.</p> </li> <li> <p>Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:my-db-cluster</code>.</p> </li> <li> <p>SageMaker endpoint variant - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> <li> <p>Custom resources are not supported with a resource type. This parameter must specify the <code>OutputValue</code> from the CloudFormation template stack used to access the resources. The unique identifier is defined by the service provider. More information is available in our <a href=\"https://github.com/aws/aws-auto-scaling-custom-resource\">GitHub repository</a>.</p> </li> <li> <p>Amazon Comprehend document classification endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Amazon Comprehend entity recognizer endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Lambda provisioned concurrency - The resource type is <code>function</code> and the unique identifier is the function name with a function version or alias name suffix that is not <code>$LATEST</code>. Example: <code>function:my-function:prod</code> or <code>function:my-function:1</code>.</p> </li> <li> <p>Amazon Keyspaces table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>keyspace/mykeyspace/table/mytable</code>.</p> </li> <li> <p>Amazon MSK cluster - The resource type and unique identifier are specified using the cluster ARN. Example: <code>arn:aws:kafka:us-east-1:123456789012:cluster/demo-cluster-1/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5</code>.</p> </li> <li> <p>Amazon ElastiCache replication group - The resource type is <code>replication-group</code> and the unique identifier is the replication group name. Example: <code>replication-group/mycluster</code>.</p> </li> <li> <p>Neptune cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:mycluster</code>.</p> </li> <li> <p>SageMaker Serverless endpoint - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> </ul>', 'DescribeScalingPoliciesRequest$ResourceId' => '<p>The identifier of the resource associated with the scaling policy. This string consists of the resource type and unique identifier.</p> <ul> <li> <p>ECS service - The resource type is <code>service</code> and the unique identifier is the cluster name and service name. Example: <code>service/default/sample-webapp</code>.</p> </li> <li> <p>Spot Fleet - The resource type is <code>spot-fleet-request</code> and the unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>.</p> </li> <li> <p>EMR cluster - The resource type is <code>instancegroup</code> and the unique identifier is the cluster ID and instance group ID. Example: <code>instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0</code>.</p> </li> <li> <p>AppStream 2.0 fleet - The resource type is <code>fleet</code> and the unique identifier is the fleet name. Example: <code>fleet/sample-fleet</code>.</p> </li> <li> <p>DynamoDB table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>table/my-table</code>.</p> </li> <li> <p>DynamoDB global secondary index - The resource type is <code>index</code> and the unique identifier is the index name. Example: <code>table/my-table/index/my-table-index</code>.</p> </li> <li> <p>Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:my-db-cluster</code>.</p> </li> <li> <p>SageMaker endpoint variant - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> <li> <p>Custom resources are not supported with a resource type. This parameter must specify the <code>OutputValue</code> from the CloudFormation template stack used to access the resources. The unique identifier is defined by the service provider. More information is available in our <a href=\"https://github.com/aws/aws-auto-scaling-custom-resource\">GitHub repository</a>.</p> </li> <li> <p>Amazon Comprehend document classification endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Amazon Comprehend entity recognizer endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Lambda provisioned concurrency - The resource type is <code>function</code> and the unique identifier is the function name with a function version or alias name suffix that is not <code>$LATEST</code>. Example: <code>function:my-function:prod</code> or <code>function:my-function:1</code>.</p> </li> <li> <p>Amazon Keyspaces table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>keyspace/mykeyspace/table/mytable</code>.</p> </li> <li> <p>Amazon MSK cluster - The resource type and unique identifier are specified using the cluster ARN. Example: <code>arn:aws:kafka:us-east-1:123456789012:cluster/demo-cluster-1/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5</code>.</p> </li> <li> <p>Amazon ElastiCache replication group - The resource type is <code>replication-group</code> and the unique identifier is the replication group name. Example: <code>replication-group/mycluster</code>.</p> </li> <li> <p>Neptune cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:mycluster</code>.</p> </li> <li> <p>SageMaker Serverless endpoint - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> </ul>', 'DescribeScheduledActionsRequest$ResourceId' => '<p>The identifier of the resource associated with the scheduled action. This string consists of the resource type and unique identifier.</p> <ul> <li> <p>ECS service - The resource type is <code>service</code> and the unique identifier is the cluster name and service name. Example: <code>service/default/sample-webapp</code>.</p> </li> <li> <p>Spot Fleet - The resource type is <code>spot-fleet-request</code> and the unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>.</p> </li> <li> <p>EMR cluster - The resource type is <code>instancegroup</code> and the unique identifier is the cluster ID and instance group ID. Example: <code>instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0</code>.</p> </li> <li> <p>AppStream 2.0 fleet - The resource type is <code>fleet</code> and the unique identifier is the fleet name. Example: <code>fleet/sample-fleet</code>.</p> </li> <li> <p>DynamoDB table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>table/my-table</code>.</p> </li> <li> <p>DynamoDB global secondary index - The resource type is <code>index</code> and the unique identifier is the index name. Example: <code>table/my-table/index/my-table-index</code>.</p> </li> <li> <p>Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:my-db-cluster</code>.</p> </li> <li> <p>SageMaker endpoint variant - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> <li> <p>Custom resources are not supported with a resource type. This parameter must specify the <code>OutputValue</code> from the CloudFormation template stack used to access the resources. The unique identifier is defined by the service provider. More information is available in our <a href=\"https://github.com/aws/aws-auto-scaling-custom-resource\">GitHub repository</a>.</p> </li> <li> <p>Amazon Comprehend document classification endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Amazon Comprehend entity recognizer endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Lambda provisioned concurrency - The resource type is <code>function</code> and the unique identifier is the function name with a function version or alias name suffix that is not <code>$LATEST</code>. Example: <code>function:my-function:prod</code> or <code>function:my-function:1</code>.</p> </li> <li> <p>Amazon Keyspaces table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>keyspace/mykeyspace/table/mytable</code>.</p> </li> <li> <p>Amazon MSK cluster - The resource type and unique identifier are specified using the cluster ARN. Example: <code>arn:aws:kafka:us-east-1:123456789012:cluster/demo-cluster-1/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5</code>.</p> </li> <li> <p>Amazon ElastiCache replication group - The resource type is <code>replication-group</code> and the unique identifier is the replication group name. Example: <code>replication-group/mycluster</code>.</p> </li> <li> <p>Neptune cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:mycluster</code>.</p> </li> <li> <p>SageMaker Serverless endpoint - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> </ul>', 'PutScalingPolicyRequest$ResourceId' => '<p>The identifier of the resource associated with the scaling policy. This string consists of the resource type and unique identifier.</p> <ul> <li> <p>ECS service - The resource type is <code>service</code> and the unique identifier is the cluster name and service name. Example: <code>service/default/sample-webapp</code>.</p> </li> <li> <p>Spot Fleet - The resource type is <code>spot-fleet-request</code> and the unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>.</p> </li> <li> <p>EMR cluster - The resource type is <code>instancegroup</code> and the unique identifier is the cluster ID and instance group ID. Example: <code>instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0</code>.</p> </li> <li> <p>AppStream 2.0 fleet - The resource type is <code>fleet</code> and the unique identifier is the fleet name. Example: <code>fleet/sample-fleet</code>.</p> </li> <li> <p>DynamoDB table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>table/my-table</code>.</p> </li> <li> <p>DynamoDB global secondary index - The resource type is <code>index</code> and the unique identifier is the index name. Example: <code>table/my-table/index/my-table-index</code>.</p> </li> <li> <p>Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:my-db-cluster</code>.</p> </li> <li> <p>SageMaker endpoint variant - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> <li> <p>Custom resources are not supported with a resource type. This parameter must specify the <code>OutputValue</code> from the CloudFormation template stack used to access the resources. The unique identifier is defined by the service provider. More information is available in our <a href=\"https://github.com/aws/aws-auto-scaling-custom-resource\">GitHub repository</a>.</p> </li> <li> <p>Amazon Comprehend document classification endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Amazon Comprehend entity recognizer endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Lambda provisioned concurrency - The resource type is <code>function</code> and the unique identifier is the function name with a function version or alias name suffix that is not <code>$LATEST</code>. Example: <code>function:my-function:prod</code> or <code>function:my-function:1</code>.</p> </li> <li> <p>Amazon Keyspaces table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>keyspace/mykeyspace/table/mytable</code>.</p> </li> <li> <p>Amazon MSK cluster - The resource type and unique identifier are specified using the cluster ARN. Example: <code>arn:aws:kafka:us-east-1:123456789012:cluster/demo-cluster-1/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5</code>.</p> </li> <li> <p>Amazon ElastiCache replication group - The resource type is <code>replication-group</code> and the unique identifier is the replication group name. Example: <code>replication-group/mycluster</code>.</p> </li> <li> <p>Neptune cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:mycluster</code>.</p> </li> <li> <p>SageMaker Serverless endpoint - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> </ul>', 'PutScalingPolicyResponse$PolicyARN' => '<p>The Amazon Resource Name (ARN) of the resulting scaling policy.</p>', 'PutScheduledActionRequest$Schedule' => '<p>The schedule for this action. The following formats are supported:</p> <ul> <li> <p>At expressions - \"<code>at(<i>yyyy</i>-<i>mm</i>-<i>dd</i>T<i>hh</i>:<i>mm</i>:<i>ss</i>)</code>\"</p> </li> <li> <p>Rate expressions - \"<code>rate(<i>value</i> <i>unit</i>)</code>\"</p> </li> <li> <p>Cron expressions - \"<code>cron(<i>fields</i>)</code>\"</p> </li> </ul> <p>At expressions are useful for one-time schedules. Cron expressions are useful for scheduled actions that run periodically at a specified date and time, and rate expressions are useful for scheduled actions that run at a regular interval.</p> <p>At and cron expressions use Universal Coordinated Time (UTC) by default.</p> <p>The cron format consists of six fields separated by white spaces: [Minutes] [Hours] [Day_of_Month] [Month] [Day_of_Week] [Year].</p> <p>For rate expressions, <i>value</i> is a positive integer and <i>unit</i> is <code>minute</code> | <code>minutes</code> | <code>hour</code> | <code>hours</code> | <code>day</code> | <code>days</code>.</p> <p>For more information and examples, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/examples-scheduled-actions.html\">Example scheduled actions for Application Auto Scaling</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'PutScheduledActionRequest$Timezone' => '<p>Specifies the time zone used when setting a scheduled action by using an at or cron expression. If a time zone is not provided, UTC is used by default.</p> <p>Valid values are the canonical names of the IANA time zones supported by Joda-Time (such as <code>Etc/GMT+9</code> or <code>Pacific/Tahiti</code>). For more information, see <a href=\"https://www.joda.org/joda-time/timezones.html\">https://www.joda.org/joda-time/timezones.html</a>.</p>', 'PutScheduledActionRequest$ResourceId' => '<p>The identifier of the resource associated with the scheduled action. This string consists of the resource type and unique identifier.</p> <ul> <li> <p>ECS service - The resource type is <code>service</code> and the unique identifier is the cluster name and service name. Example: <code>service/default/sample-webapp</code>.</p> </li> <li> <p>Spot Fleet - The resource type is <code>spot-fleet-request</code> and the unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>.</p> </li> <li> <p>EMR cluster - The resource type is <code>instancegroup</code> and the unique identifier is the cluster ID and instance group ID. Example: <code>instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0</code>.</p> </li> <li> <p>AppStream 2.0 fleet - The resource type is <code>fleet</code> and the unique identifier is the fleet name. Example: <code>fleet/sample-fleet</code>.</p> </li> <li> <p>DynamoDB table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>table/my-table</code>.</p> </li> <li> <p>DynamoDB global secondary index - The resource type is <code>index</code> and the unique identifier is the index name. Example: <code>table/my-table/index/my-table-index</code>.</p> </li> <li> <p>Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:my-db-cluster</code>.</p> </li> <li> <p>SageMaker endpoint variant - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> <li> <p>Custom resources are not supported with a resource type. This parameter must specify the <code>OutputValue</code> from the CloudFormation template stack used to access the resources. The unique identifier is defined by the service provider. More information is available in our <a href=\"https://github.com/aws/aws-auto-scaling-custom-resource\">GitHub repository</a>.</p> </li> <li> <p>Amazon Comprehend document classification endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Amazon Comprehend entity recognizer endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Lambda provisioned concurrency - The resource type is <code>function</code> and the unique identifier is the function name with a function version or alias name suffix that is not <code>$LATEST</code>. Example: <code>function:my-function:prod</code> or <code>function:my-function:1</code>.</p> </li> <li> <p>Amazon Keyspaces table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>keyspace/mykeyspace/table/mytable</code>.</p> </li> <li> <p>Amazon MSK cluster - The resource type and unique identifier are specified using the cluster ARN. Example: <code>arn:aws:kafka:us-east-1:123456789012:cluster/demo-cluster-1/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5</code>.</p> </li> <li> <p>Amazon ElastiCache replication group - The resource type is <code>replication-group</code> and the unique identifier is the replication group name. Example: <code>replication-group/mycluster</code>.</p> </li> <li> <p>Neptune cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:mycluster</code>.</p> </li> <li> <p>SageMaker Serverless endpoint - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> </ul>', 'RegisterScalableTargetRequest$ResourceId' => '<p>The identifier of the resource that is associated with the scalable target. This string consists of the resource type and unique identifier.</p> <ul> <li> <p>ECS service - The resource type is <code>service</code> and the unique identifier is the cluster name and service name. Example: <code>service/default/sample-webapp</code>.</p> </li> <li> <p>Spot Fleet - The resource type is <code>spot-fleet-request</code> and the unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>.</p> </li> <li> <p>EMR cluster - The resource type is <code>instancegroup</code> and the unique identifier is the cluster ID and instance group ID. Example: <code>instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0</code>.</p> </li> <li> <p>AppStream 2.0 fleet - The resource type is <code>fleet</code> and the unique identifier is the fleet name. Example: <code>fleet/sample-fleet</code>.</p> </li> <li> <p>DynamoDB table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>table/my-table</code>.</p> </li> <li> <p>DynamoDB global secondary index - The resource type is <code>index</code> and the unique identifier is the index name. Example: <code>table/my-table/index/my-table-index</code>.</p> </li> <li> <p>Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:my-db-cluster</code>.</p> </li> <li> <p>SageMaker endpoint variant - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> <li> <p>Custom resources are not supported with a resource type. This parameter must specify the <code>OutputValue</code> from the CloudFormation template stack used to access the resources. The unique identifier is defined by the service provider. More information is available in our <a href=\"https://github.com/aws/aws-auto-scaling-custom-resource\">GitHub repository</a>.</p> </li> <li> <p>Amazon Comprehend document classification endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Amazon Comprehend entity recognizer endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Lambda provisioned concurrency - The resource type is <code>function</code> and the unique identifier is the function name with a function version or alias name suffix that is not <code>$LATEST</code>. Example: <code>function:my-function:prod</code> or <code>function:my-function:1</code>.</p> </li> <li> <p>Amazon Keyspaces table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>keyspace/mykeyspace/table/mytable</code>.</p> </li> <li> <p>Amazon MSK cluster - The resource type and unique identifier are specified using the cluster ARN. Example: <code>arn:aws:kafka:us-east-1:123456789012:cluster/demo-cluster-1/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5</code>.</p> </li> <li> <p>Amazon ElastiCache replication group - The resource type is <code>replication-group</code> and the unique identifier is the replication group name. Example: <code>replication-group/mycluster</code>.</p> </li> <li> <p>Neptune cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:mycluster</code>.</p> </li> <li> <p>SageMaker Serverless endpoint - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> </ul>', 'RegisterScalableTargetRequest$RoleARN' => '<p>This parameter is required for services that do not support service-linked roles (such as Amazon EMR), and it must specify the ARN of an IAM role that allows Application Auto Scaling to modify the scalable target on your behalf. </p> <p>If the service supports service-linked roles, Application Auto Scaling uses a service-linked role, which it creates if it does not yet exist. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/security_iam_service-with-iam.html#security_iam_service-with-iam-roles\">Application Auto Scaling IAM roles</a>.</p>', 'ResourceIdsMaxLen1600$member' => NULL, 'ScalableTarget$ResourceId' => '<p>The identifier of the resource associated with the scalable target. This string consists of the resource type and unique identifier.</p> <ul> <li> <p>ECS service - The resource type is <code>service</code> and the unique identifier is the cluster name and service name. Example: <code>service/default/sample-webapp</code>.</p> </li> <li> <p>Spot Fleet - The resource type is <code>spot-fleet-request</code> and the unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>.</p> </li> <li> <p>EMR cluster - The resource type is <code>instancegroup</code> and the unique identifier is the cluster ID and instance group ID. Example: <code>instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0</code>.</p> </li> <li> <p>AppStream 2.0 fleet - The resource type is <code>fleet</code> and the unique identifier is the fleet name. Example: <code>fleet/sample-fleet</code>.</p> </li> <li> <p>DynamoDB table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>table/my-table</code>.</p> </li> <li> <p>DynamoDB global secondary index - The resource type is <code>index</code> and the unique identifier is the index name. Example: <code>table/my-table/index/my-table-index</code>.</p> </li> <li> <p>Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:my-db-cluster</code>.</p> </li> <li> <p>SageMaker endpoint variant - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> <li> <p>Custom resources are not supported with a resource type. This parameter must specify the <code>OutputValue</code> from the CloudFormation template stack used to access the resources. The unique identifier is defined by the service provider. More information is available in our <a href=\"https://github.com/aws/aws-auto-scaling-custom-resource\">GitHub repository</a>.</p> </li> <li> <p>Amazon Comprehend document classification endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Amazon Comprehend entity recognizer endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Lambda provisioned concurrency - The resource type is <code>function</code> and the unique identifier is the function name with a function version or alias name suffix that is not <code>$LATEST</code>. Example: <code>function:my-function:prod</code> or <code>function:my-function:1</code>.</p> </li> <li> <p>Amazon Keyspaces table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>keyspace/mykeyspace/table/mytable</code>.</p> </li> <li> <p>Amazon MSK cluster - The resource type and unique identifier are specified using the cluster ARN. Example: <code>arn:aws:kafka:us-east-1:123456789012:cluster/demo-cluster-1/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5</code>.</p> </li> <li> <p>Amazon ElastiCache replication group - The resource type is <code>replication-group</code> and the unique identifier is the replication group name. Example: <code>replication-group/mycluster</code>.</p> </li> <li> <p>Neptune cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:mycluster</code>.</p> </li> <li> <p>SageMaker Serverless endpoint - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> </ul>', 'ScalableTarget$RoleARN' => '<p>The ARN of an IAM role that allows Application Auto Scaling to modify the scalable target on your behalf.</p>', 'ScalingActivity$ResourceId' => '<p>The identifier of the resource associated with the scaling activity. This string consists of the resource type and unique identifier.</p> <ul> <li> <p>ECS service - The resource type is <code>service</code> and the unique identifier is the cluster name and service name. Example: <code>service/default/sample-webapp</code>.</p> </li> <li> <p>Spot Fleet - The resource type is <code>spot-fleet-request</code> and the unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>.</p> </li> <li> <p>EMR cluster - The resource type is <code>instancegroup</code> and the unique identifier is the cluster ID and instance group ID. Example: <code>instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0</code>.</p> </li> <li> <p>AppStream 2.0 fleet - The resource type is <code>fleet</code> and the unique identifier is the fleet name. Example: <code>fleet/sample-fleet</code>.</p> </li> <li> <p>DynamoDB table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>table/my-table</code>.</p> </li> <li> <p>DynamoDB global secondary index - The resource type is <code>index</code> and the unique identifier is the index name. Example: <code>table/my-table/index/my-table-index</code>.</p> </li> <li> <p>Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:my-db-cluster</code>.</p> </li> <li> <p>SageMaker endpoint variant - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> <li> <p>Custom resources are not supported with a resource type. This parameter must specify the <code>OutputValue</code> from the CloudFormation template stack used to access the resources. The unique identifier is defined by the service provider. More information is available in our <a href=\"https://github.com/aws/aws-auto-scaling-custom-resource\">GitHub repository</a>.</p> </li> <li> <p>Amazon Comprehend document classification endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Amazon Comprehend entity recognizer endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Lambda provisioned concurrency - The resource type is <code>function</code> and the unique identifier is the function name with a function version or alias name suffix that is not <code>$LATEST</code>. Example: <code>function:my-function:prod</code> or <code>function:my-function:1</code>.</p> </li> <li> <p>Amazon Keyspaces table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>keyspace/mykeyspace/table/mytable</code>.</p> </li> <li> <p>Amazon MSK cluster - The resource type and unique identifier are specified using the cluster ARN. Example: <code>arn:aws:kafka:us-east-1:123456789012:cluster/demo-cluster-1/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5</code>.</p> </li> <li> <p>Amazon ElastiCache replication group - The resource type is <code>replication-group</code> and the unique identifier is the replication group name. Example: <code>replication-group/mycluster</code>.</p> </li> <li> <p>Neptune cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:mycluster</code>.</p> </li> <li> <p>SageMaker Serverless endpoint - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> </ul>', 'ScalingPolicy$PolicyARN' => '<p>The Amazon Resource Name (ARN) of the scaling policy.</p>', 'ScalingPolicy$ResourceId' => '<p>The identifier of the resource associated with the scaling policy. This string consists of the resource type and unique identifier.</p> <ul> <li> <p>ECS service - The resource type is <code>service</code> and the unique identifier is the cluster name and service name. Example: <code>service/default/sample-webapp</code>.</p> </li> <li> <p>Spot Fleet - The resource type is <code>spot-fleet-request</code> and the unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>.</p> </li> <li> <p>EMR cluster - The resource type is <code>instancegroup</code> and the unique identifier is the cluster ID and instance group ID. Example: <code>instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0</code>.</p> </li> <li> <p>AppStream 2.0 fleet - The resource type is <code>fleet</code> and the unique identifier is the fleet name. Example: <code>fleet/sample-fleet</code>.</p> </li> <li> <p>DynamoDB table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>table/my-table</code>.</p> </li> <li> <p>DynamoDB global secondary index - The resource type is <code>index</code> and the unique identifier is the index name. Example: <code>table/my-table/index/my-table-index</code>.</p> </li> <li> <p>Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:my-db-cluster</code>.</p> </li> <li> <p>SageMaker endpoint variant - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> <li> <p>Custom resources are not supported with a resource type. This parameter must specify the <code>OutputValue</code> from the CloudFormation template stack used to access the resources. The unique identifier is defined by the service provider. More information is available in our <a href=\"https://github.com/aws/aws-auto-scaling-custom-resource\">GitHub repository</a>.</p> </li> <li> <p>Amazon Comprehend document classification endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Amazon Comprehend entity recognizer endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Lambda provisioned concurrency - The resource type is <code>function</code> and the unique identifier is the function name with a function version or alias name suffix that is not <code>$LATEST</code>. Example: <code>function:my-function:prod</code> or <code>function:my-function:1</code>.</p> </li> <li> <p>Amazon Keyspaces table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>keyspace/mykeyspace/table/mytable</code>.</p> </li> <li> <p>Amazon MSK cluster - The resource type and unique identifier are specified using the cluster ARN. Example: <code>arn:aws:kafka:us-east-1:123456789012:cluster/demo-cluster-1/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5</code>.</p> </li> <li> <p>Amazon ElastiCache replication group - The resource type is <code>replication-group</code> and the unique identifier is the replication group name. Example: <code>replication-group/mycluster</code>.</p> </li> <li> <p>Neptune cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:mycluster</code>.</p> </li> <li> <p>SageMaker Serverless endpoint - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> </ul>', 'ScheduledAction$ScheduledActionARN' => '<p>The Amazon Resource Name (ARN) of the scheduled action.</p>', 'ScheduledAction$Schedule' => '<p>The schedule for this action. The following formats are supported:</p> <ul> <li> <p>At expressions - \"<code>at(<i>yyyy</i>-<i>mm</i>-<i>dd</i>T<i>hh</i>:<i>mm</i>:<i>ss</i>)</code>\"</p> </li> <li> <p>Rate expressions - \"<code>rate(<i>value</i> <i>unit</i>)</code>\"</p> </li> <li> <p>Cron expressions - \"<code>cron(<i>fields</i>)</code>\"</p> </li> </ul> <p>At expressions are useful for one-time schedules. Cron expressions are useful for scheduled actions that run periodically at a specified date and time, and rate expressions are useful for scheduled actions that run at a regular interval.</p> <p>At and cron expressions use Universal Coordinated Time (UTC) by default.</p> <p>The cron format consists of six fields separated by white spaces: [Minutes] [Hours] [Day_of_Month] [Month] [Day_of_Week] [Year].</p> <p>For rate expressions, <i>value</i> is a positive integer and <i>unit</i> is <code>minute</code> | <code>minutes</code> | <code>hour</code> | <code>hours</code> | <code>day</code> | <code>days</code>.</p> <p>For more information and examples, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/examples-scheduled-actions.html\">Example scheduled actions for Application Auto Scaling</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'ScheduledAction$Timezone' => '<p>The time zone used when referring to the date and time of a scheduled action, when the scheduled action uses an at or cron expression.</p>', 'ScheduledAction$ResourceId' => '<p>The identifier of the resource associated with the scaling policy. This string consists of the resource type and unique identifier.</p> <ul> <li> <p>ECS service - The resource type is <code>service</code> and the unique identifier is the cluster name and service name. Example: <code>service/default/sample-webapp</code>.</p> </li> <li> <p>Spot Fleet - The resource type is <code>spot-fleet-request</code> and the unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>.</p> </li> <li> <p>EMR cluster - The resource type is <code>instancegroup</code> and the unique identifier is the cluster ID and instance group ID. Example: <code>instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0</code>.</p> </li> <li> <p>AppStream 2.0 fleet - The resource type is <code>fleet</code> and the unique identifier is the fleet name. Example: <code>fleet/sample-fleet</code>.</p> </li> <li> <p>DynamoDB table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>table/my-table</code>.</p> </li> <li> <p>DynamoDB global secondary index - The resource type is <code>index</code> and the unique identifier is the index name. Example: <code>table/my-table/index/my-table-index</code>.</p> </li> <li> <p>Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:my-db-cluster</code>.</p> </li> <li> <p>SageMaker endpoint variant - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> <li> <p>Custom resources are not supported with a resource type. This parameter must specify the <code>OutputValue</code> from the CloudFormation template stack used to access the resources. The unique identifier is defined by the service provider. More information is available in our <a href=\"https://github.com/aws/aws-auto-scaling-custom-resource\">GitHub repository</a>.</p> </li> <li> <p>Amazon Comprehend document classification endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Amazon Comprehend entity recognizer endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Lambda provisioned concurrency - The resource type is <code>function</code> and the unique identifier is the function name with a function version or alias name suffix that is not <code>$LATEST</code>. Example: <code>function:my-function:prod</code> or <code>function:my-function:1</code>.</p> </li> <li> <p>Amazon Keyspaces table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>keyspace/mykeyspace/table/mytable</code>.</p> </li> <li> <p>Amazon MSK cluster - The resource type and unique identifier are specified using the cluster ARN. Example: <code>arn:aws:kafka:us-east-1:123456789012:cluster/demo-cluster-1/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5</code>.</p> </li> <li> <p>Amazon ElastiCache replication group - The resource type is <code>replication-group</code> and the unique identifier is the replication group name. Example: <code>replication-group/mycluster</code>.</p> </li> <li> <p>Neptune cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:mycluster</code>.</p> </li> <li> <p>SageMaker Serverless endpoint - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> </ul>', ], ], 'ResourceIdsMaxLen1600' => [ 'base' => NULL, 'refs' => [ 'DescribeScalableTargetsRequest$ResourceIds' => '<p>The identifier of the resource associated with the scalable target. This string consists of the resource type and unique identifier.</p> <ul> <li> <p>ECS service - The resource type is <code>service</code> and the unique identifier is the cluster name and service name. Example: <code>service/default/sample-webapp</code>.</p> </li> <li> <p>Spot Fleet - The resource type is <code>spot-fleet-request</code> and the unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>.</p> </li> <li> <p>EMR cluster - The resource type is <code>instancegroup</code> and the unique identifier is the cluster ID and instance group ID. Example: <code>instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0</code>.</p> </li> <li> <p>AppStream 2.0 fleet - The resource type is <code>fleet</code> and the unique identifier is the fleet name. Example: <code>fleet/sample-fleet</code>.</p> </li> <li> <p>DynamoDB table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>table/my-table</code>.</p> </li> <li> <p>DynamoDB global secondary index - The resource type is <code>index</code> and the unique identifier is the index name. Example: <code>table/my-table/index/my-table-index</code>.</p> </li> <li> <p>Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:my-db-cluster</code>.</p> </li> <li> <p>SageMaker endpoint variant - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> <li> <p>Custom resources are not supported with a resource type. This parameter must specify the <code>OutputValue</code> from the CloudFormation template stack used to access the resources. The unique identifier is defined by the service provider. More information is available in our <a href=\"https://github.com/aws/aws-auto-scaling-custom-resource\">GitHub repository</a>.</p> </li> <li> <p>Amazon Comprehend document classification endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Amazon Comprehend entity recognizer endpoint - The resource type and unique identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint/EXAMPLE</code>.</p> </li> <li> <p>Lambda provisioned concurrency - The resource type is <code>function</code> and the unique identifier is the function name with a function version or alias name suffix that is not <code>$LATEST</code>. Example: <code>function:my-function:prod</code> or <code>function:my-function:1</code>.</p> </li> <li> <p>Amazon Keyspaces table - The resource type is <code>table</code> and the unique identifier is the table name. Example: <code>keyspace/mykeyspace/table/mytable</code>.</p> </li> <li> <p>Amazon MSK cluster - The resource type and unique identifier are specified using the cluster ARN. Example: <code>arn:aws:kafka:us-east-1:123456789012:cluster/demo-cluster-1/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5</code>.</p> </li> <li> <p>Amazon ElastiCache replication group - The resource type is <code>replication-group</code> and the unique identifier is the replication group name. Example: <code>replication-group/mycluster</code>.</p> </li> <li> <p>Neptune cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:mycluster</code>.</p> </li> <li> <p>SageMaker Serverless endpoint - The resource type is <code>variant</code> and the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>.</p> </li> </ul>', 'DescribeScalingPoliciesRequest$PolicyNames' => '<p>The names of the scaling policies to describe.</p>', 'DescribeScheduledActionsRequest$ScheduledActionNames' => '<p>The names of the scheduled actions to describe.</p>', ], ], 'ResourceLabel' => [ 'base' => NULL, 'refs' => [ 'PredefinedMetricSpecification$ResourceLabel' => '<p>Identifies the resource associated with the metric type. You can\\'t specify a resource label unless the metric type is <code>ALBRequestCountPerTarget</code> and there is a target group attached to the Spot Fleet or ECS service.</p> <p>You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:</p> <p> <code>app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff</code>.</p> <p>Where:</p> <ul> <li> <p>app/&lt;load-balancer-name&gt;/&lt;load-balancer-id&gt; is the final portion of the load balancer ARN</p> </li> <li> <p>targetgroup/&lt;target-group-name&gt;/&lt;target-group-id&gt; is the final portion of the target group ARN.</p> </li> </ul> <p>To find the ARN for an Application Load Balancer, use the <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html\">DescribeLoadBalancers</a> API operation. To find the ARN for the target group, use the <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html\">DescribeTargetGroups</a> API operation.</p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p>The specified resource doesn\\'t exist.</p>', 'refs' => [], ], 'ReturnData' => [ 'base' => NULL, 'refs' => [ 'TargetTrackingMetricDataQuery$ReturnData' => '<p>Indicates whether to return the timestamps and raw data values of this metric. </p> <p>If you use any math expressions, specify <code>true</code> for this value for only the final math expression that the metric specification is based on. You must specify <code>false</code> for <code>ReturnData</code> for all the other metrics and expressions used in the metric specification.</p> <p>If you are only retrieving metrics and not performing any math expressions, do not specify anything for <code>ReturnData</code>. This sets it to its default (<code>true</code>).</p>', ], ], 'ScalableDimension' => [ 'base' => NULL, 'refs' => [ 'DeleteScalingPolicyRequest$ScalableDimension' => '<p>The scalable dimension. This string consists of the service namespace, resource type, and scaling property.</p> <ul> <li> <p> <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service.</p> </li> <li> <p> <code>elasticmapreduce:instancegroup:InstanceCount</code> - The instance count of an EMR Instance Group.</p> </li> <li> <p> <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot Fleet.</p> </li> <li> <p> <code>appstream:fleet:DesiredCapacity</code> - The desired capacity of an AppStream 2.0 fleet.</p> </li> <li> <p> <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.</p> </li> <li> <p> <code>sagemaker:variant:DesiredInstanceCount</code> - The number of EC2 instances for a SageMaker model endpoint variant.</p> </li> <li> <p> <code>custom-resource:ResourceType:Property</code> - The scalable dimension for a custom resource provided by your own application or service.</p> </li> <li> <p> <code>comprehend:document-classifier-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend document classification endpoint.</p> </li> <li> <p> <code>comprehend:entity-recognizer-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend entity recognizer endpoint.</p> </li> <li> <p> <code>lambda:function:ProvisionedConcurrency</code> - The provisioned concurrency for a Lambda function.</p> </li> <li> <p> <code>cassandra:table:ReadCapacityUnits</code> - The provisioned read capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>cassandra:table:WriteCapacityUnits</code> - The provisioned write capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>kafka:broker-storage:VolumeSize</code> - The provisioned volume size (in GiB) for brokers in an Amazon MSK cluster.</p> </li> <li> <p> <code>elasticache:replication-group:NodeGroups</code> - The number of node groups for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>elasticache:replication-group:Replicas</code> - The number of replicas per node group for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>neptune:cluster:ReadReplicaCount</code> - The count of read replicas in an Amazon Neptune DB cluster.</p> </li> <li> <p> <code>sagemaker:variant:DesiredProvisionedConcurrency</code> - The provisioned concurrency for a SageMaker Serverless endpoint.</p> </li> </ul>', 'DeleteScheduledActionRequest$ScalableDimension' => '<p>The scalable dimension. This string consists of the service namespace, resource type, and scaling property.</p> <ul> <li> <p> <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service.</p> </li> <li> <p> <code>elasticmapreduce:instancegroup:InstanceCount</code> - The instance count of an EMR Instance Group.</p> </li> <li> <p> <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot Fleet.</p> </li> <li> <p> <code>appstream:fleet:DesiredCapacity</code> - The desired capacity of an AppStream 2.0 fleet.</p> </li> <li> <p> <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.</p> </li> <li> <p> <code>sagemaker:variant:DesiredInstanceCount</code> - The number of EC2 instances for a SageMaker model endpoint variant.</p> </li> <li> <p> <code>custom-resource:ResourceType:Property</code> - The scalable dimension for a custom resource provided by your own application or service.</p> </li> <li> <p> <code>comprehend:document-classifier-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend document classification endpoint.</p> </li> <li> <p> <code>comprehend:entity-recognizer-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend entity recognizer endpoint.</p> </li> <li> <p> <code>lambda:function:ProvisionedConcurrency</code> - The provisioned concurrency for a Lambda function.</p> </li> <li> <p> <code>cassandra:table:ReadCapacityUnits</code> - The provisioned read capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>cassandra:table:WriteCapacityUnits</code> - The provisioned write capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>kafka:broker-storage:VolumeSize</code> - The provisioned volume size (in GiB) for brokers in an Amazon MSK cluster.</p> </li> <li> <p> <code>elasticache:replication-group:NodeGroups</code> - The number of node groups for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>elasticache:replication-group:Replicas</code> - The number of replicas per node group for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>neptune:cluster:ReadReplicaCount</code> - The count of read replicas in an Amazon Neptune DB cluster.</p> </li> <li> <p> <code>sagemaker:variant:DesiredProvisionedConcurrency</code> - The provisioned concurrency for a SageMaker Serverless endpoint.</p> </li> </ul>', 'DeregisterScalableTargetRequest$ScalableDimension' => '<p>The scalable dimension associated with the scalable target. This string consists of the service namespace, resource type, and scaling property.</p> <ul> <li> <p> <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service.</p> </li> <li> <p> <code>elasticmapreduce:instancegroup:InstanceCount</code> - The instance count of an EMR Instance Group.</p> </li> <li> <p> <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot Fleet.</p> </li> <li> <p> <code>appstream:fleet:DesiredCapacity</code> - The desired capacity of an AppStream 2.0 fleet.</p> </li> <li> <p> <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.</p> </li> <li> <p> <code>sagemaker:variant:DesiredInstanceCount</code> - The number of EC2 instances for a SageMaker model endpoint variant.</p> </li> <li> <p> <code>custom-resource:ResourceType:Property</code> - The scalable dimension for a custom resource provided by your own application or service.</p> </li> <li> <p> <code>comprehend:document-classifier-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend document classification endpoint.</p> </li> <li> <p> <code>comprehend:entity-recognizer-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend entity recognizer endpoint.</p> </li> <li> <p> <code>lambda:function:ProvisionedConcurrency</code> - The provisioned concurrency for a Lambda function.</p> </li> <li> <p> <code>cassandra:table:ReadCapacityUnits</code> - The provisioned read capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>cassandra:table:WriteCapacityUnits</code> - The provisioned write capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>kafka:broker-storage:VolumeSize</code> - The provisioned volume size (in GiB) for brokers in an Amazon MSK cluster.</p> </li> <li> <p> <code>elasticache:replication-group:NodeGroups</code> - The number of node groups for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>elasticache:replication-group:Replicas</code> - The number of replicas per node group for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>neptune:cluster:ReadReplicaCount</code> - The count of read replicas in an Amazon Neptune DB cluster.</p> </li> <li> <p> <code>sagemaker:variant:DesiredProvisionedConcurrency</code> - The provisioned concurrency for a SageMaker Serverless endpoint.</p> </li> </ul>', 'DescribeScalableTargetsRequest$ScalableDimension' => '<p>The scalable dimension associated with the scalable target. This string consists of the service namespace, resource type, and scaling property. If you specify a scalable dimension, you must also specify a resource ID.</p> <ul> <li> <p> <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service.</p> </li> <li> <p> <code>elasticmapreduce:instancegroup:InstanceCount</code> - The instance count of an EMR Instance Group.</p> </li> <li> <p> <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot Fleet.</p> </li> <li> <p> <code>appstream:fleet:DesiredCapacity</code> - The desired capacity of an AppStream 2.0 fleet.</p> </li> <li> <p> <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.</p> </li> <li> <p> <code>sagemaker:variant:DesiredInstanceCount</code> - The number of EC2 instances for a SageMaker model endpoint variant.</p> </li> <li> <p> <code>custom-resource:ResourceType:Property</code> - The scalable dimension for a custom resource provided by your own application or service.</p> </li> <li> <p> <code>comprehend:document-classifier-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend document classification endpoint.</p> </li> <li> <p> <code>comprehend:entity-recognizer-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend entity recognizer endpoint.</p> </li> <li> <p> <code>lambda:function:ProvisionedConcurrency</code> - The provisioned concurrency for a Lambda function.</p> </li> <li> <p> <code>cassandra:table:ReadCapacityUnits</code> - The provisioned read capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>cassandra:table:WriteCapacityUnits</code> - The provisioned write capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>kafka:broker-storage:VolumeSize</code> - The provisioned volume size (in GiB) for brokers in an Amazon MSK cluster.</p> </li> <li> <p> <code>elasticache:replication-group:NodeGroups</code> - The number of node groups for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>elasticache:replication-group:Replicas</code> - The number of replicas per node group for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>neptune:cluster:ReadReplicaCount</code> - The count of read replicas in an Amazon Neptune DB cluster.</p> </li> <li> <p> <code>sagemaker:variant:DesiredProvisionedConcurrency</code> - The provisioned concurrency for a SageMaker Serverless endpoint.</p> </li> </ul>', 'DescribeScalingActivitiesRequest$ScalableDimension' => '<p>The scalable dimension. This string consists of the service namespace, resource type, and scaling property. If you specify a scalable dimension, you must also specify a resource ID.</p> <ul> <li> <p> <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service.</p> </li> <li> <p> <code>elasticmapreduce:instancegroup:InstanceCount</code> - The instance count of an EMR Instance Group.</p> </li> <li> <p> <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot Fleet.</p> </li> <li> <p> <code>appstream:fleet:DesiredCapacity</code> - The desired capacity of an AppStream 2.0 fleet.</p> </li> <li> <p> <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.</p> </li> <li> <p> <code>sagemaker:variant:DesiredInstanceCount</code> - The number of EC2 instances for a SageMaker model endpoint variant.</p> </li> <li> <p> <code>custom-resource:ResourceType:Property</code> - The scalable dimension for a custom resource provided by your own application or service.</p> </li> <li> <p> <code>comprehend:document-classifier-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend document classification endpoint.</p> </li> <li> <p> <code>comprehend:entity-recognizer-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend entity recognizer endpoint.</p> </li> <li> <p> <code>lambda:function:ProvisionedConcurrency</code> - The provisioned concurrency for a Lambda function.</p> </li> <li> <p> <code>cassandra:table:ReadCapacityUnits</code> - The provisioned read capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>cassandra:table:WriteCapacityUnits</code> - The provisioned write capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>kafka:broker-storage:VolumeSize</code> - The provisioned volume size (in GiB) for brokers in an Amazon MSK cluster.</p> </li> <li> <p> <code>elasticache:replication-group:NodeGroups</code> - The number of node groups for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>elasticache:replication-group:Replicas</code> - The number of replicas per node group for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>neptune:cluster:ReadReplicaCount</code> - The count of read replicas in an Amazon Neptune DB cluster.</p> </li> <li> <p> <code>sagemaker:variant:DesiredProvisionedConcurrency</code> - The provisioned concurrency for a SageMaker Serverless endpoint.</p> </li> </ul>', 'DescribeScalingPoliciesRequest$ScalableDimension' => '<p>The scalable dimension. This string consists of the service namespace, resource type, and scaling property. If you specify a scalable dimension, you must also specify a resource ID.</p> <ul> <li> <p> <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service.</p> </li> <li> <p> <code>elasticmapreduce:instancegroup:InstanceCount</code> - The instance count of an EMR Instance Group.</p> </li> <li> <p> <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot Fleet.</p> </li> <li> <p> <code>appstream:fleet:DesiredCapacity</code> - The desired capacity of an AppStream 2.0 fleet.</p> </li> <li> <p> <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.</p> </li> <li> <p> <code>sagemaker:variant:DesiredInstanceCount</code> - The number of EC2 instances for a SageMaker model endpoint variant.</p> </li> <li> <p> <code>custom-resource:ResourceType:Property</code> - The scalable dimension for a custom resource provided by your own application or service.</p> </li> <li> <p> <code>comprehend:document-classifier-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend document classification endpoint.</p> </li> <li> <p> <code>comprehend:entity-recognizer-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend entity recognizer endpoint.</p> </li> <li> <p> <code>lambda:function:ProvisionedConcurrency</code> - The provisioned concurrency for a Lambda function.</p> </li> <li> <p> <code>cassandra:table:ReadCapacityUnits</code> - The provisioned read capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>cassandra:table:WriteCapacityUnits</code> - The provisioned write capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>kafka:broker-storage:VolumeSize</code> - The provisioned volume size (in GiB) for brokers in an Amazon MSK cluster.</p> </li> <li> <p> <code>elasticache:replication-group:NodeGroups</code> - The number of node groups for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>elasticache:replication-group:Replicas</code> - The number of replicas per node group for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>neptune:cluster:ReadReplicaCount</code> - The count of read replicas in an Amazon Neptune DB cluster.</p> </li> <li> <p> <code>sagemaker:variant:DesiredProvisionedConcurrency</code> - The provisioned concurrency for a SageMaker Serverless endpoint.</p> </li> </ul>', 'DescribeScheduledActionsRequest$ScalableDimension' => '<p>The scalable dimension. This string consists of the service namespace, resource type, and scaling property. If you specify a scalable dimension, you must also specify a resource ID.</p> <ul> <li> <p> <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service.</p> </li> <li> <p> <code>elasticmapreduce:instancegroup:InstanceCount</code> - The instance count of an EMR Instance Group.</p> </li> <li> <p> <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot Fleet.</p> </li> <li> <p> <code>appstream:fleet:DesiredCapacity</code> - The desired capacity of an AppStream 2.0 fleet.</p> </li> <li> <p> <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.</p> </li> <li> <p> <code>sagemaker:variant:DesiredInstanceCount</code> - The number of EC2 instances for a SageMaker model endpoint variant.</p> </li> <li> <p> <code>custom-resource:ResourceType:Property</code> - The scalable dimension for a custom resource provided by your own application or service.</p> </li> <li> <p> <code>comprehend:document-classifier-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend document classification endpoint.</p> </li> <li> <p> <code>comprehend:entity-recognizer-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend entity recognizer endpoint.</p> </li> <li> <p> <code>lambda:function:ProvisionedConcurrency</code> - The provisioned concurrency for a Lambda function.</p> </li> <li> <p> <code>cassandra:table:ReadCapacityUnits</code> - The provisioned read capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>cassandra:table:WriteCapacityUnits</code> - The provisioned write capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>kafka:broker-storage:VolumeSize</code> - The provisioned volume size (in GiB) for brokers in an Amazon MSK cluster.</p> </li> <li> <p> <code>elasticache:replication-group:NodeGroups</code> - The number of node groups for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>elasticache:replication-group:Replicas</code> - The number of replicas per node group for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>neptune:cluster:ReadReplicaCount</code> - The count of read replicas in an Amazon Neptune DB cluster.</p> </li> <li> <p> <code>sagemaker:variant:DesiredProvisionedConcurrency</code> - The provisioned concurrency for a SageMaker Serverless endpoint.</p> </li> </ul>', 'PutScalingPolicyRequest$ScalableDimension' => '<p>The scalable dimension. This string consists of the service namespace, resource type, and scaling property.</p> <ul> <li> <p> <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service.</p> </li> <li> <p> <code>elasticmapreduce:instancegroup:InstanceCount</code> - The instance count of an EMR Instance Group.</p> </li> <li> <p> <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot Fleet.</p> </li> <li> <p> <code>appstream:fleet:DesiredCapacity</code> - The desired capacity of an AppStream 2.0 fleet.</p> </li> <li> <p> <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.</p> </li> <li> <p> <code>sagemaker:variant:DesiredInstanceCount</code> - The number of EC2 instances for a SageMaker model endpoint variant.</p> </li> <li> <p> <code>custom-resource:ResourceType:Property</code> - The scalable dimension for a custom resource provided by your own application or service.</p> </li> <li> <p> <code>comprehend:document-classifier-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend document classification endpoint.</p> </li> <li> <p> <code>comprehend:entity-recognizer-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend entity recognizer endpoint.</p> </li> <li> <p> <code>lambda:function:ProvisionedConcurrency</code> - The provisioned concurrency for a Lambda function.</p> </li> <li> <p> <code>cassandra:table:ReadCapacityUnits</code> - The provisioned read capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>cassandra:table:WriteCapacityUnits</code> - The provisioned write capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>kafka:broker-storage:VolumeSize</code> - The provisioned volume size (in GiB) for brokers in an Amazon MSK cluster.</p> </li> <li> <p> <code>elasticache:replication-group:NodeGroups</code> - The number of node groups for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>elasticache:replication-group:Replicas</code> - The number of replicas per node group for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>neptune:cluster:ReadReplicaCount</code> - The count of read replicas in an Amazon Neptune DB cluster.</p> </li> <li> <p> <code>sagemaker:variant:DesiredProvisionedConcurrency</code> - The provisioned concurrency for a SageMaker Serverless endpoint.</p> </li> </ul>', 'PutScheduledActionRequest$ScalableDimension' => '<p>The scalable dimension. This string consists of the service namespace, resource type, and scaling property.</p> <ul> <li> <p> <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service.</p> </li> <li> <p> <code>elasticmapreduce:instancegroup:InstanceCount</code> - The instance count of an EMR Instance Group.</p> </li> <li> <p> <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot Fleet.</p> </li> <li> <p> <code>appstream:fleet:DesiredCapacity</code> - The desired capacity of an AppStream 2.0 fleet.</p> </li> <li> <p> <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.</p> </li> <li> <p> <code>sagemaker:variant:DesiredInstanceCount</code> - The number of EC2 instances for a SageMaker model endpoint variant.</p> </li> <li> <p> <code>custom-resource:ResourceType:Property</code> - The scalable dimension for a custom resource provided by your own application or service.</p> </li> <li> <p> <code>comprehend:document-classifier-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend document classification endpoint.</p> </li> <li> <p> <code>comprehend:entity-recognizer-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend entity recognizer endpoint.</p> </li> <li> <p> <code>lambda:function:ProvisionedConcurrency</code> - The provisioned concurrency for a Lambda function.</p> </li> <li> <p> <code>cassandra:table:ReadCapacityUnits</code> - The provisioned read capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>cassandra:table:WriteCapacityUnits</code> - The provisioned write capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>kafka:broker-storage:VolumeSize</code> - The provisioned volume size (in GiB) for brokers in an Amazon MSK cluster.</p> </li> <li> <p> <code>elasticache:replication-group:NodeGroups</code> - The number of node groups for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>elasticache:replication-group:Replicas</code> - The number of replicas per node group for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>neptune:cluster:ReadReplicaCount</code> - The count of read replicas in an Amazon Neptune DB cluster.</p> </li> <li> <p> <code>sagemaker:variant:DesiredProvisionedConcurrency</code> - The provisioned concurrency for a SageMaker Serverless endpoint.</p> </li> </ul>', 'RegisterScalableTargetRequest$ScalableDimension' => '<p>The scalable dimension associated with the scalable target. This string consists of the service namespace, resource type, and scaling property.</p> <ul> <li> <p> <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service.</p> </li> <li> <p> <code>elasticmapreduce:instancegroup:InstanceCount</code> - The instance count of an EMR Instance Group.</p> </li> <li> <p> <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot Fleet.</p> </li> <li> <p> <code>appstream:fleet:DesiredCapacity</code> - The desired capacity of an AppStream 2.0 fleet.</p> </li> <li> <p> <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.</p> </li> <li> <p> <code>sagemaker:variant:DesiredInstanceCount</code> - The number of EC2 instances for a SageMaker model endpoint variant.</p> </li> <li> <p> <code>custom-resource:ResourceType:Property</code> - The scalable dimension for a custom resource provided by your own application or service.</p> </li> <li> <p> <code>comprehend:document-classifier-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend document classification endpoint.</p> </li> <li> <p> <code>comprehend:entity-recognizer-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend entity recognizer endpoint.</p> </li> <li> <p> <code>lambda:function:ProvisionedConcurrency</code> - The provisioned concurrency for a Lambda function.</p> </li> <li> <p> <code>cassandra:table:ReadCapacityUnits</code> - The provisioned read capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>cassandra:table:WriteCapacityUnits</code> - The provisioned write capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>kafka:broker-storage:VolumeSize</code> - The provisioned volume size (in GiB) for brokers in an Amazon MSK cluster.</p> </li> <li> <p> <code>elasticache:replication-group:NodeGroups</code> - The number of node groups for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>elasticache:replication-group:Replicas</code> - The number of replicas per node group for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>neptune:cluster:ReadReplicaCount</code> - The count of read replicas in an Amazon Neptune DB cluster.</p> </li> <li> <p> <code>sagemaker:variant:DesiredProvisionedConcurrency</code> - The provisioned concurrency for a SageMaker Serverless endpoint.</p> </li> </ul>', 'ScalableTarget$ScalableDimension' => '<p>The scalable dimension associated with the scalable target. This string consists of the service namespace, resource type, and scaling property.</p> <ul> <li> <p> <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service.</p> </li> <li> <p> <code>elasticmapreduce:instancegroup:InstanceCount</code> - The instance count of an EMR Instance Group.</p> </li> <li> <p> <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot Fleet.</p> </li> <li> <p> <code>appstream:fleet:DesiredCapacity</code> - The desired capacity of an AppStream 2.0 fleet.</p> </li> <li> <p> <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.</p> </li> <li> <p> <code>sagemaker:variant:DesiredInstanceCount</code> - The number of EC2 instances for a SageMaker model endpoint variant.</p> </li> <li> <p> <code>custom-resource:ResourceType:Property</code> - The scalable dimension for a custom resource provided by your own application or service.</p> </li> <li> <p> <code>comprehend:document-classifier-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend document classification endpoint.</p> </li> <li> <p> <code>comprehend:entity-recognizer-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend entity recognizer endpoint.</p> </li> <li> <p> <code>lambda:function:ProvisionedConcurrency</code> - The provisioned concurrency for a Lambda function.</p> </li> <li> <p> <code>cassandra:table:ReadCapacityUnits</code> - The provisioned read capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>cassandra:table:WriteCapacityUnits</code> - The provisioned write capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>kafka:broker-storage:VolumeSize</code> - The provisioned volume size (in GiB) for brokers in an Amazon MSK cluster.</p> </li> <li> <p> <code>elasticache:replication-group:NodeGroups</code> - The number of node groups for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>elasticache:replication-group:Replicas</code> - The number of replicas per node group for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>neptune:cluster:ReadReplicaCount</code> - The count of read replicas in an Amazon Neptune DB cluster.</p> </li> <li> <p> <code>sagemaker:variant:DesiredProvisionedConcurrency</code> - The provisioned concurrency for a SageMaker Serverless endpoint.</p> </li> </ul>', 'ScalingActivity$ScalableDimension' => '<p>The scalable dimension. This string consists of the service namespace, resource type, and scaling property.</p> <ul> <li> <p> <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service.</p> </li> <li> <p> <code>elasticmapreduce:instancegroup:InstanceCount</code> - The instance count of an EMR Instance Group.</p> </li> <li> <p> <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot Fleet.</p> </li> <li> <p> <code>appstream:fleet:DesiredCapacity</code> - The desired capacity of an AppStream 2.0 fleet.</p> </li> <li> <p> <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.</p> </li> <li> <p> <code>sagemaker:variant:DesiredInstanceCount</code> - The number of EC2 instances for a SageMaker model endpoint variant.</p> </li> <li> <p> <code>custom-resource:ResourceType:Property</code> - The scalable dimension for a custom resource provided by your own application or service.</p> </li> <li> <p> <code>comprehend:document-classifier-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend document classification endpoint.</p> </li> <li> <p> <code>comprehend:entity-recognizer-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend entity recognizer endpoint.</p> </li> <li> <p> <code>lambda:function:ProvisionedConcurrency</code> - The provisioned concurrency for a Lambda function.</p> </li> <li> <p> <code>cassandra:table:ReadCapacityUnits</code> - The provisioned read capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>cassandra:table:WriteCapacityUnits</code> - The provisioned write capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>kafka:broker-storage:VolumeSize</code> - The provisioned volume size (in GiB) for brokers in an Amazon MSK cluster.</p> </li> <li> <p> <code>elasticache:replication-group:NodeGroups</code> - The number of node groups for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>elasticache:replication-group:Replicas</code> - The number of replicas per node group for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>neptune:cluster:ReadReplicaCount</code> - The count of read replicas in an Amazon Neptune DB cluster.</p> </li> <li> <p> <code>sagemaker:variant:DesiredProvisionedConcurrency</code> - The provisioned concurrency for a SageMaker Serverless endpoint.</p> </li> </ul>', 'ScalingPolicy$ScalableDimension' => '<p>The scalable dimension. This string consists of the service namespace, resource type, and scaling property.</p> <ul> <li> <p> <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service.</p> </li> <li> <p> <code>elasticmapreduce:instancegroup:InstanceCount</code> - The instance count of an EMR Instance Group.</p> </li> <li> <p> <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot Fleet.</p> </li> <li> <p> <code>appstream:fleet:DesiredCapacity</code> - The desired capacity of an AppStream 2.0 fleet.</p> </li> <li> <p> <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.</p> </li> <li> <p> <code>sagemaker:variant:DesiredInstanceCount</code> - The number of EC2 instances for a SageMaker model endpoint variant.</p> </li> <li> <p> <code>custom-resource:ResourceType:Property</code> - The scalable dimension for a custom resource provided by your own application or service.</p> </li> <li> <p> <code>comprehend:document-classifier-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend document classification endpoint.</p> </li> <li> <p> <code>comprehend:entity-recognizer-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend entity recognizer endpoint.</p> </li> <li> <p> <code>lambda:function:ProvisionedConcurrency</code> - The provisioned concurrency for a Lambda function.</p> </li> <li> <p> <code>cassandra:table:ReadCapacityUnits</code> - The provisioned read capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>cassandra:table:WriteCapacityUnits</code> - The provisioned write capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>kafka:broker-storage:VolumeSize</code> - The provisioned volume size (in GiB) for brokers in an Amazon MSK cluster.</p> </li> <li> <p> <code>elasticache:replication-group:NodeGroups</code> - The number of node groups for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>elasticache:replication-group:Replicas</code> - The number of replicas per node group for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>neptune:cluster:ReadReplicaCount</code> - The count of read replicas in an Amazon Neptune DB cluster.</p> </li> <li> <p> <code>sagemaker:variant:DesiredProvisionedConcurrency</code> - The provisioned concurrency for a SageMaker Serverless endpoint.</p> </li> </ul>', 'ScheduledAction$ScalableDimension' => '<p>The scalable dimension. This string consists of the service namespace, resource type, and scaling property.</p> <ul> <li> <p> <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service.</p> </li> <li> <p> <code>elasticmapreduce:instancegroup:InstanceCount</code> - The instance count of an EMR Instance Group.</p> </li> <li> <p> <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot Fleet.</p> </li> <li> <p> <code>appstream:fleet:DesiredCapacity</code> - The desired capacity of an AppStream 2.0 fleet.</p> </li> <li> <p> <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.</p> </li> <li> <p> <code>sagemaker:variant:DesiredInstanceCount</code> - The number of EC2 instances for a SageMaker model endpoint variant.</p> </li> <li> <p> <code>custom-resource:ResourceType:Property</code> - The scalable dimension for a custom resource provided by your own application or service.</p> </li> <li> <p> <code>comprehend:document-classifier-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend document classification endpoint.</p> </li> <li> <p> <code>comprehend:entity-recognizer-endpoint:DesiredInferenceUnits</code> - The number of inference units for an Amazon Comprehend entity recognizer endpoint.</p> </li> <li> <p> <code>lambda:function:ProvisionedConcurrency</code> - The provisioned concurrency for a Lambda function.</p> </li> <li> <p> <code>cassandra:table:ReadCapacityUnits</code> - The provisioned read capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>cassandra:table:WriteCapacityUnits</code> - The provisioned write capacity for an Amazon Keyspaces table.</p> </li> <li> <p> <code>kafka:broker-storage:VolumeSize</code> - The provisioned volume size (in GiB) for brokers in an Amazon MSK cluster.</p> </li> <li> <p> <code>elasticache:replication-group:NodeGroups</code> - The number of node groups for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>elasticache:replication-group:Replicas</code> - The number of replicas per node group for an Amazon ElastiCache replication group.</p> </li> <li> <p> <code>neptune:cluster:ReadReplicaCount</code> - The count of read replicas in an Amazon Neptune DB cluster.</p> </li> <li> <p> <code>sagemaker:variant:DesiredProvisionedConcurrency</code> - The provisioned concurrency for a SageMaker Serverless endpoint.</p> </li> </ul>', ], ], 'ScalableTarget' => [ 'base' => '<p>Represents a scalable target.</p>', 'refs' => [ 'ScalableTargets$member' => NULL, ], ], 'ScalableTargetAction' => [ 'base' => '<p>Represents the minimum and maximum capacity for a scheduled action.</p>', 'refs' => [ 'PutScheduledActionRequest$ScalableTargetAction' => '<p>The new minimum and maximum capacity. You can set both values or just one. At the scheduled time, if the current capacity is below the minimum capacity, Application Auto Scaling scales out to the minimum capacity. If the current capacity is above the maximum capacity, Application Auto Scaling scales in to the maximum capacity.</p>', 'ScheduledAction$ScalableTargetAction' => '<p>The new minimum and maximum capacity. You can set both values or just one. At the scheduled time, if the current capacity is below the minimum capacity, Application Auto Scaling scales out to the minimum capacity. If the current capacity is above the maximum capacity, Application Auto Scaling scales in to the maximum capacity.</p>', ], ], 'ScalableTargets' => [ 'base' => NULL, 'refs' => [ 'DescribeScalableTargetsResponse$ScalableTargets' => '<p>The scalable targets that match the request parameters.</p>', ], ], 'ScalingActivities' => [ 'base' => NULL, 'refs' => [ 'DescribeScalingActivitiesResponse$ScalingActivities' => '<p>A list of scaling activity objects.</p>', ], ], 'ScalingActivity' => [ 'base' => '<p>Represents a scaling activity.</p>', 'refs' => [ 'ScalingActivities$member' => NULL, ], ], 'ScalingActivityStatusCode' => [ 'base' => NULL, 'refs' => [ 'ScalingActivity$StatusCode' => '<p>Indicates the status of the scaling activity.</p>', ], ], 'ScalingAdjustment' => [ 'base' => NULL, 'refs' => [ 'StepAdjustment$ScalingAdjustment' => '<p>The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity. For exact capacity, you must specify a non-negative value.</p>', ], ], 'ScalingPolicies' => [ 'base' => NULL, 'refs' => [ 'DescribeScalingPoliciesResponse$ScalingPolicies' => '<p>Information about the scaling policies.</p>', ], ], 'ScalingPolicy' => [ 'base' => '<p>Represents a scaling policy to use with Application Auto Scaling.</p> <p>For more information about configuring scaling policies for a specific service, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/integrated-services-list.html\">Amazon Web Services services that you can use with Application Auto Scaling</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'refs' => [ 'ScalingPolicies$member' => NULL, ], ], 'ScalingSuspended' => [ 'base' => NULL, 'refs' => [ 'SuspendedState$DynamicScalingInSuspended' => '<p>Whether scale in by a target tracking scaling policy or a step scaling policy is suspended. Set the value to <code>true</code> if you don\\'t want Application Auto Scaling to remove capacity when a scaling policy is triggered. The default is <code>false</code>. </p>', 'SuspendedState$DynamicScalingOutSuspended' => '<p>Whether scale out by a target tracking scaling policy or a step scaling policy is suspended. Set the value to <code>true</code> if you don\\'t want Application Auto Scaling to add capacity when a scaling policy is triggered. The default is <code>false</code>. </p>', 'SuspendedState$ScheduledScalingSuspended' => '<p>Whether scheduled scaling is suspended. Set the value to <code>true</code> if you don\\'t want Application Auto Scaling to add or remove capacity by initiating scheduled actions. The default is <code>false</code>. </p>', ], ], 'ScheduledAction' => [ 'base' => '<p>Represents a scheduled action.</p>', 'refs' => [ 'ScheduledActions$member' => NULL, ], ], 'ScheduledActionName' => [ 'base' => NULL, 'refs' => [ 'PutScheduledActionRequest$ScheduledActionName' => '<p>The name of the scheduled action. This name must be unique among all other scheduled actions on the specified scalable target. </p>', 'ScheduledAction$ScheduledActionName' => '<p>The name of the scheduled action.</p>', ], ], 'ScheduledActions' => [ 'base' => NULL, 'refs' => [ 'DescribeScheduledActionsResponse$ScheduledActions' => '<p>Information about the scheduled actions.</p>', ], ], 'ServiceNamespace' => [ 'base' => NULL, 'refs' => [ 'DeleteScalingPolicyRequest$ServiceNamespace' => '<p>The namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use <code>custom-resource</code> instead.</p>', 'DeleteScheduledActionRequest$ServiceNamespace' => '<p>The namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use <code>custom-resource</code> instead.</p>', 'DeregisterScalableTargetRequest$ServiceNamespace' => '<p>The namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use <code>custom-resource</code> instead.</p>', 'DescribeScalableTargetsRequest$ServiceNamespace' => '<p>The namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use <code>custom-resource</code> instead.</p>', 'DescribeScalingActivitiesRequest$ServiceNamespace' => '<p>The namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use <code>custom-resource</code> instead.</p>', 'DescribeScalingPoliciesRequest$ServiceNamespace' => '<p>The namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use <code>custom-resource</code> instead.</p>', 'DescribeScheduledActionsRequest$ServiceNamespace' => '<p>The namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use <code>custom-resource</code> instead.</p>', 'PutScalingPolicyRequest$ServiceNamespace' => '<p>The namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use <code>custom-resource</code> instead.</p>', 'PutScheduledActionRequest$ServiceNamespace' => '<p>The namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use <code>custom-resource</code> instead.</p>', 'RegisterScalableTargetRequest$ServiceNamespace' => '<p>The namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use <code>custom-resource</code> instead.</p>', 'ScalableTarget$ServiceNamespace' => '<p>The namespace of the Amazon Web Services service that provides the resource, or a <code>custom-resource</code>.</p>', 'ScalingActivity$ServiceNamespace' => '<p>The namespace of the Amazon Web Services service that provides the resource, or a <code>custom-resource</code>.</p>', 'ScalingPolicy$ServiceNamespace' => '<p>The namespace of the Amazon Web Services service that provides the resource, or a <code>custom-resource</code>.</p>', 'ScheduledAction$ServiceNamespace' => '<p>The namespace of the Amazon Web Services service that provides the resource, or a <code>custom-resource</code>.</p>', ], ], 'StepAdjustment' => [ 'base' => '<p>Represents a step adjustment for a <a href=\"https://docs.aws.amazon.com/autoscaling/application/APIReference/API_StepScalingPolicyConfiguration.html\">StepScalingPolicyConfiguration</a>. Describes an adjustment based on the difference between the value of the aggregated CloudWatch metric and the breach threshold that you\\'ve defined for the alarm. </p> <p>For the following examples, suppose that you have an alarm with a breach threshold of 50:</p> <ul> <li> <p>To initiate the adjustment when the metric is greater than or equal to 50 and less than 60, specify a lower bound of <code>0</code> and an upper bound of <code>10</code>.</p> </li> <li> <p>To initiate the adjustment when the metric is greater than 40 and less than or equal to 50, specify a lower bound of <code>-10</code> and an upper bound of <code>0</code>.</p> </li> </ul> <p>There are a few rules for the step adjustments for your step policy:</p> <ul> <li> <p>The ranges of your step adjustments can\\'t overlap or have a gap.</p> </li> <li> <p>At most one step adjustment can have a null lower bound. If one step adjustment has a negative lower bound, then there must be a step adjustment with a null lower bound.</p> </li> <li> <p>At most one step adjustment can have a null upper bound. If one step adjustment has a positive upper bound, then there must be a step adjustment with a null upper bound.</p> </li> <li> <p>The upper and lower bound can\\'t be null in the same step adjustment.</p> </li> </ul>', 'refs' => [ 'StepAdjustments$member' => NULL, ], ], 'StepAdjustments' => [ 'base' => NULL, 'refs' => [ 'StepScalingPolicyConfiguration$StepAdjustments' => '<p>A set of adjustments that enable you to scale based on the size of the alarm breach.</p> <p>At least one step adjustment is required if you are adding a new step scaling policy configuration.</p>', ], ], 'StepScalingPolicyConfiguration' => [ 'base' => '<p>Represents a step scaling policy configuration to use with Application Auto Scaling.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-step-scaling-policies.html\">Step scaling policies</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'refs' => [ 'PutScalingPolicyRequest$StepScalingPolicyConfiguration' => '<p>A step scaling policy.</p> <p>This parameter is required if you are creating a policy and the policy type is <code>StepScaling</code>.</p>', 'ScalingPolicy$StepScalingPolicyConfiguration' => '<p>A step scaling policy.</p>', ], ], 'SuspendedState' => [ 'base' => '<p>Specifies whether the scaling activities for a scalable target are in a suspended state. </p>', 'refs' => [ 'RegisterScalableTargetRequest$SuspendedState' => '<p>An embedded object that contains attributes and attribute values that are used to suspend and resume automatic scaling. Setting the value of an attribute to <code>true</code> suspends the specified scaling activities. Setting it to <code>false</code> (default) resumes the specified scaling activities. </p> <p> <b>Suspension Outcomes</b> </p> <ul> <li> <p>For <code>DynamicScalingInSuspended</code>, while a suspension is in effect, all scale-in activities that are triggered by a scaling policy are suspended.</p> </li> <li> <p>For <code>DynamicScalingOutSuspended</code>, while a suspension is in effect, all scale-out activities that are triggered by a scaling policy are suspended.</p> </li> <li> <p>For <code>ScheduledScalingSuspended</code>, while a suspension is in effect, all scaling activities that involve scheduled actions are suspended. </p> </li> </ul> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-suspend-resume-scaling.html\">Suspending and resuming scaling</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'ScalableTarget$SuspendedState' => '<p>Specifies whether the scaling activities for a scalable target are in a suspended state.</p>', ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'TagKeyList$member' => NULL, 'TagMap$key' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$TagKeys' => '<p>One or more tag keys. Specify only the tag keys, not the tag values.</p>', ], ], 'TagMap' => [ 'base' => NULL, 'refs' => [ 'ListTagsForResourceResponse$Tags' => '<p>A list of tags. Each tag consists of a tag key and a tag value.</p>', 'RegisterScalableTargetRequest$Tags' => '<p>Assigns one or more tags to the scalable target. Use this parameter to tag the scalable target when it is created. To tag an existing scalable target, use the <a>TagResource</a> operation.</p> <p>Each tag consists of a tag key and a tag value. Both the tag key and the tag value are required. You cannot have more than one tag on a scalable target with the same tag key.</p> <p>Use tags to control access to a scalable target. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/resource-tagging-support.html\">Tagging support for Application Auto Scaling</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'TagResourceRequest$Tags' => '<p>The tags assigned to the resource. A tag is a label that you assign to an Amazon Web Services resource.</p> <p>Each tag consists of a tag key and a tag value.</p> <p>You cannot have more than one tag on an Application Auto Scaling scalable target with the same tag key. If you specify an existing tag key with a different tag value, Application Auto Scaling replaces the current tag value with the specified one.</p> <p>For information about the rules that apply to tag keys and tag values, see <a href=\"https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html\">User-defined tag restrictions</a> in the <i>Amazon Web Services Billing and Cost Management User Guide</i>.</p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'TagMap$value' => NULL, ], ], 'TargetTrackingMetric' => [ 'base' => '<p>Represents a specific metric.</p> <p>Metric is a property of the <a>TargetTrackingMetricStat</a> object.</p>', 'refs' => [ 'TargetTrackingMetricStat$Metric' => '<p>The CloudWatch metric to return, including the metric name, namespace, and dimensions. To get the exact metric name, namespace, and dimensions, inspect the <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Metric.html\">Metric</a> object that is returned by a call to <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html\">ListMetrics</a>.</p>', ], ], 'TargetTrackingMetricDataQueries' => [ 'base' => NULL, 'refs' => [ 'CustomizedMetricSpecification$Metrics' => '<p>The metrics to include in the target tracking scaling policy, as a metric data query. This can include both raw metric and metric math expressions.</p>', ], ], 'TargetTrackingMetricDataQuery' => [ 'base' => '<p>The metric data to return. Also defines whether this call is returning data for one metric only, or whether it is performing a math expression on the values of returned metric statistics to create a new time series. A time series is a series of data points, each of which is associated with a timestamp.</p> <p>For more information and examples, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking-metric-math.html\">Create a target tracking scaling policy for Application Auto Scaling using metric math</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'refs' => [ 'TargetTrackingMetricDataQueries$member' => NULL, ], ], 'TargetTrackingMetricDimension' => [ 'base' => '<p>Describes the dimension of a metric.</p>', 'refs' => [ 'TargetTrackingMetricDimensions$member' => NULL, ], ], 'TargetTrackingMetricDimensionName' => [ 'base' => NULL, 'refs' => [ 'TargetTrackingMetricDimension$Name' => '<p>The name of the dimension.</p>', ], ], 'TargetTrackingMetricDimensionValue' => [ 'base' => NULL, 'refs' => [ 'TargetTrackingMetricDimension$Value' => '<p>The value of the dimension.</p>', ], ], 'TargetTrackingMetricDimensions' => [ 'base' => NULL, 'refs' => [ 'TargetTrackingMetric$Dimensions' => '<p>The dimensions for the metric. For the list of available dimensions, see the Amazon Web Services documentation available from the table in <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html\">Amazon Web Services services that publish CloudWatch metrics </a> in the <i>Amazon CloudWatch User Guide</i>. </p> <p>Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.</p>', ], ], 'TargetTrackingMetricName' => [ 'base' => NULL, 'refs' => [ 'TargetTrackingMetric$MetricName' => '<p>The name of the metric.</p>', ], ], 'TargetTrackingMetricNamespace' => [ 'base' => NULL, 'refs' => [ 'TargetTrackingMetric$Namespace' => '<p>The namespace of the metric. For more information, see the table in <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html\">Amazon Web Services services that publish CloudWatch metrics </a> in the <i>Amazon CloudWatch User Guide</i>.</p>', ], ], 'TargetTrackingMetricStat' => [ 'base' => '<p>This structure defines the CloudWatch metric to return, along with the statistic, period, and unit.</p> <p>For more information about the CloudWatch terminology below, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html\">Amazon CloudWatch concepts</a> in the <i>Amazon CloudWatch User Guide</i>.</p>', 'refs' => [ 'TargetTrackingMetricDataQuery$MetricStat' => '<p>Information about the metric data to return.</p> <p>Conditional: Within each <code>MetricDataQuery</code> object, you must specify either <code>Expression</code> or <code>MetricStat</code>, but not both.</p>', ], ], 'TargetTrackingMetricUnit' => [ 'base' => NULL, 'refs' => [ 'TargetTrackingMetricStat$Unit' => '<p>The unit to use for the returned data points. For a complete list of the units that CloudWatch supports, see the <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html\">MetricDatum</a> data type in the <i>Amazon CloudWatch API Reference</i>.</p>', ], ], 'TargetTrackingScalingPolicyConfiguration' => [ 'base' => '<p>Represents a target tracking scaling policy configuration to use with Application Auto Scaling.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html\">Target tracking scaling policies</a> in the <i>Application Auto Scaling User Guide</i>.</p>', 'refs' => [ 'PutScalingPolicyRequest$TargetTrackingScalingPolicyConfiguration' => '<p>A target tracking scaling policy. Includes support for predefined or customized metrics.</p> <p>This parameter is required if you are creating a policy and the policy type is <code>TargetTrackingScaling</code>.</p>', 'ScalingPolicy$TargetTrackingScalingPolicyConfiguration' => '<p>A target tracking scaling policy.</p>', ], ], 'TimestampType' => [ 'base' => NULL, 'refs' => [ 'PutScheduledActionRequest$StartTime' => '<p>The date and time for this scheduled action to start, in UTC.</p>', 'PutScheduledActionRequest$EndTime' => '<p>The date and time for the recurring schedule to end, in UTC.</p>', 'ScalableTarget$CreationTime' => '<p>The Unix timestamp for when the scalable target was created.</p>', 'ScalingActivity$StartTime' => '<p>The Unix timestamp for when the scaling activity began.</p>', 'ScalingActivity$EndTime' => '<p>The Unix timestamp for when the scaling activity ended.</p>', 'ScalingPolicy$CreationTime' => '<p>The Unix timestamp for when the scaling policy was created.</p>', 'ScheduledAction$StartTime' => '<p>The date and time that the action is scheduled to begin, in UTC.</p>', 'ScheduledAction$EndTime' => '<p>The date and time that the action is scheduled to end, in UTC.</p>', 'ScheduledAction$CreationTime' => '<p>The date and time that the scheduled action was created.</p>', ], ], 'TooManyTagsException' => [ 'base' => '<p>The request contains too many tags. Try the request again with fewer tags.</p>', 'refs' => [], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'ValidationException' => [ 'base' => '<p>An exception was thrown for a validation issue. Review the available parameters for the API request.</p>', 'refs' => [], ], 'XmlString' => [ 'base' => NULL, 'refs' => [ 'DescribeScalableTargetsRequest$NextToken' => '<p>The token for the next set of results.</p>', 'DescribeScalableTargetsResponse$NextToken' => '<p>The token required to get the next set of results. This value is <code>null</code> if there are no more results to return.</p>', 'DescribeScalingActivitiesRequest$NextToken' => '<p>The token for the next set of results.</p>', 'DescribeScalingActivitiesResponse$NextToken' => '<p>The token required to get the next set of results. This value is <code>null</code> if there are no more results to return.</p>', 'DescribeScalingPoliciesRequest$NextToken' => '<p>The token for the next set of results.</p>', 'DescribeScalingPoliciesResponse$NextToken' => '<p>The token required to get the next set of results. This value is <code>null</code> if there are no more results to return.</p>', 'DescribeScheduledActionsRequest$NextToken' => '<p>The token for the next set of results.</p>', 'DescribeScheduledActionsResponse$NextToken' => '<p>The token required to get the next set of results. This value is <code>null</code> if there are no more results to return.</p>', 'NotScaledReason$Code' => '<p>A code that represents the reason for not scaling.</p> <p>Valid values:</p> <ul> <li> <p>AutoScalingAnticipatedFlapping</p> </li> <li> <p>TargetServicePutResourceAsUnscalable</p> </li> <li> <p>AlreadyAtMaxCapacity</p> </li> <li> <p>AlreadyAtMinCapacity</p> </li> <li> <p>AlreadyAtDesiredCapacity</p> </li> </ul>', 'RegisterScalableTargetResponse$ScalableTargetARN' => '<p>The ARN of the scalable target.</p>', 'ScalableTarget$ScalableTargetARN' => '<p>The ARN of the scalable target.</p>', 'ScalingActivity$Description' => '<p>A simple description of what action the scaling activity intends to accomplish.</p>', 'ScalingActivity$Cause' => '<p>A simple description of what caused the scaling activity to happen.</p>', 'ScalingActivity$StatusMessage' => '<p>A simple message about the current status of the scaling activity.</p>', 'ScalingActivity$Details' => '<p>The details about the scaling activity.</p>', 'TargetTrackingMetricDataQuery$Label' => '<p>A human-readable label for this metric or expression. This is especially useful if this is a math expression, so that you know what the value represents.</p>', 'TargetTrackingMetricStat$Stat' => '<p>The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Statistic\">Statistics</a> in the <i>Amazon CloudWatch User Guide</i>.</p> <p>The most commonly used metric for scaling is <code>Average</code>.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/application-autoscaling/2016-02-06/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://application-autoscaling-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ 'aws-us-gov', [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], ], ], ], 'endpoint' => [ 'url' => 'https://application-autoscaling.{Region}.amazonaws.com', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://application-autoscaling-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://application-autoscaling.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://application-autoscaling.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/application-autoscaling/2016-02-06/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.us-iso-west-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://application-autoscaling-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/application-autoscaling/2016-02-06/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [ 'DeleteScalingPolicy' => [ [ 'input' => [ 'PolicyName' => 'web-app-cpu-lt-25', 'ResourceId' => 'service/default/web-app', 'ScalableDimension' => 'ecs:service:DesiredCount', 'ServiceNamespace' => 'ecs', ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example deletes a scaling policy for the Amazon ECS service called web-app, which is running in the default cluster.', 'id' => 'to-delete-a-scaling-policy-1470863892689', 'title' => 'To delete a scaling policy', ], ], 'DeleteScheduledAction' => [ [ 'input' => [ 'ResourceId' => 'fleet/sample-fleet', 'ScalableDimension' => 'appstream:fleet:DesiredCapacity', 'ScheduledActionName' => 'my-recurring-action', 'ServiceNamespace' => 'appstream', ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example deletes a scheduled action for the AppStream 2.0 fleet called sample-fleet.', 'id' => 'to-delete-a-scheduled-action-1677963329606', 'title' => 'To delete a scheduled action', ], ], 'DeregisterScalableTarget' => [ [ 'input' => [ 'ResourceId' => 'service/default/web-app', 'ScalableDimension' => 'ecs:service:DesiredCount', 'ServiceNamespace' => 'ecs', ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example deregisters a scalable target for an Amazon ECS service called web-app that is running in the default cluster.', 'id' => 'to-deregister-a-scalable-target-1470864164895', 'title' => 'To deregister a scalable target', ], ], 'DescribeScalableTargets' => [ [ 'input' => [ 'ServiceNamespace' => 'ecs', ], 'output' => [ 'ScalableTargets' => [ [ 'CreationTime' => '2019-05-06T11:21:46.199Z', 'MaxCapacity' => 10, 'MinCapacity' => 1, 'ResourceId' => 'service/default/web-app', 'RoleARN' => 'arn:aws:iam::012345678910:role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService', 'ScalableDimension' => 'ecs:service:DesiredCount', 'ServiceNamespace' => 'ecs', 'SuspendedState' => [ 'DynamicScalingInSuspended' => false, 'DynamicScalingOutSuspended' => false, 'ScheduledScalingSuspended' => false, ], ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the scalable targets for the ECS service namespace.', 'id' => 'to-describe-scalable-targets-1470864286961', 'title' => 'To describe scalable targets', ], ], 'DescribeScalingActivities' => [ [ 'input' => [ 'ResourceId' => 'service/default/web-app', 'ScalableDimension' => 'ecs:service:DesiredCount', 'ServiceNamespace' => 'ecs', ], 'output' => [ 'ScalingActivities' => [ [ 'ActivityId' => 'e6c5f7d1-dbbb-4a3f-89b2-51f33e766399', 'Cause' => 'monitor alarm web-app-cpu-lt-25 in state ALARM triggered policy web-app-cpu-lt-25', 'Description' => 'Setting desired count to 1.', 'EndTime' => '2019-05-06T16:04:32.111Z', 'ResourceId' => 'service/default/web-app', 'ScalableDimension' => 'ecs:service:DesiredCount', 'ServiceNamespace' => 'ecs', 'StartTime' => '2019-05-06T16:03:58.171Z', 'StatusCode' => 'Successful', 'StatusMessage' => 'Successfully set desired count to 1. Change successfully fulfilled by ecs.', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the scaling activities for an Amazon ECS service called web-app that is running in the default cluster.', 'id' => 'to-describe-scaling-activities-for-a-scalable-target-1470864398629', 'title' => 'To describe scaling activities for a scalable target', ], ], 'DescribeScalingPolicies' => [ [ 'input' => [ 'ServiceNamespace' => 'ecs', ], 'output' => [ 'NextToken' => '', 'ScalingPolicies' => [ [ 'Alarms' => [ [ 'AlarmARN' => 'arn:aws:cloudwatch:us-west-2:012345678910:alarm:web-app-cpu-gt-75', 'AlarmName' => 'web-app-cpu-gt-75', ], ], 'CreationTime' => '2019-05-06T12:11:39.230Z', 'PolicyARN' => 'arn:aws:autoscaling:us-west-2:012345678910:scalingPolicy:6d8972f3-efc8-437c-92d1-6270f29a66e7:resource/ecs/service/default/web-app:policyName/web-app-cpu-gt-75', 'PolicyName' => 'web-app-cpu-gt-75', 'PolicyType' => 'StepScaling', 'ResourceId' => 'service/default/web-app', 'ScalableDimension' => 'ecs:service:DesiredCount', 'ServiceNamespace' => 'ecs', 'StepScalingPolicyConfiguration' => [ 'AdjustmentType' => 'PercentChangeInCapacity', 'Cooldown' => 60, 'StepAdjustments' => [ [ 'MetricIntervalLowerBound' => 0, 'ScalingAdjustment' => 200, ], ], ], ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the scaling policies for the ECS service namespace.', 'id' => 'to-describe-scaling-policies-1470864609734', 'title' => 'To describe scaling policies', ], ], 'DescribeScheduledActions' => [ [ 'input' => [ 'ServiceNamespace' => 'dynamodb', ], 'output' => [ 'ScheduledActions' => [ [ 'CreationTime' => 1561571888.3610001, 'ResourceId' => 'table/my-table', 'ScalableDimension' => 'dynamodb:table:WriteCapacityUnits', 'ScalableTargetAction' => [ 'MaxCapacity' => 20, 'MinCapacity' => 15, ], 'Schedule' => 'at(2019-05-20T18:35:00)', 'ScheduledActionARN' => 'arn:aws:autoscaling:us-west-2:123456789012:scheduledAction:2d36aa3b-cdf9-4565-b290-81db519b227d:resource/dynamodb/table/my-table:scheduledActionName/my-first-scheduled-action', 'ScheduledActionName' => 'my-first-scheduled-action', 'ServiceNamespace' => 'dynamodb', ], [ 'CreationTime' => 1561571946.0209999, 'ResourceId' => 'table/my-table', 'ScalableDimension' => 'dynamodb:table:WriteCapacityUnits', 'ScalableTargetAction' => [ 'MaxCapacity' => 10, 'MinCapacity' => 5, ], 'Schedule' => 'at(2019-05-20T18:40:00)', 'ScheduledActionARN' => 'arn:aws:autoscaling:us-west-2:123456789012:scheduledAction:2d36aa3b-cdf9-4565-b290-81db519b227d:resource/dynamodb/table/my-table:scheduledActionName/my-second-scheduled-action', 'ScheduledActionName' => 'my-second-scheduled-action', 'ServiceNamespace' => 'dynamodb', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the scheduled actions for the dynamodb service namespace.', 'id' => 'to-describe-scheduled-actions-1677965249349', 'title' => 'To describe scheduled actions', ], ], 'ListTagsForResource' => [ [ 'input' => [ 'ResourceARN' => 'arn:aws:application-autoscaling:us-west-2:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123', ], 'output' => [ 'Tags' => [ 'environment' => 'production', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example lists the tag key names and values that are attached to the scalable target specified by its ARN.', 'id' => 'to-list-tags-for-a-scalable-target-1677971474903', 'title' => 'To list tags for a scalable target', ], ], 'PutScalingPolicy' => [ [ 'input' => [ 'PolicyName' => 'cpu75-target-tracking-scaling-policy', 'PolicyType' => 'TargetTrackingScaling', 'ResourceId' => 'service/default/web-app', 'ScalableDimension' => 'ecs:service:DesiredCount', 'ServiceNamespace' => 'ecs', 'TargetTrackingScalingPolicyConfiguration' => [ 'PredefinedMetricSpecification' => [ 'PredefinedMetricType' => 'ECSServiceAverageCPUUtilization', ], 'ScaleInCooldown' => 60, 'ScaleOutCooldown' => 60, 'TargetValue' => 75, ], ], 'output' => [ 'Alarms' => [ [ 'AlarmARN' => 'arn:aws:cloudwatch:us-west-2:012345678910:alarm:TargetTracking-service/default/web-app-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca', 'AlarmName' => 'TargetTracking-service/default/web-app-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca', ], [ 'AlarmARN' => 'arn:aws:cloudwatch:us-west-2:012345678910:alarm:TargetTracking-service/default/web-app-AlarmLow-1b437334-d19b-4a63-a812-6c67aaf2910d', 'AlarmName' => 'TargetTracking-service/default/web-app-AlarmLow-1b437334-d19b-4a63-a812-6c67aaf2910d', ], ], 'PolicyARN' => 'arn:aws:autoscaling:us-west-2:012345678910:scalingPolicy:6d8972f3-efc8-437c-92d1-6270f29a66e7:resource/ecs/service/default/web-app:policyName/cpu75-target-tracking-scaling-policy', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'The following example applies a target tracking scaling policy with a predefined metric specification to an Amazon ECS service called web-app in the default cluster. The policy keeps the average CPU utilization of the service at 75 percent, with scale-out and scale-in cooldown periods of 60 seconds.', 'id' => 'to-apply-a-target-tracking-scaling-policy-with-a-predefined-metric-specification-1569364247984', 'title' => 'To apply a target tracking scaling policy with a predefined metric specification', ], ], 'PutScheduledAction' => [ [ 'input' => [ 'ResourceId' => 'table/TestTable', 'ScalableDimension' => 'dynamodb:table:WriteCapacityUnits', 'ScalableTargetAction' => [ 'MinCapacity' => 6, ], 'Schedule' => 'cron(15 12 * * ? *)', 'ScheduledActionName' => 'my-recurring-action', 'ServiceNamespace' => 'dynamodb', ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example adds a scheduled action to a DynamoDB table called TestTable to scale out on a recurring schedule. On the specified schedule (every day at 12:15pm UTC), if the current capacity is below the value specified for MinCapacity, Application Auto Scaling scales out to the value specified by MinCapacity.', 'id' => 'to-create-a-recurring-scheduled-action-1677970068621', 'title' => 'To create a recurring scheduled action', ], ], 'RegisterScalableTarget' => [ [ 'input' => [ 'MaxCapacity' => 10, 'MinCapacity' => 1, 'ResourceId' => 'service/default/web-app', 'ScalableDimension' => 'ecs:service:DesiredCount', 'ServiceNamespace' => 'ecs', ], 'output' => [ 'ScalableTargetARN' => 'arn:aws:application-autoscaling:us-east-1:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example registers a scalable target from an Amazon ECS service called web-app that is running on the default cluster, with a minimum desired count of 1 task and a maximum desired count of 10 tasks.', 'id' => 'to-register-a-new-scalable-target-1470864910380', 'title' => 'To register an ECS service as a scalable target', ], ], 'TagResource' => [ [ 'input' => [ 'ResourceARN' => 'arn:aws:application-autoscaling:us-west-2:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123', 'Tags' => [ 'environment' => 'production', ], ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example adds a tag with the key name \"environment\" and the value \"production\" to the scalable target specified by its ARN.', 'id' => 'to-add-a-tag-to-a-scalable-target-1677970764620', 'title' => 'To add a tag to a scalable target', ], ], 'UntagResource' => [ [ 'input' => [ 'ResourceARN' => 'arn:aws:application-autoscaling:us-west-2:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123', 'TagKeys' => [ 'environment', ], ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example removes the tag pair with the key name \"environment\" from the scalable target specified by its ARN.', 'id' => 'to-remove-a-tag-from-a-scalable-target-1677971117168', 'title' => 'To remove a tag from a scalable target', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/application-autoscaling/2016-02-06/paginators-1.json\nreturn [ 'pagination' => [ 'DescribeScalableTargets' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'ScalableTargets', ], 'DescribeScalingActivities' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'ScalingActivities', ], 'DescribeScalingPolicies' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'ScalingPolicies', ], 'DescribeScheduledActions' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'ScheduledActions', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/application-autoscaling/2016-02-06/smoke.json\nreturn [ 'version' => 1, 'defaultRegion' => 'us-west-2', 'testCases' => [ [ 'operationName' => 'DescribeScalableTargets', 'input' => [ 'ServiceNamespace' => 'ec2', ], 'errorExpectedFromService' => false, ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/application-insights/2018-11-25/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2018-11-25', 'endpointPrefix' => 'applicationinsights', 'jsonVersion' => '1.1', 'protocol' => 'json', 'serviceAbbreviation' => 'Application Insights', 'serviceFullName' => 'Amazon CloudWatch Application Insights', 'serviceId' => 'Application Insights', 'signatureVersion' => 'v4', 'signingName' => 'applicationinsights', 'targetPrefix' => 'EC2WindowsBarleyService', 'uid' => 'application-insights-2018-11-25', ], 'operations' => [ 'CreateApplication' => [ 'name' => 'CreateApplication', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateApplicationRequest', ], 'output' => [ 'shape' => 'CreateApplicationResponse', ], 'errors' => [ [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'TagsAlreadyExistException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'CreateComponent' => [ 'name' => 'CreateComponent', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateComponentRequest', ], 'output' => [ 'shape' => 'CreateComponentResponse', ], 'errors' => [ [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'CreateLogPattern' => [ 'name' => 'CreateLogPattern', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateLogPatternRequest', ], 'output' => [ 'shape' => 'CreateLogPatternResponse', ], 'errors' => [ [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DeleteApplication' => [ 'name' => 'DeleteApplication', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteApplicationRequest', ], 'output' => [ 'shape' => 'DeleteApplicationResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DeleteComponent' => [ 'name' => 'DeleteComponent', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteComponentRequest', ], 'output' => [ 'shape' => 'DeleteComponentResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DeleteLogPattern' => [ 'name' => 'DeleteLogPattern', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteLogPatternRequest', ], 'output' => [ 'shape' => 'DeleteLogPatternResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DescribeApplication' => [ 'name' => 'DescribeApplication', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeApplicationRequest', ], 'output' => [ 'shape' => 'DescribeApplicationResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DescribeComponent' => [ 'name' => 'DescribeComponent', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeComponentRequest', ], 'output' => [ 'shape' => 'DescribeComponentResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DescribeComponentConfiguration' => [ 'name' => 'DescribeComponentConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeComponentConfigurationRequest', ], 'output' => [ 'shape' => 'DescribeComponentConfigurationResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DescribeComponentConfigurationRecommendation' => [ 'name' => 'DescribeComponentConfigurationRecommendation', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeComponentConfigurationRecommendationRequest', ], 'output' => [ 'shape' => 'DescribeComponentConfigurationRecommendationResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DescribeLogPattern' => [ 'name' => 'DescribeLogPattern', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeLogPatternRequest', ], 'output' => [ 'shape' => 'DescribeLogPatternResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DescribeObservation' => [ 'name' => 'DescribeObservation', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeObservationRequest', ], 'output' => [ 'shape' => 'DescribeObservationResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeProblem' => [ 'name' => 'DescribeProblem', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeProblemRequest', ], 'output' => [ 'shape' => 'DescribeProblemResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeProblemObservations' => [ 'name' => 'DescribeProblemObservations', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeProblemObservationsRequest', ], 'output' => [ 'shape' => 'DescribeProblemObservationsResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListApplications' => [ 'name' => 'ListApplications', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListApplicationsRequest', ], 'output' => [ 'shape' => 'ListApplicationsResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListComponents' => [ 'name' => 'ListComponents', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListComponentsRequest', ], 'output' => [ 'shape' => 'ListComponentsResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListConfigurationHistory' => [ 'name' => 'ListConfigurationHistory', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListConfigurationHistoryRequest', ], 'output' => [ 'shape' => 'ListConfigurationHistoryResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListLogPatternSets' => [ 'name' => 'ListLogPatternSets', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListLogPatternSetsRequest', ], 'output' => [ 'shape' => 'ListLogPatternSetsResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListLogPatterns' => [ 'name' => 'ListLogPatterns', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListLogPatternsRequest', ], 'output' => [ 'shape' => 'ListLogPatternsResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListProblems' => [ 'name' => 'ListProblems', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListProblemsRequest', ], 'output' => [ 'shape' => 'ListProblemsResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'TooManyTagsException', ], [ 'shape' => 'ValidationException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], ], ], 'UpdateApplication' => [ 'name' => 'UpdateApplication', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateApplicationRequest', ], 'output' => [ 'shape' => 'UpdateApplicationResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], ], ], 'UpdateComponent' => [ 'name' => 'UpdateComponent', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateComponentRequest', ], 'output' => [ 'shape' => 'UpdateComponentResponse', ], 'errors' => [ [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UpdateComponentConfiguration' => [ 'name' => 'UpdateComponentConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateComponentConfigurationRequest', ], 'output' => [ 'shape' => 'UpdateComponentConfigurationResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UpdateLogPattern' => [ 'name' => 'UpdateLogPattern', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateLogPatternRequest', ], 'output' => [ 'shape' => 'UpdateLogPatternResponse', ], 'errors' => [ [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMsg', ], ], 'exception' => true, ], 'AffectedResource' => [ 'type' => 'string', ], 'AmazonResourceName' => [ 'type' => 'string', 'max' => 1011, 'min' => 1, 'pattern' => '^arn:aws(-\\\\w+)*:[\\\\w\\\\d-]+:([\\\\w\\\\d-]*)?:[\\\\w\\\\d_-]*([:/].+)*$', ], 'ApplicationComponent' => [ 'type' => 'structure', 'members' => [ 'ComponentName' => [ 'shape' => 'ComponentName', ], 'ComponentRemarks' => [ 'shape' => 'Remarks', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'OsType' => [ 'shape' => 'OsType', ], 'Tier' => [ 'shape' => 'Tier', ], 'Monitor' => [ 'shape' => 'Monitor', ], 'DetectedWorkload' => [ 'shape' => 'DetectedWorkload', ], ], ], 'ApplicationComponentList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ApplicationComponent', ], ], 'ApplicationInfo' => [ 'type' => 'structure', 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'LifeCycle' => [ 'shape' => 'LifeCycle', ], 'OpsItemSNSTopicArn' => [ 'shape' => 'OpsItemSNSTopicArn', ], 'OpsCenterEnabled' => [ 'shape' => 'OpsCenterEnabled', ], 'CWEMonitorEnabled' => [ 'shape' => 'CWEMonitorEnabled', ], 'Remarks' => [ 'shape' => 'Remarks', ], 'AutoConfigEnabled' => [ 'shape' => 'AutoConfigEnabled', ], 'DiscoveryType' => [ 'shape' => 'DiscoveryType', ], ], ], 'ApplicationInfoList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ApplicationInfo', ], ], 'AutoConfigEnabled' => [ 'type' => 'boolean', ], 'AutoCreate' => [ 'type' => 'boolean', ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMsg', ], ], 'exception' => true, ], 'CWEMonitorEnabled' => [ 'type' => 'boolean', ], 'CloudWatchEventDetailType' => [ 'type' => 'string', ], 'CloudWatchEventId' => [ 'type' => 'string', ], 'CloudWatchEventSource' => [ 'type' => 'string', 'enum' => [ 'EC2', 'CODE_DEPLOY', 'HEALTH', 'RDS', ], ], 'CodeDeployApplication' => [ 'type' => 'string', ], 'CodeDeployDeploymentGroup' => [ 'type' => 'string', ], 'CodeDeployDeploymentId' => [ 'type' => 'string', ], 'CodeDeployInstanceGroupId' => [ 'type' => 'string', ], 'CodeDeployState' => [ 'type' => 'string', ], 'ComponentConfiguration' => [ 'type' => 'string', 'max' => 10000, 'min' => 1, 'pattern' => '[\\\\S\\\\s]+', ], 'ComponentName' => [ 'type' => 'string', 'max' => 1011, 'min' => 1, 'pattern' => '(?:^[\\\\d\\\\w\\\\-_\\\\.+]*$)|(?:^arn:aws(-\\\\w+)*:[\\\\w\\\\d-]+:([\\\\w\\\\d-]*)?:[\\\\w\\\\d_-]*([:/].+)*$)', ], 'ConfigurationEvent' => [ 'type' => 'structure', 'members' => [ 'MonitoredResourceARN' => [ 'shape' => 'ConfigurationEventMonitoredResourceARN', ], 'EventStatus' => [ 'shape' => 'ConfigurationEventStatus', ], 'EventResourceType' => [ 'shape' => 'ConfigurationEventResourceType', ], 'EventTime' => [ 'shape' => 'ConfigurationEventTime', ], 'EventDetail' => [ 'shape' => 'ConfigurationEventDetail', ], 'EventResourceName' => [ 'shape' => 'ConfigurationEventResourceName', ], ], ], 'ConfigurationEventDetail' => [ 'type' => 'string', ], 'ConfigurationEventList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConfigurationEvent', ], ], 'ConfigurationEventMonitoredResourceARN' => [ 'type' => 'string', ], 'ConfigurationEventResourceName' => [ 'type' => 'string', ], 'ConfigurationEventResourceType' => [ 'type' => 'string', 'enum' => [ 'CLOUDWATCH_ALARM', 'CLOUDWATCH_LOG', 'CLOUDFORMATION', 'SSM_ASSOCIATION', ], ], 'ConfigurationEventStatus' => [ 'type' => 'string', 'enum' => [ 'INFO', 'WARN', 'ERROR', ], ], 'ConfigurationEventTime' => [ 'type' => 'timestamp', ], 'CreateApplicationRequest' => [ 'type' => 'structure', 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'OpsCenterEnabled' => [ 'shape' => 'OpsCenterEnabled', ], 'CWEMonitorEnabled' => [ 'shape' => 'CWEMonitorEnabled', ], 'OpsItemSNSTopicArn' => [ 'shape' => 'OpsItemSNSTopicArn', ], 'Tags' => [ 'shape' => 'TagList', ], 'AutoConfigEnabled' => [ 'shape' => 'AutoConfigEnabled', ], 'AutoCreate' => [ 'shape' => 'AutoCreate', ], 'GroupingType' => [ 'shape' => 'GroupingType', ], ], ], 'CreateApplicationResponse' => [ 'type' => 'structure', 'members' => [ 'ApplicationInfo' => [ 'shape' => 'ApplicationInfo', ], ], ], 'CreateComponentRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', 'ComponentName', 'ResourceList', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'ComponentName' => [ 'shape' => 'CustomComponentName', ], 'ResourceList' => [ 'shape' => 'ResourceList', ], ], ], 'CreateComponentResponse' => [ 'type' => 'structure', 'members' => [], ], 'CreateLogPatternRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', 'PatternSetName', 'PatternName', 'Pattern', 'Rank', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'PatternSetName' => [ 'shape' => 'LogPatternSetName', ], 'PatternName' => [ 'shape' => 'LogPatternName', ], 'Pattern' => [ 'shape' => 'LogPatternRegex', ], 'Rank' => [ 'shape' => 'LogPatternRank', ], ], ], 'CreateLogPatternResponse' => [ 'type' => 'structure', 'members' => [ 'LogPattern' => [ 'shape' => 'LogPattern', ], 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], ], ], 'CustomComponentName' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^[\\\\d\\\\w\\\\-_\\\\.+]*$', ], 'DeleteApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], ], ], 'DeleteApplicationResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteComponentRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', 'ComponentName', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'ComponentName' => [ 'shape' => 'CustomComponentName', ], ], ], 'DeleteComponentResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteLogPatternRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', 'PatternSetName', 'PatternName', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'PatternSetName' => [ 'shape' => 'LogPatternSetName', ], 'PatternName' => [ 'shape' => 'LogPatternName', ], ], ], 'DeleteLogPatternResponse' => [ 'type' => 'structure', 'members' => [], ], 'DescribeApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], ], ], 'DescribeApplicationResponse' => [ 'type' => 'structure', 'members' => [ 'ApplicationInfo' => [ 'shape' => 'ApplicationInfo', ], ], ], 'DescribeComponentConfigurationRecommendationRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', 'ComponentName', 'Tier', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'ComponentName' => [ 'shape' => 'ComponentName', ], 'Tier' => [ 'shape' => 'Tier', ], ], ], 'DescribeComponentConfigurationRecommendationResponse' => [ 'type' => 'structure', 'members' => [ 'ComponentConfiguration' => [ 'shape' => 'ComponentConfiguration', ], ], ], 'DescribeComponentConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', 'ComponentName', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'ComponentName' => [ 'shape' => 'ComponentName', ], ], ], 'DescribeComponentConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'Monitor' => [ 'shape' => 'Monitor', ], 'Tier' => [ 'shape' => 'Tier', ], 'ComponentConfiguration' => [ 'shape' => 'ComponentConfiguration', ], ], ], 'DescribeComponentRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', 'ComponentName', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'ComponentName' => [ 'shape' => 'ComponentName', ], ], ], 'DescribeComponentResponse' => [ 'type' => 'structure', 'members' => [ 'ApplicationComponent' => [ 'shape' => 'ApplicationComponent', ], 'ResourceList' => [ 'shape' => 'ResourceList', ], ], ], 'DescribeLogPatternRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', 'PatternSetName', 'PatternName', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'PatternSetName' => [ 'shape' => 'LogPatternSetName', ], 'PatternName' => [ 'shape' => 'LogPatternName', ], ], ], 'DescribeLogPatternResponse' => [ 'type' => 'structure', 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'LogPattern' => [ 'shape' => 'LogPattern', ], ], ], 'DescribeObservationRequest' => [ 'type' => 'structure', 'required' => [ 'ObservationId', ], 'members' => [ 'ObservationId' => [ 'shape' => 'ObservationId', ], ], ], 'DescribeObservationResponse' => [ 'type' => 'structure', 'members' => [ 'Observation' => [ 'shape' => 'Observation', ], ], ], 'DescribeProblemObservationsRequest' => [ 'type' => 'structure', 'required' => [ 'ProblemId', ], 'members' => [ 'ProblemId' => [ 'shape' => 'ProblemId', ], ], ], 'DescribeProblemObservationsResponse' => [ 'type' => 'structure', 'members' => [ 'RelatedObservations' => [ 'shape' => 'RelatedObservations', ], ], ], 'DescribeProblemRequest' => [ 'type' => 'structure', 'required' => [ 'ProblemId', ], 'members' => [ 'ProblemId' => [ 'shape' => 'ProblemId', ], ], ], 'DescribeProblemResponse' => [ 'type' => 'structure', 'members' => [ 'Problem' => [ 'shape' => 'Problem', ], ], ], 'DetectedWorkload' => [ 'type' => 'map', 'key' => [ 'shape' => 'Tier', ], 'value' => [ 'shape' => 'WorkloadMetaData', ], ], 'DiscoveryType' => [ 'type' => 'string', 'enum' => [ 'RESOURCE_GROUP_BASED', 'ACCOUNT_BASED', ], ], 'EbsCause' => [ 'type' => 'string', ], 'EbsEvent' => [ 'type' => 'string', ], 'EbsRequestId' => [ 'type' => 'string', ], 'EbsResult' => [ 'type' => 'string', ], 'Ec2State' => [ 'type' => 'string', ], 'EndTime' => [ 'type' => 'timestamp', ], 'ErrorMsg' => [ 'type' => 'string', ], 'ExceptionMessage' => [ 'type' => 'string', ], 'Feedback' => [ 'type' => 'map', 'key' => [ 'shape' => 'FeedbackKey', ], 'value' => [ 'shape' => 'FeedbackValue', ], 'max' => 10, ], 'FeedbackKey' => [ 'type' => 'string', 'enum' => [ 'INSIGHTS_FEEDBACK', ], ], 'FeedbackValue' => [ 'type' => 'string', 'enum' => [ 'NOT_SPECIFIED', 'USEFUL', 'NOT_USEFUL', ], ], 'GroupingType' => [ 'type' => 'string', 'enum' => [ 'ACCOUNT_BASED', ], ], 'HealthEventArn' => [ 'type' => 'string', ], 'HealthEventDescription' => [ 'type' => 'string', ], 'HealthEventTypeCategory' => [ 'type' => 'string', ], 'HealthEventTypeCode' => [ 'type' => 'string', ], 'HealthService' => [ 'type' => 'string', ], 'Insights' => [ 'type' => 'string', ], 'InternalServerException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMsg', ], ], 'exception' => true, ], 'LastRecurrenceTime' => [ 'type' => 'timestamp', ], 'LifeCycle' => [ 'type' => 'string', ], 'LineTime' => [ 'type' => 'timestamp', ], 'ListApplicationsRequest' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => 'MaxEntities', ], 'NextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListApplicationsResponse' => [ 'type' => 'structure', 'members' => [ 'ApplicationInfoList' => [ 'shape' => 'ApplicationInfoList', ], 'NextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListComponentsRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'MaxResults' => [ 'shape' => 'MaxEntities', ], 'NextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListComponentsResponse' => [ 'type' => 'structure', 'members' => [ 'ApplicationComponentList' => [ 'shape' => 'ApplicationComponentList', ], 'NextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListConfigurationHistoryRequest' => [ 'type' => 'structure', 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'StartTime' => [ 'shape' => 'StartTime', ], 'EndTime' => [ 'shape' => 'EndTime', ], 'EventStatus' => [ 'shape' => 'ConfigurationEventStatus', ], 'MaxResults' => [ 'shape' => 'MaxEntities', ], 'NextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListConfigurationHistoryResponse' => [ 'type' => 'structure', 'members' => [ 'EventList' => [ 'shape' => 'ConfigurationEventList', ], 'NextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListLogPatternSetsRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'MaxResults' => [ 'shape' => 'MaxEntities', ], 'NextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListLogPatternSetsResponse' => [ 'type' => 'structure', 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'LogPatternSets' => [ 'shape' => 'LogPatternSetList', ], 'NextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListLogPatternsRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'PatternSetName' => [ 'shape' => 'LogPatternSetName', ], 'MaxResults' => [ 'shape' => 'MaxEntities', ], 'NextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListLogPatternsResponse' => [ 'type' => 'structure', 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'LogPatterns' => [ 'shape' => 'LogPatternList', ], 'NextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListProblemsRequest' => [ 'type' => 'structure', 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'StartTime' => [ 'shape' => 'StartTime', ], 'EndTime' => [ 'shape' => 'EndTime', ], 'MaxResults' => [ 'shape' => 'MaxEntities', ], 'NextToken' => [ 'shape' => 'PaginationToken', ], 'ComponentName' => [ 'shape' => 'ComponentName', ], ], ], 'ListProblemsResponse' => [ 'type' => 'structure', 'members' => [ 'ProblemList' => [ 'shape' => 'ProblemList', ], 'NextToken' => [ 'shape' => 'PaginationToken', ], 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'AmazonResourceName', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], ], ], 'LogFilter' => [ 'type' => 'string', 'enum' => [ 'ERROR', 'WARN', 'INFO', ], ], 'LogGroup' => [ 'type' => 'string', ], 'LogPattern' => [ 'type' => 'structure', 'members' => [ 'PatternSetName' => [ 'shape' => 'LogPatternSetName', ], 'PatternName' => [ 'shape' => 'LogPatternName', ], 'Pattern' => [ 'shape' => 'LogPatternRegex', ], 'Rank' => [ 'shape' => 'LogPatternRank', ], ], ], 'LogPatternList' => [ 'type' => 'list', 'member' => [ 'shape' => 'LogPattern', ], ], 'LogPatternName' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'pattern' => '[a-zA-Z0-9\\\\.\\\\-_]*', ], 'LogPatternRank' => [ 'type' => 'integer', ], 'LogPatternRegex' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'pattern' => '[\\\\S\\\\s]+', ], 'LogPatternSetList' => [ 'type' => 'list', 'member' => [ 'shape' => 'LogPatternSetName', ], ], 'LogPatternSetName' => [ 'type' => 'string', 'max' => 30, 'min' => 1, 'pattern' => '[a-zA-Z0-9\\\\.\\\\-_]*', ], 'LogText' => [ 'type' => 'string', ], 'MaxEntities' => [ 'type' => 'integer', 'max' => 40, 'min' => 1, ], 'MetaDataKey' => [ 'type' => 'string', ], 'MetaDataValue' => [ 'type' => 'string', ], 'MetricName' => [ 'type' => 'string', ], 'MetricNamespace' => [ 'type' => 'string', ], 'Monitor' => [ 'type' => 'boolean', ], 'Observation' => [ 'type' => 'structure', 'members' => [ 'Id' => [ 'shape' => 'ObservationId', ], 'StartTime' => [ 'shape' => 'StartTime', ], 'EndTime' => [ 'shape' => 'EndTime', ], 'SourceType' => [ 'shape' => 'SourceType', ], 'SourceARN' => [ 'shape' => 'SourceARN', ], 'LogGroup' => [ 'shape' => 'LogGroup', ], 'LineTime' => [ 'shape' => 'LineTime', ], 'LogText' => [ 'shape' => 'LogText', ], 'LogFilter' => [ 'shape' => 'LogFilter', ], 'MetricNamespace' => [ 'shape' => 'MetricNamespace', ], 'MetricName' => [ 'shape' => 'MetricName', ], 'Unit' => [ 'shape' => 'Unit', ], 'Value' => [ 'shape' => 'Value', ], 'CloudWatchEventId' => [ 'shape' => 'CloudWatchEventId', ], 'CloudWatchEventSource' => [ 'shape' => 'CloudWatchEventSource', ], 'CloudWatchEventDetailType' => [ 'shape' => 'CloudWatchEventDetailType', ], 'HealthEventArn' => [ 'shape' => 'HealthEventArn', ], 'HealthService' => [ 'shape' => 'HealthService', ], 'HealthEventTypeCode' => [ 'shape' => 'HealthEventTypeCode', ], 'HealthEventTypeCategory' => [ 'shape' => 'HealthEventTypeCategory', ], 'HealthEventDescription' => [ 'shape' => 'HealthEventDescription', ], 'CodeDeployDeploymentId' => [ 'shape' => 'CodeDeployDeploymentId', ], 'CodeDeployDeploymentGroup' => [ 'shape' => 'CodeDeployDeploymentGroup', ], 'CodeDeployState' => [ 'shape' => 'CodeDeployState', ], 'CodeDeployApplication' => [ 'shape' => 'CodeDeployApplication', ], 'CodeDeployInstanceGroupId' => [ 'shape' => 'CodeDeployInstanceGroupId', ], 'Ec2State' => [ 'shape' => 'Ec2State', ], 'RdsEventCategories' => [ 'shape' => 'RdsEventCategories', ], 'RdsEventMessage' => [ 'shape' => 'RdsEventMessage', ], 'S3EventName' => [ 'shape' => 'S3EventName', ], 'StatesExecutionArn' => [ 'shape' => 'StatesExecutionArn', ], 'StatesArn' => [ 'shape' => 'StatesArn', ], 'StatesStatus' => [ 'shape' => 'StatesStatus', ], 'StatesInput' => [ 'shape' => 'StatesInput', ], 'EbsEvent' => [ 'shape' => 'EbsEvent', ], 'EbsResult' => [ 'shape' => 'EbsResult', ], 'EbsCause' => [ 'shape' => 'EbsCause', ], 'EbsRequestId' => [ 'shape' => 'EbsRequestId', ], 'XRayFaultPercent' => [ 'shape' => 'XRayFaultPercent', ], 'XRayThrottlePercent' => [ 'shape' => 'XRayThrottlePercent', ], 'XRayErrorPercent' => [ 'shape' => 'XRayErrorPercent', ], 'XRayRequestCount' => [ 'shape' => 'XRayRequestCount', ], 'XRayRequestAverageLatency' => [ 'shape' => 'XRayRequestAverageLatency', ], 'XRayNodeName' => [ 'shape' => 'XRayNodeName', ], 'XRayNodeType' => [ 'shape' => 'XRayNodeType', ], ], ], 'ObservationId' => [ 'type' => 'string', 'max' => 38, 'min' => 38, 'pattern' => 'o-[0-9a-fA-F]{8}\\\\-[0-9a-fA-F]{4}\\\\-[0-9a-fA-F]{4}\\\\-[0-9a-fA-F]{4}\\\\-[0-9a-fA-F]{12}', ], 'ObservationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Observation', ], ], 'OpsCenterEnabled' => [ 'type' => 'boolean', ], 'OpsItemSNSTopicArn' => [ 'type' => 'string', 'max' => 300, 'min' => 20, 'pattern' => '^arn:aws(-\\\\w+)*:[\\\\w\\\\d-]+:([\\\\w\\\\d-]*)?:[\\\\w\\\\d_-]*([:/].+)*$', ], 'OsType' => [ 'type' => 'string', 'enum' => [ 'WINDOWS', 'LINUX', ], ], 'PaginationToken' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, 'pattern' => '.+', ], 'Problem' => [ 'type' => 'structure', 'members' => [ 'Id' => [ 'shape' => 'ProblemId', ], 'Title' => [ 'shape' => 'Title', ], 'Insights' => [ 'shape' => 'Insights', ], 'Status' => [ 'shape' => 'Status', ], 'AffectedResource' => [ 'shape' => 'AffectedResource', ], 'StartTime' => [ 'shape' => 'StartTime', ], 'EndTime' => [ 'shape' => 'EndTime', ], 'SeverityLevel' => [ 'shape' => 'SeverityLevel', ], 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'Feedback' => [ 'shape' => 'Feedback', ], 'RecurringCount' => [ 'shape' => 'RecurringCount', ], 'LastRecurrenceTime' => [ 'shape' => 'LastRecurrenceTime', ], ], ], 'ProblemId' => [ 'type' => 'string', 'max' => 38, 'min' => 38, 'pattern' => 'p-[0-9a-fA-F]{8}\\\\-[0-9a-fA-F]{4}\\\\-[0-9a-fA-F]{4}\\\\-[0-9a-fA-F]{4}\\\\-[0-9a-fA-F]{12}', ], 'ProblemList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Problem', ], ], 'RdsEventCategories' => [ 'type' => 'string', ], 'RdsEventMessage' => [ 'type' => 'string', ], 'RecurringCount' => [ 'type' => 'long', ], 'RelatedObservations' => [ 'type' => 'structure', 'members' => [ 'ObservationList' => [ 'shape' => 'ObservationList', ], ], ], 'Remarks' => [ 'type' => 'string', ], 'RemoveSNSTopic' => [ 'type' => 'boolean', ], 'ResourceARN' => [ 'type' => 'string', 'max' => 1011, 'min' => 1, 'pattern' => '^arn:aws(-\\\\w+)*:[\\\\w\\\\d-]+:([\\\\w\\\\d-]*)?:[\\\\w\\\\d_-]*([:/].+)*$', ], 'ResourceGroupName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '[a-zA-Z0-9\\\\.\\\\-_]*', ], 'ResourceInUseException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMsg', ], ], 'exception' => true, ], 'ResourceList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResourceARN', ], ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMsg', ], ], 'exception' => true, ], 'ResourceType' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'pattern' => '[0-9a-zA-Z:_]*', ], 'S3EventName' => [ 'type' => 'string', ], 'SeverityLevel' => [ 'type' => 'string', 'enum' => [ 'Informative', 'Low', 'Medium', 'High', ], ], 'SourceARN' => [ 'type' => 'string', ], 'SourceType' => [ 'type' => 'string', ], 'StartTime' => [ 'type' => 'timestamp', ], 'StatesArn' => [ 'type' => 'string', ], 'StatesExecutionArn' => [ 'type' => 'string', ], 'StatesInput' => [ 'type' => 'string', ], 'StatesStatus' => [ 'type' => 'string', ], 'Status' => [ 'type' => 'string', 'enum' => [ 'IGNORE', 'RESOLVED', 'PENDING', 'RECURRING', ], ], 'Tag' => [ 'type' => 'structure', 'required' => [ 'Key', 'Value', ], 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$', ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 200, 'min' => 0, ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], 'max' => 200, 'min' => 0, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'Tags', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'AmazonResourceName', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => '^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$', ], 'TagsAlreadyExistException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'exception' => true, ], 'Tier' => [ 'type' => 'string', 'enum' => [ 'CUSTOM', 'DEFAULT', 'DOT_NET_CORE', 'DOT_NET_WORKER', 'DOT_NET_WEB_TIER', 'DOT_NET_WEB', 'SQL_SERVER', 'SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP', 'MYSQL', 'POSTGRESQL', 'JAVA_JMX', 'ORACLE', 'SAP_HANA_MULTI_NODE', 'SAP_HANA_SINGLE_NODE', 'SAP_HANA_HIGH_AVAILABILITY', 'SQL_SERVER_FAILOVER_CLUSTER_INSTANCE', 'SHAREPOINT', 'ACTIVE_DIRECTORY', ], 'max' => 50, 'min' => 1, ], 'Title' => [ 'type' => 'string', ], 'TooManyTagsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], 'ResourceName' => [ 'shape' => 'AmazonResourceName', ], ], 'exception' => true, ], 'Unit' => [ 'type' => 'string', ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'TagKeys', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'AmazonResourceName', ], 'TagKeys' => [ 'shape' => 'TagKeyList', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'OpsCenterEnabled' => [ 'shape' => 'OpsCenterEnabled', ], 'CWEMonitorEnabled' => [ 'shape' => 'CWEMonitorEnabled', ], 'OpsItemSNSTopicArn' => [ 'shape' => 'OpsItemSNSTopicArn', ], 'RemoveSNSTopic' => [ 'shape' => 'RemoveSNSTopic', ], 'AutoConfigEnabled' => [ 'shape' => 'AutoConfigEnabled', ], ], ], 'UpdateApplicationResponse' => [ 'type' => 'structure', 'members' => [ 'ApplicationInfo' => [ 'shape' => 'ApplicationInfo', ], ], ], 'UpdateComponentConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', 'ComponentName', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'ComponentName' => [ 'shape' => 'ComponentName', ], 'Monitor' => [ 'shape' => 'Monitor', ], 'Tier' => [ 'shape' => 'Tier', ], 'ComponentConfiguration' => [ 'shape' => 'ComponentConfiguration', ], 'AutoConfigEnabled' => [ 'shape' => 'AutoConfigEnabled', ], ], ], 'UpdateComponentConfigurationResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateComponentRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', 'ComponentName', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'ComponentName' => [ 'shape' => 'CustomComponentName', ], 'NewComponentName' => [ 'shape' => 'CustomComponentName', ], 'ResourceList' => [ 'shape' => 'ResourceList', ], ], ], 'UpdateComponentResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateLogPatternRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceGroupName', 'PatternSetName', 'PatternName', ], 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'PatternSetName' => [ 'shape' => 'LogPatternSetName', ], 'PatternName' => [ 'shape' => 'LogPatternName', ], 'Pattern' => [ 'shape' => 'LogPatternRegex', ], 'Rank' => [ 'shape' => 'LogPatternRank', ], ], ], 'UpdateLogPatternResponse' => [ 'type' => 'structure', 'members' => [ 'ResourceGroupName' => [ 'shape' => 'ResourceGroupName', ], 'LogPattern' => [ 'shape' => 'LogPattern', ], ], ], 'ValidationException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMsg', ], ], 'exception' => true, ], 'Value' => [ 'type' => 'double', ], 'WorkloadMetaData' => [ 'type' => 'map', 'key' => [ 'shape' => 'MetaDataKey', ], 'value' => [ 'shape' => 'MetaDataValue', ], ], 'XRayErrorPercent' => [ 'type' => 'integer', ], 'XRayFaultPercent' => [ 'type' => 'integer', ], 'XRayNodeName' => [ 'type' => 'string', ], 'XRayNodeType' => [ 'type' => 'string', ], 'XRayRequestAverageLatency' => [ 'type' => 'long', ], 'XRayRequestCount' => [ 'type' => 'integer', ], 'XRayThrottlePercent' => [ 'type' => 'integer', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/application-insights/2018-11-25/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], [ 'fn' => 'parseURL', 'argv' => [ [ 'ref' => 'Endpoint', ], ], 'assign' => 'url', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://applicationinsights-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://applicationinsights-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://applicationinsights.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://applicationinsights.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/application-insights/2018-11-25/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.ap-south-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.ap-south-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.eu-south-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.eu-south-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.ca-central-1.api.aws', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.ca-central-1.api.aws', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.eu-central-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.eu-central-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.af-south-1.api.aws', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.af-south-1.api.aws', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.eu-north-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.eu-north-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.eu-west-3.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.eu-west-3.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.ap-northeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.ap-northeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.ap-northeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.ap-northeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.ap-northeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.ap-northeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.me-south-1.api.aws', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.me-south-1.api.aws', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.sa-east-1.api.aws', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.sa-east-1.api.aws', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.ap-east-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.ap-east-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.us-gov-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.us-gov-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.ap-southeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.ap-southeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.ap-southeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.ap-southeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights-fips.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://applicationinsights.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/application-insights/2018-11-25/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/application-insights/2018-11-25/paginators-1.json\nreturn [ 'pagination' => [ 'ListApplications' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListComponents' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListConfigurationHistory' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListLogPatternSets' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListLogPatterns' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListProblems' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/applicationcostprofiler/2020-09-10/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2020-09-10', 'endpointPrefix' => 'application-cost-profiler', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'AWS Application Cost Profiler', 'serviceId' => 'ApplicationCostProfiler', 'signatureVersion' => 'v4', 'signingName' => 'application-cost-profiler', 'uid' => 'AWSApplicationCostProfiler-2020-09-10', ], 'operations' => [ 'DeleteReportDefinition' => [ 'name' => 'DeleteReportDefinition', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/reportDefinition/{reportId}', ], 'input' => [ 'shape' => 'DeleteReportDefinitionRequest', ], 'output' => [ 'shape' => 'DeleteReportDefinitionResult', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetReportDefinition' => [ 'name' => 'GetReportDefinition', 'http' => [ 'method' => 'GET', 'requestUri' => '/reportDefinition/{reportId}', ], 'input' => [ 'shape' => 'GetReportDefinitionRequest', ], 'output' => [ 'shape' => 'GetReportDefinitionResult', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ImportApplicationUsage' => [ 'name' => 'ImportApplicationUsage', 'http' => [ 'method' => 'POST', 'requestUri' => '/importApplicationUsage', ], 'input' => [ 'shape' => 'ImportApplicationUsageRequest', ], 'output' => [ 'shape' => 'ImportApplicationUsageResult', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListReportDefinitions' => [ 'name' => 'ListReportDefinitions', 'http' => [ 'method' => 'GET', 'requestUri' => '/reportDefinition', ], 'input' => [ 'shape' => 'ListReportDefinitionsRequest', ], 'output' => [ 'shape' => 'ListReportDefinitionsResult', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'PutReportDefinition' => [ 'name' => 'PutReportDefinition', 'http' => [ 'method' => 'POST', 'requestUri' => '/reportDefinition', ], 'input' => [ 'shape' => 'PutReportDefinitionRequest', ], 'output' => [ 'shape' => 'PutReportDefinitionResult', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], ], 'UpdateReportDefinition' => [ 'name' => 'UpdateReportDefinition', 'http' => [ 'method' => 'PUT', 'requestUri' => '/reportDefinition/{reportId}', ], 'input' => [ 'shape' => 'UpdateReportDefinitionRequest', ], 'output' => [ 'shape' => 'UpdateReportDefinitionResult', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], ], ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 403, ], 'exception' => true, ], 'DeleteReportDefinitionRequest' => [ 'type' => 'structure', 'required' => [ 'reportId', ], 'members' => [ 'reportId' => [ 'shape' => 'ReportId', 'location' => 'uri', 'locationName' => 'reportId', ], ], ], 'DeleteReportDefinitionResult' => [ 'type' => 'structure', 'members' => [ 'reportId' => [ 'shape' => 'ReportId', ], ], ], 'ErrorMessage' => [ 'type' => 'string', ], 'Format' => [ 'type' => 'string', 'enum' => [ 'CSV', 'PARQUET', ], ], 'GetReportDefinitionRequest' => [ 'type' => 'structure', 'required' => [ 'reportId', ], 'members' => [ 'reportId' => [ 'shape' => 'ReportId', 'location' => 'uri', 'locationName' => 'reportId', ], ], ], 'GetReportDefinitionResult' => [ 'type' => 'structure', 'required' => [ 'reportId', 'reportDescription', 'reportFrequency', 'format', 'destinationS3Location', 'createdAt', 'lastUpdated', ], 'members' => [ 'reportId' => [ 'shape' => 'ReportId', ], 'reportDescription' => [ 'shape' => 'ReportDescription', ], 'reportFrequency' => [ 'shape' => 'ReportFrequency', ], 'format' => [ 'shape' => 'Format', ], 'destinationS3Location' => [ 'shape' => 'S3Location', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'lastUpdated' => [ 'shape' => 'Timestamp', ], ], ], 'ImportApplicationUsageRequest' => [ 'type' => 'structure', 'required' => [ 'sourceS3Location', ], 'members' => [ 'sourceS3Location' => [ 'shape' => 'SourceS3Location', ], ], ], 'ImportApplicationUsageResult' => [ 'type' => 'structure', 'required' => [ 'importId', ], 'members' => [ 'importId' => [ 'shape' => 'ImportId', ], ], ], 'ImportId' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '[0-9A-Za-z\\\\.\\\\-_]*', ], 'Integer' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'InternalServerException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'ListReportDefinitionsRequest' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'Integer', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListReportDefinitionsResult' => [ 'type' => 'structure', 'members' => [ 'reportDefinitions' => [ 'shape' => 'ReportDefinitionList', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'PutReportDefinitionRequest' => [ 'type' => 'structure', 'required' => [ 'reportId', 'reportDescription', 'reportFrequency', 'format', 'destinationS3Location', ], 'members' => [ 'reportId' => [ 'shape' => 'ReportId', ], 'reportDescription' => [ 'shape' => 'ReportDescription', ], 'reportFrequency' => [ 'shape' => 'ReportFrequency', ], 'format' => [ 'shape' => 'Format', ], 'destinationS3Location' => [ 'shape' => 'S3Location', ], ], ], 'PutReportDefinitionResult' => [ 'type' => 'structure', 'members' => [ 'reportId' => [ 'shape' => 'ReportId', ], ], ], 'ReportDefinition' => [ 'type' => 'structure', 'members' => [ 'reportId' => [ 'shape' => 'ReportId', ], 'reportDescription' => [ 'shape' => 'ReportDescription', ], 'reportFrequency' => [ 'shape' => 'ReportFrequency', ], 'format' => [ 'shape' => 'Format', ], 'destinationS3Location' => [ 'shape' => 'S3Location', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'lastUpdatedAt' => [ 'shape' => 'Timestamp', ], ], ], 'ReportDefinitionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ReportDefinition', ], ], 'ReportDescription' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, 'pattern' => '.*\\\\S.*', ], 'ReportFrequency' => [ 'type' => 'string', 'enum' => [ 'MONTHLY', 'DAILY', 'ALL', ], ], 'ReportId' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '^[0-9A-Za-z\\\\.\\\\-_]+$', ], 'S3Bucket' => [ 'type' => 'string', 'max' => 63, 'min' => 3, 'pattern' => '(?=^.{3,63}$)(?!^(\\\\d+\\\\.)+\\\\d+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\\\-]*[a-z0-9])\\\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\\\-]*[a-z0-9])$)', ], 'S3BucketRegion' => [ 'type' => 'string', 'enum' => [ 'ap-east-1', 'me-south-1', 'eu-south-1', 'af-south-1', ], ], 'S3Key' => [ 'type' => 'string', 'max' => 512, 'min' => 1, 'pattern' => '.*\\\\S.*', ], 'S3Location' => [ 'type' => 'structure', 'required' => [ 'bucket', 'prefix', ], 'members' => [ 'bucket' => [ 'shape' => 'S3Bucket', ], 'prefix' => [ 'shape' => 'S3Prefix', ], ], ], 'S3Prefix' => [ 'type' => 'string', 'max' => 512, 'min' => 1, 'pattern' => '.*\\\\S.*', ], 'ServiceQuotaExceededException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 402, ], 'exception' => true, ], 'SourceS3Location' => [ 'type' => 'structure', 'required' => [ 'bucket', 'key', ], 'members' => [ 'bucket' => [ 'shape' => 'S3Bucket', ], 'key' => [ 'shape' => 'S3Key', ], 'region' => [ 'shape' => 'S3BucketRegion', ], ], ], 'ThrottlingException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], 'Timestamp' => [ 'type' => 'timestamp', ], 'Token' => [ 'type' => 'string', 'max' => 102400, 'min' => 1, 'pattern' => '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$', ], 'UpdateReportDefinitionRequest' => [ 'type' => 'structure', 'required' => [ 'reportId', 'reportDescription', 'reportFrequency', 'format', 'destinationS3Location', ], 'members' => [ 'reportId' => [ 'shape' => 'ReportId', 'location' => 'uri', 'locationName' => 'reportId', ], 'reportDescription' => [ 'shape' => 'ReportDescription', ], 'reportFrequency' => [ 'shape' => 'ReportFrequency', ], 'format' => [ 'shape' => 'Format', ], 'destinationS3Location' => [ 'shape' => 'S3Location', ], ], ], 'UpdateReportDefinitionResult' => [ 'type' => 'structure', 'members' => [ 'reportId' => [ 'shape' => 'ReportId', ], ], ], 'ValidationException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/applicationcostprofiler/2020-09-10/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>This reference provides descriptions of the AWS Application Cost Profiler API.</p> <p>The AWS Application Cost Profiler API provides programmatic access to view, create, update, and delete application cost report definitions, as well as to import your usage data into the Application Cost Profiler service.</p> <p>For more information about using this service, see the <a href=\"https://docs.aws.amazon.com/application-cost-profiler/latest/userguide/introduction.html\">AWS Application Cost Profiler User Guide</a>.</p>', 'operations' => [ 'DeleteReportDefinition' => '<p>Deletes the specified report definition in AWS Application Cost Profiler. This stops the report from being generated.</p>', 'GetReportDefinition' => '<p>Retrieves the definition of a report already configured in AWS Application Cost Profiler.</p>', 'ImportApplicationUsage' => '<p>Ingests application usage data from Amazon Simple Storage Service (Amazon S3).</p> <p>The data must already exist in the S3 location. As part of the action, AWS Application Cost Profiler copies the object from your S3 bucket to an S3 bucket owned by Amazon for processing asynchronously.</p>', 'ListReportDefinitions' => '<p>Retrieves a list of all reports and their configurations for your AWS account.</p> <p>The maximum number of reports is one.</p>', 'PutReportDefinition' => '<p>Creates the report definition for a report in Application Cost Profiler.</p>', 'UpdateReportDefinition' => '<p>Updates existing report in AWS Application Cost Profiler.</p>', ], 'shapes' => [ 'AccessDeniedException' => [ 'base' => '<p>You do not have permission to perform this action.</p>', 'refs' => [], ], 'DeleteReportDefinitionRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteReportDefinitionResult' => [ 'base' => NULL, 'refs' => [], ], 'ErrorMessage' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$message' => NULL, 'InternalServerException$message' => NULL, 'ServiceQuotaExceededException$message' => NULL, 'ThrottlingException$message' => NULL, 'ValidationException$message' => NULL, ], ], 'Format' => [ 'base' => NULL, 'refs' => [ 'GetReportDefinitionResult$format' => '<p>Format of the generated report.</p>', 'PutReportDefinitionRequest$format' => '<p>Required. The format to use for the generated report.</p>', 'ReportDefinition$format' => '<p>The format used for the generated reports.</p>', 'UpdateReportDefinitionRequest$format' => '<p>Required. The format to use for the generated report.</p>', ], ], 'GetReportDefinitionRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetReportDefinitionResult' => [ 'base' => NULL, 'refs' => [], ], 'ImportApplicationUsageRequest' => [ 'base' => NULL, 'refs' => [], ], 'ImportApplicationUsageResult' => [ 'base' => NULL, 'refs' => [], ], 'ImportId' => [ 'base' => NULL, 'refs' => [ 'ImportApplicationUsageResult$importId' => '<p>ID of the import request.</p>', ], ], 'Integer' => [ 'base' => NULL, 'refs' => [ 'ListReportDefinitionsRequest$maxResults' => '<p>The maximum number of results to return.</p>', ], ], 'InternalServerException' => [ 'base' => '<p>An internal server error occurred. Retry your request.</p>', 'refs' => [], ], 'ListReportDefinitionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListReportDefinitionsResult' => [ 'base' => NULL, 'refs' => [], ], 'PutReportDefinitionRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutReportDefinitionResult' => [ 'base' => NULL, 'refs' => [], ], 'ReportDefinition' => [ 'base' => '<p>The configuration of a report in AWS Application Cost Profiler.</p>', 'refs' => [ 'ReportDefinitionList$member' => NULL, ], ], 'ReportDefinitionList' => [ 'base' => NULL, 'refs' => [ 'ListReportDefinitionsResult$reportDefinitions' => '<p>The retrieved reports.</p>', ], ], 'ReportDescription' => [ 'base' => NULL, 'refs' => [ 'GetReportDefinitionResult$reportDescription' => '<p>Description of the report.</p>', 'PutReportDefinitionRequest$reportDescription' => '<p>Required. Description of the report.</p>', 'ReportDefinition$reportDescription' => '<p>Description of the report</p>', 'UpdateReportDefinitionRequest$reportDescription' => '<p>Required. Description of the report.</p>', ], ], 'ReportFrequency' => [ 'base' => NULL, 'refs' => [ 'GetReportDefinitionResult$reportFrequency' => '<p>Cadence used to generate the report.</p>', 'PutReportDefinitionRequest$reportFrequency' => '<p>Required. The cadence to generate the report.</p>', 'ReportDefinition$reportFrequency' => '<p>The cadence at which the report is generated.</p>', 'UpdateReportDefinitionRequest$reportFrequency' => '<p>Required. The cadence to generate the report.</p>', ], ], 'ReportId' => [ 'base' => NULL, 'refs' => [ 'DeleteReportDefinitionRequest$reportId' => '<p>Required. ID of the report to delete.</p>', 'DeleteReportDefinitionResult$reportId' => '<p>ID of the report that was deleted.</p>', 'GetReportDefinitionRequest$reportId' => '<p>ID of the report to retrieve.</p>', 'GetReportDefinitionResult$reportId' => '<p>ID of the report retrieved.</p>', 'PutReportDefinitionRequest$reportId' => '<p>Required. ID of the report. You can choose any valid string matching the pattern for the ID.</p>', 'PutReportDefinitionResult$reportId' => '<p>ID of the report.</p>', 'ReportDefinition$reportId' => '<p>The ID of the report.</p>', 'UpdateReportDefinitionRequest$reportId' => '<p>Required. ID of the report to update.</p>', 'UpdateReportDefinitionResult$reportId' => '<p>ID of the report.</p>', ], ], 'S3Bucket' => [ 'base' => NULL, 'refs' => [ 'S3Location$bucket' => '<p>Name of the S3 bucket.</p>', 'SourceS3Location$bucket' => '<p>Name of the bucket.</p>', ], ], 'S3BucketRegion' => [ 'base' => NULL, 'refs' => [ 'SourceS3Location$region' => '<p>Region of the bucket. Only required for Regions that are disabled by default. For more infomration about Regions that are disabled by default, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable\"> Enabling a Region</a> in the <i>AWS General Reference guide</i>.</p>', ], ], 'S3Key' => [ 'base' => NULL, 'refs' => [ 'SourceS3Location$key' => '<p>Key of the object.</p>', ], ], 'S3Location' => [ 'base' => '<p>Represents the Amazon Simple Storage Service (Amazon S3) location where AWS Application Cost Profiler reports are generated and then written to.</p>', 'refs' => [ 'GetReportDefinitionResult$destinationS3Location' => '<p>Amazon Simple Storage Service (Amazon S3) location where the report is uploaded.</p>', 'PutReportDefinitionRequest$destinationS3Location' => '<p>Required. Amazon Simple Storage Service (Amazon S3) location where Application Cost Profiler uploads the report.</p>', 'ReportDefinition$destinationS3Location' => '<p>The location in Amazon Simple Storage Service (Amazon S3) the reports should be saved to.</p>', 'UpdateReportDefinitionRequest$destinationS3Location' => '<p>Required. Amazon Simple Storage Service (Amazon S3) location where Application Cost Profiler uploads the report.</p>', ], ], 'S3Prefix' => [ 'base' => NULL, 'refs' => [ 'S3Location$prefix' => '<p>Prefix for the location to write to.</p>', ], ], 'ServiceQuotaExceededException' => [ 'base' => '<p>Your request exceeds one or more of the service quotas.</p>', 'refs' => [], ], 'SourceS3Location' => [ 'base' => '<p>Represents the Amazon Simple Storage Service (Amazon S3) location where usage data is read from.</p>', 'refs' => [ 'ImportApplicationUsageRequest$sourceS3Location' => '<p>Amazon S3 location to import application usage data from.</p>', ], ], 'ThrottlingException' => [ 'base' => '<p>The calls to AWS Application Cost Profiler API are throttled. The request was denied.</p>', 'refs' => [], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [ 'GetReportDefinitionResult$createdAt' => '<p>Timestamp (milliseconds) when this report definition was created.</p>', 'GetReportDefinitionResult$lastUpdated' => '<p>Timestamp (milliseconds) when this report definition was last updated.</p>', 'ReportDefinition$createdAt' => '<p>Timestamp (milliseconds) when this report definition was created.</p>', 'ReportDefinition$lastUpdatedAt' => '<p>Timestamp (milliseconds) when this report definition was last updated.</p>', ], ], 'Token' => [ 'base' => NULL, 'refs' => [ 'ListReportDefinitionsRequest$nextToken' => '<p>The token value from a previous call to access the next page of results.</p>', 'ListReportDefinitionsResult$nextToken' => '<p>The value of the next token, if it exists. Null if there are no more results.</p>', ], ], 'UpdateReportDefinitionRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateReportDefinitionResult' => [ 'base' => NULL, 'refs' => [], ], 'ValidationException' => [ 'base' => '<p>The input fails to satisfy the constraints for the API.</p>', 'refs' => [], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/applicationcostprofiler/2020-09-10/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], [ 'fn' => 'parseURL', 'argv' => [ [ 'ref' => 'Endpoint', ], ], 'assign' => 'url', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://application-cost-profiler-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://application-cost-profiler-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://application-cost-profiler.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://application-cost-profiler.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/applicationcostprofiler/2020-09-10/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/applicationcostprofiler/2020-09-10/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/applicationcostprofiler/2020-09-10/paginators-1.json\nreturn [ 'pagination' => [ 'ListReportDefinitions' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'reportDefinitions', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appmesh/2018-10-01/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2018-10-01', 'endpointPrefix' => 'appmesh', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'AWS App Mesh', 'serviceId' => 'App Mesh', 'signatureVersion' => 'v4', 'signingName' => 'appmesh', 'uid' => 'appmesh-2018-10-01', ], 'operations' => [ 'CreateMesh' => [ 'name' => 'CreateMesh', 'http' => [ 'method' => 'PUT', 'requestUri' => '/meshes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateMeshInput', ], 'output' => [ 'shape' => 'CreateMeshOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], 'idempotent' => true, ], 'CreateRoute' => [ 'name' => 'CreateRoute', 'http' => [ 'method' => 'PUT', 'requestUri' => '/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateRouteInput', ], 'output' => [ 'shape' => 'CreateRouteOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], 'idempotent' => true, ], 'CreateVirtualNode' => [ 'name' => 'CreateVirtualNode', 'http' => [ 'method' => 'PUT', 'requestUri' => '/meshes/{meshName}/virtualNodes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateVirtualNodeInput', ], 'output' => [ 'shape' => 'CreateVirtualNodeOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], 'idempotent' => true, ], 'CreateVirtualRouter' => [ 'name' => 'CreateVirtualRouter', 'http' => [ 'method' => 'PUT', 'requestUri' => '/meshes/{meshName}/virtualRouters', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateVirtualRouterInput', ], 'output' => [ 'shape' => 'CreateVirtualRouterOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], 'idempotent' => true, ], 'DeleteMesh' => [ 'name' => 'DeleteMesh', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/meshes/{meshName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteMeshInput', ], 'output' => [ 'shape' => 'DeleteMeshOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], 'idempotent' => true, ], 'DeleteRoute' => [ 'name' => 'DeleteRoute', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes/{routeName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteRouteInput', ], 'output' => [ 'shape' => 'DeleteRouteOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], 'idempotent' => true, ], 'DeleteVirtualNode' => [ 'name' => 'DeleteVirtualNode', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/meshes/{meshName}/virtualNodes/{virtualNodeName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteVirtualNodeInput', ], 'output' => [ 'shape' => 'DeleteVirtualNodeOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], 'idempotent' => true, ], 'DeleteVirtualRouter' => [ 'name' => 'DeleteVirtualRouter', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/meshes/{meshName}/virtualRouters/{virtualRouterName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteVirtualRouterInput', ], 'output' => [ 'shape' => 'DeleteVirtualRouterOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], 'idempotent' => true, ], 'DescribeMesh' => [ 'name' => 'DescribeMesh', 'http' => [ 'method' => 'GET', 'requestUri' => '/meshes/{meshName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeMeshInput', ], 'output' => [ 'shape' => 'DescribeMeshOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DescribeRoute' => [ 'name' => 'DescribeRoute', 'http' => [ 'method' => 'GET', 'requestUri' => '/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes/{routeName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeRouteInput', ], 'output' => [ 'shape' => 'DescribeRouteOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DescribeVirtualNode' => [ 'name' => 'DescribeVirtualNode', 'http' => [ 'method' => 'GET', 'requestUri' => '/meshes/{meshName}/virtualNodes/{virtualNodeName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeVirtualNodeInput', ], 'output' => [ 'shape' => 'DescribeVirtualNodeOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DescribeVirtualRouter' => [ 'name' => 'DescribeVirtualRouter', 'http' => [ 'method' => 'GET', 'requestUri' => '/meshes/{meshName}/virtualRouters/{virtualRouterName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeVirtualRouterInput', ], 'output' => [ 'shape' => 'DescribeVirtualRouterOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'ListMeshes' => [ 'name' => 'ListMeshes', 'http' => [ 'method' => 'GET', 'requestUri' => '/meshes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListMeshesInput', ], 'output' => [ 'shape' => 'ListMeshesOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'ListRoutes' => [ 'name' => 'ListRoutes', 'http' => [ 'method' => 'GET', 'requestUri' => '/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListRoutesInput', ], 'output' => [ 'shape' => 'ListRoutesOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'ListVirtualNodes' => [ 'name' => 'ListVirtualNodes', 'http' => [ 'method' => 'GET', 'requestUri' => '/meshes/{meshName}/virtualNodes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListVirtualNodesInput', ], 'output' => [ 'shape' => 'ListVirtualNodesOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'ListVirtualRouters' => [ 'name' => 'ListVirtualRouters', 'http' => [ 'method' => 'GET', 'requestUri' => '/meshes/{meshName}/virtualRouters', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListVirtualRoutersInput', ], 'output' => [ 'shape' => 'ListVirtualRoutersOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateRoute' => [ 'name' => 'UpdateRoute', 'http' => [ 'method' => 'PUT', 'requestUri' => '/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes/{routeName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateRouteInput', ], 'output' => [ 'shape' => 'UpdateRouteOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], 'idempotent' => true, ], 'UpdateVirtualNode' => [ 'name' => 'UpdateVirtualNode', 'http' => [ 'method' => 'PUT', 'requestUri' => '/meshes/{meshName}/virtualNodes/{virtualNodeName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateVirtualNodeInput', ], 'output' => [ 'shape' => 'UpdateVirtualNodeOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], 'idempotent' => true, ], 'UpdateVirtualRouter' => [ 'name' => 'UpdateVirtualRouter', 'http' => [ 'method' => 'PUT', 'requestUri' => '/meshes/{meshName}/virtualRouters/{virtualRouterName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateVirtualRouterInput', ], 'output' => [ 'shape' => 'UpdateVirtualRouterOutput', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'TooManyRequestsException', ], ], 'idempotent' => true, ], ], 'shapes' => [ 'ServiceName' => [ 'type' => 'string', ], 'InternalServerErrorException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, 'error' => [ 'code' => 'InternalServerErrorException', 'httpStatusCode' => 500, 'fault' => true, ], ], 'HealthCheckThreshold' => [ 'type' => 'integer', 'min' => 2, 'max' => 10, ], 'DeleteMeshOutput' => [ 'type' => 'structure', 'members' => [ 'mesh' => [ 'shape' => 'MeshData', ], ], 'payload' => 'mesh', ], 'Long' => [ 'type' => 'long', 'box' => true, ], 'ForbiddenException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, 'error' => [ 'code' => 'ForbiddenException', 'httpStatusCode' => 403, 'senderFault' => true, ], ], 'UpdateVirtualRouterOutput' => [ 'type' => 'structure', 'members' => [ 'virtualRouter' => [ 'shape' => 'VirtualRouterData', ], ], 'payload' => 'virtualRouter', ], 'MeshStatusCode' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'DELETED', 'INACTIVE', ], ], 'PortNumber' => [ 'type' => 'integer', 'min' => 1, 'max' => 65535, ], 'WeightedTarget' => [ 'type' => 'structure', 'members' => [ 'virtualNode' => [ 'shape' => 'ResourceName', ], 'weight' => [ 'shape' => 'PercentInt', ], ], ], 'VirtualNodeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VirtualNodeRef', ], ], 'CreateRouteOutput' => [ 'type' => 'structure', 'members' => [ 'route' => [ 'shape' => 'RouteData', ], ], 'payload' => 'route', ], 'RouteList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RouteRef', ], ], 'DeleteVirtualNodeInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualNodeName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'virtualNodeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualNodeName', ], ], ], 'ListVirtualRoutersLimit' => [ 'type' => 'integer', 'box' => true, 'min' => 1, 'max' => 100, ], 'DnsServiceDiscovery' => [ 'type' => 'structure', 'members' => [ 'serviceName' => [ 'shape' => 'ServiceName', ], ], ], 'ConflictException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, 'error' => [ 'code' => 'ConflictException', 'httpStatusCode' => 409, 'senderFault' => true, ], ], 'HealthCheckIntervalMillis' => [ 'type' => 'long', 'box' => true, 'min' => 5000, 'max' => 300000, ], 'VirtualNodeRef' => [ 'type' => 'structure', 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'meshName' => [ 'shape' => 'ResourceName', ], 'virtualNodeName' => [ 'shape' => 'ResourceName', ], ], ], 'DescribeRouteOutput' => [ 'type' => 'structure', 'members' => [ 'route' => [ 'shape' => 'RouteData', ], ], 'payload' => 'route', ], 'ServiceDiscovery' => [ 'type' => 'structure', 'members' => [ 'dns' => [ 'shape' => 'DnsServiceDiscovery', ], ], ], 'MeshStatus' => [ 'type' => 'structure', 'members' => [ 'status' => [ 'shape' => 'MeshStatusCode', ], ], ], 'VirtualNodeData' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualNodeName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', ], 'metadata' => [ 'shape' => 'ResourceMetadata', ], 'spec' => [ 'shape' => 'VirtualNodeSpec', ], 'status' => [ 'shape' => 'VirtualNodeStatus', ], 'virtualNodeName' => [ 'shape' => 'ResourceName', ], ], ], 'VirtualNodeSpec' => [ 'type' => 'structure', 'members' => [ 'backends' => [ 'shape' => 'Backends', ], 'listeners' => [ 'shape' => 'Listeners', ], 'serviceDiscovery' => [ 'shape' => 'ServiceDiscovery', ], ], ], 'ServiceNames' => [ 'type' => 'list', 'member' => [ 'shape' => 'ServiceName', ], 'max' => 10, ], 'MeshRef' => [ 'type' => 'structure', 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'meshName' => [ 'shape' => 'ResourceName', ], ], ], 'DescribeVirtualRouterInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualRouterName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualRouterName', ], ], ], 'DescribeVirtualRouterOutput' => [ 'type' => 'structure', 'members' => [ 'virtualRouter' => [ 'shape' => 'VirtualRouterData', ], ], 'payload' => 'virtualRouter', ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, 'error' => [ 'code' => 'LimitExceededException', 'httpStatusCode' => 400, 'senderFault' => true, ], ], 'UpdateRouteOutput' => [ 'type' => 'structure', 'members' => [ 'route' => [ 'shape' => 'RouteData', ], ], 'payload' => 'route', ], 'HttpRouteAction' => [ 'type' => 'structure', 'members' => [ 'weightedTargets' => [ 'shape' => 'WeightedTargets', ], ], ], 'CreateVirtualRouterOutput' => [ 'type' => 'structure', 'members' => [ 'virtualRouter' => [ 'shape' => 'VirtualRouterData', ], ], 'payload' => 'virtualRouter', ], 'HealthCheckTimeoutMillis' => [ 'type' => 'long', 'box' => true, 'min' => 2000, 'max' => 60000, ], 'CreateVirtualRouterInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'spec', 'virtualRouterName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'spec' => [ 'shape' => 'VirtualRouterSpec', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', ], ], ], 'RouteStatus' => [ 'type' => 'structure', 'members' => [ 'status' => [ 'shape' => 'RouteStatusCode', ], ], ], 'ListMeshesInput' => [ 'type' => 'structure', 'members' => [ 'limit' => [ 'shape' => 'ListMeshesLimit', 'location' => 'querystring', 'locationName' => 'limit', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'VirtualRouterStatus' => [ 'type' => 'structure', 'members' => [ 'status' => [ 'shape' => 'VirtualRouterStatusCode', ], ], ], 'TooManyRequestsException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, 'error' => [ 'code' => 'TooManyRequestsException', 'httpStatusCode' => 429, 'senderFault' => true, ], ], 'ListMeshesOutput' => [ 'type' => 'structure', 'required' => [ 'meshes', ], 'members' => [ 'meshes' => [ 'shape' => 'MeshList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'DescribeVirtualNodeOutput' => [ 'type' => 'structure', 'members' => [ 'virtualNode' => [ 'shape' => 'VirtualNodeData', ], ], 'payload' => 'virtualNode', ], 'CreateMeshOutput' => [ 'type' => 'structure', 'members' => [ 'mesh' => [ 'shape' => 'MeshData', ], ], 'payload' => 'mesh', ], 'ResourceName' => [ 'type' => 'string', 'min' => 1, 'max' => 255, ], 'RouteData' => [ 'type' => 'structure', 'required' => [ 'meshName', 'routeName', 'virtualRouterName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', ], 'metadata' => [ 'shape' => 'ResourceMetadata', ], 'routeName' => [ 'shape' => 'ResourceName', ], 'spec' => [ 'shape' => 'RouteSpec', ], 'status' => [ 'shape' => 'RouteStatus', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', ], ], ], 'Arn' => [ 'type' => 'string', ], 'NotFoundException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, 'error' => [ 'code' => 'NotFoundException', 'httpStatusCode' => 404, 'senderFault' => true, ], ], 'UpdateVirtualNodeInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'spec', 'virtualNodeName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'spec' => [ 'shape' => 'VirtualNodeSpec', ], 'virtualNodeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualNodeName', ], ], ], 'DeleteRouteInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'routeName', 'virtualRouterName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'routeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'routeName', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualRouterName', ], ], ], 'ServiceUnavailableException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, 'error' => [ 'code' => 'ServiceUnavailableException', 'httpStatusCode' => 503, 'fault' => true, ], ], 'Listeners' => [ 'type' => 'list', 'member' => [ 'shape' => 'Listener', ], ], 'ListRoutesInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualRouterName', ], 'members' => [ 'limit' => [ 'shape' => 'ListRoutesLimit', 'location' => 'querystring', 'locationName' => 'limit', ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualRouterName', ], ], ], 'HttpRoute' => [ 'type' => 'structure', 'members' => [ 'action' => [ 'shape' => 'HttpRouteAction', ], 'match' => [ 'shape' => 'HttpRouteMatch', ], ], ], 'Timestamp' => [ 'type' => 'timestamp', ], 'ListRoutesOutput' => [ 'type' => 'structure', 'required' => [ 'routes', ], 'members' => [ 'nextToken' => [ 'shape' => 'String', ], 'routes' => [ 'shape' => 'RouteList', ], ], ], 'RouteSpec' => [ 'type' => 'structure', 'members' => [ 'httpRoute' => [ 'shape' => 'HttpRoute', ], ], ], 'DescribeVirtualNodeInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualNodeName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'virtualNodeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualNodeName', ], ], ], 'VirtualRouterRef' => [ 'type' => 'structure', 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'meshName' => [ 'shape' => 'ResourceName', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', ], ], ], 'VirtualRouterStatusCode' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'DELETED', 'INACTIVE', ], ], 'ListVirtualNodesOutput' => [ 'type' => 'structure', 'required' => [ 'virtualNodes', ], 'members' => [ 'nextToken' => [ 'shape' => 'String', ], 'virtualNodes' => [ 'shape' => 'VirtualNodeList', ], ], ], 'DeleteVirtualNodeOutput' => [ 'type' => 'structure', 'members' => [ 'virtualNode' => [ 'shape' => 'VirtualNodeData', ], ], 'payload' => 'virtualNode', ], 'UpdateVirtualRouterInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'spec', 'virtualRouterName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'spec' => [ 'shape' => 'VirtualRouterSpec', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualRouterName', ], ], ], 'ResourceInUseException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, 'error' => [ 'code' => 'ResourceInUseException', 'httpStatusCode' => 409, 'senderFault' => true, ], ], 'DescribeRouteInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'routeName', 'virtualRouterName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'routeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'routeName', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualRouterName', ], ], ], 'ListVirtualRoutersOutput' => [ 'type' => 'structure', 'required' => [ 'virtualRouters', ], 'members' => [ 'nextToken' => [ 'shape' => 'String', ], 'virtualRouters' => [ 'shape' => 'VirtualRouterList', ], ], ], 'CreateVirtualNodeOutput' => [ 'type' => 'structure', 'members' => [ 'virtualNode' => [ 'shape' => 'VirtualNodeData', ], ], 'payload' => 'virtualNode', ], 'DeleteVirtualRouterOutput' => [ 'type' => 'structure', 'members' => [ 'virtualRouter' => [ 'shape' => 'VirtualRouterData', ], ], 'payload' => 'virtualRouter', ], 'ListRoutesLimit' => [ 'type' => 'integer', 'box' => true, 'min' => 1, 'max' => 100, ], 'PortProtocol' => [ 'type' => 'string', 'enum' => [ 'http', 'tcp', ], ], 'MeshList' => [ 'type' => 'list', 'member' => [ 'shape' => 'MeshRef', ], ], 'ResourceMetadata' => [ 'type' => 'structure', 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'lastUpdatedAt' => [ 'shape' => 'Timestamp', ], 'uid' => [ 'shape' => 'String', ], 'version' => [ 'shape' => 'Long', ], ], ], 'CreateMeshInput' => [ 'type' => 'structure', 'required' => [ 'meshName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', ], ], ], 'PortMapping' => [ 'type' => 'structure', 'members' => [ 'port' => [ 'shape' => 'PortNumber', ], 'protocol' => [ 'shape' => 'PortProtocol', ], ], ], 'VirtualNodeStatusCode' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'DELETED', 'INACTIVE', ], ], 'DeleteVirtualRouterInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualRouterName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualRouterName', ], ], ], 'VirtualRouterSpec' => [ 'type' => 'structure', 'members' => [ 'serviceNames' => [ 'shape' => 'ServiceNames', ], ], ], 'UpdateRouteInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'routeName', 'spec', 'virtualRouterName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'routeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'routeName', ], 'spec' => [ 'shape' => 'RouteSpec', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualRouterName', ], ], ], 'PercentInt' => [ 'type' => 'integer', 'min' => 0, 'max' => 100, ], 'ListMeshesLimit' => [ 'type' => 'integer', 'box' => true, 'min' => 1, 'max' => 100, ], 'DescribeMeshInput' => [ 'type' => 'structure', 'required' => [ 'meshName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], ], ], 'DescribeMeshOutput' => [ 'type' => 'structure', 'members' => [ 'mesh' => [ 'shape' => 'MeshData', ], ], 'payload' => 'mesh', ], 'VirtualRouterData' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualRouterName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', ], 'metadata' => [ 'shape' => 'ResourceMetadata', ], 'spec' => [ 'shape' => 'VirtualRouterSpec', ], 'status' => [ 'shape' => 'VirtualRouterStatus', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', ], ], ], 'VirtualRouterList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VirtualRouterRef', ], ], 'Listener' => [ 'type' => 'structure', 'members' => [ 'healthCheck' => [ 'shape' => 'HealthCheckPolicy', ], 'portMapping' => [ 'shape' => 'PortMapping', ], ], ], 'String' => [ 'type' => 'string', ], 'HealthCheckPolicy' => [ 'type' => 'structure', 'required' => [ 'healthyThreshold', 'intervalMillis', 'protocol', 'timeoutMillis', 'unhealthyThreshold', ], 'members' => [ 'healthyThreshold' => [ 'shape' => 'HealthCheckThreshold', ], 'intervalMillis' => [ 'shape' => 'HealthCheckIntervalMillis', ], 'path' => [ 'shape' => 'String', ], 'port' => [ 'shape' => 'PortNumber', ], 'protocol' => [ 'shape' => 'PortProtocol', ], 'timeoutMillis' => [ 'shape' => 'HealthCheckTimeoutMillis', ], 'unhealthyThreshold' => [ 'shape' => 'HealthCheckThreshold', ], ], ], 'ListVirtualRoutersInput' => [ 'type' => 'structure', 'required' => [ 'meshName', ], 'members' => [ 'limit' => [ 'shape' => 'ListVirtualRoutersLimit', 'location' => 'querystring', 'locationName' => 'limit', ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'CreateVirtualNodeInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'spec', 'virtualNodeName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'spec' => [ 'shape' => 'VirtualNodeSpec', ], 'virtualNodeName' => [ 'shape' => 'ResourceName', ], ], ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'exception' => true, 'error' => [ 'code' => 'BadRequestException', 'httpStatusCode' => 400, 'senderFault' => true, ], ], 'MeshData' => [ 'type' => 'structure', 'required' => [ 'meshName', 'metadata', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', ], 'metadata' => [ 'shape' => 'ResourceMetadata', ], 'status' => [ 'shape' => 'MeshStatus', ], ], ], 'ListVirtualNodesLimit' => [ 'type' => 'integer', 'box' => true, 'min' => 1, 'max' => 100, ], 'WeightedTargets' => [ 'type' => 'list', 'member' => [ 'shape' => 'WeightedTarget', ], ], 'DeleteMeshInput' => [ 'type' => 'structure', 'required' => [ 'meshName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], ], ], 'HttpRouteMatch' => [ 'type' => 'structure', 'members' => [ 'prefix' => [ 'shape' => 'String', ], ], ], 'DeleteRouteOutput' => [ 'type' => 'structure', 'members' => [ 'route' => [ 'shape' => 'RouteData', ], ], 'payload' => 'route', ], 'Backends' => [ 'type' => 'list', 'member' => [ 'shape' => 'ServiceName', ], ], 'CreateRouteInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'routeName', 'spec', 'virtualRouterName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'routeName' => [ 'shape' => 'ResourceName', ], 'spec' => [ 'shape' => 'RouteSpec', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualRouterName', ], ], ], 'VirtualNodeStatus' => [ 'type' => 'structure', 'members' => [ 'status' => [ 'shape' => 'VirtualNodeStatusCode', ], ], ], 'ListVirtualNodesInput' => [ 'type' => 'structure', 'required' => [ 'meshName', ], 'members' => [ 'limit' => [ 'shape' => 'ListVirtualNodesLimit', 'location' => 'querystring', 'locationName' => 'limit', ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'RouteRef' => [ 'type' => 'structure', 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'meshName' => [ 'shape' => 'ResourceName', ], 'routeName' => [ 'shape' => 'ResourceName', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', ], ], ], 'RouteStatusCode' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'DELETED', 'INACTIVE', ], ], 'UpdateVirtualNodeOutput' => [ 'type' => 'structure', 'members' => [ 'virtualNode' => [ 'shape' => 'VirtualNodeData', ], ], 'payload' => 'virtualNode', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appmesh/2018-10-01/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>AWS App Mesh is a service mesh based on the Envoy proxy that makes it easy to monitor and control containerized microservices. App Mesh standardizes how your microservices communicate, giving you end-to-end visibility and helping to ensure high-availability for your applications.</p> <p>App Mesh gives you consistent visibility and network traffic controls for every microservice in an application. You can use App Mesh with Amazon ECS (using the Amazon EC2 launch type), Amazon EKS, and Kubernetes on AWS.</p> <note> <p>App Mesh supports containerized microservice applications that use service discovery naming for their components. To use App Mesh, you must have a containerized application running on Amazon EC2 instances, hosted in either Amazon ECS, Amazon EKS, or Kubernetes on AWS. For more information about service discovery on Amazon ECS, see <a href=\"http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html\">Service Discovery</a> in the <i>Amazon Elastic Container Service Developer Guide</i>. Kubernetes <code>kube-dns</code> is supported. For more information, see <a href=\"https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/\">DNS for Services and Pods</a> in the Kubernetes documentation.</p> </note>', 'operations' => [ 'CreateMesh' => '<p>Creates a new service mesh. A service mesh is a logical boundary for network traffic between the services that reside within it.</p> <p>After you create your service mesh, you can create virtual nodes, virtual routers, and routes to distribute traffic between the applications in your mesh.</p>', 'CreateRoute' => '<p>Creates a new route that is associated with a virtual router.</p> <p>You can use the <code>prefix</code> parameter in your route specification for path-based routing of requests. For example, if your virtual router service name is <code>my-service.local</code>, and you want the route to match requests to <code>my-service.local/metrics</code>, then your prefix should be <code>/metrics</code>.</p> <p>If your route matches a request, you can distribute traffic to one or more target virtual nodes with relative weighting.</p>', 'CreateVirtualNode' => '<p>Creates a new virtual node within a service mesh.</p> <p>A virtual node acts as logical pointer to a particular task group, such as an Amazon ECS service or a Kubernetes deployment. When you create a virtual node, you must specify the DNS service discovery name for your task group.</p> <p>Any inbound traffic that your virtual node expects should be specified as a <code>listener</code>. Any outbound traffic that your virtual node expects to reach should be specified as a <code>backend</code>.</p> <p>The response metadata for your new virtual node contains the <code>arn</code> that is associated with the virtual node. Set this value (either the full ARN or the truncated resource name, for example, <code>mesh/default/virtualNode/simpleapp</code>, as the <code>APPMESH_VIRTUAL_NODE_NAME</code> environment variable for your task group\\'s Envoy proxy container in your task definition or pod spec. This is then mapped to the <code>node.id</code> and <code>node.cluster</code> Envoy parameters.</p> <note> <p>If you require your Envoy stats or tracing to use a different name, you can override the <code>node.cluster</code> value that is set by <code>APPMESH_VIRTUAL_NODE_NAME</code> with the <code>APPMESH_VIRTUAL_NODE_CLUSTER</code> environment variable.</p> </note>', 'CreateVirtualRouter' => '<p>Creates a new virtual router within a service mesh.</p> <p>Virtual routers handle traffic for one or more service names within your mesh. After you create your virtual router, create and associate routes for your virtual router that direct incoming requests to different virtual nodes.</p>', 'DeleteMesh' => '<p>Deletes an existing service mesh.</p> <p>You must delete all resources (routes, virtual routers, virtual nodes) in the service mesh before you can delete the mesh itself.</p>', 'DeleteRoute' => '<p>Deletes an existing route.</p>', 'DeleteVirtualNode' => '<p>Deletes an existing virtual node.</p>', 'DeleteVirtualRouter' => '<p>Deletes an existing virtual router.</p> <p>You must delete any routes associated with the virtual router before you can delete the router itself.</p>', 'DescribeMesh' => '<p>Describes an existing service mesh.</p>', 'DescribeRoute' => '<p>Describes an existing route.</p>', 'DescribeVirtualNode' => '<p>Describes an existing virtual node.</p>', 'DescribeVirtualRouter' => '<p>Describes an existing virtual router.</p>', 'ListMeshes' => '<p>Returns a list of existing service meshes.</p>', 'ListRoutes' => '<p>Returns a list of existing routes in a service mesh.</p>', 'ListVirtualNodes' => '<p>Returns a list of existing virtual nodes.</p>', 'ListVirtualRouters' => '<p>Returns a list of existing virtual routers in a service mesh.</p>', 'UpdateRoute' => '<p>Updates an existing route for a specified service mesh and virtual router.</p>', 'UpdateVirtualNode' => '<p>Updates an existing virtual node in a specified service mesh.</p>', 'UpdateVirtualRouter' => '<p>Updates an existing virtual router in a specified service mesh.</p>', ], 'shapes' => [ 'Arn' => [ 'base' => NULL, 'refs' => [], ], 'Backends' => [ 'base' => NULL, 'refs' => [ 'Backends$member' => NULL, ], ], 'BadRequestException' => [ 'base' => '<p>The request syntax was malformed. Check your request syntax and try again.</p>', 'refs' => [], ], 'ConflictException' => [ 'base' => '<p>The request contains a client token that was used for a previous update resource call with different specifications. Try the request again with a new client token.</p>', 'refs' => [], ], 'CreateMeshInput' => [ 'base' => '', 'refs' => [ 'CreateMeshInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of therequest. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'CreateMeshInput$meshName' => '<p>The name to use for the service mesh.</p>', ], ], 'CreateMeshOutput' => [ 'base' => '', 'refs' => [ 'CreateMeshOutput$mesh' => '<p>The full description of your service mesh following the create call.</p>', ], ], 'CreateRouteInput' => [ 'base' => '', 'refs' => [ 'CreateRouteInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of therequest. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'CreateRouteInput$meshName' => '<p>The name of the service mesh in which to create the route.</p>', 'CreateRouteInput$routeName' => '<p>The name to use for the route.</p>', 'CreateRouteInput$spec' => '<p>The route specification to apply.</p>', 'CreateRouteInput$virtualRouterName' => '<p>The name of the virtual router in which to create the route.</p>', ], ], 'CreateRouteOutput' => [ 'base' => '', 'refs' => [ 'CreateRouteOutput$route' => '<p>The full description of your mesh following the create call.</p>', ], ], 'CreateVirtualNodeInput' => [ 'base' => '', 'refs' => [ 'CreateVirtualNodeInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of therequest. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'CreateVirtualNodeInput$meshName' => '<p>The name of the service mesh in which to create the virtual node.</p>', 'CreateVirtualNodeInput$spec' => '<p>The virtual node specification to apply.</p>', 'CreateVirtualNodeInput$virtualNodeName' => '<p>The name to use for the virtual node.</p>', ], ], 'CreateVirtualNodeOutput' => [ 'base' => '', 'refs' => [ 'CreateVirtualNodeOutput$virtualNode' => '<p>The full description of your virtual node following the create call.</p>', ], ], 'CreateVirtualRouterInput' => [ 'base' => '', 'refs' => [ 'CreateVirtualRouterInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of therequest. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'CreateVirtualRouterInput$meshName' => '<p>The name of the service mesh in which to create the virtual router.</p>', 'CreateVirtualRouterInput$spec' => '<p>The virtual router specification to apply.</p>', 'CreateVirtualRouterInput$virtualRouterName' => '<p>The name to use for the virtual router.</p>', ], ], 'CreateVirtualRouterOutput' => [ 'base' => '', 'refs' => [ 'CreateVirtualRouterOutput$virtualRouter' => '<p>The full description of your virtual router following the create call.</p>', ], ], 'DeleteMeshInput' => [ 'base' => '', 'refs' => [ 'DeleteMeshInput$meshName' => '<p>The name of the service mesh to delete.</p>', ], ], 'DeleteMeshOutput' => [ 'base' => '', 'refs' => [ 'DeleteMeshOutput$mesh' => '<p>The service mesh that was deleted.</p>', ], ], 'DeleteRouteInput' => [ 'base' => '', 'refs' => [ 'DeleteRouteInput$meshName' => '<p>The name of the service mesh in which to delete the route.</p>', 'DeleteRouteInput$routeName' => '<p>The name of the route to delete.</p>', 'DeleteRouteInput$virtualRouterName' => '<p>The name of the virtual router in which to delete the route.</p>', ], ], 'DeleteRouteOutput' => [ 'base' => '', 'refs' => [ 'DeleteRouteOutput$route' => '<p>The route that was deleted.</p>', ], ], 'DeleteVirtualNodeInput' => [ 'base' => '', 'refs' => [ 'DeleteVirtualNodeInput$meshName' => '<p>The name of the service mesh in which to delete the virtual node.</p>', 'DeleteVirtualNodeInput$virtualNodeName' => '<p>The name of the virtual node to delete.</p>', ], ], 'DeleteVirtualNodeOutput' => [ 'base' => '', 'refs' => [ 'DeleteVirtualNodeOutput$virtualNode' => '<p>The virtual node that was deleted.</p>', ], ], 'DeleteVirtualRouterInput' => [ 'base' => '', 'refs' => [ 'DeleteVirtualRouterInput$meshName' => '<p>The name of the service mesh in which to delete the virtual router.</p>', 'DeleteVirtualRouterInput$virtualRouterName' => '<p>The name of the virtual router to delete.</p>', ], ], 'DeleteVirtualRouterOutput' => [ 'base' => '', 'refs' => [ 'DeleteVirtualRouterOutput$virtualRouter' => '<p>The virtual router that was deleted.</p>', ], ], 'DescribeMeshInput' => [ 'base' => '', 'refs' => [ 'DescribeMeshInput$meshName' => '<p>The name of the service mesh to describe.</p>', ], ], 'DescribeMeshOutput' => [ 'base' => '', 'refs' => [ 'DescribeMeshOutput$mesh' => '<p>The full description of your service mesh.</p>', ], ], 'DescribeRouteInput' => [ 'base' => '', 'refs' => [ 'DescribeRouteInput$meshName' => '<p>The name of the service mesh in which the route resides.</p>', 'DescribeRouteInput$routeName' => '<p>The name of the route to describe.</p>', 'DescribeRouteInput$virtualRouterName' => '<p>The name of the virtual router with which the route is associated.</p>', ], ], 'DescribeRouteOutput' => [ 'base' => '', 'refs' => [ 'DescribeRouteOutput$route' => '<p>The full description of your route.</p>', ], ], 'DescribeVirtualNodeInput' => [ 'base' => '', 'refs' => [ 'DescribeVirtualNodeInput$meshName' => '<p>The name of the service mesh in which the virtual node resides.</p>', 'DescribeVirtualNodeInput$virtualNodeName' => '<p>The name of the virtual node to describe.</p>', ], ], 'DescribeVirtualNodeOutput' => [ 'base' => '', 'refs' => [ 'DescribeVirtualNodeOutput$virtualNode' => '<p>The full description of your virtual node.</p>', ], ], 'DescribeVirtualRouterInput' => [ 'base' => '', 'refs' => [ 'DescribeVirtualRouterInput$meshName' => '<p>The name of the service mesh in which the virtual router resides.</p>', 'DescribeVirtualRouterInput$virtualRouterName' => '<p>The name of the virtual router to describe.</p>', ], ], 'DescribeVirtualRouterOutput' => [ 'base' => '', 'refs' => [ 'DescribeVirtualRouterOutput$virtualRouter' => '<p>The full description of your virtual router.</p>', ], ], 'DnsServiceDiscovery' => [ 'base' => '<p>The DNS service discovery information for your virtual node.</p>', 'refs' => [ 'DnsServiceDiscovery$serviceName' => '<p>The DNS service name for your virtual node.</p>', ], ], 'ForbiddenException' => [ 'base' => '<p>You do not have permissions to perform this action.</p>', 'refs' => [], ], 'HealthCheckIntervalMillis' => [ 'base' => NULL, 'refs' => [], ], 'HealthCheckPolicy' => [ 'base' => '<p>An object representing the health check policy for a virtual node\\'s listener.</p>', 'refs' => [ 'HealthCheckPolicy$healthyThreshold' => '<p>The number of consecutive successful health checks that must occur before declaring listener healthy.</p>', 'HealthCheckPolicy$intervalMillis' => '<p>The time period in milliseconds between each health check execution.</p>', 'HealthCheckPolicy$path' => '<p>The destination path for the health check request. This is only required if the specified protocol is HTTP; if the protocol is TCP, then this parameter is ignored.</p>', 'HealthCheckPolicy$port' => '<p>The destination port for the health check request. This port must match the port defined in the <a>PortMapping</a> for the listener.</p>', 'HealthCheckPolicy$protocol' => '<p>The protocol for the health check request.</p>', 'HealthCheckPolicy$timeoutMillis' => '<p>The amount of time to wait when receiving a response from the health check, in milliseconds.</p>', 'HealthCheckPolicy$unhealthyThreshold' => '<p>The number of consecutive failed health checks that must occur before declaring a virtual node unhealthy. </p>', ], ], 'HealthCheckThreshold' => [ 'base' => NULL, 'refs' => [], ], 'HealthCheckTimeoutMillis' => [ 'base' => NULL, 'refs' => [], ], 'HttpRoute' => [ 'base' => '<p>An object representing the HTTP routing specification for a route.</p>', 'refs' => [ 'HttpRoute$action' => '<p>The action to take if a match is determined.</p>', 'HttpRoute$match' => '<p>The criteria for determining an HTTP request match.</p>', ], ], 'HttpRouteAction' => [ 'base' => '<p>An object representing the traffic distribution requirements for matched HTTP requests.</p>', 'refs' => [ 'HttpRouteAction$weightedTargets' => '<p>The targets that traffic is routed to when a request matches the route. You can specify one or more targets and their relative weights with which to distribute traffic.</p>', ], ], 'HttpRouteMatch' => [ 'base' => '<p>An object representing the requirements for a route to match HTTP requests for a virtual router.</p>', 'refs' => [ 'HttpRouteMatch$prefix' => '<p>Specifies the path with which to match requests. This parameter must always start with <code>/</code>, which by itself matches all requests to the virtual router service name. You can also match for path-based routing of requests. For example, if your virtual router service name is <code>my-service.local</code>, and you want the route to match requests to <code>my-service.local/metrics</code>, then your prefix should be <code>/metrics</code>.</p>', ], ], 'InternalServerErrorException' => [ 'base' => '<p>The request processing has failed because of an unknown error, exception, or failure.</p>', 'refs' => [], ], 'LimitExceededException' => [ 'base' => '<p>You have exceeded a service limit for your account. For more information, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/service_limits.html\">Service Limits</a> in the <i>AWS App Mesh User Guide</i>.</p>', 'refs' => [], ], 'ListMeshesInput' => [ 'base' => '', 'refs' => [ 'ListMeshesInput$limit' => '<p>The maximum number of mesh results returned by <code>ListMeshes</code> in paginated output. When this parameter is used, <code>ListMeshes</code> only returns <code>limit</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListMeshes</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter is not used, then <code>ListMeshes</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', 'ListMeshesInput$nextToken' => '<p>The <code>nextToken</code> value returned from a previous paginated <code>ListMeshes</code> request where <code>limit</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>', ], ], 'ListMeshesLimit' => [ 'base' => NULL, 'refs' => [], ], 'ListMeshesOutput' => [ 'base' => '', 'refs' => [ 'ListMeshesOutput$meshes' => '<p>The list of existing service meshes.</p>', 'ListMeshesOutput$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>ListMeshes</code> request. When the results of a <code>ListMeshes</code> request exceed <code>limit</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', ], ], 'ListRoutesInput' => [ 'base' => '', 'refs' => [ 'ListRoutesInput$limit' => '<p>The maximum number of mesh results returned by <code>ListRoutes</code> in paginated output. When this parameter is used, <code>ListRoutes</code> only returns <code>limit</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListRoutes</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter is not used, then <code>ListRoutes</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', 'ListRoutesInput$meshName' => '<p>The name of the service mesh in which to list routes.</p>', 'ListRoutesInput$nextToken' => '<p>The <code>nextToken</code> value returned from a previous paginated <code>ListRoutes</code> request where <code>limit</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p>', 'ListRoutesInput$virtualRouterName' => '<p>The name of the virtual router in which to list routes.</p>', ], ], 'ListRoutesLimit' => [ 'base' => NULL, 'refs' => [], ], 'ListRoutesOutput' => [ 'base' => '', 'refs' => [ 'ListRoutesOutput$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>ListRoutes</code> request. When the results of a <code>ListRoutes</code> request exceed <code>limit</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', 'ListRoutesOutput$routes' => '<p>The list of existing routes for the specified service mesh and virtual router.</p>', ], ], 'ListVirtualNodesInput' => [ 'base' => '', 'refs' => [ 'ListVirtualNodesInput$limit' => '<p>The maximum number of mesh results returned by <code>ListVirtualNodes</code> in paginated output. When this parameter is used, <code>ListVirtualNodes</code> only returns <code>limit</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListVirtualNodes</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter is not used, then <code>ListVirtualNodes</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', 'ListVirtualNodesInput$meshName' => '<p>The name of the service mesh in which to list virtual nodes.</p>', 'ListVirtualNodesInput$nextToken' => '<p>The <code>nextToken</code> value returned from a previous paginated <code>ListVirtualNodes</code> request where <code>limit</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p>', ], ], 'ListVirtualNodesLimit' => [ 'base' => NULL, 'refs' => [], ], 'ListVirtualNodesOutput' => [ 'base' => '', 'refs' => [ 'ListVirtualNodesOutput$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>ListVirtualNodes</code> request. When the results of a <code>ListVirtualNodes</code> request exceed <code>limit</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', 'ListVirtualNodesOutput$virtualNodes' => '<p>The list of existing virtual nodes for the specified service mesh.</p>', ], ], 'ListVirtualRoutersInput' => [ 'base' => '', 'refs' => [ 'ListVirtualRoutersInput$limit' => '<p>The maximum number of mesh results returned by <code>ListVirtualRouters</code> in paginated output. When this parameter is used, <code>ListVirtualRouters</code> only returns <code>limit</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListVirtualRouters</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter is not used, then <code>ListVirtualRouters</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', 'ListVirtualRoutersInput$meshName' => '<p>The name of the service mesh in which to list virtual routers.</p>', 'ListVirtualRoutersInput$nextToken' => '<p>The <code>nextToken</code> value returned from a previous paginated <code>ListVirtualRouters</code> request where <code>limit</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p>', ], ], 'ListVirtualRoutersLimit' => [ 'base' => NULL, 'refs' => [], ], 'ListVirtualRoutersOutput' => [ 'base' => '', 'refs' => [ 'ListVirtualRoutersOutput$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>ListVirtualRouters</code> request. When the results of a <code>ListVirtualRouters</code> request exceed <code>limit</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', 'ListVirtualRoutersOutput$virtualRouters' => '<p>The list of existing virtual routers for the specified service mesh.</p>', ], ], 'Listener' => [ 'base' => '<p>An object representing a listener for a virtual node.</p>', 'refs' => [ 'Listener$healthCheck' => '<p>The health check information for the listener.</p>', 'Listener$portMapping' => '<p>The port mapping information for the listener.</p>', ], ], 'Listeners' => [ 'base' => NULL, 'refs' => [ 'Listeners$member' => NULL, ], ], 'Long' => [ 'base' => NULL, 'refs' => [], ], 'MeshData' => [ 'base' => '<p>An object representing a service mesh returned by a describe operation.</p>', 'refs' => [ 'MeshData$meshName' => '<p>The name of the service mesh.</p>', 'MeshData$metadata' => '<p>The associated metadata for the service mesh.</p>', 'MeshData$status' => '<p>The status of the service mesh.</p>', ], ], 'MeshList' => [ 'base' => NULL, 'refs' => [ 'MeshList$member' => NULL, ], ], 'MeshRef' => [ 'base' => '<p>An object representing a service mesh returned by a list operation.</p>', 'refs' => [ 'MeshRef$arn' => '<p>The full Amazon Resource Name (ARN) of the service mesh.</p>', 'MeshRef$meshName' => '<p>The name of the service mesh.</p>', ], ], 'MeshStatus' => [ 'base' => '<p>An object representing the status of a service mesh.</p>', 'refs' => [ 'MeshStatus$status' => '<p>The current mesh status.</p>', ], ], 'MeshStatusCode' => [ 'base' => NULL, 'refs' => [], ], 'NotFoundException' => [ 'base' => '<p>The specified resource does not exist. Check your request syntax and try again.</p>', 'refs' => [], ], 'PercentInt' => [ 'base' => NULL, 'refs' => [], ], 'PortMapping' => [ 'base' => '<p>An object representing a virtual node listener port mapping.</p>', 'refs' => [ 'PortMapping$port' => '<p>The port used for the port mapping.</p>', 'PortMapping$protocol' => '<p>The protocol used for the port mapping.</p>', ], ], 'PortNumber' => [ 'base' => NULL, 'refs' => [], ], 'PortProtocol' => [ 'base' => NULL, 'refs' => [], ], 'ResourceInUseException' => [ 'base' => '<p>You cannot delete the specified resource because it is in use or required by another resource.</p>', 'refs' => [], ], 'ResourceMetadata' => [ 'base' => '<p>An object representing metadata for a resource.</p>', 'refs' => [ 'ResourceMetadata$arn' => '<p>The full Amazon Resource Name (ARN) for the resource.</p> <note> <p>After you create a virtual node, set this value (either the full ARN or the truncated resource name, for example, <code>mesh/default/virtualNode/simpleapp</code>, as the <code>APPMESH_VIRTUAL_NODE_NAME</code> environment variable for your task group\\'s Envoy proxy container in your task definition or pod spec. This is then mapped to the <code>node.id</code> and <code>node.cluster</code> Envoy parameters.</p> <p>If you require your Envoy stats or tracing to use a different name, you can override the <code>node.cluster</code> value that is set by <code>APPMESH_VIRTUAL_NODE_NAME</code> with the <code>APPMESH_VIRTUAL_NODE_CLUSTER</code> environment variable.</p> </note>', 'ResourceMetadata$createdAt' => '<p>The Unix epoch timestamp in seconds for when the resource was created.</p>', 'ResourceMetadata$lastUpdatedAt' => '<p>The Unix epoch timestamp in seconds for when the resource was last updated.</p>', 'ResourceMetadata$uid' => '<p>The unique identifier for the resource.</p>', 'ResourceMetadata$version' => '<p>The version of the resource. Resources are created at version 1, and this version is incremented each time they are updated.</p>', ], ], 'ResourceName' => [ 'base' => NULL, 'refs' => [], ], 'RouteData' => [ 'base' => '<p>An object representing a route returned by a describe operation.</p>', 'refs' => [ 'RouteData$meshName' => '<p>The name of the service mesh in which the route resides.</p>', 'RouteData$metadata' => '<p>The associated metadata for the route.</p>', 'RouteData$routeName' => '<p>The name of the route.</p>', 'RouteData$spec' => '<p>The specifications of the route.</p>', 'RouteData$status' => '<p>The status of the route.</p>', 'RouteData$virtualRouterName' => '<p>The virtual router with which the route is associated.</p>', ], ], 'RouteList' => [ 'base' => NULL, 'refs' => [ 'RouteList$member' => NULL, ], ], 'RouteRef' => [ 'base' => '<p>An object representing a route returned by a list operation.</p>', 'refs' => [ 'RouteRef$arn' => '<p>The full Amazon Resource Name (ARN) for the route.</p>', 'RouteRef$meshName' => '<p>The name of the service mesh in which the route resides.</p>', 'RouteRef$routeName' => '<p>The name of the route.</p>', 'RouteRef$virtualRouterName' => '<p>The virtual router with which the route is associated.</p>', ], ], 'RouteSpec' => [ 'base' => '<p>An object representing the specification of a route.</p>', 'refs' => [ 'RouteSpec$httpRoute' => '<p>The HTTP routing information for the route.</p>', ], ], 'RouteStatus' => [ 'base' => '<p>An object representing the current status of a route.</p>', 'refs' => [ 'RouteStatus$status' => '<p>The current status for the route.</p>', ], ], 'RouteStatusCode' => [ 'base' => NULL, 'refs' => [], ], 'ServiceDiscovery' => [ 'base' => '<p>An object representing the service discovery information for a virtual node.</p>', 'refs' => [ 'ServiceDiscovery$dns' => '<p>Specifies the DNS service name for the virtual node.</p>', ], ], 'ServiceName' => [ 'base' => NULL, 'refs' => [], ], 'ServiceNames' => [ 'base' => NULL, 'refs' => [ 'ServiceNames$member' => NULL, ], ], 'ServiceUnavailableException' => [ 'base' => '<p>The request has failed due to a temporary failure of the service.</p>', 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [], ], 'TooManyRequestsException' => [ 'base' => '<p>The maximum request rate permitted by the App Mesh APIs has been exceeded for your account. For best results, use an increasing or variable sleep interval between requests.</p>', 'refs' => [], ], 'UpdateRouteInput' => [ 'base' => '', 'refs' => [ 'UpdateRouteInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of therequest. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'UpdateRouteInput$meshName' => '<p>The name of the service mesh in which the route resides.</p>', 'UpdateRouteInput$routeName' => '<p>The name of the route to update.</p>', 'UpdateRouteInput$spec' => '<p>The new route specification to apply. This overwrites the existing data.</p>', 'UpdateRouteInput$virtualRouterName' => '<p>The name of the virtual router with which the route is associated.</p>', ], ], 'UpdateRouteOutput' => [ 'base' => '', 'refs' => [ 'UpdateRouteOutput$route' => '<p>A full description of the route that was updated.</p>', ], ], 'UpdateVirtualNodeInput' => [ 'base' => '', 'refs' => [ 'UpdateVirtualNodeInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of therequest. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'UpdateVirtualNodeInput$meshName' => '<p>The name of the service mesh in which the virtual node resides.</p>', 'UpdateVirtualNodeInput$spec' => '<p>The new virtual node specification to apply. This overwrites the existing data.</p>', 'UpdateVirtualNodeInput$virtualNodeName' => '<p>The name of the virtual node to update.</p>', ], ], 'UpdateVirtualNodeOutput' => [ 'base' => '', 'refs' => [ 'UpdateVirtualNodeOutput$virtualNode' => '<p>A full description of the virtual node that was updated.</p>', ], ], 'UpdateVirtualRouterInput' => [ 'base' => '', 'refs' => [ 'UpdateVirtualRouterInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of therequest. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'UpdateVirtualRouterInput$meshName' => '<p>The name of the service mesh in which the virtual router resides.</p>', 'UpdateVirtualRouterInput$spec' => '<p>The new virtual router specification to apply. This overwrites the existing data.</p>', 'UpdateVirtualRouterInput$virtualRouterName' => '<p>The name of the virtual router to update.</p>', ], ], 'UpdateVirtualRouterOutput' => [ 'base' => '', 'refs' => [ 'UpdateVirtualRouterOutput$virtualRouter' => '<p>A full description of the virtual router that was updated.</p>', ], ], 'VirtualNodeData' => [ 'base' => '<p>An object representing a virtual node returned by a describe operation.</p>', 'refs' => [ 'VirtualNodeData$meshName' => '<p>The name of the service mesh in which the virtual node resides.</p>', 'VirtualNodeData$metadata' => '<p>The associated metadata for the virtual node.</p>', 'VirtualNodeData$spec' => '<p>The specifications of the virtual node.</p>', 'VirtualNodeData$status' => '<p>The current status for the virtual node.</p>', 'VirtualNodeData$virtualNodeName' => '<p>The name of the virtual node.</p>', ], ], 'VirtualNodeList' => [ 'base' => NULL, 'refs' => [ 'VirtualNodeList$member' => NULL, ], ], 'VirtualNodeRef' => [ 'base' => '<p>An object representing a virtual node returned by a list operation.</p>', 'refs' => [ 'VirtualNodeRef$arn' => '<p>The full Amazon Resource Name (ARN) for the virtual node.</p>', 'VirtualNodeRef$meshName' => '<p>The name of the service mesh in which the virtual node resides.</p>', 'VirtualNodeRef$virtualNodeName' => '<p>The name of the virtual node.</p>', ], ], 'VirtualNodeSpec' => [ 'base' => '<p>An object representing the specification of a virtual node.</p>', 'refs' => [ 'VirtualNodeSpec$backends' => '<p>The backends to which the virtual node is expected to send outbound traffic.</p>', 'VirtualNodeSpec$listeners' => '<p>The listeners from which the virtual node is expected to receive inbound traffic.</p>', 'VirtualNodeSpec$serviceDiscovery' => '<p>The service discovery information for the virtual node.</p>', ], ], 'VirtualNodeStatus' => [ 'base' => '<p>An object representing the current status of the virtual node.</p>', 'refs' => [ 'VirtualNodeStatus$status' => '<p>The current status of the virtual node.</p>', ], ], 'VirtualNodeStatusCode' => [ 'base' => NULL, 'refs' => [], ], 'VirtualRouterData' => [ 'base' => '<p>An object representing a virtual router returned by a describe operation.</p>', 'refs' => [ 'VirtualRouterData$meshName' => '<p>The name of the service mesh in which the virtual router resides.</p>', 'VirtualRouterData$metadata' => '<p>The associated metadata for the virtual router.</p>', 'VirtualRouterData$spec' => '<p>The specifications of the virtual router.</p>', 'VirtualRouterData$status' => '<p>The current status of the virtual router.</p>', 'VirtualRouterData$virtualRouterName' => '<p>The name of the virtual router.</p>', ], ], 'VirtualRouterList' => [ 'base' => NULL, 'refs' => [ 'VirtualRouterList$member' => NULL, ], ], 'VirtualRouterRef' => [ 'base' => '<p>An object representing a virtual router returned by a list operation.</p>', 'refs' => [ 'VirtualRouterRef$arn' => '<p>The full Amazon Resource Name (ARN) for the virtual router.</p>', 'VirtualRouterRef$meshName' => '<p>The name of the service mesh in which the virtual router resides.</p>', 'VirtualRouterRef$virtualRouterName' => '<p>The name of the virtual router.</p>', ], ], 'VirtualRouterSpec' => [ 'base' => '<p>An object representing the specification of a virtual router.</p>', 'refs' => [ 'VirtualRouterSpec$serviceNames' => '<p>The service mesh service names to associate with the virtual router.</p>', ], ], 'VirtualRouterStatus' => [ 'base' => '<p>An object representing the status of a virtual router. </p>', 'refs' => [ 'VirtualRouterStatus$status' => '<p>The current status of the virtual router.</p>', ], ], 'VirtualRouterStatusCode' => [ 'base' => NULL, 'refs' => [], ], 'WeightedTarget' => [ 'base' => '<p>An object representing a target and its relative weight. Traffic is distributed across targets according to their relative weight. For example, a weighted target with a relative weight of 50 receives five times as much traffic as one with a relative weight of 10.</p>', 'refs' => [ 'WeightedTarget$virtualNode' => '<p>The virtual node to associate with the weighted target.</p>', 'WeightedTarget$weight' => '<p>The relative weight of the weighted target.</p>', ], ], 'WeightedTargets' => [ 'base' => NULL, 'refs' => [ 'WeightedTargets$member' => NULL, ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appmesh/2018-10-01/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], [ 'fn' => 'parseURL', 'argv' => [ [ 'ref' => 'Endpoint', ], ], 'assign' => 'url', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appmesh-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appmesh-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appmesh.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appmesh.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appmesh/2018-10-01/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-south-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-south-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-south-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-south-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ca-central-1.api.aws', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ca-central-1.api.aws', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-central-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-central-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.af-south-1.api.aws', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.af-south-1.api.aws', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-north-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-north-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-west-3.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-west-3.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-northeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-northeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-northeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-northeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-northeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-northeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.me-south-1.api.aws', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.me-south-1.api.aws', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.sa-east-1.api.aws', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.sa-east-1.api.aws', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-east-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-east-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-southeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-southeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-southeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-southeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-southeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-southeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appmesh/2018-10-01/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appmesh/2018-10-01/paginators-1.json\nreturn [ 'pagination' => [ 'ListMeshes' => [ 'input_token' => 'nextToken', 'limit_key' => 'limit', 'output_token' => 'nextToken', 'result_key' => 'meshes', ], 'ListRoutes' => [ 'input_token' => 'nextToken', 'limit_key' => 'limit', 'output_token' => 'nextToken', 'result_key' => 'routes', ], 'ListVirtualNodes' => [ 'input_token' => 'nextToken', 'limit_key' => 'limit', 'output_token' => 'nextToken', 'result_key' => 'virtualNodes', ], 'ListVirtualRouters' => [ 'input_token' => 'nextToken', 'limit_key' => 'limit', 'output_token' => 'nextToken', 'result_key' => 'virtualRouters', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appmesh/2019-01-25/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2019-01-25', 'endpointPrefix' => 'appmesh', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'AWS App Mesh', 'serviceId' => 'App Mesh', 'signatureVersion' => 'v4', 'signingName' => 'appmesh', 'uid' => 'appmesh-2019-01-25', ], 'operations' => [ 'CreateGatewayRoute' => [ 'name' => 'CreateGatewayRoute', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateGatewayRouteInput', ], 'output' => [ 'shape' => 'CreateGatewayRouteOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], 'CreateMesh' => [ 'name' => 'CreateMesh', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v20190125/meshes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateMeshInput', ], 'output' => [ 'shape' => 'CreateMeshOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], 'CreateRoute' => [ 'name' => 'CreateRoute', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateRouteInput', ], 'output' => [ 'shape' => 'CreateRouteOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], 'CreateVirtualGateway' => [ 'name' => 'CreateVirtualGateway', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v20190125/meshes/{meshName}/virtualGateways', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateVirtualGatewayInput', ], 'output' => [ 'shape' => 'CreateVirtualGatewayOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], 'CreateVirtualNode' => [ 'name' => 'CreateVirtualNode', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v20190125/meshes/{meshName}/virtualNodes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateVirtualNodeInput', ], 'output' => [ 'shape' => 'CreateVirtualNodeOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], 'CreateVirtualRouter' => [ 'name' => 'CreateVirtualRouter', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v20190125/meshes/{meshName}/virtualRouters', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateVirtualRouterInput', ], 'output' => [ 'shape' => 'CreateVirtualRouterOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], 'CreateVirtualService' => [ 'name' => 'CreateVirtualService', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v20190125/meshes/{meshName}/virtualServices', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateVirtualServiceInput', ], 'output' => [ 'shape' => 'CreateVirtualServiceOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], 'DeleteGatewayRoute' => [ 'name' => 'DeleteGatewayRoute', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes/{gatewayRouteName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteGatewayRouteInput', ], 'output' => [ 'shape' => 'DeleteGatewayRouteOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], 'idempotent' => true, ], 'DeleteMesh' => [ 'name' => 'DeleteMesh', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v20190125/meshes/{meshName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteMeshInput', ], 'output' => [ 'shape' => 'DeleteMeshOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], 'idempotent' => true, ], 'DeleteRoute' => [ 'name' => 'DeleteRoute', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes/{routeName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteRouteInput', ], 'output' => [ 'shape' => 'DeleteRouteOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], 'idempotent' => true, ], 'DeleteVirtualGateway' => [ 'name' => 'DeleteVirtualGateway', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v20190125/meshes/{meshName}/virtualGateways/{virtualGatewayName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteVirtualGatewayInput', ], 'output' => [ 'shape' => 'DeleteVirtualGatewayOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], 'idempotent' => true, ], 'DeleteVirtualNode' => [ 'name' => 'DeleteVirtualNode', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v20190125/meshes/{meshName}/virtualNodes/{virtualNodeName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteVirtualNodeInput', ], 'output' => [ 'shape' => 'DeleteVirtualNodeOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], 'idempotent' => true, ], 'DeleteVirtualRouter' => [ 'name' => 'DeleteVirtualRouter', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v20190125/meshes/{meshName}/virtualRouters/{virtualRouterName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteVirtualRouterInput', ], 'output' => [ 'shape' => 'DeleteVirtualRouterOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], 'idempotent' => true, ], 'DeleteVirtualService' => [ 'name' => 'DeleteVirtualService', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v20190125/meshes/{meshName}/virtualServices/{virtualServiceName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteVirtualServiceInput', ], 'output' => [ 'shape' => 'DeleteVirtualServiceOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], 'idempotent' => true, ], 'DescribeGatewayRoute' => [ 'name' => 'DescribeGatewayRoute', 'http' => [ 'method' => 'GET', 'requestUri' => '/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes/{gatewayRouteName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeGatewayRouteInput', ], 'output' => [ 'shape' => 'DescribeGatewayRouteOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'DescribeMesh' => [ 'name' => 'DescribeMesh', 'http' => [ 'method' => 'GET', 'requestUri' => '/v20190125/meshes/{meshName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeMeshInput', ], 'output' => [ 'shape' => 'DescribeMeshOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'DescribeRoute' => [ 'name' => 'DescribeRoute', 'http' => [ 'method' => 'GET', 'requestUri' => '/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes/{routeName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeRouteInput', ], 'output' => [ 'shape' => 'DescribeRouteOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'DescribeVirtualGateway' => [ 'name' => 'DescribeVirtualGateway', 'http' => [ 'method' => 'GET', 'requestUri' => '/v20190125/meshes/{meshName}/virtualGateways/{virtualGatewayName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeVirtualGatewayInput', ], 'output' => [ 'shape' => 'DescribeVirtualGatewayOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'DescribeVirtualNode' => [ 'name' => 'DescribeVirtualNode', 'http' => [ 'method' => 'GET', 'requestUri' => '/v20190125/meshes/{meshName}/virtualNodes/{virtualNodeName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeVirtualNodeInput', ], 'output' => [ 'shape' => 'DescribeVirtualNodeOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'DescribeVirtualRouter' => [ 'name' => 'DescribeVirtualRouter', 'http' => [ 'method' => 'GET', 'requestUri' => '/v20190125/meshes/{meshName}/virtualRouters/{virtualRouterName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeVirtualRouterInput', ], 'output' => [ 'shape' => 'DescribeVirtualRouterOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'DescribeVirtualService' => [ 'name' => 'DescribeVirtualService', 'http' => [ 'method' => 'GET', 'requestUri' => '/v20190125/meshes/{meshName}/virtualServices/{virtualServiceName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeVirtualServiceInput', ], 'output' => [ 'shape' => 'DescribeVirtualServiceOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'ListGatewayRoutes' => [ 'name' => 'ListGatewayRoutes', 'http' => [ 'method' => 'GET', 'requestUri' => '/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListGatewayRoutesInput', ], 'output' => [ 'shape' => 'ListGatewayRoutesOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'ListMeshes' => [ 'name' => 'ListMeshes', 'http' => [ 'method' => 'GET', 'requestUri' => '/v20190125/meshes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListMeshesInput', ], 'output' => [ 'shape' => 'ListMeshesOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'ListRoutes' => [ 'name' => 'ListRoutes', 'http' => [ 'method' => 'GET', 'requestUri' => '/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListRoutesInput', ], 'output' => [ 'shape' => 'ListRoutesOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/v20190125/tags', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTagsForResourceInput', ], 'output' => [ 'shape' => 'ListTagsForResourceOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'ListVirtualGateways' => [ 'name' => 'ListVirtualGateways', 'http' => [ 'method' => 'GET', 'requestUri' => '/v20190125/meshes/{meshName}/virtualGateways', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListVirtualGatewaysInput', ], 'output' => [ 'shape' => 'ListVirtualGatewaysOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'ListVirtualNodes' => [ 'name' => 'ListVirtualNodes', 'http' => [ 'method' => 'GET', 'requestUri' => '/v20190125/meshes/{meshName}/virtualNodes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListVirtualNodesInput', ], 'output' => [ 'shape' => 'ListVirtualNodesOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'ListVirtualRouters' => [ 'name' => 'ListVirtualRouters', 'http' => [ 'method' => 'GET', 'requestUri' => '/v20190125/meshes/{meshName}/virtualRouters', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListVirtualRoutersInput', ], 'output' => [ 'shape' => 'ListVirtualRoutersOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'ListVirtualServices' => [ 'name' => 'ListVirtualServices', 'http' => [ 'method' => 'GET', 'requestUri' => '/v20190125/meshes/{meshName}/virtualServices', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListVirtualServicesInput', ], 'output' => [ 'shape' => 'ListVirtualServicesOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v20190125/tag', 'responseCode' => 200, ], 'input' => [ 'shape' => 'TagResourceInput', ], 'output' => [ 'shape' => 'TagResourceOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyTagsException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], 'idempotent' => true, ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v20190125/untag', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UntagResourceInput', ], 'output' => [ 'shape' => 'UntagResourceOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], 'idempotent' => true, ], 'UpdateGatewayRoute' => [ 'name' => 'UpdateGatewayRoute', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes/{gatewayRouteName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateGatewayRouteInput', ], 'output' => [ 'shape' => 'UpdateGatewayRouteOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], 'UpdateMesh' => [ 'name' => 'UpdateMesh', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v20190125/meshes/{meshName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateMeshInput', ], 'output' => [ 'shape' => 'UpdateMeshOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], ], 'idempotent' => true, ], 'UpdateRoute' => [ 'name' => 'UpdateRoute', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes/{routeName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateRouteInput', ], 'output' => [ 'shape' => 'UpdateRouteOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], 'UpdateVirtualGateway' => [ 'name' => 'UpdateVirtualGateway', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v20190125/meshes/{meshName}/virtualGateways/{virtualGatewayName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateVirtualGatewayInput', ], 'output' => [ 'shape' => 'UpdateVirtualGatewayOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], 'UpdateVirtualNode' => [ 'name' => 'UpdateVirtualNode', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v20190125/meshes/{meshName}/virtualNodes/{virtualNodeName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateVirtualNodeInput', ], 'output' => [ 'shape' => 'UpdateVirtualNodeOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], 'UpdateVirtualRouter' => [ 'name' => 'UpdateVirtualRouter', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v20190125/meshes/{meshName}/virtualRouters/{virtualRouterName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateVirtualRouterInput', ], 'output' => [ 'shape' => 'UpdateVirtualRouterOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], 'UpdateVirtualService' => [ 'name' => 'UpdateVirtualService', 'http' => [ 'method' => 'PUT', 'requestUri' => '/v20190125/meshes/{meshName}/virtualServices/{virtualServiceName}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateVirtualServiceInput', ], 'output' => [ 'shape' => 'UpdateVirtualServiceOutput', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], ], 'shapes' => [ 'AccessLog' => [ 'type' => 'structure', 'members' => [ 'file' => [ 'shape' => 'FileAccessLog', ], ], 'union' => true, ], 'AccountId' => [ 'type' => 'string', 'max' => 12, 'min' => 12, ], 'Arn' => [ 'type' => 'string', ], 'AwsCloudMapInstanceAttribute' => [ 'type' => 'structure', 'required' => [ 'key', 'value', ], 'members' => [ 'key' => [ 'shape' => 'AwsCloudMapInstanceAttributeKey', ], 'value' => [ 'shape' => 'AwsCloudMapInstanceAttributeValue', ], ], ], 'AwsCloudMapInstanceAttributeKey' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '^[a-zA-Z0-9!-~]+$', ], 'AwsCloudMapInstanceAttributeValue' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, 'pattern' => '^([a-zA-Z0-9!-~][ a-zA-Z0-9!-~]*){0,1}[a-zA-Z0-9!-~]{0,1}$', ], 'AwsCloudMapInstanceAttributes' => [ 'type' => 'list', 'member' => [ 'shape' => 'AwsCloudMapInstanceAttribute', ], ], 'AwsCloudMapName' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, ], 'AwsCloudMapServiceDiscovery' => [ 'type' => 'structure', 'required' => [ 'namespaceName', 'serviceName', ], 'members' => [ 'attributes' => [ 'shape' => 'AwsCloudMapInstanceAttributes', ], 'ipPreference' => [ 'shape' => 'IpPreference', ], 'namespaceName' => [ 'shape' => 'AwsCloudMapName', ], 'serviceName' => [ 'shape' => 'AwsCloudMapName', ], ], ], 'Backend' => [ 'type' => 'structure', 'members' => [ 'virtualService' => [ 'shape' => 'VirtualServiceBackend', ], ], 'union' => true, ], 'BackendDefaults' => [ 'type' => 'structure', 'members' => [ 'clientPolicy' => [ 'shape' => 'ClientPolicy', ], ], ], 'Backends' => [ 'type' => 'list', 'member' => [ 'shape' => 'Backend', ], ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'Boolean' => [ 'type' => 'boolean', 'box' => true, ], 'CertificateAuthorityArns' => [ 'type' => 'list', 'member' => [ 'shape' => 'Arn', ], 'max' => 3, 'min' => 1, ], 'ClientPolicy' => [ 'type' => 'structure', 'members' => [ 'tls' => [ 'shape' => 'ClientPolicyTls', ], ], ], 'ClientPolicyTls' => [ 'type' => 'structure', 'required' => [ 'validation', ], 'members' => [ 'certificate' => [ 'shape' => 'ClientTlsCertificate', ], 'enforce' => [ 'shape' => 'Boolean', 'box' => true, ], 'ports' => [ 'shape' => 'PortSet', ], 'validation' => [ 'shape' => 'TlsValidationContext', ], ], ], 'ClientTlsCertificate' => [ 'type' => 'structure', 'members' => [ 'file' => [ 'shape' => 'ListenerTlsFileCertificate', ], 'sds' => [ 'shape' => 'ListenerTlsSdsCertificate', ], ], 'union' => true, ], 'ConflictException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'CreateGatewayRouteInput' => [ 'type' => 'structure', 'required' => [ 'gatewayRouteName', 'meshName', 'spec', 'virtualGatewayName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'gatewayRouteName' => [ 'shape' => 'ResourceName', ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'spec' => [ 'shape' => 'GatewayRouteSpec', ], 'tags' => [ 'shape' => 'TagList', ], 'virtualGatewayName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualGatewayName', ], ], ], 'CreateGatewayRouteOutput' => [ 'type' => 'structure', 'required' => [ 'gatewayRoute', ], 'members' => [ 'gatewayRoute' => [ 'shape' => 'GatewayRouteData', ], ], 'payload' => 'gatewayRoute', ], 'CreateMeshInput' => [ 'type' => 'structure', 'required' => [ 'meshName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', ], 'spec' => [ 'shape' => 'MeshSpec', ], 'tags' => [ 'shape' => 'TagList', ], ], ], 'CreateMeshOutput' => [ 'type' => 'structure', 'required' => [ 'mesh', ], 'members' => [ 'mesh' => [ 'shape' => 'MeshData', ], ], 'payload' => 'mesh', ], 'CreateRouteInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'routeName', 'spec', 'virtualRouterName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'routeName' => [ 'shape' => 'ResourceName', ], 'spec' => [ 'shape' => 'RouteSpec', ], 'tags' => [ 'shape' => 'TagList', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualRouterName', ], ], ], 'CreateRouteOutput' => [ 'type' => 'structure', 'required' => [ 'route', ], 'members' => [ 'route' => [ 'shape' => 'RouteData', ], ], 'payload' => 'route', ], 'CreateVirtualGatewayInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'spec', 'virtualGatewayName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'spec' => [ 'shape' => 'VirtualGatewaySpec', ], 'tags' => [ 'shape' => 'TagList', ], 'virtualGatewayName' => [ 'shape' => 'ResourceName', ], ], ], 'CreateVirtualGatewayOutput' => [ 'type' => 'structure', 'required' => [ 'virtualGateway', ], 'members' => [ 'virtualGateway' => [ 'shape' => 'VirtualGatewayData', ], ], 'payload' => 'virtualGateway', ], 'CreateVirtualNodeInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'spec', 'virtualNodeName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'spec' => [ 'shape' => 'VirtualNodeSpec', ], 'tags' => [ 'shape' => 'TagList', ], 'virtualNodeName' => [ 'shape' => 'ResourceName', ], ], ], 'CreateVirtualNodeOutput' => [ 'type' => 'structure', 'required' => [ 'virtualNode', ], 'members' => [ 'virtualNode' => [ 'shape' => 'VirtualNodeData', ], ], 'payload' => 'virtualNode', ], 'CreateVirtualRouterInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'spec', 'virtualRouterName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'spec' => [ 'shape' => 'VirtualRouterSpec', ], 'tags' => [ 'shape' => 'TagList', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', ], ], ], 'CreateVirtualRouterOutput' => [ 'type' => 'structure', 'required' => [ 'virtualRouter', ], 'members' => [ 'virtualRouter' => [ 'shape' => 'VirtualRouterData', ], ], 'payload' => 'virtualRouter', ], 'CreateVirtualServiceInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'spec', 'virtualServiceName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'spec' => [ 'shape' => 'VirtualServiceSpec', ], 'tags' => [ 'shape' => 'TagList', ], 'virtualServiceName' => [ 'shape' => 'ServiceName', ], ], ], 'CreateVirtualServiceOutput' => [ 'type' => 'structure', 'required' => [ 'virtualService', ], 'members' => [ 'virtualService' => [ 'shape' => 'VirtualServiceData', ], ], 'payload' => 'virtualService', ], 'DefaultGatewayRouteRewrite' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'DISABLED', ], ], 'DeleteGatewayRouteInput' => [ 'type' => 'structure', 'required' => [ 'gatewayRouteName', 'meshName', 'virtualGatewayName', ], 'members' => [ 'gatewayRouteName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'gatewayRouteName', ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'virtualGatewayName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualGatewayName', ], ], ], 'DeleteGatewayRouteOutput' => [ 'type' => 'structure', 'required' => [ 'gatewayRoute', ], 'members' => [ 'gatewayRoute' => [ 'shape' => 'GatewayRouteData', ], ], 'payload' => 'gatewayRoute', ], 'DeleteMeshInput' => [ 'type' => 'structure', 'required' => [ 'meshName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], ], ], 'DeleteMeshOutput' => [ 'type' => 'structure', 'required' => [ 'mesh', ], 'members' => [ 'mesh' => [ 'shape' => 'MeshData', ], ], 'payload' => 'mesh', ], 'DeleteRouteInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'routeName', 'virtualRouterName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'routeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'routeName', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualRouterName', ], ], ], 'DeleteRouteOutput' => [ 'type' => 'structure', 'required' => [ 'route', ], 'members' => [ 'route' => [ 'shape' => 'RouteData', ], ], 'payload' => 'route', ], 'DeleteVirtualGatewayInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualGatewayName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'virtualGatewayName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualGatewayName', ], ], ], 'DeleteVirtualGatewayOutput' => [ 'type' => 'structure', 'required' => [ 'virtualGateway', ], 'members' => [ 'virtualGateway' => [ 'shape' => 'VirtualGatewayData', ], ], 'payload' => 'virtualGateway', ], 'DeleteVirtualNodeInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualNodeName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'virtualNodeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualNodeName', ], ], ], 'DeleteVirtualNodeOutput' => [ 'type' => 'structure', 'required' => [ 'virtualNode', ], 'members' => [ 'virtualNode' => [ 'shape' => 'VirtualNodeData', ], ], 'payload' => 'virtualNode', ], 'DeleteVirtualRouterInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualRouterName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualRouterName', ], ], ], 'DeleteVirtualRouterOutput' => [ 'type' => 'structure', 'required' => [ 'virtualRouter', ], 'members' => [ 'virtualRouter' => [ 'shape' => 'VirtualRouterData', ], ], 'payload' => 'virtualRouter', ], 'DeleteVirtualServiceInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualServiceName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'virtualServiceName' => [ 'shape' => 'ServiceName', 'location' => 'uri', 'locationName' => 'virtualServiceName', ], ], ], 'DeleteVirtualServiceOutput' => [ 'type' => 'structure', 'required' => [ 'virtualService', ], 'members' => [ 'virtualService' => [ 'shape' => 'VirtualServiceData', ], ], 'payload' => 'virtualService', ], 'DescribeGatewayRouteInput' => [ 'type' => 'structure', 'required' => [ 'gatewayRouteName', 'meshName', 'virtualGatewayName', ], 'members' => [ 'gatewayRouteName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'gatewayRouteName', ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'virtualGatewayName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualGatewayName', ], ], ], 'DescribeGatewayRouteOutput' => [ 'type' => 'structure', 'required' => [ 'gatewayRoute', ], 'members' => [ 'gatewayRoute' => [ 'shape' => 'GatewayRouteData', ], ], 'payload' => 'gatewayRoute', ], 'DescribeMeshInput' => [ 'type' => 'structure', 'required' => [ 'meshName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], ], ], 'DescribeMeshOutput' => [ 'type' => 'structure', 'required' => [ 'mesh', ], 'members' => [ 'mesh' => [ 'shape' => 'MeshData', ], ], 'payload' => 'mesh', ], 'DescribeRouteInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'routeName', 'virtualRouterName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'routeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'routeName', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualRouterName', ], ], ], 'DescribeRouteOutput' => [ 'type' => 'structure', 'required' => [ 'route', ], 'members' => [ 'route' => [ 'shape' => 'RouteData', ], ], 'payload' => 'route', ], 'DescribeVirtualGatewayInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualGatewayName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'virtualGatewayName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualGatewayName', ], ], ], 'DescribeVirtualGatewayOutput' => [ 'type' => 'structure', 'required' => [ 'virtualGateway', ], 'members' => [ 'virtualGateway' => [ 'shape' => 'VirtualGatewayData', ], ], 'payload' => 'virtualGateway', ], 'DescribeVirtualNodeInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualNodeName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'virtualNodeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualNodeName', ], ], ], 'DescribeVirtualNodeOutput' => [ 'type' => 'structure', 'required' => [ 'virtualNode', ], 'members' => [ 'virtualNode' => [ 'shape' => 'VirtualNodeData', ], ], 'payload' => 'virtualNode', ], 'DescribeVirtualRouterInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualRouterName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualRouterName', ], ], ], 'DescribeVirtualRouterOutput' => [ 'type' => 'structure', 'required' => [ 'virtualRouter', ], 'members' => [ 'virtualRouter' => [ 'shape' => 'VirtualRouterData', ], ], 'payload' => 'virtualRouter', ], 'DescribeVirtualServiceInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualServiceName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'virtualServiceName' => [ 'shape' => 'ServiceName', 'location' => 'uri', 'locationName' => 'virtualServiceName', ], ], ], 'DescribeVirtualServiceOutput' => [ 'type' => 'structure', 'required' => [ 'virtualService', ], 'members' => [ 'virtualService' => [ 'shape' => 'VirtualServiceData', ], ], 'payload' => 'virtualService', ], 'DnsResponseType' => [ 'type' => 'string', 'enum' => [ 'LOADBALANCER', 'ENDPOINTS', ], ], 'DnsServiceDiscovery' => [ 'type' => 'structure', 'required' => [ 'hostname', ], 'members' => [ 'hostname' => [ 'shape' => 'Hostname', ], 'ipPreference' => [ 'shape' => 'IpPreference', ], 'responseType' => [ 'shape' => 'DnsResponseType', ], ], ], 'Duration' => [ 'type' => 'structure', 'members' => [ 'unit' => [ 'shape' => 'DurationUnit', ], 'value' => [ 'shape' => 'DurationValue', ], ], ], 'DurationUnit' => [ 'type' => 'string', 'enum' => [ 's', 'ms', ], ], 'DurationValue' => [ 'type' => 'long', 'box' => true, 'min' => 0, ], 'EgressFilter' => [ 'type' => 'structure', 'required' => [ 'type', ], 'members' => [ 'type' => [ 'shape' => 'EgressFilterType', ], ], ], 'EgressFilterType' => [ 'type' => 'string', 'enum' => [ 'ALLOW_ALL', 'DROP_ALL', ], ], 'ExactHostName' => [ 'type' => 'string', 'max' => 253, 'min' => 1, ], 'FileAccessLog' => [ 'type' => 'structure', 'required' => [ 'path', ], 'members' => [ 'format' => [ 'shape' => 'LoggingFormat', ], 'path' => [ 'shape' => 'FilePath', ], ], ], 'FilePath' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'ForbiddenException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 403, 'senderFault' => true, ], 'exception' => true, ], 'GatewayRouteData' => [ 'type' => 'structure', 'required' => [ 'gatewayRouteName', 'meshName', 'metadata', 'spec', 'status', 'virtualGatewayName', ], 'members' => [ 'gatewayRouteName' => [ 'shape' => 'ResourceName', ], 'meshName' => [ 'shape' => 'ResourceName', ], 'metadata' => [ 'shape' => 'ResourceMetadata', ], 'spec' => [ 'shape' => 'GatewayRouteSpec', ], 'status' => [ 'shape' => 'GatewayRouteStatus', ], 'virtualGatewayName' => [ 'shape' => 'ResourceName', ], ], ], 'GatewayRouteHostnameMatch' => [ 'type' => 'structure', 'members' => [ 'exact' => [ 'shape' => 'ExactHostName', ], 'suffix' => [ 'shape' => 'SuffixHostname', ], ], ], 'GatewayRouteHostnameRewrite' => [ 'type' => 'structure', 'members' => [ 'defaultTargetHostname' => [ 'shape' => 'DefaultGatewayRouteRewrite', ], ], ], 'GatewayRouteList' => [ 'type' => 'list', 'member' => [ 'shape' => 'GatewayRouteRef', ], ], 'GatewayRoutePriority' => [ 'type' => 'integer', 'box' => true, 'max' => 1000, 'min' => 0, ], 'GatewayRouteRef' => [ 'type' => 'structure', 'required' => [ 'arn', 'createdAt', 'gatewayRouteName', 'lastUpdatedAt', 'meshName', 'meshOwner', 'resourceOwner', 'version', 'virtualGatewayName', ], 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'gatewayRouteName' => [ 'shape' => 'ResourceName', ], 'lastUpdatedAt' => [ 'shape' => 'Timestamp', ], 'meshName' => [ 'shape' => 'ResourceName', ], 'meshOwner' => [ 'shape' => 'AccountId', ], 'resourceOwner' => [ 'shape' => 'AccountId', ], 'version' => [ 'shape' => 'Long', ], 'virtualGatewayName' => [ 'shape' => 'ResourceName', ], ], ], 'GatewayRouteSpec' => [ 'type' => 'structure', 'members' => [ 'grpcRoute' => [ 'shape' => 'GrpcGatewayRoute', ], 'http2Route' => [ 'shape' => 'HttpGatewayRoute', ], 'httpRoute' => [ 'shape' => 'HttpGatewayRoute', ], 'priority' => [ 'shape' => 'GatewayRoutePriority', ], ], ], 'GatewayRouteStatus' => [ 'type' => 'structure', 'required' => [ 'status', ], 'members' => [ 'status' => [ 'shape' => 'GatewayRouteStatusCode', ], ], ], 'GatewayRouteStatusCode' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'INACTIVE', 'DELETED', ], ], 'GatewayRouteTarget' => [ 'type' => 'structure', 'required' => [ 'virtualService', ], 'members' => [ 'port' => [ 'shape' => 'ListenerPort', ], 'virtualService' => [ 'shape' => 'GatewayRouteVirtualService', ], ], ], 'GatewayRouteVirtualService' => [ 'type' => 'structure', 'required' => [ 'virtualServiceName', ], 'members' => [ 'virtualServiceName' => [ 'shape' => 'ResourceName', ], ], ], 'GrpcGatewayRoute' => [ 'type' => 'structure', 'required' => [ 'action', 'match', ], 'members' => [ 'action' => [ 'shape' => 'GrpcGatewayRouteAction', ], 'match' => [ 'shape' => 'GrpcGatewayRouteMatch', ], ], ], 'GrpcGatewayRouteAction' => [ 'type' => 'structure', 'required' => [ 'target', ], 'members' => [ 'rewrite' => [ 'shape' => 'GrpcGatewayRouteRewrite', ], 'target' => [ 'shape' => 'GatewayRouteTarget', ], ], ], 'GrpcGatewayRouteMatch' => [ 'type' => 'structure', 'members' => [ 'hostname' => [ 'shape' => 'GatewayRouteHostnameMatch', ], 'metadata' => [ 'shape' => 'GrpcGatewayRouteMetadataList', ], 'port' => [ 'shape' => 'ListenerPort', ], 'serviceName' => [ 'shape' => 'ServiceName', ], ], ], 'GrpcGatewayRouteMetadata' => [ 'type' => 'structure', 'required' => [ 'name', ], 'members' => [ 'invert' => [ 'shape' => 'Boolean', ], 'match' => [ 'shape' => 'GrpcMetadataMatchMethod', ], 'name' => [ 'shape' => 'HeaderName', ], ], ], 'GrpcGatewayRouteMetadataList' => [ 'type' => 'list', 'member' => [ 'shape' => 'GrpcGatewayRouteMetadata', ], 'max' => 10, 'min' => 1, ], 'GrpcGatewayRouteRewrite' => [ 'type' => 'structure', 'members' => [ 'hostname' => [ 'shape' => 'GatewayRouteHostnameRewrite', ], ], ], 'GrpcMetadataMatchMethod' => [ 'type' => 'structure', 'members' => [ 'exact' => [ 'shape' => 'HeaderMatch', ], 'prefix' => [ 'shape' => 'HeaderMatch', ], 'range' => [ 'shape' => 'MatchRange', ], 'regex' => [ 'shape' => 'HeaderMatch', ], 'suffix' => [ 'shape' => 'HeaderMatch', ], ], 'union' => true, ], 'GrpcRetryPolicy' => [ 'type' => 'structure', 'required' => [ 'maxRetries', 'perRetryTimeout', ], 'members' => [ 'grpcRetryEvents' => [ 'shape' => 'GrpcRetryPolicyEvents', ], 'httpRetryEvents' => [ 'shape' => 'HttpRetryPolicyEvents', ], 'maxRetries' => [ 'shape' => 'MaxRetries', ], 'perRetryTimeout' => [ 'shape' => 'Duration', ], 'tcpRetryEvents' => [ 'shape' => 'TcpRetryPolicyEvents', ], ], ], 'GrpcRetryPolicyEvent' => [ 'type' => 'string', 'enum' => [ 'cancelled', 'deadline-exceeded', 'internal', 'resource-exhausted', 'unavailable', ], ], 'GrpcRetryPolicyEvents' => [ 'type' => 'list', 'member' => [ 'shape' => 'GrpcRetryPolicyEvent', ], 'max' => 5, 'min' => 1, ], 'GrpcRoute' => [ 'type' => 'structure', 'required' => [ 'action', 'match', ], 'members' => [ 'action' => [ 'shape' => 'GrpcRouteAction', ], 'match' => [ 'shape' => 'GrpcRouteMatch', ], 'retryPolicy' => [ 'shape' => 'GrpcRetryPolicy', ], 'timeout' => [ 'shape' => 'GrpcTimeout', ], ], ], 'GrpcRouteAction' => [ 'type' => 'structure', 'required' => [ 'weightedTargets', ], 'members' => [ 'weightedTargets' => [ 'shape' => 'WeightedTargets', ], ], ], 'GrpcRouteMatch' => [ 'type' => 'structure', 'members' => [ 'metadata' => [ 'shape' => 'GrpcRouteMetadataList', ], 'methodName' => [ 'shape' => 'MethodName', ], 'port' => [ 'shape' => 'ListenerPort', ], 'serviceName' => [ 'shape' => 'ServiceName', ], ], ], 'GrpcRouteMetadata' => [ 'type' => 'structure', 'required' => [ 'name', ], 'members' => [ 'invert' => [ 'shape' => 'Boolean', ], 'match' => [ 'shape' => 'GrpcRouteMetadataMatchMethod', ], 'name' => [ 'shape' => 'HeaderName', ], ], ], 'GrpcRouteMetadataList' => [ 'type' => 'list', 'member' => [ 'shape' => 'GrpcRouteMetadata', ], 'max' => 10, 'min' => 1, ], 'GrpcRouteMetadataMatchMethod' => [ 'type' => 'structure', 'members' => [ 'exact' => [ 'shape' => 'HeaderMatch', ], 'prefix' => [ 'shape' => 'HeaderMatch', ], 'range' => [ 'shape' => 'MatchRange', ], 'regex' => [ 'shape' => 'HeaderMatch', ], 'suffix' => [ 'shape' => 'HeaderMatch', ], ], 'union' => true, ], 'GrpcTimeout' => [ 'type' => 'structure', 'members' => [ 'idle' => [ 'shape' => 'Duration', ], 'perRequest' => [ 'shape' => 'Duration', ], ], ], 'HeaderMatch' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'HeaderMatchMethod' => [ 'type' => 'structure', 'members' => [ 'exact' => [ 'shape' => 'HeaderMatch', ], 'prefix' => [ 'shape' => 'HeaderMatch', ], 'range' => [ 'shape' => 'MatchRange', ], 'regex' => [ 'shape' => 'HeaderMatch', ], 'suffix' => [ 'shape' => 'HeaderMatch', ], ], 'union' => true, ], 'HeaderName' => [ 'type' => 'string', 'max' => 50, 'min' => 1, ], 'HealthCheckIntervalMillis' => [ 'type' => 'long', 'box' => true, 'max' => 300000, 'min' => 5000, ], 'HealthCheckPolicy' => [ 'type' => 'structure', 'required' => [ 'healthyThreshold', 'intervalMillis', 'protocol', 'timeoutMillis', 'unhealthyThreshold', ], 'members' => [ 'healthyThreshold' => [ 'shape' => 'HealthCheckThreshold', ], 'intervalMillis' => [ 'shape' => 'HealthCheckIntervalMillis', ], 'path' => [ 'shape' => 'String', ], 'port' => [ 'shape' => 'PortNumber', ], 'protocol' => [ 'shape' => 'PortProtocol', ], 'timeoutMillis' => [ 'shape' => 'HealthCheckTimeoutMillis', ], 'unhealthyThreshold' => [ 'shape' => 'HealthCheckThreshold', ], ], ], 'HealthCheckThreshold' => [ 'type' => 'integer', 'max' => 10, 'min' => 2, ], 'HealthCheckTimeoutMillis' => [ 'type' => 'long', 'box' => true, 'max' => 60000, 'min' => 2000, ], 'Hostname' => [ 'type' => 'string', ], 'HttpGatewayRoute' => [ 'type' => 'structure', 'required' => [ 'action', 'match', ], 'members' => [ 'action' => [ 'shape' => 'HttpGatewayRouteAction', ], 'match' => [ 'shape' => 'HttpGatewayRouteMatch', ], ], ], 'HttpGatewayRouteAction' => [ 'type' => 'structure', 'required' => [ 'target', ], 'members' => [ 'rewrite' => [ 'shape' => 'HttpGatewayRouteRewrite', ], 'target' => [ 'shape' => 'GatewayRouteTarget', ], ], ], 'HttpGatewayRouteHeader' => [ 'type' => 'structure', 'required' => [ 'name', ], 'members' => [ 'invert' => [ 'shape' => 'Boolean', ], 'match' => [ 'shape' => 'HeaderMatchMethod', ], 'name' => [ 'shape' => 'HeaderName', ], ], ], 'HttpGatewayRouteHeaders' => [ 'type' => 'list', 'member' => [ 'shape' => 'HttpGatewayRouteHeader', ], 'max' => 10, 'min' => 1, ], 'HttpGatewayRouteMatch' => [ 'type' => 'structure', 'members' => [ 'headers' => [ 'shape' => 'HttpGatewayRouteHeaders', ], 'hostname' => [ 'shape' => 'GatewayRouteHostnameMatch', ], 'method' => [ 'shape' => 'HttpMethod', ], 'path' => [ 'shape' => 'HttpPathMatch', ], 'port' => [ 'shape' => 'ListenerPort', ], 'prefix' => [ 'shape' => 'String', ], 'queryParameters' => [ 'shape' => 'HttpQueryParameters', ], ], ], 'HttpGatewayRoutePathRewrite' => [ 'type' => 'structure', 'members' => [ 'exact' => [ 'shape' => 'HttpPathExact', ], ], ], 'HttpGatewayRoutePrefix' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'HttpGatewayRoutePrefixRewrite' => [ 'type' => 'structure', 'members' => [ 'defaultPrefix' => [ 'shape' => 'DefaultGatewayRouteRewrite', ], 'value' => [ 'shape' => 'HttpGatewayRoutePrefix', ], ], ], 'HttpGatewayRouteRewrite' => [ 'type' => 'structure', 'members' => [ 'hostname' => [ 'shape' => 'GatewayRouteHostnameRewrite', ], 'path' => [ 'shape' => 'HttpGatewayRoutePathRewrite', ], 'prefix' => [ 'shape' => 'HttpGatewayRoutePrefixRewrite', ], ], ], 'HttpMethod' => [ 'type' => 'string', 'enum' => [ 'GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH', ], ], 'HttpPathExact' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'HttpPathMatch' => [ 'type' => 'structure', 'members' => [ 'exact' => [ 'shape' => 'HttpPathExact', ], 'regex' => [ 'shape' => 'HttpPathRegex', ], ], ], 'HttpPathRegex' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'HttpQueryParameter' => [ 'type' => 'structure', 'required' => [ 'name', ], 'members' => [ 'match' => [ 'shape' => 'QueryParameterMatch', ], 'name' => [ 'shape' => 'QueryParameterName', ], ], ], 'HttpQueryParameters' => [ 'type' => 'list', 'member' => [ 'shape' => 'HttpQueryParameter', ], 'max' => 10, 'min' => 1, ], 'HttpRetryPolicy' => [ 'type' => 'structure', 'required' => [ 'maxRetries', 'perRetryTimeout', ], 'members' => [ 'httpRetryEvents' => [ 'shape' => 'HttpRetryPolicyEvents', ], 'maxRetries' => [ 'shape' => 'MaxRetries', ], 'perRetryTimeout' => [ 'shape' => 'Duration', ], 'tcpRetryEvents' => [ 'shape' => 'TcpRetryPolicyEvents', ], ], ], 'HttpRetryPolicyEvent' => [ 'type' => 'string', 'max' => 25, 'min' => 1, ], 'HttpRetryPolicyEvents' => [ 'type' => 'list', 'member' => [ 'shape' => 'HttpRetryPolicyEvent', ], 'max' => 25, 'min' => 1, ], 'HttpRoute' => [ 'type' => 'structure', 'required' => [ 'action', 'match', ], 'members' => [ 'action' => [ 'shape' => 'HttpRouteAction', ], 'match' => [ 'shape' => 'HttpRouteMatch', ], 'retryPolicy' => [ 'shape' => 'HttpRetryPolicy', ], 'timeout' => [ 'shape' => 'HttpTimeout', ], ], ], 'HttpRouteAction' => [ 'type' => 'structure', 'required' => [ 'weightedTargets', ], 'members' => [ 'weightedTargets' => [ 'shape' => 'WeightedTargets', ], ], ], 'HttpRouteHeader' => [ 'type' => 'structure', 'required' => [ 'name', ], 'members' => [ 'invert' => [ 'shape' => 'Boolean', ], 'match' => [ 'shape' => 'HeaderMatchMethod', ], 'name' => [ 'shape' => 'HeaderName', ], ], ], 'HttpRouteHeaders' => [ 'type' => 'list', 'member' => [ 'shape' => 'HttpRouteHeader', ], 'max' => 10, 'min' => 1, ], 'HttpRouteMatch' => [ 'type' => 'structure', 'members' => [ 'headers' => [ 'shape' => 'HttpRouteHeaders', ], 'method' => [ 'shape' => 'HttpMethod', ], 'path' => [ 'shape' => 'HttpPathMatch', ], 'port' => [ 'shape' => 'ListenerPort', ], 'prefix' => [ 'shape' => 'String', ], 'queryParameters' => [ 'shape' => 'HttpQueryParameters', ], 'scheme' => [ 'shape' => 'HttpScheme', ], ], ], 'HttpScheme' => [ 'type' => 'string', 'enum' => [ 'http', 'https', ], ], 'HttpTimeout' => [ 'type' => 'structure', 'members' => [ 'idle' => [ 'shape' => 'Duration', ], 'perRequest' => [ 'shape' => 'Duration', ], ], ], 'InternalServerErrorException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, 'retryable' => [ 'throttling' => false, ], ], 'IpPreference' => [ 'type' => 'string', 'enum' => [ 'IPv6_PREFERRED', 'IPv4_PREFERRED', 'IPv4_ONLY', 'IPv6_ONLY', ], ], 'JsonFormat' => [ 'type' => 'list', 'member' => [ 'shape' => 'JsonFormatRef', ], ], 'JsonFormatRef' => [ 'type' => 'structure', 'required' => [ 'key', 'value', ], 'members' => [ 'key' => [ 'shape' => 'JsonKey', ], 'value' => [ 'shape' => 'JsonValue', ], ], ], 'JsonKey' => [ 'type' => 'string', 'max' => 100, 'min' => 1, ], 'JsonValue' => [ 'type' => 'string', 'max' => 100, 'min' => 1, ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'ListGatewayRoutesInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualGatewayName', ], 'members' => [ 'limit' => [ 'shape' => 'ListGatewayRoutesLimit', 'location' => 'querystring', 'locationName' => 'limit', ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'virtualGatewayName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualGatewayName', ], ], ], 'ListGatewayRoutesLimit' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'ListGatewayRoutesOutput' => [ 'type' => 'structure', 'required' => [ 'gatewayRoutes', ], 'members' => [ 'gatewayRoutes' => [ 'shape' => 'GatewayRouteList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'ListMeshesInput' => [ 'type' => 'structure', 'members' => [ 'limit' => [ 'shape' => 'ListMeshesLimit', 'location' => 'querystring', 'locationName' => 'limit', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'ListMeshesLimit' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'ListMeshesOutput' => [ 'type' => 'structure', 'required' => [ 'meshes', ], 'members' => [ 'meshes' => [ 'shape' => 'MeshList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'ListRoutesInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'virtualRouterName', ], 'members' => [ 'limit' => [ 'shape' => 'ListRoutesLimit', 'location' => 'querystring', 'locationName' => 'limit', ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualRouterName', ], ], ], 'ListRoutesLimit' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'ListRoutesOutput' => [ 'type' => 'structure', 'required' => [ 'routes', ], 'members' => [ 'nextToken' => [ 'shape' => 'String', ], 'routes' => [ 'shape' => 'RouteList', ], ], ], 'ListTagsForResourceInput' => [ 'type' => 'structure', 'required' => [ 'resourceArn', ], 'members' => [ 'limit' => [ 'shape' => 'TagsLimit', 'location' => 'querystring', 'locationName' => 'limit', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'resourceArn' => [ 'shape' => 'Arn', 'location' => 'querystring', 'locationName' => 'resourceArn', ], ], ], 'ListTagsForResourceOutput' => [ 'type' => 'structure', 'required' => [ 'tags', ], 'members' => [ 'nextToken' => [ 'shape' => 'String', ], 'tags' => [ 'shape' => 'TagList', ], ], ], 'ListVirtualGatewaysInput' => [ 'type' => 'structure', 'required' => [ 'meshName', ], 'members' => [ 'limit' => [ 'shape' => 'ListVirtualGatewaysLimit', 'location' => 'querystring', 'locationName' => 'limit', ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'ListVirtualGatewaysLimit' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'ListVirtualGatewaysOutput' => [ 'type' => 'structure', 'required' => [ 'virtualGateways', ], 'members' => [ 'nextToken' => [ 'shape' => 'String', ], 'virtualGateways' => [ 'shape' => 'VirtualGatewayList', ], ], ], 'ListVirtualNodesInput' => [ 'type' => 'structure', 'required' => [ 'meshName', ], 'members' => [ 'limit' => [ 'shape' => 'ListVirtualNodesLimit', 'location' => 'querystring', 'locationName' => 'limit', ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'ListVirtualNodesLimit' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'ListVirtualNodesOutput' => [ 'type' => 'structure', 'required' => [ 'virtualNodes', ], 'members' => [ 'nextToken' => [ 'shape' => 'String', ], 'virtualNodes' => [ 'shape' => 'VirtualNodeList', ], ], ], 'ListVirtualRoutersInput' => [ 'type' => 'structure', 'required' => [ 'meshName', ], 'members' => [ 'limit' => [ 'shape' => 'ListVirtualRoutersLimit', 'location' => 'querystring', 'locationName' => 'limit', ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'ListVirtualRoutersLimit' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'ListVirtualRoutersOutput' => [ 'type' => 'structure', 'required' => [ 'virtualRouters', ], 'members' => [ 'nextToken' => [ 'shape' => 'String', ], 'virtualRouters' => [ 'shape' => 'VirtualRouterList', ], ], ], 'ListVirtualServicesInput' => [ 'type' => 'structure', 'required' => [ 'meshName', ], 'members' => [ 'limit' => [ 'shape' => 'ListVirtualServicesLimit', 'location' => 'querystring', 'locationName' => 'limit', ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'ListVirtualServicesLimit' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'ListVirtualServicesOutput' => [ 'type' => 'structure', 'required' => [ 'virtualServices', ], 'members' => [ 'nextToken' => [ 'shape' => 'String', ], 'virtualServices' => [ 'shape' => 'VirtualServiceList', ], ], ], 'Listener' => [ 'type' => 'structure', 'required' => [ 'portMapping', ], 'members' => [ 'connectionPool' => [ 'shape' => 'VirtualNodeConnectionPool', ], 'healthCheck' => [ 'shape' => 'HealthCheckPolicy', ], 'outlierDetection' => [ 'shape' => 'OutlierDetection', ], 'portMapping' => [ 'shape' => 'PortMapping', ], 'timeout' => [ 'shape' => 'ListenerTimeout', ], 'tls' => [ 'shape' => 'ListenerTls', ], ], ], 'ListenerPort' => [ 'type' => 'integer', 'box' => true, 'max' => 65535, 'min' => 1, ], 'ListenerTimeout' => [ 'type' => 'structure', 'members' => [ 'grpc' => [ 'shape' => 'GrpcTimeout', ], 'http' => [ 'shape' => 'HttpTimeout', ], 'http2' => [ 'shape' => 'HttpTimeout', ], 'tcp' => [ 'shape' => 'TcpTimeout', ], ], 'union' => true, ], 'ListenerTls' => [ 'type' => 'structure', 'required' => [ 'certificate', 'mode', ], 'members' => [ 'certificate' => [ 'shape' => 'ListenerTlsCertificate', ], 'mode' => [ 'shape' => 'ListenerTlsMode', ], 'validation' => [ 'shape' => 'ListenerTlsValidationContext', ], ], ], 'ListenerTlsAcmCertificate' => [ 'type' => 'structure', 'required' => [ 'certificateArn', ], 'members' => [ 'certificateArn' => [ 'shape' => 'Arn', ], ], ], 'ListenerTlsCertificate' => [ 'type' => 'structure', 'members' => [ 'acm' => [ 'shape' => 'ListenerTlsAcmCertificate', ], 'file' => [ 'shape' => 'ListenerTlsFileCertificate', ], 'sds' => [ 'shape' => 'ListenerTlsSdsCertificate', ], ], 'union' => true, ], 'ListenerTlsFileCertificate' => [ 'type' => 'structure', 'required' => [ 'certificateChain', 'privateKey', ], 'members' => [ 'certificateChain' => [ 'shape' => 'FilePath', ], 'privateKey' => [ 'shape' => 'FilePath', ], ], ], 'ListenerTlsMode' => [ 'type' => 'string', 'enum' => [ 'STRICT', 'PERMISSIVE', 'DISABLED', ], ], 'ListenerTlsSdsCertificate' => [ 'type' => 'structure', 'required' => [ 'secretName', ], 'members' => [ 'secretName' => [ 'shape' => 'SdsSecretName', ], ], ], 'ListenerTlsValidationContext' => [ 'type' => 'structure', 'required' => [ 'trust', ], 'members' => [ 'subjectAlternativeNames' => [ 'shape' => 'SubjectAlternativeNames', ], 'trust' => [ 'shape' => 'ListenerTlsValidationContextTrust', ], ], ], 'ListenerTlsValidationContextTrust' => [ 'type' => 'structure', 'members' => [ 'file' => [ 'shape' => 'TlsValidationContextFileTrust', ], 'sds' => [ 'shape' => 'TlsValidationContextSdsTrust', ], ], 'union' => true, ], 'Listeners' => [ 'type' => 'list', 'member' => [ 'shape' => 'Listener', ], ], 'Logging' => [ 'type' => 'structure', 'members' => [ 'accessLog' => [ 'shape' => 'AccessLog', ], ], ], 'LoggingFormat' => [ 'type' => 'structure', 'members' => [ 'json' => [ 'shape' => 'JsonFormat', ], 'text' => [ 'shape' => 'TextFormat', ], ], 'union' => true, ], 'Long' => [ 'type' => 'long', 'box' => true, ], 'MatchRange' => [ 'type' => 'structure', 'required' => [ 'end', 'start', ], 'members' => [ 'end' => [ 'shape' => 'Long', ], 'start' => [ 'shape' => 'Long', ], ], ], 'MaxConnections' => [ 'type' => 'integer', 'min' => 1, ], 'MaxPendingRequests' => [ 'type' => 'integer', 'min' => 1, ], 'MaxRequests' => [ 'type' => 'integer', 'min' => 1, ], 'MaxRetries' => [ 'type' => 'long', 'box' => true, 'min' => 0, ], 'MeshData' => [ 'type' => 'structure', 'required' => [ 'meshName', 'metadata', 'spec', 'status', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', ], 'metadata' => [ 'shape' => 'ResourceMetadata', ], 'spec' => [ 'shape' => 'MeshSpec', ], 'status' => [ 'shape' => 'MeshStatus', ], ], ], 'MeshList' => [ 'type' => 'list', 'member' => [ 'shape' => 'MeshRef', ], ], 'MeshRef' => [ 'type' => 'structure', 'required' => [ 'arn', 'createdAt', 'lastUpdatedAt', 'meshName', 'meshOwner', 'resourceOwner', 'version', ], 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'lastUpdatedAt' => [ 'shape' => 'Timestamp', ], 'meshName' => [ 'shape' => 'ResourceName', ], 'meshOwner' => [ 'shape' => 'AccountId', ], 'resourceOwner' => [ 'shape' => 'AccountId', ], 'version' => [ 'shape' => 'Long', ], ], ], 'MeshServiceDiscovery' => [ 'type' => 'structure', 'members' => [ 'ipPreference' => [ 'shape' => 'IpPreference', ], ], ], 'MeshSpec' => [ 'type' => 'structure', 'members' => [ 'egressFilter' => [ 'shape' => 'EgressFilter', ], 'serviceDiscovery' => [ 'shape' => 'MeshServiceDiscovery', ], ], ], 'MeshStatus' => [ 'type' => 'structure', 'members' => [ 'status' => [ 'shape' => 'MeshStatusCode', ], ], ], 'MeshStatusCode' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'INACTIVE', 'DELETED', ], ], 'MethodName' => [ 'type' => 'string', 'max' => 50, 'min' => 1, ], 'NotFoundException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'OutlierDetection' => [ 'type' => 'structure', 'required' => [ 'baseEjectionDuration', 'interval', 'maxEjectionPercent', 'maxServerErrors', ], 'members' => [ 'baseEjectionDuration' => [ 'shape' => 'Duration', ], 'interval' => [ 'shape' => 'Duration', ], 'maxEjectionPercent' => [ 'shape' => 'OutlierDetectionMaxEjectionPercent', ], 'maxServerErrors' => [ 'shape' => 'OutlierDetectionMaxServerErrors', ], ], ], 'OutlierDetectionMaxEjectionPercent' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 0, ], 'OutlierDetectionMaxServerErrors' => [ 'type' => 'long', 'box' => true, 'min' => 1, ], 'PercentInt' => [ 'type' => 'integer', 'max' => 100, 'min' => 0, ], 'PortMapping' => [ 'type' => 'structure', 'required' => [ 'port', 'protocol', ], 'members' => [ 'port' => [ 'shape' => 'PortNumber', ], 'protocol' => [ 'shape' => 'PortProtocol', ], ], ], 'PortNumber' => [ 'type' => 'integer', 'max' => 65535, 'min' => 1, ], 'PortProtocol' => [ 'type' => 'string', 'enum' => [ 'http', 'tcp', 'http2', 'grpc', ], ], 'PortSet' => [ 'type' => 'list', 'member' => [ 'shape' => 'PortNumber', ], ], 'QueryParameterMatch' => [ 'type' => 'structure', 'members' => [ 'exact' => [ 'shape' => 'String', ], ], ], 'QueryParameterName' => [ 'type' => 'string', ], 'ResourceInUseException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'ResourceMetadata' => [ 'type' => 'structure', 'required' => [ 'arn', 'createdAt', 'lastUpdatedAt', 'meshOwner', 'resourceOwner', 'uid', 'version', ], 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'lastUpdatedAt' => [ 'shape' => 'Timestamp', ], 'meshOwner' => [ 'shape' => 'AccountId', ], 'resourceOwner' => [ 'shape' => 'AccountId', ], 'uid' => [ 'shape' => 'String', ], 'version' => [ 'shape' => 'Long', ], ], ], 'ResourceName' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'RouteData' => [ 'type' => 'structure', 'required' => [ 'meshName', 'metadata', 'routeName', 'spec', 'status', 'virtualRouterName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', ], 'metadata' => [ 'shape' => 'ResourceMetadata', ], 'routeName' => [ 'shape' => 'ResourceName', ], 'spec' => [ 'shape' => 'RouteSpec', ], 'status' => [ 'shape' => 'RouteStatus', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', ], ], ], 'RouteList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RouteRef', ], ], 'RoutePriority' => [ 'type' => 'integer', 'box' => true, 'max' => 1000, 'min' => 0, ], 'RouteRef' => [ 'type' => 'structure', 'required' => [ 'arn', 'createdAt', 'lastUpdatedAt', 'meshName', 'meshOwner', 'resourceOwner', 'routeName', 'version', 'virtualRouterName', ], 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'lastUpdatedAt' => [ 'shape' => 'Timestamp', ], 'meshName' => [ 'shape' => 'ResourceName', ], 'meshOwner' => [ 'shape' => 'AccountId', ], 'resourceOwner' => [ 'shape' => 'AccountId', ], 'routeName' => [ 'shape' => 'ResourceName', ], 'version' => [ 'shape' => 'Long', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', ], ], ], 'RouteSpec' => [ 'type' => 'structure', 'members' => [ 'grpcRoute' => [ 'shape' => 'GrpcRoute', ], 'http2Route' => [ 'shape' => 'HttpRoute', ], 'httpRoute' => [ 'shape' => 'HttpRoute', ], 'priority' => [ 'shape' => 'RoutePriority', ], 'tcpRoute' => [ 'shape' => 'TcpRoute', ], ], ], 'RouteStatus' => [ 'type' => 'structure', 'required' => [ 'status', ], 'members' => [ 'status' => [ 'shape' => 'RouteStatusCode', ], ], ], 'RouteStatusCode' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'INACTIVE', 'DELETED', ], ], 'SdsSecretName' => [ 'type' => 'string', ], 'ServiceDiscovery' => [ 'type' => 'structure', 'members' => [ 'awsCloudMap' => [ 'shape' => 'AwsCloudMapServiceDiscovery', ], 'dns' => [ 'shape' => 'DnsServiceDiscovery', ], ], 'union' => true, ], 'ServiceName' => [ 'type' => 'string', ], 'ServiceUnavailableException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, 'retryable' => [ 'throttling' => false, ], ], 'String' => [ 'type' => 'string', ], 'SubjectAlternativeName' => [ 'type' => 'string', 'max' => 254, 'min' => 1, ], 'SubjectAlternativeNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SubjectAlternativeName', ], ], 'SubjectAlternativeNameMatchers' => [ 'type' => 'structure', 'required' => [ 'exact', ], 'members' => [ 'exact' => [ 'shape' => 'SubjectAlternativeNameList', ], ], ], 'SubjectAlternativeNames' => [ 'type' => 'structure', 'required' => [ 'match', ], 'members' => [ 'match' => [ 'shape' => 'SubjectAlternativeNameMatchers', ], ], ], 'SuffixHostname' => [ 'type' => 'string', 'max' => 253, 'min' => 1, ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 50, 'min' => 0, ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagRef', ], 'max' => 50, 'min' => 0, ], 'TagRef' => [ 'type' => 'structure', 'required' => [ 'key', 'value', ], 'members' => [ 'key' => [ 'shape' => 'TagKey', ], 'value' => [ 'shape' => 'TagValue', ], ], ], 'TagResourceInput' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tags', ], 'members' => [ 'resourceArn' => [ 'shape' => 'Arn', 'location' => 'querystring', 'locationName' => 'resourceArn', ], 'tags' => [ 'shape' => 'TagList', ], ], ], 'TagResourceOutput' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, ], 'TagsLimit' => [ 'type' => 'integer', 'box' => true, 'max' => 50, 'min' => 1, ], 'TcpRetryPolicyEvent' => [ 'type' => 'string', 'enum' => [ 'connection-error', ], ], 'TcpRetryPolicyEvents' => [ 'type' => 'list', 'member' => [ 'shape' => 'TcpRetryPolicyEvent', ], 'max' => 1, 'min' => 1, ], 'TcpRoute' => [ 'type' => 'structure', 'required' => [ 'action', ], 'members' => [ 'action' => [ 'shape' => 'TcpRouteAction', ], 'match' => [ 'shape' => 'TcpRouteMatch', ], 'timeout' => [ 'shape' => 'TcpTimeout', ], ], ], 'TcpRouteAction' => [ 'type' => 'structure', 'required' => [ 'weightedTargets', ], 'members' => [ 'weightedTargets' => [ 'shape' => 'WeightedTargets', ], ], ], 'TcpRouteMatch' => [ 'type' => 'structure', 'members' => [ 'port' => [ 'shape' => 'ListenerPort', ], ], ], 'TcpTimeout' => [ 'type' => 'structure', 'members' => [ 'idle' => [ 'shape' => 'Duration', ], ], ], 'TextFormat' => [ 'type' => 'string', 'max' => 1000, 'min' => 1, ], 'Timestamp' => [ 'type' => 'timestamp', ], 'TlsValidationContext' => [ 'type' => 'structure', 'required' => [ 'trust', ], 'members' => [ 'subjectAlternativeNames' => [ 'shape' => 'SubjectAlternativeNames', ], 'trust' => [ 'shape' => 'TlsValidationContextTrust', ], ], ], 'TlsValidationContextAcmTrust' => [ 'type' => 'structure', 'required' => [ 'certificateAuthorityArns', ], 'members' => [ 'certificateAuthorityArns' => [ 'shape' => 'CertificateAuthorityArns', ], ], ], 'TlsValidationContextFileTrust' => [ 'type' => 'structure', 'required' => [ 'certificateChain', ], 'members' => [ 'certificateChain' => [ 'shape' => 'FilePath', ], ], ], 'TlsValidationContextSdsTrust' => [ 'type' => 'structure', 'required' => [ 'secretName', ], 'members' => [ 'secretName' => [ 'shape' => 'SdsSecretName', ], ], ], 'TlsValidationContextTrust' => [ 'type' => 'structure', 'members' => [ 'acm' => [ 'shape' => 'TlsValidationContextAcmTrust', ], 'file' => [ 'shape' => 'TlsValidationContextFileTrust', ], 'sds' => [ 'shape' => 'TlsValidationContextSdsTrust', ], ], 'union' => true, ], 'TooManyRequestsException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 429, 'senderFault' => true, ], 'exception' => true, 'retryable' => [ 'throttling' => true, ], ], 'TooManyTagsException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'UntagResourceInput' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tagKeys', ], 'members' => [ 'resourceArn' => [ 'shape' => 'Arn', 'location' => 'querystring', 'locationName' => 'resourceArn', ], 'tagKeys' => [ 'shape' => 'TagKeyList', ], ], ], 'UntagResourceOutput' => [ 'type' => 'structure', 'members' => [], ], 'UpdateGatewayRouteInput' => [ 'type' => 'structure', 'required' => [ 'gatewayRouteName', 'meshName', 'spec', 'virtualGatewayName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'gatewayRouteName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'gatewayRouteName', ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'spec' => [ 'shape' => 'GatewayRouteSpec', ], 'virtualGatewayName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualGatewayName', ], ], ], 'UpdateGatewayRouteOutput' => [ 'type' => 'structure', 'required' => [ 'gatewayRoute', ], 'members' => [ 'gatewayRoute' => [ 'shape' => 'GatewayRouteData', ], ], 'payload' => 'gatewayRoute', ], 'UpdateMeshInput' => [ 'type' => 'structure', 'required' => [ 'meshName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'spec' => [ 'shape' => 'MeshSpec', ], ], ], 'UpdateMeshOutput' => [ 'type' => 'structure', 'required' => [ 'mesh', ], 'members' => [ 'mesh' => [ 'shape' => 'MeshData', ], ], 'payload' => 'mesh', ], 'UpdateRouteInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'routeName', 'spec', 'virtualRouterName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'routeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'routeName', ], 'spec' => [ 'shape' => 'RouteSpec', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualRouterName', ], ], ], 'UpdateRouteOutput' => [ 'type' => 'structure', 'required' => [ 'route', ], 'members' => [ 'route' => [ 'shape' => 'RouteData', ], ], 'payload' => 'route', ], 'UpdateVirtualGatewayInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'spec', 'virtualGatewayName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'spec' => [ 'shape' => 'VirtualGatewaySpec', ], 'virtualGatewayName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualGatewayName', ], ], ], 'UpdateVirtualGatewayOutput' => [ 'type' => 'structure', 'required' => [ 'virtualGateway', ], 'members' => [ 'virtualGateway' => [ 'shape' => 'VirtualGatewayData', ], ], 'payload' => 'virtualGateway', ], 'UpdateVirtualNodeInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'spec', 'virtualNodeName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'spec' => [ 'shape' => 'VirtualNodeSpec', ], 'virtualNodeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualNodeName', ], ], ], 'UpdateVirtualNodeOutput' => [ 'type' => 'structure', 'required' => [ 'virtualNode', ], 'members' => [ 'virtualNode' => [ 'shape' => 'VirtualNodeData', ], ], 'payload' => 'virtualNode', ], 'UpdateVirtualRouterInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'spec', 'virtualRouterName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'spec' => [ 'shape' => 'VirtualRouterSpec', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'virtualRouterName', ], ], ], 'UpdateVirtualRouterOutput' => [ 'type' => 'structure', 'required' => [ 'virtualRouter', ], 'members' => [ 'virtualRouter' => [ 'shape' => 'VirtualRouterData', ], ], 'payload' => 'virtualRouter', ], 'UpdateVirtualServiceInput' => [ 'type' => 'structure', 'required' => [ 'meshName', 'spec', 'virtualServiceName', ], 'members' => [ 'clientToken' => [ 'shape' => 'String', 'idempotencyToken' => true, ], 'meshName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'meshName', ], 'meshOwner' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'meshOwner', ], 'spec' => [ 'shape' => 'VirtualServiceSpec', ], 'virtualServiceName' => [ 'shape' => 'ServiceName', 'location' => 'uri', 'locationName' => 'virtualServiceName', ], ], ], 'UpdateVirtualServiceOutput' => [ 'type' => 'structure', 'required' => [ 'virtualService', ], 'members' => [ 'virtualService' => [ 'shape' => 'VirtualServiceData', ], ], 'payload' => 'virtualService', ], 'VirtualGatewayAccessLog' => [ 'type' => 'structure', 'members' => [ 'file' => [ 'shape' => 'VirtualGatewayFileAccessLog', ], ], 'union' => true, ], 'VirtualGatewayBackendDefaults' => [ 'type' => 'structure', 'members' => [ 'clientPolicy' => [ 'shape' => 'VirtualGatewayClientPolicy', ], ], ], 'VirtualGatewayCertificateAuthorityArns' => [ 'type' => 'list', 'member' => [ 'shape' => 'Arn', ], 'max' => 3, 'min' => 1, ], 'VirtualGatewayClientPolicy' => [ 'type' => 'structure', 'members' => [ 'tls' => [ 'shape' => 'VirtualGatewayClientPolicyTls', ], ], ], 'VirtualGatewayClientPolicyTls' => [ 'type' => 'structure', 'required' => [ 'validation', ], 'members' => [ 'certificate' => [ 'shape' => 'VirtualGatewayClientTlsCertificate', ], 'enforce' => [ 'shape' => 'Boolean', 'box' => true, ], 'ports' => [ 'shape' => 'PortSet', ], 'validation' => [ 'shape' => 'VirtualGatewayTlsValidationContext', ], ], ], 'VirtualGatewayClientTlsCertificate' => [ 'type' => 'structure', 'members' => [ 'file' => [ 'shape' => 'VirtualGatewayListenerTlsFileCertificate', ], 'sds' => [ 'shape' => 'VirtualGatewayListenerTlsSdsCertificate', ], ], 'union' => true, ], 'VirtualGatewayConnectionPool' => [ 'type' => 'structure', 'members' => [ 'grpc' => [ 'shape' => 'VirtualGatewayGrpcConnectionPool', ], 'http' => [ 'shape' => 'VirtualGatewayHttpConnectionPool', ], 'http2' => [ 'shape' => 'VirtualGatewayHttp2ConnectionPool', ], ], 'union' => true, ], 'VirtualGatewayData' => [ 'type' => 'structure', 'required' => [ 'meshName', 'metadata', 'spec', 'status', 'virtualGatewayName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', ], 'metadata' => [ 'shape' => 'ResourceMetadata', ], 'spec' => [ 'shape' => 'VirtualGatewaySpec', ], 'status' => [ 'shape' => 'VirtualGatewayStatus', ], 'virtualGatewayName' => [ 'shape' => 'ResourceName', ], ], ], 'VirtualGatewayFileAccessLog' => [ 'type' => 'structure', 'required' => [ 'path', ], 'members' => [ 'format' => [ 'shape' => 'LoggingFormat', ], 'path' => [ 'shape' => 'FilePath', ], ], ], 'VirtualGatewayGrpcConnectionPool' => [ 'type' => 'structure', 'required' => [ 'maxRequests', ], 'members' => [ 'maxRequests' => [ 'shape' => 'MaxRequests', ], ], ], 'VirtualGatewayHealthCheckIntervalMillis' => [ 'type' => 'long', 'box' => true, 'max' => 300000, 'min' => 5000, ], 'VirtualGatewayHealthCheckPolicy' => [ 'type' => 'structure', 'required' => [ 'healthyThreshold', 'intervalMillis', 'protocol', 'timeoutMillis', 'unhealthyThreshold', ], 'members' => [ 'healthyThreshold' => [ 'shape' => 'VirtualGatewayHealthCheckThreshold', ], 'intervalMillis' => [ 'shape' => 'VirtualGatewayHealthCheckIntervalMillis', ], 'path' => [ 'shape' => 'String', ], 'port' => [ 'shape' => 'PortNumber', ], 'protocol' => [ 'shape' => 'VirtualGatewayPortProtocol', ], 'timeoutMillis' => [ 'shape' => 'VirtualGatewayHealthCheckTimeoutMillis', ], 'unhealthyThreshold' => [ 'shape' => 'VirtualGatewayHealthCheckThreshold', ], ], ], 'VirtualGatewayHealthCheckThreshold' => [ 'type' => 'integer', 'max' => 10, 'min' => 2, ], 'VirtualGatewayHealthCheckTimeoutMillis' => [ 'type' => 'long', 'box' => true, 'max' => 60000, 'min' => 2000, ], 'VirtualGatewayHttp2ConnectionPool' => [ 'type' => 'structure', 'required' => [ 'maxRequests', ], 'members' => [ 'maxRequests' => [ 'shape' => 'MaxRequests', ], ], ], 'VirtualGatewayHttpConnectionPool' => [ 'type' => 'structure', 'required' => [ 'maxConnections', ], 'members' => [ 'maxConnections' => [ 'shape' => 'MaxConnections', ], 'maxPendingRequests' => [ 'shape' => 'MaxPendingRequests', 'box' => true, ], ], ], 'VirtualGatewayList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VirtualGatewayRef', ], ], 'VirtualGatewayListener' => [ 'type' => 'structure', 'required' => [ 'portMapping', ], 'members' => [ 'connectionPool' => [ 'shape' => 'VirtualGatewayConnectionPool', ], 'healthCheck' => [ 'shape' => 'VirtualGatewayHealthCheckPolicy', ], 'portMapping' => [ 'shape' => 'VirtualGatewayPortMapping', ], 'tls' => [ 'shape' => 'VirtualGatewayListenerTls', ], ], ], 'VirtualGatewayListenerTls' => [ 'type' => 'structure', 'required' => [ 'certificate', 'mode', ], 'members' => [ 'certificate' => [ 'shape' => 'VirtualGatewayListenerTlsCertificate', ], 'mode' => [ 'shape' => 'VirtualGatewayListenerTlsMode', ], 'validation' => [ 'shape' => 'VirtualGatewayListenerTlsValidationContext', ], ], ], 'VirtualGatewayListenerTlsAcmCertificate' => [ 'type' => 'structure', 'required' => [ 'certificateArn', ], 'members' => [ 'certificateArn' => [ 'shape' => 'Arn', ], ], ], 'VirtualGatewayListenerTlsCertificate' => [ 'type' => 'structure', 'members' => [ 'acm' => [ 'shape' => 'VirtualGatewayListenerTlsAcmCertificate', ], 'file' => [ 'shape' => 'VirtualGatewayListenerTlsFileCertificate', ], 'sds' => [ 'shape' => 'VirtualGatewayListenerTlsSdsCertificate', ], ], 'union' => true, ], 'VirtualGatewayListenerTlsFileCertificate' => [ 'type' => 'structure', 'required' => [ 'certificateChain', 'privateKey', ], 'members' => [ 'certificateChain' => [ 'shape' => 'FilePath', ], 'privateKey' => [ 'shape' => 'FilePath', ], ], ], 'VirtualGatewayListenerTlsMode' => [ 'type' => 'string', 'enum' => [ 'STRICT', 'PERMISSIVE', 'DISABLED', ], ], 'VirtualGatewayListenerTlsSdsCertificate' => [ 'type' => 'structure', 'required' => [ 'secretName', ], 'members' => [ 'secretName' => [ 'shape' => 'VirtualGatewaySdsSecretName', ], ], ], 'VirtualGatewayListenerTlsValidationContext' => [ 'type' => 'structure', 'required' => [ 'trust', ], 'members' => [ 'subjectAlternativeNames' => [ 'shape' => 'SubjectAlternativeNames', ], 'trust' => [ 'shape' => 'VirtualGatewayListenerTlsValidationContextTrust', ], ], ], 'VirtualGatewayListenerTlsValidationContextTrust' => [ 'type' => 'structure', 'members' => [ 'file' => [ 'shape' => 'VirtualGatewayTlsValidationContextFileTrust', ], 'sds' => [ 'shape' => 'VirtualGatewayTlsValidationContextSdsTrust', ], ], 'union' => true, ], 'VirtualGatewayListeners' => [ 'type' => 'list', 'member' => [ 'shape' => 'VirtualGatewayListener', ], ], 'VirtualGatewayLogging' => [ 'type' => 'structure', 'members' => [ 'accessLog' => [ 'shape' => 'VirtualGatewayAccessLog', ], ], ], 'VirtualGatewayPortMapping' => [ 'type' => 'structure', 'required' => [ 'port', 'protocol', ], 'members' => [ 'port' => [ 'shape' => 'PortNumber', ], 'protocol' => [ 'shape' => 'VirtualGatewayPortProtocol', ], ], ], 'VirtualGatewayPortProtocol' => [ 'type' => 'string', 'enum' => [ 'http', 'http2', 'grpc', ], ], 'VirtualGatewayRef' => [ 'type' => 'structure', 'required' => [ 'arn', 'createdAt', 'lastUpdatedAt', 'meshName', 'meshOwner', 'resourceOwner', 'version', 'virtualGatewayName', ], 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'lastUpdatedAt' => [ 'shape' => 'Timestamp', ], 'meshName' => [ 'shape' => 'ResourceName', ], 'meshOwner' => [ 'shape' => 'AccountId', ], 'resourceOwner' => [ 'shape' => 'AccountId', ], 'version' => [ 'shape' => 'Long', ], 'virtualGatewayName' => [ 'shape' => 'ResourceName', ], ], ], 'VirtualGatewaySdsSecretName' => [ 'type' => 'string', ], 'VirtualGatewaySpec' => [ 'type' => 'structure', 'required' => [ 'listeners', ], 'members' => [ 'backendDefaults' => [ 'shape' => 'VirtualGatewayBackendDefaults', ], 'listeners' => [ 'shape' => 'VirtualGatewayListeners', ], 'logging' => [ 'shape' => 'VirtualGatewayLogging', ], ], ], 'VirtualGatewayStatus' => [ 'type' => 'structure', 'required' => [ 'status', ], 'members' => [ 'status' => [ 'shape' => 'VirtualGatewayStatusCode', ], ], ], 'VirtualGatewayStatusCode' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'INACTIVE', 'DELETED', ], ], 'VirtualGatewayTlsValidationContext' => [ 'type' => 'structure', 'required' => [ 'trust', ], 'members' => [ 'subjectAlternativeNames' => [ 'shape' => 'SubjectAlternativeNames', ], 'trust' => [ 'shape' => 'VirtualGatewayTlsValidationContextTrust', ], ], ], 'VirtualGatewayTlsValidationContextAcmTrust' => [ 'type' => 'structure', 'required' => [ 'certificateAuthorityArns', ], 'members' => [ 'certificateAuthorityArns' => [ 'shape' => 'VirtualGatewayCertificateAuthorityArns', ], ], ], 'VirtualGatewayTlsValidationContextFileTrust' => [ 'type' => 'structure', 'required' => [ 'certificateChain', ], 'members' => [ 'certificateChain' => [ 'shape' => 'FilePath', ], ], ], 'VirtualGatewayTlsValidationContextSdsTrust' => [ 'type' => 'structure', 'required' => [ 'secretName', ], 'members' => [ 'secretName' => [ 'shape' => 'VirtualGatewaySdsSecretName', ], ], ], 'VirtualGatewayTlsValidationContextTrust' => [ 'type' => 'structure', 'members' => [ 'acm' => [ 'shape' => 'VirtualGatewayTlsValidationContextAcmTrust', ], 'file' => [ 'shape' => 'VirtualGatewayTlsValidationContextFileTrust', ], 'sds' => [ 'shape' => 'VirtualGatewayTlsValidationContextSdsTrust', ], ], 'union' => true, ], 'VirtualNodeConnectionPool' => [ 'type' => 'structure', 'members' => [ 'grpc' => [ 'shape' => 'VirtualNodeGrpcConnectionPool', ], 'http' => [ 'shape' => 'VirtualNodeHttpConnectionPool', ], 'http2' => [ 'shape' => 'VirtualNodeHttp2ConnectionPool', ], 'tcp' => [ 'shape' => 'VirtualNodeTcpConnectionPool', ], ], 'union' => true, ], 'VirtualNodeData' => [ 'type' => 'structure', 'required' => [ 'meshName', 'metadata', 'spec', 'status', 'virtualNodeName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', ], 'metadata' => [ 'shape' => 'ResourceMetadata', ], 'spec' => [ 'shape' => 'VirtualNodeSpec', ], 'status' => [ 'shape' => 'VirtualNodeStatus', ], 'virtualNodeName' => [ 'shape' => 'ResourceName', ], ], ], 'VirtualNodeGrpcConnectionPool' => [ 'type' => 'structure', 'required' => [ 'maxRequests', ], 'members' => [ 'maxRequests' => [ 'shape' => 'MaxRequests', ], ], ], 'VirtualNodeHttp2ConnectionPool' => [ 'type' => 'structure', 'required' => [ 'maxRequests', ], 'members' => [ 'maxRequests' => [ 'shape' => 'MaxRequests', ], ], ], 'VirtualNodeHttpConnectionPool' => [ 'type' => 'structure', 'required' => [ 'maxConnections', ], 'members' => [ 'maxConnections' => [ 'shape' => 'MaxConnections', ], 'maxPendingRequests' => [ 'shape' => 'MaxPendingRequests', 'box' => true, ], ], ], 'VirtualNodeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VirtualNodeRef', ], ], 'VirtualNodeRef' => [ 'type' => 'structure', 'required' => [ 'arn', 'createdAt', 'lastUpdatedAt', 'meshName', 'meshOwner', 'resourceOwner', 'version', 'virtualNodeName', ], 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'lastUpdatedAt' => [ 'shape' => 'Timestamp', ], 'meshName' => [ 'shape' => 'ResourceName', ], 'meshOwner' => [ 'shape' => 'AccountId', ], 'resourceOwner' => [ 'shape' => 'AccountId', ], 'version' => [ 'shape' => 'Long', ], 'virtualNodeName' => [ 'shape' => 'ResourceName', ], ], ], 'VirtualNodeServiceProvider' => [ 'type' => 'structure', 'required' => [ 'virtualNodeName', ], 'members' => [ 'virtualNodeName' => [ 'shape' => 'ResourceName', ], ], ], 'VirtualNodeSpec' => [ 'type' => 'structure', 'members' => [ 'backendDefaults' => [ 'shape' => 'BackendDefaults', ], 'backends' => [ 'shape' => 'Backends', ], 'listeners' => [ 'shape' => 'Listeners', ], 'logging' => [ 'shape' => 'Logging', ], 'serviceDiscovery' => [ 'shape' => 'ServiceDiscovery', ], ], ], 'VirtualNodeStatus' => [ 'type' => 'structure', 'required' => [ 'status', ], 'members' => [ 'status' => [ 'shape' => 'VirtualNodeStatusCode', ], ], ], 'VirtualNodeStatusCode' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'INACTIVE', 'DELETED', ], ], 'VirtualNodeTcpConnectionPool' => [ 'type' => 'structure', 'required' => [ 'maxConnections', ], 'members' => [ 'maxConnections' => [ 'shape' => 'MaxConnections', ], ], ], 'VirtualRouterData' => [ 'type' => 'structure', 'required' => [ 'meshName', 'metadata', 'spec', 'status', 'virtualRouterName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', ], 'metadata' => [ 'shape' => 'ResourceMetadata', ], 'spec' => [ 'shape' => 'VirtualRouterSpec', ], 'status' => [ 'shape' => 'VirtualRouterStatus', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', ], ], ], 'VirtualRouterList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VirtualRouterRef', ], ], 'VirtualRouterListener' => [ 'type' => 'structure', 'required' => [ 'portMapping', ], 'members' => [ 'portMapping' => [ 'shape' => 'PortMapping', ], ], ], 'VirtualRouterListeners' => [ 'type' => 'list', 'member' => [ 'shape' => 'VirtualRouterListener', ], ], 'VirtualRouterRef' => [ 'type' => 'structure', 'required' => [ 'arn', 'createdAt', 'lastUpdatedAt', 'meshName', 'meshOwner', 'resourceOwner', 'version', 'virtualRouterName', ], 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'lastUpdatedAt' => [ 'shape' => 'Timestamp', ], 'meshName' => [ 'shape' => 'ResourceName', ], 'meshOwner' => [ 'shape' => 'AccountId', ], 'resourceOwner' => [ 'shape' => 'AccountId', ], 'version' => [ 'shape' => 'Long', ], 'virtualRouterName' => [ 'shape' => 'ResourceName', ], ], ], 'VirtualRouterServiceProvider' => [ 'type' => 'structure', 'required' => [ 'virtualRouterName', ], 'members' => [ 'virtualRouterName' => [ 'shape' => 'ResourceName', ], ], ], 'VirtualRouterSpec' => [ 'type' => 'structure', 'members' => [ 'listeners' => [ 'shape' => 'VirtualRouterListeners', ], ], ], 'VirtualRouterStatus' => [ 'type' => 'structure', 'required' => [ 'status', ], 'members' => [ 'status' => [ 'shape' => 'VirtualRouterStatusCode', ], ], ], 'VirtualRouterStatusCode' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'INACTIVE', 'DELETED', ], ], 'VirtualServiceBackend' => [ 'type' => 'structure', 'required' => [ 'virtualServiceName', ], 'members' => [ 'clientPolicy' => [ 'shape' => 'ClientPolicy', ], 'virtualServiceName' => [ 'shape' => 'ServiceName', ], ], ], 'VirtualServiceData' => [ 'type' => 'structure', 'required' => [ 'meshName', 'metadata', 'spec', 'status', 'virtualServiceName', ], 'members' => [ 'meshName' => [ 'shape' => 'ResourceName', ], 'metadata' => [ 'shape' => 'ResourceMetadata', ], 'spec' => [ 'shape' => 'VirtualServiceSpec', ], 'status' => [ 'shape' => 'VirtualServiceStatus', ], 'virtualServiceName' => [ 'shape' => 'ServiceName', ], ], ], 'VirtualServiceList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VirtualServiceRef', ], ], 'VirtualServiceProvider' => [ 'type' => 'structure', 'members' => [ 'virtualNode' => [ 'shape' => 'VirtualNodeServiceProvider', ], 'virtualRouter' => [ 'shape' => 'VirtualRouterServiceProvider', ], ], 'union' => true, ], 'VirtualServiceRef' => [ 'type' => 'structure', 'required' => [ 'arn', 'createdAt', 'lastUpdatedAt', 'meshName', 'meshOwner', 'resourceOwner', 'version', 'virtualServiceName', ], 'members' => [ 'arn' => [ 'shape' => 'Arn', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'lastUpdatedAt' => [ 'shape' => 'Timestamp', ], 'meshName' => [ 'shape' => 'ResourceName', ], 'meshOwner' => [ 'shape' => 'AccountId', ], 'resourceOwner' => [ 'shape' => 'AccountId', ], 'version' => [ 'shape' => 'Long', ], 'virtualServiceName' => [ 'shape' => 'ServiceName', ], ], ], 'VirtualServiceSpec' => [ 'type' => 'structure', 'members' => [ 'provider' => [ 'shape' => 'VirtualServiceProvider', ], ], ], 'VirtualServiceStatus' => [ 'type' => 'structure', 'required' => [ 'status', ], 'members' => [ 'status' => [ 'shape' => 'VirtualServiceStatusCode', ], ], ], 'VirtualServiceStatusCode' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'INACTIVE', 'DELETED', ], ], 'WeightedTarget' => [ 'type' => 'structure', 'required' => [ 'virtualNode', 'weight', ], 'members' => [ 'port' => [ 'shape' => 'ListenerPort', ], 'virtualNode' => [ 'shape' => 'ResourceName', ], 'weight' => [ 'shape' => 'PercentInt', ], ], ], 'WeightedTargets' => [ 'type' => 'list', 'member' => [ 'shape' => 'WeightedTarget', ], 'max' => 10, 'min' => 1, ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appmesh/2019-01-25/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>App Mesh is a service mesh based on the Envoy proxy that makes it easy to monitor and control microservices. App Mesh standardizes how your microservices communicate, giving you end-to-end visibility and helping to ensure high availability for your applications.</p> <p>App Mesh gives you consistent visibility and network traffic controls for every microservice in an application. You can use App Mesh with Amazon Web Services Fargate, Amazon ECS, Amazon EKS, Kubernetes on Amazon Web Services, and Amazon EC2.</p> <note> <p>App Mesh supports microservice applications that use service discovery naming for their components. For more information about service discovery on Amazon ECS, see <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html\">Service Discovery</a> in the <i>Amazon Elastic Container Service Developer Guide</i>. Kubernetes <code>kube-dns</code> and <code>coredns</code> are supported. For more information, see <a href=\"https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/\">DNS for Services and Pods</a> in the Kubernetes documentation.</p> </note>', 'operations' => [ 'CreateGatewayRoute' => '<p>Creates a gateway route.</p> <p>A gateway route is attached to a virtual gateway and routes traffic to an existing virtual service. If a route matches a request, it can distribute traffic to a target virtual service.</p> <p>For more information about gateway routes, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/gateway-routes.html\">Gateway routes</a>.</p>', 'CreateMesh' => '<p>Creates a service mesh.</p> <p> A service mesh is a logical boundary for network traffic between services that are represented by resources within the mesh. After you create your service mesh, you can create virtual services, virtual nodes, virtual routers, and routes to distribute traffic between the applications in your mesh.</p> <p>For more information about service meshes, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/meshes.html\">Service meshes</a>.</p>', 'CreateRoute' => '<p>Creates a route that is associated with a virtual router.</p> <p> You can route several different protocols and define a retry policy for a route. Traffic can be routed to one or more virtual nodes.</p> <p>For more information about routes, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/routes.html\">Routes</a>.</p>', 'CreateVirtualGateway' => '<p>Creates a virtual gateway.</p> <p>A virtual gateway allows resources outside your mesh to communicate to resources that are inside your mesh. The virtual gateway represents an Envoy proxy running in an Amazon ECS task, in a Kubernetes service, or on an Amazon EC2 instance. Unlike a virtual node, which represents an Envoy running with an application, a virtual gateway represents Envoy deployed by itself.</p> <p>For more information about virtual gateways, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_gateways.html\">Virtual gateways</a>. </p>', 'CreateVirtualNode' => '<p>Creates a virtual node within a service mesh.</p> <p> A virtual node acts as a logical pointer to a particular task group, such as an Amazon ECS service or a Kubernetes deployment. When you create a virtual node, you can specify the service discovery information for your task group, and whether the proxy running in a task group will communicate with other proxies using Transport Layer Security (TLS).</p> <p>You define a <code>listener</code> for any inbound traffic that your virtual node expects. Any virtual service that your virtual node expects to communicate to is specified as a <code>backend</code>.</p> <p>The response metadata for your new virtual node contains the <code>arn</code> that is associated with the virtual node. Set this value to the full ARN; for example, <code>arn:aws:appmesh:us-west-2:123456789012:myMesh/default/virtualNode/myApp</code>) as the <code>APPMESH_RESOURCE_ARN</code> environment variable for your task group\\'s Envoy proxy container in your task definition or pod spec. This is then mapped to the <code>node.id</code> and <code>node.cluster</code> Envoy parameters.</p> <note> <p>By default, App Mesh uses the name of the resource you specified in <code>APPMESH_RESOURCE_ARN</code> when Envoy is referring to itself in metrics and traces. You can override this behavior by setting the <code>APPMESH_RESOURCE_CLUSTER</code> environment variable with your own name.</p> </note> <p>For more information about virtual nodes, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_nodes.html\">Virtual nodes</a>. You must be using <code>1.15.0</code> or later of the Envoy image when setting these variables. For more information aboutApp Mesh Envoy variables, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/envoy.html\">Envoy image</a> in the App Mesh User Guide.</p>', 'CreateVirtualRouter' => '<p>Creates a virtual router within a service mesh.</p> <p>Specify a <code>listener</code> for any inbound traffic that your virtual router receives. Create a virtual router for each protocol and port that you need to route. Virtual routers handle traffic for one or more virtual services within your mesh. After you create your virtual router, create and associate routes for your virtual router that direct incoming requests to different virtual nodes.</p> <p>For more information about virtual routers, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_routers.html\">Virtual routers</a>.</p>', 'CreateVirtualService' => '<p>Creates a virtual service within a service mesh.</p> <p>A virtual service is an abstraction of a real service that is provided by a virtual node directly or indirectly by means of a virtual router. Dependent services call your virtual service by its <code>virtualServiceName</code>, and those requests are routed to the virtual node or virtual router that is specified as the provider for the virtual service.</p> <p>For more information about virtual services, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_services.html\">Virtual services</a>.</p>', 'DeleteGatewayRoute' => '<p>Deletes an existing gateway route.</p>', 'DeleteMesh' => '<p>Deletes an existing service mesh.</p> <p>You must delete all resources (virtual services, routes, virtual routers, and virtual nodes) in the service mesh before you can delete the mesh itself.</p>', 'DeleteRoute' => '<p>Deletes an existing route.</p>', 'DeleteVirtualGateway' => '<p>Deletes an existing virtual gateway. You cannot delete a virtual gateway if any gateway routes are associated to it.</p>', 'DeleteVirtualNode' => '<p>Deletes an existing virtual node.</p> <p>You must delete any virtual services that list a virtual node as a service provider before you can delete the virtual node itself.</p>', 'DeleteVirtualRouter' => '<p>Deletes an existing virtual router.</p> <p>You must delete any routes associated with the virtual router before you can delete the router itself.</p>', 'DeleteVirtualService' => '<p>Deletes an existing virtual service.</p>', 'DescribeGatewayRoute' => '<p>Describes an existing gateway route.</p>', 'DescribeMesh' => '<p>Describes an existing service mesh.</p>', 'DescribeRoute' => '<p>Describes an existing route.</p>', 'DescribeVirtualGateway' => '<p>Describes an existing virtual gateway.</p>', 'DescribeVirtualNode' => '<p>Describes an existing virtual node.</p>', 'DescribeVirtualRouter' => '<p>Describes an existing virtual router.</p>', 'DescribeVirtualService' => '<p>Describes an existing virtual service.</p>', 'ListGatewayRoutes' => '<p>Returns a list of existing gateway routes that are associated to a virtual gateway.</p>', 'ListMeshes' => '<p>Returns a list of existing service meshes.</p>', 'ListRoutes' => '<p>Returns a list of existing routes in a service mesh.</p>', 'ListTagsForResource' => '<p>List the tags for an App Mesh resource.</p>', 'ListVirtualGateways' => '<p>Returns a list of existing virtual gateways in a service mesh.</p>', 'ListVirtualNodes' => '<p>Returns a list of existing virtual nodes.</p>', 'ListVirtualRouters' => '<p>Returns a list of existing virtual routers in a service mesh.</p>', 'ListVirtualServices' => '<p>Returns a list of existing virtual services in a service mesh.</p>', 'TagResource' => '<p>Associates the specified tags to a resource with the specified <code>resourceArn</code>. If existing tags on a resource aren\\'t specified in the request parameters, they aren\\'t changed. When a resource is deleted, the tags associated with that resource are also deleted.</p>', 'UntagResource' => '<p>Deletes specified tags from a resource.</p>', 'UpdateGatewayRoute' => '<p>Updates an existing gateway route that is associated to a specified virtual gateway in a service mesh.</p>', 'UpdateMesh' => '<p>Updates an existing service mesh.</p>', 'UpdateRoute' => '<p>Updates an existing route for a specified service mesh and virtual router.</p>', 'UpdateVirtualGateway' => '<p>Updates an existing virtual gateway in a specified service mesh.</p>', 'UpdateVirtualNode' => '<p>Updates an existing virtual node in a specified service mesh.</p>', 'UpdateVirtualRouter' => '<p>Updates an existing virtual router in a specified service mesh.</p>', 'UpdateVirtualService' => '<p>Updates an existing virtual service in a specified service mesh.</p>', ], 'shapes' => [ 'AccessLog' => [ 'base' => '<p>An object that represents the access logging information for a virtual node.</p>', 'refs' => [ 'Logging$accessLog' => '<p>The access log configuration for a virtual node.</p>', ], ], 'AccountId' => [ 'base' => NULL, 'refs' => [ 'CreateGatewayRouteInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'CreateRouteInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'CreateVirtualGatewayInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'CreateVirtualNodeInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'CreateVirtualRouterInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'CreateVirtualServiceInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'DeleteGatewayRouteInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'DeleteRouteInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'DeleteVirtualGatewayInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'DeleteVirtualNodeInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'DeleteVirtualRouterInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'DeleteVirtualServiceInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'DescribeGatewayRouteInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'DescribeMeshInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'DescribeRouteInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'DescribeVirtualGatewayInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'DescribeVirtualNodeInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'DescribeVirtualRouterInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'DescribeVirtualServiceInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'GatewayRouteRef$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'GatewayRouteRef$resourceOwner' => '<p>The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it\\'s the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'ListGatewayRoutesInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'ListRoutesInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'ListVirtualGatewaysInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'ListVirtualNodesInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'ListVirtualRoutersInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'ListVirtualServicesInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'MeshRef$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'MeshRef$resourceOwner' => '<p>The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it\\'s the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'ResourceMetadata$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'ResourceMetadata$resourceOwner' => '<p>The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it\\'s the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'RouteRef$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'RouteRef$resourceOwner' => '<p>The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it\\'s the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'UpdateGatewayRouteInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'UpdateRouteInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'UpdateVirtualGatewayInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'UpdateVirtualNodeInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'UpdateVirtualRouterInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'UpdateVirtualServiceInput$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'VirtualGatewayRef$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'VirtualGatewayRef$resourceOwner' => '<p>The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it\\'s the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'VirtualNodeRef$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'VirtualNodeRef$resourceOwner' => '<p>The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it\\'s the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'VirtualRouterRef$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'VirtualRouterRef$resourceOwner' => '<p>The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it\\'s the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'VirtualServiceRef$meshOwner' => '<p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it\\'s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', 'VirtualServiceRef$resourceOwner' => '<p>The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it\\'s the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html\">Working with shared meshes</a>.</p>', ], ], 'Arn' => [ 'base' => NULL, 'refs' => [ 'CertificateAuthorityArns$member' => NULL, 'GatewayRouteRef$arn' => '<p>The full Amazon Resource Name (ARN) for the gateway route.</p>', 'ListTagsForResourceInput$resourceArn' => '<p>The Amazon Resource Name (ARN) that identifies the resource to list the tags for.</p>', 'ListenerTlsAcmCertificate$certificateArn' => '<p>The Amazon Resource Name (ARN) for the certificate. The certificate must meet specific requirements and you must have proxy authorization enabled. For more information, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/tls.html#virtual-node-tls-prerequisites\">Transport Layer Security (TLS)</a>.</p>', 'MeshRef$arn' => '<p>The full Amazon Resource Name (ARN) of the service mesh.</p>', 'ResourceMetadata$arn' => '<p>The full Amazon Resource Name (ARN) for the resource.</p>', 'RouteRef$arn' => '<p>The full Amazon Resource Name (ARN) for the route.</p>', 'TagResourceInput$resourceArn' => '<p>The Amazon Resource Name (ARN) of the resource to add tags to.</p>', 'UntagResourceInput$resourceArn' => '<p>The Amazon Resource Name (ARN) of the resource to delete tags from.</p>', 'VirtualGatewayCertificateAuthorityArns$member' => NULL, 'VirtualGatewayListenerTlsAcmCertificate$certificateArn' => '<p>The Amazon Resource Name (ARN) for the certificate. The certificate must meet specific requirements and you must have proxy authorization enabled. For more information, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/tls.html#virtual-node-tls-prerequisites\">Transport Layer Security (TLS)</a>.</p>', 'VirtualGatewayRef$arn' => '<p>The full Amazon Resource Name (ARN) for the resource.</p>', 'VirtualNodeRef$arn' => '<p>The full Amazon Resource Name (ARN) for the virtual node.</p>', 'VirtualRouterRef$arn' => '<p>The full Amazon Resource Name (ARN) for the virtual router.</p>', 'VirtualServiceRef$arn' => '<p>The full Amazon Resource Name (ARN) for the virtual service.</p>', ], ], 'AwsCloudMapInstanceAttribute' => [ 'base' => '<p>An object that represents the Cloud Map attribute information for your virtual node.</p> <note> <p>Cloud Map is not available in the eu-south-1 Region.</p> </note>', 'refs' => [ 'AwsCloudMapInstanceAttributes$member' => NULL, ], ], 'AwsCloudMapInstanceAttributeKey' => [ 'base' => NULL, 'refs' => [ 'AwsCloudMapInstanceAttribute$key' => '<p>The name of an Cloud Map service instance attribute key. Any Cloud Map service instance that contains the specified key and value is returned.</p>', ], ], 'AwsCloudMapInstanceAttributeValue' => [ 'base' => NULL, 'refs' => [ 'AwsCloudMapInstanceAttribute$value' => '<p>The value of an Cloud Map service instance attribute key. Any Cloud Map service instance that contains the specified key and value is returned.</p>', ], ], 'AwsCloudMapInstanceAttributes' => [ 'base' => NULL, 'refs' => [ 'AwsCloudMapServiceDiscovery$attributes' => '<p>A string map that contains attributes with values that you can use to filter instances by any custom attribute that you specified when you registered the instance. Only instances that match all of the specified key/value pairs will be returned.</p>', ], ], 'AwsCloudMapName' => [ 'base' => NULL, 'refs' => [ 'AwsCloudMapServiceDiscovery$namespaceName' => '<p>The name of the Cloud Map namespace to use.</p>', 'AwsCloudMapServiceDiscovery$serviceName' => '<p>The name of the Cloud Map service to use.</p>', ], ], 'AwsCloudMapServiceDiscovery' => [ 'base' => '<p>An object that represents the Cloud Map service discovery information for your virtual node.</p> <note> <p>Cloud Map is not available in the eu-south-1 Region.</p> </note>', 'refs' => [ 'ServiceDiscovery$awsCloudMap' => '<p>Specifies any Cloud Map information for the virtual node.</p>', ], ], 'Backend' => [ 'base' => '<p>An object that represents the backends that a virtual node is expected to send outbound traffic to.</p>', 'refs' => [ 'Backends$member' => NULL, ], ], 'BackendDefaults' => [ 'base' => '<p>An object that represents the default properties for a backend.</p>', 'refs' => [ 'VirtualNodeSpec$backendDefaults' => '<p>A reference to an object that represents the defaults for backends.</p>', ], ], 'Backends' => [ 'base' => NULL, 'refs' => [ 'VirtualNodeSpec$backends' => '<p>The backends that the virtual node is expected to send outbound traffic to.</p>', ], ], 'BadRequestException' => [ 'base' => '<p>The request syntax was malformed. Check your request syntax and try again.</p>', 'refs' => [], ], 'Boolean' => [ 'base' => NULL, 'refs' => [ 'ClientPolicyTls$enforce' => '<p>Whether the policy is enforced. The default is <code>True</code>, if a value isn\\'t specified.</p>', 'GrpcGatewayRouteMetadata$invert' => '<p>Specify <code>True</code> to match anything except the match criteria. The default value is <code>False</code>.</p>', 'GrpcRouteMetadata$invert' => '<p>Specify <code>True</code> to match anything except the match criteria. The default value is <code>False</code>.</p>', 'HttpGatewayRouteHeader$invert' => '<p>Specify <code>True</code> to match anything except the match criteria. The default value is <code>False</code>.</p>', 'HttpRouteHeader$invert' => '<p>Specify <code>True</code> to match anything except the match criteria. The default value is <code>False</code>.</p>', 'VirtualGatewayClientPolicyTls$enforce' => '<p>Whether the policy is enforced. The default is <code>True</code>, if a value isn\\'t specified.</p>', ], ], 'CertificateAuthorityArns' => [ 'base' => NULL, 'refs' => [ 'TlsValidationContextAcmTrust$certificateAuthorityArns' => '<p>One or more ACM Amazon Resource Name (ARN)s.</p>', ], ], 'ClientPolicy' => [ 'base' => '<p>An object that represents a client policy.</p>', 'refs' => [ 'BackendDefaults$clientPolicy' => '<p>A reference to an object that represents a client policy.</p>', 'VirtualServiceBackend$clientPolicy' => '<p>A reference to an object that represents the client policy for a backend.</p>', ], ], 'ClientPolicyTls' => [ 'base' => '<p>A reference to an object that represents a Transport Layer Security (TLS) client policy.</p>', 'refs' => [ 'ClientPolicy$tls' => '<p>A reference to an object that represents a Transport Layer Security (TLS) client policy.</p>', ], ], 'ClientTlsCertificate' => [ 'base' => '<p>An object that represents the client\\'s certificate.</p>', 'refs' => [ 'ClientPolicyTls$certificate' => '<p>A reference to an object that represents a client\\'s TLS certificate.</p>', ], ], 'ConflictException' => [ 'base' => '<p>The request contains a client token that was used for a previous update resource call with different specifications. Try the request again with a new client token.</p>', 'refs' => [], ], 'CreateGatewayRouteInput' => [ 'base' => NULL, 'refs' => [], ], 'CreateGatewayRouteOutput' => [ 'base' => NULL, 'refs' => [], ], 'CreateMeshInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'CreateMeshOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'CreateRouteInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'CreateRouteOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'CreateVirtualGatewayInput' => [ 'base' => NULL, 'refs' => [], ], 'CreateVirtualGatewayOutput' => [ 'base' => NULL, 'refs' => [], ], 'CreateVirtualNodeInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'CreateVirtualNodeOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'CreateVirtualRouterInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'CreateVirtualRouterOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'CreateVirtualServiceInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'CreateVirtualServiceOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DefaultGatewayRouteRewrite' => [ 'base' => NULL, 'refs' => [ 'GatewayRouteHostnameRewrite$defaultTargetHostname' => '<p>The default target host name to write to.</p>', 'HttpGatewayRoutePrefixRewrite$defaultPrefix' => '<p>The default prefix used to replace the incoming route prefix when rewritten.</p>', ], ], 'DeleteGatewayRouteInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteGatewayRouteOutput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteMeshInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DeleteMeshOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DeleteRouteInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DeleteRouteOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DeleteVirtualGatewayInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteVirtualGatewayOutput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteVirtualNodeInput' => [ 'base' => '<p>Deletes a virtual node input.</p>', 'refs' => [], ], 'DeleteVirtualNodeOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DeleteVirtualRouterInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DeleteVirtualRouterOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DeleteVirtualServiceInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DeleteVirtualServiceOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DescribeGatewayRouteInput' => [ 'base' => NULL, 'refs' => [], ], 'DescribeGatewayRouteOutput' => [ 'base' => NULL, 'refs' => [], ], 'DescribeMeshInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DescribeMeshOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DescribeRouteInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DescribeRouteOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DescribeVirtualGatewayInput' => [ 'base' => NULL, 'refs' => [], ], 'DescribeVirtualGatewayOutput' => [ 'base' => NULL, 'refs' => [], ], 'DescribeVirtualNodeInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DescribeVirtualNodeOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DescribeVirtualRouterInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DescribeVirtualRouterOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DescribeVirtualServiceInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DescribeVirtualServiceOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'DnsResponseType' => [ 'base' => NULL, 'refs' => [ 'DnsServiceDiscovery$responseType' => '<p>Specifies the DNS response type for the virtual node.</p>', ], ], 'DnsServiceDiscovery' => [ 'base' => '<p>An object that represents the DNS service discovery information for your virtual node.</p>', 'refs' => [ 'ServiceDiscovery$dns' => '<p>Specifies the DNS information for the virtual node.</p>', ], ], 'Duration' => [ 'base' => '<p>An object that represents a duration of time.</p>', 'refs' => [ 'GrpcRetryPolicy$perRetryTimeout' => '<p>The timeout for each retry attempt.</p>', 'GrpcTimeout$idle' => '<p>An object that represents an idle timeout. An idle timeout bounds the amount of time that a connection may be idle. The default value is none.</p>', 'GrpcTimeout$perRequest' => '<p>An object that represents a per request timeout. The default value is 15 seconds. If you set a higher timeout, then make sure that the higher value is set for each App Mesh resource in a conversation. For example, if a virtual node backend uses a virtual router provider to route to another virtual node, then the timeout should be greater than 15 seconds for the source and destination virtual node and the route.</p>', 'HttpRetryPolicy$perRetryTimeout' => '<p>The timeout for each retry attempt.</p>', 'HttpTimeout$idle' => '<p>An object that represents an idle timeout. An idle timeout bounds the amount of time that a connection may be idle. The default value is none.</p>', 'HttpTimeout$perRequest' => '<p>An object that represents a per request timeout. The default value is 15 seconds. If you set a higher timeout, then make sure that the higher value is set for each App Mesh resource in a conversation. For example, if a virtual node backend uses a virtual router provider to route to another virtual node, then the timeout should be greater than 15 seconds for the source and destination virtual node and the route.</p>', 'OutlierDetection$baseEjectionDuration' => '<p>The base amount of time for which a host is ejected.</p>', 'OutlierDetection$interval' => '<p>The time interval between ejection sweep analysis.</p>', 'TcpTimeout$idle' => '<p>An object that represents an idle timeout. An idle timeout bounds the amount of time that a connection may be idle. The default value is none.</p>', ], ], 'DurationUnit' => [ 'base' => NULL, 'refs' => [ 'Duration$unit' => '<p>A unit of time.</p>', ], ], 'DurationValue' => [ 'base' => NULL, 'refs' => [ 'Duration$value' => '<p>A number of time units.</p>', ], ], 'EgressFilter' => [ 'base' => '<p>An object that represents the egress filter rules for a service mesh.</p>', 'refs' => [ 'MeshSpec$egressFilter' => '<p>The egress filter rules for the service mesh.</p>', ], ], 'EgressFilterType' => [ 'base' => NULL, 'refs' => [ 'EgressFilter$type' => '<p>The egress filter type. By default, the type is <code>DROP_ALL</code>, which allows egress only from virtual nodes to other defined resources in the service mesh (and any traffic to <code>*.amazonaws.com</code> for Amazon Web Services API calls). You can set the egress filter type to <code>ALLOW_ALL</code> to allow egress to any endpoint inside or outside of the service mesh.</p>', ], ], 'ExactHostName' => [ 'base' => NULL, 'refs' => [ 'GatewayRouteHostnameMatch$exact' => '<p>The exact host name to match on.</p>', ], ], 'FileAccessLog' => [ 'base' => '<p>An object that represents an access log file.</p>', 'refs' => [ 'AccessLog$file' => '<p>The file object to send virtual node access logs to.</p>', ], ], 'FilePath' => [ 'base' => NULL, 'refs' => [ 'FileAccessLog$path' => '<p>The file path to write access logs to. You can use <code>/dev/stdout</code> to send access logs to standard out and configure your Envoy container to use a log driver, such as <code>awslogs</code>, to export the access logs to a log storage service such as Amazon CloudWatch Logs. You can also specify a path in the Envoy container\\'s file system to write the files to disk.</p> <pre><code> &lt;note&gt; &lt;p&gt;The Envoy process must have write permissions to the path that you specify here. Otherwise, Envoy fails to bootstrap properly.&lt;/p&gt; &lt;/note&gt; </code></pre>', 'ListenerTlsFileCertificate$certificateChain' => '<p>The certificate chain for the certificate.</p>', 'ListenerTlsFileCertificate$privateKey' => '<p>The private key for a certificate stored on the file system of the virtual node that the proxy is running on.</p>', 'TlsValidationContextFileTrust$certificateChain' => '<p>The certificate trust chain for a certificate stored on the file system of the virtual node that the proxy is running on.</p>', 'VirtualGatewayFileAccessLog$path' => '<p>The file path to write access logs to. You can use <code>/dev/stdout</code> to send access logs to standard out and configure your Envoy container to use a log driver, such as <code>awslogs</code>, to export the access logs to a log storage service such as Amazon CloudWatch Logs. You can also specify a path in the Envoy container\\'s file system to write the files to disk.</p>', 'VirtualGatewayListenerTlsFileCertificate$certificateChain' => '<p>The certificate chain for the certificate.</p>', 'VirtualGatewayListenerTlsFileCertificate$privateKey' => '<p>The private key for a certificate stored on the file system of the mesh endpoint that the proxy is running on.</p>', 'VirtualGatewayTlsValidationContextFileTrust$certificateChain' => '<p>The certificate trust chain for a certificate stored on the file system of the virtual node that the proxy is running on.</p>', ], ], 'ForbiddenException' => [ 'base' => '<p>You don\\'t have permissions to perform this action.</p>', 'refs' => [], ], 'GatewayRouteData' => [ 'base' => '<p>An object that represents a gateway route returned by a describe operation.</p>', 'refs' => [ 'CreateGatewayRouteOutput$gatewayRoute' => '<p>The full description of your gateway route following the create call.</p>', 'DeleteGatewayRouteOutput$gatewayRoute' => '<p>The gateway route that was deleted.</p>', 'DescribeGatewayRouteOutput$gatewayRoute' => '<p>The full description of your gateway route.</p>', 'UpdateGatewayRouteOutput$gatewayRoute' => '<p>A full description of the gateway route that was updated.</p>', ], ], 'GatewayRouteHostnameMatch' => [ 'base' => '<p>An object representing the gateway route host name to match.</p>', 'refs' => [ 'GrpcGatewayRouteMatch$hostname' => '<p>The gateway route host name to be matched on.</p>', 'HttpGatewayRouteMatch$hostname' => '<p>The host name to match on.</p>', ], ], 'GatewayRouteHostnameRewrite' => [ 'base' => '<p>An object representing the gateway route host name to rewrite.</p>', 'refs' => [ 'GrpcGatewayRouteRewrite$hostname' => '<p>The host name of the gateway route to rewrite.</p>', 'HttpGatewayRouteRewrite$hostname' => '<p>The host name to rewrite.</p>', ], ], 'GatewayRouteList' => [ 'base' => NULL, 'refs' => [ 'ListGatewayRoutesOutput$gatewayRoutes' => '<p>The list of existing gateway routes for the specified service mesh and virtual gateway.</p>', ], ], 'GatewayRoutePriority' => [ 'base' => NULL, 'refs' => [ 'GatewayRouteSpec$priority' => '<p>The ordering of the gateway routes spec.</p>', ], ], 'GatewayRouteRef' => [ 'base' => '<p>An object that represents a gateway route returned by a list operation.</p>', 'refs' => [ 'GatewayRouteList$member' => NULL, ], ], 'GatewayRouteSpec' => [ 'base' => '<p>An object that represents a gateway route specification. Specify one gateway route type.</p>', 'refs' => [ 'CreateGatewayRouteInput$spec' => '<p>The gateway route specification to apply.</p>', 'GatewayRouteData$spec' => '<p>The specifications of the gateway route.</p>', 'UpdateGatewayRouteInput$spec' => '<p>The new gateway route specification to apply. This overwrites the existing data.</p>', ], ], 'GatewayRouteStatus' => [ 'base' => '<p>An object that represents the current status of a gateway route.</p>', 'refs' => [ 'GatewayRouteData$status' => '<p>The status of the gateway route.</p>', ], ], 'GatewayRouteStatusCode' => [ 'base' => NULL, 'refs' => [ 'GatewayRouteStatus$status' => '<p>The current status for the gateway route.</p>', ], ], 'GatewayRouteTarget' => [ 'base' => '<p>An object that represents a gateway route target.</p>', 'refs' => [ 'GrpcGatewayRouteAction$target' => '<p>An object that represents the target that traffic is routed to when a request matches the gateway route.</p>', 'HttpGatewayRouteAction$target' => '<p>An object that represents the target that traffic is routed to when a request matches the gateway route.</p>', ], ], 'GatewayRouteVirtualService' => [ 'base' => '<p>An object that represents the virtual service that traffic is routed to.</p>', 'refs' => [ 'GatewayRouteTarget$virtualService' => '<p>An object that represents a virtual service gateway route target.</p>', ], ], 'GrpcGatewayRoute' => [ 'base' => '<p>An object that represents a gRPC gateway route.</p>', 'refs' => [ 'GatewayRouteSpec$grpcRoute' => '<p>An object that represents the specification of a gRPC gateway route.</p>', ], ], 'GrpcGatewayRouteAction' => [ 'base' => '<p>An object that represents the action to take if a match is determined.</p>', 'refs' => [ 'GrpcGatewayRoute$action' => '<p>An object that represents the action to take if a match is determined.</p>', ], ], 'GrpcGatewayRouteMatch' => [ 'base' => '<p>An object that represents the criteria for determining a request match.</p>', 'refs' => [ 'GrpcGatewayRoute$match' => '<p>An object that represents the criteria for determining a request match.</p>', ], ], 'GrpcGatewayRouteMetadata' => [ 'base' => '<p>An object representing the metadata of the gateway route.</p>', 'refs' => [ 'GrpcGatewayRouteMetadataList$member' => NULL, ], ], 'GrpcGatewayRouteMetadataList' => [ 'base' => NULL, 'refs' => [ 'GrpcGatewayRouteMatch$metadata' => '<p>The gateway route metadata to be matched on.</p>', ], ], 'GrpcGatewayRouteRewrite' => [ 'base' => '<p>An object that represents the gateway route to rewrite.</p>', 'refs' => [ 'GrpcGatewayRouteAction$rewrite' => '<p>The gateway route action to rewrite.</p>', ], ], 'GrpcMetadataMatchMethod' => [ 'base' => '<p>An object representing the method header to be matched.</p>', 'refs' => [ 'GrpcGatewayRouteMetadata$match' => '<p>The criteria for determining a metadata match.</p>', ], ], 'GrpcRetryPolicy' => [ 'base' => '<p>An object that represents a retry policy. Specify at least one value for at least one of the types of <code>RetryEvents</code>, a value for <code>maxRetries</code>, and a value for <code>perRetryTimeout</code>. Both <code>server-error</code> and <code>gateway-error</code> under <code>httpRetryEvents</code> include the Envoy <code>reset</code> policy. For more information on the <code>reset</code> policy, see the <a href=\"https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/router_filter#x-envoy-retry-on\">Envoy documentation</a>.</p>', 'refs' => [ 'GrpcRoute$retryPolicy' => '<p>An object that represents a retry policy.</p>', ], ], 'GrpcRetryPolicyEvent' => [ 'base' => NULL, 'refs' => [ 'GrpcRetryPolicyEvents$member' => NULL, ], ], 'GrpcRetryPolicyEvents' => [ 'base' => NULL, 'refs' => [ 'GrpcRetryPolicy$grpcRetryEvents' => '<p>Specify at least one of the valid values.</p>', ], ], 'GrpcRoute' => [ 'base' => '<p>An object that represents a gRPC route type.</p>', 'refs' => [ 'RouteSpec$grpcRoute' => '<p>An object that represents the specification of a gRPC route.</p>', ], ], 'GrpcRouteAction' => [ 'base' => '<p>An object that represents the action to take if a match is determined.</p>', 'refs' => [ 'GrpcRoute$action' => '<p>An object that represents the action to take if a match is determined.</p>', ], ], 'GrpcRouteMatch' => [ 'base' => '<p>An object that represents the criteria for determining a request match.</p>', 'refs' => [ 'GrpcRoute$match' => '<p>An object that represents the criteria for determining a request match.</p>', ], ], 'GrpcRouteMetadata' => [ 'base' => '<p>An object that represents the match metadata for the route.</p>', 'refs' => [ 'GrpcRouteMetadataList$member' => NULL, ], ], 'GrpcRouteMetadataList' => [ 'base' => NULL, 'refs' => [ 'GrpcRouteMatch$metadata' => '<p>An object that represents the data to match from the request.</p>', ], ], 'GrpcRouteMetadataMatchMethod' => [ 'base' => '<p>An object that represents the match method. Specify one of the match values.</p>', 'refs' => [ 'GrpcRouteMetadata$match' => '<p>An object that represents the data to match from the request.</p>', ], ], 'GrpcTimeout' => [ 'base' => '<p>An object that represents types of timeouts. </p>', 'refs' => [ 'GrpcRoute$timeout' => '<p>An object that represents types of timeouts. </p>', 'ListenerTimeout$grpc' => '<p>An object that represents types of timeouts. </p>', ], ], 'HeaderMatch' => [ 'base' => NULL, 'refs' => [ 'GrpcMetadataMatchMethod$exact' => '<p>The exact method header to be matched on.</p>', 'GrpcMetadataMatchMethod$prefix' => '<p>The specified beginning characters of the method header to be matched on.</p>', 'GrpcMetadataMatchMethod$regex' => '<p>The regex used to match the method header.</p>', 'GrpcMetadataMatchMethod$suffix' => '<p>The specified ending characters of the method header to match on.</p>', 'GrpcRouteMetadataMatchMethod$exact' => '<p>The value sent by the client must match the specified value exactly.</p>', 'GrpcRouteMetadataMatchMethod$prefix' => '<p>The value sent by the client must begin with the specified characters.</p>', 'GrpcRouteMetadataMatchMethod$regex' => '<p>The value sent by the client must include the specified characters.</p>', 'GrpcRouteMetadataMatchMethod$suffix' => '<p>The value sent by the client must end with the specified characters.</p>', 'HeaderMatchMethod$exact' => '<p>The value sent by the client must match the specified value exactly.</p>', 'HeaderMatchMethod$prefix' => '<p>The value sent by the client must begin with the specified characters.</p>', 'HeaderMatchMethod$regex' => '<p>The value sent by the client must include the specified characters.</p>', 'HeaderMatchMethod$suffix' => '<p>The value sent by the client must end with the specified characters.</p>', ], ], 'HeaderMatchMethod' => [ 'base' => '<p>An object that represents the method and value to match with the header value sent in a request. Specify one match method.</p>', 'refs' => [ 'HttpGatewayRouteHeader$match' => '<p>An object that represents the method and value to match with the header value sent in a request. Specify one match method.</p>', 'HttpRouteHeader$match' => '<p>The <code>HeaderMatchMethod</code> object.</p>', ], ], 'HeaderName' => [ 'base' => NULL, 'refs' => [ 'GrpcGatewayRouteMetadata$name' => '<p>A name for the gateway route metadata.</p>', 'GrpcRouteMetadata$name' => '<p>The name of the route.</p>', 'HttpGatewayRouteHeader$name' => '<p>A name for the HTTP header in the gateway route that will be matched on.</p>', 'HttpRouteHeader$name' => '<p>A name for the HTTP header in the client request that will be matched on.</p>', ], ], 'HealthCheckIntervalMillis' => [ 'base' => NULL, 'refs' => [ 'HealthCheckPolicy$intervalMillis' => '<p>The time period in milliseconds between each health check execution.</p>', ], ], 'HealthCheckPolicy' => [ 'base' => '<p>An object that represents the health check policy for a virtual node\\'s listener.</p>', 'refs' => [ 'Listener$healthCheck' => '<p>The health check information for the listener.</p>', ], ], 'HealthCheckThreshold' => [ 'base' => NULL, 'refs' => [ 'HealthCheckPolicy$healthyThreshold' => '<p>The number of consecutive successful health checks that must occur before declaring listener healthy.</p>', 'HealthCheckPolicy$unhealthyThreshold' => '<p>The number of consecutive failed health checks that must occur before declaring a virtual node unhealthy. </p>', ], ], 'HealthCheckTimeoutMillis' => [ 'base' => NULL, 'refs' => [ 'HealthCheckPolicy$timeoutMillis' => '<p>The amount of time to wait when receiving a response from the health check, in milliseconds.</p>', ], ], 'Hostname' => [ 'base' => NULL, 'refs' => [ 'DnsServiceDiscovery$hostname' => '<p>Specifies the DNS service discovery hostname for the virtual node. </p>', ], ], 'HttpGatewayRoute' => [ 'base' => '<p>An object that represents an HTTP gateway route.</p>', 'refs' => [ 'GatewayRouteSpec$http2Route' => '<p>An object that represents the specification of an HTTP/2 gateway route.</p>', 'GatewayRouteSpec$httpRoute' => '<p>An object that represents the specification of an HTTP gateway route.</p>', ], ], 'HttpGatewayRouteAction' => [ 'base' => '<p>An object that represents the action to take if a match is determined.</p>', 'refs' => [ 'HttpGatewayRoute$action' => '<p>An object that represents the action to take if a match is determined.</p>', ], ], 'HttpGatewayRouteHeader' => [ 'base' => '<p>An object that represents the HTTP header in the gateway route.</p>', 'refs' => [ 'HttpGatewayRouteHeaders$member' => NULL, ], ], 'HttpGatewayRouteHeaders' => [ 'base' => NULL, 'refs' => [ 'HttpGatewayRouteMatch$headers' => '<p>The client request headers to match on.</p>', ], ], 'HttpGatewayRouteMatch' => [ 'base' => '<p>An object that represents the criteria for determining a request match.</p>', 'refs' => [ 'HttpGatewayRoute$match' => '<p>An object that represents the criteria for determining a request match.</p>', ], ], 'HttpGatewayRoutePathRewrite' => [ 'base' => '<p>An object that represents the path to rewrite.</p>', 'refs' => [ 'HttpGatewayRouteRewrite$path' => '<p>The path to rewrite.</p>', ], ], 'HttpGatewayRoutePrefix' => [ 'base' => NULL, 'refs' => [ 'HttpGatewayRoutePrefixRewrite$value' => '<p>The value used to replace the incoming route prefix when rewritten.</p>', ], ], 'HttpGatewayRoutePrefixRewrite' => [ 'base' => '<p>An object representing the beginning characters of the route to rewrite.</p>', 'refs' => [ 'HttpGatewayRouteRewrite$prefix' => '<p>The specified beginning characters to rewrite.</p>', ], ], 'HttpGatewayRouteRewrite' => [ 'base' => '<p>An object representing the gateway route to rewrite.</p>', 'refs' => [ 'HttpGatewayRouteAction$rewrite' => '<p>The gateway route action to rewrite.</p>', ], ], 'HttpMethod' => [ 'base' => NULL, 'refs' => [ 'HttpGatewayRouteMatch$method' => '<p>The method to match on.</p>', 'HttpRouteMatch$method' => '<p>The client request method to match on. Specify only one.</p>', ], ], 'HttpPathExact' => [ 'base' => NULL, 'refs' => [ 'HttpGatewayRoutePathRewrite$exact' => '<p>The exact path to rewrite.</p>', 'HttpPathMatch$exact' => '<p>The exact path to match on.</p>', ], ], 'HttpPathMatch' => [ 'base' => '<p>An object representing the path to match in the request.</p>', 'refs' => [ 'HttpGatewayRouteMatch$path' => '<p>The path to match on.</p>', 'HttpRouteMatch$path' => '<p>The client request path to match on.</p>', ], ], 'HttpPathRegex' => [ 'base' => NULL, 'refs' => [ 'HttpPathMatch$regex' => '<p>The regex used to match the path.</p>', ], ], 'HttpQueryParameter' => [ 'base' => '<p>An object that represents the query parameter in the request.</p>', 'refs' => [ 'HttpQueryParameters$member' => NULL, ], ], 'HttpQueryParameters' => [ 'base' => NULL, 'refs' => [ 'HttpGatewayRouteMatch$queryParameters' => '<p>The query parameter to match on.</p>', 'HttpRouteMatch$queryParameters' => '<p>The client request query parameters to match on.</p>', ], ], 'HttpRetryPolicy' => [ 'base' => '<p>An object that represents a retry policy. Specify at least one value for at least one of the types of <code>RetryEvents</code>, a value for <code>maxRetries</code>, and a value for <code>perRetryTimeout</code>. Both <code>server-error</code> and <code>gateway-error</code> under <code>httpRetryEvents</code> include the Envoy <code>reset</code> policy. For more information on the <code>reset</code> policy, see the <a href=\"https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/router_filter#x-envoy-retry-on\">Envoy documentation</a>.</p>', 'refs' => [ 'HttpRoute$retryPolicy' => '<p>An object that represents a retry policy.</p>', ], ], 'HttpRetryPolicyEvent' => [ 'base' => NULL, 'refs' => [ 'HttpRetryPolicyEvents$member' => NULL, ], ], 'HttpRetryPolicyEvents' => [ 'base' => NULL, 'refs' => [ 'GrpcRetryPolicy$httpRetryEvents' => '<p>Specify at least one of the following values.</p> <ul> <li> <p> <b>server-error</b> \u00e2\u20ac\u201c HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511</p> </li> <li> <p> <b>gateway-error</b> \u00e2\u20ac\u201c HTTP status codes 502, 503, and 504</p> </li> <li> <p> <b>client-error</b> \u00e2\u20ac\u201c HTTP status code 409</p> </li> <li> <p> <b>stream-error</b> \u00e2\u20ac\u201c Retry on refused stream</p> </li> </ul>', 'HttpRetryPolicy$httpRetryEvents' => '<p>Specify at least one of the following values.</p> <ul> <li> <p> <b>server-error</b> \u00e2\u20ac\u201c HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511</p> </li> <li> <p> <b>gateway-error</b> \u00e2\u20ac\u201c HTTP status codes 502, 503, and 504</p> </li> <li> <p> <b>client-error</b> \u00e2\u20ac\u201c HTTP status code 409</p> </li> <li> <p> <b>stream-error</b> \u00e2\u20ac\u201c Retry on refused stream</p> </li> </ul>', ], ], 'HttpRoute' => [ 'base' => '<p>An object that represents an HTTP or HTTP/2 route type.</p>', 'refs' => [ 'RouteSpec$http2Route' => '<p>An object that represents the specification of an HTTP/2 route.</p>', 'RouteSpec$httpRoute' => '<p>An object that represents the specification of an HTTP route.</p>', ], ], 'HttpRouteAction' => [ 'base' => '<p>An object that represents the action to take if a match is determined.</p>', 'refs' => [ 'HttpRoute$action' => '<p>An object that represents the action to take if a match is determined.</p>', ], ], 'HttpRouteHeader' => [ 'base' => '<p>An object that represents the HTTP header in the request.</p>', 'refs' => [ 'HttpRouteHeaders$member' => NULL, ], ], 'HttpRouteHeaders' => [ 'base' => NULL, 'refs' => [ 'HttpRouteMatch$headers' => '<p>The client request headers to match on.</p>', ], ], 'HttpRouteMatch' => [ 'base' => '<p>An object that represents the requirements for a route to match HTTP requests for a virtual router.</p>', 'refs' => [ 'HttpRoute$match' => '<p>An object that represents the criteria for determining a request match.</p>', ], ], 'HttpScheme' => [ 'base' => NULL, 'refs' => [ 'HttpRouteMatch$scheme' => '<p>The client request scheme to match on. Specify only one. Applicable only for HTTP2 routes.</p>', ], ], 'HttpTimeout' => [ 'base' => '<p>An object that represents types of timeouts. </p>', 'refs' => [ 'HttpRoute$timeout' => '<p>An object that represents types of timeouts. </p>', 'ListenerTimeout$http' => '<p>An object that represents types of timeouts. </p>', 'ListenerTimeout$http2' => '<p>An object that represents types of timeouts. </p>', ], ], 'InternalServerErrorException' => [ 'base' => '<p>The request processing has failed because of an unknown error, exception, or failure.</p>', 'refs' => [], ], 'IpPreference' => [ 'base' => NULL, 'refs' => [ 'AwsCloudMapServiceDiscovery$ipPreference' => '<p>The preferred IP version that this virtual node uses. Setting the IP preference on the virtual node only overrides the IP preference set for the mesh on this specific node.</p>', 'DnsServiceDiscovery$ipPreference' => '<p>The preferred IP version that this virtual node uses. Setting the IP preference on the virtual node only overrides the IP preference set for the mesh on this specific node.</p>', 'MeshServiceDiscovery$ipPreference' => '<p>The IP version to use to control traffic within the mesh.</p>', ], ], 'JsonFormat' => [ 'base' => NULL, 'refs' => [ 'LoggingFormat$json' => '<p/>', ], ], 'JsonFormatRef' => [ 'base' => '<p>An object that represents the key value pairs for the JSON.</p>', 'refs' => [ 'JsonFormat$member' => NULL, ], ], 'JsonKey' => [ 'base' => NULL, 'refs' => [ 'JsonFormatRef$key' => '<p>The specified key for the JSON.</p>', ], ], 'JsonValue' => [ 'base' => NULL, 'refs' => [ 'JsonFormatRef$value' => '<p>The specified value for the JSON.</p>', ], ], 'LimitExceededException' => [ 'base' => '<p>You have exceeded a service limit for your account. For more information, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/service-quotas.html\">Service Limits</a> in the <i>App Mesh User Guide</i>.</p>', 'refs' => [], ], 'ListGatewayRoutesInput' => [ 'base' => NULL, 'refs' => [], ], 'ListGatewayRoutesLimit' => [ 'base' => NULL, 'refs' => [ 'ListGatewayRoutesInput$limit' => '<p>The maximum number of results returned by <code>ListGatewayRoutes</code> in paginated output. When you use this parameter, <code>ListGatewayRoutes</code> returns only <code>limit</code> results in a single page along with a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListGatewayRoutes</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If you don\\'t use this parameter, <code>ListGatewayRoutes</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', ], ], 'ListGatewayRoutesOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListMeshesInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'ListMeshesLimit' => [ 'base' => NULL, 'refs' => [ 'ListMeshesInput$limit' => '<p>The maximum number of results returned by <code>ListMeshes</code> in paginated output. When you use this parameter, <code>ListMeshes</code> returns only <code>limit</code> results in a single page along with a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListMeshes</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If you don\\'t use this parameter, <code>ListMeshes</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', ], ], 'ListMeshesOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'ListRoutesInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'ListRoutesLimit' => [ 'base' => NULL, 'refs' => [ 'ListRoutesInput$limit' => '<p>The maximum number of results returned by <code>ListRoutes</code> in paginated output. When you use this parameter, <code>ListRoutes</code> returns only <code>limit</code> results in a single page along with a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListRoutes</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If you don\\'t use this parameter, <code>ListRoutes</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', ], ], 'ListRoutesOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'ListTagsForResourceInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'ListTagsForResourceOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'ListVirtualGatewaysInput' => [ 'base' => NULL, 'refs' => [], ], 'ListVirtualGatewaysLimit' => [ 'base' => NULL, 'refs' => [ 'ListVirtualGatewaysInput$limit' => '<p>The maximum number of results returned by <code>ListVirtualGateways</code> in paginated output. When you use this parameter, <code>ListVirtualGateways</code> returns only <code>limit</code> results in a single page along with a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListVirtualGateways</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If you don\\'t use this parameter, <code>ListVirtualGateways</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', ], ], 'ListVirtualGatewaysOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListVirtualNodesInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'ListVirtualNodesLimit' => [ 'base' => NULL, 'refs' => [ 'ListVirtualNodesInput$limit' => '<p>The maximum number of results returned by <code>ListVirtualNodes</code> in paginated output. When you use this parameter, <code>ListVirtualNodes</code> returns only <code>limit</code> results in a single page along with a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListVirtualNodes</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If you don\\'t use this parameter, <code>ListVirtualNodes</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', ], ], 'ListVirtualNodesOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'ListVirtualRoutersInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'ListVirtualRoutersLimit' => [ 'base' => NULL, 'refs' => [ 'ListVirtualRoutersInput$limit' => '<p>The maximum number of results returned by <code>ListVirtualRouters</code> in paginated output. When you use this parameter, <code>ListVirtualRouters</code> returns only <code>limit</code> results in a single page along with a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListVirtualRouters</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If you don\\'t use this parameter, <code>ListVirtualRouters</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', ], ], 'ListVirtualRoutersOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'ListVirtualServicesInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'ListVirtualServicesLimit' => [ 'base' => NULL, 'refs' => [ 'ListVirtualServicesInput$limit' => '<p>The maximum number of results returned by <code>ListVirtualServices</code> in paginated output. When you use this parameter, <code>ListVirtualServices</code> returns only <code>limit</code> results in a single page along with a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListVirtualServices</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If you don\\'t use this parameter, <code>ListVirtualServices</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', ], ], 'ListVirtualServicesOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'Listener' => [ 'base' => '<p>An object that represents a listener for a virtual node.</p>', 'refs' => [ 'Listeners$member' => NULL, ], ], 'ListenerPort' => [ 'base' => NULL, 'refs' => [ 'GatewayRouteTarget$port' => '<p>The port number of the gateway route target.</p>', 'GrpcGatewayRouteMatch$port' => '<p>The port number to match from the request.</p>', 'GrpcRouteMatch$port' => '<p>The port number to match on.</p>', 'HttpGatewayRouteMatch$port' => '<p>The port number to match on.</p>', 'HttpRouteMatch$port' => '<p>The port number to match on.</p>', 'TcpRouteMatch$port' => '<p>The port number to match on.</p>', 'WeightedTarget$port' => '<p>The targeted port of the weighted object.</p>', ], ], 'ListenerTimeout' => [ 'base' => '<p>An object that represents timeouts for different protocols.</p>', 'refs' => [ 'Listener$timeout' => '<p>An object that represents timeouts for different protocols.</p>', ], ], 'ListenerTls' => [ 'base' => '<p>An object that represents the Transport Layer Security (TLS) properties for a listener.</p>', 'refs' => [ 'Listener$tls' => '<p>A reference to an object that represents the Transport Layer Security (TLS) properties for a listener.</p>', ], ], 'ListenerTlsAcmCertificate' => [ 'base' => '<p>An object that represents an Certificate Manager certificate.</p>', 'refs' => [ 'ListenerTlsCertificate$acm' => '<p>A reference to an object that represents an Certificate Manager certificate.</p>', ], ], 'ListenerTlsCertificate' => [ 'base' => '<p>An object that represents a listener\\'s Transport Layer Security (TLS) certificate.</p>', 'refs' => [ 'ListenerTls$certificate' => '<p>A reference to an object that represents a listener\\'s Transport Layer Security (TLS) certificate.</p>', ], ], 'ListenerTlsFileCertificate' => [ 'base' => '<p>An object that represents a local file certificate. The certificate must meet specific requirements and you must have proxy authorization enabled. For more information, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/tls.html#virtual-node-tls-prerequisites\">Transport Layer Security (TLS)</a>.</p>', 'refs' => [ 'ClientTlsCertificate$file' => '<p>An object that represents a local file certificate. The certificate must meet specific requirements and you must have proxy authorization enabled. For more information, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/tls.html\">Transport Layer Security (TLS)</a>.</p>', 'ListenerTlsCertificate$file' => '<p>A reference to an object that represents a local file certificate.</p>', ], ], 'ListenerTlsMode' => [ 'base' => NULL, 'refs' => [ 'ListenerTls$mode' => '<p>Specify one of the following modes.</p> <ul> <li> <p> <b/>STRICT \u00e2\u20ac\u201c Listener only accepts connections with TLS enabled. </p> </li> <li> <p> <b/>PERMISSIVE \u00e2\u20ac\u201c Listener accepts connections with or without TLS enabled.</p> </li> <li> <p> <b/>DISABLED \u00e2\u20ac\u201c Listener only accepts connections without TLS. </p> </li> </ul>', ], ], 'ListenerTlsSdsCertificate' => [ 'base' => '<p>An object that represents the listener\\'s Secret Discovery Service certificate. The proxy must be configured with a local SDS provider via a Unix Domain Socket. See App Mesh <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/tls.html\">TLS documentation</a> for more info.</p>', 'refs' => [ 'ClientTlsCertificate$sds' => '<p>A reference to an object that represents a client\\'s TLS Secret Discovery Service certificate.</p>', 'ListenerTlsCertificate$sds' => '<p>A reference to an object that represents a listener\\'s Secret Discovery Service certificate.</p>', ], ], 'ListenerTlsValidationContext' => [ 'base' => '<p>An object that represents a listener\\'s Transport Layer Security (TLS) validation context.</p>', 'refs' => [ 'ListenerTls$validation' => '<p>A reference to an object that represents a listener\\'s Transport Layer Security (TLS) validation context.</p>', ], ], 'ListenerTlsValidationContextTrust' => [ 'base' => '<p>An object that represents a listener\\'s Transport Layer Security (TLS) validation context trust.</p>', 'refs' => [ 'ListenerTlsValidationContext$trust' => '<p>A reference to where to retrieve the trust chain when validating a peer\u00e2\u20ac\u2122s Transport Layer Security (TLS) certificate.</p>', ], ], 'Listeners' => [ 'base' => NULL, 'refs' => [ 'VirtualNodeSpec$listeners' => '<p>The listener that the virtual node is expected to receive inbound traffic from. You can specify one listener.</p>', ], ], 'Logging' => [ 'base' => '<p>An object that represents the logging information for a virtual node.</p>', 'refs' => [ 'VirtualNodeSpec$logging' => '<p>The inbound and outbound access logging information for the virtual node.</p>', ], ], 'LoggingFormat' => [ 'base' => '<p>An object that represents the format for the logs.</p>', 'refs' => [ 'FileAccessLog$format' => '<p>The specified format for the logs. The format is either <code>json_format</code> or <code>text_format</code>.</p>', 'VirtualGatewayFileAccessLog$format' => '<p>The specified format for the virtual gateway access logs. It can be either <code>json_format</code> or <code>text_format</code>.</p>', ], ], 'Long' => [ 'base' => NULL, 'refs' => [ 'GatewayRouteRef$version' => '<p>The version of the resource. Resources are created at version 1, and this version is incremented each time that they\\'re updated.</p>', 'MatchRange$end' => '<p>The end of the range.</p>', 'MatchRange$start' => '<p>The start of the range.</p>', 'MeshRef$version' => '<p>The version of the resource. Resources are created at version 1, and this version is incremented each time that they\\'re updated.</p>', 'ResourceMetadata$version' => '<p>The version of the resource. Resources are created at version 1, and this version is incremented each time that they\\'re updated.</p>', 'RouteRef$version' => '<p>The version of the resource. Resources are created at version 1, and this version is incremented each time that they\\'re updated.</p>', 'VirtualGatewayRef$version' => '<p>The version of the resource. Resources are created at version 1, and this version is incremented each time that they\\'re updated.</p>', 'VirtualNodeRef$version' => '<p>The version of the resource. Resources are created at version 1, and this version is incremented each time that they\\'re updated.</p>', 'VirtualRouterRef$version' => '<p>The version of the resource. Resources are created at version 1, and this version is incremented each time that they\\'re updated.</p>', 'VirtualServiceRef$version' => '<p>The version of the resource. Resources are created at version 1, and this version is incremented each time that they\\'re updated.</p>', ], ], 'MatchRange' => [ 'base' => '<p>An object that represents the range of values to match on. The first character of the range is included in the range, though the last character is not. For example, if the range specified were 1-100, only values 1-99 would be matched.</p>', 'refs' => [ 'GrpcMetadataMatchMethod$range' => NULL, 'GrpcRouteMetadataMatchMethod$range' => '<p>An object that represents the range of values to match on.</p>', 'HeaderMatchMethod$range' => '<p>An object that represents the range of values to match on.</p>', ], ], 'MaxConnections' => [ 'base' => NULL, 'refs' => [ 'VirtualGatewayHttpConnectionPool$maxConnections' => '<p>Maximum number of outbound TCP connections Envoy can establish concurrently with all hosts in upstream cluster.</p>', 'VirtualNodeHttpConnectionPool$maxConnections' => '<p>Maximum number of outbound TCP connections Envoy can establish concurrently with all hosts in upstream cluster.</p>', 'VirtualNodeTcpConnectionPool$maxConnections' => '<p>Maximum number of outbound TCP connections Envoy can establish concurrently with all hosts in upstream cluster.</p>', ], ], 'MaxPendingRequests' => [ 'base' => NULL, 'refs' => [ 'VirtualGatewayHttpConnectionPool$maxPendingRequests' => '<p>Number of overflowing requests after <code>max_connections</code> Envoy will queue to upstream cluster.</p>', 'VirtualNodeHttpConnectionPool$maxPendingRequests' => '<p>Number of overflowing requests after <code>max_connections</code> Envoy will queue to upstream cluster.</p>', ], ], 'MaxRequests' => [ 'base' => NULL, 'refs' => [ 'VirtualGatewayGrpcConnectionPool$maxRequests' => '<p>Maximum number of inflight requests Envoy can concurrently support across hosts in upstream cluster.</p>', 'VirtualGatewayHttp2ConnectionPool$maxRequests' => '<p>Maximum number of inflight requests Envoy can concurrently support across hosts in upstream cluster.</p>', 'VirtualNodeGrpcConnectionPool$maxRequests' => '<p>Maximum number of inflight requests Envoy can concurrently support across hosts in upstream cluster.</p>', 'VirtualNodeHttp2ConnectionPool$maxRequests' => '<p>Maximum number of inflight requests Envoy can concurrently support across hosts in upstream cluster.</p>', ], ], 'MaxRetries' => [ 'base' => NULL, 'refs' => [ 'GrpcRetryPolicy$maxRetries' => '<p>The maximum number of retry attempts.</p>', 'HttpRetryPolicy$maxRetries' => '<p>The maximum number of retry attempts.</p>', ], ], 'MeshData' => [ 'base' => '<p>An object that represents a service mesh returned by a describe operation.</p>', 'refs' => [ 'CreateMeshOutput$mesh' => '<p>The full description of your service mesh following the create call.</p>', 'DeleteMeshOutput$mesh' => '<p>The service mesh that was deleted.</p>', 'DescribeMeshOutput$mesh' => '<p>The full description of your service mesh.</p>', 'UpdateMeshOutput$mesh' => NULL, ], ], 'MeshList' => [ 'base' => NULL, 'refs' => [ 'ListMeshesOutput$meshes' => '<p>The list of existing service meshes.</p>', ], ], 'MeshRef' => [ 'base' => '<p>An object that represents a service mesh returned by a list operation.</p>', 'refs' => [ 'MeshList$member' => NULL, ], ], 'MeshServiceDiscovery' => [ 'base' => '<p>An object that represents the service discovery information for a service mesh.</p>', 'refs' => [ 'MeshSpec$serviceDiscovery' => NULL, ], ], 'MeshSpec' => [ 'base' => '<p>An object that represents the specification of a service mesh.</p>', 'refs' => [ 'CreateMeshInput$spec' => '<p>The service mesh specification to apply.</p>', 'MeshData$spec' => '<p>The associated specification for the service mesh.</p>', 'UpdateMeshInput$spec' => '<p>The service mesh specification to apply.</p>', ], ], 'MeshStatus' => [ 'base' => '<p>An object that represents the status of a service mesh.</p>', 'refs' => [ 'MeshData$status' => '<p>The status of the service mesh.</p>', ], ], 'MeshStatusCode' => [ 'base' => NULL, 'refs' => [ 'MeshStatus$status' => '<p>The current mesh status.</p>', ], ], 'MethodName' => [ 'base' => NULL, 'refs' => [ 'GrpcRouteMatch$methodName' => '<p>The method name to match from the request. If you specify a name, you must also specify a <code>serviceName</code>.</p>', ], ], 'NotFoundException' => [ 'base' => '<p>The specified resource doesn\\'t exist. Check your request syntax and try again.</p>', 'refs' => [], ], 'OutlierDetection' => [ 'base' => '<p>An object that represents the outlier detection for a virtual node\\'s listener.</p>', 'refs' => [ 'Listener$outlierDetection' => '<p>The outlier detection information for the listener.</p>', ], ], 'OutlierDetectionMaxEjectionPercent' => [ 'base' => NULL, 'refs' => [ 'OutlierDetection$maxEjectionPercent' => '<p>Maximum percentage of hosts in load balancing pool for upstream service that can be ejected. Will eject at least one host regardless of the value.</p>', ], ], 'OutlierDetectionMaxServerErrors' => [ 'base' => NULL, 'refs' => [ 'OutlierDetection$maxServerErrors' => '<p>Number of consecutive <code>5xx</code> errors required for ejection. </p>', ], ], 'PercentInt' => [ 'base' => NULL, 'refs' => [ 'WeightedTarget$weight' => '<p>The relative weight of the weighted target.</p>', ], ], 'PortMapping' => [ 'base' => '<p>An object that represents a port mapping.</p>', 'refs' => [ 'Listener$portMapping' => '<p>The port mapping information for the listener.</p>', 'VirtualRouterListener$portMapping' => NULL, ], ], 'PortNumber' => [ 'base' => NULL, 'refs' => [ 'HealthCheckPolicy$port' => '<p>The destination port for the health check request. This port must match the port defined in the <a>PortMapping</a> for the listener.</p>', 'PortMapping$port' => '<p>The port used for the port mapping.</p>', 'PortSet$member' => NULL, 'VirtualGatewayHealthCheckPolicy$port' => '<p>The destination port for the health check request. This port must match the port defined in the <a>PortMapping</a> for the listener.</p>', 'VirtualGatewayPortMapping$port' => '<p>The port used for the port mapping. Specify one protocol.</p>', ], ], 'PortProtocol' => [ 'base' => NULL, 'refs' => [ 'HealthCheckPolicy$protocol' => '<p>The protocol for the health check request. If you specify <code>grpc</code>, then your service must conform to the <a href=\"https://github.com/grpc/grpc/blob/master/doc/health-checking.md\">GRPC Health Checking Protocol</a>.</p>', 'PortMapping$protocol' => '<p>The protocol used for the port mapping. Specify one protocol.</p>', ], ], 'PortSet' => [ 'base' => NULL, 'refs' => [ 'ClientPolicyTls$ports' => '<p>One or more ports that the policy is enforced for.</p>', 'VirtualGatewayClientPolicyTls$ports' => '<p>One or more ports that the policy is enforced for.</p>', ], ], 'QueryParameterMatch' => [ 'base' => '<p>An object representing the query parameter to match.</p>', 'refs' => [ 'HttpQueryParameter$match' => '<p>The query parameter to match on.</p>', ], ], 'QueryParameterName' => [ 'base' => NULL, 'refs' => [ 'HttpQueryParameter$name' => '<p>A name for the query parameter that will be matched on.</p>', ], ], 'ResourceInUseException' => [ 'base' => '<p>You can\\'t delete the specified resource because it\\'s in use or required by another resource.</p>', 'refs' => [], ], 'ResourceMetadata' => [ 'base' => '<p>An object that represents metadata for a resource.</p>', 'refs' => [ 'GatewayRouteData$metadata' => NULL, 'MeshData$metadata' => '<p>The associated metadata for the service mesh.</p>', 'RouteData$metadata' => '<p>The associated metadata for the route.</p>', 'VirtualGatewayData$metadata' => NULL, 'VirtualNodeData$metadata' => '<p>The associated metadata for the virtual node.</p>', 'VirtualRouterData$metadata' => '<p>The associated metadata for the virtual router.</p>', 'VirtualServiceData$metadata' => NULL, ], ], 'ResourceName' => [ 'base' => NULL, 'refs' => [ 'CreateGatewayRouteInput$gatewayRouteName' => '<p>The name to use for the gateway route.</p>', 'CreateGatewayRouteInput$meshName' => '<p>The name of the service mesh to create the gateway route in.</p>', 'CreateGatewayRouteInput$virtualGatewayName' => '<p>The name of the virtual gateway to associate the gateway route with. If the virtual gateway is in a shared mesh, then you must be the owner of the virtual gateway resource.</p>', 'CreateMeshInput$meshName' => '<p>The name to use for the service mesh.</p>', 'CreateRouteInput$meshName' => '<p>The name of the service mesh to create the route in.</p>', 'CreateRouteInput$routeName' => '<p>The name to use for the route.</p>', 'CreateRouteInput$virtualRouterName' => '<p>The name of the virtual router in which to create the route. If the virtual router is in a shared mesh, then you must be the owner of the virtual router resource.</p>', 'CreateVirtualGatewayInput$meshName' => '<p>The name of the service mesh to create the virtual gateway in.</p>', 'CreateVirtualGatewayInput$virtualGatewayName' => '<p>The name to use for the virtual gateway.</p>', 'CreateVirtualNodeInput$meshName' => '<p>The name of the service mesh to create the virtual node in.</p>', 'CreateVirtualNodeInput$virtualNodeName' => '<p>The name to use for the virtual node.</p>', 'CreateVirtualRouterInput$meshName' => '<p>The name of the service mesh to create the virtual router in.</p>', 'CreateVirtualRouterInput$virtualRouterName' => '<p>The name to use for the virtual router.</p>', 'CreateVirtualServiceInput$meshName' => '<p>The name of the service mesh to create the virtual service in.</p>', 'DeleteGatewayRouteInput$gatewayRouteName' => '<p>The name of the gateway route to delete.</p>', 'DeleteGatewayRouteInput$meshName' => '<p>The name of the service mesh to delete the gateway route from.</p>', 'DeleteGatewayRouteInput$virtualGatewayName' => '<p>The name of the virtual gateway to delete the route from.</p>', 'DeleteMeshInput$meshName' => '<p>The name of the service mesh to delete.</p>', 'DeleteRouteInput$meshName' => '<p>The name of the service mesh to delete the route in.</p>', 'DeleteRouteInput$routeName' => '<p>The name of the route to delete.</p>', 'DeleteRouteInput$virtualRouterName' => '<p>The name of the virtual router to delete the route in.</p>', 'DeleteVirtualGatewayInput$meshName' => '<p>The name of the service mesh to delete the virtual gateway from.</p>', 'DeleteVirtualGatewayInput$virtualGatewayName' => '<p>The name of the virtual gateway to delete.</p>', 'DeleteVirtualNodeInput$meshName' => '<p>The name of the service mesh to delete the virtual node in.</p>', 'DeleteVirtualNodeInput$virtualNodeName' => '<p>The name of the virtual node to delete.</p>', 'DeleteVirtualRouterInput$meshName' => '<p>The name of the service mesh to delete the virtual router in.</p>', 'DeleteVirtualRouterInput$virtualRouterName' => '<p>The name of the virtual router to delete.</p>', 'DeleteVirtualServiceInput$meshName' => '<p>The name of the service mesh to delete the virtual service in.</p>', 'DescribeGatewayRouteInput$gatewayRouteName' => '<p>The name of the gateway route to describe.</p>', 'DescribeGatewayRouteInput$meshName' => '<p>The name of the service mesh that the gateway route resides in.</p>', 'DescribeGatewayRouteInput$virtualGatewayName' => '<p>The name of the virtual gateway that the gateway route is associated with.</p>', 'DescribeMeshInput$meshName' => '<p>The name of the service mesh to describe.</p>', 'DescribeRouteInput$meshName' => '<p>The name of the service mesh that the route resides in.</p>', 'DescribeRouteInput$routeName' => '<p>The name of the route to describe.</p>', 'DescribeRouteInput$virtualRouterName' => '<p>The name of the virtual router that the route is associated with.</p>', 'DescribeVirtualGatewayInput$meshName' => '<p>The name of the service mesh that the gateway route resides in.</p>', 'DescribeVirtualGatewayInput$virtualGatewayName' => '<p>The name of the virtual gateway to describe.</p>', 'DescribeVirtualNodeInput$meshName' => '<p>The name of the service mesh that the virtual node resides in.</p>', 'DescribeVirtualNodeInput$virtualNodeName' => '<p>The name of the virtual node to describe.</p>', 'DescribeVirtualRouterInput$meshName' => '<p>The name of the service mesh that the virtual router resides in.</p>', 'DescribeVirtualRouterInput$virtualRouterName' => '<p>The name of the virtual router to describe.</p>', 'DescribeVirtualServiceInput$meshName' => '<p>The name of the service mesh that the virtual service resides in.</p>', 'GatewayRouteData$gatewayRouteName' => '<p>The name of the gateway route.</p>', 'GatewayRouteData$meshName' => '<p>The name of the service mesh that the resource resides in. </p>', 'GatewayRouteData$virtualGatewayName' => '<p>The virtual gateway that the gateway route is associated with.</p>', 'GatewayRouteRef$gatewayRouteName' => '<p>The name of the gateway route.</p>', 'GatewayRouteRef$meshName' => '<p>The name of the service mesh that the resource resides in. </p>', 'GatewayRouteRef$virtualGatewayName' => '<p>The virtual gateway that the gateway route is associated with.</p>', 'GatewayRouteVirtualService$virtualServiceName' => '<p>The name of the virtual service that traffic is routed to.</p>', 'ListGatewayRoutesInput$meshName' => '<p>The name of the service mesh to list gateway routes in.</p>', 'ListGatewayRoutesInput$virtualGatewayName' => '<p>The name of the virtual gateway to list gateway routes in.</p>', 'ListRoutesInput$meshName' => '<p>The name of the service mesh to list routes in.</p>', 'ListRoutesInput$virtualRouterName' => '<p>The name of the virtual router to list routes in.</p>', 'ListVirtualGatewaysInput$meshName' => '<p>The name of the service mesh to list virtual gateways in.</p>', 'ListVirtualNodesInput$meshName' => '<p>The name of the service mesh to list virtual nodes in.</p>', 'ListVirtualRoutersInput$meshName' => '<p>The name of the service mesh to list virtual routers in.</p>', 'ListVirtualServicesInput$meshName' => '<p>The name of the service mesh to list virtual services in.</p>', 'MeshData$meshName' => '<p>The name of the service mesh.</p>', 'MeshRef$meshName' => '<p>The name of the service mesh.</p>', 'RouteData$meshName' => '<p>The name of the service mesh that the route resides in.</p>', 'RouteData$routeName' => '<p>The name of the route.</p>', 'RouteData$virtualRouterName' => '<p>The virtual router that the route is associated with.</p>', 'RouteRef$meshName' => '<p>The name of the service mesh that the route resides in.</p>', 'RouteRef$routeName' => '<p>The name of the route.</p>', 'RouteRef$virtualRouterName' => '<p>The virtual router that the route is associated with.</p>', 'UpdateGatewayRouteInput$gatewayRouteName' => '<p>The name of the gateway route to update.</p>', 'UpdateGatewayRouteInput$meshName' => '<p>The name of the service mesh that the gateway route resides in.</p>', 'UpdateGatewayRouteInput$virtualGatewayName' => '<p>The name of the virtual gateway that the gateway route is associated with.</p>', 'UpdateMeshInput$meshName' => '<p>The name of the service mesh to update.</p>', 'UpdateRouteInput$meshName' => '<p>The name of the service mesh that the route resides in.</p>', 'UpdateRouteInput$routeName' => '<p>The name of the route to update.</p>', 'UpdateRouteInput$virtualRouterName' => '<p>The name of the virtual router that the route is associated with.</p>', 'UpdateVirtualGatewayInput$meshName' => '<p>The name of the service mesh that the virtual gateway resides in.</p>', 'UpdateVirtualGatewayInput$virtualGatewayName' => '<p>The name of the virtual gateway to update.</p>', 'UpdateVirtualNodeInput$meshName' => '<p>The name of the service mesh that the virtual node resides in.</p>', 'UpdateVirtualNodeInput$virtualNodeName' => '<p>The name of the virtual node to update.</p>', 'UpdateVirtualRouterInput$meshName' => '<p>The name of the service mesh that the virtual router resides in.</p>', 'UpdateVirtualRouterInput$virtualRouterName' => '<p>The name of the virtual router to update.</p>', 'UpdateVirtualServiceInput$meshName' => '<p>The name of the service mesh that the virtual service resides in.</p>', 'VirtualGatewayData$meshName' => '<p>The name of the service mesh that the virtual gateway resides in.</p>', 'VirtualGatewayData$virtualGatewayName' => '<p>The name of the virtual gateway.</p>', 'VirtualGatewayRef$meshName' => '<p>The name of the service mesh that the resource resides in.</p>', 'VirtualGatewayRef$virtualGatewayName' => '<p>The name of the resource.</p>', 'VirtualNodeData$meshName' => '<p>The name of the service mesh that the virtual node resides in.</p>', 'VirtualNodeData$virtualNodeName' => '<p>The name of the virtual node.</p>', 'VirtualNodeRef$meshName' => '<p>The name of the service mesh that the virtual node resides in.</p>', 'VirtualNodeRef$virtualNodeName' => '<p>The name of the virtual node.</p>', 'VirtualNodeServiceProvider$virtualNodeName' => '<p>The name of the virtual node that is acting as a service provider.</p>', 'VirtualRouterData$meshName' => '<p>The name of the service mesh that the virtual router resides in.</p>', 'VirtualRouterData$virtualRouterName' => '<p>The name of the virtual router.</p>', 'VirtualRouterRef$meshName' => '<p>The name of the service mesh that the virtual router resides in.</p>', 'VirtualRouterRef$virtualRouterName' => '<p>The name of the virtual router.</p>', 'VirtualRouterServiceProvider$virtualRouterName' => '<p>The name of the virtual router that is acting as a service provider.</p>', 'VirtualServiceData$meshName' => '<p>The name of the service mesh that the virtual service resides in.</p>', 'VirtualServiceRef$meshName' => '<p>The name of the service mesh that the virtual service resides in.</p>', 'WeightedTarget$virtualNode' => '<p>The virtual node to associate with the weighted target.</p>', ], ], 'RouteData' => [ 'base' => '<p>An object that represents a route returned by a describe operation.</p>', 'refs' => [ 'CreateRouteOutput$route' => '<p>The full description of your mesh following the create call.</p>', 'DeleteRouteOutput$route' => '<p>The route that was deleted.</p>', 'DescribeRouteOutput$route' => '<p>The full description of your route.</p>', 'UpdateRouteOutput$route' => '<p>A full description of the route that was updated.</p>', ], ], 'RouteList' => [ 'base' => NULL, 'refs' => [ 'ListRoutesOutput$routes' => '<p>The list of existing routes for the specified service mesh and virtual router.</p>', ], ], 'RoutePriority' => [ 'base' => NULL, 'refs' => [ 'RouteSpec$priority' => '<p>The priority for the route. Routes are matched based on the specified value, where 0 is the highest priority.</p>', ], ], 'RouteRef' => [ 'base' => '<p>An object that represents a route returned by a list operation.</p>', 'refs' => [ 'RouteList$member' => NULL, ], ], 'RouteSpec' => [ 'base' => '<p>An object that represents a route specification. Specify one route type.</p>', 'refs' => [ 'CreateRouteInput$spec' => '<p>The route specification to apply.</p>', 'RouteData$spec' => '<p>The specifications of the route.</p>', 'UpdateRouteInput$spec' => '<p>The new route specification to apply. This overwrites the existing data.</p>', ], ], 'RouteStatus' => [ 'base' => '<p>An object that represents the current status of a route.</p>', 'refs' => [ 'RouteData$status' => '<p>The status of the route.</p>', ], ], 'RouteStatusCode' => [ 'base' => NULL, 'refs' => [ 'RouteStatus$status' => '<p>The current status for the route.</p>', ], ], 'SdsSecretName' => [ 'base' => NULL, 'refs' => [ 'ListenerTlsSdsCertificate$secretName' => '<p>A reference to an object that represents the name of the secret requested from the Secret Discovery Service provider representing Transport Layer Security (TLS) materials like a certificate or certificate chain.</p>', 'TlsValidationContextSdsTrust$secretName' => '<p>A reference to an object that represents the name of the secret for a Transport Layer Security (TLS) Secret Discovery Service validation context trust.</p>', ], ], 'ServiceDiscovery' => [ 'base' => '<p>An object that represents the service discovery information for a virtual node.</p>', 'refs' => [ 'VirtualNodeSpec$serviceDiscovery' => '<p>The service discovery information for the virtual node. If your virtual node does not expect ingress traffic, you can omit this parameter. If you specify a <code>listener</code>, then you must specify service discovery information.</p>', ], ], 'ServiceName' => [ 'base' => NULL, 'refs' => [ 'CreateVirtualServiceInput$virtualServiceName' => '<p>The name to use for the virtual service.</p>', 'DeleteVirtualServiceInput$virtualServiceName' => '<p>The name of the virtual service to delete.</p>', 'DescribeVirtualServiceInput$virtualServiceName' => '<p>The name of the virtual service to describe.</p>', 'GrpcGatewayRouteMatch$serviceName' => '<p>The fully qualified domain name for the service to match from the request.</p>', 'GrpcRouteMatch$serviceName' => '<p>The fully qualified domain name for the service to match from the request.</p>', 'UpdateVirtualServiceInput$virtualServiceName' => '<p>The name of the virtual service to update.</p>', 'VirtualServiceBackend$virtualServiceName' => '<p>The name of the virtual service that is acting as a virtual node backend.</p>', 'VirtualServiceData$virtualServiceName' => '<p>The name of the virtual service.</p>', 'VirtualServiceRef$virtualServiceName' => '<p>The name of the virtual service.</p>', ], ], 'ServiceUnavailableException' => [ 'base' => '<p>The request has failed due to a temporary failure of the service.</p>', 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [ 'BadRequestException$message' => NULL, 'ConflictException$message' => NULL, 'CreateGatewayRouteInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'CreateMeshInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'CreateRouteInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'CreateVirtualGatewayInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'CreateVirtualNodeInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'CreateVirtualRouterInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'CreateVirtualServiceInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'ForbiddenException$message' => NULL, 'HealthCheckPolicy$path' => '<p>The destination path for the health check request. This value is only used if the specified protocol is HTTP or HTTP/2. For any other protocol, this value is ignored.</p>', 'HttpGatewayRouteMatch$prefix' => '<p>Specifies the path to match requests with. This parameter must always start with <code>/</code>, which by itself matches all requests to the virtual service name. You can also match for path-based routing of requests. For example, if your virtual service name is <code>my-service.local</code> and you want the route to match requests to <code>my-service.local/metrics</code>, your prefix should be <code>/metrics</code>.</p>', 'HttpRouteMatch$prefix' => '<p>Specifies the path to match requests with. This parameter must always start with <code>/</code>, which by itself matches all requests to the virtual service name. You can also match for path-based routing of requests. For example, if your virtual service name is <code>my-service.local</code> and you want the route to match requests to <code>my-service.local/metrics</code>, your prefix should be <code>/metrics</code>.</p>', 'InternalServerErrorException$message' => NULL, 'LimitExceededException$message' => NULL, 'ListGatewayRoutesInput$nextToken' => '<p>The <code>nextToken</code> value returned from a previous paginated <code>ListGatewayRoutes</code> request where <code>limit</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p>', 'ListGatewayRoutesOutput$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>ListGatewayRoutes</code> request. When the results of a <code>ListGatewayRoutes</code> request exceed <code>limit</code>, you can use this value to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', 'ListMeshesInput$nextToken' => '<p>The <code>nextToken</code> value returned from a previous paginated <code>ListMeshes</code> request where <code>limit</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p> <note> <p>This token should be treated as an opaque identifier that is used only to retrieve the next items in a list and not for other programmatic purposes.</p> </note>', 'ListMeshesOutput$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>ListMeshes</code> request. When the results of a <code>ListMeshes</code> request exceed <code>limit</code>, you can use this value to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', 'ListRoutesInput$nextToken' => '<p>The <code>nextToken</code> value returned from a previous paginated <code>ListRoutes</code> request where <code>limit</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p>', 'ListRoutesOutput$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>ListRoutes</code> request. When the results of a <code>ListRoutes</code> request exceed <code>limit</code>, you can use this value to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', 'ListTagsForResourceInput$nextToken' => '<p>The <code>nextToken</code> value returned from a previous paginated <code>ListTagsForResource</code> request where <code>limit</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p>', 'ListTagsForResourceOutput$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>ListTagsForResource</code> request. When the results of a <code>ListTagsForResource</code> request exceed <code>limit</code>, you can use this value to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', 'ListVirtualGatewaysInput$nextToken' => '<p>The <code>nextToken</code> value returned from a previous paginated <code>ListVirtualGateways</code> request where <code>limit</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p>', 'ListVirtualGatewaysOutput$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>ListVirtualGateways</code> request. When the results of a <code>ListVirtualGateways</code> request exceed <code>limit</code>, you can use this value to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', 'ListVirtualNodesInput$nextToken' => '<p>The <code>nextToken</code> value returned from a previous paginated <code>ListVirtualNodes</code> request where <code>limit</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p>', 'ListVirtualNodesOutput$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>ListVirtualNodes</code> request. When the results of a <code>ListVirtualNodes</code> request exceed <code>limit</code>, you can use this value to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', 'ListVirtualRoutersInput$nextToken' => '<p>The <code>nextToken</code> value returned from a previous paginated <code>ListVirtualRouters</code> request where <code>limit</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p>', 'ListVirtualRoutersOutput$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>ListVirtualRouters</code> request. When the results of a <code>ListVirtualRouters</code> request exceed <code>limit</code>, you can use this value to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', 'ListVirtualServicesInput$nextToken' => '<p>The <code>nextToken</code> value returned from a previous paginated <code>ListVirtualServices</code> request where <code>limit</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p>', 'ListVirtualServicesOutput$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>ListVirtualServices</code> request. When the results of a <code>ListVirtualServices</code> request exceed <code>limit</code>, you can use this value to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', 'NotFoundException$message' => NULL, 'QueryParameterMatch$exact' => '<p>The exact query parameter to match on.</p>', 'ResourceInUseException$message' => NULL, 'ResourceMetadata$uid' => '<p>The unique identifier for the resource.</p>', 'ServiceUnavailableException$message' => NULL, 'TooManyRequestsException$message' => NULL, 'TooManyTagsException$message' => NULL, 'UpdateGatewayRouteInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'UpdateMeshInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'UpdateRouteInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'UpdateVirtualGatewayInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'UpdateVirtualNodeInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'UpdateVirtualRouterInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'UpdateVirtualServiceInput$clientToken' => '<p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>', 'VirtualGatewayHealthCheckPolicy$path' => '<p>The destination path for the health check request. This value is only used if the specified protocol is HTTP or HTTP/2. For any other protocol, this value is ignored.</p>', ], ], 'SubjectAlternativeName' => [ 'base' => NULL, 'refs' => [ 'SubjectAlternativeNameList$member' => NULL, ], ], 'SubjectAlternativeNameList' => [ 'base' => NULL, 'refs' => [ 'SubjectAlternativeNameMatchers$exact' => '<p>The values sent must match the specified values exactly.</p>', ], ], 'SubjectAlternativeNameMatchers' => [ 'base' => '<p>An object that represents the methods by which a subject alternative name on a peer Transport Layer Security (TLS) certificate can be matched.</p>', 'refs' => [ 'SubjectAlternativeNames$match' => '<p>An object that represents the criteria for determining a SANs match.</p>', ], ], 'SubjectAlternativeNames' => [ 'base' => '<p>An object that represents the subject alternative names secured by the certificate.</p>', 'refs' => [ 'ListenerTlsValidationContext$subjectAlternativeNames' => '<p>A reference to an object that represents the SANs for a listener\\'s Transport Layer Security (TLS) validation context.</p>', 'TlsValidationContext$subjectAlternativeNames' => '<p>A reference to an object that represents the SANs for a Transport Layer Security (TLS) validation context. If you don\\'t specify SANs on the <i>terminating</i> mesh endpoint, the Envoy proxy for that node doesn\\'t verify the SAN on a peer client certificate. If you don\\'t specify SANs on the <i>originating</i> mesh endpoint, the SAN on the certificate provided by the terminating endpoint must match the mesh endpoint service discovery configuration. Since SPIRE vended certificates have a SPIFFE ID as a name, you must set the SAN since the name doesn\\'t match the service discovery name.</p>', 'VirtualGatewayListenerTlsValidationContext$subjectAlternativeNames' => '<p>A reference to an object that represents the SANs for a virtual gateway listener\\'s Transport Layer Security (TLS) validation context.</p>', 'VirtualGatewayTlsValidationContext$subjectAlternativeNames' => '<p>A reference to an object that represents the SANs for a virtual gateway\\'s listener\\'s Transport Layer Security (TLS) validation context.</p>', ], ], 'SuffixHostname' => [ 'base' => NULL, 'refs' => [ 'GatewayRouteHostnameMatch$suffix' => '<p>The specified ending characters of the host name to match on.</p>', ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'TagKeyList$member' => NULL, 'TagRef$key' => '<p>One part of a key-value pair that make up a tag. A <code>key</code> is a general label that acts like a category for more specific tag values.</p>', ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceInput$tagKeys' => '<p>The keys of the tags to be removed.</p>', ], ], 'TagList' => [ 'base' => NULL, 'refs' => [ 'CreateGatewayRouteInput$tags' => '<p>Optional metadata that you can apply to the gateway route to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>', 'CreateMeshInput$tags' => '<p>Optional metadata that you can apply to the service mesh to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>', 'CreateRouteInput$tags' => '<p>Optional metadata that you can apply to the route to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>', 'CreateVirtualGatewayInput$tags' => '<p>Optional metadata that you can apply to the virtual gateway to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>', 'CreateVirtualNodeInput$tags' => '<p>Optional metadata that you can apply to the virtual node to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>', 'CreateVirtualRouterInput$tags' => '<p>Optional metadata that you can apply to the virtual router to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>', 'CreateVirtualServiceInput$tags' => '<p>Optional metadata that you can apply to the virtual service to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>', 'ListTagsForResourceOutput$tags' => '<p>The tags for the resource.</p>', 'TagResourceInput$tags' => '<p>The tags to add to the resource. A tag is an array of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>', ], ], 'TagRef' => [ 'base' => '<p>Optional metadata that you apply to a resource to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>', 'refs' => [ 'TagList$member' => NULL, ], ], 'TagResourceInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'TagResourceOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'TagRef$value' => '<p>The optional part of a key-value pair that make up a tag. A <code>value</code> acts as a descriptor within a tag category (key).</p>', ], ], 'TagsLimit' => [ 'base' => NULL, 'refs' => [ 'ListTagsForResourceInput$limit' => '<p>The maximum number of tag results returned by <code>ListTagsForResource</code> in paginated output. When this parameter is used, <code>ListTagsForResource</code> returns only <code>limit</code> results in a single page along with a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListTagsForResource</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If you don\\'t use this parameter, <code>ListTagsForResource</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', ], ], 'TcpRetryPolicyEvent' => [ 'base' => NULL, 'refs' => [ 'TcpRetryPolicyEvents$member' => NULL, ], ], 'TcpRetryPolicyEvents' => [ 'base' => NULL, 'refs' => [ 'GrpcRetryPolicy$tcpRetryEvents' => '<p>Specify a valid value. The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.</p>', 'HttpRetryPolicy$tcpRetryEvents' => '<p>Specify a valid value. The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.</p>', ], ], 'TcpRoute' => [ 'base' => '<p>An object that represents a TCP route type.</p>', 'refs' => [ 'RouteSpec$tcpRoute' => '<p>An object that represents the specification of a TCP route.</p>', ], ], 'TcpRouteAction' => [ 'base' => '<p>An object that represents the action to take if a match is determined.</p>', 'refs' => [ 'TcpRoute$action' => '<p>The action to take if a match is determined.</p>', ], ], 'TcpRouteMatch' => [ 'base' => '<p>An object representing the TCP route to match.</p>', 'refs' => [ 'TcpRoute$match' => '<p>An object that represents the criteria for determining a request match.</p>', ], ], 'TcpTimeout' => [ 'base' => '<p>An object that represents types of timeouts. </p>', 'refs' => [ 'ListenerTimeout$tcp' => '<p>An object that represents types of timeouts. </p>', 'TcpRoute$timeout' => '<p>An object that represents types of timeouts. </p>', ], ], 'TextFormat' => [ 'base' => NULL, 'refs' => [ 'LoggingFormat$text' => '<p/>', ], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [ 'GatewayRouteRef$createdAt' => '<p>The Unix epoch timestamp in seconds for when the resource was created.</p>', 'GatewayRouteRef$lastUpdatedAt' => '<p>The Unix epoch timestamp in seconds for when the resource was last updated.</p>', 'MeshRef$createdAt' => '<p>The Unix epoch timestamp in seconds for when the resource was created.</p>', 'MeshRef$lastUpdatedAt' => '<p>The Unix epoch timestamp in seconds for when the resource was last updated.</p>', 'ResourceMetadata$createdAt' => '<p>The Unix epoch timestamp in seconds for when the resource was created.</p>', 'ResourceMetadata$lastUpdatedAt' => '<p>The Unix epoch timestamp in seconds for when the resource was last updated.</p>', 'RouteRef$createdAt' => '<p>The Unix epoch timestamp in seconds for when the resource was created.</p>', 'RouteRef$lastUpdatedAt' => '<p>The Unix epoch timestamp in seconds for when the resource was last updated.</p>', 'VirtualGatewayRef$createdAt' => '<p>The Unix epoch timestamp in seconds for when the resource was created.</p>', 'VirtualGatewayRef$lastUpdatedAt' => '<p>The Unix epoch timestamp in seconds for when the resource was last updated.</p>', 'VirtualNodeRef$createdAt' => '<p>The Unix epoch timestamp in seconds for when the resource was created.</p>', 'VirtualNodeRef$lastUpdatedAt' => '<p>The Unix epoch timestamp in seconds for when the resource was last updated.</p>', 'VirtualRouterRef$createdAt' => '<p>The Unix epoch timestamp in seconds for when the resource was created.</p>', 'VirtualRouterRef$lastUpdatedAt' => '<p>The Unix epoch timestamp in seconds for when the resource was last updated.</p>', 'VirtualServiceRef$createdAt' => '<p>The Unix epoch timestamp in seconds for when the resource was created.</p>', 'VirtualServiceRef$lastUpdatedAt' => '<p>The Unix epoch timestamp in seconds for when the resource was last updated.</p>', ], ], 'TlsValidationContext' => [ 'base' => '<p>An object that represents how the proxy will validate its peer during Transport Layer Security (TLS) negotiation.</p>', 'refs' => [ 'ClientPolicyTls$validation' => '<p>A reference to an object that represents a TLS validation context.</p>', ], ], 'TlsValidationContextAcmTrust' => [ 'base' => '<p>An object that represents a Transport Layer Security (TLS) validation context trust for an Certificate Manager certificate.</p>', 'refs' => [ 'TlsValidationContextTrust$acm' => '<p>A reference to an object that represents a Transport Layer Security (TLS) validation context trust for an Certificate Manager certificate.</p>', ], ], 'TlsValidationContextFileTrust' => [ 'base' => '<p>An object that represents a Transport Layer Security (TLS) validation context trust for a local file.</p>', 'refs' => [ 'ListenerTlsValidationContextTrust$file' => '<p>An object that represents a Transport Layer Security (TLS) validation context trust for a local file.</p>', 'TlsValidationContextTrust$file' => '<p>An object that represents a Transport Layer Security (TLS) validation context trust for a local file.</p>', ], ], 'TlsValidationContextSdsTrust' => [ 'base' => '<p>An object that represents a Transport Layer Security (TLS) Secret Discovery Service validation context trust. The proxy must be configured with a local SDS provider via a Unix Domain Socket. See App Mesh <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/tls.html\">TLS documentation</a> for more info.</p>', 'refs' => [ 'ListenerTlsValidationContextTrust$sds' => '<p>A reference to an object that represents a listener\\'s Transport Layer Security (TLS) Secret Discovery Service validation context trust.</p>', 'TlsValidationContextTrust$sds' => '<p>A reference to an object that represents a Transport Layer Security (TLS) Secret Discovery Service validation context trust.</p>', ], ], 'TlsValidationContextTrust' => [ 'base' => '<p>An object that represents a Transport Layer Security (TLS) validation context trust.</p>', 'refs' => [ 'TlsValidationContext$trust' => '<p>A reference to where to retrieve the trust chain when validating a peer\u00e2\u20ac\u2122s Transport Layer Security (TLS) certificate.</p>', ], ], 'TooManyRequestsException' => [ 'base' => '<p>The maximum request rate permitted by the App Mesh APIs has been exceeded for your account. For best results, use an increasing or variable sleep interval between requests.</p>', 'refs' => [], ], 'TooManyTagsException' => [ 'base' => '<p>The request exceeds the maximum allowed number of tags allowed per resource. The current limit is 50 user tags per resource. You must reduce the number of tags in the request. None of the tags in this request were applied.</p>', 'refs' => [], ], 'UntagResourceInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'UntagResourceOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'UpdateGatewayRouteInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateGatewayRouteOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateMeshInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'UpdateMeshOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'UpdateRouteInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'UpdateRouteOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'UpdateVirtualGatewayInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateVirtualGatewayOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateVirtualNodeInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'UpdateVirtualNodeOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'UpdateVirtualRouterInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'UpdateVirtualRouterOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'UpdateVirtualServiceInput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'UpdateVirtualServiceOutput' => [ 'base' => '<zonbook></zonbook><xhtml></xhtml>', 'refs' => [], ], 'VirtualGatewayAccessLog' => [ 'base' => '<p>The access log configuration for a virtual gateway.</p>', 'refs' => [ 'VirtualGatewayLogging$accessLog' => '<p>The access log configuration.</p>', ], ], 'VirtualGatewayBackendDefaults' => [ 'base' => '<p>An object that represents the default properties for a backend.</p>', 'refs' => [ 'VirtualGatewaySpec$backendDefaults' => '<p>A reference to an object that represents the defaults for backends.</p>', ], ], 'VirtualGatewayCertificateAuthorityArns' => [ 'base' => NULL, 'refs' => [ 'VirtualGatewayTlsValidationContextAcmTrust$certificateAuthorityArns' => '<p>One or more ACM Amazon Resource Name (ARN)s.</p>', ], ], 'VirtualGatewayClientPolicy' => [ 'base' => '<p>An object that represents a client policy.</p>', 'refs' => [ 'VirtualGatewayBackendDefaults$clientPolicy' => '<p>A reference to an object that represents a client policy.</p>', ], ], 'VirtualGatewayClientPolicyTls' => [ 'base' => '<p>An object that represents a Transport Layer Security (TLS) client policy.</p>', 'refs' => [ 'VirtualGatewayClientPolicy$tls' => '<p>A reference to an object that represents a Transport Layer Security (TLS) client policy.</p>', ], ], 'VirtualGatewayClientTlsCertificate' => [ 'base' => '<p>An object that represents the virtual gateway\\'s client\\'s Transport Layer Security (TLS) certificate.</p>', 'refs' => [ 'VirtualGatewayClientPolicyTls$certificate' => '<p>A reference to an object that represents a virtual gateway\\'s client\\'s Transport Layer Security (TLS) certificate.</p>', ], ], 'VirtualGatewayConnectionPool' => [ 'base' => '<p>An object that represents the type of virtual gateway connection pool.</p> <p>Only one protocol is used at a time and should be the same protocol as the one chosen under port mapping.</p> <p>If not present the default value for <code>maxPendingRequests</code> is <code>2147483647</code>.</p>', 'refs' => [ 'VirtualGatewayListener$connectionPool' => '<p>The connection pool information for the virtual gateway listener.</p>', ], ], 'VirtualGatewayData' => [ 'base' => '<p>An object that represents a virtual gateway returned by a describe operation.</p>', 'refs' => [ 'CreateVirtualGatewayOutput$virtualGateway' => '<p>The full description of your virtual gateway following the create call.</p>', 'DeleteVirtualGatewayOutput$virtualGateway' => '<p>The virtual gateway that was deleted.</p>', 'DescribeVirtualGatewayOutput$virtualGateway' => '<p>The full description of your virtual gateway.</p>', 'UpdateVirtualGatewayOutput$virtualGateway' => '<p>A full description of the virtual gateway that was updated.</p>', ], ], 'VirtualGatewayFileAccessLog' => [ 'base' => '<p>An object that represents an access log file.</p>', 'refs' => [ 'VirtualGatewayAccessLog$file' => '<p>The file object to send virtual gateway access logs to.</p>', ], ], 'VirtualGatewayGrpcConnectionPool' => [ 'base' => '<p>An object that represents a type of connection pool.</p>', 'refs' => [ 'VirtualGatewayConnectionPool$grpc' => '<p>An object that represents a type of connection pool. </p>', ], ], 'VirtualGatewayHealthCheckIntervalMillis' => [ 'base' => NULL, 'refs' => [ 'VirtualGatewayHealthCheckPolicy$intervalMillis' => '<p>The time period in milliseconds between each health check execution.</p>', ], ], 'VirtualGatewayHealthCheckPolicy' => [ 'base' => '<p>An object that represents the health check policy for a virtual gateway\\'s listener.</p>', 'refs' => [ 'VirtualGatewayListener$healthCheck' => '<p>The health check information for the listener.</p>', ], ], 'VirtualGatewayHealthCheckThreshold' => [ 'base' => NULL, 'refs' => [ 'VirtualGatewayHealthCheckPolicy$healthyThreshold' => '<p>The number of consecutive successful health checks that must occur before declaring the listener healthy.</p>', 'VirtualGatewayHealthCheckPolicy$unhealthyThreshold' => '<p>The number of consecutive failed health checks that must occur before declaring a virtual gateway unhealthy.</p>', ], ], 'VirtualGatewayHealthCheckTimeoutMillis' => [ 'base' => NULL, 'refs' => [ 'VirtualGatewayHealthCheckPolicy$timeoutMillis' => '<p>The amount of time to wait when receiving a response from the health check, in milliseconds.</p>', ], ], 'VirtualGatewayHttp2ConnectionPool' => [ 'base' => '<p>An object that represents a type of connection pool.</p>', 'refs' => [ 'VirtualGatewayConnectionPool$http2' => '<p>An object that represents a type of connection pool.</p>', ], ], 'VirtualGatewayHttpConnectionPool' => [ 'base' => '<p>An object that represents a type of connection pool.</p>', 'refs' => [ 'VirtualGatewayConnectionPool$http' => '<p>An object that represents a type of connection pool.</p>', ], ], 'VirtualGatewayList' => [ 'base' => NULL, 'refs' => [ 'ListVirtualGatewaysOutput$virtualGateways' => '<p>The list of existing virtual gateways for the specified service mesh.</p>', ], ], 'VirtualGatewayListener' => [ 'base' => '<p>An object that represents a listener for a virtual gateway.</p>', 'refs' => [ 'VirtualGatewayListeners$member' => NULL, ], ], 'VirtualGatewayListenerTls' => [ 'base' => '<p>An object that represents the Transport Layer Security (TLS) properties for a listener.</p>', 'refs' => [ 'VirtualGatewayListener$tls' => '<p>A reference to an object that represents the Transport Layer Security (TLS) properties for the listener.</p>', ], ], 'VirtualGatewayListenerTlsAcmCertificate' => [ 'base' => '<p>An object that represents an Certificate Manager certificate.</p>', 'refs' => [ 'VirtualGatewayListenerTlsCertificate$acm' => '<p>A reference to an object that represents an Certificate Manager certificate.</p>', ], ], 'VirtualGatewayListenerTlsCertificate' => [ 'base' => '<p>An object that represents a listener\\'s Transport Layer Security (TLS) certificate.</p>', 'refs' => [ 'VirtualGatewayListenerTls$certificate' => '<p>An object that represents a Transport Layer Security (TLS) certificate.</p>', ], ], 'VirtualGatewayListenerTlsFileCertificate' => [ 'base' => '<p>An object that represents a local file certificate. The certificate must meet specific requirements and you must have proxy authorization enabled. For more information, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/tls.html#virtual-node-tls-prerequisites\">Transport Layer Security (TLS)</a>.</p>', 'refs' => [ 'VirtualGatewayClientTlsCertificate$file' => '<p>An object that represents a local file certificate. The certificate must meet specific requirements and you must have proxy authorization enabled. For more information, see <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/tls.html\"> Transport Layer Security (TLS) </a>.</p>', 'VirtualGatewayListenerTlsCertificate$file' => '<p>A reference to an object that represents a local file certificate.</p>', ], ], 'VirtualGatewayListenerTlsMode' => [ 'base' => NULL, 'refs' => [ 'VirtualGatewayListenerTls$mode' => '<p>Specify one of the following modes.</p> <ul> <li> <p> <b/>STRICT \u00e2\u20ac\u201c Listener only accepts connections with TLS enabled. </p> </li> <li> <p> <b/>PERMISSIVE \u00e2\u20ac\u201c Listener accepts connections with or without TLS enabled.</p> </li> <li> <p> <b/>DISABLED \u00e2\u20ac\u201c Listener only accepts connections without TLS. </p> </li> </ul>', ], ], 'VirtualGatewayListenerTlsSdsCertificate' => [ 'base' => '<p>An object that represents the virtual gateway\\'s listener\\'s Secret Discovery Service certificate.The proxy must be configured with a local SDS provider via a Unix Domain Socket. See App Mesh<a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/tls.html\">TLS documentation</a> for more info. </p>', 'refs' => [ 'VirtualGatewayClientTlsCertificate$sds' => '<p>A reference to an object that represents a virtual gateway\\'s client\\'s Secret Discovery Service certificate.</p>', 'VirtualGatewayListenerTlsCertificate$sds' => '<p>A reference to an object that represents a virtual gateway\\'s listener\\'s Secret Discovery Service certificate.</p>', ], ], 'VirtualGatewayListenerTlsValidationContext' => [ 'base' => '<p>An object that represents a virtual gateway\\'s listener\\'s Transport Layer Security (TLS) validation context.</p>', 'refs' => [ 'VirtualGatewayListenerTls$validation' => '<p>A reference to an object that represents a virtual gateway\\'s listener\\'s Transport Layer Security (TLS) validation context.</p>', ], ], 'VirtualGatewayListenerTlsValidationContextTrust' => [ 'base' => '<p>An object that represents a virtual gateway\\'s listener\\'s Transport Layer Security (TLS) validation context trust.</p>', 'refs' => [ 'VirtualGatewayListenerTlsValidationContext$trust' => '<p>A reference to where to retrieve the trust chain when validating a peer\u00e2\u20ac\u2122s Transport Layer Security (TLS) certificate.</p>', ], ], 'VirtualGatewayListeners' => [ 'base' => NULL, 'refs' => [ 'VirtualGatewaySpec$listeners' => '<p>The listeners that the mesh endpoint is expected to receive inbound traffic from. You can specify one listener.</p>', ], ], 'VirtualGatewayLogging' => [ 'base' => '<p>An object that represents logging information.</p>', 'refs' => [ 'VirtualGatewaySpec$logging' => NULL, ], ], 'VirtualGatewayPortMapping' => [ 'base' => '<p>An object that represents a port mapping.</p>', 'refs' => [ 'VirtualGatewayListener$portMapping' => '<p>The port mapping information for the listener.</p>', ], ], 'VirtualGatewayPortProtocol' => [ 'base' => NULL, 'refs' => [ 'VirtualGatewayHealthCheckPolicy$protocol' => '<p>The protocol for the health check request. If you specify <code>grpc</code>, then your service must conform to the <a href=\"https://github.com/grpc/grpc/blob/master/doc/health-checking.md\">GRPC Health Checking Protocol</a>.</p>', 'VirtualGatewayPortMapping$protocol' => '<p>The protocol used for the port mapping.</p>', ], ], 'VirtualGatewayRef' => [ 'base' => '<p>An object that represents a virtual gateway returned by a list operation.</p>', 'refs' => [ 'VirtualGatewayList$member' => NULL, ], ], 'VirtualGatewaySdsSecretName' => [ 'base' => NULL, 'refs' => [ 'VirtualGatewayListenerTlsSdsCertificate$secretName' => '<p>A reference to an object that represents the name of the secret secret requested from the Secret Discovery Service provider representing Transport Layer Security (TLS) materials like a certificate or certificate chain.</p>', 'VirtualGatewayTlsValidationContextSdsTrust$secretName' => '<p>A reference to an object that represents the name of the secret for a virtual gateway\\'s Transport Layer Security (TLS) Secret Discovery Service validation context trust.</p>', ], ], 'VirtualGatewaySpec' => [ 'base' => '<p>An object that represents the specification of a service mesh resource.</p>', 'refs' => [ 'CreateVirtualGatewayInput$spec' => '<p>The virtual gateway specification to apply.</p>', 'UpdateVirtualGatewayInput$spec' => '<p>The new virtual gateway specification to apply. This overwrites the existing data.</p>', 'VirtualGatewayData$spec' => '<p>The specifications of the virtual gateway.</p>', ], ], 'VirtualGatewayStatus' => [ 'base' => '<p>An object that represents the status of the mesh resource.</p>', 'refs' => [ 'VirtualGatewayData$status' => '<p>The current status of the virtual gateway.</p>', ], ], 'VirtualGatewayStatusCode' => [ 'base' => NULL, 'refs' => [ 'VirtualGatewayStatus$status' => '<p>The current status.</p>', ], ], 'VirtualGatewayTlsValidationContext' => [ 'base' => '<p>An object that represents a Transport Layer Security (TLS) validation context.</p>', 'refs' => [ 'VirtualGatewayClientPolicyTls$validation' => '<p>A reference to an object that represents a Transport Layer Security (TLS) validation context.</p>', ], ], 'VirtualGatewayTlsValidationContextAcmTrust' => [ 'base' => '<p>An object that represents a Transport Layer Security (TLS) validation context trust for an Certificate Manager certificate.</p>', 'refs' => [ 'VirtualGatewayTlsValidationContextTrust$acm' => '<p>A reference to an object that represents a Transport Layer Security (TLS) validation context trust for an Certificate Manager certificate.</p>', ], ], 'VirtualGatewayTlsValidationContextFileTrust' => [ 'base' => '<p>An object that represents a Transport Layer Security (TLS) validation context trust for a local file.</p>', 'refs' => [ 'VirtualGatewayListenerTlsValidationContextTrust$file' => '<p>An object that represents a Transport Layer Security (TLS) validation context trust for a local file.</p>', 'VirtualGatewayTlsValidationContextTrust$file' => '<p>An object that represents a Transport Layer Security (TLS) validation context trust for a local file.</p>', ], ], 'VirtualGatewayTlsValidationContextSdsTrust' => [ 'base' => '<p>An object that represents a virtual gateway\\'s listener\\'s Transport Layer Security (TLS) Secret Discovery Service validation context trust. The proxy must be configured with a local SDS provider via a Unix Domain Socket. See App Mesh <a href=\"https://docs.aws.amazon.com/app-mesh/latest/userguide/tls.html\">TLS documentation</a> for more info.</p>', 'refs' => [ 'VirtualGatewayListenerTlsValidationContextTrust$sds' => '<p>A reference to an object that represents a virtual gateway\\'s listener\\'s Transport Layer Security (TLS) Secret Discovery Service validation context trust.</p>', 'VirtualGatewayTlsValidationContextTrust$sds' => '<p>A reference to an object that represents a virtual gateway\\'s Transport Layer Security (TLS) Secret Discovery Service validation context trust.</p>', ], ], 'VirtualGatewayTlsValidationContextTrust' => [ 'base' => '<p>An object that represents a Transport Layer Security (TLS) validation context trust.</p>', 'refs' => [ 'VirtualGatewayTlsValidationContext$trust' => '<p>A reference to where to retrieve the trust chain when validating a peer\u00e2\u20ac\u2122s Transport Layer Security (TLS) certificate.</p>', ], ], 'VirtualNodeConnectionPool' => [ 'base' => '<p>An object that represents the type of virtual node connection pool.</p> <p>Only one protocol is used at a time and should be the same protocol as the one chosen under port mapping.</p> <p>If not present the default value for <code>maxPendingRequests</code> is <code>2147483647</code>.</p> <p/>', 'refs' => [ 'Listener$connectionPool' => '<p>The connection pool information for the listener.</p>', ], ], 'VirtualNodeData' => [ 'base' => '<p>An object that represents a virtual node returned by a describe operation.</p>', 'refs' => [ 'CreateVirtualNodeOutput$virtualNode' => '<p>The full description of your virtual node following the create call.</p>', 'DeleteVirtualNodeOutput$virtualNode' => '<p>The virtual node that was deleted.</p>', 'DescribeVirtualNodeOutput$virtualNode' => '<p>The full description of your virtual node.</p>', 'UpdateVirtualNodeOutput$virtualNode' => '<p>A full description of the virtual node that was updated.</p>', ], ], 'VirtualNodeGrpcConnectionPool' => [ 'base' => '<p>An object that represents a type of connection pool.</p>', 'refs' => [ 'VirtualNodeConnectionPool$grpc' => '<p>An object that represents a type of connection pool.</p>', ], ], 'VirtualNodeHttp2ConnectionPool' => [ 'base' => '<p>An object that represents a type of connection pool.</p>', 'refs' => [ 'VirtualNodeConnectionPool$http2' => '<p>An object that represents a type of connection pool.</p>', ], ], 'VirtualNodeHttpConnectionPool' => [ 'base' => '<p>An object that represents a type of connection pool.</p>', 'refs' => [ 'VirtualNodeConnectionPool$http' => '<p>An object that represents a type of connection pool.</p>', ], ], 'VirtualNodeList' => [ 'base' => NULL, 'refs' => [ 'ListVirtualNodesOutput$virtualNodes' => '<p>The list of existing virtual nodes for the specified service mesh.</p>', ], ], 'VirtualNodeRef' => [ 'base' => '<p>An object that represents a virtual node returned by a list operation.</p>', 'refs' => [ 'VirtualNodeList$member' => NULL, ], ], 'VirtualNodeServiceProvider' => [ 'base' => '<p>An object that represents a virtual node service provider.</p>', 'refs' => [ 'VirtualServiceProvider$virtualNode' => '<p>The virtual node associated with a virtual service.</p>', ], ], 'VirtualNodeSpec' => [ 'base' => '<p>An object that represents the specification of a virtual node.</p>', 'refs' => [ 'CreateVirtualNodeInput$spec' => '<p>The virtual node specification to apply.</p>', 'UpdateVirtualNodeInput$spec' => '<p>The new virtual node specification to apply. This overwrites the existing data.</p>', 'VirtualNodeData$spec' => '<p>The specifications of the virtual node.</p>', ], ], 'VirtualNodeStatus' => [ 'base' => '<p>An object that represents the current status of the virtual node.</p>', 'refs' => [ 'VirtualNodeData$status' => '<p>The current status for the virtual node.</p>', ], ], 'VirtualNodeStatusCode' => [ 'base' => NULL, 'refs' => [ 'VirtualNodeStatus$status' => '<p>The current status of the virtual node.</p>', ], ], 'VirtualNodeTcpConnectionPool' => [ 'base' => '<p>An object that represents a type of connection pool.</p>', 'refs' => [ 'VirtualNodeConnectionPool$tcp' => '<p>An object that represents a type of connection pool.</p>', ], ], 'VirtualRouterData' => [ 'base' => '<p>An object that represents a virtual router returned by a describe operation.</p>', 'refs' => [ 'CreateVirtualRouterOutput$virtualRouter' => '<p>The full description of your virtual router following the create call.</p>', 'DeleteVirtualRouterOutput$virtualRouter' => '<p>The virtual router that was deleted.</p>', 'DescribeVirtualRouterOutput$virtualRouter' => '<p>The full description of your virtual router.</p>', 'UpdateVirtualRouterOutput$virtualRouter' => '<p>A full description of the virtual router that was updated.</p>', ], ], 'VirtualRouterList' => [ 'base' => NULL, 'refs' => [ 'ListVirtualRoutersOutput$virtualRouters' => '<p>The list of existing virtual routers for the specified service mesh.</p>', ], ], 'VirtualRouterListener' => [ 'base' => '<p>An object that represents a virtual router listener.</p>', 'refs' => [ 'VirtualRouterListeners$member' => NULL, ], ], 'VirtualRouterListeners' => [ 'base' => NULL, 'refs' => [ 'VirtualRouterSpec$listeners' => '<p>The listeners that the virtual router is expected to receive inbound traffic from. You can specify one listener.</p>', ], ], 'VirtualRouterRef' => [ 'base' => '<p>An object that represents a virtual router returned by a list operation.</p>', 'refs' => [ 'VirtualRouterList$member' => NULL, ], ], 'VirtualRouterServiceProvider' => [ 'base' => '<p>An object that represents a virtual node service provider.</p>', 'refs' => [ 'VirtualServiceProvider$virtualRouter' => '<p>The virtual router associated with a virtual service.</p>', ], ], 'VirtualRouterSpec' => [ 'base' => '<p>An object that represents the specification of a virtual router.</p>', 'refs' => [ 'CreateVirtualRouterInput$spec' => '<p>The virtual router specification to apply.</p>', 'UpdateVirtualRouterInput$spec' => '<p>The new virtual router specification to apply. This overwrites the existing data.</p>', 'VirtualRouterData$spec' => '<p>The specifications of the virtual router.</p>', ], ], 'VirtualRouterStatus' => [ 'base' => '<p>An object that represents the status of a virtual router. </p>', 'refs' => [ 'VirtualRouterData$status' => '<p>The current status of the virtual router.</p>', ], ], 'VirtualRouterStatusCode' => [ 'base' => NULL, 'refs' => [ 'VirtualRouterStatus$status' => '<p>The current status of the virtual router.</p>', ], ], 'VirtualServiceBackend' => [ 'base' => '<p>An object that represents a virtual service backend for a virtual node.</p>', 'refs' => [ 'Backend$virtualService' => '<p>Specifies a virtual service to use as a backend. </p>', ], ], 'VirtualServiceData' => [ 'base' => '<p>An object that represents a virtual service returned by a describe operation.</p>', 'refs' => [ 'CreateVirtualServiceOutput$virtualService' => '<p>The full description of your virtual service following the create call.</p>', 'DeleteVirtualServiceOutput$virtualService' => '<p>The virtual service that was deleted.</p>', 'DescribeVirtualServiceOutput$virtualService' => '<p>The full description of your virtual service.</p>', 'UpdateVirtualServiceOutput$virtualService' => '<p>A full description of the virtual service that was updated.</p>', ], ], 'VirtualServiceList' => [ 'base' => NULL, 'refs' => [ 'ListVirtualServicesOutput$virtualServices' => '<p>The list of existing virtual services for the specified service mesh.</p>', ], ], 'VirtualServiceProvider' => [ 'base' => '<p>An object that represents the provider for a virtual service.</p>', 'refs' => [ 'VirtualServiceSpec$provider' => '<p>The App Mesh object that is acting as the provider for a virtual service. You can specify a single virtual node or virtual router.</p>', ], ], 'VirtualServiceRef' => [ 'base' => '<p>An object that represents a virtual service returned by a list operation.</p>', 'refs' => [ 'VirtualServiceList$member' => NULL, ], ], 'VirtualServiceSpec' => [ 'base' => '<p>An object that represents the specification of a virtual service.</p>', 'refs' => [ 'CreateVirtualServiceInput$spec' => '<p>The virtual service specification to apply.</p>', 'UpdateVirtualServiceInput$spec' => '<p>The new virtual service specification to apply. This overwrites the existing data.</p>', 'VirtualServiceData$spec' => '<p>The specifications of the virtual service.</p>', ], ], 'VirtualServiceStatus' => [ 'base' => '<p>An object that represents the status of a virtual service.</p>', 'refs' => [ 'VirtualServiceData$status' => '<p>The current status of the virtual service.</p>', ], ], 'VirtualServiceStatusCode' => [ 'base' => NULL, 'refs' => [ 'VirtualServiceStatus$status' => '<p>The current status of the virtual service.</p>', ], ], 'WeightedTarget' => [ 'base' => '<p>An object that represents a target and its relative weight. Traffic is distributed across targets according to their relative weight. For example, a weighted target with a relative weight of 50 receives five times as much traffic as one with a relative weight of 10. The total weight for all targets combined must be less than or equal to 100.</p>', 'refs' => [ 'WeightedTargets$member' => NULL, ], ], 'WeightedTargets' => [ 'base' => NULL, 'refs' => [ 'GrpcRouteAction$weightedTargets' => '<p>An object that represents the targets that traffic is routed to when a request matches the route.</p>', 'HttpRouteAction$weightedTargets' => '<p>An object that represents the targets that traffic is routed to when a request matches the route.</p>', 'TcpRouteAction$weightedTargets' => '<p>An object that represents the targets that traffic is routed to when a request matches the route.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appmesh/2019-01-25/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], [ 'fn' => 'parseURL', 'argv' => [ [ 'ref' => 'Endpoint', ], ], 'assign' => 'url', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appmesh-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appmesh-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appmesh.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appmesh.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appmesh/2019-01-25/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-south-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-south-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-south-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-south-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ca-central-1.api.aws', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ca-central-1.api.aws', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-central-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-central-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.af-south-1.api.aws', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.af-south-1.api.aws', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-north-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-north-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-west-3.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-west-3.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-northeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-northeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-northeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-northeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-northeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-northeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.me-south-1.api.aws', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.me-south-1.api.aws', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.sa-east-1.api.aws', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.sa-east-1.api.aws', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-east-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-east-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-southeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-southeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-southeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-southeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-southeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-southeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh-fips.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appmesh.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appmesh/2019-01-25/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appmesh/2019-01-25/paginators-1.json\nreturn [ 'pagination' => [ 'ListGatewayRoutes' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'limit', 'result_key' => 'gatewayRoutes', ], 'ListMeshes' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'limit', 'result_key' => 'meshes', ], 'ListRoutes' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'limit', 'result_key' => 'routes', ], 'ListTagsForResource' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'limit', 'result_key' => 'tags', ], 'ListVirtualGateways' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'limit', 'result_key' => 'virtualGateways', ], 'ListVirtualNodes' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'limit', 'result_key' => 'virtualNodes', ], 'ListVirtualRouters' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'limit', 'result_key' => 'virtualRouters', ], 'ListVirtualServices' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'limit', 'result_key' => 'virtualServices', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apprunner/2020-05-15/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2020-05-15', 'endpointPrefix' => 'apprunner', 'jsonVersion' => '1.0', 'protocol' => 'json', 'serviceFullName' => 'AWS App Runner', 'serviceId' => 'AppRunner', 'signatureVersion' => 'v4', 'signingName' => 'apprunner', 'targetPrefix' => 'AppRunner', 'uid' => 'apprunner-2020-05-15', ], 'operations' => [ 'AssociateCustomDomain' => [ 'name' => 'AssociateCustomDomain', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AssociateCustomDomainRequest', ], 'output' => [ 'shape' => 'AssociateCustomDomainResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'InvalidStateException', ], ], ], 'CreateAutoScalingConfiguration' => [ 'name' => 'CreateAutoScalingConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateAutoScalingConfigurationRequest', ], 'output' => [ 'shape' => 'CreateAutoScalingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], ], 'CreateConnection' => [ 'name' => 'CreateConnection', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateConnectionRequest', ], 'output' => [ 'shape' => 'CreateConnectionResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], ], 'CreateObservabilityConfiguration' => [ 'name' => 'CreateObservabilityConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateObservabilityConfigurationRequest', ], 'output' => [ 'shape' => 'CreateObservabilityConfigurationResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], ], 'CreateService' => [ 'name' => 'CreateService', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateServiceRequest', ], 'output' => [ 'shape' => 'CreateServiceResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], ], 'CreateVpcConnector' => [ 'name' => 'CreateVpcConnector', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateVpcConnectorRequest', ], 'output' => [ 'shape' => 'CreateVpcConnectorResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], ], 'CreateVpcIngressConnection' => [ 'name' => 'CreateVpcIngressConnection', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateVpcIngressConnectionRequest', ], 'output' => [ 'shape' => 'CreateVpcIngressConnectionResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], ], 'DeleteAutoScalingConfiguration' => [ 'name' => 'DeleteAutoScalingConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteAutoScalingConfigurationRequest', ], 'output' => [ 'shape' => 'DeleteAutoScalingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DeleteConnection' => [ 'name' => 'DeleteConnection', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteConnectionRequest', ], 'output' => [ 'shape' => 'DeleteConnectionResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServiceErrorException', ], ], ], 'DeleteObservabilityConfiguration' => [ 'name' => 'DeleteObservabilityConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteObservabilityConfigurationRequest', ], 'output' => [ 'shape' => 'DeleteObservabilityConfigurationResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DeleteService' => [ 'name' => 'DeleteService', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteServiceRequest', ], 'output' => [ 'shape' => 'DeleteServiceResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'InternalServiceErrorException', ], ], ], 'DeleteVpcConnector' => [ 'name' => 'DeleteVpcConnector', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteVpcConnectorRequest', ], 'output' => [ 'shape' => 'DeleteVpcConnectorResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DeleteVpcIngressConnection' => [ 'name' => 'DeleteVpcIngressConnection', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteVpcIngressConnectionRequest', ], 'output' => [ 'shape' => 'DeleteVpcIngressConnectionResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidStateException', ], ], ], 'DescribeAutoScalingConfiguration' => [ 'name' => 'DescribeAutoScalingConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeAutoScalingConfigurationRequest', ], 'output' => [ 'shape' => 'DescribeAutoScalingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeCustomDomains' => [ 'name' => 'DescribeCustomDomains', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeCustomDomainsRequest', ], 'output' => [ 'shape' => 'DescribeCustomDomainsResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeObservabilityConfiguration' => [ 'name' => 'DescribeObservabilityConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeObservabilityConfigurationRequest', ], 'output' => [ 'shape' => 'DescribeObservabilityConfigurationResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeService' => [ 'name' => 'DescribeService', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeServiceRequest', ], 'output' => [ 'shape' => 'DescribeServiceResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServiceErrorException', ], ], ], 'DescribeVpcConnector' => [ 'name' => 'DescribeVpcConnector', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeVpcConnectorRequest', ], 'output' => [ 'shape' => 'DescribeVpcConnectorResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeVpcIngressConnection' => [ 'name' => 'DescribeVpcIngressConnection', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeVpcIngressConnectionRequest', ], 'output' => [ 'shape' => 'DescribeVpcIngressConnectionResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DisassociateCustomDomain' => [ 'name' => 'DisassociateCustomDomain', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DisassociateCustomDomainRequest', ], 'output' => [ 'shape' => 'DisassociateCustomDomainResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidStateException', ], ], ], 'ListAutoScalingConfigurations' => [ 'name' => 'ListAutoScalingConfigurations', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListAutoScalingConfigurationsRequest', ], 'output' => [ 'shape' => 'ListAutoScalingConfigurationsResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], ], ], 'ListConnections' => [ 'name' => 'ListConnections', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListConnectionsRequest', ], 'output' => [ 'shape' => 'ListConnectionsResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], ], ], 'ListObservabilityConfigurations' => [ 'name' => 'ListObservabilityConfigurations', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListObservabilityConfigurationsRequest', ], 'output' => [ 'shape' => 'ListObservabilityConfigurationsResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], ], ], 'ListOperations' => [ 'name' => 'ListOperations', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListOperationsRequest', ], 'output' => [ 'shape' => 'ListOperationsResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListServices' => [ 'name' => 'ListServices', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListServicesRequest', ], 'output' => [ 'shape' => 'ListServicesResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InvalidStateException', ], ], ], 'ListVpcConnectors' => [ 'name' => 'ListVpcConnectors', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListVpcConnectorsRequest', ], 'output' => [ 'shape' => 'ListVpcConnectorsResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], ], ], 'ListVpcIngressConnections' => [ 'name' => 'ListVpcIngressConnections', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListVpcIngressConnectionsRequest', ], 'output' => [ 'shape' => 'ListVpcIngressConnectionsResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServiceErrorException', ], ], ], 'PauseService' => [ 'name' => 'PauseService', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PauseServiceRequest', ], 'output' => [ 'shape' => 'PauseServiceResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'InvalidStateException', ], ], ], 'ResumeService' => [ 'name' => 'ResumeService', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ResumeServiceRequest', ], 'output' => [ 'shape' => 'ResumeServiceResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'InvalidStateException', ], ], ], 'StartDeployment' => [ 'name' => 'StartDeployment', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StartDeploymentRequest', ], 'output' => [ 'shape' => 'StartDeploymentResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServiceErrorException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InvalidStateException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServiceErrorException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InvalidStateException', ], ], ], 'UpdateService' => [ 'name' => 'UpdateService', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateServiceRequest', ], 'output' => [ 'shape' => 'UpdateServiceResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'InternalServiceErrorException', ], ], ], 'UpdateVpcIngressConnection' => [ 'name' => 'UpdateVpcIngressConnection', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateVpcIngressConnectionRequest', ], 'output' => [ 'shape' => 'UpdateVpcIngressConnectionResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidStateException', ], [ 'shape' => 'InternalServiceErrorException', ], ], ], ], 'shapes' => [ 'ASConfigMaxConcurrency' => [ 'type' => 'integer', 'max' => 200, 'min' => 1, ], 'ASConfigMaxSize' => [ 'type' => 'integer', 'min' => 1, ], 'ASConfigMinSize' => [ 'type' => 'integer', 'max' => 25, 'min' => 1, ], 'AppRunnerResourceArn' => [ 'type' => 'string', 'max' => 1011, 'min' => 1, 'pattern' => 'arn:aws(-[\\\\w]+)*:[a-z0-9-\\\\\\\\.]{0,63}:[a-z0-9-\\\\\\\\.]{0,63}:[0-9]{12}:(\\\\w|\\\\/|-){1,1011}', ], 'AssociateCustomDomainRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceArn', 'DomainName', ], 'members' => [ 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'DomainName' => [ 'shape' => 'DomainName', ], 'EnableWWWSubdomain' => [ 'shape' => 'NullableBoolean', ], ], ], 'AssociateCustomDomainResponse' => [ 'type' => 'structure', 'required' => [ 'DNSTarget', 'ServiceArn', 'CustomDomain', 'VpcDNSTargets', ], 'members' => [ 'DNSTarget' => [ 'shape' => 'String', ], 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'CustomDomain' => [ 'shape' => 'CustomDomain', ], 'VpcDNSTargets' => [ 'shape' => 'VpcDNSTargetList', ], ], ], 'AuthenticationConfiguration' => [ 'type' => 'structure', 'members' => [ 'ConnectionArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'AccessRoleArn' => [ 'shape' => 'RoleArn', ], ], ], 'AutoScalingConfiguration' => [ 'type' => 'structure', 'members' => [ 'AutoScalingConfigurationArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'AutoScalingConfigurationName' => [ 'shape' => 'AutoScalingConfigurationName', ], 'AutoScalingConfigurationRevision' => [ 'shape' => 'Integer', ], 'Latest' => [ 'shape' => 'Boolean', ], 'Status' => [ 'shape' => 'AutoScalingConfigurationStatus', ], 'MaxConcurrency' => [ 'shape' => 'Integer', ], 'MinSize' => [ 'shape' => 'Integer', ], 'MaxSize' => [ 'shape' => 'Integer', ], 'CreatedAt' => [ 'shape' => 'Timestamp', ], 'DeletedAt' => [ 'shape' => 'Timestamp', ], ], ], 'AutoScalingConfigurationName' => [ 'type' => 'string', 'max' => 32, 'min' => 4, 'pattern' => '[A-Za-z0-9][A-Za-z0-9\\\\-_]{3,31}', ], 'AutoScalingConfigurationStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'INACTIVE', ], ], 'AutoScalingConfigurationSummary' => [ 'type' => 'structure', 'members' => [ 'AutoScalingConfigurationArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'AutoScalingConfigurationName' => [ 'shape' => 'AutoScalingConfigurationName', ], 'AutoScalingConfigurationRevision' => [ 'shape' => 'Integer', ], ], ], 'AutoScalingConfigurationSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AutoScalingConfigurationSummary', ], ], 'Boolean' => [ 'type' => 'boolean', ], 'BuildCommand' => [ 'type' => 'string', 'pattern' => '[^\\\\x0a\\\\x0d]+', 'sensitive' => true, ], 'CertificateValidationRecord' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'String', ], 'Type' => [ 'shape' => 'String', ], 'Value' => [ 'shape' => 'String', ], 'Status' => [ 'shape' => 'CertificateValidationRecordStatus', ], ], ], 'CertificateValidationRecordList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CertificateValidationRecord', ], ], 'CertificateValidationRecordStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING_VALIDATION', 'SUCCESS', 'FAILED', ], ], 'CodeConfiguration' => [ 'type' => 'structure', 'required' => [ 'ConfigurationSource', ], 'members' => [ 'ConfigurationSource' => [ 'shape' => 'ConfigurationSource', ], 'CodeConfigurationValues' => [ 'shape' => 'CodeConfigurationValues', ], ], ], 'CodeConfigurationValues' => [ 'type' => 'structure', 'required' => [ 'Runtime', ], 'members' => [ 'Runtime' => [ 'shape' => 'Runtime', ], 'BuildCommand' => [ 'shape' => 'BuildCommand', ], 'StartCommand' => [ 'shape' => 'StartCommand', ], 'Port' => [ 'shape' => 'String', ], 'RuntimeEnvironmentVariables' => [ 'shape' => 'RuntimeEnvironmentVariables', ], 'RuntimeEnvironmentSecrets' => [ 'shape' => 'RuntimeEnvironmentSecrets', ], ], ], 'CodeRepository' => [ 'type' => 'structure', 'required' => [ 'RepositoryUrl', 'SourceCodeVersion', ], 'members' => [ 'RepositoryUrl' => [ 'shape' => 'String', ], 'SourceCodeVersion' => [ 'shape' => 'SourceCodeVersion', ], 'CodeConfiguration' => [ 'shape' => 'CodeConfiguration', ], ], ], 'ConfigurationSource' => [ 'type' => 'string', 'enum' => [ 'REPOSITORY', 'API', ], ], 'Connection' => [ 'type' => 'structure', 'members' => [ 'ConnectionName' => [ 'shape' => 'ConnectionName', ], 'ConnectionArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'ProviderType' => [ 'shape' => 'ProviderType', ], 'Status' => [ 'shape' => 'ConnectionStatus', ], 'CreatedAt' => [ 'shape' => 'Timestamp', ], ], ], 'ConnectionName' => [ 'type' => 'string', 'max' => 32, 'min' => 4, 'pattern' => '[A-Za-z0-9][A-Za-z0-9\\\\-_]{3,31}', ], 'ConnectionStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING_HANDSHAKE', 'AVAILABLE', 'ERROR', 'DELETED', ], ], 'ConnectionSummary' => [ 'type' => 'structure', 'members' => [ 'ConnectionName' => [ 'shape' => 'ConnectionName', ], 'ConnectionArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'ProviderType' => [ 'shape' => 'ProviderType', ], 'Status' => [ 'shape' => 'ConnectionStatus', ], 'CreatedAt' => [ 'shape' => 'Timestamp', ], ], ], 'ConnectionSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConnectionSummary', ], ], 'Cpu' => [ 'type' => 'string', 'max' => 9, 'min' => 3, 'pattern' => '256|512|1024|2048|4096|(0.25|0.5|1|2|4) vCPU', ], 'CreateAutoScalingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'AutoScalingConfigurationName', ], 'members' => [ 'AutoScalingConfigurationName' => [ 'shape' => 'AutoScalingConfigurationName', ], 'MaxConcurrency' => [ 'shape' => 'ASConfigMaxConcurrency', ], 'MinSize' => [ 'shape' => 'ASConfigMinSize', ], 'MaxSize' => [ 'shape' => 'ASConfigMaxSize', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateAutoScalingConfigurationResponse' => [ 'type' => 'structure', 'required' => [ 'AutoScalingConfiguration', ], 'members' => [ 'AutoScalingConfiguration' => [ 'shape' => 'AutoScalingConfiguration', ], ], ], 'CreateConnectionRequest' => [ 'type' => 'structure', 'required' => [ 'ConnectionName', 'ProviderType', ], 'members' => [ 'ConnectionName' => [ 'shape' => 'ConnectionName', ], 'ProviderType' => [ 'shape' => 'ProviderType', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateConnectionResponse' => [ 'type' => 'structure', 'required' => [ 'Connection', ], 'members' => [ 'Connection' => [ 'shape' => 'Connection', ], ], ], 'CreateObservabilityConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'ObservabilityConfigurationName', ], 'members' => [ 'ObservabilityConfigurationName' => [ 'shape' => 'ObservabilityConfigurationName', ], 'TraceConfiguration' => [ 'shape' => 'TraceConfiguration', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateObservabilityConfigurationResponse' => [ 'type' => 'structure', 'required' => [ 'ObservabilityConfiguration', ], 'members' => [ 'ObservabilityConfiguration' => [ 'shape' => 'ObservabilityConfiguration', ], ], ], 'CreateServiceRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceName', 'SourceConfiguration', ], 'members' => [ 'ServiceName' => [ 'shape' => 'ServiceName', ], 'SourceConfiguration' => [ 'shape' => 'SourceConfiguration', ], 'InstanceConfiguration' => [ 'shape' => 'InstanceConfiguration', ], 'Tags' => [ 'shape' => 'TagList', ], 'EncryptionConfiguration' => [ 'shape' => 'EncryptionConfiguration', ], 'HealthCheckConfiguration' => [ 'shape' => 'HealthCheckConfiguration', ], 'AutoScalingConfigurationArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'NetworkConfiguration' => [ 'shape' => 'NetworkConfiguration', ], 'ObservabilityConfiguration' => [ 'shape' => 'ServiceObservabilityConfiguration', ], ], ], 'CreateServiceResponse' => [ 'type' => 'structure', 'required' => [ 'Service', 'OperationId', ], 'members' => [ 'Service' => [ 'shape' => 'Service', ], 'OperationId' => [ 'shape' => 'UUID', ], ], ], 'CreateVpcConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'VpcConnectorName', 'Subnets', ], 'members' => [ 'VpcConnectorName' => [ 'shape' => 'VpcConnectorName', ], 'Subnets' => [ 'shape' => 'StringList', ], 'SecurityGroups' => [ 'shape' => 'StringList', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateVpcConnectorResponse' => [ 'type' => 'structure', 'required' => [ 'VpcConnector', ], 'members' => [ 'VpcConnector' => [ 'shape' => 'VpcConnector', ], ], ], 'CreateVpcIngressConnectionRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceArn', 'VpcIngressConnectionName', 'IngressVpcConfiguration', ], 'members' => [ 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'VpcIngressConnectionName' => [ 'shape' => 'VpcIngressConnectionName', ], 'IngressVpcConfiguration' => [ 'shape' => 'IngressVpcConfiguration', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateVpcIngressConnectionResponse' => [ 'type' => 'structure', 'required' => [ 'VpcIngressConnection', ], 'members' => [ 'VpcIngressConnection' => [ 'shape' => 'VpcIngressConnection', ], ], ], 'CustomDomain' => [ 'type' => 'structure', 'required' => [ 'DomainName', 'EnableWWWSubdomain', 'Status', ], 'members' => [ 'DomainName' => [ 'shape' => 'DomainName', ], 'EnableWWWSubdomain' => [ 'shape' => 'NullableBoolean', ], 'CertificateValidationRecords' => [ 'shape' => 'CertificateValidationRecordList', ], 'Status' => [ 'shape' => 'CustomDomainAssociationStatus', ], ], ], 'CustomDomainAssociationStatus' => [ 'type' => 'string', 'enum' => [ 'CREATING', 'CREATE_FAILED', 'ACTIVE', 'DELETING', 'DELETE_FAILED', 'PENDING_CERTIFICATE_DNS_VALIDATION', 'BINDING_CERTIFICATE', ], ], 'CustomDomainList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CustomDomain', ], ], 'CustomerAccountId' => [ 'type' => 'string', 'max' => 12, 'min' => 12, 'pattern' => '[0-9]{12}', ], 'DeleteAutoScalingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'AutoScalingConfigurationArn', ], 'members' => [ 'AutoScalingConfigurationArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'DeleteAutoScalingConfigurationResponse' => [ 'type' => 'structure', 'required' => [ 'AutoScalingConfiguration', ], 'members' => [ 'AutoScalingConfiguration' => [ 'shape' => 'AutoScalingConfiguration', ], ], ], 'DeleteConnectionRequest' => [ 'type' => 'structure', 'required' => [ 'ConnectionArn', ], 'members' => [ 'ConnectionArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'DeleteConnectionResponse' => [ 'type' => 'structure', 'members' => [ 'Connection' => [ 'shape' => 'Connection', ], ], ], 'DeleteObservabilityConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'ObservabilityConfigurationArn', ], 'members' => [ 'ObservabilityConfigurationArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'DeleteObservabilityConfigurationResponse' => [ 'type' => 'structure', 'required' => [ 'ObservabilityConfiguration', ], 'members' => [ 'ObservabilityConfiguration' => [ 'shape' => 'ObservabilityConfiguration', ], ], ], 'DeleteServiceRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceArn', ], 'members' => [ 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'DeleteServiceResponse' => [ 'type' => 'structure', 'required' => [ 'Service', 'OperationId', ], 'members' => [ 'Service' => [ 'shape' => 'Service', ], 'OperationId' => [ 'shape' => 'UUID', ], ], ], 'DeleteVpcConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'VpcConnectorArn', ], 'members' => [ 'VpcConnectorArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'DeleteVpcConnectorResponse' => [ 'type' => 'structure', 'required' => [ 'VpcConnector', ], 'members' => [ 'VpcConnector' => [ 'shape' => 'VpcConnector', ], ], ], 'DeleteVpcIngressConnectionRequest' => [ 'type' => 'structure', 'required' => [ 'VpcIngressConnectionArn', ], 'members' => [ 'VpcIngressConnectionArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'DeleteVpcIngressConnectionResponse' => [ 'type' => 'structure', 'required' => [ 'VpcIngressConnection', ], 'members' => [ 'VpcIngressConnection' => [ 'shape' => 'VpcIngressConnection', ], ], ], 'DescribeAutoScalingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'AutoScalingConfigurationArn', ], 'members' => [ 'AutoScalingConfigurationArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'DescribeAutoScalingConfigurationResponse' => [ 'type' => 'structure', 'required' => [ 'AutoScalingConfiguration', ], 'members' => [ 'AutoScalingConfiguration' => [ 'shape' => 'AutoScalingConfiguration', ], ], ], 'DescribeCustomDomainsMaxResults' => [ 'type' => 'integer', 'max' => 5, 'min' => 1, ], 'DescribeCustomDomainsRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceArn', ], 'members' => [ 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'NextToken' => [ 'shape' => 'String', ], 'MaxResults' => [ 'shape' => 'DescribeCustomDomainsMaxResults', ], ], ], 'DescribeCustomDomainsResponse' => [ 'type' => 'structure', 'required' => [ 'DNSTarget', 'ServiceArn', 'CustomDomains', 'VpcDNSTargets', ], 'members' => [ 'DNSTarget' => [ 'shape' => 'String', ], 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'CustomDomains' => [ 'shape' => 'CustomDomainList', ], 'VpcDNSTargets' => [ 'shape' => 'VpcDNSTargetList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeObservabilityConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'ObservabilityConfigurationArn', ], 'members' => [ 'ObservabilityConfigurationArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'DescribeObservabilityConfigurationResponse' => [ 'type' => 'structure', 'required' => [ 'ObservabilityConfiguration', ], 'members' => [ 'ObservabilityConfiguration' => [ 'shape' => 'ObservabilityConfiguration', ], ], ], 'DescribeServiceRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceArn', ], 'members' => [ 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'DescribeServiceResponse' => [ 'type' => 'structure', 'required' => [ 'Service', ], 'members' => [ 'Service' => [ 'shape' => 'Service', ], ], ], 'DescribeVpcConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'VpcConnectorArn', ], 'members' => [ 'VpcConnectorArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'DescribeVpcConnectorResponse' => [ 'type' => 'structure', 'required' => [ 'VpcConnector', ], 'members' => [ 'VpcConnector' => [ 'shape' => 'VpcConnector', ], ], ], 'DescribeVpcIngressConnectionRequest' => [ 'type' => 'structure', 'required' => [ 'VpcIngressConnectionArn', ], 'members' => [ 'VpcIngressConnectionArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'DescribeVpcIngressConnectionResponse' => [ 'type' => 'structure', 'required' => [ 'VpcIngressConnection', ], 'members' => [ 'VpcIngressConnection' => [ 'shape' => 'VpcIngressConnection', ], ], ], 'DisassociateCustomDomainRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceArn', 'DomainName', ], 'members' => [ 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'DomainName' => [ 'shape' => 'DomainName', ], ], ], 'DisassociateCustomDomainResponse' => [ 'type' => 'structure', 'required' => [ 'DNSTarget', 'ServiceArn', 'CustomDomain', 'VpcDNSTargets', ], 'members' => [ 'DNSTarget' => [ 'shape' => 'String', ], 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'CustomDomain' => [ 'shape' => 'CustomDomain', ], 'VpcDNSTargets' => [ 'shape' => 'VpcDNSTargetList', ], ], ], 'DomainName' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '[A-Za-z0-9*.-]{1,255}', ], 'EgressConfiguration' => [ 'type' => 'structure', 'members' => [ 'EgressType' => [ 'shape' => 'EgressType', ], 'VpcConnectorArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'EgressType' => [ 'type' => 'string', 'enum' => [ 'DEFAULT', 'VPC', ], ], 'EncryptionConfiguration' => [ 'type' => 'structure', 'required' => [ 'KmsKey', ], 'members' => [ 'KmsKey' => [ 'shape' => 'KmsKeyArn', ], ], ], 'ErrorMessage' => [ 'type' => 'string', 'max' => 600, ], 'HealthCheckConfiguration' => [ 'type' => 'structure', 'members' => [ 'Protocol' => [ 'shape' => 'HealthCheckProtocol', ], 'Path' => [ 'shape' => 'HealthCheckPath', ], 'Interval' => [ 'shape' => 'HealthCheckInterval', ], 'Timeout' => [ 'shape' => 'HealthCheckTimeout', ], 'HealthyThreshold' => [ 'shape' => 'HealthCheckHealthyThreshold', ], 'UnhealthyThreshold' => [ 'shape' => 'HealthCheckUnhealthyThreshold', ], ], ], 'HealthCheckHealthyThreshold' => [ 'type' => 'integer', 'max' => 20, 'min' => 1, ], 'HealthCheckInterval' => [ 'type' => 'integer', 'max' => 20, 'min' => 1, ], 'HealthCheckPath' => [ 'type' => 'string', 'min' => 1, ], 'HealthCheckProtocol' => [ 'type' => 'string', 'enum' => [ 'TCP', 'HTTP', ], ], 'HealthCheckTimeout' => [ 'type' => 'integer', 'max' => 20, 'min' => 1, ], 'HealthCheckUnhealthyThreshold' => [ 'type' => 'integer', 'max' => 20, 'min' => 1, ], 'ImageConfiguration' => [ 'type' => 'structure', 'members' => [ 'RuntimeEnvironmentVariables' => [ 'shape' => 'RuntimeEnvironmentVariables', ], 'StartCommand' => [ 'shape' => 'StartCommand', ], 'Port' => [ 'shape' => 'String', ], 'RuntimeEnvironmentSecrets' => [ 'shape' => 'RuntimeEnvironmentSecrets', ], ], ], 'ImageIdentifier' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, 'pattern' => '([0-9]{12}.dkr.ecr.[a-z\\\\-]+-[0-9]{1}.amazonaws.com\\\\/((?:[a-z0-9]+(?:[._-][a-z0-9]+)*\\\\/)*[a-z0-9]+(?:[._-][a-z0-9]+)*)(:([\\\\w\\\\d+\\\\-=._:\\\\/@])+|@([\\\\w\\\\d\\\\:]+))?)|(^public\\\\.ecr\\\\.aws\\\\/.+\\\\/((?:[a-z0-9]+(?:[._-][a-z0-9]+)*\\\\/)*[a-z0-9]+(?:[._-][a-z0-9]+)*)(:([\\\\w\\\\d+\\\\-=._:\\\\/@])+|@([\\\\w\\\\d\\\\:]+))?)', ], 'ImageRepository' => [ 'type' => 'structure', 'required' => [ 'ImageIdentifier', 'ImageRepositoryType', ], 'members' => [ 'ImageIdentifier' => [ 'shape' => 'ImageIdentifier', ], 'ImageConfiguration' => [ 'shape' => 'ImageConfiguration', ], 'ImageRepositoryType' => [ 'shape' => 'ImageRepositoryType', ], ], ], 'ImageRepositoryType' => [ 'type' => 'string', 'enum' => [ 'ECR', 'ECR_PUBLIC', ], ], 'IngressConfiguration' => [ 'type' => 'structure', 'members' => [ 'IsPubliclyAccessible' => [ 'shape' => 'Boolean', ], ], ], 'IngressVpcConfiguration' => [ 'type' => 'structure', 'members' => [ 'VpcId' => [ 'shape' => 'String', ], 'VpcEndpointId' => [ 'shape' => 'String', ], ], ], 'InstanceConfiguration' => [ 'type' => 'structure', 'members' => [ 'Cpu' => [ 'shape' => 'Cpu', ], 'Memory' => [ 'shape' => 'Memory', ], 'InstanceRoleArn' => [ 'shape' => 'RoleArn', ], ], ], 'Integer' => [ 'type' => 'integer', ], 'InternalServiceErrorException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, 'fault' => true, ], 'InvalidRequestException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'InvalidStateException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'KmsKeyArn' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => 'arn:aws(-[\\\\w]+)*:kms:[a-z\\\\-]+-[0-9]{1}:[0-9]{12}:key\\\\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}', ], 'ListAutoScalingConfigurationsRequest' => [ 'type' => 'structure', 'members' => [ 'AutoScalingConfigurationName' => [ 'shape' => 'AutoScalingConfigurationName', ], 'LatestOnly' => [ 'shape' => 'Boolean', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListAutoScalingConfigurationsResponse' => [ 'type' => 'structure', 'required' => [ 'AutoScalingConfigurationSummaryList', ], 'members' => [ 'AutoScalingConfigurationSummaryList' => [ 'shape' => 'AutoScalingConfigurationSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListConnectionsRequest' => [ 'type' => 'structure', 'members' => [ 'ConnectionName' => [ 'shape' => 'ConnectionName', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListConnectionsResponse' => [ 'type' => 'structure', 'required' => [ 'ConnectionSummaryList', ], 'members' => [ 'ConnectionSummaryList' => [ 'shape' => 'ConnectionSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListObservabilityConfigurationsRequest' => [ 'type' => 'structure', 'members' => [ 'ObservabilityConfigurationName' => [ 'shape' => 'ObservabilityConfigurationName', ], 'LatestOnly' => [ 'shape' => 'Boolean', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListObservabilityConfigurationsResponse' => [ 'type' => 'structure', 'required' => [ 'ObservabilityConfigurationSummaryList', ], 'members' => [ 'ObservabilityConfigurationSummaryList' => [ 'shape' => 'ObservabilityConfigurationSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListOperationsMaxResults' => [ 'type' => 'integer', 'max' => 20, 'min' => 1, ], 'ListOperationsRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceArn', ], 'members' => [ 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'NextToken' => [ 'shape' => 'String', ], 'MaxResults' => [ 'shape' => 'ListOperationsMaxResults', ], ], ], 'ListOperationsResponse' => [ 'type' => 'structure', 'members' => [ 'OperationSummaryList' => [ 'shape' => 'OperationSummaryList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListServicesRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'String', ], 'MaxResults' => [ 'shape' => 'ServiceMaxResults', ], ], ], 'ListServicesResponse' => [ 'type' => 'structure', 'required' => [ 'ServiceSummaryList', ], 'members' => [ 'ServiceSummaryList' => [ 'shape' => 'ServiceSummaryList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], ], ], 'ListVpcConnectorsRequest' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListVpcConnectorsResponse' => [ 'type' => 'structure', 'required' => [ 'VpcConnectors', ], 'members' => [ 'VpcConnectors' => [ 'shape' => 'VpcConnectors', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListVpcIngressConnectionsFilter' => [ 'type' => 'structure', 'members' => [ 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'VpcEndpointId' => [ 'shape' => 'String', ], ], ], 'ListVpcIngressConnectionsRequest' => [ 'type' => 'structure', 'members' => [ 'Filter' => [ 'shape' => 'ListVpcIngressConnectionsFilter', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListVpcIngressConnectionsResponse' => [ 'type' => 'structure', 'required' => [ 'VpcIngressConnectionSummaryList', ], 'members' => [ 'VpcIngressConnectionSummaryList' => [ 'shape' => 'VpcIngressConnectionSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'MaxResults' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'Memory' => [ 'type' => 'string', 'max' => 6, 'min' => 3, 'pattern' => '512|1024|2048|3072|4096|6144|8192|10240|12288|(0.5|1|2|3|4|6|8|10|12) GB', ], 'NetworkConfiguration' => [ 'type' => 'structure', 'members' => [ 'EgressConfiguration' => [ 'shape' => 'EgressConfiguration', ], 'IngressConfiguration' => [ 'shape' => 'IngressConfiguration', ], ], ], 'NextToken' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, 'pattern' => '.*', ], 'NullableBoolean' => [ 'type' => 'boolean', ], 'ObservabilityConfiguration' => [ 'type' => 'structure', 'members' => [ 'ObservabilityConfigurationArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'ObservabilityConfigurationName' => [ 'shape' => 'ObservabilityConfigurationName', ], 'TraceConfiguration' => [ 'shape' => 'TraceConfiguration', ], 'ObservabilityConfigurationRevision' => [ 'shape' => 'Integer', ], 'Latest' => [ 'shape' => 'Boolean', ], 'Status' => [ 'shape' => 'ObservabilityConfigurationStatus', ], 'CreatedAt' => [ 'shape' => 'Timestamp', ], 'DeletedAt' => [ 'shape' => 'Timestamp', ], ], ], 'ObservabilityConfigurationName' => [ 'type' => 'string', 'max' => 32, 'min' => 4, 'pattern' => '[A-Za-z0-9][A-Za-z0-9\\\\-_]{3,31}', ], 'ObservabilityConfigurationStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'INACTIVE', ], ], 'ObservabilityConfigurationSummary' => [ 'type' => 'structure', 'members' => [ 'ObservabilityConfigurationArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'ObservabilityConfigurationName' => [ 'shape' => 'ObservabilityConfigurationName', ], 'ObservabilityConfigurationRevision' => [ 'shape' => 'Integer', ], ], ], 'ObservabilityConfigurationSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ObservabilityConfigurationSummary', ], ], 'OperationStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING', 'IN_PROGRESS', 'FAILED', 'SUCCEEDED', 'ROLLBACK_IN_PROGRESS', 'ROLLBACK_FAILED', 'ROLLBACK_SUCCEEDED', ], ], 'OperationSummary' => [ 'type' => 'structure', 'members' => [ 'Id' => [ 'shape' => 'UUID', ], 'Type' => [ 'shape' => 'OperationType', ], 'Status' => [ 'shape' => 'OperationStatus', ], 'TargetArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'StartedAt' => [ 'shape' => 'Timestamp', ], 'EndedAt' => [ 'shape' => 'Timestamp', ], 'UpdatedAt' => [ 'shape' => 'Timestamp', ], ], ], 'OperationSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'OperationSummary', ], ], 'OperationType' => [ 'type' => 'string', 'enum' => [ 'START_DEPLOYMENT', 'CREATE_SERVICE', 'PAUSE_SERVICE', 'RESUME_SERVICE', 'DELETE_SERVICE', 'UPDATE_SERVICE', ], ], 'PauseServiceRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceArn', ], 'members' => [ 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'PauseServiceResponse' => [ 'type' => 'structure', 'required' => [ 'Service', ], 'members' => [ 'Service' => [ 'shape' => 'Service', ], 'OperationId' => [ 'shape' => 'UUID', ], ], ], 'ProviderType' => [ 'type' => 'string', 'enum' => [ 'GITHUB', ], ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ResumeServiceRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceArn', ], 'members' => [ 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'ResumeServiceResponse' => [ 'type' => 'structure', 'required' => [ 'Service', ], 'members' => [ 'Service' => [ 'shape' => 'Service', ], 'OperationId' => [ 'shape' => 'UUID', ], ], ], 'RoleArn' => [ 'type' => 'string', 'max' => 1024, 'min' => 29, 'pattern' => 'arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):iam::[0-9]{12}:(role|role\\\\/service-role)\\\\/[\\\\w+=,.@\\\\-/]{1,1000}', ], 'Runtime' => [ 'type' => 'string', 'enum' => [ 'PYTHON_3', 'NODEJS_12', 'NODEJS_14', 'CORRETTO_8', 'CORRETTO_11', 'NODEJS_16', 'GO_1', 'DOTNET_6', 'PHP_81', 'RUBY_31', ], ], 'RuntimeEnvironmentSecrets' => [ 'type' => 'map', 'key' => [ 'shape' => 'RuntimeEnvironmentSecretsName', ], 'value' => [ 'shape' => 'RuntimeEnvironmentSecretsValue', ], ], 'RuntimeEnvironmentSecretsName' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, 'sensitive' => true, ], 'RuntimeEnvironmentSecretsValue' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, 'sensitive' => true, ], 'RuntimeEnvironmentVariables' => [ 'type' => 'map', 'key' => [ 'shape' => 'RuntimeEnvironmentVariablesKey', ], 'value' => [ 'shape' => 'RuntimeEnvironmentVariablesValue', ], ], 'RuntimeEnvironmentVariablesKey' => [ 'type' => 'string', 'max' => 51200, 'min' => 1, 'pattern' => '.*', 'sensitive' => true, ], 'RuntimeEnvironmentVariablesValue' => [ 'type' => 'string', 'max' => 51200, 'min' => 0, 'pattern' => '.*', 'sensitive' => true, ], 'Service' => [ 'type' => 'structure', 'required' => [ 'ServiceName', 'ServiceId', 'ServiceArn', 'CreatedAt', 'UpdatedAt', 'Status', 'SourceConfiguration', 'InstanceConfiguration', 'AutoScalingConfigurationSummary', 'NetworkConfiguration', ], 'members' => [ 'ServiceName' => [ 'shape' => 'ServiceName', ], 'ServiceId' => [ 'shape' => 'ServiceId', ], 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'ServiceUrl' => [ 'shape' => 'String', ], 'CreatedAt' => [ 'shape' => 'Timestamp', ], 'UpdatedAt' => [ 'shape' => 'Timestamp', ], 'DeletedAt' => [ 'shape' => 'Timestamp', ], 'Status' => [ 'shape' => 'ServiceStatus', ], 'SourceConfiguration' => [ 'shape' => 'SourceConfiguration', ], 'InstanceConfiguration' => [ 'shape' => 'InstanceConfiguration', ], 'EncryptionConfiguration' => [ 'shape' => 'EncryptionConfiguration', ], 'HealthCheckConfiguration' => [ 'shape' => 'HealthCheckConfiguration', ], 'AutoScalingConfigurationSummary' => [ 'shape' => 'AutoScalingConfigurationSummary', ], 'NetworkConfiguration' => [ 'shape' => 'NetworkConfiguration', ], 'ObservabilityConfiguration' => [ 'shape' => 'ServiceObservabilityConfiguration', ], ], ], 'ServiceId' => [ 'type' => 'string', 'max' => 32, 'min' => 32, 'pattern' => '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}', ], 'ServiceMaxResults' => [ 'type' => 'integer', 'max' => 20, 'min' => 1, ], 'ServiceName' => [ 'type' => 'string', 'max' => 40, 'min' => 4, 'pattern' => '[A-Za-z0-9][A-Za-z0-9-_]{3,39}', ], 'ServiceObservabilityConfiguration' => [ 'type' => 'structure', 'required' => [ 'ObservabilityEnabled', ], 'members' => [ 'ObservabilityEnabled' => [ 'shape' => 'Boolean', ], 'ObservabilityConfigurationArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'ServiceQuotaExceededException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ServiceStatus' => [ 'type' => 'string', 'enum' => [ 'CREATE_FAILED', 'RUNNING', 'DELETED', 'DELETE_FAILED', 'PAUSED', 'OPERATION_IN_PROGRESS', ], ], 'ServiceSummary' => [ 'type' => 'structure', 'members' => [ 'ServiceName' => [ 'shape' => 'ServiceName', ], 'ServiceId' => [ 'shape' => 'ServiceId', ], 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'ServiceUrl' => [ 'shape' => 'String', ], 'CreatedAt' => [ 'shape' => 'Timestamp', ], 'UpdatedAt' => [ 'shape' => 'Timestamp', ], 'Status' => [ 'shape' => 'ServiceStatus', ], ], ], 'ServiceSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ServiceSummary', ], ], 'SourceCodeVersion' => [ 'type' => 'structure', 'required' => [ 'Type', 'Value', ], 'members' => [ 'Type' => [ 'shape' => 'SourceCodeVersionType', ], 'Value' => [ 'shape' => 'String', ], ], ], 'SourceCodeVersionType' => [ 'type' => 'string', 'enum' => [ 'BRANCH', ], ], 'SourceConfiguration' => [ 'type' => 'structure', 'members' => [ 'CodeRepository' => [ 'shape' => 'CodeRepository', ], 'ImageRepository' => [ 'shape' => 'ImageRepository', ], 'AutoDeploymentsEnabled' => [ 'shape' => 'NullableBoolean', ], 'AuthenticationConfiguration' => [ 'shape' => 'AuthenticationConfiguration', ], ], ], 'StartCommand' => [ 'type' => 'string', 'pattern' => '[^\\\\x0a\\\\x0d]+', 'sensitive' => true, ], 'StartDeploymentRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceArn', ], 'members' => [ 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'StartDeploymentResponse' => [ 'type' => 'structure', 'required' => [ 'OperationId', ], 'members' => [ 'OperationId' => [ 'shape' => 'UUID', ], ], ], 'String' => [ 'type' => 'string', 'max' => 51200, 'min' => 0, 'pattern' => '.*', ], 'StringList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'Tag' => [ 'type' => 'structure', 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^(?!aws:).+', ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'Tags', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => '.*', ], 'Timestamp' => [ 'type' => 'timestamp', ], 'TraceConfiguration' => [ 'type' => 'structure', 'required' => [ 'Vendor', ], 'members' => [ 'Vendor' => [ 'shape' => 'TracingVendor', ], ], ], 'TracingVendor' => [ 'type' => 'string', 'enum' => [ 'AWSXRAY', ], ], 'UUID' => [ 'type' => 'string', 'max' => 36, 'min' => 36, 'pattern' => '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}', ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'TagKeys', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'TagKeys' => [ 'shape' => 'TagKeyList', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateServiceRequest' => [ 'type' => 'structure', 'required' => [ 'ServiceArn', ], 'members' => [ 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'SourceConfiguration' => [ 'shape' => 'SourceConfiguration', ], 'InstanceConfiguration' => [ 'shape' => 'InstanceConfiguration', ], 'AutoScalingConfigurationArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'HealthCheckConfiguration' => [ 'shape' => 'HealthCheckConfiguration', ], 'NetworkConfiguration' => [ 'shape' => 'NetworkConfiguration', ], 'ObservabilityConfiguration' => [ 'shape' => 'ServiceObservabilityConfiguration', ], ], ], 'UpdateServiceResponse' => [ 'type' => 'structure', 'required' => [ 'Service', 'OperationId', ], 'members' => [ 'Service' => [ 'shape' => 'Service', ], 'OperationId' => [ 'shape' => 'UUID', ], ], ], 'UpdateVpcIngressConnectionRequest' => [ 'type' => 'structure', 'required' => [ 'VpcIngressConnectionArn', 'IngressVpcConfiguration', ], 'members' => [ 'VpcIngressConnectionArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'IngressVpcConfiguration' => [ 'shape' => 'IngressVpcConfiguration', ], ], ], 'UpdateVpcIngressConnectionResponse' => [ 'type' => 'structure', 'required' => [ 'VpcIngressConnection', ], 'members' => [ 'VpcIngressConnection' => [ 'shape' => 'VpcIngressConnection', ], ], ], 'VpcConnector' => [ 'type' => 'structure', 'members' => [ 'VpcConnectorName' => [ 'shape' => 'VpcConnectorName', ], 'VpcConnectorArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'VpcConnectorRevision' => [ 'shape' => 'Integer', ], 'Subnets' => [ 'shape' => 'StringList', ], 'SecurityGroups' => [ 'shape' => 'StringList', ], 'Status' => [ 'shape' => 'VpcConnectorStatus', ], 'CreatedAt' => [ 'shape' => 'Timestamp', ], 'DeletedAt' => [ 'shape' => 'Timestamp', ], ], ], 'VpcConnectorName' => [ 'type' => 'string', 'max' => 40, 'min' => 4, 'pattern' => '[A-Za-z0-9][A-Za-z0-9\\\\-_]{3,39}', ], 'VpcConnectorStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'INACTIVE', ], ], 'VpcConnectors' => [ 'type' => 'list', 'member' => [ 'shape' => 'VpcConnector', ], ], 'VpcDNSTarget' => [ 'type' => 'structure', 'members' => [ 'VpcIngressConnectionArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'VpcId' => [ 'shape' => 'String', ], 'DomainName' => [ 'shape' => 'DomainName', ], ], ], 'VpcDNSTargetList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VpcDNSTarget', ], ], 'VpcIngressConnection' => [ 'type' => 'structure', 'members' => [ 'VpcIngressConnectionArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'VpcIngressConnectionName' => [ 'shape' => 'VpcIngressConnectionName', ], 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'Status' => [ 'shape' => 'VpcIngressConnectionStatus', ], 'AccountId' => [ 'shape' => 'CustomerAccountId', ], 'DomainName' => [ 'shape' => 'DomainName', ], 'IngressVpcConfiguration' => [ 'shape' => 'IngressVpcConfiguration', ], 'CreatedAt' => [ 'shape' => 'Timestamp', ], 'DeletedAt' => [ 'shape' => 'Timestamp', ], ], ], 'VpcIngressConnectionName' => [ 'type' => 'string', 'max' => 40, 'min' => 4, 'pattern' => '[A-Za-z0-9][A-Za-z0-9\\\\-_]{3,39}', ], 'VpcIngressConnectionStatus' => [ 'type' => 'string', 'enum' => [ 'AVAILABLE', 'PENDING_CREATION', 'PENDING_UPDATE', 'PENDING_DELETION', 'FAILED_CREATION', 'FAILED_UPDATE', 'FAILED_DELETION', 'DELETED', ], ], 'VpcIngressConnectionSummary' => [ 'type' => 'structure', 'members' => [ 'VpcIngressConnectionArn' => [ 'shape' => 'AppRunnerResourceArn', ], 'ServiceArn' => [ 'shape' => 'AppRunnerResourceArn', ], ], ], 'VpcIngressConnectionSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VpcIngressConnectionSummary', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apprunner/2020-05-15/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<fullname>App Runner</fullname> <p>App Runner is an application service that provides a fast, simple, and cost-effective way to go directly from an existing container image or source code to a running service in the Amazon Web Services Cloud in seconds. You don\\'t need to learn new technologies, decide which compute service to use, or understand how to provision and configure Amazon Web Services resources.</p> <p>App Runner connects directly to your container registry or source code repository. It provides an automatic delivery pipeline with fully managed operations, high performance, scalability, and security.</p> <p>For more information about App Runner, see the <a href=\"https://docs.aws.amazon.com/apprunner/latest/dg/\">App Runner Developer Guide</a>. For release information, see the <a href=\"https://docs.aws.amazon.com/apprunner/latest/relnotes/\">App Runner Release Notes</a>.</p> <p> To install the Software Development Kits (SDKs), Integrated Development Environment (IDE) Toolkits, and command line tools that you can use to access the API, see <a href=\"http://aws.amazon.com/tools/\">Tools for Amazon Web Services</a>.</p> <p> <b>Endpoints</b> </p> <p>For a list of Region-specific endpoints that App Runner supports, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/apprunner.html\">App Runner endpoints and quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>', 'operations' => [ 'AssociateCustomDomain' => '<p>Associate your own domain name with the App Runner subdomain URL of your App Runner service.</p> <p>After you call <code>AssociateCustomDomain</code> and receive a successful response, use the information in the <a>CustomDomain</a> record that\\'s returned to add CNAME records to your Domain Name System (DNS). For each mapped domain name, add a mapping to the target App Runner subdomain and one or more certificate validation records. App Runner then performs DNS validation to verify that you own or control the domain name that you associated. App Runner tracks domain validity in a certificate stored in <a href=\"https://docs.aws.amazon.com/acm/latest/userguide\">AWS Certificate Manager (ACM)</a>.</p>', 'CreateAutoScalingConfiguration' => '<p>Create an App Runner automatic scaling configuration resource. App Runner requires this resource when you create or update App Runner services and you require non-default auto scaling settings. You can share an auto scaling configuration across multiple services.</p> <p>Create multiple revisions of a configuration by calling this action multiple times using the same <code>AutoScalingConfigurationName</code>. The call returns incremental <code>AutoScalingConfigurationRevision</code> values. When you create a service and configure an auto scaling configuration resource, the service uses the latest active revision of the auto scaling configuration by default. You can optionally configure the service to use a specific revision.</p> <p>Configure a higher <code>MinSize</code> to increase the spread of your App Runner service over more Availability Zones in the Amazon Web Services Region. The tradeoff is a higher minimal cost.</p> <p>Configure a lower <code>MaxSize</code> to control your cost. The tradeoff is lower responsiveness during peak demand.</p>', 'CreateConnection' => '<p>Create an App Runner connection resource. App Runner requires a connection resource when you create App Runner services that access private repositories from certain third-party providers. You can share a connection across multiple services.</p> <p>A connection resource is needed to access GitHub repositories. GitHub requires a user interface approval process through the App Runner console before you can use the connection.</p>', 'CreateObservabilityConfiguration' => '<p>Create an App Runner observability configuration resource. App Runner requires this resource when you create or update App Runner services and you want to enable non-default observability features. You can share an observability configuration across multiple services.</p> <p>Create multiple revisions of a configuration by calling this action multiple times using the same <code>ObservabilityConfigurationName</code>. The call returns incremental <code>ObservabilityConfigurationRevision</code> values. When you create a service and configure an observability configuration resource, the service uses the latest active revision of the observability configuration by default. You can optionally configure the service to use a specific revision.</p> <p>The observability configuration resource is designed to configure multiple features (currently one feature, tracing). This action takes optional parameters that describe the configuration of these features (currently one parameter, <code>TraceConfiguration</code>). If you don\\'t specify a feature parameter, App Runner doesn\\'t enable the feature.</p>', 'CreateService' => '<p>Create an App Runner service. After the service is created, the action also automatically starts a deployment.</p> <p>This is an asynchronous operation. On a successful call, you can use the returned <code>OperationId</code> and the <a href=\"https://docs.aws.amazon.com/apprunner/latest/api/API_ListOperations.html\">ListOperations</a> call to track the operation\\'s progress.</p>', 'CreateVpcConnector' => '<p>Create an App Runner VPC connector resource. App Runner requires this resource when you want to associate your App Runner service to a custom Amazon Virtual Private Cloud (Amazon VPC).</p>', 'CreateVpcIngressConnection' => '<p>Create an App Runner VPC Ingress Connection resource. App Runner requires this resource when you want to associate your App Runner service with an Amazon VPC endpoint.</p>', 'DeleteAutoScalingConfiguration' => '<p>Delete an App Runner automatic scaling configuration resource. You can delete a specific revision or the latest active revision. You can\\'t delete a configuration that\\'s used by one or more App Runner services.</p>', 'DeleteConnection' => '<p>Delete an App Runner connection. You must first ensure that there are no running App Runner services that use this connection. If there are any, the <code>DeleteConnection</code> action fails.</p>', 'DeleteObservabilityConfiguration' => '<p>Delete an App Runner observability configuration resource. You can delete a specific revision or the latest active revision. You can\\'t delete a configuration that\\'s used by one or more App Runner services.</p>', 'DeleteService' => '<p>Delete an App Runner service.</p> <p>This is an asynchronous operation. On a successful call, you can use the returned <code>OperationId</code> and the <a>ListOperations</a> call to track the operation\\'s progress.</p> <note> <p>Make sure that you don\\'t have any active VPCIngressConnections associated with the service you want to delete. </p> </note>', 'DeleteVpcConnector' => '<p>Delete an App Runner VPC connector resource. You can\\'t delete a connector that\\'s used by one or more App Runner services.</p>', 'DeleteVpcIngressConnection' => '<p>Delete an App Runner VPC Ingress Connection resource that\\'s associated with an App Runner service. The VPC Ingress Connection must be in one of the following states to be deleted: </p> <ul> <li> <p> <code>AVAILABLE</code> </p> </li> <li> <p> <code>FAILED_CREATION</code> </p> </li> <li> <p> <code>FAILED_UPDATE</code> </p> </li> <li> <p> <code>FAILED_DELETION</code> </p> </li> </ul>', 'DescribeAutoScalingConfiguration' => '<p>Return a full description of an App Runner automatic scaling configuration resource.</p>', 'DescribeCustomDomains' => '<p>Return a description of custom domain names that are associated with an App Runner service.</p>', 'DescribeObservabilityConfiguration' => '<p>Return a full description of an App Runner observability configuration resource.</p>', 'DescribeService' => '<p>Return a full description of an App Runner service.</p>', 'DescribeVpcConnector' => '<p>Return a description of an App Runner VPC connector resource.</p>', 'DescribeVpcIngressConnection' => '<p>Return a full description of an App Runner VPC Ingress Connection resource.</p>', 'DisassociateCustomDomain' => '<p>Disassociate a custom domain name from an App Runner service.</p> <p>Certificates tracking domain validity are associated with a custom domain and are stored in <a href=\"https://docs.aws.amazon.com/acm/latest/userguide\">AWS Certificate Manager (ACM)</a>. These certificates aren\\'t deleted as part of this action. App Runner delays certificate deletion for 30 days after a domain is disassociated from your service.</p>', 'ListAutoScalingConfigurations' => '<p>Returns a list of active App Runner automatic scaling configurations in your Amazon Web Services account. You can query the revisions for a specific configuration name or the revisions for all active configurations in your account. You can optionally query only the latest revision of each requested name.</p> <p>To retrieve a full description of a particular configuration revision, call and provide one of the ARNs returned by <code>ListAutoScalingConfigurations</code>.</p>', 'ListConnections' => '<p>Returns a list of App Runner connections that are associated with your Amazon Web Services account.</p>', 'ListObservabilityConfigurations' => '<p>Returns a list of active App Runner observability configurations in your Amazon Web Services account. You can query the revisions for a specific configuration name or the revisions for all active configurations in your account. You can optionally query only the latest revision of each requested name.</p> <p>To retrieve a full description of a particular configuration revision, call and provide one of the ARNs returned by <code>ListObservabilityConfigurations</code>.</p>', 'ListOperations' => '<p>Return a list of operations that occurred on an App Runner service.</p> <p>The resulting list of <a>OperationSummary</a> objects is sorted in reverse chronological order. The first object on the list represents the last started operation.</p>', 'ListServices' => '<p>Returns a list of running App Runner services in your Amazon Web Services account.</p>', 'ListTagsForResource' => '<p>List tags that are associated with for an App Runner resource. The response contains a list of tag key-value pairs.</p>', 'ListVpcConnectors' => '<p>Returns a list of App Runner VPC connectors in your Amazon Web Services account.</p>', 'ListVpcIngressConnections' => '<p>Return a list of App Runner VPC Ingress Connections in your Amazon Web Services account.</p>', 'PauseService' => '<p>Pause an active App Runner service. App Runner reduces compute capacity for the service to zero and loses state (for example, ephemeral storage is removed).</p> <p>This is an asynchronous operation. On a successful call, you can use the returned <code>OperationId</code> and the <a>ListOperations</a> call to track the operation\\'s progress.</p>', 'ResumeService' => '<p>Resume an active App Runner service. App Runner provisions compute capacity for the service.</p> <p>This is an asynchronous operation. On a successful call, you can use the returned <code>OperationId</code> and the <a>ListOperations</a> call to track the operation\\'s progress.</p>', 'StartDeployment' => '<p>Initiate a manual deployment of the latest commit in a source code repository or the latest image in a source image repository to an App Runner service.</p> <p>For a source code repository, App Runner retrieves the commit and builds a Docker image. For a source image repository, App Runner retrieves the latest Docker image. In both cases, App Runner then deploys the new image to your service and starts a new container instance.</p> <p>This is an asynchronous operation. On a successful call, you can use the returned <code>OperationId</code> and the <a>ListOperations</a> call to track the operation\\'s progress.</p>', 'TagResource' => '<p>Add tags to, or update the tag values of, an App Runner resource. A tag is a key-value pair.</p>', 'UntagResource' => '<p>Remove tags from an App Runner resource.</p>', 'UpdateService' => '<p>Update an App Runner service. You can update the source configuration and instance configuration of the service. You can also update the ARN of the auto scaling configuration resource that\\'s associated with the service. However, you can\\'t change the name or the encryption configuration of the service. These can be set only when you create the service.</p> <p>To update the tags applied to your service, use the separate actions <a>TagResource</a> and <a>UntagResource</a>.</p> <p>This is an asynchronous operation. On a successful call, you can use the returned <code>OperationId</code> and the <a>ListOperations</a> call to track the operation\\'s progress.</p>', 'UpdateVpcIngressConnection' => '<p>Update an existing App Runner VPC Ingress Connection resource. The VPC Ingress Connection must be in one of the following states to be updated:</p> <ul> <li> <p> AVAILABLE </p> </li> <li> <p> FAILED_CREATION </p> </li> <li> <p> FAILED_UPDATE </p> </li> </ul>', ], 'shapes' => [ 'ASConfigMaxConcurrency' => [ 'base' => NULL, 'refs' => [ 'CreateAutoScalingConfigurationRequest$MaxConcurrency' => '<p>The maximum number of concurrent requests that you want an instance to process. If the number of concurrent requests exceeds this limit, App Runner scales up your service.</p> <p>Default: <code>100</code> </p>', ], ], 'ASConfigMaxSize' => [ 'base' => NULL, 'refs' => [ 'CreateAutoScalingConfigurationRequest$MaxSize' => '<p>The maximum number of instances that your service scales up to. At most <code>MaxSize</code> instances actively serve traffic for your service.</p> <p>Default: <code>25</code> </p>', ], ], 'ASConfigMinSize' => [ 'base' => NULL, 'refs' => [ 'CreateAutoScalingConfigurationRequest$MinSize' => '<p>The minimum number of instances that App Runner provisions for your service. The service always has at least <code>MinSize</code> provisioned instances. Some of them actively serve traffic. The rest of them (provisioned and inactive instances) are a cost-effective compute capacity reserve and are ready to be quickly activated. You pay for memory usage of all the provisioned instances. You pay for CPU usage of only the active subset.</p> <p>App Runner temporarily doubles the number of provisioned instances during deployments, to maintain the same capacity for both old and new code.</p> <p>Default: <code>1</code> </p>', ], ], 'AppRunnerResourceArn' => [ 'base' => NULL, 'refs' => [ 'AssociateCustomDomainRequest$ServiceArn' => '<p>The Amazon Resource Name (ARN) of the App Runner service that you want to associate a custom domain name with.</p>', 'AssociateCustomDomainResponse$ServiceArn' => '<p>The Amazon Resource Name (ARN) of the App Runner service with which a custom domain name is associated.</p>', 'AuthenticationConfiguration$ConnectionArn' => '<p>The Amazon Resource Name (ARN) of the App Runner connection that enables the App Runner service to connect to a source repository. It\\'s required for GitHub code repositories.</p>', 'AutoScalingConfiguration$AutoScalingConfigurationArn' => '<p>The Amazon Resource Name (ARN) of this auto scaling configuration.</p>', 'AutoScalingConfigurationSummary$AutoScalingConfigurationArn' => '<p>The Amazon Resource Name (ARN) of this auto scaling configuration.</p>', 'Connection$ConnectionArn' => '<p>The Amazon Resource Name (ARN) of this connection.</p>', 'ConnectionSummary$ConnectionArn' => '<p>The Amazon Resource Name (ARN) of this connection.</p>', 'CreateServiceRequest$AutoScalingConfigurationArn' => '<p>The Amazon Resource Name (ARN) of an App Runner automatic scaling configuration resource that you want to associate with your service. If not provided, App Runner associates the latest revision of a default auto scaling configuration.</p> <p>Specify an ARN with a name and a revision number to associate that revision. For example: <code>arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/3</code> </p> <p>Specify just the name to associate the latest revision. For example: <code>arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability</code> </p>', 'CreateVpcIngressConnectionRequest$ServiceArn' => '<p>The Amazon Resource Name (ARN) for this App Runner service that is used to create the VPC Ingress Connection resource.</p>', 'DeleteAutoScalingConfigurationRequest$AutoScalingConfigurationArn' => '<p>The Amazon Resource Name (ARN) of the App Runner auto scaling configuration that you want to delete.</p> <p>The ARN can be a full auto scaling configuration ARN, or a partial ARN ending with either <code>.../<i>name</i> </code> or <code>.../<i>name</i>/<i>revision</i> </code>. If a revision isn\\'t specified, the latest active revision is deleted.</p>', 'DeleteConnectionRequest$ConnectionArn' => '<p>The Amazon Resource Name (ARN) of the App Runner connection that you want to delete.</p>', 'DeleteObservabilityConfigurationRequest$ObservabilityConfigurationArn' => '<p>The Amazon Resource Name (ARN) of the App Runner observability configuration that you want to delete.</p> <p>The ARN can be a full observability configuration ARN, or a partial ARN ending with either <code>.../<i>name</i> </code> or <code>.../<i>name</i>/<i>revision</i> </code>. If a revision isn\\'t specified, the latest active revision is deleted.</p>', 'DeleteServiceRequest$ServiceArn' => '<p>The Amazon Resource Name (ARN) of the App Runner service that you want to delete.</p>', 'DeleteVpcConnectorRequest$VpcConnectorArn' => '<p>The Amazon Resource Name (ARN) of the App Runner VPC connector that you want to delete.</p> <p>The ARN must be a full VPC connector ARN.</p>', 'DeleteVpcIngressConnectionRequest$VpcIngressConnectionArn' => '<p>The Amazon Resource Name (ARN) of the App Runner VPC Ingress Connection that you want to delete.</p>', 'DescribeAutoScalingConfigurationRequest$AutoScalingConfigurationArn' => '<p>The Amazon Resource Name (ARN) of the App Runner auto scaling configuration that you want a description for.</p> <p>The ARN can be a full auto scaling configuration ARN, or a partial ARN ending with either <code>.../<i>name</i> </code> or <code>.../<i>name</i>/<i>revision</i> </code>. If a revision isn\\'t specified, the latest active revision is described.</p>', 'DescribeCustomDomainsRequest$ServiceArn' => '<p>The Amazon Resource Name (ARN) of the App Runner service that you want associated custom domain names to be described for.</p>', 'DescribeCustomDomainsResponse$ServiceArn' => '<p>The Amazon Resource Name (ARN) of the App Runner service whose associated custom domain names you want to describe.</p>', 'DescribeObservabilityConfigurationRequest$ObservabilityConfigurationArn' => '<p>The Amazon Resource Name (ARN) of the App Runner observability configuration that you want a description for.</p> <p>The ARN can be a full observability configuration ARN, or a partial ARN ending with either <code>.../<i>name</i> </code> or <code>.../<i>name</i>/<i>revision</i> </code>. If a revision isn\\'t specified, the latest active revision is described.</p>', 'DescribeServiceRequest$ServiceArn' => '<p>The Amazon Resource Name (ARN) of the App Runner service that you want a description for.</p>', 'DescribeVpcConnectorRequest$VpcConnectorArn' => '<p>The Amazon Resource Name (ARN) of the App Runner VPC connector that you want a description for.</p> <p>The ARN must be a full VPC connector ARN.</p>', 'DescribeVpcIngressConnectionRequest$VpcIngressConnectionArn' => '<p>The Amazon Resource Name (ARN) of the App Runner VPC Ingress Connection that you want a description for.</p>', 'DisassociateCustomDomainRequest$ServiceArn' => '<p>The Amazon Resource Name (ARN) of the App Runner service that you want to disassociate a custom domain name from.</p>', 'DisassociateCustomDomainResponse$ServiceArn' => '<p>The Amazon Resource Name (ARN) of the App Runner service that a custom domain name is disassociated from.</p>', 'EgressConfiguration$VpcConnectorArn' => '<p>The Amazon Resource Name (ARN) of the App Runner VPC connector that you want to associate with your App Runner service. Only valid when <code>EgressType = VPC</code>.</p>', 'ListOperationsRequest$ServiceArn' => '<p>The Amazon Resource Name (ARN) of the App Runner service that you want a list of operations for.</p>', 'ListTagsForResourceRequest$ResourceArn' => '<p>The Amazon Resource Name (ARN) of the resource that a tag list is requested for.</p> <p>It must be the ARN of an App Runner resource.</p>', 'ListVpcIngressConnectionsFilter$ServiceArn' => '<p>The Amazon Resource Name (ARN) of a service to filter by. </p>', 'ObservabilityConfiguration$ObservabilityConfigurationArn' => '<p>The Amazon Resource Name (ARN) of this observability configuration.</p>', 'ObservabilityConfigurationSummary$ObservabilityConfigurationArn' => '<p>The Amazon Resource Name (ARN) of this observability configuration.</p>', 'OperationSummary$TargetArn' => '<p>The Amazon Resource Name (ARN) of the resource that the operation acted on (for example, an App Runner service).</p>', 'PauseServiceRequest$ServiceArn' => '<p>The Amazon Resource Name (ARN) of the App Runner service that you want to pause.</p>', 'ResumeServiceRequest$ServiceArn' => '<p>The Amazon Resource Name (ARN) of the App Runner service that you want to resume.</p>', 'Service$ServiceArn' => '<p>The Amazon Resource Name (ARN) of this service.</p>', 'ServiceObservabilityConfiguration$ObservabilityConfigurationArn' => '<p>The Amazon Resource Name (ARN) of the observability configuration that is associated with the service. Specified only when <code>ObservabilityEnabled</code> is <code>true</code>.</p> <p>Specify an ARN with a name and a revision number to associate that revision. For example: <code>arn:aws:apprunner:us-east-1:123456789012:observabilityconfiguration/xray-tracing/3</code> </p> <p>Specify just the name to associate the latest revision. For example: <code>arn:aws:apprunner:us-east-1:123456789012:observabilityconfiguration/xray-tracing</code> </p>', 'ServiceSummary$ServiceArn' => '<p>The Amazon Resource Name (ARN) of this service.</p>', 'StartDeploymentRequest$ServiceArn' => '<p>The Amazon Resource Name (ARN) of the App Runner service that you want to manually deploy to.</p>', 'TagResourceRequest$ResourceArn' => '<p>The Amazon Resource Name (ARN) of the resource that you want to update tags for.</p> <p>It must be the ARN of an App Runner resource.</p>', 'UntagResourceRequest$ResourceArn' => '<p>The Amazon Resource Name (ARN) of the resource that you want to remove tags from.</p> <p>It must be the ARN of an App Runner resource.</p>', 'UpdateServiceRequest$ServiceArn' => '<p>The Amazon Resource Name (ARN) of the App Runner service that you want to update.</p>', 'UpdateServiceRequest$AutoScalingConfigurationArn' => '<p>The Amazon Resource Name (ARN) of an App Runner automatic scaling configuration resource that you want to associate with the App Runner service.</p>', 'UpdateVpcIngressConnectionRequest$VpcIngressConnectionArn' => '<p>The Amazon Resource Name (Arn) for the App Runner VPC Ingress Connection resource that you want to update.</p>', 'VpcConnector$VpcConnectorArn' => '<p>The Amazon Resource Name (ARN) of this VPC connector.</p>', 'VpcDNSTarget$VpcIngressConnectionArn' => '<p>The Amazon Resource Name (ARN) of the VPC Ingress Connection that is associated with your service.</p>', 'VpcIngressConnection$VpcIngressConnectionArn' => '<p>The Amazon Resource Name (ARN) of the VPC Ingress Connection. </p>', 'VpcIngressConnection$ServiceArn' => '<p>The Amazon Resource Name (ARN) of the service associated with the VPC Ingress Connection. </p>', 'VpcIngressConnectionSummary$VpcIngressConnectionArn' => '<p>The Amazon Resource Name (ARN) of the VPC Ingress Connection. </p>', 'VpcIngressConnectionSummary$ServiceArn' => '<p>The Amazon Resource Name (ARN) of the service associated with the VPC Ingress Connection. </p>', ], ], 'AssociateCustomDomainRequest' => [ 'base' => NULL, 'refs' => [], ], 'AssociateCustomDomainResponse' => [ 'base' => NULL, 'refs' => [], ], 'AuthenticationConfiguration' => [ 'base' => '<p>Describes resources needed to authenticate access to some source repositories. The specific resource depends on the repository provider.</p>', 'refs' => [ 'SourceConfiguration$AuthenticationConfiguration' => '<p>Describes the resources that are needed to authenticate access to some source repositories.</p>', ], ], 'AutoScalingConfiguration' => [ 'base' => '<p>Describes an App Runner automatic scaling configuration resource.</p> <p>A higher <code>MinSize</code> increases the spread of your App Runner service over more Availability Zones in the Amazon Web Services Region. The tradeoff is a higher minimal cost.</p> <p>A lower <code>MaxSize</code> controls your cost. The tradeoff is lower responsiveness during peak demand.</p> <p>Multiple revisions of a configuration might have the same <code>AutoScalingConfigurationName</code> and different <code>AutoScalingConfigurationRevision</code> values.</p>', 'refs' => [ 'CreateAutoScalingConfigurationResponse$AutoScalingConfiguration' => '<p>A description of the App Runner auto scaling configuration that\\'s created by this request.</p>', 'DeleteAutoScalingConfigurationResponse$AutoScalingConfiguration' => '<p>A description of the App Runner auto scaling configuration that this request just deleted.</p>', 'DescribeAutoScalingConfigurationResponse$AutoScalingConfiguration' => '<p>A full description of the App Runner auto scaling configuration that you specified in this request.</p>', ], ], 'AutoScalingConfigurationName' => [ 'base' => NULL, 'refs' => [ 'AutoScalingConfiguration$AutoScalingConfigurationName' => '<p>The customer-provided auto scaling configuration name. It can be used in multiple revisions of a configuration.</p>', 'AutoScalingConfigurationSummary$AutoScalingConfigurationName' => '<p>The customer-provided auto scaling configuration name. It can be used in multiple revisions of a configuration.</p>', 'CreateAutoScalingConfigurationRequest$AutoScalingConfigurationName' => '<p>A name for the auto scaling configuration. When you use it for the first time in an Amazon Web Services Region, App Runner creates revision number <code>1</code> of this name. When you use the same name in subsequent calls, App Runner creates incremental revisions of the configuration.</p> <note> <p>The name <code>DefaultConfiguration</code> is reserved (it\\'s the configuration that App Runner uses if you don\\'t provide a custome one). You can\\'t use it to create a new auto scaling configuration, and you can\\'t create a revision of it.</p> <p>When you want to use your own auto scaling configuration for your App Runner service, <i>create a configuration with a different name</i>, and then provide it when you create or update your service.</p> </note>', 'ListAutoScalingConfigurationsRequest$AutoScalingConfigurationName' => '<p>The name of the App Runner auto scaling configuration that you want to list. If specified, App Runner lists revisions that share this name. If not specified, App Runner returns revisions of all active configurations.</p>', ], ], 'AutoScalingConfigurationStatus' => [ 'base' => NULL, 'refs' => [ 'AutoScalingConfiguration$Status' => '<p>The current state of the auto scaling configuration. If the status of a configuration revision is <code>INACTIVE</code>, it was deleted and can\\'t be used. Inactive configuration revisions are permanently removed some time after they are deleted.</p>', ], ], 'AutoScalingConfigurationSummary' => [ 'base' => '<p>Provides summary information about an App Runner automatic scaling configuration resource.</p> <p>This type contains limited information about an auto scaling configuration. It includes only identification information, without configuration details. It\\'s returned by the <a>ListAutoScalingConfigurations</a> action. Complete configuration information is returned by the <a>CreateAutoScalingConfiguration</a>, <a>DescribeAutoScalingConfiguration</a>, and <a>DeleteAutoScalingConfiguration</a> actions using the <a>AutoScalingConfiguration</a> type.</p>', 'refs' => [ 'AutoScalingConfigurationSummaryList$member' => NULL, 'Service$AutoScalingConfigurationSummary' => '<p>Summary information for the App Runner automatic scaling configuration resource that\\'s associated with this service.</p>', ], ], 'AutoScalingConfigurationSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListAutoScalingConfigurationsResponse$AutoScalingConfigurationSummaryList' => '<p>A list of summary information records for auto scaling configurations. In a paginated request, the request returns up to <code>MaxResults</code> records for each call.</p>', ], ], 'Boolean' => [ 'base' => NULL, 'refs' => [ 'AutoScalingConfiguration$Latest' => '<p>It\\'s set to <code>true</code> for the configuration with the highest <code>Revision</code> among all configurations that share the same <code>AutoScalingConfigurationName</code>. It\\'s set to <code>false</code> otherwise.</p>', 'IngressConfiguration$IsPubliclyAccessible' => '<p>Specifies whether your App Runner service is publicly accessible. To make the service publicly accessible set it to <code>True</code>. To make the service privately accessible, from only within an Amazon VPC set it to <code>False</code>. </p>', 'ListAutoScalingConfigurationsRequest$LatestOnly' => '<p>Set to <code>true</code> to list only the latest revision for each requested configuration name.</p> <p>Set to <code>false</code> to list all revisions for each requested configuration name.</p> <p>Default: <code>true</code> </p>', 'ListObservabilityConfigurationsRequest$LatestOnly' => '<p>Set to <code>true</code> to list only the latest revision for each requested configuration name.</p> <p>Set to <code>false</code> to list all revisions for each requested configuration name.</p> <p>Default: <code>true</code> </p>', 'ObservabilityConfiguration$Latest' => '<p>It\\'s set to <code>true</code> for the configuration with the highest <code>Revision</code> among all configurations that share the same <code>ObservabilityConfigurationName</code>. It\\'s set to <code>false</code> otherwise.</p>', 'ServiceObservabilityConfiguration$ObservabilityEnabled' => '<p>When <code>true</code>, an observability configuration resource is associated with the service, and an <code>ObservabilityConfigurationArn</code> is specified.</p>', ], ], 'BuildCommand' => [ 'base' => NULL, 'refs' => [ 'CodeConfigurationValues$BuildCommand' => '<p>The command App Runner runs to build your application.</p>', ], ], 'CertificateValidationRecord' => [ 'base' => '<p>Describes a certificate CNAME record to add to your DNS. For more information, see <a href=\"https://docs.aws.amazon.com/apprunner/latest/api/API_AssociateCustomDomain.html\">AssociateCustomDomain</a>.</p>', 'refs' => [ 'CertificateValidationRecordList$member' => NULL, ], ], 'CertificateValidationRecordList' => [ 'base' => NULL, 'refs' => [ 'CustomDomain$CertificateValidationRecords' => '<p>A list of certificate CNAME records that\\'s used for this domain name.</p>', ], ], 'CertificateValidationRecordStatus' => [ 'base' => NULL, 'refs' => [ 'CertificateValidationRecord$Status' => '<p>The current state of the certificate CNAME record validation. It should change to <code>SUCCESS</code> after App Runner completes validation with your DNS.</p>', ], ], 'CodeConfiguration' => [ 'base' => '<p>Describes the configuration that App Runner uses to build and run an App Runner service from a source code repository.</p>', 'refs' => [ 'CodeRepository$CodeConfiguration' => '<p>Configuration for building and running the service from a source code repository.</p> <note> <p> <code>CodeConfiguration</code> is required only for <code>CreateService</code> request.</p> </note>', ], ], 'CodeConfigurationValues' => [ 'base' => '<p>Describes the basic configuration needed for building and running an App Runner service. This type doesn\\'t support the full set of possible configuration options. Fur full configuration capabilities, use a <code>apprunner.yaml</code> file in the source code repository.</p>', 'refs' => [ 'CodeConfiguration$CodeConfigurationValues' => '<p>The basic configuration for building and running the App Runner service. Use it to quickly launch an App Runner service without providing a <code>apprunner.yaml</code> file in the source code repository (or ignoring the file if it exists).</p>', ], ], 'CodeRepository' => [ 'base' => '<p>Describes a source code repository.</p>', 'refs' => [ 'SourceConfiguration$CodeRepository' => '<p>The description of a source code repository.</p> <p>You must provide either this member or <code>ImageRepository</code> (but not both).</p>', ], ], 'ConfigurationSource' => [ 'base' => NULL, 'refs' => [ 'CodeConfiguration$ConfigurationSource' => '<p>The source of the App Runner configuration. Values are interpreted as follows:</p> <ul> <li> <p> <code>REPOSITORY</code> \u00e2\u20ac\u201c App Runner reads configuration values from the <code>apprunner.yaml</code> file in the source code repository and ignores <code>CodeConfigurationValues</code>.</p> </li> <li> <p> <code>API</code> \u00e2\u20ac\u201c App Runner uses configuration values provided in <code>CodeConfigurationValues</code> and ignores the <code>apprunner.yaml</code> file in the source code repository.</p> </li> </ul>', ], ], 'Connection' => [ 'base' => '<p>Describes an App Runner connection resource.</p>', 'refs' => [ 'CreateConnectionResponse$Connection' => '<p>A description of the App Runner connection that\\'s created by this request.</p>', 'DeleteConnectionResponse$Connection' => '<p>A description of the App Runner connection that this request just deleted.</p>', ], ], 'ConnectionName' => [ 'base' => NULL, 'refs' => [ 'Connection$ConnectionName' => '<p>The customer-provided connection name.</p>', 'ConnectionSummary$ConnectionName' => '<p>The customer-provided connection name.</p>', 'CreateConnectionRequest$ConnectionName' => '<p>A name for the new connection. It must be unique across all App Runner connections for the Amazon Web Services account in the Amazon Web Services Region.</p>', 'ListConnectionsRequest$ConnectionName' => '<p>If specified, only this connection is returned. If not specified, the result isn\\'t filtered by name.</p>', ], ], 'ConnectionStatus' => [ 'base' => NULL, 'refs' => [ 'Connection$Status' => '<p>The current state of the App Runner connection. When the state is <code>AVAILABLE</code>, you can use the connection to create an App Runner service.</p>', 'ConnectionSummary$Status' => '<p>The current state of the App Runner connection. When the state is <code>AVAILABLE</code>, you can use the connection to create an App Runner service.</p>', ], ], 'ConnectionSummary' => [ 'base' => '<p>Provides summary information about an App Runner connection resource.</p>', 'refs' => [ 'ConnectionSummaryList$member' => NULL, ], ], 'ConnectionSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListConnectionsResponse$ConnectionSummaryList' => '<p>A list of summary information records for connections. In a paginated request, the request returns up to <code>MaxResults</code> records for each call.</p>', ], ], 'Cpu' => [ 'base' => NULL, 'refs' => [ 'InstanceConfiguration$Cpu' => '<p>The number of CPU units reserved for each instance of your App Runner service.</p> <p>Default: <code>1 vCPU</code> </p>', ], ], 'CreateAutoScalingConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAutoScalingConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateConnectionRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateConnectionResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateObservabilityConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateObservabilityConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateServiceRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateServiceResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateVpcConnectorRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateVpcConnectorResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateVpcIngressConnectionRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateVpcIngressConnectionResponse' => [ 'base' => NULL, 'refs' => [], ], 'CustomDomain' => [ 'base' => '<p>Describes a custom domain that\\'s associated with an App Runner service.</p>', 'refs' => [ 'AssociateCustomDomainResponse$CustomDomain' => '<p>A description of the domain name that\\'s being associated.</p>', 'CustomDomainList$member' => NULL, 'DisassociateCustomDomainResponse$CustomDomain' => '<p>A description of the domain name that\\'s being disassociated.</p>', ], ], 'CustomDomainAssociationStatus' => [ 'base' => NULL, 'refs' => [ 'CustomDomain$Status' => '<p>The current state of the domain name association.</p>', ], ], 'CustomDomainList' => [ 'base' => NULL, 'refs' => [ 'DescribeCustomDomainsResponse$CustomDomains' => '<p>A list of descriptions of custom domain names that are associated with the service. In a paginated request, the request returns up to <code>MaxResults</code> records per call.</p>', ], ], 'CustomerAccountId' => [ 'base' => NULL, 'refs' => [ 'VpcIngressConnection$AccountId' => '<p>The Account Id you use to create the VPC Ingress Connection resource.</p>', ], ], 'DeleteAutoScalingConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAutoScalingConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteConnectionRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteConnectionResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteObservabilityConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteObservabilityConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteServiceRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteServiceResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteVpcConnectorRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteVpcConnectorResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteVpcIngressConnectionRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteVpcIngressConnectionResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAutoScalingConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAutoScalingConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeCustomDomainsMaxResults' => [ 'base' => NULL, 'refs' => [ 'DescribeCustomDomainsRequest$MaxResults' => '<p>The maximum number of results that each response (result page) can include. It\\'s used for a paginated request.</p> <p>If you don\\'t specify <code>MaxResults</code>, the request retrieves all available results in a single response.</p>', ], ], 'DescribeCustomDomainsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeCustomDomainsResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeObservabilityConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeObservabilityConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeServiceRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeServiceResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeVpcConnectorRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeVpcConnectorResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeVpcIngressConnectionRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeVpcIngressConnectionResponse' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateCustomDomainRequest' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateCustomDomainResponse' => [ 'base' => NULL, 'refs' => [], ], 'DomainName' => [ 'base' => NULL, 'refs' => [ 'AssociateCustomDomainRequest$DomainName' => '<p>A custom domain endpoint to associate. Specify a root domain (for example, <code>example.com</code>), a subdomain (for example, <code>login.example.com</code> or <code>admin.login.example.com</code>), or a wildcard (for example, <code>*.example.com</code>).</p>', 'CustomDomain$DomainName' => '<p>An associated custom domain endpoint. It can be a root domain (for example, <code>example.com</code>), a subdomain (for example, <code>login.example.com</code> or <code>admin.login.example.com</code>), or a wildcard (for example, <code>*.example.com</code>).</p>', 'DisassociateCustomDomainRequest$DomainName' => '<p>The domain name that you want to disassociate from the App Runner service.</p>', 'VpcDNSTarget$DomainName' => '<p>The domain name of your target DNS that is associated with the Amazon VPC.</p>', 'VpcIngressConnection$DomainName' => '<p>The domain name associated with the VPC Ingress Connection resource.</p>', ], ], 'EgressConfiguration' => [ 'base' => '<p>Describes configuration settings related to outbound network traffic of an App Runner service.</p>', 'refs' => [ 'NetworkConfiguration$EgressConfiguration' => '<p>Network configuration settings for outbound message traffic.</p>', ], ], 'EgressType' => [ 'base' => NULL, 'refs' => [ 'EgressConfiguration$EgressType' => '<p>The type of egress configuration.</p> <p>Set to <code>DEFAULT</code> for access to resources hosted on public networks.</p> <p>Set to <code>VPC</code> to associate your service to a custom VPC specified by <code>VpcConnectorArn</code>.</p>', ], ], 'EncryptionConfiguration' => [ 'base' => '<p>Describes a custom encryption key that App Runner uses to encrypt copies of the source repository and service logs.</p>', 'refs' => [ 'CreateServiceRequest$EncryptionConfiguration' => '<p>An optional custom encryption key that App Runner uses to encrypt the copy of your source repository that it maintains and your service logs. By default, App Runner uses an Amazon Web Services managed key.</p>', 'Service$EncryptionConfiguration' => '<p>The encryption key that App Runner uses to encrypt the service logs and the copy of the source repository that App Runner maintains for the service. It can be either a customer-provided encryption key or an Amazon Web Services managed key.</p>', ], ], 'ErrorMessage' => [ 'base' => NULL, 'refs' => [ 'InternalServiceErrorException$Message' => NULL, 'InvalidRequestException$Message' => NULL, 'InvalidStateException$Message' => NULL, 'ResourceNotFoundException$Message' => NULL, 'ServiceQuotaExceededException$Message' => NULL, ], ], 'HealthCheckConfiguration' => [ 'base' => '<p>Describes the settings for the health check that App Runner performs to monitor the health of a service.</p>', 'refs' => [ 'CreateServiceRequest$HealthCheckConfiguration' => '<p>The settings for the health check that App Runner performs to monitor the health of the App Runner service.</p>', 'Service$HealthCheckConfiguration' => '<p>The settings for the health check that App Runner performs to monitor the health of this service.</p>', 'UpdateServiceRequest$HealthCheckConfiguration' => '<p>The settings for the health check that App Runner performs to monitor the health of the App Runner service.</p>', ], ], 'HealthCheckHealthyThreshold' => [ 'base' => NULL, 'refs' => [ 'HealthCheckConfiguration$HealthyThreshold' => '<p>The number of consecutive checks that must succeed before App Runner decides that the service is healthy.</p> <p>Default: <code>1</code> </p>', ], ], 'HealthCheckInterval' => [ 'base' => NULL, 'refs' => [ 'HealthCheckConfiguration$Interval' => '<p>The time interval, in seconds, between health checks.</p> <p>Default: <code>5</code> </p>', ], ], 'HealthCheckPath' => [ 'base' => NULL, 'refs' => [ 'HealthCheckConfiguration$Path' => '<p>The URL that health check requests are sent to.</p> <p> <code>Path</code> is only applicable when you set <code>Protocol</code> to <code>HTTP</code>.</p> <p>Default: <code>\"/\"</code> </p>', ], ], 'HealthCheckProtocol' => [ 'base' => NULL, 'refs' => [ 'HealthCheckConfiguration$Protocol' => '<p>The IP protocol that App Runner uses to perform health checks for your service.</p> <p>If you set <code>Protocol</code> to <code>HTTP</code>, App Runner sends health check requests to the HTTP path specified by <code>Path</code>.</p> <p>Default: <code>TCP</code> </p>', ], ], 'HealthCheckTimeout' => [ 'base' => NULL, 'refs' => [ 'HealthCheckConfiguration$Timeout' => '<p>The time, in seconds, to wait for a health check response before deciding it failed.</p> <p>Default: <code>2</code> </p>', ], ], 'HealthCheckUnhealthyThreshold' => [ 'base' => NULL, 'refs' => [ 'HealthCheckConfiguration$UnhealthyThreshold' => '<p>The number of consecutive checks that must fail before App Runner decides that the service is unhealthy.</p> <p>Default: <code>5</code> </p>', ], ], 'ImageConfiguration' => [ 'base' => '<p>Describes the configuration that App Runner uses to run an App Runner service using an image pulled from a source image repository.</p>', 'refs' => [ 'ImageRepository$ImageConfiguration' => '<p>Configuration for running the identified image.</p>', ], ], 'ImageIdentifier' => [ 'base' => NULL, 'refs' => [ 'ImageRepository$ImageIdentifier' => '<p>The identifier of an image.</p> <p>For an image in Amazon Elastic Container Registry (Amazon ECR), this is an image name. For the image name format, see <a href=\"https://docs.aws.amazon.com/AmazonECR/latest/userguide/docker-pull-ecr-image.html\">Pulling an image</a> in the <i>Amazon ECR User Guide</i>.</p>', ], ], 'ImageRepository' => [ 'base' => '<p>Describes a source image repository.</p>', 'refs' => [ 'SourceConfiguration$ImageRepository' => '<p>The description of a source image repository.</p> <p>You must provide either this member or <code>CodeRepository</code> (but not both).</p>', ], ], 'ImageRepositoryType' => [ 'base' => NULL, 'refs' => [ 'ImageRepository$ImageRepositoryType' => '<p>The type of the image repository. This reflects the repository provider and whether the repository is private or public.</p>', ], ], 'IngressConfiguration' => [ 'base' => '<p>Network configuration settings for inbound network traffic.</p>', 'refs' => [ 'NetworkConfiguration$IngressConfiguration' => '<p>Network configuration settings for inbound message traffic.</p>', ], ], 'IngressVpcConfiguration' => [ 'base' => '<p>The configuration of your VPC and the associated VPC endpoint. The VPC endpoint is an Amazon Web Services PrivateLink resource that allows access to your App Runner services from within an Amazon VPC.</p>', 'refs' => [ 'CreateVpcIngressConnectionRequest$IngressVpcConfiguration' => '<p>Specifications for the customer\u00e2\u20ac\u2122s Amazon VPC and the related Amazon Web Services PrivateLink VPC endpoint that are used to create the VPC Ingress Connection resource.</p>', 'UpdateVpcIngressConnectionRequest$IngressVpcConfiguration' => '<p>Specifications for the customer\u00e2\u20ac\u2122s Amazon VPC and the related Amazon Web Services PrivateLink VPC endpoint that are used to update the VPC Ingress Connection resource.</p>', 'VpcIngressConnection$IngressVpcConfiguration' => '<p>Specifications for the customer\u00e2\u20ac\u2122s VPC and related PrivateLink VPC endpoint that are used to associate with the VPC Ingress Connection resource.</p>', ], ], 'InstanceConfiguration' => [ 'base' => '<p>Describes the runtime configuration of an App Runner service instance (scaling unit).</p>', 'refs' => [ 'CreateServiceRequest$InstanceConfiguration' => '<p>The runtime configuration of instances (scaling units) of your service.</p>', 'Service$InstanceConfiguration' => '<p>The runtime configuration of instances (scaling units) of this service.</p>', 'UpdateServiceRequest$InstanceConfiguration' => '<p>The runtime configuration to apply to instances (scaling units) of your service.</p>', ], ], 'Integer' => [ 'base' => NULL, 'refs' => [ 'AutoScalingConfiguration$AutoScalingConfigurationRevision' => '<p>The revision of this auto scaling configuration. It\\'s unique among all the active configurations (<code>\"Status\": \"ACTIVE\"</code>) that share the same <code>AutoScalingConfigurationName</code>.</p>', 'AutoScalingConfiguration$MaxConcurrency' => '<p>The maximum number of concurrent requests that an instance processes. If the number of concurrent requests exceeds this limit, App Runner scales the service up.</p>', 'AutoScalingConfiguration$MinSize' => '<p>The minimum number of instances that App Runner provisions for a service. The service always has at least <code>MinSize</code> provisioned instances. Some of them actively serve traffic. The rest of them (provisioned and inactive instances) are a cost-effective compute capacity reserve and are ready to be quickly activated. You pay for memory usage of all the provisioned instances. You pay for CPU usage of only the active subset.</p> <p>App Runner temporarily doubles the number of provisioned instances during deployments, to maintain the same capacity for both old and new code.</p>', 'AutoScalingConfiguration$MaxSize' => '<p>The maximum number of instances that a service scales up to. At most <code>MaxSize</code> instances actively serve traffic for your service.</p>', 'AutoScalingConfigurationSummary$AutoScalingConfigurationRevision' => '<p>The revision of this auto scaling configuration. It\\'s unique among all the active configurations (<code>\"Status\": \"ACTIVE\"</code>) with the same <code>AutoScalingConfigurationName</code>.</p>', 'ObservabilityConfiguration$ObservabilityConfigurationRevision' => '<p>The revision of this observability configuration. It\\'s unique among all the active configurations (<code>\"Status\": \"ACTIVE\"</code>) that share the same <code>ObservabilityConfigurationName</code>.</p>', 'ObservabilityConfigurationSummary$ObservabilityConfigurationRevision' => '<p>The revision of this observability configuration. It\\'s unique among all the active configurations (<code>\"Status\": \"ACTIVE\"</code>) that share the same <code>ObservabilityConfigurationName</code>.</p>', 'VpcConnector$VpcConnectorRevision' => '<p>The revision of this VPC connector. It\\'s unique among all the active connectors (<code>\"Status\": \"ACTIVE\"</code>) that share the same <code>Name</code>.</p> <note> <p>At this time, App Runner supports only one revision per name.</p> </note>', ], ], 'InternalServiceErrorException' => [ 'base' => '<p>An unexpected service exception occurred.</p>', 'refs' => [], ], 'InvalidRequestException' => [ 'base' => '<p>One or more input parameters aren\\'t valid. Refer to the API action\\'s document page, correct the input parameters, and try the action again.</p>', 'refs' => [], ], 'InvalidStateException' => [ 'base' => '<p>You can\\'t perform this action when the resource is in its current state.</p>', 'refs' => [], ], 'KmsKeyArn' => [ 'base' => NULL, 'refs' => [ 'EncryptionConfiguration$KmsKey' => '<p>The ARN of the KMS key that\\'s used for encryption.</p>', ], ], 'ListAutoScalingConfigurationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAutoScalingConfigurationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListConnectionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListConnectionsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListObservabilityConfigurationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListObservabilityConfigurationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListOperationsMaxResults' => [ 'base' => NULL, 'refs' => [ 'ListOperationsRequest$MaxResults' => '<p>The maximum number of results to include in each response (result page). It\\'s used for a paginated request.</p> <p>If you don\\'t specify <code>MaxResults</code>, the request retrieves all available results in a single response.</p>', ], ], 'ListOperationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListOperationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListServicesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListServicesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListVpcConnectorsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListVpcConnectorsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListVpcIngressConnectionsFilter' => [ 'base' => '<p>Returns a list of VPC Ingress Connections based on the filter provided. It can return either <code>ServiceArn</code> or <code>VpcEndpointId</code>, or both.</p>', 'refs' => [ 'ListVpcIngressConnectionsRequest$Filter' => '<p>The VPC Ingress Connections to be listed based on either the Service Arn or Vpc Endpoint Id, or both.</p>', ], ], 'ListVpcIngressConnectionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListVpcIngressConnectionsResponse' => [ 'base' => NULL, 'refs' => [], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'ListAutoScalingConfigurationsRequest$MaxResults' => '<p>The maximum number of results to include in each response (result page). It\\'s used for a paginated request.</p> <p>If you don\\'t specify <code>MaxResults</code>, the request retrieves all available results in a single response.</p>', 'ListConnectionsRequest$MaxResults' => '<p>The maximum number of results to include in each response (result page). Used for a paginated request.</p> <p>If you don\\'t specify <code>MaxResults</code>, the request retrieves all available results in a single response.</p>', 'ListObservabilityConfigurationsRequest$MaxResults' => '<p>The maximum number of results to include in each response (result page). It\\'s used for a paginated request.</p> <p>If you don\\'t specify <code>MaxResults</code>, the request retrieves all available results in a single response.</p>', 'ListVpcConnectorsRequest$MaxResults' => '<p>The maximum number of results to include in each response (result page). It\\'s used for a paginated request.</p> <p>If you don\\'t specify <code>MaxResults</code>, the request retrieves all available results in a single response.</p>', 'ListVpcIngressConnectionsRequest$MaxResults' => '<p>The maximum number of results to include in each response (result page). It\\'s used for a paginated request.</p> <p>If you don\\'t specify <code>MaxResults</code>, the request retrieves all available results in a single response.</p>', ], ], 'Memory' => [ 'base' => NULL, 'refs' => [ 'InstanceConfiguration$Memory' => '<p>The amount of memory, in MB or GB, reserved for each instance of your App Runner service.</p> <p>Default: <code>2 GB</code> </p>', ], ], 'NetworkConfiguration' => [ 'base' => '<p>Describes configuration settings related to network traffic of an App Runner service. Consists of embedded objects for each configurable network feature.</p>', 'refs' => [ 'CreateServiceRequest$NetworkConfiguration' => '<p>Configuration settings related to network traffic of the web application that the App Runner service runs.</p>', 'Service$NetworkConfiguration' => '<p>Configuration settings related to network traffic of the web application that this service runs.</p>', 'UpdateServiceRequest$NetworkConfiguration' => '<p>Configuration settings related to network traffic of the web application that the App Runner service runs.</p>', ], ], 'NextToken' => [ 'base' => NULL, 'refs' => [ 'ListAutoScalingConfigurationsRequest$NextToken' => '<p>A token from a previous result page. It\\'s used for a paginated request. The request retrieves the next result page. All other parameter values must be identical to the ones that are specified in the initial request.</p> <p>If you don\\'t specify <code>NextToken</code>, the request retrieves the first result page.</p>', 'ListAutoScalingConfigurationsResponse$NextToken' => '<p>The token that you can pass in a subsequent request to get the next result page. It\\'s returned in a paginated request.</p>', 'ListConnectionsRequest$NextToken' => '<p>A token from a previous result page. Used for a paginated request. The request retrieves the next result page. All other parameter values must be identical to the ones specified in the initial request.</p> <p>If you don\\'t specify <code>NextToken</code>, the request retrieves the first result page.</p>', 'ListConnectionsResponse$NextToken' => '<p>The token that you can pass in a subsequent request to get the next result page. Returned in a paginated request.</p>', 'ListObservabilityConfigurationsRequest$NextToken' => '<p>A token from a previous result page. It\\'s used for a paginated request. The request retrieves the next result page. All other parameter values must be identical to the ones that are specified in the initial request.</p> <p>If you don\\'t specify <code>NextToken</code>, the request retrieves the first result page.</p>', 'ListObservabilityConfigurationsResponse$NextToken' => '<p>The token that you can pass in a subsequent request to get the next result page. It\\'s returned in a paginated request.</p>', 'ListVpcConnectorsRequest$NextToken' => '<p>A token from a previous result page. It\\'s used for a paginated request. The request retrieves the next result page. All other parameter values must be identical to the ones that are specified in the initial request.</p> <p>If you don\\'t specify <code>NextToken</code>, the request retrieves the first result page.</p>', 'ListVpcConnectorsResponse$NextToken' => '<p>The token that you can pass in a subsequent request to get the next result page. It\\'s returned in a paginated request.</p>', 'ListVpcIngressConnectionsRequest$NextToken' => '<p>A token from a previous result page. It\\'s used for a paginated request. The request retrieves the next result page. All other parameter values must be identical to the ones that are specified in the initial request.</p> <p>If you don\\'t specify <code>NextToken</code>, the request retrieves the first result page.</p>', 'ListVpcIngressConnectionsResponse$NextToken' => '<p>The token that you can pass in a subsequent request to get the next result page. It\\'s returned in a paginated request.</p>', ], ], 'NullableBoolean' => [ 'base' => NULL, 'refs' => [ 'AssociateCustomDomainRequest$EnableWWWSubdomain' => '<p>Set to <code>true</code> to associate the subdomain <code>www.<i>DomainName</i> </code> with the App Runner service in addition to the base domain.</p> <p>Default: <code>true</code> </p>', 'CustomDomain$EnableWWWSubdomain' => '<p>When <code>true</code>, the subdomain <code>www.<i>DomainName</i> </code> is associated with the App Runner service in addition to the base domain.</p>', 'SourceConfiguration$AutoDeploymentsEnabled' => '<p>If <code>true</code>, continuous integration from the source repository is enabled for the App Runner service. Each repository change (including any source code commit or new image version) starts a deployment.</p> <p>Default: App Runner sets to <code>false</code> for a source image that uses an ECR Public repository or an ECR repository that\\'s in an Amazon Web Services account other than the one that the service is in. App Runner sets to <code>true</code> in all other cases (which currently include a source code repository or a source image using a same-account ECR repository).</p>', ], ], 'ObservabilityConfiguration' => [ 'base' => '<p>Describes an App Runner observability configuration resource. Multiple revisions of a configuration have the same <code>ObservabilityConfigurationName</code> and different <code>ObservabilityConfigurationRevision</code> values.</p> <p>The resource is designed to configure multiple features (currently one feature, tracing). This type contains optional members that describe the configuration of these features (currently one member, <code>TraceConfiguration</code>). If a feature member isn\\'t specified, the feature isn\\'t enabled.</p>', 'refs' => [ 'CreateObservabilityConfigurationResponse$ObservabilityConfiguration' => '<p>A description of the App Runner observability configuration that\\'s created by this request.</p>', 'DeleteObservabilityConfigurationResponse$ObservabilityConfiguration' => '<p>A description of the App Runner observability configuration that this request just deleted.</p>', 'DescribeObservabilityConfigurationResponse$ObservabilityConfiguration' => '<p>A full description of the App Runner observability configuration that you specified in this request.</p>', ], ], 'ObservabilityConfigurationName' => [ 'base' => NULL, 'refs' => [ 'CreateObservabilityConfigurationRequest$ObservabilityConfigurationName' => '<p>A name for the observability configuration. When you use it for the first time in an Amazon Web Services Region, App Runner creates revision number <code>1</code> of this name. When you use the same name in subsequent calls, App Runner creates incremental revisions of the configuration.</p> <note> <p>The name <code>DefaultConfiguration</code> is reserved. You can\\'t use it to create a new observability configuration, and you can\\'t create a revision of it.</p> <p>When you want to use your own observability configuration for your App Runner service, <i>create a configuration with a different name</i>, and then provide it when you create or update your service.</p> </note>', 'ListObservabilityConfigurationsRequest$ObservabilityConfigurationName' => '<p>The name of the App Runner observability configuration that you want to list. If specified, App Runner lists revisions that share this name. If not specified, App Runner returns revisions of all active configurations.</p>', 'ObservabilityConfiguration$ObservabilityConfigurationName' => '<p>The customer-provided observability configuration name. It can be used in multiple revisions of a configuration.</p>', 'ObservabilityConfigurationSummary$ObservabilityConfigurationName' => '<p>The customer-provided observability configuration name. It can be used in multiple revisions of a configuration.</p>', ], ], 'ObservabilityConfigurationStatus' => [ 'base' => NULL, 'refs' => [ 'ObservabilityConfiguration$Status' => '<p>The current state of the observability configuration. If the status of a configuration revision is <code>INACTIVE</code>, it was deleted and can\\'t be used. Inactive configuration revisions are permanently removed some time after they are deleted.</p>', ], ], 'ObservabilityConfigurationSummary' => [ 'base' => '<p>Provides summary information about an App Runner observability configuration resource.</p> <p>This type contains limited information about an observability configuration. It includes only identification information, without configuration details. It\\'s returned by the <a>ListObservabilityConfigurations</a> action. Complete configuration information is returned by the <a>CreateObservabilityConfiguration</a>, <a>DescribeObservabilityConfiguration</a>, and <a>DeleteObservabilityConfiguration</a> actions using the <a>ObservabilityConfiguration</a> type.</p>', 'refs' => [ 'ObservabilityConfigurationSummaryList$member' => NULL, ], ], 'ObservabilityConfigurationSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListObservabilityConfigurationsResponse$ObservabilityConfigurationSummaryList' => '<p>A list of summary information records for observability configurations. In a paginated request, the request returns up to <code>MaxResults</code> records for each call.</p>', ], ], 'OperationStatus' => [ 'base' => NULL, 'refs' => [ 'OperationSummary$Status' => '<p>The current state of the operation.</p>', ], ], 'OperationSummary' => [ 'base' => '<p>Provides summary information for an operation that occurred on an App Runner service.</p>', 'refs' => [ 'OperationSummaryList$member' => NULL, ], ], 'OperationSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListOperationsResponse$OperationSummaryList' => '<p>A list of operation summary information records. In a paginated request, the request returns up to <code>MaxResults</code> records for each call.</p>', ], ], 'OperationType' => [ 'base' => NULL, 'refs' => [ 'OperationSummary$Type' => '<p>The type of operation. It indicates a specific action that occured.</p>', ], ], 'PauseServiceRequest' => [ 'base' => NULL, 'refs' => [], ], 'PauseServiceResponse' => [ 'base' => NULL, 'refs' => [], ], 'ProviderType' => [ 'base' => NULL, 'refs' => [ 'Connection$ProviderType' => '<p>The source repository provider.</p>', 'ConnectionSummary$ProviderType' => '<p>The source repository provider.</p>', 'CreateConnectionRequest$ProviderType' => '<p>The source repository provider.</p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p>A resource doesn\\'t exist for the specified Amazon Resource Name (ARN) in your Amazon Web Services account.</p>', 'refs' => [], ], 'ResumeServiceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ResumeServiceResponse' => [ 'base' => NULL, 'refs' => [], ], 'RoleArn' => [ 'base' => NULL, 'refs' => [ 'AuthenticationConfiguration$AccessRoleArn' => '<p>The Amazon Resource Name (ARN) of the IAM role that grants the App Runner service access to a source repository. It\\'s required for ECR image repositories (but not for ECR Public repositories).</p>', 'InstanceConfiguration$InstanceRoleArn' => '<p>The Amazon Resource Name (ARN) of an IAM role that provides permissions to your App Runner service. These are permissions that your code needs when it calls any Amazon Web Services APIs.</p>', ], ], 'Runtime' => [ 'base' => NULL, 'refs' => [ 'CodeConfigurationValues$Runtime' => '<p>A runtime environment type for building and running an App Runner service. It represents a programming language runtime.</p>', ], ], 'RuntimeEnvironmentSecrets' => [ 'base' => NULL, 'refs' => [ 'CodeConfigurationValues$RuntimeEnvironmentSecrets' => '<p>An array of key-value pairs representing the secrets and parameters that get referenced to your service as an environment variable. The supported values are either the full Amazon Resource Name (ARN) of the Secrets Manager secret or the full ARN of the parameter in the Amazon Web Services Systems Manager Parameter Store.</p> <note> <ul> <li> <p> If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Amazon Web Services Region as the service that you\\'re launching, you can use either the full ARN or name of the secret. If the parameter exists in a different Region, then the full ARN must be specified. </p> </li> <li> <p> Currently, cross account referencing of Amazon Web Services Systems Manager Parameter Store parameter is not supported. </p> </li> </ul> </note>', 'ImageConfiguration$RuntimeEnvironmentSecrets' => '<p>An array of key-value pairs representing the secrets and parameters that get referenced to your service as an environment variable. The supported values are either the full Amazon Resource Name (ARN) of the Secrets Manager secret or the full ARN of the parameter in the Amazon Web Services Systems Manager Parameter Store.</p> <note> <ul> <li> <p> If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Amazon Web Services Region as the service that you\\'re launching, you can use either the full ARN or name of the secret. If the parameter exists in a different Region, then the full ARN must be specified. </p> </li> <li> <p> Currently, cross account referencing of Amazon Web Services Systems Manager Parameter Store parameter is not supported. </p> </li> </ul> </note>', ], ], 'RuntimeEnvironmentSecretsName' => [ 'base' => NULL, 'refs' => [ 'RuntimeEnvironmentSecrets$key' => NULL, ], ], 'RuntimeEnvironmentSecretsValue' => [ 'base' => NULL, 'refs' => [ 'RuntimeEnvironmentSecrets$value' => NULL, ], ], 'RuntimeEnvironmentVariables' => [ 'base' => NULL, 'refs' => [ 'CodeConfigurationValues$RuntimeEnvironmentVariables' => '<p>The environment variables that are available to your running App Runner service. An array of key-value pairs.</p>', 'ImageConfiguration$RuntimeEnvironmentVariables' => '<p>Environment variables that are available to your running App Runner service. An array of key-value pairs.</p>', ], ], 'RuntimeEnvironmentVariablesKey' => [ 'base' => NULL, 'refs' => [ 'RuntimeEnvironmentVariables$key' => NULL, ], ], 'RuntimeEnvironmentVariablesValue' => [ 'base' => NULL, 'refs' => [ 'RuntimeEnvironmentVariables$value' => NULL, ], ], 'Service' => [ 'base' => '<p>Describes an App Runner service. It can describe a service in any state, including deleted services.</p> <p>This type contains the full information about a service, including configuration details. It\\'s returned by the <a href=\"https://docs.aws.amazon.com/apprunner/latest/api/API_CreateService.html\">CreateService</a>, <a href=\"https://docs.aws.amazon.com/apprunner/latest/api/API_DescribeService.html\">DescribeService</a>, and <a href=\"https://docs.aws.amazon.com/apprunner/latest/api/API_DeleteService.html\">DeleteService</a> actions. A subset of this information is returned by the <a href=\"https://docs.aws.amazon.com/apprunner/latest/api/API_ListServices.html\">ListServices</a> action using the <a href=\"https://docs.aws.amazon.com/apprunner/latest/api/API_ServiceSummary.html\">ServiceSummary</a> type.</p>', 'refs' => [ 'CreateServiceResponse$Service' => '<p>A description of the App Runner service that\\'s created by this request.</p>', 'DeleteServiceResponse$Service' => '<p>A description of the App Runner service that this request just deleted.</p>', 'DescribeServiceResponse$Service' => '<p>A full description of the App Runner service that you specified in this request.</p>', 'PauseServiceResponse$Service' => '<p>A description of the App Runner service that this request just paused.</p>', 'ResumeServiceResponse$Service' => '<p>A description of the App Runner service that this request just resumed.</p>', 'UpdateServiceResponse$Service' => '<p>A description of the App Runner service updated by this request. All configuration values in the returned <code>Service</code> structure reflect configuration changes that are being applied by this request.</p>', ], ], 'ServiceId' => [ 'base' => NULL, 'refs' => [ 'Service$ServiceId' => '<p>An ID that App Runner generated for this service. It\\'s unique within the Amazon Web Services Region.</p>', 'ServiceSummary$ServiceId' => '<p>An ID that App Runner generated for this service. It\\'s unique within the Amazon Web Services Region.</p>', ], ], 'ServiceMaxResults' => [ 'base' => NULL, 'refs' => [ 'ListServicesRequest$MaxResults' => '<p>The maximum number of results to include in each response (result page). It\\'s used for a paginated request.</p> <p>If you don\\'t specify <code>MaxResults</code>, the request retrieves all available results in a single response.</p>', ], ], 'ServiceName' => [ 'base' => NULL, 'refs' => [ 'CreateServiceRequest$ServiceName' => '<p>A name for the App Runner service. It must be unique across all the running App Runner services in your Amazon Web Services account in the Amazon Web Services Region.</p>', 'Service$ServiceName' => '<p>The customer-provided service name.</p>', 'ServiceSummary$ServiceName' => '<p>The customer-provided service name.</p>', ], ], 'ServiceObservabilityConfiguration' => [ 'base' => '<p>Describes the observability configuration of an App Runner service. These are additional observability features, like tracing, that you choose to enable. They\\'re configured in a separate resource that you associate with your service.</p>', 'refs' => [ 'CreateServiceRequest$ObservabilityConfiguration' => '<p>The observability configuration of your service.</p>', 'Service$ObservabilityConfiguration' => '<p>The observability configuration of this service.</p>', 'UpdateServiceRequest$ObservabilityConfiguration' => '<p>The observability configuration of your service.</p>', ], ], 'ServiceQuotaExceededException' => [ 'base' => '<p>App Runner can\\'t create this resource. You\\'ve reached your account quota for this resource type.</p> <p>For App Runner per-resource quotas, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/apprunner.html\">App Runner endpoints and quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>', 'refs' => [], ], 'ServiceStatus' => [ 'base' => NULL, 'refs' => [ 'Service$Status' => '<p>The current state of the App Runner service. These particular values mean the following.</p> <ul> <li> <p> <code>CREATE_FAILED</code> \u00e2\u20ac\u201c The service failed to create. To troubleshoot this failure, read the failure events and logs, change any parameters that need to be fixed, and retry the call to create the service.</p> <p>The failed service isn\\'t usable, and still counts towards your service quota. When you\\'re done analyzing the failure, delete the service.</p> </li> <li> <p> <code>DELETE_FAILED</code> \u00e2\u20ac\u201c The service failed to delete and can\\'t be successfully recovered. Retry the service deletion call to ensure that all related resources are removed.</p> </li> </ul>', 'ServiceSummary$Status' => '<p>The current state of the App Runner service. These particular values mean the following.</p> <ul> <li> <p> <code>CREATE_FAILED</code> \u00e2\u20ac\u201c The service failed to create. Read the failure events and logs, change any parameters that need to be fixed, and retry the call to create the service.</p> <p>The failed service isn\\'t usable, and still counts towards your service quota. When you\\'re done analyzing the failure, delete the service.</p> </li> <li> <p> <code>DELETE_FAILED</code> \u00e2\u20ac\u201c The service failed to delete and can\\'t be successfully recovered. Retry the service deletion call to ensure that all related resources are removed.</p> </li> </ul>', ], ], 'ServiceSummary' => [ 'base' => '<p>Provides summary information for an App Runner service.</p> <p>This type contains limited information about a service. It doesn\\'t include configuration details. It\\'s returned by the <a href=\"https://docs.aws.amazon.com/apprunner/latest/api/API_ListServices.html\">ListServices</a> action. Complete service information is returned by the <a href=\"https://docs.aws.amazon.com/apprunner/latest/api/API_CreateService.html\">CreateService</a>, <a href=\"https://docs.aws.amazon.com/apprunner/latest/api/API_DescribeService.html\">DescribeService</a>, and <a href=\"https://docs.aws.amazon.com/apprunner/latest/api/API_DeleteService.html\">DeleteService</a> actions using the <a href=\"https://docs.aws.amazon.com/apprunner/latest/api/API_Service.html\">Service</a> type.</p>', 'refs' => [ 'ServiceSummaryList$member' => NULL, ], ], 'ServiceSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListServicesResponse$ServiceSummaryList' => '<p>A list of service summary information records. In a paginated request, the request returns up to <code>MaxResults</code> records for each call.</p>', ], ], 'SourceCodeVersion' => [ 'base' => '<p>Identifies a version of code that App Runner refers to within a source code repository.</p>', 'refs' => [ 'CodeRepository$SourceCodeVersion' => '<p>The version that should be used within the source code repository.</p>', ], ], 'SourceCodeVersionType' => [ 'base' => NULL, 'refs' => [ 'SourceCodeVersion$Type' => '<p>The type of version identifier.</p> <p>For a git-based repository, branches represent versions.</p>', ], ], 'SourceConfiguration' => [ 'base' => '<p>Describes the source deployed to an App Runner service. It can be a code or an image repository.</p>', 'refs' => [ 'CreateServiceRequest$SourceConfiguration' => '<p>The source to deploy to the App Runner service. It can be a code or an image repository.</p>', 'Service$SourceConfiguration' => '<p>The source deployed to the App Runner service. It can be a code or an image repository.</p>', 'UpdateServiceRequest$SourceConfiguration' => '<p>The source configuration to apply to the App Runner service.</p> <p>You can change the configuration of the code or image repository that the service uses. However, you can\\'t switch from code to image or the other way around. This means that you must provide the same structure member of <code>SourceConfiguration</code> that you originally included when you created the service. Specifically, you can include either <code>CodeRepository</code> or <code>ImageRepository</code>. To update the source configuration, set the values to members of the structure that you include.</p>', ], ], 'StartCommand' => [ 'base' => NULL, 'refs' => [ 'CodeConfigurationValues$StartCommand' => '<p>The command App Runner runs to start your application.</p>', 'ImageConfiguration$StartCommand' => '<p>An optional command that App Runner runs to start the application in the source image. If specified, this command overrides the Docker image\u00e2\u20ac\u2122s default start command.</p>', ], ], 'StartDeploymentRequest' => [ 'base' => NULL, 'refs' => [], ], 'StartDeploymentResponse' => [ 'base' => NULL, 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [ 'AssociateCustomDomainResponse$DNSTarget' => '<p>The App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name.</p>', 'CertificateValidationRecord$Name' => '<p>The certificate CNAME record name.</p>', 'CertificateValidationRecord$Type' => '<p>The record type, always <code>CNAME</code>.</p>', 'CertificateValidationRecord$Value' => '<p>The certificate CNAME record value.</p>', 'CodeConfigurationValues$Port' => '<p>The port that your application listens to in the container.</p> <p>Default: <code>8080</code> </p>', 'CodeRepository$RepositoryUrl' => '<p>The location of the repository that contains the source code.</p>', 'DescribeCustomDomainsRequest$NextToken' => '<p>A token from a previous result page. It\\'s used for a paginated request. The request retrieves the next result page. All other parameter values must be identical to the ones that are specified in the initial request.</p> <p>If you don\\'t specify <code>NextToken</code>, the request retrieves the first result page.</p>', 'DescribeCustomDomainsResponse$DNSTarget' => '<p>The App Runner subdomain of the App Runner service. The associated custom domain names are mapped to this target name.</p>', 'DescribeCustomDomainsResponse$NextToken' => '<p>The token that you can pass in a subsequent request to get the next result page. It\\'s returned in a paginated request.</p>', 'DisassociateCustomDomainResponse$DNSTarget' => '<p>The App Runner subdomain of the App Runner service. The disassociated custom domain name was mapped to this target name.</p>', 'ImageConfiguration$Port' => '<p>The port that your application listens to in the container.</p> <p>Default: <code>8080</code> </p>', 'IngressVpcConfiguration$VpcId' => '<p>The ID of the VPC that is used for the VPC endpoint.</p>', 'IngressVpcConfiguration$VpcEndpointId' => '<p>The ID of the VPC endpoint that your App Runner service connects to. </p>', 'ListOperationsRequest$NextToken' => '<p>A token from a previous result page. It\\'s used for a paginated request. The request retrieves the next result page. All other parameter values must be identical to the ones specified in the initial request.</p> <p>If you don\\'t specify <code>NextToken</code>, the request retrieves the first result page.</p>', 'ListOperationsResponse$NextToken' => '<p>The token that you can pass in a subsequent request to get the next result page. It\\'s returned in a paginated request.</p>', 'ListServicesRequest$NextToken' => '<p>A token from a previous result page. Used for a paginated request. The request retrieves the next result page. All other parameter values must be identical to the ones specified in the initial request.</p> <p>If you don\\'t specify <code>NextToken</code>, the request retrieves the first result page.</p>', 'ListServicesResponse$NextToken' => '<p>The token that you can pass in a subsequent request to get the next result page. It\\'s returned in a paginated request.</p>', 'ListVpcIngressConnectionsFilter$VpcEndpointId' => '<p>The ID of a VPC Endpoint to filter by. </p>', 'Service$ServiceUrl' => '<p>A subdomain URL that App Runner generated for this service. You can use this URL to access your service web application.</p>', 'ServiceSummary$ServiceUrl' => '<p>A subdomain URL that App Runner generated for this service. You can use this URL to access your service web application.</p>', 'SourceCodeVersion$Value' => '<p>A source code version.</p> <p>For a git-based repository, a branch name maps to a specific version. App Runner uses the most recent commit to the branch.</p>', 'StringList$member' => NULL, 'VpcDNSTarget$VpcId' => '<p>The ID of the Amazon VPC that is associated with the custom domain name of the target DNS.</p>', ], ], 'StringList' => [ 'base' => NULL, 'refs' => [ 'CreateVpcConnectorRequest$Subnets' => '<p>A list of IDs of subnets that App Runner should use when it associates your service with a custom Amazon VPC. Specify IDs of subnets of a single Amazon VPC. App Runner determines the Amazon VPC from the subnets you specify.</p> <note> <p> App Runner currently only provides support for IPv4. </p> </note>', 'CreateVpcConnectorRequest$SecurityGroups' => '<p>A list of IDs of security groups that App Runner should use for access to Amazon Web Services resources under the specified subnets. If not specified, App Runner uses the default security group of the Amazon VPC. The default security group allows all outbound traffic.</p>', 'VpcConnector$Subnets' => '<p>A list of IDs of subnets that App Runner uses for your service. All IDs are of subnets of a single Amazon VPC.</p>', 'VpcConnector$SecurityGroups' => '<p>A list of IDs of security groups that App Runner uses for access to Amazon Web Services resources under the specified subnets. If not specified, App Runner uses the default security group of the Amazon VPC. The default security group allows all outbound traffic.</p>', ], ], 'Tag' => [ 'base' => '<p>Describes a tag that is applied to an App Runner resource. A tag is a metadata item consisting of a key-value pair.</p>', 'refs' => [ 'TagList$member' => NULL, ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'Tag$Key' => '<p>The key of the tag.</p>', 'TagKeyList$member' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$TagKeys' => '<p>A list of tag keys that you want to remove.</p>', ], ], 'TagList' => [ 'base' => NULL, 'refs' => [ 'CreateAutoScalingConfigurationRequest$Tags' => '<p>A list of metadata items that you can associate with your auto scaling configuration resource. A tag is a key-value pair.</p>', 'CreateConnectionRequest$Tags' => '<p>A list of metadata items that you can associate with your connection resource. A tag is a key-value pair.</p>', 'CreateObservabilityConfigurationRequest$Tags' => '<p>A list of metadata items that you can associate with your observability configuration resource. A tag is a key-value pair.</p>', 'CreateServiceRequest$Tags' => '<p>An optional list of metadata items that you can associate with the App Runner service resource. A tag is a key-value pair.</p>', 'CreateVpcConnectorRequest$Tags' => '<p>A list of metadata items that you can associate with your VPC connector resource. A tag is a key-value pair.</p>', 'CreateVpcIngressConnectionRequest$Tags' => '<p>An optional list of metadata items that you can associate with the VPC Ingress Connection resource. A tag is a key-value pair.</p>', 'ListTagsForResourceResponse$Tags' => '<p>A list of the tag key-value pairs that are associated with the resource.</p>', 'TagResourceRequest$Tags' => '<p>A list of tag key-value pairs to add or update. If a key is new to the resource, the tag is added with the provided value. If a key is already associated with the resource, the value of the tag is updated.</p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'Tag$Value' => '<p>The value of the tag.</p>', ], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [ 'AutoScalingConfiguration$CreatedAt' => '<p>The time when the auto scaling configuration was created. It\\'s in Unix time stamp format.</p>', 'AutoScalingConfiguration$DeletedAt' => '<p>The time when the auto scaling configuration was deleted. It\\'s in Unix time stamp format.</p>', 'Connection$CreatedAt' => '<p>The App Runner connection creation time, expressed as a Unix time stamp.</p>', 'ConnectionSummary$CreatedAt' => '<p>The App Runner connection creation time, expressed as a Unix time stamp.</p>', 'ObservabilityConfiguration$CreatedAt' => '<p>The time when the observability configuration was created. It\\'s in Unix time stamp format.</p>', 'ObservabilityConfiguration$DeletedAt' => '<p>The time when the observability configuration was deleted. It\\'s in Unix time stamp format.</p>', 'OperationSummary$StartedAt' => '<p>The time when the operation started. It\\'s in the Unix time stamp format.</p>', 'OperationSummary$EndedAt' => '<p>The time when the operation ended. It\\'s in the Unix time stamp format.</p>', 'OperationSummary$UpdatedAt' => '<p>The time when the operation was last updated. It\\'s in the Unix time stamp format.</p>', 'Service$CreatedAt' => '<p>The time when the App Runner service was created. It\\'s in the Unix time stamp format.</p>', 'Service$UpdatedAt' => '<p>The time when the App Runner service was last updated at. It\\'s in the Unix time stamp format.</p>', 'Service$DeletedAt' => '<p>The time when the App Runner service was deleted. It\\'s in the Unix time stamp format.</p>', 'ServiceSummary$CreatedAt' => '<p>The time when the App Runner service was created. It\\'s in the Unix time stamp format.</p>', 'ServiceSummary$UpdatedAt' => '<p>The time when the App Runner service was last updated. It\\'s in theUnix time stamp format.</p>', 'VpcConnector$CreatedAt' => '<p>The time when the VPC connector was created. It\\'s in Unix time stamp format.</p>', 'VpcConnector$DeletedAt' => '<p>The time when the VPC connector was deleted. It\\'s in Unix time stamp format.</p>', 'VpcIngressConnection$CreatedAt' => '<p>The time when the VPC Ingress Connection was created. It\\'s in the Unix time stamp format.</p> <ul> <li> <p> Type: Timestamp </p> </li> <li> <p> Required: Yes </p> </li> </ul>', 'VpcIngressConnection$DeletedAt' => '<p>The time when the App Runner service was deleted. It\\'s in the Unix time stamp format.</p> <ul> <li> <p> Type: Timestamp </p> </li> <li> <p> Required: No </p> </li> </ul>', ], ], 'TraceConfiguration' => [ 'base' => '<p>Describes the configuration of the tracing feature within an App Runner observability configuration.</p>', 'refs' => [ 'CreateObservabilityConfigurationRequest$TraceConfiguration' => '<p>The configuration of the tracing feature within this observability configuration. If you don\\'t specify it, App Runner doesn\\'t enable tracing.</p>', 'ObservabilityConfiguration$TraceConfiguration' => '<p>The configuration of the tracing feature within this observability configuration. If not specified, tracing isn\\'t enabled.</p>', ], ], 'TracingVendor' => [ 'base' => NULL, 'refs' => [ 'TraceConfiguration$Vendor' => '<p>The implementation provider chosen for tracing App Runner services.</p>', ], ], 'UUID' => [ 'base' => NULL, 'refs' => [ 'CreateServiceResponse$OperationId' => '<p>The unique ID of the asynchronous operation that this request started. You can use it combined with the <a href=\"https://docs.aws.amazon.com/apprunner/latest/api/API_ListOperations.html\">ListOperations</a> call to track the operation\\'s progress.</p>', 'DeleteServiceResponse$OperationId' => '<p>The unique ID of the asynchronous operation that this request started. You can use it combined with the <a>ListOperations</a> call to track the operation\\'s progress.</p>', 'OperationSummary$Id' => '<p>A unique ID of this operation. It\\'s unique in the scope of the App Runner service.</p>', 'PauseServiceResponse$OperationId' => '<p>The unique ID of the asynchronous operation that this request started. You can use it combined with the <a>ListOperations</a> call to track the operation\\'s progress.</p>', 'ResumeServiceResponse$OperationId' => '<p>The unique ID of the asynchronous operation that this request started. You can use it combined with the <a>ListOperations</a> call to track the operation\\'s progress.</p>', 'StartDeploymentResponse$OperationId' => '<p>The unique ID of the asynchronous operation that this request started. You can use it combined with the <a>ListOperations</a> call to track the operation\\'s progress.</p>', 'UpdateServiceResponse$OperationId' => '<p>The unique ID of the asynchronous operation that this request started. You can use it combined with the <a>ListOperations</a> call to track the operation\\'s progress.</p>', ], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateServiceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateServiceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateVpcIngressConnectionRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateVpcIngressConnectionResponse' => [ 'base' => NULL, 'refs' => [], ], 'VpcConnector' => [ 'base' => '<p>Describes an App Runner VPC connector resource. A VPC connector describes the Amazon Virtual Private Cloud (Amazon VPC) that an App Runner service is associated with, and the subnets and security group that are used.</p> <p>Multiple revisions of a connector might have the same <code>Name</code> and different <code>Revision</code> values.</p> <note> <p>At this time, App Runner supports only one revision per name.</p> </note>', 'refs' => [ 'CreateVpcConnectorResponse$VpcConnector' => '<p>A description of the App Runner VPC connector that\\'s created by this request.</p>', 'DeleteVpcConnectorResponse$VpcConnector' => '<p>A description of the App Runner VPC connector that this request just deleted.</p>', 'DescribeVpcConnectorResponse$VpcConnector' => '<p>A description of the App Runner VPC connector that you specified in this request.</p>', 'VpcConnectors$member' => NULL, ], ], 'VpcConnectorName' => [ 'base' => NULL, 'refs' => [ 'CreateVpcConnectorRequest$VpcConnectorName' => '<p>A name for the VPC connector.</p>', 'VpcConnector$VpcConnectorName' => '<p>The customer-provided VPC connector name.</p>', ], ], 'VpcConnectorStatus' => [ 'base' => NULL, 'refs' => [ 'VpcConnector$Status' => '<p>The current state of the VPC connector. If the status of a connector revision is <code>INACTIVE</code>, it was deleted and can\\'t be used. Inactive connector revisions are permanently removed some time after they are deleted.</p>', ], ], 'VpcConnectors' => [ 'base' => NULL, 'refs' => [ 'ListVpcConnectorsResponse$VpcConnectors' => '<p>A list of information records for VPC connectors. In a paginated request, the request returns up to <code>MaxResults</code> records for each call.</p>', ], ], 'VpcDNSTarget' => [ 'base' => '<p>DNS Target record for a custom domain of this Amazon VPC.</p>', 'refs' => [ 'VpcDNSTargetList$member' => NULL, ], ], 'VpcDNSTargetList' => [ 'base' => NULL, 'refs' => [ 'AssociateCustomDomainResponse$VpcDNSTargets' => '<p>DNS Target records for the custom domains of this Amazon VPC. </p>', 'DescribeCustomDomainsResponse$VpcDNSTargets' => '<p>DNS Target records for the custom domains of this Amazon VPC. </p>', 'DisassociateCustomDomainResponse$VpcDNSTargets' => '<p>DNS Target records for the custom domains of this Amazon VPC. </p>', ], ], 'VpcIngressConnection' => [ 'base' => '<p>The App Runner resource that specifies an App Runner endpoint for incoming traffic. It establishes a connection between a VPC interface endpoint and a App Runner service, to make your App Runner service accessible from only within an Amazon VPC.</p>', 'refs' => [ 'CreateVpcIngressConnectionResponse$VpcIngressConnection' => '<p>A description of the App Runner VPC Ingress Connection resource that\\'s created by this request. </p>', 'DeleteVpcIngressConnectionResponse$VpcIngressConnection' => '<p>A description of the App Runner VPC Ingress Connection that this request just deleted.</p>', 'DescribeVpcIngressConnectionResponse$VpcIngressConnection' => '<p>A description of the App Runner VPC Ingress Connection that you specified in this request.</p>', 'UpdateVpcIngressConnectionResponse$VpcIngressConnection' => '<p>A description of the App Runner VPC Ingress Connection resource that\\'s updated by this request.</p>', ], ], 'VpcIngressConnectionName' => [ 'base' => NULL, 'refs' => [ 'CreateVpcIngressConnectionRequest$VpcIngressConnectionName' => '<p>A name for the VPC Ingress Connection resource. It must be unique across all the active VPC Ingress Connections in your Amazon Web Services account in the Amazon Web Services Region. </p>', 'VpcIngressConnection$VpcIngressConnectionName' => '<p>The customer-provided VPC Ingress Connection name.</p>', ], ], 'VpcIngressConnectionStatus' => [ 'base' => NULL, 'refs' => [ 'VpcIngressConnection$Status' => '<p>The current status of the VPC Ingress Connection. The VPC Ingress Connection displays one of the following statuses: <code>AVAILABLE</code>, <code>PENDING_CREATION</code>, <code>PENDING_UPDATE</code>, <code>PENDING_DELETION</code>,<code>FAILED_CREATION</code>, <code>FAILED_UPDATE</code>, <code>FAILED_DELETION</code>, and <code>DELETED</code>.. </p>', ], ], 'VpcIngressConnectionSummary' => [ 'base' => '<p>Provides summary information about an VPC Ingress Connection, which includes its VPC Ingress Connection ARN and its associated Service ARN.</p>', 'refs' => [ 'VpcIngressConnectionSummaryList$member' => NULL, ], ], 'VpcIngressConnectionSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListVpcIngressConnectionsResponse$VpcIngressConnectionSummaryList' => '<p>A list of summary information records for VPC Ingress Connections. In a paginated request, the request returns up to <code>MaxResults</code> records for each call.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apprunner/2020-05-15/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://apprunner-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://apprunner-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://apprunner.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://apprunner.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apprunner/2020-05-15/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://apprunner.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apprunner/2020-05-15/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/apprunner/2020-05-15/paginators-1.json\nreturn [ 'pagination' => [ 'DescribeCustomDomains' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListAutoScalingConfigurations' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListConnections' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListObservabilityConfigurations' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListOperations' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListServices' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListVpcConnectors' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListVpcIngressConnections' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appstream/2016-12-01/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2016-12-01', 'endpointPrefix' => 'appstream2', 'jsonVersion' => '1.1', 'protocol' => 'json', 'serviceFullName' => 'Amazon AppStream', 'serviceId' => 'AppStream', 'signatureVersion' => 'v4', 'signingName' => 'appstream', 'targetPrefix' => 'PhotonAdminProxyService', 'uid' => 'appstream-2016-12-01', ], 'operations' => [ 'AssociateAppBlockBuilderAppBlock' => [ 'name' => 'AssociateAppBlockBuilderAppBlock', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AssociateAppBlockBuilderAppBlockRequest', ], 'output' => [ 'shape' => 'AssociateAppBlockBuilderAppBlockResult', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterCombinationException', ], [ 'shape' => 'OperationNotPermittedException', ], ], ], 'AssociateApplicationFleet' => [ 'name' => 'AssociateApplicationFleet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AssociateApplicationFleetRequest', ], 'output' => [ 'shape' => 'AssociateApplicationFleetResult', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterCombinationException', ], [ 'shape' => 'OperationNotPermittedException', ], ], ], 'AssociateApplicationToEntitlement' => [ 'name' => 'AssociateApplicationToEntitlement', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AssociateApplicationToEntitlementRequest', ], 'output' => [ 'shape' => 'AssociateApplicationToEntitlementResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'EntitlementNotFoundException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'OperationNotPermittedException', ], ], ], 'AssociateFleet' => [ 'name' => 'AssociateFleet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AssociateFleetRequest', ], 'output' => [ 'shape' => 'AssociateFleetResult', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'IncompatibleImageException', ], [ 'shape' => 'OperationNotPermittedException', ], ], ], 'BatchAssociateUserStack' => [ 'name' => 'BatchAssociateUserStack', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'BatchAssociateUserStackRequest', ], 'output' => [ 'shape' => 'BatchAssociateUserStackResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'InvalidParameterCombinationException', ], ], ], 'BatchDisassociateUserStack' => [ 'name' => 'BatchDisassociateUserStack', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'BatchDisassociateUserStackRequest', ], 'output' => [ 'shape' => 'BatchDisassociateUserStackResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'InvalidParameterCombinationException', ], ], ], 'CopyImage' => [ 'name' => 'CopyImage', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CopyImageRequest', ], 'output' => [ 'shape' => 'CopyImageResponse', ], 'errors' => [ [ 'shape' => 'ResourceAlreadyExistsException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ResourceNotAvailableException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'IncompatibleImageException', ], ], ], 'CreateAppBlock' => [ 'name' => 'CreateAppBlock', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateAppBlockRequest', ], 'output' => [ 'shape' => 'CreateAppBlockResult', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceAlreadyExistsException', ], ], ], 'CreateAppBlockBuilder' => [ 'name' => 'CreateAppBlockBuilder', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateAppBlockBuilderRequest', ], 'output' => [ 'shape' => 'CreateAppBlockBuilderResult', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'RequestLimitExceededException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'InvalidRoleException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceAlreadyExistsException', ], [ 'shape' => 'ResourceNotAvailableException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterCombinationException', ], ], ], 'CreateAppBlockBuilderStreamingURL' => [ 'name' => 'CreateAppBlockBuilderStreamingURL', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateAppBlockBuilderStreamingURLRequest', ], 'output' => [ 'shape' => 'CreateAppBlockBuilderStreamingURLResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'OperationNotPermittedException', ], ], ], 'CreateApplication' => [ 'name' => 'CreateApplication', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateApplicationRequest', ], 'output' => [ 'shape' => 'CreateApplicationResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceAlreadyExistsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'CreateDirectoryConfig' => [ 'name' => 'CreateDirectoryConfig', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateDirectoryConfigRequest', ], 'output' => [ 'shape' => 'CreateDirectoryConfigResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ResourceAlreadyExistsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'InvalidRoleException', ], ], ], 'CreateEntitlement' => [ 'name' => 'CreateEntitlement', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateEntitlementRequest', ], 'output' => [ 'shape' => 'CreateEntitlementResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'EntitlementAlreadyExistsException', ], ], ], 'CreateFleet' => [ 'name' => 'CreateFleet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateFleetRequest', ], 'output' => [ 'shape' => 'CreateFleetResult', ], 'errors' => [ [ 'shape' => 'ResourceAlreadyExistsException', ], [ 'shape' => 'ResourceNotAvailableException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'RequestLimitExceededException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'InvalidRoleException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InvalidParameterCombinationException', ], [ 'shape' => 'IncompatibleImageException', ], [ 'shape' => 'OperationNotPermittedException', ], ], ], 'CreateImageBuilder' => [ 'name' => 'CreateImageBuilder', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateImageBuilderRequest', ], 'output' => [ 'shape' => 'CreateImageBuilderResult', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'RequestLimitExceededException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'ResourceAlreadyExistsException', ], [ 'shape' => 'ResourceNotAvailableException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidRoleException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InvalidParameterCombinationException', ], [ 'shape' => 'IncompatibleImageException', ], [ 'shape' => 'OperationNotPermittedException', ], ], ], 'CreateImageBuilderStreamingURL' => [ 'name' => 'CreateImageBuilderStreamingURL', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateImageBuilderStreamingURLRequest', ], 'output' => [ 'shape' => 'CreateImageBuilderStreamingURLResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'CreateStack' => [ 'name' => 'CreateStack', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateStackRequest', ], 'output' => [ 'shape' => 'CreateStackResult', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'ResourceAlreadyExistsException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InvalidRoleException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterCombinationException', ], ], ], 'CreateStreamingURL' => [ 'name' => 'CreateStreamingURL', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateStreamingURLRequest', ], 'output' => [ 'shape' => 'CreateStreamingURLResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ResourceNotAvailableException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'InvalidParameterCombinationException', ], ], ], 'CreateUpdatedImage' => [ 'name' => 'CreateUpdatedImage', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateUpdatedImageRequest', ], 'output' => [ 'shape' => 'CreateUpdatedImageResult', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceAlreadyExistsException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'IncompatibleImageException', ], ], ], 'CreateUsageReportSubscription' => [ 'name' => 'CreateUsageReportSubscription', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateUsageReportSubscriptionRequest', ], 'output' => [ 'shape' => 'CreateUsageReportSubscriptionResult', ], 'errors' => [ [ 'shape' => 'InvalidRoleException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'CreateUser' => [ 'name' => 'CreateUser', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateUserRequest', ], 'output' => [ 'shape' => 'CreateUserResult', ], 'errors' => [ [ 'shape' => 'ResourceAlreadyExistsException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'InvalidParameterCombinationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'OperationNotPermittedException', ], ], ], 'DeleteAppBlock' => [ 'name' => 'DeleteAppBlock', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteAppBlockRequest', ], 'output' => [ 'shape' => 'DeleteAppBlockResult', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DeleteAppBlockBuilder' => [ 'name' => 'DeleteAppBlockBuilder', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteAppBlockBuilderRequest', ], 'output' => [ 'shape' => 'DeleteAppBlockBuilderResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DeleteApplication' => [ 'name' => 'DeleteApplication', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteApplicationRequest', ], 'output' => [ 'shape' => 'DeleteApplicationResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], ], 'DeleteDirectoryConfig' => [ 'name' => 'DeleteDirectoryConfig', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteDirectoryConfigRequest', ], 'output' => [ 'shape' => 'DeleteDirectoryConfigResult', ], 'errors' => [ [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DeleteEntitlement' => [ 'name' => 'DeleteEntitlement', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteEntitlementRequest', ], 'output' => [ 'shape' => 'DeleteEntitlementResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'EntitlementNotFoundException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ConcurrentModificationException', ], ], ], 'DeleteFleet' => [ 'name' => 'DeleteFleet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteFleetRequest', ], 'output' => [ 'shape' => 'DeleteFleetResult', ], 'errors' => [ [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], ], 'DeleteImage' => [ 'name' => 'DeleteImage', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteImageRequest', ], 'output' => [ 'shape' => 'DeleteImageResult', ], 'errors' => [ [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ConcurrentModificationException', ], ], ], 'DeleteImageBuilder' => [ 'name' => 'DeleteImageBuilder', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteImageBuilderRequest', ], 'output' => [ 'shape' => 'DeleteImageBuilderResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ConcurrentModificationException', ], ], ], 'DeleteImagePermissions' => [ 'name' => 'DeleteImagePermissions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteImagePermissionsRequest', ], 'output' => [ 'shape' => 'DeleteImagePermissionsResult', ], 'errors' => [ [ 'shape' => 'ResourceNotAvailableException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DeleteStack' => [ 'name' => 'DeleteStack', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteStackRequest', ], 'output' => [ 'shape' => 'DeleteStackResult', ], 'errors' => [ [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ConcurrentModificationException', ], ], ], 'DeleteUsageReportSubscription' => [ 'name' => 'DeleteUsageReportSubscription', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteUsageReportSubscriptionRequest', ], 'output' => [ 'shape' => 'DeleteUsageReportSubscriptionResult', ], 'errors' => [ [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DeleteUser' => [ 'name' => 'DeleteUser', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteUserRequest', ], 'output' => [ 'shape' => 'DeleteUserResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeAppBlockBuilderAppBlockAssociations' => [ 'name' => 'DescribeAppBlockBuilderAppBlockAssociations', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeAppBlockBuilderAppBlockAssociationsRequest', ], 'output' => [ 'shape' => 'DescribeAppBlockBuilderAppBlockAssociationsResult', ], 'errors' => [ [ 'shape' => 'InvalidParameterCombinationException', ], [ 'shape' => 'OperationNotPermittedException', ], ], ], 'DescribeAppBlockBuilders' => [ 'name' => 'DescribeAppBlockBuilders', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeAppBlockBuildersRequest', ], 'output' => [ 'shape' => 'DescribeAppBlockBuildersResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeAppBlocks' => [ 'name' => 'DescribeAppBlocks', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeAppBlocksRequest', ], 'output' => [ 'shape' => 'DescribeAppBlocksResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeApplicationFleetAssociations' => [ 'name' => 'DescribeApplicationFleetAssociations', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeApplicationFleetAssociationsRequest', ], 'output' => [ 'shape' => 'DescribeApplicationFleetAssociationsResult', ], 'errors' => [ [ 'shape' => 'InvalidParameterCombinationException', ], [ 'shape' => 'OperationNotPermittedException', ], ], ], 'DescribeApplications' => [ 'name' => 'DescribeApplications', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeApplicationsRequest', ], 'output' => [ 'shape' => 'DescribeApplicationsResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeDirectoryConfigs' => [ 'name' => 'DescribeDirectoryConfigs', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeDirectoryConfigsRequest', ], 'output' => [ 'shape' => 'DescribeDirectoryConfigsResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeEntitlements' => [ 'name' => 'DescribeEntitlements', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeEntitlementsRequest', ], 'output' => [ 'shape' => 'DescribeEntitlementsResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'EntitlementNotFoundException', ], ], ], 'DescribeFleets' => [ 'name' => 'DescribeFleets', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeFleetsRequest', ], 'output' => [ 'shape' => 'DescribeFleetsResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeImageBuilders' => [ 'name' => 'DescribeImageBuilders', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeImageBuildersRequest', ], 'output' => [ 'shape' => 'DescribeImageBuildersResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeImagePermissions' => [ 'name' => 'DescribeImagePermissions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeImagePermissionsRequest', ], 'output' => [ 'shape' => 'DescribeImagePermissionsResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeImages' => [ 'name' => 'DescribeImages', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeImagesRequest', ], 'output' => [ 'shape' => 'DescribeImagesResult', ], 'errors' => [ [ 'shape' => 'InvalidParameterCombinationException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeSessions' => [ 'name' => 'DescribeSessions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeSessionsRequest', ], 'output' => [ 'shape' => 'DescribeSessionsResult', ], 'errors' => [ [ 'shape' => 'InvalidParameterCombinationException', ], ], ], 'DescribeStacks' => [ 'name' => 'DescribeStacks', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeStacksRequest', ], 'output' => [ 'shape' => 'DescribeStacksResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeUsageReportSubscriptions' => [ 'name' => 'DescribeUsageReportSubscriptions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeUsageReportSubscriptionsRequest', ], 'output' => [ 'shape' => 'DescribeUsageReportSubscriptionsResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidAccountStatusException', ], ], ], 'DescribeUserStackAssociations' => [ 'name' => 'DescribeUserStackAssociations', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeUserStackAssociationsRequest', ], 'output' => [ 'shape' => 'DescribeUserStackAssociationsResult', ], 'errors' => [ [ 'shape' => 'InvalidParameterCombinationException', ], [ 'shape' => 'OperationNotPermittedException', ], ], ], 'DescribeUsers' => [ 'name' => 'DescribeUsers', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeUsersRequest', ], 'output' => [ 'shape' => 'DescribeUsersResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterCombinationException', ], [ 'shape' => 'OperationNotPermittedException', ], ], ], 'DisableUser' => [ 'name' => 'DisableUser', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DisableUserRequest', ], 'output' => [ 'shape' => 'DisableUserResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DisassociateAppBlockBuilderAppBlock' => [ 'name' => 'DisassociateAppBlockBuilderAppBlock', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DisassociateAppBlockBuilderAppBlockRequest', ], 'output' => [ 'shape' => 'DisassociateAppBlockBuilderAppBlockResult', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InvalidParameterCombinationException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DisassociateApplicationFleet' => [ 'name' => 'DisassociateApplicationFleet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DisassociateApplicationFleetRequest', ], 'output' => [ 'shape' => 'DisassociateApplicationFleetResult', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InvalidParameterCombinationException', ], [ 'shape' => 'OperationNotPermittedException', ], ], ], 'DisassociateApplicationFromEntitlement' => [ 'name' => 'DisassociateApplicationFromEntitlement', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DisassociateApplicationFromEntitlementRequest', ], 'output' => [ 'shape' => 'DisassociateApplicationFromEntitlementResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'EntitlementNotFoundException', ], [ 'shape' => 'OperationNotPermittedException', ], ], ], 'DisassociateFleet' => [ 'name' => 'DisassociateFleet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DisassociateFleetRequest', ], 'output' => [ 'shape' => 'DisassociateFleetResult', ], 'errors' => [ [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'OperationNotPermittedException', ], ], ], 'EnableUser' => [ 'name' => 'EnableUser', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'EnableUserRequest', ], 'output' => [ 'shape' => 'EnableUserResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidAccountStatusException', ], ], ], 'ExpireSession' => [ 'name' => 'ExpireSession', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ExpireSessionRequest', ], 'output' => [ 'shape' => 'ExpireSessionResult', ], ], 'ListAssociatedFleets' => [ 'name' => 'ListAssociatedFleets', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListAssociatedFleetsRequest', ], 'output' => [ 'shape' => 'ListAssociatedFleetsResult', ], ], 'ListAssociatedStacks' => [ 'name' => 'ListAssociatedStacks', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListAssociatedStacksRequest', ], 'output' => [ 'shape' => 'ListAssociatedStacksResult', ], ], 'ListEntitledApplications' => [ 'name' => 'ListEntitledApplications', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListEntitledApplicationsRequest', ], 'output' => [ 'shape' => 'ListEntitledApplicationsResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'EntitlementNotFoundException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], ], ], 'StartAppBlockBuilder' => [ 'name' => 'StartAppBlockBuilder', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StartAppBlockBuilderRequest', ], 'output' => [ 'shape' => 'StartAppBlockBuilderResult', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'RequestLimitExceededException', ], [ 'shape' => 'ResourceNotAvailableException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'StartFleet' => [ 'name' => 'StartFleet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StartFleetRequest', ], 'output' => [ 'shape' => 'StartFleetResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'RequestLimitExceededException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'ResourceNotAvailableException', ], [ 'shape' => 'InvalidRoleException', ], ], ], 'StartImageBuilder' => [ 'name' => 'StartImageBuilder', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StartImageBuilderRequest', ], 'output' => [ 'shape' => 'StartImageBuilderResult', ], 'errors' => [ [ 'shape' => 'ResourceNotAvailableException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'IncompatibleImageException', ], ], ], 'StopAppBlockBuilder' => [ 'name' => 'StopAppBlockBuilder', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StopAppBlockBuilderRequest', ], 'output' => [ 'shape' => 'StopAppBlockBuilderResult', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'StopFleet' => [ 'name' => 'StopFleet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StopFleetRequest', ], 'output' => [ 'shape' => 'StopFleetResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], ], 'StopImageBuilder' => [ 'name' => 'StopImageBuilder', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StopImageBuilderRequest', ], 'output' => [ 'shape' => 'StopImageBuilderResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ConcurrentModificationException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UpdateAppBlockBuilder' => [ 'name' => 'UpdateAppBlockBuilder', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateAppBlockBuilderRequest', ], 'output' => [ 'shape' => 'UpdateAppBlockBuilderResult', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'InvalidParameterCombinationException', ], [ 'shape' => 'InvalidRoleException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'RequestLimitExceededException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ResourceNotAvailableException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UpdateApplication' => [ 'name' => 'UpdateApplication', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateApplicationRequest', ], 'output' => [ 'shape' => 'UpdateApplicationResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UpdateDirectoryConfig' => [ 'name' => 'UpdateDirectoryConfig', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateDirectoryConfigRequest', ], 'output' => [ 'shape' => 'UpdateDirectoryConfigResult', ], 'errors' => [ [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'InvalidRoleException', ], ], ], 'UpdateEntitlement' => [ 'name' => 'UpdateEntitlement', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateEntitlementRequest', ], 'output' => [ 'shape' => 'UpdateEntitlementResult', ], 'errors' => [ [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'EntitlementNotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], ], 'UpdateFleet' => [ 'name' => 'UpdateFleet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateFleetRequest', ], 'output' => [ 'shape' => 'UpdateFleetResult', ], 'errors' => [ [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'RequestLimitExceededException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'InvalidRoleException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ResourceNotAvailableException', ], [ 'shape' => 'InvalidParameterCombinationException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'IncompatibleImageException', ], [ 'shape' => 'OperationNotPermittedException', ], ], ], 'UpdateImagePermissions' => [ 'name' => 'UpdateImagePermissions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateImagePermissionsRequest', ], 'output' => [ 'shape' => 'UpdateImagePermissionsResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ResourceNotAvailableException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'UpdateStack' => [ 'name' => 'UpdateStack', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateStackRequest', ], 'output' => [ 'shape' => 'UpdateStackResult', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ResourceInUseException', ], [ 'shape' => 'InvalidRoleException', ], [ 'shape' => 'InvalidParameterCombinationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidAccountStatusException', ], [ 'shape' => 'IncompatibleImageException', ], [ 'shape' => 'OperationNotPermittedException', ], [ 'shape' => 'ConcurrentModificationException', ], ], ], ], 'shapes' => [ 'AccessEndpoint' => [ 'type' => 'structure', 'required' => [ 'EndpointType', ], 'members' => [ 'EndpointType' => [ 'shape' => 'AccessEndpointType', ], 'VpceId' => [ 'shape' => 'String', ], ], ], 'AccessEndpointList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AccessEndpoint', ], 'max' => 4, 'min' => 1, ], 'AccessEndpointType' => [ 'type' => 'string', 'enum' => [ 'STREAMING', ], ], 'AccountName' => [ 'type' => 'string', 'min' => 1, 'sensitive' => true, ], 'AccountPassword' => [ 'type' => 'string', 'max' => 127, 'min' => 1, 'sensitive' => true, ], 'Action' => [ 'type' => 'string', 'enum' => [ 'CLIPBOARD_COPY_FROM_LOCAL_DEVICE', 'CLIPBOARD_COPY_TO_LOCAL_DEVICE', 'FILE_UPLOAD', 'FILE_DOWNLOAD', 'PRINTING_TO_LOCAL_DEVICE', 'DOMAIN_PASSWORD_SIGNIN', 'DOMAIN_SMART_CARD_SIGNIN', ], ], 'AppBlock' => [ 'type' => 'structure', 'required' => [ 'Name', 'Arn', ], 'members' => [ 'Name' => [ 'shape' => 'String', ], 'Arn' => [ 'shape' => 'Arn', ], 'Description' => [ 'shape' => 'String', ], 'DisplayName' => [ 'shape' => 'String', ], 'SourceS3Location' => [ 'shape' => 'S3Location', ], 'SetupScriptDetails' => [ 'shape' => 'ScriptDetails', ], 'CreatedTime' => [ 'shape' => 'Timestamp', ], 'PostSetupScriptDetails' => [ 'shape' => 'ScriptDetails', ], 'PackagingType' => [ 'shape' => 'PackagingType', ], 'State' => [ 'shape' => 'AppBlockState', ], 'AppBlockErrors' => [ 'shape' => 'ErrorDetailsList', ], ], ], 'AppBlockBuilder' => [ 'type' => 'structure', 'required' => [ 'Arn', 'Name', 'Platform', 'InstanceType', 'VpcConfig', 'State', ], 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'String', ], 'DisplayName' => [ 'shape' => 'String', ], 'Description' => [ 'shape' => 'String', ], 'Platform' => [ 'shape' => 'AppBlockBuilderPlatformType', ], 'InstanceType' => [ 'shape' => 'String', ], 'EnableDefaultInternetAccess' => [ 'shape' => 'BooleanObject', ], 'IamRoleArn' => [ 'shape' => 'Arn', ], 'VpcConfig' => [ 'shape' => 'VpcConfig', ], 'State' => [ 'shape' => 'AppBlockBuilderState', ], 'CreatedTime' => [ 'shape' => 'Timestamp', ], 'AppBlockBuilderErrors' => [ 'shape' => 'ResourceErrors', ], 'StateChangeReason' => [ 'shape' => 'AppBlockBuilderStateChangeReason', ], 'AccessEndpoints' => [ 'shape' => 'AccessEndpointList', ], ], ], 'AppBlockBuilderAppBlockAssociation' => [ 'type' => 'structure', 'required' => [ 'AppBlockArn', 'AppBlockBuilderName', ], 'members' => [ 'AppBlockArn' => [ 'shape' => 'Arn', ], 'AppBlockBuilderName' => [ 'shape' => 'Name', ], ], ], 'AppBlockBuilderAppBlockAssociationsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AppBlockBuilderAppBlockAssociation', ], 'max' => 25, 'min' => 1, ], 'AppBlockBuilderAttribute' => [ 'type' => 'string', 'enum' => [ 'IAM_ROLE_ARN', 'ACCESS_ENDPOINTS', 'VPC_CONFIGURATION_SECURITY_GROUP_IDS', ], ], 'AppBlockBuilderAttributes' => [ 'type' => 'list', 'member' => [ 'shape' => 'AppBlockBuilderAttribute', ], ], 'AppBlockBuilderList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AppBlockBuilder', ], ], 'AppBlockBuilderPlatformType' => [ 'type' => 'string', 'enum' => [ 'WINDOWS_SERVER_2019', ], ], 'AppBlockBuilderState' => [ 'type' => 'string', 'enum' => [ 'STARTING', 'RUNNING', 'STOPPING', 'STOPPED', ], ], 'AppBlockBuilderStateChangeReason' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'AppBlockBuilderStateChangeReasonCode', ], 'Message' => [ 'shape' => 'String', ], ], ], 'AppBlockBuilderStateChangeReasonCode' => [ 'type' => 'string', 'enum' => [ 'INTERNAL_ERROR', ], ], 'AppBlockState' => [ 'type' => 'string', 'enum' => [ 'INACTIVE', 'ACTIVE', ], ], 'AppBlocks' => [ 'type' => 'list', 'member' => [ 'shape' => 'AppBlock', ], ], 'AppVisibility' => [ 'type' => 'string', 'enum' => [ 'ALL', 'ASSOCIATED', ], ], 'Application' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'String', ], 'DisplayName' => [ 'shape' => 'String', ], 'IconURL' => [ 'shape' => 'String', ], 'LaunchPath' => [ 'shape' => 'String', ], 'LaunchParameters' => [ 'shape' => 'String', ], 'Enabled' => [ 'shape' => 'Boolean', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'WorkingDirectory' => [ 'shape' => 'String', ], 'Description' => [ 'shape' => 'String', ], 'Arn' => [ 'shape' => 'Arn', ], 'AppBlockArn' => [ 'shape' => 'Arn', ], 'IconS3Location' => [ 'shape' => 'S3Location', ], 'Platforms' => [ 'shape' => 'Platforms', ], 'InstanceFamilies' => [ 'shape' => 'StringList', ], 'CreatedTime' => [ 'shape' => 'Timestamp', ], ], ], 'ApplicationAttribute' => [ 'type' => 'string', 'enum' => [ 'LAUNCH_PARAMETERS', 'WORKING_DIRECTORY', ], ], 'ApplicationAttributes' => [ 'type' => 'list', 'member' => [ 'shape' => 'ApplicationAttribute', ], 'max' => 2, ], 'ApplicationFleetAssociation' => [ 'type' => 'structure', 'required' => [ 'FleetName', 'ApplicationArn', ], 'members' => [ 'FleetName' => [ 'shape' => 'String', ], 'ApplicationArn' => [ 'shape' => 'Arn', ], ], ], 'ApplicationFleetAssociationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ApplicationFleetAssociation', ], 'max' => 25, 'min' => 1, ], 'ApplicationSettings' => [ 'type' => 'structure', 'required' => [ 'Enabled', ], 'members' => [ 'Enabled' => [ 'shape' => 'Boolean', ], 'SettingsGroup' => [ 'shape' => 'SettingsGroup', ], ], ], 'ApplicationSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'Enabled' => [ 'shape' => 'Boolean', ], 'SettingsGroup' => [ 'shape' => 'SettingsGroup', ], 'S3BucketName' => [ 'shape' => 'String', ], ], ], 'Applications' => [ 'type' => 'list', 'member' => [ 'shape' => 'Application', ], ], 'AppstreamAgentVersion' => [ 'type' => 'string', 'max' => 100, 'min' => 1, ], 'Arn' => [ 'type' => 'string', 'pattern' => '^arn:aws(?:\\\\-cn|\\\\-iso\\\\-b|\\\\-iso|\\\\-us\\\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\\\\\-]{0,1023}$', ], 'ArnList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Arn', ], ], 'AssociateAppBlockBuilderAppBlockRequest' => [ 'type' => 'structure', 'required' => [ 'AppBlockArn', 'AppBlockBuilderName', ], 'members' => [ 'AppBlockArn' => [ 'shape' => 'Arn', ], 'AppBlockBuilderName' => [ 'shape' => 'Name', ], ], ], 'AssociateAppBlockBuilderAppBlockResult' => [ 'type' => 'structure', 'members' => [ 'AppBlockBuilderAppBlockAssociation' => [ 'shape' => 'AppBlockBuilderAppBlockAssociation', ], ], ], 'AssociateApplicationFleetRequest' => [ 'type' => 'structure', 'required' => [ 'FleetName', 'ApplicationArn', ], 'members' => [ 'FleetName' => [ 'shape' => 'Name', ], 'ApplicationArn' => [ 'shape' => 'Arn', ], ], ], 'AssociateApplicationFleetResult' => [ 'type' => 'structure', 'members' => [ 'ApplicationFleetAssociation' => [ 'shape' => 'ApplicationFleetAssociation', ], ], ], 'AssociateApplicationToEntitlementRequest' => [ 'type' => 'structure', 'required' => [ 'StackName', 'EntitlementName', 'ApplicationIdentifier', ], 'members' => [ 'StackName' => [ 'shape' => 'Name', ], 'EntitlementName' => [ 'shape' => 'Name', ], 'ApplicationIdentifier' => [ 'shape' => 'String', ], ], ], 'AssociateApplicationToEntitlementResult' => [ 'type' => 'structure', 'members' => [], ], 'AssociateFleetRequest' => [ 'type' => 'structure', 'required' => [ 'FleetName', 'StackName', ], 'members' => [ 'FleetName' => [ 'shape' => 'String', ], 'StackName' => [ 'shape' => 'String', ], ], ], 'AssociateFleetResult' => [ 'type' => 'structure', 'members' => [], ], 'AuthenticationType' => [ 'type' => 'string', 'enum' => [ 'API', 'SAML', 'USERPOOL', 'AWS_AD', ], ], 'AwsAccountId' => [ 'type' => 'string', 'pattern' => '^\\\\d+$', ], 'AwsAccountIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AwsAccountId', ], 'max' => 5, 'min' => 1, ], 'BatchAssociateUserStackRequest' => [ 'type' => 'structure', 'required' => [ 'UserStackAssociations', ], 'members' => [ 'UserStackAssociations' => [ 'shape' => 'UserStackAssociationList', ], ], ], 'BatchAssociateUserStackResult' => [ 'type' => 'structure', 'members' => [ 'errors' => [ 'shape' => 'UserStackAssociationErrorList', ], ], ], 'BatchDisassociateUserStackRequest' => [ 'type' => 'structure', 'required' => [ 'UserStackAssociations', ], 'members' => [ 'UserStackAssociations' => [ 'shape' => 'UserStackAssociationList', ], ], ], 'BatchDisassociateUserStackResult' => [ 'type' => 'structure', 'members' => [ 'errors' => [ 'shape' => 'UserStackAssociationErrorList', ], ], ], 'Boolean' => [ 'type' => 'boolean', ], 'BooleanObject' => [ 'type' => 'boolean', ], 'CertificateBasedAuthProperties' => [ 'type' => 'structure', 'members' => [ 'Status' => [ 'shape' => 'CertificateBasedAuthStatus', ], 'CertificateAuthorityArn' => [ 'shape' => 'Arn', ], ], ], 'CertificateBasedAuthStatus' => [ 'type' => 'string', 'enum' => [ 'DISABLED', 'ENABLED', 'ENABLED_NO_DIRECTORY_LOGIN_FALLBACK', ], ], 'ComputeCapacity' => [ 'type' => 'structure', 'required' => [ 'DesiredInstances', ], 'members' => [ 'DesiredInstances' => [ 'shape' => 'Integer', ], ], ], 'ComputeCapacityStatus' => [ 'type' => 'structure', 'required' => [ 'Desired', ], 'members' => [ 'Desired' => [ 'shape' => 'Integer', ], 'Running' => [ 'shape' => 'Integer', ], 'InUse' => [ 'shape' => 'Integer', ], 'Available' => [ 'shape' => 'Integer', ], ], ], 'ConcurrentModificationException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'CopyImageRequest' => [ 'type' => 'structure', 'required' => [ 'SourceImageName', 'DestinationImageName', 'DestinationRegion', ], 'members' => [ 'SourceImageName' => [ 'shape' => 'Name', ], 'DestinationImageName' => [ 'shape' => 'Name', ], 'DestinationRegion' => [ 'shape' => 'RegionName', ], 'DestinationImageDescription' => [ 'shape' => 'Description', ], ], ], 'CopyImageResponse' => [ 'type' => 'structure', 'members' => [ 'DestinationImageName' => [ 'shape' => 'Name', ], ], ], 'CreateAppBlockBuilderRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'Platform', 'InstanceType', 'VpcConfig', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'DisplayName' => [ 'shape' => 'DisplayName', ], 'Tags' => [ 'shape' => 'Tags', ], 'Platform' => [ 'shape' => 'AppBlockBuilderPlatformType', ], 'InstanceType' => [ 'shape' => 'String', ], 'VpcConfig' => [ 'shape' => 'VpcConfig', ], 'EnableDefaultInternetAccess' => [ 'shape' => 'BooleanObject', ], 'IamRoleArn' => [ 'shape' => 'Arn', ], 'AccessEndpoints' => [ 'shape' => 'AccessEndpointList', ], ], ], 'CreateAppBlockBuilderResult' => [ 'type' => 'structure', 'members' => [ 'AppBlockBuilder' => [ 'shape' => 'AppBlockBuilder', ], ], ], 'CreateAppBlockBuilderStreamingURLRequest' => [ 'type' => 'structure', 'required' => [ 'AppBlockBuilderName', ], 'members' => [ 'AppBlockBuilderName' => [ 'shape' => 'Name', ], 'Validity' => [ 'shape' => 'Long', ], ], ], 'CreateAppBlockBuilderStreamingURLResult' => [ 'type' => 'structure', 'members' => [ 'StreamingURL' => [ 'shape' => 'String', ], 'Expires' => [ 'shape' => 'Timestamp', ], ], ], 'CreateAppBlockRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'SourceS3Location', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'DisplayName' => [ 'shape' => 'DisplayName', ], 'SourceS3Location' => [ 'shape' => 'S3Location', ], 'SetupScriptDetails' => [ 'shape' => 'ScriptDetails', ], 'Tags' => [ 'shape' => 'Tags', ], 'PostSetupScriptDetails' => [ 'shape' => 'ScriptDetails', ], 'PackagingType' => [ 'shape' => 'PackagingType', ], ], ], 'CreateAppBlockResult' => [ 'type' => 'structure', 'members' => [ 'AppBlock' => [ 'shape' => 'AppBlock', ], ], ], 'CreateApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'IconS3Location', 'LaunchPath', 'Platforms', 'InstanceFamilies', 'AppBlockArn', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'DisplayName' => [ 'shape' => 'DisplayName', ], 'Description' => [ 'shape' => 'Description', ], 'IconS3Location' => [ 'shape' => 'S3Location', ], 'LaunchPath' => [ 'shape' => 'String', ], 'WorkingDirectory' => [ 'shape' => 'String', ], 'LaunchParameters' => [ 'shape' => 'String', ], 'Platforms' => [ 'shape' => 'Platforms', ], 'InstanceFamilies' => [ 'shape' => 'StringList', ], 'AppBlockArn' => [ 'shape' => 'Arn', ], 'Tags' => [ 'shape' => 'Tags', ], ], ], 'CreateApplicationResult' => [ 'type' => 'structure', 'members' => [ 'Application' => [ 'shape' => 'Application', ], ], ], 'CreateDirectoryConfigRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryName', 'OrganizationalUnitDistinguishedNames', ], 'members' => [ 'DirectoryName' => [ 'shape' => 'DirectoryName', ], 'OrganizationalUnitDistinguishedNames' => [ 'shape' => 'OrganizationalUnitDistinguishedNamesList', ], 'ServiceAccountCredentials' => [ 'shape' => 'ServiceAccountCredentials', ], 'CertificateBasedAuthProperties' => [ 'shape' => 'CertificateBasedAuthProperties', ], ], ], 'CreateDirectoryConfigResult' => [ 'type' => 'structure', 'members' => [ 'DirectoryConfig' => [ 'shape' => 'DirectoryConfig', ], ], ], 'CreateEntitlementRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'StackName', 'AppVisibility', 'Attributes', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'StackName' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'AppVisibility' => [ 'shape' => 'AppVisibility', ], 'Attributes' => [ 'shape' => 'EntitlementAttributeList', ], ], ], 'CreateEntitlementResult' => [ 'type' => 'structure', 'members' => [ 'Entitlement' => [ 'shape' => 'Entitlement', ], ], ], 'CreateFleetRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'InstanceType', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'ImageName' => [ 'shape' => 'Name', ], 'ImageArn' => [ 'shape' => 'Arn', ], 'InstanceType' => [ 'shape' => 'String', ], 'FleetType' => [ 'shape' => 'FleetType', ], 'ComputeCapacity' => [ 'shape' => 'ComputeCapacity', ], 'VpcConfig' => [ 'shape' => 'VpcConfig', ], 'MaxUserDurationInSeconds' => [ 'shape' => 'Integer', ], 'DisconnectTimeoutInSeconds' => [ 'shape' => 'Integer', ], 'Description' => [ 'shape' => 'Description', ], 'DisplayName' => [ 'shape' => 'DisplayName', ], 'EnableDefaultInternetAccess' => [ 'shape' => 'BooleanObject', ], 'DomainJoinInfo' => [ 'shape' => 'DomainJoinInfo', ], 'Tags' => [ 'shape' => 'Tags', ], 'IdleDisconnectTimeoutInSeconds' => [ 'shape' => 'Integer', ], 'IamRoleArn' => [ 'shape' => 'Arn', ], 'StreamView' => [ 'shape' => 'StreamView', ], 'Platform' => [ 'shape' => 'PlatformType', ], 'MaxConcurrentSessions' => [ 'shape' => 'Integer', ], 'UsbDeviceFilterStrings' => [ 'shape' => 'UsbDeviceFilterStrings', ], 'SessionScriptS3Location' => [ 'shape' => 'S3Location', ], ], ], 'CreateFleetResult' => [ 'type' => 'structure', 'members' => [ 'Fleet' => [ 'shape' => 'Fleet', ], ], ], 'CreateImageBuilderRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'InstanceType', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'ImageName' => [ 'shape' => 'String', ], 'ImageArn' => [ 'shape' => 'Arn', ], 'InstanceType' => [ 'shape' => 'String', ], 'Description' => [ 'shape' => 'Description', ], 'DisplayName' => [ 'shape' => 'DisplayName', ], 'VpcConfig' => [ 'shape' => 'VpcConfig', ], 'IamRoleArn' => [ 'shape' => 'Arn', ], 'EnableDefaultInternetAccess' => [ 'shape' => 'BooleanObject', ], 'DomainJoinInfo' => [ 'shape' => 'DomainJoinInfo', ], 'AppstreamAgentVersion' => [ 'shape' => 'AppstreamAgentVersion', ], 'Tags' => [ 'shape' => 'Tags', ], 'AccessEndpoints' => [ 'shape' => 'AccessEndpointList', ], ], ], 'CreateImageBuilderResult' => [ 'type' => 'structure', 'members' => [ 'ImageBuilder' => [ 'shape' => 'ImageBuilder', ], ], ], 'CreateImageBuilderStreamingURLRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'String', ], 'Validity' => [ 'shape' => 'Long', ], ], ], 'CreateImageBuilderStreamingURLResult' => [ 'type' => 'structure', 'members' => [ 'StreamingURL' => [ 'shape' => 'String', ], 'Expires' => [ 'shape' => 'Timestamp', ], ], ], 'CreateStackRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'DisplayName' => [ 'shape' => 'DisplayName', ], 'StorageConnectors' => [ 'shape' => 'StorageConnectorList', ], 'RedirectURL' => [ 'shape' => 'RedirectURL', ], 'FeedbackURL' => [ 'shape' => 'FeedbackURL', ], 'UserSettings' => [ 'shape' => 'UserSettingList', ], 'ApplicationSettings' => [ 'shape' => 'ApplicationSettings', ], 'Tags' => [ 'shape' => 'Tags', ], 'AccessEndpoints' => [ 'shape' => 'AccessEndpointList', ], 'EmbedHostDomains' => [ 'shape' => 'EmbedHostDomains', ], 'StreamingExperienceSettings' => [ 'shape' => 'StreamingExperienceSettings', ], ], ], 'CreateStackResult' => [ 'type' => 'structure', 'members' => [ 'Stack' => [ 'shape' => 'Stack', ], ], ], 'CreateStreamingURLRequest' => [ 'type' => 'structure', 'required' => [ 'StackName', 'FleetName', 'UserId', ], 'members' => [ 'StackName' => [ 'shape' => 'String', ], 'FleetName' => [ 'shape' => 'String', ], 'UserId' => [ 'shape' => 'StreamingUrlUserId', ], 'ApplicationId' => [ 'shape' => 'String', ], 'Validity' => [ 'shape' => 'Long', ], 'SessionContext' => [ 'shape' => 'String', ], ], ], 'CreateStreamingURLResult' => [ 'type' => 'structure', 'members' => [ 'StreamingURL' => [ 'shape' => 'String', ], 'Expires' => [ 'shape' => 'Timestamp', ], ], ], 'CreateUpdatedImageRequest' => [ 'type' => 'structure', 'required' => [ 'existingImageName', 'newImageName', ], 'members' => [ 'existingImageName' => [ 'shape' => 'Name', ], 'newImageName' => [ 'shape' => 'Name', ], 'newImageDescription' => [ 'shape' => 'Description', ], 'newImageDisplayName' => [ 'shape' => 'DisplayName', ], 'newImageTags' => [ 'shape' => 'Tags', ], 'dryRun' => [ 'shape' => 'Boolean', ], ], ], 'CreateUpdatedImageResult' => [ 'type' => 'structure', 'members' => [ 'image' => [ 'shape' => 'Image', ], 'canUpdateImage' => [ 'shape' => 'Boolean', ], ], ], 'CreateUsageReportSubscriptionRequest' => [ 'type' => 'structure', 'members' => [], ], 'CreateUsageReportSubscriptionResult' => [ 'type' => 'structure', 'members' => [ 'S3BucketName' => [ 'shape' => 'String', ], 'Schedule' => [ 'shape' => 'UsageReportSchedule', ], ], ], 'CreateUserRequest' => [ 'type' => 'structure', 'required' => [ 'UserName', 'AuthenticationType', ], 'members' => [ 'UserName' => [ 'shape' => 'Username', ], 'MessageAction' => [ 'shape' => 'MessageAction', ], 'FirstName' => [ 'shape' => 'UserAttributeValue', ], 'LastName' => [ 'shape' => 'UserAttributeValue', ], 'AuthenticationType' => [ 'shape' => 'AuthenticationType', ], ], ], 'CreateUserResult' => [ 'type' => 'structure', 'members' => [], ], 'DeleteAppBlockBuilderRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], ], ], 'DeleteAppBlockBuilderResult' => [ 'type' => 'structure', 'members' => [], ], 'DeleteAppBlockRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], ], ], 'DeleteAppBlockResult' => [ 'type' => 'structure', 'members' => [], ], 'DeleteApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], ], ], 'DeleteApplicationResult' => [ 'type' => 'structure', 'members' => [], ], 'DeleteDirectoryConfigRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryName', ], 'members' => [ 'DirectoryName' => [ 'shape' => 'DirectoryName', ], ], ], 'DeleteDirectoryConfigResult' => [ 'type' => 'structure', 'members' => [], ], 'DeleteEntitlementRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'StackName', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'StackName' => [ 'shape' => 'Name', ], ], ], 'DeleteEntitlementResult' => [ 'type' => 'structure', 'members' => [], ], 'DeleteFleetRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'String', ], ], ], 'DeleteFleetResult' => [ 'type' => 'structure', 'members' => [], ], 'DeleteImageBuilderRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], ], ], 'DeleteImageBuilderResult' => [ 'type' => 'structure', 'members' => [ 'ImageBuilder' => [ 'shape' => 'ImageBuilder', ], ], ], 'DeleteImagePermissionsRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'SharedAccountId', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'SharedAccountId' => [ 'shape' => 'AwsAccountId', ], ], ], 'DeleteImagePermissionsResult' => [ 'type' => 'structure', 'members' => [], ], 'DeleteImageRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], ], ], 'DeleteImageResult' => [ 'type' => 'structure', 'members' => [ 'Image' => [ 'shape' => 'Image', ], ], ], 'DeleteStackRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'String', ], ], ], 'DeleteStackResult' => [ 'type' => 'structure', 'members' => [], ], 'DeleteUsageReportSubscriptionRequest' => [ 'type' => 'structure', 'members' => [], ], 'DeleteUsageReportSubscriptionResult' => [ 'type' => 'structure', 'members' => [], ], 'DeleteUserRequest' => [ 'type' => 'structure', 'required' => [ 'UserName', 'AuthenticationType', ], 'members' => [ 'UserName' => [ 'shape' => 'Username', ], 'AuthenticationType' => [ 'shape' => 'AuthenticationType', ], ], ], 'DeleteUserResult' => [ 'type' => 'structure', 'members' => [], ], 'DescribeAppBlockBuilderAppBlockAssociationsRequest' => [ 'type' => 'structure', 'members' => [ 'AppBlockArn' => [ 'shape' => 'Arn', ], 'AppBlockBuilderName' => [ 'shape' => 'Name', ], 'MaxResults' => [ 'shape' => 'Integer', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeAppBlockBuilderAppBlockAssociationsResult' => [ 'type' => 'structure', 'members' => [ 'AppBlockBuilderAppBlockAssociations' => [ 'shape' => 'AppBlockBuilderAppBlockAssociationsList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeAppBlockBuildersRequest' => [ 'type' => 'structure', 'members' => [ 'Names' => [ 'shape' => 'StringList', ], 'NextToken' => [ 'shape' => 'String', ], 'MaxResults' => [ 'shape' => 'Integer', ], ], ], 'DescribeAppBlockBuildersResult' => [ 'type' => 'structure', 'members' => [ 'AppBlockBuilders' => [ 'shape' => 'AppBlockBuilderList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeAppBlocksRequest' => [ 'type' => 'structure', 'members' => [ 'Arns' => [ 'shape' => 'ArnList', ], 'NextToken' => [ 'shape' => 'String', ], 'MaxResults' => [ 'shape' => 'Integer', ], ], ], 'DescribeAppBlocksResult' => [ 'type' => 'structure', 'members' => [ 'AppBlocks' => [ 'shape' => 'AppBlocks', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeApplicationFleetAssociationsRequest' => [ 'type' => 'structure', 'members' => [ 'FleetName' => [ 'shape' => 'Name', ], 'ApplicationArn' => [ 'shape' => 'Arn', ], 'MaxResults' => [ 'shape' => 'Integer', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeApplicationFleetAssociationsResult' => [ 'type' => 'structure', 'members' => [ 'ApplicationFleetAssociations' => [ 'shape' => 'ApplicationFleetAssociationList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeApplicationsRequest' => [ 'type' => 'structure', 'members' => [ 'Arns' => [ 'shape' => 'ArnList', ], 'NextToken' => [ 'shape' => 'String', ], 'MaxResults' => [ 'shape' => 'Integer', ], ], ], 'DescribeApplicationsResult' => [ 'type' => 'structure', 'members' => [ 'Applications' => [ 'shape' => 'Applications', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeDirectoryConfigsRequest' => [ 'type' => 'structure', 'members' => [ 'DirectoryNames' => [ 'shape' => 'DirectoryNameList', ], 'MaxResults' => [ 'shape' => 'Integer', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeDirectoryConfigsResult' => [ 'type' => 'structure', 'members' => [ 'DirectoryConfigs' => [ 'shape' => 'DirectoryConfigList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeEntitlementsRequest' => [ 'type' => 'structure', 'required' => [ 'StackName', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'StackName' => [ 'shape' => 'Name', ], 'NextToken' => [ 'shape' => 'String', ], 'MaxResults' => [ 'shape' => 'Integer', ], ], ], 'DescribeEntitlementsResult' => [ 'type' => 'structure', 'members' => [ 'Entitlements' => [ 'shape' => 'EntitlementList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeFleetsRequest' => [ 'type' => 'structure', 'members' => [ 'Names' => [ 'shape' => 'StringList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeFleetsResult' => [ 'type' => 'structure', 'members' => [ 'Fleets' => [ 'shape' => 'FleetList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeImageBuildersRequest' => [ 'type' => 'structure', 'members' => [ 'Names' => [ 'shape' => 'StringList', ], 'MaxResults' => [ 'shape' => 'Integer', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeImageBuildersResult' => [ 'type' => 'structure', 'members' => [ 'ImageBuilders' => [ 'shape' => 'ImageBuilderList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeImagePermissionsRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'SharedAwsAccountIds' => [ 'shape' => 'AwsAccountIdList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeImagePermissionsResult' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'SharedImagePermissionsList' => [ 'shape' => 'SharedImagePermissionsList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeImagesMaxResults' => [ 'type' => 'integer', 'box' => true, 'max' => 25, 'min' => 0, ], 'DescribeImagesRequest' => [ 'type' => 'structure', 'members' => [ 'Names' => [ 'shape' => 'StringList', ], 'Arns' => [ 'shape' => 'ArnList', ], 'Type' => [ 'shape' => 'VisibilityType', ], 'NextToken' => [ 'shape' => 'String', ], 'MaxResults' => [ 'shape' => 'DescribeImagesMaxResults', ], ], ], 'DescribeImagesResult' => [ 'type' => 'structure', 'members' => [ 'Images' => [ 'shape' => 'ImageList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeSessionsRequest' => [ 'type' => 'structure', 'required' => [ 'StackName', 'FleetName', ], 'members' => [ 'StackName' => [ 'shape' => 'String', ], 'FleetName' => [ 'shape' => 'String', ], 'UserId' => [ 'shape' => 'UserId', ], 'NextToken' => [ 'shape' => 'String', ], 'Limit' => [ 'shape' => 'Integer', ], 'AuthenticationType' => [ 'shape' => 'AuthenticationType', ], ], ], 'DescribeSessionsResult' => [ 'type' => 'structure', 'members' => [ 'Sessions' => [ 'shape' => 'SessionList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeStacksRequest' => [ 'type' => 'structure', 'members' => [ 'Names' => [ 'shape' => 'StringList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeStacksResult' => [ 'type' => 'structure', 'members' => [ 'Stacks' => [ 'shape' => 'StackList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeUsageReportSubscriptionsRequest' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => 'Integer', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeUsageReportSubscriptionsResult' => [ 'type' => 'structure', 'members' => [ 'UsageReportSubscriptions' => [ 'shape' => 'UsageReportSubscriptionList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeUserStackAssociationsRequest' => [ 'type' => 'structure', 'members' => [ 'StackName' => [ 'shape' => 'String', ], 'UserName' => [ 'shape' => 'Username', ], 'AuthenticationType' => [ 'shape' => 'AuthenticationType', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeUserStackAssociationsResult' => [ 'type' => 'structure', 'members' => [ 'UserStackAssociations' => [ 'shape' => 'UserStackAssociationList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeUsersRequest' => [ 'type' => 'structure', 'required' => [ 'AuthenticationType', ], 'members' => [ 'AuthenticationType' => [ 'shape' => 'AuthenticationType', ], 'MaxResults' => [ 'shape' => 'Integer', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'DescribeUsersResult' => [ 'type' => 'structure', 'members' => [ 'Users' => [ 'shape' => 'UserList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'Description' => [ 'type' => 'string', 'max' => 256, ], 'DirectoryConfig' => [ 'type' => 'structure', 'required' => [ 'DirectoryName', ], 'members' => [ 'DirectoryName' => [ 'shape' => 'DirectoryName', ], 'OrganizationalUnitDistinguishedNames' => [ 'shape' => 'OrganizationalUnitDistinguishedNamesList', ], 'ServiceAccountCredentials' => [ 'shape' => 'ServiceAccountCredentials', ], 'CreatedTime' => [ 'shape' => 'Timestamp', ], 'CertificateBasedAuthProperties' => [ 'shape' => 'CertificateBasedAuthProperties', ], ], ], 'DirectoryConfigList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DirectoryConfig', ], ], 'DirectoryName' => [ 'type' => 'string', ], 'DirectoryNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DirectoryName', ], ], 'DisableUserRequest' => [ 'type' => 'structure', 'required' => [ 'UserName', 'AuthenticationType', ], 'members' => [ 'UserName' => [ 'shape' => 'Username', ], 'AuthenticationType' => [ 'shape' => 'AuthenticationType', ], ], ], 'DisableUserResult' => [ 'type' => 'structure', 'members' => [], ], 'DisassociateAppBlockBuilderAppBlockRequest' => [ 'type' => 'structure', 'required' => [ 'AppBlockArn', 'AppBlockBuilderName', ], 'members' => [ 'AppBlockArn' => [ 'shape' => 'Arn', ], 'AppBlockBuilderName' => [ 'shape' => 'Name', ], ], ], 'DisassociateAppBlockBuilderAppBlockResult' => [ 'type' => 'structure', 'members' => [], ], 'DisassociateApplicationFleetRequest' => [ 'type' => 'structure', 'required' => [ 'FleetName', 'ApplicationArn', ], 'members' => [ 'FleetName' => [ 'shape' => 'Name', ], 'ApplicationArn' => [ 'shape' => 'Arn', ], ], ], 'DisassociateApplicationFleetResult' => [ 'type' => 'structure', 'members' => [], ], 'DisassociateApplicationFromEntitlementRequest' => [ 'type' => 'structure', 'required' => [ 'StackName', 'EntitlementName', 'ApplicationIdentifier', ], 'members' => [ 'StackName' => [ 'shape' => 'Name', ], 'EntitlementName' => [ 'shape' => 'Name', ], 'ApplicationIdentifier' => [ 'shape' => 'String', ], ], ], 'DisassociateApplicationFromEntitlementResult' => [ 'type' => 'structure', 'members' => [], ], 'DisassociateFleetRequest' => [ 'type' => 'structure', 'required' => [ 'FleetName', 'StackName', ], 'members' => [ 'FleetName' => [ 'shape' => 'String', ], 'StackName' => [ 'shape' => 'String', ], ], ], 'DisassociateFleetResult' => [ 'type' => 'structure', 'members' => [], ], 'DisplayName' => [ 'type' => 'string', 'max' => 100, ], 'Domain' => [ 'type' => 'string', 'max' => 64, 'min' => 1, ], 'DomainJoinInfo' => [ 'type' => 'structure', 'members' => [ 'DirectoryName' => [ 'shape' => 'DirectoryName', ], 'OrganizationalUnitDistinguishedName' => [ 'shape' => 'OrganizationalUnitDistinguishedName', ], ], ], 'DomainList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Domain', ], 'max' => 50, ], 'EmbedHostDomain' => [ 'type' => 'string', 'max' => 128, 'pattern' => '(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]', ], 'EmbedHostDomains' => [ 'type' => 'list', 'member' => [ 'shape' => 'EmbedHostDomain', ], 'max' => 20, 'min' => 1, ], 'EnableUserRequest' => [ 'type' => 'structure', 'required' => [ 'UserName', 'AuthenticationType', ], 'members' => [ 'UserName' => [ 'shape' => 'Username', ], 'AuthenticationType' => [ 'shape' => 'AuthenticationType', ], ], ], 'EnableUserResult' => [ 'type' => 'structure', 'members' => [], ], 'EntitledApplication' => [ 'type' => 'structure', 'required' => [ 'ApplicationIdentifier', ], 'members' => [ 'ApplicationIdentifier' => [ 'shape' => 'String', ], ], ], 'EntitledApplicationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'EntitledApplication', ], ], 'Entitlement' => [ 'type' => 'structure', 'required' => [ 'Name', 'StackName', 'AppVisibility', 'Attributes', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'StackName' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'AppVisibility' => [ 'shape' => 'AppVisibility', ], 'Attributes' => [ 'shape' => 'EntitlementAttributeList', ], 'CreatedTime' => [ 'shape' => 'Timestamp', ], 'LastModifiedTime' => [ 'shape' => 'Timestamp', ], ], ], 'EntitlementAlreadyExistsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'EntitlementAttribute' => [ 'type' => 'structure', 'required' => [ 'Name', 'Value', ], 'members' => [ 'Name' => [ 'shape' => 'String', ], 'Value' => [ 'shape' => 'String', ], ], ], 'EntitlementAttributeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'EntitlementAttribute', ], 'min' => 1, ], 'EntitlementList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Entitlement', ], ], 'EntitlementNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ErrorDetails' => [ 'type' => 'structure', 'members' => [ 'ErrorCode' => [ 'shape' => 'String', ], 'ErrorMessage' => [ 'shape' => 'String', ], ], ], 'ErrorDetailsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ErrorDetails', ], ], 'ErrorMessage' => [ 'type' => 'string', ], 'ExpireSessionRequest' => [ 'type' => 'structure', 'required' => [ 'SessionId', ], 'members' => [ 'SessionId' => [ 'shape' => 'String', ], ], ], 'ExpireSessionResult' => [ 'type' => 'structure', 'members' => [], ], 'FeedbackURL' => [ 'type' => 'string', 'max' => 1000, ], 'Fleet' => [ 'type' => 'structure', 'required' => [ 'Arn', 'Name', 'InstanceType', 'ComputeCapacityStatus', 'State', ], 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'String', ], 'DisplayName' => [ 'shape' => 'String', ], 'Description' => [ 'shape' => 'String', ], 'ImageName' => [ 'shape' => 'String', ], 'ImageArn' => [ 'shape' => 'Arn', ], 'InstanceType' => [ 'shape' => 'String', ], 'FleetType' => [ 'shape' => 'FleetType', ], 'ComputeCapacityStatus' => [ 'shape' => 'ComputeCapacityStatus', ], 'MaxUserDurationInSeconds' => [ 'shape' => 'Integer', ], 'DisconnectTimeoutInSeconds' => [ 'shape' => 'Integer', ], 'State' => [ 'shape' => 'FleetState', ], 'VpcConfig' => [ 'shape' => 'VpcConfig', ], 'CreatedTime' => [ 'shape' => 'Timestamp', ], 'FleetErrors' => [ 'shape' => 'FleetErrors', ], 'EnableDefaultInternetAccess' => [ 'shape' => 'BooleanObject', ], 'DomainJoinInfo' => [ 'shape' => 'DomainJoinInfo', ], 'IdleDisconnectTimeoutInSeconds' => [ 'shape' => 'Integer', ], 'IamRoleArn' => [ 'shape' => 'Arn', ], 'StreamView' => [ 'shape' => 'StreamView', ], 'Platform' => [ 'shape' => 'PlatformType', ], 'MaxConcurrentSessions' => [ 'shape' => 'Integer', ], 'UsbDeviceFilterStrings' => [ 'shape' => 'UsbDeviceFilterStrings', ], 'SessionScriptS3Location' => [ 'shape' => 'S3Location', ], ], ], 'FleetAttribute' => [ 'type' => 'string', 'enum' => [ 'VPC_CONFIGURATION', 'VPC_CONFIGURATION_SECURITY_GROUP_IDS', 'DOMAIN_JOIN_INFO', 'IAM_ROLE_ARN', 'USB_DEVICE_FILTER_STRINGS', 'SESSION_SCRIPT_S3_LOCATION', ], ], 'FleetAttributes' => [ 'type' => 'list', 'member' => [ 'shape' => 'FleetAttribute', ], ], 'FleetError' => [ 'type' => 'structure', 'members' => [ 'ErrorCode' => [ 'shape' => 'FleetErrorCode', ], 'ErrorMessage' => [ 'shape' => 'String', ], ], ], 'FleetErrorCode' => [ 'type' => 'string', 'enum' => [ 'IAM_SERVICE_ROLE_MISSING_ENI_DESCRIBE_ACTION', 'IAM_SERVICE_ROLE_MISSING_ENI_CREATE_ACTION', 'IAM_SERVICE_ROLE_MISSING_ENI_DELETE_ACTION', 'NETWORK_INTERFACE_LIMIT_EXCEEDED', 'INTERNAL_SERVICE_ERROR', 'IAM_SERVICE_ROLE_IS_MISSING', 'MACHINE_ROLE_IS_MISSING', 'STS_DISABLED_IN_REGION', 'SUBNET_HAS_INSUFFICIENT_IP_ADDRESSES', 'IAM_SERVICE_ROLE_MISSING_DESCRIBE_SUBNET_ACTION', 'SUBNET_NOT_FOUND', 'IMAGE_NOT_FOUND', 'INVALID_SUBNET_CONFIGURATION', 'SECURITY_GROUPS_NOT_FOUND', 'IGW_NOT_ATTACHED', 'IAM_SERVICE_ROLE_MISSING_DESCRIBE_SECURITY_GROUPS_ACTION', 'FLEET_STOPPED', 'FLEET_INSTANCE_PROVISIONING_FAILURE', 'DOMAIN_JOIN_ERROR_FILE_NOT_FOUND', 'DOMAIN_JOIN_ERROR_ACCESS_DENIED', 'DOMAIN_JOIN_ERROR_LOGON_FAILURE', 'DOMAIN_JOIN_ERROR_INVALID_PARAMETER', 'DOMAIN_JOIN_ERROR_MORE_DATA', 'DOMAIN_JOIN_ERROR_NO_SUCH_DOMAIN', 'DOMAIN_JOIN_ERROR_NOT_SUPPORTED', 'DOMAIN_JOIN_NERR_INVALID_WORKGROUP_NAME', 'DOMAIN_JOIN_NERR_WORKSTATION_NOT_STARTED', 'DOMAIN_JOIN_ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED', 'DOMAIN_JOIN_NERR_PASSWORD_EXPIRED', 'DOMAIN_JOIN_INTERNAL_SERVICE_ERROR', ], ], 'FleetErrors' => [ 'type' => 'list', 'member' => [ 'shape' => 'FleetError', ], ], 'FleetList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Fleet', ], ], 'FleetState' => [ 'type' => 'string', 'enum' => [ 'STARTING', 'RUNNING', 'STOPPING', 'STOPPED', ], ], 'FleetType' => [ 'type' => 'string', 'enum' => [ 'ALWAYS_ON', 'ON_DEMAND', 'ELASTIC', ], ], 'Image' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'String', ], 'Arn' => [ 'shape' => 'Arn', ], 'BaseImageArn' => [ 'shape' => 'Arn', ], 'DisplayName' => [ 'shape' => 'String', ], 'State' => [ 'shape' => 'ImageState', ], 'Visibility' => [ 'shape' => 'VisibilityType', ], 'ImageBuilderSupported' => [ 'shape' => 'Boolean', ], 'ImageBuilderName' => [ 'shape' => 'String', ], 'Platform' => [ 'shape' => 'PlatformType', ], 'Description' => [ 'shape' => 'String', ], 'StateChangeReason' => [ 'shape' => 'ImageStateChangeReason', ], 'Applications' => [ 'shape' => 'Applications', ], 'CreatedTime' => [ 'shape' => 'Timestamp', ], 'PublicBaseImageReleasedDate' => [ 'shape' => 'Timestamp', ], 'AppstreamAgentVersion' => [ 'shape' => 'AppstreamAgentVersion', ], 'ImagePermissions' => [ 'shape' => 'ImagePermissions', ], 'ImageErrors' => [ 'shape' => 'ResourceErrors', ], ], ], 'ImageBuilder' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'String', ], 'Arn' => [ 'shape' => 'Arn', ], 'ImageArn' => [ 'shape' => 'Arn', ], 'Description' => [ 'shape' => 'String', ], 'DisplayName' => [ 'shape' => 'String', ], 'VpcConfig' => [ 'shape' => 'VpcConfig', ], 'InstanceType' => [ 'shape' => 'String', ], 'Platform' => [ 'shape' => 'PlatformType', ], 'IamRoleArn' => [ 'shape' => 'Arn', ], 'State' => [ 'shape' => 'ImageBuilderState', ], 'StateChangeReason' => [ 'shape' => 'ImageBuilderStateChangeReason', ], 'CreatedTime' => [ 'shape' => 'Timestamp', ], 'EnableDefaultInternetAccess' => [ 'shape' => 'BooleanObject', ], 'DomainJoinInfo' => [ 'shape' => 'DomainJoinInfo', ], 'NetworkAccessConfiguration' => [ 'shape' => 'NetworkAccessConfiguration', ], 'ImageBuilderErrors' => [ 'shape' => 'ResourceErrors', ], 'AppstreamAgentVersion' => [ 'shape' => 'AppstreamAgentVersion', ], 'AccessEndpoints' => [ 'shape' => 'AccessEndpointList', ], ], ], 'ImageBuilderList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ImageBuilder', ], ], 'ImageBuilderState' => [ 'type' => 'string', 'enum' => [ 'PENDING', 'UPDATING_AGENT', 'RUNNING', 'STOPPING', 'STOPPED', 'REBOOTING', 'SNAPSHOTTING', 'DELETING', 'FAILED', 'UPDATING', 'PENDING_QUALIFICATION', ], ], 'ImageBuilderStateChangeReason' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ImageBuilderStateChangeReasonCode', ], 'Message' => [ 'shape' => 'String', ], ], ], 'ImageBuilderStateChangeReasonCode' => [ 'type' => 'string', 'enum' => [ 'INTERNAL_ERROR', 'IMAGE_UNAVAILABLE', ], ], 'ImageList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Image', ], ], 'ImagePermissions' => [ 'type' => 'structure', 'members' => [ 'allowFleet' => [ 'shape' => 'BooleanObject', ], 'allowImageBuilder' => [ 'shape' => 'BooleanObject', ], ], ], 'ImageState' => [ 'type' => 'string', 'enum' => [ 'PENDING', 'AVAILABLE', 'FAILED', 'COPYING', 'DELETING', 'CREATING', 'IMPORTING', ], ], 'ImageStateChangeReason' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ImageStateChangeReasonCode', ], 'Message' => [ 'shape' => 'String', ], ], ], 'ImageStateChangeReasonCode' => [ 'type' => 'string', 'enum' => [ 'INTERNAL_ERROR', 'IMAGE_BUILDER_NOT_AVAILABLE', 'IMAGE_COPY_FAILURE', ], ], 'IncompatibleImageException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'Integer' => [ 'type' => 'integer', ], 'InvalidAccountStatusException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'InvalidParameterCombinationException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'InvalidRoleException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'LastReportGenerationExecutionError' => [ 'type' => 'structure', 'members' => [ 'ErrorCode' => [ 'shape' => 'UsageReportExecutionErrorCode', ], 'ErrorMessage' => [ 'shape' => 'String', ], ], ], 'LastReportGenerationExecutionErrors' => [ 'type' => 'list', 'member' => [ 'shape' => 'LastReportGenerationExecutionError', ], ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ListAssociatedFleetsRequest' => [ 'type' => 'structure', 'required' => [ 'StackName', ], 'members' => [ 'StackName' => [ 'shape' => 'String', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListAssociatedFleetsResult' => [ 'type' => 'structure', 'members' => [ 'Names' => [ 'shape' => 'StringList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListAssociatedStacksRequest' => [ 'type' => 'structure', 'required' => [ 'FleetName', ], 'members' => [ 'FleetName' => [ 'shape' => 'String', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListAssociatedStacksResult' => [ 'type' => 'structure', 'members' => [ 'Names' => [ 'shape' => 'StringList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListEntitledApplicationsRequest' => [ 'type' => 'structure', 'required' => [ 'StackName', 'EntitlementName', ], 'members' => [ 'StackName' => [ 'shape' => 'Name', ], 'EntitlementName' => [ 'shape' => 'Name', ], 'NextToken' => [ 'shape' => 'String', ], 'MaxResults' => [ 'shape' => 'Integer', ], ], ], 'ListEntitledApplicationsResult' => [ 'type' => 'structure', 'members' => [ 'EntitledApplications' => [ 'shape' => 'EntitledApplicationList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'Tags', ], ], ], 'Long' => [ 'type' => 'long', ], 'MaxResults' => [ 'type' => 'integer', 'box' => true, 'max' => 500, 'min' => 0, ], 'MessageAction' => [ 'type' => 'string', 'enum' => [ 'SUPPRESS', 'RESEND', ], ], 'Metadata' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], 'Name' => [ 'type' => 'string', 'pattern' => '^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$', ], 'NetworkAccessConfiguration' => [ 'type' => 'structure', 'members' => [ 'EniPrivateIpAddress' => [ 'shape' => 'String', ], 'EniId' => [ 'shape' => 'String', ], ], ], 'OperationNotPermittedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'OrganizationalUnitDistinguishedName' => [ 'type' => 'string', 'max' => 2000, ], 'OrganizationalUnitDistinguishedNamesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'OrganizationalUnitDistinguishedName', ], ], 'PackagingType' => [ 'type' => 'string', 'enum' => [ 'CUSTOM', 'APPSTREAM2', ], ], 'Permission' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'DISABLED', ], ], 'PlatformType' => [ 'type' => 'string', 'enum' => [ 'WINDOWS', 'WINDOWS_SERVER_2016', 'WINDOWS_SERVER_2019', 'AMAZON_LINUX2', ], ], 'Platforms' => [ 'type' => 'list', 'member' => [ 'shape' => 'PlatformType', ], 'max' => 4, ], 'PreferredProtocol' => [ 'type' => 'string', 'enum' => [ 'TCP', 'UDP', ], ], 'RedirectURL' => [ 'type' => 'string', 'max' => 1000, ], 'RegionName' => [ 'type' => 'string', 'max' => 32, 'min' => 1, ], 'RequestLimitExceededException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ResourceAlreadyExistsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ResourceError' => [ 'type' => 'structure', 'members' => [ 'ErrorCode' => [ 'shape' => 'FleetErrorCode', ], 'ErrorMessage' => [ 'shape' => 'String', ], 'ErrorTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'ResourceErrors' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResourceError', ], ], 'ResourceIdentifier' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, ], 'ResourceInUseException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ResourceNotAvailableException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'S3Bucket' => [ 'type' => 'string', 'max' => 63, 'min' => 3, 'pattern' => '^[0-9a-z\\\\.\\\\-]*(?<!\\\\.)$', ], 'S3Key' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, ], 'S3Location' => [ 'type' => 'structure', 'required' => [ 'S3Bucket', ], 'members' => [ 'S3Bucket' => [ 'shape' => 'S3Bucket', ], 'S3Key' => [ 'shape' => 'S3Key', ], ], ], 'ScriptDetails' => [ 'type' => 'structure', 'required' => [ 'ScriptS3Location', 'ExecutablePath', 'TimeoutInSeconds', ], 'members' => [ 'ScriptS3Location' => [ 'shape' => 'S3Location', ], 'ExecutablePath' => [ 'shape' => 'String', ], 'ExecutableParameters' => [ 'shape' => 'String', ], 'TimeoutInSeconds' => [ 'shape' => 'Integer', ], ], ], 'SecurityGroupIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], 'max' => 5, ], 'ServiceAccountCredentials' => [ 'type' => 'structure', 'required' => [ 'AccountName', 'AccountPassword', ], 'members' => [ 'AccountName' => [ 'shape' => 'AccountName', ], 'AccountPassword' => [ 'shape' => 'AccountPassword', ], ], ], 'Session' => [ 'type' => 'structure', 'required' => [ 'Id', 'UserId', 'StackName', 'FleetName', 'State', ], 'members' => [ 'Id' => [ 'shape' => 'String', ], 'UserId' => [ 'shape' => 'UserId', ], 'StackName' => [ 'shape' => 'String', ], 'FleetName' => [ 'shape' => 'String', ], 'State' => [ 'shape' => 'SessionState', ], 'ConnectionState' => [ 'shape' => 'SessionConnectionState', ], 'StartTime' => [ 'shape' => 'Timestamp', ], 'MaxExpirationTime' => [ 'shape' => 'Timestamp', ], 'AuthenticationType' => [ 'shape' => 'AuthenticationType', ], 'NetworkAccessConfiguration' => [ 'shape' => 'NetworkAccessConfiguration', ], ], ], 'SessionConnectionState' => [ 'type' => 'string', 'enum' => [ 'CONNECTED', 'NOT_CONNECTED', ], ], 'SessionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Session', ], ], 'SessionState' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'PENDING', 'EXPIRED', ], ], 'SettingsGroup' => [ 'type' => 'string', 'max' => 100, ], 'SharedImagePermissions' => [ 'type' => 'structure', 'required' => [ 'sharedAccountId', 'imagePermissions', ], 'members' => [ 'sharedAccountId' => [ 'shape' => 'AwsAccountId', ], 'imagePermissions' => [ 'shape' => 'ImagePermissions', ], ], ], 'SharedImagePermissionsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SharedImagePermissions', ], ], 'Stack' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'String', ], 'Description' => [ 'shape' => 'String', ], 'DisplayName' => [ 'shape' => 'String', ], 'CreatedTime' => [ 'shape' => 'Timestamp', ], 'StorageConnectors' => [ 'shape' => 'StorageConnectorList', ], 'RedirectURL' => [ 'shape' => 'RedirectURL', ], 'FeedbackURL' => [ 'shape' => 'FeedbackURL', ], 'StackErrors' => [ 'shape' => 'StackErrors', ], 'UserSettings' => [ 'shape' => 'UserSettingList', ], 'ApplicationSettings' => [ 'shape' => 'ApplicationSettingsResponse', ], 'AccessEndpoints' => [ 'shape' => 'AccessEndpointList', ], 'EmbedHostDomains' => [ 'shape' => 'EmbedHostDomains', ], 'StreamingExperienceSettings' => [ 'shape' => 'StreamingExperienceSettings', ], ], ], 'StackAttribute' => [ 'type' => 'string', 'enum' => [ 'STORAGE_CONNECTORS', 'STORAGE_CONNECTOR_HOMEFOLDERS', 'STORAGE_CONNECTOR_GOOGLE_DRIVE', 'STORAGE_CONNECTOR_ONE_DRIVE', 'REDIRECT_URL', 'FEEDBACK_URL', 'THEME_NAME', 'USER_SETTINGS', 'EMBED_HOST_DOMAINS', 'IAM_ROLE_ARN', 'ACCESS_ENDPOINTS', 'STREAMING_EXPERIENCE_SETTINGS', ], ], 'StackAttributes' => [ 'type' => 'list', 'member' => [ 'shape' => 'StackAttribute', ], ], 'StackError' => [ 'type' => 'structure', 'members' => [ 'ErrorCode' => [ 'shape' => 'StackErrorCode', ], 'ErrorMessage' => [ 'shape' => 'String', ], ], ], 'StackErrorCode' => [ 'type' => 'string', 'enum' => [ 'STORAGE_CONNECTOR_ERROR', 'INTERNAL_SERVICE_ERROR', ], ], 'StackErrors' => [ 'type' => 'list', 'member' => [ 'shape' => 'StackError', ], ], 'StackList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Stack', ], ], 'StartAppBlockBuilderRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], ], ], 'StartAppBlockBuilderResult' => [ 'type' => 'structure', 'members' => [ 'AppBlockBuilder' => [ 'shape' => 'AppBlockBuilder', ], ], ], 'StartFleetRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'String', ], ], ], 'StartFleetResult' => [ 'type' => 'structure', 'members' => [], ], 'StartImageBuilderRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'String', ], 'AppstreamAgentVersion' => [ 'shape' => 'AppstreamAgentVersion', ], ], ], 'StartImageBuilderResult' => [ 'type' => 'structure', 'members' => [ 'ImageBuilder' => [ 'shape' => 'ImageBuilder', ], ], ], 'StopAppBlockBuilderRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], ], ], 'StopAppBlockBuilderResult' => [ 'type' => 'structure', 'members' => [ 'AppBlockBuilder' => [ 'shape' => 'AppBlockBuilder', ], ], ], 'StopFleetRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'String', ], ], ], 'StopFleetResult' => [ 'type' => 'structure', 'members' => [], ], 'StopImageBuilderRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'String', ], ], ], 'StopImageBuilderResult' => [ 'type' => 'structure', 'members' => [ 'ImageBuilder' => [ 'shape' => 'ImageBuilder', ], ], ], 'StorageConnector' => [ 'type' => 'structure', 'required' => [ 'ConnectorType', ], 'members' => [ 'ConnectorType' => [ 'shape' => 'StorageConnectorType', ], 'ResourceIdentifier' => [ 'shape' => 'ResourceIdentifier', ], 'Domains' => [ 'shape' => 'DomainList', ], ], ], 'StorageConnectorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'StorageConnector', ], ], 'StorageConnectorType' => [ 'type' => 'string', 'enum' => [ 'HOMEFOLDERS', 'GOOGLE_DRIVE', 'ONE_DRIVE', ], ], 'StreamView' => [ 'type' => 'string', 'enum' => [ 'APP', 'DESKTOP', ], ], 'StreamingExperienceSettings' => [ 'type' => 'structure', 'members' => [ 'PreferredProtocol' => [ 'shape' => 'PreferredProtocol', ], ], ], 'StreamingUrlUserId' => [ 'type' => 'string', 'max' => 32, 'min' => 2, 'pattern' => '[\\\\w+=,.@-]*', ], 'String' => [ 'type' => 'string', 'min' => 1, ], 'StringList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'SubnetIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^(^(?!aws:).[\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$', ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 50, 'min' => 1, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'Tags', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', ], 'Tags' => [ 'shape' => 'Tags', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => '^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$', ], 'Tags' => [ 'type' => 'map', 'key' => [ 'shape' => 'TagKey', ], 'value' => [ 'shape' => 'TagValue', ], 'max' => 50, 'min' => 1, ], 'Timestamp' => [ 'type' => 'timestamp', ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'TagKeys', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', ], 'TagKeys' => [ 'shape' => 'TagKeyList', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateAppBlockBuilderRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'DisplayName' => [ 'shape' => 'DisplayName', ], 'Platform' => [ 'shape' => 'PlatformType', ], 'InstanceType' => [ 'shape' => 'String', ], 'VpcConfig' => [ 'shape' => 'VpcConfig', ], 'EnableDefaultInternetAccess' => [ 'shape' => 'BooleanObject', ], 'IamRoleArn' => [ 'shape' => 'Arn', ], 'AccessEndpoints' => [ 'shape' => 'AccessEndpointList', ], 'AttributesToDelete' => [ 'shape' => 'AppBlockBuilderAttributes', ], ], ], 'UpdateAppBlockBuilderResult' => [ 'type' => 'structure', 'members' => [ 'AppBlockBuilder' => [ 'shape' => 'AppBlockBuilder', ], ], ], 'UpdateApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'DisplayName' => [ 'shape' => 'DisplayName', ], 'Description' => [ 'shape' => 'Description', ], 'IconS3Location' => [ 'shape' => 'S3Location', ], 'LaunchPath' => [ 'shape' => 'String', ], 'WorkingDirectory' => [ 'shape' => 'String', ], 'LaunchParameters' => [ 'shape' => 'String', ], 'AppBlockArn' => [ 'shape' => 'Arn', ], 'AttributesToDelete' => [ 'shape' => 'ApplicationAttributes', ], ], ], 'UpdateApplicationResult' => [ 'type' => 'structure', 'members' => [ 'Application' => [ 'shape' => 'Application', ], ], ], 'UpdateDirectoryConfigRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryName', ], 'members' => [ 'DirectoryName' => [ 'shape' => 'DirectoryName', ], 'OrganizationalUnitDistinguishedNames' => [ 'shape' => 'OrganizationalUnitDistinguishedNamesList', ], 'ServiceAccountCredentials' => [ 'shape' => 'ServiceAccountCredentials', ], 'CertificateBasedAuthProperties' => [ 'shape' => 'CertificateBasedAuthProperties', ], ], ], 'UpdateDirectoryConfigResult' => [ 'type' => 'structure', 'members' => [ 'DirectoryConfig' => [ 'shape' => 'DirectoryConfig', ], ], ], 'UpdateEntitlementRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'StackName', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'StackName' => [ 'shape' => 'Name', ], 'Description' => [ 'shape' => 'Description', ], 'AppVisibility' => [ 'shape' => 'AppVisibility', ], 'Attributes' => [ 'shape' => 'EntitlementAttributeList', ], ], ], 'UpdateEntitlementResult' => [ 'type' => 'structure', 'members' => [ 'Entitlement' => [ 'shape' => 'Entitlement', ], ], ], 'UpdateFleetRequest' => [ 'type' => 'structure', 'members' => [ 'ImageName' => [ 'shape' => 'String', ], 'ImageArn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'String', ], 'InstanceType' => [ 'shape' => 'String', ], 'ComputeCapacity' => [ 'shape' => 'ComputeCapacity', ], 'VpcConfig' => [ 'shape' => 'VpcConfig', ], 'MaxUserDurationInSeconds' => [ 'shape' => 'Integer', ], 'DisconnectTimeoutInSeconds' => [ 'shape' => 'Integer', ], 'DeleteVpcConfig' => [ 'shape' => 'Boolean', 'deprecated' => true, ], 'Description' => [ 'shape' => 'Description', ], 'DisplayName' => [ 'shape' => 'DisplayName', ], 'EnableDefaultInternetAccess' => [ 'shape' => 'BooleanObject', ], 'DomainJoinInfo' => [ 'shape' => 'DomainJoinInfo', ], 'IdleDisconnectTimeoutInSeconds' => [ 'shape' => 'Integer', ], 'AttributesToDelete' => [ 'shape' => 'FleetAttributes', ], 'IamRoleArn' => [ 'shape' => 'Arn', ], 'StreamView' => [ 'shape' => 'StreamView', ], 'Platform' => [ 'shape' => 'PlatformType', ], 'MaxConcurrentSessions' => [ 'shape' => 'Integer', ], 'UsbDeviceFilterStrings' => [ 'shape' => 'UsbDeviceFilterStrings', ], 'SessionScriptS3Location' => [ 'shape' => 'S3Location', ], ], ], 'UpdateFleetResult' => [ 'type' => 'structure', 'members' => [ 'Fleet' => [ 'shape' => 'Fleet', ], ], ], 'UpdateImagePermissionsRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'SharedAccountId', 'ImagePermissions', ], 'members' => [ 'Name' => [ 'shape' => 'Name', ], 'SharedAccountId' => [ 'shape' => 'AwsAccountId', ], 'ImagePermissions' => [ 'shape' => 'ImagePermissions', ], ], ], 'UpdateImagePermissionsResult' => [ 'type' => 'structure', 'members' => [], ], 'UpdateStackRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'DisplayName' => [ 'shape' => 'DisplayName', ], 'Description' => [ 'shape' => 'Description', ], 'Name' => [ 'shape' => 'String', ], 'StorageConnectors' => [ 'shape' => 'StorageConnectorList', ], 'DeleteStorageConnectors' => [ 'shape' => 'Boolean', 'deprecated' => true, ], 'RedirectURL' => [ 'shape' => 'RedirectURL', ], 'FeedbackURL' => [ 'shape' => 'FeedbackURL', ], 'AttributesToDelete' => [ 'shape' => 'StackAttributes', ], 'UserSettings' => [ 'shape' => 'UserSettingList', ], 'ApplicationSettings' => [ 'shape' => 'ApplicationSettings', ], 'AccessEndpoints' => [ 'shape' => 'AccessEndpointList', ], 'EmbedHostDomains' => [ 'shape' => 'EmbedHostDomains', ], 'StreamingExperienceSettings' => [ 'shape' => 'StreamingExperienceSettings', ], ], ], 'UpdateStackResult' => [ 'type' => 'structure', 'members' => [ 'Stack' => [ 'shape' => 'Stack', ], ], ], 'UsageReportExecutionErrorCode' => [ 'type' => 'string', 'enum' => [ 'RESOURCE_NOT_FOUND', 'ACCESS_DENIED', 'INTERNAL_SERVICE_ERROR', ], ], 'UsageReportSchedule' => [ 'type' => 'string', 'enum' => [ 'DAILY', ], ], 'UsageReportSubscription' => [ 'type' => 'structure', 'members' => [ 'S3BucketName' => [ 'shape' => 'String', ], 'Schedule' => [ 'shape' => 'UsageReportSchedule', ], 'LastGeneratedReportDate' => [ 'shape' => 'Timestamp', ], 'SubscriptionErrors' => [ 'shape' => 'LastReportGenerationExecutionErrors', ], ], ], 'UsageReportSubscriptionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'UsageReportSubscription', ], ], 'UsbDeviceFilterString' => [ 'type' => 'string', 'max' => 100, 'min' => 0, 'pattern' => '^((\\\\w*)\\\\s*(\\\\w*)\\\\s*\\\\,\\\\s*(\\\\w*)\\\\s*\\\\,\\\\s*\\\\*?(\\\\w*)\\\\s*\\\\,\\\\s*\\\\*?(\\\\w*)\\\\s*\\\\,\\\\s*\\\\*?\\\\d*\\\\s*\\\\,\\\\s*\\\\*?\\\\d*\\\\s*\\\\,\\\\s*[0-1]\\\\s*\\\\,\\\\s*[0-1]\\\\s*)$', ], 'UsbDeviceFilterStrings' => [ 'type' => 'list', 'member' => [ 'shape' => 'UsbDeviceFilterString', ], ], 'User' => [ 'type' => 'structure', 'required' => [ 'AuthenticationType', ], 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'UserName' => [ 'shape' => 'Username', ], 'Enabled' => [ 'shape' => 'Boolean', ], 'Status' => [ 'shape' => 'String', ], 'FirstName' => [ 'shape' => 'UserAttributeValue', ], 'LastName' => [ 'shape' => 'UserAttributeValue', ], 'CreatedTime' => [ 'shape' => 'Timestamp', ], 'AuthenticationType' => [ 'shape' => 'AuthenticationType', ], ], ], 'UserAttributeValue' => [ 'type' => 'string', 'max' => 2048, 'pattern' => '^[A-Za-z0-9_\\\\-\\\\s]+$', 'sensitive' => true, ], 'UserId' => [ 'type' => 'string', 'max' => 128, 'min' => 2, ], 'UserList' => [ 'type' => 'list', 'member' => [ 'shape' => 'User', ], ], 'UserSetting' => [ 'type' => 'structure', 'required' => [ 'Action', 'Permission', ], 'members' => [ 'Action' => [ 'shape' => 'Action', ], 'Permission' => [ 'shape' => 'Permission', ], ], ], 'UserSettingList' => [ 'type' => 'list', 'member' => [ 'shape' => 'UserSetting', ], 'min' => 1, ], 'UserStackAssociation' => [ 'type' => 'structure', 'required' => [ 'StackName', 'UserName', 'AuthenticationType', ], 'members' => [ 'StackName' => [ 'shape' => 'String', ], 'UserName' => [ 'shape' => 'Username', ], 'AuthenticationType' => [ 'shape' => 'AuthenticationType', ], 'SendEmailNotification' => [ 'shape' => 'Boolean', ], ], ], 'UserStackAssociationError' => [ 'type' => 'structure', 'members' => [ 'UserStackAssociation' => [ 'shape' => 'UserStackAssociation', ], 'ErrorCode' => [ 'shape' => 'UserStackAssociationErrorCode', ], 'ErrorMessage' => [ 'shape' => 'String', ], ], ], 'UserStackAssociationErrorCode' => [ 'type' => 'string', 'enum' => [ 'STACK_NOT_FOUND', 'USER_NAME_NOT_FOUND', 'DIRECTORY_NOT_FOUND', 'INTERNAL_ERROR', ], ], 'UserStackAssociationErrorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'UserStackAssociationError', ], ], 'UserStackAssociationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'UserStackAssociation', ], 'max' => 25, 'min' => 1, ], 'Username' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[\\\\p{L}\\\\p{M}\\\\p{S}\\\\p{N}\\\\p{P}]+', 'sensitive' => true, ], 'VisibilityType' => [ 'type' => 'string', 'enum' => [ 'PUBLIC', 'PRIVATE', 'SHARED', ], ], 'VpcConfig' => [ 'type' => 'structure', 'members' => [ 'SubnetIds' => [ 'shape' => 'SubnetIdList', ], 'SecurityGroupIds' => [ 'shape' => 'SecurityGroupIdList', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appstream/2016-12-01/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<fullname>Amazon AppStream 2.0</fullname> <p>This is the <i>Amazon AppStream 2.0 API Reference</i>. This documentation provides descriptions and syntax for each of the actions and data types in AppStream 2.0. AppStream 2.0 is a fully managed, secure application streaming service that lets you stream desktop applications to users without rewriting applications. AppStream 2.0 manages the AWS resources that are required to host and run your applications, scales automatically, and provides access to your users on demand. </p> <note> <p>You can call the AppStream 2.0 API operations by using an interface VPC endpoint (interface endpoint). For more information, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/access-api-cli-through-interface-vpc-endpoint.html\">Access AppStream 2.0 API Operations and CLI Commands Through an Interface VPC Endpoint</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p> </note> <p>To learn more about AppStream 2.0, see the following resources:</p> <ul> <li> <p> <a href=\"http://aws.amazon.com/appstream2\">Amazon AppStream 2.0 product page</a> </p> </li> <li> <p> <a href=\"http://aws.amazon.com/documentation/appstream2\">Amazon AppStream 2.0 documentation</a> </p> </li> </ul>', 'operations' => [ 'AssociateAppBlockBuilderAppBlock' => '<p>Associates the specified app block builder with the specified app block.</p>', 'AssociateApplicationFleet' => '<p>Associates the specified application with the specified fleet. This is only supported for Elastic fleets.</p>', 'AssociateApplicationToEntitlement' => '<p>Associates an application to entitle.</p>', 'AssociateFleet' => '<p>Associates the specified fleet with the specified stack.</p>', 'BatchAssociateUserStack' => '<p>Associates the specified users with the specified stacks. Users in a user pool cannot be assigned to stacks with fleets that are joined to an Active Directory domain.</p>', 'BatchDisassociateUserStack' => '<p>Disassociates the specified users from the specified stacks.</p>', 'CopyImage' => '<p>Copies the image within the same region or to a new region within the same AWS account. Note that any tags you added to the image will not be copied.</p>', 'CreateAppBlock' => '<p>Creates an app block.</p> <p>App blocks are an Amazon AppStream 2.0 resource that stores the details about the virtual hard disk in an S3 bucket. It also stores the setup script with details about how to mount the virtual hard disk. The virtual hard disk includes the application binaries and other files necessary to launch your applications. Multiple applications can be assigned to a single app block.</p> <p>This is only supported for Elastic fleets.</p>', 'CreateAppBlockBuilder' => '<p>Creates an app block builder.</p>', 'CreateAppBlockBuilderStreamingURL' => '<p>Creates a URL to start a create app block builder streaming session.</p>', 'CreateApplication' => '<p>Creates an application.</p> <p>Applications are an Amazon AppStream 2.0 resource that stores the details about how to launch applications on Elastic fleet streaming instances. An application consists of the launch details, icon, and display name. Applications are associated with an app block that contains the application binaries and other files. The applications assigned to an Elastic fleet are the applications users can launch. </p> <p>This is only supported for Elastic fleets.</p>', 'CreateDirectoryConfig' => '<p>Creates a Directory Config object in AppStream 2.0. This object includes the configuration information required to join fleets and image builders to Microsoft Active Directory domains.</p>', 'CreateEntitlement' => '<p>Creates a new entitlement. Entitlements control access to specific applications within a stack, based on user attributes. Entitlements apply to SAML 2.0 federated user identities. Amazon AppStream 2.0 user pool and streaming URL users are entitled to all applications in a stack. Entitlements don\\'t apply to the desktop stream view application, or to applications managed by a dynamic app provider using the Dynamic Application Framework.</p>', 'CreateFleet' => '<p>Creates a fleet. A fleet consists of streaming instances that your users access for their applications and desktops.</p>', 'CreateImageBuilder' => '<p>Creates an image builder. An image builder is a virtual machine that is used to create an image.</p> <p>The initial state of the builder is <code>PENDING</code>. When it is ready, the state is <code>RUNNING</code>.</p>', 'CreateImageBuilderStreamingURL' => '<p>Creates a URL to start an image builder streaming session.</p>', 'CreateStack' => '<p>Creates a stack to start streaming applications to users. A stack consists of an associated fleet, user access policies, and storage configurations. </p>', 'CreateStreamingURL' => '<p>Creates a temporary URL to start an AppStream 2.0 streaming session for the specified user. A streaming URL enables application streaming to be tested without user setup. </p>', 'CreateUpdatedImage' => '<p>Creates a new image with the latest Windows operating system updates, driver updates, and AppStream 2.0 agent software.</p> <p>For more information, see the \"Update an Image by Using Managed AppStream 2.0 Image Updates\" section in <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/administer-images.html\">Administer Your AppStream 2.0 Images</a>, in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'CreateUsageReportSubscription' => '<p>Creates a usage report subscription. Usage reports are generated daily.</p>', 'CreateUser' => '<p>Creates a new user in the user pool.</p>', 'DeleteAppBlock' => '<p>Deletes an app block.</p>', 'DeleteAppBlockBuilder' => '<p>Deletes an app block builder.</p> <p>An app block builder can only be deleted when it has no association with an app block.</p>', 'DeleteApplication' => '<p>Deletes an application.</p>', 'DeleteDirectoryConfig' => '<p>Deletes the specified Directory Config object from AppStream 2.0. This object includes the information required to join streaming instances to an Active Directory domain.</p>', 'DeleteEntitlement' => '<p>Deletes the specified entitlement.</p>', 'DeleteFleet' => '<p>Deletes the specified fleet.</p>', 'DeleteImage' => '<p>Deletes the specified image. You cannot delete an image when it is in use. After you delete an image, you cannot provision new capacity using the image.</p>', 'DeleteImageBuilder' => '<p>Deletes the specified image builder and releases the capacity.</p>', 'DeleteImagePermissions' => '<p>Deletes permissions for the specified private image. After you delete permissions for an image, AWS accounts to which you previously granted these permissions can no longer use the image.</p>', 'DeleteStack' => '<p>Deletes the specified stack. After the stack is deleted, the application streaming environment provided by the stack is no longer available to users. Also, any reservations made for application streaming sessions for the stack are released.</p>', 'DeleteUsageReportSubscription' => '<p>Disables usage report generation.</p>', 'DeleteUser' => '<p>Deletes a user from the user pool.</p>', 'DescribeAppBlockBuilderAppBlockAssociations' => '<p>Retrieves a list that describes one or more app block builder associations.</p>', 'DescribeAppBlockBuilders' => '<p>Retrieves a list that describes one or more app block builders.</p>', 'DescribeAppBlocks' => '<p>Retrieves a list that describes one or more app blocks.</p>', 'DescribeApplicationFleetAssociations' => '<p>Retrieves a list that describes one or more application fleet associations. Either ApplicationArn or FleetName must be specified.</p>', 'DescribeApplications' => '<p>Retrieves a list that describes one or more applications.</p>', 'DescribeDirectoryConfigs' => '<p>Retrieves a list that describes one or more specified Directory Config objects for AppStream 2.0, if the names for these objects are provided. Otherwise, all Directory Config objects in the account are described. These objects include the configuration information required to join fleets and image builders to Microsoft Active Directory domains. </p> <p>Although the response syntax in this topic includes the account password, this password is not returned in the actual response.</p>', 'DescribeEntitlements' => '<p>Retrieves a list that describes one of more entitlements.</p>', 'DescribeFleets' => '<p>Retrieves a list that describes one or more specified fleets, if the fleet names are provided. Otherwise, all fleets in the account are described.</p>', 'DescribeImageBuilders' => '<p>Retrieves a list that describes one or more specified image builders, if the image builder names are provided. Otherwise, all image builders in the account are described.</p>', 'DescribeImagePermissions' => '<p>Retrieves a list that describes the permissions for shared AWS account IDs on a private image that you own. </p>', 'DescribeImages' => '<p>Retrieves a list that describes one or more specified images, if the image names or image ARNs are provided. Otherwise, all images in the account are described.</p>', 'DescribeSessions' => '<p>Retrieves a list that describes the streaming sessions for a specified stack and fleet. If a UserId is provided for the stack and fleet, only streaming sessions for that user are described. If an authentication type is not provided, the default is to authenticate users using a streaming URL.</p>', 'DescribeStacks' => '<p>Retrieves a list that describes one or more specified stacks, if the stack names are provided. Otherwise, all stacks in the account are described.</p>', 'DescribeUsageReportSubscriptions' => '<p>Retrieves a list that describes one or more usage report subscriptions.</p>', 'DescribeUserStackAssociations' => '<p>Retrieves a list that describes the UserStackAssociation objects. You must specify either or both of the following:</p> <ul> <li> <p>The stack name</p> </li> <li> <p>The user name (email address of the user associated with the stack) and the authentication type for the user</p> </li> </ul>', 'DescribeUsers' => '<p>Retrieves a list that describes one or more specified users in the user pool.</p>', 'DisableUser' => '<p>Disables the specified user in the user pool. Users can\\'t sign in to AppStream 2.0 until they are re-enabled. This action does not delete the user. </p>', 'DisassociateAppBlockBuilderAppBlock' => '<p>Disassociates a specified app block builder from a specified app block.</p>', 'DisassociateApplicationFleet' => '<p>Disassociates the specified application from the fleet.</p>', 'DisassociateApplicationFromEntitlement' => '<p>Deletes the specified application from the specified entitlement.</p>', 'DisassociateFleet' => '<p>Disassociates the specified fleet from the specified stack.</p>', 'EnableUser' => '<p>Enables a user in the user pool. After being enabled, users can sign in to AppStream 2.0 and open applications from the stacks to which they are assigned.</p>', 'ExpireSession' => '<p>Immediately stops the specified streaming session.</p>', 'ListAssociatedFleets' => '<p>Retrieves the name of the fleet that is associated with the specified stack.</p>', 'ListAssociatedStacks' => '<p>Retrieves the name of the stack with which the specified fleet is associated.</p>', 'ListEntitledApplications' => '<p>Retrieves a list of entitled applications.</p>', 'ListTagsForResource' => '<p>Retrieves a list of all tags for the specified AppStream 2.0 resource. You can tag AppStream 2.0 image builders, images, fleets, and stacks.</p> <p>For more information about tags, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html\">Tagging Your Resources</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'StartAppBlockBuilder' => '<p>Starts an app block builder.</p> <p>An app block builder can only be started when it\\'s associated with an app block.</p> <p>Starting an app block builder starts a new instance, which is equivalent to an elastic fleet instance with application builder assistance functionality.</p>', 'StartFleet' => '<p>Starts the specified fleet.</p>', 'StartImageBuilder' => '<p>Starts the specified image builder.</p>', 'StopAppBlockBuilder' => '<p>Stops an app block builder.</p> <p>Stopping an app block builder terminates the instance, and the instance state is not persisted.</p>', 'StopFleet' => '<p>Stops the specified fleet.</p>', 'StopImageBuilder' => '<p>Stops the specified image builder.</p>', 'TagResource' => '<p>Adds or overwrites one or more tags for the specified AppStream 2.0 resource. You can tag AppStream 2.0 image builders, images, fleets, and stacks.</p> <p>Each tag consists of a key and an optional value. If a resource already has a tag with the same key, this operation updates its value.</p> <p>To list the current tags for your resources, use <a>ListTagsForResource</a>. To disassociate tags from your resources, use <a>UntagResource</a>.</p> <p>For more information about tags, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html\">Tagging Your Resources</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'UntagResource' => '<p>Disassociates one or more specified tags from the specified AppStream 2.0 resource.</p> <p>To list the current tags for your resources, use <a>ListTagsForResource</a>.</p> <p>For more information about tags, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html\">Tagging Your Resources</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'UpdateAppBlockBuilder' => '<p>Updates an app block builder.</p> <p>If the app block builder is in the <code>STARTING</code> or <code>STOPPING</code> state, you can\\'t update it. If the app block builder is in the <code>RUNNING</code> state, you can only update the DisplayName and Description. If the app block builder is in the <code>STOPPED</code> state, you can update any attribute except the Name.</p>', 'UpdateApplication' => '<p>Updates the specified application.</p>', 'UpdateDirectoryConfig' => '<p>Updates the specified Directory Config object in AppStream 2.0. This object includes the configuration information required to join fleets and image builders to Microsoft Active Directory domains.</p>', 'UpdateEntitlement' => '<p>Updates the specified entitlement.</p>', 'UpdateFleet' => '<p>Updates the specified fleet.</p> <p>If the fleet is in the <code>STOPPED</code> state, you can update any attribute except the fleet name.</p> <p>If the fleet is in the <code>RUNNING</code> state, you can update the following based on the fleet type:</p> <ul> <li> <p>Always-On and On-Demand fleet types</p> <p>You can update the <code>DisplayName</code>, <code>ComputeCapacity</code>, <code>ImageARN</code>, <code>ImageName</code>, <code>IdleDisconnectTimeoutInSeconds</code>, and <code>DisconnectTimeoutInSeconds</code> attributes.</p> </li> <li> <p>Elastic fleet type</p> <p>You can update the <code>DisplayName</code>, <code>IdleDisconnectTimeoutInSeconds</code>, <code>DisconnectTimeoutInSeconds</code>, <code>MaxConcurrentSessions</code>, <code>SessionScriptS3Location</code> and <code>UsbDeviceFilterStrings</code> attributes.</p> </li> </ul> <p>If the fleet is in the <code>STARTING</code> or <code>STOPPED</code> state, you can\\'t update it.</p>', 'UpdateImagePermissions' => '<p>Adds or updates permissions for the specified private image. </p>', 'UpdateStack' => '<p>Updates the specified fields for the specified stack.</p>', ], 'shapes' => [ 'AccessEndpoint' => [ 'base' => '<p>Describes an interface VPC endpoint (interface endpoint) that lets you create a private connection between the virtual private cloud (VPC) that you specify and AppStream 2.0. When you specify an interface endpoint for a stack, users of the stack can connect to AppStream 2.0 only through that endpoint. When you specify an interface endpoint for an image builder, administrators can connect to the image builder only through that endpoint.</p>', 'refs' => [ 'AccessEndpointList$member' => NULL, ], ], 'AccessEndpointList' => [ 'base' => NULL, 'refs' => [ 'AppBlockBuilder$AccessEndpoints' => '<p>The list of interface VPC endpoint (interface endpoint) objects. Administrators can connect to the app block builder only through the specified endpoints.</p>', 'CreateAppBlockBuilderRequest$AccessEndpoints' => '<p>The list of interface VPC endpoint (interface endpoint) objects. Administrators can connect to the app block builder only through the specified endpoints.</p>', 'CreateImageBuilderRequest$AccessEndpoints' => '<p>The list of interface VPC endpoint (interface endpoint) objects. Administrators can connect to the image builder only through the specified endpoints.</p>', 'CreateStackRequest$AccessEndpoints' => '<p>The list of interface VPC endpoint (interface endpoint) objects. Users of the stack can connect to AppStream 2.0 only through the specified endpoints.</p>', 'ImageBuilder$AccessEndpoints' => '<p>The list of virtual private cloud (VPC) interface endpoint objects. Administrators can connect to the image builder only through the specified endpoints.</p>', 'Stack$AccessEndpoints' => '<p>The list of virtual private cloud (VPC) interface endpoint objects. Users of the stack can connect to AppStream 2.0 only through the specified endpoints. </p>', 'UpdateAppBlockBuilderRequest$AccessEndpoints' => '<p>The list of interface VPC endpoint (interface endpoint) objects. Administrators can connect to the app block builder only through the specified endpoints.</p>', 'UpdateStackRequest$AccessEndpoints' => '<p>The list of interface VPC endpoint (interface endpoint) objects. Users of the stack can connect to AppStream 2.0 only through the specified endpoints.</p>', ], ], 'AccessEndpointType' => [ 'base' => NULL, 'refs' => [ 'AccessEndpoint$EndpointType' => '<p>The type of interface endpoint.</p>', ], ], 'AccountName' => [ 'base' => NULL, 'refs' => [ 'ServiceAccountCredentials$AccountName' => '<p>The user name of the account. This account must have the following privileges: create computer objects, join computers to the domain, and change/reset the password on descendant computer objects for the organizational units specified.</p>', ], ], 'AccountPassword' => [ 'base' => NULL, 'refs' => [ 'ServiceAccountCredentials$AccountPassword' => '<p>The password for the account.</p>', ], ], 'Action' => [ 'base' => NULL, 'refs' => [ 'UserSetting$Action' => '<p>The action that is enabled or disabled.</p>', ], ], 'AppBlock' => [ 'base' => '<p>Describes an app block.</p> <p>App blocks are an Amazon AppStream 2.0 resource that stores the details about the virtual hard disk in an S3 bucket. It also stores the setup script with details about how to mount the virtual hard disk. The virtual hard disk includes the application binaries and other files necessary to launch your applications. Multiple applications can be assigned to a single app block.</p> <p>This is only supported for Elastic fleets.</p>', 'refs' => [ 'AppBlocks$member' => NULL, 'CreateAppBlockResult$AppBlock' => '<p>The app block.</p>', ], ], 'AppBlockBuilder' => [ 'base' => '<p>Describes an app block builder.</p>', 'refs' => [ 'AppBlockBuilderList$member' => NULL, 'CreateAppBlockBuilderResult$AppBlockBuilder' => NULL, 'StartAppBlockBuilderResult$AppBlockBuilder' => NULL, 'StopAppBlockBuilderResult$AppBlockBuilder' => NULL, 'UpdateAppBlockBuilderResult$AppBlockBuilder' => NULL, ], ], 'AppBlockBuilderAppBlockAssociation' => [ 'base' => '<p>Describes an association between an app block builder and app block.</p>', 'refs' => [ 'AppBlockBuilderAppBlockAssociationsList$member' => NULL, 'AssociateAppBlockBuilderAppBlockResult$AppBlockBuilderAppBlockAssociation' => '<p>The list of app block builders associated with app blocks.</p>', ], ], 'AppBlockBuilderAppBlockAssociationsList' => [ 'base' => NULL, 'refs' => [ 'DescribeAppBlockBuilderAppBlockAssociationsResult$AppBlockBuilderAppBlockAssociations' => '<p>This list of app block builders associated with app blocks.</p>', ], ], 'AppBlockBuilderAttribute' => [ 'base' => NULL, 'refs' => [ 'AppBlockBuilderAttributes$member' => NULL, ], ], 'AppBlockBuilderAttributes' => [ 'base' => NULL, 'refs' => [ 'UpdateAppBlockBuilderRequest$AttributesToDelete' => '<p>The attributes to delete from the app block builder.</p>', ], ], 'AppBlockBuilderList' => [ 'base' => NULL, 'refs' => [ 'DescribeAppBlockBuildersResult$AppBlockBuilders' => '<p>The list that describes one or more app block builders.</p>', ], ], 'AppBlockBuilderPlatformType' => [ 'base' => NULL, 'refs' => [ 'AppBlockBuilder$Platform' => '<p>The platform of the app block builder.</p> <p> <code>WINDOWS_SERVER_2019</code> is the only valid value.</p>', 'CreateAppBlockBuilderRequest$Platform' => '<p>The platform of the app block builder.</p> <p> <code>WINDOWS_SERVER_2019</code> is the only valid value.</p>', ], ], 'AppBlockBuilderState' => [ 'base' => NULL, 'refs' => [ 'AppBlockBuilder$State' => '<p>The state of the app block builder.</p>', ], ], 'AppBlockBuilderStateChangeReason' => [ 'base' => '<p>Describes the reason why the last app block builder state change occurred.</p>', 'refs' => [ 'AppBlockBuilder$StateChangeReason' => '<p>The state change reason.</p>', ], ], 'AppBlockBuilderStateChangeReasonCode' => [ 'base' => NULL, 'refs' => [ 'AppBlockBuilderStateChangeReason$Code' => '<p>The state change reason code.</p>', ], ], 'AppBlockState' => [ 'base' => NULL, 'refs' => [ 'AppBlock$State' => '<p>The state of the app block.</p> <p>An app block with AppStream 2.0 packaging will be in the <code>INACTIVE</code> state if no application package (VHD) is assigned to it. After an application package (VHD) is created by an app block builder for an app block, it becomes <code>ACTIVE</code>. </p> <p>Custom app blocks are always in the <code>ACTIVE</code> state and no action is required to use them.</p>', ], ], 'AppBlocks' => [ 'base' => NULL, 'refs' => [ 'DescribeAppBlocksResult$AppBlocks' => '<p>The app blocks in the list.</p>', ], ], 'AppVisibility' => [ 'base' => NULL, 'refs' => [ 'CreateEntitlementRequest$AppVisibility' => '<p>Specifies whether all or selected apps are entitled.</p>', 'Entitlement$AppVisibility' => '<p>Specifies whether all or selected apps are entitled.</p>', 'UpdateEntitlementRequest$AppVisibility' => '<p>Specifies whether all or only selected apps are entitled.</p>', ], ], 'Application' => [ 'base' => '<p>Describes an application in the application catalog.</p>', 'refs' => [ 'Applications$member' => NULL, 'CreateApplicationResult$Application' => NULL, 'UpdateApplicationResult$Application' => NULL, ], ], 'ApplicationAttribute' => [ 'base' => NULL, 'refs' => [ 'ApplicationAttributes$member' => NULL, ], ], 'ApplicationAttributes' => [ 'base' => NULL, 'refs' => [ 'UpdateApplicationRequest$AttributesToDelete' => '<p>The attributes to delete for an application.</p>', ], ], 'ApplicationFleetAssociation' => [ 'base' => '<p>Describes the application fleet association.</p>', 'refs' => [ 'ApplicationFleetAssociationList$member' => NULL, 'AssociateApplicationFleetResult$ApplicationFleetAssociation' => '<p>If fleet name is specified, this returns the list of applications that are associated to it. If application ARN is specified, this returns the list of fleets to which it is associated.</p>', ], ], 'ApplicationFleetAssociationList' => [ 'base' => NULL, 'refs' => [ 'DescribeApplicationFleetAssociationsResult$ApplicationFleetAssociations' => '<p>The application fleet associations in the list.</p>', ], ], 'ApplicationSettings' => [ 'base' => '<p>The persistent application settings for users of a stack.</p>', 'refs' => [ 'CreateStackRequest$ApplicationSettings' => '<p>The persistent application settings for users of a stack. When these settings are enabled, changes that users make to applications and Windows settings are automatically saved after each session and applied to the next session.</p>', 'UpdateStackRequest$ApplicationSettings' => '<p>The persistent application settings for users of a stack. When these settings are enabled, changes that users make to applications and Windows settings are automatically saved after each session and applied to the next session.</p>', ], ], 'ApplicationSettingsResponse' => [ 'base' => '<p>Describes the persistent application settings for users of a stack.</p>', 'refs' => [ 'Stack$ApplicationSettings' => '<p>The persistent application settings for users of the stack.</p>', ], ], 'Applications' => [ 'base' => NULL, 'refs' => [ 'DescribeApplicationsResult$Applications' => '<p>The applications in the list.</p>', 'Image$Applications' => '<p>The applications associated with the image.</p>', ], ], 'AppstreamAgentVersion' => [ 'base' => NULL, 'refs' => [ 'CreateImageBuilderRequest$AppstreamAgentVersion' => '<p>The version of the AppStream 2.0 agent to use for this image builder. To use the latest version of the AppStream 2.0 agent, specify [LATEST]. </p>', 'Image$AppstreamAgentVersion' => '<p>The version of the AppStream 2.0 agent to use for instances that are launched from this image. </p>', 'ImageBuilder$AppstreamAgentVersion' => '<p>The version of the AppStream 2.0 agent that is currently being used by the image builder. </p>', 'StartImageBuilderRequest$AppstreamAgentVersion' => '<p>The version of the AppStream 2.0 agent to use for this image builder. To use the latest version of the AppStream 2.0 agent, specify [LATEST]. </p>', ], ], 'Arn' => [ 'base' => NULL, 'refs' => [ 'AppBlock$Arn' => '<p>The ARN of the app block.</p>', 'AppBlockBuilder$Arn' => '<p>The ARN of the app block builder.</p>', 'AppBlockBuilder$IamRoleArn' => '<p>The ARN of the IAM role that is applied to the app block builder.</p>', 'AppBlockBuilderAppBlockAssociation$AppBlockArn' => '<p>The ARN of the app block.</p>', 'Application$Arn' => '<p>The ARN of the application.</p>', 'Application$AppBlockArn' => '<p>The app block ARN of the application.</p>', 'ApplicationFleetAssociation$ApplicationArn' => '<p>The ARN of the application associated with the fleet.</p>', 'ArnList$member' => NULL, 'AssociateAppBlockBuilderAppBlockRequest$AppBlockArn' => '<p>The ARN of the app block.</p>', 'AssociateApplicationFleetRequest$ApplicationArn' => '<p>The ARN of the application.</p>', 'CertificateBasedAuthProperties$CertificateAuthorityArn' => '<p>The ARN of the AWS Certificate Manager Private CA resource.</p>', 'CreateAppBlockBuilderRequest$IamRoleArn' => '<p>The Amazon Resource Name (ARN) of the IAM role to apply to the app block builder. To assume a role, the app block builder calls the AWS Security Token Service (STS) <code>AssumeRole</code> API operation and passes the ARN of the role to use. The operation creates a new session with temporary credentials. AppStream 2.0 retrieves the temporary credentials and creates the <b>appstream_machine_role</b> credential profile on the instance.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html\">Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'CreateApplicationRequest$AppBlockArn' => '<p>The app block ARN to which the application should be associated</p>', 'CreateFleetRequest$ImageArn' => '<p>The ARN of the public, private, or shared image to use.</p>', 'CreateFleetRequest$IamRoleArn' => '<p>The Amazon Resource Name (ARN) of the IAM role to apply to the fleet. To assume a role, a fleet instance calls the AWS Security Token Service (STS) <code>AssumeRole</code> API operation and passes the ARN of the role to use. The operation creates a new session with temporary credentials. AppStream 2.0 retrieves the temporary credentials and creates the <b>appstream_machine_role</b> credential profile on the instance.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html\">Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'CreateImageBuilderRequest$ImageArn' => '<p>The ARN of the public, private, or shared image to use.</p>', 'CreateImageBuilderRequest$IamRoleArn' => '<p>The Amazon Resource Name (ARN) of the IAM role to apply to the image builder. To assume a role, the image builder calls the AWS Security Token Service (STS) <code>AssumeRole</code> API operation and passes the ARN of the role to use. The operation creates a new session with temporary credentials. AppStream 2.0 retrieves the temporary credentials and creates the <b>appstream_machine_role</b> credential profile on the instance.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html\">Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'DescribeAppBlockBuilderAppBlockAssociationsRequest$AppBlockArn' => '<p>The ARN of the app block.</p>', 'DescribeApplicationFleetAssociationsRequest$ApplicationArn' => '<p>The ARN of the application.</p>', 'DisassociateAppBlockBuilderAppBlockRequest$AppBlockArn' => '<p>The ARN of the app block.</p>', 'DisassociateApplicationFleetRequest$ApplicationArn' => '<p>The ARN of the application.</p>', 'Fleet$Arn' => '<p>The Amazon Resource Name (ARN) for the fleet.</p>', 'Fleet$ImageArn' => '<p>The ARN for the public, private, or shared image.</p>', 'Fleet$IamRoleArn' => '<p>The ARN of the IAM role that is applied to the fleet. To assume a role, the fleet instance calls the AWS Security Token Service (STS) <code>AssumeRole</code> API operation and passes the ARN of the role to use. The operation creates a new session with temporary credentials. AppStream 2.0 retrieves the temporary credentials and creates the <b>appstream_machine_role</b> credential profile on the instance.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html\">Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'Image$Arn' => '<p>The ARN of the image.</p>', 'Image$BaseImageArn' => '<p>The ARN of the image from which this image was created.</p>', 'ImageBuilder$Arn' => '<p>The ARN for the image builder.</p>', 'ImageBuilder$ImageArn' => '<p>The ARN of the image from which this builder was created.</p>', 'ImageBuilder$IamRoleArn' => '<p>The ARN of the IAM role that is applied to the image builder. To assume a role, the image builder calls the AWS Security Token Service (STS) <code>AssumeRole</code> API operation and passes the ARN of the role to use. The operation creates a new session with temporary credentials. AppStream 2.0 retrieves the temporary credentials and creates the <b>appstream_machine_role</b> credential profile on the instance.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html\">Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'ListTagsForResourceRequest$ResourceArn' => '<p>The Amazon Resource Name (ARN) of the resource.</p>', 'Stack$Arn' => '<p>The ARN of the stack.</p>', 'TagResourceRequest$ResourceArn' => '<p>The Amazon Resource Name (ARN) of the resource.</p>', 'UntagResourceRequest$ResourceArn' => '<p>The Amazon Resource Name (ARN) of the resource.</p>', 'UpdateAppBlockBuilderRequest$IamRoleArn' => '<p>The Amazon Resource Name (ARN) of the IAM role to apply to the app block builder. To assume a role, the app block builder calls the AWS Security Token Service (STS) <code>AssumeRole</code> API operation and passes the ARN of the role to use. The operation creates a new session with temporary credentials. AppStream 2.0 retrieves the temporary credentials and creates the <b>appstream_machine_role</b> credential profile on the instance.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html\">Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'UpdateApplicationRequest$AppBlockArn' => '<p>The ARN of the app block.</p>', 'UpdateFleetRequest$ImageArn' => '<p>The ARN of the public, private, or shared image to use.</p>', 'UpdateFleetRequest$IamRoleArn' => '<p>The Amazon Resource Name (ARN) of the IAM role to apply to the fleet. To assume a role, a fleet instance calls the AWS Security Token Service (STS) <code>AssumeRole</code> API operation and passes the ARN of the role to use. The operation creates a new session with temporary credentials. AppStream 2.0 retrieves the temporary credentials and creates the <b>appstream_machine_role</b> credential profile on the instance.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html\">Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'User$Arn' => '<p>The ARN of the user.</p>', ], ], 'ArnList' => [ 'base' => NULL, 'refs' => [ 'DescribeAppBlocksRequest$Arns' => '<p>The ARNs of the app blocks.</p>', 'DescribeApplicationsRequest$Arns' => '<p>The ARNs for the applications.</p>', 'DescribeImagesRequest$Arns' => '<p>The ARNs of the public, private, and shared images to describe.</p>', ], ], 'AssociateAppBlockBuilderAppBlockRequest' => [ 'base' => NULL, 'refs' => [], ], 'AssociateAppBlockBuilderAppBlockResult' => [ 'base' => NULL, 'refs' => [], ], 'AssociateApplicationFleetRequest' => [ 'base' => NULL, 'refs' => [], ], 'AssociateApplicationFleetResult' => [ 'base' => NULL, 'refs' => [], ], 'AssociateApplicationToEntitlementRequest' => [ 'base' => NULL, 'refs' => [], ], 'AssociateApplicationToEntitlementResult' => [ 'base' => NULL, 'refs' => [], ], 'AssociateFleetRequest' => [ 'base' => NULL, 'refs' => [], ], 'AssociateFleetResult' => [ 'base' => NULL, 'refs' => [], ], 'AuthenticationType' => [ 'base' => NULL, 'refs' => [ 'CreateUserRequest$AuthenticationType' => '<p>The authentication type for the user. You must specify USERPOOL. </p>', 'DeleteUserRequest$AuthenticationType' => '<p>The authentication type for the user. You must specify USERPOOL.</p>', 'DescribeSessionsRequest$AuthenticationType' => '<p>The authentication method. Specify <code>API</code> for a user authenticated using a streaming URL or <code>SAML</code> for a SAML federated user. The default is to authenticate users using a streaming URL.</p>', 'DescribeUserStackAssociationsRequest$AuthenticationType' => '<p>The authentication type for the user who is associated with the stack. You must specify USERPOOL.</p>', 'DescribeUsersRequest$AuthenticationType' => '<p>The authentication type for the users in the user pool to describe. You must specify USERPOOL.</p>', 'DisableUserRequest$AuthenticationType' => '<p>The authentication type for the user. You must specify USERPOOL.</p>', 'EnableUserRequest$AuthenticationType' => '<p>The authentication type for the user. You must specify USERPOOL.</p>', 'Session$AuthenticationType' => '<p>The authentication method. The user is authenticated using a streaming URL (<code>API</code>) or SAML 2.0 federation (<code>SAML</code>).</p>', 'User$AuthenticationType' => '<p>The authentication type for the user.</p>', 'UserStackAssociation$AuthenticationType' => '<p>The authentication type for the user.</p>', ], ], 'AwsAccountId' => [ 'base' => NULL, 'refs' => [ 'AwsAccountIdList$member' => NULL, 'DeleteImagePermissionsRequest$SharedAccountId' => '<p>The 12-digit identifier of the AWS account for which to delete image permissions.</p>', 'SharedImagePermissions$sharedAccountId' => '<p>The 12-digit identifier of the AWS account with which the image is shared.</p>', 'UpdateImagePermissionsRequest$SharedAccountId' => '<p>The 12-digit identifier of the AWS account for which you want add or update image permissions.</p>', ], ], 'AwsAccountIdList' => [ 'base' => NULL, 'refs' => [ 'DescribeImagePermissionsRequest$SharedAwsAccountIds' => '<p>The 12-digit identifier of one or more AWS accounts with which the image is shared.</p>', ], ], 'BatchAssociateUserStackRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchAssociateUserStackResult' => [ 'base' => NULL, 'refs' => [], ], 'BatchDisassociateUserStackRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchDisassociateUserStackResult' => [ 'base' => NULL, 'refs' => [], ], 'Boolean' => [ 'base' => NULL, 'refs' => [ 'Application$Enabled' => '<p>If there is a problem, the application can be disabled after image creation.</p>', 'ApplicationSettings$Enabled' => '<p>Enables or disables persistent application settings for users during their streaming sessions. </p>', 'ApplicationSettingsResponse$Enabled' => '<p>Specifies whether persistent application settings are enabled for users during their streaming sessions.</p>', 'CreateUpdatedImageRequest$dryRun' => '<p>Indicates whether to display the status of image update availability before AppStream 2.0 initiates the process of creating a new updated image. If this value is set to <code>true</code>, AppStream 2.0 displays whether image updates are available. If this value is set to <code>false</code>, AppStream 2.0 initiates the process of creating a new updated image without displaying whether image updates are available.</p>', 'CreateUpdatedImageResult$canUpdateImage' => '<p>Indicates whether a new image can be created.</p>', 'Image$ImageBuilderSupported' => '<p>Indicates whether an image builder can be launched from this image.</p>', 'UpdateFleetRequest$DeleteVpcConfig' => '<p>Deletes the VPC association for the specified fleet.</p>', 'UpdateStackRequest$DeleteStorageConnectors' => '<p>Deletes the storage connectors currently enabled for the stack.</p>', 'User$Enabled' => '<p>Specifies whether the user in the user pool is enabled.</p>', 'UserStackAssociation$SendEmailNotification' => '<p>Specifies whether a welcome email is sent to a user after the user is created in the user pool.</p>', ], ], 'BooleanObject' => [ 'base' => NULL, 'refs' => [ 'AppBlockBuilder$EnableDefaultInternetAccess' => '<p>Indicates whether default internet access is enabled for the app block builder.</p>', 'CreateAppBlockBuilderRequest$EnableDefaultInternetAccess' => '<p>Enables or disables default internet access for the app block builder.</p>', 'CreateFleetRequest$EnableDefaultInternetAccess' => '<p>Enables or disables default internet access for the fleet.</p>', 'CreateImageBuilderRequest$EnableDefaultInternetAccess' => '<p>Enables or disables default internet access for the image builder.</p>', 'Fleet$EnableDefaultInternetAccess' => '<p>Indicates whether default internet access is enabled for the fleet.</p>', 'ImageBuilder$EnableDefaultInternetAccess' => '<p>Enables or disables default internet access for the image builder.</p>', 'ImagePermissions$allowFleet' => '<p>Indicates whether the image can be used for a fleet.</p>', 'ImagePermissions$allowImageBuilder' => '<p>Indicates whether the image can be used for an image builder.</p>', 'UpdateAppBlockBuilderRequest$EnableDefaultInternetAccess' => '<p>Enables or disables default internet access for the app block builder.</p>', 'UpdateFleetRequest$EnableDefaultInternetAccess' => '<p>Enables or disables default internet access for the fleet.</p>', ], ], 'CertificateBasedAuthProperties' => [ 'base' => '<p>The certificate-based authentication properties used to authenticate SAML 2.0 Identity Provider (IdP) user identities to Active Directory domain-joined streaming instances. Fallback is turned on by default when certificate-based authentication is <b>Enabled</b> . Fallback allows users to log in using their AD domain password if certificate-based authentication is unsuccessful, or to unlock a desktop lock screen. <b>Enabled_no_directory_login_fallback</b> enables certificate-based authentication, but does not allow users to log in using their AD domain password. Users will be disconnected to re-authenticate using certificates.</p>', 'refs' => [ 'CreateDirectoryConfigRequest$CertificateBasedAuthProperties' => '<p>The certificate-based authentication properties used to authenticate SAML 2.0 Identity Provider (IdP) user identities to Active Directory domain-joined streaming instances. Fallback is turned on by default when certificate-based authentication is <b>Enabled</b> . Fallback allows users to log in using their AD domain password if certificate-based authentication is unsuccessful, or to unlock a desktop lock screen. <b>Enabled_no_directory_login_fallback</b> enables certificate-based authentication, but does not allow users to log in using their AD domain password. Users will be disconnected to re-authenticate using certificates.</p>', 'DirectoryConfig$CertificateBasedAuthProperties' => '<p>The certificate-based authentication properties used to authenticate SAML 2.0 Identity Provider (IdP) user identities to Active Directory domain-joined streaming instances. Fallback is turned on by default when certificate-based authentication is <b>Enabled</b> . Fallback allows users to log in using their AD domain password if certificate-based authentication is unsuccessful, or to unlock a desktop lock screen. <b>Enabled_no_directory_login_fallback</b> enables certificate-based authentication, but does not allow users to log in using their AD domain password. Users will be disconnected to re-authenticate using certificates.</p>', 'UpdateDirectoryConfigRequest$CertificateBasedAuthProperties' => '<p>The certificate-based authentication properties used to authenticate SAML 2.0 Identity Provider (IdP) user identities to Active Directory domain-joined streaming instances. Fallback is turned on by default when certificate-based authentication is <b>Enabled</b> . Fallback allows users to log in using their AD domain password if certificate-based authentication is unsuccessful, or to unlock a desktop lock screen. <b>Enabled_no_directory_login_fallback</b> enables certificate-based authentication, but does not allow users to log in using their AD domain password. Users will be disconnected to re-authenticate using certificates.</p>', ], ], 'CertificateBasedAuthStatus' => [ 'base' => NULL, 'refs' => [ 'CertificateBasedAuthProperties$Status' => '<p>The status of the certificate-based authentication properties.</p>', ], ], 'ComputeCapacity' => [ 'base' => '<p>Describes the capacity for a fleet.</p>', 'refs' => [ 'CreateFleetRequest$ComputeCapacity' => '<p>The desired capacity for the fleet. This is not allowed for Elastic fleets. For Elastic fleets, specify MaxConcurrentSessions instead.</p>', 'UpdateFleetRequest$ComputeCapacity' => '<p>The desired capacity for the fleet. This is not allowed for Elastic fleets.</p>', ], ], 'ComputeCapacityStatus' => [ 'base' => '<p>Describes the capacity status for a fleet.</p>', 'refs' => [ 'Fleet$ComputeCapacityStatus' => '<p>The capacity status for the fleet.</p>', ], ], 'ConcurrentModificationException' => [ 'base' => '<p>An API error occurred. Wait a few minutes and try again.</p>', 'refs' => [], ], 'CopyImageRequest' => [ 'base' => NULL, 'refs' => [], ], 'CopyImageResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppBlockBuilderRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppBlockBuilderResult' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppBlockBuilderStreamingURLRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppBlockBuilderStreamingURLResult' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppBlockRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppBlockResult' => [ 'base' => NULL, 'refs' => [], ], 'CreateApplicationRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateApplicationResult' => [ 'base' => NULL, 'refs' => [], ], 'CreateDirectoryConfigRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateDirectoryConfigResult' => [ 'base' => NULL, 'refs' => [], ], 'CreateEntitlementRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateEntitlementResult' => [ 'base' => NULL, 'refs' => [], ], 'CreateFleetRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateFleetResult' => [ 'base' => NULL, 'refs' => [], ], 'CreateImageBuilderRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateImageBuilderResult' => [ 'base' => NULL, 'refs' => [], ], 'CreateImageBuilderStreamingURLRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateImageBuilderStreamingURLResult' => [ 'base' => NULL, 'refs' => [], ], 'CreateStackRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateStackResult' => [ 'base' => NULL, 'refs' => [], ], 'CreateStreamingURLRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateStreamingURLResult' => [ 'base' => NULL, 'refs' => [], ], 'CreateUpdatedImageRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateUpdatedImageResult' => [ 'base' => NULL, 'refs' => [], ], 'CreateUsageReportSubscriptionRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateUsageReportSubscriptionResult' => [ 'base' => NULL, 'refs' => [], ], 'CreateUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateUserResult' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAppBlockBuilderRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAppBlockBuilderResult' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAppBlockRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAppBlockResult' => [ 'base' => NULL, 'refs' => [], ], 'DeleteApplicationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteApplicationResult' => [ 'base' => NULL, 'refs' => [], ], 'DeleteDirectoryConfigRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteDirectoryConfigResult' => [ 'base' => NULL, 'refs' => [], ], 'DeleteEntitlementRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteEntitlementResult' => [ 'base' => NULL, 'refs' => [], ], 'DeleteFleetRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteFleetResult' => [ 'base' => NULL, 'refs' => [], ], 'DeleteImageBuilderRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteImageBuilderResult' => [ 'base' => NULL, 'refs' => [], ], 'DeleteImagePermissionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteImagePermissionsResult' => [ 'base' => NULL, 'refs' => [], ], 'DeleteImageRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteImageResult' => [ 'base' => NULL, 'refs' => [], ], 'DeleteStackRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteStackResult' => [ 'base' => NULL, 'refs' => [], ], 'DeleteUsageReportSubscriptionRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteUsageReportSubscriptionResult' => [ 'base' => NULL, 'refs' => [], ], 'DeleteUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteUserResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppBlockBuilderAppBlockAssociationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppBlockBuilderAppBlockAssociationsResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppBlockBuildersRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppBlockBuildersResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppBlocksRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppBlocksResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeApplicationFleetAssociationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeApplicationFleetAssociationsResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeApplicationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeApplicationsResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeDirectoryConfigsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeDirectoryConfigsResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeEntitlementsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeEntitlementsResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeFleetsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeFleetsResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeImageBuildersRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeImageBuildersResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeImagePermissionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeImagePermissionsResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeImagesMaxResults' => [ 'base' => NULL, 'refs' => [ 'DescribeImagesRequest$MaxResults' => '<p>The maximum size of each page of results.</p>', ], ], 'DescribeImagesRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeImagesResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeSessionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeSessionsResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeStacksRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeStacksResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeUsageReportSubscriptionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeUsageReportSubscriptionsResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeUserStackAssociationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeUserStackAssociationsResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeUsersRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeUsersResult' => [ 'base' => NULL, 'refs' => [], ], 'Description' => [ 'base' => NULL, 'refs' => [ 'CopyImageRequest$DestinationImageDescription' => '<p>The description that the image will have when it is copied to the destination.</p>', 'CreateAppBlockBuilderRequest$Description' => '<p>The description of the app block builder.</p>', 'CreateAppBlockRequest$Description' => '<p>The description of the app block.</p>', 'CreateApplicationRequest$Description' => '<p>The description of the application.</p>', 'CreateEntitlementRequest$Description' => '<p>The description of the entitlement.</p>', 'CreateFleetRequest$Description' => '<p>The description to display.</p>', 'CreateImageBuilderRequest$Description' => '<p>The description to display.</p>', 'CreateStackRequest$Description' => '<p>The description to display.</p>', 'CreateUpdatedImageRequest$newImageDescription' => '<p>The description to display for the new image.</p>', 'Entitlement$Description' => '<p>The description of the entitlement.</p>', 'UpdateAppBlockBuilderRequest$Description' => '<p>The description of the app block builder.</p>', 'UpdateApplicationRequest$Description' => '<p>The description of the application.</p>', 'UpdateEntitlementRequest$Description' => '<p>The description of the entitlement.</p>', 'UpdateFleetRequest$Description' => '<p>The description to display.</p>', 'UpdateStackRequest$Description' => '<p>The description to display.</p>', ], ], 'DirectoryConfig' => [ 'base' => '<p>Describes the configuration information required to join fleets and image builders to Microsoft Active Directory domains.</p>', 'refs' => [ 'CreateDirectoryConfigResult$DirectoryConfig' => '<p>Information about the directory configuration.</p>', 'DirectoryConfigList$member' => NULL, 'UpdateDirectoryConfigResult$DirectoryConfig' => '<p>Information about the Directory Config object.</p>', ], ], 'DirectoryConfigList' => [ 'base' => NULL, 'refs' => [ 'DescribeDirectoryConfigsResult$DirectoryConfigs' => '<p>Information about the directory configurations. Note that although the response syntax in this topic includes the account password, this password is not returned in the actual response. </p>', ], ], 'DirectoryName' => [ 'base' => NULL, 'refs' => [ 'CreateDirectoryConfigRequest$DirectoryName' => '<p>The fully qualified name of the directory (for example, corp.example.com).</p>', 'DeleteDirectoryConfigRequest$DirectoryName' => '<p>The name of the directory configuration.</p>', 'DirectoryConfig$DirectoryName' => '<p>The fully qualified name of the directory (for example, corp.example.com).</p>', 'DirectoryNameList$member' => NULL, 'DomainJoinInfo$DirectoryName' => '<p>The fully qualified name of the directory (for example, corp.example.com).</p>', 'UpdateDirectoryConfigRequest$DirectoryName' => '<p>The name of the Directory Config object.</p>', ], ], 'DirectoryNameList' => [ 'base' => NULL, 'refs' => [ 'DescribeDirectoryConfigsRequest$DirectoryNames' => '<p>The directory names.</p>', ], ], 'DisableUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'DisableUserResult' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateAppBlockBuilderAppBlockRequest' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateAppBlockBuilderAppBlockResult' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateApplicationFleetRequest' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateApplicationFleetResult' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateApplicationFromEntitlementRequest' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateApplicationFromEntitlementResult' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateFleetRequest' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateFleetResult' => [ 'base' => NULL, 'refs' => [], ], 'DisplayName' => [ 'base' => NULL, 'refs' => [ 'CreateAppBlockBuilderRequest$DisplayName' => '<p>The display name of the app block builder.</p>', 'CreateAppBlockRequest$DisplayName' => '<p>The display name of the app block. This is not displayed to the user.</p>', 'CreateApplicationRequest$DisplayName' => '<p>The display name of the application. This name is visible to users in the application catalog.</p>', 'CreateFleetRequest$DisplayName' => '<p>The fleet name to display.</p>', 'CreateImageBuilderRequest$DisplayName' => '<p>The image builder name to display.</p>', 'CreateStackRequest$DisplayName' => '<p>The stack name to display.</p>', 'CreateUpdatedImageRequest$newImageDisplayName' => '<p>The name to display for the new image.</p>', 'UpdateAppBlockBuilderRequest$DisplayName' => '<p>The display name of the app block builder.</p>', 'UpdateApplicationRequest$DisplayName' => '<p>The display name of the application. This name is visible to users in the application catalog.</p>', 'UpdateFleetRequest$DisplayName' => '<p>The fleet name to display.</p>', 'UpdateStackRequest$DisplayName' => '<p>The stack name to display.</p>', ], ], 'Domain' => [ 'base' => 'GSuite domain for GDrive integration.', 'refs' => [ 'DomainList$member' => NULL, ], ], 'DomainJoinInfo' => [ 'base' => '<p>Describes the configuration information required to join fleets and image builders to Microsoft Active Directory domains.</p>', 'refs' => [ 'CreateFleetRequest$DomainJoinInfo' => '<p>The name of the directory and organizational unit (OU) to use to join the fleet to a Microsoft Active Directory domain. This is not allowed for Elastic fleets. </p>', 'CreateImageBuilderRequest$DomainJoinInfo' => '<p>The name of the directory and organizational unit (OU) to use to join the image builder to a Microsoft Active Directory domain. </p>', 'Fleet$DomainJoinInfo' => '<p>The name of the directory and organizational unit (OU) to use to join the fleet to a Microsoft Active Directory domain. </p>', 'ImageBuilder$DomainJoinInfo' => '<p>The name of the directory and organizational unit (OU) to use to join the image builder to a Microsoft Active Directory domain. </p>', 'UpdateFleetRequest$DomainJoinInfo' => '<p>The name of the directory and organizational unit (OU) to use to join the fleet to a Microsoft Active Directory domain. </p>', ], ], 'DomainList' => [ 'base' => NULL, 'refs' => [ 'StorageConnector$Domains' => '<p>The names of the domains for the account.</p>', ], ], 'EmbedHostDomain' => [ 'base' => 'Specifies a valid domain that can embed AppStream. Valid examples include: [\"testorigin.tt--com\", \"testingorigin.com.us\", \"test.com.us\"] Invalid examples include: [\"test,com\", \".com\", \"h*llo.com\". \"\"]', 'refs' => [ 'EmbedHostDomains$member' => NULL, ], ], 'EmbedHostDomains' => [ 'base' => NULL, 'refs' => [ 'CreateStackRequest$EmbedHostDomains' => '<p>The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. You must approve the domains that you want to host embedded AppStream 2.0 streaming sessions. </p>', 'Stack$EmbedHostDomains' => '<p>The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. You must approve the domains that you want to host embedded AppStream 2.0 streaming sessions.</p>', 'UpdateStackRequest$EmbedHostDomains' => '<p>The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. You must approve the domains that you want to host embedded AppStream 2.0 streaming sessions. </p>', ], ], 'EnableUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'EnableUserResult' => [ 'base' => NULL, 'refs' => [], ], 'EntitledApplication' => [ 'base' => '<p>The application associated to an entitlement. Access is controlled based on user attributes.</p>', 'refs' => [ 'EntitledApplicationList$member' => NULL, ], ], 'EntitledApplicationList' => [ 'base' => NULL, 'refs' => [ 'ListEntitledApplicationsResult$EntitledApplications' => '<p>The entitled applications.</p>', ], ], 'Entitlement' => [ 'base' => '<p>Specifies an entitlement. Entitlements control access to specific applications within a stack, based on user attributes. Entitlements apply to SAML 2.0 federated user identities. Amazon AppStream 2.0 user pool and streaming URL users are entitled to all applications in a stack. Entitlements don\\'t apply to the desktop stream view application, or to applications managed by a dynamic app provider using the Dynamic Application Framework.</p>', 'refs' => [ 'CreateEntitlementResult$Entitlement' => '<p>The entitlement.</p>', 'EntitlementList$member' => NULL, 'UpdateEntitlementResult$Entitlement' => '<p>The entitlement.</p>', ], ], 'EntitlementAlreadyExistsException' => [ 'base' => '<p>The entitlement already exists.</p>', 'refs' => [], ], 'EntitlementAttribute' => [ 'base' => '<p>An attribute associated with an entitlement. Application entitlements work by matching a supported SAML 2.0 attribute name to a value when a user identity federates to an Amazon AppStream 2.0 SAML application.</p>', 'refs' => [ 'EntitlementAttributeList$member' => NULL, ], ], 'EntitlementAttributeList' => [ 'base' => NULL, 'refs' => [ 'CreateEntitlementRequest$Attributes' => '<p>The attributes of the entitlement.</p>', 'Entitlement$Attributes' => '<p>The attributes of the entitlement.</p>', 'UpdateEntitlementRequest$Attributes' => '<p>The attributes of the entitlement.</p>', ], ], 'EntitlementList' => [ 'base' => NULL, 'refs' => [ 'DescribeEntitlementsResult$Entitlements' => '<p>The entitlements.</p>', ], ], 'EntitlementNotFoundException' => [ 'base' => '<p>The entitlement can\\'t be found.</p>', 'refs' => [], ], 'ErrorDetails' => [ 'base' => '<p>The error details.</p>', 'refs' => [ 'ErrorDetailsList$member' => NULL, ], ], 'ErrorDetailsList' => [ 'base' => NULL, 'refs' => [ 'AppBlock$AppBlockErrors' => '<p>The errors of the app block.</p>', ], ], 'ErrorMessage' => [ 'base' => '<p>The error message in the exception.</p>', 'refs' => [ 'ConcurrentModificationException$Message' => NULL, 'EntitlementAlreadyExistsException$Message' => NULL, 'EntitlementNotFoundException$Message' => NULL, 'IncompatibleImageException$Message' => NULL, 'InvalidAccountStatusException$Message' => NULL, 'InvalidParameterCombinationException$Message' => NULL, 'InvalidRoleException$Message' => NULL, 'LimitExceededException$Message' => NULL, 'OperationNotPermittedException$Message' => NULL, 'RequestLimitExceededException$Message' => NULL, 'ResourceAlreadyExistsException$Message' => NULL, 'ResourceInUseException$Message' => NULL, 'ResourceNotAvailableException$Message' => NULL, 'ResourceNotFoundException$Message' => NULL, ], ], 'ExpireSessionRequest' => [ 'base' => NULL, 'refs' => [], ], 'ExpireSessionResult' => [ 'base' => NULL, 'refs' => [], ], 'FeedbackURL' => [ 'base' => NULL, 'refs' => [ 'CreateStackRequest$FeedbackURL' => '<p>The URL that users are redirected to after they click the Send Feedback link. If no URL is specified, no Send Feedback link is displayed.</p>', 'Stack$FeedbackURL' => '<p>The URL that users are redirected to after they click the Send Feedback link. If no URL is specified, no Send Feedback link is displayed.</p>', 'UpdateStackRequest$FeedbackURL' => '<p>The URL that users are redirected to after they choose the Send Feedback link. If no URL is specified, no Send Feedback link is displayed.</p>', ], ], 'Fleet' => [ 'base' => '<p>Describes a fleet.</p>', 'refs' => [ 'CreateFleetResult$Fleet' => '<p>Information about the fleet.</p>', 'FleetList$member' => NULL, 'UpdateFleetResult$Fleet' => '<p>Information about the fleet.</p>', ], ], 'FleetAttribute' => [ 'base' => '<p>The fleet attribute.</p>', 'refs' => [ 'FleetAttributes$member' => NULL, ], ], 'FleetAttributes' => [ 'base' => '<p>The fleet attributes.</p>', 'refs' => [ 'UpdateFleetRequest$AttributesToDelete' => '<p>The fleet attributes to delete.</p>', ], ], 'FleetError' => [ 'base' => '<p>Describes a fleet error.</p>', 'refs' => [ 'FleetErrors$member' => NULL, ], ], 'FleetErrorCode' => [ 'base' => NULL, 'refs' => [ 'FleetError$ErrorCode' => '<p>The error code.</p>', 'ResourceError$ErrorCode' => '<p>The error code.</p>', ], ], 'FleetErrors' => [ 'base' => NULL, 'refs' => [ 'Fleet$FleetErrors' => '<p>The fleet errors.</p>', ], ], 'FleetList' => [ 'base' => '<p>The fleets.</p>', 'refs' => [ 'DescribeFleetsResult$Fleets' => '<p>Information about the fleets.</p>', ], ], 'FleetState' => [ 'base' => NULL, 'refs' => [ 'Fleet$State' => '<p>The current state for the fleet.</p>', ], ], 'FleetType' => [ 'base' => NULL, 'refs' => [ 'CreateFleetRequest$FleetType' => '<p>The fleet type.</p> <dl> <dt>ALWAYS_ON</dt> <dd> <p>Provides users with instant-on access to their apps. You are charged for all running instances in your fleet, even if no users are streaming apps.</p> </dd> <dt>ON_DEMAND</dt> <dd> <p>Provide users with access to applications after they connect, which takes one to two minutes. You are charged for instance streaming when users are connected and a small hourly fee for instances that are not streaming apps.</p> </dd> </dl>', 'Fleet$FleetType' => '<p>The fleet type.</p> <dl> <dt>ALWAYS_ON</dt> <dd> <p>Provides users with instant-on access to their apps. You are charged for all running instances in your fleet, even if no users are streaming apps.</p> </dd> <dt>ON_DEMAND</dt> <dd> <p>Provide users with access to applications after they connect, which takes one to two minutes. You are charged for instance streaming when users are connected and a small hourly fee for instances that are not streaming apps.</p> </dd> </dl>', ], ], 'Image' => [ 'base' => '<p>Describes an image.</p>', 'refs' => [ 'CreateUpdatedImageResult$image' => NULL, 'DeleteImageResult$Image' => '<p>Information about the image.</p>', 'ImageList$member' => NULL, ], ], 'ImageBuilder' => [ 'base' => '<p>Describes a virtual machine that is used to create an image. </p>', 'refs' => [ 'CreateImageBuilderResult$ImageBuilder' => '<p>Information about the image builder.</p>', 'DeleteImageBuilderResult$ImageBuilder' => '<p>Information about the image builder.</p>', 'ImageBuilderList$member' => NULL, 'StartImageBuilderResult$ImageBuilder' => '<p>Information about the image builder.</p>', 'StopImageBuilderResult$ImageBuilder' => '<p>Information about the image builder.</p>', ], ], 'ImageBuilderList' => [ 'base' => NULL, 'refs' => [ 'DescribeImageBuildersResult$ImageBuilders' => '<p>Information about the image builders.</p>', ], ], 'ImageBuilderState' => [ 'base' => NULL, 'refs' => [ 'ImageBuilder$State' => '<p>The state of the image builder.</p>', ], ], 'ImageBuilderStateChangeReason' => [ 'base' => '<p>Describes the reason why the last image builder state change occurred.</p>', 'refs' => [ 'ImageBuilder$StateChangeReason' => '<p>The reason why the last state change occurred.</p>', ], ], 'ImageBuilderStateChangeReasonCode' => [ 'base' => NULL, 'refs' => [ 'ImageBuilderStateChangeReason$Code' => '<p>The state change reason code.</p>', ], ], 'ImageList' => [ 'base' => NULL, 'refs' => [ 'DescribeImagesResult$Images' => '<p>Information about the images.</p>', ], ], 'ImagePermissions' => [ 'base' => '<p>Describes the permissions for an image. </p>', 'refs' => [ 'Image$ImagePermissions' => '<p>The permissions to provide to the destination AWS account for the specified image.</p>', 'SharedImagePermissions$imagePermissions' => '<p>Describes the permissions for a shared image.</p>', 'UpdateImagePermissionsRequest$ImagePermissions' => '<p>The permissions for the image.</p>', ], ], 'ImageState' => [ 'base' => NULL, 'refs' => [ 'Image$State' => '<p>The image starts in the <code>PENDING</code> state. If image creation succeeds, the state is <code>AVAILABLE</code>. If image creation fails, the state is <code>FAILED</code>.</p>', ], ], 'ImageStateChangeReason' => [ 'base' => '<p>Describes the reason why the last image state change occurred.</p>', 'refs' => [ 'Image$StateChangeReason' => '<p>The reason why the last state change occurred.</p>', ], ], 'ImageStateChangeReasonCode' => [ 'base' => NULL, 'refs' => [ 'ImageStateChangeReason$Code' => '<p>The state change reason code.</p>', ], ], 'IncompatibleImageException' => [ 'base' => '<p>The image can\\'t be updated because it\\'s not compatible for updates.</p>', 'refs' => [], ], 'Integer' => [ 'base' => NULL, 'refs' => [ 'ComputeCapacity$DesiredInstances' => '<p>The desired number of streaming instances.</p>', 'ComputeCapacityStatus$Desired' => '<p>The desired number of streaming instances.</p>', 'ComputeCapacityStatus$Running' => '<p>The total number of simultaneous streaming instances that are running.</p>', 'ComputeCapacityStatus$InUse' => '<p>The number of instances in use for streaming.</p>', 'ComputeCapacityStatus$Available' => '<p>The number of currently available instances that can be used to stream sessions.</p>', 'CreateFleetRequest$MaxUserDurationInSeconds' => '<p>The maximum amount of time that a streaming session can remain active, in seconds. If users are still connected to a streaming instance five minutes before this limit is reached, they are prompted to save any open documents before being disconnected. After this time elapses, the instance is terminated and replaced by a new instance.</p> <p>Specify a value between 600 and 360000.</p>', 'CreateFleetRequest$DisconnectTimeoutInSeconds' => '<p>The amount of time that a streaming session remains active after users disconnect. If users try to reconnect to the streaming session after a disconnection or network interruption within this time interval, they are connected to their previous session. Otherwise, they are connected to a new session with a new streaming instance. </p> <p>Specify a value between 60 and 360000.</p>', 'CreateFleetRequest$IdleDisconnectTimeoutInSeconds' => '<p>The amount of time that users can be idle (inactive) before they are disconnected from their streaming session and the <code>DisconnectTimeoutInSeconds</code> time interval begins. Users are notified before they are disconnected due to inactivity. If they try to reconnect to the streaming session before the time interval specified in <code>DisconnectTimeoutInSeconds</code> elapses, they are connected to their previous session. Users are considered idle when they stop providing keyboard or mouse input during their streaming session. File uploads and downloads, audio in, audio out, and pixels changing do not qualify as user activity. If users continue to be idle after the time interval in <code>IdleDisconnectTimeoutInSeconds</code> elapses, they are disconnected.</p> <p>To prevent users from being disconnected due to inactivity, specify a value of 0. Otherwise, specify a value between 60 and 3600. The default value is 0.</p> <note> <p>If you enable this feature, we recommend that you specify a value that corresponds exactly to a whole number of minutes (for example, 60, 120, and 180). If you don\\'t do this, the value is rounded to the nearest minute. For example, if you specify a value of 70, users are disconnected after 1 minute of inactivity. If you specify a value that is at the midpoint between two different minutes, the value is rounded up. For example, if you specify a value of 90, users are disconnected after 2 minutes of inactivity. </p> </note>', 'CreateFleetRequest$MaxConcurrentSessions' => '<p>The maximum concurrent sessions of the Elastic fleet. This is required for Elastic fleets, and not allowed for other fleet types.</p>', 'DescribeAppBlockBuilderAppBlockAssociationsRequest$MaxResults' => '<p>The maximum size of each page of results.</p>', 'DescribeAppBlockBuildersRequest$MaxResults' => '<p>The maximum size of each page of results. The maximum value is 25.</p>', 'DescribeAppBlocksRequest$MaxResults' => '<p>The maximum size of each page of results.</p>', 'DescribeApplicationFleetAssociationsRequest$MaxResults' => '<p>The maximum size of each page of results.</p>', 'DescribeApplicationsRequest$MaxResults' => '<p>The maximum size of each page of results.</p>', 'DescribeDirectoryConfigsRequest$MaxResults' => '<p>The maximum size of each page of results.</p>', 'DescribeEntitlementsRequest$MaxResults' => '<p>The maximum size of each page of results.</p>', 'DescribeImageBuildersRequest$MaxResults' => '<p>The maximum size of each page of results.</p>', 'DescribeSessionsRequest$Limit' => '<p>The size of each page of results. The default value is 20 and the maximum value is 50.</p>', 'DescribeUsageReportSubscriptionsRequest$MaxResults' => '<p>The maximum size of each page of results.</p>', 'DescribeUsersRequest$MaxResults' => '<p>The maximum size of each page of results.</p>', 'Fleet$MaxUserDurationInSeconds' => '<p>The maximum amount of time that a streaming session can remain active, in seconds. If users are still connected to a streaming instance five minutes before this limit is reached, they are prompted to save any open documents before being disconnected. After this time elapses, the instance is terminated and replaced by a new instance. </p> <p>Specify a value between 600 and 360000.</p>', 'Fleet$DisconnectTimeoutInSeconds' => '<p>The amount of time that a streaming session remains active after users disconnect. If they try to reconnect to the streaming session after a disconnection or network interruption within this time interval, they are connected to their previous session. Otherwise, they are connected to a new session with a new streaming instance.</p> <p>Specify a value between 60 and 360000.</p>', 'Fleet$IdleDisconnectTimeoutInSeconds' => '<p>The amount of time that users can be idle (inactive) before they are disconnected from their streaming session and the <code>DisconnectTimeoutInSeconds</code> time interval begins. Users are notified before they are disconnected due to inactivity. If users try to reconnect to the streaming session before the time interval specified in <code>DisconnectTimeoutInSeconds</code> elapses, they are connected to their previous session. Users are considered idle when they stop providing keyboard or mouse input during their streaming session. File uploads and downloads, audio in, audio out, and pixels changing do not qualify as user activity. If users continue to be idle after the time interval in <code>IdleDisconnectTimeoutInSeconds</code> elapses, they are disconnected.</p> <p>To prevent users from being disconnected due to inactivity, specify a value of 0. Otherwise, specify a value between 60 and 3600. The default value is 0.</p> <note> <p>If you enable this feature, we recommend that you specify a value that corresponds exactly to a whole number of minutes (for example, 60, 120, and 180). If you don\\'t do this, the value is rounded to the nearest minute. For example, if you specify a value of 70, users are disconnected after 1 minute of inactivity. If you specify a value that is at the midpoint between two different minutes, the value is rounded up. For example, if you specify a value of 90, users are disconnected after 2 minutes of inactivity. </p> </note>', 'Fleet$MaxConcurrentSessions' => '<p>The maximum number of concurrent sessions for the fleet.</p>', 'ListEntitledApplicationsRequest$MaxResults' => '<p>The maximum size of each page of results.</p>', 'ScriptDetails$TimeoutInSeconds' => '<p>The run timeout, in seconds, for the script.</p>', 'UpdateFleetRequest$MaxUserDurationInSeconds' => '<p>The maximum amount of time that a streaming session can remain active, in seconds. If users are still connected to a streaming instance five minutes before this limit is reached, they are prompted to save any open documents before being disconnected. After this time elapses, the instance is terminated and replaced by a new instance.</p> <p>Specify a value between 600 and 432000.</p>', 'UpdateFleetRequest$DisconnectTimeoutInSeconds' => '<p>The amount of time that a streaming session remains active after users disconnect. If users try to reconnect to the streaming session after a disconnection or network interruption within this time interval, they are connected to their previous session. Otherwise, they are connected to a new session with a new streaming instance. </p> <p>Specify a value between 60 and 360000.</p>', 'UpdateFleetRequest$IdleDisconnectTimeoutInSeconds' => '<p>The amount of time that users can be idle (inactive) before they are disconnected from their streaming session and the <code>DisconnectTimeoutInSeconds</code> time interval begins. Users are notified before they are disconnected due to inactivity. If users try to reconnect to the streaming session before the time interval specified in <code>DisconnectTimeoutInSeconds</code> elapses, they are connected to their previous session. Users are considered idle when they stop providing keyboard or mouse input during their streaming session. File uploads and downloads, audio in, audio out, and pixels changing do not qualify as user activity. If users continue to be idle after the time interval in <code>IdleDisconnectTimeoutInSeconds</code> elapses, they are disconnected. </p> <p>To prevent users from being disconnected due to inactivity, specify a value of 0. Otherwise, specify a value between 60 and 3600. The default value is 0.</p> <note> <p>If you enable this feature, we recommend that you specify a value that corresponds exactly to a whole number of minutes (for example, 60, 120, and 180). If you don\\'t do this, the value is rounded to the nearest minute. For example, if you specify a value of 70, users are disconnected after 1 minute of inactivity. If you specify a value that is at the midpoint between two different minutes, the value is rounded up. For example, if you specify a value of 90, users are disconnected after 2 minutes of inactivity. </p> </note>', 'UpdateFleetRequest$MaxConcurrentSessions' => '<p>The maximum number of concurrent sessions for a fleet.</p>', ], ], 'InvalidAccountStatusException' => [ 'base' => '<p>The resource cannot be created because your AWS account is suspended. For assistance, contact AWS Support. </p>', 'refs' => [], ], 'InvalidParameterCombinationException' => [ 'base' => '<p>Indicates an incorrect combination of parameters, or a missing parameter.</p>', 'refs' => [], ], 'InvalidRoleException' => [ 'base' => '<p>The specified role is invalid.</p>', 'refs' => [], ], 'LastReportGenerationExecutionError' => [ 'base' => '<p>Describes the error that is returned when a usage report can\\'t be generated.</p>', 'refs' => [ 'LastReportGenerationExecutionErrors$member' => NULL, ], ], 'LastReportGenerationExecutionErrors' => [ 'base' => NULL, 'refs' => [ 'UsageReportSubscription$SubscriptionErrors' => '<p>The errors that were returned if usage reports couldn\\'t be generated.</p>', ], ], 'LimitExceededException' => [ 'base' => '<p>The requested limit exceeds the permitted limit for an account.</p>', 'refs' => [], ], 'ListAssociatedFleetsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAssociatedFleetsResult' => [ 'base' => NULL, 'refs' => [], ], 'ListAssociatedStacksRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAssociatedStacksResult' => [ 'base' => NULL, 'refs' => [], ], 'ListEntitledApplicationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListEntitledApplicationsResult' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'Long' => [ 'base' => NULL, 'refs' => [ 'CreateAppBlockBuilderStreamingURLRequest$Validity' => '<p>The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. The default is 3600 seconds.</p>', 'CreateImageBuilderStreamingURLRequest$Validity' => '<p>The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. The default is 3600 seconds.</p>', 'CreateStreamingURLRequest$Validity' => '<p>The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. The default is 60 seconds.</p>', ], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'DescribeImagePermissionsRequest$MaxResults' => '<p>The maximum size of each page of results.</p>', 'DescribeUserStackAssociationsRequest$MaxResults' => '<p>The maximum size of each page of results.</p>', ], ], 'MessageAction' => [ 'base' => NULL, 'refs' => [ 'CreateUserRequest$MessageAction' => '<p>The action to take for the welcome email that is sent to a user after the user is created in the user pool. If you specify SUPPRESS, no email is sent. If you specify RESEND, do not specify the first name or last name of the user. If the value is null, the email is sent. </p> <note> <p>The temporary password in the welcome email is valid for only 7 days. If users don\u00e2\u20ac\u2122t set their passwords within 7 days, you must send them a new welcome email.</p> </note>', ], ], 'Metadata' => [ 'base' => NULL, 'refs' => [ 'Application$Metadata' => '<p>Additional attributes that describe the application.</p>', ], ], 'Name' => [ 'base' => NULL, 'refs' => [ 'AppBlockBuilderAppBlockAssociation$AppBlockBuilderName' => '<p>The name of the app block builder.</p>', 'AssociateAppBlockBuilderAppBlockRequest$AppBlockBuilderName' => '<p>The name of the app block builder.</p>', 'AssociateApplicationFleetRequest$FleetName' => '<p>The name of the fleet.</p>', 'AssociateApplicationToEntitlementRequest$StackName' => '<p>The name of the stack.</p>', 'AssociateApplicationToEntitlementRequest$EntitlementName' => '<p>The name of the entitlement.</p>', 'CopyImageRequest$SourceImageName' => '<p>The name of the image to copy.</p>', 'CopyImageRequest$DestinationImageName' => '<p>The name that the image will have when it is copied to the destination.</p>', 'CopyImageResponse$DestinationImageName' => '<p>The name of the destination image.</p>', 'CreateAppBlockBuilderRequest$Name' => '<p>The unique name for the app block builder.</p>', 'CreateAppBlockBuilderStreamingURLRequest$AppBlockBuilderName' => '<p>The name of the app block builder.</p>', 'CreateAppBlockRequest$Name' => '<p>The name of the app block.</p>', 'CreateApplicationRequest$Name' => '<p>The name of the application. This name is visible to users when display name is not specified.</p>', 'CreateEntitlementRequest$Name' => '<p>The name of the entitlement.</p>', 'CreateEntitlementRequest$StackName' => '<p>The name of the stack with which the entitlement is associated.</p>', 'CreateFleetRequest$Name' => '<p>A unique name for the fleet.</p>', 'CreateFleetRequest$ImageName' => '<p>The name of the image used to create the fleet.</p>', 'CreateImageBuilderRequest$Name' => '<p>A unique name for the image builder.</p>', 'CreateStackRequest$Name' => '<p>The name of the stack.</p>', 'CreateUpdatedImageRequest$existingImageName' => '<p>The name of the image to update.</p>', 'CreateUpdatedImageRequest$newImageName' => '<p>The name of the new image. The name must be unique within the AWS account and Region.</p>', 'DeleteAppBlockBuilderRequest$Name' => '<p>The name of the app block builder.</p>', 'DeleteAppBlockRequest$Name' => '<p>The name of the app block.</p>', 'DeleteApplicationRequest$Name' => '<p>The name of the application.</p>', 'DeleteEntitlementRequest$Name' => '<p>The name of the entitlement.</p>', 'DeleteEntitlementRequest$StackName' => '<p>The name of the stack with which the entitlement is associated.</p>', 'DeleteImageBuilderRequest$Name' => '<p>The name of the image builder.</p>', 'DeleteImagePermissionsRequest$Name' => '<p>The name of the private image.</p>', 'DeleteImageRequest$Name' => '<p>The name of the image.</p>', 'DescribeAppBlockBuilderAppBlockAssociationsRequest$AppBlockBuilderName' => '<p>The name of the app block builder.</p>', 'DescribeApplicationFleetAssociationsRequest$FleetName' => '<p>The name of the fleet.</p>', 'DescribeEntitlementsRequest$Name' => '<p>The name of the entitlement.</p>', 'DescribeEntitlementsRequest$StackName' => '<p>The name of the stack with which the entitlement is associated.</p>', 'DescribeImagePermissionsRequest$Name' => '<p>The name of the private image for which to describe permissions. The image must be one that you own. </p>', 'DescribeImagePermissionsResult$Name' => '<p>The name of the private image.</p>', 'DisassociateAppBlockBuilderAppBlockRequest$AppBlockBuilderName' => '<p>The name of the app block builder.</p>', 'DisassociateApplicationFleetRequest$FleetName' => '<p>The name of the fleet.</p>', 'DisassociateApplicationFromEntitlementRequest$StackName' => '<p>The name of the stack with which the entitlement is associated.</p>', 'DisassociateApplicationFromEntitlementRequest$EntitlementName' => '<p>The name of the entitlement.</p>', 'Entitlement$Name' => '<p>The name of the entitlement.</p>', 'Entitlement$StackName' => '<p>The name of the stack with which the entitlement is associated.</p>', 'ListEntitledApplicationsRequest$StackName' => '<p>The name of the stack with which the entitlement is associated.</p>', 'ListEntitledApplicationsRequest$EntitlementName' => '<p>The name of the entitlement.</p>', 'StartAppBlockBuilderRequest$Name' => '<p>The name of the app block builder.</p>', 'StopAppBlockBuilderRequest$Name' => '<p>The name of the app block builder.</p>', 'UpdateAppBlockBuilderRequest$Name' => '<p>The unique name for the app block builder.</p>', 'UpdateApplicationRequest$Name' => '<p>The name of the application. This name is visible to users when display name is not specified.</p>', 'UpdateEntitlementRequest$Name' => '<p>The name of the entitlement.</p>', 'UpdateEntitlementRequest$StackName' => '<p>The name of the stack with which the entitlement is associated.</p>', 'UpdateImagePermissionsRequest$Name' => '<p>The name of the private image.</p>', ], ], 'NetworkAccessConfiguration' => [ 'base' => '<p>Describes the network details of the fleet or image builder instance.</p>', 'refs' => [ 'ImageBuilder$NetworkAccessConfiguration' => NULL, 'Session$NetworkAccessConfiguration' => '<p>The network details for the streaming session.</p>', ], ], 'OperationNotPermittedException' => [ 'base' => '<p>The attempted operation is not permitted.</p>', 'refs' => [], ], 'OrganizationalUnitDistinguishedName' => [ 'base' => NULL, 'refs' => [ 'DomainJoinInfo$OrganizationalUnitDistinguishedName' => '<p>The distinguished name of the organizational unit for computer accounts.</p>', 'OrganizationalUnitDistinguishedNamesList$member' => NULL, ], ], 'OrganizationalUnitDistinguishedNamesList' => [ 'base' => NULL, 'refs' => [ 'CreateDirectoryConfigRequest$OrganizationalUnitDistinguishedNames' => '<p>The distinguished names of the organizational units for computer accounts.</p>', 'DirectoryConfig$OrganizationalUnitDistinguishedNames' => '<p>The distinguished names of the organizational units for computer accounts.</p>', 'UpdateDirectoryConfigRequest$OrganizationalUnitDistinguishedNames' => '<p>The distinguished names of the organizational units for computer accounts.</p>', ], ], 'PackagingType' => [ 'base' => NULL, 'refs' => [ 'AppBlock$PackagingType' => '<p>The packaging type of the app block.</p>', 'CreateAppBlockRequest$PackagingType' => '<p>The packaging type of the app block.</p>', ], ], 'Permission' => [ 'base' => NULL, 'refs' => [ 'UserSetting$Permission' => '<p>Indicates whether the action is enabled or disabled.</p>', ], ], 'PlatformType' => [ 'base' => NULL, 'refs' => [ 'CreateFleetRequest$Platform' => '<p>The fleet platform. WINDOWS_SERVER_2019 and AMAZON_LINUX2 are supported for Elastic fleets. </p>', 'Fleet$Platform' => '<p>The platform of the fleet.</p>', 'Image$Platform' => '<p>The operating system platform of the image.</p>', 'ImageBuilder$Platform' => '<p>The operating system platform of the image builder.</p>', 'Platforms$member' => NULL, 'UpdateAppBlockBuilderRequest$Platform' => '<p>The platform of the app block builder.</p> <p> <code>WINDOWS_SERVER_2019</code> is the only valid value.</p>', 'UpdateFleetRequest$Platform' => '<p>The platform of the fleet. WINDOWS_SERVER_2019 and AMAZON_LINUX2 are supported for Elastic fleets. </p>', ], ], 'Platforms' => [ 'base' => NULL, 'refs' => [ 'Application$Platforms' => '<p>The platforms on which the application can run.</p>', 'CreateApplicationRequest$Platforms' => '<p>The platforms the application supports. WINDOWS_SERVER_2019 and AMAZON_LINUX2 are supported for Elastic fleets.</p>', ], ], 'PreferredProtocol' => [ 'base' => NULL, 'refs' => [ 'StreamingExperienceSettings$PreferredProtocol' => '<p>The preferred protocol that you want to use while streaming your application.</p>', ], ], 'RedirectURL' => [ 'base' => NULL, 'refs' => [ 'CreateStackRequest$RedirectURL' => '<p>The URL that users are redirected to after their streaming session ends.</p>', 'Stack$RedirectURL' => '<p>The URL that users are redirected to after their streaming session ends.</p>', 'UpdateStackRequest$RedirectURL' => '<p>The URL that users are redirected to after their streaming session ends.</p>', ], ], 'RegionName' => [ 'base' => NULL, 'refs' => [ 'CopyImageRequest$DestinationRegion' => '<p>The destination region to which the image will be copied. This parameter is required, even if you are copying an image within the same region.</p>', ], ], 'RequestLimitExceededException' => [ 'base' => '<p>AppStream 2.0 can\u00e2\u20ac\u2122t process the request right now because the Describe calls from your AWS account are being throttled by Amazon EC2. Try again later.</p>', 'refs' => [], ], 'ResourceAlreadyExistsException' => [ 'base' => '<p>The specified resource already exists.</p>', 'refs' => [], ], 'ResourceError' => [ 'base' => '<p>Describes a resource error.</p>', 'refs' => [ 'ResourceErrors$member' => NULL, ], ], 'ResourceErrors' => [ 'base' => NULL, 'refs' => [ 'AppBlockBuilder$AppBlockBuilderErrors' => '<p>The app block builder errors.</p>', 'Image$ImageErrors' => '<p>Describes the errors that are returned when a new image can\\'t be created.</p>', 'ImageBuilder$ImageBuilderErrors' => '<p>The image builder errors.</p>', ], ], 'ResourceIdentifier' => [ 'base' => '<p>The ARN of the resource.</p>', 'refs' => [ 'StorageConnector$ResourceIdentifier' => '<p>The ARN of the storage connector.</p>', ], ], 'ResourceInUseException' => [ 'base' => '<p>The specified resource is in use.</p>', 'refs' => [], ], 'ResourceNotAvailableException' => [ 'base' => '<p>The specified resource exists and is not in use, but isn\\'t available.</p>', 'refs' => [], ], 'ResourceNotFoundException' => [ 'base' => '<p>The specified resource was not found.</p>', 'refs' => [], ], 'S3Bucket' => [ 'base' => NULL, 'refs' => [ 'S3Location$S3Bucket' => '<p>The S3 bucket of the S3 object.</p>', ], ], 'S3Key' => [ 'base' => NULL, 'refs' => [ 'S3Location$S3Key' => '<p>The S3 key of the S3 object.</p> <p>This is required when used for the following:</p> <ul> <li> <p>IconS3Location (Actions: CreateApplication and UpdateApplication)</p> </li> <li> <p>SessionScriptS3Location (Actions: CreateFleet and UpdateFleet)</p> </li> <li> <p>ScriptDetails (Actions: CreateAppBlock)</p> </li> <li> <p>SourceS3Location when creating an app block with <code>CUSTOM</code> PackagingType (Actions: CreateAppBlock)</p> </li> <li> <p>SourceS3Location when creating an app block with <code>APPSTREAM2</code> PackagingType, and using an existing application package (VHD file). In this case, <code>S3Key</code> refers to the VHD file. If a new application package is required, then <code>S3Key</code> is not required. (Actions: CreateAppBlock)</p> </li> </ul>', ], ], 'S3Location' => [ 'base' => '<p>Describes the S3 location.</p>', 'refs' => [ 'AppBlock$SourceS3Location' => '<p>The source S3 location of the app block.</p>', 'Application$IconS3Location' => '<p>The S3 location of the application icon.</p>', 'CreateAppBlockRequest$SourceS3Location' => '<p>The source S3 location of the app block.</p>', 'CreateApplicationRequest$IconS3Location' => '<p>The location in S3 of the application icon.</p>', 'CreateFleetRequest$SessionScriptS3Location' => '<p>The S3 location of the session scripts configuration zip file. This only applies to Elastic fleets.</p>', 'Fleet$SessionScriptS3Location' => '<p>The S3 location of the session scripts configuration zip file. This only applies to Elastic fleets.</p>', 'ScriptDetails$ScriptS3Location' => '<p>The S3 object location for the script.</p>', 'UpdateApplicationRequest$IconS3Location' => '<p>The icon S3 location of the application.</p>', 'UpdateFleetRequest$SessionScriptS3Location' => '<p>The S3 location of the session scripts configuration zip file. This only applies to Elastic fleets. </p>', ], ], 'ScriptDetails' => [ 'base' => '<p>Describes the details of the script.</p>', 'refs' => [ 'AppBlock$SetupScriptDetails' => '<p>The setup script details of the app block.</p> <p>This only applies to app blocks with PackagingType <code>CUSTOM</code>.</p>', 'AppBlock$PostSetupScriptDetails' => '<p>The post setup script details of the app block.</p> <p>This only applies to app blocks with PackagingType <code>APPSTREAM2</code>.</p>', 'CreateAppBlockRequest$SetupScriptDetails' => '<p>The setup script details of the app block. This must be provided for the <code>CUSTOM</code> PackagingType.</p>', 'CreateAppBlockRequest$PostSetupScriptDetails' => '<p>The post setup script details of the app block. This can only be provided for the <code>APPSTREAM2</code> PackagingType.</p>', ], ], 'SecurityGroupIdList' => [ 'base' => '<p>The security group identifiers.</p>', 'refs' => [ 'VpcConfig$SecurityGroupIds' => '<p>The identifiers of the security groups for the fleet or image builder.</p>', ], ], 'ServiceAccountCredentials' => [ 'base' => '<p>Describes the credentials for the service account used by the fleet or image builder to connect to the directory.</p>', 'refs' => [ 'CreateDirectoryConfigRequest$ServiceAccountCredentials' => '<p>The credentials for the service account used by the fleet or image builder to connect to the directory.</p>', 'DirectoryConfig$ServiceAccountCredentials' => '<p>The credentials for the service account used by the fleet or image builder to connect to the directory.</p>', 'UpdateDirectoryConfigRequest$ServiceAccountCredentials' => '<p>The credentials for the service account used by the fleet or image builder to connect to the directory.</p>', ], ], 'Session' => [ 'base' => '<p>Describes a streaming session.</p>', 'refs' => [ 'SessionList$member' => NULL, ], ], 'SessionConnectionState' => [ 'base' => NULL, 'refs' => [ 'Session$ConnectionState' => '<p>Specifies whether a user is connected to the streaming session.</p>', ], ], 'SessionList' => [ 'base' => '<p>List of sessions.</p>', 'refs' => [ 'DescribeSessionsResult$Sessions' => '<p>Information about the streaming sessions.</p>', ], ], 'SessionState' => [ 'base' => '<p>Possible values for the state of a streaming session.</p>', 'refs' => [ 'Session$State' => '<p>The current state of the streaming session.</p>', ], ], 'SettingsGroup' => [ 'base' => NULL, 'refs' => [ 'ApplicationSettings$SettingsGroup' => '<p>The path prefix for the S3 bucket where users\u00e2\u20ac\u2122 persistent application settings are stored. You can allow the same persistent application settings to be used across multiple stacks by specifying the same settings group for each stack. </p>', 'ApplicationSettingsResponse$SettingsGroup' => '<p>The path prefix for the S3 bucket where users\u00e2\u20ac\u2122 persistent application settings are stored.</p>', ], ], 'SharedImagePermissions' => [ 'base' => '<p>Describes the permissions that are available to the specified AWS account for a shared image.</p>', 'refs' => [ 'SharedImagePermissionsList$member' => NULL, ], ], 'SharedImagePermissionsList' => [ 'base' => NULL, 'refs' => [ 'DescribeImagePermissionsResult$SharedImagePermissionsList' => '<p>The permissions for a private image that you own. </p>', ], ], 'Stack' => [ 'base' => '<p>Describes a stack.</p>', 'refs' => [ 'CreateStackResult$Stack' => '<p>Information about the stack.</p>', 'StackList$member' => NULL, 'UpdateStackResult$Stack' => '<p>Information about the stack.</p>', ], ], 'StackAttribute' => [ 'base' => NULL, 'refs' => [ 'StackAttributes$member' => NULL, ], ], 'StackAttributes' => [ 'base' => NULL, 'refs' => [ 'UpdateStackRequest$AttributesToDelete' => '<p>The stack attributes to delete.</p>', ], ], 'StackError' => [ 'base' => '<p>Describes a stack error.</p>', 'refs' => [ 'StackErrors$member' => NULL, ], ], 'StackErrorCode' => [ 'base' => NULL, 'refs' => [ 'StackError$ErrorCode' => '<p>The error code.</p>', ], ], 'StackErrors' => [ 'base' => '<p>The stack errors.</p>', 'refs' => [ 'Stack$StackErrors' => '<p>The errors for the stack.</p>', ], ], 'StackList' => [ 'base' => '<p>The stacks.</p>', 'refs' => [ 'DescribeStacksResult$Stacks' => '<p>Information about the stacks.</p>', ], ], 'StartAppBlockBuilderRequest' => [ 'base' => NULL, 'refs' => [], ], 'StartAppBlockBuilderResult' => [ 'base' => NULL, 'refs' => [], ], 'StartFleetRequest' => [ 'base' => NULL, 'refs' => [], ], 'StartFleetResult' => [ 'base' => NULL, 'refs' => [], ], 'StartImageBuilderRequest' => [ 'base' => NULL, 'refs' => [], ], 'StartImageBuilderResult' => [ 'base' => NULL, 'refs' => [], ], 'StopAppBlockBuilderRequest' => [ 'base' => NULL, 'refs' => [], ], 'StopAppBlockBuilderResult' => [ 'base' => NULL, 'refs' => [], ], 'StopFleetRequest' => [ 'base' => NULL, 'refs' => [], ], 'StopFleetResult' => [ 'base' => NULL, 'refs' => [], ], 'StopImageBuilderRequest' => [ 'base' => NULL, 'refs' => [], ], 'StopImageBuilderResult' => [ 'base' => NULL, 'refs' => [], ], 'StorageConnector' => [ 'base' => '<p>Describes a connector that enables persistent storage for users.</p>', 'refs' => [ 'StorageConnectorList$member' => NULL, ], ], 'StorageConnectorList' => [ 'base' => '<p>The storage connectors.</p>', 'refs' => [ 'CreateStackRequest$StorageConnectors' => '<p>The storage connectors to enable.</p>', 'Stack$StorageConnectors' => '<p>The storage connectors to enable.</p>', 'UpdateStackRequest$StorageConnectors' => '<p>The storage connectors to enable.</p>', ], ], 'StorageConnectorType' => [ 'base' => '<p>The type of storage connector.</p>', 'refs' => [ 'StorageConnector$ConnectorType' => '<p>The type of storage connector.</p>', ], ], 'StreamView' => [ 'base' => NULL, 'refs' => [ 'CreateFleetRequest$StreamView' => '<p>The AppStream 2.0 view that is displayed to your users when they stream from the fleet. When <code>APP</code> is specified, only the windows of applications opened by users display. When <code>DESKTOP</code> is specified, the standard desktop that is provided by the operating system displays.</p> <p>The default value is <code>APP</code>.</p>', 'Fleet$StreamView' => '<p>The AppStream 2.0 view that is displayed to your users when they stream from the fleet. When <code>APP</code> is specified, only the windows of applications opened by users display. When <code>DESKTOP</code> is specified, the standard desktop that is provided by the operating system displays.</p> <p>The default value is <code>APP</code>.</p>', 'UpdateFleetRequest$StreamView' => '<p>The AppStream 2.0 view that is displayed to your users when they stream from the fleet. When <code>APP</code> is specified, only the windows of applications opened by users display. When <code>DESKTOP</code> is specified, the standard desktop that is provided by the operating system displays.</p> <p>The default value is <code>APP</code>.</p>', ], ], 'StreamingExperienceSettings' => [ 'base' => '<p>The streaming protocol you want your stack to prefer. This can be UDP or TCP. Currently, UDP is only supported in the Windows native client.</p>', 'refs' => [ 'CreateStackRequest$StreamingExperienceSettings' => '<p>The streaming protocol you want your stack to prefer. This can be UDP or TCP. Currently, UDP is only supported in the Windows native client.</p>', 'Stack$StreamingExperienceSettings' => '<p>The streaming protocol you want your stack to prefer. This can be UDP or TCP. Currently, UDP is only supported in the Windows native client.</p>', 'UpdateStackRequest$StreamingExperienceSettings' => '<p>The streaming protocol you want your stack to prefer. This can be UDP or TCP. Currently, UDP is only supported in the Windows native client.</p>', ], ], 'StreamingUrlUserId' => [ 'base' => NULL, 'refs' => [ 'CreateStreamingURLRequest$UserId' => '<p>The identifier of the user.</p>', ], ], 'String' => [ 'base' => NULL, 'refs' => [ 'AccessEndpoint$VpceId' => '<p>The identifier (ID) of the VPC in which the interface endpoint is used.</p>', 'AppBlock$Name' => '<p>The name of the app block.</p>', 'AppBlock$Description' => '<p>The description of the app block.</p>', 'AppBlock$DisplayName' => '<p>The display name of the app block.</p>', 'AppBlockBuilder$Name' => '<p>The name of the app block builder.</p>', 'AppBlockBuilder$DisplayName' => '<p>The display name of the app block builder.</p>', 'AppBlockBuilder$Description' => '<p>The description of the app block builder.</p>', 'AppBlockBuilder$InstanceType' => '<p>The instance type of the app block builder.</p>', 'AppBlockBuilderStateChangeReason$Message' => '<p>The state change reason message.</p>', 'Application$Name' => '<p>The name of the application.</p>', 'Application$DisplayName' => '<p>The application name to display.</p>', 'Application$IconURL' => '<p>The URL for the application icon. This URL might be time-limited.</p>', 'Application$LaunchPath' => '<p>The path to the application executable in the instance.</p>', 'Application$LaunchParameters' => '<p>The arguments that are passed to the application at launch.</p>', 'Application$WorkingDirectory' => '<p>The working directory for the application.</p>', 'Application$Description' => '<p>The description of the application.</p>', 'ApplicationFleetAssociation$FleetName' => '<p>The name of the fleet associated with the application.</p>', 'ApplicationSettingsResponse$S3BucketName' => '<p>The S3 bucket where users\u00e2\u20ac\u2122 persistent application settings are stored. When persistent application settings are enabled for the first time for an account in an AWS Region, an S3 bucket is created. The bucket is unique to the AWS account and the Region. </p>', 'AssociateApplicationToEntitlementRequest$ApplicationIdentifier' => '<p>The identifier of the application.</p>', 'AssociateFleetRequest$FleetName' => '<p>The name of the fleet. </p>', 'AssociateFleetRequest$StackName' => '<p>The name of the stack.</p>', 'CreateAppBlockBuilderRequest$InstanceType' => '<p>The instance type to use when launching the app block builder. The following instance types are available:</p> <ul> <li> <p>stream.standard.small</p> </li> <li> <p>stream.standard.medium</p> </li> <li> <p>stream.standard.large</p> </li> <li> <p>stream.standard.xlarge</p> </li> <li> <p>stream.standard.2xlarge</p> </li> </ul>', 'CreateAppBlockBuilderStreamingURLResult$StreamingURL' => '<p>The URL to start the streaming session.</p>', 'CreateApplicationRequest$LaunchPath' => '<p>The launch path of the application.</p>', 'CreateApplicationRequest$WorkingDirectory' => '<p>The working directory of the application.</p>', 'CreateApplicationRequest$LaunchParameters' => '<p>The launch parameters of the application.</p>', 'CreateFleetRequest$InstanceType' => '<p>The instance type to use when launching fleet instances. The following instance types are available:</p> <ul> <li> <p>stream.standard.small</p> </li> <li> <p>stream.standard.medium</p> </li> <li> <p>stream.standard.large</p> </li> <li> <p>stream.standard.xlarge</p> </li> <li> <p>stream.standard.2xlarge</p> </li> <li> <p>stream.compute.large</p> </li> <li> <p>stream.compute.xlarge</p> </li> <li> <p>stream.compute.2xlarge</p> </li> <li> <p>stream.compute.4xlarge</p> </li> <li> <p>stream.compute.8xlarge</p> </li> <li> <p>stream.memory.large</p> </li> <li> <p>stream.memory.xlarge</p> </li> <li> <p>stream.memory.2xlarge</p> </li> <li> <p>stream.memory.4xlarge</p> </li> <li> <p>stream.memory.8xlarge</p> </li> <li> <p>stream.memory.z1d.large</p> </li> <li> <p>stream.memory.z1d.xlarge</p> </li> <li> <p>stream.memory.z1d.2xlarge</p> </li> <li> <p>stream.memory.z1d.3xlarge</p> </li> <li> <p>stream.memory.z1d.6xlarge</p> </li> <li> <p>stream.memory.z1d.12xlarge</p> </li> <li> <p>stream.graphics-design.large</p> </li> <li> <p>stream.graphics-design.xlarge</p> </li> <li> <p>stream.graphics-design.2xlarge</p> </li> <li> <p>stream.graphics-design.4xlarge</p> </li> <li> <p>stream.graphics-desktop.2xlarge</p> </li> <li> <p>stream.graphics.g4dn.xlarge</p> </li> <li> <p>stream.graphics.g4dn.2xlarge</p> </li> <li> <p>stream.graphics.g4dn.4xlarge</p> </li> <li> <p>stream.graphics.g4dn.8xlarge</p> </li> <li> <p>stream.graphics.g4dn.12xlarge</p> </li> <li> <p>stream.graphics.g4dn.16xlarge</p> </li> <li> <p>stream.graphics-pro.4xlarge</p> </li> <li> <p>stream.graphics-pro.8xlarge</p> </li> <li> <p>stream.graphics-pro.16xlarge</p> </li> </ul> <p>The following instance types are available for Elastic fleets:</p> <ul> <li> <p>stream.standard.small</p> </li> <li> <p>stream.standard.medium</p> </li> <li> <p>stream.standard.large</p> </li> <li> <p>stream.standard.xlarge</p> </li> <li> <p>stream.standard.2xlarge</p> </li> </ul>', 'CreateImageBuilderRequest$ImageName' => '<p>The name of the image used to create the image builder.</p>', 'CreateImageBuilderRequest$InstanceType' => '<p>The instance type to use when launching the image builder. The following instance types are available:</p> <ul> <li> <p>stream.standard.small</p> </li> <li> <p>stream.standard.medium</p> </li> <li> <p>stream.standard.large</p> </li> <li> <p>stream.compute.large</p> </li> <li> <p>stream.compute.xlarge</p> </li> <li> <p>stream.compute.2xlarge</p> </li> <li> <p>stream.compute.4xlarge</p> </li> <li> <p>stream.compute.8xlarge</p> </li> <li> <p>stream.memory.large</p> </li> <li> <p>stream.memory.xlarge</p> </li> <li> <p>stream.memory.2xlarge</p> </li> <li> <p>stream.memory.4xlarge</p> </li> <li> <p>stream.memory.8xlarge</p> </li> <li> <p>stream.memory.z1d.large</p> </li> <li> <p>stream.memory.z1d.xlarge</p> </li> <li> <p>stream.memory.z1d.2xlarge</p> </li> <li> <p>stream.memory.z1d.3xlarge</p> </li> <li> <p>stream.memory.z1d.6xlarge</p> </li> <li> <p>stream.memory.z1d.12xlarge</p> </li> <li> <p>stream.graphics-design.large</p> </li> <li> <p>stream.graphics-design.xlarge</p> </li> <li> <p>stream.graphics-design.2xlarge</p> </li> <li> <p>stream.graphics-design.4xlarge</p> </li> <li> <p>stream.graphics-desktop.2xlarge</p> </li> <li> <p>stream.graphics.g4dn.xlarge</p> </li> <li> <p>stream.graphics.g4dn.2xlarge</p> </li> <li> <p>stream.graphics.g4dn.4xlarge</p> </li> <li> <p>stream.graphics.g4dn.8xlarge</p> </li> <li> <p>stream.graphics.g4dn.12xlarge</p> </li> <li> <p>stream.graphics.g4dn.16xlarge</p> </li> <li> <p>stream.graphics-pro.4xlarge</p> </li> <li> <p>stream.graphics-pro.8xlarge</p> </li> <li> <p>stream.graphics-pro.16xlarge</p> </li> </ul>', 'CreateImageBuilderStreamingURLRequest$Name' => '<p>The name of the image builder.</p>', 'CreateImageBuilderStreamingURLResult$StreamingURL' => '<p>The URL to start the AppStream 2.0 streaming session.</p>', 'CreateStreamingURLRequest$StackName' => '<p>The name of the stack.</p>', 'CreateStreamingURLRequest$FleetName' => '<p>The name of the fleet.</p>', 'CreateStreamingURLRequest$ApplicationId' => '<p>The name of the application to launch after the session starts. This is the name that you specified as <b>Name</b> in the Image Assistant. If your fleet is enabled for the <b>Desktop</b> stream view, you can also choose to launch directly to the operating system desktop. To do so, specify <b>Desktop</b>.</p>', 'CreateStreamingURLRequest$SessionContext' => '<p>The session context. For more information, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/managing-stacks-fleets.html#managing-stacks-fleets-parameters\">Session Context</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'CreateStreamingURLResult$StreamingURL' => '<p>The URL to start the AppStream 2.0 streaming session.</p>', 'CreateUsageReportSubscriptionResult$S3BucketName' => '<p>The Amazon S3 bucket where generated reports are stored.</p> <p>If you enabled on-instance session scripts and Amazon S3 logging for your session script configuration, AppStream 2.0 created an S3 bucket to store the script output. The bucket is unique to your account and Region. When you enable usage reporting in this case, AppStream 2.0 uses the same bucket to store your usage reports. If you haven\\'t already enabled on-instance session scripts, when you enable usage reports, AppStream 2.0 creates a new S3 bucket.</p>', 'DeleteFleetRequest$Name' => '<p>The name of the fleet.</p>', 'DeleteStackRequest$Name' => '<p>The name of the stack.</p>', 'DescribeAppBlockBuilderAppBlockAssociationsRequest$NextToken' => '<p>The pagination token used to retrieve the next page of results for this operation.</p>', 'DescribeAppBlockBuilderAppBlockAssociationsResult$NextToken' => '<p>The pagination token used to retrieve the next page of results for this operation.</p>', 'DescribeAppBlockBuildersRequest$NextToken' => '<p>The pagination token used to retrieve the next page of results for this operation.</p>', 'DescribeAppBlockBuildersResult$NextToken' => '<p>The pagination token used to retrieve the next page of results for this operation.</p>', 'DescribeAppBlocksRequest$NextToken' => '<p>The pagination token used to retrieve the next page of results for this operation.</p>', 'DescribeAppBlocksResult$NextToken' => '<p>The pagination token used to retrieve the next page of results for this operation.</p>', 'DescribeApplicationFleetAssociationsRequest$NextToken' => '<p>The pagination token used to retrieve the next page of results for this operation.</p>', 'DescribeApplicationFleetAssociationsResult$NextToken' => '<p>The pagination token used to retrieve the next page of results for this operation.</p>', 'DescribeApplicationsRequest$NextToken' => '<p>The pagination token used to retrieve the next page of results for this operation.</p>', 'DescribeApplicationsResult$NextToken' => '<p>The pagination token used to retrieve the next page of results for this operation.</p>', 'DescribeDirectoryConfigsRequest$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.</p>', 'DescribeDirectoryConfigsResult$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.</p>', 'DescribeEntitlementsRequest$NextToken' => '<p>The pagination token used to retrieve the next page of results for this operation.</p>', 'DescribeEntitlementsResult$NextToken' => '<p>The pagination token used to retrieve the next page of results for this operation.</p>', 'DescribeFleetsRequest$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.</p>', 'DescribeFleetsResult$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.</p>', 'DescribeImageBuildersRequest$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.</p>', 'DescribeImageBuildersResult$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.</p>', 'DescribeImagePermissionsRequest$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.</p>', 'DescribeImagePermissionsResult$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.</p>', 'DescribeImagesRequest$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.</p>', 'DescribeImagesResult$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.</p>', 'DescribeSessionsRequest$StackName' => '<p>The name of the stack. This value is case-sensitive.</p>', 'DescribeSessionsRequest$FleetName' => '<p>The name of the fleet. This value is case-sensitive.</p>', 'DescribeSessionsRequest$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.</p>', 'DescribeSessionsResult$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.</p>', 'DescribeStacksRequest$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.</p>', 'DescribeStacksResult$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.</p>', 'DescribeUsageReportSubscriptionsRequest$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.</p>', 'DescribeUsageReportSubscriptionsResult$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.</p>', 'DescribeUserStackAssociationsRequest$StackName' => '<p>The name of the stack that is associated with the user.</p>', 'DescribeUserStackAssociationsRequest$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.</p>', 'DescribeUserStackAssociationsResult$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.</p>', 'DescribeUsersRequest$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.</p>', 'DescribeUsersResult$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.</p>', 'DisassociateApplicationFromEntitlementRequest$ApplicationIdentifier' => '<p>The identifier of the application to remove from the entitlement.</p>', 'DisassociateFleetRequest$FleetName' => '<p>The name of the fleet.</p>', 'DisassociateFleetRequest$StackName' => '<p>The name of the stack.</p>', 'EntitledApplication$ApplicationIdentifier' => '<p>The identifier of the application.</p>', 'EntitlementAttribute$Name' => '<p>A supported AWS IAM SAML <code>PrincipalTag</code> attribute that is matched to the associated value when a user identity federates into an Amazon AppStream 2.0 SAML application.</p> <p>The following are valid values:</p> <ul> <li> <p>roles</p> </li> <li> <p>department </p> </li> <li> <p>organization </p> </li> <li> <p>groups </p> </li> <li> <p>title </p> </li> <li> <p>costCenter </p> </li> <li> <p>userType</p> </li> </ul> <p> </p>', 'EntitlementAttribute$Value' => '<p>A value that is matched to a supported SAML attribute name when a user identity federates into an Amazon AppStream 2.0 SAML application. </p>', 'ErrorDetails$ErrorCode' => '<p>The error code.</p>', 'ErrorDetails$ErrorMessage' => '<p>The error message.</p>', 'ExpireSessionRequest$SessionId' => '<p>The identifier of the streaming session.</p>', 'Fleet$Name' => '<p>The name of the fleet.</p>', 'Fleet$DisplayName' => '<p>The fleet name to display.</p>', 'Fleet$Description' => '<p>The description to display.</p>', 'Fleet$ImageName' => '<p>The name of the image used to create the fleet.</p>', 'Fleet$InstanceType' => '<p>The instance type to use when launching fleet instances. The following instance types are available:</p> <ul> <li> <p>stream.standard.small</p> </li> <li> <p>stream.standard.medium</p> </li> <li> <p>stream.standard.large</p> </li> <li> <p>stream.compute.large</p> </li> <li> <p>stream.compute.xlarge</p> </li> <li> <p>stream.compute.2xlarge</p> </li> <li> <p>stream.compute.4xlarge</p> </li> <li> <p>stream.compute.8xlarge</p> </li> <li> <p>stream.memory.large</p> </li> <li> <p>stream.memory.xlarge</p> </li> <li> <p>stream.memory.2xlarge</p> </li> <li> <p>stream.memory.4xlarge</p> </li> <li> <p>stream.memory.8xlarge</p> </li> <li> <p>stream.memory.z1d.large</p> </li> <li> <p>stream.memory.z1d.xlarge</p> </li> <li> <p>stream.memory.z1d.2xlarge</p> </li> <li> <p>stream.memory.z1d.3xlarge</p> </li> <li> <p>stream.memory.z1d.6xlarge</p> </li> <li> <p>stream.memory.z1d.12xlarge</p> </li> <li> <p>stream.graphics-design.large</p> </li> <li> <p>stream.graphics-design.xlarge</p> </li> <li> <p>stream.graphics-design.2xlarge</p> </li> <li> <p>stream.graphics-design.4xlarge</p> </li> <li> <p>stream.graphics-desktop.2xlarge</p> </li> <li> <p>stream.graphics.g4dn.xlarge</p> </li> <li> <p>stream.graphics.g4dn.2xlarge</p> </li> <li> <p>stream.graphics.g4dn.4xlarge</p> </li> <li> <p>stream.graphics.g4dn.8xlarge</p> </li> <li> <p>stream.graphics.g4dn.12xlarge</p> </li> <li> <p>stream.graphics.g4dn.16xlarge</p> </li> <li> <p>stream.graphics-pro.4xlarge</p> </li> <li> <p>stream.graphics-pro.8xlarge</p> </li> <li> <p>stream.graphics-pro.16xlarge</p> </li> </ul>', 'FleetError$ErrorMessage' => '<p>The error message.</p>', 'Image$Name' => '<p>The name of the image.</p>', 'Image$DisplayName' => '<p>The image name to display.</p>', 'Image$ImageBuilderName' => '<p>The name of the image builder that was used to create the private image. If the image is shared, this value is null.</p>', 'Image$Description' => '<p>The description to display.</p>', 'ImageBuilder$Name' => '<p>The name of the image builder.</p>', 'ImageBuilder$Description' => '<p>The description to display.</p>', 'ImageBuilder$DisplayName' => '<p>The image builder name to display.</p>', 'ImageBuilder$InstanceType' => '<p>The instance type for the image builder. The following instance types are available:</p> <ul> <li> <p>stream.standard.small</p> </li> <li> <p>stream.standard.medium</p> </li> <li> <p>stream.standard.large</p> </li> <li> <p>stream.compute.large</p> </li> <li> <p>stream.compute.xlarge</p> </li> <li> <p>stream.compute.2xlarge</p> </li> <li> <p>stream.compute.4xlarge</p> </li> <li> <p>stream.compute.8xlarge</p> </li> <li> <p>stream.memory.large</p> </li> <li> <p>stream.memory.xlarge</p> </li> <li> <p>stream.memory.2xlarge</p> </li> <li> <p>stream.memory.4xlarge</p> </li> <li> <p>stream.memory.8xlarge</p> </li> <li> <p>stream.memory.z1d.large</p> </li> <li> <p>stream.memory.z1d.xlarge</p> </li> <li> <p>stream.memory.z1d.2xlarge</p> </li> <li> <p>stream.memory.z1d.3xlarge</p> </li> <li> <p>stream.memory.z1d.6xlarge</p> </li> <li> <p>stream.memory.z1d.12xlarge</p> </li> <li> <p>stream.graphics-design.large</p> </li> <li> <p>stream.graphics-design.xlarge</p> </li> <li> <p>stream.graphics-design.2xlarge</p> </li> <li> <p>stream.graphics-design.4xlarge</p> </li> <li> <p>stream.graphics-desktop.2xlarge</p> </li> <li> <p>stream.graphics.g4dn.xlarge</p> </li> <li> <p>stream.graphics.g4dn.2xlarge</p> </li> <li> <p>stream.graphics.g4dn.4xlarge</p> </li> <li> <p>stream.graphics.g4dn.8xlarge</p> </li> <li> <p>stream.graphics.g4dn.12xlarge</p> </li> <li> <p>stream.graphics.g4dn.16xlarge</p> </li> <li> <p>stream.graphics-pro.4xlarge</p> </li> <li> <p>stream.graphics-pro.8xlarge</p> </li> <li> <p>stream.graphics-pro.16xlarge</p> </li> </ul>', 'ImageBuilderStateChangeReason$Message' => '<p>The state change reason message.</p>', 'ImageStateChangeReason$Message' => '<p>The state change reason message.</p>', 'LastReportGenerationExecutionError$ErrorMessage' => '<p>The error message for the error that is returned when a usage report can\\'t be generated.</p>', 'ListAssociatedFleetsRequest$StackName' => '<p>The name of the stack.</p>', 'ListAssociatedFleetsRequest$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.</p>', 'ListAssociatedFleetsResult$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.</p>', 'ListAssociatedStacksRequest$FleetName' => '<p>The name of the fleet.</p>', 'ListAssociatedStacksRequest$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.</p>', 'ListAssociatedStacksResult$NextToken' => '<p>The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.</p>', 'ListEntitledApplicationsRequest$NextToken' => '<p>The pagination token used to retrieve the next page of results for this operation.</p>', 'ListEntitledApplicationsResult$NextToken' => '<p>The pagination token used to retrieve the next page of results for this operation.</p>', 'Metadata$key' => NULL, 'Metadata$value' => NULL, 'NetworkAccessConfiguration$EniPrivateIpAddress' => '<p>The private IP address of the elastic network interface that is attached to instances in your VPC.</p>', 'NetworkAccessConfiguration$EniId' => '<p>The resource identifier of the elastic network interface that is attached to instances in your VPC. All network interfaces have the eni-xxxxxxxx resource identifier.</p>', 'ResourceError$ErrorMessage' => '<p>The error message.</p>', 'ScriptDetails$ExecutablePath' => '<p>The run path for the script.</p>', 'ScriptDetails$ExecutableParameters' => '<p>The runtime parameters passed to the run path for the script.</p>', 'SecurityGroupIdList$member' => NULL, 'Session$Id' => '<p>The identifier of the streaming session.</p>', 'Session$StackName' => '<p>The name of the stack for the streaming session.</p>', 'Session$FleetName' => '<p>The name of the fleet for the streaming session.</p>', 'Stack$Name' => '<p>The name of the stack.</p>', 'Stack$Description' => '<p>The description to display.</p>', 'Stack$DisplayName' => '<p>The stack name to display.</p>', 'StackError$ErrorMessage' => '<p>The error message.</p>', 'StartFleetRequest$Name' => '<p>The name of the fleet.</p>', 'StartImageBuilderRequest$Name' => '<p>The name of the image builder.</p>', 'StopFleetRequest$Name' => '<p>The name of the fleet.</p>', 'StopImageBuilderRequest$Name' => '<p>The name of the image builder.</p>', 'StringList$member' => NULL, 'SubnetIdList$member' => NULL, 'UpdateAppBlockBuilderRequest$InstanceType' => '<p>The instance type to use when launching the app block builder. The following instance types are available:</p> <ul> <li> <p>stream.standard.small</p> </li> <li> <p>stream.standard.medium</p> </li> <li> <p>stream.standard.large</p> </li> <li> <p>stream.standard.xlarge</p> </li> <li> <p>stream.standard.2xlarge</p> </li> </ul>', 'UpdateApplicationRequest$LaunchPath' => '<p>The launch path of the application.</p>', 'UpdateApplicationRequest$WorkingDirectory' => '<p>The working directory of the application.</p>', 'UpdateApplicationRequest$LaunchParameters' => '<p>The launch parameters of the application.</p>', 'UpdateFleetRequest$ImageName' => '<p>The name of the image used to create the fleet.</p>', 'UpdateFleetRequest$Name' => '<p>A unique name for the fleet.</p>', 'UpdateFleetRequest$InstanceType' => '<p>The instance type to use when launching fleet instances. The following instance types are available:</p> <ul> <li> <p>stream.standard.small</p> </li> <li> <p>stream.standard.medium</p> </li> <li> <p>stream.standard.large</p> </li> <li> <p>stream.standard.xlarge</p> </li> <li> <p>stream.standard.2xlarge</p> </li> <li> <p>stream.compute.large</p> </li> <li> <p>stream.compute.xlarge</p> </li> <li> <p>stream.compute.2xlarge</p> </li> <li> <p>stream.compute.4xlarge</p> </li> <li> <p>stream.compute.8xlarge</p> </li> <li> <p>stream.memory.large</p> </li> <li> <p>stream.memory.xlarge</p> </li> <li> <p>stream.memory.2xlarge</p> </li> <li> <p>stream.memory.4xlarge</p> </li> <li> <p>stream.memory.8xlarge</p> </li> <li> <p>stream.memory.z1d.large</p> </li> <li> <p>stream.memory.z1d.xlarge</p> </li> <li> <p>stream.memory.z1d.2xlarge</p> </li> <li> <p>stream.memory.z1d.3xlarge</p> </li> <li> <p>stream.memory.z1d.6xlarge</p> </li> <li> <p>stream.memory.z1d.12xlarge</p> </li> <li> <p>stream.graphics-design.large</p> </li> <li> <p>stream.graphics-design.xlarge</p> </li> <li> <p>stream.graphics-design.2xlarge</p> </li> <li> <p>stream.graphics-design.4xlarge</p> </li> <li> <p>stream.graphics-desktop.2xlarge</p> </li> <li> <p>stream.graphics.g4dn.xlarge</p> </li> <li> <p>stream.graphics.g4dn.2xlarge</p> </li> <li> <p>stream.graphics.g4dn.4xlarge</p> </li> <li> <p>stream.graphics.g4dn.8xlarge</p> </li> <li> <p>stream.graphics.g4dn.12xlarge</p> </li> <li> <p>stream.graphics.g4dn.16xlarge</p> </li> <li> <p>stream.graphics-pro.4xlarge</p> </li> <li> <p>stream.graphics-pro.8xlarge</p> </li> <li> <p>stream.graphics-pro.16xlarge</p> </li> </ul> <p>The following instance types are available for Elastic fleets:</p> <ul> <li> <p>stream.standard.small</p> </li> <li> <p>stream.standard.medium</p> </li> <li> <p>stream.standard.large</p> </li> <li> <p>stream.standard.xlarge</p> </li> <li> <p>stream.standard.2xlarge</p> </li> </ul>', 'UpdateStackRequest$Name' => '<p>The name of the stack.</p>', 'UsageReportSubscription$S3BucketName' => '<p>The Amazon S3 bucket where generated reports are stored.</p> <p>If you enabled on-instance session scripts and Amazon S3 logging for your session script configuration, AppStream 2.0 created an S3 bucket to store the script output. The bucket is unique to your account and Region. When you enable usage reporting in this case, AppStream 2.0 uses the same bucket to store your usage reports. If you haven\\'t already enabled on-instance session scripts, when you enable usage reports, AppStream 2.0 creates a new S3 bucket.</p>', 'User$Status' => '<p>The status of the user in the user pool. The status can be one of the following:</p> <ul> <li> <p>UNCONFIRMED \u00e2\u20ac\u201c The user is created but not confirmed.</p> </li> <li> <p>CONFIRMED \u00e2\u20ac\u201c The user is confirmed.</p> </li> <li> <p>ARCHIVED \u00e2\u20ac\u201c The user is no longer active.</p> </li> <li> <p>COMPROMISED \u00e2\u20ac\u201c The user is disabled because of a potential security threat.</p> </li> <li> <p>UNKNOWN \u00e2\u20ac\u201c The user status is not known.</p> </li> </ul>', 'UserStackAssociation$StackName' => '<p>The name of the stack that is associated with the user.</p>', 'UserStackAssociationError$ErrorMessage' => '<p>The error message for the error that is returned when a user can\u00e2\u20ac\u2122t be associated with or disassociated from a stack.</p>', ], ], 'StringList' => [ 'base' => NULL, 'refs' => [ 'Application$InstanceFamilies' => '<p>The instance families for the application.</p>', 'CreateApplicationRequest$InstanceFamilies' => '<p>The instance families the application supports. Valid values are GENERAL_PURPOSE and GRAPHICS_G4.</p>', 'DescribeAppBlockBuildersRequest$Names' => '<p>The names of the app block builders.</p>', 'DescribeFleetsRequest$Names' => '<p>The names of the fleets to describe.</p>', 'DescribeImageBuildersRequest$Names' => '<p>The names of the image builders to describe.</p>', 'DescribeImagesRequest$Names' => '<p>The names of the public or private images to describe.</p>', 'DescribeStacksRequest$Names' => '<p>The names of the stacks to describe.</p>', 'ListAssociatedFleetsResult$Names' => '<p>The name of the fleet.</p>', 'ListAssociatedStacksResult$Names' => '<p>The name of the stack.</p>', ], ], 'SubnetIdList' => [ 'base' => '<p>The subnet identifiers.</p>', 'refs' => [ 'VpcConfig$SubnetIds' => '<p>The identifiers of the subnets to which a network interface is attached from the fleet instance or image builder instance. Fleet instances use one or more subnets. Image builder instances use one subnet.</p>', ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'TagKeyList$member' => NULL, 'Tags$key' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$TagKeys' => '<p>The tag keys for the tags to disassociate.</p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'Tags$value' => NULL, ], ], 'Tags' => [ 'base' => NULL, 'refs' => [ 'CreateAppBlockBuilderRequest$Tags' => '<p>The tags to associate with the app block builder. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=. </p> <p>If you do not specify a value, the value is set to an empty string.</p> <p>Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters: </p> <p>_ . : / = + \\\\ - @</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html\">Tagging Your Resources</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'CreateAppBlockRequest$Tags' => '<p>The tags assigned to the app block.</p>', 'CreateApplicationRequest$Tags' => '<p>The tags assigned to the application.</p>', 'CreateFleetRequest$Tags' => '<p>The tags to associate with the fleet. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=. </p> <p>If you do not specify a value, the value is set to an empty string.</p> <p>Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters: </p> <p>_ . : / = + \\\\ - @</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html\">Tagging Your Resources</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'CreateImageBuilderRequest$Tags' => '<p>The tags to associate with the image builder. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=. </p> <p>Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters: </p> <p>_ . : / = + \\\\ - @</p> <p>If you do not specify a value, the value is set to an empty string.</p> <p>For more information about tags, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html\">Tagging Your Resources</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'CreateStackRequest$Tags' => '<p>The tags to associate with the stack. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=. </p> <p>If you do not specify a value, the value is set to an empty string.</p> <p>Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters: </p> <p>_ . : / = + \\\\ - @</p> <p>For more information about tags, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html\">Tagging Your Resources</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'CreateUpdatedImageRequest$newImageTags' => '<p>The tags to associate with the new image. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=. </p> <p>Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters: </p> <p>_ . : / = + \\\\ - @</p> <p>If you do not specify a value, the value is set to an empty string.</p> <p>For more information about tags, see <a href=\"https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html\">Tagging Your Resources</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>', 'ListTagsForResourceResponse$Tags' => '<p>The information about the tags.</p>', 'TagResourceRequest$Tags' => '<p>The tags to associate. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=. </p> <p>If you do not specify a value, the value is set to an empty string.</p> <p>Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters: </p> <p>_ . : / = + \\\\ - @</p>', ], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [ 'AppBlock$CreatedTime' => '<p>The created time of the app block.</p>', 'AppBlockBuilder$CreatedTime' => '<p>The creation time of the app block builder.</p>', 'Application$CreatedTime' => '<p>The time at which the application was created within the app block.</p>', 'CreateAppBlockBuilderStreamingURLResult$Expires' => '<p>The elapsed time, in seconds after the Unix epoch, when this URL expires.</p>', 'CreateImageBuilderStreamingURLResult$Expires' => '<p>The elapsed time, in seconds after the Unix epoch, when this URL expires.</p>', 'CreateStreamingURLResult$Expires' => '<p>The elapsed time, in seconds after the Unix epoch, when this URL expires.</p>', 'DirectoryConfig$CreatedTime' => '<p>The time the directory configuration was created.</p>', 'Entitlement$CreatedTime' => '<p>The time when the entitlement was created.</p>', 'Entitlement$LastModifiedTime' => '<p>The time when the entitlement was last modified.</p>', 'Fleet$CreatedTime' => '<p>The time the fleet was created.</p>', 'Image$CreatedTime' => '<p>The time the image was created.</p>', 'Image$PublicBaseImageReleasedDate' => '<p>The release date of the public base image. For private images, this date is the release date of the base image from which the image was created.</p>', 'ImageBuilder$CreatedTime' => '<p>The time stamp when the image builder was created.</p>', 'ResourceError$ErrorTimestamp' => '<p>The time the error occurred.</p>', 'Session$StartTime' => '<p>The time when a streaming instance is dedicated for the user.</p>', 'Session$MaxExpirationTime' => '<p>The time when the streaming session is set to expire. This time is based on the <code>MaxUserDurationinSeconds</code> value, which determines the maximum length of time that a streaming session can run. A streaming session might end earlier than the time specified in <code>SessionMaxExpirationTime</code>, when the <code>DisconnectTimeOutInSeconds</code> elapses or the user chooses to end his or her session. If the <code>DisconnectTimeOutInSeconds</code> elapses, or the user chooses to end his or her session, the streaming instance is terminated and the streaming session ends.</p>', 'Stack$CreatedTime' => '<p>The time the stack was created.</p>', 'UsageReportSubscription$LastGeneratedReportDate' => '<p>The time when the last usage report was generated.</p>', 'User$CreatedTime' => '<p>The date and time the user was created in the user pool.</p>', ], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAppBlockBuilderRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAppBlockBuilderResult' => [ 'base' => NULL, 'refs' => [], ], 'UpdateApplicationRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateApplicationResult' => [ 'base' => NULL, 'refs' => [], ], 'UpdateDirectoryConfigRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateDirectoryConfigResult' => [ 'base' => NULL, 'refs' => [], ], 'UpdateEntitlementRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateEntitlementResult' => [ 'base' => NULL, 'refs' => [], ], 'UpdateFleetRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateFleetResult' => [ 'base' => NULL, 'refs' => [], ], 'UpdateImagePermissionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateImagePermissionsResult' => [ 'base' => NULL, 'refs' => [], ], 'UpdateStackRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateStackResult' => [ 'base' => NULL, 'refs' => [], ], 'UsageReportExecutionErrorCode' => [ 'base' => NULL, 'refs' => [ 'LastReportGenerationExecutionError$ErrorCode' => '<p>The error code for the error that is returned when a usage report can\\'t be generated.</p>', ], ], 'UsageReportSchedule' => [ 'base' => NULL, 'refs' => [ 'CreateUsageReportSubscriptionResult$Schedule' => '<p>The schedule for generating usage reports.</p>', 'UsageReportSubscription$Schedule' => '<p>The schedule for generating usage reports.</p>', ], ], 'UsageReportSubscription' => [ 'base' => '<p>Describes information about the usage report subscription.</p>', 'refs' => [ 'UsageReportSubscriptionList$member' => NULL, ], ], 'UsageReportSubscriptionList' => [ 'base' => NULL, 'refs' => [ 'DescribeUsageReportSubscriptionsResult$UsageReportSubscriptions' => '<p>Information about the usage report subscription.</p>', ], ], 'UsbDeviceFilterString' => [ 'base' => NULL, 'refs' => [ 'UsbDeviceFilterStrings$member' => NULL, ], ], 'UsbDeviceFilterStrings' => [ 'base' => NULL, 'refs' => [ 'CreateFleetRequest$UsbDeviceFilterStrings' => '<p>The USB device filter strings that specify which USB devices a user can redirect to the fleet streaming session, when using the Windows native client. This is allowed but not required for Elastic fleets.</p>', 'Fleet$UsbDeviceFilterStrings' => '<p>The USB device filter strings associated with the fleet.</p>', 'UpdateFleetRequest$UsbDeviceFilterStrings' => '<p>The USB device filter strings that specify which USB devices a user can redirect to the fleet streaming session, when using the Windows native client. This is allowed but not required for Elastic fleets.</p>', ], ], 'User' => [ 'base' => '<p>Describes a user in the user pool.</p>', 'refs' => [ 'UserList$member' => NULL, ], ], 'UserAttributeValue' => [ 'base' => NULL, 'refs' => [ 'CreateUserRequest$FirstName' => '<p>The first name, or given name, of the user.</p>', 'CreateUserRequest$LastName' => '<p>The last name, or surname, of the user.</p>', 'User$FirstName' => '<p>The first name, or given name, of the user.</p>', 'User$LastName' => '<p>The last name, or surname, of the user.</p>', ], ], 'UserId' => [ 'base' => NULL, 'refs' => [ 'DescribeSessionsRequest$UserId' => '<p>The user identifier (ID). If you specify a user ID, you must also specify the authentication type.</p>', 'Session$UserId' => '<p>The identifier of the user for whom the session was created.</p>', ], ], 'UserList' => [ 'base' => NULL, 'refs' => [ 'DescribeUsersResult$Users' => '<p>Information about users in the user pool.</p>', ], ], 'UserSetting' => [ 'base' => '<p>Describes an action and whether the action is enabled or disabled for users during their streaming sessions.</p>', 'refs' => [ 'UserSettingList$member' => NULL, ], ], 'UserSettingList' => [ 'base' => NULL, 'refs' => [ 'CreateStackRequest$UserSettings' => '<p>The actions that are enabled or disabled for users during their streaming sessions. By default, these actions are enabled. </p>', 'Stack$UserSettings' => '<p>The actions that are enabled or disabled for users during their streaming sessions. By default these actions are enabled.</p>', 'UpdateStackRequest$UserSettings' => '<p>The actions that are enabled or disabled for users during their streaming sessions. By default, these actions are enabled.</p>', ], ], 'UserStackAssociation' => [ 'base' => '<p>Describes a user in the user pool and the associated stack.</p>', 'refs' => [ 'UserStackAssociationError$UserStackAssociation' => '<p>Information about the user and associated stack.</p>', 'UserStackAssociationList$member' => NULL, ], ], 'UserStackAssociationError' => [ 'base' => '<p>Describes the error that is returned when a user can\u00e2\u20ac\u2122t be associated with or disassociated from a stack. </p>', 'refs' => [ 'UserStackAssociationErrorList$member' => NULL, ], ], 'UserStackAssociationErrorCode' => [ 'base' => NULL, 'refs' => [ 'UserStackAssociationError$ErrorCode' => '<p>The error code for the error that is returned when a user can\u00e2\u20ac\u2122t be associated with or disassociated from a stack.</p>', ], ], 'UserStackAssociationErrorList' => [ 'base' => NULL, 'refs' => [ 'BatchAssociateUserStackResult$errors' => '<p>The list of UserStackAssociationError objects.</p>', 'BatchDisassociateUserStackResult$errors' => '<p>The list of UserStackAssociationError objects.</p>', ], ], 'UserStackAssociationList' => [ 'base' => NULL, 'refs' => [ 'BatchAssociateUserStackRequest$UserStackAssociations' => '<p>The list of UserStackAssociation objects.</p>', 'BatchDisassociateUserStackRequest$UserStackAssociations' => '<p>The list of UserStackAssociation objects.</p>', 'DescribeUserStackAssociationsResult$UserStackAssociations' => '<p>The UserStackAssociation objects.</p>', ], ], 'Username' => [ 'base' => NULL, 'refs' => [ 'CreateUserRequest$UserName' => '<p>The email address of the user.</p> <note> <p>Users\\' email addresses are case-sensitive. During login, if they specify an email address that doesn\\'t use the same capitalization as the email address specified when their user pool account was created, a \"user does not exist\" error message displays.</p> </note>', 'DeleteUserRequest$UserName' => '<p>The email address of the user.</p> <note> <p>Users\\' email addresses are case-sensitive.</p> </note>', 'DescribeUserStackAssociationsRequest$UserName' => '<p>The email address of the user who is associated with the stack.</p> <note> <p>Users\\' email addresses are case-sensitive.</p> </note>', 'DisableUserRequest$UserName' => '<p>The email address of the user.</p> <note> <p>Users\\' email addresses are case-sensitive.</p> </note>', 'EnableUserRequest$UserName' => '<p>The email address of the user.</p> <note> <p>Users\\' email addresses are case-sensitive. During login, if they specify an email address that doesn\\'t use the same capitalization as the email address specified when their user pool account was created, a \"user does not exist\" error message displays. </p> </note>', 'User$UserName' => '<p>The email address of the user.</p> <note> <p>Users\\' email addresses are case-sensitive.</p> </note>', 'UserStackAssociation$UserName' => '<p>The email address of the user who is associated with the stack.</p> <note> <p>Users\\' email addresses are case-sensitive.</p> </note>', ], ], 'VisibilityType' => [ 'base' => NULL, 'refs' => [ 'DescribeImagesRequest$Type' => '<p>The type of image (public, private, or shared) to describe. </p>', 'Image$Visibility' => '<p>Indicates whether the image is public or private.</p>', ], ], 'VpcConfig' => [ 'base' => '<p>Describes VPC configuration information for fleets and image builders.</p>', 'refs' => [ 'AppBlockBuilder$VpcConfig' => '<p>The VPC configuration for the app block builder.</p>', 'CreateAppBlockBuilderRequest$VpcConfig' => '<p>The VPC configuration for the app block builder.</p> <p>App block builders require that you specify at least two subnets in different availability zones.</p>', 'CreateFleetRequest$VpcConfig' => '<p>The VPC configuration for the fleet. This is required for Elastic fleets, but not required for other fleet types. Elastic fleets require that you specify at least two subnets in different availability zones.</p>', 'CreateImageBuilderRequest$VpcConfig' => '<p>The VPC configuration for the image builder. You can specify only one subnet.</p>', 'Fleet$VpcConfig' => '<p>The VPC configuration for the fleet.</p>', 'ImageBuilder$VpcConfig' => '<p>The VPC configuration of the image builder.</p>', 'UpdateAppBlockBuilderRequest$VpcConfig' => '<p>The VPC configuration for the app block builder.</p> <p>App block builders require that you specify at least two subnets in different availability zones.</p>', 'UpdateFleetRequest$VpcConfig' => '<p>The VPC configuration for the fleet. This is required for Elastic fleets, but not required for other fleet types. Elastic fleets require that you specify at least two subnets in different availability zones. </p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appstream/2016-12-01/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appstream2-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appstream2-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appstream2.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ 'aws', [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], ], ], ], 'endpoint' => [ 'url' => 'https://appstream2.{Region}.amazonaws.com', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ 'aws-us-gov', [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], ], ], ], 'endpoint' => [ 'url' => 'https://appstream2.{Region}.amazonaws.com', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appstream2.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appstream/2016-12-01/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2-fips.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appstream2.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appstream/2016-12-01/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appstream/2016-12-01/paginators-1.json\nreturn [ 'pagination' => [ 'DescribeAppBlockBuilderAppBlockAssociations' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'DescribeAppBlockBuilders' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'DescribeImagePermissions' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'DescribeImages' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appstream/2016-12-01/smoke.json\nreturn [ 'version' => 1, 'defaultRegion' => 'us-west-2', 'testCases' => [ [ 'operationName' => 'DescribeStacks', 'input' => [], 'errorExpectedFromService' => false, ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appstream/2016-12-01/waiters-2.json\nreturn [ 'version' => 2, 'waiters' => [ 'FleetStarted' => [ 'delay' => 30, 'maxAttempts' => 40, 'operation' => 'DescribeFleets', 'acceptors' => [ [ 'state' => 'success', 'matcher' => 'pathAll', 'argument' => 'Fleets[].State', 'expected' => 'RUNNING', ], [ 'state' => 'failure', 'matcher' => 'pathAny', 'argument' => 'Fleets[].State', 'expected' => 'STOPPING', ], [ 'state' => 'failure', 'matcher' => 'pathAny', 'argument' => 'Fleets[].State', 'expected' => 'STOPPED', ], ], ], 'FleetStopped' => [ 'delay' => 30, 'maxAttempts' => 40, 'operation' => 'DescribeFleets', 'acceptors' => [ [ 'state' => 'success', 'matcher' => 'pathAll', 'argument' => 'Fleets[].State', 'expected' => 'STOPPED', ], [ 'state' => 'failure', 'matcher' => 'pathAny', 'argument' => 'Fleets[].State', 'expected' => 'STARTING', ], [ 'state' => 'failure', 'matcher' => 'pathAny', 'argument' => 'Fleets[].State', 'expected' => 'RUNNING', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appsync/2017-07-25/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2017-07-25', 'endpointPrefix' => 'appsync', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceAbbreviation' => 'AWSAppSync', 'serviceFullName' => 'AWS AppSync', 'serviceId' => 'AppSync', 'signatureVersion' => 'v4', 'signingName' => 'appsync', 'uid' => 'appsync-2017-07-25', ], 'operations' => [ 'AssociateApi' => [ 'name' => 'AssociateApi', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/domainnames/{domainName}/apiassociation', ], 'input' => [ 'shape' => 'AssociateApiRequest', ], 'output' => [ 'shape' => 'AssociateApiResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], ], ], 'AssociateMergedGraphqlApi' => [ 'name' => 'AssociateMergedGraphqlApi', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/sourceApis/{sourceApiIdentifier}/mergedApiAssociations', ], 'input' => [ 'shape' => 'AssociateMergedGraphqlApiRequest', ], 'output' => [ 'shape' => 'AssociateMergedGraphqlApiResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ConcurrentModificationException', ], ], ], 'AssociateSourceGraphqlApi' => [ 'name' => 'AssociateSourceGraphqlApi', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/mergedApis/{mergedApiIdentifier}/sourceApiAssociations', ], 'input' => [ 'shape' => 'AssociateSourceGraphqlApiRequest', ], 'output' => [ 'shape' => 'AssociateSourceGraphqlApiResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ConcurrentModificationException', ], ], ], 'CreateApiCache' => [ 'name' => 'CreateApiCache', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/apis/{apiId}/ApiCaches', ], 'input' => [ 'shape' => 'CreateApiCacheRequest', ], 'output' => [ 'shape' => 'CreateApiCacheResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'CreateApiKey' => [ 'name' => 'CreateApiKey', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/apis/{apiId}/apikeys', ], 'input' => [ 'shape' => 'CreateApiKeyRequest', ], 'output' => [ 'shape' => 'CreateApiKeyResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'ApiKeyLimitExceededException', ], [ 'shape' => 'ApiKeyValidityOutOfBoundsException', ], ], ], 'CreateDataSource' => [ 'name' => 'CreateDataSource', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/apis/{apiId}/datasources', ], 'input' => [ 'shape' => 'CreateDataSourceRequest', ], 'output' => [ 'shape' => 'CreateDataSourceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'CreateDomainName' => [ 'name' => 'CreateDomainName', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/domainnames', ], 'input' => [ 'shape' => 'CreateDomainNameRequest', ], 'output' => [ 'shape' => 'CreateDomainNameResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'CreateFunction' => [ 'name' => 'CreateFunction', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/apis/{apiId}/functions', ], 'input' => [ 'shape' => 'CreateFunctionRequest', ], 'output' => [ 'shape' => 'CreateFunctionResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'CreateGraphqlApi' => [ 'name' => 'CreateGraphqlApi', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/apis', ], 'input' => [ 'shape' => 'CreateGraphqlApiRequest', ], 'output' => [ 'shape' => 'CreateGraphqlApiResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'ApiLimitExceededException', ], ], ], 'CreateResolver' => [ 'name' => 'CreateResolver', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/apis/{apiId}/types/{typeName}/resolvers', ], 'input' => [ 'shape' => 'CreateResolverRequest', ], 'output' => [ 'shape' => 'CreateResolverResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'BadRequestException', ], ], ], 'CreateType' => [ 'name' => 'CreateType', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/apis/{apiId}/types', ], 'input' => [ 'shape' => 'CreateTypeRequest', ], 'output' => [ 'shape' => 'CreateTypeResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'DeleteApiCache' => [ 'name' => 'DeleteApiCache', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v1/apis/{apiId}/ApiCaches', ], 'input' => [ 'shape' => 'DeleteApiCacheRequest', ], 'output' => [ 'shape' => 'DeleteApiCacheResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'DeleteApiKey' => [ 'name' => 'DeleteApiKey', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v1/apis/{apiId}/apikeys/{id}', ], 'input' => [ 'shape' => 'DeleteApiKeyRequest', ], 'output' => [ 'shape' => 'DeleteApiKeyResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'DeleteDataSource' => [ 'name' => 'DeleteDataSource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v1/apis/{apiId}/datasources/{name}', ], 'input' => [ 'shape' => 'DeleteDataSourceRequest', ], 'output' => [ 'shape' => 'DeleteDataSourceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'DeleteDomainName' => [ 'name' => 'DeleteDomainName', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v1/domainnames/{domainName}', ], 'input' => [ 'shape' => 'DeleteDomainNameRequest', ], 'output' => [ 'shape' => 'DeleteDomainNameResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], ], ], 'DeleteFunction' => [ 'name' => 'DeleteFunction', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v1/apis/{apiId}/functions/{functionId}', ], 'input' => [ 'shape' => 'DeleteFunctionRequest', ], 'output' => [ 'shape' => 'DeleteFunctionResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'DeleteGraphqlApi' => [ 'name' => 'DeleteGraphqlApi', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v1/apis/{apiId}', ], 'input' => [ 'shape' => 'DeleteGraphqlApiRequest', ], 'output' => [ 'shape' => 'DeleteGraphqlApiResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'DeleteResolver' => [ 'name' => 'DeleteResolver', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v1/apis/{apiId}/types/{typeName}/resolvers/{fieldName}', ], 'input' => [ 'shape' => 'DeleteResolverRequest', ], 'output' => [ 'shape' => 'DeleteResolverResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'BadRequestException', ], ], ], 'DeleteType' => [ 'name' => 'DeleteType', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v1/apis/{apiId}/types/{typeName}', ], 'input' => [ 'shape' => 'DeleteTypeRequest', ], 'output' => [ 'shape' => 'DeleteTypeResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'DisassociateApi' => [ 'name' => 'DisassociateApi', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v1/domainnames/{domainName}/apiassociation', ], 'input' => [ 'shape' => 'DisassociateApiRequest', ], 'output' => [ 'shape' => 'DisassociateApiResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], ], ], 'DisassociateMergedGraphqlApi' => [ 'name' => 'DisassociateMergedGraphqlApi', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v1/sourceApis/{sourceApiIdentifier}/mergedApiAssociations/{associationId}', ], 'input' => [ 'shape' => 'DisassociateMergedGraphqlApiRequest', ], 'output' => [ 'shape' => 'DisassociateMergedGraphqlApiResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], ], 'DisassociateSourceGraphqlApi' => [ 'name' => 'DisassociateSourceGraphqlApi', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v1/mergedApis/{mergedApiIdentifier}/sourceApiAssociations/{associationId}', ], 'input' => [ 'shape' => 'DisassociateSourceGraphqlApiRequest', ], 'output' => [ 'shape' => 'DisassociateSourceGraphqlApiResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], ], 'EvaluateCode' => [ 'name' => 'EvaluateCode', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/dataplane-evaluatecode', ], 'input' => [ 'shape' => 'EvaluateCodeRequest', ], 'output' => [ 'shape' => 'EvaluateCodeResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'BadRequestException', ], ], ], 'EvaluateMappingTemplate' => [ 'name' => 'EvaluateMappingTemplate', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/dataplane-evaluatetemplate', ], 'input' => [ 'shape' => 'EvaluateMappingTemplateRequest', ], 'output' => [ 'shape' => 'EvaluateMappingTemplateResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'BadRequestException', ], ], ], 'FlushApiCache' => [ 'name' => 'FlushApiCache', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v1/apis/{apiId}/FlushCache', ], 'input' => [ 'shape' => 'FlushApiCacheRequest', ], 'output' => [ 'shape' => 'FlushApiCacheResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'GetApiAssociation' => [ 'name' => 'GetApiAssociation', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/domainnames/{domainName}/apiassociation', ], 'input' => [ 'shape' => 'GetApiAssociationRequest', ], 'output' => [ 'shape' => 'GetApiAssociationResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], ], ], 'GetApiCache' => [ 'name' => 'GetApiCache', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/apis/{apiId}/ApiCaches', ], 'input' => [ 'shape' => 'GetApiCacheRequest', ], 'output' => [ 'shape' => 'GetApiCacheResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'GetDataSource' => [ 'name' => 'GetDataSource', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/apis/{apiId}/datasources/{name}', ], 'input' => [ 'shape' => 'GetDataSourceRequest', ], 'output' => [ 'shape' => 'GetDataSourceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'GetDomainName' => [ 'name' => 'GetDomainName', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/domainnames/{domainName}', ], 'input' => [ 'shape' => 'GetDomainNameRequest', ], 'output' => [ 'shape' => 'GetDomainNameResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], ], ], 'GetFunction' => [ 'name' => 'GetFunction', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/apis/{apiId}/functions/{functionId}', ], 'input' => [ 'shape' => 'GetFunctionRequest', ], 'output' => [ 'shape' => 'GetFunctionResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], ], ], 'GetGraphqlApi' => [ 'name' => 'GetGraphqlApi', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/apis/{apiId}', ], 'input' => [ 'shape' => 'GetGraphqlApiRequest', ], 'output' => [ 'shape' => 'GetGraphqlApiResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetIntrospectionSchema' => [ 'name' => 'GetIntrospectionSchema', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/apis/{apiId}/schema', ], 'input' => [ 'shape' => 'GetIntrospectionSchemaRequest', ], 'output' => [ 'shape' => 'GetIntrospectionSchemaResponse', ], 'errors' => [ [ 'shape' => 'GraphQLSchemaException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'GetResolver' => [ 'name' => 'GetResolver', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/apis/{apiId}/types/{typeName}/resolvers/{fieldName}', ], 'input' => [ 'shape' => 'GetResolverRequest', ], 'output' => [ 'shape' => 'GetResolverResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], ], ], 'GetSchemaCreationStatus' => [ 'name' => 'GetSchemaCreationStatus', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/apis/{apiId}/schemacreation', ], 'input' => [ 'shape' => 'GetSchemaCreationStatusRequest', ], 'output' => [ 'shape' => 'GetSchemaCreationStatusResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'GetSourceApiAssociation' => [ 'name' => 'GetSourceApiAssociation', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/mergedApis/{mergedApiIdentifier}/sourceApiAssociations/{associationId}', ], 'input' => [ 'shape' => 'GetSourceApiAssociationRequest', ], 'output' => [ 'shape' => 'GetSourceApiAssociationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], ], ], 'GetType' => [ 'name' => 'GetType', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/apis/{apiId}/types/{typeName}', ], 'input' => [ 'shape' => 'GetTypeRequest', ], 'output' => [ 'shape' => 'GetTypeResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'ListApiKeys' => [ 'name' => 'ListApiKeys', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/apis/{apiId}/apikeys', ], 'input' => [ 'shape' => 'ListApiKeysRequest', ], 'output' => [ 'shape' => 'ListApiKeysResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'ListDataSources' => [ 'name' => 'ListDataSources', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/apis/{apiId}/datasources', ], 'input' => [ 'shape' => 'ListDataSourcesRequest', ], 'output' => [ 'shape' => 'ListDataSourcesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'ListDomainNames' => [ 'name' => 'ListDomainNames', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/domainnames', ], 'input' => [ 'shape' => 'ListDomainNamesRequest', ], 'output' => [ 'shape' => 'ListDomainNamesResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'ListFunctions' => [ 'name' => 'ListFunctions', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/apis/{apiId}/functions', ], 'input' => [ 'shape' => 'ListFunctionsRequest', ], 'output' => [ 'shape' => 'ListFunctionsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'ListGraphqlApis' => [ 'name' => 'ListGraphqlApis', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/apis', ], 'input' => [ 'shape' => 'ListGraphqlApisRequest', ], 'output' => [ 'shape' => 'ListGraphqlApisResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'ListResolvers' => [ 'name' => 'ListResolvers', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/apis/{apiId}/types/{typeName}/resolvers', ], 'input' => [ 'shape' => 'ListResolversRequest', ], 'output' => [ 'shape' => 'ListResolversResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'ListResolversByFunction' => [ 'name' => 'ListResolversByFunction', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/apis/{apiId}/functions/{functionId}/resolvers', ], 'input' => [ 'shape' => 'ListResolversByFunctionRequest', ], 'output' => [ 'shape' => 'ListResolversByFunctionResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'ListSourceApiAssociations' => [ 'name' => 'ListSourceApiAssociations', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/apis/{apiId}/sourceApiAssociations', ], 'input' => [ 'shape' => 'ListSourceApiAssociationsRequest', ], 'output' => [ 'shape' => 'ListSourceApiAssociationsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/tags/{resourceArn}', ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListTypes' => [ 'name' => 'ListTypes', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/apis/{apiId}/types', ], 'input' => [ 'shape' => 'ListTypesRequest', ], 'output' => [ 'shape' => 'ListTypesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'ListTypesByAssociation' => [ 'name' => 'ListTypesByAssociation', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/mergedApis/{mergedApiIdentifier}/sourceApiAssociations/{associationId}/types', ], 'input' => [ 'shape' => 'ListTypesByAssociationRequest', ], 'output' => [ 'shape' => 'ListTypesByAssociationResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'StartSchemaCreation' => [ 'name' => 'StartSchemaCreation', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/apis/{apiId}/schemacreation', ], 'input' => [ 'shape' => 'StartSchemaCreationRequest', ], 'output' => [ 'shape' => 'StartSchemaCreationResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'StartSchemaMerge' => [ 'name' => 'StartSchemaMerge', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/mergedApis/{mergedApiIdentifier}/sourceApiAssociations/{associationId}/merge', ], 'input' => [ 'shape' => 'StartSchemaMergeRequest', ], 'output' => [ 'shape' => 'StartSchemaMergeResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/tags/{resourceArn}', ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v1/tags/{resourceArn}', ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'UpdateApiCache' => [ 'name' => 'UpdateApiCache', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/apis/{apiId}/ApiCaches/update', ], 'input' => [ 'shape' => 'UpdateApiCacheRequest', ], 'output' => [ 'shape' => 'UpdateApiCacheResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'UpdateApiKey' => [ 'name' => 'UpdateApiKey', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/apis/{apiId}/apikeys/{id}', ], 'input' => [ 'shape' => 'UpdateApiKeyRequest', ], 'output' => [ 'shape' => 'UpdateApiKeyResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'ApiKeyValidityOutOfBoundsException', ], ], ], 'UpdateDataSource' => [ 'name' => 'UpdateDataSource', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/apis/{apiId}/datasources/{name}', ], 'input' => [ 'shape' => 'UpdateDataSourceRequest', ], 'output' => [ 'shape' => 'UpdateDataSourceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'UpdateDomainName' => [ 'name' => 'UpdateDomainName', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/domainnames/{domainName}', ], 'input' => [ 'shape' => 'UpdateDomainNameRequest', ], 'output' => [ 'shape' => 'UpdateDomainNameResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], ], ], 'UpdateFunction' => [ 'name' => 'UpdateFunction', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/apis/{apiId}/functions/{functionId}', ], 'input' => [ 'shape' => 'UpdateFunctionRequest', ], 'output' => [ 'shape' => 'UpdateFunctionResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], 'UpdateGraphqlApi' => [ 'name' => 'UpdateGraphqlApi', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/apis/{apiId}', ], 'input' => [ 'shape' => 'UpdateGraphqlApiRequest', ], 'output' => [ 'shape' => 'UpdateGraphqlApiResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'UpdateResolver' => [ 'name' => 'UpdateResolver', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/apis/{apiId}/types/{typeName}/resolvers/{fieldName}', ], 'input' => [ 'shape' => 'UpdateResolverRequest', ], 'output' => [ 'shape' => 'UpdateResolverResponse', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'BadRequestException', ], ], ], 'UpdateSourceApiAssociation' => [ 'name' => 'UpdateSourceApiAssociation', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/mergedApis/{mergedApiIdentifier}/sourceApiAssociations/{associationId}', ], 'input' => [ 'shape' => 'UpdateSourceApiAssociationRequest', ], 'output' => [ 'shape' => 'UpdateSourceApiAssociationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'InternalFailureException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConcurrentModificationException', ], ], ], 'UpdateType' => [ 'name' => 'UpdateType', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/apis/{apiId}/types/{typeName}', ], 'input' => [ 'shape' => 'UpdateTypeRequest', ], 'output' => [ 'shape' => 'UpdateTypeResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'InternalFailureException', ], ], ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 403, ], 'exception' => true, ], 'AdditionalAuthenticationProvider' => [ 'type' => 'structure', 'members' => [ 'authenticationType' => [ 'shape' => 'AuthenticationType', ], 'openIDConnectConfig' => [ 'shape' => 'OpenIDConnectConfig', ], 'userPoolConfig' => [ 'shape' => 'CognitoUserPoolConfig', ], 'lambdaAuthorizerConfig' => [ 'shape' => 'LambdaAuthorizerConfig', ], ], ], 'AdditionalAuthenticationProviders' => [ 'type' => 'list', 'member' => [ 'shape' => 'AdditionalAuthenticationProvider', ], ], 'ApiAssociation' => [ 'type' => 'structure', 'members' => [ 'domainName' => [ 'shape' => 'DomainName', ], 'apiId' => [ 'shape' => 'String', ], 'associationStatus' => [ 'shape' => 'AssociationStatus', ], 'deploymentDetail' => [ 'shape' => 'String', ], ], ], 'ApiCache' => [ 'type' => 'structure', 'members' => [ 'ttl' => [ 'shape' => 'Long', ], 'apiCachingBehavior' => [ 'shape' => 'ApiCachingBehavior', ], 'transitEncryptionEnabled' => [ 'shape' => 'Boolean', ], 'atRestEncryptionEnabled' => [ 'shape' => 'Boolean', ], 'type' => [ 'shape' => 'ApiCacheType', ], 'status' => [ 'shape' => 'ApiCacheStatus', ], ], ], 'ApiCacheStatus' => [ 'type' => 'string', 'enum' => [ 'AVAILABLE', 'CREATING', 'DELETING', 'MODIFYING', 'FAILED', ], ], 'ApiCacheType' => [ 'type' => 'string', 'enum' => [ 'T2_SMALL', 'T2_MEDIUM', 'R4_LARGE', 'R4_XLARGE', 'R4_2XLARGE', 'R4_4XLARGE', 'R4_8XLARGE', 'SMALL', 'MEDIUM', 'LARGE', 'XLARGE', 'LARGE_2X', 'LARGE_4X', 'LARGE_8X', 'LARGE_12X', ], ], 'ApiCachingBehavior' => [ 'type' => 'string', 'enum' => [ 'FULL_REQUEST_CACHING', 'PER_RESOLVER_CACHING', ], ], 'ApiKey' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'expires' => [ 'shape' => 'Long', ], 'deletes' => [ 'shape' => 'Long', ], ], ], 'ApiKeyLimitExceededException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ApiKeyValidityOutOfBoundsException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ApiKeys' => [ 'type' => 'list', 'member' => [ 'shape' => 'ApiKey', ], ], 'ApiLimitExceededException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'AppSyncRuntime' => [ 'type' => 'structure', 'required' => [ 'name', 'runtimeVersion', ], 'members' => [ 'name' => [ 'shape' => 'RuntimeName', ], 'runtimeVersion' => [ 'shape' => 'String', ], ], ], 'AssociateApiRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', 'apiId', ], 'members' => [ 'domainName' => [ 'shape' => 'DomainName', 'location' => 'uri', 'locationName' => 'domainName', ], 'apiId' => [ 'shape' => 'String', ], ], ], 'AssociateApiResponse' => [ 'type' => 'structure', 'members' => [ 'apiAssociation' => [ 'shape' => 'ApiAssociation', ], ], ], 'AssociateMergedGraphqlApiRequest' => [ 'type' => 'structure', 'required' => [ 'sourceApiIdentifier', 'mergedApiIdentifier', ], 'members' => [ 'sourceApiIdentifier' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'sourceApiIdentifier', ], 'mergedApiIdentifier' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'sourceApiAssociationConfig' => [ 'shape' => 'SourceApiAssociationConfig', ], ], ], 'AssociateMergedGraphqlApiResponse' => [ 'type' => 'structure', 'members' => [ 'sourceApiAssociation' => [ 'shape' => 'SourceApiAssociation', ], ], ], 'AssociateSourceGraphqlApiRequest' => [ 'type' => 'structure', 'required' => [ 'mergedApiIdentifier', 'sourceApiIdentifier', ], 'members' => [ 'mergedApiIdentifier' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'mergedApiIdentifier', ], 'sourceApiIdentifier' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'sourceApiAssociationConfig' => [ 'shape' => 'SourceApiAssociationConfig', ], ], ], 'AssociateSourceGraphqlApiResponse' => [ 'type' => 'structure', 'members' => [ 'sourceApiAssociation' => [ 'shape' => 'SourceApiAssociation', ], ], ], 'AssociationStatus' => [ 'type' => 'string', 'enum' => [ 'PROCESSING', 'FAILED', 'SUCCESS', ], ], 'AuthenticationType' => [ 'type' => 'string', 'enum' => [ 'API_KEY', 'AWS_IAM', 'AMAZON_COGNITO_USER_POOLS', 'OPENID_CONNECT', 'AWS_LAMBDA', ], ], 'AuthorizationConfig' => [ 'type' => 'structure', 'required' => [ 'authorizationType', ], 'members' => [ 'authorizationType' => [ 'shape' => 'AuthorizationType', ], 'awsIamConfig' => [ 'shape' => 'AwsIamConfig', ], ], ], 'AuthorizationType' => [ 'type' => 'string', 'enum' => [ 'AWS_IAM', ], ], 'AwsIamConfig' => [ 'type' => 'structure', 'members' => [ 'signingRegion' => [ 'shape' => 'String', ], 'signingServiceName' => [ 'shape' => 'String', ], ], ], 'BadRequestDetail' => [ 'type' => 'structure', 'members' => [ 'codeErrors' => [ 'shape' => 'CodeErrors', ], ], ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], 'reason' => [ 'shape' => 'BadRequestReason', ], 'detail' => [ 'shape' => 'BadRequestDetail', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'BadRequestReason' => [ 'type' => 'string', 'enum' => [ 'CODE_ERROR', ], ], 'Blob' => [ 'type' => 'blob', ], 'Boolean' => [ 'type' => 'boolean', ], 'BooleanValue' => [ 'type' => 'boolean', ], 'CachingConfig' => [ 'type' => 'structure', 'required' => [ 'ttl', ], 'members' => [ 'ttl' => [ 'shape' => 'Long', ], 'cachingKeys' => [ 'shape' => 'CachingKeys', ], ], ], 'CachingKeys' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'CertificateArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 20, 'pattern' => '^arn:[a-z-]*:(acm|iam):[a-z0-9-]*:\\\\d{12}:(certificate|server-certificate)/[0-9A-Za-z_/-]*$', ], 'Code' => [ 'type' => 'string', 'max' => 32768, 'min' => 1, ], 'CodeError' => [ 'type' => 'structure', 'members' => [ 'errorType' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], 'location' => [ 'shape' => 'CodeErrorLocation', ], ], ], 'CodeErrorColumn' => [ 'type' => 'integer', ], 'CodeErrorLine' => [ 'type' => 'integer', ], 'CodeErrorLocation' => [ 'type' => 'structure', 'members' => [ 'line' => [ 'shape' => 'CodeErrorLine', ], 'column' => [ 'shape' => 'CodeErrorColumn', ], 'span' => [ 'shape' => 'CodeErrorSpan', ], ], ], 'CodeErrorSpan' => [ 'type' => 'integer', ], 'CodeErrors' => [ 'type' => 'list', 'member' => [ 'shape' => 'CodeError', ], ], 'CognitoUserPoolConfig' => [ 'type' => 'structure', 'required' => [ 'userPoolId', 'awsRegion', ], 'members' => [ 'userPoolId' => [ 'shape' => 'String', ], 'awsRegion' => [ 'shape' => 'String', ], 'appIdClientRegex' => [ 'shape' => 'String', ], ], ], 'ConcurrentModificationException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'ConflictDetectionType' => [ 'type' => 'string', 'enum' => [ 'VERSION', 'NONE', ], ], 'ConflictHandlerType' => [ 'type' => 'string', 'enum' => [ 'OPTIMISTIC_CONCURRENCY', 'LAMBDA', 'AUTOMERGE', 'NONE', ], ], 'Context' => [ 'type' => 'string', 'max' => 28000, 'min' => 2, 'pattern' => '^[\\\\s\\\\S]*$', ], 'CreateApiCacheRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'ttl', 'apiCachingBehavior', 'type', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'ttl' => [ 'shape' => 'Long', ], 'transitEncryptionEnabled' => [ 'shape' => 'Boolean', ], 'atRestEncryptionEnabled' => [ 'shape' => 'Boolean', ], 'apiCachingBehavior' => [ 'shape' => 'ApiCachingBehavior', ], 'type' => [ 'shape' => 'ApiCacheType', ], ], ], 'CreateApiCacheResponse' => [ 'type' => 'structure', 'members' => [ 'apiCache' => [ 'shape' => 'ApiCache', ], ], ], 'CreateApiKeyRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'description' => [ 'shape' => 'String', ], 'expires' => [ 'shape' => 'Long', ], ], ], 'CreateApiKeyResponse' => [ 'type' => 'structure', 'members' => [ 'apiKey' => [ 'shape' => 'ApiKey', ], ], ], 'CreateDataSourceRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'name', 'type', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'name' => [ 'shape' => 'ResourceName', ], 'description' => [ 'shape' => 'String', ], 'type' => [ 'shape' => 'DataSourceType', ], 'serviceRoleArn' => [ 'shape' => 'String', ], 'dynamodbConfig' => [ 'shape' => 'DynamodbDataSourceConfig', ], 'lambdaConfig' => [ 'shape' => 'LambdaDataSourceConfig', ], 'elasticsearchConfig' => [ 'shape' => 'ElasticsearchDataSourceConfig', ], 'openSearchServiceConfig' => [ 'shape' => 'OpenSearchServiceDataSourceConfig', ], 'httpConfig' => [ 'shape' => 'HttpDataSourceConfig', ], 'relationalDatabaseConfig' => [ 'shape' => 'RelationalDatabaseDataSourceConfig', ], 'eventBridgeConfig' => [ 'shape' => 'EventBridgeDataSourceConfig', ], ], ], 'CreateDataSourceResponse' => [ 'type' => 'structure', 'members' => [ 'dataSource' => [ 'shape' => 'DataSource', ], ], ], 'CreateDomainNameRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', 'certificateArn', ], 'members' => [ 'domainName' => [ 'shape' => 'DomainName', ], 'certificateArn' => [ 'shape' => 'CertificateArn', ], 'description' => [ 'shape' => 'Description', ], ], ], 'CreateDomainNameResponse' => [ 'type' => 'structure', 'members' => [ 'domainNameConfig' => [ 'shape' => 'DomainNameConfig', ], ], ], 'CreateFunctionRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'name', 'dataSourceName', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'name' => [ 'shape' => 'ResourceName', ], 'description' => [ 'shape' => 'String', ], 'dataSourceName' => [ 'shape' => 'ResourceName', ], 'requestMappingTemplate' => [ 'shape' => 'MappingTemplate', ], 'responseMappingTemplate' => [ 'shape' => 'MappingTemplate', ], 'functionVersion' => [ 'shape' => 'String', ], 'syncConfig' => [ 'shape' => 'SyncConfig', ], 'maxBatchSize' => [ 'shape' => 'MaxBatchSize', ], 'runtime' => [ 'shape' => 'AppSyncRuntime', ], 'code' => [ 'shape' => 'Code', ], ], ], 'CreateFunctionResponse' => [ 'type' => 'structure', 'members' => [ 'functionConfiguration' => [ 'shape' => 'FunctionConfiguration', ], ], ], 'CreateGraphqlApiRequest' => [ 'type' => 'structure', 'required' => [ 'name', 'authenticationType', ], 'members' => [ 'name' => [ 'shape' => 'String', ], 'logConfig' => [ 'shape' => 'LogConfig', ], 'authenticationType' => [ 'shape' => 'AuthenticationType', ], 'userPoolConfig' => [ 'shape' => 'UserPoolConfig', ], 'openIDConnectConfig' => [ 'shape' => 'OpenIDConnectConfig', ], 'tags' => [ 'shape' => 'TagMap', ], 'additionalAuthenticationProviders' => [ 'shape' => 'AdditionalAuthenticationProviders', ], 'xrayEnabled' => [ 'shape' => 'Boolean', ], 'lambdaAuthorizerConfig' => [ 'shape' => 'LambdaAuthorizerConfig', ], 'visibility' => [ 'shape' => 'GraphQLApiVisibility', ], 'apiType' => [ 'shape' => 'GraphQLApiType', ], 'mergedApiExecutionRoleArn' => [ 'shape' => 'String', ], 'ownerContact' => [ 'shape' => 'String', ], ], ], 'CreateGraphqlApiResponse' => [ 'type' => 'structure', 'members' => [ 'graphqlApi' => [ 'shape' => 'GraphqlApi', ], ], ], 'CreateResolverRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'typeName', 'fieldName', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'typeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'typeName', ], 'fieldName' => [ 'shape' => 'ResourceName', ], 'dataSourceName' => [ 'shape' => 'ResourceName', ], 'requestMappingTemplate' => [ 'shape' => 'MappingTemplate', ], 'responseMappingTemplate' => [ 'shape' => 'MappingTemplate', ], 'kind' => [ 'shape' => 'ResolverKind', ], 'pipelineConfig' => [ 'shape' => 'PipelineConfig', ], 'syncConfig' => [ 'shape' => 'SyncConfig', ], 'cachingConfig' => [ 'shape' => 'CachingConfig', ], 'maxBatchSize' => [ 'shape' => 'MaxBatchSize', ], 'runtime' => [ 'shape' => 'AppSyncRuntime', ], 'code' => [ 'shape' => 'Code', ], ], ], 'CreateResolverResponse' => [ 'type' => 'structure', 'members' => [ 'resolver' => [ 'shape' => 'Resolver', ], ], ], 'CreateTypeRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'definition', 'format', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'definition' => [ 'shape' => 'String', ], 'format' => [ 'shape' => 'TypeDefinitionFormat', ], ], ], 'CreateTypeResponse' => [ 'type' => 'structure', 'members' => [ 'type' => [ 'shape' => 'Type', ], ], ], 'DataSource' => [ 'type' => 'structure', 'members' => [ 'dataSourceArn' => [ 'shape' => 'String', ], 'name' => [ 'shape' => 'ResourceName', ], 'description' => [ 'shape' => 'String', ], 'type' => [ 'shape' => 'DataSourceType', ], 'serviceRoleArn' => [ 'shape' => 'String', ], 'dynamodbConfig' => [ 'shape' => 'DynamodbDataSourceConfig', ], 'lambdaConfig' => [ 'shape' => 'LambdaDataSourceConfig', ], 'elasticsearchConfig' => [ 'shape' => 'ElasticsearchDataSourceConfig', ], 'openSearchServiceConfig' => [ 'shape' => 'OpenSearchServiceDataSourceConfig', ], 'httpConfig' => [ 'shape' => 'HttpDataSourceConfig', ], 'relationalDatabaseConfig' => [ 'shape' => 'RelationalDatabaseDataSourceConfig', ], 'eventBridgeConfig' => [ 'shape' => 'EventBridgeDataSourceConfig', ], ], ], 'DataSourceType' => [ 'type' => 'string', 'enum' => [ 'AWS_LAMBDA', 'AMAZON_DYNAMODB', 'AMAZON_ELASTICSEARCH', 'NONE', 'HTTP', 'RELATIONAL_DATABASE', 'AMAZON_OPENSEARCH_SERVICE', 'AMAZON_EVENTBRIDGE', ], ], 'DataSources' => [ 'type' => 'list', 'member' => [ 'shape' => 'DataSource', ], ], 'Date' => [ 'type' => 'timestamp', ], 'DefaultAction' => [ 'type' => 'string', 'enum' => [ 'ALLOW', 'DENY', ], ], 'DeleteApiCacheRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], ], ], 'DeleteApiCacheResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteApiKeyRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'id', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'id' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'id', ], ], ], 'DeleteApiKeyResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteDataSourceRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'name', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'name' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'name', ], ], ], 'DeleteDataSourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteDomainNameRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', ], 'members' => [ 'domainName' => [ 'shape' => 'DomainName', 'location' => 'uri', 'locationName' => 'domainName', ], ], ], 'DeleteDomainNameResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteFunctionRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'functionId', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'functionId' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'functionId', ], ], ], 'DeleteFunctionResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteGraphqlApiRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], ], ], 'DeleteGraphqlApiResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteResolverRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'typeName', 'fieldName', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'typeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'typeName', ], 'fieldName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'fieldName', ], ], ], 'DeleteResolverResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteTypeRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'typeName', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'typeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'typeName', ], ], ], 'DeleteTypeResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeltaSyncConfig' => [ 'type' => 'structure', 'members' => [ 'baseTableTTL' => [ 'shape' => 'Long', ], 'deltaSyncTableName' => [ 'shape' => 'String', ], 'deltaSyncTableTTL' => [ 'shape' => 'Long', ], ], ], 'Description' => [ 'type' => 'string', 'max' => 255, 'min' => 0, 'pattern' => '^.*$', ], 'DisassociateApiRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', ], 'members' => [ 'domainName' => [ 'shape' => 'DomainName', 'location' => 'uri', 'locationName' => 'domainName', ], ], ], 'DisassociateApiResponse' => [ 'type' => 'structure', 'members' => [], ], 'DisassociateMergedGraphqlApiRequest' => [ 'type' => 'structure', 'required' => [ 'sourceApiIdentifier', 'associationId', ], 'members' => [ 'sourceApiIdentifier' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'sourceApiIdentifier', ], 'associationId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'associationId', ], ], ], 'DisassociateMergedGraphqlApiResponse' => [ 'type' => 'structure', 'members' => [ 'sourceApiAssociationStatus' => [ 'shape' => 'SourceApiAssociationStatus', ], ], ], 'DisassociateSourceGraphqlApiRequest' => [ 'type' => 'structure', 'required' => [ 'mergedApiIdentifier', 'associationId', ], 'members' => [ 'mergedApiIdentifier' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'mergedApiIdentifier', ], 'associationId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'associationId', ], ], ], 'DisassociateSourceGraphqlApiResponse' => [ 'type' => 'structure', 'members' => [ 'sourceApiAssociationStatus' => [ 'shape' => 'SourceApiAssociationStatus', ], ], ], 'DomainName' => [ 'type' => 'string', 'max' => 253, 'min' => 1, 'pattern' => '^(\\\\*[\\\\w\\\\d-]*\\\\.)?([\\\\w\\\\d-]+\\\\.)+[\\\\w\\\\d-]+$', ], 'DomainNameConfig' => [ 'type' => 'structure', 'members' => [ 'domainName' => [ 'shape' => 'DomainName', ], 'description' => [ 'shape' => 'Description', ], 'certificateArn' => [ 'shape' => 'CertificateArn', ], 'appsyncDomainName' => [ 'shape' => 'String', ], 'hostedZoneId' => [ 'shape' => 'String', ], ], ], 'DomainNameConfigs' => [ 'type' => 'list', 'member' => [ 'shape' => 'DomainNameConfig', ], ], 'DynamodbDataSourceConfig' => [ 'type' => 'structure', 'required' => [ 'tableName', 'awsRegion', ], 'members' => [ 'tableName' => [ 'shape' => 'String', ], 'awsRegion' => [ 'shape' => 'String', ], 'useCallerCredentials' => [ 'shape' => 'Boolean', ], 'deltaSyncConfig' => [ 'shape' => 'DeltaSyncConfig', ], 'versioned' => [ 'shape' => 'Boolean', ], ], ], 'ElasticsearchDataSourceConfig' => [ 'type' => 'structure', 'required' => [ 'endpoint', 'awsRegion', ], 'members' => [ 'endpoint' => [ 'shape' => 'String', ], 'awsRegion' => [ 'shape' => 'String', ], ], ], 'ErrorDetail' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], ], 'ErrorMessage' => [ 'type' => 'string', ], 'EvaluateCodeErrorDetail' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], 'codeErrors' => [ 'shape' => 'CodeErrors', ], ], ], 'EvaluateCodeRequest' => [ 'type' => 'structure', 'required' => [ 'runtime', 'code', 'context', ], 'members' => [ 'runtime' => [ 'shape' => 'AppSyncRuntime', ], 'code' => [ 'shape' => 'Code', ], 'context' => [ 'shape' => 'Context', ], 'function' => [ 'shape' => 'String', ], ], ], 'EvaluateCodeResponse' => [ 'type' => 'structure', 'members' => [ 'evaluationResult' => [ 'shape' => 'EvaluationResult', ], 'error' => [ 'shape' => 'EvaluateCodeErrorDetail', ], 'logs' => [ 'shape' => 'Logs', ], ], ], 'EvaluateMappingTemplateRequest' => [ 'type' => 'structure', 'required' => [ 'template', 'context', ], 'members' => [ 'template' => [ 'shape' => 'Template', ], 'context' => [ 'shape' => 'Context', ], ], ], 'EvaluateMappingTemplateResponse' => [ 'type' => 'structure', 'members' => [ 'evaluationResult' => [ 'shape' => 'EvaluationResult', ], 'error' => [ 'shape' => 'ErrorDetail', ], 'logs' => [ 'shape' => 'Logs', ], ], ], 'EvaluationResult' => [ 'type' => 'string', 'max' => 65536, 'min' => 0, 'pattern' => '^[\\\\s\\\\S]*$', ], 'EventBridgeDataSourceConfig' => [ 'type' => 'structure', 'required' => [ 'eventBusArn', ], 'members' => [ 'eventBusArn' => [ 'shape' => 'String', ], ], ], 'FieldLogLevel' => [ 'type' => 'string', 'enum' => [ 'NONE', 'ERROR', 'ALL', ], ], 'FlushApiCacheRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], ], ], 'FlushApiCacheResponse' => [ 'type' => 'structure', 'members' => [], ], 'FunctionConfiguration' => [ 'type' => 'structure', 'members' => [ 'functionId' => [ 'shape' => 'String', ], 'functionArn' => [ 'shape' => 'String', ], 'name' => [ 'shape' => 'ResourceName', ], 'description' => [ 'shape' => 'String', ], 'dataSourceName' => [ 'shape' => 'ResourceName', ], 'requestMappingTemplate' => [ 'shape' => 'MappingTemplate', ], 'responseMappingTemplate' => [ 'shape' => 'MappingTemplate', ], 'functionVersion' => [ 'shape' => 'String', ], 'syncConfig' => [ 'shape' => 'SyncConfig', ], 'maxBatchSize' => [ 'shape' => 'MaxBatchSize', ], 'runtime' => [ 'shape' => 'AppSyncRuntime', ], 'code' => [ 'shape' => 'Code', ], ], ], 'Functions' => [ 'type' => 'list', 'member' => [ 'shape' => 'FunctionConfiguration', ], ], 'FunctionsIds' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'GetApiAssociationRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', ], 'members' => [ 'domainName' => [ 'shape' => 'DomainName', 'location' => 'uri', 'locationName' => 'domainName', ], ], ], 'GetApiAssociationResponse' => [ 'type' => 'structure', 'members' => [ 'apiAssociation' => [ 'shape' => 'ApiAssociation', ], ], ], 'GetApiCacheRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], ], ], 'GetApiCacheResponse' => [ 'type' => 'structure', 'members' => [ 'apiCache' => [ 'shape' => 'ApiCache', ], ], ], 'GetDataSourceRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'name', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'name' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'name', ], ], ], 'GetDataSourceResponse' => [ 'type' => 'structure', 'members' => [ 'dataSource' => [ 'shape' => 'DataSource', ], ], ], 'GetDomainNameRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', ], 'members' => [ 'domainName' => [ 'shape' => 'DomainName', 'location' => 'uri', 'locationName' => 'domainName', ], ], ], 'GetDomainNameResponse' => [ 'type' => 'structure', 'members' => [ 'domainNameConfig' => [ 'shape' => 'DomainNameConfig', ], ], ], 'GetFunctionRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'functionId', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'functionId' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'functionId', ], ], ], 'GetFunctionResponse' => [ 'type' => 'structure', 'members' => [ 'functionConfiguration' => [ 'shape' => 'FunctionConfiguration', ], ], ], 'GetGraphqlApiRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], ], ], 'GetGraphqlApiResponse' => [ 'type' => 'structure', 'members' => [ 'graphqlApi' => [ 'shape' => 'GraphqlApi', ], ], ], 'GetIntrospectionSchemaRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'format', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'format' => [ 'shape' => 'OutputType', 'location' => 'querystring', 'locationName' => 'format', ], 'includeDirectives' => [ 'shape' => 'BooleanValue', 'location' => 'querystring', 'locationName' => 'includeDirectives', ], ], ], 'GetIntrospectionSchemaResponse' => [ 'type' => 'structure', 'members' => [ 'schema' => [ 'shape' => 'Blob', ], ], 'payload' => 'schema', ], 'GetResolverRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'typeName', 'fieldName', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'typeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'typeName', ], 'fieldName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'fieldName', ], ], ], 'GetResolverResponse' => [ 'type' => 'structure', 'members' => [ 'resolver' => [ 'shape' => 'Resolver', ], ], ], 'GetSchemaCreationStatusRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], ], ], 'GetSchemaCreationStatusResponse' => [ 'type' => 'structure', 'members' => [ 'status' => [ 'shape' => 'SchemaStatus', ], 'details' => [ 'shape' => 'String', ], ], ], 'GetSourceApiAssociationRequest' => [ 'type' => 'structure', 'required' => [ 'mergedApiIdentifier', 'associationId', ], 'members' => [ 'mergedApiIdentifier' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'mergedApiIdentifier', ], 'associationId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'associationId', ], ], ], 'GetSourceApiAssociationResponse' => [ 'type' => 'structure', 'members' => [ 'sourceApiAssociation' => [ 'shape' => 'SourceApiAssociation', ], ], ], 'GetTypeRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'typeName', 'format', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'typeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'typeName', ], 'format' => [ 'shape' => 'TypeDefinitionFormat', 'location' => 'querystring', 'locationName' => 'format', ], ], ], 'GetTypeResponse' => [ 'type' => 'structure', 'members' => [ 'type' => [ 'shape' => 'Type', ], ], ], 'GraphQLApiType' => [ 'type' => 'string', 'enum' => [ 'GRAPHQL', 'MERGED', ], ], 'GraphQLApiVisibility' => [ 'type' => 'string', 'enum' => [ 'GLOBAL', 'PRIVATE', ], ], 'GraphQLSchemaException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'GraphqlApi' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'ResourceName', ], 'apiId' => [ 'shape' => 'String', ], 'authenticationType' => [ 'shape' => 'AuthenticationType', ], 'logConfig' => [ 'shape' => 'LogConfig', ], 'userPoolConfig' => [ 'shape' => 'UserPoolConfig', ], 'openIDConnectConfig' => [ 'shape' => 'OpenIDConnectConfig', ], 'arn' => [ 'shape' => 'String', ], 'uris' => [ 'shape' => 'MapOfStringToString', ], 'tags' => [ 'shape' => 'TagMap', ], 'additionalAuthenticationProviders' => [ 'shape' => 'AdditionalAuthenticationProviders', ], 'xrayEnabled' => [ 'shape' => 'Boolean', ], 'wafWebAclArn' => [ 'shape' => 'String', ], 'lambdaAuthorizerConfig' => [ 'shape' => 'LambdaAuthorizerConfig', ], 'dns' => [ 'shape' => 'MapOfStringToString', ], 'visibility' => [ 'shape' => 'GraphQLApiVisibility', ], 'apiType' => [ 'shape' => 'GraphQLApiType', ], 'mergedApiExecutionRoleArn' => [ 'shape' => 'String', ], 'owner' => [ 'shape' => 'String', ], 'ownerContact' => [ 'shape' => 'String', ], ], ], 'GraphqlApis' => [ 'type' => 'list', 'member' => [ 'shape' => 'GraphqlApi', ], ], 'HttpDataSourceConfig' => [ 'type' => 'structure', 'members' => [ 'endpoint' => [ 'shape' => 'String', ], 'authorizationConfig' => [ 'shape' => 'AuthorizationConfig', ], ], ], 'InternalFailureException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'LambdaAuthorizerConfig' => [ 'type' => 'structure', 'required' => [ 'authorizerUri', ], 'members' => [ 'authorizerResultTtlInSeconds' => [ 'shape' => 'TTL', ], 'authorizerUri' => [ 'shape' => 'String', ], 'identityValidationExpression' => [ 'shape' => 'String', ], ], ], 'LambdaConflictHandlerConfig' => [ 'type' => 'structure', 'members' => [ 'lambdaConflictHandlerArn' => [ 'shape' => 'String', ], ], ], 'LambdaDataSourceConfig' => [ 'type' => 'structure', 'required' => [ 'lambdaFunctionArn', ], 'members' => [ 'lambdaFunctionArn' => [ 'shape' => 'String', ], ], ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], 'ListApiKeysRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListApiKeysResponse' => [ 'type' => 'structure', 'members' => [ 'apiKeys' => [ 'shape' => 'ApiKeys', ], 'nextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListDataSourcesRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListDataSourcesResponse' => [ 'type' => 'structure', 'members' => [ 'dataSources' => [ 'shape' => 'DataSources', ], 'nextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListDomainNamesRequest' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListDomainNamesResponse' => [ 'type' => 'structure', 'members' => [ 'domainNameConfigs' => [ 'shape' => 'DomainNameConfigs', ], 'nextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListFunctionsRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListFunctionsResponse' => [ 'type' => 'structure', 'members' => [ 'functions' => [ 'shape' => 'Functions', ], 'nextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListGraphqlApisRequest' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'apiType' => [ 'shape' => 'GraphQLApiType', 'location' => 'querystring', 'locationName' => 'apiType', ], 'owner' => [ 'shape' => 'Ownership', 'location' => 'querystring', 'locationName' => 'owner', ], ], ], 'ListGraphqlApisResponse' => [ 'type' => 'structure', 'members' => [ 'graphqlApis' => [ 'shape' => 'GraphqlApis', ], 'nextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListResolversByFunctionRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'functionId', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'functionId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'functionId', ], 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListResolversByFunctionResponse' => [ 'type' => 'structure', 'members' => [ 'resolvers' => [ 'shape' => 'Resolvers', ], 'nextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListResolversRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'typeName', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'typeName' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'typeName', ], 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListResolversResponse' => [ 'type' => 'structure', 'members' => [ 'resolvers' => [ 'shape' => 'Resolvers', ], 'nextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListSourceApiAssociationsRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListSourceApiAssociationsResponse' => [ 'type' => 'structure', 'members' => [ 'sourceApiAssociationSummaries' => [ 'shape' => 'SourceApiAssociationSummaryList', ], 'nextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', ], 'members' => [ 'resourceArn' => [ 'shape' => 'ResourceArn', 'location' => 'uri', 'locationName' => 'resourceArn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'tags' => [ 'shape' => 'TagMap', ], ], ], 'ListTypesByAssociationRequest' => [ 'type' => 'structure', 'required' => [ 'mergedApiIdentifier', 'associationId', 'format', ], 'members' => [ 'mergedApiIdentifier' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'mergedApiIdentifier', ], 'associationId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'associationId', ], 'format' => [ 'shape' => 'TypeDefinitionFormat', 'location' => 'querystring', 'locationName' => 'format', ], 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListTypesByAssociationResponse' => [ 'type' => 'structure', 'members' => [ 'types' => [ 'shape' => 'TypeList', ], 'nextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListTypesRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'format', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'format' => [ 'shape' => 'TypeDefinitionFormat', 'location' => 'querystring', 'locationName' => 'format', ], 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListTypesResponse' => [ 'type' => 'structure', 'members' => [ 'types' => [ 'shape' => 'TypeList', ], 'nextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'LogConfig' => [ 'type' => 'structure', 'required' => [ 'fieldLogLevel', 'cloudWatchLogsRoleArn', ], 'members' => [ 'fieldLogLevel' => [ 'shape' => 'FieldLogLevel', ], 'cloudWatchLogsRoleArn' => [ 'shape' => 'String', ], 'excludeVerboseContent' => [ 'shape' => 'Boolean', ], ], ], 'Logs' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'Long' => [ 'type' => 'long', ], 'MapOfStringToString' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], 'MappingTemplate' => [ 'type' => 'string', 'max' => 65536, 'min' => 1, 'pattern' => '^.*$', ], 'MaxBatchSize' => [ 'type' => 'integer', 'max' => 2000, 'min' => 0, ], 'MaxResults' => [ 'type' => 'integer', 'max' => 25, 'min' => 0, ], 'MergeType' => [ 'type' => 'string', 'enum' => [ 'MANUAL_MERGE', 'AUTO_MERGE', ], ], 'NotFoundException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'OpenIDConnectConfig' => [ 'type' => 'structure', 'required' => [ 'issuer', ], 'members' => [ 'issuer' => [ 'shape' => 'String', ], 'clientId' => [ 'shape' => 'String', ], 'iatTTL' => [ 'shape' => 'Long', ], 'authTTL' => [ 'shape' => 'Long', ], ], ], 'OpenSearchServiceDataSourceConfig' => [ 'type' => 'structure', 'required' => [ 'endpoint', 'awsRegion', ], 'members' => [ 'endpoint' => [ 'shape' => 'String', ], 'awsRegion' => [ 'shape' => 'String', ], ], ], 'OutputType' => [ 'type' => 'string', 'enum' => [ 'SDL', 'JSON', ], ], 'Ownership' => [ 'type' => 'string', 'enum' => [ 'CURRENT_ACCOUNT', 'OTHER_ACCOUNTS', ], ], 'PaginationToken' => [ 'type' => 'string', 'max' => 65536, 'min' => 1, 'pattern' => '[\\\\\\\\S]+', ], 'PipelineConfig' => [ 'type' => 'structure', 'members' => [ 'functions' => [ 'shape' => 'FunctionsIds', ], ], ], 'RdsHttpEndpointConfig' => [ 'type' => 'structure', 'members' => [ 'awsRegion' => [ 'shape' => 'String', ], 'dbClusterIdentifier' => [ 'shape' => 'String', ], 'databaseName' => [ 'shape' => 'String', ], 'schema' => [ 'shape' => 'String', ], 'awsSecretStoreArn' => [ 'shape' => 'String', ], ], ], 'RelationalDatabaseDataSourceConfig' => [ 'type' => 'structure', 'members' => [ 'relationalDatabaseSourceType' => [ 'shape' => 'RelationalDatabaseSourceType', ], 'rdsHttpEndpointConfig' => [ 'shape' => 'RdsHttpEndpointConfig', ], ], ], 'RelationalDatabaseSourceType' => [ 'type' => 'string', 'enum' => [ 'RDS_HTTP_ENDPOINT', ], ], 'Resolver' => [ 'type' => 'structure', 'members' => [ 'typeName' => [ 'shape' => 'ResourceName', ], 'fieldName' => [ 'shape' => 'ResourceName', ], 'dataSourceName' => [ 'shape' => 'ResourceName', ], 'resolverArn' => [ 'shape' => 'String', ], 'requestMappingTemplate' => [ 'shape' => 'MappingTemplate', ], 'responseMappingTemplate' => [ 'shape' => 'MappingTemplate', ], 'kind' => [ 'shape' => 'ResolverKind', ], 'pipelineConfig' => [ 'shape' => 'PipelineConfig', ], 'syncConfig' => [ 'shape' => 'SyncConfig', ], 'cachingConfig' => [ 'shape' => 'CachingConfig', ], 'maxBatchSize' => [ 'shape' => 'MaxBatchSize', ], 'runtime' => [ 'shape' => 'AppSyncRuntime', ], 'code' => [ 'shape' => 'Code', ], ], ], 'ResolverKind' => [ 'type' => 'string', 'enum' => [ 'UNIT', 'PIPELINE', ], ], 'Resolvers' => [ 'type' => 'list', 'member' => [ 'shape' => 'Resolver', ], ], 'ResourceArn' => [ 'type' => 'string', 'max' => 75, 'min' => 70, 'pattern' => '^arn:aws:appsync:[A-Za-z0-9_/.-]{0,63}:\\\\d{12}:apis/[0-9A-Za-z_-]{26}$', ], 'ResourceName' => [ 'type' => 'string', 'max' => 65536, 'min' => 1, 'pattern' => '[_A-Za-z][_0-9A-Za-z]*', ], 'RuntimeName' => [ 'type' => 'string', 'enum' => [ 'APPSYNC_JS', ], ], 'SchemaStatus' => [ 'type' => 'string', 'enum' => [ 'PROCESSING', 'ACTIVE', 'DELETING', 'FAILED', 'SUCCESS', 'NOT_APPLICABLE', ], ], 'SourceApiAssociation' => [ 'type' => 'structure', 'members' => [ 'associationId' => [ 'shape' => 'String', ], 'associationArn' => [ 'shape' => 'String', ], 'sourceApiId' => [ 'shape' => 'String', ], 'sourceApiArn' => [ 'shape' => 'String', ], 'mergedApiArn' => [ 'shape' => 'String', ], 'mergedApiId' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], 'sourceApiAssociationConfig' => [ 'shape' => 'SourceApiAssociationConfig', ], 'sourceApiAssociationStatus' => [ 'shape' => 'SourceApiAssociationStatus', ], 'sourceApiAssociationStatusDetail' => [ 'shape' => 'String', ], 'lastSuccessfulMergeDate' => [ 'shape' => 'Date', ], ], ], 'SourceApiAssociationConfig' => [ 'type' => 'structure', 'members' => [ 'mergeType' => [ 'shape' => 'MergeType', ], ], ], 'SourceApiAssociationStatus' => [ 'type' => 'string', 'enum' => [ 'MERGE_SCHEDULED', 'MERGE_FAILED', 'MERGE_SUCCESS', 'MERGE_IN_PROGRESS', 'AUTO_MERGE_SCHEDULE_FAILED', 'DELETION_SCHEDULED', 'DELETION_IN_PROGRESS', 'DELETION_FAILED', ], ], 'SourceApiAssociationSummary' => [ 'type' => 'structure', 'members' => [ 'associationId' => [ 'shape' => 'String', ], 'associationArn' => [ 'shape' => 'String', ], 'sourceApiId' => [ 'shape' => 'String', ], 'sourceApiArn' => [ 'shape' => 'String', ], 'mergedApiId' => [ 'shape' => 'String', ], 'mergedApiArn' => [ 'shape' => 'String', ], 'description' => [ 'shape' => 'String', ], ], ], 'SourceApiAssociationSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SourceApiAssociationSummary', ], ], 'StartSchemaCreationRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'definition', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'definition' => [ 'shape' => 'Blob', ], ], ], 'StartSchemaCreationResponse' => [ 'type' => 'structure', 'members' => [ 'status' => [ 'shape' => 'SchemaStatus', ], ], ], 'StartSchemaMergeRequest' => [ 'type' => 'structure', 'required' => [ 'associationId', 'mergedApiIdentifier', ], 'members' => [ 'associationId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'associationId', ], 'mergedApiIdentifier' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'mergedApiIdentifier', ], ], ], 'StartSchemaMergeResponse' => [ 'type' => 'structure', 'members' => [ 'sourceApiAssociationStatus' => [ 'shape' => 'SourceApiAssociationStatus', ], ], ], 'String' => [ 'type' => 'string', ], 'SyncConfig' => [ 'type' => 'structure', 'members' => [ 'conflictHandler' => [ 'shape' => 'ConflictHandlerType', ], 'conflictDetection' => [ 'shape' => 'ConflictDetectionType', ], 'lambdaConflictHandlerConfig' => [ 'shape' => 'LambdaConflictHandlerConfig', ], ], ], 'TTL' => [ 'type' => 'integer', 'max' => 3600, 'min' => 0, ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^(?!aws:)[ a-zA-Z+-=._:/]+$', ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 50, 'min' => 1, ], 'TagMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'TagKey', ], 'value' => [ 'shape' => 'TagValue', ], 'max' => 50, 'min' => 1, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tags', ], 'members' => [ 'resourceArn' => [ 'shape' => 'ResourceArn', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'pattern' => '^[\\\\s\\\\w+-=\\\\.:/@]*$', ], 'Template' => [ 'type' => 'string', 'max' => 65536, 'min' => 2, 'pattern' => '^[\\\\s\\\\S]*$', ], 'Type' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'ResourceName', ], 'description' => [ 'shape' => 'String', ], 'arn' => [ 'shape' => 'String', ], 'definition' => [ 'shape' => 'String', ], 'format' => [ 'shape' => 'TypeDefinitionFormat', ], ], ], 'TypeDefinitionFormat' => [ 'type' => 'string', 'enum' => [ 'SDL', 'JSON', ], ], 'TypeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Type', ], ], 'UnauthorizedException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tagKeys', ], 'members' => [ 'resourceArn' => [ 'shape' => 'ResourceArn', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tagKeys' => [ 'shape' => 'TagKeyList', 'location' => 'querystring', 'locationName' => 'tagKeys', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateApiCacheRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'ttl', 'apiCachingBehavior', 'type', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'ttl' => [ 'shape' => 'Long', ], 'apiCachingBehavior' => [ 'shape' => 'ApiCachingBehavior', ], 'type' => [ 'shape' => 'ApiCacheType', ], ], ], 'UpdateApiCacheResponse' => [ 'type' => 'structure', 'members' => [ 'apiCache' => [ 'shape' => 'ApiCache', ], ], ], 'UpdateApiKeyRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'id', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'id' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'id', ], 'description' => [ 'shape' => 'String', ], 'expires' => [ 'shape' => 'Long', ], ], ], 'UpdateApiKeyResponse' => [ 'type' => 'structure', 'members' => [ 'apiKey' => [ 'shape' => 'ApiKey', ], ], ], 'UpdateDataSourceRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'name', 'type', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'name' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'name', ], 'description' => [ 'shape' => 'String', ], 'type' => [ 'shape' => 'DataSourceType', ], 'serviceRoleArn' => [ 'shape' => 'String', ], 'dynamodbConfig' => [ 'shape' => 'DynamodbDataSourceConfig', ], 'lambdaConfig' => [ 'shape' => 'LambdaDataSourceConfig', ], 'elasticsearchConfig' => [ 'shape' => 'ElasticsearchDataSourceConfig', ], 'openSearchServiceConfig' => [ 'shape' => 'OpenSearchServiceDataSourceConfig', ], 'httpConfig' => [ 'shape' => 'HttpDataSourceConfig', ], 'relationalDatabaseConfig' => [ 'shape' => 'RelationalDatabaseDataSourceConfig', ], 'eventBridgeConfig' => [ 'shape' => 'EventBridgeDataSourceConfig', ], ], ], 'UpdateDataSourceResponse' => [ 'type' => 'structure', 'members' => [ 'dataSource' => [ 'shape' => 'DataSource', ], ], ], 'UpdateDomainNameRequest' => [ 'type' => 'structure', 'required' => [ 'domainName', ], 'members' => [ 'domainName' => [ 'shape' => 'DomainName', 'location' => 'uri', 'locationName' => 'domainName', ], 'description' => [ 'shape' => 'Description', ], ], ], 'UpdateDomainNameResponse' => [ 'type' => 'structure', 'members' => [ 'domainNameConfig' => [ 'shape' => 'DomainNameConfig', ], ], ], 'UpdateFunctionRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'name', 'functionId', 'dataSourceName', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'name' => [ 'shape' => 'ResourceName', ], 'description' => [ 'shape' => 'String', ], 'functionId' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'functionId', ], 'dataSourceName' => [ 'shape' => 'ResourceName', ], 'requestMappingTemplate' => [ 'shape' => 'MappingTemplate', ], 'responseMappingTemplate' => [ 'shape' => 'MappingTemplate', ], 'functionVersion' => [ 'shape' => 'String', ], 'syncConfig' => [ 'shape' => 'SyncConfig', ], 'maxBatchSize' => [ 'shape' => 'MaxBatchSize', ], 'runtime' => [ 'shape' => 'AppSyncRuntime', ], 'code' => [ 'shape' => 'Code', ], ], ], 'UpdateFunctionResponse' => [ 'type' => 'structure', 'members' => [ 'functionConfiguration' => [ 'shape' => 'FunctionConfiguration', ], ], ], 'UpdateGraphqlApiRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'name', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'name' => [ 'shape' => 'String', ], 'logConfig' => [ 'shape' => 'LogConfig', ], 'authenticationType' => [ 'shape' => 'AuthenticationType', ], 'userPoolConfig' => [ 'shape' => 'UserPoolConfig', ], 'openIDConnectConfig' => [ 'shape' => 'OpenIDConnectConfig', ], 'additionalAuthenticationProviders' => [ 'shape' => 'AdditionalAuthenticationProviders', ], 'xrayEnabled' => [ 'shape' => 'Boolean', ], 'lambdaAuthorizerConfig' => [ 'shape' => 'LambdaAuthorizerConfig', ], 'mergedApiExecutionRoleArn' => [ 'shape' => 'String', ], 'ownerContact' => [ 'shape' => 'String', ], ], ], 'UpdateGraphqlApiResponse' => [ 'type' => 'structure', 'members' => [ 'graphqlApi' => [ 'shape' => 'GraphqlApi', ], ], ], 'UpdateResolverRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'typeName', 'fieldName', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'typeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'typeName', ], 'fieldName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'fieldName', ], 'dataSourceName' => [ 'shape' => 'ResourceName', ], 'requestMappingTemplate' => [ 'shape' => 'MappingTemplate', ], 'responseMappingTemplate' => [ 'shape' => 'MappingTemplate', ], 'kind' => [ 'shape' => 'ResolverKind', ], 'pipelineConfig' => [ 'shape' => 'PipelineConfig', ], 'syncConfig' => [ 'shape' => 'SyncConfig', ], 'cachingConfig' => [ 'shape' => 'CachingConfig', ], 'maxBatchSize' => [ 'shape' => 'MaxBatchSize', ], 'runtime' => [ 'shape' => 'AppSyncRuntime', ], 'code' => [ 'shape' => 'Code', ], ], ], 'UpdateResolverResponse' => [ 'type' => 'structure', 'members' => [ 'resolver' => [ 'shape' => 'Resolver', ], ], ], 'UpdateSourceApiAssociationRequest' => [ 'type' => 'structure', 'required' => [ 'associationId', 'mergedApiIdentifier', ], 'members' => [ 'associationId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'associationId', ], 'mergedApiIdentifier' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'mergedApiIdentifier', ], 'description' => [ 'shape' => 'String', ], 'sourceApiAssociationConfig' => [ 'shape' => 'SourceApiAssociationConfig', ], ], ], 'UpdateSourceApiAssociationResponse' => [ 'type' => 'structure', 'members' => [ 'sourceApiAssociation' => [ 'shape' => 'SourceApiAssociation', ], ], ], 'UpdateTypeRequest' => [ 'type' => 'structure', 'required' => [ 'apiId', 'typeName', 'format', ], 'members' => [ 'apiId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'apiId', ], 'typeName' => [ 'shape' => 'ResourceName', 'location' => 'uri', 'locationName' => 'typeName', ], 'definition' => [ 'shape' => 'String', ], 'format' => [ 'shape' => 'TypeDefinitionFormat', ], ], ], 'UpdateTypeResponse' => [ 'type' => 'structure', 'members' => [ 'type' => [ 'shape' => 'Type', ], ], ], 'UserPoolConfig' => [ 'type' => 'structure', 'required' => [ 'userPoolId', 'awsRegion', 'defaultAction', ], 'members' => [ 'userPoolId' => [ 'shape' => 'String', ], 'awsRegion' => [ 'shape' => 'String', ], 'defaultAction' => [ 'shape' => 'DefaultAction', ], 'appIdClientRegex' => [ 'shape' => 'String', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appsync/2017-07-25/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>AppSync provides API actions for creating and interacting with data sources using GraphQL from your application.</p>', 'operations' => [ 'AssociateApi' => '<p>Maps an endpoint to your custom domain.</p>', 'AssociateMergedGraphqlApi' => '<p>Creates an association between a Merged API and source API using the source API\\'s identifier.</p>', 'AssociateSourceGraphqlApi' => '<p>Creates an association between a Merged API and source API using the Merged API\\'s identifier.</p>', 'CreateApiCache' => '<p>Creates a cache for the GraphQL API.</p>', 'CreateApiKey' => '<p>Creates a unique key that you can distribute to clients who invoke your API.</p>', 'CreateDataSource' => '<p>Creates a <code>DataSource</code> object.</p>', 'CreateDomainName' => '<p>Creates a custom <code>DomainName</code> object.</p>', 'CreateFunction' => '<p>Creates a <code>Function</code> object.</p> <p>A function is a reusable entity. You can use multiple functions to compose the resolver logic.</p>', 'CreateGraphqlApi' => '<p>Creates a <code>GraphqlApi</code> object.</p>', 'CreateResolver' => '<p>Creates a <code>Resolver</code> object.</p> <p>A resolver converts incoming requests into a format that a data source can understand, and converts the data source\\'s responses into GraphQL.</p>', 'CreateType' => '<p>Creates a <code>Type</code> object.</p>', 'DeleteApiCache' => '<p>Deletes an <code>ApiCache</code> object.</p>', 'DeleteApiKey' => '<p>Deletes an API key.</p>', 'DeleteDataSource' => '<p>Deletes a <code>DataSource</code> object.</p>', 'DeleteDomainName' => '<p>Deletes a custom <code>DomainName</code> object.</p>', 'DeleteFunction' => '<p>Deletes a <code>Function</code>.</p>', 'DeleteGraphqlApi' => '<p>Deletes a <code>GraphqlApi</code> object.</p>', 'DeleteResolver' => '<p>Deletes a <code>Resolver</code> object.</p>', 'DeleteType' => '<p>Deletes a <code>Type</code> object.</p>', 'DisassociateApi' => '<p>Removes an <code>ApiAssociation</code> object from a custom domain.</p>', 'DisassociateMergedGraphqlApi' => '<p>Deletes an association between a Merged API and source API using the source API\\'s identifier and the association ID.</p>', 'DisassociateSourceGraphqlApi' => '<p>Deletes an association between a Merged API and source API using the Merged API\\'s identifier and the association ID.</p>', 'EvaluateCode' => '<p>Evaluates the given code and returns the response. The code definition requirements depend on the specified runtime. For <code>APPSYNC_JS</code> runtimes, the code defines the request and response functions. The request function takes the incoming request after a GraphQL operation is parsed and converts it into a request configuration for the selected data source operation. The response function interprets responses from the data source and maps it to the shape of the GraphQL field output type. </p>', 'EvaluateMappingTemplate' => '<p>Evaluates a given template and returns the response. The mapping template can be a request or response template.</p> <p>Request templates take the incoming request after a GraphQL operation is parsed and convert it into a request configuration for the selected data source operation. Response templates interpret responses from the data source and map it to the shape of the GraphQL field output type.</p> <p>Mapping templates are written in the Apache Velocity Template Language (VTL).</p>', 'FlushApiCache' => '<p>Flushes an <code>ApiCache</code> object.</p>', 'GetApiAssociation' => '<p>Retrieves an <code>ApiAssociation</code> object.</p>', 'GetApiCache' => '<p>Retrieves an <code>ApiCache</code> object.</p>', 'GetDataSource' => '<p>Retrieves a <code>DataSource</code> object.</p>', 'GetDomainName' => '<p>Retrieves a custom <code>DomainName</code> object.</p>', 'GetFunction' => '<p>Get a <code>Function</code>.</p>', 'GetGraphqlApi' => '<p>Retrieves a <code>GraphqlApi</code> object.</p>', 'GetIntrospectionSchema' => '<p>Retrieves the introspection schema for a GraphQL API.</p>', 'GetResolver' => '<p>Retrieves a <code>Resolver</code> object.</p>', 'GetSchemaCreationStatus' => '<p>Retrieves the current status of a schema creation operation.</p>', 'GetSourceApiAssociation' => '<p>Retrieves a <code>SourceApiAssociation</code> object.</p>', 'GetType' => '<p>Retrieves a <code>Type</code> object.</p>', 'ListApiKeys' => '<p>Lists the API keys for a given API.</p> <note> <p>API keys are deleted automatically 60 days after they expire. However, they may still be included in the response until they have actually been deleted. You can safely call <code>DeleteApiKey</code> to manually delete a key before it\\'s automatically deleted.</p> </note>', 'ListDataSources' => '<p>Lists the data sources for a given API.</p>', 'ListDomainNames' => '<p>Lists multiple custom domain names.</p>', 'ListFunctions' => '<p>List multiple functions.</p>', 'ListGraphqlApis' => '<p>Lists your GraphQL APIs.</p>', 'ListResolvers' => '<p>Lists the resolvers for a given API and type.</p>', 'ListResolversByFunction' => '<p>List the resolvers that are associated with a specific function.</p>', 'ListSourceApiAssociations' => '<p>Lists the <code>SourceApiAssociationSummary</code> data.</p>', 'ListTagsForResource' => '<p>Lists the tags for a resource.</p>', 'ListTypes' => '<p>Lists the types for a given API.</p>', 'ListTypesByAssociation' => '<p>Lists <code>Type</code> objects by the source API association ID.</p>', 'StartSchemaCreation' => '<p>Adds a new schema to your GraphQL API.</p> <p>This operation is asynchronous. Use to determine when it has completed.</p>', 'StartSchemaMerge' => '<p>Initiates a merge operation. Returns a status that shows the result of the merge operation.</p>', 'TagResource' => '<p>Tags a resource with user-supplied tags.</p>', 'UntagResource' => '<p>Untags a resource.</p>', 'UpdateApiCache' => '<p>Updates the cache for the GraphQL API.</p>', 'UpdateApiKey' => '<p>Updates an API key. You can update the key as long as it\\'s not deleted.</p>', 'UpdateDataSource' => '<p>Updates a <code>DataSource</code> object.</p>', 'UpdateDomainName' => '<p>Updates a custom <code>DomainName</code> object.</p>', 'UpdateFunction' => '<p>Updates a <code>Function</code> object.</p>', 'UpdateGraphqlApi' => '<p>Updates a <code>GraphqlApi</code> object.</p>', 'UpdateResolver' => '<p>Updates a <code>Resolver</code> object.</p>', 'UpdateSourceApiAssociation' => '<p>Updates some of the configuration choices of a particular source API association.</p>', 'UpdateType' => '<p>Updates a <code>Type</code> object.</p>', ], 'shapes' => [ 'AccessDeniedException' => [ 'base' => '<p>You don\\'t have access to perform this operation on this resource.</p>', 'refs' => [], ], 'AdditionalAuthenticationProvider' => [ 'base' => '<p>Describes an additional authentication provider.</p>', 'refs' => [ 'AdditionalAuthenticationProviders$member' => NULL, ], ], 'AdditionalAuthenticationProviders' => [ 'base' => NULL, 'refs' => [ 'CreateGraphqlApiRequest$additionalAuthenticationProviders' => '<p>A list of additional authentication providers for the <code>GraphqlApi</code> API.</p>', 'GraphqlApi$additionalAuthenticationProviders' => '<p>A list of additional authentication providers for the <code>GraphqlApi</code> API.</p>', 'UpdateGraphqlApiRequest$additionalAuthenticationProviders' => '<p>A list of additional authentication providers for the <code>GraphqlApi</code> API.</p>', ], ], 'ApiAssociation' => [ 'base' => '<p>Describes an <code>ApiAssociation</code> object.</p>', 'refs' => [ 'AssociateApiResponse$apiAssociation' => '<p>The <code>ApiAssociation</code> object.</p>', 'GetApiAssociationResponse$apiAssociation' => '<p>The <code>ApiAssociation</code> object.</p>', ], ], 'ApiCache' => [ 'base' => '<p>The <code>ApiCache</code> object.</p>', 'refs' => [ 'CreateApiCacheResponse$apiCache' => '<p>The <code>ApiCache</code> object.</p>', 'GetApiCacheResponse$apiCache' => '<p>The <code>ApiCache</code> object.</p>', 'UpdateApiCacheResponse$apiCache' => '<p>The <code>ApiCache</code> object.</p>', ], ], 'ApiCacheStatus' => [ 'base' => NULL, 'refs' => [ 'ApiCache$status' => '<p>The cache instance status.</p> <ul> <li> <p> <b>AVAILABLE</b>: The instance is available for use.</p> </li> <li> <p> <b>CREATING</b>: The instance is currently creating.</p> </li> <li> <p> <b>DELETING</b>: The instance is currently deleting.</p> </li> <li> <p> <b>MODIFYING</b>: The instance is currently modifying.</p> </li> <li> <p> <b>FAILED</b>: The instance has failed creation.</p> </li> </ul>', ], ], 'ApiCacheType' => [ 'base' => NULL, 'refs' => [ 'ApiCache$type' => '<p>The cache instance type. Valid values are </p> <ul> <li> <p> <code>SMALL</code> </p> </li> <li> <p> <code>MEDIUM</code> </p> </li> <li> <p> <code>LARGE</code> </p> </li> <li> <p> <code>XLARGE</code> </p> </li> <li> <p> <code>LARGE_2X</code> </p> </li> <li> <p> <code>LARGE_4X</code> </p> </li> <li> <p> <code>LARGE_8X</code> (not available in all regions)</p> </li> <li> <p> <code>LARGE_12X</code> </p> </li> </ul> <p>Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.</p> <p>The following legacy instance types are available, but their use is discouraged:</p> <ul> <li> <p> <b>T2_SMALL</b>: A t2.small instance type.</p> </li> <li> <p> <b>T2_MEDIUM</b>: A t2.medium instance type.</p> </li> <li> <p> <b>R4_LARGE</b>: A r4.large instance type.</p> </li> <li> <p> <b>R4_XLARGE</b>: A r4.xlarge instance type.</p> </li> <li> <p> <b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p> </li> <li> <p> <b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p> </li> <li> <p> <b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p> </li> </ul>', 'CreateApiCacheRequest$type' => '<p>The cache instance type. Valid values are </p> <ul> <li> <p> <code>SMALL</code> </p> </li> <li> <p> <code>MEDIUM</code> </p> </li> <li> <p> <code>LARGE</code> </p> </li> <li> <p> <code>XLARGE</code> </p> </li> <li> <p> <code>LARGE_2X</code> </p> </li> <li> <p> <code>LARGE_4X</code> </p> </li> <li> <p> <code>LARGE_8X</code> (not available in all regions)</p> </li> <li> <p> <code>LARGE_12X</code> </p> </li> </ul> <p>Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.</p> <p>The following legacy instance types are available, but their use is discouraged:</p> <ul> <li> <p> <b>T2_SMALL</b>: A t2.small instance type.</p> </li> <li> <p> <b>T2_MEDIUM</b>: A t2.medium instance type.</p> </li> <li> <p> <b>R4_LARGE</b>: A r4.large instance type.</p> </li> <li> <p> <b>R4_XLARGE</b>: A r4.xlarge instance type.</p> </li> <li> <p> <b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p> </li> <li> <p> <b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p> </li> <li> <p> <b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p> </li> </ul>', 'UpdateApiCacheRequest$type' => '<p>The cache instance type. Valid values are </p> <ul> <li> <p> <code>SMALL</code> </p> </li> <li> <p> <code>MEDIUM</code> </p> </li> <li> <p> <code>LARGE</code> </p> </li> <li> <p> <code>XLARGE</code> </p> </li> <li> <p> <code>LARGE_2X</code> </p> </li> <li> <p> <code>LARGE_4X</code> </p> </li> <li> <p> <code>LARGE_8X</code> (not available in all regions)</p> </li> <li> <p> <code>LARGE_12X</code> </p> </li> </ul> <p>Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.</p> <p>The following legacy instance types are available, but their use is discouraged:</p> <ul> <li> <p> <b>T2_SMALL</b>: A t2.small instance type.</p> </li> <li> <p> <b>T2_MEDIUM</b>: A t2.medium instance type.</p> </li> <li> <p> <b>R4_LARGE</b>: A r4.large instance type.</p> </li> <li> <p> <b>R4_XLARGE</b>: A r4.xlarge instance type.</p> </li> <li> <p> <b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p> </li> <li> <p> <b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p> </li> <li> <p> <b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p> </li> </ul>', ], ], 'ApiCachingBehavior' => [ 'base' => NULL, 'refs' => [ 'ApiCache$apiCachingBehavior' => '<p>Caching behavior.</p> <ul> <li> <p> <b>FULL_REQUEST_CACHING</b>: All requests are fully cached.</p> </li> <li> <p> <b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p> </li> </ul>', 'CreateApiCacheRequest$apiCachingBehavior' => '<p>Caching behavior.</p> <ul> <li> <p> <b>FULL_REQUEST_CACHING</b>: All requests are fully cached.</p> </li> <li> <p> <b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p> </li> </ul>', 'UpdateApiCacheRequest$apiCachingBehavior' => '<p>Caching behavior.</p> <ul> <li> <p> <b>FULL_REQUEST_CACHING</b>: All requests are fully cached.</p> </li> <li> <p> <b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p> </li> </ul>', ], ], 'ApiKey' => [ 'base' => '<p>Describes an API key.</p> <p>Customers invoke AppSync GraphQL API operations with API keys as an identity mechanism. There are two key versions:</p> <p> <b>da1</b>: We introduced this version at launch in November 2017. These keys always expire after 7 days. Amazon DynamoDB TTL manages key expiration. These keys ceased to be valid after February 21, 2018, and they should no longer be used.</p> <ul> <li> <p> <code>ListApiKeys</code> returns the expiration time in milliseconds.</p> </li> <li> <p> <code>CreateApiKey</code> returns the expiration time in milliseconds.</p> </li> <li> <p> <code>UpdateApiKey</code> is not available for this key version.</p> </li> <li> <p> <code>DeleteApiKey</code> deletes the item from the table.</p> </li> <li> <p>Expiration is stored in DynamoDB as milliseconds. This results in a bug where keys are not automatically deleted because DynamoDB expects the TTL to be stored in seconds. As a one-time action, we deleted these keys from the table on February 21, 2018.</p> </li> </ul> <p> <b>da2</b>: We introduced this version in February 2018 when AppSync added support to extend key expiration.</p> <ul> <li> <p> <code>ListApiKeys</code> returns the expiration time and deletion time in seconds.</p> </li> <li> <p> <code>CreateApiKey</code> returns the expiration time and deletion time in seconds and accepts a user-provided expiration time in seconds.</p> </li> <li> <p> <code>UpdateApiKey</code> returns the expiration time and and deletion time in seconds and accepts a user-provided expiration time in seconds. Expired API keys are kept for 60 days after the expiration time. You can update the key expiration time as long as the key isn\\'t deleted.</p> </li> <li> <p> <code>DeleteApiKey</code> deletes the item from the table.</p> </li> <li> <p>Expiration is stored in DynamoDB as seconds. After the expiration time, using the key to authenticate will fail. However, you can reinstate the key before deletion.</p> </li> <li> <p>Deletion is stored in DynamoDB as seconds. The key is deleted after deletion time.</p> </li> </ul>', 'refs' => [ 'ApiKeys$member' => NULL, 'CreateApiKeyResponse$apiKey' => '<p>The API key.</p>', 'UpdateApiKeyResponse$apiKey' => '<p>The API key.</p>', ], ], 'ApiKeyLimitExceededException' => [ 'base' => '<p>The API key exceeded a limit. Try your request again.</p>', 'refs' => [], ], 'ApiKeyValidityOutOfBoundsException' => [ 'base' => '<p>The API key expiration must be set to a value between 1 and 365 days from creation (for <code>CreateApiKey</code>) or from update (for <code>UpdateApiKey</code>).</p>', 'refs' => [], ], 'ApiKeys' => [ 'base' => NULL, 'refs' => [ 'ListApiKeysResponse$apiKeys' => '<p>The <code>ApiKey</code> objects.</p>', ], ], 'ApiLimitExceededException' => [ 'base' => '<p>The GraphQL API exceeded a limit. Try your request again.</p>', 'refs' => [], ], 'AppSyncRuntime' => [ 'base' => '<p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>', 'refs' => [ 'CreateFunctionRequest$runtime' => NULL, 'CreateResolverRequest$runtime' => NULL, 'EvaluateCodeRequest$runtime' => '<p>The runtime to be used when evaluating the code. Currently, only the <code>APPSYNC_JS</code> runtime is supported.</p>', 'FunctionConfiguration$runtime' => NULL, 'Resolver$runtime' => NULL, 'UpdateFunctionRequest$runtime' => NULL, 'UpdateResolverRequest$runtime' => NULL, ], ], 'AssociateApiRequest' => [ 'base' => NULL, 'refs' => [], ], 'AssociateApiResponse' => [ 'base' => NULL, 'refs' => [], ], 'AssociateMergedGraphqlApiRequest' => [ 'base' => NULL, 'refs' => [], ], 'AssociateMergedGraphqlApiResponse' => [ 'base' => NULL, 'refs' => [], ], 'AssociateSourceGraphqlApiRequest' => [ 'base' => NULL, 'refs' => [], ], 'AssociateSourceGraphqlApiResponse' => [ 'base' => NULL, 'refs' => [], ], 'AssociationStatus' => [ 'base' => NULL, 'refs' => [ 'ApiAssociation$associationStatus' => '<p>Identifies the status of an association.</p> <ul> <li> <p> <b>PROCESSING</b>: The API association is being created. You cannot modify association requests during processing.</p> </li> <li> <p> <b>SUCCESS</b>: The API association was successful. You can modify associations after success.</p> </li> <li> <p> <b>FAILED</b>: The API association has failed. You can modify associations after failure.</p> </li> </ul>', ], ], 'AuthenticationType' => [ 'base' => NULL, 'refs' => [ 'AdditionalAuthenticationProvider$authenticationType' => '<p>The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.</p>', 'CreateGraphqlApiRequest$authenticationType' => '<p>The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.</p>', 'GraphqlApi$authenticationType' => '<p>The authentication type.</p>', 'UpdateGraphqlApiRequest$authenticationType' => '<p>The new authentication type for the <code>GraphqlApi</code> object.</p>', ], ], 'AuthorizationConfig' => [ 'base' => '<p>The authorization configuration in case the HTTP endpoint requires authorization.</p>', 'refs' => [ 'HttpDataSourceConfig$authorizationConfig' => '<p>The authorization configuration in case the HTTP endpoint requires authorization.</p>', ], ], 'AuthorizationType' => [ 'base' => NULL, 'refs' => [ 'AuthorizationConfig$authorizationType' => '<p>The authorization type that the HTTP endpoint requires.</p> <ul> <li> <p> <b>AWS_IAM</b>: The authorization type is Signature Version 4 (SigV4).</p> </li> </ul>', ], ], 'AwsIamConfig' => [ 'base' => '<p>The Identity and Access Management (IAM) configuration.</p>', 'refs' => [ 'AuthorizationConfig$awsIamConfig' => '<p>The Identity and Access Management (IAM) settings.</p>', ], ], 'BadRequestDetail' => [ 'base' => '<p>Provides further details for the reason behind the bad request. For reason type <code>CODE_ERROR</code>, the detail will contain a list of code errors.</p>', 'refs' => [ 'BadRequestException$detail' => NULL, ], ], 'BadRequestException' => [ 'base' => '<p>The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and then try again.</p>', 'refs' => [], ], 'BadRequestReason' => [ 'base' => '<p>Provides context for the cause of the bad request. The only supported value is <code>CODE_ERROR</code>.</p>', 'refs' => [ 'BadRequestException$reason' => NULL, ], ], 'Blob' => [ 'base' => NULL, 'refs' => [ 'GetIntrospectionSchemaResponse$schema' => '<p>The schema, in GraphQL Schema Definition Language (SDL) format.</p> <p>For more information, see the <a href=\"http://graphql.org/learn/schema/\">GraphQL SDL documentation</a>.</p>', 'StartSchemaCreationRequest$definition' => '<p>The schema definition, in GraphQL schema language format.</p>', ], ], 'Boolean' => [ 'base' => NULL, 'refs' => [ 'ApiCache$transitEncryptionEnabled' => '<p>Transit encryption flag when connecting to cache. You cannot update this setting after creation.</p>', 'ApiCache$atRestEncryptionEnabled' => '<p>At-rest encryption flag for cache. You cannot update this setting after creation.</p>', 'CreateApiCacheRequest$transitEncryptionEnabled' => '<p>Transit encryption flag when connecting to cache. You cannot update this setting after creation.</p>', 'CreateApiCacheRequest$atRestEncryptionEnabled' => '<p>At-rest encryption flag for cache. You cannot update this setting after creation.</p>', 'CreateGraphqlApiRequest$xrayEnabled' => '<p>A flag indicating whether to use X-Ray tracing for the <code>GraphqlApi</code>.</p>', 'DynamodbDataSourceConfig$useCallerCredentials' => '<p>Set to TRUE to use Amazon Cognito credentials with this data source.</p>', 'DynamodbDataSourceConfig$versioned' => '<p>Set to TRUE to use Conflict Detection and Resolution with this data source.</p>', 'GraphqlApi$xrayEnabled' => '<p>A flag indicating whether to use X-Ray tracing for this <code>GraphqlApi</code>.</p>', 'LogConfig$excludeVerboseContent' => '<p>Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.</p>', 'UpdateGraphqlApiRequest$xrayEnabled' => '<p>A flag indicating whether to use X-Ray tracing for the <code>GraphqlApi</code>.</p>', ], ], 'BooleanValue' => [ 'base' => NULL, 'refs' => [ 'GetIntrospectionSchemaRequest$includeDirectives' => '<p>A flag that specifies whether the schema introspection should contain directives.</p>', ], ], 'CachingConfig' => [ 'base' => '<p>The caching configuration for a resolver that has caching activated.</p>', 'refs' => [ 'CreateResolverRequest$cachingConfig' => '<p>The caching configuration for the resolver.</p>', 'Resolver$cachingConfig' => '<p>The caching configuration for the resolver.</p>', 'UpdateResolverRequest$cachingConfig' => '<p>The caching configuration for the resolver.</p>', ], ], 'CachingKeys' => [ 'base' => NULL, 'refs' => [ 'CachingConfig$cachingKeys' => '<p>The caching keys for a resolver that has caching activated.</p> <p>Valid values are entries from the <code>$context.arguments</code>, <code>$context.source</code>, and <code>$context.identity</code> maps.</p>', ], ], 'CertificateArn' => [ 'base' => NULL, 'refs' => [ 'CreateDomainNameRequest$certificateArn' => '<p>The Amazon Resource Name (ARN) of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate.</p>', 'DomainNameConfig$certificateArn' => '<p>The Amazon Resource Name (ARN) of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate.</p>', ], ], 'Code' => [ 'base' => NULL, 'refs' => [ 'CreateFunctionRequest$code' => '<p>The <code>function</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>', 'CreateResolverRequest$code' => '<p>The <code>resolver</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>', 'EvaluateCodeRequest$code' => '<p>The code definition to be evaluated. Note that <code>code</code> and <code>runtime</code> are both required for this action. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>', 'FunctionConfiguration$code' => '<p>The <code>function</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>', 'Resolver$code' => '<p>The <code>resolver</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>', 'UpdateFunctionRequest$code' => '<p>The <code>function</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>', 'UpdateResolverRequest$code' => '<p>The <code>resolver</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>', ], ], 'CodeError' => [ 'base' => '<p>Describes an AppSync error.</p>', 'refs' => [ 'CodeErrors$member' => NULL, ], ], 'CodeErrorColumn' => [ 'base' => NULL, 'refs' => [ 'CodeErrorLocation$column' => '<p>The column number in the code. Defaults to <code>0</code> if unknown.</p>', ], ], 'CodeErrorLine' => [ 'base' => NULL, 'refs' => [ 'CodeErrorLocation$line' => '<p>The line number in the code. Defaults to <code>0</code> if unknown.</p>', ], ], 'CodeErrorLocation' => [ 'base' => '<p>Describes the location of the error in a code sample.</p>', 'refs' => [ 'CodeError$location' => '<p>The line, column, and span location of the error in the code.</p>', ], ], 'CodeErrorSpan' => [ 'base' => NULL, 'refs' => [ 'CodeErrorLocation$span' => '<p>The span/length of the error. Defaults to <code>-1</code> if unknown.</p>', ], ], 'CodeErrors' => [ 'base' => NULL, 'refs' => [ 'BadRequestDetail$codeErrors' => '<p>Contains the list of errors in the request.</p>', 'EvaluateCodeErrorDetail$codeErrors' => '<p>Contains the list of <code>CodeError</code> objects.</p>', ], ], 'CognitoUserPoolConfig' => [ 'base' => '<p>Describes an Amazon Cognito user pool configuration.</p>', 'refs' => [ 'AdditionalAuthenticationProvider$userPoolConfig' => '<p>The Amazon Cognito user pool configuration.</p>', ], ], 'ConcurrentModificationException' => [ 'base' => '<p>Another modification is in progress at this time and it must complete before you can make your change.</p>', 'refs' => [], ], 'ConflictDetectionType' => [ 'base' => NULL, 'refs' => [ 'SyncConfig$conflictDetection' => '<p>The Conflict Detection strategy to use.</p> <ul> <li> <p> <b>VERSION</b>: Detect conflicts based on object versions for this resolver.</p> </li> <li> <p> <b>NONE</b>: Do not detect conflicts when invoking this resolver.</p> </li> </ul>', ], ], 'ConflictHandlerType' => [ 'base' => NULL, 'refs' => [ 'SyncConfig$conflictHandler' => '<p>The Conflict Resolution strategy to perform in the event of a conflict.</p> <ul> <li> <p> <b>OPTIMISTIC_CONCURRENCY</b>: Resolve conflicts by rejecting mutations when versions don\\'t match the latest version at the server.</p> </li> <li> <p> <b>AUTOMERGE</b>: Resolve conflicts with the Automerge conflict resolution strategy.</p> </li> <li> <p> <b>LAMBDA</b>: Resolve conflicts with an Lambda function supplied in the <code>LambdaConflictHandlerConfig</code>.</p> </li> </ul>', ], ], 'Context' => [ 'base' => NULL, 'refs' => [ 'EvaluateCodeRequest$context' => '<p>The map that holds all of the contextual information for your resolver invocation. A <code>context</code> is required for this action.</p>', 'EvaluateMappingTemplateRequest$context' => '<p>The map that holds all of the contextual information for your resolver invocation. A <code>context</code> is required for this action.</p>', ], ], 'CreateApiCacheRequest' => [ 'base' => '<p>Represents the input of a <code>CreateApiCache</code> operation.</p>', 'refs' => [], ], 'CreateApiCacheResponse' => [ 'base' => '<p>Represents the output of a <code>CreateApiCache</code> operation.</p>', 'refs' => [], ], 'CreateApiKeyRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateApiKeyResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateDataSourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateDataSourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateDomainNameRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateDomainNameResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateFunctionRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateFunctionResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateGraphqlApiRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateGraphqlApiResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateResolverRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateResolverResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateTypeRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateTypeResponse' => [ 'base' => NULL, 'refs' => [], ], 'DataSource' => [ 'base' => '<p>Describes a data source.</p>', 'refs' => [ 'CreateDataSourceResponse$dataSource' => '<p>The <code>DataSource</code> object.</p>', 'DataSources$member' => NULL, 'GetDataSourceResponse$dataSource' => '<p>The <code>DataSource</code> object.</p>', 'UpdateDataSourceResponse$dataSource' => '<p>The updated <code>DataSource</code> object.</p>', ], ], 'DataSourceType' => [ 'base' => NULL, 'refs' => [ 'CreateDataSourceRequest$type' => '<p>The type of the <code>DataSource</code>.</p>', 'DataSource$type' => '<p>The type of the data source.</p> <ul> <li> <p> <b>AWS_LAMBDA</b>: The data source is an Lambda function.</p> </li> <li> <p> <b>AMAZON_DYNAMODB</b>: The data source is an Amazon DynamoDB table.</p> </li> <li> <p> <b>AMAZON_ELASTICSEARCH</b>: The data source is an Amazon OpenSearch Service domain.</p> </li> <li> <p> <b>AMAZON_OPENSEARCH_SERVICE</b>: The data source is an Amazon OpenSearch Service domain.</p> </li> <li> <p> <b>AMAZON_EVENTBRIDGE</b>: The data source is an Amazon EventBridge configuration.</p> </li> <li> <p> <b>NONE</b>: There is no data source. Use this type when you want to invoke a GraphQL operation without connecting to a data source, such as when you\\'re performing data transformation with resolvers or invoking a subscription from a mutation.</p> </li> <li> <p> <b>HTTP</b>: The data source is an HTTP endpoint.</p> </li> <li> <p> <b>RELATIONAL_DATABASE</b>: The data source is a relational database.</p> </li> </ul>', 'UpdateDataSourceRequest$type' => '<p>The new data source type.</p>', ], ], 'DataSources' => [ 'base' => NULL, 'refs' => [ 'ListDataSourcesResponse$dataSources' => '<p>The <code>DataSource</code> objects.</p>', ], ], 'Date' => [ 'base' => NULL, 'refs' => [ 'SourceApiAssociation$lastSuccessfulMergeDate' => '<p>The datetime value of the last successful merge of the source API association. The result will be in UTC format and your local time zone.</p>', ], ], 'DefaultAction' => [ 'base' => NULL, 'refs' => [ 'UserPoolConfig$defaultAction' => '<p>The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn\\'t match the Amazon Cognito user pool configuration.</p>', ], ], 'DeleteApiCacheRequest' => [ 'base' => '<p>Represents the input of a <code>DeleteApiCache</code> operation.</p>', 'refs' => [], ], 'DeleteApiCacheResponse' => [ 'base' => '<p>Represents the output of a <code>DeleteApiCache</code> operation.</p>', 'refs' => [], ], 'DeleteApiKeyRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteApiKeyResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteDataSourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteDataSourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteDomainNameRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteDomainNameResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteFunctionRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteFunctionResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteGraphqlApiRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteGraphqlApiResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteResolverRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteResolverResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteTypeRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteTypeResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeltaSyncConfig' => [ 'base' => '<p>Describes a Delta Sync configuration.</p>', 'refs' => [ 'DynamodbDataSourceConfig$deltaSyncConfig' => '<p>The <code>DeltaSyncConfig</code> for a versioned data source.</p>', ], ], 'Description' => [ 'base' => NULL, 'refs' => [ 'CreateDomainNameRequest$description' => '<p>A description of the <code>DomainName</code>.</p>', 'DomainNameConfig$description' => '<p>A description of the <code>DomainName</code> configuration.</p>', 'UpdateDomainNameRequest$description' => '<p>A description of the <code>DomainName</code>.</p>', ], ], 'DisassociateApiRequest' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateApiResponse' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateMergedGraphqlApiRequest' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateMergedGraphqlApiResponse' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateSourceGraphqlApiRequest' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateSourceGraphqlApiResponse' => [ 'base' => NULL, 'refs' => [], ], 'DomainName' => [ 'base' => NULL, 'refs' => [ 'ApiAssociation$domainName' => '<p>The domain name.</p>', 'AssociateApiRequest$domainName' => '<p>The domain name.</p>', 'CreateDomainNameRequest$domainName' => '<p>The domain name.</p>', 'DeleteDomainNameRequest$domainName' => '<p>The domain name.</p>', 'DisassociateApiRequest$domainName' => '<p>The domain name.</p>', 'DomainNameConfig$domainName' => '<p>The domain name.</p>', 'GetApiAssociationRequest$domainName' => '<p>The domain name.</p>', 'GetDomainNameRequest$domainName' => '<p>The domain name.</p>', 'UpdateDomainNameRequest$domainName' => '<p>The domain name.</p>', ], ], 'DomainNameConfig' => [ 'base' => '<p>Describes a configuration for a custom domain.</p>', 'refs' => [ 'CreateDomainNameResponse$domainNameConfig' => '<p>The configuration for the <code>DomainName</code>.</p>', 'DomainNameConfigs$member' => NULL, 'GetDomainNameResponse$domainNameConfig' => '<p>The configuration for the <code>DomainName</code>.</p>', 'UpdateDomainNameResponse$domainNameConfig' => '<p>The configuration for the <code>DomainName</code>.</p>', ], ], 'DomainNameConfigs' => [ 'base' => NULL, 'refs' => [ 'ListDomainNamesResponse$domainNameConfigs' => '<p>Lists configurations for multiple domain names.</p>', ], ], 'DynamodbDataSourceConfig' => [ 'base' => '<p>Describes an Amazon DynamoDB data source configuration.</p>', 'refs' => [ 'CreateDataSourceRequest$dynamodbConfig' => '<p>Amazon DynamoDB settings.</p>', 'DataSource$dynamodbConfig' => '<p>DynamoDB settings.</p>', 'UpdateDataSourceRequest$dynamodbConfig' => '<p>The new Amazon DynamoDB configuration.</p>', ], ], 'ElasticsearchDataSourceConfig' => [ 'base' => '<p>Describes an OpenSearch data source configuration.</p> <p>As of September 2021, Amazon Elasticsearch service is Amazon OpenSearch Service. This configuration is deprecated. For new data sources, use <a>OpenSearchServiceDataSourceConfig</a> to specify an OpenSearch data source.</p>', 'refs' => [ 'CreateDataSourceRequest$elasticsearchConfig' => '<p>Amazon OpenSearch Service settings.</p> <p>As of September 2021, Amazon Elasticsearch service is Amazon OpenSearch Service. This configuration is deprecated. For new data sources, use <a>CreateDataSourceRequest$openSearchServiceConfig</a> to create an OpenSearch data source.</p>', 'DataSource$elasticsearchConfig' => '<p>Amazon OpenSearch Service settings.</p>', 'UpdateDataSourceRequest$elasticsearchConfig' => '<p>The new OpenSearch configuration.</p> <p>As of September 2021, Amazon Elasticsearch service is Amazon OpenSearch Service. This configuration is deprecated. Instead, use <a>UpdateDataSourceRequest$openSearchServiceConfig</a> to update an OpenSearch data source.</p>', ], ], 'ErrorDetail' => [ 'base' => '<p>Contains the list of errors generated. When using JavaScript, this will apply to the request or response function evaluation.</p>', 'refs' => [ 'EvaluateMappingTemplateResponse$error' => '<p>The <code>ErrorDetail</code> object.</p>', ], ], 'ErrorMessage' => [ 'base' => NULL, 'refs' => [ 'BadRequestException$message' => NULL, 'ConcurrentModificationException$message' => NULL, 'ErrorDetail$message' => '<p>The error payload.</p>', 'EvaluateCodeErrorDetail$message' => '<p>The error payload.</p>', 'GraphQLSchemaException$message' => NULL, ], ], 'EvaluateCodeErrorDetail' => [ 'base' => '<p>Contains the list of errors from a code evaluation response.</p>', 'refs' => [ 'EvaluateCodeResponse$error' => '<p>Contains the payload of the response error.</p>', ], ], 'EvaluateCodeRequest' => [ 'base' => NULL, 'refs' => [], ], 'EvaluateCodeResponse' => [ 'base' => NULL, 'refs' => [], ], 'EvaluateMappingTemplateRequest' => [ 'base' => NULL, 'refs' => [], ], 'EvaluateMappingTemplateResponse' => [ 'base' => NULL, 'refs' => [], ], 'EvaluationResult' => [ 'base' => NULL, 'refs' => [ 'EvaluateCodeResponse$evaluationResult' => '<p>The result of the evaluation operation.</p>', 'EvaluateMappingTemplateResponse$evaluationResult' => '<p>The mapping template; this can be a request or response template.</p>', ], ], 'EventBridgeDataSourceConfig' => [ 'base' => '<p>Describes an Amazon EventBridge bus data source configuration.</p>', 'refs' => [ 'CreateDataSourceRequest$eventBridgeConfig' => '<p>Amazon EventBridge settings.</p>', 'DataSource$eventBridgeConfig' => '<p>Amazon EventBridge settings.</p>', 'UpdateDataSourceRequest$eventBridgeConfig' => '<p>The new Amazon EventBridge settings.</p>', ], ], 'FieldLogLevel' => [ 'base' => NULL, 'refs' => [ 'LogConfig$fieldLogLevel' => '<p>The field logging level. Values can be NONE, ERROR, or ALL.</p> <ul> <li> <p> <b>NONE</b>: No field-level logs are captured.</p> </li> <li> <p> <b>ERROR</b>: Logs the following information only for the fields that are in error:</p> <ul> <li> <p>The error section in the server response.</p> </li> <li> <p>Field-level errors.</p> </li> <li> <p>The generated request/response functions that got resolved for error fields.</p> </li> </ul> </li> <li> <p> <b>ALL</b>: The following information is logged for all fields in the query:</p> <ul> <li> <p>Field-level tracing information.</p> </li> <li> <p>The generated request/response functions that got resolved for each field.</p> </li> </ul> </li> </ul>', ], ], 'FlushApiCacheRequest' => [ 'base' => '<p>Represents the input of a <code>FlushApiCache</code> operation.</p>', 'refs' => [], ], 'FlushApiCacheResponse' => [ 'base' => '<p>Represents the output of a <code>FlushApiCache</code> operation.</p>', 'refs' => [], ], 'FunctionConfiguration' => [ 'base' => '<p>A function is a reusable entity. You can use multiple functions to compose the resolver logic.</p>', 'refs' => [ 'CreateFunctionResponse$functionConfiguration' => '<p>The <code>Function</code> object.</p>', 'Functions$member' => NULL, 'GetFunctionResponse$functionConfiguration' => '<p>The <code>Function</code> object.</p>', 'UpdateFunctionResponse$functionConfiguration' => '<p>The <code>Function</code> object.</p>', ], ], 'Functions' => [ 'base' => NULL, 'refs' => [ 'ListFunctionsResponse$functions' => '<p>A list of <code>Function</code> objects.</p>', ], ], 'FunctionsIds' => [ 'base' => NULL, 'refs' => [ 'PipelineConfig$functions' => '<p>A list of <code>Function</code> objects.</p>', ], ], 'GetApiAssociationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetApiAssociationResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetApiCacheRequest' => [ 'base' => '<p>Represents the input of a <code>GetApiCache</code> operation.</p>', 'refs' => [], ], 'GetApiCacheResponse' => [ 'base' => '<p>Represents the output of a <code>GetApiCache</code> operation.</p>', 'refs' => [], ], 'GetDataSourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetDataSourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetDomainNameRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetDomainNameResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetFunctionRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetFunctionResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetGraphqlApiRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetGraphqlApiResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetIntrospectionSchemaRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetIntrospectionSchemaResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetResolverRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetResolverResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetSchemaCreationStatusRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetSchemaCreationStatusResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetSourceApiAssociationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetSourceApiAssociationResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetTypeRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetTypeResponse' => [ 'base' => NULL, 'refs' => [], ], 'GraphQLApiType' => [ 'base' => NULL, 'refs' => [ 'CreateGraphqlApiRequest$apiType' => '<p>The value that indicates whether the GraphQL API is a standard API (<code>GRAPHQL</code>) or merged API (<code>MERGED</code>).</p>', 'GraphqlApi$apiType' => '<p>The value that indicates whether the GraphQL API is a standard API (<code>GRAPHQL</code>) or merged API (<code>MERGED</code>).</p>', 'ListGraphqlApisRequest$apiType' => '<p>The value that indicates whether the GraphQL API is a standard API (<code>GRAPHQL</code>) or merged API (<code>MERGED</code>).</p>', ], ], 'GraphQLApiVisibility' => [ 'base' => NULL, 'refs' => [ 'CreateGraphqlApiRequest$visibility' => '<p>Sets the value of the GraphQL API to public (<code>GLOBAL</code>) or private (<code>PRIVATE</code>). If no value is provided, the visibility will be set to <code>GLOBAL</code> by default. This value cannot be changed once the API has been created.</p>', 'GraphqlApi$visibility' => '<p>Sets the value of the GraphQL API to public (<code>GLOBAL</code>) or private (<code>PRIVATE</code>). If no value is provided, the visibility will be set to <code>GLOBAL</code> by default. This value cannot be changed once the API has been created.</p>', ], ], 'GraphQLSchemaException' => [ 'base' => '<p>The GraphQL schema is not valid.</p>', 'refs' => [], ], 'GraphqlApi' => [ 'base' => '<p>Describes a GraphQL API.</p>', 'refs' => [ 'CreateGraphqlApiResponse$graphqlApi' => '<p>The <code>GraphqlApi</code>.</p>', 'GetGraphqlApiResponse$graphqlApi' => '<p>The <code>GraphqlApi</code> object.</p>', 'GraphqlApis$member' => NULL, 'UpdateGraphqlApiResponse$graphqlApi' => '<p>The updated <code>GraphqlApi</code> object.</p>', ], ], 'GraphqlApis' => [ 'base' => NULL, 'refs' => [ 'ListGraphqlApisResponse$graphqlApis' => '<p>The <code>GraphqlApi</code> objects.</p>', ], ], 'HttpDataSourceConfig' => [ 'base' => '<p>Describes an HTTP data source configuration.</p>', 'refs' => [ 'CreateDataSourceRequest$httpConfig' => '<p>HTTP endpoint settings.</p>', 'DataSource$httpConfig' => '<p>HTTP endpoint settings.</p>', 'UpdateDataSourceRequest$httpConfig' => '<p>The new HTTP endpoint configuration.</p>', ], ], 'InternalFailureException' => [ 'base' => '<p>An internal AppSync error occurred. Try your request again.</p>', 'refs' => [], ], 'LambdaAuthorizerConfig' => [ 'base' => '<p>A <code>LambdaAuthorizerConfig</code> specifies how to authorize AppSync API access when using the <code>AWS_LAMBDA</code> authorizer mode. Be aware that an AppSync API can have only one Lambda authorizer configured at a time.</p>', 'refs' => [ 'AdditionalAuthenticationProvider$lambdaAuthorizerConfig' => '<p>Configuration for Lambda function authorization.</p>', 'CreateGraphqlApiRequest$lambdaAuthorizerConfig' => '<p>Configuration for Lambda function authorization.</p>', 'GraphqlApi$lambdaAuthorizerConfig' => '<p>Configuration for Lambda function authorization.</p>', 'UpdateGraphqlApiRequest$lambdaAuthorizerConfig' => '<p>Configuration for Lambda function authorization.</p>', ], ], 'LambdaConflictHandlerConfig' => [ 'base' => '<p>The <code>LambdaConflictHandlerConfig</code> object when configuring <code>LAMBDA</code> as the Conflict Handler.</p>', 'refs' => [ 'SyncConfig$lambdaConflictHandlerConfig' => '<p>The <code>LambdaConflictHandlerConfig</code> when configuring <code>LAMBDA</code> as the Conflict Handler.</p>', ], ], 'LambdaDataSourceConfig' => [ 'base' => '<p>Describes an Lambda data source configuration.</p>', 'refs' => [ 'CreateDataSourceRequest$lambdaConfig' => '<p>Lambda settings.</p>', 'DataSource$lambdaConfig' => '<p>Lambda settings.</p>', 'UpdateDataSourceRequest$lambdaConfig' => '<p>The new Lambda configuration.</p>', ], ], 'LimitExceededException' => [ 'base' => '<p>The request exceeded a limit. Try your request again.</p>', 'refs' => [], ], 'ListApiKeysRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListApiKeysResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListDataSourcesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListDataSourcesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListDomainNamesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListDomainNamesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListFunctionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListFunctionsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListGraphqlApisRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListGraphqlApisResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListResolversByFunctionRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListResolversByFunctionResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListResolversRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListResolversResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListSourceApiAssociationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListSourceApiAssociationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTypesByAssociationRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTypesByAssociationResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTypesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTypesResponse' => [ 'base' => NULL, 'refs' => [], ], 'LogConfig' => [ 'base' => '<p>The Amazon CloudWatch Logs configuration.</p>', 'refs' => [ 'CreateGraphqlApiRequest$logConfig' => '<p>The Amazon CloudWatch Logs configuration.</p>', 'GraphqlApi$logConfig' => '<p>The Amazon CloudWatch Logs configuration.</p>', 'UpdateGraphqlApiRequest$logConfig' => '<p>The Amazon CloudWatch Logs configuration for the <code>GraphqlApi</code> object.</p>', ], ], 'Logs' => [ 'base' => NULL, 'refs' => [ 'EvaluateCodeResponse$logs' => '<p>A list of logs that were generated by calls to <code>util.log.info</code> and <code>util.log.error</code> in the evaluated code.</p>', 'EvaluateMappingTemplateResponse$logs' => '<p>A list of logs that were generated by calls to <code>util.log.info</code> and <code>util.log.error</code> in the evaluated code.</p>', ], ], 'Long' => [ 'base' => NULL, 'refs' => [ 'ApiCache$ttl' => '<p>TTL in seconds for cache entries.</p> <p>Valid values are 1\u00e2\u20ac\u201c3,600 seconds.</p>', 'ApiKey$expires' => '<p>The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.</p>', 'ApiKey$deletes' => '<p>The time after which the API key is deleted. The date is represented as seconds since the epoch, rounded down to the nearest hour.</p>', 'CachingConfig$ttl' => '<p>The TTL in seconds for a resolver that has caching activated.</p> <p>Valid values are 1\u00e2\u20ac\u201c3,600 seconds.</p>', 'CreateApiCacheRequest$ttl' => '<p>TTL in seconds for cache entries.</p> <p>Valid values are 1\u00e2\u20ac\u201c3,600 seconds.</p>', 'CreateApiKeyRequest$expires' => '<p>From the creation time, the time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour. The default value for this parameter is 7 days from creation time. For more information, see .</p>', 'DeltaSyncConfig$baseTableTTL' => '<p>The number of minutes that an Item is stored in the data source.</p>', 'DeltaSyncConfig$deltaSyncTableTTL' => '<p>The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.</p>', 'OpenIDConnectConfig$iatTTL' => '<p>The number of milliseconds that a token is valid after it\\'s issued to a user.</p>', 'OpenIDConnectConfig$authTTL' => '<p>The number of milliseconds that a token is valid after being authenticated.</p>', 'UpdateApiCacheRequest$ttl' => '<p>TTL in seconds for cache entries.</p> <p>Valid values are 1\u00e2\u20ac\u201c3,600 seconds.</p>', 'UpdateApiKeyRequest$expires' => '<p>From the update time, the time after which the API key expires. The date is represented as seconds since the epoch. For more information, see .</p>', ], ], 'MapOfStringToString' => [ 'base' => NULL, 'refs' => [ 'GraphqlApi$uris' => '<p>The URIs.</p>', 'GraphqlApi$dns' => '<p>The DNS records for the API.</p>', ], ], 'MappingTemplate' => [ 'base' => NULL, 'refs' => [ 'CreateFunctionRequest$requestMappingTemplate' => '<p>The <code>Function</code> request mapping template. Functions support only the 2018-05-29 version of the request mapping template.</p>', 'CreateFunctionRequest$responseMappingTemplate' => '<p>The <code>Function</code> response mapping template.</p>', 'CreateResolverRequest$requestMappingTemplate' => '<p>The mapping template to use for requests.</p> <p>A resolver uses a request mapping template to convert a GraphQL expression into a format that a data source can understand. Mapping templates are written in Apache Velocity Template Language (VTL).</p> <p>VTL request mapping templates are optional when using an Lambda data source. For all other data sources, VTL request and response mapping templates are required.</p>', 'CreateResolverRequest$responseMappingTemplate' => '<p>The mapping template to use for responses from the data source.</p>', 'FunctionConfiguration$requestMappingTemplate' => '<p>The <code>Function</code> request mapping template. Functions support only the 2018-05-29 version of the request mapping template.</p>', 'FunctionConfiguration$responseMappingTemplate' => '<p>The <code>Function</code> response mapping template.</p>', 'Resolver$requestMappingTemplate' => '<p>The request mapping template.</p>', 'Resolver$responseMappingTemplate' => '<p>The response mapping template.</p>', 'UpdateFunctionRequest$requestMappingTemplate' => '<p>The <code>Function</code> request mapping template. Functions support only the 2018-05-29 version of the request mapping template.</p>', 'UpdateFunctionRequest$responseMappingTemplate' => '<p>The <code>Function</code> request mapping template.</p>', 'UpdateResolverRequest$requestMappingTemplate' => '<p>The new request mapping template.</p> <p>A resolver uses a request mapping template to convert a GraphQL expression into a format that a data source can understand. Mapping templates are written in Apache Velocity Template Language (VTL).</p> <p>VTL request mapping templates are optional when using an Lambda data source. For all other data sources, VTL request and response mapping templates are required.</p>', 'UpdateResolverRequest$responseMappingTemplate' => '<p>The new response mapping template.</p>', ], ], 'MaxBatchSize' => [ 'base' => NULL, 'refs' => [ 'CreateFunctionRequest$maxBatchSize' => '<p>The maximum batching size for a resolver.</p>', 'CreateResolverRequest$maxBatchSize' => '<p>The maximum batching size for a resolver.</p>', 'FunctionConfiguration$maxBatchSize' => '<p>The maximum batching size for a resolver.</p>', 'Resolver$maxBatchSize' => '<p>The maximum batching size for a resolver.</p>', 'UpdateFunctionRequest$maxBatchSize' => '<p>The maximum batching size for a resolver.</p>', 'UpdateResolverRequest$maxBatchSize' => '<p>The maximum batching size for a resolver.</p>', ], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'ListApiKeysRequest$maxResults' => '<p>The maximum number of results that you want the request to return.</p>', 'ListDataSourcesRequest$maxResults' => '<p>The maximum number of results that you want the request to return.</p>', 'ListDomainNamesRequest$maxResults' => '<p>The maximum number of results that you want the request to return.</p>', 'ListFunctionsRequest$maxResults' => '<p>The maximum number of results that you want the request to return.</p>', 'ListGraphqlApisRequest$maxResults' => '<p>The maximum number of results that you want the request to return.</p>', 'ListResolversByFunctionRequest$maxResults' => '<p>The maximum number of results that you want the request to return.</p>', 'ListResolversRequest$maxResults' => '<p>The maximum number of results that you want the request to return.</p>', 'ListSourceApiAssociationsRequest$maxResults' => '<p>The maximum number of results that you want the request to return.</p>', 'ListTypesByAssociationRequest$maxResults' => '<p>The maximum number of results that you want the request to return.</p>', 'ListTypesRequest$maxResults' => '<p>The maximum number of results that you want the request to return.</p>', ], ], 'MergeType' => [ 'base' => NULL, 'refs' => [ 'SourceApiAssociationConfig$mergeType' => '<p>The property that indicates which merging option is enabled in the source API association.</p> <p>Valid merge types are <code>MANUAL_MERGE</code> (default) and <code>AUTO_MERGE</code>. Manual merges are the default behavior and require the user to trigger any changes from the source APIs to the merged API manually. Auto merges subscribe the merged API to the changes performed on the source APIs so that any change in the source APIs are also made to the merged API. Auto merges use <code>MergedApiExecutionRoleArn</code> to perform merge operations.</p>', ], ], 'NotFoundException' => [ 'base' => '<p>The resource specified in the request was not found. Check the resource, and then try again.</p>', 'refs' => [], ], 'OpenIDConnectConfig' => [ 'base' => '<p>Describes an OpenID Connect (OIDC) configuration.</p>', 'refs' => [ 'AdditionalAuthenticationProvider$openIDConnectConfig' => '<p>The OIDC configuration.</p>', 'CreateGraphqlApiRequest$openIDConnectConfig' => '<p>The OIDC configuration.</p>', 'GraphqlApi$openIDConnectConfig' => '<p>The OpenID Connect configuration.</p>', 'UpdateGraphqlApiRequest$openIDConnectConfig' => '<p>The OpenID Connect configuration for the <code>GraphqlApi</code> object.</p>', ], ], 'OpenSearchServiceDataSourceConfig' => [ 'base' => '<p>Describes an OpenSearch data source configuration.</p>', 'refs' => [ 'CreateDataSourceRequest$openSearchServiceConfig' => '<p>Amazon OpenSearch Service settings.</p>', 'DataSource$openSearchServiceConfig' => '<p>Amazon OpenSearch Service settings.</p>', 'UpdateDataSourceRequest$openSearchServiceConfig' => '<p>The new OpenSearch configuration.</p>', ], ], 'OutputType' => [ 'base' => NULL, 'refs' => [ 'GetIntrospectionSchemaRequest$format' => '<p>The schema format: SDL or JSON.</p>', ], ], 'Ownership' => [ 'base' => NULL, 'refs' => [ 'ListGraphqlApisRequest$owner' => '<p>The account owner of the GraphQL API.</p>', ], ], 'PaginationToken' => [ 'base' => NULL, 'refs' => [ 'ListApiKeysRequest$nextToken' => '<p>An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.</p>', 'ListApiKeysResponse$nextToken' => '<p>An identifier to pass in the next request to this operation to return the next set of items in the list.</p>', 'ListDataSourcesRequest$nextToken' => '<p>An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.</p>', 'ListDataSourcesResponse$nextToken' => '<p>An identifier to pass in the next request to this operation to return the next set of items in the list.</p>', 'ListDomainNamesRequest$nextToken' => '<p>An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.</p>', 'ListDomainNamesResponse$nextToken' => '<p>An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.</p>', 'ListFunctionsRequest$nextToken' => '<p>An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.</p>', 'ListFunctionsResponse$nextToken' => '<p>An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.</p>', 'ListGraphqlApisRequest$nextToken' => '<p>An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.</p>', 'ListGraphqlApisResponse$nextToken' => '<p>An identifier to pass in the next request to this operation to return the next set of items in the list.</p>', 'ListResolversByFunctionRequest$nextToken' => '<p>An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.</p>', 'ListResolversByFunctionResponse$nextToken' => '<p>An identifier that you can use to return the next set of items in the list.</p>', 'ListResolversRequest$nextToken' => '<p>An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.</p>', 'ListResolversResponse$nextToken' => '<p>An identifier to pass in the next request to this operation to return the next set of items in the list.</p>', 'ListSourceApiAssociationsRequest$nextToken' => '<p>An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.</p>', 'ListSourceApiAssociationsResponse$nextToken' => '<p>An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.</p>', 'ListTypesByAssociationRequest$nextToken' => '<p>An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.</p>', 'ListTypesByAssociationResponse$nextToken' => '<p>An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.</p>', 'ListTypesRequest$nextToken' => '<p>An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.</p>', 'ListTypesResponse$nextToken' => '<p>An identifier to pass in the next request to this operation to return the next set of items in the list.</p>', ], ], 'PipelineConfig' => [ 'base' => '<p>The pipeline configuration for a resolver of kind <code>PIPELINE</code>.</p>', 'refs' => [ 'CreateResolverRequest$pipelineConfig' => '<p>The <code>PipelineConfig</code>.</p>', 'Resolver$pipelineConfig' => '<p>The <code>PipelineConfig</code>.</p>', 'UpdateResolverRequest$pipelineConfig' => '<p>The <code>PipelineConfig</code>.</p>', ], ], 'RdsHttpEndpointConfig' => [ 'base' => '<p>The Amazon Relational Database Service (Amazon RDS) HTTP endpoint configuration.</p>', 'refs' => [ 'RelationalDatabaseDataSourceConfig$rdsHttpEndpointConfig' => '<p>Amazon RDS HTTP endpoint settings.</p>', ], ], 'RelationalDatabaseDataSourceConfig' => [ 'base' => '<p>Describes a relational database data source configuration.</p>', 'refs' => [ 'CreateDataSourceRequest$relationalDatabaseConfig' => '<p>Relational database settings.</p>', 'DataSource$relationalDatabaseConfig' => '<p>Relational database settings.</p>', 'UpdateDataSourceRequest$relationalDatabaseConfig' => '<p>The new relational database configuration.</p>', ], ], 'RelationalDatabaseSourceType' => [ 'base' => NULL, 'refs' => [ 'RelationalDatabaseDataSourceConfig$relationalDatabaseSourceType' => '<p>Source type for the relational database.</p> <ul> <li> <p> <b>RDS_HTTP_ENDPOINT</b>: The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.</p> </li> </ul>', ], ], 'Resolver' => [ 'base' => '<p>Describes a resolver.</p>', 'refs' => [ 'CreateResolverResponse$resolver' => '<p>The <code>Resolver</code> object.</p>', 'GetResolverResponse$resolver' => '<p>The <code>Resolver</code> object.</p>', 'Resolvers$member' => NULL, 'UpdateResolverResponse$resolver' => '<p>The updated <code>Resolver</code> object.</p>', ], ], 'ResolverKind' => [ 'base' => NULL, 'refs' => [ 'CreateResolverRequest$kind' => '<p>The resolver type.</p> <ul> <li> <p> <b>UNIT</b>: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.</p> </li> <li> <p> <b>PIPELINE</b>: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of <code>Function</code> objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.</p> </li> </ul>', 'Resolver$kind' => '<p>The resolver type.</p> <ul> <li> <p> <b>UNIT</b>: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.</p> </li> <li> <p> <b>PIPELINE</b>: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of <code>Function</code> objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.</p> </li> </ul>', 'UpdateResolverRequest$kind' => '<p>The resolver type.</p> <ul> <li> <p> <b>UNIT</b>: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.</p> </li> <li> <p> <b>PIPELINE</b>: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of <code>Function</code> objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.</p> </li> </ul>', ], ], 'Resolvers' => [ 'base' => NULL, 'refs' => [ 'ListResolversByFunctionResponse$resolvers' => '<p>The list of resolvers.</p>', 'ListResolversResponse$resolvers' => '<p>The <code>Resolver</code> objects.</p>', ], ], 'ResourceArn' => [ 'base' => NULL, 'refs' => [ 'ListTagsForResourceRequest$resourceArn' => '<p>The <code>GraphqlApi</code> Amazon Resource Name (ARN).</p>', 'TagResourceRequest$resourceArn' => '<p>The <code>GraphqlApi</code> Amazon Resource Name (ARN).</p>', 'UntagResourceRequest$resourceArn' => '<p>The <code>GraphqlApi</code> Amazon Resource Name (ARN).</p>', ], ], 'ResourceName' => [ 'base' => NULL, 'refs' => [ 'CreateDataSourceRequest$name' => '<p>A user-supplied name for the <code>DataSource</code>.</p>', 'CreateFunctionRequest$name' => '<p>The <code>Function</code> name. The function name does not have to be unique.</p>', 'CreateFunctionRequest$dataSourceName' => '<p>The <code>Function</code> <code>DataSource</code> name.</p>', 'CreateResolverRequest$typeName' => '<p>The name of the <code>Type</code>.</p>', 'CreateResolverRequest$fieldName' => '<p>The name of the field to attach the resolver to.</p>', 'CreateResolverRequest$dataSourceName' => '<p>The name of the data source for which the resolver is being created.</p>', 'DataSource$name' => '<p>The name of the data source.</p>', 'DeleteDataSourceRequest$name' => '<p>The name of the data source.</p>', 'DeleteFunctionRequest$functionId' => '<p>The <code>Function</code> ID.</p>', 'DeleteResolverRequest$typeName' => '<p>The name of the resolver type.</p>', 'DeleteResolverRequest$fieldName' => '<p>The resolver field name.</p>', 'DeleteTypeRequest$typeName' => '<p>The type name.</p>', 'FunctionConfiguration$name' => '<p>The name of the <code>Function</code> object.</p>', 'FunctionConfiguration$dataSourceName' => '<p>The name of the <code>DataSource</code>.</p>', 'GetDataSourceRequest$name' => '<p>The name of the data source.</p>', 'GetFunctionRequest$functionId' => '<p>The <code>Function</code> ID.</p>', 'GetResolverRequest$typeName' => '<p>The resolver type name.</p>', 'GetResolverRequest$fieldName' => '<p>The resolver field name.</p>', 'GetTypeRequest$typeName' => '<p>The type name.</p>', 'GraphqlApi$name' => '<p>The API name.</p>', 'Resolver$typeName' => '<p>The resolver type name.</p>', 'Resolver$fieldName' => '<p>The resolver field name.</p>', 'Resolver$dataSourceName' => '<p>The resolver data source name.</p>', 'Type$name' => '<p>The type name.</p>', 'UpdateDataSourceRequest$name' => '<p>The new name for the data source.</p>', 'UpdateFunctionRequest$name' => '<p>The <code>Function</code> name.</p>', 'UpdateFunctionRequest$functionId' => '<p>The function ID.</p>', 'UpdateFunctionRequest$dataSourceName' => '<p>The <code>Function</code> <code>DataSource</code> name.</p>', 'UpdateResolverRequest$typeName' => '<p>The new type name.</p>', 'UpdateResolverRequest$fieldName' => '<p>The new field name.</p>', 'UpdateResolverRequest$dataSourceName' => '<p>The new data source name.</p>', 'UpdateTypeRequest$typeName' => '<p>The new type name.</p>', ], ], 'RuntimeName' => [ 'base' => NULL, 'refs' => [ 'AppSyncRuntime$name' => '<p>The <code>name</code> of the runtime to use. Currently, the only allowed value is <code>APPSYNC_JS</code>.</p>', ], ], 'SchemaStatus' => [ 'base' => NULL, 'refs' => [ 'GetSchemaCreationStatusResponse$status' => '<p>The current state of the schema (PROCESSING, FAILED, SUCCESS, or NOT_APPLICABLE). When the schema is in the ACTIVE state, you can add data.</p>', 'StartSchemaCreationResponse$status' => '<p>The current state of the schema (PROCESSING, FAILED, SUCCESS, or NOT_APPLICABLE). When the schema is in the ACTIVE state, you can add data.</p>', ], ], 'SourceApiAssociation' => [ 'base' => '<p>Describes the configuration of a source API. A source API is a GraphQL API that is linked to a merged API. There can be multiple source APIs attached to each merged API. When linked to a merged API, the source API\\'s schema, data sources, and resolvers will be combined with other linked source API data to form a new, singular API. </p> <p>Source APIs can originate from your account or from other accounts via Amazon Web Services Resource Access Manager. For more information about sharing resources from other accounts, see <a href=\"https://docs.aws.amazon.com/ram/latest/userguide/what-is.html\">What is Amazon Web Services Resource Access Manager?</a> in the <i>Amazon Web Services Resource Access Manager</i> guide.</p>', 'refs' => [ 'AssociateMergedGraphqlApiResponse$sourceApiAssociation' => '<p>The <code>SourceApiAssociation</code> object data.</p>', 'AssociateSourceGraphqlApiResponse$sourceApiAssociation' => '<p>The <code>SourceApiAssociation</code> object data.</p>', 'GetSourceApiAssociationResponse$sourceApiAssociation' => '<p>The <code>SourceApiAssociation</code> object data.</p>', 'UpdateSourceApiAssociationResponse$sourceApiAssociation' => '<p>The <code>SourceApiAssociation</code> object data.</p>', ], ], 'SourceApiAssociationConfig' => [ 'base' => '<p>Describes properties used to specify configurations related to a source API.</p>', 'refs' => [ 'AssociateMergedGraphqlApiRequest$sourceApiAssociationConfig' => '<p>The <code>SourceApiAssociationConfig</code> object data.</p>', 'AssociateSourceGraphqlApiRequest$sourceApiAssociationConfig' => '<p>The <code>SourceApiAssociationConfig</code> object data.</p>', 'SourceApiAssociation$sourceApiAssociationConfig' => '<p>The <code>SourceApiAssociationConfig</code> object data.</p>', 'UpdateSourceApiAssociationRequest$sourceApiAssociationConfig' => '<p>The <code>SourceApiAssociationConfig</code> object data.</p>', ], ], 'SourceApiAssociationStatus' => [ 'base' => NULL, 'refs' => [ 'DisassociateMergedGraphqlApiResponse$sourceApiAssociationStatus' => '<p>The state of the source API association.</p>', 'DisassociateSourceGraphqlApiResponse$sourceApiAssociationStatus' => '<p>The state of the source API association.</p>', 'SourceApiAssociation$sourceApiAssociationStatus' => '<p>The state of the source API association.</p>', 'StartSchemaMergeResponse$sourceApiAssociationStatus' => '<p>The state of the source API association.</p>', ], ], 'SourceApiAssociationSummary' => [ 'base' => '<p>Describes the ARNs and IDs of associations, Merged APIs, and source APIs.</p>', 'refs' => [ 'SourceApiAssociationSummaryList$member' => NULL, ], ], 'SourceApiAssociationSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListSourceApiAssociationsResponse$sourceApiAssociationSummaries' => '<p>The <code>SourceApiAssociationSummary</code> object data.</p>', ], ], 'StartSchemaCreationRequest' => [ 'base' => NULL, 'refs' => [], ], 'StartSchemaCreationResponse' => [ 'base' => NULL, 'refs' => [], ], 'StartSchemaMergeRequest' => [ 'base' => NULL, 'refs' => [], ], 'StartSchemaMergeResponse' => [ 'base' => NULL, 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$message' => NULL, 'ApiAssociation$apiId' => '<p>The API ID.</p>', 'ApiAssociation$deploymentDetail' => '<p>Details about the last deployment status.</p>', 'ApiKey$id' => '<p>The API key ID.</p>', 'ApiKey$description' => '<p>A description of the purpose of the API key.</p>', 'ApiKeyLimitExceededException$message' => NULL, 'ApiKeyValidityOutOfBoundsException$message' => NULL, 'ApiLimitExceededException$message' => NULL, 'AppSyncRuntime$runtimeVersion' => '<p>The <code>version</code> of the runtime to use. Currently, the only allowed version is <code>1.0.0</code>.</p>', 'AssociateApiRequest$apiId' => '<p>The API ID. Private APIs can not be associated with custom domains.</p>', 'AssociateMergedGraphqlApiRequest$sourceApiIdentifier' => '<p>The identifier of the AppSync Source API. This is generated by the AppSync service. In most cases, source APIs (especially in your account) only require the API ID value or ARN of the source API. However, source APIs from other accounts (cross-account use cases) strictly require the full resource ARN of the source API.</p>', 'AssociateMergedGraphqlApiRequest$mergedApiIdentifier' => '<p>The identifier of the AppSync Merged API. This is generated by the AppSync service. In most cases, Merged APIs (especially in your account) only require the API ID value or ARN of the merged API. However, Merged APIs in other accounts (cross-account use cases) strictly require the full resource ARN of the merged API.</p>', 'AssociateMergedGraphqlApiRequest$description' => '<p>The description field.</p>', 'AssociateSourceGraphqlApiRequest$mergedApiIdentifier' => '<p>The identifier of the AppSync Merged API. This is generated by the AppSync service. In most cases, Merged APIs (especially in your account) only require the API ID value or ARN of the merged API. However, Merged APIs in other accounts (cross-account use cases) strictly require the full resource ARN of the merged API.</p>', 'AssociateSourceGraphqlApiRequest$sourceApiIdentifier' => '<p>The identifier of the AppSync Source API. This is generated by the AppSync service. In most cases, source APIs (especially in your account) only require the API ID value or ARN of the source API. However, source APIs from other accounts (cross-account use cases) strictly require the full resource ARN of the source API.</p>', 'AssociateSourceGraphqlApiRequest$description' => '<p>The description field.</p>', 'AwsIamConfig$signingRegion' => '<p>The signing Amazon Web Services Region for IAM authorization.</p>', 'AwsIamConfig$signingServiceName' => '<p>The signing service name for IAM authorization.</p>', 'CachingKeys$member' => NULL, 'CodeError$errorType' => '<p>The type of code error. </p> <p>Examples include, but aren\\'t limited to: <code>LINT_ERROR</code>, <code>PARSER_ERROR</code>.</p>', 'CodeError$value' => '<p>A user presentable error.</p> <p>Examples include, but aren\\'t limited to: <code>Parsing error: Unterminated string literal</code>.</p>', 'CognitoUserPoolConfig$userPoolId' => '<p>The user pool ID.</p>', 'CognitoUserPoolConfig$awsRegion' => '<p>The Amazon Web Services Region in which the user pool was created.</p>', 'CognitoUserPoolConfig$appIdClientRegex' => '<p>A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn\\'t set, no filtering is applied.</p>', 'CreateApiCacheRequest$apiId' => '<p>The GraphQL API ID.</p>', 'CreateApiKeyRequest$apiId' => '<p>The ID for your GraphQL API.</p>', 'CreateApiKeyRequest$description' => '<p>A description of the purpose of the API key.</p>', 'CreateDataSourceRequest$apiId' => '<p>The API ID for the GraphQL API for the <code>DataSource</code>.</p>', 'CreateDataSourceRequest$description' => '<p>A description of the <code>DataSource</code>.</p>', 'CreateDataSourceRequest$serviceRoleArn' => '<p>The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.</p>', 'CreateFunctionRequest$apiId' => '<p>The GraphQL API ID.</p>', 'CreateFunctionRequest$description' => '<p>The <code>Function</code> description.</p>', 'CreateFunctionRequest$functionVersion' => '<p>The <code>version</code> of the request mapping template. Currently, the supported value is 2018-05-29. Note that when using VTL and mapping templates, the <code>functionVersion</code> is required.</p>', 'CreateGraphqlApiRequest$name' => '<p>A user-supplied name for the <code>GraphqlApi</code>.</p>', 'CreateGraphqlApiRequest$mergedApiExecutionRoleArn' => '<p>The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the <code>AUTO_MERGE</code> to update the merged API endpoint with the source API changes automatically.</p>', 'CreateGraphqlApiRequest$ownerContact' => '<p>The owner contact information for an API resource.</p> <p>This field accepts any string input with a length of 0 - 256 characters.</p>', 'CreateResolverRequest$apiId' => '<p>The ID for the GraphQL API for which the resolver is being created.</p>', 'CreateTypeRequest$apiId' => '<p>The API ID.</p>', 'CreateTypeRequest$definition' => '<p>The type definition, in GraphQL Schema Definition Language (SDL) format.</p> <p>For more information, see the <a href=\"http://graphql.org/learn/schema/\">GraphQL SDL documentation</a>.</p>', 'DataSource$dataSourceArn' => '<p>The data source Amazon Resource Name (ARN).</p>', 'DataSource$description' => '<p>The description of the data source.</p>', 'DataSource$serviceRoleArn' => '<p>The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.</p>', 'DeleteApiCacheRequest$apiId' => '<p>The API ID.</p>', 'DeleteApiKeyRequest$apiId' => '<p>The API ID.</p>', 'DeleteApiKeyRequest$id' => '<p>The ID for the API key.</p>', 'DeleteDataSourceRequest$apiId' => '<p>The API ID.</p>', 'DeleteFunctionRequest$apiId' => '<p>The GraphQL API ID.</p>', 'DeleteGraphqlApiRequest$apiId' => '<p>The API ID.</p>', 'DeleteResolverRequest$apiId' => '<p>The API ID.</p>', 'DeleteTypeRequest$apiId' => '<p>The API ID.</p>', 'DeltaSyncConfig$deltaSyncTableName' => '<p>The Delta Sync table name.</p>', 'DisassociateMergedGraphqlApiRequest$sourceApiIdentifier' => '<p>The identifier of the AppSync Source API. This is generated by the AppSync service. In most cases, source APIs (especially in your account) only require the API ID value or ARN of the source API. However, source APIs from other accounts (cross-account use cases) strictly require the full resource ARN of the source API.</p>', 'DisassociateMergedGraphqlApiRequest$associationId' => '<p>The ID generated by the AppSync service for the source API association.</p>', 'DisassociateSourceGraphqlApiRequest$mergedApiIdentifier' => '<p>The identifier of the AppSync Merged API. This is generated by the AppSync service. In most cases, Merged APIs (especially in your account) only require the API ID value or ARN of the merged API. However, Merged APIs in other accounts (cross-account use cases) strictly require the full resource ARN of the merged API.</p>', 'DisassociateSourceGraphqlApiRequest$associationId' => '<p>The ID generated by the AppSync service for the source API association.</p>', 'DomainNameConfig$appsyncDomainName' => '<p>The domain name that AppSync provides.</p>', 'DomainNameConfig$hostedZoneId' => '<p>The ID of your Amazon Route\u00c2\u00a053 hosted zone.</p>', 'DynamodbDataSourceConfig$tableName' => '<p>The table name.</p>', 'DynamodbDataSourceConfig$awsRegion' => '<p>The Amazon Web Services Region.</p>', 'ElasticsearchDataSourceConfig$endpoint' => '<p>The endpoint.</p>', 'ElasticsearchDataSourceConfig$awsRegion' => '<p>The Amazon Web Services Region.</p>', 'EvaluateCodeRequest$function' => '<p>The function within the code to be evaluated. If provided, the valid values are <code>request</code> and <code>response</code>.</p>', 'EventBridgeDataSourceConfig$eventBusArn' => '<p>The ARN of the event bus. For more information about event buses, see <a href=\"https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-bus.html\">Amazon EventBridge event buses</a>.</p>', 'FlushApiCacheRequest$apiId' => '<p>The API ID.</p>', 'FunctionConfiguration$functionId' => '<p>A unique ID representing the <code>Function</code> object.</p>', 'FunctionConfiguration$functionArn' => '<p>The Amazon Resource Name (ARN) of the <code>Function</code> object.</p>', 'FunctionConfiguration$description' => '<p>The <code>Function</code> description.</p>', 'FunctionConfiguration$functionVersion' => '<p>The version of the request mapping template. Currently, only the 2018-05-29 version of the template is supported.</p>', 'FunctionsIds$member' => NULL, 'GetApiCacheRequest$apiId' => '<p>The API ID.</p>', 'GetDataSourceRequest$apiId' => '<p>The API ID.</p>', 'GetFunctionRequest$apiId' => '<p>The GraphQL API ID.</p>', 'GetGraphqlApiRequest$apiId' => '<p>The API ID for the GraphQL API.</p>', 'GetIntrospectionSchemaRequest$apiId' => '<p>The API ID.</p>', 'GetResolverRequest$apiId' => '<p>The API ID.</p>', 'GetSchemaCreationStatusRequest$apiId' => '<p>The API ID.</p>', 'GetSchemaCreationStatusResponse$details' => '<p>Detailed information about the status of the schema creation operation.</p>', 'GetSourceApiAssociationRequest$mergedApiIdentifier' => '<p>The identifier of the AppSync Merged API. This is generated by the AppSync service. In most cases, Merged APIs (especially in your account) only require the API ID value or ARN of the merged API. However, Merged APIs in other accounts (cross-account use cases) strictly require the full resource ARN of the merged API.</p>', 'GetSourceApiAssociationRequest$associationId' => '<p>The ID generated by the AppSync service for the source API association.</p>', 'GetTypeRequest$apiId' => '<p>The API ID.</p>', 'GraphqlApi$apiId' => '<p>The API ID.</p>', 'GraphqlApi$arn' => '<p>The Amazon Resource Name (ARN).</p>', 'GraphqlApi$wafWebAclArn' => '<p>The ARN of the WAF access control list (ACL) associated with this <code>GraphqlApi</code>, if one exists.</p>', 'GraphqlApi$mergedApiExecutionRoleArn' => '<p>The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the <code>AUTO_MERGE</code> to update the merged API endpoint with the source API changes automatically.</p>', 'GraphqlApi$owner' => '<p>The account owner of the GraphQL API.</p>', 'GraphqlApi$ownerContact' => '<p>The owner contact information for an API resource.</p> <p>This field accepts any string input with a length of 0 - 256 characters.</p>', 'HttpDataSourceConfig$endpoint' => '<p>The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don\\'t specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.</p>', 'InternalFailureException$message' => NULL, 'LambdaAuthorizerConfig$authorizerUri' => '<p>The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (<code>.../v3</code>), or an alias ARN. </p> <p> <b>Note</b>: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:</p> <p> <code>aws lambda add-permission --function-name \"arn:aws:lambda:us-east-2:111122223333:function:my-function\" --statement-id \"appsync\" --principal appsync.amazonaws.com --action lambda:InvokeFunction</code> </p>', 'LambdaAuthorizerConfig$identityValidationExpression' => '<p>A regular expression for validation of tokens before the Lambda function is called.</p>', 'LambdaConflictHandlerConfig$lambdaConflictHandlerArn' => '<p>The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.</p>', 'LambdaDataSourceConfig$lambdaFunctionArn' => '<p>The Amazon Resource Name (ARN) for the Lambda function.</p>', 'LimitExceededException$message' => NULL, 'ListApiKeysRequest$apiId' => '<p>The API ID.</p>', 'ListDataSourcesRequest$apiId' => '<p>The API ID.</p>', 'ListFunctionsRequest$apiId' => '<p>The GraphQL API ID.</p>', 'ListResolversByFunctionRequest$apiId' => '<p>The API ID.</p>', 'ListResolversByFunctionRequest$functionId' => '<p>The function ID.</p>', 'ListResolversRequest$apiId' => '<p>The API ID.</p>', 'ListResolversRequest$typeName' => '<p>The type name.</p>', 'ListSourceApiAssociationsRequest$apiId' => '<p>The API ID.</p>', 'ListTypesByAssociationRequest$mergedApiIdentifier' => '<p>The identifier of the AppSync Merged API. This is generated by the AppSync service. In most cases, Merged APIs (especially in your account) only require the API ID value or ARN of the merged API. However, Merged APIs in other accounts (cross-account use cases) strictly require the full resource ARN of the merged API.</p>', 'ListTypesByAssociationRequest$associationId' => '<p>The ID generated by the AppSync service for the source API association.</p>', 'ListTypesRequest$apiId' => '<p>The API ID.</p>', 'LogConfig$cloudWatchLogsRoleArn' => '<p>The service role that AppSync assumes to publish to CloudWatch logs in your account.</p>', 'Logs$member' => NULL, 'MapOfStringToString$key' => NULL, 'MapOfStringToString$value' => NULL, 'NotFoundException$message' => NULL, 'OpenIDConnectConfig$issuer' => '<p>The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of <code>iss</code> in the ID token.</p>', 'OpenIDConnectConfig$clientId' => '<p>The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.</p>', 'OpenSearchServiceDataSourceConfig$endpoint' => '<p>The endpoint.</p>', 'OpenSearchServiceDataSourceConfig$awsRegion' => '<p>The Amazon Web Services Region.</p>', 'RdsHttpEndpointConfig$awsRegion' => '<p>Amazon Web Services Region for Amazon RDS HTTP endpoint.</p>', 'RdsHttpEndpointConfig$dbClusterIdentifier' => '<p>Amazon RDS cluster Amazon Resource Name (ARN).</p>', 'RdsHttpEndpointConfig$databaseName' => '<p>Logical database name.</p>', 'RdsHttpEndpointConfig$schema' => '<p>Logical schema name.</p>', 'RdsHttpEndpointConfig$awsSecretStoreArn' => '<p>Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.</p>', 'Resolver$resolverArn' => '<p>The resolver Amazon Resource Name (ARN).</p>', 'SourceApiAssociation$associationId' => '<p>The ID generated by the AppSync service for the source API association.</p>', 'SourceApiAssociation$associationArn' => '<p>The Amazon Resource Name (ARN) of the source API association.</p>', 'SourceApiAssociation$sourceApiId' => '<p>The ID of the AppSync source API.</p>', 'SourceApiAssociation$sourceApiArn' => '<p>The Amazon Resource Name (ARN) of the AppSync source API.</p>', 'SourceApiAssociation$mergedApiArn' => '<p>The Amazon Resource Name (ARN) of the AppSync Merged API.</p>', 'SourceApiAssociation$mergedApiId' => '<p>The ID of the AppSync Merged API.</p>', 'SourceApiAssociation$description' => '<p>The description field.</p>', 'SourceApiAssociation$sourceApiAssociationStatusDetail' => '<p>The detailed message related to the current state of the source API association.</p>', 'SourceApiAssociationSummary$associationId' => '<p>The ID generated by the AppSync service for the source API association.</p>', 'SourceApiAssociationSummary$associationArn' => '<p>The Amazon Resource Name (ARN) of the source API association.</p>', 'SourceApiAssociationSummary$sourceApiId' => '<p>The ID of the AppSync source API.</p>', 'SourceApiAssociationSummary$sourceApiArn' => '<p>The Amazon Resource Name (ARN) of the AppSync Source API.</p>', 'SourceApiAssociationSummary$mergedApiId' => '<p>The ID of the AppSync Merged API.</p>', 'SourceApiAssociationSummary$mergedApiArn' => '<p>The Amazon Resource Name (ARN) of the AppSync Merged API.</p>', 'SourceApiAssociationSummary$description' => '<p>The description field.</p>', 'StartSchemaCreationRequest$apiId' => '<p>The API ID.</p>', 'StartSchemaMergeRequest$associationId' => '<p>The ID generated by the AppSync service for the source API association.</p>', 'StartSchemaMergeRequest$mergedApiIdentifier' => '<p>The identifier of the AppSync Merged API. This is generated by the AppSync service. In most cases, Merged APIs (especially in your account) only require the API ID value or ARN of the merged API. However, Merged APIs in other accounts (cross-account use cases) strictly require the full resource ARN of the merged API.</p>', 'Type$description' => '<p>The type description.</p>', 'Type$arn' => '<p>The type Amazon Resource Name (ARN).</p>', 'Type$definition' => '<p>The type definition.</p>', 'UnauthorizedException$message' => NULL, 'UpdateApiCacheRequest$apiId' => '<p>The GraphQL API ID.</p>', 'UpdateApiKeyRequest$apiId' => '<p>The ID for the GraphQL API.</p>', 'UpdateApiKeyRequest$id' => '<p>The API key ID.</p>', 'UpdateApiKeyRequest$description' => '<p>A description of the purpose of the API key.</p>', 'UpdateDataSourceRequest$apiId' => '<p>The API ID.</p>', 'UpdateDataSourceRequest$description' => '<p>The new description for the data source.</p>', 'UpdateDataSourceRequest$serviceRoleArn' => '<p>The new service role Amazon Resource Name (ARN) for the data source.</p>', 'UpdateFunctionRequest$apiId' => '<p>The GraphQL API ID.</p>', 'UpdateFunctionRequest$description' => '<p>The <code>Function</code> description.</p>', 'UpdateFunctionRequest$functionVersion' => '<p>The <code>version</code> of the request mapping template. Currently, the supported value is 2018-05-29. Note that when using VTL and mapping templates, the <code>functionVersion</code> is required.</p>', 'UpdateGraphqlApiRequest$apiId' => '<p>The API ID.</p>', 'UpdateGraphqlApiRequest$name' => '<p>The new name for the <code>GraphqlApi</code> object.</p>', 'UpdateGraphqlApiRequest$mergedApiExecutionRoleArn' => '<p>The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the <code>AUTO_MERGE</code> to update the merged API endpoint with the source API changes automatically.</p>', 'UpdateGraphqlApiRequest$ownerContact' => '<p>The owner contact information for an API resource.</p> <p>This field accepts any string input with a length of 0 - 256 characters.</p>', 'UpdateResolverRequest$apiId' => '<p>The API ID.</p>', 'UpdateSourceApiAssociationRequest$associationId' => '<p>The ID generated by the AppSync service for the source API association.</p>', 'UpdateSourceApiAssociationRequest$mergedApiIdentifier' => '<p>The identifier of the AppSync Merged API. This is generated by the AppSync service. In most cases, Merged APIs (especially in your account) only require the API ID value or ARN of the merged API. However, Merged APIs in other accounts (cross-account use cases) strictly require the full resource ARN of the merged API.</p>', 'UpdateSourceApiAssociationRequest$description' => '<p>The description field.</p>', 'UpdateTypeRequest$apiId' => '<p>The API ID.</p>', 'UpdateTypeRequest$definition' => '<p>The new definition.</p>', 'UserPoolConfig$userPoolId' => '<p>The user pool ID.</p>', 'UserPoolConfig$awsRegion' => '<p>The Amazon Web Services Region in which the user pool was created.</p>', 'UserPoolConfig$appIdClientRegex' => '<p>A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn\\'t set, no filtering is applied.</p>', ], ], 'SyncConfig' => [ 'base' => '<p>Describes a Sync configuration for a resolver.</p> <p>Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.</p>', 'refs' => [ 'CreateFunctionRequest$syncConfig' => NULL, 'CreateResolverRequest$syncConfig' => '<p>The <code>SyncConfig</code> for a resolver attached to a versioned data source.</p>', 'FunctionConfiguration$syncConfig' => NULL, 'Resolver$syncConfig' => '<p>The <code>SyncConfig</code> for a resolver attached to a versioned data source.</p>', 'UpdateFunctionRequest$syncConfig' => NULL, 'UpdateResolverRequest$syncConfig' => '<p>The <code>SyncConfig</code> for a resolver attached to a versioned data source.</p>', ], ], 'TTL' => [ 'base' => NULL, 'refs' => [ 'LambdaAuthorizerConfig$authorizerResultTtlInSeconds' => '<p>The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don\\'t specify a value for <code>authorizerResultTtlInSeconds</code>, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a <code>ttlOverride</code> key in its response.</p>', ], ], 'TagKey' => [ 'base' => '<p>The key for the tag.</p>', 'refs' => [ 'TagKeyList$member' => NULL, 'TagMap$key' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$tagKeys' => '<p>A list of <code>TagKey</code> objects.</p>', ], ], 'TagMap' => [ 'base' => '<p>A map with keys of <code>TagKey</code> objects and values of <code>TagValue</code> objects.</p>', 'refs' => [ 'CreateGraphqlApiRequest$tags' => '<p>A <code>TagMap</code> object.</p>', 'GraphqlApi$tags' => '<p>The tags.</p>', 'ListTagsForResourceResponse$tags' => '<p>A <code>TagMap</code> object.</p>', 'TagResourceRequest$tags' => '<p>A <code>TagMap</code> object.</p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => '<p>The value for the tag.</p>', 'refs' => [ 'TagMap$value' => NULL, ], ], 'Template' => [ 'base' => NULL, 'refs' => [ 'EvaluateMappingTemplateRequest$template' => '<p>The mapping template; this can be a request or response template. A <code>template</code> is required for this action.</p>', ], ], 'Type' => [ 'base' => '<p>Describes a type.</p>', 'refs' => [ 'CreateTypeResponse$type' => '<p>The <code>Type</code> object.</p>', 'GetTypeResponse$type' => '<p>The <code>Type</code> object.</p>', 'TypeList$member' => NULL, 'UpdateTypeResponse$type' => '<p>The updated <code>Type</code> object.</p>', ], ], 'TypeDefinitionFormat' => [ 'base' => NULL, 'refs' => [ 'CreateTypeRequest$format' => '<p>The type format: SDL or JSON.</p>', 'GetTypeRequest$format' => '<p>The type format: SDL or JSON.</p>', 'ListTypesByAssociationRequest$format' => '<p>The format type.</p>', 'ListTypesRequest$format' => '<p>The type format: SDL or JSON.</p>', 'Type$format' => '<p>The type format: SDL or JSON.</p>', 'UpdateTypeRequest$format' => '<p>The new type format: SDL or JSON.</p>', ], ], 'TypeList' => [ 'base' => NULL, 'refs' => [ 'ListTypesByAssociationResponse$types' => '<p>The <code>Type</code> objects.</p>', 'ListTypesResponse$types' => '<p>The <code>Type</code> objects.</p>', ], ], 'UnauthorizedException' => [ 'base' => '<p>You aren\\'t authorized to perform this operation.</p>', 'refs' => [], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateApiCacheRequest' => [ 'base' => '<p>Represents the input of a <code>UpdateApiCache</code> operation.</p>', 'refs' => [], ], 'UpdateApiCacheResponse' => [ 'base' => '<p>Represents the output of a <code>UpdateApiCache</code> operation.</p>', 'refs' => [], ], 'UpdateApiKeyRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateApiKeyResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateDataSourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateDataSourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateDomainNameRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateDomainNameResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateFunctionRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateFunctionResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateGraphqlApiRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateGraphqlApiResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateResolverRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateResolverResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateSourceApiAssociationRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateSourceApiAssociationResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateTypeRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateTypeResponse' => [ 'base' => NULL, 'refs' => [], ], 'UserPoolConfig' => [ 'base' => '<p>Describes an Amazon Cognito user pool configuration.</p>', 'refs' => [ 'CreateGraphqlApiRequest$userPoolConfig' => '<p>The Amazon Cognito user pool configuration.</p>', 'GraphqlApi$userPoolConfig' => '<p>The Amazon Cognito user pool configuration.</p>', 'UpdateGraphqlApiRequest$userPoolConfig' => '<p>The new Amazon Cognito user pool configuration for the <code>~GraphqlApi</code> object.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appsync/2017-07-25/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appsync-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appsync-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appsync.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://appsync.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appsync/2017-07-25/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://appsync.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appsync/2017-07-25/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/appsync/2017-07-25/paginators-1.json\nreturn [ 'pagination' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/arc-zonal-shift/2022-10-30/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2022-10-30', 'endpointPrefix' => 'arc-zonal-shift', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'AWS ARC - Zonal Shift', 'serviceId' => 'ARC Zonal Shift', 'signatureVersion' => 'v4', 'signingName' => 'arc-zonal-shift', 'uid' => 'arc-zonal-shift-2022-10-30', ], 'operations' => [ 'CancelZonalShift' => [ 'name' => 'CancelZonalShift', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/zonalshifts/{zonalShiftId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CancelZonalShiftRequest', ], 'output' => [ 'shape' => 'ZonalShift', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetManagedResource' => [ 'name' => 'GetManagedResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/managedresources/{resourceIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetManagedResourceRequest', ], 'output' => [ 'shape' => 'GetManagedResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListManagedResources' => [ 'name' => 'ListManagedResources', 'http' => [ 'method' => 'GET', 'requestUri' => '/managedresources', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListManagedResourcesRequest', ], 'output' => [ 'shape' => 'ListManagedResourcesResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListZonalShifts' => [ 'name' => 'ListZonalShifts', 'http' => [ 'method' => 'GET', 'requestUri' => '/zonalshifts', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListZonalShiftsRequest', ], 'output' => [ 'shape' => 'ListZonalShiftsResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'StartZonalShift' => [ 'name' => 'StartZonalShift', 'http' => [ 'method' => 'POST', 'requestUri' => '/zonalshifts', 'responseCode' => 201, ], 'input' => [ 'shape' => 'StartZonalShiftRequest', ], 'output' => [ 'shape' => 'ZonalShift', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'UpdateZonalShift' => [ 'name' => 'UpdateZonalShift', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/zonalshifts/{zonalShiftId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateZonalShiftRequest', ], 'output' => [ 'shape' => 'ZonalShift', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], ], ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 403, 'senderFault' => true, ], 'exception' => true, ], 'AppliedStatus' => [ 'type' => 'string', 'enum' => [ 'APPLIED', 'NOT_APPLIED', ], ], 'AppliedWeights' => [ 'type' => 'map', 'key' => [ 'shape' => 'AvailabilityZone', ], 'value' => [ 'shape' => 'Weight', ], ], 'AvailabilityZone' => [ 'type' => 'string', 'max' => 20, 'min' => 0, ], 'AvailabilityZones' => [ 'type' => 'list', 'member' => [ 'shape' => 'AvailabilityZone', ], ], 'CancelZonalShiftRequest' => [ 'type' => 'structure', 'required' => [ 'zonalShiftId', ], 'members' => [ 'zonalShiftId' => [ 'shape' => 'ZonalShiftId', 'location' => 'uri', 'locationName' => 'zonalShiftId', ], ], ], 'ConflictException' => [ 'type' => 'structure', 'required' => [ 'message', 'reason', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'reason' => [ 'shape' => 'ConflictExceptionReason', ], 'zonalShiftId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'ConflictExceptionReason' => [ 'type' => 'string', 'enum' => [ 'ZonalShiftAlreadyExists', 'ZonalShiftStatusNotActive', 'SimultaneousZonalShiftsConflict', ], ], 'ExpiresIn' => [ 'type' => 'string', 'max' => 5, 'min' => 2, 'pattern' => '^([1-9][0-9]*)(m|h)$', ], 'ExpiryTime' => [ 'type' => 'timestamp', ], 'GetManagedResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceIdentifier', ], 'members' => [ 'resourceIdentifier' => [ 'shape' => 'ResourceIdentifier', 'location' => 'uri', 'locationName' => 'resourceIdentifier', ], ], ], 'GetManagedResourceResponse' => [ 'type' => 'structure', 'required' => [ 'appliedWeights', 'zonalShifts', ], 'members' => [ 'appliedWeights' => [ 'shape' => 'AppliedWeights', ], 'arn' => [ 'shape' => 'ResourceArn', ], 'name' => [ 'shape' => 'ResourceName', ], 'zonalShifts' => [ 'shape' => 'ZonalShiftsInResource', ], ], ], 'InternalServerException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'ListManagedResourcesRequest' => [ 'type' => 'structure', 'members' => [ 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], ], ], 'ListManagedResourcesResponse' => [ 'type' => 'structure', 'required' => [ 'items', ], 'members' => [ 'items' => [ 'shape' => 'ManagedResourceSummaries', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'ListZonalShiftsRequest' => [ 'type' => 'structure', 'members' => [ 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'nextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'status' => [ 'shape' => 'ZonalShiftStatus', 'location' => 'querystring', 'locationName' => 'status', ], ], ], 'ListZonalShiftsResponse' => [ 'type' => 'structure', 'members' => [ 'items' => [ 'shape' => 'ZonalShiftSummaries', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'ManagedResourceSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'ManagedResourceSummary', ], ], 'ManagedResourceSummary' => [ 'type' => 'structure', 'required' => [ 'availabilityZones', ], 'members' => [ 'arn' => [ 'shape' => 'ResourceArn', ], 'availabilityZones' => [ 'shape' => 'AvailabilityZones', ], 'name' => [ 'shape' => 'ResourceName', ], ], ], 'MaxResults' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'ResourceArn' => [ 'type' => 'string', 'max' => 1024, 'min' => 8, 'pattern' => '^arn:.*$', ], 'ResourceIdentifier' => [ 'type' => 'string', 'max' => 1024, 'min' => 8, ], 'ResourceName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'StartTime' => [ 'type' => 'timestamp', ], 'StartZonalShiftRequest' => [ 'type' => 'structure', 'required' => [ 'awayFrom', 'comment', 'expiresIn', 'resourceIdentifier', ], 'members' => [ 'awayFrom' => [ 'shape' => 'AvailabilityZone', ], 'comment' => [ 'shape' => 'ZonalShiftComment', ], 'expiresIn' => [ 'shape' => 'ExpiresIn', ], 'resourceIdentifier' => [ 'shape' => 'ResourceIdentifier', ], ], ], 'String' => [ 'type' => 'string', ], 'ThrottlingException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 429, 'senderFault' => true, ], 'exception' => true, ], 'UpdateZonalShiftRequest' => [ 'type' => 'structure', 'required' => [ 'zonalShiftId', ], 'members' => [ 'comment' => [ 'shape' => 'ZonalShiftComment', ], 'expiresIn' => [ 'shape' => 'ExpiresIn', ], 'zonalShiftId' => [ 'shape' => 'ZonalShiftId', 'location' => 'uri', 'locationName' => 'zonalShiftId', ], ], ], 'ValidationException' => [ 'type' => 'structure', 'required' => [ 'message', 'reason', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'reason' => [ 'shape' => 'ValidationExceptionReason', ], ], 'error' => [ 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'ValidationExceptionReason' => [ 'type' => 'string', 'enum' => [ 'InvalidExpiresIn', 'InvalidStatus', 'MissingValue', 'InvalidToken', 'InvalidResourceIdentifier', 'InvalidAz', 'UnsupportedAz', ], ], 'Weight' => [ 'type' => 'float', 'box' => true, 'max' => 1, 'min' => 0, ], 'ZonalShift' => [ 'type' => 'structure', 'required' => [ 'awayFrom', 'comment', 'expiryTime', 'resourceIdentifier', 'startTime', 'status', 'zonalShiftId', ], 'members' => [ 'awayFrom' => [ 'shape' => 'AvailabilityZone', ], 'comment' => [ 'shape' => 'ZonalShiftComment', ], 'expiryTime' => [ 'shape' => 'ExpiryTime', ], 'resourceIdentifier' => [ 'shape' => 'ResourceIdentifier', ], 'startTime' => [ 'shape' => 'StartTime', ], 'status' => [ 'shape' => 'ZonalShiftStatus', ], 'zonalShiftId' => [ 'shape' => 'ZonalShiftId', ], ], ], 'ZonalShiftComment' => [ 'type' => 'string', 'max' => 128, 'min' => 0, ], 'ZonalShiftId' => [ 'type' => 'string', 'max' => 36, 'min' => 6, 'pattern' => '^[A-Za-z0-9-]+$', ], 'ZonalShiftInResource' => [ 'type' => 'structure', 'required' => [ 'appliedStatus', 'awayFrom', 'comment', 'expiryTime', 'resourceIdentifier', 'startTime', 'zonalShiftId', ], 'members' => [ 'appliedStatus' => [ 'shape' => 'AppliedStatus', ], 'awayFrom' => [ 'shape' => 'AvailabilityZone', ], 'comment' => [ 'shape' => 'ZonalShiftComment', ], 'expiryTime' => [ 'shape' => 'ExpiryTime', ], 'resourceIdentifier' => [ 'shape' => 'ResourceIdentifier', ], 'startTime' => [ 'shape' => 'StartTime', ], 'zonalShiftId' => [ 'shape' => 'ZonalShiftId', ], ], ], 'ZonalShiftStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'EXPIRED', 'CANCELED', ], ], 'ZonalShiftSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'ZonalShiftSummary', ], ], 'ZonalShiftSummary' => [ 'type' => 'structure', 'required' => [ 'awayFrom', 'comment', 'expiryTime', 'resourceIdentifier', 'startTime', 'status', 'zonalShiftId', ], 'members' => [ 'awayFrom' => [ 'shape' => 'AvailabilityZone', ], 'comment' => [ 'shape' => 'ZonalShiftComment', ], 'expiryTime' => [ 'shape' => 'ExpiryTime', ], 'resourceIdentifier' => [ 'shape' => 'ResourceIdentifier', ], 'startTime' => [ 'shape' => 'StartTime', ], 'status' => [ 'shape' => 'ZonalShiftStatus', ], 'zonalShiftId' => [ 'shape' => 'ZonalShiftId', ], ], ], 'ZonalShiftsInResource' => [ 'type' => 'list', 'member' => [ 'shape' => 'ZonalShiftInResource', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/arc-zonal-shift/2022-10-30/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>This is the API Reference Guide for the zonal shift feature of Amazon Route 53 Application Recovery Controller. This guide is for developers who need detailed information about zonal shift API actions, data types, and errors.</p> <p>Zonal shift is in preview release for Amazon Route 53 Application Recovery Controller and is subject to change.</p> <p>Zonal shift in Route 53 ARC enables you to move traffic for a load balancer resource away from an Availability Zone. Starting a zonal shift helps your application recover immediately, for example, from a developer\\'s bad code deployment or from an AWS infrastructure failure in a single Availability Zone, reducing the impact and time lost from an issue in one zone. </p> <p>Supported AWS resources are automatically registered with Route 53 ARC. Resources that are registered for zonal shifts in Route 53 ARC are managed resources in Route 53 ARC. You can start a zonal shift for any managed resource in your account in a Region. At this time, you can only start a zonal shift for Network Load Balancers and Application Load Balancers with cross-zone load balancing turned off.</p> <p>Zonal shifts are temporary. You must specify an expiration when you start a zonal shift, of up to three days initially. If you want to still keep traffic away from an Availability Zone, you can update the zonal shift and set a new expiration. You can also cancel a zonal shift, before it expires, for example, if you\\'re ready to restore traffic to the Availability Zone.</p> <p>For more information about using zonal shift, see the <a href=\"https://docs.aws.amazon.com/r53recovery/latest/dg/what-is-route53-recovery.html\">Amazon Route 53 Application Recovery Controller Developer Guide</a>.</p>', 'operations' => [ 'CancelZonalShift' => '<p>Cancel a zonal shift in Amazon Route 53 Application Recovery Controller that you\\'ve started for a resource in your AWS account in an AWS Region. </p>', 'GetManagedResource' => '<p>Get information about a resource that\\'s been registered for zonal shifts with Amazon Route 53 Application Recovery Controller in this AWS Region. Resources that are registered for zonal shifts are managed resources in Route 53 ARC.</p> <p>At this time, you can only start a zonal shift for Network Load Balancers and Application Load Balancers with cross-zone load balancing turned off.</p>', 'ListManagedResources' => '<p>Lists all the resources in your AWS account in this AWS Region that are managed for zonal shifts in Amazon Route 53 Application Recovery Controller, and information about them. The information includes their Amazon Resource Names (ARNs), the Availability Zones the resources are deployed in, and the resource name.</p>', 'ListZonalShifts' => '<p>Lists all the active zonal shifts in Amazon Route 53 Application Recovery Controller in your AWS account in this AWS Region.</p>', 'StartZonalShift' => '<p>You start a zonal shift to temporarily move load balancer traffic away from an Availability Zone in a AWS Region, to help your application recover immediately, for example, from a developer\\'s bad code deployment or from an AWS infrastructure failure in a single Availability Zone. You can start a zonal shift in Route 53 ARC only for managed resources in your account in an AWS Region. Resources are automatically registered with Route 53 ARC by AWS services.</p> <p>At this time, you can only start a zonal shift for Network Load Balancers and Application Load Balancers with cross-zone load balancing turned off.</p> <p>When you start a zonal shift, traffic for the resource is no longer routed to the Availability Zone. The zonal shift is created immediately in Route 53 ARC. However, it can take a short time, typically up to a few minutes, for existing, in-progress connections in the Availability Zone to complete.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/r53recovery/latest/dg/arc-zonal-shift.html\">Zonal shift</a> in the Amazon Route 53 Application Recovery Controller Developer Guide.</p>', 'UpdateZonalShift' => '<p>Update an active zonal shift in Amazon Route 53 Application Recovery Controller in your AWS account. You can update a zonal shift to set a new expiration, or edit or replace the comment for the zonal shift. </p>', ], 'shapes' => [ 'AccessDeniedException' => [ 'base' => '<p>You do not have sufficient access to perform this action.</p>', 'refs' => [], ], 'AppliedStatus' => [ 'base' => NULL, 'refs' => [ 'ZonalShiftInResource$appliedStatus' => '<p>An <code>appliedStatus</code> for a zonal shift for a resource can have one of two values: <code>APPLIED</code> or <code>NOT_APPLIED</code>. </p>', ], ], 'AppliedWeights' => [ 'base' => NULL, 'refs' => [ 'GetManagedResourceResponse$appliedWeights' => '<p>A collection of key-value pairs that indicate whether resources are active in Availability Zones or not. The key name is the Availability Zone where the resource is deployed. The value is 1 or 0.</p>', ], ], 'AvailabilityZone' => [ 'base' => NULL, 'refs' => [ 'AppliedWeights$key' => NULL, 'AvailabilityZones$member' => NULL, 'StartZonalShiftRequest$awayFrom' => '<p>The Availability Zone that traffic is moved away from for a resource when you start a zonal shift. Until the zonal shift expires or you cancel it, traffic for the resource is instead moved to other Availability Zones in the AWS Region.</p>', 'ZonalShift$awayFrom' => '<p>The Availability Zone that traffic is moved away from for a resource when you start a zonal shift. Until the zonal shift expires or you cancel it, traffic for the resource is instead moved to other Availability Zones in the AWS Region.</p>', 'ZonalShiftInResource$awayFrom' => '<p>The Availability Zone that traffic is moved away from for a resource when you start a zonal shift. Until the zonal shift expires or you cancel it, traffic for the resource is instead moved to other Availability Zones in the AWS Region.</p>', 'ZonalShiftSummary$awayFrom' => '<p>The Availability Zone that traffic is moved away from for a resource when you start a zonal shift. Until the zonal shift expires or you cancel it, traffic for the resource is instead moved to other Availability Zones in the AWS Region.</p>', ], ], 'AvailabilityZones' => [ 'base' => NULL, 'refs' => [ 'ManagedResourceSummary$availabilityZones' => '<p>The Availability Zones that a resource is deployed in.</p>', ], ], 'CancelZonalShiftRequest' => [ 'base' => NULL, 'refs' => [], ], 'ConflictException' => [ 'base' => '<p>The request could not be processed because of conflict in the current state of the resource.</p>', 'refs' => [], ], 'ConflictExceptionReason' => [ 'base' => NULL, 'refs' => [ 'ConflictException$reason' => '<p>The reason for the conflict exception.</p>', ], ], 'ExpiresIn' => [ 'base' => NULL, 'refs' => [ 'StartZonalShiftRequest$expiresIn' => '<p>The length of time that you want a zonal shift to be active, which Route 53 ARC converts to an expiry time (expiration time). Zonal shifts are temporary. You can set a zonal shift to be active initially for up to three days (72 hours).</p> <p>If you want to still keep traffic away from an Availability Zone, you can update the zonal shift and set a new expiration. You can also cancel a zonal shift, before it expires, for example, if you\\'re ready to restore traffic to the Availability Zone.</p> <p>To set a length of time for a zonal shift to be active, specify a whole number, and then one of the following, with no space:</p> <pre><code> &lt;ul&gt; &lt;li&gt; &lt;p&gt; &lt;b&gt;A lowercase letter m:&lt;/b&gt; To specify that the value is in minutes.&lt;/p&gt; &lt;/li&gt; &lt;li&gt; &lt;p&gt; &lt;b&gt;A lowercase letter h:&lt;/b&gt; To specify that the value is in hours.&lt;/p&gt; &lt;/li&gt; &lt;/ul&gt; &lt;p&gt;For example: &lt;code&gt;20h&lt;/code&gt; means the zonal shift expires in 20 hours. &lt;code&gt;120m&lt;/code&gt; means the zonal shift expires in 120 minutes (2 hours).&lt;/p&gt; </code></pre>', 'UpdateZonalShiftRequest$expiresIn' => '<p>The length of time that you want a zonal shift to be active, which Route 53 ARC converts to an expiry time (expiration time). Zonal shifts are temporary. You can set a zonal shift to be active initially for up to three days (72 hours).</p> <p>If you want to still keep traffic away from an Availability Zone, you can update the zonal shift and set a new expiration. You can also cancel a zonal shift, before it expires, for example, if you\\'re ready to restore traffic to the Availability Zone.</p> <p>To set a length of time for a zonal shift to be active, specify a whole number, and then one of the following, with no space:</p> <ul> <li> <p> <b>A lowercase letter m:</b> To specify that the value is in minutes.</p> </li> <li> <p> <b>A lowercase letter h:</b> To specify that the value is in hours.</p> </li> </ul> <p>For example: <code>20h</code> means the zonal shift expires in 20 hours. <code>120m</code> means the zonal shift expires in 120 minutes (2 hours).</p>', ], ], 'ExpiryTime' => [ 'base' => NULL, 'refs' => [ 'ZonalShift$expiryTime' => '<p>The expiry time (expiration time) for the zonal shift. A zonal shift is temporary and must be set to expire when you start the zonal shift. You can initially set a zonal shift to expire in a maximum of three days (72 hours). However, you can update a zonal shift to set a new expiration at any time. </p> <p>When you start a zonal shift, you specify how long you want it to be active, which Route 53 ARC converts to an expiry time (expiration time). You can cancel a zonal shift, for example, if you\\'re ready to restore traffic to the Availability Zone. Or you can update the zonal shift to specify another length of time to expire in.</p>', 'ZonalShiftInResource$expiryTime' => '<p>The expiry time (expiration time) for the zonal shift. A zonal shift is temporary and must be set to expire when you start the zonal shift. You can initially set a zonal shift to expire in a maximum of three days (72 hours). However, you can update a zonal shift to set a new expiration at any time. </p> <p>When you start a zonal shift, you specify how long you want it to be active, which Route 53 ARC converts to an expiry time (expiration time). You can cancel a zonal shift, for example, if you\\'re ready to restore traffic to the Availability Zone. Or you can update the zonal shift to specify another length of time to expire in.</p>', 'ZonalShiftSummary$expiryTime' => '<p>The expiry time (expiration time) for the zonal shift. A zonal shift is temporary and must be set to expire when you start the zonal shift. You can initially set a zonal shift to expire in a maximum of three days (72 hours). However, you can update a zonal shift to set a new expiration at any time. </p> <p>When you start a zonal shift, you specify how long you want it to be active, which Route 53 ARC converts to an expiry time (expiration time). You can cancel a zonal shift, for example, if you\\'re ready to restore traffic to the Availability Zone. Or you can update the zonal shift to specify another length of time to expire in.</p>', ], ], 'GetManagedResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetManagedResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'InternalServerException' => [ 'base' => '<p>There was an internal server error.</p>', 'refs' => [], ], 'ListManagedResourcesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListManagedResourcesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListZonalShiftsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListZonalShiftsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ManagedResourceSummaries' => [ 'base' => NULL, 'refs' => [ 'ListManagedResourcesResponse$items' => '<p>The items in the response list.</p>', ], ], 'ManagedResourceSummary' => [ 'base' => '<p>A complex structure for a managed resource in an account.</p> <p>A managed resource is a Network Load Balancer or Application Load Balancer that has been registered with Route 53 ARC by Elastic Load Balancing. You can start a zonal shift in Route 53 ARC for a managed resource to temporarily move traffic for the resource away from an Availability Zone in an AWS Region.</p> <note> <p>At this time, you can only start a zonal shift for Network Load Balancers and Application Load Balancers with cross-zone load balancing turned off.</p> </note>', 'refs' => [ 'ManagedResourceSummaries$member' => NULL, ], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'ListManagedResourcesRequest$maxResults' => '<p>The number of objects that you want to return with this call.</p>', 'ListZonalShiftsRequest$maxResults' => '<p>The number of objects that you want to return with this call.</p>', ], ], 'ResourceArn' => [ 'base' => NULL, 'refs' => [ 'GetManagedResourceResponse$arn' => '<p>The Amazon Resource Name (ARN) for the resource.</p>', 'ManagedResourceSummary$arn' => '<p>The Amazon Resource Name (ARN) for the managed resource.</p>', ], ], 'ResourceIdentifier' => [ 'base' => NULL, 'refs' => [ 'GetManagedResourceRequest$resourceIdentifier' => '<p>The identifier for the resource to include in a zonal shift. The identifier is the Amazon Resource Name (ARN) for the resource.</p> <p>At this time, you can only start a zonal shift for Network Load Balancers and Application Load Balancers with cross-zone load balancing turned off.</p>', 'StartZonalShiftRequest$resourceIdentifier' => '<p>The identifier for the resource to include in a zonal shift. The identifier is the Amazon Resource Name (ARN) for the resource.</p> <p>At this time, you can only start a zonal shift for Network Load Balancers and Application Load Balancers with cross-zone load balancing turned off.</p>', 'ZonalShift$resourceIdentifier' => '<p>The identifier for the resource to include in a zonal shift. The identifier is the Amazon Resource Name (ARN) for the resource.</p> <p>At this time, you can only start a zonal shift for Network Load Balancers and Application Load Balancers with cross-zone load balancing turned off.</p>', 'ZonalShiftInResource$resourceIdentifier' => '<p>The identifier for the resource to include in a zonal shift. The identifier is the Amazon Resource Name (ARN) for the resource.</p> <p>At this time, you can only start a zonal shift for Network Load Balancers and Application Load Balancers with cross-zone load balancing turned off.</p>', 'ZonalShiftSummary$resourceIdentifier' => '<p>The identifier for the resource to include in a zonal shift. The identifier is the Amazon Resource Name (ARN) for the resource.</p> <p>At this time, you can only start a zonal shift for Network Load Balancers and Application Load Balancers with cross-zone load balancing turned off.</p>', ], ], 'ResourceName' => [ 'base' => NULL, 'refs' => [ 'GetManagedResourceResponse$name' => '<p>The name of the resource.</p>', 'ManagedResourceSummary$name' => '<p>The name of the managed resource.</p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p>The input requested a resource that was not found.</p>', 'refs' => [], ], 'StartTime' => [ 'base' => NULL, 'refs' => [ 'ZonalShift$startTime' => '<p>The time (UTC) when the zonal shift is started.</p>', 'ZonalShiftInResource$startTime' => '<p>The time (UTC) when the zonal shift is started.</p>', 'ZonalShiftSummary$startTime' => '<p>The time (UTC) when the zonal shift is started.</p>', ], ], 'StartZonalShiftRequest' => [ 'base' => NULL, 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$message' => NULL, 'ConflictException$message' => NULL, 'ConflictException$zonalShiftId' => '<p>The zonal shift ID associated with the conflict exception.</p>', 'InternalServerException$message' => NULL, 'ListManagedResourcesRequest$nextToken' => '<p>Specifies that you want to receive the next page of results. Valid only if you received a <code>NextToken</code> response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call\\'s <code>NextToken</code> response to request the next page of results.</p>', 'ListManagedResourcesResponse$nextToken' => '<p>Specifies that you want to receive the next page of results. Valid only if you received a <code>NextToken</code> response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call\\'s <code>NextToken</code> response to request the next page of results.</p>', 'ListZonalShiftsRequest$nextToken' => '<p>Specifies that you want to receive the next page of results. Valid only if you received a <code>NextToken</code> response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call\\'s <code>NextToken</code> response to request the next page of results.</p>', 'ListZonalShiftsResponse$nextToken' => '<p>Specifies that you want to receive the next page of results. Valid only if you received a <code>NextToken</code> response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call\\'s <code>NextToken</code> response to request the next page of results.</p>', 'ResourceNotFoundException$message' => NULL, 'ThrottlingException$message' => NULL, 'ValidationException$message' => NULL, ], ], 'ThrottlingException' => [ 'base' => '<p>The request was denied due to request throttling.</p>', 'refs' => [], ], 'UpdateZonalShiftRequest' => [ 'base' => NULL, 'refs' => [], ], 'ValidationException' => [ 'base' => '<p>The input fails to satisfy the constraints specified by an AWS service.</p>', 'refs' => [], ], 'ValidationExceptionReason' => [ 'base' => NULL, 'refs' => [ 'ValidationException$reason' => '<p>The reason for the validation exception.</p>', ], ], 'Weight' => [ 'base' => NULL, 'refs' => [ 'AppliedWeights$value' => NULL, ], ], 'ZonalShift' => [ 'base' => NULL, 'refs' => [], ], 'ZonalShiftComment' => [ 'base' => NULL, 'refs' => [ 'StartZonalShiftRequest$comment' => '<p>A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. A new comment overwrites any existing comment string.</p>', 'UpdateZonalShiftRequest$comment' => '<p>A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. A new comment overwrites any existing comment string.</p>', 'ZonalShift$comment' => '<p>A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. A new comment overwrites any existing comment string.</p>', 'ZonalShiftInResource$comment' => '<p>A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. That is, a new comment overwrites any existing comment string.</p>', 'ZonalShiftSummary$comment' => '<p>A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. That is, a new comment overwrites any existing comment string.</p>', ], ], 'ZonalShiftId' => [ 'base' => NULL, 'refs' => [ 'CancelZonalShiftRequest$zonalShiftId' => '<p>The internally-generated identifier of a zonal shift.</p>', 'UpdateZonalShiftRequest$zonalShiftId' => '<p>The identifier of a zonal shift.</p>', 'ZonalShift$zonalShiftId' => '<p>The identifier of a zonal shift.</p>', 'ZonalShiftInResource$zonalShiftId' => '<p>The identifier of a zonal shift.</p>', 'ZonalShiftSummary$zonalShiftId' => '<p>The identifier of a zonal shift.</p>', ], ], 'ZonalShiftInResource' => [ 'base' => '<p>A complex structure that lists the zonal shifts for a managed resource and their statuses for the resource.</p>', 'refs' => [ 'ZonalShiftsInResource$member' => NULL, ], ], 'ZonalShiftStatus' => [ 'base' => NULL, 'refs' => [ 'ListZonalShiftsRequest$status' => '<p>A status for a zonal shift.</p> <p>The <code>Status</code> for a zonal shift can have one of the following values:</p> <ul> <li> <p> <b>ACTIVE</b>: The zonal shift is started and active.</p> </li> <li> <p> <b>EXPIRED</b>: The zonal shift has expired (the expiry time was exceeded).</p> </li> <li> <p> <b>CANCELED</b>: The zonal shift was canceled.</p> </li> </ul>', 'ZonalShift$status' => '<p>A status for a zonal shift.</p> <p>The <code>Status</code> for a zonal shift can have one of the following values:</p> <ul> <li> <p> <b>ACTIVE:</b> The zonal shift is started and active.</p> </li> <li> <p> <b>EXPIRED:</b> The zonal shift has expired (the expiry time was exceeded).</p> </li> <li> <p> <b>CANCELED:</b> The zonal shift was canceled.</p> </li> </ul>', 'ZonalShiftSummary$status' => '<p>A status for a zonal shift.</p> <p>The <code>Status</code> for a zonal shift can have one of the following values:</p> <ul> <li> <p> <b>ACTIVE:</b> The zonal shift is started and active.</p> </li> <li> <p> <b>EXPIRED:</b> The zonal shift has expired (the expiry time was exceeded).</p> </li> <li> <p> <b>CANCELED:</b> The zonal shift was canceled.</p> </li> </ul>', ], ], 'ZonalShiftSummaries' => [ 'base' => NULL, 'refs' => [ 'ListZonalShiftsResponse$items' => '<p>The items in the response list.</p>', ], ], 'ZonalShiftSummary' => [ 'base' => '<p>You start a zonal shift to temporarily move load balancer traffic away from an Availability Zone in a AWS Region. A zonal shift helps your application recover immediately, for example, from a developer\\'s bad code deployment or from an AWS infrastructure failure in a single Availability Zone. You can start a zonal shift in Route 53 ARC only for managed resources in your account in an AWS Region. Supported AWS resources are automatically registered with Route 53 ARC.</p> <p>Zonal shifts are temporary. A zonal shift can be active for up to three days (72 hours).</p> <p>When you start a zonal shift, you specify how long you want it to be active, which Amazon Route 53 Application Recovery Controller converts to an expiry time (expiration time). You can cancel a zonal shift, for example, if you\\'re ready to restore traffic to the Availability Zone. Or you can extend the zonal shift by updating the expiration so the zonal shift is active longer.</p>', 'refs' => [ 'ZonalShiftSummaries$member' => NULL, ], ], 'ZonalShiftsInResource' => [ 'base' => NULL, 'refs' => [ 'GetManagedResourceResponse$zonalShifts' => '<p>The zonal shifts that are currently active for a resource. </p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/arc-zonal-shift/2022-10-30/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => true, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], [ 'fn' => 'parseURL', 'argv' => [ [ 'ref' => 'Endpoint', ], ], 'assign' => 'url', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://arc-zonal-shift-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://arc-zonal-shift-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://arc-zonal-shift.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://arc-zonal-shift.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/arc-zonal-shift/2022-10-30/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://arc-zonal-shift-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://arc-zonal-shift-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://arc-zonal-shift.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://arc-zonal-shift.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://arc-zonal-shift-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'cn-north-1', ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://arc-zonal-shift-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'cn-north-1', ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://arc-zonal-shift.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'cn-north-1', ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://arc-zonal-shift.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'cn-north-1', ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'us-iso-east-1', ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://arc-zonal-shift-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'us-iso-east-1', ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'us-iso-east-1', ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://arc-zonal-shift.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-iso-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://arc-zonal-shift-fips.us-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://arc-zonal-shift-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://arc-zonal-shift.us-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://arc-zonal-shift.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'us-isob-east-1', ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://arc-zonal-shift-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'us-isob-east-1', ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'us-isob-east-1', ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://arc-zonal-shift.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-isob-east-1', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/arc-zonal-shift/2022-10-30/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/arc-zonal-shift/2022-10-30/paginators-1.json\nreturn [ 'pagination' => [ 'ListManagedResources' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'items', ], 'ListZonalShifts' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'items', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/athena/2017-05-18/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2017-05-18', 'endpointPrefix' => 'athena', 'jsonVersion' => '1.1', 'protocol' => 'json', 'serviceFullName' => 'Amazon Athena', 'serviceId' => 'Athena', 'signatureVersion' => 'v4', 'targetPrefix' => 'AmazonAthena', 'uid' => 'athena-2017-05-18', ], 'operations' => [ 'BatchGetNamedQuery' => [ 'name' => 'BatchGetNamedQuery', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'BatchGetNamedQueryInput', ], 'output' => [ 'shape' => 'BatchGetNamedQueryOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'BatchGetPreparedStatement' => [ 'name' => 'BatchGetPreparedStatement', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'BatchGetPreparedStatementInput', ], 'output' => [ 'shape' => 'BatchGetPreparedStatementOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'BatchGetQueryExecution' => [ 'name' => 'BatchGetQueryExecution', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'BatchGetQueryExecutionInput', ], 'output' => [ 'shape' => 'BatchGetQueryExecutionOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'CancelCapacityReservation' => [ 'name' => 'CancelCapacityReservation', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CancelCapacityReservationInput', ], 'output' => [ 'shape' => 'CancelCapacityReservationOutput', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'CreateCapacityReservation' => [ 'name' => 'CreateCapacityReservation', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateCapacityReservationInput', ], 'output' => [ 'shape' => 'CreateCapacityReservationOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], 'idempotent' => true, ], 'CreateDataCatalog' => [ 'name' => 'CreateDataCatalog', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateDataCatalogInput', ], 'output' => [ 'shape' => 'CreateDataCatalogOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'CreateNamedQuery' => [ 'name' => 'CreateNamedQuery', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateNamedQueryInput', ], 'output' => [ 'shape' => 'CreateNamedQueryOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], 'idempotent' => true, ], 'CreateNotebook' => [ 'name' => 'CreateNotebook', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateNotebookInput', ], 'output' => [ 'shape' => 'CreateNotebookOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'CreatePreparedStatement' => [ 'name' => 'CreatePreparedStatement', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreatePreparedStatementInput', ], 'output' => [ 'shape' => 'CreatePreparedStatementOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'CreatePresignedNotebookUrl' => [ 'name' => 'CreatePresignedNotebookUrl', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreatePresignedNotebookUrlRequest', ], 'output' => [ 'shape' => 'CreatePresignedNotebookUrlResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'CreateWorkGroup' => [ 'name' => 'CreateWorkGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateWorkGroupInput', ], 'output' => [ 'shape' => 'CreateWorkGroupOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'DeleteCapacityReservation' => [ 'name' => 'DeleteCapacityReservation', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteCapacityReservationInput', ], 'output' => [ 'shape' => 'DeleteCapacityReservationOutput', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'DeleteDataCatalog' => [ 'name' => 'DeleteDataCatalog', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteDataCatalogInput', ], 'output' => [ 'shape' => 'DeleteDataCatalogOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'DeleteNamedQuery' => [ 'name' => 'DeleteNamedQuery', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteNamedQueryInput', ], 'output' => [ 'shape' => 'DeleteNamedQueryOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], 'idempotent' => true, ], 'DeleteNotebook' => [ 'name' => 'DeleteNotebook', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteNotebookInput', ], 'output' => [ 'shape' => 'DeleteNotebookOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'DeletePreparedStatement' => [ 'name' => 'DeletePreparedStatement', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeletePreparedStatementInput', ], 'output' => [ 'shape' => 'DeletePreparedStatementOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DeleteWorkGroup' => [ 'name' => 'DeleteWorkGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteWorkGroupInput', ], 'output' => [ 'shape' => 'DeleteWorkGroupOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], 'idempotent' => true, ], 'ExportNotebook' => [ 'name' => 'ExportNotebook', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ExportNotebookInput', ], 'output' => [ 'shape' => 'ExportNotebookOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetCalculationExecution' => [ 'name' => 'GetCalculationExecution', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetCalculationExecutionRequest', ], 'output' => [ 'shape' => 'GetCalculationExecutionResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetCalculationExecutionCode' => [ 'name' => 'GetCalculationExecutionCode', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetCalculationExecutionCodeRequest', ], 'output' => [ 'shape' => 'GetCalculationExecutionCodeResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetCalculationExecutionStatus' => [ 'name' => 'GetCalculationExecutionStatus', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetCalculationExecutionStatusRequest', ], 'output' => [ 'shape' => 'GetCalculationExecutionStatusResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetCapacityAssignmentConfiguration' => [ 'name' => 'GetCapacityAssignmentConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetCapacityAssignmentConfigurationInput', ], 'output' => [ 'shape' => 'GetCapacityAssignmentConfigurationOutput', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetCapacityReservation' => [ 'name' => 'GetCapacityReservation', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetCapacityReservationInput', ], 'output' => [ 'shape' => 'GetCapacityReservationOutput', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetDataCatalog' => [ 'name' => 'GetDataCatalog', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetDataCatalogInput', ], 'output' => [ 'shape' => 'GetDataCatalogOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'GetDatabase' => [ 'name' => 'GetDatabase', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetDatabaseInput', ], 'output' => [ 'shape' => 'GetDatabaseOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'MetadataException', ], ], ], 'GetNamedQuery' => [ 'name' => 'GetNamedQuery', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetNamedQueryInput', ], 'output' => [ 'shape' => 'GetNamedQueryOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'GetNotebookMetadata' => [ 'name' => 'GetNotebookMetadata', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetNotebookMetadataInput', ], 'output' => [ 'shape' => 'GetNotebookMetadataOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetPreparedStatement' => [ 'name' => 'GetPreparedStatement', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetPreparedStatementInput', ], 'output' => [ 'shape' => 'GetPreparedStatementOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetQueryExecution' => [ 'name' => 'GetQueryExecution', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetQueryExecutionInput', ], 'output' => [ 'shape' => 'GetQueryExecutionOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'GetQueryResults' => [ 'name' => 'GetQueryResults', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetQueryResultsInput', ], 'output' => [ 'shape' => 'GetQueryResultsOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'GetQueryRuntimeStatistics' => [ 'name' => 'GetQueryRuntimeStatistics', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetQueryRuntimeStatisticsInput', ], 'output' => [ 'shape' => 'GetQueryRuntimeStatisticsOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'GetSession' => [ 'name' => 'GetSession', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetSessionRequest', ], 'output' => [ 'shape' => 'GetSessionResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetSessionStatus' => [ 'name' => 'GetSessionStatus', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetSessionStatusRequest', ], 'output' => [ 'shape' => 'GetSessionStatusResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetTableMetadata' => [ 'name' => 'GetTableMetadata', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetTableMetadataInput', ], 'output' => [ 'shape' => 'GetTableMetadataOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'MetadataException', ], ], ], 'GetWorkGroup' => [ 'name' => 'GetWorkGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetWorkGroupInput', ], 'output' => [ 'shape' => 'GetWorkGroupOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'ImportNotebook' => [ 'name' => 'ImportNotebook', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ImportNotebookInput', ], 'output' => [ 'shape' => 'ImportNotebookOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'ListApplicationDPUSizes' => [ 'name' => 'ListApplicationDPUSizes', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListApplicationDPUSizesInput', ], 'output' => [ 'shape' => 'ListApplicationDPUSizesOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'ListCalculationExecutions' => [ 'name' => 'ListCalculationExecutions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListCalculationExecutionsRequest', ], 'output' => [ 'shape' => 'ListCalculationExecutionsResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListCapacityReservations' => [ 'name' => 'ListCapacityReservations', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListCapacityReservationsInput', ], 'output' => [ 'shape' => 'ListCapacityReservationsOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'ListDataCatalogs' => [ 'name' => 'ListDataCatalogs', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListDataCatalogsInput', ], 'output' => [ 'shape' => 'ListDataCatalogsOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'ListDatabases' => [ 'name' => 'ListDatabases', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListDatabasesInput', ], 'output' => [ 'shape' => 'ListDatabasesOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'MetadataException', ], ], ], 'ListEngineVersions' => [ 'name' => 'ListEngineVersions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListEngineVersionsInput', ], 'output' => [ 'shape' => 'ListEngineVersionsOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'ListExecutors' => [ 'name' => 'ListExecutors', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListExecutorsRequest', ], 'output' => [ 'shape' => 'ListExecutorsResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListNamedQueries' => [ 'name' => 'ListNamedQueries', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListNamedQueriesInput', ], 'output' => [ 'shape' => 'ListNamedQueriesOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'ListNotebookMetadata' => [ 'name' => 'ListNotebookMetadata', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListNotebookMetadataInput', ], 'output' => [ 'shape' => 'ListNotebookMetadataOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'ListNotebookSessions' => [ 'name' => 'ListNotebookSessions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListNotebookSessionsRequest', ], 'output' => [ 'shape' => 'ListNotebookSessionsResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListPreparedStatements' => [ 'name' => 'ListPreparedStatements', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListPreparedStatementsInput', ], 'output' => [ 'shape' => 'ListPreparedStatementsOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'ListQueryExecutions' => [ 'name' => 'ListQueryExecutions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListQueryExecutionsInput', ], 'output' => [ 'shape' => 'ListQueryExecutionsOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'ListSessions' => [ 'name' => 'ListSessions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListSessionsRequest', ], 'output' => [ 'shape' => 'ListSessionsResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListTableMetadata' => [ 'name' => 'ListTableMetadata', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListTableMetadataInput', ], 'output' => [ 'shape' => 'ListTableMetadataOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'MetadataException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListTagsForResourceInput', ], 'output' => [ 'shape' => 'ListTagsForResourceOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListWorkGroups' => [ 'name' => 'ListWorkGroups', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListWorkGroupsInput', ], 'output' => [ 'shape' => 'ListWorkGroupsOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'PutCapacityAssignmentConfiguration' => [ 'name' => 'PutCapacityAssignmentConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutCapacityAssignmentConfigurationInput', ], 'output' => [ 'shape' => 'PutCapacityAssignmentConfigurationOutput', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'StartCalculationExecution' => [ 'name' => 'StartCalculationExecution', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StartCalculationExecutionRequest', ], 'output' => [ 'shape' => 'StartCalculationExecutionResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'StartQueryExecution' => [ 'name' => 'StartQueryExecution', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StartQueryExecutionInput', ], 'output' => [ 'shape' => 'StartQueryExecutionOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], 'idempotent' => true, ], 'StartSession' => [ 'name' => 'StartSession', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StartSessionRequest', ], 'output' => [ 'shape' => 'StartSessionResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'SessionAlreadyExistsException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'StopCalculationExecution' => [ 'name' => 'StopCalculationExecution', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StopCalculationExecutionRequest', ], 'output' => [ 'shape' => 'StopCalculationExecutionResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'StopQueryExecution' => [ 'name' => 'StopQueryExecution', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StopQueryExecutionInput', ], 'output' => [ 'shape' => 'StopQueryExecutionOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], 'idempotent' => true, ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'TagResourceInput', ], 'output' => [ 'shape' => 'TagResourceOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'TerminateSession' => [ 'name' => 'TerminateSession', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'TerminateSessionRequest', ], 'output' => [ 'shape' => 'TerminateSessionResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UntagResourceInput', ], 'output' => [ 'shape' => 'UntagResourceOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UpdateCapacityReservation' => [ 'name' => 'UpdateCapacityReservation', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateCapacityReservationInput', ], 'output' => [ 'shape' => 'UpdateCapacityReservationOutput', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UpdateDataCatalog' => [ 'name' => 'UpdateDataCatalog', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateDataCatalogInput', ], 'output' => [ 'shape' => 'UpdateDataCatalogOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'UpdateNamedQuery' => [ 'name' => 'UpdateNamedQuery', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateNamedQueryInput', ], 'output' => [ 'shape' => 'UpdateNamedQueryOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], 'idempotent' => true, ], 'UpdateNotebook' => [ 'name' => 'UpdateNotebook', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateNotebookInput', ], 'output' => [ 'shape' => 'UpdateNotebookOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdateNotebookMetadata' => [ 'name' => 'UpdateNotebookMetadata', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateNotebookMetadataInput', ], 'output' => [ 'shape' => 'UpdateNotebookMetadataOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'TooManyRequestsException', ], ], ], 'UpdatePreparedStatement' => [ 'name' => 'UpdatePreparedStatement', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdatePreparedStatementInput', ], 'output' => [ 'shape' => 'UpdatePreparedStatementOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UpdateWorkGroup' => [ 'name' => 'UpdateWorkGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateWorkGroupInput', ], 'output' => [ 'shape' => 'UpdateWorkGroupOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'InvalidRequestException', ], ], ], ], 'shapes' => [ 'AclConfiguration' => [ 'type' => 'structure', 'required' => [ 'S3AclOption', ], 'members' => [ 'S3AclOption' => [ 'shape' => 'S3AclOption', ], ], ], 'Age' => [ 'type' => 'integer', 'max' => 10080, 'min' => 0, ], 'AllocatedDpusInteger' => [ 'type' => 'integer', 'box' => true, 'min' => 0, ], 'AmazonResourceName' => [ 'type' => 'string', 'max' => 1011, 'min' => 1, ], 'ApplicationDPUSizes' => [ 'type' => 'structure', 'members' => [ 'ApplicationRuntimeId' => [ 'shape' => 'NameString', ], 'SupportedDPUSizes' => [ 'shape' => 'SupportedDPUSizeList', ], ], ], 'ApplicationDPUSizesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ApplicationDPUSizes', ], ], 'AthenaError' => [ 'type' => 'structure', 'members' => [ 'ErrorCategory' => [ 'shape' => 'ErrorCategory', ], 'ErrorType' => [ 'shape' => 'ErrorType', ], 'Retryable' => [ 'shape' => 'Boolean', ], 'ErrorMessage' => [ 'shape' => 'String', ], ], ], 'AuthToken' => [ 'type' => 'string', 'max' => 2048, ], 'AwsAccountId' => [ 'type' => 'string', 'max' => 12, 'min' => 12, 'pattern' => '^[0-9]+$', ], 'BatchGetNamedQueryInput' => [ 'type' => 'structure', 'required' => [ 'NamedQueryIds', ], 'members' => [ 'NamedQueryIds' => [ 'shape' => 'NamedQueryIdList', ], ], ], 'BatchGetNamedQueryOutput' => [ 'type' => 'structure', 'members' => [ 'NamedQueries' => [ 'shape' => 'NamedQueryList', ], 'UnprocessedNamedQueryIds' => [ 'shape' => 'UnprocessedNamedQueryIdList', ], ], ], 'BatchGetPreparedStatementInput' => [ 'type' => 'structure', 'required' => [ 'PreparedStatementNames', 'WorkGroup', ], 'members' => [ 'PreparedStatementNames' => [ 'shape' => 'PreparedStatementNameList', ], 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], ], ], 'BatchGetPreparedStatementOutput' => [ 'type' => 'structure', 'members' => [ 'PreparedStatements' => [ 'shape' => 'PreparedStatementDetailsList', ], 'UnprocessedPreparedStatementNames' => [ 'shape' => 'UnprocessedPreparedStatementNameList', ], ], ], 'BatchGetQueryExecutionInput' => [ 'type' => 'structure', 'required' => [ 'QueryExecutionIds', ], 'members' => [ 'QueryExecutionIds' => [ 'shape' => 'QueryExecutionIdList', ], ], ], 'BatchGetQueryExecutionOutput' => [ 'type' => 'structure', 'members' => [ 'QueryExecutions' => [ 'shape' => 'QueryExecutionList', ], 'UnprocessedQueryExecutionIds' => [ 'shape' => 'UnprocessedQueryExecutionIdList', ], ], ], 'Boolean' => [ 'type' => 'boolean', ], 'BoxedBoolean' => [ 'type' => 'boolean', ], 'BytesScannedCutoffValue' => [ 'type' => 'long', 'min' => 10000000, ], 'CalculationConfiguration' => [ 'type' => 'structure', 'members' => [ 'CodeBlock' => [ 'shape' => 'CodeBlock', ], ], ], 'CalculationExecutionId' => [ 'type' => 'string', 'max' => 36, 'min' => 1, ], 'CalculationExecutionState' => [ 'type' => 'string', 'enum' => [ 'CREATING', 'CREATED', 'QUEUED', 'RUNNING', 'CANCELING', 'CANCELED', 'COMPLETED', 'FAILED', ], ], 'CalculationResult' => [ 'type' => 'structure', 'members' => [ 'StdOutS3Uri' => [ 'shape' => 'S3Uri', ], 'StdErrorS3Uri' => [ 'shape' => 'S3Uri', ], 'ResultS3Uri' => [ 'shape' => 'S3Uri', ], 'ResultType' => [ 'shape' => 'CalculationResultType', ], ], ], 'CalculationResultType' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '\\\\w+\\\\/[-+.\\\\w]+', ], 'CalculationStatistics' => [ 'type' => 'structure', 'members' => [ 'DpuExecutionInMillis' => [ 'shape' => 'Long', ], 'Progress' => [ 'shape' => 'DescriptionString', ], ], ], 'CalculationStatus' => [ 'type' => 'structure', 'members' => [ 'SubmissionDateTime' => [ 'shape' => 'Date', ], 'CompletionDateTime' => [ 'shape' => 'Date', ], 'State' => [ 'shape' => 'CalculationExecutionState', ], 'StateChangeReason' => [ 'shape' => 'DescriptionString', ], ], ], 'CalculationSummary' => [ 'type' => 'structure', 'members' => [ 'CalculationExecutionId' => [ 'shape' => 'CalculationExecutionId', ], 'Description' => [ 'shape' => 'DescriptionString', ], 'Status' => [ 'shape' => 'CalculationStatus', ], ], ], 'CalculationsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CalculationSummary', ], 'max' => 100, 'min' => 0, ], 'CancelCapacityReservationInput' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'CapacityReservationName', ], ], ], 'CancelCapacityReservationOutput' => [ 'type' => 'structure', 'members' => [], ], 'CapacityAllocation' => [ 'type' => 'structure', 'required' => [ 'Status', 'RequestTime', ], 'members' => [ 'Status' => [ 'shape' => 'CapacityAllocationStatus', ], 'StatusMessage' => [ 'shape' => 'String', ], 'RequestTime' => [ 'shape' => 'Timestamp', ], 'RequestCompletionTime' => [ 'shape' => 'Timestamp', ], ], ], 'CapacityAllocationStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING', 'SUCCEEDED', 'FAILED', ], ], 'CapacityAssignment' => [ 'type' => 'structure', 'members' => [ 'WorkGroupNames' => [ 'shape' => 'WorkGroupNamesList', ], ], ], 'CapacityAssignmentConfiguration' => [ 'type' => 'structure', 'members' => [ 'CapacityReservationName' => [ 'shape' => 'CapacityReservationName', ], 'CapacityAssignments' => [ 'shape' => 'CapacityAssignmentsList', ], ], ], 'CapacityAssignmentsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CapacityAssignment', ], ], 'CapacityReservation' => [ 'type' => 'structure', 'required' => [ 'Name', 'Status', 'TargetDpus', 'AllocatedDpus', 'CreationTime', ], 'members' => [ 'Name' => [ 'shape' => 'CapacityReservationName', ], 'Status' => [ 'shape' => 'CapacityReservationStatus', ], 'TargetDpus' => [ 'shape' => 'TargetDpusInteger', ], 'AllocatedDpus' => [ 'shape' => 'AllocatedDpusInteger', ], 'LastAllocation' => [ 'shape' => 'CapacityAllocation', ], 'LastSuccessfulAllocationTime' => [ 'shape' => 'Timestamp', ], 'CreationTime' => [ 'shape' => 'Timestamp', ], ], ], 'CapacityReservationName' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[a-zA-Z0-9._-]+', ], 'CapacityReservationStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING', 'ACTIVE', 'CANCELLING', 'CANCELLED', 'FAILED', 'UPDATE_PENDING', ], ], 'CapacityReservationsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CapacityReservation', ], ], 'CatalogNameString' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\t]*', ], 'ClientRequestToken' => [ 'type' => 'string', 'max' => 36, 'min' => 1, 'pattern' => '[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}', ], 'CodeBlock' => [ 'type' => 'string', 'max' => 68000, ], 'Column' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'NameString', ], 'Type' => [ 'shape' => 'TypeString', ], 'Comment' => [ 'shape' => 'CommentString', ], ], ], 'ColumnInfo' => [ 'type' => 'structure', 'required' => [ 'Name', 'Type', ], 'members' => [ 'CatalogName' => [ 'shape' => 'String', ], 'SchemaName' => [ 'shape' => 'String', ], 'TableName' => [ 'shape' => 'String', ], 'Name' => [ 'shape' => 'String', ], 'Label' => [ 'shape' => 'String', ], 'Type' => [ 'shape' => 'String', ], 'Precision' => [ 'shape' => 'Integer', ], 'Scale' => [ 'shape' => 'Integer', ], 'Nullable' => [ 'shape' => 'ColumnNullable', ], 'CaseSensitive' => [ 'shape' => 'Boolean', ], ], ], 'ColumnInfoList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ColumnInfo', ], ], 'ColumnList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Column', ], ], 'ColumnNullable' => [ 'type' => 'string', 'enum' => [ 'NOT_NULL', 'NULLABLE', 'UNKNOWN', ], ], 'CommentString' => [ 'type' => 'string', 'max' => 255, 'min' => 0, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\t]*', ], 'CoordinatorDpuSize' => [ 'type' => 'integer', 'box' => true, 'max' => 1, 'min' => 1, ], 'CreateCapacityReservationInput' => [ 'type' => 'structure', 'required' => [ 'TargetDpus', 'Name', ], 'members' => [ 'TargetDpus' => [ 'shape' => 'TargetDpusInteger', ], 'Name' => [ 'shape' => 'CapacityReservationName', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateCapacityReservationOutput' => [ 'type' => 'structure', 'members' => [], ], 'CreateDataCatalogInput' => [ 'type' => 'structure', 'required' => [ 'Name', 'Type', ], 'members' => [ 'Name' => [ 'shape' => 'CatalogNameString', ], 'Type' => [ 'shape' => 'DataCatalogType', ], 'Description' => [ 'shape' => 'DescriptionString', ], 'Parameters' => [ 'shape' => 'ParametersMap', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateDataCatalogOutput' => [ 'type' => 'structure', 'members' => [], ], 'CreateNamedQueryInput' => [ 'type' => 'structure', 'required' => [ 'Name', 'Database', 'QueryString', ], 'members' => [ 'Name' => [ 'shape' => 'NameString', ], 'Description' => [ 'shape' => 'DescriptionString', ], 'Database' => [ 'shape' => 'DatabaseString', ], 'QueryString' => [ 'shape' => 'QueryString', ], 'ClientRequestToken' => [ 'shape' => 'IdempotencyToken', 'idempotencyToken' => true, ], 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], ], ], 'CreateNamedQueryOutput' => [ 'type' => 'structure', 'members' => [ 'NamedQueryId' => [ 'shape' => 'NamedQueryId', ], ], ], 'CreateNotebookInput' => [ 'type' => 'structure', 'required' => [ 'WorkGroup', 'Name', ], 'members' => [ 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], 'Name' => [ 'shape' => 'NotebookName', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', ], ], ], 'CreateNotebookOutput' => [ 'type' => 'structure', 'members' => [ 'NotebookId' => [ 'shape' => 'NotebookId', ], ], ], 'CreatePreparedStatementInput' => [ 'type' => 'structure', 'required' => [ 'StatementName', 'WorkGroup', 'QueryStatement', ], 'members' => [ 'StatementName' => [ 'shape' => 'StatementName', ], 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], 'QueryStatement' => [ 'shape' => 'QueryString', ], 'Description' => [ 'shape' => 'DescriptionString', ], ], ], 'CreatePreparedStatementOutput' => [ 'type' => 'structure', 'members' => [], ], 'CreatePresignedNotebookUrlRequest' => [ 'type' => 'structure', 'required' => [ 'SessionId', ], 'members' => [ 'SessionId' => [ 'shape' => 'SessionId', ], ], ], 'CreatePresignedNotebookUrlResponse' => [ 'type' => 'structure', 'required' => [ 'NotebookUrl', 'AuthToken', 'AuthTokenExpirationTime', ], 'members' => [ 'NotebookUrl' => [ 'shape' => 'String', ], 'AuthToken' => [ 'shape' => 'AuthToken', ], 'AuthTokenExpirationTime' => [ 'shape' => 'Long', ], ], ], 'CreateWorkGroupInput' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'WorkGroupName', ], 'Configuration' => [ 'shape' => 'WorkGroupConfiguration', ], 'Description' => [ 'shape' => 'WorkGroupDescriptionString', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateWorkGroupOutput' => [ 'type' => 'structure', 'members' => [], ], 'CustomerContentEncryptionConfiguration' => [ 'type' => 'structure', 'required' => [ 'KmsKey', ], 'members' => [ 'KmsKey' => [ 'shape' => 'KmsKey', ], ], ], 'DataCatalog' => [ 'type' => 'structure', 'required' => [ 'Name', 'Type', ], 'members' => [ 'Name' => [ 'shape' => 'CatalogNameString', ], 'Description' => [ 'shape' => 'DescriptionString', ], 'Type' => [ 'shape' => 'DataCatalogType', ], 'Parameters' => [ 'shape' => 'ParametersMap', ], ], ], 'DataCatalogSummary' => [ 'type' => 'structure', 'members' => [ 'CatalogName' => [ 'shape' => 'CatalogNameString', ], 'Type' => [ 'shape' => 'DataCatalogType', ], ], ], 'DataCatalogSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DataCatalogSummary', ], ], 'DataCatalogType' => [ 'type' => 'string', 'enum' => [ 'LAMBDA', 'GLUE', 'HIVE', ], ], 'Database' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'NameString', ], 'Description' => [ 'shape' => 'DescriptionString', ], 'Parameters' => [ 'shape' => 'ParametersMap', ], ], ], 'DatabaseList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Database', ], ], 'DatabaseString' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'Date' => [ 'type' => 'timestamp', ], 'Datum' => [ 'type' => 'structure', 'members' => [ 'VarCharValue' => [ 'shape' => 'datumString', ], ], ], 'DefaultExecutorDpuSize' => [ 'type' => 'integer', 'box' => true, 'max' => 1, 'min' => 1, ], 'DeleteCapacityReservationInput' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'CapacityReservationName', ], ], ], 'DeleteCapacityReservationOutput' => [ 'type' => 'structure', 'members' => [], ], 'DeleteDataCatalogInput' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'CatalogNameString', ], ], ], 'DeleteDataCatalogOutput' => [ 'type' => 'structure', 'members' => [], ], 'DeleteNamedQueryInput' => [ 'type' => 'structure', 'required' => [ 'NamedQueryId', ], 'members' => [ 'NamedQueryId' => [ 'shape' => 'NamedQueryId', 'idempotencyToken' => true, ], ], ], 'DeleteNamedQueryOutput' => [ 'type' => 'structure', 'members' => [], ], 'DeleteNotebookInput' => [ 'type' => 'structure', 'required' => [ 'NotebookId', ], 'members' => [ 'NotebookId' => [ 'shape' => 'NotebookId', ], ], ], 'DeleteNotebookOutput' => [ 'type' => 'structure', 'members' => [], ], 'DeletePreparedStatementInput' => [ 'type' => 'structure', 'required' => [ 'StatementName', 'WorkGroup', ], 'members' => [ 'StatementName' => [ 'shape' => 'StatementName', ], 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], ], ], 'DeletePreparedStatementOutput' => [ 'type' => 'structure', 'members' => [], ], 'DeleteWorkGroupInput' => [ 'type' => 'structure', 'required' => [ 'WorkGroup', ], 'members' => [ 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], 'RecursiveDeleteOption' => [ 'shape' => 'BoxedBoolean', ], ], ], 'DeleteWorkGroupOutput' => [ 'type' => 'structure', 'members' => [], ], 'DescriptionString' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, ], 'EncryptionConfiguration' => [ 'type' => 'structure', 'required' => [ 'EncryptionOption', ], 'members' => [ 'EncryptionOption' => [ 'shape' => 'EncryptionOption', ], 'KmsKey' => [ 'shape' => 'String', ], ], ], 'EncryptionOption' => [ 'type' => 'string', 'enum' => [ 'SSE_S3', 'SSE_KMS', 'CSE_KMS', ], ], 'EngineConfiguration' => [ 'type' => 'structure', 'required' => [ 'MaxConcurrentDpus', ], 'members' => [ 'CoordinatorDpuSize' => [ 'shape' => 'CoordinatorDpuSize', ], 'MaxConcurrentDpus' => [ 'shape' => 'MaxConcurrentDpus', ], 'DefaultExecutorDpuSize' => [ 'shape' => 'DefaultExecutorDpuSize', ], 'AdditionalConfigs' => [ 'shape' => 'ParametersMap', ], 'SparkProperties' => [ 'shape' => 'ParametersMap', ], ], ], 'EngineVersion' => [ 'type' => 'structure', 'members' => [ 'SelectedEngineVersion' => [ 'shape' => 'NameString', ], 'EffectiveEngineVersion' => [ 'shape' => 'NameString', ], ], ], 'EngineVersionsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'EngineVersion', ], 'max' => 10, 'min' => 0, ], 'ErrorCategory' => [ 'type' => 'integer', 'box' => true, 'max' => 3, 'min' => 1, ], 'ErrorCode' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'ErrorMessage' => [ 'type' => 'string', ], 'ErrorType' => [ 'type' => 'integer', 'box' => true, 'max' => 9999, 'min' => 0, ], 'ExecutionParameter' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, ], 'ExecutionParameters' => [ 'type' => 'list', 'member' => [ 'shape' => 'ExecutionParameter', ], 'min' => 1, ], 'ExecutorId' => [ 'type' => 'string', 'max' => 100000, 'pattern' => '.*', ], 'ExecutorState' => [ 'type' => 'string', 'enum' => [ 'CREATING', 'CREATED', 'REGISTERED', 'TERMINATING', 'TERMINATED', 'FAILED', ], ], 'ExecutorType' => [ 'type' => 'string', 'enum' => [ 'COORDINATOR', 'GATEWAY', 'WORKER', ], ], 'ExecutorsSummary' => [ 'type' => 'structure', 'required' => [ 'ExecutorId', ], 'members' => [ 'ExecutorId' => [ 'shape' => 'ExecutorId', ], 'ExecutorType' => [ 'shape' => 'ExecutorType', ], 'StartDateTime' => [ 'shape' => 'Long', ], 'TerminationDateTime' => [ 'shape' => 'Long', ], 'ExecutorState' => [ 'shape' => 'ExecutorState', ], 'ExecutorSize' => [ 'shape' => 'Long', ], ], ], 'ExecutorsSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ExecutorsSummary', ], ], 'ExportNotebookInput' => [ 'type' => 'structure', 'required' => [ 'NotebookId', ], 'members' => [ 'NotebookId' => [ 'shape' => 'NotebookId', ], ], ], 'ExportNotebookOutput' => [ 'type' => 'structure', 'members' => [ 'NotebookMetadata' => [ 'shape' => 'NotebookMetadata', ], 'Payload' => [ 'shape' => 'Payload', ], ], ], 'ExpressionString' => [ 'type' => 'string', 'max' => 256, 'min' => 0, ], 'FilterDefinition' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'NotebookName', ], ], ], 'GetCalculationExecutionCodeRequest' => [ 'type' => 'structure', 'required' => [ 'CalculationExecutionId', ], 'members' => [ 'CalculationExecutionId' => [ 'shape' => 'CalculationExecutionId', ], ], ], 'GetCalculationExecutionCodeResponse' => [ 'type' => 'structure', 'members' => [ 'CodeBlock' => [ 'shape' => 'CodeBlock', ], ], ], 'GetCalculationExecutionRequest' => [ 'type' => 'structure', 'required' => [ 'CalculationExecutionId', ], 'members' => [ 'CalculationExecutionId' => [ 'shape' => 'CalculationExecutionId', ], ], ], 'GetCalculationExecutionResponse' => [ 'type' => 'structure', 'members' => [ 'CalculationExecutionId' => [ 'shape' => 'CalculationExecutionId', ], 'SessionId' => [ 'shape' => 'SessionId', ], 'Description' => [ 'shape' => 'DescriptionString', ], 'WorkingDirectory' => [ 'shape' => 'S3Uri', ], 'Status' => [ 'shape' => 'CalculationStatus', ], 'Statistics' => [ 'shape' => 'CalculationStatistics', ], 'Result' => [ 'shape' => 'CalculationResult', ], ], ], 'GetCalculationExecutionStatusRequest' => [ 'type' => 'structure', 'required' => [ 'CalculationExecutionId', ], 'members' => [ 'CalculationExecutionId' => [ 'shape' => 'CalculationExecutionId', ], ], ], 'GetCalculationExecutionStatusResponse' => [ 'type' => 'structure', 'members' => [ 'Status' => [ 'shape' => 'CalculationStatus', ], 'Statistics' => [ 'shape' => 'CalculationStatistics', ], ], ], 'GetCapacityAssignmentConfigurationInput' => [ 'type' => 'structure', 'required' => [ 'CapacityReservationName', ], 'members' => [ 'CapacityReservationName' => [ 'shape' => 'CapacityReservationName', ], ], ], 'GetCapacityAssignmentConfigurationOutput' => [ 'type' => 'structure', 'required' => [ 'CapacityAssignmentConfiguration', ], 'members' => [ 'CapacityAssignmentConfiguration' => [ 'shape' => 'CapacityAssignmentConfiguration', ], ], ], 'GetCapacityReservationInput' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'CapacityReservationName', ], ], ], 'GetCapacityReservationOutput' => [ 'type' => 'structure', 'required' => [ 'CapacityReservation', ], 'members' => [ 'CapacityReservation' => [ 'shape' => 'CapacityReservation', ], ], ], 'GetDataCatalogInput' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'CatalogNameString', ], ], ], 'GetDataCatalogOutput' => [ 'type' => 'structure', 'members' => [ 'DataCatalog' => [ 'shape' => 'DataCatalog', ], ], ], 'GetDatabaseInput' => [ 'type' => 'structure', 'required' => [ 'CatalogName', 'DatabaseName', ], 'members' => [ 'CatalogName' => [ 'shape' => 'CatalogNameString', ], 'DatabaseName' => [ 'shape' => 'NameString', ], ], ], 'GetDatabaseOutput' => [ 'type' => 'structure', 'members' => [ 'Database' => [ 'shape' => 'Database', ], ], ], 'GetNamedQueryInput' => [ 'type' => 'structure', 'required' => [ 'NamedQueryId', ], 'members' => [ 'NamedQueryId' => [ 'shape' => 'NamedQueryId', ], ], ], 'GetNamedQueryOutput' => [ 'type' => 'structure', 'members' => [ 'NamedQuery' => [ 'shape' => 'NamedQuery', ], ], ], 'GetNotebookMetadataInput' => [ 'type' => 'structure', 'required' => [ 'NotebookId', ], 'members' => [ 'NotebookId' => [ 'shape' => 'NotebookId', ], ], ], 'GetNotebookMetadataOutput' => [ 'type' => 'structure', 'members' => [ 'NotebookMetadata' => [ 'shape' => 'NotebookMetadata', ], ], ], 'GetPreparedStatementInput' => [ 'type' => 'structure', 'required' => [ 'StatementName', 'WorkGroup', ], 'members' => [ 'StatementName' => [ 'shape' => 'StatementName', ], 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], ], ], 'GetPreparedStatementOutput' => [ 'type' => 'structure', 'members' => [ 'PreparedStatement' => [ 'shape' => 'PreparedStatement', ], ], ], 'GetQueryExecutionInput' => [ 'type' => 'structure', 'required' => [ 'QueryExecutionId', ], 'members' => [ 'QueryExecutionId' => [ 'shape' => 'QueryExecutionId', ], ], ], 'GetQueryExecutionOutput' => [ 'type' => 'structure', 'members' => [ 'QueryExecution' => [ 'shape' => 'QueryExecution', ], ], ], 'GetQueryResultsInput' => [ 'type' => 'structure', 'required' => [ 'QueryExecutionId', ], 'members' => [ 'QueryExecutionId' => [ 'shape' => 'QueryExecutionId', ], 'NextToken' => [ 'shape' => 'Token', ], 'MaxResults' => [ 'shape' => 'MaxQueryResults', ], ], ], 'GetQueryResultsOutput' => [ 'type' => 'structure', 'members' => [ 'UpdateCount' => [ 'shape' => 'Long', ], 'ResultSet' => [ 'shape' => 'ResultSet', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'GetQueryRuntimeStatisticsInput' => [ 'type' => 'structure', 'required' => [ 'QueryExecutionId', ], 'members' => [ 'QueryExecutionId' => [ 'shape' => 'QueryExecutionId', ], ], ], 'GetQueryRuntimeStatisticsOutput' => [ 'type' => 'structure', 'members' => [ 'QueryRuntimeStatistics' => [ 'shape' => 'QueryRuntimeStatistics', ], ], ], 'GetSessionRequest' => [ 'type' => 'structure', 'required' => [ 'SessionId', ], 'members' => [ 'SessionId' => [ 'shape' => 'SessionId', ], ], ], 'GetSessionResponse' => [ 'type' => 'structure', 'members' => [ 'SessionId' => [ 'shape' => 'SessionId', ], 'Description' => [ 'shape' => 'DescriptionString', ], 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], 'EngineVersion' => [ 'shape' => 'NameString', ], 'EngineConfiguration' => [ 'shape' => 'EngineConfiguration', ], 'NotebookVersion' => [ 'shape' => 'NameString', ], 'SessionConfiguration' => [ 'shape' => 'SessionConfiguration', ], 'Status' => [ 'shape' => 'SessionStatus', ], 'Statistics' => [ 'shape' => 'SessionStatistics', ], ], ], 'GetSessionStatusRequest' => [ 'type' => 'structure', 'required' => [ 'SessionId', ], 'members' => [ 'SessionId' => [ 'shape' => 'SessionId', ], ], ], 'GetSessionStatusResponse' => [ 'type' => 'structure', 'members' => [ 'SessionId' => [ 'shape' => 'SessionId', ], 'Status' => [ 'shape' => 'SessionStatus', ], ], ], 'GetTableMetadataInput' => [ 'type' => 'structure', 'required' => [ 'CatalogName', 'DatabaseName', 'TableName', ], 'members' => [ 'CatalogName' => [ 'shape' => 'CatalogNameString', ], 'DatabaseName' => [ 'shape' => 'NameString', ], 'TableName' => [ 'shape' => 'NameString', ], ], ], 'GetTableMetadataOutput' => [ 'type' => 'structure', 'members' => [ 'TableMetadata' => [ 'shape' => 'TableMetadata', ], ], ], 'GetWorkGroupInput' => [ 'type' => 'structure', 'required' => [ 'WorkGroup', ], 'members' => [ 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], ], ], 'GetWorkGroupOutput' => [ 'type' => 'structure', 'members' => [ 'WorkGroup' => [ 'shape' => 'WorkGroup', ], ], ], 'IdempotencyToken' => [ 'type' => 'string', 'max' => 128, 'min' => 32, ], 'ImportNotebookInput' => [ 'type' => 'structure', 'required' => [ 'WorkGroup', 'Name', 'Payload', 'Type', ], 'members' => [ 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], 'Name' => [ 'shape' => 'NotebookName', ], 'Payload' => [ 'shape' => 'Payload', ], 'Type' => [ 'shape' => 'NotebookType', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', ], ], ], 'ImportNotebookOutput' => [ 'type' => 'structure', 'members' => [ 'NotebookId' => [ 'shape' => 'NotebookId', ], ], ], 'Integer' => [ 'type' => 'integer', ], 'InternalServerException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, 'fault' => true, ], 'InvalidRequestException' => [ 'type' => 'structure', 'members' => [ 'AthenaErrorCode' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'KeyString' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\t]*', ], 'KmsKey' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, 'pattern' => '^arn:aws[a-z\\\\-]*:kms:([a-z0-9\\\\-]+):\\\\d{12}:key/?[a-zA-Z_0-9+=,.@\\\\-_/]+$|^arn:aws[a-z\\\\-]*:kms:([a-z0-9\\\\-]+):\\\\d{12}:alias/?[a-zA-Z_0-9+=,.@\\\\-_/]+$|^alias/[a-zA-Z0-9/_-]+$|[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}', ], 'ListApplicationDPUSizesInput' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => 'MaxApplicationDPUSizesCount', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListApplicationDPUSizesOutput' => [ 'type' => 'structure', 'members' => [ 'ApplicationDPUSizes' => [ 'shape' => 'ApplicationDPUSizesList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListCalculationExecutionsRequest' => [ 'type' => 'structure', 'required' => [ 'SessionId', ], 'members' => [ 'SessionId' => [ 'shape' => 'SessionId', ], 'StateFilter' => [ 'shape' => 'CalculationExecutionState', ], 'MaxResults' => [ 'shape' => 'MaxCalculationsCount', ], 'NextToken' => [ 'shape' => 'SessionManagerToken', ], ], ], 'ListCalculationExecutionsResponse' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'SessionManagerToken', ], 'Calculations' => [ 'shape' => 'CalculationsList', ], ], ], 'ListCapacityReservationsInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'Token', ], 'MaxResults' => [ 'shape' => 'MaxCapacityReservationsCount', ], ], ], 'ListCapacityReservationsOutput' => [ 'type' => 'structure', 'required' => [ 'CapacityReservations', ], 'members' => [ 'NextToken' => [ 'shape' => 'Token', ], 'CapacityReservations' => [ 'shape' => 'CapacityReservationsList', ], ], ], 'ListDataCatalogsInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'Token', ], 'MaxResults' => [ 'shape' => 'MaxDataCatalogsCount', ], ], ], 'ListDataCatalogsOutput' => [ 'type' => 'structure', 'members' => [ 'DataCatalogsSummary' => [ 'shape' => 'DataCatalogSummaryList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListDatabasesInput' => [ 'type' => 'structure', 'required' => [ 'CatalogName', ], 'members' => [ 'CatalogName' => [ 'shape' => 'CatalogNameString', ], 'NextToken' => [ 'shape' => 'Token', ], 'MaxResults' => [ 'shape' => 'MaxDatabasesCount', ], ], ], 'ListDatabasesOutput' => [ 'type' => 'structure', 'members' => [ 'DatabaseList' => [ 'shape' => 'DatabaseList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListEngineVersionsInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'Token', ], 'MaxResults' => [ 'shape' => 'MaxEngineVersionsCount', ], ], ], 'ListEngineVersionsOutput' => [ 'type' => 'structure', 'members' => [ 'EngineVersions' => [ 'shape' => 'EngineVersionsList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListExecutorsRequest' => [ 'type' => 'structure', 'required' => [ 'SessionId', ], 'members' => [ 'SessionId' => [ 'shape' => 'SessionId', ], 'ExecutorStateFilter' => [ 'shape' => 'ExecutorState', ], 'MaxResults' => [ 'shape' => 'MaxListExecutorsCount', ], 'NextToken' => [ 'shape' => 'SessionManagerToken', ], ], ], 'ListExecutorsResponse' => [ 'type' => 'structure', 'required' => [ 'SessionId', ], 'members' => [ 'SessionId' => [ 'shape' => 'SessionId', ], 'NextToken' => [ 'shape' => 'SessionManagerToken', ], 'ExecutorsSummary' => [ 'shape' => 'ExecutorsSummaryList', ], ], ], 'ListNamedQueriesInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'Token', ], 'MaxResults' => [ 'shape' => 'MaxNamedQueriesCount', ], 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], ], ], 'ListNamedQueriesOutput' => [ 'type' => 'structure', 'members' => [ 'NamedQueryIds' => [ 'shape' => 'NamedQueryIdList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListNotebookMetadataInput' => [ 'type' => 'structure', 'required' => [ 'WorkGroup', ], 'members' => [ 'Filters' => [ 'shape' => 'FilterDefinition', ], 'NextToken' => [ 'shape' => 'Token', ], 'MaxResults' => [ 'shape' => 'MaxNotebooksCount', ], 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], ], ], 'ListNotebookMetadataOutput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'Token', ], 'NotebookMetadataList' => [ 'shape' => 'NotebookMetadataArray', ], ], ], 'ListNotebookSessionsRequest' => [ 'type' => 'structure', 'required' => [ 'NotebookId', ], 'members' => [ 'NotebookId' => [ 'shape' => 'NotebookId', ], 'MaxResults' => [ 'shape' => 'MaxSessionsCount', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListNotebookSessionsResponse' => [ 'type' => 'structure', 'required' => [ 'NotebookSessionsList', ], 'members' => [ 'NotebookSessionsList' => [ 'shape' => 'NotebookSessionsList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListPreparedStatementsInput' => [ 'type' => 'structure', 'required' => [ 'WorkGroup', ], 'members' => [ 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], 'NextToken' => [ 'shape' => 'Token', ], 'MaxResults' => [ 'shape' => 'MaxPreparedStatementsCount', ], ], ], 'ListPreparedStatementsOutput' => [ 'type' => 'structure', 'members' => [ 'PreparedStatements' => [ 'shape' => 'PreparedStatementsList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListQueryExecutionsInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'Token', ], 'MaxResults' => [ 'shape' => 'MaxQueryExecutionsCount', ], 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], ], ], 'ListQueryExecutionsOutput' => [ 'type' => 'structure', 'members' => [ 'QueryExecutionIds' => [ 'shape' => 'QueryExecutionIdList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListSessionsRequest' => [ 'type' => 'structure', 'required' => [ 'WorkGroup', ], 'members' => [ 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], 'StateFilter' => [ 'shape' => 'SessionState', ], 'MaxResults' => [ 'shape' => 'MaxSessionsCount', ], 'NextToken' => [ 'shape' => 'SessionManagerToken', ], ], ], 'ListSessionsResponse' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'SessionManagerToken', ], 'Sessions' => [ 'shape' => 'SessionsList', ], ], ], 'ListTableMetadataInput' => [ 'type' => 'structure', 'required' => [ 'CatalogName', 'DatabaseName', ], 'members' => [ 'CatalogName' => [ 'shape' => 'CatalogNameString', ], 'DatabaseName' => [ 'shape' => 'NameString', ], 'Expression' => [ 'shape' => 'ExpressionString', ], 'NextToken' => [ 'shape' => 'Token', ], 'MaxResults' => [ 'shape' => 'MaxTableMetadataCount', ], ], ], 'ListTableMetadataOutput' => [ 'type' => 'structure', 'members' => [ 'TableMetadataList' => [ 'shape' => 'TableMetadataList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListTagsForResourceInput' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'AmazonResourceName', ], 'NextToken' => [ 'shape' => 'Token', ], 'MaxResults' => [ 'shape' => 'MaxTagsCount', ], ], ], 'ListTagsForResourceOutput' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListWorkGroupsInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'Token', ], 'MaxResults' => [ 'shape' => 'MaxWorkGroupsCount', ], ], ], 'ListWorkGroupsOutput' => [ 'type' => 'structure', 'members' => [ 'WorkGroups' => [ 'shape' => 'WorkGroupsList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'Long' => [ 'type' => 'long', ], 'MaxApplicationDPUSizesCount' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'MaxCalculationsCount' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'MaxCapacityReservationsCount' => [ 'type' => 'integer', 'box' => true, 'max' => 50, 'min' => 1, ], 'MaxConcurrentDpus' => [ 'type' => 'integer', 'max' => 5000, 'min' => 2, ], 'MaxDataCatalogsCount' => [ 'type' => 'integer', 'box' => true, 'max' => 50, 'min' => 2, ], 'MaxDatabasesCount' => [ 'type' => 'integer', 'box' => true, 'max' => 50, 'min' => 1, ], 'MaxEngineVersionsCount' => [ 'type' => 'integer', 'box' => true, 'max' => 10, 'min' => 1, ], 'MaxListExecutorsCount' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'MaxNamedQueriesCount' => [ 'type' => 'integer', 'box' => true, 'max' => 50, 'min' => 0, ], 'MaxNotebooksCount' => [ 'type' => 'integer', 'box' => true, 'max' => 50, 'min' => 1, ], 'MaxPreparedStatementsCount' => [ 'type' => 'integer', 'box' => true, 'max' => 50, 'min' => 1, ], 'MaxQueryExecutionsCount' => [ 'type' => 'integer', 'box' => true, 'max' => 50, 'min' => 0, ], 'MaxQueryResults' => [ 'type' => 'integer', 'box' => true, 'max' => 1000, 'min' => 1, ], 'MaxSessionsCount' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'MaxTableMetadataCount' => [ 'type' => 'integer', 'box' => true, 'max' => 50, 'min' => 1, ], 'MaxTagsCount' => [ 'type' => 'integer', 'box' => true, 'min' => 75, ], 'MaxWorkGroupsCount' => [ 'type' => 'integer', 'box' => true, 'max' => 50, 'min' => 1, ], 'MetadataException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'NameString' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'NamedQuery' => [ 'type' => 'structure', 'required' => [ 'Name', 'Database', 'QueryString', ], 'members' => [ 'Name' => [ 'shape' => 'NameString', ], 'Description' => [ 'shape' => 'DescriptionString', ], 'Database' => [ 'shape' => 'DatabaseString', ], 'QueryString' => [ 'shape' => 'QueryString', ], 'NamedQueryId' => [ 'shape' => 'NamedQueryId', ], 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], ], ], 'NamedQueryDescriptionString' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, ], 'NamedQueryId' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '\\\\S+', ], 'NamedQueryIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'NamedQueryId', ], 'max' => 50, 'min' => 1, ], 'NamedQueryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'NamedQuery', ], ], 'NotebookId' => [ 'type' => 'string', 'max' => 36, 'min' => 1, 'pattern' => '[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}', ], 'NotebookMetadata' => [ 'type' => 'structure', 'members' => [ 'NotebookId' => [ 'shape' => 'NotebookId', ], 'Name' => [ 'shape' => 'NotebookName', ], 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], 'CreationTime' => [ 'shape' => 'Date', ], 'Type' => [ 'shape' => 'NotebookType', ], 'LastModifiedTime' => [ 'shape' => 'Date', ], ], ], 'NotebookMetadataArray' => [ 'type' => 'list', 'member' => [ 'shape' => 'NotebookMetadata', ], ], 'NotebookName' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\t]+', ], 'NotebookSessionSummary' => [ 'type' => 'structure', 'members' => [ 'SessionId' => [ 'shape' => 'SessionId', ], 'CreationTime' => [ 'shape' => 'Date', ], ], ], 'NotebookSessionsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'NotebookSessionSummary', ], 'max' => 10, 'min' => 0, ], 'NotebookType' => [ 'type' => 'string', 'enum' => [ 'IPYNB', ], ], 'ParametersMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'KeyString', ], 'value' => [ 'shape' => 'ParametersMapValue', ], ], 'ParametersMapValue' => [ 'type' => 'string', 'max' => 51200, ], 'Payload' => [ 'type' => 'string', 'max' => 10485760, 'min' => 1, ], 'PreparedStatement' => [ 'type' => 'structure', 'members' => [ 'StatementName' => [ 'shape' => 'StatementName', ], 'QueryStatement' => [ 'shape' => 'QueryString', ], 'WorkGroupName' => [ 'shape' => 'WorkGroupName', ], 'Description' => [ 'shape' => 'DescriptionString', ], 'LastModifiedTime' => [ 'shape' => 'Date', ], ], ], 'PreparedStatementDetailsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PreparedStatement', ], ], 'PreparedStatementNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'StatementName', ], ], 'PreparedStatementSummary' => [ 'type' => 'structure', 'members' => [ 'StatementName' => [ 'shape' => 'StatementName', ], 'LastModifiedTime' => [ 'shape' => 'Date', ], ], ], 'PreparedStatementsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PreparedStatementSummary', ], 'max' => 50, 'min' => 0, ], 'PutCapacityAssignmentConfigurationInput' => [ 'type' => 'structure', 'required' => [ 'CapacityReservationName', 'CapacityAssignments', ], 'members' => [ 'CapacityReservationName' => [ 'shape' => 'CapacityReservationName', ], 'CapacityAssignments' => [ 'shape' => 'CapacityAssignmentsList', ], ], ], 'PutCapacityAssignmentConfigurationOutput' => [ 'type' => 'structure', 'members' => [], ], 'QueryExecution' => [ 'type' => 'structure', 'members' => [ 'QueryExecutionId' => [ 'shape' => 'QueryExecutionId', ], 'Query' => [ 'shape' => 'QueryString', ], 'StatementType' => [ 'shape' => 'StatementType', ], 'ResultConfiguration' => [ 'shape' => 'ResultConfiguration', ], 'ResultReuseConfiguration' => [ 'shape' => 'ResultReuseConfiguration', ], 'QueryExecutionContext' => [ 'shape' => 'QueryExecutionContext', ], 'Status' => [ 'shape' => 'QueryExecutionStatus', ], 'Statistics' => [ 'shape' => 'QueryExecutionStatistics', ], 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], 'EngineVersion' => [ 'shape' => 'EngineVersion', ], 'ExecutionParameters' => [ 'shape' => 'ExecutionParameters', ], 'SubstatementType' => [ 'shape' => 'String', ], ], ], 'QueryExecutionContext' => [ 'type' => 'structure', 'members' => [ 'Database' => [ 'shape' => 'DatabaseString', ], 'Catalog' => [ 'shape' => 'CatalogNameString', ], ], ], 'QueryExecutionId' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '\\\\S+', ], 'QueryExecutionIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'QueryExecutionId', ], 'max' => 50, 'min' => 1, ], 'QueryExecutionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'QueryExecution', ], ], 'QueryExecutionState' => [ 'type' => 'string', 'enum' => [ 'QUEUED', 'RUNNING', 'SUCCEEDED', 'FAILED', 'CANCELLED', ], ], 'QueryExecutionStatistics' => [ 'type' => 'structure', 'members' => [ 'EngineExecutionTimeInMillis' => [ 'shape' => 'Long', ], 'DataScannedInBytes' => [ 'shape' => 'Long', ], 'DataManifestLocation' => [ 'shape' => 'String', ], 'TotalExecutionTimeInMillis' => [ 'shape' => 'Long', ], 'QueryQueueTimeInMillis' => [ 'shape' => 'Long', ], 'QueryPlanningTimeInMillis' => [ 'shape' => 'Long', ], 'ServiceProcessingTimeInMillis' => [ 'shape' => 'Long', ], 'ResultReuseInformation' => [ 'shape' => 'ResultReuseInformation', ], ], ], 'QueryExecutionStatus' => [ 'type' => 'structure', 'members' => [ 'State' => [ 'shape' => 'QueryExecutionState', ], 'StateChangeReason' => [ 'shape' => 'String', ], 'SubmissionDateTime' => [ 'shape' => 'Date', ], 'CompletionDateTime' => [ 'shape' => 'Date', ], 'AthenaError' => [ 'shape' => 'AthenaError', ], ], ], 'QueryRuntimeStatistics' => [ 'type' => 'structure', 'members' => [ 'Timeline' => [ 'shape' => 'QueryRuntimeStatisticsTimeline', ], 'Rows' => [ 'shape' => 'QueryRuntimeStatisticsRows', ], 'OutputStage' => [ 'shape' => 'QueryStage', ], ], ], 'QueryRuntimeStatisticsRows' => [ 'type' => 'structure', 'members' => [ 'InputRows' => [ 'shape' => 'Long', ], 'InputBytes' => [ 'shape' => 'Long', ], 'OutputBytes' => [ 'shape' => 'Long', ], 'OutputRows' => [ 'shape' => 'Long', ], ], ], 'QueryRuntimeStatisticsTimeline' => [ 'type' => 'structure', 'members' => [ 'QueryQueueTimeInMillis' => [ 'shape' => 'Long', ], 'QueryPlanningTimeInMillis' => [ 'shape' => 'Long', ], 'EngineExecutionTimeInMillis' => [ 'shape' => 'Long', ], 'ServiceProcessingTimeInMillis' => [ 'shape' => 'Long', ], 'TotalExecutionTimeInMillis' => [ 'shape' => 'Long', ], ], ], 'QueryStage' => [ 'type' => 'structure', 'members' => [ 'StageId' => [ 'shape' => 'Long', ], 'State' => [ 'shape' => 'String', ], 'OutputBytes' => [ 'shape' => 'Long', ], 'OutputRows' => [ 'shape' => 'Long', ], 'InputBytes' => [ 'shape' => 'Long', ], 'InputRows' => [ 'shape' => 'Long', ], 'ExecutionTime' => [ 'shape' => 'Long', ], 'QueryStagePlan' => [ 'shape' => 'QueryStagePlanNode', ], 'SubStages' => [ 'shape' => 'QueryStages', ], ], ], 'QueryStagePlanNode' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'String', ], 'Identifier' => [ 'shape' => 'String', ], 'Children' => [ 'shape' => 'QueryStagePlanNodes', ], 'RemoteSources' => [ 'shape' => 'StringList', ], ], ], 'QueryStagePlanNodes' => [ 'type' => 'list', 'member' => [ 'shape' => 'QueryStagePlanNode', ], ], 'QueryStages' => [ 'type' => 'list', 'member' => [ 'shape' => 'QueryStage', ], ], 'QueryString' => [ 'type' => 'string', 'max' => 262144, 'min' => 1, ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], 'ResourceName' => [ 'shape' => 'AmazonResourceName', ], ], 'exception' => true, ], 'ResultConfiguration' => [ 'type' => 'structure', 'members' => [ 'OutputLocation' => [ 'shape' => 'ResultOutputLocation', ], 'EncryptionConfiguration' => [ 'shape' => 'EncryptionConfiguration', ], 'ExpectedBucketOwner' => [ 'shape' => 'AwsAccountId', ], 'AclConfiguration' => [ 'shape' => 'AclConfiguration', ], ], ], 'ResultConfigurationUpdates' => [ 'type' => 'structure', 'members' => [ 'OutputLocation' => [ 'shape' => 'ResultOutputLocation', ], 'RemoveOutputLocation' => [ 'shape' => 'BoxedBoolean', ], 'EncryptionConfiguration' => [ 'shape' => 'EncryptionConfiguration', ], 'RemoveEncryptionConfiguration' => [ 'shape' => 'BoxedBoolean', ], 'ExpectedBucketOwner' => [ 'shape' => 'AwsAccountId', ], 'RemoveExpectedBucketOwner' => [ 'shape' => 'BoxedBoolean', ], 'AclConfiguration' => [ 'shape' => 'AclConfiguration', ], 'RemoveAclConfiguration' => [ 'shape' => 'BoxedBoolean', ], ], ], 'ResultOutputLocation' => [ 'type' => 'string', ], 'ResultReuseByAgeConfiguration' => [ 'type' => 'structure', 'required' => [ 'Enabled', ], 'members' => [ 'Enabled' => [ 'shape' => 'Boolean', ], 'MaxAgeInMinutes' => [ 'shape' => 'Age', ], ], ], 'ResultReuseConfiguration' => [ 'type' => 'structure', 'members' => [ 'ResultReuseByAgeConfiguration' => [ 'shape' => 'ResultReuseByAgeConfiguration', ], ], ], 'ResultReuseInformation' => [ 'type' => 'structure', 'required' => [ 'ReusedPreviousResult', ], 'members' => [ 'ReusedPreviousResult' => [ 'shape' => 'Boolean', ], ], ], 'ResultSet' => [ 'type' => 'structure', 'members' => [ 'Rows' => [ 'shape' => 'RowList', ], 'ResultSetMetadata' => [ 'shape' => 'ResultSetMetadata', ], ], ], 'ResultSetMetadata' => [ 'type' => 'structure', 'members' => [ 'ColumnInfo' => [ 'shape' => 'ColumnInfoList', ], ], ], 'RoleArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 20, 'pattern' => '^arn:aws[a-z\\\\-]*:iam::\\\\d{12}:role/?[a-zA-Z_0-9+=,.@\\\\-_/]+$', ], 'Row' => [ 'type' => 'structure', 'members' => [ 'Data' => [ 'shape' => 'datumList', ], ], ], 'RowList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Row', ], ], 'S3AclOption' => [ 'type' => 'string', 'enum' => [ 'BUCKET_OWNER_FULL_CONTROL', ], ], 'S3Uri' => [ 'type' => 'string', 'max' => 1024, 'pattern' => '^(https|s3|S3)://([^/]+)/?(.*)$', ], 'SessionAlreadyExistsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'SessionConfiguration' => [ 'type' => 'structure', 'members' => [ 'ExecutionRole' => [ 'shape' => 'RoleArn', ], 'WorkingDirectory' => [ 'shape' => 'ResultOutputLocation', ], 'IdleTimeoutSeconds' => [ 'shape' => 'Long', ], 'EncryptionConfiguration' => [ 'shape' => 'EncryptionConfiguration', ], ], ], 'SessionId' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'SessionIdleTimeoutInMinutes' => [ 'type' => 'integer', 'box' => true, 'max' => 480, 'min' => 1, ], 'SessionManagerToken' => [ 'type' => 'string', 'max' => 2048, ], 'SessionState' => [ 'type' => 'string', 'enum' => [ 'CREATING', 'CREATED', 'IDLE', 'BUSY', 'TERMINATING', 'TERMINATED', 'DEGRADED', 'FAILED', ], ], 'SessionStatistics' => [ 'type' => 'structure', 'members' => [ 'DpuExecutionInMillis' => [ 'shape' => 'Long', ], ], ], 'SessionStatus' => [ 'type' => 'structure', 'members' => [ 'StartDateTime' => [ 'shape' => 'Date', ], 'LastModifiedDateTime' => [ 'shape' => 'Date', ], 'EndDateTime' => [ 'shape' => 'Date', ], 'IdleSinceDateTime' => [ 'shape' => 'Date', ], 'State' => [ 'shape' => 'SessionState', ], 'StateChangeReason' => [ 'shape' => 'DescriptionString', ], ], ], 'SessionSummary' => [ 'type' => 'structure', 'members' => [ 'SessionId' => [ 'shape' => 'SessionId', ], 'Description' => [ 'shape' => 'DescriptionString', ], 'EngineVersion' => [ 'shape' => 'EngineVersion', ], 'NotebookVersion' => [ 'shape' => 'NameString', ], 'Status' => [ 'shape' => 'SessionStatus', ], ], ], 'SessionsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SessionSummary', ], 'max' => 100, 'min' => 0, ], 'StartCalculationExecutionRequest' => [ 'type' => 'structure', 'required' => [ 'SessionId', ], 'members' => [ 'SessionId' => [ 'shape' => 'SessionId', ], 'Description' => [ 'shape' => 'DescriptionString', ], 'CalculationConfiguration' => [ 'shape' => 'CalculationConfiguration', 'deprecated' => true, 'deprecatedMessage' => 'Kepler Post GA Tasks : https://sim.amazon.com/issues/ATHENA-39828', ], 'CodeBlock' => [ 'shape' => 'CodeBlock', ], 'ClientRequestToken' => [ 'shape' => 'IdempotencyToken', ], ], ], 'StartCalculationExecutionResponse' => [ 'type' => 'structure', 'members' => [ 'CalculationExecutionId' => [ 'shape' => 'CalculationExecutionId', ], 'State' => [ 'shape' => 'CalculationExecutionState', ], ], ], 'StartQueryExecutionInput' => [ 'type' => 'structure', 'required' => [ 'QueryString', ], 'members' => [ 'QueryString' => [ 'shape' => 'QueryString', ], 'ClientRequestToken' => [ 'shape' => 'IdempotencyToken', 'idempotencyToken' => true, ], 'QueryExecutionContext' => [ 'shape' => 'QueryExecutionContext', ], 'ResultConfiguration' => [ 'shape' => 'ResultConfiguration', ], 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], 'ExecutionParameters' => [ 'shape' => 'ExecutionParameters', ], 'ResultReuseConfiguration' => [ 'shape' => 'ResultReuseConfiguration', ], ], ], 'StartQueryExecutionOutput' => [ 'type' => 'structure', 'members' => [ 'QueryExecutionId' => [ 'shape' => 'QueryExecutionId', ], ], ], 'StartSessionRequest' => [ 'type' => 'structure', 'required' => [ 'WorkGroup', 'EngineConfiguration', ], 'members' => [ 'Description' => [ 'shape' => 'DescriptionString', ], 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], 'EngineConfiguration' => [ 'shape' => 'EngineConfiguration', ], 'NotebookVersion' => [ 'shape' => 'NameString', ], 'SessionIdleTimeoutInMinutes' => [ 'shape' => 'SessionIdleTimeoutInMinutes', ], 'ClientRequestToken' => [ 'shape' => 'IdempotencyToken', ], ], ], 'StartSessionResponse' => [ 'type' => 'structure', 'members' => [ 'SessionId' => [ 'shape' => 'SessionId', ], 'State' => [ 'shape' => 'SessionState', ], ], ], 'StatementName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '[a-zA-Z_][a-zA-Z0-9_@:]{1,256}', ], 'StatementType' => [ 'type' => 'string', 'enum' => [ 'DDL', 'DML', 'UTILITY', ], ], 'StopCalculationExecutionRequest' => [ 'type' => 'structure', 'required' => [ 'CalculationExecutionId', ], 'members' => [ 'CalculationExecutionId' => [ 'shape' => 'CalculationExecutionId', ], ], ], 'StopCalculationExecutionResponse' => [ 'type' => 'structure', 'members' => [ 'State' => [ 'shape' => 'CalculationExecutionState', ], ], ], 'StopQueryExecutionInput' => [ 'type' => 'structure', 'required' => [ 'QueryExecutionId', ], 'members' => [ 'QueryExecutionId' => [ 'shape' => 'QueryExecutionId', 'idempotencyToken' => true, ], ], ], 'StopQueryExecutionOutput' => [ 'type' => 'structure', 'members' => [], ], 'String' => [ 'type' => 'string', ], 'StringList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'SupportedDPUSizeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Integer', ], ], 'TableMetadata' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'NameString', ], 'CreateTime' => [ 'shape' => 'Timestamp', ], 'LastAccessTime' => [ 'shape' => 'Timestamp', ], 'TableType' => [ 'shape' => 'TableTypeString', ], 'Columns' => [ 'shape' => 'ColumnList', ], 'PartitionKeys' => [ 'shape' => 'ColumnList', ], 'Parameters' => [ 'shape' => 'ParametersMap', ], ], ], 'TableMetadataList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TableMetadata', ], ], 'TableTypeString' => [ 'type' => 'string', 'max' => 255, ], 'Tag' => [ 'type' => 'structure', 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], ], 'TagResourceInput' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'Tags', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'AmazonResourceName', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'TagResourceOutput' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, ], 'TargetDpusInteger' => [ 'type' => 'integer', 'box' => true, 'min' => 24, ], 'TerminateSessionRequest' => [ 'type' => 'structure', 'required' => [ 'SessionId', ], 'members' => [ 'SessionId' => [ 'shape' => 'SessionId', ], ], ], 'TerminateSessionResponse' => [ 'type' => 'structure', 'members' => [ 'State' => [ 'shape' => 'SessionState', ], ], ], 'ThrottleReason' => [ 'type' => 'string', 'enum' => [ 'CONCURRENT_QUERY_LIMIT_EXCEEDED', ], ], 'Timestamp' => [ 'type' => 'timestamp', ], 'Token' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, ], 'TooManyRequestsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], 'Reason' => [ 'shape' => 'ThrottleReason', ], ], 'exception' => true, ], 'TypeString' => [ 'type' => 'string', 'max' => 4096, 'min' => 0, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\t]*', ], 'UnprocessedNamedQueryId' => [ 'type' => 'structure', 'members' => [ 'NamedQueryId' => [ 'shape' => 'NamedQueryId', ], 'ErrorCode' => [ 'shape' => 'ErrorCode', ], 'ErrorMessage' => [ 'shape' => 'ErrorMessage', ], ], ], 'UnprocessedNamedQueryIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'UnprocessedNamedQueryId', ], ], 'UnprocessedPreparedStatementName' => [ 'type' => 'structure', 'members' => [ 'StatementName' => [ 'shape' => 'StatementName', ], 'ErrorCode' => [ 'shape' => 'ErrorCode', ], 'ErrorMessage' => [ 'shape' => 'ErrorMessage', ], ], ], 'UnprocessedPreparedStatementNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'UnprocessedPreparedStatementName', ], ], 'UnprocessedQueryExecutionId' => [ 'type' => 'structure', 'members' => [ 'QueryExecutionId' => [ 'shape' => 'QueryExecutionId', ], 'ErrorCode' => [ 'shape' => 'ErrorCode', ], 'ErrorMessage' => [ 'shape' => 'ErrorMessage', ], ], ], 'UnprocessedQueryExecutionIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'UnprocessedQueryExecutionId', ], ], 'UntagResourceInput' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'TagKeys', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'AmazonResourceName', ], 'TagKeys' => [ 'shape' => 'TagKeyList', ], ], ], 'UntagResourceOutput' => [ 'type' => 'structure', 'members' => [], ], 'UpdateCapacityReservationInput' => [ 'type' => 'structure', 'required' => [ 'TargetDpus', 'Name', ], 'members' => [ 'TargetDpus' => [ 'shape' => 'TargetDpusInteger', ], 'Name' => [ 'shape' => 'CapacityReservationName', ], ], ], 'UpdateCapacityReservationOutput' => [ 'type' => 'structure', 'members' => [], ], 'UpdateDataCatalogInput' => [ 'type' => 'structure', 'required' => [ 'Name', 'Type', ], 'members' => [ 'Name' => [ 'shape' => 'CatalogNameString', ], 'Type' => [ 'shape' => 'DataCatalogType', ], 'Description' => [ 'shape' => 'DescriptionString', ], 'Parameters' => [ 'shape' => 'ParametersMap', ], ], ], 'UpdateDataCatalogOutput' => [ 'type' => 'structure', 'members' => [], ], 'UpdateNamedQueryInput' => [ 'type' => 'structure', 'required' => [ 'NamedQueryId', 'Name', 'QueryString', ], 'members' => [ 'NamedQueryId' => [ 'shape' => 'NamedQueryId', ], 'Name' => [ 'shape' => 'NameString', ], 'Description' => [ 'shape' => 'NamedQueryDescriptionString', ], 'QueryString' => [ 'shape' => 'QueryString', ], ], ], 'UpdateNamedQueryOutput' => [ 'type' => 'structure', 'members' => [], ], 'UpdateNotebookInput' => [ 'type' => 'structure', 'required' => [ 'NotebookId', 'Payload', 'Type', ], 'members' => [ 'NotebookId' => [ 'shape' => 'NotebookId', ], 'Payload' => [ 'shape' => 'Payload', ], 'Type' => [ 'shape' => 'NotebookType', ], 'SessionId' => [ 'shape' => 'SessionId', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', ], ], ], 'UpdateNotebookMetadataInput' => [ 'type' => 'structure', 'required' => [ 'NotebookId', 'Name', ], 'members' => [ 'NotebookId' => [ 'shape' => 'NotebookId', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', ], 'Name' => [ 'shape' => 'NotebookName', ], ], ], 'UpdateNotebookMetadataOutput' => [ 'type' => 'structure', 'members' => [], ], 'UpdateNotebookOutput' => [ 'type' => 'structure', 'members' => [], ], 'UpdatePreparedStatementInput' => [ 'type' => 'structure', 'required' => [ 'StatementName', 'WorkGroup', 'QueryStatement', ], 'members' => [ 'StatementName' => [ 'shape' => 'StatementName', ], 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], 'QueryStatement' => [ 'shape' => 'QueryString', ], 'Description' => [ 'shape' => 'DescriptionString', ], ], ], 'UpdatePreparedStatementOutput' => [ 'type' => 'structure', 'members' => [], ], 'UpdateWorkGroupInput' => [ 'type' => 'structure', 'required' => [ 'WorkGroup', ], 'members' => [ 'WorkGroup' => [ 'shape' => 'WorkGroupName', ], 'Description' => [ 'shape' => 'WorkGroupDescriptionString', ], 'ConfigurationUpdates' => [ 'shape' => 'WorkGroupConfigurationUpdates', ], 'State' => [ 'shape' => 'WorkGroupState', ], ], ], 'UpdateWorkGroupOutput' => [ 'type' => 'structure', 'members' => [], ], 'WorkGroup' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'WorkGroupName', ], 'State' => [ 'shape' => 'WorkGroupState', ], 'Configuration' => [ 'shape' => 'WorkGroupConfiguration', ], 'Description' => [ 'shape' => 'WorkGroupDescriptionString', ], 'CreationTime' => [ 'shape' => 'Date', ], ], ], 'WorkGroupConfiguration' => [ 'type' => 'structure', 'members' => [ 'ResultConfiguration' => [ 'shape' => 'ResultConfiguration', ], 'EnforceWorkGroupConfiguration' => [ 'shape' => 'BoxedBoolean', ], 'PublishCloudWatchMetricsEnabled' => [ 'shape' => 'BoxedBoolean', ], 'BytesScannedCutoffPerQuery' => [ 'shape' => 'BytesScannedCutoffValue', ], 'RequesterPaysEnabled' => [ 'shape' => 'BoxedBoolean', ], 'EngineVersion' => [ 'shape' => 'EngineVersion', ], 'AdditionalConfiguration' => [ 'shape' => 'NameString', ], 'ExecutionRole' => [ 'shape' => 'RoleArn', ], 'CustomerContentEncryptionConfiguration' => [ 'shape' => 'CustomerContentEncryptionConfiguration', ], 'EnableMinimumEncryptionConfiguration' => [ 'shape' => 'BoxedBoolean', ], ], ], 'WorkGroupConfigurationUpdates' => [ 'type' => 'structure', 'members' => [ 'EnforceWorkGroupConfiguration' => [ 'shape' => 'BoxedBoolean', ], 'ResultConfigurationUpdates' => [ 'shape' => 'ResultConfigurationUpdates', ], 'PublishCloudWatchMetricsEnabled' => [ 'shape' => 'BoxedBoolean', ], 'BytesScannedCutoffPerQuery' => [ 'shape' => 'BytesScannedCutoffValue', ], 'RemoveBytesScannedCutoffPerQuery' => [ 'shape' => 'BoxedBoolean', ], 'RequesterPaysEnabled' => [ 'shape' => 'BoxedBoolean', ], 'EngineVersion' => [ 'shape' => 'EngineVersion', ], 'RemoveCustomerContentEncryptionConfiguration' => [ 'shape' => 'BoxedBoolean', ], 'AdditionalConfiguration' => [ 'shape' => 'NameString', ], 'ExecutionRole' => [ 'shape' => 'RoleArn', ], 'CustomerContentEncryptionConfiguration' => [ 'shape' => 'CustomerContentEncryptionConfiguration', ], 'EnableMinimumEncryptionConfiguration' => [ 'shape' => 'BoxedBoolean', ], ], ], 'WorkGroupDescriptionString' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, ], 'WorkGroupName' => [ 'type' => 'string', 'pattern' => '[a-zA-Z0-9._-]{1,128}', ], 'WorkGroupNamesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'WorkGroupName', ], ], 'WorkGroupState' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'DISABLED', ], ], 'WorkGroupSummary' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'WorkGroupName', ], 'State' => [ 'shape' => 'WorkGroupState', ], 'Description' => [ 'shape' => 'WorkGroupDescriptionString', ], 'CreationTime' => [ 'shape' => 'Date', ], 'EngineVersion' => [ 'shape' => 'EngineVersion', ], ], ], 'WorkGroupsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'WorkGroupSummary', ], 'max' => 50, 'min' => 0, ], 'datumList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Datum', ], ], 'datumString' => [ 'type' => 'string', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/athena/2017-05-18/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>Amazon Athena is an interactive query service that lets you use standard SQL to analyze data directly in Amazon S3. You can point Athena at your data in Amazon S3 and run ad-hoc queries and get results in seconds. Athena is serverless, so there is no infrastructure to set up or manage. You pay only for the queries you run. Athena scales automatically\u00e2\u20ac\u201dexecuting queries in parallel\u00e2\u20ac\u201dso results are fast, even with large datasets and complex queries. For more information, see <a href=\"http://docs.aws.amazon.com/athena/latest/ug/what-is.html\">What is Amazon Athena</a> in the <i>Amazon Athena User Guide</i>.</p> <p>If you connect to Athena using the JDBC driver, use version 1.1.0 of the driver or later with the Amazon Athena API. Earlier version drivers do not support the API. For more information and to download the driver, see <a href=\"https://docs.aws.amazon.com/athena/latest/ug/connect-with-jdbc.html\">Accessing Amazon Athena with JDBC</a>.</p> <p>For code samples using the Amazon Web Services SDK for Java, see <a href=\"https://docs.aws.amazon.com/athena/latest/ug/code-samples.html\">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>', 'operations' => [ 'BatchGetNamedQuery' => '<p>Returns the details of a single named query or a list of up to 50 queries, which you provide as an array of query ID strings. Requires you to have access to the workgroup in which the queries were saved. Use <a>ListNamedQueriesInput</a> to get the list of named query IDs in the specified workgroup. If information could not be retrieved for a submitted query ID, information about the query ID submitted is listed under <a>UnprocessedNamedQueryId</a>. Named queries differ from executed queries. Use <a>BatchGetQueryExecutionInput</a> to get details about each unique query execution, and <a>ListQueryExecutionsInput</a> to get a list of query execution IDs.</p>', 'BatchGetPreparedStatement' => '<p>Returns the details of a single prepared statement or a list of up to 256 prepared statements for the array of prepared statement names that you provide. Requires you to have access to the workgroup to which the prepared statements belong. If a prepared statement cannot be retrieved for the name specified, the statement is listed in <code>UnprocessedPreparedStatementNames</code>.</p>', 'BatchGetQueryExecution' => '<p>Returns the details of a single query execution or a list of up to 50 query executions, which you provide as an array of query execution ID strings. Requires you to have access to the workgroup in which the queries ran. To get a list of query execution IDs, use <a>ListQueryExecutionsInput$WorkGroup</a>. Query executions differ from named (saved) queries. Use <a>BatchGetNamedQueryInput</a> to get details about named queries.</p>', 'CancelCapacityReservation' => '<p>Cancels the capacity reservation with the specified name. Cancelled reservations remain in your account and will be deleted 45 days after cancellation. During the 45 days, you cannot re-purpose or reuse a reservation that has been cancelled, but you can refer to its tags and view it for historical reference. </p>', 'CreateCapacityReservation' => '<p>Creates a capacity reservation with the specified name and number of requested data processing units.</p>', 'CreateDataCatalog' => '<p>Creates (registers) a data catalog with the specified name and properties. Catalogs created are visible to all users of the same Amazon Web Services account.</p>', 'CreateNamedQuery' => '<p>Creates a named query in the specified workgroup. Requires that you have access to the workgroup.</p> <p>For code samples using the Amazon Web Services SDK for Java, see <a href=\"http://docs.aws.amazon.com/athena/latest/ug/code-samples.html\">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>', 'CreateNotebook' => '<p>Creates an empty <code>ipynb</code> file in the specified Apache Spark enabled workgroup. Throws an error if a file in the workgroup with the same name already exists.</p>', 'CreatePreparedStatement' => '<p>Creates a prepared statement for use with SQL queries in Athena.</p>', 'CreatePresignedNotebookUrl' => '<p>Gets an authentication token and the URL at which the notebook can be accessed. During programmatic access, <code>CreatePresignedNotebookUrl</code> must be called every 10 minutes to refresh the authentication token. For information about granting programmatic access, see <a href=\"https://docs.aws.amazon.com/athena/latest/ug/setting-up.html#setting-up-grant-programmatic-access\">Grant programmatic access</a>.</p>', 'CreateWorkGroup' => '<p>Creates a workgroup with the specified name. A workgroup can be an Apache Spark enabled workgroup or an Athena SQL workgroup.</p>', 'DeleteCapacityReservation' => '<p>Deletes a cancelled capacity reservation. A reservation must be cancelled before it can be deleted. A deleted reservation is immediately removed from your account and can no longer be referenced, including by its ARN. A deleted reservation cannot be called by <code>GetCapacityReservation</code>, and deleted reservations do not appear in the output of <code>ListCapacityReservations</code>.</p>', 'DeleteDataCatalog' => '<p>Deletes a data catalog.</p>', 'DeleteNamedQuery' => '<p>Deletes the named query if you have access to the workgroup in which the query was saved.</p> <p>For code samples using the Amazon Web Services SDK for Java, see <a href=\"http://docs.aws.amazon.com/athena/latest/ug/code-samples.html\">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>', 'DeleteNotebook' => '<p>Deletes the specified notebook.</p>', 'DeletePreparedStatement' => '<p>Deletes the prepared statement with the specified name from the specified workgroup.</p>', 'DeleteWorkGroup' => '<p>Deletes the workgroup with the specified name. The primary workgroup cannot be deleted.</p>', 'ExportNotebook' => '<p>Exports the specified notebook and its metadata.</p>', 'GetCalculationExecution' => '<p>Describes a previously submitted calculation execution.</p>', 'GetCalculationExecutionCode' => '<p>Retrieves the unencrypted code that was executed for the calculation.</p>', 'GetCalculationExecutionStatus' => '<p>Gets the status of a current calculation.</p>', 'GetCapacityAssignmentConfiguration' => '<p>Gets the capacity assignment configuration for a capacity reservation, if one exists.</p>', 'GetCapacityReservation' => '<p>Returns information about the capacity reservation with the specified name.</p>', 'GetDataCatalog' => '<p>Returns the specified data catalog.</p>', 'GetDatabase' => '<p>Returns a database object for the specified database and data catalog.</p>', 'GetNamedQuery' => '<p>Returns information about a single query. Requires that you have access to the workgroup in which the query was saved.</p>', 'GetNotebookMetadata' => '<p>Retrieves notebook metadata for the specified notebook ID.</p>', 'GetPreparedStatement' => '<p>Retrieves the prepared statement with the specified name from the specified workgroup.</p>', 'GetQueryExecution' => '<p>Returns information about a single execution of a query if you have access to the workgroup in which the query ran. Each time a query executes, information about the query execution is saved with a unique ID.</p>', 'GetQueryResults' => '<p>Streams the results of a single query execution specified by <code>QueryExecutionId</code> from the Athena query results location in Amazon S3. For more information, see <a href=\"https://docs.aws.amazon.com/athena/latest/ug/querying.html\">Working with query results, recent queries, and output files</a> in the <i>Amazon Athena User Guide</i>. This request does not execute the query but returns results. Use <a>StartQueryExecution</a> to run a query.</p> <p>To stream query results successfully, the IAM principal with permission to call <code>GetQueryResults</code> also must have permissions to the Amazon S3 <code>GetObject</code> action for the Athena query results location.</p> <important> <p>IAM principals with permission to the Amazon S3 <code>GetObject</code> action for the query results location are able to retrieve query results from Amazon S3 even if permission to the <code>GetQueryResults</code> action is denied. To restrict user or role access, ensure that Amazon S3 permissions to the Athena query location are denied.</p> </important>', 'GetQueryRuntimeStatistics' => '<p>Returns query execution runtime statistics related to a single execution of a query if you have access to the workgroup in which the query ran. Query execution runtime statistics are returned only when <a>QueryExecutionStatus$State</a> is in a SUCCEEDED or FAILED state. Stage-level input and output row count and data size statistics are not shown when a query has row-level filters defined in Lake Formation.</p>', 'GetSession' => '<p>Gets the full details of a previously created session, including the session status and configuration.</p>', 'GetSessionStatus' => '<p>Gets the current status of a session.</p>', 'GetTableMetadata' => '<p>Returns table metadata for the specified catalog, database, and table.</p>', 'GetWorkGroup' => '<p>Returns information about the workgroup with the specified name.</p>', 'ImportNotebook' => '<p>Imports a single <code>ipynb</code> file to a Spark enabled workgroup. The maximum file size that can be imported is 10 megabytes. If an <code>ipynb</code> file with the same name already exists in the workgroup, throws an error.</p>', 'ListApplicationDPUSizes' => '<p>Returns the supported DPU sizes for the supported application runtimes (for example, <code>Athena notebook version 1</code>). </p>', 'ListCalculationExecutions' => '<p>Lists the calculations that have been submitted to a session in descending order. Newer calculations are listed first; older calculations are listed later.</p>', 'ListCapacityReservations' => '<p>Lists the capacity reservations for the current account.</p>', 'ListDataCatalogs' => '<p>Lists the data catalogs in the current Amazon Web Services account.</p> <note> <p>In the Athena console, data catalogs are listed as \"data sources\" on the <b>Data sources</b> page under the <b>Data source name</b> column.</p> </note>', 'ListDatabases' => '<p>Lists the databases in the specified data catalog.</p>', 'ListEngineVersions' => '<p>Returns a list of engine versions that are available to choose from, including the Auto option.</p>', 'ListExecutors' => '<p>Lists, in descending order, the executors that joined a session. Newer executors are listed first; older executors are listed later. The result can be optionally filtered by state.</p>', 'ListNamedQueries' => '<p>Provides a list of available query IDs only for queries saved in the specified workgroup. Requires that you have access to the specified workgroup. If a workgroup is not specified, lists the saved queries for the primary workgroup.</p> <p>For code samples using the Amazon Web Services SDK for Java, see <a href=\"http://docs.aws.amazon.com/athena/latest/ug/code-samples.html\">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>', 'ListNotebookMetadata' => '<p>Displays the notebook files for the specified workgroup in paginated format.</p>', 'ListNotebookSessions' => '<p>Lists, in descending order, the sessions that have been created in a notebook that are in an active state like <code>CREATING</code>, <code>CREATED</code>, <code>IDLE</code> or <code>BUSY</code>. Newer sessions are listed first; older sessions are listed later.</p>', 'ListPreparedStatements' => '<p>Lists the prepared statements in the specified workgroup.</p>', 'ListQueryExecutions' => '<p>Provides a list of available query execution IDs for the queries in the specified workgroup. If a workgroup is not specified, returns a list of query execution IDs for the primary workgroup. Requires you to have access to the workgroup in which the queries ran.</p> <p>For code samples using the Amazon Web Services SDK for Java, see <a href=\"http://docs.aws.amazon.com/athena/latest/ug/code-samples.html\">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>', 'ListSessions' => '<p>Lists the sessions in a workgroup that are in an active state like <code>CREATING</code>, <code>CREATED</code>, <code>IDLE</code>, or <code>BUSY</code>. Newer sessions are listed first; older sessions are listed later.</p>', 'ListTableMetadata' => '<p>Lists the metadata for the tables in the specified data catalog database.</p>', 'ListTagsForResource' => '<p>Lists the tags associated with an Athena resource.</p>', 'ListWorkGroups' => '<p>Lists available workgroups for the account.</p>', 'PutCapacityAssignmentConfiguration' => '<p>Puts a new capacity assignment configuration for a specified capacity reservation. If a capacity assignment configuration already exists for the capacity reservation, replaces the existing capacity assignment configuration.</p>', 'StartCalculationExecution' => '<p>Submits calculations for execution within a session. You can supply the code to run as an inline code block within the request.</p>', 'StartQueryExecution' => '<p>Runs the SQL query statements contained in the <code>Query</code>. Requires you to have access to the workgroup in which the query ran. Running queries against an external catalog requires <a>GetDataCatalog</a> permission to the catalog. For code samples using the Amazon Web Services SDK for Java, see <a href=\"http://docs.aws.amazon.com/athena/latest/ug/code-samples.html\">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>', 'StartSession' => '<p>Creates a session for running calculations within a workgroup. The session is ready when it reaches an <code>IDLE</code> state.</p>', 'StopCalculationExecution' => '<p>Requests the cancellation of a calculation. A <code>StopCalculationExecution</code> call on a calculation that is already in a terminal state (for example, <code>STOPPED</code>, <code>FAILED</code>, or <code>COMPLETED</code>) succeeds but has no effect.</p> <note> <p>Cancelling a calculation is done on a best effort basis. If a calculation cannot be cancelled, you can be charged for its completion. If you are concerned about being charged for a calculation that cannot be cancelled, consider terminating the session in which the calculation is running.</p> </note>', 'StopQueryExecution' => '<p>Stops a query execution. Requires you to have access to the workgroup in which the query ran.</p> <p>For code samples using the Amazon Web Services SDK for Java, see <a href=\"http://docs.aws.amazon.com/athena/latest/ug/code-samples.html\">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>', 'TagResource' => '<p>Adds one or more tags to an Athena resource. A tag is a label that you assign to a resource. Each tag consists of a key and an optional value, both of which you define. For example, you can use tags to categorize Athena workgroups, data catalogs, or capacity reservations by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter the resources in your account. For best practices, see <a href=\"https://docs.aws.amazon.com/whitepapers/latest/tagging-best-practices/tagging-best-practices.html\">Tagging Best Practices</a>. Tag keys can be from 1 to 128 UTF-8 Unicode characters, and tag values can be from 0 to 256 UTF-8 Unicode characters. Tags can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys and values are case-sensitive. Tag keys must be unique per resource. If you specify more than one tag, separate them by commas.</p>', 'TerminateSession' => '<p>Terminates an active session. A <code>TerminateSession</code> call on a session that is already inactive (for example, in a <code>FAILED</code>, <code>TERMINATED</code> or <code>TERMINATING</code> state) succeeds but has no effect. Calculations running in the session when <code>TerminateSession</code> is called are forcefully stopped, but may display as <code>FAILED</code> instead of <code>STOPPED</code>.</p>', 'UntagResource' => '<p>Removes one or more tags from an Athena resource.</p>', 'UpdateCapacityReservation' => '<p>Updates the number of requested data processing units for the capacity reservation with the specified name.</p>', 'UpdateDataCatalog' => '<p>Updates the data catalog that has the specified name.</p>', 'UpdateNamedQuery' => '<p>Updates a <a>NamedQuery</a> object. The database or workgroup cannot be updated.</p>', 'UpdateNotebook' => '<p>Updates the contents of a Spark notebook.</p>', 'UpdateNotebookMetadata' => '<p>Updates the metadata for a notebook.</p>', 'UpdatePreparedStatement' => '<p>Updates a prepared statement.</p>', 'UpdateWorkGroup' => '<p>Updates the workgroup with the specified name. The workgroup\\'s name cannot be changed. Only <code>ConfigurationUpdates</code> can be specified.</p>', ], 'shapes' => [ 'AclConfiguration' => [ 'base' => '<p>Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. When Athena stores query results in Amazon S3, the canned ACL is set with the <code>x-amz-acl</code> request header. For more information about S3 Object Ownership, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html#object-ownership-overview\">Object Ownership settings</a> in the <i>Amazon S3 User Guide</i>.</p>', 'refs' => [ 'ResultConfiguration$AclConfiguration' => '<p>Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. Currently the only supported canned ACL is <code>BUCKET_OWNER_FULL_CONTROL</code>. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the ACL configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. For more information, see <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a> and <a href=\"https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html\">Workgroup Settings Override Client-Side Settings</a>.</p>', 'ResultConfigurationUpdates$AclConfiguration' => '<p>The ACL configuration for the query results.</p>', ], ], 'Age' => [ 'base' => NULL, 'refs' => [ 'ResultReuseByAgeConfiguration$MaxAgeInMinutes' => '<p>Specifies, in minutes, the maximum age of a previous query result that Athena should consider for reuse. The default is 60.</p>', ], ], 'AllocatedDpusInteger' => [ 'base' => NULL, 'refs' => [ 'CapacityReservation$AllocatedDpus' => '<p>The number of data processing units currently allocated.</p>', ], ], 'AmazonResourceName' => [ 'base' => NULL, 'refs' => [ 'ListTagsForResourceInput$ResourceARN' => '<p>Lists the tags for the resource with the specified ARN.</p>', 'ResourceNotFoundException$ResourceName' => '<p>The name of the Amazon resource.</p>', 'TagResourceInput$ResourceARN' => '<p>Specifies the ARN of the Athena resource to which tags are to be added.</p>', 'UntagResourceInput$ResourceARN' => '<p>Specifies the ARN of the resource from which tags are to be removed.</p>', ], ], 'ApplicationDPUSizes' => [ 'base' => '<p>Contains the application runtime IDs and their supported DPU sizes.</p>', 'refs' => [ 'ApplicationDPUSizesList$member' => NULL, ], ], 'ApplicationDPUSizesList' => [ 'base' => NULL, 'refs' => [ 'ListApplicationDPUSizesOutput$ApplicationDPUSizes' => '<p>A list of the supported DPU sizes that the application runtime supports.</p>', ], ], 'AthenaError' => [ 'base' => '<p>Provides information about an Athena query error. The <code>AthenaError</code> feature provides standardized error information to help you understand failed queries and take steps after a query failure occurs. <code>AthenaError</code> includes an <code>ErrorCategory</code> field that specifies whether the cause of the failed query is due to system error, user error, or other error.</p>', 'refs' => [ 'QueryExecutionStatus$AthenaError' => '<p>Provides information about an Athena query error.</p>', ], ], 'AuthToken' => [ 'base' => NULL, 'refs' => [ 'CreatePresignedNotebookUrlResponse$AuthToken' => '<p>The authentication token for the notebook.</p>', ], ], 'AwsAccountId' => [ 'base' => NULL, 'refs' => [ 'ResultConfiguration$ExpectedBucketOwner' => '<p>The Amazon Web Services account ID that you expect to be the owner of the Amazon S3 bucket specified by <a>ResultConfiguration$OutputLocation</a>. If set, Athena uses the value for <code>ExpectedBucketOwner</code> when it makes Amazon S3 calls to your specified output location. If the <code>ExpectedBucketOwner</code> Amazon Web Services account ID does not match the actual owner of the Amazon S3 bucket, the call fails with a permissions error.</p> <p>This is a client-side setting. If workgroup settings override client-side settings, then the query uses the <code>ExpectedBucketOwner</code> setting that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a> and <a href=\"https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html\">Workgroup Settings Override Client-Side Settings</a>.</p>', 'ResultConfigurationUpdates$ExpectedBucketOwner' => '<p>The Amazon Web Services account ID that you expect to be the owner of the Amazon S3 bucket specified by <a>ResultConfiguration$OutputLocation</a>. If set, Athena uses the value for <code>ExpectedBucketOwner</code> when it makes Amazon S3 calls to your specified output location. If the <code>ExpectedBucketOwner</code> Amazon Web Services account ID does not match the actual owner of the Amazon S3 bucket, the call fails with a permissions error.</p> <p>If workgroup settings override client-side settings, then the query uses the <code>ExpectedBucketOwner</code> setting that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a> and <a href=\"https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html\">Workgroup Settings Override Client-Side Settings</a>.</p>', ], ], 'BatchGetNamedQueryInput' => [ 'base' => '<p>Contains an array of named query IDs.</p>', 'refs' => [], ], 'BatchGetNamedQueryOutput' => [ 'base' => NULL, 'refs' => [], ], 'BatchGetPreparedStatementInput' => [ 'base' => NULL, 'refs' => [], ], 'BatchGetPreparedStatementOutput' => [ 'base' => NULL, 'refs' => [], ], 'BatchGetQueryExecutionInput' => [ 'base' => '<p>Contains an array of query execution IDs.</p>', 'refs' => [], ], 'BatchGetQueryExecutionOutput' => [ 'base' => NULL, 'refs' => [], ], 'Boolean' => [ 'base' => NULL, 'refs' => [ 'AthenaError$Retryable' => '<p>True if the query might succeed if resubmitted.</p>', 'ColumnInfo$CaseSensitive' => '<p>Indicates whether values in the column are case-sensitive.</p>', 'ResultReuseByAgeConfiguration$Enabled' => '<p>True if previous query results can be reused when the query is run; otherwise, false. The default is false.</p>', 'ResultReuseInformation$ReusedPreviousResult' => '<p>True if a previous query result was reused; false if the result was generated from a new run of the query.</p>', ], ], 'BoxedBoolean' => [ 'base' => NULL, 'refs' => [ 'DeleteWorkGroupInput$RecursiveDeleteOption' => '<p>The option to delete the workgroup and its contents even if the workgroup contains any named queries, query executions, or notebooks.</p>', 'ResultConfigurationUpdates$RemoveOutputLocation' => '<p>If set to \"true\", indicates that the previously-specified query results location (also known as a client-side setting) for queries in this workgroup should be ignored and set to null. If set to \"false\" or not set, and a value is present in the <code>OutputLocation</code> in <code>ResultConfigurationUpdates</code> (the client-side setting), the <code>OutputLocation</code> in the workgroup\\'s <code>ResultConfiguration</code> will be updated with the new value. For more information, see <a href=\"https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html\">Workgroup Settings Override Client-Side Settings</a>.</p>', 'ResultConfigurationUpdates$RemoveEncryptionConfiguration' => '<p>If set to \"true\", indicates that the previously-specified encryption configuration (also known as the client-side setting) for queries in this workgroup should be ignored and set to null. If set to \"false\" or not set, and a value is present in the <code>EncryptionConfiguration</code> in <code>ResultConfigurationUpdates</code> (the client-side setting), the <code>EncryptionConfiguration</code> in the workgroup\\'s <code>ResultConfiguration</code> will be updated with the new value. For more information, see <a href=\"https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html\">Workgroup Settings Override Client-Side Settings</a>.</p>', 'ResultConfigurationUpdates$RemoveExpectedBucketOwner' => '<p>If set to \"true\", removes the Amazon Web Services account ID previously specified for <a>ResultConfiguration$ExpectedBucketOwner</a>. If set to \"false\" or not set, and a value is present in the <code>ExpectedBucketOwner</code> in <code>ResultConfigurationUpdates</code> (the client-side setting), the <code>ExpectedBucketOwner</code> in the workgroup\\'s <code>ResultConfiguration</code> is updated with the new value. For more information, see <a href=\"https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html\">Workgroup Settings Override Client-Side Settings</a>.</p>', 'ResultConfigurationUpdates$RemoveAclConfiguration' => '<p>If set to <code>true</code>, indicates that the previously-specified ACL configuration for queries in this workgroup should be ignored and set to null. If set to <code>false</code> or not set, and a value is present in the <code>AclConfiguration</code> of <code>ResultConfigurationUpdates</code>, the <code>AclConfiguration</code> in the workgroup\\'s <code>ResultConfiguration</code> is updated with the new value. For more information, see <a href=\"https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html\">Workgroup Settings Override Client-Side Settings</a>.</p>', 'WorkGroupConfiguration$EnforceWorkGroupConfiguration' => '<p>If set to \"true\", the settings for the workgroup override client-side settings. If set to \"false\", client-side settings are used. For more information, see <a href=\"https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html\">Workgroup Settings Override Client-Side Settings</a>.</p>', 'WorkGroupConfiguration$PublishCloudWatchMetricsEnabled' => '<p>Indicates that the Amazon CloudWatch metrics are enabled for the workgroup.</p>', 'WorkGroupConfiguration$RequesterPaysEnabled' => '<p>If set to <code>true</code>, allows members assigned to a workgroup to reference Amazon S3 Requester Pays buckets in queries. If set to <code>false</code>, workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default is <code>false</code>. For more information about Requester Pays buckets, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html\">Requester Pays Buckets</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.</p>', 'WorkGroupConfiguration$EnableMinimumEncryptionConfiguration' => '<p>Enforces a minimal level of encryption for the workgroup for query and calculation results that are written to Amazon S3. When enabled, workgroup users can set encryption only to the minimum level set by the administrator or higher when they submit queries.</p> <p>The <code>EnforceWorkGroupConfiguration</code> setting takes precedence over the <code>EnableMinimumEncryptionConfiguration</code> flag. This means that if <code>EnforceWorkGroupConfiguration</code> is true, the <code>EnableMinimumEncryptionConfiguration</code> flag is ignored, and the workgroup configuration for encryption is used.</p>', 'WorkGroupConfigurationUpdates$EnforceWorkGroupConfiguration' => '<p>If set to \"true\", the settings for the workgroup override client-side settings. If set to \"false\" client-side settings are used. For more information, see <a href=\"https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html\">Workgroup Settings Override Client-Side Settings</a>.</p>', 'WorkGroupConfigurationUpdates$PublishCloudWatchMetricsEnabled' => '<p>Indicates whether this workgroup enables publishing metrics to Amazon CloudWatch.</p>', 'WorkGroupConfigurationUpdates$RemoveBytesScannedCutoffPerQuery' => '<p>Indicates that the data usage control limit per query is removed. <a>WorkGroupConfiguration$BytesScannedCutoffPerQuery</a> </p>', 'WorkGroupConfigurationUpdates$RequesterPaysEnabled' => '<p>If set to <code>true</code>, allows members assigned to a workgroup to specify Amazon S3 Requester Pays buckets in queries. If set to <code>false</code>, workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default is <code>false</code>. For more information about Requester Pays buckets, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html\">Requester Pays Buckets</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.</p>', 'WorkGroupConfigurationUpdates$RemoveCustomerContentEncryptionConfiguration' => '<p>Removes content encryption configuration from an Apache Spark-enabled Athena workgroup.</p>', 'WorkGroupConfigurationUpdates$EnableMinimumEncryptionConfiguration' => '<p>Enforces a minimal level of encryption for the workgroup for query and calculation results that are written to Amazon S3. When enabled, workgroup users can set encryption only to the minimum level set by the administrator or higher when they submit queries. This setting does not apply to Spark-enabled workgroups.</p> <p>The <code>EnforceWorkGroupConfiguration</code> setting takes precedence over the <code>EnableMinimumEncryptionConfiguration</code> flag. This means that if <code>EnforceWorkGroupConfiguration</code> is true, the <code>EnableMinimumEncryptionConfiguration</code> flag is ignored, and the workgroup configuration for encryption is used.</p>', ], ], 'BytesScannedCutoffValue' => [ 'base' => NULL, 'refs' => [ 'WorkGroupConfiguration$BytesScannedCutoffPerQuery' => '<p>The upper data usage limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan.</p>', 'WorkGroupConfigurationUpdates$BytesScannedCutoffPerQuery' => '<p>The upper limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan.</p>', ], ], 'CalculationConfiguration' => [ 'base' => '<p>Contains configuration information for the calculation.</p>', 'refs' => [ 'StartCalculationExecutionRequest$CalculationConfiguration' => '<p>Contains configuration information for the calculation.</p>', ], ], 'CalculationExecutionId' => [ 'base' => NULL, 'refs' => [ 'CalculationSummary$CalculationExecutionId' => '<p>The calculation execution UUID.</p>', 'GetCalculationExecutionCodeRequest$CalculationExecutionId' => '<p>The calculation execution UUID.</p>', 'GetCalculationExecutionRequest$CalculationExecutionId' => '<p>The calculation execution UUID.</p>', 'GetCalculationExecutionResponse$CalculationExecutionId' => '<p>The calculation execution UUID.</p>', 'GetCalculationExecutionStatusRequest$CalculationExecutionId' => '<p>The calculation execution UUID.</p>', 'StartCalculationExecutionResponse$CalculationExecutionId' => '<p>The calculation execution UUID.</p>', 'StopCalculationExecutionRequest$CalculationExecutionId' => '<p>The calculation execution UUID.</p>', ], ], 'CalculationExecutionState' => [ 'base' => NULL, 'refs' => [ 'CalculationStatus$State' => '<p>The state of the calculation execution. A description of each state follows.</p> <p> <code>CREATING</code> - The calculation is in the process of being created.</p> <p> <code>CREATED</code> - The calculation has been created and is ready to run.</p> <p> <code>QUEUED</code> - The calculation has been queued for processing.</p> <p> <code>RUNNING</code> - The calculation is running.</p> <p> <code>CANCELING</code> - A request to cancel the calculation has been received and the system is working to stop it.</p> <p> <code>CANCELED</code> - The calculation is no longer running as the result of a cancel request.</p> <p> <code>COMPLETED</code> - The calculation has completed without error.</p> <p> <code>FAILED</code> - The calculation failed and is no longer running.</p>', 'ListCalculationExecutionsRequest$StateFilter' => '<p>A filter for a specific calculation execution state. A description of each state follows.</p> <p> <code>CREATING</code> - The calculation is in the process of being created.</p> <p> <code>CREATED</code> - The calculation has been created and is ready to run.</p> <p> <code>QUEUED</code> - The calculation has been queued for processing.</p> <p> <code>RUNNING</code> - The calculation is running.</p> <p> <code>CANCELING</code> - A request to cancel the calculation has been received and the system is working to stop it.</p> <p> <code>CANCELED</code> - The calculation is no longer running as the result of a cancel request.</p> <p> <code>COMPLETED</code> - The calculation has completed without error.</p> <p> <code>FAILED</code> - The calculation failed and is no longer running.</p>', 'StartCalculationExecutionResponse$State' => '<p> <code>CREATING</code> - The calculation is in the process of being created.</p> <p> <code>CREATED</code> - The calculation has been created and is ready to run.</p> <p> <code>QUEUED</code> - The calculation has been queued for processing.</p> <p> <code>RUNNING</code> - The calculation is running.</p> <p> <code>CANCELING</code> - A request to cancel the calculation has been received and the system is working to stop it.</p> <p> <code>CANCELED</code> - The calculation is no longer running as the result of a cancel request.</p> <p> <code>COMPLETED</code> - The calculation has completed without error.</p> <p> <code>FAILED</code> - The calculation failed and is no longer running.</p>', 'StopCalculationExecutionResponse$State' => '<p> <code>CREATING</code> - The calculation is in the process of being created.</p> <p> <code>CREATED</code> - The calculation has been created and is ready to run.</p> <p> <code>QUEUED</code> - The calculation has been queued for processing.</p> <p> <code>RUNNING</code> - The calculation is running.</p> <p> <code>CANCELING</code> - A request to cancel the calculation has been received and the system is working to stop it.</p> <p> <code>CANCELED</code> - The calculation is no longer running as the result of a cancel request.</p> <p> <code>COMPLETED</code> - The calculation has completed without error.</p> <p> <code>FAILED</code> - The calculation failed and is no longer running.</p>', ], ], 'CalculationResult' => [ 'base' => '<p>Contains information about an application-specific calculation result.</p>', 'refs' => [ 'GetCalculationExecutionResponse$Result' => '<p>Contains result information. This field is populated only if the calculation is completed.</p>', ], ], 'CalculationResultType' => [ 'base' => NULL, 'refs' => [ 'CalculationResult$ResultType' => '<p>The data format of the calculation result.</p>', ], ], 'CalculationStatistics' => [ 'base' => '<p>Contains statistics for a notebook calculation.</p>', 'refs' => [ 'GetCalculationExecutionResponse$Statistics' => '<p>Contains information about the data processing unit (DPU) execution time and progress. This field is populated only when statistics are available.</p>', 'GetCalculationExecutionStatusResponse$Statistics' => '<p>Contains information about the DPU execution time and progress.</p>', ], ], 'CalculationStatus' => [ 'base' => '<p>Contains information about the status of a notebook calculation.</p>', 'refs' => [ 'CalculationSummary$Status' => '<p>Contains information about the status of the calculation.</p>', 'GetCalculationExecutionResponse$Status' => '<p>Contains information about the status of the calculation.</p>', 'GetCalculationExecutionStatusResponse$Status' => '<p>Contains information about the calculation execution status.</p>', ], ], 'CalculationSummary' => [ 'base' => '<p>Summary information for a notebook calculation.</p>', 'refs' => [ 'CalculationsList$member' => NULL, ], ], 'CalculationsList' => [ 'base' => NULL, 'refs' => [ 'ListCalculationExecutionsResponse$Calculations' => '<p>A list of <a>CalculationSummary</a> objects.</p>', ], ], 'CancelCapacityReservationInput' => [ 'base' => NULL, 'refs' => [], ], 'CancelCapacityReservationOutput' => [ 'base' => NULL, 'refs' => [], ], 'CapacityAllocation' => [ 'base' => '<p>Contains the submission time of a single allocation request for a capacity reservation and the most recent status of the attempted allocation.</p>', 'refs' => [ 'CapacityReservation$LastAllocation' => NULL, ], ], 'CapacityAllocationStatus' => [ 'base' => NULL, 'refs' => [ 'CapacityAllocation$Status' => '<p>The status of the capacity allocation.</p>', ], ], 'CapacityAssignment' => [ 'base' => '<p>A mapping between one or more workgroups and a capacity reservation.</p>', 'refs' => [ 'CapacityAssignmentsList$member' => NULL, ], ], 'CapacityAssignmentConfiguration' => [ 'base' => '<p>Assigns Athena workgroups (and hence their queries) to capacity reservations. A capacity reservation can have only one capacity assignment configuration, but the capacity assignment configuration can be made up of multiple individual assignments. Each assignment specifies how Athena queries can consume capacity from the capacity reservation that their workgroup is mapped to.</p>', 'refs' => [ 'GetCapacityAssignmentConfigurationOutput$CapacityAssignmentConfiguration' => '<p>The requested capacity assignment configuration for the specified capacity reservation.</p>', ], ], 'CapacityAssignmentsList' => [ 'base' => NULL, 'refs' => [ 'CapacityAssignmentConfiguration$CapacityAssignments' => '<p>The list of assignments that make up the capacity assignment configuration.</p>', 'PutCapacityAssignmentConfigurationInput$CapacityAssignments' => '<p>The list of assignments for the capacity assignment configuration.</p>', ], ], 'CapacityReservation' => [ 'base' => '<p>A reservation for a specified number of data processing units (DPUs). When a reservation is initially created, it has no DPUs. Athena allocates DPUs until the allocated amount equals the requested amount.</p>', 'refs' => [ 'CapacityReservationsList$member' => NULL, 'GetCapacityReservationOutput$CapacityReservation' => '<p>The requested capacity reservation structure.</p>', ], ], 'CapacityReservationName' => [ 'base' => NULL, 'refs' => [ 'CancelCapacityReservationInput$Name' => '<p>The name of the capacity reservation to cancel.</p>', 'CapacityAssignmentConfiguration$CapacityReservationName' => '<p>The name of the reservation that the capacity assignment configuration is for.</p>', 'CapacityReservation$Name' => '<p>The name of the capacity reservation.</p>', 'CreateCapacityReservationInput$Name' => '<p>The name of the capacity reservation to create.</p>', 'DeleteCapacityReservationInput$Name' => '<p>The name of the capacity reservation to delete.</p>', 'GetCapacityAssignmentConfigurationInput$CapacityReservationName' => '<p>The name of the capacity reservation to retrieve the capacity assignment configuration for.</p>', 'GetCapacityReservationInput$Name' => '<p>The name of the capacity reservation.</p>', 'PutCapacityAssignmentConfigurationInput$CapacityReservationName' => '<p>The name of the capacity reservation to put a capacity assignment configuration for.</p>', 'UpdateCapacityReservationInput$Name' => '<p>The name of the capacity reservation.</p>', ], ], 'CapacityReservationStatus' => [ 'base' => NULL, 'refs' => [ 'CapacityReservation$Status' => '<p>The status of the capacity reservation.</p>', ], ], 'CapacityReservationsList' => [ 'base' => NULL, 'refs' => [ 'ListCapacityReservationsOutput$CapacityReservations' => '<p>The capacity reservations for the current account.</p>', ], ], 'CatalogNameString' => [ 'base' => NULL, 'refs' => [ 'CreateDataCatalogInput$Name' => '<p>The name of the data catalog to create. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.</p>', 'DataCatalog$Name' => '<p>The name of the data catalog. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.</p>', 'DataCatalogSummary$CatalogName' => '<p>The name of the data catalog. The catalog name is unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.</p>', 'DeleteDataCatalogInput$Name' => '<p>The name of the data catalog to delete.</p>', 'GetDataCatalogInput$Name' => '<p>The name of the data catalog to return.</p>', 'GetDatabaseInput$CatalogName' => '<p>The name of the data catalog that contains the database to return.</p>', 'GetTableMetadataInput$CatalogName' => '<p>The name of the data catalog that contains the database and table metadata to return.</p>', 'ListDatabasesInput$CatalogName' => '<p>The name of the data catalog that contains the databases to return.</p>', 'ListTableMetadataInput$CatalogName' => '<p>The name of the data catalog for which table metadata should be returned.</p>', 'QueryExecutionContext$Catalog' => '<p>The name of the data catalog used in the query execution.</p>', 'UpdateDataCatalogInput$Name' => '<p>The name of the data catalog to update. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.</p>', ], ], 'ClientRequestToken' => [ 'base' => NULL, 'refs' => [ 'CreateNotebookInput$ClientRequestToken' => '<p>A unique case-sensitive string used to ensure the request to create the notebook is idempotent (executes only once).</p> <important> <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for you. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p> </important>', 'ImportNotebookInput$ClientRequestToken' => '<p>A unique case-sensitive string used to ensure the request to import the notebook is idempotent (executes only once).</p> <important> <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for you. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p> </important>', 'UpdateNotebookInput$ClientRequestToken' => '<p>A unique case-sensitive string used to ensure the request to create the notebook is idempotent (executes only once).</p> <important> <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for you. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p> </important>', 'UpdateNotebookMetadataInput$ClientRequestToken' => '<p>A unique case-sensitive string used to ensure the request to create the notebook is idempotent (executes only once).</p> <important> <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for you. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p> </important>', ], ], 'CodeBlock' => [ 'base' => NULL, 'refs' => [ 'CalculationConfiguration$CodeBlock' => '<p>A string that contains the code for the calculation.</p>', 'GetCalculationExecutionCodeResponse$CodeBlock' => '<p>The unencrypted code that was executed for the calculation.</p>', 'StartCalculationExecutionRequest$CodeBlock' => '<p>A string that contains the code of the calculation.</p>', ], ], 'Column' => [ 'base' => '<p>Contains metadata for a column in a table.</p>', 'refs' => [ 'ColumnList$member' => NULL, ], ], 'ColumnInfo' => [ 'base' => '<p>Information about the columns in a query execution result.</p>', 'refs' => [ 'ColumnInfoList$member' => NULL, ], ], 'ColumnInfoList' => [ 'base' => NULL, 'refs' => [ 'ResultSetMetadata$ColumnInfo' => '<p>Information about the columns returned in a query result metadata.</p>', ], ], 'ColumnList' => [ 'base' => NULL, 'refs' => [ 'TableMetadata$Columns' => '<p>A list of the columns in the table.</p>', 'TableMetadata$PartitionKeys' => '<p>A list of the partition keys in the table.</p>', ], ], 'ColumnNullable' => [ 'base' => NULL, 'refs' => [ 'ColumnInfo$Nullable' => '<p>Indicates the column\\'s nullable status.</p>', ], ], 'CommentString' => [ 'base' => NULL, 'refs' => [ 'Column$Comment' => '<p>Optional information about the column.</p>', ], ], 'CoordinatorDpuSize' => [ 'base' => NULL, 'refs' => [ 'EngineConfiguration$CoordinatorDpuSize' => '<p>The number of DPUs to use for the coordinator. A coordinator is a special executor that orchestrates processing work and manages other executors in a notebook session. The default is 1.</p>', ], ], 'CreateCapacityReservationInput' => [ 'base' => NULL, 'refs' => [], ], 'CreateCapacityReservationOutput' => [ 'base' => NULL, 'refs' => [], ], 'CreateDataCatalogInput' => [ 'base' => NULL, 'refs' => [], ], 'CreateDataCatalogOutput' => [ 'base' => NULL, 'refs' => [], ], 'CreateNamedQueryInput' => [ 'base' => NULL, 'refs' => [], ], 'CreateNamedQueryOutput' => [ 'base' => NULL, 'refs' => [], ], 'CreateNotebookInput' => [ 'base' => NULL, 'refs' => [], ], 'CreateNotebookOutput' => [ 'base' => NULL, 'refs' => [], ], 'CreatePreparedStatementInput' => [ 'base' => NULL, 'refs' => [], ], 'CreatePreparedStatementOutput' => [ 'base' => NULL, 'refs' => [], ], 'CreatePresignedNotebookUrlRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreatePresignedNotebookUrlResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateWorkGroupInput' => [ 'base' => NULL, 'refs' => [], ], 'CreateWorkGroupOutput' => [ 'base' => NULL, 'refs' => [], ], 'CustomerContentEncryptionConfiguration' => [ 'base' => '<p>Specifies the KMS key that is used to encrypt the user\\'s data stores in Athena. This setting does not apply to Athena SQL workgroups.</p>', 'refs' => [ 'WorkGroupConfiguration$CustomerContentEncryptionConfiguration' => '<p>Specifies the KMS key that is used to encrypt the user\\'s data stores in Athena. This setting does not apply to Athena SQL workgroups.</p>', 'WorkGroupConfigurationUpdates$CustomerContentEncryptionConfiguration' => NULL, ], ], 'DataCatalog' => [ 'base' => '<p>Contains information about a data catalog in an Amazon Web Services account.</p> <note> <p>In the Athena console, data catalogs are listed as \"data sources\" on the <b>Data sources</b> page under the <b>Data source name</b> column.</p> </note>', 'refs' => [ 'GetDataCatalogOutput$DataCatalog' => '<p>The data catalog returned.</p>', ], ], 'DataCatalogSummary' => [ 'base' => '<p>The summary information for the data catalog, which includes its name and type.</p>', 'refs' => [ 'DataCatalogSummaryList$member' => NULL, ], ], 'DataCatalogSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListDataCatalogsOutput$DataCatalogsSummary' => '<p>A summary list of data catalogs.</p>', ], ], 'DataCatalogType' => [ 'base' => NULL, 'refs' => [ 'CreateDataCatalogInput$Type' => '<p>The type of data catalog to create: <code>LAMBDA</code> for a federated catalog, <code>HIVE</code> for an external hive metastore, or <code>GLUE</code> for an Glue Data Catalog.</p>', 'DataCatalog$Type' => '<p>The type of data catalog to create: <code>LAMBDA</code> for a federated catalog, <code>HIVE</code> for an external hive metastore, or <code>GLUE</code> for an Glue Data Catalog.</p>', 'DataCatalogSummary$Type' => '<p>The data catalog type.</p>', 'UpdateDataCatalogInput$Type' => '<p>Specifies the type of data catalog to update. Specify <code>LAMBDA</code> for a federated catalog, <code>HIVE</code> for an external hive metastore, or <code>GLUE</code> for an Glue Data Catalog.</p>', ], ], 'Database' => [ 'base' => '<p>Contains metadata information for a database in a data catalog.</p>', 'refs' => [ 'DatabaseList$member' => NULL, 'GetDatabaseOutput$Database' => '<p>The database returned.</p>', ], ], 'DatabaseList' => [ 'base' => NULL, 'refs' => [ 'ListDatabasesOutput$DatabaseList' => '<p>A list of databases from a data catalog.</p>', ], ], 'DatabaseString' => [ 'base' => NULL, 'refs' => [ 'CreateNamedQueryInput$Database' => '<p>The database to which the query belongs.</p>', 'NamedQuery$Database' => '<p>The database to which the query belongs.</p>', 'QueryExecutionContext$Database' => '<p>The name of the database used in the query execution. The database must exist in the catalog.</p>', ], ], 'Date' => [ 'base' => NULL, 'refs' => [ 'CalculationStatus$SubmissionDateTime' => '<p>The date and time the calculation was submitted for processing.</p>', 'CalculationStatus$CompletionDateTime' => '<p>The date and time the calculation completed processing.</p>', 'NotebookMetadata$CreationTime' => '<p>The time when the notebook was created.</p>', 'NotebookMetadata$LastModifiedTime' => '<p>The time when the notebook was last modified.</p>', 'NotebookSessionSummary$CreationTime' => '<p>The time when the notebook session was created.</p>', 'PreparedStatement$LastModifiedTime' => '<p>The last modified time of the prepared statement.</p>', 'PreparedStatementSummary$LastModifiedTime' => '<p>The last modified time of the prepared statement.</p>', 'QueryExecutionStatus$SubmissionDateTime' => '<p>The date and time that the query was submitted.</p>', 'QueryExecutionStatus$CompletionDateTime' => '<p>The date and time that the query completed.</p>', 'SessionStatus$StartDateTime' => '<p>The date and time that the session started.</p>', 'SessionStatus$LastModifiedDateTime' => '<p>The most recent date and time that the session was modified.</p>', 'SessionStatus$EndDateTime' => '<p>The date and time that the session ended.</p>', 'SessionStatus$IdleSinceDateTime' => '<p>The date and time starting at which the session became idle. Can be empty if the session is not currently idle.</p>', 'WorkGroup$CreationTime' => '<p>The date and time the workgroup was created.</p>', 'WorkGroupSummary$CreationTime' => '<p>The workgroup creation date and time.</p>', ], ], 'Datum' => [ 'base' => '<p>A piece of data (a field in the table).</p>', 'refs' => [ 'datumList$member' => NULL, ], ], 'DefaultExecutorDpuSize' => [ 'base' => NULL, 'refs' => [ 'EngineConfiguration$DefaultExecutorDpuSize' => '<p>The default number of DPUs to use for executors. An executor is the smallest unit of compute that a notebook session can request from Athena. The default is 1.</p>', ], ], 'DeleteCapacityReservationInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteCapacityReservationOutput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteDataCatalogInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteDataCatalogOutput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteNamedQueryInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteNamedQueryOutput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteNotebookInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteNotebookOutput' => [ 'base' => NULL, 'refs' => [], ], 'DeletePreparedStatementInput' => [ 'base' => NULL, 'refs' => [], ], 'DeletePreparedStatementOutput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteWorkGroupInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteWorkGroupOutput' => [ 'base' => NULL, 'refs' => [], ], 'DescriptionString' => [ 'base' => NULL, 'refs' => [ 'CalculationStatistics$Progress' => '<p>The progress of the calculation.</p>', 'CalculationStatus$StateChangeReason' => '<p>The reason for the calculation state change (for example, the calculation was canceled because the session was terminated).</p>', 'CalculationSummary$Description' => '<p>A description of the calculation.</p>', 'CreateDataCatalogInput$Description' => '<p>A description of the data catalog to be created.</p>', 'CreateNamedQueryInput$Description' => '<p>The query description.</p>', 'CreatePreparedStatementInput$Description' => '<p>The description of the prepared statement.</p>', 'DataCatalog$Description' => '<p>An optional description of the data catalog.</p>', 'Database$Description' => '<p>An optional description of the database.</p>', 'GetCalculationExecutionResponse$Description' => '<p>The description of the calculation execution.</p>', 'GetSessionResponse$Description' => '<p>The session description.</p>', 'NamedQuery$Description' => '<p>The query description.</p>', 'PreparedStatement$Description' => '<p>The description of the prepared statement.</p>', 'SessionStatus$StateChangeReason' => '<p>The reason for the session state change (for example, canceled because the session was terminated).</p>', 'SessionSummary$Description' => '<p>The session description.</p>', 'StartCalculationExecutionRequest$Description' => '<p>A description of the calculation.</p>', 'StartSessionRequest$Description' => '<p>The session description.</p>', 'UpdateDataCatalogInput$Description' => '<p>New or modified text that describes the data catalog.</p>', 'UpdatePreparedStatementInput$Description' => '<p>The description of the prepared statement.</p>', ], ], 'EncryptionConfiguration' => [ 'base' => '<p>If query and calculation results are encrypted in Amazon S3, indicates the encryption option used (for example, <code>SSE_KMS</code> or <code>CSE_KMS</code>) and key information.</p>', 'refs' => [ 'ResultConfiguration$EncryptionConfiguration' => '<p>If query and calculation results are encrypted in Amazon S3, indicates the encryption option used (for example, <code>SSE_KMS</code> or <code>CSE_KMS</code>) and key information. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the encryption configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a> and <a href=\"https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html\">Workgroup Settings Override Client-Side Settings</a>.</p>', 'ResultConfigurationUpdates$EncryptionConfiguration' => '<p>The encryption configuration for query and calculation results.</p>', 'SessionConfiguration$EncryptionConfiguration' => NULL, ], ], 'EncryptionOption' => [ 'base' => NULL, 'refs' => [ 'EncryptionConfiguration$EncryptionOption' => '<p>Indicates whether Amazon S3 server-side encryption with Amazon S3-managed keys (<code>SSE_S3</code>), server-side encryption with KMS-managed keys (<code>SSE_KMS</code>), or client-side encryption with KMS-managed keys (<code>CSE_KMS</code>) is used.</p> <p>If a query runs in a workgroup and the workgroup overrides client-side settings, then the workgroup\\'s setting for encryption is used. It specifies whether query results must be encrypted, for all queries that run in this workgroup. </p>', ], ], 'EngineConfiguration' => [ 'base' => '<p>Contains data processing unit (DPU) configuration settings and parameter mappings for a notebook engine.</p>', 'refs' => [ 'GetSessionResponse$EngineConfiguration' => '<p>Contains engine configuration information like DPU usage.</p>', 'StartSessionRequest$EngineConfiguration' => '<p>Contains engine data processing unit (DPU) configuration settings and parameter mappings.</p>', ], ], 'EngineVersion' => [ 'base' => '<p>The Athena engine version for running queries, or the PySpark engine version for running sessions.</p>', 'refs' => [ 'EngineVersionsList$member' => NULL, 'QueryExecution$EngineVersion' => '<p>The engine version that executed the query.</p>', 'SessionSummary$EngineVersion' => '<p>The engine version used by the session (for example, <code>PySpark engine version 3</code>).</p>', 'WorkGroupConfiguration$EngineVersion' => '<p>The engine version that all queries running on the workgroup use. Queries on the <code>AmazonAthenaPreviewFunctionality</code> workgroup run on the preview engine regardless of this setting.</p>', 'WorkGroupConfigurationUpdates$EngineVersion' => '<p>The engine version requested when a workgroup is updated. After the update, all queries on the workgroup run on the requested engine version. If no value was previously set, the default is Auto. Queries on the <code>AmazonAthenaPreviewFunctionality</code> workgroup run on the preview engine regardless of this setting.</p>', 'WorkGroupSummary$EngineVersion' => '<p>The engine version setting for all queries on the workgroup. Queries on the <code>AmazonAthenaPreviewFunctionality</code> workgroup run on the preview engine regardless of this setting.</p>', ], ], 'EngineVersionsList' => [ 'base' => NULL, 'refs' => [ 'ListEngineVersionsOutput$EngineVersions' => '<p>A list of engine versions that are available to choose from.</p>', ], ], 'ErrorCategory' => [ 'base' => NULL, 'refs' => [ 'AthenaError$ErrorCategory' => '<p>An integer value that specifies the category of a query failure error. The following list shows the category for each integer value.</p> <p> <b>1</b> - System</p> <p> <b>2</b> - User</p> <p> <b>3</b> - Other</p>', ], ], 'ErrorCode' => [ 'base' => '<p>The error code returned when the query execution failed to process, or when the processing request for the named query failed.</p>', 'refs' => [ 'InvalidRequestException$AthenaErrorCode' => NULL, 'UnprocessedNamedQueryId$ErrorCode' => '<p>The error code returned when the processing request for the named query failed, if applicable.</p>', 'UnprocessedPreparedStatementName$ErrorCode' => '<p>The error code returned when the request for the prepared statement failed.</p>', 'UnprocessedQueryExecutionId$ErrorCode' => '<p>The error code returned when the query execution failed to process, if applicable.</p>', ], ], 'ErrorMessage' => [ 'base' => NULL, 'refs' => [ 'InternalServerException$Message' => NULL, 'InvalidRequestException$Message' => NULL, 'MetadataException$Message' => NULL, 'ResourceNotFoundException$Message' => NULL, 'SessionAlreadyExistsException$Message' => NULL, 'TooManyRequestsException$Message' => NULL, 'UnprocessedNamedQueryId$ErrorMessage' => '<p>The error message returned when the processing request for the named query failed, if applicable.</p>', 'UnprocessedPreparedStatementName$ErrorMessage' => '<p>The error message containing the reason why the prepared statement could not be returned. The following error messages are possible:</p> <ul> <li> <p> <code>INVALID_INPUT</code> - The name of the prepared statement that was provided is not valid (for example, the name is too long).</p> </li> <li> <p> <code>STATEMENT_NOT_FOUND</code> - A prepared statement with the name provided could not be found.</p> </li> <li> <p> <code>UNAUTHORIZED</code> - The requester does not have permission to access the workgroup that contains the prepared statement.</p> </li> </ul>', 'UnprocessedQueryExecutionId$ErrorMessage' => '<p>The error message returned when the query execution failed to process, if applicable.</p>', ], ], 'ErrorType' => [ 'base' => NULL, 'refs' => [ 'AthenaError$ErrorType' => '<p>An integer value that provides specific information about an Athena query error. For the meaning of specific values, see the <a href=\"https://docs.aws.amazon.com/athena/latest/ug/error-reference.html#error-reference-error-type-reference\">Error Type Reference</a> in the <i>Amazon Athena User Guide</i>.</p>', ], ], 'ExecutionParameter' => [ 'base' => NULL, 'refs' => [ 'ExecutionParameters$member' => NULL, ], ], 'ExecutionParameters' => [ 'base' => NULL, 'refs' => [ 'QueryExecution$ExecutionParameters' => '<p>A list of values for the parameters in a query. The values are applied sequentially to the parameters in the query in the order in which the parameters occur. The list of parameters is not returned in the response.</p>', 'StartQueryExecutionInput$ExecutionParameters' => '<p>A list of values for the parameters in a query. The values are applied sequentially to the parameters in the query in the order in which the parameters occur.</p>', ], ], 'ExecutorId' => [ 'base' => NULL, 'refs' => [ 'ExecutorsSummary$ExecutorId' => '<p>The UUID of the executor.</p>', ], ], 'ExecutorState' => [ 'base' => NULL, 'refs' => [ 'ExecutorsSummary$ExecutorState' => '<p>The processing state of the executor. A description of each state follows.</p> <p> <code>CREATING</code> - The executor is being started, including acquiring resources.</p> <p> <code>CREATED</code> - The executor has been started.</p> <p> <code>REGISTERED</code> - The executor has been registered.</p> <p> <code>TERMINATING</code> - The executor is in the process of shutting down.</p> <p> <code>TERMINATED</code> - The executor is no longer running.</p> <p> <code>FAILED</code> - Due to a failure, the executor is no longer running.</p>', 'ListExecutorsRequest$ExecutorStateFilter' => '<p>A filter for a specific executor state. A description of each state follows.</p> <p> <code>CREATING</code> - The executor is being started, including acquiring resources.</p> <p> <code>CREATED</code> - The executor has been started.</p> <p> <code>REGISTERED</code> - The executor has been registered.</p> <p> <code>TERMINATING</code> - The executor is in the process of shutting down.</p> <p> <code>TERMINATED</code> - The executor is no longer running.</p> <p> <code>FAILED</code> - Due to a failure, the executor is no longer running.</p>', ], ], 'ExecutorType' => [ 'base' => NULL, 'refs' => [ 'ExecutorsSummary$ExecutorType' => '<p>The type of executor used for the application (<code>COORDINATOR</code>, <code>GATEWAY</code>, or <code>WORKER</code>).</p>', ], ], 'ExecutorsSummary' => [ 'base' => '<p>Contains summary information about an executor.</p>', 'refs' => [ 'ExecutorsSummaryList$member' => NULL, ], ], 'ExecutorsSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListExecutorsResponse$ExecutorsSummary' => '<p>Contains summary information about the executor.</p>', ], ], 'ExportNotebookInput' => [ 'base' => NULL, 'refs' => [], ], 'ExportNotebookOutput' => [ 'base' => NULL, 'refs' => [], ], 'ExpressionString' => [ 'base' => NULL, 'refs' => [ 'ListTableMetadataInput$Expression' => '<p>A regex filter that pattern-matches table names. If no expression is supplied, metadata for all tables are listed.</p>', ], ], 'FilterDefinition' => [ 'base' => '<p>A string for searching notebook names.</p>', 'refs' => [ 'ListNotebookMetadataInput$Filters' => '<p>Search filter string.</p>', ], ], 'GetCalculationExecutionCodeRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetCalculationExecutionCodeResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetCalculationExecutionRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetCalculationExecutionResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetCalculationExecutionStatusRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetCalculationExecutionStatusResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetCapacityAssignmentConfigurationInput' => [ 'base' => NULL, 'refs' => [], ], 'GetCapacityAssignmentConfigurationOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetCapacityReservationInput' => [ 'base' => NULL, 'refs' => [], ], 'GetCapacityReservationOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetDataCatalogInput' => [ 'base' => NULL, 'refs' => [], ], 'GetDataCatalogOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetDatabaseInput' => [ 'base' => NULL, 'refs' => [], ], 'GetDatabaseOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetNamedQueryInput' => [ 'base' => NULL, 'refs' => [], ], 'GetNamedQueryOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetNotebookMetadataInput' => [ 'base' => NULL, 'refs' => [], ], 'GetNotebookMetadataOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetPreparedStatementInput' => [ 'base' => NULL, 'refs' => [], ], 'GetPreparedStatementOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetQueryExecutionInput' => [ 'base' => NULL, 'refs' => [], ], 'GetQueryExecutionOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetQueryResultsInput' => [ 'base' => NULL, 'refs' => [], ], 'GetQueryResultsOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetQueryRuntimeStatisticsInput' => [ 'base' => NULL, 'refs' => [], ], 'GetQueryRuntimeStatisticsOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetSessionRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetSessionResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetSessionStatusRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetSessionStatusResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetTableMetadataInput' => [ 'base' => NULL, 'refs' => [], ], 'GetTableMetadataOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetWorkGroupInput' => [ 'base' => NULL, 'refs' => [], ], 'GetWorkGroupOutput' => [ 'base' => NULL, 'refs' => [], ], 'IdempotencyToken' => [ 'base' => NULL, 'refs' => [ 'CreateNamedQueryInput$ClientRequestToken' => '<p>A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another <code>CreateNamedQuery</code> request is received, the same response is returned and another query is not created. If a parameter has changed, for example, the <code>QueryString</code>, an error is returned.</p> <important> <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p> </important>', 'StartCalculationExecutionRequest$ClientRequestToken' => '<p>A unique case-sensitive string used to ensure the request to create the calculation is idempotent (executes only once). If another <code>StartCalculationExecutionRequest</code> is received, the same response is returned and another calculation is not created. If a parameter has changed, an error is returned.</p> <important> <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p> </important>', 'StartQueryExecutionInput$ClientRequestToken' => '<p>A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another <code>StartQueryExecution</code> request is received, the same response is returned and another query is not created. If a parameter has changed, for example, the <code>QueryString</code>, an error is returned.</p> <important> <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p> </important>', 'StartSessionRequest$ClientRequestToken' => '<p>A unique case-sensitive string used to ensure the request to create the session is idempotent (executes only once). If another <code>StartSessionRequest</code> is received, the same response is returned and another session is not created. If a parameter has changed, an error is returned.</p> <important> <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p> </important>', ], ], 'ImportNotebookInput' => [ 'base' => NULL, 'refs' => [], ], 'ImportNotebookOutput' => [ 'base' => NULL, 'refs' => [], ], 'Integer' => [ 'base' => NULL, 'refs' => [ 'ColumnInfo$Precision' => '<p>For <code>DECIMAL</code> data types, specifies the total number of digits, up to 38. For performance reasons, we recommend up to 18 digits.</p>', 'ColumnInfo$Scale' => '<p>For <code>DECIMAL</code> data types, specifies the total number of digits in the fractional part of the value. Defaults to 0.</p>', 'SupportedDPUSizeList$member' => NULL, ], ], 'InternalServerException' => [ 'base' => '<p>Indicates a platform issue, which may be due to a transient condition or outage.</p>', 'refs' => [], ], 'InvalidRequestException' => [ 'base' => '<p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>', 'refs' => [], ], 'KeyString' => [ 'base' => NULL, 'refs' => [ 'ParametersMap$key' => NULL, ], ], 'KmsKey' => [ 'base' => NULL, 'refs' => [ 'CustomerContentEncryptionConfiguration$KmsKey' => '<p>The KMS key that is used to encrypt the user\\'s data stores in Athena.</p>', ], ], 'ListApplicationDPUSizesInput' => [ 'base' => NULL, 'refs' => [], ], 'ListApplicationDPUSizesOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListCalculationExecutionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListCalculationExecutionsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListCapacityReservationsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListCapacityReservationsOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListDataCatalogsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListDataCatalogsOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListDatabasesInput' => [ 'base' => NULL, 'refs' => [], ], 'ListDatabasesOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListEngineVersionsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListEngineVersionsOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListExecutorsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListExecutorsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListNamedQueriesInput' => [ 'base' => NULL, 'refs' => [], ], 'ListNamedQueriesOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListNotebookMetadataInput' => [ 'base' => NULL, 'refs' => [], ], 'ListNotebookMetadataOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListNotebookSessionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListNotebookSessionsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListPreparedStatementsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListPreparedStatementsOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListQueryExecutionsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListQueryExecutionsOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListSessionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListSessionsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTableMetadataInput' => [ 'base' => NULL, 'refs' => [], ], 'ListTableMetadataOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceInput' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListWorkGroupsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListWorkGroupsOutput' => [ 'base' => NULL, 'refs' => [], ], 'Long' => [ 'base' => NULL, 'refs' => [ 'CalculationStatistics$DpuExecutionInMillis' => '<p>The data processing unit execution time in milliseconds for the calculation.</p>', 'CreatePresignedNotebookUrlResponse$AuthTokenExpirationTime' => '<p>The UTC epoch time when the authentication token expires.</p>', 'ExecutorsSummary$StartDateTime' => '<p>The date and time that the executor started.</p>', 'ExecutorsSummary$TerminationDateTime' => '<p>The date and time that the executor was terminated.</p>', 'ExecutorsSummary$ExecutorSize' => '<p>The smallest unit of compute that a session can request from Athena. Size is measured in data processing unit (DPU) values, a relative measure of processing power.</p>', 'GetQueryResultsOutput$UpdateCount' => '<p>The number of rows inserted with a <code>CREATE TABLE AS SELECT</code> statement. </p>', 'QueryExecutionStatistics$EngineExecutionTimeInMillis' => '<p>The number of milliseconds that the query took to execute.</p>', 'QueryExecutionStatistics$DataScannedInBytes' => '<p>The number of bytes in the data that was queried.</p>', 'QueryExecutionStatistics$TotalExecutionTimeInMillis' => '<p>The number of milliseconds that Athena took to run the query.</p>', 'QueryExecutionStatistics$QueryQueueTimeInMillis' => '<p>The number of milliseconds that the query was in your query queue waiting for resources. Note that if transient errors occur, Athena might automatically add the query back to the queue.</p>', 'QueryExecutionStatistics$QueryPlanningTimeInMillis' => '<p>The number of milliseconds that Athena took to plan the query processing flow. This includes the time spent retrieving table partitions from the data source. Note that because the query engine performs the query planning, query planning time is a subset of engine processing time.</p>', 'QueryExecutionStatistics$ServiceProcessingTimeInMillis' => '<p>The number of milliseconds that Athena took to finalize and publish the query results after the query engine finished running the query.</p>', 'QueryRuntimeStatisticsRows$InputRows' => '<p>The number of rows read to execute the query.</p>', 'QueryRuntimeStatisticsRows$InputBytes' => '<p>The number of bytes read to execute the query.</p>', 'QueryRuntimeStatisticsRows$OutputBytes' => '<p>The number of bytes returned by the query.</p>', 'QueryRuntimeStatisticsRows$OutputRows' => '<p>The number of rows returned by the query.</p>', 'QueryRuntimeStatisticsTimeline$QueryQueueTimeInMillis' => '<p>The number of milliseconds that the query was in your query queue waiting for resources. Note that if transient errors occur, Athena might automatically add the query back to the queue.</p>', 'QueryRuntimeStatisticsTimeline$QueryPlanningTimeInMillis' => '<p>The number of milliseconds that Athena took to plan the query processing flow. This includes the time spent retrieving table partitions from the data source. Note that because the query engine performs the query planning, query planning time is a subset of engine processing time.</p>', 'QueryRuntimeStatisticsTimeline$EngineExecutionTimeInMillis' => '<p>The number of milliseconds that the query took to execute.</p>', 'QueryRuntimeStatisticsTimeline$ServiceProcessingTimeInMillis' => '<p>The number of milliseconds that Athena took to finalize and publish the query results after the query engine finished running the query.</p>', 'QueryRuntimeStatisticsTimeline$TotalExecutionTimeInMillis' => '<p>The number of milliseconds that Athena took to run the query.</p>', 'QueryStage$StageId' => '<p>The identifier for a stage.</p>', 'QueryStage$OutputBytes' => '<p>The number of bytes output from the stage after execution.</p>', 'QueryStage$OutputRows' => '<p>The number of rows output from the stage after execution.</p>', 'QueryStage$InputBytes' => '<p>The number of bytes input into the stage for execution.</p>', 'QueryStage$InputRows' => '<p>The number of rows input into the stage for execution.</p>', 'QueryStage$ExecutionTime' => '<p>Time taken to execute this stage.</p>', 'SessionConfiguration$IdleTimeoutSeconds' => '<p>The idle timeout in seconds for the session.</p>', 'SessionStatistics$DpuExecutionInMillis' => '<p>The data processing unit execution time for a session in milliseconds.</p>', ], ], 'MaxApplicationDPUSizesCount' => [ 'base' => NULL, 'refs' => [ 'ListApplicationDPUSizesInput$MaxResults' => '<p>Specifies the maximum number of results to return.</p>', ], ], 'MaxCalculationsCount' => [ 'base' => NULL, 'refs' => [ 'ListCalculationExecutionsRequest$MaxResults' => '<p>The maximum number of calculation executions to return.</p>', ], ], 'MaxCapacityReservationsCount' => [ 'base' => NULL, 'refs' => [ 'ListCapacityReservationsInput$MaxResults' => '<p>Specifies the maximum number of results to return.</p>', ], ], 'MaxConcurrentDpus' => [ 'base' => NULL, 'refs' => [ 'EngineConfiguration$MaxConcurrentDpus' => '<p>The maximum number of DPUs that can run concurrently.</p>', ], ], 'MaxDataCatalogsCount' => [ 'base' => NULL, 'refs' => [ 'ListDataCatalogsInput$MaxResults' => '<p>Specifies the maximum number of data catalogs to return.</p>', ], ], 'MaxDatabasesCount' => [ 'base' => NULL, 'refs' => [ 'ListDatabasesInput$MaxResults' => '<p>Specifies the maximum number of results to return.</p>', ], ], 'MaxEngineVersionsCount' => [ 'base' => NULL, 'refs' => [ 'ListEngineVersionsInput$MaxResults' => '<p>The maximum number of engine versions to return in this request.</p>', ], ], 'MaxListExecutorsCount' => [ 'base' => NULL, 'refs' => [ 'ListExecutorsRequest$MaxResults' => '<p>The maximum number of executors to return.</p>', ], ], 'MaxNamedQueriesCount' => [ 'base' => NULL, 'refs' => [ 'ListNamedQueriesInput$MaxResults' => '<p>The maximum number of queries to return in this request.</p>', ], ], 'MaxNotebooksCount' => [ 'base' => NULL, 'refs' => [ 'ListNotebookMetadataInput$MaxResults' => '<p>Specifies the maximum number of results to return.</p>', ], ], 'MaxPreparedStatementsCount' => [ 'base' => NULL, 'refs' => [ 'ListPreparedStatementsInput$MaxResults' => '<p>The maximum number of results to return in this request.</p>', ], ], 'MaxQueryExecutionsCount' => [ 'base' => NULL, 'refs' => [ 'ListQueryExecutionsInput$MaxResults' => '<p>The maximum number of query executions to return in this request.</p>', ], ], 'MaxQueryResults' => [ 'base' => NULL, 'refs' => [ 'GetQueryResultsInput$MaxResults' => '<p>The maximum number of results (rows) to return in this request.</p>', ], ], 'MaxSessionsCount' => [ 'base' => NULL, 'refs' => [ 'ListNotebookSessionsRequest$MaxResults' => '<p>The maximum number of notebook sessions to return.</p>', 'ListSessionsRequest$MaxResults' => '<p>The maximum number of sessions to return.</p>', ], ], 'MaxTableMetadataCount' => [ 'base' => NULL, 'refs' => [ 'ListTableMetadataInput$MaxResults' => '<p>Specifies the maximum number of results to return.</p>', ], ], 'MaxTagsCount' => [ 'base' => NULL, 'refs' => [ 'ListTagsForResourceInput$MaxResults' => '<p>The maximum number of results to be returned per request that lists the tags for the resource.</p>', ], ], 'MaxWorkGroupsCount' => [ 'base' => NULL, 'refs' => [ 'ListWorkGroupsInput$MaxResults' => '<p>The maximum number of workgroups to return in this request.</p>', ], ], 'MetadataException' => [ 'base' => '<p>An exception that Athena received when it called a custom metastore. Occurs if the error is not caused by user input (<code>InvalidRequestException</code>) or from the Athena platform (<code>InternalServerException</code>). For example, if a user-created Lambda function is missing permissions, the Lambda <code>4XX</code> exception is returned in a <code>MetadataException</code>.</p>', 'refs' => [], ], 'NameString' => [ 'base' => NULL, 'refs' => [ 'ApplicationDPUSizes$ApplicationRuntimeId' => '<p>The name of the supported application runtime (for example, <code>Athena notebook version 1</code>).</p>', 'Column$Name' => '<p>The name of the column.</p>', 'CreateNamedQueryInput$Name' => '<p>The query name.</p>', 'Database$Name' => '<p>The name of the database.</p>', 'EngineVersion$SelectedEngineVersion' => '<p>The engine version requested by the user. Possible values are determined by the output of <code>ListEngineVersions</code>, including AUTO. The default is AUTO.</p>', 'EngineVersion$EffectiveEngineVersion' => '<p>Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a <code>CreateWorkGroup</code> or <code>UpdateWorkGroup</code> operation, the <code>EffectiveEngineVersion</code> field is ignored.</p>', 'GetDatabaseInput$DatabaseName' => '<p>The name of the database to return.</p>', 'GetSessionResponse$EngineVersion' => '<p>The engine version used by the session (for example, <code>PySpark engine version 3</code>). You can get a list of engine versions by calling <a>ListEngineVersions</a>.</p>', 'GetSessionResponse$NotebookVersion' => '<p>The notebook version.</p>', 'GetTableMetadataInput$DatabaseName' => '<p>The name of the database that contains the table metadata to return.</p>', 'GetTableMetadataInput$TableName' => '<p>The name of the table for which metadata is returned.</p>', 'ListTableMetadataInput$DatabaseName' => '<p>The name of the database for which table metadata should be returned.</p>', 'NamedQuery$Name' => '<p>The query name.</p>', 'SessionSummary$NotebookVersion' => '<p>The notebook version.</p>', 'StartSessionRequest$NotebookVersion' => '<p>The notebook version. This value is supplied automatically for notebook sessions in the Athena console and is not required for programmatic session access. The only valid notebook version is <code>Athena notebook version 1</code>. If you specify a value for <code>NotebookVersion</code>, you must also specify a value for <code>NotebookId</code>. See <a>EngineConfiguration$AdditionalConfigs</a>.</p>', 'TableMetadata$Name' => '<p>The name of the table.</p>', 'UpdateNamedQueryInput$Name' => '<p>The name of the query.</p>', 'WorkGroupConfiguration$AdditionalConfiguration' => '<p>Specifies a user defined JSON string that is passed to the notebook engine.</p>', 'WorkGroupConfigurationUpdates$AdditionalConfiguration' => '<p>Contains a user defined string in JSON format for a Spark-enabled workgroup.</p>', ], ], 'NamedQuery' => [ 'base' => '<p>A query, where <code>QueryString</code> contains the SQL statements that make up the query.</p>', 'refs' => [ 'GetNamedQueryOutput$NamedQuery' => '<p>Information about the query.</p>', 'NamedQueryList$member' => NULL, ], ], 'NamedQueryDescriptionString' => [ 'base' => NULL, 'refs' => [ 'UpdateNamedQueryInput$Description' => '<p>The query description.</p>', ], ], 'NamedQueryId' => [ 'base' => NULL, 'refs' => [ 'CreateNamedQueryOutput$NamedQueryId' => '<p>The unique ID of the query.</p>', 'DeleteNamedQueryInput$NamedQueryId' => '<p>The unique ID of the query to delete.</p>', 'GetNamedQueryInput$NamedQueryId' => '<p>The unique ID of the query. Use <a>ListNamedQueries</a> to get query IDs.</p>', 'NamedQuery$NamedQueryId' => '<p>The unique identifier of the query.</p>', 'NamedQueryIdList$member' => NULL, 'UnprocessedNamedQueryId$NamedQueryId' => '<p>The unique identifier of the named query.</p>', 'UpdateNamedQueryInput$NamedQueryId' => '<p>The unique identifier (UUID) of the query.</p>', ], ], 'NamedQueryIdList' => [ 'base' => NULL, 'refs' => [ 'BatchGetNamedQueryInput$NamedQueryIds' => '<p>An array of query IDs.</p>', 'ListNamedQueriesOutput$NamedQueryIds' => '<p>The list of unique query IDs.</p>', ], ], 'NamedQueryList' => [ 'base' => NULL, 'refs' => [ 'BatchGetNamedQueryOutput$NamedQueries' => '<p>Information about the named query IDs submitted.</p>', ], ], 'NotebookId' => [ 'base' => NULL, 'refs' => [ 'CreateNotebookOutput$NotebookId' => '<p>A unique identifier for the notebook.</p>', 'DeleteNotebookInput$NotebookId' => '<p>The ID of the notebook to delete.</p>', 'ExportNotebookInput$NotebookId' => '<p>The ID of the notebook to export.</p>', 'GetNotebookMetadataInput$NotebookId' => '<p>The ID of the notebook whose metadata is to be retrieved.</p>', 'ImportNotebookOutput$NotebookId' => '<p>The ID assigned to the imported notebook.</p>', 'ListNotebookSessionsRequest$NotebookId' => '<p>The ID of the notebook to list sessions for.</p>', 'NotebookMetadata$NotebookId' => '<p>The notebook ID.</p>', 'UpdateNotebookInput$NotebookId' => '<p>The ID of the notebook to update.</p>', 'UpdateNotebookMetadataInput$NotebookId' => '<p>The ID of the notebook to update the metadata for.</p>', ], ], 'NotebookMetadata' => [ 'base' => '<p>Contains metadata for notebook, including the notebook name, ID, workgroup, and time created.</p>', 'refs' => [ 'ExportNotebookOutput$NotebookMetadata' => '<p>The notebook metadata, including notebook ID, notebook name, and workgroup name.</p>', 'GetNotebookMetadataOutput$NotebookMetadata' => '<p>The metadata that is returned for the specified notebook ID.</p>', 'NotebookMetadataArray$member' => NULL, ], ], 'NotebookMetadataArray' => [ 'base' => NULL, 'refs' => [ 'ListNotebookMetadataOutput$NotebookMetadataList' => '<p>The list of notebook metadata for the specified workgroup.</p>', ], ], 'NotebookName' => [ 'base' => NULL, 'refs' => [ 'CreateNotebookInput$Name' => '<p>The name of the <code>ipynb</code> file to be created in the Spark workgroup, without the <code>.ipynb</code> extension.</p>', 'FilterDefinition$Name' => '<p>The name of the notebook to search for.</p>', 'ImportNotebookInput$Name' => '<p>The name of the notebook to import.</p>', 'NotebookMetadata$Name' => '<p>The name of the notebook.</p>', 'UpdateNotebookMetadataInput$Name' => '<p>The name to update the notebook to.</p>', ], ], 'NotebookSessionSummary' => [ 'base' => '<p>Contains the notebook session ID and notebook session creation time.</p>', 'refs' => [ 'NotebookSessionsList$member' => NULL, ], ], 'NotebookSessionsList' => [ 'base' => '<p>A list of notebook sessions.</p>', 'refs' => [ 'ListNotebookSessionsResponse$NotebookSessionsList' => '<p>A list of the sessions belonging to the notebook.</p>', ], ], 'NotebookType' => [ 'base' => NULL, 'refs' => [ 'ImportNotebookInput$Type' => '<p>The notebook content type. Currently, the only valid type is <code>IPYNB</code>.</p>', 'NotebookMetadata$Type' => '<p>The type of notebook. Currently, the only valid type is <code>IPYNB</code>.</p>', 'UpdateNotebookInput$Type' => '<p>The notebook content type. Currently, the only valid type is <code>IPYNB</code>.</p>', ], ], 'ParametersMap' => [ 'base' => NULL, 'refs' => [ 'CreateDataCatalogInput$Parameters' => '<p>Specifies the Lambda function or functions to use for creating the data catalog. This is a mapping whose values depend on the catalog type. </p> <ul> <li> <p>For the <code>HIVE</code> data catalog type, use the following syntax. The <code>metadata-function</code> parameter is required. <code>The sdk-version</code> parameter is optional and defaults to the currently supported version.</p> <p> <code>metadata-function=<i>lambda_arn</i>, sdk-version=<i>version_number</i> </code> </p> </li> <li> <p>For the <code>LAMBDA</code> data catalog type, use one of the following sets of required parameters, but not both.</p> <ul> <li> <p>If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required.</p> <p> <code>metadata-function=<i>lambda_arn</i>, record-function=<i>lambda_arn</i> </code> </p> </li> <li> <p> If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function.</p> <p> <code>function=<i>lambda_arn</i> </code> </p> </li> </ul> </li> <li> <p>The <code>GLUE</code> type takes a catalog ID parameter and is required. The <code> <i>catalog_id</i> </code> is the account ID of the Amazon Web Services account to which the Glue Data Catalog belongs.</p> <p> <code>catalog-id=<i>catalog_id</i> </code> </p> <ul> <li> <p>The <code>GLUE</code> data catalog type also applies to the default <code>AwsDataCatalog</code> that already exists in your account, of which you can have only one and cannot modify.</p> </li> <li> <p>Queries that specify a Glue Data Catalog other than the default <code>AwsDataCatalog</code> must be run on Athena engine version 2.</p> </li> <li> <p>In Regions where Athena engine version 2 is not available, creating new Glue data catalogs results in an <code>INVALID_INPUT</code> error.</p> </li> </ul> </li> </ul>', 'DataCatalog$Parameters' => '<p>Specifies the Lambda function or functions to use for the data catalog. This is a mapping whose values depend on the catalog type. </p> <ul> <li> <p>For the <code>HIVE</code> data catalog type, use the following syntax. The <code>metadata-function</code> parameter is required. <code>The sdk-version</code> parameter is optional and defaults to the currently supported version.</p> <p> <code>metadata-function=<i>lambda_arn</i>, sdk-version=<i>version_number</i> </code> </p> </li> <li> <p>For the <code>LAMBDA</code> data catalog type, use one of the following sets of required parameters, but not both.</p> <ul> <li> <p>If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required.</p> <p> <code>metadata-function=<i>lambda_arn</i>, record-function=<i>lambda_arn</i> </code> </p> </li> <li> <p> If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function.</p> <p> <code>function=<i>lambda_arn</i> </code> </p> </li> </ul> </li> <li> <p>The <code>GLUE</code> type takes a catalog ID parameter and is required. The <code> <i>catalog_id</i> </code> is the account ID of the Amazon Web Services account to which the Glue catalog belongs.</p> <p> <code>catalog-id=<i>catalog_id</i> </code> </p> <ul> <li> <p>The <code>GLUE</code> data catalog type also applies to the default <code>AwsDataCatalog</code> that already exists in your account, of which you can have only one and cannot modify.</p> </li> <li> <p>Queries that specify a Glue Data Catalog other than the default <code>AwsDataCatalog</code> must be run on Athena engine version 2.</p> </li> </ul> </li> </ul>', 'Database$Parameters' => '<p>A set of custom key/value pairs.</p>', 'EngineConfiguration$AdditionalConfigs' => '<p>Contains additional notebook engine <code>MAP&lt;string, string&gt;</code> parameter mappings in the form of key-value pairs. To specify an Athena notebook that the Jupyter server will download and serve, specify a value for the <a>StartSessionRequest$NotebookVersion</a> field, and then add a key named <code>NotebookId</code> to <code>AdditionalConfigs</code> that has the value of the Athena notebook ID.</p>', 'EngineConfiguration$SparkProperties' => '<p>Specifies custom jar files and Spark properties for use cases like cluster encryption, table formats, and general Spark tuning.</p>', 'TableMetadata$Parameters' => '<p>A set of custom key/value pairs for table properties.</p>', 'UpdateDataCatalogInput$Parameters' => '<p>Specifies the Lambda function or functions to use for updating the data catalog. This is a mapping whose values depend on the catalog type. </p> <ul> <li> <p>For the <code>HIVE</code> data catalog type, use the following syntax. The <code>metadata-function</code> parameter is required. <code>The sdk-version</code> parameter is optional and defaults to the currently supported version.</p> <p> <code>metadata-function=<i>lambda_arn</i>, sdk-version=<i>version_number</i> </code> </p> </li> <li> <p>For the <code>LAMBDA</code> data catalog type, use one of the following sets of required parameters, but not both.</p> <ul> <li> <p>If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required.</p> <p> <code>metadata-function=<i>lambda_arn</i>, record-function=<i>lambda_arn</i> </code> </p> </li> <li> <p> If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function.</p> <p> <code>function=<i>lambda_arn</i> </code> </p> </li> </ul> </li> </ul>', ], ], 'ParametersMapValue' => [ 'base' => NULL, 'refs' => [ 'ParametersMap$value' => NULL, ], ], 'Payload' => [ 'base' => NULL, 'refs' => [ 'ExportNotebookOutput$Payload' => '<p>The content of the exported notebook.</p>', 'ImportNotebookInput$Payload' => '<p>The notebook content to be imported.</p>', 'UpdateNotebookInput$Payload' => '<p>The updated content for the notebook.</p>', ], ], 'PreparedStatement' => [ 'base' => '<p>A prepared SQL statement for use with Athena.</p>', 'refs' => [ 'GetPreparedStatementOutput$PreparedStatement' => '<p>The name of the prepared statement that was retrieved.</p>', 'PreparedStatementDetailsList$member' => NULL, ], ], 'PreparedStatementDetailsList' => [ 'base' => NULL, 'refs' => [ 'BatchGetPreparedStatementOutput$PreparedStatements' => '<p>The list of prepared statements returned.</p>', ], ], 'PreparedStatementNameList' => [ 'base' => NULL, 'refs' => [ 'BatchGetPreparedStatementInput$PreparedStatementNames' => '<p>A list of prepared statement names to return.</p>', ], ], 'PreparedStatementSummary' => [ 'base' => '<p>The name and last modified time of the prepared statement.</p>', 'refs' => [ 'PreparedStatementsList$member' => NULL, ], ], 'PreparedStatementsList' => [ 'base' => NULL, 'refs' => [ 'ListPreparedStatementsOutput$PreparedStatements' => '<p>The list of prepared statements for the workgroup.</p>', ], ], 'PutCapacityAssignmentConfigurationInput' => [ 'base' => NULL, 'refs' => [], ], 'PutCapacityAssignmentConfigurationOutput' => [ 'base' => NULL, 'refs' => [], ], 'QueryExecution' => [ 'base' => '<p>Information about a single instance of a query execution.</p>', 'refs' => [ 'GetQueryExecutionOutput$QueryExecution' => '<p>Information about the query execution.</p>', 'QueryExecutionList$member' => NULL, ], ], 'QueryExecutionContext' => [ 'base' => '<p>The database and data catalog context in which the query execution occurs.</p>', 'refs' => [ 'QueryExecution$QueryExecutionContext' => '<p>The database in which the query execution occurred.</p>', 'StartQueryExecutionInput$QueryExecutionContext' => '<p>The database within which the query executes.</p>', ], ], 'QueryExecutionId' => [ 'base' => NULL, 'refs' => [ 'GetQueryExecutionInput$QueryExecutionId' => '<p>The unique ID of the query execution.</p>', 'GetQueryResultsInput$QueryExecutionId' => '<p>The unique ID of the query execution.</p>', 'GetQueryRuntimeStatisticsInput$QueryExecutionId' => '<p>The unique ID of the query execution.</p>', 'QueryExecution$QueryExecutionId' => '<p>The unique identifier for each query execution.</p>', 'QueryExecutionIdList$member' => NULL, 'StartQueryExecutionOutput$QueryExecutionId' => '<p>The unique ID of the query that ran as a result of this request.</p>', 'StopQueryExecutionInput$QueryExecutionId' => '<p>The unique ID of the query execution to stop.</p>', 'UnprocessedQueryExecutionId$QueryExecutionId' => '<p>The unique identifier of the query execution.</p>', ], ], 'QueryExecutionIdList' => [ 'base' => NULL, 'refs' => [ 'BatchGetQueryExecutionInput$QueryExecutionIds' => '<p>An array of query execution IDs.</p>', 'ListQueryExecutionsOutput$QueryExecutionIds' => '<p>The unique IDs of each query execution as an array of strings.</p>', ], ], 'QueryExecutionList' => [ 'base' => NULL, 'refs' => [ 'BatchGetQueryExecutionOutput$QueryExecutions' => '<p>Information about a query execution.</p>', ], ], 'QueryExecutionState' => [ 'base' => NULL, 'refs' => [ 'QueryExecutionStatus$State' => '<p>The state of query execution. <code>QUEUED</code> indicates that the query has been submitted to the service, and Athena will execute the query as soon as resources are available. <code>RUNNING</code> indicates that the query is in execution phase. <code>SUCCEEDED</code> indicates that the query completed without errors. <code>FAILED</code> indicates that the query experienced an error and did not complete processing. <code>CANCELLED</code> indicates that a user input interrupted query execution.</p> <note> <p>Athena automatically retries your queries in cases of certain transient errors. As a result, you may see the query state transition from <code>RUNNING</code> or <code>FAILED</code> to <code>QUEUED</code>. </p> </note>', ], ], 'QueryExecutionStatistics' => [ 'base' => '<p>The amount of data scanned during the query execution and the amount of time that it took to execute, and the type of statement that was run.</p>', 'refs' => [ 'QueryExecution$Statistics' => '<p>Query execution statistics, such as the amount of data scanned, the amount of time that the query took to process, and the type of statement that was run.</p>', ], ], 'QueryExecutionStatus' => [ 'base' => '<p>The completion date, current state, submission time, and state change reason (if applicable) for the query execution.</p>', 'refs' => [ 'QueryExecution$Status' => '<p>The completion date, current state, submission time, and state change reason (if applicable) for the query execution.</p>', ], ], 'QueryRuntimeStatistics' => [ 'base' => '<p>The query execution timeline, statistics on input and output rows and bytes, and the different query stages that form the query execution plan.</p>', 'refs' => [ 'GetQueryRuntimeStatisticsOutput$QueryRuntimeStatistics' => '<p>Runtime statistics about the query execution.</p>', ], ], 'QueryRuntimeStatisticsRows' => [ 'base' => '<p>Statistics such as input rows and bytes read by the query, rows and bytes output by the query, and the number of rows written by the query.</p>', 'refs' => [ 'QueryRuntimeStatistics$Rows' => NULL, ], ], 'QueryRuntimeStatisticsTimeline' => [ 'base' => '<p>Timeline statistics such as query queue time, planning time, execution time, service processing time, and total execution time.</p>', 'refs' => [ 'QueryRuntimeStatistics$Timeline' => NULL, ], ], 'QueryStage' => [ 'base' => '<p>Stage statistics such as input and output rows and bytes, execution time and stage state. This information also includes substages and the query stage plan.</p>', 'refs' => [ 'QueryRuntimeStatistics$OutputStage' => '<p>Stage statistics such as input and output rows and bytes, execution time, and stage state. This information also includes substages and the query stage plan.</p>', 'QueryStages$member' => NULL, ], ], 'QueryStagePlanNode' => [ 'base' => '<p>Stage plan information such as name, identifier, sub plans, and remote sources.</p>', 'refs' => [ 'QueryStage$QueryStagePlan' => '<p>Stage plan information such as name, identifier, sub plans, and source stages.</p>', 'QueryStagePlanNodes$member' => NULL, ], ], 'QueryStagePlanNodes' => [ 'base' => NULL, 'refs' => [ 'QueryStagePlanNode$Children' => '<p>Stage plan information such as name, identifier, sub plans, and remote sources of child plan nodes/</p>', ], ], 'QueryStages' => [ 'base' => NULL, 'refs' => [ 'QueryStage$SubStages' => '<p>List of sub query stages that form this stage execution plan.</p>', ], ], 'QueryString' => [ 'base' => NULL, 'refs' => [ 'CreateNamedQueryInput$QueryString' => '<p>The contents of the query with all query statements.</p>', 'CreatePreparedStatementInput$QueryStatement' => '<p>The query string for the prepared statement.</p>', 'NamedQuery$QueryString' => '<p>The SQL statements that make up the query.</p>', 'PreparedStatement$QueryStatement' => '<p>The query string for the prepared statement.</p>', 'QueryExecution$Query' => '<p>The SQL query statements which the query execution ran.</p>', 'StartQueryExecutionInput$QueryString' => '<p>The SQL query statements to be executed.</p>', 'UpdateNamedQueryInput$QueryString' => '<p>The contents of the query with all query statements.</p>', 'UpdatePreparedStatementInput$QueryStatement' => '<p>The query string for the prepared statement.</p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p>A resource, such as a workgroup, was not found.</p>', 'refs' => [], ], 'ResultConfiguration' => [ 'base' => '<p>The location in Amazon S3 where query and calculation results are stored and the encryption option, if any, used for query and calculation results. These are known as \"client-side settings\". If workgroup settings override client-side settings, then the query uses the workgroup settings.</p>', 'refs' => [ 'QueryExecution$ResultConfiguration' => '<p>The location in Amazon S3 where query and calculation results are stored and the encryption option, if any, used for query results. These are known as \"client-side settings\". If workgroup settings override client-side settings, then the query uses the location for the query results and the encryption configuration that are specified for the workgroup.</p>', 'StartQueryExecutionInput$ResultConfiguration' => '<p>Specifies information about where and how to save the results of the query execution. If the query runs in a workgroup, then workgroup\\'s settings may override query settings. This affects the query results location. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a>.</p>', 'WorkGroupConfiguration$ResultConfiguration' => '<p>The configuration for the workgroup, which includes the location in Amazon S3 where query and calculation results are stored and the encryption option, if any, used for query and calculation results. To run the query, you must specify the query results location using one of the ways: either in the workgroup using this setting, or for individual queries (client-side), using <a>ResultConfiguration$OutputLocation</a>. If none of them is set, Athena issues an error that no output location is provided. For more information, see <a href=\"https://docs.aws.amazon.com/athena/latest/ug/querying.html\">Working with query results, recent queries, and output files</a>.</p>', ], ], 'ResultConfigurationUpdates' => [ 'base' => '<p>The information about the updates in the query results, such as output location and encryption configuration for the query results.</p>', 'refs' => [ 'WorkGroupConfigurationUpdates$ResultConfigurationUpdates' => '<p>The result configuration information about the queries in this workgroup that will be updated. Includes the updated results location and an updated option for encrypting query results.</p>', ], ], 'ResultOutputLocation' => [ 'base' => NULL, 'refs' => [ 'ResultConfiguration$OutputLocation' => '<p>The location in Amazon S3 where your query and calculation results are stored, such as <code>s3://path/to/query/bucket/</code>. To run the query, you must specify the query results location using one of the ways: either for individual queries using either this setting (client-side), or in the workgroup, using <a>WorkGroupConfiguration</a>. If none of them is set, Athena issues an error that no output location is provided. For more information, see <a href=\"https://docs.aws.amazon.com/athena/latest/ug/querying.html\">Working with query results, recent queries, and output files</a>. If workgroup settings override client-side settings, then the query uses the settings specified for the workgroup. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a>.</p>', 'ResultConfigurationUpdates$OutputLocation' => '<p>The location in Amazon S3 where your query and calculation results are stored, such as <code>s3://path/to/query/bucket/</code>. For more information, see <a href=\"https://docs.aws.amazon.com/athena/latest/ug/querying.html\">Working with query results, recent queries, and output files</a>. If workgroup settings override client-side settings, then the query uses the location for the query results and the encryption configuration that are specified for the workgroup. The \"workgroup settings override\" is specified in <code>EnforceWorkGroupConfiguration</code> (true/false) in the <code>WorkGroupConfiguration</code>. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a>.</p>', 'SessionConfiguration$WorkingDirectory' => '<p>The Amazon S3 location that stores information for the notebook.</p>', ], ], 'ResultReuseByAgeConfiguration' => [ 'base' => '<p>Specifies whether previous query results are reused, and if so, their maximum age.</p>', 'refs' => [ 'ResultReuseConfiguration$ResultReuseByAgeConfiguration' => '<p>Specifies whether previous query results are reused, and if so, their maximum age.</p>', ], ], 'ResultReuseConfiguration' => [ 'base' => '<p>Specifies the query result reuse behavior for the query.</p>', 'refs' => [ 'QueryExecution$ResultReuseConfiguration' => '<p>Specifies the query result reuse behavior that was used for the query.</p>', 'StartQueryExecutionInput$ResultReuseConfiguration' => '<p>Specifies the query result reuse behavior for the query.</p>', ], ], 'ResultReuseInformation' => [ 'base' => '<p>Contains information about whether the result of a previous query was reused.</p>', 'refs' => [ 'QueryExecutionStatistics$ResultReuseInformation' => '<p>Contains information about whether previous query results were reused for the query.</p>', ], ], 'ResultSet' => [ 'base' => '<p>The metadata and rows that make up a query result set. The metadata describes the column structure and data types. To return a <code>ResultSet</code> object, use <a>GetQueryResults</a>.</p>', 'refs' => [ 'GetQueryResultsOutput$ResultSet' => '<p>The results of the query execution.</p>', ], ], 'ResultSetMetadata' => [ 'base' => '<p>The metadata that describes the column structure and data types of a table of query results. To return a <code>ResultSetMetadata</code> object, use <a>GetQueryResults</a>.</p>', 'refs' => [ 'ResultSet$ResultSetMetadata' => '<p>The metadata that describes the column structure and data types of a table of query results.</p>', ], ], 'RoleArn' => [ 'base' => NULL, 'refs' => [ 'SessionConfiguration$ExecutionRole' => '<p>The ARN of the execution role used for the session.</p>', 'WorkGroupConfiguration$ExecutionRole' => '<p>Role used in a session for accessing the user\\'s resources.</p>', 'WorkGroupConfigurationUpdates$ExecutionRole' => '<p>Contains the ARN of the execution role for the workgroup</p>', ], ], 'Row' => [ 'base' => '<p>The rows that make up a query result table.</p>', 'refs' => [ 'RowList$member' => NULL, ], ], 'RowList' => [ 'base' => NULL, 'refs' => [ 'ResultSet$Rows' => '<p>The rows in the table.</p>', ], ], 'S3AclOption' => [ 'base' => NULL, 'refs' => [ 'AclConfiguration$S3AclOption' => '<p>The Amazon S3 canned ACL that Athena should specify when storing query results. Currently the only supported canned ACL is <code>BUCKET_OWNER_FULL_CONTROL</code>. If a query runs in a workgroup and the workgroup overrides client-side settings, then the Amazon S3 canned ACL specified in the workgroup\\'s settings is used for all queries that run in the workgroup. For more information about Amazon S3 canned ACLs, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl\">Canned ACL</a> in the <i>Amazon S3 User Guide</i>.</p>', ], ], 'S3Uri' => [ 'base' => NULL, 'refs' => [ 'CalculationResult$StdOutS3Uri' => '<p>The Amazon S3 location of the <code>stdout</code> file for the calculation.</p>', 'CalculationResult$StdErrorS3Uri' => '<p>The Amazon S3 location of the <code>stderr</code> error messages file for the calculation.</p>', 'CalculationResult$ResultS3Uri' => '<p>The Amazon S3 location of the folder for the calculation results.</p>', 'GetCalculationExecutionResponse$WorkingDirectory' => '<p>The Amazon S3 location in which calculation results are stored.</p>', ], ], 'SessionAlreadyExistsException' => [ 'base' => '<p>The specified session already exists.</p>', 'refs' => [], ], 'SessionConfiguration' => [ 'base' => '<p>Contains session configuration information.</p>', 'refs' => [ 'GetSessionResponse$SessionConfiguration' => '<p>Contains the workgroup configuration information used by the session.</p>', ], ], 'SessionId' => [ 'base' => NULL, 'refs' => [ 'CreatePresignedNotebookUrlRequest$SessionId' => '<p>The session ID.</p>', 'GetCalculationExecutionResponse$SessionId' => '<p>The session ID that the calculation ran in.</p>', 'GetSessionRequest$SessionId' => '<p>The session ID.</p>', 'GetSessionResponse$SessionId' => '<p>The session ID.</p>', 'GetSessionStatusRequest$SessionId' => '<p>The session ID.</p>', 'GetSessionStatusResponse$SessionId' => '<p>The session ID.</p>', 'ListCalculationExecutionsRequest$SessionId' => '<p>The session ID.</p>', 'ListExecutorsRequest$SessionId' => '<p>The session ID.</p>', 'ListExecutorsResponse$SessionId' => '<p>The session ID.</p>', 'NotebookSessionSummary$SessionId' => '<p>The notebook session ID.</p>', 'SessionSummary$SessionId' => '<p>The session ID.</p>', 'StartCalculationExecutionRequest$SessionId' => '<p>The session ID.</p>', 'StartSessionResponse$SessionId' => '<p>The session ID.</p>', 'TerminateSessionRequest$SessionId' => '<p>The session ID.</p>', 'UpdateNotebookInput$SessionId' => '<p>The active notebook session ID. Required if the notebook has an active session.</p>', ], ], 'SessionIdleTimeoutInMinutes' => [ 'base' => NULL, 'refs' => [ 'StartSessionRequest$SessionIdleTimeoutInMinutes' => '<p>The idle timeout in minutes for the session.</p>', ], ], 'SessionManagerToken' => [ 'base' => NULL, 'refs' => [ 'ListCalculationExecutionsRequest$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListCalculationExecutionsResponse$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListExecutorsRequest$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListExecutorsResponse$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListSessionsRequest$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListSessionsResponse$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', ], ], 'SessionState' => [ 'base' => NULL, 'refs' => [ 'ListSessionsRequest$StateFilter' => '<p>A filter for a specific session state. A description of each state follows.</p> <p> <code>CREATING</code> - The session is being started, including acquiring resources.</p> <p> <code>CREATED</code> - The session has been started.</p> <p> <code>IDLE</code> - The session is able to accept a calculation.</p> <p> <code>BUSY</code> - The session is processing another task and is unable to accept a calculation.</p> <p> <code>TERMINATING</code> - The session is in the process of shutting down.</p> <p> <code>TERMINATED</code> - The session and its resources are no longer running.</p> <p> <code>DEGRADED</code> - The session has no healthy coordinators.</p> <p> <code>FAILED</code> - Due to a failure, the session and its resources are no longer running.</p>', 'SessionStatus$State' => '<p>The state of the session. A description of each state follows.</p> <p> <code>CREATING</code> - The session is being started, including acquiring resources.</p> <p> <code>CREATED</code> - The session has been started.</p> <p> <code>IDLE</code> - The session is able to accept a calculation.</p> <p> <code>BUSY</code> - The session is processing another task and is unable to accept a calculation.</p> <p> <code>TERMINATING</code> - The session is in the process of shutting down.</p> <p> <code>TERMINATED</code> - The session and its resources are no longer running.</p> <p> <code>DEGRADED</code> - The session has no healthy coordinators.</p> <p> <code>FAILED</code> - Due to a failure, the session and its resources are no longer running.</p>', 'StartSessionResponse$State' => '<p>The state of the session. A description of each state follows.</p> <p> <code>CREATING</code> - The session is being started, including acquiring resources.</p> <p> <code>CREATED</code> - The session has been started.</p> <p> <code>IDLE</code> - The session is able to accept a calculation.</p> <p> <code>BUSY</code> - The session is processing another task and is unable to accept a calculation.</p> <p> <code>TERMINATING</code> - The session is in the process of shutting down.</p> <p> <code>TERMINATED</code> - The session and its resources are no longer running.</p> <p> <code>DEGRADED</code> - The session has no healthy coordinators.</p> <p> <code>FAILED</code> - Due to a failure, the session and its resources are no longer running.</p>', 'TerminateSessionResponse$State' => '<p>The state of the session. A description of each state follows.</p> <p> <code>CREATING</code> - The session is being started, including acquiring resources.</p> <p> <code>CREATED</code> - The session has been started.</p> <p> <code>IDLE</code> - The session is able to accept a calculation.</p> <p> <code>BUSY</code> - The session is processing another task and is unable to accept a calculation.</p> <p> <code>TERMINATING</code> - The session is in the process of shutting down.</p> <p> <code>TERMINATED</code> - The session and its resources are no longer running.</p> <p> <code>DEGRADED</code> - The session has no healthy coordinators.</p> <p> <code>FAILED</code> - Due to a failure, the session and its resources are no longer running.</p>', ], ], 'SessionStatistics' => [ 'base' => '<p>Contains statistics for a session.</p>', 'refs' => [ 'GetSessionResponse$Statistics' => '<p>Contains the DPU execution time.</p>', ], ], 'SessionStatus' => [ 'base' => '<p>Contains information about the status of a session.</p>', 'refs' => [ 'GetSessionResponse$Status' => '<p>Contains information about the status of the session.</p>', 'GetSessionStatusResponse$Status' => '<p>Contains information about the status of the session.</p>', 'SessionSummary$Status' => '<p>Contains information about the session status.</p>', ], ], 'SessionSummary' => [ 'base' => '<p>Contains summary information about a session.</p>', 'refs' => [ 'SessionsList$member' => NULL, ], ], 'SessionsList' => [ 'base' => NULL, 'refs' => [ 'ListSessionsResponse$Sessions' => '<p>A list of sessions.</p>', ], ], 'StartCalculationExecutionRequest' => [ 'base' => NULL, 'refs' => [], ], 'StartCalculationExecutionResponse' => [ 'base' => NULL, 'refs' => [], ], 'StartQueryExecutionInput' => [ 'base' => NULL, 'refs' => [], ], 'StartQueryExecutionOutput' => [ 'base' => NULL, 'refs' => [], ], 'StartSessionRequest' => [ 'base' => NULL, 'refs' => [], ], 'StartSessionResponse' => [ 'base' => NULL, 'refs' => [], ], 'StatementName' => [ 'base' => NULL, 'refs' => [ 'CreatePreparedStatementInput$StatementName' => '<p>The name of the prepared statement.</p>', 'DeletePreparedStatementInput$StatementName' => '<p>The name of the prepared statement to delete.</p>', 'GetPreparedStatementInput$StatementName' => '<p>The name of the prepared statement to retrieve.</p>', 'PreparedStatement$StatementName' => '<p>The name of the prepared statement.</p>', 'PreparedStatementNameList$member' => NULL, 'PreparedStatementSummary$StatementName' => '<p>The name of the prepared statement.</p>', 'UnprocessedPreparedStatementName$StatementName' => '<p>The name of a prepared statement that could not be returned due to an error.</p>', 'UpdatePreparedStatementInput$StatementName' => '<p>The name of the prepared statement.</p>', ], ], 'StatementType' => [ 'base' => NULL, 'refs' => [ 'QueryExecution$StatementType' => '<p>The type of query statement that was run. <code>DDL</code> indicates DDL query statements. <code>DML</code> indicates DML (Data Manipulation Language) query statements, such as <code>CREATE TABLE AS SELECT</code>. <code>UTILITY</code> indicates query statements other than DDL and DML, such as <code>SHOW CREATE TABLE</code>, or <code>DESCRIBE TABLE</code>.</p>', ], ], 'StopCalculationExecutionRequest' => [ 'base' => NULL, 'refs' => [], ], 'StopCalculationExecutionResponse' => [ 'base' => NULL, 'refs' => [], ], 'StopQueryExecutionInput' => [ 'base' => NULL, 'refs' => [], ], 'StopQueryExecutionOutput' => [ 'base' => NULL, 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [ 'AthenaError$ErrorMessage' => '<p>Contains a short description of the error that occurred.</p>', 'CapacityAllocation$StatusMessage' => '<p>The status message of the capacity allocation.</p>', 'ColumnInfo$CatalogName' => '<p>The catalog to which the query results belong.</p>', 'ColumnInfo$SchemaName' => '<p>The schema name (database name) to which the query results belong.</p>', 'ColumnInfo$TableName' => '<p>The table name for the query results.</p>', 'ColumnInfo$Name' => '<p>The name of the column.</p>', 'ColumnInfo$Label' => '<p>A column label.</p>', 'ColumnInfo$Type' => '<p>The data type of the column.</p>', 'CreatePresignedNotebookUrlResponse$NotebookUrl' => '<p>The URL of the notebook. The URL includes the authentication token and notebook file name and points directly to the opened notebook.</p>', 'EncryptionConfiguration$KmsKey' => '<p>For <code>SSE_KMS</code> and <code>CSE_KMS</code>, this is the KMS key ARN or ID.</p>', 'QueryExecution$SubstatementType' => '<p>The kind of query statement that was run.</p>', 'QueryExecutionStatistics$DataManifestLocation' => '<p>The location and file name of a data manifest file. The manifest file is saved to the Athena query results location in Amazon S3. The manifest file tracks files that the query wrote to Amazon S3. If the query fails, the manifest file also tracks files that the query intended to write. The manifest is useful for identifying orphaned files resulting from a failed query. For more information, see <a href=\"https://docs.aws.amazon.com/athena/latest/ug/querying.html\">Working with Query Results, Output Files, and Query History</a> in the <i>Amazon Athena User Guide</i>.</p>', 'QueryExecutionStatus$StateChangeReason' => '<p>Further detail about the status of the query.</p>', 'QueryStage$State' => '<p>State of the stage after query execution.</p>', 'QueryStagePlanNode$Name' => '<p>Name of the query stage plan that describes the operation this stage is performing as part of query execution.</p>', 'QueryStagePlanNode$Identifier' => '<p>Information about the operation this query stage plan node is performing.</p>', 'StringList$member' => NULL, ], ], 'StringList' => [ 'base' => NULL, 'refs' => [ 'QueryStagePlanNode$RemoteSources' => '<p>Source plan node IDs.</p>', ], ], 'SupportedDPUSizeList' => [ 'base' => NULL, 'refs' => [ 'ApplicationDPUSizes$SupportedDPUSizes' => '<p>A list of the supported DPU sizes that the application runtime supports.</p>', ], ], 'TableMetadata' => [ 'base' => '<p>Contains metadata for a table.</p>', 'refs' => [ 'GetTableMetadataOutput$TableMetadata' => '<p>An object that contains table metadata.</p>', 'TableMetadataList$member' => NULL, ], ], 'TableMetadataList' => [ 'base' => NULL, 'refs' => [ 'ListTableMetadataOutput$TableMetadataList' => '<p>A list of table metadata.</p>', ], ], 'TableTypeString' => [ 'base' => NULL, 'refs' => [ 'TableMetadata$TableType' => '<p>The type of table. In Athena, only <code>EXTERNAL_TABLE</code> is supported.</p>', ], ], 'Tag' => [ 'base' => '<p>A label that you assign to a resource. Athena resources include workgroups, data catalogs, and capacity reservations. Each tag consists of a key and an optional value, both of which you define. For example, you can use tags to categorize Athena resources by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter the resources in your account. For best practices, see <a href=\"https://docs.aws.amazon.com/whitepapers/latest/tagging-best-practices/tagging-best-practices.html\">Tagging Best Practices</a>. Tag keys can be from 1 to 128 UTF-8 Unicode characters, and tag values can be from 0 to 256 UTF-8 Unicode characters. Tags can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys and values are case-sensitive. Tag keys must be unique per resource. If you specify more than one tag, separate them by commas. </p>', 'refs' => [ 'TagList$member' => NULL, ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'Tag$Key' => '<p>A tag key. The tag key length is from 1 to 128 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys are case-sensitive and must be unique per resource. </p>', 'TagKeyList$member' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceInput$TagKeys' => '<p>A comma-separated list of one or more tag keys whose tags are to be removed from the specified resource.</p>', ], ], 'TagList' => [ 'base' => NULL, 'refs' => [ 'CreateCapacityReservationInput$Tags' => '<p>The tags for the capacity reservation.</p>', 'CreateDataCatalogInput$Tags' => '<p>A list of comma separated tags to add to the data catalog that is created.</p>', 'CreateWorkGroupInput$Tags' => '<p>A list of comma separated tags to add to the workgroup that is created.</p>', 'ListTagsForResourceOutput$Tags' => '<p>The list of tags associated with the specified resource.</p>', 'TagResourceInput$Tags' => '<p>A collection of one or more tags, separated by commas, to be added to an Athena resource.</p>', ], ], 'TagResourceInput' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceOutput' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'Tag$Value' => '<p>A tag value. The tag value length is from 0 to 256 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag values are case-sensitive. </p>', ], ], 'TargetDpusInteger' => [ 'base' => NULL, 'refs' => [ 'CapacityReservation$TargetDpus' => '<p>The number of data processing units requested.</p>', 'CreateCapacityReservationInput$TargetDpus' => '<p>The number of requested data processing units.</p>', 'UpdateCapacityReservationInput$TargetDpus' => '<p>The new number of requested data processing units.</p>', ], ], 'TerminateSessionRequest' => [ 'base' => NULL, 'refs' => [], ], 'TerminateSessionResponse' => [ 'base' => NULL, 'refs' => [], ], 'ThrottleReason' => [ 'base' => '<p>The reason for the query throttling, for example, when it exceeds the concurrent query limit.</p>', 'refs' => [ 'TooManyRequestsException$Reason' => NULL, ], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [ 'CapacityAllocation$RequestTime' => '<p>The time when the capacity allocation was requested.</p>', 'CapacityAllocation$RequestCompletionTime' => '<p>The time when the capacity allocation request was completed.</p>', 'CapacityReservation$LastSuccessfulAllocationTime' => '<p>The time of the most recent capacity allocation that succeeded.</p>', 'CapacityReservation$CreationTime' => '<p>The time in UTC epoch millis when the capacity reservation was created.</p>', 'TableMetadata$CreateTime' => '<p>The time that the table was created.</p>', 'TableMetadata$LastAccessTime' => '<p>The last time the table was accessed.</p>', ], ], 'Token' => [ 'base' => NULL, 'refs' => [ 'GetQueryResultsInput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'GetQueryResultsOutput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListApplicationDPUSizesInput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated.</p>', 'ListApplicationDPUSizesOutput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListCapacityReservationsInput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated.</p>', 'ListCapacityReservationsOutput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.</p>', 'ListDataCatalogsInput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.</p>', 'ListDataCatalogsOutput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.</p>', 'ListDatabasesInput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListDatabasesOutput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.</p>', 'ListEngineVersionsInput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListEngineVersionsOutput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListNamedQueriesInput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListNamedQueriesOutput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListNotebookMetadataInput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated.</p>', 'ListNotebookMetadataOutput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListNotebookSessionsRequest$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListNotebookSessionsResponse$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListPreparedStatementsInput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListPreparedStatementsOutput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListQueryExecutionsInput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListQueryExecutionsOutput$NextToken' => '<p>A token to be used by the next request if this request is truncated.</p>', 'ListTableMetadataInput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.</p>', 'ListTableMetadataOutput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.</p>', 'ListTagsForResourceInput$NextToken' => '<p>The token for the next set of results, or null if there are no additional results for this request, where the request lists the tags for the resource with the specified ARN.</p>', 'ListTagsForResourceOutput$NextToken' => '<p>A token to be used by the next request if this request is truncated.</p>', 'ListWorkGroupsInput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', 'ListWorkGroupsOutput$NextToken' => '<p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>', ], ], 'TooManyRequestsException' => [ 'base' => '<p>Indicates that the request was throttled.</p>', 'refs' => [], ], 'TypeString' => [ 'base' => NULL, 'refs' => [ 'Column$Type' => '<p>The data type of the column.</p>', ], ], 'UnprocessedNamedQueryId' => [ 'base' => '<p>Information about a named query ID that could not be processed.</p>', 'refs' => [ 'UnprocessedNamedQueryIdList$member' => NULL, ], ], 'UnprocessedNamedQueryIdList' => [ 'base' => NULL, 'refs' => [ 'BatchGetNamedQueryOutput$UnprocessedNamedQueryIds' => '<p>Information about provided query IDs.</p>', ], ], 'UnprocessedPreparedStatementName' => [ 'base' => '<p>The name of a prepared statement that could not be returned.</p>', 'refs' => [ 'UnprocessedPreparedStatementNameList$member' => NULL, ], ], 'UnprocessedPreparedStatementNameList' => [ 'base' => NULL, 'refs' => [ 'BatchGetPreparedStatementOutput$UnprocessedPreparedStatementNames' => '<p>A list of one or more prepared statements that were requested but could not be returned.</p>', ], ], 'UnprocessedQueryExecutionId' => [ 'base' => '<p>Describes a query execution that failed to process.</p>', 'refs' => [ 'UnprocessedQueryExecutionIdList$member' => NULL, ], ], 'UnprocessedQueryExecutionIdList' => [ 'base' => NULL, 'refs' => [ 'BatchGetQueryExecutionOutput$UnprocessedQueryExecutionIds' => '<p>Information about the query executions that failed to run.</p>', ], ], 'UntagResourceInput' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateCapacityReservationInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateCapacityReservationOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateDataCatalogInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateDataCatalogOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateNamedQueryInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateNamedQueryOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateNotebookInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateNotebookMetadataInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateNotebookMetadataOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateNotebookOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdatePreparedStatementInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdatePreparedStatementOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateWorkGroupInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateWorkGroupOutput' => [ 'base' => NULL, 'refs' => [], ], 'WorkGroup' => [ 'base' => '<p>A workgroup, which contains a name, description, creation time, state, and other configuration, listed under <a>WorkGroup$Configuration</a>. Each workgroup enables you to isolate queries for you or your group of users from other queries in the same account, to configure the query results location and the encryption configuration (known as workgroup settings), to enable sending query metrics to Amazon CloudWatch, and to establish per-query data usage control limits for all queries in a workgroup. The workgroup settings override is specified in <code>EnforceWorkGroupConfiguration</code> (true/false) in the <code>WorkGroupConfiguration</code>. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a>.</p>', 'refs' => [ 'GetWorkGroupOutput$WorkGroup' => '<p>Information about the workgroup.</p>', ], ], 'WorkGroupConfiguration' => [ 'base' => '<p>The configuration of the workgroup, which includes the location in Amazon S3 where query and calculation results are stored, the encryption option, if any, used for query and calculation results, whether the Amazon CloudWatch Metrics are enabled for the workgroup and whether workgroup settings override query settings, and the data usage limits for the amount of data scanned per query or per workgroup. The workgroup settings override is specified in <code>EnforceWorkGroupConfiguration</code> (true/false) in the <code>WorkGroupConfiguration</code>. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a>. </p>', 'refs' => [ 'CreateWorkGroupInput$Configuration' => '<p>Contains configuration information for creating an Athena SQL workgroup or Spark enabled Athena workgroup. Athena SQL workgroup configuration includes the location in Amazon S3 where query and calculation results are stored, the encryption configuration, if any, used for encrypting query results, whether the Amazon CloudWatch Metrics are enabled for the workgroup, the limit for the amount of bytes scanned (cutoff) per query, if it is specified, and whether workgroup\\'s settings (specified with <code>EnforceWorkGroupConfiguration</code>) in the <code>WorkGroupConfiguration</code> override client-side settings. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a>.</p>', 'WorkGroup$Configuration' => '<p>The configuration of the workgroup, which includes the location in Amazon S3 where query and calculation results are stored, the encryption configuration, if any, used for query and calculation results; whether the Amazon CloudWatch Metrics are enabled for the workgroup; whether workgroup settings override client-side settings; and the data usage limits for the amount of data scanned per query or per workgroup. The workgroup settings override is specified in <code>EnforceWorkGroupConfiguration</code> (true/false) in the <code>WorkGroupConfiguration</code>. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a>.</p>', ], ], 'WorkGroupConfigurationUpdates' => [ 'base' => '<p>The configuration information that will be updated for this workgroup, which includes the location in Amazon S3 where query and calculation results are stored, the encryption option, if any, used for query results, whether the Amazon CloudWatch Metrics are enabled for the workgroup, whether the workgroup settings override the client-side settings, and the data usage limit for the amount of bytes scanned per query, if it is specified.</p>', 'refs' => [ 'UpdateWorkGroupInput$ConfigurationUpdates' => '<p>Contains configuration updates for an Athena SQL workgroup.</p>', ], ], 'WorkGroupDescriptionString' => [ 'base' => NULL, 'refs' => [ 'CreateWorkGroupInput$Description' => '<p>The workgroup description.</p>', 'UpdateWorkGroupInput$Description' => '<p>The workgroup description.</p>', 'WorkGroup$Description' => '<p>The workgroup description.</p>', 'WorkGroupSummary$Description' => '<p>The workgroup description.</p>', ], ], 'WorkGroupName' => [ 'base' => NULL, 'refs' => [ 'BatchGetPreparedStatementInput$WorkGroup' => '<p>The name of the workgroup to which the prepared statements belong.</p>', 'CreateNamedQueryInput$WorkGroup' => '<p>The name of the workgroup in which the named query is being created.</p>', 'CreateNotebookInput$WorkGroup' => '<p>The name of the Spark enabled workgroup in which the notebook will be created.</p>', 'CreatePreparedStatementInput$WorkGroup' => '<p>The name of the workgroup to which the prepared statement belongs.</p>', 'CreateWorkGroupInput$Name' => '<p>The workgroup name.</p>', 'DeletePreparedStatementInput$WorkGroup' => '<p>The workgroup to which the statement to be deleted belongs.</p>', 'DeleteWorkGroupInput$WorkGroup' => '<p>The unique name of the workgroup to delete.</p>', 'GetPreparedStatementInput$WorkGroup' => '<p>The workgroup to which the statement to be retrieved belongs.</p>', 'GetSessionResponse$WorkGroup' => '<p>The workgroup to which the session belongs.</p>', 'GetWorkGroupInput$WorkGroup' => '<p>The name of the workgroup.</p>', 'ImportNotebookInput$WorkGroup' => '<p>The name of the Spark enabled workgroup to import the notebook to.</p>', 'ListNamedQueriesInput$WorkGroup' => '<p>The name of the workgroup from which the named queries are being returned. If a workgroup is not specified, the saved queries for the primary workgroup are returned.</p>', 'ListNotebookMetadataInput$WorkGroup' => '<p>The name of the Spark enabled workgroup to retrieve notebook metadata for.</p>', 'ListPreparedStatementsInput$WorkGroup' => '<p>The workgroup to list the prepared statements for.</p>', 'ListQueryExecutionsInput$WorkGroup' => '<p>The name of the workgroup from which queries are being returned. If a workgroup is not specified, a list of available query execution IDs for the queries in the primary workgroup is returned.</p>', 'ListSessionsRequest$WorkGroup' => '<p>The workgroup to which the session belongs.</p>', 'NamedQuery$WorkGroup' => '<p>The name of the workgroup that contains the named query.</p>', 'NotebookMetadata$WorkGroup' => '<p>The name of the Spark enabled workgroup to which the notebook belongs.</p>', 'PreparedStatement$WorkGroupName' => '<p>The name of the workgroup to which the prepared statement belongs.</p>', 'QueryExecution$WorkGroup' => '<p>The name of the workgroup in which the query ran.</p>', 'StartQueryExecutionInput$WorkGroup' => '<p>The name of the workgroup in which the query is being started.</p>', 'StartSessionRequest$WorkGroup' => '<p>The workgroup to which the session belongs.</p>', 'UpdatePreparedStatementInput$WorkGroup' => '<p>The workgroup for the prepared statement.</p>', 'UpdateWorkGroupInput$WorkGroup' => '<p>The specified workgroup that will be updated.</p>', 'WorkGroup$Name' => '<p>The workgroup name.</p>', 'WorkGroupNamesList$member' => NULL, 'WorkGroupSummary$Name' => '<p>The name of the workgroup.</p>', ], ], 'WorkGroupNamesList' => [ 'base' => NULL, 'refs' => [ 'CapacityAssignment$WorkGroupNames' => '<p>The list of workgroup names for the capacity assignment.</p>', ], ], 'WorkGroupState' => [ 'base' => NULL, 'refs' => [ 'UpdateWorkGroupInput$State' => '<p>The workgroup state that will be updated for the given workgroup.</p>', 'WorkGroup$State' => '<p>The state of the workgroup: ENABLED or DISABLED.</p>', 'WorkGroupSummary$State' => '<p>The state of the workgroup.</p>', ], ], 'WorkGroupSummary' => [ 'base' => '<p>The summary information for the workgroup, which includes its name, state, description, and the date and time it was created.</p>', 'refs' => [ 'WorkGroupsList$member' => NULL, ], ], 'WorkGroupsList' => [ 'base' => NULL, 'refs' => [ 'ListWorkGroupsOutput$WorkGroups' => '<p>A list of <a>WorkGroupSummary</a> objects that include the names, descriptions, creation times, and states for each workgroup.</p>', ], ], 'datumList' => [ 'base' => NULL, 'refs' => [ 'Row$Data' => '<p>The data that populates a row in a query result table.</p>', ], ], 'datumString' => [ 'base' => NULL, 'refs' => [ 'Datum$VarCharValue' => '<p>The value of the datum.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/athena/2017-05-18/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://athena-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://athena-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://athena.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://athena.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/athena/2017-05-18/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena-fips.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://athena.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/athena/2017-05-18/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/athena/2017-05-18/paginators-1.json\nreturn [ 'pagination' => [ 'GetQueryResults' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', ], 'ListApplicationDPUSizes' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', ], 'ListCalculationExecutions' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', ], 'ListCapacityReservations' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', ], 'ListDataCatalogs' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'DataCatalogsSummary', ], 'ListDatabases' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'DatabaseList', ], 'ListEngineVersions' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', ], 'ListExecutors' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', ], 'ListNamedQueries' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', ], 'ListPreparedStatements' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', ], 'ListQueryExecutions' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', ], 'ListSessions' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', ], 'ListTableMetadata' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'TableMetadataList', ], 'ListTagsForResource' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'Tags', ], 'ListWorkGroups' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/athena/2017-05-18/smoke.json\nreturn [ 'version' => 1, 'defaultRegion' => 'us-west-2', 'testCases' => [ [ 'operationName' => 'ListNamedQueries', 'input' => [], 'errorExpectedFromService' => false, ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/auditmanager/2017-07-25/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2017-07-25', 'endpointPrefix' => 'auditmanager', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'AWS Audit Manager', 'serviceId' => 'AuditManager', 'signatureVersion' => 'v4', 'signingName' => 'auditmanager', 'uid' => 'auditmanager-2017-07-25', ], 'operations' => [ 'AssociateAssessmentReportEvidenceFolder' => [ 'name' => 'AssociateAssessmentReportEvidenceFolder', 'http' => [ 'method' => 'PUT', 'requestUri' => '/assessments/{assessmentId}/associateToAssessmentReport', ], 'input' => [ 'shape' => 'AssociateAssessmentReportEvidenceFolderRequest', ], 'output' => [ 'shape' => 'AssociateAssessmentReportEvidenceFolderResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'BatchAssociateAssessmentReportEvidence' => [ 'name' => 'BatchAssociateAssessmentReportEvidence', 'http' => [ 'method' => 'PUT', 'requestUri' => '/assessments/{assessmentId}/batchAssociateToAssessmentReport', ], 'input' => [ 'shape' => 'BatchAssociateAssessmentReportEvidenceRequest', ], 'output' => [ 'shape' => 'BatchAssociateAssessmentReportEvidenceResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'BatchCreateDelegationByAssessment' => [ 'name' => 'BatchCreateDelegationByAssessment', 'http' => [ 'method' => 'POST', 'requestUri' => '/assessments/{assessmentId}/delegations', ], 'input' => [ 'shape' => 'BatchCreateDelegationByAssessmentRequest', ], 'output' => [ 'shape' => 'BatchCreateDelegationByAssessmentResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'BatchDeleteDelegationByAssessment' => [ 'name' => 'BatchDeleteDelegationByAssessment', 'http' => [ 'method' => 'PUT', 'requestUri' => '/assessments/{assessmentId}/delegations', ], 'input' => [ 'shape' => 'BatchDeleteDelegationByAssessmentRequest', ], 'output' => [ 'shape' => 'BatchDeleteDelegationByAssessmentResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'BatchDisassociateAssessmentReportEvidence' => [ 'name' => 'BatchDisassociateAssessmentReportEvidence', 'http' => [ 'method' => 'PUT', 'requestUri' => '/assessments/{assessmentId}/batchDisassociateFromAssessmentReport', ], 'input' => [ 'shape' => 'BatchDisassociateAssessmentReportEvidenceRequest', ], 'output' => [ 'shape' => 'BatchDisassociateAssessmentReportEvidenceResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'BatchImportEvidenceToAssessmentControl' => [ 'name' => 'BatchImportEvidenceToAssessmentControl', 'http' => [ 'method' => 'POST', 'requestUri' => '/assessments/{assessmentId}/controlSets/{controlSetId}/controls/{controlId}/evidence', ], 'input' => [ 'shape' => 'BatchImportEvidenceToAssessmentControlRequest', ], 'output' => [ 'shape' => 'BatchImportEvidenceToAssessmentControlResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'CreateAssessment' => [ 'name' => 'CreateAssessment', 'http' => [ 'method' => 'POST', 'requestUri' => '/assessments', ], 'input' => [ 'shape' => 'CreateAssessmentRequest', ], 'output' => [ 'shape' => 'CreateAssessmentResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], ], 'CreateAssessmentFramework' => [ 'name' => 'CreateAssessmentFramework', 'http' => [ 'method' => 'POST', 'requestUri' => '/assessmentFrameworks', ], 'input' => [ 'shape' => 'CreateAssessmentFrameworkRequest', ], 'output' => [ 'shape' => 'CreateAssessmentFrameworkResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], ], 'CreateAssessmentReport' => [ 'name' => 'CreateAssessmentReport', 'http' => [ 'method' => 'POST', 'requestUri' => '/assessments/{assessmentId}/reports', ], 'input' => [ 'shape' => 'CreateAssessmentReportRequest', ], 'output' => [ 'shape' => 'CreateAssessmentReportResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'CreateControl' => [ 'name' => 'CreateControl', 'http' => [ 'method' => 'POST', 'requestUri' => '/controls', ], 'input' => [ 'shape' => 'CreateControlRequest', ], 'output' => [ 'shape' => 'CreateControlResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], ], 'DeleteAssessment' => [ 'name' => 'DeleteAssessment', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/assessments/{assessmentId}', ], 'input' => [ 'shape' => 'DeleteAssessmentRequest', ], 'output' => [ 'shape' => 'DeleteAssessmentResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DeleteAssessmentFramework' => [ 'name' => 'DeleteAssessmentFramework', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/assessmentFrameworks/{frameworkId}', ], 'input' => [ 'shape' => 'DeleteAssessmentFrameworkRequest', ], 'output' => [ 'shape' => 'DeleteAssessmentFrameworkResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DeleteAssessmentFrameworkShare' => [ 'name' => 'DeleteAssessmentFrameworkShare', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/assessmentFrameworkShareRequests/{requestId}', ], 'input' => [ 'shape' => 'DeleteAssessmentFrameworkShareRequest', ], 'output' => [ 'shape' => 'DeleteAssessmentFrameworkShareResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DeleteAssessmentReport' => [ 'name' => 'DeleteAssessmentReport', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/assessments/{assessmentId}/reports/{assessmentReportId}', ], 'input' => [ 'shape' => 'DeleteAssessmentReportRequest', ], 'output' => [ 'shape' => 'DeleteAssessmentReportResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DeleteControl' => [ 'name' => 'DeleteControl', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/controls/{controlId}', ], 'input' => [ 'shape' => 'DeleteControlRequest', ], 'output' => [ 'shape' => 'DeleteControlResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'DeregisterAccount' => [ 'name' => 'DeregisterAccount', 'http' => [ 'method' => 'POST', 'requestUri' => '/account/deregisterAccount', ], 'input' => [ 'shape' => 'DeregisterAccountRequest', ], 'output' => [ 'shape' => 'DeregisterAccountResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DeregisterOrganizationAdminAccount' => [ 'name' => 'DeregisterOrganizationAdminAccount', 'http' => [ 'method' => 'POST', 'requestUri' => '/account/deregisterOrganizationAdminAccount', ], 'input' => [ 'shape' => 'DeregisterOrganizationAdminAccountRequest', ], 'output' => [ 'shape' => 'DeregisterOrganizationAdminAccountResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DisassociateAssessmentReportEvidenceFolder' => [ 'name' => 'DisassociateAssessmentReportEvidenceFolder', 'http' => [ 'method' => 'PUT', 'requestUri' => '/assessments/{assessmentId}/disassociateFromAssessmentReport', ], 'input' => [ 'shape' => 'DisassociateAssessmentReportEvidenceFolderRequest', ], 'output' => [ 'shape' => 'DisassociateAssessmentReportEvidenceFolderResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetAccountStatus' => [ 'name' => 'GetAccountStatus', 'http' => [ 'method' => 'GET', 'requestUri' => '/account/status', ], 'input' => [ 'shape' => 'GetAccountStatusRequest', ], 'output' => [ 'shape' => 'GetAccountStatusResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], ], ], 'GetAssessment' => [ 'name' => 'GetAssessment', 'http' => [ 'method' => 'GET', 'requestUri' => '/assessments/{assessmentId}', ], 'input' => [ 'shape' => 'GetAssessmentRequest', ], 'output' => [ 'shape' => 'GetAssessmentResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetAssessmentFramework' => [ 'name' => 'GetAssessmentFramework', 'http' => [ 'method' => 'GET', 'requestUri' => '/assessmentFrameworks/{frameworkId}', ], 'input' => [ 'shape' => 'GetAssessmentFrameworkRequest', ], 'output' => [ 'shape' => 'GetAssessmentFrameworkResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetAssessmentReportUrl' => [ 'name' => 'GetAssessmentReportUrl', 'http' => [ 'method' => 'GET', 'requestUri' => '/assessments/{assessmentId}/reports/{assessmentReportId}/url', ], 'input' => [ 'shape' => 'GetAssessmentReportUrlRequest', ], 'output' => [ 'shape' => 'GetAssessmentReportUrlResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetChangeLogs' => [ 'name' => 'GetChangeLogs', 'http' => [ 'method' => 'GET', 'requestUri' => '/assessments/{assessmentId}/changelogs', ], 'input' => [ 'shape' => 'GetChangeLogsRequest', ], 'output' => [ 'shape' => 'GetChangeLogsResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetControl' => [ 'name' => 'GetControl', 'http' => [ 'method' => 'GET', 'requestUri' => '/controls/{controlId}', ], 'input' => [ 'shape' => 'GetControlRequest', ], 'output' => [ 'shape' => 'GetControlResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetDelegations' => [ 'name' => 'GetDelegations', 'http' => [ 'method' => 'GET', 'requestUri' => '/delegations', ], 'input' => [ 'shape' => 'GetDelegationsRequest', ], 'output' => [ 'shape' => 'GetDelegationsResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetEvidence' => [ 'name' => 'GetEvidence', 'http' => [ 'method' => 'GET', 'requestUri' => '/assessments/{assessmentId}/controlSets/{controlSetId}/evidenceFolders/{evidenceFolderId}/evidence/{evidenceId}', ], 'input' => [ 'shape' => 'GetEvidenceRequest', ], 'output' => [ 'shape' => 'GetEvidenceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetEvidenceByEvidenceFolder' => [ 'name' => 'GetEvidenceByEvidenceFolder', 'http' => [ 'method' => 'GET', 'requestUri' => '/assessments/{assessmentId}/controlSets/{controlSetId}/evidenceFolders/{evidenceFolderId}/evidence', ], 'input' => [ 'shape' => 'GetEvidenceByEvidenceFolderRequest', ], 'output' => [ 'shape' => 'GetEvidenceByEvidenceFolderResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetEvidenceFileUploadUrl' => [ 'name' => 'GetEvidenceFileUploadUrl', 'http' => [ 'method' => 'GET', 'requestUri' => '/evidenceFileUploadUrl', ], 'input' => [ 'shape' => 'GetEvidenceFileUploadUrlRequest', ], 'output' => [ 'shape' => 'GetEvidenceFileUploadUrlResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'GetEvidenceFolder' => [ 'name' => 'GetEvidenceFolder', 'http' => [ 'method' => 'GET', 'requestUri' => '/assessments/{assessmentId}/controlSets/{controlSetId}/evidenceFolders/{evidenceFolderId}', ], 'input' => [ 'shape' => 'GetEvidenceFolderRequest', ], 'output' => [ 'shape' => 'GetEvidenceFolderResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetEvidenceFoldersByAssessment' => [ 'name' => 'GetEvidenceFoldersByAssessment', 'http' => [ 'method' => 'GET', 'requestUri' => '/assessments/{assessmentId}/evidenceFolders', ], 'input' => [ 'shape' => 'GetEvidenceFoldersByAssessmentRequest', ], 'output' => [ 'shape' => 'GetEvidenceFoldersByAssessmentResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetEvidenceFoldersByAssessmentControl' => [ 'name' => 'GetEvidenceFoldersByAssessmentControl', 'http' => [ 'method' => 'GET', 'requestUri' => '/assessments/{assessmentId}/evidenceFolders-by-assessment-control/{controlSetId}/{controlId}', ], 'input' => [ 'shape' => 'GetEvidenceFoldersByAssessmentControlRequest', ], 'output' => [ 'shape' => 'GetEvidenceFoldersByAssessmentControlResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetInsights' => [ 'name' => 'GetInsights', 'http' => [ 'method' => 'GET', 'requestUri' => '/insights', ], 'input' => [ 'shape' => 'GetInsightsRequest', ], 'output' => [ 'shape' => 'GetInsightsResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetInsightsByAssessment' => [ 'name' => 'GetInsightsByAssessment', 'http' => [ 'method' => 'GET', 'requestUri' => '/insights/assessments/{assessmentId}', ], 'input' => [ 'shape' => 'GetInsightsByAssessmentRequest', ], 'output' => [ 'shape' => 'GetInsightsByAssessmentResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetOrganizationAdminAccount' => [ 'name' => 'GetOrganizationAdminAccount', 'http' => [ 'method' => 'GET', 'requestUri' => '/account/organizationAdminAccount', ], 'input' => [ 'shape' => 'GetOrganizationAdminAccountRequest', ], 'output' => [ 'shape' => 'GetOrganizationAdminAccountResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetServicesInScope' => [ 'name' => 'GetServicesInScope', 'http' => [ 'method' => 'GET', 'requestUri' => '/services', ], 'input' => [ 'shape' => 'GetServicesInScopeRequest', ], 'output' => [ 'shape' => 'GetServicesInScopeResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'GetSettings' => [ 'name' => 'GetSettings', 'http' => [ 'method' => 'GET', 'requestUri' => '/settings/{attribute}', ], 'input' => [ 'shape' => 'GetSettingsRequest', ], 'output' => [ 'shape' => 'GetSettingsResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListAssessmentControlInsightsByControlDomain' => [ 'name' => 'ListAssessmentControlInsightsByControlDomain', 'http' => [ 'method' => 'GET', 'requestUri' => '/insights/controls-by-assessment', ], 'input' => [ 'shape' => 'ListAssessmentControlInsightsByControlDomainRequest', ], 'output' => [ 'shape' => 'ListAssessmentControlInsightsByControlDomainResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListAssessmentFrameworkShareRequests' => [ 'name' => 'ListAssessmentFrameworkShareRequests', 'http' => [ 'method' => 'GET', 'requestUri' => '/assessmentFrameworkShareRequests', ], 'input' => [ 'shape' => 'ListAssessmentFrameworkShareRequestsRequest', ], 'output' => [ 'shape' => 'ListAssessmentFrameworkShareRequestsResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListAssessmentFrameworks' => [ 'name' => 'ListAssessmentFrameworks', 'http' => [ 'method' => 'GET', 'requestUri' => '/assessmentFrameworks', ], 'input' => [ 'shape' => 'ListAssessmentFrameworksRequest', ], 'output' => [ 'shape' => 'ListAssessmentFrameworksResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListAssessmentReports' => [ 'name' => 'ListAssessmentReports', 'http' => [ 'method' => 'GET', 'requestUri' => '/assessmentReports', ], 'input' => [ 'shape' => 'ListAssessmentReportsRequest', ], 'output' => [ 'shape' => 'ListAssessmentReportsResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListAssessments' => [ 'name' => 'ListAssessments', 'http' => [ 'method' => 'GET', 'requestUri' => '/assessments', ], 'input' => [ 'shape' => 'ListAssessmentsRequest', ], 'output' => [ 'shape' => 'ListAssessmentsResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListControlDomainInsights' => [ 'name' => 'ListControlDomainInsights', 'http' => [ 'method' => 'GET', 'requestUri' => '/insights/control-domains', ], 'input' => [ 'shape' => 'ListControlDomainInsightsRequest', ], 'output' => [ 'shape' => 'ListControlDomainInsightsResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], ], ], 'ListControlDomainInsightsByAssessment' => [ 'name' => 'ListControlDomainInsightsByAssessment', 'http' => [ 'method' => 'GET', 'requestUri' => '/insights/control-domains-by-assessment', ], 'input' => [ 'shape' => 'ListControlDomainInsightsByAssessmentRequest', ], 'output' => [ 'shape' => 'ListControlDomainInsightsByAssessmentResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListControlInsightsByControlDomain' => [ 'name' => 'ListControlInsightsByControlDomain', 'http' => [ 'method' => 'GET', 'requestUri' => '/insights/controls', ], 'input' => [ 'shape' => 'ListControlInsightsByControlDomainRequest', ], 'output' => [ 'shape' => 'ListControlInsightsByControlDomainResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], ], ], 'ListControls' => [ 'name' => 'ListControls', 'http' => [ 'method' => 'GET', 'requestUri' => '/controls', ], 'input' => [ 'shape' => 'ListControlsRequest', ], 'output' => [ 'shape' => 'ListControlsResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListKeywordsForDataSource' => [ 'name' => 'ListKeywordsForDataSource', 'http' => [ 'method' => 'GET', 'requestUri' => '/dataSourceKeywords', ], 'input' => [ 'shape' => 'ListKeywordsForDataSourceRequest', ], 'output' => [ 'shape' => 'ListKeywordsForDataSourceResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListNotifications' => [ 'name' => 'ListNotifications', 'http' => [ 'method' => 'GET', 'requestUri' => '/notifications', ], 'input' => [ 'shape' => 'ListNotificationsRequest', ], 'output' => [ 'shape' => 'ListNotificationsResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags/{resourceArn}', ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'RegisterAccount' => [ 'name' => 'RegisterAccount', 'http' => [ 'method' => 'POST', 'requestUri' => '/account/registerAccount', ], 'input' => [ 'shape' => 'RegisterAccountRequest', ], 'output' => [ 'shape' => 'RegisterAccountResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'RegisterOrganizationAdminAccount' => [ 'name' => 'RegisterOrganizationAdminAccount', 'http' => [ 'method' => 'POST', 'requestUri' => '/account/registerOrganizationAdminAccount', ], 'input' => [ 'shape' => 'RegisterOrganizationAdminAccountRequest', ], 'output' => [ 'shape' => 'RegisterOrganizationAdminAccountResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'StartAssessmentFrameworkShare' => [ 'name' => 'StartAssessmentFrameworkShare', 'http' => [ 'method' => 'POST', 'requestUri' => '/assessmentFrameworks/{frameworkId}/shareRequests', ], 'input' => [ 'shape' => 'StartAssessmentFrameworkShareRequest', ], 'output' => [ 'shape' => 'StartAssessmentFrameworkShareResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags/{resourceArn}', ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/tags/{resourceArn}', ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UpdateAssessment' => [ 'name' => 'UpdateAssessment', 'http' => [ 'method' => 'PUT', 'requestUri' => '/assessments/{assessmentId}', ], 'input' => [ 'shape' => 'UpdateAssessmentRequest', ], 'output' => [ 'shape' => 'UpdateAssessmentResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UpdateAssessmentControl' => [ 'name' => 'UpdateAssessmentControl', 'http' => [ 'method' => 'PUT', 'requestUri' => '/assessments/{assessmentId}/controlSets/{controlSetId}/controls/{controlId}', ], 'input' => [ 'shape' => 'UpdateAssessmentControlRequest', ], 'output' => [ 'shape' => 'UpdateAssessmentControlResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UpdateAssessmentControlSetStatus' => [ 'name' => 'UpdateAssessmentControlSetStatus', 'http' => [ 'method' => 'PUT', 'requestUri' => '/assessments/{assessmentId}/controlSets/{controlSetId}/status', ], 'input' => [ 'shape' => 'UpdateAssessmentControlSetStatusRequest', ], 'output' => [ 'shape' => 'UpdateAssessmentControlSetStatusResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UpdateAssessmentFramework' => [ 'name' => 'UpdateAssessmentFramework', 'http' => [ 'method' => 'PUT', 'requestUri' => '/assessmentFrameworks/{frameworkId}', ], 'input' => [ 'shape' => 'UpdateAssessmentFrameworkRequest', ], 'output' => [ 'shape' => 'UpdateAssessmentFrameworkResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UpdateAssessmentFrameworkShare' => [ 'name' => 'UpdateAssessmentFrameworkShare', 'http' => [ 'method' => 'PUT', 'requestUri' => '/assessmentFrameworkShareRequests/{requestId}', ], 'input' => [ 'shape' => 'UpdateAssessmentFrameworkShareRequest', ], 'output' => [ 'shape' => 'UpdateAssessmentFrameworkShareResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], ], 'UpdateAssessmentStatus' => [ 'name' => 'UpdateAssessmentStatus', 'http' => [ 'method' => 'PUT', 'requestUri' => '/assessments/{assessmentId}/status', ], 'input' => [ 'shape' => 'UpdateAssessmentStatusRequest', ], 'output' => [ 'shape' => 'UpdateAssessmentStatusResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ServiceQuotaExceededException', ], ], ], 'UpdateControl' => [ 'name' => 'UpdateControl', 'http' => [ 'method' => 'PUT', 'requestUri' => '/controls/{controlId}', ], 'input' => [ 'shape' => 'UpdateControlRequest', ], 'output' => [ 'shape' => 'UpdateControlResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'UpdateSettings' => [ 'name' => 'UpdateSettings', 'http' => [ 'method' => 'PUT', 'requestUri' => '/settings', ], 'input' => [ 'shape' => 'UpdateSettingsRequest', ], 'output' => [ 'shape' => 'UpdateSettingsResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ValidateAssessmentReportIntegrity' => [ 'name' => 'ValidateAssessmentReportIntegrity', 'http' => [ 'method' => 'POST', 'requestUri' => '/assessmentReports/integrity', ], 'input' => [ 'shape' => 'ValidateAssessmentReportIntegrityRequest', ], 'output' => [ 'shape' => 'ValidateAssessmentReportIntegrityResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], ], 'shapes' => [ 'AWSAccount' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'AccountId', ], 'emailAddress' => [ 'shape' => 'EmailAddress', ], 'name' => [ 'shape' => 'AccountName', ], ], ], 'AWSAccounts' => [ 'type' => 'list', 'member' => [ 'shape' => 'AWSAccount', ], ], 'AWSService' => [ 'type' => 'structure', 'members' => [ 'serviceName' => [ 'shape' => 'AWSServiceName', ], ], ], 'AWSServiceName' => [ 'type' => 'string', 'max' => 40, 'min' => 1, 'pattern' => '^[a-zA-Z0-9-\\\\s().]+$', ], 'AWSServices' => [ 'type' => 'list', 'member' => [ 'shape' => 'AWSService', ], ], 'AccessDeniedException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 403, ], 'exception' => true, ], 'AccountId' => [ 'type' => 'string', 'max' => 12, 'min' => 12, 'pattern' => '^[0-9]{12}$', ], 'AccountName' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'pattern' => '^[\\\\u0020-\\\\u007E]+$', ], 'AccountStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'INACTIVE', 'PENDING_ACTIVATION', ], ], 'ActionEnum' => [ 'type' => 'string', 'enum' => [ 'CREATE', 'UPDATE_METADATA', 'ACTIVE', 'INACTIVE', 'DELETE', 'UNDER_REVIEW', 'REVIEWED', 'IMPORT_EVIDENCE', ], ], 'ActionPlanInstructions' => [ 'type' => 'string', 'max' => 1000, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'ActionPlanTitle' => [ 'type' => 'string', 'max' => 300, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'Assessment' => [ 'type' => 'structure', 'members' => [ 'arn' => [ 'shape' => 'AuditManagerArn', ], 'awsAccount' => [ 'shape' => 'AWSAccount', ], 'metadata' => [ 'shape' => 'AssessmentMetadata', ], 'framework' => [ 'shape' => 'AssessmentFramework', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'AssessmentControl' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'UUID', ], 'name' => [ 'shape' => 'ControlName', ], 'description' => [ 'shape' => 'ControlDescription', ], 'status' => [ 'shape' => 'ControlStatus', ], 'response' => [ 'shape' => 'ControlResponse', ], 'comments' => [ 'shape' => 'ControlComments', ], 'evidenceSources' => [ 'shape' => 'EvidenceSources', ], 'evidenceCount' => [ 'shape' => 'Integer', ], 'assessmentReportEvidenceCount' => [ 'shape' => 'Integer', ], ], ], 'AssessmentControlSet' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'ControlSetId', ], 'description' => [ 'shape' => 'NonEmptyString', ], 'status' => [ 'shape' => 'ControlSetStatus', ], 'roles' => [ 'shape' => 'Roles', ], 'controls' => [ 'shape' => 'AssessmentControls', ], 'delegations' => [ 'shape' => 'Delegations', ], 'systemEvidenceCount' => [ 'shape' => 'Integer', ], 'manualEvidenceCount' => [ 'shape' => 'Integer', ], ], ], 'AssessmentControlSets' => [ 'type' => 'list', 'member' => [ 'shape' => 'AssessmentControlSet', ], ], 'AssessmentControls' => [ 'type' => 'list', 'member' => [ 'shape' => 'AssessmentControl', ], ], 'AssessmentDescription' => [ 'type' => 'string', 'max' => 1000, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'AssessmentEvidenceFolder' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'AssessmentEvidenceFolderName', ], 'date' => [ 'shape' => 'Timestamp', ], 'assessmentId' => [ 'shape' => 'UUID', ], 'controlSetId' => [ 'shape' => 'ControlSetId', ], 'controlId' => [ 'shape' => 'UUID', ], 'id' => [ 'shape' => 'UUID', ], 'dataSource' => [ 'shape' => 'String', ], 'author' => [ 'shape' => 'String', ], 'totalEvidence' => [ 'shape' => 'Integer', ], 'assessmentReportSelectionCount' => [ 'shape' => 'Integer', ], 'controlName' => [ 'shape' => 'ControlName', ], 'evidenceResourcesIncludedCount' => [ 'shape' => 'Integer', ], 'evidenceByTypeConfigurationDataCount' => [ 'shape' => 'Integer', ], 'evidenceByTypeManualCount' => [ 'shape' => 'Integer', ], 'evidenceByTypeComplianceCheckCount' => [ 'shape' => 'Integer', ], 'evidenceByTypeComplianceCheckIssuesCount' => [ 'shape' => 'Integer', ], 'evidenceByTypeUserActivityCount' => [ 'shape' => 'Integer', ], 'evidenceAwsServiceSourceCount' => [ 'shape' => 'Integer', ], ], ], 'AssessmentEvidenceFolderName' => [ 'type' => 'string', 'max' => 300, 'min' => 1, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'AssessmentEvidenceFolders' => [ 'type' => 'list', 'member' => [ 'shape' => 'AssessmentEvidenceFolder', ], ], 'AssessmentFramework' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'UUID', ], 'arn' => [ 'shape' => 'AuditManagerArn', ], 'metadata' => [ 'shape' => 'FrameworkMetadata', ], 'controlSets' => [ 'shape' => 'AssessmentControlSets', ], ], ], 'AssessmentFrameworkDescription' => [ 'type' => 'string', 'max' => 200, 'min' => 1, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'AssessmentFrameworkMetadata' => [ 'type' => 'structure', 'members' => [ 'arn' => [ 'shape' => 'AuditManagerArn', ], 'id' => [ 'shape' => 'UUID', ], 'type' => [ 'shape' => 'FrameworkType', ], 'name' => [ 'shape' => 'FrameworkName', ], 'description' => [ 'shape' => 'FrameworkDescription', ], 'logo' => [ 'shape' => 'Filename', ], 'complianceType' => [ 'shape' => 'ComplianceType', ], 'controlsCount' => [ 'shape' => 'ControlsCount', ], 'controlSetsCount' => [ 'shape' => 'ControlSetsCount', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'lastUpdatedAt' => [ 'shape' => 'Timestamp', ], ], ], 'AssessmentFrameworkShareRequest' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'UUID', ], 'frameworkId' => [ 'shape' => 'UUID', ], 'frameworkName' => [ 'shape' => 'FrameworkName', ], 'frameworkDescription' => [ 'shape' => 'FrameworkDescription', ], 'status' => [ 'shape' => 'ShareRequestStatus', ], 'sourceAccount' => [ 'shape' => 'AccountId', ], 'destinationAccount' => [ 'shape' => 'AccountId', ], 'destinationRegion' => [ 'shape' => 'Region', ], 'expirationTime' => [ 'shape' => 'Timestamp', ], 'creationTime' => [ 'shape' => 'Timestamp', ], 'lastUpdated' => [ 'shape' => 'Timestamp', ], 'comment' => [ 'shape' => 'ShareRequestComment', ], 'standardControlsCount' => [ 'shape' => 'NullableInteger', ], 'customControlsCount' => [ 'shape' => 'NullableInteger', ], 'complianceType' => [ 'shape' => 'ComplianceType', ], ], ], 'AssessmentFrameworkShareRequestList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AssessmentFrameworkShareRequest', ], ], 'AssessmentMetadata' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'AssessmentName', ], 'id' => [ 'shape' => 'UUID', ], 'description' => [ 'shape' => 'AssessmentDescription', ], 'complianceType' => [ 'shape' => 'ComplianceType', ], 'status' => [ 'shape' => 'AssessmentStatus', ], 'assessmentReportsDestination' => [ 'shape' => 'AssessmentReportsDestination', ], 'scope' => [ 'shape' => 'Scope', ], 'roles' => [ 'shape' => 'Roles', ], 'delegations' => [ 'shape' => 'Delegations', ], 'creationTime' => [ 'shape' => 'Timestamp', ], 'lastUpdated' => [ 'shape' => 'Timestamp', ], ], ], 'AssessmentMetadataItem' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'AssessmentName', ], 'id' => [ 'shape' => 'UUID', ], 'complianceType' => [ 'shape' => 'ComplianceType', ], 'status' => [ 'shape' => 'AssessmentStatus', ], 'roles' => [ 'shape' => 'Roles', ], 'delegations' => [ 'shape' => 'Delegations', ], 'creationTime' => [ 'shape' => 'Timestamp', ], 'lastUpdated' => [ 'shape' => 'Timestamp', ], ], ], 'AssessmentName' => [ 'type' => 'string', 'max' => 300, 'min' => 1, 'pattern' => '^[^\\\\\\\\]*$', ], 'AssessmentReport' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'UUID', ], 'name' => [ 'shape' => 'AssessmentReportName', ], 'description' => [ 'shape' => 'AssessmentReportDescription', ], 'awsAccountId' => [ 'shape' => 'AccountId', ], 'assessmentId' => [ 'shape' => 'UUID', ], 'assessmentName' => [ 'shape' => 'AssessmentName', ], 'author' => [ 'shape' => 'Username', ], 'status' => [ 'shape' => 'AssessmentReportStatus', ], 'creationTime' => [ 'shape' => 'Timestamp', ], ], ], 'AssessmentReportDescription' => [ 'type' => 'string', 'max' => 1000, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'AssessmentReportDestinationType' => [ 'type' => 'string', 'enum' => [ 'S3', ], ], 'AssessmentReportEvidenceError' => [ 'type' => 'structure', 'members' => [ 'evidenceId' => [ 'shape' => 'UUID', ], 'errorCode' => [ 'shape' => 'ErrorCode', ], 'errorMessage' => [ 'shape' => 'ErrorMessage', ], ], ], 'AssessmentReportEvidenceErrors' => [ 'type' => 'list', 'member' => [ 'shape' => 'AssessmentReportEvidenceError', ], ], 'AssessmentReportMetadata' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'UUID', ], 'name' => [ 'shape' => 'AssessmentReportName', ], 'description' => [ 'shape' => 'AssessmentReportDescription', ], 'assessmentId' => [ 'shape' => 'UUID', ], 'assessmentName' => [ 'shape' => 'AssessmentName', ], 'author' => [ 'shape' => 'Username', ], 'status' => [ 'shape' => 'AssessmentReportStatus', ], 'creationTime' => [ 'shape' => 'Timestamp', ], ], ], 'AssessmentReportName' => [ 'type' => 'string', 'max' => 300, 'min' => 1, 'pattern' => '^[a-zA-Z0-9-_\\\\.]+$', ], 'AssessmentReportStatus' => [ 'type' => 'string', 'enum' => [ 'COMPLETE', 'IN_PROGRESS', 'FAILED', ], ], 'AssessmentReportsDestination' => [ 'type' => 'structure', 'members' => [ 'destinationType' => [ 'shape' => 'AssessmentReportDestinationType', ], 'destination' => [ 'shape' => 'S3Url', ], ], ], 'AssessmentReportsMetadata' => [ 'type' => 'list', 'member' => [ 'shape' => 'AssessmentReportMetadata', ], ], 'AssessmentStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'INACTIVE', ], ], 'AssociateAssessmentReportEvidenceFolderRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', 'evidenceFolderId', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'evidenceFolderId' => [ 'shape' => 'UUID', ], ], ], 'AssociateAssessmentReportEvidenceFolderResponse' => [ 'type' => 'structure', 'members' => [], ], 'AuditManagerArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 20, 'pattern' => '^arn:.*:auditmanager:.*', ], 'BatchAssociateAssessmentReportEvidenceRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', 'evidenceFolderId', 'evidenceIds', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'evidenceFolderId' => [ 'shape' => 'UUID', ], 'evidenceIds' => [ 'shape' => 'EvidenceIds', ], ], ], 'BatchAssociateAssessmentReportEvidenceResponse' => [ 'type' => 'structure', 'members' => [ 'evidenceIds' => [ 'shape' => 'EvidenceIds', ], 'errors' => [ 'shape' => 'AssessmentReportEvidenceErrors', ], ], ], 'BatchCreateDelegationByAssessmentError' => [ 'type' => 'structure', 'members' => [ 'createDelegationRequest' => [ 'shape' => 'CreateDelegationRequest', ], 'errorCode' => [ 'shape' => 'ErrorCode', ], 'errorMessage' => [ 'shape' => 'ErrorMessage', ], ], ], 'BatchCreateDelegationByAssessmentErrors' => [ 'type' => 'list', 'member' => [ 'shape' => 'BatchCreateDelegationByAssessmentError', ], ], 'BatchCreateDelegationByAssessmentRequest' => [ 'type' => 'structure', 'required' => [ 'createDelegationRequests', 'assessmentId', ], 'members' => [ 'createDelegationRequests' => [ 'shape' => 'CreateDelegationRequests', ], 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], ], ], 'BatchCreateDelegationByAssessmentResponse' => [ 'type' => 'structure', 'members' => [ 'delegations' => [ 'shape' => 'Delegations', ], 'errors' => [ 'shape' => 'BatchCreateDelegationByAssessmentErrors', ], ], ], 'BatchDeleteDelegationByAssessmentError' => [ 'type' => 'structure', 'members' => [ 'delegationId' => [ 'shape' => 'UUID', ], 'errorCode' => [ 'shape' => 'ErrorCode', ], 'errorMessage' => [ 'shape' => 'ErrorMessage', ], ], ], 'BatchDeleteDelegationByAssessmentErrors' => [ 'type' => 'list', 'member' => [ 'shape' => 'BatchDeleteDelegationByAssessmentError', ], ], 'BatchDeleteDelegationByAssessmentRequest' => [ 'type' => 'structure', 'required' => [ 'delegationIds', 'assessmentId', ], 'members' => [ 'delegationIds' => [ 'shape' => 'DelegationIds', ], 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], ], ], 'BatchDeleteDelegationByAssessmentResponse' => [ 'type' => 'structure', 'members' => [ 'errors' => [ 'shape' => 'BatchDeleteDelegationByAssessmentErrors', ], ], ], 'BatchDisassociateAssessmentReportEvidenceRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', 'evidenceFolderId', 'evidenceIds', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'evidenceFolderId' => [ 'shape' => 'UUID', ], 'evidenceIds' => [ 'shape' => 'EvidenceIds', ], ], ], 'BatchDisassociateAssessmentReportEvidenceResponse' => [ 'type' => 'structure', 'members' => [ 'evidenceIds' => [ 'shape' => 'EvidenceIds', ], 'errors' => [ 'shape' => 'AssessmentReportEvidenceErrors', ], ], ], 'BatchImportEvidenceToAssessmentControlError' => [ 'type' => 'structure', 'members' => [ 'manualEvidence' => [ 'shape' => 'ManualEvidence', ], 'errorCode' => [ 'shape' => 'ErrorCode', ], 'errorMessage' => [ 'shape' => 'ErrorMessage', ], ], ], 'BatchImportEvidenceToAssessmentControlErrors' => [ 'type' => 'list', 'member' => [ 'shape' => 'BatchImportEvidenceToAssessmentControlError', ], ], 'BatchImportEvidenceToAssessmentControlRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', 'controlSetId', 'controlId', 'manualEvidence', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'controlSetId' => [ 'shape' => 'ControlSetId', 'location' => 'uri', 'locationName' => 'controlSetId', ], 'controlId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'controlId', ], 'manualEvidence' => [ 'shape' => 'ManualEvidenceList', ], ], ], 'BatchImportEvidenceToAssessmentControlResponse' => [ 'type' => 'structure', 'members' => [ 'errors' => [ 'shape' => 'BatchImportEvidenceToAssessmentControlErrors', ], ], ], 'Boolean' => [ 'type' => 'boolean', ], 'ChangeLog' => [ 'type' => 'structure', 'members' => [ 'objectType' => [ 'shape' => 'ObjectTypeEnum', ], 'objectName' => [ 'shape' => 'NonEmptyString', ], 'action' => [ 'shape' => 'ActionEnum', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'createdBy' => [ 'shape' => 'IamArn', ], ], ], 'ChangeLogs' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChangeLog', ], ], 'CloudTrailArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 20, 'pattern' => '^arn:.*:cloudtrail:.*', ], 'ComplianceType' => [ 'type' => 'string', 'max' => 100, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'Control' => [ 'type' => 'structure', 'members' => [ 'arn' => [ 'shape' => 'AuditManagerArn', ], 'id' => [ 'shape' => 'UUID', ], 'type' => [ 'shape' => 'ControlType', ], 'name' => [ 'shape' => 'ControlName', ], 'description' => [ 'shape' => 'ControlDescription', ], 'testingInformation' => [ 'shape' => 'TestingInformation', ], 'actionPlanTitle' => [ 'shape' => 'ActionPlanTitle', ], 'actionPlanInstructions' => [ 'shape' => 'ActionPlanInstructions', ], 'controlSources' => [ 'shape' => 'ControlSources', ], 'controlMappingSources' => [ 'shape' => 'ControlMappingSources', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'lastUpdatedAt' => [ 'shape' => 'Timestamp', ], 'createdBy' => [ 'shape' => 'CreatedBy', ], 'lastUpdatedBy' => [ 'shape' => 'LastUpdatedBy', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'ControlComment' => [ 'type' => 'structure', 'members' => [ 'authorName' => [ 'shape' => 'Username', ], 'commentBody' => [ 'shape' => 'ControlCommentBody', ], 'postedDate' => [ 'shape' => 'Timestamp', ], ], ], 'ControlCommentBody' => [ 'type' => 'string', 'max' => 500, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'ControlComments' => [ 'type' => 'list', 'member' => [ 'shape' => 'ControlComment', ], ], 'ControlDescription' => [ 'type' => 'string', 'max' => 1000, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'ControlDomainInsights' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'NonEmptyString', ], 'id' => [ 'shape' => 'UUID', ], 'controlsCountByNoncompliantEvidence' => [ 'shape' => 'NullableInteger', ], 'totalControlsCount' => [ 'shape' => 'NullableInteger', ], 'evidenceInsights' => [ 'shape' => 'EvidenceInsights', ], 'lastUpdated' => [ 'shape' => 'Timestamp', ], ], ], 'ControlDomainInsightsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ControlDomainInsights', ], ], 'ControlInsightsMetadata' => [ 'type' => 'list', 'member' => [ 'shape' => 'ControlInsightsMetadataItem', ], ], 'ControlInsightsMetadataByAssessment' => [ 'type' => 'list', 'member' => [ 'shape' => 'ControlInsightsMetadataByAssessmentItem', ], ], 'ControlInsightsMetadataByAssessmentItem' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'NonEmptyString', ], 'id' => [ 'shape' => 'UUID', ], 'evidenceInsights' => [ 'shape' => 'EvidenceInsights', ], 'controlSetName' => [ 'shape' => 'NonEmptyString', ], 'lastUpdated' => [ 'shape' => 'Timestamp', ], ], ], 'ControlInsightsMetadataItem' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'NonEmptyString', ], 'id' => [ 'shape' => 'UUID', ], 'evidenceInsights' => [ 'shape' => 'EvidenceInsights', ], 'lastUpdated' => [ 'shape' => 'Timestamp', ], ], ], 'ControlMappingSource' => [ 'type' => 'structure', 'members' => [ 'sourceId' => [ 'shape' => 'UUID', ], 'sourceName' => [ 'shape' => 'SourceName', ], 'sourceDescription' => [ 'shape' => 'SourceDescription', ], 'sourceSetUpOption' => [ 'shape' => 'SourceSetUpOption', ], 'sourceType' => [ 'shape' => 'SourceType', ], 'sourceKeyword' => [ 'shape' => 'SourceKeyword', ], 'sourceFrequency' => [ 'shape' => 'SourceFrequency', ], 'troubleshootingText' => [ 'shape' => 'TroubleshootingText', ], ], ], 'ControlMappingSources' => [ 'type' => 'list', 'member' => [ 'shape' => 'ControlMappingSource', ], 'min' => 1, ], 'ControlMetadata' => [ 'type' => 'structure', 'members' => [ 'arn' => [ 'shape' => 'AuditManagerArn', ], 'id' => [ 'shape' => 'UUID', ], 'name' => [ 'shape' => 'ControlName', ], 'controlSources' => [ 'shape' => 'ControlSources', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'lastUpdatedAt' => [ 'shape' => 'Timestamp', ], ], ], 'ControlMetadataList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ControlMetadata', ], ], 'ControlName' => [ 'type' => 'string', 'max' => 300, 'min' => 1, 'pattern' => '^[^\\\\\\\\]*$', ], 'ControlResponse' => [ 'type' => 'string', 'enum' => [ 'MANUAL', 'AUTOMATE', 'DEFER', 'IGNORE', ], ], 'ControlSet' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'UUID', ], 'name' => [ 'shape' => 'ControlSetName', ], 'controls' => [ 'shape' => 'Controls', ], ], ], 'ControlSetId' => [ 'type' => 'string', 'max' => 300, 'min' => 1, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'ControlSetName' => [ 'type' => 'string', 'max' => 300, 'min' => 1, 'pattern' => '^[^\\\\\\\\\\\\_]*$', ], 'ControlSetStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'UNDER_REVIEW', 'REVIEWED', ], ], 'ControlSets' => [ 'type' => 'list', 'member' => [ 'shape' => 'ControlSet', ], 'min' => 1, ], 'ControlSetsCount' => [ 'type' => 'integer', ], 'ControlSources' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '^[a-zA-Z_0-9-\\\\s.,]+$', ], 'ControlStatus' => [ 'type' => 'string', 'enum' => [ 'UNDER_REVIEW', 'REVIEWED', 'INACTIVE', ], ], 'ControlType' => [ 'type' => 'string', 'enum' => [ 'Standard', 'Custom', ], ], 'Controls' => [ 'type' => 'list', 'member' => [ 'shape' => 'Control', ], 'min' => 1, ], 'ControlsCount' => [ 'type' => 'integer', ], 'CreateAssessmentFrameworkControl' => [ 'type' => 'structure', 'required' => [ 'id', ], 'members' => [ 'id' => [ 'shape' => 'UUID', ], ], ], 'CreateAssessmentFrameworkControlSet' => [ 'type' => 'structure', 'required' => [ 'name', ], 'members' => [ 'name' => [ 'shape' => 'ControlSetName', ], 'controls' => [ 'shape' => 'CreateAssessmentFrameworkControls', ], ], ], 'CreateAssessmentFrameworkControlSets' => [ 'type' => 'list', 'member' => [ 'shape' => 'CreateAssessmentFrameworkControlSet', ], 'min' => 1, ], 'CreateAssessmentFrameworkControls' => [ 'type' => 'list', 'member' => [ 'shape' => 'CreateAssessmentFrameworkControl', ], 'min' => 1, ], 'CreateAssessmentFrameworkRequest' => [ 'type' => 'structure', 'required' => [ 'name', 'controlSets', ], 'members' => [ 'name' => [ 'shape' => 'FrameworkName', ], 'description' => [ 'shape' => 'FrameworkDescription', ], 'complianceType' => [ 'shape' => 'ComplianceType', ], 'controlSets' => [ 'shape' => 'CreateAssessmentFrameworkControlSets', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'CreateAssessmentFrameworkResponse' => [ 'type' => 'structure', 'members' => [ 'framework' => [ 'shape' => 'Framework', ], ], ], 'CreateAssessmentReportRequest' => [ 'type' => 'structure', 'required' => [ 'name', 'assessmentId', ], 'members' => [ 'name' => [ 'shape' => 'AssessmentReportName', ], 'description' => [ 'shape' => 'AssessmentReportDescription', ], 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'queryStatement' => [ 'shape' => 'QueryStatement', ], ], ], 'CreateAssessmentReportResponse' => [ 'type' => 'structure', 'members' => [ 'assessmentReport' => [ 'shape' => 'AssessmentReport', ], ], ], 'CreateAssessmentRequest' => [ 'type' => 'structure', 'required' => [ 'name', 'assessmentReportsDestination', 'scope', 'roles', 'frameworkId', ], 'members' => [ 'name' => [ 'shape' => 'AssessmentName', ], 'description' => [ 'shape' => 'AssessmentDescription', ], 'assessmentReportsDestination' => [ 'shape' => 'AssessmentReportsDestination', ], 'scope' => [ 'shape' => 'Scope', ], 'roles' => [ 'shape' => 'Roles', ], 'frameworkId' => [ 'shape' => 'UUID', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'CreateAssessmentResponse' => [ 'type' => 'structure', 'members' => [ 'assessment' => [ 'shape' => 'Assessment', ], ], ], 'CreateControlMappingSource' => [ 'type' => 'structure', 'members' => [ 'sourceName' => [ 'shape' => 'SourceName', ], 'sourceDescription' => [ 'shape' => 'SourceDescription', ], 'sourceSetUpOption' => [ 'shape' => 'SourceSetUpOption', ], 'sourceType' => [ 'shape' => 'SourceType', ], 'sourceKeyword' => [ 'shape' => 'SourceKeyword', ], 'sourceFrequency' => [ 'shape' => 'SourceFrequency', ], 'troubleshootingText' => [ 'shape' => 'TroubleshootingText', ], ], ], 'CreateControlMappingSources' => [ 'type' => 'list', 'member' => [ 'shape' => 'CreateControlMappingSource', ], 'min' => 1, ], 'CreateControlRequest' => [ 'type' => 'structure', 'required' => [ 'name', 'controlMappingSources', ], 'members' => [ 'name' => [ 'shape' => 'ControlName', ], 'description' => [ 'shape' => 'ControlDescription', ], 'testingInformation' => [ 'shape' => 'TestingInformation', ], 'actionPlanTitle' => [ 'shape' => 'ActionPlanTitle', ], 'actionPlanInstructions' => [ 'shape' => 'ActionPlanInstructions', ], 'controlMappingSources' => [ 'shape' => 'CreateControlMappingSources', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'CreateControlResponse' => [ 'type' => 'structure', 'members' => [ 'control' => [ 'shape' => 'Control', ], ], ], 'CreateDelegationRequest' => [ 'type' => 'structure', 'members' => [ 'comment' => [ 'shape' => 'DelegationComment', ], 'controlSetId' => [ 'shape' => 'ControlSetId', ], 'roleArn' => [ 'shape' => 'IamArn', ], 'roleType' => [ 'shape' => 'RoleType', ], ], ], 'CreateDelegationRequests' => [ 'type' => 'list', 'member' => [ 'shape' => 'CreateDelegationRequest', ], 'max' => 50, 'min' => 1, ], 'CreatedBy' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '^[a-zA-Z0-9\\\\s-_()\\\\[\\\\]]+$', ], 'DefaultExportDestination' => [ 'type' => 'structure', 'members' => [ 'destinationType' => [ 'shape' => 'ExportDestinationType', ], 'destination' => [ 'shape' => 'S3Url', ], ], ], 'Delegation' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'UUID', ], 'assessmentName' => [ 'shape' => 'AssessmentName', ], 'assessmentId' => [ 'shape' => 'UUID', ], 'status' => [ 'shape' => 'DelegationStatus', ], 'roleArn' => [ 'shape' => 'IamArn', ], 'roleType' => [ 'shape' => 'RoleType', ], 'creationTime' => [ 'shape' => 'Timestamp', ], 'lastUpdated' => [ 'shape' => 'Timestamp', ], 'controlSetId' => [ 'shape' => 'ControlSetId', ], 'comment' => [ 'shape' => 'DelegationComment', ], 'createdBy' => [ 'shape' => 'CreatedBy', ], ], ], 'DelegationComment' => [ 'type' => 'string', 'max' => 350, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'DelegationIds' => [ 'type' => 'list', 'member' => [ 'shape' => 'UUID', ], 'max' => 50, 'min' => 1, ], 'DelegationMetadata' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'UUID', ], 'assessmentName' => [ 'shape' => 'AssessmentName', ], 'assessmentId' => [ 'shape' => 'UUID', ], 'status' => [ 'shape' => 'DelegationStatus', ], 'roleArn' => [ 'shape' => 'IamArn', ], 'creationTime' => [ 'shape' => 'Timestamp', ], 'controlSetName' => [ 'shape' => 'NonEmptyString', ], ], ], 'DelegationMetadataList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DelegationMetadata', ], ], 'DelegationStatus' => [ 'type' => 'string', 'enum' => [ 'IN_PROGRESS', 'UNDER_REVIEW', 'COMPLETE', ], ], 'Delegations' => [ 'type' => 'list', 'member' => [ 'shape' => 'Delegation', ], ], 'DeleteAssessmentFrameworkRequest' => [ 'type' => 'structure', 'required' => [ 'frameworkId', ], 'members' => [ 'frameworkId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'frameworkId', ], ], ], 'DeleteAssessmentFrameworkResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteAssessmentFrameworkShareRequest' => [ 'type' => 'structure', 'required' => [ 'requestId', 'requestType', ], 'members' => [ 'requestId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'requestId', ], 'requestType' => [ 'shape' => 'ShareRequestType', 'location' => 'querystring', 'locationName' => 'requestType', ], ], ], 'DeleteAssessmentFrameworkShareResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteAssessmentReportRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', 'assessmentReportId', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'assessmentReportId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentReportId', ], ], ], 'DeleteAssessmentReportResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteAssessmentRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], ], ], 'DeleteAssessmentResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteControlRequest' => [ 'type' => 'structure', 'required' => [ 'controlId', ], 'members' => [ 'controlId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'controlId', ], ], ], 'DeleteControlResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteResources' => [ 'type' => 'string', 'enum' => [ 'ALL', 'DEFAULT', ], ], 'DeregisterAccountRequest' => [ 'type' => 'structure', 'members' => [], ], 'DeregisterAccountResponse' => [ 'type' => 'structure', 'members' => [ 'status' => [ 'shape' => 'AccountStatus', ], ], ], 'DeregisterOrganizationAdminAccountRequest' => [ 'type' => 'structure', 'members' => [ 'adminAccountId' => [ 'shape' => 'AccountId', ], ], ], 'DeregisterOrganizationAdminAccountResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeregistrationPolicy' => [ 'type' => 'structure', 'members' => [ 'deleteResources' => [ 'shape' => 'DeleteResources', ], ], ], 'DisassociateAssessmentReportEvidenceFolderRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', 'evidenceFolderId', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'evidenceFolderId' => [ 'shape' => 'UUID', ], ], ], 'DisassociateAssessmentReportEvidenceFolderResponse' => [ 'type' => 'structure', 'members' => [], ], 'EmailAddress' => [ 'type' => 'string', 'max' => 320, 'min' => 1, 'pattern' => '^.*@.*$', ], 'ErrorCode' => [ 'type' => 'string', 'max' => 3, 'min' => 3, 'pattern' => '[0-9]{3}', ], 'ErrorMessage' => [ 'type' => 'string', 'max' => 300, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'EventName' => [ 'type' => 'string', 'max' => 100, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'Evidence' => [ 'type' => 'structure', 'members' => [ 'dataSource' => [ 'shape' => 'String', ], 'evidenceAwsAccountId' => [ 'shape' => 'AccountId', ], 'time' => [ 'shape' => 'Timestamp', ], 'eventSource' => [ 'shape' => 'AWSServiceName', ], 'eventName' => [ 'shape' => 'EventName', ], 'evidenceByType' => [ 'shape' => 'String', ], 'resourcesIncluded' => [ 'shape' => 'Resources', ], 'attributes' => [ 'shape' => 'EvidenceAttributes', ], 'iamId' => [ 'shape' => 'IamArn', ], 'complianceCheck' => [ 'shape' => 'String', ], 'awsOrganization' => [ 'shape' => 'String', ], 'awsAccountId' => [ 'shape' => 'AccountId', ], 'evidenceFolderId' => [ 'shape' => 'UUID', ], 'id' => [ 'shape' => 'UUID', ], 'assessmentReportSelection' => [ 'shape' => 'String', ], ], ], 'EvidenceAttributeKey' => [ 'type' => 'string', 'max' => 100, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'EvidenceAttributeValue' => [ 'type' => 'string', 'max' => 200, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'EvidenceAttributes' => [ 'type' => 'map', 'key' => [ 'shape' => 'EvidenceAttributeKey', ], 'value' => [ 'shape' => 'EvidenceAttributeValue', ], ], 'EvidenceFinderBackfillStatus' => [ 'type' => 'string', 'enum' => [ 'NOT_STARTED', 'IN_PROGRESS', 'COMPLETED', ], ], 'EvidenceFinderEnablement' => [ 'type' => 'structure', 'members' => [ 'eventDataStoreArn' => [ 'shape' => 'CloudTrailArn', ], 'enablementStatus' => [ 'shape' => 'EvidenceFinderEnablementStatus', ], 'backfillStatus' => [ 'shape' => 'EvidenceFinderBackfillStatus', ], 'error' => [ 'shape' => 'ErrorMessage', ], ], ], 'EvidenceFinderEnablementStatus' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'DISABLED', 'ENABLE_IN_PROGRESS', 'DISABLE_IN_PROGRESS', ], ], 'EvidenceIds' => [ 'type' => 'list', 'member' => [ 'shape' => 'UUID', ], 'max' => 50, 'min' => 0, ], 'EvidenceInsights' => [ 'type' => 'structure', 'members' => [ 'noncompliantEvidenceCount' => [ 'shape' => 'NullableInteger', ], 'compliantEvidenceCount' => [ 'shape' => 'NullableInteger', ], 'inconclusiveEvidenceCount' => [ 'shape' => 'NullableInteger', ], ], ], 'EvidenceList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Evidence', ], ], 'EvidenceSources' => [ 'type' => 'list', 'member' => [ 'shape' => 'NonEmptyString', ], ], 'ExportDestinationType' => [ 'type' => 'string', 'enum' => [ 'S3', ], ], 'Filename' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '^[\\\\w,\\\\s-]+\\\\.[A-Za-z]+$', ], 'Framework' => [ 'type' => 'structure', 'members' => [ 'arn' => [ 'shape' => 'AuditManagerArn', ], 'id' => [ 'shape' => 'UUID', ], 'name' => [ 'shape' => 'FrameworkName', ], 'type' => [ 'shape' => 'FrameworkType', ], 'complianceType' => [ 'shape' => 'ComplianceType', ], 'description' => [ 'shape' => 'FrameworkDescription', ], 'logo' => [ 'shape' => 'Filename', ], 'controlSources' => [ 'shape' => 'ControlSources', ], 'controlSets' => [ 'shape' => 'ControlSets', ], 'createdAt' => [ 'shape' => 'Timestamp', ], 'lastUpdatedAt' => [ 'shape' => 'Timestamp', ], 'createdBy' => [ 'shape' => 'CreatedBy', ], 'lastUpdatedBy' => [ 'shape' => 'LastUpdatedBy', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'FrameworkDescription' => [ 'type' => 'string', 'max' => 1000, 'min' => 1, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'FrameworkMetadata' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'AssessmentName', ], 'description' => [ 'shape' => 'AssessmentFrameworkDescription', ], 'logo' => [ 'shape' => 'Filename', ], 'complianceType' => [ 'shape' => 'ComplianceType', ], ], ], 'FrameworkMetadataList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AssessmentFrameworkMetadata', ], ], 'FrameworkName' => [ 'type' => 'string', 'max' => 300, 'min' => 1, 'pattern' => '^[^\\\\\\\\]*$', ], 'FrameworkType' => [ 'type' => 'string', 'enum' => [ 'Standard', 'Custom', ], ], 'GenericArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 20, 'pattern' => '^arn:.*', ], 'GetAccountStatusRequest' => [ 'type' => 'structure', 'members' => [], ], 'GetAccountStatusResponse' => [ 'type' => 'structure', 'members' => [ 'status' => [ 'shape' => 'AccountStatus', ], ], ], 'GetAssessmentFrameworkRequest' => [ 'type' => 'structure', 'required' => [ 'frameworkId', ], 'members' => [ 'frameworkId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'frameworkId', ], ], ], 'GetAssessmentFrameworkResponse' => [ 'type' => 'structure', 'members' => [ 'framework' => [ 'shape' => 'Framework', ], ], ], 'GetAssessmentReportUrlRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentReportId', 'assessmentId', ], 'members' => [ 'assessmentReportId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentReportId', ], 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], ], ], 'GetAssessmentReportUrlResponse' => [ 'type' => 'structure', 'members' => [ 'preSignedUrl' => [ 'shape' => 'URL', ], ], ], 'GetAssessmentRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], ], ], 'GetAssessmentResponse' => [ 'type' => 'structure', 'members' => [ 'assessment' => [ 'shape' => 'Assessment', ], 'userRole' => [ 'shape' => 'Role', ], ], ], 'GetChangeLogsRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'controlSetId' => [ 'shape' => 'ControlSetId', 'location' => 'querystring', 'locationName' => 'controlSetId', ], 'controlId' => [ 'shape' => 'UUID', 'location' => 'querystring', 'locationName' => 'controlId', ], 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'GetChangeLogsResponse' => [ 'type' => 'structure', 'members' => [ 'changeLogs' => [ 'shape' => 'ChangeLogs', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'GetControlRequest' => [ 'type' => 'structure', 'required' => [ 'controlId', ], 'members' => [ 'controlId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'controlId', ], ], ], 'GetControlResponse' => [ 'type' => 'structure', 'members' => [ 'control' => [ 'shape' => 'Control', ], ], ], 'GetDelegationsRequest' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'GetDelegationsResponse' => [ 'type' => 'structure', 'members' => [ 'delegations' => [ 'shape' => 'DelegationMetadataList', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'GetEvidenceByEvidenceFolderRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', 'controlSetId', 'evidenceFolderId', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'controlSetId' => [ 'shape' => 'ControlSetId', 'location' => 'uri', 'locationName' => 'controlSetId', ], 'evidenceFolderId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'evidenceFolderId', ], 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'GetEvidenceByEvidenceFolderResponse' => [ 'type' => 'structure', 'members' => [ 'evidence' => [ 'shape' => 'EvidenceList', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'GetEvidenceFileUploadUrlRequest' => [ 'type' => 'structure', 'required' => [ 'fileName', ], 'members' => [ 'fileName' => [ 'shape' => 'ManualEvidenceLocalFileName', 'location' => 'querystring', 'locationName' => 'fileName', ], ], ], 'GetEvidenceFileUploadUrlResponse' => [ 'type' => 'structure', 'members' => [ 'evidenceFileName' => [ 'shape' => 'NonEmptyString', ], 'uploadUrl' => [ 'shape' => 'NonEmptyString', ], ], ], 'GetEvidenceFolderRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', 'controlSetId', 'evidenceFolderId', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'controlSetId' => [ 'shape' => 'ControlSetId', 'location' => 'uri', 'locationName' => 'controlSetId', ], 'evidenceFolderId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'evidenceFolderId', ], ], ], 'GetEvidenceFolderResponse' => [ 'type' => 'structure', 'members' => [ 'evidenceFolder' => [ 'shape' => 'AssessmentEvidenceFolder', ], ], ], 'GetEvidenceFoldersByAssessmentControlRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', 'controlSetId', 'controlId', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'controlSetId' => [ 'shape' => 'ControlSetId', 'location' => 'uri', 'locationName' => 'controlSetId', ], 'controlId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'controlId', ], 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'GetEvidenceFoldersByAssessmentControlResponse' => [ 'type' => 'structure', 'members' => [ 'evidenceFolders' => [ 'shape' => 'AssessmentEvidenceFolders', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'GetEvidenceFoldersByAssessmentRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'GetEvidenceFoldersByAssessmentResponse' => [ 'type' => 'structure', 'members' => [ 'evidenceFolders' => [ 'shape' => 'AssessmentEvidenceFolders', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'GetEvidenceRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', 'controlSetId', 'evidenceFolderId', 'evidenceId', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'controlSetId' => [ 'shape' => 'ControlSetId', 'location' => 'uri', 'locationName' => 'controlSetId', ], 'evidenceFolderId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'evidenceFolderId', ], 'evidenceId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'evidenceId', ], ], ], 'GetEvidenceResponse' => [ 'type' => 'structure', 'members' => [ 'evidence' => [ 'shape' => 'Evidence', ], ], ], 'GetInsightsByAssessmentRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], ], ], 'GetInsightsByAssessmentResponse' => [ 'type' => 'structure', 'members' => [ 'insights' => [ 'shape' => 'InsightsByAssessment', ], ], ], 'GetInsightsRequest' => [ 'type' => 'structure', 'members' => [], ], 'GetInsightsResponse' => [ 'type' => 'structure', 'members' => [ 'insights' => [ 'shape' => 'Insights', ], ], ], 'GetOrganizationAdminAccountRequest' => [ 'type' => 'structure', 'members' => [], ], 'GetOrganizationAdminAccountResponse' => [ 'type' => 'structure', 'members' => [ 'adminAccountId' => [ 'shape' => 'AccountId', ], 'organizationId' => [ 'shape' => 'organizationId', ], ], ], 'GetServicesInScopeRequest' => [ 'type' => 'structure', 'members' => [], ], 'GetServicesInScopeResponse' => [ 'type' => 'structure', 'members' => [ 'serviceMetadata' => [ 'shape' => 'ServiceMetadataList', ], ], ], 'GetSettingsRequest' => [ 'type' => 'structure', 'required' => [ 'attribute', ], 'members' => [ 'attribute' => [ 'shape' => 'SettingAttribute', 'location' => 'uri', 'locationName' => 'attribute', ], ], ], 'GetSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'settings' => [ 'shape' => 'Settings', ], ], ], 'HyperlinkName' => [ 'type' => 'string', 'max' => 200, 'min' => 1, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'IamArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 20, 'pattern' => '^arn:.*:iam:.*', ], 'Insights' => [ 'type' => 'structure', 'members' => [ 'activeAssessmentsCount' => [ 'shape' => 'NullableInteger', ], 'noncompliantEvidenceCount' => [ 'shape' => 'NullableInteger', ], 'compliantEvidenceCount' => [ 'shape' => 'NullableInteger', ], 'inconclusiveEvidenceCount' => [ 'shape' => 'NullableInteger', ], 'assessmentControlsCountByNoncompliantEvidence' => [ 'shape' => 'NullableInteger', ], 'totalAssessmentControlsCount' => [ 'shape' => 'NullableInteger', ], 'lastUpdated' => [ 'shape' => 'Timestamp', ], ], ], 'InsightsByAssessment' => [ 'type' => 'structure', 'members' => [ 'noncompliantEvidenceCount' => [ 'shape' => 'NullableInteger', ], 'compliantEvidenceCount' => [ 'shape' => 'NullableInteger', ], 'inconclusiveEvidenceCount' => [ 'shape' => 'NullableInteger', ], 'assessmentControlsCountByNoncompliantEvidence' => [ 'shape' => 'NullableInteger', ], 'totalAssessmentControlsCount' => [ 'shape' => 'NullableInteger', ], 'lastUpdated' => [ 'shape' => 'Timestamp', ], ], ], 'Integer' => [ 'type' => 'integer', ], 'InternalServerException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'KeywordInputType' => [ 'type' => 'string', 'enum' => [ 'SELECT_FROM_LIST', 'UPLOAD_FILE', 'INPUT_TEXT', ], ], 'KeywordValue' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '^[a-zA-Z_0-9-\\\\s().]+$', ], 'Keywords' => [ 'type' => 'list', 'member' => [ 'shape' => 'KeywordValue', ], ], 'KmsKey' => [ 'type' => 'string', 'max' => 2048, 'min' => 7, 'pattern' => '^arn:.*:kms:.*|DEFAULT', ], 'LastUpdatedBy' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '^[a-zA-Z0-9\\\\s-_()\\\\[\\\\]]+$', ], 'ListAssessmentControlInsightsByControlDomainRequest' => [ 'type' => 'structure', 'required' => [ 'controlDomainId', 'assessmentId', ], 'members' => [ 'controlDomainId' => [ 'shape' => 'UUID', 'location' => 'querystring', 'locationName' => 'controlDomainId', ], 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'querystring', 'locationName' => 'assessmentId', ], 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListAssessmentControlInsightsByControlDomainResponse' => [ 'type' => 'structure', 'members' => [ 'controlInsightsByAssessment' => [ 'shape' => 'ControlInsightsMetadataByAssessment', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListAssessmentFrameworkShareRequestsRequest' => [ 'type' => 'structure', 'required' => [ 'requestType', ], 'members' => [ 'requestType' => [ 'shape' => 'ShareRequestType', 'location' => 'querystring', 'locationName' => 'requestType', ], 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListAssessmentFrameworkShareRequestsResponse' => [ 'type' => 'structure', 'members' => [ 'assessmentFrameworkShareRequests' => [ 'shape' => 'AssessmentFrameworkShareRequestList', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListAssessmentFrameworksRequest' => [ 'type' => 'structure', 'required' => [ 'frameworkType', ], 'members' => [ 'frameworkType' => [ 'shape' => 'FrameworkType', 'location' => 'querystring', 'locationName' => 'frameworkType', ], 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListAssessmentFrameworksResponse' => [ 'type' => 'structure', 'members' => [ 'frameworkMetadataList' => [ 'shape' => 'FrameworkMetadataList', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListAssessmentMetadata' => [ 'type' => 'list', 'member' => [ 'shape' => 'AssessmentMetadataItem', ], ], 'ListAssessmentReportsRequest' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListAssessmentReportsResponse' => [ 'type' => 'structure', 'members' => [ 'assessmentReports' => [ 'shape' => 'AssessmentReportsMetadata', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListAssessmentsRequest' => [ 'type' => 'structure', 'members' => [ 'status' => [ 'shape' => 'AssessmentStatus', 'location' => 'querystring', 'locationName' => 'status', ], 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListAssessmentsResponse' => [ 'type' => 'structure', 'members' => [ 'assessmentMetadata' => [ 'shape' => 'ListAssessmentMetadata', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListControlDomainInsightsByAssessmentRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'querystring', 'locationName' => 'assessmentId', ], 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListControlDomainInsightsByAssessmentResponse' => [ 'type' => 'structure', 'members' => [ 'controlDomainInsights' => [ 'shape' => 'ControlDomainInsightsList', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListControlDomainInsightsRequest' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListControlDomainInsightsResponse' => [ 'type' => 'structure', 'members' => [ 'controlDomainInsights' => [ 'shape' => 'ControlDomainInsightsList', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListControlInsightsByControlDomainRequest' => [ 'type' => 'structure', 'required' => [ 'controlDomainId', ], 'members' => [ 'controlDomainId' => [ 'shape' => 'UUID', 'location' => 'querystring', 'locationName' => 'controlDomainId', ], 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListControlInsightsByControlDomainResponse' => [ 'type' => 'structure', 'members' => [ 'controlInsightsMetadata' => [ 'shape' => 'ControlInsightsMetadata', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListControlsRequest' => [ 'type' => 'structure', 'required' => [ 'controlType', ], 'members' => [ 'controlType' => [ 'shape' => 'ControlType', 'location' => 'querystring', 'locationName' => 'controlType', ], 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListControlsResponse' => [ 'type' => 'structure', 'members' => [ 'controlMetadataList' => [ 'shape' => 'ControlMetadataList', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListKeywordsForDataSourceRequest' => [ 'type' => 'structure', 'required' => [ 'source', ], 'members' => [ 'source' => [ 'shape' => 'SourceType', 'location' => 'querystring', 'locationName' => 'source', ], 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListKeywordsForDataSourceResponse' => [ 'type' => 'structure', 'members' => [ 'keywords' => [ 'shape' => 'Keywords', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListNotificationsRequest' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'Token', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListNotificationsResponse' => [ 'type' => 'structure', 'members' => [ 'notifications' => [ 'shape' => 'Notifications', ], 'nextToken' => [ 'shape' => 'Token', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', ], 'members' => [ 'resourceArn' => [ 'shape' => 'AuditManagerArn', 'location' => 'uri', 'locationName' => 'resourceArn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'tags' => [ 'shape' => 'TagMap', ], ], ], 'ManualEvidence' => [ 'type' => 'structure', 'members' => [ 's3ResourcePath' => [ 'shape' => 'S3Url', ], 'textResponse' => [ 'shape' => 'ManualEvidenceTextResponse', ], 'evidenceFileName' => [ 'shape' => 'ManualEvidenceLocalFileName', ], ], ], 'ManualEvidenceList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ManualEvidence', ], 'max' => 50, 'min' => 1, ], 'ManualEvidenceLocalFileName' => [ 'type' => 'string', 'max' => 300, 'min' => 1, 'pattern' => '[^\\\\/]*', ], 'ManualEvidenceTextResponse' => [ 'type' => 'string', 'max' => 1000, 'min' => 1, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'MaxResults' => [ 'type' => 'integer', 'max' => 1000, 'min' => 1, ], 'NonEmptyString' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, 'pattern' => '.*\\\\S.*', ], 'Notification' => [ 'type' => 'structure', 'members' => [ 'id' => [ 'shape' => 'TimestampUUID', ], 'assessmentId' => [ 'shape' => 'UUID', ], 'assessmentName' => [ 'shape' => 'AssessmentName', ], 'controlSetId' => [ 'shape' => 'ControlSetId', ], 'controlSetName' => [ 'shape' => 'NonEmptyString', ], 'description' => [ 'shape' => 'NonEmptyString', ], 'eventTime' => [ 'shape' => 'Timestamp', ], 'source' => [ 'shape' => 'NonEmptyString', ], ], ], 'Notifications' => [ 'type' => 'list', 'member' => [ 'shape' => 'Notification', ], ], 'NullableInteger' => [ 'type' => 'integer', ], 'ObjectTypeEnum' => [ 'type' => 'string', 'enum' => [ 'ASSESSMENT', 'CONTROL_SET', 'CONTROL', 'DELEGATION', 'ASSESSMENT_REPORT', ], ], 'QueryStatement' => [ 'type' => 'string', 'max' => 10000, 'min' => 1, 'pattern' => '(?s).*', ], 'Region' => [ 'type' => 'string', 'pattern' => '^[a-z]{2}-[a-z]+-[0-9]{1}$', ], 'RegisterAccountRequest' => [ 'type' => 'structure', 'members' => [ 'kmsKey' => [ 'shape' => 'KmsKey', ], 'delegatedAdminAccount' => [ 'shape' => 'AccountId', ], ], ], 'RegisterAccountResponse' => [ 'type' => 'structure', 'members' => [ 'status' => [ 'shape' => 'AccountStatus', ], ], ], 'RegisterOrganizationAdminAccountRequest' => [ 'type' => 'structure', 'required' => [ 'adminAccountId', ], 'members' => [ 'adminAccountId' => [ 'shape' => 'AccountId', ], ], ], 'RegisterOrganizationAdminAccountResponse' => [ 'type' => 'structure', 'members' => [ 'adminAccountId' => [ 'shape' => 'AccountId', ], 'organizationId' => [ 'shape' => 'organizationId', ], ], ], 'Resource' => [ 'type' => 'structure', 'members' => [ 'arn' => [ 'shape' => 'GenericArn', ], 'value' => [ 'shape' => 'String', ], 'complianceCheck' => [ 'shape' => 'String', ], ], ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'required' => [ 'message', 'resourceId', 'resourceType', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'resourceId' => [ 'shape' => 'String', ], 'resourceType' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'Resources' => [ 'type' => 'list', 'member' => [ 'shape' => 'Resource', ], ], 'Role' => [ 'type' => 'structure', 'required' => [ 'roleType', 'roleArn', ], 'members' => [ 'roleType' => [ 'shape' => 'RoleType', ], 'roleArn' => [ 'shape' => 'IamArn', ], ], ], 'RoleType' => [ 'type' => 'string', 'enum' => [ 'PROCESS_OWNER', 'RESOURCE_OWNER', ], ], 'Roles' => [ 'type' => 'list', 'member' => [ 'shape' => 'Role', ], ], 'S3Url' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, 'pattern' => '^(S|s)3:\\\\/\\\\/[a-zA-Z0-9\\\\-\\\\.\\\\(\\\\)\\\\\\'\\\\*\\\\_\\\\!\\\\/]+$', ], 'SNSTopic' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '^[a-zA-Z0-9-_\\\\(\\\\)\\\\[\\\\]]+$', ], 'Scope' => [ 'type' => 'structure', 'members' => [ 'awsAccounts' => [ 'shape' => 'AWSAccounts', ], 'awsServices' => [ 'shape' => 'AWSServices', ], ], ], 'ServiceMetadata' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'AWSServiceName', ], 'displayName' => [ 'shape' => 'NonEmptyString', ], 'description' => [ 'shape' => 'NonEmptyString', ], 'category' => [ 'shape' => 'NonEmptyString', ], ], ], 'ServiceMetadataList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ServiceMetadata', ], ], 'ServiceQuotaExceededException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 402, ], 'exception' => true, ], 'SettingAttribute' => [ 'type' => 'string', 'enum' => [ 'ALL', 'IS_AWS_ORG_ENABLED', 'SNS_TOPIC', 'DEFAULT_ASSESSMENT_REPORTS_DESTINATION', 'DEFAULT_PROCESS_OWNERS', 'EVIDENCE_FINDER_ENABLEMENT', 'DEREGISTRATION_POLICY', 'DEFAULT_EXPORT_DESTINATION', ], ], 'Settings' => [ 'type' => 'structure', 'members' => [ 'isAwsOrgEnabled' => [ 'shape' => 'Boolean', ], 'snsTopic' => [ 'shape' => 'SNSTopic', ], 'defaultAssessmentReportsDestination' => [ 'shape' => 'AssessmentReportsDestination', ], 'defaultProcessOwners' => [ 'shape' => 'Roles', ], 'kmsKey' => [ 'shape' => 'KmsKey', ], 'evidenceFinderEnablement' => [ 'shape' => 'EvidenceFinderEnablement', ], 'deregistrationPolicy' => [ 'shape' => 'DeregistrationPolicy', ], 'defaultExportDestination' => [ 'shape' => 'DefaultExportDestination', ], ], ], 'ShareRequestAction' => [ 'type' => 'string', 'enum' => [ 'ACCEPT', 'DECLINE', 'REVOKE', ], ], 'ShareRequestComment' => [ 'type' => 'string', 'max' => 500, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'ShareRequestStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'REPLICATING', 'SHARED', 'EXPIRING', 'FAILED', 'EXPIRED', 'DECLINED', 'REVOKED', ], ], 'ShareRequestType' => [ 'type' => 'string', 'enum' => [ 'SENT', 'RECEIVED', ], ], 'SnsArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 4, 'pattern' => '^arn:.*:sns:.*|NONE', ], 'SourceDescription' => [ 'type' => 'string', 'max' => 1000, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'SourceFrequency' => [ 'type' => 'string', 'enum' => [ 'DAILY', 'WEEKLY', 'MONTHLY', ], ], 'SourceKeyword' => [ 'type' => 'structure', 'members' => [ 'keywordInputType' => [ 'shape' => 'KeywordInputType', ], 'keywordValue' => [ 'shape' => 'KeywordValue', ], ], ], 'SourceName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, ], 'SourceSetUpOption' => [ 'type' => 'string', 'enum' => [ 'System_Controls_Mapping', 'Procedural_Controls_Mapping', ], ], 'SourceType' => [ 'type' => 'string', 'enum' => [ 'AWS_Cloudtrail', 'AWS_Config', 'AWS_Security_Hub', 'AWS_API_Call', 'MANUAL', ], ], 'StartAssessmentFrameworkShareRequest' => [ 'type' => 'structure', 'required' => [ 'frameworkId', 'destinationAccount', 'destinationRegion', ], 'members' => [ 'frameworkId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'frameworkId', ], 'destinationAccount' => [ 'shape' => 'AccountId', ], 'destinationRegion' => [ 'shape' => 'Region', ], 'comment' => [ 'shape' => 'ShareRequestComment', ], ], ], 'StartAssessmentFrameworkShareResponse' => [ 'type' => 'structure', 'members' => [ 'assessmentFrameworkShareRequest' => [ 'shape' => 'AssessmentFrameworkShareRequest', ], ], ], 'String' => [ 'type' => 'string', 'max' => 2048, 'min' => 0, 'pattern' => '.*', ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^(?!aws:)[a-zA-Z+-=._:/]+$', ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 50, 'min' => 1, ], 'TagMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'TagKey', ], 'value' => [ 'shape' => 'TagValue', ], 'max' => 50, 'min' => 0, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tags', ], 'members' => [ 'resourceArn' => [ 'shape' => 'AuditManagerArn', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => '.{0,255}', ], 'TestingInformation' => [ 'type' => 'string', 'max' => 1000, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'ThrottlingException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'Timestamp' => [ 'type' => 'timestamp', ], 'TimestampUUID' => [ 'type' => 'string', 'max' => 50, 'min' => 47, 'pattern' => '^[0-9]{10,13}_[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$', ], 'Token' => [ 'type' => 'string', 'max' => 1000, 'min' => 1, 'pattern' => '^[A-Za-z0-9+\\\\/=]*$', ], 'TroubleshootingText' => [ 'type' => 'string', 'max' => 1000, 'pattern' => '^[\\\\w\\\\W\\\\s\\\\S]*$', ], 'URL' => [ 'type' => 'structure', 'members' => [ 'hyperlinkName' => [ 'shape' => 'HyperlinkName', ], 'link' => [ 'shape' => 'UrlLink', ], ], ], 'UUID' => [ 'type' => 'string', 'max' => 36, 'min' => 36, 'pattern' => '^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$', ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tagKeys', ], 'members' => [ 'resourceArn' => [ 'shape' => 'AuditManagerArn', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tagKeys' => [ 'shape' => 'TagKeyList', 'location' => 'querystring', 'locationName' => 'tagKeys', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateAssessmentControlRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', 'controlSetId', 'controlId', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'controlSetId' => [ 'shape' => 'ControlSetId', 'location' => 'uri', 'locationName' => 'controlSetId', ], 'controlId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'controlId', ], 'controlStatus' => [ 'shape' => 'ControlStatus', ], 'commentBody' => [ 'shape' => 'ControlCommentBody', ], ], ], 'UpdateAssessmentControlResponse' => [ 'type' => 'structure', 'members' => [ 'control' => [ 'shape' => 'AssessmentControl', ], ], ], 'UpdateAssessmentControlSetStatusRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', 'controlSetId', 'status', 'comment', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'controlSetId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'controlSetId', ], 'status' => [ 'shape' => 'ControlSetStatus', ], 'comment' => [ 'shape' => 'DelegationComment', ], ], ], 'UpdateAssessmentControlSetStatusResponse' => [ 'type' => 'structure', 'members' => [ 'controlSet' => [ 'shape' => 'AssessmentControlSet', ], ], ], 'UpdateAssessmentFrameworkControlSet' => [ 'type' => 'structure', 'required' => [ 'name', 'controls', ], 'members' => [ 'id' => [ 'shape' => 'ControlSetName', ], 'name' => [ 'shape' => 'ControlSetName', ], 'controls' => [ 'shape' => 'CreateAssessmentFrameworkControls', ], ], ], 'UpdateAssessmentFrameworkControlSets' => [ 'type' => 'list', 'member' => [ 'shape' => 'UpdateAssessmentFrameworkControlSet', ], 'min' => 1, ], 'UpdateAssessmentFrameworkRequest' => [ 'type' => 'structure', 'required' => [ 'frameworkId', 'name', 'controlSets', ], 'members' => [ 'frameworkId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'frameworkId', ], 'name' => [ 'shape' => 'FrameworkName', ], 'description' => [ 'shape' => 'FrameworkDescription', ], 'complianceType' => [ 'shape' => 'ComplianceType', ], 'controlSets' => [ 'shape' => 'UpdateAssessmentFrameworkControlSets', ], ], ], 'UpdateAssessmentFrameworkResponse' => [ 'type' => 'structure', 'members' => [ 'framework' => [ 'shape' => 'Framework', ], ], ], 'UpdateAssessmentFrameworkShareRequest' => [ 'type' => 'structure', 'required' => [ 'requestId', 'requestType', 'action', ], 'members' => [ 'requestId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'requestId', ], 'requestType' => [ 'shape' => 'ShareRequestType', ], 'action' => [ 'shape' => 'ShareRequestAction', ], ], ], 'UpdateAssessmentFrameworkShareResponse' => [ 'type' => 'structure', 'members' => [ 'assessmentFrameworkShareRequest' => [ 'shape' => 'AssessmentFrameworkShareRequest', ], ], ], 'UpdateAssessmentRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', 'scope', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'assessmentName' => [ 'shape' => 'AssessmentName', ], 'assessmentDescription' => [ 'shape' => 'AssessmentDescription', ], 'scope' => [ 'shape' => 'Scope', ], 'assessmentReportsDestination' => [ 'shape' => 'AssessmentReportsDestination', ], 'roles' => [ 'shape' => 'Roles', ], ], ], 'UpdateAssessmentResponse' => [ 'type' => 'structure', 'members' => [ 'assessment' => [ 'shape' => 'Assessment', ], ], ], 'UpdateAssessmentStatusRequest' => [ 'type' => 'structure', 'required' => [ 'assessmentId', 'status', ], 'members' => [ 'assessmentId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'assessmentId', ], 'status' => [ 'shape' => 'AssessmentStatus', ], ], ], 'UpdateAssessmentStatusResponse' => [ 'type' => 'structure', 'members' => [ 'assessment' => [ 'shape' => 'Assessment', ], ], ], 'UpdateControlRequest' => [ 'type' => 'structure', 'required' => [ 'controlId', 'name', 'controlMappingSources', ], 'members' => [ 'controlId' => [ 'shape' => 'UUID', 'location' => 'uri', 'locationName' => 'controlId', ], 'name' => [ 'shape' => 'ControlName', ], 'description' => [ 'shape' => 'ControlDescription', ], 'testingInformation' => [ 'shape' => 'TestingInformation', ], 'actionPlanTitle' => [ 'shape' => 'ActionPlanTitle', ], 'actionPlanInstructions' => [ 'shape' => 'ActionPlanInstructions', ], 'controlMappingSources' => [ 'shape' => 'ControlMappingSources', ], ], ], 'UpdateControlResponse' => [ 'type' => 'structure', 'members' => [ 'control' => [ 'shape' => 'Control', ], ], ], 'UpdateSettingsRequest' => [ 'type' => 'structure', 'members' => [ 'snsTopic' => [ 'shape' => 'SnsArn', ], 'defaultAssessmentReportsDestination' => [ 'shape' => 'AssessmentReportsDestination', ], 'defaultProcessOwners' => [ 'shape' => 'Roles', ], 'kmsKey' => [ 'shape' => 'KmsKey', ], 'evidenceFinderEnabled' => [ 'shape' => 'Boolean', ], 'deregistrationPolicy' => [ 'shape' => 'DeregistrationPolicy', ], 'defaultExportDestination' => [ 'shape' => 'DefaultExportDestination', ], ], ], 'UpdateSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'settings' => [ 'shape' => 'Settings', ], ], ], 'UrlLink' => [ 'type' => 'string', 'max' => 8192, 'min' => 1, 'pattern' => '^(https?:\\\\/\\\\/)?(www\\\\.)?[a-zA-Z0-9-_]+([\\\\.]+[a-zA-Z]+)+[\\\\/\\\\w]*$', ], 'Username' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^[a-zA-Z0-9-_()\\\\s\\\\+=,.@]+$', ], 'ValidateAssessmentReportIntegrityRequest' => [ 'type' => 'structure', 'required' => [ 's3RelativePath', ], 'members' => [ 's3RelativePath' => [ 'shape' => 'S3Url', ], ], ], 'ValidateAssessmentReportIntegrityResponse' => [ 'type' => 'structure', 'members' => [ 'signatureValid' => [ 'shape' => 'Boolean', ], 'signatureAlgorithm' => [ 'shape' => 'String', ], 'signatureDateTime' => [ 'shape' => 'String', ], 'signatureKeyId' => [ 'shape' => 'String', ], 'validationErrors' => [ 'shape' => 'ValidationErrors', ], ], ], 'ValidationErrors' => [ 'type' => 'list', 'member' => [ 'shape' => 'NonEmptyString', ], ], 'ValidationException' => [ 'type' => 'structure', 'required' => [ 'message', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'reason' => [ 'shape' => 'ValidationExceptionReason', ], 'fields' => [ 'shape' => 'ValidationExceptionFieldList', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ValidationExceptionField' => [ 'type' => 'structure', 'required' => [ 'name', 'message', ], 'members' => [ 'name' => [ 'shape' => 'String', ], 'message' => [ 'shape' => 'String', ], ], ], 'ValidationExceptionFieldList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ValidationExceptionField', ], ], 'ValidationExceptionReason' => [ 'type' => 'string', 'enum' => [ 'unknownOperation', 'cannotParse', 'fieldValidationFailed', 'other', ], ], 'organizationId' => [ 'type' => 'string', 'max' => 34, 'min' => 12, 'pattern' => 'o-[a-z0-9]{10,32}', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/auditmanager/2017-07-25/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>Welcome to the Audit Manager API reference. This guide is for developers who need detailed information about the Audit Manager API operations, data types, and errors. </p> <p>Audit Manager is a service that provides automated evidence collection so that you can continually audit your Amazon Web Services usage. You can use it to assess the effectiveness of your controls, manage risk, and simplify compliance.</p> <p>Audit Manager provides prebuilt frameworks that structure and automate assessments for a given compliance standard. Frameworks include a prebuilt collection of controls with descriptions and testing procedures. These controls are grouped according to the requirements of the specified compliance standard or regulation. You can also customize frameworks and controls to support internal audits with specific requirements. </p> <p>Use the following links to get started with the Audit Manager API:</p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_Operations.html\">Actions</a>: An alphabetical list of all Audit Manager API operations.</p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_Types.html\">Data types</a>: An alphabetical list of all Audit Manager data types.</p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/CommonParameters.html\">Common parameters</a>: Parameters that all operations can use.</p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/CommonErrors.html\">Common errors</a>: Client and server errors that all operations can return.</p> </li> </ul> <p>If you\\'re new to Audit Manager, we recommend that you review the <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/what-is.html\"> Audit Manager User Guide</a>.</p>', 'operations' => [ 'AssociateAssessmentReportEvidenceFolder' => '<p> Associates an evidence folder to an assessment report in an Audit Manager assessment. </p>', 'BatchAssociateAssessmentReportEvidence' => '<p> Associates a list of evidence to an assessment report in an Audit Manager assessment. </p>', 'BatchCreateDelegationByAssessment' => '<p> Creates a batch of delegations for an assessment in Audit Manager. </p>', 'BatchDeleteDelegationByAssessment' => '<p> Deletes a batch of delegations for an assessment in Audit Manager. </p>', 'BatchDisassociateAssessmentReportEvidence' => '<p> Disassociates a list of evidence from an assessment report in Audit Manager. </p>', 'BatchImportEvidenceToAssessmentControl' => '<p>Adds one or more pieces of evidence to a control in an Audit Manager assessment. </p> <p>You can import manual evidence from any S3 bucket by specifying the S3 URI of the object. You can also upload a file from your browser, or enter plain text in response to a risk assessment question. </p> <p>The following restrictions apply to this action:</p> <ul> <li> <p> <code>manualEvidence</code> can be only one of the following: <code>evidenceFileName</code>, <code>s3ResourcePath</code>, or <code>textResponse</code> </p> </li> <li> <p>Maximum size of an individual evidence file: 100 MB</p> </li> <li> <p>Number of daily manual evidence uploads per control: 100</p> </li> <li> <p>Supported file formats: See <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/upload-evidence.html#supported-manual-evidence-files\">Supported file types for manual evidence</a> in the <i>Audit Manager User Guide</i> </p> </li> </ul> <p>For more information about Audit Manager service restrictions, see <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/service-quotas.html\">Quotas and restrictions for Audit Manager</a>.</p>', 'CreateAssessment' => '<p> Creates an assessment in Audit Manager. </p>', 'CreateAssessmentFramework' => '<p> Creates a custom framework in Audit Manager. </p>', 'CreateAssessmentReport' => '<p> Creates an assessment report for the specified assessment. </p>', 'CreateControl' => '<p> Creates a new custom control in Audit Manager. </p>', 'DeleteAssessment' => '<p> Deletes an assessment in Audit Manager. </p>', 'DeleteAssessmentFramework' => '<p> Deletes a custom framework in Audit Manager. </p>', 'DeleteAssessmentFrameworkShare' => '<p> Deletes a share request for a custom framework in Audit Manager. </p>', 'DeleteAssessmentReport' => '<p>Deletes an assessment report in Audit Manager. </p> <p>When you run the <code>DeleteAssessmentReport</code> operation, Audit Manager attempts to delete the following data:</p> <ol> <li> <p>The specified assessment report that\u00e2\u20ac\u2122s stored in your S3 bucket</p> </li> <li> <p>The associated metadata that\u00e2\u20ac\u2122s stored in Audit Manager</p> </li> </ol> <p>If Audit Manager can\u00e2\u20ac\u2122t access the assessment report in your S3 bucket, the report isn\u00e2\u20ac\u2122t deleted. In this event, the <code>DeleteAssessmentReport</code> operation doesn\u00e2\u20ac\u2122t fail. Instead, it proceeds to delete the associated metadata only. You must then delete the assessment report from the S3 bucket yourself. </p> <p>This scenario happens when Audit Manager receives a <code>403 (Forbidden)</code> or <code>404 (Not Found)</code> error from Amazon S3. To avoid this, make sure that your S3 bucket is available, and that you configured the correct permissions for Audit Manager to delete resources in your S3 bucket. For an example permissions policy that you can use, see <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/security_iam_id-based-policy-examples.html#full-administrator-access-assessment-report-destination\">Assessment report destination permissions</a> in the <i>Audit Manager User Guide</i>. For information about the issues that could cause a <code>403 (Forbidden)</code> or <code>404 (Not Found</code>) error from Amazon S3, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList\">List of Error Codes</a> in the <i>Amazon Simple Storage Service API Reference</i>. </p>', 'DeleteControl' => '<p> Deletes a custom control in Audit Manager. </p> <important> <p>When you invoke this operation, the custom control is deleted from any frameworks or assessments that it\u00e2\u20ac\u2122s currently part of. As a result, Audit Manager will stop collecting evidence for that custom control in all of your assessments. This includes assessments that you previously created before you deleted the custom control.</p> </important>', 'DeregisterAccount' => '<p> Deregisters an account in Audit Manager. </p> <note> <p>Before you deregister, you can use the <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_UpdateSettings.html\">UpdateSettings</a> API operation to set your preferred data retention policy. By default, Audit Manager retains your data. If you want to delete your data, you can use the <code>DeregistrationPolicy</code> attribute to request the deletion of your data. </p> <p>For more information about data retention, see <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/data-protection.html\">Data Protection</a> in the <i>Audit Manager User Guide</i>. </p> </note>', 'DeregisterOrganizationAdminAccount' => '<p>Removes the specified Amazon Web Services account as a delegated administrator for Audit Manager. </p> <p>When you remove a delegated administrator from your Audit Manager settings, you continue to have access to the evidence that you previously collected under that account. This is also the case when you deregister a delegated administrator from Organizations. However, Audit Manager stops collecting and attaching evidence to that delegated administrator account moving forward.</p> <important> <p>Keep in mind the following cleanup task if you use evidence finder:</p> <p>Before you use your management account to remove a delegated administrator, make sure that the current delegated administrator account signs in to Audit Manager and disables evidence finder first. Disabling evidence finder automatically deletes the event data store that was created in their account when they enabled evidence finder. If this task isn\u00e2\u20ac\u2122t completed, the event data store remains in their account. In this case, we recommend that the original delegated administrator goes to CloudTrail Lake and manually <a href=\"https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-eds-disable-termination.html\">deletes the event data store</a>.</p> <p>This cleanup task is necessary to ensure that you don\\'t end up with multiple event data stores. Audit Manager ignores an unused event data store after you remove or change a delegated administrator account. However, the unused event data store continues to incur storage costs from CloudTrail Lake if you don\\'t delete it.</p> </important> <p>When you deregister a delegated administrator account for Audit Manager, the data for that account isn\u00e2\u20ac\u2122t deleted. If you want to delete resource data for a delegated administrator account, you must perform that task separately before you deregister the account. Either, you can do this in the Audit Manager console. Or, you can use one of the delete API operations that are provided by Audit Manager. </p> <p>To delete your Audit Manager resource data, see the following instructions: </p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_DeleteAssessment.html\">DeleteAssessment</a> (see also: <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/delete-assessment.html\">Deleting an assessment</a> in the <i>Audit Manager User Guide</i>)</p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_DeleteAssessmentFramework.html\">DeleteAssessmentFramework</a> (see also: <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/delete-custom-framework.html\">Deleting a custom framework</a> in the <i>Audit Manager User Guide</i>)</p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_DeleteAssessmentFrameworkShare.html\">DeleteAssessmentFrameworkShare</a> (see also: <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/deleting-shared-framework-requests.html\">Deleting a share request</a> in the <i>Audit Manager User Guide</i>)</p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_DeleteAssessmentReport.html\">DeleteAssessmentReport</a> (see also: <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/generate-assessment-report.html#delete-assessment-report-steps\">Deleting an assessment report</a> in the <i>Audit Manager User Guide</i>)</p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_DeleteControl.html\">DeleteControl</a> (see also: <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/delete-controls.html\">Deleting a custom control</a> in the <i>Audit Manager User Guide</i>)</p> </li> </ul> <p>At this time, Audit Manager doesn\\'t provide an option to delete evidence for a specific delegated administrator. Instead, when your management account deregisters Audit Manager, we perform a cleanup for the current delegated administrator account at the time of deregistration.</p>', 'DisassociateAssessmentReportEvidenceFolder' => '<p> Disassociates an evidence folder from the specified assessment report in Audit Manager. </p>', 'GetAccountStatus' => '<p> Gets the registration status of an account in Audit Manager. </p>', 'GetAssessment' => '<p>Gets information about a specified assessment. </p>', 'GetAssessmentFramework' => '<p>Gets information about a specified framework.</p>', 'GetAssessmentReportUrl' => '<p> Gets the URL of an assessment report in Audit Manager. </p>', 'GetChangeLogs' => '<p> Gets a list of changelogs from Audit Manager. </p>', 'GetControl' => '<p> Gets information about a specified control.</p>', 'GetDelegations' => '<p> Gets a list of delegations from an audit owner to a delegate. </p>', 'GetEvidence' => '<p> Gets information about a specified evidence item.</p>', 'GetEvidenceByEvidenceFolder' => '<p> Gets all evidence from a specified evidence folder in Audit Manager. </p>', 'GetEvidenceFileUploadUrl' => '<p>Creates a presigned Amazon S3 URL that can be used to upload a file as manual evidence. For instructions on how to use this operation, see <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/upload-evidence.html#how-to-upload-manual-evidence-files\">Upload a file from your browser </a> in the <i>Audit Manager User Guide</i>.</p> <p>The following restrictions apply to this operation:</p> <ul> <li> <p>Maximum size of an individual evidence file: 100 MB</p> </li> <li> <p>Number of daily manual evidence uploads per control: 100</p> </li> <li> <p>Supported file formats: See <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/upload-evidence.html#supported-manual-evidence-files\">Supported file types for manual evidence</a> in the <i>Audit Manager User Guide</i> </p> </li> </ul> <p>For more information about Audit Manager service restrictions, see <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/service-quotas.html\">Quotas and restrictions for Audit Manager</a>.</p>', 'GetEvidenceFolder' => '<p> Gets an evidence folder from a specified assessment in Audit Manager. </p>', 'GetEvidenceFoldersByAssessment' => '<p> Gets the evidence folders from a specified assessment in Audit Manager. </p>', 'GetEvidenceFoldersByAssessmentControl' => '<p> Gets a list of evidence folders that are associated with a specified control in an Audit Manager assessment. </p>', 'GetInsights' => '<p>Gets the latest analytics data for all your current active assessments. </p>', 'GetInsightsByAssessment' => '<p>Gets the latest analytics data for a specific active assessment. </p>', 'GetOrganizationAdminAccount' => '<p> Gets the name of the delegated Amazon Web Services administrator account for a specified organization. </p>', 'GetServicesInScope' => '<p>Gets a list of all of the Amazon Web Services that you can choose to include in your assessment. When you <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_CreateAssessment.html\">create an assessment</a>, specify which of these services you want to include to narrow the assessment\\'s <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_Scope.html\">scope</a>.</p>', 'GetSettings' => '<p> Gets the settings for a specified Amazon Web Services account. </p>', 'ListAssessmentControlInsightsByControlDomain' => '<p>Lists the latest analytics data for controls within a specific control domain and a specific active assessment.</p> <note> <p>Control insights are listed only if the control belongs to the control domain and assessment that was specified. Moreover, the control must have collected evidence on the <code>lastUpdated</code> date of <code>controlInsightsByAssessment</code>. If neither of these conditions are met, no data is listed for that control. </p> </note>', 'ListAssessmentFrameworkShareRequests' => '<p> Returns a list of sent or received share requests for custom frameworks in Audit Manager. </p>', 'ListAssessmentFrameworks' => '<p> Returns a list of the frameworks that are available in the Audit Manager framework library. </p>', 'ListAssessmentReports' => '<p> Returns a list of assessment reports created in Audit Manager. </p>', 'ListAssessments' => '<p> Returns a list of current and past assessments from Audit Manager. </p>', 'ListControlDomainInsights' => '<p>Lists the latest analytics data for control domains across all of your active assessments. </p> <note> <p>A control domain is listed only if at least one of the controls within that domain collected evidence on the <code>lastUpdated</code> date of <code>controlDomainInsights</code>. If this condition isn\u00e2\u20ac\u2122t met, no data is listed for that control domain.</p> </note>', 'ListControlDomainInsightsByAssessment' => '<p>Lists analytics data for control domains within a specified active assessment.</p> <note> <p>A control domain is listed only if at least one of the controls within that domain collected evidence on the <code>lastUpdated</code> date of <code>controlDomainInsights</code>. If this condition isn\u00e2\u20ac\u2122t met, no data is listed for that domain.</p> </note>', 'ListControlInsightsByControlDomain' => '<p>Lists the latest analytics data for controls within a specific control domain across all active assessments.</p> <note> <p>Control insights are listed only if the control belongs to the control domain that was specified and the control collected evidence on the <code>lastUpdated</code> date of <code>controlInsightsMetadata</code>. If neither of these conditions are met, no data is listed for that control. </p> </note>', 'ListControls' => '<p> Returns a list of controls from Audit Manager. </p>', 'ListKeywordsForDataSource' => '<p> Returns a list of keywords that are pre-mapped to the specified control data source. </p>', 'ListNotifications' => '<p> Returns a list of all Audit Manager notifications. </p>', 'ListTagsForResource' => '<p> Returns a list of tags for the specified resource in Audit Manager. </p>', 'RegisterAccount' => '<p> Enables Audit Manager for the specified Amazon Web Services account. </p>', 'RegisterOrganizationAdminAccount' => '<p> Enables an Amazon Web Services account within the organization as the delegated administrator for Audit Manager. </p>', 'StartAssessmentFrameworkShare' => '<p> Creates a share request for a custom framework in Audit Manager. </p> <p>The share request specifies a recipient and notifies them that a custom framework is available. Recipients have 120 days to accept or decline the request. If no action is taken, the share request expires.</p> <p>When you create a share request, Audit Manager stores a snapshot of your custom framework in the US East (N. Virginia) Amazon Web Services Region. Audit Manager also stores a backup of the same snapshot in the US West (Oregon) Amazon Web Services Region.</p> <p>Audit Manager deletes the snapshot and the backup snapshot when one of the following events occurs:</p> <ul> <li> <p>The sender revokes the share request.</p> </li> <li> <p>The recipient declines the share request.</p> </li> <li> <p>The recipient encounters an error and doesn\\'t successfully accept the share request.</p> </li> <li> <p>The share request expires before the recipient responds to the request.</p> </li> </ul> <p>When a sender <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/framework-sharing.html#framework-sharing-resend\">resends a share request</a>, the snapshot is replaced with an updated version that corresponds with the latest version of the custom framework. </p> <p>When a recipient accepts a share request, the snapshot is replicated into their Amazon Web Services account under the Amazon Web Services Region that was specified in the share request. </p> <important> <p>When you invoke the <code>StartAssessmentFrameworkShare</code> API, you are about to share a custom framework with another Amazon Web Services account. You may not share a custom framework that is derived from a standard framework if the standard framework is designated as not eligible for sharing by Amazon Web Services, unless you have obtained permission to do so from the owner of the standard framework. To learn more about which standard frameworks are eligible for sharing, see <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/share-custom-framework-concepts-and-terminology.html#eligibility\">Framework sharing eligibility</a> in the <i>Audit Manager User Guide</i>.</p> </important>', 'TagResource' => '<p> Tags the specified resource in Audit Manager. </p>', 'UntagResource' => '<p> Removes a tag from a resource in Audit Manager. </p>', 'UpdateAssessment' => '<p> Edits an Audit Manager assessment. </p>', 'UpdateAssessmentControl' => '<p> Updates a control within an assessment in Audit Manager. </p>', 'UpdateAssessmentControlSetStatus' => '<p> Updates the status of a control set in an Audit Manager assessment. </p>', 'UpdateAssessmentFramework' => '<p> Updates a custom framework in Audit Manager. </p>', 'UpdateAssessmentFrameworkShare' => '<p> Updates a share request for a custom framework in Audit Manager. </p>', 'UpdateAssessmentStatus' => '<p> Updates the status of an assessment in Audit Manager. </p>', 'UpdateControl' => '<p> Updates a custom control in Audit Manager. </p>', 'UpdateSettings' => '<p> Updates Audit Manager settings for the current account. </p>', 'ValidateAssessmentReportIntegrity' => '<p> Validates the integrity of an assessment report in Audit Manager. </p>', ], 'shapes' => [ 'AWSAccount' => [ 'base' => '<p> The wrapper of Amazon Web Services account details, such as account ID or email address. </p>', 'refs' => [ 'AWSAccounts$member' => NULL, 'Assessment$awsAccount' => '<p> The Amazon Web Services account that\\'s associated with the assessment. </p>', ], ], 'AWSAccounts' => [ 'base' => NULL, 'refs' => [ 'Scope$awsAccounts' => '<p> The Amazon Web Services accounts that are included in the scope of the assessment. </p>', ], ], 'AWSService' => [ 'base' => '<p> An Amazon Web Service such as Amazon S3 or CloudTrail. </p> <p>For an example of how to find an Amazon Web Service name and how to define it in your assessment scope, see the following:</p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_GetServicesInScope.html#API_GetServicesInScope_Example_2\">Finding an Amazon Web Service name to use in your assessment scope</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_GetServicesInScope.html#API_GetServicesInScope_Example_3\">Defining an Amazon Web Service name in your assessment scope</a> </p> </li> </ul>', 'refs' => [ 'AWSServices$member' => NULL, ], ], 'AWSServiceName' => [ 'base' => NULL, 'refs' => [ 'AWSService$serviceName' => '<p> The name of the Amazon Web Service. </p>', 'Evidence$eventSource' => '<p> The Amazon Web Service that the evidence is collected from. </p>', 'ServiceMetadata$name' => '<p> The name of the Amazon Web Service. </p>', ], ], 'AWSServices' => [ 'base' => NULL, 'refs' => [ 'Scope$awsServices' => '<p> The Amazon Web Services services that are included in the scope of the assessment. </p>', ], ], 'AccessDeniedException' => [ 'base' => '<p> Your account isn\\'t registered with Audit Manager. Check the delegated administrator setup on the Audit Manager settings page, and try again. </p>', 'refs' => [], ], 'AccountId' => [ 'base' => NULL, 'refs' => [ 'AWSAccount$id' => '<p> The identifier for the Amazon Web Services account. </p>', 'AssessmentFrameworkShareRequest$sourceAccount' => '<p> The Amazon Web Services account of the sender. </p>', 'AssessmentFrameworkShareRequest$destinationAccount' => '<p> The Amazon Web Services account of the recipient. </p>', 'AssessmentReport$awsAccountId' => '<p> The identifier for the specified Amazon Web Services account. </p>', 'DeregisterOrganizationAdminAccountRequest$adminAccountId' => '<p> The identifier for the administrator account. </p>', 'Evidence$evidenceAwsAccountId' => '<p> The identifier for the Amazon Web Services account. </p>', 'Evidence$awsAccountId' => '<p> The identifier for the Amazon Web Services account. </p>', 'GetOrganizationAdminAccountResponse$adminAccountId' => '<p> The identifier for the administrator account. </p>', 'RegisterAccountRequest$delegatedAdminAccount' => '<p> The delegated administrator account for Audit Manager. </p>', 'RegisterOrganizationAdminAccountRequest$adminAccountId' => '<p> The identifier for the delegated administrator account. </p>', 'RegisterOrganizationAdminAccountResponse$adminAccountId' => '<p> The identifier for the delegated administrator account. </p>', 'StartAssessmentFrameworkShareRequest$destinationAccount' => '<p> The Amazon Web Services account of the recipient. </p>', ], ], 'AccountName' => [ 'base' => NULL, 'refs' => [ 'AWSAccount$name' => '<p> The name of the Amazon Web Services account. </p>', ], ], 'AccountStatus' => [ 'base' => NULL, 'refs' => [ 'DeregisterAccountResponse$status' => '<p> The registration status of the account. </p>', 'GetAccountStatusResponse$status' => '<p> The status of the Amazon Web Services account. </p>', 'RegisterAccountResponse$status' => '<p> The status of the account registration request. </p>', ], ], 'ActionEnum' => [ 'base' => NULL, 'refs' => [ 'ChangeLog$action' => '<p> The action that was performed. </p>', ], ], 'ActionPlanInstructions' => [ 'base' => NULL, 'refs' => [ 'Control$actionPlanInstructions' => '<p> The recommended actions to carry out if the control isn\\'t fulfilled. </p>', 'CreateControlRequest$actionPlanInstructions' => '<p> The recommended actions to carry out if the control isn\\'t fulfilled. </p>', 'UpdateControlRequest$actionPlanInstructions' => '<p> The recommended actions to carry out if the control isn\\'t fulfilled. </p>', ], ], 'ActionPlanTitle' => [ 'base' => NULL, 'refs' => [ 'Control$actionPlanTitle' => '<p> The title of the action plan for remediating the control. </p>', 'CreateControlRequest$actionPlanTitle' => '<p> The title of the action plan for remediating the control. </p>', 'UpdateControlRequest$actionPlanTitle' => '<p> The title of the action plan for remediating the control. </p>', ], ], 'Assessment' => [ 'base' => '<p> An entity that defines the scope of audit evidence collected by Audit Manager. An Audit Manager assessment is an implementation of an Audit Manager framework. </p>', 'refs' => [ 'CreateAssessmentResponse$assessment' => NULL, 'GetAssessmentResponse$assessment' => NULL, 'UpdateAssessmentResponse$assessment' => '<p> The response object for the <code>UpdateAssessment</code> API. This is the name of the updated assessment.</p>', 'UpdateAssessmentStatusResponse$assessment' => '<p> The name of the updated assessment that the <code>UpdateAssessmentStatus</code> API returned. </p>', ], ], 'AssessmentControl' => [ 'base' => '<p> The control entity that represents a standard control or a custom control in an Audit Manager assessment. </p>', 'refs' => [ 'AssessmentControls$member' => NULL, 'UpdateAssessmentControlResponse$control' => '<p> The name of the updated control set that the <code>UpdateAssessmentControl</code> API returned. </p>', ], ], 'AssessmentControlSet' => [ 'base' => '<p> Represents a set of controls in an Audit Manager assessment. </p>', 'refs' => [ 'AssessmentControlSets$member' => NULL, 'UpdateAssessmentControlSetStatusResponse$controlSet' => '<p> The name of the updated control set that the <code>UpdateAssessmentControlSetStatus</code> API returned. </p>', ], ], 'AssessmentControlSets' => [ 'base' => NULL, 'refs' => [ 'AssessmentFramework$controlSets' => '<p> The control sets that are associated with the framework. </p>', ], ], 'AssessmentControls' => [ 'base' => NULL, 'refs' => [ 'AssessmentControlSet$controls' => '<p> The list of controls that\\'s contained with the control set. </p>', ], ], 'AssessmentDescription' => [ 'base' => NULL, 'refs' => [ 'AssessmentMetadata$description' => '<p> The description of the assessment. </p>', 'CreateAssessmentRequest$description' => '<p> The optional description of the assessment to be created. </p>', 'UpdateAssessmentRequest$assessmentDescription' => '<p> The description of the assessment. </p>', ], ], 'AssessmentEvidenceFolder' => [ 'base' => '<p> The folder where Audit Manager stores evidence for an assessment. </p>', 'refs' => [ 'AssessmentEvidenceFolders$member' => NULL, 'GetEvidenceFolderResponse$evidenceFolder' => '<p> The folder that the evidence is stored in. </p>', ], ], 'AssessmentEvidenceFolderName' => [ 'base' => NULL, 'refs' => [ 'AssessmentEvidenceFolder$name' => '<p> The name of the evidence folder. </p>', ], ], 'AssessmentEvidenceFolders' => [ 'base' => NULL, 'refs' => [ 'GetEvidenceFoldersByAssessmentControlResponse$evidenceFolders' => '<p> The list of evidence folders that the <code>GetEvidenceFoldersByAssessmentControl</code> API returned. </p>', 'GetEvidenceFoldersByAssessmentResponse$evidenceFolders' => '<p> The list of evidence folders that the <code>GetEvidenceFoldersByAssessment</code> API returned. </p>', ], ], 'AssessmentFramework' => [ 'base' => '<p> The file used to structure and automate Audit Manager assessments for a given compliance standard. </p>', 'refs' => [ 'Assessment$framework' => '<p> The framework that the assessment was created from. </p>', ], ], 'AssessmentFrameworkDescription' => [ 'base' => NULL, 'refs' => [ 'FrameworkMetadata$description' => '<p> The description of the framework. </p>', ], ], 'AssessmentFrameworkMetadata' => [ 'base' => '<p> The metadata that\\'s associated with a standard framework or a custom framework. </p>', 'refs' => [ 'FrameworkMetadataList$member' => NULL, ], ], 'AssessmentFrameworkShareRequest' => [ 'base' => '<p> Represents a share request for a custom framework in Audit Manager. </p>', 'refs' => [ 'AssessmentFrameworkShareRequestList$member' => NULL, 'StartAssessmentFrameworkShareResponse$assessmentFrameworkShareRequest' => '<p> The share request that\\'s created by the <code>StartAssessmentFrameworkShare</code> API. </p>', 'UpdateAssessmentFrameworkShareResponse$assessmentFrameworkShareRequest' => '<p> The updated share request that\\'s returned by the <code>UpdateAssessmentFrameworkShare</code> operation. </p>', ], ], 'AssessmentFrameworkShareRequestList' => [ 'base' => NULL, 'refs' => [ 'ListAssessmentFrameworkShareRequestsResponse$assessmentFrameworkShareRequests' => '<p> The list of share requests that the <code>ListAssessmentFrameworkShareRequests</code> API returned. </p>', ], ], 'AssessmentMetadata' => [ 'base' => '<p> The metadata that\\'s associated with the specified assessment. </p>', 'refs' => [ 'Assessment$metadata' => '<p> The metadata for the assessment. </p>', ], ], 'AssessmentMetadataItem' => [ 'base' => '<p> A metadata object that\\'s associated with an assessment in Audit Manager. </p>', 'refs' => [ 'ListAssessmentMetadata$member' => NULL, ], ], 'AssessmentName' => [ 'base' => NULL, 'refs' => [ 'AssessmentMetadata$name' => '<p> The name of the assessment. </p>', 'AssessmentMetadataItem$name' => '<p> The name of the assessment. </p>', 'AssessmentReport$assessmentName' => '<p> The name of the associated assessment. </p>', 'AssessmentReportMetadata$assessmentName' => '<p>The name of the associated assessment. </p>', 'CreateAssessmentRequest$name' => '<p> The name of the assessment to be created. </p>', 'Delegation$assessmentName' => '<p> The name of the assessment that\\'s associated with the delegation. </p>', 'DelegationMetadata$assessmentName' => '<p> The name of the associated assessment. </p>', 'FrameworkMetadata$name' => '<p> The name of the framework. </p>', 'Notification$assessmentName' => '<p> The name of the related assessment. </p>', 'UpdateAssessmentRequest$assessmentName' => '<p> The name of the assessment to be updated. </p>', ], ], 'AssessmentReport' => [ 'base' => '<p> A finalized document that\\'s generated from an Audit Manager assessment. These reports summarize the relevant evidence that was collected for your audit, and link to the relevant evidence folders. These evidence folders are named and organized according to the controls that are specified in your assessment. </p>', 'refs' => [ 'CreateAssessmentReportResponse$assessmentReport' => '<p> The new assessment report that the <code>CreateAssessmentReport</code> API returned. </p>', ], ], 'AssessmentReportDescription' => [ 'base' => NULL, 'refs' => [ 'AssessmentReport$description' => '<p> The description of the specified assessment report. </p>', 'AssessmentReportMetadata$description' => '<p> The description of the assessment report. </p>', 'CreateAssessmentReportRequest$description' => '<p> The description of the assessment report. </p>', ], ], 'AssessmentReportDestinationType' => [ 'base' => NULL, 'refs' => [ 'AssessmentReportsDestination$destinationType' => '<p> The destination type, such as Amazon S3. </p>', ], ], 'AssessmentReportEvidenceError' => [ 'base' => '<p> An error entity for assessment report evidence errors. This is used to provide more meaningful errors than a simple string message. </p>', 'refs' => [ 'AssessmentReportEvidenceErrors$member' => NULL, ], ], 'AssessmentReportEvidenceErrors' => [ 'base' => NULL, 'refs' => [ 'BatchAssociateAssessmentReportEvidenceResponse$errors' => '<p> A list of errors that the <code>BatchAssociateAssessmentReportEvidence</code> API returned. </p>', 'BatchDisassociateAssessmentReportEvidenceResponse$errors' => '<p> A list of errors that the <code>BatchDisassociateAssessmentReportEvidence</code> API returned. </p>', ], ], 'AssessmentReportMetadata' => [ 'base' => '<p> The metadata objects that are associated with the specified assessment report. </p>', 'refs' => [ 'AssessmentReportsMetadata$member' => NULL, ], ], 'AssessmentReportName' => [ 'base' => NULL, 'refs' => [ 'AssessmentReport$name' => '<p> The name that\\'s given to the assessment report. </p>', 'AssessmentReportMetadata$name' => '<p> The name of the assessment report. </p>', 'CreateAssessmentReportRequest$name' => '<p> The name of the new assessment report. </p>', ], ], 'AssessmentReportStatus' => [ 'base' => NULL, 'refs' => [ 'AssessmentReport$status' => '<p> The current status of the specified assessment report. </p>', 'AssessmentReportMetadata$status' => '<p> The current status of the assessment report. </p>', ], ], 'AssessmentReportsDestination' => [ 'base' => '<p> The location where Audit Manager saves assessment reports for the given assessment. </p>', 'refs' => [ 'AssessmentMetadata$assessmentReportsDestination' => '<p> The destination that evidence reports are stored in for the assessment. </p>', 'CreateAssessmentRequest$assessmentReportsDestination' => '<p> The assessment report storage destination for the assessment that\\'s being created. </p>', 'Settings$defaultAssessmentReportsDestination' => '<p>The default S3 destination bucket for storing assessment reports.</p>', 'UpdateAssessmentRequest$assessmentReportsDestination' => '<p> The assessment report storage destination for the assessment that\\'s being updated. </p>', 'UpdateSettingsRequest$defaultAssessmentReportsDestination' => '<p> The default S3 destination bucket for storing assessment reports. </p>', ], ], 'AssessmentReportsMetadata' => [ 'base' => NULL, 'refs' => [ 'ListAssessmentReportsResponse$assessmentReports' => '<p> The list of assessment reports that the <code>ListAssessmentReports</code> API returned. </p>', ], ], 'AssessmentStatus' => [ 'base' => NULL, 'refs' => [ 'AssessmentMetadata$status' => '<p> The overall status of the assessment. </p>', 'AssessmentMetadataItem$status' => '<p> The current status of the assessment. </p>', 'ListAssessmentsRequest$status' => '<p> The current status of the assessment.</p>', 'UpdateAssessmentStatusRequest$status' => '<p> The current status of the assessment. </p>', ], ], 'AssociateAssessmentReportEvidenceFolderRequest' => [ 'base' => NULL, 'refs' => [], ], 'AssociateAssessmentReportEvidenceFolderResponse' => [ 'base' => NULL, 'refs' => [], ], 'AuditManagerArn' => [ 'base' => NULL, 'refs' => [ 'Assessment$arn' => '<p> The Amazon Resource Name (ARN) of the assessment. </p>', 'AssessmentFramework$arn' => '<p> The Amazon Resource Name (ARN) of the framework. </p>', 'AssessmentFrameworkMetadata$arn' => '<p> The Amazon Resource Name (ARN) of the framework. </p>', 'Control$arn' => '<p> The Amazon Resource Name (ARN) of the control. </p>', 'ControlMetadata$arn' => '<p> The Amazon Resource Name (ARN) of the control. </p>', 'Framework$arn' => '<p> The Amazon Resource Name (ARN) of the framework. </p>', 'ListTagsForResourceRequest$resourceArn' => '<p> The Amazon Resource Name (ARN) of the resource. </p>', 'TagResourceRequest$resourceArn' => '<p> The Amazon Resource Name (ARN) of the resource. </p>', 'UntagResourceRequest$resourceArn' => '<p> The Amazon Resource Name (ARN) of the specified resource. </p>', ], ], 'BatchAssociateAssessmentReportEvidenceRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchAssociateAssessmentReportEvidenceResponse' => [ 'base' => NULL, 'refs' => [], ], 'BatchCreateDelegationByAssessmentError' => [ 'base' => '<p> An error entity for the <code>BatchCreateDelegationByAssessment</code> API. This is used to provide more meaningful errors than a simple string message. </p>', 'refs' => [ 'BatchCreateDelegationByAssessmentErrors$member' => NULL, ], ], 'BatchCreateDelegationByAssessmentErrors' => [ 'base' => NULL, 'refs' => [ 'BatchCreateDelegationByAssessmentResponse$errors' => '<p> A list of errors that the <code>BatchCreateDelegationByAssessment</code> API returned. </p>', ], ], 'BatchCreateDelegationByAssessmentRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchCreateDelegationByAssessmentResponse' => [ 'base' => NULL, 'refs' => [], ], 'BatchDeleteDelegationByAssessmentError' => [ 'base' => '<p> An error entity for the <code>BatchDeleteDelegationByAssessment</code> API. This is used to provide more meaningful errors than a simple string message. </p>', 'refs' => [ 'BatchDeleteDelegationByAssessmentErrors$member' => NULL, ], ], 'BatchDeleteDelegationByAssessmentErrors' => [ 'base' => NULL, 'refs' => [ 'BatchDeleteDelegationByAssessmentResponse$errors' => '<p> A list of errors that the <code>BatchDeleteDelegationByAssessment</code> API returned. </p>', ], ], 'BatchDeleteDelegationByAssessmentRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchDeleteDelegationByAssessmentResponse' => [ 'base' => NULL, 'refs' => [], ], 'BatchDisassociateAssessmentReportEvidenceRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchDisassociateAssessmentReportEvidenceResponse' => [ 'base' => NULL, 'refs' => [], ], 'BatchImportEvidenceToAssessmentControlError' => [ 'base' => '<p> An error entity for the <code>BatchImportEvidenceToAssessmentControl</code> API. This is used to provide more meaningful errors than a simple string message. </p>', 'refs' => [ 'BatchImportEvidenceToAssessmentControlErrors$member' => NULL, ], ], 'BatchImportEvidenceToAssessmentControlErrors' => [ 'base' => NULL, 'refs' => [ 'BatchImportEvidenceToAssessmentControlResponse$errors' => '<p> A list of errors that the <code>BatchImportEvidenceToAssessmentControl</code> API returned. </p>', ], ], 'BatchImportEvidenceToAssessmentControlRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchImportEvidenceToAssessmentControlResponse' => [ 'base' => NULL, 'refs' => [], ], 'Boolean' => [ 'base' => NULL, 'refs' => [ 'Settings$isAwsOrgEnabled' => '<p> Specifies whether Organizations is enabled. </p>', 'UpdateSettingsRequest$evidenceFinderEnabled' => '<p>Specifies whether the evidence finder feature is enabled. Change this attribute to enable or disable evidence finder.</p> <important> <p>When you use this attribute to disable evidence finder, Audit Manager deletes the event data store that\u00e2\u20ac\u2122s used to query your evidence data. As a result, you can\u00e2\u20ac\u2122t re-enable evidence finder and use the feature again. Your only alternative is to <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_DeregisterAccount.html\">deregister</a> and then <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_RegisterAccount.html\">re-register</a> Audit Manager. </p> </important>', 'ValidateAssessmentReportIntegrityResponse$signatureValid' => '<p> Specifies whether the signature key is valid. </p>', ], ], 'ChangeLog' => [ 'base' => '<p> The record of a change within Audit Manager. For example, this could be the status change of an assessment or the delegation of a control set. </p>', 'refs' => [ 'ChangeLogs$member' => NULL, ], ], 'ChangeLogs' => [ 'base' => NULL, 'refs' => [ 'GetChangeLogsResponse$changeLogs' => '<p>The list of user activity for the control. </p>', ], ], 'CloudTrailArn' => [ 'base' => NULL, 'refs' => [ 'EvidenceFinderEnablement$eventDataStoreArn' => '<p>The Amazon Resource Name (ARN) of the CloudTrail Lake event data store that\u00e2\u20ac\u2122s used by evidence finder. The event data store is the lake of evidence data that evidence finder runs queries against.</p>', ], ], 'ComplianceType' => [ 'base' => NULL, 'refs' => [ 'AssessmentFrameworkMetadata$complianceType' => '<p> The compliance type that the new custom framework supports, such as CIS or HIPAA. </p>', 'AssessmentFrameworkShareRequest$complianceType' => '<p>The compliance type that the shared custom framework supports, such as CIS or HIPAA.</p>', 'AssessmentMetadata$complianceType' => '<p> The name of the compliance standard that\\'s related to the assessment, such as PCI-DSS. </p>', 'AssessmentMetadataItem$complianceType' => '<p> The name of the compliance standard that\\'s related to the assessment, such as PCI-DSS. </p>', 'CreateAssessmentFrameworkRequest$complianceType' => '<p> The compliance type that the new custom framework supports, such as CIS or HIPAA. </p>', 'Framework$complianceType' => '<p> The compliance type that the framework supports, such as CIS or HIPAA. </p>', 'FrameworkMetadata$complianceType' => '<p> The compliance standard that\\'s associated with the framework. For example, this could be PCI DSS or HIPAA. </p>', 'UpdateAssessmentFrameworkRequest$complianceType' => '<p> The compliance type that the new custom framework supports, such as CIS or HIPAA. </p>', ], ], 'Control' => [ 'base' => '<p> A control in Audit Manager. </p>', 'refs' => [ 'Controls$member' => NULL, 'CreateControlResponse$control' => '<p> The new control that the <code>CreateControl</code> API returned. </p>', 'GetControlResponse$control' => '<p> The details of the control that the <code>GetControl</code> API returned. </p>', 'UpdateControlResponse$control' => '<p> The name of the updated control set that the <code>UpdateControl</code> API returned. </p>', ], ], 'ControlComment' => [ 'base' => '<p> A comment that\\'s posted by a user on a control. This includes the author\\'s name, the comment text, and a timestamp. </p>', 'refs' => [ 'ControlComments$member' => NULL, ], ], 'ControlCommentBody' => [ 'base' => NULL, 'refs' => [ 'ControlComment$commentBody' => '<p> The body text of a control comment. </p>', 'UpdateAssessmentControlRequest$commentBody' => '<p> The comment body text for the control. </p>', ], ], 'ControlComments' => [ 'base' => NULL, 'refs' => [ 'AssessmentControl$comments' => '<p> The list of comments that\\'s attached to the control. </p>', ], ], 'ControlDescription' => [ 'base' => NULL, 'refs' => [ 'AssessmentControl$description' => '<p> The description of the control. </p>', 'Control$description' => '<p> The description of the control. </p>', 'CreateControlRequest$description' => '<p> The description of the control. </p>', 'UpdateControlRequest$description' => '<p> The optional description of the control. </p>', ], ], 'ControlDomainInsights' => [ 'base' => '<p>A summary of the latest analytics data for a specific control domain.</p> <p>Control domain insights are grouped by control domain, and ranked by the highest total count of non-compliant evidence.</p>', 'refs' => [ 'ControlDomainInsightsList$member' => NULL, ], ], 'ControlDomainInsightsList' => [ 'base' => NULL, 'refs' => [ 'ListControlDomainInsightsByAssessmentResponse$controlDomainInsights' => '<p>The control domain analytics data that the <code>ListControlDomainInsightsByAssessment</code> API returned. </p>', 'ListControlDomainInsightsResponse$controlDomainInsights' => '<p>The control domain analytics data that the <code>ListControlDomainInsights</code> API returned. </p>', ], ], 'ControlInsightsMetadata' => [ 'base' => NULL, 'refs' => [ 'ListControlInsightsByControlDomainResponse$controlInsightsMetadata' => '<p>The control analytics data that the <code>ListControlInsightsByControlDomain</code> API returned. </p>', ], ], 'ControlInsightsMetadataByAssessment' => [ 'base' => NULL, 'refs' => [ 'ListAssessmentControlInsightsByControlDomainResponse$controlInsightsByAssessment' => '<p>The assessment control analytics data that the <code>ListAssessmentControlInsightsByControlDomain</code> API returned. </p>', ], ], 'ControlInsightsMetadataByAssessmentItem' => [ 'base' => '<p>A summary of the latest analytics data for a specific control in a specific active assessment.</p> <p>Control insights are grouped by control domain, and ranked by the highest total count of non-compliant evidence. </p>', 'refs' => [ 'ControlInsightsMetadataByAssessment$member' => NULL, ], ], 'ControlInsightsMetadataItem' => [ 'base' => '<p>A summary of the latest analytics data for a specific control. </p> <p>This data reflects the total counts for the specified control across all active assessments. Control insights are grouped by control domain, and ranked by the highest total count of non-compliant evidence.</p>', 'refs' => [ 'ControlInsightsMetadata$member' => NULL, ], ], 'ControlMappingSource' => [ 'base' => '<p> The data source that determines where Audit Manager collects evidence from for the control. </p>', 'refs' => [ 'ControlMappingSources$member' => NULL, ], ], 'ControlMappingSources' => [ 'base' => NULL, 'refs' => [ 'Control$controlMappingSources' => '<p> The data mapping sources for the control. </p>', 'UpdateControlRequest$controlMappingSources' => '<p> The data mapping sources for the control. </p>', ], ], 'ControlMetadata' => [ 'base' => '<p> The metadata that\\'s associated with the standard control or custom control. </p>', 'refs' => [ 'ControlMetadataList$member' => NULL, ], ], 'ControlMetadataList' => [ 'base' => NULL, 'refs' => [ 'ListControlsResponse$controlMetadataList' => '<p> A list of metadata that the <code>ListControls</code> API returns for each control.</p>', ], ], 'ControlName' => [ 'base' => NULL, 'refs' => [ 'AssessmentControl$name' => '<p> The name of the control. </p>', 'AssessmentEvidenceFolder$controlName' => '<p> The name of the control. </p>', 'Control$name' => '<p> The name of the control. </p>', 'ControlMetadata$name' => '<p> The name of the control. </p>', 'CreateControlRequest$name' => '<p> The name of the control. </p>', 'UpdateControlRequest$name' => '<p> The name of the updated control. </p>', ], ], 'ControlResponse' => [ 'base' => NULL, 'refs' => [ 'AssessmentControl$response' => '<p> The response of the control. </p>', ], ], 'ControlSet' => [ 'base' => '<p> A set of controls in Audit Manager. </p>', 'refs' => [ 'ControlSets$member' => NULL, ], ], 'ControlSetId' => [ 'base' => NULL, 'refs' => [ 'AssessmentControlSet$id' => '<p> The identifier of the control set in the assessment. This is the control set name in a plain string format. </p>', 'AssessmentEvidenceFolder$controlSetId' => '<p> The identifier for the control set. </p>', 'BatchImportEvidenceToAssessmentControlRequest$controlSetId' => '<p> The identifier for the control set. </p>', 'CreateDelegationRequest$controlSetId' => '<p> The unique identifier for the control set. </p>', 'Delegation$controlSetId' => '<p> The identifier for the control set that\\'s associated with the delegation. </p>', 'GetChangeLogsRequest$controlSetId' => '<p> The unique identifier for the control set. </p>', 'GetEvidenceByEvidenceFolderRequest$controlSetId' => '<p> The identifier for the control set. </p>', 'GetEvidenceFolderRequest$controlSetId' => '<p> The unique identifier for the control set. </p>', 'GetEvidenceFoldersByAssessmentControlRequest$controlSetId' => '<p> The identifier for the control set. </p>', 'GetEvidenceRequest$controlSetId' => '<p> The unique identifier for the control set. </p>', 'Notification$controlSetId' => '<p> The identifier for the control set. </p>', 'UpdateAssessmentControlRequest$controlSetId' => '<p> The unique identifier for the control set. </p>', ], ], 'ControlSetName' => [ 'base' => NULL, 'refs' => [ 'ControlSet$name' => '<p> The name of the control set. </p>', 'CreateAssessmentFrameworkControlSet$name' => '<p> The name of the control set. </p>', 'UpdateAssessmentFrameworkControlSet$id' => '<p> The unique identifier for the control set. </p>', 'UpdateAssessmentFrameworkControlSet$name' => '<p> The name of the control set. </p>', ], ], 'ControlSetStatus' => [ 'base' => NULL, 'refs' => [ 'AssessmentControlSet$status' => '<p> The current status of the control set. </p>', 'UpdateAssessmentControlSetStatusRequest$status' => '<p> The status of the control set that\\'s being updated. </p>', ], ], 'ControlSets' => [ 'base' => NULL, 'refs' => [ 'Framework$controlSets' => '<p> The control sets that are associated with the framework. </p>', ], ], 'ControlSetsCount' => [ 'base' => NULL, 'refs' => [ 'AssessmentFrameworkMetadata$controlSetsCount' => '<p> The number of control sets that are associated with the framework. </p>', ], ], 'ControlSources' => [ 'base' => NULL, 'refs' => [ 'Control$controlSources' => '<p> The data source types that determine where Audit Manager collects evidence from for the control. </p>', 'ControlMetadata$controlSources' => '<p> The data source that determines where Audit Manager collects evidence from for the control. </p>', 'Framework$controlSources' => '<p> The control data sources where Audit Manager collects evidence from.</p>', ], ], 'ControlStatus' => [ 'base' => NULL, 'refs' => [ 'AssessmentControl$status' => '<p> The status of the control. </p>', 'UpdateAssessmentControlRequest$controlStatus' => '<p> The status of the control. </p>', ], ], 'ControlType' => [ 'base' => NULL, 'refs' => [ 'Control$type' => '<p> Specifies whether the control is a standard control or a custom control.</p>', 'ListControlsRequest$controlType' => '<p> The type of control, such as a standard control or a custom control. </p>', ], ], 'Controls' => [ 'base' => NULL, 'refs' => [ 'ControlSet$controls' => '<p> The list of controls within the control set. </p>', ], ], 'ControlsCount' => [ 'base' => NULL, 'refs' => [ 'AssessmentFrameworkMetadata$controlsCount' => '<p> The number of controls that are associated with the framework. </p>', ], ], 'CreateAssessmentFrameworkControl' => [ 'base' => '<p> The control entity attributes that uniquely identify an existing control to be added to a framework in Audit Manager. </p>', 'refs' => [ 'CreateAssessmentFrameworkControls$member' => NULL, ], ], 'CreateAssessmentFrameworkControlSet' => [ 'base' => '<p> A <code>controlSet</code> entity that represents a collection of controls in Audit Manager. This doesn\\'t contain the control set ID. </p>', 'refs' => [ 'CreateAssessmentFrameworkControlSets$member' => NULL, ], ], 'CreateAssessmentFrameworkControlSets' => [ 'base' => NULL, 'refs' => [ 'CreateAssessmentFrameworkRequest$controlSets' => '<p> The control sets that are associated with the framework. </p>', ], ], 'CreateAssessmentFrameworkControls' => [ 'base' => NULL, 'refs' => [ 'CreateAssessmentFrameworkControlSet$controls' => '<p> The list of controls within the control set. This doesn\\'t contain the control set ID. </p>', 'UpdateAssessmentFrameworkControlSet$controls' => '<p> The list of controls that are contained within the control set. </p>', ], ], 'CreateAssessmentFrameworkRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAssessmentFrameworkResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateAssessmentReportRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAssessmentReportResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateAssessmentRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAssessmentResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateControlMappingSource' => [ 'base' => '<p> The control mapping fields that represent the source for evidence collection, along with related parameters and metadata. This doesn\\'t contain <code>mappingID</code>. </p>', 'refs' => [ 'CreateControlMappingSources$member' => NULL, ], ], 'CreateControlMappingSources' => [ 'base' => NULL, 'refs' => [ 'CreateControlRequest$controlMappingSources' => '<p> The data mapping sources for the control. </p>', ], ], 'CreateControlRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateControlResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateDelegationRequest' => [ 'base' => '<p> A collection of attributes that\\'s used to create a delegation for an assessment in Audit Manager. </p>', 'refs' => [ 'BatchCreateDelegationByAssessmentError$createDelegationRequest' => '<p> The API request to batch create delegations in Audit Manager. </p>', 'CreateDelegationRequests$member' => NULL, ], ], 'CreateDelegationRequests' => [ 'base' => NULL, 'refs' => [ 'BatchCreateDelegationByAssessmentRequest$createDelegationRequests' => '<p> The API request to batch create delegations in Audit Manager. </p>', ], ], 'CreatedBy' => [ 'base' => NULL, 'refs' => [ 'Control$createdBy' => '<p> The user or role that created the control. </p>', 'Delegation$createdBy' => '<p> The user or role that created the delegation. </p>', 'Framework$createdBy' => '<p> The user or role that created the framework. </p>', ], ], 'DefaultExportDestination' => [ 'base' => '<p>The default s3 bucket where Audit Manager saves the files that you export from evidence finder.</p>', 'refs' => [ 'Settings$defaultExportDestination' => '<p>The default S3 destination bucket for storing evidence finder exports.</p>', 'UpdateSettingsRequest$defaultExportDestination' => '<p> The default S3 destination bucket for storing evidence finder exports. </p>', ], ], 'Delegation' => [ 'base' => '<p> The assignment of a control set to a delegate for review. </p>', 'refs' => [ 'Delegations$member' => NULL, ], ], 'DelegationComment' => [ 'base' => NULL, 'refs' => [ 'CreateDelegationRequest$comment' => '<p> A comment that\\'s related to the delegation request. </p>', 'Delegation$comment' => '<p> The comment that\\'s related to the delegation. </p>', 'UpdateAssessmentControlSetStatusRequest$comment' => '<p> The comment that\\'s related to the status update. </p>', ], ], 'DelegationIds' => [ 'base' => NULL, 'refs' => [ 'BatchDeleteDelegationByAssessmentRequest$delegationIds' => '<p> The identifiers for the delegations. </p>', ], ], 'DelegationMetadata' => [ 'base' => '<p> The metadata that\\'s associated with the delegation. </p>', 'refs' => [ 'DelegationMetadataList$member' => NULL, ], ], 'DelegationMetadataList' => [ 'base' => NULL, 'refs' => [ 'GetDelegationsResponse$delegations' => '<p> The list of delegations that the <code>GetDelegations</code> API returned. </p>', ], ], 'DelegationStatus' => [ 'base' => NULL, 'refs' => [ 'Delegation$status' => '<p> The status of the delegation. </p>', 'DelegationMetadata$status' => '<p> The current status of the delegation. </p>', ], ], 'Delegations' => [ 'base' => NULL, 'refs' => [ 'AssessmentControlSet$delegations' => '<p> The delegations that are associated with the control set. </p>', 'AssessmentMetadata$delegations' => '<p> The delegations that are associated with the assessment. </p>', 'AssessmentMetadataItem$delegations' => '<p> The delegations that are associated with the assessment. </p>', 'BatchCreateDelegationByAssessmentResponse$delegations' => '<p> The delegations that are associated with the assessment. </p>', ], ], 'DeleteAssessmentFrameworkRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAssessmentFrameworkResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAssessmentFrameworkShareRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAssessmentFrameworkShareResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAssessmentReportRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAssessmentReportResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAssessmentRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAssessmentResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteControlRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteControlResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteResources' => [ 'base' => NULL, 'refs' => [ 'DeregistrationPolicy$deleteResources' => '<p>Specifies which Audit Manager data will be deleted when you deregister Audit Manager.</p> <ul> <li> <p>If you set the value to <code>ALL</code>, all of your data is deleted within seven days of deregistration.</p> </li> <li> <p>If you set the value to <code>DEFAULT</code>, none of your data is deleted at the time of deregistration. However, keep in mind that the Audit Manager data retention policy still applies. As a result, any evidence data will be deleted two years after its creation date. Your other Audit Manager resources will continue to exist indefinitely.</p> </li> </ul>', ], ], 'DeregisterAccountRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeregisterAccountResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeregisterOrganizationAdminAccountRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeregisterOrganizationAdminAccountResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeregistrationPolicy' => [ 'base' => '<p>The deregistration policy for the data that\\'s stored in Audit Manager. You can use this attribute to determine how your data is handled when you <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_DeregisterAccount.html\">deregister Audit Manager</a>.</p> <p>By default, Audit Manager retains evidence data for two years from the time of its creation. Other Audit Manager resources (including assessments, custom controls, and custom frameworks) remain in Audit Manager indefinitely, and are available if you <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_RegisterAccount.html\">re-register Audit Manager</a> in the future. For more information about data retention, see <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/data-protection.html\">Data Protection</a> in the <i>Audit Manager User Guide</i>.</p> <important> <p>If you choose to delete all data, this action permanently deletes all evidence data in your account within seven days. It also deletes all of the Audit Manager resources that you created, including assessments, custom controls, and custom frameworks. Your data will not be available if you re-register Audit Manager in the future.</p> </important>', 'refs' => [ 'Settings$deregistrationPolicy' => '<p>The deregistration policy for your Audit Manager data. You can use this attribute to determine how your data is handled when you deregister Audit Manager.</p>', 'UpdateSettingsRequest$deregistrationPolicy' => '<p>The deregistration policy for your Audit Manager data. You can use this attribute to determine how your data is handled when you deregister Audit Manager.</p>', ], ], 'DisassociateAssessmentReportEvidenceFolderRequest' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateAssessmentReportEvidenceFolderResponse' => [ 'base' => NULL, 'refs' => [], ], 'EmailAddress' => [ 'base' => NULL, 'refs' => [ 'AWSAccount$emailAddress' => '<p> The email address that\\'s associated with the Amazon Web Services account. </p>', ], ], 'ErrorCode' => [ 'base' => NULL, 'refs' => [ 'AssessmentReportEvidenceError$errorCode' => '<p> The error code that was returned. </p>', 'BatchCreateDelegationByAssessmentError$errorCode' => '<p> The error code that the <code>BatchCreateDelegationByAssessment</code> API returned. </p>', 'BatchDeleteDelegationByAssessmentError$errorCode' => '<p> The error code that the <code>BatchDeleteDelegationByAssessment</code> API returned. </p>', 'BatchImportEvidenceToAssessmentControlError$errorCode' => '<p> The error code that the <code>BatchImportEvidenceToAssessmentControl</code> API returned. </p>', ], ], 'ErrorMessage' => [ 'base' => NULL, 'refs' => [ 'AssessmentReportEvidenceError$errorMessage' => '<p> The error message that was returned. </p>', 'BatchCreateDelegationByAssessmentError$errorMessage' => '<p> The error message that the <code>BatchCreateDelegationByAssessment</code> API returned. </p>', 'BatchDeleteDelegationByAssessmentError$errorMessage' => '<p> The error message that the <code>BatchDeleteDelegationByAssessment</code> API returned. </p>', 'BatchImportEvidenceToAssessmentControlError$errorMessage' => '<p> The error message that the <code>BatchImportEvidenceToAssessmentControl</code> API returned. </p>', 'EvidenceFinderEnablement$error' => '<p>Represents any errors that occurred when enabling or disabling evidence finder. </p>', ], ], 'EventName' => [ 'base' => NULL, 'refs' => [ 'Evidence$eventName' => '<p> The name of the evidence event. </p>', ], ], 'Evidence' => [ 'base' => '<p> A record that contains the information needed to demonstrate compliance with the requirements specified by a control. Examples of evidence include change activity invoked by a user, or a system configuration snapshot. </p>', 'refs' => [ 'EvidenceList$member' => NULL, 'GetEvidenceResponse$evidence' => '<p> The evidence that the <code>GetEvidence</code> API returned. </p>', ], ], 'EvidenceAttributeKey' => [ 'base' => NULL, 'refs' => [ 'EvidenceAttributes$key' => NULL, ], ], 'EvidenceAttributeValue' => [ 'base' => NULL, 'refs' => [ 'EvidenceAttributes$value' => NULL, ], ], 'EvidenceAttributes' => [ 'base' => NULL, 'refs' => [ 'Evidence$attributes' => '<p> The names and values that are used by the evidence event. This includes an attribute name (such as <code>allowUsersToChangePassword</code>) and value (such as <code>true</code> or <code>false</code>). </p>', ], ], 'EvidenceFinderBackfillStatus' => [ 'base' => NULL, 'refs' => [ 'EvidenceFinderEnablement$backfillStatus' => '<p>The current status of the evidence data backfill process. </p> <p>The backfill starts after you enable evidence finder. During this task, Audit Manager populates an event data store with your past two years\u00e2\u20ac\u2122 worth of evidence data so that your evidence can be queried.</p> <ul> <li> <p> <code>NOT_STARTED</code> means that the backfill hasn\u00e2\u20ac\u2122t started yet. </p> </li> <li> <p> <code>IN_PROGRESS</code> means that the backfill is in progress. This can take up to 7 days to complete, depending on the amount of evidence data. </p> </li> <li> <p> <code>COMPLETED</code> means that the backfill is complete. All of your past evidence is now queryable. </p> </li> </ul>', ], ], 'EvidenceFinderEnablement' => [ 'base' => '<p>The settings object that specifies whether evidence finder is enabled. This object also describes the related event data store, and the backfill status for populating the event data store with evidence data.</p>', 'refs' => [ 'Settings$evidenceFinderEnablement' => '<p>The current evidence finder status and event data store details.</p>', ], ], 'EvidenceFinderEnablementStatus' => [ 'base' => NULL, 'refs' => [ 'EvidenceFinderEnablement$enablementStatus' => '<p>The current status of the evidence finder feature and the related event data store. </p> <ul> <li> <p> <code>ENABLE_IN_PROGRESS</code> means that you requested to enable evidence finder. An event data store is currently being created to support evidence finder queries.</p> </li> <li> <p> <code>ENABLED</code> means that an event data store was successfully created and evidence finder is enabled. We recommend that you wait 7 days until the event data store is backfilled with your past two years\u00e2\u20ac\u2122 worth of evidence data. You can use evidence finder in the meantime, but not all data might be available until the backfill is complete.</p> </li> <li> <p> <code>DISABLE_IN_PROGRESS</code> means that you requested to disable evidence finder, and your request is pending the deletion of the event data store.</p> </li> <li> <p> <code>DISABLED</code> means that you have permanently disabled evidence finder and the event data store has been deleted. You can\\'t re-enable evidence finder after this point.</p> </li> </ul>', ], ], 'EvidenceIds' => [ 'base' => NULL, 'refs' => [ 'BatchAssociateAssessmentReportEvidenceRequest$evidenceIds' => '<p> The list of evidence identifiers. </p>', 'BatchAssociateAssessmentReportEvidenceResponse$evidenceIds' => '<p> The list of evidence identifiers. </p>', 'BatchDisassociateAssessmentReportEvidenceRequest$evidenceIds' => '<p> The list of evidence identifiers. </p>', 'BatchDisassociateAssessmentReportEvidenceResponse$evidenceIds' => '<p> The identifier for the evidence. </p>', ], ], 'EvidenceInsights' => [ 'base' => '<p>A breakdown of the latest compliance check status for the evidence in your Audit Manager assessments. </p>', 'refs' => [ 'ControlDomainInsights$evidenceInsights' => '<p>A breakdown of the compliance check status for the evidence that\u00e2\u20ac\u2122s associated with the control domain. </p>', 'ControlInsightsMetadataByAssessmentItem$evidenceInsights' => '<p>A breakdown of the compliance check status for the evidence that\u00e2\u20ac\u2122s associated with the assessment control. </p>', 'ControlInsightsMetadataItem$evidenceInsights' => '<p>A breakdown of the compliance check status for the evidence that\u00e2\u20ac\u2122s associated with the control. </p>', ], ], 'EvidenceList' => [ 'base' => NULL, 'refs' => [ 'GetEvidenceByEvidenceFolderResponse$evidence' => '<p> The list of evidence that the <code>GetEvidenceByEvidenceFolder</code> API returned. </p>', ], ], 'EvidenceSources' => [ 'base' => NULL, 'refs' => [ 'AssessmentControl$evidenceSources' => '<p> The list of data sources for the evidence. </p>', ], ], 'ExportDestinationType' => [ 'base' => NULL, 'refs' => [ 'DefaultExportDestination$destinationType' => '<p>The destination type, such as Amazon S3.</p>', ], ], 'Filename' => [ 'base' => NULL, 'refs' => [ 'AssessmentFrameworkMetadata$logo' => '<p> The logo that\\'s associated with the framework. </p>', 'Framework$logo' => '<p> The logo that\\'s associated with the framework. </p>', 'FrameworkMetadata$logo' => '<p> The logo that\\'s associated with the framework. </p>', ], ], 'Framework' => [ 'base' => '<p> The file that\\'s used to structure and automate Audit Manager assessments for a given compliance standard. </p>', 'refs' => [ 'CreateAssessmentFrameworkResponse$framework' => '<p> The name of the new framework that the <code>CreateAssessmentFramework</code> API returned. </p>', 'GetAssessmentFrameworkResponse$framework' => '<p> The framework that the <code>GetAssessmentFramework</code> API returned. </p>', 'UpdateAssessmentFrameworkResponse$framework' => '<p> The name of the framework. </p>', ], ], 'FrameworkDescription' => [ 'base' => NULL, 'refs' => [ 'AssessmentFrameworkMetadata$description' => '<p> The description of the framework. </p>', 'AssessmentFrameworkShareRequest$frameworkDescription' => '<p>The description of the shared custom framework.</p>', 'CreateAssessmentFrameworkRequest$description' => '<p> An optional description for the new custom framework. </p>', 'Framework$description' => '<p> The description of the framework. </p>', 'UpdateAssessmentFrameworkRequest$description' => '<p> The description of the updated framework. </p>', ], ], 'FrameworkMetadata' => [ 'base' => '<p> The metadata of a framework, such as the name, ID, or description. </p>', 'refs' => [ 'AssessmentFramework$metadata' => NULL, ], ], 'FrameworkMetadataList' => [ 'base' => NULL, 'refs' => [ 'ListAssessmentFrameworksResponse$frameworkMetadataList' => '<p> A list of metadata that the <code>ListAssessmentFrameworks</code> API returns for each framework.</p>', ], ], 'FrameworkName' => [ 'base' => NULL, 'refs' => [ 'AssessmentFrameworkMetadata$name' => '<p> The name of the framework. </p>', 'AssessmentFrameworkShareRequest$frameworkName' => '<p> The name of the custom framework that the share request is for. </p>', 'CreateAssessmentFrameworkRequest$name' => '<p> The name of the new custom framework. </p>', 'Framework$name' => '<p> The name of the framework. </p>', 'UpdateAssessmentFrameworkRequest$name' => '<p> The name of the framework to be updated. </p>', ], ], 'FrameworkType' => [ 'base' => NULL, 'refs' => [ 'AssessmentFrameworkMetadata$type' => '<p> The framework type, such as a standard framework or a custom framework. </p>', 'Framework$type' => '<p> Specifies whether the framework is a standard framework or a custom framework.</p>', 'ListAssessmentFrameworksRequest$frameworkType' => '<p> The type of framework, such as a standard framework or a custom framework. </p>', ], ], 'GenericArn' => [ 'base' => NULL, 'refs' => [ 'Resource$arn' => '<p> The Amazon Resource Name (ARN) for the resource. </p>', ], ], 'GetAccountStatusRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetAccountStatusResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetAssessmentFrameworkRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetAssessmentFrameworkResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetAssessmentReportUrlRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetAssessmentReportUrlResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetAssessmentRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetAssessmentResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetChangeLogsRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetChangeLogsResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetControlRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetControlResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetDelegationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetDelegationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetEvidenceByEvidenceFolderRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetEvidenceByEvidenceFolderResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetEvidenceFileUploadUrlRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetEvidenceFileUploadUrlResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetEvidenceFolderRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetEvidenceFolderResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetEvidenceFoldersByAssessmentControlRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetEvidenceFoldersByAssessmentControlResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetEvidenceFoldersByAssessmentRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetEvidenceFoldersByAssessmentResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetEvidenceRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetEvidenceResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetInsightsByAssessmentRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetInsightsByAssessmentResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetInsightsRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetInsightsResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetOrganizationAdminAccountRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetOrganizationAdminAccountResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetServicesInScopeRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetServicesInScopeResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetSettingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetSettingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'HyperlinkName' => [ 'base' => NULL, 'refs' => [ 'URL$hyperlinkName' => '<p> The name or word that\\'s used as a hyperlink to the URL. </p>', ], ], 'IamArn' => [ 'base' => NULL, 'refs' => [ 'ChangeLog$createdBy' => '<p> The user or role that performed the action. </p>', 'CreateDelegationRequest$roleArn' => '<p> The Amazon Resource Name (ARN) of the IAM role. </p>', 'Delegation$roleArn' => '<p> The Amazon Resource Name (ARN) of the IAM role. </p>', 'DelegationMetadata$roleArn' => '<p> The Amazon Resource Name (ARN) of the IAM role. </p>', 'Evidence$iamId' => '<p> The unique identifier for the user or role that\\'s associated with the evidence. </p>', 'Role$roleArn' => '<p> The Amazon Resource Name (ARN) of the IAM role. </p>', ], ], 'Insights' => [ 'base' => '<p>A summary of the latest analytics data for all your active assessments. </p> <p>This summary is a snapshot of the data that your active assessments collected on the <code>lastUpdated</code> date. It\u00e2\u20ac\u2122s important to understand that the following totals are daily counts based on this date \u00e2\u20ac\u201d they aren\u00e2\u20ac\u2122t a total sum to date. </p> <p>The <code>Insights</code> data is eventually consistent. This means that, when you read data from <code>Insights</code>, the response might not instantly reflect the results of a recently completed write or update operation. If you repeat your read request after a few hours, the response should return the latest data.</p> <note> <p>If you delete an assessment or change its status to inactive, <code>InsightsByAssessment</code> includes data for that assessment as follows.</p> <ul> <li> <p> <b>Inactive assessments</b> - If Audit Manager collected evidence for your assessment before you changed it inactive, that evidence is included in the <code>InsightsByAssessment</code> counts for that day.</p> </li> <li> <p> <b>Deleted assessments</b> - If Audit Manager collected evidence for your assessment before you deleted it, that evidence isn\\'t included in the <code>InsightsByAssessment</code> counts for that day.</p> </li> </ul> </note>', 'refs' => [ 'GetInsightsResponse$insights' => '<p>The analytics data that the <code>GetInsights</code> API returned. </p>', ], ], 'InsightsByAssessment' => [ 'base' => '<p>A summary of the latest analytics data for a specific active assessment.</p> <p>This summary is a snapshot of the data that was collected on the <code>lastUpdated</code> date. It\u00e2\u20ac\u2122s important to understand that the totals in <code>InsightsByAssessment</code> are daily counts based on this date \u00e2\u20ac\u201d they aren\u00e2\u20ac\u2122t a total sum to date. </p> <p>The <code>InsightsByAssessment</code> data is eventually consistent. This means that when you read data from <code>InsightsByAssessment</code>, the response might not instantly reflect the results of a recently completed write or update operation. If you repeat your read request after a few hours, the response returns the latest data.</p> <note> <p>If you delete an assessment or change its status to inactive, <code>InsightsByAssessment</code> includes data for that assessment as follows.</p> <ul> <li> <p> <b>Inactive assessments</b> - If Audit Manager collected evidence for your assessment before you changed it inactive, that evidence is included in the <code>InsightsByAssessment</code> counts for that day.</p> </li> <li> <p> <b>Deleted assessments</b> - If Audit Manager collected evidence for your assessment before you deleted it, that evidence isn\\'t included in the <code>InsightsByAssessment</code> counts for that day.</p> </li> </ul> </note>', 'refs' => [ 'GetInsightsByAssessmentResponse$insights' => '<p> The assessment analytics data that the <code>GetInsightsByAssessment</code> API returned. </p>', ], ], 'Integer' => [ 'base' => NULL, 'refs' => [ 'AssessmentControl$evidenceCount' => '<p> The amount of evidence that\\'s collected for the control. </p>', 'AssessmentControl$assessmentReportEvidenceCount' => '<p> The amount of evidence in the assessment report. </p>', 'AssessmentControlSet$systemEvidenceCount' => '<p> The total number of evidence objects that are retrieved automatically for the control set. </p>', 'AssessmentControlSet$manualEvidenceCount' => '<p> The total number of evidence objects that are uploaded manually to the control set. </p>', 'AssessmentEvidenceFolder$totalEvidence' => '<p> The total amount of evidence in the evidence folder. </p>', 'AssessmentEvidenceFolder$assessmentReportSelectionCount' => '<p> The total count of evidence that\\'s included in the assessment report. </p>', 'AssessmentEvidenceFolder$evidenceResourcesIncludedCount' => '<p> The amount of evidence that\\'s included in the evidence folder. </p>', 'AssessmentEvidenceFolder$evidenceByTypeConfigurationDataCount' => '<p> The number of evidence that falls under the configuration data category. This evidence is collected from configuration snapshots of other Amazon Web Services such as Amazon EC2, Amazon S3, or IAM. </p>', 'AssessmentEvidenceFolder$evidenceByTypeManualCount' => '<p> The number of evidence that falls under the manual category. This evidence is imported manually. </p>', 'AssessmentEvidenceFolder$evidenceByTypeComplianceCheckCount' => '<p> The number of evidence that falls under the compliance check category. This evidence is collected from Config or Security Hub. </p>', 'AssessmentEvidenceFolder$evidenceByTypeComplianceCheckIssuesCount' => '<p> The total number of issues that were reported directly from Security Hub, Config, or both. </p>', 'AssessmentEvidenceFolder$evidenceByTypeUserActivityCount' => '<p> The number of evidence that falls under the user activity category. This evidence is collected from CloudTrail logs. </p>', 'AssessmentEvidenceFolder$evidenceAwsServiceSourceCount' => '<p> The total number of Amazon Web Services resources that were assessed to generate the evidence. </p>', ], ], 'InternalServerException' => [ 'base' => '<p> An internal service error occurred during the processing of your request. Try again later. </p>', 'refs' => [], ], 'KeywordInputType' => [ 'base' => NULL, 'refs' => [ 'SourceKeyword$keywordInputType' => '<p> The input method for the keyword. </p> <ul> <li> <p> <code>SELECT_FROM_LIST</code> is used when mapping a data source for automated evidence.</p> <ul> <li> <p>When <code>keywordInputType</code> is <code>SELECT_FROM_LIST</code>, a keyword must be selected to collect automated evidence. For example, this keyword can be a CloudTrail event name, a rule name for Config, a Security Hub control, or the name of an Amazon Web Services API call.</p> </li> </ul> </li> <li> <p> <code>UPLOAD_FILE</code> and <code>INPUT_TEXT</code> are only used when mapping a data source for manual evidence.</p> <ul> <li> <p>When <code>keywordInputType</code> is <code>UPLOAD_FILE</code>, a file must be uploaded as manual evidence.</p> </li> <li> <p>When <code>keywordInputType</code> is <code>INPUT_TEXT</code>, text must be entered as manual evidence.</p> </li> </ul> </li> </ul>', ], ], 'KeywordValue' => [ 'base' => NULL, 'refs' => [ 'Keywords$member' => NULL, 'SourceKeyword$keywordValue' => '<p> The value of the keyword that\\'s used when mapping a control data source. For example, this can be a CloudTrail event name, a rule name for Config, a Security Hub control, or the name of an Amazon Web Services API call. </p> <p>If you\u00e2\u20ac\u2122re mapping a data source to a rule in Config, the <code>keywordValue</code> that you specify depends on the type of rule:</p> <ul> <li> <p>For <a href=\"https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_use-managed-rules.html\">managed rules</a>, you can use the rule identifier as the <code>keywordValue</code>. You can find the rule identifier from the <a href=\"https://docs.aws.amazon.com/config/latest/developerguide/managed-rules-by-aws-config.html\">list of Config managed rules</a>. For some rules, the rule identifier is different from the rule name. For example, the rule name <code>restricted-ssh</code> has the following rule identifier: <code>INCOMING_SSH_DISABLED</code>. Make sure to use the rule identifier, not the rule name. </p> <p>Keyword example for managed rules:</p> <ul> <li> <p>Managed rule name: <a href=\"https://docs.aws.amazon.com/config/latest/developerguide/s3-bucket-acl-prohibited.html\">s3-bucket-acl-prohibited</a> </p> <p> <code>keywordValue</code>: <code>S3_BUCKET_ACL_PROHIBITED</code> </p> </li> </ul> </li> <li> <p>For <a href=\"https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_develop-rules.html\">custom rules</a>, you form the <code>keywordValue</code> by adding the <code>Custom_</code> prefix to the rule name. This prefix distinguishes the custom rule from a managed rule. </p> <p>Keyword example for custom rules:</p> <ul> <li> <p>Custom rule name: my-custom-config-rule</p> <p> <code>keywordValue</code>: <code>Custom_my-custom-config-rule</code> </p> </li> </ul> </li> <li> <p>For <a href=\"https://docs.aws.amazon.com/config/latest/developerguide/service-linked-awsconfig-rules.html\">service-linked rules</a>, you form the <code>keywordValue</code> by adding the <code>Custom_</code> prefix to the rule name. In addition, you remove the suffix ID that appears at the end of the rule name. </p> <p>Keyword examples for service-linked rules:</p> <ul> <li> <p>Service-linked rule name: CustomRuleForAccount-conformance-pack-szsm1uv0w</p> <p> <code>keywordValue</code>: <code>Custom_CustomRuleForAccount-conformance-pack</code> </p> </li> <li> <p>Service-linked rule name: OrgConfigRule-s3-bucket-versioning-enabled-dbgzf8ba</p> <p> <code>keywordValue</code>: <code>Custom_OrgConfigRule-s3-bucket-versioning-enabled</code> </p> </li> </ul> </li> </ul> <important> <p>The <code>keywordValue</code> is case sensitive. If you enter a value incorrectly, Audit Manager might not recognize the data source mapping. As a result, you might not successfully collect evidence from that data source as intended. </p> <p>Keep in mind the following requirements, depending on the data source type that you\\'re using. </p> <ol> <li> <p>For Config: </p> <ul> <li> <p>For managed rules, make sure that the <code>keywordValue</code> is the rule identifier in <code>ALL_CAPS_WITH_UNDERSCORES</code>. For example, <code>CLOUDWATCH_LOG_GROUP_ENCRYPTED</code>. For accuracy, we recommend that you reference the list of <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/control-data-sources-config.html\">supported Config managed rules</a>.</p> </li> <li> <p>For custom rules, make sure that the <code>keywordValue</code> has the <code>Custom_</code> prefix followed by the custom rule name. The format of the custom rule name itself may vary. For accuracy, we recommend that you visit the <a href=\"https://console.aws.amazon.com/config/\">Config console</a> to verify your custom rule name.</p> </li> </ul> </li> <li> <p>For Security Hub: The format varies for Security Hub control names. For accuracy, we recommend that you reference the list of <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/control-data-sources-ash.html\">supported Security Hub controls</a>.</p> </li> <li> <p>For Amazon Web Services API calls: Make sure that the <code>keywordValue</code> is written as <code>serviceprefix_ActionName</code>. For example, <code>iam_ListGroups</code>. For accuracy, we recommend that you reference the list of <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/control-data-sources-api.html\">supported API calls</a>.</p> </li> <li> <p>For CloudTrail: Make sure that the <code>keywordValue</code> is written as <code>serviceprefix_ActionName</code>. For example, <code>cloudtrail_StartLogging</code>. For accuracy, we recommend that you review the Amazon Web Service prefix and action names in the <a href=\"https://docs.aws.amazon.com/service-authorization/latest/reference/reference_policies_actions-resources-contextkeys.html\">Service Authorization Reference</a>.</p> </li> </ol> </important>', ], ], 'Keywords' => [ 'base' => NULL, 'refs' => [ 'ListKeywordsForDataSourceResponse$keywords' => '<p> The list of keywords for the event mapping source. </p>', ], ], 'KmsKey' => [ 'base' => NULL, 'refs' => [ 'RegisterAccountRequest$kmsKey' => '<p> The KMS key details. </p>', 'Settings$kmsKey' => '<p> The KMS key details. </p>', 'UpdateSettingsRequest$kmsKey' => '<p> The KMS key details. </p>', ], ], 'LastUpdatedBy' => [ 'base' => NULL, 'refs' => [ 'Control$lastUpdatedBy' => '<p> The user or role that most recently updated the control. </p>', 'Framework$lastUpdatedBy' => '<p> The user or role that most recently updated the framework. </p>', ], ], 'ListAssessmentControlInsightsByControlDomainRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAssessmentControlInsightsByControlDomainResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListAssessmentFrameworkShareRequestsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAssessmentFrameworkShareRequestsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListAssessmentFrameworksRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAssessmentFrameworksResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListAssessmentMetadata' => [ 'base' => NULL, 'refs' => [ 'ListAssessmentsResponse$assessmentMetadata' => '<p>The metadata that the <code>ListAssessments</code> API returns for each assessment.</p>', ], ], 'ListAssessmentReportsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAssessmentReportsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListAssessmentsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAssessmentsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListControlDomainInsightsByAssessmentRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListControlDomainInsightsByAssessmentResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListControlDomainInsightsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListControlDomainInsightsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListControlInsightsByControlDomainRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListControlInsightsByControlDomainResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListControlsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListControlsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListKeywordsForDataSourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListKeywordsForDataSourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListNotificationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListNotificationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'ManualEvidence' => [ 'base' => '<p> Evidence that\\'s manually added to a control in Audit Manager. <code>manualEvidence</code> can be one of the following: <code>evidenceFileName</code>, <code>s3ResourcePath</code>, or <code>textResponse</code>.</p>', 'refs' => [ 'BatchImportEvidenceToAssessmentControlError$manualEvidence' => '<p> Manual evidence that can\\'t be collected automatically by Audit Manager. </p>', 'ManualEvidenceList$member' => NULL, ], ], 'ManualEvidenceList' => [ 'base' => NULL, 'refs' => [ 'BatchImportEvidenceToAssessmentControlRequest$manualEvidence' => '<p> The list of manual evidence objects. </p>', ], ], 'ManualEvidenceLocalFileName' => [ 'base' => NULL, 'refs' => [ 'GetEvidenceFileUploadUrlRequest$fileName' => '<p>The file that you want to upload. For a list of supported file formats, see <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/upload-evidence.html#supported-manual-evidence-files\">Supported file types for manual evidence</a> in the <i>Audit Manager User Guide</i>.</p>', 'ManualEvidence$evidenceFileName' => '<p>The name of the file that\\'s uploaded as manual evidence. This name is populated using the <code>evidenceFileName</code> value from the <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_GetEvidenceFileUploadUrl.html\"> <code>GetEvidenceFileUploadUrl</code> </a> API response.</p>', ], ], 'ManualEvidenceTextResponse' => [ 'base' => NULL, 'refs' => [ 'ManualEvidence$textResponse' => '<p>The plain text response that\\'s entered and saved as manual evidence.</p>', ], ], 'MaxResults' => [ 'base' => 'Max results in the page.', 'refs' => [ 'GetChangeLogsRequest$maxResults' => '<p>Represents the maximum number of results on a page or for an API request call. </p>', 'GetDelegationsRequest$maxResults' => '<p> Represents the maximum number of results on a page or for an API request call. </p>', 'GetEvidenceByEvidenceFolderRequest$maxResults' => '<p> Represents the maximum number of results on a page or for an API request call. </p>', 'GetEvidenceFoldersByAssessmentControlRequest$maxResults' => '<p> Represents the maximum number of results on a page or for an API request call. </p>', 'GetEvidenceFoldersByAssessmentRequest$maxResults' => '<p> Represents the maximum number of results on a page or for an API request call. </p>', 'ListAssessmentControlInsightsByControlDomainRequest$maxResults' => '<p>Represents the maximum number of results on a page or for an API request call. </p>', 'ListAssessmentFrameworkShareRequestsRequest$maxResults' => '<p> Represents the maximum number of results on a page or for an API request call. </p>', 'ListAssessmentFrameworksRequest$maxResults' => '<p> Represents the maximum number of results on a page or for an API request call. </p>', 'ListAssessmentReportsRequest$maxResults' => '<p> Represents the maximum number of results on a page or for an API request call. </p>', 'ListAssessmentsRequest$maxResults' => '<p> Represents the maximum number of results on a page or for an API request call. </p>', 'ListControlDomainInsightsByAssessmentRequest$maxResults' => '<p>Represents the maximum number of results on a page or for an API request call. </p>', 'ListControlDomainInsightsRequest$maxResults' => '<p>Represents the maximum number of results on a page or for an API request call. </p>', 'ListControlInsightsByControlDomainRequest$maxResults' => '<p>Represents the maximum number of results on a page or for an API request call. </p>', 'ListControlsRequest$maxResults' => '<p> Represents the maximum number of results on a page or for an API request call. </p>', 'ListKeywordsForDataSourceRequest$maxResults' => '<p> Represents the maximum number of results on a page or for an API request call. </p>', 'ListNotificationsRequest$maxResults' => '<p> Represents the maximum number of results on a page or for an API request call. </p>', ], ], 'NonEmptyString' => [ 'base' => NULL, 'refs' => [ 'AssessmentControlSet$description' => '<p> The description for the control set. </p>', 'ChangeLog$objectName' => '<p> The name of the object that changed. This could be the name of an assessment, control, or control set.</p>', 'ControlDomainInsights$name' => '<p>The name of the control domain. </p>', 'ControlInsightsMetadataByAssessmentItem$name' => '<p>The name of the assessment control. </p>', 'ControlInsightsMetadataByAssessmentItem$controlSetName' => '<p>The name of the control set that the assessment control belongs to. </p>', 'ControlInsightsMetadataItem$name' => '<p>The name of the control. </p>', 'DelegationMetadata$controlSetName' => '<p> Specifies the name of the control set that was delegated for review. </p>', 'EvidenceSources$member' => NULL, 'GetEvidenceFileUploadUrlResponse$evidenceFileName' => '<p>The name of the uploaded manual evidence file that the presigned URL was generated for.</p>', 'GetEvidenceFileUploadUrlResponse$uploadUrl' => '<p>The presigned URL that was generated.</p>', 'Notification$controlSetName' => '<p> Specifies the name of the control set that the notification is about. </p>', 'Notification$description' => '<p> The description of the notification. </p>', 'Notification$source' => '<p> The sender of the notification. </p>', 'ServiceMetadata$displayName' => '<p> The display name of the Amazon Web Service. </p>', 'ServiceMetadata$description' => '<p> The description of the Amazon Web Service. </p>', 'ServiceMetadata$category' => '<p> The category that the Amazon Web Service belongs to, such as compute, storage, or database. </p>', 'ValidationErrors$member' => NULL, ], ], 'Notification' => [ 'base' => '<p> The notification that informs a user of an update in Audit Manager. For example, this includes the notification that\\'s sent when a control set is delegated for review. </p>', 'refs' => [ 'Notifications$member' => NULL, ], ], 'Notifications' => [ 'base' => NULL, 'refs' => [ 'ListNotificationsResponse$notifications' => '<p> The returned list of notifications. </p>', ], ], 'NullableInteger' => [ 'base' => NULL, 'refs' => [ 'AssessmentFrameworkShareRequest$standardControlsCount' => '<p>The number of standard controls that are part of the shared custom framework. </p>', 'AssessmentFrameworkShareRequest$customControlsCount' => '<p>The number of custom controls that are part of the shared custom framework.</p>', 'ControlDomainInsights$controlsCountByNoncompliantEvidence' => '<p>The number of controls in the control domain that collected non-compliant evidence on the <code>lastUpdated</code> date. </p>', 'ControlDomainInsights$totalControlsCount' => '<p>The total number of controls in the control domain. </p>', 'EvidenceInsights$noncompliantEvidenceCount' => '<p>The number of compliance check evidence that Audit Manager classified as non-compliant. This includes evidence that was collected from Security Hub with a <i>Fail</i> ruling, or collected from Config with a <i>Non-compliant</i> ruling. </p>', 'EvidenceInsights$compliantEvidenceCount' => '<p>The number of compliance check evidence that Audit Manager classified as compliant. This includes evidence that was collected from Security Hub with a <i>Pass</i> ruling, or collected from Config with a <i>Compliant</i> ruling. </p>', 'EvidenceInsights$inconclusiveEvidenceCount' => '<p>The number of evidence that a compliance check ruling isn\\'t available for. Evidence is inconclusive when the associated control uses Security Hub or Config as a data source but you didn\\'t enable those services. This is also the case when a control uses a data source that doesn\u00e2\u20ac\u2122t support compliance checks (for example, manual evidence, API calls, or CloudTrail). </p> <note> <p>If evidence has a compliance check status of <i>not applicable</i> in the console, it\\'s classified as <i>inconclusive</i> in <code>EvidenceInsights</code> data.</p> </note>', 'Insights$activeAssessmentsCount' => '<p>The number of active assessments in Audit Manager. </p>', 'Insights$noncompliantEvidenceCount' => '<p>The number of compliance check evidence that Audit Manager classified as non-compliant on the <code>lastUpdated</code> date. This includes evidence that was collected from Security Hub with a <i>Fail</i> ruling, or collected from Config with a <i>Non-compliant</i> ruling. </p>', 'Insights$compliantEvidenceCount' => '<p>The number of compliance check evidence that Audit Manager classified as compliant on the <code>lastUpdated</code> date. This includes evidence that was collected from Security Hub with a <i>Pass</i> ruling, or collected from Config with a <i>Compliant</i> ruling. </p>', 'Insights$inconclusiveEvidenceCount' => '<p>The number of evidence without a compliance check ruling. Evidence is inconclusive when the associated control uses Security Hub or Config as a data source but you didn\\'t enable those services. This is also the case when a control uses a data source that doesn\u00e2\u20ac\u2122t support compliance checks (for example: manual evidence, API calls, or CloudTrail). </p> <note> <p>If evidence has a compliance check status of <i>not applicable</i>, it\\'s classed as <i>inconclusive</i> in <code>Insights</code> data.</p> </note>', 'Insights$assessmentControlsCountByNoncompliantEvidence' => '<p>The number of assessment controls that collected non-compliant evidence on the <code>lastUpdated</code> date. </p>', 'Insights$totalAssessmentControlsCount' => '<p>The total number of controls across all active assessments. </p>', 'InsightsByAssessment$noncompliantEvidenceCount' => '<p>The number of compliance check evidence that Audit Manager classified as non-compliant. This includes evidence that was collected from Security Hub with a <i>Fail</i> ruling, or collected from Config with a <i>Non-compliant</i> ruling. </p>', 'InsightsByAssessment$compliantEvidenceCount' => '<p>The number of compliance check evidence that Audit Manager classified as compliant. This includes evidence that was collected from Security Hub with a <i>Pass</i> ruling, or collected from Config with a <i>Compliant</i> ruling. </p>', 'InsightsByAssessment$inconclusiveEvidenceCount' => '<p>The amount of evidence without a compliance check ruling. Evidence is inconclusive if the associated control uses Security Hub or Config as a data source and you didn\\'t enable those services. This is also the case if a control uses a data source that doesn\u00e2\u20ac\u2122t support compliance checks (for example, manual evidence, API calls, or CloudTrail). </p> <note> <p>If evidence has a compliance check status of <i>not applicable</i>, it\\'s classified as <i>inconclusive</i> in <code>InsightsByAssessment</code> data.</p> </note>', 'InsightsByAssessment$assessmentControlsCountByNoncompliantEvidence' => '<p>The number of assessment controls that collected non-compliant evidence on the <code>lastUpdated</code> date. </p>', 'InsightsByAssessment$totalAssessmentControlsCount' => '<p>The total number of controls in the assessment. </p>', ], ], 'ObjectTypeEnum' => [ 'base' => NULL, 'refs' => [ 'ChangeLog$objectType' => '<p> The object that was changed, such as an assessment, control, or control set. </p>', ], ], 'QueryStatement' => [ 'base' => NULL, 'refs' => [ 'CreateAssessmentReportRequest$queryStatement' => '<p>A SQL statement that represents an evidence finder query.</p> <p>Provide this parameter when you want to generate an assessment report from the results of an evidence finder search query. When you use this parameter, Audit Manager generates a one-time report using only the evidence from the query output. This report does not include any assessment evidence that was manually <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/generate-assessment-report.html#generate-assessment-report-include-evidence\">added to a report using the console</a>, or <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_BatchAssociateAssessmentReportEvidence.html\">associated with a report using the API</a>. </p> <p>To use this parameter, the <a href=\"https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_EvidenceFinderEnablement.html#auditmanager-Type-EvidenceFinderEnablement-enablementStatus\">enablementStatus</a> of evidence finder must be <code>ENABLED</code>. </p> <p> For examples and help resolving <code>queryStatement</code> validation exceptions, see <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/evidence-finder-issues.html#querystatement-exceptions\">Troubleshooting evidence finder issues</a> in the <i>Audit Manager User Guide.</i> </p>', ], ], 'Region' => [ 'base' => NULL, 'refs' => [ 'AssessmentFrameworkShareRequest$destinationRegion' => '<p> The Amazon Web Services Region of the recipient. </p>', 'StartAssessmentFrameworkShareRequest$destinationRegion' => '<p> The Amazon Web Services Region of the recipient. </p>', ], ], 'RegisterAccountRequest' => [ 'base' => NULL, 'refs' => [], ], 'RegisterAccountResponse' => [ 'base' => NULL, 'refs' => [], ], 'RegisterOrganizationAdminAccountRequest' => [ 'base' => NULL, 'refs' => [], ], 'RegisterOrganizationAdminAccountResponse' => [ 'base' => NULL, 'refs' => [], ], 'Resource' => [ 'base' => '<p> A system asset that\\'s evaluated in an Audit Manager assessment. </p>', 'refs' => [ 'Resources$member' => NULL, ], ], 'ResourceNotFoundException' => [ 'base' => '<p> The resource that\\'s specified in the request can\\'t be found. </p>', 'refs' => [], ], 'Resources' => [ 'base' => NULL, 'refs' => [ 'Evidence$resourcesIncluded' => '<p> The list of resources that are assessed to generate the evidence. </p>', ], ], 'Role' => [ 'base' => '<p> The wrapper that contains the Audit Manager role information of the current user. This includes the role type and IAM Amazon Resource Name (ARN). </p>', 'refs' => [ 'GetAssessmentResponse$userRole' => NULL, 'Roles$member' => NULL, ], ], 'RoleType' => [ 'base' => NULL, 'refs' => [ 'CreateDelegationRequest$roleType' => '<p> The type of customer persona. </p> <note> <p>In <code>CreateAssessment</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>. </p> <p>In <code>UpdateSettings</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p> <p>In <code>BatchCreateDelegationByAssessment</code>, <code>roleType</code> can only be <code>RESOURCE_OWNER</code>.</p> </note>', 'Delegation$roleType' => '<p> The type of customer persona. </p> <note> <p>In <code>CreateAssessment</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>. </p> <p>In <code>UpdateSettings</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p> <p>In <code>BatchCreateDelegationByAssessment</code>, <code>roleType</code> can only be <code>RESOURCE_OWNER</code>.</p> </note>', 'Role$roleType' => '<p> The type of customer persona. </p> <note> <p>In <code>CreateAssessment</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>. </p> <p>In <code>UpdateSettings</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p> <p>In <code>BatchCreateDelegationByAssessment</code>, <code>roleType</code> can only be <code>RESOURCE_OWNER</code>.</p> </note>', ], ], 'Roles' => [ 'base' => NULL, 'refs' => [ 'AssessmentControlSet$roles' => '<p> The roles that are associated with the control set. </p>', 'AssessmentMetadata$roles' => '<p> The roles that are associated with the assessment. </p>', 'AssessmentMetadataItem$roles' => '<p> The roles that are associated with the assessment. </p>', 'CreateAssessmentRequest$roles' => '<p> The list of roles for the assessment. </p>', 'Settings$defaultProcessOwners' => '<p> The designated default audit owners. </p>', 'UpdateAssessmentRequest$roles' => '<p> The list of roles for the assessment. </p>', 'UpdateSettingsRequest$defaultProcessOwners' => '<p> A list of the default audit owners. </p>', ], ], 'S3Url' => [ 'base' => NULL, 'refs' => [ 'AssessmentReportsDestination$destination' => '<p> The destination bucket where Audit Manager stores assessment reports. </p>', 'DefaultExportDestination$destination' => '<p>The destination bucket where Audit Manager stores exported files.</p>', 'ManualEvidence$s3ResourcePath' => '<p>The S3 URL of the object that\\'s imported as manual evidence. </p>', 'ValidateAssessmentReportIntegrityRequest$s3RelativePath' => '<p> The relative path of the Amazon S3 bucket that the assessment report is stored in. </p>', ], ], 'SNSTopic' => [ 'base' => NULL, 'refs' => [ 'Settings$snsTopic' => '<p> The designated Amazon Simple Notification Service (Amazon SNS) topic. </p>', ], ], 'Scope' => [ 'base' => '<p> The wrapper that contains the Amazon Web Services accounts and services that are in scope for the assessment. </p>', 'refs' => [ 'AssessmentMetadata$scope' => '<p> The wrapper of Amazon Web Services accounts and services that are in scope for the assessment. </p>', 'CreateAssessmentRequest$scope' => NULL, 'UpdateAssessmentRequest$scope' => '<p> The scope of the assessment. </p>', ], ], 'ServiceMetadata' => [ 'base' => '<p> The metadata that\\'s associated with the Amazon Web Service. </p>', 'refs' => [ 'ServiceMetadataList$member' => NULL, ], ], 'ServiceMetadataList' => [ 'base' => NULL, 'refs' => [ 'GetServicesInScopeResponse$serviceMetadata' => '<p> The metadata that\\'s associated with the Amazon Web Service. </p>', ], ], 'ServiceQuotaExceededException' => [ 'base' => '<p>You\\'ve reached your account quota for this resource type. To perform the requested action, delete some existing resources or <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html\">request a quota increase</a> from the Service Quotas console. For a list of Audit Manager service quotas, see <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/service-quotas.html\">Quotas and restrictions for Audit Manager</a>.</p>', 'refs' => [], ], 'SettingAttribute' => [ 'base' => NULL, 'refs' => [ 'GetSettingsRequest$attribute' => '<p> The list of setting attribute enum values. </p>', ], ], 'Settings' => [ 'base' => '<p> The settings object that holds all supported Audit Manager settings. </p>', 'refs' => [ 'GetSettingsResponse$settings' => '<p> The settings object that holds all supported Audit Manager settings. </p>', 'UpdateSettingsResponse$settings' => '<p> The current list of settings. </p>', ], ], 'ShareRequestAction' => [ 'base' => NULL, 'refs' => [ 'UpdateAssessmentFrameworkShareRequest$action' => '<p>Specifies the update action for the share request.</p>', ], ], 'ShareRequestComment' => [ 'base' => NULL, 'refs' => [ 'AssessmentFrameworkShareRequest$comment' => '<p> An optional comment from the sender about the share request. </p>', 'StartAssessmentFrameworkShareRequest$comment' => '<p> An optional comment from the sender about the share request. </p>', ], ], 'ShareRequestStatus' => [ 'base' => NULL, 'refs' => [ 'AssessmentFrameworkShareRequest$status' => '<p> The status of the share request. </p>', ], ], 'ShareRequestType' => [ 'base' => NULL, 'refs' => [ 'DeleteAssessmentFrameworkShareRequest$requestType' => '<p>Specifies whether the share request is a sent request or a received request.</p>', 'ListAssessmentFrameworkShareRequestsRequest$requestType' => '<p> Specifies whether the share request is a sent request or a received request.</p>', 'UpdateAssessmentFrameworkShareRequest$requestType' => '<p>Specifies whether the share request is a sent request or a received request.</p>', ], ], 'SnsArn' => [ 'base' => NULL, 'refs' => [ 'UpdateSettingsRequest$snsTopic' => '<p> The Amazon Simple Notification Service (Amazon SNS) topic that Audit Manager sends notifications to. </p>', ], ], 'SourceDescription' => [ 'base' => NULL, 'refs' => [ 'ControlMappingSource$sourceDescription' => '<p> The description of the source. </p>', 'CreateControlMappingSource$sourceDescription' => '<p> The description of the data source that determines where Audit Manager collects evidence from for the control. </p>', ], ], 'SourceFrequency' => [ 'base' => NULL, 'refs' => [ 'ControlMappingSource$sourceFrequency' => '<p>Specifies how often evidence is collected from the control mapping source. </p>', 'CreateControlMappingSource$sourceFrequency' => '<p>Specifies how often evidence is collected from the control mapping source. </p>', ], ], 'SourceKeyword' => [ 'base' => '<p>A keyword that relates to the control data source.</p> <p>For manual evidence, this keyword indicates if the manual evidence is a file or text.</p> <p>For automated evidence, this keyword identifies a specific CloudTrail event, Config rule, Security Hub control, or Amazon Web Services API name. </p> <p> To learn more about the supported keywords that you can use when mapping a control data source, see the following pages in the <i>Audit Manager User Guide</i>:</p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/control-data-sources-config.html\">Config rules supported by Audit Manager</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/control-data-sources-ash.html\">Security Hub controls supported by Audit Manager</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/control-data-sources-api.html\">API calls supported by Audit Manager</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/audit-manager/latest/userguide/control-data-sources-cloudtrail.html\">CloudTrail event names supported by Audit Manager</a> </p> </li> </ul>', 'refs' => [ 'ControlMappingSource$sourceKeyword' => NULL, 'CreateControlMappingSource$sourceKeyword' => NULL, ], ], 'SourceName' => [ 'base' => NULL, 'refs' => [ 'ControlMappingSource$sourceName' => '<p> The name of the source. </p>', 'CreateControlMappingSource$sourceName' => '<p> The name of the control mapping data source. </p>', ], ], 'SourceSetUpOption' => [ 'base' => NULL, 'refs' => [ 'ControlMappingSource$sourceSetUpOption' => '<p> The setup option for the data source. This option reflects if the evidence collection is automated or manual. </p>', 'CreateControlMappingSource$sourceSetUpOption' => '<p> The setup option for the data source, which reflects if the evidence collection is automated or manual. </p>', ], ], 'SourceType' => [ 'base' => NULL, 'refs' => [ 'ControlMappingSource$sourceType' => '<p> Specifies one of the five data source types for evidence collection. </p>', 'CreateControlMappingSource$sourceType' => '<p> Specifies one of the five types of data sources for evidence collection. </p>', 'ListKeywordsForDataSourceRequest$source' => '<p> The control mapping data source that the keywords apply to. </p>', ], ], 'StartAssessmentFrameworkShareRequest' => [ 'base' => NULL, 'refs' => [], ], 'StartAssessmentFrameworkShareResponse' => [ 'base' => NULL, 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$message' => NULL, 'AssessmentEvidenceFolder$dataSource' => '<p> The Amazon Web Service that the evidence was collected from. </p>', 'AssessmentEvidenceFolder$author' => '<p> The name of the user who created the evidence folder. </p>', 'Evidence$dataSource' => '<p> The data source where the evidence was collected from. </p>', 'Evidence$evidenceByType' => '<p> The type of automated evidence. </p>', 'Evidence$complianceCheck' => '<p>The evaluation status for automated evidence that falls under the compliance check category.</p> <ul> <li> <p>Audit Manager classes evidence as non-compliant if Security Hub reports a <i>Fail</i> result, or if Config reports a <i>Non-compliant</i> result.</p> </li> <li> <p>Audit Manager classes evidence as compliant if Security Hub reports a <i>Pass</i> result, or if Config reports a <i>Compliant</i> result.</p> </li> <li> <p>If a compliance check isn\\'t available or applicable, then no compliance evaluation can be made for that evidence. This is the case if the evidence uses Config or Security Hub as the underlying data source type, but those services aren\\'t enabled. This is also the case if the evidence uses an underlying data source type that doesn\\'t support compliance checks (such as manual evidence, Amazon Web Services API calls, or CloudTrail). </p> </li> </ul>', 'Evidence$awsOrganization' => '<p> The Amazon Web Services account that the evidence is collected from, and its organization path. </p>', 'Evidence$assessmentReportSelection' => '<p> Specifies whether the evidence is included in the assessment report. </p>', 'InternalServerException$message' => NULL, 'Resource$value' => '<p> The value of the resource. </p>', 'Resource$complianceCheck' => '<p> The evaluation status for a resource that was assessed when collecting compliance check evidence. </p> <ul> <li> <p>Audit Manager classes the resource as non-compliant if Security Hub reports a <i>Fail</i> result, or if Config reports a <i>Non-compliant</i> result.</p> </li> <li> <p>Audit Manager classes the resource as compliant if Security Hub reports a <i>Pass</i> result, or if Config reports a <i>Compliant</i> result.</p> </li> <li> <p>If a compliance check isn\\'t available or applicable, then no compliance evaluation can be made for that resource. This is the case if a resource assessment uses Config or Security Hub as the underlying data source type, but those services aren\\'t enabled. This is also the case if the resource assessment uses an underlying data source type that doesn\\'t support compliance checks (such as manual evidence, Amazon Web Services API calls, or CloudTrail). </p> </li> </ul>', 'ResourceNotFoundException$message' => NULL, 'ResourceNotFoundException$resourceId' => '<p> The unique identifier for the resource. </p>', 'ResourceNotFoundException$resourceType' => '<p> The type of resource that\\'s affected by the error. </p>', 'ServiceQuotaExceededException$message' => NULL, 'ThrottlingException$message' => NULL, 'UpdateAssessmentControlSetStatusRequest$controlSetId' => '<p> The unique identifier for the control set. </p>', 'ValidateAssessmentReportIntegrityResponse$signatureAlgorithm' => '<p> The signature algorithm that\\'s used to code sign the assessment report file. </p>', 'ValidateAssessmentReportIntegrityResponse$signatureDateTime' => '<p> The date and time signature that specifies when the assessment report was created. </p>', 'ValidateAssessmentReportIntegrityResponse$signatureKeyId' => '<p> The unique identifier for the validation signature key. </p>', 'ValidationException$message' => NULL, 'ValidationExceptionField$name' => '<p> The name of the validation error. </p>', 'ValidationExceptionField$message' => '<p> The body of the error message. </p>', ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'TagKeyList$member' => NULL, 'TagMap$key' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$tagKeys' => '<p> The name or key of the tag. </p>', ], ], 'TagMap' => [ 'base' => NULL, 'refs' => [ 'Assessment$tags' => '<p> The tags that are associated with the assessment. </p>', 'Control$tags' => '<p> The tags associated with the control. </p>', 'CreateAssessmentFrameworkRequest$tags' => '<p> The tags that are associated with the framework. </p>', 'CreateAssessmentRequest$tags' => '<p> The tags that are associated with the assessment. </p>', 'CreateControlRequest$tags' => '<p> The tags that are associated with the control. </p>', 'Framework$tags' => '<p> The tags that are associated with the framework. </p>', 'ListTagsForResourceResponse$tags' => '<p> The list of tags that the <code>ListTagsForResource</code> API returned. </p>', 'TagResourceRequest$tags' => '<p> The tags that are associated with the resource. </p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'TagMap$value' => NULL, ], ], 'TestingInformation' => [ 'base' => NULL, 'refs' => [ 'Control$testingInformation' => '<p> The steps that you should follow to determine if the control has been satisfied. </p>', 'CreateControlRequest$testingInformation' => '<p> The steps to follow to determine if the control is satisfied. </p>', 'UpdateControlRequest$testingInformation' => '<p> The steps that you should follow to determine if the control is met. </p>', ], ], 'ThrottlingException' => [ 'base' => '<p>The request was denied due to request throttling.</p>', 'refs' => [], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [ 'AssessmentEvidenceFolder$date' => '<p> The date when the first evidence was added to the evidence folder. </p>', 'AssessmentFrameworkMetadata$createdAt' => '<p> The time when the framework was created. </p>', 'AssessmentFrameworkMetadata$lastUpdatedAt' => '<p> The time when the framework was most recently updated. </p>', 'AssessmentFrameworkShareRequest$expirationTime' => '<p> The time when the share request expires. </p>', 'AssessmentFrameworkShareRequest$creationTime' => '<p> The time when the share request was created. </p>', 'AssessmentFrameworkShareRequest$lastUpdated' => '<p> Specifies when the share request was last updated. </p>', 'AssessmentMetadata$creationTime' => '<p> Specifies when the assessment was created. </p>', 'AssessmentMetadata$lastUpdated' => '<p> The time of the most recent update. </p>', 'AssessmentMetadataItem$creationTime' => '<p> Specifies when the assessment was created. </p>', 'AssessmentMetadataItem$lastUpdated' => '<p> The time of the most recent update. </p>', 'AssessmentReport$creationTime' => '<p> Specifies when the assessment report was created. </p>', 'AssessmentReportMetadata$creationTime' => '<p> Specifies when the assessment report was created. </p>', 'ChangeLog$createdAt' => '<p> The time when the action was performed and the changelog record was created. </p>', 'Control$createdAt' => '<p> The time when the control was created. </p>', 'Control$lastUpdatedAt' => '<p> The time when the control was most recently updated. </p>', 'ControlComment$postedDate' => '<p> The time when the comment was posted. </p>', 'ControlDomainInsights$lastUpdated' => '<p>The time when the control domain insights were last updated. </p>', 'ControlInsightsMetadataByAssessmentItem$lastUpdated' => '<p>The time when the assessment control insights were last updated. </p>', 'ControlInsightsMetadataItem$lastUpdated' => '<p>The time when the control insights were last updated. </p>', 'ControlMetadata$createdAt' => '<p> The time when the control was created. </p>', 'ControlMetadata$lastUpdatedAt' => '<p> The time when the control was most recently updated. </p>', 'Delegation$creationTime' => '<p> Specifies when the delegation was created. </p>', 'Delegation$lastUpdated' => '<p> Specifies when the delegation was last updated. </p>', 'DelegationMetadata$creationTime' => '<p> Specifies when the delegation was created. </p>', 'Evidence$time' => '<p> The timestamp that represents when the evidence was collected. </p>', 'Framework$createdAt' => '<p> The time when the framework was created. </p>', 'Framework$lastUpdatedAt' => '<p> The time when the framework was most recently updated. </p>', 'Insights$lastUpdated' => '<p>The time when the cross-assessment insights were last updated. </p>', 'InsightsByAssessment$lastUpdated' => '<p>The time when the assessment insights were last updated.</p>', 'Notification$eventTime' => '<p> The time when the notification was sent. </p>', ], ], 'TimestampUUID' => [ 'base' => NULL, 'refs' => [ 'Notification$id' => '<p> The unique identifier for the notification. </p>', ], ], 'Token' => [ 'base' => NULL, 'refs' => [ 'GetChangeLogsRequest$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'GetChangeLogsResponse$nextToken' => '<p>The pagination token that\\'s used to fetch the next set of results. </p>', 'GetDelegationsRequest$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'GetDelegationsResponse$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'GetEvidenceByEvidenceFolderRequest$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'GetEvidenceByEvidenceFolderResponse$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'GetEvidenceFoldersByAssessmentControlRequest$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'GetEvidenceFoldersByAssessmentControlResponse$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'GetEvidenceFoldersByAssessmentRequest$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'GetEvidenceFoldersByAssessmentResponse$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'ListAssessmentControlInsightsByControlDomainRequest$nextToken' => '<p>The pagination token that\\'s used to fetch the next set of results. </p>', 'ListAssessmentControlInsightsByControlDomainResponse$nextToken' => '<p>The pagination token that\\'s used to fetch the next set of results. </p>', 'ListAssessmentFrameworkShareRequestsRequest$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'ListAssessmentFrameworkShareRequestsResponse$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'ListAssessmentFrameworksRequest$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'ListAssessmentFrameworksResponse$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'ListAssessmentReportsRequest$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'ListAssessmentReportsResponse$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'ListAssessmentsRequest$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'ListAssessmentsResponse$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'ListControlDomainInsightsByAssessmentRequest$nextToken' => '<p>The pagination token that\\'s used to fetch the next set of results. </p>', 'ListControlDomainInsightsByAssessmentResponse$nextToken' => '<p>The pagination token that\\'s used to fetch the next set of results. </p>', 'ListControlDomainInsightsRequest$nextToken' => '<p>The pagination token that\\'s used to fetch the next set of results. </p>', 'ListControlDomainInsightsResponse$nextToken' => '<p>The pagination token that\\'s used to fetch the next set of results. </p>', 'ListControlInsightsByControlDomainRequest$nextToken' => '<p>The pagination token that\\'s used to fetch the next set of results. </p>', 'ListControlInsightsByControlDomainResponse$nextToken' => '<p>The pagination token that\\'s used to fetch the next set of results. </p>', 'ListControlsRequest$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'ListControlsResponse$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'ListKeywordsForDataSourceRequest$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'ListKeywordsForDataSourceResponse$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'ListNotificationsRequest$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', 'ListNotificationsResponse$nextToken' => '<p> The pagination token that\\'s used to fetch the next set of results. </p>', ], ], 'TroubleshootingText' => [ 'base' => NULL, 'refs' => [ 'ControlMappingSource$troubleshootingText' => '<p> The instructions for troubleshooting the control. </p>', 'CreateControlMappingSource$troubleshootingText' => '<p> The instructions for troubleshooting the control. </p>', ], ], 'URL' => [ 'base' => '<p> Short for uniform resource locator. A URL is used as a unique identifier to locate a resource on the internet. </p>', 'refs' => [ 'GetAssessmentReportUrlResponse$preSignedUrl' => NULL, ], ], 'UUID' => [ 'base' => NULL, 'refs' => [ 'AssessmentControl$id' => '<p> The identifier for the control. </p>', 'AssessmentEvidenceFolder$assessmentId' => '<p> The identifier for the assessment. </p>', 'AssessmentEvidenceFolder$controlId' => '<p> The unique identifier for the control. </p>', 'AssessmentEvidenceFolder$id' => '<p> The identifier for the folder that the evidence is stored in. </p>', 'AssessmentFramework$id' => '<p> The unique identifier for the framework. </p>', 'AssessmentFrameworkMetadata$id' => '<p> The unique identifier for the framework. </p>', 'AssessmentFrameworkShareRequest$id' => '<p> The unique identifier for the share request. </p>', 'AssessmentFrameworkShareRequest$frameworkId' => '<p>The unique identifier for the shared custom framework. </p>', 'AssessmentMetadata$id' => '<p> The unique identifier for the assessment. </p>', 'AssessmentMetadataItem$id' => '<p> The unique identifier for the assessment. </p>', 'AssessmentReport$id' => '<p> The unique identifier for the assessment report. </p>', 'AssessmentReport$assessmentId' => '<p> The identifier for the specified assessment. </p>', 'AssessmentReportEvidenceError$evidenceId' => '<p> The identifier for the evidence. </p>', 'AssessmentReportMetadata$id' => '<p> The unique identifier for the assessment report. </p>', 'AssessmentReportMetadata$assessmentId' => '<p> The unique identifier for the associated assessment. </p>', 'AssociateAssessmentReportEvidenceFolderRequest$assessmentId' => '<p> The identifier for the assessment. </p>', 'AssociateAssessmentReportEvidenceFolderRequest$evidenceFolderId' => '<p> The identifier for the folder that the evidence is stored in. </p>', 'BatchAssociateAssessmentReportEvidenceRequest$assessmentId' => '<p> The identifier for the assessment. </p>', 'BatchAssociateAssessmentReportEvidenceRequest$evidenceFolderId' => '<p> The identifier for the folder that the evidence is stored in. </p>', 'BatchCreateDelegationByAssessmentRequest$assessmentId' => '<p> The identifier for the assessment. </p>', 'BatchDeleteDelegationByAssessmentError$delegationId' => '<p> The identifier for the delegation. </p>', 'BatchDeleteDelegationByAssessmentRequest$assessmentId' => '<p> The identifier for the assessment. </p>', 'BatchDisassociateAssessmentReportEvidenceRequest$assessmentId' => '<p> The identifier for the assessment. </p>', 'BatchDisassociateAssessmentReportEvidenceRequest$evidenceFolderId' => '<p> The identifier for the folder that the evidence is stored in. </p>', 'BatchImportEvidenceToAssessmentControlRequest$assessmentId' => '<p> The identifier for the assessment. </p>', 'BatchImportEvidenceToAssessmentControlRequest$controlId' => '<p> The identifier for the control. </p>', 'Control$id' => '<p> The unique identifier for the control. </p>', 'ControlDomainInsights$id' => '<p>The unique identifier for the control domain. </p>', 'ControlInsightsMetadataByAssessmentItem$id' => '<p>The unique identifier for the assessment control. </p>', 'ControlInsightsMetadataItem$id' => '<p>The unique identifier for the control. </p>', 'ControlMappingSource$sourceId' => '<p> The unique identifier for the source. </p>', 'ControlMetadata$id' => '<p> The unique identifier for the control. </p>', 'ControlSet$id' => '<p> The identifier of the control set in the assessment. This is the control set name in a plain string format. </p>', 'CreateAssessmentFrameworkControl$id' => '<p> The unique identifier of the control. </p>', 'CreateAssessmentReportRequest$assessmentId' => '<p> The identifier for the assessment. </p>', 'CreateAssessmentRequest$frameworkId' => '<p> The identifier for the framework that the assessment will be created from. </p>', 'Delegation$id' => '<p> The unique identifier for the delegation. </p>', 'Delegation$assessmentId' => '<p> The identifier for the assessment that\\'s associated with the delegation. </p>', 'DelegationIds$member' => NULL, 'DelegationMetadata$id' => '<p> The unique identifier for the delegation. </p>', 'DelegationMetadata$assessmentId' => '<p> The unique identifier for the assessment. </p>', 'DeleteAssessmentFrameworkRequest$frameworkId' => '<p> The identifier for the custom framework. </p>', 'DeleteAssessmentFrameworkShareRequest$requestId' => '<p>The unique identifier for the share request to be deleted.</p>', 'DeleteAssessmentReportRequest$assessmentId' => '<p> The unique identifier for the assessment. </p>', 'DeleteAssessmentReportRequest$assessmentReportId' => '<p> The unique identifier for the assessment report. </p>', 'DeleteAssessmentRequest$assessmentId' => '<p> The identifier for the assessment. </p>', 'DeleteControlRequest$controlId' => '<p> The unique identifier for the control. </p>', 'DisassociateAssessmentReportEvidenceFolderRequest$assessmentId' => '<p> The unique identifier for the assessment. </p>', 'DisassociateAssessmentReportEvidenceFolderRequest$evidenceFolderId' => '<p> The unique identifier for the folder that the evidence is stored in. </p>', 'Evidence$evidenceFolderId' => '<p> The identifier for the folder that the evidence is stored in. </p>', 'Evidence$id' => '<p> The identifier for the evidence. </p>', 'EvidenceIds$member' => NULL, 'Framework$id' => '<p> The unique identifier for the framework. </p>', 'GetAssessmentFrameworkRequest$frameworkId' => '<p> The identifier for the framework. </p>', 'GetAssessmentReportUrlRequest$assessmentReportId' => '<p> The unique identifier for the assessment report. </p>', 'GetAssessmentReportUrlRequest$assessmentId' => '<p> The unique identifier for the assessment. </p>', 'GetAssessmentRequest$assessmentId' => '<p>The unique identifier for the assessment. </p>', 'GetChangeLogsRequest$assessmentId' => '<p>The unique identifier for the assessment. </p>', 'GetChangeLogsRequest$controlId' => '<p> The unique identifier for the control. </p>', 'GetControlRequest$controlId' => '<p> The identifier for the control. </p>', 'GetEvidenceByEvidenceFolderRequest$assessmentId' => '<p> The identifier for the assessment. </p>', 'GetEvidenceByEvidenceFolderRequest$evidenceFolderId' => '<p> The unique identifier for the folder that the evidence is stored in. </p>', 'GetEvidenceFolderRequest$assessmentId' => '<p> The unique identifier for the assessment. </p>', 'GetEvidenceFolderRequest$evidenceFolderId' => '<p> The unique identifier for the folder that the evidence is stored in. </p>', 'GetEvidenceFoldersByAssessmentControlRequest$assessmentId' => '<p> The identifier for the assessment. </p>', 'GetEvidenceFoldersByAssessmentControlRequest$controlId' => '<p> The identifier for the control. </p>', 'GetEvidenceFoldersByAssessmentRequest$assessmentId' => '<p> The unique identifier for the assessment. </p>', 'GetEvidenceRequest$assessmentId' => '<p> The unique identifier for the assessment. </p>', 'GetEvidenceRequest$evidenceFolderId' => '<p> The unique identifier for the folder that the evidence is stored in. </p>', 'GetEvidenceRequest$evidenceId' => '<p> The unique identifier for the evidence. </p>', 'GetInsightsByAssessmentRequest$assessmentId' => '<p>The unique identifier for the assessment. </p>', 'ListAssessmentControlInsightsByControlDomainRequest$controlDomainId' => '<p>The unique identifier for the control domain. </p>', 'ListAssessmentControlInsightsByControlDomainRequest$assessmentId' => '<p>The unique identifier for the active assessment. </p>', 'ListControlDomainInsightsByAssessmentRequest$assessmentId' => '<p>The unique identifier for the active assessment. </p>', 'ListControlInsightsByControlDomainRequest$controlDomainId' => '<p>The unique identifier for the control domain. </p>', 'Notification$assessmentId' => '<p> The identifier for the assessment. </p>', 'StartAssessmentFrameworkShareRequest$frameworkId' => '<p> The unique identifier for the custom framework to be shared. </p>', 'UpdateAssessmentControlRequest$assessmentId' => '<p> The unique identifier for the assessment. </p>', 'UpdateAssessmentControlRequest$controlId' => '<p> The unique identifier for the control. </p>', 'UpdateAssessmentControlSetStatusRequest$assessmentId' => '<p> The unique identifier for the assessment. </p>', 'UpdateAssessmentFrameworkRequest$frameworkId' => '<p> The unique identifier for the framework. </p>', 'UpdateAssessmentFrameworkShareRequest$requestId' => '<p> The unique identifier for the share request. </p>', 'UpdateAssessmentRequest$assessmentId' => '<p> The unique identifier for the assessment. </p>', 'UpdateAssessmentStatusRequest$assessmentId' => '<p> The unique identifier for the assessment. </p>', 'UpdateControlRequest$controlId' => '<p> The identifier for the control. </p>', ], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAssessmentControlRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAssessmentControlResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAssessmentControlSetStatusRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAssessmentControlSetStatusResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAssessmentFrameworkControlSet' => [ 'base' => '<p> A <code>controlSet</code> entity that represents a collection of controls in Audit Manager. This doesn\\'t contain the control set ID. </p>', 'refs' => [ 'UpdateAssessmentFrameworkControlSets$member' => NULL, ], ], 'UpdateAssessmentFrameworkControlSets' => [ 'base' => NULL, 'refs' => [ 'UpdateAssessmentFrameworkRequest$controlSets' => '<p> The control sets that are associated with the framework. </p>', ], ], 'UpdateAssessmentFrameworkRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAssessmentFrameworkResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAssessmentFrameworkShareRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAssessmentFrameworkShareResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAssessmentRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAssessmentResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAssessmentStatusRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAssessmentStatusResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateControlRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateControlResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateSettingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateSettingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'UrlLink' => [ 'base' => NULL, 'refs' => [ 'URL$link' => '<p> The unique identifier for the internet resource. </p>', ], ], 'Username' => [ 'base' => NULL, 'refs' => [ 'AssessmentReport$author' => '<p> The name of the user who created the assessment report. </p>', 'AssessmentReportMetadata$author' => '<p> The name of the user who created the assessment report. </p>', 'ControlComment$authorName' => '<p> The name of the user who authored the comment. </p>', ], ], 'ValidateAssessmentReportIntegrityRequest' => [ 'base' => NULL, 'refs' => [], ], 'ValidateAssessmentReportIntegrityResponse' => [ 'base' => NULL, 'refs' => [], ], 'ValidationErrors' => [ 'base' => NULL, 'refs' => [ 'ValidateAssessmentReportIntegrityResponse$validationErrors' => '<p> Represents any errors that occurred when validating the assessment report. </p>', ], ], 'ValidationException' => [ 'base' => '<p> The request has invalid or missing parameters. </p>', 'refs' => [], ], 'ValidationExceptionField' => [ 'base' => '<p> Indicates that the request has invalid or missing parameters for the field. </p>', 'refs' => [ 'ValidationExceptionFieldList$member' => NULL, ], ], 'ValidationExceptionFieldList' => [ 'base' => NULL, 'refs' => [ 'ValidationException$fields' => '<p> The fields that caused the error, if applicable. </p>', ], ], 'ValidationExceptionReason' => [ 'base' => NULL, 'refs' => [ 'ValidationException$reason' => '<p> The reason the request failed validation. </p>', ], ], 'organizationId' => [ 'base' => NULL, 'refs' => [ 'GetOrganizationAdminAccountResponse$organizationId' => '<p> The identifier for the organization. </p>', 'RegisterOrganizationAdminAccountResponse$organizationId' => '<p> The identifier for the organization. </p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/auditmanager/2017-07-25/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://auditmanager-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://auditmanager-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://auditmanager.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://auditmanager.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/auditmanager/2017-07-25/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://auditmanager.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/auditmanager/2017-07-25/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/auditmanager/2017-07-25/paginators-1.json\nreturn [ 'pagination' => [ 'GetChangeLogs' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'GetDelegations' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'GetEvidenceByEvidenceFolder' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'GetEvidenceFoldersByAssessment' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'GetEvidenceFoldersByAssessmentControl' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'ListAssessmentControlInsightsByControlDomain' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'ListAssessmentFrameworkShareRequests' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'ListAssessmentFrameworks' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'ListAssessmentReports' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'ListAssessments' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'ListControlDomainInsights' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'ListControlDomainInsightsByAssessment' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'ListControlInsightsByControlDomain' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'ListControls' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'ListKeywordsForDataSource' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'ListNotifications' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/autoscaling/2011-01-01/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2011-01-01', 'endpointPrefix' => 'autoscaling', 'protocol' => 'query', 'serviceFullName' => 'Auto Scaling', 'serviceId' => 'Auto Scaling', 'signatureVersion' => 'v4', 'uid' => 'autoscaling-2011-01-01', 'xmlNamespace' => 'http://autoscaling.amazonaws.com/doc/2011-01-01/', ], 'operations' => [ 'AttachInstances' => [ 'name' => 'AttachInstances', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AttachInstancesQuery', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'ServiceLinkedRoleFailure', ], ], ], 'AttachLoadBalancerTargetGroups' => [ 'name' => 'AttachLoadBalancerTargetGroups', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AttachLoadBalancerTargetGroupsType', ], 'output' => [ 'shape' => 'AttachLoadBalancerTargetGroupsResultType', 'resultWrapper' => 'AttachLoadBalancerTargetGroupsResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'ServiceLinkedRoleFailure', ], ], ], 'AttachLoadBalancers' => [ 'name' => 'AttachLoadBalancers', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AttachLoadBalancersType', ], 'output' => [ 'shape' => 'AttachLoadBalancersResultType', 'resultWrapper' => 'AttachLoadBalancersResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'ServiceLinkedRoleFailure', ], ], ], 'AttachTrafficSources' => [ 'name' => 'AttachTrafficSources', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AttachTrafficSourcesType', ], 'output' => [ 'shape' => 'AttachTrafficSourcesResultType', 'resultWrapper' => 'AttachTrafficSourcesResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'ServiceLinkedRoleFailure', ], ], ], 'BatchDeleteScheduledAction' => [ 'name' => 'BatchDeleteScheduledAction', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'BatchDeleteScheduledActionType', ], 'output' => [ 'shape' => 'BatchDeleteScheduledActionAnswer', 'resultWrapper' => 'BatchDeleteScheduledActionResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'BatchPutScheduledUpdateGroupAction' => [ 'name' => 'BatchPutScheduledUpdateGroupAction', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'BatchPutScheduledUpdateGroupActionType', ], 'output' => [ 'shape' => 'BatchPutScheduledUpdateGroupActionAnswer', 'resultWrapper' => 'BatchPutScheduledUpdateGroupActionResult', ], 'errors' => [ [ 'shape' => 'AlreadyExistsFault', ], [ 'shape' => 'LimitExceededFault', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'CancelInstanceRefresh' => [ 'name' => 'CancelInstanceRefresh', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CancelInstanceRefreshType', ], 'output' => [ 'shape' => 'CancelInstanceRefreshAnswer', 'resultWrapper' => 'CancelInstanceRefreshResult', ], 'errors' => [ [ 'shape' => 'LimitExceededFault', ], [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'ActiveInstanceRefreshNotFoundFault', ], ], ], 'CompleteLifecycleAction' => [ 'name' => 'CompleteLifecycleAction', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CompleteLifecycleActionType', ], 'output' => [ 'shape' => 'CompleteLifecycleActionAnswer', 'resultWrapper' => 'CompleteLifecycleActionResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'CreateAutoScalingGroup' => [ 'name' => 'CreateAutoScalingGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateAutoScalingGroupType', ], 'errors' => [ [ 'shape' => 'AlreadyExistsFault', ], [ 'shape' => 'LimitExceededFault', ], [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'ServiceLinkedRoleFailure', ], ], ], 'CreateLaunchConfiguration' => [ 'name' => 'CreateLaunchConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateLaunchConfigurationType', ], 'errors' => [ [ 'shape' => 'AlreadyExistsFault', ], [ 'shape' => 'LimitExceededFault', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'CreateOrUpdateTags' => [ 'name' => 'CreateOrUpdateTags', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateOrUpdateTagsType', ], 'errors' => [ [ 'shape' => 'LimitExceededFault', ], [ 'shape' => 'AlreadyExistsFault', ], [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'ResourceInUseFault', ], ], ], 'DeleteAutoScalingGroup' => [ 'name' => 'DeleteAutoScalingGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteAutoScalingGroupType', ], 'errors' => [ [ 'shape' => 'ScalingActivityInProgressFault', ], [ 'shape' => 'ResourceInUseFault', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'DeleteLaunchConfiguration' => [ 'name' => 'DeleteLaunchConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'LaunchConfigurationNameType', ], 'errors' => [ [ 'shape' => 'ResourceInUseFault', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'DeleteLifecycleHook' => [ 'name' => 'DeleteLifecycleHook', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteLifecycleHookType', ], 'output' => [ 'shape' => 'DeleteLifecycleHookAnswer', 'resultWrapper' => 'DeleteLifecycleHookResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'DeleteNotificationConfiguration' => [ 'name' => 'DeleteNotificationConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteNotificationConfigurationType', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'DeletePolicy' => [ 'name' => 'DeletePolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeletePolicyType', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'ServiceLinkedRoleFailure', ], ], ], 'DeleteScheduledAction' => [ 'name' => 'DeleteScheduledAction', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteScheduledActionType', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'DeleteTags' => [ 'name' => 'DeleteTags', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteTagsType', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'ResourceInUseFault', ], ], ], 'DeleteWarmPool' => [ 'name' => 'DeleteWarmPool', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteWarmPoolType', ], 'output' => [ 'shape' => 'DeleteWarmPoolAnswer', 'resultWrapper' => 'DeleteWarmPoolResult', ], 'errors' => [ [ 'shape' => 'LimitExceededFault', ], [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'ScalingActivityInProgressFault', ], [ 'shape' => 'ResourceInUseFault', ], ], ], 'DescribeAccountLimits' => [ 'name' => 'DescribeAccountLimits', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'output' => [ 'shape' => 'DescribeAccountLimitsAnswer', 'resultWrapper' => 'DescribeAccountLimitsResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'DescribeAdjustmentTypes' => [ 'name' => 'DescribeAdjustmentTypes', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'output' => [ 'shape' => 'DescribeAdjustmentTypesAnswer', 'resultWrapper' => 'DescribeAdjustmentTypesResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'DescribeAutoScalingGroups' => [ 'name' => 'DescribeAutoScalingGroups', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AutoScalingGroupNamesType', ], 'output' => [ 'shape' => 'AutoScalingGroupsType', 'resultWrapper' => 'DescribeAutoScalingGroupsResult', ], 'errors' => [ [ 'shape' => 'InvalidNextToken', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'DescribeAutoScalingInstances' => [ 'name' => 'DescribeAutoScalingInstances', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeAutoScalingInstancesType', ], 'output' => [ 'shape' => 'AutoScalingInstancesType', 'resultWrapper' => 'DescribeAutoScalingInstancesResult', ], 'errors' => [ [ 'shape' => 'InvalidNextToken', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'DescribeAutoScalingNotificationTypes' => [ 'name' => 'DescribeAutoScalingNotificationTypes', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'output' => [ 'shape' => 'DescribeAutoScalingNotificationTypesAnswer', 'resultWrapper' => 'DescribeAutoScalingNotificationTypesResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'DescribeInstanceRefreshes' => [ 'name' => 'DescribeInstanceRefreshes', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeInstanceRefreshesType', ], 'output' => [ 'shape' => 'DescribeInstanceRefreshesAnswer', 'resultWrapper' => 'DescribeInstanceRefreshesResult', ], 'errors' => [ [ 'shape' => 'InvalidNextToken', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'DescribeLaunchConfigurations' => [ 'name' => 'DescribeLaunchConfigurations', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'LaunchConfigurationNamesType', ], 'output' => [ 'shape' => 'LaunchConfigurationsType', 'resultWrapper' => 'DescribeLaunchConfigurationsResult', ], 'errors' => [ [ 'shape' => 'InvalidNextToken', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'DescribeLifecycleHookTypes' => [ 'name' => 'DescribeLifecycleHookTypes', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'output' => [ 'shape' => 'DescribeLifecycleHookTypesAnswer', 'resultWrapper' => 'DescribeLifecycleHookTypesResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'DescribeLifecycleHooks' => [ 'name' => 'DescribeLifecycleHooks', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeLifecycleHooksType', ], 'output' => [ 'shape' => 'DescribeLifecycleHooksAnswer', 'resultWrapper' => 'DescribeLifecycleHooksResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'DescribeLoadBalancerTargetGroups' => [ 'name' => 'DescribeLoadBalancerTargetGroups', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeLoadBalancerTargetGroupsRequest', ], 'output' => [ 'shape' => 'DescribeLoadBalancerTargetGroupsResponse', 'resultWrapper' => 'DescribeLoadBalancerTargetGroupsResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'InvalidNextToken', ], ], ], 'DescribeLoadBalancers' => [ 'name' => 'DescribeLoadBalancers', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeLoadBalancersRequest', ], 'output' => [ 'shape' => 'DescribeLoadBalancersResponse', 'resultWrapper' => 'DescribeLoadBalancersResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'InvalidNextToken', ], ], ], 'DescribeMetricCollectionTypes' => [ 'name' => 'DescribeMetricCollectionTypes', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'output' => [ 'shape' => 'DescribeMetricCollectionTypesAnswer', 'resultWrapper' => 'DescribeMetricCollectionTypesResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'DescribeNotificationConfigurations' => [ 'name' => 'DescribeNotificationConfigurations', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeNotificationConfigurationsType', ], 'output' => [ 'shape' => 'DescribeNotificationConfigurationsAnswer', 'resultWrapper' => 'DescribeNotificationConfigurationsResult', ], 'errors' => [ [ 'shape' => 'InvalidNextToken', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'DescribePolicies' => [ 'name' => 'DescribePolicies', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribePoliciesType', ], 'output' => [ 'shape' => 'PoliciesType', 'resultWrapper' => 'DescribePoliciesResult', ], 'errors' => [ [ 'shape' => 'InvalidNextToken', ], [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'ServiceLinkedRoleFailure', ], ], ], 'DescribeScalingActivities' => [ 'name' => 'DescribeScalingActivities', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeScalingActivitiesType', ], 'output' => [ 'shape' => 'ActivitiesType', 'resultWrapper' => 'DescribeScalingActivitiesResult', ], 'errors' => [ [ 'shape' => 'InvalidNextToken', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'DescribeScalingProcessTypes' => [ 'name' => 'DescribeScalingProcessTypes', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'output' => [ 'shape' => 'ProcessesType', 'resultWrapper' => 'DescribeScalingProcessTypesResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'DescribeScheduledActions' => [ 'name' => 'DescribeScheduledActions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeScheduledActionsType', ], 'output' => [ 'shape' => 'ScheduledActionsType', 'resultWrapper' => 'DescribeScheduledActionsResult', ], 'errors' => [ [ 'shape' => 'InvalidNextToken', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'DescribeTags' => [ 'name' => 'DescribeTags', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeTagsType', ], 'output' => [ 'shape' => 'TagsType', 'resultWrapper' => 'DescribeTagsResult', ], 'errors' => [ [ 'shape' => 'InvalidNextToken', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'DescribeTerminationPolicyTypes' => [ 'name' => 'DescribeTerminationPolicyTypes', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'output' => [ 'shape' => 'DescribeTerminationPolicyTypesAnswer', 'resultWrapper' => 'DescribeTerminationPolicyTypesResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'DescribeTrafficSources' => [ 'name' => 'DescribeTrafficSources', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeTrafficSourcesRequest', ], 'output' => [ 'shape' => 'DescribeTrafficSourcesResponse', 'resultWrapper' => 'DescribeTrafficSourcesResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'InvalidNextToken', ], ], ], 'DescribeWarmPool' => [ 'name' => 'DescribeWarmPool', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeWarmPoolType', ], 'output' => [ 'shape' => 'DescribeWarmPoolAnswer', 'resultWrapper' => 'DescribeWarmPoolResult', ], 'errors' => [ [ 'shape' => 'InvalidNextToken', ], [ 'shape' => 'LimitExceededFault', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'DetachInstances' => [ 'name' => 'DetachInstances', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DetachInstancesQuery', ], 'output' => [ 'shape' => 'DetachInstancesAnswer', 'resultWrapper' => 'DetachInstancesResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'DetachLoadBalancerTargetGroups' => [ 'name' => 'DetachLoadBalancerTargetGroups', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DetachLoadBalancerTargetGroupsType', ], 'output' => [ 'shape' => 'DetachLoadBalancerTargetGroupsResultType', 'resultWrapper' => 'DetachLoadBalancerTargetGroupsResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'DetachLoadBalancers' => [ 'name' => 'DetachLoadBalancers', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DetachLoadBalancersType', ], 'output' => [ 'shape' => 'DetachLoadBalancersResultType', 'resultWrapper' => 'DetachLoadBalancersResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'DetachTrafficSources' => [ 'name' => 'DetachTrafficSources', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DetachTrafficSourcesType', ], 'output' => [ 'shape' => 'DetachTrafficSourcesResultType', 'resultWrapper' => 'DetachTrafficSourcesResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'DisableMetricsCollection' => [ 'name' => 'DisableMetricsCollection', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DisableMetricsCollectionQuery', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'EnableMetricsCollection' => [ 'name' => 'EnableMetricsCollection', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'EnableMetricsCollectionQuery', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'EnterStandby' => [ 'name' => 'EnterStandby', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'EnterStandbyQuery', ], 'output' => [ 'shape' => 'EnterStandbyAnswer', 'resultWrapper' => 'EnterStandbyResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'ExecutePolicy' => [ 'name' => 'ExecutePolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ExecutePolicyType', ], 'errors' => [ [ 'shape' => 'ScalingActivityInProgressFault', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'ExitStandby' => [ 'name' => 'ExitStandby', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ExitStandbyQuery', ], 'output' => [ 'shape' => 'ExitStandbyAnswer', 'resultWrapper' => 'ExitStandbyResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'GetPredictiveScalingForecast' => [ 'name' => 'GetPredictiveScalingForecast', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetPredictiveScalingForecastType', ], 'output' => [ 'shape' => 'GetPredictiveScalingForecastAnswer', 'resultWrapper' => 'GetPredictiveScalingForecastResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'PutLifecycleHook' => [ 'name' => 'PutLifecycleHook', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutLifecycleHookType', ], 'output' => [ 'shape' => 'PutLifecycleHookAnswer', 'resultWrapper' => 'PutLifecycleHookResult', ], 'errors' => [ [ 'shape' => 'LimitExceededFault', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'PutNotificationConfiguration' => [ 'name' => 'PutNotificationConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutNotificationConfigurationType', ], 'errors' => [ [ 'shape' => 'LimitExceededFault', ], [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'ServiceLinkedRoleFailure', ], ], ], 'PutScalingPolicy' => [ 'name' => 'PutScalingPolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutScalingPolicyType', ], 'output' => [ 'shape' => 'PolicyARNType', 'resultWrapper' => 'PutScalingPolicyResult', ], 'errors' => [ [ 'shape' => 'LimitExceededFault', ], [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'ServiceLinkedRoleFailure', ], ], ], 'PutScheduledUpdateGroupAction' => [ 'name' => 'PutScheduledUpdateGroupAction', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutScheduledUpdateGroupActionType', ], 'errors' => [ [ 'shape' => 'AlreadyExistsFault', ], [ 'shape' => 'LimitExceededFault', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'PutWarmPool' => [ 'name' => 'PutWarmPool', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutWarmPoolType', ], 'output' => [ 'shape' => 'PutWarmPoolAnswer', 'resultWrapper' => 'PutWarmPoolResult', ], 'errors' => [ [ 'shape' => 'LimitExceededFault', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'RecordLifecycleActionHeartbeat' => [ 'name' => 'RecordLifecycleActionHeartbeat', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'RecordLifecycleActionHeartbeatType', ], 'output' => [ 'shape' => 'RecordLifecycleActionHeartbeatAnswer', 'resultWrapper' => 'RecordLifecycleActionHeartbeatResult', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'ResumeProcesses' => [ 'name' => 'ResumeProcesses', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ScalingProcessQuery', ], 'errors' => [ [ 'shape' => 'ResourceInUseFault', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'RollbackInstanceRefresh' => [ 'name' => 'RollbackInstanceRefresh', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'RollbackInstanceRefreshType', ], 'output' => [ 'shape' => 'RollbackInstanceRefreshAnswer', 'resultWrapper' => 'RollbackInstanceRefreshResult', ], 'errors' => [ [ 'shape' => 'LimitExceededFault', ], [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'ActiveInstanceRefreshNotFoundFault', ], [ 'shape' => 'IrreversibleInstanceRefreshFault', ], ], ], 'SetDesiredCapacity' => [ 'name' => 'SetDesiredCapacity', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SetDesiredCapacityType', ], 'errors' => [ [ 'shape' => 'ScalingActivityInProgressFault', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'SetInstanceHealth' => [ 'name' => 'SetInstanceHealth', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SetInstanceHealthQuery', ], 'errors' => [ [ 'shape' => 'ResourceContentionFault', ], ], ], 'SetInstanceProtection' => [ 'name' => 'SetInstanceProtection', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SetInstanceProtectionQuery', ], 'output' => [ 'shape' => 'SetInstanceProtectionAnswer', 'resultWrapper' => 'SetInstanceProtectionResult', ], 'errors' => [ [ 'shape' => 'LimitExceededFault', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'StartInstanceRefresh' => [ 'name' => 'StartInstanceRefresh', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StartInstanceRefreshType', ], 'output' => [ 'shape' => 'StartInstanceRefreshAnswer', 'resultWrapper' => 'StartInstanceRefreshResult', ], 'errors' => [ [ 'shape' => 'LimitExceededFault', ], [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'InstanceRefreshInProgressFault', ], ], ], 'SuspendProcesses' => [ 'name' => 'SuspendProcesses', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ScalingProcessQuery', ], 'errors' => [ [ 'shape' => 'ResourceInUseFault', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'TerminateInstanceInAutoScalingGroup' => [ 'name' => 'TerminateInstanceInAutoScalingGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'TerminateInstanceInAutoScalingGroupType', ], 'output' => [ 'shape' => 'ActivityType', 'resultWrapper' => 'TerminateInstanceInAutoScalingGroupResult', ], 'errors' => [ [ 'shape' => 'ScalingActivityInProgressFault', ], [ 'shape' => 'ResourceContentionFault', ], ], ], 'UpdateAutoScalingGroup' => [ 'name' => 'UpdateAutoScalingGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateAutoScalingGroupType', ], 'errors' => [ [ 'shape' => 'ScalingActivityInProgressFault', ], [ 'shape' => 'ResourceContentionFault', ], [ 'shape' => 'ServiceLinkedRoleFailure', ], ], ], ], 'shapes' => [ 'AcceleratorCountRequest' => [ 'type' => 'structure', 'members' => [ 'Min' => [ 'shape' => 'NullablePositiveInteger', ], 'Max' => [ 'shape' => 'NullablePositiveInteger', ], ], ], 'AcceleratorManufacturer' => [ 'type' => 'string', 'enum' => [ 'nvidia', 'amd', 'amazon-web-services', 'xilinx', ], ], 'AcceleratorManufacturers' => [ 'type' => 'list', 'member' => [ 'shape' => 'AcceleratorManufacturer', ], ], 'AcceleratorName' => [ 'type' => 'string', 'enum' => [ 'a100', 'v100', 'k80', 't4', 'm60', 'radeon-pro-v520', 'vu9p', ], ], 'AcceleratorNames' => [ 'type' => 'list', 'member' => [ 'shape' => 'AcceleratorName', ], ], 'AcceleratorTotalMemoryMiBRequest' => [ 'type' => 'structure', 'members' => [ 'Min' => [ 'shape' => 'NullablePositiveInteger', ], 'Max' => [ 'shape' => 'NullablePositiveInteger', ], ], ], 'AcceleratorType' => [ 'type' => 'string', 'enum' => [ 'gpu', 'fpga', 'inference', ], ], 'AcceleratorTypes' => [ 'type' => 'list', 'member' => [ 'shape' => 'AcceleratorType', ], ], 'ActiveInstanceRefreshNotFoundFault' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'error' => [ 'code' => 'ActiveInstanceRefreshNotFound', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'Activities' => [ 'type' => 'list', 'member' => [ 'shape' => 'Activity', ], ], 'ActivitiesType' => [ 'type' => 'structure', 'required' => [ 'Activities', ], 'members' => [ 'Activities' => [ 'shape' => 'Activities', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'Activity' => [ 'type' => 'structure', 'required' => [ 'ActivityId', 'AutoScalingGroupName', 'Cause', 'StartTime', 'StatusCode', ], 'members' => [ 'ActivityId' => [ 'shape' => 'XmlString', ], 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'Description' => [ 'shape' => 'XmlString', ], 'Cause' => [ 'shape' => 'XmlStringMaxLen1023', ], 'StartTime' => [ 'shape' => 'TimestampType', ], 'EndTime' => [ 'shape' => 'TimestampType', ], 'StatusCode' => [ 'shape' => 'ScalingActivityStatusCode', ], 'StatusMessage' => [ 'shape' => 'XmlStringMaxLen255', ], 'Progress' => [ 'shape' => 'Progress', ], 'Details' => [ 'shape' => 'XmlString', ], 'AutoScalingGroupState' => [ 'shape' => 'AutoScalingGroupState', ], 'AutoScalingGroupARN' => [ 'shape' => 'ResourceName', ], ], ], 'ActivityIds' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlString', ], ], 'ActivityType' => [ 'type' => 'structure', 'members' => [ 'Activity' => [ 'shape' => 'Activity', ], ], ], 'AdjustmentType' => [ 'type' => 'structure', 'members' => [ 'AdjustmentType' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'AdjustmentTypes' => [ 'type' => 'list', 'member' => [ 'shape' => 'AdjustmentType', ], ], 'Alarm' => [ 'type' => 'structure', 'members' => [ 'AlarmName' => [ 'shape' => 'XmlStringMaxLen255', ], 'AlarmARN' => [ 'shape' => 'ResourceName', ], ], ], 'Alarms' => [ 'type' => 'list', 'member' => [ 'shape' => 'Alarm', ], ], 'AllowedInstanceType' => [ 'type' => 'string', 'max' => 30, 'min' => 1, 'pattern' => '[a-zA-Z0-9\\\\.\\\\*]+', ], 'AllowedInstanceTypes' => [ 'type' => 'list', 'member' => [ 'shape' => 'AllowedInstanceType', ], 'max' => 400, ], 'AlreadyExistsFault' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'error' => [ 'code' => 'AlreadyExists', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'AsciiStringMaxLen255' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '[A-Za-z0-9\\\\-_\\\\/]+', ], 'AssociatePublicIpAddress' => [ 'type' => 'boolean', ], 'AttachInstancesQuery' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', ], 'members' => [ 'InstanceIds' => [ 'shape' => 'InstanceIds', ], 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'AttachLoadBalancerTargetGroupsResultType' => [ 'type' => 'structure', 'members' => [], ], 'AttachLoadBalancerTargetGroupsType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'TargetGroupARNs', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'TargetGroupARNs' => [ 'shape' => 'TargetGroupARNs', ], ], ], 'AttachLoadBalancersResultType' => [ 'type' => 'structure', 'members' => [], ], 'AttachLoadBalancersType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'LoadBalancerNames', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'LoadBalancerNames' => [ 'shape' => 'LoadBalancerNames', ], ], ], 'AttachTrafficSourcesResultType' => [ 'type' => 'structure', 'members' => [], ], 'AttachTrafficSourcesType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'TrafficSources', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'TrafficSources' => [ 'shape' => 'TrafficSources', ], ], ], 'AutoRollback' => [ 'type' => 'boolean', ], 'AutoScalingGroup' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'MinSize', 'MaxSize', 'DesiredCapacity', 'DefaultCooldown', 'AvailabilityZones', 'HealthCheckType', 'CreatedTime', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'AutoScalingGroupARN' => [ 'shape' => 'ResourceName', ], 'LaunchConfigurationName' => [ 'shape' => 'XmlStringMaxLen255', ], 'LaunchTemplate' => [ 'shape' => 'LaunchTemplateSpecification', ], 'MixedInstancesPolicy' => [ 'shape' => 'MixedInstancesPolicy', ], 'MinSize' => [ 'shape' => 'AutoScalingGroupMinSize', ], 'MaxSize' => [ 'shape' => 'AutoScalingGroupMaxSize', ], 'DesiredCapacity' => [ 'shape' => 'AutoScalingGroupDesiredCapacity', ], 'PredictedCapacity' => [ 'shape' => 'AutoScalingGroupPredictedCapacity', ], 'DefaultCooldown' => [ 'shape' => 'Cooldown', ], 'AvailabilityZones' => [ 'shape' => 'AvailabilityZones', ], 'LoadBalancerNames' => [ 'shape' => 'LoadBalancerNames', ], 'TargetGroupARNs' => [ 'shape' => 'TargetGroupARNs', ], 'HealthCheckType' => [ 'shape' => 'XmlStringMaxLen32', ], 'HealthCheckGracePeriod' => [ 'shape' => 'HealthCheckGracePeriod', ], 'Instances' => [ 'shape' => 'Instances', ], 'CreatedTime' => [ 'shape' => 'TimestampType', ], 'SuspendedProcesses' => [ 'shape' => 'SuspendedProcesses', ], 'PlacementGroup' => [ 'shape' => 'XmlStringMaxLen255', ], 'VPCZoneIdentifier' => [ 'shape' => 'XmlStringMaxLen2047', ], 'EnabledMetrics' => [ 'shape' => 'EnabledMetrics', ], 'Status' => [ 'shape' => 'XmlStringMaxLen255', ], 'Tags' => [ 'shape' => 'TagDescriptionList', ], 'TerminationPolicies' => [ 'shape' => 'TerminationPolicies', ], 'NewInstancesProtectedFromScaleIn' => [ 'shape' => 'InstanceProtected', ], 'ServiceLinkedRoleARN' => [ 'shape' => 'ResourceName', ], 'MaxInstanceLifetime' => [ 'shape' => 'MaxInstanceLifetime', ], 'CapacityRebalance' => [ 'shape' => 'CapacityRebalanceEnabled', ], 'WarmPoolConfiguration' => [ 'shape' => 'WarmPoolConfiguration', ], 'WarmPoolSize' => [ 'shape' => 'WarmPoolSize', ], 'Context' => [ 'shape' => 'Context', ], 'DesiredCapacityType' => [ 'shape' => 'XmlStringMaxLen255', ], 'DefaultInstanceWarmup' => [ 'shape' => 'DefaultInstanceWarmup', ], 'TrafficSources' => [ 'shape' => 'TrafficSources', ], ], ], 'AutoScalingGroupDesiredCapacity' => [ 'type' => 'integer', ], 'AutoScalingGroupMaxSize' => [ 'type' => 'integer', ], 'AutoScalingGroupMinSize' => [ 'type' => 'integer', ], 'AutoScalingGroupNames' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'AutoScalingGroupNamesType' => [ 'type' => 'structure', 'members' => [ 'AutoScalingGroupNames' => [ 'shape' => 'AutoScalingGroupNames', ], 'NextToken' => [ 'shape' => 'XmlString', ], 'MaxRecords' => [ 'shape' => 'MaxRecords', ], 'Filters' => [ 'shape' => 'Filters', ], ], ], 'AutoScalingGroupPredictedCapacity' => [ 'type' => 'integer', ], 'AutoScalingGroupState' => [ 'type' => 'string', 'max' => 32, 'min' => 1, ], 'AutoScalingGroups' => [ 'type' => 'list', 'member' => [ 'shape' => 'AutoScalingGroup', ], ], 'AutoScalingGroupsType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroups', ], 'members' => [ 'AutoScalingGroups' => [ 'shape' => 'AutoScalingGroups', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'AutoScalingInstanceDetails' => [ 'type' => 'structure', 'required' => [ 'InstanceId', 'AutoScalingGroupName', 'AvailabilityZone', 'LifecycleState', 'HealthStatus', 'ProtectedFromScaleIn', ], 'members' => [ 'InstanceId' => [ 'shape' => 'XmlStringMaxLen19', ], 'InstanceType' => [ 'shape' => 'XmlStringMaxLen255', ], 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'AvailabilityZone' => [ 'shape' => 'XmlStringMaxLen255', ], 'LifecycleState' => [ 'shape' => 'XmlStringMaxLen32', ], 'HealthStatus' => [ 'shape' => 'XmlStringMaxLen32', ], 'LaunchConfigurationName' => [ 'shape' => 'XmlStringMaxLen255', ], 'LaunchTemplate' => [ 'shape' => 'LaunchTemplateSpecification', ], 'ProtectedFromScaleIn' => [ 'shape' => 'InstanceProtected', ], 'WeightedCapacity' => [ 'shape' => 'XmlStringMaxLen32', ], ], ], 'AutoScalingInstances' => [ 'type' => 'list', 'member' => [ 'shape' => 'AutoScalingInstanceDetails', ], ], 'AutoScalingInstancesType' => [ 'type' => 'structure', 'members' => [ 'AutoScalingInstances' => [ 'shape' => 'AutoScalingInstances', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'AutoScalingNotificationTypes' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'AvailabilityZones' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'BareMetal' => [ 'type' => 'string', 'enum' => [ 'included', 'excluded', 'required', ], ], 'BaselineEbsBandwidthMbpsRequest' => [ 'type' => 'structure', 'members' => [ 'Min' => [ 'shape' => 'NullablePositiveInteger', ], 'Max' => [ 'shape' => 'NullablePositiveInteger', ], ], ], 'BatchDeleteScheduledActionAnswer' => [ 'type' => 'structure', 'members' => [ 'FailedScheduledActions' => [ 'shape' => 'FailedScheduledUpdateGroupActionRequests', ], ], ], 'BatchDeleteScheduledActionType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'ScheduledActionNames', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'ScheduledActionNames' => [ 'shape' => 'ScheduledActionNames', ], ], ], 'BatchPutScheduledUpdateGroupActionAnswer' => [ 'type' => 'structure', 'members' => [ 'FailedScheduledUpdateGroupActions' => [ 'shape' => 'FailedScheduledUpdateGroupActionRequests', ], ], ], 'BatchPutScheduledUpdateGroupActionType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'ScheduledUpdateGroupActions', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'ScheduledUpdateGroupActions' => [ 'shape' => 'ScheduledUpdateGroupActionRequests', ], ], ], 'BlockDeviceEbsDeleteOnTermination' => [ 'type' => 'boolean', ], 'BlockDeviceEbsEncrypted' => [ 'type' => 'boolean', ], 'BlockDeviceEbsIops' => [ 'type' => 'integer', 'max' => 20000, 'min' => 100, ], 'BlockDeviceEbsThroughput' => [ 'type' => 'integer', 'max' => 1000, 'min' => 125, ], 'BlockDeviceEbsVolumeSize' => [ 'type' => 'integer', 'max' => 16384, 'min' => 1, ], 'BlockDeviceEbsVolumeType' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'BlockDeviceMapping' => [ 'type' => 'structure', 'required' => [ 'DeviceName', ], 'members' => [ 'VirtualName' => [ 'shape' => 'XmlStringMaxLen255', ], 'DeviceName' => [ 'shape' => 'XmlStringMaxLen255', ], 'Ebs' => [ 'shape' => 'Ebs', ], 'NoDevice' => [ 'shape' => 'NoDevice', ], ], ], 'BlockDeviceMappings' => [ 'type' => 'list', 'member' => [ 'shape' => 'BlockDeviceMapping', ], ], 'BurstablePerformance' => [ 'type' => 'string', 'enum' => [ 'included', 'excluded', 'required', ], ], 'CancelInstanceRefreshAnswer' => [ 'type' => 'structure', 'members' => [ 'InstanceRefreshId' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'CancelInstanceRefreshType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'CapacityForecast' => [ 'type' => 'structure', 'required' => [ 'Timestamps', 'Values', ], 'members' => [ 'Timestamps' => [ 'shape' => 'PredictiveScalingForecastTimestamps', ], 'Values' => [ 'shape' => 'PredictiveScalingForecastValues', ], ], ], 'CapacityRebalanceEnabled' => [ 'type' => 'boolean', ], 'CheckpointDelay' => [ 'type' => 'integer', 'max' => 172800, 'min' => 0, ], 'CheckpointPercentages' => [ 'type' => 'list', 'member' => [ 'shape' => 'NonZeroIntPercent', ], ], 'ClassicLinkVPCSecurityGroups' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'CompleteLifecycleActionAnswer' => [ 'type' => 'structure', 'members' => [], ], 'CompleteLifecycleActionType' => [ 'type' => 'structure', 'required' => [ 'LifecycleHookName', 'AutoScalingGroupName', 'LifecycleActionResult', ], 'members' => [ 'LifecycleHookName' => [ 'shape' => 'AsciiStringMaxLen255', ], 'AutoScalingGroupName' => [ 'shape' => 'ResourceName', ], 'LifecycleActionToken' => [ 'shape' => 'LifecycleActionToken', ], 'LifecycleActionResult' => [ 'shape' => 'LifecycleActionResult', ], 'InstanceId' => [ 'shape' => 'XmlStringMaxLen19', ], ], ], 'Context' => [ 'type' => 'string', ], 'Cooldown' => [ 'type' => 'integer', ], 'CpuManufacturer' => [ 'type' => 'string', 'enum' => [ 'intel', 'amd', 'amazon-web-services', ], ], 'CpuManufacturers' => [ 'type' => 'list', 'member' => [ 'shape' => 'CpuManufacturer', ], ], 'CreateAutoScalingGroupType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'MinSize', 'MaxSize', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'LaunchConfigurationName' => [ 'shape' => 'XmlStringMaxLen255', ], 'LaunchTemplate' => [ 'shape' => 'LaunchTemplateSpecification', ], 'MixedInstancesPolicy' => [ 'shape' => 'MixedInstancesPolicy', ], 'InstanceId' => [ 'shape' => 'XmlStringMaxLen19', ], 'MinSize' => [ 'shape' => 'AutoScalingGroupMinSize', ], 'MaxSize' => [ 'shape' => 'AutoScalingGroupMaxSize', ], 'DesiredCapacity' => [ 'shape' => 'AutoScalingGroupDesiredCapacity', ], 'DefaultCooldown' => [ 'shape' => 'Cooldown', ], 'AvailabilityZones' => [ 'shape' => 'AvailabilityZones', ], 'LoadBalancerNames' => [ 'shape' => 'LoadBalancerNames', ], 'TargetGroupARNs' => [ 'shape' => 'TargetGroupARNs', ], 'HealthCheckType' => [ 'shape' => 'XmlStringMaxLen32', ], 'HealthCheckGracePeriod' => [ 'shape' => 'HealthCheckGracePeriod', ], 'PlacementGroup' => [ 'shape' => 'XmlStringMaxLen255', ], 'VPCZoneIdentifier' => [ 'shape' => 'XmlStringMaxLen2047', ], 'TerminationPolicies' => [ 'shape' => 'TerminationPolicies', ], 'NewInstancesProtectedFromScaleIn' => [ 'shape' => 'InstanceProtected', ], 'CapacityRebalance' => [ 'shape' => 'CapacityRebalanceEnabled', ], 'LifecycleHookSpecificationList' => [ 'shape' => 'LifecycleHookSpecifications', ], 'Tags' => [ 'shape' => 'Tags', ], 'ServiceLinkedRoleARN' => [ 'shape' => 'ResourceName', ], 'MaxInstanceLifetime' => [ 'shape' => 'MaxInstanceLifetime', ], 'Context' => [ 'shape' => 'Context', ], 'DesiredCapacityType' => [ 'shape' => 'XmlStringMaxLen255', ], 'DefaultInstanceWarmup' => [ 'shape' => 'DefaultInstanceWarmup', ], 'TrafficSources' => [ 'shape' => 'TrafficSources', ], ], ], 'CreateLaunchConfigurationType' => [ 'type' => 'structure', 'required' => [ 'LaunchConfigurationName', ], 'members' => [ 'LaunchConfigurationName' => [ 'shape' => 'XmlStringMaxLen255', ], 'ImageId' => [ 'shape' => 'XmlStringMaxLen255', ], 'KeyName' => [ 'shape' => 'XmlStringMaxLen255', ], 'SecurityGroups' => [ 'shape' => 'SecurityGroups', ], 'ClassicLinkVPCId' => [ 'shape' => 'XmlStringMaxLen255', ], 'ClassicLinkVPCSecurityGroups' => [ 'shape' => 'ClassicLinkVPCSecurityGroups', ], 'UserData' => [ 'shape' => 'XmlStringUserData', ], 'InstanceId' => [ 'shape' => 'XmlStringMaxLen19', ], 'InstanceType' => [ 'shape' => 'XmlStringMaxLen255', ], 'KernelId' => [ 'shape' => 'XmlStringMaxLen255', ], 'RamdiskId' => [ 'shape' => 'XmlStringMaxLen255', ], 'BlockDeviceMappings' => [ 'shape' => 'BlockDeviceMappings', ], 'InstanceMonitoring' => [ 'shape' => 'InstanceMonitoring', ], 'SpotPrice' => [ 'shape' => 'SpotPrice', ], 'IamInstanceProfile' => [ 'shape' => 'XmlStringMaxLen1600', ], 'EbsOptimized' => [ 'shape' => 'EbsOptimized', ], 'AssociatePublicIpAddress' => [ 'shape' => 'AssociatePublicIpAddress', ], 'PlacementTenancy' => [ 'shape' => 'XmlStringMaxLen64', ], 'MetadataOptions' => [ 'shape' => 'InstanceMetadataOptions', ], ], ], 'CreateOrUpdateTagsType' => [ 'type' => 'structure', 'required' => [ 'Tags', ], 'members' => [ 'Tags' => [ 'shape' => 'Tags', ], ], ], 'CustomizedMetricSpecification' => [ 'type' => 'structure', 'members' => [ 'MetricName' => [ 'shape' => 'MetricName', ], 'Namespace' => [ 'shape' => 'MetricNamespace', ], 'Dimensions' => [ 'shape' => 'MetricDimensions', ], 'Statistic' => [ 'shape' => 'MetricStatistic', ], 'Unit' => [ 'shape' => 'MetricUnit', ], 'Metrics' => [ 'shape' => 'TargetTrackingMetricDataQueries', ], ], ], 'DefaultInstanceWarmup' => [ 'type' => 'integer', ], 'DeleteAutoScalingGroupType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'ForceDelete' => [ 'shape' => 'ForceDelete', ], ], ], 'DeleteLifecycleHookAnswer' => [ 'type' => 'structure', 'members' => [], ], 'DeleteLifecycleHookType' => [ 'type' => 'structure', 'required' => [ 'LifecycleHookName', 'AutoScalingGroupName', ], 'members' => [ 'LifecycleHookName' => [ 'shape' => 'AsciiStringMaxLen255', ], 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'DeleteNotificationConfigurationType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'TopicARN', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'TopicARN' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'DeletePolicyType' => [ 'type' => 'structure', 'required' => [ 'PolicyName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'PolicyName' => [ 'shape' => 'ResourceName', ], ], ], 'DeleteScheduledActionType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'ScheduledActionName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'ScheduledActionName' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'DeleteTagsType' => [ 'type' => 'structure', 'required' => [ 'Tags', ], 'members' => [ 'Tags' => [ 'shape' => 'Tags', ], ], ], 'DeleteWarmPoolAnswer' => [ 'type' => 'structure', 'members' => [], ], 'DeleteWarmPoolType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'ForceDelete' => [ 'shape' => 'ForceDelete', ], ], ], 'DescribeAccountLimitsAnswer' => [ 'type' => 'structure', 'members' => [ 'MaxNumberOfAutoScalingGroups' => [ 'shape' => 'MaxNumberOfAutoScalingGroups', ], 'MaxNumberOfLaunchConfigurations' => [ 'shape' => 'MaxNumberOfLaunchConfigurations', ], 'NumberOfAutoScalingGroups' => [ 'shape' => 'NumberOfAutoScalingGroups', ], 'NumberOfLaunchConfigurations' => [ 'shape' => 'NumberOfLaunchConfigurations', ], ], ], 'DescribeAdjustmentTypesAnswer' => [ 'type' => 'structure', 'members' => [ 'AdjustmentTypes' => [ 'shape' => 'AdjustmentTypes', ], ], ], 'DescribeAutoScalingInstancesType' => [ 'type' => 'structure', 'members' => [ 'InstanceIds' => [ 'shape' => 'InstanceIds', ], 'MaxRecords' => [ 'shape' => 'MaxRecords', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'DescribeAutoScalingNotificationTypesAnswer' => [ 'type' => 'structure', 'members' => [ 'AutoScalingNotificationTypes' => [ 'shape' => 'AutoScalingNotificationTypes', ], ], ], 'DescribeInstanceRefreshesAnswer' => [ 'type' => 'structure', 'members' => [ 'InstanceRefreshes' => [ 'shape' => 'InstanceRefreshes', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'DescribeInstanceRefreshesType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'InstanceRefreshIds' => [ 'shape' => 'InstanceRefreshIds', ], 'NextToken' => [ 'shape' => 'XmlString', ], 'MaxRecords' => [ 'shape' => 'MaxRecords', ], ], ], 'DescribeLifecycleHookTypesAnswer' => [ 'type' => 'structure', 'members' => [ 'LifecycleHookTypes' => [ 'shape' => 'AutoScalingNotificationTypes', ], ], ], 'DescribeLifecycleHooksAnswer' => [ 'type' => 'structure', 'members' => [ 'LifecycleHooks' => [ 'shape' => 'LifecycleHooks', ], ], ], 'DescribeLifecycleHooksType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'LifecycleHookNames' => [ 'shape' => 'LifecycleHookNames', ], ], ], 'DescribeLoadBalancerTargetGroupsRequest' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'NextToken' => [ 'shape' => 'XmlString', ], 'MaxRecords' => [ 'shape' => 'MaxRecords', ], ], ], 'DescribeLoadBalancerTargetGroupsResponse' => [ 'type' => 'structure', 'members' => [ 'LoadBalancerTargetGroups' => [ 'shape' => 'LoadBalancerTargetGroupStates', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'DescribeLoadBalancersRequest' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'NextToken' => [ 'shape' => 'XmlString', ], 'MaxRecords' => [ 'shape' => 'MaxRecords', ], ], ], 'DescribeLoadBalancersResponse' => [ 'type' => 'structure', 'members' => [ 'LoadBalancers' => [ 'shape' => 'LoadBalancerStates', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'DescribeMetricCollectionTypesAnswer' => [ 'type' => 'structure', 'members' => [ 'Metrics' => [ 'shape' => 'MetricCollectionTypes', ], 'Granularities' => [ 'shape' => 'MetricGranularityTypes', ], ], ], 'DescribeNotificationConfigurationsAnswer' => [ 'type' => 'structure', 'required' => [ 'NotificationConfigurations', ], 'members' => [ 'NotificationConfigurations' => [ 'shape' => 'NotificationConfigurations', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'DescribeNotificationConfigurationsType' => [ 'type' => 'structure', 'members' => [ 'AutoScalingGroupNames' => [ 'shape' => 'AutoScalingGroupNames', ], 'NextToken' => [ 'shape' => 'XmlString', ], 'MaxRecords' => [ 'shape' => 'MaxRecords', ], ], ], 'DescribePoliciesType' => [ 'type' => 'structure', 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'PolicyNames' => [ 'shape' => 'PolicyNames', ], 'PolicyTypes' => [ 'shape' => 'PolicyTypes', ], 'NextToken' => [ 'shape' => 'XmlString', ], 'MaxRecords' => [ 'shape' => 'MaxRecords', ], ], ], 'DescribeScalingActivitiesType' => [ 'type' => 'structure', 'members' => [ 'ActivityIds' => [ 'shape' => 'ActivityIds', ], 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'IncludeDeletedGroups' => [ 'shape' => 'IncludeDeletedGroups', ], 'MaxRecords' => [ 'shape' => 'MaxRecords', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'DescribeScheduledActionsType' => [ 'type' => 'structure', 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'ScheduledActionNames' => [ 'shape' => 'ScheduledActionNames', ], 'StartTime' => [ 'shape' => 'TimestampType', ], 'EndTime' => [ 'shape' => 'TimestampType', ], 'NextToken' => [ 'shape' => 'XmlString', ], 'MaxRecords' => [ 'shape' => 'MaxRecords', ], ], ], 'DescribeTagsType' => [ 'type' => 'structure', 'members' => [ 'Filters' => [ 'shape' => 'Filters', ], 'NextToken' => [ 'shape' => 'XmlString', ], 'MaxRecords' => [ 'shape' => 'MaxRecords', ], ], ], 'DescribeTerminationPolicyTypesAnswer' => [ 'type' => 'structure', 'members' => [ 'TerminationPolicyTypes' => [ 'shape' => 'TerminationPolicies', ], ], ], 'DescribeTrafficSourcesRequest' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'TrafficSourceType' => [ 'shape' => 'XmlStringMaxLen255', ], 'NextToken' => [ 'shape' => 'XmlString', ], 'MaxRecords' => [ 'shape' => 'MaxRecords', ], ], ], 'DescribeTrafficSourcesResponse' => [ 'type' => 'structure', 'members' => [ 'TrafficSources' => [ 'shape' => 'TrafficSourceStates', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'DescribeWarmPoolAnswer' => [ 'type' => 'structure', 'members' => [ 'WarmPoolConfiguration' => [ 'shape' => 'WarmPoolConfiguration', ], 'Instances' => [ 'shape' => 'Instances', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'DescribeWarmPoolType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'MaxRecords' => [ 'shape' => 'MaxRecords', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'DesiredConfiguration' => [ 'type' => 'structure', 'members' => [ 'LaunchTemplate' => [ 'shape' => 'LaunchTemplateSpecification', ], 'MixedInstancesPolicy' => [ 'shape' => 'MixedInstancesPolicy', ], ], ], 'DetachInstancesAnswer' => [ 'type' => 'structure', 'members' => [ 'Activities' => [ 'shape' => 'Activities', ], ], ], 'DetachInstancesQuery' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'ShouldDecrementDesiredCapacity', ], 'members' => [ 'InstanceIds' => [ 'shape' => 'InstanceIds', ], 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'ShouldDecrementDesiredCapacity' => [ 'shape' => 'ShouldDecrementDesiredCapacity', ], ], ], 'DetachLoadBalancerTargetGroupsResultType' => [ 'type' => 'structure', 'members' => [], ], 'DetachLoadBalancerTargetGroupsType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'TargetGroupARNs', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'TargetGroupARNs' => [ 'shape' => 'TargetGroupARNs', ], ], ], 'DetachLoadBalancersResultType' => [ 'type' => 'structure', 'members' => [], ], 'DetachLoadBalancersType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'LoadBalancerNames', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'LoadBalancerNames' => [ 'shape' => 'LoadBalancerNames', ], ], ], 'DetachTrafficSourcesResultType' => [ 'type' => 'structure', 'members' => [], ], 'DetachTrafficSourcesType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'TrafficSources', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'TrafficSources' => [ 'shape' => 'TrafficSources', ], ], ], 'DisableMetricsCollectionQuery' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'Metrics' => [ 'shape' => 'Metrics', ], ], ], 'DisableScaleIn' => [ 'type' => 'boolean', ], 'Ebs' => [ 'type' => 'structure', 'members' => [ 'SnapshotId' => [ 'shape' => 'XmlStringMaxLen255', ], 'VolumeSize' => [ 'shape' => 'BlockDeviceEbsVolumeSize', ], 'VolumeType' => [ 'shape' => 'BlockDeviceEbsVolumeType', ], 'DeleteOnTermination' => [ 'shape' => 'BlockDeviceEbsDeleteOnTermination', ], 'Iops' => [ 'shape' => 'BlockDeviceEbsIops', ], 'Encrypted' => [ 'shape' => 'BlockDeviceEbsEncrypted', ], 'Throughput' => [ 'shape' => 'BlockDeviceEbsThroughput', ], ], ], 'EbsOptimized' => [ 'type' => 'boolean', ], 'EnableMetricsCollectionQuery' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'Granularity', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'Metrics' => [ 'shape' => 'Metrics', ], 'Granularity' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'EnabledMetric' => [ 'type' => 'structure', 'members' => [ 'Metric' => [ 'shape' => 'XmlStringMaxLen255', ], 'Granularity' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'EnabledMetrics' => [ 'type' => 'list', 'member' => [ 'shape' => 'EnabledMetric', ], ], 'EnterStandbyAnswer' => [ 'type' => 'structure', 'members' => [ 'Activities' => [ 'shape' => 'Activities', ], ], ], 'EnterStandbyQuery' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'ShouldDecrementDesiredCapacity', ], 'members' => [ 'InstanceIds' => [ 'shape' => 'InstanceIds', ], 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'ShouldDecrementDesiredCapacity' => [ 'shape' => 'ShouldDecrementDesiredCapacity', ], ], ], 'EstimatedInstanceWarmup' => [ 'type' => 'integer', ], 'ExcludedInstance' => [ 'type' => 'string', 'max' => 30, 'min' => 1, 'pattern' => '[a-zA-Z0-9\\\\.\\\\*]+', ], 'ExcludedInstanceTypes' => [ 'type' => 'list', 'member' => [ 'shape' => 'ExcludedInstance', ], 'max' => 400, ], 'ExecutePolicyType' => [ 'type' => 'structure', 'required' => [ 'PolicyName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'PolicyName' => [ 'shape' => 'ResourceName', ], 'HonorCooldown' => [ 'shape' => 'HonorCooldown', ], 'MetricValue' => [ 'shape' => 'MetricScale', ], 'BreachThreshold' => [ 'shape' => 'MetricScale', ], ], ], 'ExitStandbyAnswer' => [ 'type' => 'structure', 'members' => [ 'Activities' => [ 'shape' => 'Activities', ], ], ], 'ExitStandbyQuery' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', ], 'members' => [ 'InstanceIds' => [ 'shape' => 'InstanceIds', ], 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'FailedScheduledUpdateGroupActionRequest' => [ 'type' => 'structure', 'required' => [ 'ScheduledActionName', ], 'members' => [ 'ScheduledActionName' => [ 'shape' => 'XmlStringMaxLen255', ], 'ErrorCode' => [ 'shape' => 'XmlStringMaxLen64', ], 'ErrorMessage' => [ 'shape' => 'XmlString', ], ], ], 'FailedScheduledUpdateGroupActionRequests' => [ 'type' => 'list', 'member' => [ 'shape' => 'FailedScheduledUpdateGroupActionRequest', ], ], 'Filter' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'XmlString', ], 'Values' => [ 'shape' => 'Values', ], ], ], 'Filters' => [ 'type' => 'list', 'member' => [ 'shape' => 'Filter', ], ], 'ForceDelete' => [ 'type' => 'boolean', ], 'GetPredictiveScalingForecastAnswer' => [ 'type' => 'structure', 'required' => [ 'LoadForecast', 'CapacityForecast', 'UpdateTime', ], 'members' => [ 'LoadForecast' => [ 'shape' => 'LoadForecasts', ], 'CapacityForecast' => [ 'shape' => 'CapacityForecast', ], 'UpdateTime' => [ 'shape' => 'TimestampType', ], ], ], 'GetPredictiveScalingForecastType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'PolicyName', 'StartTime', 'EndTime', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'PolicyName' => [ 'shape' => 'XmlStringMaxLen255', ], 'StartTime' => [ 'shape' => 'TimestampType', ], 'EndTime' => [ 'shape' => 'TimestampType', ], ], ], 'GlobalTimeout' => [ 'type' => 'integer', ], 'HealthCheckGracePeriod' => [ 'type' => 'integer', ], 'HeartbeatTimeout' => [ 'type' => 'integer', ], 'HonorCooldown' => [ 'type' => 'boolean', ], 'IncludeDeletedGroups' => [ 'type' => 'boolean', ], 'Instance' => [ 'type' => 'structure', 'required' => [ 'InstanceId', 'AvailabilityZone', 'LifecycleState', 'HealthStatus', 'ProtectedFromScaleIn', ], 'members' => [ 'InstanceId' => [ 'shape' => 'XmlStringMaxLen19', ], 'InstanceType' => [ 'shape' => 'XmlStringMaxLen255', ], 'AvailabilityZone' => [ 'shape' => 'XmlStringMaxLen255', ], 'LifecycleState' => [ 'shape' => 'LifecycleState', ], 'HealthStatus' => [ 'shape' => 'XmlStringMaxLen32', ], 'LaunchConfigurationName' => [ 'shape' => 'XmlStringMaxLen255', ], 'LaunchTemplate' => [ 'shape' => 'LaunchTemplateSpecification', ], 'ProtectedFromScaleIn' => [ 'shape' => 'InstanceProtected', ], 'WeightedCapacity' => [ 'shape' => 'XmlStringMaxLen32', ], ], ], 'InstanceGeneration' => [ 'type' => 'string', 'enum' => [ 'current', 'previous', ], ], 'InstanceGenerations' => [ 'type' => 'list', 'member' => [ 'shape' => 'InstanceGeneration', ], ], 'InstanceIds' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlStringMaxLen19', ], ], 'InstanceMetadataEndpointState' => [ 'type' => 'string', 'enum' => [ 'disabled', 'enabled', ], ], 'InstanceMetadataHttpPutResponseHopLimit' => [ 'type' => 'integer', 'max' => 64, 'min' => 1, ], 'InstanceMetadataHttpTokensState' => [ 'type' => 'string', 'enum' => [ 'optional', 'required', ], ], 'InstanceMetadataOptions' => [ 'type' => 'structure', 'members' => [ 'HttpTokens' => [ 'shape' => 'InstanceMetadataHttpTokensState', ], 'HttpPutResponseHopLimit' => [ 'shape' => 'InstanceMetadataHttpPutResponseHopLimit', ], 'HttpEndpoint' => [ 'shape' => 'InstanceMetadataEndpointState', ], ], ], 'InstanceMonitoring' => [ 'type' => 'structure', 'members' => [ 'Enabled' => [ 'shape' => 'MonitoringEnabled', ], ], ], 'InstanceProtected' => [ 'type' => 'boolean', ], 'InstanceRefresh' => [ 'type' => 'structure', 'members' => [ 'InstanceRefreshId' => [ 'shape' => 'XmlStringMaxLen255', ], 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'Status' => [ 'shape' => 'InstanceRefreshStatus', ], 'StatusReason' => [ 'shape' => 'XmlStringMaxLen1023', ], 'StartTime' => [ 'shape' => 'TimestampType', ], 'EndTime' => [ 'shape' => 'TimestampType', ], 'PercentageComplete' => [ 'shape' => 'IntPercent', ], 'InstancesToUpdate' => [ 'shape' => 'InstancesToUpdate', ], 'ProgressDetails' => [ 'shape' => 'InstanceRefreshProgressDetails', ], 'Preferences' => [ 'shape' => 'RefreshPreferences', ], 'DesiredConfiguration' => [ 'shape' => 'DesiredConfiguration', ], 'RollbackDetails' => [ 'shape' => 'RollbackDetails', ], ], ], 'InstanceRefreshIds' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'InstanceRefreshInProgressFault' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'error' => [ 'code' => 'InstanceRefreshInProgress', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'InstanceRefreshLivePoolProgress' => [ 'type' => 'structure', 'members' => [ 'PercentageComplete' => [ 'shape' => 'IntPercent', ], 'InstancesToUpdate' => [ 'shape' => 'InstancesToUpdate', ], ], ], 'InstanceRefreshProgressDetails' => [ 'type' => 'structure', 'members' => [ 'LivePoolProgress' => [ 'shape' => 'InstanceRefreshLivePoolProgress', ], 'WarmPoolProgress' => [ 'shape' => 'InstanceRefreshWarmPoolProgress', ], ], ], 'InstanceRefreshStatus' => [ 'type' => 'string', 'enum' => [ 'Pending', 'InProgress', 'Successful', 'Failed', 'Cancelling', 'Cancelled', 'RollbackInProgress', 'RollbackFailed', 'RollbackSuccessful', ], ], 'InstanceRefreshWarmPoolProgress' => [ 'type' => 'structure', 'members' => [ 'PercentageComplete' => [ 'shape' => 'IntPercent', ], 'InstancesToUpdate' => [ 'shape' => 'InstancesToUpdate', ], ], ], 'InstanceRefreshes' => [ 'type' => 'list', 'member' => [ 'shape' => 'InstanceRefresh', ], ], 'InstanceRequirements' => [ 'type' => 'structure', 'required' => [ 'VCpuCount', 'MemoryMiB', ], 'members' => [ 'VCpuCount' => [ 'shape' => 'VCpuCountRequest', ], 'MemoryMiB' => [ 'shape' => 'MemoryMiBRequest', ], 'CpuManufacturers' => [ 'shape' => 'CpuManufacturers', ], 'MemoryGiBPerVCpu' => [ 'shape' => 'MemoryGiBPerVCpuRequest', ], 'ExcludedInstanceTypes' => [ 'shape' => 'ExcludedInstanceTypes', ], 'InstanceGenerations' => [ 'shape' => 'InstanceGenerations', ], 'SpotMaxPricePercentageOverLowestPrice' => [ 'shape' => 'NullablePositiveInteger', ], 'OnDemandMaxPricePercentageOverLowestPrice' => [ 'shape' => 'NullablePositiveInteger', ], 'BareMetal' => [ 'shape' => 'BareMetal', ], 'BurstablePerformance' => [ 'shape' => 'BurstablePerformance', ], 'RequireHibernateSupport' => [ 'shape' => 'NullableBoolean', ], 'NetworkInterfaceCount' => [ 'shape' => 'NetworkInterfaceCountRequest', ], 'LocalStorage' => [ 'shape' => 'LocalStorage', ], 'LocalStorageTypes' => [ 'shape' => 'LocalStorageTypes', ], 'TotalLocalStorageGB' => [ 'shape' => 'TotalLocalStorageGBRequest', ], 'BaselineEbsBandwidthMbps' => [ 'shape' => 'BaselineEbsBandwidthMbpsRequest', ], 'AcceleratorTypes' => [ 'shape' => 'AcceleratorTypes', ], 'AcceleratorCount' => [ 'shape' => 'AcceleratorCountRequest', ], 'AcceleratorManufacturers' => [ 'shape' => 'AcceleratorManufacturers', ], 'AcceleratorNames' => [ 'shape' => 'AcceleratorNames', ], 'AcceleratorTotalMemoryMiB' => [ 'shape' => 'AcceleratorTotalMemoryMiBRequest', ], 'NetworkBandwidthGbps' => [ 'shape' => 'NetworkBandwidthGbpsRequest', ], 'AllowedInstanceTypes' => [ 'shape' => 'AllowedInstanceTypes', ], ], ], 'InstanceReusePolicy' => [ 'type' => 'structure', 'members' => [ 'ReuseOnScaleIn' => [ 'shape' => 'ReuseOnScaleIn', ], ], ], 'Instances' => [ 'type' => 'list', 'member' => [ 'shape' => 'Instance', ], ], 'InstancesDistribution' => [ 'type' => 'structure', 'members' => [ 'OnDemandAllocationStrategy' => [ 'shape' => 'XmlString', ], 'OnDemandBaseCapacity' => [ 'shape' => 'OnDemandBaseCapacity', ], 'OnDemandPercentageAboveBaseCapacity' => [ 'shape' => 'OnDemandPercentageAboveBaseCapacity', ], 'SpotAllocationStrategy' => [ 'shape' => 'XmlString', ], 'SpotInstancePools' => [ 'shape' => 'SpotInstancePools', ], 'SpotMaxPrice' => [ 'shape' => 'MixedInstanceSpotPrice', ], ], ], 'InstancesToUpdate' => [ 'type' => 'integer', 'min' => 0, ], 'IntPercent' => [ 'type' => 'integer', 'max' => 100, 'min' => 0, ], 'InvalidNextToken' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'error' => [ 'code' => 'InvalidNextToken', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'IrreversibleInstanceRefreshFault' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'error' => [ 'code' => 'IrreversibleInstanceRefresh', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'LaunchConfiguration' => [ 'type' => 'structure', 'required' => [ 'LaunchConfigurationName', 'ImageId', 'InstanceType', 'CreatedTime', ], 'members' => [ 'LaunchConfigurationName' => [ 'shape' => 'XmlStringMaxLen255', ], 'LaunchConfigurationARN' => [ 'shape' => 'ResourceName', ], 'ImageId' => [ 'shape' => 'XmlStringMaxLen255', ], 'KeyName' => [ 'shape' => 'XmlStringMaxLen255', ], 'SecurityGroups' => [ 'shape' => 'SecurityGroups', ], 'ClassicLinkVPCId' => [ 'shape' => 'XmlStringMaxLen255', ], 'ClassicLinkVPCSecurityGroups' => [ 'shape' => 'ClassicLinkVPCSecurityGroups', ], 'UserData' => [ 'shape' => 'XmlStringUserData', ], 'InstanceType' => [ 'shape' => 'XmlStringMaxLen255', ], 'KernelId' => [ 'shape' => 'XmlStringMaxLen255', ], 'RamdiskId' => [ 'shape' => 'XmlStringMaxLen255', ], 'BlockDeviceMappings' => [ 'shape' => 'BlockDeviceMappings', ], 'InstanceMonitoring' => [ 'shape' => 'InstanceMonitoring', ], 'SpotPrice' => [ 'shape' => 'SpotPrice', ], 'IamInstanceProfile' => [ 'shape' => 'XmlStringMaxLen1600', ], 'CreatedTime' => [ 'shape' => 'TimestampType', ], 'EbsOptimized' => [ 'shape' => 'EbsOptimized', ], 'AssociatePublicIpAddress' => [ 'shape' => 'AssociatePublicIpAddress', ], 'PlacementTenancy' => [ 'shape' => 'XmlStringMaxLen64', ], 'MetadataOptions' => [ 'shape' => 'InstanceMetadataOptions', ], ], ], 'LaunchConfigurationNameType' => [ 'type' => 'structure', 'required' => [ 'LaunchConfigurationName', ], 'members' => [ 'LaunchConfigurationName' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'LaunchConfigurationNames' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'LaunchConfigurationNamesType' => [ 'type' => 'structure', 'members' => [ 'LaunchConfigurationNames' => [ 'shape' => 'LaunchConfigurationNames', ], 'NextToken' => [ 'shape' => 'XmlString', ], 'MaxRecords' => [ 'shape' => 'MaxRecords', ], ], ], 'LaunchConfigurations' => [ 'type' => 'list', 'member' => [ 'shape' => 'LaunchConfiguration', ], ], 'LaunchConfigurationsType' => [ 'type' => 'structure', 'required' => [ 'LaunchConfigurations', ], 'members' => [ 'LaunchConfigurations' => [ 'shape' => 'LaunchConfigurations', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'LaunchTemplate' => [ 'type' => 'structure', 'members' => [ 'LaunchTemplateSpecification' => [ 'shape' => 'LaunchTemplateSpecification', ], 'Overrides' => [ 'shape' => 'Overrides', ], ], ], 'LaunchTemplateName' => [ 'type' => 'string', 'max' => 128, 'min' => 3, 'pattern' => '[a-zA-Z0-9\\\\(\\\\)\\\\.\\\\-/_]+', ], 'LaunchTemplateOverrides' => [ 'type' => 'structure', 'members' => [ 'InstanceType' => [ 'shape' => 'XmlStringMaxLen255', ], 'WeightedCapacity' => [ 'shape' => 'XmlStringMaxLen32', ], 'LaunchTemplateSpecification' => [ 'shape' => 'LaunchTemplateSpecification', ], 'InstanceRequirements' => [ 'shape' => 'InstanceRequirements', ], ], ], 'LaunchTemplateSpecification' => [ 'type' => 'structure', 'members' => [ 'LaunchTemplateId' => [ 'shape' => 'XmlStringMaxLen255', ], 'LaunchTemplateName' => [ 'shape' => 'LaunchTemplateName', ], 'Version' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'LifecycleActionResult' => [ 'type' => 'string', ], 'LifecycleActionToken' => [ 'type' => 'string', 'max' => 36, 'min' => 36, ], 'LifecycleHook' => [ 'type' => 'structure', 'members' => [ 'LifecycleHookName' => [ 'shape' => 'AsciiStringMaxLen255', ], 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'LifecycleTransition' => [ 'shape' => 'LifecycleTransition', ], 'NotificationTargetARN' => [ 'shape' => 'NotificationTargetResourceName', ], 'RoleARN' => [ 'shape' => 'XmlStringMaxLen255', ], 'NotificationMetadata' => [ 'shape' => 'XmlStringMaxLen1023', ], 'HeartbeatTimeout' => [ 'shape' => 'HeartbeatTimeout', ], 'GlobalTimeout' => [ 'shape' => 'GlobalTimeout', ], 'DefaultResult' => [ 'shape' => 'LifecycleActionResult', ], ], ], 'LifecycleHookNames' => [ 'type' => 'list', 'member' => [ 'shape' => 'AsciiStringMaxLen255', ], 'max' => 50, ], 'LifecycleHookSpecification' => [ 'type' => 'structure', 'required' => [ 'LifecycleHookName', 'LifecycleTransition', ], 'members' => [ 'LifecycleHookName' => [ 'shape' => 'AsciiStringMaxLen255', ], 'LifecycleTransition' => [ 'shape' => 'LifecycleTransition', ], 'NotificationMetadata' => [ 'shape' => 'XmlStringMaxLen1023', ], 'HeartbeatTimeout' => [ 'shape' => 'HeartbeatTimeout', ], 'DefaultResult' => [ 'shape' => 'LifecycleActionResult', ], 'NotificationTargetARN' => [ 'shape' => 'NotificationTargetResourceName', ], 'RoleARN' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'LifecycleHookSpecifications' => [ 'type' => 'list', 'member' => [ 'shape' => 'LifecycleHookSpecification', ], ], 'LifecycleHooks' => [ 'type' => 'list', 'member' => [ 'shape' => 'LifecycleHook', ], ], 'LifecycleState' => [ 'type' => 'string', 'enum' => [ 'Pending', 'Pending:Wait', 'Pending:Proceed', 'Quarantined', 'InService', 'Terminating', 'Terminating:Wait', 'Terminating:Proceed', 'Terminated', 'Detaching', 'Detached', 'EnteringStandby', 'Standby', 'Warmed:Pending', 'Warmed:Pending:Wait', 'Warmed:Pending:Proceed', 'Warmed:Terminating', 'Warmed:Terminating:Wait', 'Warmed:Terminating:Proceed', 'Warmed:Terminated', 'Warmed:Stopped', 'Warmed:Running', 'Warmed:Hibernated', ], ], 'LifecycleTransition' => [ 'type' => 'string', ], 'LimitExceededFault' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'error' => [ 'code' => 'LimitExceeded', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'LoadBalancerNames' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'LoadBalancerState' => [ 'type' => 'structure', 'members' => [ 'LoadBalancerName' => [ 'shape' => 'XmlStringMaxLen255', ], 'State' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'LoadBalancerStates' => [ 'type' => 'list', 'member' => [ 'shape' => 'LoadBalancerState', ], ], 'LoadBalancerTargetGroupState' => [ 'type' => 'structure', 'members' => [ 'LoadBalancerTargetGroupARN' => [ 'shape' => 'XmlStringMaxLen511', ], 'State' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'LoadBalancerTargetGroupStates' => [ 'type' => 'list', 'member' => [ 'shape' => 'LoadBalancerTargetGroupState', ], ], 'LoadForecast' => [ 'type' => 'structure', 'required' => [ 'Timestamps', 'Values', 'MetricSpecification', ], 'members' => [ 'Timestamps' => [ 'shape' => 'PredictiveScalingForecastTimestamps', ], 'Values' => [ 'shape' => 'PredictiveScalingForecastValues', ], 'MetricSpecification' => [ 'shape' => 'PredictiveScalingMetricSpecification', ], ], ], 'LoadForecasts' => [ 'type' => 'list', 'member' => [ 'shape' => 'LoadForecast', ], ], 'LocalStorage' => [ 'type' => 'string', 'enum' => [ 'included', 'excluded', 'required', ], ], 'LocalStorageType' => [ 'type' => 'string', 'enum' => [ 'hdd', 'ssd', ], ], 'LocalStorageTypes' => [ 'type' => 'list', 'member' => [ 'shape' => 'LocalStorageType', ], ], 'MaxGroupPreparedCapacity' => [ 'type' => 'integer', 'min' => -1, ], 'MaxInstanceLifetime' => [ 'type' => 'integer', ], 'MaxNumberOfAutoScalingGroups' => [ 'type' => 'integer', ], 'MaxNumberOfLaunchConfigurations' => [ 'type' => 'integer', ], 'MaxRecords' => [ 'type' => 'integer', ], 'MemoryGiBPerVCpuRequest' => [ 'type' => 'structure', 'members' => [ 'Min' => [ 'shape' => 'NullablePositiveDouble', ], 'Max' => [ 'shape' => 'NullablePositiveDouble', ], ], ], 'MemoryMiBRequest' => [ 'type' => 'structure', 'required' => [ 'Min', ], 'members' => [ 'Min' => [ 'shape' => 'NullablePositiveInteger', ], 'Max' => [ 'shape' => 'NullablePositiveInteger', ], ], ], 'Metric' => [ 'type' => 'structure', 'required' => [ 'Namespace', 'MetricName', ], 'members' => [ 'Namespace' => [ 'shape' => 'MetricNamespace', ], 'MetricName' => [ 'shape' => 'MetricName', ], 'Dimensions' => [ 'shape' => 'MetricDimensions', ], ], ], 'MetricCollectionType' => [ 'type' => 'structure', 'members' => [ 'Metric' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'MetricCollectionTypes' => [ 'type' => 'list', 'member' => [ 'shape' => 'MetricCollectionType', ], ], 'MetricDataQueries' => [ 'type' => 'list', 'member' => [ 'shape' => 'MetricDataQuery', ], ], 'MetricDataQuery' => [ 'type' => 'structure', 'required' => [ 'Id', ], 'members' => [ 'Id' => [ 'shape' => 'XmlStringMaxLen255', ], 'Expression' => [ 'shape' => 'XmlStringMaxLen1023', ], 'MetricStat' => [ 'shape' => 'MetricStat', ], 'Label' => [ 'shape' => 'XmlStringMetricLabel', ], 'ReturnData' => [ 'shape' => 'ReturnData', ], ], ], 'MetricDimension' => [ 'type' => 'structure', 'required' => [ 'Name', 'Value', ], 'members' => [ 'Name' => [ 'shape' => 'MetricDimensionName', ], 'Value' => [ 'shape' => 'MetricDimensionValue', ], ], ], 'MetricDimensionName' => [ 'type' => 'string', ], 'MetricDimensionValue' => [ 'type' => 'string', ], 'MetricDimensions' => [ 'type' => 'list', 'member' => [ 'shape' => 'MetricDimension', ], ], 'MetricGranularityType' => [ 'type' => 'structure', 'members' => [ 'Granularity' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'MetricGranularityTypes' => [ 'type' => 'list', 'member' => [ 'shape' => 'MetricGranularityType', ], ], 'MetricName' => [ 'type' => 'string', ], 'MetricNamespace' => [ 'type' => 'string', ], 'MetricScale' => [ 'type' => 'double', ], 'MetricStat' => [ 'type' => 'structure', 'required' => [ 'Metric', 'Stat', ], 'members' => [ 'Metric' => [ 'shape' => 'Metric', ], 'Stat' => [ 'shape' => 'XmlStringMetricStat', ], 'Unit' => [ 'shape' => 'MetricUnit', ], ], ], 'MetricStatistic' => [ 'type' => 'string', 'enum' => [ 'Average', 'Minimum', 'Maximum', 'SampleCount', 'Sum', ], ], 'MetricType' => [ 'type' => 'string', 'enum' => [ 'ASGAverageCPUUtilization', 'ASGAverageNetworkIn', 'ASGAverageNetworkOut', 'ALBRequestCountPerTarget', ], ], 'MetricUnit' => [ 'type' => 'string', ], 'Metrics' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'MinAdjustmentMagnitude' => [ 'type' => 'integer', ], 'MinAdjustmentStep' => [ 'type' => 'integer', 'deprecated' => true, ], 'MixedInstanceSpotPrice' => [ 'type' => 'string', 'max' => 255, 'min' => 0, ], 'MixedInstancesPolicy' => [ 'type' => 'structure', 'members' => [ 'LaunchTemplate' => [ 'shape' => 'LaunchTemplate', ], 'InstancesDistribution' => [ 'shape' => 'InstancesDistribution', ], ], ], 'MonitoringEnabled' => [ 'type' => 'boolean', ], 'NetworkBandwidthGbpsRequest' => [ 'type' => 'structure', 'members' => [ 'Min' => [ 'shape' => 'NullablePositiveDouble', ], 'Max' => [ 'shape' => 'NullablePositiveDouble', ], ], ], 'NetworkInterfaceCountRequest' => [ 'type' => 'structure', 'members' => [ 'Min' => [ 'shape' => 'NullablePositiveInteger', ], 'Max' => [ 'shape' => 'NullablePositiveInteger', ], ], ], 'NoDevice' => [ 'type' => 'boolean', ], 'NonZeroIntPercent' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'NotificationConfiguration' => [ 'type' => 'structure', 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'TopicARN' => [ 'shape' => 'XmlStringMaxLen255', ], 'NotificationType' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'NotificationConfigurations' => [ 'type' => 'list', 'member' => [ 'shape' => 'NotificationConfiguration', ], ], 'NotificationTargetResourceName' => [ 'type' => 'string', 'max' => 255, 'min' => 0, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'NullableBoolean' => [ 'type' => 'boolean', ], 'NullablePositiveDouble' => [ 'type' => 'double', 'min' => 0, ], 'NullablePositiveInteger' => [ 'type' => 'integer', 'min' => 0, ], 'NumberOfAutoScalingGroups' => [ 'type' => 'integer', ], 'NumberOfLaunchConfigurations' => [ 'type' => 'integer', ], 'OnDemandBaseCapacity' => [ 'type' => 'integer', ], 'OnDemandPercentageAboveBaseCapacity' => [ 'type' => 'integer', ], 'Overrides' => [ 'type' => 'list', 'member' => [ 'shape' => 'LaunchTemplateOverrides', ], ], 'PoliciesType' => [ 'type' => 'structure', 'members' => [ 'ScalingPolicies' => [ 'shape' => 'ScalingPolicies', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'PolicyARNType' => [ 'type' => 'structure', 'members' => [ 'PolicyARN' => [ 'shape' => 'ResourceName', ], 'Alarms' => [ 'shape' => 'Alarms', ], ], ], 'PolicyIncrement' => [ 'type' => 'integer', ], 'PolicyNames' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResourceName', ], ], 'PolicyTypes' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlStringMaxLen64', ], ], 'PredefinedLoadMetricType' => [ 'type' => 'string', 'enum' => [ 'ASGTotalCPUUtilization', 'ASGTotalNetworkIn', 'ASGTotalNetworkOut', 'ALBTargetGroupRequestCount', ], ], 'PredefinedMetricPairType' => [ 'type' => 'string', 'enum' => [ 'ASGCPUUtilization', 'ASGNetworkIn', 'ASGNetworkOut', 'ALBRequestCount', ], ], 'PredefinedMetricSpecification' => [ 'type' => 'structure', 'required' => [ 'PredefinedMetricType', ], 'members' => [ 'PredefinedMetricType' => [ 'shape' => 'MetricType', ], 'ResourceLabel' => [ 'shape' => 'XmlStringMaxLen1023', ], ], ], 'PredefinedScalingMetricType' => [ 'type' => 'string', 'enum' => [ 'ASGAverageCPUUtilization', 'ASGAverageNetworkIn', 'ASGAverageNetworkOut', 'ALBRequestCountPerTarget', ], ], 'PredictiveScalingConfiguration' => [ 'type' => 'structure', 'required' => [ 'MetricSpecifications', ], 'members' => [ 'MetricSpecifications' => [ 'shape' => 'PredictiveScalingMetricSpecifications', ], 'Mode' => [ 'shape' => 'PredictiveScalingMode', ], 'SchedulingBufferTime' => [ 'shape' => 'PredictiveScalingSchedulingBufferTime', ], 'MaxCapacityBreachBehavior' => [ 'shape' => 'PredictiveScalingMaxCapacityBreachBehavior', ], 'MaxCapacityBuffer' => [ 'shape' => 'PredictiveScalingMaxCapacityBuffer', ], ], ], 'PredictiveScalingCustomizedCapacityMetric' => [ 'type' => 'structure', 'required' => [ 'MetricDataQueries', ], 'members' => [ 'MetricDataQueries' => [ 'shape' => 'MetricDataQueries', ], ], ], 'PredictiveScalingCustomizedLoadMetric' => [ 'type' => 'structure', 'required' => [ 'MetricDataQueries', ], 'members' => [ 'MetricDataQueries' => [ 'shape' => 'MetricDataQueries', ], ], ], 'PredictiveScalingCustomizedScalingMetric' => [ 'type' => 'structure', 'required' => [ 'MetricDataQueries', ], 'members' => [ 'MetricDataQueries' => [ 'shape' => 'MetricDataQueries', ], ], ], 'PredictiveScalingForecastTimestamps' => [ 'type' => 'list', 'member' => [ 'shape' => 'TimestampType', ], ], 'PredictiveScalingForecastValues' => [ 'type' => 'list', 'member' => [ 'shape' => 'MetricScale', ], ], 'PredictiveScalingMaxCapacityBreachBehavior' => [ 'type' => 'string', 'enum' => [ 'HonorMaxCapacity', 'IncreaseMaxCapacity', ], ], 'PredictiveScalingMaxCapacityBuffer' => [ 'type' => 'integer', 'max' => 100, 'min' => 0, ], 'PredictiveScalingMetricSpecification' => [ 'type' => 'structure', 'required' => [ 'TargetValue', ], 'members' => [ 'TargetValue' => [ 'shape' => 'MetricScale', ], 'PredefinedMetricPairSpecification' => [ 'shape' => 'PredictiveScalingPredefinedMetricPair', ], 'PredefinedScalingMetricSpecification' => [ 'shape' => 'PredictiveScalingPredefinedScalingMetric', ], 'PredefinedLoadMetricSpecification' => [ 'shape' => 'PredictiveScalingPredefinedLoadMetric', ], 'CustomizedScalingMetricSpecification' => [ 'shape' => 'PredictiveScalingCustomizedScalingMetric', ], 'CustomizedLoadMetricSpecification' => [ 'shape' => 'PredictiveScalingCustomizedLoadMetric', ], 'CustomizedCapacityMetricSpecification' => [ 'shape' => 'PredictiveScalingCustomizedCapacityMetric', ], ], ], 'PredictiveScalingMetricSpecifications' => [ 'type' => 'list', 'member' => [ 'shape' => 'PredictiveScalingMetricSpecification', ], ], 'PredictiveScalingMode' => [ 'type' => 'string', 'enum' => [ 'ForecastAndScale', 'ForecastOnly', ], ], 'PredictiveScalingPredefinedLoadMetric' => [ 'type' => 'structure', 'required' => [ 'PredefinedMetricType', ], 'members' => [ 'PredefinedMetricType' => [ 'shape' => 'PredefinedLoadMetricType', ], 'ResourceLabel' => [ 'shape' => 'XmlStringMaxLen1023', ], ], ], 'PredictiveScalingPredefinedMetricPair' => [ 'type' => 'structure', 'required' => [ 'PredefinedMetricType', ], 'members' => [ 'PredefinedMetricType' => [ 'shape' => 'PredefinedMetricPairType', ], 'ResourceLabel' => [ 'shape' => 'XmlStringMaxLen1023', ], ], ], 'PredictiveScalingPredefinedScalingMetric' => [ 'type' => 'structure', 'required' => [ 'PredefinedMetricType', ], 'members' => [ 'PredefinedMetricType' => [ 'shape' => 'PredefinedScalingMetricType', ], 'ResourceLabel' => [ 'shape' => 'XmlStringMaxLen1023', ], ], ], 'PredictiveScalingSchedulingBufferTime' => [ 'type' => 'integer', 'min' => 0, ], 'ProcessNames' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'ProcessType' => [ 'type' => 'structure', 'required' => [ 'ProcessName', ], 'members' => [ 'ProcessName' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'Processes' => [ 'type' => 'list', 'member' => [ 'shape' => 'ProcessType', ], ], 'ProcessesType' => [ 'type' => 'structure', 'members' => [ 'Processes' => [ 'shape' => 'Processes', ], ], ], 'Progress' => [ 'type' => 'integer', ], 'PropagateAtLaunch' => [ 'type' => 'boolean', ], 'ProtectedFromScaleIn' => [ 'type' => 'boolean', ], 'PutLifecycleHookAnswer' => [ 'type' => 'structure', 'members' => [], ], 'PutLifecycleHookType' => [ 'type' => 'structure', 'required' => [ 'LifecycleHookName', 'AutoScalingGroupName', ], 'members' => [ 'LifecycleHookName' => [ 'shape' => 'AsciiStringMaxLen255', ], 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'LifecycleTransition' => [ 'shape' => 'LifecycleTransition', ], 'RoleARN' => [ 'shape' => 'XmlStringMaxLen255', ], 'NotificationTargetARN' => [ 'shape' => 'NotificationTargetResourceName', ], 'NotificationMetadata' => [ 'shape' => 'XmlStringMaxLen1023', ], 'HeartbeatTimeout' => [ 'shape' => 'HeartbeatTimeout', ], 'DefaultResult' => [ 'shape' => 'LifecycleActionResult', ], ], ], 'PutNotificationConfigurationType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'TopicARN', 'NotificationTypes', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'TopicARN' => [ 'shape' => 'XmlStringMaxLen255', ], 'NotificationTypes' => [ 'shape' => 'AutoScalingNotificationTypes', ], ], ], 'PutScalingPolicyType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'PolicyName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'PolicyName' => [ 'shape' => 'XmlStringMaxLen255', ], 'PolicyType' => [ 'shape' => 'XmlStringMaxLen64', ], 'AdjustmentType' => [ 'shape' => 'XmlStringMaxLen255', ], 'MinAdjustmentStep' => [ 'shape' => 'MinAdjustmentStep', ], 'MinAdjustmentMagnitude' => [ 'shape' => 'MinAdjustmentMagnitude', ], 'ScalingAdjustment' => [ 'shape' => 'PolicyIncrement', ], 'Cooldown' => [ 'shape' => 'Cooldown', ], 'MetricAggregationType' => [ 'shape' => 'XmlStringMaxLen32', ], 'StepAdjustments' => [ 'shape' => 'StepAdjustments', ], 'EstimatedInstanceWarmup' => [ 'shape' => 'EstimatedInstanceWarmup', ], 'TargetTrackingConfiguration' => [ 'shape' => 'TargetTrackingConfiguration', ], 'Enabled' => [ 'shape' => 'ScalingPolicyEnabled', ], 'PredictiveScalingConfiguration' => [ 'shape' => 'PredictiveScalingConfiguration', ], ], ], 'PutScheduledUpdateGroupActionType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'ScheduledActionName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'ScheduledActionName' => [ 'shape' => 'XmlStringMaxLen255', ], 'Time' => [ 'shape' => 'TimestampType', ], 'StartTime' => [ 'shape' => 'TimestampType', ], 'EndTime' => [ 'shape' => 'TimestampType', ], 'Recurrence' => [ 'shape' => 'XmlStringMaxLen255', ], 'MinSize' => [ 'shape' => 'AutoScalingGroupMinSize', ], 'MaxSize' => [ 'shape' => 'AutoScalingGroupMaxSize', ], 'DesiredCapacity' => [ 'shape' => 'AutoScalingGroupDesiredCapacity', ], 'TimeZone' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'PutWarmPoolAnswer' => [ 'type' => 'structure', 'members' => [], ], 'PutWarmPoolType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'MaxGroupPreparedCapacity' => [ 'shape' => 'MaxGroupPreparedCapacity', ], 'MinSize' => [ 'shape' => 'WarmPoolMinSize', ], 'PoolState' => [ 'shape' => 'WarmPoolState', ], 'InstanceReusePolicy' => [ 'shape' => 'InstanceReusePolicy', ], ], ], 'RecordLifecycleActionHeartbeatAnswer' => [ 'type' => 'structure', 'members' => [], ], 'RecordLifecycleActionHeartbeatType' => [ 'type' => 'structure', 'required' => [ 'LifecycleHookName', 'AutoScalingGroupName', ], 'members' => [ 'LifecycleHookName' => [ 'shape' => 'AsciiStringMaxLen255', ], 'AutoScalingGroupName' => [ 'shape' => 'ResourceName', ], 'LifecycleActionToken' => [ 'shape' => 'LifecycleActionToken', ], 'InstanceId' => [ 'shape' => 'XmlStringMaxLen19', ], ], ], 'RefreshInstanceWarmup' => [ 'type' => 'integer', 'min' => 0, ], 'RefreshPreferences' => [ 'type' => 'structure', 'members' => [ 'MinHealthyPercentage' => [ 'shape' => 'IntPercent', ], 'InstanceWarmup' => [ 'shape' => 'RefreshInstanceWarmup', ], 'CheckpointPercentages' => [ 'shape' => 'CheckpointPercentages', ], 'CheckpointDelay' => [ 'shape' => 'CheckpointDelay', ], 'SkipMatching' => [ 'shape' => 'SkipMatching', ], 'AutoRollback' => [ 'shape' => 'AutoRollback', ], 'ScaleInProtectedInstances' => [ 'shape' => 'ScaleInProtectedInstances', ], 'StandbyInstances' => [ 'shape' => 'StandbyInstances', ], ], ], 'RefreshStrategy' => [ 'type' => 'string', 'enum' => [ 'Rolling', ], ], 'ResourceContentionFault' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'error' => [ 'code' => 'ResourceContention', 'httpStatusCode' => 500, 'senderFault' => true, ], 'exception' => true, ], 'ResourceInUseFault' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'error' => [ 'code' => 'ResourceInUse', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'ResourceName' => [ 'type' => 'string', 'max' => 1600, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'ReturnData' => [ 'type' => 'boolean', ], 'ReuseOnScaleIn' => [ 'type' => 'boolean', ], 'RollbackDetails' => [ 'type' => 'structure', 'members' => [ 'RollbackReason' => [ 'shape' => 'XmlStringMaxLen1023', ], 'RollbackStartTime' => [ 'shape' => 'TimestampType', ], 'PercentageCompleteOnRollback' => [ 'shape' => 'IntPercent', ], 'InstancesToUpdateOnRollback' => [ 'shape' => 'InstancesToUpdate', ], 'ProgressDetailsOnRollback' => [ 'shape' => 'InstanceRefreshProgressDetails', ], ], ], 'RollbackInstanceRefreshAnswer' => [ 'type' => 'structure', 'members' => [ 'InstanceRefreshId' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'RollbackInstanceRefreshType' => [ 'type' => 'structure', 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'ScaleInProtectedInstances' => [ 'type' => 'string', 'enum' => [ 'Refresh', 'Ignore', 'Wait', ], ], 'ScalingActivityInProgressFault' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'error' => [ 'code' => 'ScalingActivityInProgress', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'ScalingActivityStatusCode' => [ 'type' => 'string', 'enum' => [ 'PendingSpotBidPlacement', 'WaitingForSpotInstanceRequestId', 'WaitingForSpotInstanceId', 'WaitingForInstanceId', 'PreInService', 'InProgress', 'WaitingForELBConnectionDraining', 'MidLifecycleAction', 'WaitingForInstanceWarmup', 'Successful', 'Failed', 'Cancelled', 'WaitingForConnectionDraining', ], ], 'ScalingPolicies' => [ 'type' => 'list', 'member' => [ 'shape' => 'ScalingPolicy', ], ], 'ScalingPolicy' => [ 'type' => 'structure', 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'PolicyName' => [ 'shape' => 'XmlStringMaxLen255', ], 'PolicyARN' => [ 'shape' => 'ResourceName', ], 'PolicyType' => [ 'shape' => 'XmlStringMaxLen64', ], 'AdjustmentType' => [ 'shape' => 'XmlStringMaxLen255', ], 'MinAdjustmentStep' => [ 'shape' => 'MinAdjustmentStep', ], 'MinAdjustmentMagnitude' => [ 'shape' => 'MinAdjustmentMagnitude', ], 'ScalingAdjustment' => [ 'shape' => 'PolicyIncrement', ], 'Cooldown' => [ 'shape' => 'Cooldown', ], 'StepAdjustments' => [ 'shape' => 'StepAdjustments', ], 'MetricAggregationType' => [ 'shape' => 'XmlStringMaxLen32', ], 'EstimatedInstanceWarmup' => [ 'shape' => 'EstimatedInstanceWarmup', ], 'Alarms' => [ 'shape' => 'Alarms', ], 'TargetTrackingConfiguration' => [ 'shape' => 'TargetTrackingConfiguration', ], 'Enabled' => [ 'shape' => 'ScalingPolicyEnabled', ], 'PredictiveScalingConfiguration' => [ 'shape' => 'PredictiveScalingConfiguration', ], ], ], 'ScalingPolicyEnabled' => [ 'type' => 'boolean', ], 'ScalingProcessQuery' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'ScalingProcesses' => [ 'shape' => 'ProcessNames', ], ], ], 'ScheduledActionNames' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'ScheduledActionsType' => [ 'type' => 'structure', 'members' => [ 'ScheduledUpdateGroupActions' => [ 'shape' => 'ScheduledUpdateGroupActions', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'ScheduledUpdateGroupAction' => [ 'type' => 'structure', 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'ScheduledActionName' => [ 'shape' => 'XmlStringMaxLen255', ], 'ScheduledActionARN' => [ 'shape' => 'ResourceName', ], 'Time' => [ 'shape' => 'TimestampType', ], 'StartTime' => [ 'shape' => 'TimestampType', ], 'EndTime' => [ 'shape' => 'TimestampType', ], 'Recurrence' => [ 'shape' => 'XmlStringMaxLen255', ], 'MinSize' => [ 'shape' => 'AutoScalingGroupMinSize', ], 'MaxSize' => [ 'shape' => 'AutoScalingGroupMaxSize', ], 'DesiredCapacity' => [ 'shape' => 'AutoScalingGroupDesiredCapacity', ], 'TimeZone' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'ScheduledUpdateGroupActionRequest' => [ 'type' => 'structure', 'required' => [ 'ScheduledActionName', ], 'members' => [ 'ScheduledActionName' => [ 'shape' => 'XmlStringMaxLen255', ], 'StartTime' => [ 'shape' => 'TimestampType', ], 'EndTime' => [ 'shape' => 'TimestampType', ], 'Recurrence' => [ 'shape' => 'XmlStringMaxLen255', ], 'MinSize' => [ 'shape' => 'AutoScalingGroupMinSize', ], 'MaxSize' => [ 'shape' => 'AutoScalingGroupMaxSize', ], 'DesiredCapacity' => [ 'shape' => 'AutoScalingGroupDesiredCapacity', ], 'TimeZone' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'ScheduledUpdateGroupActionRequests' => [ 'type' => 'list', 'member' => [ 'shape' => 'ScheduledUpdateGroupActionRequest', ], ], 'ScheduledUpdateGroupActions' => [ 'type' => 'list', 'member' => [ 'shape' => 'ScheduledUpdateGroupAction', ], ], 'SecurityGroups' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlString', ], ], 'ServiceLinkedRoleFailure' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'XmlStringMaxLen255', ], ], 'error' => [ 'code' => 'ServiceLinkedRoleFailure', 'httpStatusCode' => 500, 'senderFault' => true, ], 'exception' => true, ], 'SetDesiredCapacityType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', 'DesiredCapacity', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'DesiredCapacity' => [ 'shape' => 'AutoScalingGroupDesiredCapacity', ], 'HonorCooldown' => [ 'shape' => 'HonorCooldown', ], ], ], 'SetInstanceHealthQuery' => [ 'type' => 'structure', 'required' => [ 'InstanceId', 'HealthStatus', ], 'members' => [ 'InstanceId' => [ 'shape' => 'XmlStringMaxLen19', ], 'HealthStatus' => [ 'shape' => 'XmlStringMaxLen32', ], 'ShouldRespectGracePeriod' => [ 'shape' => 'ShouldRespectGracePeriod', ], ], ], 'SetInstanceProtectionAnswer' => [ 'type' => 'structure', 'members' => [], ], 'SetInstanceProtectionQuery' => [ 'type' => 'structure', 'required' => [ 'InstanceIds', 'AutoScalingGroupName', 'ProtectedFromScaleIn', ], 'members' => [ 'InstanceIds' => [ 'shape' => 'InstanceIds', ], 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'ProtectedFromScaleIn' => [ 'shape' => 'ProtectedFromScaleIn', ], ], ], 'ShouldDecrementDesiredCapacity' => [ 'type' => 'boolean', ], 'ShouldRespectGracePeriod' => [ 'type' => 'boolean', ], 'SkipMatching' => [ 'type' => 'boolean', ], 'SpotInstancePools' => [ 'type' => 'integer', ], 'SpotPrice' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'StandbyInstances' => [ 'type' => 'string', 'enum' => [ 'Terminate', 'Ignore', 'Wait', ], ], 'StartInstanceRefreshAnswer' => [ 'type' => 'structure', 'members' => [ 'InstanceRefreshId' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'StartInstanceRefreshType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'Strategy' => [ 'shape' => 'RefreshStrategy', ], 'DesiredConfiguration' => [ 'shape' => 'DesiredConfiguration', ], 'Preferences' => [ 'shape' => 'RefreshPreferences', ], ], ], 'StepAdjustment' => [ 'type' => 'structure', 'required' => [ 'ScalingAdjustment', ], 'members' => [ 'MetricIntervalLowerBound' => [ 'shape' => 'MetricScale', ], 'MetricIntervalUpperBound' => [ 'shape' => 'MetricScale', ], 'ScalingAdjustment' => [ 'shape' => 'PolicyIncrement', ], ], ], 'StepAdjustments' => [ 'type' => 'list', 'member' => [ 'shape' => 'StepAdjustment', ], ], 'SuspendedProcess' => [ 'type' => 'structure', 'members' => [ 'ProcessName' => [ 'shape' => 'XmlStringMaxLen255', ], 'SuspensionReason' => [ 'shape' => 'XmlStringMaxLen255', ], ], ], 'SuspendedProcesses' => [ 'type' => 'list', 'member' => [ 'shape' => 'SuspendedProcess', ], ], 'Tag' => [ 'type' => 'structure', 'required' => [ 'Key', ], 'members' => [ 'ResourceId' => [ 'shape' => 'XmlString', ], 'ResourceType' => [ 'shape' => 'XmlString', ], 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], 'PropagateAtLaunch' => [ 'shape' => 'PropagateAtLaunch', ], ], ], 'TagDescription' => [ 'type' => 'structure', 'members' => [ 'ResourceId' => [ 'shape' => 'XmlString', ], 'ResourceType' => [ 'shape' => 'XmlString', ], 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], 'PropagateAtLaunch' => [ 'shape' => 'PropagateAtLaunch', ], ], ], 'TagDescriptionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagDescription', ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'Tags' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], ], 'TagsType' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagDescriptionList', ], 'NextToken' => [ 'shape' => 'XmlString', ], ], ], 'TargetGroupARNs' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlStringMaxLen511', ], ], 'TargetTrackingConfiguration' => [ 'type' => 'structure', 'required' => [ 'TargetValue', ], 'members' => [ 'PredefinedMetricSpecification' => [ 'shape' => 'PredefinedMetricSpecification', ], 'CustomizedMetricSpecification' => [ 'shape' => 'CustomizedMetricSpecification', ], 'TargetValue' => [ 'shape' => 'MetricScale', ], 'DisableScaleIn' => [ 'shape' => 'DisableScaleIn', ], ], ], 'TargetTrackingMetricDataQueries' => [ 'type' => 'list', 'member' => [ 'shape' => 'TargetTrackingMetricDataQuery', ], ], 'TargetTrackingMetricDataQuery' => [ 'type' => 'structure', 'required' => [ 'Id', ], 'members' => [ 'Id' => [ 'shape' => 'XmlStringMaxLen255', ], 'Expression' => [ 'shape' => 'XmlStringMaxLen2047', ], 'MetricStat' => [ 'shape' => 'TargetTrackingMetricStat', ], 'Label' => [ 'shape' => 'XmlStringMetricLabel', ], 'ReturnData' => [ 'shape' => 'ReturnData', ], ], ], 'TargetTrackingMetricStat' => [ 'type' => 'structure', 'required' => [ 'Metric', 'Stat', ], 'members' => [ 'Metric' => [ 'shape' => 'Metric', ], 'Stat' => [ 'shape' => 'XmlStringMetricStat', ], 'Unit' => [ 'shape' => 'MetricUnit', ], ], ], 'TerminateInstanceInAutoScalingGroupType' => [ 'type' => 'structure', 'required' => [ 'InstanceId', 'ShouldDecrementDesiredCapacity', ], 'members' => [ 'InstanceId' => [ 'shape' => 'XmlStringMaxLen19', ], 'ShouldDecrementDesiredCapacity' => [ 'shape' => 'ShouldDecrementDesiredCapacity', ], ], ], 'TerminationPolicies' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlStringMaxLen1600', ], ], 'TimestampType' => [ 'type' => 'timestamp', ], 'TotalLocalStorageGBRequest' => [ 'type' => 'structure', 'members' => [ 'Min' => [ 'shape' => 'NullablePositiveDouble', ], 'Max' => [ 'shape' => 'NullablePositiveDouble', ], ], ], 'TrafficSourceIdentifier' => [ 'type' => 'structure', 'required' => [ 'Identifier', ], 'members' => [ 'Identifier' => [ 'shape' => 'XmlStringMaxLen511', ], 'Type' => [ 'shape' => 'XmlStringMaxLen511', ], ], ], 'TrafficSourceState' => [ 'type' => 'structure', 'members' => [ 'TrafficSource' => [ 'shape' => 'XmlStringMaxLen511', 'deprecated' => true, 'deprecatedMessage' => 'TrafficSource has been replaced by Identifier', ], 'State' => [ 'shape' => 'XmlStringMaxLen255', ], 'Identifier' => [ 'shape' => 'XmlStringMaxLen511', ], 'Type' => [ 'shape' => 'XmlStringMaxLen511', ], ], ], 'TrafficSourceStates' => [ 'type' => 'list', 'member' => [ 'shape' => 'TrafficSourceState', ], ], 'TrafficSources' => [ 'type' => 'list', 'member' => [ 'shape' => 'TrafficSourceIdentifier', ], ], 'UpdateAutoScalingGroupType' => [ 'type' => 'structure', 'required' => [ 'AutoScalingGroupName', ], 'members' => [ 'AutoScalingGroupName' => [ 'shape' => 'XmlStringMaxLen255', ], 'LaunchConfigurationName' => [ 'shape' => 'XmlStringMaxLen255', ], 'LaunchTemplate' => [ 'shape' => 'LaunchTemplateSpecification', ], 'MixedInstancesPolicy' => [ 'shape' => 'MixedInstancesPolicy', ], 'MinSize' => [ 'shape' => 'AutoScalingGroupMinSize', ], 'MaxSize' => [ 'shape' => 'AutoScalingGroupMaxSize', ], 'DesiredCapacity' => [ 'shape' => 'AutoScalingGroupDesiredCapacity', ], 'DefaultCooldown' => [ 'shape' => 'Cooldown', ], 'AvailabilityZones' => [ 'shape' => 'AvailabilityZones', ], 'HealthCheckType' => [ 'shape' => 'XmlStringMaxLen32', ], 'HealthCheckGracePeriod' => [ 'shape' => 'HealthCheckGracePeriod', ], 'PlacementGroup' => [ 'shape' => 'XmlStringMaxLen255', ], 'VPCZoneIdentifier' => [ 'shape' => 'XmlStringMaxLen2047', ], 'TerminationPolicies' => [ 'shape' => 'TerminationPolicies', ], 'NewInstancesProtectedFromScaleIn' => [ 'shape' => 'InstanceProtected', ], 'ServiceLinkedRoleARN' => [ 'shape' => 'ResourceName', ], 'MaxInstanceLifetime' => [ 'shape' => 'MaxInstanceLifetime', ], 'CapacityRebalance' => [ 'shape' => 'CapacityRebalanceEnabled', ], 'Context' => [ 'shape' => 'Context', ], 'DesiredCapacityType' => [ 'shape' => 'XmlStringMaxLen255', ], 'DefaultInstanceWarmup' => [ 'shape' => 'DefaultInstanceWarmup', ], ], ], 'VCpuCountRequest' => [ 'type' => 'structure', 'required' => [ 'Min', ], 'members' => [ 'Min' => [ 'shape' => 'NullablePositiveInteger', ], 'Max' => [ 'shape' => 'NullablePositiveInteger', ], ], ], 'Values' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlString', ], ], 'WarmPoolConfiguration' => [ 'type' => 'structure', 'members' => [ 'MaxGroupPreparedCapacity' => [ 'shape' => 'MaxGroupPreparedCapacity', ], 'MinSize' => [ 'shape' => 'WarmPoolMinSize', ], 'PoolState' => [ 'shape' => 'WarmPoolState', ], 'Status' => [ 'shape' => 'WarmPoolStatus', ], 'InstanceReusePolicy' => [ 'shape' => 'InstanceReusePolicy', ], ], ], 'WarmPoolMinSize' => [ 'type' => 'integer', 'min' => 0, ], 'WarmPoolSize' => [ 'type' => 'integer', ], 'WarmPoolState' => [ 'type' => 'string', 'enum' => [ 'Stopped', 'Running', 'Hibernated', ], ], 'WarmPoolStatus' => [ 'type' => 'string', 'enum' => [ 'PendingDelete', ], ], 'XmlString' => [ 'type' => 'string', 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'XmlStringMaxLen1023' => [ 'type' => 'string', 'max' => 1023, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'XmlStringMaxLen1600' => [ 'type' => 'string', 'max' => 1600, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'XmlStringMaxLen19' => [ 'type' => 'string', 'max' => 19, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'XmlStringMaxLen2047' => [ 'type' => 'string', 'max' => 2047, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'XmlStringMaxLen255' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'XmlStringMaxLen32' => [ 'type' => 'string', 'max' => 32, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'XmlStringMaxLen511' => [ 'type' => 'string', 'max' => 511, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'XmlStringMaxLen64' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'XmlStringMetricLabel' => [ 'type' => 'string', 'max' => 2047, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'XmlStringMetricStat' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'XmlStringUserData' => [ 'type' => 'string', 'max' => 21847, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/autoscaling/2011-01-01/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<fullname>Amazon EC2 Auto Scaling</fullname> <p>Amazon EC2 Auto Scaling is designed to automatically launch and terminate EC2 instances based on user-defined scaling policies, scheduled actions, and health checks.</p> <p>For more information, see the <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/\">Amazon EC2 Auto Scaling User Guide</a> and the <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/APIReference/Welcome.html\">Amazon EC2 Auto Scaling API Reference</a>.</p>', 'operations' => [ 'AttachInstances' => '<p>Attaches one or more EC2 instances to the specified Auto Scaling group.</p> <p>When you attach instances, Amazon EC2 Auto Scaling increases the desired capacity of the group by the number of instances being attached. If the number of instances being attached plus the desired capacity of the group exceeds the maximum size of the group, the operation fails.</p> <p>If there is a Classic Load Balancer attached to your Auto Scaling group, the instances are also registered with the load balancer. If there are target groups attached to your Auto Scaling group, the instances are also registered with the target groups.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/attach-instance-asg.html\">Attach EC2 instances to your Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'AttachLoadBalancerTargetGroups' => '<note> <p>This API operation is superseded by <a>AttachTrafficSources</a>, which can attach multiple traffic sources types. We recommend using <code>AttachTrafficSources</code> to simplify how you manage traffic sources. However, we continue to support <code>AttachLoadBalancerTargetGroups</code>. You can use both the original <code>AttachLoadBalancerTargetGroups</code> API operation and <code>AttachTrafficSources</code> on the same Auto Scaling group.</p> </note> <p>Attaches one or more target groups to the specified Auto Scaling group.</p> <p>This operation is used with the following load balancer types: </p> <ul> <li> <p>Application Load Balancer - Operates at the application layer (layer 7) and supports HTTP and HTTPS. </p> </li> <li> <p>Network Load Balancer - Operates at the transport layer (layer 4) and supports TCP, TLS, and UDP. </p> </li> <li> <p>Gateway Load Balancer - Operates at the network layer (layer 3).</p> </li> </ul> <p>To describe the target groups for an Auto Scaling group, call the <a>DescribeLoadBalancerTargetGroups</a> API. To detach the target group from the Auto Scaling group, call the <a>DetachLoadBalancerTargetGroups</a> API.</p> <p>This operation is additive and does not detach existing target groups or Classic Load Balancers from the Auto Scaling group.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html\">Use Elastic Load Balancing to distribute traffic across the instances in your Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>. </p>', 'AttachLoadBalancers' => '<note> <p>This API operation is superseded by <a>AttachTrafficSources</a>, which can attach multiple traffic sources types. We recommend using <code>AttachTrafficSources</code> to simplify how you manage traffic sources. However, we continue to support <code>AttachLoadBalancers</code>. You can use both the original <code>AttachLoadBalancers</code> API operation and <code>AttachTrafficSources</code> on the same Auto Scaling group.</p> </note> <p>Attaches one or more Classic Load Balancers to the specified Auto Scaling group. Amazon EC2 Auto Scaling registers the running instances with these Classic Load Balancers.</p> <p>To describe the load balancers for an Auto Scaling group, call the <a>DescribeLoadBalancers</a> API. To detach a load balancer from the Auto Scaling group, call the <a>DetachLoadBalancers</a> API.</p> <p>This operation is additive and does not detach existing Classic Load Balancers or target groups from the Auto Scaling group.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html\">Use Elastic Load Balancing to distribute traffic across the instances in your Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'AttachTrafficSources' => '<p>Attaches one or more traffic sources to the specified Auto Scaling group.</p> <p>You can use any of the following as traffic sources for an Auto Scaling group:</p> <ul> <li> <p>Application Load Balancer</p> </li> <li> <p>Classic Load Balancer</p> </li> <li> <p>Gateway Load Balancer</p> </li> <li> <p>Network Load Balancer</p> </li> <li> <p>VPC Lattice</p> </li> </ul> <p>This operation is additive and does not detach existing traffic sources from the Auto Scaling group. </p> <p>After the operation completes, use the <a>DescribeTrafficSources</a> API to return details about the state of the attachments between traffic sources and your Auto Scaling group. To detach a traffic source from the Auto Scaling group, call the <a>DetachTrafficSources</a> API.</p>', 'BatchDeleteScheduledAction' => '<p>Deletes one or more scheduled actions for the specified Auto Scaling group.</p>', 'BatchPutScheduledUpdateGroupAction' => '<p>Creates or updates one or more scheduled scaling actions for an Auto Scaling group.</p>', 'CancelInstanceRefresh' => '<p>Cancels an instance refresh or rollback that is in progress. If an instance refresh or rollback is not in progress, an <code>ActiveInstanceRefreshNotFound</code> error occurs.</p> <p>This operation is part of the <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html\">instance refresh feature</a> in Amazon EC2 Auto Scaling, which helps you update instances in your Auto Scaling group after you make configuration changes.</p> <p>When you cancel an instance refresh, this does not roll back any changes that it made. Use the <a>RollbackInstanceRefresh</a> API to roll back instead.</p>', 'CompleteLifecycleAction' => '<p>Completes the lifecycle action for the specified token or instance with the specified result.</p> <p>This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling group:</p> <ol> <li> <p>(Optional) Create a launch template or launch configuration with a user data script that runs while an instance is in a wait state due to a lifecycle hook.</p> </li> <li> <p>(Optional) Create a Lambda function and a rule that allows Amazon EventBridge to invoke your Lambda function when an instance is put into a wait state due to a lifecycle hook.</p> </li> <li> <p>(Optional) Create a notification target and an IAM role. The target can be either an Amazon SQS queue or an Amazon SNS topic. The role allows Amazon EC2 Auto Scaling to publish lifecycle notifications to the target.</p> </li> <li> <p>Create the lifecycle hook. Specify whether the hook is used when the instances launch or terminate.</p> </li> <li> <p>If you need more time, record the lifecycle action heartbeat to keep the instance in a wait state.</p> </li> <li> <p> <b>If you finish before the timeout period ends, send a callback by using the <a>CompleteLifecycleAction</a> API call.</b> </p> </li> </ol> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html\">Amazon EC2 Auto Scaling lifecycle hooks</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'CreateAutoScalingGroup' => '<p> <b>We strongly recommend using a launch template when calling this operation to ensure full functionality for Amazon EC2 Auto Scaling and Amazon EC2.</b> </p> <p>Creates an Auto Scaling group with the specified name and attributes. </p> <p>If you exceed your maximum limit of Auto Scaling groups, the call fails. To query this limit, call the <a>DescribeAccountLimits</a> API. For information about updating this limit, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-quotas.html\">Quotas for Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>For introductory exercises for creating an Auto Scaling group, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/GettingStartedTutorial.html\">Getting started with Amazon EC2 Auto Scaling</a> and <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-register-lbs-with-asg.html\">Tutorial: Set up a scaled and load-balanced application</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html\">Auto Scaling groups</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>Every Auto Scaling group has three size properties (<code>DesiredCapacity</code>, <code>MaxSize</code>, and <code>MinSize</code>). Usually, you set these sizes based on a specific number of instances. However, if you configure a mixed instances policy that defines weights for the instance types, you must specify these sizes with the same units that you use for weighting instances.</p>', 'CreateLaunchConfiguration' => '<p>Creates a launch configuration.</p> <p>If you exceed your maximum limit of launch configurations, the call fails. To query this limit, call the <a>DescribeAccountLimits</a> API. For information about updating this limit, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-quotas.html\">Quotas for Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/LaunchConfiguration.html\">Launch configurations</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <note> <p>Amazon EC2 Auto Scaling configures instances launched as part of an Auto Scaling group using either a launch template or a launch configuration. We strongly recommend that you do not use launch configurations. They do not provide full functionality for Amazon EC2 Auto Scaling or Amazon EC2. For information about using launch templates, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-templates.html\">Launch templates</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> </note>', 'CreateOrUpdateTags' => '<p>Creates or updates tags for the specified Auto Scaling group.</p> <p>When you specify a tag with a key that already exists, the operation overwrites the previous tag definition, and you do not get an error message.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html\">Tag Auto Scaling groups and instances</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'DeleteAutoScalingGroup' => '<p>Deletes the specified Auto Scaling group.</p> <p>If the group has instances or scaling activities in progress, you must specify the option to force the deletion in order for it to succeed. The force delete operation will also terminate the EC2 instances. If the group has a warm pool, the force delete option also deletes the warm pool.</p> <p>To remove instances from the Auto Scaling group before deleting it, call the <a>DetachInstances</a> API with the list of instances and the option to decrement the desired capacity. This ensures that Amazon EC2 Auto Scaling does not launch replacement instances.</p> <p>To terminate all instances before deleting the Auto Scaling group, call the <a>UpdateAutoScalingGroup</a> API and set the minimum size and desired capacity of the Auto Scaling group to zero.</p> <p>If the group has scaling policies, deleting the group deletes the policies, the underlying alarm actions, and any alarm that no longer has an associated action.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-process-shutdown.html\">Delete your Auto Scaling infrastructure</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'DeleteLaunchConfiguration' => '<p>Deletes the specified launch configuration.</p> <p>The launch configuration must not be attached to an Auto Scaling group. When this call completes, the launch configuration is no longer available for use.</p>', 'DeleteLifecycleHook' => '<p>Deletes the specified lifecycle hook.</p> <p>If there are any outstanding lifecycle actions, they are completed first (<code>ABANDON</code> for launching instances, <code>CONTINUE</code> for terminating instances).</p>', 'DeleteNotificationConfiguration' => '<p>Deletes the specified notification.</p>', 'DeletePolicy' => '<p>Deletes the specified scaling policy.</p> <p>Deleting either a step scaling policy or a simple scaling policy deletes the underlying alarm action, but does not delete the alarm, even if it no longer has an associated action.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/deleting-scaling-policy.html\">Deleting a scaling policy</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'DeleteScheduledAction' => '<p>Deletes the specified scheduled action.</p>', 'DeleteTags' => '<p>Deletes the specified tags.</p>', 'DeleteWarmPool' => '<p>Deletes the warm pool for the specified Auto Scaling group.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-warm-pools.html\">Warm pools for Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'DescribeAccountLimits' => '<p>Describes the current Amazon EC2 Auto Scaling resource quotas for your account.</p> <p>When you establish an Amazon Web Services account, the account has initial quotas on the maximum number of Auto Scaling groups and launch configurations that you can create in a given Region. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-quotas.html\">Quotas for Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'DescribeAdjustmentTypes' => '<p>Describes the available adjustment types for step scaling and simple scaling policies.</p> <p>The following adjustment types are supported:</p> <ul> <li> <p> <code>ChangeInCapacity</code> </p> </li> <li> <p> <code>ExactCapacity</code> </p> </li> <li> <p> <code>PercentChangeInCapacity</code> </p> </li> </ul>', 'DescribeAutoScalingGroups' => '<p>Gets information about the Auto Scaling groups in the account and Region.</p> <p>If you specify Auto Scaling group names, the output includes information for only the specified Auto Scaling groups. If you specify filters, the output includes information for only those Auto Scaling groups that meet the filter criteria. If you do not specify group names or filters, the output includes information for all Auto Scaling groups. </p> <p>This operation also returns information about instances in Auto Scaling groups. To retrieve information about the instances in a warm pool, you must call the <a>DescribeWarmPool</a> API. </p>', 'DescribeAutoScalingInstances' => '<p>Gets information about the Auto Scaling instances in the account and Region.</p>', 'DescribeAutoScalingNotificationTypes' => '<p>Describes the notification types that are supported by Amazon EC2 Auto Scaling.</p>', 'DescribeInstanceRefreshes' => '<p>Gets information about the instance refreshes for the specified Auto Scaling group.</p> <p>This operation is part of the <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html\">instance refresh feature</a> in Amazon EC2 Auto Scaling, which helps you update instances in your Auto Scaling group after you make configuration changes.</p> <p>To help you determine the status of an instance refresh, Amazon EC2 Auto Scaling returns information about the instance refreshes you previously initiated, including their status, start time, end time, the percentage of the instance refresh that is complete, and the number of instances remaining to update before the instance refresh is complete. If a rollback is initiated while an instance refresh is in progress, Amazon EC2 Auto Scaling also returns information about the rollback of the instance refresh.</p>', 'DescribeLaunchConfigurations' => '<p>Gets information about the launch configurations in the account and Region.</p>', 'DescribeLifecycleHookTypes' => '<p>Describes the available types of lifecycle hooks.</p> <p>The following hook types are supported:</p> <ul> <li> <p> <code>autoscaling:EC2_INSTANCE_LAUNCHING</code> </p> </li> <li> <p> <code>autoscaling:EC2_INSTANCE_TERMINATING</code> </p> </li> </ul>', 'DescribeLifecycleHooks' => '<p>Gets information about the lifecycle hooks for the specified Auto Scaling group.</p>', 'DescribeLoadBalancerTargetGroups' => '<note> <p>This API operation is superseded by <a>DescribeTrafficSources</a>, which can describe multiple traffic sources types. We recommend using <code>DetachTrafficSources</code> to simplify how you manage traffic sources. However, we continue to support <code>DescribeLoadBalancerTargetGroups</code>. You can use both the original <code>DescribeLoadBalancerTargetGroups</code> API operation and <code>DescribeTrafficSources</code> on the same Auto Scaling group.</p> </note> <p>Gets information about the Elastic Load Balancing target groups for the specified Auto Scaling group.</p> <p>To determine the attachment status of the target group, use the <code>State</code> element in the response. When you attach a target group to an Auto Scaling group, the initial <code>State</code> value is <code>Adding</code>. The state transitions to <code>Added</code> after all Auto Scaling instances are registered with the target group. If Elastic Load Balancing health checks are enabled for the Auto Scaling group, the state transitions to <code>InService</code> after at least one Auto Scaling instance passes the health check. When the target group is in the <code>InService</code> state, Amazon EC2 Auto Scaling can terminate and replace any instances that are reported as unhealthy. If no registered instances pass the health checks, the target group doesn\\'t enter the <code>InService</code> state. </p> <p>Target groups also have an <code>InService</code> state if you attach them in the <a>CreateAutoScalingGroup</a> API call. If your target group state is <code>InService</code>, but it is not working properly, check the scaling activities by calling <a>DescribeScalingActivities</a> and take any corrective actions necessary.</p> <p>For help with failed health checks, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ts-as-healthchecks.html\">Troubleshooting Amazon EC2 Auto Scaling: Health checks</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html\">Use Elastic Load Balancing to distribute traffic across the instances in your Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>. </p> <note> <p>You can use this operation to describe target groups that were attached by using <a>AttachLoadBalancerTargetGroups</a>, but not for target groups that were attached by using <a>AttachTrafficSources</a>.</p> </note>', 'DescribeLoadBalancers' => '<note> <p>This API operation is superseded by <a>DescribeTrafficSources</a>, which can describe multiple traffic sources types. We recommend using <code>DescribeTrafficSources</code> to simplify how you manage traffic sources. However, we continue to support <code>DescribeLoadBalancers</code>. You can use both the original <code>DescribeLoadBalancers</code> API operation and <code>DescribeTrafficSources</code> on the same Auto Scaling group.</p> </note> <p>Gets information about the load balancers for the specified Auto Scaling group.</p> <p>This operation describes only Classic Load Balancers. If you have Application Load Balancers, Network Load Balancers, or Gateway Load Balancers, use the <a>DescribeLoadBalancerTargetGroups</a> API instead.</p> <p>To determine the attachment status of the load balancer, use the <code>State</code> element in the response. When you attach a load balancer to an Auto Scaling group, the initial <code>State</code> value is <code>Adding</code>. The state transitions to <code>Added</code> after all Auto Scaling instances are registered with the load balancer. If Elastic Load Balancing health checks are enabled for the Auto Scaling group, the state transitions to <code>InService</code> after at least one Auto Scaling instance passes the health check. When the load balancer is in the <code>InService</code> state, Amazon EC2 Auto Scaling can terminate and replace any instances that are reported as unhealthy. If no registered instances pass the health checks, the load balancer doesn\\'t enter the <code>InService</code> state. </p> <p>Load balancers also have an <code>InService</code> state if you attach them in the <a>CreateAutoScalingGroup</a> API call. If your load balancer state is <code>InService</code>, but it is not working properly, check the scaling activities by calling <a>DescribeScalingActivities</a> and take any corrective actions necessary.</p> <p>For help with failed health checks, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ts-as-healthchecks.html\">Troubleshooting Amazon EC2 Auto Scaling: Health checks</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html\">Use Elastic Load Balancing to distribute traffic across the instances in your Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>. </p>', 'DescribeMetricCollectionTypes' => '<p>Describes the available CloudWatch metrics for Amazon EC2 Auto Scaling.</p>', 'DescribeNotificationConfigurations' => '<p>Gets information about the Amazon SNS notifications that are configured for one or more Auto Scaling groups.</p>', 'DescribePolicies' => '<p>Gets information about the scaling policies in the account and Region.</p>', 'DescribeScalingActivities' => '<p>Gets information about the scaling activities in the account and Region.</p> <p>When scaling events occur, you see a record of the scaling activity in the scaling activities. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-verify-scaling-activity.html\">Verifying a scaling activity for an Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>If the scaling event succeeds, the value of the <code>StatusCode</code> element in the response is <code>Successful</code>. If an attempt to launch instances failed, the <code>StatusCode</code> value is <code>Failed</code> or <code>Cancelled</code> and the <code>StatusMessage</code> element in the response indicates the cause of the failure. For help interpreting the <code>StatusMessage</code>, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/CHAP_Troubleshooting.html\">Troubleshooting Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>. </p>', 'DescribeScalingProcessTypes' => '<p>Describes the scaling process types for use with the <a>ResumeProcesses</a> and <a>SuspendProcesses</a> APIs.</p>', 'DescribeScheduledActions' => '<p>Gets information about the scheduled actions that haven\\'t run or that have not reached their end time.</p> <p>To describe the scaling activities for scheduled actions that have already run, call the <a>DescribeScalingActivities</a> API.</p>', 'DescribeTags' => '<p>Describes the specified tags.</p> <p>You can use filters to limit the results. For example, you can query for the tags for a specific Auto Scaling group. You can specify multiple values for a filter. A tag must match at least one of the specified values for it to be included in the results.</p> <p>You can also specify multiple filters. The result includes information for a particular tag only if it matches all the filters. If there\\'s no match, no special message is returned.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html\">Tag Auto Scaling groups and instances</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'DescribeTerminationPolicyTypes' => '<p>Describes the termination policies supported by Amazon EC2 Auto Scaling.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-termination-policies.html\">Work with Amazon EC2 Auto Scaling termination policies</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'DescribeTrafficSources' => '<p>Gets information about the traffic sources for the specified Auto Scaling group.</p> <p>You can optionally provide a traffic source type. If you provide a traffic source type, then the results only include that traffic source type.</p> <p>If you do not provide a traffic source type, then the results include all the traffic sources for the specified Auto Scaling group. </p>', 'DescribeWarmPool' => '<p>Gets information about a warm pool and its instances.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-warm-pools.html\">Warm pools for Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'DetachInstances' => '<p>Removes one or more instances from the specified Auto Scaling group.</p> <p>After the instances are detached, you can manage them independent of the Auto Scaling group.</p> <p>If you do not specify the option to decrement the desired capacity, Amazon EC2 Auto Scaling launches instances to replace the ones that are detached.</p> <p>If there is a Classic Load Balancer attached to the Auto Scaling group, the instances are deregistered from the load balancer. If there are target groups attached to the Auto Scaling group, the instances are deregistered from the target groups.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/detach-instance-asg.html\">Detach EC2 instances from your Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'DetachLoadBalancerTargetGroups' => '<note> <p>This API operation is superseded by <a>DetachTrafficSources</a>, which can detach multiple traffic sources types. We recommend using <code>DetachTrafficSources</code> to simplify how you manage traffic sources. However, we continue to support <code>DetachLoadBalancerTargetGroups</code>. You can use both the original <code>DetachLoadBalancerTargetGroups</code> API operation and <code>DetachTrafficSources</code> on the same Auto Scaling group.</p> </note> <p>Detaches one or more target groups from the specified Auto Scaling group.</p> <p>When you detach a target group, it enters the <code>Removing</code> state while deregistering the instances in the group. When all instances are deregistered, then you can no longer describe the target group using the <a>DescribeLoadBalancerTargetGroups</a> API call. The instances remain running.</p> <note> <p>You can use this operation to detach target groups that were attached by using <a>AttachLoadBalancerTargetGroups</a>, but not for target groups that were attached by using <a>AttachTrafficSources</a>.</p> </note>', 'DetachLoadBalancers' => '<note> <p>This API operation is superseded by <a>DetachTrafficSources</a>, which can detach multiple traffic sources types. We recommend using <code>DetachTrafficSources</code> to simplify how you manage traffic sources. However, we continue to support <code>DetachLoadBalancers</code>. You can use both the original <code>DetachLoadBalancers</code> API operation and <code>DetachTrafficSources</code> on the same Auto Scaling group.</p> </note> <p>Detaches one or more Classic Load Balancers from the specified Auto Scaling group.</p> <p>This operation detaches only Classic Load Balancers. If you have Application Load Balancers, Network Load Balancers, or Gateway Load Balancers, use the <a>DetachLoadBalancerTargetGroups</a> API instead.</p> <p>When you detach a load balancer, it enters the <code>Removing</code> state while deregistering the instances in the group. When all instances are deregistered, then you can no longer describe the load balancer using the <a>DescribeLoadBalancers</a> API call. The instances remain running.</p>', 'DetachTrafficSources' => '<p>Detaches one or more traffic sources from the specified Auto Scaling group.</p> <p>When you detach a taffic, it enters the <code>Removing</code> state while deregistering the instances in the group. When all instances are deregistered, then you can no longer describe the traffic source using the <a>DescribeTrafficSources</a> API call. The instances continue to run.</p>', 'DisableMetricsCollection' => '<p>Disables group metrics collection for the specified Auto Scaling group.</p>', 'EnableMetricsCollection' => '<p>Enables group metrics collection for the specified Auto Scaling group.</p> <p>You can use these metrics to track changes in an Auto Scaling group and to set alarms on threshold values. You can view group metrics using the Amazon EC2 Auto Scaling console or the CloudWatch console. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-cloudwatch-monitoring.html\">Monitor CloudWatch metrics for your Auto Scaling groups and instances</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'EnterStandby' => '<p>Moves the specified instances into the standby state.</p> <p>If you choose to decrement the desired capacity of the Auto Scaling group, the instances can enter standby as long as the desired capacity of the Auto Scaling group after the instances are placed into standby is equal to or greater than the minimum capacity of the group.</p> <p>If you choose not to decrement the desired capacity of the Auto Scaling group, the Auto Scaling group launches new instances to replace the instances on standby.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html\">Temporarily removing instances from your Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'ExecutePolicy' => '<p>Executes the specified policy. This can be useful for testing the design of your scaling policy.</p>', 'ExitStandby' => '<p>Moves the specified instances out of the standby state.</p> <p>After you put the instances back in service, the desired capacity is incremented.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html\">Temporarily removing instances from your Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'GetPredictiveScalingForecast' => '<p>Retrieves the forecast data for a predictive scaling policy.</p> <p>Load forecasts are predictions of the hourly load values using historical load data from CloudWatch and an analysis of historical trends. Capacity forecasts are represented as predicted values for the minimum capacity that is needed on an hourly basis, based on the hourly load forecast.</p> <p>A minimum of 24 hours of data is required to create the initial forecasts. However, having a full 14 days of historical data results in more accurate forecasts.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-predictive-scaling.html\">Predictive scaling for Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'PutLifecycleHook' => '<p>Creates or updates a lifecycle hook for the specified Auto Scaling group.</p> <p>Lifecycle hooks let you create solutions that are aware of events in the Auto Scaling instance lifecycle, and then perform a custom action on instances when the corresponding lifecycle event occurs.</p> <p>This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling group:</p> <ol> <li> <p>(Optional) Create a launch template or launch configuration with a user data script that runs while an instance is in a wait state due to a lifecycle hook.</p> </li> <li> <p>(Optional) Create a Lambda function and a rule that allows Amazon EventBridge to invoke your Lambda function when an instance is put into a wait state due to a lifecycle hook.</p> </li> <li> <p>(Optional) Create a notification target and an IAM role. The target can be either an Amazon SQS queue or an Amazon SNS topic. The role allows Amazon EC2 Auto Scaling to publish lifecycle notifications to the target.</p> </li> <li> <p> <b>Create the lifecycle hook. Specify whether the hook is used when the instances launch or terminate.</b> </p> </li> <li> <p>If you need more time, record the lifecycle action heartbeat to keep the instance in a wait state using the <a>RecordLifecycleActionHeartbeat</a> API call.</p> </li> <li> <p>If you finish before the timeout period ends, send a callback by using the <a>CompleteLifecycleAction</a> API call.</p> </li> </ol> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html\">Amazon EC2 Auto Scaling lifecycle hooks</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>If you exceed your maximum limit of lifecycle hooks, which by default is 50 per Auto Scaling group, the call fails.</p> <p>You can view the lifecycle hooks for an Auto Scaling group using the <a>DescribeLifecycleHooks</a> API call. If you are no longer using a lifecycle hook, you can delete it by calling the <a>DeleteLifecycleHook</a> API.</p>', 'PutNotificationConfiguration' => '<p>Configures an Auto Scaling group to send notifications when specified events take place. Subscribers to the specified topic can have messages delivered to an endpoint such as a web server or an email address.</p> <p>This configuration overwrites any existing configuration.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html\">Getting Amazon SNS notifications when your Auto Scaling group scales</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>If you exceed your maximum limit of SNS topics, which is 10 per Auto Scaling group, the call fails.</p>', 'PutScalingPolicy' => '<p>Creates or updates a scaling policy for an Auto Scaling group. Scaling policies are used to scale an Auto Scaling group based on configurable metrics. If no policies are defined, the dynamic scaling and predictive scaling features are not used. </p> <p>For more information about using dynamic scaling, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-target-tracking.html\">Target tracking scaling policies</a> and <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html\">Step and simple scaling policies</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>For more information about using predictive scaling, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-predictive-scaling.html\">Predictive scaling for Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>You can view the scaling policies for an Auto Scaling group using the <a>DescribePolicies</a> API call. If you are no longer using a scaling policy, you can delete it by calling the <a>DeletePolicy</a> API.</p>', 'PutScheduledUpdateGroupAction' => '<p>Creates or updates a scheduled scaling action for an Auto Scaling group.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html\">Scheduled scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>You can view the scheduled actions for an Auto Scaling group using the <a>DescribeScheduledActions</a> API call. If you are no longer using a scheduled action, you can delete it by calling the <a>DeleteScheduledAction</a> API.</p> <p>If you try to schedule your action in the past, Amazon EC2 Auto Scaling returns an error message.</p>', 'PutWarmPool' => '<p>Creates or updates a warm pool for the specified Auto Scaling group. A warm pool is a pool of pre-initialized EC2 instances that sits alongside the Auto Scaling group. Whenever your application needs to scale out, the Auto Scaling group can draw on the warm pool to meet its new desired capacity. For more information and example configurations, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-warm-pools.html\">Warm pools for Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>This operation must be called from the Region in which the Auto Scaling group was created. This operation cannot be called on an Auto Scaling group that has a mixed instances policy or a launch template or launch configuration that requests Spot Instances.</p> <p>You can view the instances in the warm pool using the <a>DescribeWarmPool</a> API call. If you are no longer using a warm pool, you can delete it by calling the <a>DeleteWarmPool</a> API.</p>', 'RecordLifecycleActionHeartbeat' => '<p>Records a heartbeat for the lifecycle action associated with the specified token or instance. This extends the timeout by the length of time defined using the <a>PutLifecycleHook</a> API call.</p> <p>This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling group:</p> <ol> <li> <p>(Optional) Create a launch template or launch configuration with a user data script that runs while an instance is in a wait state due to a lifecycle hook.</p> </li> <li> <p>(Optional) Create a Lambda function and a rule that allows Amazon EventBridge to invoke your Lambda function when an instance is put into a wait state due to a lifecycle hook.</p> </li> <li> <p>(Optional) Create a notification target and an IAM role. The target can be either an Amazon SQS queue or an Amazon SNS topic. The role allows Amazon EC2 Auto Scaling to publish lifecycle notifications to the target.</p> </li> <li> <p>Create the lifecycle hook. Specify whether the hook is used when the instances launch or terminate.</p> </li> <li> <p> <b>If you need more time, record the lifecycle action heartbeat to keep the instance in a wait state.</b> </p> </li> <li> <p>If you finish before the timeout period ends, send a callback by using the <a>CompleteLifecycleAction</a> API call.</p> </li> </ol> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html\">Amazon EC2 Auto Scaling lifecycle hooks</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'ResumeProcesses' => '<p>Resumes the specified suspended auto scaling processes, or all suspended process, for the specified Auto Scaling group.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html\">Suspending and resuming scaling processes</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'RollbackInstanceRefresh' => '<p>Cancels an instance refresh that is in progress and rolls back any changes that it made. Amazon EC2 Auto Scaling replaces any instances that were replaced during the instance refresh. This restores your Auto Scaling group to the configuration that it was using before the start of the instance refresh. </p> <p>This operation is part of the <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html\">instance refresh feature</a> in Amazon EC2 Auto Scaling, which helps you update instances in your Auto Scaling group after you make configuration changes.</p> <p>A rollback is not supported in the following situations: </p> <ul> <li> <p>There is no desired configuration specified for the instance refresh.</p> </li> <li> <p>The Auto Scaling group has a launch template that uses an Amazon Web Services Systems Manager parameter instead of an AMI ID for the <code>ImageId</code> property.</p> </li> <li> <p>The Auto Scaling group uses the launch template\\'s <code>$Latest</code> or <code>$Default</code> version.</p> </li> </ul> <p>When you receive a successful response from this operation, Amazon EC2 Auto Scaling immediately begins replacing instances. You can check the status of this operation through the <a>DescribeInstanceRefreshes</a> API operation. </p>', 'SetDesiredCapacity' => '<p>Sets the size of the specified Auto Scaling group.</p> <p>If a scale-in activity occurs as a result of a new <code>DesiredCapacity</code> value that is lower than the current size of the group, the Auto Scaling group uses its termination policy to determine which instances to terminate. </p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-manual-scaling.html\">Manual scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'SetInstanceHealth' => '<p>Sets the health status of the specified instance.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html\">Health checks for Auto Scaling instances</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'SetInstanceProtection' => '<p>Updates the instance protection settings of the specified instances. This operation cannot be called on instances in a warm pool.</p> <p>For more information about preventing instances that are part of an Auto Scaling group from terminating on scale in, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-protection.html\">Using instance scale-in protection</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>If you exceed your maximum limit of instance IDs, which is 50 per Auto Scaling group, the call fails.</p>', 'StartInstanceRefresh' => '<p>Starts an instance refresh. During an instance refresh, Amazon EC2 Auto Scaling performs a rolling update of instances in an Auto Scaling group. Instances are terminated first and then replaced, which temporarily reduces the capacity available within your Auto Scaling group.</p> <p>This operation is part of the <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html\">instance refresh feature</a> in Amazon EC2 Auto Scaling, which helps you update instances in your Auto Scaling group. This feature is helpful, for example, when you have a new AMI or a new user data script. You just need to create a new launch template that specifies the new AMI or user data script. Then start an instance refresh to immediately begin the process of updating instances in the group. </p> <p>If successful, the request\\'s response contains a unique ID that you can use to track the progress of the instance refresh. To query its status, call the <a>DescribeInstanceRefreshes</a> API. To describe the instance refreshes that have already run, call the <a>DescribeInstanceRefreshes</a> API. To cancel an instance refresh that is in progress, use the <a>CancelInstanceRefresh</a> API. </p> <p>An instance refresh might fail for several reasons, such as EC2 launch failures, misconfigured health checks, or not ignoring or allowing the termination of instances that are in <code>Standby</code> state or protected from scale in. You can monitor for failed EC2 launches using the scaling activities. To find the scaling activities, call the <a>DescribeScalingActivities</a> API.</p> <p>If you enable auto rollback, your Auto Scaling group will be rolled back automatically when the instance refresh fails. You can enable this feature before starting an instance refresh by specifying the <code>AutoRollback</code> property in the instance refresh preferences. Otherwise, to roll back an instance refresh before it finishes, use the <a>RollbackInstanceRefresh</a> API. </p>', 'SuspendProcesses' => '<p>Suspends the specified auto scaling processes, or all processes, for the specified Auto Scaling group.</p> <p>If you suspend either the <code>Launch</code> or <code>Terminate</code> process types, it can prevent other process types from functioning properly. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html\">Suspending and resuming scaling processes</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>To resume processes that have been suspended, call the <a>ResumeProcesses</a> API.</p>', 'TerminateInstanceInAutoScalingGroup' => '<p>Terminates the specified instance and optionally adjusts the desired group size. This operation cannot be called on instances in a warm pool.</p> <p>This call simply makes a termination request. The instance is not terminated immediately. When an instance is terminated, the instance status changes to <code>terminated</code>. You can\\'t connect to or start an instance after you\\'ve terminated it.</p> <p>If you do not specify the option to decrement the desired capacity, Amazon EC2 Auto Scaling launches instances to replace the ones that are terminated. </p> <p>By default, Amazon EC2 Auto Scaling balances instances across all Availability Zones. If you decrement the desired capacity, your Auto Scaling group can become unbalanced between Availability Zones. Amazon EC2 Auto Scaling tries to rebalance the group, and rebalancing might terminate instances in other zones. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-benefits.html#AutoScalingBehavior.InstanceUsage\">Rebalancing activities</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'UpdateAutoScalingGroup' => '<p> <b>We strongly recommend that all Auto Scaling groups use launch templates to ensure full functionality for Amazon EC2 Auto Scaling and Amazon EC2.</b> </p> <p>Updates the configuration for the specified Auto Scaling group.</p> <p>To update an Auto Scaling group, specify the name of the group and the property that you want to change. Any properties that you don\\'t specify are not changed by this update request. The new settings take effect on any scaling activities after this call returns. </p> <p>If you associate a new launch configuration or template with an Auto Scaling group, all new instances will get the updated configuration. Existing instances continue to run with the configuration that they were originally launched with. When you update a group to specify a mixed instances policy instead of a launch configuration or template, existing instances may be replaced to match the new purchasing options that you specified in the policy. For example, if the group currently has 100% On-Demand capacity and the policy specifies 50% Spot capacity, this means that half of your instances will be gradually terminated and relaunched as Spot Instances. When replacing instances, Amazon EC2 Auto Scaling launches new instances before terminating the old ones, so that updating your group does not compromise the performance or availability of your application.</p> <p>Note the following about changing <code>DesiredCapacity</code>, <code>MaxSize</code>, or <code>MinSize</code>:</p> <ul> <li> <p>If a scale-in activity occurs as a result of a new <code>DesiredCapacity</code> value that is lower than the current size of the group, the Auto Scaling group uses its termination policy to determine which instances to terminate.</p> </li> <li> <p>If you specify a new value for <code>MinSize</code> without specifying a value for <code>DesiredCapacity</code>, and the new <code>MinSize</code> is larger than the current size of the group, this sets the group\\'s <code>DesiredCapacity</code> to the new <code>MinSize</code> value.</p> </li> <li> <p>If you specify a new value for <code>MaxSize</code> without specifying a value for <code>DesiredCapacity</code>, and the new <code>MaxSize</code> is smaller than the current size of the group, this sets the group\\'s <code>DesiredCapacity</code> to the new <code>MaxSize</code> value.</p> </li> </ul> <p>To see which properties have been set, call the <a>DescribeAutoScalingGroups</a> API. To view the scaling policies for an Auto Scaling group, call the <a>DescribePolicies</a> API. If the group has scaling policies, you can update them by calling the <a>PutScalingPolicy</a> API.</p>', ], 'shapes' => [ 'AcceleratorCountRequest' => [ 'base' => '<p>Specifies the minimum and maximum for the <code>AcceleratorCount</code> object when you specify <a>InstanceRequirements</a> for an Auto Scaling group.</p>', 'refs' => [ 'InstanceRequirements$AcceleratorCount' => '<p>The minimum and maximum number of accelerators (GPUs, FPGAs, or Amazon Web Services Inferentia chips) for an instance type.</p> <p>To exclude accelerator-enabled instance types, set <code>Max</code> to <code>0</code>.</p> <p>Default: No minimum or maximum limits</p>', ], ], 'AcceleratorManufacturer' => [ 'base' => NULL, 'refs' => [ 'AcceleratorManufacturers$member' => NULL, ], ], 'AcceleratorManufacturers' => [ 'base' => NULL, 'refs' => [ 'InstanceRequirements$AcceleratorManufacturers' => '<p>Indicates whether instance types must have accelerators by specific manufacturers.</p> <ul> <li> <p>For instance types with NVIDIA devices, specify <code>nvidia</code>.</p> </li> <li> <p>For instance types with AMD devices, specify <code>amd</code>.</p> </li> <li> <p>For instance types with Amazon Web Services devices, specify <code>amazon-web-services</code>.</p> </li> <li> <p>For instance types with Xilinx devices, specify <code>xilinx</code>.</p> </li> </ul> <p>Default: Any manufacturer</p>', ], ], 'AcceleratorName' => [ 'base' => NULL, 'refs' => [ 'AcceleratorNames$member' => NULL, ], ], 'AcceleratorNames' => [ 'base' => NULL, 'refs' => [ 'InstanceRequirements$AcceleratorNames' => '<p>Lists the accelerators that must be on an instance type.</p> <ul> <li> <p>For instance types with NVIDIA A100 GPUs, specify <code>a100</code>.</p> </li> <li> <p>For instance types with NVIDIA V100 GPUs, specify <code>v100</code>.</p> </li> <li> <p>For instance types with NVIDIA K80 GPUs, specify <code>k80</code>.</p> </li> <li> <p>For instance types with NVIDIA T4 GPUs, specify <code>t4</code>.</p> </li> <li> <p>For instance types with NVIDIA M60 GPUs, specify <code>m60</code>.</p> </li> <li> <p>For instance types with AMD Radeon Pro V520 GPUs, specify <code>radeon-pro-v520</code>.</p> </li> <li> <p>For instance types with Xilinx VU9P FPGAs, specify <code>vu9p</code>.</p> </li> </ul> <p>Default: Any accelerator</p>', ], ], 'AcceleratorTotalMemoryMiBRequest' => [ 'base' => '<p>Specifies the minimum and maximum for the <code>AcceleratorTotalMemoryMiB</code> object when you specify <a>InstanceRequirements</a> for an Auto Scaling group.</p>', 'refs' => [ 'InstanceRequirements$AcceleratorTotalMemoryMiB' => '<p>The minimum and maximum total memory size for the accelerators on an instance type, in MiB.</p> <p>Default: No minimum or maximum limits</p>', ], ], 'AcceleratorType' => [ 'base' => NULL, 'refs' => [ 'AcceleratorTypes$member' => NULL, ], ], 'AcceleratorTypes' => [ 'base' => NULL, 'refs' => [ 'InstanceRequirements$AcceleratorTypes' => '<p>Lists the accelerator types that must be on an instance type.</p> <ul> <li> <p>For instance types with GPU accelerators, specify <code>gpu</code>.</p> </li> <li> <p>For instance types with FPGA accelerators, specify <code>fpga</code>.</p> </li> <li> <p>For instance types with inference accelerators, specify <code>inference</code>.</p> </li> </ul> <p>Default: Any accelerator type</p>', ], ], 'ActiveInstanceRefreshNotFoundFault' => [ 'base' => '<p>The request failed because an active instance refresh or rollback for the specified Auto Scaling group was not found.</p>', 'refs' => [], ], 'Activities' => [ 'base' => NULL, 'refs' => [ 'ActivitiesType$Activities' => '<p>The scaling activities. Activities are sorted by start time. Activities still in progress are described first.</p>', 'DetachInstancesAnswer$Activities' => '<p>The activities related to detaching the instances from the Auto Scaling group.</p>', 'EnterStandbyAnswer$Activities' => '<p>The activities related to moving instances into <code>Standby</code> mode.</p>', 'ExitStandbyAnswer$Activities' => '<p>The activities related to moving instances out of <code>Standby</code> mode.</p>', ], ], 'ActivitiesType' => [ 'base' => NULL, 'refs' => [], ], 'Activity' => [ 'base' => '<p>Describes scaling activity, which is a long-running process that represents a change to your Auto Scaling group, such as changing its size or replacing an instance.</p>', 'refs' => [ 'Activities$member' => NULL, 'ActivityType$Activity' => '<p>A scaling activity.</p>', ], ], 'ActivityIds' => [ 'base' => NULL, 'refs' => [ 'DescribeScalingActivitiesType$ActivityIds' => '<p>The activity IDs of the desired scaling activities. If you omit this property, all activities for the past six weeks are described. If unknown activities are requested, they are ignored with no error. If you specify an Auto Scaling group, the results are limited to that group.</p> <p>Array Members: Maximum number of 50 IDs.</p>', ], ], 'ActivityType' => [ 'base' => NULL, 'refs' => [], ], 'AdjustmentType' => [ 'base' => '<p>Describes a policy adjustment type.</p>', 'refs' => [ 'AdjustmentTypes$member' => NULL, ], ], 'AdjustmentTypes' => [ 'base' => NULL, 'refs' => [ 'DescribeAdjustmentTypesAnswer$AdjustmentTypes' => '<p>The policy adjustment types.</p>', ], ], 'Alarm' => [ 'base' => '<p>Describes an alarm.</p>', 'refs' => [ 'Alarms$member' => NULL, ], ], 'Alarms' => [ 'base' => NULL, 'refs' => [ 'PolicyARNType$Alarms' => '<p>The CloudWatch alarms created for the target tracking scaling policy.</p>', 'ScalingPolicy$Alarms' => '<p>The CloudWatch alarms related to the policy.</p>', ], ], 'AllowedInstanceType' => [ 'base' => NULL, 'refs' => [ 'AllowedInstanceTypes$member' => NULL, ], ], 'AllowedInstanceTypes' => [ 'base' => NULL, 'refs' => [ 'InstanceRequirements$AllowedInstanceTypes' => '<p>The instance types to apply your specified attributes against. All other instance types are ignored, even if they match your specified attributes.</p> <p>You can use strings with one or more wild cards, represented by an asterisk (<code>*</code>), to allow an instance type, size, or generation. The following are examples: <code>m5.8xlarge</code>, <code>c5*.*</code>, <code>m5a.*</code>, <code>r*</code>, <code>*3*</code>.</p> <p>For example, if you specify <code>c5*</code>, Amazon EC2 Auto Scaling will allow the entire C5 instance family, which includes all C5a and C5n instance types. If you specify <code>m5a.*</code>, Amazon EC2 Auto Scaling will allow all the M5a instance types, but not the M5n instance types.</p> <note> <p>If you specify <code>AllowedInstanceTypes</code>, you can\\'t specify <code>ExcludedInstanceTypes</code>.</p> </note> <p>Default: All instance types</p>', ], ], 'AlreadyExistsFault' => [ 'base' => '<p>You already have an Auto Scaling group or launch configuration with this name.</p>', 'refs' => [], ], 'AsciiStringMaxLen255' => [ 'base' => NULL, 'refs' => [ 'CompleteLifecycleActionType$LifecycleHookName' => '<p>The name of the lifecycle hook.</p>', 'DeleteLifecycleHookType$LifecycleHookName' => '<p>The name of the lifecycle hook.</p>', 'LifecycleHook$LifecycleHookName' => '<p>The name of the lifecycle hook.</p>', 'LifecycleHookNames$member' => NULL, 'LifecycleHookSpecification$LifecycleHookName' => '<p>The name of the lifecycle hook.</p>', 'PutLifecycleHookType$LifecycleHookName' => '<p>The name of the lifecycle hook.</p>', 'RecordLifecycleActionHeartbeatType$LifecycleHookName' => '<p>The name of the lifecycle hook.</p>', ], ], 'AssociatePublicIpAddress' => [ 'base' => NULL, 'refs' => [ 'CreateLaunchConfigurationType$AssociatePublicIpAddress' => '<p>Specifies whether to assign a public IPv4 address to the group\\'s instances. If the instance is launched into a default subnet, the default is to assign a public IPv4 address, unless you disabled the option to assign a public IPv4 address on the subnet. If the instance is launched into a nondefault subnet, the default is not to assign a public IPv4 address, unless you enabled the option to assign a public IPv4 address on the subnet.</p> <p>If you specify <code>true</code>, each instance in the Auto Scaling group receives a unique public IPv4 address. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html\">Launching Auto Scaling instances in a VPC</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>If you specify this property, you must specify at least one subnet for <code>VPCZoneIdentifier</code> when you create your group.</p>', 'LaunchConfiguration$AssociatePublicIpAddress' => '<p>Specifies whether to assign a public IPv4 address to the group\\'s instances. If the instance is launched into a default subnet, the default is to assign a public IPv4 address, unless you disabled the option to assign a public IPv4 address on the subnet. If the instance is launched into a nondefault subnet, the default is not to assign a public IPv4 address, unless you enabled the option to assign a public IPv4 address on the subnet. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html\">Launching Auto Scaling instances in a VPC</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', ], ], 'AttachInstancesQuery' => [ 'base' => NULL, 'refs' => [], ], 'AttachLoadBalancerTargetGroupsResultType' => [ 'base' => NULL, 'refs' => [], ], 'AttachLoadBalancerTargetGroupsType' => [ 'base' => NULL, 'refs' => [], ], 'AttachLoadBalancersResultType' => [ 'base' => NULL, 'refs' => [], ], 'AttachLoadBalancersType' => [ 'base' => NULL, 'refs' => [], ], 'AttachTrafficSourcesResultType' => [ 'base' => NULL, 'refs' => [], ], 'AttachTrafficSourcesType' => [ 'base' => NULL, 'refs' => [], ], 'AutoRollback' => [ 'base' => NULL, 'refs' => [ 'RefreshPreferences$AutoRollback' => '<p>(Optional) Indicates whether to roll back the Auto Scaling group to its previous configuration if the instance refresh fails. The default is <code>false</code>.</p> <p>A rollback is not supported in the following situations: </p> <ul> <li> <p>There is no desired configuration specified for the instance refresh.</p> </li> <li> <p>The Auto Scaling group has a launch template that uses an Amazon Web Services Systems Manager parameter instead of an AMI ID for the <code>ImageId</code> property.</p> </li> <li> <p>The Auto Scaling group uses the launch template\\'s <code>$Latest</code> or <code>$Default</code> version.</p> </li> </ul>', ], ], 'AutoScalingGroup' => [ 'base' => '<p>Describes an Auto Scaling group.</p>', 'refs' => [ 'AutoScalingGroups$member' => NULL, ], ], 'AutoScalingGroupDesiredCapacity' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$DesiredCapacity' => '<p>The desired size of the group.</p>', 'CreateAutoScalingGroupType$DesiredCapacity' => '<p>The desired capacity is the initial capacity of the Auto Scaling group at the time of its creation and the capacity it attempts to maintain. It can scale beyond this capacity if you configure auto scaling. This number must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group. If you do not specify a desired capacity, the default is the minimum size of the group.</p>', 'PutScheduledUpdateGroupActionType$DesiredCapacity' => '<p>The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain. It can scale beyond this capacity if you add more scaling conditions. </p> <note> <p>You must specify at least one of the following properties: <code>MaxSize</code>, <code>MinSize</code>, or <code>DesiredCapacity</code>. </p> </note>', 'ScheduledUpdateGroupAction$DesiredCapacity' => '<p>The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain.</p>', 'ScheduledUpdateGroupActionRequest$DesiredCapacity' => '<p>The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain.</p>', 'SetDesiredCapacityType$DesiredCapacity' => '<p>The desired capacity is the initial capacity of the Auto Scaling group after this operation completes and the capacity it attempts to maintain.</p>', 'UpdateAutoScalingGroupType$DesiredCapacity' => '<p>The desired capacity is the initial capacity of the Auto Scaling group after this operation completes and the capacity it attempts to maintain. This number must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group.</p>', ], ], 'AutoScalingGroupMaxSize' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$MaxSize' => '<p>The maximum size of the group.</p>', 'CreateAutoScalingGroupType$MaxSize' => '<p>The maximum size of the group.</p> <note> <p>With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above <code>MaxSize</code> to meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will never go above <code>MaxSize</code> by more than your largest instance weight (weights that define how many units each instance contributes to the desired capacity of the group).</p> </note>', 'PutScheduledUpdateGroupActionType$MaxSize' => '<p>The maximum size of the Auto Scaling group.</p>', 'ScheduledUpdateGroupAction$MaxSize' => '<p>The maximum size of the Auto Scaling group.</p>', 'ScheduledUpdateGroupActionRequest$MaxSize' => '<p>The maximum size of the Auto Scaling group.</p>', 'UpdateAutoScalingGroupType$MaxSize' => '<p>The maximum size of the Auto Scaling group.</p> <note> <p>With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above <code>MaxSize</code> to meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will never go above <code>MaxSize</code> by more than your largest instance weight (weights that define how many units each instance contributes to the desired capacity of the group).</p> </note>', ], ], 'AutoScalingGroupMinSize' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$MinSize' => '<p>The minimum size of the group.</p>', 'CreateAutoScalingGroupType$MinSize' => '<p>The minimum size of the group.</p>', 'PutScheduledUpdateGroupActionType$MinSize' => '<p>The minimum size of the Auto Scaling group.</p>', 'ScheduledUpdateGroupAction$MinSize' => '<p>The minimum size of the Auto Scaling group.</p>', 'ScheduledUpdateGroupActionRequest$MinSize' => '<p>The minimum size of the Auto Scaling group.</p>', 'UpdateAutoScalingGroupType$MinSize' => '<p>The minimum size of the Auto Scaling group.</p>', ], ], 'AutoScalingGroupNames' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroupNamesType$AutoScalingGroupNames' => '<p>The names of the Auto Scaling groups. By default, you can only specify up to 50 names. You can optionally increase this limit using the <code>MaxRecords</code> property.</p> <p>If you omit this property, all Auto Scaling groups are described.</p>', 'DescribeNotificationConfigurationsType$AutoScalingGroupNames' => '<p>The name of the Auto Scaling group.</p>', ], ], 'AutoScalingGroupNamesType' => [ 'base' => NULL, 'refs' => [], ], 'AutoScalingGroupPredictedCapacity' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$PredictedCapacity' => '<p>The predicted capacity of the group when it has a predictive scaling policy.</p>', ], ], 'AutoScalingGroupState' => [ 'base' => NULL, 'refs' => [ 'Activity$AutoScalingGroupState' => '<p>The state of the Auto Scaling group, which is either <code>InService</code> or <code>Deleted</code>.</p>', ], ], 'AutoScalingGroups' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroupsType$AutoScalingGroups' => '<p>The groups.</p>', ], ], 'AutoScalingGroupsType' => [ 'base' => NULL, 'refs' => [], ], 'AutoScalingInstanceDetails' => [ 'base' => '<p>Describes an EC2 instance associated with an Auto Scaling group.</p>', 'refs' => [ 'AutoScalingInstances$member' => NULL, ], ], 'AutoScalingInstances' => [ 'base' => NULL, 'refs' => [ 'AutoScalingInstancesType$AutoScalingInstances' => '<p>The instances.</p>', ], ], 'AutoScalingInstancesType' => [ 'base' => NULL, 'refs' => [], ], 'AutoScalingNotificationTypes' => [ 'base' => NULL, 'refs' => [ 'DescribeAutoScalingNotificationTypesAnswer$AutoScalingNotificationTypes' => '<p>The notification types.</p>', 'DescribeLifecycleHookTypesAnswer$LifecycleHookTypes' => '<p>The lifecycle hook types.</p>', 'PutNotificationConfigurationType$NotificationTypes' => '<p>The type of event that causes the notification to be sent. To query the notification types supported by Amazon EC2 Auto Scaling, call the <a>DescribeAutoScalingNotificationTypes</a> API.</p>', ], ], 'AvailabilityZones' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$AvailabilityZones' => '<p>One or more Availability Zones for the group.</p>', 'CreateAutoScalingGroupType$AvailabilityZones' => '<p>A list of Availability Zones where instances in the Auto Scaling group can be created. Used for launching into the default VPC subnet in each Availability Zone when not using the <code>VPCZoneIdentifier</code> property, or for attaching a network interface when an existing network interface ID is specified in a launch template.</p>', 'UpdateAutoScalingGroupType$AvailabilityZones' => '<p>One or more Availability Zones for the group.</p>', ], ], 'BareMetal' => [ 'base' => NULL, 'refs' => [ 'InstanceRequirements$BareMetal' => '<p>Indicates whether bare metal instance types are included, excluded, or required.</p> <p>Default: <code>excluded</code> </p>', ], ], 'BaselineEbsBandwidthMbpsRequest' => [ 'base' => '<p>Specifies the minimum and maximum for the <code>BaselineEbsBandwidthMbps</code> object when you specify <a>InstanceRequirements</a> for an Auto Scaling group.</p>', 'refs' => [ 'InstanceRequirements$BaselineEbsBandwidthMbps' => '<p>The minimum and maximum baseline bandwidth performance for an instance type, in Mbps. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-optimized.html\">Amazon EBS\u00e2\u20ac\u201coptimized instances</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> <p>Default: No minimum or maximum limits</p>', ], ], 'BatchDeleteScheduledActionAnswer' => [ 'base' => NULL, 'refs' => [], ], 'BatchDeleteScheduledActionType' => [ 'base' => NULL, 'refs' => [], ], 'BatchPutScheduledUpdateGroupActionAnswer' => [ 'base' => NULL, 'refs' => [], ], 'BatchPutScheduledUpdateGroupActionType' => [ 'base' => NULL, 'refs' => [], ], 'BlockDeviceEbsDeleteOnTermination' => [ 'base' => NULL, 'refs' => [ 'Ebs$DeleteOnTermination' => '<p>Indicates whether the volume is deleted on instance termination. For Amazon EC2 Auto Scaling, the default value is <code>true</code>.</p>', ], ], 'BlockDeviceEbsEncrypted' => [ 'base' => NULL, 'refs' => [ 'Ebs$Encrypted' => '<p>Specifies whether the volume should be encrypted. Encrypted EBS volumes can only be attached to instances that support Amazon EBS encryption. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances\">Supported instance types</a>. If your AMI uses encrypted volumes, you can also only launch it on supported instance types.</p> <note> <p>If you are creating a volume from a snapshot, you cannot create an unencrypted volume from an encrypted snapshot. Also, you cannot specify a KMS key ID when using a launch configuration.</p> <p>If you enable encryption by default, the EBS volumes that you create are always encrypted, either using the Amazon Web Services managed KMS key or a customer-managed KMS key, regardless of whether the snapshot was encrypted. </p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-data-protection.html#encryption\">Use Amazon Web Services KMS keys to encrypt Amazon EBS volumes</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> </note>', ], ], 'BlockDeviceEbsIops' => [ 'base' => NULL, 'refs' => [ 'Ebs$Iops' => '<p>The number of input/output (I/O) operations per second (IOPS) to provision for the volume. For <code>gp3</code> and <code>io1</code> volumes, this represents the number of IOPS that are provisioned for the volume. For <code>gp2</code> volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. </p> <p>The following are the supported values for each volume type: </p> <ul> <li> <p> <code>gp3</code>: 3,000-16,000 IOPS</p> </li> <li> <p> <code>io1</code>: 100-64,000 IOPS</p> </li> </ul> <p>For <code>io1</code> volumes, we guarantee 64,000 IOPS only for <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances\">Instances built on the Nitro System</a>. Other instance families guarantee performance up to 32,000 IOPS. </p> <p> <code>Iops</code> is supported when the volume type is <code>gp3</code> or <code>io1</code> and required only when the volume type is <code>io1</code>. (Not used with <code>standard</code>, <code>gp2</code>, <code>st1</code>, or <code>sc1</code> volumes.) </p>', ], ], 'BlockDeviceEbsThroughput' => [ 'base' => NULL, 'refs' => [ 'Ebs$Throughput' => '<p>The throughput (MiBps) to provision for a <code>gp3</code> volume.</p>', ], ], 'BlockDeviceEbsVolumeSize' => [ 'base' => NULL, 'refs' => [ 'Ebs$VolumeSize' => '<p>The volume size, in GiBs. The following are the supported volumes sizes for each volume type: </p> <ul> <li> <p> <code>gp2</code> and <code>gp3</code>: 1-16,384</p> </li> <li> <p> <code>io1</code>: 4-16,384</p> </li> <li> <p> <code>st1</code> and <code>sc1</code>: 125-16,384</p> </li> <li> <p> <code>standard</code>: 1-1,024</p> </li> </ul> <p>You must specify either a <code>SnapshotId</code> or a <code>VolumeSize</code>. If you specify both <code>SnapshotId</code> and <code>VolumeSize</code>, the volume size must be equal or greater than the size of the snapshot.</p>', ], ], 'BlockDeviceEbsVolumeType' => [ 'base' => NULL, 'refs' => [ 'Ebs$VolumeType' => '<p>The volume type. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html\">Amazon EBS volume types</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> <p>Valid values: <code>standard</code> | <code>io1</code> | <code>gp2</code> | <code>st1</code> | <code>sc1</code> | <code>gp3</code> </p>', ], ], 'BlockDeviceMapping' => [ 'base' => '<p>Describes a block device mapping.</p>', 'refs' => [ 'BlockDeviceMappings$member' => NULL, ], ], 'BlockDeviceMappings' => [ 'base' => NULL, 'refs' => [ 'CreateLaunchConfigurationType$BlockDeviceMappings' => '<p>The block device mapping entries that define the block devices to attach to the instances at launch. By default, the block devices specified in the block device mapping for the AMI are used. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html\">Block device mappings</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p>', 'LaunchConfiguration$BlockDeviceMappings' => '<p>The block device mapping entries that define the block devices to attach to the instances at launch. By default, the block devices specified in the block device mapping for the AMI are used. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html\">Block Device Mapping</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p>', ], ], 'BurstablePerformance' => [ 'base' => NULL, 'refs' => [ 'InstanceRequirements$BurstablePerformance' => '<p>Indicates whether burstable performance instance types are included, excluded, or required. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html\">Burstable performance instances</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> <p>Default: <code>excluded</code> </p>', ], ], 'CancelInstanceRefreshAnswer' => [ 'base' => NULL, 'refs' => [], ], 'CancelInstanceRefreshType' => [ 'base' => NULL, 'refs' => [], ], 'CapacityForecast' => [ 'base' => '<p>A <code>GetPredictiveScalingForecast</code> call returns the capacity forecast for a predictive scaling policy. This structure includes the data points for that capacity forecast, along with the timestamps of those data points. </p>', 'refs' => [ 'GetPredictiveScalingForecastAnswer$CapacityForecast' => '<p>The capacity forecast.</p>', ], ], 'CapacityRebalanceEnabled' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$CapacityRebalance' => '<p>Indicates whether Capacity Rebalancing is enabled.</p>', 'CreateAutoScalingGroupType$CapacityRebalance' => '<p>Indicates whether Capacity Rebalancing is enabled. Otherwise, Capacity Rebalancing is disabled. When you turn on Capacity Rebalancing, Amazon EC2 Auto Scaling attempts to launch a Spot Instance whenever Amazon EC2 notifies that a Spot Instance is at an elevated risk of interruption. After launching a new instance, it then terminates an old instance. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-capacity-rebalancing.html\">Use Capacity Rebalancing to handle Amazon EC2 Spot Interruptions</a> in the in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'UpdateAutoScalingGroupType$CapacityRebalance' => '<p>Enables or disables Capacity Rebalancing. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-capacity-rebalancing.html\">Use Capacity Rebalancing to handle Amazon EC2 Spot Interruptions</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', ], ], 'CheckpointDelay' => [ 'base' => NULL, 'refs' => [ 'RefreshPreferences$CheckpointDelay' => '<p>(Optional) The amount of time, in seconds, to wait after a checkpoint before continuing. This property is optional, but if you specify a value for it, you must also specify a value for <code>CheckpointPercentages</code>. If you specify a value for <code>CheckpointPercentages</code> and not for <code>CheckpointDelay</code>, the <code>CheckpointDelay</code> defaults to <code>3600</code> (1 hour). </p>', ], ], 'CheckpointPercentages' => [ 'base' => NULL, 'refs' => [ 'RefreshPreferences$CheckpointPercentages' => '<p>(Optional) Threshold values for each checkpoint in ascending order. Each number must be unique. To replace all instances in the Auto Scaling group, the last number in the array must be <code>100</code>.</p> <p>For usage examples, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-adding-checkpoints-instance-refresh.html\">Adding checkpoints to an instance refresh</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', ], ], 'ClassicLinkVPCSecurityGroups' => [ 'base' => NULL, 'refs' => [ 'CreateLaunchConfigurationType$ClassicLinkVPCSecurityGroups' => '<p>Available for backward compatibility.</p>', 'LaunchConfiguration$ClassicLinkVPCSecurityGroups' => '<p>Available for backward compatibility.</p>', ], ], 'CompleteLifecycleActionAnswer' => [ 'base' => NULL, 'refs' => [], ], 'CompleteLifecycleActionType' => [ 'base' => NULL, 'refs' => [], ], 'Context' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$Context' => '<p>Reserved.</p>', 'CreateAutoScalingGroupType$Context' => '<p>Reserved.</p>', 'UpdateAutoScalingGroupType$Context' => '<p>Reserved.</p>', ], ], 'Cooldown' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$DefaultCooldown' => '<p>The duration of the default cooldown period, in seconds.</p>', 'CreateAutoScalingGroupType$DefaultCooldown' => '<p> <i>Only needed if you use simple scaling policies.</i> </p> <p>The amount of time, in seconds, between one scaling activity ending and another one starting due to simple scaling policies. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html\">Scaling cooldowns for Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>Default: <code>300</code> seconds</p>', 'PutScalingPolicyType$Cooldown' => '<p>A cooldown period, in seconds, that applies to a specific simple scaling policy. When a cooldown period is specified here, it overrides the default cooldown.</p> <p>Valid only if the policy type is <code>SimpleScaling</code>. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html\">Scaling cooldowns for Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>Default: None</p>', 'ScalingPolicy$Cooldown' => '<p>The duration of the policy\\'s cooldown period, in seconds.</p>', 'UpdateAutoScalingGroupType$DefaultCooldown' => '<p> <i>Only needed if you use simple scaling policies.</i> </p> <p>The amount of time, in seconds, between one scaling activity ending and another one starting due to simple scaling policies. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html\">Scaling cooldowns for Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', ], ], 'CpuManufacturer' => [ 'base' => NULL, 'refs' => [ 'CpuManufacturers$member' => NULL, ], ], 'CpuManufacturers' => [ 'base' => NULL, 'refs' => [ 'InstanceRequirements$CpuManufacturers' => '<p>Lists which specific CPU manufacturers to include.</p> <ul> <li> <p>For instance types with Intel CPUs, specify <code>intel</code>.</p> </li> <li> <p>For instance types with AMD CPUs, specify <code>amd</code>.</p> </li> <li> <p>For instance types with Amazon Web Services CPUs, specify <code>amazon-web-services</code>.</p> </li> </ul> <note> <p>Don\\'t confuse the CPU hardware manufacturer with the CPU hardware architecture. Instances will be launched with a compatible CPU architecture based on the Amazon Machine Image (AMI) that you specify in your launch template. </p> </note> <p>Default: Any manufacturer</p>', ], ], 'CreateAutoScalingGroupType' => [ 'base' => NULL, 'refs' => [], ], 'CreateLaunchConfigurationType' => [ 'base' => NULL, 'refs' => [], ], 'CreateOrUpdateTagsType' => [ 'base' => NULL, 'refs' => [], ], 'CustomizedMetricSpecification' => [ 'base' => '<p>Represents a CloudWatch metric of your choosing for a target tracking scaling policy to use with Amazon EC2 Auto Scaling.</p> <p>To create your customized metric specification:</p> <ul> <li> <p>Add values for each required property from CloudWatch. You can use an existing metric, or a new metric that you create. To use your own metric, you must first publish the metric to CloudWatch. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html\">Publish custom metrics</a> in the <i>Amazon CloudWatch User Guide</i>.</p> </li> <li> <p>Choose a metric that changes proportionally with capacity. The value of the metric should increase or decrease in inverse proportion to the number of capacity units. That is, the value of the metric should decrease when capacity increases.</p> </li> </ul> <p>For more information about the CloudWatch terminology below, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html\">Amazon CloudWatch concepts</a>.</p> <note> <p>Each individual service provides information about the metrics, namespace, and dimensions they use. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html\">Amazon Web Services services that publish CloudWatch metrics</a> in the <i>Amazon CloudWatch User Guide</i>.</p> </note>', 'refs' => [ 'TargetTrackingConfiguration$CustomizedMetricSpecification' => '<p>A customized metric. You must specify either a predefined metric or a customized metric.</p>', ], ], 'DefaultInstanceWarmup' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$DefaultInstanceWarmup' => '<p>The duration of the default instance warmup, in seconds.</p>', 'CreateAutoScalingGroupType$DefaultInstanceWarmup' => '<p>The amount of time, in seconds, until a new instance is considered to have finished initializing and resource consumption to become stable after it enters the <code>InService</code> state. </p> <p>During an instance refresh, Amazon EC2 Auto Scaling waits for the warm-up period after it replaces an instance before it moves on to replacing the next instance. Amazon EC2 Auto Scaling also waits for the warm-up period before aggregating the metrics for new instances with existing instances in the Amazon CloudWatch metrics that are used for scaling, resulting in more reliable usage data. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-default-instance-warmup.html\">Set the default instance warmup for an Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <important> <p>To manage various warm-up settings at the group level, we recommend that you set the default instance warmup, <i>even if it is set to 0 seconds</i>. To remove a value that you previously set, include the property but specify <code>-1</code> for the value. However, we strongly recommend keeping the default instance warmup enabled by specifying a value of <code>0</code> or other nominal value.</p> </important> <p>Default: None </p>', 'UpdateAutoScalingGroupType$DefaultInstanceWarmup' => '<p>The amount of time, in seconds, until a new instance is considered to have finished initializing and resource consumption to become stable after it enters the <code>InService</code> state. </p> <p>During an instance refresh, Amazon EC2 Auto Scaling waits for the warm-up period after it replaces an instance before it moves on to replacing the next instance. Amazon EC2 Auto Scaling also waits for the warm-up period before aggregating the metrics for new instances with existing instances in the Amazon CloudWatch metrics that are used for scaling, resulting in more reliable usage data. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-default-instance-warmup.html\">Set the default instance warmup for an Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <important> <p>To manage various warm-up settings at the group level, we recommend that you set the default instance warmup, <i>even if it is set to 0 seconds</i>. To remove a value that you previously set, include the property but specify <code>-1</code> for the value. However, we strongly recommend keeping the default instance warmup enabled by specifying a value of <code>0</code> or other nominal value.</p> </important>', ], ], 'DeleteAutoScalingGroupType' => [ 'base' => NULL, 'refs' => [], ], 'DeleteLifecycleHookAnswer' => [ 'base' => NULL, 'refs' => [], ], 'DeleteLifecycleHookType' => [ 'base' => NULL, 'refs' => [], ], 'DeleteNotificationConfigurationType' => [ 'base' => NULL, 'refs' => [], ], 'DeletePolicyType' => [ 'base' => NULL, 'refs' => [], ], 'DeleteScheduledActionType' => [ 'base' => NULL, 'refs' => [], ], 'DeleteTagsType' => [ 'base' => NULL, 'refs' => [], ], 'DeleteWarmPoolAnswer' => [ 'base' => NULL, 'refs' => [], ], 'DeleteWarmPoolType' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAccountLimitsAnswer' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAdjustmentTypesAnswer' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAutoScalingInstancesType' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAutoScalingNotificationTypesAnswer' => [ 'base' => NULL, 'refs' => [], ], 'DescribeInstanceRefreshesAnswer' => [ 'base' => NULL, 'refs' => [], ], 'DescribeInstanceRefreshesType' => [ 'base' => NULL, 'refs' => [], ], 'DescribeLifecycleHookTypesAnswer' => [ 'base' => NULL, 'refs' => [], ], 'DescribeLifecycleHooksAnswer' => [ 'base' => NULL, 'refs' => [], ], 'DescribeLifecycleHooksType' => [ 'base' => NULL, 'refs' => [], ], 'DescribeLoadBalancerTargetGroupsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeLoadBalancerTargetGroupsResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeLoadBalancersRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeLoadBalancersResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeMetricCollectionTypesAnswer' => [ 'base' => NULL, 'refs' => [], ], 'DescribeNotificationConfigurationsAnswer' => [ 'base' => NULL, 'refs' => [], ], 'DescribeNotificationConfigurationsType' => [ 'base' => NULL, 'refs' => [], ], 'DescribePoliciesType' => [ 'base' => NULL, 'refs' => [], ], 'DescribeScalingActivitiesType' => [ 'base' => NULL, 'refs' => [], ], 'DescribeScheduledActionsType' => [ 'base' => NULL, 'refs' => [], ], 'DescribeTagsType' => [ 'base' => NULL, 'refs' => [], ], 'DescribeTerminationPolicyTypesAnswer' => [ 'base' => NULL, 'refs' => [], ], 'DescribeTrafficSourcesRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeTrafficSourcesResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeWarmPoolAnswer' => [ 'base' => NULL, 'refs' => [], ], 'DescribeWarmPoolType' => [ 'base' => NULL, 'refs' => [], ], 'DesiredConfiguration' => [ 'base' => '<p>Describes the desired configuration for an instance refresh. </p> <p>If you specify a desired configuration, you must specify either a <code>LaunchTemplate</code> or a <code>MixedInstancesPolicy</code>. </p>', 'refs' => [ 'InstanceRefresh$DesiredConfiguration' => '<p>Describes the desired configuration for the instance refresh.</p>', 'StartInstanceRefreshType$DesiredConfiguration' => '<p>The desired configuration. For example, the desired configuration can specify a new launch template or a new version of the current launch template.</p> <p>Once the instance refresh succeeds, Amazon EC2 Auto Scaling updates the settings of the Auto Scaling group to reflect the new desired configuration. </p> <note> <p>When you specify a new launch template or a new version of the current launch template for your desired configuration, consider enabling the <code>SkipMatching</code> property in preferences. If it\\'s enabled, Amazon EC2 Auto Scaling skips replacing instances that already use the specified launch template and instance types. This can help you reduce the number of replacements that are required to apply updates. </p> </note>', ], ], 'DetachInstancesAnswer' => [ 'base' => NULL, 'refs' => [], ], 'DetachInstancesQuery' => [ 'base' => NULL, 'refs' => [], ], 'DetachLoadBalancerTargetGroupsResultType' => [ 'base' => NULL, 'refs' => [], ], 'DetachLoadBalancerTargetGroupsType' => [ 'base' => NULL, 'refs' => [], ], 'DetachLoadBalancersResultType' => [ 'base' => NULL, 'refs' => [], ], 'DetachLoadBalancersType' => [ 'base' => NULL, 'refs' => [], ], 'DetachTrafficSourcesResultType' => [ 'base' => NULL, 'refs' => [], ], 'DetachTrafficSourcesType' => [ 'base' => NULL, 'refs' => [], ], 'DisableMetricsCollectionQuery' => [ 'base' => NULL, 'refs' => [], ], 'DisableScaleIn' => [ 'base' => NULL, 'refs' => [ 'TargetTrackingConfiguration$DisableScaleIn' => '<p>Indicates whether scaling in by the target tracking scaling policy is disabled. If scaling in is disabled, the target tracking scaling policy doesn\\'t remove instances from the Auto Scaling group. Otherwise, the target tracking scaling policy can remove instances from the Auto Scaling group. The default is <code>false</code>.</p>', ], ], 'Ebs' => [ 'base' => '<p>Describes information used to set up an Amazon EBS volume specified in a block device mapping.</p>', 'refs' => [ 'BlockDeviceMapping$Ebs' => '<p>Information to attach an EBS volume to an instance at launch.</p>', ], ], 'EbsOptimized' => [ 'base' => NULL, 'refs' => [ 'CreateLaunchConfigurationType$EbsOptimized' => '<p>Specifies whether the launch configuration is optimized for EBS I/O (<code>true</code>) or not (<code>false</code>). The optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization is not available with all instance types. Additional fees are incurred when you enable EBS optimization for an instance type that is not EBS-optimized by default. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html\">Amazon EBS-optimized instances</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> <p>The default value is <code>false</code>.</p>', 'LaunchConfiguration$EbsOptimized' => '<p>Specifies whether the launch configuration is optimized for EBS I/O (<code>true</code>) or not (<code>false</code>). For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html\">Amazon EBS-Optimized Instances</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p>', ], ], 'EnableMetricsCollectionQuery' => [ 'base' => NULL, 'refs' => [], ], 'EnabledMetric' => [ 'base' => '<p>Describes an enabled Auto Scaling group metric.</p>', 'refs' => [ 'EnabledMetrics$member' => NULL, ], ], 'EnabledMetrics' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$EnabledMetrics' => '<p>The metrics enabled for the group.</p>', ], ], 'EnterStandbyAnswer' => [ 'base' => NULL, 'refs' => [], ], 'EnterStandbyQuery' => [ 'base' => NULL, 'refs' => [], ], 'EstimatedInstanceWarmup' => [ 'base' => NULL, 'refs' => [ 'PutScalingPolicyType$EstimatedInstanceWarmup' => '<p> <i>Not needed if the default instance warmup is defined for the group.</i> </p> <p>The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. This warm-up period applies to instances launched due to a specific target tracking or step scaling policy. When a warm-up period is specified here, it overrides the default instance warmup.</p> <p>Valid only if the policy type is <code>TargetTrackingScaling</code> or <code>StepScaling</code>.</p> <note> <p>The default is to use the value for the default instance warmup defined for the group. If default instance warmup is null, then <code>EstimatedInstanceWarmup</code> falls back to the value of default cooldown.</p> </note>', 'ScalingPolicy$EstimatedInstanceWarmup' => '<p>The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.</p>', ], ], 'ExcludedInstance' => [ 'base' => NULL, 'refs' => [ 'ExcludedInstanceTypes$member' => NULL, ], ], 'ExcludedInstanceTypes' => [ 'base' => NULL, 'refs' => [ 'InstanceRequirements$ExcludedInstanceTypes' => '<p>The instance types to exclude. You can use strings with one or more wild cards, represented by an asterisk (<code>*</code>), to exclude an instance family, type, size, or generation. The following are examples: <code>m5.8xlarge</code>, <code>c5*.*</code>, <code>m5a.*</code>, <code>r*</code>, <code>*3*</code>. </p> <p>For example, if you specify <code>c5*</code>, you are excluding the entire C5 instance family, which includes all C5a and C5n instance types. If you specify <code>m5a.*</code>, Amazon EC2 Auto Scaling will exclude all the M5a instance types, but not the M5n instance types.</p> <note> <p>If you specify <code>ExcludedInstanceTypes</code>, you can\\'t specify <code>AllowedInstanceTypes</code>.</p> </note> <p>Default: No excluded instance types</p>', ], ], 'ExecutePolicyType' => [ 'base' => NULL, 'refs' => [], ], 'ExitStandbyAnswer' => [ 'base' => NULL, 'refs' => [], ], 'ExitStandbyQuery' => [ 'base' => NULL, 'refs' => [], ], 'FailedScheduledUpdateGroupActionRequest' => [ 'base' => '<p>Describes a scheduled action that could not be created, updated, or deleted.</p>', 'refs' => [ 'FailedScheduledUpdateGroupActionRequests$member' => NULL, ], ], 'FailedScheduledUpdateGroupActionRequests' => [ 'base' => NULL, 'refs' => [ 'BatchDeleteScheduledActionAnswer$FailedScheduledActions' => '<p>The names of the scheduled actions that could not be deleted, including an error message.</p>', 'BatchPutScheduledUpdateGroupActionAnswer$FailedScheduledUpdateGroupActions' => '<p>The names of the scheduled actions that could not be created or updated, including an error message.</p>', ], ], 'Filter' => [ 'base' => '<p>Describes a filter that is used to return a more specific list of results from a describe operation.</p> <p>If you specify multiple filters, the filters are automatically logically joined with an <code>AND</code>, and the request returns only the results that match all of the specified filters. </p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html\">Tag Auto Scaling groups and instances</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'refs' => [ 'Filters$member' => NULL, ], ], 'Filters' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroupNamesType$Filters' => '<p>One or more filters to limit the results based on specific tags. </p>', 'DescribeTagsType$Filters' => '<p>One or more filters to scope the tags to return. The maximum number of filters per filter type (for example, <code>auto-scaling-group</code>) is 1000.</p>', ], ], 'ForceDelete' => [ 'base' => NULL, 'refs' => [ 'DeleteAutoScalingGroupType$ForceDelete' => '<p>Specifies that the group is to be deleted along with all instances associated with the group, without waiting for all instances to be terminated. This action also deletes any outstanding lifecycle actions associated with the group.</p>', 'DeleteWarmPoolType$ForceDelete' => '<p>Specifies that the warm pool is to be deleted along with all of its associated instances, without waiting for all instances to be terminated. This parameter also deletes any outstanding lifecycle actions associated with the warm pool instances.</p>', ], ], 'GetPredictiveScalingForecastAnswer' => [ 'base' => NULL, 'refs' => [], ], 'GetPredictiveScalingForecastType' => [ 'base' => NULL, 'refs' => [], ], 'GlobalTimeout' => [ 'base' => NULL, 'refs' => [ 'LifecycleHook$GlobalTimeout' => '<p>The maximum time, in seconds, that an instance can remain in a wait state. The maximum is 172800 seconds (48 hours) or 100 times <code>HeartbeatTimeout</code>, whichever is smaller.</p>', ], ], 'HealthCheckGracePeriod' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$HealthCheckGracePeriod' => '<p>The duration of the health check grace period, in seconds.</p>', 'CreateAutoScalingGroupType$HealthCheckGracePeriod' => '<p>The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2 instance that has come into service and marking it unhealthy due to a failed health check. This is useful if your instances do not immediately pass their health checks after they enter the <code>InService</code> state. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/health-check-grace-period.html\">Set the health check grace period for an Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>Default: <code>0</code> seconds</p>', 'UpdateAutoScalingGroupType$HealthCheckGracePeriod' => '<p>The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2 instance that has come into service and marking it unhealthy due to a failed health check. This is useful if your instances do not immediately pass their health checks after they enter the <code>InService</code> state. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/health-check-grace-period.html\">Set the health check grace period for an Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', ], ], 'HeartbeatTimeout' => [ 'base' => NULL, 'refs' => [ 'LifecycleHook$HeartbeatTimeout' => '<p>The maximum time, in seconds, that can elapse before the lifecycle hook times out. If the lifecycle hook times out, Amazon EC2 Auto Scaling performs the action that you specified in the <code>DefaultResult</code> property.</p>', 'LifecycleHookSpecification$HeartbeatTimeout' => '<p>The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from <code>30</code> to <code>7200</code> seconds. The default value is <code>3600</code> seconds (1 hour).</p>', 'PutLifecycleHookType$HeartbeatTimeout' => '<p>The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from <code>30</code> to <code>7200</code> seconds. The default value is <code>3600</code> seconds (1 hour).</p>', ], ], 'HonorCooldown' => [ 'base' => NULL, 'refs' => [ 'ExecutePolicyType$HonorCooldown' => '<p>Indicates whether Amazon EC2 Auto Scaling waits for the cooldown period to complete before executing the policy.</p> <p>Valid only if the policy type is <code>SimpleScaling</code>. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html\">Scaling cooldowns for Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'SetDesiredCapacityType$HonorCooldown' => '<p>Indicates whether Amazon EC2 Auto Scaling waits for the cooldown period to complete before initiating a scaling activity to set your Auto Scaling group to its new capacity. By default, Amazon EC2 Auto Scaling does not honor the cooldown period during manual scaling activities.</p>', ], ], 'IncludeDeletedGroups' => [ 'base' => NULL, 'refs' => [ 'DescribeScalingActivitiesType$IncludeDeletedGroups' => '<p>Indicates whether to include scaling activity from deleted Auto Scaling groups.</p>', ], ], 'Instance' => [ 'base' => '<p>Describes an EC2 instance.</p>', 'refs' => [ 'Instances$member' => NULL, ], ], 'InstanceGeneration' => [ 'base' => NULL, 'refs' => [ 'InstanceGenerations$member' => NULL, ], ], 'InstanceGenerations' => [ 'base' => NULL, 'refs' => [ 'InstanceRequirements$InstanceGenerations' => '<p>Indicates whether current or previous generation instance types are included.</p> <ul> <li> <p>For current generation instance types, specify <code>current</code>. The current generation includes EC2 instance types currently recommended for use. This typically includes the latest two to three generations in each instance family. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html\">Instance types</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> </li> <li> <p>For previous generation instance types, specify <code>previous</code>.</p> </li> </ul> <p>Default: Any current or previous generation</p>', ], ], 'InstanceIds' => [ 'base' => NULL, 'refs' => [ 'AttachInstancesQuery$InstanceIds' => '<p>The IDs of the instances. You can specify up to 20 instances.</p>', 'DescribeAutoScalingInstancesType$InstanceIds' => '<p>The IDs of the instances. If you omit this property, all Auto Scaling instances are described. If you specify an ID that does not exist, it is ignored with no error.</p> <p>Array Members: Maximum number of 50 items.</p>', 'DetachInstancesQuery$InstanceIds' => '<p>The IDs of the instances. You can specify up to 20 instances.</p>', 'EnterStandbyQuery$InstanceIds' => '<p>The IDs of the instances. You can specify up to 20 instances.</p>', 'ExitStandbyQuery$InstanceIds' => '<p>The IDs of the instances. You can specify up to 20 instances.</p>', 'SetInstanceProtectionQuery$InstanceIds' => '<p>One or more instance IDs. You can specify up to 50 instances.</p>', ], ], 'InstanceMetadataEndpointState' => [ 'base' => NULL, 'refs' => [ 'InstanceMetadataOptions$HttpEndpoint' => '<p>This parameter enables or disables the HTTP metadata endpoint on your instances. If the parameter is not specified, the default state is <code>enabled</code>.</p> <note> <p>If you specify a value of <code>disabled</code>, you will not be able to access your instance metadata. </p> </note>', ], ], 'InstanceMetadataHttpPutResponseHopLimit' => [ 'base' => NULL, 'refs' => [ 'InstanceMetadataOptions$HttpPutResponseHopLimit' => '<p>The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel.</p> <p>Default: 1</p>', ], ], 'InstanceMetadataHttpTokensState' => [ 'base' => NULL, 'refs' => [ 'InstanceMetadataOptions$HttpTokens' => '<p>The state of token usage for your instance metadata requests. If the parameter is not specified in the request, the default state is <code>optional</code>.</p> <p>If the state is <code>optional</code>, you can choose to retrieve instance metadata with or without a signed token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0 role credentials are returned.</p> <p>If the state is <code>required</code>, you must send a signed token header with any instance metadata retrieval requests. In this state, retrieving the IAM role credentials always returns the version 2.0 credentials; the version 1.0 credentials are not available.</p>', ], ], 'InstanceMetadataOptions' => [ 'base' => '<p>The metadata options for the instances. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-config.html#launch-configurations-imds\">Configuring the Instance Metadata Options</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'refs' => [ 'CreateLaunchConfigurationType$MetadataOptions' => '<p>The metadata options for the instances. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-config.html#launch-configurations-imds\">Configuring the Instance Metadata Options</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'LaunchConfiguration$MetadataOptions' => '<p>The metadata options for the instances. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-config.html#launch-configurations-imds\">Configuring the Instance Metadata Options</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', ], ], 'InstanceMonitoring' => [ 'base' => '<p>Describes whether detailed monitoring is enabled for the Auto Scaling instances.</p>', 'refs' => [ 'CreateLaunchConfigurationType$InstanceMonitoring' => '<p>Controls whether instances in this group are launched with detailed (<code>true</code>) or basic (<code>false</code>) monitoring.</p> <p>The default value is <code>true</code> (enabled).</p> <important> <p>When detailed monitoring is enabled, Amazon CloudWatch generates metrics every minute and your account is charged a fee. When you disable detailed monitoring, CloudWatch generates metrics every 5 minutes. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/latest/userguide/enable-as-instance-metrics.html\">Configure Monitoring for Auto Scaling Instances</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> </important>', 'LaunchConfiguration$InstanceMonitoring' => '<p>Controls whether instances in this group are launched with detailed (<code>true</code>) or basic (<code>false</code>) monitoring.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/latest/userguide/enable-as-instance-metrics.html\">Configure Monitoring for Auto Scaling Instances</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', ], ], 'InstanceProtected' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$NewInstancesProtectedFromScaleIn' => '<p>Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in.</p>', 'AutoScalingInstanceDetails$ProtectedFromScaleIn' => '<p>Indicates whether the instance is protected from termination by Amazon EC2 Auto Scaling when scaling in.</p>', 'CreateAutoScalingGroupType$NewInstancesProtectedFromScaleIn' => '<p>Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in. For more information about preventing instances from terminating on scale in, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-protection.html\">Using instance scale-in protection</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'Instance$ProtectedFromScaleIn' => '<p>Indicates whether the instance is protected from termination by Amazon EC2 Auto Scaling when scaling in.</p>', 'UpdateAutoScalingGroupType$NewInstancesProtectedFromScaleIn' => '<p>Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in. For more information about preventing instances from terminating on scale in, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-protection.html\">Using instance scale-in protection</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', ], ], 'InstanceRefresh' => [ 'base' => '<p>Describes an instance refresh for an Auto Scaling group. </p>', 'refs' => [ 'InstanceRefreshes$member' => NULL, ], ], 'InstanceRefreshIds' => [ 'base' => NULL, 'refs' => [ 'DescribeInstanceRefreshesType$InstanceRefreshIds' => '<p>One or more instance refresh IDs.</p>', ], ], 'InstanceRefreshInProgressFault' => [ 'base' => '<p>The request failed because an active instance refresh already exists for the specified Auto Scaling group.</p>', 'refs' => [], ], 'InstanceRefreshLivePoolProgress' => [ 'base' => '<p>Reports progress on replacing instances that are in the Auto Scaling group.</p>', 'refs' => [ 'InstanceRefreshProgressDetails$LivePoolProgress' => '<p>Reports progress on replacing instances that are in the Auto Scaling group.</p>', ], ], 'InstanceRefreshProgressDetails' => [ 'base' => '<p>Reports progress on replacing instances in an Auto Scaling group that has a warm pool. This includes separate details for instances in the warm pool and instances in the Auto Scaling group (the live pool).</p>', 'refs' => [ 'InstanceRefresh$ProgressDetails' => '<p>Additional progress details for an Auto Scaling group that has a warm pool.</p>', 'RollbackDetails$ProgressDetailsOnRollback' => '<p>Reports progress on replacing instances in an Auto Scaling group that has a warm pool. This includes separate details for instances in the warm pool and instances in the Auto Scaling group (the live pool).</p>', ], ], 'InstanceRefreshStatus' => [ 'base' => NULL, 'refs' => [ 'InstanceRefresh$Status' => '<p>The current status for the instance refresh operation:</p> <ul> <li> <p> <code>Pending</code> - The request was created, but the instance refresh has not started.</p> </li> <li> <p> <code>InProgress</code> - An instance refresh is in progress.</p> </li> <li> <p> <code>Successful</code> - An instance refresh completed successfully.</p> </li> <li> <p> <code>Failed</code> - An instance refresh failed to complete. You can troubleshoot using the status reason and the scaling activities. </p> </li> <li> <p> <code>Cancelling</code> - An ongoing instance refresh is being cancelled.</p> </li> <li> <p> <code>Cancelled</code> - The instance refresh is cancelled. </p> </li> <li> <p> <code>RollbackInProgress</code> - An instance refresh is being rolled back.</p> </li> <li> <p> <code>RollbackFailed</code> - The rollback failed to complete. You can troubleshoot using the status reason and the scaling activities.</p> </li> <li> <p> <code>RollbackSuccessful</code> - The rollback completed successfully.</p> </li> </ul>', ], ], 'InstanceRefreshWarmPoolProgress' => [ 'base' => '<p>Reports progress on replacing instances that are in the warm pool.</p>', 'refs' => [ 'InstanceRefreshProgressDetails$WarmPoolProgress' => '<p>Reports progress on replacing instances that are in the warm pool.</p>', ], ], 'InstanceRefreshes' => [ 'base' => NULL, 'refs' => [ 'DescribeInstanceRefreshesAnswer$InstanceRefreshes' => '<p>The instance refreshes for the specified group, sorted by creation timestamp in descending order.</p>', ], ], 'InstanceRequirements' => [ 'base' => '<p>The attributes for the instance types for a mixed instances policy. Amazon EC2 Auto Scaling uses your specified requirements to identify instance types. Then, it uses your On-Demand and Spot allocation strategies to launch instances from these instance types.</p> <p>When you specify multiple attributes, you get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, you get instance types that satisfy any of the specified values.</p> <p>To limit the list of instance types from which Amazon EC2 Auto Scaling can identify matching instance types, you can use one of the following parameters, but not both in the same request:</p> <ul> <li> <p> <code>AllowedInstanceTypes</code> - The instance types to include in the list. All other instance types are ignored, even if they match your specified attributes.</p> </li> <li> <p> <code>ExcludedInstanceTypes</code> - The instance types to exclude from the list, even if they match your specified attributes.</p> </li> </ul> <note> <p>You must specify <code>VCpuCount</code> and <code>MemoryMiB</code>. All other attributes are optional. Any unspecified optional attribute is set to its default.</p> </note> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-instance-type-requirements.html\">Creating an Auto Scaling group using attribute-based instance type selection</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>. For help determining which instance types match your attributes before you apply them to your Auto Scaling group, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection.html#ec2fleet-get-instance-types-from-instance-requirements\">Preview instance types with specified attributes</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p>', 'refs' => [ 'LaunchTemplateOverrides$InstanceRequirements' => '<p>The instance requirements. Amazon EC2 Auto Scaling uses your specified requirements to identify instance types. Then, it uses your On-Demand and Spot allocation strategies to launch instances from these instance types.</p> <p>You can specify up to four separate sets of instance requirements per Auto Scaling group. This is useful for provisioning instances from different Amazon Machine Images (AMIs) in the same Auto Scaling group. To do this, create the AMIs and create a new launch template for each AMI. Then, create a compatible set of instance requirements for each launch template. </p> <note> <p>If you specify <code>InstanceRequirements</code>, you can\\'t specify <code>InstanceType</code>.</p> </note>', ], ], 'InstanceReusePolicy' => [ 'base' => '<p>Describes an instance reuse policy for a warm pool. </p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-warm-pools.html\">Warm pools for Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'refs' => [ 'PutWarmPoolType$InstanceReusePolicy' => '<p>Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in. The default is to terminate instances in the Auto Scaling group when the group scales in.</p>', 'WarmPoolConfiguration$InstanceReusePolicy' => '<p>The instance reuse policy.</p>', ], ], 'Instances' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$Instances' => '<p>The EC2 instances associated with the group.</p>', 'DescribeWarmPoolAnswer$Instances' => '<p>The instances that are currently in the warm pool.</p>', ], ], 'InstancesDistribution' => [ 'base' => '<p>Use this structure to specify the distribution of On-Demand Instances and Spot Instances and the allocation strategies used to fulfill On-Demand and Spot capacities for a mixed instances policy.</p>', 'refs' => [ 'MixedInstancesPolicy$InstancesDistribution' => '<p>The instances distribution.</p>', ], ], 'InstancesToUpdate' => [ 'base' => NULL, 'refs' => [ 'InstanceRefresh$InstancesToUpdate' => '<p>The number of instances remaining to update before the instance refresh is complete.</p> <note> <p>If you roll back the instance refresh, <code>InstancesToUpdate</code> shows you the number of instances that were not yet updated by the instance refresh. Therefore, these instances don\\'t need to be replaced as part of the rollback.</p> </note>', 'InstanceRefreshLivePoolProgress$InstancesToUpdate' => '<p>The number of instances remaining to update.</p>', 'InstanceRefreshWarmPoolProgress$InstancesToUpdate' => '<p>The number of instances remaining to update.</p>', 'RollbackDetails$InstancesToUpdateOnRollback' => '<p>Indicates the value of <code>InstancesToUpdate</code> at the time the rollback started.</p>', ], ], 'IntPercent' => [ 'base' => NULL, 'refs' => [ 'InstanceRefresh$PercentageComplete' => '<p>The percentage of the instance refresh that is complete. For each instance replacement, Amazon EC2 Auto Scaling tracks the instance\\'s health status and warm-up time. When the instance\\'s health status changes to healthy and the specified warm-up time passes, the instance is considered updated and is added to the percentage complete.</p> <note> <p> <code>PercentageComplete</code> does not include instances that are replaced during a rollback. This value gradually goes back down to zero during a rollback.</p> </note>', 'InstanceRefreshLivePoolProgress$PercentageComplete' => '<p>The percentage of instances in the Auto Scaling group that have been replaced. For each instance replacement, Amazon EC2 Auto Scaling tracks the instance\\'s health status and warm-up time. When the instance\\'s health status changes to healthy and the specified warm-up time passes, the instance is considered updated and is added to the percentage complete.</p>', 'InstanceRefreshWarmPoolProgress$PercentageComplete' => '<p>The percentage of instances in the warm pool that have been replaced. For each instance replacement, Amazon EC2 Auto Scaling tracks the instance\\'s health status and warm-up time. When the instance\\'s health status changes to healthy and the specified warm-up time passes, the instance is considered updated and is added to the percentage complete.</p>', 'RefreshPreferences$MinHealthyPercentage' => '<p>The amount of capacity in the Auto Scaling group that must pass your group\\'s health checks to allow the operation to continue. The value is expressed as a percentage of the desired capacity of the Auto Scaling group (rounded up to the nearest integer). The default is <code>90</code>.</p> <p>Setting the minimum healthy percentage to 100 percent limits the rate of replacement to one instance at a time. In contrast, setting it to 0 percent has the effect of replacing all instances at the same time. </p>', 'RollbackDetails$PercentageCompleteOnRollback' => '<p>Indicates the value of <code>PercentageComplete</code> at the time the rollback started.</p>', ], ], 'InvalidNextToken' => [ 'base' => '<p>The <code>NextToken</code> value is not valid.</p>', 'refs' => [], ], 'IrreversibleInstanceRefreshFault' => [ 'base' => '<p>The request failed because a desired configuration was not found or an incompatible launch template (uses a Systems Manager parameter instead of an AMI ID) or launch template version (<code>$Latest</code> or <code>$Default</code>) is present on the Auto Scaling group.</p>', 'refs' => [], ], 'LaunchConfiguration' => [ 'base' => '<p>Describes a launch configuration.</p>', 'refs' => [ 'LaunchConfigurations$member' => NULL, ], ], 'LaunchConfigurationNameType' => [ 'base' => NULL, 'refs' => [], ], 'LaunchConfigurationNames' => [ 'base' => NULL, 'refs' => [ 'LaunchConfigurationNamesType$LaunchConfigurationNames' => '<p>The launch configuration names. If you omit this property, all launch configurations are described.</p> <p>Array Members: Maximum number of 50 items.</p>', ], ], 'LaunchConfigurationNamesType' => [ 'base' => NULL, 'refs' => [], ], 'LaunchConfigurations' => [ 'base' => NULL, 'refs' => [ 'LaunchConfigurationsType$LaunchConfigurations' => '<p>The launch configurations.</p>', ], ], 'LaunchConfigurationsType' => [ 'base' => NULL, 'refs' => [], ], 'LaunchTemplate' => [ 'base' => '<p>Use this structure to specify the launch templates and instance types (overrides) for a mixed instances policy.</p>', 'refs' => [ 'MixedInstancesPolicy$LaunchTemplate' => '<p>One or more launch templates and the instance types (overrides) that are used to launch EC2 instances to fulfill On-Demand and Spot capacities.</p>', ], ], 'LaunchTemplateName' => [ 'base' => NULL, 'refs' => [ 'LaunchTemplateSpecification$LaunchTemplateName' => '<p>The name of the launch template. To get the template name, use the Amazon EC2 <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeLaunchTemplates.html\">DescribeLaunchTemplates</a> API operation. New launch templates can be created using the Amazon EC2 <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplate.html\">CreateLaunchTemplate</a> API. </p> <p>Conditional: You must specify either a <code>LaunchTemplateId</code> or a <code>LaunchTemplateName</code>.</p>', ], ], 'LaunchTemplateOverrides' => [ 'base' => '<p>Use this structure to let Amazon EC2 Auto Scaling do the following when the Auto Scaling group has a mixed instances policy:</p> <ul> <li> <p>Override the instance type that is specified in the launch template.</p> </li> <li> <p>Use multiple instance types.</p> </li> </ul> <p>Specify the instance types that you want, or define your instance requirements instead and let Amazon EC2 Auto Scaling provision the available instance types that meet your requirements. This can provide Amazon EC2 Auto Scaling with a larger selection of instance types to choose from when fulfilling Spot and On-Demand capacities. You can view which instance types are matched before you apply the instance requirements to your Auto Scaling group.</p> <p>After you define your instance requirements, you don\\'t have to keep updating these settings to get new EC2 instance types automatically. Amazon EC2 Auto Scaling uses the instance requirements of the Auto Scaling group to determine whether a new EC2 instance type can be used.</p>', 'refs' => [ 'Overrides$member' => NULL, ], ], 'LaunchTemplateSpecification' => [ 'base' => '<p>Describes the launch template and the version of the launch template that Amazon EC2 Auto Scaling uses to launch Amazon EC2 instances. For more information about launch templates, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/LaunchTemplates.html\">Launch templates</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'refs' => [ 'AutoScalingGroup$LaunchTemplate' => '<p>The launch template for the group.</p>', 'AutoScalingInstanceDetails$LaunchTemplate' => '<p>The launch template for the instance.</p>', 'CreateAutoScalingGroupType$LaunchTemplate' => '<p>Information used to specify the launch template and version to use to launch instances. </p> <p>Conditional: You must specify either a launch template (<code>LaunchTemplate</code> or <code>MixedInstancesPolicy</code>) or a launch configuration (<code>LaunchConfigurationName</code> or <code>InstanceId</code>).</p> <note> <p>The launch template that is specified must be configured for use with an Auto Scaling group. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html\">Creating a launch template for an Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> </note>', 'DesiredConfiguration$LaunchTemplate' => '<p>Describes the launch template and the version of the launch template that Amazon EC2 Auto Scaling uses to launch Amazon EC2 instances. For more information about launch templates, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/LaunchTemplates.html\">Launch templates</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'Instance$LaunchTemplate' => '<p>The launch template for the instance.</p>', 'LaunchTemplate$LaunchTemplateSpecification' => '<p>The launch template.</p>', 'LaunchTemplateOverrides$LaunchTemplateSpecification' => '<p>Provides a launch template for the specified instance type or set of instance requirements. For example, some instance types might require a launch template with a different AMI. If not provided, Amazon EC2 Auto Scaling uses the launch template that\\'s specified in the <code>LaunchTemplate</code> definition. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups-launch-template-overrides.html\">Specifying a different launch template for an instance type</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>. </p> <p>You can specify up to 20 launch templates per Auto Scaling group. The launch templates specified in the overrides and in the <code>LaunchTemplate</code> definition count towards this limit.</p>', 'UpdateAutoScalingGroupType$LaunchTemplate' => '<p>The launch template and version to use to specify the updates. If you specify <code>LaunchTemplate</code> in your update request, you can\\'t specify <code>LaunchConfigurationName</code> or <code>MixedInstancesPolicy</code>.</p>', ], ], 'LifecycleActionResult' => [ 'base' => NULL, 'refs' => [ 'CompleteLifecycleActionType$LifecycleActionResult' => '<p>The action for the group to take. You can specify either <code>CONTINUE</code> or <code>ABANDON</code>.</p>', 'LifecycleHook$DefaultResult' => '<p>The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs.</p> <p>Valid values: <code>CONTINUE</code> | <code>ABANDON</code> </p>', 'LifecycleHookSpecification$DefaultResult' => '<p>The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. The default value is <code>ABANDON</code>.</p> <p>Valid values: <code>CONTINUE</code> | <code>ABANDON</code> </p>', 'PutLifecycleHookType$DefaultResult' => '<p>The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. The default value is <code>ABANDON</code>.</p> <p>Valid values: <code>CONTINUE</code> | <code>ABANDON</code> </p>', ], ], 'LifecycleActionToken' => [ 'base' => NULL, 'refs' => [ 'CompleteLifecycleActionType$LifecycleActionToken' => '<p>A universally unique identifier (UUID) that identifies a specific lifecycle action associated with an instance. Amazon EC2 Auto Scaling sends this token to the notification target you specified when you created the lifecycle hook.</p>', 'RecordLifecycleActionHeartbeatType$LifecycleActionToken' => '<p>A token that uniquely identifies a specific lifecycle action associated with an instance. Amazon EC2 Auto Scaling sends this token to the notification target that you specified when you created the lifecycle hook.</p>', ], ], 'LifecycleHook' => [ 'base' => '<p>Describes a lifecycle hook. A lifecycle hook lets you create solutions that are aware of events in the Auto Scaling instance lifecycle, and then perform a custom action on instances when the corresponding lifecycle event occurs.</p>', 'refs' => [ 'LifecycleHooks$member' => NULL, ], ], 'LifecycleHookNames' => [ 'base' => NULL, 'refs' => [ 'DescribeLifecycleHooksType$LifecycleHookNames' => '<p>The names of one or more lifecycle hooks. If you omit this property, all lifecycle hooks are described.</p>', ], ], 'LifecycleHookSpecification' => [ 'base' => '<p>Describes information used to specify a lifecycle hook for an Auto Scaling group.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html\">Amazon EC2 Auto Scaling lifecycle hooks</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'refs' => [ 'LifecycleHookSpecifications$member' => NULL, ], ], 'LifecycleHookSpecifications' => [ 'base' => NULL, 'refs' => [ 'CreateAutoScalingGroupType$LifecycleHookSpecificationList' => '<p>One or more lifecycle hooks to add to the Auto Scaling group before instances are launched.</p>', ], ], 'LifecycleHooks' => [ 'base' => NULL, 'refs' => [ 'DescribeLifecycleHooksAnswer$LifecycleHooks' => '<p>The lifecycle hooks for the specified group.</p>', ], ], 'LifecycleState' => [ 'base' => NULL, 'refs' => [ 'Instance$LifecycleState' => '<p>A description of the current lifecycle state. The <code>Quarantined</code> state is not used. For information about lifecycle states, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroupLifecycle.html\">Instance lifecycle</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>. </p>', ], ], 'LifecycleTransition' => [ 'base' => NULL, 'refs' => [ 'LifecycleHook$LifecycleTransition' => '<p>The lifecycle transition.</p> <p>Valid values: <code>autoscaling:EC2_INSTANCE_LAUNCHING</code> | <code>autoscaling:EC2_INSTANCE_TERMINATING</code> </p>', 'LifecycleHookSpecification$LifecycleTransition' => '<p>The lifecycle transition. For Auto Scaling groups, there are two major lifecycle transitions.</p> <ul> <li> <p>To create a lifecycle hook for scale-out events, specify <code>autoscaling:EC2_INSTANCE_LAUNCHING</code>.</p> </li> <li> <p>To create a lifecycle hook for scale-in events, specify <code>autoscaling:EC2_INSTANCE_TERMINATING</code>.</p> </li> </ul>', 'PutLifecycleHookType$LifecycleTransition' => '<p>The lifecycle transition. For Auto Scaling groups, there are two major lifecycle transitions.</p> <ul> <li> <p>To create a lifecycle hook for scale-out events, specify <code>autoscaling:EC2_INSTANCE_LAUNCHING</code>.</p> </li> <li> <p>To create a lifecycle hook for scale-in events, specify <code>autoscaling:EC2_INSTANCE_TERMINATING</code>.</p> </li> </ul> <p>Required for new lifecycle hooks, but optional when updating existing hooks.</p>', ], ], 'LimitExceededFault' => [ 'base' => '<p>You have already reached a limit for your Amazon EC2 Auto Scaling resources (for example, Auto Scaling groups, launch configurations, or lifecycle hooks). For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeAccountLimits.html\">DescribeAccountLimits</a> in the <i>Amazon EC2 Auto Scaling API Reference</i>.</p>', 'refs' => [], ], 'LoadBalancerNames' => [ 'base' => NULL, 'refs' => [ 'AttachLoadBalancersType$LoadBalancerNames' => '<p>The names of the load balancers. You can specify up to 10 load balancers.</p>', 'AutoScalingGroup$LoadBalancerNames' => '<p>One or more load balancers associated with the group.</p>', 'CreateAutoScalingGroupType$LoadBalancerNames' => '<p>A list of Classic Load Balancers associated with this Auto Scaling group. For Application Load Balancers, Network Load Balancers, and Gateway Load Balancers, specify the <code>TargetGroupARNs</code> property instead.</p>', 'DetachLoadBalancersType$LoadBalancerNames' => '<p>The names of the load balancers. You can specify up to 10 load balancers.</p>', ], ], 'LoadBalancerState' => [ 'base' => '<p>Describes the state of a Classic Load Balancer.</p>', 'refs' => [ 'LoadBalancerStates$member' => NULL, ], ], 'LoadBalancerStates' => [ 'base' => NULL, 'refs' => [ 'DescribeLoadBalancersResponse$LoadBalancers' => '<p>The load balancers.</p>', ], ], 'LoadBalancerTargetGroupState' => [ 'base' => '<p>Describes the state of a target group.</p>', 'refs' => [ 'LoadBalancerTargetGroupStates$member' => NULL, ], ], 'LoadBalancerTargetGroupStates' => [ 'base' => NULL, 'refs' => [ 'DescribeLoadBalancerTargetGroupsResponse$LoadBalancerTargetGroups' => '<p>Information about the target groups.</p>', ], ], 'LoadForecast' => [ 'base' => '<p>A <code>GetPredictiveScalingForecast</code> call returns the load forecast for a predictive scaling policy. This structure includes the data points for that load forecast, along with the timestamps of those data points and the metric specification. </p>', 'refs' => [ 'LoadForecasts$member' => NULL, ], ], 'LoadForecasts' => [ 'base' => NULL, 'refs' => [ 'GetPredictiveScalingForecastAnswer$LoadForecast' => '<p>The load forecast.</p>', ], ], 'LocalStorage' => [ 'base' => NULL, 'refs' => [ 'InstanceRequirements$LocalStorage' => '<p>Indicates whether instance types with instance store volumes are included, excluded, or required. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html\">Amazon EC2 instance store</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> <p>Default: <code>included</code> </p>', ], ], 'LocalStorageType' => [ 'base' => NULL, 'refs' => [ 'LocalStorageTypes$member' => NULL, ], ], 'LocalStorageTypes' => [ 'base' => NULL, 'refs' => [ 'InstanceRequirements$LocalStorageTypes' => '<p>Indicates the type of local storage that is required.</p> <ul> <li> <p>For instance types with hard disk drive (HDD) storage, specify <code>hdd</code>.</p> </li> <li> <p>For instance types with solid state drive (SSD) storage, specify <code>ssd</code>.</p> </li> </ul> <p>Default: Any local storage type</p>', ], ], 'MaxGroupPreparedCapacity' => [ 'base' => NULL, 'refs' => [ 'PutWarmPoolType$MaxGroupPreparedCapacity' => '<p>Specifies the maximum number of instances that are allowed to be in the warm pool or in any state except <code>Terminated</code> for the Auto Scaling group. This is an optional property. Specify it only if you do not want the warm pool size to be determined by the difference between the group\\'s maximum capacity and its desired capacity. </p> <important> <p>If a value for <code>MaxGroupPreparedCapacity</code> is not specified, Amazon EC2 Auto Scaling launches and maintains the difference between the group\\'s maximum capacity and its desired capacity. If you specify a value for <code>MaxGroupPreparedCapacity</code>, Amazon EC2 Auto Scaling uses the difference between the <code>MaxGroupPreparedCapacity</code> and the desired capacity instead. </p> <p>The size of the warm pool is dynamic. Only when <code>MaxGroupPreparedCapacity</code> and <code>MinSize</code> are set to the same value does the warm pool have an absolute size.</p> </important> <p>If the desired capacity of the Auto Scaling group is higher than the <code>MaxGroupPreparedCapacity</code>, the capacity of the warm pool is 0, unless you specify a value for <code>MinSize</code>. To remove a value that you previously set, include the property but specify -1 for the value. </p>', 'WarmPoolConfiguration$MaxGroupPreparedCapacity' => '<p>The maximum number of instances that are allowed to be in the warm pool or in any state except <code>Terminated</code> for the Auto Scaling group.</p>', ], ], 'MaxInstanceLifetime' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$MaxInstanceLifetime' => '<p>The maximum amount of time, in seconds, that an instance can be in service.</p> <p>Valid Range: Minimum value of 0.</p>', 'CreateAutoScalingGroupType$MaxInstanceLifetime' => '<p>The maximum amount of time, in seconds, that an instance can be in service. The default is null. If specified, the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day). For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html\">Replacing Auto Scaling instances based on maximum instance lifetime</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'UpdateAutoScalingGroupType$MaxInstanceLifetime' => '<p>The maximum amount of time, in seconds, that an instance can be in service. The default is null. If specified, the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day). To clear a previously set value, specify a new value of 0. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html\">Replacing Auto Scaling instances based on maximum instance lifetime</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', ], ], 'MaxNumberOfAutoScalingGroups' => [ 'base' => NULL, 'refs' => [ 'DescribeAccountLimitsAnswer$MaxNumberOfAutoScalingGroups' => '<p>The maximum number of groups allowed for your account. The default is 200 groups per Region.</p>', ], ], 'MaxNumberOfLaunchConfigurations' => [ 'base' => NULL, 'refs' => [ 'DescribeAccountLimitsAnswer$MaxNumberOfLaunchConfigurations' => '<p>The maximum number of launch configurations allowed for your account. The default is 200 launch configurations per Region.</p>', ], ], 'MaxRecords' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroupNamesType$MaxRecords' => '<p>The maximum number of items to return with this call. The default value is <code>50</code> and the maximum value is <code>100</code>.</p>', 'DescribeAutoScalingInstancesType$MaxRecords' => '<p>The maximum number of items to return with this call. The default value is <code>50</code> and the maximum value is <code>50</code>.</p>', 'DescribeInstanceRefreshesType$MaxRecords' => '<p>The maximum number of items to return with this call. The default value is <code>50</code> and the maximum value is <code>100</code>.</p>', 'DescribeLoadBalancerTargetGroupsRequest$MaxRecords' => '<p>The maximum number of items to return with this call. The default value is <code>100</code> and the maximum value is <code>100</code>.</p>', 'DescribeLoadBalancersRequest$MaxRecords' => '<p>The maximum number of items to return with this call. The default value is <code>100</code> and the maximum value is <code>100</code>.</p>', 'DescribeNotificationConfigurationsType$MaxRecords' => '<p>The maximum number of items to return with this call. The default value is <code>50</code> and the maximum value is <code>100</code>.</p>', 'DescribePoliciesType$MaxRecords' => '<p>The maximum number of items to be returned with each call. The default value is <code>50</code> and the maximum value is <code>100</code>.</p>', 'DescribeScalingActivitiesType$MaxRecords' => '<p>The maximum number of items to return with this call. The default value is <code>100</code> and the maximum value is <code>100</code>.</p>', 'DescribeScheduledActionsType$MaxRecords' => '<p>The maximum number of items to return with this call. The default value is <code>50</code> and the maximum value is <code>100</code>.</p>', 'DescribeTagsType$MaxRecords' => '<p>The maximum number of items to return with this call. The default value is <code>50</code> and the maximum value is <code>100</code>.</p>', 'DescribeTrafficSourcesRequest$MaxRecords' => '<p>The maximum number of items to return with this call. The maximum value is <code>50</code>.</p>', 'DescribeWarmPoolType$MaxRecords' => '<p>The maximum number of instances to return with this call. The maximum value is <code>50</code>.</p>', 'LaunchConfigurationNamesType$MaxRecords' => '<p>The maximum number of items to return with this call. The default value is <code>50</code> and the maximum value is <code>100</code>.</p>', ], ], 'MemoryGiBPerVCpuRequest' => [ 'base' => '<p>Specifies the minimum and maximum for the <code>MemoryGiBPerVCpu</code> object when you specify <a>InstanceRequirements</a> for an Auto Scaling group.</p>', 'refs' => [ 'InstanceRequirements$MemoryGiBPerVCpu' => '<p>The minimum and maximum amount of memory per vCPU for an instance type, in GiB.</p> <p>Default: No minimum or maximum limits</p>', ], ], 'MemoryMiBRequest' => [ 'base' => '<p>Specifies the minimum and maximum for the <code>MemoryMiB</code> object when you specify <a>InstanceRequirements</a> for an Auto Scaling group.</p>', 'refs' => [ 'InstanceRequirements$MemoryMiB' => '<p>The minimum and maximum instance memory size for an instance type, in MiB.</p>', ], ], 'Metric' => [ 'base' => '<p>Represents a specific metric. </p>', 'refs' => [ 'MetricStat$Metric' => '<p>The CloudWatch metric to return, including the metric name, namespace, and dimensions. To get the exact metric name, namespace, and dimensions, inspect the <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Metric.html\">Metric</a> object that is returned by a call to <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html\">ListMetrics</a>.</p>', 'TargetTrackingMetricStat$Metric' => '<p>The metric to use.</p>', ], ], 'MetricCollectionType' => [ 'base' => '<p>Describes a metric.</p>', 'refs' => [ 'MetricCollectionTypes$member' => NULL, ], ], 'MetricCollectionTypes' => [ 'base' => NULL, 'refs' => [ 'DescribeMetricCollectionTypesAnswer$Metrics' => '<p>The metrics.</p>', ], ], 'MetricDataQueries' => [ 'base' => NULL, 'refs' => [ 'PredictiveScalingCustomizedCapacityMetric$MetricDataQueries' => '<p>One or more metric data queries to provide the data points for a capacity metric. Use multiple metric data queries only if you are performing a math expression on returned data. </p>', 'PredictiveScalingCustomizedLoadMetric$MetricDataQueries' => '<p>One or more metric data queries to provide the data points for a load metric. Use multiple metric data queries only if you are performing a math expression on returned data. </p>', 'PredictiveScalingCustomizedScalingMetric$MetricDataQueries' => '<p>One or more metric data queries to provide the data points for a scaling metric. Use multiple metric data queries only if you are performing a math expression on returned data. </p>', ], ], 'MetricDataQuery' => [ 'base' => '<p>The metric data to return. Also defines whether this call is returning data for one metric only, or whether it is performing a math expression on the values of returned metric statistics to create a new time series. A time series is a series of data points, each of which is associated with a timestamp.</p> <p>For more information and examples, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/predictive-scaling-customized-metric-specification.html\">Advanced predictive scaling policy configurations using custom metrics</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'refs' => [ 'MetricDataQueries$member' => NULL, ], ], 'MetricDimension' => [ 'base' => '<p>Describes the dimension of a metric.</p>', 'refs' => [ 'MetricDimensions$member' => NULL, ], ], 'MetricDimensionName' => [ 'base' => NULL, 'refs' => [ 'MetricDimension$Name' => '<p>The name of the dimension.</p>', ], ], 'MetricDimensionValue' => [ 'base' => NULL, 'refs' => [ 'MetricDimension$Value' => '<p>The value of the dimension.</p>', ], ], 'MetricDimensions' => [ 'base' => NULL, 'refs' => [ 'CustomizedMetricSpecification$Dimensions' => '<p>The dimensions of the metric.</p> <p>Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.</p>', 'Metric$Dimensions' => '<p>The dimensions for the metric. For the list of available dimensions, see the Amazon Web Services documentation available from the table in <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html\">Amazon Web Services services that publish CloudWatch metrics </a> in the <i>Amazon CloudWatch User Guide</i>. </p> <p>Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.</p>', ], ], 'MetricGranularityType' => [ 'base' => '<p>Describes a granularity of a metric.</p>', 'refs' => [ 'MetricGranularityTypes$member' => NULL, ], ], 'MetricGranularityTypes' => [ 'base' => NULL, 'refs' => [ 'DescribeMetricCollectionTypesAnswer$Granularities' => '<p>The granularities for the metrics.</p>', ], ], 'MetricName' => [ 'base' => NULL, 'refs' => [ 'CustomizedMetricSpecification$MetricName' => '<p>The name of the metric. To get the exact metric name, namespace, and dimensions, inspect the <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Metric.html\">Metric</a> object that is returned by a call to <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html\">ListMetrics</a>.</p>', 'Metric$MetricName' => '<p>The name of the metric.</p>', ], ], 'MetricNamespace' => [ 'base' => NULL, 'refs' => [ 'CustomizedMetricSpecification$Namespace' => '<p>The namespace of the metric.</p>', 'Metric$Namespace' => '<p>The namespace of the metric. For more information, see the table in <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html\">Amazon Web Services services that publish CloudWatch metrics </a> in the <i>Amazon CloudWatch User Guide</i>.</p>', ], ], 'MetricScale' => [ 'base' => NULL, 'refs' => [ 'ExecutePolicyType$MetricValue' => '<p>The metric value to compare to <code>BreachThreshold</code>. This enables you to execute a policy of type <code>StepScaling</code> and determine which step adjustment to use. For example, if the breach threshold is 50 and you want to use a step adjustment with a lower bound of 0 and an upper bound of 10, you can set the metric value to 59.</p> <p>If you specify a metric value that doesn\\'t correspond to a step adjustment for the policy, the call returns an error.</p> <p>Required if the policy type is <code>StepScaling</code> and not supported otherwise.</p>', 'ExecutePolicyType$BreachThreshold' => '<p>The breach threshold for the alarm.</p> <p>Required if the policy type is <code>StepScaling</code> and not supported otherwise.</p>', 'PredictiveScalingForecastValues$member' => NULL, 'PredictiveScalingMetricSpecification$TargetValue' => '<p>Specifies the target utilization.</p> <note> <p>Some metrics are based on a count instead of a percentage, such as the request count for an Application Load Balancer or the number of messages in an SQS queue. If the scaling policy specifies one of these metrics, specify the target utilization as the optimal average request or message count per instance during any one-minute interval. </p> </note>', 'StepAdjustment$MetricIntervalLowerBound' => '<p>The lower bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the lower bound is inclusive (the metric must be greater than or equal to the threshold plus the lower bound). Otherwise, it is exclusive (the metric must be greater than the threshold plus the lower bound). A null value indicates negative infinity.</p>', 'StepAdjustment$MetricIntervalUpperBound' => '<p>The upper bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the upper bound is exclusive (the metric must be less than the threshold plus the upper bound). Otherwise, it is inclusive (the metric must be less than or equal to the threshold plus the upper bound). A null value indicates positive infinity.</p> <p>The upper bound must be greater than the lower bound.</p>', 'TargetTrackingConfiguration$TargetValue' => '<p>The target value for the metric.</p> <note> <p>Some metrics are based on a count instead of a percentage, such as the request count for an Application Load Balancer or the number of messages in an SQS queue. If the scaling policy specifies one of these metrics, specify the target utilization as the optimal average request or message count per instance during any one-minute interval. </p> </note>', ], ], 'MetricStat' => [ 'base' => '<p>This structure defines the CloudWatch metric to return, along with the statistic, period, and unit.</p> <p>For more information about the CloudWatch terminology below, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html\">Amazon CloudWatch concepts</a> in the <i>Amazon CloudWatch User Guide</i>.</p>', 'refs' => [ 'MetricDataQuery$MetricStat' => '<p>Information about the metric data to return.</p> <p>Conditional: Within each <code>MetricDataQuery</code> object, you must specify either <code>Expression</code> or <code>MetricStat</code>, but not both.</p>', ], ], 'MetricStatistic' => [ 'base' => NULL, 'refs' => [ 'CustomizedMetricSpecification$Statistic' => '<p>The statistic of the metric.</p>', ], ], 'MetricType' => [ 'base' => NULL, 'refs' => [ 'PredefinedMetricSpecification$PredefinedMetricType' => '<p>The metric type. The following predefined metrics are available:</p> <ul> <li> <p> <code>ASGAverageCPUUtilization</code> - Average CPU utilization of the Auto Scaling group.</p> </li> <li> <p> <code>ASGAverageNetworkIn</code> - Average number of bytes received on all network interfaces by the Auto Scaling group.</p> </li> <li> <p> <code>ASGAverageNetworkOut</code> - Average number of bytes sent out on all network interfaces by the Auto Scaling group.</p> </li> <li> <p> <code>ALBRequestCountPerTarget</code> - Average Application Load Balancer request count per target for your Auto Scaling group.</p> </li> </ul>', ], ], 'MetricUnit' => [ 'base' => NULL, 'refs' => [ 'CustomizedMetricSpecification$Unit' => '<p>The unit of the metric. For a complete list of the units that CloudWatch supports, see the <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html\">MetricDatum</a> data type in the <i>Amazon CloudWatch API Reference</i>.</p>', 'MetricStat$Unit' => '<p>The unit to use for the returned data points. For a complete list of the units that CloudWatch supports, see the <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html\">MetricDatum</a> data type in the <i>Amazon CloudWatch API Reference</i>.</p>', 'TargetTrackingMetricStat$Unit' => '<p>The unit to use for the returned data points. For a complete list of the units that CloudWatch supports, see the <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html\">MetricDatum</a> data type in the <i>Amazon CloudWatch API Reference</i>.</p>', ], ], 'Metrics' => [ 'base' => NULL, 'refs' => [ 'DisableMetricsCollectionQuery$Metrics' => '<p>Identifies the metrics to disable.</p> <p>You can specify one or more of the following metrics:</p> <ul> <li> <p> <code>GroupMinSize</code> </p> </li> <li> <p> <code>GroupMaxSize</code> </p> </li> <li> <p> <code>GroupDesiredCapacity</code> </p> </li> <li> <p> <code>GroupInServiceInstances</code> </p> </li> <li> <p> <code>GroupPendingInstances</code> </p> </li> <li> <p> <code>GroupStandbyInstances</code> </p> </li> <li> <p> <code>GroupTerminatingInstances</code> </p> </li> <li> <p> <code>GroupTotalInstances</code> </p> </li> <li> <p> <code>GroupInServiceCapacity</code> </p> </li> <li> <p> <code>GroupPendingCapacity</code> </p> </li> <li> <p> <code>GroupStandbyCapacity</code> </p> </li> <li> <p> <code>GroupTerminatingCapacity</code> </p> </li> <li> <p> <code>GroupTotalCapacity</code> </p> </li> <li> <p> <code>WarmPoolDesiredCapacity</code> </p> </li> <li> <p> <code>WarmPoolWarmedCapacity</code> </p> </li> <li> <p> <code>WarmPoolPendingCapacity</code> </p> </li> <li> <p> <code>WarmPoolTerminatingCapacity</code> </p> </li> <li> <p> <code>WarmPoolTotalCapacity</code> </p> </li> <li> <p> <code>GroupAndWarmPoolDesiredCapacity</code> </p> </li> <li> <p> <code>GroupAndWarmPoolTotalCapacity</code> </p> </li> </ul> <p>If you omit this property, all metrics are disabled.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-cloudwatch-monitoring.html#as-group-metrics\">Auto Scaling group metrics</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'EnableMetricsCollectionQuery$Metrics' => '<p>Identifies the metrics to enable.</p> <p>You can specify one or more of the following metrics:</p> <ul> <li> <p> <code>GroupMinSize</code> </p> </li> <li> <p> <code>GroupMaxSize</code> </p> </li> <li> <p> <code>GroupDesiredCapacity</code> </p> </li> <li> <p> <code>GroupInServiceInstances</code> </p> </li> <li> <p> <code>GroupPendingInstances</code> </p> </li> <li> <p> <code>GroupStandbyInstances</code> </p> </li> <li> <p> <code>GroupTerminatingInstances</code> </p> </li> <li> <p> <code>GroupTotalInstances</code> </p> </li> <li> <p> <code>GroupInServiceCapacity</code> </p> </li> <li> <p> <code>GroupPendingCapacity</code> </p> </li> <li> <p> <code>GroupStandbyCapacity</code> </p> </li> <li> <p> <code>GroupTerminatingCapacity</code> </p> </li> <li> <p> <code>GroupTotalCapacity</code> </p> </li> <li> <p> <code>WarmPoolDesiredCapacity</code> </p> </li> <li> <p> <code>WarmPoolWarmedCapacity</code> </p> </li> <li> <p> <code>WarmPoolPendingCapacity</code> </p> </li> <li> <p> <code>WarmPoolTerminatingCapacity</code> </p> </li> <li> <p> <code>WarmPoolTotalCapacity</code> </p> </li> <li> <p> <code>GroupAndWarmPoolDesiredCapacity</code> </p> </li> <li> <p> <code>GroupAndWarmPoolTotalCapacity</code> </p> </li> </ul> <p>If you specify <code>Granularity</code> and don\\'t specify any metrics, all metrics are enabled.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-cloudwatch-monitoring.html#as-group-metrics\">Auto Scaling group metrics</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', ], ], 'MinAdjustmentMagnitude' => [ 'base' => NULL, 'refs' => [ 'PutScalingPolicyType$MinAdjustmentMagnitude' => '<p>The minimum value to scale by when the adjustment type is <code>PercentChangeInCapacity</code>. For example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a <code>MinAdjustmentMagnitude</code> of 2. If the group has 4 instances and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a <code>MinAdjustmentMagnitude</code> of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances.</p> <p>Valid only if the policy type is <code>StepScaling</code> or <code>SimpleScaling</code>. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment\">Scaling adjustment types</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <note> <p>Some Auto Scaling groups use instance weights. In this case, set the <code>MinAdjustmentMagnitude</code> to a value that is at least as large as your largest instance weight.</p> </note>', 'ScalingPolicy$MinAdjustmentMagnitude' => '<p>The minimum value to scale by when the adjustment type is <code>PercentChangeInCapacity</code>. </p>', ], ], 'MinAdjustmentStep' => [ 'base' => NULL, 'refs' => [ 'PutScalingPolicyType$MinAdjustmentStep' => '<p>Available for backward compatibility. Use <code>MinAdjustmentMagnitude</code> instead.</p>', 'ScalingPolicy$MinAdjustmentStep' => '<p>Available for backward compatibility. Use <code>MinAdjustmentMagnitude</code> instead.</p>', ], ], 'MixedInstanceSpotPrice' => [ 'base' => NULL, 'refs' => [ 'InstancesDistribution$SpotMaxPrice' => '<p>The maximum price per unit hour that you are willing to pay for a Spot Instance. If your maximum price is lower than the Spot price for the instance types that you selected, your Spot Instances are not launched. We do not recommend specifying a maximum price because it can lead to increased interruptions. When Spot Instances launch, you pay the current Spot price. To remove a maximum price that you previously set, include the property but specify an empty string (\"\") for the value.</p> <important> <p>If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify one.</p> </important> <p>Valid Range: Minimum value of 0.001</p>', ], ], 'MixedInstancesPolicy' => [ 'base' => '<p>Use this structure to launch multiple instance types and On-Demand Instances and Spot Instances within a single Auto Scaling group.</p> <p>A mixed instances policy contains information that Amazon EC2 Auto Scaling can use to launch instances and help optimize your costs. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html\">Auto Scaling groups with multiple instance types and purchase options</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'refs' => [ 'AutoScalingGroup$MixedInstancesPolicy' => '<p>The mixed instances policy for the group.</p>', 'CreateAutoScalingGroupType$MixedInstancesPolicy' => '<p>The mixed instances policy. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html\">Auto Scaling groups with multiple instance types and purchase options</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'DesiredConfiguration$MixedInstancesPolicy' => '<p>Use this structure to launch multiple instance types and On-Demand Instances and Spot Instances within a single Auto Scaling group.</p> <p>A mixed instances policy contains information that Amazon EC2 Auto Scaling can use to launch instances and help optimize your costs. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html\">Auto Scaling groups with multiple instance types and purchase options</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'UpdateAutoScalingGroupType$MixedInstancesPolicy' => '<p>The mixed instances policy. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html\">Auto Scaling groups with multiple instance types and purchase options</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', ], ], 'MonitoringEnabled' => [ 'base' => NULL, 'refs' => [ 'InstanceMonitoring$Enabled' => '<p>If <code>true</code>, detailed monitoring is enabled. Otherwise, basic monitoring is enabled.</p>', ], ], 'NetworkBandwidthGbpsRequest' => [ 'base' => '<p>Specifies the minimum and maximum for the <code>NetworkBandwidthGbps</code> object when you specify <a>InstanceRequirements</a> for an Auto Scaling group.</p> <note> <p>Setting the minimum bandwidth does not guarantee that your instance will achieve the minimum bandwidth. Amazon EC2 will identify instance types that support the specified minimum bandwidth, but the actual bandwidth of your instance might go below the specified minimum at times. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-network-bandwidth.html#available-instance-bandwidth\">Available instance bandwidth</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> </note>', 'refs' => [ 'InstanceRequirements$NetworkBandwidthGbps' => '<p>The minimum and maximum amount of network bandwidth, in gigabits per second (Gbps).</p> <p>Default: No minimum or maximum limits</p>', ], ], 'NetworkInterfaceCountRequest' => [ 'base' => '<p>Specifies the minimum and maximum for the <code>NetworkInterfaceCount</code> object when you specify <a>InstanceRequirements</a> for an Auto Scaling group.</p>', 'refs' => [ 'InstanceRequirements$NetworkInterfaceCount' => '<p>The minimum and maximum number of network interfaces for an instance type.</p> <p>Default: No minimum or maximum limits</p>', ], ], 'NoDevice' => [ 'base' => NULL, 'refs' => [ 'BlockDeviceMapping$NoDevice' => '<p>Setting this value to <code>true</code> prevents a volume that is included in the block device mapping of the AMI from being mapped to the specified device name at launch.</p> <p>If <code>NoDevice</code> is <code>true</code> for the root device, instances might fail the EC2 health check. In that case, Amazon EC2 Auto Scaling launches replacement instances.</p>', ], ], 'NonZeroIntPercent' => [ 'base' => NULL, 'refs' => [ 'CheckpointPercentages$member' => NULL, ], ], 'NotificationConfiguration' => [ 'base' => '<p>Describes a notification.</p>', 'refs' => [ 'NotificationConfigurations$member' => NULL, ], ], 'NotificationConfigurations' => [ 'base' => NULL, 'refs' => [ 'DescribeNotificationConfigurationsAnswer$NotificationConfigurations' => '<p>The notification configurations.</p>', ], ], 'NotificationTargetResourceName' => [ 'base' => NULL, 'refs' => [ 'LifecycleHook$NotificationTargetARN' => '<p>The ARN of the target that Amazon EC2 Auto Scaling sends notifications to when an instance is in a wait state for the lifecycle hook.</p>', 'LifecycleHookSpecification$NotificationTargetARN' => '<p>The Amazon Resource Name (ARN) of the notification target that Amazon EC2 Auto Scaling sends notifications to when an instance is in a wait state for the lifecycle hook. You can specify an Amazon SNS topic or an Amazon SQS queue.</p>', 'PutLifecycleHookType$NotificationTargetARN' => '<p>The Amazon Resource Name (ARN) of the notification target that Amazon EC2 Auto Scaling uses to notify you when an instance is in a wait state for the lifecycle hook. You can specify either an Amazon SNS topic or an Amazon SQS queue.</p> <p>If you specify an empty string, this overrides the current ARN.</p> <p>This operation uses the JSON format when sending notifications to an Amazon SQS queue, and an email key-value pair format when sending notifications to an Amazon SNS topic.</p> <p>When you specify a notification target, Amazon EC2 Auto Scaling sends it a test message. Test messages contain the following additional key-value pair: <code>\"Event\": \"autoscaling:TEST_NOTIFICATION\"</code>.</p>', ], ], 'NullableBoolean' => [ 'base' => NULL, 'refs' => [ 'InstanceRequirements$RequireHibernateSupport' => '<p>Indicates whether instance types must provide On-Demand Instance hibernation support.</p> <p>Default: <code>false</code> </p>', ], ], 'NullablePositiveDouble' => [ 'base' => NULL, 'refs' => [ 'MemoryGiBPerVCpuRequest$Min' => '<p>The memory minimum in GiB.</p>', 'MemoryGiBPerVCpuRequest$Max' => '<p>The memory maximum in GiB.</p>', 'NetworkBandwidthGbpsRequest$Min' => '<p>The minimum amount of network bandwidth, in gigabits per second (Gbps).</p>', 'NetworkBandwidthGbpsRequest$Max' => '<p>The maximum amount of network bandwidth, in gigabits per second (Gbps).</p>', 'TotalLocalStorageGBRequest$Min' => '<p>The storage minimum in GB.</p>', 'TotalLocalStorageGBRequest$Max' => '<p>The storage maximum in GB.</p>', ], ], 'NullablePositiveInteger' => [ 'base' => NULL, 'refs' => [ 'AcceleratorCountRequest$Min' => '<p>The minimum value.</p>', 'AcceleratorCountRequest$Max' => '<p>The maximum value.</p>', 'AcceleratorTotalMemoryMiBRequest$Min' => '<p>The memory minimum in MiB.</p>', 'AcceleratorTotalMemoryMiBRequest$Max' => '<p>The memory maximum in MiB.</p>', 'BaselineEbsBandwidthMbpsRequest$Min' => '<p>The minimum value in Mbps.</p>', 'BaselineEbsBandwidthMbpsRequest$Max' => '<p>The maximum value in Mbps.</p>', 'InstanceRequirements$SpotMaxPricePercentageOverLowestPrice' => '<p>The price protection threshold for Spot Instances. This is the maximum you\u00e2\u20ac\u2122ll pay for a Spot Instance, expressed as a percentage higher than the least expensive current generation M, C, or R instance type with your specified attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we will exclude instance types whose price is higher than your threshold. The parameter accepts an integer, which Amazon EC2 Auto Scaling interprets as a percentage. To turn off price protection, specify a high value, such as <code>999999</code>. </p> <p>If you set <code>DesiredCapacityType</code> to <code>vcpu</code> or <code>memory-mib</code>, the price protection threshold is applied based on the per vCPU or per memory price instead of the per instance price. </p> <p>Default: <code>100</code> </p>', 'InstanceRequirements$OnDemandMaxPricePercentageOverLowestPrice' => '<p>The price protection threshold for On-Demand Instances. This is the maximum you\u00e2\u20ac\u2122ll pay for an On-Demand Instance, expressed as a percentage higher than the least expensive current generation M, C, or R instance type with your specified attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we will exclude instance types whose price is higher than your threshold. The parameter accepts an integer, which Amazon EC2 Auto Scaling interprets as a percentage. To turn off price protection, specify a high value, such as <code>999999</code>. </p> <p>If you set <code>DesiredCapacityType</code> to <code>vcpu</code> or <code>memory-mib</code>, the price protection threshold is applied based on the per vCPU or per memory price instead of the per instance price. </p> <p>Default: <code>20</code> </p>', 'MemoryMiBRequest$Min' => '<p>The memory minimum in MiB.</p>', 'MemoryMiBRequest$Max' => '<p>The memory maximum in MiB.</p>', 'NetworkInterfaceCountRequest$Min' => '<p>The minimum number of network interfaces.</p>', 'NetworkInterfaceCountRequest$Max' => '<p>The maximum number of network interfaces.</p>', 'VCpuCountRequest$Min' => '<p>The minimum number of vCPUs.</p>', 'VCpuCountRequest$Max' => '<p>The maximum number of vCPUs.</p>', ], ], 'NumberOfAutoScalingGroups' => [ 'base' => NULL, 'refs' => [ 'DescribeAccountLimitsAnswer$NumberOfAutoScalingGroups' => '<p>The current number of groups for your account.</p>', ], ], 'NumberOfLaunchConfigurations' => [ 'base' => NULL, 'refs' => [ 'DescribeAccountLimitsAnswer$NumberOfLaunchConfigurations' => '<p>The current number of launch configurations for your account.</p>', ], ], 'OnDemandBaseCapacity' => [ 'base' => NULL, 'refs' => [ 'InstancesDistribution$OnDemandBaseCapacity' => '<p>The minimum amount of the Auto Scaling group\\'s capacity that must be fulfilled by On-Demand Instances. This base portion is launched first as your group scales.</p> <p>This number has the same unit of measurement as the group\\'s desired capacity. If you change the default unit of measurement (number of instances) by specifying weighted capacity values in your launch template overrides list, or by changing the default desired capacity type setting of the group, you must specify this number using the same unit of measurement.</p> <p>Default: 0</p>', ], ], 'OnDemandPercentageAboveBaseCapacity' => [ 'base' => NULL, 'refs' => [ 'InstancesDistribution$OnDemandPercentageAboveBaseCapacity' => '<p>Controls the percentages of On-Demand Instances and Spot Instances for your additional capacity beyond <code>OnDemandBaseCapacity</code>. Expressed as a number (for example, 20 specifies 20% On-Demand Instances, 80% Spot Instances). If set to 100, only On-Demand Instances are used.</p> <p>Default: 100</p>', ], ], 'Overrides' => [ 'base' => NULL, 'refs' => [ 'LaunchTemplate$Overrides' => '<p>Any properties that you specify override the same properties in the launch template.</p>', ], ], 'PoliciesType' => [ 'base' => NULL, 'refs' => [], ], 'PolicyARNType' => [ 'base' => '<p>Contains the output of PutScalingPolicy.</p>', 'refs' => [], ], 'PolicyIncrement' => [ 'base' => NULL, 'refs' => [ 'PutScalingPolicyType$ScalingAdjustment' => '<p>The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity. For exact capacity, you must specify a positive value.</p> <p>Required if the policy type is <code>SimpleScaling</code>. (Not used with any other policy type.) </p>', 'ScalingPolicy$ScalingAdjustment' => '<p>The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity.</p>', 'StepAdjustment$ScalingAdjustment' => '<p>The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity.</p> <p>The amount by which to scale. The adjustment is based on the value that you specified in the <code>AdjustmentType</code> property (either an absolute number or a percentage). A positive value adds to the current capacity and a negative number subtracts from the current capacity. </p>', ], ], 'PolicyNames' => [ 'base' => NULL, 'refs' => [ 'DescribePoliciesType$PolicyNames' => '<p>The names of one or more policies. If you omit this property, all policies are described. If a group name is provided, the results are limited to that group. If you specify an unknown policy name, it is ignored with no error.</p> <p>Array Members: Maximum number of 50 items.</p>', ], ], 'PolicyTypes' => [ 'base' => NULL, 'refs' => [ 'DescribePoliciesType$PolicyTypes' => '<p>One or more policy types. The valid values are <code>SimpleScaling</code>, <code>StepScaling</code>, <code>TargetTrackingScaling</code>, and <code>PredictiveScaling</code>.</p>', ], ], 'PredefinedLoadMetricType' => [ 'base' => NULL, 'refs' => [ 'PredictiveScalingPredefinedLoadMetric$PredefinedMetricType' => '<p>The metric type.</p>', ], ], 'PredefinedMetricPairType' => [ 'base' => NULL, 'refs' => [ 'PredictiveScalingPredefinedMetricPair$PredefinedMetricType' => '<p>Indicates which metrics to use. There are two different types of metrics for each metric type: one is a load metric and one is a scaling metric. For example, if the metric type is <code>ASGCPUUtilization</code>, the Auto Scaling group\\'s total CPU metric is used as the load metric, and the average CPU metric is used for the scaling metric.</p>', ], ], 'PredefinedMetricSpecification' => [ 'base' => '<p>Represents a predefined metric for a target tracking scaling policy to use with Amazon EC2 Auto Scaling.</p>', 'refs' => [ 'TargetTrackingConfiguration$PredefinedMetricSpecification' => '<p>A predefined metric. You must specify either a predefined metric or a customized metric.</p>', ], ], 'PredefinedScalingMetricType' => [ 'base' => NULL, 'refs' => [ 'PredictiveScalingPredefinedScalingMetric$PredefinedMetricType' => '<p>The metric type.</p>', ], ], 'PredictiveScalingConfiguration' => [ 'base' => '<p>Represents a predictive scaling policy configuration to use with Amazon EC2 Auto Scaling.</p>', 'refs' => [ 'PutScalingPolicyType$PredictiveScalingConfiguration' => '<p>A predictive scaling policy. Provides support for predefined and custom metrics.</p> <p>Predefined metrics include CPU utilization, network in/out, and the Application Load Balancer request count.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_PredictiveScalingConfiguration.html\">PredictiveScalingConfiguration</a> in the <i>Amazon EC2 Auto Scaling API Reference</i>.</p> <p>Required if the policy type is <code>PredictiveScaling</code>.</p>', 'ScalingPolicy$PredictiveScalingConfiguration' => '<p>A predictive scaling policy.</p>', ], ], 'PredictiveScalingCustomizedCapacityMetric' => [ 'base' => '<p>Describes a customized capacity metric for a predictive scaling policy.</p>', 'refs' => [ 'PredictiveScalingMetricSpecification$CustomizedCapacityMetricSpecification' => '<p>The customized capacity metric specification.</p>', ], ], 'PredictiveScalingCustomizedLoadMetric' => [ 'base' => '<p>Describes a custom load metric for a predictive scaling policy.</p>', 'refs' => [ 'PredictiveScalingMetricSpecification$CustomizedLoadMetricSpecification' => '<p>The customized load metric specification.</p>', ], ], 'PredictiveScalingCustomizedScalingMetric' => [ 'base' => '<p>Describes a custom scaling metric for a predictive scaling policy.</p>', 'refs' => [ 'PredictiveScalingMetricSpecification$CustomizedScalingMetricSpecification' => '<p>The customized scaling metric specification.</p>', ], ], 'PredictiveScalingForecastTimestamps' => [ 'base' => NULL, 'refs' => [ 'CapacityForecast$Timestamps' => '<p>The timestamps for the data points, in UTC format.</p>', 'LoadForecast$Timestamps' => '<p>The timestamps for the data points, in UTC format.</p>', ], ], 'PredictiveScalingForecastValues' => [ 'base' => NULL, 'refs' => [ 'CapacityForecast$Values' => '<p>The values of the data points.</p>', 'LoadForecast$Values' => '<p>The values of the data points.</p>', ], ], 'PredictiveScalingMaxCapacityBreachBehavior' => [ 'base' => NULL, 'refs' => [ 'PredictiveScalingConfiguration$MaxCapacityBreachBehavior' => '<p>Defines the behavior that should be applied if the forecast capacity approaches or exceeds the maximum capacity of the Auto Scaling group. Defaults to <code>HonorMaxCapacity</code> if not specified.</p> <p>The following are possible values:</p> <ul> <li> <p> <code>HonorMaxCapacity</code> - Amazon EC2 Auto Scaling cannot scale out capacity higher than the maximum capacity. The maximum capacity is enforced as a hard limit. </p> </li> <li> <p> <code>IncreaseMaxCapacity</code> - Amazon EC2 Auto Scaling can scale out capacity higher than the maximum capacity when the forecast capacity is close to or exceeds the maximum capacity. The upper limit is determined by the forecasted capacity and the value for <code>MaxCapacityBuffer</code>.</p> </li> </ul>', ], ], 'PredictiveScalingMaxCapacityBuffer' => [ 'base' => NULL, 'refs' => [ 'PredictiveScalingConfiguration$MaxCapacityBuffer' => '<p>The size of the capacity buffer to use when the forecast capacity is close to or exceeds the maximum capacity. The value is specified as a percentage relative to the forecast capacity. For example, if the buffer is 10, this means a 10 percent buffer, such that if the forecast capacity is 50, and the maximum capacity is 40, then the effective maximum capacity is 55.</p> <p>If set to 0, Amazon EC2 Auto Scaling may scale capacity higher than the maximum capacity to equal but not exceed forecast capacity. </p> <p>Required if the <code>MaxCapacityBreachBehavior</code> property is set to <code>IncreaseMaxCapacity</code>, and cannot be used otherwise.</p>', ], ], 'PredictiveScalingMetricSpecification' => [ 'base' => '<p>This structure specifies the metrics and target utilization settings for a predictive scaling policy. </p> <p>You must specify either a metric pair, or a load metric and a scaling metric individually. Specifying a metric pair instead of individual metrics provides a simpler way to configure metrics for a scaling policy. You choose the metric pair, and the policy automatically knows the correct sum and average statistics to use for the load metric and the scaling metric.</p> <p>Example</p> <ul> <li> <p>You create a predictive scaling policy and specify <code>ALBRequestCount</code> as the value for the metric pair and <code>1000.0</code> as the target value. For this type of metric, you must provide the metric dimension for the corresponding target group, so you also provide a resource label for the Application Load Balancer target group that is attached to your Auto Scaling group.</p> </li> <li> <p>The number of requests the target group receives per minute provides the load metric, and the request count averaged between the members of the target group provides the scaling metric. In CloudWatch, this refers to the <code>RequestCount</code> and <code>RequestCountPerTarget</code> metrics, respectively.</p> </li> <li> <p>For optimal use of predictive scaling, you adhere to the best practice of using a dynamic scaling policy to automatically scale between the minimum capacity and maximum capacity in response to real-time changes in resource utilization.</p> </li> <li> <p>Amazon EC2 Auto Scaling consumes data points for the load metric over the last 14 days and creates an hourly load forecast for predictive scaling. (A minimum of 24 hours of data is required.)</p> </li> <li> <p>After creating the load forecast, Amazon EC2 Auto Scaling determines when to reduce or increase the capacity of your Auto Scaling group in each hour of the forecast period so that the average number of requests received by each instance is as close to 1000 requests per minute as possible at all times.</p> </li> </ul> <p>For information about using custom metrics with predictive scaling, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/predictive-scaling-customized-metric-specification.html\">Advanced predictive scaling policy configurations using custom metrics</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'refs' => [ 'LoadForecast$MetricSpecification' => '<p>The metric specification for the load forecast.</p>', 'PredictiveScalingMetricSpecifications$member' => NULL, ], ], 'PredictiveScalingMetricSpecifications' => [ 'base' => NULL, 'refs' => [ 'PredictiveScalingConfiguration$MetricSpecifications' => '<p>This structure includes the metrics and target utilization to use for predictive scaling. </p> <p>This is an array, but we currently only support a single metric specification. That is, you can specify a target value and a single metric pair, or a target value and one scaling metric and one load metric.</p>', ], ], 'PredictiveScalingMode' => [ 'base' => NULL, 'refs' => [ 'PredictiveScalingConfiguration$Mode' => '<p>The predictive scaling mode. Defaults to <code>ForecastOnly</code> if not specified.</p>', ], ], 'PredictiveScalingPredefinedLoadMetric' => [ 'base' => '<p>Describes a load metric for a predictive scaling policy.</p> <p>When returned in the output of <code>DescribePolicies</code>, it indicates that a predictive scaling policy uses individually specified load and scaling metrics instead of a metric pair.</p>', 'refs' => [ 'PredictiveScalingMetricSpecification$PredefinedLoadMetricSpecification' => '<p>The predefined load metric specification.</p>', ], ], 'PredictiveScalingPredefinedMetricPair' => [ 'base' => '<p>Represents a metric pair for a predictive scaling policy. </p>', 'refs' => [ 'PredictiveScalingMetricSpecification$PredefinedMetricPairSpecification' => '<p>The predefined metric pair specification from which Amazon EC2 Auto Scaling determines the appropriate scaling metric and load metric to use.</p>', ], ], 'PredictiveScalingPredefinedScalingMetric' => [ 'base' => '<p>Describes a scaling metric for a predictive scaling policy.</p> <p>When returned in the output of <code>DescribePolicies</code>, it indicates that a predictive scaling policy uses individually specified load and scaling metrics instead of a metric pair.</p>', 'refs' => [ 'PredictiveScalingMetricSpecification$PredefinedScalingMetricSpecification' => '<p>The predefined scaling metric specification.</p>', ], ], 'PredictiveScalingSchedulingBufferTime' => [ 'base' => NULL, 'refs' => [ 'PredictiveScalingConfiguration$SchedulingBufferTime' => '<p>The amount of time, in seconds, by which the instance launch time can be advanced. For example, the forecast says to add capacity at 10:00 AM, and you choose to pre-launch instances by 5 minutes. In that case, the instances will be launched at 9:55 AM. The intention is to give resources time to be provisioned. It can take a few minutes to launch an EC2 instance. The actual amount of time required depends on several factors, such as the size of the instance and whether there are startup scripts to complete. </p> <p>The value must be less than the forecast interval duration of 3600 seconds (60 minutes). Defaults to 300 seconds if not specified. </p>', ], ], 'ProcessNames' => [ 'base' => NULL, 'refs' => [ 'ScalingProcessQuery$ScalingProcesses' => '<p>One or more of the following processes:</p> <ul> <li> <p> <code>Launch</code> </p> </li> <li> <p> <code>Terminate</code> </p> </li> <li> <p> <code>AddToLoadBalancer</code> </p> </li> <li> <p> <code>AlarmNotification</code> </p> </li> <li> <p> <code>AZRebalance</code> </p> </li> <li> <p> <code>HealthCheck</code> </p> </li> <li> <p> <code>InstanceRefresh</code> </p> </li> <li> <p> <code>ReplaceUnhealthy</code> </p> </li> <li> <p> <code>ScheduledActions</code> </p> </li> </ul> <p>If you omit this property, all processes are specified.</p>', ], ], 'ProcessType' => [ 'base' => '<p>Describes a process type.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html#process-types\">Scaling processes</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'refs' => [ 'Processes$member' => NULL, ], ], 'Processes' => [ 'base' => NULL, 'refs' => [ 'ProcessesType$Processes' => '<p>The names of the process types.</p>', ], ], 'ProcessesType' => [ 'base' => NULL, 'refs' => [], ], 'Progress' => [ 'base' => NULL, 'refs' => [ 'Activity$Progress' => '<p>A value between 0 and 100 that indicates the progress of the activity.</p>', ], ], 'PropagateAtLaunch' => [ 'base' => NULL, 'refs' => [ 'Tag$PropagateAtLaunch' => '<p>Determines whether the tag is added to new instances as they are launched in the group.</p>', 'TagDescription$PropagateAtLaunch' => '<p>Determines whether the tag is added to new instances as they are launched in the group.</p>', ], ], 'ProtectedFromScaleIn' => [ 'base' => NULL, 'refs' => [ 'SetInstanceProtectionQuery$ProtectedFromScaleIn' => '<p>Indicates whether the instance is protected from termination by Amazon EC2 Auto Scaling when scaling in.</p>', ], ], 'PutLifecycleHookAnswer' => [ 'base' => NULL, 'refs' => [], ], 'PutLifecycleHookType' => [ 'base' => NULL, 'refs' => [], ], 'PutNotificationConfigurationType' => [ 'base' => NULL, 'refs' => [], ], 'PutScalingPolicyType' => [ 'base' => NULL, 'refs' => [], ], 'PutScheduledUpdateGroupActionType' => [ 'base' => NULL, 'refs' => [], ], 'PutWarmPoolAnswer' => [ 'base' => NULL, 'refs' => [], ], 'PutWarmPoolType' => [ 'base' => NULL, 'refs' => [], ], 'RecordLifecycleActionHeartbeatAnswer' => [ 'base' => NULL, 'refs' => [], ], 'RecordLifecycleActionHeartbeatType' => [ 'base' => NULL, 'refs' => [], ], 'RefreshInstanceWarmup' => [ 'base' => NULL, 'refs' => [ 'RefreshPreferences$InstanceWarmup' => '<p>A time period, in seconds, during which an instance refresh waits before moving on to replacing the next instance after a new instance enters the <code>InService</code> state.</p> <p>This property is not required for normal usage. Instead, use the <code>DefaultInstanceWarmup</code> property of the Auto Scaling group. The <code>InstanceWarmup</code> and <code>DefaultInstanceWarmup</code> properties work the same way. Only specify this property if you must override the <code>DefaultInstanceWarmup</code> property. </p> <p> If you do not specify this property, the instance warmup by default is the value of the <code>DefaultInstanceWarmup</code> property, if defined (which is recommended in all cases), or the <code>HealthCheckGracePeriod</code> property otherwise.</p>', ], ], 'RefreshPreferences' => [ 'base' => '<p>Describes the preferences for an instance refresh.</p>', 'refs' => [ 'InstanceRefresh$Preferences' => '<p>The preferences for an instance refresh.</p>', 'StartInstanceRefreshType$Preferences' => '<p>Sets your preferences for the instance refresh so that it performs as expected when you start it. Includes the instance warmup time, the minimum healthy percentage, and the behaviors that you want Amazon EC2 Auto Scaling to use if instances that are in <code>Standby</code> state or protected from scale in are found. You can also choose to enable additional features, such as the following:</p> <ul> <li> <p>Auto rollback</p> </li> <li> <p>Checkpoints</p> </li> <li> <p>Skip matching</p> </li> </ul>', ], ], 'RefreshStrategy' => [ 'base' => NULL, 'refs' => [ 'StartInstanceRefreshType$Strategy' => '<p>The strategy to use for the instance refresh. The only valid value is <code>Rolling</code>.</p>', ], ], 'ResourceContentionFault' => [ 'base' => '<p>You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).</p>', 'refs' => [], ], 'ResourceInUseFault' => [ 'base' => '<p>The operation can\\'t be performed because the resource is in use.</p>', 'refs' => [], ], 'ResourceName' => [ 'base' => NULL, 'refs' => [ 'Activity$AutoScalingGroupARN' => '<p>The Amazon Resource Name (ARN) of the Auto Scaling group.</p>', 'Alarm$AlarmARN' => '<p>The Amazon Resource Name (ARN) of the alarm.</p>', 'AutoScalingGroup$AutoScalingGroupARN' => '<p>The Amazon Resource Name (ARN) of the Auto Scaling group.</p>', 'AutoScalingGroup$ServiceLinkedRoleARN' => '<p>The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other Amazon Web Services on your behalf.</p>', 'CompleteLifecycleActionType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'CreateAutoScalingGroupType$ServiceLinkedRoleARN' => '<p>The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other Amazon Web Services service on your behalf. By default, Amazon EC2 Auto Scaling uses a service-linked role named <code>AWSServiceRoleForAutoScaling</code>, which it creates if it does not exist. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-service-linked-role.html\">Service-linked roles</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'DeletePolicyType$PolicyName' => '<p>The name or Amazon Resource Name (ARN) of the policy.</p>', 'ExecutePolicyType$PolicyName' => '<p>The name or ARN of the policy.</p>', 'LaunchConfiguration$LaunchConfigurationARN' => '<p>The Amazon Resource Name (ARN) of the launch configuration.</p>', 'PolicyARNType$PolicyARN' => '<p>The Amazon Resource Name (ARN) of the policy.</p>', 'PolicyNames$member' => NULL, 'RecordLifecycleActionHeartbeatType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'ScalingPolicy$PolicyARN' => '<p>The Amazon Resource Name (ARN) of the policy.</p>', 'ScheduledUpdateGroupAction$ScheduledActionARN' => '<p>The Amazon Resource Name (ARN) of the scheduled action.</p>', 'UpdateAutoScalingGroupType$ServiceLinkedRoleARN' => '<p>The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other Amazon Web Services on your behalf. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-service-linked-role.html\">Service-linked roles</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', ], ], 'ReturnData' => [ 'base' => NULL, 'refs' => [ 'MetricDataQuery$ReturnData' => '<p>Indicates whether to return the timestamps and raw data values of this metric. </p> <p>If you use any math expressions, specify <code>true</code> for this value for only the final math expression that the metric specification is based on. You must specify <code>false</code> for <code>ReturnData</code> for all the other metrics and expressions used in the metric specification.</p> <p>If you are only retrieving metrics and not performing any math expressions, do not specify anything for <code>ReturnData</code>. This sets it to its default (<code>true</code>).</p>', 'TargetTrackingMetricDataQuery$ReturnData' => '<p>Indicates whether to return the timestamps and raw data values of this metric. </p> <p>If you use any math expressions, specify <code>true</code> for this value for only the final math expression that the metric specification is based on. You must specify <code>false</code> for <code>ReturnData</code> for all the other metrics and expressions used in the metric specification.</p> <p>If you are only retrieving metrics and not performing any math expressions, do not specify anything for <code>ReturnData</code>. This sets it to its default (<code>true</code>).</p>', ], ], 'ReuseOnScaleIn' => [ 'base' => NULL, 'refs' => [ 'InstanceReusePolicy$ReuseOnScaleIn' => '<p>Specifies whether instances in the Auto Scaling group can be returned to the warm pool on scale in. </p>', ], ], 'RollbackDetails' => [ 'base' => '<p>Details about an instance refresh rollback.</p>', 'refs' => [ 'InstanceRefresh$RollbackDetails' => '<p>The rollback details.</p>', ], ], 'RollbackInstanceRefreshAnswer' => [ 'base' => NULL, 'refs' => [], ], 'RollbackInstanceRefreshType' => [ 'base' => NULL, 'refs' => [], ], 'ScaleInProtectedInstances' => [ 'base' => NULL, 'refs' => [ 'RefreshPreferences$ScaleInProtectedInstances' => '<p>Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances protected from scale in are found. </p> <p>The following lists the valid values:</p> <dl> <dt>Refresh</dt> <dd> <p>Amazon EC2 Auto Scaling replaces instances that are protected from scale in.</p> </dd> <dt>Ignore</dt> <dd> <p>Amazon EC2 Auto Scaling ignores instances that are protected from scale in and continues to replace instances that are not protected.</p> </dd> <dt>Wait (default)</dt> <dd> <p>Amazon EC2 Auto Scaling waits one hour for you to remove scale-in protection. Otherwise, the instance refresh will fail.</p> </dd> </dl>', ], ], 'ScalingActivityInProgressFault' => [ 'base' => '<p>The operation can\\'t be performed because there are scaling activities in progress.</p>', 'refs' => [], ], 'ScalingActivityStatusCode' => [ 'base' => NULL, 'refs' => [ 'Activity$StatusCode' => '<p>The current status of the activity.</p>', ], ], 'ScalingPolicies' => [ 'base' => NULL, 'refs' => [ 'PoliciesType$ScalingPolicies' => '<p>The scaling policies.</p>', ], ], 'ScalingPolicy' => [ 'base' => '<p>Describes a scaling policy.</p>', 'refs' => [ 'ScalingPolicies$member' => NULL, ], ], 'ScalingPolicyEnabled' => [ 'base' => NULL, 'refs' => [ 'PutScalingPolicyType$Enabled' => '<p>Indicates whether the scaling policy is enabled or disabled. The default is enabled. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enable-disable-scaling-policy.html\">Disabling a scaling policy for an Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'ScalingPolicy$Enabled' => '<p>Indicates whether the policy is enabled (<code>true</code>) or disabled (<code>false</code>).</p>', ], ], 'ScalingProcessQuery' => [ 'base' => NULL, 'refs' => [], ], 'ScheduledActionNames' => [ 'base' => NULL, 'refs' => [ 'BatchDeleteScheduledActionType$ScheduledActionNames' => '<p>The names of the scheduled actions to delete. The maximum number allowed is 50. </p>', 'DescribeScheduledActionsType$ScheduledActionNames' => '<p>The names of one or more scheduled actions. If you omit this property, all scheduled actions are described. If you specify an unknown scheduled action, it is ignored with no error.</p> <p>Array Members: Maximum number of 50 actions.</p>', ], ], 'ScheduledActionsType' => [ 'base' => NULL, 'refs' => [], ], 'ScheduledUpdateGroupAction' => [ 'base' => '<p>Describes a scheduled scaling action.</p>', 'refs' => [ 'ScheduledUpdateGroupActions$member' => NULL, ], ], 'ScheduledUpdateGroupActionRequest' => [ 'base' => '<p>Describes information used for one or more scheduled scaling action updates in a <a>BatchPutScheduledUpdateGroupAction</a> operation.</p>', 'refs' => [ 'ScheduledUpdateGroupActionRequests$member' => NULL, ], ], 'ScheduledUpdateGroupActionRequests' => [ 'base' => NULL, 'refs' => [ 'BatchPutScheduledUpdateGroupActionType$ScheduledUpdateGroupActions' => '<p>One or more scheduled actions. The maximum number allowed is 50.</p>', ], ], 'ScheduledUpdateGroupActions' => [ 'base' => NULL, 'refs' => [ 'ScheduledActionsType$ScheduledUpdateGroupActions' => '<p>The scheduled actions.</p>', ], ], 'SecurityGroups' => [ 'base' => NULL, 'refs' => [ 'CreateLaunchConfigurationType$SecurityGroups' => '<p>A list that contains the security group IDs to assign to the instances in the Auto Scaling group. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html\">Control traffic to resources using security groups</a> in the <i>Amazon Virtual Private Cloud User Guide</i>.</p>', 'LaunchConfiguration$SecurityGroups' => '<p>A list that contains the security groups to assign to the instances in the Auto Scaling group. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html\">Security Groups for Your VPC</a> in the <i>Amazon Virtual Private Cloud User Guide</i>.</p>', ], ], 'ServiceLinkedRoleFailure' => [ 'base' => '<p>The service-linked role is not yet ready for use.</p>', 'refs' => [], ], 'SetDesiredCapacityType' => [ 'base' => NULL, 'refs' => [], ], 'SetInstanceHealthQuery' => [ 'base' => NULL, 'refs' => [], ], 'SetInstanceProtectionAnswer' => [ 'base' => NULL, 'refs' => [], ], 'SetInstanceProtectionQuery' => [ 'base' => NULL, 'refs' => [], ], 'ShouldDecrementDesiredCapacity' => [ 'base' => NULL, 'refs' => [ 'DetachInstancesQuery$ShouldDecrementDesiredCapacity' => '<p>Indicates whether the Auto Scaling group decrements the desired capacity value by the number of instances detached.</p>', 'EnterStandbyQuery$ShouldDecrementDesiredCapacity' => '<p>Indicates whether to decrement the desired capacity of the Auto Scaling group by the number of instances moved to <code>Standby</code> mode.</p>', 'TerminateInstanceInAutoScalingGroupType$ShouldDecrementDesiredCapacity' => '<p>Indicates whether terminating the instance also decrements the size of the Auto Scaling group.</p>', ], ], 'ShouldRespectGracePeriod' => [ 'base' => NULL, 'refs' => [ 'SetInstanceHealthQuery$ShouldRespectGracePeriod' => '<p>If the Auto Scaling group of the specified instance has a <code>HealthCheckGracePeriod</code> specified for the group, by default, this call respects the grace period. Set this to <code>False</code>, to have the call not respect the grace period associated with the group.</p> <p>For more information about the health check grace period, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_CreateAutoScalingGroup.html\">CreateAutoScalingGroup</a> in the <i>Amazon EC2 Auto Scaling API Reference</i>.</p>', ], ], 'SkipMatching' => [ 'base' => NULL, 'refs' => [ 'RefreshPreferences$SkipMatching' => '<p>(Optional) Indicates whether skip matching is enabled. If enabled (<code>true</code>), then Amazon EC2 Auto Scaling skips replacing instances that match the desired configuration. If no desired configuration is specified, then it skips replacing instances that have the same launch template and instance types that the Auto Scaling group was using before the start of the instance refresh. The default is <code>false</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh-skip-matching.html\">Use an instance refresh with skip matching</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', ], ], 'SpotInstancePools' => [ 'base' => NULL, 'refs' => [ 'InstancesDistribution$SpotInstancePools' => '<p>The number of Spot Instance pools across which to allocate your Spot Instances. The Spot pools are determined from the different instance types in the overrides. Valid only when the <code>SpotAllocationStrategy</code> is <code>lowest-price</code>. Value must be in the range of 1\u00e2\u20ac\u201c20.</p> <p>Default: 2</p>', ], ], 'SpotPrice' => [ 'base' => NULL, 'refs' => [ 'CreateLaunchConfigurationType$SpotPrice' => '<p>The maximum hourly price to be paid for any Spot Instance launched to fulfill the request. Spot Instances are launched when the price you specify exceeds the current Spot price. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-template-spot-instances.html\">Request Spot Instances for fault-tolerant and flexible applications</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>Valid Range: Minimum value of 0.001</p> <note> <p>When you change your maximum price by creating a new launch configuration, running instances will continue to run as long as the maximum price for those running instances is higher than the current Spot price.</p> </note>', 'LaunchConfiguration$SpotPrice' => '<p>The maximum hourly price to be paid for any Spot Instance launched to fulfill the request. Spot Instances are launched when the price you specify exceeds the current Spot price. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-spot-instances.html\">Requesting Spot Instances</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', ], ], 'StandbyInstances' => [ 'base' => NULL, 'refs' => [ 'RefreshPreferences$StandbyInstances' => '<p>Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances in <code>Standby</code> state are found.</p> <p>The following lists the valid values:</p> <dl> <dt>Terminate</dt> <dd> <p>Amazon EC2 Auto Scaling terminates instances that are in <code>Standby</code>.</p> </dd> <dt>Ignore</dt> <dd> <p>Amazon EC2 Auto Scaling ignores instances that are in <code>Standby</code> and continues to replace instances that are in the <code>InService</code> state.</p> </dd> <dt>Wait (default)</dt> <dd> <p>Amazon EC2 Auto Scaling waits one hour for you to return the instances to service. Otherwise, the instance refresh will fail.</p> </dd> </dl>', ], ], 'StartInstanceRefreshAnswer' => [ 'base' => NULL, 'refs' => [], ], 'StartInstanceRefreshType' => [ 'base' => NULL, 'refs' => [], ], 'StepAdjustment' => [ 'base' => '<p>Describes information used to create a step adjustment for a step scaling policy.</p> <p>For the following examples, suppose that you have an alarm with a breach threshold of 50:</p> <ul> <li> <p>To trigger the adjustment when the metric is greater than or equal to 50 and less than 60, specify a lower bound of 0 and an upper bound of 10.</p> </li> <li> <p>To trigger the adjustment when the metric is greater than 40 and less than or equal to 50, specify a lower bound of -10 and an upper bound of 0.</p> </li> </ul> <p>There are a few rules for the step adjustments for your step policy:</p> <ul> <li> <p>The ranges of your step adjustments can\\'t overlap or have a gap.</p> </li> <li> <p>At most, one step adjustment can have a null lower bound. If one step adjustment has a negative lower bound, then there must be a step adjustment with a null lower bound.</p> </li> <li> <p>At most, one step adjustment can have a null upper bound. If one step adjustment has a positive upper bound, then there must be a step adjustment with a null upper bound.</p> </li> <li> <p>The upper and lower bound can\\'t be null in the same step adjustment.</p> </li> </ul> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-steps\">Step adjustments</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'refs' => [ 'StepAdjustments$member' => NULL, ], ], 'StepAdjustments' => [ 'base' => NULL, 'refs' => [ 'PutScalingPolicyType$StepAdjustments' => '<p>A set of adjustments that enable you to scale based on the size of the alarm breach.</p> <p>Required if the policy type is <code>StepScaling</code>. (Not used with any other policy type.) </p>', 'ScalingPolicy$StepAdjustments' => '<p>A set of adjustments that enable you to scale based on the size of the alarm breach.</p>', ], ], 'SuspendedProcess' => [ 'base' => '<p>Describes an auto scaling process that has been suspended.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html#process-types\">Scaling processes</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'refs' => [ 'SuspendedProcesses$member' => NULL, ], ], 'SuspendedProcesses' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$SuspendedProcesses' => '<p>The suspended processes associated with the group.</p>', ], ], 'Tag' => [ 'base' => '<p>Describes a tag for an Auto Scaling group.</p>', 'refs' => [ 'Tags$member' => NULL, ], ], 'TagDescription' => [ 'base' => '<p>Describes a tag for an Auto Scaling group.</p>', 'refs' => [ 'TagDescriptionList$member' => NULL, ], ], 'TagDescriptionList' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$Tags' => '<p>The tags for the group.</p>', 'TagsType$Tags' => '<p>One or more tags.</p>', ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'Tag$Key' => '<p>The tag key.</p>', 'TagDescription$Key' => '<p>The tag key.</p>', ], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'Tag$Value' => '<p>The tag value.</p>', 'TagDescription$Value' => '<p>The tag value.</p>', ], ], 'Tags' => [ 'base' => NULL, 'refs' => [ 'CreateAutoScalingGroupType$Tags' => '<p>One or more tags. You can tag your Auto Scaling group and propagate the tags to the Amazon EC2 instances it launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS volumes, specify the tags in a launch template but use caution. If the launch template specifies an instance tag with a key that is also specified for the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that instance tag with the value specified by the Auto Scaling group. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html\">Tag Auto Scaling groups and instances</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'CreateOrUpdateTagsType$Tags' => '<p>One or more tags.</p>', 'DeleteTagsType$Tags' => '<p>One or more tags.</p>', ], ], 'TagsType' => [ 'base' => NULL, 'refs' => [], ], 'TargetGroupARNs' => [ 'base' => NULL, 'refs' => [ 'AttachLoadBalancerTargetGroupsType$TargetGroupARNs' => '<p>The Amazon Resource Names (ARNs) of the target groups. You can specify up to 10 target groups. To get the ARN of a target group, use the Elastic Load Balancing <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html\">DescribeTargetGroups</a> API operation.</p>', 'AutoScalingGroup$TargetGroupARNs' => '<p>The Amazon Resource Names (ARN) of the target groups for your load balancer.</p>', 'CreateAutoScalingGroupType$TargetGroupARNs' => '<p>The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to associate with the Auto Scaling group. Instances are registered as targets with the target groups. The target groups receive incoming traffic and route requests to one or more registered targets. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html\">Use Elastic Load Balancing to distribute traffic across the instances in your Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'DetachLoadBalancerTargetGroupsType$TargetGroupARNs' => '<p>The Amazon Resource Names (ARN) of the target groups. You can specify up to 10 target groups.</p>', ], ], 'TargetTrackingConfiguration' => [ 'base' => '<p>Represents a target tracking scaling policy configuration to use with Amazon EC2 Auto Scaling.</p>', 'refs' => [ 'PutScalingPolicyType$TargetTrackingConfiguration' => '<p>A target tracking scaling policy. Provides support for predefined or custom metrics.</p> <p>The following predefined metrics are available:</p> <ul> <li> <p> <code>ASGAverageCPUUtilization</code> </p> </li> <li> <p> <code>ASGAverageNetworkIn</code> </p> </li> <li> <p> <code>ASGAverageNetworkOut</code> </p> </li> <li> <p> <code>ALBRequestCountPerTarget</code> </p> </li> </ul> <p>If you specify <code>ALBRequestCountPerTarget</code> for the metric, you must specify the <code>ResourceLabel</code> property with the <code>PredefinedMetricSpecification</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_TargetTrackingConfiguration.html\">TargetTrackingConfiguration</a> in the <i>Amazon EC2 Auto Scaling API Reference</i>.</p> <p>Required if the policy type is <code>TargetTrackingScaling</code>.</p>', 'ScalingPolicy$TargetTrackingConfiguration' => '<p>A target tracking scaling policy.</p>', ], ], 'TargetTrackingMetricDataQueries' => [ 'base' => NULL, 'refs' => [ 'CustomizedMetricSpecification$Metrics' => '<p>The metrics to include in the target tracking scaling policy, as a metric data query. This can include both raw metric and metric math expressions.</p>', ], ], 'TargetTrackingMetricDataQuery' => [ 'base' => '<p>The metric data to return. Also defines whether this call is returning data for one metric only, or whether it is performing a math expression on the values of returned metric statistics to create a new time series. A time series is a series of data points, each of which is associated with a timestamp.</p>', 'refs' => [ 'TargetTrackingMetricDataQueries$member' => NULL, ], ], 'TargetTrackingMetricStat' => [ 'base' => '<p>This structure defines the CloudWatch metric to return, along with the statistic and unit.</p> <p>For more information about the CloudWatch terminology below, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html\">Amazon CloudWatch concepts</a> in the <i>Amazon CloudWatch User Guide</i>.</p>', 'refs' => [ 'TargetTrackingMetricDataQuery$MetricStat' => '<p>Information about the metric data to return.</p> <p>Conditional: Within each <code>TargetTrackingMetricDataQuery</code> object, you must specify either <code>Expression</code> or <code>MetricStat</code>, but not both.</p>', ], ], 'TerminateInstanceInAutoScalingGroupType' => [ 'base' => NULL, 'refs' => [], ], 'TerminationPolicies' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$TerminationPolicies' => '<p>The termination policies for the group.</p>', 'CreateAutoScalingGroupType$TerminationPolicies' => '<p>A policy or a list of policies that are used to select the instance to terminate. These policies are executed in the order that you list them. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-termination-policies.html\">Work with Amazon EC2 Auto Scaling termination policies</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>Valid values: <code>Default</code> | <code>AllocationStrategy</code> | <code>ClosestToNextInstanceHour</code> | <code>NewestInstance</code> | <code>OldestInstance</code> | <code>OldestLaunchConfiguration</code> | <code>OldestLaunchTemplate</code> | <code>arn:aws:lambda:region:account-id:function:my-function:my-alias</code> </p>', 'DescribeTerminationPolicyTypesAnswer$TerminationPolicyTypes' => '<p>The termination policies supported by Amazon EC2 Auto Scaling: <code>OldestInstance</code>, <code>OldestLaunchConfiguration</code>, <code>NewestInstance</code>, <code>ClosestToNextInstanceHour</code>, <code>Default</code>, <code>OldestLaunchTemplate</code>, and <code>AllocationStrategy</code>.</p>', 'UpdateAutoScalingGroupType$TerminationPolicies' => '<p>A policy or a list of policies that are used to select the instances to terminate. The policies are executed in the order that you list them. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-termination-policies.html\">Work with Amazon EC2 Auto Scaling termination policies</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>Valid values: <code>Default</code> | <code>AllocationStrategy</code> | <code>ClosestToNextInstanceHour</code> | <code>NewestInstance</code> | <code>OldestInstance</code> | <code>OldestLaunchConfiguration</code> | <code>OldestLaunchTemplate</code> | <code>arn:aws:lambda:region:account-id:function:my-function:my-alias</code> </p>', ], ], 'TimestampType' => [ 'base' => NULL, 'refs' => [ 'Activity$StartTime' => '<p>The start time of the activity.</p>', 'Activity$EndTime' => '<p>The end time of the activity.</p>', 'AutoScalingGroup$CreatedTime' => '<p>The date and time the group was created.</p>', 'DescribeScheduledActionsType$StartTime' => '<p>The earliest scheduled start time to return. If scheduled action names are provided, this property is ignored.</p>', 'DescribeScheduledActionsType$EndTime' => '<p>The latest scheduled start time to return. If scheduled action names are provided, this property is ignored.</p>', 'GetPredictiveScalingForecastAnswer$UpdateTime' => '<p>The time the forecast was made.</p>', 'GetPredictiveScalingForecastType$StartTime' => '<p>The inclusive start time of the time range for the forecast data to get. At most, the date and time can be one year before the current date and time.</p>', 'GetPredictiveScalingForecastType$EndTime' => '<p>The exclusive end time of the time range for the forecast data to get. The maximum time duration between the start and end time is 30 days. </p> <p>Although this parameter can accept a date and time that is more than two days in the future, the availability of forecast data has limits. Amazon EC2 Auto Scaling only issues forecasts for periods of two days in advance.</p>', 'InstanceRefresh$StartTime' => '<p>The date and time at which the instance refresh began.</p>', 'InstanceRefresh$EndTime' => '<p>The date and time at which the instance refresh ended.</p>', 'LaunchConfiguration$CreatedTime' => '<p>The creation date and time for the launch configuration.</p>', 'PredictiveScalingForecastTimestamps$member' => NULL, 'PutScheduledUpdateGroupActionType$Time' => '<p>This property is no longer used.</p>', 'PutScheduledUpdateGroupActionType$StartTime' => '<p>The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT only and in quotes (for example, <code>\"2021-06-01T00:00:00Z\"</code>).</p> <p>If you specify <code>Recurrence</code> and <code>StartTime</code>, Amazon EC2 Auto Scaling performs the action at this time, and then performs the action based on the specified recurrence.</p>', 'PutScheduledUpdateGroupActionType$EndTime' => '<p>The date and time for the recurring schedule to end, in UTC. For example, <code>\"2021-06-01T00:00:00Z\"</code>.</p>', 'RollbackDetails$RollbackStartTime' => '<p>The date and time at which the rollback began.</p>', 'ScheduledUpdateGroupAction$Time' => '<p>This property is no longer used.</p>', 'ScheduledUpdateGroupAction$StartTime' => '<p>The date and time in UTC for this action to start. For example, <code>\"2019-06-01T00:00:00Z\"</code>. </p>', 'ScheduledUpdateGroupAction$EndTime' => '<p>The date and time in UTC for the recurring schedule to end. For example, <code>\"2019-06-01T00:00:00Z\"</code>. </p>', 'ScheduledUpdateGroupActionRequest$StartTime' => '<p>The date and time for the action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT only and in quotes (for example, <code>\"2019-06-01T00:00:00Z\"</code>).</p> <p>If you specify <code>Recurrence</code> and <code>StartTime</code>, Amazon EC2 Auto Scaling performs the action at this time, and then performs the action based on the specified recurrence.</p> <p>If you try to schedule the action in the past, Amazon EC2 Auto Scaling returns an error message.</p>', 'ScheduledUpdateGroupActionRequest$EndTime' => '<p>The date and time for the recurring schedule to end, in UTC.</p>', ], ], 'TotalLocalStorageGBRequest' => [ 'base' => '<p>Specifies the minimum and maximum for the <code>TotalLocalStorageGB</code> object when you specify <a>InstanceRequirements</a> for an Auto Scaling group.</p>', 'refs' => [ 'InstanceRequirements$TotalLocalStorageGB' => '<p>The minimum and maximum total local storage size for an instance type, in GB.</p> <p>Default: No minimum or maximum limits</p>', ], ], 'TrafficSourceIdentifier' => [ 'base' => '<p>Identifying information for a traffic source.</p>', 'refs' => [ 'TrafficSources$member' => NULL, ], ], 'TrafficSourceState' => [ 'base' => '<p>Describes the state of a traffic source.</p>', 'refs' => [ 'TrafficSourceStates$member' => NULL, ], ], 'TrafficSourceStates' => [ 'base' => NULL, 'refs' => [ 'DescribeTrafficSourcesResponse$TrafficSources' => '<p>Information about the traffic sources.</p>', ], ], 'TrafficSources' => [ 'base' => NULL, 'refs' => [ 'AttachTrafficSourcesType$TrafficSources' => '<p>The unique identifiers of one or more traffic sources. You can specify up to 10 traffic sources.</p>', 'AutoScalingGroup$TrafficSources' => '<p>The traffic sources associated with this Auto Scaling group.</p>', 'CreateAutoScalingGroupType$TrafficSources' => '<p>The list of traffic sources to attach to this Auto Scaling group. You can use any of the following as traffic sources for an Auto Scaling group: Classic Load Balancer, Application Load Balancer, Gateway Load Balancer, Network Load Balancer, and VPC Lattice.</p>', 'DetachTrafficSourcesType$TrafficSources' => '<p>The unique identifiers of one or more traffic sources. You can specify up to 10 traffic sources.</p>', ], ], 'UpdateAutoScalingGroupType' => [ 'base' => NULL, 'refs' => [], ], 'VCpuCountRequest' => [ 'base' => '<p>Specifies the minimum and maximum for the <code>VCpuCount</code> object when you specify <a>InstanceRequirements</a> for an Auto Scaling group.</p>', 'refs' => [ 'InstanceRequirements$VCpuCount' => '<p>The minimum and maximum number of vCPUs for an instance type.</p>', ], ], 'Values' => [ 'base' => NULL, 'refs' => [ 'Filter$Values' => '<p>One or more filter values. Filter values are case-sensitive. </p> <p>If you specify multiple values for a filter, the values are automatically logically joined with an <code>OR</code>, and the request returns all results that match any of the specified values. For example, specify \"tag:environment\" for the filter name and \"production,development\" for the filter values to find Auto Scaling groups with the tag \"environment=production\" or \"environment=development\".</p>', ], ], 'WarmPoolConfiguration' => [ 'base' => '<p>Describes a warm pool configuration. </p>', 'refs' => [ 'AutoScalingGroup$WarmPoolConfiguration' => '<p>The warm pool for the group.</p>', 'DescribeWarmPoolAnswer$WarmPoolConfiguration' => '<p>The warm pool configuration details. </p>', ], ], 'WarmPoolMinSize' => [ 'base' => NULL, 'refs' => [ 'PutWarmPoolType$MinSize' => '<p>Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.</p>', 'WarmPoolConfiguration$MinSize' => '<p>The minimum number of instances to maintain in the warm pool.</p>', ], ], 'WarmPoolSize' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$WarmPoolSize' => '<p>The current size of the warm pool.</p>', ], ], 'WarmPoolState' => [ 'base' => NULL, 'refs' => [ 'PutWarmPoolType$PoolState' => '<p>Sets the instance state to transition to after the lifecycle actions are complete. Default is <code>Stopped</code>.</p>', 'WarmPoolConfiguration$PoolState' => '<p>The instance state to transition to after the lifecycle actions are complete.</p>', ], ], 'WarmPoolStatus' => [ 'base' => NULL, 'refs' => [ 'WarmPoolConfiguration$Status' => '<p>The status of a warm pool that is marked for deletion.</p>', ], ], 'XmlString' => [ 'base' => NULL, 'refs' => [ 'ActivitiesType$NextToken' => '<p>A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the <code>NextToken</code> value when requesting the next set of items. This value is null when there are no more items to return.</p>', 'Activity$ActivityId' => '<p>The ID of the activity.</p>', 'Activity$Description' => '<p>A friendly, more verbose description of the activity.</p>', 'Activity$Details' => '<p>The details about the activity.</p>', 'ActivityIds$member' => NULL, 'AutoScalingGroupNamesType$NextToken' => '<p>The token for the next set of items to return. (You received this token from a previous call.)</p>', 'AutoScalingGroupsType$NextToken' => '<p>A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the <code>NextToken</code> value when requesting the next set of items. This value is null when there are no more items to return.</p>', 'AutoScalingInstancesType$NextToken' => '<p>A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the <code>NextToken</code> value when requesting the next set of items. This value is null when there are no more items to return.</p>', 'DescribeAutoScalingInstancesType$NextToken' => '<p>The token for the next set of items to return. (You received this token from a previous call.)</p>', 'DescribeInstanceRefreshesAnswer$NextToken' => '<p>A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the <code>NextToken</code> value when requesting the next set of items. This value is null when there are no more items to return.</p>', 'DescribeInstanceRefreshesType$NextToken' => '<p>The token for the next set of items to return. (You received this token from a previous call.)</p>', 'DescribeLoadBalancerTargetGroupsRequest$NextToken' => '<p>The token for the next set of items to return. (You received this token from a previous call.)</p>', 'DescribeLoadBalancerTargetGroupsResponse$NextToken' => '<p>A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the <code>NextToken</code> value when requesting the next set of items. This value is null when there are no more items to return.</p>', 'DescribeLoadBalancersRequest$NextToken' => '<p>The token for the next set of items to return. (You received this token from a previous call.)</p>', 'DescribeLoadBalancersResponse$NextToken' => '<p>A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the <code>NextToken</code> value when requesting the next set of items. This value is null when there are no more items to return.</p>', 'DescribeNotificationConfigurationsAnswer$NextToken' => '<p>A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the <code>NextToken</code> value when requesting the next set of items. This value is null when there are no more items to return.</p>', 'DescribeNotificationConfigurationsType$NextToken' => '<p>The token for the next set of items to return. (You received this token from a previous call.)</p>', 'DescribePoliciesType$NextToken' => '<p>The token for the next set of items to return. (You received this token from a previous call.)</p>', 'DescribeScalingActivitiesType$NextToken' => '<p>The token for the next set of items to return. (You received this token from a previous call.)</p>', 'DescribeScheduledActionsType$NextToken' => '<p>The token for the next set of items to return. (You received this token from a previous call.)</p>', 'DescribeTagsType$NextToken' => '<p>The token for the next set of items to return. (You received this token from a previous call.)</p>', 'DescribeTrafficSourcesRequest$NextToken' => '<p>The token for the next set of items to return. (You received this token from a previous call.)</p>', 'DescribeTrafficSourcesResponse$NextToken' => '<p>This string indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the <code>NextToken</code> value when requesting the next set of items. This value is null when there are no more items to return.</p>', 'DescribeWarmPoolAnswer$NextToken' => '<p>This string indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the <code>NextToken</code> value when requesting the next set of items. This value is null when there are no more items to return.</p>', 'DescribeWarmPoolType$NextToken' => '<p>The token for the next set of instances to return. (You received this token from a previous call.)</p>', 'FailedScheduledUpdateGroupActionRequest$ErrorMessage' => '<p>The error message accompanying the error code.</p>', 'Filter$Name' => '<p>The name of the filter.</p> <p>The valid values for <code>Name</code> depend on which API operation you\\'re using with the filter (<a>DescribeAutoScalingGroups</a> or <a>DescribeTags</a>).</p> <p> <b>DescribeAutoScalingGroups</b> </p> <p>Valid values for <code>Name</code> include the following: </p> <ul> <li> <p> <code>tag-key</code> - Accepts tag keys. The results only include information about the Auto Scaling groups associated with these tag keys. </p> </li> <li> <p> <code>tag-value</code> - Accepts tag values. The results only include information about the Auto Scaling groups associated with these tag values. </p> </li> <li> <p> <code>tag:&lt;key&gt;</code> - Accepts the key/value combination of the tag. Use the tag key in the filter name and the tag value as the filter value. The results only include information about the Auto Scaling groups associated with the specified key/value combination. </p> </li> </ul> <p> <b>DescribeTags</b> </p> <p>Valid values for <code>Name</code> include the following: </p> <ul> <li> <p> <code>auto-scaling-group</code> - Accepts the names of Auto Scaling groups. The results only include information about the tags associated with these Auto Scaling groups. </p> </li> <li> <p> <code>key</code> - Accepts tag keys. The results only include information about the tags associated with these tag keys. </p> </li> <li> <p> <code>value</code> - Accepts tag values. The results only include information about the tags associated with these tag values. </p> </li> <li> <p> <code>propagate-at-launch</code> - Accepts a Boolean value, which specifies whether tags propagate to instances at launch. The results only include information about the tags associated with the specified Boolean value. </p> </li> </ul>', 'InstancesDistribution$OnDemandAllocationStrategy' => '<p>The allocation strategy to apply to your On-Demand Instances when they are launched. Possible instance types are determined by the launch template overrides that you specify.</p> <p>The following lists the valid values:</p> <dl> <dt>lowest-price</dt> <dd> <p>Uses price to determine which instance types are the highest priority, launching the lowest priced instance types within an Availability Zone first. This is the default value for Auto Scaling groups that specify <a>InstanceRequirements</a>. </p> </dd> <dt>prioritized</dt> <dd> <p>You set the order of instance types for the launch template overrides from highest to lowest priority (from first to last in the list). Amazon EC2 Auto Scaling launches your highest priority instance types first. If all your On-Demand capacity cannot be fulfilled using your highest priority instance type, then Amazon EC2 Auto Scaling launches the remaining capacity using the second priority instance type, and so on. This is the default value for Auto Scaling groups that don\\'t specify <a>InstanceRequirements</a> and cannot be used for groups that do.</p> </dd> </dl>', 'InstancesDistribution$SpotAllocationStrategy' => '<p>The allocation strategy to apply to your Spot Instances when they are launched. Possible instance types are determined by the launch template overrides that you specify.</p> <p>The following lists the valid values:</p> <dl> <dt>capacity-optimized</dt> <dd> <p>Requests Spot Instances using pools that are optimally chosen based on the available Spot capacity. This strategy has the lowest risk of interruption. To give certain instance types a higher chance of launching first, use <code>capacity-optimized-prioritized</code>.</p> </dd> <dt>capacity-optimized-prioritized</dt> <dd> <p>You set the order of instance types for the launch template overrides from highest to lowest priority (from first to last in the list). Amazon EC2 Auto Scaling honors the instance type priorities on a best effort basis but optimizes for capacity first. Note that if the On-Demand allocation strategy is set to <code>prioritized</code>, the same priority is applied when fulfilling On-Demand capacity. This is not a valid value for Auto Scaling groups that specify <a>InstanceRequirements</a>.</p> </dd> <dt>lowest-price</dt> <dd> <p>Requests Spot Instances using the lowest priced pools within an Availability Zone, across the number of Spot pools that you specify for the <code>SpotInstancePools</code> property. To ensure that your desired capacity is met, you might receive Spot Instances from several pools. This is the default value, but it might lead to high interruption rates because this strategy only considers instance price and not available capacity.</p> </dd> <dt>price-capacity-optimized (recommended)</dt> <dd> <p>The price and capacity optimized allocation strategy looks at both price and capacity to select the Spot Instance pools that are the least likely to be interrupted and have the lowest possible price.</p> </dd> </dl>', 'LaunchConfigurationNamesType$NextToken' => '<p>The token for the next set of items to return. (You received this token from a previous call.)</p>', 'LaunchConfigurationsType$NextToken' => '<p>A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the <code>NextToken</code> value when requesting the next set of items. This value is null when there are no more items to return.</p>', 'PoliciesType$NextToken' => '<p>A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the <code>NextToken</code> value when requesting the next set of items. This value is null when there are no more items to return.</p>', 'ScheduledActionsType$NextToken' => '<p>A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the <code>NextToken</code> value when requesting the next set of items. This value is null when there are no more items to return.</p>', 'SecurityGroups$member' => NULL, 'Tag$ResourceId' => '<p>The name of the Auto Scaling group.</p>', 'Tag$ResourceType' => '<p>The type of resource. The only supported value is <code>auto-scaling-group</code>.</p>', 'TagDescription$ResourceId' => '<p>The name of the group.</p>', 'TagDescription$ResourceType' => '<p>The type of resource. The only supported value is <code>auto-scaling-group</code>.</p>', 'TagsType$NextToken' => '<p>A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the <code>NextToken</code> value when requesting the next set of items. This value is null when there are no more items to return.</p>', 'Values$member' => NULL, ], ], 'XmlStringMaxLen1023' => [ 'base' => NULL, 'refs' => [ 'Activity$Cause' => '<p>The reason the activity began.</p>', 'InstanceRefresh$StatusReason' => '<p>The explanation for the specific status assigned to this operation.</p>', 'LifecycleHook$NotificationMetadata' => '<p>Additional information that is included any time Amazon EC2 Auto Scaling sends a message to the notification target.</p>', 'LifecycleHookSpecification$NotificationMetadata' => '<p>Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.</p>', 'MetricDataQuery$Expression' => '<p>The math expression to perform on the returned data, if this object is performing a math expression. This expression can use the <code>Id</code> of the other metrics to refer to those metrics, and can also use the <code>Id</code> of other expressions to use the result of those expressions. </p> <p>Conditional: Within each <code>MetricDataQuery</code> object, you must specify either <code>Expression</code> or <code>MetricStat</code>, but not both.</p>', 'PredefinedMetricSpecification$ResourceLabel' => '<p>A label that uniquely identifies a specific Application Load Balancer target group from which to determine the average request count served by your Auto Scaling group. You can\\'t specify a resource label unless the target group is attached to the Auto Scaling group.</p> <p>You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:</p> <p> <code>app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff</code>.</p> <p>Where:</p> <ul> <li> <p>app/&lt;load-balancer-name&gt;/&lt;load-balancer-id&gt; is the final portion of the load balancer ARN</p> </li> <li> <p>targetgroup/&lt;target-group-name&gt;/&lt;target-group-id&gt; is the final portion of the target group ARN.</p> </li> </ul> <p>To find the ARN for an Application Load Balancer, use the <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html\">DescribeLoadBalancers</a> API operation. To find the ARN for the target group, use the <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html\">DescribeTargetGroups</a> API operation.</p>', 'PredictiveScalingPredefinedLoadMetric$ResourceLabel' => '<p>A label that uniquely identifies a specific Application Load Balancer target group from which to determine the request count served by your Auto Scaling group. You can\\'t specify a resource label unless the target group is attached to the Auto Scaling group.</p> <p>You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:</p> <p> <code>app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff</code>.</p> <p>Where:</p> <ul> <li> <p>app/&lt;load-balancer-name&gt;/&lt;load-balancer-id&gt; is the final portion of the load balancer ARN</p> </li> <li> <p>targetgroup/&lt;target-group-name&gt;/&lt;target-group-id&gt; is the final portion of the target group ARN.</p> </li> </ul> <p>To find the ARN for an Application Load Balancer, use the <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html\">DescribeLoadBalancers</a> API operation. To find the ARN for the target group, use the <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html\">DescribeTargetGroups</a> API operation.</p>', 'PredictiveScalingPredefinedMetricPair$ResourceLabel' => '<p>A label that uniquely identifies a specific Application Load Balancer target group from which to determine the total and average request count served by your Auto Scaling group. You can\\'t specify a resource label unless the target group is attached to the Auto Scaling group.</p> <p>You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:</p> <p> <code>app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff</code>.</p> <p>Where:</p> <ul> <li> <p>app/&lt;load-balancer-name&gt;/&lt;load-balancer-id&gt; is the final portion of the load balancer ARN</p> </li> <li> <p>targetgroup/&lt;target-group-name&gt;/&lt;target-group-id&gt; is the final portion of the target group ARN.</p> </li> </ul> <p>To find the ARN for an Application Load Balancer, use the <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html\">DescribeLoadBalancers</a> API operation. To find the ARN for the target group, use the <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html\">DescribeTargetGroups</a> API operation.</p>', 'PredictiveScalingPredefinedScalingMetric$ResourceLabel' => '<p>A label that uniquely identifies a specific Application Load Balancer target group from which to determine the average request count served by your Auto Scaling group. You can\\'t specify a resource label unless the target group is attached to the Auto Scaling group.</p> <p>You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:</p> <p> <code>app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff</code>.</p> <p>Where:</p> <ul> <li> <p>app/&lt;load-balancer-name&gt;/&lt;load-balancer-id&gt; is the final portion of the load balancer ARN</p> </li> <li> <p>targetgroup/&lt;target-group-name&gt;/&lt;target-group-id&gt; is the final portion of the target group ARN.</p> </li> </ul> <p>To find the ARN for an Application Load Balancer, use the <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html\">DescribeLoadBalancers</a> API operation. To find the ARN for the target group, use the <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html\">DescribeTargetGroups</a> API operation.</p>', 'PutLifecycleHookType$NotificationMetadata' => '<p>Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.</p>', 'RollbackDetails$RollbackReason' => '<p>The reason for this instance refresh rollback (for example, whether a manual or automatic rollback was initiated).</p>', ], ], 'XmlStringMaxLen1600' => [ 'base' => NULL, 'refs' => [ 'CreateLaunchConfigurationType$IamInstanceProfile' => '<p>The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance. The instance profile contains the IAM role. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/us-iam-role.html\">IAM role for applications that run on Amazon EC2 instances</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'LaunchConfiguration$IamInstanceProfile' => '<p>The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance. The instance profile contains the IAM role. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/us-iam-role.html\">IAM role for applications that run on Amazon EC2 instances</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'TerminationPolicies$member' => NULL, ], ], 'XmlStringMaxLen19' => [ 'base' => NULL, 'refs' => [ 'AutoScalingInstanceDetails$InstanceId' => '<p>The ID of the instance.</p>', 'CompleteLifecycleActionType$InstanceId' => '<p>The ID of the instance.</p>', 'CreateAutoScalingGroupType$InstanceId' => '<p>The ID of the instance used to base the launch configuration on. If specified, Amazon EC2 Auto Scaling uses the configuration values from the specified instance to create a new launch configuration. To get the instance ID, use the Amazon EC2 <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html\">DescribeInstances</a> API operation. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-from-instance.html\">Creating an Auto Scaling group using an EC2 instance</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'CreateLaunchConfigurationType$InstanceId' => '<p>The ID of the instance to use to create the launch configuration. The new launch configuration derives attributes from the instance, except for the block device mapping.</p> <p>To create a launch configuration with a block device mapping or override any other instance attributes, specify them as part of the same request.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-lc-with-instanceID.html\">Creating a launch configuration using an EC2 instance</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'Instance$InstanceId' => '<p>The ID of the instance.</p>', 'InstanceIds$member' => NULL, 'RecordLifecycleActionHeartbeatType$InstanceId' => '<p>The ID of the instance.</p>', 'SetInstanceHealthQuery$InstanceId' => '<p>The ID of the instance.</p>', 'TerminateInstanceInAutoScalingGroupType$InstanceId' => '<p>The ID of the instance.</p>', ], ], 'XmlStringMaxLen2047' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$VPCZoneIdentifier' => '<p>One or more subnet IDs, if applicable, separated by commas.</p>', 'CreateAutoScalingGroupType$VPCZoneIdentifier' => '<p>A comma-separated list of subnet IDs for a virtual private cloud (VPC) where instances in the Auto Scaling group can be created. If you specify <code>VPCZoneIdentifier</code> with <code>AvailabilityZones</code>, the subnets that you specify must reside in those Availability Zones.</p>', 'TargetTrackingMetricDataQuery$Expression' => '<p>The math expression to perform on the returned data, if this object is performing a math expression. This expression can use the <code>Id</code> of the other metrics to refer to those metrics, and can also use the <code>Id</code> of other expressions to use the result of those expressions. </p> <p>Conditional: Within each <code>TargetTrackingMetricDataQuery</code> object, you must specify either <code>Expression</code> or <code>MetricStat</code>, but not both.</p>', 'UpdateAutoScalingGroupType$VPCZoneIdentifier' => '<p>A comma-separated list of subnet IDs for a virtual private cloud (VPC). If you specify <code>VPCZoneIdentifier</code> with <code>AvailabilityZones</code>, the subnets that you specify must reside in those Availability Zones.</p>', ], ], 'XmlStringMaxLen255' => [ 'base' => NULL, 'refs' => [ 'ActiveInstanceRefreshNotFoundFault$message' => NULL, 'Activity$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'Activity$StatusMessage' => '<p>A friendly, more verbose description of the activity status.</p>', 'AdjustmentType$AdjustmentType' => '<p>The policy adjustment type. The valid values are <code>ChangeInCapacity</code>, <code>ExactCapacity</code>, and <code>PercentChangeInCapacity</code>.</p>', 'Alarm$AlarmName' => '<p>The name of the alarm.</p>', 'AlreadyExistsFault$message' => '<p/>', 'AttachInstancesQuery$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'AttachLoadBalancerTargetGroupsType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'AttachLoadBalancersType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'AttachTrafficSourcesType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'AutoScalingGroup$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'AutoScalingGroup$LaunchConfigurationName' => '<p>The name of the associated launch configuration.</p>', 'AutoScalingGroup$PlacementGroup' => '<p>The name of the placement group into which to launch your instances, if any.</p>', 'AutoScalingGroup$Status' => '<p>The current state of the group when the <a>DeleteAutoScalingGroup</a> operation is in progress.</p>', 'AutoScalingGroup$DesiredCapacityType' => '<p>The unit of measurement for the value specified for desired capacity. Amazon EC2 Auto Scaling supports <code>DesiredCapacityType</code> for attribute-based instance type selection only.</p>', 'AutoScalingGroupNames$member' => NULL, 'AutoScalingInstanceDetails$InstanceType' => '<p>The instance type of the EC2 instance.</p>', 'AutoScalingInstanceDetails$AutoScalingGroupName' => '<p>The name of the Auto Scaling group for the instance.</p>', 'AutoScalingInstanceDetails$AvailabilityZone' => '<p>The Availability Zone for the instance.</p>', 'AutoScalingInstanceDetails$LaunchConfigurationName' => '<p>The launch configuration used to launch the instance. This value is not available if you attached the instance to the Auto Scaling group.</p>', 'AutoScalingNotificationTypes$member' => NULL, 'AvailabilityZones$member' => NULL, 'BatchDeleteScheduledActionType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'BatchPutScheduledUpdateGroupActionType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'BlockDeviceMapping$VirtualName' => '<p>The name of the instance store volume (virtual device) to attach to an instance at launch. The name must be in the form ephemeral<i>X</i> where <i>X</i> is a number starting from zero (0), for example, <code>ephemeral0</code>.</p>', 'BlockDeviceMapping$DeviceName' => '<p>The device name assigned to the volume (for example, <code>/dev/sdh</code> or <code>xvdh</code>). For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html\">Device naming on Linux instances</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> <note> <p>To define a block device mapping, set the device name and exactly one of the following properties: <code>Ebs</code>, <code>NoDevice</code>, or <code>VirtualName</code>.</p> </note>', 'CancelInstanceRefreshAnswer$InstanceRefreshId' => '<p>The instance refresh ID associated with the request. This is the unique ID assigned to the instance refresh when it was started.</p>', 'CancelInstanceRefreshType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'ClassicLinkVPCSecurityGroups$member' => NULL, 'CreateAutoScalingGroupType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group. This name must be unique per Region per account.</p> <p>The name can contain any ASCII character 33 to 126 including most punctuation characters, digits, and upper and lowercased letters.</p> <note> <p>You cannot use a colon (:) in the name.</p> </note>', 'CreateAutoScalingGroupType$LaunchConfigurationName' => '<p>The name of the launch configuration to use to launch instances. </p> <p>Conditional: You must specify either a launch template (<code>LaunchTemplate</code> or <code>MixedInstancesPolicy</code>) or a launch configuration (<code>LaunchConfigurationName</code> or <code>InstanceId</code>).</p>', 'CreateAutoScalingGroupType$PlacementGroup' => '<p>The name of the placement group into which to launch your instances. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html\">Placement groups</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> <note> <p>A <i>cluster</i> placement group is a logical grouping of instances within a single Availability Zone. You cannot specify multiple Availability Zones and a cluster placement group. </p> </note>', 'CreateAutoScalingGroupType$DesiredCapacityType' => '<p>The unit of measurement for the value specified for desired capacity. Amazon EC2 Auto Scaling supports <code>DesiredCapacityType</code> for attribute-based instance type selection only. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-instance-type-requirements.html\">Creating an Auto Scaling group using attribute-based instance type selection</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>By default, Amazon EC2 Auto Scaling specifies <code>units</code>, which translates into number of instances.</p> <p>Valid values: <code>units</code> | <code>vcpu</code> | <code>memory-mib</code> </p>', 'CreateLaunchConfigurationType$LaunchConfigurationName' => '<p>The name of the launch configuration. This name must be unique per Region per account.</p>', 'CreateLaunchConfigurationType$ImageId' => '<p>The ID of the Amazon Machine Image (AMI) that was assigned during registration. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html\">Finding a Linux AMI</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> <p>If you specify <code>InstanceId</code>, an <code>ImageId</code> is not required.</p>', 'CreateLaunchConfigurationType$KeyName' => '<p>The name of the key pair. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\">Amazon EC2 key pairs and Linux instances</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p>', 'CreateLaunchConfigurationType$ClassicLinkVPCId' => '<p>Available for backward compatibility.</p>', 'CreateLaunchConfigurationType$InstanceType' => '<p>Specifies the instance type of the EC2 instance. For information about available instance types, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#AvailableInstanceTypes\">Available instance types</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> <p>If you specify <code>InstanceId</code>, an <code>InstanceType</code> is not required.</p>', 'CreateLaunchConfigurationType$KernelId' => '<p>The ID of the kernel associated with the AMI.</p> <note> <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html\">User provided kernels</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> </note>', 'CreateLaunchConfigurationType$RamdiskId' => '<p>The ID of the RAM disk to select.</p> <note> <p>We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html\">User provided kernels</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> </note>', 'DeleteAutoScalingGroupType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DeleteLifecycleHookType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DeleteNotificationConfigurationType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DeleteNotificationConfigurationType$TopicARN' => '<p>The Amazon Resource Name (ARN) of the Amazon SNS topic.</p>', 'DeletePolicyType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DeleteScheduledActionType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DeleteScheduledActionType$ScheduledActionName' => '<p>The name of the action to delete.</p>', 'DeleteWarmPoolType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DescribeInstanceRefreshesType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DescribeLifecycleHooksType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DescribeLoadBalancerTargetGroupsRequest$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DescribeLoadBalancersRequest$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DescribePoliciesType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DescribeScalingActivitiesType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DescribeScheduledActionsType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DescribeTrafficSourcesRequest$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DescribeTrafficSourcesRequest$TrafficSourceType' => '<p>The traffic source type that you want to describe.</p> <p>The following lists the valid values:</p> <ul> <li> <p> <code>elb</code> if the traffic source is a Classic Load Balancer.</p> </li> <li> <p> <code>elbv2</code> if the traffic source is a Application Load Balancer, Gateway Load Balancer, or Network Load Balancer.</p> </li> <li> <p> <code>vpc-lattice</code> if the traffic source is VPC Lattice.</p> </li> </ul>', 'DescribeWarmPoolType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DetachInstancesQuery$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DetachLoadBalancerTargetGroupsType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DetachLoadBalancersType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DetachTrafficSourcesType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'DisableMetricsCollectionQuery$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'Ebs$SnapshotId' => '<p>The snapshot ID of the volume to use.</p> <p>You must specify either a <code>VolumeSize</code> or a <code>SnapshotId</code>.</p>', 'EnableMetricsCollectionQuery$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'EnableMetricsCollectionQuery$Granularity' => '<p>The frequency at which Amazon EC2 Auto Scaling sends aggregated data to CloudWatch. The only valid value is <code>1Minute</code>.</p>', 'EnabledMetric$Metric' => '<p>One of the following metrics:</p> <ul> <li> <p> <code>GroupMinSize</code> </p> </li> <li> <p> <code>GroupMaxSize</code> </p> </li> <li> <p> <code>GroupDesiredCapacity</code> </p> </li> <li> <p> <code>GroupInServiceInstances</code> </p> </li> <li> <p> <code>GroupPendingInstances</code> </p> </li> <li> <p> <code>GroupStandbyInstances</code> </p> </li> <li> <p> <code>GroupTerminatingInstances</code> </p> </li> <li> <p> <code>GroupTotalInstances</code> </p> </li> <li> <p> <code>GroupInServiceCapacity</code> </p> </li> <li> <p> <code>GroupPendingCapacity</code> </p> </li> <li> <p> <code>GroupStandbyCapacity</code> </p> </li> <li> <p> <code>GroupTerminatingCapacity</code> </p> </li> <li> <p> <code>GroupTotalCapacity</code> </p> </li> <li> <p> <code>WarmPoolDesiredCapacity</code> </p> </li> <li> <p> <code>WarmPoolWarmedCapacity</code> </p> </li> <li> <p> <code>WarmPoolPendingCapacity</code> </p> </li> <li> <p> <code>WarmPoolTerminatingCapacity</code> </p> </li> <li> <p> <code>WarmPoolTotalCapacity</code> </p> </li> <li> <p> <code>GroupAndWarmPoolDesiredCapacity</code> </p> </li> <li> <p> <code>GroupAndWarmPoolTotalCapacity</code> </p> </li> </ul> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-cloudwatch-monitoring.html#as-group-metrics\">Auto Scaling group metrics</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'EnabledMetric$Granularity' => '<p>The granularity of the metric. The only valid value is <code>1Minute</code>.</p>', 'EnterStandbyQuery$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'ExecutePolicyType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'ExitStandbyQuery$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'FailedScheduledUpdateGroupActionRequest$ScheduledActionName' => '<p>The name of the scheduled action.</p>', 'GetPredictiveScalingForecastType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'GetPredictiveScalingForecastType$PolicyName' => '<p>The name of the policy.</p>', 'Instance$InstanceType' => '<p>The instance type of the EC2 instance.</p>', 'Instance$AvailabilityZone' => '<p>The Availability Zone in which the instance is running.</p>', 'Instance$LaunchConfigurationName' => '<p>The launch configuration associated with the instance.</p>', 'InstanceRefresh$InstanceRefreshId' => '<p>The instance refresh ID.</p>', 'InstanceRefresh$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'InstanceRefreshIds$member' => NULL, 'InstanceRefreshInProgressFault$message' => NULL, 'InvalidNextToken$message' => '<p/>', 'IrreversibleInstanceRefreshFault$message' => NULL, 'LaunchConfiguration$LaunchConfigurationName' => '<p>The name of the launch configuration.</p>', 'LaunchConfiguration$ImageId' => '<p>The ID of the Amazon Machine Image (AMI) to use to launch your EC2 instances. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html\">Find a Linux AMI</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p>', 'LaunchConfiguration$KeyName' => '<p>The name of the key pair.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html\">Amazon EC2 Key Pairs</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p>', 'LaunchConfiguration$ClassicLinkVPCId' => '<p>Available for backward compatibility.</p>', 'LaunchConfiguration$InstanceType' => '<p>The instance type for the instances. For information about available instance types, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#AvailableInstanceTypes\">Available instance types</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p>', 'LaunchConfiguration$KernelId' => '<p>The ID of the kernel associated with the AMI.</p>', 'LaunchConfiguration$RamdiskId' => '<p>The ID of the RAM disk associated with the AMI.</p>', 'LaunchConfigurationNameType$LaunchConfigurationName' => '<p>The name of the launch configuration.</p>', 'LaunchConfigurationNames$member' => NULL, 'LaunchTemplateOverrides$InstanceType' => '<p>The instance type, such as <code>m3.xlarge</code>. You must specify an instance type that is supported in your requested Region and Availability Zones. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html\">Instance types</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p> <p>You can specify up to 40 instance types per Auto Scaling group.</p>', 'LaunchTemplateSpecification$LaunchTemplateId' => '<p>The ID of the launch template. To get the template ID, use the Amazon EC2 <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeLaunchTemplates.html\">DescribeLaunchTemplates</a> API operation. New launch templates can be created using the Amazon EC2 <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplate.html\">CreateLaunchTemplate</a> API. </p> <p>Conditional: You must specify either a <code>LaunchTemplateId</code> or a <code>LaunchTemplateName</code>.</p>', 'LaunchTemplateSpecification$Version' => '<p>The version number, <code>$Latest</code>, or <code>$Default</code>. To get the version number, use the Amazon EC2 <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeLaunchTemplateVersions.html\">DescribeLaunchTemplateVersions</a> API operation. New launch template versions can be created using the Amazon EC2 <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplateVersion.html\">CreateLaunchTemplateVersion</a> API. If the value is <code>$Latest</code>, Amazon EC2 Auto Scaling selects the latest version of the launch template when launching instances. If the value is <code>$Default</code>, Amazon EC2 Auto Scaling selects the default version of the launch template when launching instances. The default value is <code>$Default</code>.</p>', 'LifecycleHook$AutoScalingGroupName' => '<p>The name of the Auto Scaling group for the lifecycle hook.</p>', 'LifecycleHook$RoleARN' => '<p>The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target (an Amazon SNS topic or an Amazon SQS queue).</p>', 'LifecycleHookSpecification$RoleARN' => '<p>The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target. For information about creating this role, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/prepare-for-lifecycle-notifications.html#lifecycle-hook-notification-target\">Configure a notification target for a lifecycle hook</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>Valid only if the notification target is an Amazon SNS topic or an Amazon SQS queue.</p>', 'LimitExceededFault$message' => '<p/>', 'LoadBalancerNames$member' => NULL, 'LoadBalancerState$LoadBalancerName' => '<p>The name of the load balancer.</p>', 'LoadBalancerState$State' => '<p>One of the following load balancer states:</p> <ul> <li> <p> <code>Adding</code> - The Auto Scaling instances are being registered with the load balancer.</p> </li> <li> <p> <code>Added</code> - All Auto Scaling instances are registered with the load balancer.</p> </li> <li> <p> <code>InService</code> - At least one Auto Scaling instance passed an <code>ELB</code> health check.</p> </li> <li> <p> <code>Removing</code> - The Auto Scaling instances are being deregistered from the load balancer. If connection draining is enabled, Elastic Load Balancing waits for in-flight requests to complete before deregistering the instances.</p> </li> <li> <p> <code>Removed</code> - All Auto Scaling instances are deregistered from the load balancer.</p> </li> </ul>', 'LoadBalancerTargetGroupState$State' => '<p>The state of the target group.</p> <ul> <li> <p> <code>Adding</code> - The Auto Scaling instances are being registered with the target group.</p> </li> <li> <p> <code>Added</code> - All Auto Scaling instances are registered with the target group.</p> </li> <li> <p> <code>InService</code> - At least one Auto Scaling instance passed an <code>ELB</code> health check.</p> </li> <li> <p> <code>Removing</code> - The Auto Scaling instances are being deregistered from the target group. If connection draining is enabled, Elastic Load Balancing waits for in-flight requests to complete before deregistering the instances.</p> </li> <li> <p> <code>Removed</code> - All Auto Scaling instances are deregistered from the target group.</p> </li> </ul>', 'MetricCollectionType$Metric' => '<p>One of the following metrics:</p> <ul> <li> <p> <code>GroupMinSize</code> </p> </li> <li> <p> <code>GroupMaxSize</code> </p> </li> <li> <p> <code>GroupDesiredCapacity</code> </p> </li> <li> <p> <code>GroupInServiceInstances</code> </p> </li> <li> <p> <code>GroupPendingInstances</code> </p> </li> <li> <p> <code>GroupStandbyInstances</code> </p> </li> <li> <p> <code>GroupTerminatingInstances</code> </p> </li> <li> <p> <code>GroupTotalInstances</code> </p> </li> <li> <p> <code>GroupInServiceCapacity</code> </p> </li> <li> <p> <code>GroupPendingCapacity</code> </p> </li> <li> <p> <code>GroupStandbyCapacity</code> </p> </li> <li> <p> <code>GroupTerminatingCapacity</code> </p> </li> <li> <p> <code>GroupTotalCapacity</code> </p> </li> <li> <p> <code>WarmPoolDesiredCapacity</code> </p> </li> <li> <p> <code>WarmPoolWarmedCapacity</code> </p> </li> <li> <p> <code>WarmPoolPendingCapacity</code> </p> </li> <li> <p> <code>WarmPoolTerminatingCapacity</code> </p> </li> <li> <p> <code>WarmPoolTotalCapacity</code> </p> </li> <li> <p> <code>GroupAndWarmPoolDesiredCapacity</code> </p> </li> <li> <p> <code>GroupAndWarmPoolTotalCapacity</code> </p> </li> </ul>', 'MetricDataQuery$Id' => '<p>A short name that identifies the object\\'s results in the response. This name must be unique among all <code>MetricDataQuery</code> objects specified for a single scaling policy. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscores. The first character must be a lowercase letter. </p>', 'MetricGranularityType$Granularity' => '<p>The granularity. The only valid value is <code>1Minute</code>.</p>', 'Metrics$member' => NULL, 'NotificationConfiguration$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'NotificationConfiguration$TopicARN' => '<p>The Amazon Resource Name (ARN) of the Amazon SNS topic.</p>', 'NotificationConfiguration$NotificationType' => '<p>One of the following event notification types:</p> <ul> <li> <p> <code>autoscaling:EC2_INSTANCE_LAUNCH</code> </p> </li> <li> <p> <code>autoscaling:EC2_INSTANCE_LAUNCH_ERROR</code> </p> </li> <li> <p> <code>autoscaling:EC2_INSTANCE_TERMINATE</code> </p> </li> <li> <p> <code>autoscaling:EC2_INSTANCE_TERMINATE_ERROR</code> </p> </li> <li> <p> <code>autoscaling:TEST_NOTIFICATION</code> </p> </li> </ul>', 'ProcessNames$member' => NULL, 'ProcessType$ProcessName' => '<p>One of the following processes:</p> <ul> <li> <p> <code>Launch</code> </p> </li> <li> <p> <code>Terminate</code> </p> </li> <li> <p> <code>AddToLoadBalancer</code> </p> </li> <li> <p> <code>AlarmNotification</code> </p> </li> <li> <p> <code>AZRebalance</code> </p> </li> <li> <p> <code>HealthCheck</code> </p> </li> <li> <p> <code>InstanceRefresh</code> </p> </li> <li> <p> <code>ReplaceUnhealthy</code> </p> </li> <li> <p> <code>ScheduledActions</code> </p> </li> </ul>', 'PutLifecycleHookType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'PutLifecycleHookType$RoleARN' => '<p>The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.</p> <p>Valid only if the notification target is an Amazon SNS topic or an Amazon SQS queue. Required for new lifecycle hooks, but optional when updating existing hooks.</p>', 'PutNotificationConfigurationType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'PutNotificationConfigurationType$TopicARN' => '<p>The Amazon Resource Name (ARN) of the Amazon SNS topic.</p>', 'PutScalingPolicyType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'PutScalingPolicyType$PolicyName' => '<p>The name of the policy.</p>', 'PutScalingPolicyType$AdjustmentType' => '<p>Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid values are <code>ChangeInCapacity</code>, <code>ExactCapacity</code>, and <code>PercentChangeInCapacity</code>.</p> <p>Required if the policy type is <code>StepScaling</code> or <code>SimpleScaling</code>. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment\">Scaling adjustment types</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'PutScheduledUpdateGroupActionType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'PutScheduledUpdateGroupActionType$ScheduledActionName' => '<p>The name of this scaling action.</p>', 'PutScheduledUpdateGroupActionType$Recurrence' => '<p>The recurring schedule for this action. This format consists of five fields separated by white spaces: [Minute] [Hour] [Day_of_Month] [Month_of_Year] [Day_of_Week]. The value must be in quotes (for example, <code>\"30 0 1 1,6,12 *\"</code>). For more information about this format, see <a href=\"http://crontab.org\">Crontab</a>.</p> <p>When <code>StartTime</code> and <code>EndTime</code> are specified with <code>Recurrence</code>, they form the boundaries of when the recurring action starts and stops.</p> <p>Cron expressions use Universal Coordinated Time (UTC) by default.</p>', 'PutScheduledUpdateGroupActionType$TimeZone' => '<p>Specifies the time zone for a cron expression. If a time zone is not provided, UTC is used by default. </p> <p>Valid values are the canonical names of the IANA time zones, derived from the IANA Time Zone Database (such as <code>Etc/GMT+9</code> or <code>Pacific/Tahiti</code>). For more information, see <a href=\"https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\">https://en.wikipedia.org/wiki/List_of_tz_database_time_zones</a>.</p>', 'PutWarmPoolType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'ResourceContentionFault$message' => '<p/>', 'ResourceInUseFault$message' => '<p/>', 'RollbackInstanceRefreshAnswer$InstanceRefreshId' => '<p>The instance refresh ID associated with the request. This is the unique ID assigned to the instance refresh when it was started.</p>', 'RollbackInstanceRefreshType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'ScalingActivityInProgressFault$message' => '<p/>', 'ScalingPolicy$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'ScalingPolicy$PolicyName' => '<p>The name of the scaling policy.</p>', 'ScalingPolicy$AdjustmentType' => '<p>Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid values are <code>ChangeInCapacity</code>, <code>ExactCapacity</code>, and <code>PercentChangeInCapacity</code>.</p>', 'ScalingProcessQuery$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'ScheduledActionNames$member' => NULL, 'ScheduledUpdateGroupAction$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'ScheduledUpdateGroupAction$ScheduledActionName' => '<p>The name of the scheduled action.</p>', 'ScheduledUpdateGroupAction$Recurrence' => '<p>The recurring schedule for the action, in Unix cron syntax format.</p> <p>When <code>StartTime</code> and <code>EndTime</code> are specified with <code>Recurrence</code>, they form the boundaries of when the recurring action starts and stops.</p>', 'ScheduledUpdateGroupAction$TimeZone' => '<p>The time zone for the cron expression.</p>', 'ScheduledUpdateGroupActionRequest$ScheduledActionName' => '<p>The name of the scaling action.</p>', 'ScheduledUpdateGroupActionRequest$Recurrence' => '<p>The recurring schedule for the action, in Unix cron syntax format. This format consists of five fields separated by white spaces: [Minute] [Hour] [Day_of_Month] [Month_of_Year] [Day_of_Week]. The value must be in quotes (for example, <code>\"30 0 1 1,6,12 *\"</code>). For more information about this format, see <a href=\"http://crontab.org\">Crontab</a>.</p> <p>When <code>StartTime</code> and <code>EndTime</code> are specified with <code>Recurrence</code>, they form the boundaries of when the recurring action starts and stops.</p> <p>Cron expressions use Universal Coordinated Time (UTC) by default.</p>', 'ScheduledUpdateGroupActionRequest$TimeZone' => '<p>Specifies the time zone for a cron expression. If a time zone is not provided, UTC is used by default. </p> <p>Valid values are the canonical names of the IANA time zones, derived from the IANA Time Zone Database (such as <code>Etc/GMT+9</code> or <code>Pacific/Tahiti</code>). For more information, see <a href=\"https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\">https://en.wikipedia.org/wiki/List_of_tz_database_time_zones</a>.</p>', 'ServiceLinkedRoleFailure$message' => NULL, 'SetDesiredCapacityType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'SetInstanceProtectionQuery$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'StartInstanceRefreshAnswer$InstanceRefreshId' => '<p>A unique ID for tracking the progress of the instance refresh.</p>', 'StartInstanceRefreshType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'SuspendedProcess$ProcessName' => '<p>The name of the suspended process.</p>', 'SuspendedProcess$SuspensionReason' => '<p>The reason that the process was suspended.</p>', 'TargetTrackingMetricDataQuery$Id' => '<p>A short name that identifies the object\\'s results in the response. This name must be unique among all <code>TargetTrackingMetricDataQuery</code> objects specified for a single scaling policy. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscores. The first character must be a lowercase letter. </p>', 'TrafficSourceState$State' => '<p>Describes the current state of a traffic source.</p> <p>The state values are as follows:</p> <ul> <li> <p> <code>Adding</code> - The Auto Scaling instances are being registered with the load balancer or target group.</p> </li> <li> <p> <code>Added</code> - All Auto Scaling instances are registered with the load balancer or target group.</p> </li> <li> <p> <code>InService</code> - For an Elastic Load Balancing load balancer or target group, at least one Auto Scaling instance passed an <code>ELB</code> health check. For VPC Lattice, at least one Auto Scaling instance passed an <code>VPC_LATTICE</code> health check.</p> </li> <li> <p> <code>Removing</code> - The Auto Scaling instances are being deregistered from the load balancer or target group. If connection draining (deregistration delay) is enabled, Elastic Load Balancing or VPC Lattice waits for in-flight requests to complete before deregistering the instances.</p> </li> <li> <p> <code>Removed</code> - All Auto Scaling instances are deregistered from the load balancer or target group.</p> </li> </ul>', 'UpdateAutoScalingGroupType$AutoScalingGroupName' => '<p>The name of the Auto Scaling group.</p>', 'UpdateAutoScalingGroupType$LaunchConfigurationName' => '<p>The name of the launch configuration. If you specify <code>LaunchConfigurationName</code> in your update request, you can\\'t specify <code>LaunchTemplate</code> or <code>MixedInstancesPolicy</code>.</p>', 'UpdateAutoScalingGroupType$PlacementGroup' => '<p>The name of an existing placement group into which to launch your instances. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html\">Placement groups</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> <note> <p>A <i>cluster</i> placement group is a logical grouping of instances within a single Availability Zone. You cannot specify multiple Availability Zones and a cluster placement group. </p> </note>', 'UpdateAutoScalingGroupType$DesiredCapacityType' => '<p>The unit of measurement for the value specified for desired capacity. Amazon EC2 Auto Scaling supports <code>DesiredCapacityType</code> for attribute-based instance type selection only. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-instance-type-requirements.html\">Creating an Auto Scaling group using attribute-based instance type selection</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>By default, Amazon EC2 Auto Scaling specifies <code>units</code>, which translates into number of instances.</p> <p>Valid values: <code>units</code> | <code>vcpu</code> | <code>memory-mib</code> </p>', ], ], 'XmlStringMaxLen32' => [ 'base' => NULL, 'refs' => [ 'AutoScalingGroup$HealthCheckType' => '<p>A comma-separated value string of one or more health check types.</p>', 'AutoScalingInstanceDetails$LifecycleState' => '<p>The lifecycle state for the instance. The <code>Quarantined</code> state is not used. For information about lifecycle states, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroupLifecycle.html\">Instance lifecycle</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>. </p> <p>Valid values: <code>Pending</code> | <code>Pending:Wait</code> | <code>Pending:Proceed</code> | <code>Quarantined</code> | <code>InService</code> | <code>Terminating</code> | <code>Terminating:Wait</code> | <code>Terminating:Proceed</code> | <code>Terminated</code> | <code>Detaching</code> | <code>Detached</code> | <code>EnteringStandby</code> | <code>Standby</code> | <code>Warmed:Pending</code> | <code>Warmed:Pending:Wait</code> | <code>Warmed:Pending:Proceed</code> | <code>Warmed:Terminating</code> | <code>Warmed:Terminating:Wait</code> | <code>Warmed:Terminating:Proceed</code> | <code>Warmed:Terminated</code> | <code>Warmed:Stopped</code> | <code>Warmed:Running</code> </p>', 'AutoScalingInstanceDetails$HealthStatus' => '<p>The last reported health status of this instance. <code>Healthy</code> means that the instance is healthy and should remain in service. <code>Unhealthy</code> means that the instance is unhealthy and Amazon EC2 Auto Scaling should terminate and replace it.</p>', 'AutoScalingInstanceDetails$WeightedCapacity' => '<p>The number of capacity units contributed by the instance based on its instance type.</p> <p>Valid Range: Minimum value of 1. Maximum value of 999.</p>', 'CreateAutoScalingGroupType$HealthCheckType' => '<p>A comma-separated value string of one or more health check types.</p> <p>The valid values are <code>EC2</code>, <code>ELB</code>, and <code>VPC_LATTICE</code>. <code>EC2</code> is the default health check and cannot be disabled. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html\">Health checks for Auto Scaling instances</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>Only specify <code>EC2</code> if you must clear a value that was previously set.</p>', 'Instance$HealthStatus' => '<p>The last reported health status of the instance. <code>Healthy</code> means that the instance is healthy and should remain in service. <code>Unhealthy</code> means that the instance is unhealthy and that Amazon EC2 Auto Scaling should terminate and replace it.</p>', 'Instance$WeightedCapacity' => '<p>The number of capacity units contributed by the instance based on its instance type.</p> <p>Valid Range: Minimum value of 1. Maximum value of 999.</p>', 'LaunchTemplateOverrides$WeightedCapacity' => '<p>If you provide a list of instance types to use, you can specify the number of capacity units provided by each instance type in terms of virtual CPUs, memory, storage, throughput, or other relative performance characteristic. When a Spot or On-Demand Instance is launched, the capacity units count toward the desired capacity. Amazon EC2 Auto Scaling launches instances until the desired capacity is totally fulfilled, even if this results in an overage. For example, if there are two units remaining to fulfill capacity, and Amazon EC2 Auto Scaling can only launch an instance with a <code>WeightedCapacity</code> of five units, the instance is launched, and the desired capacity is exceeded by three units. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups-instance-weighting.html\">Configuring instance weighting for Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>. Value must be in the range of 1\u00e2\u20ac\u201c999.</p> <p>If you specify a value for <code>WeightedCapacity</code> for one instance type, you must specify a value for <code>WeightedCapacity</code> for all of them.</p> <important> <p>Every Auto Scaling group has three size parameters (<code>DesiredCapacity</code>, <code>MaxSize</code>, and <code>MinSize</code>). Usually, you set these sizes based on a specific number of instances. However, if you configure a mixed instances policy that defines weights for the instance types, you must specify these sizes with the same units that you use for weighting instances. </p> </important>', 'PutScalingPolicyType$MetricAggregationType' => '<p>The aggregation type for the CloudWatch metrics. The valid values are <code>Minimum</code>, <code>Maximum</code>, and <code>Average</code>. If the aggregation type is null, the value is treated as <code>Average</code>.</p> <p>Valid only if the policy type is <code>StepScaling</code>.</p>', 'ScalingPolicy$MetricAggregationType' => '<p>The aggregation type for the CloudWatch metrics. The valid values are <code>Minimum</code>, <code>Maximum</code>, and <code>Average</code>.</p>', 'SetInstanceHealthQuery$HealthStatus' => '<p>The health status of the instance. Set to <code>Healthy</code> to have the instance remain in service. Set to <code>Unhealthy</code> to have the instance be out of service. Amazon EC2 Auto Scaling terminates and replaces the unhealthy instance.</p>', 'UpdateAutoScalingGroupType$HealthCheckType' => '<p>A comma-separated value string of one or more health check types.</p> <p>The valid values are <code>EC2</code>, <code>ELB</code>, and <code>VPC_LATTICE</code>. <code>EC2</code> is the default health check and cannot be disabled. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html\">Health checks for Auto Scaling instances</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>Only specify <code>EC2</code> if you must clear a value that was previously set.</p>', ], ], 'XmlStringMaxLen511' => [ 'base' => NULL, 'refs' => [ 'LoadBalancerTargetGroupState$LoadBalancerTargetGroupARN' => '<p>The Amazon Resource Name (ARN) of the target group.</p>', 'TargetGroupARNs$member' => NULL, 'TrafficSourceIdentifier$Identifier' => '<p>Identifies the traffic source.</p> <p>For Application Load Balancers, Gateway Load Balancers, Network Load Balancers, and VPC Lattice, this will be the Amazon Resource Name (ARN) for a target group in this account and Region. For Classic Load Balancers, this will be the name of the Classic Load Balancer in this account and Region.</p> <p>For example: </p> <ul> <li> <p>Application Load Balancer ARN: <code>arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/1234567890123456</code> </p> </li> <li> <p>Classic Load Balancer name: <code>my-classic-load-balancer</code> </p> </li> <li> <p>VPC Lattice ARN: <code>arn:aws:vpc-lattice:us-west-2:123456789012:targetgroup/tg-1234567890123456</code> </p> </li> </ul> <p>To get the ARN of a target group for a Application Load Balancer, Gateway Load Balancer, or Network Load Balancer, or the name of a Classic Load Balancer, use the Elastic Load Balancing <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html\">DescribeTargetGroups</a> and <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html\">DescribeLoadBalancers</a> API operations.</p> <p>To get the ARN of a target group for VPC Lattice, use the VPC Lattice <a href=\"https://docs.aws.amazon.com/vpc-lattice/latest/APIReference/API_GetTargetGroup.html\">GetTargetGroup</a> API operation.</p>', 'TrafficSourceIdentifier$Type' => '<p>Provides additional context for the value of <code>Identifier</code>.</p> <p>The following lists the valid values:</p> <ul> <li> <p> <code>elb</code> if <code>Identifier</code> is the name of a Classic Load Balancer.</p> </li> <li> <p> <code>elbv2</code> if <code>Identifier</code> is the ARN of an Application Load Balancer, Gateway Load Balancer, or Network Load Balancer target group.</p> </li> <li> <p> <code>vpc-lattice</code> if <code>Identifier</code> is the ARN of a VPC Lattice target group.</p> </li> </ul> <p>Required if the identifier is the name of a Classic Load Balancer.</p>', 'TrafficSourceState$TrafficSource' => '<p>This is replaced by <code>Identifier</code>.</p>', 'TrafficSourceState$Identifier' => '<p>The unique identifier of the traffic source.</p>', 'TrafficSourceState$Type' => '<p>Provides additional context for the value of <code>Identifier</code>.</p> <p>The following lists the valid values:</p> <ul> <li> <p> <code>elb</code> if <code>Identifier</code> is the name of a Classic Load Balancer.</p> </li> <li> <p> <code>elbv2</code> if <code>Identifier</code> is the ARN of an Application Load Balancer, Gateway Load Balancer, or Network Load Balancer target group.</p> </li> <li> <p> <code>vpc-lattice</code> if <code>Identifier</code> is the ARN of a VPC Lattice target group.</p> </li> </ul> <p>Required if the identifier is the name of a Classic Load Balancer.</p>', ], ], 'XmlStringMaxLen64' => [ 'base' => NULL, 'refs' => [ 'CreateLaunchConfigurationType$PlacementTenancy' => '<p>The tenancy of the instance, either <code>default</code> or <code>dedicated</code>. An instance with <code>dedicated</code> tenancy runs on isolated, single-tenant hardware and can only be launched into a VPC. To launch dedicated instances into a shared tenancy VPC (a VPC with the instance placement tenancy attribute set to <code>default</code>), you must set the value of this property to <code>dedicated</code>. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-dedicated-instances.html\">Configuring instance tenancy with Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>If you specify <code>PlacementTenancy</code>, you must specify at least one subnet for <code>VPCZoneIdentifier</code> when you create your group.</p> <p>Valid values: <code>default</code> | <code>dedicated</code> </p>', 'FailedScheduledUpdateGroupActionRequest$ErrorCode' => '<p>The error code.</p>', 'LaunchConfiguration$PlacementTenancy' => '<p>The tenancy of the instance, either <code>default</code> or <code>dedicated</code>. An instance with <code>dedicated</code> tenancy runs on isolated, single-tenant hardware and can only be launched into a VPC.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-dedicated-instances.html\">Configuring instance tenancy with Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', 'PolicyTypes$member' => NULL, 'PutScalingPolicyType$PolicyType' => '<p>One of the following policy types: </p> <ul> <li> <p> <code>TargetTrackingScaling</code> </p> </li> <li> <p> <code>StepScaling</code> </p> </li> <li> <p> <code>SimpleScaling</code> (default)</p> </li> <li> <p> <code>PredictiveScaling</code> </p> </li> </ul>', 'ScalingPolicy$PolicyType' => '<p>One of the following policy types: </p> <ul> <li> <p> <code>TargetTrackingScaling</code> </p> </li> <li> <p> <code>StepScaling</code> </p> </li> <li> <p> <code>SimpleScaling</code> (default)</p> </li> <li> <p> <code>PredictiveScaling</code> </p> </li> </ul> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-target-tracking.html\">Target tracking scaling policies</a> and <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html\">Step and simple scaling policies</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>', ], ], 'XmlStringMetricLabel' => [ 'base' => NULL, 'refs' => [ 'MetricDataQuery$Label' => '<p>A human-readable label for this metric or expression. This is especially useful if this is a math expression, so that you know what the value represents.</p>', 'TargetTrackingMetricDataQuery$Label' => '<p>A human-readable label for this metric or expression. This is especially useful if this is a math expression, so that you know what the value represents.</p>', ], ], 'XmlStringMetricStat' => [ 'base' => NULL, 'refs' => [ 'MetricStat$Stat' => '<p>The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Statistic\">Statistics</a> in the <i>Amazon CloudWatch User Guide</i>.</p> <p>The most commonly used metrics for predictive scaling are <code>Average</code> and <code>Sum</code>.</p>', 'TargetTrackingMetricStat$Stat' => '<p>The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Statistic\">Statistics</a> in the <i>Amazon CloudWatch User Guide</i>.</p> <p>The most commonly used metric for scaling is <code>Average</code>.</p>', ], ], 'XmlStringUserData' => [ 'base' => NULL, 'refs' => [ 'CreateLaunchConfigurationType$UserData' => '<p>The user data to make available to the launched EC2 instances. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html\">Instance metadata and user data</a> (Linux) and <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-metadata.html\">Instance metadata and user data</a> (Windows). If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text. User data is limited to 16 KB.</p>', 'LaunchConfiguration$UserData' => '<p>The user data to make available to the launched EC2 instances. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html\">Instance metadata and user data</a> (Linux) and <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-metadata.html\">Instance metadata and user data</a> (Windows). If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text. User data is limited to 16 KB.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/autoscaling/2011-01-01/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://autoscaling-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ 'aws-us-gov', [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], ], ], ], 'endpoint' => [ 'url' => 'https://autoscaling.{Region}.amazonaws.com', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://autoscaling-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://autoscaling.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://autoscaling.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/autoscaling/2011-01-01/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.us-iso-west-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/autoscaling/2011-01-01/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [ 'AttachInstances' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'InstanceIds' => [ 'i-93633f9b', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example attaches the specified instance to the specified Auto Scaling group.', 'id' => 'autoscaling-attach-instances-1', 'title' => 'To attach an instance to an Auto Scaling group', ], ], 'AttachLoadBalancerTargetGroups' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'TargetGroupARNs' => [ 'arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example attaches the specified target group to the specified Auto Scaling group.', 'id' => 'autoscaling-attach-load-balancer-target-groups-1', 'title' => 'To attach a target group to an Auto Scaling group', ], ], 'AttachLoadBalancers' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'LoadBalancerNames' => [ 'my-load-balancer', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example attaches the specified load balancer to the specified Auto Scaling group.', 'id' => 'autoscaling-attach-load-balancers-1', 'title' => 'To attach a load balancer to an Auto Scaling group', ], ], 'AttachTrafficSources' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'TrafficSources' => [ [ 'Identifier' => 'arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067', ], ], ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example attaches the specified target group to the specified Auto Scaling group.', 'id' => 'to-attach-a-target-group-to-an-auto-scaling-group-1680036570089', 'title' => 'To attach a target group to an Auto Scaling group', ], ], 'CancelInstanceRefresh' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', ], 'output' => [ 'InstanceRefreshId' => '08b91cf7-8fa6-48af-b6a6-d227f40f1b9b', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example cancels an instance refresh operation in progress.', 'id' => 'to-cancel-an-instance-refresh-1592960979817', 'title' => 'To cancel an instance refresh', ], ], 'CompleteLifecycleAction' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'LifecycleActionResult' => 'CONTINUE', 'LifecycleActionToken' => 'bcd2f1b8-9a78-44d3-8a7a-4dd07d7cf635', 'LifecycleHookName' => 'my-lifecycle-hook', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example notifies Auto Scaling that the specified lifecycle action is complete so that it can finish launching or terminating the instance.', 'id' => 'autoscaling-complete-lifecycle-action-1', 'title' => 'To complete the lifecycle action', ], ], 'CreateAutoScalingGroup' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'LaunchTemplate' => [ 'LaunchTemplateName' => 'my-template-for-auto-scaling', 'Version' => '$Latest', ], 'MaxInstanceLifetime' => 2592000, 'MaxSize' => 3, 'MinSize' => 1, 'VPCZoneIdentifier' => 'subnet-057fa0918fEXAMPLE', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example creates an Auto Scaling group.', 'id' => 'autoscaling-create-auto-scaling-group-1', 'title' => 'To create an Auto Scaling group', ], [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'HealthCheckGracePeriod' => 300, 'HealthCheckType' => 'ELB', 'LaunchTemplate' => [ 'LaunchTemplateName' => 'my-template-for-auto-scaling', 'Version' => '$Latest', ], 'MaxSize' => 3, 'MinSize' => 1, 'TargetGroupARNs' => [ 'arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067', ], 'VPCZoneIdentifier' => 'subnet-057fa0918fEXAMPLE, subnet-610acd08EXAMPLE', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example creates an Auto Scaling group and attaches the specified target group.', 'id' => 'autoscaling-create-auto-scaling-group-2', 'title' => 'To create an Auto Scaling group with an attached target group', ], [ 'input' => [ 'AutoScalingGroupName' => 'my-asg', 'DesiredCapacity' => 3, 'MaxSize' => 5, 'MinSize' => 1, 'MixedInstancesPolicy' => [ 'InstancesDistribution' => [ 'OnDemandBaseCapacity' => 1, 'OnDemandPercentageAboveBaseCapacity' => 50, 'SpotAllocationStrategy' => 'capacity-optimized', ], 'LaunchTemplate' => [ 'LaunchTemplateSpecification' => [ 'LaunchTemplateName' => 'my-launch-template-for-x86', 'Version' => '$Latest', ], 'Overrides' => [ [ 'InstanceType' => 'c6g.large', 'LaunchTemplateSpecification' => [ 'LaunchTemplateName' => 'my-launch-template-for-arm', 'Version' => '$Latest', ], ], [ 'InstanceType' => 'c5.large', ], [ 'InstanceType' => 'c5a.large', ], ], ], ], 'VPCZoneIdentifier' => 'subnet-057fa0918fEXAMPLE, subnet-610acd08EXAMPLE', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example creates an Auto Scaling group with a mixed instances policy. It specifies the c5.large, c5a.large, and c6g.large instance types and defines a different launch template for the c6g.large instance type.', 'id' => 'to-create-an-auto-scaling-group-with-a-mixed-instances-policy-1617815269039', 'title' => 'To create an Auto Scaling group with a mixed instances policy', ], ], 'CreateLaunchConfiguration' => [ [ 'input' => [ 'IamInstanceProfile' => 'my-iam-role', 'ImageId' => 'ami-12345678', 'InstanceType' => 'm3.medium', 'LaunchConfigurationName' => 'my-launch-config', 'SecurityGroups' => [ 'sg-eb2af88e', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example creates a launch configuration.', 'id' => 'autoscaling-create-launch-configuration-1', 'title' => 'To create a launch configuration', ], ], 'CreateOrUpdateTags' => [ [ 'input' => [ 'Tags' => [ [ 'Key' => 'Role', 'PropagateAtLaunch' => true, 'ResourceId' => 'my-auto-scaling-group', 'ResourceType' => 'auto-scaling-group', 'Value' => 'WebServer', ], [ 'Key' => 'Dept', 'PropagateAtLaunch' => true, 'ResourceId' => 'my-auto-scaling-group', 'ResourceType' => 'auto-scaling-group', 'Value' => 'Research', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example adds two tags to the specified Auto Scaling group.', 'id' => 'autoscaling-create-or-update-tags-1', 'title' => 'To create or update tags for an Auto Scaling group', ], ], 'DeleteAutoScalingGroup' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example deletes the specified Auto Scaling group.', 'id' => 'autoscaling-delete-auto-scaling-group-1', 'title' => 'To delete an Auto Scaling group', ], [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'ForceDelete' => true, ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example deletes the specified Auto Scaling group and all its instances.', 'id' => 'autoscaling-delete-auto-scaling-group-2', 'title' => 'To delete an Auto Scaling group and all its instances', ], ], 'DeleteLaunchConfiguration' => [ [ 'input' => [ 'LaunchConfigurationName' => 'my-launch-config', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example deletes the specified launch configuration.', 'id' => 'autoscaling-delete-launch-configuration-1', 'title' => 'To delete a launch configuration', ], ], 'DeleteLifecycleHook' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'LifecycleHookName' => 'my-lifecycle-hook', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example deletes the specified lifecycle hook.', 'id' => 'autoscaling-delete-lifecycle-hook-1', 'title' => 'To delete a lifecycle hook', ], ], 'DeleteNotificationConfiguration' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'TopicARN' => 'arn:aws:sns:us-west-2:123456789012:my-sns-topic', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example deletes the specified notification from the specified Auto Scaling group.', 'id' => 'autoscaling-delete-notification-configuration-1', 'title' => 'To delete an Auto Scaling notification', ], ], 'DeletePolicy' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'PolicyName' => 'my-step-scale-out-policy', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example deletes the specified Auto Scaling policy.', 'id' => 'autoscaling-delete-policy-1', 'title' => 'To delete an Auto Scaling policy', ], ], 'DeleteScheduledAction' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'ScheduledActionName' => 'my-scheduled-action', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example deletes the specified scheduled action from the specified Auto Scaling group.', 'id' => 'autoscaling-delete-scheduled-action-1', 'title' => 'To delete a scheduled action from an Auto Scaling group', ], ], 'DeleteTags' => [ [ 'input' => [ 'Tags' => [ [ 'Key' => 'Dept', 'ResourceId' => 'my-auto-scaling-group', 'ResourceType' => 'auto-scaling-group', 'Value' => 'Research', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example deletes the specified tag from the specified Auto Scaling group.', 'id' => 'autoscaling-delete-tags-1', 'title' => 'To delete a tag from an Auto Scaling group', ], ], 'DescribeAccountLimits' => [ [ 'output' => [ 'MaxNumberOfAutoScalingGroups' => 20, 'MaxNumberOfLaunchConfigurations' => 100, 'NumberOfAutoScalingGroups' => 3, 'NumberOfLaunchConfigurations' => 5, ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the Amazon EC2 Auto Scaling service quotas for your account.', 'id' => 'autoscaling-describe-account-limits-1', 'title' => 'To describe your Auto Scaling account limits', ], ], 'DescribeAdjustmentTypes' => [ [ 'output' => [ 'AdjustmentTypes' => [ [ 'AdjustmentType' => 'ChangeInCapacity', ], [ 'AdjustmentType' => 'ExactCapcity', ], [ 'AdjustmentType' => 'PercentChangeInCapacity', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the available adjustment types.', 'id' => 'autoscaling-describe-adjustment-types-1', 'title' => 'To describe the Amazon EC2 Auto Scaling adjustment types', ], ], 'DescribeAutoScalingGroups' => [ [ 'input' => [ 'AutoScalingGroupNames' => [ 'my-auto-scaling-group', ], ], 'output' => [ 'AutoScalingGroups' => [ [ 'AutoScalingGroupARN' => 'arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:930d940e-891e-4781-a11a-7b0acd480f03:autoScalingGroupName/my-auto-scaling-group', 'AutoScalingGroupName' => 'my-auto-scaling-group', 'AvailabilityZones' => [ 'us-west-2c', ], 'CreatedTime' => '2013-08-19T20:53:25.584Z', 'DefaultCooldown' => 300, 'DesiredCapacity' => 1, 'EnabledMetrics' => [], 'HealthCheckGracePeriod' => 300, 'HealthCheckType' => 'EC2', 'Instances' => [ [ 'AvailabilityZone' => 'us-west-2c', 'HealthStatus' => 'Healthy', 'InstanceId' => 'i-4ba0837f', 'LaunchConfigurationName' => 'my-launch-config', 'LifecycleState' => 'InService', 'ProtectedFromScaleIn' => false, ], ], 'LaunchConfigurationName' => 'my-launch-config', 'LoadBalancerNames' => [], 'MaxSize' => 1, 'MinSize' => 0, 'NewInstancesProtectedFromScaleIn' => false, 'SuspendedProcesses' => [], 'Tags' => [], 'TerminationPolicies' => [ 'Default', ], 'VPCZoneIdentifier' => 'subnet-12345678', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the specified Auto Scaling group.', 'id' => 'autoscaling-describe-auto-scaling-groups-1', 'title' => 'To describe an Auto Scaling group', ], ], 'DescribeAutoScalingInstances' => [ [ 'input' => [ 'InstanceIds' => [ 'i-4ba0837f', ], ], 'output' => [ 'AutoScalingInstances' => [ [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'AvailabilityZone' => 'us-west-2c', 'HealthStatus' => 'HEALTHY', 'InstanceId' => 'i-4ba0837f', 'LaunchConfigurationName' => 'my-launch-config', 'LifecycleState' => 'InService', 'ProtectedFromScaleIn' => false, ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the specified Auto Scaling instance.', 'id' => 'autoscaling-describe-auto-scaling-instances-1', 'title' => 'To describe one or more Auto Scaling instances', ], ], 'DescribeAutoScalingNotificationTypes' => [ [ 'output' => [ 'AutoScalingNotificationTypes' => [ 'autoscaling:EC2_INSTANCE_LAUNCH', 'autoscaling:EC2_INSTANCE_LAUNCH_ERROR', 'autoscaling:EC2_INSTANCE_TERMINATE', 'autoscaling:EC2_INSTANCE_TERMINATE_ERROR', 'autoscaling:TEST_NOTIFICATION', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the available notification types.', 'id' => 'autoscaling-describe-auto-scaling-notification-types-1', 'title' => 'To describe the Auto Scaling notification types', ], ], 'DescribeInstanceRefreshes' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', ], 'output' => [ 'InstanceRefreshes' => [ [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'InstanceRefreshId' => '08b91cf7-8fa6-48af-b6a6-d227f40f1b9b', 'InstancesToUpdate' => 5, 'PercentageComplete' => 0, 'StartTime' => '2020-06-02T18:11:27Z', 'Status' => 'InProgress', ], [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'EndTime' => '2020-06-02T16:53:37Z', 'InstanceRefreshId' => 'dd7728d0-5bc4-4575-96a3-1b2c52bf8bb1', 'InstancesToUpdate' => 0, 'PercentageComplete' => 100, 'StartTime' => '2020-06-02T16:43:19Z', 'Status' => 'Successful', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the instance refreshes for the specified Auto Scaling group.', 'id' => 'to-list-instance-refreshes-1592959593746', 'title' => 'To list instance refreshes', ], ], 'DescribeLaunchConfigurations' => [ [ 'input' => [ 'LaunchConfigurationNames' => [ 'my-launch-config', ], ], 'output' => [ 'LaunchConfigurations' => [ [ 'AssociatePublicIpAddress' => true, 'BlockDeviceMappings' => [], 'CreatedTime' => '2014-05-07T17:39:28.599Z', 'EbsOptimized' => false, 'ImageId' => 'ami-043a5034', 'InstanceMonitoring' => [ 'Enabled' => true, ], 'InstanceType' => 't1.micro', 'LaunchConfigurationARN' => 'arn:aws:autoscaling:us-west-2:123456789012:launchConfiguration:98d3b196-4cf9-4e88-8ca1-8547c24ced8b:launchConfigurationName/my-launch-config', 'LaunchConfigurationName' => 'my-launch-config', 'SecurityGroups' => [ 'sg-67ef0308', ], ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the specified launch configuration.', 'id' => 'autoscaling-describe-launch-configurations-1', 'title' => 'To describe Auto Scaling launch configurations', ], ], 'DescribeLifecycleHookTypes' => [ [ 'output' => [ 'LifecycleHookTypes' => [ 'autoscaling:EC2_INSTANCE_LAUNCHING', 'autoscaling:EC2_INSTANCE_TERMINATING', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the available lifecycle hook types.', 'id' => 'autoscaling-describe-lifecycle-hook-types-1', 'title' => 'To describe the available types of lifecycle hooks', ], ], 'DescribeLifecycleHooks' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', ], 'output' => [ 'LifecycleHooks' => [ [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'DefaultResult' => 'ABANDON', 'GlobalTimeout' => 172800, 'HeartbeatTimeout' => 3600, 'LifecycleHookName' => 'my-lifecycle-hook', 'LifecycleTransition' => 'autoscaling:EC2_INSTANCE_LAUNCHING', 'NotificationTargetARN' => 'arn:aws:sns:us-west-2:123456789012:my-sns-topic', 'RoleARN' => 'arn:aws:iam::123456789012:role/my-auto-scaling-role', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the lifecycle hooks for the specified Auto Scaling group.', 'id' => 'autoscaling-describe-lifecycle-hooks-1', 'title' => 'To describe your lifecycle hooks', ], ], 'DescribeLoadBalancerTargetGroups' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', ], 'output' => [ 'LoadBalancerTargetGroups' => [ [ 'LoadBalancerTargetGroupARN' => 'arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067', 'State' => 'Added', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the target groups attached to the specified Auto Scaling group.', 'id' => 'autoscaling-describe-load-balancer-target-groups-1', 'title' => 'To describe the target groups for an Auto Scaling group', ], ], 'DescribeLoadBalancers' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', ], 'output' => [ 'LoadBalancers' => [ [ 'LoadBalancerName' => 'my-load-balancer', 'State' => 'Added', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the load balancers attached to the specified Auto Scaling group.', 'id' => 'autoscaling-describe-load-balancers-1', 'title' => 'To describe the load balancers for an Auto Scaling group', ], ], 'DescribeMetricCollectionTypes' => [ [ 'output' => [ 'Granularities' => [ [ 'Granularity' => '1Minute', ], ], 'Metrics' => [ [ 'Metric' => 'GroupMinSize', ], [ 'Metric' => 'GroupMaxSize', ], [ 'Metric' => 'GroupDesiredCapacity', ], [ 'Metric' => 'GroupInServiceInstances', ], [ 'Metric' => 'GroupPendingInstances', ], [ 'Metric' => 'GroupTerminatingInstances', ], [ 'Metric' => 'GroupStandbyInstances', ], [ 'Metric' => 'GroupTotalInstances', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the available metric collection types.', 'id' => 'autoscaling-describe-metric-collection-types-1', 'title' => 'To describe the Auto Scaling metric collection types', ], ], 'DescribeNotificationConfigurations' => [ [ 'input' => [ 'AutoScalingGroupNames' => [ 'my-auto-scaling-group', ], ], 'output' => [ 'NotificationConfigurations' => [ [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'NotificationType' => 'autoscaling:TEST_NOTIFICATION', 'TopicARN' => 'arn:aws:sns:us-west-2:123456789012:my-sns-topic-2', ], [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'NotificationType' => 'autoscaling:TEST_NOTIFICATION', 'TopicARN' => 'arn:aws:sns:us-west-2:123456789012:my-sns-topic', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the notification configurations for the specified Auto Scaling group.', 'id' => 'autoscaling-describe-notification-configurations-1', 'title' => 'To describe Auto Scaling notification configurations', ], ], 'DescribePolicies' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', ], 'output' => [ 'ScalingPolicies' => [ [ 'AdjustmentType' => 'ChangeInCapacity', 'Alarms' => [], 'AutoScalingGroupName' => 'my-auto-scaling-group', 'PolicyARN' => 'arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:2233f3d7-6290-403b-b632-93c553560106:autoScalingGroupName/my-auto-scaling-group:policyName/ScaleIn', 'PolicyName' => 'ScaleIn', 'ScalingAdjustment' => -1, ], [ 'AdjustmentType' => 'PercentChangeInCapacity', 'Alarms' => [], 'AutoScalingGroupName' => 'my-auto-scaling-group', 'Cooldown' => 60, 'MinAdjustmentStep' => 2, 'PolicyARN' => 'arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:2b435159-cf77-4e89-8c0e-d63b497baad7:autoScalingGroupName/my-auto-scaling-group:policyName/ScalePercentChange', 'PolicyName' => 'ScalePercentChange', 'ScalingAdjustment' => 25, ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the policies for the specified Auto Scaling group.', 'id' => 'autoscaling-describe-policies-1', 'title' => 'To describe scaling policies', ], ], 'DescribeScalingActivities' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', ], 'output' => [ 'Activities' => [ [ 'ActivityId' => 'f9f2d65b-f1f2-43e7-b46d-d86756459699', 'AutoScalingGroupName' => 'my-auto-scaling-group', 'Cause' => 'At 2013-08-19T20:53:25Z a user request created an AutoScalingGroup changing the desired capacity from 0 to 1. At 2013-08-19T20:53:29Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1.', 'Description' => 'Launching a new EC2 instance: i-4ba0837f', 'Details' => 'details', 'EndTime' => '2013-08-19T20:54:02Z', 'Progress' => 100, 'StartTime' => '2013-08-19T20:53:29.930Z', 'StatusCode' => 'Successful', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the scaling activities for the specified Auto Scaling group.', 'id' => 'autoscaling-describe-scaling-activities-1', 'title' => 'To describe the scaling activities for an Auto Scaling group', ], ], 'DescribeScalingProcessTypes' => [ [ 'output' => [ 'Processes' => [ [ 'ProcessName' => 'AZRebalance', ], [ 'ProcessName' => 'AddToLoadBalancer', ], [ 'ProcessName' => 'AlarmNotification', ], [ 'ProcessName' => 'HealthCheck', ], [ 'ProcessName' => 'Launch', ], [ 'ProcessName' => 'ReplaceUnhealthy', ], [ 'ProcessName' => 'ScheduledActions', ], [ 'ProcessName' => 'Terminate', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the Auto Scaling process types.', 'id' => 'autoscaling-describe-scaling-process-types-1', 'title' => 'To describe the Auto Scaling process types', ], ], 'DescribeScheduledActions' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', ], 'output' => [ 'ScheduledUpdateGroupActions' => [ [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'DesiredCapacity' => 4, 'MaxSize' => 6, 'MinSize' => 2, 'Recurrence' => '30 0 1 12 0', 'ScheduledActionARN' => 'arn:aws:autoscaling:us-west-2:123456789012:scheduledUpdateGroupAction:8e86b655-b2e6-4410-8f29-b4f094d6871c:autoScalingGroupName/my-auto-scaling-group:scheduledActionName/my-scheduled-action', 'ScheduledActionName' => 'my-scheduled-action', 'StartTime' => '2016-12-01T00:30:00Z', 'Time' => '2016-12-01T00:30:00Z', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the scheduled actions for the specified Auto Scaling group.', 'id' => 'autoscaling-describe-scheduled-actions-1', 'title' => 'To describe scheduled actions', ], ], 'DescribeTags' => [ [ 'input' => [ 'Filters' => [ [ 'Name' => 'auto-scaling-group', 'Values' => [ 'my-auto-scaling-group', ], ], ], ], 'output' => [ 'Tags' => [ [ 'Key' => 'Dept', 'PropagateAtLaunch' => true, 'ResourceId' => 'my-auto-scaling-group', 'ResourceType' => 'auto-scaling-group', 'Value' => 'Research', ], [ 'Key' => 'Role', 'PropagateAtLaunch' => true, 'ResourceId' => 'my-auto-scaling-group', 'ResourceType' => 'auto-scaling-group', 'Value' => 'WebServer', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the tags for the specified Auto Scaling group.', 'id' => 'autoscaling-describe-tags-1', 'title' => 'To describe tags', ], ], 'DescribeTerminationPolicyTypes' => [ [ 'output' => [ 'TerminationPolicyTypes' => [ 'ClosestToNextInstanceHour', 'Default', 'NewestInstance', 'OldestInstance', 'OldestLaunchConfiguration', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the available termination policy types.', 'id' => 'autoscaling-describe-termination-policy-types-1', 'title' => 'To describe termination policy types', ], ], 'DescribeTrafficSources' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', ], 'output' => [ 'NextToken' => '', 'TrafficSources' => [ [ 'Identifier' => 'arn:aws:vpc-lattice:us-west-2:123456789012:targetgroup/tg-0e2f2665eEXAMPLE', 'State' => 'InService', 'Type' => 'vpc-lattice', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the target groups attached to the specified Auto Scaling group.', 'id' => 'to-describe-the-target-groups-for-an-auto-scaling-group-1680040714521', 'title' => 'To describe the target groups for an Auto Scaling group', ], ], 'DetachInstances' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'InstanceIds' => [ 'i-93633f9b', ], 'ShouldDecrementDesiredCapacity' => true, ], 'output' => [ 'Activities' => [ [ 'ActivityId' => '5091cb52-547a-47ce-a236-c9ccbc2cb2c9', 'AutoScalingGroupName' => 'my-auto-scaling-group', 'Cause' => 'At 2015-04-12T15:02:16Z instance i-93633f9b was detached in response to a user request, shrinking the capacity from 2 to 1.', 'Description' => 'Detaching EC2 instance: i-93633f9b', 'Details' => 'details', 'Progress' => 50, 'StartTime' => '2015-04-12T15:02:16.179Z', 'StatusCode' => 'InProgress', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example detaches the specified instance from the specified Auto Scaling group.', 'id' => 'autoscaling-detach-instances-1', 'title' => 'To detach an instance from an Auto Scaling group', ], ], 'DetachLoadBalancerTargetGroups' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'TargetGroupARNs' => [ 'arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example detaches the specified target group from the specified Auto Scaling group', 'id' => 'autoscaling-detach-load-balancer-target-groups-1', 'title' => 'To detach a target group from an Auto Scaling group', ], ], 'DetachLoadBalancers' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'LoadBalancerNames' => [ 'my-load-balancer', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example detaches the specified load balancer from the specified Auto Scaling group.', 'id' => 'autoscaling-detach-load-balancers-1', 'title' => 'To detach a load balancer from an Auto Scaling group', ], ], 'DetachTrafficSources' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'TrafficSources' => [ [ 'Identifier' => 'arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067', ], ], ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example detaches the specified target group from the specified Auto Scaling group.', 'id' => 'to-detach-a-target-group-from-an-auto-scaling-group-1680040404169', 'title' => 'To detach a target group from an Auto Scaling group', ], ], 'DisableMetricsCollection' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'Metrics' => [ 'GroupDesiredCapacity', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example disables collecting data for the GroupDesiredCapacity metric for the specified Auto Scaling group.', 'id' => 'autoscaling-disable-metrics-collection-1', 'title' => 'To disable metrics collection for an Auto Scaling group', ], ], 'EnableMetricsCollection' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'Granularity' => '1Minute', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example enables data collection for the specified Auto Scaling group.', 'id' => 'autoscaling-enable-metrics-collection-1', 'title' => 'To enable metrics collection for an Auto Scaling group', ], ], 'EnterStandby' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'InstanceIds' => [ 'i-93633f9b', ], 'ShouldDecrementDesiredCapacity' => true, ], 'output' => [ 'Activities' => [ [ 'ActivityId' => 'ffa056b4-6ed3-41ba-ae7c-249dfae6eba1', 'AutoScalingGroupName' => 'my-auto-scaling-group', 'Cause' => 'At 2015-04-12T15:10:23Z instance i-93633f9b was moved to standby in response to a user request, shrinking the capacity from 2 to 1.', 'Description' => 'Moving EC2 instance to Standby: i-93633f9b', 'Details' => 'details', 'Progress' => 50, 'StartTime' => '2015-04-12T15:10:23.640Z', 'StatusCode' => 'InProgress', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example puts the specified instance into standby mode.', 'id' => 'autoscaling-enter-standby-1', 'title' => 'To move instances into standby mode', ], ], 'ExecutePolicy' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'BreachThreshold' => 50, 'MetricValue' => 59, 'PolicyName' => 'my-step-scale-out-policy', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example executes the specified policy.', 'id' => 'autoscaling-execute-policy-1', 'title' => 'To execute a scaling policy', ], ], 'ExitStandby' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'InstanceIds' => [ 'i-93633f9b', ], ], 'output' => [ 'Activities' => [ [ 'ActivityId' => '142928e1-a2dc-453a-9b24-b85ad6735928', 'AutoScalingGroupName' => 'my-auto-scaling-group', 'Cause' => 'At 2015-04-12T15:14:29Z instance i-93633f9b was moved out of standby in response to a user request, increasing the capacity from 1 to 2.', 'Description' => 'Moving EC2 instance out of Standby: i-93633f9b', 'Details' => 'details', 'Progress' => 30, 'StartTime' => '2015-04-12T15:14:29.886Z', 'StatusCode' => 'PreInService', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example moves the specified instance out of standby mode.', 'id' => 'autoscaling-exit-standby-1', 'title' => 'To move instances out of standby mode', ], ], 'PutLifecycleHook' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'DefaultResult' => 'CONTINUE', 'HeartbeatTimeout' => 300, 'LifecycleHookName' => 'my-launch-lifecycle-hook', 'LifecycleTransition' => 'autoscaling:EC2_INSTANCE_LAUNCHING', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example creates a lifecycle hook for instance launch.', 'id' => 'autoscaling-put-lifecycle-hook-1', 'title' => 'To create a launch lifecycle hook', ], ], 'PutNotificationConfiguration' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'NotificationTypes' => [ 'autoscaling:TEST_NOTIFICATION', ], 'TopicARN' => 'arn:aws:sns:us-west-2:123456789012:my-sns-topic', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example adds the specified notification to the specified Auto Scaling group.', 'id' => 'autoscaling-put-notification-configuration-1', 'title' => 'To add an Auto Scaling notification', ], ], 'PutScalingPolicy' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'PolicyName' => 'alb1000-target-tracking-scaling-policy', 'PolicyType' => 'TargetTrackingScaling', 'TargetTrackingConfiguration' => [ 'PredefinedMetricSpecification' => [ 'PredefinedMetricType' => 'ALBRequestCountPerTarget', 'ResourceLabel' => 'app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff', ], 'TargetValue' => 1000, ], ], 'output' => [ 'Alarms' => [ [ 'AlarmARN' => 'arn:aws:cloudwatch:us-west-2:123456789012:alarm:TargetTracking-my-asg-AlarmHigh-fc0e4183-23ac-497e-9992-691c9980c38e', 'AlarmName' => 'TargetTracking-my-asg-AlarmHigh-fc0e4183-23ac-497e-9992-691c9980c38e', ], [ 'AlarmARN' => 'arn:aws:cloudwatch:us-west-2:123456789012:alarm:TargetTracking-my-asg-AlarmLow-61a39305-ed0c-47af-bd9e-471a352ee1a2', 'AlarmName' => 'TargetTracking-my-asg-AlarmLow-61a39305-ed0c-47af-bd9e-471a352ee1a2', ], ], 'PolicyARN' => 'arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:228f02c2-c665-4bfd-aaac-8b04080bea3c:autoScalingGroupName/my-auto-scaling-group:policyName/alb1000-target-tracking-scaling-policy', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example adds the specified policy to the specified Auto Scaling group.', 'id' => 'autoscaling-put-scaling-policy-1', 'title' => 'To add a scaling policy to an Auto Scaling group', ], ], 'PutScheduledUpdateGroupAction' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'DesiredCapacity' => 4, 'EndTime' => '2014-05-12T08:00:00Z', 'MaxSize' => 6, 'MinSize' => 2, 'ScheduledActionName' => 'my-scheduled-action', 'StartTime' => '2014-05-12T08:00:00Z', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example adds the specified scheduled action to the specified Auto Scaling group.', 'id' => 'autoscaling-put-scheduled-update-group-action-1', 'title' => 'To add a scheduled action to an Auto Scaling group', ], ], 'PutWarmPool' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'InstanceReusePolicy' => [ 'ReuseOnScaleIn' => true, ], 'MinSize' => 30, 'PoolState' => 'Hibernated', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example creates a warm pool for the specified Auto Scaling group.', 'id' => 'to-add-a-warm-pool-to-an-auto-scaling-group-1617818810383', 'title' => 'To create a warm pool for an Auto Scaling group', ], ], 'RecordLifecycleActionHeartbeat' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'LifecycleActionToken' => 'bcd2f1b8-9a78-44d3-8a7a-4dd07d7cf635', 'LifecycleHookName' => 'my-lifecycle-hook', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example records a lifecycle action heartbeat to keep the instance in a pending state.', 'id' => 'autoscaling-record-lifecycle-action-heartbeat-1', 'title' => 'To record a lifecycle action heartbeat', ], ], 'ResumeProcesses' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'ScalingProcesses' => [ 'AlarmNotification', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example resumes the specified suspended scaling process for the specified Auto Scaling group.', 'id' => 'autoscaling-resume-processes-1', 'title' => 'To resume Auto Scaling processes', ], ], 'SetDesiredCapacity' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'DesiredCapacity' => 2, 'HonorCooldown' => true, ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example sets the desired capacity for the specified Auto Scaling group.', 'id' => 'autoscaling-set-desired-capacity-1', 'title' => 'To set the desired capacity for an Auto Scaling group', ], ], 'SetInstanceHealth' => [ [ 'input' => [ 'HealthStatus' => 'Unhealthy', 'InstanceId' => 'i-93633f9b', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example sets the health status of the specified instance to Unhealthy.', 'id' => 'autoscaling-set-instance-health-1', 'title' => 'To set the health status of an instance', ], ], 'SetInstanceProtection' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'InstanceIds' => [ 'i-93633f9b', ], 'ProtectedFromScaleIn' => true, ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example enables instance protection for the specified instance.', 'id' => 'autoscaling-set-instance-protection-1', 'title' => 'To enable instance protection for an instance', ], [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'InstanceIds' => [ 'i-93633f9b', ], 'ProtectedFromScaleIn' => false, ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example disables instance protection for the specified instance.', 'id' => 'autoscaling-set-instance-protection-2', 'title' => 'To disable instance protection for an instance', ], ], 'StartInstanceRefresh' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'DesiredConfiguration' => [ 'LaunchTemplate' => [ 'LaunchTemplateName' => 'my-template-for-auto-scaling', 'Version' => '$Latest', ], ], 'Preferences' => [ 'InstanceWarmup' => 400, 'MinHealthyPercentage' => 90, 'SkipMatching' => true, ], ], 'output' => [ 'InstanceRefreshId' => '08b91cf7-8fa6-48af-b6a6-d227f40f1b9b', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example starts an instance refresh for the specified Auto Scaling group.', 'id' => 'to-start-an-instance-refresh-1592957271522', 'title' => 'To start an instance refresh', ], ], 'SuspendProcesses' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'ScalingProcesses' => [ 'AlarmNotification', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example suspends the specified scaling process for the specified Auto Scaling group.', 'id' => 'autoscaling-suspend-processes-1', 'title' => 'To suspend Auto Scaling processes', ], ], 'TerminateInstanceInAutoScalingGroup' => [ [ 'input' => [ 'InstanceId' => 'i-93633f9b', 'ShouldDecrementDesiredCapacity' => false, ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example terminates the specified instance from the specified Auto Scaling group without updating the size of the group. Auto Scaling launches a replacement instance after the specified instance terminates.', 'id' => 'autoscaling-terminate-instance-in-auto-scaling-group-1', 'title' => 'To terminate an instance in an Auto Scaling group', ], ], 'UpdateAutoScalingGroup' => [ [ 'input' => [ 'AutoScalingGroupName' => 'my-auto-scaling-group', 'LaunchTemplate' => [ 'LaunchTemplateName' => 'my-template-for-auto-scaling', 'Version' => '2', ], 'MaxSize' => 5, 'MinSize' => 1, 'NewInstancesProtectedFromScaleIn' => true, ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example updates multiple properties at the same time.', 'id' => 'autoscaling-update-auto-scaling-group-1', 'title' => 'To update an Auto Scaling group', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/autoscaling/2011-01-01/paginators-1.json\nreturn [ 'pagination' => [ 'DescribeAutoScalingGroups' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxRecords', 'output_token' => 'NextToken', 'result_key' => 'AutoScalingGroups', ], 'DescribeAutoScalingInstances' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxRecords', 'output_token' => 'NextToken', 'result_key' => 'AutoScalingInstances', ], 'DescribeLaunchConfigurations' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxRecords', 'output_token' => 'NextToken', 'result_key' => 'LaunchConfigurations', ], 'DescribeNotificationConfigurations' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxRecords', 'output_token' => 'NextToken', 'result_key' => 'NotificationConfigurations', ], 'DescribePolicies' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxRecords', 'output_token' => 'NextToken', 'result_key' => 'ScalingPolicies', ], 'DescribeScalingActivities' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxRecords', 'output_token' => 'NextToken', 'result_key' => 'Activities', ], 'DescribeScheduledActions' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxRecords', 'output_token' => 'NextToken', 'result_key' => 'ScheduledUpdateGroupActions', ], 'DescribeTags' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxRecords', 'output_token' => 'NextToken', 'result_key' => 'Tags', ], 'DescribeTrafficSources' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxRecords', 'output_token' => 'NextToken', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/autoscaling/2011-01-01/smoke.json\nreturn [ 'version' => 1, 'defaultRegion' => 'us-west-2', 'testCases' => [ [ 'operationName' => 'DescribeScalingProcessTypes', 'input' => [], 'errorExpectedFromService' => false, ], [ 'operationName' => 'CreateLaunchConfiguration', 'input' => [ 'LaunchConfigurationName' => 'hello, world', 'ImageId' => 'ami-12345678', 'InstanceType' => 'm1.small', ], 'errorExpectedFromService' => true, ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/autoscaling/2011-01-01/waiters-2.json\nreturn [ 'version' => 2, 'waiters' => [ 'GroupExists' => [ 'acceptors' => [ [ 'argument' => 'length(AutoScalingGroups) > `0`', 'expected' => true, 'matcher' => 'path', 'state' => 'success', ], [ 'argument' => 'length(AutoScalingGroups) > `0`', 'expected' => false, 'matcher' => 'path', 'state' => 'retry', ], ], 'delay' => 5, 'maxAttempts' => 10, 'operation' => 'DescribeAutoScalingGroups', ], 'GroupInService' => [ 'acceptors' => [ [ 'argument' => 'contains(AutoScalingGroups[].[length(Instances[?LifecycleState==\\'InService\\']) >= MinSize][], `false`)', 'expected' => false, 'matcher' => 'path', 'state' => 'success', ], [ 'argument' => 'contains(AutoScalingGroups[].[length(Instances[?LifecycleState==\\'InService\\']) >= MinSize][], `false`)', 'expected' => true, 'matcher' => 'path', 'state' => 'retry', ], ], 'delay' => 15, 'maxAttempts' => 40, 'operation' => 'DescribeAutoScalingGroups', ], 'GroupNotExists' => [ 'acceptors' => [ [ 'argument' => 'length(AutoScalingGroups) > `0`', 'expected' => false, 'matcher' => 'path', 'state' => 'success', ], [ 'argument' => 'length(AutoScalingGroups) > `0`', 'expected' => true, 'matcher' => 'path', 'state' => 'retry', ], ], 'delay' => 15, 'maxAttempts' => 40, 'operation' => 'DescribeAutoScalingGroups', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/autoscaling-plans/2018-01-06/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2018-01-06', 'endpointPrefix' => 'autoscaling-plans', 'jsonVersion' => '1.1', 'protocol' => 'json', 'serviceFullName' => 'AWS Auto Scaling Plans', 'serviceId' => 'Auto Scaling Plans', 'signatureVersion' => 'v4', 'signingName' => 'autoscaling-plans', 'targetPrefix' => 'AnyScaleScalingPlannerFrontendService', 'uid' => 'autoscaling-plans-2018-01-06', ], 'operations' => [ 'CreateScalingPlan' => [ 'name' => 'CreateScalingPlan', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateScalingPlanRequest', ], 'output' => [ 'shape' => 'CreateScalingPlanResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ConcurrentUpdateException', ], [ 'shape' => 'InternalServiceException', ], ], ], 'DeleteScalingPlan' => [ 'name' => 'DeleteScalingPlan', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteScalingPlanRequest', ], 'output' => [ 'shape' => 'DeleteScalingPlanResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ObjectNotFoundException', ], [ 'shape' => 'ConcurrentUpdateException', ], [ 'shape' => 'InternalServiceException', ], ], ], 'DescribeScalingPlanResources' => [ 'name' => 'DescribeScalingPlanResources', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeScalingPlanResourcesRequest', ], 'output' => [ 'shape' => 'DescribeScalingPlanResourcesResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ConcurrentUpdateException', ], [ 'shape' => 'InternalServiceException', ], ], ], 'DescribeScalingPlans' => [ 'name' => 'DescribeScalingPlans', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeScalingPlansRequest', ], 'output' => [ 'shape' => 'DescribeScalingPlansResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ConcurrentUpdateException', ], [ 'shape' => 'InternalServiceException', ], ], ], 'GetScalingPlanResourceForecastData' => [ 'name' => 'GetScalingPlanResourceForecastData', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetScalingPlanResourceForecastDataRequest', ], 'output' => [ 'shape' => 'GetScalingPlanResourceForecastDataResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServiceException', ], ], ], 'UpdateScalingPlan' => [ 'name' => 'UpdateScalingPlan', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateScalingPlanRequest', ], 'output' => [ 'shape' => 'UpdateScalingPlanResponse', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ConcurrentUpdateException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ObjectNotFoundException', ], ], ], ], 'shapes' => [ 'ApplicationSource' => [ 'type' => 'structure', 'members' => [ 'CloudFormationStackARN' => [ 'shape' => 'XmlString', ], 'TagFilters' => [ 'shape' => 'TagFilters', ], ], ], 'ApplicationSources' => [ 'type' => 'list', 'member' => [ 'shape' => 'ApplicationSource', ], ], 'ConcurrentUpdateException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'Cooldown' => [ 'type' => 'integer', ], 'CreateScalingPlanRequest' => [ 'type' => 'structure', 'required' => [ 'ScalingPlanName', 'ApplicationSource', 'ScalingInstructions', ], 'members' => [ 'ScalingPlanName' => [ 'shape' => 'ScalingPlanName', ], 'ApplicationSource' => [ 'shape' => 'ApplicationSource', ], 'ScalingInstructions' => [ 'shape' => 'ScalingInstructions', ], ], ], 'CreateScalingPlanResponse' => [ 'type' => 'structure', 'required' => [ 'ScalingPlanVersion', ], 'members' => [ 'ScalingPlanVersion' => [ 'shape' => 'ScalingPlanVersion', ], ], ], 'CustomizedLoadMetricSpecification' => [ 'type' => 'structure', 'required' => [ 'MetricName', 'Namespace', 'Statistic', ], 'members' => [ 'MetricName' => [ 'shape' => 'MetricName', ], 'Namespace' => [ 'shape' => 'MetricNamespace', ], 'Dimensions' => [ 'shape' => 'MetricDimensions', ], 'Statistic' => [ 'shape' => 'MetricStatistic', ], 'Unit' => [ 'shape' => 'MetricUnit', ], ], ], 'CustomizedScalingMetricSpecification' => [ 'type' => 'structure', 'required' => [ 'MetricName', 'Namespace', 'Statistic', ], 'members' => [ 'MetricName' => [ 'shape' => 'MetricName', ], 'Namespace' => [ 'shape' => 'MetricNamespace', ], 'Dimensions' => [ 'shape' => 'MetricDimensions', ], 'Statistic' => [ 'shape' => 'MetricStatistic', ], 'Unit' => [ 'shape' => 'MetricUnit', ], ], ], 'Datapoint' => [ 'type' => 'structure', 'members' => [ 'Timestamp' => [ 'shape' => 'TimestampType', ], 'Value' => [ 'shape' => 'MetricScale', ], ], ], 'Datapoints' => [ 'type' => 'list', 'member' => [ 'shape' => 'Datapoint', ], ], 'DeleteScalingPlanRequest' => [ 'type' => 'structure', 'required' => [ 'ScalingPlanName', 'ScalingPlanVersion', ], 'members' => [ 'ScalingPlanName' => [ 'shape' => 'ScalingPlanName', ], 'ScalingPlanVersion' => [ 'shape' => 'ScalingPlanVersion', ], ], ], 'DeleteScalingPlanResponse' => [ 'type' => 'structure', 'members' => [], ], 'DescribeScalingPlanResourcesRequest' => [ 'type' => 'structure', 'required' => [ 'ScalingPlanName', 'ScalingPlanVersion', ], 'members' => [ 'ScalingPlanName' => [ 'shape' => 'ScalingPlanName', ], 'ScalingPlanVersion' => [ 'shape' => 'ScalingPlanVersion', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeScalingPlanResourcesResponse' => [ 'type' => 'structure', 'members' => [ 'ScalingPlanResources' => [ 'shape' => 'ScalingPlanResources', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeScalingPlansRequest' => [ 'type' => 'structure', 'members' => [ 'ScalingPlanNames' => [ 'shape' => 'ScalingPlanNames', ], 'ScalingPlanVersion' => [ 'shape' => 'ScalingPlanVersion', ], 'ApplicationSources' => [ 'shape' => 'ApplicationSources', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeScalingPlansResponse' => [ 'type' => 'structure', 'members' => [ 'ScalingPlans' => [ 'shape' => 'ScalingPlans', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'DisableDynamicScaling' => [ 'type' => 'boolean', ], 'DisableScaleIn' => [ 'type' => 'boolean', ], 'ErrorMessage' => [ 'type' => 'string', ], 'ForecastDataType' => [ 'type' => 'string', 'enum' => [ 'CapacityForecast', 'LoadForecast', 'ScheduledActionMinCapacity', 'ScheduledActionMaxCapacity', ], ], 'GetScalingPlanResourceForecastDataRequest' => [ 'type' => 'structure', 'required' => [ 'ScalingPlanName', 'ScalingPlanVersion', 'ServiceNamespace', 'ResourceId', 'ScalableDimension', 'ForecastDataType', 'StartTime', 'EndTime', ], 'members' => [ 'ScalingPlanName' => [ 'shape' => 'ScalingPlanName', ], 'ScalingPlanVersion' => [ 'shape' => 'ScalingPlanVersion', ], 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'ResourceId' => [ 'shape' => 'XmlString', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], 'ForecastDataType' => [ 'shape' => 'ForecastDataType', ], 'StartTime' => [ 'shape' => 'TimestampType', ], 'EndTime' => [ 'shape' => 'TimestampType', ], ], ], 'GetScalingPlanResourceForecastDataResponse' => [ 'type' => 'structure', 'required' => [ 'Datapoints', ], 'members' => [ 'Datapoints' => [ 'shape' => 'Datapoints', ], ], ], 'InternalServiceException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'InvalidNextTokenException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'LoadMetricType' => [ 'type' => 'string', 'enum' => [ 'ASGTotalCPUUtilization', 'ASGTotalNetworkIn', 'ASGTotalNetworkOut', 'ALBTargetGroupRequestCount', ], ], 'MaxResults' => [ 'type' => 'integer', ], 'MetricDimension' => [ 'type' => 'structure', 'required' => [ 'Name', 'Value', ], 'members' => [ 'Name' => [ 'shape' => 'MetricDimensionName', ], 'Value' => [ 'shape' => 'MetricDimensionValue', ], ], ], 'MetricDimensionName' => [ 'type' => 'string', ], 'MetricDimensionValue' => [ 'type' => 'string', ], 'MetricDimensions' => [ 'type' => 'list', 'member' => [ 'shape' => 'MetricDimension', ], ], 'MetricName' => [ 'type' => 'string', ], 'MetricNamespace' => [ 'type' => 'string', ], 'MetricScale' => [ 'type' => 'double', ], 'MetricStatistic' => [ 'type' => 'string', 'enum' => [ 'Average', 'Minimum', 'Maximum', 'SampleCount', 'Sum', ], ], 'MetricUnit' => [ 'type' => 'string', ], 'NextToken' => [ 'type' => 'string', ], 'ObjectNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'PolicyName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '\\\\p{Print}+', ], 'PolicyType' => [ 'type' => 'string', 'enum' => [ 'TargetTrackingScaling', ], ], 'PredefinedLoadMetricSpecification' => [ 'type' => 'structure', 'required' => [ 'PredefinedLoadMetricType', ], 'members' => [ 'PredefinedLoadMetricType' => [ 'shape' => 'LoadMetricType', ], 'ResourceLabel' => [ 'shape' => 'ResourceLabel', ], ], ], 'PredefinedScalingMetricSpecification' => [ 'type' => 'structure', 'required' => [ 'PredefinedScalingMetricType', ], 'members' => [ 'PredefinedScalingMetricType' => [ 'shape' => 'ScalingMetricType', ], 'ResourceLabel' => [ 'shape' => 'ResourceLabel', ], ], ], 'PredictiveScalingMaxCapacityBehavior' => [ 'type' => 'string', 'enum' => [ 'SetForecastCapacityToMaxCapacity', 'SetMaxCapacityToForecastCapacity', 'SetMaxCapacityAboveForecastCapacity', ], ], 'PredictiveScalingMode' => [ 'type' => 'string', 'enum' => [ 'ForecastAndScale', 'ForecastOnly', ], ], 'ResourceCapacity' => [ 'type' => 'integer', ], 'ResourceIdMaxLen1600' => [ 'type' => 'string', 'max' => 1600, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'ResourceLabel' => [ 'type' => 'string', 'max' => 1023, 'min' => 1, ], 'ScalableDimension' => [ 'type' => 'string', 'enum' => [ 'autoscaling:autoScalingGroup:DesiredCapacity', 'ecs:service:DesiredCount', 'ec2:spot-fleet-request:TargetCapacity', 'rds:cluster:ReadReplicaCount', 'dynamodb:table:ReadCapacityUnits', 'dynamodb:table:WriteCapacityUnits', 'dynamodb:index:ReadCapacityUnits', 'dynamodb:index:WriteCapacityUnits', ], ], 'ScalingInstruction' => [ 'type' => 'structure', 'required' => [ 'ServiceNamespace', 'ResourceId', 'ScalableDimension', 'MinCapacity', 'MaxCapacity', 'TargetTrackingConfigurations', ], 'members' => [ 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'ResourceId' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], 'MinCapacity' => [ 'shape' => 'ResourceCapacity', ], 'MaxCapacity' => [ 'shape' => 'ResourceCapacity', ], 'TargetTrackingConfigurations' => [ 'shape' => 'TargetTrackingConfigurations', ], 'PredefinedLoadMetricSpecification' => [ 'shape' => 'PredefinedLoadMetricSpecification', ], 'CustomizedLoadMetricSpecification' => [ 'shape' => 'CustomizedLoadMetricSpecification', ], 'ScheduledActionBufferTime' => [ 'shape' => 'ScheduledActionBufferTime', ], 'PredictiveScalingMaxCapacityBehavior' => [ 'shape' => 'PredictiveScalingMaxCapacityBehavior', ], 'PredictiveScalingMaxCapacityBuffer' => [ 'shape' => 'ResourceCapacity', ], 'PredictiveScalingMode' => [ 'shape' => 'PredictiveScalingMode', ], 'ScalingPolicyUpdateBehavior' => [ 'shape' => 'ScalingPolicyUpdateBehavior', ], 'DisableDynamicScaling' => [ 'shape' => 'DisableDynamicScaling', ], ], ], 'ScalingInstructions' => [ 'type' => 'list', 'member' => [ 'shape' => 'ScalingInstruction', ], ], 'ScalingMetricType' => [ 'type' => 'string', 'enum' => [ 'ASGAverageCPUUtilization', 'ASGAverageNetworkIn', 'ASGAverageNetworkOut', 'DynamoDBReadCapacityUtilization', 'DynamoDBWriteCapacityUtilization', 'ECSServiceAverageCPUUtilization', 'ECSServiceAverageMemoryUtilization', 'ALBRequestCountPerTarget', 'RDSReaderAverageCPUUtilization', 'RDSReaderAverageDatabaseConnections', 'EC2SpotFleetRequestAverageCPUUtilization', 'EC2SpotFleetRequestAverageNetworkIn', 'EC2SpotFleetRequestAverageNetworkOut', ], ], 'ScalingPlan' => [ 'type' => 'structure', 'required' => [ 'ScalingPlanName', 'ScalingPlanVersion', 'ApplicationSource', 'ScalingInstructions', 'StatusCode', ], 'members' => [ 'ScalingPlanName' => [ 'shape' => 'ScalingPlanName', ], 'ScalingPlanVersion' => [ 'shape' => 'ScalingPlanVersion', ], 'ApplicationSource' => [ 'shape' => 'ApplicationSource', ], 'ScalingInstructions' => [ 'shape' => 'ScalingInstructions', ], 'StatusCode' => [ 'shape' => 'ScalingPlanStatusCode', ], 'StatusMessage' => [ 'shape' => 'XmlString', ], 'StatusStartTime' => [ 'shape' => 'TimestampType', ], 'CreationTime' => [ 'shape' => 'TimestampType', ], ], ], 'ScalingPlanName' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[\\\\p{Print}&&[^|:/]]+', ], 'ScalingPlanNames' => [ 'type' => 'list', 'member' => [ 'shape' => 'ScalingPlanName', ], ], 'ScalingPlanResource' => [ 'type' => 'structure', 'required' => [ 'ScalingPlanName', 'ScalingPlanVersion', 'ServiceNamespace', 'ResourceId', 'ScalableDimension', 'ScalingStatusCode', ], 'members' => [ 'ScalingPlanName' => [ 'shape' => 'ScalingPlanName', ], 'ScalingPlanVersion' => [ 'shape' => 'ScalingPlanVersion', ], 'ServiceNamespace' => [ 'shape' => 'ServiceNamespace', ], 'ResourceId' => [ 'shape' => 'ResourceIdMaxLen1600', ], 'ScalableDimension' => [ 'shape' => 'ScalableDimension', ], 'ScalingPolicies' => [ 'shape' => 'ScalingPolicies', ], 'ScalingStatusCode' => [ 'shape' => 'ScalingStatusCode', ], 'ScalingStatusMessage' => [ 'shape' => 'XmlString', ], ], ], 'ScalingPlanResources' => [ 'type' => 'list', 'member' => [ 'shape' => 'ScalingPlanResource', ], ], 'ScalingPlanStatusCode' => [ 'type' => 'string', 'enum' => [ 'Active', 'ActiveWithProblems', 'CreationInProgress', 'CreationFailed', 'DeletionInProgress', 'DeletionFailed', 'UpdateInProgress', 'UpdateFailed', ], ], 'ScalingPlanVersion' => [ 'type' => 'long', ], 'ScalingPlans' => [ 'type' => 'list', 'member' => [ 'shape' => 'ScalingPlan', ], ], 'ScalingPolicies' => [ 'type' => 'list', 'member' => [ 'shape' => 'ScalingPolicy', ], ], 'ScalingPolicy' => [ 'type' => 'structure', 'required' => [ 'PolicyName', 'PolicyType', ], 'members' => [ 'PolicyName' => [ 'shape' => 'PolicyName', ], 'PolicyType' => [ 'shape' => 'PolicyType', ], 'TargetTrackingConfiguration' => [ 'shape' => 'TargetTrackingConfiguration', ], ], ], 'ScalingPolicyUpdateBehavior' => [ 'type' => 'string', 'enum' => [ 'KeepExternalPolicies', 'ReplaceExternalPolicies', ], ], 'ScalingStatusCode' => [ 'type' => 'string', 'enum' => [ 'Inactive', 'PartiallyActive', 'Active', ], ], 'ScheduledActionBufferTime' => [ 'type' => 'integer', 'min' => 0, ], 'ServiceNamespace' => [ 'type' => 'string', 'enum' => [ 'autoscaling', 'ecs', 'ec2', 'rds', 'dynamodb', ], ], 'TagFilter' => [ 'type' => 'structure', 'members' => [ 'Key' => [ 'shape' => 'XmlStringMaxLen128', ], 'Values' => [ 'shape' => 'TagValues', ], ], ], 'TagFilters' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagFilter', ], ], 'TagValues' => [ 'type' => 'list', 'member' => [ 'shape' => 'XmlStringMaxLen256', ], ], 'TargetTrackingConfiguration' => [ 'type' => 'structure', 'required' => [ 'TargetValue', ], 'members' => [ 'PredefinedScalingMetricSpecification' => [ 'shape' => 'PredefinedScalingMetricSpecification', ], 'CustomizedScalingMetricSpecification' => [ 'shape' => 'CustomizedScalingMetricSpecification', ], 'TargetValue' => [ 'shape' => 'MetricScale', ], 'DisableScaleIn' => [ 'shape' => 'DisableScaleIn', ], 'ScaleOutCooldown' => [ 'shape' => 'Cooldown', ], 'ScaleInCooldown' => [ 'shape' => 'Cooldown', ], 'EstimatedInstanceWarmup' => [ 'shape' => 'Cooldown', ], ], ], 'TargetTrackingConfigurations' => [ 'type' => 'list', 'member' => [ 'shape' => 'TargetTrackingConfiguration', ], ], 'TimestampType' => [ 'type' => 'timestamp', ], 'UpdateScalingPlanRequest' => [ 'type' => 'structure', 'required' => [ 'ScalingPlanName', 'ScalingPlanVersion', ], 'members' => [ 'ScalingPlanName' => [ 'shape' => 'ScalingPlanName', ], 'ScalingPlanVersion' => [ 'shape' => 'ScalingPlanVersion', ], 'ApplicationSource' => [ 'shape' => 'ApplicationSource', ], 'ScalingInstructions' => [ 'shape' => 'ScalingInstructions', ], ], ], 'UpdateScalingPlanResponse' => [ 'type' => 'structure', 'members' => [], ], 'ValidationException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'XmlString' => [ 'type' => 'string', 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'XmlStringMaxLen128' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], 'XmlStringMaxLen256' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDC00-\\\\uDBFF\\\\uDFFF\\\\r\\\\n\\\\t]*', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/autoscaling-plans/2018-01-06/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<fullname>AWS Auto Scaling</fullname> <p>Use AWS Auto Scaling to create scaling plans for your applications to automatically scale your scalable AWS resources. </p> <p> <b>API Summary</b> </p> <p>You can use the AWS Auto Scaling service API to accomplish the following tasks:</p> <ul> <li> <p>Create and manage scaling plans</p> </li> <li> <p>Define target tracking scaling policies to dynamically scale your resources based on utilization</p> </li> <li> <p>Scale Amazon EC2 Auto Scaling groups using predictive scaling and dynamic scaling to scale your Amazon EC2 capacity faster</p> </li> <li> <p>Set minimum and maximum capacity limits</p> </li> <li> <p>Retrieve information on existing scaling plans</p> </li> <li> <p>Access current forecast data and historical forecast data for up to 56 days previous</p> </li> </ul> <p>To learn more about AWS Auto Scaling, including information about granting IAM users required permissions for AWS Auto Scaling actions, see the <a href=\"https://docs.aws.amazon.com/autoscaling/plans/userguide/what-is-aws-auto-scaling.html\">AWS Auto Scaling User Guide</a>. </p>', 'operations' => [ 'CreateScalingPlan' => '<p>Creates a scaling plan. </p>', 'DeleteScalingPlan' => '<p>Deletes the specified scaling plan.</p> <p>Deleting a scaling plan deletes the underlying <a>ScalingInstruction</a> for all of the scalable resources that are covered by the plan.</p> <p>If the plan has launched resources or has scaling activities in progress, you must delete those resources separately.</p>', 'DescribeScalingPlanResources' => '<p>Describes the scalable resources in the specified scaling plan.</p>', 'DescribeScalingPlans' => '<p>Describes one or more of your scaling plans.</p>', 'GetScalingPlanResourceForecastData' => '<p>Retrieves the forecast data for a scalable resource.</p> <p>Capacity forecasts are represented as predicted values, or data points, that are calculated using historical data points from a specified CloudWatch load metric. Data points are available for up to 56 days. </p>', 'UpdateScalingPlan' => '<p>Updates the specified scaling plan.</p> <p>You cannot update a scaling plan if it is in the process of being created, updated, or deleted.</p>', ], 'shapes' => [ 'ApplicationSource' => [ 'base' => '<p>Represents an application source.</p>', 'refs' => [ 'ApplicationSources$member' => NULL, 'CreateScalingPlanRequest$ApplicationSource' => '<p>A CloudFormation stack or set of tags. You can create one scaling plan per application source.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/plans/APIReference/API_ApplicationSource.html\">ApplicationSource</a> in the <i>AWS Auto Scaling API Reference</i>.</p>', 'ScalingPlan$ApplicationSource' => '<p>A CloudFormation stack or a set of tags. You can create one scaling plan per application source.</p>', 'UpdateScalingPlanRequest$ApplicationSource' => '<p>A CloudFormation stack or set of tags.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/plans/APIReference/API_ApplicationSource.html\">ApplicationSource</a> in the <i>AWS Auto Scaling API Reference</i>.</p>', ], ], 'ApplicationSources' => [ 'base' => NULL, 'refs' => [ 'DescribeScalingPlansRequest$ApplicationSources' => '<p>The sources for the applications (up to 10). If you specify scaling plan names, you cannot specify application sources.</p>', ], ], 'ConcurrentUpdateException' => [ 'base' => '<p>Concurrent updates caused an exception, for example, if you request an update to a scaling plan that already has a pending update.</p>', 'refs' => [], ], 'Cooldown' => [ 'base' => NULL, 'refs' => [ 'TargetTrackingConfiguration$ScaleOutCooldown' => '<p>The amount of time, in seconds, to wait for a previous scale-out activity to take effect. This property is not used if the scalable resource is an Auto Scaling group.</p> <p>With the <i>scale-out cooldown period</i>, the intention is to continuously (but not excessively) scale out. After Auto Scaling successfully scales out using a target tracking scaling policy, it starts to calculate the cooldown time. The scaling policy won\\'t increase the desired capacity again unless either a larger scale out is triggered or the cooldown period ends.</p>', 'TargetTrackingConfiguration$ScaleInCooldown' => '<p>The amount of time, in seconds, after a scale-in activity completes before another scale-in activity can start. This property is not used if the scalable resource is an Auto Scaling group.</p> <p>With the <i>scale-in cooldown period</i>, the intention is to scale in conservatively to protect your application\u00e2\u20ac\u2122s availability, so scale-in activities are blocked until the cooldown period has expired. However, if another alarm triggers a scale-out activity during the scale-in cooldown period, Auto Scaling scales out the target immediately. In this case, the scale-in cooldown period stops and doesn\\'t complete.</p>', 'TargetTrackingConfiguration$EstimatedInstanceWarmup' => '<p>The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. This value is used only if the resource is an Auto Scaling group.</p>', ], ], 'CreateScalingPlanRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateScalingPlanResponse' => [ 'base' => NULL, 'refs' => [], ], 'CustomizedLoadMetricSpecification' => [ 'base' => '<p>Represents a CloudWatch metric of your choosing that can be used for predictive scaling. </p> <p>For predictive scaling to work with a customized load metric specification, AWS Auto Scaling needs access to the <code>Sum</code> and <code>Average</code> statistics that CloudWatch computes from metric data.</p> <p>When you choose a load metric, make sure that the required <code>Sum</code> and <code>Average</code> statistics for your metric are available in CloudWatch and that they provide relevant data for predictive scaling. The <code>Sum</code> statistic must represent the total load on the resource, and the <code>Average</code> statistic must represent the average load per capacity unit of the resource. For example, there is a metric that counts the number of requests processed by your Auto Scaling group. If the <code>Sum</code> statistic represents the total request count processed by the group, then the <code>Average</code> statistic for the specified metric must represent the average request count processed by each instance of the group. </p> <p>If you publish your own metrics, you can aggregate the data points at a given interval and then publish the aggregated data points to CloudWatch. Before AWS Auto Scaling generates the forecast, it sums up all the metric data points that occurred within each hour to match the granularity period that is used in the forecast (60 minutes).</p> <p>For information about terminology, available metrics, or how to publish new metrics, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html\">Amazon CloudWatch Concepts</a> in the <i>Amazon CloudWatch User Guide</i>. </p> <p>After creating your scaling plan, you can use the AWS Auto Scaling console to visualize forecasts for the specified metric. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/plans/userguide/gs-create-scaling-plan.html#gs-view-resource\">View Scaling Information for a Resource</a> in the <i>AWS Auto Scaling User Guide</i>.</p>', 'refs' => [ 'ScalingInstruction$CustomizedLoadMetricSpecification' => '<p>The customized load metric to use for predictive scaling. This parameter or a <b>PredefinedLoadMetricSpecification</b> is required when configuring predictive scaling, and cannot be used otherwise. </p>', ], ], 'CustomizedScalingMetricSpecification' => [ 'base' => '<p>Represents a CloudWatch metric of your choosing that can be used for dynamic scaling as part of a target tracking scaling policy. </p> <p>To create your customized scaling metric specification:</p> <ul> <li> <p>Add values for each required parameter from CloudWatch. You can use an existing metric, or a new metric that you create. To use your own metric, you must first publish the metric to CloudWatch. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html\">Publish Custom Metrics</a> in the <i>Amazon CloudWatch User Guide</i>.</p> </li> <li> <p>Choose a metric that changes proportionally with capacity. The value of the metric should increase or decrease in inverse proportion to the number of capacity units. That is, the value of the metric should decrease when capacity increases. </p> </li> </ul> <p>For information about terminology, available metrics, or how to publish new metrics, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html\">Amazon CloudWatch Concepts</a> in the <i>Amazon CloudWatch User Guide</i>. </p>', 'refs' => [ 'TargetTrackingConfiguration$CustomizedScalingMetricSpecification' => '<p>A customized metric. You can specify either a predefined metric or a customized metric. </p>', ], ], 'Datapoint' => [ 'base' => '<p>Represents a single value in the forecast data used for predictive scaling.</p>', 'refs' => [ 'Datapoints$member' => NULL, ], ], 'Datapoints' => [ 'base' => NULL, 'refs' => [ 'GetScalingPlanResourceForecastDataResponse$Datapoints' => '<p>The data points to return.</p>', ], ], 'DeleteScalingPlanRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteScalingPlanResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeScalingPlanResourcesRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeScalingPlanResourcesResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeScalingPlansRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeScalingPlansResponse' => [ 'base' => NULL, 'refs' => [], ], 'DisableDynamicScaling' => [ 'base' => NULL, 'refs' => [ 'ScalingInstruction$DisableDynamicScaling' => '<p>Controls whether dynamic scaling by AWS Auto Scaling is disabled. When dynamic scaling is enabled, AWS Auto Scaling creates target tracking scaling policies based on the specified target tracking configurations. </p> <p>The default is enabled (<code>false</code>). </p>', ], ], 'DisableScaleIn' => [ 'base' => NULL, 'refs' => [ 'TargetTrackingConfiguration$DisableScaleIn' => '<p>Indicates whether scale in by the target tracking scaling policy is disabled. If the value is <code>true</code>, scale in is disabled and the target tracking scaling policy doesn\\'t remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking scaling policy can remove capacity from the scalable resource. </p> <p>The default value is <code>false</code>.</p>', ], ], 'ErrorMessage' => [ 'base' => NULL, 'refs' => [ 'ConcurrentUpdateException$Message' => NULL, 'InternalServiceException$Message' => NULL, 'InvalidNextTokenException$Message' => NULL, 'LimitExceededException$Message' => NULL, 'ObjectNotFoundException$Message' => NULL, 'ValidationException$Message' => NULL, ], ], 'ForecastDataType' => [ 'base' => NULL, 'refs' => [ 'GetScalingPlanResourceForecastDataRequest$ForecastDataType' => '<p>The type of forecast data to get.</p> <ul> <li> <p> <code>LoadForecast</code>: The load metric forecast. </p> </li> <li> <p> <code>CapacityForecast</code>: The capacity forecast. </p> </li> <li> <p> <code>ScheduledActionMinCapacity</code>: The minimum capacity for each scheduled scaling action. This data is calculated as the larger of two values: the capacity forecast or the minimum capacity in the scaling instruction.</p> </li> <li> <p> <code>ScheduledActionMaxCapacity</code>: The maximum capacity for each scheduled scaling action. The calculation used is determined by the predictive scaling maximum capacity behavior setting in the scaling instruction.</p> </li> </ul>', ], ], 'GetScalingPlanResourceForecastDataRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetScalingPlanResourceForecastDataResponse' => [ 'base' => NULL, 'refs' => [], ], 'InternalServiceException' => [ 'base' => '<p>The service encountered an internal error.</p>', 'refs' => [], ], 'InvalidNextTokenException' => [ 'base' => '<p>The token provided is not valid.</p>', 'refs' => [], ], 'LimitExceededException' => [ 'base' => '<p>Your account exceeded a limit. This exception is thrown when a per-account resource limit is exceeded.</p>', 'refs' => [], ], 'LoadMetricType' => [ 'base' => NULL, 'refs' => [ 'PredefinedLoadMetricSpecification$PredefinedLoadMetricType' => '<p>The metric type.</p>', ], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'DescribeScalingPlanResourcesRequest$MaxResults' => '<p>The maximum number of scalable resources to return. The value must be between 1 and 50. The default value is 50.</p>', 'DescribeScalingPlansRequest$MaxResults' => '<p>The maximum number of scalable resources to return. This value can be between 1 and 50. The default value is 50.</p>', ], ], 'MetricDimension' => [ 'base' => '<p>Represents a dimension for a customized metric.</p>', 'refs' => [ 'MetricDimensions$member' => NULL, ], ], 'MetricDimensionName' => [ 'base' => NULL, 'refs' => [ 'MetricDimension$Name' => '<p>The name of the dimension.</p>', ], ], 'MetricDimensionValue' => [ 'base' => NULL, 'refs' => [ 'MetricDimension$Value' => '<p>The value of the dimension.</p>', ], ], 'MetricDimensions' => [ 'base' => NULL, 'refs' => [ 'CustomizedLoadMetricSpecification$Dimensions' => '<p>The dimensions of the metric.</p> <p>Conditional: If you published your metric with dimensions, you must specify the same dimensions in your customized load metric specification.</p>', 'CustomizedScalingMetricSpecification$Dimensions' => '<p>The dimensions of the metric.</p> <p>Conditional: If you published your metric with dimensions, you must specify the same dimensions in your customized scaling metric specification.</p>', ], ], 'MetricName' => [ 'base' => NULL, 'refs' => [ 'CustomizedLoadMetricSpecification$MetricName' => '<p>The name of the metric.</p>', 'CustomizedScalingMetricSpecification$MetricName' => '<p>The name of the metric.</p>', ], ], 'MetricNamespace' => [ 'base' => NULL, 'refs' => [ 'CustomizedLoadMetricSpecification$Namespace' => '<p>The namespace of the metric.</p>', 'CustomizedScalingMetricSpecification$Namespace' => '<p>The namespace of the metric.</p>', ], ], 'MetricScale' => [ 'base' => NULL, 'refs' => [ 'Datapoint$Value' => '<p>The value of the data point.</p>', 'TargetTrackingConfiguration$TargetValue' => '<p>The target value for the metric. Although this property accepts numbers of type Double, it won\\'t accept values that are either too small or too large. Values must be in the range of -2^360 to 2^360.</p>', ], ], 'MetricStatistic' => [ 'base' => NULL, 'refs' => [ 'CustomizedLoadMetricSpecification$Statistic' => '<p>The statistic of the metric. The only valid value is <code>Sum</code>.</p>', 'CustomizedScalingMetricSpecification$Statistic' => '<p>The statistic of the metric.</p>', ], ], 'MetricUnit' => [ 'base' => NULL, 'refs' => [ 'CustomizedLoadMetricSpecification$Unit' => '<p>The unit of the metric.</p>', 'CustomizedScalingMetricSpecification$Unit' => '<p>The unit of the metric. </p>', ], ], 'NextToken' => [ 'base' => NULL, 'refs' => [ 'DescribeScalingPlanResourcesRequest$NextToken' => '<p>The token for the next set of results.</p>', 'DescribeScalingPlanResourcesResponse$NextToken' => '<p>The token required to get the next set of results. This value is <code>null</code> if there are no more results to return.</p>', 'DescribeScalingPlansRequest$NextToken' => '<p>The token for the next set of results.</p>', 'DescribeScalingPlansResponse$NextToken' => '<p>The token required to get the next set of results. This value is <code>null</code> if there are no more results to return.</p>', ], ], 'ObjectNotFoundException' => [ 'base' => '<p>The specified object could not be found.</p>', 'refs' => [], ], 'PolicyName' => [ 'base' => NULL, 'refs' => [ 'ScalingPolicy$PolicyName' => '<p>The name of the scaling policy.</p>', ], ], 'PolicyType' => [ 'base' => NULL, 'refs' => [ 'ScalingPolicy$PolicyType' => '<p>The type of scaling policy.</p>', ], ], 'PredefinedLoadMetricSpecification' => [ 'base' => '<p>Represents a predefined metric that can be used for predictive scaling.</p> <p>After creating your scaling plan, you can use the AWS Auto Scaling console to visualize forecasts for the specified metric. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/plans/userguide/gs-create-scaling-plan.html#gs-view-resource\">View Scaling Information for a Resource</a> in the <i>AWS Auto Scaling User Guide</i>.</p>', 'refs' => [ 'ScalingInstruction$PredefinedLoadMetricSpecification' => '<p>The predefined load metric to use for predictive scaling. This parameter or a <b>CustomizedLoadMetricSpecification</b> is required when configuring predictive scaling, and cannot be used otherwise. </p>', ], ], 'PredefinedScalingMetricSpecification' => [ 'base' => '<p>Represents a predefined metric that can be used for dynamic scaling as part of a target tracking scaling policy.</p>', 'refs' => [ 'TargetTrackingConfiguration$PredefinedScalingMetricSpecification' => '<p>A predefined metric. You can specify either a predefined metric or a customized metric.</p>', ], ], 'PredictiveScalingMaxCapacityBehavior' => [ 'base' => NULL, 'refs' => [ 'ScalingInstruction$PredictiveScalingMaxCapacityBehavior' => '<p>Defines the behavior that should be applied if the forecast capacity approaches or exceeds the maximum capacity specified for the resource. The default value is <code>SetForecastCapacityToMaxCapacity</code>.</p> <p>The following are possible values:</p> <ul> <li> <p> <code>SetForecastCapacityToMaxCapacity</code> - AWS Auto Scaling cannot scale resource capacity higher than the maximum capacity. The maximum capacity is enforced as a hard limit. </p> </li> <li> <p> <code>SetMaxCapacityToForecastCapacity</code> - AWS Auto Scaling may scale resource capacity higher than the maximum capacity to equal but not exceed forecast capacity.</p> </li> <li> <p> <code>SetMaxCapacityAboveForecastCapacity</code> - AWS Auto Scaling may scale resource capacity higher than the maximum capacity by a specified buffer value. The intention is to give the target tracking scaling policy extra capacity if unexpected traffic occurs. </p> </li> </ul> <p>Only valid when configuring predictive scaling.</p>', ], ], 'PredictiveScalingMode' => [ 'base' => NULL, 'refs' => [ 'ScalingInstruction$PredictiveScalingMode' => '<p>The predictive scaling mode. The default value is <code>ForecastAndScale</code>. Otherwise, AWS Auto Scaling forecasts capacity but does not create any scheduled scaling actions based on the capacity forecast. </p>', ], ], 'ResourceCapacity' => [ 'base' => NULL, 'refs' => [ 'ScalingInstruction$MinCapacity' => '<p>The minimum capacity of the resource. </p>', 'ScalingInstruction$MaxCapacity' => '<p>The maximum capacity of the resource. The exception to this upper limit is if you specify a non-default setting for <b>PredictiveScalingMaxCapacityBehavior</b>. </p>', 'ScalingInstruction$PredictiveScalingMaxCapacityBuffer' => '<p>The size of the capacity buffer to use when the forecast capacity is close to or exceeds the maximum capacity. The value is specified as a percentage relative to the forecast capacity. For example, if the buffer is 10, this means a 10 percent buffer, such that if the forecast capacity is 50, and the maximum capacity is 40, then the effective maximum capacity is 55.</p> <p>Only valid when configuring predictive scaling. Required if the <b>PredictiveScalingMaxCapacityBehavior</b> is set to <code>SetMaxCapacityAboveForecastCapacity</code>, and cannot be used otherwise.</p> <p>The range is 1-100.</p>', ], ], 'ResourceIdMaxLen1600' => [ 'base' => NULL, 'refs' => [ 'ScalingInstruction$ResourceId' => '<p>The ID of the resource. This string consists of the resource type and unique identifier.</p> <ul> <li> <p>Auto Scaling group - The resource type is <code>autoScalingGroup</code> and the unique identifier is the name of the Auto Scaling group. Example: <code>autoScalingGroup/my-asg</code>.</p> </li> <li> <p>ECS service - The resource type is <code>service</code> and the unique identifier is the cluster name and service name. Example: <code>service/default/sample-webapp</code>.</p> </li> <li> <p>Spot Fleet request - The resource type is <code>spot-fleet-request</code> and the unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>.</p> </li> <li> <p>DynamoDB table - The resource type is <code>table</code> and the unique identifier is the resource ID. Example: <code>table/my-table</code>.</p> </li> <li> <p>DynamoDB global secondary index - The resource type is <code>index</code> and the unique identifier is the resource ID. Example: <code>table/my-table/index/my-table-index</code>.</p> </li> <li> <p>Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:my-db-cluster</code>.</p> </li> </ul>', 'ScalingPlanResource$ResourceId' => '<p>The ID of the resource. This string consists of the resource type and unique identifier.</p> <ul> <li> <p>Auto Scaling group - The resource type is <code>autoScalingGroup</code> and the unique identifier is the name of the Auto Scaling group. Example: <code>autoScalingGroup/my-asg</code>.</p> </li> <li> <p>ECS service - The resource type is <code>service</code> and the unique identifier is the cluster name and service name. Example: <code>service/default/sample-webapp</code>.</p> </li> <li> <p>Spot Fleet request - The resource type is <code>spot-fleet-request</code> and the unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>.</p> </li> <li> <p>DynamoDB table - The resource type is <code>table</code> and the unique identifier is the resource ID. Example: <code>table/my-table</code>.</p> </li> <li> <p>DynamoDB global secondary index - The resource type is <code>index</code> and the unique identifier is the resource ID. Example: <code>table/my-table/index/my-table-index</code>.</p> </li> <li> <p>Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier is the cluster name. Example: <code>cluster:my-db-cluster</code>.</p> </li> </ul>', ], ], 'ResourceLabel' => [ 'base' => NULL, 'refs' => [ 'PredefinedLoadMetricSpecification$ResourceLabel' => '<p>Identifies the resource associated with the metric type. You can\\'t specify a resource label unless the metric type is <code>ALBTargetGroupRequestCount</code> and there is a target group for an Application Load Balancer attached to the Auto Scaling group.</p> <p>You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format is app/&lt;load-balancer-name&gt;/&lt;load-balancer-id&gt;/targetgroup/&lt;target-group-name&gt;/&lt;target-group-id&gt;, where:</p> <ul> <li> <p>app/&lt;load-balancer-name&gt;/&lt;load-balancer-id&gt; is the final portion of the load balancer ARN</p> </li> <li> <p>targetgroup/&lt;target-group-name&gt;/&lt;target-group-id&gt; is the final portion of the target group ARN.</p> </li> </ul> <p>This is an example: app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d.</p> <p>To find the ARN for an Application Load Balancer, use the <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html\">DescribeLoadBalancers</a> API operation. To find the ARN for the target group, use the <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html\">DescribeTargetGroups</a> API operation.</p>', 'PredefinedScalingMetricSpecification$ResourceLabel' => '<p>Identifies the resource associated with the metric type. You can\\'t specify a resource label unless the metric type is <code>ALBRequestCountPerTarget</code> and there is a target group for an Application Load Balancer attached to the Auto Scaling group, Spot Fleet request, or ECS service.</p> <p>You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format is app/&lt;load-balancer-name&gt;/&lt;load-balancer-id&gt;/targetgroup/&lt;target-group-name&gt;/&lt;target-group-id&gt;, where:</p> <ul> <li> <p>app/&lt;load-balancer-name&gt;/&lt;load-balancer-id&gt; is the final portion of the load balancer ARN</p> </li> <li> <p>targetgroup/&lt;target-group-name&gt;/&lt;target-group-id&gt; is the final portion of the target group ARN.</p> </li> </ul> <p>This is an example: app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d.</p> <p>To find the ARN for an Application Load Balancer, use the <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html\">DescribeLoadBalancers</a> API operation. To find the ARN for the target group, use the <a href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html\">DescribeTargetGroups</a> API operation.</p>', ], ], 'ScalableDimension' => [ 'base' => NULL, 'refs' => [ 'GetScalingPlanResourceForecastDataRequest$ScalableDimension' => '<p>The scalable dimension for the resource. The only valid value is <code>autoscaling:autoScalingGroup:DesiredCapacity</code>. </p>', 'ScalingInstruction$ScalableDimension' => '<p>The scalable dimension associated with the resource.</p> <ul> <li> <p> <code>autoscaling:autoScalingGroup:DesiredCapacity</code> - The desired capacity of an Auto Scaling group.</p> </li> <li> <p> <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service.</p> </li> <li> <p> <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot Fleet request.</p> </li> <li> <p> <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.</p> </li> </ul>', 'ScalingPlanResource$ScalableDimension' => '<p>The scalable dimension for the resource.</p> <ul> <li> <p> <code>autoscaling:autoScalingGroup:DesiredCapacity</code> - The desired capacity of an Auto Scaling group.</p> </li> <li> <p> <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service.</p> </li> <li> <p> <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot Fleet request.</p> </li> <li> <p> <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB table.</p> </li> <li> <p> <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for a DynamoDB global secondary index.</p> </li> <li> <p> <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.</p> </li> </ul>', ], ], 'ScalingInstruction' => [ 'base' => '<p>Describes a scaling instruction for a scalable resource in a scaling plan. Each scaling instruction applies to one resource.</p> <p>AWS Auto Scaling creates target tracking scaling policies based on the scaling instructions. Target tracking scaling policies adjust the capacity of your scalable resource as required to maintain resource utilization at the target value that you specified. </p> <p>AWS Auto Scaling also configures predictive scaling for your Amazon EC2 Auto Scaling groups using a subset of parameters, including the load metric, the scaling metric, the target value for the scaling metric, the predictive scaling mode (forecast and scale or forecast only), and the desired behavior when the forecast capacity exceeds the maximum capacity of the resource. With predictive scaling, AWS Auto Scaling generates forecasts with traffic predictions for the two days ahead and schedules scaling actions that proactively add and remove resource capacity to match the forecast. </p> <important> <p>We recommend waiting a minimum of 24 hours after creating an Auto Scaling group to configure predictive scaling. At minimum, there must be 24 hours of historical data to generate a forecast. For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/plans/userguide/gs-best-practices.html\">Best Practices for AWS Auto Scaling</a> in the <i>AWS Auto Scaling User Guide</i>.</p> </important>', 'refs' => [ 'ScalingInstructions$member' => NULL, ], ], 'ScalingInstructions' => [ 'base' => NULL, 'refs' => [ 'CreateScalingPlanRequest$ScalingInstructions' => '<p>The scaling instructions.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/plans/APIReference/API_ScalingInstruction.html\">ScalingInstruction</a> in the <i>AWS Auto Scaling API Reference</i>.</p>', 'ScalingPlan$ScalingInstructions' => '<p>The scaling instructions.</p>', 'UpdateScalingPlanRequest$ScalingInstructions' => '<p>The scaling instructions.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/autoscaling/plans/APIReference/API_ScalingInstruction.html\">ScalingInstruction</a> in the <i>AWS Auto Scaling API Reference</i>.</p>', ], ], 'ScalingMetricType' => [ 'base' => NULL, 'refs' => [ 'PredefinedScalingMetricSpecification$PredefinedScalingMetricType' => '<p>The metric type. The <code>ALBRequestCountPerTarget</code> metric type applies only to Auto Scaling groups, Spot Fleet requests, and ECS services.</p>', ], ], 'ScalingPlan' => [ 'base' => '<p>Represents a scaling plan.</p>', 'refs' => [ 'ScalingPlans$member' => NULL, ], ], 'ScalingPlanName' => [ 'base' => NULL, 'refs' => [ 'CreateScalingPlanRequest$ScalingPlanName' => '<p>The name of the scaling plan. Names cannot contain vertical bars, colons, or forward slashes.</p>', 'DeleteScalingPlanRequest$ScalingPlanName' => '<p>The name of the scaling plan.</p>', 'DescribeScalingPlanResourcesRequest$ScalingPlanName' => '<p>The name of the scaling plan.</p>', 'GetScalingPlanResourceForecastDataRequest$ScalingPlanName' => '<p>The name of the scaling plan.</p>', 'ScalingPlan$ScalingPlanName' => '<p>The name of the scaling plan.</p>', 'ScalingPlanNames$member' => NULL, 'ScalingPlanResource$ScalingPlanName' => '<p>The name of the scaling plan.</p>', 'UpdateScalingPlanRequest$ScalingPlanName' => '<p>The name of the scaling plan.</p>', ], ], 'ScalingPlanNames' => [ 'base' => NULL, 'refs' => [ 'DescribeScalingPlansRequest$ScalingPlanNames' => '<p>The names of the scaling plans (up to 10). If you specify application sources, you cannot specify scaling plan names.</p>', ], ], 'ScalingPlanResource' => [ 'base' => '<p>Represents a scalable resource.</p>', 'refs' => [ 'ScalingPlanResources$member' => NULL, ], ], 'ScalingPlanResources' => [ 'base' => NULL, 'refs' => [ 'DescribeScalingPlanResourcesResponse$ScalingPlanResources' => '<p>Information about the scalable resources.</p>', ], ], 'ScalingPlanStatusCode' => [ 'base' => NULL, 'refs' => [ 'ScalingPlan$StatusCode' => '<p>The status of the scaling plan.</p> <ul> <li> <p> <code>Active</code> - The scaling plan is active.</p> </li> <li> <p> <code>ActiveWithProblems</code> - The scaling plan is active, but the scaling configuration for one or more resources could not be applied.</p> </li> <li> <p> <code>CreationInProgress</code> - The scaling plan is being created.</p> </li> <li> <p> <code>CreationFailed</code> - The scaling plan could not be created.</p> </li> <li> <p> <code>DeletionInProgress</code> - The scaling plan is being deleted.</p> </li> <li> <p> <code>DeletionFailed</code> - The scaling plan could not be deleted.</p> </li> <li> <p> <code>UpdateInProgress</code> - The scaling plan is being updated.</p> </li> <li> <p> <code>UpdateFailed</code> - The scaling plan could not be updated.</p> </li> </ul>', ], ], 'ScalingPlanVersion' => [ 'base' => NULL, 'refs' => [ 'CreateScalingPlanResponse$ScalingPlanVersion' => '<p>The version number of the scaling plan. This value is always <code>1</code>. Currently, you cannot have multiple scaling plan versions.</p>', 'DeleteScalingPlanRequest$ScalingPlanVersion' => '<p>The version number of the scaling plan. Currently, the only valid value is <code>1</code>.</p>', 'DescribeScalingPlanResourcesRequest$ScalingPlanVersion' => '<p>The version number of the scaling plan. Currently, the only valid value is <code>1</code>.</p>', 'DescribeScalingPlansRequest$ScalingPlanVersion' => '<p>The version number of the scaling plan. Currently, the only valid value is <code>1</code>.</p> <note> <p>If you specify a scaling plan version, you must also specify a scaling plan name.</p> </note>', 'GetScalingPlanResourceForecastDataRequest$ScalingPlanVersion' => '<p>The version number of the scaling plan. Currently, the only valid value is <code>1</code>.</p>', 'ScalingPlan$ScalingPlanVersion' => '<p>The version number of the scaling plan.</p>', 'ScalingPlanResource$ScalingPlanVersion' => '<p>The version number of the scaling plan.</p>', 'UpdateScalingPlanRequest$ScalingPlanVersion' => '<p>The version number of the scaling plan. The only valid value is <code>1</code>. Currently, you cannot have multiple scaling plan versions.</p>', ], ], 'ScalingPlans' => [ 'base' => NULL, 'refs' => [ 'DescribeScalingPlansResponse$ScalingPlans' => '<p>Information about the scaling plans.</p>', ], ], 'ScalingPolicies' => [ 'base' => NULL, 'refs' => [ 'ScalingPlanResource$ScalingPolicies' => '<p>The scaling policies.</p>', ], ], 'ScalingPolicy' => [ 'base' => '<p>Represents a scaling policy.</p>', 'refs' => [ 'ScalingPolicies$member' => NULL, ], ], 'ScalingPolicyUpdateBehavior' => [ 'base' => NULL, 'refs' => [ 'ScalingInstruction$ScalingPolicyUpdateBehavior' => '<p>Controls whether a resource\\'s externally created scaling policies are kept or replaced. </p> <p>The default value is <code>KeepExternalPolicies</code>. If the parameter is set to <code>ReplaceExternalPolicies</code>, any scaling policies that are external to AWS Auto Scaling are deleted and new target tracking scaling policies created. </p> <p>Only valid when configuring dynamic scaling. </p> <p>Condition: The number of existing policies to be replaced must be less than or equal to 50. If there are more than 50 policies to be replaced, AWS Auto Scaling keeps all existing policies and does not create new ones.</p>', ], ], 'ScalingStatusCode' => [ 'base' => NULL, 'refs' => [ 'ScalingPlanResource$ScalingStatusCode' => '<p>The scaling status of the resource.</p> <ul> <li> <p> <code>Active</code> - The scaling configuration is active.</p> </li> <li> <p> <code>Inactive</code> - The scaling configuration is not active because the scaling plan is being created or the scaling configuration could not be applied. Check the status message for more information.</p> </li> <li> <p> <code>PartiallyActive</code> - The scaling configuration is partially active because the scaling plan is being created or deleted or the scaling configuration could not be fully applied. Check the status message for more information.</p> </li> </ul>', ], ], 'ScheduledActionBufferTime' => [ 'base' => NULL, 'refs' => [ 'ScalingInstruction$ScheduledActionBufferTime' => '<p>The amount of time, in seconds, to buffer the run time of scheduled scaling actions when scaling out. For example, if the forecast says to add capacity at 10:00 AM, and the buffer time is 5 minutes, then the run time of the corresponding scheduled scaling action will be 9:55 AM. The intention is to give resources time to be provisioned. For example, it can take a few minutes to launch an EC2 instance. The actual amount of time required depends on several factors, such as the size of the instance and whether there are startup scripts to complete. </p> <p>The value must be less than the forecast interval duration of 3600 seconds (60 minutes). The default is 300 seconds. </p> <p>Only valid when configuring predictive scaling. </p>', ], ], 'ServiceNamespace' => [ 'base' => NULL, 'refs' => [ 'GetScalingPlanResourceForecastDataRequest$ServiceNamespace' => '<p>The namespace of the AWS service. The only valid value is <code>autoscaling</code>. </p>', 'ScalingInstruction$ServiceNamespace' => '<p>The namespace of the AWS service.</p>', 'ScalingPlanResource$ServiceNamespace' => '<p>The namespace of the AWS service.</p>', ], ], 'TagFilter' => [ 'base' => '<p>Represents a tag.</p>', 'refs' => [ 'TagFilters$member' => NULL, ], ], 'TagFilters' => [ 'base' => NULL, 'refs' => [ 'ApplicationSource$TagFilters' => '<p>A set of tags (up to 50).</p>', ], ], 'TagValues' => [ 'base' => NULL, 'refs' => [ 'TagFilter$Values' => '<p>The tag values (0 to 20).</p>', ], ], 'TargetTrackingConfiguration' => [ 'base' => '<p>Describes a target tracking configuration to use with AWS Auto Scaling. Used with <a>ScalingInstruction</a> and <a>ScalingPolicy</a>.</p>', 'refs' => [ 'ScalingPolicy$TargetTrackingConfiguration' => '<p>The target tracking scaling policy. Includes support for predefined or customized metrics.</p>', 'TargetTrackingConfigurations$member' => NULL, ], ], 'TargetTrackingConfigurations' => [ 'base' => NULL, 'refs' => [ 'ScalingInstruction$TargetTrackingConfigurations' => '<p>The target tracking configurations (up to 10). Each of these structures must specify a unique scaling metric and a target value for the metric. </p>', ], ], 'TimestampType' => [ 'base' => NULL, 'refs' => [ 'Datapoint$Timestamp' => '<p>The time stamp for the data point in UTC format.</p>', 'GetScalingPlanResourceForecastDataRequest$StartTime' => '<p>The inclusive start time of the time range for the forecast data to get. The date and time can be at most 56 days before the current date and time. </p>', 'GetScalingPlanResourceForecastDataRequest$EndTime' => '<p>The exclusive end time of the time range for the forecast data to get. The maximum time duration between the start and end time is seven days. </p> <p>Although this parameter can accept a date and time that is more than two days in the future, the availability of forecast data has limits. AWS Auto Scaling only issues forecasts for periods of two days in advance.</p>', 'ScalingPlan$StatusStartTime' => '<p>The Unix time stamp when the scaling plan entered the current status.</p>', 'ScalingPlan$CreationTime' => '<p>The Unix time stamp when the scaling plan was created.</p>', ], ], 'UpdateScalingPlanRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateScalingPlanResponse' => [ 'base' => NULL, 'refs' => [], ], 'ValidationException' => [ 'base' => '<p>An exception was thrown for a validation issue. Review the parameters provided.</p>', 'refs' => [], ], 'XmlString' => [ 'base' => NULL, 'refs' => [ 'ApplicationSource$CloudFormationStackARN' => '<p>The Amazon Resource Name (ARN) of a AWS CloudFormation stack.</p>', 'GetScalingPlanResourceForecastDataRequest$ResourceId' => '<p>The ID of the resource. This string consists of a prefix (<code>autoScalingGroup</code>) followed by the name of a specified Auto Scaling group (<code>my-asg</code>). Example: <code>autoScalingGroup/my-asg</code>. </p>', 'ScalingPlan$StatusMessage' => '<p>A simple message about the current status of the scaling plan.</p>', 'ScalingPlanResource$ScalingStatusMessage' => '<p>A simple message about the current scaling status of the resource.</p>', ], ], 'XmlStringMaxLen128' => [ 'base' => NULL, 'refs' => [ 'TagFilter$Key' => '<p>The tag key.</p>', ], ], 'XmlStringMaxLen256' => [ 'base' => NULL, 'refs' => [ 'TagValues$member' => NULL, ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/autoscaling-plans/2018-01-06/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], [ 'fn' => 'parseURL', 'argv' => [ [ 'ref' => 'Endpoint', ], ], 'assign' => 'url', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://autoscaling-plans.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://autoscaling-plans.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/autoscaling-plans/2018-01-06/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ap-south-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ap-south-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.eu-south-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.eu-south-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ca-central-1.api.aws', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ca-central-1.api.aws', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.eu-central-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.eu-central-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.af-south-1.api.aws', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.af-south-1.api.aws', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.eu-north-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.eu-north-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.eu-west-3.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.eu-west-3.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ap-northeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ap-northeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ap-northeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ap-northeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ap-northeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ap-northeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.me-south-1.api.aws', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.me-south-1.api.aws', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.sa-east-1.api.aws', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.sa-east-1.api.aws', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ap-east-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ap-east-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.us-gov-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.us-gov-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ap-southeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ap-southeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ap-southeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ap-southeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ap-southeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ap-southeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans-fips.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://autoscaling-plans.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/autoscaling-plans/2018-01-06/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/autoscaling-plans/2018-01-06/paginators-1.json\nreturn [ 'pagination' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backup/2018-11-15/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2018-11-15', 'endpointPrefix' => 'backup', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'AWS Backup', 'serviceId' => 'Backup', 'signatureVersion' => 'v4', 'uid' => 'backup-2018-11-15', ], 'operations' => [ 'CancelLegalHold' => [ 'name' => 'CancelLegalHold', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/legal-holds/{legalHoldId}', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CancelLegalHoldInput', ], 'output' => [ 'shape' => 'CancelLegalHoldOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'InvalidResourceStateException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'CreateBackupPlan' => [ 'name' => 'CreateBackupPlan', 'http' => [ 'method' => 'PUT', 'requestUri' => '/backup/plans/', ], 'input' => [ 'shape' => 'CreateBackupPlanInput', ], 'output' => [ 'shape' => 'CreateBackupPlanOutput', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'CreateBackupSelection' => [ 'name' => 'CreateBackupSelection', 'http' => [ 'method' => 'PUT', 'requestUri' => '/backup/plans/{backupPlanId}/selections/', ], 'input' => [ 'shape' => 'CreateBackupSelectionInput', ], 'output' => [ 'shape' => 'CreateBackupSelectionOutput', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'CreateBackupVault' => [ 'name' => 'CreateBackupVault', 'http' => [ 'method' => 'PUT', 'requestUri' => '/backup-vaults/{backupVaultName}', ], 'input' => [ 'shape' => 'CreateBackupVaultInput', ], 'output' => [ 'shape' => 'CreateBackupVaultOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AlreadyExistsException', ], ], 'idempotent' => true, ], 'CreateFramework' => [ 'name' => 'CreateFramework', 'http' => [ 'method' => 'POST', 'requestUri' => '/audit/frameworks', ], 'input' => [ 'shape' => 'CreateFrameworkInput', ], 'output' => [ 'shape' => 'CreateFrameworkOutput', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'CreateLegalHold' => [ 'name' => 'CreateLegalHold', 'http' => [ 'method' => 'POST', 'requestUri' => '/legal-holds/', ], 'input' => [ 'shape' => 'CreateLegalHoldInput', ], 'output' => [ 'shape' => 'CreateLegalHoldOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], 'CreateReportPlan' => [ 'name' => 'CreateReportPlan', 'http' => [ 'method' => 'POST', 'requestUri' => '/audit/report-plans', ], 'input' => [ 'shape' => 'CreateReportPlanInput', ], 'output' => [ 'shape' => 'CreateReportPlanOutput', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'MissingParameterValueException', ], ], 'idempotent' => true, ], 'DeleteBackupPlan' => [ 'name' => 'DeleteBackupPlan', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/backup/plans/{backupPlanId}', ], 'input' => [ 'shape' => 'DeleteBackupPlanInput', ], 'output' => [ 'shape' => 'DeleteBackupPlanOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'DeleteBackupSelection' => [ 'name' => 'DeleteBackupSelection', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/backup/plans/{backupPlanId}/selections/{selectionId}', ], 'input' => [ 'shape' => 'DeleteBackupSelectionInput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], ], 'DeleteBackupVault' => [ 'name' => 'DeleteBackupVault', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/backup-vaults/{backupVaultName}', ], 'input' => [ 'shape' => 'DeleteBackupVaultInput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'DeleteBackupVaultAccessPolicy' => [ 'name' => 'DeleteBackupVaultAccessPolicy', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/backup-vaults/{backupVaultName}/access-policy', ], 'input' => [ 'shape' => 'DeleteBackupVaultAccessPolicyInput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'DeleteBackupVaultLockConfiguration' => [ 'name' => 'DeleteBackupVaultLockConfiguration', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/backup-vaults/{backupVaultName}/vault-lock', ], 'input' => [ 'shape' => 'DeleteBackupVaultLockConfigurationInput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'DeleteBackupVaultNotifications' => [ 'name' => 'DeleteBackupVaultNotifications', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/backup-vaults/{backupVaultName}/notification-configuration', ], 'input' => [ 'shape' => 'DeleteBackupVaultNotificationsInput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'DeleteFramework' => [ 'name' => 'DeleteFramework', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/audit/frameworks/{frameworkName}', ], 'input' => [ 'shape' => 'DeleteFrameworkInput', ], 'errors' => [ [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DeleteRecoveryPoint' => [ 'name' => 'DeleteRecoveryPoint', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/backup-vaults/{backupVaultName}/recovery-points/{recoveryPointArn}', ], 'input' => [ 'shape' => 'DeleteRecoveryPointInput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'InvalidResourceStateException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InvalidRequestException', ], ], 'idempotent' => true, ], 'DeleteReportPlan' => [ 'name' => 'DeleteReportPlan', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/audit/report-plans/{reportPlanName}', ], 'input' => [ 'shape' => 'DeleteReportPlanInput', ], 'errors' => [ [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'DescribeBackupJob' => [ 'name' => 'DescribeBackupJob', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup-jobs/{backupJobId}', ], 'input' => [ 'shape' => 'DescribeBackupJobInput', ], 'output' => [ 'shape' => 'DescribeBackupJobOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'DependencyFailureException', ], ], 'idempotent' => true, ], 'DescribeBackupVault' => [ 'name' => 'DescribeBackupVault', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup-vaults/{backupVaultName}', ], 'input' => [ 'shape' => 'DescribeBackupVaultInput', ], 'output' => [ 'shape' => 'DescribeBackupVaultOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'DescribeCopyJob' => [ 'name' => 'DescribeCopyJob', 'http' => [ 'method' => 'GET', 'requestUri' => '/copy-jobs/{copyJobId}', ], 'input' => [ 'shape' => 'DescribeCopyJobInput', ], 'output' => [ 'shape' => 'DescribeCopyJobOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'DescribeFramework' => [ 'name' => 'DescribeFramework', 'http' => [ 'method' => 'GET', 'requestUri' => '/audit/frameworks/{frameworkName}', ], 'input' => [ 'shape' => 'DescribeFrameworkInput', ], 'output' => [ 'shape' => 'DescribeFrameworkOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], ], 'DescribeGlobalSettings' => [ 'name' => 'DescribeGlobalSettings', 'http' => [ 'method' => 'GET', 'requestUri' => '/global-settings', ], 'input' => [ 'shape' => 'DescribeGlobalSettingsInput', ], 'output' => [ 'shape' => 'DescribeGlobalSettingsOutput', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ServiceUnavailableException', ], ], ], 'DescribeProtectedResource' => [ 'name' => 'DescribeProtectedResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/resources/{resourceArn}', ], 'input' => [ 'shape' => 'DescribeProtectedResourceInput', ], 'output' => [ 'shape' => 'DescribeProtectedResourceOutput', ], 'errors' => [ [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'DescribeRecoveryPoint' => [ 'name' => 'DescribeRecoveryPoint', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup-vaults/{backupVaultName}/recovery-points/{recoveryPointArn}', ], 'input' => [ 'shape' => 'DescribeRecoveryPointInput', ], 'output' => [ 'shape' => 'DescribeRecoveryPointOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'DescribeRegionSettings' => [ 'name' => 'DescribeRegionSettings', 'http' => [ 'method' => 'GET', 'requestUri' => '/account-settings', ], 'input' => [ 'shape' => 'DescribeRegionSettingsInput', ], 'output' => [ 'shape' => 'DescribeRegionSettingsOutput', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], ], ], 'DescribeReportJob' => [ 'name' => 'DescribeReportJob', 'http' => [ 'method' => 'GET', 'requestUri' => '/audit/report-jobs/{reportJobId}', ], 'input' => [ 'shape' => 'DescribeReportJobInput', ], 'output' => [ 'shape' => 'DescribeReportJobOutput', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'DescribeReportPlan' => [ 'name' => 'DescribeReportPlan', 'http' => [ 'method' => 'GET', 'requestUri' => '/audit/report-plans/{reportPlanName}', ], 'input' => [ 'shape' => 'DescribeReportPlanInput', ], 'output' => [ 'shape' => 'DescribeReportPlanOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], ], ], 'DescribeRestoreJob' => [ 'name' => 'DescribeRestoreJob', 'http' => [ 'method' => 'GET', 'requestUri' => '/restore-jobs/{restoreJobId}', ], 'input' => [ 'shape' => 'DescribeRestoreJobInput', ], 'output' => [ 'shape' => 'DescribeRestoreJobOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'DependencyFailureException', ], ], 'idempotent' => true, ], 'DisassociateRecoveryPoint' => [ 'name' => 'DisassociateRecoveryPoint', 'http' => [ 'method' => 'POST', 'requestUri' => '/backup-vaults/{backupVaultName}/recovery-points/{recoveryPointArn}/disassociate', ], 'input' => [ 'shape' => 'DisassociateRecoveryPointInput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'InvalidResourceStateException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'DisassociateRecoveryPointFromParent' => [ 'name' => 'DisassociateRecoveryPointFromParent', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/backup-vaults/{backupVaultName}/recovery-points/{recoveryPointArn}/parentAssociation', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DisassociateRecoveryPointFromParentInput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'ExportBackupPlanTemplate' => [ 'name' => 'ExportBackupPlanTemplate', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup/plans/{backupPlanId}/toTemplate/', ], 'input' => [ 'shape' => 'ExportBackupPlanTemplateInput', ], 'output' => [ 'shape' => 'ExportBackupPlanTemplateOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetBackupPlan' => [ 'name' => 'GetBackupPlan', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup/plans/{backupPlanId}/', ], 'input' => [ 'shape' => 'GetBackupPlanInput', ], 'output' => [ 'shape' => 'GetBackupPlanOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'GetBackupPlanFromJSON' => [ 'name' => 'GetBackupPlanFromJSON', 'http' => [ 'method' => 'POST', 'requestUri' => '/backup/template/json/toPlan', ], 'input' => [ 'shape' => 'GetBackupPlanFromJSONInput', ], 'output' => [ 'shape' => 'GetBackupPlanFromJSONOutput', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'GetBackupPlanFromTemplate' => [ 'name' => 'GetBackupPlanFromTemplate', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup/template/plans/{templateId}/toPlan', ], 'input' => [ 'shape' => 'GetBackupPlanFromTemplateInput', ], 'output' => [ 'shape' => 'GetBackupPlanFromTemplateOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetBackupSelection' => [ 'name' => 'GetBackupSelection', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup/plans/{backupPlanId}/selections/{selectionId}', ], 'input' => [ 'shape' => 'GetBackupSelectionInput', ], 'output' => [ 'shape' => 'GetBackupSelectionOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'GetBackupVaultAccessPolicy' => [ 'name' => 'GetBackupVaultAccessPolicy', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup-vaults/{backupVaultName}/access-policy', ], 'input' => [ 'shape' => 'GetBackupVaultAccessPolicyInput', ], 'output' => [ 'shape' => 'GetBackupVaultAccessPolicyOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'GetBackupVaultNotifications' => [ 'name' => 'GetBackupVaultNotifications', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup-vaults/{backupVaultName}/notification-configuration', ], 'input' => [ 'shape' => 'GetBackupVaultNotificationsInput', ], 'output' => [ 'shape' => 'GetBackupVaultNotificationsOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'GetLegalHold' => [ 'name' => 'GetLegalHold', 'http' => [ 'method' => 'GET', 'requestUri' => '/legal-holds/{legalHoldId}/', ], 'input' => [ 'shape' => 'GetLegalHoldInput', ], 'output' => [ 'shape' => 'GetLegalHoldOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'GetRecoveryPointRestoreMetadata' => [ 'name' => 'GetRecoveryPointRestoreMetadata', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup-vaults/{backupVaultName}/recovery-points/{recoveryPointArn}/restore-metadata', ], 'input' => [ 'shape' => 'GetRecoveryPointRestoreMetadataInput', ], 'output' => [ 'shape' => 'GetRecoveryPointRestoreMetadataOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'GetSupportedResourceTypes' => [ 'name' => 'GetSupportedResourceTypes', 'http' => [ 'method' => 'GET', 'requestUri' => '/supported-resource-types', ], 'output' => [ 'shape' => 'GetSupportedResourceTypesOutput', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], ], ], 'ListBackupJobs' => [ 'name' => 'ListBackupJobs', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup-jobs/', ], 'input' => [ 'shape' => 'ListBackupJobsInput', ], 'output' => [ 'shape' => 'ListBackupJobsOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'ListBackupPlanTemplates' => [ 'name' => 'ListBackupPlanTemplates', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup/template/plans', ], 'input' => [ 'shape' => 'ListBackupPlanTemplatesInput', ], 'output' => [ 'shape' => 'ListBackupPlanTemplatesOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListBackupPlanVersions' => [ 'name' => 'ListBackupPlanVersions', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup/plans/{backupPlanId}/versions/', ], 'input' => [ 'shape' => 'ListBackupPlanVersionsInput', ], 'output' => [ 'shape' => 'ListBackupPlanVersionsOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'ListBackupPlans' => [ 'name' => 'ListBackupPlans', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup/plans/', ], 'input' => [ 'shape' => 'ListBackupPlansInput', ], 'output' => [ 'shape' => 'ListBackupPlansOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'ListBackupSelections' => [ 'name' => 'ListBackupSelections', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup/plans/{backupPlanId}/selections/', ], 'input' => [ 'shape' => 'ListBackupSelectionsInput', ], 'output' => [ 'shape' => 'ListBackupSelectionsOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'ListBackupVaults' => [ 'name' => 'ListBackupVaults', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup-vaults/', ], 'input' => [ 'shape' => 'ListBackupVaultsInput', ], 'output' => [ 'shape' => 'ListBackupVaultsOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'ListCopyJobs' => [ 'name' => 'ListCopyJobs', 'http' => [ 'method' => 'GET', 'requestUri' => '/copy-jobs/', ], 'input' => [ 'shape' => 'ListCopyJobsInput', ], 'output' => [ 'shape' => 'ListCopyJobsOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], ], 'ListFrameworks' => [ 'name' => 'ListFrameworks', 'http' => [ 'method' => 'GET', 'requestUri' => '/audit/frameworks', ], 'input' => [ 'shape' => 'ListFrameworksInput', ], 'output' => [ 'shape' => 'ListFrameworksOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], ], 'ListLegalHolds' => [ 'name' => 'ListLegalHolds', 'http' => [ 'method' => 'GET', 'requestUri' => '/legal-holds/', ], 'input' => [ 'shape' => 'ListLegalHoldsInput', ], 'output' => [ 'shape' => 'ListLegalHoldsOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'ListProtectedResources' => [ 'name' => 'ListProtectedResources', 'http' => [ 'method' => 'GET', 'requestUri' => '/resources/', ], 'input' => [ 'shape' => 'ListProtectedResourcesInput', ], 'output' => [ 'shape' => 'ListProtectedResourcesOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'ListRecoveryPointsByBackupVault' => [ 'name' => 'ListRecoveryPointsByBackupVault', 'http' => [ 'method' => 'GET', 'requestUri' => '/backup-vaults/{backupVaultName}/recovery-points/', ], 'input' => [ 'shape' => 'ListRecoveryPointsByBackupVaultInput', ], 'output' => [ 'shape' => 'ListRecoveryPointsByBackupVaultOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'ListRecoveryPointsByLegalHold' => [ 'name' => 'ListRecoveryPointsByLegalHold', 'http' => [ 'method' => 'GET', 'requestUri' => '/legal-holds/{legalHoldId}/recovery-points', ], 'input' => [ 'shape' => 'ListRecoveryPointsByLegalHoldInput', ], 'output' => [ 'shape' => 'ListRecoveryPointsByLegalHoldOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'ListRecoveryPointsByResource' => [ 'name' => 'ListRecoveryPointsByResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/resources/{resourceArn}/recovery-points/', ], 'input' => [ 'shape' => 'ListRecoveryPointsByResourceInput', ], 'output' => [ 'shape' => 'ListRecoveryPointsByResourceOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'ListReportJobs' => [ 'name' => 'ListReportJobs', 'http' => [ 'method' => 'GET', 'requestUri' => '/audit/report-jobs', ], 'input' => [ 'shape' => 'ListReportJobsInput', ], 'output' => [ 'shape' => 'ListReportJobsOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListReportPlans' => [ 'name' => 'ListReportPlans', 'http' => [ 'method' => 'GET', 'requestUri' => '/audit/report-plans', ], 'input' => [ 'shape' => 'ListReportPlansInput', ], 'output' => [ 'shape' => 'ListReportPlansOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], ], 'ListRestoreJobs' => [ 'name' => 'ListRestoreJobs', 'http' => [ 'method' => 'GET', 'requestUri' => '/restore-jobs/', ], 'input' => [ 'shape' => 'ListRestoreJobsInput', ], 'output' => [ 'shape' => 'ListRestoreJobsOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'ListTags' => [ 'name' => 'ListTags', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags/{resourceArn}/', ], 'input' => [ 'shape' => 'ListTagsInput', ], 'output' => [ 'shape' => 'ListTagsOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'PutBackupVaultAccessPolicy' => [ 'name' => 'PutBackupVaultAccessPolicy', 'http' => [ 'method' => 'PUT', 'requestUri' => '/backup-vaults/{backupVaultName}/access-policy', ], 'input' => [ 'shape' => 'PutBackupVaultAccessPolicyInput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'PutBackupVaultLockConfiguration' => [ 'name' => 'PutBackupVaultLockConfiguration', 'http' => [ 'method' => 'PUT', 'requestUri' => '/backup-vaults/{backupVaultName}/vault-lock', ], 'input' => [ 'shape' => 'PutBackupVaultLockConfigurationInput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'PutBackupVaultNotifications' => [ 'name' => 'PutBackupVaultNotifications', 'http' => [ 'method' => 'PUT', 'requestUri' => '/backup-vaults/{backupVaultName}/notification-configuration', ], 'input' => [ 'shape' => 'PutBackupVaultNotificationsInput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'StartBackupJob' => [ 'name' => 'StartBackupJob', 'http' => [ 'method' => 'PUT', 'requestUri' => '/backup-jobs', ], 'input' => [ 'shape' => 'StartBackupJobInput', ], 'output' => [ 'shape' => 'StartBackupJobOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], 'StartCopyJob' => [ 'name' => 'StartCopyJob', 'http' => [ 'method' => 'PUT', 'requestUri' => '/copy-jobs', ], 'input' => [ 'shape' => 'StartCopyJobInput', ], 'output' => [ 'shape' => 'StartCopyJobOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidRequestException', ], ], 'idempotent' => true, ], 'StartReportJob' => [ 'name' => 'StartReportJob', 'http' => [ 'method' => 'POST', 'requestUri' => '/audit/report-jobs/{reportPlanName}', ], 'input' => [ 'shape' => 'StartReportJobInput', ], 'output' => [ 'shape' => 'StartReportJobOutput', ], 'errors' => [ [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'StartRestoreJob' => [ 'name' => 'StartRestoreJob', 'http' => [ 'method' => 'PUT', 'requestUri' => '/restore-jobs', ], 'input' => [ 'shape' => 'StartRestoreJobInput', ], 'output' => [ 'shape' => 'StartRestoreJobOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'InvalidRequestException', ], ], 'idempotent' => true, ], 'StopBackupJob' => [ 'name' => 'StopBackupJob', 'http' => [ 'method' => 'POST', 'requestUri' => '/backup-jobs/{backupJobId}', ], 'input' => [ 'shape' => 'StopBackupJobInput', ], 'errors' => [ [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'ServiceUnavailableException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags/{resourceArn}', ], 'input' => [ 'shape' => 'TagResourceInput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'LimitExceededException', ], ], 'idempotent' => true, ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/untag/{resourceArn}', ], 'input' => [ 'shape' => 'UntagResourceInput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'UpdateBackupPlan' => [ 'name' => 'UpdateBackupPlan', 'http' => [ 'method' => 'POST', 'requestUri' => '/backup/plans/{backupPlanId}', ], 'input' => [ 'shape' => 'UpdateBackupPlanInput', ], 'output' => [ 'shape' => 'UpdateBackupPlanOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'UpdateFramework' => [ 'name' => 'UpdateFramework', 'http' => [ 'method' => 'PUT', 'requestUri' => '/audit/frameworks/{frameworkName}', ], 'input' => [ 'shape' => 'UpdateFrameworkInput', ], 'output' => [ 'shape' => 'UpdateFrameworkOutput', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'UpdateGlobalSettings' => [ 'name' => 'UpdateGlobalSettings', 'http' => [ 'method' => 'PUT', 'requestUri' => '/global-settings', ], 'input' => [ 'shape' => 'UpdateGlobalSettingsInput', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'InvalidRequestException', ], ], ], 'UpdateRecoveryPointLifecycle' => [ 'name' => 'UpdateRecoveryPointLifecycle', 'http' => [ 'method' => 'POST', 'requestUri' => '/backup-vaults/{backupVaultName}/recovery-points/{recoveryPointArn}', ], 'input' => [ 'shape' => 'UpdateRecoveryPointLifecycleInput', ], 'output' => [ 'shape' => 'UpdateRecoveryPointLifecycleOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], ], 'idempotent' => true, ], 'UpdateRegionSettings' => [ 'name' => 'UpdateRegionSettings', 'http' => [ 'method' => 'PUT', 'requestUri' => '/account-settings', ], 'input' => [ 'shape' => 'UpdateRegionSettingsInput', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'InvalidParameterValueException', ], ], ], 'UpdateReportPlan' => [ 'name' => 'UpdateReportPlan', 'http' => [ 'method' => 'PUT', 'requestUri' => '/audit/report-plans/{reportPlanName}', ], 'input' => [ 'shape' => 'UpdateReportPlanInput', ], 'output' => [ 'shape' => 'UpdateReportPlanOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidParameterValueException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'MissingParameterValueException', ], [ 'shape' => 'ConflictException', ], ], 'idempotent' => true, ], ], 'shapes' => [ 'ARN' => [ 'type' => 'string', ], 'AccountId' => [ 'type' => 'string', 'pattern' => '^[0-9]{12}$', ], 'AdvancedBackupSetting' => [ 'type' => 'structure', 'members' => [ 'ResourceType' => [ 'shape' => 'ResourceType', ], 'BackupOptions' => [ 'shape' => 'BackupOptions', ], ], ], 'AdvancedBackupSettings' => [ 'type' => 'list', 'member' => [ 'shape' => 'AdvancedBackupSetting', ], ], 'AlreadyExistsException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'string', ], 'Message' => [ 'shape' => 'string', ], 'CreatorRequestId' => [ 'shape' => 'string', ], 'Arn' => [ 'shape' => 'string', ], 'Type' => [ 'shape' => 'string', ], 'Context' => [ 'shape' => 'string', ], ], 'exception' => true, ], 'BackupJob' => [ 'type' => 'structure', 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BackupJobId' => [ 'shape' => 'string', ], 'BackupVaultName' => [ 'shape' => 'BackupVaultName', ], 'BackupVaultArn' => [ 'shape' => 'ARN', ], 'RecoveryPointArn' => [ 'shape' => 'ARN', ], 'ResourceArn' => [ 'shape' => 'ARN', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'CompletionDate' => [ 'shape' => 'timestamp', ], 'State' => [ 'shape' => 'BackupJobState', ], 'StatusMessage' => [ 'shape' => 'string', ], 'PercentDone' => [ 'shape' => 'string', ], 'BackupSizeInBytes' => [ 'shape' => 'Long', ], 'IamRoleArn' => [ 'shape' => 'IAMRoleArn', ], 'CreatedBy' => [ 'shape' => 'RecoveryPointCreator', ], 'ExpectedCompletionDate' => [ 'shape' => 'timestamp', ], 'StartBy' => [ 'shape' => 'timestamp', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'BytesTransferred' => [ 'shape' => 'Long', ], 'BackupOptions' => [ 'shape' => 'BackupOptions', ], 'BackupType' => [ 'shape' => 'string', ], 'ParentJobId' => [ 'shape' => 'string', ], 'IsParent' => [ 'shape' => 'boolean', ], 'ResourceName' => [ 'shape' => 'string', ], ], ], 'BackupJobChildJobsInState' => [ 'type' => 'map', 'key' => [ 'shape' => 'BackupJobState', ], 'value' => [ 'shape' => 'Long', ], ], 'BackupJobState' => [ 'type' => 'string', 'enum' => [ 'CREATED', 'PENDING', 'RUNNING', 'ABORTING', 'ABORTED', 'COMPLETED', 'FAILED', 'EXPIRED', 'PARTIAL', ], ], 'BackupJobsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BackupJob', ], ], 'BackupOptionKey' => [ 'type' => 'string', 'pattern' => '^[a-zA-Z0-9\\\\-\\\\_\\\\.]{1,50}$', ], 'BackupOptionValue' => [ 'type' => 'string', 'pattern' => '^[a-zA-Z0-9\\\\-\\\\_\\\\.]{1,50}$', ], 'BackupOptions' => [ 'type' => 'map', 'key' => [ 'shape' => 'BackupOptionKey', ], 'value' => [ 'shape' => 'BackupOptionValue', ], ], 'BackupPlan' => [ 'type' => 'structure', 'required' => [ 'BackupPlanName', 'Rules', ], 'members' => [ 'BackupPlanName' => [ 'shape' => 'BackupPlanName', ], 'Rules' => [ 'shape' => 'BackupRules', ], 'AdvancedBackupSettings' => [ 'shape' => 'AdvancedBackupSettings', ], ], ], 'BackupPlanInput' => [ 'type' => 'structure', 'required' => [ 'BackupPlanName', 'Rules', ], 'members' => [ 'BackupPlanName' => [ 'shape' => 'BackupPlanName', ], 'Rules' => [ 'shape' => 'BackupRulesInput', ], 'AdvancedBackupSettings' => [ 'shape' => 'AdvancedBackupSettings', ], ], ], 'BackupPlanName' => [ 'type' => 'string', ], 'BackupPlanTemplatesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BackupPlanTemplatesListMember', ], ], 'BackupPlanTemplatesListMember' => [ 'type' => 'structure', 'members' => [ 'BackupPlanTemplateId' => [ 'shape' => 'string', ], 'BackupPlanTemplateName' => [ 'shape' => 'string', ], ], ], 'BackupPlanVersionsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BackupPlansListMember', ], ], 'BackupPlansList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BackupPlansListMember', ], ], 'BackupPlansListMember' => [ 'type' => 'structure', 'members' => [ 'BackupPlanArn' => [ 'shape' => 'ARN', ], 'BackupPlanId' => [ 'shape' => 'string', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'DeletionDate' => [ 'shape' => 'timestamp', ], 'VersionId' => [ 'shape' => 'string', ], 'BackupPlanName' => [ 'shape' => 'BackupPlanName', ], 'CreatorRequestId' => [ 'shape' => 'string', ], 'LastExecutionDate' => [ 'shape' => 'timestamp', ], 'AdvancedBackupSettings' => [ 'shape' => 'AdvancedBackupSettings', ], ], ], 'BackupRule' => [ 'type' => 'structure', 'required' => [ 'RuleName', 'TargetBackupVaultName', ], 'members' => [ 'RuleName' => [ 'shape' => 'BackupRuleName', ], 'TargetBackupVaultName' => [ 'shape' => 'BackupVaultName', ], 'ScheduleExpression' => [ 'shape' => 'CronExpression', ], 'StartWindowMinutes' => [ 'shape' => 'WindowMinutes', ], 'CompletionWindowMinutes' => [ 'shape' => 'WindowMinutes', ], 'Lifecycle' => [ 'shape' => 'Lifecycle', ], 'RecoveryPointTags' => [ 'shape' => 'Tags', ], 'RuleId' => [ 'shape' => 'string', ], 'CopyActions' => [ 'shape' => 'CopyActions', ], 'EnableContinuousBackup' => [ 'shape' => 'Boolean', ], ], ], 'BackupRuleInput' => [ 'type' => 'structure', 'required' => [ 'RuleName', 'TargetBackupVaultName', ], 'members' => [ 'RuleName' => [ 'shape' => 'BackupRuleName', ], 'TargetBackupVaultName' => [ 'shape' => 'BackupVaultName', ], 'ScheduleExpression' => [ 'shape' => 'CronExpression', ], 'StartWindowMinutes' => [ 'shape' => 'WindowMinutes', ], 'CompletionWindowMinutes' => [ 'shape' => 'WindowMinutes', ], 'Lifecycle' => [ 'shape' => 'Lifecycle', ], 'RecoveryPointTags' => [ 'shape' => 'Tags', ], 'CopyActions' => [ 'shape' => 'CopyActions', ], 'EnableContinuousBackup' => [ 'shape' => 'Boolean', ], ], ], 'BackupRuleName' => [ 'type' => 'string', 'pattern' => '^[a-zA-Z0-9\\\\-\\\\_\\\\.]{1,50}$', ], 'BackupRules' => [ 'type' => 'list', 'member' => [ 'shape' => 'BackupRule', ], ], 'BackupRulesInput' => [ 'type' => 'list', 'member' => [ 'shape' => 'BackupRuleInput', ], ], 'BackupSelection' => [ 'type' => 'structure', 'required' => [ 'SelectionName', 'IamRoleArn', ], 'members' => [ 'SelectionName' => [ 'shape' => 'BackupSelectionName', ], 'IamRoleArn' => [ 'shape' => 'IAMRoleArn', ], 'Resources' => [ 'shape' => 'ResourceArns', ], 'ListOfTags' => [ 'shape' => 'ListOfTags', ], 'NotResources' => [ 'shape' => 'ResourceArns', ], 'Conditions' => [ 'shape' => 'Conditions', ], ], ], 'BackupSelectionName' => [ 'type' => 'string', 'pattern' => '^[a-zA-Z0-9\\\\-\\\\_\\\\.]{1,50}$', ], 'BackupSelectionsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BackupSelectionsListMember', ], ], 'BackupSelectionsListMember' => [ 'type' => 'structure', 'members' => [ 'SelectionId' => [ 'shape' => 'string', ], 'SelectionName' => [ 'shape' => 'BackupSelectionName', ], 'BackupPlanId' => [ 'shape' => 'string', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'CreatorRequestId' => [ 'shape' => 'string', ], 'IamRoleArn' => [ 'shape' => 'IAMRoleArn', ], ], ], 'BackupVaultEvent' => [ 'type' => 'string', 'enum' => [ 'BACKUP_JOB_STARTED', 'BACKUP_JOB_COMPLETED', 'BACKUP_JOB_SUCCESSFUL', 'BACKUP_JOB_FAILED', 'BACKUP_JOB_EXPIRED', 'RESTORE_JOB_STARTED', 'RESTORE_JOB_COMPLETED', 'RESTORE_JOB_SUCCESSFUL', 'RESTORE_JOB_FAILED', 'COPY_JOB_STARTED', 'COPY_JOB_SUCCESSFUL', 'COPY_JOB_FAILED', 'RECOVERY_POINT_MODIFIED', 'BACKUP_PLAN_CREATED', 'BACKUP_PLAN_MODIFIED', 'S3_BACKUP_OBJECT_FAILED', 'S3_RESTORE_OBJECT_FAILED', ], ], 'BackupVaultEvents' => [ 'type' => 'list', 'member' => [ 'shape' => 'BackupVaultEvent', ], ], 'BackupVaultList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BackupVaultListMember', ], ], 'BackupVaultListMember' => [ 'type' => 'structure', 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', ], 'BackupVaultArn' => [ 'shape' => 'ARN', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'EncryptionKeyArn' => [ 'shape' => 'ARN', ], 'CreatorRequestId' => [ 'shape' => 'string', ], 'NumberOfRecoveryPoints' => [ 'shape' => 'long', ], 'Locked' => [ 'shape' => 'Boolean', ], 'MinRetentionDays' => [ 'shape' => 'Long', ], 'MaxRetentionDays' => [ 'shape' => 'Long', ], 'LockDate' => [ 'shape' => 'timestamp', ], ], ], 'BackupVaultName' => [ 'type' => 'string', 'pattern' => '^[a-zA-Z0-9\\\\-\\\\_]{2,50}$', ], 'Boolean' => [ 'type' => 'boolean', ], 'CalculatedLifecycle' => [ 'type' => 'structure', 'members' => [ 'MoveToColdStorageAt' => [ 'shape' => 'timestamp', ], 'DeleteAt' => [ 'shape' => 'timestamp', ], ], ], 'CancelLegalHoldInput' => [ 'type' => 'structure', 'required' => [ 'LegalHoldId', 'CancelDescription', ], 'members' => [ 'LegalHoldId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'legalHoldId', ], 'CancelDescription' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'cancelDescription', ], 'RetainRecordInDays' => [ 'shape' => 'Long', 'location' => 'querystring', 'locationName' => 'retainRecordInDays', ], ], ], 'CancelLegalHoldOutput' => [ 'type' => 'structure', 'members' => [], ], 'ComplianceResourceIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'string', ], 'max' => 100, 'min' => 1, ], 'Condition' => [ 'type' => 'structure', 'required' => [ 'ConditionType', 'ConditionKey', 'ConditionValue', ], 'members' => [ 'ConditionType' => [ 'shape' => 'ConditionType', ], 'ConditionKey' => [ 'shape' => 'ConditionKey', ], 'ConditionValue' => [ 'shape' => 'ConditionValue', ], ], ], 'ConditionKey' => [ 'type' => 'string', ], 'ConditionParameter' => [ 'type' => 'structure', 'members' => [ 'ConditionKey' => [ 'shape' => 'ConditionKey', ], 'ConditionValue' => [ 'shape' => 'ConditionValue', ], ], ], 'ConditionParameters' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConditionParameter', ], ], 'ConditionType' => [ 'type' => 'string', 'enum' => [ 'STRINGEQUALS', ], ], 'ConditionValue' => [ 'type' => 'string', ], 'Conditions' => [ 'type' => 'structure', 'members' => [ 'StringEquals' => [ 'shape' => 'ConditionParameters', ], 'StringNotEquals' => [ 'shape' => 'ConditionParameters', ], 'StringLike' => [ 'shape' => 'ConditionParameters', ], 'StringNotLike' => [ 'shape' => 'ConditionParameters', ], ], ], 'ConflictException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'string', ], 'Message' => [ 'shape' => 'string', ], 'Type' => [ 'shape' => 'string', ], 'Context' => [ 'shape' => 'string', ], ], 'exception' => true, ], 'ControlInputParameter' => [ 'type' => 'structure', 'members' => [ 'ParameterName' => [ 'shape' => 'ParameterName', ], 'ParameterValue' => [ 'shape' => 'ParameterValue', ], ], ], 'ControlInputParameters' => [ 'type' => 'list', 'member' => [ 'shape' => 'ControlInputParameter', ], ], 'ControlName' => [ 'type' => 'string', ], 'ControlScope' => [ 'type' => 'structure', 'members' => [ 'ComplianceResourceIds' => [ 'shape' => 'ComplianceResourceIdList', ], 'ComplianceResourceTypes' => [ 'shape' => 'ResourceTypeList', ], 'Tags' => [ 'shape' => 'stringMap', ], ], ], 'CopyAction' => [ 'type' => 'structure', 'required' => [ 'DestinationBackupVaultArn', ], 'members' => [ 'Lifecycle' => [ 'shape' => 'Lifecycle', ], 'DestinationBackupVaultArn' => [ 'shape' => 'ARN', ], ], ], 'CopyActions' => [ 'type' => 'list', 'member' => [ 'shape' => 'CopyAction', ], ], 'CopyJob' => [ 'type' => 'structure', 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'CopyJobId' => [ 'shape' => 'string', ], 'SourceBackupVaultArn' => [ 'shape' => 'ARN', ], 'SourceRecoveryPointArn' => [ 'shape' => 'ARN', ], 'DestinationBackupVaultArn' => [ 'shape' => 'ARN', ], 'DestinationRecoveryPointArn' => [ 'shape' => 'ARN', ], 'ResourceArn' => [ 'shape' => 'ARN', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'CompletionDate' => [ 'shape' => 'timestamp', ], 'State' => [ 'shape' => 'CopyJobState', ], 'StatusMessage' => [ 'shape' => 'string', ], 'BackupSizeInBytes' => [ 'shape' => 'Long', ], 'IamRoleArn' => [ 'shape' => 'IAMRoleArn', ], 'CreatedBy' => [ 'shape' => 'RecoveryPointCreator', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'ParentJobId' => [ 'shape' => 'string', ], 'IsParent' => [ 'shape' => 'boolean', ], 'CompositeMemberIdentifier' => [ 'shape' => 'string', ], 'NumberOfChildJobs' => [ 'shape' => 'Long', ], 'ChildJobsInState' => [ 'shape' => 'CopyJobChildJobsInState', ], 'ResourceName' => [ 'shape' => 'string', ], ], ], 'CopyJobChildJobsInState' => [ 'type' => 'map', 'key' => [ 'shape' => 'CopyJobState', ], 'value' => [ 'shape' => 'Long', ], ], 'CopyJobState' => [ 'type' => 'string', 'enum' => [ 'CREATED', 'RUNNING', 'COMPLETED', 'FAILED', 'PARTIAL', ], ], 'CopyJobsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CopyJob', ], ], 'CreateBackupPlanInput' => [ 'type' => 'structure', 'required' => [ 'BackupPlan', ], 'members' => [ 'BackupPlan' => [ 'shape' => 'BackupPlanInput', ], 'BackupPlanTags' => [ 'shape' => 'Tags', ], 'CreatorRequestId' => [ 'shape' => 'string', ], ], ], 'CreateBackupPlanOutput' => [ 'type' => 'structure', 'members' => [ 'BackupPlanId' => [ 'shape' => 'string', ], 'BackupPlanArn' => [ 'shape' => 'ARN', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'VersionId' => [ 'shape' => 'string', ], 'AdvancedBackupSettings' => [ 'shape' => 'AdvancedBackupSettings', ], ], ], 'CreateBackupSelectionInput' => [ 'type' => 'structure', 'required' => [ 'BackupPlanId', 'BackupSelection', ], 'members' => [ 'BackupPlanId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'backupPlanId', ], 'BackupSelection' => [ 'shape' => 'BackupSelection', ], 'CreatorRequestId' => [ 'shape' => 'string', ], ], ], 'CreateBackupSelectionOutput' => [ 'type' => 'structure', 'members' => [ 'SelectionId' => [ 'shape' => 'string', ], 'BackupPlanId' => [ 'shape' => 'string', ], 'CreationDate' => [ 'shape' => 'timestamp', ], ], ], 'CreateBackupVaultInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'uri', 'locationName' => 'backupVaultName', ], 'BackupVaultTags' => [ 'shape' => 'Tags', ], 'EncryptionKeyArn' => [ 'shape' => 'ARN', ], 'CreatorRequestId' => [ 'shape' => 'string', ], ], ], 'CreateBackupVaultOutput' => [ 'type' => 'structure', 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', ], 'BackupVaultArn' => [ 'shape' => 'ARN', ], 'CreationDate' => [ 'shape' => 'timestamp', ], ], ], 'CreateFrameworkInput' => [ 'type' => 'structure', 'required' => [ 'FrameworkName', 'FrameworkControls', ], 'members' => [ 'FrameworkName' => [ 'shape' => 'FrameworkName', ], 'FrameworkDescription' => [ 'shape' => 'FrameworkDescription', ], 'FrameworkControls' => [ 'shape' => 'FrameworkControls', ], 'IdempotencyToken' => [ 'shape' => 'string', 'idempotencyToken' => true, ], 'FrameworkTags' => [ 'shape' => 'stringMap', ], ], ], 'CreateFrameworkOutput' => [ 'type' => 'structure', 'members' => [ 'FrameworkName' => [ 'shape' => 'FrameworkName', ], 'FrameworkArn' => [ 'shape' => 'ARN', ], ], ], 'CreateLegalHoldInput' => [ 'type' => 'structure', 'required' => [ 'Title', 'Description', ], 'members' => [ 'Title' => [ 'shape' => 'string', ], 'Description' => [ 'shape' => 'string', ], 'IdempotencyToken' => [ 'shape' => 'string', ], 'RecoveryPointSelection' => [ 'shape' => 'RecoveryPointSelection', ], 'Tags' => [ 'shape' => 'Tags', ], ], ], 'CreateLegalHoldOutput' => [ 'type' => 'structure', 'members' => [ 'Title' => [ 'shape' => 'string', ], 'Status' => [ 'shape' => 'LegalHoldStatus', ], 'Description' => [ 'shape' => 'string', ], 'LegalHoldId' => [ 'shape' => 'string', ], 'LegalHoldArn' => [ 'shape' => 'ARN', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'RecoveryPointSelection' => [ 'shape' => 'RecoveryPointSelection', ], ], ], 'CreateReportPlanInput' => [ 'type' => 'structure', 'required' => [ 'ReportPlanName', 'ReportDeliveryChannel', 'ReportSetting', ], 'members' => [ 'ReportPlanName' => [ 'shape' => 'ReportPlanName', ], 'ReportPlanDescription' => [ 'shape' => 'ReportPlanDescription', ], 'ReportDeliveryChannel' => [ 'shape' => 'ReportDeliveryChannel', ], 'ReportSetting' => [ 'shape' => 'ReportSetting', ], 'ReportPlanTags' => [ 'shape' => 'stringMap', ], 'IdempotencyToken' => [ 'shape' => 'string', 'idempotencyToken' => true, ], ], ], 'CreateReportPlanOutput' => [ 'type' => 'structure', 'members' => [ 'ReportPlanName' => [ 'shape' => 'ReportPlanName', ], 'ReportPlanArn' => [ 'shape' => 'ARN', ], 'CreationTime' => [ 'shape' => 'timestamp', ], ], ], 'CronExpression' => [ 'type' => 'string', ], 'DateRange' => [ 'type' => 'structure', 'required' => [ 'FromDate', 'ToDate', ], 'members' => [ 'FromDate' => [ 'shape' => 'timestamp', ], 'ToDate' => [ 'shape' => 'timestamp', ], ], ], 'DeleteBackupPlanInput' => [ 'type' => 'structure', 'required' => [ 'BackupPlanId', ], 'members' => [ 'BackupPlanId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'backupPlanId', ], ], ], 'DeleteBackupPlanOutput' => [ 'type' => 'structure', 'members' => [ 'BackupPlanId' => [ 'shape' => 'string', ], 'BackupPlanArn' => [ 'shape' => 'ARN', ], 'DeletionDate' => [ 'shape' => 'timestamp', ], 'VersionId' => [ 'shape' => 'string', ], ], ], 'DeleteBackupSelectionInput' => [ 'type' => 'structure', 'required' => [ 'BackupPlanId', 'SelectionId', ], 'members' => [ 'BackupPlanId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'backupPlanId', ], 'SelectionId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'selectionId', ], ], ], 'DeleteBackupVaultAccessPolicyInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'uri', 'locationName' => 'backupVaultName', ], ], ], 'DeleteBackupVaultInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'backupVaultName', ], ], ], 'DeleteBackupVaultLockConfigurationInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'uri', 'locationName' => 'backupVaultName', ], ], ], 'DeleteBackupVaultNotificationsInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'uri', 'locationName' => 'backupVaultName', ], ], ], 'DeleteFrameworkInput' => [ 'type' => 'structure', 'required' => [ 'FrameworkName', ], 'members' => [ 'FrameworkName' => [ 'shape' => 'FrameworkName', 'location' => 'uri', 'locationName' => 'frameworkName', ], ], ], 'DeleteRecoveryPointInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', 'RecoveryPointArn', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'uri', 'locationName' => 'backupVaultName', ], 'RecoveryPointArn' => [ 'shape' => 'ARN', 'location' => 'uri', 'locationName' => 'recoveryPointArn', ], ], ], 'DeleteReportPlanInput' => [ 'type' => 'structure', 'required' => [ 'ReportPlanName', ], 'members' => [ 'ReportPlanName' => [ 'shape' => 'ReportPlanName', 'location' => 'uri', 'locationName' => 'reportPlanName', ], ], ], 'DependencyFailureException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'string', ], 'Message' => [ 'shape' => 'string', ], 'Type' => [ 'shape' => 'string', ], 'Context' => [ 'shape' => 'string', ], ], 'exception' => true, 'fault' => true, ], 'DescribeBackupJobInput' => [ 'type' => 'structure', 'required' => [ 'BackupJobId', ], 'members' => [ 'BackupJobId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'backupJobId', ], ], ], 'DescribeBackupJobOutput' => [ 'type' => 'structure', 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BackupJobId' => [ 'shape' => 'string', ], 'BackupVaultName' => [ 'shape' => 'BackupVaultName', ], 'BackupVaultArn' => [ 'shape' => 'ARN', ], 'RecoveryPointArn' => [ 'shape' => 'ARN', ], 'ResourceArn' => [ 'shape' => 'ARN', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'CompletionDate' => [ 'shape' => 'timestamp', ], 'State' => [ 'shape' => 'BackupJobState', ], 'StatusMessage' => [ 'shape' => 'string', ], 'PercentDone' => [ 'shape' => 'string', ], 'BackupSizeInBytes' => [ 'shape' => 'Long', ], 'IamRoleArn' => [ 'shape' => 'IAMRoleArn', ], 'CreatedBy' => [ 'shape' => 'RecoveryPointCreator', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'BytesTransferred' => [ 'shape' => 'Long', ], 'ExpectedCompletionDate' => [ 'shape' => 'timestamp', ], 'StartBy' => [ 'shape' => 'timestamp', ], 'BackupOptions' => [ 'shape' => 'BackupOptions', ], 'BackupType' => [ 'shape' => 'string', ], 'ParentJobId' => [ 'shape' => 'string', ], 'IsParent' => [ 'shape' => 'boolean', ], 'NumberOfChildJobs' => [ 'shape' => 'Long', ], 'ChildJobsInState' => [ 'shape' => 'BackupJobChildJobsInState', ], 'ResourceName' => [ 'shape' => 'string', ], ], ], 'DescribeBackupVaultInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'backupVaultName', ], ], ], 'DescribeBackupVaultOutput' => [ 'type' => 'structure', 'members' => [ 'BackupVaultName' => [ 'shape' => 'string', ], 'BackupVaultArn' => [ 'shape' => 'ARN', ], 'EncryptionKeyArn' => [ 'shape' => 'ARN', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'CreatorRequestId' => [ 'shape' => 'string', ], 'NumberOfRecoveryPoints' => [ 'shape' => 'long', ], 'Locked' => [ 'shape' => 'Boolean', ], 'MinRetentionDays' => [ 'shape' => 'Long', ], 'MaxRetentionDays' => [ 'shape' => 'Long', ], 'LockDate' => [ 'shape' => 'timestamp', ], ], ], 'DescribeCopyJobInput' => [ 'type' => 'structure', 'required' => [ 'CopyJobId', ], 'members' => [ 'CopyJobId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'copyJobId', ], ], ], 'DescribeCopyJobOutput' => [ 'type' => 'structure', 'members' => [ 'CopyJob' => [ 'shape' => 'CopyJob', ], ], ], 'DescribeFrameworkInput' => [ 'type' => 'structure', 'required' => [ 'FrameworkName', ], 'members' => [ 'FrameworkName' => [ 'shape' => 'FrameworkName', 'location' => 'uri', 'locationName' => 'frameworkName', ], ], ], 'DescribeFrameworkOutput' => [ 'type' => 'structure', 'members' => [ 'FrameworkName' => [ 'shape' => 'FrameworkName', ], 'FrameworkArn' => [ 'shape' => 'ARN', ], 'FrameworkDescription' => [ 'shape' => 'FrameworkDescription', ], 'FrameworkControls' => [ 'shape' => 'FrameworkControls', ], 'CreationTime' => [ 'shape' => 'timestamp', ], 'DeploymentStatus' => [ 'shape' => 'string', ], 'FrameworkStatus' => [ 'shape' => 'string', ], 'IdempotencyToken' => [ 'shape' => 'string', ], ], ], 'DescribeGlobalSettingsInput' => [ 'type' => 'structure', 'members' => [], ], 'DescribeGlobalSettingsOutput' => [ 'type' => 'structure', 'members' => [ 'GlobalSettings' => [ 'shape' => 'GlobalSettings', ], 'LastUpdateTime' => [ 'shape' => 'timestamp', ], ], ], 'DescribeProtectedResourceInput' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'ARN', 'location' => 'uri', 'locationName' => 'resourceArn', ], ], ], 'DescribeProtectedResourceOutput' => [ 'type' => 'structure', 'members' => [ 'ResourceArn' => [ 'shape' => 'ARN', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'LastBackupTime' => [ 'shape' => 'timestamp', ], 'ResourceName' => [ 'shape' => 'string', ], ], ], 'DescribeRecoveryPointInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', 'RecoveryPointArn', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'uri', 'locationName' => 'backupVaultName', ], 'RecoveryPointArn' => [ 'shape' => 'ARN', 'location' => 'uri', 'locationName' => 'recoveryPointArn', ], ], ], 'DescribeRecoveryPointOutput' => [ 'type' => 'structure', 'members' => [ 'RecoveryPointArn' => [ 'shape' => 'ARN', ], 'BackupVaultName' => [ 'shape' => 'BackupVaultName', ], 'BackupVaultArn' => [ 'shape' => 'ARN', ], 'SourceBackupVaultArn' => [ 'shape' => 'ARN', ], 'ResourceArn' => [ 'shape' => 'ARN', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'CreatedBy' => [ 'shape' => 'RecoveryPointCreator', ], 'IamRoleArn' => [ 'shape' => 'IAMRoleArn', ], 'Status' => [ 'shape' => 'RecoveryPointStatus', ], 'StatusMessage' => [ 'shape' => 'string', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'CompletionDate' => [ 'shape' => 'timestamp', ], 'BackupSizeInBytes' => [ 'shape' => 'Long', ], 'CalculatedLifecycle' => [ 'shape' => 'CalculatedLifecycle', ], 'Lifecycle' => [ 'shape' => 'Lifecycle', ], 'EncryptionKeyArn' => [ 'shape' => 'ARN', ], 'IsEncrypted' => [ 'shape' => 'boolean', ], 'StorageClass' => [ 'shape' => 'StorageClass', ], 'LastRestoreTime' => [ 'shape' => 'timestamp', ], 'ParentRecoveryPointArn' => [ 'shape' => 'ARN', ], 'CompositeMemberIdentifier' => [ 'shape' => 'string', ], 'IsParent' => [ 'shape' => 'boolean', ], 'ResourceName' => [ 'shape' => 'string', ], ], ], 'DescribeRegionSettingsInput' => [ 'type' => 'structure', 'members' => [], ], 'DescribeRegionSettingsOutput' => [ 'type' => 'structure', 'members' => [ 'ResourceTypeOptInPreference' => [ 'shape' => 'ResourceTypeOptInPreference', ], 'ResourceTypeManagementPreference' => [ 'shape' => 'ResourceTypeManagementPreference', ], ], ], 'DescribeReportJobInput' => [ 'type' => 'structure', 'required' => [ 'ReportJobId', ], 'members' => [ 'ReportJobId' => [ 'shape' => 'ReportJobId', 'location' => 'uri', 'locationName' => 'reportJobId', ], ], ], 'DescribeReportJobOutput' => [ 'type' => 'structure', 'members' => [ 'ReportJob' => [ 'shape' => 'ReportJob', ], ], ], 'DescribeReportPlanInput' => [ 'type' => 'structure', 'required' => [ 'ReportPlanName', ], 'members' => [ 'ReportPlanName' => [ 'shape' => 'ReportPlanName', 'location' => 'uri', 'locationName' => 'reportPlanName', ], ], ], 'DescribeReportPlanOutput' => [ 'type' => 'structure', 'members' => [ 'ReportPlan' => [ 'shape' => 'ReportPlan', ], ], ], 'DescribeRestoreJobInput' => [ 'type' => 'structure', 'required' => [ 'RestoreJobId', ], 'members' => [ 'RestoreJobId' => [ 'shape' => 'RestoreJobId', 'location' => 'uri', 'locationName' => 'restoreJobId', ], ], ], 'DescribeRestoreJobOutput' => [ 'type' => 'structure', 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'RestoreJobId' => [ 'shape' => 'string', ], 'RecoveryPointArn' => [ 'shape' => 'ARN', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'CompletionDate' => [ 'shape' => 'timestamp', ], 'Status' => [ 'shape' => 'RestoreJobStatus', ], 'StatusMessage' => [ 'shape' => 'string', ], 'PercentDone' => [ 'shape' => 'string', ], 'BackupSizeInBytes' => [ 'shape' => 'Long', ], 'IamRoleArn' => [ 'shape' => 'IAMRoleArn', ], 'ExpectedCompletionTimeMinutes' => [ 'shape' => 'Long', ], 'CreatedResourceArn' => [ 'shape' => 'ARN', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], ], ], 'DisassociateRecoveryPointFromParentInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', 'RecoveryPointArn', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'uri', 'locationName' => 'backupVaultName', ], 'RecoveryPointArn' => [ 'shape' => 'ARN', 'location' => 'uri', 'locationName' => 'recoveryPointArn', ], ], ], 'DisassociateRecoveryPointInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', 'RecoveryPointArn', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'uri', 'locationName' => 'backupVaultName', ], 'RecoveryPointArn' => [ 'shape' => 'ARN', 'location' => 'uri', 'locationName' => 'recoveryPointArn', ], ], ], 'ExportBackupPlanTemplateInput' => [ 'type' => 'structure', 'required' => [ 'BackupPlanId', ], 'members' => [ 'BackupPlanId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'backupPlanId', ], ], ], 'ExportBackupPlanTemplateOutput' => [ 'type' => 'structure', 'members' => [ 'BackupPlanTemplateJson' => [ 'shape' => 'string', ], ], ], 'FormatList' => [ 'type' => 'list', 'member' => [ 'shape' => 'string', ], ], 'Framework' => [ 'type' => 'structure', 'members' => [ 'FrameworkName' => [ 'shape' => 'FrameworkName', ], 'FrameworkArn' => [ 'shape' => 'ARN', ], 'FrameworkDescription' => [ 'shape' => 'FrameworkDescription', ], 'NumberOfControls' => [ 'shape' => 'integer', ], 'CreationTime' => [ 'shape' => 'timestamp', ], 'DeploymentStatus' => [ 'shape' => 'string', ], ], ], 'FrameworkControl' => [ 'type' => 'structure', 'required' => [ 'ControlName', ], 'members' => [ 'ControlName' => [ 'shape' => 'ControlName', ], 'ControlInputParameters' => [ 'shape' => 'ControlInputParameters', ], 'ControlScope' => [ 'shape' => 'ControlScope', ], ], ], 'FrameworkControls' => [ 'type' => 'list', 'member' => [ 'shape' => 'FrameworkControl', ], ], 'FrameworkDescription' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'pattern' => '.*\\\\S.*', ], 'FrameworkList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Framework', ], ], 'FrameworkName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '[a-zA-Z][_a-zA-Z0-9]*', ], 'GetBackupPlanFromJSONInput' => [ 'type' => 'structure', 'required' => [ 'BackupPlanTemplateJson', ], 'members' => [ 'BackupPlanTemplateJson' => [ 'shape' => 'string', ], ], ], 'GetBackupPlanFromJSONOutput' => [ 'type' => 'structure', 'members' => [ 'BackupPlan' => [ 'shape' => 'BackupPlan', ], ], ], 'GetBackupPlanFromTemplateInput' => [ 'type' => 'structure', 'required' => [ 'BackupPlanTemplateId', ], 'members' => [ 'BackupPlanTemplateId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'templateId', ], ], ], 'GetBackupPlanFromTemplateOutput' => [ 'type' => 'structure', 'members' => [ 'BackupPlanDocument' => [ 'shape' => 'BackupPlan', ], ], ], 'GetBackupPlanInput' => [ 'type' => 'structure', 'required' => [ 'BackupPlanId', ], 'members' => [ 'BackupPlanId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'backupPlanId', ], 'VersionId' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'versionId', ], ], ], 'GetBackupPlanOutput' => [ 'type' => 'structure', 'members' => [ 'BackupPlan' => [ 'shape' => 'BackupPlan', ], 'BackupPlanId' => [ 'shape' => 'string', ], 'BackupPlanArn' => [ 'shape' => 'ARN', ], 'VersionId' => [ 'shape' => 'string', ], 'CreatorRequestId' => [ 'shape' => 'string', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'DeletionDate' => [ 'shape' => 'timestamp', ], 'LastExecutionDate' => [ 'shape' => 'timestamp', ], 'AdvancedBackupSettings' => [ 'shape' => 'AdvancedBackupSettings', ], ], ], 'GetBackupSelectionInput' => [ 'type' => 'structure', 'required' => [ 'BackupPlanId', 'SelectionId', ], 'members' => [ 'BackupPlanId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'backupPlanId', ], 'SelectionId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'selectionId', ], ], ], 'GetBackupSelectionOutput' => [ 'type' => 'structure', 'members' => [ 'BackupSelection' => [ 'shape' => 'BackupSelection', ], 'SelectionId' => [ 'shape' => 'string', ], 'BackupPlanId' => [ 'shape' => 'string', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'CreatorRequestId' => [ 'shape' => 'string', ], ], ], 'GetBackupVaultAccessPolicyInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'uri', 'locationName' => 'backupVaultName', ], ], ], 'GetBackupVaultAccessPolicyOutput' => [ 'type' => 'structure', 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', ], 'BackupVaultArn' => [ 'shape' => 'ARN', ], 'Policy' => [ 'shape' => 'IAMPolicy', ], ], ], 'GetBackupVaultNotificationsInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'uri', 'locationName' => 'backupVaultName', ], ], ], 'GetBackupVaultNotificationsOutput' => [ 'type' => 'structure', 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', ], 'BackupVaultArn' => [ 'shape' => 'ARN', ], 'SNSTopicArn' => [ 'shape' => 'ARN', ], 'BackupVaultEvents' => [ 'shape' => 'BackupVaultEvents', ], ], ], 'GetLegalHoldInput' => [ 'type' => 'structure', 'required' => [ 'LegalHoldId', ], 'members' => [ 'LegalHoldId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'legalHoldId', ], ], ], 'GetLegalHoldOutput' => [ 'type' => 'structure', 'members' => [ 'Title' => [ 'shape' => 'string', ], 'Status' => [ 'shape' => 'LegalHoldStatus', ], 'Description' => [ 'shape' => 'string', ], 'CancelDescription' => [ 'shape' => 'string', ], 'LegalHoldId' => [ 'shape' => 'string', ], 'LegalHoldArn' => [ 'shape' => 'ARN', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'CancellationDate' => [ 'shape' => 'timestamp', ], 'RetainRecordUntil' => [ 'shape' => 'timestamp', ], 'RecoveryPointSelection' => [ 'shape' => 'RecoveryPointSelection', ], ], ], 'GetRecoveryPointRestoreMetadataInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', 'RecoveryPointArn', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'uri', 'locationName' => 'backupVaultName', ], 'RecoveryPointArn' => [ 'shape' => 'ARN', 'location' => 'uri', 'locationName' => 'recoveryPointArn', ], ], ], 'GetRecoveryPointRestoreMetadataOutput' => [ 'type' => 'structure', 'members' => [ 'BackupVaultArn' => [ 'shape' => 'ARN', ], 'RecoveryPointArn' => [ 'shape' => 'ARN', ], 'RestoreMetadata' => [ 'shape' => 'Metadata', ], ], ], 'GetSupportedResourceTypesOutput' => [ 'type' => 'structure', 'members' => [ 'ResourceTypes' => [ 'shape' => 'ResourceTypes', ], ], ], 'GlobalSettings' => [ 'type' => 'map', 'key' => [ 'shape' => 'GlobalSettingsName', ], 'value' => [ 'shape' => 'GlobalSettingsValue', ], ], 'GlobalSettingsName' => [ 'type' => 'string', ], 'GlobalSettingsValue' => [ 'type' => 'string', ], 'IAMPolicy' => [ 'type' => 'string', ], 'IAMRoleArn' => [ 'type' => 'string', ], 'InvalidParameterValueException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'string', ], 'Message' => [ 'shape' => 'string', ], 'Type' => [ 'shape' => 'string', ], 'Context' => [ 'shape' => 'string', ], ], 'exception' => true, ], 'InvalidRequestException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'string', ], 'Message' => [ 'shape' => 'string', ], 'Type' => [ 'shape' => 'string', ], 'Context' => [ 'shape' => 'string', ], ], 'exception' => true, ], 'InvalidResourceStateException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'string', ], 'Message' => [ 'shape' => 'string', ], 'Type' => [ 'shape' => 'string', ], 'Context' => [ 'shape' => 'string', ], ], 'exception' => true, ], 'IsEnabled' => [ 'type' => 'boolean', ], 'LegalHold' => [ 'type' => 'structure', 'members' => [ 'Title' => [ 'shape' => 'string', ], 'Status' => [ 'shape' => 'LegalHoldStatus', ], 'Description' => [ 'shape' => 'string', ], 'LegalHoldId' => [ 'shape' => 'string', ], 'LegalHoldArn' => [ 'shape' => 'ARN', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'CancellationDate' => [ 'shape' => 'timestamp', ], ], ], 'LegalHoldStatus' => [ 'type' => 'string', 'enum' => [ 'CREATING', 'ACTIVE', 'CANCELING', 'CANCELED', ], ], 'LegalHoldsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'LegalHold', ], ], 'Lifecycle' => [ 'type' => 'structure', 'members' => [ 'MoveToColdStorageAfterDays' => [ 'shape' => 'Long', ], 'DeleteAfterDays' => [ 'shape' => 'Long', ], ], ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'string', ], 'Message' => [ 'shape' => 'string', ], 'Type' => [ 'shape' => 'string', ], 'Context' => [ 'shape' => 'string', ], ], 'exception' => true, ], 'ListBackupJobsInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'ByResourceArn' => [ 'shape' => 'ARN', 'location' => 'querystring', 'locationName' => 'resourceArn', ], 'ByState' => [ 'shape' => 'BackupJobState', 'location' => 'querystring', 'locationName' => 'state', ], 'ByBackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'querystring', 'locationName' => 'backupVaultName', ], 'ByCreatedBefore' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'createdBefore', ], 'ByCreatedAfter' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'createdAfter', ], 'ByResourceType' => [ 'shape' => 'ResourceType', 'location' => 'querystring', 'locationName' => 'resourceType', ], 'ByAccountId' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'accountId', ], 'ByCompleteAfter' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'completeAfter', ], 'ByCompleteBefore' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'completeBefore', ], 'ByParentJobId' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'parentJobId', ], ], ], 'ListBackupJobsOutput' => [ 'type' => 'structure', 'members' => [ 'BackupJobs' => [ 'shape' => 'BackupJobsList', ], 'NextToken' => [ 'shape' => 'string', ], ], ], 'ListBackupPlanTemplatesInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListBackupPlanTemplatesOutput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'string', ], 'BackupPlanTemplatesList' => [ 'shape' => 'BackupPlanTemplatesList', ], ], ], 'ListBackupPlanVersionsInput' => [ 'type' => 'structure', 'required' => [ 'BackupPlanId', ], 'members' => [ 'BackupPlanId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'backupPlanId', ], 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListBackupPlanVersionsOutput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'string', ], 'BackupPlanVersionsList' => [ 'shape' => 'BackupPlanVersionsList', ], ], ], 'ListBackupPlansInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'IncludeDeleted' => [ 'shape' => 'Boolean', 'location' => 'querystring', 'locationName' => 'includeDeleted', ], ], ], 'ListBackupPlansOutput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'string', ], 'BackupPlansList' => [ 'shape' => 'BackupPlansList', ], ], ], 'ListBackupSelectionsInput' => [ 'type' => 'structure', 'required' => [ 'BackupPlanId', ], 'members' => [ 'BackupPlanId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'backupPlanId', ], 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListBackupSelectionsOutput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'string', ], 'BackupSelectionsList' => [ 'shape' => 'BackupSelectionsList', ], ], ], 'ListBackupVaultsInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListBackupVaultsOutput' => [ 'type' => 'structure', 'members' => [ 'BackupVaultList' => [ 'shape' => 'BackupVaultList', ], 'NextToken' => [ 'shape' => 'string', ], ], ], 'ListCopyJobsInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'ByResourceArn' => [ 'shape' => 'ARN', 'location' => 'querystring', 'locationName' => 'resourceArn', ], 'ByState' => [ 'shape' => 'CopyJobState', 'location' => 'querystring', 'locationName' => 'state', ], 'ByCreatedBefore' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'createdBefore', ], 'ByCreatedAfter' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'createdAfter', ], 'ByResourceType' => [ 'shape' => 'ResourceType', 'location' => 'querystring', 'locationName' => 'resourceType', ], 'ByDestinationVaultArn' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'destinationVaultArn', ], 'ByAccountId' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'accountId', ], 'ByCompleteBefore' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'completeBefore', ], 'ByCompleteAfter' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'completeAfter', ], 'ByParentJobId' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'parentJobId', ], ], ], 'ListCopyJobsOutput' => [ 'type' => 'structure', 'members' => [ 'CopyJobs' => [ 'shape' => 'CopyJobsList', ], 'NextToken' => [ 'shape' => 'string', ], ], ], 'ListFrameworksInput' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => 'MaxFrameworkInputs', 'location' => 'querystring', 'locationName' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'NextToken', ], ], ], 'ListFrameworksOutput' => [ 'type' => 'structure', 'members' => [ 'Frameworks' => [ 'shape' => 'FrameworkList', ], 'NextToken' => [ 'shape' => 'string', ], ], ], 'ListLegalHoldsInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListLegalHoldsOutput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'string', ], 'LegalHolds' => [ 'shape' => 'LegalHoldsList', ], ], ], 'ListOfTags' => [ 'type' => 'list', 'member' => [ 'shape' => 'Condition', ], ], 'ListProtectedResourcesInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListProtectedResourcesOutput' => [ 'type' => 'structure', 'members' => [ 'Results' => [ 'shape' => 'ProtectedResourcesList', ], 'NextToken' => [ 'shape' => 'string', ], ], ], 'ListRecoveryPointsByBackupVaultInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'uri', 'locationName' => 'backupVaultName', ], 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'ByResourceArn' => [ 'shape' => 'ARN', 'location' => 'querystring', 'locationName' => 'resourceArn', ], 'ByResourceType' => [ 'shape' => 'ResourceType', 'location' => 'querystring', 'locationName' => 'resourceType', ], 'ByBackupPlanId' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'backupPlanId', ], 'ByCreatedBefore' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'createdBefore', ], 'ByCreatedAfter' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'createdAfter', ], 'ByParentRecoveryPointArn' => [ 'shape' => 'ARN', 'location' => 'querystring', 'locationName' => 'parentRecoveryPointArn', ], ], ], 'ListRecoveryPointsByBackupVaultOutput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'string', ], 'RecoveryPoints' => [ 'shape' => 'RecoveryPointByBackupVaultList', ], ], ], 'ListRecoveryPointsByLegalHoldInput' => [ 'type' => 'structure', 'required' => [ 'LegalHoldId', ], 'members' => [ 'LegalHoldId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'legalHoldId', ], 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListRecoveryPointsByLegalHoldOutput' => [ 'type' => 'structure', 'members' => [ 'RecoveryPoints' => [ 'shape' => 'RecoveryPointsList', ], 'NextToken' => [ 'shape' => 'string', ], ], ], 'ListRecoveryPointsByResourceInput' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'ARN', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListRecoveryPointsByResourceOutput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'string', ], 'RecoveryPoints' => [ 'shape' => 'RecoveryPointByResourceList', ], ], ], 'ListReportJobsInput' => [ 'type' => 'structure', 'members' => [ 'ByReportPlanName' => [ 'shape' => 'ReportPlanName', 'location' => 'querystring', 'locationName' => 'ReportPlanName', ], 'ByCreationBefore' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'CreationBefore', ], 'ByCreationAfter' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'CreationAfter', ], 'ByStatus' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'Status', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'NextToken', ], ], ], 'ListReportJobsOutput' => [ 'type' => 'structure', 'members' => [ 'ReportJobs' => [ 'shape' => 'ReportJobList', ], 'NextToken' => [ 'shape' => 'string', ], ], ], 'ListReportPlansInput' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'NextToken', ], ], ], 'ListReportPlansOutput' => [ 'type' => 'structure', 'members' => [ 'ReportPlans' => [ 'shape' => 'ReportPlanList', ], 'NextToken' => [ 'shape' => 'string', ], ], ], 'ListRestoreJobsInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'ByAccountId' => [ 'shape' => 'AccountId', 'location' => 'querystring', 'locationName' => 'accountId', ], 'ByCreatedBefore' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'createdBefore', ], 'ByCreatedAfter' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'createdAfter', ], 'ByStatus' => [ 'shape' => 'RestoreJobStatus', 'location' => 'querystring', 'locationName' => 'status', ], 'ByCompleteBefore' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'completeBefore', ], 'ByCompleteAfter' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'completeAfter', ], ], ], 'ListRestoreJobsOutput' => [ 'type' => 'structure', 'members' => [ 'RestoreJobs' => [ 'shape' => 'RestoreJobsList', ], 'NextToken' => [ 'shape' => 'string', ], ], ], 'ListTagsInput' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'ARN', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListTagsOutput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'string', ], 'Tags' => [ 'shape' => 'Tags', ], ], ], 'Long' => [ 'type' => 'long', ], 'MaxFrameworkInputs' => [ 'type' => 'integer', 'max' => 1000, 'min' => 1, ], 'MaxResults' => [ 'type' => 'integer', 'max' => 1000, 'min' => 1, ], 'Metadata' => [ 'type' => 'map', 'key' => [ 'shape' => 'MetadataKey', ], 'value' => [ 'shape' => 'MetadataValue', ], 'sensitive' => true, ], 'MetadataKey' => [ 'type' => 'string', ], 'MetadataValue' => [ 'type' => 'string', ], 'MissingParameterValueException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'string', ], 'Message' => [ 'shape' => 'string', ], 'Type' => [ 'shape' => 'string', ], 'Context' => [ 'shape' => 'string', ], ], 'exception' => true, ], 'ParameterName' => [ 'type' => 'string', ], 'ParameterValue' => [ 'type' => 'string', ], 'ProtectedResource' => [ 'type' => 'structure', 'members' => [ 'ResourceArn' => [ 'shape' => 'ARN', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'LastBackupTime' => [ 'shape' => 'timestamp', ], 'ResourceName' => [ 'shape' => 'string', ], ], ], 'ProtectedResourcesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ProtectedResource', ], ], 'PutBackupVaultAccessPolicyInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'uri', 'locationName' => 'backupVaultName', ], 'Policy' => [ 'shape' => 'IAMPolicy', ], ], ], 'PutBackupVaultLockConfigurationInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'uri', 'locationName' => 'backupVaultName', ], 'MinRetentionDays' => [ 'shape' => 'Long', ], 'MaxRetentionDays' => [ 'shape' => 'Long', ], 'ChangeableForDays' => [ 'shape' => 'Long', ], ], ], 'PutBackupVaultNotificationsInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', 'SNSTopicArn', 'BackupVaultEvents', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'uri', 'locationName' => 'backupVaultName', ], 'SNSTopicArn' => [ 'shape' => 'ARN', ], 'BackupVaultEvents' => [ 'shape' => 'BackupVaultEvents', ], ], ], 'RecoveryPointByBackupVault' => [ 'type' => 'structure', 'members' => [ 'RecoveryPointArn' => [ 'shape' => 'ARN', ], 'BackupVaultName' => [ 'shape' => 'BackupVaultName', ], 'BackupVaultArn' => [ 'shape' => 'ARN', ], 'SourceBackupVaultArn' => [ 'shape' => 'ARN', ], 'ResourceArn' => [ 'shape' => 'ARN', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'CreatedBy' => [ 'shape' => 'RecoveryPointCreator', ], 'IamRoleArn' => [ 'shape' => 'IAMRoleArn', ], 'Status' => [ 'shape' => 'RecoveryPointStatus', ], 'StatusMessage' => [ 'shape' => 'string', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'CompletionDate' => [ 'shape' => 'timestamp', ], 'BackupSizeInBytes' => [ 'shape' => 'Long', ], 'CalculatedLifecycle' => [ 'shape' => 'CalculatedLifecycle', ], 'Lifecycle' => [ 'shape' => 'Lifecycle', ], 'EncryptionKeyArn' => [ 'shape' => 'ARN', ], 'IsEncrypted' => [ 'shape' => 'boolean', ], 'LastRestoreTime' => [ 'shape' => 'timestamp', ], 'ParentRecoveryPointArn' => [ 'shape' => 'ARN', ], 'CompositeMemberIdentifier' => [ 'shape' => 'string', ], 'IsParent' => [ 'shape' => 'boolean', ], 'ResourceName' => [ 'shape' => 'string', ], ], ], 'RecoveryPointByBackupVaultList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RecoveryPointByBackupVault', ], ], 'RecoveryPointByResource' => [ 'type' => 'structure', 'members' => [ 'RecoveryPointArn' => [ 'shape' => 'ARN', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'Status' => [ 'shape' => 'RecoveryPointStatus', ], 'StatusMessage' => [ 'shape' => 'string', ], 'EncryptionKeyArn' => [ 'shape' => 'ARN', ], 'BackupSizeBytes' => [ 'shape' => 'Long', ], 'BackupVaultName' => [ 'shape' => 'BackupVaultName', ], 'IsParent' => [ 'shape' => 'boolean', ], 'ParentRecoveryPointArn' => [ 'shape' => 'ARN', ], 'ResourceName' => [ 'shape' => 'string', ], ], ], 'RecoveryPointByResourceList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RecoveryPointByResource', ], ], 'RecoveryPointCreator' => [ 'type' => 'structure', 'members' => [ 'BackupPlanId' => [ 'shape' => 'string', ], 'BackupPlanArn' => [ 'shape' => 'ARN', ], 'BackupPlanVersion' => [ 'shape' => 'string', ], 'BackupRuleId' => [ 'shape' => 'string', ], ], ], 'RecoveryPointMember' => [ 'type' => 'structure', 'members' => [ 'RecoveryPointArn' => [ 'shape' => 'ARN', ], 'ResourceArn' => [ 'shape' => 'ARN', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'BackupVaultName' => [ 'shape' => 'BackupVaultName', ], ], ], 'RecoveryPointSelection' => [ 'type' => 'structure', 'members' => [ 'VaultNames' => [ 'shape' => 'VaultNames', ], 'ResourceIdentifiers' => [ 'shape' => 'ResourceIdentifiers', ], 'DateRange' => [ 'shape' => 'DateRange', ], ], ], 'RecoveryPointStatus' => [ 'type' => 'string', 'enum' => [ 'COMPLETED', 'PARTIAL', 'DELETING', 'EXPIRED', ], ], 'RecoveryPointsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RecoveryPointMember', ], ], 'ReportDeliveryChannel' => [ 'type' => 'structure', 'required' => [ 'S3BucketName', ], 'members' => [ 'S3BucketName' => [ 'shape' => 'string', ], 'S3KeyPrefix' => [ 'shape' => 'string', ], 'Formats' => [ 'shape' => 'FormatList', ], ], ], 'ReportDestination' => [ 'type' => 'structure', 'members' => [ 'S3BucketName' => [ 'shape' => 'string', ], 'S3Keys' => [ 'shape' => 'stringList', ], ], ], 'ReportJob' => [ 'type' => 'structure', 'members' => [ 'ReportJobId' => [ 'shape' => 'ReportJobId', ], 'ReportPlanArn' => [ 'shape' => 'ARN', ], 'ReportTemplate' => [ 'shape' => 'string', ], 'CreationTime' => [ 'shape' => 'timestamp', ], 'CompletionTime' => [ 'shape' => 'timestamp', ], 'Status' => [ 'shape' => 'string', ], 'StatusMessage' => [ 'shape' => 'string', ], 'ReportDestination' => [ 'shape' => 'ReportDestination', ], ], ], 'ReportJobId' => [ 'type' => 'string', ], 'ReportJobList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ReportJob', ], ], 'ReportPlan' => [ 'type' => 'structure', 'members' => [ 'ReportPlanArn' => [ 'shape' => 'ARN', ], 'ReportPlanName' => [ 'shape' => 'ReportPlanName', ], 'ReportPlanDescription' => [ 'shape' => 'ReportPlanDescription', ], 'ReportSetting' => [ 'shape' => 'ReportSetting', ], 'ReportDeliveryChannel' => [ 'shape' => 'ReportDeliveryChannel', ], 'DeploymentStatus' => [ 'shape' => 'string', ], 'CreationTime' => [ 'shape' => 'timestamp', ], 'LastAttemptedExecutionTime' => [ 'shape' => 'timestamp', ], 'LastSuccessfulExecutionTime' => [ 'shape' => 'timestamp', ], ], ], 'ReportPlanDescription' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'pattern' => '.*\\\\S.*', ], 'ReportPlanList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ReportPlan', ], ], 'ReportPlanName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '[a-zA-Z][_a-zA-Z0-9]*', ], 'ReportSetting' => [ 'type' => 'structure', 'required' => [ 'ReportTemplate', ], 'members' => [ 'ReportTemplate' => [ 'shape' => 'string', ], 'FrameworkArns' => [ 'shape' => 'stringList', ], 'NumberOfFrameworks' => [ 'shape' => 'integer', ], 'Accounts' => [ 'shape' => 'stringList', ], 'OrganizationUnits' => [ 'shape' => 'stringList', ], 'Regions' => [ 'shape' => 'stringList', ], ], ], 'ResourceArns' => [ 'type' => 'list', 'member' => [ 'shape' => 'ARN', ], ], 'ResourceIdentifiers' => [ 'type' => 'list', 'member' => [ 'shape' => 'string', ], ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'string', ], 'Message' => [ 'shape' => 'string', ], 'Type' => [ 'shape' => 'string', ], 'Context' => [ 'shape' => 'string', ], ], 'exception' => true, ], 'ResourceType' => [ 'type' => 'string', 'pattern' => '^[a-zA-Z0-9\\\\-\\\\_\\\\.]{1,50}$', ], 'ResourceTypeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ARN', ], ], 'ResourceTypeManagementPreference' => [ 'type' => 'map', 'key' => [ 'shape' => 'ResourceType', ], 'value' => [ 'shape' => 'IsEnabled', ], ], 'ResourceTypeOptInPreference' => [ 'type' => 'map', 'key' => [ 'shape' => 'ResourceType', ], 'value' => [ 'shape' => 'IsEnabled', ], ], 'ResourceTypes' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResourceType', ], ], 'RestoreJobId' => [ 'type' => 'string', ], 'RestoreJobStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING', 'RUNNING', 'COMPLETED', 'ABORTED', 'FAILED', ], ], 'RestoreJobsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RestoreJobsListMember', ], ], 'RestoreJobsListMember' => [ 'type' => 'structure', 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'RestoreJobId' => [ 'shape' => 'string', ], 'RecoveryPointArn' => [ 'shape' => 'ARN', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'CompletionDate' => [ 'shape' => 'timestamp', ], 'Status' => [ 'shape' => 'RestoreJobStatus', ], 'StatusMessage' => [ 'shape' => 'string', ], 'PercentDone' => [ 'shape' => 'string', ], 'BackupSizeInBytes' => [ 'shape' => 'Long', ], 'IamRoleArn' => [ 'shape' => 'IAMRoleArn', ], 'ExpectedCompletionTimeMinutes' => [ 'shape' => 'Long', ], 'CreatedResourceArn' => [ 'shape' => 'ARN', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], ], ], 'ServiceUnavailableException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'string', ], 'Message' => [ 'shape' => 'string', ], 'Type' => [ 'shape' => 'string', ], 'Context' => [ 'shape' => 'string', ], ], 'exception' => true, 'fault' => true, ], 'StartBackupJobInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', 'ResourceArn', 'IamRoleArn', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', ], 'ResourceArn' => [ 'shape' => 'ARN', ], 'IamRoleArn' => [ 'shape' => 'IAMRoleArn', ], 'IdempotencyToken' => [ 'shape' => 'string', ], 'StartWindowMinutes' => [ 'shape' => 'WindowMinutes', ], 'CompleteWindowMinutes' => [ 'shape' => 'WindowMinutes', ], 'Lifecycle' => [ 'shape' => 'Lifecycle', ], 'RecoveryPointTags' => [ 'shape' => 'Tags', ], 'BackupOptions' => [ 'shape' => 'BackupOptions', ], ], ], 'StartBackupJobOutput' => [ 'type' => 'structure', 'members' => [ 'BackupJobId' => [ 'shape' => 'string', ], 'RecoveryPointArn' => [ 'shape' => 'ARN', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'IsParent' => [ 'shape' => 'boolean', ], ], ], 'StartCopyJobInput' => [ 'type' => 'structure', 'required' => [ 'RecoveryPointArn', 'SourceBackupVaultName', 'DestinationBackupVaultArn', 'IamRoleArn', ], 'members' => [ 'RecoveryPointArn' => [ 'shape' => 'ARN', ], 'SourceBackupVaultName' => [ 'shape' => 'BackupVaultName', ], 'DestinationBackupVaultArn' => [ 'shape' => 'ARN', ], 'IamRoleArn' => [ 'shape' => 'IAMRoleArn', ], 'IdempotencyToken' => [ 'shape' => 'string', ], 'Lifecycle' => [ 'shape' => 'Lifecycle', ], ], ], 'StartCopyJobOutput' => [ 'type' => 'structure', 'members' => [ 'CopyJobId' => [ 'shape' => 'string', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'IsParent' => [ 'shape' => 'boolean', ], ], ], 'StartReportJobInput' => [ 'type' => 'structure', 'required' => [ 'ReportPlanName', ], 'members' => [ 'ReportPlanName' => [ 'shape' => 'ReportPlanName', 'location' => 'uri', 'locationName' => 'reportPlanName', ], 'IdempotencyToken' => [ 'shape' => 'string', 'idempotencyToken' => true, ], ], ], 'StartReportJobOutput' => [ 'type' => 'structure', 'members' => [ 'ReportJobId' => [ 'shape' => 'ReportJobId', ], ], ], 'StartRestoreJobInput' => [ 'type' => 'structure', 'required' => [ 'RecoveryPointArn', 'Metadata', ], 'members' => [ 'RecoveryPointArn' => [ 'shape' => 'ARN', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'IamRoleArn' => [ 'shape' => 'IAMRoleArn', ], 'IdempotencyToken' => [ 'shape' => 'string', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'CopySourceTagsToRestoredResource' => [ 'shape' => 'boolean', ], ], ], 'StartRestoreJobOutput' => [ 'type' => 'structure', 'members' => [ 'RestoreJobId' => [ 'shape' => 'RestoreJobId', ], ], ], 'StopBackupJobInput' => [ 'type' => 'structure', 'required' => [ 'BackupJobId', ], 'members' => [ 'BackupJobId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'backupJobId', ], ], ], 'StorageClass' => [ 'type' => 'string', 'enum' => [ 'WARM', 'COLD', 'DELETED', ], ], 'TagKey' => [ 'type' => 'string', ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'string', ], 'sensitive' => true, ], 'TagResourceInput' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'Tags', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'ARN', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'Tags' => [ 'shape' => 'Tags', ], ], ], 'TagValue' => [ 'type' => 'string', ], 'Tags' => [ 'type' => 'map', 'key' => [ 'shape' => 'TagKey', ], 'value' => [ 'shape' => 'TagValue', ], 'sensitive' => true, ], 'UntagResourceInput' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'TagKeyList', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'ARN', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'TagKeyList' => [ 'shape' => 'TagKeyList', ], ], ], 'UpdateBackupPlanInput' => [ 'type' => 'structure', 'required' => [ 'BackupPlanId', 'BackupPlan', ], 'members' => [ 'BackupPlanId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'backupPlanId', ], 'BackupPlan' => [ 'shape' => 'BackupPlanInput', ], ], ], 'UpdateBackupPlanOutput' => [ 'type' => 'structure', 'members' => [ 'BackupPlanId' => [ 'shape' => 'string', ], 'BackupPlanArn' => [ 'shape' => 'ARN', ], 'CreationDate' => [ 'shape' => 'timestamp', ], 'VersionId' => [ 'shape' => 'string', ], 'AdvancedBackupSettings' => [ 'shape' => 'AdvancedBackupSettings', ], ], ], 'UpdateFrameworkInput' => [ 'type' => 'structure', 'required' => [ 'FrameworkName', ], 'members' => [ 'FrameworkName' => [ 'shape' => 'FrameworkName', 'location' => 'uri', 'locationName' => 'frameworkName', ], 'FrameworkDescription' => [ 'shape' => 'FrameworkDescription', ], 'FrameworkControls' => [ 'shape' => 'FrameworkControls', ], 'IdempotencyToken' => [ 'shape' => 'string', 'idempotencyToken' => true, ], ], ], 'UpdateFrameworkOutput' => [ 'type' => 'structure', 'members' => [ 'FrameworkName' => [ 'shape' => 'FrameworkName', ], 'FrameworkArn' => [ 'shape' => 'ARN', ], 'CreationTime' => [ 'shape' => 'timestamp', ], ], ], 'UpdateGlobalSettingsInput' => [ 'type' => 'structure', 'members' => [ 'GlobalSettings' => [ 'shape' => 'GlobalSettings', ], ], ], 'UpdateRecoveryPointLifecycleInput' => [ 'type' => 'structure', 'required' => [ 'BackupVaultName', 'RecoveryPointArn', ], 'members' => [ 'BackupVaultName' => [ 'shape' => 'BackupVaultName', 'location' => 'uri', 'locationName' => 'backupVaultName', ], 'RecoveryPointArn' => [ 'shape' => 'ARN', 'location' => 'uri', 'locationName' => 'recoveryPointArn', ], 'Lifecycle' => [ 'shape' => 'Lifecycle', ], ], ], 'UpdateRecoveryPointLifecycleOutput' => [ 'type' => 'structure', 'members' => [ 'BackupVaultArn' => [ 'shape' => 'ARN', ], 'RecoveryPointArn' => [ 'shape' => 'ARN', ], 'Lifecycle' => [ 'shape' => 'Lifecycle', ], 'CalculatedLifecycle' => [ 'shape' => 'CalculatedLifecycle', ], ], ], 'UpdateRegionSettingsInput' => [ 'type' => 'structure', 'members' => [ 'ResourceTypeOptInPreference' => [ 'shape' => 'ResourceTypeOptInPreference', ], 'ResourceTypeManagementPreference' => [ 'shape' => 'ResourceTypeManagementPreference', ], ], ], 'UpdateReportPlanInput' => [ 'type' => 'structure', 'required' => [ 'ReportPlanName', ], 'members' => [ 'ReportPlanName' => [ 'shape' => 'ReportPlanName', 'location' => 'uri', 'locationName' => 'reportPlanName', ], 'ReportPlanDescription' => [ 'shape' => 'ReportPlanDescription', ], 'ReportDeliveryChannel' => [ 'shape' => 'ReportDeliveryChannel', ], 'ReportSetting' => [ 'shape' => 'ReportSetting', ], 'IdempotencyToken' => [ 'shape' => 'string', 'idempotencyToken' => true, ], ], ], 'UpdateReportPlanOutput' => [ 'type' => 'structure', 'members' => [ 'ReportPlanName' => [ 'shape' => 'ReportPlanName', ], 'ReportPlanArn' => [ 'shape' => 'ARN', ], 'CreationTime' => [ 'shape' => 'timestamp', ], ], ], 'VaultNames' => [ 'type' => 'list', 'member' => [ 'shape' => 'string', ], ], 'WindowMinutes' => [ 'type' => 'long', ], 'boolean' => [ 'type' => 'boolean', ], 'integer' => [ 'type' => 'integer', ], 'long' => [ 'type' => 'long', ], 'string' => [ 'type' => 'string', ], 'stringList' => [ 'type' => 'list', 'member' => [ 'shape' => 'string', ], ], 'stringMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'string', ], 'value' => [ 'shape' => 'string', ], ], 'timestamp' => [ 'type' => 'timestamp', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backup/2018-11-15/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://backup-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://backup-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://backup.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://backup.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backup/2018-11-15/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backup/2018-11-15/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backup/2018-11-15/paginators-1.json\nreturn [ 'pagination' => [ 'ListBackupJobs' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'BackupJobs', ], 'ListBackupPlanTemplates' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'BackupPlanTemplatesList', ], 'ListBackupPlanVersions' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'BackupPlanVersionsList', ], 'ListBackupPlans' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'BackupPlansList', ], 'ListBackupSelections' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'BackupSelectionsList', ], 'ListBackupVaults' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'BackupVaultList', ], 'ListCopyJobs' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'CopyJobs', ], 'ListFrameworks' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListLegalHolds' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'LegalHolds', ], 'ListProtectedResources' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'Results', ], 'ListRecoveryPointsByBackupVault' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'RecoveryPoints', ], 'ListRecoveryPointsByLegalHold' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'RecoveryPoints', ], 'ListRecoveryPointsByResource' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'RecoveryPoints', ], 'ListReportJobs' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListReportPlans' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListRestoreJobs' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'RestoreJobs', ], 'ListTags' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backup-gateway/2021-01-01/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2021-01-01', 'endpointPrefix' => 'backup-gateway', 'jsonVersion' => '1.0', 'protocol' => 'json', 'serviceFullName' => 'AWS Backup Gateway', 'serviceId' => 'Backup Gateway', 'signatureVersion' => 'v4', 'signingName' => 'backup-gateway', 'targetPrefix' => 'BackupOnPremises_v20210101', 'uid' => 'backup-gateway-2021-01-01', ], 'operations' => [ 'AssociateGatewayToServer' => [ 'name' => 'AssociateGatewayToServer', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'AssociateGatewayToServerInput', ], 'output' => [ 'shape' => 'AssociateGatewayToServerOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'CreateGateway' => [ 'name' => 'CreateGateway', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateGatewayInput', ], 'output' => [ 'shape' => 'CreateGatewayOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DeleteGateway' => [ 'name' => 'DeleteGateway', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteGatewayInput', ], 'output' => [ 'shape' => 'DeleteGatewayOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], 'idempotent' => true, ], 'DeleteHypervisor' => [ 'name' => 'DeleteHypervisor', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteHypervisorInput', ], 'output' => [ 'shape' => 'DeleteHypervisorOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], 'idempotent' => true, ], 'DisassociateGatewayFromServer' => [ 'name' => 'DisassociateGatewayFromServer', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DisassociateGatewayFromServerInput', ], 'output' => [ 'shape' => 'DisassociateGatewayFromServerOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'GetBandwidthRateLimitSchedule' => [ 'name' => 'GetBandwidthRateLimitSchedule', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetBandwidthRateLimitScheduleInput', ], 'output' => [ 'shape' => 'GetBandwidthRateLimitScheduleOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'GetGateway' => [ 'name' => 'GetGateway', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetGatewayInput', ], 'output' => [ 'shape' => 'GetGatewayOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'GetHypervisor' => [ 'name' => 'GetHypervisor', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetHypervisorInput', ], 'output' => [ 'shape' => 'GetHypervisorOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'GetHypervisorPropertyMappings' => [ 'name' => 'GetHypervisorPropertyMappings', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetHypervisorPropertyMappingsInput', ], 'output' => [ 'shape' => 'GetHypervisorPropertyMappingsOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'GetVirtualMachine' => [ 'name' => 'GetVirtualMachine', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetVirtualMachineInput', ], 'output' => [ 'shape' => 'GetVirtualMachineOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'ImportHypervisorConfiguration' => [ 'name' => 'ImportHypervisorConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ImportHypervisorConfigurationInput', ], 'output' => [ 'shape' => 'ImportHypervisorConfigurationOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'ListGateways' => [ 'name' => 'ListGateways', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListGatewaysInput', ], 'output' => [ 'shape' => 'ListGatewaysOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'ListHypervisors' => [ 'name' => 'ListHypervisors', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListHypervisorsInput', ], 'output' => [ 'shape' => 'ListHypervisorsOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListTagsForResourceInput', ], 'output' => [ 'shape' => 'ListTagsForResourceOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'ListVirtualMachines' => [ 'name' => 'ListVirtualMachines', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListVirtualMachinesInput', ], 'output' => [ 'shape' => 'ListVirtualMachinesOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'PutBandwidthRateLimitSchedule' => [ 'name' => 'PutBandwidthRateLimitSchedule', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutBandwidthRateLimitScheduleInput', ], 'output' => [ 'shape' => 'PutBandwidthRateLimitScheduleOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], 'idempotent' => true, ], 'PutHypervisorPropertyMappings' => [ 'name' => 'PutHypervisorPropertyMappings', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutHypervisorPropertyMappingsInput', ], 'output' => [ 'shape' => 'PutHypervisorPropertyMappingsOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], 'idempotent' => true, ], 'PutMaintenanceStartTime' => [ 'name' => 'PutMaintenanceStartTime', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutMaintenanceStartTimeInput', ], 'output' => [ 'shape' => 'PutMaintenanceStartTimeOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'StartVirtualMachinesMetadataSync' => [ 'name' => 'StartVirtualMachinesMetadataSync', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StartVirtualMachinesMetadataSyncInput', ], 'output' => [ 'shape' => 'StartVirtualMachinesMetadataSyncOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'TagResourceInput', ], 'output' => [ 'shape' => 'TagResourceOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'TestHypervisorConfiguration' => [ 'name' => 'TestHypervisorConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'TestHypervisorConfigurationInput', ], 'output' => [ 'shape' => 'TestHypervisorConfigurationOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UntagResourceInput', ], 'output' => [ 'shape' => 'UntagResourceOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'UpdateGatewayInformation' => [ 'name' => 'UpdateGatewayInformation', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateGatewayInformationInput', ], 'output' => [ 'shape' => 'UpdateGatewayInformationOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'UpdateGatewaySoftwareNow' => [ 'name' => 'UpdateGatewaySoftwareNow', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateGatewaySoftwareNowInput', ], 'output' => [ 'shape' => 'UpdateGatewaySoftwareNowOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'UpdateHypervisor' => [ 'name' => 'UpdateHypervisor', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateHypervisorInput', ], 'output' => [ 'shape' => 'UpdateHypervisorOutput', ], 'errors' => [ [ 'shape' => 'ValidationException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], ], ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'required' => [ 'ErrorCode', ], 'members' => [ 'ErrorCode' => [ 'shape' => 'string', ], 'Message' => [ 'shape' => 'string', ], ], 'exception' => true, ], 'ActivationKey' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'pattern' => '^[0-9a-zA-Z\\\\-]+$', ], 'AssociateGatewayToServerInput' => [ 'type' => 'structure', 'required' => [ 'GatewayArn', 'ServerArn', ], 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], 'ServerArn' => [ 'shape' => 'ServerArn', ], ], ], 'AssociateGatewayToServerOutput' => [ 'type' => 'structure', 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], ], ], 'AverageUploadRateLimit' => [ 'type' => 'long', 'box' => true, 'max' => 8000000000000, 'min' => 51200, ], 'BandwidthRateLimitInterval' => [ 'type' => 'structure', 'required' => [ 'DaysOfWeek', 'EndHourOfDay', 'EndMinuteOfHour', 'StartHourOfDay', 'StartMinuteOfHour', ], 'members' => [ 'AverageUploadRateLimitInBitsPerSec' => [ 'shape' => 'AverageUploadRateLimit', ], 'DaysOfWeek' => [ 'shape' => 'DaysOfWeek', ], 'EndHourOfDay' => [ 'shape' => 'HourOfDay', ], 'EndMinuteOfHour' => [ 'shape' => 'MinuteOfHour', ], 'StartHourOfDay' => [ 'shape' => 'HourOfDay', ], 'StartMinuteOfHour' => [ 'shape' => 'MinuteOfHour', ], ], ], 'BandwidthRateLimitIntervals' => [ 'type' => 'list', 'member' => [ 'shape' => 'BandwidthRateLimitInterval', ], 'max' => 20, 'min' => 0, ], 'ConflictException' => [ 'type' => 'structure', 'required' => [ 'ErrorCode', ], 'members' => [ 'ErrorCode' => [ 'shape' => 'string', ], 'Message' => [ 'shape' => 'string', ], ], 'exception' => true, ], 'CreateGatewayInput' => [ 'type' => 'structure', 'required' => [ 'ActivationKey', 'GatewayDisplayName', 'GatewayType', ], 'members' => [ 'ActivationKey' => [ 'shape' => 'ActivationKey', ], 'GatewayDisplayName' => [ 'shape' => 'Name', ], 'GatewayType' => [ 'shape' => 'GatewayType', ], 'Tags' => [ 'shape' => 'Tags', ], ], ], 'CreateGatewayOutput' => [ 'type' => 'structure', 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], ], ], 'DayOfMonth' => [ 'type' => 'integer', 'box' => true, 'max' => 31, 'min' => 1, ], 'DayOfWeek' => [ 'type' => 'integer', 'box' => true, 'max' => 6, 'min' => 0, ], 'DaysOfWeek' => [ 'type' => 'list', 'member' => [ 'shape' => 'DayOfWeek', ], 'max' => 7, 'min' => 1, ], 'DeleteGatewayInput' => [ 'type' => 'structure', 'required' => [ 'GatewayArn', ], 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], ], ], 'DeleteGatewayOutput' => [ 'type' => 'structure', 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], ], ], 'DeleteHypervisorInput' => [ 'type' => 'structure', 'required' => [ 'HypervisorArn', ], 'members' => [ 'HypervisorArn' => [ 'shape' => 'ServerArn', ], ], ], 'DeleteHypervisorOutput' => [ 'type' => 'structure', 'members' => [ 'HypervisorArn' => [ 'shape' => 'ServerArn', ], ], ], 'DisassociateGatewayFromServerInput' => [ 'type' => 'structure', 'required' => [ 'GatewayArn', ], 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], ], ], 'DisassociateGatewayFromServerOutput' => [ 'type' => 'structure', 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], ], ], 'Gateway' => [ 'type' => 'structure', 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], 'GatewayDisplayName' => [ 'shape' => 'Name', ], 'GatewayType' => [ 'shape' => 'GatewayType', ], 'HypervisorId' => [ 'shape' => 'HypervisorId', ], 'LastSeenTime' => [ 'shape' => 'Time', ], ], ], 'GatewayArn' => [ 'type' => 'string', 'max' => 500, 'min' => 50, 'pattern' => '^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\\\/[a-zA-Z-0-9]+$', ], 'GatewayDetails' => [ 'type' => 'structure', 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], 'GatewayDisplayName' => [ 'shape' => 'Name', ], 'GatewayType' => [ 'shape' => 'GatewayType', ], 'HypervisorId' => [ 'shape' => 'HypervisorId', ], 'LastSeenTime' => [ 'shape' => 'Time', ], 'MaintenanceStartTime' => [ 'shape' => 'MaintenanceStartTime', ], 'NextUpdateAvailabilityTime' => [ 'shape' => 'Time', ], 'VpcEndpoint' => [ 'shape' => 'VpcEndpoint', ], ], ], 'GatewayType' => [ 'type' => 'string', 'enum' => [ 'BACKUP_VM', ], ], 'Gateways' => [ 'type' => 'list', 'member' => [ 'shape' => 'Gateway', ], ], 'GetBandwidthRateLimitScheduleInput' => [ 'type' => 'structure', 'required' => [ 'GatewayArn', ], 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], ], ], 'GetBandwidthRateLimitScheduleOutput' => [ 'type' => 'structure', 'members' => [ 'BandwidthRateLimitIntervals' => [ 'shape' => 'BandwidthRateLimitIntervals', ], 'GatewayArn' => [ 'shape' => 'GatewayArn', ], ], ], 'GetGatewayInput' => [ 'type' => 'structure', 'required' => [ 'GatewayArn', ], 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], ], ], 'GetGatewayOutput' => [ 'type' => 'structure', 'members' => [ 'Gateway' => [ 'shape' => 'GatewayDetails', ], ], ], 'GetHypervisorInput' => [ 'type' => 'structure', 'required' => [ 'HypervisorArn', ], 'members' => [ 'HypervisorArn' => [ 'shape' => 'ServerArn', ], ], ], 'GetHypervisorOutput' => [ 'type' => 'structure', 'members' => [ 'Hypervisor' => [ 'shape' => 'HypervisorDetails', ], ], ], 'GetHypervisorPropertyMappingsInput' => [ 'type' => 'structure', 'required' => [ 'HypervisorArn', ], 'members' => [ 'HypervisorArn' => [ 'shape' => 'ServerArn', ], ], ], 'GetHypervisorPropertyMappingsOutput' => [ 'type' => 'structure', 'members' => [ 'HypervisorArn' => [ 'shape' => 'ServerArn', ], 'IamRoleArn' => [ 'shape' => 'IamRoleArn', ], 'VmwareToAwsTagMappings' => [ 'shape' => 'VmwareToAwsTagMappings', ], ], ], 'GetVirtualMachineInput' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'ResourceArn', ], ], ], 'GetVirtualMachineOutput' => [ 'type' => 'structure', 'members' => [ 'VirtualMachine' => [ 'shape' => 'VirtualMachineDetails', ], ], ], 'Host' => [ 'type' => 'string', 'max' => 128, 'min' => 3, 'pattern' => '^.+$', ], 'HourOfDay' => [ 'type' => 'integer', 'box' => true, 'max' => 23, 'min' => 0, ], 'Hypervisor' => [ 'type' => 'structure', 'members' => [ 'Host' => [ 'shape' => 'Host', ], 'HypervisorArn' => [ 'shape' => 'ServerArn', ], 'KmsKeyArn' => [ 'shape' => 'KmsKeyArn', ], 'Name' => [ 'shape' => 'Name', ], 'State' => [ 'shape' => 'HypervisorState', ], ], ], 'HypervisorDetails' => [ 'type' => 'structure', 'members' => [ 'Host' => [ 'shape' => 'Host', ], 'HypervisorArn' => [ 'shape' => 'ServerArn', ], 'KmsKeyArn' => [ 'shape' => 'KmsKeyArn', ], 'LastSuccessfulMetadataSyncTime' => [ 'shape' => 'Time', ], 'LatestMetadataSyncStatus' => [ 'shape' => 'SyncMetadataStatus', ], 'LatestMetadataSyncStatusMessage' => [ 'shape' => 'string', ], 'LogGroupArn' => [ 'shape' => 'LogGroupArn', ], 'Name' => [ 'shape' => 'Name', ], 'State' => [ 'shape' => 'HypervisorState', ], ], ], 'HypervisorId' => [ 'type' => 'string', 'max' => 100, 'min' => 1, ], 'HypervisorState' => [ 'type' => 'string', 'enum' => [ 'PENDING', 'ONLINE', 'OFFLINE', 'ERROR', ], ], 'Hypervisors' => [ 'type' => 'list', 'member' => [ 'shape' => 'Hypervisor', ], ], 'IamRoleArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 20, 'pattern' => '^arn:(aws|aws-cn|aws-us-gov):iam::([0-9]+):role/(\\\\S+)$', ], 'ImportHypervisorConfigurationInput' => [ 'type' => 'structure', 'required' => [ 'Host', 'Name', ], 'members' => [ 'Host' => [ 'shape' => 'Host', ], 'KmsKeyArn' => [ 'shape' => 'KmsKeyArn', ], 'Name' => [ 'shape' => 'Name', ], 'Password' => [ 'shape' => 'Password', ], 'Tags' => [ 'shape' => 'Tags', ], 'Username' => [ 'shape' => 'Username', ], ], ], 'ImportHypervisorConfigurationOutput' => [ 'type' => 'structure', 'members' => [ 'HypervisorArn' => [ 'shape' => 'ServerArn', ], ], ], 'InternalServerException' => [ 'type' => 'structure', 'members' => [ 'ErrorCode' => [ 'shape' => 'string', ], 'Message' => [ 'shape' => 'string', ], ], 'exception' => true, 'fault' => true, ], 'KmsKeyArn' => [ 'type' => 'string', 'max' => 500, 'min' => 50, 'pattern' => '^(^arn:(aws|aws-cn|aws-us-gov):kms:([a-zA-Z0-9-]+):([0-9]+):(key|alias)/(\\\\S+)$)|(^alias/(\\\\S+)$)$', ], 'ListGatewaysInput' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListGatewaysOutput' => [ 'type' => 'structure', 'members' => [ 'Gateways' => [ 'shape' => 'Gateways', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListHypervisorsInput' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListHypervisorsOutput' => [ 'type' => 'structure', 'members' => [ 'Hypervisors' => [ 'shape' => 'Hypervisors', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTagsForResourceInput' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'ResourceArn', ], ], ], 'ListTagsForResourceOutput' => [ 'type' => 'structure', 'members' => [ 'ResourceArn' => [ 'shape' => 'ResourceArn', ], 'Tags' => [ 'shape' => 'Tags', ], ], ], 'ListVirtualMachinesInput' => [ 'type' => 'structure', 'members' => [ 'HypervisorArn' => [ 'shape' => 'ServerArn', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListVirtualMachinesOutput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'VirtualMachines' => [ 'shape' => 'VirtualMachines', ], ], ], 'LogGroupArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 0, 'pattern' => '^$|^arn:(aws|aws-cn|aws-us-gov):logs:([a-zA-Z0-9-]+):([0-9]+):log-group:[a-zA-Z0-9_\\\\-\\\\/\\\\.]+:\\\\*$', ], 'MaintenanceStartTime' => [ 'type' => 'structure', 'required' => [ 'HourOfDay', 'MinuteOfHour', ], 'members' => [ 'DayOfMonth' => [ 'shape' => 'DayOfMonth', ], 'DayOfWeek' => [ 'shape' => 'DayOfWeek', ], 'HourOfDay' => [ 'shape' => 'HourOfDay', ], 'MinuteOfHour' => [ 'shape' => 'MinuteOfHour', ], ], ], 'MaxResults' => [ 'type' => 'integer', 'box' => true, 'min' => 1, ], 'MinuteOfHour' => [ 'type' => 'integer', 'box' => true, 'max' => 59, 'min' => 0, ], 'Name' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '^[a-zA-Z0-9-]*$', ], 'NextToken' => [ 'type' => 'string', 'max' => 1000, 'min' => 1, 'pattern' => '^.+$', ], 'Password' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '^[ -~]+$', 'sensitive' => true, ], 'Path' => [ 'type' => 'string', 'max' => 4096, 'min' => 1, 'pattern' => '^[^\\\\x00]+$', ], 'PutBandwidthRateLimitScheduleInput' => [ 'type' => 'structure', 'required' => [ 'BandwidthRateLimitIntervals', 'GatewayArn', ], 'members' => [ 'BandwidthRateLimitIntervals' => [ 'shape' => 'BandwidthRateLimitIntervals', ], 'GatewayArn' => [ 'shape' => 'GatewayArn', ], ], ], 'PutBandwidthRateLimitScheduleOutput' => [ 'type' => 'structure', 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], ], ], 'PutHypervisorPropertyMappingsInput' => [ 'type' => 'structure', 'required' => [ 'HypervisorArn', 'IamRoleArn', 'VmwareToAwsTagMappings', ], 'members' => [ 'HypervisorArn' => [ 'shape' => 'ServerArn', ], 'IamRoleArn' => [ 'shape' => 'IamRoleArn', ], 'VmwareToAwsTagMappings' => [ 'shape' => 'VmwareToAwsTagMappings', ], ], ], 'PutHypervisorPropertyMappingsOutput' => [ 'type' => 'structure', 'members' => [ 'HypervisorArn' => [ 'shape' => 'ServerArn', ], ], ], 'PutMaintenanceStartTimeInput' => [ 'type' => 'structure', 'required' => [ 'GatewayArn', 'HourOfDay', 'MinuteOfHour', ], 'members' => [ 'DayOfMonth' => [ 'shape' => 'DayOfMonth', ], 'DayOfWeek' => [ 'shape' => 'DayOfWeek', ], 'GatewayArn' => [ 'shape' => 'GatewayArn', ], 'HourOfDay' => [ 'shape' => 'HourOfDay', ], 'MinuteOfHour' => [ 'shape' => 'MinuteOfHour', ], ], ], 'PutMaintenanceStartTimeOutput' => [ 'type' => 'structure', 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], ], ], 'ResourceArn' => [ 'type' => 'string', 'max' => 500, 'min' => 50, 'pattern' => '^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\\\/[a-zA-Z-0-9]+$', ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'ErrorCode' => [ 'shape' => 'string', ], 'Message' => [ 'shape' => 'string', ], ], 'exception' => true, ], 'ServerArn' => [ 'type' => 'string', 'max' => 500, 'min' => 50, 'pattern' => '^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\\\/[a-zA-Z-0-9]+$', ], 'StartVirtualMachinesMetadataSyncInput' => [ 'type' => 'structure', 'required' => [ 'HypervisorArn', ], 'members' => [ 'HypervisorArn' => [ 'shape' => 'ServerArn', ], ], ], 'StartVirtualMachinesMetadataSyncOutput' => [ 'type' => 'structure', 'members' => [ 'HypervisorArn' => [ 'shape' => 'ServerArn', ], ], ], 'SyncMetadataStatus' => [ 'type' => 'string', 'enum' => [ 'CREATED', 'RUNNING', 'FAILED', 'PARTIALLY_FAILED', 'SUCCEEDED', ], ], 'Tag' => [ 'type' => 'structure', 'required' => [ 'Key', 'Value', ], 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$', ], 'TagKeys' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], ], 'TagResourceInput' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'Tags', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'ResourceArn', ], 'Tags' => [ 'shape' => 'Tags', ], ], ], 'TagResourceOutput' => [ 'type' => 'structure', 'members' => [ 'ResourceARN' => [ 'shape' => 'ResourceArn', ], ], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => '^[^\\\\x00]*$', ], 'Tags' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], ], 'TestHypervisorConfigurationInput' => [ 'type' => 'structure', 'required' => [ 'GatewayArn', 'Host', ], 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], 'Host' => [ 'shape' => 'Host', ], 'Password' => [ 'shape' => 'Password', ], 'Username' => [ 'shape' => 'Username', ], ], ], 'TestHypervisorConfigurationOutput' => [ 'type' => 'structure', 'members' => [], ], 'ThrottlingException' => [ 'type' => 'structure', 'required' => [ 'ErrorCode', ], 'members' => [ 'ErrorCode' => [ 'shape' => 'string', ], 'Message' => [ 'shape' => 'string', ], ], 'exception' => true, ], 'Time' => [ 'type' => 'timestamp', ], 'UntagResourceInput' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'TagKeys', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'ResourceArn', ], 'TagKeys' => [ 'shape' => 'TagKeys', ], ], ], 'UntagResourceOutput' => [ 'type' => 'structure', 'members' => [ 'ResourceARN' => [ 'shape' => 'ResourceArn', ], ], ], 'UpdateGatewayInformationInput' => [ 'type' => 'structure', 'required' => [ 'GatewayArn', ], 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], 'GatewayDisplayName' => [ 'shape' => 'Name', ], ], ], 'UpdateGatewayInformationOutput' => [ 'type' => 'structure', 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], ], ], 'UpdateGatewaySoftwareNowInput' => [ 'type' => 'structure', 'required' => [ 'GatewayArn', ], 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], ], ], 'UpdateGatewaySoftwareNowOutput' => [ 'type' => 'structure', 'members' => [ 'GatewayArn' => [ 'shape' => 'GatewayArn', ], ], ], 'UpdateHypervisorInput' => [ 'type' => 'structure', 'required' => [ 'HypervisorArn', ], 'members' => [ 'Host' => [ 'shape' => 'Host', ], 'HypervisorArn' => [ 'shape' => 'ServerArn', ], 'LogGroupArn' => [ 'shape' => 'LogGroupArn', ], 'Name' => [ 'shape' => 'Name', ], 'Password' => [ 'shape' => 'Password', ], 'Username' => [ 'shape' => 'Username', ], ], ], 'UpdateHypervisorOutput' => [ 'type' => 'structure', 'members' => [ 'HypervisorArn' => [ 'shape' => 'ServerArn', ], ], ], 'Username' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '^[ -\\\\.0-\\\\[\\\\]-~]*[!-\\\\.0-\\\\[\\\\]-~][ -\\\\.0-\\\\[\\\\]-~]*$', 'sensitive' => true, ], 'ValidationException' => [ 'type' => 'structure', 'members' => [ 'ErrorCode' => [ 'shape' => 'string', ], 'Message' => [ 'shape' => 'string', ], ], 'exception' => true, ], 'VirtualMachine' => [ 'type' => 'structure', 'members' => [ 'HostName' => [ 'shape' => 'Name', ], 'HypervisorId' => [ 'shape' => 'string', ], 'LastBackupDate' => [ 'shape' => 'Time', ], 'Name' => [ 'shape' => 'Name', ], 'Path' => [ 'shape' => 'Path', ], 'ResourceArn' => [ 'shape' => 'ResourceArn', ], ], ], 'VirtualMachineDetails' => [ 'type' => 'structure', 'members' => [ 'HostName' => [ 'shape' => 'Name', ], 'HypervisorId' => [ 'shape' => 'string', ], 'LastBackupDate' => [ 'shape' => 'Time', ], 'Name' => [ 'shape' => 'Name', ], 'Path' => [ 'shape' => 'Path', ], 'ResourceArn' => [ 'shape' => 'ResourceArn', ], 'VmwareTags' => [ 'shape' => 'VmwareTags', ], ], ], 'VirtualMachines' => [ 'type' => 'list', 'member' => [ 'shape' => 'VirtualMachine', ], ], 'VmwareCategory' => [ 'type' => 'string', 'max' => 80, 'min' => 1, ], 'VmwareTag' => [ 'type' => 'structure', 'members' => [ 'VmwareCategory' => [ 'shape' => 'VmwareCategory', ], 'VmwareTagDescription' => [ 'shape' => 'string', ], 'VmwareTagName' => [ 'shape' => 'VmwareTagName', ], ], ], 'VmwareTagName' => [ 'type' => 'string', 'max' => 80, 'min' => 1, ], 'VmwareTags' => [ 'type' => 'list', 'member' => [ 'shape' => 'VmwareTag', ], ], 'VmwareToAwsTagMapping' => [ 'type' => 'structure', 'required' => [ 'AwsTagKey', 'AwsTagValue', 'VmwareCategory', 'VmwareTagName', ], 'members' => [ 'AwsTagKey' => [ 'shape' => 'TagKey', ], 'AwsTagValue' => [ 'shape' => 'TagValue', ], 'VmwareCategory' => [ 'shape' => 'VmwareCategory', ], 'VmwareTagName' => [ 'shape' => 'VmwareTagName', ], ], ], 'VmwareToAwsTagMappings' => [ 'type' => 'list', 'member' => [ 'shape' => 'VmwareToAwsTagMapping', ], ], 'VpcEndpoint' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'string' => [ 'type' => 'string', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backup-gateway/2021-01-01/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p><fullname>Backup gateway</fullname> <p>Backup gateway connects Backup to your hypervisor, so you can create, store, and restore backups of your virtual machines (VMs) anywhere, whether on-premises or in the VMware Cloud (VMC) on Amazon Web Services.</p> <p>Add on-premises resources by connecting to a hypervisor through a gateway. Backup will automatically discover the resources in your hypervisor.</p> <p>Use Backup to assign virtual or on-premises resources to a backup plan, or run on-demand backups. Once you have backed up your resources, you can view them and restore them like any resource supported by Backup.</p> <p>To download the Amazon Web Services software to get started, navigate to the Backup console, choose <b>Gateways</b>, then choose <b>Create gateway</b>.</p></p>', 'operations' => [ 'AssociateGatewayToServer' => '<p>Associates a backup gateway with your server. After you complete the association process, you can back up and restore your VMs through the gateway.</p>', 'CreateGateway' => '<p>Creates a backup gateway. After you create a gateway, you can associate it with a server using the <code>AssociateGatewayToServer</code> operation.</p>', 'DeleteGateway' => '<p>Deletes a backup gateway.</p>', 'DeleteHypervisor' => '<p>Deletes a hypervisor.</p>', 'DisassociateGatewayFromServer' => '<p>Disassociates a backup gateway from the specified server. After the disassociation process finishes, the gateway can no longer access the virtual machines on the server.</p>', 'GetBandwidthRateLimitSchedule' => '<p>Retrieves the bandwidth rate limit schedule for a specified gateway. By default, gateways do not have bandwidth rate limit schedules, which means no bandwidth rate limiting is in effect. Use this to get a gateway\\'s bandwidth rate limit schedule.</p>', 'GetGateway' => '<p>By providing the ARN (Amazon Resource Name), this API returns the gateway.</p>', 'GetHypervisor' => '<p>This action requests information about the specified hypervisor to which the gateway will connect. A hypervisor is hardware, software, or firmware that creates and manages virtual machines, and allocates resources to them.</p>', 'GetHypervisorPropertyMappings' => '<p>This action retrieves the property mappings for the specified hypervisor. A hypervisor property mapping displays the relationship of entity properties available from the on-premises hypervisor to the properties available in Amazon Web Services.</p>', 'GetVirtualMachine' => '<p>By providing the ARN (Amazon Resource Name), this API returns the virtual machine.</p>', 'ImportHypervisorConfiguration' => '<p>Connect to a hypervisor by importing its configuration.</p>', 'ListGateways' => '<p>Lists backup gateways owned by an Amazon Web Services account in an Amazon Web Services Region. The returned list is ordered by gateway Amazon Resource Name (ARN).</p>', 'ListHypervisors' => '<p>Lists your hypervisors.</p>', 'ListTagsForResource' => '<p>Lists the tags applied to the resource identified by its Amazon Resource Name (ARN).</p>', 'ListVirtualMachines' => '<p>Lists your virtual machines.</p>', 'PutBandwidthRateLimitSchedule' => '<p>This action sets the bandwidth rate limit schedule for a specified gateway. By default, gateways do not have a bandwidth rate limit schedule, which means no bandwidth rate limiting is in effect. Use this to initiate a gateway\\'s bandwidth rate limit schedule.</p>', 'PutHypervisorPropertyMappings' => '<p>This action sets the property mappings for the specified hypervisor. A hypervisor property mapping displays the relationship of entity properties available from the on-premises hypervisor to the properties available in Amazon Web Services.</p>', 'PutMaintenanceStartTime' => '<p>Set the maintenance start time for a gateway.</p>', 'StartVirtualMachinesMetadataSync' => '<p>This action sends a request to sync metadata across the specified virtual machines.</p>', 'TagResource' => '<p>Tag the resource.</p>', 'TestHypervisorConfiguration' => '<p>Tests your hypervisor configuration to validate that backup gateway can connect with the hypervisor and its resources.</p>', 'UntagResource' => '<p>Removes tags from the resource.</p>', 'UpdateGatewayInformation' => '<p>Updates a gateway\\'s name. Specify which gateway to update using the Amazon Resource Name (ARN) of the gateway in your request.</p>', 'UpdateGatewaySoftwareNow' => '<p>Updates the gateway virtual machine (VM) software. The request immediately triggers the software update.</p> <note> <p>When you make this request, you get a <code>200 OK</code> success response immediately. However, it might take some time for the update to complete.</p> </note>', 'UpdateHypervisor' => '<p>Updates a hypervisor metadata, including its host, username, and password. Specify which hypervisor to update using the Amazon Resource Name (ARN) of the hypervisor in your request.</p>', ], 'shapes' => [ 'AccessDeniedException' => [ 'base' => '<p>The operation cannot proceed because you have insufficient permissions.</p>', 'refs' => [], ], 'ActivationKey' => [ 'base' => NULL, 'refs' => [ 'CreateGatewayInput$ActivationKey' => '<p>The activation key of the created gateway.</p>', ], ], 'AssociateGatewayToServerInput' => [ 'base' => NULL, 'refs' => [], ], 'AssociateGatewayToServerOutput' => [ 'base' => NULL, 'refs' => [], ], 'AverageUploadRateLimit' => [ 'base' => NULL, 'refs' => [ 'BandwidthRateLimitInterval$AverageUploadRateLimitInBitsPerSec' => '<p>The average upload rate limit component of the bandwidth rate limit interval, in bits per second. This field does not appear in the response if the upload rate limit is not set.</p> <note> <p>For Backup Gateway, the minimum value is <code>(Value)</code>.</p> </note>', ], ], 'BandwidthRateLimitInterval' => [ 'base' => '<p>Describes a bandwidth rate limit interval for a gateway. A bandwidth rate limit schedule consists of one or more bandwidth rate limit intervals. A bandwidth rate limit interval defines a period of time on one or more days of the week, during which bandwidth rate limits are specified for uploading, downloading, or both.</p>', 'refs' => [ 'BandwidthRateLimitIntervals$member' => NULL, ], ], 'BandwidthRateLimitIntervals' => [ 'base' => NULL, 'refs' => [ 'GetBandwidthRateLimitScheduleOutput$BandwidthRateLimitIntervals' => '<p>An array containing bandwidth rate limit schedule intervals for a gateway. When no bandwidth rate limit intervals have been scheduled, the array is empty.</p>', 'PutBandwidthRateLimitScheduleInput$BandwidthRateLimitIntervals' => '<p>An array containing bandwidth rate limit schedule intervals for a gateway. When no bandwidth rate limit intervals have been scheduled, the array is empty.</p>', ], ], 'ConflictException' => [ 'base' => '<p>The operation cannot proceed because it is not supported.</p>', 'refs' => [], ], 'CreateGatewayInput' => [ 'base' => NULL, 'refs' => [], ], 'CreateGatewayOutput' => [ 'base' => NULL, 'refs' => [], ], 'DayOfMonth' => [ 'base' => NULL, 'refs' => [ 'MaintenanceStartTime$DayOfMonth' => '<p>The day of the month component of the maintenance start time represented as an ordinal number from 1 to 28, where 1 represents the first day of the month and 28 represents the last day of the month.</p>', 'PutMaintenanceStartTimeInput$DayOfMonth' => '<p>The day of the month start maintenance on a gateway.</p> <p>Valid values range from <code>Sunday</code> to <code>Saturday</code>.</p>', ], ], 'DayOfWeek' => [ 'base' => NULL, 'refs' => [ 'DaysOfWeek$member' => NULL, 'MaintenanceStartTime$DayOfWeek' => '<p>An ordinal number between 0 and 6 that represents the day of the week, where 0 represents Sunday and 6 represents Saturday. The day of week is in the time zone of the gateway.</p>', 'PutMaintenanceStartTimeInput$DayOfWeek' => '<p>The day of the week to start maintenance on a gateway.</p>', ], ], 'DaysOfWeek' => [ 'base' => NULL, 'refs' => [ 'BandwidthRateLimitInterval$DaysOfWeek' => '<p>The days of the week component of the bandwidth rate limit interval, represented as ordinal numbers from 0 to 6, where 0 represents Sunday and 6 represents Saturday.</p>', ], ], 'DeleteGatewayInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteGatewayOutput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteHypervisorInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteHypervisorOutput' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateGatewayFromServerInput' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateGatewayFromServerOutput' => [ 'base' => NULL, 'refs' => [], ], 'Gateway' => [ 'base' => '<p>A gateway is an Backup Gateway appliance that runs on the customer\\'s network to provide seamless connectivity to backup storage in the Amazon Web Services Cloud.</p>', 'refs' => [ 'Gateways$member' => NULL, ], ], 'GatewayArn' => [ 'base' => NULL, 'refs' => [ 'AssociateGatewayToServerInput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>', 'AssociateGatewayToServerOutput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of a gateway.</p>', 'CreateGatewayOutput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway you create.</p>', 'DeleteGatewayInput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway to delete.</p>', 'DeleteGatewayOutput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway you deleted.</p>', 'DisassociateGatewayFromServerInput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway to disassociate.</p>', 'DisassociateGatewayFromServerOutput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway you disassociated.</p>', 'Gateway$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>', 'GatewayDetails$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>', 'GetBandwidthRateLimitScheduleInput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway. Use the <a href=\"https://docs.aws.amazon.com/aws-backup/latest/devguide/API_BGW_ListGateways.html\"> <code>ListGateways</code> </a> operation to return a list of gateways for your account and Amazon Web Services Region.</p>', 'GetBandwidthRateLimitScheduleOutput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway. Use the <a href=\"https://docs.aws.amazon.com/aws-backup/latest/devguide/API_BGW_ListGateways.html\"> <code>ListGateways</code> </a> operation to return a list of gateways for your account and Amazon Web Services Region.</p>', 'GetGatewayInput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway.</p>', 'PutBandwidthRateLimitScheduleInput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway. Use the <a href=\"https://docs.aws.amazon.com/aws-backup/latest/devguide/API_BGW_ListGateways.html\"> <code>ListGateways</code> </a> operation to return a list of gateways for your account and Amazon Web Services Region.</p>', 'PutBandwidthRateLimitScheduleOutput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway. Use the <a href=\"https://docs.aws.amazon.com/aws-backup/latest/devguide/API_BGW_ListGateways.html\"> <code>ListGateways</code> </a> operation to return a list of gateways for your account and Amazon Web Services Region.</p>', 'PutMaintenanceStartTimeInput$GatewayArn' => '<p>The Amazon Resource Name (ARN) for the gateway, used to specify its maintenance start time.</p>', 'PutMaintenanceStartTimeOutput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of a gateway for which you set the maintenance start time.</p>', 'TestHypervisorConfigurationInput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway to the hypervisor to test.</p>', 'UpdateGatewayInformationInput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway to update.</p>', 'UpdateGatewayInformationOutput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway you updated.</p>', 'UpdateGatewaySoftwareNowInput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway to be updated.</p>', 'UpdateGatewaySoftwareNowOutput$GatewayArn' => '<p>The Amazon Resource Name (ARN) of the gateway you updated.</p>', ], ], 'GatewayDetails' => [ 'base' => '<p>The details of gateway.</p>', 'refs' => [ 'GetGatewayOutput$Gateway' => '<p>By providing the ARN (Amazon Resource Name), this API returns the gateway.</p>', ], ], 'GatewayType' => [ 'base' => NULL, 'refs' => [ 'CreateGatewayInput$GatewayType' => '<p>The type of created gateway.</p>', 'Gateway$GatewayType' => '<p>The type of the gateway.</p>', 'GatewayDetails$GatewayType' => '<p>The type of the gateway type.</p>', ], ], 'Gateways' => [ 'base' => NULL, 'refs' => [ 'ListGatewaysOutput$Gateways' => '<p>A list of your gateways.</p>', ], ], 'GetBandwidthRateLimitScheduleInput' => [ 'base' => NULL, 'refs' => [], ], 'GetBandwidthRateLimitScheduleOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetGatewayInput' => [ 'base' => NULL, 'refs' => [], ], 'GetGatewayOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetHypervisorInput' => [ 'base' => NULL, 'refs' => [], ], 'GetHypervisorOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetHypervisorPropertyMappingsInput' => [ 'base' => NULL, 'refs' => [], ], 'GetHypervisorPropertyMappingsOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetVirtualMachineInput' => [ 'base' => NULL, 'refs' => [], ], 'GetVirtualMachineOutput' => [ 'base' => NULL, 'refs' => [], ], 'Host' => [ 'base' => NULL, 'refs' => [ 'Hypervisor$Host' => '<p>The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).</p>', 'HypervisorDetails$Host' => '<p>The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).</p>', 'ImportHypervisorConfigurationInput$Host' => '<p>The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).</p>', 'TestHypervisorConfigurationInput$Host' => '<p>The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).</p>', 'UpdateHypervisorInput$Host' => '<p>The updated host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).</p>', ], ], 'HourOfDay' => [ 'base' => NULL, 'refs' => [ 'BandwidthRateLimitInterval$EndHourOfDay' => '<p>The hour of the day to end the bandwidth rate limit interval.</p>', 'BandwidthRateLimitInterval$StartHourOfDay' => '<p>The hour of the day to start the bandwidth rate limit interval.</p>', 'MaintenanceStartTime$HourOfDay' => '<p>The hour component of the maintenance start time represented as <i>hh</i>, where <i>hh</i> is the hour (0 to 23). The hour of the day is in the time zone of the gateway.</p>', 'PutMaintenanceStartTimeInput$HourOfDay' => '<p>The hour of the day to start maintenance on a gateway.</p>', ], ], 'Hypervisor' => [ 'base' => '<p>Represents the hypervisor\\'s permissions to which the gateway will connect.</p> <p>A hypervisor is hardware, software, or firmware that creates and manages virtual machines, and allocates resources to them.</p>', 'refs' => [ 'Hypervisors$member' => NULL, ], ], 'HypervisorDetails' => [ 'base' => '<p>These are the details of the specified hypervisor. A hypervisor is hardware, software, or firmware that creates and manages virtual machines, and allocates resources to them.</p>', 'refs' => [ 'GetHypervisorOutput$Hypervisor' => '<p>Details about the requested hypervisor.</p>', ], ], 'HypervisorId' => [ 'base' => NULL, 'refs' => [ 'Gateway$HypervisorId' => '<p>The hypervisor ID of the gateway.</p>', 'GatewayDetails$HypervisorId' => '<p>The hypervisor ID of the gateway.</p>', ], ], 'HypervisorState' => [ 'base' => NULL, 'refs' => [ 'Hypervisor$State' => '<p>The state of the hypervisor.</p>', 'HypervisorDetails$State' => '<p>This is the current state of the specified hypervisor.</p> <p>The possible states are <code>PENDING</code>, <code>ONLINE</code>, <code>OFFLINE</code>, or <code>ERROR</code>.</p>', ], ], 'Hypervisors' => [ 'base' => NULL, 'refs' => [ 'ListHypervisorsOutput$Hypervisors' => '<p>A list of your <code>Hypervisor</code> objects, ordered by their Amazon Resource Names (ARNs).</p>', ], ], 'IamRoleArn' => [ 'base' => NULL, 'refs' => [ 'GetHypervisorPropertyMappingsOutput$IamRoleArn' => '<p>The Amazon Resource Name (ARN) of the IAM role.</p>', 'PutHypervisorPropertyMappingsInput$IamRoleArn' => '<p>The Amazon Resource Name (ARN) of the IAM role.</p>', ], ], 'ImportHypervisorConfigurationInput' => [ 'base' => NULL, 'refs' => [], ], 'ImportHypervisorConfigurationOutput' => [ 'base' => NULL, 'refs' => [], ], 'InternalServerException' => [ 'base' => '<p>The operation did not succeed because an internal error occurred. Try again later.</p>', 'refs' => [], ], 'KmsKeyArn' => [ 'base' => NULL, 'refs' => [ 'Hypervisor$KmsKeyArn' => '<p>The Amazon Resource Name (ARN) of the Key Management Service used to encrypt the hypervisor.</p>', 'HypervisorDetails$KmsKeyArn' => '<p>The Amazon Resource Name (ARN) of the KMS used to encrypt the hypervisor.</p>', 'ImportHypervisorConfigurationInput$KmsKeyArn' => '<p>The Key Management Service for the hypervisor.</p>', ], ], 'ListGatewaysInput' => [ 'base' => NULL, 'refs' => [], ], 'ListGatewaysOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListHypervisorsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListHypervisorsOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceInput' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListVirtualMachinesInput' => [ 'base' => NULL, 'refs' => [], ], 'ListVirtualMachinesOutput' => [ 'base' => NULL, 'refs' => [], ], 'LogGroupArn' => [ 'base' => NULL, 'refs' => [ 'HypervisorDetails$LogGroupArn' => '<p>The Amazon Resource Name (ARN) of the group of gateways within the requested log.</p>', 'UpdateHypervisorInput$LogGroupArn' => '<p>The Amazon Resource Name (ARN) of the group of gateways within the requested log.</p>', ], ], 'MaintenanceStartTime' => [ 'base' => '<p>This is your gateway\\'s weekly maintenance start time including the day and time of the week. Note that values are in terms of the gateway\\'s time zone. Can be weekly or monthly.</p>', 'refs' => [ 'GatewayDetails$MaintenanceStartTime' => '<p>Returns your gateway\\'s weekly maintenance start time including the day and time of the week. Note that values are in terms of the gateway\\'s time zone. Can be weekly or monthly.</p>', ], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'ListGatewaysInput$MaxResults' => '<p>The maximum number of gateways to list.</p>', 'ListHypervisorsInput$MaxResults' => '<p>The maximum number of hypervisors to list.</p>', 'ListVirtualMachinesInput$MaxResults' => '<p>The maximum number of virtual machines to list.</p>', ], ], 'MinuteOfHour' => [ 'base' => NULL, 'refs' => [ 'BandwidthRateLimitInterval$EndMinuteOfHour' => '<p>The minute of the hour to end the bandwidth rate limit interval.</p> <important> <p>The bandwidth rate limit interval ends at the end of the minute. To end an interval at the end of an hour, use the value <code>59</code>.</p> </important>', 'BandwidthRateLimitInterval$StartMinuteOfHour' => '<p>The minute of the hour to start the bandwidth rate limit interval. The interval begins at the start of that minute. To begin an interval exactly at the start of the hour, use the value <code>0</code>.</p>', 'MaintenanceStartTime$MinuteOfHour' => '<p>The minute component of the maintenance start time represented as <i>mm</i>, where <i>mm</i> is the minute (0 to 59). The minute of the hour is in the time zone of the gateway.</p>', 'PutMaintenanceStartTimeInput$MinuteOfHour' => '<p>The minute of the hour to start maintenance on a gateway.</p>', ], ], 'Name' => [ 'base' => NULL, 'refs' => [ 'CreateGatewayInput$GatewayDisplayName' => '<p>The display name of the created gateway.</p>', 'Gateway$GatewayDisplayName' => '<p>The display name of the gateway.</p>', 'GatewayDetails$GatewayDisplayName' => '<p>The display name of the gateway.</p>', 'Hypervisor$Name' => '<p>The name of the hypervisor.</p>', 'HypervisorDetails$Name' => '<p>This is the name of the specified hypervisor.</p>', 'ImportHypervisorConfigurationInput$Name' => '<p>The name of the hypervisor.</p>', 'UpdateGatewayInformationInput$GatewayDisplayName' => '<p>The updated display name of the gateway.</p>', 'UpdateHypervisorInput$Name' => '<p>The updated name for the hypervisor</p>', 'VirtualMachine$HostName' => '<p>The host name of the virtual machine.</p>', 'VirtualMachine$Name' => '<p>The name of the virtual machine.</p>', 'VirtualMachineDetails$HostName' => '<p>The host name of the virtual machine.</p>', 'VirtualMachineDetails$Name' => '<p>The name of the virtual machine.</p>', ], ], 'NextToken' => [ 'base' => NULL, 'refs' => [ 'ListGatewaysInput$NextToken' => '<p>The next item following a partial list of returned resources. For example, if a request is made to return <code>MaxResults</code> number of resources, <code>NextToken</code> allows you to return more items in your list starting at the location pointed to by the next token.</p>', 'ListGatewaysOutput$NextToken' => '<p>The next item following a partial list of returned resources. For example, if a request is made to return <code>maxResults</code> number of resources, <code>NextToken</code> allows you to return more items in your list starting at the location pointed to by the next token.</p>', 'ListHypervisorsInput$NextToken' => '<p>The next item following a partial list of returned resources. For example, if a request is made to return <code>maxResults</code> number of resources, <code>NextToken</code> allows you to return more items in your list starting at the location pointed to by the next token.</p>', 'ListHypervisorsOutput$NextToken' => '<p>The next item following a partial list of returned resources. For example, if a request is made to return <code>maxResults</code> number of resources, <code>NextToken</code> allows you to return more items in your list starting at the location pointed to by the next token.</p>', 'ListVirtualMachinesInput$NextToken' => '<p>The next item following a partial list of returned resources. For example, if a request is made to return <code>maxResults</code> number of resources, <code>NextToken</code> allows you to return more items in your list starting at the location pointed to by the next token.</p>', 'ListVirtualMachinesOutput$NextToken' => '<p>The next item following a partial list of returned resources. For example, if a request is made to return <code>maxResults</code> number of resources, <code>NextToken</code> allows you to return more items in your list starting at the location pointed to by the next token.</p>', ], ], 'Password' => [ 'base' => NULL, 'refs' => [ 'ImportHypervisorConfigurationInput$Password' => '<p>The password for the hypervisor.</p>', 'TestHypervisorConfigurationInput$Password' => '<p>The password for the hypervisor.</p>', 'UpdateHypervisorInput$Password' => '<p>The updated password for the hypervisor.</p>', ], ], 'Path' => [ 'base' => NULL, 'refs' => [ 'VirtualMachine$Path' => '<p>The path of the virtual machine.</p>', 'VirtualMachineDetails$Path' => '<p>The path of the virtual machine.</p>', ], ], 'PutBandwidthRateLimitScheduleInput' => [ 'base' => NULL, 'refs' => [], ], 'PutBandwidthRateLimitScheduleOutput' => [ 'base' => NULL, 'refs' => [], ], 'PutHypervisorPropertyMappingsInput' => [ 'base' => NULL, 'refs' => [], ], 'PutHypervisorPropertyMappingsOutput' => [ 'base' => NULL, 'refs' => [], ], 'PutMaintenanceStartTimeInput' => [ 'base' => NULL, 'refs' => [], ], 'PutMaintenanceStartTimeOutput' => [ 'base' => NULL, 'refs' => [], ], 'ResourceArn' => [ 'base' => NULL, 'refs' => [ 'GetVirtualMachineInput$ResourceArn' => '<p>The Amazon Resource Name (ARN) of the virtual machine.</p>', 'ListTagsForResourceInput$ResourceArn' => '<p>The Amazon Resource Name (ARN) of the resource\\'s tags to list.</p>', 'ListTagsForResourceOutput$ResourceArn' => '<p>The Amazon Resource Name (ARN) of the resource\\'s tags that you listed.</p>', 'TagResourceInput$ResourceARN' => '<p>The Amazon Resource Name (ARN) of the resource to tag.</p>', 'TagResourceOutput$ResourceARN' => '<p>The Amazon Resource Name (ARN) of the resource you tagged.</p>', 'UntagResourceInput$ResourceARN' => '<p>The Amazon Resource Name (ARN) of the resource from which to remove tags.</p>', 'UntagResourceOutput$ResourceARN' => '<p>The Amazon Resource Name (ARN) of the resource from which you removed tags.</p>', 'VirtualMachine$ResourceArn' => '<p>The Amazon Resource Name (ARN) of the virtual machine. For example, <code>arn:aws:backup-gateway:us-west-1:0000000000000:vm/vm-0000ABCDEFGIJKL</code>.</p>', 'VirtualMachineDetails$ResourceArn' => '<p>The Amazon Resource Name (ARN) of the virtual machine. For example, <code>arn:aws:backup-gateway:us-west-1:0000000000000:vm/vm-0000ABCDEFGIJKL</code>.</p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p>A resource that is required for the action wasn\\'t found.</p>', 'refs' => [], ], 'ServerArn' => [ 'base' => NULL, 'refs' => [ 'AssociateGatewayToServerInput$ServerArn' => '<p>The Amazon Resource Name (ARN) of the server that hosts your virtual machines.</p>', 'DeleteHypervisorInput$HypervisorArn' => '<p>The Amazon Resource Name (ARN) of the hypervisor to delete.</p>', 'DeleteHypervisorOutput$HypervisorArn' => '<p>The Amazon Resource Name (ARN) of the hypervisor you deleted.</p>', 'GetHypervisorInput$HypervisorArn' => '<p>The Amazon Resource Name (ARN) of the hypervisor.</p>', 'GetHypervisorPropertyMappingsInput$HypervisorArn' => '<p>The Amazon Resource Name (ARN) of the hypervisor.</p>', 'GetHypervisorPropertyMappingsOutput$HypervisorArn' => '<p>The Amazon Resource Name (ARN) of the hypervisor.</p>', 'Hypervisor$HypervisorArn' => '<p>The Amazon Resource Name (ARN) of the hypervisor.</p>', 'HypervisorDetails$HypervisorArn' => '<p>The Amazon Resource Name (ARN) of the hypervisor.</p>', 'ImportHypervisorConfigurationOutput$HypervisorArn' => '<p>The Amazon Resource Name (ARN) of the hypervisor you disassociated.</p>', 'ListVirtualMachinesInput$HypervisorArn' => '<p>The Amazon Resource Name (ARN) of the hypervisor connected to your virtual machine.</p>', 'PutHypervisorPropertyMappingsInput$HypervisorArn' => '<p>The Amazon Resource Name (ARN) of the hypervisor.</p>', 'PutHypervisorPropertyMappingsOutput$HypervisorArn' => '<p>The Amazon Resource Name (ARN) of the hypervisor.</p>', 'StartVirtualMachinesMetadataSyncInput$HypervisorArn' => '<p>The Amazon Resource Name (ARN) of the hypervisor.</p>', 'StartVirtualMachinesMetadataSyncOutput$HypervisorArn' => '<p>The Amazon Resource Name (ARN) of the hypervisor.</p>', 'UpdateHypervisorInput$HypervisorArn' => '<p>The Amazon Resource Name (ARN) of the hypervisor to update.</p>', 'UpdateHypervisorOutput$HypervisorArn' => '<p>The Amazon Resource Name (ARN) of the hypervisor you updated.</p>', ], ], 'StartVirtualMachinesMetadataSyncInput' => [ 'base' => NULL, 'refs' => [], ], 'StartVirtualMachinesMetadataSyncOutput' => [ 'base' => NULL, 'refs' => [], ], 'SyncMetadataStatus' => [ 'base' => NULL, 'refs' => [ 'HypervisorDetails$LatestMetadataSyncStatus' => '<p>This is the most recent status for the indicated metadata sync.</p>', ], ], 'Tag' => [ 'base' => '<p>A key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.</p>', 'refs' => [ 'Tags$member' => NULL, ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'Tag$Key' => '<p>The key part of a tag\\'s key-value pair. The key can\\'t start with <code>aws:</code>.</p>', 'TagKeys$member' => NULL, 'VmwareToAwsTagMapping$AwsTagKey' => '<p>The key part of the Amazon Web Services tag\\'s key-value pair.</p>', ], ], 'TagKeys' => [ 'base' => NULL, 'refs' => [ 'UntagResourceInput$TagKeys' => '<p>The list of tag keys specifying which tags to remove.</p>', ], ], 'TagResourceInput' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceOutput' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'Tag$Value' => '<p>The value part of a tag\\'s key-value pair.</p>', 'VmwareToAwsTagMapping$AwsTagValue' => '<p>The value part of the Amazon Web Services tag\\'s key-value pair.</p>', ], ], 'Tags' => [ 'base' => NULL, 'refs' => [ 'CreateGatewayInput$Tags' => '<p>A list of up to 50 tags to assign to the gateway. Each tag is a key-value pair.</p>', 'ImportHypervisorConfigurationInput$Tags' => '<p>The tags of the hypervisor configuration to import.</p>', 'ListTagsForResourceOutput$Tags' => '<p>A list of the resource\\'s tags.</p>', 'TagResourceInput$Tags' => '<p>A list of tags to assign to the resource.</p>', ], ], 'TestHypervisorConfigurationInput' => [ 'base' => NULL, 'refs' => [], ], 'TestHypervisorConfigurationOutput' => [ 'base' => NULL, 'refs' => [], ], 'ThrottlingException' => [ 'base' => '<p>TPS has been limited to protect against intentional or unintentional high request volumes.</p>', 'refs' => [], ], 'Time' => [ 'base' => NULL, 'refs' => [ 'Gateway$LastSeenTime' => '<p>The last time Backup gateway communicated with the gateway, in Unix format and UTC time.</p>', 'GatewayDetails$LastSeenTime' => '<p>Details showing the last time Backup gateway communicated with the cloud, in Unix format and UTC time.</p>', 'GatewayDetails$NextUpdateAvailabilityTime' => '<p>Details showing the next update availability time of the gateway.</p>', 'HypervisorDetails$LastSuccessfulMetadataSyncTime' => '<p>This is the time when the most recent successful sync of metadata occurred.</p>', 'VirtualMachine$LastBackupDate' => '<p>The most recent date a virtual machine was backed up, in Unix format and UTC time.</p>', 'VirtualMachineDetails$LastBackupDate' => '<p>The most recent date a virtual machine was backed up, in Unix format and UTC time.</p>', ], ], 'UntagResourceInput' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateGatewayInformationInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateGatewayInformationOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateGatewaySoftwareNowInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateGatewaySoftwareNowOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateHypervisorInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateHypervisorOutput' => [ 'base' => NULL, 'refs' => [], ], 'Username' => [ 'base' => NULL, 'refs' => [ 'ImportHypervisorConfigurationInput$Username' => '<p>The username for the hypervisor.</p>', 'TestHypervisorConfigurationInput$Username' => '<p>The username for the hypervisor.</p>', 'UpdateHypervisorInput$Username' => '<p>The updated username for the hypervisor.</p>', ], ], 'ValidationException' => [ 'base' => '<p>The operation did not succeed because a validation error occurred.</p>', 'refs' => [], ], 'VirtualMachine' => [ 'base' => '<p>A virtual machine that is on a hypervisor.</p>', 'refs' => [ 'VirtualMachines$member' => NULL, ], ], 'VirtualMachineDetails' => [ 'base' => '<p>Your <code>VirtualMachine</code> objects, ordered by their Amazon Resource Names (ARNs).</p>', 'refs' => [ 'GetVirtualMachineOutput$VirtualMachine' => '<p>This object contains the basic attributes of <code>VirtualMachine</code> contained by the output of <code>GetVirtualMachine</code> </p>', ], ], 'VirtualMachines' => [ 'base' => NULL, 'refs' => [ 'ListVirtualMachinesOutput$VirtualMachines' => '<p>A list of your <code>VirtualMachine</code> objects, ordered by their Amazon Resource Names (ARNs).</p>', ], ], 'VmwareCategory' => [ 'base' => NULL, 'refs' => [ 'VmwareTag$VmwareCategory' => '<p>The is the category of VMware.</p>', 'VmwareToAwsTagMapping$VmwareCategory' => '<p>The is the category of VMware.</p>', ], ], 'VmwareTag' => [ 'base' => '<p>A VMware tag is a tag attached to a specific virtual machine. A <a href=\"https://docs.aws.amazon.com/aws-backup/latest/devguide/API_BGW_Tag.html\">tag</a> is a key-value pair you can use to manage, filter, and search for your resources.</p> <p>The content of VMware tags can be matched to Amazon Web Services tags.</p>', 'refs' => [ 'VmwareTags$member' => NULL, ], ], 'VmwareTagName' => [ 'base' => NULL, 'refs' => [ 'VmwareTag$VmwareTagName' => '<p>This is the user-defined name of a VMware tag.</p>', 'VmwareToAwsTagMapping$VmwareTagName' => '<p>This is the user-defined name of a VMware tag.</p>', ], ], 'VmwareTags' => [ 'base' => NULL, 'refs' => [ 'VirtualMachineDetails$VmwareTags' => '<p>These are the details of the VMware tags associated with the specified virtual machine.</p>', ], ], 'VmwareToAwsTagMapping' => [ 'base' => '<p>This displays the mapping of on-premises VMware tags to the corresponding Amazon Web Services tags.</p>', 'refs' => [ 'VmwareToAwsTagMappings$member' => NULL, ], ], 'VmwareToAwsTagMappings' => [ 'base' => NULL, 'refs' => [ 'GetHypervisorPropertyMappingsOutput$VmwareToAwsTagMappings' => '<p>This is a display of the mappings of on-premises VMware tags to the Amazon Web Services tags.</p>', 'PutHypervisorPropertyMappingsInput$VmwareToAwsTagMappings' => '<p>This action requests the mappings of on-premises VMware tags to the Amazon Web Services tags.</p>', ], ], 'VpcEndpoint' => [ 'base' => NULL, 'refs' => [ 'GatewayDetails$VpcEndpoint' => '<p>The DNS name for the virtual private cloud (VPC) endpoint the gateway uses to connect to the cloud for backup gateway.</p>', ], ], 'string' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$ErrorCode' => '<p>A description of why you have insufficient permissions.</p>', 'AccessDeniedException$Message' => NULL, 'ConflictException$ErrorCode' => '<p>A description of why the operation is not supported.</p>', 'ConflictException$Message' => NULL, 'HypervisorDetails$LatestMetadataSyncStatusMessage' => '<p>This is the most recent status for the indicated metadata sync.</p>', 'InternalServerException$ErrorCode' => '<p>A description of which internal error occured.</p>', 'InternalServerException$Message' => NULL, 'ResourceNotFoundException$ErrorCode' => '<p>A description of which resource wasn\\'t found.</p>', 'ResourceNotFoundException$Message' => NULL, 'ThrottlingException$ErrorCode' => '<p>Error: TPS has been limited to protect against intentional or unintentional high request volumes.</p>', 'ThrottlingException$Message' => NULL, 'ValidationException$ErrorCode' => '<p>A description of what caused the validation error.</p>', 'ValidationException$Message' => NULL, 'VirtualMachine$HypervisorId' => '<p>The ID of the virtual machine\\'s hypervisor.</p>', 'VirtualMachineDetails$HypervisorId' => '<p>The ID of the virtual machine\\'s hypervisor.</p>', 'VmwareTag$VmwareTagDescription' => '<p>This is a user-defined description of a VMware tag.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backup-gateway/2021-01-01/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => true, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://backup-gateway-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://backup-gateway-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://backup-gateway.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://backup-gateway.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backup-gateway/2021-01-01/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.ap-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'ap-south-1', ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.ap-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'ap-south-1', ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.ap-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'ap-south-1', ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.ap-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ap-south-1', ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.eu-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'eu-south-1', ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.eu-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'eu-south-1', ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.eu-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'eu-south-1', ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.eu-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'eu-south-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.ca-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'ca-central-1', ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.ca-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'ca-central-1', ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.ca-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'ca-central-1', ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.ca-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ca-central-1', ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.eu-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'eu-central-1', ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.eu-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'eu-central-1', ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.eu-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'eu-central-1', ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.eu-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'eu-central-1', ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.us-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'us-west-1', ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-west-1', ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.us-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'us-west-1', ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.us-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-west-1', ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.us-west-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'us-west-2', ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-west-2', ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.us-west-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'us-west-2', ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-west-2', ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.af-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'af-south-1', ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.af-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'af-south-1', ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.af-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'af-south-1', ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.af-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'af-south-1', ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.eu-north-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'eu-north-1', ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.eu-north-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'eu-north-1', ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.eu-north-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'eu-north-1', ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.eu-north-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'eu-north-1', ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.eu-west-3.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'eu-west-3', ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.eu-west-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'eu-west-3', ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.eu-west-3.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'eu-west-3', ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.eu-west-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'eu-west-3', ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.eu-west-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'eu-west-2', ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.eu-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'eu-west-2', ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.eu-west-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'eu-west-2', ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.eu-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'eu-west-2', ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.eu-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'eu-west-1', ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.eu-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'eu-west-1', ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.eu-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'eu-west-1', ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.eu-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'eu-west-1', ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.ap-northeast-3.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'ap-northeast-3', ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'ap-northeast-3', ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.ap-northeast-3.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'ap-northeast-3', ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ap-northeast-3', ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.ap-northeast-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'ap-northeast-2', ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'ap-northeast-2', ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.ap-northeast-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'ap-northeast-2', ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ap-northeast-2', ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.ap-northeast-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'ap-northeast-1', ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'ap-northeast-1', ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.ap-northeast-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'ap-northeast-1', ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ap-northeast-1', ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.me-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'me-south-1', ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.me-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'me-south-1', ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.me-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'me-south-1', ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.me-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'me-south-1', ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.sa-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'sa-east-1', ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.sa-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'sa-east-1', ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.sa-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'sa-east-1', ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.sa-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'sa-east-1', ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.ap-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'ap-east-1', ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.ap-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'ap-east-1', ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.ap-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'ap-east-1', ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.ap-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ap-east-1', ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.us-gov-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'us-gov-west-1', ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-gov-west-1', ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.us-gov-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'us-gov-west-1', ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-gov-west-1', ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.ap-southeast-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'ap-southeast-1', ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'ap-southeast-1', ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.ap-southeast-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'ap-southeast-1', ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ap-southeast-1', ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.ap-southeast-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'ap-southeast-2', ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'ap-southeast-2', ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.ap-southeast-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'ap-southeast-2', ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'ap-southeast-2', ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.us-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.us-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.us-east-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'us-east-2', ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-east-2', ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.us-east-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'us-east-2', ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backup-gateway.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-east-2', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backup-gateway/2021-01-01/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backup-gateway/2021-01-01/paginators-1.json\nreturn [ 'pagination' => [ 'ListGateways' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'Gateways', ], 'ListHypervisors' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'Hypervisors', ], 'ListVirtualMachines' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'VirtualMachines', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backupstorage/2018-04-10/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2018-04-10', 'endpointPrefix' => 'backupstorage', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'AWS Backup Storage', 'serviceId' => 'BackupStorage', 'signatureVersion' => 'v4', 'signingName' => 'backup-storage', 'uid' => 'backupstorage-2018-04-10', ], 'operations' => [ 'DeleteObject' => [ 'name' => 'DeleteObject', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/backup-jobs/{jobId}/object/{objectName}', ], 'input' => [ 'shape' => 'DeleteObjectInput', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceInternalException', ], [ 'shape' => 'RetryableException', ], [ 'shape' => 'IllegalArgumentException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetChunk' => [ 'name' => 'GetChunk', 'http' => [ 'method' => 'GET', 'requestUri' => '/restore-jobs/{jobId}/chunk/{chunkToken}', ], 'input' => [ 'shape' => 'GetChunkInput', ], 'output' => [ 'shape' => 'GetChunkOutput', ], 'errors' => [ [ 'shape' => 'IllegalArgumentException', ], [ 'shape' => 'RetryableException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ServiceInternalException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'KMSInvalidKeyUsageException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetObjectMetadata' => [ 'name' => 'GetObjectMetadata', 'http' => [ 'method' => 'GET', 'requestUri' => '/restore-jobs/{jobId}/object/{objectToken}/metadata', ], 'input' => [ 'shape' => 'GetObjectMetadataInput', ], 'output' => [ 'shape' => 'GetObjectMetadataOutput', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceInternalException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'RetryableException', ], [ 'shape' => 'IllegalArgumentException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'KMSInvalidKeyUsageException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListChunks' => [ 'name' => 'ListChunks', 'http' => [ 'method' => 'GET', 'requestUri' => '/restore-jobs/{jobId}/chunks/{objectToken}/list', ], 'input' => [ 'shape' => 'ListChunksInput', ], 'output' => [ 'shape' => 'ListChunksOutput', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ServiceInternalException', ], [ 'shape' => 'RetryableException', ], [ 'shape' => 'IllegalArgumentException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListObjects' => [ 'name' => 'ListObjects', 'http' => [ 'method' => 'GET', 'requestUri' => '/restore-jobs/{jobId}/objects/list', ], 'input' => [ 'shape' => 'ListObjectsInput', ], 'output' => [ 'shape' => 'ListObjectsOutput', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceInternalException', ], [ 'shape' => 'RetryableException', ], [ 'shape' => 'IllegalArgumentException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'KMSInvalidKeyUsageException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'NotifyObjectComplete' => [ 'name' => 'NotifyObjectComplete', 'http' => [ 'method' => 'PUT', 'requestUri' => '/backup-jobs/{jobId}/object/{uploadId}/complete', ], 'input' => [ 'shape' => 'NotifyObjectCompleteInput', ], 'output' => [ 'shape' => 'NotifyObjectCompleteOutput', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceInternalException', ], [ 'shape' => 'NotReadableInputStreamException', ], [ 'shape' => 'RetryableException', ], [ 'shape' => 'IllegalArgumentException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'KMSInvalidKeyUsageException', ], [ 'shape' => 'AccessDeniedException', ], ], 'authtype' => 'v4-unsigned-body', ], 'PutChunk' => [ 'name' => 'PutChunk', 'http' => [ 'method' => 'PUT', 'requestUri' => '/backup-jobs/{jobId}/chunk/{uploadId}/{chunkIndex}', ], 'input' => [ 'shape' => 'PutChunkInput', ], 'output' => [ 'shape' => 'PutChunkOutput', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceInternalException', ], [ 'shape' => 'NotReadableInputStreamException', ], [ 'shape' => 'RetryableException', ], [ 'shape' => 'IllegalArgumentException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'KMSInvalidKeyUsageException', ], [ 'shape' => 'AccessDeniedException', ], ], 'authtype' => 'v4-unsigned-body', ], 'PutObject' => [ 'name' => 'PutObject', 'http' => [ 'method' => 'PUT', 'requestUri' => '/backup-jobs/{jobId}/object/{objectName}/put-object', ], 'input' => [ 'shape' => 'PutObjectInput', ], 'output' => [ 'shape' => 'PutObjectOutput', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceInternalException', ], [ 'shape' => 'NotReadableInputStreamException', ], [ 'shape' => 'RetryableException', ], [ 'shape' => 'IllegalArgumentException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'KMSInvalidKeyUsageException', ], [ 'shape' => 'AccessDeniedException', ], ], 'authtype' => 'v4-unsigned-body', ], 'StartObject' => [ 'name' => 'StartObject', 'http' => [ 'method' => 'PUT', 'requestUri' => '/backup-jobs/{jobId}/object/{objectName}', ], 'input' => [ 'shape' => 'StartObjectInput', ], 'output' => [ 'shape' => 'StartObjectOutput', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceInternalException', ], [ 'shape' => 'RetryableException', ], [ 'shape' => 'IllegalArgumentException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'DataAlreadyExistsException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ServiceErrorMessage', ], ], 'error' => [ 'httpStatusCode' => 403, ], 'exception' => true, 'synthetic' => true, ], 'BackupObject' => [ 'type' => 'structure', 'required' => [ 'Name', 'ObjectChecksum', 'ObjectChecksumAlgorithm', 'ObjectToken', ], 'members' => [ 'Name' => [ 'shape' => 'string', ], 'ChunksCount' => [ 'shape' => 'OptionalLong', ], 'MetadataString' => [ 'shape' => 'string', ], 'ObjectChecksum' => [ 'shape' => 'string', ], 'ObjectChecksumAlgorithm' => [ 'shape' => 'SummaryChecksumAlgorithm', ], 'ObjectToken' => [ 'shape' => 'string', ], ], ], 'Chunk' => [ 'type' => 'structure', 'required' => [ 'Index', 'Length', 'Checksum', 'ChecksumAlgorithm', 'ChunkToken', ], 'members' => [ 'Index' => [ 'shape' => 'long', ], 'Length' => [ 'shape' => 'long', ], 'Checksum' => [ 'shape' => 'string', ], 'ChecksumAlgorithm' => [ 'shape' => 'DataChecksumAlgorithm', ], 'ChunkToken' => [ 'shape' => 'string', ], ], ], 'ChunkList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Chunk', ], ], 'DataAlreadyExistsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'string', ], 'Checksum' => [ 'shape' => 'string', ], 'ChecksumAlgorithm' => [ 'shape' => 'string', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'DataChecksumAlgorithm' => [ 'type' => 'string', 'enum' => [ 'SHA256', ], ], 'DeleteObjectInput' => [ 'type' => 'structure', 'required' => [ 'BackupJobId', 'ObjectName', ], 'members' => [ 'BackupJobId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'jobId', ], 'ObjectName' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'objectName', ], ], ], 'GetChunkInput' => [ 'type' => 'structure', 'required' => [ 'StorageJobId', 'ChunkToken', ], 'members' => [ 'StorageJobId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'jobId', ], 'ChunkToken' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'chunkToken', ], ], ], 'GetChunkOutput' => [ 'type' => 'structure', 'required' => [ 'Data', 'Length', 'Checksum', 'ChecksumAlgorithm', ], 'members' => [ 'Data' => [ 'shape' => 'PayloadBlob', ], 'Length' => [ 'shape' => 'long', 'location' => 'header', 'locationName' => 'x-amz-data-length', ], 'Checksum' => [ 'shape' => 'string', 'location' => 'header', 'locationName' => 'x-amz-checksum', ], 'ChecksumAlgorithm' => [ 'shape' => 'DataChecksumAlgorithm', 'location' => 'header', 'locationName' => 'x-amz-checksum-algorithm', ], ], 'payload' => 'Data', ], 'GetObjectMetadataInput' => [ 'type' => 'structure', 'required' => [ 'StorageJobId', 'ObjectToken', ], 'members' => [ 'StorageJobId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'jobId', ], 'ObjectToken' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'objectToken', ], ], ], 'GetObjectMetadataOutput' => [ 'type' => 'structure', 'members' => [ 'MetadataString' => [ 'shape' => 'string', 'location' => 'header', 'locationName' => 'x-amz-metadata-string', ], 'MetadataBlob' => [ 'shape' => 'PayloadBlob', ], 'MetadataBlobLength' => [ 'shape' => 'long', 'location' => 'header', 'locationName' => 'x-amz-data-length', ], 'MetadataBlobChecksum' => [ 'shape' => 'string', 'location' => 'header', 'locationName' => 'x-amz-checksum', ], 'MetadataBlobChecksumAlgorithm' => [ 'shape' => 'DataChecksumAlgorithm', 'location' => 'header', 'locationName' => 'x-amz-checksum-algorithm', ], ], 'payload' => 'MetadataBlob', ], 'IllegalArgumentException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'string', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'KMSInvalidKeyUsageException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'string', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ListChunksInput' => [ 'type' => 'structure', 'required' => [ 'StorageJobId', 'ObjectToken', ], 'members' => [ 'StorageJobId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'jobId', ], 'ObjectToken' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'objectToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListChunksOutput' => [ 'type' => 'structure', 'required' => [ 'ChunkList', ], 'members' => [ 'ChunkList' => [ 'shape' => 'ChunkList', ], 'NextToken' => [ 'shape' => 'string', ], ], ], 'ListObjectsInput' => [ 'type' => 'structure', 'required' => [ 'StorageJobId', ], 'members' => [ 'StorageJobId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'jobId', ], 'StartingObjectName' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'starting-object-name', ], 'StartingObjectPrefix' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'starting-object-prefix', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'next-token', ], 'CreatedBefore' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'created-before', ], 'CreatedAfter' => [ 'shape' => 'timestamp', 'location' => 'querystring', 'locationName' => 'created-after', ], ], ], 'ListObjectsOutput' => [ 'type' => 'structure', 'required' => [ 'ObjectList', ], 'members' => [ 'ObjectList' => [ 'shape' => 'ObjectList', ], 'NextToken' => [ 'shape' => 'string', ], ], ], 'MaxResults' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'MetadataString' => [ 'type' => 'string', 'pattern' => '^.{1,256}$', ], 'NotReadableInputStreamException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'string', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'NotifyObjectCompleteInput' => [ 'type' => 'structure', 'required' => [ 'BackupJobId', 'UploadId', 'ObjectChecksum', 'ObjectChecksumAlgorithm', ], 'members' => [ 'BackupJobId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'jobId', ], 'UploadId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'uploadId', ], 'ObjectChecksum' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'checksum', ], 'ObjectChecksumAlgorithm' => [ 'shape' => 'SummaryChecksumAlgorithm', 'location' => 'querystring', 'locationName' => 'checksum-algorithm', ], 'MetadataString' => [ 'shape' => 'MetadataString', 'location' => 'querystring', 'locationName' => 'metadata-string', ], 'MetadataBlob' => [ 'shape' => 'PayloadBlob', ], 'MetadataBlobLength' => [ 'shape' => 'long', 'location' => 'querystring', 'locationName' => 'metadata-blob-length', ], 'MetadataBlobChecksum' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'metadata-checksum', ], 'MetadataBlobChecksumAlgorithm' => [ 'shape' => 'DataChecksumAlgorithm', 'location' => 'querystring', 'locationName' => 'metadata-checksum-algorithm', ], ], 'payload' => 'MetadataBlob', ], 'NotifyObjectCompleteOutput' => [ 'type' => 'structure', 'required' => [ 'ObjectChecksum', 'ObjectChecksumAlgorithm', ], 'members' => [ 'ObjectChecksum' => [ 'shape' => 'string', ], 'ObjectChecksumAlgorithm' => [ 'shape' => 'SummaryChecksumAlgorithm', ], ], ], 'ObjectList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BackupObject', ], ], 'OptionalLong' => [ 'type' => 'long', ], 'PayloadBlob' => [ 'type' => 'blob', 'streaming' => true, ], 'PutChunkInput' => [ 'type' => 'structure', 'required' => [ 'BackupJobId', 'UploadId', 'ChunkIndex', 'Data', 'Length', 'Checksum', 'ChecksumAlgorithm', ], 'members' => [ 'BackupJobId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'jobId', ], 'UploadId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'uploadId', ], 'ChunkIndex' => [ 'shape' => 'long', 'location' => 'uri', 'locationName' => 'chunkIndex', ], 'Data' => [ 'shape' => 'PayloadBlob', ], 'Length' => [ 'shape' => 'long', 'location' => 'querystring', 'locationName' => 'length', ], 'Checksum' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'checksum', ], 'ChecksumAlgorithm' => [ 'shape' => 'DataChecksumAlgorithm', 'location' => 'querystring', 'locationName' => 'checksum-algorithm', ], ], 'payload' => 'Data', ], 'PutChunkOutput' => [ 'type' => 'structure', 'required' => [ 'ChunkChecksum', 'ChunkChecksumAlgorithm', ], 'members' => [ 'ChunkChecksum' => [ 'shape' => 'string', ], 'ChunkChecksumAlgorithm' => [ 'shape' => 'DataChecksumAlgorithm', ], ], ], 'PutObjectInput' => [ 'type' => 'structure', 'required' => [ 'BackupJobId', 'ObjectName', ], 'members' => [ 'BackupJobId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'jobId', ], 'ObjectName' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'objectName', ], 'MetadataString' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'metadata-string', ], 'InlineChunk' => [ 'shape' => 'PayloadBlob', ], 'InlineChunkLength' => [ 'shape' => 'long', 'location' => 'querystring', 'locationName' => 'length', ], 'InlineChunkChecksum' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'checksum', ], 'InlineChunkChecksumAlgorithm' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'checksum-algorithm', ], 'ObjectChecksum' => [ 'shape' => 'string', 'location' => 'querystring', 'locationName' => 'object-checksum', ], 'ObjectChecksumAlgorithm' => [ 'shape' => 'SummaryChecksumAlgorithm', 'location' => 'querystring', 'locationName' => 'object-checksum-algorithm', ], 'ThrowOnDuplicate' => [ 'shape' => 'boolean', 'location' => 'querystring', 'locationName' => 'throwOnDuplicate', ], ], 'payload' => 'InlineChunk', ], 'PutObjectOutput' => [ 'type' => 'structure', 'required' => [ 'InlineChunkChecksum', 'InlineChunkChecksumAlgorithm', 'ObjectChecksum', 'ObjectChecksumAlgorithm', ], 'members' => [ 'InlineChunkChecksum' => [ 'shape' => 'string', ], 'InlineChunkChecksumAlgorithm' => [ 'shape' => 'DataChecksumAlgorithm', ], 'ObjectChecksum' => [ 'shape' => 'string', ], 'ObjectChecksumAlgorithm' => [ 'shape' => 'SummaryChecksumAlgorithm', ], ], ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'string', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'RetryableException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'string', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, ], 'ServiceErrorMessage' => [ 'type' => 'string', ], 'ServiceInternalException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'string', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'ServiceUnavailableException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'string', ], ], 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], 'StartObjectInput' => [ 'type' => 'structure', 'required' => [ 'BackupJobId', 'ObjectName', ], 'members' => [ 'BackupJobId' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'jobId', ], 'ObjectName' => [ 'shape' => 'string', 'location' => 'uri', 'locationName' => 'objectName', ], 'ThrowOnDuplicate' => [ 'shape' => 'boolean', ], ], ], 'StartObjectOutput' => [ 'type' => 'structure', 'required' => [ 'UploadId', ], 'members' => [ 'UploadId' => [ 'shape' => 'string', ], ], ], 'SummaryChecksumAlgorithm' => [ 'type' => 'string', 'enum' => [ 'SUMMARY', ], ], 'ThrottlingException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'string', ], ], 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], 'boolean' => [ 'type' => 'boolean', ], 'long' => [ 'type' => 'long', ], 'string' => [ 'type' => 'string', ], 'timestamp' => [ 'type' => 'timestamp', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backupstorage/2018-04-10/docs-2.json\nreturn [ 'version' => '2.0', 'service' => 'The frontend service for Cryo Storage.', 'operations' => [ 'DeleteObject' => 'Delete Object from the incremental base Backup.', 'GetChunk' => 'Gets the specified object\\'s chunk.', 'GetObjectMetadata' => 'Get metadata associated with an Object.', 'ListChunks' => 'List chunks in a given Object', 'ListObjects' => 'List all Objects in a given Backup.', 'NotifyObjectComplete' => 'Complete upload', 'PutChunk' => 'Upload chunk.', 'PutObject' => 'Upload object that can store object metadata String and data blob in single API call using inline chunk field.', 'StartObject' => 'Start upload containing one or many chunks.', ], 'shapes' => [ 'AccessDeniedException' => [ 'base' => NULL, 'refs' => [], ], 'BackupObject' => [ 'base' => 'Object', 'refs' => [ 'ObjectList$member' => NULL, ], ], 'Chunk' => [ 'base' => 'Chunk', 'refs' => [ 'ChunkList$member' => NULL, ], ], 'ChunkList' => [ 'base' => NULL, 'refs' => [ 'ListChunksOutput$ChunkList' => 'List of chunks', ], ], 'DataAlreadyExistsException' => [ 'base' => 'Non-retryable exception. Attempted to create already existing object or chunk. This message contains a checksum of already presented data.', 'refs' => [], ], 'DataChecksumAlgorithm' => [ 'base' => NULL, 'refs' => [ 'Chunk$ChecksumAlgorithm' => 'Checksum algorithm', 'GetChunkOutput$ChecksumAlgorithm' => 'Checksum algorithm', 'GetObjectMetadataOutput$MetadataBlobChecksumAlgorithm' => 'Checksum algorithm.', 'NotifyObjectCompleteInput$MetadataBlobChecksumAlgorithm' => 'Checksum algorithm.', 'PutChunkInput$ChecksumAlgorithm' => 'Checksum algorithm', 'PutChunkOutput$ChunkChecksumAlgorithm' => 'Checksum algorithm', 'PutObjectOutput$InlineChunkChecksumAlgorithm' => 'Inline chunk checksum algorithm', ], ], 'DeleteObjectInput' => [ 'base' => NULL, 'refs' => [], ], 'GetChunkInput' => [ 'base' => NULL, 'refs' => [], ], 'GetChunkOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetObjectMetadataInput' => [ 'base' => NULL, 'refs' => [], ], 'GetObjectMetadataOutput' => [ 'base' => NULL, 'refs' => [], ], 'IllegalArgumentException' => [ 'base' => 'Non-retryable exception, indicates client error (wrong argument passed to API). See exception message for details.', 'refs' => [], ], 'KMSInvalidKeyUsageException' => [ 'base' => 'Non-retryable exception. Indicates the KMS key usage is incorrect. See exception message for details.', 'refs' => [], ], 'ListChunksInput' => [ 'base' => NULL, 'refs' => [], ], 'ListChunksOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListObjectsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListObjectsOutput' => [ 'base' => NULL, 'refs' => [], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'ListChunksInput$MaxResults' => 'Maximum number of chunks', 'ListObjectsInput$MaxResults' => 'Maximum objects count', ], ], 'MetadataString' => [ 'base' => NULL, 'refs' => [ 'NotifyObjectCompleteInput$MetadataString' => 'Optional metadata associated with an Object. Maximum string length is 256 bytes.', ], ], 'NotReadableInputStreamException' => [ 'base' => 'Retryalble exception. Indicated issues while reading an input stream due to the networking issues or connection drop on the client side.', 'refs' => [], ], 'NotifyObjectCompleteInput' => [ 'base' => NULL, 'refs' => [], ], 'NotifyObjectCompleteOutput' => [ 'base' => NULL, 'refs' => [], ], 'ObjectList' => [ 'base' => NULL, 'refs' => [ 'ListObjectsOutput$ObjectList' => 'Object list', ], ], 'OptionalLong' => [ 'base' => NULL, 'refs' => [ 'BackupObject$ChunksCount' => 'Number of chunks in object', ], ], 'PayloadBlob' => [ 'base' => NULL, 'refs' => [ 'GetChunkOutput$Data' => 'Chunk data', 'GetObjectMetadataOutput$MetadataBlob' => 'Metadata blob.', 'NotifyObjectCompleteInput$MetadataBlob' => 'Optional metadata associated with an Object. Maximum length is 4MB.', 'PutChunkInput$Data' => 'Data to be uploaded', 'PutObjectInput$InlineChunk' => 'Inline chunk data to be uploaded.', ], ], 'PutChunkInput' => [ 'base' => NULL, 'refs' => [], ], 'PutChunkOutput' => [ 'base' => NULL, 'refs' => [], ], 'PutObjectInput' => [ 'base' => NULL, 'refs' => [], ], 'PutObjectOutput' => [ 'base' => NULL, 'refs' => [], ], 'ResourceNotFoundException' => [ 'base' => 'Non-retryable exception. Attempted to make an operation on non-existing or expired resource.', 'refs' => [], ], 'RetryableException' => [ 'base' => 'Retryable exception. In general indicates internal failure that can be fixed by retry.', 'refs' => [], ], 'ServiceErrorMessage' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$Message' => NULL, ], ], 'ServiceInternalException' => [ 'base' => 'Deprecated. To be removed from the model.', 'refs' => [], ], 'ServiceUnavailableException' => [ 'base' => 'Retryable exception, indicates internal server error.', 'refs' => [], ], 'StartObjectInput' => [ 'base' => NULL, 'refs' => [], ], 'StartObjectOutput' => [ 'base' => NULL, 'refs' => [], ], 'SummaryChecksumAlgorithm' => [ 'base' => NULL, 'refs' => [ 'BackupObject$ObjectChecksumAlgorithm' => 'Checksum algorithm', 'NotifyObjectCompleteInput$ObjectChecksumAlgorithm' => 'Checksum algorithm', 'NotifyObjectCompleteOutput$ObjectChecksumAlgorithm' => 'Checksum algorithm', 'PutObjectInput$ObjectChecksumAlgorithm' => 'object checksum algorithm', 'PutObjectOutput$ObjectChecksumAlgorithm' => 'object checksum algorithm', ], ], 'ThrottlingException' => [ 'base' => 'Increased rate over throttling limits. Can be retried with exponential backoff.', 'refs' => [], ], 'boolean' => [ 'base' => NULL, 'refs' => [ 'PutObjectInput$ThrowOnDuplicate' => 'Throw an exception if Object name is already exist.', 'StartObjectInput$ThrowOnDuplicate' => 'Throw an exception if Object name is already exist.', ], ], 'long' => [ 'base' => NULL, 'refs' => [ 'Chunk$Index' => 'Chunk index', 'Chunk$Length' => 'Chunk length', 'GetChunkOutput$Length' => 'Data length', 'GetObjectMetadataOutput$MetadataBlobLength' => 'The size of MetadataBlob.', 'NotifyObjectCompleteInput$MetadataBlobLength' => 'The size of MetadataBlob.', 'PutChunkInput$ChunkIndex' => 'Describes this chunk\\'s position relative to the other chunks', 'PutChunkInput$Length' => 'Data length', 'PutObjectInput$InlineChunkLength' => 'Length of the inline chunk data.', ], ], 'string' => [ 'base' => NULL, 'refs' => [ 'BackupObject$Name' => 'Object name', 'BackupObject$MetadataString' => 'Metadata string associated with the Object', 'BackupObject$ObjectChecksum' => 'Object checksum', 'BackupObject$ObjectToken' => 'Object token', 'Chunk$Checksum' => 'Chunk checksum', 'Chunk$ChunkToken' => 'Chunk token', 'DataAlreadyExistsException$Message' => NULL, 'DataAlreadyExistsException$Checksum' => 'Data checksum used', 'DataAlreadyExistsException$ChecksumAlgorithm' => 'Checksum algorithm used', 'DeleteObjectInput$BackupJobId' => 'Backup job Id for the in-progress backup.', 'DeleteObjectInput$ObjectName' => 'The name of the Object.', 'GetChunkInput$StorageJobId' => 'Storage job id', 'GetChunkInput$ChunkToken' => 'Chunk token', 'GetChunkOutput$Checksum' => 'Data checksum', 'GetObjectMetadataInput$StorageJobId' => 'Backup job id for the in-progress backup.', 'GetObjectMetadataInput$ObjectToken' => 'Object token.', 'GetObjectMetadataOutput$MetadataString' => 'Metadata string.', 'GetObjectMetadataOutput$MetadataBlobChecksum' => 'MetadataBlob checksum.', 'IllegalArgumentException$Message' => NULL, 'KMSInvalidKeyUsageException$Message' => NULL, 'ListChunksInput$StorageJobId' => 'Storage job id', 'ListChunksInput$ObjectToken' => 'Object token', 'ListChunksInput$NextToken' => 'Pagination token', 'ListChunksOutput$NextToken' => 'Pagination token', 'ListObjectsInput$StorageJobId' => 'Storage job id', 'ListObjectsInput$StartingObjectName' => 'Optional, specifies the starting Object name to list from. Ignored if NextToken is not NULL', 'ListObjectsInput$StartingObjectPrefix' => 'Optional, specifies the starting Object prefix to list from. Ignored if NextToken is not NULL', 'ListObjectsInput$NextToken' => 'Pagination token', 'ListObjectsOutput$NextToken' => 'Pagination token', 'NotReadableInputStreamException$Message' => NULL, 'NotifyObjectCompleteInput$BackupJobId' => 'Backup job Id for the in-progress backup', 'NotifyObjectCompleteInput$UploadId' => 'Upload Id for the in-progress upload', 'NotifyObjectCompleteInput$ObjectChecksum' => 'Object checksum', 'NotifyObjectCompleteInput$MetadataBlobChecksum' => 'Checksum of MetadataBlob.', 'NotifyObjectCompleteOutput$ObjectChecksum' => 'Object checksum', 'PutChunkInput$BackupJobId' => 'Backup job Id for the in-progress backup.', 'PutChunkInput$UploadId' => 'Upload Id for the in-progress upload.', 'PutChunkInput$Checksum' => 'Data checksum', 'PutChunkOutput$ChunkChecksum' => 'Chunk checksum', 'PutObjectInput$BackupJobId' => 'Backup job Id for the in-progress backup.', 'PutObjectInput$ObjectName' => 'The name of the Object to be uploaded.', 'PutObjectInput$MetadataString' => 'Store user defined metadata like backup checksum, disk ids, restore metadata etc.', 'PutObjectInput$InlineChunkChecksum' => 'Inline chunk checksum', 'PutObjectInput$InlineChunkChecksumAlgorithm' => 'Inline chunk checksum algorithm', 'PutObjectInput$ObjectChecksum' => 'object checksum', 'PutObjectOutput$InlineChunkChecksum' => 'Inline chunk checksum', 'PutObjectOutput$ObjectChecksum' => 'object checksum', 'ResourceNotFoundException$Message' => NULL, 'RetryableException$Message' => NULL, 'ServiceInternalException$Message' => NULL, 'ServiceUnavailableException$Message' => NULL, 'StartObjectInput$BackupJobId' => 'Backup job Id for the in-progress backup', 'StartObjectInput$ObjectName' => 'Name for the object.', 'StartObjectOutput$UploadId' => 'Upload Id for a given upload.', 'ThrottlingException$Message' => NULL, ], ], 'timestamp' => [ 'base' => NULL, 'refs' => [ 'ListObjectsInput$CreatedBefore' => '(Optional) Created before filter', 'ListObjectsInput$CreatedAfter' => '(Optional) Created after filter', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backupstorage/2018-04-10/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], [ 'fn' => 'parseURL', 'argv' => [ [ 'ref' => 'Endpoint', ], ], 'assign' => 'url', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://backupstorage-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://backupstorage-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://backupstorage.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://backupstorage.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backupstorage/2018-04-10/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backupstorage-fips.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backupstorage-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backupstorage.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backupstorage.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backupstorage-fips.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backupstorage-fips.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backupstorage.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backupstorage.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backupstorage-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backupstorage-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backupstorage.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backupstorage.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backupstorage-fips.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backupstorage-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backupstorage.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://backupstorage.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backupstorage/2018-04-10/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/backupstorage/2018-04-10/paginators-1.json\nreturn [ 'pagination' => [ 'ListChunks' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListObjects' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/batch/2016-08-10/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2016-08-10', 'endpointPrefix' => 'batch', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceAbbreviation' => 'AWS Batch', 'serviceFullName' => 'AWS Batch', 'serviceId' => 'Batch', 'signatureVersion' => 'v4', 'uid' => 'batch-2016-08-10', ], 'operations' => [ 'CancelJob' => [ 'name' => 'CancelJob', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/canceljob', ], 'input' => [ 'shape' => 'CancelJobRequest', ], 'output' => [ 'shape' => 'CancelJobResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'CreateComputeEnvironment' => [ 'name' => 'CreateComputeEnvironment', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/createcomputeenvironment', ], 'input' => [ 'shape' => 'CreateComputeEnvironmentRequest', ], 'output' => [ 'shape' => 'CreateComputeEnvironmentResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'CreateJobQueue' => [ 'name' => 'CreateJobQueue', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/createjobqueue', ], 'input' => [ 'shape' => 'CreateJobQueueRequest', ], 'output' => [ 'shape' => 'CreateJobQueueResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'CreateSchedulingPolicy' => [ 'name' => 'CreateSchedulingPolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/createschedulingpolicy', ], 'input' => [ 'shape' => 'CreateSchedulingPolicyRequest', ], 'output' => [ 'shape' => 'CreateSchedulingPolicyResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'DeleteComputeEnvironment' => [ 'name' => 'DeleteComputeEnvironment', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/deletecomputeenvironment', ], 'input' => [ 'shape' => 'DeleteComputeEnvironmentRequest', ], 'output' => [ 'shape' => 'DeleteComputeEnvironmentResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'DeleteJobQueue' => [ 'name' => 'DeleteJobQueue', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/deletejobqueue', ], 'input' => [ 'shape' => 'DeleteJobQueueRequest', ], 'output' => [ 'shape' => 'DeleteJobQueueResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'DeleteSchedulingPolicy' => [ 'name' => 'DeleteSchedulingPolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/deleteschedulingpolicy', ], 'input' => [ 'shape' => 'DeleteSchedulingPolicyRequest', ], 'output' => [ 'shape' => 'DeleteSchedulingPolicyResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'DeregisterJobDefinition' => [ 'name' => 'DeregisterJobDefinition', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/deregisterjobdefinition', ], 'input' => [ 'shape' => 'DeregisterJobDefinitionRequest', ], 'output' => [ 'shape' => 'DeregisterJobDefinitionResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'DescribeComputeEnvironments' => [ 'name' => 'DescribeComputeEnvironments', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/describecomputeenvironments', ], 'input' => [ 'shape' => 'DescribeComputeEnvironmentsRequest', ], 'output' => [ 'shape' => 'DescribeComputeEnvironmentsResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'DescribeJobDefinitions' => [ 'name' => 'DescribeJobDefinitions', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/describejobdefinitions', ], 'input' => [ 'shape' => 'DescribeJobDefinitionsRequest', ], 'output' => [ 'shape' => 'DescribeJobDefinitionsResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'DescribeJobQueues' => [ 'name' => 'DescribeJobQueues', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/describejobqueues', ], 'input' => [ 'shape' => 'DescribeJobQueuesRequest', ], 'output' => [ 'shape' => 'DescribeJobQueuesResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'DescribeJobs' => [ 'name' => 'DescribeJobs', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/describejobs', ], 'input' => [ 'shape' => 'DescribeJobsRequest', ], 'output' => [ 'shape' => 'DescribeJobsResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'DescribeSchedulingPolicies' => [ 'name' => 'DescribeSchedulingPolicies', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/describeschedulingpolicies', ], 'input' => [ 'shape' => 'DescribeSchedulingPoliciesRequest', ], 'output' => [ 'shape' => 'DescribeSchedulingPoliciesResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'ListJobs' => [ 'name' => 'ListJobs', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/listjobs', ], 'input' => [ 'shape' => 'ListJobsRequest', ], 'output' => [ 'shape' => 'ListJobsResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'ListSchedulingPolicies' => [ 'name' => 'ListSchedulingPolicies', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/listschedulingpolicies', ], 'input' => [ 'shape' => 'ListSchedulingPoliciesRequest', ], 'output' => [ 'shape' => 'ListSchedulingPoliciesResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/v1/tags/{resourceArn}', ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'RegisterJobDefinition' => [ 'name' => 'RegisterJobDefinition', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/registerjobdefinition', ], 'input' => [ 'shape' => 'RegisterJobDefinitionRequest', ], 'output' => [ 'shape' => 'RegisterJobDefinitionResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'SubmitJob' => [ 'name' => 'SubmitJob', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/submitjob', ], 'input' => [ 'shape' => 'SubmitJobRequest', ], 'output' => [ 'shape' => 'SubmitJobResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/tags/{resourceArn}', ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'TerminateJob' => [ 'name' => 'TerminateJob', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/terminatejob', ], 'input' => [ 'shape' => 'TerminateJobRequest', ], 'output' => [ 'shape' => 'TerminateJobResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/v1/tags/{resourceArn}', ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'UpdateComputeEnvironment' => [ 'name' => 'UpdateComputeEnvironment', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/updatecomputeenvironment', ], 'input' => [ 'shape' => 'UpdateComputeEnvironmentRequest', ], 'output' => [ 'shape' => 'UpdateComputeEnvironmentResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'UpdateJobQueue' => [ 'name' => 'UpdateJobQueue', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/updatejobqueue', ], 'input' => [ 'shape' => 'UpdateJobQueueRequest', ], 'output' => [ 'shape' => 'UpdateJobQueueResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], 'UpdateSchedulingPolicy' => [ 'name' => 'UpdateSchedulingPolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/v1/updateschedulingpolicy', ], 'input' => [ 'shape' => 'UpdateSchedulingPolicyRequest', ], 'output' => [ 'shape' => 'UpdateSchedulingPolicyResponse', ], 'errors' => [ [ 'shape' => 'ClientException', ], [ 'shape' => 'ServerException', ], ], ], ], 'shapes' => [ 'ArrayJobDependency' => [ 'type' => 'string', 'enum' => [ 'N_TO_N', 'SEQUENTIAL', ], ], 'ArrayJobStatusSummary' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'Integer', ], ], 'ArrayProperties' => [ 'type' => 'structure', 'members' => [ 'size' => [ 'shape' => 'Integer', ], ], ], 'ArrayPropertiesDetail' => [ 'type' => 'structure', 'members' => [ 'statusSummary' => [ 'shape' => 'ArrayJobStatusSummary', ], 'size' => [ 'shape' => 'Integer', ], 'index' => [ 'shape' => 'Integer', ], ], ], 'ArrayPropertiesSummary' => [ 'type' => 'structure', 'members' => [ 'size' => [ 'shape' => 'Integer', ], 'index' => [ 'shape' => 'Integer', ], ], ], 'AssignPublicIp' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'DISABLED', ], ], 'AttemptContainerDetail' => [ 'type' => 'structure', 'members' => [ 'containerInstanceArn' => [ 'shape' => 'String', ], 'taskArn' => [ 'shape' => 'String', ], 'exitCode' => [ 'shape' => 'Integer', ], 'reason' => [ 'shape' => 'String', ], 'logStreamName' => [ 'shape' => 'String', ], 'networkInterfaces' => [ 'shape' => 'NetworkInterfaceList', ], ], ], 'AttemptDetail' => [ 'type' => 'structure', 'members' => [ 'container' => [ 'shape' => 'AttemptContainerDetail', ], 'startedAt' => [ 'shape' => 'Long', ], 'stoppedAt' => [ 'shape' => 'Long', ], 'statusReason' => [ 'shape' => 'String', ], ], ], 'AttemptDetails' => [ 'type' => 'list', 'member' => [ 'shape' => 'AttemptDetail', ], ], 'Boolean' => [ 'type' => 'boolean', ], 'CEState' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'DISABLED', ], ], 'CEStatus' => [ 'type' => 'string', 'enum' => [ 'CREATING', 'UPDATING', 'DELETING', 'DELETED', 'VALID', 'INVALID', ], ], 'CEType' => [ 'type' => 'string', 'enum' => [ 'MANAGED', 'UNMANAGED', ], ], 'CRAllocationStrategy' => [ 'type' => 'string', 'enum' => [ 'BEST_FIT', 'BEST_FIT_PROGRESSIVE', 'SPOT_CAPACITY_OPTIMIZED', ], ], 'CRType' => [ 'type' => 'string', 'enum' => [ 'EC2', 'SPOT', 'FARGATE', 'FARGATE_SPOT', ], ], 'CRUpdateAllocationStrategy' => [ 'type' => 'string', 'enum' => [ 'BEST_FIT_PROGRESSIVE', 'SPOT_CAPACITY_OPTIMIZED', ], ], 'CancelJobRequest' => [ 'type' => 'structure', 'required' => [ 'jobId', 'reason', ], 'members' => [ 'jobId' => [ 'shape' => 'String', ], 'reason' => [ 'shape' => 'String', ], ], ], 'CancelJobResponse' => [ 'type' => 'structure', 'members' => [], ], 'ClientException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ComputeEnvironmentDetail' => [ 'type' => 'structure', 'required' => [ 'computeEnvironmentName', 'computeEnvironmentArn', ], 'members' => [ 'computeEnvironmentName' => [ 'shape' => 'String', ], 'computeEnvironmentArn' => [ 'shape' => 'String', ], 'unmanagedvCpus' => [ 'shape' => 'Integer', ], 'ecsClusterArn' => [ 'shape' => 'String', ], 'tags' => [ 'shape' => 'TagrisTagsMap', ], 'type' => [ 'shape' => 'CEType', ], 'state' => [ 'shape' => 'CEState', ], 'status' => [ 'shape' => 'CEStatus', ], 'statusReason' => [ 'shape' => 'String', ], 'computeResources' => [ 'shape' => 'ComputeResource', ], 'serviceRole' => [ 'shape' => 'String', ], 'updatePolicy' => [ 'shape' => 'UpdatePolicy', ], 'eksConfiguration' => [ 'shape' => 'EksConfiguration', ], 'containerOrchestrationType' => [ 'shape' => 'OrchestrationType', ], 'uuid' => [ 'shape' => 'String', ], ], ], 'ComputeEnvironmentDetailList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ComputeEnvironmentDetail', ], ], 'ComputeEnvironmentOrder' => [ 'type' => 'structure', 'required' => [ 'order', 'computeEnvironment', ], 'members' => [ 'order' => [ 'shape' => 'Integer', ], 'computeEnvironment' => [ 'shape' => 'String', ], ], ], 'ComputeEnvironmentOrders' => [ 'type' => 'list', 'member' => [ 'shape' => 'ComputeEnvironmentOrder', ], ], 'ComputeResource' => [ 'type' => 'structure', 'required' => [ 'type', 'maxvCpus', 'subnets', ], 'members' => [ 'type' => [ 'shape' => 'CRType', ], 'allocationStrategy' => [ 'shape' => 'CRAllocationStrategy', ], 'minvCpus' => [ 'shape' => 'Integer', ], 'maxvCpus' => [ 'shape' => 'Integer', ], 'desiredvCpus' => [ 'shape' => 'Integer', ], 'instanceTypes' => [ 'shape' => 'StringList', ], 'imageId' => [ 'shape' => 'String', 'deprecated' => true, 'deprecatedMessage' => 'This field is deprecated, use ec2Configuration[].imageIdOverride instead.', ], 'subnets' => [ 'shape' => 'StringList', ], 'securityGroupIds' => [ 'shape' => 'StringList', ], 'ec2KeyPair' => [ 'shape' => 'String', ], 'instanceRole' => [ 'shape' => 'String', ], 'tags' => [ 'shape' => 'TagsMap', ], 'placementGroup' => [ 'shape' => 'String', ], 'bidPercentage' => [ 'shape' => 'Integer', ], 'spotIamFleetRole' => [ 'shape' => 'String', ], 'launchTemplate' => [ 'shape' => 'LaunchTemplateSpecification', ], 'ec2Configuration' => [ 'shape' => 'Ec2ConfigurationList', ], ], ], 'ComputeResourceUpdate' => [ 'type' => 'structure', 'members' => [ 'minvCpus' => [ 'shape' => 'Integer', ], 'maxvCpus' => [ 'shape' => 'Integer', ], 'desiredvCpus' => [ 'shape' => 'Integer', ], 'subnets' => [ 'shape' => 'StringList', ], 'securityGroupIds' => [ 'shape' => 'StringList', ], 'allocationStrategy' => [ 'shape' => 'CRUpdateAllocationStrategy', ], 'instanceTypes' => [ 'shape' => 'StringList', ], 'ec2KeyPair' => [ 'shape' => 'String', ], 'instanceRole' => [ 'shape' => 'String', ], 'tags' => [ 'shape' => 'TagsMap', ], 'placementGroup' => [ 'shape' => 'String', ], 'bidPercentage' => [ 'shape' => 'Integer', ], 'launchTemplate' => [ 'shape' => 'LaunchTemplateSpecification', ], 'ec2Configuration' => [ 'shape' => 'Ec2ConfigurationList', ], 'updateToLatestImageVersion' => [ 'shape' => 'Boolean', ], 'type' => [ 'shape' => 'CRType', ], 'imageId' => [ 'shape' => 'String', ], ], ], 'ContainerDetail' => [ 'type' => 'structure', 'members' => [ 'image' => [ 'shape' => 'String', ], 'vcpus' => [ 'shape' => 'Integer', ], 'memory' => [ 'shape' => 'Integer', ], 'command' => [ 'shape' => 'StringList', ], 'jobRoleArn' => [ 'shape' => 'String', ], 'executionRoleArn' => [ 'shape' => 'String', ], 'volumes' => [ 'shape' => 'Volumes', ], 'environment' => [ 'shape' => 'EnvironmentVariables', ], 'mountPoints' => [ 'shape' => 'MountPoints', ], 'readonlyRootFilesystem' => [ 'shape' => 'Boolean', ], 'ulimits' => [ 'shape' => 'Ulimits', ], 'privileged' => [ 'shape' => 'Boolean', ], 'user' => [ 'shape' => 'String', ], 'exitCode' => [ 'shape' => 'Integer', ], 'reason' => [ 'shape' => 'String', ], 'containerInstanceArn' => [ 'shape' => 'String', ], 'taskArn' => [ 'shape' => 'String', ], 'logStreamName' => [ 'shape' => 'String', ], 'instanceType' => [ 'shape' => 'String', ], 'networkInterfaces' => [ 'shape' => 'NetworkInterfaceList', ], 'resourceRequirements' => [ 'shape' => 'ResourceRequirements', ], 'linuxParameters' => [ 'shape' => 'LinuxParameters', ], 'logConfiguration' => [ 'shape' => 'LogConfiguration', ], 'secrets' => [ 'shape' => 'SecretList', ], 'networkConfiguration' => [ 'shape' => 'NetworkConfiguration', ], 'fargatePlatformConfiguration' => [ 'shape' => 'FargatePlatformConfiguration', ], 'ephemeralStorage' => [ 'shape' => 'EphemeralStorage', ], ], ], 'ContainerOverrides' => [ 'type' => 'structure', 'members' => [ 'vcpus' => [ 'shape' => 'Integer', 'deprecated' => true, 'deprecatedMessage' => 'This field is deprecated, use resourceRequirements instead.', ], 'memory' => [ 'shape' => 'Integer', 'deprecated' => true, 'deprecatedMessage' => 'This field is deprecated, use resourceRequirements instead.', ], 'command' => [ 'shape' => 'StringList', ], 'instanceType' => [ 'shape' => 'String', ], 'environment' => [ 'shape' => 'EnvironmentVariables', ], 'resourceRequirements' => [ 'shape' => 'ResourceRequirements', ], ], ], 'ContainerProperties' => [ 'type' => 'structure', 'members' => [ 'image' => [ 'shape' => 'String', ], 'vcpus' => [ 'shape' => 'Integer', 'deprecated' => true, 'deprecatedMessage' => 'This field is deprecated, use resourceRequirements instead.', ], 'memory' => [ 'shape' => 'Integer', 'deprecated' => true, 'deprecatedMessage' => 'This field is deprecated, use resourceRequirements instead.', ], 'command' => [ 'shape' => 'StringList', ], 'jobRoleArn' => [ 'shape' => 'String', ], 'executionRoleArn' => [ 'shape' => 'String', ], 'volumes' => [ 'shape' => 'Volumes', ], 'environment' => [ 'shape' => 'EnvironmentVariables', ], 'mountPoints' => [ 'shape' => 'MountPoints', ], 'readonlyRootFilesystem' => [ 'shape' => 'Boolean', ], 'privileged' => [ 'shape' => 'Boolean', ], 'ulimits' => [ 'shape' => 'Ulimits', ], 'user' => [ 'shape' => 'String', ], 'instanceType' => [ 'shape' => 'String', ], 'resourceRequirements' => [ 'shape' => 'ResourceRequirements', ], 'linuxParameters' => [ 'shape' => 'LinuxParameters', ], 'logConfiguration' => [ 'shape' => 'LogConfiguration', ], 'secrets' => [ 'shape' => 'SecretList', ], 'networkConfiguration' => [ 'shape' => 'NetworkConfiguration', ], 'fargatePlatformConfiguration' => [ 'shape' => 'FargatePlatformConfiguration', ], 'ephemeralStorage' => [ 'shape' => 'EphemeralStorage', ], ], ], 'ContainerSummary' => [ 'type' => 'structure', 'members' => [ 'exitCode' => [ 'shape' => 'Integer', ], 'reason' => [ 'shape' => 'String', ], ], ], 'CreateComputeEnvironmentRequest' => [ 'type' => 'structure', 'required' => [ 'computeEnvironmentName', 'type', ], 'members' => [ 'computeEnvironmentName' => [ 'shape' => 'String', ], 'type' => [ 'shape' => 'CEType', ], 'state' => [ 'shape' => 'CEState', ], 'unmanagedvCpus' => [ 'shape' => 'Integer', ], 'computeResources' => [ 'shape' => 'ComputeResource', ], 'serviceRole' => [ 'shape' => 'String', ], 'tags' => [ 'shape' => 'TagrisTagsMap', ], 'eksConfiguration' => [ 'shape' => 'EksConfiguration', ], ], ], 'CreateComputeEnvironmentResponse' => [ 'type' => 'structure', 'members' => [ 'computeEnvironmentName' => [ 'shape' => 'String', ], 'computeEnvironmentArn' => [ 'shape' => 'String', ], ], ], 'CreateJobQueueRequest' => [ 'type' => 'structure', 'required' => [ 'jobQueueName', 'priority', 'computeEnvironmentOrder', ], 'members' => [ 'jobQueueName' => [ 'shape' => 'String', ], 'state' => [ 'shape' => 'JQState', ], 'schedulingPolicyArn' => [ 'shape' => 'String', ], 'priority' => [ 'shape' => 'Integer', ], 'computeEnvironmentOrder' => [ 'shape' => 'ComputeEnvironmentOrders', ], 'tags' => [ 'shape' => 'TagrisTagsMap', ], ], ], 'CreateJobQueueResponse' => [ 'type' => 'structure', 'required' => [ 'jobQueueName', 'jobQueueArn', ], 'members' => [ 'jobQueueName' => [ 'shape' => 'String', ], 'jobQueueArn' => [ 'shape' => 'String', ], ], ], 'CreateSchedulingPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'name', ], 'members' => [ 'name' => [ 'shape' => 'String', ], 'fairsharePolicy' => [ 'shape' => 'FairsharePolicy', ], 'tags' => [ 'shape' => 'TagrisTagsMap', ], ], ], 'CreateSchedulingPolicyResponse' => [ 'type' => 'structure', 'required' => [ 'name', 'arn', ], 'members' => [ 'name' => [ 'shape' => 'String', ], 'arn' => [ 'shape' => 'String', ], ], ], 'DeleteComputeEnvironmentRequest' => [ 'type' => 'structure', 'required' => [ 'computeEnvironment', ], 'members' => [ 'computeEnvironment' => [ 'shape' => 'String', ], ], ], 'DeleteComputeEnvironmentResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteJobQueueRequest' => [ 'type' => 'structure', 'required' => [ 'jobQueue', ], 'members' => [ 'jobQueue' => [ 'shape' => 'String', ], ], ], 'DeleteJobQueueResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteSchedulingPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'arn', ], 'members' => [ 'arn' => [ 'shape' => 'String', ], ], ], 'DeleteSchedulingPolicyResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeregisterJobDefinitionRequest' => [ 'type' => 'structure', 'required' => [ 'jobDefinition', ], 'members' => [ 'jobDefinition' => [ 'shape' => 'String', ], ], ], 'DeregisterJobDefinitionResponse' => [ 'type' => 'structure', 'members' => [], ], 'DescribeComputeEnvironmentsRequest' => [ 'type' => 'structure', 'members' => [ 'computeEnvironments' => [ 'shape' => 'StringList', ], 'maxResults' => [ 'shape' => 'Integer', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'DescribeComputeEnvironmentsResponse' => [ 'type' => 'structure', 'members' => [ 'computeEnvironments' => [ 'shape' => 'ComputeEnvironmentDetailList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'DescribeJobDefinitionsRequest' => [ 'type' => 'structure', 'members' => [ 'jobDefinitions' => [ 'shape' => 'StringList', ], 'maxResults' => [ 'shape' => 'Integer', ], 'jobDefinitionName' => [ 'shape' => 'String', ], 'status' => [ 'shape' => 'String', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'DescribeJobDefinitionsResponse' => [ 'type' => 'structure', 'members' => [ 'jobDefinitions' => [ 'shape' => 'JobDefinitionList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'DescribeJobQueuesRequest' => [ 'type' => 'structure', 'members' => [ 'jobQueues' => [ 'shape' => 'StringList', ], 'maxResults' => [ 'shape' => 'Integer', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'DescribeJobQueuesResponse' => [ 'type' => 'structure', 'members' => [ 'jobQueues' => [ 'shape' => 'JobQueueDetailList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'DescribeJobsRequest' => [ 'type' => 'structure', 'required' => [ 'jobs', ], 'members' => [ 'jobs' => [ 'shape' => 'StringList', ], ], ], 'DescribeJobsResponse' => [ 'type' => 'structure', 'members' => [ 'jobs' => [ 'shape' => 'JobDetailList', ], ], ], 'DescribeSchedulingPoliciesRequest' => [ 'type' => 'structure', 'required' => [ 'arns', ], 'members' => [ 'arns' => [ 'shape' => 'StringList', ], ], ], 'DescribeSchedulingPoliciesResponse' => [ 'type' => 'structure', 'members' => [ 'schedulingPolicies' => [ 'shape' => 'SchedulingPolicyDetailList', ], ], ], 'Device' => [ 'type' => 'structure', 'required' => [ 'hostPath', ], 'members' => [ 'hostPath' => [ 'shape' => 'String', ], 'containerPath' => [ 'shape' => 'String', ], 'permissions' => [ 'shape' => 'DeviceCgroupPermissions', ], ], ], 'DeviceCgroupPermission' => [ 'type' => 'string', 'enum' => [ 'READ', 'WRITE', 'MKNOD', ], ], 'DeviceCgroupPermissions' => [ 'type' => 'list', 'member' => [ 'shape' => 'DeviceCgroupPermission', ], ], 'DevicesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Device', ], ], 'EFSAuthorizationConfig' => [ 'type' => 'structure', 'members' => [ 'accessPointId' => [ 'shape' => 'String', ], 'iam' => [ 'shape' => 'EFSAuthorizationConfigIAM', ], ], ], 'EFSAuthorizationConfigIAM' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'DISABLED', ], ], 'EFSTransitEncryption' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'DISABLED', ], ], 'EFSVolumeConfiguration' => [ 'type' => 'structure', 'required' => [ 'fileSystemId', ], 'members' => [ 'fileSystemId' => [ 'shape' => 'String', ], 'rootDirectory' => [ 'shape' => 'String', ], 'transitEncryption' => [ 'shape' => 'EFSTransitEncryption', ], 'transitEncryptionPort' => [ 'shape' => 'Integer', ], 'authorizationConfig' => [ 'shape' => 'EFSAuthorizationConfig', ], ], ], 'Ec2Configuration' => [ 'type' => 'structure', 'required' => [ 'imageType', ], 'members' => [ 'imageType' => [ 'shape' => 'ImageType', ], 'imageIdOverride' => [ 'shape' => 'ImageIdOverride', ], 'imageKubernetesVersion' => [ 'shape' => 'KubernetesVersion', ], ], ], 'Ec2ConfigurationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Ec2Configuration', ], ], 'EksAttemptContainerDetail' => [ 'type' => 'structure', 'members' => [ 'exitCode' => [ 'shape' => 'Integer', ], 'reason' => [ 'shape' => 'String', ], ], ], 'EksAttemptContainerDetails' => [ 'type' => 'list', 'member' => [ 'shape' => 'EksAttemptContainerDetail', ], ], 'EksAttemptDetail' => [ 'type' => 'structure', 'members' => [ 'containers' => [ 'shape' => 'EksAttemptContainerDetails', ], 'podName' => [ 'shape' => 'String', ], 'nodeName' => [ 'shape' => 'String', ], 'startedAt' => [ 'shape' => 'Long', ], 'stoppedAt' => [ 'shape' => 'Long', ], 'statusReason' => [ 'shape' => 'String', ], ], ], 'EksAttemptDetails' => [ 'type' => 'list', 'member' => [ 'shape' => 'EksAttemptDetail', ], ], 'EksConfiguration' => [ 'type' => 'structure', 'required' => [ 'eksClusterArn', 'kubernetesNamespace', ], 'members' => [ 'eksClusterArn' => [ 'shape' => 'String', ], 'kubernetesNamespace' => [ 'shape' => 'String', ], ], ], 'EksContainer' => [ 'type' => 'structure', 'required' => [ 'image', ], 'members' => [ 'name' => [ 'shape' => 'String', ], 'image' => [ 'shape' => 'String', ], 'imagePullPolicy' => [ 'shape' => 'String', ], 'command' => [ 'shape' => 'StringList', ], 'args' => [ 'shape' => 'StringList', ], 'env' => [ 'shape' => 'EksContainerEnvironmentVariables', ], 'resources' => [ 'shape' => 'EksContainerResourceRequirements', ], 'volumeMounts' => [ 'shape' => 'EksContainerVolumeMounts', ], 'securityContext' => [ 'shape' => 'EksContainerSecurityContext', ], ], ], 'EksContainerDetail' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'String', ], 'image' => [ 'shape' => 'String', ], 'imagePullPolicy' => [ 'shape' => 'String', ], 'command' => [ 'shape' => 'StringList', ], 'args' => [ 'shape' => 'StringList', ], 'env' => [ 'shape' => 'EksContainerEnvironmentVariables', ], 'resources' => [ 'shape' => 'EksContainerResourceRequirements', ], 'exitCode' => [ 'shape' => 'Integer', ], 'reason' => [ 'shape' => 'String', ], 'volumeMounts' => [ 'shape' => 'EksContainerVolumeMounts', ], 'securityContext' => [ 'shape' => 'EksContainerSecurityContext', ], ], ], 'EksContainerDetails' => [ 'type' => 'list', 'member' => [ 'shape' => 'EksContainerDetail', ], ], 'EksContainerEnvironmentVariable' => [ 'type' => 'structure', 'required' => [ 'name', ], 'members' => [ 'name' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], ], 'EksContainerEnvironmentVariables' => [ 'type' => 'list', 'member' => [ 'shape' => 'EksContainerEnvironmentVariable', ], ], 'EksContainerOverride' => [ 'type' => 'structure', 'members' => [ 'image' => [ 'shape' => 'String', ], 'command' => [ 'shape' => 'StringList', ], 'args' => [ 'shape' => 'StringList', ], 'env' => [ 'shape' => 'EksContainerEnvironmentVariables', ], 'resources' => [ 'shape' => 'EksContainerResourceRequirements', ], ], ], 'EksContainerOverrideList' => [ 'type' => 'list', 'member' => [ 'shape' => 'EksContainerOverride', ], ], 'EksContainerResourceRequirements' => [ 'type' => 'structure', 'members' => [ 'limits' => [ 'shape' => 'EksLimits', ], 'requests' => [ 'shape' => 'EksRequests', ], ], ], 'EksContainerSecurityContext' => [ 'type' => 'structure', 'members' => [ 'runAsUser' => [ 'shape' => 'Long', ], 'runAsGroup' => [ 'shape' => 'Long', ], 'privileged' => [ 'shape' => 'Boolean', ], 'readOnlyRootFilesystem' => [ 'shape' => 'Boolean', ], 'runAsNonRoot' => [ 'shape' => 'Boolean', ], ], ], 'EksContainerVolumeMount' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'String', ], 'mountPath' => [ 'shape' => 'String', ], 'readOnly' => [ 'shape' => 'Boolean', ], ], ], 'EksContainerVolumeMounts' => [ 'type' => 'list', 'member' => [ 'shape' => 'EksContainerVolumeMount', ], ], 'EksContainers' => [ 'type' => 'list', 'member' => [ 'shape' => 'EksContainer', ], ], 'EksEmptyDir' => [ 'type' => 'structure', 'members' => [ 'medium' => [ 'shape' => 'String', ], 'sizeLimit' => [ 'shape' => 'Quantity', ], ], ], 'EksHostPath' => [ 'type' => 'structure', 'members' => [ 'path' => [ 'shape' => 'String', ], ], ], 'EksLabelsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], 'EksLimits' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'Quantity', ], ], 'EksMetadata' => [ 'type' => 'structure', 'members' => [ 'labels' => [ 'shape' => 'EksLabelsMap', ], ], ], 'EksPodProperties' => [ 'type' => 'structure', 'members' => [ 'serviceAccountName' => [ 'shape' => 'String', ], 'hostNetwork' => [ 'shape' => 'Boolean', ], 'dnsPolicy' => [ 'shape' => 'String', ], 'containers' => [ 'shape' => 'EksContainers', ], 'volumes' => [ 'shape' => 'EksVolumes', ], 'metadata' => [ 'shape' => 'EksMetadata', ], ], ], 'EksPodPropertiesDetail' => [ 'type' => 'structure', 'members' => [ 'serviceAccountName' => [ 'shape' => 'String', ], 'hostNetwork' => [ 'shape' => 'Boolean', ], 'dnsPolicy' => [ 'shape' => 'String', ], 'containers' => [ 'shape' => 'EksContainerDetails', ], 'volumes' => [ 'shape' => 'EksVolumes', ], 'podName' => [ 'shape' => 'String', ], 'nodeName' => [ 'shape' => 'String', ], 'metadata' => [ 'shape' => 'EksMetadata', ], ], ], 'EksPodPropertiesOverride' => [ 'type' => 'structure', 'members' => [ 'containers' => [ 'shape' => 'EksContainerOverrideList', ], 'metadata' => [ 'shape' => 'EksMetadata', ], ], ], 'EksProperties' => [ 'type' => 'structure', 'members' => [ 'podProperties' => [ 'shape' => 'EksPodProperties', ], ], ], 'EksPropertiesDetail' => [ 'type' => 'structure', 'members' => [ 'podProperties' => [ 'shape' => 'EksPodPropertiesDetail', ], ], ], 'EksPropertiesOverride' => [ 'type' => 'structure', 'members' => [ 'podProperties' => [ 'shape' => 'EksPodPropertiesOverride', ], ], ], 'EksRequests' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'Quantity', ], ], 'EksSecret' => [ 'type' => 'structure', 'required' => [ 'secretName', ], 'members' => [ 'secretName' => [ 'shape' => 'String', ], 'optional' => [ 'shape' => 'Boolean', ], ], ], 'EksVolume' => [ 'type' => 'structure', 'required' => [ 'name', ], 'members' => [ 'name' => [ 'shape' => 'String', ], 'hostPath' => [ 'shape' => 'EksHostPath', ], 'emptyDir' => [ 'shape' => 'EksEmptyDir', ], 'secret' => [ 'shape' => 'EksSecret', ], ], ], 'EksVolumes' => [ 'type' => 'list', 'member' => [ 'shape' => 'EksVolume', ], ], 'EnvironmentVariables' => [ 'type' => 'list', 'member' => [ 'shape' => 'KeyValuePair', ], ], 'EphemeralStorage' => [ 'type' => 'structure', 'required' => [ 'sizeInGiB', ], 'members' => [ 'sizeInGiB' => [ 'shape' => 'Integer', ], ], ], 'EvaluateOnExit' => [ 'type' => 'structure', 'required' => [ 'action', ], 'members' => [ 'onStatusReason' => [ 'shape' => 'String', ], 'onReason' => [ 'shape' => 'String', ], 'onExitCode' => [ 'shape' => 'String', ], 'action' => [ 'shape' => 'RetryAction', ], ], ], 'EvaluateOnExitList' => [ 'type' => 'list', 'member' => [ 'shape' => 'EvaluateOnExit', ], ], 'FairsharePolicy' => [ 'type' => 'structure', 'members' => [ 'shareDecaySeconds' => [ 'shape' => 'Integer', ], 'computeReservation' => [ 'shape' => 'Integer', ], 'shareDistribution' => [ 'shape' => 'ShareAttributesList', ], ], ], 'FargatePlatformConfiguration' => [ 'type' => 'structure', 'members' => [ 'platformVersion' => [ 'shape' => 'String', ], ], ], 'Float' => [ 'type' => 'float', ], 'Host' => [ 'type' => 'structure', 'members' => [ 'sourcePath' => [ 'shape' => 'String', ], ], ], 'ImageIdOverride' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'ImageType' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'Integer' => [ 'type' => 'integer', ], 'JQState' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'DISABLED', ], ], 'JQStatus' => [ 'type' => 'string', 'enum' => [ 'CREATING', 'UPDATING', 'DELETING', 'DELETED', 'VALID', 'INVALID', ], ], 'JobDefinition' => [ 'type' => 'structure', 'required' => [ 'jobDefinitionName', 'jobDefinitionArn', 'revision', 'type', ], 'members' => [ 'jobDefinitionName' => [ 'shape' => 'String', ], 'jobDefinitionArn' => [ 'shape' => 'String', ], 'revision' => [ 'shape' => 'Integer', ], 'status' => [ 'shape' => 'String', ], 'type' => [ 'shape' => 'String', ], 'schedulingPriority' => [ 'shape' => 'Integer', ], 'parameters' => [ 'shape' => 'ParametersMap', ], 'retryStrategy' => [ 'shape' => 'RetryStrategy', ], 'containerProperties' => [ 'shape' => 'ContainerProperties', ], 'timeout' => [ 'shape' => 'JobTimeout', ], 'nodeProperties' => [ 'shape' => 'NodeProperties', ], 'tags' => [ 'shape' => 'TagrisTagsMap', ], 'propagateTags' => [ 'shape' => 'Boolean', ], 'platformCapabilities' => [ 'shape' => 'PlatformCapabilityList', ], 'eksProperties' => [ 'shape' => 'EksProperties', ], 'containerOrchestrationType' => [ 'shape' => 'OrchestrationType', ], ], ], 'JobDefinitionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'JobDefinition', ], ], 'JobDefinitionType' => [ 'type' => 'string', 'enum' => [ 'container', 'multinode', ], ], 'JobDependency' => [ 'type' => 'structure', 'members' => [ 'jobId' => [ 'shape' => 'String', ], 'type' => [ 'shape' => 'ArrayJobDependency', ], ], ], 'JobDependencyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'JobDependency', ], ], 'JobDetail' => [ 'type' => 'structure', 'required' => [ 'jobName', 'jobId', 'jobQueue', 'status', 'startedAt', 'jobDefinition', ], 'members' => [ 'jobArn' => [ 'shape' => 'String', ], 'jobName' => [ 'shape' => 'String', ], 'jobId' => [ 'shape' => 'String', ], 'jobQueue' => [ 'shape' => 'String', ], 'status' => [ 'shape' => 'JobStatus', ], 'shareIdentifier' => [ 'shape' => 'String', ], 'schedulingPriority' => [ 'shape' => 'Integer', ], 'attempts' => [ 'shape' => 'AttemptDetails', ], 'statusReason' => [ 'shape' => 'String', ], 'createdAt' => [ 'shape' => 'Long', ], 'retryStrategy' => [ 'shape' => 'RetryStrategy', ], 'startedAt' => [ 'shape' => 'Long', ], 'stoppedAt' => [ 'shape' => 'Long', ], 'dependsOn' => [ 'shape' => 'JobDependencyList', ], 'jobDefinition' => [ 'shape' => 'String', ], 'parameters' => [ 'shape' => 'ParametersMap', ], 'container' => [ 'shape' => 'ContainerDetail', ], 'nodeDetails' => [ 'shape' => 'NodeDetails', ], 'nodeProperties' => [ 'shape' => 'NodeProperties', ], 'arrayProperties' => [ 'shape' => 'ArrayPropertiesDetail', ], 'timeout' => [ 'shape' => 'JobTimeout', ], 'tags' => [ 'shape' => 'TagrisTagsMap', ], 'propagateTags' => [ 'shape' => 'Boolean', ], 'platformCapabilities' => [ 'shape' => 'PlatformCapabilityList', ], 'eksProperties' => [ 'shape' => 'EksPropertiesDetail', ], 'eksAttempts' => [ 'shape' => 'EksAttemptDetails', ], 'isCancelled' => [ 'shape' => 'Boolean', ], 'isTerminated' => [ 'shape' => 'Boolean', ], ], ], 'JobDetailList' => [ 'type' => 'list', 'member' => [ 'shape' => 'JobDetail', ], ], 'JobExecutionTimeoutMinutes' => [ 'type' => 'long', 'max' => 360, 'min' => 1, ], 'JobQueueDetail' => [ 'type' => 'structure', 'required' => [ 'jobQueueName', 'jobQueueArn', 'state', 'priority', 'computeEnvironmentOrder', ], 'members' => [ 'jobQueueName' => [ 'shape' => 'String', ], 'jobQueueArn' => [ 'shape' => 'String', ], 'state' => [ 'shape' => 'JQState', ], 'schedulingPolicyArn' => [ 'shape' => 'String', ], 'status' => [ 'shape' => 'JQStatus', ], 'statusReason' => [ 'shape' => 'String', ], 'priority' => [ 'shape' => 'Integer', ], 'computeEnvironmentOrder' => [ 'shape' => 'ComputeEnvironmentOrders', ], 'tags' => [ 'shape' => 'TagrisTagsMap', ], ], ], 'JobQueueDetailList' => [ 'type' => 'list', 'member' => [ 'shape' => 'JobQueueDetail', ], ], 'JobStatus' => [ 'type' => 'string', 'enum' => [ 'SUBMITTED', 'PENDING', 'RUNNABLE', 'STARTING', 'RUNNING', 'SUCCEEDED', 'FAILED', ], ], 'JobSummary' => [ 'type' => 'structure', 'required' => [ 'jobId', 'jobName', ], 'members' => [ 'jobArn' => [ 'shape' => 'String', ], 'jobId' => [ 'shape' => 'String', ], 'jobName' => [ 'shape' => 'String', ], 'createdAt' => [ 'shape' => 'Long', ], 'status' => [ 'shape' => 'JobStatus', ], 'statusReason' => [ 'shape' => 'String', ], 'startedAt' => [ 'shape' => 'Long', ], 'stoppedAt' => [ 'shape' => 'Long', ], 'container' => [ 'shape' => 'ContainerSummary', ], 'arrayProperties' => [ 'shape' => 'ArrayPropertiesSummary', ], 'nodeProperties' => [ 'shape' => 'NodePropertiesSummary', ], 'jobDefinition' => [ 'shape' => 'String', ], ], ], 'JobSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'JobSummary', ], ], 'JobTimeout' => [ 'type' => 'structure', 'members' => [ 'attemptDurationSeconds' => [ 'shape' => 'Integer', ], ], ], 'KeyValuePair' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], ], 'KeyValuesPair' => [ 'type' => 'structure', 'members' => [ 'name' => [ 'shape' => 'String', ], 'values' => [ 'shape' => 'StringList', ], ], ], 'KubernetesVersion' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'LaunchTemplateSpecification' => [ 'type' => 'structure', 'members' => [ 'launchTemplateId' => [ 'shape' => 'String', ], 'launchTemplateName' => [ 'shape' => 'String', ], 'version' => [ 'shape' => 'String', ], ], ], 'LinuxParameters' => [ 'type' => 'structure', 'members' => [ 'devices' => [ 'shape' => 'DevicesList', ], 'initProcessEnabled' => [ 'shape' => 'Boolean', ], 'sharedMemorySize' => [ 'shape' => 'Integer', ], 'tmpfs' => [ 'shape' => 'TmpfsList', ], 'maxSwap' => [ 'shape' => 'Integer', ], 'swappiness' => [ 'shape' => 'Integer', ], ], ], 'ListJobsFilterList' => [ 'type' => 'list', 'member' => [ 'shape' => 'KeyValuesPair', ], ], 'ListJobsRequest' => [ 'type' => 'structure', 'members' => [ 'jobQueue' => [ 'shape' => 'String', ], 'arrayJobId' => [ 'shape' => 'String', ], 'multiNodeJobId' => [ 'shape' => 'String', ], 'jobStatus' => [ 'shape' => 'JobStatus', ], 'maxResults' => [ 'shape' => 'Integer', ], 'nextToken' => [ 'shape' => 'String', ], 'filters' => [ 'shape' => 'ListJobsFilterList', ], ], ], 'ListJobsResponse' => [ 'type' => 'structure', 'required' => [ 'jobSummaryList', ], 'members' => [ 'jobSummaryList' => [ 'shape' => 'JobSummaryList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'ListSchedulingPoliciesRequest' => [ 'type' => 'structure', 'members' => [ 'maxResults' => [ 'shape' => 'Integer', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'ListSchedulingPoliciesResponse' => [ 'type' => 'structure', 'members' => [ 'schedulingPolicies' => [ 'shape' => 'SchedulingPolicyListingDetailList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', ], 'members' => [ 'resourceArn' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resourceArn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'tags' => [ 'shape' => 'TagrisTagsMap', ], ], ], 'LogConfiguration' => [ 'type' => 'structure', 'required' => [ 'logDriver', ], 'members' => [ 'logDriver' => [ 'shape' => 'LogDriver', ], 'options' => [ 'shape' => 'LogConfigurationOptionsMap', ], 'secretOptions' => [ 'shape' => 'SecretList', ], ], ], 'LogConfigurationOptionsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], 'LogDriver' => [ 'type' => 'string', 'enum' => [ 'json-file', 'syslog', 'journald', 'gelf', 'fluentd', 'awslogs', 'splunk', ], ], 'Long' => [ 'type' => 'long', ], 'MountPoint' => [ 'type' => 'structure', 'members' => [ 'containerPath' => [ 'shape' => 'String', ], 'readOnly' => [ 'shape' => 'Boolean', ], 'sourceVolume' => [ 'shape' => 'String', ], ], ], 'MountPoints' => [ 'type' => 'list', 'member' => [ 'shape' => 'MountPoint', ], ], 'NetworkConfiguration' => [ 'type' => 'structure', 'members' => [ 'assignPublicIp' => [ 'shape' => 'AssignPublicIp', ], ], ], 'NetworkInterface' => [ 'type' => 'structure', 'members' => [ 'attachmentId' => [ 'shape' => 'String', ], 'ipv6Address' => [ 'shape' => 'String', ], 'privateIpv4Address' => [ 'shape' => 'String', ], ], ], 'NetworkInterfaceList' => [ 'type' => 'list', 'member' => [ 'shape' => 'NetworkInterface', ], ], 'NodeDetails' => [ 'type' => 'structure', 'members' => [ 'nodeIndex' => [ 'shape' => 'Integer', ], 'isMainNode' => [ 'shape' => 'Boolean', ], ], ], 'NodeOverrides' => [ 'type' => 'structure', 'members' => [ 'numNodes' => [ 'shape' => 'Integer', ], 'nodePropertyOverrides' => [ 'shape' => 'NodePropertyOverrides', ], ], ], 'NodeProperties' => [ 'type' => 'structure', 'required' => [ 'numNodes', 'mainNode', 'nodeRangeProperties', ], 'members' => [ 'numNodes' => [ 'shape' => 'Integer', ], 'mainNode' => [ 'shape' => 'Integer', ], 'nodeRangeProperties' => [ 'shape' => 'NodeRangeProperties', ], ], ], 'NodePropertiesSummary' => [ 'type' => 'structure', 'members' => [ 'isMainNode' => [ 'shape' => 'Boolean', ], 'numNodes' => [ 'shape' => 'Integer', ], 'nodeIndex' => [ 'shape' => 'Integer', ], ], ], 'NodePropertyOverride' => [ 'type' => 'structure', 'required' => [ 'targetNodes', ], 'members' => [ 'targetNodes' => [ 'shape' => 'String', ], 'containerOverrides' => [ 'shape' => 'ContainerOverrides', ], ], ], 'NodePropertyOverrides' => [ 'type' => 'list', 'member' => [ 'shape' => 'NodePropertyOverride', ], ], 'NodeRangeProperties' => [ 'type' => 'list', 'member' => [ 'shape' => 'NodeRangeProperty', ], ], 'NodeRangeProperty' => [ 'type' => 'structure', 'required' => [ 'targetNodes', ], 'members' => [ 'targetNodes' => [ 'shape' => 'String', ], 'container' => [ 'shape' => 'ContainerProperties', ], ], ], 'OrchestrationType' => [ 'type' => 'string', 'enum' => [ 'ECS', 'EKS', ], ], 'ParametersMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], 'PlatformCapability' => [ 'type' => 'string', 'enum' => [ 'EC2', 'FARGATE', ], ], 'PlatformCapabilityList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PlatformCapability', ], ], 'Quantity' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'RegisterJobDefinitionRequest' => [ 'type' => 'structure', 'required' => [ 'jobDefinitionName', 'type', ], 'members' => [ 'jobDefinitionName' => [ 'shape' => 'String', ], 'type' => [ 'shape' => 'JobDefinitionType', ], 'parameters' => [ 'shape' => 'ParametersMap', ], 'schedulingPriority' => [ 'shape' => 'Integer', ], 'containerProperties' => [ 'shape' => 'ContainerProperties', ], 'nodeProperties' => [ 'shape' => 'NodeProperties', ], 'retryStrategy' => [ 'shape' => 'RetryStrategy', ], 'propagateTags' => [ 'shape' => 'Boolean', ], 'timeout' => [ 'shape' => 'JobTimeout', ], 'tags' => [ 'shape' => 'TagrisTagsMap', ], 'platformCapabilities' => [ 'shape' => 'PlatformCapabilityList', ], 'eksProperties' => [ 'shape' => 'EksProperties', ], ], ], 'RegisterJobDefinitionResponse' => [ 'type' => 'structure', 'required' => [ 'jobDefinitionName', 'jobDefinitionArn', 'revision', ], 'members' => [ 'jobDefinitionName' => [ 'shape' => 'String', ], 'jobDefinitionArn' => [ 'shape' => 'String', ], 'revision' => [ 'shape' => 'Integer', ], ], ], 'ResourceRequirement' => [ 'type' => 'structure', 'required' => [ 'value', 'type', ], 'members' => [ 'value' => [ 'shape' => 'String', ], 'type' => [ 'shape' => 'ResourceType', ], ], ], 'ResourceRequirements' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResourceRequirement', ], ], 'ResourceType' => [ 'type' => 'string', 'enum' => [ 'GPU', 'VCPU', 'MEMORY', ], ], 'RetryAction' => [ 'type' => 'string', 'enum' => [ 'RETRY', 'EXIT', ], ], 'RetryStrategy' => [ 'type' => 'structure', 'members' => [ 'attempts' => [ 'shape' => 'Integer', ], 'evaluateOnExit' => [ 'shape' => 'EvaluateOnExitList', ], ], ], 'SchedulingPolicyDetail' => [ 'type' => 'structure', 'required' => [ 'name', 'arn', ], 'members' => [ 'name' => [ 'shape' => 'String', ], 'arn' => [ 'shape' => 'String', ], 'fairsharePolicy' => [ 'shape' => 'FairsharePolicy', ], 'tags' => [ 'shape' => 'TagrisTagsMap', ], ], ], 'SchedulingPolicyDetailList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SchedulingPolicyDetail', ], ], 'SchedulingPolicyListingDetail' => [ 'type' => 'structure', 'required' => [ 'arn', ], 'members' => [ 'arn' => [ 'shape' => 'String', ], ], ], 'SchedulingPolicyListingDetailList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SchedulingPolicyListingDetail', ], ], 'Secret' => [ 'type' => 'structure', 'required' => [ 'name', 'valueFrom', ], 'members' => [ 'name' => [ 'shape' => 'String', ], 'valueFrom' => [ 'shape' => 'String', ], ], ], 'SecretList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Secret', ], ], 'ServerException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'ShareAttributes' => [ 'type' => 'structure', 'required' => [ 'shareIdentifier', ], 'members' => [ 'shareIdentifier' => [ 'shape' => 'String', ], 'weightFactor' => [ 'shape' => 'Float', ], ], ], 'ShareAttributesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ShareAttributes', ], ], 'String' => [ 'type' => 'string', ], 'StringList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'SubmitJobRequest' => [ 'type' => 'structure', 'required' => [ 'jobName', 'jobQueue', 'jobDefinition', ], 'members' => [ 'jobName' => [ 'shape' => 'String', ], 'jobQueue' => [ 'shape' => 'String', ], 'shareIdentifier' => [ 'shape' => 'String', ], 'schedulingPriorityOverride' => [ 'shape' => 'Integer', ], 'arrayProperties' => [ 'shape' => 'ArrayProperties', ], 'dependsOn' => [ 'shape' => 'JobDependencyList', ], 'jobDefinition' => [ 'shape' => 'String', ], 'parameters' => [ 'shape' => 'ParametersMap', ], 'containerOverrides' => [ 'shape' => 'ContainerOverrides', ], 'nodeOverrides' => [ 'shape' => 'NodeOverrides', ], 'retryStrategy' => [ 'shape' => 'RetryStrategy', ], 'propagateTags' => [ 'shape' => 'Boolean', ], 'timeout' => [ 'shape' => 'JobTimeout', ], 'tags' => [ 'shape' => 'TagrisTagsMap', ], 'eksPropertiesOverride' => [ 'shape' => 'EksPropertiesOverride', ], ], ], 'SubmitJobResponse' => [ 'type' => 'structure', 'required' => [ 'jobName', 'jobId', ], 'members' => [ 'jobArn' => [ 'shape' => 'String', ], 'jobName' => [ 'shape' => 'String', ], 'jobId' => [ 'shape' => 'String', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'TagKeysList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 50, 'min' => 1, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tags', ], 'members' => [ 'resourceArn' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tags' => [ 'shape' => 'TagrisTagsMap', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, ], 'TagrisTagsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'TagKey', ], 'value' => [ 'shape' => 'TagValue', ], 'max' => 50, 'min' => 1, ], 'TagsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], 'TerminateJobRequest' => [ 'type' => 'structure', 'required' => [ 'jobId', 'reason', ], 'members' => [ 'jobId' => [ 'shape' => 'String', ], 'reason' => [ 'shape' => 'String', ], ], ], 'TerminateJobResponse' => [ 'type' => 'structure', 'members' => [], ], 'Tmpfs' => [ 'type' => 'structure', 'required' => [ 'containerPath', 'size', ], 'members' => [ 'containerPath' => [ 'shape' => 'String', ], 'size' => [ 'shape' => 'Integer', ], 'mountOptions' => [ 'shape' => 'StringList', ], ], ], 'TmpfsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tmpfs', ], ], 'Ulimit' => [ 'type' => 'structure', 'required' => [ 'hardLimit', 'name', 'softLimit', ], 'members' => [ 'hardLimit' => [ 'shape' => 'Integer', ], 'name' => [ 'shape' => 'String', ], 'softLimit' => [ 'shape' => 'Integer', ], ], ], 'Ulimits' => [ 'type' => 'list', 'member' => [ 'shape' => 'Ulimit', ], ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tagKeys', ], 'members' => [ 'resourceArn' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tagKeys' => [ 'shape' => 'TagKeysList', 'location' => 'querystring', 'locationName' => 'tagKeys', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateComputeEnvironmentRequest' => [ 'type' => 'structure', 'required' => [ 'computeEnvironment', ], 'members' => [ 'computeEnvironment' => [ 'shape' => 'String', ], 'state' => [ 'shape' => 'CEState', ], 'unmanagedvCpus' => [ 'shape' => 'Integer', ], 'computeResources' => [ 'shape' => 'ComputeResourceUpdate', ], 'serviceRole' => [ 'shape' => 'String', ], 'updatePolicy' => [ 'shape' => 'UpdatePolicy', ], ], ], 'UpdateComputeEnvironmentResponse' => [ 'type' => 'structure', 'members' => [ 'computeEnvironmentName' => [ 'shape' => 'String', ], 'computeEnvironmentArn' => [ 'shape' => 'String', ], ], ], 'UpdateJobQueueRequest' => [ 'type' => 'structure', 'required' => [ 'jobQueue', ], 'members' => [ 'jobQueue' => [ 'shape' => 'String', ], 'state' => [ 'shape' => 'JQState', ], 'schedulingPolicyArn' => [ 'shape' => 'String', ], 'priority' => [ 'shape' => 'Integer', ], 'computeEnvironmentOrder' => [ 'shape' => 'ComputeEnvironmentOrders', ], ], ], 'UpdateJobQueueResponse' => [ 'type' => 'structure', 'members' => [ 'jobQueueName' => [ 'shape' => 'String', ], 'jobQueueArn' => [ 'shape' => 'String', ], ], ], 'UpdatePolicy' => [ 'type' => 'structure', 'members' => [ 'terminateJobsOnUpdate' => [ 'shape' => 'Boolean', ], 'jobExecutionTimeoutMinutes' => [ 'shape' => 'JobExecutionTimeoutMinutes', ], ], ], 'UpdateSchedulingPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'arn', ], 'members' => [ 'arn' => [ 'shape' => 'String', ], 'fairsharePolicy' => [ 'shape' => 'FairsharePolicy', ], ], ], 'UpdateSchedulingPolicyResponse' => [ 'type' => 'structure', 'members' => [], ], 'Volume' => [ 'type' => 'structure', 'members' => [ 'host' => [ 'shape' => 'Host', ], 'name' => [ 'shape' => 'String', ], 'efsVolumeConfiguration' => [ 'shape' => 'EFSVolumeConfiguration', ], ], ], 'Volumes' => [ 'type' => 'list', 'member' => [ 'shape' => 'Volume', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/batch/2016-08-10/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<fullname>Batch</fullname> <p>Using Batch, you can run batch computing workloads on the Amazon Web Services Cloud. Batch computing is a common means for developers, scientists, and engineers to access large amounts of compute resources. Batch uses the advantages of the batch computing to remove the undifferentiated heavy lifting of configuring and managing required infrastructure. At the same time, it also adopts a familiar batch computing software approach. You can use Batch to efficiently provision resources d, and work toward eliminating capacity constraints, reducing your overall compute costs, and delivering results more quickly.</p> <p>As a fully managed service, Batch can run batch computing workloads of any scale. Batch automatically provisions compute resources and optimizes workload distribution based on the quantity and scale of your specific workloads. With Batch, there\\'s no need to install or manage batch computing software. This means that you can focus on analyzing results and solving your specific problems instead.</p>', 'operations' => [ 'CancelJob' => '<p>Cancels a job in an Batch job queue. Jobs that are in the <code>SUBMITTED</code> or <code>PENDING</code> are canceled. A job in<code>RUNNABLE</code> remains in <code>RUNNABLE</code> until it reaches the head of the job queue. Then the job status is updated to <code>FAILED</code>.</p> <p>Jobs that progressed to the <code>STARTING</code> or <code>RUNNING</code> state aren\\'t canceled. However, the API operation still succeeds, even if no job is canceled. These jobs must be terminated with the <a>TerminateJob</a> operation.</p>', 'CreateComputeEnvironment' => '<p>Creates an Batch compute environment. You can create <code>MANAGED</code> or <code>UNMANAGED</code> compute environments. <code>MANAGED</code> compute environments can use Amazon EC2 or Fargate resources. <code>UNMANAGED</code> compute environments can only use EC2 resources.</p> <p>In a managed compute environment, Batch manages the capacity and instance types of the compute resources within the environment. This is based on the compute resource specification that you define or the <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html\">launch template</a> that you specify when you create the compute environment. Either, you can choose to use EC2 On-Demand Instances and EC2 Spot Instances. Or, you can use Fargate and Fargate Spot capacity in your managed compute environment. You can optionally set a maximum price so that Spot Instances only launch when the Spot Instance price is less than a specified percentage of the On-Demand price.</p> <note> <p>Multi-node parallel jobs aren\\'t supported on Spot Instances.</p> </note> <p>In an unmanaged compute environment, you can manage your own EC2 compute resources and have flexibility with how you configure your compute resources. For example, you can use custom AMIs. However, you must verify that each of your AMIs meet the Amazon ECS container instance AMI specification. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container_instance_AMIs.html\">container instance AMIs</a> in the <i>Amazon Elastic Container Service Developer Guide</i>. After you created your unmanaged compute environment, you can use the <a>DescribeComputeEnvironments</a> operation to find the Amazon ECS cluster that\\'s associated with it. Then, launch your container instances into that Amazon ECS cluster. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html\">Launching an Amazon ECS container instance</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p> <note> <p>To create a compute environment that uses EKS resources, the caller must have permissions to call <code>eks:DescribeCluster</code>.</p> </note> <note> <p>Batch doesn\\'t automatically upgrade the AMIs in a compute environment after it\\'s created. For example, it also doesn\\'t update the AMIs in your compute environment when a newer version of the Amazon ECS optimized AMI is available. You\\'re responsible for the management of the guest operating system. This includes any updates and security patches. You\\'re also responsible for any additional application software or utilities that you install on the compute resources. There are two ways to use a new AMI for your Batch jobs. The original method is to complete these steps:</p> <ol> <li> <p>Create a new compute environment with the new AMI.</p> </li> <li> <p>Add the compute environment to an existing job queue.</p> </li> <li> <p>Remove the earlier compute environment from your job queue.</p> </li> <li> <p>Delete the earlier compute environment.</p> </li> </ol> <p>In April 2022, Batch added enhanced support for updating compute environments. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a>. To use the enhanced updating of compute environments to update AMIs, follow these rules:</p> <ul> <li> <p>Either don\\'t set the service role (<code>serviceRole</code>) parameter or set it to the <b>AWSBatchServiceRole</b> service-linked role.</p> </li> <li> <p>Set the allocation strategy (<code>allocationStrategy</code>) parameter to <code>BEST_FIT_PROGRESSIVE</code> or <code>SPOT_CAPACITY_OPTIMIZED</code>.</p> </li> <li> <p>Set the update to latest image version (<code>updateToLatestImageVersion</code>) parameter to <code>true</code>.</p> </li> <li> <p>Don\\'t specify an AMI ID in <code>imageId</code>, <code>imageIdOverride</code> (in <a href=\"https://docs.aws.amazon.com/batch/latest/APIReference/API_Ec2Configuration.html\"> <code>ec2Configuration</code> </a>), or in the launch template (<code>launchTemplate</code>). In that case, Batch selects the latest Amazon ECS optimized AMI that\\'s supported by Batch at the time the infrastructure update is initiated. Alternatively, you can specify the AMI ID in the <code>imageId</code> or <code>imageIdOverride</code> parameters, or the launch template identified by the <code>LaunchTemplate</code> properties. Changing any of these properties starts an infrastructure update. If the AMI ID is specified in the launch template, it can\\'t be replaced by specifying an AMI ID in either the <code>imageId</code> or <code>imageIdOverride</code> parameters. It can only be replaced by specifying a different launch template, or if the launch template version is set to <code>$Default</code> or <code>$Latest</code>, by setting either a new default version for the launch template (if <code>$Default</code>) or by adding a new version to the launch template (if <code>$Latest</code>).</p> </li> </ul> <p>If these rules are followed, any update that starts an infrastructure update causes the AMI ID to be re-selected. If the <code>version</code> setting in the launch template (<code>launchTemplate</code>) is set to <code>$Latest</code> or <code>$Default</code>, the latest or default version of the launch template is evaluated up at the time of the infrastructure update, even if the <code>launchTemplate</code> wasn\\'t updated.</p> </note>', 'CreateJobQueue' => '<p>Creates an Batch job queue. When you create a job queue, you associate one or more compute environments to the queue and assign an order of preference for the compute environments.</p> <p>You also set a priority to the job queue that determines the order that the Batch scheduler places jobs onto its associated compute environments. For example, if a compute environment is associated with more than one job queue, the job queue with a higher priority is given preference for scheduling jobs to that compute environment.</p>', 'CreateSchedulingPolicy' => '<p>Creates an Batch scheduling policy.</p>', 'DeleteComputeEnvironment' => '<p>Deletes an Batch compute environment.</p> <p>Before you can delete a compute environment, you must set its state to <code>DISABLED</code> with the <a>UpdateComputeEnvironment</a> API operation and disassociate it from any job queues with the <a>UpdateJobQueue</a> API operation. Compute environments that use Fargate resources must terminate all active jobs on that compute environment before deleting the compute environment. If this isn\\'t done, the compute environment enters an invalid state.</p>', 'DeleteJobQueue' => '<p>Deletes the specified job queue. You must first disable submissions for a queue with the <a>UpdateJobQueue</a> operation. All jobs in the queue are eventually terminated when you delete a job queue. The jobs are terminated at a rate of about 16 jobs each second.</p> <p>It\\'s not necessary to disassociate compute environments from a queue before submitting a <code>DeleteJobQueue</code> request.</p>', 'DeleteSchedulingPolicy' => '<p>Deletes the specified scheduling policy.</p> <p>You can\\'t delete a scheduling policy that\\'s used in any job queues.</p>', 'DeregisterJobDefinition' => '<p>Deregisters an Batch job definition. Job definitions are permanently deleted after 180 days.</p>', 'DescribeComputeEnvironments' => '<p>Describes one or more of your compute environments.</p> <p>If you\\'re using an unmanaged compute environment, you can use the <code>DescribeComputeEnvironment</code> operation to determine the <code>ecsClusterArn</code> that you launch your Amazon ECS container instances into.</p>', 'DescribeJobDefinitions' => '<p>Describes a list of job definitions. You can specify a <code>status</code> (such as <code>ACTIVE</code>) to only return job definitions that match that status.</p>', 'DescribeJobQueues' => '<p>Describes one or more of your job queues.</p>', 'DescribeJobs' => '<p>Describes a list of Batch jobs.</p>', 'DescribeSchedulingPolicies' => '<p>Describes one or more of your scheduling policies.</p>', 'ListJobs' => '<p>Returns a list of Batch jobs.</p> <p>You must specify only one of the following items:</p> <ul> <li> <p>A job queue ID to return a list of jobs in that job queue</p> </li> <li> <p>A multi-node parallel job ID to return a list of nodes for that job</p> </li> <li> <p>An array job ID to return a list of the children for that job</p> </li> </ul> <p>You can filter the results by job status with the <code>jobStatus</code> parameter. If you don\\'t specify a status, only <code>RUNNING</code> jobs are returned.</p>', 'ListSchedulingPolicies' => '<p>Returns a list of Batch scheduling policies.</p>', 'ListTagsForResource' => '<p>Lists the tags for an Batch resource. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren\\'t supported.</p>', 'RegisterJobDefinition' => '<p>Registers an Batch job definition.</p>', 'SubmitJob' => '<p>Submits an Batch job from a job definition. Parameters that are specified during <a>SubmitJob</a> override parameters defined in the job definition. vCPU and memory requirements that are specified in the <code>resourceRequirements</code> objects in the job definition are the exception. They can\\'t be overridden this way using the <code>memory</code> and <code>vcpus</code> parameters. Rather, you must specify updates to job definition parameters in a <code>resourceRequirements</code> object that\\'s included in the <code>containerOverrides</code> parameter.</p> <note> <p>Job queues with a scheduling policy are limited to 500 active fair share identifiers at a time. </p> </note> <important> <p>Jobs that run on Fargate resources can\\'t be guaranteed to run for more than 14 days. This is because, after 14 days, Fargate resources might become unavailable and job might be terminated.</p> </important>', 'TagResource' => '<p>Associates the specified tags to a resource with the specified <code>resourceArn</code>. If existing tags on a resource aren\\'t specified in the request parameters, they aren\\'t changed. When a resource is deleted, the tags that are associated with that resource are deleted as well. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren\\'t supported.</p>', 'TerminateJob' => '<p>Terminates a job in a job queue. Jobs that are in the <code>STARTING</code> or <code>RUNNING</code> state are terminated, which causes them to transition to <code>FAILED</code>. Jobs that have not progressed to the <code>STARTING</code> state are cancelled.</p>', 'UntagResource' => '<p>Deletes specified tags from an Batch resource.</p>', 'UpdateComputeEnvironment' => '<p>Updates an Batch compute environment.</p>', 'UpdateJobQueue' => '<p>Updates a job queue.</p>', 'UpdateSchedulingPolicy' => '<p>Updates a scheduling policy.</p>', ], 'shapes' => [ 'ArrayJobDependency' => [ 'base' => NULL, 'refs' => [ 'JobDependency$type' => '<p>The type of the job dependency.</p>', ], ], 'ArrayJobStatusSummary' => [ 'base' => NULL, 'refs' => [ 'ArrayPropertiesDetail$statusSummary' => '<p>A summary of the number of array job children in each available job status. This parameter is returned for parent array jobs.</p>', ], ], 'ArrayProperties' => [ 'base' => '<p>An object that represents an Batch array job.</p>', 'refs' => [ 'SubmitJobRequest$arrayProperties' => '<p>The array properties for the submitted job, such as the size of the array. The array size can be between 2 and 10,000. If you specify array properties for a job, it becomes an array job. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/array_jobs.html\">Array Jobs</a> in the <i>Batch User Guide</i>.</p>', ], ], 'ArrayPropertiesDetail' => [ 'base' => '<p>An object that represents the array properties of a job.</p>', 'refs' => [ 'JobDetail$arrayProperties' => '<p>The array properties of the job, if it\\'s an array job.</p>', ], ], 'ArrayPropertiesSummary' => [ 'base' => '<p>An object that represents the array properties of a job.</p>', 'refs' => [ 'JobSummary$arrayProperties' => '<p>The array properties of the job, if it\\'s an array job.</p>', ], ], 'AssignPublicIp' => [ 'base' => NULL, 'refs' => [ 'NetworkConfiguration$assignPublicIp' => '<p>Indicates whether the job has a public IP address. For a job that\\'s running on Fargate resources in a private subnet to send outbound traffic to the internet (for example, to pull container images), the private subnet requires a NAT gateway be attached to route requests to the internet. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html\">Amazon ECS task networking</a> in the <i>Amazon Elastic Container Service Developer Guide</i>. The default value is \"<code>DISABLED</code>\".</p>', ], ], 'AttemptContainerDetail' => [ 'base' => '<p>An object that represents the details of a container that\\'s part of a job attempt.</p>', 'refs' => [ 'AttemptDetail$container' => '<p>The details for the container in this job attempt.</p>', ], ], 'AttemptDetail' => [ 'base' => '<p>An object that represents a job attempt.</p>', 'refs' => [ 'AttemptDetails$member' => NULL, ], ], 'AttemptDetails' => [ 'base' => NULL, 'refs' => [ 'JobDetail$attempts' => '<p>A list of job attempts that are associated with this job.</p>', ], ], 'Boolean' => [ 'base' => NULL, 'refs' => [ 'ComputeResourceUpdate$updateToLatestImageVersion' => '<p>Specifies whether the AMI ID is updated to the latest one that\\'s supported by Batch when the compute environment has an infrastructure update. The default value is <code>false</code>.</p> <note> <p>An AMI ID can either be specified in the <code>imageId</code> or <code>imageIdOverride</code> parameters or be determined by the launch template that\\'s specified in the <code>launchTemplate</code> parameter. If an AMI ID is specified any of these ways, this parameter is ignored. For more information about to update AMI IDs during an infrastructure update, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html#updating-compute-environments-ami\">Updating the AMI ID</a> in the <i>Batch User Guide</i>.</p> </note> <p>When updating a compute environment, changing this setting requires an infrastructure update of the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p>', 'ContainerDetail$readonlyRootFilesystem' => '<p>When this parameter is true, the container is given read-only access to its root file system. This parameter maps to <code>ReadonlyRootfs</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--read-only</code> option to <a href=\"https://docs.docker.com/engine/reference/commandline/run/\"> <code>docker run</code> </a>.</p>', 'ContainerDetail$privileged' => '<p>When this parameter is true, the container is given elevated permissions on the host container instance (similar to the <code>root</code> user). The default value is <code>false</code>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources and shouldn\\'t be provided, or specified as <code>false</code>.</p> </note>', 'ContainerProperties$readonlyRootFilesystem' => '<p>When this parameter is true, the container is given read-only access to its root file system. This parameter maps to <code>ReadonlyRootfs</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--read-only</code> option to <code>docker run</code>.</p>', 'ContainerProperties$privileged' => '<p>When this parameter is true, the container is given elevated permissions on the host container instance (similar to the <code>root</code> user). This parameter maps to <code>Privileged</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--privileged</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>. The default value is false.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources and shouldn\\'t be provided, or specified as false.</p> </note>', 'EksContainerSecurityContext$privileged' => '<p>When this parameter is <code>true</code>, the container is given elevated permissions on the host container instance. The level of permissions are similar to the <code>root</code> user permissions. The default value is <code>false</code>. This parameter maps to <code>privileged</code> policy in the <a href=\"https://kubernetes.io/docs/concepts/security/pod-security-policy/#privileged\">Privileged pod security policies</a> in the <i>Kubernetes documentation</i>.</p>', 'EksContainerSecurityContext$readOnlyRootFilesystem' => '<p>When this parameter is <code>true</code>, the container is given read-only access to its root file system. The default value is <code>false</code>. This parameter maps to <code>ReadOnlyRootFilesystem</code> policy in the <a href=\"https://kubernetes.io/docs/concepts/security/pod-security-policy/#volumes-and-file-systems\">Volumes and file systems pod security policies</a> in the <i>Kubernetes documentation</i>.</p>', 'EksContainerSecurityContext$runAsNonRoot' => '<p>When this parameter is specified, the container is run as a user with a <code>uid</code> other than 0. If this parameter isn\\'t specified, so such rule is enforced. This parameter maps to <code>RunAsUser</code> and <code>MustRunAsNonRoot</code> policy in the <a href=\"https://kubernetes.io/docs/concepts/security/pod-security-policy/#users-and-groups\">Users and groups pod security policies</a> in the <i>Kubernetes documentation</i>.</p>', 'EksContainerVolumeMount$readOnly' => '<p>If this value is <code>true</code>, the container has read-only access to the volume. Otherwise, the container can write to the volume. The default value is <code>false</code>.</p>', 'EksPodProperties$hostNetwork' => '<p>Indicates if the pod uses the hosts\\' network IP address. The default value is <code>true</code>. Setting this to <code>false</code> enables the Kubernetes pod networking model. Most Batch workloads are egress-only and don\\'t require the overhead of IP allocation for each pod for incoming connections. For more information, see <a href=\"https://kubernetes.io/docs/concepts/security/pod-security-policy/#host-namespaces\">Host namespaces</a> and <a href=\"https://kubernetes.io/docs/concepts/workloads/pods/#pod-networking\">Pod networking</a> in the <i>Kubernetes documentation</i>.</p>', 'EksPodPropertiesDetail$hostNetwork' => '<p>Indicates if the pod uses the hosts\\' network IP address. The default value is <code>true</code>. Setting this to <code>false</code> enables the Kubernetes pod networking model. Most Batch workloads are egress-only and don\\'t require the overhead of IP allocation for each pod for incoming connections. For more information, see <a href=\"https://kubernetes.io/docs/concepts/security/pod-security-policy/#host-namespaces\">Host namespaces</a> and <a href=\"https://kubernetes.io/docs/concepts/workloads/pods/#pod-networking\">Pod networking</a> in the <i>Kubernetes documentation</i>.</p>', 'EksSecret$optional' => '<p>Specifies whether the secret or the secret\\'s keys must be defined.</p>', 'JobDefinition$propagateTags' => '<p>Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task. If no value is specified, the tags aren\\'t propagated. Tags can only be propagated to the tasks when the tasks are created. For tags with the same name, job tags are given priority over job definitions tags. If the total number of combined tags from the job and job definition is over 50, the job is moved to the <code>FAILED</code> state.</p>', 'JobDetail$propagateTags' => '<p>Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task. If no value is specified, the tags aren\\'t propagated. Tags can only be propagated to the tasks when the tasks are created. For tags with the same name, job tags are given priority over job definitions tags. If the total number of combined tags from the job and job definition is over 50, the job is moved to the <code>FAILED</code> state.</p>', 'JobDetail$isCancelled' => '<p>Indicates whether the job is canceled.</p>', 'JobDetail$isTerminated' => '<p>Indicates whether the job is terminated.</p>', 'LinuxParameters$initProcessEnabled' => '<p>If true, run an <code>init</code> process inside the container that forwards signals and reaps processes. This parameter maps to the <code>--init</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>. This parameter requires version 1.25 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: <code>sudo docker version | grep \"Server API version\"</code> </p>', 'MountPoint$readOnly' => '<p>If this value is <code>true</code>, the container has read-only access to the volume. Otherwise, the container can write to the volume. The default value is <code>false</code>.</p>', 'NodeDetails$isMainNode' => '<p>Specifies whether the current node is the main node for a multi-node parallel job.</p>', 'NodePropertiesSummary$isMainNode' => '<p>Specifies whether the current node is the main node for a multi-node parallel job.</p>', 'RegisterJobDefinitionRequest$propagateTags' => '<p>Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task. If no value is specified, the tags are not propagated. Tags can only be propagated to the tasks during task creation. For tags with the same name, job tags are given priority over job definitions tags. If the total number of combined tags from the job and job definition is over 50, the job is moved to the <code>FAILED</code> state.</p> <note> <p>If the job runs on Amazon EKS resources, then you must not specify <code>propagateTags</code>.</p> </note>', 'SubmitJobRequest$propagateTags' => '<p>Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task. If no value is specified, the tags aren\\'t propagated. Tags can only be propagated to the tasks during task creation. For tags with the same name, job tags are given priority over job definitions tags. If the total number of combined tags from the job and job definition is over 50, the job is moved to the <code>FAILED</code> state. When specified, this overrides the tag propagation setting in the job definition.</p>', 'UpdatePolicy$terminateJobsOnUpdate' => '<p>Specifies whether jobs are automatically terminated when the computer environment infrastructure is updated. The default value is <code>false</code>.</p>', ], ], 'CEState' => [ 'base' => NULL, 'refs' => [ 'ComputeEnvironmentDetail$state' => '<p>The state of the compute environment. The valid values are <code>ENABLED</code> or <code>DISABLED</code>.</p> <p>If the state is <code>ENABLED</code>, then the Batch scheduler can attempt to place jobs from an associated job queue on the compute resources within the environment. If the compute environment is managed, then it can scale its instances out or in automatically based on the job queue demand.</p> <p>If the state is <code>DISABLED</code>, then the Batch scheduler doesn\\'t attempt to place jobs within the environment. Jobs in a <code>STARTING</code> or <code>RUNNING</code> state continue to progress normally. Managed compute environments in the <code>DISABLED</code> state don\\'t scale out. </p> <note> <p>Compute environments in a <code>DISABLED</code> state may continue to incur billing charges. To prevent additional charges, turn off and then delete the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/compute_environment_parameters.html#compute_environment_state\">State</a> in the <i>Batch User Guide</i>.</p> </note> <p>When an instance is idle, the instance scales down to the <code>minvCpus</code> value. However, the instance size doesn\\'t change. For example, consider a <code>c5.8xlarge</code> instance with a <code>minvCpus</code> value of <code>4</code> and a <code>desiredvCpus</code> value of <code>36</code>. This instance doesn\\'t scale down to a <code>c5.large</code> instance.</p>', 'CreateComputeEnvironmentRequest$state' => '<p>The state of the compute environment. If the state is <code>ENABLED</code>, then the compute environment accepts jobs from a queue and can scale out automatically based on queues.</p> <p>If the state is <code>ENABLED</code>, then the Batch scheduler can attempt to place jobs from an associated job queue on the compute resources within the environment. If the compute environment is managed, then it can scale its instances out or in automatically, based on the job queue demand.</p> <p>If the state is <code>DISABLED</code>, then the Batch scheduler doesn\\'t attempt to place jobs within the environment. Jobs in a <code>STARTING</code> or <code>RUNNING</code> state continue to progress normally. Managed compute environments in the <code>DISABLED</code> state don\\'t scale out. </p> <note> <p>Compute environments in a <code>DISABLED</code> state may continue to incur billing charges. To prevent additional charges, turn off and then delete the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/compute_environment_parameters.html#compute_environment_state\">State</a> in the <i>Batch User Guide</i>.</p> </note> <p>When an instance is idle, the instance scales down to the <code>minvCpus</code> value. However, the instance size doesn\\'t change. For example, consider a <code>c5.8xlarge</code> instance with a <code>minvCpus</code> value of <code>4</code> and a <code>desiredvCpus</code> value of <code>36</code>. This instance doesn\\'t scale down to a <code>c5.large</code> instance.</p>', 'UpdateComputeEnvironmentRequest$state' => '<p>The state of the compute environment. Compute environments in the <code>ENABLED</code> state can accept jobs from a queue and scale in or out automatically based on the workload demand of its associated queues.</p> <p>If the state is <code>ENABLED</code>, then the Batch scheduler can attempt to place jobs from an associated job queue on the compute resources within the environment. If the compute environment is managed, then it can scale its instances out or in automatically, based on the job queue demand.</p> <p>If the state is <code>DISABLED</code>, then the Batch scheduler doesn\\'t attempt to place jobs within the environment. Jobs in a <code>STARTING</code> or <code>RUNNING</code> state continue to progress normally. Managed compute environments in the <code>DISABLED</code> state don\\'t scale out. </p> <note> <p>Compute environments in a <code>DISABLED</code> state may continue to incur billing charges. To prevent additional charges, turn off and then delete the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/compute_environment_parameters.html#compute_environment_state\">State</a> in the <i>Batch User Guide</i>.</p> </note> <p>When an instance is idle, the instance scales down to the <code>minvCpus</code> value. However, the instance size doesn\\'t change. For example, consider a <code>c5.8xlarge</code> instance with a <code>minvCpus</code> value of <code>4</code> and a <code>desiredvCpus</code> value of <code>36</code>. This instance doesn\\'t scale down to a <code>c5.large</code> instance.</p>', ], ], 'CEStatus' => [ 'base' => NULL, 'refs' => [ 'ComputeEnvironmentDetail$status' => '<p>The current status of the compute environment (for example, <code>CREATING</code> or <code>VALID</code>).</p>', ], ], 'CEType' => [ 'base' => NULL, 'refs' => [ 'ComputeEnvironmentDetail$type' => '<p>The type of the compute environment: <code>MANAGED</code> or <code>UNMANAGED</code>. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html\">Compute environments</a> in the <i>Batch User Guide</i>.</p>', 'CreateComputeEnvironmentRequest$type' => '<p>The type of the compute environment: <code>MANAGED</code> or <code>UNMANAGED</code>. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html\">Compute Environments</a> in the <i>Batch User Guide</i>.</p>', ], ], 'CRAllocationStrategy' => [ 'base' => NULL, 'refs' => [ 'ComputeResource$allocationStrategy' => '<p>The allocation strategy to use for the compute resource if not enough instances of the best fitting instance type can be allocated. This might be because of availability of the instance type in the Region or <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html\">Amazon EC2 service limits</a>. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/allocation-strategies.html\">Allocation strategies</a> in the <i>Batch User Guide</i>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note> <dl> <dt>BEST_FIT (default)</dt> <dd> <p>Batch selects an instance type that best fits the needs of the jobs with a preference for the lowest-cost instance type. If additional instances of the selected instance type aren\\'t available, Batch waits for the additional instances to be available. If there aren\\'t enough instances available or the user is reaching <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html\">Amazon EC2 service limits</a>, additional jobs aren\\'t run until the currently running jobs are completed. This allocation strategy keeps costs lower but can limit scaling. If you\\'re using Spot Fleets with <code>BEST_FIT</code>, the Spot Fleet IAM Role must be specified. Compute resources that use a <code>BEST_FIT</code> allocation strategy don\\'t support infrastructure updates and can\\'t update some parameters. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p> </dd> <dt>BEST_FIT_PROGRESSIVE</dt> <dd> <p>Batch selects additional instance types that are large enough to meet the requirements of the jobs in the queue. Its preference is for instance types with lower cost vCPUs. If additional instances of the previously selected instance types aren\\'t available, Batch selects new instance types.</p> </dd> <dt>SPOT_CAPACITY_OPTIMIZED</dt> <dd> <p>Batch selects one or more instance types that are large enough to meet the requirements of the jobs in the queue. Its preference is for instance types that are less likely to be interrupted. This allocation strategy is only available for Spot Instance compute resources.</p> </dd> </dl> <p>With both <code>BEST_FIT_PROGRESSIVE</code> and <code>SPOT_CAPACITY_OPTIMIZED</code> strategies using On-Demand or Spot Instances, and the <code>BEST_FIT</code> strategy using Spot Instances, Batch might need to exceed <code>maxvCpus</code> to meet your capacity requirements. In this event, Batch never exceeds <code>maxvCpus</code> by more than a single instance.</p>', ], ], 'CRType' => [ 'base' => NULL, 'refs' => [ 'ComputeResource$type' => '<p>The type of compute environment: <code>EC2</code>, <code>SPOT</code>, <code>FARGATE</code>, or <code>FARGATE_SPOT</code>. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html\">Compute environments</a> in the <i>Batch User Guide</i>.</p> <p> If you choose <code>SPOT</code>, you must also specify an Amazon EC2 Spot Fleet role with the <code>spotIamFleetRole</code> parameter. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/spot_fleet_IAM_role.html\">Amazon EC2 spot fleet role</a> in the <i>Batch User Guide</i>.</p>', 'ComputeResourceUpdate$type' => '<p>The type of compute environment: <code>EC2</code>, <code>SPOT</code>, <code>FARGATE</code>, or <code>FARGATE_SPOT</code>. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html\">Compute environments</a> in the <i>Batch User Guide</i>.</p> <p> If you choose <code>SPOT</code>, you must also specify an Amazon EC2 Spot Fleet role with the <code>spotIamFleetRole</code> parameter. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/spot_fleet_IAM_role.html\">Amazon EC2 spot fleet role</a> in the <i>Batch User Guide</i>.</p> <p>When updating a compute environment, changing the type of a compute environment requires an infrastructure update of the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p>', ], ], 'CRUpdateAllocationStrategy' => [ 'base' => NULL, 'refs' => [ 'ComputeResourceUpdate$allocationStrategy' => '<p>The allocation strategy to use for the compute resource if there\\'s not enough instances of the best fitting instance type that can be allocated. This might be because of availability of the instance type in the Region or <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html\">Amazon EC2 service limits</a>. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/allocation-strategies.html\">Allocation strategies</a> in the <i>Batch User Guide</i>.</p> <p>When updating a compute environment, changing the allocation strategy requires an infrastructure update of the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>. <code>BEST_FIT</code> isn\\'t supported when updating a compute environment.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note> <dl> <dt>BEST_FIT_PROGRESSIVE</dt> <dd> <p>Batch selects additional instance types that are large enough to meet the requirements of the jobs in the queue. Its preference is for instance types with lower cost vCPUs. If additional instances of the previously selected instance types aren\\'t available, Batch selects new instance types.</p> </dd> <dt>SPOT_CAPACITY_OPTIMIZED</dt> <dd> <p>Batch selects one or more instance types that are large enough to meet the requirements of the jobs in the queue. Its preference is for instance types that are less likely to be interrupted. This allocation strategy is only available for Spot Instance compute resources.</p> </dd> </dl> <p>With both <code>BEST_FIT_PROGRESSIVE</code> and <code>SPOT_CAPACITY_OPTIMIZED</code> strategies using On-Demand or Spot Instances, and the <code>BEST_FIT</code> strategy using Spot Instances, Batch might need to exceed <code>maxvCpus</code> to meet your capacity requirements. In this event, Batch never exceeds <code>maxvCpus</code> by more than a single instance.</p>', ], ], 'CancelJobRequest' => [ 'base' => '<p>Contains the parameters for <code>CancelJob</code>.</p>', 'refs' => [], ], 'CancelJobResponse' => [ 'base' => NULL, 'refs' => [], ], 'ClientException' => [ 'base' => '<p>These errors are usually caused by a client action. One example cause is using an action or resource on behalf of a user that doesn\\'t have permissions to use the action or resource. Another cause is specifying an identifier that\\'s not valid.</p>', 'refs' => [], ], 'ComputeEnvironmentDetail' => [ 'base' => '<p>An object that represents an Batch compute environment.</p>', 'refs' => [ 'ComputeEnvironmentDetailList$member' => NULL, ], ], 'ComputeEnvironmentDetailList' => [ 'base' => NULL, 'refs' => [ 'DescribeComputeEnvironmentsResponse$computeEnvironments' => '<p>The list of compute environments.</p>', ], ], 'ComputeEnvironmentOrder' => [ 'base' => '<p>The order that compute environments are tried in for job placement within a queue. Compute environments are tried in ascending order. For example, if two compute environments are associated with a job queue, the compute environment with a lower order integer value is tried for job placement first. Compute environments must be in the <code>VALID</code> state before you can associate them with a job queue. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>); EC2 and Fargate compute environments can\\'t be mixed.</p> <note> <p>All compute environments that are associated with a job queue must share the same architecture. Batch doesn\\'t support mixing compute environment architecture types in a single job queue.</p> </note>', 'refs' => [ 'ComputeEnvironmentOrders$member' => NULL, ], ], 'ComputeEnvironmentOrders' => [ 'base' => NULL, 'refs' => [ 'CreateJobQueueRequest$computeEnvironmentOrder' => '<p>The set of compute environments mapped to a job queue and their order relative to each other. The job scheduler uses this parameter to determine which compute environment runs a specific job. Compute environments must be in the <code>VALID</code> state before you can associate them with a job queue. You can associate up to three compute environments with a job queue. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>); EC2 and Fargate compute environments can\\'t be mixed.</p> <note> <p>All compute environments that are associated with a job queue must share the same architecture. Batch doesn\\'t support mixing compute environment architecture types in a single job queue.</p> </note>', 'JobQueueDetail$computeEnvironmentOrder' => '<p>The compute environments that are attached to the job queue and the order that job placement is preferred. Compute environments are selected for job placement in ascending order.</p>', 'UpdateJobQueueRequest$computeEnvironmentOrder' => '<p>Details the set of compute environments mapped to a job queue and their order relative to each other. This is one of the parameters used by the job scheduler to determine which compute environment runs a given job. Compute environments must be in the <code>VALID</code> state before you can associate them with a job queue. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>). EC2 and Fargate compute environments can\\'t be mixed.</p> <note> <p>All compute environments that are associated with a job queue must share the same architecture. Batch doesn\\'t support mixing compute environment architecture types in a single job queue.</p> </note>', ], ], 'ComputeResource' => [ 'base' => '<p>An object that represents an Batch compute resource. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html\">Compute environments</a> in the <i>Batch User Guide</i>.</p>', 'refs' => [ 'ComputeEnvironmentDetail$computeResources' => '<p>The compute resources defined for the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html\">Compute environments</a> in the <i>Batch User Guide</i>.</p>', 'CreateComputeEnvironmentRequest$computeResources' => '<p>Details about the compute resources managed by the compute environment. This parameter is required for managed compute environments. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html\">Compute Environments</a> in the <i>Batch User Guide</i>.</p>', ], ], 'ComputeResourceUpdate' => [ 'base' => '<p>An object that represents the attributes of a compute environment that can be updated. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p>', 'refs' => [ 'UpdateComputeEnvironmentRequest$computeResources' => '<p>Details of the compute resources managed by the compute environment. Required for a managed compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html\">Compute Environments</a> in the <i>Batch User Guide</i>.</p>', ], ], 'ContainerDetail' => [ 'base' => '<p>An object that represents the details of a container that\\'s part of a job.</p>', 'refs' => [ 'JobDetail$container' => '<p>An object that represents the details for the container that\\'s associated with the job.</p>', ], ], 'ContainerOverrides' => [ 'base' => '<p>The overrides that should be sent to a container.</p>', 'refs' => [ 'NodePropertyOverride$containerOverrides' => '<p>The overrides that are sent to a node range.</p>', 'SubmitJobRequest$containerOverrides' => '<p>An object with various properties that override the defaults for the job definition that specify the name of a container in the specified job definition and the overrides it should receive. You can override the default command for a container, which is specified in the job definition or the Docker image, with a <code>command</code> override. You can also override existing environment variables on a container or add new environment variables to it with an <code>environment</code> override.</p>', ], ], 'ContainerProperties' => [ 'base' => '<p>Container properties are used for Amazon ECS based job definitions. These properties to describe the container that\\'s launched as part of a job.</p>', 'refs' => [ 'JobDefinition$containerProperties' => '<p>An object with various properties specific to Amazon ECS based jobs. Valid values are <code>containerProperties</code>, <code>eksProperties</code>, and <code>nodeProperties</code>. Only one can be specified.</p>', 'NodeRangeProperty$container' => '<p>The container details for the node range.</p>', 'RegisterJobDefinitionRequest$containerProperties' => '<p>An object with various properties specific to Amazon ECS based single-node container-based jobs. If the job definition\\'s <code>type</code> parameter is <code>container</code>, then you must specify either <code>containerProperties</code> or <code>nodeProperties</code>. This must not be specified for Amazon EKS based job definitions.</p> <note> <p>If the job runs on Fargate resources, then you must not specify <code>nodeProperties</code>; use only <code>containerProperties</code>.</p> </note>', ], ], 'ContainerSummary' => [ 'base' => '<p>An object that represents summary details of a container within a job.</p>', 'refs' => [ 'JobSummary$container' => '<p>An object that represents the details of the container that\\'s associated with the job.</p>', ], ], 'CreateComputeEnvironmentRequest' => [ 'base' => '<p>Contains the parameters for <code>CreateComputeEnvironment</code>.</p>', 'refs' => [], ], 'CreateComputeEnvironmentResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateJobQueueRequest' => [ 'base' => '<p>Contains the parameters for <code>CreateJobQueue</code>.</p>', 'refs' => [], ], 'CreateJobQueueResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateSchedulingPolicyRequest' => [ 'base' => '<p>Contains the parameters for <code>CreateSchedulingPolicy</code>.</p>', 'refs' => [], ], 'CreateSchedulingPolicyResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteComputeEnvironmentRequest' => [ 'base' => '<p>Contains the parameters for <code>DeleteComputeEnvironment</code>.</p>', 'refs' => [], ], 'DeleteComputeEnvironmentResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteJobQueueRequest' => [ 'base' => '<p>Contains the parameters for <code>DeleteJobQueue</code>.</p>', 'refs' => [], ], 'DeleteJobQueueResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteSchedulingPolicyRequest' => [ 'base' => '<p>Contains the parameters for <code>DeleteSchedulingPolicy</code>.</p>', 'refs' => [], ], 'DeleteSchedulingPolicyResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeregisterJobDefinitionRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeregisterJobDefinitionResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeComputeEnvironmentsRequest' => [ 'base' => '<p>Contains the parameters for <code>DescribeComputeEnvironments</code>.</p>', 'refs' => [], ], 'DescribeComputeEnvironmentsResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeJobDefinitionsRequest' => [ 'base' => '<p>Contains the parameters for <code>DescribeJobDefinitions</code>.</p>', 'refs' => [], ], 'DescribeJobDefinitionsResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeJobQueuesRequest' => [ 'base' => '<p>Contains the parameters for <code>DescribeJobQueues</code>.</p>', 'refs' => [], ], 'DescribeJobQueuesResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeJobsRequest' => [ 'base' => '<p>Contains the parameters for <code>DescribeJobs</code>.</p>', 'refs' => [], ], 'DescribeJobsResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeSchedulingPoliciesRequest' => [ 'base' => '<p>Contains the parameters for <code>DescribeSchedulingPolicies</code>.</p>', 'refs' => [], ], 'DescribeSchedulingPoliciesResponse' => [ 'base' => NULL, 'refs' => [], ], 'Device' => [ 'base' => '<p>An object that represents a container instance host device.</p> <note> <p>This object isn\\'t applicable to jobs that are running on Fargate resources and shouldn\\'t be provided.</p> </note>', 'refs' => [ 'DevicesList$member' => NULL, ], ], 'DeviceCgroupPermission' => [ 'base' => NULL, 'refs' => [ 'DeviceCgroupPermissions$member' => NULL, ], ], 'DeviceCgroupPermissions' => [ 'base' => NULL, 'refs' => [ 'Device$permissions' => '<p>The explicit permissions to provide to the container for the device. By default, the container has permissions for <code>read</code>, <code>write</code>, and <code>mknod</code> for the device.</p>', ], ], 'DevicesList' => [ 'base' => NULL, 'refs' => [ 'LinuxParameters$devices' => '<p>Any of the host devices to expose to the container. This parameter maps to <code>Devices</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--device</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t provide it for these jobs.</p> </note>', ], ], 'EFSAuthorizationConfig' => [ 'base' => '<p>The authorization configuration details for the Amazon EFS file system.</p>', 'refs' => [ 'EFSVolumeConfiguration$authorizationConfig' => '<p>The authorization configuration details for the Amazon EFS file system.</p>', ], ], 'EFSAuthorizationConfigIAM' => [ 'base' => NULL, 'refs' => [ 'EFSAuthorizationConfig$iam' => '<p>Whether or not to use the Batch job IAM role defined in a job definition when mounting the Amazon EFS file system. If enabled, transit encryption must be enabled in the <code>EFSVolumeConfiguration</code>. If this parameter is omitted, the default value of <code>DISABLED</code> is used. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/efs-volumes.html#efs-volume-accesspoints\">Using Amazon EFS access points</a> in the <i>Batch User Guide</i>. EFS IAM authorization requires that <code>TransitEncryption</code> be <code>ENABLED</code> and that a <code>JobRoleArn</code> is specified.</p>', ], ], 'EFSTransitEncryption' => [ 'base' => NULL, 'refs' => [ 'EFSVolumeConfiguration$transitEncryption' => '<p>Determines whether to enable encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server. Transit encryption must be enabled if Amazon EFS IAM authorization is used. If this parameter is omitted, the default value of <code>DISABLED</code> is used. For more information, see <a href=\"https://docs.aws.amazon.com/efs/latest/ug/encryption-in-transit.html\">Encrypting data in transit</a> in the <i>Amazon Elastic File System User Guide</i>.</p>', ], ], 'EFSVolumeConfiguration' => [ 'base' => '<p>This is used when you\\'re using an Amazon Elastic File System file system for job storage. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/efs-volumes.html\">Amazon EFS Volumes</a> in the <i>Batch User Guide</i>.</p>', 'refs' => [ 'Volume$efsVolumeConfiguration' => '<p>This parameter is specified when you\\'re using an Amazon Elastic File System file system for job storage. Jobs that are running on Fargate resources must specify a <code>platformVersion</code> of at least <code>1.4.0</code>.</p>', ], ], 'Ec2Configuration' => [ 'base' => '<p>Provides information used to select Amazon Machine Images (AMIs) for instances in the compute environment. If <code>Ec2Configuration</code> isn\\'t specified, the default is <code>ECS_AL2</code> (<a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html#al2ami\">Amazon Linux 2</a>).</p> <note> <p>This object isn\\'t applicable to jobs that are running on Fargate resources.</p> </note>', 'refs' => [ 'Ec2ConfigurationList$member' => NULL, ], ], 'Ec2ConfigurationList' => [ 'base' => NULL, 'refs' => [ 'ComputeResource$ec2Configuration' => '<p>Provides information that\\'s used to select Amazon Machine Images (AMIs) for EC2 instances in the compute environment. If <code>Ec2Configuration</code> isn\\'t specified, the default is <code>ECS_AL2</code>.</p> <p>One or two values can be provided.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', 'ComputeResourceUpdate$ec2Configuration' => '<p>Provides information used to select Amazon Machine Images (AMIs) for EC2 instances in the compute environment. If <code>Ec2Configuration</code> isn\\'t specified, the default is <code>ECS_AL2</code>.</p> <p>When updating a compute environment, changing this setting requires an infrastructure update of the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>. To remove the EC2 configuration and any custom AMI ID specified in <code>imageIdOverride</code>, set this value to an empty string.</p> <p>One or two values can be provided.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', ], ], 'EksAttemptContainerDetail' => [ 'base' => '<p>An object that represents the details for an attempt for a job attempt that an Amazon EKS container runs.</p>', 'refs' => [ 'EksAttemptContainerDetails$member' => NULL, ], ], 'EksAttemptContainerDetails' => [ 'base' => NULL, 'refs' => [ 'EksAttemptDetail$containers' => '<p>The details for the final status of the containers for this job attempt.</p>', ], ], 'EksAttemptDetail' => [ 'base' => '<p>An object that represents the details of a job attempt for a job attempt by an Amazon EKS container.</p>', 'refs' => [ 'EksAttemptDetails$member' => NULL, ], ], 'EksAttemptDetails' => [ 'base' => NULL, 'refs' => [ 'JobDetail$eksAttempts' => '<p>A list of job attempts that are associated with this job.</p>', ], ], 'EksConfiguration' => [ 'base' => '<p>Configuration for the Amazon EKS cluster that supports the Batch compute environment. The cluster must exist before the compute environment can be created.</p>', 'refs' => [ 'ComputeEnvironmentDetail$eksConfiguration' => '<p>The configuration for the Amazon EKS cluster that supports the Batch compute environment. Only specify this parameter if the <code>containerOrchestrationType</code> is <code>EKS</code>.</p>', 'CreateComputeEnvironmentRequest$eksConfiguration' => '<p>The details for the Amazon EKS cluster that supports the compute environment.</p>', ], ], 'EksContainer' => [ 'base' => '<p>EKS container properties are used in job definitions for Amazon EKS based job definitions to describe the properties for a container node in the pod that\\'s launched as part of a job. This can\\'t be specified for Amazon ECS based job definitions.</p>', 'refs' => [ 'EksContainers$member' => NULL, ], ], 'EksContainerDetail' => [ 'base' => '<p>The details for container properties that are returned by <code>DescribeJobs</code> for jobs that use Amazon EKS.</p>', 'refs' => [ 'EksContainerDetails$member' => NULL, ], ], 'EksContainerDetails' => [ 'base' => NULL, 'refs' => [ 'EksPodPropertiesDetail$containers' => '<p>The properties of the container that\\'s used on the Amazon EKS pod.</p>', ], ], 'EksContainerEnvironmentVariable' => [ 'base' => '<p>An environment variable.</p>', 'refs' => [ 'EksContainerEnvironmentVariables$member' => NULL, ], ], 'EksContainerEnvironmentVariables' => [ 'base' => NULL, 'refs' => [ 'EksContainer$env' => '<p>The environment variables to pass to a container.</p> <note> <p>Environment variables cannot start with \"<code>AWS_BATCH</code>\". This naming convention is reserved for variables that Batch sets.</p> </note>', 'EksContainerDetail$env' => '<p>The environment variables to pass to a container.</p> <note> <p>Environment variables cannot start with \"<code>AWS_BATCH</code>\". This naming convention is reserved for variables that Batch sets.</p> </note>', 'EksContainerOverride$env' => '<p>The environment variables to send to the container. You can add new environment variables, which are added to the container at launch. Or, you can override the existing environment variables from the Docker image or the job definition.</p> <note> <p>Environment variables cannot start with \"<code>AWS_BATCH</code>\". This naming convention is reserved for variables that Batch sets.</p> </note>', ], ], 'EksContainerOverride' => [ 'base' => '<p>Object representing any Kubernetes overrides to a job definition that\\'s used in a <a>SubmitJob</a> API operation.</p>', 'refs' => [ 'EksContainerOverrideList$member' => NULL, ], ], 'EksContainerOverrideList' => [ 'base' => NULL, 'refs' => [ 'EksPodPropertiesOverride$containers' => '<p>The overrides for the container that\\'s used on the Amazon EKS pod.</p>', ], ], 'EksContainerResourceRequirements' => [ 'base' => '<p>The type and amount of resources to assign to a container. The supported resources include <code>memory</code>, <code>cpu</code>, and <code>nvidia.com/gpu</code>. For more information, see <a href=\"https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/\">Resource management for pods and containers</a> in the <i>Kubernetes documentation</i>.</p>', 'refs' => [ 'EksContainer$resources' => '<p>The type and amount of resources to assign to a container. The supported resources include <code>memory</code>, <code>cpu</code>, and <code>nvidia.com/gpu</code>. For more information, see <a href=\"https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/\">Resource management for pods and containers</a> in the <i>Kubernetes documentation</i>.</p>', 'EksContainerDetail$resources' => '<p>The type and amount of resources to assign to a container. The supported resources include <code>memory</code>, <code>cpu</code>, and <code>nvidia.com/gpu</code>. For more information, see <a href=\"https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/\">Resource management for pods and containers</a> in the <i>Kubernetes documentation</i>.</p>', 'EksContainerOverride$resources' => '<p>The type and amount of resources to assign to a container. These override the settings in the job definition. The supported resources include <code>memory</code>, <code>cpu</code>, and <code>nvidia.com/gpu</code>. For more information, see <a href=\"https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/\">Resource management for pods and containers</a> in the <i>Kubernetes documentation</i>.</p>', ], ], 'EksContainerSecurityContext' => [ 'base' => '<p>The security context for a job. For more information, see <a href=\"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/\">Configure a security context for a pod or container</a> in the <i>Kubernetes documentation</i>.</p>', 'refs' => [ 'EksContainer$securityContext' => '<p>The security context for a job. For more information, see <a href=\"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/\">Configure a security context for a pod or container</a> in the <i>Kubernetes documentation</i>.</p>', 'EksContainerDetail$securityContext' => '<p>The security context for a job. For more information, see <a href=\"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/\">Configure a security context for a pod or container</a> in the <i>Kubernetes documentation</i>.</p>', ], ], 'EksContainerVolumeMount' => [ 'base' => '<p>The volume mounts for a container for an Amazon EKS job. For more information about volumes and volume mounts in Kubernetes, see <a href=\"https://kubernetes.io/docs/concepts/storage/volumes/\">Volumes</a> in the <i>Kubernetes documentation</i>.</p>', 'refs' => [ 'EksContainerVolumeMounts$member' => NULL, ], ], 'EksContainerVolumeMounts' => [ 'base' => NULL, 'refs' => [ 'EksContainer$volumeMounts' => '<p>The volume mounts for the container. Batch supports <code>emptyDir</code>, <code>hostPath</code>, and <code>secret</code> volume types. For more information about volumes and volume mounts in Kubernetes, see <a href=\"https://kubernetes.io/docs/concepts/storage/volumes/\">Volumes</a> in the <i>Kubernetes documentation</i>.</p>', 'EksContainerDetail$volumeMounts' => '<p>The volume mounts for the container. Batch supports <code>emptyDir</code>, <code>hostPath</code>, and <code>secret</code> volume types. For more information about volumes and volume mounts in Kubernetes, see <a href=\"https://kubernetes.io/docs/concepts/storage/volumes/\">Volumes</a> in the <i>Kubernetes documentation</i>.</p>', ], ], 'EksContainers' => [ 'base' => NULL, 'refs' => [ 'EksPodProperties$containers' => '<p>The properties of the container that\\'s used on the Amazon EKS pod.</p>', ], ], 'EksEmptyDir' => [ 'base' => '<p>Specifies the configuration of a Kubernetes <code>emptyDir</code> volume. An <code>emptyDir</code> volume is first created when a pod is assigned to a node. It exists as long as that pod is running on that node. The <code>emptyDir</code> volume is initially empty. All containers in the pod can read and write the files in the <code>emptyDir</code> volume. However, the <code>emptyDir</code> volume can be mounted at the same or different paths in each container. When a pod is removed from a node for any reason, the data in the <code>emptyDir</code> is deleted permanently. For more information, see <a href=\"https://kubernetes.io/docs/concepts/storage/volumes/#emptydir\">emptyDir</a> in the <i>Kubernetes documentation</i>.</p>', 'refs' => [ 'EksVolume$emptyDir' => '<p>Specifies the configuration of a Kubernetes <code>emptyDir</code> volume. For more information, see <a href=\"https://kubernetes.io/docs/concepts/storage/volumes/#emptydir\">emptyDir</a> in the <i>Kubernetes documentation</i>.</p>', ], ], 'EksHostPath' => [ 'base' => '<p>Specifies the configuration of a Kubernetes <code>hostPath</code> volume. A <code>hostPath</code> volume mounts an existing file or directory from the host node\\'s filesystem into your pod. For more information, see <a href=\"https://kubernetes.io/docs/concepts/storage/volumes/#hostpath\">hostPath</a> in the <i>Kubernetes documentation</i>.</p>', 'refs' => [ 'EksVolume$hostPath' => '<p>Specifies the configuration of a Kubernetes <code>hostPath</code> volume. For more information, see <a href=\"https://kubernetes.io/docs/concepts/storage/volumes/#hostpath\">hostPath</a> in the <i>Kubernetes documentation</i>.</p>', ], ], 'EksLabelsMap' => [ 'base' => NULL, 'refs' => [ 'EksMetadata$labels' => '<p>Key-value pairs used to identify, sort, and organize cube resources. Can contain up to 63 uppercase letters, lowercase letters, numbers, hyphens (-), and underscores (_). Labels can be added or modified at any time. Each resource can have multiple labels, but each key must be unique for a given object.</p>', ], ], 'EksLimits' => [ 'base' => NULL, 'refs' => [ 'EksContainerResourceRequirements$limits' => '<p>The type and quantity of the resources to reserve for the container. The values vary based on the <code>name</code> that\\'s specified. Resources can be requested using either the <code>limits</code> or the <code>requests</code> objects.</p> <dl> <dt>memory</dt> <dd> <p>The memory hard limit (in MiB) for the container, using whole integers, with a \"Mi\" suffix. If your container attempts to exceed the memory specified, the container is terminated. You must specify at least 4 MiB of memory for a job. <code>memory</code> can be specified in <code>limits</code>, <code>requests</code>, or both. If <code>memory</code> is specified in both places, then the value that\\'s specified in <code>limits</code> must be equal to the value that\\'s specified in <code>requests</code>.</p> <note> <p>To maximize your resource utilization, provide your jobs with as much memory as possible for the specific instance type that you are using. To learn how, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/memory-management.html\">Memory management</a> in the <i>Batch User Guide</i>.</p> </note> </dd> <dt>cpu</dt> <dd> <p>The number of CPUs that\\'s reserved for the container. Values must be an even multiple of <code>0.25</code>. <code>cpu</code> can be specified in <code>limits</code>, <code>requests</code>, or both. If <code>cpu</code> is specified in both places, then the value that\\'s specified in <code>limits</code> must be at least as large as the value that\\'s specified in <code>requests</code>.</p> </dd> <dt>nvidia.com/gpu</dt> <dd> <p>The number of GPUs that\\'s reserved for the container. Values must be a whole integer. <code>memory</code> can be specified in <code>limits</code>, <code>requests</code>, or both. If <code>memory</code> is specified in both places, then the value that\\'s specified in <code>limits</code> must be equal to the value that\\'s specified in <code>requests</code>.</p> </dd> </dl>', ], ], 'EksMetadata' => [ 'base' => '<p>Describes and uniquely identifies Kubernetes resources. For example, the compute environment that a pod runs in or the <code>jobID</code> for a job running in the pod. For more information, see <a href=\"https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/\">Understanding Kubernetes Objects</a> in the <i>Kubernetes documentation</i>.</p>', 'refs' => [ 'EksPodProperties$metadata' => '<p>Metadata about the Kubernetes pod. For more information, see <a href=\"https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/\">Understanding Kubernetes Objects</a> in the <i>Kubernetes documentation</i>.</p>', 'EksPodPropertiesDetail$metadata' => NULL, 'EksPodPropertiesOverride$metadata' => '<p>Metadata about the overrides for the container that\\'s used on the Amazon EKS pod.</p>', ], ], 'EksPodProperties' => [ 'base' => '<p>The properties for the pod.</p>', 'refs' => [ 'EksProperties$podProperties' => '<p>The properties for the Kubernetes pod resources of a job.</p>', ], ], 'EksPodPropertiesDetail' => [ 'base' => '<p>The details for the pod.</p>', 'refs' => [ 'EksPropertiesDetail$podProperties' => '<p>The properties for the Kubernetes pod resources of a job.</p>', ], ], 'EksPodPropertiesOverride' => [ 'base' => '<p>An object that contains overrides for the Kubernetes pod properties of a job.</p>', 'refs' => [ 'EksPropertiesOverride$podProperties' => '<p>The overrides for the Kubernetes pod resources of a job.</p>', ], ], 'EksProperties' => [ 'base' => '<p>An object that contains the properties for the Kubernetes resources of a job.</p>', 'refs' => [ 'JobDefinition$eksProperties' => '<p>An object with various properties that are specific to Amazon EKS based jobs. Valid values are <code>containerProperties</code>, <code>eksProperties</code>, and <code>nodeProperties</code>. Only one can be specified.</p>', 'RegisterJobDefinitionRequest$eksProperties' => '<p>An object with various properties that are specific to Amazon EKS based jobs. This must not be specified for Amazon ECS based job definitions.</p>', ], ], 'EksPropertiesDetail' => [ 'base' => '<p>An object that contains the details for the Kubernetes resources of a job.</p>', 'refs' => [ 'JobDetail$eksProperties' => '<p>An object with various properties that are specific to Amazon EKS based jobs. Only one of <code>container</code>, <code>eksProperties</code>, or <code>nodeDetails</code> is specified.</p>', ], ], 'EksPropertiesOverride' => [ 'base' => '<p>An object that contains overrides for the Kubernetes resources of a job.</p>', 'refs' => [ 'SubmitJobRequest$eksPropertiesOverride' => '<p>An object that can only be specified for jobs that are run on Amazon EKS resources with various properties that override defaults for the job definition.</p>', ], ], 'EksRequests' => [ 'base' => NULL, 'refs' => [ 'EksContainerResourceRequirements$requests' => '<p>The type and quantity of the resources to request for the container. The values vary based on the <code>name</code> that\\'s specified. Resources can be requested by using either the <code>limits</code> or the <code>requests</code> objects.</p> <dl> <dt>memory</dt> <dd> <p>The memory hard limit (in MiB) for the container, using whole integers, with a \"Mi\" suffix. If your container attempts to exceed the memory specified, the container is terminated. You must specify at least 4 MiB of memory for a job. <code>memory</code> can be specified in <code>limits</code>, <code>requests</code>, or both. If <code>memory</code> is specified in both, then the value that\\'s specified in <code>limits</code> must be equal to the value that\\'s specified in <code>requests</code>.</p> <note> <p>If you\\'re trying to maximize your resource utilization by providing your jobs as much memory as possible for a particular instance type, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/memory-management.html\">Memory management</a> in the <i>Batch User Guide</i>.</p> </note> </dd> <dt>cpu</dt> <dd> <p>The number of CPUs that are reserved for the container. Values must be an even multiple of <code>0.25</code>. <code>cpu</code> can be specified in <code>limits</code>, <code>requests</code>, or both. If <code>cpu</code> is specified in both, then the value that\\'s specified in <code>limits</code> must be at least as large as the value that\\'s specified in <code>requests</code>.</p> </dd> <dt>nvidia.com/gpu</dt> <dd> <p>The number of GPUs that are reserved for the container. Values must be a whole integer. <code>nvidia.com/gpu</code> can be specified in <code>limits</code>, <code>requests</code>, or both. If <code>nvidia.com/gpu</code> is specified in both, then the value that\\'s specified in <code>limits</code> must be equal to the value that\\'s specified in <code>requests</code>.</p> </dd> </dl>', ], ], 'EksSecret' => [ 'base' => '<p>Specifies the configuration of a Kubernetes <code>secret</code> volume. For more information, see <a href=\"https://kubernetes.io/docs/concepts/storage/volumes/#secret\">secret</a> in the <i>Kubernetes documentation</i>.</p>', 'refs' => [ 'EksVolume$secret' => '<p>Specifies the configuration of a Kubernetes <code>secret</code> volume. For more information, see <a href=\"https://kubernetes.io/docs/concepts/storage/volumes/#secret\">secret</a> in the <i>Kubernetes documentation</i>.</p>', ], ], 'EksVolume' => [ 'base' => '<p>Specifies an Amazon EKS volume for a job definition.</p>', 'refs' => [ 'EksVolumes$member' => NULL, ], ], 'EksVolumes' => [ 'base' => NULL, 'refs' => [ 'EksPodProperties$volumes' => '<p>Specifies the volumes for a job definition that uses Amazon EKS resources.</p>', 'EksPodPropertiesDetail$volumes' => '<p>Specifies the volumes for a job definition using Amazon EKS resources.</p>', ], ], 'EnvironmentVariables' => [ 'base' => NULL, 'refs' => [ 'ContainerDetail$environment' => '<p>The environment variables to pass to a container.</p> <note> <p>Environment variables cannot start with \"<code>AWS_BATCH</code>\". This naming convention is reserved for variables that Batch sets.</p> </note>', 'ContainerOverrides$environment' => '<p>The environment variables to send to the container. You can add new environment variables, which are added to the container at launch, or you can override the existing environment variables from the Docker image or the job definition.</p> <note> <p>Environment variables cannot start with \"<code>AWS_BATCH</code>\". This naming convention is reserved for variables that Batch sets.</p> </note>', 'ContainerProperties$environment' => '<p>The environment variables to pass to a container. This parameter maps to <code>Env</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--env</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>.</p> <important> <p>We don\\'t recommend using plaintext environment variables for sensitive information, such as credential data.</p> </important> <note> <p>Environment variables cannot start with \"<code>AWS_BATCH</code>\". This naming convention is reserved for variables that Batch sets.</p> </note>', ], ], 'EphemeralStorage' => [ 'base' => '<p>The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on Fargate.</p>', 'refs' => [ 'ContainerDetail$ephemeralStorage' => '<p>The amount of ephemeral storage allocated for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on Fargate.</p>', 'ContainerProperties$ephemeralStorage' => '<p>The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on Fargate.</p>', ], ], 'EvaluateOnExit' => [ 'base' => '<p>Specifies an array of up to 5 conditions to be met, and an action to take (<code>RETRY</code> or <code>EXIT</code>) if all conditions are met. If none of the <code>EvaluateOnExit</code> conditions in a <code>RetryStrategy</code> match, then the job is retried.</p>', 'refs' => [ 'EvaluateOnExitList$member' => NULL, ], ], 'EvaluateOnExitList' => [ 'base' => NULL, 'refs' => [ 'RetryStrategy$evaluateOnExit' => '<p>Array of up to 5 objects that specify the conditions where jobs are retried or failed. If this parameter is specified, then the <code>attempts</code> parameter must also be specified. If none of the listed conditions match, then the job is retried.</p>', ], ], 'FairsharePolicy' => [ 'base' => '<p>The fair share policy for a scheduling policy.</p>', 'refs' => [ 'CreateSchedulingPolicyRequest$fairsharePolicy' => '<p>The fair share policy of the scheduling policy.</p>', 'SchedulingPolicyDetail$fairsharePolicy' => '<p>The fair share policy for the scheduling policy.</p>', 'UpdateSchedulingPolicyRequest$fairsharePolicy' => '<p>The fair share policy.</p>', ], ], 'FargatePlatformConfiguration' => [ 'base' => '<p>The platform configuration for jobs that are running on Fargate resources. Jobs that run on EC2 resources must not specify this parameter.</p>', 'refs' => [ 'ContainerDetail$fargatePlatformConfiguration' => '<p>The platform configuration for jobs that are running on Fargate resources. Jobs that are running on EC2 resources must not specify this parameter.</p>', 'ContainerProperties$fargatePlatformConfiguration' => '<p>The platform configuration for jobs that are running on Fargate resources. Jobs that are running on EC2 resources must not specify this parameter.</p>', ], ], 'Float' => [ 'base' => NULL, 'refs' => [ 'ShareAttributes$weightFactor' => '<p>The weight factor for the fair share identifier. The default value is 1.0. A lower value has a higher priority for compute resources. For example, jobs that use a share identifier with a weight factor of 0.125 (1/8) get 8 times the compute resources of jobs that use a share identifier with a weight factor of 1.</p> <p>The smallest supported value is 0.0001, and the largest supported value is 999.9999.</p>', ], ], 'Host' => [ 'base' => '<p>Determine whether your data volume persists on the host container instance and where it\\'s stored. If this parameter is empty, then the Docker daemon assigns a host path for your data volume. However, the data isn\\'t guaranteed to persist after the containers that are associated with it stop running.</p>', 'refs' => [ 'Volume$host' => '<p>The contents of the <code>host</code> parameter determine whether your data volume persists on the host container instance and where it\\'s stored. If the host parameter is empty, then the Docker daemon assigns a host path for your data volume. However, the data isn\\'t guaranteed to persist after the containers that are associated with it stop running.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources and shouldn\\'t be provided.</p> </note>', ], ], 'ImageIdOverride' => [ 'base' => NULL, 'refs' => [ 'Ec2Configuration$imageIdOverride' => '<p>The AMI ID used for instances launched in the compute environment that match the image type. This setting overrides the <code>imageId</code> set in the <code>computeResource</code> object.</p> <note> <p>The AMI that you choose for a compute environment must match the architecture of the instance types that you intend to use for that compute environment. For example, if your compute environment uses A1 instance types, the compute resource AMI that you choose must support ARM instances. Amazon ECS vends both x86 and ARM versions of the Amazon ECS-optimized Amazon Linux 2 AMI. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html#ecs-optimized-ami-linux-variants.html\">Amazon ECS-optimized Amazon Linux 2 AMI</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p> </note>', ], ], 'ImageType' => [ 'base' => NULL, 'refs' => [ 'Ec2Configuration$imageType' => '<p>The image type to match with the instance type to select an AMI. The supported values are different for <code>ECS</code> and <code>EKS</code> resources.</p> <dl> <dt>ECS</dt> <dd> <p>If the <code>imageIdOverride</code> parameter isn\\'t specified, then a recent <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html#al2ami\">Amazon ECS-optimized Amazon Linux 2 AMI</a> (<code>ECS_AL2</code>) is used. If a new image type is specified in an update, but neither an <code>imageId</code> nor a <code>imageIdOverride</code> parameter is specified, then the latest Amazon ECS optimized AMI for that image type that\\'s supported by Batch is used.</p> <dl> <dt>ECS_AL2</dt> <dd> <p> <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html#al2ami\">Amazon Linux 2</a>: Default for all non-GPU instance families.</p> </dd> <dt>ECS_AL2_NVIDIA</dt> <dd> <p> <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html#gpuami\">Amazon Linux 2 (GPU)</a>: Default for all GPU instance families (for example <code>P4</code> and <code>G4</code>) and can be used for all non Amazon Web Services Graviton-based instance types.</p> </dd> <dt>ECS_AL1</dt> <dd> <p> <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html#alami\">Amazon Linux</a>. Amazon Linux has reached the end-of-life of standard support. For more information, see <a href=\"http://aws.amazon.com/amazon-linux-ami/\">Amazon Linux AMI</a>.</p> </dd> </dl> </dd> <dt>EKS</dt> <dd> <p>If the <code>imageIdOverride</code> parameter isn\\'t specified, then a recent <a href=\"https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-ami.html\">Amazon EKS-optimized Amazon Linux AMI</a> (<code>EKS_AL2</code>) is used. If a new image type is specified in an update, but neither an <code>imageId</code> nor a <code>imageIdOverride</code> parameter is specified, then the latest Amazon EKS optimized AMI for that image type that Batch supports is used.</p> <dl> <dt>EKS_AL2</dt> <dd> <p> <a href=\"https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-ami.html\">Amazon Linux 2</a>: Default for all non-GPU instance families.</p> </dd> <dt>EKS_AL2_NVIDIA</dt> <dd> <p> <a href=\"https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-ami.html\">Amazon Linux 2 (accelerated)</a>: Default for all GPU instance families (for example, <code>P4</code> and <code>G4</code>) and can be used for all non Amazon Web Services Graviton-based instance types.</p> </dd> </dl> </dd> </dl>', ], ], 'Integer' => [ 'base' => NULL, 'refs' => [ 'ArrayJobStatusSummary$value' => NULL, 'ArrayProperties$size' => '<p>The size of the array job.</p>', 'ArrayPropertiesDetail$size' => '<p>The size of the array job. This parameter is returned for parent array jobs.</p>', 'ArrayPropertiesDetail$index' => '<p>The job index within the array that\\'s associated with this job. This parameter is returned for array job children.</p>', 'ArrayPropertiesSummary$size' => '<p>The size of the array job. This parameter is returned for parent array jobs.</p>', 'ArrayPropertiesSummary$index' => '<p>The job index within the array that\\'s associated with this job. This parameter is returned for children of array jobs.</p>', 'AttemptContainerDetail$exitCode' => '<p>The exit code for the job attempt. A non-zero exit code is considered failed.</p>', 'ComputeEnvironmentDetail$unmanagedvCpus' => '<p>The maximum number of VCPUs expected to be used for an unmanaged compute environment.</p>', 'ComputeEnvironmentOrder$order' => '<p>The order of the compute environment. Compute environments are tried in ascending order. For example, if two compute environments are associated with a job queue, the compute environment with a lower <code>order</code> integer value is tried for job placement first.</p>', 'ComputeResource$minvCpus' => '<p>The minimum number of Amazon EC2 vCPUs that an environment should maintain (even if the compute environment is <code>DISABLED</code>).</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', 'ComputeResource$maxvCpus' => '<p>The maximum number of Amazon EC2 vCPUs that a compute environment can reach.</p> <note> <p>With both <code>BEST_FIT_PROGRESSIVE</code> and <code>SPOT_CAPACITY_OPTIMIZED</code> allocation strategies using On-Demand or Spot Instances, and the <code>BEST_FIT</code> strategy using Spot Instances, Batch might need to exceed <code>maxvCpus</code> to meet your capacity requirements. In this event, Batch never exceeds <code>maxvCpus</code> by more than a single instance. For example, no more than a single instance from among those specified in your compute environment is allocated.</p> </note>', 'ComputeResource$desiredvCpus' => '<p>The desired number of Amazon EC2 vCPUS in the compute environment. Batch modifies this value between the minimum and maximum values based on job queue demand.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', 'ComputeResource$bidPercentage' => '<p>The maximum percentage that a Spot Instance price can be when compared with the On-Demand price for that instance type before instances are launched. For example, if your maximum percentage is 20%, then the Spot price must be less than 20% of the current On-Demand price for that Amazon EC2 instance. You always pay the lowest (market) price and never more than your maximum percentage. If you leave this field empty, the default value is 100% of the On-Demand price. For most use cases, we recommend leaving this field empty.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', 'ComputeResourceUpdate$minvCpus' => '<p>The minimum number of Amazon EC2 vCPUs that an environment should maintain (even if the compute environment is <code>DISABLED</code>).</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', 'ComputeResourceUpdate$maxvCpus' => '<p>The maximum number of Amazon EC2 vCPUs that an environment can reach.</p> <note> <p>With both <code>BEST_FIT_PROGRESSIVE</code> and <code>SPOT_CAPACITY_OPTIMIZED</code> allocation strategies using On-Demand or Spot Instances, and the <code>BEST_FIT</code> strategy using Spot Instances, Batch might need to exceed <code>maxvCpus</code> to meet your capacity requirements. In this event, Batch never exceeds <code>maxvCpus</code> by more than a single instance. That is, no more than a single instance from among those specified in your compute environment.</p> </note>', 'ComputeResourceUpdate$desiredvCpus' => '<p>The desired number of Amazon EC2 vCPUS in the compute environment. Batch modifies this value between the minimum and maximum values based on job queue demand.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note> <note> <p>Batch doesn\\'t support changing the desired number of vCPUs of an existing compute environment. Don\\'t specify this parameter for compute environments using Amazon EKS clusters.</p> </note> <note> <p>When you update the <code>desiredvCpus</code> setting, the value must be between the <code>minvCpus</code> and <code>maxvCpus</code> values. </p> <p>Additionally, the updated <code>desiredvCpus</code> value must be greater than or equal to the current <code>desiredvCpus</code> value. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/troubleshooting.html#error-desired-vcpus-update\">Troubleshooting Batch</a> in the <i>Batch User Guide</i>.</p> </note>', 'ComputeResourceUpdate$bidPercentage' => '<p>The maximum percentage that a Spot Instance price can be when compared with the On-Demand price for that instance type before instances are launched. For example, if your maximum percentage is 20%, the Spot price must be less than 20% of the current On-Demand price for that Amazon EC2 instance. You always pay the lowest (market) price and never more than your maximum percentage. For most use cases, we recommend leaving this field empty.</p> <p>When updating a compute environment, changing the bid percentage requires an infrastructure update of the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', 'ContainerDetail$vcpus' => '<p>The number of vCPUs reserved for the container. For jobs that run on EC2 resources, you can specify the vCPU requirement for the job using <code>resourceRequirements</code>, but you can\\'t specify the vCPU requirements in both the <code>vcpus</code> and <code>resourceRequirements</code> object. This parameter maps to <code>CpuShares</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--cpu-shares</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>. Each vCPU is equivalent to 1,024 CPU shares. You must specify at least one vCPU. This is required but can be specified in several places. It must be specified for each node at least once.</p> <note> <p>This parameter isn\\'t applicable to jobs that run on Fargate resources. For jobs that run on Fargate resources, you must specify the vCPU requirement for the job using <code>resourceRequirements</code>.</p> </note>', 'ContainerDetail$memory' => '<p>For jobs running on EC2 resources that didn\\'t specify memory requirements using <code>resourceRequirements</code>, the number of MiB of memory reserved for the job. For other jobs, including all run on Fargate resources, see <code>resourceRequirements</code>.</p>', 'ContainerDetail$exitCode' => '<p>The exit code to return upon completion.</p>', 'ContainerOverrides$vcpus' => '<p>This parameter is deprecated, use <code>resourceRequirements</code> to override the <code>vcpus</code> parameter that\\'s set in the job definition. It\\'s not supported for jobs running on Fargate resources. For jobs that run on EC2 resources, it overrides the <code>vcpus</code> parameter set in the job definition, but doesn\\'t override any vCPU requirement specified in the <code>resourceRequirements</code> structure in the job definition. To override vCPU requirements that are specified in the <code>resourceRequirements</code> structure in the job definition, <code>resourceRequirements</code> must be specified in the <code>SubmitJob</code> request, with <code>type</code> set to <code>VCPU</code> and <code>value</code> set to the new value. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/troubleshooting.html#override-resource-requirements\">Can\\'t override job definition resource requirements</a> in the <i>Batch User Guide</i>.</p>', 'ContainerOverrides$memory' => '<p>This parameter is deprecated, use <code>resourceRequirements</code> to override the memory requirements specified in the job definition. It\\'s not supported for jobs running on Fargate resources. For jobs that run on EC2 resources, it overrides the <code>memory</code> parameter set in the job definition, but doesn\\'t override any memory requirement that\\'s specified in the <code>resourceRequirements</code> structure in the job definition. To override memory requirements that are specified in the <code>resourceRequirements</code> structure in the job definition, <code>resourceRequirements</code> must be specified in the <code>SubmitJob</code> request, with <code>type</code> set to <code>MEMORY</code> and <code>value</code> set to the new value. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/troubleshooting.html#override-resource-requirements\">Can\\'t override job definition resource requirements</a> in the <i>Batch User Guide</i>.</p>', 'ContainerProperties$vcpus' => '<p>This parameter is deprecated, use <code>resourceRequirements</code> to specify the vCPU requirements for the job definition. It\\'s not supported for jobs running on Fargate resources. For jobs running on EC2 resources, it specifies the number of vCPUs reserved for the job.</p> <p>Each vCPU is equivalent to 1,024 CPU shares. This parameter maps to <code>CpuShares</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--cpu-shares</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>. The number of vCPUs must be specified but can be specified in several places. You must specify it at least once for each node.</p>', 'ContainerProperties$memory' => '<p>This parameter is deprecated, use <code>resourceRequirements</code> to specify the memory requirements for the job definition. It\\'s not supported for jobs running on Fargate resources. For jobs that run on EC2 resources, it specifies the memory hard limit (in MiB) for a container. If your container attempts to exceed the specified number, it\\'s terminated. You must specify at least 4 MiB of memory for a job using this parameter. The memory hard limit can be specified in several places. It must be specified for each node at least once.</p>', 'ContainerSummary$exitCode' => '<p>The exit code to return upon completion.</p>', 'CreateComputeEnvironmentRequest$unmanagedvCpus' => '<p>The maximum number of vCPUs for an unmanaged compute environment. This parameter is only used for fair share scheduling to reserve vCPU capacity for new share identifiers. If this parameter isn\\'t provided for a fair share job queue, no vCPU capacity is reserved.</p> <note> <p>This parameter is only supported when the <code>type</code> parameter is set to <code>UNMANAGED</code>.</p> </note>', 'CreateJobQueueRequest$priority' => '<p>The priority of the job queue. Job queues with a higher priority (or a higher integer value for the <code>priority</code> parameter) are evaluated first when associated with the same compute environment. Priority is determined in descending order. For example, a job queue with a priority value of <code>10</code> is given scheduling preference over a job queue with a priority value of <code>1</code>. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>); EC2 and Fargate compute environments can\\'t be mixed.</p>', 'DescribeComputeEnvironmentsRequest$maxResults' => '<p>The maximum number of cluster results returned by <code>DescribeComputeEnvironments</code> in paginated output. When this parameter is used, <code>DescribeComputeEnvironments</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeComputeEnvironments</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn\\'t used, then <code>DescribeComputeEnvironments</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', 'DescribeJobDefinitionsRequest$maxResults' => '<p>The maximum number of results returned by <code>DescribeJobDefinitions</code> in paginated output. When this parameter is used, <code>DescribeJobDefinitions</code> only returns <code>maxResults</code> results in a single page and a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeJobDefinitions</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn\\'t used, then <code>DescribeJobDefinitions</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', 'DescribeJobQueuesRequest$maxResults' => '<p>The maximum number of results returned by <code>DescribeJobQueues</code> in paginated output. When this parameter is used, <code>DescribeJobQueues</code> only returns <code>maxResults</code> results in a single page and a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeJobQueues</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn\\'t used, then <code>DescribeJobQueues</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', 'EFSVolumeConfiguration$transitEncryptionPort' => '<p>The port to use when sending encrypted data between the Amazon ECS host and the Amazon EFS server. If you don\\'t specify a transit encryption port, it uses the port selection strategy that the Amazon EFS mount helper uses. The value must be between 0 and 65,535. For more information, see <a href=\"https://docs.aws.amazon.com/efs/latest/ug/efs-mount-helper.html\">EFS mount helper</a> in the <i>Amazon Elastic File System User Guide</i>.</p>', 'EksAttemptContainerDetail$exitCode' => '<p>The exit code for the job attempt. A non-zero exit code is considered failed.</p>', 'EksContainerDetail$exitCode' => '<p>The exit code for the job attempt. A non-zero exit code is considered failed.</p>', 'EphemeralStorage$sizeInGiB' => '<p>The total amount, in GiB, of ephemeral storage to set for the task. The minimum supported value is <code>21</code> GiB and the maximum supported value is <code>200</code> GiB.</p>', 'FairsharePolicy$shareDecaySeconds' => '<p>The amount of time (in seconds) to use to calculate a fair share percentage for each fair share identifier in use. A value of zero (0) indicates that only current usage is measured. The decay allows for more recently run jobs to have more weight than jobs that ran earlier. The maximum supported value is 604800 (1 week).</p>', 'FairsharePolicy$computeReservation' => '<p>A value used to reserve some of the available maximum vCPU for fair share identifiers that aren\\'t already used.</p> <p>The reserved ratio is <code>(<i>computeReservation</i>/100)^<i>ActiveFairShares</i> </code> where <code> <i>ActiveFairShares</i> </code> is the number of active fair share identifiers.</p> <p>For example, a <code>computeReservation</code> value of 50 indicates that Batchreserves 50% of the maximum available vCPU if there\\'s only one fair share identifier. It reserves 25% if there are two fair share identifiers. It reserves 12.5% if there are three fair share identifiers. A <code>computeReservation</code> value of 25 indicates that Batch should reserve 25% of the maximum available vCPU if there\\'s only one fair share identifier, 6.25% if there are two fair share identifiers, and 1.56% if there are three fair share identifiers.</p> <p>The minimum value is 0 and the maximum value is 99.</p>', 'JobDefinition$revision' => '<p>The revision of the job definition.</p>', 'JobDefinition$schedulingPriority' => '<p>The scheduling priority of the job definition. This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.</p>', 'JobDetail$schedulingPriority' => '<p>The scheduling policy of the job definition. This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.</p>', 'JobQueueDetail$priority' => '<p>The priority of the job queue. Job queues with a higher priority (or a higher integer value for the <code>priority</code> parameter) are evaluated first when associated with the same compute environment. Priority is determined in descending order. For example, a job queue with a priority value of <code>10</code> is given scheduling preference over a job queue with a priority value of <code>1</code>. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>). EC2 and Fargate compute environments can\\'t be mixed.</p>', 'JobTimeout$attemptDurationSeconds' => '<p>The job timeout time (in seconds) that\\'s measured from the job attempt\\'s <code>startedAt</code> timestamp. After this time passes, Batch terminates your jobs if they aren\\'t finished. The minimum value for the timeout is 60 seconds.</p> <p>For array jobs, the timeout applies to the child jobs, not to the parent array job.</p> <p>For multi-node parallel (MNP) jobs, the timeout applies to the whole job, not to the individual nodes.</p>', 'LinuxParameters$sharedMemorySize' => '<p>The value for the size (in MiB) of the <code>/dev/shm</code> volume. This parameter maps to the <code>--shm-size</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t provide it for these jobs.</p> </note>', 'LinuxParameters$maxSwap' => '<p>The total amount of swap memory (in MiB) a container can use. This parameter is translated to the <code>--memory-swap</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a> where the value is the sum of the container memory plus the <code>maxSwap</code> value. For more information, see <a href=\"https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details\"> <code>--memory-swap</code> details</a> in the Docker documentation.</p> <p>If a <code>maxSwap</code> value of <code>0</code> is specified, the container doesn\\'t use swap. Accepted values are <code>0</code> or any positive integer. If the <code>maxSwap</code> parameter is omitted, the container doesn\\'t use the swap configuration for the container instance that it\\'s running on. A <code>maxSwap</code> value must be set for the <code>swappiness</code> parameter to be used.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t provide it for these jobs.</p> </note>', 'LinuxParameters$swappiness' => '<p>You can use this parameter to tune a container\\'s memory swappiness behavior. A <code>swappiness</code> value of <code>0</code> causes swapping to not occur unless absolutely necessary. A <code>swappiness</code> value of <code>100</code> causes pages to be swapped aggressively. Valid values are whole numbers between <code>0</code> and <code>100</code>. If the <code>swappiness</code> parameter isn\\'t specified, a default value of <code>60</code> is used. If a value isn\\'t specified for <code>maxSwap</code>, then this parameter is ignored. If <code>maxSwap</code> is set to 0, the container doesn\\'t use swap. This parameter maps to the <code>--memory-swappiness</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>.</p> <p>Consider the following when you use a per-container swap configuration.</p> <ul> <li> <p>Swap space must be enabled and allocated on the container instance for the containers to use.</p> <note> <p>By default, the Amazon ECS optimized AMIs don\\'t have swap enabled. You must enable swap on the instance to use this feature. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-store-swap-volumes.html\">Instance store swap volumes</a> in the <i>Amazon EC2 User Guide for Linux Instances</i> or <a href=\"http://aws.amazon.com/premiumsupport/knowledge-center/ec2-memory-swap-file/\">How do I allocate memory to work as swap space in an Amazon EC2 instance by using a swap file?</a> </p> </note> </li> <li> <p>The swap space parameters are only supported for job definitions using EC2 resources.</p> </li> <li> <p>If the <code>maxSwap</code> and <code>swappiness</code> parameters are omitted from a job definition, each container has a default <code>swappiness</code> value of 60. Moreover, the total swap usage is limited to two times the memory reservation of the container.</p> </li> </ul> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t provide it for these jobs.</p> </note>', 'ListJobsRequest$maxResults' => '<p>The maximum number of results returned by <code>ListJobs</code> in paginated output. When this parameter is used, <code>ListJobs</code> only returns <code>maxResults</code> results in a single page and a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListJobs</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn\\'t used, then <code>ListJobs</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', 'ListSchedulingPoliciesRequest$maxResults' => '<p>The maximum number of results that\\'s returned by <code>ListSchedulingPolicies</code> in paginated output. When this parameter is used, <code>ListSchedulingPolicies</code> only returns <code>maxResults</code> results in a single page and a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListSchedulingPolicies</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn\\'t used, <code>ListSchedulingPolicies</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>', 'NodeDetails$nodeIndex' => '<p>The node index for the node. Node index numbering starts at zero. This index is also available on the node with the <code>AWS_BATCH_JOB_NODE_INDEX</code> environment variable.</p>', 'NodeOverrides$numNodes' => '<p>The number of nodes to use with a multi-node parallel job. This value overrides the number of nodes that are specified in the job definition. To use this override, you must meet the following conditions:</p> <ul> <li> <p>There must be at least one node range in your job definition that has an open upper boundary, such as <code>:</code> or <code>n:</code>.</p> </li> <li> <p>The lower boundary of the node range that\\'s specified in the job definition must be fewer than the number of nodes specified in the override.</p> </li> <li> <p>The main node index that\\'s specified in the job definition must be fewer than the number of nodes specified in the override.</p> </li> </ul>', 'NodeProperties$numNodes' => '<p>The number of nodes that are associated with a multi-node parallel job.</p>', 'NodeProperties$mainNode' => '<p>Specifies the node index for the main node of a multi-node parallel job. This node index value must be fewer than the number of nodes.</p>', 'NodePropertiesSummary$numNodes' => '<p>The number of nodes that are associated with a multi-node parallel job.</p>', 'NodePropertiesSummary$nodeIndex' => '<p>The node index for the node. Node index numbering begins at zero. This index is also available on the node with the <code>AWS_BATCH_JOB_NODE_INDEX</code> environment variable.</p>', 'RegisterJobDefinitionRequest$schedulingPriority' => '<p>The scheduling priority for jobs that are submitted with this job definition. This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.</p> <p>The minimum supported value is 0 and the maximum supported value is 9999.</p>', 'RegisterJobDefinitionResponse$revision' => '<p>The revision of the job definition.</p>', 'RetryStrategy$attempts' => '<p>The number of times to move a job to the <code>RUNNABLE</code> status. You can specify between 1 and 10 attempts. If the value of <code>attempts</code> is greater than one, the job is retried on failure the same number of attempts as the value.</p>', 'SubmitJobRequest$schedulingPriorityOverride' => '<p>The scheduling priority for the job. This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority. This overrides any scheduling priority in the job definition.</p> <p>The minimum supported value is 0 and the maximum supported value is 9999.</p>', 'Tmpfs$size' => '<p>The size (in MiB) of the <code>tmpfs</code> volume.</p>', 'Ulimit$hardLimit' => '<p>The hard limit for the <code>ulimit</code> type.</p>', 'Ulimit$softLimit' => '<p>The soft limit for the <code>ulimit</code> type.</p>', 'UpdateComputeEnvironmentRequest$unmanagedvCpus' => '<p>The maximum number of vCPUs expected to be used for an unmanaged compute environment. Don\\'t specify this parameter for a managed compute environment. This parameter is only used for fair share scheduling to reserve vCPU capacity for new share identifiers. If this parameter isn\\'t provided for a fair share job queue, no vCPU capacity is reserved.</p>', 'UpdateJobQueueRequest$priority' => '<p>The priority of the job queue. Job queues with a higher priority (or a higher integer value for the <code>priority</code> parameter) are evaluated first when associated with the same compute environment. Priority is determined in descending order. For example, a job queue with a priority value of <code>10</code> is given scheduling preference over a job queue with a priority value of <code>1</code>. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>). EC2 and Fargate compute environments can\\'t be mixed.</p>', ], ], 'JQState' => [ 'base' => NULL, 'refs' => [ 'CreateJobQueueRequest$state' => '<p>The state of the job queue. If the job queue state is <code>ENABLED</code>, it is able to accept jobs. If the job queue state is <code>DISABLED</code>, new jobs can\\'t be added to the queue, but jobs already in the queue can finish.</p>', 'JobQueueDetail$state' => '<p>Describes the ability of the queue to accept new jobs. If the job queue state is <code>ENABLED</code>, it can accept jobs. If the job queue state is <code>DISABLED</code>, new jobs can\\'t be added to the queue, but jobs already in the queue can finish.</p>', 'UpdateJobQueueRequest$state' => '<p>Describes the queue\\'s ability to accept new jobs. If the job queue state is <code>ENABLED</code>, it can accept jobs. If the job queue state is <code>DISABLED</code>, new jobs can\\'t be added to the queue, but jobs already in the queue can finish.</p>', ], ], 'JQStatus' => [ 'base' => NULL, 'refs' => [ 'JobQueueDetail$status' => '<p>The status of the job queue (for example, <code>CREATING</code> or <code>VALID</code>).</p>', ], ], 'JobDefinition' => [ 'base' => '<p>An object that represents an Batch job definition.</p>', 'refs' => [ 'JobDefinitionList$member' => NULL, ], ], 'JobDefinitionList' => [ 'base' => NULL, 'refs' => [ 'DescribeJobDefinitionsResponse$jobDefinitions' => '<p>The list of job definitions.</p>', ], ], 'JobDefinitionType' => [ 'base' => NULL, 'refs' => [ 'RegisterJobDefinitionRequest$type' => '<p>The type of job definition. For more information about multi-node parallel jobs, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/multi-node-job-def.html\">Creating a multi-node parallel job definition</a> in the <i>Batch User Guide</i>.</p> <note> <p>If the job is run on Fargate resources, then <code>multinode</code> isn\\'t supported.</p> </note>', ], ], 'JobDependency' => [ 'base' => '<p>An object that represents an Batch job dependency.</p>', 'refs' => [ 'JobDependencyList$member' => NULL, ], ], 'JobDependencyList' => [ 'base' => NULL, 'refs' => [ 'JobDetail$dependsOn' => '<p>A list of job IDs that this job depends on.</p>', 'SubmitJobRequest$dependsOn' => '<p>A list of dependencies for the job. A job can depend upon a maximum of 20 jobs. You can specify a <code>SEQUENTIAL</code> type dependency without specifying a job ID for array jobs so that each child array job completes sequentially, starting at index 0. You can also specify an <code>N_TO_N</code> type dependency with a job ID for array jobs. In that case, each index child of this job must wait for the corresponding index child of each dependency to complete before it can begin.</p>', ], ], 'JobDetail' => [ 'base' => '<p>An object that represents an Batch job.</p>', 'refs' => [ 'JobDetailList$member' => NULL, ], ], 'JobDetailList' => [ 'base' => NULL, 'refs' => [ 'DescribeJobsResponse$jobs' => '<p>The list of jobs.</p>', ], ], 'JobExecutionTimeoutMinutes' => [ 'base' => NULL, 'refs' => [ 'UpdatePolicy$jobExecutionTimeoutMinutes' => '<p>Specifies the job timeout (in minutes) when the compute environment infrastructure is updated. The default value is 30.</p>', ], ], 'JobQueueDetail' => [ 'base' => '<p>An object that represents the details for an Batch job queue.</p>', 'refs' => [ 'JobQueueDetailList$member' => NULL, ], ], 'JobQueueDetailList' => [ 'base' => NULL, 'refs' => [ 'DescribeJobQueuesResponse$jobQueues' => '<p>The list of job queues.</p>', ], ], 'JobStatus' => [ 'base' => NULL, 'refs' => [ 'JobDetail$status' => '<p>The current status for the job.</p> <note> <p>If your jobs don\\'t progress to <code>STARTING</code>, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/troubleshooting.html#job_stuck_in_runnable\">Jobs stuck in RUNNABLE status</a> in the troubleshooting section of the <i>Batch User Guide</i>.</p> </note>', 'JobSummary$status' => '<p>The current status for the job.</p>', 'ListJobsRequest$jobStatus' => '<p>The job status used to filter jobs in the specified queue. If the <code>filters</code> parameter is specified, the <code>jobStatus</code> parameter is ignored and jobs with any status are returned. If you don\\'t specify a status, only <code>RUNNING</code> jobs are returned.</p>', ], ], 'JobSummary' => [ 'base' => '<p>An object that represents summary details of a job.</p>', 'refs' => [ 'JobSummaryList$member' => NULL, ], ], 'JobSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListJobsResponse$jobSummaryList' => '<p>A list of job summaries that match the request.</p>', ], ], 'JobTimeout' => [ 'base' => '<p>An object that represents a job timeout configuration.</p>', 'refs' => [ 'JobDefinition$timeout' => '<p>The timeout time for jobs that are submitted with this job definition. After the amount of time you specify passes, Batch terminates your jobs if they aren\\'t finished.</p>', 'JobDetail$timeout' => '<p>The timeout configuration for the job.</p>', 'RegisterJobDefinitionRequest$timeout' => '<p>The timeout configuration for jobs that are submitted with this job definition, after which Batch terminates your jobs if they have not finished. If a job is terminated due to a timeout, it isn\\'t retried. The minimum value for the timeout is 60 seconds. Any timeout configuration that\\'s specified during a <a>SubmitJob</a> operation overrides the timeout configuration defined here. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/job_timeouts.html\">Job Timeouts</a> in the <i>Batch User Guide</i>.</p>', 'SubmitJobRequest$timeout' => '<p>The timeout configuration for this <a>SubmitJob</a> operation. You can specify a timeout duration after which Batch terminates your jobs if they haven\\'t finished. If a job is terminated due to a timeout, it isn\\'t retried. The minimum value for the timeout is 60 seconds. This configuration overrides any timeout configuration specified in the job definition. For array jobs, child jobs have the same timeout configuration as the parent job. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/job_timeouts.html\">Job Timeouts</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>', ], ], 'KeyValuePair' => [ 'base' => '<p>A key-value pair object.</p>', 'refs' => [ 'EnvironmentVariables$member' => NULL, ], ], 'KeyValuesPair' => [ 'base' => '<p>A filter name and value pair that\\'s used to return a more specific list of results from a <code>ListJobs</code> API operation.</p>', 'refs' => [ 'ListJobsFilterList$member' => NULL, ], ], 'KubernetesVersion' => [ 'base' => NULL, 'refs' => [ 'Ec2Configuration$imageKubernetesVersion' => '<p>The Kubernetes version for the compute environment. If you don\\'t specify a value, the latest version that Batch supports is used.</p>', ], ], 'LaunchTemplateSpecification' => [ 'base' => '<p>An object that represents a launch template that\\'s associated with a compute resource. You must specify either the launch template ID or launch template name in the request, but not both.</p> <p>If security groups are specified using both the <code>securityGroupIds</code> parameter of <code>CreateComputeEnvironment</code> and the launch template, the values in the <code>securityGroupIds</code> parameter of <code>CreateComputeEnvironment</code> will be used.</p> <note> <p>This object isn\\'t applicable to jobs that are running on Fargate resources.</p> </note>', 'refs' => [ 'ComputeResource$launchTemplate' => '<p>The launch template to use for your compute resources. Any other compute resource parameters that you specify in a <a>CreateComputeEnvironment</a> API operation override the same parameters in the launch template. You must specify either the launch template ID or launch template name in the request, but not both. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/launch-templates.html\">Launch template support</a> in the <i>Batch User Guide</i>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', 'ComputeResourceUpdate$launchTemplate' => '<p>The updated launch template to use for your compute resources. You must specify either the launch template ID or launch template name in the request, but not both. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/launch-templates.html\">Launch template support</a> in the <i>Batch User Guide</i>. To remove the custom launch template and use the default launch template, set <code>launchTemplateId</code> or <code>launchTemplateName</code> member of the launch template specification to an empty string. Removing the launch template from a compute environment will not remove the AMI specified in the launch template. In order to update the AMI specified in a launch template, the <code>updateToLatestImageVersion</code> parameter must be set to <code>true</code>.</p> <p>When updating a compute environment, changing the launch template requires an infrastructure update of the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', ], ], 'LinuxParameters' => [ 'base' => '<p>Linux-specific modifications that are applied to the container, such as details for device mappings.</p>', 'refs' => [ 'ContainerDetail$linuxParameters' => '<p>Linux-specific modifications that are applied to the container, such as details for device mappings.</p>', 'ContainerProperties$linuxParameters' => '<p>Linux-specific modifications that are applied to the container, such as details for device mappings.</p>', ], ], 'ListJobsFilterList' => [ 'base' => NULL, 'refs' => [ 'ListJobsRequest$filters' => '<p>The filter to apply to the query. Only one filter can be used at a time. When the filter is used, <code>jobStatus</code> is ignored. The filter doesn\\'t apply to child jobs in an array or multi-node parallel (MNP) jobs. The results are sorted by the <code>createdAt</code> field, with the most recent jobs being first.</p> <dl> <dt>JOB_NAME</dt> <dd> <p>The value of the filter is a case-insensitive match for the job name. If the value ends with an asterisk (*), the filter matches any job name that begins with the string before the \\'*\\'. This corresponds to the <code>jobName</code> value. For example, <code>test1</code> matches both <code>Test1</code> and <code>test1</code>, and <code>test1*</code> matches both <code>test1</code> and <code>Test10</code>. When the <code>JOB_NAME</code> filter is used, the results are grouped by the job name and version.</p> </dd> <dt>JOB_DEFINITION</dt> <dd> <p>The value for the filter is the name or Amazon Resource Name (ARN) of the job definition. This corresponds to the <code>jobDefinition</code> value. The value is case sensitive. When the value for the filter is the job definition name, the results include all the jobs that used any revision of that job definition name. If the value ends with an asterisk (*), the filter matches any job definition name that begins with the string before the \\'*\\'. For example, <code>jd1</code> matches only <code>jd1</code>, and <code>jd1*</code> matches both <code>jd1</code> and <code>jd1A</code>. The version of the job definition that\\'s used doesn\\'t affect the sort order. When the <code>JOB_DEFINITION</code> filter is used and the ARN is used (which is in the form <code>arn:${Partition}:batch:${Region}:${Account}:job-definition/${JobDefinitionName}:${Revision}</code>), the results include jobs that used the specified revision of the job definition. Asterisk (*) isn\\'t supported when the ARN is used.</p> </dd> <dt>BEFORE_CREATED_AT</dt> <dd> <p>The value for the filter is the time that\\'s before the job was created. This corresponds to the <code>createdAt</code> value. The value is a string representation of the number of milliseconds since 00:00:00 UTC (midnight) on January 1, 1970.</p> </dd> <dt>AFTER_CREATED_AT</dt> <dd> <p>The value for the filter is the time that\\'s after the job was created. This corresponds to the <code>createdAt</code> value. The value is a string representation of the number of milliseconds since 00:00:00 UTC (midnight) on January 1, 1970.</p> </dd> </dl>', ], ], 'ListJobsRequest' => [ 'base' => '<p>Contains the parameters for <code>ListJobs</code>.</p>', 'refs' => [], ], 'ListJobsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListSchedulingPoliciesRequest' => [ 'base' => '<p>Contains the parameters for <code>ListSchedulingPolicies</code>.</p>', 'refs' => [], ], 'ListSchedulingPoliciesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => '<p>Contains the parameters for <code>ListTagsForResource</code>.</p>', 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'LogConfiguration' => [ 'base' => '<p>Log configuration options to send to a custom log driver for the container.</p>', 'refs' => [ 'ContainerDetail$logConfiguration' => '<p>The log configuration specification for the container.</p> <p>This parameter maps to <code>LogConfig</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--log-driver</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>. By default, containers use the same logging driver that the Docker daemon uses. However, the container might use a different logging driver than the Docker daemon by specifying a log driver with this parameter in the container definition. To use a different logging driver for a container, the log system must be configured properly on the container instance. Or, alternatively, it must be configured on a different log server for remote logging options. For more information on the options for different supported log drivers, see <a href=\"https://docs.docker.com/engine/admin/logging/overview/\">Configure logging drivers</a> in the Docker documentation.</p> <note> <p>Batch currently supports a subset of the logging drivers available to the Docker daemon (shown in the <a>LogConfiguration</a> data type). Additional log drivers might be available in future releases of the Amazon ECS container agent.</p> </note> <p>This parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: <code>sudo docker version | grep \"Server API version\"</code> </p> <note> <p>The Amazon ECS container agent running on a container instance must register the logging drivers available on that instance with the <code>ECS_AVAILABLE_LOGGING_DRIVERS</code> environment variable before containers placed on that instance can use these log configuration options. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html\">Amazon ECS container agent configuration</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p> </note>', 'ContainerProperties$logConfiguration' => '<p>The log configuration specification for the container.</p> <p>This parameter maps to <code>LogConfig</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--log-driver</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>. By default, containers use the same logging driver that the Docker daemon uses. However the container might use a different logging driver than the Docker daemon by specifying a log driver with this parameter in the container definition. To use a different logging driver for a container, the log system must be configured properly on the container instance (or on a different log server for remote logging options). For more information on the options for different supported log drivers, see <a href=\"https://docs.docker.com/engine/admin/logging/overview/\">Configure logging drivers</a> in the Docker documentation.</p> <note> <p>Batch currently supports a subset of the logging drivers available to the Docker daemon (shown in the <a>LogConfiguration</a> data type).</p> </note> <p>This parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: <code>sudo docker version | grep \"Server API version\"</code> </p> <note> <p>The Amazon ECS container agent running on a container instance must register the logging drivers available on that instance with the <code>ECS_AVAILABLE_LOGGING_DRIVERS</code> environment variable before containers placed on that instance can use these log configuration options. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html\">Amazon ECS container agent configuration</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p> </note>', ], ], 'LogConfigurationOptionsMap' => [ 'base' => NULL, 'refs' => [ 'LogConfiguration$options' => '<p>The configuration options to send to the log driver. This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: <code>sudo docker version | grep \"Server API version\"</code> </p>', ], ], 'LogDriver' => [ 'base' => NULL, 'refs' => [ 'LogConfiguration$logDriver' => '<p>The log driver to use for the container. The valid values that are listed for this parameter are log drivers that the Amazon ECS container agent can communicate with by default.</p> <p>The supported log drivers are <code>awslogs</code>, <code>fluentd</code>, <code>gelf</code>, <code>json-file</code>, <code>journald</code>, <code>logentries</code>, <code>syslog</code>, and <code>splunk</code>.</p> <note> <p>Jobs that are running on Fargate resources are restricted to the <code>awslogs</code> and <code>splunk</code> log drivers.</p> </note> <dl> <dt>awslogs</dt> <dd> <p>Specifies the Amazon CloudWatch Logs logging driver. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/using_awslogs.html\">Using the awslogs log driver</a> in the <i>Batch User Guide</i> and <a href=\"https://docs.docker.com/config/containers/logging/awslogs/\">Amazon CloudWatch Logs logging driver</a> in the Docker documentation.</p> </dd> <dt>fluentd</dt> <dd> <p>Specifies the Fluentd logging driver. For more information including usage and options, see <a href=\"https://docs.docker.com/config/containers/logging/fluentd/\">Fluentd logging driver</a> in the <i>Docker documentation</i>.</p> </dd> <dt>gelf</dt> <dd> <p>Specifies the Graylog Extended Format (GELF) logging driver. For more information including usage and options, see <a href=\"https://docs.docker.com/config/containers/logging/gelf/\">Graylog Extended Format logging driver</a> in the <i>Docker documentation</i>.</p> </dd> <dt>journald</dt> <dd> <p>Specifies the journald logging driver. For more information including usage and options, see <a href=\"https://docs.docker.com/config/containers/logging/journald/\">Journald logging driver</a> in the <i>Docker documentation</i>.</p> </dd> <dt>json-file</dt> <dd> <p>Specifies the JSON file logging driver. For more information including usage and options, see <a href=\"https://docs.docker.com/config/containers/logging/json-file/\">JSON File logging driver</a> in the <i>Docker documentation</i>.</p> </dd> <dt>splunk</dt> <dd> <p>Specifies the Splunk logging driver. For more information including usage and options, see <a href=\"https://docs.docker.com/config/containers/logging/splunk/\">Splunk logging driver</a> in the <i>Docker documentation</i>.</p> </dd> <dt>syslog</dt> <dd> <p>Specifies the syslog logging driver. For more information including usage and options, see <a href=\"https://docs.docker.com/config/containers/logging/syslog/\">Syslog logging driver</a> in the <i>Docker documentation</i>.</p> </dd> </dl> <note> <p>If you have a custom driver that\\'s not listed earlier that you want to work with the Amazon ECS container agent, you can fork the Amazon ECS container agent project that\\'s <a href=\"https://github.com/aws/amazon-ecs-agent\">available on GitHub</a> and customize it to work with that driver. We encourage you to submit pull requests for changes that you want to have included. However, Amazon Web Services doesn\\'t currently support running modified copies of this software.</p> </note> <p>This parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: <code>sudo docker version | grep \"Server API version\"</code> </p>', ], ], 'Long' => [ 'base' => NULL, 'refs' => [ 'AttemptDetail$startedAt' => '<p>The Unix timestamp (in milliseconds) for when the attempt was started (when the attempt transitioned from the <code>STARTING</code> state to the <code>RUNNING</code> state).</p>', 'AttemptDetail$stoppedAt' => '<p>The Unix timestamp (in milliseconds) for when the attempt was stopped (when the attempt transitioned from the <code>RUNNING</code> state to a terminal state, such as <code>SUCCEEDED</code> or <code>FAILED</code>).</p>', 'EksAttemptDetail$startedAt' => '<p>The Unix timestamp (in milliseconds) for when the attempt was started (when the attempt transitioned from the <code>STARTING</code> state to the <code>RUNNING</code> state).</p>', 'EksAttemptDetail$stoppedAt' => '<p>The Unix timestamp (in milliseconds) for when the attempt was stopped. This happens when the attempt transitioned from the <code>RUNNING</code> state to a terminal state, such as <code>SUCCEEDED</code> or <code>FAILED</code>.</p>', 'EksContainerSecurityContext$runAsUser' => '<p>When this parameter is specified, the container is run as the specified user ID (<code>uid</code>). If this parameter isn\\'t specified, the default is the user that\\'s specified in the image metadata. This parameter maps to <code>RunAsUser</code> and <code>MustRanAs</code> policy in the <a href=\"https://kubernetes.io/docs/concepts/security/pod-security-policy/#users-and-groups\">Users and groups pod security policies</a> in the <i>Kubernetes documentation</i>.</p>', 'EksContainerSecurityContext$runAsGroup' => '<p>When this parameter is specified, the container is run as the specified group ID (<code>gid</code>). If this parameter isn\\'t specified, the default is the group that\\'s specified in the image metadata. This parameter maps to <code>RunAsGroup</code> and <code>MustRunAs</code> policy in the <a href=\"https://kubernetes.io/docs/concepts/security/pod-security-policy/#users-and-groups\">Users and groups pod security policies</a> in the <i>Kubernetes documentation</i>.</p>', 'JobDetail$createdAt' => '<p>The Unix timestamp (in milliseconds) for when the job was created. For non-array jobs and parent array jobs, this is when the job entered the <code>SUBMITTED</code> state. This is specifically at the time <a>SubmitJob</a> was called. For array child jobs, this is when the child job was spawned by its parent and entered the <code>PENDING</code> state.</p>', 'JobDetail$startedAt' => '<p>The Unix timestamp (in milliseconds) for when the job was started. More specifically, it\\'s when the job transitioned from the <code>STARTING</code> state to the <code>RUNNING</code> state. This parameter isn\\'t provided for child jobs of array jobs or multi-node parallel jobs.</p>', 'JobDetail$stoppedAt' => '<p>The Unix timestamp (in milliseconds) for when the job was stopped. More specifically, it\\'s when the job transitioned from the <code>RUNNING</code> state to a terminal state, such as <code>SUCCEEDED</code> or <code>FAILED</code>.</p>', 'JobSummary$createdAt' => '<p>The Unix timestamp (in milliseconds) for when the job was created. For non-array jobs and parent array jobs, this is when the job entered the <code>SUBMITTED</code> state (at the time <a>SubmitJob</a> was called). For array child jobs, this is when the child job was spawned by its parent and entered the <code>PENDING</code> state.</p>', 'JobSummary$startedAt' => '<p>The Unix timestamp for when the job was started. More specifically, it\\'s when the job transitioned from the <code>STARTING</code> state to the <code>RUNNING</code> state.</p>', 'JobSummary$stoppedAt' => '<p>The Unix timestamp for when the job was stopped. More specifically, it\\'s when the job transitioned from the <code>RUNNING</code> state to a terminal state, such as <code>SUCCEEDED</code> or <code>FAILED</code>.</p>', ], ], 'MountPoint' => [ 'base' => '<p>Details for a Docker volume mount point that\\'s used in a job\\'s container properties. This parameter maps to <code>Volumes</code> in the <a href=\"https://docs.docker.com/engine/reference/api/docker_remote_api_v1.19/#create-a-container\">Create a container</a> section of the <i>Docker Remote API</i> and the <code>--volume</code> option to docker run.</p>', 'refs' => [ 'MountPoints$member' => NULL, ], ], 'MountPoints' => [ 'base' => NULL, 'refs' => [ 'ContainerDetail$mountPoints' => '<p>The mount points for data volumes in your container.</p>', 'ContainerProperties$mountPoints' => '<p>The mount points for data volumes in your container. This parameter maps to <code>Volumes</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--volume</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>.</p>', ], ], 'NetworkConfiguration' => [ 'base' => '<p>The network configuration for jobs that are running on Fargate resources. Jobs that are running on EC2 resources must not specify this parameter.</p>', 'refs' => [ 'ContainerDetail$networkConfiguration' => '<p>The network configuration for jobs that are running on Fargate resources. Jobs that are running on EC2 resources must not specify this parameter.</p>', 'ContainerProperties$networkConfiguration' => '<p>The network configuration for jobs that are running on Fargate resources. Jobs that are running on EC2 resources must not specify this parameter.</p>', ], ], 'NetworkInterface' => [ 'base' => '<p>An object that represents the elastic network interface for a multi-node parallel job node.</p>', 'refs' => [ 'NetworkInterfaceList$member' => NULL, ], ], 'NetworkInterfaceList' => [ 'base' => NULL, 'refs' => [ 'AttemptContainerDetail$networkInterfaces' => '<p>The network interfaces that are associated with the job attempt.</p>', 'ContainerDetail$networkInterfaces' => '<p>The network interfaces that are associated with the job.</p>', ], ], 'NodeDetails' => [ 'base' => '<p>An object that represents the details of a multi-node parallel job node.</p>', 'refs' => [ 'JobDetail$nodeDetails' => '<p>An object that represents the details of a node that\\'s associated with a multi-node parallel job.</p>', ], ], 'NodeOverrides' => [ 'base' => '<p>An object that represents any node overrides to a job definition that\\'s used in a <a>SubmitJob</a> API operation.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t provide it for these jobs. Rather, use <code>containerOverrides</code> instead.</p> </note>', 'refs' => [ 'SubmitJobRequest$nodeOverrides' => '<p>A list of node overrides in JSON format that specify the node range to target and the container overrides for that node range.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources; use <code>containerOverrides</code> instead.</p> </note>', ], ], 'NodeProperties' => [ 'base' => '<p>An object that represents the node properties of a multi-node parallel job.</p> <note> <p>Node properties can\\'t be specified for Amazon EKS based job definitions.</p> </note>', 'refs' => [ 'JobDefinition$nodeProperties' => '<p>An object with various properties that are specific to multi-node parallel jobs. Valid values are <code>containerProperties</code>, <code>eksProperties</code>, and <code>nodeProperties</code>. Only one can be specified.</p> <note> <p>If the job runs on Fargate resources, don\\'t specify <code>nodeProperties</code>. Use <code>containerProperties</code> instead.</p> </note>', 'JobDetail$nodeProperties' => '<p>An object that represents the node properties of a multi-node parallel job.</p> <note> <p>This isn\\'t applicable to jobs that are running on Fargate resources.</p> </note>', 'RegisterJobDefinitionRequest$nodeProperties' => '<p>An object with various properties specific to multi-node parallel jobs. If you specify node properties for a job, it becomes a multi-node parallel job. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/multi-node-parallel-jobs.html\">Multi-node Parallel Jobs</a> in the <i>Batch User Guide</i>. If the job definition\\'s <code>type</code> parameter is <code>container</code>, then you must specify either <code>containerProperties</code> or <code>nodeProperties</code>.</p> <note> <p>If the job runs on Fargate resources, then you must not specify <code>nodeProperties</code>; use <code>containerProperties</code> instead.</p> </note> <note> <p>If the job runs on Amazon EKS resources, then you must not specify <code>nodeProperties</code>.</p> </note>', ], ], 'NodePropertiesSummary' => [ 'base' => '<p>An object that represents the properties of a node that\\'s associated with a multi-node parallel job.</p>', 'refs' => [ 'JobSummary$nodeProperties' => '<p>The node properties for a single node in a job summary list.</p> <note> <p>This isn\\'t applicable to jobs that are running on Fargate resources.</p> </note>', ], ], 'NodePropertyOverride' => [ 'base' => '<p>The object that represents any node overrides to a job definition that\\'s used in a <a>SubmitJob</a> API operation.</p>', 'refs' => [ 'NodePropertyOverrides$member' => NULL, ], ], 'NodePropertyOverrides' => [ 'base' => NULL, 'refs' => [ 'NodeOverrides$nodePropertyOverrides' => '<p>The node property overrides for the job.</p>', ], ], 'NodeRangeProperties' => [ 'base' => NULL, 'refs' => [ 'NodeProperties$nodeRangeProperties' => '<p>A list of node ranges and their properties that are associated with a multi-node parallel job.</p>', ], ], 'NodeRangeProperty' => [ 'base' => '<p>An object that represents the properties of the node range for a multi-node parallel job.</p>', 'refs' => [ 'NodeRangeProperties$member' => NULL, ], ], 'OrchestrationType' => [ 'base' => NULL, 'refs' => [ 'ComputeEnvironmentDetail$containerOrchestrationType' => '<p>The orchestration type of the compute environment. The valid values are <code>ECS</code> (default) or <code>EKS</code>.</p>', 'JobDefinition$containerOrchestrationType' => '<p>The orchestration type of the compute environment. The valid values are <code>ECS</code> (default) or <code>EKS</code>.</p>', ], ], 'ParametersMap' => [ 'base' => NULL, 'refs' => [ 'JobDefinition$parameters' => '<p>Default parameters or parameter substitution placeholders that are set in the job definition. Parameters are specified as a key-value pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding parameter defaults from the job definition. For more information about specifying parameters, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/job_definition_parameters.html\">Job definition parameters</a> in the <i>Batch User Guide</i>.</p>', 'JobDetail$parameters' => '<p>Additional parameters that are passed to the job that replace parameter substitution placeholders or override any corresponding parameter defaults from the job definition.</p>', 'RegisterJobDefinitionRequest$parameters' => '<p>Default parameter substitution placeholders to set in the job definition. Parameters are specified as a key-value pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding parameter defaults from the job definition.</p>', 'SubmitJobRequest$parameters' => '<p>Additional parameters passed to the job that replace parameter substitution placeholders that are set in the job definition. Parameters are specified as a key and value pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding parameter defaults from the job definition.</p>', ], ], 'PlatformCapability' => [ 'base' => NULL, 'refs' => [ 'PlatformCapabilityList$member' => NULL, ], ], 'PlatformCapabilityList' => [ 'base' => NULL, 'refs' => [ 'JobDefinition$platformCapabilities' => '<p>The platform capabilities required by the job definition. If no value is specified, it defaults to <code>EC2</code>. Jobs run on Fargate resources specify <code>FARGATE</code>.</p>', 'JobDetail$platformCapabilities' => '<p>The platform capabilities required by the job definition. If no value is specified, it defaults to <code>EC2</code>. Jobs run on Fargate resources specify <code>FARGATE</code>.</p>', 'RegisterJobDefinitionRequest$platformCapabilities' => '<p>The platform capabilities required by the job definition. If no value is specified, it defaults to <code>EC2</code>. To run the job on Fargate resources, specify <code>FARGATE</code>.</p> <note> <p>If the job runs on Amazon EKS resources, then you must not specify <code>platformCapabilities</code>.</p> </note>', ], ], 'Quantity' => [ 'base' => NULL, 'refs' => [ 'EksEmptyDir$sizeLimit' => '<p>The maximum size of the volume. By default, there\\'s no maximum size defined.</p>', 'EksLimits$value' => NULL, 'EksRequests$value' => NULL, ], ], 'RegisterJobDefinitionRequest' => [ 'base' => '<p>Contains the parameters for <code>RegisterJobDefinition</code>.</p>', 'refs' => [], ], 'RegisterJobDefinitionResponse' => [ 'base' => NULL, 'refs' => [], ], 'ResourceRequirement' => [ 'base' => '<p>The type and amount of a resource to assign to a container. The supported resources include <code>GPU</code>, <code>MEMORY</code>, and <code>VCPU</code>.</p>', 'refs' => [ 'ResourceRequirements$member' => NULL, ], ], 'ResourceRequirements' => [ 'base' => NULL, 'refs' => [ 'ContainerDetail$resourceRequirements' => '<p>The type and amount of resources to assign to a container. The supported resources include <code>GPU</code>, <code>MEMORY</code>, and <code>VCPU</code>.</p>', 'ContainerOverrides$resourceRequirements' => '<p>The type and amount of resources to assign to a container. This overrides the settings in the job definition. The supported resources include <code>GPU</code>, <code>MEMORY</code>, and <code>VCPU</code>.</p>', 'ContainerProperties$resourceRequirements' => '<p>The type and amount of resources to assign to a container. The supported resources include <code>GPU</code>, <code>MEMORY</code>, and <code>VCPU</code>.</p>', ], ], 'ResourceType' => [ 'base' => NULL, 'refs' => [ 'ResourceRequirement$type' => '<p>The type of resource to assign to a container. The supported resources include <code>GPU</code>, <code>MEMORY</code>, and <code>VCPU</code>.</p>', ], ], 'RetryAction' => [ 'base' => NULL, 'refs' => [ 'EvaluateOnExit$action' => '<p>Specifies the action to take if all of the specified conditions (<code>onStatusReason</code>, <code>onReason</code>, and <code>onExitCode</code>) are met. The values aren\\'t case sensitive.</p>', ], ], 'RetryStrategy' => [ 'base' => '<p>The retry strategy that\\'s associated with a job. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/job_retries.html\">Automated job retries</a> in the <i>Batch User Guide</i>.</p>', 'refs' => [ 'JobDefinition$retryStrategy' => '<p>The retry strategy to use for failed jobs that are submitted with this job definition.</p>', 'JobDetail$retryStrategy' => '<p>The retry strategy to use for this job if an attempt fails.</p>', 'RegisterJobDefinitionRequest$retryStrategy' => '<p>The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that\\'s specified during a <a>SubmitJob</a> operation overrides the retry strategy defined here. If a job is terminated due to a timeout, it isn\\'t retried.</p>', 'SubmitJobRequest$retryStrategy' => '<p>The retry strategy to use for failed jobs from this <a>SubmitJob</a> operation. When a retry strategy is specified here, it overrides the retry strategy defined in the job definition.</p>', ], ], 'SchedulingPolicyDetail' => [ 'base' => '<p>An object that represents a scheduling policy.</p>', 'refs' => [ 'SchedulingPolicyDetailList$member' => NULL, ], ], 'SchedulingPolicyDetailList' => [ 'base' => NULL, 'refs' => [ 'DescribeSchedulingPoliciesResponse$schedulingPolicies' => '<p>The list of scheduling policies.</p>', ], ], 'SchedulingPolicyListingDetail' => [ 'base' => '<p>An object that contains the details of a scheduling policy that\\'s returned in a <code>ListSchedulingPolicy</code> action.</p>', 'refs' => [ 'SchedulingPolicyListingDetailList$member' => NULL, ], ], 'SchedulingPolicyListingDetailList' => [ 'base' => NULL, 'refs' => [ 'ListSchedulingPoliciesResponse$schedulingPolicies' => '<p>A list of scheduling policies that match the request.</p>', ], ], 'Secret' => [ 'base' => '<p>An object that represents the secret to expose to your container. Secrets can be exposed to a container in the following ways:</p> <ul> <li> <p>To inject sensitive data into your containers as environment variables, use the <code>secrets</code> container definition parameter.</p> </li> <li> <p>To reference sensitive information in the log configuration of a container, use the <code>secretOptions</code> container definition parameter.</p> </li> </ul> <p>For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/specifying-sensitive-data.html\">Specifying sensitive data</a> in the <i>Batch User Guide</i>.</p>', 'refs' => [ 'SecretList$member' => NULL, ], ], 'SecretList' => [ 'base' => NULL, 'refs' => [ 'ContainerDetail$secrets' => '<p>The secrets to pass to the container. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/specifying-sensitive-data.html\">Specifying sensitive data</a> in the <i>Batch User Guide</i>.</p>', 'ContainerProperties$secrets' => '<p>The secrets for the container. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/specifying-sensitive-data.html\">Specifying sensitive data</a> in the <i>Batch User Guide</i>.</p>', 'LogConfiguration$secretOptions' => '<p>The secrets to pass to the log configuration. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/specifying-sensitive-data.html\">Specifying sensitive data</a> in the <i>Batch User Guide</i>.</p>', ], ], 'ServerException' => [ 'base' => '<p>These errors are usually caused by a server issue.</p>', 'refs' => [], ], 'ShareAttributes' => [ 'base' => '<p>Specifies the weights for the fair share identifiers for the fair share policy. Fair share identifiers that aren\\'t included have a default weight of <code>1.0</code>.</p>', 'refs' => [ 'ShareAttributesList$member' => NULL, ], ], 'ShareAttributesList' => [ 'base' => NULL, 'refs' => [ 'FairsharePolicy$shareDistribution' => '<p>An array of <code>SharedIdentifier</code> objects that contain the weights for the fair share identifiers for the fair share policy. Fair share identifiers that aren\\'t included have a default weight of <code>1.0</code>.</p>', ], ], 'String' => [ 'base' => NULL, 'refs' => [ 'ArrayJobStatusSummary$key' => NULL, 'AttemptContainerDetail$containerInstanceArn' => '<p>The Amazon Resource Name (ARN) of the Amazon ECS container instance that hosts the job attempt.</p>', 'AttemptContainerDetail$taskArn' => '<p>The Amazon Resource Name (ARN) of the Amazon ECS task that\\'s associated with the job attempt. Each container attempt receives a task ARN when they reach the <code>STARTING</code> status.</p>', 'AttemptContainerDetail$reason' => '<p>A short (255 max characters) human-readable string to provide additional details for a running or stopped container.</p>', 'AttemptContainerDetail$logStreamName' => '<p>The name of the CloudWatch Logs log stream that\\'s associated with the container. The log group for Batch jobs is <code>/aws/batch/job</code>. Each container attempt receives a log stream name when they reach the <code>RUNNING</code> status.</p>', 'AttemptDetail$statusReason' => '<p>A short, human-readable string to provide additional details for the current status of the job attempt.</p>', 'CancelJobRequest$jobId' => '<p>The Batch job ID of the job to cancel.</p>', 'CancelJobRequest$reason' => '<p>A message to attach to the job that explains the reason for canceling it. This message is returned by future <a>DescribeJobs</a> operations on the job. This message is also recorded in the Batch activity logs.</p>', 'ClientException$message' => NULL, 'ComputeEnvironmentDetail$computeEnvironmentName' => '<p>The name of the compute environment. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>', 'ComputeEnvironmentDetail$computeEnvironmentArn' => '<p>The Amazon Resource Name (ARN) of the compute environment.</p>', 'ComputeEnvironmentDetail$ecsClusterArn' => '<p>The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster that the compute environment uses.</p>', 'ComputeEnvironmentDetail$statusReason' => '<p>A short, human-readable string to provide additional details for the current status of the compute environment.</p>', 'ComputeEnvironmentDetail$serviceRole' => '<p>The service role that\\'s associated with the compute environment that allows Batch to make calls to Amazon Web Services API operations on your behalf. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html\">Batch service IAM role</a> in the <i>Batch User Guide</i>.</p>', 'ComputeEnvironmentDetail$uuid' => '<p>Unique identifier for the compute environment.</p>', 'ComputeEnvironmentOrder$computeEnvironment' => '<p>The Amazon Resource Name (ARN) of the compute environment.</p>', 'ComputeResource$imageId' => '<p>The Amazon Machine Image (AMI) ID used for instances launched in the compute environment. This parameter is overridden by the <code>imageIdOverride</code> member of the <code>Ec2Configuration</code> structure.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note> <note> <p>The AMI that you choose for a compute environment must match the architecture of the instance types that you intend to use for that compute environment. For example, if your compute environment uses A1 instance types, the compute resource AMI that you choose must support ARM instances. Amazon ECS vends both x86 and ARM versions of the Amazon ECS-optimized Amazon Linux 2 AMI. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html#ecs-optimized-ami-linux-variants.html\">Amazon ECS-optimized Amazon Linux 2 AMI</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p> </note>', 'ComputeResource$ec2KeyPair' => '<p>The Amazon EC2 key pair that\\'s used for instances launched in the compute environment. You can use this key pair to log in to your instances with SSH.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', 'ComputeResource$instanceRole' => '<p>The Amazon ECS instance profile applied to Amazon EC2 instances in a compute environment. You can specify the short name or full Amazon Resource Name (ARN) of an instance profile. For example, <code> <i>ecsInstanceRole</i> </code> or <code>arn:aws:iam::<i>&lt;aws_account_id&gt;</i>:instance-profile/<i>ecsInstanceRole</i> </code>. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/instance_IAM_role.html\">Amazon ECS instance role</a> in the <i>Batch User Guide</i>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', 'ComputeResource$placementGroup' => '<p>The Amazon EC2 placement group to associate with your compute resources. If you intend to submit multi-node parallel jobs to your compute environment, you should consider creating a cluster placement group and associate it with your compute resources. This keeps your multi-node parallel job on a logical grouping of instances within a single Availability Zone with high network flow potential. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html\">Placement groups</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', 'ComputeResource$spotIamFleetRole' => '<p>The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a <code>SPOT</code> compute environment. This role is required if the allocation strategy set to <code>BEST_FIT</code> or if the allocation strategy isn\\'t specified. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/spot_fleet_IAM_role.html\">Amazon EC2 spot fleet role</a> in the <i>Batch User Guide</i>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note> <important> <p>To tag your Spot Instances on creation, the Spot Fleet IAM role specified here must use the newer <b>AmazonEC2SpotFleetTaggingRole</b> managed policy. The previously recommended <b>AmazonEC2SpotFleetRole</b> managed policy doesn\\'t have the required permissions to tag Spot Instances. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/troubleshooting.html#spot-instance-no-tag\">Spot instances not tagged on creation</a> in the <i>Batch User Guide</i>.</p> </important>', 'ComputeResourceUpdate$ec2KeyPair' => '<p>The Amazon EC2 key pair that\\'s used for instances launched in the compute environment. You can use this key pair to log in to your instances with SSH. To remove the Amazon EC2 key pair, set this value to an empty string.</p> <p>When updating a compute environment, changing the EC2 key pair requires an infrastructure update of the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', 'ComputeResourceUpdate$instanceRole' => '<p>The Amazon ECS instance profile applied to Amazon EC2 instances in a compute environment. You can specify the short name or full Amazon Resource Name (ARN) of an instance profile. For example, <code> <i>ecsInstanceRole</i> </code> or <code>arn:aws:iam::<i>&lt;aws_account_id&gt;</i>:instance-profile/<i>ecsInstanceRole</i> </code>. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/instance_IAM_role.html\">Amazon ECS instance role</a> in the <i>Batch User Guide</i>.</p> <p>When updating a compute environment, changing this setting requires an infrastructure update of the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', 'ComputeResourceUpdate$placementGroup' => '<p>The Amazon EC2 placement group to associate with your compute resources. If you intend to submit multi-node parallel jobs to your compute environment, you should consider creating a cluster placement group and associate it with your compute resources. This keeps your multi-node parallel job on a logical grouping of instances within a single Availability Zone with high network flow potential. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html\">Placement groups</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> <p>When updating a compute environment, changing the placement group requires an infrastructure update of the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', 'ComputeResourceUpdate$imageId' => '<p>The Amazon Machine Image (AMI) ID used for instances launched in the compute environment. This parameter is overridden by the <code>imageIdOverride</code> member of the <code>Ec2Configuration</code> structure. To remove the custom AMI ID and use the default AMI ID, set this value to an empty string.</p> <p>When updating a compute environment, changing the AMI ID requires an infrastructure update of the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note> <note> <p>The AMI that you choose for a compute environment must match the architecture of the instance types that you intend to use for that compute environment. For example, if your compute environment uses A1 instance types, the compute resource AMI that you choose must support ARM instances. Amazon ECS vends both x86 and ARM versions of the Amazon ECS-optimized Amazon Linux 2 AMI. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html#ecs-optimized-ami-linux-variants.html\">Amazon ECS-optimized Amazon Linux 2 AMI</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p> </note>', 'ContainerDetail$image' => '<p>The image used to start the container.</p>', 'ContainerDetail$jobRoleArn' => '<p>The Amazon Resource Name (ARN) that\\'s associated with the job when run.</p>', 'ContainerDetail$executionRoleArn' => '<p>The Amazon Resource Name (ARN) of the execution role that Batch can assume. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html\">Batch execution IAM role</a> in the <i>Batch User Guide</i>.</p>', 'ContainerDetail$user' => '<p>The user name to use inside the container. This parameter maps to <code>User</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--user</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>.</p>', 'ContainerDetail$reason' => '<p>A short (255 max characters) human-readable string to provide additional details for a running or stopped container.</p>', 'ContainerDetail$containerInstanceArn' => '<p>The Amazon Resource Name (ARN) of the container instance that the container is running on.</p>', 'ContainerDetail$taskArn' => '<p>The Amazon Resource Name (ARN) of the Amazon ECS task that\\'s associated with the container job. Each container attempt receives a task ARN when they reach the <code>STARTING</code> status.</p>', 'ContainerDetail$logStreamName' => '<p>The name of the Amazon CloudWatch Logs log stream that\\'s associated with the container. The log group for Batch jobs is <code>/aws/batch/job</code>. Each container attempt receives a log stream name when they reach the <code>RUNNING</code> status.</p>', 'ContainerDetail$instanceType' => '<p>The instance type of the underlying host infrastructure of a multi-node parallel job.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources.</p> </note>', 'ContainerOverrides$instanceType' => '<p>The instance type to use for a multi-node parallel job.</p> <note> <p>This parameter isn\\'t applicable to single-node container jobs or jobs that run on Fargate resources, and shouldn\\'t be provided.</p> </note>', 'ContainerProperties$image' => '<p>The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with <code> <i>repository-url</i>/<i>image</i>:<i>tag</i> </code>. It can be 255 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), underscores (_), colons (:), periods (.), forward slashes (/), and number signs (#). This parameter maps to <code>Image</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>IMAGE</code> parameter of <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>.</p> <note> <p>Docker image architecture must match the processor architecture of the compute resources that they\\'re scheduled on. For example, ARM-based Docker images can only run on ARM-based compute resources.</p> </note> <ul> <li> <p>Images in Amazon ECR Public repositories use the full <code>registry/repository[:tag]</code> or <code>registry/repository[@digest]</code> naming conventions. For example, <code>public.ecr.aws/<i>registry_alias</i>/<i>my-web-app</i>:<i>latest</i> </code>.</p> </li> <li> <p>Images in Amazon ECR repositories use the full registry and repository URI (for example, <code>123456789012.dkr.ecr.&lt;region-name&gt;.amazonaws.com/&lt;repository-name&gt;</code>).</p> </li> <li> <p>Images in official repositories on Docker Hub use a single name (for example, <code>ubuntu</code> or <code>mongo</code>).</p> </li> <li> <p>Images in other repositories on Docker Hub are qualified with an organization name (for example, <code>amazon/amazon-ecs-agent</code>).</p> </li> <li> <p>Images in other online repositories are qualified further by a domain name (for example, <code>quay.io/assemblyline/ubuntu</code>).</p> </li> </ul>', 'ContainerProperties$jobRoleArn' => '<p>The Amazon Resource Name (ARN) of the IAM role that the container can assume for Amazon Web Services permissions. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html\">IAM roles for tasks</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>', 'ContainerProperties$executionRoleArn' => '<p>The Amazon Resource Name (ARN) of the execution role that Batch can assume. For jobs that run on Fargate resources, you must provide an execution role. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html\">Batch execution IAM role</a> in the <i>Batch User Guide</i>.</p>', 'ContainerProperties$user' => '<p>The user name to use inside the container. This parameter maps to <code>User</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--user</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>.</p>', 'ContainerProperties$instanceType' => '<p>The instance type to use for a multi-node parallel job. All node groups in a multi-node parallel job must use the same instance type.</p> <note> <p>This parameter isn\\'t applicable to single-node container jobs or jobs that run on Fargate resources, and shouldn\\'t be provided.</p> </note>', 'ContainerSummary$reason' => '<p>A short (255 max characters) human-readable string to provide additional details for a running or stopped container.</p>', 'CreateComputeEnvironmentRequest$computeEnvironmentName' => '<p>The name for your compute environment. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>', 'CreateComputeEnvironmentRequest$serviceRole' => '<p>The full Amazon Resource Name (ARN) of the IAM role that allows Batch to make calls to other Amazon Web Services services on your behalf. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html\">Batch service IAM role</a> in the <i>Batch User Guide</i>.</p> <important> <p>If your account already created the Batch service-linked role, that role is used by default for your compute environment unless you specify a different role here. If the Batch service-linked role doesn\\'t exist in your account, and no role is specified here, the service attempts to create the Batch service-linked role in your account.</p> </important> <p>If your specified role has a path other than <code>/</code>, then you must specify either the full role ARN (recommended) or prefix the role name with the path. For example, if a role with the name <code>bar</code> has a path of <code>/foo/</code>, specify <code>/foo/bar</code> as the role name. For more information, see <a href=\"https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names\">Friendly names and paths</a> in the <i>IAM User Guide</i>.</p> <note> <p>Depending on how you created your Batch service role, its ARN might contain the <code>service-role</code> path prefix. When you only specify the name of the service role, Batch assumes that your ARN doesn\\'t use the <code>service-role</code> path prefix. Because of this, we recommend that you specify the full ARN of your service role when you create compute environments.</p> </note>', 'CreateComputeEnvironmentResponse$computeEnvironmentName' => '<p>The name of the compute environment. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>', 'CreateComputeEnvironmentResponse$computeEnvironmentArn' => '<p>The Amazon Resource Name (ARN) of the compute environment.</p>', 'CreateJobQueueRequest$jobQueueName' => '<p>The name of the job queue. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>', 'CreateJobQueueRequest$schedulingPolicyArn' => '<p>The Amazon Resource Name (ARN) of the fair share scheduling policy. If this parameter is specified, the job queue uses a fair share scheduling policy. If this parameter isn\\'t specified, the job queue uses a first in, first out (FIFO) scheduling policy. After a job queue is created, you can replace but can\\'t remove the fair share scheduling policy. The format is <code>aws:<i>Partition</i>:batch:<i>Region</i>:<i>Account</i>:scheduling-policy/<i>Name</i> </code>. An example is <code>aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy</code>.</p>', 'CreateJobQueueResponse$jobQueueName' => '<p>The name of the job queue.</p>', 'CreateJobQueueResponse$jobQueueArn' => '<p>The Amazon Resource Name (ARN) of the job queue.</p>', 'CreateSchedulingPolicyRequest$name' => '<p>The name of the scheduling policy. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>', 'CreateSchedulingPolicyResponse$name' => '<p>The name of the scheduling policy.</p>', 'CreateSchedulingPolicyResponse$arn' => '<p>The Amazon Resource Name (ARN) of the scheduling policy. The format is <code>aws:<i>Partition</i>:batch:<i>Region</i>:<i>Account</i>:scheduling-policy/<i>Name</i> </code>. For example, <code>aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy</code>.</p>', 'DeleteComputeEnvironmentRequest$computeEnvironment' => '<p>The name or Amazon Resource Name (ARN) of the compute environment to delete.</p>', 'DeleteJobQueueRequest$jobQueue' => '<p>The short name or full Amazon Resource Name (ARN) of the queue to delete.</p>', 'DeleteSchedulingPolicyRequest$arn' => '<p>The Amazon Resource Name (ARN) of the scheduling policy to delete.</p>', 'DeregisterJobDefinitionRequest$jobDefinition' => '<p>The name and revision (<code>name:revision</code>) or full Amazon Resource Name (ARN) of the job definition to deregister.</p>', 'DescribeComputeEnvironmentsRequest$nextToken' => '<p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeComputeEnvironments</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note> <p>Treat this token as an opaque identifier that\\'s only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>', 'DescribeComputeEnvironmentsResponse$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>DescribeComputeEnvironments</code> request. When the results of a <code>DescribeComputeEnvironments</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', 'DescribeJobDefinitionsRequest$jobDefinitionName' => '<p>The name of the job definition to describe.</p>', 'DescribeJobDefinitionsRequest$status' => '<p>The status used to filter job definitions.</p>', 'DescribeJobDefinitionsRequest$nextToken' => '<p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeJobDefinitions</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note> <p>Treat this token as an opaque identifier that\\'s only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>', 'DescribeJobDefinitionsResponse$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>DescribeJobDefinitions</code> request. When the results of a <code>DescribeJobDefinitions</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', 'DescribeJobQueuesRequest$nextToken' => '<p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeJobQueues</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note> <p>Treat this token as an opaque identifier that\\'s only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>', 'DescribeJobQueuesResponse$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>DescribeJobQueues</code> request. When the results of a <code>DescribeJobQueues</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', 'Device$hostPath' => '<p>The path for the device on the host container instance.</p>', 'Device$containerPath' => '<p>The path inside the container that\\'s used to expose the host device. By default, the <code>hostPath</code> value is used.</p>', 'EFSAuthorizationConfig$accessPointId' => '<p>The Amazon EFS access point ID to use. If an access point is specified, the root directory value specified in the <code>EFSVolumeConfiguration</code> must either be omitted or set to <code>/</code> which enforces the path set on the EFS access point. If an access point is used, transit encryption must be enabled in the <code>EFSVolumeConfiguration</code>. For more information, see <a href=\"https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html\">Working with Amazon EFS access points</a> in the <i>Amazon Elastic File System User Guide</i>.</p>', 'EFSVolumeConfiguration$fileSystemId' => '<p>The Amazon EFS file system ID to use.</p>', 'EFSVolumeConfiguration$rootDirectory' => '<p>The directory within the Amazon EFS file system to mount as the root directory inside the host. If this parameter is omitted, the root of the Amazon EFS volume is used instead. Specifying <code>/</code> has the same effect as omitting this parameter. The maximum length is 4,096 characters.</p> <important> <p>If an EFS access point is specified in the <code>authorizationConfig</code>, the root directory parameter must either be omitted or set to <code>/</code>, which enforces the path set on the Amazon EFS access point.</p> </important>', 'EksAttemptContainerDetail$reason' => '<p>A short (255 max characters) human-readable string to provide additional details for a running or stopped container.</p>', 'EksAttemptDetail$podName' => '<p>The name of the pod for this job attempt.</p>', 'EksAttemptDetail$nodeName' => '<p>The name of the node for this job attempt.</p>', 'EksAttemptDetail$statusReason' => '<p>A short, human-readable string to provide additional details for the current status of the job attempt.</p>', 'EksConfiguration$eksClusterArn' => '<p>The Amazon Resource Name (ARN) of the Amazon EKS cluster. An example is <code>arn:<i>aws</i>:eks:<i>us-east-1</i>:<i>123456789012</i>:cluster/<i>ClusterForBatch</i> </code>. </p>', 'EksConfiguration$kubernetesNamespace' => '<p>The namespace of the Amazon EKS cluster. Batch manages pods in this namespace. The value can\\'t left empty or null. It must be fewer than 64 characters long, can\\'t be set to <code>default</code>, can\\'t start with \"<code>kube-</code>,\" and must match this regular expression: <code>^[a-z0-9]([-a-z0-9]*[a-z0-9])?$</code>. For more information, see <a href=\"https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/\">Namespaces</a> in the Kubernetes documentation.</p>', 'EksContainer$name' => '<p>The name of the container. If the name isn\\'t specified, the default name \"<code>Default</code>\" is used. Each container in a pod must have a unique name.</p>', 'EksContainer$image' => '<p>The Docker image used to start the container.</p>', 'EksContainer$imagePullPolicy' => '<p>The image pull policy for the container. Supported values are <code>Always</code>, <code>IfNotPresent</code>, and <code>Never</code>. This parameter defaults to <code>IfNotPresent</code>. However, if the <code>:latest</code> tag is specified, it defaults to <code>Always</code>. For more information, see <a href=\"https://kubernetes.io/docs/concepts/containers/images/#updating-images\">Updating images</a> in the <i>Kubernetes documentation</i>.</p>', 'EksContainerDetail$name' => '<p>The name of the container. If the name isn\\'t specified, the default name \"<code>Default</code>\" is used. Each container in a pod must have a unique name.</p>', 'EksContainerDetail$image' => '<p>The Docker image used to start the container.</p>', 'EksContainerDetail$imagePullPolicy' => '<p>The image pull policy for the container. Supported values are <code>Always</code>, <code>IfNotPresent</code>, and <code>Never</code>. This parameter defaults to <code>Always</code> if the <code>:latest</code> tag is specified, <code>IfNotPresent</code> otherwise. For more information, see <a href=\"https://kubernetes.io/docs/concepts/containers/images/#updating-images\">Updating images</a> in the <i>Kubernetes documentation</i>.</p>', 'EksContainerDetail$reason' => '<p>A short human-readable string to provide additional details for a running or stopped container. It can be up to 255 characters long.</p>', 'EksContainerEnvironmentVariable$name' => '<p>The name of the environment variable.</p>', 'EksContainerEnvironmentVariable$value' => '<p>The value of the environment variable.</p>', 'EksContainerOverride$image' => '<p>The override of the Docker image that\\'s used to start the container.</p>', 'EksContainerVolumeMount$name' => '<p>The name the volume mount. This must match the name of one of the volumes in the pod.</p>', 'EksContainerVolumeMount$mountPath' => '<p>The path on the container where the volume is mounted.</p>', 'EksEmptyDir$medium' => '<p>The medium to store the volume. The default value is an empty string, which uses the storage of the node.</p> <dl> <dt>\"\"</dt> <dd> <p> <b>(Default)</b> Use the disk storage of the node.</p> </dd> <dt>\"Memory\"</dt> <dd> <p>Use the <code>tmpfs</code> volume that\\'s backed by the RAM of the node. Contents of the volume are lost when the node reboots, and any storage on the volume counts against the container\\'s memory limit.</p> </dd> </dl>', 'EksHostPath$path' => '<p>The path of the file or directory on the host to mount into containers on the pod.</p>', 'EksLabelsMap$key' => NULL, 'EksLabelsMap$value' => NULL, 'EksLimits$key' => NULL, 'EksPodProperties$serviceAccountName' => '<p>The name of the service account that\\'s used to run the pod. For more information, see <a href=\"https://docs.aws.amazon.com/eks/latest/userguide/service-accounts.html\">Kubernetes service accounts</a> and <a href=\"https://docs.aws.amazon.com/eks/latest/userguide/associate-service-account-role.html\">Configure a Kubernetes service account to assume an IAM role</a> in the <i>Amazon EKS User Guide</i> and <a href=\"https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/\">Configure service accounts for pods</a> in the <i>Kubernetes documentation</i>.</p>', 'EksPodProperties$dnsPolicy' => '<p>The DNS policy for the pod. The default value is <code>ClusterFirst</code>. If the <code>hostNetwork</code> parameter is not specified, the default is <code>ClusterFirstWithHostNet</code>. <code>ClusterFirst</code> indicates that any DNS query that does not match the configured cluster domain suffix is forwarded to the upstream nameserver inherited from the node. For more information, see <a href=\"https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy\">Pod\\'s DNS policy</a> in the <i>Kubernetes documentation</i>.</p> <p>Valid values: <code>Default</code> | <code>ClusterFirst</code> | <code>ClusterFirstWithHostNet</code> </p>', 'EksPodPropertiesDetail$serviceAccountName' => '<p>The name of the service account that\\'s used to run the pod. For more information, see <a href=\"https://docs.aws.amazon.com/eks/latest/userguide/service-accounts.html\">Kubernetes service accounts</a> and <a href=\"https://docs.aws.amazon.com/eks/latest/userguide/associate-service-account-role.html\">Configure a Kubernetes service account to assume an IAM role</a> in the <i>Amazon EKS User Guide</i> and <a href=\"https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/\">Configure service accounts for pods</a> in the <i>Kubernetes documentation</i>.</p>', 'EksPodPropertiesDetail$dnsPolicy' => '<p>The DNS policy for the pod. The default value is <code>ClusterFirst</code>. If the <code>hostNetwork</code> parameter is not specified, the default is <code>ClusterFirstWithHostNet</code>. <code>ClusterFirst</code> indicates that any DNS query that does not match the configured cluster domain suffix is forwarded to the upstream nameserver inherited from the node. If no value was specified for <code>dnsPolicy</code> in the <a href=\"https://docs.aws.amazon.com/batch/latest/APIReference/API_RegisterJobDefinition.html\">RegisterJobDefinition</a> API operation, then no value will be returned for <code>dnsPolicy</code> by either of <a href=\"https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeJobDefinitions.html\">DescribeJobDefinitions</a> or <a href=\"https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeJobs.html\">DescribeJobs</a> API operations. The pod spec setting will contain either <code>ClusterFirst</code> or <code>ClusterFirstWithHostNet</code>, depending on the value of the <code>hostNetwork</code> parameter. For more information, see <a href=\"https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy\">Pod\\'s DNS policy</a> in the <i>Kubernetes documentation</i>.</p> <p>Valid values: <code>Default</code> | <code>ClusterFirst</code> | <code>ClusterFirstWithHostNet</code> </p>', 'EksPodPropertiesDetail$podName' => '<p>The name of the pod for this job.</p>', 'EksPodPropertiesDetail$nodeName' => '<p>The name of the node for this job.</p>', 'EksRequests$key' => NULL, 'EksSecret$secretName' => '<p>The name of the secret. The name must be allowed as a DNS subdomain name. For more information, see <a href=\"https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names\">DNS subdomain names</a> in the <i>Kubernetes documentation</i>.</p>', 'EksVolume$name' => '<p>The name of the volume. The name must be allowed as a DNS subdomain name. For more information, see <a href=\"https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names\">DNS subdomain names</a> in the <i>Kubernetes documentation</i>.</p>', 'EvaluateOnExit$onStatusReason' => '<p>Contains a glob pattern to match against the <code>StatusReason</code> returned for a job. The pattern can contain up to 512 characters. It can contain letters, numbers, periods (.), colons (:), and white spaces (including spaces or tabs). It can optionally end with an asterisk (*) so that only the start of the string needs to be an exact match.</p>', 'EvaluateOnExit$onReason' => '<p>Contains a glob pattern to match against the <code>Reason</code> returned for a job. The pattern can contain up to 512 characters. It can contain letters, numbers, periods (.), colons (:), and white space (including spaces and tabs). It can optionally end with an asterisk (*) so that only the start of the string needs to be an exact match.</p>', 'EvaluateOnExit$onExitCode' => '<p>Contains a glob pattern to match against the decimal representation of the <code>ExitCode</code> returned for a job. The pattern can be up to 512 characters long. It can contain only numbers, and can end with an asterisk (*) so that only the start of the string needs to be an exact match.</p> <p>The string can contain up to 512 characters.</p>', 'FargatePlatformConfiguration$platformVersion' => '<p>The Fargate platform version where the jobs are running. A platform version is specified only for jobs that are running on Fargate resources. If one isn\\'t specified, the <code>LATEST</code> platform version is used by default. This uses a recent, approved version of the Fargate platform for compute resources. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html\">Fargate platform versions</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>', 'Host$sourcePath' => '<p>The path on the host container instance that\\'s presented to the container. If this parameter is empty, then the Docker daemon has assigned a host path for you. If this parameter contains a file location, then the data volume persists at the specified location on the host container instance until you delete it manually. If the source path location doesn\\'t exist on the host container instance, the Docker daemon creates it. If the location does exist, the contents of the source path folder are exported.</p> <note> <p>This parameter isn\\'t applicable to jobs that run on Fargate resources. Don\\'t provide this for these jobs.</p> </note>', 'JobDefinition$jobDefinitionName' => '<p>The name of the job definition.</p>', 'JobDefinition$jobDefinitionArn' => '<p>The Amazon Resource Name (ARN) for the job definition.</p>', 'JobDefinition$status' => '<p>The status of the job definition.</p>', 'JobDefinition$type' => '<p>The type of job definition. It\\'s either <code>container</code> or <code>multinode</code>. If the job is run on Fargate resources, then <code>multinode</code> isn\\'t supported. For more information about multi-node parallel jobs, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/multi-node-job-def.html\">Creating a multi-node parallel job definition</a> in the <i>Batch User Guide</i>.</p>', 'JobDependency$jobId' => '<p>The job ID of the Batch job that\\'s associated with this dependency.</p>', 'JobDetail$jobArn' => '<p>The Amazon Resource Name (ARN) of the job.</p>', 'JobDetail$jobName' => '<p>The job name.</p>', 'JobDetail$jobId' => '<p>The job ID.</p>', 'JobDetail$jobQueue' => '<p>The Amazon Resource Name (ARN) of the job queue that the job is associated with.</p>', 'JobDetail$shareIdentifier' => '<p>The share identifier for the job.</p>', 'JobDetail$statusReason' => '<p>A short, human-readable string to provide more details for the current status of the job.</p>', 'JobDetail$jobDefinition' => '<p>The Amazon Resource Name (ARN) of the job definition that this job uses.</p>', 'JobQueueDetail$jobQueueName' => '<p>The job queue name.</p>', 'JobQueueDetail$jobQueueArn' => '<p>The Amazon Resource Name (ARN) of the job queue.</p>', 'JobQueueDetail$schedulingPolicyArn' => '<p>The Amazon Resource Name (ARN) of the scheduling policy. The format is <code>aws:<i>Partition</i>:batch:<i>Region</i>:<i>Account</i>:scheduling-policy/<i>Name</i> </code>. For example, <code>aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy</code>.</p>', 'JobQueueDetail$statusReason' => '<p>A short, human-readable string to provide additional details for the current status of the job queue.</p>', 'JobSummary$jobArn' => '<p>The Amazon Resource Name (ARN) of the job.</p>', 'JobSummary$jobId' => '<p>The job ID.</p>', 'JobSummary$jobName' => '<p>The job name.</p>', 'JobSummary$statusReason' => '<p>A short, human-readable string to provide more details for the current status of the job.</p>', 'JobSummary$jobDefinition' => '<p>The Amazon Resource Name (ARN) of the job definition.</p>', 'KeyValuePair$name' => '<p>The name of the key-value pair. For environment variables, this is the name of the environment variable.</p>', 'KeyValuePair$value' => '<p>The value of the key-value pair. For environment variables, this is the value of the environment variable.</p>', 'KeyValuesPair$name' => '<p>The name of the filter. Filter names are case sensitive.</p>', 'LaunchTemplateSpecification$launchTemplateId' => '<p>The ID of the launch template.</p>', 'LaunchTemplateSpecification$launchTemplateName' => '<p>The name of the launch template.</p>', 'LaunchTemplateSpecification$version' => '<p>The version number of the launch template, <code>$Latest</code>, or <code>$Default</code>.</p> <p>If the value is <code>$Latest</code>, the latest version of the launch template is used. If the value is <code>$Default</code>, the default version of the launch template is used.</p> <important> <p>If the AMI ID that\\'s used in a compute environment is from the launch template, the AMI isn\\'t changed when the compute environment is updated. It\\'s only changed if the <code>updateToLatestImageVersion</code> parameter for the compute environment is set to <code>true</code>. During an infrastructure update, if either <code>$Latest</code> or <code>$Default</code> is specified, Batch re-evaluates the launch template version, and it might use a different version of the launch template. This is the case even if the launch template isn\\'t specified in the update. When updating a compute environment, changing the launch template requires an infrastructure update of the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p> </important> <p>Default: <code>$Default</code>.</p>', 'ListJobsRequest$jobQueue' => '<p>The name or full Amazon Resource Name (ARN) of the job queue used to list jobs.</p>', 'ListJobsRequest$arrayJobId' => '<p>The job ID for an array job. Specifying an array job ID with this parameter lists all child jobs from within the specified array.</p>', 'ListJobsRequest$multiNodeJobId' => '<p>The job ID for a multi-node parallel job. Specifying a multi-node parallel job ID with this parameter lists all nodes that are associated with the specified job.</p>', 'ListJobsRequest$nextToken' => '<p>The <code>nextToken</code> value returned from a previous paginated <code>ListJobs</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note> <p>Treat this token as an opaque identifier that\\'s only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>', 'ListJobsResponse$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>ListJobs</code> request. When the results of a <code>ListJobs</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', 'ListSchedulingPoliciesRequest$nextToken' => '<p>The <code>nextToken</code> value that\\'s returned from a previous paginated <code>ListSchedulingPolicies</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note> <p>Treat this token as an opaque identifier that\\'s only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>', 'ListSchedulingPoliciesResponse$nextToken' => '<p>The <code>nextToken</code> value to include in a future <code>ListSchedulingPolicies</code> request. When the results of a <code>ListSchedulingPolicies</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>', 'ListTagsForResourceRequest$resourceArn' => '<p>The Amazon Resource Name (ARN) that identifies the resource that tags are listed for. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren\\'t supported.</p>', 'LogConfigurationOptionsMap$key' => NULL, 'LogConfigurationOptionsMap$value' => NULL, 'MountPoint$containerPath' => '<p>The path on the container where the host volume is mounted.</p>', 'MountPoint$sourceVolume' => '<p>The name of the volume to mount.</p>', 'NetworkInterface$attachmentId' => '<p>The attachment ID for the network interface.</p>', 'NetworkInterface$ipv6Address' => '<p>The private IPv6 address for the network interface.</p>', 'NetworkInterface$privateIpv4Address' => '<p>The private IPv4 address for the network interface.</p>', 'NodePropertyOverride$targetNodes' => '<p>The range of nodes, using node index values, that\\'s used to override. A range of <code>0:3</code> indicates nodes with index values of <code>0</code> through <code>3</code>. If the starting range value is omitted (<code>:n</code>), then <code>0</code> is used to start the range. If the ending range value is omitted (<code>n:</code>), then the highest possible node index is used to end the range.</p>', 'NodeRangeProperty$targetNodes' => '<p>The range of nodes, using node index values. A range of <code>0:3</code> indicates nodes with index values of <code>0</code> through <code>3</code>. If the starting range value is omitted (<code>:n</code>), then <code>0</code> is used to start the range. If the ending range value is omitted (<code>n:</code>), then the highest possible node index is used to end the range. Your accumulative node ranges must account for all nodes (<code>0:n</code>). You can nest node ranges (for example, <code>0:10</code> and <code>4:5</code>). In this case, the <code>4:5</code> range properties override the <code>0:10</code> properties.</p>', 'ParametersMap$key' => NULL, 'ParametersMap$value' => NULL, 'RegisterJobDefinitionRequest$jobDefinitionName' => '<p>The name of the job definition to register. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>', 'RegisterJobDefinitionResponse$jobDefinitionName' => '<p>The name of the job definition.</p>', 'RegisterJobDefinitionResponse$jobDefinitionArn' => '<p>The Amazon Resource Name (ARN) of the job definition.</p>', 'ResourceRequirement$value' => '<p>The quantity of the specified resource to reserve for the container. The values vary based on the <code>type</code> specified.</p> <dl> <dt>type=\"GPU\"</dt> <dd> <p>The number of physical GPUs to reserve for the container. Make sure that the number of GPUs reserved for all containers in a job doesn\\'t exceed the number of available GPUs on the compute resource that the job is launched on.</p> <note> <p>GPUs aren\\'t available for jobs that are running on Fargate resources.</p> </note> </dd> <dt>type=\"MEMORY\"</dt> <dd> <p>The memory hard limit (in MiB) present to the container. This parameter is supported for jobs that are running on EC2 resources. If your container attempts to exceed the memory specified, the container is terminated. This parameter maps to <code>Memory</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--memory</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>. You must specify at least 4 MiB of memory for a job. This is required but can be specified in several places for multi-node parallel (MNP) jobs. It must be specified for each node at least once. This parameter maps to <code>Memory</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--memory</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>.</p> <note> <p>If you\\'re trying to maximize your resource utilization by providing your jobs as much memory as possible for a particular instance type, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/memory-management.html\">Memory management</a> in the <i>Batch User Guide</i>.</p> </note> <p>For jobs that are running on Fargate resources, then <code>value</code> is the hard limit (in MiB), and must match one of the supported values and the <code>VCPU</code> values must be one of the values supported for that memory value.</p> <dl> <dt>value = 512</dt> <dd> <p> <code>VCPU</code> = 0.25</p> </dd> <dt>value = 1024</dt> <dd> <p> <code>VCPU</code> = 0.25 or 0.5</p> </dd> <dt>value = 2048</dt> <dd> <p> <code>VCPU</code> = 0.25, 0.5, or 1</p> </dd> <dt>value = 3072</dt> <dd> <p> <code>VCPU</code> = 0.5, or 1</p> </dd> <dt>value = 4096</dt> <dd> <p> <code>VCPU</code> = 0.5, 1, or 2</p> </dd> <dt>value = 5120, 6144, or 7168</dt> <dd> <p> <code>VCPU</code> = 1 or 2</p> </dd> <dt>value = 8192</dt> <dd> <p> <code>VCPU</code> = 1, 2, or 4</p> </dd> <dt>value = 9216, 10240, 11264, 12288, 13312, 14336, or 15360</dt> <dd> <p> <code>VCPU</code> = 2 or 4</p> </dd> <dt>value = 16384</dt> <dd> <p> <code>VCPU</code> = 2, 4, or 8</p> </dd> <dt>value = 17408, 18432, 19456, 21504, 22528, 23552, 25600, 26624, 27648, 29696, or 30720</dt> <dd> <p> <code>VCPU</code> = 4</p> </dd> <dt>value = 20480, 24576, or 28672</dt> <dd> <p> <code>VCPU</code> = 4 or 8</p> </dd> <dt>value = 36864, 45056, 53248, or 61440</dt> <dd> <p> <code>VCPU</code> = 8</p> </dd> <dt>value = 32768, 40960, 49152, or 57344</dt> <dd> <p> <code>VCPU</code> = 8 or 16</p> </dd> <dt>value = 65536, 73728, 81920, 90112, 98304, 106496, 114688, or 122880</dt> <dd> <p> <code>VCPU</code> = 16</p> </dd> </dl> </dd> <dt>type=\"VCPU\"</dt> <dd> <p>The number of vCPUs reserved for the container. This parameter maps to <code>CpuShares</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--cpu-shares</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>. Each vCPU is equivalent to 1,024 CPU shares. For EC2 resources, you must specify at least one vCPU. This is required but can be specified in several places; it must be specified for each node at least once.</p> <p>The default for the Fargate On-Demand vCPU resource count quota is 6 vCPUs. For more information about Fargate quotas, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/ecs-service.html#service-quotas-fargate\">Fargate quotas</a> in the <i>Amazon Web Services General Reference</i>.</p> <p>For jobs that are running on Fargate resources, then <code>value</code> must match one of the supported values and the <code>MEMORY</code> values must be one of the values supported for that <code>VCPU</code> value. The supported values are 0.25, 0.5, 1, 2, 4, 8, and 16</p> <dl> <dt>value = 0.25</dt> <dd> <p> <code>MEMORY</code> = 512, 1024, or 2048</p> </dd> <dt>value = 0.5</dt> <dd> <p> <code>MEMORY</code> = 1024, 2048, 3072, or 4096</p> </dd> <dt>value = 1</dt> <dd> <p> <code>MEMORY</code> = 2048, 3072, 4096, 5120, 6144, 7168, or 8192</p> </dd> <dt>value = 2</dt> <dd> <p> <code>MEMORY</code> = 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360, or 16384</p> </dd> <dt>value = 4</dt> <dd> <p> <code>MEMORY</code> = 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360, 16384, 17408, 18432, 19456, 20480, 21504, 22528, 23552, 24576, 25600, 26624, 27648, 28672, 29696, or 30720</p> </dd> <dt>value = 8</dt> <dd> <p> <code>MEMORY</code> = 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, or 61440 </p> </dd> <dt>value = 16</dt> <dd> <p> <code>MEMORY</code> = 32768, 40960, 49152, 57344, 65536, 73728, 81920, 90112, 98304, 106496, 114688, or 122880 </p> </dd> </dl> </dd> </dl>', 'SchedulingPolicyDetail$name' => '<p>The name of the scheduling policy.</p>', 'SchedulingPolicyDetail$arn' => '<p>The Amazon Resource Name (ARN) of the scheduling policy. An example is <code>arn:<i>aws</i>:batch:<i>us-east-1</i>:<i>123456789012</i>:scheduling-policy/<i>HighPriority</i> </code>.</p>', 'SchedulingPolicyListingDetail$arn' => '<p>Amazon Resource Name (ARN) of the scheduling policy.</p>', 'Secret$name' => '<p>The name of the secret.</p>', 'Secret$valueFrom' => '<p>The secret to expose to the container. The supported values are either the full Amazon Resource Name (ARN) of the Secrets Manager secret or the full ARN of the parameter in the Amazon Web Services Systems Manager Parameter Store.</p> <note> <p>If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Region as the job you\\'re launching, then you can use either the full Amazon Resource Name (ARN) or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified.</p> </note>', 'ServerException$message' => NULL, 'ShareAttributes$shareIdentifier' => '<p>A fair share identifier or fair share identifier prefix. If the string ends with an asterisk (*), this entry specifies the weight factor to use for fair share identifiers that start with that prefix. The list of fair share identifiers in a fair share policy can\\'t overlap. For example, you can\\'t have one that specifies a <code>shareIdentifier</code> of <code>UserA*</code> and another that specifies a <code>shareIdentifier</code> of <code>UserA-1</code>.</p> <p>There can be no more than 500 fair share identifiers active in a job queue.</p> <p>The string is limited to 255 alphanumeric characters, and can be followed by an asterisk (*).</p>', 'StringList$member' => NULL, 'SubmitJobRequest$jobName' => '<p>The name of the job. It can be up to 128 letters long. The first character must be alphanumeric, can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>', 'SubmitJobRequest$jobQueue' => '<p>The job queue where the job is submitted. You can specify either the name or the Amazon Resource Name (ARN) of the queue.</p>', 'SubmitJobRequest$shareIdentifier' => '<p>The share identifier for the job. If the job queue doesn\\'t have a scheduling policy, then this parameter must not be specified. If the job queue has a scheduling policy, then this parameter must be specified.</p>', 'SubmitJobRequest$jobDefinition' => '<p>The job definition used by this job. This value can be one of <code>definition-name</code>, <code>definition-name:revision</code>, or the Amazon Resource Name (ARN) for the job definition, with or without the revision (<code>arn:aws:batch:<i>region</i>:<i>account</i>:job-definition/<i>definition-name</i>:<i>revision</i> </code>, or <code>arn:aws:batch:<i>region</i>:<i>account</i>:job-definition/<i>definition-name</i> </code>).</p> <p>If the revision is not specified, then the latest active revision is used.</p>', 'SubmitJobResponse$jobArn' => '<p>The Amazon Resource Name (ARN) for the job.</p>', 'SubmitJobResponse$jobName' => '<p>The name of the job.</p>', 'SubmitJobResponse$jobId' => '<p>The unique identifier for the job.</p>', 'TagResourceRequest$resourceArn' => '<p>The Amazon Resource Name (ARN) of the resource that tags are added to. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren\\'t supported.</p>', 'TagsMap$key' => NULL, 'TagsMap$value' => NULL, 'TerminateJobRequest$jobId' => '<p>The Batch job ID of the job to terminate.</p>', 'TerminateJobRequest$reason' => '<p>A message to attach to the job that explains the reason for canceling it. This message is returned by future <a>DescribeJobs</a> operations on the job. This message is also recorded in the Batch activity logs.</p>', 'Tmpfs$containerPath' => '<p>The absolute file path in the container where the <code>tmpfs</code> volume is mounted.</p>', 'Ulimit$name' => '<p>The <code>type</code> of the <code>ulimit</code>.</p>', 'UntagResourceRequest$resourceArn' => '<p>The Amazon Resource Name (ARN) of the resource from which to delete tags. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren\\'t supported.</p>', 'UpdateComputeEnvironmentRequest$computeEnvironment' => '<p>The name or full Amazon Resource Name (ARN) of the compute environment to update.</p>', 'UpdateComputeEnvironmentRequest$serviceRole' => '<p>The full Amazon Resource Name (ARN) of the IAM role that allows Batch to make calls to other Amazon Web Services services on your behalf. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html\">Batch service IAM role</a> in the <i>Batch User Guide</i>.</p> <important> <p>If the compute environment has a service-linked role, it can\\'t be changed to use a regular IAM role. Likewise, if the compute environment has a regular IAM role, it can\\'t be changed to use a service-linked role. To update the parameters for the compute environment that require an infrastructure update to change, the <b>AWSServiceRoleForBatch</b> service-linked role must be used. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p> </important> <p>If your specified role has a path other than <code>/</code>, then you must either specify the full role ARN (recommended) or prefix the role name with the path.</p> <note> <p>Depending on how you created your Batch service role, its ARN might contain the <code>service-role</code> path prefix. When you only specify the name of the service role, Batch assumes that your ARN doesn\\'t use the <code>service-role</code> path prefix. Because of this, we recommend that you specify the full ARN of your service role when you create compute environments.</p> </note>', 'UpdateComputeEnvironmentResponse$computeEnvironmentName' => '<p>The name of the compute environment. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>', 'UpdateComputeEnvironmentResponse$computeEnvironmentArn' => '<p>The Amazon Resource Name (ARN) of the compute environment.</p>', 'UpdateJobQueueRequest$jobQueue' => '<p>The name or the Amazon Resource Name (ARN) of the job queue.</p>', 'UpdateJobQueueRequest$schedulingPolicyArn' => '<p>Amazon Resource Name (ARN) of the fair share scheduling policy. Once a job queue is created, the fair share scheduling policy can be replaced but not removed. The format is <code>aws:<i>Partition</i>:batch:<i>Region</i>:<i>Account</i>:scheduling-policy/<i>Name</i> </code>. For example, <code>aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy</code>.</p>', 'UpdateJobQueueResponse$jobQueueName' => '<p>The name of the job queue.</p>', 'UpdateJobQueueResponse$jobQueueArn' => '<p>The Amazon Resource Name (ARN) of the job queue.</p>', 'UpdateSchedulingPolicyRequest$arn' => '<p>The Amazon Resource Name (ARN) of the scheduling policy to update.</p>', 'Volume$name' => '<p>The name of the volume. It can be up to 255 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_). This name is referenced in the <code>sourceVolume</code> parameter of container definition <code>mountPoints</code>.</p>', ], ], 'StringList' => [ 'base' => NULL, 'refs' => [ 'ComputeResource$instanceTypes' => '<p>The instances types that can be launched. You can specify instance families to launch any instance type within those families (for example, <code>c5</code> or <code>p3</code>), or you can specify specific sizes within a family (such as <code>c5.8xlarge</code>). You can also choose <code>optimal</code> to select instance types (from the C4, M4, and R4 instance families) that match the demand of your job queues.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note> <note> <p>When you create a compute environment, the instance types that you select for the compute environment must share the same architecture. For example, you can\\'t mix x86 and ARM instances in the same compute environment.</p> </note> <note> <p>Currently, <code>optimal</code> uses instance types from the C4, M4, and R4 instance families. In Regions that don\\'t have instance types from those instance families, instance types from the C5, M5, and R5 instance families are used.</p> </note>', 'ComputeResource$subnets' => '<p>The VPC subnets where the compute resources are launched. These subnets must be within the same VPC. Fargate compute resources can contain up to 16 subnets. For more information, see <a href=\"https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html\">VPCs and subnets</a> in the <i>Amazon VPC User Guide</i>.</p> <note> <p>Batch on Amazon EC2 and Batch on Amazon EKS support Local Zones. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-local-zones\"> Local Zones</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>, <a href=\"https://docs.aws.amazon.com/eks/latest/userguide/local-zones.html\">Amazon EKS and Amazon Web Services Local Zones</a> in the <i>Amazon EKS User Guide</i> and <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-regions-zones.html#clusters-local-zones\"> Amazon ECS clusters in Local Zones, Wavelength Zones, and Amazon Web Services Outposts</a> in the <i>Amazon ECS Developer Guide</i>.</p> <p>Batch on Fargate doesn\\'t currently support Local Zones.</p> </note>', 'ComputeResource$securityGroupIds' => '<p>The Amazon EC2 security groups that are associated with instances launched in the compute environment. One or more security groups must be specified, either in <code>securityGroupIds</code> or using a launch template referenced in <code>launchTemplate</code>. This parameter is required for jobs that are running on Fargate resources and must contain at least one security group. Fargate doesn\\'t support launch templates. If security groups are specified using both <code>securityGroupIds</code> and <code>launchTemplate</code>, the values in <code>securityGroupIds</code> are used.</p>', 'ComputeResourceUpdate$subnets' => '<p>The VPC subnets where the compute resources are launched. Fargate compute resources can contain up to 16 subnets. For Fargate compute resources, providing an empty list will be handled as if this parameter wasn\\'t specified and no change is made. For EC2 compute resources, providing an empty list removes the VPC subnets from the compute resource. For more information, see <a href=\"https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html\">VPCs and subnets</a> in the <i>Amazon VPC User Guide</i>.</p> <p>When updating a compute environment, changing the VPC subnets requires an infrastructure update of the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p> <note> <p>Batch on Amazon EC2 and Batch on Amazon EKS support Local Zones. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-local-zones\"> Local Zones</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>, <a href=\"https://docs.aws.amazon.com/eks/latest/userguide/local-zones.html\">Amazon EKS and Amazon Web Services Local Zones</a> in the <i>Amazon EKS User Guide</i> and <a href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-regions-zones.html#clusters-local-zones\"> Amazon ECS clusters in Local Zones, Wavelength Zones, and Amazon Web Services Outposts</a> in the <i>Amazon ECS Developer Guide</i>.</p> <p>Batch on Fargate doesn\\'t currently support Local Zones.</p> </note>', 'ComputeResourceUpdate$securityGroupIds' => '<p>The Amazon EC2 security groups that are associated with instances launched in the compute environment. This parameter is required for Fargate compute resources, where it can contain up to 5 security groups. For Fargate compute resources, providing an empty list is handled as if this parameter wasn\\'t specified and no change is made. For EC2 compute resources, providing an empty list removes the security groups from the compute resource.</p> <p>When updating a compute environment, changing the EC2 security groups requires an infrastructure update of the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p>', 'ComputeResourceUpdate$instanceTypes' => '<p>The instances types that can be launched. You can specify instance families to launch any instance type within those families (for example, <code>c5</code> or <code>p3</code>), or you can specify specific sizes within a family (such as <code>c5.8xlarge</code>). You can also choose <code>optimal</code> to select instance types (from the C4, M4, and R4 instance families) that match the demand of your job queues.</p> <p>When updating a compute environment, changing this setting requires an infrastructure update of the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note> <note> <p>When you create a compute environment, the instance types that you select for the compute environment must share the same architecture. For example, you can\\'t mix x86 and ARM instances in the same compute environment.</p> </note> <note> <p>Currently, <code>optimal</code> uses instance types from the C4, M4, and R4 instance families. In Regions that don\\'t have instance types from those instance families, instance types from the C5, M5, and R5 instance families are used.</p> </note>', 'ContainerDetail$command' => '<p>The command that\\'s passed to the container.</p>', 'ContainerOverrides$command' => '<p>The command to send to the container that overrides the default command from the Docker image or the job definition.</p>', 'ContainerProperties$command' => '<p>The command that\\'s passed to the container. This parameter maps to <code>Cmd</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>COMMAND</code> parameter to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>. For more information, see <a href=\"https://docs.docker.com/engine/reference/builder/#cmd\">https://docs.docker.com/engine/reference/builder/#cmd</a>.</p>', 'DescribeComputeEnvironmentsRequest$computeEnvironments' => '<p>A list of up to 100 compute environment names or full Amazon Resource Name (ARN) entries.</p>', 'DescribeJobDefinitionsRequest$jobDefinitions' => '<p>A list of up to 100 job definitions. Each entry in the list can either be an ARN in the format <code>arn:aws:batch:${Region}:${Account}:job-definition/${JobDefinitionName}:${Revision}</code> or a short version using the form <code>${JobDefinitionName}:${Revision}</code>.</p>', 'DescribeJobQueuesRequest$jobQueues' => '<p>A list of up to 100 queue names or full queue Amazon Resource Name (ARN) entries.</p>', 'DescribeJobsRequest$jobs' => '<p>A list of up to 100 job IDs.</p>', 'DescribeSchedulingPoliciesRequest$arns' => '<p>A list of up to 100 scheduling policy Amazon Resource Name (ARN) entries.</p>', 'EksContainer$command' => '<p>The entrypoint for the container. This isn\\'t run within a shell. If this isn\\'t specified, the <code>ENTRYPOINT</code> of the container image is used. Environment variable references are expanded using the container\\'s environment.</p> <p>If the referenced environment variable doesn\\'t exist, the reference in the command isn\\'t changed. For example, if the reference is to \"<code>$(NAME1)</code>\" and the <code>NAME1</code> environment variable doesn\\'t exist, the command string will remain \"<code>$(NAME1)</code>.\" <code>$$</code> is replaced with <code>$</code> and the resulting string isn\\'t expanded. For example, <code>$$(VAR_NAME)</code> will be passed as <code>$(VAR_NAME)</code> whether or not the <code>VAR_NAME</code> environment variable exists. The entrypoint can\\'t be updated. For more information, see <a href=\"https://docs.docker.com/engine/reference/builder/#entrypoint\">ENTRYPOINT</a> in the <i>Dockerfile reference</i> and <a href=\"https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/\">Define a command and arguments for a container</a> and <a href=\"https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#entrypoint\">Entrypoint</a> in the <i>Kubernetes documentation</i>.</p>', 'EksContainer$args' => '<p>An array of arguments to the entrypoint. If this isn\\'t specified, the <code>CMD</code> of the container image is used. This corresponds to the <code>args</code> member in the <a href=\"https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#entrypoint\">Entrypoint</a> portion of the <a href=\"https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/\">Pod</a> in Kubernetes. Environment variable references are expanded using the container\\'s environment.</p> <p>If the referenced environment variable doesn\\'t exist, the reference in the command isn\\'t changed. For example, if the reference is to \"<code>$(NAME1)</code>\" and the <code>NAME1</code> environment variable doesn\\'t exist, the command string will remain \"<code>$(NAME1)</code>.\" <code>$$</code> is replaced with <code>$</code>, and the resulting string isn\\'t expanded. For example, <code>$$(VAR_NAME)</code> is passed as <code>$(VAR_NAME)</code> whether or not the <code>VAR_NAME</code> environment variable exists. For more information, see <a href=\"https://docs.docker.com/engine/reference/builder/#cmd\">CMD</a> in the <i>Dockerfile reference</i> and <a href=\"https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/\">Define a command and arguments for a pod</a> in the <i>Kubernetes documentation</i>.</p>', 'EksContainerDetail$command' => '<p>The entrypoint for the container. For more information, see <a href=\"https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#entrypoint\">Entrypoint</a> in the <i>Kubernetes documentation</i>.</p>', 'EksContainerDetail$args' => '<p>An array of arguments to the entrypoint. If this isn\\'t specified, the <code>CMD</code> of the container image is used. This corresponds to the <code>args</code> member in the <a href=\"https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#entrypoint\">Entrypoint</a> portion of the <a href=\"https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/\">Pod</a> in Kubernetes. Environment variable references are expanded using the container\\'s environment.</p> <p>If the referenced environment variable doesn\\'t exist, the reference in the command isn\\'t changed. For example, if the reference is to \"<code>$(NAME1)</code>\" and the <code>NAME1</code> environment variable doesn\\'t exist, the command string will remain \"<code>$(NAME1)</code>\". <code>$$</code> is replaced with <code>$</code> and the resulting string isn\\'t expanded. For example, <code>$$(VAR_NAME)</code> is passed as <code>$(VAR_NAME)</code> whether or not the <code>VAR_NAME</code> environment variable exists. For more information, see <a href=\"https://docs.docker.com/engine/reference/builder/#cmd\">CMD</a> in the <i>Dockerfile reference</i> and <a href=\"https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/\">Define a command and arguments for a pod</a> in the <i>Kubernetes documentation</i>.</p>', 'EksContainerOverride$command' => '<p>The command to send to the container that overrides the default command from the Docker image or the job definition.</p>', 'EksContainerOverride$args' => '<p>The arguments to the entrypoint to send to the container that overrides the default arguments from the Docker image or the job definition. For more information, see <a href=\"https://docs.docker.com/engine/reference/builder/#cmd\">CMD</a> in the <i>Dockerfile reference</i> and <a href=\"https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/\">Define a command an arguments for a pod</a> in the <i>Kubernetes documentation</i>.</p>', 'KeyValuesPair$values' => '<p>The filter values.</p>', 'Tmpfs$mountOptions' => '<p>The list of <code>tmpfs</code> volume mount options.</p> <p>Valid values: \"<code>defaults</code>\" | \"<code>ro</code>\" | \"<code>rw</code>\" | \"<code>suid</code>\" | \"<code>nosuid</code>\" | \"<code>dev</code>\" | \"<code>nodev</code>\" | \"<code>exec</code>\" | \"<code>noexec</code>\" | \"<code>sync</code>\" | \"<code>async</code>\" | \"<code>dirsync</code>\" | \"<code>remount</code>\" | \"<code>mand</code>\" | \"<code>nomand</code>\" | \"<code>atime</code>\" | \"<code>noatime</code>\" | \"<code>diratime</code>\" | \"<code>nodiratime</code>\" | \"<code>bind</code>\" | \"<code>rbind\" | \"unbindable\" | \"runbindable\" | \"private\" | \"rprivate\" | \"shared\" | \"rshared\" | \"slave\" | \"rslave\" | \"relatime</code>\" | \"<code>norelatime</code>\" | \"<code>strictatime</code>\" | \"<code>nostrictatime</code>\" | \"<code>mode</code>\" | \"<code>uid</code>\" | \"<code>gid</code>\" | \"<code>nr_inodes</code>\" | \"<code>nr_blocks</code>\" | \"<code>mpol</code>\"</p>', ], ], 'SubmitJobRequest' => [ 'base' => '<p>Contains the parameters for <code>SubmitJob</code>.</p>', 'refs' => [], ], 'SubmitJobResponse' => [ 'base' => NULL, 'refs' => [], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'TagKeysList$member' => NULL, 'TagrisTagsMap$key' => NULL, ], ], 'TagKeysList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$tagKeys' => '<p>The keys of the tags to be removed.</p>', ], ], 'TagResourceRequest' => [ 'base' => '<p>Contains the parameters for <code>TagResource</code>.</p>', 'refs' => [], ], 'TagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'TagrisTagsMap$value' => NULL, ], ], 'TagrisTagsMap' => [ 'base' => NULL, 'refs' => [ 'ComputeEnvironmentDetail$tags' => '<p>The tags applied to the compute environment.</p>', 'CreateComputeEnvironmentRequest$tags' => '<p>The tags that you apply to the compute environment to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html\">Tagging Amazon Web Services Resources</a> in <i>Amazon Web Services General Reference</i>.</p> <p>These tags can be updated or removed using the <a href=\"https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html\">TagResource</a> and <a href=\"https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html\">UntagResource</a> API operations. These tags don\\'t propagate to the underlying compute resources.</p>', 'CreateJobQueueRequest$tags' => '<p>The tags that you apply to the job queue to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html\">Tagging your Batch resources</a> in <i>Batch User Guide</i>.</p>', 'CreateSchedulingPolicyRequest$tags' => '<p>The tags that you apply to the scheduling policy to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html\">Tagging Amazon Web Services Resources</a> in <i>Amazon Web Services General Reference</i>.</p> <p>These tags can be updated or removed using the <a href=\"https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html\">TagResource</a> and <a href=\"https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html\">UntagResource</a> API operations.</p>', 'JobDefinition$tags' => '<p>The tags that are applied to the job definition.</p>', 'JobDetail$tags' => '<p>The tags that are applied to the job.</p>', 'JobQueueDetail$tags' => '<p>The tags that are applied to the job queue. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html\">Tagging your Batch resources</a> in <i>Batch User Guide</i>.</p>', 'ListTagsForResourceResponse$tags' => '<p>The tags for the resource.</p>', 'RegisterJobDefinitionRequest$tags' => '<p>The tags that you apply to the job definition to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html\">Tagging Amazon Web Services Resources</a> in <i>Batch User Guide</i>.</p>', 'SchedulingPolicyDetail$tags' => '<p>The tags that you apply to the scheduling policy to categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html\">Tagging Amazon Web Services resources</a> in <i>Amazon Web Services General Reference</i>.</p>', 'SubmitJobRequest$tags' => '<p>The tags that you apply to the job request to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html\">Tagging Amazon Web Services Resources</a> in <i>Amazon Web Services General Reference</i>.</p>', 'TagResourceRequest$tags' => '<p>The tags that you apply to the resource to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html\">Tagging Amazon Web Services Resources</a> in <i>Amazon Web Services General Reference</i>.</p>', ], ], 'TagsMap' => [ 'base' => NULL, 'refs' => [ 'ComputeResource$tags' => '<p>Key-value pair tags to be applied to EC2 resources that are launched in the compute environment. For Batch, these take the form of <code>\"String1\": \"String2\"</code>, where <code>String1</code> is the tag key and <code>String2</code> is the tag value-for example, <code>{ \"Name\": \"Batch Instance - C4OnDemand\" }</code>. This is helpful for recognizing your Batch instances in the Amazon EC2 console. Updating these tags requires an infrastructure update to the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>. These tags aren\\'t seen when using the Batch <code>ListTagsForResource</code> API operation.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', 'ComputeResourceUpdate$tags' => '<p>Key-value pair tags to be applied to EC2 resources that are launched in the compute environment. For Batch, these take the form of <code>\"String1\": \"String2\"</code>, where <code>String1</code> is the tag key and <code>String2</code> is the tag value-for example, <code>{ \"Name\": \"Batch Instance - C4OnDemand\" }</code>. This is helpful for recognizing your Batch instances in the Amazon EC2 console. These tags aren\\'t seen when using the Batch <code>ListTagsForResource</code> API operation.</p> <p>When updating a compute environment, changing this setting requires an infrastructure update of the compute environment. For more information, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t specify it.</p> </note>', ], ], 'TerminateJobRequest' => [ 'base' => '<p>Contains the parameters for <code>TerminateJob</code>.</p>', 'refs' => [], ], 'TerminateJobResponse' => [ 'base' => NULL, 'refs' => [], ], 'Tmpfs' => [ 'base' => '<p>The container path, mount options, and size of the <code>tmpfs</code> mount.</p> <note> <p>This object isn\\'t applicable to jobs that are running on Fargate resources.</p> </note>', 'refs' => [ 'TmpfsList$member' => NULL, ], ], 'TmpfsList' => [ 'base' => NULL, 'refs' => [ 'LinuxParameters$tmpfs' => '<p>The container path, mount options, and size (in MiB) of the <code>tmpfs</code> mount. This parameter maps to the <code>--tmpfs</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources. Don\\'t provide this parameter for this resource type.</p> </note>', ], ], 'Ulimit' => [ 'base' => '<p>The <code>ulimit</code> settings to pass to the container.</p> <note> <p>This object isn\\'t applicable to jobs that are running on Fargate resources.</p> </note>', 'refs' => [ 'Ulimits$member' => NULL, ], ], 'Ulimits' => [ 'base' => NULL, 'refs' => [ 'ContainerDetail$ulimits' => '<p>A list of <code>ulimit</code> values to set in the container. This parameter maps to <code>Ulimits</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--ulimit</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources.</p> </note>', 'ContainerProperties$ulimits' => '<p>A list of <code>ulimits</code> to set in the container. This parameter maps to <code>Ulimits</code> in the <a href=\"https://docs.docker.com/engine/api/v1.23/#create-a-container\">Create a container</a> section of the <a href=\"https://docs.docker.com/engine/api/v1.23/\">Docker Remote API</a> and the <code>--ulimit</code> option to <a href=\"https://docs.docker.com/engine/reference/run/\">docker run</a>.</p> <note> <p>This parameter isn\\'t applicable to jobs that are running on Fargate resources and shouldn\\'t be provided.</p> </note>', ], ], 'UntagResourceRequest' => [ 'base' => '<p>Contains the parameters for <code>UntagResource</code>.</p>', 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateComputeEnvironmentRequest' => [ 'base' => '<p>Contains the parameters for <code>UpdateComputeEnvironment</code>.</p>', 'refs' => [], ], 'UpdateComputeEnvironmentResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateJobQueueRequest' => [ 'base' => '<p>Contains the parameters for <code>UpdateJobQueue</code>.</p>', 'refs' => [], ], 'UpdateJobQueueResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdatePolicy' => [ 'base' => '<p>Specifies the infrastructure update policy for the compute environment. For more information about infrastructure updates, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p>', 'refs' => [ 'ComputeEnvironmentDetail$updatePolicy' => '<p>Specifies the infrastructure update policy for the compute environment. For more information about infrastructure updates, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p>', 'UpdateComputeEnvironmentRequest$updatePolicy' => '<p>Specifies the updated infrastructure update policy for the compute environment. For more information about infrastructure updates, see <a href=\"https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html\">Updating compute environments</a> in the <i>Batch User Guide</i>.</p>', ], ], 'UpdateSchedulingPolicyRequest' => [ 'base' => '<p>Contains the parameters for <code>UpdateSchedulingPolicy</code>.</p>', 'refs' => [], ], 'UpdateSchedulingPolicyResponse' => [ 'base' => NULL, 'refs' => [], ], 'Volume' => [ 'base' => '<p>A data volume that\\'s used in a job\\'s container properties.</p>', 'refs' => [ 'Volumes$member' => NULL, ], ], 'Volumes' => [ 'base' => NULL, 'refs' => [ 'ContainerDetail$volumes' => '<p>A list of volumes that are associated with the job.</p>', 'ContainerProperties$volumes' => '<p>A list of data volumes used in a job.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/batch/2016-08-10/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://batch-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ 'aws', [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], ], ], ], 'endpoint' => [ 'url' => 'https://fips.batch.{Region}.amazonaws.com', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ 'aws-us-gov', [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], ], ], ], 'endpoint' => [ 'url' => 'https://batch.{Region}.amazonaws.com', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://batch-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://batch.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://batch.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/batch/2016-08-10/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.af-south-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'af-south-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.ap-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-east-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-northeast-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-northeast-2', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-northeast-3', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.ap-south-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-south-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-southeast-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-southeast-2', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ap-southeast-3', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.ca-central-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'ca-central-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.eu-central-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'eu-central-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.eu-north-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'eu-north-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.eu-south-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'eu-south-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.eu-west-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'eu-west-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.eu-west-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'eu-west-2', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.eu-west-3.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'eu-west-3', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.me-south-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'me-south-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.sa-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'sa-east-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-east-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://fips.batch.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-east-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-east-2', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://fips.batch.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-east-2', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.us-west-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-west-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://fips.batch.us-west-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-west-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-west-2', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://fips.batch.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-west-2', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch-fips.us-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-east-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.us-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-east-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'cn-north-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'cn-northwest-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'cn-north-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'cn-north-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'cn-north-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-gov-east-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-gov-east-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-gov-west-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-gov-west-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-gov-east-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-gov-east-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-iso-east-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-iso-east-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-iso-east-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-iso-east-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-isob-east-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-isob-east-1', 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-isob-east-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://batch.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-isob-east-1', 'UseFIPS' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-east-1', 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'UseDualStack' => false, 'Region' => 'us-east-1', 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'UseDualStack' => true, 'Region' => 'us-east-1', 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/batch/2016-08-10/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [ 'CancelJob' => [ [ 'input' => [ 'jobId' => '1d828f65-7a4d-42e8-996d-3b900ed59dc4', 'reason' => 'Cancelling job.', ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example cancels a job with the specified job ID.', 'id' => 'to-cancel-a-job-1481152314733', 'title' => 'To cancel a job', ], ], 'CreateComputeEnvironment' => [ [ 'input' => [ 'type' => 'MANAGED', 'computeEnvironmentName' => 'C4OnDemand', 'computeResources' => [ 'type' => 'EC2', 'desiredvCpus' => 48, 'ec2KeyPair' => 'id_rsa', 'instanceRole' => 'ecsInstanceRole', 'instanceTypes' => [ 'c4.large', 'c4.xlarge', 'c4.2xlarge', 'c4.4xlarge', 'c4.8xlarge', ], 'maxvCpus' => 128, 'minvCpus' => 0, 'securityGroupIds' => [ 'sg-cf5093b2', ], 'subnets' => [ 'subnet-220c0e0a', 'subnet-1a95556d', 'subnet-978f6dce', ], 'tags' => [ 'Name' => 'Batch Instance - C4OnDemand', ], ], 'serviceRole' => 'arn:aws:iam::012345678910:role/AWSBatchServiceRole', 'state' => 'ENABLED', ], 'output' => [ 'computeEnvironmentArn' => 'arn:aws:batch:us-east-1:012345678910:compute-environment/C4OnDemand', 'computeEnvironmentName' => 'C4OnDemand', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example creates a managed compute environment with specific C4 instance types that are launched on demand. The compute environment is called C4OnDemand.', 'id' => 'to-create-a-managed-ec2-compute-environment-1481152600017', 'title' => 'To create a managed EC2 compute environment', ], [ 'input' => [ 'type' => 'MANAGED', 'computeEnvironmentName' => 'M4Spot', 'computeResources' => [ 'type' => 'SPOT', 'bidPercentage' => 20, 'desiredvCpus' => 4, 'ec2KeyPair' => 'id_rsa', 'instanceRole' => 'ecsInstanceRole', 'instanceTypes' => [ 'm4', ], 'maxvCpus' => 128, 'minvCpus' => 0, 'securityGroupIds' => [ 'sg-cf5093b2', ], 'spotIamFleetRole' => 'arn:aws:iam::012345678910:role/aws-ec2-spot-fleet-role', 'subnets' => [ 'subnet-220c0e0a', 'subnet-1a95556d', 'subnet-978f6dce', ], 'tags' => [ 'Name' => 'Batch Instance - M4Spot', ], ], 'serviceRole' => 'arn:aws:iam::012345678910:role/AWSBatchServiceRole', 'state' => 'ENABLED', ], 'output' => [ 'computeEnvironmentArn' => 'arn:aws:batch:us-east-1:012345678910:compute-environment/M4Spot', 'computeEnvironmentName' => 'M4Spot', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example creates a managed compute environment with the M4 instance type that is launched when the Spot bid price is at or below 20% of the On-Demand price for the instance type. The compute environment is called M4Spot.', 'id' => 'to-create-a-managed-ec2-spot-compute-environment-1481152844190', 'title' => 'To create a managed EC2 Spot compute environment', ], ], 'CreateJobQueue' => [ [ 'input' => [ 'computeEnvironmentOrder' => [ [ 'computeEnvironment' => 'M4Spot', 'order' => 1, ], ], 'jobQueueName' => 'LowPriority', 'priority' => 1, 'state' => 'ENABLED', ], 'output' => [ 'jobQueueArn' => 'arn:aws:batch:us-east-1:012345678910:job-queue/LowPriority', 'jobQueueName' => 'LowPriority', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example creates a job queue called LowPriority that uses the M4Spot compute environment.', 'id' => 'to-create-a-job-queue-with-a-single-compute-environment-1481152967946', 'title' => 'To create a job queue with a single compute environment', ], [ 'input' => [ 'computeEnvironmentOrder' => [ [ 'computeEnvironment' => 'C4OnDemand', 'order' => 1, ], [ 'computeEnvironment' => 'M4Spot', 'order' => 2, ], ], 'jobQueueName' => 'HighPriority', 'priority' => 10, 'state' => 'ENABLED', ], 'output' => [ 'jobQueueArn' => 'arn:aws:batch:us-east-1:012345678910:job-queue/HighPriority', 'jobQueueName' => 'HighPriority', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example creates a job queue called HighPriority that uses the C4OnDemand compute environment with an order of 1 and the M4Spot compute environment with an order of 2.', 'id' => 'to-create-a-job-queue-with-multiple-compute-environments-1481153027051', 'title' => 'To create a job queue with multiple compute environments', ], ], 'DeleteComputeEnvironment' => [ [ 'input' => [ 'computeEnvironment' => 'P2OnDemand', ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example deletes the P2OnDemand compute environment.', 'id' => 'to-delete-a-compute-environment-1481153105644', 'title' => 'To delete a compute environment', ], ], 'DeleteJobQueue' => [ [ 'input' => [ 'jobQueue' => 'GPGPU', ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example deletes the GPGPU job queue.', 'id' => 'to-delete-a-job-queue-1481153508134', 'title' => 'To delete a job queue', ], ], 'DeregisterJobDefinition' => [ [ 'input' => [ 'jobDefinition' => 'sleep10', ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example deregisters a job definition called sleep10.', 'id' => 'to-deregister-a-job-definition-1481153579565', 'title' => 'To deregister a job definition', ], ], 'DescribeComputeEnvironments' => [ [ 'input' => [ 'computeEnvironments' => [ 'P2OnDemand', ], ], 'output' => [ 'computeEnvironments' => [ [ 'type' => 'MANAGED', 'computeEnvironmentArn' => 'arn:aws:batch:us-east-1:012345678910:compute-environment/P2OnDemand', 'computeEnvironmentName' => 'P2OnDemand', 'computeResources' => [ 'type' => 'EC2', 'desiredvCpus' => 48, 'ec2KeyPair' => 'id_rsa', 'instanceRole' => 'ecsInstanceRole', 'instanceTypes' => [ 'p2', ], 'maxvCpus' => 128, 'minvCpus' => 0, 'securityGroupIds' => [ 'sg-cf5093b2', ], 'subnets' => [ 'subnet-220c0e0a', 'subnet-1a95556d', 'subnet-978f6dce', ], 'tags' => [ 'Name' => 'Batch Instance - P2OnDemand', ], ], 'ecsClusterArn' => 'arn:aws:ecs:us-east-1:012345678910:cluster/P2OnDemand_Batch_2c06f29d-d1fe-3a49-879d-42394c86effc', 'serviceRole' => 'arn:aws:iam::012345678910:role/AWSBatchServiceRole', 'state' => 'ENABLED', 'status' => 'VALID', 'statusReason' => 'ComputeEnvironment Healthy', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the P2OnDemand compute environment.', 'id' => 'to-describe-a-compute-environment-1481153713334', 'title' => 'To describe a compute environment', ], ], 'DescribeJobDefinitions' => [ [ 'input' => [ 'status' => 'ACTIVE', ], 'output' => [ 'jobDefinitions' => [ [ 'type' => 'container', 'containerProperties' => [ 'command' => [ 'sleep', '60', ], 'environment' => [], 'image' => 'busybox', 'mountPoints' => [], 'resourceRequirements' => [ [ 'type' => 'MEMORY', 'value' => '128', ], [ 'type' => 'VCPU', 'value' => '1', ], ], 'ulimits' => [], 'volumes' => [], ], 'jobDefinitionArn' => 'arn:aws:batch:us-east-1:012345678910:job-definition/sleep60:1', 'jobDefinitionName' => 'sleep60', 'revision' => 1, 'status' => 'ACTIVE', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes all of your active job definitions.', 'id' => 'to-describe-active-job-definitions-1481153895831', 'title' => 'To describe active job definitions', ], ], 'DescribeJobQueues' => [ [ 'input' => [ 'jobQueues' => [ 'HighPriority', ], ], 'output' => [ 'jobQueues' => [ [ 'computeEnvironmentOrder' => [ [ 'computeEnvironment' => 'arn:aws:batch:us-east-1:012345678910:compute-environment/C4OnDemand', 'order' => 1, ], ], 'jobQueueArn' => 'arn:aws:batch:us-east-1:012345678910:job-queue/HighPriority', 'jobQueueName' => 'HighPriority', 'priority' => 1, 'state' => 'ENABLED', 'status' => 'VALID', 'statusReason' => 'JobQueue Healthy', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes the HighPriority job queue.', 'id' => 'to-describe-a-job-queue-1481153995804', 'title' => 'To describe a job queue', ], ], 'DescribeJobs' => [ [ 'input' => [ 'jobs' => [ '24fa2d7a-64c4-49d2-8b47-f8da4fbde8e9', ], ], 'output' => [ 'jobs' => [ [ 'container' => [ 'command' => [ 'sleep', '60', ], 'containerInstanceArn' => 'arn:aws:ecs:us-east-1:012345678910:container-instance/5406d7cd-58bd-4b8f-9936-48d7c6b1526c', 'environment' => [], 'exitCode' => 0, 'image' => 'busybox', 'memory' => 128, 'mountPoints' => [], 'ulimits' => [], 'vcpus' => 1, 'volumes' => [], ], 'createdAt' => 1480460782010, 'dependsOn' => [], 'jobDefinition' => 'sleep60', 'jobId' => '24fa2d7a-64c4-49d2-8b47-f8da4fbde8e9', 'jobName' => 'example', 'jobQueue' => 'arn:aws:batch:us-east-1:012345678910:job-queue/HighPriority', 'parameters' => [], 'startedAt' => 1480460816500, 'status' => 'SUCCEEDED', 'stoppedAt' => 1480460880699, ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example describes a job with the specified job ID.', 'id' => 'to-describe-a-specific-job-1481154090490', 'title' => 'To describe a specific job', ], ], 'ListJobs' => [ [ 'input' => [ 'jobQueue' => 'HighPriority', ], 'output' => [ 'jobSummaryList' => [ [ 'jobId' => 'e66ff5fd-a1ff-4640-b1a2-0b0a142f49bb', 'jobName' => 'example', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example lists the running jobs in the HighPriority job queue.', 'id' => 'to-list-running-jobs-1481154202164', 'title' => 'To list running jobs', ], [ 'input' => [ 'jobQueue' => 'HighPriority', 'jobStatus' => 'SUBMITTED', ], 'output' => [ 'jobSummaryList' => [ [ 'jobId' => '68f0c163-fbd4-44e6-9fd1-25b14a434786', 'jobName' => 'example', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example lists jobs in the HighPriority job queue that are in the SUBMITTED job status.', 'id' => 'to-list-submitted-jobs-1481154251623', 'title' => 'To list submitted jobs', ], ], 'ListTagsForResource' => [ [ 'input' => [ 'resourceArn' => 'arn:aws:batch:us-east-1:123456789012:job-definition/sleep30:1', ], 'output' => [ 'tags' => [ 'Department' => 'Engineering', 'Stage' => 'Alpha', 'User' => 'JaneDoe', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This demonstrates calling the ListTagsForResource action.', 'id' => 'listtagsforresource-example-1591293003710', 'title' => 'ListTagsForResource Example', ], ], 'RegisterJobDefinition' => [ [ 'input' => [ 'type' => 'container', 'containerProperties' => [ 'command' => [ 'sleep', '10', ], 'image' => 'busybox', 'resourceRequirements' => [ [ 'type' => 'MEMORY', 'value' => '128', ], [ 'type' => 'VCPU', 'value' => '1', ], ], ], 'jobDefinitionName' => 'sleep10', ], 'output' => [ 'jobDefinitionArn' => 'arn:aws:batch:us-east-1:012345678910:job-definition/sleep10:1', 'jobDefinitionName' => 'sleep10', 'revision' => 1, ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example registers a job definition for a simple container job.', 'id' => 'to-register-a-job-definition-1481154325325', 'title' => 'To register a job definition', ], [ 'input' => [ 'type' => 'container', 'containerProperties' => [ 'command' => [ 'sleep', '30', ], 'image' => 'busybox', 'resourceRequirements' => [ [ 'type' => 'MEMORY', 'value' => '128', ], [ 'type' => 'VCPU', 'value' => '1', ], ], ], 'jobDefinitionName' => 'sleep30', 'tags' => [ 'Department' => 'Engineering', 'User' => 'JaneDoe', ], ], 'output' => [ 'jobDefinitionArn' => 'arn:aws:batch:us-east-1:012345678910:job-definition/sleep30:1', 'jobDefinitionName' => 'sleep30', 'revision' => 1, ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This demonstrates calling the RegisterJobDefinition action, including tags.', 'id' => 'registerjobdefinition-with-tags-1591290509028', 'title' => 'RegisterJobDefinition with tags', ], ], 'SubmitJob' => [ [ 'input' => [ 'jobDefinition' => 'sleep60', 'jobName' => 'example', 'jobQueue' => 'HighPriority', ], 'output' => [ 'jobId' => '876da822-4198-45f2-a252-6cea32512ea8', 'jobName' => 'example', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example submits a simple container job called example to the HighPriority job queue.', 'id' => 'to-submit-a-job-to-a-queue-1481154481673', 'title' => 'To submit a job to a queue', ], ], 'TagResource' => [ [ 'input' => [ 'resourceArn' => 'arn:aws:batch:us-east-1:123456789012:job-definition/sleep30:1', 'tags' => [ 'Stage' => 'Alpha', ], ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This demonstrates calling the TagResource action.', 'id' => 'tagresource-example-1591291959952', 'title' => 'TagResource Example', ], ], 'TerminateJob' => [ [ 'input' => [ 'jobId' => '61e743ed-35e4-48da-b2de-5c8333821c84', 'reason' => 'Terminating job.', ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example terminates a job with the specified job ID.', 'id' => 'to-terminate-a-job-1481154558276', 'title' => 'To terminate a job', ], ], 'UntagResource' => [ [ 'input' => [ 'resourceArn' => 'arn:aws:batch:us-east-1:123456789012:job-definition/sleep30:1', 'tagKeys' => [ 'Stage', ], ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This demonstrates calling the UntagResource action.', 'id' => 'untagresource-example-1591292811042', 'title' => 'UntagResource Example', ], ], 'UpdateComputeEnvironment' => [ [ 'input' => [ 'computeEnvironment' => 'P2OnDemand', 'state' => 'DISABLED', ], 'output' => [ 'computeEnvironmentArn' => 'arn:aws:batch:us-east-1:012345678910:compute-environment/P2OnDemand', 'computeEnvironmentName' => 'P2OnDemand', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example disables the P2OnDemand compute environment so it can be deleted.', 'id' => 'to-update-a-compute-environment-1481154702731', 'title' => 'To update a compute environment', ], ], 'UpdateJobQueue' => [ [ 'input' => [ 'jobQueue' => 'GPGPU', 'state' => 'DISABLED', ], 'output' => [ 'jobQueueArn' => 'arn:aws:batch:us-east-1:012345678910:job-queue/GPGPU', 'jobQueueName' => 'GPGPU', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'This example disables a job queue so that it can be deleted.', 'id' => 'to-update-a-job-queue-1481154806981', 'title' => 'To update a job queue', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/batch/2016-08-10/paginators-1.json\nreturn [ 'pagination' => [ 'DescribeComputeEnvironments' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'computeEnvironments', ], 'DescribeJobDefinitions' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'jobDefinitions', ], 'DescribeJobQueues' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'jobQueues', ], 'ListJobs' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'jobSummaryList', ], 'ListSchedulingPolicies' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'schedulingPolicies', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/batch/2016-08-10/smoke.json\nreturn [ 'version' => 1, 'defaultRegion' => 'us-west-2', 'testCases' => [ [ 'operationName' => 'DescribeComputeEnvironments', 'input' => [], 'errorExpectedFromService' => false, ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/billingconductor/2021-07-30/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2021-07-30', 'endpointPrefix' => 'billingconductor', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'AWSBillingConductor', 'serviceId' => 'billingconductor', 'signatureVersion' => 'v4', 'signingName' => 'billingconductor', 'uid' => 'billingconductor-2021-07-30', ], 'operations' => [ 'AssociateAccounts' => [ 'name' => 'AssociateAccounts', 'http' => [ 'method' => 'POST', 'requestUri' => '/associate-accounts', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AssociateAccountsInput', ], 'output' => [ 'shape' => 'AssociateAccountsOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ServiceLimitExceededException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'AssociatePricingRules' => [ 'name' => 'AssociatePricingRules', 'http' => [ 'method' => 'PUT', 'requestUri' => '/associate-pricing-rules', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AssociatePricingRulesInput', ], 'output' => [ 'shape' => 'AssociatePricingRulesOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ServiceLimitExceededException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'BatchAssociateResourcesToCustomLineItem' => [ 'name' => 'BatchAssociateResourcesToCustomLineItem', 'http' => [ 'method' => 'PUT', 'requestUri' => '/batch-associate-resources-to-custom-line-item', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchAssociateResourcesToCustomLineItemInput', ], 'output' => [ 'shape' => 'BatchAssociateResourcesToCustomLineItemOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ServiceLimitExceededException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'BatchDisassociateResourcesFromCustomLineItem' => [ 'name' => 'BatchDisassociateResourcesFromCustomLineItem', 'http' => [ 'method' => 'PUT', 'requestUri' => '/batch-disassociate-resources-from-custom-line-item', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchDisassociateResourcesFromCustomLineItemInput', ], 'output' => [ 'shape' => 'BatchDisassociateResourcesFromCustomLineItemOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'CreateBillingGroup' => [ 'name' => 'CreateBillingGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/create-billing-group', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateBillingGroupInput', ], 'output' => [ 'shape' => 'CreateBillingGroupOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ServiceLimitExceededException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'CreateCustomLineItem' => [ 'name' => 'CreateCustomLineItem', 'http' => [ 'method' => 'POST', 'requestUri' => '/create-custom-line-item', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateCustomLineItemInput', ], 'output' => [ 'shape' => 'CreateCustomLineItemOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ServiceLimitExceededException', ], [ 'shape' => 'InternalServerException', ], ], ], 'CreatePricingPlan' => [ 'name' => 'CreatePricingPlan', 'http' => [ 'method' => 'POST', 'requestUri' => '/create-pricing-plan', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreatePricingPlanInput', ], 'output' => [ 'shape' => 'CreatePricingPlanOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ServiceLimitExceededException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'CreatePricingRule' => [ 'name' => 'CreatePricingRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/create-pricing-rule', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreatePricingRuleInput', ], 'output' => [ 'shape' => 'CreatePricingRuleOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ServiceLimitExceededException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'DeleteBillingGroup' => [ 'name' => 'DeleteBillingGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/delete-billing-group', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteBillingGroupInput', ], 'output' => [ 'shape' => 'DeleteBillingGroupOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'DeleteCustomLineItem' => [ 'name' => 'DeleteCustomLineItem', 'http' => [ 'method' => 'POST', 'requestUri' => '/delete-custom-line-item', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteCustomLineItemInput', ], 'output' => [ 'shape' => 'DeleteCustomLineItemOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'DeletePricingPlan' => [ 'name' => 'DeletePricingPlan', 'http' => [ 'method' => 'POST', 'requestUri' => '/delete-pricing-plan', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeletePricingPlanInput', ], 'output' => [ 'shape' => 'DeletePricingPlanOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'DeletePricingRule' => [ 'name' => 'DeletePricingRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/delete-pricing-rule', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeletePricingRuleInput', ], 'output' => [ 'shape' => 'DeletePricingRuleOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], 'idempotent' => true, ], 'DisassociateAccounts' => [ 'name' => 'DisassociateAccounts', 'http' => [ 'method' => 'POST', 'requestUri' => '/disassociate-accounts', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DisassociateAccountsInput', ], 'output' => [ 'shape' => 'DisassociateAccountsOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'DisassociatePricingRules' => [ 'name' => 'DisassociatePricingRules', 'http' => [ 'method' => 'PUT', 'requestUri' => '/disassociate-pricing-rules', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DisassociatePricingRulesInput', ], 'output' => [ 'shape' => 'DisassociatePricingRulesOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'ListAccountAssociations' => [ 'name' => 'ListAccountAssociations', 'http' => [ 'method' => 'POST', 'requestUri' => '/list-account-associations', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAccountAssociationsInput', ], 'output' => [ 'shape' => 'ListAccountAssociationsOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListBillingGroupCostReports' => [ 'name' => 'ListBillingGroupCostReports', 'http' => [ 'method' => 'POST', 'requestUri' => '/list-billing-group-cost-reports', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListBillingGroupCostReportsInput', ], 'output' => [ 'shape' => 'ListBillingGroupCostReportsOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListBillingGroups' => [ 'name' => 'ListBillingGroups', 'http' => [ 'method' => 'POST', 'requestUri' => '/list-billing-groups', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListBillingGroupsInput', ], 'output' => [ 'shape' => 'ListBillingGroupsOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListCustomLineItemVersions' => [ 'name' => 'ListCustomLineItemVersions', 'http' => [ 'method' => 'POST', 'requestUri' => '/list-custom-line-item-versions', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListCustomLineItemVersionsInput', ], 'output' => [ 'shape' => 'ListCustomLineItemVersionsOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListCustomLineItems' => [ 'name' => 'ListCustomLineItems', 'http' => [ 'method' => 'POST', 'requestUri' => '/list-custom-line-items', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListCustomLineItemsInput', ], 'output' => [ 'shape' => 'ListCustomLineItemsOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListPricingPlans' => [ 'name' => 'ListPricingPlans', 'http' => [ 'method' => 'POST', 'requestUri' => '/list-pricing-plans', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListPricingPlansInput', ], 'output' => [ 'shape' => 'ListPricingPlansOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListPricingPlansAssociatedWithPricingRule' => [ 'name' => 'ListPricingPlansAssociatedWithPricingRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/list-pricing-plans-associated-with-pricing-rule', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListPricingPlansAssociatedWithPricingRuleInput', ], 'output' => [ 'shape' => 'ListPricingPlansAssociatedWithPricingRuleOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListPricingRules' => [ 'name' => 'ListPricingRules', 'http' => [ 'method' => 'POST', 'requestUri' => '/list-pricing-rules', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListPricingRulesInput', ], 'output' => [ 'shape' => 'ListPricingRulesOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], ], ], 'ListPricingRulesAssociatedToPricingPlan' => [ 'name' => 'ListPricingRulesAssociatedToPricingPlan', 'http' => [ 'method' => 'POST', 'requestUri' => '/list-pricing-rules-associated-to-pricing-plan', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListPricingRulesAssociatedToPricingPlanInput', ], 'output' => [ 'shape' => 'ListPricingRulesAssociatedToPricingPlanOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListResourcesAssociatedToCustomLineItem' => [ 'name' => 'ListResourcesAssociatedToCustomLineItem', 'http' => [ 'method' => 'POST', 'requestUri' => '/list-resources-associated-to-custom-line-item', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListResourcesAssociatedToCustomLineItemInput', ], 'output' => [ 'shape' => 'ListResourcesAssociatedToCustomLineItemOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags/{ResourceArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags/{ResourceArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/tags/{ResourceArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UpdateBillingGroup' => [ 'name' => 'UpdateBillingGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/update-billing-group', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateBillingGroupInput', ], 'output' => [ 'shape' => 'UpdateBillingGroupOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'UpdateCustomLineItem' => [ 'name' => 'UpdateCustomLineItem', 'http' => [ 'method' => 'POST', 'requestUri' => '/update-custom-line-item', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateCustomLineItemInput', ], 'output' => [ 'shape' => 'UpdateCustomLineItemOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'UpdatePricingPlan' => [ 'name' => 'UpdatePricingPlan', 'http' => [ 'method' => 'PUT', 'requestUri' => '/update-pricing-plan', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdatePricingPlanInput', ], 'output' => [ 'shape' => 'UpdatePricingPlanOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], 'UpdatePricingRule' => [ 'name' => 'UpdatePricingRule', 'http' => [ 'method' => 'PUT', 'requestUri' => '/update-pricing-rule', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdatePricingRuleInput', ], 'output' => [ 'shape' => 'UpdatePricingRuleOutput', ], 'errors' => [ [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ResourceNotFoundException', ], ], 'idempotent' => true, ], ], 'shapes' => [ 'AWSCost' => [ 'type' => 'string', ], 'AccessDeniedException' => [ 'type' => 'structure', 'required' => [ 'Message', ], 'members' => [ 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 403, 'senderFault' => true, ], 'exception' => true, ], 'AccountAssociationsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AccountAssociationsListElement', ], ], 'AccountAssociationsListElement' => [ 'type' => 'structure', 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BillingGroupArn' => [ 'shape' => 'BillingGroupArn', ], 'AccountName' => [ 'shape' => 'AccountName', ], 'AccountEmail' => [ 'shape' => 'AccountEmail', ], ], ], 'AccountEmail' => [ 'type' => 'string', 'sensitive' => true, ], 'AccountGrouping' => [ 'type' => 'structure', 'required' => [ 'LinkedAccountIds', ], 'members' => [ 'LinkedAccountIds' => [ 'shape' => 'AccountIdList', ], ], ], 'AccountId' => [ 'type' => 'string', 'pattern' => '[0-9]{12}', ], 'AccountIdFilterList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AccountId', ], 'max' => 30, 'min' => 1, ], 'AccountIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AccountId', ], 'max' => 30, 'min' => 1, ], 'AccountName' => [ 'type' => 'string', 'sensitive' => true, ], 'Arn' => [ 'type' => 'string', 'max' => 100, 'min' => 0, 'pattern' => 'arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/?[0-9]{12}$|^arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingplan/[a-zA-Z0-9]{10}$|^arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingrule/[a-zA-Z0-9]{10}$|^(arn:aws(-cn)?:billingconductor::[0-9]{12}:customlineitem/)?[a-zA-Z0-9]{10}', ], 'AssociateAccountsInput' => [ 'type' => 'structure', 'required' => [ 'Arn', 'AccountIds', ], 'members' => [ 'Arn' => [ 'shape' => 'BillingGroupArn', ], 'AccountIds' => [ 'shape' => 'AccountIdList', ], ], ], 'AssociateAccountsOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'BillingGroupArn', ], ], ], 'AssociatePricingRulesInput' => [ 'type' => 'structure', 'required' => [ 'Arn', 'PricingRuleArns', ], 'members' => [ 'Arn' => [ 'shape' => 'PricingPlanArn', ], 'PricingRuleArns' => [ 'shape' => 'PricingRuleArnsNonEmptyInput', ], ], ], 'AssociatePricingRulesOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'PricingPlanArn', ], ], ], 'AssociateResourceError' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'String', ], 'Reason' => [ 'shape' => 'AssociateResourceErrorReason', ], ], ], 'AssociateResourceErrorReason' => [ 'type' => 'string', 'enum' => [ 'INVALID_ARN', 'SERVICE_LIMIT_EXCEEDED', 'ILLEGAL_CUSTOMLINEITEM', 'INTERNAL_SERVER_EXCEPTION', 'INVALID_BILLING_PERIOD_RANGE', ], ], 'AssociateResourceResponseElement' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'CustomLineItemAssociationElement', ], 'Error' => [ 'shape' => 'AssociateResourceError', ], ], ], 'AssociateResourcesResponseList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AssociateResourceResponseElement', ], ], 'Association' => [ 'type' => 'string', 'pattern' => '((arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/)?[0-9]{12}|MONITORED|UNMONITORED)', ], 'BatchAssociateResourcesToCustomLineItemInput' => [ 'type' => 'structure', 'required' => [ 'TargetArn', 'ResourceArns', ], 'members' => [ 'TargetArn' => [ 'shape' => 'CustomLineItemArn', ], 'ResourceArns' => [ 'shape' => 'CustomLineItemBatchAssociationsList', ], 'BillingPeriodRange' => [ 'shape' => 'CustomLineItemBillingPeriodRange', ], ], ], 'BatchAssociateResourcesToCustomLineItemOutput' => [ 'type' => 'structure', 'members' => [ 'SuccessfullyAssociatedResources' => [ 'shape' => 'AssociateResourcesResponseList', ], 'FailedAssociatedResources' => [ 'shape' => 'AssociateResourcesResponseList', ], ], ], 'BatchDisassociateResourcesFromCustomLineItemInput' => [ 'type' => 'structure', 'required' => [ 'TargetArn', 'ResourceArns', ], 'members' => [ 'TargetArn' => [ 'shape' => 'CustomLineItemArn', ], 'ResourceArns' => [ 'shape' => 'CustomLineItemBatchDisassociationsList', ], 'BillingPeriodRange' => [ 'shape' => 'CustomLineItemBillingPeriodRange', ], ], ], 'BatchDisassociateResourcesFromCustomLineItemOutput' => [ 'type' => 'structure', 'members' => [ 'SuccessfullyDisassociatedResources' => [ 'shape' => 'DisassociateResourcesResponseList', ], 'FailedDisassociatedResources' => [ 'shape' => 'DisassociateResourcesResponseList', ], ], ], 'BillingEntity' => [ 'type' => 'string', 'pattern' => '[a-zA-Z0-9 ]+', ], 'BillingGroupArn' => [ 'type' => 'string', 'pattern' => '(arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/)?[0-9]{12}', ], 'BillingGroupArnList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BillingGroupArn', ], 'max' => 100, 'min' => 1, ], 'BillingGroupCostReportElement' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'BillingGroupArn', ], 'AWSCost' => [ 'shape' => 'AWSCost', ], 'ProformaCost' => [ 'shape' => 'ProformaCost', ], 'Margin' => [ 'shape' => 'Margin', ], 'MarginPercentage' => [ 'shape' => 'MarginPercentage', ], 'Currency' => [ 'shape' => 'Currency', ], ], ], 'BillingGroupCostReportList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BillingGroupCostReportElement', ], ], 'BillingGroupDescription' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'sensitive' => true, ], 'BillingGroupFullArn' => [ 'type' => 'string', 'pattern' => 'arn:aws(-cn)?:billingconductor::[0-9]{12}:billinggroup/[0-9]{12}', ], 'BillingGroupList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BillingGroupListElement', ], ], 'BillingGroupListElement' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'BillingGroupName', ], 'Arn' => [ 'shape' => 'BillingGroupArn', ], 'Description' => [ 'shape' => 'BillingGroupDescription', ], 'PrimaryAccountId' => [ 'shape' => 'AccountId', ], 'ComputationPreference' => [ 'shape' => 'ComputationPreference', ], 'Size' => [ 'shape' => 'NumberOfAccounts', ], 'CreationTime' => [ 'shape' => 'Instant', ], 'LastModifiedTime' => [ 'shape' => 'Instant', ], 'Status' => [ 'shape' => 'BillingGroupStatus', ], 'StatusReason' => [ 'shape' => 'BillingGroupStatusReason', ], ], ], 'BillingGroupName' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[a-zA-Z0-9_\\\\+=\\\\.\\\\-@]+', 'sensitive' => true, ], 'BillingGroupStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'PRIMARY_ACCOUNT_MISSING', ], ], 'BillingGroupStatusList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BillingGroupStatus', ], 'max' => 2, 'min' => 1, ], 'BillingGroupStatusReason' => [ 'type' => 'string', ], 'BillingPeriod' => [ 'type' => 'string', 'pattern' => '\\\\d{4}-(0?[1-9]|1[012])', ], 'ClientToken' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '[a-zA-Z0-9-]+', ], 'ComputationPreference' => [ 'type' => 'structure', 'required' => [ 'PricingPlanArn', ], 'members' => [ 'PricingPlanArn' => [ 'shape' => 'PricingPlanFullArn', ], ], ], 'ConflictException' => [ 'type' => 'structure', 'required' => [ 'Message', 'ResourceId', 'ResourceType', ], 'members' => [ 'Message' => [ 'shape' => 'String', ], 'ResourceId' => [ 'shape' => 'String', ], 'ResourceType' => [ 'shape' => 'String', ], 'Reason' => [ 'shape' => 'ConflictExceptionReason', ], ], 'error' => [ 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'ConflictExceptionReason' => [ 'type' => 'string', 'enum' => [ 'RESOURCE_NAME_CONFLICT', 'PRICING_RULE_IN_PRICING_PLAN_CONFLICT', 'PRICING_PLAN_ATTACHED_TO_BILLING_GROUP_DELETE_CONFLICT', 'PRICING_RULE_ATTACHED_TO_PRICING_PLAN_DELETE_CONFLICT', 'WRITE_CONFLICT_RETRY', ], ], 'CreateBillingGroupInput' => [ 'type' => 'structure', 'required' => [ 'Name', 'AccountGrouping', 'ComputationPreference', ], 'members' => [ 'ClientToken' => [ 'shape' => 'ClientToken', 'idempotencyToken' => true, 'location' => 'header', 'locationName' => 'X-Amzn-Client-Token', ], 'Name' => [ 'shape' => 'BillingGroupName', ], 'AccountGrouping' => [ 'shape' => 'AccountGrouping', ], 'ComputationPreference' => [ 'shape' => 'ComputationPreference', ], 'PrimaryAccountId' => [ 'shape' => 'AccountId', ], 'Description' => [ 'shape' => 'BillingGroupDescription', ], 'Tags' => [ 'shape' => 'TagMap', ], ], ], 'CreateBillingGroupOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'BillingGroupArn', ], ], ], 'CreateCustomLineItemInput' => [ 'type' => 'structure', 'required' => [ 'Name', 'Description', 'BillingGroupArn', 'ChargeDetails', ], 'members' => [ 'ClientToken' => [ 'shape' => 'ClientToken', 'idempotencyToken' => true, 'location' => 'header', 'locationName' => 'X-Amzn-Client-Token', ], 'Name' => [ 'shape' => 'CustomLineItemName', ], 'Description' => [ 'shape' => 'CustomLineItemDescription', ], 'BillingGroupArn' => [ 'shape' => 'BillingGroupArn', ], 'BillingPeriodRange' => [ 'shape' => 'CustomLineItemBillingPeriodRange', ], 'Tags' => [ 'shape' => 'TagMap', ], 'ChargeDetails' => [ 'shape' => 'CustomLineItemChargeDetails', ], ], ], 'CreateCustomLineItemOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'CustomLineItemArn', ], ], ], 'CreateFreeTierConfig' => [ 'type' => 'structure', 'required' => [ 'Activated', ], 'members' => [ 'Activated' => [ 'shape' => 'TieringActivated', ], ], ], 'CreatePricingPlanInput' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'ClientToken' => [ 'shape' => 'ClientToken', 'idempotencyToken' => true, 'location' => 'header', 'locationName' => 'X-Amzn-Client-Token', ], 'Name' => [ 'shape' => 'PricingPlanName', ], 'Description' => [ 'shape' => 'PricingPlanDescription', ], 'PricingRuleArns' => [ 'shape' => 'PricingRuleArnsInput', ], 'Tags' => [ 'shape' => 'TagMap', ], ], ], 'CreatePricingPlanOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'PricingPlanArn', ], ], ], 'CreatePricingRuleInput' => [ 'type' => 'structure', 'required' => [ 'Name', 'Scope', 'Type', ], 'members' => [ 'ClientToken' => [ 'shape' => 'ClientToken', 'idempotencyToken' => true, 'location' => 'header', 'locationName' => 'X-Amzn-Client-Token', ], 'Name' => [ 'shape' => 'PricingRuleName', ], 'Description' => [ 'shape' => 'PricingRuleDescription', ], 'Scope' => [ 'shape' => 'PricingRuleScope', ], 'Type' => [ 'shape' => 'PricingRuleType', ], 'ModifierPercentage' => [ 'shape' => 'ModifierPercentage', ], 'Service' => [ 'shape' => 'Service', ], 'Tags' => [ 'shape' => 'TagMap', ], 'BillingEntity' => [ 'shape' => 'BillingEntity', ], 'Tiering' => [ 'shape' => 'CreateTieringInput', ], 'UsageType' => [ 'shape' => 'UsageType', ], 'Operation' => [ 'shape' => 'Operation', ], ], ], 'CreatePricingRuleOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'PricingRuleArn', ], ], ], 'CreateTieringInput' => [ 'type' => 'structure', 'required' => [ 'FreeTier', ], 'members' => [ 'FreeTier' => [ 'shape' => 'CreateFreeTierConfig', ], ], ], 'Currency' => [ 'type' => 'string', ], 'CurrencyCode' => [ 'type' => 'string', 'enum' => [ 'USD', 'CNY', ], ], 'CustomLineItemArn' => [ 'type' => 'string', 'pattern' => '(arn:aws(-cn)?:billingconductor::[0-9]{12}:customlineitem/)?[a-zA-Z0-9]{10}', ], 'CustomLineItemArns' => [ 'type' => 'list', 'member' => [ 'shape' => 'CustomLineItemArn', ], 'max' => 100, 'min' => 1, ], 'CustomLineItemAssociationElement' => [ 'type' => 'string', 'pattern' => '(arn:aws(-cn)?:billingconductor::[0-9]{12}:(customlineitem|billinggroup)/)?[a-zA-Z0-9]{10,12}', ], 'CustomLineItemAssociationsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CustomLineItemAssociationElement', ], 'max' => 5, 'min' => 0, ], 'CustomLineItemBatchAssociationsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CustomLineItemAssociationElement', ], 'max' => 30, 'min' => 1, ], 'CustomLineItemBatchDisassociationsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CustomLineItemAssociationElement', ], 'max' => 30, 'min' => 1, ], 'CustomLineItemBillingPeriodRange' => [ 'type' => 'structure', 'required' => [ 'InclusiveStartBillingPeriod', ], 'members' => [ 'InclusiveStartBillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'ExclusiveEndBillingPeriod' => [ 'shape' => 'BillingPeriod', ], ], ], 'CustomLineItemChargeDetails' => [ 'type' => 'structure', 'required' => [ 'Type', ], 'members' => [ 'Flat' => [ 'shape' => 'CustomLineItemFlatChargeDetails', ], 'Percentage' => [ 'shape' => 'CustomLineItemPercentageChargeDetails', ], 'Type' => [ 'shape' => 'CustomLineItemType', ], ], ], 'CustomLineItemChargeValue' => [ 'type' => 'double', 'box' => true, 'max' => 1000000, 'min' => 0, ], 'CustomLineItemDescription' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'sensitive' => true, ], 'CustomLineItemFlatChargeDetails' => [ 'type' => 'structure', 'required' => [ 'ChargeValue', ], 'members' => [ 'ChargeValue' => [ 'shape' => 'CustomLineItemChargeValue', ], ], ], 'CustomLineItemList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CustomLineItemListElement', ], ], 'CustomLineItemListElement' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'CustomLineItemArn', ], 'Name' => [ 'shape' => 'CustomLineItemName', ], 'ChargeDetails' => [ 'shape' => 'ListCustomLineItemChargeDetails', ], 'CurrencyCode' => [ 'shape' => 'CurrencyCode', ], 'Description' => [ 'shape' => 'CustomLineItemDescription', ], 'ProductCode' => [ 'shape' => 'CustomLineItemProductCode', ], 'BillingGroupArn' => [ 'shape' => 'BillingGroupArn', ], 'CreationTime' => [ 'shape' => 'Instant', ], 'LastModifiedTime' => [ 'shape' => 'Instant', ], 'AssociationSize' => [ 'shape' => 'NumberOfAssociations', ], ], ], 'CustomLineItemName' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[a-zA-Z0-9_\\\\+=\\\\.\\\\-@]+', 'sensitive' => true, ], 'CustomLineItemNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CustomLineItemName', ], 'max' => 100, 'min' => 1, ], 'CustomLineItemPercentageChargeDetails' => [ 'type' => 'structure', 'required' => [ 'PercentageValue', ], 'members' => [ 'PercentageValue' => [ 'shape' => 'CustomLineItemPercentageChargeValue', ], 'AssociatedValues' => [ 'shape' => 'CustomLineItemAssociationsList', ], ], ], 'CustomLineItemPercentageChargeValue' => [ 'type' => 'double', 'box' => true, 'max' => 10000, 'min' => 0, ], 'CustomLineItemProductCode' => [ 'type' => 'string', 'max' => 29, 'min' => 1, ], 'CustomLineItemRelationship' => [ 'type' => 'string', 'enum' => [ 'PARENT', 'CHILD', ], ], 'CustomLineItemType' => [ 'type' => 'string', 'enum' => [ 'CREDIT', 'FEE', ], ], 'CustomLineItemVersionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CustomLineItemVersionListElement', ], ], 'CustomLineItemVersionListElement' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'CustomLineItemName', ], 'ChargeDetails' => [ 'shape' => 'ListCustomLineItemChargeDetails', ], 'CurrencyCode' => [ 'shape' => 'CurrencyCode', ], 'Description' => [ 'shape' => 'CustomLineItemDescription', ], 'ProductCode' => [ 'shape' => 'CustomLineItemProductCode', ], 'BillingGroupArn' => [ 'shape' => 'BillingGroupArn', ], 'CreationTime' => [ 'shape' => 'Instant', ], 'LastModifiedTime' => [ 'shape' => 'Instant', ], 'AssociationSize' => [ 'shape' => 'NumberOfAssociations', ], 'StartBillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'EndBillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'Arn' => [ 'shape' => 'CustomLineItemArn', ], 'StartTime' => [ 'shape' => 'Instant', ], ], ], 'DeleteBillingGroupInput' => [ 'type' => 'structure', 'required' => [ 'Arn', ], 'members' => [ 'Arn' => [ 'shape' => 'BillingGroupArn', ], ], ], 'DeleteBillingGroupOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'BillingGroupArn', ], ], ], 'DeleteCustomLineItemInput' => [ 'type' => 'structure', 'required' => [ 'Arn', ], 'members' => [ 'Arn' => [ 'shape' => 'CustomLineItemArn', ], 'BillingPeriodRange' => [ 'shape' => 'CustomLineItemBillingPeriodRange', ], ], ], 'DeleteCustomLineItemOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'CustomLineItemArn', ], ], ], 'DeletePricingPlanInput' => [ 'type' => 'structure', 'required' => [ 'Arn', ], 'members' => [ 'Arn' => [ 'shape' => 'PricingPlanArn', ], ], ], 'DeletePricingPlanOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'PricingPlanArn', ], ], ], 'DeletePricingRuleInput' => [ 'type' => 'structure', 'required' => [ 'Arn', ], 'members' => [ 'Arn' => [ 'shape' => 'PricingRuleArn', ], ], ], 'DeletePricingRuleOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'PricingRuleArn', ], ], ], 'DisassociateAccountsInput' => [ 'type' => 'structure', 'required' => [ 'Arn', 'AccountIds', ], 'members' => [ 'Arn' => [ 'shape' => 'BillingGroupArn', ], 'AccountIds' => [ 'shape' => 'AccountIdList', ], ], ], 'DisassociateAccountsOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'BillingGroupArn', ], ], ], 'DisassociatePricingRulesInput' => [ 'type' => 'structure', 'required' => [ 'Arn', 'PricingRuleArns', ], 'members' => [ 'Arn' => [ 'shape' => 'PricingPlanArn', ], 'PricingRuleArns' => [ 'shape' => 'PricingRuleArnsNonEmptyInput', ], ], ], 'DisassociatePricingRulesOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'PricingPlanArn', ], ], ], 'DisassociateResourceResponseElement' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'CustomLineItemAssociationElement', ], 'Error' => [ 'shape' => 'AssociateResourceError', ], ], ], 'DisassociateResourcesResponseList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DisassociateResourceResponseElement', ], ], 'FreeTierConfig' => [ 'type' => 'structure', 'required' => [ 'Activated', ], 'members' => [ 'Activated' => [ 'shape' => 'TieringActivated', ], ], ], 'Instant' => [ 'type' => 'long', ], 'InternalServerException' => [ 'type' => 'structure', 'required' => [ 'Message', ], 'members' => [ 'Message' => [ 'shape' => 'String', ], 'RetryAfterSeconds' => [ 'shape' => 'RetryAfterSeconds', 'location' => 'header', 'locationName' => 'Retry-After', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'ListAccountAssociationsFilter' => [ 'type' => 'structure', 'members' => [ 'Association' => [ 'shape' => 'Association', ], 'AccountId' => [ 'shape' => 'AccountId', ], 'AccountIds' => [ 'shape' => 'AccountIdFilterList', ], ], ], 'ListAccountAssociationsInput' => [ 'type' => 'structure', 'members' => [ 'BillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'Filters' => [ 'shape' => 'ListAccountAssociationsFilter', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListAccountAssociationsOutput' => [ 'type' => 'structure', 'members' => [ 'LinkedAccounts' => [ 'shape' => 'AccountAssociationsList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListBillingGroupCostReportsFilter' => [ 'type' => 'structure', 'members' => [ 'BillingGroupArns' => [ 'shape' => 'BillingGroupArnList', ], ], ], 'ListBillingGroupCostReportsInput' => [ 'type' => 'structure', 'members' => [ 'BillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'MaxResults' => [ 'shape' => 'MaxBillingGroupResults', ], 'NextToken' => [ 'shape' => 'Token', ], 'Filters' => [ 'shape' => 'ListBillingGroupCostReportsFilter', ], ], ], 'ListBillingGroupCostReportsOutput' => [ 'type' => 'structure', 'members' => [ 'BillingGroupCostReports' => [ 'shape' => 'BillingGroupCostReportList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListBillingGroupsFilter' => [ 'type' => 'structure', 'members' => [ 'Arns' => [ 'shape' => 'BillingGroupArnList', ], 'PricingPlan' => [ 'shape' => 'PricingPlanFullArn', ], 'Statuses' => [ 'shape' => 'BillingGroupStatusList', ], ], ], 'ListBillingGroupsInput' => [ 'type' => 'structure', 'members' => [ 'BillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'MaxResults' => [ 'shape' => 'MaxBillingGroupResults', ], 'NextToken' => [ 'shape' => 'Token', ], 'Filters' => [ 'shape' => 'ListBillingGroupsFilter', ], ], ], 'ListBillingGroupsOutput' => [ 'type' => 'structure', 'members' => [ 'BillingGroups' => [ 'shape' => 'BillingGroupList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListCustomLineItemChargeDetails' => [ 'type' => 'structure', 'required' => [ 'Type', ], 'members' => [ 'Flat' => [ 'shape' => 'ListCustomLineItemFlatChargeDetails', ], 'Percentage' => [ 'shape' => 'ListCustomLineItemPercentageChargeDetails', ], 'Type' => [ 'shape' => 'CustomLineItemType', ], ], ], 'ListCustomLineItemFlatChargeDetails' => [ 'type' => 'structure', 'required' => [ 'ChargeValue', ], 'members' => [ 'ChargeValue' => [ 'shape' => 'CustomLineItemChargeValue', ], ], ], 'ListCustomLineItemPercentageChargeDetails' => [ 'type' => 'structure', 'required' => [ 'PercentageValue', ], 'members' => [ 'PercentageValue' => [ 'shape' => 'CustomLineItemPercentageChargeValue', ], ], ], 'ListCustomLineItemVersionsBillingPeriodRangeFilter' => [ 'type' => 'structure', 'members' => [ 'StartBillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'EndBillingPeriod' => [ 'shape' => 'BillingPeriod', ], ], ], 'ListCustomLineItemVersionsFilter' => [ 'type' => 'structure', 'members' => [ 'BillingPeriodRange' => [ 'shape' => 'ListCustomLineItemVersionsBillingPeriodRangeFilter', ], ], ], 'ListCustomLineItemVersionsInput' => [ 'type' => 'structure', 'required' => [ 'Arn', ], 'members' => [ 'Arn' => [ 'shape' => 'CustomLineItemArn', ], 'MaxResults' => [ 'shape' => 'MaxCustomLineItemResults', ], 'NextToken' => [ 'shape' => 'Token', ], 'Filters' => [ 'shape' => 'ListCustomLineItemVersionsFilter', ], ], ], 'ListCustomLineItemVersionsOutput' => [ 'type' => 'structure', 'members' => [ 'CustomLineItemVersions' => [ 'shape' => 'CustomLineItemVersionList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListCustomLineItemsFilter' => [ 'type' => 'structure', 'members' => [ 'Names' => [ 'shape' => 'CustomLineItemNameList', ], 'BillingGroups' => [ 'shape' => 'BillingGroupArnList', ], 'Arns' => [ 'shape' => 'CustomLineItemArns', ], ], ], 'ListCustomLineItemsInput' => [ 'type' => 'structure', 'members' => [ 'BillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'MaxResults' => [ 'shape' => 'MaxCustomLineItemResults', ], 'NextToken' => [ 'shape' => 'Token', ], 'Filters' => [ 'shape' => 'ListCustomLineItemsFilter', ], ], ], 'ListCustomLineItemsOutput' => [ 'type' => 'structure', 'members' => [ 'CustomLineItems' => [ 'shape' => 'CustomLineItemList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListPricingPlansAssociatedWithPricingRuleInput' => [ 'type' => 'structure', 'required' => [ 'PricingRuleArn', ], 'members' => [ 'BillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'PricingRuleArn' => [ 'shape' => 'PricingRuleArn', ], 'MaxResults' => [ 'shape' => 'MaxPricingRuleResults', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListPricingPlansAssociatedWithPricingRuleOutput' => [ 'type' => 'structure', 'members' => [ 'BillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'PricingRuleArn' => [ 'shape' => 'PricingRuleArn', ], 'PricingPlanArns' => [ 'shape' => 'PricingPlanArns', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListPricingPlansFilter' => [ 'type' => 'structure', 'members' => [ 'Arns' => [ 'shape' => 'PricingPlanArns', ], ], ], 'ListPricingPlansInput' => [ 'type' => 'structure', 'members' => [ 'BillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'Filters' => [ 'shape' => 'ListPricingPlansFilter', ], 'MaxResults' => [ 'shape' => 'MaxPricingPlanResults', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListPricingPlansOutput' => [ 'type' => 'structure', 'members' => [ 'BillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'PricingPlans' => [ 'shape' => 'PricingPlanList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListPricingRulesAssociatedToPricingPlanInput' => [ 'type' => 'structure', 'required' => [ 'PricingPlanArn', ], 'members' => [ 'BillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'PricingPlanArn' => [ 'shape' => 'PricingPlanArn', ], 'MaxResults' => [ 'shape' => 'MaxPricingPlanResults', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListPricingRulesAssociatedToPricingPlanOutput' => [ 'type' => 'structure', 'members' => [ 'BillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'PricingPlanArn' => [ 'shape' => 'PricingPlanArn', ], 'PricingRuleArns' => [ 'shape' => 'PricingRuleArns', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListPricingRulesFilter' => [ 'type' => 'structure', 'members' => [ 'Arns' => [ 'shape' => 'PricingRuleArns', ], ], ], 'ListPricingRulesInput' => [ 'type' => 'structure', 'members' => [ 'BillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'Filters' => [ 'shape' => 'ListPricingRulesFilter', ], 'MaxResults' => [ 'shape' => 'MaxPricingRuleResults', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListPricingRulesOutput' => [ 'type' => 'structure', 'members' => [ 'BillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'PricingRules' => [ 'shape' => 'PricingRuleList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListResourcesAssociatedToCustomLineItemFilter' => [ 'type' => 'structure', 'members' => [ 'Relationship' => [ 'shape' => 'CustomLineItemRelationship', ], ], ], 'ListResourcesAssociatedToCustomLineItemInput' => [ 'type' => 'structure', 'required' => [ 'Arn', ], 'members' => [ 'BillingPeriod' => [ 'shape' => 'BillingPeriod', ], 'Arn' => [ 'shape' => 'CustomLineItemArn', ], 'MaxResults' => [ 'shape' => 'MaxCustomLineItemResults', ], 'NextToken' => [ 'shape' => 'Token', ], 'Filters' => [ 'shape' => 'ListResourcesAssociatedToCustomLineItemFilter', ], ], ], 'ListResourcesAssociatedToCustomLineItemOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'CustomLineItemArn', ], 'AssociatedResources' => [ 'shape' => 'ListResourcesAssociatedToCustomLineItemResponseList', ], 'NextToken' => [ 'shape' => 'Token', ], ], ], 'ListResourcesAssociatedToCustomLineItemResponseElement' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'CustomLineItemAssociationElement', ], 'Relationship' => [ 'shape' => 'CustomLineItemRelationship', ], 'EndBillingPeriod' => [ 'shape' => 'BillingPeriod', ], ], ], 'ListResourcesAssociatedToCustomLineItemResponseList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ListResourcesAssociatedToCustomLineItemResponseElement', ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', 'location' => 'uri', 'locationName' => 'ResourceArn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagMap', ], ], ], 'Margin' => [ 'type' => 'string', ], 'MarginPercentage' => [ 'type' => 'string', ], 'MaxBillingGroupResults' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'MaxCustomLineItemResults' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'MaxPricingPlanResults' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'MaxPricingRuleResults' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'ModifierPercentage' => [ 'type' => 'double', 'box' => true, 'min' => 0, ], 'NumberOfAccounts' => [ 'type' => 'long', 'min' => 0, ], 'NumberOfAssociatedPricingRules' => [ 'type' => 'long', 'min' => 1, ], 'NumberOfAssociations' => [ 'type' => 'long', 'min' => 0, ], 'NumberOfPricingPlansAssociatedWith' => [ 'type' => 'long', 'min' => 0, ], 'Operation' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '\\\\S+', ], 'PricingPlanArn' => [ 'type' => 'string', 'pattern' => '(arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingplan/)?[a-zA-Z0-9]{10}', ], 'PricingPlanArns' => [ 'type' => 'list', 'member' => [ 'shape' => 'PricingPlanArn', ], 'max' => 100, 'min' => 1, ], 'PricingPlanDescription' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'sensitive' => true, ], 'PricingPlanFullArn' => [ 'type' => 'string', 'pattern' => 'arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingplan/[a-zA-Z0-9]{10}', ], 'PricingPlanList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PricingPlanListElement', ], ], 'PricingPlanListElement' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'PricingPlanName', ], 'Arn' => [ 'shape' => 'PricingPlanArn', ], 'Description' => [ 'shape' => 'PricingPlanDescription', ], 'Size' => [ 'shape' => 'NumberOfAssociatedPricingRules', ], 'CreationTime' => [ 'shape' => 'Instant', ], 'LastModifiedTime' => [ 'shape' => 'Instant', ], ], ], 'PricingPlanName' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[a-zA-Z0-9_\\\\+=\\\\.\\\\-@]+', 'sensitive' => true, ], 'PricingRuleArn' => [ 'type' => 'string', 'pattern' => '(arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingrule/)?[a-zA-Z0-9]{10}', ], 'PricingRuleArns' => [ 'type' => 'list', 'member' => [ 'shape' => 'PricingRuleArn', ], 'max' => 100, 'min' => 1, ], 'PricingRuleArnsInput' => [ 'type' => 'list', 'member' => [ 'shape' => 'PricingRuleArn', ], 'max' => 30, 'min' => 0, ], 'PricingRuleArnsNonEmptyInput' => [ 'type' => 'list', 'member' => [ 'shape' => 'PricingRuleArn', ], 'max' => 30, 'min' => 1, ], 'PricingRuleDescription' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'sensitive' => true, ], 'PricingRuleList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PricingRuleListElement', ], ], 'PricingRuleListElement' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'PricingRuleName', ], 'Arn' => [ 'shape' => 'PricingRuleArn', ], 'Description' => [ 'shape' => 'PricingRuleDescription', ], 'Scope' => [ 'shape' => 'PricingRuleScope', ], 'Type' => [ 'shape' => 'PricingRuleType', ], 'ModifierPercentage' => [ 'shape' => 'ModifierPercentage', ], 'Service' => [ 'shape' => 'Service', ], 'AssociatedPricingPlanCount' => [ 'shape' => 'NumberOfPricingPlansAssociatedWith', ], 'CreationTime' => [ 'shape' => 'Instant', ], 'LastModifiedTime' => [ 'shape' => 'Instant', ], 'BillingEntity' => [ 'shape' => 'BillingEntity', ], 'Tiering' => [ 'shape' => 'Tiering', ], 'UsageType' => [ 'shape' => 'UsageType', ], 'Operation' => [ 'shape' => 'Operation', ], ], ], 'PricingRuleName' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[a-zA-Z0-9_\\\\+=\\\\.\\\\-@]+', 'sensitive' => true, ], 'PricingRuleScope' => [ 'type' => 'string', 'enum' => [ 'GLOBAL', 'SERVICE', 'BILLING_ENTITY', 'SKU', ], ], 'PricingRuleType' => [ 'type' => 'string', 'enum' => [ 'MARKUP', 'DISCOUNT', 'TIERING', ], ], 'ProformaCost' => [ 'type' => 'string', ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'required' => [ 'Message', 'ResourceId', 'ResourceType', ], 'members' => [ 'Message' => [ 'shape' => 'String', ], 'ResourceId' => [ 'shape' => 'String', ], 'ResourceType' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'RetryAfterSeconds' => [ 'type' => 'integer', ], 'Service' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[a-zA-Z0-9]+', ], 'ServiceLimitExceededException' => [ 'type' => 'structure', 'required' => [ 'Message', 'LimitCode', 'ServiceCode', ], 'members' => [ 'Message' => [ 'shape' => 'String', ], 'ResourceId' => [ 'shape' => 'String', ], 'ResourceType' => [ 'shape' => 'String', ], 'LimitCode' => [ 'shape' => 'String', ], 'ServiceCode' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 402, 'senderFault' => true, ], 'exception' => true, ], 'String' => [ 'type' => 'string', ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 200, 'min' => 1, ], 'TagMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'TagKey', ], 'value' => [ 'shape' => 'TagValue', ], 'max' => 200, 'min' => 1, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'Tags', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', 'location' => 'uri', 'locationName' => 'ResourceArn', ], 'Tags' => [ 'shape' => 'TagMap', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, ], 'ThrottlingException' => [ 'type' => 'structure', 'required' => [ 'Message', ], 'members' => [ 'Message' => [ 'shape' => 'String', ], 'RetryAfterSeconds' => [ 'shape' => 'RetryAfterSeconds', 'location' => 'header', 'locationName' => 'Retry-After', ], ], 'error' => [ 'httpStatusCode' => 429, 'senderFault' => true, ], 'exception' => true, ], 'Tiering' => [ 'type' => 'structure', 'required' => [ 'FreeTier', ], 'members' => [ 'FreeTier' => [ 'shape' => 'FreeTierConfig', ], ], ], 'TieringActivated' => [ 'type' => 'boolean', 'box' => true, ], 'Token' => [ 'type' => 'string', ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'TagKeys', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', 'location' => 'uri', 'locationName' => 'ResourceArn', ], 'TagKeys' => [ 'shape' => 'TagKeyList', 'location' => 'querystring', 'locationName' => 'tagKeys', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateBillingGroupInput' => [ 'type' => 'structure', 'required' => [ 'Arn', ], 'members' => [ 'Arn' => [ 'shape' => 'BillingGroupArn', ], 'Name' => [ 'shape' => 'BillingGroupName', ], 'Status' => [ 'shape' => 'BillingGroupStatus', ], 'ComputationPreference' => [ 'shape' => 'ComputationPreference', ], 'Description' => [ 'shape' => 'BillingGroupDescription', ], ], ], 'UpdateBillingGroupOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'BillingGroupArn', ], 'Name' => [ 'shape' => 'BillingGroupName', ], 'Description' => [ 'shape' => 'BillingGroupDescription', ], 'PrimaryAccountId' => [ 'shape' => 'AccountId', ], 'PricingPlanArn' => [ 'shape' => 'PricingPlanArn', ], 'Size' => [ 'shape' => 'NumberOfAccounts', ], 'LastModifiedTime' => [ 'shape' => 'Instant', ], 'Status' => [ 'shape' => 'BillingGroupStatus', ], 'StatusReason' => [ 'shape' => 'BillingGroupStatusReason', ], ], ], 'UpdateCustomLineItemChargeDetails' => [ 'type' => 'structure', 'members' => [ 'Flat' => [ 'shape' => 'UpdateCustomLineItemFlatChargeDetails', ], 'Percentage' => [ 'shape' => 'UpdateCustomLineItemPercentageChargeDetails', ], ], ], 'UpdateCustomLineItemFlatChargeDetails' => [ 'type' => 'structure', 'required' => [ 'ChargeValue', ], 'members' => [ 'ChargeValue' => [ 'shape' => 'CustomLineItemChargeValue', ], ], ], 'UpdateCustomLineItemInput' => [ 'type' => 'structure', 'required' => [ 'Arn', ], 'members' => [ 'Arn' => [ 'shape' => 'CustomLineItemArn', ], 'Name' => [ 'shape' => 'CustomLineItemName', ], 'Description' => [ 'shape' => 'CustomLineItemDescription', ], 'ChargeDetails' => [ 'shape' => 'UpdateCustomLineItemChargeDetails', ], 'BillingPeriodRange' => [ 'shape' => 'CustomLineItemBillingPeriodRange', ], ], ], 'UpdateCustomLineItemOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'CustomLineItemArn', ], 'BillingGroupArn' => [ 'shape' => 'BillingGroupFullArn', ], 'Name' => [ 'shape' => 'CustomLineItemName', ], 'Description' => [ 'shape' => 'CustomLineItemDescription', ], 'ChargeDetails' => [ 'shape' => 'ListCustomLineItemChargeDetails', ], 'LastModifiedTime' => [ 'shape' => 'Instant', ], 'AssociationSize' => [ 'shape' => 'NumberOfAssociations', ], ], ], 'UpdateCustomLineItemPercentageChargeDetails' => [ 'type' => 'structure', 'required' => [ 'PercentageValue', ], 'members' => [ 'PercentageValue' => [ 'shape' => 'CustomLineItemPercentageChargeValue', ], ], ], 'UpdateFreeTierConfig' => [ 'type' => 'structure', 'required' => [ 'Activated', ], 'members' => [ 'Activated' => [ 'shape' => 'TieringActivated', ], ], ], 'UpdatePricingPlanInput' => [ 'type' => 'structure', 'required' => [ 'Arn', ], 'members' => [ 'Arn' => [ 'shape' => 'PricingPlanArn', ], 'Name' => [ 'shape' => 'PricingPlanName', ], 'Description' => [ 'shape' => 'PricingPlanDescription', ], ], ], 'UpdatePricingPlanOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'PricingPlanArn', ], 'Name' => [ 'shape' => 'PricingPlanName', ], 'Description' => [ 'shape' => 'PricingPlanDescription', ], 'Size' => [ 'shape' => 'NumberOfAssociatedPricingRules', ], 'LastModifiedTime' => [ 'shape' => 'Instant', ], ], ], 'UpdatePricingRuleInput' => [ 'type' => 'structure', 'required' => [ 'Arn', ], 'members' => [ 'Arn' => [ 'shape' => 'PricingRuleArn', ], 'Name' => [ 'shape' => 'PricingRuleName', ], 'Description' => [ 'shape' => 'PricingRuleDescription', ], 'Type' => [ 'shape' => 'PricingRuleType', ], 'ModifierPercentage' => [ 'shape' => 'ModifierPercentage', ], 'Tiering' => [ 'shape' => 'UpdateTieringInput', ], ], ], 'UpdatePricingRuleOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'PricingRuleArn', ], 'Name' => [ 'shape' => 'PricingRuleName', ], 'Description' => [ 'shape' => 'PricingRuleDescription', ], 'Scope' => [ 'shape' => 'PricingRuleScope', ], 'Type' => [ 'shape' => 'PricingRuleType', ], 'ModifierPercentage' => [ 'shape' => 'ModifierPercentage', ], 'Service' => [ 'shape' => 'Service', ], 'AssociatedPricingPlanCount' => [ 'shape' => 'NumberOfPricingPlansAssociatedWith', ], 'LastModifiedTime' => [ 'shape' => 'Instant', ], 'BillingEntity' => [ 'shape' => 'BillingEntity', ], 'Tiering' => [ 'shape' => 'UpdateTieringInput', ], 'UsageType' => [ 'shape' => 'UsageType', ], 'Operation' => [ 'shape' => 'Operation', ], ], ], 'UpdateTieringInput' => [ 'type' => 'structure', 'required' => [ 'FreeTier', ], 'members' => [ 'FreeTier' => [ 'shape' => 'UpdateFreeTierConfig', ], ], ], 'UsageType' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '\\\\S+', ], 'ValidationException' => [ 'type' => 'structure', 'required' => [ 'Message', ], 'members' => [ 'Message' => [ 'shape' => 'String', ], 'Reason' => [ 'shape' => 'ValidationExceptionReason', ], 'Fields' => [ 'shape' => 'ValidationExceptionFieldList', ], ], 'error' => [ 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'ValidationExceptionField' => [ 'type' => 'structure', 'required' => [ 'Name', 'Message', ], 'members' => [ 'Name' => [ 'shape' => 'String', ], 'Message' => [ 'shape' => 'String', ], ], ], 'ValidationExceptionFieldList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ValidationExceptionField', ], ], 'ValidationExceptionReason' => [ 'type' => 'string', 'enum' => [ 'UNKNOWN_OPERATION', 'CANNOT_PARSE', 'FIELD_VALIDATION_FAILED', 'OTHER', 'PRIMARY_NOT_ASSOCIATED', 'PRIMARY_CANNOT_DISASSOCIATE', 'ACCOUNTS_NOT_ASSOCIATED', 'ACCOUNTS_ALREADY_ASSOCIATED', 'ILLEGAL_PRIMARY_ACCOUNT', 'ILLEGAL_ACCOUNTS', 'MISMATCHED_BILLINGGROUP_ARN', 'MISSING_BILLINGGROUP', 'MISMATCHED_CUSTOMLINEITEM_ARN', 'ILLEGAL_BILLING_PERIOD', 'ILLEGAL_BILLING_PERIOD_RANGE', 'TOO_MANY_ACCOUNTS_IN_REQUEST', 'DUPLICATE_ACCOUNT', 'INVALID_BILLING_GROUP_STATUS', 'MISMATCHED_PRICINGPLAN_ARN', 'MISSING_PRICINGPLAN', 'MISMATCHED_PRICINGRULE_ARN', 'DUPLICATE_PRICINGRULE_ARNS', 'ILLEGAL_EXPRESSION', 'ILLEGAL_SCOPE', 'ILLEGAL_SERVICE', 'PRICINGRULES_NOT_EXIST', 'PRICINGRULES_ALREADY_ASSOCIATED', 'PRICINGRULES_NOT_ASSOCIATED', 'INVALID_TIME_RANGE', 'INVALID_BILLINGVIEW_ARN', 'MISMATCHED_BILLINGVIEW_ARN', 'ILLEGAL_CUSTOMLINEITEM', 'MISSING_CUSTOMLINEITEM', 'ILLEGAL_CUSTOMLINEITEM_UPDATE', 'TOO_MANY_CUSTOMLINEITEMS_IN_REQUEST', 'ILLEGAL_CHARGE_DETAILS', 'ILLEGAL_UPDATE_CHARGE_DETAILS', 'INVALID_ARN', 'ILLEGAL_RESOURCE_ARNS', 'ILLEGAL_CUSTOMLINEITEM_MODIFICATION', 'MISSING_LINKED_ACCOUNT_IDS', 'MULTIPLE_LINKED_ACCOUNT_IDS', 'MISSING_PRICING_PLAN_ARN', 'MULTIPLE_PRICING_PLAN_ARN', 'ILLEGAL_CHILD_ASSOCIATE_RESOURCE', 'CUSTOM_LINE_ITEM_ASSOCIATION_EXISTS', 'INVALID_BILLING_GROUP', 'INVALID_BILLING_PERIOD_FOR_OPERATION', 'ILLEGAL_BILLING_ENTITY', 'ILLEGAL_MODIFIER_PERCENTAGE', 'ILLEGAL_TYPE', 'ILLEGAL_ENDED_BILLINGGROUP', 'ILLEGAL_TIERING_INPUT', 'ILLEGAL_OPERATION', 'ILLEGAL_USAGE_TYPE', 'INVALID_SKU_COMBO', 'INVALID_FILTER', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/billingconductor/2021-07-30/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>Amazon Web Services Billing Conductor is a fully managed service that you can use to customize a <a href=\"https://docs.aws.amazon.com/billingconductor/latest/userguide/understanding-eb.html#eb-other-definitions\">pro forma</a> version of your billing data each month, to accurately show or chargeback your end customers. Amazon Web Services Billing Conductor doesn\\'t change the way you\\'re billed by Amazon Web Services each month by design. Instead, it provides you with a mechanism to configure, generate, and display rates to certain customers over a given billing period. You can also analyze the difference between the rates you apply to your accounting groupings relative to your actual rates from Amazon Web Services. As a result of your Amazon Web Services Billing Conductor configuration, the payer account can also see the custom rate applied on the billing details page of the <a href=\"https://console.aws.amazon.com/billing\">Amazon Web Services Billing console</a>, or configure a cost and usage report per billing group.</p> <p>This documentation shows how you can configure Amazon Web Services Billing Conductor using its API. For more information about using the <a href=\"https://console.aws.amazon.com/billingconductor/\">Amazon Web Services Billing Conductor</a> user interface, see the <a href=\"https://docs.aws.amazon.com/billingconductor/latest/userguide/what-is-billingconductor.html\"> Amazon Web Services Billing Conductor User Guide</a>.</p>', 'operations' => [ 'AssociateAccounts' => '<p>Connects an array of account IDs in a consolidated billing family to a predefined billing group. The account IDs must be a part of the consolidated billing family during the current month, and not already associated with another billing group. The maximum number of accounts that can be associated in one call is 30. </p>', 'AssociatePricingRules' => '<p>Connects an array of <code>PricingRuleArns</code> to a defined <code>PricingPlan</code>. The maximum number <code>PricingRuleArn</code> that can be associated in one call is 30. </p>', 'BatchAssociateResourcesToCustomLineItem' => '<p> Associates a batch of resources to a percentage custom line item. </p>', 'BatchDisassociateResourcesFromCustomLineItem' => '<p> Disassociates a batch of resources from a percentage custom line item. </p>', 'CreateBillingGroup' => '<p> Creates a billing group that resembles a consolidated billing family that Amazon Web Services charges, based off of the predefined pricing plan computation. </p>', 'CreateCustomLineItem' => '<p> Creates a custom line item that can be used to create a one-time fixed charge that can be applied to a single billing group for the current or previous billing period. The one-time fixed charge is either a fee or discount. </p>', 'CreatePricingPlan' => '<p>Creates a pricing plan that is used for computing Amazon Web Services charges for billing groups. </p>', 'CreatePricingRule' => '<p> Creates a pricing rule can be associated to a pricing plan, or a set of pricing plans. </p>', 'DeleteBillingGroup' => '<p> Deletes a billing group. </p>', 'DeleteCustomLineItem' => '<p> Deletes the custom line item identified by the given ARN in the current, or previous billing period. </p>', 'DeletePricingPlan' => '<p>Deletes a pricing plan. The pricing plan must not be associated with any billing groups to delete successfully.</p>', 'DeletePricingRule' => '<p> Deletes the pricing rule that\\'s identified by the input Amazon Resource Name (ARN). </p>', 'DisassociateAccounts' => '<p>Removes the specified list of account IDs from the given billing group. </p>', 'DisassociatePricingRules' => '<p> Disassociates a list of pricing rules from a pricing plan. </p>', 'ListAccountAssociations' => '<p> This is a paginated call to list linked accounts that are linked to the payer account for the specified time period. If no information is provided, the current billing period is used. The response will optionally include the billing group that\\'s associated with the linked account.</p>', 'ListBillingGroupCostReports' => '<p>A paginated call to retrieve a summary report of actual Amazon Web Services charges and the calculated Amazon Web Services charges based on the associated pricing plan of a billing group.</p>', 'ListBillingGroups' => '<p>A paginated call to retrieve a list of billing groups for the given billing period. If you don\\'t provide a billing group, the current billing period is used.</p>', 'ListCustomLineItemVersions' => '<p>A paginated call to get a list of all custom line item versions.</p>', 'ListCustomLineItems' => '<p> A paginated call to get a list of all custom line items (FFLIs) for the given billing period. If you don\\'t provide a billing period, the current billing period is used. </p>', 'ListPricingPlans' => '<p>A paginated call to get pricing plans for the given billing period. If you don\\'t provide a billing period, the current billing period is used. </p>', 'ListPricingPlansAssociatedWithPricingRule' => '<p> A list of the pricing plans that are associated with a pricing rule. </p>', 'ListPricingRules' => '<p> Describes a pricing rule that can be associated to a pricing plan, or set of pricing plans. </p>', 'ListPricingRulesAssociatedToPricingPlan' => '<p> Lists the pricing rules that are associated with a pricing plan. </p>', 'ListResourcesAssociatedToCustomLineItem' => '<p> List the resources that are associated to a custom line item. </p>', 'ListTagsForResource' => '<p> A list the tags for a resource. </p>', 'TagResource' => '<p> Associates the specified tags to a resource with the specified <code>resourceArn</code>. If existing tags on a resource are not specified in the request parameters, they are not changed. </p>', 'UntagResource' => '<p> Deletes specified tags from a resource. </p>', 'UpdateBillingGroup' => '<p>This updates an existing billing group. </p>', 'UpdateCustomLineItem' => '<p> Update an existing custom line item in the current or previous billing period. </p>', 'UpdatePricingPlan' => '<p>This updates an existing pricing plan. </p>', 'UpdatePricingRule' => '<p> Updates an existing pricing rule. </p>', ], 'shapes' => [ 'AWSCost' => [ 'base' => NULL, 'refs' => [ 'BillingGroupCostReportElement$AWSCost' => '<p>The actual Amazon Web Services charges for the billing group. </p>', ], ], 'AccessDeniedException' => [ 'base' => '<p>You do not have sufficient access to perform this action. </p>', 'refs' => [], ], 'AccountAssociationsList' => [ 'base' => NULL, 'refs' => [ 'ListAccountAssociationsOutput$LinkedAccounts' => '<p> The list of linked accounts in the payer account. </p>', ], ], 'AccountAssociationsListElement' => [ 'base' => '<p> A representation of a linked account. </p>', 'refs' => [ 'AccountAssociationsList$member' => NULL, ], ], 'AccountEmail' => [ 'base' => NULL, 'refs' => [ 'AccountAssociationsListElement$AccountEmail' => '<p> The Amazon Web Services account email. </p>', ], ], 'AccountGrouping' => [ 'base' => '<p> The set of accounts that will be under the billing group. The set of accounts resemble the linked accounts in a consolidated family. </p>', 'refs' => [ 'CreateBillingGroupInput$AccountGrouping' => '<p> The set of accounts that will be under the billing group. The set of accounts resemble the linked accounts in a consolidated family. </p>', ], ], 'AccountId' => [ 'base' => NULL, 'refs' => [ 'AccountAssociationsListElement$AccountId' => '<p> The associating array of account IDs. </p>', 'AccountIdFilterList$member' => NULL, 'AccountIdList$member' => NULL, 'BillingGroupListElement$PrimaryAccountId' => '<p>The account ID that serves as the main account in a billing group. </p>', 'CreateBillingGroupInput$PrimaryAccountId' => '<p> The account ID that serves as the main account in a billing group. </p>', 'ListAccountAssociationsFilter$AccountId' => '<p> The Amazon Web Services account ID to filter on. </p>', 'UpdateBillingGroupOutput$PrimaryAccountId' => '<p> The account ID that serves as the main account in a billing group. </p>', ], ], 'AccountIdFilterList' => [ 'base' => NULL, 'refs' => [ 'ListAccountAssociationsFilter$AccountIds' => '<p> The list of Amazon Web Services IDs to retrieve their associated billing group for a given time range. </p>', ], ], 'AccountIdList' => [ 'base' => NULL, 'refs' => [ 'AccountGrouping$LinkedAccountIds' => '<p> The account IDs that make up the billing group. Account IDs must be a part of the consolidated billing family, and not associated with another billing group. </p>', 'AssociateAccountsInput$AccountIds' => '<p> The associating array of account IDs. </p>', 'DisassociateAccountsInput$AccountIds' => '<p>The array of account IDs to disassociate. </p>', ], ], 'AccountName' => [ 'base' => NULL, 'refs' => [ 'AccountAssociationsListElement$AccountName' => '<p> The Amazon Web Services account name. </p>', ], ], 'Arn' => [ 'base' => NULL, 'refs' => [ 'ListTagsForResourceRequest$ResourceArn' => '<p> The Amazon Resource Name (ARN) that identifies the resource to list the tags. </p>', 'TagResourceRequest$ResourceArn' => '<p> The Amazon Resource Name (ARN) of the resource to which to add tags. </p>', 'UntagResourceRequest$ResourceArn' => '<p> The Amazon Resource Name (ARN) of the resource to which to delete tags. </p>', ], ], 'AssociateAccountsInput' => [ 'base' => NULL, 'refs' => [], ], 'AssociateAccountsOutput' => [ 'base' => NULL, 'refs' => [], ], 'AssociatePricingRulesInput' => [ 'base' => NULL, 'refs' => [], ], 'AssociatePricingRulesOutput' => [ 'base' => NULL, 'refs' => [], ], 'AssociateResourceError' => [ 'base' => '<p> A representation of a resource association error. </p>', 'refs' => [ 'AssociateResourceResponseElement$Error' => '<p> An <code>AssociateResourceError</code> that will populate if the resource association fails. </p>', 'DisassociateResourceResponseElement$Error' => '<p> An <code>AssociateResourceError</code> that\\'s shown if the resource disassociation fails. </p>', ], ], 'AssociateResourceErrorReason' => [ 'base' => NULL, 'refs' => [ 'AssociateResourceError$Reason' => '<p> A static error code that\\'s used to classify the type of failure. </p>', ], ], 'AssociateResourceResponseElement' => [ 'base' => '<p> A resource association result for a percentage custom line item. </p>', 'refs' => [ 'AssociateResourcesResponseList$member' => NULL, ], ], 'AssociateResourcesResponseList' => [ 'base' => NULL, 'refs' => [ 'BatchAssociateResourcesToCustomLineItemOutput$SuccessfullyAssociatedResources' => '<p> A list of <code>AssociateResourceResponseElement</code> for each resource that\\'s been associated to a percentage custom line item successfully. </p>', 'BatchAssociateResourcesToCustomLineItemOutput$FailedAssociatedResources' => '<p> A list of <code>AssociateResourceResponseElement</code> for each resource that failed association to a percentage custom line item. </p>', ], ], 'Association' => [ 'base' => NULL, 'refs' => [ 'ListAccountAssociationsFilter$Association' => '<p> <code>MONITORED</code>: linked accounts that are associated to billing groups.</p> <p> <code>UNMONITORED</code>: linked accounts that are not associated to billing groups.</p> <p> <code>Billing Group Arn</code>: linked accounts that are associated to the provided Billing Group Arn. </p>', ], ], 'BatchAssociateResourcesToCustomLineItemInput' => [ 'base' => NULL, 'refs' => [], ], 'BatchAssociateResourcesToCustomLineItemOutput' => [ 'base' => NULL, 'refs' => [], ], 'BatchDisassociateResourcesFromCustomLineItemInput' => [ 'base' => NULL, 'refs' => [], ], 'BatchDisassociateResourcesFromCustomLineItemOutput' => [ 'base' => NULL, 'refs' => [], ], 'BillingEntity' => [ 'base' => NULL, 'refs' => [ 'CreatePricingRuleInput$BillingEntity' => '<p> The seller of services provided by Amazon Web Services, their affiliates, or third-party providers selling services via Amazon Web Services Marketplace. </p>', 'PricingRuleListElement$BillingEntity' => '<p> The seller of services provided by Amazon Web Services, their affiliates, or third-party providers selling services via Amazon Web Services Marketplace. </p>', 'UpdatePricingRuleOutput$BillingEntity' => '<p> The seller of services provided by Amazon Web Services, their affiliates, or third-party providers selling services via Amazon Web Services Marketplace. </p>', ], ], 'BillingGroupArn' => [ 'base' => NULL, 'refs' => [ 'AccountAssociationsListElement$BillingGroupArn' => '<p> The Billing Group Arn that the linked account is associated to. </p>', 'AssociateAccountsInput$Arn' => '<p> The Amazon Resource Name (ARN) of the billing group that associates the array of account IDs. </p>', 'AssociateAccountsOutput$Arn' => '<p> The Amazon Resource Name (ARN) of the billing group that associates the array of account IDs. </p>', 'BillingGroupArnList$member' => NULL, 'BillingGroupCostReportElement$Arn' => '<p>The Amazon Resource Name (ARN) of a billing group. </p>', 'BillingGroupListElement$Arn' => '<p>The Amazon Resource Number (ARN) that can be used to uniquely identify the billing group. </p>', 'CreateBillingGroupOutput$Arn' => '<p>The Amazon Resource Name (ARN) of the created billing group. </p>', 'CreateCustomLineItemInput$BillingGroupArn' => '<p> The Amazon Resource Name (ARN) that references the billing group where the custom line item applies to. </p>', 'CustomLineItemListElement$BillingGroupArn' => '<p> The Amazon Resource Name (ARN) that references the billing group where the custom line item applies to. </p>', 'CustomLineItemVersionListElement$BillingGroupArn' => '<p>The Amazon Resource Name (ARN) of the billing group that the custom line item applies to.</p>', 'DeleteBillingGroupInput$Arn' => '<p>The Amazon Resource Name (ARN) of the billing group that you\\'re deleting.</p>', 'DeleteBillingGroupOutput$Arn' => '<p>The Amazon Resource Name (ARN) of the deleted billing group.</p>', 'DisassociateAccountsInput$Arn' => '<p>The Amazon Resource Name (ARN) of the billing group that the array of account IDs will disassociate from. </p>', 'DisassociateAccountsOutput$Arn' => '<p>The Amazon Resource Name (ARN) of the billing group that the array of account IDs is disassociated from. </p>', 'UpdateBillingGroupInput$Arn' => '<p>The Amazon Resource Name (ARN) of the billing group being updated. </p>', 'UpdateBillingGroupOutput$Arn' => '<p>The Amazon Resource Name (ARN) of the billing group that was updated. </p>', ], ], 'BillingGroupArnList' => [ 'base' => NULL, 'refs' => [ 'ListBillingGroupCostReportsFilter$BillingGroupArns' => '<p>The list of Amazon Resource Names (ARNs) used to filter billing groups to retrieve reports. </p>', 'ListBillingGroupsFilter$Arns' => '<p>The list of billing group Amazon Resource Names (ARNs) to retrieve information. </p>', 'ListCustomLineItemsFilter$BillingGroups' => '<p> The billing group Amazon Resource Names (ARNs) to retrieve information. </p>', ], ], 'BillingGroupCostReportElement' => [ 'base' => '<p>A summary report of actual Amazon Web Services charges and calculated Amazon Web Services charges, based on the associated pricing plan of a billing group. </p>', 'refs' => [ 'BillingGroupCostReportList$member' => NULL, ], ], 'BillingGroupCostReportList' => [ 'base' => NULL, 'refs' => [ 'ListBillingGroupCostReportsOutput$BillingGroupCostReports' => '<p>A list of <code>BillingGroupCostReportElement</code> retrieved. </p>', ], ], 'BillingGroupDescription' => [ 'base' => NULL, 'refs' => [ 'BillingGroupListElement$Description' => '<p>The description of the billing group. </p>', 'CreateBillingGroupInput$Description' => '<p>The description of the billing group. </p>', 'UpdateBillingGroupInput$Description' => '<p>A description of the billing group. </p>', 'UpdateBillingGroupOutput$Description' => '<p> A description of the billing group. </p>', ], ], 'BillingGroupFullArn' => [ 'base' => NULL, 'refs' => [ 'UpdateCustomLineItemOutput$BillingGroupArn' => '<p> The ARN of the billing group that the custom line item is applied to. </p>', ], ], 'BillingGroupList' => [ 'base' => NULL, 'refs' => [ 'ListBillingGroupsOutput$BillingGroups' => '<p>A list of <code>BillingGroupListElement</code> retrieved. </p>', ], ], 'BillingGroupListElement' => [ 'base' => '<p>A representation of a billing group. </p>', 'refs' => [ 'BillingGroupList$member' => NULL, ], ], 'BillingGroupName' => [ 'base' => NULL, 'refs' => [ 'BillingGroupListElement$Name' => '<p>The name of the billing group. </p>', 'CreateBillingGroupInput$Name' => '<p> The billing group name. The names must be unique. </p>', 'UpdateBillingGroupInput$Name' => '<p>The name of the billing group. The names must be unique to each billing group. </p>', 'UpdateBillingGroupOutput$Name' => '<p> The name of the billing group. The names must be unique to each billing group. </p>', ], ], 'BillingGroupStatus' => [ 'base' => NULL, 'refs' => [ 'BillingGroupListElement$Status' => '<p>The billing group status. Only one of the valid values can be used. </p>', 'BillingGroupStatusList$member' => NULL, 'UpdateBillingGroupInput$Status' => '<p>The status of the billing group. Only one of the valid values can be used. </p>', 'UpdateBillingGroupOutput$Status' => '<p> The status of the billing group. Only one of the valid values can be used. </p>', ], ], 'BillingGroupStatusList' => [ 'base' => NULL, 'refs' => [ 'ListBillingGroupsFilter$Statuses' => '<p> A list of billing groups to retrieve their current status for a specific time range </p>', ], ], 'BillingGroupStatusReason' => [ 'base' => NULL, 'refs' => [ 'BillingGroupListElement$StatusReason' => '<p>The reason why the billing group is in its current status. </p>', 'UpdateBillingGroupOutput$StatusReason' => '<p> The reason why the billing group is in its current status. </p>', ], ], 'BillingPeriod' => [ 'base' => NULL, 'refs' => [ 'CustomLineItemBillingPeriodRange$InclusiveStartBillingPeriod' => '<p> The inclusive start billing period that defines a billing period range where a custom line is applied. </p>', 'CustomLineItemBillingPeriodRange$ExclusiveEndBillingPeriod' => '<p> The inclusive end billing period that defines a billing period range where a custom line is applied. </p>', 'CustomLineItemVersionListElement$StartBillingPeriod' => '<p>The start billing period of the custom line item version.</p>', 'CustomLineItemVersionListElement$EndBillingPeriod' => '<p>The end billing period of the custom line item version.</p>', 'ListAccountAssociationsInput$BillingPeriod' => '<p> The preferred billing period to get account associations. </p>', 'ListBillingGroupCostReportsInput$BillingPeriod' => '<p>The preferred billing period for your report. </p>', 'ListBillingGroupsInput$BillingPeriod' => '<p>The preferred billing period to get billing groups. </p>', 'ListCustomLineItemVersionsBillingPeriodRangeFilter$StartBillingPeriod' => '<p>The inclusive start billing period that defines a billing period range where a custom line item version is applied.</p>', 'ListCustomLineItemVersionsBillingPeriodRangeFilter$EndBillingPeriod' => '<p>The exclusive end billing period that defines a billing period range where a custom line item version is applied.</p>', 'ListCustomLineItemsInput$BillingPeriod' => '<p> The preferred billing period to get custom line items (FFLIs). </p>', 'ListPricingPlansAssociatedWithPricingRuleInput$BillingPeriod' => '<p> The pricing plan billing period for which associations will be listed. </p>', 'ListPricingPlansAssociatedWithPricingRuleOutput$BillingPeriod' => '<p> The pricing plan billing period for which associations will be listed. </p>', 'ListPricingPlansInput$BillingPeriod' => '<p>The preferred billing period to get pricing plan. </p>', 'ListPricingPlansOutput$BillingPeriod' => '<p> The billing period for which the described pricing plans are applicable. </p>', 'ListPricingRulesAssociatedToPricingPlanInput$BillingPeriod' => '<p> The billing period for which the pricing rule associations are to be listed. </p>', 'ListPricingRulesAssociatedToPricingPlanOutput$BillingPeriod' => '<p> The billing period for which the pricing rule associations are listed. </p>', 'ListPricingRulesInput$BillingPeriod' => '<p> The preferred billing period to get the pricing plan. </p>', 'ListPricingRulesOutput$BillingPeriod' => '<p> The billing period for which the described pricing rules are applicable. </p>', 'ListResourcesAssociatedToCustomLineItemInput$BillingPeriod' => '<p> The billing period for which the resource associations will be listed. </p>', 'ListResourcesAssociatedToCustomLineItemResponseElement$EndBillingPeriod' => '<p>The end billing period of the associated resource.</p>', ], ], 'ClientToken' => [ 'base' => NULL, 'refs' => [ 'CreateBillingGroupInput$ClientToken' => '<p> The token that is needed to support idempotency. Idempotency isn\\'t currently supported, but will be implemented in a future update. </p>', 'CreateCustomLineItemInput$ClientToken' => '<p> The token that is needed to support idempotency. Idempotency isn\\'t currently supported, but will be implemented in a future update. </p>', 'CreatePricingPlanInput$ClientToken' => '<p> The token that is needed to support idempotency. Idempotency isn\\'t currently supported, but will be implemented in a future update. </p>', 'CreatePricingRuleInput$ClientToken' => '<p> The token that\\'s needed to support idempotency. Idempotency isn\\'t currently supported, but will be implemented in a future update. </p>', ], ], 'ComputationPreference' => [ 'base' => '<p> The preferences and settings that will be used to compute the Amazon Web Services charges for a billing group. </p>', 'refs' => [ 'BillingGroupListElement$ComputationPreference' => NULL, 'CreateBillingGroupInput$ComputationPreference' => '<p> The preferences and settings that will be used to compute the Amazon Web Services charges for a billing group. </p>', 'UpdateBillingGroupInput$ComputationPreference' => '<p> The preferences and settings that will be used to compute the Amazon Web Services charges for a billing group. </p>', ], ], 'ConflictException' => [ 'base' => '<p>You can cause an inconsistent state by updating or deleting a resource. </p>', 'refs' => [], ], 'ConflictExceptionReason' => [ 'base' => NULL, 'refs' => [ 'ConflictException$Reason' => '<p>Reason for the inconsistent state. </p>', ], ], 'CreateBillingGroupInput' => [ 'base' => NULL, 'refs' => [], ], 'CreateBillingGroupOutput' => [ 'base' => NULL, 'refs' => [], ], 'CreateCustomLineItemInput' => [ 'base' => NULL, 'refs' => [], ], 'CreateCustomLineItemOutput' => [ 'base' => NULL, 'refs' => [], ], 'CreateFreeTierConfig' => [ 'base' => '<p> The possible Amazon Web Services Free Tier configurations. </p>', 'refs' => [ 'CreateTieringInput$FreeTier' => '<p> The possible Amazon Web Services Free Tier configurations. </p>', ], ], 'CreatePricingPlanInput' => [ 'base' => NULL, 'refs' => [], ], 'CreatePricingPlanOutput' => [ 'base' => NULL, 'refs' => [], ], 'CreatePricingRuleInput' => [ 'base' => NULL, 'refs' => [], ], 'CreatePricingRuleOutput' => [ 'base' => NULL, 'refs' => [], ], 'CreateTieringInput' => [ 'base' => '<p> The set of tiering configurations for the pricing rule. </p>', 'refs' => [ 'CreatePricingRuleInput$Tiering' => '<p> The set of tiering configurations for the pricing rule. </p>', ], ], 'Currency' => [ 'base' => NULL, 'refs' => [ 'BillingGroupCostReportElement$Currency' => '<p>The displayed currency. </p>', ], ], 'CurrencyCode' => [ 'base' => NULL, 'refs' => [ 'CustomLineItemListElement$CurrencyCode' => '<p> The custom line item\\'s charge value currency. Only one of the valid values can be used. </p>', 'CustomLineItemVersionListElement$CurrencyCode' => '<p>The charge value currency of the custom line item.</p>', ], ], 'CustomLineItemArn' => [ 'base' => NULL, 'refs' => [ 'BatchAssociateResourcesToCustomLineItemInput$TargetArn' => '<p> A percentage custom line item ARN to associate the resources to. </p>', 'BatchDisassociateResourcesFromCustomLineItemInput$TargetArn' => '<p> A percentage custom line item ARN to disassociate the resources from. </p>', 'CreateCustomLineItemOutput$Arn' => '<p> The Amazon Resource Name (ARN) of the created custom line item. </p>', 'CustomLineItemArns$member' => NULL, 'CustomLineItemListElement$Arn' => '<p> The Amazon Resource Names (ARNs) for custom line items. </p>', 'CustomLineItemVersionListElement$Arn' => '<p> A list of custom line item Amazon Resource Names (ARNs) to retrieve information. </p>', 'DeleteCustomLineItemInput$Arn' => '<p> The ARN of the custom line item to be deleted. </p>', 'DeleteCustomLineItemOutput$Arn' => '<p> Then ARN of the deleted custom line item. </p>', 'ListCustomLineItemVersionsInput$Arn' => '<p>The Amazon Resource Name (ARN) for the custom line item.</p>', 'ListResourcesAssociatedToCustomLineItemInput$Arn' => '<p> The ARN of the custom line item for which the resource associations will be listed. </p>', 'ListResourcesAssociatedToCustomLineItemOutput$Arn' => '<p> The custom line item ARN for which the resource associations are listed. </p>', 'UpdateCustomLineItemInput$Arn' => '<p> The ARN of the custom line item to be updated. </p>', 'UpdateCustomLineItemOutput$Arn' => '<p> The ARN of the successfully updated custom line item. </p>', ], ], 'CustomLineItemArns' => [ 'base' => NULL, 'refs' => [ 'ListCustomLineItemsFilter$Arns' => '<p> A list of custom line item ARNs to retrieve information. </p>', ], ], 'CustomLineItemAssociationElement' => [ 'base' => NULL, 'refs' => [ 'AssociateResourceResponseElement$Arn' => '<p> The resource ARN that was associated to the custom line item. </p>', 'CustomLineItemAssociationsList$member' => NULL, 'CustomLineItemBatchAssociationsList$member' => NULL, 'CustomLineItemBatchDisassociationsList$member' => NULL, 'DisassociateResourceResponseElement$Arn' => '<p> The resource ARN that was disassociated from the custom line item. </p>', 'ListResourcesAssociatedToCustomLineItemResponseElement$Arn' => '<p> The ARN of the associated resource. </p>', ], ], 'CustomLineItemAssociationsList' => [ 'base' => NULL, 'refs' => [ 'CustomLineItemPercentageChargeDetails$AssociatedValues' => '<p> A list of resource ARNs to associate to the percentage custom line item. </p>', ], ], 'CustomLineItemBatchAssociationsList' => [ 'base' => NULL, 'refs' => [ 'BatchAssociateResourcesToCustomLineItemInput$ResourceArns' => '<p> A list containing the ARNs of the resources to be associated. </p>', ], ], 'CustomLineItemBatchDisassociationsList' => [ 'base' => NULL, 'refs' => [ 'BatchDisassociateResourcesFromCustomLineItemInput$ResourceArns' => '<p> A list containing the ARNs of resources to be disassociated. </p>', ], ], 'CustomLineItemBillingPeriodRange' => [ 'base' => '<p> The billing period range in which the custom line item request will be applied. </p>', 'refs' => [ 'BatchAssociateResourcesToCustomLineItemInput$BillingPeriodRange' => NULL, 'BatchDisassociateResourcesFromCustomLineItemInput$BillingPeriodRange' => NULL, 'CreateCustomLineItemInput$BillingPeriodRange' => '<p> A time range for which the custom line item is effective. </p>', 'DeleteCustomLineItemInput$BillingPeriodRange' => NULL, 'UpdateCustomLineItemInput$BillingPeriodRange' => NULL, ], ], 'CustomLineItemChargeDetails' => [ 'base' => '<p> The charge details of a custom line item. It should contain only one of <code>Flat</code> or <code>Percentage</code>. </p>', 'refs' => [ 'CreateCustomLineItemInput$ChargeDetails' => '<p> A <code>CustomLineItemChargeDetails</code> that describes the charge details for a custom line item. </p>', ], ], 'CustomLineItemChargeValue' => [ 'base' => NULL, 'refs' => [ 'CustomLineItemFlatChargeDetails$ChargeValue' => '<p> The custom line item\\'s fixed charge value in USD. </p>', 'ListCustomLineItemFlatChargeDetails$ChargeValue' => '<p> The custom line item\\'s fixed charge value in USD. </p>', 'UpdateCustomLineItemFlatChargeDetails$ChargeValue' => '<p> The custom line item\\'s new fixed charge value in USD. </p>', ], ], 'CustomLineItemDescription' => [ 'base' => NULL, 'refs' => [ 'CreateCustomLineItemInput$Description' => '<p> The description of the custom line item. This is shown on the Bills page in association with the charge value. </p>', 'CustomLineItemListElement$Description' => '<p> The custom line item\\'s description. This is shown on the Bills page in association with the charge value. </p>', 'CustomLineItemVersionListElement$Description' => '<p>The description of the custom line item.</p>', 'UpdateCustomLineItemInput$Description' => '<p> The new line item description of the custom line item. </p>', 'UpdateCustomLineItemOutput$Description' => '<p> The description of the successfully updated custom line item. </p>', ], ], 'CustomLineItemFlatChargeDetails' => [ 'base' => '<p> A representation of the charge details that are associated with a flat custom line item. </p>', 'refs' => [ 'CustomLineItemChargeDetails$Flat' => '<p> A <code>CustomLineItemFlatChargeDetails</code> that describes the charge details of a flat custom line item. </p>', ], ], 'CustomLineItemList' => [ 'base' => NULL, 'refs' => [ 'ListCustomLineItemsOutput$CustomLineItems' => '<p> A list of <code>FreeFormLineItemListElements</code> received. </p>', ], ], 'CustomLineItemListElement' => [ 'base' => '<p> A representation of a custom line item. </p>', 'refs' => [ 'CustomLineItemList$member' => NULL, ], ], 'CustomLineItemName' => [ 'base' => NULL, 'refs' => [ 'CreateCustomLineItemInput$Name' => '<p> The name of the custom line item. </p>', 'CustomLineItemListElement$Name' => '<p> The custom line item\\'s name. </p>', 'CustomLineItemNameList$member' => NULL, 'CustomLineItemVersionListElement$Name' => '<p>The name of the custom line item.</p>', 'UpdateCustomLineItemInput$Name' => '<p> The new name for the custom line item. </p>', 'UpdateCustomLineItemOutput$Name' => '<p> The name of the successfully updated custom line item. </p>', ], ], 'CustomLineItemNameList' => [ 'base' => NULL, 'refs' => [ 'ListCustomLineItemsFilter$Names' => '<p> A list of custom line items to retrieve information. </p>', ], ], 'CustomLineItemPercentageChargeDetails' => [ 'base' => '<p> A representation of the charge details that are associated with a percentage custom line item. </p>', 'refs' => [ 'CustomLineItemChargeDetails$Percentage' => '<p> A <code>CustomLineItemPercentageChargeDetails</code> that describes the charge details of a percentage custom line item. </p>', ], ], 'CustomLineItemPercentageChargeValue' => [ 'base' => NULL, 'refs' => [ 'CustomLineItemPercentageChargeDetails$PercentageValue' => '<p> The custom line item\\'s percentage value. This will be multiplied against the combined value of its associated resources to determine its charge value. </p>', 'ListCustomLineItemPercentageChargeDetails$PercentageValue' => '<p> The custom line item\\'s percentage value. This will be multiplied against the combined value of its associated resources to determine its charge value. </p>', 'UpdateCustomLineItemPercentageChargeDetails$PercentageValue' => '<p> The custom line item\\'s new percentage value. This will be multiplied against the combined value of its associated resources to determine its charge value. </p>', ], ], 'CustomLineItemProductCode' => [ 'base' => NULL, 'refs' => [ 'CustomLineItemListElement$ProductCode' => '<p> The product code that\\'s associated with the custom line item. </p>', 'CustomLineItemVersionListElement$ProductCode' => '<p>The product code that\u00e2\u20ac\u2122s associated with the custom line item.</p>', ], ], 'CustomLineItemRelationship' => [ 'base' => NULL, 'refs' => [ 'ListResourcesAssociatedToCustomLineItemFilter$Relationship' => '<p> The type of relationship between the custom line item and the associated resource. </p>', 'ListResourcesAssociatedToCustomLineItemResponseElement$Relationship' => '<p> The type of relationship between the custom line item and the associated resource. </p>', ], ], 'CustomLineItemType' => [ 'base' => NULL, 'refs' => [ 'CustomLineItemChargeDetails$Type' => '<p> The type of the custom line item that indicates whether the charge is a fee or credit. </p>', 'ListCustomLineItemChargeDetails$Type' => '<p> The type of the custom line item that indicates whether the charge is a <code>fee</code> or <code>credit</code>. </p>', ], ], 'CustomLineItemVersionList' => [ 'base' => NULL, 'refs' => [ 'ListCustomLineItemVersionsOutput$CustomLineItemVersions' => '<p>A list of <code>CustomLineItemVersionListElements</code> that are received.</p>', ], ], 'CustomLineItemVersionListElement' => [ 'base' => '<p>A representation of a custom line item version.</p>', 'refs' => [ 'CustomLineItemVersionList$member' => NULL, ], ], 'DeleteBillingGroupInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteBillingGroupOutput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteCustomLineItemInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteCustomLineItemOutput' => [ 'base' => NULL, 'refs' => [], ], 'DeletePricingPlanInput' => [ 'base' => NULL, 'refs' => [], ], 'DeletePricingPlanOutput' => [ 'base' => NULL, 'refs' => [], ], 'DeletePricingRuleInput' => [ 'base' => NULL, 'refs' => [], ], 'DeletePricingRuleOutput' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateAccountsInput' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateAccountsOutput' => [ 'base' => NULL, 'refs' => [], ], 'DisassociatePricingRulesInput' => [ 'base' => NULL, 'refs' => [], ], 'DisassociatePricingRulesOutput' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateResourceResponseElement' => [ 'base' => '<p> A resource disassociation result for a percentage custom line item. </p>', 'refs' => [ 'DisassociateResourcesResponseList$member' => NULL, ], ], 'DisassociateResourcesResponseList' => [ 'base' => NULL, 'refs' => [ 'BatchDisassociateResourcesFromCustomLineItemOutput$SuccessfullyDisassociatedResources' => '<p> A list of <code>DisassociateResourceResponseElement</code> for each resource that\\'s been disassociated from a percentage custom line item successfully. </p>', 'BatchDisassociateResourcesFromCustomLineItemOutput$FailedDisassociatedResources' => '<p> A list of <code>DisassociateResourceResponseElement</code> for each resource that failed disassociation from a percentage custom line item. </p>', ], ], 'FreeTierConfig' => [ 'base' => '<p> The possible Amazon Web Services Free Tier configurations. </p>', 'refs' => [ 'Tiering$FreeTier' => '<p> The possible Amazon Web Services Free Tier configurations. </p>', ], ], 'Instant' => [ 'base' => NULL, 'refs' => [ 'BillingGroupListElement$CreationTime' => '<p> The time when the billing group was created. </p>', 'BillingGroupListElement$LastModifiedTime' => '<p> The most recent time when the billing group was modified. </p>', 'CustomLineItemListElement$CreationTime' => '<p> The time created. </p>', 'CustomLineItemListElement$LastModifiedTime' => '<p> The most recent time when the custom line item was modified. </p>', 'CustomLineItemVersionListElement$CreationTime' => '<p>The time when the custom line item version was created.</p>', 'CustomLineItemVersionListElement$LastModifiedTime' => '<p>The most recent time that the custom line item version was modified.</p>', 'CustomLineItemVersionListElement$StartTime' => '<p> The inclusive start time. </p>', 'PricingPlanListElement$CreationTime' => '<p> The time when the pricing plan was created. </p>', 'PricingPlanListElement$LastModifiedTime' => '<p> The most recent time when the pricing plan was modified. </p>', 'PricingRuleListElement$CreationTime' => '<p> The time when the pricing rule was created. </p>', 'PricingRuleListElement$LastModifiedTime' => '<p> The most recent time when the pricing rule was modified. </p>', 'UpdateBillingGroupOutput$LastModifiedTime' => '<p> The most recent time when the billing group was modified. </p>', 'UpdateCustomLineItemOutput$LastModifiedTime' => '<p> The most recent time when the custom line item was modified. </p>', 'UpdatePricingPlanOutput$LastModifiedTime' => '<p> The most recent time when the pricing plan was modified. </p>', 'UpdatePricingRuleOutput$LastModifiedTime' => '<p> The most recent time the pricing rule was modified. </p>', ], ], 'InternalServerException' => [ 'base' => '<p>An unexpected error occurred while processing a request. </p>', 'refs' => [], ], 'ListAccountAssociationsFilter' => [ 'base' => '<p>The filter on the account ID of the linked account, or any of the following:</p> <p> <code>MONITORED</code>: linked accounts that are associated to billing groups.</p> <p> <code>UNMONITORED</code>: linked accounts that are not associated to billing groups.</p> <p> <code>Billing Group Arn</code>: linked accounts that are associated to the provided Billing Group Arn. </p>', 'refs' => [ 'ListAccountAssociationsInput$Filters' => '<p>The filter on the account ID of the linked account, or any of the following:</p> <p> <code>MONITORED</code>: linked accounts that are associated to billing groups.</p> <p> <code>UNMONITORED</code>: linked accounts that aren\\'t associated to billing groups.</p> <p> <code>Billing Group Arn</code>: linked accounts that are associated to the provided billing group Arn. </p>', ], ], 'ListAccountAssociationsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListAccountAssociationsOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListBillingGroupCostReportsFilter' => [ 'base' => '<p>The filter used to retrieve specific <code>BillingGroupCostReportElements</code>. </p>', 'refs' => [ 'ListBillingGroupCostReportsInput$Filters' => '<p>A <code>ListBillingGroupCostReportsFilter</code> to specify billing groups to retrieve reports from. </p>', ], ], 'ListBillingGroupCostReportsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListBillingGroupCostReportsOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListBillingGroupsFilter' => [ 'base' => '<p>The filter that specifies the billing groups and pricing plans to retrieve billing group information. </p>', 'refs' => [ 'ListBillingGroupsInput$Filters' => '<p>A <code>ListBillingGroupsFilter</code> that specifies the billing group and pricing plan to retrieve billing group information. </p>', ], ], 'ListBillingGroupsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListBillingGroupsOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListCustomLineItemChargeDetails' => [ 'base' => '<p> A representation of the charge details of a custom line item. </p>', 'refs' => [ 'CustomLineItemListElement$ChargeDetails' => '<p> A <code>ListCustomLineItemChargeDetails</code> that describes the charge details of a custom line item. </p>', 'CustomLineItemVersionListElement$ChargeDetails' => NULL, 'UpdateCustomLineItemOutput$ChargeDetails' => '<p> A <code>ListCustomLineItemChargeDetails</code> containing the charge details of the successfully updated custom line item. </p>', ], ], 'ListCustomLineItemFlatChargeDetails' => [ 'base' => '<p> A representation of the charge details that are associated with a flat custom line item. </p>', 'refs' => [ 'ListCustomLineItemChargeDetails$Flat' => '<p> A <code>ListCustomLineItemFlatChargeDetails</code> that describes the charge details of a flat custom line item. </p>', ], ], 'ListCustomLineItemPercentageChargeDetails' => [ 'base' => '<p> A representation of the charge details that are associated with a percentage custom line item. </p>', 'refs' => [ 'ListCustomLineItemChargeDetails$Percentage' => '<p> A <code>ListCustomLineItemPercentageChargeDetails</code> that describes the charge details of a percentage custom line item. </p>', ], ], 'ListCustomLineItemVersionsBillingPeriodRangeFilter' => [ 'base' => '<p>A billing period filter that specifies the custom line item versions to retrieve.</p>', 'refs' => [ 'ListCustomLineItemVersionsFilter$BillingPeriodRange' => '<p>The billing period range in which the custom line item version is applied.</p>', ], ], 'ListCustomLineItemVersionsFilter' => [ 'base' => '<p>A filter that specifies the billing period range where the custom line item versions reside.</p>', 'refs' => [ 'ListCustomLineItemVersionsInput$Filters' => '<p>A <code>ListCustomLineItemVersionsFilter</code> that specifies the billing period range in which the custom line item versions are applied.</p>', ], ], 'ListCustomLineItemVersionsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListCustomLineItemVersionsOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListCustomLineItemsFilter' => [ 'base' => '<p> A filter that specifies the custom line items and billing groups to retrieve FFLI information. </p>', 'refs' => [ 'ListCustomLineItemsInput$Filters' => '<p>A <code>ListCustomLineItemsFilter</code> that specifies the custom line item names and/or billing group Amazon Resource Names (ARNs) to retrieve FFLI information.</p>', ], ], 'ListCustomLineItemsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListCustomLineItemsOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListPricingPlansAssociatedWithPricingRuleInput' => [ 'base' => NULL, 'refs' => [], ], 'ListPricingPlansAssociatedWithPricingRuleOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListPricingPlansFilter' => [ 'base' => '<p>The filter that specifies the Amazon Resource Names (ARNs) of pricing plans, to retrieve pricing plan information. </p>', 'refs' => [ 'ListPricingPlansInput$Filters' => '<p>A <code>ListPricingPlansFilter</code> that specifies the Amazon Resource Name (ARNs) of pricing plans to retrieve pricing plans information.</p>', ], ], 'ListPricingPlansInput' => [ 'base' => NULL, 'refs' => [], ], 'ListPricingPlansOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListPricingRulesAssociatedToPricingPlanInput' => [ 'base' => NULL, 'refs' => [], ], 'ListPricingRulesAssociatedToPricingPlanOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListPricingRulesFilter' => [ 'base' => '<p> The filter that specifies criteria that the pricing rules returned by the <code>ListPricingRules</code> API will adhere to. </p>', 'refs' => [ 'ListPricingRulesInput$Filters' => '<p> A <code>DescribePricingRuleFilter</code> that specifies the Amazon Resource Name (ARNs) of pricing rules to retrieve pricing rules information. </p>', ], ], 'ListPricingRulesInput' => [ 'base' => NULL, 'refs' => [], ], 'ListPricingRulesOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListResourcesAssociatedToCustomLineItemFilter' => [ 'base' => '<p> A filter that specifies the type of resource associations that should be retrieved for a custom line item. </p>', 'refs' => [ 'ListResourcesAssociatedToCustomLineItemInput$Filters' => '<p> (Optional) A <code>ListResourcesAssociatedToCustomLineItemFilter</code> that can specify the types of resources that should be retrieved. </p>', ], ], 'ListResourcesAssociatedToCustomLineItemInput' => [ 'base' => NULL, 'refs' => [], ], 'ListResourcesAssociatedToCustomLineItemOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListResourcesAssociatedToCustomLineItemResponseElement' => [ 'base' => '<p> A representation of a resource association for a custom line item. </p>', 'refs' => [ 'ListResourcesAssociatedToCustomLineItemResponseList$member' => NULL, ], ], 'ListResourcesAssociatedToCustomLineItemResponseList' => [ 'base' => NULL, 'refs' => [ 'ListResourcesAssociatedToCustomLineItemOutput$AssociatedResources' => '<p> A list of <code>ListResourcesAssociatedToCustomLineItemResponseElement</code> for each resource association retrieved. </p>', ], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'Margin' => [ 'base' => NULL, 'refs' => [ 'BillingGroupCostReportElement$Margin' => '<p> The billing group margin. </p>', ], ], 'MarginPercentage' => [ 'base' => NULL, 'refs' => [ 'BillingGroupCostReportElement$MarginPercentage' => '<p> The percentage of billing group margin. </p>', ], ], 'MaxBillingGroupResults' => [ 'base' => NULL, 'refs' => [ 'ListBillingGroupCostReportsInput$MaxResults' => '<p>The maximum number of reports to retrieve. </p>', 'ListBillingGroupsInput$MaxResults' => '<p>The maximum number of billing groups to retrieve. </p>', ], ], 'MaxCustomLineItemResults' => [ 'base' => NULL, 'refs' => [ 'ListCustomLineItemVersionsInput$MaxResults' => '<p>The maximum number of custom line item versions to retrieve.</p>', 'ListCustomLineItemsInput$MaxResults' => '<p> The maximum number of billing groups to retrieve. </p>', 'ListResourcesAssociatedToCustomLineItemInput$MaxResults' => '<p> (Optional) The maximum number of resource associations to be retrieved. </p>', ], ], 'MaxPricingPlanResults' => [ 'base' => NULL, 'refs' => [ 'ListPricingPlansInput$MaxResults' => '<p>The maximum number of pricing plans to retrieve.</p>', 'ListPricingRulesAssociatedToPricingPlanInput$MaxResults' => '<p>The optional maximum number of pricing rule associations to retrieve.</p>', ], ], 'MaxPricingRuleResults' => [ 'base' => NULL, 'refs' => [ 'ListPricingPlansAssociatedWithPricingRuleInput$MaxResults' => '<p> The optional maximum number of pricing rule associations to retrieve. </p>', 'ListPricingRulesInput$MaxResults' => '<p> The maximum number of pricing rules to retrieve. </p>', ], ], 'ModifierPercentage' => [ 'base' => NULL, 'refs' => [ 'CreatePricingRuleInput$ModifierPercentage' => '<p> A percentage modifier that\\'s applied on the public pricing rates. </p>', 'PricingRuleListElement$ModifierPercentage' => '<p> A percentage modifier applied on the public pricing rates. </p>', 'UpdatePricingRuleInput$ModifierPercentage' => '<p> The new modifier to show pricing plan rates as a percentage. </p>', 'UpdatePricingRuleOutput$ModifierPercentage' => '<p> The new modifier to show pricing plan rates as a percentage. </p>', ], ], 'NumberOfAccounts' => [ 'base' => NULL, 'refs' => [ 'BillingGroupListElement$Size' => '<p>The number of accounts in the particular billing group. </p>', 'UpdateBillingGroupOutput$Size' => '<p> The number of accounts in the particular billing group. </p>', ], ], 'NumberOfAssociatedPricingRules' => [ 'base' => NULL, 'refs' => [ 'PricingPlanListElement$Size' => '<p> The pricing rules count that\\'s currently associated with this pricing plan list element. </p>', 'UpdatePricingPlanOutput$Size' => '<p> The pricing rules count that\\'s currently associated with this pricing plan list. </p>', ], ], 'NumberOfAssociations' => [ 'base' => NULL, 'refs' => [ 'CustomLineItemListElement$AssociationSize' => '<p> The number of resources that are associated to the custom line item. </p>', 'CustomLineItemVersionListElement$AssociationSize' => '<p>The number of resources that are associated with the custom line item.</p>', 'UpdateCustomLineItemOutput$AssociationSize' => '<p> The number of resources that are associated to the custom line item. </p>', ], ], 'NumberOfPricingPlansAssociatedWith' => [ 'base' => NULL, 'refs' => [ 'PricingRuleListElement$AssociatedPricingPlanCount' => '<p> The pricing plans count that this pricing rule is associated with. </p>', 'UpdatePricingRuleOutput$AssociatedPricingPlanCount' => '<p> The pricing plans count that this pricing rule is associated with. </p>', ], ], 'Operation' => [ 'base' => NULL, 'refs' => [ 'CreatePricingRuleInput$Operation' => '<p> Operation is the specific Amazon Web Services action covered by this line item. This describes the specific usage of the line item.</p> <p> If the <code>Scope</code> attribute is set to <code>SKU</code>, this attribute indicates which operation the <code>PricingRule</code> is modifying. For example, a value of <code>RunInstances:0202</code> indicates the operation of running an Amazon EC2 instance.</p>', 'PricingRuleListElement$Operation' => '<p> Operation is the specific Amazon Web Services action covered by this line item. This describes the specific usage of the line item.</p> <p> If the <code>Scope</code> attribute is set to <code>SKU</code>, this attribute indicates which operation the <code>PricingRule</code> is modifying. For example, a value of <code>RunInstances:0202</code> indicates the operation of running an Amazon EC2 instance.</p>', 'UpdatePricingRuleOutput$Operation' => '<p>Operation refers to the specific Amazon Web Services covered by this line item. This describes the specific usage of the line item.</p> <p> If the <code>Scope</code> attribute is set to <code>SKU</code>, this attribute indicates which operation the <code>PricingRule</code> is modifying. For example, a value of <code>RunInstances:0202</code> indicates the operation of running an Amazon EC2 instance.</p>', ], ], 'PricingPlanArn' => [ 'base' => NULL, 'refs' => [ 'AssociatePricingRulesInput$Arn' => '<p> The <code>PricingPlanArn</code> that the <code>PricingRuleArns</code> are associated with. </p>', 'AssociatePricingRulesOutput$Arn' => '<p> The <code>PricingPlanArn</code> that the <code>PricingRuleArns</code> are associated with. </p>', 'CreatePricingPlanOutput$Arn' => '<p>The Amazon Resource Name (ARN) of the created pricing plan.</p>', 'DeletePricingPlanInput$Arn' => '<p>The Amazon Resource Name (ARN) of the pricing plan that you\\'re deleting. </p>', 'DeletePricingPlanOutput$Arn' => '<p> The Amazon Resource Name (ARN) of the deleted pricing plan. </p>', 'DisassociatePricingRulesInput$Arn' => '<p> The pricing plan Amazon Resource Name (ARN) to disassociate pricing rules from. </p>', 'DisassociatePricingRulesOutput$Arn' => '<p> The Amazon Resource Name (ARN) of the pricing plan that the pricing rules successfully disassociated from. </p>', 'ListPricingRulesAssociatedToPricingPlanInput$PricingPlanArn' => '<p> The Amazon Resource Name (ARN) of the pricing plan for which associations are to be listed.</p>', 'ListPricingRulesAssociatedToPricingPlanOutput$PricingPlanArn' => '<p> The Amazon Resource Name (ARN) of the pricing plan for which associations are listed.</p>', 'PricingPlanArns$member' => NULL, 'PricingPlanListElement$Arn' => '<p>The pricing plan Amazon Resource Names (ARN). This can be used to uniquely identify a pricing plan. </p>', 'UpdateBillingGroupOutput$PricingPlanArn' => '<p> The Amazon Resource Name (ARN) of the pricing plan to compute Amazon Web Services charges for the billing group. </p>', 'UpdatePricingPlanInput$Arn' => '<p>The Amazon Resource Name (ARN) of the pricing plan that you\\'re updating. </p>', 'UpdatePricingPlanOutput$Arn' => '<p>The Amazon Resource Name (ARN) of the updated pricing plan. </p>', ], ], 'PricingPlanArns' => [ 'base' => NULL, 'refs' => [ 'ListPricingPlansAssociatedWithPricingRuleOutput$PricingPlanArns' => '<p> The list containing pricing plans that are associated with the requested pricing rule. </p>', 'ListPricingPlansFilter$Arns' => '<p>A list of pricing plan Amazon Resource Names (ARNs) to retrieve information. </p>', ], ], 'PricingPlanDescription' => [ 'base' => NULL, 'refs' => [ 'CreatePricingPlanInput$Description' => '<p>The description of the pricing plan. </p>', 'PricingPlanListElement$Description' => '<p>The pricing plan description. </p>', 'UpdatePricingPlanInput$Description' => '<p>The description of the pricing plan. </p>', 'UpdatePricingPlanOutput$Description' => '<p> The new description for the pricing rule. </p>', ], ], 'PricingPlanFullArn' => [ 'base' => NULL, 'refs' => [ 'ComputationPreference$PricingPlanArn' => '<p> The Amazon Resource Name (ARN) of the pricing plan that\\'s used to compute the Amazon Web Services charges for a billing group. </p>', 'ListBillingGroupsFilter$PricingPlan' => '<p>The pricing plan Amazon Resource Names (ARNs) to retrieve information. </p>', ], ], 'PricingPlanList' => [ 'base' => NULL, 'refs' => [ 'ListPricingPlansOutput$PricingPlans' => '<p>A list of <code>PricingPlanListElement</code> retrieved. </p>', ], ], 'PricingPlanListElement' => [ 'base' => '<p>A representation of a pricing plan. </p>', 'refs' => [ 'PricingPlanList$member' => NULL, ], ], 'PricingPlanName' => [ 'base' => NULL, 'refs' => [ 'CreatePricingPlanInput$Name' => '<p>The name of the pricing plan. The names must be unique to each pricing plan. </p>', 'PricingPlanListElement$Name' => '<p>The name of a pricing plan. </p>', 'UpdatePricingPlanInput$Name' => '<p>The name of the pricing plan. The name must be unique to each pricing plan. </p>', 'UpdatePricingPlanOutput$Name' => '<p> The name of the pricing plan. The name must be unique to each pricing plan. </p>', ], ], 'PricingRuleArn' => [ 'base' => NULL, 'refs' => [ 'CreatePricingRuleOutput$Arn' => '<p> The Amazon Resource Name (ARN) of the created pricing rule. </p>', 'DeletePricingRuleInput$Arn' => '<p> The Amazon Resource Name (ARN) of the pricing rule that you are deleting. </p>', 'DeletePricingRuleOutput$Arn' => '<p> The Amazon Resource Name (ARN) of the deleted pricing rule. </p>', 'ListPricingPlansAssociatedWithPricingRuleInput$PricingRuleArn' => '<p> The pricing rule Amazon Resource Name (ARN) for which associations will be listed. </p>', 'ListPricingPlansAssociatedWithPricingRuleOutput$PricingRuleArn' => '<p> The pricing rule Amazon Resource Name (ARN) for which associations will be listed. </p>', 'PricingRuleArns$member' => NULL, 'PricingRuleArnsInput$member' => NULL, 'PricingRuleArnsNonEmptyInput$member' => NULL, 'PricingRuleListElement$Arn' => '<p> The Amazon Resource Name (ARN) used to uniquely identify a pricing rule. </p>', 'UpdatePricingRuleInput$Arn' => '<p> The Amazon Resource Name (ARN) of the pricing rule to update. </p>', 'UpdatePricingRuleOutput$Arn' => '<p> The Amazon Resource Name (ARN) of the successfully updated pricing rule. </p>', ], ], 'PricingRuleArns' => [ 'base' => NULL, 'refs' => [ 'ListPricingRulesAssociatedToPricingPlanOutput$PricingRuleArns' => '<p> A list containing pricing rules that are associated with the requested pricing plan. </p>', 'ListPricingRulesFilter$Arns' => '<p> A list containing the pricing rule Amazon Resource Names (ARNs) to include in the API response. </p>', ], ], 'PricingRuleArnsInput' => [ 'base' => NULL, 'refs' => [ 'CreatePricingPlanInput$PricingRuleArns' => '<p> A list of Amazon Resource Names (ARNs) that define the pricing plan parameters. </p>', ], ], 'PricingRuleArnsNonEmptyInput' => [ 'base' => NULL, 'refs' => [ 'AssociatePricingRulesInput$PricingRuleArns' => '<p> The <code>PricingRuleArns</code> that are associated with the Pricing Plan. </p>', 'DisassociatePricingRulesInput$PricingRuleArns' => '<p> A list containing the Amazon Resource Name (ARN) of the pricing rules that will be disassociated. </p>', ], ], 'PricingRuleDescription' => [ 'base' => NULL, 'refs' => [ 'CreatePricingRuleInput$Description' => '<p> The pricing rule description. </p>', 'PricingRuleListElement$Description' => '<p> The pricing rule description. </p>', 'UpdatePricingRuleInput$Description' => '<p> The new description for the pricing rule. </p>', 'UpdatePricingRuleOutput$Description' => '<p> The new description for the pricing rule. </p>', ], ], 'PricingRuleList' => [ 'base' => NULL, 'refs' => [ 'ListPricingRulesOutput$PricingRules' => '<p> A list containing the described pricing rules. </p>', ], ], 'PricingRuleListElement' => [ 'base' => '<p> A representation of a pricing rule. </p>', 'refs' => [ 'PricingRuleList$member' => NULL, ], ], 'PricingRuleName' => [ 'base' => NULL, 'refs' => [ 'CreatePricingRuleInput$Name' => '<p> The pricing rule name. The names must be unique to each pricing rule. </p>', 'PricingRuleListElement$Name' => '<p> The name of a pricing rule. </p>', 'UpdatePricingRuleInput$Name' => '<p> The new name of the pricing rule. The name must be unique to each pricing rule. </p>', 'UpdatePricingRuleOutput$Name' => '<p> The new name of the pricing rule. The name must be unique to each pricing rule. </p>', ], ], 'PricingRuleScope' => [ 'base' => NULL, 'refs' => [ 'CreatePricingRuleInput$Scope' => '<p> The scope of pricing rule that indicates if it\\'s globally applicable, or it\\'s service-specific. </p>', 'PricingRuleListElement$Scope' => '<p> The scope of pricing rule that indicates if it is globally applicable, or if it is service-specific. </p>', 'UpdatePricingRuleOutput$Scope' => '<p> The scope of pricing rule that indicates if it\\'s globally applicable, or it\\'s service-specific. </p>', ], ], 'PricingRuleType' => [ 'base' => NULL, 'refs' => [ 'CreatePricingRuleInput$Type' => '<p> The type of pricing rule. </p>', 'PricingRuleListElement$Type' => '<p> The type of pricing rule. </p>', 'UpdatePricingRuleInput$Type' => '<p> The new pricing rule type. </p>', 'UpdatePricingRuleOutput$Type' => '<p> The new pricing rule type. </p>', ], ], 'ProformaCost' => [ 'base' => NULL, 'refs' => [ 'BillingGroupCostReportElement$ProformaCost' => '<p>The hypothetical Amazon Web Services charges based on the associated pricing plan of a billing group. </p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p>The request references a resource that doesn\\'t exist. </p>', 'refs' => [], ], 'RetryAfterSeconds' => [ 'base' => NULL, 'refs' => [ 'InternalServerException$RetryAfterSeconds' => '<p>Number of seconds you can retry after the call. </p>', 'ThrottlingException$RetryAfterSeconds' => '<p>Number of seconds you can safely retry after the call. </p>', ], ], 'Service' => [ 'base' => NULL, 'refs' => [ 'CreatePricingRuleInput$Service' => '<p> If the <code>Scope</code> attribute is set to <code>SERVICE</code> or <code>SKU</code>, the attribute indicates which service the <code>PricingRule</code> is applicable for. </p>', 'PricingRuleListElement$Service' => '<p> If the <code>Scope</code> attribute is <code>SERVICE</code>, this attribute indicates which service the <code>PricingRule</code> is applicable for. </p>', 'UpdatePricingRuleOutput$Service' => '<p> If the <code>Scope</code> attribute is set to <code>SERVICE</code>, the attribute indicates which service the <code>PricingRule</code> is applicable for. </p>', ], ], 'ServiceLimitExceededException' => [ 'base' => '<p>The request would cause a service limit to exceed. </p>', 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$Message' => NULL, 'AssociateResourceError$Message' => '<p> The reason why the resource association failed. </p>', 'ConflictException$Message' => NULL, 'ConflictException$ResourceId' => '<p>Identifier of the resource in use. </p>', 'ConflictException$ResourceType' => '<p>Type of the resource in use. </p>', 'InternalServerException$Message' => NULL, 'ResourceNotFoundException$Message' => NULL, 'ResourceNotFoundException$ResourceId' => '<p>Resource identifier that was not found. </p>', 'ResourceNotFoundException$ResourceType' => '<p>Resource type that was not found. </p>', 'ServiceLimitExceededException$Message' => NULL, 'ServiceLimitExceededException$ResourceId' => '<p>Identifier of the resource affected. </p>', 'ServiceLimitExceededException$ResourceType' => '<p>Type of the resource affected. </p>', 'ServiceLimitExceededException$LimitCode' => '<p>The unique code identifier of the service limit that is being exceeded. </p>', 'ServiceLimitExceededException$ServiceCode' => '<p>The unique code for the service of the limit that is being exceeded. </p>', 'ThrottlingException$Message' => NULL, 'ValidationException$Message' => NULL, 'ValidationExceptionField$Name' => '<p>The field name. </p>', 'ValidationExceptionField$Message' => '<p>The message describing why the field failed validation. </p>', ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'TagKeyList$member' => NULL, 'TagMap$key' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$TagKeys' => '<p> The tags to delete from the resource as a list of key-value pairs. </p>', ], ], 'TagMap' => [ 'base' => NULL, 'refs' => [ 'CreateBillingGroupInput$Tags' => '<p> A map that contains tag keys and tag values that are attached to a billing group. This feature isn\\'t available during the beta. </p>', 'CreateCustomLineItemInput$Tags' => '<p> A map that contains tag keys and tag values that are attached to a custom line item. </p>', 'CreatePricingPlanInput$Tags' => '<p> A map that contains tag keys and tag values that are attached to a pricing plan. </p>', 'CreatePricingRuleInput$Tags' => '<p> A map that contains tag keys and tag values that are attached to a pricing rule. </p>', 'ListTagsForResourceResponse$Tags' => '<p> The tags for the resource. </p>', 'TagResourceRequest$Tags' => '<p> The tags to add to the resource as a list of key-value pairs. </p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'TagMap$value' => NULL, ], ], 'ThrottlingException' => [ 'base' => '<p>The request was denied due to request throttling. </p>', 'refs' => [], ], 'Tiering' => [ 'base' => '<p> The set of tiering configurations for the pricing rule. </p>', 'refs' => [ 'PricingRuleListElement$Tiering' => '<p> The set of tiering configurations for the pricing rule. </p>', ], ], 'TieringActivated' => [ 'base' => NULL, 'refs' => [ 'CreateFreeTierConfig$Activated' => '<p> Activate or deactivate Amazon Web Services Free Tier. </p>', 'FreeTierConfig$Activated' => '<p> Activate or deactivate Amazon Web Services Free Tier application. </p>', 'UpdateFreeTierConfig$Activated' => '<p> Activate or deactivate application of Amazon Web Services Free Tier. </p>', ], ], 'Token' => [ 'base' => NULL, 'refs' => [ 'ListAccountAssociationsInput$NextToken' => '<p> The pagination token that\\'s used on subsequent calls to retrieve accounts. </p>', 'ListAccountAssociationsOutput$NextToken' => '<p> The pagination token that\\'s used on subsequent calls to get accounts. </p>', 'ListBillingGroupCostReportsInput$NextToken' => '<p>The pagination token that\\'s used on subsequent calls to get reports. </p>', 'ListBillingGroupCostReportsOutput$NextToken' => '<p>The pagination token that\\'s used on subsequent calls to get reports. </p>', 'ListBillingGroupsInput$NextToken' => '<p>The pagination token that\\'s used on subsequent calls to get billing groups. </p>', 'ListBillingGroupsOutput$NextToken' => '<p>The pagination token that\\'s used on subsequent calls to get billing groups. </p>', 'ListCustomLineItemVersionsInput$NextToken' => '<p>The pagination token that\\'s used on subsequent calls to retrieve custom line item versions.</p>', 'ListCustomLineItemVersionsOutput$NextToken' => '<p>The pagination token that\\'s used on subsequent calls to retrieve custom line item versions.</p>', 'ListCustomLineItemsInput$NextToken' => '<p> The pagination token that\\'s used on subsequent calls to get custom line items (FFLIs). </p>', 'ListCustomLineItemsOutput$NextToken' => '<p> The pagination token that\\'s used on subsequent calls to get custom line items (FFLIs). </p>', 'ListPricingPlansAssociatedWithPricingRuleInput$NextToken' => '<p> The optional pagination token returned by a previous call. </p>', 'ListPricingPlansAssociatedWithPricingRuleOutput$NextToken' => '<p> The pagination token to be used on subsequent calls. </p>', 'ListPricingPlansInput$NextToken' => '<p>The pagination token that\\'s used on subsequent call to get pricing plans. </p>', 'ListPricingPlansOutput$NextToken' => '<p>The pagination token that\\'s used on subsequent calls to get pricing plans. </p>', 'ListPricingRulesAssociatedToPricingPlanInput$NextToken' => '<p> The optional pagination token returned by a previous call. </p>', 'ListPricingRulesAssociatedToPricingPlanOutput$NextToken' => '<p> The pagination token to be used on subsequent calls. </p>', 'ListPricingRulesInput$NextToken' => '<p> The pagination token that\\'s used on subsequent call to get pricing rules. </p>', 'ListPricingRulesOutput$NextToken' => '<p> The pagination token that\\'s used on subsequent calls to get pricing rules. </p>', 'ListResourcesAssociatedToCustomLineItemInput$NextToken' => '<p> (Optional) The pagination token that\\'s returned by a previous request. </p>', 'ListResourcesAssociatedToCustomLineItemOutput$NextToken' => '<p> The pagination token to be used in subsequent requests to retrieve additional results. </p>', ], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateBillingGroupInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateBillingGroupOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateCustomLineItemChargeDetails' => [ 'base' => '<p> A representation of the new charge details of a custom line item. This should contain only one of <code>Flat</code> or <code>Percentage</code>. </p>', 'refs' => [ 'UpdateCustomLineItemInput$ChargeDetails' => '<p> A <code>ListCustomLineItemChargeDetails</code> containing the new charge details for the custom line item. </p>', ], ], 'UpdateCustomLineItemFlatChargeDetails' => [ 'base' => '<p> A representation of the new charge details that are associated with a flat custom line item. </p>', 'refs' => [ 'UpdateCustomLineItemChargeDetails$Flat' => '<p> An <code>UpdateCustomLineItemFlatChargeDetails</code> that describes the new charge details of a flat custom line item. </p>', ], ], 'UpdateCustomLineItemInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateCustomLineItemOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateCustomLineItemPercentageChargeDetails' => [ 'base' => '<p> A representation of the new charge details that are associated with a percentage custom line item. </p>', 'refs' => [ 'UpdateCustomLineItemChargeDetails$Percentage' => '<p> An <code>UpdateCustomLineItemPercentageChargeDetails</code> that describes the new charge details of a percentage custom line item. </p>', ], ], 'UpdateFreeTierConfig' => [ 'base' => '<p> The possible Amazon Web Services Free Tier configurations. </p>', 'refs' => [ 'UpdateTieringInput$FreeTier' => '<p> The possible Amazon Web Services Free Tier configurations. </p>', ], ], 'UpdatePricingPlanInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdatePricingPlanOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdatePricingRuleInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdatePricingRuleOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateTieringInput' => [ 'base' => '<p> The set of tiering configurations for the pricing rule. </p>', 'refs' => [ 'UpdatePricingRuleInput$Tiering' => '<p> The set of tiering configurations for the pricing rule. </p>', 'UpdatePricingRuleOutput$Tiering' => '<p> The set of tiering configurations for the pricing rule. </p>', ], ], 'UsageType' => [ 'base' => NULL, 'refs' => [ 'CreatePricingRuleInput$UsageType' => '<p> Usage type is the unit that each service uses to measure the usage of a specific type of resource.</p> <p>If the <code>Scope</code> attribute is set to <code>SKU</code>, this attribute indicates which usage type the <code>PricingRule</code> is modifying. For example, <code>USW2-BoxUsage:m2.2xlarge</code> describes an<code> M2 High Memory Double Extra Large</code> instance in the US West (Oregon) Region. <pre><code>&lt;/p&gt; </code></pre>', 'PricingRuleListElement$UsageType' => '<p> Usage type is the unit that each service uses to measure the usage of a specific type of resource.</p> <p>If the <code>Scope</code> attribute is set to <code>SKU</code>, this attribute indicates which usage type the <code>PricingRule</code> is modifying. For example, <code>USW2-BoxUsage:m2.2xlarge</code> describes an<code> M2 High Memory Double Extra Large</code> instance in the US West (Oregon) Region. <pre><code>&lt;/p&gt; </code></pre>', 'UpdatePricingRuleOutput$UsageType' => '<p>Usage type is the unit that each service uses to measure the usage of a specific type of resource.</p> <p>If the <code>Scope</code> attribute is set to <code>SKU</code>, this attribute indicates which usage type the <code>PricingRule</code> is modifying. For example, <code>USW2-BoxUsage:m2.2xlarge</code> describes an <code>M2 High Memory Double Extra Large</code> instance in the US West (Oregon) Region. </p>', ], ], 'ValidationException' => [ 'base' => '<p>The input doesn\\'t match with the constraints specified by Amazon Web Services services.</p>', 'refs' => [], ], 'ValidationExceptionField' => [ 'base' => '<p>The field\\'s information of a request that resulted in an exception. </p>', 'refs' => [ 'ValidationExceptionFieldList$member' => NULL, ], ], 'ValidationExceptionFieldList' => [ 'base' => NULL, 'refs' => [ 'ValidationException$Fields' => '<p>The fields that caused the error, if applicable. </p>', ], ], 'ValidationExceptionReason' => [ 'base' => NULL, 'refs' => [ 'ValidationException$Reason' => '<p>The reason the request\\'s validation failed. </p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/billingconductor/2021-07-30/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], 'aws', ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://billingconductor-fips.{Region}.api.aws', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://billingconductor-fips.{Region}.amazonaws.com', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://billingconductor.{Region}.api.aws', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://billingconductor.us-east-1.amazonaws.com', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'billingconductor', 'signingRegion' => 'us-east-1', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://billingconductor-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://billingconductor-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://billingconductor.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'ref' => 'Region', ], 'aws-global', ], ], ], 'endpoint' => [ 'url' => 'https://billingconductor.us-east-1.amazonaws.com', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'billingconductor', 'signingRegion' => 'us-east-1', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://billingconductor.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/billingconductor/2021-07-30/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region aws-global with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'billingconductor', 'signingRegion' => 'us-east-1', ], ], ], 'url' => 'https://billingconductor.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'aws-global', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://billingconductor-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://billingconductor-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://billingconductor.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'billingconductor', 'signingRegion' => 'us-east-1', ], ], ], 'url' => 'https://billingconductor.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://billingconductor-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://billingconductor-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://billingconductor.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://billingconductor.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://billingconductor-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://billingconductor-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://billingconductor.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://billingconductor.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://billingconductor-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://billingconductor.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://billingconductor-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://billingconductor.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/billingconductor/2021-07-30/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/billingconductor/2021-07-30/paginators-1.json\nreturn [ 'pagination' => [ 'ListAccountAssociations' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'result_key' => 'LinkedAccounts', ], 'ListBillingGroupCostReports' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'BillingGroupCostReports', ], 'ListBillingGroups' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'BillingGroups', ], 'ListCustomLineItems' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'CustomLineItems', ], 'ListCustomLineItemVersions' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'CustomLineItemVersions', ], 'ListPricingPlans' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'non_aggregate_keys' => [ 'BillingPeriod', ], 'output_token' => 'NextToken', 'result_key' => 'PricingPlans', ], 'ListPricingPlansAssociatedWithPricingRule' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'non_aggregate_keys' => [ 'BillingPeriod', 'PricingRuleArn', ], 'output_token' => 'NextToken', 'result_key' => 'PricingPlanArns', ], 'ListPricingRules' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'non_aggregate_keys' => [ 'BillingPeriod', ], 'output_token' => 'NextToken', 'result_key' => 'PricingRules', ], 'ListPricingRulesAssociatedToPricingPlan' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'non_aggregate_keys' => [ 'BillingPeriod', 'PricingPlanArn', ], 'output_token' => 'NextToken', 'result_key' => 'PricingRuleArns', ], 'ListResourcesAssociatedToCustomLineItem' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'non_aggregate_keys' => [ 'Arn', ], 'output_token' => 'NextToken', 'result_key' => 'AssociatedResources', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/billingconductor/2021-07-30/smoke.json\nreturn [ 'version' => 1, 'defaultRegion' => 'us-east-1', 'testCases' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/billingconductor/2021-07-30/waiters-2.json\nreturn [ 'version' => 2, 'waiters' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/braket/2019-09-01/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2019-09-01', 'endpointPrefix' => 'braket', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'Braket', 'serviceId' => 'Braket', 'signatureVersion' => 'v4', 'signingName' => 'braket', 'uid' => 'braket-2019-09-01', ], 'operations' => [ 'CancelJob' => [ 'name' => 'CancelJob', 'http' => [ 'method' => 'PUT', 'requestUri' => '/job/{jobArn}/cancel', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CancelJobRequest', ], 'output' => [ 'shape' => 'CancelJobResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], ], 'idempotent' => true, ], 'CancelQuantumTask' => [ 'name' => 'CancelQuantumTask', 'http' => [ 'method' => 'PUT', 'requestUri' => '/quantum-task/{quantumTaskArn}/cancel', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CancelQuantumTaskRequest', ], 'output' => [ 'shape' => 'CancelQuantumTaskResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], ], 'idempotent' => true, ], 'CreateJob' => [ 'name' => 'CreateJob', 'http' => [ 'method' => 'POST', 'requestUri' => '/job', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateJobRequest', ], 'output' => [ 'shape' => 'CreateJobResponse', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'DeviceRetiredException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ValidationException', ], ], ], 'CreateQuantumTask' => [ 'name' => 'CreateQuantumTask', 'http' => [ 'method' => 'POST', 'requestUri' => '/quantum-task', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateQuantumTaskRequest', ], 'output' => [ 'shape' => 'CreateQuantumTaskResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'DeviceOfflineException', ], [ 'shape' => 'DeviceRetiredException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ValidationException', ], ], ], 'GetDevice' => [ 'name' => 'GetDevice', 'http' => [ 'method' => 'GET', 'requestUri' => '/device/{deviceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetDeviceRequest', ], 'output' => [ 'shape' => 'GetDeviceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], ], ], 'GetJob' => [ 'name' => 'GetJob', 'http' => [ 'method' => 'GET', 'requestUri' => '/job/{jobArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetJobRequest', ], 'output' => [ 'shape' => 'GetJobResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], ], ], 'GetQuantumTask' => [ 'name' => 'GetQuantumTask', 'http' => [ 'method' => 'GET', 'requestUri' => '/quantum-task/{quantumTaskArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetQuantumTaskRequest', ], 'output' => [ 'shape' => 'GetQuantumTaskResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags/{resourceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], ], ], 'SearchDevices' => [ 'name' => 'SearchDevices', 'http' => [ 'method' => 'POST', 'requestUri' => '/devices', 'responseCode' => 200, ], 'input' => [ 'shape' => 'SearchDevicesRequest', ], 'output' => [ 'shape' => 'SearchDevicesResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], ], ], 'SearchJobs' => [ 'name' => 'SearchJobs', 'http' => [ 'method' => 'POST', 'requestUri' => '/jobs', 'responseCode' => 200, ], 'input' => [ 'shape' => 'SearchJobsRequest', ], 'output' => [ 'shape' => 'SearchJobsResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], ], ], 'SearchQuantumTasks' => [ 'name' => 'SearchQuantumTasks', 'http' => [ 'method' => 'POST', 'requestUri' => '/quantum-tasks', 'responseCode' => 200, ], 'input' => [ 'shape' => 'SearchQuantumTasksRequest', ], 'output' => [ 'shape' => 'SearchQuantumTasksResponse', ], 'errors' => [ [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags/{resourceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/tags/{resourceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], ], 'idempotent' => true, ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 403, 'senderFault' => true, ], 'exception' => true, ], 'AlgorithmSpecification' => [ 'type' => 'structure', 'members' => [ 'containerImage' => [ 'shape' => 'ContainerImage', ], 'scriptModeConfig' => [ 'shape' => 'ScriptModeConfig', ], ], ], 'CancelJobRequest' => [ 'type' => 'structure', 'required' => [ 'jobArn', ], 'members' => [ 'jobArn' => [ 'shape' => 'JobArn', 'location' => 'uri', 'locationName' => 'jobArn', ], ], ], 'CancelJobResponse' => [ 'type' => 'structure', 'required' => [ 'cancellationStatus', 'jobArn', ], 'members' => [ 'cancellationStatus' => [ 'shape' => 'CancellationStatus', ], 'jobArn' => [ 'shape' => 'JobArn', ], ], ], 'CancelQuantumTaskRequest' => [ 'type' => 'structure', 'required' => [ 'clientToken', 'quantumTaskArn', ], 'members' => [ 'clientToken' => [ 'shape' => 'String64', 'idempotencyToken' => true, ], 'quantumTaskArn' => [ 'shape' => 'QuantumTaskArn', 'location' => 'uri', 'locationName' => 'quantumTaskArn', ], ], ], 'CancelQuantumTaskResponse' => [ 'type' => 'structure', 'required' => [ 'cancellationStatus', 'quantumTaskArn', ], 'members' => [ 'cancellationStatus' => [ 'shape' => 'CancellationStatus', ], 'quantumTaskArn' => [ 'shape' => 'QuantumTaskArn', ], ], ], 'CancellationStatus' => [ 'type' => 'string', 'enum' => [ 'CANCELLING', 'CANCELLED', ], ], 'CompressionType' => [ 'type' => 'string', 'enum' => [ 'NONE', 'GZIP', ], ], 'ConflictException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'ContainerImage' => [ 'type' => 'structure', 'required' => [ 'uri', ], 'members' => [ 'uri' => [ 'shape' => 'Uri', ], ], ], 'CreateJobRequest' => [ 'type' => 'structure', 'required' => [ 'algorithmSpecification', 'clientToken', 'deviceConfig', 'instanceConfig', 'jobName', 'outputDataConfig', 'roleArn', ], 'members' => [ 'algorithmSpecification' => [ 'shape' => 'AlgorithmSpecification', ], 'checkpointConfig' => [ 'shape' => 'JobCheckpointConfig', ], 'clientToken' => [ 'shape' => 'String64', 'idempotencyToken' => true, ], 'deviceConfig' => [ 'shape' => 'DeviceConfig', ], 'hyperParameters' => [ 'shape' => 'HyperParameters', ], 'inputDataConfig' => [ 'shape' => 'CreateJobRequestInputDataConfigList', ], 'instanceConfig' => [ 'shape' => 'InstanceConfig', ], 'jobName' => [ 'shape' => 'CreateJobRequestJobNameString', ], 'outputDataConfig' => [ 'shape' => 'JobOutputDataConfig', ], 'roleArn' => [ 'shape' => 'RoleArn', ], 'stoppingCondition' => [ 'shape' => 'JobStoppingCondition', ], 'tags' => [ 'shape' => 'TagsMap', ], ], ], 'CreateJobRequestInputDataConfigList' => [ 'type' => 'list', 'member' => [ 'shape' => 'InputFileConfig', ], 'max' => 20, 'min' => 0, ], 'CreateJobRequestJobNameString' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'pattern' => '^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,50}$', ], 'CreateJobResponse' => [ 'type' => 'structure', 'required' => [ 'jobArn', ], 'members' => [ 'jobArn' => [ 'shape' => 'JobArn', ], ], ], 'CreateQuantumTaskRequest' => [ 'type' => 'structure', 'required' => [ 'action', 'clientToken', 'deviceArn', 'outputS3Bucket', 'outputS3KeyPrefix', 'shots', ], 'members' => [ 'action' => [ 'shape' => 'JsonValue', 'jsonvalue' => true, ], 'clientToken' => [ 'shape' => 'String64', 'idempotencyToken' => true, ], 'deviceArn' => [ 'shape' => 'DeviceArn', ], 'deviceParameters' => [ 'shape' => 'CreateQuantumTaskRequestDeviceParametersString', 'jsonvalue' => true, ], 'jobToken' => [ 'shape' => 'JobToken', ], 'outputS3Bucket' => [ 'shape' => 'CreateQuantumTaskRequestOutputS3BucketString', ], 'outputS3KeyPrefix' => [ 'shape' => 'CreateQuantumTaskRequestOutputS3KeyPrefixString', ], 'shots' => [ 'shape' => 'CreateQuantumTaskRequestShotsLong', ], 'tags' => [ 'shape' => 'TagsMap', ], ], ], 'CreateQuantumTaskRequestDeviceParametersString' => [ 'type' => 'string', 'max' => 48000, 'min' => 1, ], 'CreateQuantumTaskRequestOutputS3BucketString' => [ 'type' => 'string', 'max' => 63, 'min' => 3, ], 'CreateQuantumTaskRequestOutputS3KeyPrefixString' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, ], 'CreateQuantumTaskRequestShotsLong' => [ 'type' => 'long', 'box' => true, 'min' => 0, ], 'CreateQuantumTaskResponse' => [ 'type' => 'structure', 'required' => [ 'quantumTaskArn', ], 'members' => [ 'quantumTaskArn' => [ 'shape' => 'QuantumTaskArn', ], ], ], 'DataSource' => [ 'type' => 'structure', 'required' => [ 's3DataSource', ], 'members' => [ 's3DataSource' => [ 'shape' => 'S3DataSource', ], ], ], 'DeviceArn' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'DeviceConfig' => [ 'type' => 'structure', 'required' => [ 'device', ], 'members' => [ 'device' => [ 'shape' => 'String256', ], ], ], 'DeviceOfflineException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 424, 'senderFault' => true, ], 'exception' => true, ], 'DeviceRetiredException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 410, 'senderFault' => true, ], 'exception' => true, ], 'DeviceStatus' => [ 'type' => 'string', 'enum' => [ 'ONLINE', 'OFFLINE', 'RETIRED', ], ], 'DeviceSummary' => [ 'type' => 'structure', 'required' => [ 'deviceArn', 'deviceName', 'deviceStatus', 'deviceType', 'providerName', ], 'members' => [ 'deviceArn' => [ 'shape' => 'DeviceArn', ], 'deviceName' => [ 'shape' => 'String', ], 'deviceStatus' => [ 'shape' => 'DeviceStatus', ], 'deviceType' => [ 'shape' => 'DeviceType', ], 'providerName' => [ 'shape' => 'String', ], ], ], 'DeviceSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DeviceSummary', ], ], 'DeviceType' => [ 'type' => 'string', 'enum' => [ 'QPU', 'SIMULATOR', ], ], 'GetDeviceRequest' => [ 'type' => 'structure', 'required' => [ 'deviceArn', ], 'members' => [ 'deviceArn' => [ 'shape' => 'DeviceArn', 'location' => 'uri', 'locationName' => 'deviceArn', ], ], ], 'GetDeviceResponse' => [ 'type' => 'structure', 'required' => [ 'deviceArn', 'deviceCapabilities', 'deviceName', 'deviceStatus', 'deviceType', 'providerName', ], 'members' => [ 'deviceArn' => [ 'shape' => 'DeviceArn', ], 'deviceCapabilities' => [ 'shape' => 'JsonValue', 'jsonvalue' => true, ], 'deviceName' => [ 'shape' => 'String', ], 'deviceStatus' => [ 'shape' => 'DeviceStatus', ], 'deviceType' => [ 'shape' => 'DeviceType', ], 'providerName' => [ 'shape' => 'String', ], ], ], 'GetJobRequest' => [ 'type' => 'structure', 'required' => [ 'jobArn', ], 'members' => [ 'jobArn' => [ 'shape' => 'JobArn', 'location' => 'uri', 'locationName' => 'jobArn', ], ], ], 'GetJobResponse' => [ 'type' => 'structure', 'required' => [ 'algorithmSpecification', 'createdAt', 'instanceConfig', 'jobArn', 'jobName', 'outputDataConfig', 'roleArn', 'status', ], 'members' => [ 'algorithmSpecification' => [ 'shape' => 'AlgorithmSpecification', ], 'billableDuration' => [ 'shape' => 'Integer', ], 'checkpointConfig' => [ 'shape' => 'JobCheckpointConfig', ], 'createdAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], 'deviceConfig' => [ 'shape' => 'DeviceConfig', ], 'endedAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], 'events' => [ 'shape' => 'JobEvents', ], 'failureReason' => [ 'shape' => 'String1024', ], 'hyperParameters' => [ 'shape' => 'HyperParameters', ], 'inputDataConfig' => [ 'shape' => 'InputConfigList', ], 'instanceConfig' => [ 'shape' => 'InstanceConfig', ], 'jobArn' => [ 'shape' => 'JobArn', ], 'jobName' => [ 'shape' => 'GetJobResponseJobNameString', ], 'outputDataConfig' => [ 'shape' => 'JobOutputDataConfig', ], 'roleArn' => [ 'shape' => 'RoleArn', ], 'startedAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], 'status' => [ 'shape' => 'JobPrimaryStatus', ], 'stoppingCondition' => [ 'shape' => 'JobStoppingCondition', ], 'tags' => [ 'shape' => 'TagsMap', ], ], ], 'GetJobResponseJobNameString' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'pattern' => '^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,50}$', ], 'GetQuantumTaskRequest' => [ 'type' => 'structure', 'required' => [ 'quantumTaskArn', ], 'members' => [ 'quantumTaskArn' => [ 'shape' => 'QuantumTaskArn', 'location' => 'uri', 'locationName' => 'quantumTaskArn', ], ], ], 'GetQuantumTaskResponse' => [ 'type' => 'structure', 'required' => [ 'createdAt', 'deviceArn', 'deviceParameters', 'outputS3Bucket', 'outputS3Directory', 'quantumTaskArn', 'shots', 'status', ], 'members' => [ 'createdAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], 'deviceArn' => [ 'shape' => 'DeviceArn', ], 'deviceParameters' => [ 'shape' => 'JsonValue', 'jsonvalue' => true, ], 'endedAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], 'failureReason' => [ 'shape' => 'String', ], 'jobArn' => [ 'shape' => 'JobArn', ], 'outputS3Bucket' => [ 'shape' => 'String', ], 'outputS3Directory' => [ 'shape' => 'String', ], 'quantumTaskArn' => [ 'shape' => 'QuantumTaskArn', ], 'shots' => [ 'shape' => 'Long', ], 'status' => [ 'shape' => 'QuantumTaskStatus', ], 'tags' => [ 'shape' => 'TagsMap', ], ], ], 'HyperParameters' => [ 'type' => 'map', 'key' => [ 'shape' => 'String256', ], 'value' => [ 'shape' => 'HyperParametersValueString', ], 'max' => 100, 'min' => 0, ], 'HyperParametersValueString' => [ 'type' => 'string', 'max' => 2500, 'min' => 1, ], 'InputConfigList' => [ 'type' => 'list', 'member' => [ 'shape' => 'InputFileConfig', ], ], 'InputFileConfig' => [ 'type' => 'structure', 'required' => [ 'channelName', 'dataSource', ], 'members' => [ 'channelName' => [ 'shape' => 'InputFileConfigChannelNameString', ], 'contentType' => [ 'shape' => 'String256', ], 'dataSource' => [ 'shape' => 'DataSource', ], ], ], 'InputFileConfigChannelNameString' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '^[A-Za-z0-9\\\\.\\\\-_]+$', ], 'InstanceConfig' => [ 'type' => 'structure', 'required' => [ 'instanceType', 'volumeSizeInGb', ], 'members' => [ 'instanceCount' => [ 'shape' => 'InstanceConfigInstanceCountInteger', ], 'instanceType' => [ 'shape' => 'InstanceType', ], 'volumeSizeInGb' => [ 'shape' => 'InstanceConfigVolumeSizeInGbInteger', ], ], ], 'InstanceConfigInstanceCountInteger' => [ 'type' => 'integer', 'box' => true, 'min' => 1, ], 'InstanceConfigVolumeSizeInGbInteger' => [ 'type' => 'integer', 'box' => true, 'min' => 1, ], 'InstanceType' => [ 'type' => 'string', 'enum' => [ 'ml.m4.xlarge', 'ml.m4.2xlarge', 'ml.m4.4xlarge', 'ml.m4.10xlarge', 'ml.m4.16xlarge', 'ml.g4dn.xlarge', 'ml.g4dn.2xlarge', 'ml.g4dn.4xlarge', 'ml.g4dn.8xlarge', 'ml.g4dn.12xlarge', 'ml.g4dn.16xlarge', 'ml.m5.large', 'ml.m5.xlarge', 'ml.m5.2xlarge', 'ml.m5.4xlarge', 'ml.m5.12xlarge', 'ml.m5.24xlarge', 'ml.c4.xlarge', 'ml.c4.2xlarge', 'ml.c4.4xlarge', 'ml.c4.8xlarge', 'ml.p2.xlarge', 'ml.p2.8xlarge', 'ml.p2.16xlarge', 'ml.p3.2xlarge', 'ml.p3.8xlarge', 'ml.p3.16xlarge', 'ml.p3dn.24xlarge', 'ml.p4d.24xlarge', 'ml.c5.xlarge', 'ml.c5.2xlarge', 'ml.c5.4xlarge', 'ml.c5.9xlarge', 'ml.c5.18xlarge', 'ml.c5n.xlarge', 'ml.c5n.2xlarge', 'ml.c5n.4xlarge', 'ml.c5n.9xlarge', 'ml.c5n.18xlarge', ], ], 'Integer' => [ 'type' => 'integer', 'box' => true, ], 'InternalServiceException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'JobArn' => [ 'type' => 'string', 'pattern' => '^arn:aws[a-z\\\\-]*:braket:[a-z0-9\\\\-]*:[0-9]{12}:job/.*$', ], 'JobCheckpointConfig' => [ 'type' => 'structure', 'required' => [ 's3Uri', ], 'members' => [ 'localPath' => [ 'shape' => 'String4096', ], 's3Uri' => [ 'shape' => 'S3Path', ], ], ], 'JobEventDetails' => [ 'type' => 'structure', 'members' => [ 'eventType' => [ 'shape' => 'JobEventType', ], 'message' => [ 'shape' => 'JobEventDetailsMessageString', ], 'timeOfEvent' => [ 'shape' => 'SyntheticTimestamp_date_time', ], ], ], 'JobEventDetailsMessageString' => [ 'type' => 'string', 'max' => 2500, 'min' => 0, ], 'JobEventType' => [ 'type' => 'string', 'enum' => [ 'WAITING_FOR_PRIORITY', 'QUEUED_FOR_EXECUTION', 'STARTING_INSTANCE', 'DOWNLOADING_DATA', 'RUNNING', 'DEPRIORITIZED_DUE_TO_INACTIVITY', 'UPLOADING_RESULTS', 'COMPLETED', 'FAILED', 'MAX_RUNTIME_EXCEEDED', 'CANCELLED', ], ], 'JobEvents' => [ 'type' => 'list', 'member' => [ 'shape' => 'JobEventDetails', ], 'max' => 20, 'min' => 0, ], 'JobOutputDataConfig' => [ 'type' => 'structure', 'required' => [ 's3Path', ], 'members' => [ 'kmsKeyId' => [ 'shape' => 'String2048', ], 's3Path' => [ 'shape' => 'S3Path', ], ], ], 'JobPrimaryStatus' => [ 'type' => 'string', 'enum' => [ 'QUEUED', 'RUNNING', 'COMPLETED', 'FAILED', 'CANCELLING', 'CANCELLED', ], ], 'JobStoppingCondition' => [ 'type' => 'structure', 'members' => [ 'maxRuntimeInSeconds' => [ 'shape' => 'JobStoppingConditionMaxRuntimeInSecondsInteger', ], ], ], 'JobStoppingConditionMaxRuntimeInSecondsInteger' => [ 'type' => 'integer', 'box' => true, 'max' => 432000, 'min' => 1, ], 'JobSummary' => [ 'type' => 'structure', 'required' => [ 'createdAt', 'device', 'jobArn', 'jobName', 'status', ], 'members' => [ 'createdAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], 'device' => [ 'shape' => 'String256', ], 'endedAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], 'jobArn' => [ 'shape' => 'JobArn', ], 'jobName' => [ 'shape' => 'String', ], 'startedAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], 'status' => [ 'shape' => 'JobPrimaryStatus', ], 'tags' => [ 'shape' => 'TagsMap', ], ], ], 'JobSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'JobSummary', ], ], 'JobToken' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'JsonValue' => [ 'type' => 'string', ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', ], 'members' => [ 'resourceArn' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resourceArn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'tags' => [ 'shape' => 'TagsMap', ], ], ], 'Long' => [ 'type' => 'long', 'box' => true, ], 'QuantumTaskArn' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'QuantumTaskStatus' => [ 'type' => 'string', 'enum' => [ 'CREATED', 'QUEUED', 'RUNNING', 'COMPLETED', 'FAILED', 'CANCELLING', 'CANCELLED', ], ], 'QuantumTaskSummary' => [ 'type' => 'structure', 'required' => [ 'createdAt', 'deviceArn', 'outputS3Bucket', 'outputS3Directory', 'quantumTaskArn', 'shots', 'status', ], 'members' => [ 'createdAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], 'deviceArn' => [ 'shape' => 'DeviceArn', ], 'endedAt' => [ 'shape' => 'SyntheticTimestamp_date_time', ], 'outputS3Bucket' => [ 'shape' => 'String', ], 'outputS3Directory' => [ 'shape' => 'String', ], 'quantumTaskArn' => [ 'shape' => 'QuantumTaskArn', ], 'shots' => [ 'shape' => 'Long', ], 'status' => [ 'shape' => 'QuantumTaskStatus', ], 'tags' => [ 'shape' => 'TagsMap', ], ], ], 'QuantumTaskSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'QuantumTaskSummary', ], ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'RoleArn' => [ 'type' => 'string', 'pattern' => '^arn:aws[a-z\\\\-]*:iam::\\\\d{12}:role/?[a-zA-Z_0-9+=,.@\\\\-_/]+$', ], 'S3DataSource' => [ 'type' => 'structure', 'required' => [ 's3Uri', ], 'members' => [ 's3Uri' => [ 'shape' => 'S3Path', ], ], ], 'S3Path' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'pattern' => '^(https|s3)://([^/]+)/?(.*)$', ], 'ScriptModeConfig' => [ 'type' => 'structure', 'required' => [ 'entryPoint', 's3Uri', ], 'members' => [ 'compressionType' => [ 'shape' => 'CompressionType', ], 'entryPoint' => [ 'shape' => 'String', ], 's3Uri' => [ 'shape' => 'S3Path', ], ], ], 'SearchDevicesFilter' => [ 'type' => 'structure', 'required' => [ 'name', 'values', ], 'members' => [ 'name' => [ 'shape' => 'SearchDevicesFilterNameString', ], 'values' => [ 'shape' => 'SearchDevicesFilterValuesList', ], ], ], 'SearchDevicesFilterNameString' => [ 'type' => 'string', 'max' => 64, 'min' => 1, ], 'SearchDevicesFilterValuesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String256', ], 'max' => 10, 'min' => 1, ], 'SearchDevicesRequest' => [ 'type' => 'structure', 'required' => [ 'filters', ], 'members' => [ 'filters' => [ 'shape' => 'SearchDevicesRequestFiltersList', ], 'maxResults' => [ 'shape' => 'SearchDevicesRequestMaxResultsInteger', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'SearchDevicesRequestFiltersList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SearchDevicesFilter', ], 'max' => 10, 'min' => 0, ], 'SearchDevicesRequestMaxResultsInteger' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'SearchDevicesResponse' => [ 'type' => 'structure', 'required' => [ 'devices', ], 'members' => [ 'devices' => [ 'shape' => 'DeviceSummaryList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'SearchJobsFilter' => [ 'type' => 'structure', 'required' => [ 'name', 'operator', 'values', ], 'members' => [ 'name' => [ 'shape' => 'String64', ], 'operator' => [ 'shape' => 'SearchJobsFilterOperator', ], 'values' => [ 'shape' => 'SearchJobsFilterValuesList', ], ], ], 'SearchJobsFilterOperator' => [ 'type' => 'string', 'enum' => [ 'LT', 'LTE', 'EQUAL', 'GT', 'GTE', 'BETWEEN', 'CONTAINS', ], ], 'SearchJobsFilterValuesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String256', ], 'max' => 10, 'min' => 1, ], 'SearchJobsRequest' => [ 'type' => 'structure', 'required' => [ 'filters', ], 'members' => [ 'filters' => [ 'shape' => 'SearchJobsRequestFiltersList', ], 'maxResults' => [ 'shape' => 'SearchJobsRequestMaxResultsInteger', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'SearchJobsRequestFiltersList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SearchJobsFilter', ], 'max' => 10, 'min' => 0, ], 'SearchJobsRequestMaxResultsInteger' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'SearchJobsResponse' => [ 'type' => 'structure', 'required' => [ 'jobs', ], 'members' => [ 'jobs' => [ 'shape' => 'JobSummaryList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'SearchQuantumTasksFilter' => [ 'type' => 'structure', 'required' => [ 'name', 'operator', 'values', ], 'members' => [ 'name' => [ 'shape' => 'String64', ], 'operator' => [ 'shape' => 'SearchQuantumTasksFilterOperator', ], 'values' => [ 'shape' => 'SearchQuantumTasksFilterValuesList', ], ], ], 'SearchQuantumTasksFilterOperator' => [ 'type' => 'string', 'enum' => [ 'LT', 'LTE', 'EQUAL', 'GT', 'GTE', 'BETWEEN', ], ], 'SearchQuantumTasksFilterValuesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String256', ], 'max' => 10, 'min' => 1, ], 'SearchQuantumTasksRequest' => [ 'type' => 'structure', 'required' => [ 'filters', ], 'members' => [ 'filters' => [ 'shape' => 'SearchQuantumTasksRequestFiltersList', ], 'maxResults' => [ 'shape' => 'SearchQuantumTasksRequestMaxResultsInteger', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'SearchQuantumTasksRequestFiltersList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SearchQuantumTasksFilter', ], 'max' => 10, 'min' => 0, ], 'SearchQuantumTasksRequestMaxResultsInteger' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'SearchQuantumTasksResponse' => [ 'type' => 'structure', 'required' => [ 'quantumTasks', ], 'members' => [ 'nextToken' => [ 'shape' => 'String', ], 'quantumTasks' => [ 'shape' => 'QuantumTaskSummaryList', ], ], ], 'ServiceQuotaExceededException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 402, 'senderFault' => true, ], 'exception' => true, ], 'String' => [ 'type' => 'string', ], 'String1024' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, ], 'String2048' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, ], 'String256' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'String4096' => [ 'type' => 'string', 'max' => 4096, 'min' => 1, ], 'String64' => [ 'type' => 'string', 'max' => 64, 'min' => 1, ], 'SyntheticTimestamp_date_time' => [ 'type' => 'timestamp', 'timestampFormat' => 'iso8601', ], 'TagKeys' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tags', ], 'members' => [ 'resourceArn' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tags' => [ 'shape' => 'TagsMap', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'String', ], 'value' => [ 'shape' => 'String', ], ], 'ThrottlingException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 429, 'senderFault' => true, ], 'exception' => true, ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tagKeys', ], 'members' => [ 'resourceArn' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tagKeys' => [ 'shape' => 'TagKeys', 'location' => 'querystring', 'locationName' => 'tagKeys', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'Uri' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '\\\\d{10,14}\\\\.dkr\\\\.ecr.[a-z0-9-]+\\\\.amazonaws\\\\.com\\\\/.+(@sha256)?:.+', ], 'ValidationException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/braket/2019-09-01/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>The Amazon Braket API Reference provides information about the operations and structures supported in Amazon Braket.</p> <p>Additional Resources:</p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/braket/latest/developerguide/what-is-braket.html\">Amazon Braket Developer Guide</a> </p> </li> </ul>', 'operations' => [ 'CancelJob' => '<p>Cancels an Amazon Braket job.</p>', 'CancelQuantumTask' => '<p>Cancels the specified task.</p>', 'CreateJob' => '<p>Creates an Amazon Braket job.</p>', 'CreateQuantumTask' => '<p>Creates a quantum task.</p>', 'GetDevice' => '<p>Retrieves the devices available in Amazon Braket.</p> <note> <p>For backwards compatibility with older versions of BraketSchemas, OpenQASM information is omitted from GetDevice API calls. To get this information the user-agent needs to present a recent version of the BraketSchemas (1.8.0 or later). The Braket SDK automatically reports this for you. If you do not see OpenQASM results in the GetDevice response when using a Braket SDK, you may need to set AWS_EXECUTION_ENV environment variable to configure user-agent. See the code examples provided below for how to do this for the AWS CLI, Boto3, and the Go, Java, and JavaScript/TypeScript SDKs.</p> </note>', 'GetJob' => '<p>Retrieves the specified Amazon Braket job.</p>', 'GetQuantumTask' => '<p>Retrieves the specified quantum task.</p>', 'ListTagsForResource' => '<p>Shows the tags associated with this resource.</p>', 'SearchDevices' => '<p>Searches for devices using the specified filters.</p>', 'SearchJobs' => '<p>Searches for Amazon Braket jobs that match the specified filter values.</p>', 'SearchQuantumTasks' => '<p>Searches for tasks that match the specified filter values.</p>', 'TagResource' => '<p>Add a tag to the specified resource.</p>', 'UntagResource' => '<p>Remove tags from a resource.</p>', ], 'shapes' => [ 'AccessDeniedException' => [ 'base' => '<p>You do not have sufficient access to perform this action.</p>', 'refs' => [], ], 'AlgorithmSpecification' => [ 'base' => '<p>Defines the Amazon Braket job to be created. Specifies the container image the job uses and the paths to the Python scripts used for entry and training.</p>', 'refs' => [ 'CreateJobRequest$algorithmSpecification' => '<p>Definition of the Amazon Braket job to be created. Specifies the container image the job uses and information about the Python scripts used for entry and training.</p>', 'GetJobResponse$algorithmSpecification' => '<p>Definition of the Amazon Braket job created. Specifies the container image the job uses, information about the Python scripts used for entry and training, and the user-defined metrics used to evaluation the job.</p>', ], ], 'CancelJobRequest' => [ 'base' => NULL, 'refs' => [], ], 'CancelJobResponse' => [ 'base' => NULL, 'refs' => [], ], 'CancelQuantumTaskRequest' => [ 'base' => NULL, 'refs' => [], ], 'CancelQuantumTaskResponse' => [ 'base' => NULL, 'refs' => [], ], 'CancellationStatus' => [ 'base' => NULL, 'refs' => [ 'CancelJobResponse$cancellationStatus' => '<p>The status of the job cancellation request.</p>', 'CancelQuantumTaskResponse$cancellationStatus' => '<p>The status of the cancellation request.</p>', ], ], 'CompressionType' => [ 'base' => NULL, 'refs' => [ 'ScriptModeConfig$compressionType' => '<p>The type of compression used by the Python scripts for an Amazon Braket job.</p>', ], ], 'ConflictException' => [ 'base' => '<p>An error occurred due to a conflict.</p>', 'refs' => [], ], 'ContainerImage' => [ 'base' => '<p>The container image used to create an Amazon Braket job.</p>', 'refs' => [ 'AlgorithmSpecification$containerImage' => '<p>The container image used to create an Amazon Braket job.</p>', ], ], 'CreateJobRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateJobRequestInputDataConfigList' => [ 'base' => NULL, 'refs' => [ 'CreateJobRequest$inputDataConfig' => '<p>A list of parameters that specify the name and type of input data and where it is located.</p>', ], ], 'CreateJobRequestJobNameString' => [ 'base' => NULL, 'refs' => [ 'CreateJobRequest$jobName' => '<p>The name of the Amazon Braket job.</p>', ], ], 'CreateJobResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateQuantumTaskRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateQuantumTaskRequestDeviceParametersString' => [ 'base' => NULL, 'refs' => [ 'CreateQuantumTaskRequest$deviceParameters' => '<p>The parameters for the device to run the task on.</p>', ], ], 'CreateQuantumTaskRequestOutputS3BucketString' => [ 'base' => NULL, 'refs' => [ 'CreateQuantumTaskRequest$outputS3Bucket' => '<p>The S3 bucket to store task result files in.</p>', ], ], 'CreateQuantumTaskRequestOutputS3KeyPrefixString' => [ 'base' => NULL, 'refs' => [ 'CreateQuantumTaskRequest$outputS3KeyPrefix' => '<p>The key prefix for the location in the S3 bucket to store task results in.</p>', ], ], 'CreateQuantumTaskRequestShotsLong' => [ 'base' => NULL, 'refs' => [ 'CreateQuantumTaskRequest$shots' => '<p>The number of shots to use for the task.</p>', ], ], 'CreateQuantumTaskResponse' => [ 'base' => NULL, 'refs' => [], ], 'DataSource' => [ 'base' => '<p>Information about the source of the data used by the Amazon Braket job.</p>', 'refs' => [ 'InputFileConfig$dataSource' => '<p>The location of the channel data.</p>', ], ], 'DeviceArn' => [ 'base' => NULL, 'refs' => [ 'CreateQuantumTaskRequest$deviceArn' => '<p>The ARN of the device to run the task on.</p>', 'DeviceSummary$deviceArn' => '<p>The ARN of the device.</p>', 'GetDeviceRequest$deviceArn' => '<p>The ARN of the device to retrieve.</p>', 'GetDeviceResponse$deviceArn' => '<p>The ARN of the device.</p>', 'GetQuantumTaskResponse$deviceArn' => '<p>The ARN of the device the task was run on.</p>', 'QuantumTaskSummary$deviceArn' => '<p>The ARN of the device the task ran on.</p>', ], ], 'DeviceConfig' => [ 'base' => '<p>Configures the quantum processing units (QPUs) or simulator used to create and run an Amazon Braket job.</p>', 'refs' => [ 'CreateJobRequest$deviceConfig' => '<p>The quantum processing unit (QPU) or simulator used to create an Amazon Braket job.</p>', 'GetJobResponse$deviceConfig' => '<p>The quantum processing unit (QPU) or simulator used to run the Amazon Braket job.</p>', ], ], 'DeviceOfflineException' => [ 'base' => '<p>The specified device is currently offline.</p>', 'refs' => [], ], 'DeviceRetiredException' => [ 'base' => '<p>The specified device has been retired.</p>', 'refs' => [], ], 'DeviceStatus' => [ 'base' => NULL, 'refs' => [ 'DeviceSummary$deviceStatus' => '<p>The status of the device.</p>', 'GetDeviceResponse$deviceStatus' => '<p>The status of the device.</p>', ], ], 'DeviceSummary' => [ 'base' => '<p>Includes information about the device.</p>', 'refs' => [ 'DeviceSummaryList$member' => NULL, ], ], 'DeviceSummaryList' => [ 'base' => NULL, 'refs' => [ 'SearchDevicesResponse$devices' => '<p>An array of <code>DeviceSummary</code> objects for devices that match the specified filter values.</p>', ], ], 'DeviceType' => [ 'base' => NULL, 'refs' => [ 'DeviceSummary$deviceType' => '<p>The type of the device.</p>', 'GetDeviceResponse$deviceType' => '<p>The type of the device.</p>', ], ], 'GetDeviceRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetDeviceResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetJobRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetJobResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetJobResponseJobNameString' => [ 'base' => NULL, 'refs' => [ 'GetJobResponse$jobName' => '<p>The name of the Amazon Braket job.</p>', ], ], 'GetQuantumTaskRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetQuantumTaskResponse' => [ 'base' => NULL, 'refs' => [], ], 'HyperParameters' => [ 'base' => NULL, 'refs' => [ 'CreateJobRequest$hyperParameters' => '<p>Algorithm-specific parameters used by an Amazon Braket job that influence the quality of the training job. The values are set with a string of JSON key:value pairs, where the key is the name of the hyperparameter and the value is the value of th hyperparameter.</p>', 'GetJobResponse$hyperParameters' => '<p>Algorithm-specific parameters used by an Amazon Braket job that influence the quality of the traiing job. The values are set with a string of JSON key:value pairs, where the key is the name of the hyperparameter and the value is the value of th hyperparameter.</p>', ], ], 'HyperParametersValueString' => [ 'base' => NULL, 'refs' => [ 'HyperParameters$value' => NULL, ], ], 'InputConfigList' => [ 'base' => NULL, 'refs' => [ 'GetJobResponse$inputDataConfig' => '<p>A list of parameters that specify the name and type of input data and where it is located.</p>', ], ], 'InputFileConfig' => [ 'base' => '<p>A list of parameters that specify the input channels, type of input data, and where it is located.</p>', 'refs' => [ 'CreateJobRequestInputDataConfigList$member' => NULL, 'InputConfigList$member' => NULL, ], ], 'InputFileConfigChannelNameString' => [ 'base' => NULL, 'refs' => [ 'InputFileConfig$channelName' => '<p>A named input source that an Amazon Braket job can consume.</p>', ], ], 'InstanceConfig' => [ 'base' => '<p>Configures the resource instances to use while running the Amazon Braket hybrid job on Amazon Braket.</p>', 'refs' => [ 'CreateJobRequest$instanceConfig' => '<p>Configuration of the resource instances to use while running the hybrid job on Amazon Braket.</p>', 'GetJobResponse$instanceConfig' => '<p>The resource instances to use while running the hybrid job on Amazon Braket.</p>', ], ], 'InstanceConfigInstanceCountInteger' => [ 'base' => NULL, 'refs' => [ 'InstanceConfig$instanceCount' => '<p>Configures the number of resource instances to use while running an Amazon Braket job on Amazon Braket. The default value is 1.</p>', ], ], 'InstanceConfigVolumeSizeInGbInteger' => [ 'base' => NULL, 'refs' => [ 'InstanceConfig$volumeSizeInGb' => '<p>The size of the storage volume, in GB, that user wants to provision.</p>', ], ], 'InstanceType' => [ 'base' => NULL, 'refs' => [ 'InstanceConfig$instanceType' => '<p>Configures the type resource instances to use while running an Amazon Braket hybrid job.</p>', ], ], 'Integer' => [ 'base' => NULL, 'refs' => [ 'GetJobResponse$billableDuration' => '<p>The billable time the Amazon Braket job used to complete.</p>', ], ], 'InternalServiceException' => [ 'base' => '<p>The request processing has failed because of an unknown error, exception, or failure.</p>', 'refs' => [], ], 'JobArn' => [ 'base' => NULL, 'refs' => [ 'CancelJobRequest$jobArn' => '<p>The ARN of the Amazon Braket job to cancel.</p>', 'CancelJobResponse$jobArn' => '<p>The ARN of the Amazon Braket job.</p>', 'CreateJobResponse$jobArn' => '<p>The ARN of the Amazon Braket job created.</p>', 'GetJobRequest$jobArn' => '<p>The ARN of the job to retrieve.</p>', 'GetJobResponse$jobArn' => '<p>The ARN of the Amazon Braket job.</p>', 'GetQuantumTaskResponse$jobArn' => '<p>The ARN of the Amazon Braket job associated with the quantum task.</p>', 'JobSummary$jobArn' => '<p>The ARN of the Amazon Braket job.</p>', ], ], 'JobCheckpointConfig' => [ 'base' => '<p>Contains information about the output locations for job checkpoint data.</p>', 'refs' => [ 'CreateJobRequest$checkpointConfig' => '<p>Information about the output locations for job checkpoint data.</p>', 'GetJobResponse$checkpointConfig' => '<p>Information about the output locations for job checkpoint data.</p>', ], ], 'JobEventDetails' => [ 'base' => '<p>Details about the type and time events occurred related to the Amazon Braket job.</p>', 'refs' => [ 'JobEvents$member' => NULL, ], ], 'JobEventDetailsMessageString' => [ 'base' => NULL, 'refs' => [ 'JobEventDetails$message' => '<p>A message describing the event that occurred related to the Amazon Braket job.</p>', ], ], 'JobEventType' => [ 'base' => NULL, 'refs' => [ 'JobEventDetails$eventType' => '<p>The type of event that occurred related to the Amazon Braket job.</p>', ], ], 'JobEvents' => [ 'base' => NULL, 'refs' => [ 'GetJobResponse$events' => '<p>Details about the type and time events occurred related to the Amazon Braket job.</p>', ], ], 'JobOutputDataConfig' => [ 'base' => '<p>Specifies the path to the S3 location where you want to store job artifacts and the encryption key used to store them.</p>', 'refs' => [ 'CreateJobRequest$outputDataConfig' => '<p>The path to the S3 location where you want to store job artifacts and the encryption key used to store them.</p>', 'GetJobResponse$outputDataConfig' => '<p>The path to the S3 location where job artifacts are stored and the encryption key used to store them there.</p>', ], ], 'JobPrimaryStatus' => [ 'base' => NULL, 'refs' => [ 'GetJobResponse$status' => '<p>The status of the Amazon Braket job.</p>', 'JobSummary$status' => '<p>The status of the Amazon Braket job.</p>', ], ], 'JobStoppingCondition' => [ 'base' => '<p>Specifies limits for how long an Amazon Braket job can run. </p>', 'refs' => [ 'CreateJobRequest$stoppingCondition' => '<p> The user-defined criteria that specifies when a job stops running.</p>', 'GetJobResponse$stoppingCondition' => '<p>The user-defined criteria that specifies when to stop a job running.</p>', ], ], 'JobStoppingConditionMaxRuntimeInSecondsInteger' => [ 'base' => NULL, 'refs' => [ 'JobStoppingCondition$maxRuntimeInSeconds' => '<p>The maximum length of time, in seconds, that an Amazon Braket job can run.</p>', ], ], 'JobSummary' => [ 'base' => '<p>Provides summary information about an Amazon Braket job.</p>', 'refs' => [ 'JobSummaryList$member' => NULL, ], ], 'JobSummaryList' => [ 'base' => NULL, 'refs' => [ 'SearchJobsResponse$jobs' => '<p>An array of <code>JobSummary</code> objects for devices that match the specified filter values.</p>', ], ], 'JobToken' => [ 'base' => NULL, 'refs' => [ 'CreateQuantumTaskRequest$jobToken' => '<p>The token for an Amazon Braket job that associates it with the quantum task.</p>', ], ], 'JsonValue' => [ 'base' => NULL, 'refs' => [ 'CreateQuantumTaskRequest$action' => '<p>The action associated with the task.</p>', 'GetDeviceResponse$deviceCapabilities' => '<p>Details about the capabilities of the device.</p>', 'GetQuantumTaskResponse$deviceParameters' => '<p>The parameters for the device on which the task ran.</p>', ], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'Long' => [ 'base' => NULL, 'refs' => [ 'GetQuantumTaskResponse$shots' => '<p>The number of shots used in the task.</p>', 'QuantumTaskSummary$shots' => '<p>The shots used for the task.</p>', ], ], 'QuantumTaskArn' => [ 'base' => NULL, 'refs' => [ 'CancelQuantumTaskRequest$quantumTaskArn' => '<p>The ARN of the task to cancel.</p>', 'CancelQuantumTaskResponse$quantumTaskArn' => '<p>The ARN of the task.</p>', 'CreateQuantumTaskResponse$quantumTaskArn' => '<p>The ARN of the task created by the request.</p>', 'GetQuantumTaskRequest$quantumTaskArn' => '<p>the ARN of the task to retrieve.</p>', 'GetQuantumTaskResponse$quantumTaskArn' => '<p>The ARN of the task.</p>', 'QuantumTaskSummary$quantumTaskArn' => '<p>The ARN of the task.</p>', ], ], 'QuantumTaskStatus' => [ 'base' => NULL, 'refs' => [ 'GetQuantumTaskResponse$status' => '<p>The status of the task.</p>', 'QuantumTaskSummary$status' => '<p>The status of the task.</p>', ], ], 'QuantumTaskSummary' => [ 'base' => '<p>Includes information about a quantum task.</p>', 'refs' => [ 'QuantumTaskSummaryList$member' => NULL, ], ], 'QuantumTaskSummaryList' => [ 'base' => NULL, 'refs' => [ 'SearchQuantumTasksResponse$quantumTasks' => '<p>An array of <code>QuantumTaskSummary</code> objects for tasks that match the specified filters.</p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p>The specified resource was not found.</p>', 'refs' => [], ], 'RoleArn' => [ 'base' => NULL, 'refs' => [ 'CreateJobRequest$roleArn' => '<p>The Amazon Resource Name (ARN) of an IAM role that Amazon Braket can assume to perform tasks on behalf of a user. It can access user resources, run an Amazon Braket job container on behalf of user, and output resources to the users\\' s3 buckets.</p>', 'GetJobResponse$roleArn' => '<p>The Amazon Resource Name (ARN) of an IAM role that Amazon Braket can assume to perform tasks on behalf of a user. It can access user resources, run an Amazon Braket job container on behalf of user, and output resources to the s3 buckets of a user.</p>', ], ], 'S3DataSource' => [ 'base' => '<p>Information about the data stored in Amazon S3 used by the Amazon Braket job.</p>', 'refs' => [ 'DataSource$s3DataSource' => '<p>Information about the data stored in Amazon S3 used by the Amazon Braket job.</p>', ], ], 'S3Path' => [ 'base' => NULL, 'refs' => [ 'JobCheckpointConfig$s3Uri' => '<p>Identifies the S3 path where you want Amazon Braket to store checkpoints. For example, <code>s3://bucket-name/key-name-prefix</code>.</p>', 'JobOutputDataConfig$s3Path' => '<p>Identifies the S3 path where you want Amazon Braket to store the job training artifacts. For example, <code>s3://bucket-name/key-name-prefix</code>.</p>', 'S3DataSource$s3Uri' => '<p>Depending on the value specified for the <code>S3DataType</code>, identifies either a key name prefix or a manifest that locates the S3 data source.</p>', 'ScriptModeConfig$s3Uri' => '<p>The URI that specifies the S3 path to the Python script module that contains the training script used by an Amazon Braket job.</p>', ], ], 'ScriptModeConfig' => [ 'base' => '<p>Contains information about the Python scripts used for entry and by an Amazon Braket job.</p>', 'refs' => [ 'AlgorithmSpecification$scriptModeConfig' => '<p>Configures the paths to the Python scripts used for entry and training.</p>', ], ], 'SearchDevicesFilter' => [ 'base' => '<p>The filter to use for searching devices.</p>', 'refs' => [ 'SearchDevicesRequestFiltersList$member' => NULL, ], ], 'SearchDevicesFilterNameString' => [ 'base' => NULL, 'refs' => [ 'SearchDevicesFilter$name' => '<p>The name to use to filter results.</p>', ], ], 'SearchDevicesFilterValuesList' => [ 'base' => NULL, 'refs' => [ 'SearchDevicesFilter$values' => '<p>The values to use to filter results.</p>', ], ], 'SearchDevicesRequest' => [ 'base' => NULL, 'refs' => [], ], 'SearchDevicesRequestFiltersList' => [ 'base' => NULL, 'refs' => [ 'SearchDevicesRequest$filters' => '<p>The filter values to use to search for a device.</p>', ], ], 'SearchDevicesRequestMaxResultsInteger' => [ 'base' => NULL, 'refs' => [ 'SearchDevicesRequest$maxResults' => '<p>The maximum number of results to return in the response.</p>', ], ], 'SearchDevicesResponse' => [ 'base' => NULL, 'refs' => [], ], 'SearchJobsFilter' => [ 'base' => '<p>A filter used to search for Amazon Braket jobs.</p>', 'refs' => [ 'SearchJobsRequestFiltersList$member' => NULL, ], ], 'SearchJobsFilterOperator' => [ 'base' => NULL, 'refs' => [ 'SearchJobsFilter$operator' => '<p>An operator to use for the jobs filter.</p>', ], ], 'SearchJobsFilterValuesList' => [ 'base' => NULL, 'refs' => [ 'SearchJobsFilter$values' => '<p>The values to use for the jobs filter.</p>', ], ], 'SearchJobsRequest' => [ 'base' => NULL, 'refs' => [], ], 'SearchJobsRequestFiltersList' => [ 'base' => NULL, 'refs' => [ 'SearchJobsRequest$filters' => '<p>The filter values to use when searching for a job.</p>', ], ], 'SearchJobsRequestMaxResultsInteger' => [ 'base' => NULL, 'refs' => [ 'SearchJobsRequest$maxResults' => '<p>The maximum number of results to return in the response.</p>', ], ], 'SearchJobsResponse' => [ 'base' => NULL, 'refs' => [], ], 'SearchQuantumTasksFilter' => [ 'base' => '<p>A filter to use to search for tasks.</p>', 'refs' => [ 'SearchQuantumTasksRequestFiltersList$member' => NULL, ], ], 'SearchQuantumTasksFilterOperator' => [ 'base' => NULL, 'refs' => [ 'SearchQuantumTasksFilter$operator' => '<p>An operator to use in the filter.</p>', ], ], 'SearchQuantumTasksFilterValuesList' => [ 'base' => NULL, 'refs' => [ 'SearchQuantumTasksFilter$values' => '<p>The values to use for the filter.</p>', ], ], 'SearchQuantumTasksRequest' => [ 'base' => NULL, 'refs' => [], ], 'SearchQuantumTasksRequestFiltersList' => [ 'base' => NULL, 'refs' => [ 'SearchQuantumTasksRequest$filters' => '<p>Array of <code>SearchQuantumTasksFilter</code> objects.</p>', ], ], 'SearchQuantumTasksRequestMaxResultsInteger' => [ 'base' => NULL, 'refs' => [ 'SearchQuantumTasksRequest$maxResults' => '<p>Maximum number of results to return in the response.</p>', ], ], 'SearchQuantumTasksResponse' => [ 'base' => NULL, 'refs' => [], ], 'ServiceQuotaExceededException' => [ 'base' => '<p>The request failed because a service quota is exceeded.</p>', 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$message' => NULL, 'ConflictException$message' => NULL, 'DeviceOfflineException$message' => NULL, 'DeviceRetiredException$message' => NULL, 'DeviceSummary$deviceName' => '<p>The name of the device.</p>', 'DeviceSummary$providerName' => '<p>The provider of the device.</p>', 'GetDeviceResponse$deviceName' => '<p>The name of the device.</p>', 'GetDeviceResponse$providerName' => '<p>The name of the partner company for the device.</p>', 'GetQuantumTaskResponse$failureReason' => '<p>The reason that a task failed.</p>', 'GetQuantumTaskResponse$outputS3Bucket' => '<p>The S3 bucket where task results are stored.</p>', 'GetQuantumTaskResponse$outputS3Directory' => '<p>The folder in the S3 bucket where task results are stored.</p>', 'InternalServiceException$message' => NULL, 'JobSummary$jobName' => '<p>The name of the Amazon Braket job.</p>', 'ListTagsForResourceRequest$resourceArn' => '<p>Specify the <code>resourceArn</code> for the resource whose tags to display.</p>', 'QuantumTaskSummary$outputS3Bucket' => '<p>The S3 bucket where the task result file is stored..</p>', 'QuantumTaskSummary$outputS3Directory' => '<p>The folder in the S3 bucket where the task result file is stored.</p>', 'ResourceNotFoundException$message' => NULL, 'ScriptModeConfig$entryPoint' => '<p>The path to the Python script that serves as the entry point for an Amazon Braket job.</p>', 'SearchDevicesRequest$nextToken' => '<p>A token used for pagination of results returned in the response. Use the token returned from the previous request continue results where the previous request ended.</p>', 'SearchDevicesResponse$nextToken' => '<p>A token used for pagination of results, or null if there are no additional results. Use the token value in a subsequent request to continue results where the previous request ended.</p>', 'SearchJobsRequest$nextToken' => '<p>A token used for pagination of results returned in the response. Use the token returned from the previous request to continue results where the previous request ended.</p>', 'SearchJobsResponse$nextToken' => '<p>A token used for pagination of results, or <code>null</code> if there are no additional results. Use the token value in a subsequent request to continue results where the previous request ended.</p>', 'SearchQuantumTasksRequest$nextToken' => '<p>A token used for pagination of results returned in the response. Use the token returned from the previous request continue results where the previous request ended.</p>', 'SearchQuantumTasksResponse$nextToken' => '<p>A token used for pagination of results, or null if there are no additional results. Use the token value in a subsequent request to continue results where the previous request ended.</p>', 'ServiceQuotaExceededException$message' => NULL, 'TagKeys$member' => NULL, 'TagResourceRequest$resourceArn' => '<p>Specify the <code>resourceArn</code> of the resource to which a tag will be added.</p>', 'TagsMap$key' => NULL, 'TagsMap$value' => NULL, 'ThrottlingException$message' => NULL, 'UntagResourceRequest$resourceArn' => '<p>Specify the <code>resourceArn</code> for the resource from which to remove the tags.</p>', 'ValidationException$message' => NULL, ], ], 'String1024' => [ 'base' => NULL, 'refs' => [ 'GetJobResponse$failureReason' => '<p>A description of the reason why an Amazon Braket job failed, if it failed.</p>', ], ], 'String2048' => [ 'base' => NULL, 'refs' => [ 'JobOutputDataConfig$kmsKeyId' => '<p>The AWS Key Management Service (AWS KMS) key that Amazon Braket uses to encrypt the job training artifacts at rest using Amazon S3 server-side encryption.</p>', ], ], 'String256' => [ 'base' => NULL, 'refs' => [ 'DeviceConfig$device' => '<p>The primary quantum processing unit (QPU) or simulator used to create and run an Amazon Braket job.</p>', 'HyperParameters$key' => NULL, 'InputFileConfig$contentType' => '<p>The MIME type of the data.</p>', 'JobSummary$device' => '<p>Provides summary information about the primary device used by an Amazon Braket job.</p>', 'SearchDevicesFilterValuesList$member' => NULL, 'SearchJobsFilterValuesList$member' => NULL, 'SearchQuantumTasksFilterValuesList$member' => NULL, ], ], 'String4096' => [ 'base' => NULL, 'refs' => [ 'JobCheckpointConfig$localPath' => '<p>(Optional) The local directory where checkpoints are written. The default directory is <code>/opt/braket/checkpoints/</code>.</p>', ], ], 'String64' => [ 'base' => NULL, 'refs' => [ 'CancelQuantumTaskRequest$clientToken' => '<p>The client token associated with the request.</p>', 'CreateJobRequest$clientToken' => '<p>A unique token that guarantees that the call to this API is idempotent.</p>', 'CreateQuantumTaskRequest$clientToken' => '<p>The client token associated with the request.</p>', 'SearchJobsFilter$name' => '<p>The name to use for the jobs filter.</p>', 'SearchQuantumTasksFilter$name' => '<p>The name of the device used for the task.</p>', ], ], 'SyntheticTimestamp_date_time' => [ 'base' => NULL, 'refs' => [ 'GetJobResponse$createdAt' => '<p>The date and time that the Amazon Braket job was created.</p>', 'GetJobResponse$endedAt' => '<p>The date and time that the Amazon Braket job ended.</p>', 'GetJobResponse$startedAt' => '<p>The date and time that the Amazon Braket job was started.</p>', 'GetQuantumTaskResponse$createdAt' => '<p>The time at which the task was created.</p>', 'GetQuantumTaskResponse$endedAt' => '<p>The time at which the task ended.</p>', 'JobEventDetails$timeOfEvent' => '<p>TThe type of event that occurred related to the Amazon Braket job.</p>', 'JobSummary$createdAt' => '<p>The date and time that the Amazon Braket job was created.</p>', 'JobSummary$endedAt' => '<p>The date and time that the Amazon Braket job ended.</p>', 'JobSummary$startedAt' => '<p>The date and time that the Amazon Braket job was started.</p>', 'QuantumTaskSummary$createdAt' => '<p>The time at which the task was created.</p>', 'QuantumTaskSummary$endedAt' => '<p>The time at which the task finished.</p>', ], ], 'TagKeys' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$tagKeys' => '<p>Specify the keys for the tags to remove from the resource.</p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'TagsMap' => [ 'base' => NULL, 'refs' => [ 'CreateJobRequest$tags' => '<p>A tag object that consists of a key and an optional value, used to manage metadata for Amazon Braket resources.</p>', 'CreateQuantumTaskRequest$tags' => '<p>Tags to be added to the quantum task you\\'re creating.</p>', 'GetJobResponse$tags' => '<p>A tag object that consists of a key and an optional value, used to manage metadata for Amazon Braket resources.</p>', 'GetQuantumTaskResponse$tags' => '<p>The tags that belong to this task.</p>', 'JobSummary$tags' => '<p>A tag object that consists of a key and an optional value, used to manage metadata for Amazon Braket resources.</p>', 'ListTagsForResourceResponse$tags' => '<p>Displays the key, value pairs of tags associated with this resource.</p>', 'QuantumTaskSummary$tags' => '<p>Displays the key, value pairs of tags associated with this quantum task.</p>', 'TagResourceRequest$tags' => '<p>Specify the tags to add to the resource.</p>', ], ], 'ThrottlingException' => [ 'base' => '<p>The throttling rate limit is met.</p>', 'refs' => [], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'Uri' => [ 'base' => NULL, 'refs' => [ 'ContainerImage$uri' => '<p>The URI locating the container image.</p>', ], ], 'ValidationException' => [ 'base' => '<p>The input fails to satisfy the constraints specified by an AWS service.</p>', 'refs' => [], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/braket/2019-09-01/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], [ 'fn' => 'parseURL', 'argv' => [ [ 'ref' => 'Endpoint', ], ], 'assign' => 'url', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://braket-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://braket-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://braket.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://braket.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/braket/2019-09-01/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://braket-fips.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://braket-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://braket.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://braket.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://braket-fips.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://braket-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://braket.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://braket.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://braket-fips.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://braket-fips.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://braket.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://braket.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://braket-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://braket-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://braket.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://braket.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/braket/2019-09-01/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/braket/2019-09-01/paginators-1.json\nreturn [ 'pagination' => [ 'SearchDevices' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'devices', ], 'SearchJobs' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'jobs', ], 'SearchQuantumTasks' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'quantumTasks', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/budgets/2016-10-20/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2016-10-20', 'endpointPrefix' => 'budgets', 'jsonVersion' => '1.1', 'protocol' => 'json', 'serviceAbbreviation' => 'AWSBudgets', 'serviceFullName' => 'AWS Budgets', 'serviceId' => 'Budgets', 'signatureVersion' => 'v4', 'targetPrefix' => 'AWSBudgetServiceGateway', 'uid' => 'budgets-2016-10-20', ], 'operations' => [ 'CreateBudget' => [ 'name' => 'CreateBudget', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateBudgetRequest', ], 'output' => [ 'shape' => 'CreateBudgetResponse', ], 'errors' => [ [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'CreationLimitExceededException', ], [ 'shape' => 'DuplicateRecordException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'CreateBudgetAction' => [ 'name' => 'CreateBudgetAction', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateBudgetActionRequest', ], 'output' => [ 'shape' => 'CreateBudgetActionResponse', ], 'errors' => [ [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'CreationLimitExceededException', ], [ 'shape' => 'DuplicateRecordException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'CreateNotification' => [ 'name' => 'CreateNotification', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateNotificationRequest', ], 'output' => [ 'shape' => 'CreateNotificationResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'CreationLimitExceededException', ], [ 'shape' => 'DuplicateRecordException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'CreateSubscriber' => [ 'name' => 'CreateSubscriber', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateSubscriberRequest', ], 'output' => [ 'shape' => 'CreateSubscriberResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'CreationLimitExceededException', ], [ 'shape' => 'DuplicateRecordException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DeleteBudget' => [ 'name' => 'DeleteBudget', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteBudgetRequest', ], 'output' => [ 'shape' => 'DeleteBudgetResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DeleteBudgetAction' => [ 'name' => 'DeleteBudgetAction', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteBudgetActionRequest', ], 'output' => [ 'shape' => 'DeleteBudgetActionResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceLockedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DeleteNotification' => [ 'name' => 'DeleteNotification', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteNotificationRequest', ], 'output' => [ 'shape' => 'DeleteNotificationResponse', ], 'errors' => [ [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DeleteSubscriber' => [ 'name' => 'DeleteSubscriber', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteSubscriberRequest', ], 'output' => [ 'shape' => 'DeleteSubscriberResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DescribeBudget' => [ 'name' => 'DescribeBudget', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeBudgetRequest', ], 'output' => [ 'shape' => 'DescribeBudgetResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DescribeBudgetAction' => [ 'name' => 'DescribeBudgetAction', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeBudgetActionRequest', ], 'output' => [ 'shape' => 'DescribeBudgetActionResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DescribeBudgetActionHistories' => [ 'name' => 'DescribeBudgetActionHistories', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeBudgetActionHistoriesRequest', ], 'output' => [ 'shape' => 'DescribeBudgetActionHistoriesResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DescribeBudgetActionsForAccount' => [ 'name' => 'DescribeBudgetActionsForAccount', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeBudgetActionsForAccountRequest', ], 'output' => [ 'shape' => 'DescribeBudgetActionsForAccountResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DescribeBudgetActionsForBudget' => [ 'name' => 'DescribeBudgetActionsForBudget', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeBudgetActionsForBudgetRequest', ], 'output' => [ 'shape' => 'DescribeBudgetActionsForBudgetResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DescribeBudgetNotificationsForAccount' => [ 'name' => 'DescribeBudgetNotificationsForAccount', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeBudgetNotificationsForAccountRequest', ], 'output' => [ 'shape' => 'DescribeBudgetNotificationsForAccountResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ExpiredNextTokenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DescribeBudgetPerformanceHistory' => [ 'name' => 'DescribeBudgetPerformanceHistory', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeBudgetPerformanceHistoryRequest', ], 'output' => [ 'shape' => 'DescribeBudgetPerformanceHistoryResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ExpiredNextTokenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DescribeBudgets' => [ 'name' => 'DescribeBudgets', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeBudgetsRequest', ], 'output' => [ 'shape' => 'DescribeBudgetsResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ExpiredNextTokenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DescribeNotificationsForBudget' => [ 'name' => 'DescribeNotificationsForBudget', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeNotificationsForBudgetRequest', ], 'output' => [ 'shape' => 'DescribeNotificationsForBudgetResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ExpiredNextTokenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DescribeSubscribersForNotification' => [ 'name' => 'DescribeSubscribersForNotification', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeSubscribersForNotificationRequest', ], 'output' => [ 'shape' => 'DescribeSubscribersForNotificationResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ExpiredNextTokenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'ExecuteBudgetAction' => [ 'name' => 'ExecuteBudgetAction', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ExecuteBudgetActionRequest', ], 'output' => [ 'shape' => 'ExecuteBudgetActionResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceLockedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'UpdateBudget' => [ 'name' => 'UpdateBudget', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateBudgetRequest', ], 'output' => [ 'shape' => 'UpdateBudgetResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'UpdateBudgetAction' => [ 'name' => 'UpdateBudgetAction', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateBudgetActionRequest', ], 'output' => [ 'shape' => 'UpdateBudgetActionResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceLockedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'UpdateNotification' => [ 'name' => 'UpdateNotification', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateNotificationRequest', ], 'output' => [ 'shape' => 'UpdateNotificationResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'DuplicateRecordException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'UpdateSubscriber' => [ 'name' => 'UpdateSubscriber', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateSubscriberRequest', ], 'output' => [ 'shape' => 'UpdateSubscriberResponse', ], 'errors' => [ [ 'shape' => 'InternalErrorException', ], [ 'shape' => 'InvalidParameterException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'DuplicateRecordException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottlingException', ], ], ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'AccountId' => [ 'type' => 'string', 'max' => 12, 'min' => 12, 'pattern' => '\\\\d{12}', ], 'Action' => [ 'type' => 'structure', 'required' => [ 'ActionId', 'BudgetName', 'NotificationType', 'ActionType', 'ActionThreshold', 'Definition', 'ExecutionRoleArn', 'ApprovalModel', 'Status', 'Subscribers', ], 'members' => [ 'ActionId' => [ 'shape' => 'ActionId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'NotificationType' => [ 'shape' => 'NotificationType', ], 'ActionType' => [ 'shape' => 'ActionType', ], 'ActionThreshold' => [ 'shape' => 'ActionThreshold', ], 'Definition' => [ 'shape' => 'Definition', ], 'ExecutionRoleArn' => [ 'shape' => 'RoleArn', ], 'ApprovalModel' => [ 'shape' => 'ApprovalModel', ], 'Status' => [ 'shape' => 'ActionStatus', ], 'Subscribers' => [ 'shape' => 'Subscribers', ], ], ], 'ActionHistories' => [ 'type' => 'list', 'member' => [ 'shape' => 'ActionHistory', ], 'max' => 100, 'min' => 0, ], 'ActionHistory' => [ 'type' => 'structure', 'required' => [ 'Timestamp', 'Status', 'EventType', 'ActionHistoryDetails', ], 'members' => [ 'Timestamp' => [ 'shape' => 'GenericTimestamp', ], 'Status' => [ 'shape' => 'ActionStatus', ], 'EventType' => [ 'shape' => 'EventType', ], 'ActionHistoryDetails' => [ 'shape' => 'ActionHistoryDetails', ], ], ], 'ActionHistoryDetails' => [ 'type' => 'structure', 'required' => [ 'Message', 'Action', ], 'members' => [ 'Message' => [ 'shape' => 'GenericString', ], 'Action' => [ 'shape' => 'Action', ], ], ], 'ActionId' => [ 'type' => 'string', 'max' => 36, 'min' => 36, 'pattern' => '^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$', ], 'ActionStatus' => [ 'type' => 'string', 'enum' => [ 'STANDBY', 'PENDING', 'EXECUTION_IN_PROGRESS', 'EXECUTION_SUCCESS', 'EXECUTION_FAILURE', 'REVERSE_IN_PROGRESS', 'REVERSE_SUCCESS', 'REVERSE_FAILURE', 'RESET_IN_PROGRESS', 'RESET_FAILURE', ], ], 'ActionSubType' => [ 'type' => 'string', 'enum' => [ 'STOP_EC2_INSTANCES', 'STOP_RDS_INSTANCES', ], ], 'ActionThreshold' => [ 'type' => 'structure', 'required' => [ 'ActionThresholdValue', 'ActionThresholdType', ], 'members' => [ 'ActionThresholdValue' => [ 'shape' => 'NotificationThreshold', ], 'ActionThresholdType' => [ 'shape' => 'ThresholdType', ], ], ], 'ActionType' => [ 'type' => 'string', 'enum' => [ 'APPLY_IAM_POLICY', 'APPLY_SCP_POLICY', 'RUN_SSM_DOCUMENTS', ], ], 'Actions' => [ 'type' => 'list', 'member' => [ 'shape' => 'Action', ], 'max' => 100, 'min' => 0, ], 'AdjustmentPeriod' => [ 'type' => 'integer', 'box' => true, 'max' => 60, 'min' => 1, ], 'ApprovalModel' => [ 'type' => 'string', 'enum' => [ 'AUTOMATIC', 'MANUAL', ], ], 'AutoAdjustData' => [ 'type' => 'structure', 'required' => [ 'AutoAdjustType', ], 'members' => [ 'AutoAdjustType' => [ 'shape' => 'AutoAdjustType', ], 'HistoricalOptions' => [ 'shape' => 'HistoricalOptions', ], 'LastAutoAdjustTime' => [ 'shape' => 'GenericTimestamp', ], ], ], 'AutoAdjustType' => [ 'type' => 'string', 'enum' => [ 'HISTORICAL', 'FORECAST', ], ], 'Budget' => [ 'type' => 'structure', 'required' => [ 'BudgetName', 'TimeUnit', 'BudgetType', ], 'members' => [ 'BudgetName' => [ 'shape' => 'BudgetName', ], 'BudgetLimit' => [ 'shape' => 'Spend', ], 'PlannedBudgetLimits' => [ 'shape' => 'PlannedBudgetLimits', ], 'CostFilters' => [ 'shape' => 'CostFilters', ], 'CostTypes' => [ 'shape' => 'CostTypes', ], 'TimeUnit' => [ 'shape' => 'TimeUnit', ], 'TimePeriod' => [ 'shape' => 'TimePeriod', ], 'CalculatedSpend' => [ 'shape' => 'CalculatedSpend', ], 'BudgetType' => [ 'shape' => 'BudgetType', ], 'LastUpdatedTime' => [ 'shape' => 'GenericTimestamp', ], 'AutoAdjustData' => [ 'shape' => 'AutoAdjustData', ], ], ], 'BudgetName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '[^:\\\\\\\\]+', ], 'BudgetNotificationsForAccount' => [ 'type' => 'structure', 'members' => [ 'Notifications' => [ 'shape' => 'Notifications', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], ], ], 'BudgetNotificationsForAccountList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BudgetNotificationsForAccount', ], 'max' => 50, ], 'BudgetPerformanceHistory' => [ 'type' => 'structure', 'members' => [ 'BudgetName' => [ 'shape' => 'BudgetName', ], 'BudgetType' => [ 'shape' => 'BudgetType', ], 'CostFilters' => [ 'shape' => 'CostFilters', ], 'CostTypes' => [ 'shape' => 'CostTypes', ], 'TimeUnit' => [ 'shape' => 'TimeUnit', ], 'BudgetedAndActualAmountsList' => [ 'shape' => 'BudgetedAndActualAmountsList', ], ], ], 'BudgetType' => [ 'type' => 'string', 'enum' => [ 'USAGE', 'COST', 'RI_UTILIZATION', 'RI_COVERAGE', 'SAVINGS_PLANS_UTILIZATION', 'SAVINGS_PLANS_COVERAGE', ], ], 'BudgetedAndActualAmounts' => [ 'type' => 'structure', 'members' => [ 'BudgetedAmount' => [ 'shape' => 'Spend', ], 'ActualAmount' => [ 'shape' => 'Spend', ], 'TimePeriod' => [ 'shape' => 'TimePeriod', ], ], ], 'BudgetedAndActualAmountsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BudgetedAndActualAmounts', ], ], 'Budgets' => [ 'type' => 'list', 'member' => [ 'shape' => 'Budget', ], ], 'CalculatedSpend' => [ 'type' => 'structure', 'required' => [ 'ActualSpend', ], 'members' => [ 'ActualSpend' => [ 'shape' => 'Spend', ], 'ForecastedSpend' => [ 'shape' => 'Spend', ], ], ], 'ComparisonOperator' => [ 'type' => 'string', 'enum' => [ 'GREATER_THAN', 'LESS_THAN', 'EQUAL_TO', ], ], 'CostFilters' => [ 'type' => 'map', 'key' => [ 'shape' => 'GenericString', ], 'value' => [ 'shape' => 'DimensionValues', ], ], 'CostTypes' => [ 'type' => 'structure', 'members' => [ 'IncludeTax' => [ 'shape' => 'NullableBoolean', ], 'IncludeSubscription' => [ 'shape' => 'NullableBoolean', ], 'UseBlended' => [ 'shape' => 'NullableBoolean', ], 'IncludeRefund' => [ 'shape' => 'NullableBoolean', ], 'IncludeCredit' => [ 'shape' => 'NullableBoolean', ], 'IncludeUpfront' => [ 'shape' => 'NullableBoolean', ], 'IncludeRecurring' => [ 'shape' => 'NullableBoolean', ], 'IncludeOtherSubscription' => [ 'shape' => 'NullableBoolean', ], 'IncludeSupport' => [ 'shape' => 'NullableBoolean', ], 'IncludeDiscount' => [ 'shape' => 'NullableBoolean', ], 'UseAmortized' => [ 'shape' => 'NullableBoolean', ], ], ], 'CreateBudgetActionRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'NotificationType', 'ActionType', 'ActionThreshold', 'Definition', 'ExecutionRoleArn', 'ApprovalModel', 'Subscribers', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'NotificationType' => [ 'shape' => 'NotificationType', ], 'ActionType' => [ 'shape' => 'ActionType', ], 'ActionThreshold' => [ 'shape' => 'ActionThreshold', ], 'Definition' => [ 'shape' => 'Definition', ], 'ExecutionRoleArn' => [ 'shape' => 'RoleArn', ], 'ApprovalModel' => [ 'shape' => 'ApprovalModel', ], 'Subscribers' => [ 'shape' => 'Subscribers', ], ], ], 'CreateBudgetActionResponse' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'ActionId', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'ActionId' => [ 'shape' => 'ActionId', ], ], ], 'CreateBudgetRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'Budget', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'Budget' => [ 'shape' => 'Budget', ], 'NotificationsWithSubscribers' => [ 'shape' => 'NotificationWithSubscribersList', ], ], ], 'CreateBudgetResponse' => [ 'type' => 'structure', 'members' => [], ], 'CreateNotificationRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'Notification', 'Subscribers', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'Notification' => [ 'shape' => 'Notification', ], 'Subscribers' => [ 'shape' => 'Subscribers', ], ], ], 'CreateNotificationResponse' => [ 'type' => 'structure', 'members' => [], ], 'CreateSubscriberRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'Notification', 'Subscriber', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'Notification' => [ 'shape' => 'Notification', ], 'Subscriber' => [ 'shape' => 'Subscriber', ], ], ], 'CreateSubscriberResponse' => [ 'type' => 'structure', 'members' => [], ], 'CreationLimitExceededException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'Definition' => [ 'type' => 'structure', 'members' => [ 'IamActionDefinition' => [ 'shape' => 'IamActionDefinition', ], 'ScpActionDefinition' => [ 'shape' => 'ScpActionDefinition', ], 'SsmActionDefinition' => [ 'shape' => 'SsmActionDefinition', ], ], ], 'DeleteBudgetActionRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'ActionId', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'ActionId' => [ 'shape' => 'ActionId', ], ], ], 'DeleteBudgetActionResponse' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'Action', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'Action' => [ 'shape' => 'Action', ], ], ], 'DeleteBudgetRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], ], ], 'DeleteBudgetResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteNotificationRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'Notification', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'Notification' => [ 'shape' => 'Notification', ], ], ], 'DeleteNotificationResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteSubscriberRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'Notification', 'Subscriber', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'Notification' => [ 'shape' => 'Notification', ], 'Subscriber' => [ 'shape' => 'Subscriber', ], ], ], 'DeleteSubscriberResponse' => [ 'type' => 'structure', 'members' => [], ], 'DescribeBudgetActionHistoriesRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'ActionId', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'ActionId' => [ 'shape' => 'ActionId', ], 'TimePeriod' => [ 'shape' => 'TimePeriod', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'GenericString', ], ], ], 'DescribeBudgetActionHistoriesResponse' => [ 'type' => 'structure', 'required' => [ 'ActionHistories', ], 'members' => [ 'ActionHistories' => [ 'shape' => 'ActionHistories', ], 'NextToken' => [ 'shape' => 'GenericString', ], ], ], 'DescribeBudgetActionRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'ActionId', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'ActionId' => [ 'shape' => 'ActionId', ], ], ], 'DescribeBudgetActionResponse' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'Action', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'Action' => [ 'shape' => 'Action', ], ], ], 'DescribeBudgetActionsForAccountRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'GenericString', ], ], ], 'DescribeBudgetActionsForAccountResponse' => [ 'type' => 'structure', 'required' => [ 'Actions', ], 'members' => [ 'Actions' => [ 'shape' => 'Actions', ], 'NextToken' => [ 'shape' => 'GenericString', ], ], ], 'DescribeBudgetActionsForBudgetRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'GenericString', ], ], ], 'DescribeBudgetActionsForBudgetResponse' => [ 'type' => 'structure', 'required' => [ 'Actions', ], 'members' => [ 'Actions' => [ 'shape' => 'Actions', ], 'NextToken' => [ 'shape' => 'GenericString', ], ], ], 'DescribeBudgetNotificationsForAccountRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'MaxResults' => [ 'shape' => 'MaxResultsBudgetNotifications', ], 'NextToken' => [ 'shape' => 'GenericString', ], ], ], 'DescribeBudgetNotificationsForAccountResponse' => [ 'type' => 'structure', 'members' => [ 'BudgetNotificationsForAccount' => [ 'shape' => 'BudgetNotificationsForAccountList', ], 'NextToken' => [ 'shape' => 'GenericString', ], ], ], 'DescribeBudgetPerformanceHistoryRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'TimePeriod' => [ 'shape' => 'TimePeriod', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'GenericString', ], ], ], 'DescribeBudgetPerformanceHistoryResponse' => [ 'type' => 'structure', 'members' => [ 'BudgetPerformanceHistory' => [ 'shape' => 'BudgetPerformanceHistory', ], 'NextToken' => [ 'shape' => 'GenericString', ], ], ], 'DescribeBudgetRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], ], ], 'DescribeBudgetResponse' => [ 'type' => 'structure', 'members' => [ 'Budget' => [ 'shape' => 'Budget', ], ], ], 'DescribeBudgetsRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'GenericString', ], ], ], 'DescribeBudgetsResponse' => [ 'type' => 'structure', 'members' => [ 'Budgets' => [ 'shape' => 'Budgets', ], 'NextToken' => [ 'shape' => 'GenericString', ], ], ], 'DescribeNotificationsForBudgetRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'GenericString', ], ], ], 'DescribeNotificationsForBudgetResponse' => [ 'type' => 'structure', 'members' => [ 'Notifications' => [ 'shape' => 'Notifications', ], 'NextToken' => [ 'shape' => 'GenericString', ], ], ], 'DescribeSubscribersForNotificationRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'Notification', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'Notification' => [ 'shape' => 'Notification', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'GenericString', ], ], ], 'DescribeSubscribersForNotificationResponse' => [ 'type' => 'structure', 'members' => [ 'Subscribers' => [ 'shape' => 'Subscribers', ], 'NextToken' => [ 'shape' => 'GenericString', ], ], ], 'DimensionValue' => [ 'type' => 'string', 'max' => 2147483647, 'min' => 0, 'pattern' => '[\\\\S\\\\s]*', ], 'DimensionValues' => [ 'type' => 'list', 'member' => [ 'shape' => 'DimensionValue', ], ], 'DuplicateRecordException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'EventType' => [ 'type' => 'string', 'enum' => [ 'SYSTEM', 'CREATE_ACTION', 'DELETE_ACTION', 'UPDATE_ACTION', 'EXECUTE_ACTION', ], ], 'ExecuteBudgetActionRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'ActionId', 'ExecutionType', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'ActionId' => [ 'shape' => 'ActionId', ], 'ExecutionType' => [ 'shape' => 'ExecutionType', ], ], ], 'ExecuteBudgetActionResponse' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'ActionId', 'ExecutionType', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'ActionId' => [ 'shape' => 'ActionId', ], 'ExecutionType' => [ 'shape' => 'ExecutionType', ], ], ], 'ExecutionType' => [ 'type' => 'string', 'enum' => [ 'APPROVE_BUDGET_ACTION', 'RETRY_BUDGET_ACTION', 'REVERSE_BUDGET_ACTION', 'RESET_BUDGET_ACTION', ], ], 'ExpiredNextTokenException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'GenericString' => [ 'type' => 'string', 'max' => 2147483647, 'min' => 0, 'pattern' => '.*', ], 'GenericTimestamp' => [ 'type' => 'timestamp', ], 'Group' => [ 'type' => 'string', 'max' => 640, 'min' => 1, 'pattern' => '^([\\\\u0021-\\\\u007F]+\\\\u002F)?[\\\\w+=,.@-]+$', ], 'Groups' => [ 'type' => 'list', 'member' => [ 'shape' => 'Group', ], 'max' => 100, 'min' => 1, ], 'HistoricalOptions' => [ 'type' => 'structure', 'required' => [ 'BudgetAdjustmentPeriod', ], 'members' => [ 'BudgetAdjustmentPeriod' => [ 'shape' => 'AdjustmentPeriod', ], 'LookBackAvailablePeriods' => [ 'shape' => 'AdjustmentPeriod', ], ], ], 'IamActionDefinition' => [ 'type' => 'structure', 'required' => [ 'PolicyArn', ], 'members' => [ 'PolicyArn' => [ 'shape' => 'PolicyArn', ], 'Roles' => [ 'shape' => 'Roles', ], 'Groups' => [ 'shape' => 'Groups', ], 'Users' => [ 'shape' => 'Users', ], ], ], 'InstanceId' => [ 'type' => 'string', 'max' => 63, 'min' => 1, 'pattern' => '^i-(\\\\w{8}|\\\\w{17})$|^[a-zA-Z]([\\\\w-]{0,61}\\\\w)?$', ], 'InstanceIds' => [ 'type' => 'list', 'member' => [ 'shape' => 'InstanceId', ], 'max' => 100, 'min' => 1, ], 'InternalErrorException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'InvalidNextTokenException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'InvalidParameterException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'MaxResults' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'MaxResultsBudgetNotifications' => [ 'type' => 'integer', 'box' => true, 'max' => 50, 'min' => 1, ], 'NotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'Notification' => [ 'type' => 'structure', 'required' => [ 'NotificationType', 'ComparisonOperator', 'Threshold', ], 'members' => [ 'NotificationType' => [ 'shape' => 'NotificationType', ], 'ComparisonOperator' => [ 'shape' => 'ComparisonOperator', ], 'Threshold' => [ 'shape' => 'NotificationThreshold', ], 'ThresholdType' => [ 'shape' => 'ThresholdType', ], 'NotificationState' => [ 'shape' => 'NotificationState', ], ], ], 'NotificationState' => [ 'type' => 'string', 'enum' => [ 'OK', 'ALARM', ], ], 'NotificationThreshold' => [ 'type' => 'double', 'max' => 15000000000000, 'min' => 0, ], 'NotificationType' => [ 'type' => 'string', 'enum' => [ 'ACTUAL', 'FORECASTED', ], ], 'NotificationWithSubscribers' => [ 'type' => 'structure', 'required' => [ 'Notification', 'Subscribers', ], 'members' => [ 'Notification' => [ 'shape' => 'Notification', ], 'Subscribers' => [ 'shape' => 'Subscribers', ], ], ], 'NotificationWithSubscribersList' => [ 'type' => 'list', 'member' => [ 'shape' => 'NotificationWithSubscribers', ], 'max' => 10, ], 'Notifications' => [ 'type' => 'list', 'member' => [ 'shape' => 'Notification', ], ], 'NullableBoolean' => [ 'type' => 'boolean', 'box' => true, ], 'NumericValue' => [ 'type' => 'string', 'max' => 2147483647, 'min' => 1, 'pattern' => '([0-9]*\\\\.)?[0-9]+', ], 'PlannedBudgetLimits' => [ 'type' => 'map', 'key' => [ 'shape' => 'GenericString', ], 'value' => [ 'shape' => 'Spend', ], ], 'PolicyArn' => [ 'type' => 'string', 'max' => 684, 'min' => 25, 'pattern' => '^arn:(aws|aws-cn|aws-us-gov|us-iso-east-1|us-isob-east-1):iam::(\\\\d{12}|aws):policy(\\\\u002F[\\\\u0021-\\\\u007F]+\\\\u002F|\\\\u002F)[\\\\w+=,.@-]+$', ], 'PolicyId' => [ 'type' => 'string', 'max' => 130, 'min' => 10, 'pattern' => '^p-[0-9a-zA-Z_]{8,128}$', ], 'Region' => [ 'type' => 'string', 'max' => 20, 'min' => 9, 'pattern' => '^\\\\w{2}-\\\\w+(-\\\\w+)?-\\\\d$', ], 'ResourceLockedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'Role' => [ 'type' => 'string', 'max' => 576, 'min' => 1, 'pattern' => '^([\\\\u0021-\\\\u007F]+\\\\u002F)?[\\\\w+=,.@-]+$', ], 'RoleArn' => [ 'type' => 'string', 'max' => 618, 'min' => 32, 'pattern' => '^arn:(aws|aws-cn|aws-us-gov|us-iso-east-1|us-isob-east-1):iam::\\\\d{12}:role(\\\\u002F[\\\\u0021-\\\\u007F]+\\\\u002F|\\\\u002F)[\\\\w+=,.@-]+$', ], 'Roles' => [ 'type' => 'list', 'member' => [ 'shape' => 'Role', ], 'max' => 100, 'min' => 1, ], 'ScpActionDefinition' => [ 'type' => 'structure', 'required' => [ 'PolicyId', 'TargetIds', ], 'members' => [ 'PolicyId' => [ 'shape' => 'PolicyId', ], 'TargetIds' => [ 'shape' => 'TargetIds', ], ], ], 'Spend' => [ 'type' => 'structure', 'required' => [ 'Amount', 'Unit', ], 'members' => [ 'Amount' => [ 'shape' => 'NumericValue', ], 'Unit' => [ 'shape' => 'UnitValue', ], ], ], 'SsmActionDefinition' => [ 'type' => 'structure', 'required' => [ 'ActionSubType', 'Region', 'InstanceIds', ], 'members' => [ 'ActionSubType' => [ 'shape' => 'ActionSubType', ], 'Region' => [ 'shape' => 'Region', ], 'InstanceIds' => [ 'shape' => 'InstanceIds', ], ], ], 'Subscriber' => [ 'type' => 'structure', 'required' => [ 'SubscriptionType', 'Address', ], 'members' => [ 'SubscriptionType' => [ 'shape' => 'SubscriptionType', ], 'Address' => [ 'shape' => 'SubscriberAddress', ], ], ], 'SubscriberAddress' => [ 'type' => 'string', 'max' => 2147483647, 'min' => 1, 'pattern' => '(.*[\\\\n\\\\r\\\\t\\\\f\\\\ ]?)*', 'sensitive' => true, ], 'Subscribers' => [ 'type' => 'list', 'member' => [ 'shape' => 'Subscriber', ], 'max' => 11, 'min' => 1, ], 'SubscriptionType' => [ 'type' => 'string', 'enum' => [ 'SNS', 'EMAIL', ], ], 'TargetId' => [ 'type' => 'string', 'max' => 68, 'min' => 12, 'pattern' => '^(ou-[0-9a-z]{4,32}-[a-z0-9]{8,32}$)|(\\\\d{12})', ], 'TargetIds' => [ 'type' => 'list', 'member' => [ 'shape' => 'TargetId', ], 'max' => 100, 'min' => 1, ], 'ThresholdType' => [ 'type' => 'string', 'enum' => [ 'PERCENTAGE', 'ABSOLUTE_VALUE', ], ], 'ThrottlingException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'TimePeriod' => [ 'type' => 'structure', 'members' => [ 'Start' => [ 'shape' => 'GenericTimestamp', ], 'End' => [ 'shape' => 'GenericTimestamp', ], ], ], 'TimeUnit' => [ 'type' => 'string', 'enum' => [ 'DAILY', 'MONTHLY', 'QUARTERLY', 'ANNUALLY', ], ], 'UnitValue' => [ 'type' => 'string', 'max' => 2147483647, 'min' => 1, 'pattern' => '.*', ], 'UpdateBudgetActionRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'ActionId', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'ActionId' => [ 'shape' => 'ActionId', ], 'NotificationType' => [ 'shape' => 'NotificationType', ], 'ActionThreshold' => [ 'shape' => 'ActionThreshold', ], 'Definition' => [ 'shape' => 'Definition', ], 'ExecutionRoleArn' => [ 'shape' => 'RoleArn', ], 'ApprovalModel' => [ 'shape' => 'ApprovalModel', ], 'Subscribers' => [ 'shape' => 'Subscribers', ], ], ], 'UpdateBudgetActionResponse' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'OldAction', 'NewAction', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'OldAction' => [ 'shape' => 'Action', ], 'NewAction' => [ 'shape' => 'Action', ], ], ], 'UpdateBudgetRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'NewBudget', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'NewBudget' => [ 'shape' => 'Budget', ], ], ], 'UpdateBudgetResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateNotificationRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'OldNotification', 'NewNotification', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'OldNotification' => [ 'shape' => 'Notification', ], 'NewNotification' => [ 'shape' => 'Notification', ], ], ], 'UpdateNotificationResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateSubscriberRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BudgetName', 'Notification', 'OldSubscriber', 'NewSubscriber', ], 'members' => [ 'AccountId' => [ 'shape' => 'AccountId', ], 'BudgetName' => [ 'shape' => 'BudgetName', ], 'Notification' => [ 'shape' => 'Notification', ], 'OldSubscriber' => [ 'shape' => 'Subscriber', ], 'NewSubscriber' => [ 'shape' => 'Subscriber', ], ], ], 'UpdateSubscriberResponse' => [ 'type' => 'structure', 'members' => [], ], 'User' => [ 'type' => 'string', 'max' => 576, 'min' => 1, 'pattern' => '^([\\\\u0021-\\\\u007F]+\\\\u002F)?[\\\\w+=,.@-]+$', ], 'Users' => [ 'type' => 'list', 'member' => [ 'shape' => 'User', ], 'max' => 100, 'min' => 1, ], 'errorMessage' => [ 'type' => 'string', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/budgets/2016-10-20/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>Use the Amazon Web Services Budgets API to plan your service usage, service costs, and instance reservations. This API reference provides descriptions, syntax, and usage examples for each of the actions and data types for the Amazon Web Services Budgets feature. </p> <p>Budgets provide you with a way to see the following information:</p> <ul> <li> <p>How close your plan is to your budgeted amount or to the free tier limits</p> </li> <li> <p>Your usage-to-date, including how much you\\'ve used of your Reserved Instances (RIs)</p> </li> <li> <p>Your current estimated charges from Amazon Web Services, and how much your predicted usage will accrue in charges by the end of the month</p> </li> <li> <p>How much of your budget has been used</p> </li> </ul> <p>Amazon Web Services updates your budget status several times a day. Budgets track your unblended costs, subscriptions, refunds, and RIs. You can create the following types of budgets:</p> <ul> <li> <p> <b>Cost budgets</b> - Plan how much you want to spend on a service.</p> </li> <li> <p> <b>Usage budgets</b> - Plan how much you want to use one or more services.</p> </li> <li> <p> <b>RI utilization budgets</b> - Define a utilization threshold, and receive alerts when your RI usage falls below that threshold. This lets you see if your RIs are unused or under-utilized.</p> </li> <li> <p> <b>RI coverage budgets</b> - Define a coverage threshold, and receive alerts when the number of your instance hours that are covered by RIs fall below that threshold. This lets you see how much of your instance usage is covered by a reservation.</p> </li> </ul> <p>Service Endpoint</p> <p>The Amazon Web Services Budgets API provides the following endpoint:</p> <ul> <li> <p>https://budgets.amazonaws.com</p> </li> </ul> <p>For information about costs that are associated with the Amazon Web Services Budgets API, see <a href=\"https://aws.amazon.com/aws-cost-management/pricing/\">Amazon Web Services Cost Management Pricing</a>.</p>', 'operations' => [ 'CreateBudget' => '<p>Creates a budget and, if included, notifications and subscribers. </p> <important> <p>Only one of <code>BudgetLimit</code> or <code>PlannedBudgetLimits</code> can be present in the syntax at one time. Use the syntax that matches your case. The Request Syntax section shows the <code>BudgetLimit</code> syntax. For <code>PlannedBudgetLimits</code>, see the <a href=\"https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_CreateBudget.html#API_CreateBudget_Examples\">Examples</a> section. </p> </important>', 'CreateBudgetAction' => '<p> Creates a budget action. </p>', 'CreateNotification' => '<p>Creates a notification. You must create the budget before you create the associated notification.</p>', 'CreateSubscriber' => '<p>Creates a subscriber. You must create the associated budget and notification before you create the subscriber.</p>', 'DeleteBudget' => '<p>Deletes a budget. You can delete your budget at any time.</p> <important> <p>Deleting a budget also deletes the notifications and subscribers that are associated with that budget.</p> </important>', 'DeleteBudgetAction' => '<p> Deletes a budget action. </p>', 'DeleteNotification' => '<p>Deletes a notification.</p> <important> <p>Deleting a notification also deletes the subscribers that are associated with the notification.</p> </important>', 'DeleteSubscriber' => '<p>Deletes a subscriber.</p> <important> <p>Deleting the last subscriber to a notification also deletes the notification.</p> </important>', 'DescribeBudget' => '<p>Describes a budget.</p> <important> <p>The Request Syntax section shows the <code>BudgetLimit</code> syntax. For <code>PlannedBudgetLimits</code>, see the <a href=\"https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_DescribeBudget.html#API_DescribeBudget_Examples\">Examples</a> section. </p> </important>', 'DescribeBudgetAction' => '<p> Describes a budget action detail. </p>', 'DescribeBudgetActionHistories' => '<p> Describes a budget action history detail. </p>', 'DescribeBudgetActionsForAccount' => '<p> Describes all of the budget actions for an account. </p>', 'DescribeBudgetActionsForBudget' => '<p> Describes all of the budget actions for a budget. </p>', 'DescribeBudgetNotificationsForAccount' => '<p> Lists the budget names and notifications that are associated with an account. </p>', 'DescribeBudgetPerformanceHistory' => '<p>Describes the history for <code>DAILY</code>, <code>MONTHLY</code>, and <code>QUARTERLY</code> budgets. Budget history isn\\'t available for <code>ANNUAL</code> budgets.</p>', 'DescribeBudgets' => '<p>Lists the budgets that are associated with an account.</p> <important> <p>The Request Syntax section shows the <code>BudgetLimit</code> syntax. For <code>PlannedBudgetLimits</code>, see the <a href=\"https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_DescribeBudgets.html#API_DescribeBudgets_Examples\">Examples</a> section. </p> </important>', 'DescribeNotificationsForBudget' => '<p>Lists the notifications that are associated with a budget.</p>', 'DescribeSubscribersForNotification' => '<p>Lists the subscribers that are associated with a notification.</p>', 'ExecuteBudgetAction' => '<p> Executes a budget action. </p>', 'UpdateBudget' => '<p>Updates a budget. You can change every part of a budget except for the <code>budgetName</code> and the <code>calculatedSpend</code>. When you modify a budget, the <code>calculatedSpend</code> drops to zero until Amazon Web Services has new usage data to use for forecasting.</p> <important> <p>Only one of <code>BudgetLimit</code> or <code>PlannedBudgetLimits</code> can be present in the syntax at one time. Use the syntax that matches your case. The Request Syntax section shows the <code>BudgetLimit</code> syntax. For <code>PlannedBudgetLimits</code>, see the <a href=\"https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_UpdateBudget.html#API_UpdateBudget_Examples\">Examples</a> section. </p> </important>', 'UpdateBudgetAction' => '<p> Updates a budget action. </p>', 'UpdateNotification' => '<p>Updates a notification.</p>', 'UpdateSubscriber' => '<p>Updates a subscriber.</p>', ], 'shapes' => [ 'AccessDeniedException' => [ 'base' => '<p>You are not authorized to use this operation with the given parameters.</p>', 'refs' => [], ], 'AccountId' => [ 'base' => '<p>The account ID of the user. It\\'s a 12-digit number.</p>', 'refs' => [ 'CreateBudgetActionRequest$AccountId' => NULL, 'CreateBudgetActionResponse$AccountId' => NULL, 'CreateBudgetRequest$AccountId' => '<p>The <code>accountId</code> that is associated with the budget.</p>', 'CreateNotificationRequest$AccountId' => '<p>The <code>accountId</code> that is associated with the budget that you want to create a notification for.</p>', 'CreateSubscriberRequest$AccountId' => '<p>The <code>accountId</code> that is associated with the budget that you want to create a subscriber for.</p>', 'DeleteBudgetActionRequest$AccountId' => NULL, 'DeleteBudgetActionResponse$AccountId' => NULL, 'DeleteBudgetRequest$AccountId' => '<p>The <code>accountId</code> that is associated with the budget that you want to delete.</p>', 'DeleteNotificationRequest$AccountId' => '<p>The <code>accountId</code> that is associated with the budget whose notification you want to delete.</p>', 'DeleteSubscriberRequest$AccountId' => '<p>The <code>accountId</code> that is associated with the budget whose subscriber you want to delete.</p>', 'DescribeBudgetActionHistoriesRequest$AccountId' => NULL, 'DescribeBudgetActionRequest$AccountId' => NULL, 'DescribeBudgetActionResponse$AccountId' => NULL, 'DescribeBudgetActionsForAccountRequest$AccountId' => NULL, 'DescribeBudgetActionsForBudgetRequest$AccountId' => NULL, 'DescribeBudgetNotificationsForAccountRequest$AccountId' => NULL, 'DescribeBudgetPerformanceHistoryRequest$AccountId' => NULL, 'DescribeBudgetRequest$AccountId' => '<p>The <code>accountId</code> that is associated with the budget that you want a description of.</p>', 'DescribeBudgetsRequest$AccountId' => '<p>The <code>accountId</code> that is associated with the budgets that you want descriptions of.</p>', 'DescribeNotificationsForBudgetRequest$AccountId' => '<p>The <code>accountId</code> that is associated with the budget whose notifications you want descriptions of.</p>', 'DescribeSubscribersForNotificationRequest$AccountId' => '<p>The <code>accountId</code> that is associated with the budget whose subscribers you want descriptions of.</p>', 'ExecuteBudgetActionRequest$AccountId' => NULL, 'ExecuteBudgetActionResponse$AccountId' => NULL, 'UpdateBudgetActionRequest$AccountId' => NULL, 'UpdateBudgetActionResponse$AccountId' => NULL, 'UpdateBudgetRequest$AccountId' => '<p>The <code>accountId</code> that is associated with the budget that you want to update.</p>', 'UpdateNotificationRequest$AccountId' => '<p>The <code>accountId</code> that is associated with the budget whose notification you want to update.</p>', 'UpdateSubscriberRequest$AccountId' => '<p>The <code>accountId</code> that is associated with the budget whose subscriber you want to update.</p>', ], ], 'Action' => [ 'base' => '<p>A budget action resource. </p>', 'refs' => [ 'ActionHistoryDetails$Action' => '<p>The budget action resource. </p>', 'Actions$member' => NULL, 'DeleteBudgetActionResponse$Action' => NULL, 'DescribeBudgetActionResponse$Action' => '<p> A budget action resource. </p>', 'UpdateBudgetActionResponse$OldAction' => '<p> The previous action resource information. </p>', 'UpdateBudgetActionResponse$NewAction' => '<p> The updated action resource information. </p>', ], ], 'ActionHistories' => [ 'base' => NULL, 'refs' => [ 'DescribeBudgetActionHistoriesResponse$ActionHistories' => '<p> The historical record of the budget action resource. </p>', ], ], 'ActionHistory' => [ 'base' => '<p>The historical records for a budget action. </p>', 'refs' => [ 'ActionHistories$member' => NULL, ], ], 'ActionHistoryDetails' => [ 'base' => '<p>The description of the details for the event. </p>', 'refs' => [ 'ActionHistory$ActionHistoryDetails' => '<p>The description of the details for the event. </p>', ], ], 'ActionId' => [ 'base' => NULL, 'refs' => [ 'Action$ActionId' => '<p>A system-generated universally unique identifier (UUID) for the action. </p>', 'CreateBudgetActionResponse$ActionId' => '<p> A system-generated universally unique identifier (UUID) for the action. </p>', 'DeleteBudgetActionRequest$ActionId' => '<p> A system-generated universally unique identifier (UUID) for the action. </p>', 'DescribeBudgetActionHistoriesRequest$ActionId' => '<p> A system-generated universally unique identifier (UUID) for the action. </p>', 'DescribeBudgetActionRequest$ActionId' => '<p> A system-generated universally unique identifier (UUID) for the action. </p>', 'ExecuteBudgetActionRequest$ActionId' => '<p> A system-generated universally unique identifier (UUID) for the action. </p>', 'ExecuteBudgetActionResponse$ActionId' => '<p> A system-generated universally unique identifier (UUID) for the action. </p>', 'UpdateBudgetActionRequest$ActionId' => '<p> A system-generated universally unique identifier (UUID) for the action. </p>', ], ], 'ActionStatus' => [ 'base' => NULL, 'refs' => [ 'Action$Status' => '<p>The status of the action. </p>', 'ActionHistory$Status' => '<p>The status of action at the time of the event. </p>', ], ], 'ActionSubType' => [ 'base' => NULL, 'refs' => [ 'SsmActionDefinition$ActionSubType' => '<p>The action subType. </p>', ], ], 'ActionThreshold' => [ 'base' => '<p>The trigger threshold of the action. </p>', 'refs' => [ 'Action$ActionThreshold' => '<p>The trigger threshold of the action. </p>', 'CreateBudgetActionRequest$ActionThreshold' => NULL, 'UpdateBudgetActionRequest$ActionThreshold' => NULL, ], ], 'ActionType' => [ 'base' => NULL, 'refs' => [ 'Action$ActionType' => '<p>The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition. </p>', 'CreateBudgetActionRequest$ActionType' => '<p> The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition. </p>', ], ], 'Actions' => [ 'base' => NULL, 'refs' => [ 'DescribeBudgetActionsForAccountResponse$Actions' => '<p> A list of the budget action resources information. </p>', 'DescribeBudgetActionsForBudgetResponse$Actions' => '<p> A list of the budget action resources information. </p>', ], ], 'AdjustmentPeriod' => [ 'base' => NULL, 'refs' => [ 'HistoricalOptions$BudgetAdjustmentPeriod' => '<p>The number of budget periods included in the moving-average calculation that determines your auto-adjusted budget amount. The maximum value depends on the <code>TimeUnit</code> granularity of the budget:</p> <ul> <li> <p>For the <code>DAILY</code> granularity, the maximum value is <code>60</code>.</p> </li> <li> <p>For the <code>MONTHLY</code> granularity, the maximum value is <code>12</code>.</p> </li> <li> <p>For the <code>QUARTERLY</code> granularity, the maximum value is <code>4</code>.</p> </li> <li> <p>For the <code>ANNUALLY</code> granularity, the maximum value is <code>1</code>.</p> </li> </ul>', 'HistoricalOptions$LookBackAvailablePeriods' => '<p>The integer that describes how many budget periods in your <code>BudgetAdjustmentPeriod</code> are included in the calculation of your current <code>BudgetLimit</code>. If the first budget period in your <code>BudgetAdjustmentPeriod</code> has no cost data, then that budget period isn\u00e2\u20ac\u2122t included in the average that determines your budget limit. </p> <p>For example, if you set <code>BudgetAdjustmentPeriod</code> as <code>4</code> quarters, but your account had no cost data in the first quarter, then only the last three quarters are included in the calculation. In this scenario, <code>LookBackAvailablePeriods</code> returns <code>3</code>. </p> <p>You can\u00e2\u20ac\u2122t set your own <code>LookBackAvailablePeriods</code>. The value is automatically calculated from the <code>BudgetAdjustmentPeriod</code> and your historical cost data.</p>', ], ], 'ApprovalModel' => [ 'base' => NULL, 'refs' => [ 'Action$ApprovalModel' => '<p>This specifies if the action needs manual or automatic approval. </p>', 'CreateBudgetActionRequest$ApprovalModel' => '<p> This specifies if the action needs manual or automatic approval. </p>', 'UpdateBudgetActionRequest$ApprovalModel' => '<p> This specifies if the action needs manual or automatic approval. </p>', ], ], 'AutoAdjustData' => [ 'base' => '<p>The parameters that determine the budget amount for an auto-adjusting budget.</p>', 'refs' => [ 'Budget$AutoAdjustData' => '<p>The parameters that determine the budget amount for an auto-adjusting budget.</p>', ], ], 'AutoAdjustType' => [ 'base' => NULL, 'refs' => [ 'AutoAdjustData$AutoAdjustType' => '<p>The string that defines whether your budget auto-adjusts based on historical or forecasted data.</p>', ], ], 'Budget' => [ 'base' => '<p>Represents the output of the <code>CreateBudget</code> operation. The content consists of the detailed metadata and data file information, and the current status of the <code>budget</code> object.</p> <p>This is the Amazon Resource Name (ARN) pattern for a budget: </p> <p> <code>arn:aws:budgets::AccountId:budget/budgetName</code> </p>', 'refs' => [ 'Budgets$member' => NULL, 'CreateBudgetRequest$Budget' => '<p>The budget object that you want to create.</p>', 'DescribeBudgetResponse$Budget' => '<p>The description of the budget.</p>', 'UpdateBudgetRequest$NewBudget' => '<p>The budget that you want to update your budget to.</p>', ], ], 'BudgetName' => [ 'base' => '<p> A string that represents the budget name. The \":\" and \"\\\\\" characters aren\\'t allowed.</p>', 'refs' => [ 'Action$BudgetName' => NULL, 'Budget$BudgetName' => '<p>The name of a budget. The name must be unique within an account. The <code>:</code> and <code>\\\\</code> characters aren\\'t allowed in <code>BudgetName</code>.</p>', 'BudgetNotificationsForAccount$BudgetName' => NULL, 'BudgetPerformanceHistory$BudgetName' => NULL, 'CreateBudgetActionRequest$BudgetName' => NULL, 'CreateBudgetActionResponse$BudgetName' => NULL, 'CreateNotificationRequest$BudgetName' => '<p>The name of the budget that you want Amazon Web Services to notify you about. Budget names must be unique within an account.</p>', 'CreateSubscriberRequest$BudgetName' => '<p>The name of the budget that you want to subscribe to. Budget names must be unique within an account.</p>', 'DeleteBudgetActionRequest$BudgetName' => NULL, 'DeleteBudgetActionResponse$BudgetName' => NULL, 'DeleteBudgetRequest$BudgetName' => '<p>The name of the budget that you want to delete.</p>', 'DeleteNotificationRequest$BudgetName' => '<p>The name of the budget whose notification you want to delete.</p>', 'DeleteSubscriberRequest$BudgetName' => '<p>The name of the budget whose subscriber you want to delete.</p>', 'DescribeBudgetActionHistoriesRequest$BudgetName' => NULL, 'DescribeBudgetActionRequest$BudgetName' => NULL, 'DescribeBudgetActionResponse$BudgetName' => NULL, 'DescribeBudgetActionsForBudgetRequest$BudgetName' => NULL, 'DescribeBudgetPerformanceHistoryRequest$BudgetName' => NULL, 'DescribeBudgetRequest$BudgetName' => '<p>The name of the budget that you want a description of.</p>', 'DescribeNotificationsForBudgetRequest$BudgetName' => '<p>The name of the budget whose notifications you want descriptions of.</p>', 'DescribeSubscribersForNotificationRequest$BudgetName' => '<p>The name of the budget whose subscribers you want descriptions of.</p>', 'ExecuteBudgetActionRequest$BudgetName' => NULL, 'ExecuteBudgetActionResponse$BudgetName' => NULL, 'UpdateBudgetActionRequest$BudgetName' => NULL, 'UpdateBudgetActionResponse$BudgetName' => NULL, 'UpdateNotificationRequest$BudgetName' => '<p>The name of the budget whose notification you want to update.</p>', 'UpdateSubscriberRequest$BudgetName' => '<p>The name of the budget whose subscriber you want to update.</p>', ], ], 'BudgetNotificationsForAccount' => [ 'base' => '<p> The budget name and associated notifications for an account. </p>', 'refs' => [ 'BudgetNotificationsForAccountList$member' => NULL, ], ], 'BudgetNotificationsForAccountList' => [ 'base' => NULL, 'refs' => [ 'DescribeBudgetNotificationsForAccountResponse$BudgetNotificationsForAccount' => '<p> A list of budget names and associated notifications for an account. </p>', ], ], 'BudgetPerformanceHistory' => [ 'base' => '<p>A history of the state of a budget at the end of the budget\\'s specified time period.</p>', 'refs' => [ 'DescribeBudgetPerformanceHistoryResponse$BudgetPerformanceHistory' => '<p>The history of how often the budget has gone into an <code>ALARM</code> state.</p> <p>For <code>DAILY</code> budgets, the history saves the state of the budget for the last 60 days. For <code>MONTHLY</code> budgets, the history saves the state of the budget for the current month plus the last 12 months. For <code>QUARTERLY</code> budgets, the history saves the state of the budget for the last four quarters.</p>', ], ], 'BudgetType' => [ 'base' => '<p> The type of a budget. It must be one of the following types: </p> <p> <code>COST</code>, <code>USAGE</code>, <code>RI_UTILIZATION</code>, <code>RI_COVERAGE</code>, <code>SAVINGS_PLANS_UTILIZATION</code>, or <code>SAVINGS_PLANS_COVERAGE</code>.</p>', 'refs' => [ 'Budget$BudgetType' => '<p>Specifies whether this budget tracks costs, usage, RI utilization, RI coverage, Savings Plans utilization, or Savings Plans coverage.</p>', 'BudgetPerformanceHistory$BudgetType' => NULL, ], ], 'BudgetedAndActualAmounts' => [ 'base' => '<p>The amount of cost or usage that you created the budget for, compared to your actual costs or usage.</p>', 'refs' => [ 'BudgetedAndActualAmountsList$member' => NULL, ], ], 'BudgetedAndActualAmountsList' => [ 'base' => NULL, 'refs' => [ 'BudgetPerformanceHistory$BudgetedAndActualAmountsList' => '<p>A list of amounts of cost or usage that you created budgets for, which are compared to your actual costs or usage.</p>', ], ], 'Budgets' => [ 'base' => '<p> A list of budgets.</p>', 'refs' => [ 'DescribeBudgetsResponse$Budgets' => '<p>A list of budgets.</p>', ], ], 'CalculatedSpend' => [ 'base' => '<p>The spend objects that are associated with this budget. The <code>actualSpend</code> tracks how much you\\'ve used, cost, usage, RI units, or Savings Plans units and the <code>forecastedSpend</code> tracks how much that you\\'re predicted to spend based on your historical usage profile.</p> <p>For example, if it\\'s the 20th of the month and you have spent <code>50</code> dollars on Amazon EC2, your <code>actualSpend</code> is <code>50 USD</code>, and your <code>forecastedSpend</code> is <code>75 USD</code>.</p>', 'refs' => [ 'Budget$CalculatedSpend' => '<p>The actual and forecasted cost or usage that the budget tracks.</p>', ], ], 'ComparisonOperator' => [ 'base' => '<p> The comparison operator of a notification. Currently, the service supports the following operators:</p> <p> <code>GREATER_THAN</code>, <code>LESS_THAN</code>, <code>EQUAL_TO</code> </p>', 'refs' => [ 'Notification$ComparisonOperator' => '<p>The comparison that\\'s used for this notification.</p>', ], ], 'CostFilters' => [ 'base' => '<p> A map that represents the cost filters that are applied to the budget.</p>', 'refs' => [ 'Budget$CostFilters' => '<p>The cost filters, such as <code>Region</code>, <code>Service</code>, <code>member account</code>, <code>Tag</code>, or <code>Cost Category</code>, that are applied to a budget.</p> <p>Amazon Web Services Budgets supports the following services as a <code>Service</code> filter for RI budgets:</p> <ul> <li> <p>Amazon EC2</p> </li> <li> <p>Amazon Redshift</p> </li> <li> <p>Amazon Relational Database Service</p> </li> <li> <p>Amazon ElastiCache</p> </li> <li> <p>Amazon OpenSearch Service</p> </li> </ul>', 'BudgetPerformanceHistory$CostFilters' => '<p>The history of the cost filters for a budget during the specified time period.</p>', ], ], 'CostTypes' => [ 'base' => '<p>The types of cost that are included in a <code>COST</code> budget, such as tax and subscriptions.</p> <p> <code>USAGE</code>, <code>RI_UTILIZATION</code>, <code>RI_COVERAGE</code>, <code>SAVINGS_PLANS_UTILIZATION</code>, and <code>SAVINGS_PLANS_COVERAGE</code> budgets don\\'t have <code>CostTypes</code>.</p>', 'refs' => [ 'Budget$CostTypes' => '<p>The types of costs that are included in this <code>COST</code> budget.</p> <p> <code>USAGE</code>, <code>RI_UTILIZATION</code>, <code>RI_COVERAGE</code>, <code>SAVINGS_PLANS_UTILIZATION</code>, and <code>SAVINGS_PLANS_COVERAGE</code> budgets do not have <code>CostTypes</code>.</p>', 'BudgetPerformanceHistory$CostTypes' => '<p>The history of the cost types for a budget during the specified time period.</p>', ], ], 'CreateBudgetActionRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateBudgetActionResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateBudgetRequest' => [ 'base' => '<p> Request of CreateBudget </p>', 'refs' => [], ], 'CreateBudgetResponse' => [ 'base' => '<p> Response of CreateBudget </p>', 'refs' => [], ], 'CreateNotificationRequest' => [ 'base' => '<p> Request of CreateNotification </p>', 'refs' => [], ], 'CreateNotificationResponse' => [ 'base' => '<p> Response of CreateNotification </p>', 'refs' => [], ], 'CreateSubscriberRequest' => [ 'base' => '<p> Request of CreateSubscriber </p>', 'refs' => [], ], 'CreateSubscriberResponse' => [ 'base' => '<p> Response of CreateSubscriber </p>', 'refs' => [], ], 'CreationLimitExceededException' => [ 'base' => '<p>You\\'ve exceeded the notification or subscriber limit.</p>', 'refs' => [], ], 'Definition' => [ 'base' => '<p>Specifies all of the type-specific parameters. </p>', 'refs' => [ 'Action$Definition' => '<p>Where you specify all of the type-specific parameters. </p>', 'CreateBudgetActionRequest$Definition' => NULL, 'UpdateBudgetActionRequest$Definition' => NULL, ], ], 'DeleteBudgetActionRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteBudgetActionResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteBudgetRequest' => [ 'base' => '<p> Request of DeleteBudget </p>', 'refs' => [], ], 'DeleteBudgetResponse' => [ 'base' => '<p> Response of DeleteBudget </p>', 'refs' => [], ], 'DeleteNotificationRequest' => [ 'base' => '<p> Request of DeleteNotification </p>', 'refs' => [], ], 'DeleteNotificationResponse' => [ 'base' => '<p> Response of DeleteNotification </p>', 'refs' => [], ], 'DeleteSubscriberRequest' => [ 'base' => '<p> Request of DeleteSubscriber </p>', 'refs' => [], ], 'DeleteSubscriberResponse' => [ 'base' => '<p> Response of DeleteSubscriber </p>', 'refs' => [], ], 'DescribeBudgetActionHistoriesRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeBudgetActionHistoriesResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeBudgetActionRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeBudgetActionResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeBudgetActionsForAccountRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeBudgetActionsForAccountResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeBudgetActionsForBudgetRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeBudgetActionsForBudgetResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeBudgetNotificationsForAccountRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeBudgetNotificationsForAccountResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeBudgetPerformanceHistoryRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeBudgetPerformanceHistoryResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeBudgetRequest' => [ 'base' => '<p> Request of DescribeBudget </p>', 'refs' => [], ], 'DescribeBudgetResponse' => [ 'base' => '<p> Response of DescribeBudget </p>', 'refs' => [], ], 'DescribeBudgetsRequest' => [ 'base' => '<p> Request of DescribeBudgets </p>', 'refs' => [], ], 'DescribeBudgetsResponse' => [ 'base' => '<p> Response of DescribeBudgets </p>', 'refs' => [], ], 'DescribeNotificationsForBudgetRequest' => [ 'base' => '<p> Request of DescribeNotificationsForBudget </p>', 'refs' => [], ], 'DescribeNotificationsForBudgetResponse' => [ 'base' => '<p> Response of GetNotificationsForBudget </p>', 'refs' => [], ], 'DescribeSubscribersForNotificationRequest' => [ 'base' => '<p> Request of DescribeSubscribersForNotification </p>', 'refs' => [], ], 'DescribeSubscribersForNotificationResponse' => [ 'base' => '<p> Response of DescribeSubscribersForNotification </p>', 'refs' => [], ], 'DimensionValue' => [ 'base' => NULL, 'refs' => [ 'DimensionValues$member' => NULL, ], ], 'DimensionValues' => [ 'base' => NULL, 'refs' => [ 'CostFilters$value' => NULL, ], ], 'DuplicateRecordException' => [ 'base' => '<p>The budget name already exists. Budget names must be unique within an account.</p>', 'refs' => [], ], 'EventType' => [ 'base' => NULL, 'refs' => [ 'ActionHistory$EventType' => '<p>This distinguishes between whether the events are triggered by the user or are generated by the system. </p>', ], ], 'ExecuteBudgetActionRequest' => [ 'base' => NULL, 'refs' => [], ], 'ExecuteBudgetActionResponse' => [ 'base' => NULL, 'refs' => [], ], 'ExecutionType' => [ 'base' => NULL, 'refs' => [ 'ExecuteBudgetActionRequest$ExecutionType' => '<p> The type of execution. </p>', 'ExecuteBudgetActionResponse$ExecutionType' => '<p> The type of execution. </p>', ], ], 'ExpiredNextTokenException' => [ 'base' => '<p>The pagination token expired.</p>', 'refs' => [], ], 'GenericString' => [ 'base' => '<p> A generic string.</p>', 'refs' => [ 'ActionHistoryDetails$Message' => NULL, 'CostFilters$key' => NULL, 'DescribeBudgetActionHistoriesRequest$NextToken' => NULL, 'DescribeBudgetActionHistoriesResponse$NextToken' => NULL, 'DescribeBudgetActionsForAccountRequest$NextToken' => NULL, 'DescribeBudgetActionsForAccountResponse$NextToken' => NULL, 'DescribeBudgetActionsForBudgetRequest$NextToken' => NULL, 'DescribeBudgetActionsForBudgetResponse$NextToken' => NULL, 'DescribeBudgetNotificationsForAccountRequest$NextToken' => NULL, 'DescribeBudgetNotificationsForAccountResponse$NextToken' => NULL, 'DescribeBudgetPerformanceHistoryRequest$NextToken' => NULL, 'DescribeBudgetPerformanceHistoryResponse$NextToken' => NULL, 'DescribeBudgetsRequest$NextToken' => '<p>The pagination token that you include in your request to indicate the next set of results that you want to retrieve.</p>', 'DescribeBudgetsResponse$NextToken' => '<p>The pagination token in the service response that indicates the next set of results that you can retrieve.</p>', 'DescribeNotificationsForBudgetRequest$NextToken' => '<p>The pagination token that you include in your request to indicate the next set of results that you want to retrieve.</p>', 'DescribeNotificationsForBudgetResponse$NextToken' => '<p>The pagination token in the service response that indicates the next set of results that you can retrieve.</p>', 'DescribeSubscribersForNotificationRequest$NextToken' => '<p>The pagination token that you include in your request to indicate the next set of results that you want to retrieve.</p>', 'DescribeSubscribersForNotificationResponse$NextToken' => '<p>The pagination token in the service response that indicates the next set of results that you can retrieve.</p>', 'PlannedBudgetLimits$key' => NULL, ], ], 'GenericTimestamp' => [ 'base' => '<p> A generic time stamp. In Java, it\\'s transformed to a <code>Date</code> object.</p>', 'refs' => [ 'ActionHistory$Timestamp' => NULL, 'AutoAdjustData$LastAutoAdjustTime' => '<p>The last time that your budget was auto-adjusted.</p>', 'Budget$LastUpdatedTime' => '<p>The last time that you updated this budget.</p>', 'TimePeriod$Start' => '<p>The start date for a budget. If you created your budget and didn\\'t specify a start date, Amazon Web Services defaults to the start of your chosen time period (DAILY, MONTHLY, QUARTERLY, or ANNUALLY). For example, if you created your budget on January 24, 2018, chose <code>DAILY</code>, and didn\\'t set a start date, Amazon Web Services set your start date to <code>01/24/18 00:00 UTC</code>. If you chose <code>MONTHLY</code>, Amazon Web Services set your start date to <code>01/01/18 00:00 UTC</code>. The defaults are the same for the Billing and Cost Management console and the API.</p> <p>You can change your start date with the <code>UpdateBudget</code> operation.</p>', 'TimePeriod$End' => '<p>The end date for a budget. If you didn\\'t specify an end date, Amazon Web Services set your end date to <code>06/15/87 00:00 UTC</code>. The defaults are the same for the Billing and Cost Management console and the API.</p> <p>After the end date, Amazon Web Services deletes the budget and all the associated notifications and subscribers. You can change your end date with the <code>UpdateBudget</code> operation.</p>', ], ], 'Group' => [ 'base' => NULL, 'refs' => [ 'Groups$member' => NULL, ], ], 'Groups' => [ 'base' => NULL, 'refs' => [ 'IamActionDefinition$Groups' => '<p>A list of groups to be attached. There must be at least one group. </p>', ], ], 'HistoricalOptions' => [ 'base' => '<p>The parameters that define or describe the historical data that your auto-adjusting budget is based on.</p>', 'refs' => [ 'AutoAdjustData$HistoricalOptions' => '<p>The parameters that define or describe the historical data that your auto-adjusting budget is based on.</p>', ], ], 'IamActionDefinition' => [ 'base' => '<p>The Identity and Access Management (IAM) action definition details. </p>', 'refs' => [ 'Definition$IamActionDefinition' => '<p>The Identity and Access Management (IAM) action definition details. </p>', ], ], 'InstanceId' => [ 'base' => NULL, 'refs' => [ 'InstanceIds$member' => NULL, ], ], 'InstanceIds' => [ 'base' => NULL, 'refs' => [ 'SsmActionDefinition$InstanceIds' => '<p>The EC2 and RDS instance IDs. </p>', ], ], 'InternalErrorException' => [ 'base' => '<p>An error on the server occurred during the processing of your request. Try again later.</p>', 'refs' => [], ], 'InvalidNextTokenException' => [ 'base' => '<p>The pagination token is invalid.</p>', 'refs' => [], ], 'InvalidParameterException' => [ 'base' => '<p>An error on the client occurred. Typically, the cause is an invalid input value.</p>', 'refs' => [], ], 'MaxResults' => [ 'base' => '<p> An integer that represents how many entries a paginated response contains. The maximum is 100.</p>', 'refs' => [ 'DescribeBudgetActionHistoriesRequest$MaxResults' => NULL, 'DescribeBudgetActionsForAccountRequest$MaxResults' => NULL, 'DescribeBudgetActionsForBudgetRequest$MaxResults' => NULL, 'DescribeBudgetPerformanceHistoryRequest$MaxResults' => NULL, 'DescribeBudgetsRequest$MaxResults' => '<p>An optional integer that represents how many entries a paginated response contains. The maximum is 100.</p>', 'DescribeNotificationsForBudgetRequest$MaxResults' => '<p>An optional integer that represents how many entries a paginated response contains. The maximum is 100.</p>', 'DescribeSubscribersForNotificationRequest$MaxResults' => '<p>An optional integer that represents how many entries a paginated response contains. The maximum is 100.</p>', ], ], 'MaxResultsBudgetNotifications' => [ 'base' => NULL, 'refs' => [ 'DescribeBudgetNotificationsForAccountRequest$MaxResults' => '<p> An integer that shows how many budget name entries a paginated response contains. </p>', ], ], 'NotFoundException' => [ 'base' => '<p>We can\u00e2\u20ac\u2122t locate the resource that you specified.</p>', 'refs' => [], ], 'Notification' => [ 'base' => '<p>A notification that\\'s associated with a budget. A budget can have up to ten notifications. </p> <p>Each notification must have at least one subscriber. A notification can have one SNS subscriber and up to 10 email subscribers, for a total of 11 subscribers.</p> <p>For example, if you have a budget for 200 dollars and you want to be notified when you go over 160 dollars, create a notification with the following parameters:</p> <ul> <li> <p>A notificationType of <code>ACTUAL</code> </p> </li> <li> <p>A <code>thresholdType</code> of <code>PERCENTAGE</code> </p> </li> <li> <p>A <code>comparisonOperator</code> of <code>GREATER_THAN</code> </p> </li> <li> <p>A notification <code>threshold</code> of <code>80</code> </p> </li> </ul>', 'refs' => [ 'CreateNotificationRequest$Notification' => '<p>The notification that you want to create.</p>', 'CreateSubscriberRequest$Notification' => '<p>The notification that you want to create a subscriber for.</p>', 'DeleteNotificationRequest$Notification' => '<p>The notification that you want to delete.</p>', 'DeleteSubscriberRequest$Notification' => '<p>The notification whose subscriber you want to delete.</p>', 'DescribeSubscribersForNotificationRequest$Notification' => '<p>The notification whose subscribers you want to list.</p>', 'NotificationWithSubscribers$Notification' => '<p>The notification that\\'s associated with a budget.</p>', 'Notifications$member' => NULL, 'UpdateNotificationRequest$OldNotification' => '<p>The previous notification that is associated with a budget.</p>', 'UpdateNotificationRequest$NewNotification' => '<p>The updated notification to be associated with a budget.</p>', 'UpdateSubscriberRequest$Notification' => '<p>The notification whose subscriber you want to update.</p>', ], ], 'NotificationState' => [ 'base' => NULL, 'refs' => [ 'Notification$NotificationState' => '<p>Specifies whether this notification is in alarm. If a budget notification is in the <code>ALARM</code> state, you passed the set threshold for the budget.</p>', ], ], 'NotificationThreshold' => [ 'base' => '<p> The threshold of a notification.</p>', 'refs' => [ 'ActionThreshold$ActionThresholdValue' => NULL, 'Notification$Threshold' => '<p>The threshold that\\'s associated with a notification. Thresholds are always a percentage, and many customers find value being alerted between 50% - 200% of the budgeted amount. The maximum limit for your threshold is 1,000,000% above the budgeted amount.</p>', ], ], 'NotificationType' => [ 'base' => '<p> The type of a notification. It must be ACTUAL or FORECASTED.</p>', 'refs' => [ 'Action$NotificationType' => NULL, 'CreateBudgetActionRequest$NotificationType' => NULL, 'Notification$NotificationType' => '<p>Specifies whether the notification is for how much you have spent (<code>ACTUAL</code>) or for how much that you\\'re forecasted to spend (<code>FORECASTED</code>).</p>', 'UpdateBudgetActionRequest$NotificationType' => NULL, ], ], 'NotificationWithSubscribers' => [ 'base' => '<p>A notification with subscribers. A notification can have one SNS subscriber and up to 10 email subscribers, for a total of 11 subscribers.</p>', 'refs' => [ 'NotificationWithSubscribersList$member' => NULL, ], ], 'NotificationWithSubscribersList' => [ 'base' => '<p> A list of notifications, each with a list of subscribers.</p>', 'refs' => [ 'CreateBudgetRequest$NotificationsWithSubscribers' => '<p>A notification that you want to associate with a budget. A budget can have up to five notifications, and each notification can have one SNS subscriber and up to 10 email subscribers. If you include notifications and subscribers in your <code>CreateBudget</code> call, Amazon Web Services creates the notifications and subscribers for you.</p>', ], ], 'Notifications' => [ 'base' => '<p> A list of notifications.</p>', 'refs' => [ 'BudgetNotificationsForAccount$Notifications' => NULL, 'DescribeNotificationsForBudgetResponse$Notifications' => '<p>A list of notifications that are associated with a budget.</p>', ], ], 'NullableBoolean' => [ 'base' => NULL, 'refs' => [ 'CostTypes$IncludeTax' => '<p>Specifies whether a budget includes taxes.</p> <p>The default value is <code>true</code>.</p>', 'CostTypes$IncludeSubscription' => '<p>Specifies whether a budget includes subscriptions.</p> <p>The default value is <code>true</code>.</p>', 'CostTypes$UseBlended' => '<p>Specifies whether a budget uses a blended rate.</p> <p>The default value is <code>false</code>.</p>', 'CostTypes$IncludeRefund' => '<p>Specifies whether a budget includes refunds.</p> <p>The default value is <code>true</code>.</p>', 'CostTypes$IncludeCredit' => '<p>Specifies whether a budget includes credits.</p> <p>The default value is <code>true</code>.</p>', 'CostTypes$IncludeUpfront' => '<p>Specifies whether a budget includes upfront RI costs.</p> <p>The default value is <code>true</code>.</p>', 'CostTypes$IncludeRecurring' => '<p>Specifies whether a budget includes recurring fees such as monthly RI fees.</p> <p>The default value is <code>true</code>.</p>', 'CostTypes$IncludeOtherSubscription' => '<p>Specifies whether a budget includes non-RI subscription costs.</p> <p>The default value is <code>true</code>.</p>', 'CostTypes$IncludeSupport' => '<p>Specifies whether a budget includes support subscription fees.</p> <p>The default value is <code>true</code>.</p>', 'CostTypes$IncludeDiscount' => '<p>Specifies whether a budget includes discounts.</p> <p>The default value is <code>true</code>.</p>', 'CostTypes$UseAmortized' => '<p>Specifies whether a budget uses the amortized rate.</p> <p>The default value is <code>false</code>.</p>', ], ], 'NumericValue' => [ 'base' => '<p> A string that represents a numeric value.</p>', 'refs' => [ 'Spend$Amount' => '<p>The cost or usage amount that\\'s associated with a budget forecast, actual spend, or budget threshold.</p>', ], ], 'PlannedBudgetLimits' => [ 'base' => NULL, 'refs' => [ 'Budget$PlannedBudgetLimits' => '<p>A map containing multiple <code>BudgetLimit</code>, including current or future limits.</p> <p> <code>PlannedBudgetLimits</code> is available for cost or usage budget and supports both monthly and quarterly <code>TimeUnit</code>. </p> <p>For monthly budgets, provide 12 months of <code>PlannedBudgetLimits</code> values. This must start from the current month and include the next 11 months. The <code>key</code> is the start of the month, <code>UTC</code> in epoch seconds. </p> <p>For quarterly budgets, provide four quarters of <code>PlannedBudgetLimits</code> value entries in standard calendar quarter increments. This must start from the current quarter and include the next three quarters. The <code>key</code> is the start of the quarter, <code>UTC</code> in epoch seconds. </p> <p>If the planned budget expires before 12 months for monthly or four quarters for quarterly, provide the <code>PlannedBudgetLimits</code> values only for the remaining periods.</p> <p>If the budget begins at a date in the future, provide <code>PlannedBudgetLimits</code> values from the start date of the budget. </p> <p>After all of the <code>BudgetLimit</code> values in <code>PlannedBudgetLimits</code> are used, the budget continues to use the last limit as the <code>BudgetLimit</code>. At that point, the planned budget provides the same experience as a fixed budget. </p> <p> <code>DescribeBudget</code> and <code>DescribeBudgets</code> response along with <code>PlannedBudgetLimits</code> also contain <code>BudgetLimit</code> representing the current month or quarter limit present in <code>PlannedBudgetLimits</code>. This only applies to budgets that are created with <code>PlannedBudgetLimits</code>. Budgets that are created without <code>PlannedBudgetLimits</code> only contain <code>BudgetLimit</code>. They don\\'t contain <code>PlannedBudgetLimits</code>.</p>', ], ], 'PolicyArn' => [ 'base' => NULL, 'refs' => [ 'IamActionDefinition$PolicyArn' => '<p>The Amazon Resource Name (ARN) of the policy to be attached. </p>', ], ], 'PolicyId' => [ 'base' => NULL, 'refs' => [ 'ScpActionDefinition$PolicyId' => '<p>The policy ID attached. </p>', ], ], 'Region' => [ 'base' => NULL, 'refs' => [ 'SsmActionDefinition$Region' => '<p>The Region to run the SSM document. </p>', ], ], 'ResourceLockedException' => [ 'base' => '<p> The request was received and recognized by the server, but the server rejected that particular method for the requested resource. </p>', 'refs' => [], ], 'Role' => [ 'base' => NULL, 'refs' => [ 'Roles$member' => NULL, ], ], 'RoleArn' => [ 'base' => NULL, 'refs' => [ 'Action$ExecutionRoleArn' => '<p>The role passed for action execution and reversion. Roles and actions must be in the same account. </p>', 'CreateBudgetActionRequest$ExecutionRoleArn' => '<p> The role passed for action execution and reversion. Roles and actions must be in the same account. </p>', 'UpdateBudgetActionRequest$ExecutionRoleArn' => '<p> The role passed for action execution and reversion. Roles and actions must be in the same account. </p>', ], ], 'Roles' => [ 'base' => NULL, 'refs' => [ 'IamActionDefinition$Roles' => '<p>A list of roles to be attached. There must be at least one role. </p>', ], ], 'ScpActionDefinition' => [ 'base' => '<p>The service control policies (SCP) action definition details. </p>', 'refs' => [ 'Definition$ScpActionDefinition' => '<p>The service control policies (SCPs) action definition details. </p>', ], ], 'Spend' => [ 'base' => '<p>The amount of cost or usage that\\'s measured for a budget.</p> <p>For example, a <code>Spend</code> for <code>3 GB</code> of S3 usage has the following parameters:</p> <ul> <li> <p>An <code>Amount</code> of <code>3</code> </p> </li> <li> <p>A <code>unit</code> of <code>GB</code> </p> </li> </ul>', 'refs' => [ 'Budget$BudgetLimit' => '<p>The total amount of cost, usage, RI utilization, RI coverage, Savings Plans utilization, or Savings Plans coverage that you want to track with your budget.</p> <p> <code>BudgetLimit</code> is required for cost or usage budgets, but optional for RI or Savings Plans utilization or coverage budgets. RI and Savings Plans utilization or coverage budgets default to <code>100</code>. This is the only valid value for RI or Savings Plans utilization or coverage budgets. You can\\'t use <code>BudgetLimit</code> with <code>PlannedBudgetLimits</code> for <code>CreateBudget</code> and <code>UpdateBudget</code> actions. </p>', 'BudgetedAndActualAmounts$BudgetedAmount' => '<p>The amount of cost or usage that you created the budget for.</p>', 'BudgetedAndActualAmounts$ActualAmount' => '<p>Your actual costs or usage for a budget period.</p>', 'CalculatedSpend$ActualSpend' => '<p>The amount of cost, usage, RI units, or Savings Plans units that you used.</p>', 'CalculatedSpend$ForecastedSpend' => '<p>The amount of cost, usage, RI units, or Savings Plans units that you\\'re forecasted to use.</p>', 'PlannedBudgetLimits$value' => NULL, ], ], 'SsmActionDefinition' => [ 'base' => '<p>The Amazon Web Services Systems Manager (SSM) action definition details. </p>', 'refs' => [ 'Definition$SsmActionDefinition' => '<p>The Amazon Web Services Systems Manager (SSM) action definition details. </p>', ], ], 'Subscriber' => [ 'base' => '<p>The subscriber to a budget notification. The subscriber consists of a subscription type and either an Amazon SNS topic or an email address.</p> <p>For example, an email subscriber has the following parameters:</p> <ul> <li> <p>A <code>subscriptionType</code> of <code>EMAIL</code> </p> </li> <li> <p>An <code>address</code> of <code>example@example.com</code> </p> </li> </ul>', 'refs' => [ 'CreateSubscriberRequest$Subscriber' => '<p>The subscriber that you want to associate with a budget notification.</p>', 'DeleteSubscriberRequest$Subscriber' => '<p>The subscriber that you want to delete.</p>', 'Subscribers$member' => NULL, 'UpdateSubscriberRequest$OldSubscriber' => '<p>The previous subscriber that is associated with a budget notification.</p>', 'UpdateSubscriberRequest$NewSubscriber' => '<p>The updated subscriber that is associated with a budget notification.</p>', ], ], 'SubscriberAddress' => [ 'base' => '<p> A string that contains an email address or SNS topic for the subscriber\\'s address.</p>', 'refs' => [ 'Subscriber$Address' => '<p>The address that Amazon Web Services sends budget notifications to, either an SNS topic or an email.</p> <p>When you create a subscriber, the value of <code>Address</code> can\\'t contain line breaks.</p>', ], ], 'Subscribers' => [ 'base' => '<p> A list of subscribers.</p>', 'refs' => [ 'Action$Subscribers' => NULL, 'CreateBudgetActionRequest$Subscribers' => NULL, 'CreateNotificationRequest$Subscribers' => '<p>A list of subscribers that you want to associate with the notification. Each notification can have one SNS subscriber and up to 10 email subscribers.</p>', 'DescribeSubscribersForNotificationResponse$Subscribers' => '<p>A list of subscribers that are associated with a notification.</p>', 'NotificationWithSubscribers$Subscribers' => '<p>A list of subscribers who are subscribed to this notification.</p>', 'UpdateBudgetActionRequest$Subscribers' => NULL, ], ], 'SubscriptionType' => [ 'base' => '<p> The subscription type of the subscriber. It can be SMS or EMAIL.</p>', 'refs' => [ 'Subscriber$SubscriptionType' => '<p>The type of notification that Amazon Web Services sends to a subscriber.</p>', ], ], 'TargetId' => [ 'base' => NULL, 'refs' => [ 'TargetIds$member' => NULL, ], ], 'TargetIds' => [ 'base' => NULL, 'refs' => [ 'ScpActionDefinition$TargetIds' => '<p>A list of target IDs. </p>', ], ], 'ThresholdType' => [ 'base' => '<p> The type of threshold for a notification.</p>', 'refs' => [ 'ActionThreshold$ActionThresholdType' => NULL, 'Notification$ThresholdType' => '<p>The type of threshold for a notification. For <code>ABSOLUTE_VALUE</code> thresholds, Amazon Web Services notifies you when you go over or are forecasted to go over your total cost threshold. For <code>PERCENTAGE</code> thresholds, Amazon Web Services notifies you when you go over or are forecasted to go over a certain percentage of your forecasted spend. For example, if you have a budget for 200 dollars and you have a <code>PERCENTAGE</code> threshold of 80%, Amazon Web Services notifies you when you go over 160 dollars.</p>', ], ], 'ThrottlingException' => [ 'base' => '<p> The number of API requests has exceeded the maximum allowed API request throttling limit for the account. </p>', 'refs' => [], ], 'TimePeriod' => [ 'base' => '<p>The period of time that\\'s covered by a budget. The period has a start date and an end date. The start date must come before the end date. There are no restrictions on the end date. </p>', 'refs' => [ 'Budget$TimePeriod' => '<p>The period of time that\\'s covered by a budget. You setthe start date and end date. The start date must come before the end date. The end date must come before <code>06/15/87 00:00 UTC</code>. </p> <p>If you create your budget and don\\'t specify a start date, Amazon Web Services defaults to the start of your chosen time period (DAILY, MONTHLY, QUARTERLY, or ANNUALLY). For example, if you created your budget on January 24, 2018, chose <code>DAILY</code>, and didn\\'t set a start date, Amazon Web Services set your start date to <code>01/24/18 00:00 UTC</code>. If you chose <code>MONTHLY</code>, Amazon Web Services set your start date to <code>01/01/18 00:00 UTC</code>. If you didn\\'t specify an end date, Amazon Web Services set your end date to <code>06/15/87 00:00 UTC</code>. The defaults are the same for the Billing and Cost Management console and the API. </p> <p>You can change either date with the <code>UpdateBudget</code> operation.</p> <p>After the end date, Amazon Web Services deletes the budget and all the associated notifications and subscribers.</p>', 'BudgetedAndActualAmounts$TimePeriod' => '<p>The time period that\\'s covered by this budget comparison.</p>', 'DescribeBudgetActionHistoriesRequest$TimePeriod' => NULL, 'DescribeBudgetPerformanceHistoryRequest$TimePeriod' => '<p>Retrieves how often the budget went into an <code>ALARM</code> state for the specified time period.</p>', ], ], 'TimeUnit' => [ 'base' => '<p> The time unit of the budget, such as MONTHLY or QUARTERLY.</p>', 'refs' => [ 'Budget$TimeUnit' => '<p>The length of time until a budget resets the actual and forecasted spend.</p>', 'BudgetPerformanceHistory$TimeUnit' => NULL, ], ], 'UnitValue' => [ 'base' => '<p> A string that represents the spend unit of a budget. It can\\'t be null or empty.</p>', 'refs' => [ 'Spend$Unit' => '<p>The unit of measurement that\\'s used for the budget forecast, actual spend, or budget threshold, such as USD or GBP.</p>', ], ], 'UpdateBudgetActionRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateBudgetActionResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateBudgetRequest' => [ 'base' => '<p> Request of UpdateBudget </p>', 'refs' => [], ], 'UpdateBudgetResponse' => [ 'base' => '<p> Response of UpdateBudget </p>', 'refs' => [], ], 'UpdateNotificationRequest' => [ 'base' => '<p> Request of UpdateNotification </p>', 'refs' => [], ], 'UpdateNotificationResponse' => [ 'base' => '<p> Response of UpdateNotification </p>', 'refs' => [], ], 'UpdateSubscriberRequest' => [ 'base' => '<p> Request of UpdateSubscriber </p>', 'refs' => [], ], 'UpdateSubscriberResponse' => [ 'base' => '<p> Response of UpdateSubscriber </p>', 'refs' => [], ], 'User' => [ 'base' => NULL, 'refs' => [ 'Users$member' => NULL, ], ], 'Users' => [ 'base' => NULL, 'refs' => [ 'IamActionDefinition$Users' => '<p>A list of users to be attached. There must be at least one user. </p>', ], ], 'errorMessage' => [ 'base' => '<p>The error message the exception carries.</p>', 'refs' => [ 'AccessDeniedException$Message' => NULL, 'CreationLimitExceededException$Message' => NULL, 'DuplicateRecordException$Message' => NULL, 'ExpiredNextTokenException$Message' => NULL, 'InternalErrorException$Message' => NULL, 'InvalidNextTokenException$Message' => NULL, 'InvalidParameterException$Message' => NULL, 'NotFoundException$Message' => NULL, 'ResourceLockedException$Message' => NULL, 'ThrottlingException$Message' => NULL, ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/budgets/2016-10-20/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], [ 'fn' => 'parseURL', 'argv' => [ [ 'ref' => 'Endpoint', ], ], 'assign' => 'url', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], 'aws', ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://budgets-fips.{Region}.api.aws', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'budgets', 'signingRegion' => 'us-east-1', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://budgets-fips.{Region}.amazonaws.com', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'budgets', 'signingRegion' => 'us-east-1', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://budgets.{Region}.api.aws', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'budgets', 'signingRegion' => 'us-east-1', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://budgets.amazonaws.com', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'budgets', 'signingRegion' => 'us-east-1', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], 'aws-cn', ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://budgets-fips.{Region}.api.amazonwebservices.com.cn', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'budgets', 'signingRegion' => 'cn-northwest-1', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://budgets-fips.{Region}.amazonaws.com.cn', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'budgets', 'signingRegion' => 'cn-northwest-1', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://budgets.{Region}.api.amazonwebservices.com.cn', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'budgets', 'signingRegion' => 'cn-northwest-1', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://budgets.amazonaws.com.cn', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'budgets', 'signingRegion' => 'cn-northwest-1', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://budgets-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://budgets-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://budgets.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'ref' => 'Region', ], 'aws-global', ], ], ], 'endpoint' => [ 'url' => 'https://budgets.amazonaws.com', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'budgets', 'signingRegion' => 'us-east-1', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'ref' => 'Region', ], 'aws-cn-global', ], ], ], 'endpoint' => [ 'url' => 'https://budgets.amazonaws.com.cn', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'budgets', 'signingRegion' => 'cn-northwest-1', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://budgets.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/budgets/2016-10-20/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region aws-cn-global with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'budgets', 'signingRegion' => 'cn-northwest-1', ], ], ], 'url' => 'https://budgets.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'aws-cn-global', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region aws-global with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'budgets', 'signingRegion' => 'us-east-1', ], ], ], 'url' => 'https://budgets.amazonaws.com', ], ], 'params' => [ 'Region' => 'aws-global', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/budgets/2016-10-20/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/budgets/2016-10-20/paginators-1.json\nreturn [ 'pagination' => [ 'DescribeBudgetActionHistories' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'ActionHistories', ], 'DescribeBudgetActionsForAccount' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'Actions', ], 'DescribeBudgetActionsForBudget' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'Actions', ], 'DescribeBudgetNotificationsForAccount' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'BudgetNotificationsForAccount', ], 'DescribeBudgetPerformanceHistory' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'BudgetPerformanceHistory', ], 'DescribeBudgets' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'Budgets', ], 'DescribeNotificationsForBudget' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'Notifications', ], 'DescribeSubscribersForNotification' => [ 'input_token' => 'NextToken', 'limit_key' => 'MaxResults', 'output_token' => 'NextToken', 'result_key' => 'Subscribers', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/ce/2017-10-25/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2017-10-25', 'endpointPrefix' => 'ce', 'jsonVersion' => '1.1', 'protocol' => 'json', 'serviceAbbreviation' => 'AWS Cost Explorer', 'serviceFullName' => 'AWS Cost Explorer Service', 'serviceId' => 'Cost Explorer', 'signatureVersion' => 'v4', 'signingName' => 'ce', 'targetPrefix' => 'AWSInsightsIndexService', 'uid' => 'ce-2017-10-25', ], 'operations' => [ 'CreateAnomalyMonitor' => [ 'name' => 'CreateAnomalyMonitor', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateAnomalyMonitorRequest', ], 'output' => [ 'shape' => 'CreateAnomalyMonitorResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], ], ], 'CreateAnomalySubscription' => [ 'name' => 'CreateAnomalySubscription', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateAnomalySubscriptionRequest', ], 'output' => [ 'shape' => 'CreateAnomalySubscriptionResponse', ], 'errors' => [ [ 'shape' => 'UnknownMonitorException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'CreateCostCategoryDefinition' => [ 'name' => 'CreateCostCategoryDefinition', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateCostCategoryDefinitionRequest', ], 'output' => [ 'shape' => 'CreateCostCategoryDefinitionResponse', ], 'errors' => [ [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'DeleteAnomalyMonitor' => [ 'name' => 'DeleteAnomalyMonitor', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteAnomalyMonitorRequest', ], 'output' => [ 'shape' => 'DeleteAnomalyMonitorResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'UnknownMonitorException', ], ], ], 'DeleteAnomalySubscription' => [ 'name' => 'DeleteAnomalySubscription', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteAnomalySubscriptionRequest', ], 'output' => [ 'shape' => 'DeleteAnomalySubscriptionResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'UnknownSubscriptionException', ], ], ], 'DeleteCostCategoryDefinition' => [ 'name' => 'DeleteCostCategoryDefinition', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteCostCategoryDefinitionRequest', ], 'output' => [ 'shape' => 'DeleteCostCategoryDefinitionResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'DescribeCostCategoryDefinition' => [ 'name' => 'DescribeCostCategoryDefinition', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeCostCategoryDefinitionRequest', ], 'output' => [ 'shape' => 'DescribeCostCategoryDefinitionResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'GetAnomalies' => [ 'name' => 'GetAnomalies', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetAnomaliesRequest', ], 'output' => [ 'shape' => 'GetAnomaliesResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'GetAnomalyMonitors' => [ 'name' => 'GetAnomalyMonitors', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetAnomalyMonitorsRequest', ], 'output' => [ 'shape' => 'GetAnomalyMonitorsResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'UnknownMonitorException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'GetAnomalySubscriptions' => [ 'name' => 'GetAnomalySubscriptions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetAnomalySubscriptionsRequest', ], 'output' => [ 'shape' => 'GetAnomalySubscriptionsResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'UnknownSubscriptionException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'GetCostAndUsage' => [ 'name' => 'GetCostAndUsage', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetCostAndUsageRequest', ], 'output' => [ 'shape' => 'GetCostAndUsageResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'BillExpirationException', ], [ 'shape' => 'DataUnavailableException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'RequestChangedException', ], ], ], 'GetCostAndUsageWithResources' => [ 'name' => 'GetCostAndUsageWithResources', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetCostAndUsageWithResourcesRequest', ], 'output' => [ 'shape' => 'GetCostAndUsageWithResourcesResponse', ], 'errors' => [ [ 'shape' => 'DataUnavailableException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'BillExpirationException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'RequestChangedException', ], ], ], 'GetCostCategories' => [ 'name' => 'GetCostCategories', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetCostCategoriesRequest', ], 'output' => [ 'shape' => 'GetCostCategoriesResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'BillExpirationException', ], [ 'shape' => 'DataUnavailableException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'RequestChangedException', ], ], ], 'GetCostForecast' => [ 'name' => 'GetCostForecast', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetCostForecastRequest', ], 'output' => [ 'shape' => 'GetCostForecastResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'DataUnavailableException', ], ], ], 'GetDimensionValues' => [ 'name' => 'GetDimensionValues', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetDimensionValuesRequest', ], 'output' => [ 'shape' => 'GetDimensionValuesResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'BillExpirationException', ], [ 'shape' => 'DataUnavailableException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'RequestChangedException', ], ], ], 'GetReservationCoverage' => [ 'name' => 'GetReservationCoverage', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetReservationCoverageRequest', ], 'output' => [ 'shape' => 'GetReservationCoverageResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'DataUnavailableException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'GetReservationPurchaseRecommendation' => [ 'name' => 'GetReservationPurchaseRecommendation', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetReservationPurchaseRecommendationRequest', ], 'output' => [ 'shape' => 'GetReservationPurchaseRecommendationResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'DataUnavailableException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'GetReservationUtilization' => [ 'name' => 'GetReservationUtilization', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetReservationUtilizationRequest', ], 'output' => [ 'shape' => 'GetReservationUtilizationResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'DataUnavailableException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'GetRightsizingRecommendation' => [ 'name' => 'GetRightsizingRecommendation', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetRightsizingRecommendationRequest', ], 'output' => [ 'shape' => 'GetRightsizingRecommendationResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'GetSavingsPlansCoverage' => [ 'name' => 'GetSavingsPlansCoverage', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetSavingsPlansCoverageRequest', ], 'output' => [ 'shape' => 'GetSavingsPlansCoverageResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'DataUnavailableException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'GetSavingsPlansPurchaseRecommendation' => [ 'name' => 'GetSavingsPlansPurchaseRecommendation', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetSavingsPlansPurchaseRecommendationRequest', ], 'output' => [ 'shape' => 'GetSavingsPlansPurchaseRecommendationResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'GetSavingsPlansUtilization' => [ 'name' => 'GetSavingsPlansUtilization', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetSavingsPlansUtilizationRequest', ], 'output' => [ 'shape' => 'GetSavingsPlansUtilizationResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'DataUnavailableException', ], ], ], 'GetSavingsPlansUtilizationDetails' => [ 'name' => 'GetSavingsPlansUtilizationDetails', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetSavingsPlansUtilizationDetailsRequest', ], 'output' => [ 'shape' => 'GetSavingsPlansUtilizationDetailsResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'DataUnavailableException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'GetTags' => [ 'name' => 'GetTags', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetTagsRequest', ], 'output' => [ 'shape' => 'GetTagsResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'BillExpirationException', ], [ 'shape' => 'DataUnavailableException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'RequestChangedException', ], ], ], 'GetUsageForecast' => [ 'name' => 'GetUsageForecast', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetUsageForecastRequest', ], 'output' => [ 'shape' => 'GetUsageForecastResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'DataUnavailableException', ], [ 'shape' => 'UnresolvableUsageUnitException', ], ], ], 'ListCostAllocationTags' => [ 'name' => 'ListCostAllocationTags', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListCostAllocationTagsRequest', ], 'output' => [ 'shape' => 'ListCostAllocationTagsResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListCostCategoryDefinitions' => [ 'name' => 'ListCostCategoryDefinitions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListCostCategoryDefinitionsRequest', ], 'output' => [ 'shape' => 'ListCostCategoryDefinitionsResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], ], ], 'ListSavingsPlansPurchaseRecommendationGeneration' => [ 'name' => 'ListSavingsPlansPurchaseRecommendationGeneration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListSavingsPlansPurchaseRecommendationGenerationRequest', ], 'output' => [ 'shape' => 'ListSavingsPlansPurchaseRecommendationGenerationResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'ProvideAnomalyFeedback' => [ 'name' => 'ProvideAnomalyFeedback', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ProvideAnomalyFeedbackRequest', ], 'output' => [ 'shape' => 'ProvideAnomalyFeedbackResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], ], ], 'StartSavingsPlansPurchaseRecommendationGeneration' => [ 'name' => 'StartSavingsPlansPurchaseRecommendationGeneration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StartSavingsPlansPurchaseRecommendationGenerationRequest', ], 'output' => [ 'shape' => 'StartSavingsPlansPurchaseRecommendationGenerationResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'GenerationExistsException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'TooManyTagsException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'UpdateAnomalyMonitor' => [ 'name' => 'UpdateAnomalyMonitor', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateAnomalyMonitorRequest', ], 'output' => [ 'shape' => 'UpdateAnomalyMonitorResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'UnknownMonitorException', ], ], ], 'UpdateAnomalySubscription' => [ 'name' => 'UpdateAnomalySubscription', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateAnomalySubscriptionRequest', ], 'output' => [ 'shape' => 'UpdateAnomalySubscriptionResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'UnknownMonitorException', ], [ 'shape' => 'UnknownSubscriptionException', ], ], ], 'UpdateCostAllocationTagsStatus' => [ 'name' => 'UpdateCostAllocationTagsStatus', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateCostAllocationTagsStatusRequest', ], 'output' => [ 'shape' => 'UpdateCostAllocationTagsStatusResponse', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], ], ], 'UpdateCostCategoryDefinition' => [ 'name' => 'UpdateCostCategoryDefinition', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateCostCategoryDefinitionRequest', ], 'output' => [ 'shape' => 'UpdateCostCategoryDefinitionResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'LimitExceededException', ], ], ], ], 'shapes' => [ 'AccountScope' => [ 'type' => 'string', 'enum' => [ 'PAYER', 'LINKED', ], ], 'AmortizedRecurringFee' => [ 'type' => 'string', ], 'AmortizedUpfrontFee' => [ 'type' => 'string', ], 'Anomalies' => [ 'type' => 'list', 'member' => [ 'shape' => 'Anomaly', ], ], 'Anomaly' => [ 'type' => 'structure', 'required' => [ 'AnomalyId', 'AnomalyScore', 'Impact', 'MonitorArn', ], 'members' => [ 'AnomalyId' => [ 'shape' => 'GenericString', ], 'AnomalyStartDate' => [ 'shape' => 'YearMonthDay', ], 'AnomalyEndDate' => [ 'shape' => 'YearMonthDay', ], 'DimensionValue' => [ 'shape' => 'GenericString', ], 'RootCauses' => [ 'shape' => 'RootCauses', ], 'AnomalyScore' => [ 'shape' => 'AnomalyScore', ], 'Impact' => [ 'shape' => 'Impact', ], 'MonitorArn' => [ 'shape' => 'GenericString', ], 'Feedback' => [ 'shape' => 'AnomalyFeedbackType', ], ], ], 'AnomalyDateInterval' => [ 'type' => 'structure', 'required' => [ 'StartDate', ], 'members' => [ 'StartDate' => [ 'shape' => 'YearMonthDay', ], 'EndDate' => [ 'shape' => 'YearMonthDay', ], ], ], 'AnomalyFeedbackType' => [ 'type' => 'string', 'enum' => [ 'YES', 'NO', 'PLANNED_ACTIVITY', ], ], 'AnomalyMonitor' => [ 'type' => 'structure', 'required' => [ 'MonitorName', 'MonitorType', ], 'members' => [ 'MonitorArn' => [ 'shape' => 'GenericString', ], 'MonitorName' => [ 'shape' => 'GenericString', ], 'CreationDate' => [ 'shape' => 'YearMonthDay', ], 'LastUpdatedDate' => [ 'shape' => 'YearMonthDay', ], 'LastEvaluatedDate' => [ 'shape' => 'YearMonthDay', ], 'MonitorType' => [ 'shape' => 'MonitorType', ], 'MonitorDimension' => [ 'shape' => 'MonitorDimension', ], 'MonitorSpecification' => [ 'shape' => 'Expression', ], 'DimensionalValueCount' => [ 'shape' => 'NonNegativeInteger', ], ], ], 'AnomalyMonitors' => [ 'type' => 'list', 'member' => [ 'shape' => 'AnomalyMonitor', ], ], 'AnomalyScore' => [ 'type' => 'structure', 'required' => [ 'MaxScore', 'CurrentScore', ], 'members' => [ 'MaxScore' => [ 'shape' => 'GenericDouble', ], 'CurrentScore' => [ 'shape' => 'GenericDouble', ], ], ], 'AnomalySubscription' => [ 'type' => 'structure', 'required' => [ 'MonitorArnList', 'Subscribers', 'Frequency', 'SubscriptionName', ], 'members' => [ 'SubscriptionArn' => [ 'shape' => 'GenericString', ], 'AccountId' => [ 'shape' => 'GenericString', ], 'MonitorArnList' => [ 'shape' => 'MonitorArnList', ], 'Subscribers' => [ 'shape' => 'Subscribers', ], 'Threshold' => [ 'shape' => 'NullableNonNegativeDouble', 'deprecated' => true, 'deprecatedMessage' => 'Threshold has been deprecated in favor of ThresholdExpression', ], 'Frequency' => [ 'shape' => 'AnomalySubscriptionFrequency', ], 'SubscriptionName' => [ 'shape' => 'GenericString', ], 'ThresholdExpression' => [ 'shape' => 'Expression', ], ], ], 'AnomalySubscriptionFrequency' => [ 'type' => 'string', 'enum' => [ 'DAILY', 'IMMEDIATE', 'WEEKLY', ], ], 'AnomalySubscriptions' => [ 'type' => 'list', 'member' => [ 'shape' => 'AnomalySubscription', ], ], 'Arn' => [ 'type' => 'string', 'max' => 2048, 'min' => 20, 'pattern' => 'arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+', ], 'AttributeType' => [ 'type' => 'string', ], 'AttributeValue' => [ 'type' => 'string', ], 'Attributes' => [ 'type' => 'map', 'key' => [ 'shape' => 'AttributeType', ], 'value' => [ 'shape' => 'AttributeValue', ], ], 'BillExpirationException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'Context' => [ 'type' => 'string', 'enum' => [ 'COST_AND_USAGE', 'RESERVATIONS', 'SAVINGS_PLANS', ], ], 'CostAllocationTag' => [ 'type' => 'structure', 'required' => [ 'TagKey', 'Type', 'Status', ], 'members' => [ 'TagKey' => [ 'shape' => 'TagKey', ], 'Type' => [ 'shape' => 'CostAllocationTagType', ], 'Status' => [ 'shape' => 'CostAllocationTagStatus', ], ], ], 'CostAllocationTagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 100, 'min' => 1, ], 'CostAllocationTagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CostAllocationTag', ], 'max' => 100, 'min' => 0, ], 'CostAllocationTagStatus' => [ 'type' => 'string', 'enum' => [ 'Active', 'Inactive', ], ], 'CostAllocationTagStatusEntry' => [ 'type' => 'structure', 'required' => [ 'TagKey', 'Status', ], 'members' => [ 'TagKey' => [ 'shape' => 'TagKey', ], 'Status' => [ 'shape' => 'CostAllocationTagStatus', ], ], ], 'CostAllocationTagStatusList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CostAllocationTagStatusEntry', ], 'max' => 20, 'min' => 1, ], 'CostAllocationTagType' => [ 'type' => 'string', 'enum' => [ 'AWSGenerated', 'UserDefined', ], ], 'CostAllocationTagsMaxResults' => [ 'type' => 'integer', 'max' => 1000, 'min' => 1, ], 'CostCategory' => [ 'type' => 'structure', 'required' => [ 'CostCategoryArn', 'EffectiveStart', 'Name', 'RuleVersion', 'Rules', ], 'members' => [ 'CostCategoryArn' => [ 'shape' => 'Arn', ], 'EffectiveStart' => [ 'shape' => 'ZonedDateTime', ], 'EffectiveEnd' => [ 'shape' => 'ZonedDateTime', ], 'Name' => [ 'shape' => 'CostCategoryName', ], 'RuleVersion' => [ 'shape' => 'CostCategoryRuleVersion', ], 'Rules' => [ 'shape' => 'CostCategoryRulesList', ], 'SplitChargeRules' => [ 'shape' => 'CostCategorySplitChargeRulesList', ], 'ProcessingStatus' => [ 'shape' => 'CostCategoryProcessingStatusList', ], 'DefaultValue' => [ 'shape' => 'CostCategoryValue', ], ], ], 'CostCategoryInheritedValueDimension' => [ 'type' => 'structure', 'members' => [ 'DimensionName' => [ 'shape' => 'CostCategoryInheritedValueDimensionName', ], 'DimensionKey' => [ 'shape' => 'GenericString', ], ], ], 'CostCategoryInheritedValueDimensionName' => [ 'type' => 'string', 'enum' => [ 'LINKED_ACCOUNT_NAME', 'TAG', ], ], 'CostCategoryMaxResults' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'CostCategoryName' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'pattern' => '^(?! )[\\\\p{L}\\\\p{N}\\\\p{Z}-_]*(?<! )$', ], 'CostCategoryNamesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CostCategoryName', ], ], 'CostCategoryProcessingStatus' => [ 'type' => 'structure', 'members' => [ 'Component' => [ 'shape' => 'CostCategoryStatusComponent', ], 'Status' => [ 'shape' => 'CostCategoryStatus', ], ], ], 'CostCategoryProcessingStatusList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CostCategoryProcessingStatus', ], ], 'CostCategoryReference' => [ 'type' => 'structure', 'members' => [ 'CostCategoryArn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'CostCategoryName', ], 'EffectiveStart' => [ 'shape' => 'ZonedDateTime', ], 'EffectiveEnd' => [ 'shape' => 'ZonedDateTime', ], 'NumberOfRules' => [ 'shape' => 'NonNegativeInteger', ], 'ProcessingStatus' => [ 'shape' => 'CostCategoryProcessingStatusList', ], 'Values' => [ 'shape' => 'CostCategoryValuesList', ], 'DefaultValue' => [ 'shape' => 'CostCategoryValue', ], ], ], 'CostCategoryReferencesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CostCategoryReference', ], ], 'CostCategoryRule' => [ 'type' => 'structure', 'members' => [ 'Value' => [ 'shape' => 'CostCategoryValue', ], 'Rule' => [ 'shape' => 'Expression', ], 'InheritedValue' => [ 'shape' => 'CostCategoryInheritedValueDimension', ], 'Type' => [ 'shape' => 'CostCategoryRuleType', ], ], ], 'CostCategoryRuleType' => [ 'type' => 'string', 'enum' => [ 'REGULAR', 'INHERITED_VALUE', ], ], 'CostCategoryRuleVersion' => [ 'type' => 'string', 'enum' => [ 'CostCategoryExpression.v1', ], ], 'CostCategoryRulesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CostCategoryRule', ], 'max' => 500, 'min' => 1, ], 'CostCategorySplitChargeMethod' => [ 'type' => 'string', 'enum' => [ 'FIXED', 'PROPORTIONAL', 'EVEN', ], ], 'CostCategorySplitChargeRule' => [ 'type' => 'structure', 'required' => [ 'Source', 'Targets', 'Method', ], 'members' => [ 'Source' => [ 'shape' => 'GenericString', ], 'Targets' => [ 'shape' => 'CostCategorySplitChargeRuleTargetsList', ], 'Method' => [ 'shape' => 'CostCategorySplitChargeMethod', ], 'Parameters' => [ 'shape' => 'CostCategorySplitChargeRuleParametersList', ], ], ], 'CostCategorySplitChargeRuleParameter' => [ 'type' => 'structure', 'required' => [ 'Type', 'Values', ], 'members' => [ 'Type' => [ 'shape' => 'CostCategorySplitChargeRuleParameterType', ], 'Values' => [ 'shape' => 'CostCategorySplitChargeRuleParameterValuesList', ], ], ], 'CostCategorySplitChargeRuleParameterType' => [ 'type' => 'string', 'enum' => [ 'ALLOCATION_PERCENTAGES', ], ], 'CostCategorySplitChargeRuleParameterValuesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'GenericString', ], 'max' => 500, 'min' => 1, ], 'CostCategorySplitChargeRuleParametersList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CostCategorySplitChargeRuleParameter', ], 'max' => 10, 'min' => 1, ], 'CostCategorySplitChargeRuleTargetsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'GenericString', ], 'max' => 500, 'min' => 1, ], 'CostCategorySplitChargeRulesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CostCategorySplitChargeRule', ], 'max' => 10, 'min' => 1, ], 'CostCategoryStatus' => [ 'type' => 'string', 'enum' => [ 'PROCESSING', 'APPLIED', ], ], 'CostCategoryStatusComponent' => [ 'type' => 'string', 'enum' => [ 'COST_EXPLORER', ], ], 'CostCategoryValue' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'pattern' => '^(?! )[\\\\p{L}\\\\p{N}\\\\p{Z}-_]*(?<! )$', ], 'CostCategoryValues' => [ 'type' => 'structure', 'members' => [ 'Key' => [ 'shape' => 'CostCategoryName', ], 'Values' => [ 'shape' => 'Values', ], 'MatchOptions' => [ 'shape' => 'MatchOptions', ], ], ], 'CostCategoryValuesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CostCategoryValue', ], ], 'Coverage' => [ 'type' => 'structure', 'members' => [ 'CoverageHours' => [ 'shape' => 'CoverageHours', ], 'CoverageNormalizedUnits' => [ 'shape' => 'CoverageNormalizedUnits', ], 'CoverageCost' => [ 'shape' => 'CoverageCost', ], ], ], 'CoverageByTime' => [ 'type' => 'structure', 'members' => [ 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'Groups' => [ 'shape' => 'ReservationCoverageGroups', ], 'Total' => [ 'shape' => 'Coverage', ], ], ], 'CoverageCost' => [ 'type' => 'structure', 'members' => [ 'OnDemandCost' => [ 'shape' => 'OnDemandCost', ], ], ], 'CoverageHours' => [ 'type' => 'structure', 'members' => [ 'OnDemandHours' => [ 'shape' => 'OnDemandHours', ], 'ReservedHours' => [ 'shape' => 'ReservedHours', ], 'TotalRunningHours' => [ 'shape' => 'TotalRunningHours', ], 'CoverageHoursPercentage' => [ 'shape' => 'CoverageHoursPercentage', ], ], ], 'CoverageHoursPercentage' => [ 'type' => 'string', ], 'CoverageNormalizedUnits' => [ 'type' => 'structure', 'members' => [ 'OnDemandNormalizedUnits' => [ 'shape' => 'OnDemandNormalizedUnits', ], 'ReservedNormalizedUnits' => [ 'shape' => 'ReservedNormalizedUnits', ], 'TotalRunningNormalizedUnits' => [ 'shape' => 'TotalRunningNormalizedUnits', ], 'CoverageNormalizedUnitsPercentage' => [ 'shape' => 'CoverageNormalizedUnitsPercentage', ], ], ], 'CoverageNormalizedUnitsPercentage' => [ 'type' => 'string', ], 'CoveragesByTime' => [ 'type' => 'list', 'member' => [ 'shape' => 'CoverageByTime', ], ], 'CreateAnomalyMonitorRequest' => [ 'type' => 'structure', 'required' => [ 'AnomalyMonitor', ], 'members' => [ 'AnomalyMonitor' => [ 'shape' => 'AnomalyMonitor', ], 'ResourceTags' => [ 'shape' => 'ResourceTagList', ], ], ], 'CreateAnomalyMonitorResponse' => [ 'type' => 'structure', 'required' => [ 'MonitorArn', ], 'members' => [ 'MonitorArn' => [ 'shape' => 'GenericString', ], ], ], 'CreateAnomalySubscriptionRequest' => [ 'type' => 'structure', 'required' => [ 'AnomalySubscription', ], 'members' => [ 'AnomalySubscription' => [ 'shape' => 'AnomalySubscription', ], 'ResourceTags' => [ 'shape' => 'ResourceTagList', ], ], ], 'CreateAnomalySubscriptionResponse' => [ 'type' => 'structure', 'required' => [ 'SubscriptionArn', ], 'members' => [ 'SubscriptionArn' => [ 'shape' => 'GenericString', ], ], ], 'CreateCostCategoryDefinitionRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'RuleVersion', 'Rules', ], 'members' => [ 'Name' => [ 'shape' => 'CostCategoryName', ], 'EffectiveStart' => [ 'shape' => 'ZonedDateTime', ], 'RuleVersion' => [ 'shape' => 'CostCategoryRuleVersion', ], 'Rules' => [ 'shape' => 'CostCategoryRulesList', ], 'DefaultValue' => [ 'shape' => 'CostCategoryValue', ], 'SplitChargeRules' => [ 'shape' => 'CostCategorySplitChargeRulesList', ], 'ResourceTags' => [ 'shape' => 'ResourceTagList', ], ], ], 'CreateCostCategoryDefinitionResponse' => [ 'type' => 'structure', 'members' => [ 'CostCategoryArn' => [ 'shape' => 'Arn', ], 'EffectiveStart' => [ 'shape' => 'ZonedDateTime', ], ], ], 'CurrentInstance' => [ 'type' => 'structure', 'members' => [ 'ResourceId' => [ 'shape' => 'GenericString', ], 'InstanceName' => [ 'shape' => 'GenericString', ], 'Tags' => [ 'shape' => 'TagValuesList', ], 'ResourceDetails' => [ 'shape' => 'ResourceDetails', ], 'ResourceUtilization' => [ 'shape' => 'ResourceUtilization', ], 'ReservationCoveredHoursInLookbackPeriod' => [ 'shape' => 'GenericString', ], 'SavingsPlansCoveredHoursInLookbackPeriod' => [ 'shape' => 'GenericString', ], 'OnDemandHoursInLookbackPeriod' => [ 'shape' => 'GenericString', ], 'TotalRunningHoursInLookbackPeriod' => [ 'shape' => 'GenericString', ], 'MonthlyCost' => [ 'shape' => 'GenericString', ], 'CurrencyCode' => [ 'shape' => 'GenericString', ], ], ], 'DataUnavailableException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'DateInterval' => [ 'type' => 'structure', 'required' => [ 'Start', 'End', ], 'members' => [ 'Start' => [ 'shape' => 'YearMonthDay', ], 'End' => [ 'shape' => 'YearMonthDay', ], ], ], 'DeleteAnomalyMonitorRequest' => [ 'type' => 'structure', 'required' => [ 'MonitorArn', ], 'members' => [ 'MonitorArn' => [ 'shape' => 'GenericString', ], ], ], 'DeleteAnomalyMonitorResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteAnomalySubscriptionRequest' => [ 'type' => 'structure', 'required' => [ 'SubscriptionArn', ], 'members' => [ 'SubscriptionArn' => [ 'shape' => 'GenericString', ], ], ], 'DeleteAnomalySubscriptionResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteCostCategoryDefinitionRequest' => [ 'type' => 'structure', 'required' => [ 'CostCategoryArn', ], 'members' => [ 'CostCategoryArn' => [ 'shape' => 'Arn', ], ], ], 'DeleteCostCategoryDefinitionResponse' => [ 'type' => 'structure', 'members' => [ 'CostCategoryArn' => [ 'shape' => 'Arn', ], 'EffectiveEnd' => [ 'shape' => 'ZonedDateTime', ], ], ], 'DescribeCostCategoryDefinitionRequest' => [ 'type' => 'structure', 'required' => [ 'CostCategoryArn', ], 'members' => [ 'CostCategoryArn' => [ 'shape' => 'Arn', ], 'EffectiveOn' => [ 'shape' => 'ZonedDateTime', ], ], ], 'DescribeCostCategoryDefinitionResponse' => [ 'type' => 'structure', 'members' => [ 'CostCategory' => [ 'shape' => 'CostCategory', ], ], ], 'Dimension' => [ 'type' => 'string', 'enum' => [ 'AZ', 'INSTANCE_TYPE', 'LINKED_ACCOUNT', 'LINKED_ACCOUNT_NAME', 'OPERATION', 'PURCHASE_TYPE', 'REGION', 'SERVICE', 'SERVICE_CODE', 'USAGE_TYPE', 'USAGE_TYPE_GROUP', 'RECORD_TYPE', 'OPERATING_SYSTEM', 'TENANCY', 'SCOPE', 'PLATFORM', 'SUBSCRIPTION_ID', 'LEGAL_ENTITY_NAME', 'DEPLOYMENT_OPTION', 'DATABASE_ENGINE', 'CACHE_ENGINE', 'INSTANCE_TYPE_FAMILY', 'BILLING_ENTITY', 'RESERVATION_ID', 'RESOURCE_ID', 'RIGHTSIZING_TYPE', 'SAVINGS_PLANS_TYPE', 'SAVINGS_PLAN_ARN', 'PAYMENT_OPTION', 'AGREEMENT_END_DATE_TIME_AFTER', 'AGREEMENT_END_DATE_TIME_BEFORE', 'INVOICING_ENTITY', 'ANOMALY_TOTAL_IMPACT_ABSOLUTE', 'ANOMALY_TOTAL_IMPACT_PERCENTAGE', ], ], 'DimensionValues' => [ 'type' => 'structure', 'members' => [ 'Key' => [ 'shape' => 'Dimension', ], 'Values' => [ 'shape' => 'Values', ], 'MatchOptions' => [ 'shape' => 'MatchOptions', ], ], ], 'DimensionValuesWithAttributes' => [ 'type' => 'structure', 'members' => [ 'Value' => [ 'shape' => 'Value', ], 'Attributes' => [ 'shape' => 'Attributes', ], ], ], 'DimensionValuesWithAttributesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DimensionValuesWithAttributes', ], ], 'DiskResourceUtilization' => [ 'type' => 'structure', 'members' => [ 'DiskReadOpsPerSecond' => [ 'shape' => 'GenericString', ], 'DiskWriteOpsPerSecond' => [ 'shape' => 'GenericString', ], 'DiskReadBytesPerSecond' => [ 'shape' => 'GenericString', ], 'DiskWriteBytesPerSecond' => [ 'shape' => 'GenericString', ], ], ], 'EBSResourceUtilization' => [ 'type' => 'structure', 'members' => [ 'EbsReadOpsPerSecond' => [ 'shape' => 'GenericString', ], 'EbsWriteOpsPerSecond' => [ 'shape' => 'GenericString', ], 'EbsReadBytesPerSecond' => [ 'shape' => 'GenericString', ], 'EbsWriteBytesPerSecond' => [ 'shape' => 'GenericString', ], ], ], 'EC2InstanceDetails' => [ 'type' => 'structure', 'members' => [ 'Family' => [ 'shape' => 'GenericString', ], 'InstanceType' => [ 'shape' => 'GenericString', ], 'Region' => [ 'shape' => 'GenericString', ], 'AvailabilityZone' => [ 'shape' => 'GenericString', ], 'Platform' => [ 'shape' => 'GenericString', ], 'Tenancy' => [ 'shape' => 'GenericString', ], 'CurrentGeneration' => [ 'shape' => 'GenericBoolean', ], 'SizeFlexEligible' => [ 'shape' => 'GenericBoolean', ], ], ], 'EC2ResourceDetails' => [ 'type' => 'structure', 'members' => [ 'HourlyOnDemandRate' => [ 'shape' => 'GenericString', ], 'InstanceType' => [ 'shape' => 'GenericString', ], 'Platform' => [ 'shape' => 'GenericString', ], 'Region' => [ 'shape' => 'GenericString', ], 'Sku' => [ 'shape' => 'GenericString', ], 'Memory' => [ 'shape' => 'GenericString', ], 'NetworkPerformance' => [ 'shape' => 'GenericString', ], 'Storage' => [ 'shape' => 'GenericString', ], 'Vcpu' => [ 'shape' => 'GenericString', ], ], ], 'EC2ResourceUtilization' => [ 'type' => 'structure', 'members' => [ 'MaxCpuUtilizationPercentage' => [ 'shape' => 'GenericString', ], 'MaxMemoryUtilizationPercentage' => [ 'shape' => 'GenericString', ], 'MaxStorageUtilizationPercentage' => [ 'shape' => 'GenericString', ], 'EBSResourceUtilization' => [ 'shape' => 'EBSResourceUtilization', ], 'DiskResourceUtilization' => [ 'shape' => 'DiskResourceUtilization', ], 'NetworkResourceUtilization' => [ 'shape' => 'NetworkResourceUtilization', ], ], ], 'EC2Specification' => [ 'type' => 'structure', 'members' => [ 'OfferingClass' => [ 'shape' => 'OfferingClass', ], ], ], 'ESInstanceDetails' => [ 'type' => 'structure', 'members' => [ 'InstanceClass' => [ 'shape' => 'GenericString', ], 'InstanceSize' => [ 'shape' => 'GenericString', ], 'Region' => [ 'shape' => 'GenericString', ], 'CurrentGeneration' => [ 'shape' => 'GenericBoolean', ], 'SizeFlexEligible' => [ 'shape' => 'GenericBoolean', ], ], ], 'ElastiCacheInstanceDetails' => [ 'type' => 'structure', 'members' => [ 'Family' => [ 'shape' => 'GenericString', ], 'NodeType' => [ 'shape' => 'GenericString', ], 'Region' => [ 'shape' => 'GenericString', ], 'ProductDescription' => [ 'shape' => 'GenericString', ], 'CurrentGeneration' => [ 'shape' => 'GenericBoolean', ], 'SizeFlexEligible' => [ 'shape' => 'GenericBoolean', ], ], ], 'Entity' => [ 'type' => 'string', ], 'ErrorMessage' => [ 'type' => 'string', ], 'Estimated' => [ 'type' => 'boolean', ], 'Expression' => [ 'type' => 'structure', 'members' => [ 'Or' => [ 'shape' => 'Expressions', ], 'And' => [ 'shape' => 'Expressions', ], 'Not' => [ 'shape' => 'Expression', ], 'Dimensions' => [ 'shape' => 'DimensionValues', ], 'Tags' => [ 'shape' => 'TagValues', ], 'CostCategories' => [ 'shape' => 'CostCategoryValues', ], ], ], 'Expressions' => [ 'type' => 'list', 'member' => [ 'shape' => 'Expression', ], ], 'FindingReasonCode' => [ 'type' => 'string', 'enum' => [ 'CPU_OVER_PROVISIONED', 'CPU_UNDER_PROVISIONED', 'MEMORY_OVER_PROVISIONED', 'MEMORY_UNDER_PROVISIONED', 'EBS_THROUGHPUT_OVER_PROVISIONED', 'EBS_THROUGHPUT_UNDER_PROVISIONED', 'EBS_IOPS_OVER_PROVISIONED', 'EBS_IOPS_UNDER_PROVISIONED', 'NETWORK_BANDWIDTH_OVER_PROVISIONED', 'NETWORK_BANDWIDTH_UNDER_PROVISIONED', 'NETWORK_PPS_OVER_PROVISIONED', 'NETWORK_PPS_UNDER_PROVISIONED', 'DISK_IOPS_OVER_PROVISIONED', 'DISK_IOPS_UNDER_PROVISIONED', 'DISK_THROUGHPUT_OVER_PROVISIONED', 'DISK_THROUGHPUT_UNDER_PROVISIONED', ], ], 'FindingReasonCodes' => [ 'type' => 'list', 'member' => [ 'shape' => 'FindingReasonCode', ], ], 'ForecastResult' => [ 'type' => 'structure', 'members' => [ 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'MeanValue' => [ 'shape' => 'GenericString', ], 'PredictionIntervalLowerBound' => [ 'shape' => 'GenericString', ], 'PredictionIntervalUpperBound' => [ 'shape' => 'GenericString', ], ], ], 'ForecastResultsByTime' => [ 'type' => 'list', 'member' => [ 'shape' => 'ForecastResult', ], ], 'GenerationExistsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'GenerationStatus' => [ 'type' => 'string', 'enum' => [ 'SUCCEEDED', 'PROCESSING', 'FAILED', ], ], 'GenerationSummary' => [ 'type' => 'structure', 'members' => [ 'RecommendationId' => [ 'shape' => 'RecommendationId', ], 'GenerationStatus' => [ 'shape' => 'GenerationStatus', ], 'GenerationStartedTime' => [ 'shape' => 'ZonedDateTime', ], 'GenerationCompletionTime' => [ 'shape' => 'ZonedDateTime', ], 'EstimatedCompletionTime' => [ 'shape' => 'ZonedDateTime', ], ], ], 'GenerationSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'GenerationSummary', ], ], 'GenericBoolean' => [ 'type' => 'boolean', ], 'GenericDouble' => [ 'type' => 'double', ], 'GenericString' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'pattern' => '[\\\\S\\\\s]*', ], 'GetAnomaliesRequest' => [ 'type' => 'structure', 'required' => [ 'DateInterval', ], 'members' => [ 'MonitorArn' => [ 'shape' => 'GenericString', ], 'DateInterval' => [ 'shape' => 'AnomalyDateInterval', ], 'Feedback' => [ 'shape' => 'AnomalyFeedbackType', ], 'TotalImpact' => [ 'shape' => 'TotalImpactFilter', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], 'MaxResults' => [ 'shape' => 'PageSize', ], ], ], 'GetAnomaliesResponse' => [ 'type' => 'structure', 'required' => [ 'Anomalies', ], 'members' => [ 'Anomalies' => [ 'shape' => 'Anomalies', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetAnomalyMonitorsRequest' => [ 'type' => 'structure', 'members' => [ 'MonitorArnList' => [ 'shape' => 'Values', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], 'MaxResults' => [ 'shape' => 'PageSize', ], ], ], 'GetAnomalyMonitorsResponse' => [ 'type' => 'structure', 'required' => [ 'AnomalyMonitors', ], 'members' => [ 'AnomalyMonitors' => [ 'shape' => 'AnomalyMonitors', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetAnomalySubscriptionsRequest' => [ 'type' => 'structure', 'members' => [ 'SubscriptionArnList' => [ 'shape' => 'Values', ], 'MonitorArn' => [ 'shape' => 'GenericString', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], 'MaxResults' => [ 'shape' => 'PageSize', ], ], ], 'GetAnomalySubscriptionsResponse' => [ 'type' => 'structure', 'required' => [ 'AnomalySubscriptions', ], 'members' => [ 'AnomalySubscriptions' => [ 'shape' => 'AnomalySubscriptions', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetCostAndUsageRequest' => [ 'type' => 'structure', 'required' => [ 'TimePeriod', 'Granularity', 'Metrics', ], 'members' => [ 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'Granularity' => [ 'shape' => 'Granularity', ], 'Filter' => [ 'shape' => 'Expression', ], 'Metrics' => [ 'shape' => 'MetricNames', ], 'GroupBy' => [ 'shape' => 'GroupDefinitions', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetCostAndUsageResponse' => [ 'type' => 'structure', 'members' => [ 'NextPageToken' => [ 'shape' => 'NextPageToken', ], 'GroupDefinitions' => [ 'shape' => 'GroupDefinitions', ], 'ResultsByTime' => [ 'shape' => 'ResultsByTime', ], 'DimensionValueAttributes' => [ 'shape' => 'DimensionValuesWithAttributesList', ], ], ], 'GetCostAndUsageWithResourcesRequest' => [ 'type' => 'structure', 'required' => [ 'TimePeriod', 'Granularity', 'Filter', ], 'members' => [ 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'Granularity' => [ 'shape' => 'Granularity', ], 'Filter' => [ 'shape' => 'Expression', ], 'Metrics' => [ 'shape' => 'MetricNames', ], 'GroupBy' => [ 'shape' => 'GroupDefinitions', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetCostAndUsageWithResourcesResponse' => [ 'type' => 'structure', 'members' => [ 'NextPageToken' => [ 'shape' => 'NextPageToken', ], 'GroupDefinitions' => [ 'shape' => 'GroupDefinitions', ], 'ResultsByTime' => [ 'shape' => 'ResultsByTime', ], 'DimensionValueAttributes' => [ 'shape' => 'DimensionValuesWithAttributesList', ], ], ], 'GetCostCategoriesRequest' => [ 'type' => 'structure', 'required' => [ 'TimePeriod', ], 'members' => [ 'SearchString' => [ 'shape' => 'SearchString', ], 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'CostCategoryName' => [ 'shape' => 'CostCategoryName', ], 'Filter' => [ 'shape' => 'Expression', ], 'SortBy' => [ 'shape' => 'SortDefinitions', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetCostCategoriesResponse' => [ 'type' => 'structure', 'required' => [ 'ReturnSize', 'TotalSize', ], 'members' => [ 'NextPageToken' => [ 'shape' => 'NextPageToken', ], 'CostCategoryNames' => [ 'shape' => 'CostCategoryNamesList', ], 'CostCategoryValues' => [ 'shape' => 'CostCategoryValuesList', ], 'ReturnSize' => [ 'shape' => 'PageSize', ], 'TotalSize' => [ 'shape' => 'PageSize', ], ], ], 'GetCostForecastRequest' => [ 'type' => 'structure', 'required' => [ 'TimePeriod', 'Metric', 'Granularity', ], 'members' => [ 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'Metric' => [ 'shape' => 'Metric', ], 'Granularity' => [ 'shape' => 'Granularity', ], 'Filter' => [ 'shape' => 'Expression', ], 'PredictionIntervalLevel' => [ 'shape' => 'PredictionIntervalLevel', ], ], ], 'GetCostForecastResponse' => [ 'type' => 'structure', 'members' => [ 'Total' => [ 'shape' => 'MetricValue', ], 'ForecastResultsByTime' => [ 'shape' => 'ForecastResultsByTime', ], ], ], 'GetDimensionValuesRequest' => [ 'type' => 'structure', 'required' => [ 'TimePeriod', 'Dimension', ], 'members' => [ 'SearchString' => [ 'shape' => 'SearchString', ], 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'Dimension' => [ 'shape' => 'Dimension', ], 'Context' => [ 'shape' => 'Context', ], 'Filter' => [ 'shape' => 'Expression', ], 'SortBy' => [ 'shape' => 'SortDefinitions', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetDimensionValuesResponse' => [ 'type' => 'structure', 'required' => [ 'DimensionValues', 'ReturnSize', 'TotalSize', ], 'members' => [ 'DimensionValues' => [ 'shape' => 'DimensionValuesWithAttributesList', ], 'ReturnSize' => [ 'shape' => 'PageSize', ], 'TotalSize' => [ 'shape' => 'PageSize', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetReservationCoverageRequest' => [ 'type' => 'structure', 'required' => [ 'TimePeriod', ], 'members' => [ 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'GroupBy' => [ 'shape' => 'GroupDefinitions', ], 'Granularity' => [ 'shape' => 'Granularity', ], 'Filter' => [ 'shape' => 'Expression', ], 'Metrics' => [ 'shape' => 'MetricNames', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], 'SortBy' => [ 'shape' => 'SortDefinition', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'box' => true, ], ], ], 'GetReservationCoverageResponse' => [ 'type' => 'structure', 'required' => [ 'CoveragesByTime', ], 'members' => [ 'CoveragesByTime' => [ 'shape' => 'CoveragesByTime', ], 'Total' => [ 'shape' => 'Coverage', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetReservationPurchaseRecommendationRequest' => [ 'type' => 'structure', 'required' => [ 'Service', ], 'members' => [ 'AccountId' => [ 'shape' => 'GenericString', ], 'Service' => [ 'shape' => 'GenericString', ], 'Filter' => [ 'shape' => 'Expression', ], 'AccountScope' => [ 'shape' => 'AccountScope', ], 'LookbackPeriodInDays' => [ 'shape' => 'LookbackPeriodInDays', ], 'TermInYears' => [ 'shape' => 'TermInYears', ], 'PaymentOption' => [ 'shape' => 'PaymentOption', ], 'ServiceSpecification' => [ 'shape' => 'ServiceSpecification', ], 'PageSize' => [ 'shape' => 'NonNegativeInteger', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetReservationPurchaseRecommendationResponse' => [ 'type' => 'structure', 'members' => [ 'Metadata' => [ 'shape' => 'ReservationPurchaseRecommendationMetadata', ], 'Recommendations' => [ 'shape' => 'ReservationPurchaseRecommendations', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetReservationUtilizationRequest' => [ 'type' => 'structure', 'required' => [ 'TimePeriod', ], 'members' => [ 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'GroupBy' => [ 'shape' => 'GroupDefinitions', ], 'Granularity' => [ 'shape' => 'Granularity', ], 'Filter' => [ 'shape' => 'Expression', ], 'SortBy' => [ 'shape' => 'SortDefinition', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'box' => true, ], ], ], 'GetReservationUtilizationResponse' => [ 'type' => 'structure', 'required' => [ 'UtilizationsByTime', ], 'members' => [ 'UtilizationsByTime' => [ 'shape' => 'UtilizationsByTime', ], 'Total' => [ 'shape' => 'ReservationAggregates', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetRightsizingRecommendationRequest' => [ 'type' => 'structure', 'required' => [ 'Service', ], 'members' => [ 'Filter' => [ 'shape' => 'Expression', ], 'Configuration' => [ 'shape' => 'RightsizingRecommendationConfiguration', ], 'Service' => [ 'shape' => 'GenericString', ], 'PageSize' => [ 'shape' => 'NonNegativeInteger', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetRightsizingRecommendationResponse' => [ 'type' => 'structure', 'members' => [ 'Metadata' => [ 'shape' => 'RightsizingRecommendationMetadata', ], 'Summary' => [ 'shape' => 'RightsizingRecommendationSummary', ], 'RightsizingRecommendations' => [ 'shape' => 'RightsizingRecommendationList', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], 'Configuration' => [ 'shape' => 'RightsizingRecommendationConfiguration', ], ], ], 'GetSavingsPlansCoverageRequest' => [ 'type' => 'structure', 'required' => [ 'TimePeriod', ], 'members' => [ 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'GroupBy' => [ 'shape' => 'GroupDefinitions', ], 'Granularity' => [ 'shape' => 'Granularity', ], 'Filter' => [ 'shape' => 'Expression', ], 'Metrics' => [ 'shape' => 'MetricNames', ], 'NextToken' => [ 'shape' => 'NextPageToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'box' => true, ], 'SortBy' => [ 'shape' => 'SortDefinition', ], ], ], 'GetSavingsPlansCoverageResponse' => [ 'type' => 'structure', 'required' => [ 'SavingsPlansCoverages', ], 'members' => [ 'SavingsPlansCoverages' => [ 'shape' => 'SavingsPlansCoverages', ], 'NextToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetSavingsPlansPurchaseRecommendationRequest' => [ 'type' => 'structure', 'required' => [ 'SavingsPlansType', 'TermInYears', 'PaymentOption', 'LookbackPeriodInDays', ], 'members' => [ 'SavingsPlansType' => [ 'shape' => 'SupportedSavingsPlansType', ], 'TermInYears' => [ 'shape' => 'TermInYears', ], 'PaymentOption' => [ 'shape' => 'PaymentOption', ], 'AccountScope' => [ 'shape' => 'AccountScope', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], 'PageSize' => [ 'shape' => 'NonNegativeInteger', ], 'LookbackPeriodInDays' => [ 'shape' => 'LookbackPeriodInDays', ], 'Filter' => [ 'shape' => 'Expression', ], ], ], 'GetSavingsPlansPurchaseRecommendationResponse' => [ 'type' => 'structure', 'members' => [ 'Metadata' => [ 'shape' => 'SavingsPlansPurchaseRecommendationMetadata', ], 'SavingsPlansPurchaseRecommendation' => [ 'shape' => 'SavingsPlansPurchaseRecommendation', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetSavingsPlansUtilizationDetailsRequest' => [ 'type' => 'structure', 'required' => [ 'TimePeriod', ], 'members' => [ 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'Filter' => [ 'shape' => 'Expression', ], 'DataType' => [ 'shape' => 'SavingsPlansDataTypes', ], 'NextToken' => [ 'shape' => 'NextPageToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'box' => true, ], 'SortBy' => [ 'shape' => 'SortDefinition', ], ], ], 'GetSavingsPlansUtilizationDetailsResponse' => [ 'type' => 'structure', 'required' => [ 'SavingsPlansUtilizationDetails', 'TimePeriod', ], 'members' => [ 'SavingsPlansUtilizationDetails' => [ 'shape' => 'SavingsPlansUtilizationDetails', ], 'Total' => [ 'shape' => 'SavingsPlansUtilizationAggregates', ], 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'NextToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetSavingsPlansUtilizationRequest' => [ 'type' => 'structure', 'required' => [ 'TimePeriod', ], 'members' => [ 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'Granularity' => [ 'shape' => 'Granularity', ], 'Filter' => [ 'shape' => 'Expression', ], 'SortBy' => [ 'shape' => 'SortDefinition', ], ], ], 'GetSavingsPlansUtilizationResponse' => [ 'type' => 'structure', 'required' => [ 'Total', ], 'members' => [ 'SavingsPlansUtilizationsByTime' => [ 'shape' => 'SavingsPlansUtilizationsByTime', ], 'Total' => [ 'shape' => 'SavingsPlansUtilizationAggregates', ], ], ], 'GetTagsRequest' => [ 'type' => 'structure', 'required' => [ 'TimePeriod', ], 'members' => [ 'SearchString' => [ 'shape' => 'SearchString', ], 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'TagKey' => [ 'shape' => 'TagKey', ], 'Filter' => [ 'shape' => 'Expression', ], 'SortBy' => [ 'shape' => 'SortDefinitions', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'GetTagsResponse' => [ 'type' => 'structure', 'required' => [ 'Tags', 'ReturnSize', 'TotalSize', ], 'members' => [ 'NextPageToken' => [ 'shape' => 'NextPageToken', ], 'Tags' => [ 'shape' => 'TagList', ], 'ReturnSize' => [ 'shape' => 'PageSize', ], 'TotalSize' => [ 'shape' => 'PageSize', ], ], ], 'GetUsageForecastRequest' => [ 'type' => 'structure', 'required' => [ 'TimePeriod', 'Metric', 'Granularity', ], 'members' => [ 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'Metric' => [ 'shape' => 'Metric', ], 'Granularity' => [ 'shape' => 'Granularity', ], 'Filter' => [ 'shape' => 'Expression', ], 'PredictionIntervalLevel' => [ 'shape' => 'PredictionIntervalLevel', ], ], ], 'GetUsageForecastResponse' => [ 'type' => 'structure', 'members' => [ 'Total' => [ 'shape' => 'MetricValue', ], 'ForecastResultsByTime' => [ 'shape' => 'ForecastResultsByTime', ], ], ], 'Granularity' => [ 'type' => 'string', 'enum' => [ 'DAILY', 'MONTHLY', 'HOURLY', ], ], 'Group' => [ 'type' => 'structure', 'members' => [ 'Keys' => [ 'shape' => 'Keys', ], 'Metrics' => [ 'shape' => 'Metrics', ], ], ], 'GroupDefinition' => [ 'type' => 'structure', 'members' => [ 'Type' => [ 'shape' => 'GroupDefinitionType', ], 'Key' => [ 'shape' => 'GroupDefinitionKey', ], ], ], 'GroupDefinitionKey' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'pattern' => '[\\\\S\\\\s]*', ], 'GroupDefinitionType' => [ 'type' => 'string', 'enum' => [ 'DIMENSION', 'TAG', 'COST_CATEGORY', ], ], 'GroupDefinitions' => [ 'type' => 'list', 'member' => [ 'shape' => 'GroupDefinition', ], ], 'Groups' => [ 'type' => 'list', 'member' => [ 'shape' => 'Group', ], ], 'Impact' => [ 'type' => 'structure', 'required' => [ 'MaxImpact', ], 'members' => [ 'MaxImpact' => [ 'shape' => 'GenericDouble', ], 'TotalImpact' => [ 'shape' => 'GenericDouble', ], 'TotalActualSpend' => [ 'shape' => 'NullableNonNegativeDouble', ], 'TotalExpectedSpend' => [ 'shape' => 'NullableNonNegativeDouble', ], 'TotalImpactPercentage' => [ 'shape' => 'NullableNonNegativeDouble', ], ], ], 'InstanceDetails' => [ 'type' => 'structure', 'members' => [ 'EC2InstanceDetails' => [ 'shape' => 'EC2InstanceDetails', ], 'RDSInstanceDetails' => [ 'shape' => 'RDSInstanceDetails', ], 'RedshiftInstanceDetails' => [ 'shape' => 'RedshiftInstanceDetails', ], 'ElastiCacheInstanceDetails' => [ 'shape' => 'ElastiCacheInstanceDetails', ], 'ESInstanceDetails' => [ 'shape' => 'ESInstanceDetails', ], ], ], 'InvalidNextTokenException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'Key' => [ 'type' => 'string', ], 'Keys' => [ 'type' => 'list', 'member' => [ 'shape' => 'Key', ], ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ListCostAllocationTagsRequest' => [ 'type' => 'structure', 'members' => [ 'Status' => [ 'shape' => 'CostAllocationTagStatus', ], 'TagKeys' => [ 'shape' => 'CostAllocationTagKeyList', ], 'Type' => [ 'shape' => 'CostAllocationTagType', ], 'NextToken' => [ 'shape' => 'NextPageToken', ], 'MaxResults' => [ 'shape' => 'CostAllocationTagsMaxResults', 'box' => true, ], ], ], 'ListCostAllocationTagsResponse' => [ 'type' => 'structure', 'members' => [ 'CostAllocationTags' => [ 'shape' => 'CostAllocationTagList', ], 'NextToken' => [ 'shape' => 'NextPageToken', ], ], ], 'ListCostCategoryDefinitionsRequest' => [ 'type' => 'structure', 'members' => [ 'EffectiveOn' => [ 'shape' => 'ZonedDateTime', ], 'NextToken' => [ 'shape' => 'NextPageToken', ], 'MaxResults' => [ 'shape' => 'CostCategoryMaxResults', 'box' => true, ], ], ], 'ListCostCategoryDefinitionsResponse' => [ 'type' => 'structure', 'members' => [ 'CostCategoryReferences' => [ 'shape' => 'CostCategoryReferencesList', ], 'NextToken' => [ 'shape' => 'NextPageToken', ], ], ], 'ListSavingsPlansPurchaseRecommendationGenerationRequest' => [ 'type' => 'structure', 'members' => [ 'GenerationStatus' => [ 'shape' => 'GenerationStatus', ], 'RecommendationIds' => [ 'shape' => 'RecommendationIdList', ], 'PageSize' => [ 'shape' => 'NonNegativeInteger', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'ListSavingsPlansPurchaseRecommendationGenerationResponse' => [ 'type' => 'structure', 'members' => [ 'GenerationSummaryList' => [ 'shape' => 'GenerationSummaryList', ], 'NextPageToken' => [ 'shape' => 'NextPageToken', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'ResourceTags' => [ 'shape' => 'ResourceTagList', ], ], ], 'LookbackPeriodInDays' => [ 'type' => 'string', 'enum' => [ 'SEVEN_DAYS', 'THIRTY_DAYS', 'SIXTY_DAYS', ], ], 'MatchOption' => [ 'type' => 'string', 'enum' => [ 'EQUALS', 'ABSENT', 'STARTS_WITH', 'ENDS_WITH', 'CONTAINS', 'CASE_SENSITIVE', 'CASE_INSENSITIVE', 'GREATER_THAN_OR_EQUAL', ], ], 'MatchOptions' => [ 'type' => 'list', 'member' => [ 'shape' => 'MatchOption', ], ], 'MaxResults' => [ 'type' => 'integer', 'min' => 1, ], 'Metric' => [ 'type' => 'string', 'enum' => [ 'BLENDED_COST', 'UNBLENDED_COST', 'AMORTIZED_COST', 'NET_UNBLENDED_COST', 'NET_AMORTIZED_COST', 'USAGE_QUANTITY', 'NORMALIZED_USAGE_AMOUNT', ], ], 'MetricAmount' => [ 'type' => 'string', ], 'MetricName' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'pattern' => '[\\\\S\\\\s]*', ], 'MetricNames' => [ 'type' => 'list', 'member' => [ 'shape' => 'MetricName', ], ], 'MetricUnit' => [ 'type' => 'string', ], 'MetricValue' => [ 'type' => 'structure', 'members' => [ 'Amount' => [ 'shape' => 'MetricAmount', ], 'Unit' => [ 'shape' => 'MetricUnit', ], ], ], 'Metrics' => [ 'type' => 'map', 'key' => [ 'shape' => 'MetricName', ], 'value' => [ 'shape' => 'MetricValue', ], ], 'ModifyRecommendationDetail' => [ 'type' => 'structure', 'members' => [ 'TargetInstances' => [ 'shape' => 'TargetInstancesList', ], ], ], 'MonitorArnList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Arn', ], ], 'MonitorDimension' => [ 'type' => 'string', 'enum' => [ 'SERVICE', ], ], 'MonitorType' => [ 'type' => 'string', 'enum' => [ 'DIMENSIONAL', 'CUSTOM', ], ], 'NetRISavings' => [ 'type' => 'string', ], 'NetworkResourceUtilization' => [ 'type' => 'structure', 'members' => [ 'NetworkInBytesPerSecond' => [ 'shape' => 'GenericString', ], 'NetworkOutBytesPerSecond' => [ 'shape' => 'GenericString', ], 'NetworkPacketsInPerSecond' => [ 'shape' => 'GenericString', ], 'NetworkPacketsOutPerSecond' => [ 'shape' => 'GenericString', ], ], ], 'NextPageToken' => [ 'type' => 'string', 'max' => 8192, 'min' => 0, 'pattern' => '[\\\\S\\\\s]*', ], 'NonNegativeInteger' => [ 'type' => 'integer', 'min' => 0, ], 'NullableNonNegativeDouble' => [ 'type' => 'double', 'min' => 0, ], 'NumericOperator' => [ 'type' => 'string', 'enum' => [ 'EQUAL', 'GREATER_THAN_OR_EQUAL', 'LESS_THAN_OR_EQUAL', 'GREATER_THAN', 'LESS_THAN', 'BETWEEN', ], ], 'OfferingClass' => [ 'type' => 'string', 'enum' => [ 'STANDARD', 'CONVERTIBLE', ], ], 'OnDemandCost' => [ 'type' => 'string', ], 'OnDemandCostOfRIHoursUsed' => [ 'type' => 'string', ], 'OnDemandHours' => [ 'type' => 'string', ], 'OnDemandNormalizedUnits' => [ 'type' => 'string', ], 'PageSize' => [ 'type' => 'integer', ], 'PaymentOption' => [ 'type' => 'string', 'enum' => [ 'NO_UPFRONT', 'PARTIAL_UPFRONT', 'ALL_UPFRONT', 'LIGHT_UTILIZATION', 'MEDIUM_UTILIZATION', 'HEAVY_UTILIZATION', ], ], 'PlatformDifference' => [ 'type' => 'string', 'enum' => [ 'HYPERVISOR', 'NETWORK_INTERFACE', 'STORAGE_INTERFACE', 'INSTANCE_STORE_AVAILABILITY', 'VIRTUALIZATION_TYPE', ], ], 'PlatformDifferences' => [ 'type' => 'list', 'member' => [ 'shape' => 'PlatformDifference', ], ], 'PredictionIntervalLevel' => [ 'type' => 'integer', 'max' => 99, 'min' => 51, ], 'ProvideAnomalyFeedbackRequest' => [ 'type' => 'structure', 'required' => [ 'AnomalyId', 'Feedback', ], 'members' => [ 'AnomalyId' => [ 'shape' => 'GenericString', ], 'Feedback' => [ 'shape' => 'AnomalyFeedbackType', ], ], ], 'ProvideAnomalyFeedbackResponse' => [ 'type' => 'structure', 'required' => [ 'AnomalyId', ], 'members' => [ 'AnomalyId' => [ 'shape' => 'GenericString', ], ], ], 'PurchasedHours' => [ 'type' => 'string', ], 'PurchasedUnits' => [ 'type' => 'string', ], 'RDSInstanceDetails' => [ 'type' => 'structure', 'members' => [ 'Family' => [ 'shape' => 'GenericString', ], 'InstanceType' => [ 'shape' => 'GenericString', ], 'Region' => [ 'shape' => 'GenericString', ], 'DatabaseEngine' => [ 'shape' => 'GenericString', ], 'DatabaseEdition' => [ 'shape' => 'GenericString', ], 'DeploymentOption' => [ 'shape' => 'GenericString', ], 'LicenseModel' => [ 'shape' => 'GenericString', ], 'CurrentGeneration' => [ 'shape' => 'GenericBoolean', ], 'SizeFlexEligible' => [ 'shape' => 'GenericBoolean', ], ], ], 'RICostForUnusedHours' => [ 'type' => 'string', ], 'RealizedSavings' => [ 'type' => 'string', ], 'RecommendationId' => [ 'type' => 'string', 'max' => 36, 'min' => 36, 'pattern' => '^[\\\\S\\\\s]{8}-[\\\\S\\\\s]{4}-[\\\\S\\\\s]{4}-[\\\\S\\\\s]{4}-[\\\\S\\\\s]{12}$', ], 'RecommendationIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RecommendationId', ], ], 'RecommendationTarget' => [ 'type' => 'string', 'enum' => [ 'SAME_INSTANCE_FAMILY', 'CROSS_INSTANCE_FAMILY', ], ], 'RedshiftInstanceDetails' => [ 'type' => 'structure', 'members' => [ 'Family' => [ 'shape' => 'GenericString', ], 'NodeType' => [ 'shape' => 'GenericString', ], 'Region' => [ 'shape' => 'GenericString', ], 'CurrentGeneration' => [ 'shape' => 'GenericBoolean', ], 'SizeFlexEligible' => [ 'shape' => 'GenericBoolean', ], ], ], 'RequestChangedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ReservationAggregates' => [ 'type' => 'structure', 'members' => [ 'UtilizationPercentage' => [ 'shape' => 'UtilizationPercentage', ], 'UtilizationPercentageInUnits' => [ 'shape' => 'UtilizationPercentageInUnits', ], 'PurchasedHours' => [ 'shape' => 'PurchasedHours', ], 'PurchasedUnits' => [ 'shape' => 'PurchasedUnits', ], 'TotalActualHours' => [ 'shape' => 'TotalActualHours', ], 'TotalActualUnits' => [ 'shape' => 'TotalActualUnits', ], 'UnusedHours' => [ 'shape' => 'UnusedHours', ], 'UnusedUnits' => [ 'shape' => 'UnusedUnits', ], 'OnDemandCostOfRIHoursUsed' => [ 'shape' => 'OnDemandCostOfRIHoursUsed', ], 'NetRISavings' => [ 'shape' => 'NetRISavings', ], 'TotalPotentialRISavings' => [ 'shape' => 'TotalPotentialRISavings', ], 'AmortizedUpfrontFee' => [ 'shape' => 'AmortizedUpfrontFee', ], 'AmortizedRecurringFee' => [ 'shape' => 'AmortizedRecurringFee', ], 'TotalAmortizedFee' => [ 'shape' => 'TotalAmortizedFee', ], 'RICostForUnusedHours' => [ 'shape' => 'RICostForUnusedHours', ], 'RealizedSavings' => [ 'shape' => 'RealizedSavings', ], 'UnrealizedSavings' => [ 'shape' => 'UnrealizedSavings', ], ], ], 'ReservationCoverageGroup' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'Attributes', ], 'Coverage' => [ 'shape' => 'Coverage', ], ], ], 'ReservationCoverageGroups' => [ 'type' => 'list', 'member' => [ 'shape' => 'ReservationCoverageGroup', ], ], 'ReservationGroupKey' => [ 'type' => 'string', ], 'ReservationGroupValue' => [ 'type' => 'string', ], 'ReservationPurchaseRecommendation' => [ 'type' => 'structure', 'members' => [ 'AccountScope' => [ 'shape' => 'AccountScope', ], 'LookbackPeriodInDays' => [ 'shape' => 'LookbackPeriodInDays', ], 'TermInYears' => [ 'shape' => 'TermInYears', ], 'PaymentOption' => [ 'shape' => 'PaymentOption', ], 'ServiceSpecification' => [ 'shape' => 'ServiceSpecification', ], 'RecommendationDetails' => [ 'shape' => 'ReservationPurchaseRecommendationDetails', ], 'RecommendationSummary' => [ 'shape' => 'ReservationPurchaseRecommendationSummary', ], ], ], 'ReservationPurchaseRecommendationDetail' => [ 'type' => 'structure', 'members' => [ 'AccountId' => [ 'shape' => 'GenericString', ], 'InstanceDetails' => [ 'shape' => 'InstanceDetails', ], 'RecommendedNumberOfInstancesToPurchase' => [ 'shape' => 'GenericString', ], 'RecommendedNormalizedUnitsToPurchase' => [ 'shape' => 'GenericString', ], 'MinimumNumberOfInstancesUsedPerHour' => [ 'shape' => 'GenericString', ], 'MinimumNormalizedUnitsUsedPerHour' => [ 'shape' => 'GenericString', ], 'MaximumNumberOfInstancesUsedPerHour' => [ 'shape' => 'GenericString', ], 'MaximumNormalizedUnitsUsedPerHour' => [ 'shape' => 'GenericString', ], 'AverageNumberOfInstancesUsedPerHour' => [ 'shape' => 'GenericString', ], 'AverageNormalizedUnitsUsedPerHour' => [ 'shape' => 'GenericString', ], 'AverageUtilization' => [ 'shape' => 'GenericString', ], 'EstimatedBreakEvenInMonths' => [ 'shape' => 'GenericString', ], 'CurrencyCode' => [ 'shape' => 'GenericString', ], 'EstimatedMonthlySavingsAmount' => [ 'shape' => 'GenericString', ], 'EstimatedMonthlySavingsPercentage' => [ 'shape' => 'GenericString', ], 'EstimatedMonthlyOnDemandCost' => [ 'shape' => 'GenericString', ], 'EstimatedReservationCostForLookbackPeriod' => [ 'shape' => 'GenericString', ], 'UpfrontCost' => [ 'shape' => 'GenericString', ], 'RecurringStandardMonthlyCost' => [ 'shape' => 'GenericString', ], ], ], 'ReservationPurchaseRecommendationDetails' => [ 'type' => 'list', 'member' => [ 'shape' => 'ReservationPurchaseRecommendationDetail', ], ], 'ReservationPurchaseRecommendationMetadata' => [ 'type' => 'structure', 'members' => [ 'RecommendationId' => [ 'shape' => 'GenericString', ], 'GenerationTimestamp' => [ 'shape' => 'GenericString', ], ], ], 'ReservationPurchaseRecommendationSummary' => [ 'type' => 'structure', 'members' => [ 'TotalEstimatedMonthlySavingsAmount' => [ 'shape' => 'GenericString', ], 'TotalEstimatedMonthlySavingsPercentage' => [ 'shape' => 'GenericString', ], 'CurrencyCode' => [ 'shape' => 'GenericString', ], ], ], 'ReservationPurchaseRecommendations' => [ 'type' => 'list', 'member' => [ 'shape' => 'ReservationPurchaseRecommendation', ], ], 'ReservationUtilizationGroup' => [ 'type' => 'structure', 'members' => [ 'Key' => [ 'shape' => 'ReservationGroupKey', ], 'Value' => [ 'shape' => 'ReservationGroupValue', ], 'Attributes' => [ 'shape' => 'Attributes', ], 'Utilization' => [ 'shape' => 'ReservationAggregates', ], ], ], 'ReservationUtilizationGroups' => [ 'type' => 'list', 'member' => [ 'shape' => 'ReservationUtilizationGroup', ], ], 'ReservedHours' => [ 'type' => 'string', ], 'ReservedNormalizedUnits' => [ 'type' => 'string', ], 'ResourceDetails' => [ 'type' => 'structure', 'members' => [ 'EC2ResourceDetails' => [ 'shape' => 'EC2ResourceDetails', ], ], ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], 'ResourceName' => [ 'shape' => 'Arn', ], ], 'exception' => true, ], 'ResourceTag' => [ 'type' => 'structure', 'required' => [ 'Key', 'Value', ], 'members' => [ 'Key' => [ 'shape' => 'ResourceTagKey', ], 'Value' => [ 'shape' => 'ResourceTagValue', ], ], ], 'ResourceTagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$', ], 'ResourceTagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResourceTagKey', ], 'max' => 200, 'min' => 0, ], 'ResourceTagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResourceTag', ], 'max' => 200, 'min' => 0, ], 'ResourceTagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => '^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$', ], 'ResourceUtilization' => [ 'type' => 'structure', 'members' => [ 'EC2ResourceUtilization' => [ 'shape' => 'EC2ResourceUtilization', ], ], ], 'ResultByTime' => [ 'type' => 'structure', 'members' => [ 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'Total' => [ 'shape' => 'Metrics', ], 'Groups' => [ 'shape' => 'Groups', ], 'Estimated' => [ 'shape' => 'Estimated', ], ], ], 'ResultsByTime' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResultByTime', ], ], 'RightsizingRecommendation' => [ 'type' => 'structure', 'members' => [ 'AccountId' => [ 'shape' => 'GenericString', ], 'CurrentInstance' => [ 'shape' => 'CurrentInstance', ], 'RightsizingType' => [ 'shape' => 'RightsizingType', ], 'ModifyRecommendationDetail' => [ 'shape' => 'ModifyRecommendationDetail', ], 'TerminateRecommendationDetail' => [ 'shape' => 'TerminateRecommendationDetail', ], 'FindingReasonCodes' => [ 'shape' => 'FindingReasonCodes', ], ], ], 'RightsizingRecommendationConfiguration' => [ 'type' => 'structure', 'required' => [ 'RecommendationTarget', 'BenefitsConsidered', ], 'members' => [ 'RecommendationTarget' => [ 'shape' => 'RecommendationTarget', ], 'BenefitsConsidered' => [ 'shape' => 'GenericBoolean', ], ], ], 'RightsizingRecommendationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RightsizingRecommendation', ], ], 'RightsizingRecommendationMetadata' => [ 'type' => 'structure', 'members' => [ 'RecommendationId' => [ 'shape' => 'GenericString', ], 'GenerationTimestamp' => [ 'shape' => 'GenericString', ], 'LookbackPeriodInDays' => [ 'shape' => 'LookbackPeriodInDays', ], 'AdditionalMetadata' => [ 'shape' => 'GenericString', ], ], ], 'RightsizingRecommendationSummary' => [ 'type' => 'structure', 'members' => [ 'TotalRecommendationCount' => [ 'shape' => 'GenericString', ], 'EstimatedTotalMonthlySavingsAmount' => [ 'shape' => 'GenericString', ], 'SavingsCurrencyCode' => [ 'shape' => 'GenericString', ], 'SavingsPercentage' => [ 'shape' => 'GenericString', ], ], ], 'RightsizingType' => [ 'type' => 'string', 'enum' => [ 'TERMINATE', 'MODIFY', ], ], 'RootCause' => [ 'type' => 'structure', 'members' => [ 'Service' => [ 'shape' => 'GenericString', ], 'Region' => [ 'shape' => 'GenericString', ], 'LinkedAccount' => [ 'shape' => 'GenericString', ], 'UsageType' => [ 'shape' => 'GenericString', ], 'LinkedAccountName' => [ 'shape' => 'GenericString', ], ], ], 'RootCauses' => [ 'type' => 'list', 'member' => [ 'shape' => 'RootCause', ], ], 'SavingsPlanArn' => [ 'type' => 'string', ], 'SavingsPlansAmortizedCommitment' => [ 'type' => 'structure', 'members' => [ 'AmortizedRecurringCommitment' => [ 'shape' => 'GenericString', ], 'AmortizedUpfrontCommitment' => [ 'shape' => 'GenericString', ], 'TotalAmortizedCommitment' => [ 'shape' => 'GenericString', ], ], ], 'SavingsPlansCoverage' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'Attributes', ], 'Coverage' => [ 'shape' => 'SavingsPlansCoverageData', ], 'TimePeriod' => [ 'shape' => 'DateInterval', ], ], ], 'SavingsPlansCoverageData' => [ 'type' => 'structure', 'members' => [ 'SpendCoveredBySavingsPlans' => [ 'shape' => 'GenericString', ], 'OnDemandCost' => [ 'shape' => 'GenericString', ], 'TotalCost' => [ 'shape' => 'GenericString', ], 'CoveragePercentage' => [ 'shape' => 'GenericString', ], ], ], 'SavingsPlansCoverages' => [ 'type' => 'list', 'member' => [ 'shape' => 'SavingsPlansCoverage', ], ], 'SavingsPlansDataType' => [ 'type' => 'string', 'enum' => [ 'ATTRIBUTES', 'UTILIZATION', 'AMORTIZED_COMMITMENT', 'SAVINGS', ], ], 'SavingsPlansDataTypes' => [ 'type' => 'list', 'member' => [ 'shape' => 'SavingsPlansDataType', ], ], 'SavingsPlansDetails' => [ 'type' => 'structure', 'members' => [ 'Region' => [ 'shape' => 'GenericString', ], 'InstanceFamily' => [ 'shape' => 'GenericString', ], 'OfferingId' => [ 'shape' => 'GenericString', ], ], ], 'SavingsPlansPurchaseRecommendation' => [ 'type' => 'structure', 'members' => [ 'AccountScope' => [ 'shape' => 'AccountScope', ], 'SavingsPlansType' => [ 'shape' => 'SupportedSavingsPlansType', ], 'TermInYears' => [ 'shape' => 'TermInYears', ], 'PaymentOption' => [ 'shape' => 'PaymentOption', ], 'LookbackPeriodInDays' => [ 'shape' => 'LookbackPeriodInDays', ], 'SavingsPlansPurchaseRecommendationDetails' => [ 'shape' => 'SavingsPlansPurchaseRecommendationDetailList', ], 'SavingsPlansPurchaseRecommendationSummary' => [ 'shape' => 'SavingsPlansPurchaseRecommendationSummary', ], ], ], 'SavingsPlansPurchaseRecommendationDetail' => [ 'type' => 'structure', 'members' => [ 'SavingsPlansDetails' => [ 'shape' => 'SavingsPlansDetails', ], 'AccountId' => [ 'shape' => 'GenericString', ], 'UpfrontCost' => [ 'shape' => 'GenericString', ], 'EstimatedROI' => [ 'shape' => 'GenericString', ], 'CurrencyCode' => [ 'shape' => 'GenericString', ], 'EstimatedSPCost' => [ 'shape' => 'GenericString', ], 'EstimatedOnDemandCost' => [ 'shape' => 'GenericString', ], 'EstimatedOnDemandCostWithCurrentCommitment' => [ 'shape' => 'GenericString', ], 'EstimatedSavingsAmount' => [ 'shape' => 'GenericString', ], 'EstimatedSavingsPercentage' => [ 'shape' => 'GenericString', ], 'HourlyCommitmentToPurchase' => [ 'shape' => 'GenericString', ], 'EstimatedAverageUtilization' => [ 'shape' => 'GenericString', ], 'EstimatedMonthlySavingsAmount' => [ 'shape' => 'GenericString', ], 'CurrentMinimumHourlyOnDemandSpend' => [ 'shape' => 'GenericString', ], 'CurrentMaximumHourlyOnDemandSpend' => [ 'shape' => 'GenericString', ], 'CurrentAverageHourlyOnDemandSpend' => [ 'shape' => 'GenericString', ], ], ], 'SavingsPlansPurchaseRecommendationDetailList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SavingsPlansPurchaseRecommendationDetail', ], ], 'SavingsPlansPurchaseRecommendationMetadata' => [ 'type' => 'structure', 'members' => [ 'RecommendationId' => [ 'shape' => 'GenericString', ], 'GenerationTimestamp' => [ 'shape' => 'GenericString', ], 'AdditionalMetadata' => [ 'shape' => 'GenericString', ], ], ], 'SavingsPlansPurchaseRecommendationSummary' => [ 'type' => 'structure', 'members' => [ 'EstimatedROI' => [ 'shape' => 'GenericString', ], 'CurrencyCode' => [ 'shape' => 'GenericString', ], 'EstimatedTotalCost' => [ 'shape' => 'GenericString', ], 'CurrentOnDemandSpend' => [ 'shape' => 'GenericString', ], 'EstimatedSavingsAmount' => [ 'shape' => 'GenericString', ], 'TotalRecommendationCount' => [ 'shape' => 'GenericString', ], 'DailyCommitmentToPurchase' => [ 'shape' => 'GenericString', ], 'HourlyCommitmentToPurchase' => [ 'shape' => 'GenericString', ], 'EstimatedSavingsPercentage' => [ 'shape' => 'GenericString', ], 'EstimatedMonthlySavingsAmount' => [ 'shape' => 'GenericString', ], 'EstimatedOnDemandCostWithCurrentCommitment' => [ 'shape' => 'GenericString', ], ], ], 'SavingsPlansSavings' => [ 'type' => 'structure', 'members' => [ 'NetSavings' => [ 'shape' => 'GenericString', ], 'OnDemandCostEquivalent' => [ 'shape' => 'GenericString', ], ], ], 'SavingsPlansUtilization' => [ 'type' => 'structure', 'members' => [ 'TotalCommitment' => [ 'shape' => 'GenericString', ], 'UsedCommitment' => [ 'shape' => 'GenericString', ], 'UnusedCommitment' => [ 'shape' => 'GenericString', ], 'UtilizationPercentage' => [ 'shape' => 'GenericString', ], ], ], 'SavingsPlansUtilizationAggregates' => [ 'type' => 'structure', 'required' => [ 'Utilization', ], 'members' => [ 'Utilization' => [ 'shape' => 'SavingsPlansUtilization', ], 'Savings' => [ 'shape' => 'SavingsPlansSavings', ], 'AmortizedCommitment' => [ 'shape' => 'SavingsPlansAmortizedCommitment', ], ], ], 'SavingsPlansUtilizationByTime' => [ 'type' => 'structure', 'required' => [ 'TimePeriod', 'Utilization', ], 'members' => [ 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'Utilization' => [ 'shape' => 'SavingsPlansUtilization', ], 'Savings' => [ 'shape' => 'SavingsPlansSavings', ], 'AmortizedCommitment' => [ 'shape' => 'SavingsPlansAmortizedCommitment', ], ], ], 'SavingsPlansUtilizationDetail' => [ 'type' => 'structure', 'members' => [ 'SavingsPlanArn' => [ 'shape' => 'SavingsPlanArn', ], 'Attributes' => [ 'shape' => 'Attributes', ], 'Utilization' => [ 'shape' => 'SavingsPlansUtilization', ], 'Savings' => [ 'shape' => 'SavingsPlansSavings', ], 'AmortizedCommitment' => [ 'shape' => 'SavingsPlansAmortizedCommitment', ], ], ], 'SavingsPlansUtilizationDetails' => [ 'type' => 'list', 'member' => [ 'shape' => 'SavingsPlansUtilizationDetail', ], ], 'SavingsPlansUtilizationsByTime' => [ 'type' => 'list', 'member' => [ 'shape' => 'SavingsPlansUtilizationByTime', ], ], 'SearchString' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'pattern' => '[\\\\S\\\\s]*', ], 'ServiceQuotaExceededException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ServiceSpecification' => [ 'type' => 'structure', 'members' => [ 'EC2Specification' => [ 'shape' => 'EC2Specification', ], ], ], 'SortDefinition' => [ 'type' => 'structure', 'required' => [ 'Key', ], 'members' => [ 'Key' => [ 'shape' => 'SortDefinitionKey', ], 'SortOrder' => [ 'shape' => 'SortOrder', ], ], ], 'SortDefinitionKey' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'pattern' => '[\\\\S\\\\s]*', ], 'SortDefinitions' => [ 'type' => 'list', 'member' => [ 'shape' => 'SortDefinition', ], ], 'SortOrder' => [ 'type' => 'string', 'enum' => [ 'ASCENDING', 'DESCENDING', ], ], 'StartSavingsPlansPurchaseRecommendationGenerationRequest' => [ 'type' => 'structure', 'members' => [], ], 'StartSavingsPlansPurchaseRecommendationGenerationResponse' => [ 'type' => 'structure', 'members' => [ 'RecommendationId' => [ 'shape' => 'RecommendationId', ], 'GenerationStartedTime' => [ 'shape' => 'ZonedDateTime', ], 'EstimatedCompletionTime' => [ 'shape' => 'ZonedDateTime', ], ], ], 'Subscriber' => [ 'type' => 'structure', 'members' => [ 'Address' => [ 'shape' => 'SubscriberAddress', ], 'Type' => [ 'shape' => 'SubscriberType', ], 'Status' => [ 'shape' => 'SubscriberStatus', ], ], ], 'SubscriberAddress' => [ 'type' => 'string', 'max' => 302, 'min' => 6, 'pattern' => '(^[a-zA-Z0-9.!#$%&\\'*+=?^_\u00e2\u20ac\u02dc{|}~-]+@[a-zA-Z0-9_-]+(\\\\.[a-zA-Z0-9_-]+)+$)|(^arn:(aws[a-zA-Z-]*):sns:[a-zA-Z0-9-]+:[0-9]{12}:[a-zA-Z0-9_-]+(\\\\.fifo)?$)', ], 'SubscriberStatus' => [ 'type' => 'string', 'enum' => [ 'CONFIRMED', 'DECLINED', ], ], 'SubscriberType' => [ 'type' => 'string', 'enum' => [ 'EMAIL', 'SNS', ], ], 'Subscribers' => [ 'type' => 'list', 'member' => [ 'shape' => 'Subscriber', ], ], 'SupportedSavingsPlansType' => [ 'type' => 'string', 'enum' => [ 'COMPUTE_SP', 'EC2_INSTANCE_SP', 'SAGEMAKER_SP', ], ], 'TagKey' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'pattern' => '[\\\\S\\\\s]*', ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Entity', ], ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'ResourceTags', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', ], 'ResourceTags' => [ 'shape' => 'ResourceTagList', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValues' => [ 'type' => 'structure', 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Values' => [ 'shape' => 'Values', ], 'MatchOptions' => [ 'shape' => 'MatchOptions', ], ], ], 'TagValuesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagValues', ], ], 'TargetInstance' => [ 'type' => 'structure', 'members' => [ 'EstimatedMonthlyCost' => [ 'shape' => 'GenericString', ], 'EstimatedMonthlySavings' => [ 'shape' => 'GenericString', ], 'CurrencyCode' => [ 'shape' => 'GenericString', ], 'DefaultTargetInstance' => [ 'shape' => 'GenericBoolean', ], 'ResourceDetails' => [ 'shape' => 'ResourceDetails', ], 'ExpectedResourceUtilization' => [ 'shape' => 'ResourceUtilization', ], 'PlatformDifferences' => [ 'shape' => 'PlatformDifferences', ], ], ], 'TargetInstancesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TargetInstance', ], ], 'TermInYears' => [ 'type' => 'string', 'enum' => [ 'ONE_YEAR', 'THREE_YEARS', ], ], 'TerminateRecommendationDetail' => [ 'type' => 'structure', 'members' => [ 'EstimatedMonthlySavings' => [ 'shape' => 'GenericString', ], 'CurrencyCode' => [ 'shape' => 'GenericString', ], ], ], 'TooManyTagsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], 'ResourceName' => [ 'shape' => 'Arn', ], ], 'exception' => true, ], 'TotalActualHours' => [ 'type' => 'string', ], 'TotalActualUnits' => [ 'type' => 'string', ], 'TotalAmortizedFee' => [ 'type' => 'string', ], 'TotalImpactFilter' => [ 'type' => 'structure', 'required' => [ 'NumericOperator', 'StartValue', ], 'members' => [ 'NumericOperator' => [ 'shape' => 'NumericOperator', ], 'StartValue' => [ 'shape' => 'GenericDouble', ], 'EndValue' => [ 'shape' => 'GenericDouble', ], ], ], 'TotalPotentialRISavings' => [ 'type' => 'string', ], 'TotalRunningHours' => [ 'type' => 'string', ], 'TotalRunningNormalizedUnits' => [ 'type' => 'string', ], 'UnknownMonitorException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'UnknownSubscriptionException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'UnrealizedSavings' => [ 'type' => 'string', ], 'UnresolvableUsageUnitException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'ResourceTagKeys', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', ], 'ResourceTagKeys' => [ 'shape' => 'ResourceTagKeyList', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UnusedHours' => [ 'type' => 'string', ], 'UnusedUnits' => [ 'type' => 'string', ], 'UpdateAnomalyMonitorRequest' => [ 'type' => 'structure', 'required' => [ 'MonitorArn', ], 'members' => [ 'MonitorArn' => [ 'shape' => 'GenericString', ], 'MonitorName' => [ 'shape' => 'GenericString', ], ], ], 'UpdateAnomalyMonitorResponse' => [ 'type' => 'structure', 'required' => [ 'MonitorArn', ], 'members' => [ 'MonitorArn' => [ 'shape' => 'GenericString', ], ], ], 'UpdateAnomalySubscriptionRequest' => [ 'type' => 'structure', 'required' => [ 'SubscriptionArn', ], 'members' => [ 'SubscriptionArn' => [ 'shape' => 'GenericString', ], 'Threshold' => [ 'shape' => 'NullableNonNegativeDouble', 'deprecated' => true, 'deprecatedMessage' => 'Threshold has been deprecated in favor of ThresholdExpression', ], 'Frequency' => [ 'shape' => 'AnomalySubscriptionFrequency', ], 'MonitorArnList' => [ 'shape' => 'MonitorArnList', ], 'Subscribers' => [ 'shape' => 'Subscribers', ], 'SubscriptionName' => [ 'shape' => 'GenericString', ], 'ThresholdExpression' => [ 'shape' => 'Expression', ], ], ], 'UpdateAnomalySubscriptionResponse' => [ 'type' => 'structure', 'required' => [ 'SubscriptionArn', ], 'members' => [ 'SubscriptionArn' => [ 'shape' => 'GenericString', ], ], ], 'UpdateCostAllocationTagsStatusError' => [ 'type' => 'structure', 'members' => [ 'TagKey' => [ 'shape' => 'TagKey', ], 'Code' => [ 'shape' => 'GenericString', ], 'Message' => [ 'shape' => 'ErrorMessage', ], ], ], 'UpdateCostAllocationTagsStatusErrors' => [ 'type' => 'list', 'member' => [ 'shape' => 'UpdateCostAllocationTagsStatusError', ], 'max' => 20, 'min' => 0, ], 'UpdateCostAllocationTagsStatusRequest' => [ 'type' => 'structure', 'required' => [ 'CostAllocationTagsStatus', ], 'members' => [ 'CostAllocationTagsStatus' => [ 'shape' => 'CostAllocationTagStatusList', ], ], ], 'UpdateCostAllocationTagsStatusResponse' => [ 'type' => 'structure', 'members' => [ 'Errors' => [ 'shape' => 'UpdateCostAllocationTagsStatusErrors', ], ], ], 'UpdateCostCategoryDefinitionRequest' => [ 'type' => 'structure', 'required' => [ 'CostCategoryArn', 'RuleVersion', 'Rules', ], 'members' => [ 'CostCategoryArn' => [ 'shape' => 'Arn', ], 'EffectiveStart' => [ 'shape' => 'ZonedDateTime', ], 'RuleVersion' => [ 'shape' => 'CostCategoryRuleVersion', ], 'Rules' => [ 'shape' => 'CostCategoryRulesList', ], 'DefaultValue' => [ 'shape' => 'CostCategoryValue', ], 'SplitChargeRules' => [ 'shape' => 'CostCategorySplitChargeRulesList', ], ], ], 'UpdateCostCategoryDefinitionResponse' => [ 'type' => 'structure', 'members' => [ 'CostCategoryArn' => [ 'shape' => 'Arn', ], 'EffectiveStart' => [ 'shape' => 'ZonedDateTime', ], ], ], 'UtilizationByTime' => [ 'type' => 'structure', 'members' => [ 'TimePeriod' => [ 'shape' => 'DateInterval', ], 'Groups' => [ 'shape' => 'ReservationUtilizationGroups', ], 'Total' => [ 'shape' => 'ReservationAggregates', ], ], ], 'UtilizationPercentage' => [ 'type' => 'string', ], 'UtilizationPercentageInUnits' => [ 'type' => 'string', ], 'UtilizationsByTime' => [ 'type' => 'list', 'member' => [ 'shape' => 'UtilizationByTime', ], ], 'Value' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'pattern' => '[\\\\S\\\\s]*', ], 'Values' => [ 'type' => 'list', 'member' => [ 'shape' => 'Value', ], ], 'YearMonthDay' => [ 'type' => 'string', 'max' => 40, 'min' => 0, 'pattern' => '(\\\\d{4}-\\\\d{2}-\\\\d{2})(T\\\\d{2}:\\\\d{2}:\\\\d{2}Z)?', ], 'ZonedDateTime' => [ 'type' => 'string', 'max' => 25, 'min' => 20, 'pattern' => '^\\\\d{4}-\\\\d\\\\d-\\\\d\\\\dT\\\\d\\\\d:\\\\d\\\\d:\\\\d\\\\d(([+-]\\\\d\\\\d:\\\\d\\\\d)|Z)$', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/ce/2017-10-25/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => true, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], 'aws', ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cost-explorer-fips.{Region}.api.aws', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingRegion' => 'us-east-1', 'signingName' => 'ce', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cost-explorer-fips.{Region}.amazonaws.com', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingRegion' => 'us-east-1', 'signingName' => 'ce', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cost-explorer.{Region}.api.aws', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingRegion' => 'us-east-1', 'signingName' => 'ce', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://ce.us-east-1.amazonaws.com', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingRegion' => 'us-east-1', 'signingName' => 'ce', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], 'aws-cn', ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cost-explorer-fips.{Region}.api.amazonwebservices.com.cn', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingRegion' => 'cn-northwest-1', 'signingName' => 'ce', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cost-explorer-fips.{Region}.amazonaws.com.cn', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingRegion' => 'cn-northwest-1', 'signingName' => 'ce', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cost-explorer.{Region}.api.amazonwebservices.com.cn', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingRegion' => 'cn-northwest-1', 'signingName' => 'ce', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://ce.cn-northwest-1.amazonaws.com.cn', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingRegion' => 'cn-northwest-1', 'signingName' => 'ce', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://ce-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://ce-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://ce.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'ref' => 'Region', ], 'aws-global', ], ], ], 'endpoint' => [ 'url' => 'https://ce.us-east-1.amazonaws.com', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingRegion' => 'us-east-1', 'signingName' => 'ce', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'ref' => 'Region', ], 'aws-cn-global', ], ], ], 'endpoint' => [ 'url' => 'https://ce.cn-northwest-1.amazonaws.com.cn', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingRegion' => 'cn-northwest-1', 'signingName' => 'ce', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://ce.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/ce/2017-10-25/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region aws-cn-global with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'properties' => [ 'authSchemes' => [ [ 'signingRegion' => 'cn-northwest-1', 'name' => 'sigv4', 'signingName' => 'ce', ], ], ], 'url' => 'https://ce.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'aws-cn-global', ], ], [ 'documentation' => 'For region aws-global with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'properties' => [ 'authSchemes' => [ [ 'signingRegion' => 'us-east-1', 'name' => 'sigv4', 'signingName' => 'ce', ], ], ], 'url' => 'https://ce.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'aws-global', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/ce/2017-10-25/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/ce/2017-10-25/paginators-1.json\nreturn [ 'pagination' => [ 'GetSavingsPlansCoverage' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'GetSavingsPlansUtilizationDetails' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListCostAllocationTags' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListCostCategoryDefinitions' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime/2018-05-01/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2018-05-01', 'endpointPrefix' => 'chime', 'protocol' => 'rest-json', 'serviceFullName' => 'Amazon Chime', 'serviceId' => 'Chime', 'signatureVersion' => 'v4', 'uid' => 'chime-2018-05-01', ], 'operations' => [ 'AssociatePhoneNumberWithUser' => [ 'name' => 'AssociatePhoneNumberWithUser', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/users/{userId}?operation=associate-phone-number', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AssociatePhoneNumberWithUserRequest', ], 'output' => [ 'shape' => 'AssociatePhoneNumberWithUserResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'AssociatePhoneNumbersWithVoiceConnector' => [ 'name' => 'AssociatePhoneNumbersWithVoiceConnector', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors/{voiceConnectorId}?operation=associate-phone-numbers', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AssociatePhoneNumbersWithVoiceConnectorRequest', ], 'output' => [ 'shape' => 'AssociatePhoneNumbersWithVoiceConnectorResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by AssociatePhoneNumbersWithVoiceConnector in the Amazon Chime SDK Voice Namespace', ], 'AssociatePhoneNumbersWithVoiceConnectorGroup' => [ 'name' => 'AssociatePhoneNumbersWithVoiceConnectorGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connector-groups/{voiceConnectorGroupId}?operation=associate-phone-numbers', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AssociatePhoneNumbersWithVoiceConnectorGroupRequest', ], 'output' => [ 'shape' => 'AssociatePhoneNumbersWithVoiceConnectorGroupResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by AssociatePhoneNumbersWithVoiceConnectorGroup in the Amazon Chime SDK Voice Namespace', ], 'AssociateSigninDelegateGroupsWithAccount' => [ 'name' => 'AssociateSigninDelegateGroupsWithAccount', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}?operation=associate-signin-delegate-groups', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AssociateSigninDelegateGroupsWithAccountRequest', ], 'output' => [ 'shape' => 'AssociateSigninDelegateGroupsWithAccountResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'BatchCreateAttendee' => [ 'name' => 'BatchCreateAttendee', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings/{meetingId}/attendees?operation=batch-create', 'responseCode' => 201, ], 'input' => [ 'shape' => 'BatchCreateAttendeeRequest', ], 'output' => [ 'shape' => 'BatchCreateAttendeeResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by BatchCreateAttendee in the Amazon Chime SDK Meetings Namespace', ], 'BatchCreateChannelMembership' => [ 'name' => 'BatchCreateChannelMembership', 'http' => [ 'method' => 'POST', 'requestUri' => '/channels/{channelArn}/memberships?operation=batch-create', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchCreateChannelMembershipRequest', ], 'output' => [ 'shape' => 'BatchCreateChannelMembershipResponse', ], 'errors' => [ [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by BatchCreateChannelMembership in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'BatchCreateRoomMembership' => [ 'name' => 'BatchCreateRoomMembership', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/rooms/{roomId}/memberships?operation=batch-create', 'responseCode' => 201, ], 'input' => [ 'shape' => 'BatchCreateRoomMembershipRequest', ], 'output' => [ 'shape' => 'BatchCreateRoomMembershipResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'BatchDeletePhoneNumber' => [ 'name' => 'BatchDeletePhoneNumber', 'http' => [ 'method' => 'POST', 'requestUri' => '/phone-numbers?operation=batch-delete', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchDeletePhoneNumberRequest', ], 'output' => [ 'shape' => 'BatchDeletePhoneNumberResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'BatchSuspendUser' => [ 'name' => 'BatchSuspendUser', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/users?operation=suspend', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchSuspendUserRequest', ], 'output' => [ 'shape' => 'BatchSuspendUserResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'BatchUnsuspendUser' => [ 'name' => 'BatchUnsuspendUser', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/users?operation=unsuspend', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchUnsuspendUserRequest', ], 'output' => [ 'shape' => 'BatchUnsuspendUserResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'BatchUpdatePhoneNumber' => [ 'name' => 'BatchUpdatePhoneNumber', 'http' => [ 'method' => 'POST', 'requestUri' => '/phone-numbers?operation=batch-update', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchUpdatePhoneNumberRequest', ], 'output' => [ 'shape' => 'BatchUpdatePhoneNumberResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'BatchUpdateUser' => [ 'name' => 'BatchUpdateUser', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/users', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchUpdateUserRequest', ], 'output' => [ 'shape' => 'BatchUpdateUserResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateAccount' => [ 'name' => 'CreateAccount', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateAccountRequest', ], 'output' => [ 'shape' => 'CreateAccountResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateAppInstance' => [ 'name' => 'CreateAppInstance', 'http' => [ 'method' => 'POST', 'requestUri' => '/app-instances', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateAppInstanceRequest', ], 'output' => [ 'shape' => 'CreateAppInstanceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateAppInstance in the Amazon Chime SDK Identity Namespace', 'endpoint' => [ 'hostPrefix' => 'identity-', ], ], 'CreateAppInstanceAdmin' => [ 'name' => 'CreateAppInstanceAdmin', 'http' => [ 'method' => 'POST', 'requestUri' => '/app-instances/{appInstanceArn}/admins', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateAppInstanceAdminRequest', ], 'output' => [ 'shape' => 'CreateAppInstanceAdminResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateAppInstanceAdmin in the Amazon Chime SDK Identity Namespace', 'endpoint' => [ 'hostPrefix' => 'identity-', ], ], 'CreateAppInstanceUser' => [ 'name' => 'CreateAppInstanceUser', 'http' => [ 'method' => 'POST', 'requestUri' => '/app-instance-users', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateAppInstanceUserRequest', ], 'output' => [ 'shape' => 'CreateAppInstanceUserResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateAppInstanceUser in the Amazon Chime SDK Identity Namespace', 'endpoint' => [ 'hostPrefix' => 'identity-', ], ], 'CreateAttendee' => [ 'name' => 'CreateAttendee', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings/{meetingId}/attendees', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateAttendeeRequest', ], 'output' => [ 'shape' => 'CreateAttendeeResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateAttendee in the Amazon Chime SDK Meetings Namespace', ], 'CreateBot' => [ 'name' => 'CreateBot', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/bots', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateBotRequest', ], 'output' => [ 'shape' => 'CreateBotResponse', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ThrottledClientException', ], ], ], 'CreateChannel' => [ 'name' => 'CreateChannel', 'http' => [ 'method' => 'POST', 'requestUri' => '/channels', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateChannelRequest', ], 'output' => [ 'shape' => 'CreateChannelResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateChannel in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'CreateChannelBan' => [ 'name' => 'CreateChannelBan', 'http' => [ 'method' => 'POST', 'requestUri' => '/channels/{channelArn}/bans', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateChannelBanRequest', ], 'output' => [ 'shape' => 'CreateChannelBanResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateChannelBan in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'CreateChannelMembership' => [ 'name' => 'CreateChannelMembership', 'http' => [ 'method' => 'POST', 'requestUri' => '/channels/{channelArn}/memberships', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateChannelMembershipRequest', ], 'output' => [ 'shape' => 'CreateChannelMembershipResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateChannelMembership in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'CreateChannelModerator' => [ 'name' => 'CreateChannelModerator', 'http' => [ 'method' => 'POST', 'requestUri' => '/channels/{channelArn}/moderators', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateChannelModeratorRequest', ], 'output' => [ 'shape' => 'CreateChannelModeratorResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateChannelModerator in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'CreateMediaCapturePipeline' => [ 'name' => 'CreateMediaCapturePipeline', 'http' => [ 'method' => 'POST', 'requestUri' => '/media-capture-pipelines', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateMediaCapturePipelineRequest', ], 'output' => [ 'shape' => 'CreateMediaCapturePipelineResponse', ], 'errors' => [ [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateMediaCapturePipeline in the Amazon Chime SDK Media Pipelines Namespace', ], 'CreateMeeting' => [ 'name' => 'CreateMeeting', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateMeetingRequest', ], 'output' => [ 'shape' => 'CreateMeetingResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateMeeting in the Amazon Chime SDK Meetings Namespace', ], 'CreateMeetingDialOut' => [ 'name' => 'CreateMeetingDialOut', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings/{meetingId}/dial-outs', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateMeetingDialOutRequest', ], 'output' => [ 'shape' => 'CreateMeetingDialOutResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateMeetingWithAttendees' => [ 'name' => 'CreateMeetingWithAttendees', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings?operation=create-attendees', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateMeetingWithAttendeesRequest', ], 'output' => [ 'shape' => 'CreateMeetingWithAttendeesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateMeetingWithAttendees in the Amazon Chime SDK Meetings Namespace', ], 'CreatePhoneNumberOrder' => [ 'name' => 'CreatePhoneNumberOrder', 'http' => [ 'method' => 'POST', 'requestUri' => '/phone-number-orders', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreatePhoneNumberOrderRequest', ], 'output' => [ 'shape' => 'CreatePhoneNumberOrderResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateProxySession' => [ 'name' => 'CreateProxySession', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors/{voiceConnectorId}/proxy-sessions', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateProxySessionRequest', ], 'output' => [ 'shape' => 'CreateProxySessionResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateProxySession in the Amazon Chime SDK Voice Namespace', ], 'CreateRoom' => [ 'name' => 'CreateRoom', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/rooms', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateRoomRequest', ], 'output' => [ 'shape' => 'CreateRoomResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateRoomMembership' => [ 'name' => 'CreateRoomMembership', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/rooms/{roomId}/memberships', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateRoomMembershipRequest', ], 'output' => [ 'shape' => 'CreateRoomMembershipResponse', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateSipMediaApplication' => [ 'name' => 'CreateSipMediaApplication', 'http' => [ 'method' => 'POST', 'requestUri' => '/sip-media-applications', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateSipMediaApplicationRequest', ], 'output' => [ 'shape' => 'CreateSipMediaApplicationResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateSipMediaApplication in the Amazon Chime SDK Voice Namespace', ], 'CreateSipMediaApplicationCall' => [ 'name' => 'CreateSipMediaApplicationCall', 'http' => [ 'method' => 'POST', 'requestUri' => '/sip-media-applications/{sipMediaApplicationId}/calls', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateSipMediaApplicationCallRequest', ], 'output' => [ 'shape' => 'CreateSipMediaApplicationCallResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateSipMediaApplicationCall in the Amazon Chime SDK Voice Namespace', ], 'CreateSipRule' => [ 'name' => 'CreateSipRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/sip-rules', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateSipRuleRequest', ], 'output' => [ 'shape' => 'CreateSipRuleResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateSipRule in the Amazon Chime SDK Voice Namespace', ], 'CreateUser' => [ 'name' => 'CreateUser', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/users?operation=create', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateUserRequest', ], 'output' => [ 'shape' => 'CreateUserResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateVoiceConnector' => [ 'name' => 'CreateVoiceConnector', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateVoiceConnectorRequest', ], 'output' => [ 'shape' => 'CreateVoiceConnectorResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateVoiceConnector in the Amazon Chime SDK Voice Namespace', ], 'CreateVoiceConnectorGroup' => [ 'name' => 'CreateVoiceConnectorGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connector-groups', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateVoiceConnectorGroupRequest', ], 'output' => [ 'shape' => 'CreateVoiceConnectorGroupResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by CreateVoiceConnectorGroup in the Amazon Chime SDK Voice Namespace', ], 'DeleteAccount' => [ 'name' => 'DeleteAccount', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/accounts/{accountId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteAccountRequest', ], 'output' => [ 'shape' => 'DeleteAccountResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnprocessableEntityException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteAppInstance' => [ 'name' => 'DeleteAppInstance', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/app-instances/{appInstanceArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteAppInstanceRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteAppInstance in the Amazon Chime SDK Identity Namespace', 'endpoint' => [ 'hostPrefix' => 'identity-', ], ], 'DeleteAppInstanceAdmin' => [ 'name' => 'DeleteAppInstanceAdmin', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/app-instances/{appInstanceArn}/admins/{appInstanceAdminArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteAppInstanceAdminRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteAppInstanceAdmin in the Amazon Chime SDK Identity Namespace', 'endpoint' => [ 'hostPrefix' => 'identity-', ], ], 'DeleteAppInstanceStreamingConfigurations' => [ 'name' => 'DeleteAppInstanceStreamingConfigurations', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/app-instances/{appInstanceArn}/streaming-configurations', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteAppInstanceStreamingConfigurationsRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteAppInstanceStreamingConfigurations in the Amazon Chime SDK Messaging Namespace', ], 'DeleteAppInstanceUser' => [ 'name' => 'DeleteAppInstanceUser', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/app-instance-users/{appInstanceUserArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteAppInstanceUserRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteAppInstanceUser in the Amazon Chime SDK Identity Namespace', 'endpoint' => [ 'hostPrefix' => 'identity-', ], ], 'DeleteAttendee' => [ 'name' => 'DeleteAttendee', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/meetings/{meetingId}/attendees/{attendeeId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteAttendeeRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteAttendee in the Amazon Chime SDK Meetings Namespace', ], 'DeleteChannel' => [ 'name' => 'DeleteChannel', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/channels/{channelArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteChannelRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteChannel in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'DeleteChannelBan' => [ 'name' => 'DeleteChannelBan', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/channels/{channelArn}/bans/{memberArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteChannelBanRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteChannelBan in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'DeleteChannelMembership' => [ 'name' => 'DeleteChannelMembership', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/channels/{channelArn}/memberships/{memberArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteChannelMembershipRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteChannelMembership in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'DeleteChannelMessage' => [ 'name' => 'DeleteChannelMessage', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/channels/{channelArn}/messages/{messageId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteChannelMessageRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteChannelMessage in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'DeleteChannelModerator' => [ 'name' => 'DeleteChannelModerator', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/channels/{channelArn}/moderators/{channelModeratorArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteChannelModeratorRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteChannelModerator in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'DeleteEventsConfiguration' => [ 'name' => 'DeleteEventsConfiguration', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/accounts/{accountId}/bots/{botId}/events-configuration', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteEventsConfigurationRequest', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], ], ], 'DeleteMediaCapturePipeline' => [ 'name' => 'DeleteMediaCapturePipeline', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/media-capture-pipelines/{mediaPipelineId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteMediaCapturePipelineRequest', ], 'errors' => [ [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteMediaCapturePipeline in the Amazon Chime SDK Media Pipelines Namespace', ], 'DeleteMeeting' => [ 'name' => 'DeleteMeeting', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/meetings/{meetingId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteMeetingRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteMeeting in the Amazon Chime SDK Meetings Namespace', ], 'DeletePhoneNumber' => [ 'name' => 'DeletePhoneNumber', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/phone-numbers/{phoneNumberId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeletePhoneNumberRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteProxySession' => [ 'name' => 'DeleteProxySession', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-connectors/{voiceConnectorId}/proxy-sessions/{proxySessionId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteProxySessionRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteProxySession in the Amazon Chime SDK Voice Namespace', ], 'DeleteRoom' => [ 'name' => 'DeleteRoom', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/accounts/{accountId}/rooms/{roomId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteRoomRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteRoomMembership' => [ 'name' => 'DeleteRoomMembership', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/accounts/{accountId}/rooms/{roomId}/memberships/{memberId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteRoomMembershipRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteSipMediaApplication' => [ 'name' => 'DeleteSipMediaApplication', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/sip-media-applications/{sipMediaApplicationId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteSipMediaApplicationRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteSipMediaApplication in the Amazon Chime SDK Voice Namespace', ], 'DeleteSipRule' => [ 'name' => 'DeleteSipRule', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/sip-rules/{sipRuleId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteSipRuleRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteSipRule in the Amazon Chime SDK Voice Namespace', ], 'DeleteVoiceConnector' => [ 'name' => 'DeleteVoiceConnector', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-connectors/{voiceConnectorId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceConnectorRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteVoiceConnector in the Amazon Chime SDK Voice Namespace', ], 'DeleteVoiceConnectorEmergencyCallingConfiguration' => [ 'name' => 'DeleteVoiceConnectorEmergencyCallingConfiguration', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-connectors/{voiceConnectorId}/emergency-calling-configuration', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceConnectorEmergencyCallingConfigurationRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteVoiceConnectorEmergencyCallingConfiguration in the Amazon Chime SDK Voice Namespace', ], 'DeleteVoiceConnectorGroup' => [ 'name' => 'DeleteVoiceConnectorGroup', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-connector-groups/{voiceConnectorGroupId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceConnectorGroupRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteVoiceConnectorGroup in the Amazon Chime SDK Voice Namespace', ], 'DeleteVoiceConnectorOrigination' => [ 'name' => 'DeleteVoiceConnectorOrigination', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-connectors/{voiceConnectorId}/origination', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceConnectorOriginationRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteVoiceConnectorOrigination in the Amazon Chime SDK Voice Namespace', ], 'DeleteVoiceConnectorProxy' => [ 'name' => 'DeleteVoiceConnectorProxy', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-connectors/{voiceConnectorId}/programmable-numbers/proxy', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceConnectorProxyRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteVoiceConnectorProxy in the Amazon Chime SDK Voice Namespace', ], 'DeleteVoiceConnectorStreamingConfiguration' => [ 'name' => 'DeleteVoiceConnectorStreamingConfiguration', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-connectors/{voiceConnectorId}/streaming-configuration', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceConnectorStreamingConfigurationRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteVoiceConnectorStreamingConfiguration in the Amazon Chime SDK Voice Namespace', ], 'DeleteVoiceConnectorTermination' => [ 'name' => 'DeleteVoiceConnectorTermination', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-connectors/{voiceConnectorId}/termination', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceConnectorTerminationRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteVoiceConnectorTermination in the Amazon Chime SDK Voice Namespace', ], 'DeleteVoiceConnectorTerminationCredentials' => [ 'name' => 'DeleteVoiceConnectorTerminationCredentials', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors/{voiceConnectorId}/termination/credentials?operation=delete', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceConnectorTerminationCredentialsRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DeleteVoiceConnectorTerminationCredentials in the Amazon Chime SDK Voice Namespace', ], 'DescribeAppInstance' => [ 'name' => 'DescribeAppInstance', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instances/{appInstanceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeAppInstanceRequest', ], 'output' => [ 'shape' => 'DescribeAppInstanceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DescribeAppInstance in the Amazon Chime SDK Identity Namespace', 'endpoint' => [ 'hostPrefix' => 'identity-', ], ], 'DescribeAppInstanceAdmin' => [ 'name' => 'DescribeAppInstanceAdmin', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instances/{appInstanceArn}/admins/{appInstanceAdminArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeAppInstanceAdminRequest', ], 'output' => [ 'shape' => 'DescribeAppInstanceAdminResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DescribeAppInstanceAdmin in the Amazon Chime SDK Identity Namespace', 'endpoint' => [ 'hostPrefix' => 'identity-', ], ], 'DescribeAppInstanceUser' => [ 'name' => 'DescribeAppInstanceUser', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instance-users/{appInstanceUserArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeAppInstanceUserRequest', ], 'output' => [ 'shape' => 'DescribeAppInstanceUserResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DescribeAppInstanceUser in the Amazon Chime SDK Identity Namespace', 'endpoint' => [ 'hostPrefix' => 'identity-', ], ], 'DescribeChannel' => [ 'name' => 'DescribeChannel', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeChannelRequest', ], 'output' => [ 'shape' => 'DescribeChannelResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DescribeChannel in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'DescribeChannelBan' => [ 'name' => 'DescribeChannelBan', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/bans/{memberArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeChannelBanRequest', ], 'output' => [ 'shape' => 'DescribeChannelBanResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DescribeChannelBan in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'DescribeChannelMembership' => [ 'name' => 'DescribeChannelMembership', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/memberships/{memberArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeChannelMembershipRequest', ], 'output' => [ 'shape' => 'DescribeChannelMembershipResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DescribeChannelMembership in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'DescribeChannelMembershipForAppInstanceUser' => [ 'name' => 'DescribeChannelMembershipForAppInstanceUser', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}?scope=app-instance-user-membership', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeChannelMembershipForAppInstanceUserRequest', ], 'output' => [ 'shape' => 'DescribeChannelMembershipForAppInstanceUserResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DescribeChannelMembershipForAppInstanceUser in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'DescribeChannelModeratedByAppInstanceUser' => [ 'name' => 'DescribeChannelModeratedByAppInstanceUser', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}?scope=app-instance-user-moderated-channel', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeChannelModeratedByAppInstanceUserRequest', ], 'output' => [ 'shape' => 'DescribeChannelModeratedByAppInstanceUserResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DescribeChannelModeratedByAppInstanceUser in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'DescribeChannelModerator' => [ 'name' => 'DescribeChannelModerator', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/moderators/{channelModeratorArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeChannelModeratorRequest', ], 'output' => [ 'shape' => 'DescribeChannelModeratorResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DescribeChannelModerator in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'DisassociatePhoneNumberFromUser' => [ 'name' => 'DisassociatePhoneNumberFromUser', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/users/{userId}?operation=disassociate-phone-number', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DisassociatePhoneNumberFromUserRequest', ], 'output' => [ 'shape' => 'DisassociatePhoneNumberFromUserResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DisassociatePhoneNumbersFromVoiceConnector' => [ 'name' => 'DisassociatePhoneNumbersFromVoiceConnector', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors/{voiceConnectorId}?operation=disassociate-phone-numbers', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DisassociatePhoneNumbersFromVoiceConnectorRequest', ], 'output' => [ 'shape' => 'DisassociatePhoneNumbersFromVoiceConnectorResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DisassociatePhoneNumbersFromVoiceConnector in the Amazon Chime SDK Voice Namespace', ], 'DisassociatePhoneNumbersFromVoiceConnectorGroup' => [ 'name' => 'DisassociatePhoneNumbersFromVoiceConnectorGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connector-groups/{voiceConnectorGroupId}?operation=disassociate-phone-numbers', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DisassociatePhoneNumbersFromVoiceConnectorGroupRequest', ], 'output' => [ 'shape' => 'DisassociatePhoneNumbersFromVoiceConnectorGroupResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by DisassociatePhoneNumbersFromVoiceConnectorGroup in the Amazon Chime SDK Voice Namespace', ], 'DisassociateSigninDelegateGroupsFromAccount' => [ 'name' => 'DisassociateSigninDelegateGroupsFromAccount', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}?operation=disassociate-signin-delegate-groups', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DisassociateSigninDelegateGroupsFromAccountRequest', ], 'output' => [ 'shape' => 'DisassociateSigninDelegateGroupsFromAccountResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetAccount' => [ 'name' => 'GetAccount', 'http' => [ 'method' => 'GET', 'requestUri' => '/accounts/{accountId}', ], 'input' => [ 'shape' => 'GetAccountRequest', ], 'output' => [ 'shape' => 'GetAccountResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetAccountSettings' => [ 'name' => 'GetAccountSettings', 'http' => [ 'method' => 'GET', 'requestUri' => '/accounts/{accountId}/settings', ], 'input' => [ 'shape' => 'GetAccountSettingsRequest', ], 'output' => [ 'shape' => 'GetAccountSettingsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetAppInstanceRetentionSettings' => [ 'name' => 'GetAppInstanceRetentionSettings', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instances/{appInstanceArn}/retention-settings', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetAppInstanceRetentionSettingsRequest', ], 'output' => [ 'shape' => 'GetAppInstanceRetentionSettingsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetAppInstanceRetentionSettings in the Amazon Chime SDK Identity Namespace', 'endpoint' => [ 'hostPrefix' => 'identity-', ], ], 'GetAppInstanceStreamingConfigurations' => [ 'name' => 'GetAppInstanceStreamingConfigurations', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instances/{appInstanceArn}/streaming-configurations', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetAppInstanceStreamingConfigurationsRequest', ], 'output' => [ 'shape' => 'GetAppInstanceStreamingConfigurationsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetAppInstanceStreamingConfigurations in the Amazon Chime SDK Messaging Namespace', ], 'GetAttendee' => [ 'name' => 'GetAttendee', 'http' => [ 'method' => 'GET', 'requestUri' => '/meetings/{meetingId}/attendees/{attendeeId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetAttendeeRequest', ], 'output' => [ 'shape' => 'GetAttendeeResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetAttendee in the Amazon Chime SDK Meetings Namespace', ], 'GetBot' => [ 'name' => 'GetBot', 'http' => [ 'method' => 'GET', 'requestUri' => '/accounts/{accountId}/bots/{botId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetBotRequest', ], 'output' => [ 'shape' => 'GetBotResponse', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], ], ], 'GetChannelMessage' => [ 'name' => 'GetChannelMessage', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/messages/{messageId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetChannelMessageRequest', ], 'output' => [ 'shape' => 'GetChannelMessageResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetChannelMessage in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'GetEventsConfiguration' => [ 'name' => 'GetEventsConfiguration', 'http' => [ 'method' => 'GET', 'requestUri' => '/accounts/{accountId}/bots/{botId}/events-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetEventsConfigurationRequest', ], 'output' => [ 'shape' => 'GetEventsConfigurationResponse', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'NotFoundException', ], ], ], 'GetGlobalSettings' => [ 'name' => 'GetGlobalSettings', 'http' => [ 'method' => 'GET', 'requestUri' => '/settings', 'responseCode' => 200, ], 'output' => [ 'shape' => 'GetGlobalSettingsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetMediaCapturePipeline' => [ 'name' => 'GetMediaCapturePipeline', 'http' => [ 'method' => 'GET', 'requestUri' => '/media-capture-pipelines/{mediaPipelineId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetMediaCapturePipelineRequest', ], 'output' => [ 'shape' => 'GetMediaCapturePipelineResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetMediaCapturePipeline in the Amazon Chime SDK Media Pipelines Namespace', ], 'GetMeeting' => [ 'name' => 'GetMeeting', 'http' => [ 'method' => 'GET', 'requestUri' => '/meetings/{meetingId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetMeetingRequest', ], 'output' => [ 'shape' => 'GetMeetingResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetMeeting in the Amazon Chime SDK Meetings Namespace', ], 'GetMessagingSessionEndpoint' => [ 'name' => 'GetMessagingSessionEndpoint', 'http' => [ 'method' => 'GET', 'requestUri' => '/endpoints/messaging-session', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetMessagingSessionEndpointRequest', ], 'output' => [ 'shape' => 'GetMessagingSessionEndpointResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetMessagingSessionEndpoint in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'GetPhoneNumber' => [ 'name' => 'GetPhoneNumber', 'http' => [ 'method' => 'GET', 'requestUri' => '/phone-numbers/{phoneNumberId}', ], 'input' => [ 'shape' => 'GetPhoneNumberRequest', ], 'output' => [ 'shape' => 'GetPhoneNumberResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetPhoneNumberOrder' => [ 'name' => 'GetPhoneNumberOrder', 'http' => [ 'method' => 'GET', 'requestUri' => '/phone-number-orders/{phoneNumberOrderId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetPhoneNumberOrderRequest', ], 'output' => [ 'shape' => 'GetPhoneNumberOrderResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetPhoneNumberSettings' => [ 'name' => 'GetPhoneNumberSettings', 'http' => [ 'method' => 'GET', 'requestUri' => '/settings/phone-number', 'responseCode' => 200, ], 'output' => [ 'shape' => 'GetPhoneNumberSettingsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetProxySession' => [ 'name' => 'GetProxySession', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/proxy-sessions/{proxySessionId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetProxySessionRequest', ], 'output' => [ 'shape' => 'GetProxySessionResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetProxySession in the Amazon Chime SDK Voice Namespace', ], 'GetRetentionSettings' => [ 'name' => 'GetRetentionSettings', 'http' => [ 'method' => 'GET', 'requestUri' => '/accounts/{accountId}/retention-settings', ], 'input' => [ 'shape' => 'GetRetentionSettingsRequest', ], 'output' => [ 'shape' => 'GetRetentionSettingsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetRoom' => [ 'name' => 'GetRoom', 'http' => [ 'method' => 'GET', 'requestUri' => '/accounts/{accountId}/rooms/{roomId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetRoomRequest', ], 'output' => [ 'shape' => 'GetRoomResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetSipMediaApplication' => [ 'name' => 'GetSipMediaApplication', 'http' => [ 'method' => 'GET', 'requestUri' => '/sip-media-applications/{sipMediaApplicationId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetSipMediaApplicationRequest', ], 'output' => [ 'shape' => 'GetSipMediaApplicationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetSipMediaApplication in the Amazon Chime SDK Voice Namespace', ], 'GetSipMediaApplicationLoggingConfiguration' => [ 'name' => 'GetSipMediaApplicationLoggingConfiguration', 'http' => [ 'method' => 'GET', 'requestUri' => '/sip-media-applications/{sipMediaApplicationId}/logging-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetSipMediaApplicationLoggingConfigurationRequest', ], 'output' => [ 'shape' => 'GetSipMediaApplicationLoggingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetSipMediaApplicationLoggingConfiguration in the Amazon Chime SDK Voice Namespace', ], 'GetSipRule' => [ 'name' => 'GetSipRule', 'http' => [ 'method' => 'GET', 'requestUri' => '/sip-rules/{sipRuleId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetSipRuleRequest', ], 'output' => [ 'shape' => 'GetSipRuleResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetSipRule in the Amazon Chime SDK Voice Namespace', ], 'GetUser' => [ 'name' => 'GetUser', 'http' => [ 'method' => 'GET', 'requestUri' => '/accounts/{accountId}/users/{userId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetUserRequest', ], 'output' => [ 'shape' => 'GetUserResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetUserSettings' => [ 'name' => 'GetUserSettings', 'http' => [ 'method' => 'GET', 'requestUri' => '/accounts/{accountId}/users/{userId}/settings', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetUserSettingsRequest', ], 'output' => [ 'shape' => 'GetUserSettingsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetVoiceConnector' => [ 'name' => 'GetVoiceConnector', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetVoiceConnector in the Amazon Chime SDK Voice Namespace', ], 'GetVoiceConnectorEmergencyCallingConfiguration' => [ 'name' => 'GetVoiceConnectorEmergencyCallingConfiguration', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/emergency-calling-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorEmergencyCallingConfigurationRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorEmergencyCallingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetVoiceConnectorEmergencyCallingConfiguration in the Amazon Chime SDK Voice Namespace', ], 'GetVoiceConnectorGroup' => [ 'name' => 'GetVoiceConnectorGroup', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connector-groups/{voiceConnectorGroupId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorGroupRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorGroupResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetVoiceConnectorGroup in the Amazon Chime SDK Voice Namespace', ], 'GetVoiceConnectorLoggingConfiguration' => [ 'name' => 'GetVoiceConnectorLoggingConfiguration', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/logging-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorLoggingConfigurationRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorLoggingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetVoiceConnectorLoggingConfiguration in the Amazon Chime SDK Voice Namespace', ], 'GetVoiceConnectorOrigination' => [ 'name' => 'GetVoiceConnectorOrigination', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/origination', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorOriginationRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorOriginationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetVoiceConnectorOrigination in the Amazon Chime SDK Voice Namespace', ], 'GetVoiceConnectorProxy' => [ 'name' => 'GetVoiceConnectorProxy', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/programmable-numbers/proxy', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorProxyRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorProxyResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetVoiceConnectorProxy in the Amazon Chime SDK Voice Namespace', ], 'GetVoiceConnectorStreamingConfiguration' => [ 'name' => 'GetVoiceConnectorStreamingConfiguration', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/streaming-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorStreamingConfigurationRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorStreamingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetVoiceConnectorStreamingConfiguration in the Amazon Chime SDK Voice Namespace', ], 'GetVoiceConnectorTermination' => [ 'name' => 'GetVoiceConnectorTermination', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/termination', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorTerminationRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorTerminationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetVoiceConnectorTermination in the Amazon Chime SDK Voice Namespace', ], 'GetVoiceConnectorTerminationHealth' => [ 'name' => 'GetVoiceConnectorTerminationHealth', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/termination/health', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorTerminationHealthRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorTerminationHealthResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by GetVoiceConnectorTerminationHealth in the Amazon Chime SDK Voice Namespace', ], 'InviteUsers' => [ 'name' => 'InviteUsers', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/users?operation=add', 'responseCode' => 201, ], 'input' => [ 'shape' => 'InviteUsersRequest', ], 'output' => [ 'shape' => 'InviteUsersResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListAccounts' => [ 'name' => 'ListAccounts', 'http' => [ 'method' => 'GET', 'requestUri' => '/accounts', ], 'input' => [ 'shape' => 'ListAccountsRequest', ], 'output' => [ 'shape' => 'ListAccountsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListAppInstanceAdmins' => [ 'name' => 'ListAppInstanceAdmins', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instances/{appInstanceArn}/admins', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAppInstanceAdminsRequest', ], 'output' => [ 'shape' => 'ListAppInstanceAdminsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListAppInstanceAdmins in the Amazon Chime SDK Identity Namespace', 'endpoint' => [ 'hostPrefix' => 'identity-', ], ], 'ListAppInstanceUsers' => [ 'name' => 'ListAppInstanceUsers', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instance-users', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAppInstanceUsersRequest', ], 'output' => [ 'shape' => 'ListAppInstanceUsersResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListAppInstanceUsers in the Amazon Chime SDK Identity Namespace', 'endpoint' => [ 'hostPrefix' => 'identity-', ], ], 'ListAppInstances' => [ 'name' => 'ListAppInstances', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instances', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAppInstancesRequest', ], 'output' => [ 'shape' => 'ListAppInstancesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListAppInstances in the Amazon Chime SDK Identity Namespace', 'endpoint' => [ 'hostPrefix' => 'identity-', ], ], 'ListAttendeeTags' => [ 'name' => 'ListAttendeeTags', 'http' => [ 'method' => 'GET', 'requestUri' => '/meetings/{meetingId}/attendees/{attendeeId}/tags', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAttendeeTagsRequest', ], 'output' => [ 'shape' => 'ListAttendeeTagsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Attendee Tags are not supported in the Amazon Chime SDK Meetings Namespace. Update your application to remove calls to this API.', ], 'ListAttendees' => [ 'name' => 'ListAttendees', 'http' => [ 'method' => 'GET', 'requestUri' => '/meetings/{meetingId}/attendees', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAttendeesRequest', ], 'output' => [ 'shape' => 'ListAttendeesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListAttendees in the Amazon Chime SDK Meetings Namespace', ], 'ListBots' => [ 'name' => 'ListBots', 'http' => [ 'method' => 'GET', 'requestUri' => '/accounts/{accountId}/bots', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListBotsRequest', ], 'output' => [ 'shape' => 'ListBotsResponse', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ThrottledClientException', ], ], ], 'ListChannelBans' => [ 'name' => 'ListChannelBans', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/bans', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListChannelBansRequest', ], 'output' => [ 'shape' => 'ListChannelBansResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListChannelBans in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'ListChannelMemberships' => [ 'name' => 'ListChannelMemberships', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/memberships', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListChannelMembershipsRequest', ], 'output' => [ 'shape' => 'ListChannelMembershipsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListChannelMemberships in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'ListChannelMembershipsForAppInstanceUser' => [ 'name' => 'ListChannelMembershipsForAppInstanceUser', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels?scope=app-instance-user-memberships', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListChannelMembershipsForAppInstanceUserRequest', ], 'output' => [ 'shape' => 'ListChannelMembershipsForAppInstanceUserResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListChannelMembershipsForAppInstanceUser in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'ListChannelMessages' => [ 'name' => 'ListChannelMessages', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/messages', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListChannelMessagesRequest', ], 'output' => [ 'shape' => 'ListChannelMessagesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListChannelMessages in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'ListChannelModerators' => [ 'name' => 'ListChannelModerators', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/moderators', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListChannelModeratorsRequest', ], 'output' => [ 'shape' => 'ListChannelModeratorsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListChannelModerators in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'ListChannels' => [ 'name' => 'ListChannels', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListChannelsRequest', ], 'output' => [ 'shape' => 'ListChannelsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListChannels in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'ListChannelsModeratedByAppInstanceUser' => [ 'name' => 'ListChannelsModeratedByAppInstanceUser', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels?scope=app-instance-user-moderated-channels', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListChannelsModeratedByAppInstanceUserRequest', ], 'output' => [ 'shape' => 'ListChannelsModeratedByAppInstanceUserResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListChannelsModeratedByAppInstanceUser in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'ListMediaCapturePipelines' => [ 'name' => 'ListMediaCapturePipelines', 'http' => [ 'method' => 'GET', 'requestUri' => '/media-capture-pipelines', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListMediaCapturePipelinesRequest', ], 'output' => [ 'shape' => 'ListMediaCapturePipelinesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListMediaCapturePipelines in the Amazon Chime SDK Media Pipelines Namespace', ], 'ListMeetingTags' => [ 'name' => 'ListMeetingTags', 'http' => [ 'method' => 'GET', 'requestUri' => '/meetings/{meetingId}/tags', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListMeetingTagsRequest', ], 'output' => [ 'shape' => 'ListMeetingTagsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Use ListTagsForResource in the Amazon Chime SDK Meetings Namespace.', ], 'ListMeetings' => [ 'name' => 'ListMeetings', 'http' => [ 'method' => 'GET', 'requestUri' => '/meetings', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListMeetingsRequest', ], 'output' => [ 'shape' => 'ListMeetingsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'ListMeetings is not supported in the Amazon Chime SDK Meetings Namespace. Update your application to remove calls to this API.', ], 'ListPhoneNumberOrders' => [ 'name' => 'ListPhoneNumberOrders', 'http' => [ 'method' => 'GET', 'requestUri' => '/phone-number-orders', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListPhoneNumberOrdersRequest', ], 'output' => [ 'shape' => 'ListPhoneNumberOrdersResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListPhoneNumbers' => [ 'name' => 'ListPhoneNumbers', 'http' => [ 'method' => 'GET', 'requestUri' => '/phone-numbers', ], 'input' => [ 'shape' => 'ListPhoneNumbersRequest', ], 'output' => [ 'shape' => 'ListPhoneNumbersResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListProxySessions' => [ 'name' => 'ListProxySessions', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/proxy-sessions', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListProxySessionsRequest', ], 'output' => [ 'shape' => 'ListProxySessionsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListProxySessions in the Amazon Chime SDK Voice Namespace', ], 'ListRoomMemberships' => [ 'name' => 'ListRoomMemberships', 'http' => [ 'method' => 'GET', 'requestUri' => '/accounts/{accountId}/rooms/{roomId}/memberships', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListRoomMembershipsRequest', ], 'output' => [ 'shape' => 'ListRoomMembershipsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListRooms' => [ 'name' => 'ListRooms', 'http' => [ 'method' => 'GET', 'requestUri' => '/accounts/{accountId}/rooms', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListRoomsRequest', ], 'output' => [ 'shape' => 'ListRoomsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListSipMediaApplications' => [ 'name' => 'ListSipMediaApplications', 'http' => [ 'method' => 'GET', 'requestUri' => '/sip-media-applications', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListSipMediaApplicationsRequest', ], 'output' => [ 'shape' => 'ListSipMediaApplicationsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListSipMediaApplications in the Amazon Chime SDK Voice Namespace', ], 'ListSipRules' => [ 'name' => 'ListSipRules', 'http' => [ 'method' => 'GET', 'requestUri' => '/sip-rules', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListSipRulesRequest', ], 'output' => [ 'shape' => 'ListSipRulesResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListSipRules in the Amazon Chime SDK Voice Namespace', ], 'ListSupportedPhoneNumberCountries' => [ 'name' => 'ListSupportedPhoneNumberCountries', 'http' => [ 'method' => 'GET', 'requestUri' => '/phone-number-countries', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListSupportedPhoneNumberCountriesRequest', ], 'output' => [ 'shape' => 'ListSupportedPhoneNumberCountriesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags', ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListTagsForResource in the Amazon Chime SDK Voice, Amazon Chime SDK Meetings, Amazon Chime SDK Identity, Amazon Chime SDK Messaging, and Amazon Chime SDK Media Pipelines Namespaces', ], 'ListUsers' => [ 'name' => 'ListUsers', 'http' => [ 'method' => 'GET', 'requestUri' => '/accounts/{accountId}/users', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListUsersRequest', ], 'output' => [ 'shape' => 'ListUsersResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListVoiceConnectorGroups' => [ 'name' => 'ListVoiceConnectorGroups', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connector-groups', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListVoiceConnectorGroupsRequest', ], 'output' => [ 'shape' => 'ListVoiceConnectorGroupsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListVoiceConnectorGroups in the Amazon Chime SDK Voice Namespace', ], 'ListVoiceConnectorTerminationCredentials' => [ 'name' => 'ListVoiceConnectorTerminationCredentials', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/termination/credentials', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListVoiceConnectorTerminationCredentialsRequest', ], 'output' => [ 'shape' => 'ListVoiceConnectorTerminationCredentialsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListVoiceConnectorTerminationCredentials in the Amazon Chime SDK Voice Namespace', ], 'ListVoiceConnectors' => [ 'name' => 'ListVoiceConnectors', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListVoiceConnectorsRequest', ], 'output' => [ 'shape' => 'ListVoiceConnectorsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ListVoiceConnectors in the Amazon Chime SDK Voice Namespace', ], 'LogoutUser' => [ 'name' => 'LogoutUser', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/users/{userId}?operation=logout', 'responseCode' => 204, ], 'input' => [ 'shape' => 'LogoutUserRequest', ], 'output' => [ 'shape' => 'LogoutUserResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'PutAppInstanceRetentionSettings' => [ 'name' => 'PutAppInstanceRetentionSettings', 'http' => [ 'method' => 'PUT', 'requestUri' => '/app-instances/{appInstanceArn}/retention-settings', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutAppInstanceRetentionSettingsRequest', ], 'output' => [ 'shape' => 'PutAppInstanceRetentionSettingsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by PutAppInstanceRetentionSettings in the Amazon Chime SDK Identity Namespace', 'endpoint' => [ 'hostPrefix' => 'identity-', ], ], 'PutAppInstanceStreamingConfigurations' => [ 'name' => 'PutAppInstanceStreamingConfigurations', 'http' => [ 'method' => 'PUT', 'requestUri' => '/app-instances/{appInstanceArn}/streaming-configurations', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutAppInstanceStreamingConfigurationsRequest', ], 'output' => [ 'shape' => 'PutAppInstanceStreamingConfigurationsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by PutAppInstanceStreamingConfigurations in the Amazon Chime SDK Messaging Namespace', ], 'PutEventsConfiguration' => [ 'name' => 'PutEventsConfiguration', 'http' => [ 'method' => 'PUT', 'requestUri' => '/accounts/{accountId}/bots/{botId}/events-configuration', 'responseCode' => 201, ], 'input' => [ 'shape' => 'PutEventsConfigurationRequest', ], 'output' => [ 'shape' => 'PutEventsConfigurationResponse', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'NotFoundException', ], ], ], 'PutRetentionSettings' => [ 'name' => 'PutRetentionSettings', 'http' => [ 'method' => 'PUT', 'requestUri' => '/accounts/{accountId}/retention-settings', 'responseCode' => 204, ], 'input' => [ 'shape' => 'PutRetentionSettingsRequest', ], 'output' => [ 'shape' => 'PutRetentionSettingsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'PutSipMediaApplicationLoggingConfiguration' => [ 'name' => 'PutSipMediaApplicationLoggingConfiguration', 'http' => [ 'method' => 'PUT', 'requestUri' => '/sip-media-applications/{sipMediaApplicationId}/logging-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutSipMediaApplicationLoggingConfigurationRequest', ], 'output' => [ 'shape' => 'PutSipMediaApplicationLoggingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by PutSipMediaApplicationLoggingConfiguration in the Amazon Chime SDK Voice Namespace', ], 'PutVoiceConnectorEmergencyCallingConfiguration' => [ 'name' => 'PutVoiceConnectorEmergencyCallingConfiguration', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-connectors/{voiceConnectorId}/emergency-calling-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutVoiceConnectorEmergencyCallingConfigurationRequest', ], 'output' => [ 'shape' => 'PutVoiceConnectorEmergencyCallingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by PutVoiceConnectorEmergencyCallingConfiguration in the Amazon Chime SDK Voice Namespace', ], 'PutVoiceConnectorLoggingConfiguration' => [ 'name' => 'PutVoiceConnectorLoggingConfiguration', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-connectors/{voiceConnectorId}/logging-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutVoiceConnectorLoggingConfigurationRequest', ], 'output' => [ 'shape' => 'PutVoiceConnectorLoggingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by PutVoiceConnectorLoggingConfiguration in the Amazon Chime SDK Voice Namespace', ], 'PutVoiceConnectorOrigination' => [ 'name' => 'PutVoiceConnectorOrigination', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-connectors/{voiceConnectorId}/origination', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutVoiceConnectorOriginationRequest', ], 'output' => [ 'shape' => 'PutVoiceConnectorOriginationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by PutVoiceConnectorOrigination in the Amazon Chime SDK Voice Namespace', ], 'PutVoiceConnectorProxy' => [ 'name' => 'PutVoiceConnectorProxy', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-connectors/{voiceConnectorId}/programmable-numbers/proxy', ], 'input' => [ 'shape' => 'PutVoiceConnectorProxyRequest', ], 'output' => [ 'shape' => 'PutVoiceConnectorProxyResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by PutVoiceConnectorProxy in the Amazon Chime SDK Voice Namespace', ], 'PutVoiceConnectorStreamingConfiguration' => [ 'name' => 'PutVoiceConnectorStreamingConfiguration', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-connectors/{voiceConnectorId}/streaming-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutVoiceConnectorStreamingConfigurationRequest', ], 'output' => [ 'shape' => 'PutVoiceConnectorStreamingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by PutVoiceConnectorStreamingConfiguration in the Amazon Chime SDK Voice Namespace', ], 'PutVoiceConnectorTermination' => [ 'name' => 'PutVoiceConnectorTermination', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-connectors/{voiceConnectorId}/termination', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutVoiceConnectorTerminationRequest', ], 'output' => [ 'shape' => 'PutVoiceConnectorTerminationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by PutVoiceConnectorTermination in the Amazon Chime SDK Voice Namespace', ], 'PutVoiceConnectorTerminationCredentials' => [ 'name' => 'PutVoiceConnectorTerminationCredentials', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors/{voiceConnectorId}/termination/credentials?operation=put', 'responseCode' => 204, ], 'input' => [ 'shape' => 'PutVoiceConnectorTerminationCredentialsRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by PutVoiceConnectorTerminationCredentials in the Amazon Chime SDK Voice Namespace', ], 'RedactChannelMessage' => [ 'name' => 'RedactChannelMessage', 'http' => [ 'method' => 'POST', 'requestUri' => '/channels/{channelArn}/messages/{messageId}?operation=redact', 'responseCode' => 200, ], 'input' => [ 'shape' => 'RedactChannelMessageRequest', ], 'output' => [ 'shape' => 'RedactChannelMessageResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by RedactChannelMessage in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'RedactConversationMessage' => [ 'name' => 'RedactConversationMessage', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/conversations/{conversationId}/messages/{messageId}?operation=redact', 'responseCode' => 200, ], 'input' => [ 'shape' => 'RedactConversationMessageRequest', ], 'output' => [ 'shape' => 'RedactConversationMessageResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'RedactRoomMessage' => [ 'name' => 'RedactRoomMessage', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/rooms/{roomId}/messages/{messageId}?operation=redact', 'responseCode' => 200, ], 'input' => [ 'shape' => 'RedactRoomMessageRequest', ], 'output' => [ 'shape' => 'RedactRoomMessageResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'RegenerateSecurityToken' => [ 'name' => 'RegenerateSecurityToken', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/bots/{botId}?operation=regenerate-security-token', 'responseCode' => 200, ], 'input' => [ 'shape' => 'RegenerateSecurityTokenRequest', ], 'output' => [ 'shape' => 'RegenerateSecurityTokenResponse', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ThrottledClientException', ], ], ], 'ResetPersonalPIN' => [ 'name' => 'ResetPersonalPIN', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/users/{userId}?operation=reset-personal-pin', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ResetPersonalPINRequest', ], 'output' => [ 'shape' => 'ResetPersonalPINResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'RestorePhoneNumber' => [ 'name' => 'RestorePhoneNumber', 'http' => [ 'method' => 'POST', 'requestUri' => '/phone-numbers/{phoneNumberId}?operation=restore', 'responseCode' => 200, ], 'input' => [ 'shape' => 'RestorePhoneNumberRequest', ], 'output' => [ 'shape' => 'RestorePhoneNumberResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'SearchAvailablePhoneNumbers' => [ 'name' => 'SearchAvailablePhoneNumbers', 'http' => [ 'method' => 'GET', 'requestUri' => '/search?type=phone-numbers', ], 'input' => [ 'shape' => 'SearchAvailablePhoneNumbersRequest', ], 'output' => [ 'shape' => 'SearchAvailablePhoneNumbersResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'SendChannelMessage' => [ 'name' => 'SendChannelMessage', 'http' => [ 'method' => 'POST', 'requestUri' => '/channels/{channelArn}/messages', 'responseCode' => 201, ], 'input' => [ 'shape' => 'SendChannelMessageRequest', ], 'output' => [ 'shape' => 'SendChannelMessageResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by SendChannelMessage in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'StartMeetingTranscription' => [ 'name' => 'StartMeetingTranscription', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings/{meetingId}/transcription?operation=start', 'responseCode' => 200, ], 'input' => [ 'shape' => 'StartMeetingTranscriptionRequest', ], 'output' => [ 'shape' => 'StartMeetingTranscriptionResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'UnprocessableEntityException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by StartMeetingTranscription in the Amazon Chime SDK Meetings Namespace', ], 'StopMeetingTranscription' => [ 'name' => 'StopMeetingTranscription', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings/{meetingId}/transcription?operation=stop', 'responseCode' => 200, ], 'input' => [ 'shape' => 'StopMeetingTranscriptionRequest', ], 'output' => [ 'shape' => 'StopMeetingTranscriptionResponse', ], 'errors' => [ [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'UnprocessableEntityException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by StopMeetingTranscription in the Amazon Chime SDK Meetings Namespace', ], 'TagAttendee' => [ 'name' => 'TagAttendee', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings/{meetingId}/attendees/{attendeeId}/tags?operation=add', 'responseCode' => 204, ], 'input' => [ 'shape' => 'TagAttendeeRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Attendee Tags are not supported in the Amazon Chime SDK Meetings Namespace. Update your application to remove calls to this API.', ], 'TagMeeting' => [ 'name' => 'TagMeeting', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings/{meetingId}/tags?operation=add', 'responseCode' => 204, ], 'input' => [ 'shape' => 'TagMeetingRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Use TagResource in the Amazon Chime SDK Meetings Namespace.', ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags?operation=tag-resource', 'responseCode' => 204, ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by TagResource in the Amazon Chime SDK Voice, Amazon Chime SDK Meetings, Amazon Chime SDK Identity, Amazon Chime SDK Messaging, and Amazon Chime SDK Media Pipelines Namespaces', ], 'UntagAttendee' => [ 'name' => 'UntagAttendee', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings/{meetingId}/attendees/{attendeeId}/tags?operation=delete', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UntagAttendeeRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Attendee Tags are not supported in the Amazon Chime SDK Meetings Namespace. Update your application to remove calls to this API.', ], 'UntagMeeting' => [ 'name' => 'UntagMeeting', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings/{meetingId}/tags?operation=delete', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UntagMeetingRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Use UntagResource in the Amazon Chime SDK Meetings Namespace.', ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags?operation=untag-resource', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by UntagResource in the Amazon Chime SDK Voice, Amazon Chime SDK Meetings, Amazon Chime SDK Identity, Amazon Chime SDK Messaging, and Amazon Chime SDK Media Pipelines Namespaces', ], 'UpdateAccount' => [ 'name' => 'UpdateAccount', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateAccountRequest', ], 'output' => [ 'shape' => 'UpdateAccountResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateAccountSettings' => [ 'name' => 'UpdateAccountSettings', 'http' => [ 'method' => 'PUT', 'requestUri' => '/accounts/{accountId}/settings', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UpdateAccountSettingsRequest', ], 'output' => [ 'shape' => 'UpdateAccountSettingsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateAppInstance' => [ 'name' => 'UpdateAppInstance', 'http' => [ 'method' => 'PUT', 'requestUri' => '/app-instances/{appInstanceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateAppInstanceRequest', ], 'output' => [ 'shape' => 'UpdateAppInstanceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by UpdateAppInstance in the Amazon Chime SDK Identity Namespace', 'endpoint' => [ 'hostPrefix' => 'identity-', ], ], 'UpdateAppInstanceUser' => [ 'name' => 'UpdateAppInstanceUser', 'http' => [ 'method' => 'PUT', 'requestUri' => '/app-instance-users/{appInstanceUserArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateAppInstanceUserRequest', ], 'output' => [ 'shape' => 'UpdateAppInstanceUserResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by UpdateAppInstanceUser in the Amazon Chime SDK Identity Namespace', 'endpoint' => [ 'hostPrefix' => 'identity-', ], ], 'UpdateBot' => [ 'name' => 'UpdateBot', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/bots/{botId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateBotRequest', ], 'output' => [ 'shape' => 'UpdateBotResponse', ], 'errors' => [ [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ThrottledClientException', ], ], ], 'UpdateChannel' => [ 'name' => 'UpdateChannel', 'http' => [ 'method' => 'PUT', 'requestUri' => '/channels/{channelArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateChannelRequest', ], 'output' => [ 'shape' => 'UpdateChannelResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by UpdateChannel in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'UpdateChannelMessage' => [ 'name' => 'UpdateChannelMessage', 'http' => [ 'method' => 'PUT', 'requestUri' => '/channels/{channelArn}/messages/{messageId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateChannelMessageRequest', ], 'output' => [ 'shape' => 'UpdateChannelMessageResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by UpdateChannelMessage in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'UpdateChannelReadMarker' => [ 'name' => 'UpdateChannelReadMarker', 'http' => [ 'method' => 'PUT', 'requestUri' => '/channels/{channelArn}/readMarker', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateChannelReadMarkerRequest', ], 'output' => [ 'shape' => 'UpdateChannelReadMarkerResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by UpdateChannelReadMarker in the Amazon Chime SDK Messaging Namespace', 'endpoint' => [ 'hostPrefix' => 'messaging-', ], ], 'UpdateGlobalSettings' => [ 'name' => 'UpdateGlobalSettings', 'http' => [ 'method' => 'PUT', 'requestUri' => '/settings', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UpdateGlobalSettingsRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdatePhoneNumber' => [ 'name' => 'UpdatePhoneNumber', 'http' => [ 'method' => 'POST', 'requestUri' => '/phone-numbers/{phoneNumberId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdatePhoneNumberRequest', ], 'output' => [ 'shape' => 'UpdatePhoneNumberResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdatePhoneNumberSettings' => [ 'name' => 'UpdatePhoneNumberSettings', 'http' => [ 'method' => 'PUT', 'requestUri' => '/settings/phone-number', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UpdatePhoneNumberSettingsRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateProxySession' => [ 'name' => 'UpdateProxySession', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors/{voiceConnectorId}/proxy-sessions/{proxySessionId}', 'responseCode' => 201, ], 'input' => [ 'shape' => 'UpdateProxySessionRequest', ], 'output' => [ 'shape' => 'UpdateProxySessionResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by UpdateProxySession in the Amazon Chime SDK Voice Namespace', ], 'UpdateRoom' => [ 'name' => 'UpdateRoom', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/rooms/{roomId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateRoomRequest', ], 'output' => [ 'shape' => 'UpdateRoomResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateRoomMembership' => [ 'name' => 'UpdateRoomMembership', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/rooms/{roomId}/memberships/{memberId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateRoomMembershipRequest', ], 'output' => [ 'shape' => 'UpdateRoomMembershipResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateSipMediaApplication' => [ 'name' => 'UpdateSipMediaApplication', 'http' => [ 'method' => 'PUT', 'requestUri' => '/sip-media-applications/{sipMediaApplicationId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateSipMediaApplicationRequest', ], 'output' => [ 'shape' => 'UpdateSipMediaApplicationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by UpdateSipMediaApplication in the Amazon Chime SDK Voice Namespace', ], 'UpdateSipMediaApplicationCall' => [ 'name' => 'UpdateSipMediaApplicationCall', 'http' => [ 'method' => 'POST', 'requestUri' => '/sip-media-applications/{sipMediaApplicationId}/calls/{transactionId}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'UpdateSipMediaApplicationCallRequest', ], 'output' => [ 'shape' => 'UpdateSipMediaApplicationCallResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by UpdateSipMediaApplicationCall in the Amazon Chime SDK Voice Namespace', ], 'UpdateSipRule' => [ 'name' => 'UpdateSipRule', 'http' => [ 'method' => 'PUT', 'requestUri' => '/sip-rules/{sipRuleId}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'UpdateSipRuleRequest', ], 'output' => [ 'shape' => 'UpdateSipRuleResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by UpdateSipRule in the Amazon Chime SDK Voice Namespace', ], 'UpdateUser' => [ 'name' => 'UpdateUser', 'http' => [ 'method' => 'POST', 'requestUri' => '/accounts/{accountId}/users/{userId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateUserRequest', ], 'output' => [ 'shape' => 'UpdateUserResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateUserSettings' => [ 'name' => 'UpdateUserSettings', 'http' => [ 'method' => 'PUT', 'requestUri' => '/accounts/{accountId}/users/{userId}/settings', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UpdateUserSettingsRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateVoiceConnector' => [ 'name' => 'UpdateVoiceConnector', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-connectors/{voiceConnectorId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateVoiceConnectorRequest', ], 'output' => [ 'shape' => 'UpdateVoiceConnectorResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by UpdateVoiceConnector in the Amazon Chime SDK Voice Namespace', ], 'UpdateVoiceConnectorGroup' => [ 'name' => 'UpdateVoiceConnectorGroup', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-connector-groups/{voiceConnectorGroupId}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'UpdateVoiceConnectorGroupRequest', ], 'output' => [ 'shape' => 'UpdateVoiceConnectorGroupResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by UpdateVoiceConnectorGroup in the Amazon Chime SDK Voice Namespace', ], 'ValidateE911Address' => [ 'name' => 'ValidateE911Address', 'http' => [ 'method' => 'POST', 'requestUri' => '/emergency-calling/address', 'responseCode' => 202, ], 'input' => [ 'shape' => 'ValidateE911AddressRequest', ], 'output' => [ 'shape' => 'ValidateE911AddressResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], 'deprecated' => true, 'deprecatedMessage' => 'Replaced by ValidateE911Address in the Amazon Chime SDK Voice Namespace', ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 403, ], 'exception' => true, ], 'Account' => [ 'type' => 'structure', 'required' => [ 'AwsAccountId', 'AccountId', 'Name', ], 'members' => [ 'AwsAccountId' => [ 'shape' => 'String', ], 'AccountId' => [ 'shape' => 'String', ], 'Name' => [ 'shape' => 'String', ], 'AccountType' => [ 'shape' => 'AccountType', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'DefaultLicense' => [ 'shape' => 'License', ], 'SupportedLicenses' => [ 'shape' => 'LicenseList', ], 'AccountStatus' => [ 'shape' => 'AccountStatus', ], 'SigninDelegateGroups' => [ 'shape' => 'SigninDelegateGroupList', ], ], ], 'AccountList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Account', ], ], 'AccountName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '.*\\\\S.*', ], 'AccountSettings' => [ 'type' => 'structure', 'members' => [ 'DisableRemoteControl' => [ 'shape' => 'Boolean', ], 'EnableDialOut' => [ 'shape' => 'Boolean', ], ], ], 'AccountStatus' => [ 'type' => 'string', 'enum' => [ 'Suspended', 'Active', ], ], 'AccountType' => [ 'type' => 'string', 'enum' => [ 'Team', 'EnterpriseDirectory', 'EnterpriseLWA', 'EnterpriseOIDC', ], ], 'Address' => [ 'type' => 'structure', 'members' => [ 'streetName' => [ 'shape' => 'SensitiveNonEmptyString', ], 'streetSuffix' => [ 'shape' => 'SensitiveNonEmptyString', ], 'postDirectional' => [ 'shape' => 'SensitiveNonEmptyString', ], 'preDirectional' => [ 'shape' => 'SensitiveNonEmptyString', ], 'streetNumber' => [ 'shape' => 'SensitiveNonEmptyString', ], 'city' => [ 'shape' => 'SensitiveNonEmptyString', ], 'state' => [ 'shape' => 'SensitiveNonEmptyString', ], 'postalCode' => [ 'shape' => 'SensitiveNonEmptyString', ], 'postalCodePlus4' => [ 'shape' => 'SensitiveNonEmptyString', ], 'country' => [ 'shape' => 'SensitiveNonEmptyString', ], ], ], 'AlexaForBusinessMetadata' => [ 'type' => 'structure', 'members' => [ 'IsAlexaForBusinessEnabled' => [ 'shape' => 'Boolean', ], 'AlexaForBusinessRoomArn' => [ 'shape' => 'SensitiveString', ], ], ], 'Alpha2CountryCode' => [ 'type' => 'string', 'pattern' => '[A-Z]{2}', ], 'AppInstance' => [ 'type' => 'structure', 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'AppInstanceAdmin' => [ 'type' => 'structure', 'members' => [ 'Admin' => [ 'shape' => 'Identity', ], 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'AppInstanceAdminList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AppInstanceAdminSummary', ], ], 'AppInstanceAdminSummary' => [ 'type' => 'structure', 'members' => [ 'Admin' => [ 'shape' => 'Identity', ], ], ], 'AppInstanceDataType' => [ 'type' => 'string', 'enum' => [ 'Channel', 'ChannelMessage', ], ], 'AppInstanceList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AppInstanceSummary', ], ], 'AppInstanceRetentionSettings' => [ 'type' => 'structure', 'members' => [ 'ChannelRetentionSettings' => [ 'shape' => 'ChannelRetentionSettings', ], ], ], 'AppInstanceStreamingConfiguration' => [ 'type' => 'structure', 'required' => [ 'AppInstanceDataType', 'ResourceArn', ], 'members' => [ 'AppInstanceDataType' => [ 'shape' => 'AppInstanceDataType', ], 'ResourceArn' => [ 'shape' => 'Arn', ], ], ], 'AppInstanceStreamingConfigurationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AppInstanceStreamingConfiguration', ], 'max' => 2, 'min' => 1, ], 'AppInstanceSummary' => [ 'type' => 'structure', 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'Metadata' => [ 'shape' => 'Metadata', ], ], ], 'AppInstanceUser' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'UserName', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'AppInstanceUserList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AppInstanceUserSummary', ], ], 'AppInstanceUserMembershipSummary' => [ 'type' => 'structure', 'members' => [ 'Type' => [ 'shape' => 'ChannelMembershipType', ], 'ReadMarkerTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'AppInstanceUserSummary' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'UserName', ], 'Metadata' => [ 'shape' => 'Metadata', ], ], ], 'AreaCode' => [ 'type' => 'string', 'pattern' => '^$|^[0-9]{3,3}$', ], 'Arn' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, 'pattern' => '^arn[\\\\/\\\\:\\\\-\\\\_\\\\.a-zA-Z0-9]+$', 'sensitive' => true, ], 'ArtifactsConfiguration' => [ 'type' => 'structure', 'required' => [ 'Audio', 'Video', 'Content', ], 'members' => [ 'Audio' => [ 'shape' => 'AudioArtifactsConfiguration', ], 'Video' => [ 'shape' => 'VideoArtifactsConfiguration', ], 'Content' => [ 'shape' => 'ContentArtifactsConfiguration', ], ], ], 'ArtifactsState' => [ 'type' => 'string', 'enum' => [ 'Enabled', 'Disabled', ], ], 'AssociatePhoneNumberWithUserRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'UserId', 'E164PhoneNumber', ], 'members' => [ 'AccountId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'accountId', ], 'UserId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'userId', ], 'E164PhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], ], ], 'AssociatePhoneNumberWithUserResponse' => [ 'type' => 'structure', 'members' => [], ], 'AssociatePhoneNumbersWithVoiceConnectorGroupRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorGroupId', 'E164PhoneNumbers', ], 'members' => [ 'VoiceConnectorGroupId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorGroupId', ], 'E164PhoneNumbers' => [ 'shape' => 'E164PhoneNumberList', ], 'ForceAssociate' => [ 'shape' => 'NullableBoolean', ], ], ], 'AssociatePhoneNumbersWithVoiceConnectorGroupResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberErrors' => [ 'shape' => 'PhoneNumberErrorList', ], ], ], 'AssociatePhoneNumbersWithVoiceConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'E164PhoneNumbers', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'E164PhoneNumbers' => [ 'shape' => 'E164PhoneNumberList', ], 'ForceAssociate' => [ 'shape' => 'NullableBoolean', ], ], ], 'AssociatePhoneNumbersWithVoiceConnectorResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberErrors' => [ 'shape' => 'PhoneNumberErrorList', ], ], ], 'AssociateSigninDelegateGroupsWithAccountRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'SigninDelegateGroups', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'SigninDelegateGroups' => [ 'shape' => 'SigninDelegateGroupList', ], ], ], 'AssociateSigninDelegateGroupsWithAccountResponse' => [ 'type' => 'structure', 'members' => [], ], 'Attendee' => [ 'type' => 'structure', 'members' => [ 'ExternalUserId' => [ 'shape' => 'ExternalUserIdType', ], 'AttendeeId' => [ 'shape' => 'GuidString', ], 'JoinToken' => [ 'shape' => 'JoinTokenString', ], ], ], 'AttendeeIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'GuidString', ], 'min' => 1, ], 'AttendeeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Attendee', ], ], 'AttendeeTagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 10, 'min' => 1, ], 'AttendeeTagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], 'max' => 10, 'min' => 1, ], 'AudioArtifactsConfiguration' => [ 'type' => 'structure', 'required' => [ 'MuxType', ], 'members' => [ 'MuxType' => [ 'shape' => 'AudioMuxType', ], ], ], 'AudioMuxType' => [ 'type' => 'string', 'enum' => [ 'AudioOnly', 'AudioWithActiveSpeakerVideo', ], ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'BatchChannelMemberships' => [ 'type' => 'structure', 'members' => [ 'InvitedBy' => [ 'shape' => 'Identity', ], 'Type' => [ 'shape' => 'ChannelMembershipType', ], 'Members' => [ 'shape' => 'Members', ], 'ChannelArn' => [ 'shape' => 'ChimeArn', ], ], ], 'BatchCreateAttendeeErrorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CreateAttendeeError', ], ], 'BatchCreateAttendeeRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'Attendees', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'meetingId', ], 'Attendees' => [ 'shape' => 'CreateAttendeeRequestItemList', ], ], ], 'BatchCreateAttendeeResponse' => [ 'type' => 'structure', 'members' => [ 'Attendees' => [ 'shape' => 'AttendeeList', ], 'Errors' => [ 'shape' => 'BatchCreateAttendeeErrorList', ], ], ], 'BatchCreateChannelMembershipError' => [ 'type' => 'structure', 'members' => [ 'MemberArn' => [ 'shape' => 'ChimeArn', ], 'ErrorCode' => [ 'shape' => 'ErrorCode', ], 'ErrorMessage' => [ 'shape' => 'String', ], ], ], 'BatchCreateChannelMembershipErrors' => [ 'type' => 'list', 'member' => [ 'shape' => 'BatchCreateChannelMembershipError', ], ], 'BatchCreateChannelMembershipRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MemberArns', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'Type' => [ 'shape' => 'ChannelMembershipType', ], 'MemberArns' => [ 'shape' => 'MemberArns', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'BatchCreateChannelMembershipResponse' => [ 'type' => 'structure', 'members' => [ 'BatchChannelMemberships' => [ 'shape' => 'BatchChannelMemberships', ], 'Errors' => [ 'shape' => 'BatchCreateChannelMembershipErrors', ], ], ], 'BatchCreateRoomMembershipRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'RoomId', 'MembershipItemList', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'RoomId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'roomId', ], 'MembershipItemList' => [ 'shape' => 'MembershipItemList', ], ], ], 'BatchCreateRoomMembershipResponse' => [ 'type' => 'structure', 'members' => [ 'Errors' => [ 'shape' => 'MemberErrorList', ], ], ], 'BatchDeletePhoneNumberRequest' => [ 'type' => 'structure', 'required' => [ 'PhoneNumberIds', ], 'members' => [ 'PhoneNumberIds' => [ 'shape' => 'NonEmptyStringList', ], ], ], 'BatchDeletePhoneNumberResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberErrors' => [ 'shape' => 'PhoneNumberErrorList', ], ], ], 'BatchSuspendUserRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'UserIdList', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'UserIdList' => [ 'shape' => 'UserIdList', ], ], ], 'BatchSuspendUserResponse' => [ 'type' => 'structure', 'members' => [ 'UserErrors' => [ 'shape' => 'UserErrorList', ], ], ], 'BatchUnsuspendUserRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'UserIdList', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'UserIdList' => [ 'shape' => 'UserIdList', ], ], ], 'BatchUnsuspendUserResponse' => [ 'type' => 'structure', 'members' => [ 'UserErrors' => [ 'shape' => 'UserErrorList', ], ], ], 'BatchUpdatePhoneNumberRequest' => [ 'type' => 'structure', 'required' => [ 'UpdatePhoneNumberRequestItems', ], 'members' => [ 'UpdatePhoneNumberRequestItems' => [ 'shape' => 'UpdatePhoneNumberRequestItemList', ], ], ], 'BatchUpdatePhoneNumberResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberErrors' => [ 'shape' => 'PhoneNumberErrorList', ], ], ], 'BatchUpdateUserRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'UpdateUserRequestItems', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'UpdateUserRequestItems' => [ 'shape' => 'UpdateUserRequestItemList', ], ], ], 'BatchUpdateUserResponse' => [ 'type' => 'structure', 'members' => [ 'UserErrors' => [ 'shape' => 'UserErrorList', ], ], ], 'Boolean' => [ 'type' => 'boolean', ], 'Bot' => [ 'type' => 'structure', 'members' => [ 'BotId' => [ 'shape' => 'String', ], 'UserId' => [ 'shape' => 'String', ], 'DisplayName' => [ 'shape' => 'SensitiveString', ], 'BotType' => [ 'shape' => 'BotType', ], 'Disabled' => [ 'shape' => 'NullableBoolean', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'BotEmail' => [ 'shape' => 'SensitiveString', ], 'SecurityToken' => [ 'shape' => 'SensitiveString', ], ], ], 'BotList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Bot', ], ], 'BotType' => [ 'type' => 'string', 'enum' => [ 'ChatBot', ], ], 'BusinessCallingSettings' => [ 'type' => 'structure', 'members' => [ 'CdrBucket' => [ 'shape' => 'String', 'box' => true, ], ], ], 'CallingName' => [ 'type' => 'string', 'pattern' => '^$|^[a-zA-Z0-9 ]{2,15}$', 'sensitive' => true, ], 'CallingNameStatus' => [ 'type' => 'string', 'enum' => [ 'Unassigned', 'UpdateInProgress', 'UpdateSucceeded', 'UpdateFailed', ], ], 'CallingRegion' => [ 'type' => 'string', ], 'CallingRegionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CallingRegion', ], ], 'CandidateAddress' => [ 'type' => 'structure', 'members' => [ 'streetInfo' => [ 'shape' => 'SensitiveNonEmptyString', ], 'streetNumber' => [ 'shape' => 'SensitiveNonEmptyString', ], 'city' => [ 'shape' => 'SensitiveNonEmptyString', ], 'state' => [ 'shape' => 'SensitiveNonEmptyString', ], 'postalCode' => [ 'shape' => 'SensitiveNonEmptyString', ], 'postalCodePlus4' => [ 'shape' => 'SensitiveNonEmptyString', ], 'country' => [ 'shape' => 'SensitiveNonEmptyString', ], ], ], 'CandidateAddressList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CandidateAddress', ], ], 'Capability' => [ 'type' => 'string', 'enum' => [ 'Voice', 'SMS', ], ], 'CapabilityList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Capability', ], ], 'Channel' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'Mode' => [ 'shape' => 'ChannelMode', ], 'Privacy' => [ 'shape' => 'ChannelPrivacy', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'CreatedBy' => [ 'shape' => 'Identity', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastMessageTimestamp' => [ 'shape' => 'Timestamp', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'ChannelBan' => [ 'type' => 'structure', 'members' => [ 'Member' => [ 'shape' => 'Identity', ], 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'CreatedBy' => [ 'shape' => 'Identity', ], ], ], 'ChannelBanSummary' => [ 'type' => 'structure', 'members' => [ 'Member' => [ 'shape' => 'Identity', ], ], ], 'ChannelBanSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelBanSummary', ], ], 'ChannelMembership' => [ 'type' => 'structure', 'members' => [ 'InvitedBy' => [ 'shape' => 'Identity', ], 'Type' => [ 'shape' => 'ChannelMembershipType', ], 'Member' => [ 'shape' => 'Identity', ], 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'ChannelMembershipForAppInstanceUserSummary' => [ 'type' => 'structure', 'members' => [ 'ChannelSummary' => [ 'shape' => 'ChannelSummary', ], 'AppInstanceUserMembershipSummary' => [ 'shape' => 'AppInstanceUserMembershipSummary', ], ], ], 'ChannelMembershipForAppInstanceUserSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelMembershipForAppInstanceUserSummary', ], ], 'ChannelMembershipSummary' => [ 'type' => 'structure', 'members' => [ 'Member' => [ 'shape' => 'Identity', ], ], ], 'ChannelMembershipSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelMembershipSummary', ], ], 'ChannelMembershipType' => [ 'type' => 'string', 'enum' => [ 'DEFAULT', 'HIDDEN', ], ], 'ChannelMessage' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'MessageId' => [ 'shape' => 'MessageId', ], 'Content' => [ 'shape' => 'Content', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'Type' => [ 'shape' => 'ChannelMessageType', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastEditedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], 'Sender' => [ 'shape' => 'Identity', ], 'Redacted' => [ 'shape' => 'NonNullableBoolean', ], 'Persistence' => [ 'shape' => 'ChannelMessagePersistenceType', ], ], ], 'ChannelMessagePersistenceType' => [ 'type' => 'string', 'enum' => [ 'PERSISTENT', 'NON_PERSISTENT', ], ], 'ChannelMessageSummary' => [ 'type' => 'structure', 'members' => [ 'MessageId' => [ 'shape' => 'MessageId', ], 'Content' => [ 'shape' => 'Content', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'Type' => [ 'shape' => 'ChannelMessageType', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastEditedTimestamp' => [ 'shape' => 'Timestamp', ], 'Sender' => [ 'shape' => 'Identity', ], 'Redacted' => [ 'shape' => 'NonNullableBoolean', ], ], ], 'ChannelMessageSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelMessageSummary', ], ], 'ChannelMessageType' => [ 'type' => 'string', 'enum' => [ 'STANDARD', 'CONTROL', ], ], 'ChannelMode' => [ 'type' => 'string', 'enum' => [ 'UNRESTRICTED', 'RESTRICTED', ], ], 'ChannelModeratedByAppInstanceUserSummary' => [ 'type' => 'structure', 'members' => [ 'ChannelSummary' => [ 'shape' => 'ChannelSummary', ], ], ], 'ChannelModeratedByAppInstanceUserSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelModeratedByAppInstanceUserSummary', ], ], 'ChannelModerator' => [ 'type' => 'structure', 'members' => [ 'Moderator' => [ 'shape' => 'Identity', ], 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'CreatedBy' => [ 'shape' => 'Identity', ], ], ], 'ChannelModeratorSummary' => [ 'type' => 'structure', 'members' => [ 'Moderator' => [ 'shape' => 'Identity', ], ], ], 'ChannelModeratorSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelModeratorSummary', ], ], 'ChannelPrivacy' => [ 'type' => 'string', 'enum' => [ 'PUBLIC', 'PRIVATE', ], ], 'ChannelRetentionSettings' => [ 'type' => 'structure', 'members' => [ 'RetentionDays' => [ 'shape' => 'RetentionDays', ], ], ], 'ChannelSummary' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'Mode' => [ 'shape' => 'ChannelMode', ], 'Privacy' => [ 'shape' => 'ChannelPrivacy', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'LastMessageTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'ChannelSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelSummary', ], ], 'ChimeArn' => [ 'type' => 'string', 'max' => 1600, 'min' => 5, 'pattern' => 'arn:[a-z0-9-\\\\.]{1,63}:[a-z0-9-\\\\.]{0,63}:[a-z0-9-\\\\.]{0,63}:[a-z0-9-\\\\.]{0,63}:[^/].{0,1023}', ], 'ChimeSdkMeetingConfiguration' => [ 'type' => 'structure', 'members' => [ 'SourceConfiguration' => [ 'shape' => 'SourceConfiguration', ], 'ArtifactsConfiguration' => [ 'shape' => 'ArtifactsConfiguration', ], ], ], 'ClientRequestToken' => [ 'type' => 'string', 'max' => 64, 'min' => 2, 'pattern' => '[-_a-zA-Z0-9]*', 'sensitive' => true, ], 'ConflictException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'Content' => [ 'type' => 'string', 'max' => 4096, 'min' => 0, 'pattern' => '[\\\\s\\\\S]*', 'sensitive' => true, ], 'ContentArtifactsConfiguration' => [ 'type' => 'structure', 'required' => [ 'State', ], 'members' => [ 'State' => [ 'shape' => 'ArtifactsState', ], 'MuxType' => [ 'shape' => 'ContentMuxType', ], ], ], 'ContentMuxType' => [ 'type' => 'string', 'enum' => [ 'ContentOnly', ], ], 'ConversationRetentionSettings' => [ 'type' => 'structure', 'members' => [ 'RetentionDays' => [ 'shape' => 'RetentionDays', ], ], ], 'Country' => [ 'type' => 'string', 'pattern' => '^$|^[A-Z]{2,2}$', ], 'CountryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Country', ], 'max' => 100, 'min' => 1, ], 'CpsLimit' => [ 'type' => 'integer', 'min' => 1, ], 'CreateAccountRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'AccountName', ], ], ], 'CreateAccountResponse' => [ 'type' => 'structure', 'members' => [ 'Account' => [ 'shape' => 'Account', ], ], ], 'CreateAppInstanceAdminRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceAdminArn', 'AppInstanceArn', ], 'members' => [ 'AppInstanceAdminArn' => [ 'shape' => 'ChimeArn', ], 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], ], ], 'CreateAppInstanceAdminResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceAdmin' => [ 'shape' => 'Identity', ], 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], ], ], 'CreateAppInstanceRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'ClientRequestToken', ], 'members' => [ 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateAppInstanceResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], ], ], 'CreateAppInstanceUserRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', 'AppInstanceUserId', 'Name', 'ClientRequestToken', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'AppInstanceUserId' => [ 'shape' => 'UserId', ], 'Name' => [ 'shape' => 'UserName', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateAppInstanceUserResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', ], ], ], 'CreateAttendeeError' => [ 'type' => 'structure', 'members' => [ 'ExternalUserId' => [ 'shape' => 'ExternalUserIdType', ], 'ErrorCode' => [ 'shape' => 'String', ], 'ErrorMessage' => [ 'shape' => 'String', ], ], ], 'CreateAttendeeRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'ExternalUserId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'meetingId', ], 'ExternalUserId' => [ 'shape' => 'ExternalUserIdType', ], 'Tags' => [ 'shape' => 'AttendeeTagList', ], ], ], 'CreateAttendeeRequestItem' => [ 'type' => 'structure', 'required' => [ 'ExternalUserId', ], 'members' => [ 'ExternalUserId' => [ 'shape' => 'ExternalUserIdType', ], 'Tags' => [ 'shape' => 'AttendeeTagList', ], ], ], 'CreateAttendeeRequestItemList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CreateAttendeeRequestItem', ], ], 'CreateAttendeeResponse' => [ 'type' => 'structure', 'members' => [ 'Attendee' => [ 'shape' => 'Attendee', ], ], ], 'CreateBotRequest' => [ 'type' => 'structure', 'required' => [ 'DisplayName', 'AccountId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'DisplayName' => [ 'shape' => 'SensitiveString', ], 'Domain' => [ 'shape' => 'NonEmptyString', ], ], ], 'CreateBotResponse' => [ 'type' => 'structure', 'members' => [ 'Bot' => [ 'shape' => 'Bot', ], ], ], 'CreateChannelBanRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MemberArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MemberArn' => [ 'shape' => 'ChimeArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'CreateChannelBanResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'Member' => [ 'shape' => 'Identity', ], ], ], 'CreateChannelMembershipRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MemberArn', 'Type', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MemberArn' => [ 'shape' => 'ChimeArn', ], 'Type' => [ 'shape' => 'ChannelMembershipType', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'CreateChannelMembershipResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'Member' => [ 'shape' => 'Identity', ], ], ], 'CreateChannelModeratorRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChannelModeratorArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'ChannelModeratorArn' => [ 'shape' => 'ChimeArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'CreateChannelModeratorResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'ChannelModerator' => [ 'shape' => 'Identity', ], ], ], 'CreateChannelRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', 'Name', 'ClientRequestToken', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'Mode' => [ 'shape' => 'ChannelMode', ], 'Privacy' => [ 'shape' => 'ChannelPrivacy', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'CreateChannelResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], ], ], 'CreateMediaCapturePipelineRequest' => [ 'type' => 'structure', 'required' => [ 'SourceType', 'SourceArn', 'SinkType', 'SinkArn', ], 'members' => [ 'SourceType' => [ 'shape' => 'MediaPipelineSourceType', ], 'SourceArn' => [ 'shape' => 'Arn', ], 'SinkType' => [ 'shape' => 'MediaPipelineSinkType', ], 'SinkArn' => [ 'shape' => 'Arn', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'ChimeSdkMeetingConfiguration' => [ 'shape' => 'ChimeSdkMeetingConfiguration', ], ], ], 'CreateMediaCapturePipelineResponse' => [ 'type' => 'structure', 'members' => [ 'MediaCapturePipeline' => [ 'shape' => 'MediaCapturePipeline', ], ], ], 'CreateMeetingDialOutRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'FromPhoneNumber', 'ToPhoneNumber', 'JoinToken', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'meetingId', ], 'FromPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'ToPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'JoinToken' => [ 'shape' => 'JoinTokenString', ], ], ], 'CreateMeetingDialOutResponse' => [ 'type' => 'structure', 'members' => [ 'TransactionId' => [ 'shape' => 'GuidString', ], ], ], 'CreateMeetingRequest' => [ 'type' => 'structure', 'required' => [ 'ClientRequestToken', ], 'members' => [ 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'ExternalMeetingId' => [ 'shape' => 'ExternalMeetingIdType', ], 'MeetingHostId' => [ 'shape' => 'ExternalUserIdType', ], 'MediaRegion' => [ 'shape' => 'String', ], 'Tags' => [ 'shape' => 'MeetingTagList', ], 'NotificationsConfiguration' => [ 'shape' => 'MeetingNotificationConfiguration', ], ], ], 'CreateMeetingResponse' => [ 'type' => 'structure', 'members' => [ 'Meeting' => [ 'shape' => 'Meeting', ], ], ], 'CreateMeetingWithAttendeesRequest' => [ 'type' => 'structure', 'required' => [ 'ClientRequestToken', ], 'members' => [ 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'ExternalMeetingId' => [ 'shape' => 'ExternalMeetingIdType', ], 'MeetingHostId' => [ 'shape' => 'ExternalUserIdType', ], 'MediaRegion' => [ 'shape' => 'String', ], 'Tags' => [ 'shape' => 'MeetingTagList', ], 'NotificationsConfiguration' => [ 'shape' => 'MeetingNotificationConfiguration', ], 'Attendees' => [ 'shape' => 'CreateMeetingWithAttendeesRequestItemList', ], ], ], 'CreateMeetingWithAttendeesRequestItemList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CreateAttendeeRequestItem', ], 'max' => 10, 'min' => 1, ], 'CreateMeetingWithAttendeesResponse' => [ 'type' => 'structure', 'members' => [ 'Meeting' => [ 'shape' => 'Meeting', ], 'Attendees' => [ 'shape' => 'AttendeeList', ], 'Errors' => [ 'shape' => 'BatchCreateAttendeeErrorList', ], ], ], 'CreatePhoneNumberOrderRequest' => [ 'type' => 'structure', 'required' => [ 'ProductType', 'E164PhoneNumbers', ], 'members' => [ 'ProductType' => [ 'shape' => 'PhoneNumberProductType', ], 'E164PhoneNumbers' => [ 'shape' => 'E164PhoneNumberList', ], ], ], 'CreatePhoneNumberOrderResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberOrder' => [ 'shape' => 'PhoneNumberOrder', ], ], ], 'CreateProxySessionRequest' => [ 'type' => 'structure', 'required' => [ 'ParticipantPhoneNumbers', 'Capabilities', 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'ParticipantPhoneNumbers' => [ 'shape' => 'ParticipantPhoneNumberList', ], 'Name' => [ 'shape' => 'ProxySessionNameString', ], 'ExpiryMinutes' => [ 'shape' => 'PositiveInteger', ], 'Capabilities' => [ 'shape' => 'CapabilityList', ], 'NumberSelectionBehavior' => [ 'shape' => 'NumberSelectionBehavior', ], 'GeoMatchLevel' => [ 'shape' => 'GeoMatchLevel', ], 'GeoMatchParams' => [ 'shape' => 'GeoMatchParams', ], ], ], 'CreateProxySessionResponse' => [ 'type' => 'structure', 'members' => [ 'ProxySession' => [ 'shape' => 'ProxySession', ], ], ], 'CreateRoomMembershipRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'RoomId', 'MemberId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'RoomId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'roomId', ], 'MemberId' => [ 'shape' => 'NonEmptyString', ], 'Role' => [ 'shape' => 'RoomMembershipRole', ], ], ], 'CreateRoomMembershipResponse' => [ 'type' => 'structure', 'members' => [ 'RoomMembership' => [ 'shape' => 'RoomMembership', ], ], ], 'CreateRoomRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'Name', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'Name' => [ 'shape' => 'SensitiveString', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], ], ], 'CreateRoomResponse' => [ 'type' => 'structure', 'members' => [ 'Room' => [ 'shape' => 'Room', ], ], ], 'CreateSipMediaApplicationCallRequest' => [ 'type' => 'structure', 'required' => [ 'FromPhoneNumber', 'ToPhoneNumber', 'SipMediaApplicationId', ], 'members' => [ 'FromPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'ToPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipMediaApplicationId', ], 'SipHeaders' => [ 'shape' => 'SipHeadersMap', ], ], ], 'CreateSipMediaApplicationCallResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplicationCall' => [ 'shape' => 'SipMediaApplicationCall', ], ], ], 'CreateSipMediaApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'AwsRegion', 'Name', 'Endpoints', ], 'members' => [ 'AwsRegion' => [ 'shape' => 'String', ], 'Name' => [ 'shape' => 'SipMediaApplicationName', ], 'Endpoints' => [ 'shape' => 'SipMediaApplicationEndpointList', ], ], ], 'CreateSipMediaApplicationResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplication' => [ 'shape' => 'SipMediaApplication', ], ], ], 'CreateSipRuleRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'TriggerType', 'TriggerValue', 'TargetApplications', ], 'members' => [ 'Name' => [ 'shape' => 'SipRuleName', ], 'TriggerType' => [ 'shape' => 'SipRuleTriggerType', ], 'TriggerValue' => [ 'shape' => 'NonEmptyString', ], 'Disabled' => [ 'shape' => 'NullableBoolean', ], 'TargetApplications' => [ 'shape' => 'SipRuleTargetApplicationList', ], ], ], 'CreateSipRuleResponse' => [ 'type' => 'structure', 'members' => [ 'SipRule' => [ 'shape' => 'SipRule', ], ], ], 'CreateUserRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'Username' => [ 'shape' => 'String', ], 'Email' => [ 'shape' => 'EmailAddress', ], 'UserType' => [ 'shape' => 'UserType', ], ], ], 'CreateUserResponse' => [ 'type' => 'structure', 'members' => [ 'User' => [ 'shape' => 'User', ], ], ], 'CreateVoiceConnectorGroupRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'VoiceConnectorGroupName', ], 'VoiceConnectorItems' => [ 'shape' => 'VoiceConnectorItemList', ], ], ], 'CreateVoiceConnectorGroupResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectorGroup' => [ 'shape' => 'VoiceConnectorGroup', ], ], ], 'CreateVoiceConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'RequireEncryption', ], 'members' => [ 'Name' => [ 'shape' => 'VoiceConnectorName', ], 'AwsRegion' => [ 'shape' => 'VoiceConnectorAwsRegion', ], 'RequireEncryption' => [ 'shape' => 'Boolean', ], ], ], 'CreateVoiceConnectorResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnector' => [ 'shape' => 'VoiceConnector', ], ], ], 'Credential' => [ 'type' => 'structure', 'members' => [ 'Username' => [ 'shape' => 'SensitiveString', ], 'Password' => [ 'shape' => 'SensitiveString', ], ], ], 'CredentialList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Credential', ], ], 'DNISEmergencyCallingConfiguration' => [ 'type' => 'structure', 'required' => [ 'EmergencyPhoneNumber', 'CallingCountry', ], 'members' => [ 'EmergencyPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'TestPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'CallingCountry' => [ 'shape' => 'Alpha2CountryCode', ], ], ], 'DNISEmergencyCallingConfigurationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DNISEmergencyCallingConfiguration', ], ], 'DataRetentionInHours' => [ 'type' => 'integer', 'min' => 0, ], 'DeleteAccountRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], ], ], 'DeleteAccountResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteAppInstanceAdminRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceAdminArn', 'AppInstanceArn', ], 'members' => [ 'AppInstanceAdminArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceAdminArn', ], 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], ], ], 'DeleteAppInstanceRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], ], ], 'DeleteAppInstanceStreamingConfigurationsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], ], ], 'DeleteAppInstanceUserRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceUserArn', ], 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceUserArn', ], ], ], 'DeleteAttendeeRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'AttendeeId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'meetingId', ], 'AttendeeId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'attendeeId', ], ], ], 'DeleteChannelBanRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MemberArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MemberArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'memberArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DeleteChannelMembershipRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MemberArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MemberArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'memberArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DeleteChannelMessageRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MessageId', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MessageId' => [ 'shape' => 'MessageId', 'location' => 'uri', 'locationName' => 'messageId', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DeleteChannelModeratorRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChannelModeratorArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'ChannelModeratorArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelModeratorArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DeleteChannelRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DeleteEventsConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BotId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'BotId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'botId', ], ], ], 'DeleteMediaCapturePipelineRequest' => [ 'type' => 'structure', 'required' => [ 'MediaPipelineId', ], 'members' => [ 'MediaPipelineId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'mediaPipelineId', ], ], ], 'DeleteMeetingRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'meetingId', ], ], ], 'DeletePhoneNumberRequest' => [ 'type' => 'structure', 'required' => [ 'PhoneNumberId', ], 'members' => [ 'PhoneNumberId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'phoneNumberId', ], ], ], 'DeleteProxySessionRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'ProxySessionId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'ProxySessionId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'proxySessionId', ], ], ], 'DeleteRoomMembershipRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'RoomId', 'MemberId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'RoomId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'roomId', ], 'MemberId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'memberId', ], ], ], 'DeleteRoomRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'RoomId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'RoomId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'roomId', ], ], ], 'DeleteSipMediaApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'SipMediaApplicationId', ], 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipMediaApplicationId', ], ], ], 'DeleteSipRuleRequest' => [ 'type' => 'structure', 'required' => [ 'SipRuleId', ], 'members' => [ 'SipRuleId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipRuleId', ], ], ], 'DeleteVoiceConnectorEmergencyCallingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'DeleteVoiceConnectorGroupRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorGroupId', ], 'members' => [ 'VoiceConnectorGroupId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorGroupId', ], ], ], 'DeleteVoiceConnectorOriginationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'DeleteVoiceConnectorProxyRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'DeleteVoiceConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'DeleteVoiceConnectorStreamingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'DeleteVoiceConnectorTerminationCredentialsRequest' => [ 'type' => 'structure', 'required' => [ 'Usernames', 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'Usernames' => [ 'shape' => 'SensitiveStringList', ], ], ], 'DeleteVoiceConnectorTerminationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'DescribeAppInstanceAdminRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceAdminArn', 'AppInstanceArn', ], 'members' => [ 'AppInstanceAdminArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceAdminArn', ], 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], ], ], 'DescribeAppInstanceAdminResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceAdmin' => [ 'shape' => 'AppInstanceAdmin', ], ], ], 'DescribeAppInstanceRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], ], ], 'DescribeAppInstanceResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstance' => [ 'shape' => 'AppInstance', ], ], ], 'DescribeAppInstanceUserRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceUserArn', ], 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceUserArn', ], ], ], 'DescribeAppInstanceUserResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUser' => [ 'shape' => 'AppInstanceUser', ], ], ], 'DescribeChannelBanRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MemberArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MemberArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'memberArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DescribeChannelBanResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelBan' => [ 'shape' => 'ChannelBan', ], ], ], 'DescribeChannelMembershipForAppInstanceUserRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'AppInstanceUserArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'app-instance-user-arn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DescribeChannelMembershipForAppInstanceUserResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelMembership' => [ 'shape' => 'ChannelMembershipForAppInstanceUserSummary', ], ], ], 'DescribeChannelMembershipRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MemberArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MemberArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'memberArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DescribeChannelMembershipResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelMembership' => [ 'shape' => 'ChannelMembership', ], ], ], 'DescribeChannelModeratedByAppInstanceUserRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'AppInstanceUserArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'app-instance-user-arn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DescribeChannelModeratedByAppInstanceUserResponse' => [ 'type' => 'structure', 'members' => [ 'Channel' => [ 'shape' => 'ChannelModeratedByAppInstanceUserSummary', ], ], ], 'DescribeChannelModeratorRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChannelModeratorArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'ChannelModeratorArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelModeratorArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DescribeChannelModeratorResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelModerator' => [ 'shape' => 'ChannelModerator', ], ], ], 'DescribeChannelRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DescribeChannelResponse' => [ 'type' => 'structure', 'members' => [ 'Channel' => [ 'shape' => 'Channel', ], ], ], 'DisassociatePhoneNumberFromUserRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'UserId', ], 'members' => [ 'AccountId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'accountId', ], 'UserId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'userId', ], ], ], 'DisassociatePhoneNumberFromUserResponse' => [ 'type' => 'structure', 'members' => [], ], 'DisassociatePhoneNumbersFromVoiceConnectorGroupRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorGroupId', 'E164PhoneNumbers', ], 'members' => [ 'VoiceConnectorGroupId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorGroupId', ], 'E164PhoneNumbers' => [ 'shape' => 'E164PhoneNumberList', ], ], ], 'DisassociatePhoneNumbersFromVoiceConnectorGroupResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberErrors' => [ 'shape' => 'PhoneNumberErrorList', ], ], ], 'DisassociatePhoneNumbersFromVoiceConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'E164PhoneNumbers', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'E164PhoneNumbers' => [ 'shape' => 'E164PhoneNumberList', ], ], ], 'DisassociatePhoneNumbersFromVoiceConnectorResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberErrors' => [ 'shape' => 'PhoneNumberErrorList', ], ], ], 'DisassociateSigninDelegateGroupsFromAccountRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'GroupNames', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'GroupNames' => [ 'shape' => 'NonEmptyStringList', ], ], ], 'DisassociateSigninDelegateGroupsFromAccountResponse' => [ 'type' => 'structure', 'members' => [], ], 'E164PhoneNumber' => [ 'type' => 'string', 'pattern' => '^\\\\+?[1-9]\\\\d{1,14}$', 'sensitive' => true, ], 'E164PhoneNumberList' => [ 'type' => 'list', 'member' => [ 'shape' => 'E164PhoneNumber', ], ], 'EmailAddress' => [ 'type' => 'string', 'pattern' => '.+@.+\\\\..+', 'sensitive' => true, ], 'EmailStatus' => [ 'type' => 'string', 'enum' => [ 'NotSent', 'Sent', 'Failed', ], ], 'EmergencyCallingConfiguration' => [ 'type' => 'structure', 'members' => [ 'DNIS' => [ 'shape' => 'DNISEmergencyCallingConfigurationList', ], ], ], 'EngineTranscribeMedicalSettings' => [ 'type' => 'structure', 'required' => [ 'LanguageCode', 'Specialty', 'Type', ], 'members' => [ 'LanguageCode' => [ 'shape' => 'TranscribeMedicalLanguageCode', ], 'Specialty' => [ 'shape' => 'TranscribeMedicalSpecialty', ], 'Type' => [ 'shape' => 'TranscribeMedicalType', ], 'VocabularyName' => [ 'shape' => 'String', ], 'Region' => [ 'shape' => 'TranscribeMedicalRegion', ], 'ContentIdentificationType' => [ 'shape' => 'TranscribeMedicalContentIdentificationType', ], ], ], 'EngineTranscribeSettings' => [ 'type' => 'structure', 'members' => [ 'LanguageCode' => [ 'shape' => 'TranscribeLanguageCode', ], 'VocabularyFilterMethod' => [ 'shape' => 'TranscribeVocabularyFilterMethod', ], 'VocabularyFilterName' => [ 'shape' => 'String', ], 'VocabularyName' => [ 'shape' => 'String', ], 'Region' => [ 'shape' => 'TranscribeRegion', ], 'EnablePartialResultsStabilization' => [ 'shape' => 'Boolean', ], 'PartialResultsStability' => [ 'shape' => 'TranscribePartialResultsStability', ], 'ContentIdentificationType' => [ 'shape' => 'TranscribeContentIdentificationType', ], 'ContentRedactionType' => [ 'shape' => 'TranscribeContentRedactionType', ], 'PiiEntityTypes' => [ 'shape' => 'TranscribePiiEntityTypes', ], 'LanguageModelName' => [ 'shape' => 'TranscribeLanguageModelName', ], 'IdentifyLanguage' => [ 'shape' => 'Boolean', ], 'LanguageOptions' => [ 'shape' => 'TranscribeLanguageOptions', ], 'PreferredLanguage' => [ 'shape' => 'TranscribeLanguageCode', ], 'VocabularyNames' => [ 'shape' => 'TranscribeVocabularyNamesOrFilterNamesString', ], 'VocabularyFilterNames' => [ 'shape' => 'TranscribeVocabularyNamesOrFilterNamesString', ], ], ], 'ErrorCode' => [ 'type' => 'string', 'enum' => [ 'BadRequest', 'Conflict', 'Forbidden', 'NotFound', 'PreconditionFailed', 'ResourceLimitExceeded', 'ServiceFailure', 'AccessDenied', 'ServiceUnavailable', 'Throttled', 'Throttling', 'Unauthorized', 'Unprocessable', 'VoiceConnectorGroupAssociationsExist', 'PhoneNumberAssociationsExist', ], ], 'EventsConfiguration' => [ 'type' => 'structure', 'members' => [ 'BotId' => [ 'shape' => 'String', ], 'OutboundEventsHTTPSEndpoint' => [ 'shape' => 'SensitiveString', ], 'LambdaFunctionArn' => [ 'shape' => 'SensitiveString', ], ], ], 'ExternalMeetingIdType' => [ 'type' => 'string', 'max' => 64, 'min' => 2, 'sensitive' => true, ], 'ExternalUserIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ExternalUserIdType', ], 'min' => 1, ], 'ExternalUserIdType' => [ 'type' => 'string', 'max' => 64, 'min' => 2, 'sensitive' => true, ], 'ForbiddenException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 403, ], 'exception' => true, ], 'FunctionArn' => [ 'type' => 'string', 'max' => 10000, 'pattern' => 'arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\\\d{1}:\\\\d{12}:function:[a-zA-Z0-9-_]+(:(\\\\$LATEST|[a-zA-Z0-9-_]+))?', 'sensitive' => true, ], 'GeoMatchLevel' => [ 'type' => 'string', 'enum' => [ 'Country', 'AreaCode', ], ], 'GeoMatchParams' => [ 'type' => 'structure', 'required' => [ 'Country', 'AreaCode', ], 'members' => [ 'Country' => [ 'shape' => 'Country', ], 'AreaCode' => [ 'shape' => 'AreaCode', ], ], ], 'GetAccountRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], ], ], 'GetAccountResponse' => [ 'type' => 'structure', 'members' => [ 'Account' => [ 'shape' => 'Account', ], ], ], 'GetAccountSettingsRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], ], ], 'GetAccountSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'AccountSettings' => [ 'shape' => 'AccountSettings', ], ], ], 'GetAppInstanceRetentionSettingsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], ], ], 'GetAppInstanceRetentionSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceRetentionSettings' => [ 'shape' => 'AppInstanceRetentionSettings', ], 'InitiateDeletionTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'GetAppInstanceStreamingConfigurationsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], ], ], 'GetAppInstanceStreamingConfigurationsResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceStreamingConfigurations' => [ 'shape' => 'AppInstanceStreamingConfigurationList', ], ], ], 'GetAttendeeRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'AttendeeId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'meetingId', ], 'AttendeeId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'attendeeId', ], ], ], 'GetAttendeeResponse' => [ 'type' => 'structure', 'members' => [ 'Attendee' => [ 'shape' => 'Attendee', ], ], ], 'GetBotRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BotId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'BotId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'botId', ], ], ], 'GetBotResponse' => [ 'type' => 'structure', 'members' => [ 'Bot' => [ 'shape' => 'Bot', ], ], ], 'GetChannelMessageRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MessageId', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MessageId' => [ 'shape' => 'MessageId', 'location' => 'uri', 'locationName' => 'messageId', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'GetChannelMessageResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelMessage' => [ 'shape' => 'ChannelMessage', ], ], ], 'GetEventsConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BotId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'BotId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'botId', ], ], ], 'GetEventsConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'EventsConfiguration' => [ 'shape' => 'EventsConfiguration', ], ], ], 'GetGlobalSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'BusinessCalling' => [ 'shape' => 'BusinessCallingSettings', ], 'VoiceConnector' => [ 'shape' => 'VoiceConnectorSettings', ], ], ], 'GetMediaCapturePipelineRequest' => [ 'type' => 'structure', 'required' => [ 'MediaPipelineId', ], 'members' => [ 'MediaPipelineId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'mediaPipelineId', ], ], ], 'GetMediaCapturePipelineResponse' => [ 'type' => 'structure', 'members' => [ 'MediaCapturePipeline' => [ 'shape' => 'MediaCapturePipeline', ], ], ], 'GetMeetingRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'meetingId', ], ], ], 'GetMeetingResponse' => [ 'type' => 'structure', 'members' => [ 'Meeting' => [ 'shape' => 'Meeting', ], ], ], 'GetMessagingSessionEndpointRequest' => [ 'type' => 'structure', 'members' => [], ], 'GetMessagingSessionEndpointResponse' => [ 'type' => 'structure', 'members' => [ 'Endpoint' => [ 'shape' => 'MessagingSessionEndpoint', ], ], ], 'GetPhoneNumberOrderRequest' => [ 'type' => 'structure', 'required' => [ 'PhoneNumberOrderId', ], 'members' => [ 'PhoneNumberOrderId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'phoneNumberOrderId', ], ], ], 'GetPhoneNumberOrderResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberOrder' => [ 'shape' => 'PhoneNumberOrder', ], ], ], 'GetPhoneNumberRequest' => [ 'type' => 'structure', 'required' => [ 'PhoneNumberId', ], 'members' => [ 'PhoneNumberId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'phoneNumberId', ], ], ], 'GetPhoneNumberResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumber' => [ 'shape' => 'PhoneNumber', ], ], ], 'GetPhoneNumberSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'CallingName' => [ 'shape' => 'CallingName', ], 'CallingNameUpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'GetProxySessionRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'ProxySessionId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'ProxySessionId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'proxySessionId', ], ], ], 'GetProxySessionResponse' => [ 'type' => 'structure', 'members' => [ 'ProxySession' => [ 'shape' => 'ProxySession', ], ], ], 'GetRetentionSettingsRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], ], ], 'GetRetentionSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'RetentionSettings' => [ 'shape' => 'RetentionSettings', ], 'InitiateDeletionTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'GetRoomRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'RoomId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'RoomId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'roomId', ], ], ], 'GetRoomResponse' => [ 'type' => 'structure', 'members' => [ 'Room' => [ 'shape' => 'Room', ], ], ], 'GetSipMediaApplicationLoggingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'SipMediaApplicationId', ], 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipMediaApplicationId', ], ], ], 'GetSipMediaApplicationLoggingConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplicationLoggingConfiguration' => [ 'shape' => 'SipMediaApplicationLoggingConfiguration', ], ], ], 'GetSipMediaApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'SipMediaApplicationId', ], 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipMediaApplicationId', ], ], ], 'GetSipMediaApplicationResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplication' => [ 'shape' => 'SipMediaApplication', ], ], ], 'GetSipRuleRequest' => [ 'type' => 'structure', 'required' => [ 'SipRuleId', ], 'members' => [ 'SipRuleId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipRuleId', ], ], ], 'GetSipRuleResponse' => [ 'type' => 'structure', 'members' => [ 'SipRule' => [ 'shape' => 'SipRule', ], ], ], 'GetUserRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'UserId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'UserId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'userId', ], ], ], 'GetUserResponse' => [ 'type' => 'structure', 'members' => [ 'User' => [ 'shape' => 'User', ], ], ], 'GetUserSettingsRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'UserId', ], 'members' => [ 'AccountId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'accountId', ], 'UserId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'userId', ], ], ], 'GetUserSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'UserSettings' => [ 'shape' => 'UserSettings', ], ], ], 'GetVoiceConnectorEmergencyCallingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'GetVoiceConnectorEmergencyCallingConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'EmergencyCallingConfiguration' => [ 'shape' => 'EmergencyCallingConfiguration', ], ], ], 'GetVoiceConnectorGroupRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorGroupId', ], 'members' => [ 'VoiceConnectorGroupId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorGroupId', ], ], ], 'GetVoiceConnectorGroupResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectorGroup' => [ 'shape' => 'VoiceConnectorGroup', ], ], ], 'GetVoiceConnectorLoggingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'GetVoiceConnectorLoggingConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'LoggingConfiguration' => [ 'shape' => 'LoggingConfiguration', ], ], ], 'GetVoiceConnectorOriginationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'GetVoiceConnectorOriginationResponse' => [ 'type' => 'structure', 'members' => [ 'Origination' => [ 'shape' => 'Origination', ], ], ], 'GetVoiceConnectorProxyRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'GetVoiceConnectorProxyResponse' => [ 'type' => 'structure', 'members' => [ 'Proxy' => [ 'shape' => 'Proxy', ], ], ], 'GetVoiceConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'GetVoiceConnectorResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnector' => [ 'shape' => 'VoiceConnector', ], ], ], 'GetVoiceConnectorStreamingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'GetVoiceConnectorStreamingConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'StreamingConfiguration' => [ 'shape' => 'StreamingConfiguration', ], ], ], 'GetVoiceConnectorTerminationHealthRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'GetVoiceConnectorTerminationHealthResponse' => [ 'type' => 'structure', 'members' => [ 'TerminationHealth' => [ 'shape' => 'TerminationHealth', ], ], ], 'GetVoiceConnectorTerminationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'GetVoiceConnectorTerminationResponse' => [ 'type' => 'structure', 'members' => [ 'Termination' => [ 'shape' => 'Termination', ], ], ], 'GuidString' => [ 'type' => 'string', 'pattern' => '[a-fA-F0-9]{8}(?:-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}', ], 'Identity' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'ResourceName', ], ], ], 'Integer' => [ 'type' => 'integer', ], 'Invite' => [ 'type' => 'structure', 'members' => [ 'InviteId' => [ 'shape' => 'String', ], 'Status' => [ 'shape' => 'InviteStatus', ], 'EmailAddress' => [ 'shape' => 'EmailAddress', ], 'EmailStatus' => [ 'shape' => 'EmailStatus', ], ], ], 'InviteList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Invite', ], ], 'InviteStatus' => [ 'type' => 'string', 'enum' => [ 'Pending', 'Accepted', 'Failed', ], ], 'InviteUsersRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'UserEmailList', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'UserEmailList' => [ 'shape' => 'UserEmailList', ], 'UserType' => [ 'shape' => 'UserType', ], ], ], 'InviteUsersResponse' => [ 'type' => 'structure', 'members' => [ 'Invites' => [ 'shape' => 'InviteList', ], ], ], 'Iso8601Timestamp' => [ 'type' => 'timestamp', 'timestampFormat' => 'iso8601', ], 'JoinTokenString' => [ 'type' => 'string', 'max' => 2048, 'min' => 2, 'pattern' => '^[a-zA-Z0-9+/]+$', 'sensitive' => true, ], 'License' => [ 'type' => 'string', 'enum' => [ 'Basic', 'Plus', 'Pro', 'ProTrial', ], ], 'LicenseList' => [ 'type' => 'list', 'member' => [ 'shape' => 'License', ], ], 'ListAccountsRequest' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'AccountName', 'location' => 'querystring', 'locationName' => 'name', ], 'UserEmail' => [ 'shape' => 'EmailAddress', 'location' => 'querystring', 'locationName' => 'user-email', ], 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ProfileServiceMaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListAccountsResponse' => [ 'type' => 'structure', 'members' => [ 'Accounts' => [ 'shape' => 'AccountList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListAppInstanceAdminsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListAppInstanceAdminsResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'AppInstanceAdmins' => [ 'shape' => 'AppInstanceAdminList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListAppInstanceUsersRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'app-instance-arn', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListAppInstanceUsersResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'AppInstanceUsers' => [ 'shape' => 'AppInstanceUserList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListAppInstancesRequest' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListAppInstancesResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstances' => [ 'shape' => 'AppInstanceList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListAttendeeTagsRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'AttendeeId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'meetingId', ], 'AttendeeId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'attendeeId', ], ], ], 'ListAttendeeTagsResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], ], ], 'ListAttendeesRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'meetingId', ], 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListAttendeesResponse' => [ 'type' => 'structure', 'members' => [ 'Attendees' => [ 'shape' => 'AttendeeList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListBotsRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListBotsResponse' => [ 'type' => 'structure', 'members' => [ 'Bots' => [ 'shape' => 'BotList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListChannelBansRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'ListChannelBansResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'ChannelBans' => [ 'shape' => 'ChannelBanSummaryList', ], ], ], 'ListChannelMembershipsForAppInstanceUserRequest' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'app-instance-user-arn', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'ListChannelMembershipsForAppInstanceUserResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelMemberships' => [ 'shape' => 'ChannelMembershipForAppInstanceUserSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListChannelMembershipsRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'Type' => [ 'shape' => 'ChannelMembershipType', 'location' => 'querystring', 'locationName' => 'type', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'ListChannelMembershipsResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'ChannelMemberships' => [ 'shape' => 'ChannelMembershipSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListChannelMessagesRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'SortOrder' => [ 'shape' => 'SortOrder', 'location' => 'querystring', 'locationName' => 'sort-order', ], 'NotBefore' => [ 'shape' => 'Timestamp', 'location' => 'querystring', 'locationName' => 'not-before', ], 'NotAfter' => [ 'shape' => 'Timestamp', 'location' => 'querystring', 'locationName' => 'not-after', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'ListChannelMessagesResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'ChannelMessages' => [ 'shape' => 'ChannelMessageSummaryList', ], ], ], 'ListChannelModeratorsRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'ListChannelModeratorsResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'ChannelModerators' => [ 'shape' => 'ChannelModeratorSummaryList', ], ], ], 'ListChannelsModeratedByAppInstanceUserRequest' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'app-instance-user-arn', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'ListChannelsModeratedByAppInstanceUserResponse' => [ 'type' => 'structure', 'members' => [ 'Channels' => [ 'shape' => 'ChannelModeratedByAppInstanceUserSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListChannelsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'app-instance-arn', ], 'Privacy' => [ 'shape' => 'ChannelPrivacy', 'location' => 'querystring', 'locationName' => 'privacy', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'ListChannelsResponse' => [ 'type' => 'structure', 'members' => [ 'Channels' => [ 'shape' => 'ChannelSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListMediaCapturePipelinesRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListMediaCapturePipelinesResponse' => [ 'type' => 'structure', 'members' => [ 'MediaCapturePipelines' => [ 'shape' => 'MediaCapturePipelineList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListMeetingTagsRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'meetingId', ], ], ], 'ListMeetingTagsResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], ], ], 'ListMeetingsRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListMeetingsResponse' => [ 'type' => 'structure', 'members' => [ 'Meetings' => [ 'shape' => 'MeetingList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListPhoneNumberOrdersRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListPhoneNumberOrdersResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberOrders' => [ 'shape' => 'PhoneNumberOrderList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListPhoneNumbersRequest' => [ 'type' => 'structure', 'members' => [ 'Status' => [ 'shape' => 'PhoneNumberStatus', 'location' => 'querystring', 'locationName' => 'status', ], 'ProductType' => [ 'shape' => 'PhoneNumberProductType', 'location' => 'querystring', 'locationName' => 'product-type', ], 'FilterName' => [ 'shape' => 'PhoneNumberAssociationName', 'location' => 'querystring', 'locationName' => 'filter-name', ], 'FilterValue' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'filter-value', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListPhoneNumbersResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumbers' => [ 'shape' => 'PhoneNumberList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListProxySessionsRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'Status' => [ 'shape' => 'ProxySessionStatus', 'location' => 'querystring', 'locationName' => 'status', ], 'NextToken' => [ 'shape' => 'NextTokenString', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListProxySessionsResponse' => [ 'type' => 'structure', 'members' => [ 'ProxySessions' => [ 'shape' => 'ProxySessions', ], 'NextToken' => [ 'shape' => 'NextTokenString', ], ], ], 'ListRoomMembershipsRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'RoomId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'RoomId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'roomId', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListRoomMembershipsResponse' => [ 'type' => 'structure', 'members' => [ 'RoomMemberships' => [ 'shape' => 'RoomMembershipList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListRoomsRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'MemberId' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'member-id', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListRoomsResponse' => [ 'type' => 'structure', 'members' => [ 'Rooms' => [ 'shape' => 'RoomList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListSipMediaApplicationsRequest' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextTokenString', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListSipMediaApplicationsResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplications' => [ 'shape' => 'SipMediaApplicationList', ], 'NextToken' => [ 'shape' => 'NextTokenString', ], ], ], 'ListSipRulesRequest' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'querystring', 'locationName' => 'sip-media-application', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextTokenString', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListSipRulesResponse' => [ 'type' => 'structure', 'members' => [ 'SipRules' => [ 'shape' => 'SipRuleList', ], 'NextToken' => [ 'shape' => 'NextTokenString', ], ], ], 'ListSupportedPhoneNumberCountriesRequest' => [ 'type' => 'structure', 'required' => [ 'ProductType', ], 'members' => [ 'ProductType' => [ 'shape' => 'PhoneNumberProductType', 'location' => 'querystring', 'locationName' => 'product-type', ], ], ], 'ListSupportedPhoneNumberCountriesResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberCountries' => [ 'shape' => 'PhoneNumberCountriesList', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'Arn', 'location' => 'querystring', 'locationName' => 'arn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], ], ], 'ListUsersRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'UserEmail' => [ 'shape' => 'EmailAddress', 'location' => 'querystring', 'locationName' => 'user-email', ], 'UserType' => [ 'shape' => 'UserType', 'location' => 'querystring', 'locationName' => 'user-type', ], 'MaxResults' => [ 'shape' => 'ProfileServiceMaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListUsersResponse' => [ 'type' => 'structure', 'members' => [ 'Users' => [ 'shape' => 'UserList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListVoiceConnectorGroupsRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListVoiceConnectorGroupsResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectorGroups' => [ 'shape' => 'VoiceConnectorGroupList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListVoiceConnectorTerminationCredentialsRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'ListVoiceConnectorTerminationCredentialsResponse' => [ 'type' => 'structure', 'members' => [ 'Usernames' => [ 'shape' => 'SensitiveStringList', ], ], ], 'ListVoiceConnectorsRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListVoiceConnectorsResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectors' => [ 'shape' => 'VoiceConnectorList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'LoggingConfiguration' => [ 'type' => 'structure', 'members' => [ 'EnableSIPLogs' => [ 'shape' => 'Boolean', ], 'EnableMediaMetricLogs' => [ 'shape' => 'Boolean', ], ], ], 'LogoutUserRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'UserId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'UserId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'userId', ], ], ], 'LogoutUserResponse' => [ 'type' => 'structure', 'members' => [], ], 'MaxResults' => [ 'type' => 'integer', 'max' => 50, 'min' => 1, ], 'MediaCapturePipeline' => [ 'type' => 'structure', 'members' => [ 'MediaPipelineId' => [ 'shape' => 'GuidString', ], 'SourceType' => [ 'shape' => 'MediaPipelineSourceType', ], 'SourceArn' => [ 'shape' => 'Arn', ], 'Status' => [ 'shape' => 'MediaPipelineStatus', ], 'SinkType' => [ 'shape' => 'MediaPipelineSinkType', ], 'SinkArn' => [ 'shape' => 'Arn', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'ChimeSdkMeetingConfiguration' => [ 'shape' => 'ChimeSdkMeetingConfiguration', ], ], ], 'MediaCapturePipelineList' => [ 'type' => 'list', 'member' => [ 'shape' => 'MediaCapturePipeline', ], ], 'MediaPipelineSinkType' => [ 'type' => 'string', 'enum' => [ 'S3Bucket', ], ], 'MediaPipelineSourceType' => [ 'type' => 'string', 'enum' => [ 'ChimeSdkMeeting', ], ], 'MediaPipelineStatus' => [ 'type' => 'string', 'enum' => [ 'Initializing', 'InProgress', 'Failed', 'Stopping', 'Stopped', ], ], 'MediaPlacement' => [ 'type' => 'structure', 'members' => [ 'AudioHostUrl' => [ 'shape' => 'UriType', ], 'AudioFallbackUrl' => [ 'shape' => 'UriType', ], 'ScreenDataUrl' => [ 'shape' => 'UriType', ], 'ScreenSharingUrl' => [ 'shape' => 'UriType', ], 'ScreenViewingUrl' => [ 'shape' => 'UriType', ], 'SignalingUrl' => [ 'shape' => 'UriType', ], 'TurnControlUrl' => [ 'shape' => 'UriType', ], 'EventIngestionUrl' => [ 'shape' => 'UriType', ], ], ], 'Meeting' => [ 'type' => 'structure', 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', ], 'ExternalMeetingId' => [ 'shape' => 'ExternalMeetingIdType', ], 'MediaPlacement' => [ 'shape' => 'MediaPlacement', ], 'MediaRegion' => [ 'shape' => 'String', ], ], ], 'MeetingList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Meeting', ], ], 'MeetingNotificationConfiguration' => [ 'type' => 'structure', 'members' => [ 'SnsTopicArn' => [ 'shape' => 'Arn', ], 'SqsQueueArn' => [ 'shape' => 'Arn', ], ], ], 'MeetingTagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 50, 'min' => 1, ], 'MeetingTagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], 'max' => 50, 'min' => 1, ], 'Member' => [ 'type' => 'structure', 'members' => [ 'MemberId' => [ 'shape' => 'NonEmptyString', ], 'MemberType' => [ 'shape' => 'MemberType', ], 'Email' => [ 'shape' => 'SensitiveString', ], 'FullName' => [ 'shape' => 'SensitiveString', ], 'AccountId' => [ 'shape' => 'NonEmptyString', ], ], ], 'MemberArns' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChimeArn', ], 'max' => 100, 'min' => 1, ], 'MemberError' => [ 'type' => 'structure', 'members' => [ 'MemberId' => [ 'shape' => 'NonEmptyString', ], 'ErrorCode' => [ 'shape' => 'ErrorCode', ], 'ErrorMessage' => [ 'shape' => 'String', ], ], ], 'MemberErrorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'MemberError', ], ], 'MemberType' => [ 'type' => 'string', 'enum' => [ 'User', 'Bot', 'Webhook', ], ], 'Members' => [ 'type' => 'list', 'member' => [ 'shape' => 'Identity', ], ], 'MembershipItem' => [ 'type' => 'structure', 'members' => [ 'MemberId' => [ 'shape' => 'NonEmptyString', ], 'Role' => [ 'shape' => 'RoomMembershipRole', ], ], ], 'MembershipItemList' => [ 'type' => 'list', 'member' => [ 'shape' => 'MembershipItem', ], 'max' => 50, ], 'MessageId' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[-_a-zA-Z0-9]*', ], 'MessagingSessionEndpoint' => [ 'type' => 'structure', 'members' => [ 'Url' => [ 'shape' => 'UrlType', ], ], ], 'Metadata' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'pattern' => '.*', 'sensitive' => true, ], 'NextToken' => [ 'type' => 'string', 'max' => 2048, 'min' => 0, 'pattern' => '.*', 'sensitive' => true, ], 'NextTokenString' => [ 'type' => 'string', 'max' => 65535, ], 'NonEmptyContent' => [ 'type' => 'string', 'min' => 1, 'pattern' => '[\\\\s\\\\S]*', 'sensitive' => true, ], 'NonEmptyResourceName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', 'sensitive' => true, ], 'NonEmptyString' => [ 'type' => 'string', 'pattern' => '.*\\\\S.*', ], 'NonEmptyString128' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '.*\\\\S.*', ], 'NonEmptyStringList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], 'min' => 1, ], 'NonNullableBoolean' => [ 'type' => 'boolean', ], 'NotFoundException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'NotificationTarget' => [ 'type' => 'string', 'enum' => [ 'EventBridge', 'SNS', 'SQS', ], ], 'NullableBoolean' => [ 'type' => 'boolean', ], 'NumberSelectionBehavior' => [ 'type' => 'string', 'enum' => [ 'PreferSticky', 'AvoidSticky', ], ], 'OrderedPhoneNumber' => [ 'type' => 'structure', 'members' => [ 'E164PhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'Status' => [ 'shape' => 'OrderedPhoneNumberStatus', ], ], ], 'OrderedPhoneNumberList' => [ 'type' => 'list', 'member' => [ 'shape' => 'OrderedPhoneNumber', ], ], 'OrderedPhoneNumberStatus' => [ 'type' => 'string', 'enum' => [ 'Processing', 'Acquired', 'Failed', ], ], 'Origination' => [ 'type' => 'structure', 'members' => [ 'Routes' => [ 'shape' => 'OriginationRouteList', ], 'Disabled' => [ 'shape' => 'Boolean', ], ], ], 'OriginationRoute' => [ 'type' => 'structure', 'members' => [ 'Host' => [ 'shape' => 'String', ], 'Port' => [ 'shape' => 'Port', ], 'Protocol' => [ 'shape' => 'OriginationRouteProtocol', ], 'Priority' => [ 'shape' => 'OriginationRoutePriority', ], 'Weight' => [ 'shape' => 'OriginationRouteWeight', ], ], ], 'OriginationRouteList' => [ 'type' => 'list', 'member' => [ 'shape' => 'OriginationRoute', ], ], 'OriginationRoutePriority' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'OriginationRouteProtocol' => [ 'type' => 'string', 'enum' => [ 'TCP', 'UDP', ], ], 'OriginationRouteWeight' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'Participant' => [ 'type' => 'structure', 'members' => [ 'PhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'ProxyPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], ], ], 'ParticipantPhoneNumberList' => [ 'type' => 'list', 'member' => [ 'shape' => 'E164PhoneNumber', ], 'max' => 2, 'min' => 2, ], 'Participants' => [ 'type' => 'list', 'member' => [ 'shape' => 'Participant', ], ], 'PhoneNumber' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberId' => [ 'shape' => 'String', ], 'E164PhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'Country' => [ 'shape' => 'Alpha2CountryCode', ], 'Type' => [ 'shape' => 'PhoneNumberType', ], 'ProductType' => [ 'shape' => 'PhoneNumberProductType', ], 'Status' => [ 'shape' => 'PhoneNumberStatus', ], 'Capabilities' => [ 'shape' => 'PhoneNumberCapabilities', ], 'Associations' => [ 'shape' => 'PhoneNumberAssociationList', ], 'CallingName' => [ 'shape' => 'CallingName', ], 'CallingNameStatus' => [ 'shape' => 'CallingNameStatus', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'DeletionTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'PhoneNumberAssociation' => [ 'type' => 'structure', 'members' => [ 'Value' => [ 'shape' => 'String', ], 'Name' => [ 'shape' => 'PhoneNumberAssociationName', ], 'AssociatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'PhoneNumberAssociationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PhoneNumberAssociation', ], ], 'PhoneNumberAssociationName' => [ 'type' => 'string', 'enum' => [ 'AccountId', 'UserId', 'VoiceConnectorId', 'VoiceConnectorGroupId', 'SipRuleId', ], ], 'PhoneNumberCapabilities' => [ 'type' => 'structure', 'members' => [ 'InboundCall' => [ 'shape' => 'NullableBoolean', ], 'OutboundCall' => [ 'shape' => 'NullableBoolean', ], 'InboundSMS' => [ 'shape' => 'NullableBoolean', ], 'OutboundSMS' => [ 'shape' => 'NullableBoolean', ], 'InboundMMS' => [ 'shape' => 'NullableBoolean', ], 'OutboundMMS' => [ 'shape' => 'NullableBoolean', ], ], ], 'PhoneNumberCountriesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PhoneNumberCountry', ], ], 'PhoneNumberCountry' => [ 'type' => 'structure', 'members' => [ 'CountryCode' => [ 'shape' => 'Alpha2CountryCode', ], 'SupportedPhoneNumberTypes' => [ 'shape' => 'PhoneNumberTypeList', ], ], ], 'PhoneNumberError' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberId' => [ 'shape' => 'NonEmptyString', ], 'ErrorCode' => [ 'shape' => 'ErrorCode', ], 'ErrorMessage' => [ 'shape' => 'String', ], ], ], 'PhoneNumberErrorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PhoneNumberError', ], ], 'PhoneNumberList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PhoneNumber', ], ], 'PhoneNumberMaxResults' => [ 'type' => 'integer', 'max' => 500, 'min' => 1, ], 'PhoneNumberOrder' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberOrderId' => [ 'shape' => 'GuidString', ], 'ProductType' => [ 'shape' => 'PhoneNumberProductType', ], 'Status' => [ 'shape' => 'PhoneNumberOrderStatus', ], 'OrderedPhoneNumbers' => [ 'shape' => 'OrderedPhoneNumberList', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'PhoneNumberOrderList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PhoneNumberOrder', ], ], 'PhoneNumberOrderStatus' => [ 'type' => 'string', 'enum' => [ 'Processing', 'Successful', 'Failed', 'Partial', ], ], 'PhoneNumberProductType' => [ 'type' => 'string', 'enum' => [ 'BusinessCalling', 'VoiceConnector', 'SipMediaApplicationDialIn', ], ], 'PhoneNumberStatus' => [ 'type' => 'string', 'enum' => [ 'AcquireInProgress', 'AcquireFailed', 'Unassigned', 'Assigned', 'ReleaseInProgress', 'DeleteInProgress', 'ReleaseFailed', 'DeleteFailed', ], ], 'PhoneNumberType' => [ 'type' => 'string', 'enum' => [ 'Local', 'TollFree', ], ], 'PhoneNumberTypeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PhoneNumberType', ], ], 'Port' => [ 'type' => 'integer', 'max' => 65535, 'min' => 0, ], 'PositiveInteger' => [ 'type' => 'integer', 'min' => 1, ], 'ProfileServiceMaxResults' => [ 'type' => 'integer', 'max' => 200, 'min' => 1, ], 'Proxy' => [ 'type' => 'structure', 'members' => [ 'DefaultSessionExpiryMinutes' => [ 'shape' => 'Integer', ], 'Disabled' => [ 'shape' => 'Boolean', ], 'FallBackPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'PhoneNumberCountries' => [ 'shape' => 'StringList', ], ], ], 'ProxySession' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', ], 'ProxySessionId' => [ 'shape' => 'NonEmptyString128', ], 'Name' => [ 'shape' => 'String128', ], 'Status' => [ 'shape' => 'ProxySessionStatus', ], 'ExpiryMinutes' => [ 'shape' => 'PositiveInteger', ], 'Capabilities' => [ 'shape' => 'CapabilityList', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'EndedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'Participants' => [ 'shape' => 'Participants', ], 'NumberSelectionBehavior' => [ 'shape' => 'NumberSelectionBehavior', ], 'GeoMatchLevel' => [ 'shape' => 'GeoMatchLevel', ], 'GeoMatchParams' => [ 'shape' => 'GeoMatchParams', ], ], ], 'ProxySessionNameString' => [ 'type' => 'string', 'pattern' => '^$|^[a-zA-Z0-9 ]{0,30}$', 'sensitive' => true, ], 'ProxySessionStatus' => [ 'type' => 'string', 'enum' => [ 'Open', 'InProgress', 'Closed', ], ], 'ProxySessions' => [ 'type' => 'list', 'member' => [ 'shape' => 'ProxySession', ], ], 'PutAppInstanceRetentionSettingsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', 'AppInstanceRetentionSettings', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], 'AppInstanceRetentionSettings' => [ 'shape' => 'AppInstanceRetentionSettings', ], ], ], 'PutAppInstanceRetentionSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceRetentionSettings' => [ 'shape' => 'AppInstanceRetentionSettings', ], 'InitiateDeletionTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'PutAppInstanceStreamingConfigurationsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', 'AppInstanceStreamingConfigurations', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], 'AppInstanceStreamingConfigurations' => [ 'shape' => 'AppInstanceStreamingConfigurationList', ], ], ], 'PutAppInstanceStreamingConfigurationsResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceStreamingConfigurations' => [ 'shape' => 'AppInstanceStreamingConfigurationList', ], ], ], 'PutEventsConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BotId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'BotId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'botId', ], 'OutboundEventsHTTPSEndpoint' => [ 'shape' => 'SensitiveString', ], 'LambdaFunctionArn' => [ 'shape' => 'SensitiveString', ], ], ], 'PutEventsConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'EventsConfiguration' => [ 'shape' => 'EventsConfiguration', ], ], ], 'PutRetentionSettingsRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'RetentionSettings', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'RetentionSettings' => [ 'shape' => 'RetentionSettings', ], ], ], 'PutRetentionSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'RetentionSettings' => [ 'shape' => 'RetentionSettings', ], 'InitiateDeletionTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'PutSipMediaApplicationLoggingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'SipMediaApplicationId', ], 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipMediaApplicationId', ], 'SipMediaApplicationLoggingConfiguration' => [ 'shape' => 'SipMediaApplicationLoggingConfiguration', ], ], ], 'PutSipMediaApplicationLoggingConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplicationLoggingConfiguration' => [ 'shape' => 'SipMediaApplicationLoggingConfiguration', ], ], ], 'PutVoiceConnectorEmergencyCallingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'EmergencyCallingConfiguration', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'EmergencyCallingConfiguration' => [ 'shape' => 'EmergencyCallingConfiguration', ], ], ], 'PutVoiceConnectorEmergencyCallingConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'EmergencyCallingConfiguration' => [ 'shape' => 'EmergencyCallingConfiguration', ], ], ], 'PutVoiceConnectorLoggingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'LoggingConfiguration', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'LoggingConfiguration' => [ 'shape' => 'LoggingConfiguration', ], ], ], 'PutVoiceConnectorLoggingConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'LoggingConfiguration' => [ 'shape' => 'LoggingConfiguration', ], ], ], 'PutVoiceConnectorOriginationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'Origination', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'Origination' => [ 'shape' => 'Origination', ], ], ], 'PutVoiceConnectorOriginationResponse' => [ 'type' => 'structure', 'members' => [ 'Origination' => [ 'shape' => 'Origination', ], ], ], 'PutVoiceConnectorProxyRequest' => [ 'type' => 'structure', 'required' => [ 'DefaultSessionExpiryMinutes', 'PhoneNumberPoolCountries', 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'DefaultSessionExpiryMinutes' => [ 'shape' => 'Integer', ], 'PhoneNumberPoolCountries' => [ 'shape' => 'CountryList', ], 'FallBackPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'Disabled' => [ 'shape' => 'Boolean', ], ], ], 'PutVoiceConnectorProxyResponse' => [ 'type' => 'structure', 'members' => [ 'Proxy' => [ 'shape' => 'Proxy', ], ], ], 'PutVoiceConnectorStreamingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'StreamingConfiguration', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'StreamingConfiguration' => [ 'shape' => 'StreamingConfiguration', ], ], ], 'PutVoiceConnectorStreamingConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'StreamingConfiguration' => [ 'shape' => 'StreamingConfiguration', ], ], ], 'PutVoiceConnectorTerminationCredentialsRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'Credentials' => [ 'shape' => 'CredentialList', ], ], ], 'PutVoiceConnectorTerminationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'Termination', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'Termination' => [ 'shape' => 'Termination', ], ], ], 'PutVoiceConnectorTerminationResponse' => [ 'type' => 'structure', 'members' => [ 'Termination' => [ 'shape' => 'Termination', ], ], ], 'RedactChannelMessageRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MessageId', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MessageId' => [ 'shape' => 'MessageId', 'location' => 'uri', 'locationName' => 'messageId', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'RedactChannelMessageResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'MessageId' => [ 'shape' => 'MessageId', ], ], ], 'RedactConversationMessageRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'ConversationId', 'MessageId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'ConversationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'conversationId', ], 'MessageId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'messageId', ], ], ], 'RedactConversationMessageResponse' => [ 'type' => 'structure', 'members' => [], ], 'RedactRoomMessageRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'RoomId', 'MessageId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'RoomId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'roomId', ], 'MessageId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'messageId', ], ], ], 'RedactRoomMessageResponse' => [ 'type' => 'structure', 'members' => [], ], 'RegenerateSecurityTokenRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BotId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'BotId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'botId', ], ], ], 'RegenerateSecurityTokenResponse' => [ 'type' => 'structure', 'members' => [ 'Bot' => [ 'shape' => 'Bot', ], ], ], 'RegistrationStatus' => [ 'type' => 'string', 'enum' => [ 'Unregistered', 'Registered', 'Suspended', ], ], 'ResetPersonalPINRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'UserId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'UserId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'userId', ], ], ], 'ResetPersonalPINResponse' => [ 'type' => 'structure', 'members' => [ 'User' => [ 'shape' => 'User', ], ], ], 'ResourceLimitExceededException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ResourceName' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', 'sensitive' => true, ], 'RestorePhoneNumberRequest' => [ 'type' => 'structure', 'required' => [ 'PhoneNumberId', ], 'members' => [ 'PhoneNumberId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'phoneNumberId', ], ], ], 'RestorePhoneNumberResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumber' => [ 'shape' => 'PhoneNumber', ], ], ], 'ResultMax' => [ 'type' => 'integer', 'max' => 99, 'min' => 1, ], 'RetentionDays' => [ 'type' => 'integer', 'max' => 5475, 'min' => 1, ], 'RetentionSettings' => [ 'type' => 'structure', 'members' => [ 'RoomRetentionSettings' => [ 'shape' => 'RoomRetentionSettings', ], 'ConversationRetentionSettings' => [ 'shape' => 'ConversationRetentionSettings', ], ], ], 'Room' => [ 'type' => 'structure', 'members' => [ 'RoomId' => [ 'shape' => 'NonEmptyString', ], 'Name' => [ 'shape' => 'SensitiveString', ], 'AccountId' => [ 'shape' => 'NonEmptyString', ], 'CreatedBy' => [ 'shape' => 'NonEmptyString', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'RoomList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Room', ], ], 'RoomMembership' => [ 'type' => 'structure', 'members' => [ 'RoomId' => [ 'shape' => 'NonEmptyString', ], 'Member' => [ 'shape' => 'Member', ], 'Role' => [ 'shape' => 'RoomMembershipRole', ], 'InvitedBy' => [ 'shape' => 'NonEmptyString', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'RoomMembershipList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RoomMembership', ], ], 'RoomMembershipRole' => [ 'type' => 'string', 'enum' => [ 'Administrator', 'Member', ], ], 'RoomRetentionSettings' => [ 'type' => 'structure', 'members' => [ 'RetentionDays' => [ 'shape' => 'RetentionDays', ], ], ], 'SMAUpdateCallArgumentsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'SensitiveString', ], 'value' => [ 'shape' => 'SensitiveString', ], 'max' => 20, 'min' => 0, ], 'SearchAvailablePhoneNumbersRequest' => [ 'type' => 'structure', 'members' => [ 'AreaCode' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'area-code', ], 'City' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'city', ], 'Country' => [ 'shape' => 'Alpha2CountryCode', 'location' => 'querystring', 'locationName' => 'country', ], 'State' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'state', ], 'TollFreePrefix' => [ 'shape' => 'TollFreePrefix', 'location' => 'querystring', 'locationName' => 'toll-free-prefix', ], 'PhoneNumberType' => [ 'shape' => 'PhoneNumberType', 'location' => 'querystring', 'locationName' => 'phone-number-type', ], 'MaxResults' => [ 'shape' => 'PhoneNumberMaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'SearchAvailablePhoneNumbersResponse' => [ 'type' => 'structure', 'members' => [ 'E164PhoneNumbers' => [ 'shape' => 'E164PhoneNumberList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'SelectedVideoStreams' => [ 'type' => 'structure', 'members' => [ 'AttendeeIds' => [ 'shape' => 'AttendeeIdList', ], 'ExternalUserIds' => [ 'shape' => 'ExternalUserIdList', ], ], ], 'SendChannelMessageRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'Content', 'Type', 'Persistence', 'ClientRequestToken', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'Content' => [ 'shape' => 'NonEmptyContent', ], 'Type' => [ 'shape' => 'ChannelMessageType', ], 'Persistence' => [ 'shape' => 'ChannelMessagePersistenceType', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'SendChannelMessageResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'MessageId' => [ 'shape' => 'MessageId', ], ], ], 'SensitiveNonEmptyString' => [ 'type' => 'string', 'pattern' => '.*\\\\S.*', 'sensitive' => true, ], 'SensitiveString' => [ 'type' => 'string', 'sensitive' => true, ], 'SensitiveStringList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SensitiveString', ], ], 'ServiceFailureException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'ServiceUnavailableException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], 'SigninDelegateGroup' => [ 'type' => 'structure', 'members' => [ 'GroupName' => [ 'shape' => 'NonEmptyString', ], ], ], 'SigninDelegateGroupList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SigninDelegateGroup', ], ], 'SipApplicationPriority' => [ 'type' => 'integer', 'min' => 1, ], 'SipHeadersMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'SensitiveString', ], 'value' => [ 'shape' => 'SensitiveString', ], 'max' => 20, 'min' => 0, ], 'SipMediaApplication' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', ], 'AwsRegion' => [ 'shape' => 'String', ], 'Name' => [ 'shape' => 'SipMediaApplicationName', ], 'Endpoints' => [ 'shape' => 'SipMediaApplicationEndpointList', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'SipMediaApplicationCall' => [ 'type' => 'structure', 'members' => [ 'TransactionId' => [ 'shape' => 'GuidString', ], ], ], 'SipMediaApplicationEndpoint' => [ 'type' => 'structure', 'members' => [ 'LambdaArn' => [ 'shape' => 'FunctionArn', ], ], ], 'SipMediaApplicationEndpointList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SipMediaApplicationEndpoint', ], 'max' => 1, 'min' => 1, ], 'SipMediaApplicationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SipMediaApplication', ], ], 'SipMediaApplicationLoggingConfiguration' => [ 'type' => 'structure', 'members' => [ 'EnableSipMediaApplicationMessageLogs' => [ 'shape' => 'Boolean', ], ], ], 'SipMediaApplicationName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'SipRule' => [ 'type' => 'structure', 'members' => [ 'SipRuleId' => [ 'shape' => 'NonEmptyString', ], 'Name' => [ 'shape' => 'SipRuleName', ], 'Disabled' => [ 'shape' => 'Boolean', ], 'TriggerType' => [ 'shape' => 'SipRuleTriggerType', ], 'TriggerValue' => [ 'shape' => 'NonEmptyString', ], 'TargetApplications' => [ 'shape' => 'SipRuleTargetApplicationList', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'SipRuleList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SipRule', ], ], 'SipRuleName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'SipRuleTargetApplication' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', ], 'Priority' => [ 'shape' => 'SipApplicationPriority', ], 'AwsRegion' => [ 'shape' => 'String', ], ], ], 'SipRuleTargetApplicationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SipRuleTargetApplication', ], 'max' => 25, 'min' => 1, ], 'SipRuleTriggerType' => [ 'type' => 'string', 'enum' => [ 'ToPhoneNumber', 'RequestUriHostname', ], ], 'SortOrder' => [ 'type' => 'string', 'enum' => [ 'ASCENDING', 'DESCENDING', ], ], 'SourceConfiguration' => [ 'type' => 'structure', 'members' => [ 'SelectedVideoStreams' => [ 'shape' => 'SelectedVideoStreams', ], ], ], 'StartMeetingTranscriptionRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'TranscriptionConfiguration', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'meetingId', ], 'TranscriptionConfiguration' => [ 'shape' => 'TranscriptionConfiguration', ], ], ], 'StartMeetingTranscriptionResponse' => [ 'type' => 'structure', 'members' => [], ], 'StopMeetingTranscriptionRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'meetingId', ], ], ], 'StopMeetingTranscriptionResponse' => [ 'type' => 'structure', 'members' => [], ], 'StreamingConfiguration' => [ 'type' => 'structure', 'required' => [ 'DataRetentionInHours', ], 'members' => [ 'DataRetentionInHours' => [ 'shape' => 'DataRetentionInHours', ], 'Disabled' => [ 'shape' => 'Boolean', ], 'StreamingNotificationTargets' => [ 'shape' => 'StreamingNotificationTargetList', ], ], ], 'StreamingNotificationTarget' => [ 'type' => 'structure', 'required' => [ 'NotificationTarget', ], 'members' => [ 'NotificationTarget' => [ 'shape' => 'NotificationTarget', ], ], ], 'StreamingNotificationTargetList' => [ 'type' => 'list', 'member' => [ 'shape' => 'StreamingNotificationTarget', ], 'max' => 3, 'min' => 1, ], 'String' => [ 'type' => 'string', ], 'String128' => [ 'type' => 'string', 'max' => 128, ], 'StringList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'Tag' => [ 'type' => 'structure', 'required' => [ 'Key', 'Value', ], 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], ], 'TagAttendeeRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'AttendeeId', 'Tags', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'meetingId', ], 'AttendeeId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'attendeeId', ], 'Tags' => [ 'shape' => 'AttendeeTagList', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'sensitive' => true, ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 50, 'min' => 1, ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], 'max' => 50, 'min' => 1, ], 'TagMeetingRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'Tags', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'meetingId', ], 'Tags' => [ 'shape' => 'MeetingTagList', ], ], ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'Tags', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'Arn', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'sensitive' => true, ], 'TelephonySettings' => [ 'type' => 'structure', 'required' => [ 'InboundCalling', 'OutboundCalling', 'SMS', ], 'members' => [ 'InboundCalling' => [ 'shape' => 'Boolean', ], 'OutboundCalling' => [ 'shape' => 'Boolean', ], 'SMS' => [ 'shape' => 'Boolean', ], ], ], 'Termination' => [ 'type' => 'structure', 'members' => [ 'CpsLimit' => [ 'shape' => 'CpsLimit', ], 'DefaultPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'CallingRegions' => [ 'shape' => 'CallingRegionList', ], 'CidrAllowedList' => [ 'shape' => 'StringList', ], 'Disabled' => [ 'shape' => 'Boolean', ], ], ], 'TerminationHealth' => [ 'type' => 'structure', 'members' => [ 'Timestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'Source' => [ 'shape' => 'String', ], ], ], 'ThrottledClientException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], 'Timestamp' => [ 'type' => 'timestamp', ], 'TollFreePrefix' => [ 'type' => 'string', 'max' => 3, 'min' => 3, 'pattern' => '^8(00|33|44|55|66|77|88)$', ], 'TranscribeContentIdentificationType' => [ 'type' => 'string', 'enum' => [ 'PII', ], ], 'TranscribeContentRedactionType' => [ 'type' => 'string', 'enum' => [ 'PII', ], ], 'TranscribeLanguageCode' => [ 'type' => 'string', 'enum' => [ 'en-US', 'en-GB', 'es-US', 'fr-CA', 'fr-FR', 'en-AU', 'it-IT', 'de-DE', 'pt-BR', 'ja-JP', 'ko-KR', 'zh-CN', 'th-TH', 'hi-IN', ], ], 'TranscribeLanguageModelName' => [ 'type' => 'string', 'max' => 200, 'min' => 1, 'pattern' => '^[0-9a-zA-Z._-]+', ], 'TranscribeLanguageOptions' => [ 'type' => 'string', 'max' => 200, 'min' => 1, 'pattern' => '^[a-zA-Z-,]+', ], 'TranscribeMedicalContentIdentificationType' => [ 'type' => 'string', 'enum' => [ 'PHI', ], ], 'TranscribeMedicalLanguageCode' => [ 'type' => 'string', 'enum' => [ 'en-US', ], ], 'TranscribeMedicalRegion' => [ 'type' => 'string', 'enum' => [ 'us-east-1', 'us-east-2', 'us-west-2', 'ap-southeast-2', 'ca-central-1', 'eu-west-1', 'auto', ], ], 'TranscribeMedicalSpecialty' => [ 'type' => 'string', 'enum' => [ 'PRIMARYCARE', 'CARDIOLOGY', 'NEUROLOGY', 'ONCOLOGY', 'RADIOLOGY', 'UROLOGY', ], ], 'TranscribeMedicalType' => [ 'type' => 'string', 'enum' => [ 'CONVERSATION', 'DICTATION', ], ], 'TranscribePartialResultsStability' => [ 'type' => 'string', 'enum' => [ 'low', 'medium', 'high', ], ], 'TranscribePiiEntityTypes' => [ 'type' => 'string', 'max' => 300, 'min' => 1, 'pattern' => '^[A-Z_, ]+', ], 'TranscribeRegion' => [ 'type' => 'string', 'enum' => [ 'us-east-2', 'us-east-1', 'us-west-2', 'ap-northeast-2', 'ap-southeast-2', 'ap-northeast-1', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'sa-east-1', 'auto', ], ], 'TranscribeVocabularyFilterMethod' => [ 'type' => 'string', 'enum' => [ 'remove', 'mask', 'tag', ], ], 'TranscribeVocabularyNamesOrFilterNamesString' => [ 'type' => 'string', 'max' => 3000, 'min' => 1, 'pattern' => '^[a-zA-Z0-9,-._]+', ], 'TranscriptionConfiguration' => [ 'type' => 'structure', 'members' => [ 'EngineTranscribeSettings' => [ 'shape' => 'EngineTranscribeSettings', ], 'EngineTranscribeMedicalSettings' => [ 'shape' => 'EngineTranscribeMedicalSettings', ], ], ], 'UnauthorizedClientException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], 'UnprocessableEntityException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 422, ], 'exception' => true, ], 'UntagAttendeeRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'TagKeys', 'AttendeeId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'meetingId', ], 'AttendeeId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'attendeeId', ], 'TagKeys' => [ 'shape' => 'AttendeeTagKeyList', ], ], ], 'UntagMeetingRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'TagKeys', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'meetingId', ], 'TagKeys' => [ 'shape' => 'MeetingTagKeyList', ], ], ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'TagKeys', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'Arn', ], 'TagKeys' => [ 'shape' => 'TagKeyList', ], ], ], 'UpdateAccountRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'Name' => [ 'shape' => 'AccountName', ], 'DefaultLicense' => [ 'shape' => 'License', ], ], ], 'UpdateAccountResponse' => [ 'type' => 'structure', 'members' => [ 'Account' => [ 'shape' => 'Account', ], ], ], 'UpdateAccountSettingsRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'AccountSettings', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'AccountSettings' => [ 'shape' => 'AccountSettings', ], ], ], 'UpdateAccountSettingsResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateAppInstanceRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', 'Name', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'Metadata' => [ 'shape' => 'Metadata', ], ], ], 'UpdateAppInstanceResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], ], ], 'UpdateAppInstanceUserRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceUserArn', 'Name', ], 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceUserArn', ], 'Name' => [ 'shape' => 'UserName', ], 'Metadata' => [ 'shape' => 'Metadata', ], ], ], 'UpdateAppInstanceUserResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', ], ], ], 'UpdateBotRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'BotId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'BotId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'botId', ], 'Disabled' => [ 'shape' => 'NullableBoolean', ], ], ], 'UpdateBotResponse' => [ 'type' => 'structure', 'members' => [ 'Bot' => [ 'shape' => 'Bot', ], ], ], 'UpdateChannelMessageRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MessageId', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MessageId' => [ 'shape' => 'MessageId', 'location' => 'uri', 'locationName' => 'messageId', ], 'Content' => [ 'shape' => 'Content', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'UpdateChannelMessageResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'MessageId' => [ 'shape' => 'MessageId', ], ], ], 'UpdateChannelReadMarkerRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'UpdateChannelReadMarkerResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], ], ], 'UpdateChannelRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'Name', 'Mode', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'Mode' => [ 'shape' => 'ChannelMode', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'UpdateChannelResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], ], ], 'UpdateGlobalSettingsRequest' => [ 'type' => 'structure', 'members' => [ 'BusinessCalling' => [ 'shape' => 'BusinessCallingSettings', ], 'VoiceConnector' => [ 'shape' => 'VoiceConnectorSettings', ], ], ], 'UpdatePhoneNumberRequest' => [ 'type' => 'structure', 'required' => [ 'PhoneNumberId', ], 'members' => [ 'PhoneNumberId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'phoneNumberId', ], 'ProductType' => [ 'shape' => 'PhoneNumberProductType', ], 'CallingName' => [ 'shape' => 'CallingName', ], ], ], 'UpdatePhoneNumberRequestItem' => [ 'type' => 'structure', 'required' => [ 'PhoneNumberId', ], 'members' => [ 'PhoneNumberId' => [ 'shape' => 'NonEmptyString', ], 'ProductType' => [ 'shape' => 'PhoneNumberProductType', ], 'CallingName' => [ 'shape' => 'CallingName', ], ], ], 'UpdatePhoneNumberRequestItemList' => [ 'type' => 'list', 'member' => [ 'shape' => 'UpdatePhoneNumberRequestItem', ], ], 'UpdatePhoneNumberResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumber' => [ 'shape' => 'PhoneNumber', ], ], ], 'UpdatePhoneNumberSettingsRequest' => [ 'type' => 'structure', 'required' => [ 'CallingName', ], 'members' => [ 'CallingName' => [ 'shape' => 'CallingName', ], ], ], 'UpdateProxySessionRequest' => [ 'type' => 'structure', 'required' => [ 'Capabilities', 'VoiceConnectorId', 'ProxySessionId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'ProxySessionId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'proxySessionId', ], 'Capabilities' => [ 'shape' => 'CapabilityList', ], 'ExpiryMinutes' => [ 'shape' => 'PositiveInteger', ], ], ], 'UpdateProxySessionResponse' => [ 'type' => 'structure', 'members' => [ 'ProxySession' => [ 'shape' => 'ProxySession', ], ], ], 'UpdateRoomMembershipRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'RoomId', 'MemberId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'RoomId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'roomId', ], 'MemberId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'memberId', ], 'Role' => [ 'shape' => 'RoomMembershipRole', ], ], ], 'UpdateRoomMembershipResponse' => [ 'type' => 'structure', 'members' => [ 'RoomMembership' => [ 'shape' => 'RoomMembership', ], ], ], 'UpdateRoomRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'RoomId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'RoomId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'roomId', ], 'Name' => [ 'shape' => 'SensitiveString', ], ], ], 'UpdateRoomResponse' => [ 'type' => 'structure', 'members' => [ 'Room' => [ 'shape' => 'Room', ], ], ], 'UpdateSipMediaApplicationCallRequest' => [ 'type' => 'structure', 'required' => [ 'SipMediaApplicationId', 'TransactionId', 'Arguments', ], 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipMediaApplicationId', ], 'TransactionId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'transactionId', ], 'Arguments' => [ 'shape' => 'SMAUpdateCallArgumentsMap', ], ], ], 'UpdateSipMediaApplicationCallResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplicationCall' => [ 'shape' => 'SipMediaApplicationCall', ], ], ], 'UpdateSipMediaApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'SipMediaApplicationId', ], 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipMediaApplicationId', ], 'Name' => [ 'shape' => 'SipMediaApplicationName', ], 'Endpoints' => [ 'shape' => 'SipMediaApplicationEndpointList', ], ], ], 'UpdateSipMediaApplicationResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplication' => [ 'shape' => 'SipMediaApplication', ], ], ], 'UpdateSipRuleRequest' => [ 'type' => 'structure', 'required' => [ 'SipRuleId', 'Name', ], 'members' => [ 'SipRuleId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipRuleId', ], 'Name' => [ 'shape' => 'SipRuleName', ], 'Disabled' => [ 'shape' => 'NullableBoolean', ], 'TargetApplications' => [ 'shape' => 'SipRuleTargetApplicationList', ], ], ], 'UpdateSipRuleResponse' => [ 'type' => 'structure', 'members' => [ 'SipRule' => [ 'shape' => 'SipRule', ], ], ], 'UpdateUserRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'UserId', ], 'members' => [ 'AccountId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'accountId', ], 'UserId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'userId', ], 'LicenseType' => [ 'shape' => 'License', ], 'UserType' => [ 'shape' => 'UserType', ], 'AlexaForBusinessMetadata' => [ 'shape' => 'AlexaForBusinessMetadata', ], ], ], 'UpdateUserRequestItem' => [ 'type' => 'structure', 'required' => [ 'UserId', ], 'members' => [ 'UserId' => [ 'shape' => 'NonEmptyString', ], 'LicenseType' => [ 'shape' => 'License', ], 'UserType' => [ 'shape' => 'UserType', ], 'AlexaForBusinessMetadata' => [ 'shape' => 'AlexaForBusinessMetadata', ], ], ], 'UpdateUserRequestItemList' => [ 'type' => 'list', 'member' => [ 'shape' => 'UpdateUserRequestItem', ], 'max' => 20, ], 'UpdateUserResponse' => [ 'type' => 'structure', 'members' => [ 'User' => [ 'shape' => 'User', ], ], ], 'UpdateUserSettingsRequest' => [ 'type' => 'structure', 'required' => [ 'AccountId', 'UserId', 'UserSettings', ], 'members' => [ 'AccountId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'accountId', ], 'UserId' => [ 'shape' => 'String', 'location' => 'uri', 'locationName' => 'userId', ], 'UserSettings' => [ 'shape' => 'UserSettings', ], ], ], 'UpdateVoiceConnectorGroupRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorGroupId', 'Name', 'VoiceConnectorItems', ], 'members' => [ 'VoiceConnectorGroupId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorGroupId', ], 'Name' => [ 'shape' => 'VoiceConnectorGroupName', ], 'VoiceConnectorItems' => [ 'shape' => 'VoiceConnectorItemList', ], ], ], 'UpdateVoiceConnectorGroupResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectorGroup' => [ 'shape' => 'VoiceConnectorGroup', ], ], ], 'UpdateVoiceConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'Name', 'RequireEncryption', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'Name' => [ 'shape' => 'VoiceConnectorName', ], 'RequireEncryption' => [ 'shape' => 'Boolean', ], ], ], 'UpdateVoiceConnectorResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnector' => [ 'shape' => 'VoiceConnector', ], ], ], 'UriType' => [ 'type' => 'string', 'max' => 4096, ], 'UrlType' => [ 'type' => 'string', 'max' => 4096, ], 'User' => [ 'type' => 'structure', 'required' => [ 'UserId', ], 'members' => [ 'UserId' => [ 'shape' => 'String', ], 'AccountId' => [ 'shape' => 'String', ], 'PrimaryEmail' => [ 'shape' => 'EmailAddress', ], 'PrimaryProvisionedNumber' => [ 'shape' => 'SensitiveString', ], 'DisplayName' => [ 'shape' => 'SensitiveString', ], 'LicenseType' => [ 'shape' => 'License', ], 'UserType' => [ 'shape' => 'UserType', ], 'UserRegistrationStatus' => [ 'shape' => 'RegistrationStatus', ], 'UserInvitationStatus' => [ 'shape' => 'InviteStatus', ], 'RegisteredOn' => [ 'shape' => 'Iso8601Timestamp', ], 'InvitedOn' => [ 'shape' => 'Iso8601Timestamp', ], 'AlexaForBusinessMetadata' => [ 'shape' => 'AlexaForBusinessMetadata', ], 'PersonalPIN' => [ 'shape' => 'String', ], ], ], 'UserEmailList' => [ 'type' => 'list', 'member' => [ 'shape' => 'EmailAddress', ], 'max' => 50, ], 'UserError' => [ 'type' => 'structure', 'members' => [ 'UserId' => [ 'shape' => 'NonEmptyString', ], 'ErrorCode' => [ 'shape' => 'ErrorCode', ], 'ErrorMessage' => [ 'shape' => 'String', ], ], ], 'UserErrorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'UserError', ], ], 'UserId' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '[A-Za-z0-9]([A-Za-z0-9\\\\:\\\\-\\\\_\\\\.\\\\@]{0,62}[A-Za-z0-9])?', 'sensitive' => true, ], 'UserIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'NonEmptyString', ], 'max' => 50, ], 'UserList' => [ 'type' => 'list', 'member' => [ 'shape' => 'User', ], ], 'UserName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '.*\\\\S.*', 'sensitive' => true, ], 'UserSettings' => [ 'type' => 'structure', 'required' => [ 'Telephony', ], 'members' => [ 'Telephony' => [ 'shape' => 'TelephonySettings', ], ], ], 'UserType' => [ 'type' => 'string', 'enum' => [ 'PrivateUser', 'SharedDevice', ], ], 'ValidateE911AddressRequest' => [ 'type' => 'structure', 'required' => [ 'AwsAccountId', 'StreetNumber', 'StreetInfo', 'City', 'State', 'Country', 'PostalCode', ], 'members' => [ 'AwsAccountId' => [ 'shape' => 'NonEmptyString', ], 'StreetNumber' => [ 'shape' => 'SensitiveNonEmptyString', ], 'StreetInfo' => [ 'shape' => 'SensitiveNonEmptyString', ], 'City' => [ 'shape' => 'SensitiveNonEmptyString', ], 'State' => [ 'shape' => 'SensitiveNonEmptyString', ], 'Country' => [ 'shape' => 'SensitiveNonEmptyString', ], 'PostalCode' => [ 'shape' => 'SensitiveNonEmptyString', ], ], ], 'ValidateE911AddressResponse' => [ 'type' => 'structure', 'members' => [ 'ValidationResult' => [ 'shape' => 'ValidationResult', ], 'AddressExternalId' => [ 'shape' => 'String', ], 'Address' => [ 'shape' => 'Address', ], 'CandidateAddressList' => [ 'shape' => 'CandidateAddressList', ], ], ], 'ValidationResult' => [ 'type' => 'integer', 'max' => 2, 'min' => 0, ], 'VideoArtifactsConfiguration' => [ 'type' => 'structure', 'required' => [ 'State', ], 'members' => [ 'State' => [ 'shape' => 'ArtifactsState', ], 'MuxType' => [ 'shape' => 'VideoMuxType', ], ], ], 'VideoMuxType' => [ 'type' => 'string', 'enum' => [ 'VideoOnly', ], ], 'VoiceConnector' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', ], 'AwsRegion' => [ 'shape' => 'VoiceConnectorAwsRegion', ], 'Name' => [ 'shape' => 'VoiceConnectorName', ], 'OutboundHostName' => [ 'shape' => 'String', ], 'RequireEncryption' => [ 'shape' => 'Boolean', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'VoiceConnectorArn' => [ 'shape' => 'NonEmptyString', ], ], ], 'VoiceConnectorAwsRegion' => [ 'type' => 'string', 'enum' => [ 'us-east-1', 'us-west-2', ], ], 'VoiceConnectorGroup' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectorGroupId' => [ 'shape' => 'NonEmptyString', ], 'Name' => [ 'shape' => 'VoiceConnectorGroupName', ], 'VoiceConnectorItems' => [ 'shape' => 'VoiceConnectorItemList', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'VoiceConnectorGroupArn' => [ 'shape' => 'NonEmptyString', ], ], ], 'VoiceConnectorGroupList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VoiceConnectorGroup', ], ], 'VoiceConnectorGroupName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'VoiceConnectorItem' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'Priority', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', ], 'Priority' => [ 'shape' => 'VoiceConnectorItemPriority', ], ], ], 'VoiceConnectorItemList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VoiceConnectorItem', ], ], 'VoiceConnectorItemPriority' => [ 'type' => 'integer', 'max' => 99, 'min' => 1, ], 'VoiceConnectorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VoiceConnector', ], ], 'VoiceConnectorName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'VoiceConnectorSettings' => [ 'type' => 'structure', 'members' => [ 'CdrBucket' => [ 'shape' => 'String', 'box' => true, ], ], ], ], 'deprecated' => true, 'deprecatedMessage' => 'This namespace has been deprecated',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime/2018-05-01/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<important> <p> <b>Most of these APIs are no longer supported and will not be updated.</b> We recommend using the latest versions in the <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/welcome.html\">Amazon Chime SDK API reference</a>, in the Amazon Chime SDK.</p> <p>Using the latest versions requires migrating to dedicated namespaces. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important> <p>The Amazon Chime application programming interface (API) is designed so administrators can perform key tasks, such as creating and managing Amazon Chime accounts, users, and Voice Connectors. This guide provides detailed information about the Amazon Chime API, including operations, types, inputs and outputs, and error codes.</p> <p>You can use an AWS SDK, the AWS Command Line Interface (AWS CLI), or the REST API to make API calls for Amazon Chime. We recommend using an AWS SDK or the AWS CLI. The page for each API action contains a <i>See Also</i> section that includes links to information about using the action with a language-specific AWS SDK or the AWS CLI.</p> <dl> <dt>Using an AWS SDK</dt> <dd> <p> You don\\'t need to write code to calculate a signature for request authentication. The SDK clients authenticate your requests by using access keys that you provide. For more information about AWS SDKs, see the <a href=\"http://aws.amazon.com/developer/\">AWS Developer Center</a>. </p> </dd> <dt>Using the AWS CLI</dt> <dd> <p>Use your access keys with the AWS CLI to make API calls. For information about setting up the AWS CLI, see <a href=\"https://docs.aws.amazon.com/cli/latest/userguide/installing.html\">Installing the AWS Command Line Interface</a> in the <i>AWS Command Line Interface User Guide</i>. For a list of available Amazon Chime commands, see the <a href=\"https://docs.aws.amazon.com/cli/latest/reference/chime/index.html\">Amazon Chime commands</a> in the <i>AWS CLI Command Reference</i>. </p> </dd> <dt>Using REST APIs</dt> <dd> <p>If you use REST to make API calls, you must authenticate your request by providing a signature. Amazon Chime supports Signature Version 4. For more information, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\">Signature Version 4 Signing Process</a> in the <i>Amazon Web Services General Reference</i>.</p> <p>When making REST API calls, use the service name <code>chime</code> and REST endpoint <code>https://service.chime.aws.amazon.com</code>.</p> </dd> </dl> <p>Administrative permissions are controlled using AWS Identity and Access Management (IAM). For more information, see <a href=\"https://docs.aws.amazon.com/chime/latest/ag/security-iam.html\">Identity and Access Management for Amazon Chime</a> in the <i>Amazon Chime Administration Guide</i>.</p>', 'operations' => [ 'AssociatePhoneNumberWithUser' => '<p>Associates a phone number with the specified Amazon Chime user.</p>', 'AssociatePhoneNumbersWithVoiceConnector' => '<p>Associates phone numbers with the specified Amazon Chime Voice Connector.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_AssociatePhoneNumbersWithVoiceConnector.html\">AssociatePhoneNumbersWithVoiceConnector</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'AssociatePhoneNumbersWithVoiceConnectorGroup' => '<p>Associates phone numbers with the specified Amazon Chime Voice Connector group.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_AssociatePhoneNumbersWithVoiceConnectorGroup.html\">AssociatePhoneNumbersWithVoiceConnectorGroup</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'AssociateSigninDelegateGroupsWithAccount' => '<p>Associates the specified sign-in delegate groups with the specified Amazon Chime account.</p>', 'BatchCreateAttendee' => '<p>Creates up to 100 new attendees for an active Amazon Chime SDK meeting.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_BatchCreateAttendee.html\">BatchCreateAttendee</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important> <p>For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime SDK Developer Guide</i>. </p>', 'BatchCreateChannelMembership' => '<p>Adds a specified number of users to a channel.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_BatchCreateChannelMembership.html\">BatchCreateChannelMembership</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'BatchCreateRoomMembership' => '<p>Adds up to 50 members to a chat room in an Amazon Chime Enterprise account. Members can be users or bots. The member role designates whether the member is a chat room administrator or a general chat room member.</p>', 'BatchDeletePhoneNumber' => '<p> Moves phone numbers into the <b>Deletion queue</b>. Phone numbers must be disassociated from any users or Amazon Chime Voice Connectors before they can be deleted. </p> <p> Phone numbers remain in the <b>Deletion queue</b> for 7 days before they are deleted permanently. </p>', 'BatchSuspendUser' => '<p>Suspends up to 50 users from a <code>Team</code> or <code>EnterpriseLWA</code> Amazon Chime account. For more information about different account types, see <a href=\"https://docs.aws.amazon.com/chime/latest/ag/manage-chime-account.html\">Managing Your Amazon Chime Accounts</a> in the <i>Amazon Chime Administration Guide</i>.</p> <p>Users suspended from a <code>Team</code> account are disassociated from the account,but they can continue to use Amazon Chime as free users. To remove the suspension from suspended <code>Team</code> account users, invite them to the <code>Team</code> account again. You can use the <a>InviteUsers</a> action to do so.</p> <p>Users suspended from an <code>EnterpriseLWA</code> account are immediately signed out of Amazon Chime and can no longer sign in. To remove the suspension from suspended <code>EnterpriseLWA</code> account users, use the <a>BatchUnsuspendUser</a> action.</p> <p> To sign out users without suspending them, use the <a>LogoutUser</a> action.</p>', 'BatchUnsuspendUser' => '<p>Removes the suspension from up to 50 previously suspended users for the specified Amazon Chime <code>EnterpriseLWA</code> account. Only users on <code>EnterpriseLWA</code> accounts can be unsuspended using this action. For more information about different account types, see <a href=\"https://docs.aws.amazon.com/chime/latest/ag/manage-chime-account.html\"> Managing Your Amazon Chime Accounts </a> in the account types, in the <i>Amazon Chime Administration Guide</i>. </p> <p>Previously suspended users who are unsuspended using this action are returned to <code>Registered</code> status. Users who are not previously suspended are ignored.</p>', 'BatchUpdatePhoneNumber' => '<p>Updates phone number product types or calling names. You can update one attribute at a time for each <code>UpdatePhoneNumberRequestItem</code>. For example, you can update the product type or the calling name.</p> <p>For toll-free numbers, you cannot use the Amazon Chime Business Calling product type. For numbers outside the U.S., you must use the Amazon Chime SIP Media Application Dial-In product type.</p> <p>Updates to outbound calling names can take up to 72 hours to complete. Pending updates to outbound calling names must be complete before you can request another update.</p>', 'BatchUpdateUser' => '<p>Updates user details within the <a>UpdateUserRequestItem</a> object for up to 20 users for the specified Amazon Chime account. Currently, only <code>LicenseType</code> updates are supported for this action.</p>', 'CreateAccount' => '<p>Creates an Amazon Chime account under the administrator\\'s AWS account. Only <code>Team</code> account types are currently supported for this action. For more information about different account types, see <a href=\"https://docs.aws.amazon.com/chime/latest/ag/manage-chime-account.html\">Managing Your Amazon Chime Accounts</a> in the <i>Amazon Chime Administration Guide</i>.</p>', 'CreateAppInstance' => '<p>Creates an Amazon Chime SDK messaging <code>AppInstance</code> under an AWS account. Only SDK messaging customers use this API. <code>CreateAppInstance</code> supports idempotency behavior as described in the AWS API Standard.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_CreateAppInstance.html\">CreateAppInstance</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'CreateAppInstanceAdmin' => '<p>Promotes an <code>AppInstanceUser</code> to an <code>AppInstanceAdmin</code>. The promoted user can perform the following actions. </p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_CreateAppInstanceAdmin.html\">CreateAppInstanceAdmin</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important> <ul> <li> <p> <code>ChannelModerator</code> actions across all channels in the <code>AppInstance</code>.</p> </li> <li> <p> <code>DeleteChannelMessage</code> actions.</p> </li> </ul> <p>Only an <code>AppInstanceUser</code> can be promoted to an <code>AppInstanceAdmin</code> role.</p>', 'CreateAppInstanceUser' => '<p>Creates a user under an Amazon Chime <code>AppInstance</code>. The request consists of a unique <code>appInstanceUserId</code> and <code>Name</code> for that user.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_CreateAppInstanceUser.html\">CreateAppInstanceUser</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'CreateAttendee' => '<p> Creates a new attendee for an active Amazon Chime SDK meeting. For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime SDK Developer Guide</i>. </p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_CreateAttendee.html\">CreateAttendee</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'CreateBot' => '<p>Creates a bot for an Amazon Chime Enterprise account.</p>', 'CreateChannel' => '<p>Creates a channel to which you can add users and send messages.</p> <p> <b>Restriction</b>: You can\\'t change a channel\\'s privacy.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_CreateChannel.html\">CreateChannel</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'CreateChannelBan' => '<p>Permanently bans a member from a channel. Moderators can\\'t add banned members to a channel. To undo a ban, you first have to <code>DeleteChannelBan</code>, and then <code>CreateChannelMembership</code>. Bans are cleaned up when you delete users or channels.</p> <p>If you ban a user who is already part of a channel, that user is automatically kicked from the channel.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_CreateChannelBan.html\">CreateChannelBan</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'CreateChannelMembership' => '<p>Adds a user to a channel. The <code>InvitedBy</code> response field is derived from the request header. A channel member can:</p> <ul> <li> <p>List messages</p> </li> <li> <p>Send messages</p> </li> <li> <p>Receive messages</p> </li> <li> <p>Edit their own messages</p> </li> <li> <p>Leave the channel</p> </li> </ul> <p>Privacy settings impact this action as follows:</p> <ul> <li> <p>Public Channels: You do not need to be a member to list messages, but you must be a member to send messages.</p> </li> <li> <p>Private Channels: You must be a member to list or send messages.</p> </li> </ul> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_CreateChannelMembership.html\">CreateChannelMembership</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'CreateChannelModerator' => '<p>Creates a new <code>ChannelModerator</code>. A channel moderator can:</p> <ul> <li> <p>Add and remove other members of the channel.</p> </li> <li> <p>Add and remove other moderators of the channel.</p> </li> <li> <p>Add and remove user bans for the channel.</p> </li> <li> <p>Redact messages in the channel.</p> </li> <li> <p>List messages in the channel.</p> </li> </ul> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_CreateChannelModerator.html\">CreateChannelModerator</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'CreateMediaCapturePipeline' => '<p>Creates a media capture pipeline.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_media-pipelines-chime_CreateMediaCapturePipeline\">CreateMediaCapturePipeline</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'CreateMeeting' => '<p>Creates a new Amazon Chime SDK meeting in the specified media Region with no initial attendees. For more information about specifying media Regions, see <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/chime-sdk-meetings-regions.html\">Amazon Chime SDK Media Regions</a> in the <i>Amazon Chime SDK Developer Guide</i> . For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_CreateMeeting.html\">CreateMeeting</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'CreateMeetingDialOut' => '<p>Uses the join token and call metadata in a meeting request (From number, To number, and so forth) to initiate an outbound call to a public switched telephone network (PSTN) and join them into a Chime meeting. Also ensures that the From number belongs to the customer.</p> <p>To play welcome audio or implement an interactive voice response (IVR), use the <code>CreateSipMediaApplicationCall</code> action with the corresponding SIP media application ID.</p> <important> <p> <b>This API is is not available in a dedicated namespace.</b> </p> </important>', 'CreateMeetingWithAttendees' => '<p> Creates a new Amazon Chime SDK meeting in the specified media Region, with attendees. For more information about specifying media Regions, see <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/chime-sdk-meetings-regions.html\">Amazon Chime SDK Media Regions</a> in the <i>Amazon Chime SDK Developer Guide</i> . For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime SDK Developer Guide</i> . </p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_CreateMeetingWithAttendees.html\">CreateMeetingWithAttendees</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'CreatePhoneNumberOrder' => '<p>Creates an order for phone numbers to be provisioned. For toll-free numbers, you cannot use the Amazon Chime Business Calling product type. For numbers outside the U.S., you must use the Amazon Chime SIP Media Application Dial-In product type.</p>', 'CreateProxySession' => '<p>Creates a proxy session on the specified Amazon Chime Voice Connector for the specified participant phone numbers.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_CreateProxySession.html\">CreateProxySession</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'CreateRoom' => '<p>Creates a chat room for the specified Amazon Chime Enterprise account.</p>', 'CreateRoomMembership' => '<p>Adds a member to a chat room in an Amazon Chime Enterprise account. A member can be either a user or a bot. The member role designates whether the member is a chat room administrator or a general chat room member.</p>', 'CreateSipMediaApplication' => '<p>Creates a SIP media application.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_CreateSipMediaApplication.html\">CreateSipMediaApplication</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'CreateSipMediaApplicationCall' => '<p>Creates an outbound call to a phone number from the phone number specified in the request, and it invokes the endpoint of the specified <code>sipMediaApplicationId</code>.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_CreateSipMediaApplicationCall.html\">CreateSipMediaApplicationCall</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'CreateSipRule' => '<p>Creates a SIP rule which can be used to run a SIP media application as a target for a specific trigger type.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_CreateSipRule.html\">CreateSipRule</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'CreateUser' => '<p>Creates a user under the specified Amazon Chime account.</p>', 'CreateVoiceConnector' => '<p>Creates an Amazon Chime Voice Connector under the administrator\\'s AWS account. You can choose to create an Amazon Chime Voice Connector in a specific AWS Region.</p> <p>Enabling <a>CreateVoiceConnectorRequest$RequireEncryption</a> configures your Amazon Chime Voice Connector to use TLS transport for SIP signaling and Secure RTP (SRTP) for media. Inbound calls use TLS transport, and unencrypted outbound calls are blocked. </p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_CreateVoiceConnector.html\">CreateVoiceConnector</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'CreateVoiceConnectorGroup' => '<p>Creates an Amazon Chime Voice Connector group under the administrator\\'s AWS account. You can associate Amazon Chime Voice Connectors with the Amazon Chime Voice Connector group by including <code>VoiceConnectorItems</code> in the request.</p> <p>You can include Amazon Chime Voice Connectors from different AWS Regions in your group. This creates a fault tolerant mechanism for fallback in case of availability events.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_CreateVoiceConnectorGroup.html\">CreateVoiceConnectorGroup</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteAccount' => '<p>Deletes the specified Amazon Chime account. You must suspend all users before deleting <code>Team</code> account. You can use the <a>BatchSuspendUser</a> action to dodo.</p> <p>For <code>EnterpriseLWA</code> and <code>EnterpriseAD</code> accounts, you must release the claimed domains for your Amazon Chime account before deletion. As soon as you release the domain, all users under that account are suspended.</p> <p>Deleted accounts appear in your <code>Disabled</code> accounts list for 90 days. To restore deleted account from your <code>Disabled</code> accounts list, you must contact AWS Support.</p> <p>After 90 days, deleted accounts are permanently removed from your <code>Disabled</code> accounts list.</p>', 'DeleteAppInstance' => '<p>Deletes an <code>AppInstance</code> and all associated data asynchronously.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_DeleteAppInstance.html\">DeleteAppInstance</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteAppInstanceAdmin' => '<p>Demotes an <code>AppInstanceAdmin</code> to an <code>AppInstanceUser</code>. This action does not delete the user.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_DeleteAppInstanceAdmin.html\">DeleteAppInstanceAdmin</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteAppInstanceStreamingConfigurations' => '<p>Deletes the streaming configurations of an <code>AppInstance</code>.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_DeleteAppInstanceStreamingConfigurations.html\">DeleteAppInstanceStreamingConfigurations</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteAppInstanceUser' => '<p>Deletes an <code>AppInstanceUser</code>.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_DeleteAppInstanceUser.html\">DeleteAppInstanceUser</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteAttendee' => '<p>Deletes an attendee from the specified Amazon Chime SDK meeting and deletes their <code>JoinToken</code>. Attendees are automatically deleted when a Amazon Chime SDK meeting is deleted. For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_DeleteAttendee.html\">DeleteAttendee</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteChannel' => '<p>Immediately makes a channel and its memberships inaccessible and marks them for deletion. This is an irreversible process.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_DeleteChannel.html\">DeleteChannel</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteChannelBan' => '<p>Removes a user from a channel\\'s ban list.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_DeleteChannelBan.html\">DeleteChannelBan</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteChannelMembership' => '<p>Removes a member from a channel.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_DeleteChannelMembership.html\">DeleteChannelMembership</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteChannelMessage' => '<p>Deletes a channel message. Only admins can perform this action. Deletion makes messages inaccessible immediately. A background process deletes any revisions created by <code>UpdateChannelMessage</code>.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_DeleteChannelMessage.html\">DeleteChannelMessage</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteChannelModerator' => '<p>Deletes a channel moderator.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_DeleteChannelModerator.html\">DeleteChannelModerator</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteEventsConfiguration' => '<p>Deletes the events configuration that allows a bot to receive outgoing events.</p>', 'DeleteMediaCapturePipeline' => '<p>Deletes the media capture pipeline.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_media-pipelines-chime_DeleteMediaCapturePipeline.html\">DeleteMediaCapturePipeline</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteMeeting' => '<p>Deletes the specified Amazon Chime SDK meeting. The operation deletes all attendees, disconnects all clients, and prevents new clients from joining the meeting. For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_DeleteMeeting.html\">DeleteMeeting</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeletePhoneNumber' => '<p>Moves the specified phone number into the <b>Deletion queue</b>. A phone number must be disassociated from any users or Amazon Chime Voice Connectors before it can be deleted.</p> <p>Deleted phone numbers remain in the <b>Deletion queue</b> for 7 days before they are deleted permanently.</p>', 'DeleteProxySession' => '<p>Deletes the specified proxy session from the specified Amazon Chime Voice Connector.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_DeleteProxySession.html\">DeleteProxySession</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteRoom' => '<p>Deletes a chat room in an Amazon Chime Enterprise account.</p>', 'DeleteRoomMembership' => '<p>Removes a member from a chat room in an Amazon Chime Enterprise account.</p>', 'DeleteSipMediaApplication' => '<p>Deletes a SIP media application.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_DeleteSipMediaApplication.html\">DeleteSipMediaApplication</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteSipRule' => '<p>Deletes a SIP rule. You must disable a SIP rule before you can delete it.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_DeleteSipRule.html\">DeleteSipRule</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteVoiceConnector' => '<p>Deletes the specified Amazon Chime Voice Connector. Any phone numbers associated with the Amazon Chime Voice Connector must be disassociated from it before it can be deleted.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_DeleteVoiceConnector.html\">DeleteVoiceConnector</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteVoiceConnectorEmergencyCallingConfiguration' => '<p>Deletes the emergency calling configuration details from the specified Amazon Chime Voice Connector.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_DeleteVoiceConnectorEmergencyCallingConfiguration.html\">DeleteVoiceConnectorEmergencyCallingConfiguration</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteVoiceConnectorGroup' => '<p>Deletes the specified Amazon Chime Voice Connector group. Any <code>VoiceConnectorItems</code> and phone numbers associated with the group must be removed before it can be deleted.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_DeleteVoiceConnectorGroup.html\">DeleteVoiceConnectorGroup</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteVoiceConnectorOrigination' => '<p>Deletes the origination settings for the specified Amazon Chime Voice Connector.</p> <note> <p>If emergency calling is configured for the Amazon Chime Voice Connector, it must be deleted prior to deleting the origination settings.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_DeleteVoiceConnectorOrigination.html\">DeleteVoiceConnectorOrigination</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteVoiceConnectorProxy' => '<p>Deletes the proxy configuration from the specified Amazon Chime Voice Connector.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_DeleteVoiceConnectorProxy.html\">DeleteVoiceProxy</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteVoiceConnectorStreamingConfiguration' => '<p>Deletes the streaming configuration for the specified Amazon Chime Voice Connector.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_DeleteVoiceConnectorStreamingConfiguration.html\">DeleteVoiceConnectorStreamingConfiguration</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteVoiceConnectorTermination' => '<p>Deletes the termination settings for the specified Amazon Chime Voice Connector.</p> <note> <p>If emergency calling is configured for the Amazon Chime Voice Connector, it must be deleted prior to deleting the termination settings.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_DeleteVoiceConnectorTermination.html\">DeleteVoiceConnectorTermination</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DeleteVoiceConnectorTerminationCredentials' => '<p>Deletes the specified SIP credentials used by your equipment to authenticate during call termination.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_DeleteVoiceConnectorTerminationCredentials.html\">DeleteVoiceConnectorTerminationCredentials</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DescribeAppInstance' => '<p>Returns the full details of an <code>AppInstance</code>.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_DescribeAppInstance.html\">DescribeAppInstance</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DescribeAppInstanceAdmin' => '<p>Returns the full details of an <code>AppInstanceAdmin</code>.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_DescribeAppInstanceAdmin.html\">DescribeAppInstanceAdmin</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DescribeAppInstanceUser' => '<p>Returns the full details of an <code>AppInstanceUser</code>.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_DescribeAppInstanceUser.html\">DescribeAppInstanceUser</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DescribeChannel' => '<p>Returns the full details of a channel in an Amazon Chime <code>AppInstance</code>.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_DescribeChannel.html\">DescribeChannel</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DescribeChannelBan' => '<p>Returns the full details of a channel ban.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_DescribeChannelBan.html\">DescribeChannelBan</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DescribeChannelMembership' => '<p>Returns the full details of a user\\'s channel membership.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_DescribeChannelMembership.html\">DescribeChannelMembership</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DescribeChannelMembershipForAppInstanceUser' => '<p> Returns the details of a channel based on the membership of the specified <code>AppInstanceUser</code>.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_DescribeChannelMembershipForAppInstanceUser.html\">DescribeChannelMembershipForAppInstanceUser</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DescribeChannelModeratedByAppInstanceUser' => '<p>Returns the full details of a channel moderated by the specified <code>AppInstanceUser</code>.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_DescribeChannelModeratedByAppInstanceUser.html\">DescribeChannelModeratedByAppInstanceUser</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DescribeChannelModerator' => '<p>Returns the full details of a single ChannelModerator.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_DescribeChannelModerator.html\">DescribeChannelModerator</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DisassociatePhoneNumberFromUser' => '<p>Disassociates the primary provisioned phone number from the specified Amazon Chime user.</p>', 'DisassociatePhoneNumbersFromVoiceConnector' => '<p>Disassociates the specified phone numbers from the specified Amazon Chime Voice Connector.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_DisassociatePhoneNumbersFromVoiceConnector.html\">DisassociatePhoneNumbersFromVoiceConnector</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DisassociatePhoneNumbersFromVoiceConnectorGroup' => '<p>Disassociates the specified phone numbers from the specified Amazon Chime Voice Connector group.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_DisassociatePhoneNumbersFromVoiceConnectorGroup.html\">DisassociatePhoneNumbersFromVoiceConnectorGroup</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'DisassociateSigninDelegateGroupsFromAccount' => '<p>Disassociates the specified sign-in delegate groups from the specified Amazon Chime account.</p>', 'GetAccount' => '<p>Retrieves details for the specified Amazon Chime account, such as account type and supported licenses.</p>', 'GetAccountSettings' => '<p>Retrieves account settings for the specified Amazon Chime account ID, such as remote control and dialout settings. For more information about these settings, see <a href=\"https://docs.aws.amazon.com/chime/latest/ag/policies.html\">Use the Policies Page</a> in the <i>Amazon Chime Administration Guide</i>. </p>', 'GetAppInstanceRetentionSettings' => '<p>Gets the retention settings for an <code>AppInstance</code>.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_GetAppInstanceRetentionSettings.html\">GetMessagingRetentionSettings</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetAppInstanceStreamingConfigurations' => '<p>Gets the streaming settings for an <code>AppInstance</code>.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_GetMessagingStreamingConfigurations.html\">GetMessagingStreamingConfigurations</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetAttendee' => '<p> Gets the Amazon Chime SDK attendee details for a specified meeting ID and attendee ID. For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime SDK Developer Guide</i>. </p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_GetAttendee.html\">GetAttendee</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetBot' => '<p>Retrieves details for the specified bot, such as bot email address, bot type, status, and display name.</p>', 'GetChannelMessage' => '<p>Gets the full details of a channel message.</p> <note> <p>The x-amz-chime-bearer request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_GetChannelMessage.html\">GetChannelMessage</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetEventsConfiguration' => '<p>Gets details for an events configuration that allows a bot to receive outgoing events, such as an HTTPS endpoint or Lambda function ARN.</p>', 'GetGlobalSettings' => '<p>Retrieves global settings for the administrator\\'s AWS account, such as Amazon Chime Business Calling and Amazon Chime Voice Connector settings.</p>', 'GetMediaCapturePipeline' => '<p>Gets an existing media capture pipeline.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_media-pipelines-chime_GetMediaCapturePipeline.html\">GetMediaCapturePipeline</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetMeeting' => '<important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_GetMeeting.html\">GetMeeting</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important> <p> Gets the Amazon Chime SDK meeting details for the specified meeting ID. For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime SDK Developer Guide</i> . </p>', 'GetMessagingSessionEndpoint' => '<p>The details of the endpoint for the messaging session.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_GetMessagingSessionEndpoint.html\">GetMessagingSessionEndpoint</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetPhoneNumber' => '<p>Retrieves details for the specified phone number ID, such as associations, capabilities, and product type.</p>', 'GetPhoneNumberOrder' => '<p>Retrieves details for the specified phone number order, such as the order creation timestamp, phone numbers in E.164 format, product type, and order status.</p>', 'GetPhoneNumberSettings' => '<p>Retrieves the phone number settings for the administrator\\'s AWS account, such as the default outbound calling name.</p>', 'GetProxySession' => '<p>Gets the specified proxy session details for the specified Amazon Chime Voice Connector.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_GetProxySession.html\">GetProxySession</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetRetentionSettings' => '<p> Gets the retention settings for the specified Amazon Chime Enterprise account. For more information about retention settings, see <a href=\"https://docs.aws.amazon.com/chime/latest/ag/chat-retention.html\">Managing Chat Retention Policies</a> in the <i>Amazon Chime Administration Guide</i>. </p>', 'GetRoom' => '<p>Retrieves room details, such as the room name, for a room in an Amazon Chime Enterprise account.</p>', 'GetSipMediaApplication' => '<p>Retrieves the information for a SIP media application, including name, AWS Region, and endpoints.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_GetSipMediaApplication.html\">GetSipMediaApplication</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetSipMediaApplicationLoggingConfiguration' => '<p>Returns the logging configuration for the specified SIP media application.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_GetSipMediaApplicationLoggingConfiguration.html\">GetSipMediaApplicationLoggingConfiguration</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetSipRule' => '<p>Retrieves the details of a SIP rule, such as the rule ID, name, triggers, and target endpoints.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_GetSipRule.html\">GetSipRule</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetUser' => '<p>Retrieves details for the specified user ID, such as primary email address, license type,and personal meeting PIN.</p> <p> To retrieve user details with an email address instead of a user ID, use the <a>ListUsers</a> action, and then filter by email address. </p>', 'GetUserSettings' => '<p>Retrieves settings for the specified user ID, such as any associated phone number settings.</p>', 'GetVoiceConnector' => '<p>Retrieves details for the specified Amazon Chime Voice Connector, such as timestamps,name, outbound host, and encryption requirements.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_GetVoiceConnector.html\">GetVoiceConnector</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetVoiceConnectorEmergencyCallingConfiguration' => '<p>Gets the emergency calling configuration details for the specified Amazon Chime Voice Connector.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_GetVoiceConnectorEmergencyCallingConfiguration.html\">GetVoiceConnectorEmergencyCallingConfiguration</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetVoiceConnectorGroup' => '<p> Retrieves details for the specified Amazon Chime Voice Connector group, such as timestamps,name, and associated <code>VoiceConnectorItems</code>.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_GetVoiceConnectorGroup.html\">GetVoiceConnectorGroup</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetVoiceConnectorLoggingConfiguration' => '<p>Retrieves the logging configuration details for the specified Amazon Chime Voice Connector. Shows whether SIP message logs are enabled for sending to Amazon CloudWatch Logs.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_GetVoiceConnectorLoggingConfiguration.html\">GetVoiceConnectorLoggingConfiguration</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetVoiceConnectorOrigination' => '<p>Retrieves origination setting details for the specified Amazon Chime Voice Connector.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_GetVoiceConnectorOrigination.html\">GetVoiceConnectorOrigination</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetVoiceConnectorProxy' => '<p>Gets the proxy configuration details for the specified Amazon Chime Voice Connector.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_GetVoiceConnectorProxy.html\">GetVoiceConnectorProxy</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetVoiceConnectorStreamingConfiguration' => '<p>Retrieves the streaming configuration details for the specified Amazon Chime Voice Connector. Shows whether media streaming is enabled for sending to Amazon Kinesis. It also shows the retention period, in hours, for the Amazon Kinesis data.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_GetVoiceConnectorStreamingConfiguration.html\">GetVoiceConnectorStreamingConfiguration</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetVoiceConnectorTermination' => '<p>Retrieves termination setting details for the specified Amazon Chime Voice Connector.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_GetVoiceConnectorTermination.html\">GetVoiceConnectorTermination</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'GetVoiceConnectorTerminationHealth' => '<important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_GetVoiceConnectorTerminationHealth.html\">GetVoiceConnectorTerminationHealth</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important> <p>Retrieves information about the last time a SIP <code>OPTIONS</code> ping was received from your SIP infrastructure for the specified Amazon Chime Voice Connector.</p>', 'InviteUsers' => '<p>Sends email to a maximum of 50 users, inviting them to the specified Amazon Chime <code>Team</code> account. Only <code>Team</code> account types are currently supported for this action.</p>', 'ListAccounts' => '<p>Lists the Amazon Chime accounts under the administrator\\'s AWS account. You can filter accounts by account name prefix. To find out which Amazon Chime account a user belongs to, you can filter by the user\\'s email address, which returns one account result.</p>', 'ListAppInstanceAdmins' => '<p>Returns a list of the administrators in the <code>AppInstance</code>.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_ListAppInstanceAdmins.html\">ListAppInstanceAdmins</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListAppInstanceUsers' => '<p>List all <code>AppInstanceUsers</code> created under a single <code>AppInstance</code>. </p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_ListAppInstanceUsers.html\">ListAppInstanceUsers</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListAppInstances' => '<p>Lists all Amazon Chime <code>AppInstance</code>s created under a single AWS account.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_ListAppInstances.html\">ListAppInstances</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListAttendeeTags' => '<p>Lists the tags applied to an Amazon Chime SDK attendee resource.</p> <important> <p>ListAttendeeTags is not supported in the Amazon Chime SDK Meetings Namespace. Update your application to remove calls to this API.</p> </important>', 'ListAttendees' => '<p> Lists the attendees for the specified Amazon Chime SDK meeting. For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime SDK Developer Guide</i>. </p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_ListAttendees.html\">ListAttendees</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListBots' => '<p>Lists the bots associated with the administrator\\'s Amazon Chime Enterprise account ID.</p>', 'ListChannelBans' => '<p>Lists all the users banned from a particular channel.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_ListChannelBans.html\">ListChannelBans</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListChannelMemberships' => '<p>Lists all channel memberships in a channel.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_ListChannelMemberships.html\">ListChannelMemberships</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListChannelMembershipsForAppInstanceUser' => '<p> Lists all channels that a particular <code>AppInstanceUser</code> is a part of. Only an <code>AppInstanceAdmin</code> can call the API with a user ARN that is not their own. </p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_ListChannelMembershipsForAppInstanceUser.html\">ListChannelMembershipsForAppInstanceUser</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListChannelMessages' => '<p>List all the messages in a channel. Returns a paginated list of <code>ChannelMessages</code>. By default, sorted by creation timestamp in descending order.</p> <note> <p>Redacted messages appear in the results as empty, since they are only redacted, not deleted. Deleted messages do not appear in the results. This action always returns the latest version of an edited message.</p> <p>Also, the x-amz-chime-bearer request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_ListChannelMessages.html\">ListChannelMessages</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListChannelModerators' => '<p>Lists all the moderators for a channel.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_ListChannelModerators.html\">ListChannelModerators</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListChannels' => '<p>Lists all Channels created under a single Chime App as a paginated list. You can specify filters to narrow results.</p> <p class=\"title\"> <b>Functionality &amp; restrictions</b> </p> <ul> <li> <p>Use privacy = <code>PUBLIC</code> to retrieve all public channels in the account.</p> </li> <li> <p>Only an <code>AppInstanceAdmin</code> can set privacy = <code>PRIVATE</code> to list the private channels in an account.</p> </li> </ul> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_ListChannels.html\">ListChannels</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListChannelsModeratedByAppInstanceUser' => '<p>A list of the channels moderated by an <code>AppInstanceUser</code>.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_ListChannelsModeratedByAppInstanceUser.html\">ListChannelsModeratedByAppInstanceUser</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListMediaCapturePipelines' => '<p>Returns a list of media capture pipelines.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_media-pipelines-chime_ListMediaCapturePipelines.html\">ListMediaCapturePipelines</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListMeetingTags' => '<p>Lists the tags applied to an Amazon Chime SDK meeting resource.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_ListTagsForResource.html\">ListTagsForResource</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListMeetings' => '<p>Lists up to 100 active Amazon Chime SDK meetings.</p> <important> <p>ListMeetings is not supported in the Amazon Chime SDK Meetings Namespace. Update your application to remove calls to this API.</p> </important> <p>For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p>', 'ListPhoneNumberOrders' => '<p>Lists the phone number orders for the administrator\\'s Amazon Chime account.</p>', 'ListPhoneNumbers' => '<p>Lists the phone numbers for the specified Amazon Chime account, Amazon Chime user, Amazon Chime Voice Connector, or Amazon Chime Voice Connector group.</p>', 'ListProxySessions' => '<p>Lists the proxy sessions for the specified Amazon Chime Voice Connector.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_ListProxySessions.html\">ListProxySessions</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListRoomMemberships' => '<p>Lists the membership details for the specified room in an Amazon Chime Enterprise account, such as the members\\' IDs, email addresses, and names.</p>', 'ListRooms' => '<p>Lists the room details for the specified Amazon Chime Enterprise account. Optionally, filter the results by a member ID (user ID or bot ID) to see a list of rooms that the member belongs to.</p>', 'ListSipMediaApplications' => '<p>Lists the SIP media applications under the administrator\\'s AWS account.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_ListSipMediaApplications.html\">ListSipMediaApplications</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListSipRules' => '<p>Lists the SIP rules under the administrator\\'s AWS account.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_ListSipRules.html\">ListSipRules</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListSupportedPhoneNumberCountries' => '<p>Lists supported phone number countries.</p>', 'ListTagsForResource' => '<p>Lists the tags applied to an Amazon Chime SDK meeting and messaging resources.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the applicable latest version in the Amazon Chime SDK.</p> <ul> <li> <p>For meetings: <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_ListTagsForResource.html\">ListTagsForResource</a>.</p> </li> <li> <p>For messaging: <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_ListTagsForResource.html\">ListTagsForResource</a>.</p> </li> </ul> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListUsers' => '<p>Lists the users that belong to the specified Amazon Chime account. You can specify an email address to list only the user that the email address belongs to.</p>', 'ListVoiceConnectorGroups' => '<p>Lists the Amazon Chime Voice Connector groups for the administrator\\'s AWS account.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_ListVoiceConnectorGroups.html\">ListVoiceConnectorGroups</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListVoiceConnectorTerminationCredentials' => '<p>Lists the SIP credentials for the specified Amazon Chime Voice Connector.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_ListVoiceConnectorTerminationCredentials.html\">ListVoiceConnectorTerminationCredentials</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ListVoiceConnectors' => '<p>Lists the Amazon Chime Voice Connectors for the administrator\\'s AWS account.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_ListVoiceConnectors.html\">ListVoiceConnectors</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'LogoutUser' => '<p>Logs out the specified user from all of the devices they are currently logged into.</p>', 'PutAppInstanceRetentionSettings' => '<p>Sets the amount of time in days that a given <code>AppInstance</code> retains data.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_PutAppInstanceRetentionSettings.html\">PutAppInstanceRetentionSettings</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'PutAppInstanceStreamingConfigurations' => '<p>The data streaming configurations of an <code>AppInstance</code>.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_PutMessagingStreamingConfigurations.html\">PutMessagingStreamingConfigurations</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'PutEventsConfiguration' => '<p>Creates an events configuration that allows a bot to receive outgoing events sent by Amazon Chime. Choose either an HTTPS endpoint or a Lambda function ARN. For more information, see <a>Bot</a>.</p>', 'PutRetentionSettings' => '<p> Puts retention settings for the specified Amazon Chime Enterprise account. We recommend using AWS CloudTrail to monitor usage of this API for your account. For more information, see <a href=\"https://docs.aws.amazon.com/chime/latest/ag/cloudtrail.html\">Logging Amazon Chime API Calls with AWS CloudTrail</a> in the <i>Amazon Chime Administration Guide</i>.</p> <p> To turn off existing retention settings, remove the number of days from the corresponding <b>RetentionDays</b> field in the <b>RetentionSettings</b> object. For more information about retention settings, see <a href=\"https://docs.aws.amazon.com/chime/latest/ag/chat-retention.html\">Managing Chat Retention Policies</a> in the <i>Amazon Chime Administration Guide</i>.</p>', 'PutSipMediaApplicationLoggingConfiguration' => '<p>Updates the logging configuration for the specified SIP media application.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_PutSipMediaApplicationLoggingConfiguration.html\">PutSipMediaApplicationLoggingConfiguration</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'PutVoiceConnectorEmergencyCallingConfiguration' => '<p>Puts emergency calling configuration details to the specified Amazon Chime Voice Connector, such as emergency phone numbers and calling countries. Origination and termination settings must be enabled for the Amazon Chime Voice Connector before emergency calling can be configured.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_PutVoiceConnectorEmergencyCallingConfiguration.html\">PutVoiceConnectorEmergencyCallingConfiguration</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'PutVoiceConnectorLoggingConfiguration' => '<p>Adds a logging configuration for the specified Amazon Chime Voice Connector. The logging configuration specifies whether SIP message logs are enabled for sending to Amazon CloudWatch Logs.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_PutVoiceConnectorLoggingConfiguration.html\">PutVoiceConnectorLoggingConfiguration</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'PutVoiceConnectorOrigination' => '<p>Adds origination settings for the specified Amazon Chime Voice Connector.</p> <note> <p>If emergency calling is configured for the Amazon Chime Voice Connector, it must be deleted prior to turning off origination settings.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_PutVoiceConnectorOrigination.html\">PutVoiceConnectorOrigination</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'PutVoiceConnectorProxy' => '<p>Puts the specified proxy configuration to the specified Amazon Chime Voice Connector.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_PutVoiceConnectorProxy.html\">PutVoiceConnectorProxy</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'PutVoiceConnectorStreamingConfiguration' => '<p>Adds a streaming configuration for the specified Amazon Chime Voice Connector. The streaming configuration specifies whether media streaming is enabled for sending to Kinesis. It also sets the retention period, in hours, for the Amazon Kinesis data.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_PutVoiceConnectorStreamingConfiguration.html\">PutVoiceConnectorStreamingConfiguration</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'PutVoiceConnectorTermination' => '<p>Adds termination settings for the specified Amazon Chime Voice Connector.</p> <note> <p>If emergency calling is configured for the Amazon Chime Voice Connector, it must be deleted prior to turning off termination settings.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_PutVoiceConnectorTermination.html\">PutVoiceConnectorTermination</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'PutVoiceConnectorTerminationCredentials' => '<p>Adds termination SIP credentials for the specified Amazon Chime Voice Connector.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_PutVoiceConnectorTerminationCredentials.html\">PutVoiceConnectorTerminationCredentials</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'RedactChannelMessage' => '<p>Redacts message content, but not metadata. The message exists in the back end, but the action returns null content, and the state shows as redacted.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_RedactChannelMessage.html\">RedactChannelMessage</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'RedactConversationMessage' => '<p>Redacts the specified message from the specified Amazon Chime conversation.</p>', 'RedactRoomMessage' => '<p>Redacts the specified message from the specified Amazon Chime channel.</p>', 'RegenerateSecurityToken' => '<p>Regenerates the security token for a bot.</p>', 'ResetPersonalPIN' => '<p>Resets the personal meeting PIN for the specified user on an Amazon Chime account. Returns the <a>User</a> object with the updated personal meeting PIN.</p>', 'RestorePhoneNumber' => '<p>Moves a phone number from the <b>Deletion queue</b> back into the phone number <b>Inventory</b>.</p>', 'SearchAvailablePhoneNumbers' => '<p>Searches for phone numbers that can be ordered. For US numbers, provide at least one of the following search filters: <code>AreaCode</code>, <code>City</code>, <code>State</code>, or <code>TollFreePrefix</code>. If you provide <code>City</code>, you must also provide <code>State</code>. Numbers outside the US only support the <code>PhoneNumberType</code> filter, which you must use.</p>', 'SendChannelMessage' => '<p>Sends a message to a particular channel that the member is a part of.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> <p>Also, <code>STANDARD</code> messages can contain 4KB of data and the 1KB of metadata. <code>CONTROL</code> messages can contain 30 bytes of data and no metadata.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_SendChannelMessage.html\">SendChannelMessage</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'StartMeetingTranscription' => '<p>Starts transcription for the specified <code>meetingId</code>. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/meeting-transcription.html\"> Using Amazon Chime SDK live transcription </a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> <p>If you specify an invalid configuration, a <code>TranscriptFailed</code> event will be sent with the contents of the <code>BadRequestException</code> generated by Amazon Transcribe. For more information on each parameter and which combinations are valid, refer to the <a href=\"https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartStreamTranscription.html\">StartStreamTranscription</a> API in the <i>Amazon Transcribe Developer Guide</i>.</p> <note> <p>Amazon Chime SDK live transcription is powered by Amazon Transcribe. Use of Amazon Transcribe is subject to the <a href=\"https://aws.amazon.com/service-terms/\">AWS Service Terms</a>, including the terms specific to the AWS Machine Learning and Artificial Intelligence Services.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_StartMeetingTranscription.html\">StartMeetingTranscription</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'StopMeetingTranscription' => '<p>Stops transcription for the specified <code>meetingId</code>.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_StopMeetingTranscription.html\">StopMeetingTranscription</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'TagAttendee' => '<p>Applies the specified tags to the specified Amazon Chime attendee.</p> <important> <p>TagAttendee is not supported in the Amazon Chime SDK Meetings Namespace. Update your application to remove calls to this API.</p> </important>', 'TagMeeting' => '<p>Applies the specified tags to the specified Amazon Chime SDK meeting.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_TagResource.html\">TagResource</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'TagResource' => '<p>Applies the specified tags to the specified Amazon Chime SDK meeting resource.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_TagResource.html\">TagResource</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'UntagAttendee' => '<p>Untags the specified tags from the specified Amazon Chime SDK attendee.</p> <important> <p>UntagAttendee is not supported in the Amazon Chime SDK Meetings Namespace. Update your application to remove calls to this API.</p> </important>', 'UntagMeeting' => '<p>Untags the specified tags from the specified Amazon Chime SDK meeting.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_UntagResource.html\">UntagResource</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'UntagResource' => '<p>Untags the specified tags from the specified Amazon Chime SDK meeting resource.</p> <p>Applies the specified tags to the specified Amazon Chime SDK meeting resource.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_UntagResource.html\">UntagResource</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'UpdateAccount' => '<p>Updates account details for the specified Amazon Chime account. Currently, only account name and default license updates are supported for this action.</p>', 'UpdateAccountSettings' => '<p>Updates the settings for the specified Amazon Chime account. You can update settings for remote control of shared screens, or for the dial-out option. For more information about these settings, see <a href=\"https://docs.aws.amazon.com/chime/latest/ag/policies.html\">Use the Policies Page</a> in the <i>Amazon Chime Administration Guide</i>.</p>', 'UpdateAppInstance' => '<p>Updates <code>AppInstance</code> metadata.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_UpdateAppInstance.html\">UpdateAppInstance</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'UpdateAppInstanceUser' => '<p>Updates the details of an <code>AppInstanceUser</code>. You can update names and metadata.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_UpdateAppInstanceUser.html\">UpdateAppInstanceUser</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'UpdateBot' => '<p>Updates the status of the specified bot, such as starting or stopping the bot from running in your Amazon Chime Enterprise account.</p>', 'UpdateChannel' => '<p>Update a channel\\'s attributes.</p> <p> <b>Restriction</b>: You can\\'t change a channel\\'s privacy. </p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_UpdateChannel.html\">UpdateChannel</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'UpdateChannelMessage' => '<p>Updates the content of a message.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_UpdateChannelMessage.html\">UpdateChannelMessage</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'UpdateChannelReadMarker' => '<p>The details of the time when a user last read messages in a channel.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_UpdateChannelReadMarker.html\">UpdateChannelReadMarker</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'UpdateGlobalSettings' => '<p>Updates global settings for the administrator\\'s AWS account, such as Amazon Chime Business Calling and Amazon Chime Voice Connector settings.</p>', 'UpdatePhoneNumber' => '<p>Updates phone number details, such as product type or calling name, for the specified phone number ID. You can update one phone number detail at a time. For example, you can update either the product type or the calling name in one action.</p> <p>For toll-free numbers, you cannot use the Amazon Chime Business Calling product type. For numbers outside the U.S., you must use the Amazon Chime SIP Media Application Dial-In product type.</p> <p>Updates to outbound calling names can take 72 hours to complete. Pending updates to outbound calling names must be complete before you can request another update.</p>', 'UpdatePhoneNumberSettings' => '<p>Updates the phone number settings for the administrator\\'s AWS account, such as the default outbound calling name. You can update the default outbound calling name once every seven days. Outbound calling names can take up to 72 hours to update.</p>', 'UpdateProxySession' => '<p>Updates the specified proxy session details, such as voice or SMS capabilities.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_UpdateProxySession.html\">UpdateProxySession</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'UpdateRoom' => '<p>Updates room details, such as the room name, for a room in an Amazon Chime Enterprise account.</p>', 'UpdateRoomMembership' => '<p>Updates room membership details, such as the member role, for a room in an Amazon Chime Enterprise account. The member role designates whether the member is a chat room administrator or a general chat room member. The member role can be updated only for user IDs.</p>', 'UpdateSipMediaApplication' => '<p>Updates the details of the specified SIP media application.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_UpdateSipMediaApplication.html\">UpdateSipMediaApplication</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'UpdateSipMediaApplicationCall' => '<p>Invokes the AWS Lambda function associated with the SIP media application and transaction ID in an update request. The Lambda function can then return a new set of actions.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_UpdateSipMediaApplicationCall.html\">UpdateSipMediaApplicationCall</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'UpdateSipRule' => '<p>Updates the details of the specified SIP rule.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_UpdateSipRule.html\">UpdateSipRule</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'UpdateUser' => '<p>Updates user details for a specified user ID. Currently, only <code>LicenseType</code> updates are supported for this action.</p>', 'UpdateUserSettings' => '<p>Updates the settings for the specified user, such as phone number settings.</p>', 'UpdateVoiceConnector' => '<p>Updates details for the specified Amazon Chime Voice Connector.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_UpdateVoiceConnector.html\">UpdateVoiceConnector</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'UpdateVoiceConnectorGroup' => '<p>Updates details of the specified Amazon Chime Voice Connector group, such as the name and Amazon Chime Voice Connector priority ranking.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_UpdateVoiceConnectorGroup.html\">UpdateVoiceConnectorGroup</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', 'ValidateE911Address' => '<p>Validates an address to be used for 911 calls made with Amazon Chime Voice Connectors. You can use validated addresses in a Presence Information Data Format Location Object file that you include in SIP requests. That helps ensure that addresses are routed to the appropriate Public Safety Answering Point.</p> <important> <p> <b>This API is is no longer supported and will not be updated.</b> We recommend using the latest version, <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_voice-chime_ValidateE911Address.html\">ValidateE911Address</a>, in the Amazon Chime SDK.</p> <p>Using the latest version requires migrating to a dedicated namespace. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html\">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> </important>', ], 'shapes' => [ 'AccessDeniedException' => [ 'base' => '<p>You don\\'t have permissions to perform the requested operation.</p>', 'refs' => [], ], 'Account' => [ 'base' => '<p>The Amazon Chime account details. An AWS account can have multiple Amazon Chime accounts.</p>', 'refs' => [ 'AccountList$member' => NULL, 'CreateAccountResponse$Account' => '<p>The Amazon Chime account details.</p>', 'GetAccountResponse$Account' => '<p>The Amazon Chime account details.</p>', 'UpdateAccountResponse$Account' => '<p>The updated Amazon Chime account details.</p>', ], ], 'AccountList' => [ 'base' => NULL, 'refs' => [ 'ListAccountsResponse$Accounts' => '<p>List of Amazon Chime accounts and account details.</p>', ], ], 'AccountName' => [ 'base' => NULL, 'refs' => [ 'CreateAccountRequest$Name' => '<p>The name of the Amazon Chime account.</p>', 'ListAccountsRequest$Name' => '<p>Amazon Chime account name prefix with which to filter results.</p>', 'UpdateAccountRequest$Name' => '<p>The new name for the specified Amazon Chime account.</p>', ], ], 'AccountSettings' => [ 'base' => '<p>Settings related to the Amazon Chime account. This includes settings that start or stop remote control of shared screens, or start or stop the dial-out option in the Amazon Chime web application. For more information about these settings, see <a href=\"https://docs.aws.amazon.com/chime/latest/ag/policies.html\">Use the Policies Page</a> in the <i>Amazon Chime Administration Guide</i>.</p>', 'refs' => [ 'GetAccountSettingsResponse$AccountSettings' => '<p>The Amazon Chime account settings.</p>', 'UpdateAccountSettingsRequest$AccountSettings' => '<p>The Amazon Chime account settings to update.</p>', ], ], 'AccountStatus' => [ 'base' => NULL, 'refs' => [ 'Account$AccountStatus' => '<p>The status of the account.</p>', ], ], 'AccountType' => [ 'base' => NULL, 'refs' => [ 'Account$AccountType' => '<p>The Amazon Chime account type. For more information about different account types, see <a href=\"https://docs.aws.amazon.com/chime/latest/ag/manage-chime-account.html\">Managing Your Amazon Chime Accounts</a> in the <i>Amazon Chime Administration Guide</i>.</p>', ], ], 'Address' => [ 'base' => '<p>A validated address.</p>', 'refs' => [ 'ValidateE911AddressResponse$Address' => '<p>The validated address.</p>', ], ], 'AlexaForBusinessMetadata' => [ 'base' => '<p>The Alexa for Business metadata associated with an Amazon Chime user, used to integrate Alexa for Business with a device.</p>', 'refs' => [ 'UpdateUserRequest$AlexaForBusinessMetadata' => '<p>The Alexa for Business metadata.</p>', 'UpdateUserRequestItem$AlexaForBusinessMetadata' => '<p>The Alexa for Business metadata.</p>', 'User$AlexaForBusinessMetadata' => '<p>The Alexa for Business metadata.</p>', ], ], 'Alpha2CountryCode' => [ 'base' => NULL, 'refs' => [ 'DNISEmergencyCallingConfiguration$CallingCountry' => '<p>The country from which emergency calls are allowed, in ISO 3166-1 alpha-2 format.</p>', 'PhoneNumber$Country' => '<p>The phone number country. Format: ISO 3166-1 alpha-2.</p>', 'PhoneNumberCountry$CountryCode' => '<p>The phone number country code. Format: ISO 3166-1 alpha-2.</p>', 'SearchAvailablePhoneNumbersRequest$Country' => '<p>The country used to filter results. Defaults to the US Format: ISO 3166-1 alpha-2.</p>', ], ], 'AppInstance' => [ 'base' => '<p>The details of an <code>AppInstance</code>, an instance of an Amazon Chime SDK messaging application.</p>', 'refs' => [ 'DescribeAppInstanceResponse$AppInstance' => '<p>The ARN, metadata, created and last-updated timestamps, and the name of the <code>AppInstance</code>. All timestamps use epoch milliseconds.</p>', ], ], 'AppInstanceAdmin' => [ 'base' => '<p>The details of an <code>AppInstanceAdmin</code>.</p>', 'refs' => [ 'DescribeAppInstanceAdminResponse$AppInstanceAdmin' => '<p>The ARN and name of the <code>AppInstanceUser</code>, the ARN of the <code>AppInstance</code>, and the created and last-updated timestamps. All timestamps use epoch milliseconds.</p>', ], ], 'AppInstanceAdminList' => [ 'base' => NULL, 'refs' => [ 'ListAppInstanceAdminsResponse$AppInstanceAdmins' => '<p>The information for each administrator.</p>', ], ], 'AppInstanceAdminSummary' => [ 'base' => '<p>Summary of the details of an <code>AppInstanceAdmin</code>.</p>', 'refs' => [ 'AppInstanceAdminList$member' => NULL, ], ], 'AppInstanceDataType' => [ 'base' => NULL, 'refs' => [ 'AppInstanceStreamingConfiguration$AppInstanceDataType' => '<p>The type of data to be streamed.</p>', ], ], 'AppInstanceList' => [ 'base' => NULL, 'refs' => [ 'ListAppInstancesResponse$AppInstances' => '<p>The information for each <code>AppInstance</code>.</p>', ], ], 'AppInstanceRetentionSettings' => [ 'base' => '<p>The details of the data-retention settings for an <code>AppInstance</code>.</p>', 'refs' => [ 'GetAppInstanceRetentionSettingsResponse$AppInstanceRetentionSettings' => '<p>The retention settings for the <code>AppInstance</code>.</p>', 'PutAppInstanceRetentionSettingsRequest$AppInstanceRetentionSettings' => '<p>The time in days to retain data. Data type: number.</p>', 'PutAppInstanceRetentionSettingsResponse$AppInstanceRetentionSettings' => '<p>The time in days to retain data. Data type: number.</p>', ], ], 'AppInstanceStreamingConfiguration' => [ 'base' => '<p>The details of the streaming configuration of an <code>AppInstance</code>.</p>', 'refs' => [ 'AppInstanceStreamingConfigurationList$member' => NULL, ], ], 'AppInstanceStreamingConfigurationList' => [ 'base' => NULL, 'refs' => [ 'GetAppInstanceStreamingConfigurationsResponse$AppInstanceStreamingConfigurations' => '<p>The streaming settings.</p>', 'PutAppInstanceStreamingConfigurationsRequest$AppInstanceStreamingConfigurations' => '<p>The streaming configurations set for an <code>AppInstance</code>.</p>', 'PutAppInstanceStreamingConfigurationsResponse$AppInstanceStreamingConfigurations' => '<p>The streaming configurations of an <code>AppInstance</code>.</p>', ], ], 'AppInstanceSummary' => [ 'base' => '<p>Summary of the data for an <code>AppInstance</code>.</p>', 'refs' => [ 'AppInstanceList$member' => NULL, ], ], 'AppInstanceUser' => [ 'base' => '<p>The details of an <code>AppInstanceUser</code>.</p>', 'refs' => [ 'DescribeAppInstanceUserResponse$AppInstanceUser' => '<p>The name of the <code>AppInstanceUser</code>.</p>', ], ], 'AppInstanceUserList' => [ 'base' => NULL, 'refs' => [ 'ListAppInstanceUsersResponse$AppInstanceUsers' => '<p>The information for each requested <code>AppInstanceUser</code>.</p>', ], ], 'AppInstanceUserMembershipSummary' => [ 'base' => '<p>Summary of the membership details of an <code>AppInstanceUser</code>.</p>', 'refs' => [ 'ChannelMembershipForAppInstanceUserSummary$AppInstanceUserMembershipSummary' => '<p>Summary of the membership details of an <code>AppInstanceUser</code>.</p>', ], ], 'AppInstanceUserSummary' => [ 'base' => '<p>Summary of the details of an <code>AppInstanceUser</code>.</p>', 'refs' => [ 'AppInstanceUserList$member' => NULL, ], ], 'AreaCode' => [ 'base' => NULL, 'refs' => [ 'GeoMatchParams$AreaCode' => '<p>The area code.</p>', ], ], 'Arn' => [ 'base' => NULL, 'refs' => [ 'AppInstanceStreamingConfiguration$ResourceArn' => '<p>The resource ARN.</p>', 'CreateMediaCapturePipelineRequest$SourceArn' => '<p>ARN of the source from which the media artifacts are captured.</p>', 'CreateMediaCapturePipelineRequest$SinkArn' => '<p>The ARN of the sink type.</p>', 'ListTagsForResourceRequest$ResourceARN' => '<p>The resource ARN.</p>', 'MediaCapturePipeline$SourceArn' => '<p>ARN of the source from which the media artifacts will be saved.</p>', 'MediaCapturePipeline$SinkArn' => '<p>ARN of the destination to which the media artifacts are saved.</p>', 'MeetingNotificationConfiguration$SnsTopicArn' => '<p>The SNS topic ARN.</p>', 'MeetingNotificationConfiguration$SqsQueueArn' => '<p>The SQS queue ARN.</p>', 'TagResourceRequest$ResourceARN' => '<p>The resource ARN.</p>', 'UntagResourceRequest$ResourceARN' => '<p>The resource ARN.</p>', ], ], 'ArtifactsConfiguration' => [ 'base' => '<p>The configuration for the artifacts.</p>', 'refs' => [ 'ChimeSdkMeetingConfiguration$ArtifactsConfiguration' => '<p>The configuration for the artifacts in an Amazon Chime SDK meeting.</p>', ], ], 'ArtifactsState' => [ 'base' => NULL, 'refs' => [ 'ContentArtifactsConfiguration$State' => '<p>Indicates whether the content artifact is enabled or disabled.</p>', 'VideoArtifactsConfiguration$State' => '<p>Indicates whether the video artifact is enabled or disabled.</p>', ], ], 'AssociatePhoneNumberWithUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'AssociatePhoneNumberWithUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'AssociatePhoneNumbersWithVoiceConnectorGroupRequest' => [ 'base' => NULL, 'refs' => [], ], 'AssociatePhoneNumbersWithVoiceConnectorGroupResponse' => [ 'base' => NULL, 'refs' => [], ], 'AssociatePhoneNumbersWithVoiceConnectorRequest' => [ 'base' => NULL, 'refs' => [], ], 'AssociatePhoneNumbersWithVoiceConnectorResponse' => [ 'base' => NULL, 'refs' => [], ], 'AssociateSigninDelegateGroupsWithAccountRequest' => [ 'base' => NULL, 'refs' => [], ], 'AssociateSigninDelegateGroupsWithAccountResponse' => [ 'base' => NULL, 'refs' => [], ], 'Attendee' => [ 'base' => '<p> An Amazon Chime SDK meeting attendee. Includes a unique <code>AttendeeId</code> and <code>JoinToken</code> . The <code>JoinToken</code> allows a client to authenticate and join as the specified attendee. The <code>JoinToken</code> expires when the meeting ends or when <a>DeleteAttendee</a> is called. After that, the attendee is unable to join the meeting. </p> <p>We recommend securely transferring each <code>JoinToken</code> from your server application to the client so that no other client has access to the token except for the one authorized to represent the attendee.</p>', 'refs' => [ 'AttendeeList$member' => NULL, 'CreateAttendeeResponse$Attendee' => '<p>The attendee information, including attendee ID and join token.</p>', 'GetAttendeeResponse$Attendee' => '<p>The Amazon Chime SDK attendee information.</p>', ], ], 'AttendeeIdList' => [ 'base' => NULL, 'refs' => [ 'SelectedVideoStreams$AttendeeIds' => '<p>The attendee IDs of the streams selected for a media capture pipeline. </p>', ], ], 'AttendeeList' => [ 'base' => NULL, 'refs' => [ 'BatchCreateAttendeeResponse$Attendees' => '<p>The attendee information, including attendees IDs and join tokens.</p>', 'CreateMeetingWithAttendeesResponse$Attendees' => '<p>The attendee information, including attendees IDs and join tokens.</p>', 'ListAttendeesResponse$Attendees' => '<p>The Amazon Chime SDK attendee information.</p>', ], ], 'AttendeeTagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagAttendeeRequest$TagKeys' => '<p>The tag keys.</p>', ], ], 'AttendeeTagList' => [ 'base' => NULL, 'refs' => [ 'CreateAttendeeRequest$Tags' => '<p>The tag key-value pairs.</p>', 'CreateAttendeeRequestItem$Tags' => '<p>The tag key-value pairs.</p>', 'TagAttendeeRequest$Tags' => '<p>The tag key-value pairs.</p>', ], ], 'AudioArtifactsConfiguration' => [ 'base' => '<p>The audio artifact configuration object.</p>', 'refs' => [ 'ArtifactsConfiguration$Audio' => '<p>The configuration for the audio artifacts.</p>', ], ], 'AudioMuxType' => [ 'base' => NULL, 'refs' => [ 'AudioArtifactsConfiguration$MuxType' => '<p>The MUX type of the audio artifact configuration object.</p>', ], ], 'BadRequestException' => [ 'base' => '<p>The input parameters don\\'t match the service\\'s restrictions.</p>', 'refs' => [], ], 'BatchChannelMemberships' => [ 'base' => '<p>The membership information, including member ARNs, the channel ARN, and membership types.</p>', 'refs' => [ 'BatchCreateChannelMembershipResponse$BatchChannelMemberships' => '<p>The list of channel memberships in the response.</p>', ], ], 'BatchCreateAttendeeErrorList' => [ 'base' => NULL, 'refs' => [ 'BatchCreateAttendeeResponse$Errors' => '<p>If the action fails for one or more of the attendees in the request, a list of the attendees is returned, along with error codes and error messages.</p>', 'CreateMeetingWithAttendeesResponse$Errors' => '<p>If the action fails for one or more of the attendees in the request, a list of the attendees is returned, along with error codes and error messages.</p>', ], ], 'BatchCreateAttendeeRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchCreateAttendeeResponse' => [ 'base' => NULL, 'refs' => [], ], 'BatchCreateChannelMembershipError' => [ 'base' => '<p>A list of failed member ARNs, error codes, and error messages.</p>', 'refs' => [ 'BatchCreateChannelMembershipErrors$member' => NULL, ], ], 'BatchCreateChannelMembershipErrors' => [ 'base' => NULL, 'refs' => [ 'BatchCreateChannelMembershipResponse$Errors' => '<p>If the action fails for one or more of the memberships in the request, a list of the memberships is returned, along with error codes and error messages.</p>', ], ], 'BatchCreateChannelMembershipRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchCreateChannelMembershipResponse' => [ 'base' => NULL, 'refs' => [], ], 'BatchCreateRoomMembershipRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchCreateRoomMembershipResponse' => [ 'base' => NULL, 'refs' => [], ], 'BatchDeletePhoneNumberRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchDeletePhoneNumberResponse' => [ 'base' => NULL, 'refs' => [], ], 'BatchSuspendUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchSuspendUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'BatchUnsuspendUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchUnsuspendUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'BatchUpdatePhoneNumberRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchUpdatePhoneNumberResponse' => [ 'base' => NULL, 'refs' => [], ], 'BatchUpdateUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchUpdateUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'Boolean' => [ 'base' => NULL, 'refs' => [ 'AccountSettings$DisableRemoteControl' => '<p>Setting that stops or starts remote control of shared screens during meetings.</p>', 'AccountSettings$EnableDialOut' => '<p>Setting that allows meeting participants to choose the <b>Call me at a phone number</b> option. For more information, see <a href=\"https://docs.aws.amazon.com/chime/latest/ug/chime-join-meeting.html\">Join a Meeting without the Amazon Chime App</a>.</p>', 'AlexaForBusinessMetadata$IsAlexaForBusinessEnabled' => '<p>Starts or stops Alexa for Business.</p>', 'CreateVoiceConnectorRequest$RequireEncryption' => '<p>When enabled, requires encryption for the Amazon Chime Voice Connector.</p>', 'EngineTranscribeSettings$EnablePartialResultsStabilization' => '<p>Enables partial result stabilization for your transcription. Partial result stabilization can reduce latency in your output, but may impact accuracy.</p>', 'EngineTranscribeSettings$IdentifyLanguage' => '<p>Enables automatic language identification for your transcription.</p> <p>If you include <code>IdentifyLanguage</code>, you can optionally use <code>LanguageOptions</code> to include a list of language codes that you think may be present in your audio stream. Including language options can improve transcription accuracy.</p> <p>You can also use <code>PreferredLanguage</code> to include a preferred language. Doing so can help Amazon Transcribe identify the language faster.</p> <p>You must include either <code>LanguageCode</code> or <code>IdentifyLanguage</code>.</p> <p>Language identification can\\'t be combined with custom language models or redaction.</p>', 'LoggingConfiguration$EnableSIPLogs' => '<p>Boolean that enables SIP message logs to Amazon CloudWatch logs.</p>', 'LoggingConfiguration$EnableMediaMetricLogs' => '<p>Boolean that enables logging of detailed media metrics for Voice Connectors to Amazon CloudWatch logs.</p>', 'Origination$Disabled' => '<p>When origination settings are disabled, inbound calls are not enabled for your Amazon Chime Voice Connector. This parameter is not required, but you must specify this parameter or <code>Routes</code>.</p>', 'Proxy$Disabled' => '<p>When true, stops proxy sessions from being created on the specified Amazon Chime Voice Connector.</p>', 'PutVoiceConnectorProxyRequest$Disabled' => '<p>When true, stops proxy sessions from being created on the specified Amazon Chime Voice Connector.</p>', 'SipMediaApplicationLoggingConfiguration$EnableSipMediaApplicationMessageLogs' => '<p>Enables application message logs for the SIP media application.</p>', 'SipRule$Disabled' => '<p>Indicates whether the SIP rule is enabled or disabled. You must disable a rule before you can delete it.</p>', 'StreamingConfiguration$Disabled' => '<p>When true, media streaming to Amazon Kinesis is turned off.</p>', 'TelephonySettings$InboundCalling' => '<p>Allows or denies inbound calling.</p>', 'TelephonySettings$OutboundCalling' => '<p>Allows or denies outbound calling.</p>', 'TelephonySettings$SMS' => '<p>Allows or denies SMS messaging.</p>', 'Termination$Disabled' => '<p>When termination settings are disabled, outbound calls can not be made.</p>', 'UpdateVoiceConnectorRequest$RequireEncryption' => '<p>When enabled, requires encryption for the Amazon Chime Voice Connector.</p>', 'VoiceConnector$RequireEncryption' => '<p>Designates whether encryption is required for the Amazon Chime Voice Connector.</p>', ], ], 'Bot' => [ 'base' => '<p>A resource that allows Enterprise account administrators to configure an interface to receive events from Amazon Chime.</p>', 'refs' => [ 'BotList$member' => NULL, 'CreateBotResponse$Bot' => '<p>The bot details.</p>', 'GetBotResponse$Bot' => '<p>The chat bot details.</p>', 'RegenerateSecurityTokenResponse$Bot' => '<p>A resource that allows Enterprise account administrators to configure an interface that receives events from Amazon Chime.</p>', 'UpdateBotResponse$Bot' => '<p>The updated bot details.</p>', ], ], 'BotList' => [ 'base' => NULL, 'refs' => [ 'ListBotsResponse$Bots' => '<p>List of bots and bot details.</p>', ], ], 'BotType' => [ 'base' => NULL, 'refs' => [ 'Bot$BotType' => '<p>The bot type.</p>', ], ], 'BusinessCallingSettings' => [ 'base' => '<p>The Amazon Chime Business Calling settings for the administrator\\'s AWS account. Includes any Amazon S3 buckets designated for storing call detail records.</p>', 'refs' => [ 'GetGlobalSettingsResponse$BusinessCalling' => '<p>The Amazon Chime Business Calling settings.</p>', 'UpdateGlobalSettingsRequest$BusinessCalling' => '<p>The Amazon Chime Business Calling settings.</p>', ], ], 'CallingName' => [ 'base' => NULL, 'refs' => [ 'GetPhoneNumberSettingsResponse$CallingName' => '<p>The default outbound calling name for the account.</p>', 'PhoneNumber$CallingName' => '<p>The outbound calling name associated with the phone number.</p>', 'UpdatePhoneNumberRequest$CallingName' => '<p>The outbound calling name associated with the phone number.</p>', 'UpdatePhoneNumberRequestItem$CallingName' => '<p>The outbound calling name to update.</p>', 'UpdatePhoneNumberSettingsRequest$CallingName' => '<p>The default outbound calling name for the account.</p>', ], ], 'CallingNameStatus' => [ 'base' => NULL, 'refs' => [ 'PhoneNumber$CallingNameStatus' => '<p>The outbound calling name status.</p>', ], ], 'CallingRegion' => [ 'base' => NULL, 'refs' => [ 'CallingRegionList$member' => NULL, ], ], 'CallingRegionList' => [ 'base' => NULL, 'refs' => [ 'Termination$CallingRegions' => '<p>The countries to which calls are allowed, in ISO 3166-1 alpha-2 format. Required.</p>', ], ], 'CandidateAddress' => [ 'base' => '<p>A suggested address.</p>', 'refs' => [ 'CandidateAddressList$member' => NULL, ], ], 'CandidateAddressList' => [ 'base' => NULL, 'refs' => [ 'ValidateE911AddressResponse$CandidateAddressList' => '<p>The list of address suggestions.</p>', ], ], 'Capability' => [ 'base' => NULL, 'refs' => [ 'CapabilityList$member' => NULL, ], ], 'CapabilityList' => [ 'base' => NULL, 'refs' => [ 'CreateProxySessionRequest$Capabilities' => '<p>The proxy session capabilities.</p>', 'ProxySession$Capabilities' => '<p>The proxy session capabilities.</p>', 'UpdateProxySessionRequest$Capabilities' => '<p>The proxy session capabilities.</p>', ], ], 'Channel' => [ 'base' => '<p>The details of a channel.</p>', 'refs' => [ 'DescribeChannelResponse$Channel' => '<p>The channel details.</p>', ], ], 'ChannelBan' => [ 'base' => '<p>The details of a channel ban.</p>', 'refs' => [ 'DescribeChannelBanResponse$ChannelBan' => '<p>The details of the ban.</p>', ], ], 'ChannelBanSummary' => [ 'base' => '<p>Summary of the details of a <code>ChannelBan</code>.</p>', 'refs' => [ 'ChannelBanSummaryList$member' => NULL, ], ], 'ChannelBanSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListChannelBansResponse$ChannelBans' => '<p>The information for each requested ban.</p>', ], ], 'ChannelMembership' => [ 'base' => '<p>The details of a channel member.</p>', 'refs' => [ 'DescribeChannelMembershipResponse$ChannelMembership' => '<p>The details of the membership.</p>', ], ], 'ChannelMembershipForAppInstanceUserSummary' => [ 'base' => '<p>Summary of the channel membership details of an <code>AppInstanceUser</code>.</p>', 'refs' => [ 'ChannelMembershipForAppInstanceUserSummaryList$member' => NULL, 'DescribeChannelMembershipForAppInstanceUserResponse$ChannelMembership' => '<p>The channel to which a user belongs.</p>', ], ], 'ChannelMembershipForAppInstanceUserSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListChannelMembershipsForAppInstanceUserResponse$ChannelMemberships' => '<p>The information for the requested channel memberships.</p>', ], ], 'ChannelMembershipSummary' => [ 'base' => '<p>Summary of the details of a <code>ChannelMembership</code>.</p>', 'refs' => [ 'ChannelMembershipSummaryList$member' => NULL, ], ], 'ChannelMembershipSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListChannelMembershipsResponse$ChannelMemberships' => '<p>The information for the requested channel memberships.</p>', ], ], 'ChannelMembershipType' => [ 'base' => NULL, 'refs' => [ 'AppInstanceUserMembershipSummary$Type' => '<p>The type of <code>ChannelMembership</code>.</p>', 'BatchChannelMemberships$Type' => '<p>The membership types set for the channel users.</p>', 'BatchCreateChannelMembershipRequest$Type' => '<p>The membership type of a user, <code>DEFAULT</code> or <code>HIDDEN</code>. Default members are always returned as part of <code>ListChannelMemberships</code>. Hidden members are only returned if the type filter in <code>ListChannelMemberships</code> equals <code>HIDDEN</code>. Otherwise hidden members are not returned. This is only supported by moderators.</p>', 'ChannelMembership$Type' => '<p>The membership type set for the channel member.</p>', 'CreateChannelMembershipRequest$Type' => '<p>The membership type of a user, <code>DEFAULT</code> or <code>HIDDEN</code>. Default members are always returned as part of <code>ListChannelMemberships</code>. Hidden members are only returned if the type filter in <code>ListChannelMemberships</code> equals <code>HIDDEN</code>. Otherwise hidden members are not returned. This is only supported by moderators.</p>', 'ListChannelMembershipsRequest$Type' => '<p>The membership type of a user, <code>DEFAULT</code> or <code>HIDDEN</code>. Default members are always returned as part of <code>ListChannelMemberships</code>. Hidden members are only returned if the type filter in <code>ListChannelMemberships</code> equals <code>HIDDEN</code>. Otherwise hidden members are not returned.</p>', ], ], 'ChannelMessage' => [ 'base' => '<p>The details of a message in a channel.</p>', 'refs' => [ 'GetChannelMessageResponse$ChannelMessage' => '<p>The details of and content in the message.</p>', ], ], 'ChannelMessagePersistenceType' => [ 'base' => NULL, 'refs' => [ 'ChannelMessage$Persistence' => '<p>The persistence setting for a channel message.</p>', 'SendChannelMessageRequest$Persistence' => '<p>Boolean that controls whether the message is persisted on the back end. Required.</p>', ], ], 'ChannelMessageSummary' => [ 'base' => '<p>Summary of the messages in a <code>Channel</code>.</p>', 'refs' => [ 'ChannelMessageSummaryList$member' => NULL, ], ], 'ChannelMessageSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListChannelMessagesResponse$ChannelMessages' => '<p>The information about, and content of, each requested message.</p>', ], ], 'ChannelMessageType' => [ 'base' => NULL, 'refs' => [ 'ChannelMessage$Type' => '<p>The message type.</p>', 'ChannelMessageSummary$Type' => '<p>The type of message.</p>', 'SendChannelMessageRequest$Type' => '<p>The type of message, <code>STANDARD</code> or <code>CONTROL</code>.</p>', ], ], 'ChannelMode' => [ 'base' => NULL, 'refs' => [ 'Channel$Mode' => '<p>The mode of the channel.</p>', 'ChannelSummary$Mode' => '<p>The mode of the channel.</p>', 'CreateChannelRequest$Mode' => '<p>The channel mode: <code>UNRESTRICTED</code> or <code>RESTRICTED</code>. Administrators, moderators, and channel members can add themselves and other members to unrestricted channels. Only administrators and moderators can add members to restricted channels.</p>', 'UpdateChannelRequest$Mode' => '<p>The mode of the update request.</p>', ], ], 'ChannelModeratedByAppInstanceUserSummary' => [ 'base' => '<p>Summary of the details of a moderated channel.</p>', 'refs' => [ 'ChannelModeratedByAppInstanceUserSummaryList$member' => NULL, 'DescribeChannelModeratedByAppInstanceUserResponse$Channel' => '<p>The moderated channel.</p>', ], ], 'ChannelModeratedByAppInstanceUserSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListChannelsModeratedByAppInstanceUserResponse$Channels' => '<p>The moderated channels in the request.</p>', ], ], 'ChannelModerator' => [ 'base' => '<p>The details of a channel moderator.</p>', 'refs' => [ 'DescribeChannelModeratorResponse$ChannelModerator' => '<p>The details of the channel moderator.</p>', ], ], 'ChannelModeratorSummary' => [ 'base' => '<p>Summary of the details of a <code>ChannelModerator</code>.</p>', 'refs' => [ 'ChannelModeratorSummaryList$member' => NULL, ], ], 'ChannelModeratorSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListChannelModeratorsResponse$ChannelModerators' => '<p>The information about and names of each moderator.</p>', ], ], 'ChannelPrivacy' => [ 'base' => NULL, 'refs' => [ 'Channel$Privacy' => '<p>The channel\\'s privacy setting.</p>', 'ChannelSummary$Privacy' => '<p>The privacy setting of the channel.</p>', 'CreateChannelRequest$Privacy' => '<p>The channel\\'s privacy level: <code>PUBLIC</code> or <code>PRIVATE</code>. Private channels aren\\'t discoverable by users outside the channel. Public channels are discoverable by anyone in the <code>AppInstance</code>.</p>', 'ListChannelsRequest$Privacy' => '<p>The privacy setting. <code>PUBLIC</code> retrieves all the public channels. <code>PRIVATE</code> retrieves private channels. Only an <code>AppInstanceAdmin</code> can retrieve private channels. </p>', ], ], 'ChannelRetentionSettings' => [ 'base' => '<p>The details of the retention settings for a channel.</p>', 'refs' => [ 'AppInstanceRetentionSettings$ChannelRetentionSettings' => '<p>The length of time in days to retain the messages in a channel.</p>', ], ], 'ChannelSummary' => [ 'base' => '<p>Summary of the details of a <code>Channel</code>.</p>', 'refs' => [ 'ChannelMembershipForAppInstanceUserSummary$ChannelSummary' => '<p>Summary of the details of a <code>Channel</code>.</p>', 'ChannelModeratedByAppInstanceUserSummary$ChannelSummary' => '<p>Summary of the details of a <code>Channel</code>.</p>', 'ChannelSummaryList$member' => NULL, ], ], 'ChannelSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListChannelsResponse$Channels' => '<p>The information about each channel.</p>', ], ], 'ChimeArn' => [ 'base' => NULL, 'refs' => [ 'AppInstance$AppInstanceArn' => '<p>The ARN of the messaging instance.</p>', 'AppInstanceAdmin$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code> for which the user is an administrator.</p>', 'AppInstanceSummary$AppInstanceArn' => '<p>The <code>AppInstance</code> ARN.</p>', 'AppInstanceUser$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'AppInstanceUserSummary$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'BatchChannelMemberships$ChannelArn' => '<p>The ARN of the channel to which you\\'re adding users.</p>', 'BatchCreateChannelMembershipError$MemberArn' => '<p>The ARN of the member that the service couldn\\'t add.</p>', 'BatchCreateChannelMembershipRequest$ChannelArn' => '<p>The ARN of the channel to which you\\'re adding users.</p>', 'BatchCreateChannelMembershipRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'Channel$ChannelArn' => '<p>The ARN of the channel.</p>', 'ChannelBan$ChannelArn' => '<p>The ARN of the channel from which a member is being banned.</p>', 'ChannelMembership$ChannelArn' => '<p>The ARN of the member\\'s channel.</p>', 'ChannelMessage$ChannelArn' => '<p>The ARN of the channel.</p>', 'ChannelModerator$ChannelArn' => '<p>The ARN of the moderator\\'s channel.</p>', 'ChannelSummary$ChannelArn' => '<p>The ARN of the channel.</p>', 'CreateAppInstanceAdminRequest$AppInstanceAdminArn' => '<p>The ARN of the administrator of the current <code>AppInstance</code>.</p>', 'CreateAppInstanceAdminRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'CreateAppInstanceAdminResponse$AppInstanceArn' => '<p>The ARN of the of the admin for the <code>AppInstance</code>.</p>', 'CreateAppInstanceResponse$AppInstanceArn' => '<p>The Amazon Resource Number (ARN) of the <code>AppInstance</code>.</p>', 'CreateAppInstanceUserRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code> request.</p>', 'CreateAppInstanceUserResponse$AppInstanceUserArn' => '<p>The user\\'s ARN.</p>', 'CreateChannelBanRequest$ChannelArn' => '<p>The ARN of the ban request.</p>', 'CreateChannelBanRequest$MemberArn' => '<p>The ARN of the member being banned.</p>', 'CreateChannelBanRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'CreateChannelBanResponse$ChannelArn' => '<p>The ARN of the response to the ban request.</p>', 'CreateChannelMembershipRequest$ChannelArn' => '<p>The ARN of the channel to which you\\'re adding users.</p>', 'CreateChannelMembershipRequest$MemberArn' => '<p>The ARN of the member you want to add to the channel.</p>', 'CreateChannelMembershipRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'CreateChannelMembershipResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'CreateChannelModeratorRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'CreateChannelModeratorRequest$ChannelModeratorArn' => '<p>The ARN of the moderator.</p>', 'CreateChannelModeratorRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'CreateChannelModeratorResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'CreateChannelRequest$AppInstanceArn' => '<p>The ARN of the channel request.</p>', 'CreateChannelRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'CreateChannelResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'DeleteAppInstanceAdminRequest$AppInstanceAdminArn' => '<p>The ARN of the <code>AppInstance</code>\\'s administrator.</p>', 'DeleteAppInstanceAdminRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'DeleteAppInstanceRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'DeleteAppInstanceStreamingConfigurationsRequest$AppInstanceArn' => '<p>The ARN of the streaming configurations being deleted.</p>', 'DeleteAppInstanceUserRequest$AppInstanceUserArn' => '<p>The ARN of the user request being deleted.</p>', 'DeleteChannelBanRequest$ChannelArn' => '<p>The ARN of the channel from which the <code>AppInstanceUser</code> was banned.</p>', 'DeleteChannelBanRequest$MemberArn' => '<p>The ARN of the <code>AppInstanceUser</code> that you want to reinstate.</p>', 'DeleteChannelBanRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'DeleteChannelMembershipRequest$ChannelArn' => '<p>The ARN of the channel from which you want to remove the user.</p>', 'DeleteChannelMembershipRequest$MemberArn' => '<p>The ARN of the member that you\\'re removing from the channel.</p>', 'DeleteChannelMembershipRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'DeleteChannelMessageRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'DeleteChannelMessageRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'DeleteChannelModeratorRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'DeleteChannelModeratorRequest$ChannelModeratorArn' => '<p>The ARN of the moderator being deleted.</p>', 'DeleteChannelModeratorRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'DeleteChannelRequest$ChannelArn' => '<p>The ARN of the channel being deleted.</p>', 'DeleteChannelRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'DescribeAppInstanceAdminRequest$AppInstanceAdminArn' => '<p>The ARN of the <code>AppInstanceAdmin</code>.</p>', 'DescribeAppInstanceAdminRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'DescribeAppInstanceRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'DescribeAppInstanceUserRequest$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'DescribeChannelBanRequest$ChannelArn' => '<p>The ARN of the channel from which the user is banned.</p>', 'DescribeChannelBanRequest$MemberArn' => '<p>The ARN of the member being banned.</p>', 'DescribeChannelBanRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'DescribeChannelMembershipForAppInstanceUserRequest$ChannelArn' => '<p>The ARN of the channel to which the user belongs.</p>', 'DescribeChannelMembershipForAppInstanceUserRequest$AppInstanceUserArn' => '<p>The ARN of the user in a channel.</p>', 'DescribeChannelMembershipForAppInstanceUserRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'DescribeChannelMembershipRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'DescribeChannelMembershipRequest$MemberArn' => '<p>The ARN of the member.</p>', 'DescribeChannelMembershipRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'DescribeChannelModeratedByAppInstanceUserRequest$ChannelArn' => '<p>The ARN of the moderated channel.</p>', 'DescribeChannelModeratedByAppInstanceUserRequest$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code> in the moderated channel.</p>', 'DescribeChannelModeratedByAppInstanceUserRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'DescribeChannelModeratorRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'DescribeChannelModeratorRequest$ChannelModeratorArn' => '<p>The ARN of the channel moderator.</p>', 'DescribeChannelModeratorRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'DescribeChannelRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'DescribeChannelRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'GetAppInstanceRetentionSettingsRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'GetAppInstanceStreamingConfigurationsRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'GetChannelMessageRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'GetChannelMessageRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'Identity$Arn' => '<p>The ARN in an Identity.</p>', 'ListAppInstanceAdminsRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'ListAppInstanceAdminsResponse$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'ListAppInstanceUsersRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'ListAppInstanceUsersResponse$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'ListChannelBansRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'ListChannelBansRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'ListChannelBansResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'ListChannelMembershipsForAppInstanceUserRequest$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>s</p>', 'ListChannelMembershipsForAppInstanceUserRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'ListChannelMembershipsRequest$ChannelArn' => '<p>The maximum number of channel memberships that you want returned.</p>', 'ListChannelMembershipsRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'ListChannelMembershipsResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'ListChannelMessagesRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'ListChannelMessagesRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'ListChannelMessagesResponse$ChannelArn' => '<p>The ARN of the channel containing the requested messages.</p>', 'ListChannelModeratorsRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'ListChannelModeratorsRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'ListChannelModeratorsResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'ListChannelsModeratedByAppInstanceUserRequest$AppInstanceUserArn' => '<p>The ARN of the user in the moderated channel.</p>', 'ListChannelsModeratedByAppInstanceUserRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'ListChannelsRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'ListChannelsRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'MemberArns$member' => NULL, 'PutAppInstanceRetentionSettingsRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'PutAppInstanceStreamingConfigurationsRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'RedactChannelMessageRequest$ChannelArn' => '<p>The ARN of the channel containing the messages that you want to redact.</p>', 'RedactChannelMessageRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'RedactChannelMessageResponse$ChannelArn' => '<p>The ARN of the channel containing the messages that you want to redact.</p>', 'SendChannelMessageRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'SendChannelMessageRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'SendChannelMessageResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'UpdateAppInstanceRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'UpdateAppInstanceResponse$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>. </p>', 'UpdateAppInstanceUserRequest$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'UpdateAppInstanceUserResponse$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'UpdateChannelMessageRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'UpdateChannelMessageRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'UpdateChannelMessageResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'UpdateChannelReadMarkerRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'UpdateChannelReadMarkerRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'UpdateChannelReadMarkerResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'UpdateChannelRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'UpdateChannelRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user that makes the API call.</p>', 'UpdateChannelResponse$ChannelArn' => '<p>The ARN of the channel.</p>', ], ], 'ChimeSdkMeetingConfiguration' => [ 'base' => '<p>The configuration object of the Amazon Chime SDK meeting for a specified media capture pipeline. <code>SourceType</code> must be <code>ChimeSdkMeeting</code>.</p>', 'refs' => [ 'CreateMediaCapturePipelineRequest$ChimeSdkMeetingConfiguration' => '<p>The configuration for a specified media capture pipeline. <code>SourceType</code> must be <code>ChimeSdkMeeting</code>.</p>', 'MediaCapturePipeline$ChimeSdkMeetingConfiguration' => '<p>The configuration for a specified media capture pipeline. <code>SourceType</code> must be <code>ChimeSdkMeeting</code>.</p>', ], ], 'ClientRequestToken' => [ 'base' => NULL, 'refs' => [ 'CreateAppInstanceRequest$ClientRequestToken' => '<p>The <code>ClientRequestToken</code> of the <code>AppInstance</code>.</p>', 'CreateAppInstanceUserRequest$ClientRequestToken' => '<p>The token assigned to the user requesting an <code>AppInstance</code>.</p>', 'CreateChannelRequest$ClientRequestToken' => '<p>The client token for the request. An <code>Idempotency</code> token.</p>', 'CreateMediaCapturePipelineRequest$ClientRequestToken' => '<p>The unique identifier for the client request. The token makes the API request idempotent. Use a different token for different media pipeline requests.</p>', 'CreateMeetingRequest$ClientRequestToken' => '<p>The unique identifier for the client request. Use a different token for different meetings.</p>', 'CreateMeetingWithAttendeesRequest$ClientRequestToken' => '<p>The unique identifier for the client request. Use a different token for different meetings.</p>', 'CreateRoomRequest$ClientRequestToken' => '<p>The idempotency token for the request.</p>', 'SendChannelMessageRequest$ClientRequestToken' => '<p>The <code>Idempotency</code> token for each client request.</p>', ], ], 'ConflictException' => [ 'base' => '<p>The request could not be processed because of conflict in the current state of the resource.</p>', 'refs' => [], ], 'Content' => [ 'base' => NULL, 'refs' => [ 'ChannelMessage$Content' => '<p>The message content.</p>', 'ChannelMessageSummary$Content' => '<p>The content of the message.</p>', 'UpdateChannelMessageRequest$Content' => '<p>The content of the message being updated.</p>', ], ], 'ContentArtifactsConfiguration' => [ 'base' => '<p>The content artifact object.</p>', 'refs' => [ 'ArtifactsConfiguration$Content' => '<p>The configuration for the content artifacts.</p>', ], ], 'ContentMuxType' => [ 'base' => NULL, 'refs' => [ 'ContentArtifactsConfiguration$MuxType' => '<p>The MUX type of the artifact configuration.</p>', ], ], 'ConversationRetentionSettings' => [ 'base' => '<p>The retention settings that determine how long to retain conversation messages for an Amazon Chime Enterprise account.</p>', 'refs' => [ 'RetentionSettings$ConversationRetentionSettings' => '<p>The chat conversation retention settings.</p>', ], ], 'Country' => [ 'base' => NULL, 'refs' => [ 'CountryList$member' => NULL, 'GeoMatchParams$Country' => '<p>The country.</p>', ], ], 'CountryList' => [ 'base' => NULL, 'refs' => [ 'PutVoiceConnectorProxyRequest$PhoneNumberPoolCountries' => '<p>The countries for proxy phone numbers to be selected from.</p>', ], ], 'CpsLimit' => [ 'base' => NULL, 'refs' => [ 'Termination$CpsLimit' => '<p>The limit on calls per second. Max value based on account service quota. Default value of 1.</p>', ], ], 'CreateAccountRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAccountResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppInstanceAdminRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppInstanceAdminResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppInstanceRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppInstanceResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppInstanceUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppInstanceUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateAttendeeError' => [ 'base' => '<p>The list of errors returned when errors are encountered during the BatchCreateAttendee and CreateAttendee actions. This includes external user IDs, error codes, and error messages.</p>', 'refs' => [ 'BatchCreateAttendeeErrorList$member' => NULL, ], ], 'CreateAttendeeRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAttendeeRequestItem' => [ 'base' => '<p>The Amazon Chime SDK attendee fields to create, used with the BatchCreateAttendee action.</p>', 'refs' => [ 'CreateAttendeeRequestItemList$member' => NULL, 'CreateMeetingWithAttendeesRequestItemList$member' => NULL, ], ], 'CreateAttendeeRequestItemList' => [ 'base' => NULL, 'refs' => [ 'BatchCreateAttendeeRequest$Attendees' => '<p>The request containing the attendees to create.</p>', ], ], 'CreateAttendeeResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateBotRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateBotResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelBanRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelBanResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelMembershipRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelMembershipResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelModeratorRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelModeratorResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateMediaCapturePipelineRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateMediaCapturePipelineResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateMeetingDialOutRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateMeetingDialOutResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateMeetingRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateMeetingResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateMeetingWithAttendeesRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateMeetingWithAttendeesRequestItemList' => [ 'base' => NULL, 'refs' => [ 'CreateMeetingWithAttendeesRequest$Attendees' => '<p>The request containing the attendees to create.</p>', ], ], 'CreateMeetingWithAttendeesResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreatePhoneNumberOrderRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreatePhoneNumberOrderResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateProxySessionRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateProxySessionResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateRoomMembershipRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateRoomMembershipResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateRoomRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateRoomResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateSipMediaApplicationCallRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateSipMediaApplicationCallResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateSipMediaApplicationRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateSipMediaApplicationResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateSipRuleRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateSipRuleResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateVoiceConnectorGroupRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateVoiceConnectorGroupResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateVoiceConnectorRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateVoiceConnectorResponse' => [ 'base' => NULL, 'refs' => [], ], 'Credential' => [ 'base' => '<p>The SIP credentials used to authenticate requests to your Amazon Chime Voice Connector.</p>', 'refs' => [ 'CredentialList$member' => NULL, ], ], 'CredentialList' => [ 'base' => NULL, 'refs' => [ 'PutVoiceConnectorTerminationCredentialsRequest$Credentials' => '<p>The termination SIP credentials.</p>', ], ], 'DNISEmergencyCallingConfiguration' => [ 'base' => '<p>The Dialed Number Identification Service (DNIS) emergency calling configuration details associated with an Amazon Chime Voice Connector\\'s emergency calling configuration.</p>', 'refs' => [ 'DNISEmergencyCallingConfigurationList$member' => NULL, ], ], 'DNISEmergencyCallingConfigurationList' => [ 'base' => NULL, 'refs' => [ 'EmergencyCallingConfiguration$DNIS' => '<p>The Dialed Number Identification Service (DNIS) emergency calling configuration details.</p>', ], ], 'DataRetentionInHours' => [ 'base' => NULL, 'refs' => [ 'StreamingConfiguration$DataRetentionInHours' => '<p>The retention period, in hours, for the Amazon Kinesis data.</p>', ], ], 'DeleteAccountRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAccountResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAppInstanceAdminRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAppInstanceRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAppInstanceStreamingConfigurationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAppInstanceUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAttendeeRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteChannelBanRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteChannelMembershipRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteChannelMessageRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteChannelModeratorRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteChannelRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteEventsConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteMediaCapturePipelineRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteMeetingRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeletePhoneNumberRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteProxySessionRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteRoomMembershipRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteRoomRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteSipMediaApplicationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteSipRuleRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteVoiceConnectorEmergencyCallingConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteVoiceConnectorGroupRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteVoiceConnectorOriginationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteVoiceConnectorProxyRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteVoiceConnectorRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteVoiceConnectorStreamingConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteVoiceConnectorTerminationCredentialsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteVoiceConnectorTerminationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppInstanceAdminRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppInstanceAdminResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppInstanceRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppInstanceResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppInstanceUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppInstanceUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelBanRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelBanResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelMembershipForAppInstanceUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelMembershipForAppInstanceUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelMembershipRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelMembershipResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelModeratedByAppInstanceUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelModeratedByAppInstanceUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelModeratorRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelModeratorResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelResponse' => [ 'base' => NULL, 'refs' => [], ], 'DisassociatePhoneNumberFromUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'DisassociatePhoneNumberFromUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'DisassociatePhoneNumbersFromVoiceConnectorGroupRequest' => [ 'base' => NULL, 'refs' => [], ], 'DisassociatePhoneNumbersFromVoiceConnectorGroupResponse' => [ 'base' => NULL, 'refs' => [], ], 'DisassociatePhoneNumbersFromVoiceConnectorRequest' => [ 'base' => NULL, 'refs' => [], ], 'DisassociatePhoneNumbersFromVoiceConnectorResponse' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateSigninDelegateGroupsFromAccountRequest' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateSigninDelegateGroupsFromAccountResponse' => [ 'base' => NULL, 'refs' => [], ], 'E164PhoneNumber' => [ 'base' => NULL, 'refs' => [ 'AssociatePhoneNumberWithUserRequest$E164PhoneNumber' => '<p>The phone number, in E.164 format.</p>', 'CreateMeetingDialOutRequest$FromPhoneNumber' => '<p>Phone number used as the caller ID when the remote party receives a call.</p>', 'CreateMeetingDialOutRequest$ToPhoneNumber' => '<p>Phone number called when inviting someone to a meeting.</p>', 'CreateSipMediaApplicationCallRequest$FromPhoneNumber' => '<p>The phone number that a user calls from. This is a phone number in your Amazon Chime phone number inventory.</p>', 'CreateSipMediaApplicationCallRequest$ToPhoneNumber' => '<p>The phone number that the service should call.</p>', 'DNISEmergencyCallingConfiguration$EmergencyPhoneNumber' => '<p>The DNIS phone number to route emergency calls to, in E.164 format.</p>', 'DNISEmergencyCallingConfiguration$TestPhoneNumber' => '<p>The DNIS phone number to route test emergency calls to, in E.164 format.</p>', 'E164PhoneNumberList$member' => NULL, 'OrderedPhoneNumber$E164PhoneNumber' => '<p>The phone number, in E.164 format.</p>', 'Participant$PhoneNumber' => '<p>The participant\\'s phone number.</p>', 'Participant$ProxyPhoneNumber' => '<p>The participant\\'s proxy phone number.</p>', 'ParticipantPhoneNumberList$member' => NULL, 'PhoneNumber$E164PhoneNumber' => '<p>The phone number, in E.164 format.</p>', 'Proxy$FallBackPhoneNumber' => '<p>The phone number to route calls to after a proxy session expires.</p>', 'PutVoiceConnectorProxyRequest$FallBackPhoneNumber' => '<p>The phone number to route calls to after a proxy session expires.</p>', 'Termination$DefaultPhoneNumber' => '<p>The default caller ID phone number.</p>', ], ], 'E164PhoneNumberList' => [ 'base' => NULL, 'refs' => [ 'AssociatePhoneNumbersWithVoiceConnectorGroupRequest$E164PhoneNumbers' => '<p>List of phone numbers, in E.164 format.</p>', 'AssociatePhoneNumbersWithVoiceConnectorRequest$E164PhoneNumbers' => '<p>List of phone numbers, in E.164 format.</p>', 'CreatePhoneNumberOrderRequest$E164PhoneNumbers' => '<p>List of phone numbers, in E.164 format.</p>', 'DisassociatePhoneNumbersFromVoiceConnectorGroupRequest$E164PhoneNumbers' => '<p>List of phone numbers, in E.164 format.</p>', 'DisassociatePhoneNumbersFromVoiceConnectorRequest$E164PhoneNumbers' => '<p>List of phone numbers, in E.164 format.</p>', 'SearchAvailablePhoneNumbersResponse$E164PhoneNumbers' => '<p>List of phone numbers, in E.164 format.</p>', ], ], 'EmailAddress' => [ 'base' => NULL, 'refs' => [ 'CreateUserRequest$Email' => '<p>The user\\'s email address.</p>', 'Invite$EmailAddress' => '<p>The email address to which the invite is sent.</p>', 'ListAccountsRequest$UserEmail' => '<p>User email address with which to filter results.</p>', 'ListUsersRequest$UserEmail' => '<p>Optional. The user email address used to filter results. Maximum 1.</p>', 'User$PrimaryEmail' => '<p>The primary email address of the user.</p>', 'UserEmailList$member' => NULL, ], ], 'EmailStatus' => [ 'base' => NULL, 'refs' => [ 'Invite$EmailStatus' => '<p>The status of the invite email.</p>', ], ], 'EmergencyCallingConfiguration' => [ 'base' => '<p>The emergency calling configuration details associated with an Amazon Chime Voice Connector.</p>', 'refs' => [ 'GetVoiceConnectorEmergencyCallingConfigurationResponse$EmergencyCallingConfiguration' => '<p>The emergency calling configuration details.</p>', 'PutVoiceConnectorEmergencyCallingConfigurationRequest$EmergencyCallingConfiguration' => '<p>The emergency calling configuration details.</p>', 'PutVoiceConnectorEmergencyCallingConfigurationResponse$EmergencyCallingConfiguration' => '<p>The emergency calling configuration details.</p>', ], ], 'EngineTranscribeMedicalSettings' => [ 'base' => '<p>Settings specific to the Amazon Transcribe Medical engine.</p>', 'refs' => [ 'TranscriptionConfiguration$EngineTranscribeMedicalSettings' => '<p>The transcription configuration settings passed to Amazon Transcribe Medical.</p>', ], ], 'EngineTranscribeSettings' => [ 'base' => '<p>Settings specific for Amazon Transcribe as the live transcription engine.</p> <p>If you specify an invalid combination of parameters, a <code>TranscriptFailed</code> event will be sent with the contents of the <code>BadRequestException</code> generated by Amazon Transcribe. For more information on each parameter and which combinations are valid, refer to the <a href=\"https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartStreamTranscription.html\">StartStreamTranscription</a> API in the <i>Amazon Transcribe Developer Guide</i>.</p>', 'refs' => [ 'TranscriptionConfiguration$EngineTranscribeSettings' => '<p>The transcription configuration settings passed to Amazon Transcribe.</p>', ], ], 'ErrorCode' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$Code' => NULL, 'BadRequestException$Code' => NULL, 'BatchCreateChannelMembershipError$ErrorCode' => '<p>The error code.</p>', 'ConflictException$Code' => NULL, 'ForbiddenException$Code' => NULL, 'MemberError$ErrorCode' => '<p>The error code.</p>', 'NotFoundException$Code' => NULL, 'PhoneNumberError$ErrorCode' => '<p>The error code.</p>', 'ResourceLimitExceededException$Code' => NULL, 'ServiceFailureException$Code' => NULL, 'ServiceUnavailableException$Code' => NULL, 'ThrottledClientException$Code' => NULL, 'UnauthorizedClientException$Code' => NULL, 'UnprocessableEntityException$Code' => NULL, 'UserError$ErrorCode' => '<p>The error code.</p>', ], ], 'EventsConfiguration' => [ 'base' => '<p>The configuration that allows a bot to receive outgoing events. Can be either an HTTPS endpoint or a Lambda function ARN.</p>', 'refs' => [ 'GetEventsConfigurationResponse$EventsConfiguration' => '<p>The events configuration details.</p>', 'PutEventsConfigurationResponse$EventsConfiguration' => '<p>The configuration that allows a bot to receive outgoing events. Can be an HTTPS endpoint or an AWS Lambda function ARN.</p>', ], ], 'ExternalMeetingIdType' => [ 'base' => NULL, 'refs' => [ 'CreateMeetingRequest$ExternalMeetingId' => '<p>The external meeting ID.</p>', 'CreateMeetingWithAttendeesRequest$ExternalMeetingId' => '<p>The external meeting ID.</p>', 'Meeting$ExternalMeetingId' => '<p>The external meeting ID.</p>', ], ], 'ExternalUserIdList' => [ 'base' => NULL, 'refs' => [ 'SelectedVideoStreams$ExternalUserIds' => '<p>The external user IDs of the streams selected for a media capture pipeline.</p>', ], ], 'ExternalUserIdType' => [ 'base' => NULL, 'refs' => [ 'Attendee$ExternalUserId' => '<p>The Amazon Chime SDK external user ID. An idempotency token. Links the attendee to an identity managed by a builder application.</p>', 'CreateAttendeeError$ExternalUserId' => '<p>The Amazon Chime SDK external user ID. An idempotency token. Links the attendee to an identity managed by a builder application.</p>', 'CreateAttendeeRequest$ExternalUserId' => '<p>The Amazon Chime SDK external user ID. An idempotency token. Links the attendee to an identity managed by a builder application.</p>', 'CreateAttendeeRequestItem$ExternalUserId' => '<p>The Amazon Chime SDK external user ID. An idempotency token. Links the attendee to an identity managed by a builder application.</p>', 'CreateMeetingRequest$MeetingHostId' => '<p>Reserved.</p>', 'CreateMeetingWithAttendeesRequest$MeetingHostId' => '<p>Reserved.</p>', 'ExternalUserIdList$member' => NULL, ], ], 'ForbiddenException' => [ 'base' => '<p>The client is permanently forbidden from making the request.</p>', 'refs' => [], ], 'FunctionArn' => [ 'base' => NULL, 'refs' => [ 'SipMediaApplicationEndpoint$LambdaArn' => '<p>Valid Amazon Resource Name (ARN) of the Lambda function, version, or alias. The function must be created in the same AWS Region as the SIP media application.</p>', ], ], 'GeoMatchLevel' => [ 'base' => NULL, 'refs' => [ 'CreateProxySessionRequest$GeoMatchLevel' => '<p>The preference for matching the country or area code of the proxy phone number with that of the first participant.</p>', 'ProxySession$GeoMatchLevel' => '<p>The preference for matching the country or area code of the proxy phone number with that of the first participant.</p>', ], ], 'GeoMatchParams' => [ 'base' => '<p>The country and area code for a proxy phone number in a proxy phone session.</p>', 'refs' => [ 'CreateProxySessionRequest$GeoMatchParams' => '<p>The country and area code for the proxy phone number.</p>', 'ProxySession$GeoMatchParams' => '<p>The country and area code for the proxy phone number.</p>', ], ], 'GetAccountRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetAccountResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetAccountSettingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetAccountSettingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetAppInstanceRetentionSettingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetAppInstanceRetentionSettingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetAppInstanceStreamingConfigurationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetAppInstanceStreamingConfigurationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetAttendeeRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetAttendeeResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetBotRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetBotResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetChannelMessageRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetChannelMessageResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetEventsConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetEventsConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetGlobalSettingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetMediaCapturePipelineRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetMediaCapturePipelineResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetMeetingRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetMeetingResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetMessagingSessionEndpointRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetMessagingSessionEndpointResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetPhoneNumberOrderRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetPhoneNumberOrderResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetPhoneNumberRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetPhoneNumberResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetPhoneNumberSettingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetProxySessionRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetProxySessionResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetRetentionSettingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetRetentionSettingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetRoomRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetRoomResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetSipMediaApplicationLoggingConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetSipMediaApplicationLoggingConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetSipMediaApplicationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetSipMediaApplicationResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetSipRuleRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetSipRuleResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetUserSettingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetUserSettingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorEmergencyCallingConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorEmergencyCallingConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorGroupRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorGroupResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorLoggingConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorLoggingConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorOriginationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorOriginationResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorProxyRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorProxyResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorStreamingConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorStreamingConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorTerminationHealthRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorTerminationHealthResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorTerminationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetVoiceConnectorTerminationResponse' => [ 'base' => NULL, 'refs' => [], ], 'GuidString' => [ 'base' => NULL, 'refs' => [ 'Attendee$AttendeeId' => '<p>The Amazon Chime SDK attendee ID.</p>', 'AttendeeIdList$member' => NULL, 'BatchCreateAttendeeRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'CreateAttendeeRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'CreateMeetingDialOutRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'CreateMeetingDialOutResponse$TransactionId' => '<p>Unique ID that tracks API calls.</p>', 'DeleteAttendeeRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'DeleteAttendeeRequest$AttendeeId' => '<p>The Amazon Chime SDK attendee ID.</p>', 'DeleteMediaCapturePipelineRequest$MediaPipelineId' => '<p>The ID of the media capture pipeline being deleted. </p>', 'DeleteMeetingRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'GetAttendeeRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'GetAttendeeRequest$AttendeeId' => '<p>The Amazon Chime SDK attendee ID.</p>', 'GetMediaCapturePipelineRequest$MediaPipelineId' => '<p>The ID of the pipeline that you want to get.</p>', 'GetMeetingRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'GetPhoneNumberOrderRequest$PhoneNumberOrderId' => '<p>The ID for the phone number order.</p>', 'ListAttendeeTagsRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'ListAttendeeTagsRequest$AttendeeId' => '<p>The Amazon Chime SDK attendee ID.</p>', 'ListAttendeesRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'ListMeetingTagsRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'MediaCapturePipeline$MediaPipelineId' => '<p>The ID of a media capture pipeline.</p>', 'Meeting$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'PhoneNumberOrder$PhoneNumberOrderId' => '<p>The phone number order ID.</p>', 'SipMediaApplicationCall$TransactionId' => '<p>The transaction ID of a call.</p>', 'StartMeetingTranscriptionRequest$MeetingId' => '<p>The unique ID of the meeting being transcribed.</p>', 'StopMeetingTranscriptionRequest$MeetingId' => '<p>The unique ID of the meeting for which you stop transcription.</p>', 'TagAttendeeRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'TagAttendeeRequest$AttendeeId' => '<p>The Amazon Chime SDK attendee ID.</p>', 'TagMeetingRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'UntagAttendeeRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'UntagAttendeeRequest$AttendeeId' => '<p>The Amazon Chime SDK attendee ID.</p>', 'UntagMeetingRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', ], ], 'Identity' => [ 'base' => '<p>The details of a user.</p>', 'refs' => [ 'AppInstanceAdmin$Admin' => '<p>The <code>AppInstanceAdmin</code> data.</p>', 'AppInstanceAdminSummary$Admin' => '<p>The details of the <code>AppInstanceAdmin</code>.</p>', 'BatchChannelMemberships$InvitedBy' => '<p>The identifier of the member who invited another member.</p>', 'Channel$CreatedBy' => '<p>The <code>AppInstanceUser</code> who created the channel.</p>', 'ChannelBan$Member' => '<p>The member being banned from the channel.</p>', 'ChannelBan$CreatedBy' => '<p>The <code>AppInstanceUser</code> who created the ban.</p>', 'ChannelBanSummary$Member' => '<p>The member being banned from a channel.</p>', 'ChannelMembership$InvitedBy' => '<p>The identifier of the member who invited another member.</p>', 'ChannelMembership$Member' => '<p>The data of the channel member.</p>', 'ChannelMembershipSummary$Member' => '<p>A member\\'s summary data.</p>', 'ChannelMessage$Sender' => '<p>The message sender.</p>', 'ChannelMessageSummary$Sender' => '<p>The message sender.</p>', 'ChannelModerator$Moderator' => '<p>The moderator\\'s data.</p>', 'ChannelModerator$CreatedBy' => '<p>The <code>AppInstanceUser</code> who created the moderator.</p>', 'ChannelModeratorSummary$Moderator' => '<p>The data for a moderator.</p>', 'CreateAppInstanceAdminResponse$AppInstanceAdmin' => '<p>The name and ARN of the admin for the <code>AppInstance</code>.</p>', 'CreateChannelBanResponse$Member' => '<p>The <code>ChannelArn</code> and <code>BannedIdentity</code> of the member in the ban response.</p>', 'CreateChannelMembershipResponse$Member' => '<p>The ARN and metadata of the member being added.</p>', 'CreateChannelModeratorResponse$ChannelModerator' => '<p>The ARNs of the channel and the moderator.</p>', 'Members$member' => NULL, ], ], 'Integer' => [ 'base' => NULL, 'refs' => [ 'Proxy$DefaultSessionExpiryMinutes' => '<p>The default number of minutes allowed for proxy sessions.</p>', 'PutVoiceConnectorProxyRequest$DefaultSessionExpiryMinutes' => '<p>The default number of minutes allowed for proxy sessions.</p>', ], ], 'Invite' => [ 'base' => '<p>Invitation object returned after emailing users to invite them to join the Amazon Chime <code>Team</code> account.</p>', 'refs' => [ 'InviteList$member' => NULL, ], ], 'InviteList' => [ 'base' => NULL, 'refs' => [ 'InviteUsersResponse$Invites' => '<p>The email invitation details.</p>', ], ], 'InviteStatus' => [ 'base' => NULL, 'refs' => [ 'Invite$Status' => '<p>The status of the invite.</p>', 'User$UserInvitationStatus' => '<p>The user invite status.</p>', ], ], 'InviteUsersRequest' => [ 'base' => NULL, 'refs' => [], ], 'InviteUsersResponse' => [ 'base' => NULL, 'refs' => [], ], 'Iso8601Timestamp' => [ 'base' => NULL, 'refs' => [ 'Account$CreatedTimestamp' => '<p>The Amazon Chime account creation timestamp, in ISO 8601 format.</p>', 'Bot$CreatedTimestamp' => '<p>The bot creation timestamp, in ISO 8601 format.</p>', 'Bot$UpdatedTimestamp' => '<p>The updated bot timestamp, in ISO 8601 format.</p>', 'GetPhoneNumberSettingsResponse$CallingNameUpdatedTimestamp' => '<p>The updated outbound calling name timestamp, in ISO 8601 format.</p>', 'GetRetentionSettingsResponse$InitiateDeletionTimestamp' => '<p>The timestamp representing the time at which the specified items are permanently deleted, in ISO 8601 format.</p>', 'MediaCapturePipeline$CreatedTimestamp' => '<p>The time at which the capture pipeline was created, in ISO 8601 format.</p>', 'MediaCapturePipeline$UpdatedTimestamp' => '<p>The time at which the capture pipeline was updated, in ISO 8601 format.</p>', 'PhoneNumber$CreatedTimestamp' => '<p>The phone number creation timestamp, in ISO 8601 format.</p>', 'PhoneNumber$UpdatedTimestamp' => '<p>The updated phone number timestamp, in ISO 8601 format.</p>', 'PhoneNumber$DeletionTimestamp' => '<p>The deleted phone number timestamp, in ISO 8601 format.</p>', 'PhoneNumberAssociation$AssociatedTimestamp' => '<p>The timestamp of the phone number association, in ISO 8601 format.</p>', 'PhoneNumberOrder$CreatedTimestamp' => '<p>The phone number order creation time stamp, in ISO 8601 format.</p>', 'PhoneNumberOrder$UpdatedTimestamp' => '<p>The updated phone number order time stamp, in ISO 8601 format.</p>', 'ProxySession$CreatedTimestamp' => '<p>The created time stamp, in ISO 8601 format.</p>', 'ProxySession$UpdatedTimestamp' => '<p>The updated time stamp, in ISO 8601 format.</p>', 'ProxySession$EndedTimestamp' => '<p>The ended time stamp, in ISO 8601 format.</p>', 'PutRetentionSettingsResponse$InitiateDeletionTimestamp' => '<p>The timestamp representing the time at which the specified items are permanently deleted, in ISO 8601 format.</p>', 'Room$CreatedTimestamp' => '<p>The room creation timestamp, in ISO 8601 format.</p>', 'Room$UpdatedTimestamp' => '<p>The room update timestamp, in ISO 8601 format.</p>', 'RoomMembership$UpdatedTimestamp' => '<p>The room membership update timestamp, in ISO 8601 format.</p>', 'SipMediaApplication$CreatedTimestamp' => '<p>The SIP media application creation timestamp, in ISO 8601 format.</p>', 'SipMediaApplication$UpdatedTimestamp' => '<p>The SIP media application updated timestamp, in ISO 8601 format.</p>', 'SipRule$CreatedTimestamp' => '<p>The time at which the SIP rule was created, in ISO 8601 format.</p>', 'SipRule$UpdatedTimestamp' => '<p>The time at which the SIP rule was last updated, in ISO 8601 format.</p>', 'TerminationHealth$Timestamp' => '<p>The timestamp, in ISO 8601 format.</p>', 'User$RegisteredOn' => '<p>Date and time when the user is registered, in ISO 8601 format.</p>', 'User$InvitedOn' => '<p>Date and time when the user is invited to the Amazon Chime account, in ISO 8601 format.</p>', 'VoiceConnector$CreatedTimestamp' => '<p>The Amazon Chime Voice Connector creation timestamp, in ISO 8601 format.</p>', 'VoiceConnector$UpdatedTimestamp' => '<p>The updated Amazon Chime Voice Connector timestamp, in ISO 8601 format.</p>', 'VoiceConnectorGroup$CreatedTimestamp' => '<p>The Amazon Chime Voice Connector group creation time stamp, in ISO 8601 format.</p>', 'VoiceConnectorGroup$UpdatedTimestamp' => '<p>The updated Amazon Chime Voice Connector group time stamp, in ISO 8601 format.</p>', ], ], 'JoinTokenString' => [ 'base' => NULL, 'refs' => [ 'Attendee$JoinToken' => '<p>The join token used by the Amazon Chime SDK attendee.</p>', 'CreateMeetingDialOutRequest$JoinToken' => '<p>Token used by the Amazon Chime SDK attendee. Call the <a href=\"https://docs.aws.amazon.com/chime/latest/APIReference/API_CreateAttendee.html\">CreateAttendee</a> action to get a join token.</p>', ], ], 'License' => [ 'base' => NULL, 'refs' => [ 'Account$DefaultLicense' => '<p>The default license for the Amazon Chime account.</p>', 'LicenseList$member' => NULL, 'UpdateAccountRequest$DefaultLicense' => '<p>The default license applied when you add users to an Amazon Chime account.</p>', 'UpdateUserRequest$LicenseType' => '<p>The user license type to update. This must be a supported license type for the Amazon Chime account that the user belongs to.</p>', 'UpdateUserRequestItem$LicenseType' => '<p>The user license type.</p>', 'User$LicenseType' => '<p>The license type for the user.</p>', ], ], 'LicenseList' => [ 'base' => NULL, 'refs' => [ 'Account$SupportedLicenses' => '<p>Supported licenses for the Amazon Chime account.</p>', ], ], 'ListAccountsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAccountsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListAppInstanceAdminsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAppInstanceAdminsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListAppInstanceUsersRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAppInstanceUsersResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListAppInstancesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAppInstancesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListAttendeeTagsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAttendeeTagsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListAttendeesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAttendeesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListBotsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListBotsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelBansRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelBansResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelMembershipsForAppInstanceUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelMembershipsForAppInstanceUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelMembershipsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelMembershipsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelMessagesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelMessagesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelModeratorsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelModeratorsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelsModeratedByAppInstanceUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelsModeratedByAppInstanceUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListMediaCapturePipelinesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListMediaCapturePipelinesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListMeetingTagsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListMeetingTagsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListMeetingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListMeetingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListPhoneNumberOrdersRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListPhoneNumberOrdersResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListPhoneNumbersRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListPhoneNumbersResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListProxySessionsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListProxySessionsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListRoomMembershipsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListRoomMembershipsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListRoomsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListRoomsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListSipMediaApplicationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListSipMediaApplicationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListSipRulesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListSipRulesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListSupportedPhoneNumberCountriesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListSupportedPhoneNumberCountriesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListUsersRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListUsersResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListVoiceConnectorGroupsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListVoiceConnectorGroupsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListVoiceConnectorTerminationCredentialsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListVoiceConnectorTerminationCredentialsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListVoiceConnectorsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListVoiceConnectorsResponse' => [ 'base' => NULL, 'refs' => [], ], 'LoggingConfiguration' => [ 'base' => '<p>The logging configuration associated with an Amazon Chime Voice Connector. Specifies whether SIP message logs are enabled for sending to Amazon CloudWatch Logs.</p>', 'refs' => [ 'GetVoiceConnectorLoggingConfigurationResponse$LoggingConfiguration' => '<p>The logging configuration details.</p>', 'PutVoiceConnectorLoggingConfigurationRequest$LoggingConfiguration' => '<p>The logging configuration details to add.</p>', 'PutVoiceConnectorLoggingConfigurationResponse$LoggingConfiguration' => '<p>The updated logging configuration details.</p>', ], ], 'LogoutUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'LogoutUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'ListAppInstanceAdminsRequest$MaxResults' => '<p>The maximum number of administrators that you want to return.</p>', 'ListAppInstanceUsersRequest$MaxResults' => '<p>The maximum number of requests that you want returned.</p>', 'ListAppInstancesRequest$MaxResults' => '<p>The maximum number of <code>AppInstance</code>s that you want to return.</p>', 'ListChannelBansRequest$MaxResults' => '<p>The maximum number of bans that you want returned.</p>', 'ListChannelMembershipsForAppInstanceUserRequest$MaxResults' => '<p>The maximum number of users that you want returned.</p>', 'ListChannelMembershipsRequest$MaxResults' => '<p>The maximum number of channel memberships that you want returned.</p>', 'ListChannelMessagesRequest$MaxResults' => '<p>The maximum number of messages that you want returned.</p>', 'ListChannelModeratorsRequest$MaxResults' => '<p>The maximum number of moderators that you want returned.</p>', 'ListChannelsModeratedByAppInstanceUserRequest$MaxResults' => '<p>The maximum number of channels in the request.</p>', 'ListChannelsRequest$MaxResults' => '<p>The maximum number of channels that you want to return.</p>', ], ], 'MediaCapturePipeline' => [ 'base' => '<p>A media capture pipeline object consisting of an ID, source type, source ARN, a sink type, a sink ARN, and a configuration object.</p>', 'refs' => [ 'CreateMediaCapturePipelineResponse$MediaCapturePipeline' => '<p>A media capture pipeline object, the ID, source type, source ARN, sink type, and sink ARN of a media capture pipeline object.</p>', 'GetMediaCapturePipelineResponse$MediaCapturePipeline' => '<p>The media capture pipeline object.</p>', 'MediaCapturePipelineList$member' => NULL, ], ], 'MediaCapturePipelineList' => [ 'base' => NULL, 'refs' => [ 'ListMediaCapturePipelinesResponse$MediaCapturePipelines' => '<p>The media capture pipeline objects in the list.</p>', ], ], 'MediaPipelineSinkType' => [ 'base' => NULL, 'refs' => [ 'CreateMediaCapturePipelineRequest$SinkType' => '<p>Destination type to which the media artifacts are saved. You must use an S3 bucket. </p>', 'MediaCapturePipeline$SinkType' => '<p>Destination type to which the media artifacts are saved. You must use an S3 Bucket.</p>', ], ], 'MediaPipelineSourceType' => [ 'base' => NULL, 'refs' => [ 'CreateMediaCapturePipelineRequest$SourceType' => '<p>Source type from which the media artifacts will be captured. A Chime SDK Meeting is the only supported source.</p>', 'MediaCapturePipeline$SourceType' => '<p>Source type from which media artifacts are saved. You must use <code>ChimeMeeting</code>.</p>', ], ], 'MediaPipelineStatus' => [ 'base' => NULL, 'refs' => [ 'MediaCapturePipeline$Status' => '<p>The status of the media capture pipeline.</p>', ], ], 'MediaPlacement' => [ 'base' => '<p>A set of endpoints used by clients to connect to the media service group for an Amazon Chime SDK meeting.</p>', 'refs' => [ 'Meeting$MediaPlacement' => '<p>The media placement for the meeting.</p>', ], ], 'Meeting' => [ 'base' => '<p>A meeting created using the Amazon Chime SDK.</p>', 'refs' => [ 'CreateMeetingResponse$Meeting' => '<p> The meeting information, including the meeting ID and <code>MediaPlacement</code> . </p>', 'CreateMeetingWithAttendeesResponse$Meeting' => '<p>A meeting created using the Amazon Chime SDK.</p>', 'GetMeetingResponse$Meeting' => '<p>The Amazon Chime SDK meeting information.</p>', 'MeetingList$member' => NULL, ], ], 'MeetingList' => [ 'base' => NULL, 'refs' => [ 'ListMeetingsResponse$Meetings' => '<p>The Amazon Chime SDK meeting information.</p>', ], ], 'MeetingNotificationConfiguration' => [ 'base' => '<p> The resource target configurations for receiving Amazon Chime SDK meeting and attendee event notifications. The Amazon Chime SDK supports resource targets located in the US East (N. Virginia) AWS Region (<code>us-east-1</code>). </p>', 'refs' => [ 'CreateMeetingRequest$NotificationsConfiguration' => '<p>The configuration for resource targets to receive notifications when meeting and attendee events occur.</p>', 'CreateMeetingWithAttendeesRequest$NotificationsConfiguration' => '<p>The resource target configurations for receiving Amazon Chime SDK meeting and attendee event notifications. The Amazon Chime SDK supports resource targets located in the US East (N. Virginia) AWS Region (us-east-1).</p>', ], ], 'MeetingTagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagMeetingRequest$TagKeys' => '<p>The tag keys.</p>', ], ], 'MeetingTagList' => [ 'base' => NULL, 'refs' => [ 'CreateMeetingRequest$Tags' => '<p>The tag key-value pairs.</p>', 'CreateMeetingWithAttendeesRequest$Tags' => '<p>The tag key-value pairs.</p>', 'TagMeetingRequest$Tags' => '<p>The tag key-value pairs.</p>', ], ], 'Member' => [ 'base' => '<p>The member details, such as email address, name, member ID, and member type.</p>', 'refs' => [ 'RoomMembership$Member' => '<p>The member details, such as email address, name, member ID, and member type.</p>', ], ], 'MemberArns' => [ 'base' => NULL, 'refs' => [ 'BatchCreateChannelMembershipRequest$MemberArns' => '<p>The ARNs of the members you want to add to the channel.</p>', ], ], 'MemberError' => [ 'base' => '<p>The list of errors returned when a member action results in an error.</p>', 'refs' => [ 'MemberErrorList$member' => NULL, ], ], 'MemberErrorList' => [ 'base' => NULL, 'refs' => [ 'BatchCreateRoomMembershipResponse$Errors' => '<p>If the action fails for one or more of the member IDs in the request, a list of the member IDs is returned, along with error codes and error messages.</p>', ], ], 'MemberType' => [ 'base' => NULL, 'refs' => [ 'Member$MemberType' => '<p>The member type.</p>', ], ], 'Members' => [ 'base' => NULL, 'refs' => [ 'BatchChannelMemberships$Members' => '<p>The users successfully added to the request.</p>', ], ], 'MembershipItem' => [ 'base' => '<p>Membership details, such as member ID and member role.</p>', 'refs' => [ 'MembershipItemList$member' => NULL, ], ], 'MembershipItemList' => [ 'base' => NULL, 'refs' => [ 'BatchCreateRoomMembershipRequest$MembershipItemList' => '<p>The list of membership items.</p>', ], ], 'MessageId' => [ 'base' => NULL, 'refs' => [ 'ChannelMessage$MessageId' => '<p>The ID of a message.</p>', 'ChannelMessageSummary$MessageId' => '<p>The ID of the message.</p>', 'DeleteChannelMessageRequest$MessageId' => '<p>The ID of the message being deleted.</p>', 'GetChannelMessageRequest$MessageId' => '<p>The ID of the message.</p>', 'RedactChannelMessageRequest$MessageId' => '<p>The ID of the message being redacted.</p>', 'RedactChannelMessageResponse$MessageId' => '<p>The ID of the message being redacted.</p>', 'SendChannelMessageResponse$MessageId' => '<p>The ID string assigned to each message.</p>', 'UpdateChannelMessageRequest$MessageId' => '<p>The ID string of the message being updated.</p>', 'UpdateChannelMessageResponse$MessageId' => '<p>The ID string of the message being updated.</p>', ], ], 'MessagingSessionEndpoint' => [ 'base' => '<p>The websocket endpoint used to connect to Amazon Chime SDK messaging.</p>', 'refs' => [ 'GetMessagingSessionEndpointResponse$Endpoint' => '<p>The endpoint returned in the response.</p>', ], ], 'Metadata' => [ 'base' => NULL, 'refs' => [ 'AppInstance$Metadata' => '<p>The metadata of an <code>AppInstance</code>.</p>', 'AppInstanceSummary$Metadata' => '<p>The metadata of the <code>AppInstance</code>.</p>', 'AppInstanceUser$Metadata' => '<p>The metadata of the <code>AppInstanceUser</code>.</p>', 'AppInstanceUserSummary$Metadata' => '<p>The metadata of the <code>AppInstanceUser</code>.</p>', 'Channel$Metadata' => '<p>The channel\\'s metadata.</p>', 'ChannelMessage$Metadata' => '<p>The message metadata.</p>', 'ChannelMessageSummary$Metadata' => '<p>The metadata of the message.</p>', 'ChannelSummary$Metadata' => '<p>The metadata of the channel.</p>', 'CreateAppInstanceRequest$Metadata' => '<p>The metadata of the <code>AppInstance</code>. Limited to a 1KB string in UTF-8.</p>', 'CreateAppInstanceUserRequest$Metadata' => '<p>The request\\'s metadata. Limited to a 1KB string in UTF-8.</p>', 'CreateChannelRequest$Metadata' => '<p>The metadata of the creation request. Limited to 1KB and UTF-8.</p>', 'SendChannelMessageRequest$Metadata' => '<p>The optional metadata for each message.</p>', 'UpdateAppInstanceRequest$Metadata' => '<p>The metadata that you want to change.</p>', 'UpdateAppInstanceUserRequest$Metadata' => '<p>The metadata of the <code>AppInstanceUser</code>.</p>', 'UpdateChannelMessageRequest$Metadata' => '<p>The metadata of the message being updated.</p>', 'UpdateChannelRequest$Metadata' => '<p>The metadata for the update request.</p>', ], ], 'NextToken' => [ 'base' => NULL, 'refs' => [ 'ListAppInstanceAdminsRequest$NextToken' => '<p>The token returned from previous API requests until the number of administrators is reached.</p>', 'ListAppInstanceAdminsResponse$NextToken' => '<p>The token returned from previous API requests until the number of administrators is reached.</p>', 'ListAppInstanceUsersRequest$NextToken' => '<p>The token passed by previous API calls until all requested users are returned.</p>', 'ListAppInstanceUsersResponse$NextToken' => '<p>The token passed by previous API calls until all requested users are returned.</p>', 'ListAppInstancesRequest$NextToken' => '<p>The token passed by previous API requests until you reach the maximum number of <code>AppInstance</code>s.</p>', 'ListAppInstancesResponse$NextToken' => '<p>The token passed by previous API requests until the maximum number of <code>AppInstance</code>s is reached.</p>', 'ListChannelBansRequest$NextToken' => '<p>The token passed by previous API calls until all requested bans are returned.</p>', 'ListChannelBansResponse$NextToken' => '<p>The token passed by previous API calls until all requested bans are returned.</p>', 'ListChannelMembershipsForAppInstanceUserRequest$NextToken' => '<p>The token returned from previous API requests until the number of channel memberships is reached.</p>', 'ListChannelMembershipsForAppInstanceUserResponse$NextToken' => '<p>The token passed by previous API calls until all requested users are returned.</p>', 'ListChannelMembershipsRequest$NextToken' => '<p>The token passed by previous API calls until all requested channel memberships are returned.</p>', 'ListChannelMembershipsResponse$NextToken' => '<p>The token passed by previous API calls until all requested channel memberships are returned.</p>', 'ListChannelMessagesRequest$NextToken' => '<p>The token passed by previous API calls until all requested messages are returned.</p>', 'ListChannelMessagesResponse$NextToken' => '<p>The token passed by previous API calls until all requested messages are returned.</p>', 'ListChannelModeratorsRequest$NextToken' => '<p>The token passed by previous API calls until all requested moderators are returned.</p>', 'ListChannelModeratorsResponse$NextToken' => '<p>The token passed by previous API calls until all requested moderators are returned.</p>', 'ListChannelsModeratedByAppInstanceUserRequest$NextToken' => '<p>The token returned from previous API requests until the number of channels moderated by the user is reached.</p>', 'ListChannelsModeratedByAppInstanceUserResponse$NextToken' => '<p>The token returned from previous API requests until the number of channels moderated by the user is reached.</p>', 'ListChannelsRequest$NextToken' => '<p>The token passed by previous API calls until all requested channels are returned.</p>', 'ListChannelsResponse$NextToken' => '<p>The token returned from previous API requests until the number of channels is reached.</p>', ], ], 'NextTokenString' => [ 'base' => NULL, 'refs' => [ 'ListProxySessionsRequest$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListProxySessionsResponse$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListSipMediaApplicationsRequest$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListSipMediaApplicationsResponse$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListSipRulesRequest$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListSipRulesResponse$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', ], ], 'NonEmptyContent' => [ 'base' => NULL, 'refs' => [ 'SendChannelMessageRequest$Content' => '<p>The content of the message.</p>', ], ], 'NonEmptyResourceName' => [ 'base' => NULL, 'refs' => [ 'AppInstance$Name' => '<p>The name of an <code>AppInstance</code>.</p>', 'AppInstanceSummary$Name' => '<p>The name of the <code>AppInstance</code>.</p>', 'Channel$Name' => '<p>The name of the channel.</p>', 'ChannelSummary$Name' => '<p>The name of the channel.</p>', 'CreateAppInstanceRequest$Name' => '<p>The name of the <code>AppInstance</code>.</p>', 'CreateChannelRequest$Name' => '<p>The name of the channel.</p>', 'UpdateAppInstanceRequest$Name' => '<p>The name that you want to change.</p>', 'UpdateChannelRequest$Name' => '<p>The name of the channel.</p>', ], ], 'NonEmptyString' => [ 'base' => NULL, 'refs' => [ 'AssociatePhoneNumbersWithVoiceConnectorGroupRequest$VoiceConnectorGroupId' => '<p>The Amazon Chime Voice Connector group ID.</p>', 'AssociatePhoneNumbersWithVoiceConnectorRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'AssociateSigninDelegateGroupsWithAccountRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'BatchCreateRoomMembershipRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'BatchCreateRoomMembershipRequest$RoomId' => '<p>The room ID.</p>', 'BatchSuspendUserRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'BatchUnsuspendUserRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'BatchUpdateUserRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'CreateBotRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'CreateBotRequest$Domain' => '<p>The domain of the Amazon Chime Enterprise account.</p>', 'CreateRoomMembershipRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'CreateRoomMembershipRequest$RoomId' => '<p>The room ID.</p>', 'CreateRoomMembershipRequest$MemberId' => '<p>The Amazon Chime member ID (user ID or bot ID).</p>', 'CreateRoomRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'CreateSipMediaApplicationCallRequest$SipMediaApplicationId' => '<p>The ID of the SIP media application.</p>', 'CreateSipRuleRequest$TriggerValue' => '<p>If <code>TriggerType</code> is <code>RequestUriHostname</code>, the value can be the outbound host name of an Amazon Chime Voice Connector. If <code>TriggerType</code> is <code>ToPhoneNumber</code>, the value can be a customer-owned phone number in the E164 format. The <code>SipMediaApplication</code> specified in the <code>SipRule</code> is triggered if the request URI in an incoming SIP request matches the <code>RequestUriHostname</code>, or if the <code>To</code> header in the incoming SIP request matches the <code>ToPhoneNumber</code> value.</p>', 'CreateUserRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'DeleteAccountRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'DeleteEventsConfigurationRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'DeleteEventsConfigurationRequest$BotId' => '<p>The bot ID.</p>', 'DeleteRoomMembershipRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'DeleteRoomMembershipRequest$RoomId' => '<p>The room ID.</p>', 'DeleteRoomMembershipRequest$MemberId' => '<p>The member ID (user ID or bot ID).</p>', 'DeleteRoomRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'DeleteRoomRequest$RoomId' => '<p>The chat room ID.</p>', 'DeleteSipMediaApplicationRequest$SipMediaApplicationId' => '<p>The SIP media application ID.</p>', 'DeleteSipRuleRequest$SipRuleId' => '<p>The SIP rule ID.</p>', 'DeleteVoiceConnectorEmergencyCallingConfigurationRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'DeleteVoiceConnectorGroupRequest$VoiceConnectorGroupId' => '<p>The Amazon Chime Voice Connector group ID.</p>', 'DeleteVoiceConnectorOriginationRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'DeleteVoiceConnectorRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'DeleteVoiceConnectorStreamingConfigurationRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'DeleteVoiceConnectorTerminationCredentialsRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'DeleteVoiceConnectorTerminationRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'DisassociatePhoneNumbersFromVoiceConnectorGroupRequest$VoiceConnectorGroupId' => '<p>The Amazon Chime Voice Connector group ID.</p>', 'DisassociatePhoneNumbersFromVoiceConnectorRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'DisassociateSigninDelegateGroupsFromAccountRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'GetAccountRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'GetAccountSettingsRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'GetBotRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'GetBotRequest$BotId' => '<p>The bot ID.</p>', 'GetEventsConfigurationRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'GetEventsConfigurationRequest$BotId' => '<p>The bot ID.</p>', 'GetRetentionSettingsRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'GetRoomRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'GetRoomRequest$RoomId' => '<p>The room ID.</p>', 'GetSipMediaApplicationLoggingConfigurationRequest$SipMediaApplicationId' => '<p>The SIP media application ID.</p>', 'GetSipMediaApplicationRequest$SipMediaApplicationId' => '<p>The SIP media application ID.</p>', 'GetSipRuleRequest$SipRuleId' => '<p>The SIP rule ID.</p>', 'GetUserRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'GetUserRequest$UserId' => '<p>The user ID.</p>', 'GetVoiceConnectorEmergencyCallingConfigurationRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'GetVoiceConnectorGroupRequest$VoiceConnectorGroupId' => '<p>The Amazon Chime Voice Connector group ID.</p>', 'GetVoiceConnectorLoggingConfigurationRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'GetVoiceConnectorOriginationRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'GetVoiceConnectorRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'GetVoiceConnectorStreamingConfigurationRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'GetVoiceConnectorTerminationHealthRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'GetVoiceConnectorTerminationRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'InviteUsersRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'ListBotsRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'ListRoomMembershipsRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'ListRoomMembershipsRequest$RoomId' => '<p>The room ID.</p>', 'ListRoomsRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'ListSipRulesRequest$SipMediaApplicationId' => '<p>The SIP media application ID.</p>', 'ListUsersRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'ListVoiceConnectorTerminationCredentialsRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'LogoutUserRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'LogoutUserRequest$UserId' => '<p>The user ID.</p>', 'Member$MemberId' => '<p>The member ID (user ID or bot ID).</p>', 'Member$AccountId' => '<p>The Amazon Chime account ID.</p>', 'MemberError$MemberId' => '<p>The member ID.</p>', 'MembershipItem$MemberId' => '<p>The member ID.</p>', 'PhoneNumberError$PhoneNumberId' => '<p>The phone number ID for which the action failed.</p>', 'PutEventsConfigurationRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'PutEventsConfigurationRequest$BotId' => '<p>The bot ID.</p>', 'PutRetentionSettingsRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'PutSipMediaApplicationLoggingConfigurationRequest$SipMediaApplicationId' => '<p>The SIP media application ID.</p>', 'PutVoiceConnectorEmergencyCallingConfigurationRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'PutVoiceConnectorLoggingConfigurationRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'PutVoiceConnectorOriginationRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'PutVoiceConnectorStreamingConfigurationRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'PutVoiceConnectorTerminationCredentialsRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'PutVoiceConnectorTerminationRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'RedactConversationMessageRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'RedactConversationMessageRequest$ConversationId' => '<p>The conversation ID.</p>', 'RedactConversationMessageRequest$MessageId' => '<p>The message ID.</p>', 'RedactRoomMessageRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'RedactRoomMessageRequest$RoomId' => '<p>The room ID.</p>', 'RedactRoomMessageRequest$MessageId' => '<p>The message ID.</p>', 'RegenerateSecurityTokenRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'RegenerateSecurityTokenRequest$BotId' => '<p>The bot ID.</p>', 'ResetPersonalPINRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'ResetPersonalPINRequest$UserId' => '<p>The user ID.</p>', 'RestorePhoneNumberRequest$PhoneNumberId' => '<p>The phone number.</p>', 'Room$RoomId' => '<p>The room ID.</p>', 'Room$AccountId' => '<p>The Amazon Chime account ID.</p>', 'Room$CreatedBy' => '<p>The identifier of the room creator.</p>', 'RoomMembership$RoomId' => '<p>The room ID.</p>', 'RoomMembership$InvitedBy' => '<p>The identifier of the user that invited the room member.</p>', 'SigninDelegateGroup$GroupName' => '<p>The group name.</p>', 'SipMediaApplication$SipMediaApplicationId' => '<p>The SIP media application ID.</p>', 'SipRule$SipRuleId' => '<p>The SIP rule ID.</p>', 'SipRule$TriggerValue' => '<p>If <code>TriggerType</code> is <code>RequestUriHostname</code>, then the value can be the outbound host name of the Amazon Chime Voice Connector. If <code>TriggerType</code> is <code>ToPhoneNumber</code>, then the value can be a customer-owned phone number in E164 format. <code>SipRule</code> is triggered when a SIP rule requests host name or <code>ToPhoneNumber</code> matches in the incoming SIP request.</p>', 'SipRuleTargetApplication$SipMediaApplicationId' => '<p>The SIP media application ID.</p>', 'UpdateAccountRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'UpdateAccountSettingsRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'UpdateBotRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'UpdateBotRequest$BotId' => '<p>The bot ID.</p>', 'UpdatePhoneNumberRequestItem$PhoneNumberId' => '<p>The phone number ID to update.</p>', 'UpdateRoomMembershipRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'UpdateRoomMembershipRequest$RoomId' => '<p>The room ID.</p>', 'UpdateRoomMembershipRequest$MemberId' => '<p>The member ID.</p>', 'UpdateRoomRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'UpdateRoomRequest$RoomId' => '<p>The room ID.</p>', 'UpdateSipMediaApplicationCallRequest$SipMediaApplicationId' => '<p>The ID of the SIP media application handling the call.</p>', 'UpdateSipMediaApplicationCallRequest$TransactionId' => '<p>The ID of the call transaction.</p>', 'UpdateSipMediaApplicationRequest$SipMediaApplicationId' => '<p>The SIP media application ID.</p>', 'UpdateSipRuleRequest$SipRuleId' => '<p>The SIP rule ID.</p>', 'UpdateUserRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'UpdateUserRequest$UserId' => '<p>The user ID.</p>', 'UpdateUserRequestItem$UserId' => '<p>The user ID.</p>', 'UpdateVoiceConnectorGroupRequest$VoiceConnectorGroupId' => '<p>The Amazon Chime Voice Connector group ID.</p>', 'UpdateVoiceConnectorRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'UserError$UserId' => '<p>The user ID for which the action failed.</p>', 'UserIdList$member' => NULL, 'ValidateE911AddressRequest$AwsAccountId' => '<p>The AWS account ID.</p>', 'VoiceConnector$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'VoiceConnector$VoiceConnectorArn' => '<p>The ARN of the specified Amazon Chime Voice Connector.</p>', 'VoiceConnectorGroup$VoiceConnectorGroupId' => '<p>The Amazon Chime Voice Connector group ID.</p>', 'VoiceConnectorGroup$VoiceConnectorGroupArn' => '<p>The ARN of the specified Amazon Chime Voice Connector group.</p>', 'VoiceConnectorItem$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', ], ], 'NonEmptyString128' => [ 'base' => NULL, 'refs' => [ 'CreateProxySessionRequest$VoiceConnectorId' => '<p>The Amazon Chime voice connector ID.</p>', 'DeleteProxySessionRequest$VoiceConnectorId' => '<p>The Amazon Chime voice connector ID.</p>', 'DeleteProxySessionRequest$ProxySessionId' => '<p>The proxy session ID.</p>', 'DeleteVoiceConnectorProxyRequest$VoiceConnectorId' => '<p>The Amazon Chime Voice Connector ID.</p>', 'GetProxySessionRequest$VoiceConnectorId' => '<p>The Amazon Chime voice connector ID.</p>', 'GetProxySessionRequest$ProxySessionId' => '<p>The proxy session ID.</p>', 'GetVoiceConnectorProxyRequest$VoiceConnectorId' => '<p>The Amazon Chime voice connector ID.</p>', 'ListProxySessionsRequest$VoiceConnectorId' => '<p>The Amazon Chime voice connector ID.</p>', 'ProxySession$VoiceConnectorId' => '<p>The Amazon Chime voice connector ID.</p>', 'ProxySession$ProxySessionId' => '<p>The proxy session ID.</p>', 'PutVoiceConnectorProxyRequest$VoiceConnectorId' => '<p>The Amazon Chime voice connector ID.</p>', 'UpdateProxySessionRequest$VoiceConnectorId' => '<p>The Amazon Chime voice connector ID.</p>', 'UpdateProxySessionRequest$ProxySessionId' => '<p>The proxy session ID.</p>', ], ], 'NonEmptyStringList' => [ 'base' => NULL, 'refs' => [ 'BatchDeletePhoneNumberRequest$PhoneNumberIds' => '<p>List of phone number IDs.</p>', 'DisassociateSigninDelegateGroupsFromAccountRequest$GroupNames' => '<p>The sign-in delegate group names.</p>', ], ], 'NonNullableBoolean' => [ 'base' => NULL, 'refs' => [ 'ChannelMessage$Redacted' => '<p>Hides the content of a message.</p>', 'ChannelMessageSummary$Redacted' => '<p>Indicates whether a message was redacted.</p>', ], ], 'NotFoundException' => [ 'base' => '<p>One or more of the resources in the request does not exist in the system.</p>', 'refs' => [], ], 'NotificationTarget' => [ 'base' => NULL, 'refs' => [ 'StreamingNotificationTarget$NotificationTarget' => '<p>The streaming notification target.</p>', ], ], 'NullableBoolean' => [ 'base' => NULL, 'refs' => [ 'AssociatePhoneNumbersWithVoiceConnectorGroupRequest$ForceAssociate' => '<p>If true, associates the provided phone numbers with the provided Amazon Chime Voice Connector Group and removes any previously existing associations. If false, does not associate any phone numbers that have previously existing associations.</p>', 'AssociatePhoneNumbersWithVoiceConnectorRequest$ForceAssociate' => '<p>If true, associates the provided phone numbers with the provided Amazon Chime Voice Connector and removes any previously existing associations. If false, does not associate any phone numbers that have previously existing associations.</p>', 'Bot$Disabled' => '<p>When true, the bot is stopped from running in your account.</p>', 'CreateSipRuleRequest$Disabled' => '<p>Enables or disables a rule. You must disable rules before you can delete them.</p>', 'PhoneNumberCapabilities$InboundCall' => '<p>Allows or denies inbound calling for the specified phone number.</p>', 'PhoneNumberCapabilities$OutboundCall' => '<p>Allows or denies outbound calling for the specified phone number.</p>', 'PhoneNumberCapabilities$InboundSMS' => '<p>Allows or denies inbound SMS messaging for the specified phone number.</p>', 'PhoneNumberCapabilities$OutboundSMS' => '<p>Allows or denies outbound SMS messaging for the specified phone number.</p>', 'PhoneNumberCapabilities$InboundMMS' => '<p>Allows or denies inbound MMS messaging for the specified phone number.</p>', 'PhoneNumberCapabilities$OutboundMMS' => '<p>Allows or denies outbound MMS messaging for the specified phone number.</p>', 'UpdateBotRequest$Disabled' => '<p>When true, stops the specified bot from running in your account.</p>', 'UpdateSipRuleRequest$Disabled' => '<p>The new value specified to indicate whether the rule is disabled.</p>', ], ], 'NumberSelectionBehavior' => [ 'base' => NULL, 'refs' => [ 'CreateProxySessionRequest$NumberSelectionBehavior' => '<p>The preference for proxy phone number reuse, or stickiness, between the same participants across sessions.</p>', 'ProxySession$NumberSelectionBehavior' => '<p>The preference for proxy phone number reuse, or stickiness, between the same participants across sessions.</p>', ], ], 'OrderedPhoneNumber' => [ 'base' => '<p>A phone number for which an order has been placed.</p>', 'refs' => [ 'OrderedPhoneNumberList$member' => NULL, ], ], 'OrderedPhoneNumberList' => [ 'base' => NULL, 'refs' => [ 'PhoneNumberOrder$OrderedPhoneNumbers' => '<p>The ordered phone number details, such as the phone number in E.164 format and the phone number status.</p>', ], ], 'OrderedPhoneNumberStatus' => [ 'base' => NULL, 'refs' => [ 'OrderedPhoneNumber$Status' => '<p>The phone number status.</p>', ], ], 'Origination' => [ 'base' => '<p>Origination settings enable your SIP hosts to receive inbound calls using your Amazon Chime Voice Connector.</p> <note> <p>The parameters listed below are not required, but you must use at least one. </p> </note>', 'refs' => [ 'GetVoiceConnectorOriginationResponse$Origination' => '<p>The origination setting details.</p>', 'PutVoiceConnectorOriginationRequest$Origination' => '<p>The origination setting details to add.</p>', 'PutVoiceConnectorOriginationResponse$Origination' => '<p>The updated origination setting details.</p>', ], ], 'OriginationRoute' => [ 'base' => '<p>Origination routes define call distribution properties for your SIP hosts to receive inbound calls using your Amazon Chime Voice Connector. Limit: Ten origination routes for each Amazon Chime Voice Connector.</p> <note> <p>The parameters listed below are not required, but you must use at least one. </p> </note>', 'refs' => [ 'OriginationRouteList$member' => NULL, ], ], 'OriginationRouteList' => [ 'base' => NULL, 'refs' => [ 'Origination$Routes' => '<p>The call distribution properties defined for your SIP hosts. Valid range: Minimum value of 1. Maximum value of 20. This parameter is not required, but you must specify this parameter or <code>Disabled</code>.</p>', ], ], 'OriginationRoutePriority' => [ 'base' => NULL, 'refs' => [ 'OriginationRoute$Priority' => '<p>The priority associated with the host, with 1 being the highest priority. Higher priority hosts are attempted first.</p>', ], ], 'OriginationRouteProtocol' => [ 'base' => NULL, 'refs' => [ 'OriginationRoute$Protocol' => '<p>The protocol to use for the origination route. Encryption-enabled Amazon Chime Voice Connectors use TCP protocol by default.</p>', ], ], 'OriginationRouteWeight' => [ 'base' => NULL, 'refs' => [ 'OriginationRoute$Weight' => '<p>The weight associated with the host. If hosts are equal in priority, calls are redistributed among them based on their relative weight.</p>', ], ], 'Participant' => [ 'base' => '<p>The phone number and proxy phone number for a participant in an Amazon Chime Voice Connector proxy session.</p>', 'refs' => [ 'Participants$member' => NULL, ], ], 'ParticipantPhoneNumberList' => [ 'base' => NULL, 'refs' => [ 'CreateProxySessionRequest$ParticipantPhoneNumbers' => '<p>The participant phone numbers.</p>', ], ], 'Participants' => [ 'base' => NULL, 'refs' => [ 'ProxySession$Participants' => '<p>The proxy session participants.</p>', ], ], 'PhoneNumber' => [ 'base' => '<p>A phone number used for Amazon Chime Business Calling or an Amazon Chime Voice Connector.</p>', 'refs' => [ 'GetPhoneNumberResponse$PhoneNumber' => '<p>The phone number details.</p>', 'PhoneNumberList$member' => NULL, 'RestorePhoneNumberResponse$PhoneNumber' => '<p>The phone number details.</p>', 'UpdatePhoneNumberResponse$PhoneNumber' => '<p>The updated phone number details.</p>', ], ], 'PhoneNumberAssociation' => [ 'base' => '<p>The phone number associations, such as Amazon Chime account ID, Amazon Chime user ID, Amazon Chime Voice Connector ID, or Amazon Chime Voice Connector group ID.</p>', 'refs' => [ 'PhoneNumberAssociationList$member' => NULL, ], ], 'PhoneNumberAssociationList' => [ 'base' => NULL, 'refs' => [ 'PhoneNumber$Associations' => '<p>The phone number associations.</p>', ], ], 'PhoneNumberAssociationName' => [ 'base' => NULL, 'refs' => [ 'ListPhoneNumbersRequest$FilterName' => '<p>The filter to use to limit the number of results.</p>', 'PhoneNumberAssociation$Name' => '<p>Defines the association with an Amazon Chime account ID, user ID, Amazon Chime Voice Connector ID, or Amazon Chime Voice Connector group ID.</p>', ], ], 'PhoneNumberCapabilities' => [ 'base' => '<p>The phone number capabilities for Amazon Chime Business Calling phone numbers, such as enabled inbound and outbound calling and text messaging.</p>', 'refs' => [ 'PhoneNumber$Capabilities' => '<p>The phone number capabilities.</p>', ], ], 'PhoneNumberCountriesList' => [ 'base' => NULL, 'refs' => [ 'ListSupportedPhoneNumberCountriesResponse$PhoneNumberCountries' => '<p>The supported phone number countries.</p>', ], ], 'PhoneNumberCountry' => [ 'base' => '<p>The phone number country.</p>', 'refs' => [ 'PhoneNumberCountriesList$member' => NULL, ], ], 'PhoneNumberError' => [ 'base' => '<p>If the phone number action fails for one or more of the phone numbers in the request, a list of the phone numbers is returned, along with error codes and error messages.</p>', 'refs' => [ 'PhoneNumberErrorList$member' => NULL, ], ], 'PhoneNumberErrorList' => [ 'base' => NULL, 'refs' => [ 'AssociatePhoneNumbersWithVoiceConnectorGroupResponse$PhoneNumberErrors' => '<p>If the action fails for one or more of the phone numbers in the request, a list of the phone numbers is returned, along with error codes and error messages.</p>', 'AssociatePhoneNumbersWithVoiceConnectorResponse$PhoneNumberErrors' => '<p>If the action fails for one or more of the phone numbers in the request, a list of the phone numbers is returned, along with error codes and error messages.</p>', 'BatchDeletePhoneNumberResponse$PhoneNumberErrors' => '<p>If the action fails for one or more of the phone numbers in the request, a list of the phone numbers is returned, along with error codes and error messages.</p>', 'BatchUpdatePhoneNumberResponse$PhoneNumberErrors' => '<p>If the action fails for one or more of the phone numbers in the request, a list of the phone numbers is returned, along with error codes and error messages.</p>', 'DisassociatePhoneNumbersFromVoiceConnectorGroupResponse$PhoneNumberErrors' => '<p>If the action fails for one or more of the phone numbers in the request, a list of the phone numbers is returned, along with error codes and error messages.</p>', 'DisassociatePhoneNumbersFromVoiceConnectorResponse$PhoneNumberErrors' => '<p>If the action fails for one or more of the phone numbers in the request, a list of the phone numbers is returned, along with error codes and error messages.</p>', ], ], 'PhoneNumberList' => [ 'base' => NULL, 'refs' => [ 'ListPhoneNumbersResponse$PhoneNumbers' => '<p>The phone number details.</p>', ], ], 'PhoneNumberMaxResults' => [ 'base' => NULL, 'refs' => [ 'SearchAvailablePhoneNumbersRequest$MaxResults' => '<p>The maximum number of results to return in a single call.</p>', ], ], 'PhoneNumberOrder' => [ 'base' => '<p>The details of a phone number order created for Amazon Chime.</p>', 'refs' => [ 'CreatePhoneNumberOrderResponse$PhoneNumberOrder' => '<p>The phone number order details.</p>', 'GetPhoneNumberOrderResponse$PhoneNumberOrder' => '<p>The phone number order details.</p>', 'PhoneNumberOrderList$member' => NULL, ], ], 'PhoneNumberOrderList' => [ 'base' => NULL, 'refs' => [ 'ListPhoneNumberOrdersResponse$PhoneNumberOrders' => '<p>The phone number order details.</p>', ], ], 'PhoneNumberOrderStatus' => [ 'base' => NULL, 'refs' => [ 'PhoneNumberOrder$Status' => '<p>The status of the phone number order.</p>', ], ], 'PhoneNumberProductType' => [ 'base' => NULL, 'refs' => [ 'CreatePhoneNumberOrderRequest$ProductType' => '<p>The phone number product type.</p>', 'ListPhoneNumbersRequest$ProductType' => '<p>The phone number product type.</p>', 'ListSupportedPhoneNumberCountriesRequest$ProductType' => '<p>The phone number product type.</p>', 'PhoneNumber$ProductType' => '<p>The phone number product type.</p>', 'PhoneNumberOrder$ProductType' => '<p>The phone number order product type.</p>', 'UpdatePhoneNumberRequest$ProductType' => '<p>The product type.</p>', 'UpdatePhoneNumberRequestItem$ProductType' => '<p>The product type to update.</p>', ], ], 'PhoneNumberStatus' => [ 'base' => NULL, 'refs' => [ 'ListPhoneNumbersRequest$Status' => '<p>The phone number status.</p>', 'PhoneNumber$Status' => '<p>The phone number status.</p>', ], ], 'PhoneNumberType' => [ 'base' => NULL, 'refs' => [ 'PhoneNumber$Type' => '<p>The phone number type.</p>', 'PhoneNumberTypeList$member' => NULL, 'SearchAvailablePhoneNumbersRequest$PhoneNumberType' => '<p>The phone number type used to filter results. Required for non-US numbers.</p>', ], ], 'PhoneNumberTypeList' => [ 'base' => NULL, 'refs' => [ 'PhoneNumberCountry$SupportedPhoneNumberTypes' => '<p>The supported phone number types. </p>', ], ], 'Port' => [ 'base' => NULL, 'refs' => [ 'OriginationRoute$Port' => '<p>The designated origination route port. Defaults to 5060.</p>', ], ], 'PositiveInteger' => [ 'base' => NULL, 'refs' => [ 'CreateProxySessionRequest$ExpiryMinutes' => '<p>The number of minutes allowed for the proxy session.</p>', 'ProxySession$ExpiryMinutes' => '<p>The number of minutes allowed for the proxy session.</p>', 'UpdateProxySessionRequest$ExpiryMinutes' => '<p>The number of minutes allowed for the proxy session.</p>', ], ], 'ProfileServiceMaxResults' => [ 'base' => NULL, 'refs' => [ 'ListAccountsRequest$MaxResults' => '<p>The maximum number of results to return in a single call. Defaults to 100.</p>', 'ListUsersRequest$MaxResults' => '<p>The maximum number of results to return in a single call. Defaults to 100.</p>', ], ], 'Proxy' => [ 'base' => '<p>The proxy configuration for an Amazon Chime Voice Connector.</p>', 'refs' => [ 'GetVoiceConnectorProxyResponse$Proxy' => '<p>The proxy configuration details.</p>', 'PutVoiceConnectorProxyResponse$Proxy' => '<p>The proxy configuration details.</p>', ], ], 'ProxySession' => [ 'base' => '<p>The proxy session for an Amazon Chime Voice Connector.</p>', 'refs' => [ 'CreateProxySessionResponse$ProxySession' => '<p>The proxy session details.</p>', 'GetProxySessionResponse$ProxySession' => '<p>The proxy session details.</p>', 'ProxySessions$member' => NULL, 'UpdateProxySessionResponse$ProxySession' => '<p>The proxy session details.</p>', ], ], 'ProxySessionNameString' => [ 'base' => NULL, 'refs' => [ 'CreateProxySessionRequest$Name' => '<p>The name of the proxy session.</p>', ], ], 'ProxySessionStatus' => [ 'base' => NULL, 'refs' => [ 'ListProxySessionsRequest$Status' => '<p>The proxy session status.</p>', 'ProxySession$Status' => '<p>The status of the proxy session.</p>', ], ], 'ProxySessions' => [ 'base' => NULL, 'refs' => [ 'ListProxySessionsResponse$ProxySessions' => '<p>The proxy session details.</p>', ], ], 'PutAppInstanceRetentionSettingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutAppInstanceRetentionSettingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'PutAppInstanceStreamingConfigurationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutAppInstanceStreamingConfigurationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'PutEventsConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutEventsConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'PutRetentionSettingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutRetentionSettingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'PutSipMediaApplicationLoggingConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutSipMediaApplicationLoggingConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'PutVoiceConnectorEmergencyCallingConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutVoiceConnectorEmergencyCallingConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'PutVoiceConnectorLoggingConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutVoiceConnectorLoggingConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'PutVoiceConnectorOriginationRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutVoiceConnectorOriginationResponse' => [ 'base' => NULL, 'refs' => [], ], 'PutVoiceConnectorProxyRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutVoiceConnectorProxyResponse' => [ 'base' => NULL, 'refs' => [], ], 'PutVoiceConnectorStreamingConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutVoiceConnectorStreamingConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'PutVoiceConnectorTerminationCredentialsRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutVoiceConnectorTerminationRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutVoiceConnectorTerminationResponse' => [ 'base' => NULL, 'refs' => [], ], 'RedactChannelMessageRequest' => [ 'base' => NULL, 'refs' => [], ], 'RedactChannelMessageResponse' => [ 'base' => NULL, 'refs' => [], ], 'RedactConversationMessageRequest' => [ 'base' => NULL, 'refs' => [], ], 'RedactConversationMessageResponse' => [ 'base' => NULL, 'refs' => [], ], 'RedactRoomMessageRequest' => [ 'base' => NULL, 'refs' => [], ], 'RedactRoomMessageResponse' => [ 'base' => NULL, 'refs' => [], ], 'RegenerateSecurityTokenRequest' => [ 'base' => NULL, 'refs' => [], ], 'RegenerateSecurityTokenResponse' => [ 'base' => NULL, 'refs' => [], ], 'RegistrationStatus' => [ 'base' => NULL, 'refs' => [ 'User$UserRegistrationStatus' => '<p>The user registration status.</p>', ], ], 'ResetPersonalPINRequest' => [ 'base' => NULL, 'refs' => [], ], 'ResetPersonalPINResponse' => [ 'base' => NULL, 'refs' => [], ], 'ResourceLimitExceededException' => [ 'base' => '<p>The request exceeds the resource limit.</p>', 'refs' => [], ], 'ResourceName' => [ 'base' => NULL, 'refs' => [ 'Identity$Name' => '<p>The name in an Identity.</p>', ], ], 'RestorePhoneNumberRequest' => [ 'base' => NULL, 'refs' => [], ], 'RestorePhoneNumberResponse' => [ 'base' => NULL, 'refs' => [], ], 'ResultMax' => [ 'base' => NULL, 'refs' => [ 'ListAttendeesRequest$MaxResults' => '<p>The maximum number of results to return in a single call.</p>', 'ListBotsRequest$MaxResults' => '<p>The maximum number of results to return in a single call. The default is 10.</p>', 'ListMediaCapturePipelinesRequest$MaxResults' => '<p>The maximum number of results to return in a single call. Valid Range: 1 - 99.</p>', 'ListMeetingsRequest$MaxResults' => '<p>The maximum number of results to return in a single call.</p>', 'ListPhoneNumberOrdersRequest$MaxResults' => '<p>The maximum number of results to return in a single call.</p>', 'ListPhoneNumbersRequest$MaxResults' => '<p>The maximum number of results to return in a single call.</p>', 'ListProxySessionsRequest$MaxResults' => '<p>The maximum number of results to return in a single call.</p>', 'ListRoomMembershipsRequest$MaxResults' => '<p>The maximum number of results to return in a single call.</p>', 'ListRoomsRequest$MaxResults' => '<p>The maximum number of results to return in a single call.</p>', 'ListSipMediaApplicationsRequest$MaxResults' => '<p>The maximum number of results to return in a single call. Defaults to 100.</p>', 'ListSipRulesRequest$MaxResults' => '<p>The maximum number of results to return in a single call. Defaults to 100.</p>', 'ListVoiceConnectorGroupsRequest$MaxResults' => '<p>The maximum number of results to return in a single call.</p>', 'ListVoiceConnectorsRequest$MaxResults' => '<p>The maximum number of results to return in a single call.</p>', ], ], 'RetentionDays' => [ 'base' => NULL, 'refs' => [ 'ChannelRetentionSettings$RetentionDays' => '<p>The time in days to retain the messages in a channel.</p>', 'ConversationRetentionSettings$RetentionDays' => '<p>The number of days for which to retain conversation messages.</p>', 'RoomRetentionSettings$RetentionDays' => '<p>The number of days for which to retain chat-room messages.</p>', ], ], 'RetentionSettings' => [ 'base' => '<p>The retention settings for an Amazon Chime Enterprise account that determine how long to retain items such as chat-room messages and chat-conversation messages.</p>', 'refs' => [ 'GetRetentionSettingsResponse$RetentionSettings' => '<p>The retention settings.</p>', 'PutRetentionSettingsRequest$RetentionSettings' => '<p>The retention settings.</p>', 'PutRetentionSettingsResponse$RetentionSettings' => '<p>The retention settings.</p>', ], ], 'Room' => [ 'base' => '<p>The Amazon Chime chat room details.</p>', 'refs' => [ 'CreateRoomResponse$Room' => '<p>The room details.</p>', 'GetRoomResponse$Room' => '<p>The room details.</p>', 'RoomList$member' => NULL, 'UpdateRoomResponse$Room' => '<p>The room details.</p>', ], ], 'RoomList' => [ 'base' => NULL, 'refs' => [ 'ListRoomsResponse$Rooms' => '<p>The room details.</p>', ], ], 'RoomMembership' => [ 'base' => '<p>The room membership details.</p>', 'refs' => [ 'CreateRoomMembershipResponse$RoomMembership' => '<p>The room membership details.</p>', 'RoomMembershipList$member' => NULL, 'UpdateRoomMembershipResponse$RoomMembership' => '<p>The room membership details.</p>', ], ], 'RoomMembershipList' => [ 'base' => NULL, 'refs' => [ 'ListRoomMembershipsResponse$RoomMemberships' => '<p>The room membership details.</p>', ], ], 'RoomMembershipRole' => [ 'base' => NULL, 'refs' => [ 'CreateRoomMembershipRequest$Role' => '<p>The role of the member.</p>', 'MembershipItem$Role' => '<p>The member role.</p>', 'RoomMembership$Role' => '<p>The membership role.</p>', 'UpdateRoomMembershipRequest$Role' => '<p>The role of the member.</p>', ], ], 'RoomRetentionSettings' => [ 'base' => '<p>The retention settings that determine how long to retain chat-room messages for an Amazon Chime Enterprise account.</p>', 'refs' => [ 'RetentionSettings$RoomRetentionSettings' => '<p>The chat room retention settings.</p>', ], ], 'SMAUpdateCallArgumentsMap' => [ 'base' => NULL, 'refs' => [ 'UpdateSipMediaApplicationCallRequest$Arguments' => '<p>Arguments made available to the Lambda function as part of the <code>CALL_UPDATE_REQUESTED</code> event. Can contain 0-20 key-value pairs.</p>', ], ], 'SearchAvailablePhoneNumbersRequest' => [ 'base' => NULL, 'refs' => [], ], 'SearchAvailablePhoneNumbersResponse' => [ 'base' => NULL, 'refs' => [], ], 'SelectedVideoStreams' => [ 'base' => '<p>The video streams to capture for a specified media capture pipeline. The total number of video streams can\\'t exceed 25.</p>', 'refs' => [ 'SourceConfiguration$SelectedVideoStreams' => '<p>The selected video streams to capture for a specified media capture pipeline. The number of video streams can\\'t exceed 25.</p>', ], ], 'SendChannelMessageRequest' => [ 'base' => NULL, 'refs' => [], ], 'SendChannelMessageResponse' => [ 'base' => NULL, 'refs' => [], ], 'SensitiveNonEmptyString' => [ 'base' => NULL, 'refs' => [ 'Address$streetName' => '<p>The address street, such as <code>8th Avenue</code>.</p>', 'Address$streetSuffix' => '<p>The address suffix, such as the <code>N</code> in <code>8th Avenue N</code>.</p>', 'Address$postDirectional' => '<p>An address suffix location, such as the <code>S. Unit A</code> in <code>Central Park S. Unit A</code>.</p>', 'Address$preDirectional' => '<p>An address prefix location, such as the <code>N</code> in <code>N. Third St.</code>.</p>', 'Address$streetNumber' => '<p>The numeric portion of an address.</p>', 'Address$city' => '<p>The city of an address.</p>', 'Address$state' => '<p>The state of an address.</p>', 'Address$postalCode' => '<p>The postal code of an address.</p>', 'Address$postalCodePlus4' => '<p>The Zip + 4 or postal code + 4 of an address.</p>', 'Address$country' => '<p>The country of an address. </p>', 'CandidateAddress$streetInfo' => '<p>The street information of a candidate address</p>', 'CandidateAddress$streetNumber' => '<p>The numeric portion of a candidate address.</p>', 'CandidateAddress$city' => '<p>The city of a candidate address.</p>', 'CandidateAddress$state' => '<p>The state of a candidate address.</p>', 'CandidateAddress$postalCode' => '<p>The postal code of a candidate address.</p>', 'CandidateAddress$postalCodePlus4' => '<p>The Zip + 4 or postal code + 4 of a candidate address.</p>', 'CandidateAddress$country' => '<p>The country of a candidate address.</p>', 'ValidateE911AddressRequest$StreetNumber' => '<p>The address street number, such as <code>200</code> or <code>2121</code>.</p>', 'ValidateE911AddressRequest$StreetInfo' => '<p>The address street information, such as <code>8th Avenue</code>.</p>', 'ValidateE911AddressRequest$City' => '<p>The address city, such as <code>Portland</code>.</p>', 'ValidateE911AddressRequest$State' => '<p>The address state, such as <code>ME</code>.</p>', 'ValidateE911AddressRequest$Country' => '<p>The address country, such as <code>US</code>. </p>', 'ValidateE911AddressRequest$PostalCode' => '<p>The address postal code, such as <code>04352</code>.</p>', ], ], 'SensitiveString' => [ 'base' => NULL, 'refs' => [ 'AlexaForBusinessMetadata$AlexaForBusinessRoomArn' => '<p>The ARN of the room resource.</p>', 'Bot$DisplayName' => '<p>The bot display name.</p>', 'Bot$BotEmail' => '<p>The bot email address.</p>', 'Bot$SecurityToken' => '<p>The security token used to authenticate Amazon Chime with the outgoing event endpoint.</p>', 'CreateBotRequest$DisplayName' => '<p>The bot display name.</p>', 'CreateRoomRequest$Name' => '<p>The room name.</p>', 'Credential$Username' => '<p>The RFC2617 compliant user name associated with the SIP credentials, in US-ASCII format.</p>', 'Credential$Password' => '<p>The RFC2617 compliant password associated with the SIP credentials, in US-ASCII format.</p>', 'EventsConfiguration$OutboundEventsHTTPSEndpoint' => '<p>HTTPS endpoint that allows a bot to receive outgoing events.</p>', 'EventsConfiguration$LambdaFunctionArn' => '<p>Lambda function ARN that allows a bot to receive outgoing events.</p>', 'Member$Email' => '<p>The member email address.</p>', 'Member$FullName' => '<p>The member name.</p>', 'PutEventsConfigurationRequest$OutboundEventsHTTPSEndpoint' => '<p>HTTPS endpoint that allows the bot to receive outgoing events.</p>', 'PutEventsConfigurationRequest$LambdaFunctionArn' => '<p>Lambda function ARN that allows the bot to receive outgoing events.</p>', 'Room$Name' => '<p>The room name.</p>', 'SMAUpdateCallArgumentsMap$key' => NULL, 'SMAUpdateCallArgumentsMap$value' => NULL, 'SensitiveStringList$member' => NULL, 'SipHeadersMap$key' => NULL, 'SipHeadersMap$value' => NULL, 'UpdateRoomRequest$Name' => '<p>The room name.</p>', 'User$PrimaryProvisionedNumber' => '<p>The primary phone number associated with the user.</p>', 'User$DisplayName' => '<p>The display name of the user.</p>', ], ], 'SensitiveStringList' => [ 'base' => NULL, 'refs' => [ 'DeleteVoiceConnectorTerminationCredentialsRequest$Usernames' => '<p>The RFC2617 compliant username associated with the SIP credentials, in US-ASCII format.</p>', 'ListVoiceConnectorTerminationCredentialsResponse$Usernames' => '<p>A list of user names.</p>', ], ], 'ServiceFailureException' => [ 'base' => '<p>The service encountered an unexpected error.</p>', 'refs' => [], ], 'ServiceUnavailableException' => [ 'base' => '<p>The service is currently unavailable.</p>', 'refs' => [], ], 'SigninDelegateGroup' => [ 'base' => '<p>An Active Directory (AD) group whose members are granted permission to act as delegates.</p>', 'refs' => [ 'SigninDelegateGroupList$member' => NULL, ], ], 'SigninDelegateGroupList' => [ 'base' => NULL, 'refs' => [ 'Account$SigninDelegateGroups' => '<p>The sign-in delegate groups associated with the account.</p>', 'AssociateSigninDelegateGroupsWithAccountRequest$SigninDelegateGroups' => '<p>The sign-in delegate groups.</p>', ], ], 'SipApplicationPriority' => [ 'base' => NULL, 'refs' => [ 'SipRuleTargetApplication$Priority' => '<p>Priority of the SIP media application in the target list.</p>', ], ], 'SipHeadersMap' => [ 'base' => NULL, 'refs' => [ 'CreateSipMediaApplicationCallRequest$SipHeaders' => '<p>The SIP headers added to an outbound call leg.</p>', ], ], 'SipMediaApplication' => [ 'base' => '<p>The details of the SIP media application, including name and endpoints. An AWS account can have multiple SIP media applications.</p>', 'refs' => [ 'CreateSipMediaApplicationResponse$SipMediaApplication' => '<p>The SIP media application details.</p>', 'GetSipMediaApplicationResponse$SipMediaApplication' => '<p>The SIP media application details.</p>', 'SipMediaApplicationList$member' => NULL, 'UpdateSipMediaApplicationResponse$SipMediaApplication' => '<p>The updated SIP media application details.</p>', ], ], 'SipMediaApplicationCall' => [ 'base' => '<p>A <code>Call</code> instance for a SIP media application.</p>', 'refs' => [ 'CreateSipMediaApplicationCallResponse$SipMediaApplicationCall' => '<p>The actual call.</p>', 'UpdateSipMediaApplicationCallResponse$SipMediaApplicationCall' => '<p>A <code>Call</code> instance for a SIP media application.</p>', ], ], 'SipMediaApplicationEndpoint' => [ 'base' => '<p>The endpoint assigned to the SIP media application.</p>', 'refs' => [ 'SipMediaApplicationEndpointList$member' => NULL, ], ], 'SipMediaApplicationEndpointList' => [ 'base' => NULL, 'refs' => [ 'CreateSipMediaApplicationRequest$Endpoints' => '<p>List of endpoints (Lambda Amazon Resource Names) specified for the SIP media application. Currently, only one endpoint is supported.</p>', 'SipMediaApplication$Endpoints' => '<p>List of endpoints for SIP media application. Currently, only one endpoint per SIP media application is permitted.</p>', 'UpdateSipMediaApplicationRequest$Endpoints' => '<p>The new set of endpoints for the specified SIP media application.</p>', ], ], 'SipMediaApplicationList' => [ 'base' => NULL, 'refs' => [ 'ListSipMediaApplicationsResponse$SipMediaApplications' => '<p>List of SIP media applications and application details.</p>', ], ], 'SipMediaApplicationLoggingConfiguration' => [ 'base' => '<p>Logging configuration of the SIP media application.</p>', 'refs' => [ 'GetSipMediaApplicationLoggingConfigurationResponse$SipMediaApplicationLoggingConfiguration' => '<p>The actual logging configuration.</p>', 'PutSipMediaApplicationLoggingConfigurationRequest$SipMediaApplicationLoggingConfiguration' => '<p>The actual logging configuration.</p>', 'PutSipMediaApplicationLoggingConfigurationResponse$SipMediaApplicationLoggingConfiguration' => '<p>The logging configuration of the SIP media application.</p>', ], ], 'SipMediaApplicationName' => [ 'base' => NULL, 'refs' => [ 'CreateSipMediaApplicationRequest$Name' => '<p>The SIP media application name.</p>', 'SipMediaApplication$Name' => '<p>The name of the SIP media application.</p>', 'UpdateSipMediaApplicationRequest$Name' => '<p>The new name for the specified SIP media application.</p>', ], ], 'SipRule' => [ 'base' => '<p>The SIP rule details, including name, triggers, and target applications. An AWS account can have multiple SIP rules.</p>', 'refs' => [ 'CreateSipRuleResponse$SipRule' => '<p>Returns the SIP rule information, including the rule ID, triggers, and target applications.</p>', 'GetSipRuleResponse$SipRule' => '<p>The SIP rule details.</p>', 'SipRuleList$member' => NULL, 'UpdateSipRuleResponse$SipRule' => '<p>Updated SIP rule details.</p>', ], ], 'SipRuleList' => [ 'base' => NULL, 'refs' => [ 'ListSipRulesResponse$SipRules' => '<p>List of SIP rules and rule details.</p>', ], ], 'SipRuleName' => [ 'base' => NULL, 'refs' => [ 'CreateSipRuleRequest$Name' => '<p>The name of the SIP rule.</p>', 'SipRule$Name' => '<p>The name of the SIP rule.</p>', 'UpdateSipRuleRequest$Name' => '<p>The new name for the specified SIP rule.</p>', ], ], 'SipRuleTargetApplication' => [ 'base' => '<p>Target SIP media application and other details, such as priority and AWS Region, to be specified in the SIP rule. Only one SIP rule per AWS Region can be provided.</p>', 'refs' => [ 'SipRuleTargetApplicationList$member' => NULL, ], ], 'SipRuleTargetApplicationList' => [ 'base' => NULL, 'refs' => [ 'CreateSipRuleRequest$TargetApplications' => '<p>List of SIP media applications with priority and AWS Region. Only one SIP application per AWS Region can be used.</p>', 'SipRule$TargetApplications' => '<p>Target SIP media application and other details, such as priority and AWS Region, to be specified in the SIP rule. Only one SIP rule per AWS Region can be provided.</p>', 'UpdateSipRuleRequest$TargetApplications' => '<p>The new value of the list of target applications.</p>', ], ], 'SipRuleTriggerType' => [ 'base' => NULL, 'refs' => [ 'CreateSipRuleRequest$TriggerType' => '<p>The type of trigger assigned to the SIP rule in <code>TriggerValue</code>, currently <code>RequestUriHostname</code> or <code>ToPhoneNumber</code>.</p>', 'SipRule$TriggerType' => '<p>The type of trigger assigned to the SIP rule in <code>TriggerValue</code>, currently <code>RequestUriHostname</code> or <code>ToPhoneNumber</code>.</p>', ], ], 'SortOrder' => [ 'base' => NULL, 'refs' => [ 'ListChannelMessagesRequest$SortOrder' => '<p>The order in which you want messages sorted. Default is Descending, based on time created.</p>', ], ], 'SourceConfiguration' => [ 'base' => '<p>Source configuration for a specified media capture pipeline.</p>', 'refs' => [ 'ChimeSdkMeetingConfiguration$SourceConfiguration' => '<p>The source configuration for a specified media capture pipeline.</p>', ], ], 'StartMeetingTranscriptionRequest' => [ 'base' => NULL, 'refs' => [], ], 'StartMeetingTranscriptionResponse' => [ 'base' => NULL, 'refs' => [], ], 'StopMeetingTranscriptionRequest' => [ 'base' => NULL, 'refs' => [], ], 'StopMeetingTranscriptionResponse' => [ 'base' => NULL, 'refs' => [], ], 'StreamingConfiguration' => [ 'base' => '<p>The streaming configuration associated with an Amazon Chime Voice Connector. Specifies whether media streaming is enabled for sending to Amazon Kinesis, and shows the retention period for the Amazon Kinesis data, in hours.</p>', 'refs' => [ 'GetVoiceConnectorStreamingConfigurationResponse$StreamingConfiguration' => '<p>The streaming configuration details.</p>', 'PutVoiceConnectorStreamingConfigurationRequest$StreamingConfiguration' => '<p>The streaming configuration details to add.</p>', 'PutVoiceConnectorStreamingConfigurationResponse$StreamingConfiguration' => '<p>The updated streaming configuration details.</p>', ], ], 'StreamingNotificationTarget' => [ 'base' => '<p>The targeted recipient for a streaming configuration notification.</p>', 'refs' => [ 'StreamingNotificationTargetList$member' => NULL, ], ], 'StreamingNotificationTargetList' => [ 'base' => NULL, 'refs' => [ 'StreamingConfiguration$StreamingNotificationTargets' => '<p>The streaming notification targets.</p>', ], ], 'String' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$Message' => NULL, 'Account$AwsAccountId' => '<p>The AWS account ID.</p>', 'Account$AccountId' => '<p>The Amazon Chime account ID.</p>', 'Account$Name' => '<p>The Amazon Chime account name.</p>', 'AssociatePhoneNumberWithUserRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'AssociatePhoneNumberWithUserRequest$UserId' => '<p>The user ID.</p>', 'BadRequestException$Message' => NULL, 'BatchCreateChannelMembershipError$ErrorMessage' => '<p>The error message.</p>', 'Bot$BotId' => '<p>The bot ID.</p>', 'Bot$UserId' => '<p>The unique ID for the bot user.</p>', 'BusinessCallingSettings$CdrBucket' => '<p>The Amazon S3 bucket designated for call detail record storage.</p>', 'ConflictException$Message' => NULL, 'CreateAttendeeError$ErrorCode' => '<p>The error code.</p>', 'CreateAttendeeError$ErrorMessage' => '<p>The error message.</p>', 'CreateMeetingRequest$MediaRegion' => '<p> The Region in which to create the meeting. Default: <code>us-east-1</code>. </p> <p> Available values: <code>af-south-1</code> , <code>ap-northeast-1</code> , <code>ap-northeast-2</code> , <code>ap-south-1</code> , <code>ap-southeast-1</code> , <code>ap-southeast-2</code> , <code>ca-central-1</code> , <code>eu-central-1</code> , <code>eu-north-1</code> , <code>eu-south-1</code> , <code>eu-west-1</code> , <code>eu-west-2</code> , <code>eu-west-3</code> , <code>sa-east-1</code> , <code>us-east-1</code> , <code>us-east-2</code> , <code>us-west-1</code> , <code>us-west-2</code> . </p>', 'CreateMeetingWithAttendeesRequest$MediaRegion' => '<p> The Region in which to create the meeting. Default: <code>us-east-1</code> . </p> <p> Available values: <code>af-south-1</code> , <code>ap-northeast-1</code> , <code>ap-northeast-2</code> , <code>ap-south-1</code> , <code>ap-southeast-1</code> , <code>ap-southeast-2</code> , <code>ca-central-1</code> , <code>eu-central-1</code> , <code>eu-north-1</code> , <code>eu-south-1</code> , <code>eu-west-1</code> , <code>eu-west-2</code> , <code>eu-west-3</code> , <code>sa-east-1</code> , <code>us-east-1</code> , <code>us-east-2</code> , <code>us-west-1</code> , <code>us-west-2</code> . </p>', 'CreateSipMediaApplicationRequest$AwsRegion' => '<p>The AWS Region assigned to the SIP media application.</p>', 'CreateUserRequest$Username' => '<p>The user name.</p>', 'DeletePhoneNumberRequest$PhoneNumberId' => '<p>The phone number ID.</p>', 'DisassociatePhoneNumberFromUserRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'DisassociatePhoneNumberFromUserRequest$UserId' => '<p>The user ID.</p>', 'EngineTranscribeMedicalSettings$VocabularyName' => '<p>The name of the vocabulary passed to Amazon Transcribe Medical.</p>', 'EngineTranscribeSettings$VocabularyFilterName' => '<p>Specify the name of the custom vocabulary filter that you want to use when processing your transcription. Note that vocabulary filter names are case sensitive. </p> <p>If you use Amazon Transcribe in multiple Regions, the vocabulary filter must be available in Amazon Transcribe in each Region.</p> <p>If you include <code>IdentifyLanguage</code> and want to use one or more vocabulary filters with your transcription, use the <code>VocabularyFilterNames</code> parameter instead.</p>', 'EngineTranscribeSettings$VocabularyName' => '<p>Specify the name of the custom vocabulary that you want to use when processing your transcription. Note that vocabulary names are case sensitive.</p> <p>If you use Amazon Transcribe multiple Regions, the vocabulary must be available in Amazon Transcribe in each Region.</p> <p>If you include <code>IdentifyLanguage</code> and want to use one or more custom vocabularies with your transcription, use the <code>VocabularyNames</code> parameter instead.</p>', 'EventsConfiguration$BotId' => '<p>The bot ID.</p>', 'ForbiddenException$Message' => NULL, 'GetPhoneNumberRequest$PhoneNumberId' => '<p>The phone number ID.</p>', 'GetUserSettingsRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'GetUserSettingsRequest$UserId' => '<p>The user ID.</p>', 'Invite$InviteId' => '<p>The invite ID.</p>', 'ListAccountsRequest$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListAccountsResponse$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListAttendeesRequest$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListAttendeesResponse$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListBotsRequest$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListBotsResponse$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListMediaCapturePipelinesRequest$NextToken' => '<p>The token used to retrieve the next page of results.</p>', 'ListMediaCapturePipelinesResponse$NextToken' => '<p>The token used to retrieve the next page of results. </p>', 'ListMeetingsRequest$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListMeetingsResponse$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListPhoneNumberOrdersRequest$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListPhoneNumberOrdersResponse$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListPhoneNumbersRequest$FilterValue' => '<p>The value to use for the filter.</p>', 'ListPhoneNumbersRequest$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListPhoneNumbersResponse$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListRoomMembershipsRequest$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListRoomMembershipsResponse$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListRoomsRequest$MemberId' => '<p>The member ID (user ID or bot ID).</p>', 'ListRoomsRequest$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListRoomsResponse$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListUsersRequest$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListUsersResponse$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListVoiceConnectorGroupsRequest$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListVoiceConnectorGroupsResponse$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListVoiceConnectorsRequest$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListVoiceConnectorsResponse$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'Meeting$MediaRegion' => '<p>The Region in which you create the meeting. Available values: <code>af-south-1</code>, <code>ap-northeast-1</code>, <code>ap-northeast-2</code>, <code>ap-south-1</code>, <code>ap-southeast-1</code>, <code>ap-southeast-2</code>, <code>ca-central-1</code>, <code>eu-central-1</code>, <code>eu-north-1</code>, <code>eu-south-1</code>, <code>eu-west-1</code>, <code>eu-west-2</code>, <code>eu-west-3</code>, <code>sa-east-1</code>, <code>us-east-1</code>, <code>us-east-2</code>, <code>us-west-1</code>, <code>us-west-2</code>.</p>', 'MemberError$ErrorMessage' => '<p>The error message.</p>', 'NonEmptyStringList$member' => NULL, 'NotFoundException$Message' => NULL, 'OriginationRoute$Host' => '<p>The FQDN or IP address to contact for origination traffic.</p>', 'PhoneNumber$PhoneNumberId' => '<p>The phone number ID.</p>', 'PhoneNumberAssociation$Value' => '<p>Contains the ID for the entity specified in Name.</p>', 'PhoneNumberError$ErrorMessage' => '<p>The error message.</p>', 'ResourceLimitExceededException$Message' => NULL, 'SearchAvailablePhoneNumbersRequest$AreaCode' => '<p>The area code used to filter results. Only applies to the US.</p>', 'SearchAvailablePhoneNumbersRequest$City' => '<p>The city used to filter results. Only applies to the US.</p>', 'SearchAvailablePhoneNumbersRequest$State' => '<p>The state used to filter results. Required only if you provide <code>City</code>. Only applies to the US.</p>', 'SearchAvailablePhoneNumbersRequest$NextToken' => '<p>The token used to retrieve the next page of results.</p>', 'SearchAvailablePhoneNumbersResponse$NextToken' => '<p>The token used to retrieve the next page of search results.</p>', 'ServiceFailureException$Message' => NULL, 'ServiceUnavailableException$Message' => NULL, 'SipMediaApplication$AwsRegion' => '<p>The AWS Region in which the SIP media application is created.</p>', 'SipRuleTargetApplication$AwsRegion' => '<p>The AWS Region of the target application.</p>', 'StringList$member' => NULL, 'TerminationHealth$Source' => '<p>The source IP address.</p>', 'ThrottledClientException$Message' => NULL, 'UnauthorizedClientException$Message' => NULL, 'UnprocessableEntityException$Message' => NULL, 'UpdatePhoneNumberRequest$PhoneNumberId' => '<p>The phone number ID.</p>', 'UpdateUserSettingsRequest$AccountId' => '<p>The Amazon Chime account ID.</p>', 'UpdateUserSettingsRequest$UserId' => '<p>The user ID.</p>', 'User$UserId' => '<p>The user ID.</p>', 'User$AccountId' => '<p>The Amazon Chime account ID.</p>', 'User$PersonalPIN' => '<p>The user\\'s personal meeting PIN.</p>', 'UserError$ErrorMessage' => '<p>The error message.</p>', 'ValidateE911AddressResponse$AddressExternalId' => '<p>The ID that represents the address.</p>', 'VoiceConnector$OutboundHostName' => '<p>The outbound host name for the Amazon Chime Voice Connector.</p>', 'VoiceConnectorSettings$CdrBucket' => '<p>The Amazon S3 bucket designated for call detail record storage.</p>', ], ], 'String128' => [ 'base' => NULL, 'refs' => [ 'ProxySession$Name' => '<p>The name of the proxy session.</p>', ], ], 'StringList' => [ 'base' => NULL, 'refs' => [ 'Proxy$PhoneNumberCountries' => '<p>The countries for proxy phone numbers to be selected from.</p>', 'Termination$CidrAllowedList' => '<p>The IP addresses allowed to make calls, in CIDR format. Required.</p>', ], ], 'Tag' => [ 'base' => '<p>Describes a tag applied to a resource.</p>', 'refs' => [ 'AttendeeTagList$member' => NULL, 'MeetingTagList$member' => NULL, 'TagList$member' => NULL, ], ], 'TagAttendeeRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'AttendeeTagKeyList$member' => NULL, 'MeetingTagKeyList$member' => NULL, 'Tag$Key' => '<p>The key of the tag.</p>', 'TagKeyList$member' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$TagKeys' => '<p>The tag keys.</p>', ], ], 'TagList' => [ 'base' => NULL, 'refs' => [ 'CreateAppInstanceRequest$Tags' => '<p>Tags assigned to the <code>AppInstance</code>.</p>', 'CreateAppInstanceUserRequest$Tags' => '<p>Tags assigned to the <code>AppInstanceUser</code>.</p>', 'CreateChannelRequest$Tags' => '<p>The tags for the creation request.</p>', 'ListAttendeeTagsResponse$Tags' => '<p>A list of tag key-value pairs.</p>', 'ListMeetingTagsResponse$Tags' => '<p>A list of tag key-value pairs.</p>', 'ListTagsForResourceResponse$Tags' => '<p>A list of tag-key value pairs.</p>', 'TagResourceRequest$Tags' => '<p>The tag key-value pairs.</p>', ], ], 'TagMeetingRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'Tag$Value' => '<p>The value of the tag.</p>', ], ], 'TelephonySettings' => [ 'base' => '<p>Settings that allow management of telephony permissions for an Amazon Chime user, such as inbound and outbound calling and text messaging.</p>', 'refs' => [ 'UserSettings$Telephony' => '<p>The telephony settings associated with the user.</p>', ], ], 'Termination' => [ 'base' => '<p>Termination settings enable your SIP hosts to make outbound calls using your Amazon Chime Voice Connector.</p>', 'refs' => [ 'GetVoiceConnectorTerminationResponse$Termination' => '<p>The termination setting details.</p>', 'PutVoiceConnectorTerminationRequest$Termination' => '<p>The termination setting details to add.</p>', 'PutVoiceConnectorTerminationResponse$Termination' => '<p>The updated termination setting details.</p>', ], ], 'TerminationHealth' => [ 'base' => '<p>The termination health details, including the source IP address and timestamp of the last successful SIP <code>OPTIONS</code> message from your SIP infrastructure.</p>', 'refs' => [ 'GetVoiceConnectorTerminationHealthResponse$TerminationHealth' => '<p>The termination health details.</p>', ], ], 'ThrottledClientException' => [ 'base' => '<p>The client exceeded its request rate limit.</p>', 'refs' => [], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [ 'AppInstance$CreatedTimestamp' => '<p>The time at which an <code>AppInstance</code> was created. In epoch milliseconds.</p>', 'AppInstance$LastUpdatedTimestamp' => '<p>The time an <code>AppInstance</code> was last updated. In epoch milliseconds.</p>', 'AppInstanceAdmin$CreatedTimestamp' => '<p>The time at which an administrator was created.</p>', 'AppInstanceUser$CreatedTimestamp' => '<p>The time at which the <code>AppInstanceUser</code> was created.</p>', 'AppInstanceUser$LastUpdatedTimestamp' => '<p>The time at which the <code>AppInstanceUser</code> was last updated.</p>', 'AppInstanceUserMembershipSummary$ReadMarkerTimestamp' => '<p>The time at which a message was last read.</p>', 'Channel$CreatedTimestamp' => '<p>The time at which the <code>AppInstanceUser</code> created the channel.</p>', 'Channel$LastMessageTimestamp' => '<p>The time at which a member sent the last message in the channel.</p>', 'Channel$LastUpdatedTimestamp' => '<p>The time at which a channel was last updated.</p>', 'ChannelBan$CreatedTimestamp' => '<p>The time at which the ban was created.</p>', 'ChannelMembership$CreatedTimestamp' => '<p>The time at which the channel membership was created.</p>', 'ChannelMembership$LastUpdatedTimestamp' => '<p>The time at which a channel membership was last updated.</p>', 'ChannelMessage$CreatedTimestamp' => '<p>The time at which the message was created.</p>', 'ChannelMessage$LastEditedTimestamp' => '<p>The time at which a message was edited.</p>', 'ChannelMessage$LastUpdatedTimestamp' => '<p>The time at which a message was updated.</p>', 'ChannelMessageSummary$CreatedTimestamp' => '<p>The time at which the message summary was created.</p>', 'ChannelMessageSummary$LastUpdatedTimestamp' => '<p>The time at which a message was last updated.</p>', 'ChannelMessageSummary$LastEditedTimestamp' => '<p>The time at which a message was last edited.</p>', 'ChannelModerator$CreatedTimestamp' => '<p>The time at which the moderator was created.</p>', 'ChannelSummary$LastMessageTimestamp' => '<p>The time at which the last message in a channel was sent.</p>', 'GetAppInstanceRetentionSettingsResponse$InitiateDeletionTimestamp' => '<p>The timestamp representing the time at which the specified items are retained, in Epoch Seconds.</p>', 'ListChannelMessagesRequest$NotBefore' => '<p>The initial or starting time stamp for your requested messages.</p>', 'ListChannelMessagesRequest$NotAfter' => '<p>The final or ending time stamp for your requested messages.</p>', 'PutAppInstanceRetentionSettingsResponse$InitiateDeletionTimestamp' => '<p>The time at which the API deletes data.</p>', ], ], 'TollFreePrefix' => [ 'base' => NULL, 'refs' => [ 'SearchAvailablePhoneNumbersRequest$TollFreePrefix' => '<p>The toll-free prefix that you use to filter results. Only applies to the US.</p>', ], ], 'TranscribeContentIdentificationType' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$ContentIdentificationType' => '<p>Labels all personally identifiable information (PII) identified in your transcript. If you don\\'t include <code>PiiEntityTypes</code>, all PII is identified.</p> <p>You can\u00e2\u20ac\u2122t set <code>ContentIdentificationType</code> and <code>ContentRedactionType</code>.</p>', ], ], 'TranscribeContentRedactionType' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$ContentRedactionType' => '<p>Content redaction is performed at the segment level. If you don\\'t include <code>PiiEntityTypes</code>, all PII is redacted.</p> <p>You can\u00e2\u20ac\u2122t set <code>ContentIdentificationType</code> and <code>ContentRedactionType</code>.</p>', ], ], 'TranscribeLanguageCode' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$LanguageCode' => '<p>Specify the language code that represents the language spoken.</p> <p>If you\\'re unsure of the language spoken in your audio, consider using <code>IdentifyLanguage</code> to enable automatic language identification.</p>', 'EngineTranscribeSettings$PreferredLanguage' => '<p>Specify a preferred language from the subset of languages codes you specified in <code>LanguageOptions</code>.</p> <p>You can only use this parameter if you include <code>IdentifyLanguage</code> and <code>LanguageOptions</code>.</p>', ], ], 'TranscribeLanguageModelName' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$LanguageModelName' => '<p>Specify the name of the custom language model that you want to use when processing your transcription. Note that language model names are case sensitive.</p> <p>The language of the specified language model must match the language code. If the languages don\\'t match, the custom language model isn\\'t applied. There are no errors or warnings associated with a language mismatch.</p> <p>If you use Amazon Transcribe in multiple Regions, the custom language model must be available in Amazon Transcribe in each Region.</p>', ], ], 'TranscribeLanguageOptions' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$LanguageOptions' => '<p>Specify two or more language codes that represent the languages you think may be present in your media; including more than five is not recommended. If you\\'re unsure what languages are present, do not include this parameter.</p> <p>Including language options can improve the accuracy of language identification.</p> <p>If you include <code>LanguageOptions</code>, you must also include <code>IdentifyLanguage</code>.</p> <important> <p>You can only include one language dialect per language. For example, you cannot include <code>en-US</code> and <code>en-AU</code>.</p> </important>', ], ], 'TranscribeMedicalContentIdentificationType' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeMedicalSettings$ContentIdentificationType' => '<p>Labels all personally identifiable information (PII) identified in your transcript. If you don\\'t include <code>PiiEntityTypes</code>, all PII is identified.</p> <p>You can\u00e2\u20ac\u2122t set <code>ContentIdentificationType</code> and <code>ContentRedactionType</code>.</p>', ], ], 'TranscribeMedicalLanguageCode' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeMedicalSettings$LanguageCode' => '<p>The language code specified for the Amazon Transcribe Medical engine.</p>', ], ], 'TranscribeMedicalRegion' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeMedicalSettings$Region' => '<p>The AWS Region passed to Amazon Transcribe Medical. If you don\\'t specify a Region, Amazon Chime uses the meeting\\'s Region.</p>', ], ], 'TranscribeMedicalSpecialty' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeMedicalSettings$Specialty' => '<p>The specialty specified for the Amazon Transcribe Medical engine.</p>', ], ], 'TranscribeMedicalType' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeMedicalSettings$Type' => '<p>The type of transcription.</p>', ], ], 'TranscribePartialResultsStability' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$PartialResultsStability' => '<p>Specify the level of stability to use when you enable partial results stabilization (<code>EnablePartialResultsStabilization</code>).</p> <p>Low stability provides the highest accuracy. High stability transcribes faster, but with slightly lower accuracy.</p>', ], ], 'TranscribePiiEntityTypes' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$PiiEntityTypes' => '<p>Specify which types of personally identifiable information (PII) you want to redact in your transcript. You can include as many types as you\\'d like, or you can select <code>ALL</code>.</p> <p>Values must be comma-separated and can include: <code>ADDRESS</code>, <code>BANK_ACCOUNT_NUMBER</code>, <code>BANK_ROUTING</code>, <code>CREDIT_DEBIT_CVV</code>, <code>CREDIT_DEBIT_EXPIRY</code> <code>CREDIT_DEBIT_NUMBER</code>, <code>EMAIL</code>,<code>NAME</code>, <code>PHONE</code>, <code>PIN</code>, <code>SSN</code>, or <code>ALL</code>.</p> <p>Note that if you include <code>PiiEntityTypes</code>, you must also include <code>ContentIdentificationType</code> or <code>ContentRedactionType</code>.</p> <p>If you include <code>ContentRedactionType</code> or <code>ContentIdentificationType</code>, but do not include <code>PiiEntityTypes</code>, all PII is redacted or identified.</p>', ], ], 'TranscribeRegion' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$Region' => '<p>The AWS Region in which to use Amazon Transcribe.</p> <p>If you don\\'t specify a Region, then the <code>MediaRegion</code> parameter of the <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_CreateMeeting.html\">CreateMeeting.html</a> API will be used. However, if Amazon Transcribe is not available in the <code>MediaRegion</code>, then a TranscriptFailed event is sent.</p> <p>Use <code>auto</code> to use Amazon Transcribe in a Region near the meeting\u00e2\u20ac\u2122s <code>MediaRegion</code>. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/transcription-options.html#choose-region\">Choosing a transcription Region</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p>', ], ], 'TranscribeVocabularyFilterMethod' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$VocabularyFilterMethod' => '<p>Specify how you want your vocabulary filter applied to your transcript.</p> <p> To replace words with <code>***</code>, choose <code>mask</code>.</p> <p>To delete words, choose <code>remove</code>.</p> <p>To flag words without changing them, choose <code>tag</code>.</p>', ], ], 'TranscribeVocabularyNamesOrFilterNamesString' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$VocabularyNames' => '<p>Specify the names of the custom vocabularies that you want to use when processing your transcription. Note that vocabulary names are case sensitive.</p> <p>If you use Amazon Transcribe in multiple Regions, the vocabulary must be available in Amazon Transcribe in each Region.</p> <p>If you don\\'t include <code>IdentifyLanguage</code> and want to use a custom vocabulary with your transcription, use the <code>VocabularyName</code> parameter instead.</p>', 'EngineTranscribeSettings$VocabularyFilterNames' => '<p>Specify the names of the custom vocabulary filters that you want to use when processing your transcription. Note that vocabulary filter names are case sensitive.</p> <p>If you use Amazon Transcribe in multiple Regions, the vocabulary filter must be available in Amazon Transcribe in each Region.</p> <p> If you\\'re <i>not</i> including <code>IdentifyLanguage</code> and want to use a custom vocabulary filter with your transcription, use the <code>VocabularyFilterName</code> parameter instead.</p>', ], ], 'TranscriptionConfiguration' => [ 'base' => '<p>The configuration for the current transcription operation. Must contain <code>EngineTranscribeSettings</code> or <code>EngineTranscribeMedicalSettings</code>.</p>', 'refs' => [ 'StartMeetingTranscriptionRequest$TranscriptionConfiguration' => '<p>The configuration for the current transcription operation. Must contain <code>EngineTranscribeSettings</code> or <code>EngineTranscribeMedicalSettings</code>.</p>', ], ], 'UnauthorizedClientException' => [ 'base' => '<p>The client is not currently authorized to make the request.</p>', 'refs' => [], ], 'UnprocessableEntityException' => [ 'base' => '<p>The request was well-formed but was unable to be followed due to semantic errors.</p>', 'refs' => [], ], 'UntagAttendeeRequest' => [ 'base' => NULL, 'refs' => [], ], 'UntagMeetingRequest' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAccountRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAccountResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAccountSettingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAccountSettingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAppInstanceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAppInstanceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAppInstanceUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAppInstanceUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateBotRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateBotResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateChannelMessageRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateChannelMessageResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateChannelReadMarkerRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateChannelReadMarkerResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateChannelRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateChannelResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateGlobalSettingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdatePhoneNumberRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdatePhoneNumberRequestItem' => [ 'base' => '<p>The phone number ID, product type, or calling name fields to update, used with the <a>BatchUpdatePhoneNumber</a> and <a>UpdatePhoneNumber</a> actions.</p>', 'refs' => [ 'UpdatePhoneNumberRequestItemList$member' => NULL, ], ], 'UpdatePhoneNumberRequestItemList' => [ 'base' => NULL, 'refs' => [ 'BatchUpdatePhoneNumberRequest$UpdatePhoneNumberRequestItems' => '<p>The request containing the phone number IDs and product types or calling names to update.</p>', ], ], 'UpdatePhoneNumberResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdatePhoneNumberSettingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateProxySessionRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateProxySessionResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateRoomMembershipRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateRoomMembershipResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateRoomRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateRoomResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateSipMediaApplicationCallRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateSipMediaApplicationCallResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateSipMediaApplicationRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateSipMediaApplicationResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateSipRuleRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateSipRuleResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateUserRequestItem' => [ 'base' => '<p>The user ID and user fields to update, used with the <a>BatchUpdateUser</a> action.</p>', 'refs' => [ 'UpdateUserRequestItemList$member' => NULL, ], ], 'UpdateUserRequestItemList' => [ 'base' => NULL, 'refs' => [ 'BatchUpdateUserRequest$UpdateUserRequestItems' => '<p>The request containing the user IDs and details to update.</p>', ], ], 'UpdateUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateUserSettingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateVoiceConnectorGroupRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateVoiceConnectorGroupResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateVoiceConnectorRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateVoiceConnectorResponse' => [ 'base' => NULL, 'refs' => [], ], 'UriType' => [ 'base' => NULL, 'refs' => [ 'MediaPlacement$AudioHostUrl' => '<p>The audio host URL.</p>', 'MediaPlacement$AudioFallbackUrl' => '<p>The audio fallback URL.</p>', 'MediaPlacement$ScreenDataUrl' => '<p>The screen data URL.</p> <important> <p> <b>This parameter is is no longer supported and no longer used by the Amazon Chime SDK.</b> </p> </important>', 'MediaPlacement$ScreenSharingUrl' => '<p>The screen sharing URL.</p> <important> <p> <b>This parameter is is no longer supported and no longer used by the Amazon Chime SDK.</b>.</p> </important>', 'MediaPlacement$ScreenViewingUrl' => '<p>The screen viewing URL.</p> <important> <p> <b>This parameter is is no longer supported and no longer used by the Amazon Chime SDK.</b> </p> </important>', 'MediaPlacement$SignalingUrl' => '<p>The signaling URL.</p>', 'MediaPlacement$TurnControlUrl' => '<p>The turn control URL.</p> <important> <p> <b>This parameter is is no longer supported and no longer used by the Amazon Chime SDK.</b> </p> </important>', 'MediaPlacement$EventIngestionUrl' => '<p>The event ingestion URL to which you send client meeting events.</p>', ], ], 'UrlType' => [ 'base' => NULL, 'refs' => [ 'MessagingSessionEndpoint$Url' => '<p>The endpoint to which you establish a websocket connection.</p>', ], ], 'User' => [ 'base' => '<p>The user on the Amazon Chime account.</p>', 'refs' => [ 'CreateUserResponse$User' => '<p>The user on the Amazon Chime account.</p>', 'GetUserResponse$User' => '<p>The user details.</p>', 'ResetPersonalPINResponse$User' => '<p>The user details and new personal meeting PIN.</p>', 'UpdateUserResponse$User' => '<p>The updated user details.</p>', 'UserList$member' => NULL, ], ], 'UserEmailList' => [ 'base' => NULL, 'refs' => [ 'InviteUsersRequest$UserEmailList' => '<p>The user email addresses to which to send the email invitation.</p>', ], ], 'UserError' => [ 'base' => '<p>The list of errors returned when errors are encountered during the <a>BatchSuspendUser</a>, <a>BatchUnsuspendUser</a>, or <a>BatchUpdateUser</a> actions. This includes user IDs, error codes, and error messages.</p>', 'refs' => [ 'UserErrorList$member' => NULL, ], ], 'UserErrorList' => [ 'base' => NULL, 'refs' => [ 'BatchSuspendUserResponse$UserErrors' => '<p>If the <a>BatchSuspendUser</a> action fails for one or more of the user IDs in the request, a list of the user IDs is returned, along with error codes and error messages.</p>', 'BatchUnsuspendUserResponse$UserErrors' => '<p>If the <a>BatchUnsuspendUser</a> action fails for one or more of the user IDs in the request, a list of the user IDs is returned, along with error codes and error messages.</p>', 'BatchUpdateUserResponse$UserErrors' => '<p>If the <a>BatchUpdateUser</a> action fails for one or more of the user IDs in the request, a list of the user IDs is returned, along with error codes and error messages.</p>', ], ], 'UserId' => [ 'base' => NULL, 'refs' => [ 'CreateAppInstanceUserRequest$AppInstanceUserId' => '<p>The user ID of the <code>AppInstance</code>.</p>', ], ], 'UserIdList' => [ 'base' => NULL, 'refs' => [ 'BatchSuspendUserRequest$UserIdList' => '<p>The request containing the user IDs to suspend.</p>', 'BatchUnsuspendUserRequest$UserIdList' => '<p>The request containing the user IDs to unsuspend.</p>', ], ], 'UserList' => [ 'base' => NULL, 'refs' => [ 'ListUsersResponse$Users' => '<p>List of users and user details.</p>', ], ], 'UserName' => [ 'base' => NULL, 'refs' => [ 'AppInstanceUser$Name' => '<p>The name of the <code>AppInstanceUser</code>.</p>', 'AppInstanceUserSummary$Name' => '<p>The name of an <code>AppInstanceUser</code>.</p>', 'CreateAppInstanceUserRequest$Name' => '<p>The user\\'s name.</p>', 'UpdateAppInstanceUserRequest$Name' => '<p>The name of the <code>AppInstanceUser</code>.</p>', ], ], 'UserSettings' => [ 'base' => '<p>Settings associated with an Amazon Chime user, including inbound and outbound calling and text messaging.</p>', 'refs' => [ 'GetUserSettingsResponse$UserSettings' => '<p>The user settings.</p>', 'UpdateUserSettingsRequest$UserSettings' => '<p>The user settings to update.</p>', ], ], 'UserType' => [ 'base' => NULL, 'refs' => [ 'CreateUserRequest$UserType' => '<p>The user type.</p>', 'InviteUsersRequest$UserType' => '<p>The user type.</p>', 'ListUsersRequest$UserType' => '<p>The user type.</p>', 'UpdateUserRequest$UserType' => '<p>The user type.</p>', 'UpdateUserRequestItem$UserType' => '<p>The user type.</p>', 'User$UserType' => '<p>The user type.</p>', ], ], 'ValidateE911AddressRequest' => [ 'base' => NULL, 'refs' => [], ], 'ValidateE911AddressResponse' => [ 'base' => NULL, 'refs' => [], ], 'ValidationResult' => [ 'base' => NULL, 'refs' => [ 'ValidateE911AddressResponse$ValidationResult' => '<p>Number indicating the result of address validation. <code>0</code> means the address was perfect as is and successfully validated. <code>1</code> means the address was corrected. <code>2</code> means the address sent was not close enough and was not validated.</p>', ], ], 'VideoArtifactsConfiguration' => [ 'base' => '<p>The video artifact configuration object.</p>', 'refs' => [ 'ArtifactsConfiguration$Video' => '<p>The configuration for the video artifacts.</p>', ], ], 'VideoMuxType' => [ 'base' => NULL, 'refs' => [ 'VideoArtifactsConfiguration$MuxType' => '<p>The MUX type of the video artifact configuration object.</p>', ], ], 'VoiceConnector' => [ 'base' => '<p>The Amazon Chime Voice Connector configuration, including outbound host name and encryption settings.</p>', 'refs' => [ 'CreateVoiceConnectorResponse$VoiceConnector' => '<p>The Amazon Chime Voice Connector details.</p>', 'GetVoiceConnectorResponse$VoiceConnector' => '<p>The Amazon Chime Voice Connector details.</p>', 'UpdateVoiceConnectorResponse$VoiceConnector' => '<p>The updated Amazon Chime Voice Connector details.</p>', 'VoiceConnectorList$member' => NULL, ], ], 'VoiceConnectorAwsRegion' => [ 'base' => NULL, 'refs' => [ 'CreateVoiceConnectorRequest$AwsRegion' => '<p> The AWS Region in which the Amazon Chime Voice Connector is created. Default value: <code>us-east-1</code> . </p>', 'VoiceConnector$AwsRegion' => '<p> The AWS Region in which the Amazon Chime Voice Connector is created. Default: <code>us-east-1</code>. </p>', ], ], 'VoiceConnectorGroup' => [ 'base' => '<p>The Amazon Chime Voice Connector group configuration, including associated Amazon Chime Voice Connectors. You can include Amazon Chime Voice Connectors from different AWS Regions in your group. This creates a fault tolerant mechanism for fallback in case of availability events.</p>', 'refs' => [ 'CreateVoiceConnectorGroupResponse$VoiceConnectorGroup' => '<p>The Amazon Chime Voice Connector group details.</p>', 'GetVoiceConnectorGroupResponse$VoiceConnectorGroup' => '<p>The Amazon Chime Voice Connector group details.</p>', 'UpdateVoiceConnectorGroupResponse$VoiceConnectorGroup' => '<p>The updated Amazon Chime Voice Connector group details.</p>', 'VoiceConnectorGroupList$member' => NULL, ], ], 'VoiceConnectorGroupList' => [ 'base' => NULL, 'refs' => [ 'ListVoiceConnectorGroupsResponse$VoiceConnectorGroups' => '<p>The details of the Amazon Chime Voice Connector groups.</p>', ], ], 'VoiceConnectorGroupName' => [ 'base' => NULL, 'refs' => [ 'CreateVoiceConnectorGroupRequest$Name' => '<p>The name of the Amazon Chime Voice Connector group.</p>', 'UpdateVoiceConnectorGroupRequest$Name' => '<p>The name of the Amazon Chime Voice Connector group.</p>', 'VoiceConnectorGroup$Name' => '<p>The name of the Amazon Chime Voice Connector group.</p>', ], ], 'VoiceConnectorItem' => [ 'base' => '<p>For Amazon Chime Voice Connector groups, the Amazon Chime Voice Connectors to which to route inbound calls. Includes priority configuration settings. Limit: 3 <code>VoiceConnectorItems</code> per Amazon Chime Voice Connector group.</p>', 'refs' => [ 'VoiceConnectorItemList$member' => NULL, ], ], 'VoiceConnectorItemList' => [ 'base' => NULL, 'refs' => [ 'CreateVoiceConnectorGroupRequest$VoiceConnectorItems' => '<p>The Amazon Chime Voice Connectors to route inbound calls to.</p>', 'UpdateVoiceConnectorGroupRequest$VoiceConnectorItems' => '<p>The <code>VoiceConnectorItems</code> to associate with the group.</p>', 'VoiceConnectorGroup$VoiceConnectorItems' => '<p>The Amazon Chime Voice Connectors to which to route inbound calls.</p>', ], ], 'VoiceConnectorItemPriority' => [ 'base' => NULL, 'refs' => [ 'VoiceConnectorItem$Priority' => '<p>The priority associated with the Amazon Chime Voice Connector, with 1 being the highest priority. Higher priority Amazon Chime Voice Connectors are attempted first.</p>', ], ], 'VoiceConnectorList' => [ 'base' => NULL, 'refs' => [ 'ListVoiceConnectorsResponse$VoiceConnectors' => '<p>The details of the Amazon Chime Voice Connectors.</p>', ], ], 'VoiceConnectorName' => [ 'base' => NULL, 'refs' => [ 'CreateVoiceConnectorRequest$Name' => '<p>The name of the Amazon Chime Voice Connector.</p>', 'UpdateVoiceConnectorRequest$Name' => '<p>The name of the Amazon Chime Voice Connector.</p>', 'VoiceConnector$Name' => '<p>The name of the Amazon Chime Voice Connector.</p>', ], ], 'VoiceConnectorSettings' => [ 'base' => '<p>The Amazon Chime Voice Connector settings. Includes any Amazon S3 buckets designated for storing call detail records.</p>', 'refs' => [ 'GetGlobalSettingsResponse$VoiceConnector' => '<p>The Amazon Chime Voice Connector settings.</p>', 'UpdateGlobalSettingsRequest$VoiceConnector' => '<p>The Amazon Chime Voice Connector settings.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime/2018-05-01/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], 'aws', ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], false, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], false, ], ], ], 'endpoint' => [ 'url' => 'https://chime.us-east-1.amazonaws.com', 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'chime', 'signingRegion' => 'us-east-1', ], ], ], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://chime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://chime-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://chime.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://chime.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime/2018-05-01/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region aws-global with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'chime', 'signingRegion' => 'us-east-1', ], ], ], 'url' => 'https://chime.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'aws-global', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://chime-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://chime-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://chime.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'properties' => [ 'authSchemes' => [ [ 'name' => 'sigv4', 'signingName' => 'chime', 'signingRegion' => 'us-east-1', ], ], ], 'url' => 'https://chime.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://chime-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://chime-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://chime.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://chime.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://chime-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://chime-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://chime.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://chime.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://chime-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://chime.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://chime-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://chime.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime/2018-05-01/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime/2018-05-01/paginators-1.json\nreturn [ 'pagination' => [ 'ListAccounts' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListAppInstanceAdmins' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListAppInstanceUsers' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListAppInstances' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListAttendees' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListBots' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListChannelBans' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListChannelMemberships' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListChannelMembershipsForAppInstanceUser' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListChannelMessages' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListChannelModerators' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListChannels' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListChannelsModeratedByAppInstanceUser' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListMediaCapturePipelines' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListMeetings' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListPhoneNumberOrders' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListPhoneNumbers' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListProxySessions' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListRoomMemberships' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListRooms' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListSipMediaApplications' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListSipRules' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListUsers' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListVoiceConnectorGroups' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListVoiceConnectors' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'SearchAvailablePhoneNumbers' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-identity/2021-04-20/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2021-04-20', 'endpointPrefix' => 'identity-chime', 'protocol' => 'rest-json', 'serviceFullName' => 'Amazon Chime SDK Identity', 'serviceId' => 'Chime SDK Identity', 'signatureVersion' => 'v4', 'signingName' => 'chime', 'uid' => 'chime-sdk-identity-2021-04-20', ], 'operations' => [ 'CreateAppInstance' => [ 'name' => 'CreateAppInstance', 'http' => [ 'method' => 'POST', 'requestUri' => '/app-instances', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateAppInstanceRequest', ], 'output' => [ 'shape' => 'CreateAppInstanceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateAppInstanceAdmin' => [ 'name' => 'CreateAppInstanceAdmin', 'http' => [ 'method' => 'POST', 'requestUri' => '/app-instances/{appInstanceArn}/admins', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateAppInstanceAdminRequest', ], 'output' => [ 'shape' => 'CreateAppInstanceAdminResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateAppInstanceBot' => [ 'name' => 'CreateAppInstanceBot', 'http' => [ 'method' => 'POST', 'requestUri' => '/app-instance-bots', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateAppInstanceBotRequest', ], 'output' => [ 'shape' => 'CreateAppInstanceBotResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateAppInstanceUser' => [ 'name' => 'CreateAppInstanceUser', 'http' => [ 'method' => 'POST', 'requestUri' => '/app-instance-users', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateAppInstanceUserRequest', ], 'output' => [ 'shape' => 'CreateAppInstanceUserResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteAppInstance' => [ 'name' => 'DeleteAppInstance', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/app-instances/{appInstanceArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteAppInstanceRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteAppInstanceAdmin' => [ 'name' => 'DeleteAppInstanceAdmin', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/app-instances/{appInstanceArn}/admins/{appInstanceAdminArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteAppInstanceAdminRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteAppInstanceBot' => [ 'name' => 'DeleteAppInstanceBot', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/app-instance-bots/{appInstanceBotArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteAppInstanceBotRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteAppInstanceUser' => [ 'name' => 'DeleteAppInstanceUser', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/app-instance-users/{appInstanceUserArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteAppInstanceUserRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeregisterAppInstanceUserEndpoint' => [ 'name' => 'DeregisterAppInstanceUserEndpoint', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/app-instance-users/{appInstanceUserArn}/endpoints/{endpointId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeregisterAppInstanceUserEndpointRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DescribeAppInstance' => [ 'name' => 'DescribeAppInstance', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instances/{appInstanceArn}', ], 'input' => [ 'shape' => 'DescribeAppInstanceRequest', ], 'output' => [ 'shape' => 'DescribeAppInstanceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DescribeAppInstanceAdmin' => [ 'name' => 'DescribeAppInstanceAdmin', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instances/{appInstanceArn}/admins/{appInstanceAdminArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeAppInstanceAdminRequest', ], 'output' => [ 'shape' => 'DescribeAppInstanceAdminResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DescribeAppInstanceBot' => [ 'name' => 'DescribeAppInstanceBot', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instance-bots/{appInstanceBotArn}', ], 'input' => [ 'shape' => 'DescribeAppInstanceBotRequest', ], 'output' => [ 'shape' => 'DescribeAppInstanceBotResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DescribeAppInstanceUser' => [ 'name' => 'DescribeAppInstanceUser', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instance-users/{appInstanceUserArn}', ], 'input' => [ 'shape' => 'DescribeAppInstanceUserRequest', ], 'output' => [ 'shape' => 'DescribeAppInstanceUserResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DescribeAppInstanceUserEndpoint' => [ 'name' => 'DescribeAppInstanceUserEndpoint', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instance-users/{appInstanceUserArn}/endpoints/{endpointId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeAppInstanceUserEndpointRequest', ], 'output' => [ 'shape' => 'DescribeAppInstanceUserEndpointResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetAppInstanceRetentionSettings' => [ 'name' => 'GetAppInstanceRetentionSettings', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instances/{appInstanceArn}/retention-settings', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetAppInstanceRetentionSettingsRequest', ], 'output' => [ 'shape' => 'GetAppInstanceRetentionSettingsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListAppInstanceAdmins' => [ 'name' => 'ListAppInstanceAdmins', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instances/{appInstanceArn}/admins', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAppInstanceAdminsRequest', ], 'output' => [ 'shape' => 'ListAppInstanceAdminsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListAppInstanceBots' => [ 'name' => 'ListAppInstanceBots', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instance-bots', ], 'input' => [ 'shape' => 'ListAppInstanceBotsRequest', ], 'output' => [ 'shape' => 'ListAppInstanceBotsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListAppInstanceUserEndpoints' => [ 'name' => 'ListAppInstanceUserEndpoints', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instance-users/{appInstanceUserArn}/endpoints', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAppInstanceUserEndpointsRequest', ], 'output' => [ 'shape' => 'ListAppInstanceUserEndpointsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListAppInstanceUsers' => [ 'name' => 'ListAppInstanceUsers', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instance-users', ], 'input' => [ 'shape' => 'ListAppInstanceUsersRequest', ], 'output' => [ 'shape' => 'ListAppInstanceUsersResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListAppInstances' => [ 'name' => 'ListAppInstances', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instances', ], 'input' => [ 'shape' => 'ListAppInstancesRequest', ], 'output' => [ 'shape' => 'ListAppInstancesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'PutAppInstanceRetentionSettings' => [ 'name' => 'PutAppInstanceRetentionSettings', 'http' => [ 'method' => 'PUT', 'requestUri' => '/app-instances/{appInstanceArn}/retention-settings', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutAppInstanceRetentionSettingsRequest', ], 'output' => [ 'shape' => 'PutAppInstanceRetentionSettingsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'PutAppInstanceUserExpirationSettings' => [ 'name' => 'PutAppInstanceUserExpirationSettings', 'http' => [ 'method' => 'PUT', 'requestUri' => '/app-instance-users/{appInstanceUserArn}/expiration-settings', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutAppInstanceUserExpirationSettingsRequest', ], 'output' => [ 'shape' => 'PutAppInstanceUserExpirationSettingsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'RegisterAppInstanceUserEndpoint' => [ 'name' => 'RegisterAppInstanceUserEndpoint', 'http' => [ 'method' => 'POST', 'requestUri' => '/app-instance-users/{appInstanceUserArn}/endpoints', 'responseCode' => 201, ], 'input' => [ 'shape' => 'RegisterAppInstanceUserEndpointRequest', ], 'output' => [ 'shape' => 'RegisterAppInstanceUserEndpointResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags?operation=tag-resource', 'responseCode' => 204, ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags?operation=untag-resource', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateAppInstance' => [ 'name' => 'UpdateAppInstance', 'http' => [ 'method' => 'PUT', 'requestUri' => '/app-instances/{appInstanceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateAppInstanceRequest', ], 'output' => [ 'shape' => 'UpdateAppInstanceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateAppInstanceBot' => [ 'name' => 'UpdateAppInstanceBot', 'http' => [ 'method' => 'PUT', 'requestUri' => '/app-instance-bots/{appInstanceBotArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateAppInstanceBotRequest', ], 'output' => [ 'shape' => 'UpdateAppInstanceBotResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateAppInstanceUser' => [ 'name' => 'UpdateAppInstanceUser', 'http' => [ 'method' => 'PUT', 'requestUri' => '/app-instance-users/{appInstanceUserArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateAppInstanceUserRequest', ], 'output' => [ 'shape' => 'UpdateAppInstanceUserResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateAppInstanceUserEndpoint' => [ 'name' => 'UpdateAppInstanceUserEndpoint', 'http' => [ 'method' => 'PUT', 'requestUri' => '/app-instance-users/{appInstanceUserArn}/endpoints/{endpointId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateAppInstanceUserEndpointRequest', ], 'output' => [ 'shape' => 'UpdateAppInstanceUserEndpointResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], ], 'shapes' => [ 'AllowMessages' => [ 'type' => 'string', 'enum' => [ 'ALL', 'NONE', ], ], 'AppInstance' => [ 'type' => 'structure', 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], 'Metadata' => [ 'shape' => 'Metadata', ], ], ], 'AppInstanceAdmin' => [ 'type' => 'structure', 'members' => [ 'Admin' => [ 'shape' => 'Identity', ], 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'AppInstanceAdminList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AppInstanceAdminSummary', ], ], 'AppInstanceAdminSummary' => [ 'type' => 'structure', 'members' => [ 'Admin' => [ 'shape' => 'Identity', ], ], ], 'AppInstanceBot' => [ 'type' => 'structure', 'members' => [ 'AppInstanceBotArn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'ResourceName', ], 'Configuration' => [ 'shape' => 'Configuration', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], 'Metadata' => [ 'shape' => 'Metadata', ], ], ], 'AppInstanceBotList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AppInstanceBotSummary', ], ], 'AppInstanceBotSummary' => [ 'type' => 'structure', 'members' => [ 'AppInstanceBotArn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'ResourceName', ], 'Metadata' => [ 'shape' => 'Metadata', ], ], ], 'AppInstanceList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AppInstanceSummary', ], ], 'AppInstanceRetentionSettings' => [ 'type' => 'structure', 'members' => [ 'ChannelRetentionSettings' => [ 'shape' => 'ChannelRetentionSettings', ], ], ], 'AppInstanceSummary' => [ 'type' => 'structure', 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'Metadata' => [ 'shape' => 'Metadata', ], ], ], 'AppInstanceUser' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'UserName', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], 'ExpirationSettings' => [ 'shape' => 'ExpirationSettings', ], ], ], 'AppInstanceUserEndpoint' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', ], 'EndpointId' => [ 'shape' => 'String64', ], 'Name' => [ 'shape' => 'SensitiveString1600', ], 'Type' => [ 'shape' => 'AppInstanceUserEndpointType', ], 'ResourceArn' => [ 'shape' => 'ChimeArn', ], 'EndpointAttributes' => [ 'shape' => 'EndpointAttributes', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], 'AllowMessages' => [ 'shape' => 'AllowMessages', ], 'EndpointState' => [ 'shape' => 'EndpointState', ], ], ], 'AppInstanceUserEndpointSummary' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', ], 'EndpointId' => [ 'shape' => 'String64', ], 'Name' => [ 'shape' => 'SensitiveString1600', ], 'Type' => [ 'shape' => 'AppInstanceUserEndpointType', ], 'AllowMessages' => [ 'shape' => 'AllowMessages', ], 'EndpointState' => [ 'shape' => 'EndpointState', ], ], ], 'AppInstanceUserEndpointSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AppInstanceUserEndpointSummary', ], ], 'AppInstanceUserEndpointType' => [ 'type' => 'string', 'enum' => [ 'APNS', 'APNS_SANDBOX', 'GCM', ], ], 'AppInstanceUserList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AppInstanceUserSummary', ], ], 'AppInstanceUserSummary' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'UserName', ], 'Metadata' => [ 'shape' => 'Metadata', ], ], ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ChannelRetentionSettings' => [ 'type' => 'structure', 'members' => [ 'RetentionDays' => [ 'shape' => 'RetentionDays', ], ], ], 'ChimeArn' => [ 'type' => 'string', 'max' => 1600, 'min' => 5, 'pattern' => 'arn:[a-z0-9-\\\\.]{1,63}:[a-z0-9-\\\\.]{0,63}:[a-z0-9-\\\\.]{0,63}:[a-z0-9-\\\\.]{0,63}:[^/].{0,1023}', ], 'ClientRequestToken' => [ 'type' => 'string', 'max' => 64, 'min' => 2, 'pattern' => '[-_a-zA-Z0-9]*', ], 'Configuration' => [ 'type' => 'structure', 'required' => [ 'Lex', ], 'members' => [ 'Lex' => [ 'shape' => 'LexConfiguration', ], ], ], 'ConflictException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'CreateAppInstanceAdminRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceAdminArn', 'AppInstanceArn', ], 'members' => [ 'AppInstanceAdminArn' => [ 'shape' => 'ChimeArn', ], 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], ], ], 'CreateAppInstanceAdminResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceAdmin' => [ 'shape' => 'Identity', ], 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], ], ], 'CreateAppInstanceBotRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', 'ClientRequestToken', 'Configuration', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'ResourceName', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], 'Configuration' => [ 'shape' => 'Configuration', ], ], ], 'CreateAppInstanceBotResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceBotArn' => [ 'shape' => 'ChimeArn', ], ], ], 'CreateAppInstanceRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'ClientRequestToken', ], 'members' => [ 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateAppInstanceResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], ], ], 'CreateAppInstanceUserRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', 'AppInstanceUserId', 'Name', 'ClientRequestToken', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'AppInstanceUserId' => [ 'shape' => 'UserId', ], 'Name' => [ 'shape' => 'UserName', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], 'ExpirationSettings' => [ 'shape' => 'ExpirationSettings', ], ], ], 'CreateAppInstanceUserResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', ], ], ], 'DeleteAppInstanceAdminRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceAdminArn', 'AppInstanceArn', ], 'members' => [ 'AppInstanceAdminArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceAdminArn', ], 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], ], ], 'DeleteAppInstanceBotRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceBotArn', ], 'members' => [ 'AppInstanceBotArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceBotArn', ], ], ], 'DeleteAppInstanceRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], ], ], 'DeleteAppInstanceUserRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceUserArn', ], 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceUserArn', ], ], ], 'DeregisterAppInstanceUserEndpointRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceUserArn', 'EndpointId', ], 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceUserArn', ], 'EndpointId' => [ 'shape' => 'String64', 'location' => 'uri', 'locationName' => 'endpointId', ], ], ], 'DescribeAppInstanceAdminRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceAdminArn', 'AppInstanceArn', ], 'members' => [ 'AppInstanceAdminArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceAdminArn', ], 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], ], ], 'DescribeAppInstanceAdminResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceAdmin' => [ 'shape' => 'AppInstanceAdmin', ], ], ], 'DescribeAppInstanceBotRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceBotArn', ], 'members' => [ 'AppInstanceBotArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceBotArn', ], ], ], 'DescribeAppInstanceBotResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceBot' => [ 'shape' => 'AppInstanceBot', ], ], ], 'DescribeAppInstanceRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], ], ], 'DescribeAppInstanceResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstance' => [ 'shape' => 'AppInstance', ], ], ], 'DescribeAppInstanceUserEndpointRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceUserArn', 'EndpointId', ], 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'String1600', 'location' => 'uri', 'locationName' => 'appInstanceUserArn', ], 'EndpointId' => [ 'shape' => 'String64', 'location' => 'uri', 'locationName' => 'endpointId', ], ], ], 'DescribeAppInstanceUserEndpointResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserEndpoint' => [ 'shape' => 'AppInstanceUserEndpoint', ], ], ], 'DescribeAppInstanceUserRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceUserArn', ], 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceUserArn', ], ], ], 'DescribeAppInstanceUserResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUser' => [ 'shape' => 'AppInstanceUser', ], ], ], 'EndpointAttributes' => [ 'type' => 'structure', 'required' => [ 'DeviceToken', ], 'members' => [ 'DeviceToken' => [ 'shape' => 'NonEmptySensitiveString1600', ], 'VoipDeviceToken' => [ 'shape' => 'NonEmptySensitiveString1600', ], ], ], 'EndpointState' => [ 'type' => 'structure', 'required' => [ 'Status', ], 'members' => [ 'Status' => [ 'shape' => 'EndpointStatus', ], 'StatusReason' => [ 'shape' => 'EndpointStatusReason', ], ], ], 'EndpointStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'INACTIVE', ], ], 'EndpointStatusReason' => [ 'type' => 'string', 'enum' => [ 'INVALID_DEVICE_TOKEN', 'INVALID_PINPOINT_ARN', ], ], 'ErrorCode' => [ 'type' => 'string', 'enum' => [ 'BadRequest', 'Conflict', 'Forbidden', 'NotFound', 'PreconditionFailed', 'ResourceLimitExceeded', 'ServiceFailure', 'AccessDenied', 'ServiceUnavailable', 'Throttled', 'Throttling', 'Unauthorized', 'Unprocessable', 'VoiceConnectorGroupAssociationsExist', 'PhoneNumberAssociationsExist', ], ], 'ExpirationCriterion' => [ 'type' => 'string', 'enum' => [ 'CREATED_TIMESTAMP', ], ], 'ExpirationDays' => [ 'type' => 'integer', 'max' => 5475, 'min' => 1, ], 'ExpirationSettings' => [ 'type' => 'structure', 'required' => [ 'ExpirationDays', 'ExpirationCriterion', ], 'members' => [ 'ExpirationDays' => [ 'shape' => 'ExpirationDays', ], 'ExpirationCriterion' => [ 'shape' => 'ExpirationCriterion', ], ], ], 'ForbiddenException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 403, ], 'exception' => true, ], 'GetAppInstanceRetentionSettingsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], ], ], 'GetAppInstanceRetentionSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceRetentionSettings' => [ 'shape' => 'AppInstanceRetentionSettings', ], 'InitiateDeletionTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'Identity' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'ResourceName', ], ], ], 'InvokedBy' => [ 'type' => 'structure', 'required' => [ 'StandardMessages', 'TargetedMessages', ], 'members' => [ 'StandardMessages' => [ 'shape' => 'StandardMessages', ], 'TargetedMessages' => [ 'shape' => 'TargetedMessages', ], ], ], 'LexBotAliasArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 15, 'pattern' => 'arn:aws:lex:[a-z]{2}-[a-z]+-\\\\d{1}:\\\\d{12}:bot-alias/[A-Z0-9]{10}/[A-Z0-9]{10}', ], 'LexConfiguration' => [ 'type' => 'structure', 'required' => [ 'LexBotAliasArn', 'LocaleId', ], 'members' => [ 'RespondsTo' => [ 'shape' => 'RespondsTo', ], 'InvokedBy' => [ 'shape' => 'InvokedBy', ], 'LexBotAliasArn' => [ 'shape' => 'LexBotAliasArn', ], 'LocaleId' => [ 'shape' => 'String', ], 'WelcomeIntent' => [ 'shape' => 'LexIntentName', ], ], ], 'LexIntentName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '^([A-Za-z]_?)+$', ], 'ListAppInstanceAdminsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListAppInstanceAdminsResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'AppInstanceAdmins' => [ 'shape' => 'AppInstanceAdminList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListAppInstanceBotsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'app-instance-arn', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListAppInstanceBotsResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'AppInstanceBots' => [ 'shape' => 'AppInstanceBotList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListAppInstanceUserEndpointsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceUserArn', ], 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'SensitiveChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceUserArn', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListAppInstanceUserEndpointsResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserEndpoints' => [ 'shape' => 'AppInstanceUserEndpointSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListAppInstanceUsersRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'app-instance-arn', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListAppInstanceUsersResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'AppInstanceUsers' => [ 'shape' => 'AppInstanceUserList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListAppInstancesRequest' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListAppInstancesResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstances' => [ 'shape' => 'AppInstanceList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'arn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], ], ], 'MaxResults' => [ 'type' => 'integer', 'max' => 50, 'min' => 1, ], 'Metadata' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'pattern' => '.*', 'sensitive' => true, ], 'NextToken' => [ 'type' => 'string', 'max' => 2048, 'min' => 0, 'pattern' => '.*', 'sensitive' => true, ], 'NonEmptyResourceName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', 'sensitive' => true, ], 'NonEmptySensitiveString1600' => [ 'type' => 'string', 'max' => 1600, 'min' => 1, 'pattern' => '.*', 'sensitive' => true, ], 'NotFoundException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'PutAppInstanceRetentionSettingsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', 'AppInstanceRetentionSettings', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], 'AppInstanceRetentionSettings' => [ 'shape' => 'AppInstanceRetentionSettings', ], ], ], 'PutAppInstanceRetentionSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceRetentionSettings' => [ 'shape' => 'AppInstanceRetentionSettings', ], 'InitiateDeletionTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'PutAppInstanceUserExpirationSettingsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceUserArn', ], 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceUserArn', ], 'ExpirationSettings' => [ 'shape' => 'ExpirationSettings', ], ], ], 'PutAppInstanceUserExpirationSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', ], 'ExpirationSettings' => [ 'shape' => 'ExpirationSettings', ], ], ], 'RegisterAppInstanceUserEndpointRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceUserArn', 'Type', 'ResourceArn', 'EndpointAttributes', 'ClientRequestToken', ], 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'SensitiveChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceUserArn', ], 'Name' => [ 'shape' => 'SensitiveString1600', ], 'Type' => [ 'shape' => 'AppInstanceUserEndpointType', ], 'ResourceArn' => [ 'shape' => 'ChimeArn', ], 'EndpointAttributes' => [ 'shape' => 'EndpointAttributes', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'AllowMessages' => [ 'shape' => 'AllowMessages', ], ], ], 'RegisterAppInstanceUserEndpointResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', ], 'EndpointId' => [ 'shape' => 'String64', ], ], ], 'ResourceLimitExceededException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ResourceName' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', 'sensitive' => true, ], 'RespondsTo' => [ 'type' => 'string', 'enum' => [ 'STANDARD_MESSAGES', ], ], 'RetentionDays' => [ 'type' => 'integer', 'max' => 5475, 'min' => 1, ], 'SensitiveChimeArn' => [ 'type' => 'string', 'max' => 1600, 'min' => 5, 'pattern' => 'arn:[a-z0-9-\\\\.]{1,63}:[a-z0-9-\\\\.]{0,63}:[a-z0-9-\\\\.]{0,63}:[a-z0-9-\\\\.]{0,63}:[^/].{0,1023}', 'sensitive' => true, ], 'SensitiveString1600' => [ 'type' => 'string', 'max' => 1600, 'min' => 0, 'pattern' => '.*', 'sensitive' => true, ], 'ServiceFailureException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'ServiceUnavailableException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], 'StandardMessages' => [ 'type' => 'string', 'enum' => [ 'AUTO', 'ALL', 'MENTIONS', 'NONE', ], ], 'String' => [ 'type' => 'string', ], 'String1600' => [ 'type' => 'string', 'max' => 1600, 'min' => 0, 'pattern' => '.*', ], 'String64' => [ 'type' => 'string', 'max' => 64, 'min' => 0, 'pattern' => '.*', ], 'Tag' => [ 'type' => 'structure', 'required' => [ 'Key', 'Value', ], 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'sensitive' => true, ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 50, 'min' => 1, ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], 'max' => 50, 'min' => 1, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'Tags', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'ChimeArn', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'sensitive' => true, ], 'TargetedMessages' => [ 'type' => 'string', 'enum' => [ 'ALL', 'NONE', ], ], 'ThrottledClientException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], 'Timestamp' => [ 'type' => 'timestamp', ], 'UnauthorizedClientException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'TagKeys', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'ChimeArn', ], 'TagKeys' => [ 'shape' => 'TagKeyList', ], ], ], 'UpdateAppInstanceBotRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceBotArn', 'Name', 'Metadata', ], 'members' => [ 'AppInstanceBotArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceBotArn', ], 'Name' => [ 'shape' => 'ResourceName', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'Configuration' => [ 'shape' => 'Configuration', ], ], ], 'UpdateAppInstanceBotResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceBotArn' => [ 'shape' => 'ChimeArn', ], ], ], 'UpdateAppInstanceRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', 'Name', 'Metadata', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'Metadata' => [ 'shape' => 'Metadata', ], ], ], 'UpdateAppInstanceResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], ], ], 'UpdateAppInstanceUserEndpointRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceUserArn', 'EndpointId', ], 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceUserArn', ], 'EndpointId' => [ 'shape' => 'String64', 'location' => 'uri', 'locationName' => 'endpointId', ], 'Name' => [ 'shape' => 'SensitiveString1600', ], 'AllowMessages' => [ 'shape' => 'AllowMessages', ], ], ], 'UpdateAppInstanceUserEndpointResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', ], 'EndpointId' => [ 'shape' => 'String64', ], ], ], 'UpdateAppInstanceUserRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceUserArn', 'Name', 'Metadata', ], 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceUserArn', ], 'Name' => [ 'shape' => 'UserName', ], 'Metadata' => [ 'shape' => 'Metadata', ], ], ], 'UpdateAppInstanceUserResponse' => [ 'type' => 'structure', 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', ], ], ], 'UserId' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '[A-Za-z0-9]([A-Za-z0-9\\\\:\\\\-\\\\_\\\\.\\\\@]{0,62}[A-Za-z0-9])?', 'sensitive' => true, ], 'UserName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '.*\\\\S.*', 'sensitive' => true, ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-identity/2021-04-20/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>The Amazon Chime SDK Identity APIs in this section allow software developers to create and manage unique instances of their messaging applications. These APIs provide the overarching framework for creating and sending messages. For more information about the identity APIs, refer to <a href=\"https://docs.aws.amazon.com/chime/latest/APIReference/API_Operations_Amazon_Chime_SDK_Identity.html\">Amazon Chime SDK identity</a>.</p>', 'operations' => [ 'CreateAppInstance' => '<p>Creates an Amazon Chime SDK messaging <code>AppInstance</code> under an AWS account. Only SDK messaging customers use this API. <code>CreateAppInstance</code> supports idempotency behavior as described in the AWS API Standard.</p> <p>identity</p>', 'CreateAppInstanceAdmin' => '<p>Promotes an <code>AppInstanceUser</code> or <code>AppInstanceBot</code> to an <code>AppInstanceAdmin</code>. The promoted entity can perform the following actions. </p> <ul> <li> <p> <code>ChannelModerator</code> actions across all channels in the <code>AppInstance</code>.</p> </li> <li> <p> <code>DeleteChannelMessage</code> actions.</p> </li> </ul> <p>Only an <code>AppInstanceUser</code> and <code>AppInstanceBot</code> can be promoted to an <code>AppInstanceAdmin</code> role.</p>', 'CreateAppInstanceBot' => '<p>Creates a bot under an Amazon Chime <code>AppInstance</code>. The request consists of a unique <code>Configuration</code> and <code>Name</code> for that bot.</p>', 'CreateAppInstanceUser' => '<p>Creates a user under an Amazon Chime <code>AppInstance</code>. The request consists of a unique <code>appInstanceUserId</code> and <code>Name</code> for that user.</p>', 'DeleteAppInstance' => '<p>Deletes an <code>AppInstance</code> and all associated data asynchronously.</p>', 'DeleteAppInstanceAdmin' => '<p>Demotes an <code>AppInstanceAdmin</code> to an <code>AppInstanceUser</code> or <code>AppInstanceBot</code>. This action does not delete the user.</p>', 'DeleteAppInstanceBot' => '<p>Deletes an <code>AppInstanceBot</code>.</p>', 'DeleteAppInstanceUser' => '<p>Deletes an <code>AppInstanceUser</code>.</p>', 'DeregisterAppInstanceUserEndpoint' => '<p>Deregisters an <code>AppInstanceUserEndpoint</code>.</p>', 'DescribeAppInstance' => '<p>Returns the full details of an <code>AppInstance</code>.</p>', 'DescribeAppInstanceAdmin' => '<p>Returns the full details of an <code>AppInstanceAdmin</code>.</p>', 'DescribeAppInstanceBot' => '<p>The <code>AppInstanceBot\\'s</code> information.</p>', 'DescribeAppInstanceUser' => '<p>Returns the full details of an <code>AppInstanceUser</code>.</p>', 'DescribeAppInstanceUserEndpoint' => '<p>Returns the full details of an <code>AppInstanceUserEndpoint</code>.</p>', 'GetAppInstanceRetentionSettings' => '<p>Gets the retention settings for an <code>AppInstance</code>.</p>', 'ListAppInstanceAdmins' => '<p>Returns a list of the administrators in the <code>AppInstance</code>.</p>', 'ListAppInstanceBots' => '<p>Lists all <code>AppInstanceBots</code> created under a single <code>AppInstance</code>.</p>', 'ListAppInstanceUserEndpoints' => '<p>Lists all the <code>AppInstanceUserEndpoints</code> created under a single <code>AppInstanceUser</code>.</p>', 'ListAppInstanceUsers' => '<p>List all <code>AppInstanceUsers</code> created under a single <code>AppInstance</code>.</p>', 'ListAppInstances' => '<p>Lists all Amazon Chime <code>AppInstance</code>s created under a single AWS account.</p>', 'ListTagsForResource' => '<p>Lists the tags applied to an Amazon Chime SDK identity resource.</p>', 'PutAppInstanceRetentionSettings' => '<p>Sets the amount of time in days that a given <code>AppInstance</code> retains data.</p>', 'PutAppInstanceUserExpirationSettings' => '<p>Sets the number of days before the <code>AppInstanceUser</code> is automatically deleted.</p> <note> <p>A background process deletes expired <code>AppInstanceUsers</code> within 6 hours of expiration. Actual deletion times may vary.</p> <p>Expired <code>AppInstanceUsers</code> that have not yet been deleted appear as active, and you can update their expiration settings. The system honors the new settings.</p> </note>', 'RegisterAppInstanceUserEndpoint' => '<p>Registers an endpoint under an Amazon Chime <code>AppInstanceUser</code>. The endpoint receives messages for a user. For push notifications, the endpoint is a mobile device used to receive mobile push notifications for a user.</p>', 'TagResource' => '<p>Applies the specified tags to the specified Amazon Chime SDK identity resource.</p>', 'UntagResource' => '<p>Removes the specified tags from the specified Amazon Chime SDK identity resource.</p>', 'UpdateAppInstance' => '<p>Updates <code>AppInstance</code> metadata.</p>', 'UpdateAppInstanceBot' => '<p>Updates the name and metadata of an <code>AppInstanceBot</code>.</p>', 'UpdateAppInstanceUser' => '<p>Updates the details of an <code>AppInstanceUser</code>. You can update names and metadata.</p>', 'UpdateAppInstanceUserEndpoint' => '<p>Updates the details of an <code>AppInstanceUserEndpoint</code>. You can update the name and <code>AllowMessage</code> values.</p>', ], 'shapes' => [ 'AllowMessages' => [ 'base' => NULL, 'refs' => [ 'AppInstanceUserEndpoint$AllowMessages' => '<p>Boolean that controls whether the <code>AppInstanceUserEndpoint</code> is opted in to receive messages. <code>ALL</code> indicates the endpoint will receive all messages. <code>NONE</code> indicates the endpoint will receive no messages.</p>', 'AppInstanceUserEndpointSummary$AllowMessages' => '<p>BBoolean that controls whether the <code>AppInstanceUserEndpoint</code> is opted in to receive messages. <code>ALL</code> indicates the endpoint will receive all messages. <code>NONE</code> indicates the endpoint will receive no messages.</p>', 'RegisterAppInstanceUserEndpointRequest$AllowMessages' => '<p>Boolean that controls whether the AppInstanceUserEndpoint is opted in to receive messages. <code>ALL</code> indicates the endpoint receives all messages. <code>NONE</code> indicates the endpoint receives no messages.</p>', 'UpdateAppInstanceUserEndpointRequest$AllowMessages' => '<p>Boolean that controls whether the <code>AppInstanceUserEndpoint</code> is opted in to receive messages. <code>ALL</code> indicates the endpoint will receive all messages. <code>NONE</code> indicates the endpoint will receive no messages.</p>', ], ], 'AppInstance' => [ 'base' => '<p>The details of an <code>AppInstance</code>, an instance of an Amazon Chime SDK messaging application.</p>', 'refs' => [ 'DescribeAppInstanceResponse$AppInstance' => '<p>The ARN, metadata, created and last-updated timestamps, and the name of the <code>AppInstance</code>. All timestamps use epoch milliseconds.</p>', ], ], 'AppInstanceAdmin' => [ 'base' => '<p>The name and ARN of the admin for the <code>AppInstance</code>.</p>', 'refs' => [ 'DescribeAppInstanceAdminResponse$AppInstanceAdmin' => '<p>The ARN and name of the <code>AppInstanceUser</code>, the ARN of the <code>AppInstance</code>, and the created and last-updated timestamps. All timestamps use epoch milliseconds.</p>', ], ], 'AppInstanceAdminList' => [ 'base' => NULL, 'refs' => [ 'ListAppInstanceAdminsResponse$AppInstanceAdmins' => '<p>The information for each administrator.</p>', ], ], 'AppInstanceAdminSummary' => [ 'base' => '<p>Summary of the details of an <code>AppInstanceAdmin</code>.</p>', 'refs' => [ 'AppInstanceAdminList$member' => NULL, ], ], 'AppInstanceBot' => [ 'base' => '<p>An Amazon Lex V2 chat bot created under an <code>AppInstance</code>.</p>', 'refs' => [ 'DescribeAppInstanceBotResponse$AppInstanceBot' => '<p>The detials of the <code>AppInstanceBot</code>.</p>', ], ], 'AppInstanceBotList' => [ 'base' => NULL, 'refs' => [ 'ListAppInstanceBotsResponse$AppInstanceBots' => '<p>The information for each requested <code>AppInstanceBot</code>.</p>', ], ], 'AppInstanceBotSummary' => [ 'base' => '<p>High-level information about an AppInstanceBot.</p>', 'refs' => [ 'AppInstanceBotList$member' => NULL, ], ], 'AppInstanceList' => [ 'base' => NULL, 'refs' => [ 'ListAppInstancesResponse$AppInstances' => '<p>The information for each <code>AppInstance</code>.</p>', ], ], 'AppInstanceRetentionSettings' => [ 'base' => '<p>The details of the data-retention settings for an <code>AppInstance</code>.</p>', 'refs' => [ 'GetAppInstanceRetentionSettingsResponse$AppInstanceRetentionSettings' => '<p>The retention settings for the <code>AppInstance</code>.</p>', 'PutAppInstanceRetentionSettingsRequest$AppInstanceRetentionSettings' => '<p>The time in days to retain data. Data type: number.</p>', 'PutAppInstanceRetentionSettingsResponse$AppInstanceRetentionSettings' => '<p>The time in days to retain data. Data type: number.</p>', ], ], 'AppInstanceSummary' => [ 'base' => '<p>Summary of the data for an <code>AppInstance</code>.</p>', 'refs' => [ 'AppInstanceList$member' => NULL, ], ], 'AppInstanceUser' => [ 'base' => '<p>The details of an <code>AppInstanceUser</code>.</p>', 'refs' => [ 'DescribeAppInstanceUserResponse$AppInstanceUser' => '<p>The name of the <code>AppInstanceUser</code>.</p>', ], ], 'AppInstanceUserEndpoint' => [ 'base' => '<p>An endpoint under an Amazon Chime <code>AppInstanceUser</code> that receives messages for a user. For push notifications, the endpoint is a mobile device used to receive mobile push notifications for a user.</p>', 'refs' => [ 'DescribeAppInstanceUserEndpointResponse$AppInstanceUserEndpoint' => '<p>The full details of an <code>AppInstanceUserEndpoint</code>: the <code>AppInstanceUserArn</code>, ID, name, type, resource ARN, attributes, allow messages, state, and created and last updated timestamps. All timestamps use epoch milliseconds.</p>', ], ], 'AppInstanceUserEndpointSummary' => [ 'base' => '<p>Summary of the details of an <code>AppInstanceUserEndpoint</code>.</p>', 'refs' => [ 'AppInstanceUserEndpointSummaryList$member' => NULL, ], ], 'AppInstanceUserEndpointSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListAppInstanceUserEndpointsResponse$AppInstanceUserEndpoints' => '<p>The information for each requested <code>AppInstanceUserEndpoint</code>.</p>', ], ], 'AppInstanceUserEndpointType' => [ 'base' => NULL, 'refs' => [ 'AppInstanceUserEndpoint$Type' => '<p>The type of the <code>AppInstanceUserEndpoint</code>.</p>', 'AppInstanceUserEndpointSummary$Type' => '<p>The type of the <code>AppInstanceUserEndpoint</code>.</p>', 'RegisterAppInstanceUserEndpointRequest$Type' => '<p>The type of the <code>AppInstanceUserEndpoint</code>. Supported types:</p> <ul> <li> <p> <code>APNS</code>: The mobile notification service for an Apple device.</p> </li> <li> <p> <code>APNS_SANDBOX</code>: The sandbox environment of the mobile notification service for an Apple device.</p> </li> <li> <p> <code>GCM</code>: The mobile notification service for an Android device.</p> </li> </ul> <p>Populate the <code>ResourceArn</code> value of each type as <code>PinpointAppArn</code>.</p>', ], ], 'AppInstanceUserList' => [ 'base' => NULL, 'refs' => [ 'ListAppInstanceUsersResponse$AppInstanceUsers' => '<p>The information for each requested <code>AppInstanceUser</code>.</p>', ], ], 'AppInstanceUserSummary' => [ 'base' => '<p>Summary of the details of an <code>AppInstanceUser</code>.</p>', 'refs' => [ 'AppInstanceUserList$member' => NULL, ], ], 'BadRequestException' => [ 'base' => '<p>The input parameters don\\'t match the service\\'s restrictions.</p>', 'refs' => [], ], 'ChannelRetentionSettings' => [ 'base' => '<p>The details of the retention settings for a channel.</p>', 'refs' => [ 'AppInstanceRetentionSettings$ChannelRetentionSettings' => '<p>The length of time in days to retain the messages in a channel.</p>', ], ], 'ChimeArn' => [ 'base' => NULL, 'refs' => [ 'AppInstance$AppInstanceArn' => '<p>The ARN of the messaging instance.</p>', 'AppInstanceAdmin$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code> for which the user is an administrator.</p>', 'AppInstanceBot$AppInstanceBotArn' => '<p>The ARN of the AppInstanceBot.</p>', 'AppInstanceBotSummary$AppInstanceBotArn' => '<p>The ARN of the AppInstanceBot.</p>', 'AppInstanceSummary$AppInstanceArn' => '<p>The <code>AppInstance</code> ARN.</p>', 'AppInstanceUser$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'AppInstanceUserEndpoint$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'AppInstanceUserEndpoint$ResourceArn' => '<p>The ARN of the resource to which the endpoint belongs.</p>', 'AppInstanceUserEndpointSummary$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'AppInstanceUserSummary$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'CreateAppInstanceAdminRequest$AppInstanceAdminArn' => '<p>The ARN of the administrator of the current <code>AppInstance</code>.</p>', 'CreateAppInstanceAdminRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'CreateAppInstanceAdminResponse$AppInstanceArn' => '<p>The ARN of the of the admin for the <code>AppInstance</code>.</p>', 'CreateAppInstanceBotRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code> request.</p>', 'CreateAppInstanceBotResponse$AppInstanceBotArn' => '<p>The ARN of the <code>AppinstanceBot</code>.</p>', 'CreateAppInstanceResponse$AppInstanceArn' => '<p>The Amazon Resource Number (ARN) of the <code>AppInstance</code>.</p>', 'CreateAppInstanceUserRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code> request.</p>', 'CreateAppInstanceUserResponse$AppInstanceUserArn' => '<p>The user\\'s ARN.</p>', 'DeleteAppInstanceAdminRequest$AppInstanceAdminArn' => '<p>The ARN of the <code>AppInstance</code>\\'s administrator.</p>', 'DeleteAppInstanceAdminRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'DeleteAppInstanceBotRequest$AppInstanceBotArn' => '<p>The ARN of the <code>AppInstanceBot</code> being deleted.</p>', 'DeleteAppInstanceRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'DeleteAppInstanceUserRequest$AppInstanceUserArn' => '<p>The ARN of the user request being deleted.</p>', 'DeregisterAppInstanceUserEndpointRequest$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'DescribeAppInstanceAdminRequest$AppInstanceAdminArn' => '<p>The ARN of the <code>AppInstanceAdmin</code>.</p>', 'DescribeAppInstanceAdminRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'DescribeAppInstanceBotRequest$AppInstanceBotArn' => '<p>The ARN of the <code>AppInstanceBot</code>.</p>', 'DescribeAppInstanceRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'DescribeAppInstanceUserRequest$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'GetAppInstanceRetentionSettingsRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'Identity$Arn' => '<p>The ARN in an Identity.</p>', 'ListAppInstanceAdminsRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'ListAppInstanceAdminsResponse$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'ListAppInstanceBotsRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'ListAppInstanceBotsResponse$AppInstanceArn' => '<p>The ARN of the AppInstance.</p>', 'ListAppInstanceUsersRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'ListAppInstanceUsersResponse$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'ListTagsForResourceRequest$ResourceARN' => '<p>The ARN of the resource.</p>', 'PutAppInstanceRetentionSettingsRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'PutAppInstanceUserExpirationSettingsRequest$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'PutAppInstanceUserExpirationSettingsResponse$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'RegisterAppInstanceUserEndpointRequest$ResourceArn' => '<p>The ARN of the resource to which the endpoint belongs.</p>', 'RegisterAppInstanceUserEndpointResponse$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'TagResourceRequest$ResourceARN' => '<p>The resource ARN.</p>', 'UntagResourceRequest$ResourceARN' => '<p>The resource ARN.</p>', 'UpdateAppInstanceBotRequest$AppInstanceBotArn' => '<p>The ARN of the <code>AppInstanceBot</code>.</p>', 'UpdateAppInstanceBotResponse$AppInstanceBotArn' => '<p>The ARN of the <code>AppInstanceBot</code>.</p>', 'UpdateAppInstanceRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'UpdateAppInstanceResponse$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'UpdateAppInstanceUserEndpointRequest$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'UpdateAppInstanceUserEndpointResponse$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'UpdateAppInstanceUserRequest$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'UpdateAppInstanceUserResponse$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', ], ], 'ClientRequestToken' => [ 'base' => NULL, 'refs' => [ 'CreateAppInstanceBotRequest$ClientRequestToken' => '<p>The unique ID for the client making the request. Use different tokens for different <code>AppInstanceBots</code>.</p>', 'CreateAppInstanceRequest$ClientRequestToken' => '<p>The unique ID of the request. Use different tokens to create different <code>AppInstances</code>.</p>', 'CreateAppInstanceUserRequest$ClientRequestToken' => '<p>The unique ID of the request. Use different tokens to request additional <code>AppInstances</code>.</p>', 'RegisterAppInstanceUserEndpointRequest$ClientRequestToken' => '<p>The unique ID assigned to the request. Use different tokens to register other endpoints.</p>', ], ], 'Configuration' => [ 'base' => '<p>A structure that contains configuration data.</p>', 'refs' => [ 'AppInstanceBot$Configuration' => '<p>The data processing instructions for an AppInstanceBot.</p>', 'CreateAppInstanceBotRequest$Configuration' => '<p>Configuration information about the Amazon Lex V2 V2 bot.</p>', 'UpdateAppInstanceBotRequest$Configuration' => '<p>The configuration for the bot update.</p>', ], ], 'ConflictException' => [ 'base' => '<p>The request could not be processed because of conflict in the current state of the resource.</p>', 'refs' => [], ], 'CreateAppInstanceAdminRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppInstanceAdminResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppInstanceBotRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppInstanceBotResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppInstanceRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppInstanceResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppInstanceUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAppInstanceUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAppInstanceAdminRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAppInstanceBotRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAppInstanceRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAppInstanceUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeregisterAppInstanceUserEndpointRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppInstanceAdminRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppInstanceAdminResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppInstanceBotRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppInstanceBotResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppInstanceRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppInstanceResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppInstanceUserEndpointRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppInstanceUserEndpointResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppInstanceUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeAppInstanceUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'EndpointAttributes' => [ 'base' => '<p>The attributes of an <code>Endpoint</code>.</p>', 'refs' => [ 'AppInstanceUserEndpoint$EndpointAttributes' => '<p>The attributes of an <code>Endpoint</code>.</p>', 'RegisterAppInstanceUserEndpointRequest$EndpointAttributes' => '<p>The attributes of an <code>Endpoint</code>.</p>', ], ], 'EndpointState' => [ 'base' => '<p>A read-only field that represents the state of an <code>AppInstanceUserEndpoint</code>. Supported values:</p> <ul> <li> <p> <code>ACTIVE</code>: The <code>AppInstanceUserEndpoint</code> is active and able to receive messages. When <code>ACTIVE</code>, the <code>EndpointStatusReason</code> remains empty.</p> </li> <li> <p> <code>INACTIVE</code>: The <code>AppInstanceUserEndpoint</code> is inactive and can\\'t receive message. When INACTIVE, the corresponding reason will be conveyed through EndpointStatusReason.</p> </li> <li> <p> <code>INVALID_DEVICE_TOKEN</code> indicates that an <code>AppInstanceUserEndpoint</code> is <code>INACTIVE</code> due to invalid device token</p> </li> <li> <p> <code>INVALID_PINPOINT_ARN</code> indicates that an <code>AppInstanceUserEndpoint</code> is <code>INACTIVE</code> due to an invalid pinpoint ARN that was input through the <code>ResourceArn</code> field.</p> </li> </ul>', 'refs' => [ 'AppInstanceUserEndpoint$EndpointState' => '<p>A read-only field that represents the state of an <code>AppInstanceUserEndpoint</code>. Supported values:</p> <ul> <li> <p> <code>ACTIVE</code>: The <code>AppInstanceUserEndpoint</code> is active and able to receive messages. When <code>ACTIVE</code>, the <code>EndpointStatusReason</code> remains empty.</p> </li> <li> <p> <code>INACTIVE</code>: The <code>AppInstanceUserEndpoint</code> is inactive and can\\'t receive message. When <code>INACTIVE</code>, the corresponding reason will be conveyed through <code>EndpointStatusReason</code>.</p> </li> <li> <p> <code>INVALID_DEVICE_TOKEN</code> indicates that an <code>AppInstanceUserEndpoint</code> is <code>INACTIVE</code> due to invalid device token</p> </li> <li> <p> <code>INVALID_PINPOINT_ARN</code> indicates that an <code>AppInstanceUserEndpoint</code> is <code>INACTIVE</code> due to an invalid pinpoint ARN that was input through the <code>ResourceArn</code> field.</p> </li> </ul>', 'AppInstanceUserEndpointSummary$EndpointState' => '<p>A read-only field that represent the state of an <code>AppInstanceUserEndpoint</code>.</p>', ], ], 'EndpointStatus' => [ 'base' => NULL, 'refs' => [ 'EndpointState$Status' => '<p>Enum that indicates the Status of an <code>AppInstanceUserEndpoint</code>.</p>', ], ], 'EndpointStatusReason' => [ 'base' => NULL, 'refs' => [ 'EndpointState$StatusReason' => '<p>The reason for the <code>EndpointStatus</code>.</p>', ], ], 'ErrorCode' => [ 'base' => NULL, 'refs' => [ 'BadRequestException$Code' => NULL, 'ConflictException$Code' => NULL, 'ForbiddenException$Code' => NULL, 'NotFoundException$Code' => NULL, 'ResourceLimitExceededException$Code' => NULL, 'ServiceFailureException$Code' => NULL, 'ServiceUnavailableException$Code' => NULL, 'ThrottledClientException$Code' => NULL, 'UnauthorizedClientException$Code' => NULL, ], ], 'ExpirationCriterion' => [ 'base' => NULL, 'refs' => [ 'ExpirationSettings$ExpirationCriterion' => '<p>Specifies the conditions under which an <code>AppInstanceUser</code> will expire.</p>', ], ], 'ExpirationDays' => [ 'base' => NULL, 'refs' => [ 'ExpirationSettings$ExpirationDays' => '<p>The period in days after which an <code>AppInstanceUser</code> will be automatically deleted.</p>', ], ], 'ExpirationSettings' => [ 'base' => '<p>Determines the interval after which an <code>AppInstanceUser</code> is automatically deleted.</p>', 'refs' => [ 'AppInstanceUser$ExpirationSettings' => '<p>The interval after which an <code>AppInstanceUser</code> is automatically deleted.</p>', 'CreateAppInstanceUserRequest$ExpirationSettings' => '<p>Settings that control the interval after which the <code>AppInstanceUser</code> is automatically deleted.</p>', 'PutAppInstanceUserExpirationSettingsRequest$ExpirationSettings' => '<p>Settings that control the interval after which an <code>AppInstanceUser</code> is automatically deleted.</p>', 'PutAppInstanceUserExpirationSettingsResponse$ExpirationSettings' => '<p>Settings that control the interval after which an <code>AppInstanceUser</code> is automatically deleted.</p>', ], ], 'ForbiddenException' => [ 'base' => '<p>The client is permanently forbidden from making the request.</p>', 'refs' => [], ], 'GetAppInstanceRetentionSettingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetAppInstanceRetentionSettingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'Identity' => [ 'base' => '<p>The details of a user or bot.</p>', 'refs' => [ 'AppInstanceAdmin$Admin' => '<p>The <code>AppInstanceAdmin</code> data.</p>', 'AppInstanceAdminSummary$Admin' => '<p>The details of the <code>AppInstanceAdmin</code>.</p>', 'CreateAppInstanceAdminResponse$AppInstanceAdmin' => '<p>The ARN and name of the administrator, the ARN of the <code>AppInstance</code>, and the created and last-updated timestamps. All timestamps use epoch milliseconds.</p>', ], ], 'InvokedBy' => [ 'base' => '<p>Specifies the type of message that triggers a bot.</p>', 'refs' => [ 'LexConfiguration$InvokedBy' => '<p>Specifies the type of message that triggers a bot.</p>', ], ], 'LexBotAliasArn' => [ 'base' => NULL, 'refs' => [ 'LexConfiguration$LexBotAliasArn' => '<p>The ARN of the Amazon Lex V2 bot\\'s alias. The ARN uses this format: <code>arn:aws:lex:REGION:ACCOUNT:bot-alias/MYBOTID/MYBOTALIAS</code> </p>', ], ], 'LexConfiguration' => [ 'base' => '<p>The configuration for an Amazon Lex V2 bot.</p>', 'refs' => [ 'Configuration$Lex' => '<p>The configuration for an Amazon Lex V2 bot.</p>', ], ], 'LexIntentName' => [ 'base' => NULL, 'refs' => [ 'LexConfiguration$WelcomeIntent' => '<p>The name of the welcome intent configured in the Amazon Lex V2 bot.</p>', ], ], 'ListAppInstanceAdminsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAppInstanceAdminsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListAppInstanceBotsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAppInstanceBotsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListAppInstanceUserEndpointsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAppInstanceUserEndpointsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListAppInstanceUsersRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAppInstanceUsersResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListAppInstancesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAppInstancesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'ListAppInstanceAdminsRequest$MaxResults' => '<p>The maximum number of administrators that you want to return.</p>', 'ListAppInstanceBotsRequest$MaxResults' => '<p>The maximum number of requests to return.</p>', 'ListAppInstanceUserEndpointsRequest$MaxResults' => '<p>The maximum number of endpoints that you want to return.</p>', 'ListAppInstanceUsersRequest$MaxResults' => '<p>The maximum number of requests that you want returned.</p>', 'ListAppInstancesRequest$MaxResults' => '<p>The maximum number of <code>AppInstance</code>s that you want to return.</p>', ], ], 'Metadata' => [ 'base' => NULL, 'refs' => [ 'AppInstance$Metadata' => '<p>The metadata of an <code>AppInstance</code>.</p>', 'AppInstanceBot$Metadata' => '<p>The metadata for an AppInstanceBot.</p>', 'AppInstanceBotSummary$Metadata' => '<p>The metadata of the AppInstanceBot.</p>', 'AppInstanceSummary$Metadata' => '<p>The metadata of the <code>AppInstance</code>.</p>', 'AppInstanceUser$Metadata' => '<p>The metadata of the <code>AppInstanceUser</code>.</p>', 'AppInstanceUserSummary$Metadata' => '<p>The metadata of the <code>AppInstanceUser</code>.</p>', 'CreateAppInstanceBotRequest$Metadata' => '<p>The request metadata. Limited to a 1KB string in UTF-8.</p>', 'CreateAppInstanceRequest$Metadata' => '<p>The metadata of the <code>AppInstance</code>. Limited to a 1KB string in UTF-8.</p>', 'CreateAppInstanceUserRequest$Metadata' => '<p>The request\\'s metadata. Limited to a 1KB string in UTF-8.</p>', 'UpdateAppInstanceBotRequest$Metadata' => '<p>The metadata of the <code>AppInstanceBot</code>.</p>', 'UpdateAppInstanceRequest$Metadata' => '<p>The metadata that you want to change.</p>', 'UpdateAppInstanceUserRequest$Metadata' => '<p>The metadata of the <code>AppInstanceUser</code>.</p>', ], ], 'NextToken' => [ 'base' => NULL, 'refs' => [ 'ListAppInstanceAdminsRequest$NextToken' => '<p>The token returned from previous API requests until the number of administrators is reached.</p>', 'ListAppInstanceAdminsResponse$NextToken' => '<p>The token returned from previous API requests until the number of administrators is reached.</p>', 'ListAppInstanceBotsRequest$NextToken' => '<p>The token passed by previous API calls until all requested bots are returned.</p>', 'ListAppInstanceBotsResponse$NextToken' => '<p>The token passed by previous API calls until all requested bots are returned.</p>', 'ListAppInstanceUserEndpointsRequest$NextToken' => '<p>The token passed by previous API calls until all requested endpoints are returned.</p>', 'ListAppInstanceUserEndpointsResponse$NextToken' => '<p>The token passed by previous API calls until all requested endpoints are returned.</p>', 'ListAppInstanceUsersRequest$NextToken' => '<p>The token passed by previous API calls until all requested users are returned.</p>', 'ListAppInstanceUsersResponse$NextToken' => '<p>The token passed by previous API calls until all requested users are returned.</p>', 'ListAppInstancesRequest$NextToken' => '<p>The token passed by previous API requests until you reach the maximum number of <code>AppInstances</code>.</p>', 'ListAppInstancesResponse$NextToken' => '<p>The token passed by previous API requests until the maximum number of <code>AppInstance</code>s is reached.</p>', ], ], 'NonEmptyResourceName' => [ 'base' => NULL, 'refs' => [ 'AppInstance$Name' => '<p>The name of an <code>AppInstance</code>.</p>', 'AppInstanceSummary$Name' => '<p>The name of the <code>AppInstance</code>.</p>', 'CreateAppInstanceRequest$Name' => '<p>The name of the <code>AppInstance</code>.</p>', 'UpdateAppInstanceRequest$Name' => '<p>The name that you want to change.</p>', ], ], 'NonEmptySensitiveString1600' => [ 'base' => NULL, 'refs' => [ 'EndpointAttributes$DeviceToken' => '<p>The device token for the GCM, APNS, and APNS_SANDBOX endpoint types.</p>', 'EndpointAttributes$VoipDeviceToken' => '<p>The VOIP device token for the APNS and APNS_SANDBOX endpoint types.</p>', ], ], 'NotFoundException' => [ 'base' => '<p>One or more of the resources in the request does not exist in the system.</p>', 'refs' => [], ], 'PutAppInstanceRetentionSettingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutAppInstanceRetentionSettingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'PutAppInstanceUserExpirationSettingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutAppInstanceUserExpirationSettingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'RegisterAppInstanceUserEndpointRequest' => [ 'base' => NULL, 'refs' => [], ], 'RegisterAppInstanceUserEndpointResponse' => [ 'base' => NULL, 'refs' => [], ], 'ResourceLimitExceededException' => [ 'base' => '<p>The request exceeds the resource limit.</p>', 'refs' => [], ], 'ResourceName' => [ 'base' => NULL, 'refs' => [ 'AppInstanceBot$Name' => '<p>The name of the AppInstanceBot.</p>', 'AppInstanceBotSummary$Name' => '<p>The name of the AppInstanceBox.</p>', 'CreateAppInstanceBotRequest$Name' => '<p>The user\\'s name.</p>', 'Identity$Name' => '<p>The name in an Identity.</p>', 'UpdateAppInstanceBotRequest$Name' => '<p>The name of the <code>AppInstanceBot</code>.</p>', ], ], 'RespondsTo' => [ 'base' => NULL, 'refs' => [ 'LexConfiguration$RespondsTo' => '<important> <p> <b>Deprecated</b>. Use <code>InvokedBy</code> instead.</p> </important> <p>Determines whether the Amazon Lex V2 bot responds to all standard messages. Control messages are not supported.</p>', ], ], 'RetentionDays' => [ 'base' => NULL, 'refs' => [ 'ChannelRetentionSettings$RetentionDays' => '<p>The time in days to retain the messages in a channel.</p>', ], ], 'SensitiveChimeArn' => [ 'base' => NULL, 'refs' => [ 'ListAppInstanceUserEndpointsRequest$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', 'RegisterAppInstanceUserEndpointRequest$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', ], ], 'SensitiveString1600' => [ 'base' => NULL, 'refs' => [ 'AppInstanceUserEndpoint$Name' => '<p>The name of the <code>AppInstanceUserEndpoint</code>.</p>', 'AppInstanceUserEndpointSummary$Name' => '<p>The name of the <code>AppInstanceUserEndpoint</code>.</p>', 'RegisterAppInstanceUserEndpointRequest$Name' => '<p>The name of the <code>AppInstanceUserEndpoint</code>.</p>', 'UpdateAppInstanceUserEndpointRequest$Name' => '<p>The name of the <code>AppInstanceUserEndpoint</code>.</p>', ], ], 'ServiceFailureException' => [ 'base' => '<p>The service encountered an unexpected error.</p>', 'refs' => [], ], 'ServiceUnavailableException' => [ 'base' => '<p>The service is currently unavailable.</p>', 'refs' => [], ], 'StandardMessages' => [ 'base' => NULL, 'refs' => [ 'InvokedBy$StandardMessages' => '<p>Sets standard messages as the bot trigger. For standard messages:</p> <ul> <li> <p> <code>ALL</code>: The bot processes all standard messages.</p> </li> <li> <p> <code>AUTO</code>: The bot responds to ALL messages when the channel has one other non-hidden member, and responds to MENTIONS when the channel has more than one other non-hidden member.</p> </li> <li> <p> <code>MENTIONS</code>: The bot processes all standard messages that have a message attribute with <code>CHIME.mentions</code> and a value of the bot ARN.</p> </li> <li> <p> <code>NONE</code>: The bot processes no standard messages.</p> </li> </ul>', ], ], 'String' => [ 'base' => NULL, 'refs' => [ 'BadRequestException$Message' => NULL, 'ConflictException$Message' => NULL, 'ForbiddenException$Message' => NULL, 'LexConfiguration$LocaleId' => '<p>Identifies the Amazon Lex V2 bot\\'s language and locale. The string must match one of the supported locales in Amazon Lex V2. All of the intents, slot types, and slots used in the bot must have the same locale. For more information, see <a href=\"https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html\">Supported languages</a> in the <i>Amazon Lex V2 Developer Guide</i>.</p>', 'NotFoundException$Message' => NULL, 'ResourceLimitExceededException$Message' => NULL, 'ServiceFailureException$Message' => NULL, 'ServiceUnavailableException$Message' => NULL, 'ThrottledClientException$Message' => NULL, 'UnauthorizedClientException$Message' => NULL, ], ], 'String1600' => [ 'base' => NULL, 'refs' => [ 'DescribeAppInstanceUserEndpointRequest$AppInstanceUserArn' => '<p>The ARN of the <code>AppInstanceUser</code>.</p>', ], ], 'String64' => [ 'base' => NULL, 'refs' => [ 'AppInstanceUserEndpoint$EndpointId' => '<p>The unique identifier of the <code>AppInstanceUserEndpoint</code>.</p>', 'AppInstanceUserEndpointSummary$EndpointId' => '<p>The unique identifier of the <code>AppInstanceUserEndpoint</code>.</p>', 'DeregisterAppInstanceUserEndpointRequest$EndpointId' => '<p>The unique identifier of the <code>AppInstanceUserEndpoint</code>.</p>', 'DescribeAppInstanceUserEndpointRequest$EndpointId' => '<p>The unique identifier of the <code>AppInstanceUserEndpoint</code>.</p>', 'RegisterAppInstanceUserEndpointResponse$EndpointId' => '<p>The unique identifier of the <code>AppInstanceUserEndpoint</code>.</p>', 'UpdateAppInstanceUserEndpointRequest$EndpointId' => '<p>The unique identifier of the <code>AppInstanceUserEndpoint</code>.</p>', 'UpdateAppInstanceUserEndpointResponse$EndpointId' => '<p>The unique identifier of the <code>AppInstanceUserEndpoint</code>.</p>', ], ], 'Tag' => [ 'base' => '<p>A tag object containing a key-value pair.</p>', 'refs' => [ 'TagList$member' => NULL, ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'Tag$Key' => '<p>The key in a tag.</p>', 'TagKeyList$member' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$TagKeys' => '<p>The tag keys.</p>', ], ], 'TagList' => [ 'base' => NULL, 'refs' => [ 'CreateAppInstanceBotRequest$Tags' => '<p>The tags assigned to the <code>AppInstanceBot</code>.</p>', 'CreateAppInstanceRequest$Tags' => '<p>Tags assigned to the <code>AppInstance</code>.</p>', 'CreateAppInstanceUserRequest$Tags' => '<p>Tags assigned to the <code>AppInstanceUser</code>.</p>', 'ListTagsForResourceResponse$Tags' => '<p>The tag key-value pairs.</p>', 'TagResourceRequest$Tags' => '<p>The tag key-value pairs.</p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'Tag$Value' => '<p>The value in a tag.</p>', ], ], 'TargetedMessages' => [ 'base' => NULL, 'refs' => [ 'InvokedBy$TargetedMessages' => '<p>Sets targeted messages as the bot trigger. For targeted messages:</p> <ul> <li> <p> <code>ALL</code>: The bot processes all <code>TargetedMessages</code> sent to it. The bot then responds with a targeted message back to the sender. </p> </li> <li> <p> <code>NONE</code>: The bot processes no targeted messages.</p> </li> </ul>', ], ], 'ThrottledClientException' => [ 'base' => '<p>The client exceeded its request rate limit.</p>', 'refs' => [], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [ 'AppInstance$CreatedTimestamp' => '<p>The time at which an <code>AppInstance</code> was created. In epoch milliseconds.</p>', 'AppInstance$LastUpdatedTimestamp' => '<p>The time an <code>AppInstance</code> was last updated. In epoch milliseconds.</p>', 'AppInstanceAdmin$CreatedTimestamp' => '<p>The time at which an administrator was created.</p>', 'AppInstanceBot$CreatedTimestamp' => '<p>The time at which the <code>AppInstanceBot</code> was created.</p>', 'AppInstanceBot$LastUpdatedTimestamp' => '<p>The time at which the <code>AppInstanceBot</code> was last updated.</p>', 'AppInstanceUser$CreatedTimestamp' => '<p>The time at which the <code>AppInstanceUser</code> was created.</p>', 'AppInstanceUser$LastUpdatedTimestamp' => '<p>The time at which the <code>AppInstanceUser</code> was last updated.</p>', 'AppInstanceUserEndpoint$CreatedTimestamp' => '<p>The time at which an <code>AppInstanceUserEndpoint</code> was created.</p>', 'AppInstanceUserEndpoint$LastUpdatedTimestamp' => '<p>The time at which an <code>AppInstanceUserEndpoint</code> was last updated.</p>', 'GetAppInstanceRetentionSettingsResponse$InitiateDeletionTimestamp' => '<p>The timestamp representing the time at which the specified items are retained, in Epoch Seconds.</p>', 'PutAppInstanceRetentionSettingsResponse$InitiateDeletionTimestamp' => '<p>The time at which the API deletes data.</p>', ], ], 'UnauthorizedClientException' => [ 'base' => '<p>The client is not currently authorized to make the request.</p>', 'refs' => [], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAppInstanceBotRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAppInstanceBotResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAppInstanceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAppInstanceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAppInstanceUserEndpointRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAppInstanceUserEndpointResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAppInstanceUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAppInstanceUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'UserId' => [ 'base' => NULL, 'refs' => [ 'CreateAppInstanceUserRequest$AppInstanceUserId' => '<p>The user ID of the <code>AppInstance</code>.</p>', ], ], 'UserName' => [ 'base' => NULL, 'refs' => [ 'AppInstanceUser$Name' => '<p>The name of the <code>AppInstanceUser</code>.</p>', 'AppInstanceUserSummary$Name' => '<p>The name of an <code>AppInstanceUser</code>.</p>', 'CreateAppInstanceUserRequest$Name' => '<p>The user\\'s name.</p>', 'UpdateAppInstanceUserRequest$Name' => '<p>The name of the <code>AppInstanceUser</code>.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-identity/2021-04-20/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://identity-chime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://identity-chime-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://identity-chime.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://identity-chime.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-identity/2021-04-20/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://identity-chime.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-identity/2021-04-20/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-identity/2021-04-20/paginators-1.json\nreturn [ 'pagination' => [ 'ListAppInstanceAdmins' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListAppInstanceBots' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListAppInstanceUserEndpoints' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListAppInstanceUsers' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListAppInstances' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-media-pipelines/2021-07-15/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2021-07-15', 'endpointPrefix' => 'media-pipelines-chime', 'protocol' => 'rest-json', 'serviceFullName' => 'Amazon Chime SDK Media Pipelines', 'serviceId' => 'Chime SDK Media Pipelines', 'signatureVersion' => 'v4', 'signingName' => 'chime', 'uid' => 'chime-sdk-media-pipelines-2021-07-15', ], 'operations' => [ 'CreateMediaCapturePipeline' => [ 'name' => 'CreateMediaCapturePipeline', 'http' => [ 'method' => 'POST', 'requestUri' => '/sdk-media-capture-pipelines', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateMediaCapturePipelineRequest', ], 'output' => [ 'shape' => 'CreateMediaCapturePipelineResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateMediaConcatenationPipeline' => [ 'name' => 'CreateMediaConcatenationPipeline', 'http' => [ 'method' => 'POST', 'requestUri' => '/sdk-media-concatenation-pipelines', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateMediaConcatenationPipelineRequest', ], 'output' => [ 'shape' => 'CreateMediaConcatenationPipelineResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateMediaInsightsPipeline' => [ 'name' => 'CreateMediaInsightsPipeline', 'http' => [ 'method' => 'POST', 'requestUri' => '/media-insights-pipelines', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateMediaInsightsPipelineRequest', ], 'output' => [ 'shape' => 'CreateMediaInsightsPipelineResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateMediaInsightsPipelineConfiguration' => [ 'name' => 'CreateMediaInsightsPipelineConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/media-insights-pipeline-configurations', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateMediaInsightsPipelineConfigurationRequest', ], 'output' => [ 'shape' => 'CreateMediaInsightsPipelineConfigurationResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateMediaLiveConnectorPipeline' => [ 'name' => 'CreateMediaLiveConnectorPipeline', 'http' => [ 'method' => 'POST', 'requestUri' => '/sdk-media-live-connector-pipelines', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateMediaLiveConnectorPipelineRequest', ], 'output' => [ 'shape' => 'CreateMediaLiveConnectorPipelineResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteMediaCapturePipeline' => [ 'name' => 'DeleteMediaCapturePipeline', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/sdk-media-capture-pipelines/{mediaPipelineId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteMediaCapturePipelineRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteMediaInsightsPipelineConfiguration' => [ 'name' => 'DeleteMediaInsightsPipelineConfiguration', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/media-insights-pipeline-configurations/{identifier}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteMediaInsightsPipelineConfigurationRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteMediaPipeline' => [ 'name' => 'DeleteMediaPipeline', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/sdk-media-pipelines/{mediaPipelineId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteMediaPipelineRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetMediaCapturePipeline' => [ 'name' => 'GetMediaCapturePipeline', 'http' => [ 'method' => 'GET', 'requestUri' => '/sdk-media-capture-pipelines/{mediaPipelineId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetMediaCapturePipelineRequest', ], 'output' => [ 'shape' => 'GetMediaCapturePipelineResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetMediaInsightsPipelineConfiguration' => [ 'name' => 'GetMediaInsightsPipelineConfiguration', 'http' => [ 'method' => 'GET', 'requestUri' => '/media-insights-pipeline-configurations/{identifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetMediaInsightsPipelineConfigurationRequest', ], 'output' => [ 'shape' => 'GetMediaInsightsPipelineConfigurationResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetMediaPipeline' => [ 'name' => 'GetMediaPipeline', 'http' => [ 'method' => 'GET', 'requestUri' => '/sdk-media-pipelines/{mediaPipelineId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetMediaPipelineRequest', ], 'output' => [ 'shape' => 'GetMediaPipelineResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListMediaCapturePipelines' => [ 'name' => 'ListMediaCapturePipelines', 'http' => [ 'method' => 'GET', 'requestUri' => '/sdk-media-capture-pipelines', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListMediaCapturePipelinesRequest', ], 'output' => [ 'shape' => 'ListMediaCapturePipelinesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListMediaInsightsPipelineConfigurations' => [ 'name' => 'ListMediaInsightsPipelineConfigurations', 'http' => [ 'method' => 'GET', 'requestUri' => '/media-insights-pipeline-configurations', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListMediaInsightsPipelineConfigurationsRequest', ], 'output' => [ 'shape' => 'ListMediaInsightsPipelineConfigurationsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListMediaPipelines' => [ 'name' => 'ListMediaPipelines', 'http' => [ 'method' => 'GET', 'requestUri' => '/sdk-media-pipelines', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListMediaPipelinesRequest', ], 'output' => [ 'shape' => 'ListMediaPipelinesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags?operation=tag-resource', 'responseCode' => 204, ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags?operation=untag-resource', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateMediaInsightsPipelineConfiguration' => [ 'name' => 'UpdateMediaInsightsPipelineConfiguration', 'http' => [ 'method' => 'PUT', 'requestUri' => '/media-insights-pipeline-configurations/{identifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateMediaInsightsPipelineConfigurationRequest', ], 'output' => [ 'shape' => 'UpdateMediaInsightsPipelineConfigurationResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateMediaInsightsPipelineStatus' => [ 'name' => 'UpdateMediaInsightsPipelineStatus', 'http' => [ 'method' => 'PUT', 'requestUri' => '/media-insights-pipeline-status/{identifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateMediaInsightsPipelineStatusRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], ], 'shapes' => [ 'AmazonResourceName' => [ 'type' => 'string', 'max' => 1011, 'min' => 1, 'pattern' => '^arn[\\\\/\\\\:\\\\-\\\\_\\\\.a-zA-Z0-9]+$', ], 'AmazonTranscribeCallAnalyticsProcessorConfiguration' => [ 'type' => 'structure', 'required' => [ 'LanguageCode', ], 'members' => [ 'LanguageCode' => [ 'shape' => 'CallAnalyticsLanguageCode', ], 'VocabularyName' => [ 'shape' => 'VocabularyName', ], 'VocabularyFilterName' => [ 'shape' => 'VocabularyFilterName', ], 'VocabularyFilterMethod' => [ 'shape' => 'VocabularyFilterMethod', ], 'LanguageModelName' => [ 'shape' => 'ModelName', ], 'EnablePartialResultsStabilization' => [ 'shape' => 'Boolean', ], 'PartialResultsStability' => [ 'shape' => 'PartialResultsStability', ], 'ContentIdentificationType' => [ 'shape' => 'ContentType', ], 'ContentRedactionType' => [ 'shape' => 'ContentType', ], 'PiiEntityTypes' => [ 'shape' => 'PiiEntityTypes', ], 'FilterPartialResults' => [ 'shape' => 'Boolean', ], 'PostCallAnalyticsSettings' => [ 'shape' => 'PostCallAnalyticsSettings', ], 'CallAnalyticsStreamCategories' => [ 'shape' => 'CategoryNameList', ], ], ], 'AmazonTranscribeProcessorConfiguration' => [ 'type' => 'structure', 'required' => [ 'LanguageCode', ], 'members' => [ 'LanguageCode' => [ 'shape' => 'CallAnalyticsLanguageCode', ], 'VocabularyName' => [ 'shape' => 'VocabularyName', ], 'VocabularyFilterName' => [ 'shape' => 'VocabularyFilterName', ], 'VocabularyFilterMethod' => [ 'shape' => 'VocabularyFilterMethod', ], 'ShowSpeakerLabel' => [ 'shape' => 'Boolean', ], 'EnablePartialResultsStabilization' => [ 'shape' => 'Boolean', ], 'PartialResultsStability' => [ 'shape' => 'PartialResultsStability', ], 'ContentIdentificationType' => [ 'shape' => 'ContentType', ], 'ContentRedactionType' => [ 'shape' => 'ContentType', ], 'PiiEntityTypes' => [ 'shape' => 'PiiEntityTypes', ], 'LanguageModelName' => [ 'shape' => 'ModelName', ], 'FilterPartialResults' => [ 'shape' => 'Boolean', ], ], ], 'Arn' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, 'pattern' => '^arn[\\\\/\\\\:\\\\-\\\\_\\\\.a-zA-Z0-9]+$', 'sensitive' => true, ], 'ArtifactsConcatenationConfiguration' => [ 'type' => 'structure', 'required' => [ 'Audio', 'Video', 'Content', 'DataChannel', 'TranscriptionMessages', 'MeetingEvents', 'CompositedVideo', ], 'members' => [ 'Audio' => [ 'shape' => 'AudioConcatenationConfiguration', ], 'Video' => [ 'shape' => 'VideoConcatenationConfiguration', ], 'Content' => [ 'shape' => 'ContentConcatenationConfiguration', ], 'DataChannel' => [ 'shape' => 'DataChannelConcatenationConfiguration', ], 'TranscriptionMessages' => [ 'shape' => 'TranscriptionMessagesConcatenationConfiguration', ], 'MeetingEvents' => [ 'shape' => 'MeetingEventsConcatenationConfiguration', ], 'CompositedVideo' => [ 'shape' => 'CompositedVideoConcatenationConfiguration', ], ], ], 'ArtifactsConcatenationState' => [ 'type' => 'string', 'enum' => [ 'Enabled', 'Disabled', ], ], 'ArtifactsConfiguration' => [ 'type' => 'structure', 'required' => [ 'Audio', 'Video', 'Content', ], 'members' => [ 'Audio' => [ 'shape' => 'AudioArtifactsConfiguration', ], 'Video' => [ 'shape' => 'VideoArtifactsConfiguration', ], 'Content' => [ 'shape' => 'ContentArtifactsConfiguration', ], 'CompositedVideo' => [ 'shape' => 'CompositedVideoArtifactsConfiguration', ], ], ], 'ArtifactsState' => [ 'type' => 'string', 'enum' => [ 'Enabled', 'Disabled', ], ], 'AttendeeIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'GuidString', ], 'min' => 1, ], 'AudioArtifactsConcatenationState' => [ 'type' => 'string', 'enum' => [ 'Enabled', ], ], 'AudioArtifactsConfiguration' => [ 'type' => 'structure', 'required' => [ 'MuxType', ], 'members' => [ 'MuxType' => [ 'shape' => 'AudioMuxType', ], ], ], 'AudioChannelsOption' => [ 'type' => 'string', 'enum' => [ 'Stereo', 'Mono', ], ], 'AudioConcatenationConfiguration' => [ 'type' => 'structure', 'required' => [ 'State', ], 'members' => [ 'State' => [ 'shape' => 'AudioArtifactsConcatenationState', ], ], ], 'AudioMuxType' => [ 'type' => 'string', 'enum' => [ 'AudioOnly', 'AudioWithActiveSpeakerVideo', 'AudioWithCompositedVideo', ], ], 'AudioSampleRateOption' => [ 'type' => 'string', 'pattern' => '44100|48000', ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'Boolean' => [ 'type' => 'boolean', ], 'CallAnalyticsLanguageCode' => [ 'type' => 'string', 'enum' => [ 'en-US', 'en-GB', 'es-US', 'fr-CA', 'fr-FR', 'en-AU', 'it-IT', 'de-DE', 'pt-BR', ], ], 'CategoryName' => [ 'type' => 'string', 'max' => 200, 'min' => 1, 'pattern' => '^[0-9a-zA-Z._-]+', ], 'CategoryNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CategoryName', ], 'max' => 20, 'min' => 1, ], 'ChannelDefinition' => [ 'type' => 'structure', 'required' => [ 'ChannelId', ], 'members' => [ 'ChannelId' => [ 'shape' => 'ChannelId', ], 'ParticipantRole' => [ 'shape' => 'ParticipantRole', ], ], ], 'ChannelDefinitions' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelDefinition', ], 'max' => 2, 'min' => 1, ], 'ChannelId' => [ 'type' => 'integer', 'max' => 1, 'min' => 0, ], 'ChimeSdkMeetingConcatenationConfiguration' => [ 'type' => 'structure', 'required' => [ 'ArtifactsConfiguration', ], 'members' => [ 'ArtifactsConfiguration' => [ 'shape' => 'ArtifactsConcatenationConfiguration', ], ], ], 'ChimeSdkMeetingConfiguration' => [ 'type' => 'structure', 'members' => [ 'SourceConfiguration' => [ 'shape' => 'SourceConfiguration', ], 'ArtifactsConfiguration' => [ 'shape' => 'ArtifactsConfiguration', ], ], ], 'ChimeSdkMeetingLiveConnectorConfiguration' => [ 'type' => 'structure', 'required' => [ 'Arn', 'MuxType', ], 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'MuxType' => [ 'shape' => 'LiveConnectorMuxType', ], 'CompositedVideo' => [ 'shape' => 'CompositedVideoArtifactsConfiguration', ], 'SourceConfiguration' => [ 'shape' => 'SourceConfiguration', ], ], ], 'ClientRequestToken' => [ 'type' => 'string', 'max' => 64, 'min' => 2, 'pattern' => '[-_a-zA-Z0-9]*', 'sensitive' => true, ], 'CompositedVideoArtifactsConfiguration' => [ 'type' => 'structure', 'required' => [ 'GridViewConfiguration', ], 'members' => [ 'Layout' => [ 'shape' => 'LayoutOption', ], 'Resolution' => [ 'shape' => 'ResolutionOption', ], 'GridViewConfiguration' => [ 'shape' => 'GridViewConfiguration', ], ], ], 'CompositedVideoConcatenationConfiguration' => [ 'type' => 'structure', 'required' => [ 'State', ], 'members' => [ 'State' => [ 'shape' => 'ArtifactsConcatenationState', ], ], ], 'ConcatenationSink' => [ 'type' => 'structure', 'required' => [ 'Type', 'S3BucketSinkConfiguration', ], 'members' => [ 'Type' => [ 'shape' => 'ConcatenationSinkType', ], 'S3BucketSinkConfiguration' => [ 'shape' => 'S3BucketSinkConfiguration', ], ], ], 'ConcatenationSinkList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConcatenationSink', ], 'max' => 1, 'min' => 1, ], 'ConcatenationSinkType' => [ 'type' => 'string', 'enum' => [ 'S3Bucket', ], ], 'ConcatenationSource' => [ 'type' => 'structure', 'required' => [ 'Type', 'MediaCapturePipelineSourceConfiguration', ], 'members' => [ 'Type' => [ 'shape' => 'ConcatenationSourceType', ], 'MediaCapturePipelineSourceConfiguration' => [ 'shape' => 'MediaCapturePipelineSourceConfiguration', ], ], ], 'ConcatenationSourceList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConcatenationSource', ], 'max' => 1, 'min' => 1, ], 'ConcatenationSourceType' => [ 'type' => 'string', 'enum' => [ 'MediaCapturePipeline', ], ], 'ConflictException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'ContentArtifactsConfiguration' => [ 'type' => 'structure', 'required' => [ 'State', ], 'members' => [ 'State' => [ 'shape' => 'ArtifactsState', ], 'MuxType' => [ 'shape' => 'ContentMuxType', ], ], ], 'ContentConcatenationConfiguration' => [ 'type' => 'structure', 'required' => [ 'State', ], 'members' => [ 'State' => [ 'shape' => 'ArtifactsConcatenationState', ], ], ], 'ContentMuxType' => [ 'type' => 'string', 'enum' => [ 'ContentOnly', ], ], 'ContentRedactionOutput' => [ 'type' => 'string', 'enum' => [ 'redacted', 'redacted_and_unredacted', ], ], 'ContentShareLayoutOption' => [ 'type' => 'string', 'enum' => [ 'PresenterOnly', 'Horizontal', 'Vertical', ], ], 'ContentType' => [ 'type' => 'string', 'enum' => [ 'PII', ], ], 'CreateMediaCapturePipelineRequest' => [ 'type' => 'structure', 'required' => [ 'SourceType', 'SourceArn', 'SinkType', 'SinkArn', ], 'members' => [ 'SourceType' => [ 'shape' => 'MediaPipelineSourceType', ], 'SourceArn' => [ 'shape' => 'Arn', ], 'SinkType' => [ 'shape' => 'MediaPipelineSinkType', ], 'SinkArn' => [ 'shape' => 'Arn', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'ChimeSdkMeetingConfiguration' => [ 'shape' => 'ChimeSdkMeetingConfiguration', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateMediaCapturePipelineResponse' => [ 'type' => 'structure', 'members' => [ 'MediaCapturePipeline' => [ 'shape' => 'MediaCapturePipeline', ], ], ], 'CreateMediaConcatenationPipelineRequest' => [ 'type' => 'structure', 'required' => [ 'Sources', 'Sinks', ], 'members' => [ 'Sources' => [ 'shape' => 'ConcatenationSourceList', ], 'Sinks' => [ 'shape' => 'ConcatenationSinkList', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateMediaConcatenationPipelineResponse' => [ 'type' => 'structure', 'members' => [ 'MediaConcatenationPipeline' => [ 'shape' => 'MediaConcatenationPipeline', ], ], ], 'CreateMediaInsightsPipelineConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'MediaInsightsPipelineConfigurationName', 'ResourceAccessRoleArn', 'Elements', ], 'members' => [ 'MediaInsightsPipelineConfigurationName' => [ 'shape' => 'MediaInsightsPipelineConfigurationNameString', ], 'ResourceAccessRoleArn' => [ 'shape' => 'Arn', ], 'RealTimeAlertConfiguration' => [ 'shape' => 'RealTimeAlertConfiguration', ], 'Elements' => [ 'shape' => 'MediaInsightsPipelineConfigurationElements', ], 'Tags' => [ 'shape' => 'TagList', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], ], ], 'CreateMediaInsightsPipelineConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'MediaInsightsPipelineConfiguration' => [ 'shape' => 'MediaInsightsPipelineConfiguration', ], ], ], 'CreateMediaInsightsPipelineRequest' => [ 'type' => 'structure', 'required' => [ 'MediaInsightsPipelineConfigurationArn', ], 'members' => [ 'MediaInsightsPipelineConfigurationArn' => [ 'shape' => 'Arn', ], 'KinesisVideoStreamSourceRuntimeConfiguration' => [ 'shape' => 'KinesisVideoStreamSourceRuntimeConfiguration', ], 'MediaInsightsRuntimeMetadata' => [ 'shape' => 'MediaInsightsRuntimeMetadata', ], 'KinesisVideoStreamRecordingSourceRuntimeConfiguration' => [ 'shape' => 'KinesisVideoStreamRecordingSourceRuntimeConfiguration', ], 'S3RecordingSinkRuntimeConfiguration' => [ 'shape' => 'S3RecordingSinkRuntimeConfiguration', ], 'Tags' => [ 'shape' => 'TagList', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], ], ], 'CreateMediaInsightsPipelineResponse' => [ 'type' => 'structure', 'required' => [ 'MediaInsightsPipeline', ], 'members' => [ 'MediaInsightsPipeline' => [ 'shape' => 'MediaInsightsPipeline', ], ], ], 'CreateMediaLiveConnectorPipelineRequest' => [ 'type' => 'structure', 'required' => [ 'Sources', 'Sinks', ], 'members' => [ 'Sources' => [ 'shape' => 'LiveConnectorSourceList', ], 'Sinks' => [ 'shape' => 'LiveConnectorSinkList', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateMediaLiveConnectorPipelineResponse' => [ 'type' => 'structure', 'members' => [ 'MediaLiveConnectorPipeline' => [ 'shape' => 'MediaLiveConnectorPipeline', ], ], ], 'DataChannelConcatenationConfiguration' => [ 'type' => 'structure', 'required' => [ 'State', ], 'members' => [ 'State' => [ 'shape' => 'ArtifactsConcatenationState', ], ], ], 'DeleteMediaCapturePipelineRequest' => [ 'type' => 'structure', 'required' => [ 'MediaPipelineId', ], 'members' => [ 'MediaPipelineId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'mediaPipelineId', ], ], ], 'DeleteMediaInsightsPipelineConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'Identifier', ], 'members' => [ 'Identifier' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'identifier', ], ], ], 'DeleteMediaPipelineRequest' => [ 'type' => 'structure', 'required' => [ 'MediaPipelineId', ], 'members' => [ 'MediaPipelineId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'mediaPipelineId', ], ], ], 'ErrorCode' => [ 'type' => 'string', 'enum' => [ 'BadRequest', 'Forbidden', 'NotFound', 'ResourceLimitExceeded', 'ServiceFailure', 'ServiceUnavailable', 'Throttling', ], ], 'ExternalUserIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ExternalUserIdType', ], 'min' => 1, ], 'ExternalUserIdType' => [ 'type' => 'string', 'max' => 64, 'min' => 2, 'sensitive' => true, ], 'ForbiddenException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 403, ], 'exception' => true, ], 'FragmentNumberString' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^[0-9]+$', ], 'FragmentSelector' => [ 'type' => 'structure', 'required' => [ 'FragmentSelectorType', 'TimestampRange', ], 'members' => [ 'FragmentSelectorType' => [ 'shape' => 'FragmentSelectorType', ], 'TimestampRange' => [ 'shape' => 'TimestampRange', ], ], ], 'FragmentSelectorType' => [ 'type' => 'string', 'enum' => [ 'ProducerTimestamp', 'ServerTimestamp', ], ], 'GetMediaCapturePipelineRequest' => [ 'type' => 'structure', 'required' => [ 'MediaPipelineId', ], 'members' => [ 'MediaPipelineId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'mediaPipelineId', ], ], ], 'GetMediaCapturePipelineResponse' => [ 'type' => 'structure', 'members' => [ 'MediaCapturePipeline' => [ 'shape' => 'MediaCapturePipeline', ], ], ], 'GetMediaInsightsPipelineConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'Identifier', ], 'members' => [ 'Identifier' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'identifier', ], ], ], 'GetMediaInsightsPipelineConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'MediaInsightsPipelineConfiguration' => [ 'shape' => 'MediaInsightsPipelineConfiguration', ], ], ], 'GetMediaPipelineRequest' => [ 'type' => 'structure', 'required' => [ 'MediaPipelineId', ], 'members' => [ 'MediaPipelineId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'mediaPipelineId', ], ], ], 'GetMediaPipelineResponse' => [ 'type' => 'structure', 'members' => [ 'MediaPipeline' => [ 'shape' => 'MediaPipeline', ], ], ], 'GridViewConfiguration' => [ 'type' => 'structure', 'required' => [ 'ContentShareLayout', ], 'members' => [ 'ContentShareLayout' => [ 'shape' => 'ContentShareLayoutOption', ], 'PresenterOnlyConfiguration' => [ 'shape' => 'PresenterOnlyConfiguration', ], ], ], 'GuidString' => [ 'type' => 'string', 'max' => 36, 'min' => 36, 'pattern' => '[a-fA-F0-9]{8}(?:-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}', ], 'Iso8601Timestamp' => [ 'type' => 'timestamp', 'timestampFormat' => 'iso8601', ], 'IssueDetectionConfiguration' => [ 'type' => 'structure', 'required' => [ 'RuleName', ], 'members' => [ 'RuleName' => [ 'shape' => 'RuleName', ], ], ], 'Keyword' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '^[\\\\s0-9a-zA-Z\\'-]+', ], 'KeywordMatchConfiguration' => [ 'type' => 'structure', 'required' => [ 'RuleName', 'Keywords', ], 'members' => [ 'RuleName' => [ 'shape' => 'RuleName', ], 'Keywords' => [ 'shape' => 'KeywordMatchWordList', ], 'Negate' => [ 'shape' => 'Boolean', ], ], ], 'KeywordMatchWordList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Keyword', ], 'max' => 10, 'min' => 1, ], 'KinesisDataStreamSinkConfiguration' => [ 'type' => 'structure', 'members' => [ 'InsightsTarget' => [ 'shape' => 'Arn', ], ], ], 'KinesisVideoStreamArn' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, 'pattern' => 'arn:[a-z\\\\d-]+:kinesisvideo:[a-z0-9-]+:[0-9]+:[a-z]+/[a-zA-Z0-9_.-]+/[0-9]+', ], 'KinesisVideoStreamRecordingSourceRuntimeConfiguration' => [ 'type' => 'structure', 'required' => [ 'Streams', 'FragmentSelector', ], 'members' => [ 'Streams' => [ 'shape' => 'RecordingStreamList', ], 'FragmentSelector' => [ 'shape' => 'FragmentSelector', ], ], ], 'KinesisVideoStreamSourceRuntimeConfiguration' => [ 'type' => 'structure', 'required' => [ 'Streams', 'MediaEncoding', 'MediaSampleRate', ], 'members' => [ 'Streams' => [ 'shape' => 'Streams', ], 'MediaEncoding' => [ 'shape' => 'MediaEncoding', ], 'MediaSampleRate' => [ 'shape' => 'MediaSampleRateHertz', ], ], ], 'LambdaFunctionSinkConfiguration' => [ 'type' => 'structure', 'members' => [ 'InsightsTarget' => [ 'shape' => 'Arn', ], ], ], 'LayoutOption' => [ 'type' => 'string', 'enum' => [ 'GridView', ], ], 'ListMediaCapturePipelinesRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListMediaCapturePipelinesResponse' => [ 'type' => 'structure', 'members' => [ 'MediaCapturePipelines' => [ 'shape' => 'MediaCapturePipelineSummaryList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListMediaInsightsPipelineConfigurationsRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListMediaInsightsPipelineConfigurationsResponse' => [ 'type' => 'structure', 'members' => [ 'MediaInsightsPipelineConfigurations' => [ 'shape' => 'MediaInsightsPipelineConfigurationSummaryList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListMediaPipelinesRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListMediaPipelinesResponse' => [ 'type' => 'structure', 'members' => [ 'MediaPipelines' => [ 'shape' => 'MediaPipelineList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'AmazonResourceName', 'location' => 'querystring', 'locationName' => 'arn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], ], ], 'LiveConnectorMuxType' => [ 'type' => 'string', 'enum' => [ 'AudioWithCompositedVideo', 'AudioWithActiveSpeakerVideo', ], ], 'LiveConnectorRTMPConfiguration' => [ 'type' => 'structure', 'required' => [ 'Url', ], 'members' => [ 'Url' => [ 'shape' => 'SensitiveString', ], 'AudioChannels' => [ 'shape' => 'AudioChannelsOption', ], 'AudioSampleRate' => [ 'shape' => 'AudioSampleRateOption', ], ], ], 'LiveConnectorSinkConfiguration' => [ 'type' => 'structure', 'required' => [ 'SinkType', 'RTMPConfiguration', ], 'members' => [ 'SinkType' => [ 'shape' => 'LiveConnectorSinkType', ], 'RTMPConfiguration' => [ 'shape' => 'LiveConnectorRTMPConfiguration', ], ], ], 'LiveConnectorSinkList' => [ 'type' => 'list', 'member' => [ 'shape' => 'LiveConnectorSinkConfiguration', ], 'max' => 1, 'min' => 1, ], 'LiveConnectorSinkType' => [ 'type' => 'string', 'enum' => [ 'RTMP', ], ], 'LiveConnectorSourceConfiguration' => [ 'type' => 'structure', 'required' => [ 'SourceType', 'ChimeSdkMeetingLiveConnectorConfiguration', ], 'members' => [ 'SourceType' => [ 'shape' => 'LiveConnectorSourceType', ], 'ChimeSdkMeetingLiveConnectorConfiguration' => [ 'shape' => 'ChimeSdkMeetingLiveConnectorConfiguration', ], ], ], 'LiveConnectorSourceList' => [ 'type' => 'list', 'member' => [ 'shape' => 'LiveConnectorSourceConfiguration', ], 'max' => 1, 'min' => 1, ], 'LiveConnectorSourceType' => [ 'type' => 'string', 'enum' => [ 'ChimeSdkMeeting', ], ], 'MediaCapturePipeline' => [ 'type' => 'structure', 'members' => [ 'MediaPipelineId' => [ 'shape' => 'GuidString', ], 'MediaPipelineArn' => [ 'shape' => 'AmazonResourceName', ], 'SourceType' => [ 'shape' => 'MediaPipelineSourceType', ], 'SourceArn' => [ 'shape' => 'Arn', ], 'Status' => [ 'shape' => 'MediaPipelineStatus', ], 'SinkType' => [ 'shape' => 'MediaPipelineSinkType', ], 'SinkArn' => [ 'shape' => 'Arn', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'ChimeSdkMeetingConfiguration' => [ 'shape' => 'ChimeSdkMeetingConfiguration', ], ], ], 'MediaCapturePipelineSourceConfiguration' => [ 'type' => 'structure', 'required' => [ 'MediaPipelineArn', 'ChimeSdkMeetingConfiguration', ], 'members' => [ 'MediaPipelineArn' => [ 'shape' => 'Arn', ], 'ChimeSdkMeetingConfiguration' => [ 'shape' => 'ChimeSdkMeetingConcatenationConfiguration', ], ], ], 'MediaCapturePipelineSummary' => [ 'type' => 'structure', 'members' => [ 'MediaPipelineId' => [ 'shape' => 'GuidString', ], 'MediaPipelineArn' => [ 'shape' => 'AmazonResourceName', ], ], ], 'MediaCapturePipelineSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'MediaCapturePipelineSummary', ], ], 'MediaConcatenationPipeline' => [ 'type' => 'structure', 'members' => [ 'MediaPipelineId' => [ 'shape' => 'GuidString', ], 'MediaPipelineArn' => [ 'shape' => 'AmazonResourceName', ], 'Sources' => [ 'shape' => 'ConcatenationSourceList', ], 'Sinks' => [ 'shape' => 'ConcatenationSinkList', ], 'Status' => [ 'shape' => 'MediaPipelineStatus', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'MediaEncoding' => [ 'type' => 'string', 'enum' => [ 'pcm', ], ], 'MediaInsightsPipeline' => [ 'type' => 'structure', 'members' => [ 'MediaPipelineId' => [ 'shape' => 'GuidString', ], 'MediaPipelineArn' => [ 'shape' => 'Arn', ], 'MediaInsightsPipelineConfigurationArn' => [ 'shape' => 'Arn', ], 'Status' => [ 'shape' => 'MediaPipelineStatus', ], 'KinesisVideoStreamSourceRuntimeConfiguration' => [ 'shape' => 'KinesisVideoStreamSourceRuntimeConfiguration', ], 'MediaInsightsRuntimeMetadata' => [ 'shape' => 'MediaInsightsRuntimeMetadata', ], 'KinesisVideoStreamRecordingSourceRuntimeConfiguration' => [ 'shape' => 'KinesisVideoStreamRecordingSourceRuntimeConfiguration', ], 'S3RecordingSinkRuntimeConfiguration' => [ 'shape' => 'S3RecordingSinkRuntimeConfiguration', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'MediaInsightsPipelineConfiguration' => [ 'type' => 'structure', 'members' => [ 'MediaInsightsPipelineConfigurationName' => [ 'shape' => 'MediaInsightsPipelineConfigurationNameString', ], 'MediaInsightsPipelineConfigurationArn' => [ 'shape' => 'Arn', ], 'ResourceAccessRoleArn' => [ 'shape' => 'Arn', ], 'RealTimeAlertConfiguration' => [ 'shape' => 'RealTimeAlertConfiguration', ], 'Elements' => [ 'shape' => 'MediaInsightsPipelineConfigurationElements', ], 'MediaInsightsPipelineConfigurationId' => [ 'shape' => 'GuidString', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'MediaInsightsPipelineConfigurationElement' => [ 'type' => 'structure', 'required' => [ 'Type', ], 'members' => [ 'Type' => [ 'shape' => 'MediaInsightsPipelineConfigurationElementType', ], 'AmazonTranscribeCallAnalyticsProcessorConfiguration' => [ 'shape' => 'AmazonTranscribeCallAnalyticsProcessorConfiguration', ], 'AmazonTranscribeProcessorConfiguration' => [ 'shape' => 'AmazonTranscribeProcessorConfiguration', ], 'KinesisDataStreamSinkConfiguration' => [ 'shape' => 'KinesisDataStreamSinkConfiguration', ], 'S3RecordingSinkConfiguration' => [ 'shape' => 'S3RecordingSinkConfiguration', ], 'VoiceAnalyticsProcessorConfiguration' => [ 'shape' => 'VoiceAnalyticsProcessorConfiguration', ], 'LambdaFunctionSinkConfiguration' => [ 'shape' => 'LambdaFunctionSinkConfiguration', ], 'SqsQueueSinkConfiguration' => [ 'shape' => 'SqsQueueSinkConfiguration', ], 'SnsTopicSinkConfiguration' => [ 'shape' => 'SnsTopicSinkConfiguration', ], ], ], 'MediaInsightsPipelineConfigurationElementType' => [ 'type' => 'string', 'enum' => [ 'AmazonTranscribeCallAnalyticsProcessor', 'VoiceAnalyticsProcessor', 'AmazonTranscribeProcessor', 'KinesisDataStreamSink', 'LambdaFunctionSink', 'SqsQueueSink', 'SnsTopicSink', 'S3RecordingSink', ], ], 'MediaInsightsPipelineConfigurationElements' => [ 'type' => 'list', 'member' => [ 'shape' => 'MediaInsightsPipelineConfigurationElement', ], ], 'MediaInsightsPipelineConfigurationNameString' => [ 'type' => 'string', 'max' => 64, 'min' => 2, 'pattern' => '^[0-9a-zA-Z._-]+', ], 'MediaInsightsPipelineConfigurationSummary' => [ 'type' => 'structure', 'members' => [ 'MediaInsightsPipelineConfigurationName' => [ 'shape' => 'MediaInsightsPipelineConfigurationNameString', ], 'MediaInsightsPipelineConfigurationId' => [ 'shape' => 'GuidString', ], 'MediaInsightsPipelineConfigurationArn' => [ 'shape' => 'Arn', ], ], ], 'MediaInsightsPipelineConfigurationSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'MediaInsightsPipelineConfigurationSummary', ], ], 'MediaInsightsRuntimeMetadata' => [ 'type' => 'map', 'key' => [ 'shape' => 'NonEmptyString', ], 'value' => [ 'shape' => 'String', ], 'sensitive' => true, ], 'MediaLiveConnectorPipeline' => [ 'type' => 'structure', 'members' => [ 'Sources' => [ 'shape' => 'LiveConnectorSourceList', ], 'Sinks' => [ 'shape' => 'LiveConnectorSinkList', ], 'MediaPipelineId' => [ 'shape' => 'GuidString', ], 'MediaPipelineArn' => [ 'shape' => 'AmazonResourceName', ], 'Status' => [ 'shape' => 'MediaPipelineStatus', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'MediaPipeline' => [ 'type' => 'structure', 'members' => [ 'MediaCapturePipeline' => [ 'shape' => 'MediaCapturePipeline', ], 'MediaLiveConnectorPipeline' => [ 'shape' => 'MediaLiveConnectorPipeline', ], 'MediaConcatenationPipeline' => [ 'shape' => 'MediaConcatenationPipeline', ], 'MediaInsightsPipeline' => [ 'shape' => 'MediaInsightsPipeline', ], ], ], 'MediaPipelineList' => [ 'type' => 'list', 'member' => [ 'shape' => 'MediaPipelineSummary', ], ], 'MediaPipelineSinkType' => [ 'type' => 'string', 'enum' => [ 'S3Bucket', ], ], 'MediaPipelineSourceType' => [ 'type' => 'string', 'enum' => [ 'ChimeSdkMeeting', ], ], 'MediaPipelineStatus' => [ 'type' => 'string', 'enum' => [ 'Initializing', 'InProgress', 'Failed', 'Stopping', 'Stopped', 'Paused', ], ], 'MediaPipelineStatusUpdate' => [ 'type' => 'string', 'enum' => [ 'Pause', 'Resume', ], ], 'MediaPipelineSummary' => [ 'type' => 'structure', 'members' => [ 'MediaPipelineId' => [ 'shape' => 'GuidString', ], 'MediaPipelineArn' => [ 'shape' => 'AmazonResourceName', ], ], ], 'MediaSampleRateHertz' => [ 'type' => 'integer', 'max' => 48000, 'min' => 8000, ], 'MeetingEventsConcatenationConfiguration' => [ 'type' => 'structure', 'required' => [ 'State', ], 'members' => [ 'State' => [ 'shape' => 'ArtifactsConcatenationState', ], ], ], 'ModelName' => [ 'type' => 'string', 'max' => 200, 'min' => 1, 'pattern' => '^[0-9a-zA-Z._-]+', ], 'NonEmptyString' => [ 'type' => 'string', 'max' => 1024, 'pattern' => '.*\\\\S.*', ], 'NotFoundException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'NumberOfChannels' => [ 'type' => 'integer', 'max' => 2, 'min' => 1, ], 'PartialResultsStability' => [ 'type' => 'string', 'enum' => [ 'high', 'medium', 'low', ], ], 'ParticipantRole' => [ 'type' => 'string', 'enum' => [ 'AGENT', 'CUSTOMER', ], ], 'PiiEntityTypes' => [ 'type' => 'string', 'max' => 300, 'min' => 1, 'pattern' => '^[A-Z_, ]+', ], 'PostCallAnalyticsSettings' => [ 'type' => 'structure', 'required' => [ 'OutputLocation', 'DataAccessRoleArn', ], 'members' => [ 'OutputLocation' => [ 'shape' => 'String', ], 'DataAccessRoleArn' => [ 'shape' => 'String', ], 'ContentRedactionOutput' => [ 'shape' => 'ContentRedactionOutput', ], 'OutputEncryptionKMSKeyId' => [ 'shape' => 'String', ], ], ], 'PresenterOnlyConfiguration' => [ 'type' => 'structure', 'members' => [ 'PresenterPosition' => [ 'shape' => 'PresenterPosition', ], ], ], 'PresenterPosition' => [ 'type' => 'string', 'enum' => [ 'TopLeft', 'TopRight', 'BottomLeft', 'BottomRight', ], ], 'RealTimeAlertConfiguration' => [ 'type' => 'structure', 'members' => [ 'Disabled' => [ 'shape' => 'Boolean', ], 'Rules' => [ 'shape' => 'RealTimeAlertRuleList', ], ], ], 'RealTimeAlertRule' => [ 'type' => 'structure', 'required' => [ 'Type', ], 'members' => [ 'Type' => [ 'shape' => 'RealTimeAlertRuleType', ], 'KeywordMatchConfiguration' => [ 'shape' => 'KeywordMatchConfiguration', ], 'SentimentConfiguration' => [ 'shape' => 'SentimentConfiguration', ], 'IssueDetectionConfiguration' => [ 'shape' => 'IssueDetectionConfiguration', ], ], ], 'RealTimeAlertRuleList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RealTimeAlertRule', ], 'max' => 3, 'min' => 1, ], 'RealTimeAlertRuleType' => [ 'type' => 'string', 'enum' => [ 'KeywordMatch', 'Sentiment', 'IssueDetection', ], ], 'RecordingFileFormat' => [ 'type' => 'string', 'enum' => [ 'Wav', 'Opus', ], ], 'RecordingStreamConfiguration' => [ 'type' => 'structure', 'members' => [ 'StreamArn' => [ 'shape' => 'KinesisVideoStreamArn', ], ], ], 'RecordingStreamList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RecordingStreamConfiguration', ], 'max' => 2, 'min' => 2, ], 'ResolutionOption' => [ 'type' => 'string', 'enum' => [ 'HD', 'FHD', ], ], 'ResourceLimitExceededException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ResultMax' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'RuleName' => [ 'type' => 'string', 'max' => 64, 'min' => 2, 'pattern' => '^[0-9a-zA-Z._-]+', ], 'S3BucketSinkConfiguration' => [ 'type' => 'structure', 'required' => [ 'Destination', ], 'members' => [ 'Destination' => [ 'shape' => 'Arn', ], ], ], 'S3RecordingSinkConfiguration' => [ 'type' => 'structure', 'members' => [ 'Destination' => [ 'shape' => 'Arn', ], 'RecordingFileFormat' => [ 'shape' => 'RecordingFileFormat', ], ], ], 'S3RecordingSinkRuntimeConfiguration' => [ 'type' => 'structure', 'required' => [ 'Destination', 'RecordingFileFormat', ], 'members' => [ 'Destination' => [ 'shape' => 'Arn', ], 'RecordingFileFormat' => [ 'shape' => 'RecordingFileFormat', ], ], ], 'SelectedVideoStreams' => [ 'type' => 'structure', 'members' => [ 'AttendeeIds' => [ 'shape' => 'AttendeeIdList', ], 'ExternalUserIds' => [ 'shape' => 'ExternalUserIdList', ], ], ], 'SensitiveString' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, 'sensitive' => true, ], 'SentimentConfiguration' => [ 'type' => 'structure', 'required' => [ 'RuleName', 'SentimentType', 'TimePeriod', ], 'members' => [ 'RuleName' => [ 'shape' => 'RuleName', ], 'SentimentType' => [ 'shape' => 'SentimentType', ], 'TimePeriod' => [ 'shape' => 'SentimentTimePeriodInSeconds', ], ], ], 'SentimentTimePeriodInSeconds' => [ 'type' => 'integer', 'max' => 1800, 'min' => 60, ], 'SentimentType' => [ 'type' => 'string', 'enum' => [ 'NEGATIVE', ], ], 'ServiceFailureException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'ServiceUnavailableException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], 'SnsTopicSinkConfiguration' => [ 'type' => 'structure', 'members' => [ 'InsightsTarget' => [ 'shape' => 'Arn', ], ], ], 'SourceConfiguration' => [ 'type' => 'structure', 'members' => [ 'SelectedVideoStreams' => [ 'shape' => 'SelectedVideoStreams', ], ], ], 'SqsQueueSinkConfiguration' => [ 'type' => 'structure', 'members' => [ 'InsightsTarget' => [ 'shape' => 'Arn', ], ], ], 'StreamChannelDefinition' => [ 'type' => 'structure', 'required' => [ 'NumberOfChannels', ], 'members' => [ 'NumberOfChannels' => [ 'shape' => 'NumberOfChannels', ], 'ChannelDefinitions' => [ 'shape' => 'ChannelDefinitions', ], ], ], 'StreamConfiguration' => [ 'type' => 'structure', 'required' => [ 'StreamArn', 'StreamChannelDefinition', ], 'members' => [ 'StreamArn' => [ 'shape' => 'KinesisVideoStreamArn', ], 'FragmentNumber' => [ 'shape' => 'FragmentNumberString', ], 'StreamChannelDefinition' => [ 'shape' => 'StreamChannelDefinition', ], ], ], 'Streams' => [ 'type' => 'list', 'member' => [ 'shape' => 'StreamConfiguration', ], 'max' => 2, 'min' => 1, ], 'String' => [ 'type' => 'string', 'max' => 4096, 'pattern' => '.*', ], 'Tag' => [ 'type' => 'structure', 'required' => [ 'Key', 'Value', ], 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 200, 'min' => 1, ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], 'max' => 200, 'min' => 1, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'Tags', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'AmazonResourceName', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, ], 'ThrottledClientException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], 'Timestamp' => [ 'type' => 'timestamp', ], 'TimestampRange' => [ 'type' => 'structure', 'required' => [ 'StartTimestamp', 'EndTimestamp', ], 'members' => [ 'StartTimestamp' => [ 'shape' => 'Timestamp', ], 'EndTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'TranscriptionMessagesConcatenationConfiguration' => [ 'type' => 'structure', 'required' => [ 'State', ], 'members' => [ 'State' => [ 'shape' => 'ArtifactsConcatenationState', ], ], ], 'UnauthorizedClientException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'TagKeys', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'AmazonResourceName', ], 'TagKeys' => [ 'shape' => 'TagKeyList', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateMediaInsightsPipelineConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'Identifier', 'ResourceAccessRoleArn', 'Elements', ], 'members' => [ 'Identifier' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'identifier', ], 'ResourceAccessRoleArn' => [ 'shape' => 'Arn', ], 'RealTimeAlertConfiguration' => [ 'shape' => 'RealTimeAlertConfiguration', ], 'Elements' => [ 'shape' => 'MediaInsightsPipelineConfigurationElements', ], ], ], 'UpdateMediaInsightsPipelineConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'MediaInsightsPipelineConfiguration' => [ 'shape' => 'MediaInsightsPipelineConfiguration', ], ], ], 'UpdateMediaInsightsPipelineStatusRequest' => [ 'type' => 'structure', 'required' => [ 'Identifier', 'UpdateStatus', ], 'members' => [ 'Identifier' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'identifier', ], 'UpdateStatus' => [ 'shape' => 'MediaPipelineStatusUpdate', ], ], ], 'VideoArtifactsConfiguration' => [ 'type' => 'structure', 'required' => [ 'State', ], 'members' => [ 'State' => [ 'shape' => 'ArtifactsState', ], 'MuxType' => [ 'shape' => 'VideoMuxType', ], ], ], 'VideoConcatenationConfiguration' => [ 'type' => 'structure', 'required' => [ 'State', ], 'members' => [ 'State' => [ 'shape' => 'ArtifactsConcatenationState', ], ], ], 'VideoMuxType' => [ 'type' => 'string', 'enum' => [ 'VideoOnly', ], ], 'VocabularyFilterMethod' => [ 'type' => 'string', 'enum' => [ 'remove', 'mask', 'tag', ], ], 'VocabularyFilterName' => [ 'type' => 'string', 'max' => 200, 'min' => 1, 'pattern' => '^[0-9a-zA-Z._-]+', ], 'VocabularyName' => [ 'type' => 'string', 'max' => 200, 'min' => 1, 'pattern' => '^[0-9a-zA-Z._-]+', ], 'VoiceAnalyticsConfigurationStatus' => [ 'type' => 'string', 'enum' => [ 'Enabled', 'Disabled', ], ], 'VoiceAnalyticsProcessorConfiguration' => [ 'type' => 'structure', 'members' => [ 'SpeakerSearchStatus' => [ 'shape' => 'VoiceAnalyticsConfigurationStatus', ], 'VoiceToneAnalysisStatus' => [ 'shape' => 'VoiceAnalyticsConfigurationStatus', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-media-pipelines/2021-07-15/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>The Amazon Chime SDK media pipeline APIs in this section allow software developers to create Amazon Chime SDK media pipelines that capture, concatenate, or stream your Amazon Chime SDK meetings. For more information about media pipelines, see <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_Operations_Amazon_Chime_SDK_Media_Pipelines.html\">Amazon Chime SDK media pipelines</a>. </p>', 'operations' => [ 'CreateMediaCapturePipeline' => '<p>Creates a media pipeline.</p>', 'CreateMediaConcatenationPipeline' => '<p>Creates a media concatenation pipeline.</p>', 'CreateMediaInsightsPipeline' => '<p>Creates a media insights pipeline.</p>', 'CreateMediaInsightsPipelineConfiguration' => '<p>A structure that contains the static configurations for a media insights pipeline.</p>', 'CreateMediaLiveConnectorPipeline' => '<p>Creates a media live connector pipeline in an Amazon Chime SDK meeting.</p>', 'DeleteMediaCapturePipeline' => '<p>Deletes the media pipeline.</p>', 'DeleteMediaInsightsPipelineConfiguration' => '<p>Deletes the specified configuration settings.</p>', 'DeleteMediaPipeline' => '<p>Deletes the media pipeline.</p>', 'GetMediaCapturePipeline' => '<p>Gets an existing media pipeline.</p>', 'GetMediaInsightsPipelineConfiguration' => '<p>Gets the configuration settings for a media insights pipeline.</p>', 'GetMediaPipeline' => '<p>Gets an existing media pipeline.</p>', 'ListMediaCapturePipelines' => '<p>Returns a list of media pipelines.</p>', 'ListMediaInsightsPipelineConfigurations' => '<p>Lists the available media insights pipeline configurations.</p>', 'ListMediaPipelines' => '<p>Returns a list of media pipelines.</p>', 'ListTagsForResource' => '<p>Lists the tags available for a media pipeline.</p>', 'TagResource' => '<p>The ARN of the media pipeline that you want to tag. Consists of the pipeline\\'s endpoint region, resource ID, and pipeline ID.</p>', 'UntagResource' => '<p>Removes any tags from a media pipeline.</p>', 'UpdateMediaInsightsPipelineConfiguration' => '<p>Updates the media insights pipeline\\'s configuration settings.</p>', 'UpdateMediaInsightsPipelineStatus' => '<p>Updates the status of a media insights pipeline.</p>', ], 'shapes' => [ 'AmazonResourceName' => [ 'base' => NULL, 'refs' => [ 'ListTagsForResourceRequest$ResourceARN' => '<p>The ARN of the media pipeline associated with any tags. The ARN consists of the pipeline\\'s region, resource ID, and pipeline ID.</p>', 'MediaCapturePipeline$MediaPipelineArn' => '<p>The ARN of the media capture pipeline</p>', 'MediaCapturePipelineSummary$MediaPipelineArn' => '<p>The ARN of the media pipeline in the summary.</p>', 'MediaConcatenationPipeline$MediaPipelineArn' => '<p>The ARN of the media pipeline that you specify in the <code>SourceConfiguration</code> object.</p>', 'MediaLiveConnectorPipeline$MediaPipelineArn' => '<p>The connector pipeline\\'s ARN.</p>', 'MediaPipelineSummary$MediaPipelineArn' => '<p>The ARN of the media pipeline in the summary.</p>', 'TagResourceRequest$ResourceARN' => '<p>The ARN of the media pipeline associated with any tags. The ARN consists of the pipeline\\'s endpoint region, resource ID, and pipeline ID.</p>', 'UntagResourceRequest$ResourceARN' => '<p>The ARN of the pipeline that you want to untag.</p>', ], ], 'AmazonTranscribeCallAnalyticsProcessorConfiguration' => [ 'base' => '<p>A structure that contains the configuration settings for an Amazon Transcribe call analytics processor.</p>', 'refs' => [ 'MediaInsightsPipelineConfigurationElement$AmazonTranscribeCallAnalyticsProcessorConfiguration' => '<p>The analytics configuration settings for transcribing audio in a media insights pipeline configuration element.</p>', ], ], 'AmazonTranscribeProcessorConfiguration' => [ 'base' => '<p>A structure that contains the configuration settings for an Amazon Transcribe processor.</p>', 'refs' => [ 'MediaInsightsPipelineConfigurationElement$AmazonTranscribeProcessorConfiguration' => '<p>The transcription processor configuration settings in a media insights pipeline configuration element.</p>', ], ], 'Arn' => [ 'base' => NULL, 'refs' => [ 'ChimeSdkMeetingLiveConnectorConfiguration$Arn' => '<p>The configuration object\\'s Chime SDK meeting ARN.</p>', 'CreateMediaCapturePipelineRequest$SourceArn' => '<p>ARN of the source from which the media artifacts are captured.</p>', 'CreateMediaCapturePipelineRequest$SinkArn' => '<p>The ARN of the sink type.</p>', 'CreateMediaInsightsPipelineConfigurationRequest$ResourceAccessRoleArn' => '<p>The ARN of the role used by the service to access Amazon Web Services resources, including <code>Transcribe</code> and <code>Transcribe Call Analytics</code>, on the caller\u00e2\u20ac\u2122s behalf.</p>', 'CreateMediaInsightsPipelineRequest$MediaInsightsPipelineConfigurationArn' => '<p>The ARN of the pipeline\\'s configuration.</p>', 'KinesisDataStreamSinkConfiguration$InsightsTarget' => '<p>The ARN of the sink.</p>', 'LambdaFunctionSinkConfiguration$InsightsTarget' => '<p>The ARN of the sink.</p>', 'MediaCapturePipeline$SourceArn' => '<p>ARN of the source from which the media artifacts are saved.</p>', 'MediaCapturePipeline$SinkArn' => '<p>ARN of the destination to which the media artifacts are saved.</p>', 'MediaCapturePipelineSourceConfiguration$MediaPipelineArn' => '<p>The media pipeline ARN in the configuration object of a media capture pipeline.</p>', 'MediaInsightsPipeline$MediaPipelineArn' => '<p>The ARN of a media insights pipeline.</p>', 'MediaInsightsPipeline$MediaInsightsPipelineConfigurationArn' => '<p>The ARN of a media insight pipeline\\'s configuration settings.</p>', 'MediaInsightsPipelineConfiguration$MediaInsightsPipelineConfigurationArn' => '<p>The ARN of the configuration.</p>', 'MediaInsightsPipelineConfiguration$ResourceAccessRoleArn' => '<p>The ARN of the role used by the service to access Amazon Web Services resources.</p>', 'MediaInsightsPipelineConfigurationSummary$MediaInsightsPipelineConfigurationArn' => '<p>The ARN of the media insights pipeline configuration.</p>', 'S3BucketSinkConfiguration$Destination' => '<p>The destination URL of the S3 bucket.</p>', 'S3RecordingSinkConfiguration$Destination' => '<p>The default URI of the Amazon S3 bucket used as the recording sink.</p>', 'S3RecordingSinkRuntimeConfiguration$Destination' => '<p>The URI of the S3 bucket used as the sink.</p>', 'SnsTopicSinkConfiguration$InsightsTarget' => '<p>The ARN of the SNS sink.</p>', 'SqsQueueSinkConfiguration$InsightsTarget' => '<p>The ARN of the SQS sink.</p>', 'UpdateMediaInsightsPipelineConfigurationRequest$ResourceAccessRoleArn' => '<p>The ARN of the role used by the service to access Amazon Web Services resources.</p>', ], ], 'ArtifactsConcatenationConfiguration' => [ 'base' => '<p>The configuration for the artifacts concatenation.</p>', 'refs' => [ 'ChimeSdkMeetingConcatenationConfiguration$ArtifactsConfiguration' => '<p>The configuration for the artifacts in an Amazon Chime SDK meeting concatenation.</p>', ], ], 'ArtifactsConcatenationState' => [ 'base' => NULL, 'refs' => [ 'CompositedVideoConcatenationConfiguration$State' => '<p>Enables or disables the configuration object.</p>', 'ContentConcatenationConfiguration$State' => '<p>Enables or disables the configuration object.</p>', 'DataChannelConcatenationConfiguration$State' => '<p>Enables or disables the configuration object.</p>', 'MeetingEventsConcatenationConfiguration$State' => '<p>Enables or disables the configuration object.</p>', 'TranscriptionMessagesConcatenationConfiguration$State' => '<p>Enables or disables the configuration object.</p>', 'VideoConcatenationConfiguration$State' => '<p>Enables or disables the configuration object.</p>', ], ], 'ArtifactsConfiguration' => [ 'base' => '<p>The configuration for the artifacts.</p>', 'refs' => [ 'ChimeSdkMeetingConfiguration$ArtifactsConfiguration' => '<p>The configuration for the artifacts in an Amazon Chime SDK meeting.</p>', ], ], 'ArtifactsState' => [ 'base' => NULL, 'refs' => [ 'ContentArtifactsConfiguration$State' => '<p>Indicates whether the content artifact is enabled or disabled.</p>', 'VideoArtifactsConfiguration$State' => '<p>Indicates whether the video artifact is enabled or disabled.</p>', ], ], 'AttendeeIdList' => [ 'base' => NULL, 'refs' => [ 'SelectedVideoStreams$AttendeeIds' => '<p>The attendee IDs of the streams selected for a media pipeline. </p>', ], ], 'AudioArtifactsConcatenationState' => [ 'base' => NULL, 'refs' => [ 'AudioConcatenationConfiguration$State' => '<p>Enables or disables the configuration object.</p>', ], ], 'AudioArtifactsConfiguration' => [ 'base' => '<p>The audio artifact configuration object.</p>', 'refs' => [ 'ArtifactsConfiguration$Audio' => '<p>The configuration for the audio artifacts.</p>', ], ], 'AudioChannelsOption' => [ 'base' => NULL, 'refs' => [ 'LiveConnectorRTMPConfiguration$AudioChannels' => '<p>The audio channels set for the RTMP configuration</p>', ], ], 'AudioConcatenationConfiguration' => [ 'base' => '<p>The audio artifact concatenation configuration object.</p>', 'refs' => [ 'ArtifactsConcatenationConfiguration$Audio' => '<p>The configuration for the audio artifacts concatenation.</p>', ], ], 'AudioMuxType' => [ 'base' => NULL, 'refs' => [ 'AudioArtifactsConfiguration$MuxType' => '<p>The MUX type of the audio artifact configuration object.</p>', ], ], 'AudioSampleRateOption' => [ 'base' => NULL, 'refs' => [ 'LiveConnectorRTMPConfiguration$AudioSampleRate' => '<p>The audio sample rate set for the RTMP configuration. Default: 48000.</p>', ], ], 'BadRequestException' => [ 'base' => '<p>The input parameters don\\'t match the service\\'s restrictions.</p>', 'refs' => [], ], 'Boolean' => [ 'base' => NULL, 'refs' => [ 'AmazonTranscribeCallAnalyticsProcessorConfiguration$EnablePartialResultsStabilization' => '<p>Enables partial result stabilization for your transcription. Partial result stabilization can reduce latency in your output, but may impact accuracy. For more information, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization\">Partial-result stabilization</a> in the <i>Amazon Transcribe Developer Guide</i>.</p>', 'AmazonTranscribeCallAnalyticsProcessorConfiguration$FilterPartialResults' => '<p>If true, <code>UtteranceEvents</code> with <code>IsPartial: true</code> are filtered out of the insights target.</p>', 'AmazonTranscribeProcessorConfiguration$ShowSpeakerLabel' => '<p>Enables speaker partitioning (diarization) in your transcription output. Speaker partitioning labels the speech from individual speakers in your media file.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/diarization.html\">Partitioning speakers (diarization)</a> in the <i>Amazon Transcribe Developer Guide</i>.</p>', 'AmazonTranscribeProcessorConfiguration$EnablePartialResultsStabilization' => '<p>Enables partial result stabilization for your transcription. Partial result stabilization can reduce latency in your output, but may impact accuracy.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization\">Partial-result stabilization</a> in the <i>Amazon Transcribe Developer Guide</i>.</p>', 'AmazonTranscribeProcessorConfiguration$FilterPartialResults' => '<p>If true, <code>TranscriptEvents</code> with <code>IsPartial: true</code> are filtered out of the insights target.</p>', 'KeywordMatchConfiguration$Negate' => '<p>Matches keywords or phrases on their presence or absence. If set to <code>TRUE</code>, the rule matches when all the specified keywords or phrases are absent. Default: <code>FALSE</code>.</p>', 'RealTimeAlertConfiguration$Disabled' => '<p>Turns off real-time alerts.</p>', ], ], 'CallAnalyticsLanguageCode' => [ 'base' => NULL, 'refs' => [ 'AmazonTranscribeCallAnalyticsProcessorConfiguration$LanguageCode' => '<p>The language code in the configuration.</p>', 'AmazonTranscribeProcessorConfiguration$LanguageCode' => '<p>The language code that represents the language spoken in your audio.</p> <p>If you\\'re unsure of the language spoken in your audio, consider using <code>IdentifyLanguage</code> to enable automatic language identification.</p> <p>For a list of languages that real-time Call Analytics supports, see the <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html\">Supported languages table</a> in the <i>Amazon Transcribe Developer Guide</i>.</p>', ], ], 'CategoryName' => [ 'base' => NULL, 'refs' => [ 'CategoryNameList$member' => NULL, ], ], 'CategoryNameList' => [ 'base' => NULL, 'refs' => [ 'AmazonTranscribeCallAnalyticsProcessorConfiguration$CallAnalyticsStreamCategories' => '<p>By default, all <code>CategoryEvents</code> are sent to the insights target. If this parameter is specified, only included categories are sent to the insights target. </p>', ], ], 'ChannelDefinition' => [ 'base' => '<p>Defines an audio channel in a Kinesis video stream.</p>', 'refs' => [ 'ChannelDefinitions$member' => NULL, ], ], 'ChannelDefinitions' => [ 'base' => NULL, 'refs' => [ 'StreamChannelDefinition$ChannelDefinitions' => '<p>The definitions of the channels in a streaming channel.</p>', ], ], 'ChannelId' => [ 'base' => NULL, 'refs' => [ 'ChannelDefinition$ChannelId' => '<p>The channel ID.</p>', ], ], 'ChimeSdkMeetingConcatenationConfiguration' => [ 'base' => '<p>The configuration object of the Amazon Chime SDK meeting concatenation for a specified media pipeline.</p>', 'refs' => [ 'MediaCapturePipelineSourceConfiguration$ChimeSdkMeetingConfiguration' => '<p>The meeting configuration settings in a media capture pipeline configuration object. </p>', ], ], 'ChimeSdkMeetingConfiguration' => [ 'base' => '<p>The configuration object of the Amazon Chime SDK meeting for a specified media pipeline. <code>SourceType</code> must be <code>ChimeSdkMeeting</code>.</p>', 'refs' => [ 'CreateMediaCapturePipelineRequest$ChimeSdkMeetingConfiguration' => '<p>The configuration for a specified media pipeline. <code>SourceType</code> must be <code>ChimeSdkMeeting</code>.</p>', 'MediaCapturePipeline$ChimeSdkMeetingConfiguration' => '<p>The configuration for a specified media pipeline. <code>SourceType</code> must be <code>ChimeSdkMeeting</code>.</p>', ], ], 'ChimeSdkMeetingLiveConnectorConfiguration' => [ 'base' => '<p>The media pipeline\\'s configuration object.</p>', 'refs' => [ 'LiveConnectorSourceConfiguration$ChimeSdkMeetingLiveConnectorConfiguration' => '<p>The configuration settings of the connector pipeline.</p>', ], ], 'ClientRequestToken' => [ 'base' => NULL, 'refs' => [ 'CreateMediaCapturePipelineRequest$ClientRequestToken' => '<p>The unique identifier for the client request. The token makes the API request idempotent. Use a unique token for each media pipeline request.</p>', 'CreateMediaConcatenationPipelineRequest$ClientRequestToken' => '<p>The unique identifier for the client request. The token makes the API request idempotent. Use a unique token for each media concatenation pipeline request.</p>', 'CreateMediaInsightsPipelineConfigurationRequest$ClientRequestToken' => '<p>The unique identifier for the media insights pipeline configuration request.</p>', 'CreateMediaInsightsPipelineRequest$ClientRequestToken' => '<p>The unique identifier for the media insights pipeline request.</p>', 'CreateMediaLiveConnectorPipelineRequest$ClientRequestToken' => '<p>The token assigned to the client making the request.</p>', ], ], 'CompositedVideoArtifactsConfiguration' => [ 'base' => '<p>Specifies the configuration for compositing video artifacts.</p>', 'refs' => [ 'ArtifactsConfiguration$CompositedVideo' => '<p>Enables video compositing.</p>', 'ChimeSdkMeetingLiveConnectorConfiguration$CompositedVideo' => '<p>The media pipeline\\'s composited video.</p>', ], ], 'CompositedVideoConcatenationConfiguration' => [ 'base' => '<p>The composited video configuration object for a specified media pipeline. <code>SourceType</code> must be <code>ChimeSdkMeeting</code>.</p>', 'refs' => [ 'ArtifactsConcatenationConfiguration$CompositedVideo' => '<p>The configuration for the composited video artifacts concatenation.</p>', ], ], 'ConcatenationSink' => [ 'base' => '<p>The data sink of the configuration object.</p>', 'refs' => [ 'ConcatenationSinkList$member' => NULL, ], ], 'ConcatenationSinkList' => [ 'base' => NULL, 'refs' => [ 'CreateMediaConcatenationPipelineRequest$Sinks' => '<p>An object that specifies the data sinks for the media concatenation pipeline.</p>', 'MediaConcatenationPipeline$Sinks' => '<p>The data sinks of the concatenation pipeline.</p>', ], ], 'ConcatenationSinkType' => [ 'base' => NULL, 'refs' => [ 'ConcatenationSink$Type' => '<p>The type of data sink in the configuration object.</p>', ], ], 'ConcatenationSource' => [ 'base' => '<p>The source type and media pipeline configuration settings in a configuration object.</p>', 'refs' => [ 'ConcatenationSourceList$member' => NULL, ], ], 'ConcatenationSourceList' => [ 'base' => NULL, 'refs' => [ 'CreateMediaConcatenationPipelineRequest$Sources' => '<p>An object that specifies the sources for the media concatenation pipeline.</p>', 'MediaConcatenationPipeline$Sources' => '<p>The data sources being concatenated.</p>', ], ], 'ConcatenationSourceType' => [ 'base' => NULL, 'refs' => [ 'ConcatenationSource$Type' => '<p>The type of concatenation source in a configuration object.</p>', ], ], 'ConflictException' => [ 'base' => '<p>The request could not be processed because of conflict in the current state of the resource.</p>', 'refs' => [], ], 'ContentArtifactsConfiguration' => [ 'base' => '<p>The content artifact object.</p>', 'refs' => [ 'ArtifactsConfiguration$Content' => '<p>The configuration for the content artifacts.</p>', ], ], 'ContentConcatenationConfiguration' => [ 'base' => '<p>The composited content configuration object for a specified media pipeline. </p>', 'refs' => [ 'ArtifactsConcatenationConfiguration$Content' => '<p>The configuration for the content artifacts concatenation.</p>', ], ], 'ContentMuxType' => [ 'base' => NULL, 'refs' => [ 'ContentArtifactsConfiguration$MuxType' => '<p>The MUX type of the artifact configuration.</p>', ], ], 'ContentRedactionOutput' => [ 'base' => NULL, 'refs' => [ 'PostCallAnalyticsSettings$ContentRedactionOutput' => '<p>The content redaction output settings for a post-call analysis task.</p>', ], ], 'ContentShareLayoutOption' => [ 'base' => NULL, 'refs' => [ 'GridViewConfiguration$ContentShareLayout' => '<p>Defines the layout of the video tiles when content sharing is enabled.</p>', ], ], 'ContentType' => [ 'base' => NULL, 'refs' => [ 'AmazonTranscribeCallAnalyticsProcessorConfiguration$ContentIdentificationType' => '<p>Labels all personally identifiable information (PII) identified in your transcript.</p> <p>Content identification is performed at the segment level; PII specified in <code>PiiEntityTypes</code> is flagged upon complete transcription of an audio segment.</p> <p>You can\u00e2\u20ac\u2122t set <code>ContentIdentificationType</code> and <code>ContentRedactionType</code> in the same request. If you do, your request returns a <code>BadRequestException</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html\">Redacting or identifying personally identifiable information</a> in the <i>Amazon Transcribe Developer Guide</i>.</p>', 'AmazonTranscribeCallAnalyticsProcessorConfiguration$ContentRedactionType' => '<p>Redacts all personally identifiable information (PII) identified in your transcript.</p> <p>Content redaction is performed at the segment level; PII specified in <code>PiiEntityTypes</code> is redacted upon complete transcription of an audio segment.</p> <p>You can\u00e2\u20ac\u2122t set <code>ContentRedactionType</code> and <code>ContentIdentificationType</code> in the same request. If you do, your request returns a <code>BadRequestException</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html\">Redacting or identifying personally identifiable information</a> in the <i>Amazon Transcribe Developer Guide</i>.</p>', 'AmazonTranscribeProcessorConfiguration$ContentIdentificationType' => '<p>Labels all personally identifiable information (PII) identified in your transcript.</p> <p>Content identification is performed at the segment level; PII specified in <code>PiiEntityTypes</code> is flagged upon complete transcription of an audio segment.</p> <p>You can\u00e2\u20ac\u2122t set <code>ContentIdentificationType</code> and <code>ContentRedactionType</code> in the same request. If you set both, your request returns a <code>BadRequestException</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html\">Redacting or identifying personally identifiable information</a> in the <i>Amazon Transcribe Developer Guide</i>.</p>', 'AmazonTranscribeProcessorConfiguration$ContentRedactionType' => '<p>Redacts all personally identifiable information (PII) identified in your transcript.</p> <p>Content redaction is performed at the segment level; PII specified in PiiEntityTypes is redacted upon complete transcription of an audio segment.</p> <p>You can\u00e2\u20ac\u2122t set ContentRedactionType and ContentIdentificationType in the same request. If you set both, your request returns a <code>BadRequestException</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html\">Redacting or identifying personally identifiable information</a> in the <i>Amazon Transcribe Developer Guide</i>.</p>', ], ], 'CreateMediaCapturePipelineRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateMediaCapturePipelineResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateMediaConcatenationPipelineRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateMediaConcatenationPipelineResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateMediaInsightsPipelineConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateMediaInsightsPipelineConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateMediaInsightsPipelineRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateMediaInsightsPipelineResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateMediaLiveConnectorPipelineRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateMediaLiveConnectorPipelineResponse' => [ 'base' => NULL, 'refs' => [], ], 'DataChannelConcatenationConfiguration' => [ 'base' => '<p>The content configuration object\\'s data channel.</p>', 'refs' => [ 'ArtifactsConcatenationConfiguration$DataChannel' => '<p>The configuration for the data channel artifacts concatenation.</p>', ], ], 'DeleteMediaCapturePipelineRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteMediaInsightsPipelineConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteMediaPipelineRequest' => [ 'base' => NULL, 'refs' => [], ], 'ErrorCode' => [ 'base' => NULL, 'refs' => [ 'BadRequestException$Code' => NULL, 'ConflictException$Code' => NULL, 'ForbiddenException$Code' => NULL, 'NotFoundException$Code' => NULL, 'ResourceLimitExceededException$Code' => NULL, 'ServiceFailureException$Code' => NULL, 'ServiceUnavailableException$Code' => NULL, 'ThrottledClientException$Code' => NULL, 'UnauthorizedClientException$Code' => NULL, ], ], 'ExternalUserIdList' => [ 'base' => NULL, 'refs' => [ 'SelectedVideoStreams$ExternalUserIds' => '<p>The external user IDs of the streams selected for a media pipeline.</p>', ], ], 'ExternalUserIdType' => [ 'base' => NULL, 'refs' => [ 'ExternalUserIdList$member' => NULL, ], ], 'ForbiddenException' => [ 'base' => '<p>The client is permanently forbidden from making the request.</p>', 'refs' => [], ], 'FragmentNumberString' => [ 'base' => NULL, 'refs' => [ 'StreamConfiguration$FragmentNumber' => '<p>The unique identifier of the fragment to begin processing.</p>', ], ], 'FragmentSelector' => [ 'base' => '<p>Describes the timestamp range and timestamp origin of a range of fragments.</p> <p>Only fragments with a start timestamp greater than or equal to the given start time and less than or equal to the end time are returned. For example, say a stream contains fragments with the following start timestamps:</p> <ul> <li> <p>00:00:00</p> </li> <li> <p>00:00:02</p> </li> <li> <p>00:00:04</p> </li> <li> <p>00:00:06</p> </li> </ul> <p>A fragment selector range with a start time of 00:00:01 and end time of 00:00:04 would return the fragments with start times of 00:00:02 and 00:00:04.</p>', 'refs' => [ 'KinesisVideoStreamRecordingSourceRuntimeConfiguration$FragmentSelector' => '<p>Describes the timestamp range and timestamp origin of a range of fragments in the Kinesis video stream.</p>', ], ], 'FragmentSelectorType' => [ 'base' => NULL, 'refs' => [ 'FragmentSelector$FragmentSelectorType' => '<p>The origin of the timestamps to use, <code>Server</code> or <code>Producer</code>. For more information, see <a href=\"kinesisvideostreams/latest/dg/API_dataplane_StartSelector.html#KinesisVideo-Type-dataplane_StartSelector-StartSelectorType\">StartSelectorType</a> in the <i>Amazon Kinesis Video Streams Developer Guide</i>.</p>', ], ], 'GetMediaCapturePipelineRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetMediaCapturePipelineResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetMediaInsightsPipelineConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetMediaInsightsPipelineConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetMediaPipelineRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetMediaPipelineResponse' => [ 'base' => NULL, 'refs' => [], ], 'GridViewConfiguration' => [ 'base' => '<p>Specifies the type of grid layout.</p>', 'refs' => [ 'CompositedVideoArtifactsConfiguration$GridViewConfiguration' => '<p>The <code>GridView</code> configuration setting.</p>', ], ], 'GuidString' => [ 'base' => NULL, 'refs' => [ 'AttendeeIdList$member' => NULL, 'DeleteMediaCapturePipelineRequest$MediaPipelineId' => '<p>The ID of the media pipeline being deleted. </p>', 'DeleteMediaPipelineRequest$MediaPipelineId' => '<p>The ID of the media pipeline to delete.</p>', 'GetMediaCapturePipelineRequest$MediaPipelineId' => '<p>The ID of the pipeline that you want to get.</p>', 'GetMediaPipelineRequest$MediaPipelineId' => '<p>The ID of the pipeline that you want to get.</p>', 'MediaCapturePipeline$MediaPipelineId' => '<p>The ID of a media pipeline.</p>', 'MediaCapturePipelineSummary$MediaPipelineId' => '<p>The ID of the media pipeline in the summary.</p>', 'MediaConcatenationPipeline$MediaPipelineId' => '<p>The ID of the media pipeline being concatenated.</p>', 'MediaInsightsPipeline$MediaPipelineId' => '<p>The ID of a media insights pipeline.</p>', 'MediaInsightsPipelineConfiguration$MediaInsightsPipelineConfigurationId' => '<p>The ID of the configuration.</p>', 'MediaInsightsPipelineConfigurationSummary$MediaInsightsPipelineConfigurationId' => '<p>The ID of the media insights pipeline configuration.</p>', 'MediaLiveConnectorPipeline$MediaPipelineId' => '<p>The connector pipeline\\'s ID.</p>', 'MediaPipelineSummary$MediaPipelineId' => '<p>The ID of the media pipeline in the summary.</p>', ], ], 'Iso8601Timestamp' => [ 'base' => NULL, 'refs' => [ 'MediaCapturePipeline$CreatedTimestamp' => '<p>The time at which the pipeline was created, in ISO 8601 format.</p>', 'MediaCapturePipeline$UpdatedTimestamp' => '<p>The time at which the pipeline was updated, in ISO 8601 format.</p>', 'MediaConcatenationPipeline$CreatedTimestamp' => '<p>The time at which the concatenation pipeline was created.</p>', 'MediaConcatenationPipeline$UpdatedTimestamp' => '<p>The time at which the concatenation pipeline was last updated.</p>', 'MediaInsightsPipeline$CreatedTimestamp' => '<p>The time at which the media insights pipeline was created.</p>', 'MediaInsightsPipelineConfiguration$CreatedTimestamp' => '<p>The time at which the configuration was created.</p>', 'MediaInsightsPipelineConfiguration$UpdatedTimestamp' => '<p>The time at which the configuration was last updated.</p>', 'MediaLiveConnectorPipeline$CreatedTimestamp' => '<p>The time at which the connector pipeline was created.</p>', 'MediaLiveConnectorPipeline$UpdatedTimestamp' => '<p>The time at which the connector pipeline was last updated.</p>', ], ], 'IssueDetectionConfiguration' => [ 'base' => '<p>A structure that contains the configuration settings for an issue detection task.</p>', 'refs' => [ 'RealTimeAlertRule$IssueDetectionConfiguration' => '<p>Specifies the issue detection settings for a real-time alert rule.</p>', ], ], 'Keyword' => [ 'base' => NULL, 'refs' => [ 'KeywordMatchWordList$member' => NULL, ], ], 'KeywordMatchConfiguration' => [ 'base' => '<p>A structure that contains the settings for a keyword match task.</p>', 'refs' => [ 'RealTimeAlertRule$KeywordMatchConfiguration' => '<p>Specifies the settings for matching the keywords in a real-time alert rule.</p>', ], ], 'KeywordMatchWordList' => [ 'base' => NULL, 'refs' => [ 'KeywordMatchConfiguration$Keywords' => '<p>The keywords or phrases that you want to match.</p>', ], ], 'KinesisDataStreamSinkConfiguration' => [ 'base' => '<p>A structure that contains the configuration settings for a Kinesis Data Stream sink.</p>', 'refs' => [ 'MediaInsightsPipelineConfigurationElement$KinesisDataStreamSinkConfiguration' => '<p>The configuration settings for the Kinesis Data Stream Sink in a media insights pipeline configuration element.</p>', ], ], 'KinesisVideoStreamArn' => [ 'base' => NULL, 'refs' => [ 'RecordingStreamConfiguration$StreamArn' => '<p>The ARN of the recording stream.</p>', 'StreamConfiguration$StreamArn' => '<p>The ARN of the stream.</p>', ], ], 'KinesisVideoStreamRecordingSourceRuntimeConfiguration' => [ 'base' => '<p>A structure that contains the runtime settings for recording a Kinesis video stream.</p>', 'refs' => [ 'CreateMediaInsightsPipelineRequest$KinesisVideoStreamRecordingSourceRuntimeConfiguration' => '<p>The runtime configuration for the Kinesis video recording stream source.</p>', 'MediaInsightsPipeline$KinesisVideoStreamRecordingSourceRuntimeConfiguration' => '<p>The runtime configuration settings for a Kinesis recording video stream in a media insights pipeline.</p>', ], ], 'KinesisVideoStreamSourceRuntimeConfiguration' => [ 'base' => '<p>The runtime configuration settings for the Kinesis video stream source.</p>', 'refs' => [ 'CreateMediaInsightsPipelineRequest$KinesisVideoStreamSourceRuntimeConfiguration' => '<p>The runtime configuration for the Kinesis video stream source of the media insights pipeline.</p>', 'MediaInsightsPipeline$KinesisVideoStreamSourceRuntimeConfiguration' => '<p>The configuration settings for a Kinesis runtime video stream in a media insights pipeline.</p>', ], ], 'LambdaFunctionSinkConfiguration' => [ 'base' => '<p>A structure that contains the configuration settings for an AWS Lambda function\\'s data sink.</p>', 'refs' => [ 'MediaInsightsPipelineConfigurationElement$LambdaFunctionSinkConfiguration' => '<p>The configuration settings for the Amazon Web Services Lambda sink in a media insights pipeline configuration element.</p>', ], ], 'LayoutOption' => [ 'base' => NULL, 'refs' => [ 'CompositedVideoArtifactsConfiguration$Layout' => '<p>The layout setting, such as <code>GridView</code> in the configuration object.</p>', ], ], 'ListMediaCapturePipelinesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListMediaCapturePipelinesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListMediaInsightsPipelineConfigurationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListMediaInsightsPipelineConfigurationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListMediaPipelinesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListMediaPipelinesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'LiveConnectorMuxType' => [ 'base' => NULL, 'refs' => [ 'ChimeSdkMeetingLiveConnectorConfiguration$MuxType' => '<p>The configuration object\\'s multiplex type.</p>', ], ], 'LiveConnectorRTMPConfiguration' => [ 'base' => '<p>The media pipeline\\'s RTMP configuration object.</p>', 'refs' => [ 'LiveConnectorSinkConfiguration$RTMPConfiguration' => '<p>The sink configuration\\'s RTMP configuration settings.</p>', ], ], 'LiveConnectorSinkConfiguration' => [ 'base' => '<p>The media pipeline\\'s sink configuration settings.</p>', 'refs' => [ 'LiveConnectorSinkList$member' => NULL, ], ], 'LiveConnectorSinkList' => [ 'base' => NULL, 'refs' => [ 'CreateMediaLiveConnectorPipelineRequest$Sinks' => '<p>The media live connector pipeline\\'s data sinks.</p>', 'MediaLiveConnectorPipeline$Sinks' => '<p>The connector pipeline\\'s data sinks.</p>', ], ], 'LiveConnectorSinkType' => [ 'base' => NULL, 'refs' => [ 'LiveConnectorSinkConfiguration$SinkType' => '<p>The sink configuration\\'s sink type.</p>', ], ], 'LiveConnectorSourceConfiguration' => [ 'base' => '<p>The data source configuration object of a streaming media pipeline.</p>', 'refs' => [ 'LiveConnectorSourceList$member' => NULL, ], ], 'LiveConnectorSourceList' => [ 'base' => NULL, 'refs' => [ 'CreateMediaLiveConnectorPipelineRequest$Sources' => '<p>The media live connector pipeline\\'s data sources.</p>', 'MediaLiveConnectorPipeline$Sources' => '<p>The connector pipeline\\'s data sources.</p>', ], ], 'LiveConnectorSourceType' => [ 'base' => NULL, 'refs' => [ 'LiveConnectorSourceConfiguration$SourceType' => '<p>The source configuration\\'s media source type.</p>', ], ], 'MediaCapturePipeline' => [ 'base' => '<p>A media pipeline object consisting of an ID, source type, source ARN, a sink type, a sink ARN, and a configuration object.</p>', 'refs' => [ 'CreateMediaCapturePipelineResponse$MediaCapturePipeline' => '<p>A media pipeline object, the ID, source type, source ARN, sink type, and sink ARN of a media pipeline object.</p>', 'GetMediaCapturePipelineResponse$MediaCapturePipeline' => '<p>The media pipeline object.</p>', 'MediaPipeline$MediaCapturePipeline' => '<p>A pipeline that enables users to capture audio and video.</p>', ], ], 'MediaCapturePipelineSourceConfiguration' => [ 'base' => '<p>The source configuration object of a media capture pipeline.</p>', 'refs' => [ 'ConcatenationSource$MediaCapturePipelineSourceConfiguration' => '<p>The concatenation settings for the media pipeline in a configuration object.</p>', ], ], 'MediaCapturePipelineSummary' => [ 'base' => '<p>The summary data of a media capture pipeline.</p>', 'refs' => [ 'MediaCapturePipelineSummaryList$member' => NULL, ], ], 'MediaCapturePipelineSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListMediaCapturePipelinesResponse$MediaCapturePipelines' => '<p>The media pipeline objects in the list.</p>', ], ], 'MediaConcatenationPipeline' => [ 'base' => '<p>Concatenates audio and video data from one or more data streams.</p>', 'refs' => [ 'CreateMediaConcatenationPipelineResponse$MediaConcatenationPipeline' => '<p>A media concatenation pipeline object, the ID, source type, <code>MediaPipelineARN</code>, and sink of a media concatenation pipeline object.</p>', 'MediaPipeline$MediaConcatenationPipeline' => '<p>The media concatenation pipeline in a media pipeline.</p>', ], ], 'MediaEncoding' => [ 'base' => NULL, 'refs' => [ 'KinesisVideoStreamSourceRuntimeConfiguration$MediaEncoding' => '<p>Specifies the encoding of your input audio. Supported format: PCM (only signed 16-bit little-endian audio formats, which does not include WAV)</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio\">Media formats</a> in the <i>Amazon Transcribe Developer Guide</i>.</p>', ], ], 'MediaInsightsPipeline' => [ 'base' => '<p>A media pipeline that streams call analytics data.</p>', 'refs' => [ 'CreateMediaInsightsPipelineResponse$MediaInsightsPipeline' => '<p>The media insights pipeline object.</p>', 'MediaPipeline$MediaInsightsPipeline' => '<p>The media insights pipeline of a media pipeline.</p>', ], ], 'MediaInsightsPipelineConfiguration' => [ 'base' => '<p>A structure that contains the configuration settings for a media insights pipeline.</p>', 'refs' => [ 'CreateMediaInsightsPipelineConfigurationResponse$MediaInsightsPipelineConfiguration' => '<p>The configuration settings for the media insights pipeline.</p>', 'GetMediaInsightsPipelineConfigurationResponse$MediaInsightsPipelineConfiguration' => '<p>The requested media insights pipeline configuration.</p>', 'UpdateMediaInsightsPipelineConfigurationResponse$MediaInsightsPipelineConfiguration' => '<p>The updated configuration settings.</p>', ], ], 'MediaInsightsPipelineConfigurationElement' => [ 'base' => '<p>An element in a media insights pipeline configuration.</p>', 'refs' => [ 'MediaInsightsPipelineConfigurationElements$member' => NULL, ], ], 'MediaInsightsPipelineConfigurationElementType' => [ 'base' => NULL, 'refs' => [ 'MediaInsightsPipelineConfigurationElement$Type' => '<p>The element type.</p>', ], ], 'MediaInsightsPipelineConfigurationElements' => [ 'base' => NULL, 'refs' => [ 'CreateMediaInsightsPipelineConfigurationRequest$Elements' => '<p>The elements in the request, such as a processor for Amazon Transcribe or a sink for a Kinesis Data Stream.</p>', 'MediaInsightsPipelineConfiguration$Elements' => '<p>The elements in the configuration.</p>', 'UpdateMediaInsightsPipelineConfigurationRequest$Elements' => '<p>The elements in the request, such as a processor for Amazon Transcribe or a sink for a Kinesis Data Stream..</p>', ], ], 'MediaInsightsPipelineConfigurationNameString' => [ 'base' => NULL, 'refs' => [ 'CreateMediaInsightsPipelineConfigurationRequest$MediaInsightsPipelineConfigurationName' => '<p>The name of the media insights pipeline configuration.</p>', 'MediaInsightsPipelineConfiguration$MediaInsightsPipelineConfigurationName' => '<p>The name of the configuration.</p>', 'MediaInsightsPipelineConfigurationSummary$MediaInsightsPipelineConfigurationName' => '<p>The name of the media insights pipeline configuration.</p>', ], ], 'MediaInsightsPipelineConfigurationSummary' => [ 'base' => '<p>A summary of the media insights pipeline configuration.</p>', 'refs' => [ 'MediaInsightsPipelineConfigurationSummaryList$member' => NULL, ], ], 'MediaInsightsPipelineConfigurationSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListMediaInsightsPipelineConfigurationsResponse$MediaInsightsPipelineConfigurations' => '<p>The requested list of media insights pipeline configurations.</p>', ], ], 'MediaInsightsRuntimeMetadata' => [ 'base' => NULL, 'refs' => [ 'CreateMediaInsightsPipelineRequest$MediaInsightsRuntimeMetadata' => '<p>The runtime metadata for the media insights pipeline. Consists of a key-value map of strings.</p>', 'MediaInsightsPipeline$MediaInsightsRuntimeMetadata' => '<p>The runtime metadata of a media insights pipeline.</p>', ], ], 'MediaLiveConnectorPipeline' => [ 'base' => '<p>The connector pipeline.</p>', 'refs' => [ 'CreateMediaLiveConnectorPipelineResponse$MediaLiveConnectorPipeline' => '<p>The new media live connector pipeline.</p>', 'MediaPipeline$MediaLiveConnectorPipeline' => '<p>The connector pipeline of the media pipeline.</p>', ], ], 'MediaPipeline' => [ 'base' => '<p>A pipeline consisting of a media capture, media concatenation, or live-streaming pipeline.</p>', 'refs' => [ 'GetMediaPipelineResponse$MediaPipeline' => '<p>The media pipeline object.</p>', ], ], 'MediaPipelineList' => [ 'base' => NULL, 'refs' => [ 'ListMediaPipelinesResponse$MediaPipelines' => '<p>The media pipeline objects in the list.</p>', ], ], 'MediaPipelineSinkType' => [ 'base' => NULL, 'refs' => [ 'CreateMediaCapturePipelineRequest$SinkType' => '<p>Destination type to which the media artifacts are saved. You must use an S3 bucket.</p>', 'MediaCapturePipeline$SinkType' => '<p>Destination type to which the media artifacts are saved. You must use an S3 Bucket.</p>', ], ], 'MediaPipelineSourceType' => [ 'base' => NULL, 'refs' => [ 'CreateMediaCapturePipelineRequest$SourceType' => '<p>Source type from which the media artifacts are captured. A Chime SDK Meeting is the only supported source.</p>', 'MediaCapturePipeline$SourceType' => '<p>Source type from which media artifacts are saved. You must use <code>ChimeMeeting</code>.</p>', ], ], 'MediaPipelineStatus' => [ 'base' => NULL, 'refs' => [ 'MediaCapturePipeline$Status' => '<p>The status of the media pipeline.</p>', 'MediaConcatenationPipeline$Status' => '<p>The status of the concatenation pipeline.</p>', 'MediaInsightsPipeline$Status' => '<p>The status of a media insights pipeline.</p>', 'MediaLiveConnectorPipeline$Status' => '<p>The connector pipeline\\'s status.</p>', ], ], 'MediaPipelineStatusUpdate' => [ 'base' => NULL, 'refs' => [ 'UpdateMediaInsightsPipelineStatusRequest$UpdateStatus' => '<p>The requested status of the media insights pipeline.</p>', ], ], 'MediaPipelineSummary' => [ 'base' => '<p>The summary of the media pipeline.</p>', 'refs' => [ 'MediaPipelineList$member' => NULL, ], ], 'MediaSampleRateHertz' => [ 'base' => NULL, 'refs' => [ 'KinesisVideoStreamSourceRuntimeConfiguration$MediaSampleRate' => '<p>The sample rate of the input audio (in hertz). Low-quality audio, such as telephone audio, is typically around 8,000 Hz. High-quality audio typically ranges from 16,000 Hz to 48,000 Hz. Note that the sample rate you specify must match that of your audio.</p> <p>Valid Range: Minimum value of 8000. Maximum value of 48000.</p>', ], ], 'MeetingEventsConcatenationConfiguration' => [ 'base' => '<p>The configuration object for an event concatenation pipeline.</p>', 'refs' => [ 'ArtifactsConcatenationConfiguration$MeetingEvents' => '<p>The configuration for the meeting events artifacts concatenation.</p>', ], ], 'ModelName' => [ 'base' => NULL, 'refs' => [ 'AmazonTranscribeCallAnalyticsProcessorConfiguration$LanguageModelName' => '<p>Specifies the name of the custom language model to use when processing a transcription. Note that language model names are case sensitive.</p> <p>The language of the specified language model must match the language code specified in the transcription request. If the languages don\\'t match, the custom language model isn\\'t applied. Language mismatches don\\'t generate errors or warnings.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/custom-language-models.html\">Custom language models</a> in the <i>Amazon Transcribe Developer Guide</i>.</p>', 'AmazonTranscribeProcessorConfiguration$LanguageModelName' => '<p>The name of the custom language model that you want to use when processing your transcription. Note that language model names are case sensitive.</p> <p>The language of the specified language model must match the language code you specify in your transcription request. If the languages don\\'t match, the custom language model isn\\'t applied. There are no errors or warnings associated with a language mismatch.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/custom-language-models.html\">Custom language models</a> in the <i>Amazon Transcribe Developer Guide</i>.</p>', ], ], 'NonEmptyString' => [ 'base' => NULL, 'refs' => [ 'DeleteMediaInsightsPipelineConfigurationRequest$Identifier' => '<p>The unique identifier of the resource to be deleted. Valid values include the name and ARN of the media insights pipeline configuration.</p>', 'GetMediaInsightsPipelineConfigurationRequest$Identifier' => '<p>The unique identifier of the requested resource. Valid values include the name and ARN of the media insights pipeline configuration.</p>', 'MediaInsightsRuntimeMetadata$key' => NULL, 'UpdateMediaInsightsPipelineConfigurationRequest$Identifier' => '<p>The unique identifier for the resource to be updated. Valid values include the name and ARN of the media insights pipeline configuration.</p>', 'UpdateMediaInsightsPipelineStatusRequest$Identifier' => '<p>The unique identifier of the resource to be updated. Valid values include the ID and ARN of the media insights pipeline.</p>', ], ], 'NotFoundException' => [ 'base' => '<p>One or more of the resources in the request does not exist in the system.</p>', 'refs' => [], ], 'NumberOfChannels' => [ 'base' => NULL, 'refs' => [ 'StreamChannelDefinition$NumberOfChannels' => '<p>The number of channels in a streaming channel.</p>', ], ], 'PartialResultsStability' => [ 'base' => NULL, 'refs' => [ 'AmazonTranscribeCallAnalyticsProcessorConfiguration$PartialResultsStability' => '<p>Specifies the level of stability to use when you enable partial results stabilization (<code>EnablePartialResultsStabilization</code>).</p> <p>Low stability provides the highest accuracy. High stability transcribes faster, but with slightly lower accuracy.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization\">Partial-result stabilization</a> in the <i>Amazon Transcribe Developer Guide</i>.</p>', 'AmazonTranscribeProcessorConfiguration$PartialResultsStability' => '<p>The level of stability to use when you enable partial results stabilization (<code>EnablePartialResultsStabilization</code>).</p> <p>Low stability provides the highest accuracy. High stability transcribes faster, but with slightly lower accuracy.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization\">Partial-result stabilization</a> in the <i>Amazon Transcribe Developer Guide</i>.</p>', ], ], 'ParticipantRole' => [ 'base' => NULL, 'refs' => [ 'ChannelDefinition$ParticipantRole' => '<p>Specifies whether the audio in a channel belongs to the <code>AGENT</code> or <code>CUSTOMER</code>.</p>', ], ], 'PiiEntityTypes' => [ 'base' => NULL, 'refs' => [ 'AmazonTranscribeCallAnalyticsProcessorConfiguration$PiiEntityTypes' => '<p>Specifies the types of personally identifiable information (PII) to redact from a transcript. You can include as many types as you\\'d like, or you can select <code>ALL</code>.</p> <p>To include <code>PiiEntityTypes</code> in your Call Analytics request, you must also include <code>ContentIdentificationType</code> or <code>ContentRedactionType</code>, but you can\\'t include both. </p> <p>Values must be comma-separated and can include: <code>ADDRESS</code>, <code>BANK_ACCOUNT_NUMBER</code>, <code>BANK_ROUTING</code>, <code>CREDIT_DEBIT_CVV</code>, <code>CREDIT_DEBIT_EXPIRY</code>, <code>CREDIT_DEBIT_NUMBER</code>, <code>EMAIL</code>, <code>NAME</code>, <code>PHONE</code>, <code>PIN</code>, <code>SSN</code>, or <code>ALL</code>.</p> <p>Length Constraints: Minimum length of 1. Maximum length of 300.</p>', 'AmazonTranscribeProcessorConfiguration$PiiEntityTypes' => '<p>The types of personally identifiable information (PII) to redact from a transcript. You can include as many types as you\\'d like, or you can select <code>ALL</code>.</p> <p>To include <code>PiiEntityTypes</code> in your Call Analytics request, you must also include <code>ContentIdentificationType</code> or <code>ContentRedactionType</code>, but you can\\'t include both.</p> <p>Values must be comma-separated and can include: <code>ADDRESS</code>, <code>BANK_ACCOUNT_NUMBER</code>, <code>BANK_ROUTING</code>, <code>CREDIT_DEBIT_CVV</code>, <code>CREDIT_DEBIT_EXPIRY</code>, <code>CREDIT_DEBIT_NUMBER</code>, <code>EMAIL</code>, <code>NAME</code>, <code>PHONE</code>, <code>PIN</code>, <code>SSN</code>, or <code>ALL</code>.</p> <p>If you leave this parameter empty, the default behavior is equivalent to <code>ALL</code>.</p>', ], ], 'PostCallAnalyticsSettings' => [ 'base' => '<p>Allows you to specify additional settings for your Call Analytics post-call request, including output locations for your redacted transcript, which IAM role to use, and which encryption key to use.</p> <p> <code>DataAccessRoleArn</code> and <code>OutputLocation</code> are required fields.</p> <p> <code>PostCallAnalyticsSettings</code> provides the same insights as a Call Analytics post-call transcription. For more information, refer to <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/tca-post-call.html\">Post-call analytics with real-time transcriptions</a> in the <i>Amazon Transcribe Developer Guide</i>.</p>', 'refs' => [ 'AmazonTranscribeCallAnalyticsProcessorConfiguration$PostCallAnalyticsSettings' => '<p>The settings for a post-call analysis task in an analytics configuration.</p>', ], ], 'PresenterOnlyConfiguration' => [ 'base' => '<p>Defines the configuration for a presenter-only video tile.</p>', 'refs' => [ 'GridViewConfiguration$PresenterOnlyConfiguration' => '<p>Defines the configuration options for a presenter only video tile.</p>', ], ], 'PresenterPosition' => [ 'base' => NULL, 'refs' => [ 'PresenterOnlyConfiguration$PresenterPosition' => '<p>Defines the position of the presenter video tile. Default: <code>TopRight</code>.</p>', ], ], 'RealTimeAlertConfiguration' => [ 'base' => '<p>A structure that contains the configuration settings for real-time alerts.</p>', 'refs' => [ 'CreateMediaInsightsPipelineConfigurationRequest$RealTimeAlertConfiguration' => '<p>The configuration settings for the real-time alerts in a media insights pipeline configuration.</p>', 'MediaInsightsPipelineConfiguration$RealTimeAlertConfiguration' => '<p>Lists the rules that trigger a real-time alert.</p>', 'UpdateMediaInsightsPipelineConfigurationRequest$RealTimeAlertConfiguration' => '<p>The configuration settings for real-time alerts for the media insights pipeline.</p>', ], ], 'RealTimeAlertRule' => [ 'base' => '<p>Specifies the words or phrases that trigger an alert.</p>', 'refs' => [ 'RealTimeAlertRuleList$member' => NULL, ], ], 'RealTimeAlertRuleList' => [ 'base' => NULL, 'refs' => [ 'RealTimeAlertConfiguration$Rules' => '<p>The rules in the alert. Rules specify the words or phrases that you want to be notified about.</p>', ], ], 'RealTimeAlertRuleType' => [ 'base' => NULL, 'refs' => [ 'RealTimeAlertRule$Type' => '<p>The type of alert rule.</p>', ], ], 'RecordingFileFormat' => [ 'base' => NULL, 'refs' => [ 'S3RecordingSinkConfiguration$RecordingFileFormat' => '<p>The default file format for the media files sent to the Amazon S3 bucket.</p>', 'S3RecordingSinkRuntimeConfiguration$RecordingFileFormat' => '<p>The file format for the media files sent to the Amazon S3 bucket.</p>', ], ], 'RecordingStreamConfiguration' => [ 'base' => '<p>A structure that holds the settings for recording media.</p>', 'refs' => [ 'RecordingStreamList$member' => NULL, ], ], 'RecordingStreamList' => [ 'base' => NULL, 'refs' => [ 'KinesisVideoStreamRecordingSourceRuntimeConfiguration$Streams' => '<p>The stream or streams to be recorded.</p>', ], ], 'ResolutionOption' => [ 'base' => NULL, 'refs' => [ 'CompositedVideoArtifactsConfiguration$Resolution' => '<p>The video resolution setting in the configuration object. Default: HD at 1280 x 720. FHD resolution: 1920 x 1080.</p>', ], ], 'ResourceLimitExceededException' => [ 'base' => '<p>The request exceeds the resource limit.</p>', 'refs' => [], ], 'ResultMax' => [ 'base' => NULL, 'refs' => [ 'ListMediaCapturePipelinesRequest$MaxResults' => '<p>The maximum number of results to return in a single call. Valid Range: 1 - 99.</p>', 'ListMediaInsightsPipelineConfigurationsRequest$MaxResults' => '<p>The maximum number of results to return in a single call.</p>', 'ListMediaPipelinesRequest$MaxResults' => '<p>The maximum number of results to return in a single call. Valid Range: 1 - 99.</p>', ], ], 'RuleName' => [ 'base' => NULL, 'refs' => [ 'IssueDetectionConfiguration$RuleName' => '<p>The name of the issue detection rule.</p>', 'KeywordMatchConfiguration$RuleName' => '<p>The name of the keyword match rule.</p>', 'SentimentConfiguration$RuleName' => '<p>The name of the rule in the sentiment configuration.</p>', ], ], 'S3BucketSinkConfiguration' => [ 'base' => '<p>The configuration settings for the S3 bucket.</p>', 'refs' => [ 'ConcatenationSink$S3BucketSinkConfiguration' => '<p>The configuration settings for an Amazon S3 bucket sink.</p>', ], ], 'S3RecordingSinkConfiguration' => [ 'base' => '<p>The structure that holds the settings for transmitting media to the Amazon S3 bucket. These values are used as defaults if <code>S3RecordingSinkRuntimeConfiguration</code> is not specified.</p>', 'refs' => [ 'MediaInsightsPipelineConfigurationElement$S3RecordingSinkConfiguration' => '<p>The configuration settings for the Amazon S3 recording bucket in a media insights pipeline configuration element.</p>', ], ], 'S3RecordingSinkRuntimeConfiguration' => [ 'base' => '<p>A structure that holds the settings for transmitting media files to the Amazon S3 bucket. If specified, the settings in this structure override any settings in <code>S3RecordingSinkConfiguration</code>.</p>', 'refs' => [ 'CreateMediaInsightsPipelineRequest$S3RecordingSinkRuntimeConfiguration' => '<p>The runtime configuration for the S3 recording sink.</p>', 'MediaInsightsPipeline$S3RecordingSinkRuntimeConfiguration' => '<p>The runtime configuration of the Amazon S3 bucket that stores recordings in a media insights pipeline.</p>', ], ], 'SelectedVideoStreams' => [ 'base' => '<p>The video streams for a specified media pipeline. The total number of video streams can\\'t exceed 25.</p>', 'refs' => [ 'SourceConfiguration$SelectedVideoStreams' => '<p>The selected video streams for a specified media pipeline. The number of video streams can\\'t exceed 25.</p>', ], ], 'SensitiveString' => [ 'base' => NULL, 'refs' => [ 'LiveConnectorRTMPConfiguration$Url' => '<p>The URL of the RTMP configuration.</p>', ], ], 'SentimentConfiguration' => [ 'base' => '<p>A structure that contains the configuration settings for a sentiment analysis task.</p>', 'refs' => [ 'RealTimeAlertRule$SentimentConfiguration' => '<p>Specifies the settings for predicting sentiment in a real-time alert rule.</p>', ], ], 'SentimentTimePeriodInSeconds' => [ 'base' => NULL, 'refs' => [ 'SentimentConfiguration$TimePeriod' => '<p>Specifies the analysis interval.</p>', ], ], 'SentimentType' => [ 'base' => NULL, 'refs' => [ 'SentimentConfiguration$SentimentType' => '<p>The type of sentiment, <code>POSITIVE</code>, <code>NEGATIVE</code>, or <code>NEUTRAL</code>.</p>', ], ], 'ServiceFailureException' => [ 'base' => '<p>The service encountered an unexpected error.</p>', 'refs' => [], ], 'ServiceUnavailableException' => [ 'base' => '<p>The service is currently unavailable.</p>', 'refs' => [], ], 'SnsTopicSinkConfiguration' => [ 'base' => '<p>The configuration settings for the SNS topic sink.</p>', 'refs' => [ 'MediaInsightsPipelineConfigurationElement$SnsTopicSinkConfiguration' => '<p>The configuration settings for an SNS topic sink in a media insights pipeline configuration element.</p>', ], ], 'SourceConfiguration' => [ 'base' => '<p>Source configuration for a specified media pipeline.</p>', 'refs' => [ 'ChimeSdkMeetingConfiguration$SourceConfiguration' => '<p>The source configuration for a specified media pipeline.</p>', 'ChimeSdkMeetingLiveConnectorConfiguration$SourceConfiguration' => '<p>The source configuration settings of the media pipeline\\'s configuration object.</p>', ], ], 'SqsQueueSinkConfiguration' => [ 'base' => '<p>The configuration settings for the SQS sink.</p>', 'refs' => [ 'MediaInsightsPipelineConfigurationElement$SqsQueueSinkConfiguration' => '<p>The configuration settings for an SQS queue sink in a media insights pipeline configuration element.</p>', ], ], 'StreamChannelDefinition' => [ 'base' => '<p>Defines a streaming channel.</p>', 'refs' => [ 'StreamConfiguration$StreamChannelDefinition' => '<p>The streaming channel definition in the stream configuration.</p>', ], ], 'StreamConfiguration' => [ 'base' => '<p>The configuration settings for a stream.</p>', 'refs' => [ 'Streams$member' => NULL, ], ], 'Streams' => [ 'base' => NULL, 'refs' => [ 'KinesisVideoStreamSourceRuntimeConfiguration$Streams' => '<p>The streams in the source runtime configuration of a Kinesis video stream.</p>', ], ], 'String' => [ 'base' => NULL, 'refs' => [ 'BadRequestException$Message' => NULL, 'BadRequestException$RequestId' => '<p>The request ID associated with the call responsible for the exception.</p>', 'ConflictException$Message' => NULL, 'ConflictException$RequestId' => '<p>The request ID associated with the call responsible for the exception.</p>', 'ForbiddenException$Message' => NULL, 'ForbiddenException$RequestId' => '<p>The request id associated with the call responsible for the exception.</p>', 'ListMediaCapturePipelinesRequest$NextToken' => '<p>The token used to retrieve the next page of results.</p>', 'ListMediaCapturePipelinesResponse$NextToken' => '<p>The token used to retrieve the next page of results. </p>', 'ListMediaInsightsPipelineConfigurationsRequest$NextToken' => '<p>The token used to return the next page of results.</p>', 'ListMediaInsightsPipelineConfigurationsResponse$NextToken' => '<p>The token used to return the next page of results. </p>', 'ListMediaPipelinesRequest$NextToken' => '<p>The token used to retrieve the next page of results.</p>', 'ListMediaPipelinesResponse$NextToken' => '<p>The token used to retrieve the next page of results. </p>', 'MediaInsightsRuntimeMetadata$value' => NULL, 'NotFoundException$Message' => NULL, 'NotFoundException$RequestId' => '<p>The request ID associated with the call responsible for the exception.</p>', 'PostCallAnalyticsSettings$OutputLocation' => '<p>The URL of the Amazon S3 bucket that contains the post-call data.</p>', 'PostCallAnalyticsSettings$DataAccessRoleArn' => '<p>The ARN of the role used by Amazon Web Services Transcribe to upload your post call analysis. For more information, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/tca-post-call.html\">Post-call analytics with real-time transcriptions</a> in the <i>Amazon Transcribe Developer Guide</i>.</p>', 'PostCallAnalyticsSettings$OutputEncryptionKMSKeyId' => '<p>The ID of the KMS (Key Management Service) key used to encrypt the output.</p>', 'ResourceLimitExceededException$Message' => NULL, 'ResourceLimitExceededException$RequestId' => '<p>The request ID associated with the call responsible for the exception.</p>', 'ServiceFailureException$Message' => NULL, 'ServiceFailureException$RequestId' => '<p>The request ID associated with the call responsible for the exception.</p>', 'ServiceUnavailableException$Message' => NULL, 'ServiceUnavailableException$RequestId' => '<p>The request ID associated with the call responsible for the exception.</p>', 'ThrottledClientException$Message' => NULL, 'ThrottledClientException$RequestId' => '<p>The request ID associated with the call responsible for the exception.</p>', 'UnauthorizedClientException$Message' => NULL, 'UnauthorizedClientException$RequestId' => '<p>The request ID associated with the call responsible for the exception.</p>', ], ], 'Tag' => [ 'base' => '<p>A key/value pair that grants users access to meeting resources.</p>', 'refs' => [ 'TagList$member' => NULL, ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'Tag$Key' => '<p>The key half of a tag.</p>', 'TagKeyList$member' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$TagKeys' => '<p>The key/value pairs in the tag that you want to remove.</p>', ], ], 'TagList' => [ 'base' => NULL, 'refs' => [ 'CreateMediaCapturePipelineRequest$Tags' => '<p>The tag key-value pairs.</p>', 'CreateMediaConcatenationPipelineRequest$Tags' => '<p>The tags associated with the media concatenation pipeline.</p>', 'CreateMediaInsightsPipelineConfigurationRequest$Tags' => '<p>The tags assigned to the media insights pipeline configuration.</p>', 'CreateMediaInsightsPipelineRequest$Tags' => '<p>The tags assigned to the media insights pipeline.</p>', 'CreateMediaLiveConnectorPipelineRequest$Tags' => '<p>The tags associated with the media live connector pipeline.</p>', 'ListTagsForResourceResponse$Tags' => '<p>The tags associated with the specified media pipeline.</p>', 'TagResourceRequest$Tags' => '<p>The tags associated with the specified media pipeline.</p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'Tag$Value' => '<p>The value half of a tag.</p>', ], ], 'ThrottledClientException' => [ 'base' => '<p>The client exceeded its request rate limit.</p>', 'refs' => [], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [ 'TimestampRange$StartTimestamp' => '<p>The starting timestamp for the specified range.</p>', 'TimestampRange$EndTimestamp' => '<p>The ending timestamp for the specified range.</p>', ], ], 'TimestampRange' => [ 'base' => '<p>The range of timestamps to return.</p>', 'refs' => [ 'FragmentSelector$TimestampRange' => '<p>The range of timestamps to return.</p>', ], ], 'TranscriptionMessagesConcatenationConfiguration' => [ 'base' => '<p>The configuration object for concatenating transcription messages.</p>', 'refs' => [ 'ArtifactsConcatenationConfiguration$TranscriptionMessages' => '<p>The configuration for the transcription messages artifacts concatenation.</p>', ], ], 'UnauthorizedClientException' => [ 'base' => '<p>The client is not currently authorized to make the request.</p>', 'refs' => [], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateMediaInsightsPipelineConfigurationRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateMediaInsightsPipelineConfigurationResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateMediaInsightsPipelineStatusRequest' => [ 'base' => NULL, 'refs' => [], ], 'VideoArtifactsConfiguration' => [ 'base' => '<p>The video artifact configuration object.</p>', 'refs' => [ 'ArtifactsConfiguration$Video' => '<p>The configuration for the video artifacts.</p>', ], ], 'VideoConcatenationConfiguration' => [ 'base' => '<p>The configuration object of a video concatenation pipeline.</p>', 'refs' => [ 'ArtifactsConcatenationConfiguration$Video' => '<p>The configuration for the video artifacts concatenation.</p>', ], ], 'VideoMuxType' => [ 'base' => NULL, 'refs' => [ 'VideoArtifactsConfiguration$MuxType' => '<p>The MUX type of the video artifact configuration object.</p>', ], ], 'VocabularyFilterMethod' => [ 'base' => NULL, 'refs' => [ 'AmazonTranscribeCallAnalyticsProcessorConfiguration$VocabularyFilterMethod' => '<p>Specifies how to apply a vocabulary filter to a transcript.</p> <p>To replace words with <b>***</b>, choose <code>mask</code>.</p> <p>To delete words, choose <code>remove</code>.</p> <p>To flag words without changing them, choose <code>tag</code>. </p>', 'AmazonTranscribeProcessorConfiguration$VocabularyFilterMethod' => '<p>The vocabulary filtering method used in your Call Analytics transcription.</p>', ], ], 'VocabularyFilterName' => [ 'base' => NULL, 'refs' => [ 'AmazonTranscribeCallAnalyticsProcessorConfiguration$VocabularyFilterName' => '<p>Specifies the name of the custom vocabulary filter to use when processing a transcription. Note that vocabulary filter names are case sensitive.</p> <p>If the language of the specified custom vocabulary filter doesn\\'t match the language identified in your media, the vocabulary filter is not applied to your transcription.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html\">Using vocabulary filtering with unwanted words</a> in the <i>Amazon Transcribe Developer Guide</i>.</p> <p>Length Constraints: Minimum length of 1. Maximum length of 200. </p>', 'AmazonTranscribeProcessorConfiguration$VocabularyFilterName' => '<p>The name of the custom vocabulary filter that you specified in your Call Analytics request.</p> <p>Length Constraints: Minimum length of 1. Maximum length of 200.</p>', ], ], 'VocabularyName' => [ 'base' => NULL, 'refs' => [ 'AmazonTranscribeCallAnalyticsProcessorConfiguration$VocabularyName' => '<p>Specifies the name of the custom vocabulary to use when processing a transcription. Note that vocabulary names are case sensitive.</p> <p>If the language of the specified custom vocabulary doesn\\'t match the language identified in your media, the custom vocabulary is not applied to your transcription.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html\">Custom vocabularies</a> in the <i>Amazon Transcribe Developer Guide</i>.</p> <p>Length Constraints: Minimum length of 1. Maximum length of 200. </p>', 'AmazonTranscribeProcessorConfiguration$VocabularyName' => '<p>The name of the custom vocabulary that you specified in your Call Analytics request.</p> <p>Length Constraints: Minimum length of 1. Maximum length of 200.</p>', ], ], 'VoiceAnalyticsConfigurationStatus' => [ 'base' => NULL, 'refs' => [ 'VoiceAnalyticsProcessorConfiguration$SpeakerSearchStatus' => '<p>The status of the speaker search task.</p>', 'VoiceAnalyticsProcessorConfiguration$VoiceToneAnalysisStatus' => '<p>The status of the voice tone analysis task.</p>', ], ], 'VoiceAnalyticsProcessorConfiguration' => [ 'base' => '<p>The configuration settings for a voice analytics processor.</p>', 'refs' => [ 'MediaInsightsPipelineConfigurationElement$VoiceAnalyticsProcessorConfiguration' => '<p>The voice analytics configuration settings in a media insights pipeline configuration element.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-media-pipelines/2021-07-15/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://media-pipelines-chime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://media-pipelines-chime-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://media-pipelines-chime.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://media-pipelines-chime.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-media-pipelines/2021-07-15/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://media-pipelines-chime.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-media-pipelines/2021-07-15/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-media-pipelines/2021-07-15/paginators-1.json\nreturn [ 'pagination' => [ 'ListMediaCapturePipelines' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListMediaInsightsPipelineConfigurations' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListMediaPipelines' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-meetings/2021-07-15/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2021-07-15', 'endpointPrefix' => 'meetings-chime', 'protocol' => 'rest-json', 'serviceFullName' => 'Amazon Chime SDK Meetings', 'serviceId' => 'Chime SDK Meetings', 'signatureVersion' => 'v4', 'signingName' => 'chime', 'uid' => 'chime-sdk-meetings-2021-07-15', ], 'operations' => [ 'BatchCreateAttendee' => [ 'name' => 'BatchCreateAttendee', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings/{MeetingId}/attendees?operation=batch-create', ], 'input' => [ 'shape' => 'BatchCreateAttendeeRequest', ], 'output' => [ 'shape' => 'BatchCreateAttendeeResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'UnprocessableEntityException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'BatchUpdateAttendeeCapabilitiesExcept' => [ 'name' => 'BatchUpdateAttendeeCapabilitiesExcept', 'http' => [ 'method' => 'PUT', 'requestUri' => '/meetings/{MeetingId}/attendees/capabilities?operation=batch-update-except', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchUpdateAttendeeCapabilitiesExceptRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], ], ], 'CreateAttendee' => [ 'name' => 'CreateAttendee', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings/{MeetingId}/attendees', ], 'input' => [ 'shape' => 'CreateAttendeeRequest', ], 'output' => [ 'shape' => 'CreateAttendeeResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'UnprocessableEntityException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'CreateMeeting' => [ 'name' => 'CreateMeeting', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings', ], 'input' => [ 'shape' => 'CreateMeetingRequest', ], 'output' => [ 'shape' => 'CreateMeetingResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'CreateMeetingWithAttendees' => [ 'name' => 'CreateMeetingWithAttendees', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings?operation=create-attendees', ], 'input' => [ 'shape' => 'CreateMeetingWithAttendeesRequest', ], 'output' => [ 'shape' => 'CreateMeetingWithAttendeesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'DeleteAttendee' => [ 'name' => 'DeleteAttendee', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/meetings/{MeetingId}/attendees/{AttendeeId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteAttendeeRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DeleteMeeting' => [ 'name' => 'DeleteMeeting', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/meetings/{MeetingId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteMeetingRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'GetAttendee' => [ 'name' => 'GetAttendee', 'http' => [ 'method' => 'GET', 'requestUri' => '/meetings/{MeetingId}/attendees/{AttendeeId}', ], 'input' => [ 'shape' => 'GetAttendeeRequest', ], 'output' => [ 'shape' => 'GetAttendeeResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'GetMeeting' => [ 'name' => 'GetMeeting', 'http' => [ 'method' => 'GET', 'requestUri' => '/meetings/{MeetingId}', ], 'input' => [ 'shape' => 'GetMeetingRequest', ], 'output' => [ 'shape' => 'GetMeetingResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'ListAttendees' => [ 'name' => 'ListAttendees', 'http' => [ 'method' => 'GET', 'requestUri' => '/meetings/{MeetingId}/attendees', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAttendeesRequest', ], 'output' => [ 'shape' => 'ListAttendeesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], ], ], 'StartMeetingTranscription' => [ 'name' => 'StartMeetingTranscription', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings/{MeetingId}/transcription?operation=start', 'responseCode' => 200, ], 'input' => [ 'shape' => 'StartMeetingTranscriptionRequest', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'UnprocessableEntityException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'StopMeetingTranscription' => [ 'name' => 'StopMeetingTranscription', 'http' => [ 'method' => 'POST', 'requestUri' => '/meetings/{MeetingId}/transcription?operation=stop', 'responseCode' => 200, ], 'input' => [ 'shape' => 'StopMeetingTranscriptionRequest', ], 'errors' => [ [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'UnprocessableEntityException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags?operation=tag-resource', 'responseCode' => 204, ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'TooManyTagsException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags?operation=untag-resource', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UpdateAttendeeCapabilities' => [ 'name' => 'UpdateAttendeeCapabilities', 'http' => [ 'method' => 'PUT', 'requestUri' => '/meetings/{MeetingId}/attendees/{AttendeeId}/capabilities', ], 'input' => [ 'shape' => 'UpdateAttendeeCapabilitiesRequest', ], 'output' => [ 'shape' => 'UpdateAttendeeCapabilitiesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'UnauthorizedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ServiceUnavailableException', ], ], ], ], 'shapes' => [ 'AmazonResourceName' => [ 'type' => 'string', 'max' => 1011, 'min' => 1, 'pattern' => '^arn:.*', ], 'Arn' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, 'pattern' => '^arn[\\\\/\\\\:\\\\-\\\\_\\\\.a-zA-Z0-9]+$', 'sensitive' => true, ], 'Attendee' => [ 'type' => 'structure', 'members' => [ 'ExternalUserId' => [ 'shape' => 'ExternalUserId', ], 'AttendeeId' => [ 'shape' => 'GuidString', ], 'JoinToken' => [ 'shape' => 'JoinTokenString', ], 'Capabilities' => [ 'shape' => 'AttendeeCapabilities', ], ], ], 'AttendeeCapabilities' => [ 'type' => 'structure', 'required' => [ 'Audio', 'Video', 'Content', ], 'members' => [ 'Audio' => [ 'shape' => 'MediaCapabilities', ], 'Video' => [ 'shape' => 'MediaCapabilities', ], 'Content' => [ 'shape' => 'MediaCapabilities', ], ], ], 'AttendeeIdItem' => [ 'type' => 'structure', 'required' => [ 'AttendeeId', ], 'members' => [ 'AttendeeId' => [ 'shape' => 'GuidString', ], ], ], 'AttendeeIdsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AttendeeIdItem', ], 'max' => 250, 'min' => 1, ], 'AttendeeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Attendee', ], ], 'AudioFeatures' => [ 'type' => 'structure', 'members' => [ 'EchoReduction' => [ 'shape' => 'MeetingFeatureStatus', ], ], ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'String', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'BatchCreateAttendeeErrorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CreateAttendeeError', ], ], 'BatchCreateAttendeeRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'Attendees', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'MeetingId', ], 'Attendees' => [ 'shape' => 'CreateAttendeeRequestItemList', ], ], ], 'BatchCreateAttendeeResponse' => [ 'type' => 'structure', 'members' => [ 'Attendees' => [ 'shape' => 'AttendeeList', ], 'Errors' => [ 'shape' => 'BatchCreateAttendeeErrorList', ], ], ], 'BatchUpdateAttendeeCapabilitiesExceptRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'ExcludedAttendeeIds', 'Capabilities', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'MeetingId', ], 'ExcludedAttendeeIds' => [ 'shape' => 'AttendeeIdsList', ], 'Capabilities' => [ 'shape' => 'AttendeeCapabilities', ], ], ], 'Boolean' => [ 'type' => 'boolean', ], 'ClientRequestToken' => [ 'type' => 'string', 'max' => 64, 'min' => 2, 'pattern' => '[-_a-zA-Z0-9]*', 'sensitive' => true, ], 'ConflictException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'String', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'CreateAttendeeError' => [ 'type' => 'structure', 'members' => [ 'ExternalUserId' => [ 'shape' => 'ExternalUserId', ], 'ErrorCode' => [ 'shape' => 'String', ], 'ErrorMessage' => [ 'shape' => 'String', ], ], ], 'CreateAttendeeRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'ExternalUserId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'MeetingId', ], 'ExternalUserId' => [ 'shape' => 'ExternalUserId', ], 'Capabilities' => [ 'shape' => 'AttendeeCapabilities', ], ], ], 'CreateAttendeeRequestItem' => [ 'type' => 'structure', 'required' => [ 'ExternalUserId', ], 'members' => [ 'ExternalUserId' => [ 'shape' => 'ExternalUserId', ], 'Capabilities' => [ 'shape' => 'AttendeeCapabilities', ], ], ], 'CreateAttendeeRequestItemList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CreateAttendeeRequestItem', ], 'max' => 100, 'min' => 1, ], 'CreateAttendeeResponse' => [ 'type' => 'structure', 'members' => [ 'Attendee' => [ 'shape' => 'Attendee', ], ], ], 'CreateMeetingRequest' => [ 'type' => 'structure', 'required' => [ 'ClientRequestToken', 'MediaRegion', 'ExternalMeetingId', ], 'members' => [ 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'MediaRegion' => [ 'shape' => 'MediaRegion', ], 'MeetingHostId' => [ 'shape' => 'ExternalUserId', ], 'ExternalMeetingId' => [ 'shape' => 'ExternalMeetingId', ], 'NotificationsConfiguration' => [ 'shape' => 'NotificationsConfiguration', ], 'MeetingFeatures' => [ 'shape' => 'MeetingFeaturesConfiguration', ], 'PrimaryMeetingId' => [ 'shape' => 'PrimaryMeetingId', ], 'TenantIds' => [ 'shape' => 'TenantIdList', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateMeetingResponse' => [ 'type' => 'structure', 'members' => [ 'Meeting' => [ 'shape' => 'Meeting', ], ], ], 'CreateMeetingWithAttendeesRequest' => [ 'type' => 'structure', 'required' => [ 'ClientRequestToken', 'MediaRegion', 'ExternalMeetingId', 'Attendees', ], 'members' => [ 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'MediaRegion' => [ 'shape' => 'MediaRegion', ], 'MeetingHostId' => [ 'shape' => 'ExternalUserId', ], 'ExternalMeetingId' => [ 'shape' => 'ExternalMeetingId', ], 'MeetingFeatures' => [ 'shape' => 'MeetingFeaturesConfiguration', ], 'NotificationsConfiguration' => [ 'shape' => 'NotificationsConfiguration', ], 'Attendees' => [ 'shape' => 'CreateMeetingWithAttendeesRequestItemList', ], 'PrimaryMeetingId' => [ 'shape' => 'PrimaryMeetingId', ], 'TenantIds' => [ 'shape' => 'TenantIdList', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateMeetingWithAttendeesRequestItemList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CreateAttendeeRequestItem', ], 'max' => 20, 'min' => 1, ], 'CreateMeetingWithAttendeesResponse' => [ 'type' => 'structure', 'members' => [ 'Meeting' => [ 'shape' => 'Meeting', ], 'Attendees' => [ 'shape' => 'AttendeeList', ], 'Errors' => [ 'shape' => 'BatchCreateAttendeeErrorList', ], ], ], 'DeleteAttendeeRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'AttendeeId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'MeetingId', ], 'AttendeeId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'AttendeeId', ], ], ], 'DeleteMeetingRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'MeetingId', ], ], ], 'EngineTranscribeMedicalSettings' => [ 'type' => 'structure', 'required' => [ 'LanguageCode', 'Specialty', 'Type', ], 'members' => [ 'LanguageCode' => [ 'shape' => 'TranscribeMedicalLanguageCode', ], 'Specialty' => [ 'shape' => 'TranscribeMedicalSpecialty', ], 'Type' => [ 'shape' => 'TranscribeMedicalType', ], 'VocabularyName' => [ 'shape' => 'String', ], 'Region' => [ 'shape' => 'TranscribeMedicalRegion', ], 'ContentIdentificationType' => [ 'shape' => 'TranscribeMedicalContentIdentificationType', ], ], ], 'EngineTranscribeSettings' => [ 'type' => 'structure', 'members' => [ 'LanguageCode' => [ 'shape' => 'TranscribeLanguageCode', ], 'VocabularyFilterMethod' => [ 'shape' => 'TranscribeVocabularyFilterMethod', ], 'VocabularyFilterName' => [ 'shape' => 'String', ], 'VocabularyName' => [ 'shape' => 'String', ], 'Region' => [ 'shape' => 'TranscribeRegion', ], 'EnablePartialResultsStabilization' => [ 'shape' => 'Boolean', ], 'PartialResultsStability' => [ 'shape' => 'TranscribePartialResultsStability', ], 'ContentIdentificationType' => [ 'shape' => 'TranscribeContentIdentificationType', ], 'ContentRedactionType' => [ 'shape' => 'TranscribeContentRedactionType', ], 'PiiEntityTypes' => [ 'shape' => 'TranscribePiiEntityTypes', ], 'LanguageModelName' => [ 'shape' => 'TranscribeLanguageModelName', ], 'IdentifyLanguage' => [ 'shape' => 'Boolean', ], 'LanguageOptions' => [ 'shape' => 'TranscribeLanguageOptions', ], 'PreferredLanguage' => [ 'shape' => 'TranscribeLanguageCode', ], 'VocabularyNames' => [ 'shape' => 'TranscribeVocabularyNamesOrFilterNamesString', ], 'VocabularyFilterNames' => [ 'shape' => 'TranscribeVocabularyNamesOrFilterNamesString', ], ], ], 'ExternalMeetingId' => [ 'type' => 'string', 'max' => 64, 'min' => 2, 'sensitive' => true, ], 'ExternalUserId' => [ 'type' => 'string', 'max' => 64, 'min' => 2, 'sensitive' => true, ], 'ForbiddenException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'String', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 403, ], 'exception' => true, ], 'GetAttendeeRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'AttendeeId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'MeetingId', ], 'AttendeeId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'AttendeeId', ], ], ], 'GetAttendeeResponse' => [ 'type' => 'structure', 'members' => [ 'Attendee' => [ 'shape' => 'Attendee', ], ], ], 'GetMeetingRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'MeetingId', ], ], ], 'GetMeetingResponse' => [ 'type' => 'structure', 'members' => [ 'Meeting' => [ 'shape' => 'Meeting', ], ], ], 'GuidString' => [ 'type' => 'string', 'pattern' => '[a-fA-F0-9]{8}(?:-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}', ], 'JoinTokenString' => [ 'type' => 'string', 'max' => 2048, 'min' => 2, 'sensitive' => true, ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'String', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ListAttendeesRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'MeetingId', ], 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListAttendeesResponse' => [ 'type' => 'structure', 'members' => [ 'Attendees' => [ 'shape' => 'AttendeeList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'AmazonResourceName', 'location' => 'querystring', 'locationName' => 'arn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], ], ], 'MediaCapabilities' => [ 'type' => 'string', 'enum' => [ 'SendReceive', 'Send', 'Receive', 'None', ], ], 'MediaPlacement' => [ 'type' => 'structure', 'members' => [ 'AudioHostUrl' => [ 'shape' => 'String', ], 'AudioFallbackUrl' => [ 'shape' => 'String', ], 'SignalingUrl' => [ 'shape' => 'String', ], 'TurnControlUrl' => [ 'shape' => 'String', ], 'ScreenDataUrl' => [ 'shape' => 'String', ], 'ScreenViewingUrl' => [ 'shape' => 'String', ], 'ScreenSharingUrl' => [ 'shape' => 'String', ], 'EventIngestionUrl' => [ 'shape' => 'String', ], ], ], 'MediaRegion' => [ 'type' => 'string', 'max' => 64, 'min' => 2, ], 'Meeting' => [ 'type' => 'structure', 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', ], 'MeetingHostId' => [ 'shape' => 'ExternalUserId', ], 'ExternalMeetingId' => [ 'shape' => 'ExternalMeetingId', ], 'MediaRegion' => [ 'shape' => 'MediaRegion', ], 'MediaPlacement' => [ 'shape' => 'MediaPlacement', ], 'MeetingFeatures' => [ 'shape' => 'MeetingFeaturesConfiguration', ], 'PrimaryMeetingId' => [ 'shape' => 'PrimaryMeetingId', ], 'TenantIds' => [ 'shape' => 'TenantIdList', ], 'MeetingArn' => [ 'shape' => 'AmazonResourceName', ], ], ], 'MeetingFeatureStatus' => [ 'type' => 'string', 'enum' => [ 'AVAILABLE', 'UNAVAILABLE', ], ], 'MeetingFeaturesConfiguration' => [ 'type' => 'structure', 'members' => [ 'Audio' => [ 'shape' => 'AudioFeatures', ], ], ], 'NotFoundException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'String', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'NotificationsConfiguration' => [ 'type' => 'structure', 'members' => [ 'LambdaFunctionArn' => [ 'shape' => 'Arn', ], 'SnsTopicArn' => [ 'shape' => 'Arn', ], 'SqsQueueArn' => [ 'shape' => 'Arn', ], ], ], 'PrimaryMeetingId' => [ 'type' => 'string', 'max' => 64, 'min' => 2, ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'String', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], 'ResourceName' => [ 'shape' => 'AmazonResourceName', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'ResultMax' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'RetryAfterSeconds' => [ 'type' => 'string', ], 'ServiceFailureException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'String', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'ServiceUnavailableException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'String', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], 'RetryAfterSeconds' => [ 'shape' => 'RetryAfterSeconds', 'location' => 'header', 'locationName' => 'Retry-After', ], ], 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], 'StartMeetingTranscriptionRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'TranscriptionConfiguration', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'MeetingId', ], 'TranscriptionConfiguration' => [ 'shape' => 'TranscriptionConfiguration', ], ], ], 'StopMeetingTranscriptionRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'MeetingId', ], ], ], 'String' => [ 'type' => 'string', 'max' => 4096, ], 'Tag' => [ 'type' => 'structure', 'required' => [ 'Key', 'Value', ], 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^[a-zA-Z+-=._:/]+$', ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 50, 'min' => 0, ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], 'max' => 50, 'min' => 0, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'Tags', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'AmazonResourceName', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => '[\\\\s\\\\w+-=\\\\.:/@]*', ], 'TenantId' => [ 'type' => 'string', 'max' => 256, 'min' => 2, 'pattern' => '^(?!.*?(.)\\\\1{3})[-_!@#$a-zA-Z0-9]*$', ], 'TenantIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TenantId', ], 'max' => 5, 'min' => 1, ], 'ThrottlingException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'String', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], 'TooManyTagsException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'String', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], 'ResourceName' => [ 'shape' => 'AmazonResourceName', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'TranscribeContentIdentificationType' => [ 'type' => 'string', 'enum' => [ 'PII', ], ], 'TranscribeContentRedactionType' => [ 'type' => 'string', 'enum' => [ 'PII', ], ], 'TranscribeLanguageCode' => [ 'type' => 'string', 'enum' => [ 'en-US', 'en-GB', 'es-US', 'fr-CA', 'fr-FR', 'en-AU', 'it-IT', 'de-DE', 'pt-BR', 'ja-JP', 'ko-KR', 'zh-CN', 'th-TH', 'hi-IN', ], ], 'TranscribeLanguageModelName' => [ 'type' => 'string', 'max' => 200, 'min' => 1, 'pattern' => '^[0-9a-zA-Z._-]+', ], 'TranscribeLanguageOptions' => [ 'type' => 'string', 'max' => 200, 'min' => 1, 'pattern' => '^[a-zA-Z-,]+', ], 'TranscribeMedicalContentIdentificationType' => [ 'type' => 'string', 'enum' => [ 'PHI', ], ], 'TranscribeMedicalLanguageCode' => [ 'type' => 'string', 'enum' => [ 'en-US', ], ], 'TranscribeMedicalRegion' => [ 'type' => 'string', 'enum' => [ 'us-east-1', 'us-east-2', 'us-west-2', 'ap-southeast-2', 'ca-central-1', 'eu-west-1', 'auto', ], ], 'TranscribeMedicalSpecialty' => [ 'type' => 'string', 'enum' => [ 'PRIMARYCARE', 'CARDIOLOGY', 'NEUROLOGY', 'ONCOLOGY', 'RADIOLOGY', 'UROLOGY', ], ], 'TranscribeMedicalType' => [ 'type' => 'string', 'enum' => [ 'CONVERSATION', 'DICTATION', ], ], 'TranscribePartialResultsStability' => [ 'type' => 'string', 'enum' => [ 'low', 'medium', 'high', ], ], 'TranscribePiiEntityTypes' => [ 'type' => 'string', 'max' => 300, 'min' => 1, 'pattern' => '^[A-Z_, ]+', ], 'TranscribeRegion' => [ 'type' => 'string', 'enum' => [ 'us-east-2', 'us-east-1', 'us-west-2', 'ap-northeast-2', 'ap-southeast-2', 'ap-northeast-1', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'sa-east-1', 'auto', 'us-gov-west-1', ], ], 'TranscribeVocabularyFilterMethod' => [ 'type' => 'string', 'enum' => [ 'remove', 'mask', 'tag', ], ], 'TranscribeVocabularyNamesOrFilterNamesString' => [ 'type' => 'string', 'max' => 3000, 'min' => 1, 'pattern' => '^[a-zA-Z0-9,-._]+', ], 'TranscriptionConfiguration' => [ 'type' => 'structure', 'members' => [ 'EngineTranscribeSettings' => [ 'shape' => 'EngineTranscribeSettings', ], 'EngineTranscribeMedicalSettings' => [ 'shape' => 'EngineTranscribeMedicalSettings', ], ], ], 'UnauthorizedException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'String', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], 'UnprocessableEntityException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'String', ], 'Message' => [ 'shape' => 'String', ], 'RequestId' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 422, ], 'exception' => true, ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'TagKeys', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'AmazonResourceName', ], 'TagKeys' => [ 'shape' => 'TagKeyList', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateAttendeeCapabilitiesRequest' => [ 'type' => 'structure', 'required' => [ 'MeetingId', 'AttendeeId', 'Capabilities', ], 'members' => [ 'MeetingId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'MeetingId', ], 'AttendeeId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'AttendeeId', ], 'Capabilities' => [ 'shape' => 'AttendeeCapabilities', ], ], ], 'UpdateAttendeeCapabilitiesResponse' => [ 'type' => 'structure', 'members' => [ 'Attendee' => [ 'shape' => 'Attendee', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-meetings/2021-07-15/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>The Amazon Chime SDK meetings APIs in this section allow software developers to create Amazon Chime SDK meetings, set the AWS Regions for meetings, create and manage users, and send and receive meeting notifications. For more information about the meeting APIs, see <a href=\"https://docs.aws.amazon.com/chime/latest/APIReference/API_Operations_Amazon_Chime_SDK_Meetings.html\">Amazon Chime SDK meetings</a>.</p>', 'operations' => [ 'BatchCreateAttendee' => '<p>Creates up to 100 attendees for an active Amazon Chime SDK meeting. For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime Developer Guide</i>.</p>', 'BatchUpdateAttendeeCapabilitiesExcept' => '<p>Updates <code>AttendeeCapabilities</code> except the capabilities listed in an <code>ExcludedAttendeeIds</code> table.</p> <note> <p>You use the capabilities with a set of values that control what the capabilities can do, such as <code>SendReceive</code> data. For more information about those values, see .</p> </note> <p>When using capabilities, be aware of these corner cases:</p> <ul> <li> <p>You can\\'t set <code>content</code> capabilities to <code>SendReceive</code> or <code>Receive</code> unless you also set <code>video</code> capabilities to <code>SendReceive</code> or <code>Receive</code>. If you don\\'t set the <code>video</code> capability to receive, the response will contain an HTTP 400 Bad Request status code. However, you can set your <code>video</code> capability to receive and you set your <code>content</code> capability to not receive.</p> </li> <li> <p>When you change an <code>audio</code> capability from <code>None</code> or <code>Receive</code> to <code>Send</code> or <code>SendReceive</code> , and if the attendee left their microphone unmuted, audio will flow from the attendee to the other meeting participants.</p> </li> <li> <p>When you change a <code>video</code> or <code>content</code> capability from <code>None</code> or <code>Receive</code> to <code>Send</code> or <code>SendReceive</code> , and if the attendee turned on their video or content streams, remote attendees can receive those streams, but only after media renegotiation between the client and the Amazon Chime back-end server.</p> </li> </ul>', 'CreateAttendee' => '<p> Creates a new attendee for an active Amazon Chime SDK meeting. For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime Developer Guide</i>. </p>', 'CreateMeeting' => '<p>Creates a new Amazon Chime SDK meeting in the specified media Region with no initial attendees. For more information about specifying media Regions, see <a href=\"https://docs.aws.amazon.com/chime/latest/dg/chime-sdk-meetings-regions.html\">Amazon Chime SDK Media Regions</a> in the <i>Amazon Chime Developer Guide</i>. For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime Developer Guide</i>. </p>', 'CreateMeetingWithAttendees' => '<p> Creates a new Amazon Chime SDK meeting in the specified media Region, with attendees. For more information about specifying media Regions, see <a href=\"https://docs.aws.amazon.com/chime/latest/dg/chime-sdk-meetings-regions.html\">Amazon Chime SDK Media Regions</a> in the <i>Amazon Chime Developer Guide</i>. For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime Developer Guide</i>. </p>', 'DeleteAttendee' => '<p>Deletes an attendee from the specified Amazon Chime SDK meeting and deletes their <code>JoinToken</code>. Attendees are automatically deleted when a Amazon Chime SDK meeting is deleted. For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime Developer Guide</i>.</p>', 'DeleteMeeting' => '<p>Deletes the specified Amazon Chime SDK meeting. The operation deletes all attendees, disconnects all clients, and prevents new clients from joining the meeting. For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime Developer Guide</i>.</p>', 'GetAttendee' => '<p> Gets the Amazon Chime SDK attendee details for a specified meeting ID and attendee ID. For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime Developer Guide</i>. </p>', 'GetMeeting' => '<p>Gets the Amazon Chime SDK meeting details for the specified meeting ID. For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime Developer Guide</i>.</p>', 'ListAttendees' => '<p> Lists the attendees for the specified Amazon Chime SDK meeting. For more information about the Amazon Chime SDK, see <a href=\"https://docs.aws.amazon.com/chime/latest/dg/meetings-sdk.html\">Using the Amazon Chime SDK</a> in the <i>Amazon Chime Developer Guide</i>. </p>', 'ListTagsForResource' => '<p>Returns a list of the tags available for the specified resource.</p>', 'StartMeetingTranscription' => '<p>Starts transcription for the specified <code>meetingId</code>. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/meeting-transcription.html\"> Using Amazon Chime SDK live transcription </a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> <p>If you specify an invalid configuration, a <code>TranscriptFailed</code> event will be sent with the contents of the <code>BadRequestException</code> generated by Amazon Transcribe. For more information on each parameter and which combinations are valid, refer to the <a href=\"https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartStreamTranscription.html\">StartStreamTranscription</a> API in the <i>Amazon Transcribe Developer Guide</i>.</p> <important> <p>Amazon Chime SDK live transcription is powered by Amazon Transcribe. Use of Amazon Transcribe is subject to the <a href=\"https://aws.amazon.com/service-terms/\">AWS Service Terms</a>, including the terms specific to the AWS Machine Learning and Artificial Intelligence Services.</p> </important>', 'StopMeetingTranscription' => '<p>Stops transcription for the specified <code>meetingId</code>. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/meeting-transcription.html\"> Using Amazon Chime SDK live transcription </a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> <important> <p>Amazon Chime SDK live transcription is powered by Amazon Transcribe. Use of Amazon Transcribe is subject to the <a href=\"https://aws.amazon.com/service-terms/\">AWS Service Terms</a>, including the terms specific to the AWS Machine Learning and Artificial Intelligence Services.</p> </important>', 'TagResource' => '<p>The resource that supports tags.</p>', 'UntagResource' => '<p>Removes the specified tags from the specified resources. When you specify a tag key, the action removes both that key and its associated value. The operation succeeds even if you attempt to remove tags from a resource that were already removed. Note the following:</p> <ul> <li> <p>To remove tags from a resource, you need the necessary permissions for the service that the resource belongs to as well as permissions for removing tags. For more information, see the documentation for the service whose resource you want to untag.</p> </li> <li> <p>You can only tag resources that are located in the specified AWS Region for the calling AWS account.</p> </li> </ul> <p> <b>Minimum permissions</b> </p> <p>In addition to the <code>tag:UntagResources</code> permission required by this operation, you must also have the remove tags permission defined by the service that created the resource. For example, to remove the tags from an Amazon EC2 instance using the <code>UntagResources</code> operation, you must have both of the following permissions:</p> <p> <code>tag:UntagResource</code> </p> <p> <code>ChimeSDKMeetings:DeleteTags</code> </p>', 'UpdateAttendeeCapabilities' => '<p>The capabilities that you want to update.</p> <note> <p>You use the capabilities with a set of values that control what the capabilities can do, such as <code>SendReceive</code> data. For more information about those values, see .</p> </note> <p>When using capabilities, be aware of these corner cases:</p> <ul> <li> <p>You can\\'t set <code>content</code> capabilities to <code>SendReceive</code> or <code>Receive</code> unless you also set <code>video</code> capabilities to <code>SendReceive</code> or <code>Receive</code>. If you don\\'t set the <code>video</code> capability to receive, the response will contain an HTTP 400 Bad Request status code. However, you can set your <code>video</code> capability to receive and you set your <code>content</code> capability to not receive.</p> </li> <li> <p>When you change an <code>audio</code> capability from <code>None</code> or <code>Receive</code> to <code>Send</code> or <code>SendReceive</code> , and if the attendee left their microphone unmuted, audio will flow from the attendee to the other meeting participants.</p> </li> <li> <p>When you change a <code>video</code> or <code>content</code> capability from <code>None</code> or <code>Receive</code> to <code>Send</code> or <code>SendReceive</code> , and if the attendee turned on their video or content streams, remote attendees can receive those streams, but only after media renegotiation between the client and the Amazon Chime back-end server.</p> </li> </ul>', ], 'shapes' => [ 'AmazonResourceName' => [ 'base' => NULL, 'refs' => [ 'ListTagsForResourceRequest$ResourceARN' => '<p>The ARN of the resource.</p>', 'Meeting$MeetingArn' => '<p>The ARN of the meeting.</p>', 'ResourceNotFoundException$ResourceName' => '<p>The name of the resource that couldn\\'t be found.</p>', 'TagResourceRequest$ResourceARN' => '<p>The ARN of the resource.</p>', 'TooManyTagsException$ResourceName' => '<p>The name of the resource that received too many tags.</p>', 'UntagResourceRequest$ResourceARN' => '<p>The ARN of the resource that you\\'re removing tags from.</p>', ], ], 'Arn' => [ 'base' => NULL, 'refs' => [ 'NotificationsConfiguration$LambdaFunctionArn' => '<p>The ARN of the AWS Lambda function in the notifications configuration.</p>', 'NotificationsConfiguration$SnsTopicArn' => '<p>The ARN of the SNS topic.</p>', 'NotificationsConfiguration$SqsQueueArn' => '<p>The ARN of the SQS queue.</p>', ], ], 'Attendee' => [ 'base' => '<p>An Amazon Chime SDK meeting attendee. Includes a unique <code>AttendeeId</code> and <code>JoinToken</code>. The <code>JoinToken</code> allows a client to authenticate and join as the specified attendee. The <code>JoinToken</code> expires when the meeting ends, or when <a>DeleteAttendee</a> is called. After that, the attendee is unable to join the meeting. </p> <p>We recommend securely transferring each <code>JoinToken</code> from your server application to the client so that no other client has access to the token except for the one authorized to represent the attendee.</p>', 'refs' => [ 'AttendeeList$member' => NULL, 'CreateAttendeeResponse$Attendee' => '<p>The attendee information, including attendee ID and join token.</p>', 'GetAttendeeResponse$Attendee' => '<p>The Amazon Chime SDK attendee information.</p>', 'UpdateAttendeeCapabilitiesResponse$Attendee' => '<p>The updated attendee data.</p>', ], ], 'AttendeeCapabilities' => [ 'base' => '<p>The media capabilities of an attendee: audio, video, or content. </p> <note> <p>You use the capabilities with a set of values that control what the capabilities can do, such as <code>SendReceive</code> data. For more information about those values, see .</p> </note> <p>When using capabilities, be aware of these corner cases:</p> <ul> <li> <p>You can\\'t set <code>content</code> capabilities to <code>SendReceive</code> or <code>Receive</code> unless you also set <code>video</code> capabilities to <code>SendReceive</code> or <code>Receive</code>. If you don\\'t set the <code>video</code> capability to receive, the response will contain an HTTP 400 Bad Request status code. However, you can set your <code>video</code> capability to receive and you set your <code>content</code> capability to not receive.</p> </li> <li> <p>When you change an <code>audio</code> capability from <code>None</code> or <code>Receive</code> to <code>Send</code> or <code>SendReceive</code> , and if the attendee left their microphone unmuted, audio will flow from the attendee to the other meeting participants.</p> </li> <li> <p>When you change a <code>video</code> or <code>content</code> capability from <code>None</code> or <code>Receive</code> to <code>Send</code> or <code>SendReceive</code> , and if the attendee turned on their video or content streams, remote attendees can receive those streams, but only after media renegotiation between the client and the Amazon Chime back-end server.</p> </li> </ul>', 'refs' => [ 'Attendee$Capabilities' => '<p>The capabilities assigned to an attendee: audio, video, or content.</p> <note> <p>You use the capabilities with a set of values that control what the capabilities can do, such as <code>SendReceive</code> data. For more information about those values, see .</p> </note> <p>When using capabilities, be aware of these corner cases:</p> <ul> <li> <p>You can\\'t set <code>content</code> capabilities to <code>SendReceive</code> or <code>Receive</code> unless you also set <code>video</code> capabilities to <code>SendReceive</code> or <code>Receive</code>. If you don\\'t set the <code>video</code> capability to receive, the response will contain an HTTP 400 Bad Request status code. However, you can set your <code>video</code> capability to receive and you set your <code>content</code> capability to not receive.</p> </li> <li> <p>When you change an <code>audio</code> capability from <code>None</code> or <code>Receive</code> to <code>Send</code> or <code>SendReceive</code> , and if the attendee left their microphone unmuted, audio will flow from the attendee to the other meeting participants.</p> </li> <li> <p>When you change a <code>video</code> or <code>content</code> capability from <code>None</code> or <code>Receive</code> to <code>Send</code> or <code>SendReceive</code> , and if the attendee turned on their video or content streams, remote attendees can receive those streams, but only after media renegotiation between the client and the Amazon Chime back-end server.</p> </li> </ul>', 'BatchUpdateAttendeeCapabilitiesExceptRequest$Capabilities' => '<p>The capabilities (<code>audio</code>, <code>video</code>, or <code>content</code>) that you want to update.</p>', 'CreateAttendeeRequest$Capabilities' => '<p>The capabilities (<code>audio</code>, <code>video</code>, or <code>content</code>) that you want to grant an attendee. If you don\\'t specify capabilities, all users have send and receive capabilities on all media channels by default.</p> <note> <p>You use the capabilities with a set of values that control what the capabilities can do, such as <code>SendReceive</code> data. For more information about those values, see .</p> </note> <p>When using capabilities, be aware of these corner cases:</p> <ul> <li> <p>You can\\'t set <code>content</code> capabilities to <code>SendReceive</code> or <code>Receive</code> unless you also set <code>video</code> capabilities to <code>SendReceive</code> or <code>Receive</code>. If you don\\'t set the <code>video</code> capability to receive, the response will contain an HTTP 400 Bad Request status code. However, you can set your <code>video</code> capability to receive and you set your <code>content</code> capability to not receive.</p> </li> <li> <p>When you change an <code>audio</code> capability from <code>None</code> or <code>Receive</code> to <code>Send</code> or <code>SendReceive</code> , and if the attendee left their microphone unmuted, audio will flow from the attendee to the other meeting participants.</p> </li> <li> <p>When you change a <code>video</code> or <code>content</code> capability from <code>None</code> or <code>Receive</code> to <code>Send</code> or <code>SendReceive</code> , and if the attendee turned on their video or content streams, remote attendees can receive those streams, but only after media renegotiation between the client and the Amazon Chime back-end server.</p> </li> </ul>', 'CreateAttendeeRequestItem$Capabilities' => '<p>A list of one or more capabilities.</p>', 'UpdateAttendeeCapabilitiesRequest$Capabilities' => '<p>The capabilities that you want to update.</p>', ], ], 'AttendeeIdItem' => [ 'base' => '<p>A structure that contains one or more attendee IDs.</p>', 'refs' => [ 'AttendeeIdsList$member' => NULL, ], ], 'AttendeeIdsList' => [ 'base' => NULL, 'refs' => [ 'BatchUpdateAttendeeCapabilitiesExceptRequest$ExcludedAttendeeIds' => '<p>The <code>AttendeeIDs</code> that you want to exclude from one or more capabilities.</p>', ], ], 'AttendeeList' => [ 'base' => NULL, 'refs' => [ 'BatchCreateAttendeeResponse$Attendees' => '<p>The attendee information, including attendees\\' IDs and join tokens.</p>', 'CreateMeetingWithAttendeesResponse$Attendees' => '<p>The attendee information, including attendees\\' IDs and join tokens.</p>', 'ListAttendeesResponse$Attendees' => '<p>The Amazon Chime SDK attendee information.</p>', ], ], 'AudioFeatures' => [ 'base' => '<p>An optional category of meeting features that contains audio-specific configurations, such as operating parameters for Amazon Voice Focus. </p>', 'refs' => [ 'MeetingFeaturesConfiguration$Audio' => '<p>The configuration settings for the audio features available to a meeting.</p>', ], ], 'BadRequestException' => [ 'base' => '<p>The input parameters don\\'t match the service\\'s restrictions.</p>', 'refs' => [], ], 'BatchCreateAttendeeErrorList' => [ 'base' => NULL, 'refs' => [ 'BatchCreateAttendeeResponse$Errors' => '<p>If the action fails for one or more of the attendees in the request, a list of the attendees is returned, along with error codes and error messages.</p>', 'CreateMeetingWithAttendeesResponse$Errors' => '<p>If the action fails for one or more of the attendees in the request, a list of the attendees is returned, along with error codes and error messages.</p>', ], ], 'BatchCreateAttendeeRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchCreateAttendeeResponse' => [ 'base' => NULL, 'refs' => [], ], 'BatchUpdateAttendeeCapabilitiesExceptRequest' => [ 'base' => NULL, 'refs' => [], ], 'Boolean' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$EnablePartialResultsStabilization' => '<p>Enables partial result stabilization for your transcription. Partial result stabilization can reduce latency in your output, but may impact accuracy.</p>', 'EngineTranscribeSettings$IdentifyLanguage' => '<p>Enables automatic language identification for your transcription.</p> <p>If you include <code>IdentifyLanguage</code>, you can optionally use <code>LanguageOptions</code> to include a list of language codes that you think may be present in your audio stream. Including language options can improve transcription accuracy.</p> <p>You can also use <code>PreferredLanguage</code> to include a preferred language. Doing so can help Amazon Transcribe identify the language faster.</p> <p>You must include either <code>LanguageCode</code> or <code>IdentifyLanguage</code>.</p> <p>Language identification can\\'t be combined with custom language models or redaction.</p>', ], ], 'ClientRequestToken' => [ 'base' => NULL, 'refs' => [ 'CreateMeetingRequest$ClientRequestToken' => '<p>The unique identifier for the client request. Use a different token for different meetings.</p>', 'CreateMeetingWithAttendeesRequest$ClientRequestToken' => '<p>The unique identifier for the client request. Use a different token for different meetings.</p>', ], ], 'ConflictException' => [ 'base' => '<p>Multiple instances of the same request have been made simultaneously.</p>', 'refs' => [], ], 'CreateAttendeeError' => [ 'base' => '<p>The list of errors returned when errors are encountered during the BatchCreateAttendee and CreateAttendee actions. This includes external user IDs, error codes, and error messages.</p>', 'refs' => [ 'BatchCreateAttendeeErrorList$member' => NULL, ], ], 'CreateAttendeeRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateAttendeeRequestItem' => [ 'base' => '<p>The Amazon Chime SDK attendee fields to create, used with the BatchCreateAttendee action.</p>', 'refs' => [ 'CreateAttendeeRequestItemList$member' => NULL, 'CreateMeetingWithAttendeesRequestItemList$member' => NULL, ], ], 'CreateAttendeeRequestItemList' => [ 'base' => NULL, 'refs' => [ 'BatchCreateAttendeeRequest$Attendees' => '<p>The attendee information, including attendees\\' IDs and join tokens.</p>', ], ], 'CreateAttendeeResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateMeetingRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateMeetingResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateMeetingWithAttendeesRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateMeetingWithAttendeesRequestItemList' => [ 'base' => NULL, 'refs' => [ 'CreateMeetingWithAttendeesRequest$Attendees' => '<p>The attendee information, including attendees\\' IDs and join tokens.</p>', ], ], 'CreateMeetingWithAttendeesResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteAttendeeRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteMeetingRequest' => [ 'base' => NULL, 'refs' => [], ], 'EngineTranscribeMedicalSettings' => [ 'base' => '<p>Settings specific to the Amazon Transcribe Medical engine.</p>', 'refs' => [ 'TranscriptionConfiguration$EngineTranscribeMedicalSettings' => '<p>The transcription configuration settings passed to Amazon Transcribe Medical.</p>', ], ], 'EngineTranscribeSettings' => [ 'base' => '<p>Settings specific for Amazon Transcribe as the live transcription engine. </p> <p>If you specify an invalid combination of parameters, a <code>TranscriptFailed</code> event will be sent with the contents of the <code>BadRequestException</code> generated by Amazon Transcribe. For more information on each parameter and which combinations are valid, refer to the <a href=\"https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartStreamTranscription.html\">StartStreamTranscription</a> API in the <i>Amazon Transcribe Developer Guide</i>.</p>', 'refs' => [ 'TranscriptionConfiguration$EngineTranscribeSettings' => '<p>The transcription configuration settings passed to Amazon Transcribe.</p>', ], ], 'ExternalMeetingId' => [ 'base' => NULL, 'refs' => [ 'CreateMeetingRequest$ExternalMeetingId' => '<p>The external meeting ID.</p> <p>Pattern: <code>[-_&amp;@+=,(){}\\\\[\\\\]\\\\/\u00c2\u00ab\u00c2\u00bb.:|\\'\"#a-zA-Z0-9\u00c3\u20ac-\u00c3\u00bf\\\\s]*</code> </p> <p>Values that begin with <code>aws:</code> are reserved. You can\\'t configure a value that uses this prefix. Case insensitive.</p>', 'CreateMeetingWithAttendeesRequest$ExternalMeetingId' => '<p>The external meeting ID.</p> <p>Pattern: <code>[-_&amp;@+=,(){}\\\\[\\\\]\\\\/\u00c2\u00ab\u00c2\u00bb.:|\\'\"#a-zA-Z0-9\u00c3\u20ac-\u00c3\u00bf\\\\s]*</code> </p> <p>Values that begin with <code>aws:</code> are reserved. You can\\'t configure a value that uses this prefix. Case insensitive.</p>', 'Meeting$ExternalMeetingId' => '<p>The external meeting ID.</p> <p>Pattern: <code>[-_&amp;@+=,(){}\\\\[\\\\]\\\\/\u00c2\u00ab\u00c2\u00bb.:|\\'\"#a-zA-Z0-9\u00c3\u20ac-\u00c3\u00bf\\\\s]*</code> </p> <p>Values that begin with <code>aws:</code> are reserved. You can\\'t configure a value that uses this prefix. Case insensitive.</p>', ], ], 'ExternalUserId' => [ 'base' => NULL, 'refs' => [ 'Attendee$ExternalUserId' => '<p>The Amazon Chime SDK external user ID. An idempotency token. Links the attendee to an identity managed by a builder application.</p> <p>Pattern: <code>[-_&amp;@+=,(){}\\\\[\\\\]\\\\/\u00c2\u00ab\u00c2\u00bb.:|\\'\"#a-zA-Z0-9\u00c3\u20ac-\u00c3\u00bf\\\\s]*</code> </p> <p>Values that begin with <code>aws:</code> are reserved. You can\\'t configure a value that uses this prefix. Case insensitive.</p>', 'CreateAttendeeError$ExternalUserId' => '<p>The Amazon Chime SDK external user ID. An idempotency token. Links the attendee to an identity managed by a builder application.</p> <p>Pattern: <code>[-_&amp;@+=,(){}\\\\[\\\\]\\\\/\u00c2\u00ab\u00c2\u00bb.:|\\'\"#a-zA-Z0-9\u00c3\u20ac-\u00c3\u00bf\\\\s]*</code> </p> <p>Values that begin with <code>aws:</code> are reserved. You can\\'t configure a value that uses this prefix. Case insensitive.</p>', 'CreateAttendeeRequest$ExternalUserId' => '<p>The Amazon Chime SDK external user ID. An idempotency token. Links the attendee to an identity managed by a builder application.</p> <p>Pattern: <code>[-_&amp;@+=,(){}\\\\[\\\\]\\\\/\u00c2\u00ab\u00c2\u00bb.:|\\'\"#a-zA-Z0-9\u00c3\u20ac-\u00c3\u00bf\\\\s]*</code> </p> <p>Values that begin with <code>aws:</code> are reserved. You can\\'t configure a value that uses this prefix.</p>', 'CreateAttendeeRequestItem$ExternalUserId' => '<p>The Amazon Chime SDK external user ID. An idempotency token. Links the attendee to an identity managed by a builder application.</p> <p>Pattern: <code>[-_&amp;@+=,(){}\\\\[\\\\]\\\\/\u00c2\u00ab\u00c2\u00bb.:|\\'\"#a-zA-Z0-9\u00c3\u20ac-\u00c3\u00bf\\\\s]*</code> </p> <p>Values that begin with <code>aws:</code> are reserved. You can\\'t configure a value that uses this prefix. Case insensitive.</p>', 'CreateMeetingRequest$MeetingHostId' => '<p>Reserved.</p>', 'CreateMeetingWithAttendeesRequest$MeetingHostId' => '<p>Reserved.</p>', 'Meeting$MeetingHostId' => '<p>Reserved.</p>', ], ], 'ForbiddenException' => [ 'base' => '<p>The client is permanently forbidden from making the request.</p>', 'refs' => [], ], 'GetAttendeeRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetAttendeeResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetMeetingRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetMeetingResponse' => [ 'base' => NULL, 'refs' => [], ], 'GuidString' => [ 'base' => NULL, 'refs' => [ 'Attendee$AttendeeId' => '<p>The Amazon Chime SDK attendee ID.</p>', 'AttendeeIdItem$AttendeeId' => '<p>A list of one or more attendee IDs.</p>', 'BatchCreateAttendeeRequest$MeetingId' => '<p>The Amazon Chime SDK ID of the meeting to which you\\'re adding attendees.</p>', 'BatchUpdateAttendeeCapabilitiesExceptRequest$MeetingId' => '<p>The ID of the meeting associated with the update request.</p>', 'CreateAttendeeRequest$MeetingId' => '<p>The unique ID of the meeting.</p>', 'DeleteAttendeeRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'DeleteAttendeeRequest$AttendeeId' => '<p>The Amazon Chime SDK attendee ID.</p>', 'DeleteMeetingRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'GetAttendeeRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'GetAttendeeRequest$AttendeeId' => '<p>The Amazon Chime SDK attendee ID.</p>', 'GetMeetingRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'ListAttendeesRequest$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'Meeting$MeetingId' => '<p>The Amazon Chime SDK meeting ID.</p>', 'StartMeetingTranscriptionRequest$MeetingId' => '<p>The unique ID of the meeting being transcribed.</p>', 'StopMeetingTranscriptionRequest$MeetingId' => '<p>The unique ID of the meeting for which you stop transcription.</p>', 'UpdateAttendeeCapabilitiesRequest$MeetingId' => '<p>The ID of the meeting associated with the update request.</p>', 'UpdateAttendeeCapabilitiesRequest$AttendeeId' => '<p>The ID of the attendee associated with the update request.</p>', ], ], 'JoinTokenString' => [ 'base' => NULL, 'refs' => [ 'Attendee$JoinToken' => '<p>The join token used by the Amazon Chime SDK attendee.</p>', ], ], 'LimitExceededException' => [ 'base' => '<p>The request exceeds the resource limit.</p>', 'refs' => [], ], 'ListAttendeesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListAttendeesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'MediaCapabilities' => [ 'base' => NULL, 'refs' => [ 'AttendeeCapabilities$Audio' => '<p>The audio capability assigned to an attendee.</p>', 'AttendeeCapabilities$Video' => '<p>The video capability assigned to an attendee.</p>', 'AttendeeCapabilities$Content' => '<p>The content capability assigned to an attendee.</p>', ], ], 'MediaPlacement' => [ 'base' => '<p>A set of endpoints used by clients to connect to the media service group for an Amazon Chime SDK meeting.</p>', 'refs' => [ 'Meeting$MediaPlacement' => '<p>The media placement for the meeting.</p>', ], ], 'MediaRegion' => [ 'base' => NULL, 'refs' => [ 'CreateMeetingRequest$MediaRegion' => '<p>The Region in which to create the meeting.</p> <p> Available values: <code>af-south-1</code>, <code>ap-northeast-1</code>, <code>ap-northeast-2</code>, <code>ap-south-1</code>, <code>ap-southeast-1</code>, <code>ap-southeast-2</code>, <code>ca-central-1</code>, <code>eu-central-1</code>, <code>eu-north-1</code>, <code>eu-south-1</code>, <code>eu-west-1</code>, <code>eu-west-2</code>, <code>eu-west-3</code>, <code>sa-east-1</code>, <code>us-east-1</code>, <code>us-east-2</code>, <code>us-west-1</code>, <code>us-west-2</code>. </p> <p>Available values in AWS GovCloud (US) Regions: <code>us-gov-east-1</code>, <code>us-gov-west-1</code>.</p>', 'CreateMeetingWithAttendeesRequest$MediaRegion' => '<p>The Region in which to create the meeting.</p> <p> Available values: <code>af-south-1</code>, <code>ap-northeast-1</code>, <code>ap-northeast-2</code>, <code>ap-south-1</code>, <code>ap-southeast-1</code>, <code>ap-southeast-2</code>, <code>ca-central-1</code>, <code>eu-central-1</code>, <code>eu-north-1</code>, <code>eu-south-1</code>, <code>eu-west-1</code>, <code>eu-west-2</code>, <code>eu-west-3</code>, <code>sa-east-1</code>, <code>us-east-1</code>, <code>us-east-2</code>, <code>us-west-1</code>, <code>us-west-2</code>. </p> <p>Available values in AWS GovCloud (US) Regions: <code>us-gov-east-1</code>, <code>us-gov-west-1</code>.</p>', 'Meeting$MediaRegion' => '<p>The Region in which you create the meeting. Available values: <code>af-south-1</code>, <code>ap-northeast-1</code>, <code>ap-northeast-2</code>, <code>ap-south-1</code>, <code>ap-southeast-1</code>, <code>ap-southeast-2</code>, <code>ca-central-1</code>, <code>eu-central-1</code>, <code>eu-north-1</code>, <code>eu-south-1</code>, <code>eu-west-1</code>, <code>eu-west-2</code>, <code>eu-west-3</code>, <code>sa-east-1</code>, <code>us-east-1</code>, <code>us-east-2</code>, <code>us-west-1</code>, <code>us-west-2</code>.</p> <p>Available values in AWS GovCloud (US) Regions: <code>us-gov-east-1</code>, <code>us-gov-west-1</code>.</p>', ], ], 'Meeting' => [ 'base' => '<p>A meeting created using the Amazon Chime SDK.</p>', 'refs' => [ 'CreateMeetingResponse$Meeting' => '<p>The meeting information, including the meeting ID and <code>MediaPlacement</code>.</p>', 'CreateMeetingWithAttendeesResponse$Meeting' => '<p>The meeting information, including the meeting ID and <code>MediaPlacement</code>.</p>', 'GetMeetingResponse$Meeting' => '<p>The Amazon Chime SDK meeting information.</p>', ], ], 'MeetingFeatureStatus' => [ 'base' => NULL, 'refs' => [ 'AudioFeatures$EchoReduction' => '<p>Makes echo reduction available to clients who connect to the meeting.</p>', ], ], 'MeetingFeaturesConfiguration' => [ 'base' => '<p>The configuration settings of the features available to a meeting.</p>', 'refs' => [ 'CreateMeetingRequest$MeetingFeatures' => '<p>Lists the audio and video features enabled for a meeting, such as echo reduction.</p>', 'CreateMeetingWithAttendeesRequest$MeetingFeatures' => '<p>Lists the audio and video features enabled for a meeting, such as echo reduction.</p>', 'Meeting$MeetingFeatures' => '<p>The features available to a meeting, such as echo reduction.</p>', ], ], 'NotFoundException' => [ 'base' => '<p>One or more of the resources in the request does not exist in the system.</p>', 'refs' => [], ], 'NotificationsConfiguration' => [ 'base' => '<p>The configuration for resource targets to receive notifications when meeting and attendee events occur.</p>', 'refs' => [ 'CreateMeetingRequest$NotificationsConfiguration' => '<p>The configuration for resource targets to receive notifications when meeting and attendee events occur.</p>', 'CreateMeetingWithAttendeesRequest$NotificationsConfiguration' => '<p>The configuration for resource targets to receive notifications when meeting and attendee events occur.</p>', ], ], 'PrimaryMeetingId' => [ 'base' => NULL, 'refs' => [ 'CreateMeetingRequest$PrimaryMeetingId' => '<p>When specified, replicates the media from the primary meeting to the new meeting.</p>', 'CreateMeetingWithAttendeesRequest$PrimaryMeetingId' => '<p>When specified, replicates the media from the primary meeting to the new meeting.</p>', 'Meeting$PrimaryMeetingId' => '<p>When specified, replicates the media from the primary meeting to this meeting.</p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p>The resource that you want to tag couldn\\'t be found.</p>', 'refs' => [], ], 'ResultMax' => [ 'base' => NULL, 'refs' => [ 'ListAttendeesRequest$MaxResults' => '<p>The maximum number of results to return in a single call.</p>', ], ], 'RetryAfterSeconds' => [ 'base' => NULL, 'refs' => [ 'ServiceUnavailableException$RetryAfterSeconds' => '<p>The number of seconds the caller should wait before retrying.</p>', ], ], 'ServiceFailureException' => [ 'base' => '<p>The service encountered an unexpected error.</p>', 'refs' => [], ], 'ServiceUnavailableException' => [ 'base' => '<p>The service is currently unavailable.</p>', 'refs' => [], ], 'StartMeetingTranscriptionRequest' => [ 'base' => NULL, 'refs' => [], ], 'StopMeetingTranscriptionRequest' => [ 'base' => NULL, 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [ 'BadRequestException$Code' => NULL, 'BadRequestException$Message' => NULL, 'BadRequestException$RequestId' => '<p>The request id associated with the call responsible for the exception.</p>', 'ConflictException$Code' => NULL, 'ConflictException$Message' => NULL, 'ConflictException$RequestId' => '<p>The ID of the request involved in the conflict.</p>', 'CreateAttendeeError$ErrorCode' => '<p>The error code.</p>', 'CreateAttendeeError$ErrorMessage' => '<p>The error message.</p>', 'EngineTranscribeMedicalSettings$VocabularyName' => '<p>The name of the vocabulary passed to Amazon Transcribe Medical.</p>', 'EngineTranscribeSettings$VocabularyFilterName' => '<p>Specify the name of the custom vocabulary filter that you want to use when processing your transcription. Note that vocabulary filter names are case sensitive. </p> <p>If you use Amazon Transcribe in multiple Regions, the vocabulary filter must be available in Amazon Transcribe in each Region.</p> <p>If you include <code>IdentifyLanguage</code> and want to use one or more vocabulary filters with your transcription, use the <code>VocabularyFilterNames</code> parameter instead.</p>', 'EngineTranscribeSettings$VocabularyName' => '<p>Specify the name of the custom vocabulary that you want to use when processing your transcription. Note that vocabulary names are case sensitive.</p> <p>If you use Amazon Transcribe multiple Regions, the vocabulary must be available in Amazon Transcribe in each Region.</p> <p>If you include <code>IdentifyLanguage</code> and want to use one or more custom vocabularies with your transcription, use the <code>VocabularyNames</code> parameter instead.</p>', 'ForbiddenException$Code' => NULL, 'ForbiddenException$Message' => NULL, 'ForbiddenException$RequestId' => '<p>The request id associated with the call responsible for the exception.</p>', 'LimitExceededException$Code' => NULL, 'LimitExceededException$Message' => NULL, 'LimitExceededException$RequestId' => '<p>The request id associated with the call responsible for the exception.</p>', 'ListAttendeesRequest$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'ListAttendeesResponse$NextToken' => '<p>The token to use to retrieve the next page of results.</p>', 'MediaPlacement$AudioHostUrl' => '<p>The audio host URL.</p>', 'MediaPlacement$AudioFallbackUrl' => '<p>The audio fallback URL.</p>', 'MediaPlacement$SignalingUrl' => '<p>The signaling URL.</p>', 'MediaPlacement$TurnControlUrl' => '<p>The turn control URL.</p>', 'MediaPlacement$ScreenDataUrl' => '<p>The screen data URL.</p>', 'MediaPlacement$ScreenViewingUrl' => '<p>The screen viewing URL.</p>', 'MediaPlacement$ScreenSharingUrl' => '<p>The screen sharing URL.</p>', 'MediaPlacement$EventIngestionUrl' => '<p>The event ingestion URL.</p>', 'NotFoundException$Code' => NULL, 'NotFoundException$Message' => NULL, 'NotFoundException$RequestId' => '<p>The request ID associated with the call responsible for the exception.</p>', 'ResourceNotFoundException$Code' => NULL, 'ResourceNotFoundException$Message' => NULL, 'ResourceNotFoundException$RequestId' => '<p>The ID of the resource that couldn\\'t be found.</p>', 'ServiceFailureException$Code' => NULL, 'ServiceFailureException$Message' => NULL, 'ServiceFailureException$RequestId' => '<p>The ID of the failed request.</p>', 'ServiceUnavailableException$Code' => NULL, 'ServiceUnavailableException$Message' => NULL, 'ServiceUnavailableException$RequestId' => '<p>The request id associated with the call responsible for the exception.</p>', 'ThrottlingException$Code' => NULL, 'ThrottlingException$Message' => NULL, 'ThrottlingException$RequestId' => '<p>The ID of the request that exceeded the throttling limit.</p>', 'TooManyTagsException$Code' => NULL, 'TooManyTagsException$Message' => NULL, 'TooManyTagsException$RequestId' => '<p>The ID of the request that contains too many tags.</p>', 'UnauthorizedException$Code' => NULL, 'UnauthorizedException$Message' => NULL, 'UnauthorizedException$RequestId' => '<p>The request id associated with the call responsible for the exception.</p>', 'UnprocessableEntityException$Code' => NULL, 'UnprocessableEntityException$Message' => NULL, 'UnprocessableEntityException$RequestId' => '<p>The request id associated with the call responsible for the exception.</p>', ], ], 'Tag' => [ 'base' => '<p>A key-value pair that you define.</p>', 'refs' => [ 'TagList$member' => NULL, ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'Tag$Key' => '<p>The tag\\'s key.</p>', 'TagKeyList$member' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$TagKeys' => '<p>The tag keys being removed from the resources.</p>', ], ], 'TagList' => [ 'base' => NULL, 'refs' => [ 'CreateMeetingRequest$Tags' => '<p>Applies one or more tags to an Amazon Chime SDK meeting. Note the following:</p> <ul> <li> <p>Not all resources have tags. For a list of services with resources that support tagging using this operation, see <a href=\"https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/supported-services.html\">Services that support the Resource Groups Tagging API</a>. If the resource doesn\\'t yet support this operation, the resource\\'s service might support tagging using its own API operations. For more information, refer to the documentation for that service.</p> </li> <li> <p>Each resource can have up to 50 tags. For other limits, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html#tag-conventions\">Tag Naming and Usage Conventions</a> in the <i>AWS General Reference</i>.</p> </li> <li> <p>You can only tag resources that are located in the specified AWS Region for the AWS account.</p> </li> <li> <p>To add tags to a resource, you need the necessary permissions for the service that the resource belongs to as well as permissions for adding tags. For more information, see the documentation for each service.</p> </li> </ul> <important> <p>Do not store personally identifiable information (PII) or other confidential or sensitive information in tags. We use tags to provide you with billing and administration services. Tags are not intended to be used for private or sensitive data.</p> </important> <p> <b>Minimum permissions</b> </p> <p>In addition to the <code>tag:TagResources</code> permission required by this operation, you must also have the tagging permission defined by the service that created the resource. For example, to tag a <code>ChimeSDKMeetings</code> instance using the <code>TagResources</code> operation, you must have both of the following permissions:</p> <p> <code>tag:TagResources</code> </p> <p> <code>ChimeSDKMeetings:CreateTags</code> </p> <note> <p>Some services might have specific requirements for tagging some resources. For example, to tag an Amazon S3 bucket, you must also have the <code>s3:GetBucketTagging</code> permission. If the expected minimum permissions don\\'t work, check the documentation for that service\\'s tagging APIs for more information.</p> </note>', 'CreateMeetingWithAttendeesRequest$Tags' => '<p>The tags in the request.</p>', 'ListTagsForResourceResponse$Tags' => '<p>The tags requested for the specified resource.</p>', 'TagResourceRequest$Tags' => '<p>Lists the requested tags.</p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'Tag$Value' => '<p>The tag\\'s value.</p>', ], ], 'TenantId' => [ 'base' => NULL, 'refs' => [ 'TenantIdList$member' => NULL, ], ], 'TenantIdList' => [ 'base' => NULL, 'refs' => [ 'CreateMeetingRequest$TenantIds' => '<p>A consistent and opaque identifier, created and maintained by the builder to represent a segment of their users.</p>', 'CreateMeetingWithAttendeesRequest$TenantIds' => '<p>A consistent and opaque identifier, created and maintained by the builder to represent a segment of their users.</p>', 'Meeting$TenantIds' => '<p>Array of strings.</p>', ], ], 'ThrottlingException' => [ 'base' => '<p>The number of customer requests exceeds the request rate limit.</p>', 'refs' => [], ], 'TooManyTagsException' => [ 'base' => '<p>Too many tags were added to the specified resource.</p>', 'refs' => [], ], 'TranscribeContentIdentificationType' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$ContentIdentificationType' => '<p>Labels all personally identifiable information (PII) identified in your transcript. If you don\\'t include <code>PiiEntityTypes</code>, all PII is identified.</p> <note> <p>You can\u00e2\u20ac\u2122t set <code>ContentIdentificationType</code> and <code>ContentRedactionType</code>.</p> </note>', ], ], 'TranscribeContentRedactionType' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$ContentRedactionType' => '<p>Content redaction is performed at the segment level. If you don\\'t include <code>PiiEntityTypes</code>, all PII is redacted.</p> <note> <p>You can\u00e2\u20ac\u2122t set <code>ContentRedactionType</code> and <code>ContentIdentificationType</code>.</p> </note>', ], ], 'TranscribeLanguageCode' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$LanguageCode' => '<p>Specify the language code that represents the language spoken.</p> <p>If you\\'re unsure of the language spoken in your audio, consider using <code>IdentifyLanguage</code> to enable automatic language identification.</p>', 'EngineTranscribeSettings$PreferredLanguage' => '<p>Specify a preferred language from the subset of languages codes you specified in <code>LanguageOptions</code>.</p> <p>You can only use this parameter if you include <code>IdentifyLanguage</code> and <code>LanguageOptions</code>.</p>', ], ], 'TranscribeLanguageModelName' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$LanguageModelName' => '<p>Specify the name of the custom language model that you want to use when processing your transcription. Note that language model names are case sensitive.</p> <p>The language of the specified language model must match the language code. If the languages don\\'t match, the custom language model isn\\'t applied. There are no errors or warnings associated with a language mismatch.</p> <p>If you use Amazon Transcribe in multiple Regions, the custom language model must be available in Amazon Transcribe in each Region.</p>', ], ], 'TranscribeLanguageOptions' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$LanguageOptions' => '<p>Specify two or more language codes that represent the languages you think may be present in your media; including more than five is not recommended. If you\\'re unsure what languages are present, do not include this parameter.</p> <p>Including language options can improve the accuracy of language identification.</p> <p>If you include <code>LanguageOptions</code>, you must also include <code>IdentifyLanguage</code>.</p> <important> <p>You can only include one language dialect per language. For example, you cannot include <code>en-US</code> and <code>en-AU</code>.</p> </important>', ], ], 'TranscribeMedicalContentIdentificationType' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeMedicalSettings$ContentIdentificationType' => '<p>Set this field to <code>PHI</code> to identify personal health information in the transcription output.</p>', ], ], 'TranscribeMedicalLanguageCode' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeMedicalSettings$LanguageCode' => '<p>The language code specified for the Amazon Transcribe Medical engine.</p>', ], ], 'TranscribeMedicalRegion' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeMedicalSettings$Region' => '<p>The AWS Region passed to Amazon Transcribe Medical. If you don\\'t specify a Region, Amazon Chime uses the meeting\\'s Region. </p>', ], ], 'TranscribeMedicalSpecialty' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeMedicalSettings$Specialty' => '<p>The specialty specified for the Amazon Transcribe Medical engine.</p>', ], ], 'TranscribeMedicalType' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeMedicalSettings$Type' => '<p>The type of transcription.</p>', ], ], 'TranscribePartialResultsStability' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$PartialResultsStability' => '<p>Specify the level of stability to use when you enable partial results stabilization (<code>EnablePartialResultsStabilization</code>).</p> <p>Low stability provides the highest accuracy. High stability transcribes faster, but with slightly lower accuracy.</p>', ], ], 'TranscribePiiEntityTypes' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$PiiEntityTypes' => '<p>Specify which types of personally identifiable information (PII) you want to redact in your transcript. You can include as many types as you\\'d like, or you can select <code>ALL</code>.</p> <p>Values must be comma-separated and can include: <code>ADDRESS</code>, <code>BANK_ACCOUNT_NUMBER</code>, <code>BANK_ROUTING</code>, <code>CREDIT_DEBIT_CVV</code>, <code>CREDIT_DEBIT_EXPIRY</code> <code>CREDIT_DEBIT_NUMBER</code>, <code>EMAIL</code>,<code>NAME</code>, <code>PHONE</code>, <code>PIN</code>, <code>SSN</code>, or <code>ALL</code>.</p> <p>Note that if you include <code>PiiEntityTypes</code>, you must also include <code>ContentIdentificationType</code> or <code>ContentRedactionType</code>.</p> <p>If you include <code>ContentRedactionType</code> or <code>ContentIdentificationType</code>, but do not include PiiEntityTypes, all PII is redacted or identified.</p>', ], ], 'TranscribeRegion' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$Region' => '<p>The AWS Region in which to use Amazon Transcribe.</p> <p>If you don\\'t specify a Region, then the <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_CreateMeeting.html\">MediaRegion</a> of the meeting is used. However, if Amazon Transcribe is not available in the <code>MediaRegion</code>, then a <code>TranscriptFailed</code> event is sent.</p> <p>Use <code>auto</code> to use Amazon Transcribe in a Region near the meeting\u00e2\u20ac\u2122s <code>MediaRegion</code>. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/transcription-options.html#choose-region\">Choosing a transcription Region</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p>', ], ], 'TranscribeVocabularyFilterMethod' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$VocabularyFilterMethod' => '<p>Specify how you want your vocabulary filter applied to your transcript.</p> <p>To replace words with <code>***</code>, choose <code>mask</code>.</p> <p>To delete words, choose <code>remove</code>.</p> <p>To flag words without changing them, choose <code>tag</code>.</p>', ], ], 'TranscribeVocabularyNamesOrFilterNamesString' => [ 'base' => NULL, 'refs' => [ 'EngineTranscribeSettings$VocabularyNames' => '<p>Specify the names of the custom vocabularies that you want to use when processing your transcription. Note that vocabulary names are case sensitive.</p> <p>If you use Amazon Transcribe in multiple Regions, the vocabulary must be available in Amazon Transcribe in each Region.</p> <p>If you don\\'t include <code>IdentifyLanguage</code> and want to use a custom vocabulary with your transcription, use the <code>VocabularyName</code> parameter instead.</p>', 'EngineTranscribeSettings$VocabularyFilterNames' => '<p>Specify the names of the custom vocabulary filters that you want to use when processing your transcription. Note that vocabulary filter names are case sensitive.</p> <p>If you use Amazon Transcribe in multiple Regions, the vocabulary filter must be available in Amazon Transcribe in each Region.</p> <p> If you\\'re <i>not</i> including <code>IdentifyLanguage</code> and want to use a custom vocabulary filter with your transcription, use the <code>VocabularyFilterName</code> parameter instead.</p>', ], ], 'TranscriptionConfiguration' => [ 'base' => '<p>The configuration for the current transcription operation. Must contain <code>EngineTranscribeSettings</code> or <code>EngineTranscribeMedicalSettings</code>.</p>', 'refs' => [ 'StartMeetingTranscriptionRequest$TranscriptionConfiguration' => '<p>The configuration for the current transcription operation. Must contain <code>EngineTranscribeSettings</code> or <code>EngineTranscribeMedicalSettings</code>.</p>', ], ], 'UnauthorizedException' => [ 'base' => '<p>The user isn\\'t authorized to request a resource.</p>', 'refs' => [], ], 'UnprocessableEntityException' => [ 'base' => '<p>The request was well-formed but was unable to be followed due to semantic errors.</p>', 'refs' => [], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAttendeeCapabilitiesRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateAttendeeCapabilitiesResponse' => [ 'base' => NULL, 'refs' => [], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-meetings/2021-07-15/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://meetings-chime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://meetings-chime-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://meetings-chime.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://meetings-chime.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-meetings/2021-07-15/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime-fips.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://meetings-chime.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-meetings/2021-07-15/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-meetings/2021-07-15/paginators-1.json\nreturn [ 'pagination' => [ 'ListAttendees' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-messaging/2021-05-15/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2021-05-15', 'endpointPrefix' => 'messaging-chime', 'protocol' => 'rest-json', 'serviceFullName' => 'Amazon Chime SDK Messaging', 'serviceId' => 'Chime SDK Messaging', 'signatureVersion' => 'v4', 'signingName' => 'chime', 'uid' => 'chime-sdk-messaging-2021-05-15', ], 'operations' => [ 'AssociateChannelFlow' => [ 'name' => 'AssociateChannelFlow', 'http' => [ 'method' => 'PUT', 'requestUri' => '/channels/{channelArn}/channel-flow', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AssociateChannelFlowRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'BatchCreateChannelMembership' => [ 'name' => 'BatchCreateChannelMembership', 'http' => [ 'method' => 'POST', 'requestUri' => '/channels/{channelArn}/memberships?operation=batch-create', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchCreateChannelMembershipRequest', ], 'output' => [ 'shape' => 'BatchCreateChannelMembershipResponse', ], 'errors' => [ [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], ], ], 'ChannelFlowCallback' => [ 'name' => 'ChannelFlowCallback', 'http' => [ 'method' => 'POST', 'requestUri' => '/channels/{channelArn}?operation=channel-flow-callback', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ChannelFlowCallbackRequest', ], 'output' => [ 'shape' => 'ChannelFlowCallbackResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateChannel' => [ 'name' => 'CreateChannel', 'http' => [ 'method' => 'POST', 'requestUri' => '/channels', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateChannelRequest', ], 'output' => [ 'shape' => 'CreateChannelResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateChannelBan' => [ 'name' => 'CreateChannelBan', 'http' => [ 'method' => 'POST', 'requestUri' => '/channels/{channelArn}/bans', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateChannelBanRequest', ], 'output' => [ 'shape' => 'CreateChannelBanResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateChannelFlow' => [ 'name' => 'CreateChannelFlow', 'http' => [ 'method' => 'POST', 'requestUri' => '/channel-flows', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateChannelFlowRequest', ], 'output' => [ 'shape' => 'CreateChannelFlowResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateChannelMembership' => [ 'name' => 'CreateChannelMembership', 'http' => [ 'method' => 'POST', 'requestUri' => '/channels/{channelArn}/memberships', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateChannelMembershipRequest', ], 'output' => [ 'shape' => 'CreateChannelMembershipResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateChannelModerator' => [ 'name' => 'CreateChannelModerator', 'http' => [ 'method' => 'POST', 'requestUri' => '/channels/{channelArn}/moderators', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateChannelModeratorRequest', ], 'output' => [ 'shape' => 'CreateChannelModeratorResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteChannel' => [ 'name' => 'DeleteChannel', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/channels/{channelArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteChannelRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteChannelBan' => [ 'name' => 'DeleteChannelBan', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/channels/{channelArn}/bans/{memberArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteChannelBanRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteChannelFlow' => [ 'name' => 'DeleteChannelFlow', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/channel-flows/{channelFlowArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteChannelFlowRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteChannelMembership' => [ 'name' => 'DeleteChannelMembership', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/channels/{channelArn}/memberships/{memberArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteChannelMembershipRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteChannelMessage' => [ 'name' => 'DeleteChannelMessage', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/channels/{channelArn}/messages/{messageId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteChannelMessageRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteChannelModerator' => [ 'name' => 'DeleteChannelModerator', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/channels/{channelArn}/moderators/{channelModeratorArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteChannelModeratorRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteMessagingStreamingConfigurations' => [ 'name' => 'DeleteMessagingStreamingConfigurations', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/app-instances/{appInstanceArn}/streaming-configurations', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteMessagingStreamingConfigurationsRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DescribeChannel' => [ 'name' => 'DescribeChannel', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeChannelRequest', ], 'output' => [ 'shape' => 'DescribeChannelResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DescribeChannelBan' => [ 'name' => 'DescribeChannelBan', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/bans/{memberArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeChannelBanRequest', ], 'output' => [ 'shape' => 'DescribeChannelBanResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DescribeChannelFlow' => [ 'name' => 'DescribeChannelFlow', 'http' => [ 'method' => 'GET', 'requestUri' => '/channel-flows/{channelFlowArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeChannelFlowRequest', ], 'output' => [ 'shape' => 'DescribeChannelFlowResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DescribeChannelMembership' => [ 'name' => 'DescribeChannelMembership', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/memberships/{memberArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeChannelMembershipRequest', ], 'output' => [ 'shape' => 'DescribeChannelMembershipResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DescribeChannelMembershipForAppInstanceUser' => [ 'name' => 'DescribeChannelMembershipForAppInstanceUser', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}?scope=app-instance-user-membership', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeChannelMembershipForAppInstanceUserRequest', ], 'output' => [ 'shape' => 'DescribeChannelMembershipForAppInstanceUserResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DescribeChannelModeratedByAppInstanceUser' => [ 'name' => 'DescribeChannelModeratedByAppInstanceUser', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}?scope=app-instance-user-moderated-channel', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeChannelModeratedByAppInstanceUserRequest', ], 'output' => [ 'shape' => 'DescribeChannelModeratedByAppInstanceUserResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DescribeChannelModerator' => [ 'name' => 'DescribeChannelModerator', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/moderators/{channelModeratorArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DescribeChannelModeratorRequest', ], 'output' => [ 'shape' => 'DescribeChannelModeratorResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DisassociateChannelFlow' => [ 'name' => 'DisassociateChannelFlow', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/channels/{channelArn}/channel-flow/{channelFlowArn}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DisassociateChannelFlowRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetChannelMembershipPreferences' => [ 'name' => 'GetChannelMembershipPreferences', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/memberships/{memberArn}/preferences', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetChannelMembershipPreferencesRequest', ], 'output' => [ 'shape' => 'GetChannelMembershipPreferencesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetChannelMessage' => [ 'name' => 'GetChannelMessage', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/messages/{messageId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetChannelMessageRequest', ], 'output' => [ 'shape' => 'GetChannelMessageResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetChannelMessageStatus' => [ 'name' => 'GetChannelMessageStatus', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/messages/{messageId}?scope=message-status', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetChannelMessageStatusRequest', ], 'output' => [ 'shape' => 'GetChannelMessageStatusResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetMessagingSessionEndpoint' => [ 'name' => 'GetMessagingSessionEndpoint', 'http' => [ 'method' => 'GET', 'requestUri' => '/endpoints/messaging-session', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetMessagingSessionEndpointRequest', ], 'output' => [ 'shape' => 'GetMessagingSessionEndpointResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetMessagingStreamingConfigurations' => [ 'name' => 'GetMessagingStreamingConfigurations', 'http' => [ 'method' => 'GET', 'requestUri' => '/app-instances/{appInstanceArn}/streaming-configurations', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetMessagingStreamingConfigurationsRequest', ], 'output' => [ 'shape' => 'GetMessagingStreamingConfigurationsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListChannelBans' => [ 'name' => 'ListChannelBans', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/bans', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListChannelBansRequest', ], 'output' => [ 'shape' => 'ListChannelBansResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListChannelFlows' => [ 'name' => 'ListChannelFlows', 'http' => [ 'method' => 'GET', 'requestUri' => '/channel-flows', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListChannelFlowsRequest', ], 'output' => [ 'shape' => 'ListChannelFlowsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListChannelMemberships' => [ 'name' => 'ListChannelMemberships', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/memberships', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListChannelMembershipsRequest', ], 'output' => [ 'shape' => 'ListChannelMembershipsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListChannelMembershipsForAppInstanceUser' => [ 'name' => 'ListChannelMembershipsForAppInstanceUser', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels?scope=app-instance-user-memberships', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListChannelMembershipsForAppInstanceUserRequest', ], 'output' => [ 'shape' => 'ListChannelMembershipsForAppInstanceUserResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListChannelMessages' => [ 'name' => 'ListChannelMessages', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/messages', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListChannelMessagesRequest', ], 'output' => [ 'shape' => 'ListChannelMessagesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListChannelModerators' => [ 'name' => 'ListChannelModerators', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/moderators', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListChannelModeratorsRequest', ], 'output' => [ 'shape' => 'ListChannelModeratorsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListChannels' => [ 'name' => 'ListChannels', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListChannelsRequest', ], 'output' => [ 'shape' => 'ListChannelsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListChannelsAssociatedWithChannelFlow' => [ 'name' => 'ListChannelsAssociatedWithChannelFlow', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels?scope=channel-flow-associations', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListChannelsAssociatedWithChannelFlowRequest', ], 'output' => [ 'shape' => 'ListChannelsAssociatedWithChannelFlowResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListChannelsModeratedByAppInstanceUser' => [ 'name' => 'ListChannelsModeratedByAppInstanceUser', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels?scope=app-instance-user-moderated-channels', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListChannelsModeratedByAppInstanceUserRequest', ], 'output' => [ 'shape' => 'ListChannelsModeratedByAppInstanceUserResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListSubChannels' => [ 'name' => 'ListSubChannels', 'http' => [ 'method' => 'GET', 'requestUri' => '/channels/{channelArn}/subchannels', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListSubChannelsRequest', ], 'output' => [ 'shape' => 'ListSubChannelsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'PutChannelExpirationSettings' => [ 'name' => 'PutChannelExpirationSettings', 'http' => [ 'method' => 'PUT', 'requestUri' => '/channels/{channelArn}/expiration-settings', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutChannelExpirationSettingsRequest', ], 'output' => [ 'shape' => 'PutChannelExpirationSettingsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'PutChannelMembershipPreferences' => [ 'name' => 'PutChannelMembershipPreferences', 'http' => [ 'method' => 'PUT', 'requestUri' => '/channels/{channelArn}/memberships/{memberArn}/preferences', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutChannelMembershipPreferencesRequest', ], 'output' => [ 'shape' => 'PutChannelMembershipPreferencesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'PutMessagingStreamingConfigurations' => [ 'name' => 'PutMessagingStreamingConfigurations', 'http' => [ 'method' => 'PUT', 'requestUri' => '/app-instances/{appInstanceArn}/streaming-configurations', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutMessagingStreamingConfigurationsRequest', ], 'output' => [ 'shape' => 'PutMessagingStreamingConfigurationsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'RedactChannelMessage' => [ 'name' => 'RedactChannelMessage', 'http' => [ 'method' => 'POST', 'requestUri' => '/channels/{channelArn}/messages/{messageId}?operation=redact', 'responseCode' => 200, ], 'input' => [ 'shape' => 'RedactChannelMessageRequest', ], 'output' => [ 'shape' => 'RedactChannelMessageResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'SearchChannels' => [ 'name' => 'SearchChannels', 'http' => [ 'method' => 'POST', 'requestUri' => '/channels?operation=search', 'responseCode' => 200, ], 'input' => [ 'shape' => 'SearchChannelsRequest', ], 'output' => [ 'shape' => 'SearchChannelsResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'SendChannelMessage' => [ 'name' => 'SendChannelMessage', 'http' => [ 'method' => 'POST', 'requestUri' => '/channels/{channelArn}/messages', 'responseCode' => 201, ], 'input' => [ 'shape' => 'SendChannelMessageRequest', ], 'output' => [ 'shape' => 'SendChannelMessageResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags?operation=tag-resource', 'responseCode' => 204, ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags?operation=untag-resource', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateChannel' => [ 'name' => 'UpdateChannel', 'http' => [ 'method' => 'PUT', 'requestUri' => '/channels/{channelArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateChannelRequest', ], 'output' => [ 'shape' => 'UpdateChannelResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateChannelFlow' => [ 'name' => 'UpdateChannelFlow', 'http' => [ 'method' => 'PUT', 'requestUri' => '/channel-flows/{channelFlowArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateChannelFlowRequest', ], 'output' => [ 'shape' => 'UpdateChannelFlowResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateChannelMessage' => [ 'name' => 'UpdateChannelMessage', 'http' => [ 'method' => 'PUT', 'requestUri' => '/channels/{channelArn}/messages/{messageId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateChannelMessageRequest', ], 'output' => [ 'shape' => 'UpdateChannelMessageResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateChannelReadMarker' => [ 'name' => 'UpdateChannelReadMarker', 'http' => [ 'method' => 'PUT', 'requestUri' => '/channels/{channelArn}/readMarker', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateChannelReadMarkerRequest', ], 'output' => [ 'shape' => 'UpdateChannelReadMarkerResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], ], 'shapes' => [ 'AllowNotifications' => [ 'type' => 'string', 'enum' => [ 'ALL', 'NONE', 'FILTERED', ], ], 'AppInstanceUserMembershipSummary' => [ 'type' => 'structure', 'members' => [ 'Type' => [ 'shape' => 'ChannelMembershipType', ], 'ReadMarkerTimestamp' => [ 'shape' => 'Timestamp', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', ], ], ], 'AssociateChannelFlowRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChannelFlowArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'ChannelFlowArn' => [ 'shape' => 'ChimeArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'BatchChannelMemberships' => [ 'type' => 'structure', 'members' => [ 'InvitedBy' => [ 'shape' => 'Identity', ], 'Type' => [ 'shape' => 'ChannelMembershipType', ], 'Members' => [ 'shape' => 'Members', ], 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', ], ], ], 'BatchCreateChannelMembershipError' => [ 'type' => 'structure', 'members' => [ 'MemberArn' => [ 'shape' => 'ChimeArn', ], 'ErrorCode' => [ 'shape' => 'ErrorCode', ], 'ErrorMessage' => [ 'shape' => 'String', ], ], ], 'BatchCreateChannelMembershipErrors' => [ 'type' => 'list', 'member' => [ 'shape' => 'BatchCreateChannelMembershipError', ], ], 'BatchCreateChannelMembershipRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MemberArns', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'Type' => [ 'shape' => 'ChannelMembershipType', ], 'MemberArns' => [ 'shape' => 'MemberArns', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', ], ], ], 'BatchCreateChannelMembershipResponse' => [ 'type' => 'structure', 'members' => [ 'BatchChannelMemberships' => [ 'shape' => 'BatchChannelMemberships', ], 'Errors' => [ 'shape' => 'BatchCreateChannelMembershipErrors', ], ], ], 'CallbackIdType' => [ 'type' => 'string', 'max' => 64, 'min' => 32, ], 'Channel' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'Mode' => [ 'shape' => 'ChannelMode', ], 'Privacy' => [ 'shape' => 'ChannelPrivacy', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'CreatedBy' => [ 'shape' => 'Identity', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastMessageTimestamp' => [ 'shape' => 'Timestamp', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], 'ChannelFlowArn' => [ 'shape' => 'ChimeArn', ], 'ElasticChannelConfiguration' => [ 'shape' => 'ElasticChannelConfiguration', ], 'ExpirationSettings' => [ 'shape' => 'ExpirationSettings', ], ], ], 'ChannelAssociatedWithFlowSummary' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'Mode' => [ 'shape' => 'ChannelMode', ], 'Privacy' => [ 'shape' => 'ChannelPrivacy', ], 'Metadata' => [ 'shape' => 'Metadata', ], ], ], 'ChannelAssociatedWithFlowSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelAssociatedWithFlowSummary', ], ], 'ChannelBan' => [ 'type' => 'structure', 'members' => [ 'Member' => [ 'shape' => 'Identity', ], 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'CreatedBy' => [ 'shape' => 'Identity', ], ], ], 'ChannelBanSummary' => [ 'type' => 'structure', 'members' => [ 'Member' => [ 'shape' => 'Identity', ], ], ], 'ChannelBanSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelBanSummary', ], ], 'ChannelFlow' => [ 'type' => 'structure', 'members' => [ 'ChannelFlowArn' => [ 'shape' => 'ChimeArn', ], 'Processors' => [ 'shape' => 'ProcessorList', ], 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'ChannelFlowCallbackRequest' => [ 'type' => 'structure', 'required' => [ 'CallbackId', 'ChannelArn', 'ChannelMessage', ], 'members' => [ 'CallbackId' => [ 'shape' => 'CallbackIdType', 'idempotencyToken' => true, ], 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'DeleteResource' => [ 'shape' => 'NonNullableBoolean', ], 'ChannelMessage' => [ 'shape' => 'ChannelMessageCallback', ], ], ], 'ChannelFlowCallbackResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'CallbackId' => [ 'shape' => 'CallbackIdType', ], ], ], 'ChannelFlowExecutionOrder' => [ 'type' => 'integer', 'max' => 3, 'min' => 1, ], 'ChannelFlowSummary' => [ 'type' => 'structure', 'members' => [ 'ChannelFlowArn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'Processors' => [ 'shape' => 'ProcessorList', ], ], ], 'ChannelFlowSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelFlowSummary', ], ], 'ChannelId' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '[A-Za-z0-9]([A-Za-z0-9\\\\:\\\\-\\\\_\\\\.\\\\@]{0,62}[A-Za-z0-9])?', 'sensitive' => true, ], 'ChannelMemberArns' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChimeArn', ], 'max' => 10, 'min' => 1, ], 'ChannelMembership' => [ 'type' => 'structure', 'members' => [ 'InvitedBy' => [ 'shape' => 'Identity', ], 'Type' => [ 'shape' => 'ChannelMembershipType', ], 'Member' => [ 'shape' => 'Identity', ], 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', ], ], ], 'ChannelMembershipForAppInstanceUserSummary' => [ 'type' => 'structure', 'members' => [ 'ChannelSummary' => [ 'shape' => 'ChannelSummary', ], 'AppInstanceUserMembershipSummary' => [ 'shape' => 'AppInstanceUserMembershipSummary', ], ], ], 'ChannelMembershipForAppInstanceUserSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelMembershipForAppInstanceUserSummary', ], ], 'ChannelMembershipPreferences' => [ 'type' => 'structure', 'members' => [ 'PushNotifications' => [ 'shape' => 'PushNotificationPreferences', ], ], ], 'ChannelMembershipSummary' => [ 'type' => 'structure', 'members' => [ 'Member' => [ 'shape' => 'Identity', ], ], ], 'ChannelMembershipSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelMembershipSummary', ], ], 'ChannelMembershipType' => [ 'type' => 'string', 'enum' => [ 'DEFAULT', 'HIDDEN', ], ], 'ChannelMessage' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'MessageId' => [ 'shape' => 'MessageId', ], 'Content' => [ 'shape' => 'Content', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'Type' => [ 'shape' => 'ChannelMessageType', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastEditedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], 'Sender' => [ 'shape' => 'Identity', ], 'Redacted' => [ 'shape' => 'NonNullableBoolean', ], 'Persistence' => [ 'shape' => 'ChannelMessagePersistenceType', ], 'Status' => [ 'shape' => 'ChannelMessageStatusStructure', ], 'MessageAttributes' => [ 'shape' => 'MessageAttributeMap', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', ], 'ContentType' => [ 'shape' => 'ContentType', ], 'Target' => [ 'shape' => 'TargetList', ], ], ], 'ChannelMessageCallback' => [ 'type' => 'structure', 'required' => [ 'MessageId', ], 'members' => [ 'MessageId' => [ 'shape' => 'MessageId', ], 'Content' => [ 'shape' => 'NonEmptyContent', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'PushNotification' => [ 'shape' => 'PushNotificationConfiguration', ], 'MessageAttributes' => [ 'shape' => 'MessageAttributeMap', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', ], 'ContentType' => [ 'shape' => 'ContentType', ], ], ], 'ChannelMessagePersistenceType' => [ 'type' => 'string', 'enum' => [ 'PERSISTENT', 'NON_PERSISTENT', ], ], 'ChannelMessageStatus' => [ 'type' => 'string', 'enum' => [ 'SENT', 'PENDING', 'FAILED', 'DENIED', ], ], 'ChannelMessageStatusStructure' => [ 'type' => 'structure', 'members' => [ 'Value' => [ 'shape' => 'ChannelMessageStatus', ], 'Detail' => [ 'shape' => 'StatusDetail', ], ], ], 'ChannelMessageSummary' => [ 'type' => 'structure', 'members' => [ 'MessageId' => [ 'shape' => 'MessageId', ], 'Content' => [ 'shape' => 'Content', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'Type' => [ 'shape' => 'ChannelMessageType', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], 'LastEditedTimestamp' => [ 'shape' => 'Timestamp', ], 'Sender' => [ 'shape' => 'Identity', ], 'Redacted' => [ 'shape' => 'NonNullableBoolean', ], 'Status' => [ 'shape' => 'ChannelMessageStatusStructure', ], 'MessageAttributes' => [ 'shape' => 'MessageAttributeMap', ], 'ContentType' => [ 'shape' => 'ContentType', ], 'Target' => [ 'shape' => 'TargetList', ], ], ], 'ChannelMessageSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelMessageSummary', ], ], 'ChannelMessageType' => [ 'type' => 'string', 'enum' => [ 'STANDARD', 'CONTROL', ], ], 'ChannelMode' => [ 'type' => 'string', 'enum' => [ 'UNRESTRICTED', 'RESTRICTED', ], ], 'ChannelModeratedByAppInstanceUserSummary' => [ 'type' => 'structure', 'members' => [ 'ChannelSummary' => [ 'shape' => 'ChannelSummary', ], ], ], 'ChannelModeratedByAppInstanceUserSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelModeratedByAppInstanceUserSummary', ], ], 'ChannelModerator' => [ 'type' => 'structure', 'members' => [ 'Moderator' => [ 'shape' => 'Identity', ], 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'CreatedTimestamp' => [ 'shape' => 'Timestamp', ], 'CreatedBy' => [ 'shape' => 'Identity', ], ], ], 'ChannelModeratorArns' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChimeArn', ], 'max' => 10, 'min' => 1, ], 'ChannelModeratorSummary' => [ 'type' => 'structure', 'members' => [ 'Moderator' => [ 'shape' => 'Identity', ], ], ], 'ChannelModeratorSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelModeratorSummary', ], ], 'ChannelPrivacy' => [ 'type' => 'string', 'enum' => [ 'PUBLIC', 'PRIVATE', ], ], 'ChannelSummary' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'Mode' => [ 'shape' => 'ChannelMode', ], 'Privacy' => [ 'shape' => 'ChannelPrivacy', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'LastMessageTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'ChannelSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChannelSummary', ], ], 'ChimeArn' => [ 'type' => 'string', 'max' => 1600, 'min' => 5, 'pattern' => 'arn:[a-z0-9-\\\\.]{1,63}:[a-z0-9-\\\\.]{0,63}:[a-z0-9-\\\\.]{0,63}:[a-z0-9-\\\\.]{0,63}:[^/].{0,1023}', ], 'ClientRequestToken' => [ 'type' => 'string', 'max' => 64, 'min' => 2, 'pattern' => '[-_a-zA-Z0-9]*', 'sensitive' => true, ], 'ConflictException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'Content' => [ 'type' => 'string', 'max' => 4096, 'min' => 0, 'pattern' => '[\\\\s\\\\S]*', 'sensitive' => true, ], 'ContentType' => [ 'type' => 'string', 'max' => 45, 'min' => 0, 'pattern' => '[\\\\s\\\\S]*', 'sensitive' => true, ], 'CreateChannelBanRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MemberArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MemberArn' => [ 'shape' => 'ChimeArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'CreateChannelBanResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'Member' => [ 'shape' => 'Identity', ], ], ], 'CreateChannelFlowRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', 'Processors', 'Name', 'ClientRequestToken', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'Processors' => [ 'shape' => 'ProcessorList', ], 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'Tags' => [ 'shape' => 'TagList', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], ], ], 'CreateChannelFlowResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelFlowArn' => [ 'shape' => 'ChimeArn', ], ], ], 'CreateChannelMembershipRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MemberArn', 'Type', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MemberArn' => [ 'shape' => 'ChimeArn', ], 'Type' => [ 'shape' => 'ChannelMembershipType', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', ], ], ], 'CreateChannelMembershipResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'Member' => [ 'shape' => 'Identity', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', ], ], ], 'CreateChannelModeratorRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChannelModeratorArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'ChannelModeratorArn' => [ 'shape' => 'ChimeArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'CreateChannelModeratorResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'ChannelModerator' => [ 'shape' => 'Identity', ], ], ], 'CreateChannelRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', 'Name', 'ClientRequestToken', 'ChimeBearer', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'Mode' => [ 'shape' => 'ChannelMode', ], 'Privacy' => [ 'shape' => 'ChannelPrivacy', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Tags' => [ 'shape' => 'TagList', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'ChannelId' => [ 'shape' => 'ChannelId', ], 'MemberArns' => [ 'shape' => 'ChannelMemberArns', ], 'ModeratorArns' => [ 'shape' => 'ChannelModeratorArns', ], 'ElasticChannelConfiguration' => [ 'shape' => 'ElasticChannelConfiguration', ], 'ExpirationSettings' => [ 'shape' => 'ExpirationSettings', ], ], ], 'CreateChannelResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], ], ], 'DeleteChannelBanRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MemberArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MemberArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'memberArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DeleteChannelFlowRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelFlowArn', ], 'members' => [ 'ChannelFlowArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelFlowArn', ], ], ], 'DeleteChannelMembershipRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MemberArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MemberArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'memberArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', 'location' => 'querystring', 'locationName' => 'sub-channel-id', ], ], ], 'DeleteChannelMessageRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MessageId', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MessageId' => [ 'shape' => 'MessageId', 'location' => 'uri', 'locationName' => 'messageId', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', 'location' => 'querystring', 'locationName' => 'sub-channel-id', ], ], ], 'DeleteChannelModeratorRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChannelModeratorArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'ChannelModeratorArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelModeratorArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DeleteChannelRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DeleteMessagingStreamingConfigurationsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], ], ], 'DescribeChannelBanRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MemberArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MemberArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'memberArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DescribeChannelBanResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelBan' => [ 'shape' => 'ChannelBan', ], ], ], 'DescribeChannelFlowRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelFlowArn', ], 'members' => [ 'ChannelFlowArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelFlowArn', ], ], ], 'DescribeChannelFlowResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelFlow' => [ 'shape' => 'ChannelFlow', ], ], ], 'DescribeChannelMembershipForAppInstanceUserRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'AppInstanceUserArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'app-instance-user-arn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DescribeChannelMembershipForAppInstanceUserResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelMembership' => [ 'shape' => 'ChannelMembershipForAppInstanceUserSummary', ], ], ], 'DescribeChannelMembershipRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MemberArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MemberArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'memberArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', 'location' => 'querystring', 'locationName' => 'sub-channel-id', ], ], ], 'DescribeChannelMembershipResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelMembership' => [ 'shape' => 'ChannelMembership', ], ], ], 'DescribeChannelModeratedByAppInstanceUserRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'AppInstanceUserArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'app-instance-user-arn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DescribeChannelModeratedByAppInstanceUserResponse' => [ 'type' => 'structure', 'members' => [ 'Channel' => [ 'shape' => 'ChannelModeratedByAppInstanceUserSummary', ], ], ], 'DescribeChannelModeratorRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChannelModeratorArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'ChannelModeratorArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelModeratorArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DescribeChannelModeratorResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelModerator' => [ 'shape' => 'ChannelModerator', ], ], ], 'DescribeChannelRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'DescribeChannelResponse' => [ 'type' => 'structure', 'members' => [ 'Channel' => [ 'shape' => 'Channel', ], ], ], 'DisassociateChannelFlowRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChannelFlowArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'ChannelFlowArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelFlowArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'ElasticChannelConfiguration' => [ 'type' => 'structure', 'required' => [ 'MaximumSubChannels', 'TargetMembershipsPerSubChannel', 'MinimumMembershipPercentage', ], 'members' => [ 'MaximumSubChannels' => [ 'shape' => 'MaximumSubChannels', ], 'TargetMembershipsPerSubChannel' => [ 'shape' => 'TargetMembershipsPerSubChannel', ], 'MinimumMembershipPercentage' => [ 'shape' => 'MinimumMembershipPercentage', ], ], ], 'ErrorCode' => [ 'type' => 'string', 'enum' => [ 'BadRequest', 'Conflict', 'Forbidden', 'NotFound', 'PreconditionFailed', 'ResourceLimitExceeded', 'ServiceFailure', 'AccessDenied', 'ServiceUnavailable', 'Throttled', 'Throttling', 'Unauthorized', 'Unprocessable', 'VoiceConnectorGroupAssociationsExist', 'PhoneNumberAssociationsExist', ], ], 'ExpirationCriterion' => [ 'type' => 'string', 'enum' => [ 'CREATED_TIMESTAMP', 'LAST_MESSAGE_TIMESTAMP', ], ], 'ExpirationDays' => [ 'type' => 'integer', 'max' => 5475, 'min' => 1, ], 'ExpirationSettings' => [ 'type' => 'structure', 'required' => [ 'ExpirationDays', 'ExpirationCriterion', ], 'members' => [ 'ExpirationDays' => [ 'shape' => 'ExpirationDays', ], 'ExpirationCriterion' => [ 'shape' => 'ExpirationCriterion', ], ], ], 'FallbackAction' => [ 'type' => 'string', 'enum' => [ 'CONTINUE', 'ABORT', ], ], 'FilterRule' => [ 'type' => 'string', 'min' => 1, 'pattern' => '[\\\\s\\\\S]*', 'sensitive' => true, ], 'ForbiddenException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 403, ], 'exception' => true, ], 'GetChannelMembershipPreferencesRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MemberArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MemberArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'memberArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'GetChannelMembershipPreferencesResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'Member' => [ 'shape' => 'Identity', ], 'Preferences' => [ 'shape' => 'ChannelMembershipPreferences', ], ], ], 'GetChannelMessageRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MessageId', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MessageId' => [ 'shape' => 'MessageId', 'location' => 'uri', 'locationName' => 'messageId', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', 'location' => 'querystring', 'locationName' => 'sub-channel-id', ], ], ], 'GetChannelMessageResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelMessage' => [ 'shape' => 'ChannelMessage', ], ], ], 'GetChannelMessageStatusRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MessageId', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MessageId' => [ 'shape' => 'MessageId', 'location' => 'uri', 'locationName' => 'messageId', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', 'location' => 'querystring', 'locationName' => 'sub-channel-id', ], ], ], 'GetChannelMessageStatusResponse' => [ 'type' => 'structure', 'members' => [ 'Status' => [ 'shape' => 'ChannelMessageStatusStructure', ], ], ], 'GetMessagingSessionEndpointRequest' => [ 'type' => 'structure', 'members' => [], ], 'GetMessagingSessionEndpointResponse' => [ 'type' => 'structure', 'members' => [ 'Endpoint' => [ 'shape' => 'MessagingSessionEndpoint', ], ], ], 'GetMessagingStreamingConfigurationsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], ], ], 'GetMessagingStreamingConfigurationsResponse' => [ 'type' => 'structure', 'members' => [ 'StreamingConfigurations' => [ 'shape' => 'StreamingConfigurationList', ], ], ], 'Identity' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'ChimeArn', ], 'Name' => [ 'shape' => 'ResourceName', ], ], ], 'InvocationType' => [ 'type' => 'string', 'enum' => [ 'ASYNC', ], ], 'LambdaConfiguration' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'InvocationType', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'LambdaFunctionArn', ], 'InvocationType' => [ 'shape' => 'InvocationType', ], ], ], 'LambdaFunctionArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 15, 'pattern' => 'arn:aws:lambda:[a-z]{2}-[a-z]+-\\\\d{1}:\\\\d{12}:function:[a-zA-Z0-9\\\\-_\\\\.]+(:(\\\\$LATEST|[a-zA-Z0-9\\\\-_]+))?', ], 'ListChannelBansRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'ListChannelBansResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'ChannelBans' => [ 'shape' => 'ChannelBanSummaryList', ], ], ], 'ListChannelFlowsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'app-instance-arn', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListChannelFlowsResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelFlows' => [ 'shape' => 'ChannelFlowSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListChannelMembershipsForAppInstanceUserRequest' => [ 'type' => 'structure', 'required' => [ 'ChimeBearer', ], 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'app-instance-user-arn', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'ListChannelMembershipsForAppInstanceUserResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelMemberships' => [ 'shape' => 'ChannelMembershipForAppInstanceUserSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListChannelMembershipsRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'Type' => [ 'shape' => 'ChannelMembershipType', 'location' => 'querystring', 'locationName' => 'type', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', 'location' => 'querystring', 'locationName' => 'sub-channel-id', ], ], ], 'ListChannelMembershipsResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'ChannelMemberships' => [ 'shape' => 'ChannelMembershipSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListChannelMessagesRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'SortOrder' => [ 'shape' => 'SortOrder', 'location' => 'querystring', 'locationName' => 'sort-order', ], 'NotBefore' => [ 'shape' => 'Timestamp', 'location' => 'querystring', 'locationName' => 'not-before', ], 'NotAfter' => [ 'shape' => 'Timestamp', 'location' => 'querystring', 'locationName' => 'not-after', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', 'location' => 'querystring', 'locationName' => 'sub-channel-id', ], ], ], 'ListChannelMessagesResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'ChannelMessages' => [ 'shape' => 'ChannelMessageSummaryList', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', ], ], ], 'ListChannelModeratorsRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'ListChannelModeratorsResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'ChannelModerators' => [ 'shape' => 'ChannelModeratorSummaryList', ], ], ], 'ListChannelsAssociatedWithChannelFlowRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelFlowArn', ], 'members' => [ 'ChannelFlowArn' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'channel-flow-arn', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListChannelsAssociatedWithChannelFlowResponse' => [ 'type' => 'structure', 'members' => [ 'Channels' => [ 'shape' => 'ChannelAssociatedWithFlowSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListChannelsModeratedByAppInstanceUserRequest' => [ 'type' => 'structure', 'required' => [ 'ChimeBearer', ], 'members' => [ 'AppInstanceUserArn' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'app-instance-user-arn', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'ListChannelsModeratedByAppInstanceUserResponse' => [ 'type' => 'structure', 'members' => [ 'Channels' => [ 'shape' => 'ChannelModeratedByAppInstanceUserSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListChannelsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', 'ChimeBearer', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'app-instance-arn', ], 'Privacy' => [ 'shape' => 'ChannelPrivacy', 'location' => 'querystring', 'locationName' => 'privacy', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'ListChannelsResponse' => [ 'type' => 'structure', 'members' => [ 'Channels' => [ 'shape' => 'ChannelSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListSubChannelsRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListSubChannelsResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'SubChannels' => [ 'shape' => 'SubChannelSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'ChimeArn', 'location' => 'querystring', 'locationName' => 'arn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], ], ], 'MaxResults' => [ 'type' => 'integer', 'max' => 50, 'min' => 1, ], 'MaximumSubChannels' => [ 'type' => 'integer', 'min' => 2, ], 'MemberArns' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChimeArn', ], 'max' => 100, 'min' => 1, ], 'Members' => [ 'type' => 'list', 'member' => [ 'shape' => 'Identity', ], ], 'MembershipCount' => [ 'type' => 'integer', ], 'MessageAttributeMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'MessageAttributeName', ], 'value' => [ 'shape' => 'MessageAttributeValue', ], ], 'MessageAttributeName' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '[\\\\s\\\\S]*', 'sensitive' => true, ], 'MessageAttributeStringValue' => [ 'type' => 'string', 'max' => 512, 'min' => 1, 'pattern' => '[\\\\s\\\\S]*', 'sensitive' => true, ], 'MessageAttributeStringValues' => [ 'type' => 'list', 'member' => [ 'shape' => 'MessageAttributeStringValue', ], ], 'MessageAttributeValue' => [ 'type' => 'structure', 'members' => [ 'StringValues' => [ 'shape' => 'MessageAttributeStringValues', ], ], ], 'MessageId' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[-_a-zA-Z0-9]*', ], 'MessagingDataType' => [ 'type' => 'string', 'enum' => [ 'Channel', 'ChannelMessage', ], ], 'MessagingSessionEndpoint' => [ 'type' => 'structure', 'members' => [ 'Url' => [ 'shape' => 'UrlType', ], ], ], 'Metadata' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'pattern' => '.*', 'sensitive' => true, ], 'MinimumMembershipPercentage' => [ 'type' => 'integer', 'max' => 40, 'min' => 1, ], 'NextToken' => [ 'type' => 'string', 'max' => 2048, 'min' => 0, 'pattern' => '.*', 'sensitive' => true, ], 'NonEmptyContent' => [ 'type' => 'string', 'min' => 1, 'pattern' => '[\\\\s\\\\S]*', 'sensitive' => true, ], 'NonEmptyResourceName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', 'sensitive' => true, ], 'NonNullableBoolean' => [ 'type' => 'boolean', ], 'NotFoundException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'Processor' => [ 'type' => 'structure', 'required' => [ 'Name', 'Configuration', 'ExecutionOrder', 'FallbackAction', ], 'members' => [ 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'Configuration' => [ 'shape' => 'ProcessorConfiguration', ], 'ExecutionOrder' => [ 'shape' => 'ChannelFlowExecutionOrder', ], 'FallbackAction' => [ 'shape' => 'FallbackAction', ], ], ], 'ProcessorConfiguration' => [ 'type' => 'structure', 'required' => [ 'Lambda', ], 'members' => [ 'Lambda' => [ 'shape' => 'LambdaConfiguration', ], ], ], 'ProcessorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Processor', ], 'max' => 3, 'min' => 1, ], 'PushNotificationBody' => [ 'type' => 'string', 'max' => 150, 'min' => 1, 'pattern' => '[\\\\s\\\\S]*', 'sensitive' => true, ], 'PushNotificationConfiguration' => [ 'type' => 'structure', 'members' => [ 'Title' => [ 'shape' => 'PushNotificationTitle', ], 'Body' => [ 'shape' => 'PushNotificationBody', ], 'Type' => [ 'shape' => 'PushNotificationType', ], ], ], 'PushNotificationPreferences' => [ 'type' => 'structure', 'required' => [ 'AllowNotifications', ], 'members' => [ 'AllowNotifications' => [ 'shape' => 'AllowNotifications', ], 'FilterRule' => [ 'shape' => 'FilterRule', ], ], ], 'PushNotificationTitle' => [ 'type' => 'string', 'max' => 50, 'min' => 1, 'pattern' => '.*', 'sensitive' => true, ], 'PushNotificationType' => [ 'type' => 'string', 'enum' => [ 'DEFAULT', 'VOIP', ], ], 'PutChannelExpirationSettingsRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'ExpirationSettings' => [ 'shape' => 'ExpirationSettings', ], ], ], 'PutChannelExpirationSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'ExpirationSettings' => [ 'shape' => 'ExpirationSettings', ], ], ], 'PutChannelMembershipPreferencesRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MemberArn', 'ChimeBearer', 'Preferences', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MemberArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'memberArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'Preferences' => [ 'shape' => 'ChannelMembershipPreferences', ], ], ], 'PutChannelMembershipPreferencesResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'Member' => [ 'shape' => 'Identity', ], 'Preferences' => [ 'shape' => 'ChannelMembershipPreferences', ], ], ], 'PutMessagingStreamingConfigurationsRequest' => [ 'type' => 'structure', 'required' => [ 'AppInstanceArn', 'StreamingConfigurations', ], 'members' => [ 'AppInstanceArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'appInstanceArn', ], 'StreamingConfigurations' => [ 'shape' => 'StreamingConfigurationList', ], ], ], 'PutMessagingStreamingConfigurationsResponse' => [ 'type' => 'structure', 'members' => [ 'StreamingConfigurations' => [ 'shape' => 'StreamingConfigurationList', ], ], ], 'RedactChannelMessageRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MessageId', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MessageId' => [ 'shape' => 'MessageId', 'location' => 'uri', 'locationName' => 'messageId', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', ], ], ], 'RedactChannelMessageResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'MessageId' => [ 'shape' => 'MessageId', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', ], ], ], 'ResourceLimitExceededException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ResourceName' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => '[\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\u007E\\\\u0085\\\\u00A0-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]*', 'sensitive' => true, ], 'SearchChannelsRequest' => [ 'type' => 'structure', 'required' => [ 'Fields', ], 'members' => [ 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'Fields' => [ 'shape' => 'SearchFields', ], 'MaxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'SearchChannelsResponse' => [ 'type' => 'structure', 'members' => [ 'Channels' => [ 'shape' => 'ChannelSummaryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'SearchField' => [ 'type' => 'structure', 'required' => [ 'Key', 'Values', 'Operator', ], 'members' => [ 'Key' => [ 'shape' => 'SearchFieldKey', ], 'Values' => [ 'shape' => 'SearchFieldValues', ], 'Operator' => [ 'shape' => 'SearchFieldOperator', ], ], ], 'SearchFieldKey' => [ 'type' => 'string', 'enum' => [ 'MEMBERS', ], ], 'SearchFieldOperator' => [ 'type' => 'string', 'enum' => [ 'EQUALS', 'INCLUDES', ], ], 'SearchFieldValue' => [ 'type' => 'string', 'max' => 512, 'min' => 1, 'pattern' => '[\\\\s\\\\S]*', ], 'SearchFieldValues' => [ 'type' => 'list', 'member' => [ 'shape' => 'SearchFieldValue', ], 'max' => 20, 'min' => 1, ], 'SearchFields' => [ 'type' => 'list', 'member' => [ 'shape' => 'SearchField', ], 'max' => 20, 'min' => 1, ], 'SendChannelMessageRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'Content', 'Type', 'Persistence', 'ClientRequestToken', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'Content' => [ 'shape' => 'NonEmptyContent', ], 'Type' => [ 'shape' => 'ChannelMessageType', ], 'Persistence' => [ 'shape' => 'ChannelMessagePersistenceType', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'PushNotification' => [ 'shape' => 'PushNotificationConfiguration', ], 'MessageAttributes' => [ 'shape' => 'MessageAttributeMap', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', ], 'ContentType' => [ 'shape' => 'ContentType', ], 'Target' => [ 'shape' => 'TargetList', ], ], ], 'SendChannelMessageResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'MessageId' => [ 'shape' => 'MessageId', ], 'Status' => [ 'shape' => 'ChannelMessageStatusStructure', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', ], ], ], 'ServiceFailureException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'ServiceUnavailableException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], 'SortOrder' => [ 'type' => 'string', 'enum' => [ 'ASCENDING', 'DESCENDING', ], ], 'StatusDetail' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'pattern' => '[\\\\s\\\\S]*', ], 'StreamingConfiguration' => [ 'type' => 'structure', 'required' => [ 'DataType', 'ResourceArn', ], 'members' => [ 'DataType' => [ 'shape' => 'MessagingDataType', ], 'ResourceArn' => [ 'shape' => 'ChimeArn', ], ], ], 'StreamingConfigurationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'StreamingConfiguration', ], 'max' => 2, 'min' => 1, ], 'String' => [ 'type' => 'string', ], 'SubChannelId' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[-_a-zA-Z0-9]*', ], 'SubChannelSummary' => [ 'type' => 'structure', 'members' => [ 'SubChannelId' => [ 'shape' => 'SubChannelId', ], 'MembershipCount' => [ 'shape' => 'MembershipCount', ], ], ], 'SubChannelSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SubChannelSummary', ], ], 'Tag' => [ 'type' => 'structure', 'required' => [ 'Key', 'Value', ], 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'sensitive' => true, ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 50, 'min' => 1, ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], 'max' => 50, 'min' => 1, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'Tags', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'ChimeArn', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'sensitive' => true, ], 'Target' => [ 'type' => 'structure', 'members' => [ 'MemberArn' => [ 'shape' => 'ChimeArn', ], ], ], 'TargetList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Target', ], 'max' => 1, 'min' => 1, ], 'TargetMembershipsPerSubChannel' => [ 'type' => 'integer', 'min' => 2, ], 'ThrottledClientException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], 'Timestamp' => [ 'type' => 'timestamp', ], 'UnauthorizedClientException' => [ 'type' => 'structure', 'members' => [ 'Code' => [ 'shape' => 'ErrorCode', ], 'Message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'TagKeys', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'ChimeArn', ], 'TagKeys' => [ 'shape' => 'TagKeyList', ], ], ], 'UpdateChannelFlowRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelFlowArn', 'Processors', 'Name', ], 'members' => [ 'ChannelFlowArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelFlowArn', ], 'Processors' => [ 'shape' => 'ProcessorList', ], 'Name' => [ 'shape' => 'NonEmptyResourceName', ], ], ], 'UpdateChannelFlowResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelFlowArn' => [ 'shape' => 'ChimeArn', ], ], ], 'UpdateChannelMessageRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'MessageId', 'Content', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'MessageId' => [ 'shape' => 'MessageId', 'location' => 'uri', 'locationName' => 'messageId', ], 'Content' => [ 'shape' => 'NonEmptyContent', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', ], 'ContentType' => [ 'shape' => 'ContentType', ], ], ], 'UpdateChannelMessageResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], 'MessageId' => [ 'shape' => 'MessageId', ], 'Status' => [ 'shape' => 'ChannelMessageStatusStructure', ], 'SubChannelId' => [ 'shape' => 'SubChannelId', ], ], ], 'UpdateChannelReadMarkerRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'UpdateChannelReadMarkerResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], ], ], 'UpdateChannelRequest' => [ 'type' => 'structure', 'required' => [ 'ChannelArn', 'ChimeBearer', ], 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', 'location' => 'uri', 'locationName' => 'channelArn', ], 'Name' => [ 'shape' => 'NonEmptyResourceName', ], 'Mode' => [ 'shape' => 'ChannelMode', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'ChimeBearer' => [ 'shape' => 'ChimeArn', 'location' => 'header', 'locationName' => 'x-amz-chime-bearer', ], ], ], 'UpdateChannelResponse' => [ 'type' => 'structure', 'members' => [ 'ChannelArn' => [ 'shape' => 'ChimeArn', ], ], ], 'UrlType' => [ 'type' => 'string', 'max' => 4096, ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-messaging/2021-05-15/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>The Amazon Chime SDK messaging APIs in this section allow software developers to send and receive messages in custom messaging applications. These APIs depend on the frameworks provided by the Amazon Chime SDK identity APIs. For more information about the messaging APIs, see <a href=\"https://docs.aws.amazon.com/chime/latest/APIReference/API_Operations_Amazon_Chime_SDK_Messaging.html\">Amazon Chime SDK messaging</a>.</p>', 'operations' => [ 'AssociateChannelFlow' => '<p>Associates a channel flow with a channel. Once associated, all messages to that channel go through channel flow processors. To stop processing, use the <code>DisassociateChannelFlow</code> API.</p> <note> <p>Only administrators or channel moderators can associate a channel flow. The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'BatchCreateChannelMembership' => '<p>Adds a specified number of users and bots to a channel. </p>', 'ChannelFlowCallback' => '<p>Calls back Amazon Chime SDK messaging with a processing response message. This should be invoked from the processor Lambda. This is a developer API.</p> <p>You can return one of the following processing responses:</p> <ul> <li> <p>Update message content or metadata</p> </li> <li> <p>Deny a message</p> </li> <li> <p>Make no changes to the message</p> </li> </ul>', 'CreateChannel' => '<p>Creates a channel to which you can add users and send messages.</p> <p> <b>Restriction</b>: You can\\'t change a channel\\'s privacy.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'CreateChannelBan' => '<p>Permanently bans a member from a channel. Moderators can\\'t add banned members to a channel. To undo a ban, you first have to <code>DeleteChannelBan</code>, and then <code>CreateChannelMembership</code>. Bans are cleaned up when you delete users or channels.</p> <p>If you ban a user who is already part of a channel, that user is automatically kicked from the channel.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'CreateChannelFlow' => '<p>Creates a channel flow, a container for processors. Processors are AWS Lambda functions that perform actions on chat messages, such as stripping out profanity. You can associate channel flows with channels, and the processors in the channel flow then take action on all messages sent to that channel. This is a developer API.</p> <p>Channel flows process the following items:</p> <ol> <li> <p>New and updated messages</p> </li> <li> <p>Persistent and non-persistent messages</p> </li> <li> <p>The Standard message type</p> </li> </ol> <note> <p>Channel flows don\\'t process Control or System messages. For more information about the message types provided by Chime SDK messaging, refer to <a href=\"https://docs.aws.amazon.com/chime/latest/dg/using-the-messaging-sdk.html#msg-types\">Message types</a> in the <i>Amazon Chime developer guide</i>.</p> </note>', 'CreateChannelMembership' => '<p>Adds a member to a channel. The <code>InvitedBy</code> field in <code>ChannelMembership</code> is derived from the request header. A channel member can:</p> <ul> <li> <p>List messages</p> </li> <li> <p>Send messages</p> </li> <li> <p>Receive messages</p> </li> <li> <p>Edit their own messages</p> </li> <li> <p>Leave the channel</p> </li> </ul> <p>Privacy settings impact this action as follows:</p> <ul> <li> <p>Public Channels: You do not need to be a member to list messages, but you must be a member to send messages.</p> </li> <li> <p>Private Channels: You must be a member to list or send messages.</p> </li> </ul> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUserArn</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'CreateChannelModerator' => '<p>Creates a new <code>ChannelModerator</code>. A channel moderator can:</p> <ul> <li> <p>Add and remove other members of the channel.</p> </li> <li> <p>Add and remove other moderators of the channel.</p> </li> <li> <p>Add and remove user bans for the channel.</p> </li> <li> <p>Redact messages in the channel.</p> </li> <li> <p>List messages in the channel.</p> </li> </ul> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code>of the user that makes the API call as the value in the header.</p> </note>', 'DeleteChannel' => '<p>Immediately makes a channel and its memberships inaccessible and marks them for deletion. This is an irreversible process.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUserArn</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'DeleteChannelBan' => '<p>Removes a member from a channel\\'s ban list.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'DeleteChannelFlow' => '<p>Deletes a channel flow, an irreversible process. This is a developer API.</p> <note> <p> This API works only when the channel flow is not associated with any channel. To get a list of all channels that a channel flow is associated with, use the <code>ListChannelsAssociatedWithChannelFlow</code> API. Use the <code>DisassociateChannelFlow</code> API to disassociate a channel flow from all channels. </p> </note>', 'DeleteChannelMembership' => '<p>Removes a member from a channel.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note>', 'DeleteChannelMessage' => '<p>Deletes a channel message. Only admins can perform this action. Deletion makes messages inaccessible immediately. A background process deletes any revisions created by <code>UpdateChannelMessage</code>.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'DeleteChannelModerator' => '<p>Deletes a channel moderator.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'DeleteMessagingStreamingConfigurations' => '<p>Deletes the streaming configurations for an <code>AppInstance</code>. For more information, see <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/streaming-export.html\">Streaming messaging data</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p>', 'DescribeChannel' => '<p>Returns the full details of a channel in an Amazon Chime <code>AppInstance</code>.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'DescribeChannelBan' => '<p>Returns the full details of a channel ban.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'DescribeChannelFlow' => '<p>Returns the full details of a channel flow in an Amazon Chime <code>AppInstance</code>. This is a developer API.</p>', 'DescribeChannelMembership' => '<p>Returns the full details of a user\\'s channel membership.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'DescribeChannelMembershipForAppInstanceUser' => '<p> Returns the details of a channel based on the membership of the specified <code>AppInstanceUser</code> or <code>AppInstanceBot</code>.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'DescribeChannelModeratedByAppInstanceUser' => '<p>Returns the full details of a channel moderated by the specified <code>AppInstanceUser</code> or <code>AppInstanceBot</code>.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'DescribeChannelModerator' => '<p>Returns the full details of a single ChannelModerator.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the <code>AppInstanceUserArn</code> of the user that makes the API call as the value in the header.</p> </note>', 'DisassociateChannelFlow' => '<p>Disassociates a channel flow from all its channels. Once disassociated, all messages to that channel stop going through the channel flow processor.</p> <note> <p>Only administrators or channel moderators can disassociate a channel flow.</p> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'GetChannelMembershipPreferences' => '<p>Gets the membership preferences of an <code>AppInstanceUser</code> or <code>AppInstanceBot</code> for the specified channel. A user or a bot must be a member of the channel and own the membership in order to retrieve membership preferences. Users or bots in the <code>AppInstanceAdmin</code> and channel moderator roles can\\'t retrieve preferences for other users or bots. Banned users or bots can\\'t retrieve membership preferences for the channel from which they are banned.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'GetChannelMessage' => '<p>Gets the full details of a channel message.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'GetChannelMessageStatus' => '<p>Gets message status for a specified <code>messageId</code>. Use this API to determine the intermediate status of messages going through channel flow processing. The API provides an alternative to retrieving message status if the event was not received because a client wasn\\'t connected to a websocket. </p> <p>Messages can have any one of these statuses.</p> <dl> <dt>SENT</dt> <dd> <p>Message processed successfully</p> </dd> <dt>PENDING</dt> <dd> <p>Ongoing processing</p> </dd> <dt>FAILED</dt> <dd> <p>Processing failed</p> </dd> <dt>DENIED</dt> <dd> <p>Message denied by the processor</p> </dd> </dl> <note> <ul> <li> <p>This API does not return statuses for denied messages, because we don\\'t store them once the processor denies them. </p> </li> <li> <p>Only the message sender can invoke this API.</p> </li> <li> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </li> </ul> </note>', 'GetMessagingSessionEndpoint' => '<p>The details of the endpoint for the messaging session.</p>', 'GetMessagingStreamingConfigurations' => '<p>Retrieves the data streaming configuration for an <code>AppInstance</code>. For more information, see <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/streaming-export.html\">Streaming messaging data</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p>', 'ListChannelBans' => '<p>Lists all the users and bots banned from a particular channel.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'ListChannelFlows' => '<p>Returns a paginated lists of all the channel flows created under a single Chime. This is a developer API.</p>', 'ListChannelMemberships' => '<p>Lists all channel memberships in a channel.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note> <p>If you want to list the channels to which a specific app instance user belongs, see the <a href=\"https://docs.aws.amazon.com/chime/latest/APIReference/API_messaging-chime_ListChannelMembershipsForAppInstanceUser.html\">ListChannelMembershipsForAppInstanceUser</a> API.</p>', 'ListChannelMembershipsForAppInstanceUser' => '<p> Lists all channels that an <code>AppInstanceUser</code> or <code>AppInstanceBot</code> is a part of. Only an <code>AppInstanceAdmin</code> can call the API with a user ARN that is not their own. </p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'ListChannelMessages' => '<p>List all the messages in a channel. Returns a paginated list of <code>ChannelMessages</code>. By default, sorted by creation timestamp in descending order.</p> <note> <p>Redacted messages appear in the results as empty, since they are only redacted, not deleted. Deleted messages do not appear in the results. This action always returns the latest version of an edited message.</p> <p>Also, the <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'ListChannelModerators' => '<p>Lists all the moderators for a channel.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'ListChannels' => '<p>Lists all Channels created under a single Chime App as a paginated list. You can specify filters to narrow results.</p> <p class=\"title\"> <b>Functionality &amp; restrictions</b> </p> <ul> <li> <p>Use privacy = <code>PUBLIC</code> to retrieve all public channels in the account.</p> </li> <li> <p>Only an <code>AppInstanceAdmin</code> can set privacy = <code>PRIVATE</code> to list the private channels in an account.</p> </li> </ul> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'ListChannelsAssociatedWithChannelFlow' => '<p>Lists all channels associated with a specified channel flow. You can associate a channel flow with multiple channels, but you can only associate a channel with one channel flow. This is a developer API.</p>', 'ListChannelsModeratedByAppInstanceUser' => '<p>A list of the channels moderated by an <code>AppInstanceUser</code>.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'ListSubChannels' => '<p>Lists all the SubChannels in an elastic channel when given a channel ID. Available only to the app instance admins and channel moderators of elastic channels.</p>', 'ListTagsForResource' => '<p>Lists the tags applied to an Amazon Chime SDK messaging resource.</p>', 'PutChannelExpirationSettings' => '<p>Sets the number of days before the channel is automatically deleted.</p> <note> <ul> <li> <p>A background process deletes expired channels within 6 hours of expiration. Actual deletion times may vary.</p> </li> <li> <p>Expired channels that have not yet been deleted appear as active, and you can update their expiration settings. The system honors the new settings.</p> </li> <li> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </li> </ul> </note>', 'PutChannelMembershipPreferences' => '<p>Sets the membership preferences of an <code>AppInstanceUser</code> or <code>AppInstanceBot</code> for the specified channel. The user or bot must be a member of the channel. Only the user or bot who owns the membership can set preferences. Users or bots in the <code>AppInstanceAdmin</code> and channel moderator roles can\\'t set preferences for other users. Banned users or bots can\\'t set membership preferences for the channel from which they are banned.</p> <note> <p>The x-amz-chime-bearer request header is mandatory. Use the ARN of an <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'PutMessagingStreamingConfigurations' => '<p>Sets the data streaming configuration for an <code>AppInstance</code>. For more information, see <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/streaming-export.html\">Streaming messaging data</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p>', 'RedactChannelMessage' => '<p>Redacts message content, but not metadata. The message exists in the back end, but the action returns null content, and the state shows as redacted.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'SearchChannels' => '<p>Allows the <code>ChimeBearer</code> to search channels by channel members. Users or bots can search across the channels that they belong to. Users in the <code>AppInstanceAdmin</code> role can search across all channels.</p> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p>', 'SendChannelMessage' => '<p>Sends a message to a particular channel that the member is a part of.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> <p>Also, <code>STANDARD</code> messages can be up to 4KB in size and contain metadata. Metadata is arbitrary, and you can use it in a variety of ways, such as containing a link to an attachment.</p> <p> <code>CONTROL</code> messages are limited to 30 bytes and do not contain metadata.</p> </note>', 'TagResource' => '<p>Applies the specified tags to the specified Amazon Chime SDK messaging resource.</p>', 'UntagResource' => '<p>Removes the specified tags from the specified Amazon Chime SDK messaging resource.</p>', 'UpdateChannel' => '<p>Update a channel\\'s attributes.</p> <p> <b>Restriction</b>: You can\\'t change a channel\\'s privacy. </p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'UpdateChannelFlow' => '<p>Updates channel flow attributes. This is a developer API.</p>', 'UpdateChannelMessage' => '<p>Updates the content of a message.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', 'UpdateChannelReadMarker' => '<p>The details of the time when a user last read messages in a channel.</p> <note> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </note>', ], 'shapes' => [ 'AllowNotifications' => [ 'base' => NULL, 'refs' => [ 'PushNotificationPreferences$AllowNotifications' => '<p>Enum value that indicates which push notifications to send to the requested member of a channel. <code>ALL</code> sends all push notifications, <code>NONE</code> sends no push notifications, <code>FILTERED</code> sends only filtered push notifications. </p>', ], ], 'AppInstanceUserMembershipSummary' => [ 'base' => '<p>Summary of the membership details of an <code>AppInstanceUser</code>.</p>', 'refs' => [ 'ChannelMembershipForAppInstanceUserSummary$AppInstanceUserMembershipSummary' => '<p>Returns the channel membership data for an <code>AppInstance</code>.</p>', ], ], 'AssociateChannelFlowRequest' => [ 'base' => NULL, 'refs' => [], ], 'BadRequestException' => [ 'base' => '<p>The input parameters don\\'t match the service\\'s restrictions.</p>', 'refs' => [], ], 'BatchChannelMemberships' => [ 'base' => '<p>The membership information, including member ARNs, the channel ARN, and membership types.</p>', 'refs' => [ 'BatchCreateChannelMembershipResponse$BatchChannelMemberships' => '<p>The list of channel memberships in the response.</p>', ], ], 'BatchCreateChannelMembershipError' => [ 'base' => '<p>A list of failed member ARNs, error codes, and error messages.</p>', 'refs' => [ 'BatchCreateChannelMembershipErrors$member' => NULL, ], ], 'BatchCreateChannelMembershipErrors' => [ 'base' => NULL, 'refs' => [ 'BatchCreateChannelMembershipResponse$Errors' => '<p>If the action fails for one or more of the memberships in the request, a list of the memberships is returned, along with error codes and error messages.</p>', ], ], 'BatchCreateChannelMembershipRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchCreateChannelMembershipResponse' => [ 'base' => NULL, 'refs' => [], ], 'CallbackIdType' => [ 'base' => NULL, 'refs' => [ 'ChannelFlowCallbackRequest$CallbackId' => '<p>The identifier passed to the processor by the service when invoked. Use the identifier to call back the service.</p>', 'ChannelFlowCallbackResponse$CallbackId' => '<p>The call back ID passed in the request.</p>', ], ], 'Channel' => [ 'base' => '<p>The details of a channel.</p>', 'refs' => [ 'DescribeChannelResponse$Channel' => '<p>The channel details.</p>', ], ], 'ChannelAssociatedWithFlowSummary' => [ 'base' => '<p>Summary of details of a channel associated with channel flow.</p>', 'refs' => [ 'ChannelAssociatedWithFlowSummaryList$member' => NULL, ], ], 'ChannelAssociatedWithFlowSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListChannelsAssociatedWithChannelFlowResponse$Channels' => '<p>The information about each channel.</p>', ], ], 'ChannelBan' => [ 'base' => '<p>The details of a channel ban.</p>', 'refs' => [ 'DescribeChannelBanResponse$ChannelBan' => '<p>The details of the ban.</p>', ], ], 'ChannelBanSummary' => [ 'base' => '<p>Summary of the details of a <code>ChannelBan</code>.</p>', 'refs' => [ 'ChannelBanSummaryList$member' => NULL, ], ], 'ChannelBanSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListChannelBansResponse$ChannelBans' => '<p>The information for each requested ban.</p>', ], ], 'ChannelFlow' => [ 'base' => '<p>The details of a channel flow.</p>', 'refs' => [ 'DescribeChannelFlowResponse$ChannelFlow' => '<p>The channel flow details.</p>', ], ], 'ChannelFlowCallbackRequest' => [ 'base' => NULL, 'refs' => [], ], 'ChannelFlowCallbackResponse' => [ 'base' => NULL, 'refs' => [], ], 'ChannelFlowExecutionOrder' => [ 'base' => NULL, 'refs' => [ 'Processor$ExecutionOrder' => '<p>The sequence in which processors run. If you have multiple processors in a channel flow, message processing goes through each processor in the sequence. The value determines the sequence. At this point, we support only 1 processor within a flow.</p>', ], ], 'ChannelFlowSummary' => [ 'base' => '<p>Summary of details of a channel flow.</p>', 'refs' => [ 'ChannelFlowSummaryList$member' => NULL, ], ], 'ChannelFlowSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListChannelFlowsResponse$ChannelFlows' => '<p>The information about each channel flow.</p>', ], ], 'ChannelId' => [ 'base' => NULL, 'refs' => [ 'CreateChannelRequest$ChannelId' => '<p>The ID of the channel in the request.</p>', ], ], 'ChannelMemberArns' => [ 'base' => NULL, 'refs' => [ 'CreateChannelRequest$MemberArns' => '<p>The ARNs of the channel members in the request.</p>', ], ], 'ChannelMembership' => [ 'base' => '<p>The details of a channel member.</p>', 'refs' => [ 'DescribeChannelMembershipResponse$ChannelMembership' => '<p>The details of the membership.</p>', ], ], 'ChannelMembershipForAppInstanceUserSummary' => [ 'base' => '<p>Summary of the channel membership details of an <code>AppInstanceUser</code>.</p>', 'refs' => [ 'ChannelMembershipForAppInstanceUserSummaryList$member' => NULL, 'DescribeChannelMembershipForAppInstanceUserResponse$ChannelMembership' => '<p>The channel to which a user belongs.</p>', ], ], 'ChannelMembershipForAppInstanceUserSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListChannelMembershipsForAppInstanceUserResponse$ChannelMemberships' => '<p>The information for the requested channel memberships.</p>', ], ], 'ChannelMembershipPreferences' => [ 'base' => '<p>The channel membership preferences for an <code>AppInstanceUser</code>.</p>', 'refs' => [ 'GetChannelMembershipPreferencesResponse$Preferences' => '<p>The channel membership preferences for an <code>AppInstanceUser</code> .</p>', 'PutChannelMembershipPreferencesRequest$Preferences' => '<p>The channel membership preferences of an <code>AppInstanceUser</code> .</p>', 'PutChannelMembershipPreferencesResponse$Preferences' => '<p>The ARN and metadata of the member being added.</p>', ], ], 'ChannelMembershipSummary' => [ 'base' => '<p>Summary of the details of a <code>ChannelMembership</code>.</p>', 'refs' => [ 'ChannelMembershipSummaryList$member' => NULL, ], ], 'ChannelMembershipSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListChannelMembershipsResponse$ChannelMemberships' => '<p>The information for the requested channel memberships.</p>', ], ], 'ChannelMembershipType' => [ 'base' => NULL, 'refs' => [ 'AppInstanceUserMembershipSummary$Type' => '<p>The type of <code>ChannelMembership</code>.</p>', 'BatchChannelMemberships$Type' => '<p>The membership types set for the channel members.</p>', 'BatchCreateChannelMembershipRequest$Type' => '<p>The membership type of a user, <code>DEFAULT</code> or <code>HIDDEN</code>. Default members are always returned as part of <code>ListChannelMemberships</code>. Hidden members are only returned if the type filter in <code>ListChannelMemberships</code> equals <code>HIDDEN</code>. Otherwise hidden members are not returned. This is only supported by moderators.</p>', 'ChannelMembership$Type' => '<p>The membership type set for the channel member.</p>', 'CreateChannelMembershipRequest$Type' => '<p>The membership type of a user, <code>DEFAULT</code> or <code>HIDDEN</code>. Default members are always returned as part of <code>ListChannelMemberships</code>. Hidden members are only returned if the type filter in <code>ListChannelMemberships</code> equals <code>HIDDEN</code>. Otherwise hidden members are not returned. This is only supported by moderators.</p>', 'ListChannelMembershipsRequest$Type' => '<p>The membership type of a user, <code>DEFAULT</code> or <code>HIDDEN</code>. Default members are returned as part of <code>ListChannelMemberships</code> if no type is specified. Hidden members are only returned if the type filter in <code>ListChannelMemberships</code> equals <code>HIDDEN</code>.</p>', ], ], 'ChannelMessage' => [ 'base' => '<p>The details of a message in a channel.</p>', 'refs' => [ 'GetChannelMessageResponse$ChannelMessage' => '<p>The details of and content in the message.</p>', ], ], 'ChannelMessageCallback' => [ 'base' => '<p>Stores information about a callback.</p>', 'refs' => [ 'ChannelFlowCallbackRequest$ChannelMessage' => '<p>Stores information about the processed message.</p>', ], ], 'ChannelMessagePersistenceType' => [ 'base' => NULL, 'refs' => [ 'ChannelMessage$Persistence' => '<p>The persistence setting for a channel message.</p>', 'SendChannelMessageRequest$Persistence' => '<p>Boolean that controls whether the message is persisted on the back end. Required.</p>', ], ], 'ChannelMessageStatus' => [ 'base' => NULL, 'refs' => [ 'ChannelMessageStatusStructure$Value' => '<p>The message status value.</p>', ], ], 'ChannelMessageStatusStructure' => [ 'base' => '<p>Stores information about a message status.</p>', 'refs' => [ 'ChannelMessage$Status' => '<p>The status of the channel message.</p>', 'ChannelMessageSummary$Status' => '<p>The message status. The status value is <code>SENT</code> for messages sent to a channel without a channel flow. For channels associated with channel flow, the value determines the processing stage.</p>', 'GetChannelMessageStatusResponse$Status' => '<p>The message status and details.</p>', 'SendChannelMessageResponse$Status' => '<p>The status of the channel message.</p>', 'UpdateChannelMessageResponse$Status' => '<p>The status of the message update.</p>', ], ], 'ChannelMessageSummary' => [ 'base' => '<p>Summary of the messages in a <code>Channel</code>.</p>', 'refs' => [ 'ChannelMessageSummaryList$member' => NULL, ], ], 'ChannelMessageSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListChannelMessagesResponse$ChannelMessages' => '<p>The information about, and content of, each requested message.</p>', ], ], 'ChannelMessageType' => [ 'base' => NULL, 'refs' => [ 'ChannelMessage$Type' => '<p>The message type.</p>', 'ChannelMessageSummary$Type' => '<p>The type of message.</p>', 'SendChannelMessageRequest$Type' => '<p>The type of message, <code>STANDARD</code> or <code>CONTROL</code>.</p> <p> <code>STANDARD</code> messages can be up to 4KB in size and contain metadata. Metadata is arbitrary, and you can use it in a variety of ways, such as containing a link to an attachment.</p> <p> <code>CONTROL</code> messages are limited to 30 bytes and do not contain metadata.</p>', ], ], 'ChannelMode' => [ 'base' => NULL, 'refs' => [ 'Channel$Mode' => '<p>The mode of the channel.</p>', 'ChannelAssociatedWithFlowSummary$Mode' => '<p>The mode of the channel.</p>', 'ChannelSummary$Mode' => '<p>The mode of the channel.</p>', 'CreateChannelRequest$Mode' => '<p>The channel mode: <code>UNRESTRICTED</code> or <code>RESTRICTED</code>. Administrators, moderators, and channel members can add themselves and other members to unrestricted channels. Only administrators and moderators can add members to restricted channels.</p>', 'UpdateChannelRequest$Mode' => '<p>The mode of the update request.</p>', ], ], 'ChannelModeratedByAppInstanceUserSummary' => [ 'base' => '<p>Summary of the details of a moderated channel.</p>', 'refs' => [ 'ChannelModeratedByAppInstanceUserSummaryList$member' => NULL, 'DescribeChannelModeratedByAppInstanceUserResponse$Channel' => '<p>The moderated channel.</p>', ], ], 'ChannelModeratedByAppInstanceUserSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListChannelsModeratedByAppInstanceUserResponse$Channels' => '<p>The moderated channels in the request.</p>', ], ], 'ChannelModerator' => [ 'base' => '<p>The details of a channel moderator.</p>', 'refs' => [ 'DescribeChannelModeratorResponse$ChannelModerator' => '<p>The details of the channel moderator.</p>', ], ], 'ChannelModeratorArns' => [ 'base' => NULL, 'refs' => [ 'CreateChannelRequest$ModeratorArns' => '<p>The ARNs of the channel moderators in the request.</p>', ], ], 'ChannelModeratorSummary' => [ 'base' => '<p>Summary of the details of a <code>ChannelModerator</code>.</p>', 'refs' => [ 'ChannelModeratorSummaryList$member' => NULL, ], ], 'ChannelModeratorSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListChannelModeratorsResponse$ChannelModerators' => '<p>The information about and names of each moderator.</p>', ], ], 'ChannelPrivacy' => [ 'base' => NULL, 'refs' => [ 'Channel$Privacy' => '<p>The channel\\'s privacy setting.</p>', 'ChannelAssociatedWithFlowSummary$Privacy' => '<p>The channel\\'s privacy setting.</p>', 'ChannelSummary$Privacy' => '<p>The privacy setting of the channel.</p>', 'CreateChannelRequest$Privacy' => '<p>The channel\\'s privacy level: <code>PUBLIC</code> or <code>PRIVATE</code>. Private channels aren\\'t discoverable by users outside the channel. Public channels are discoverable by anyone in the <code>AppInstance</code>.</p>', 'ListChannelsRequest$Privacy' => '<p>The privacy setting. <code>PUBLIC</code> retrieves all the public channels. <code>PRIVATE</code> retrieves private channels. Only an <code>AppInstanceAdmin</code> can retrieve private channels. </p>', ], ], 'ChannelSummary' => [ 'base' => '<p>Summary of the details of a <code>Channel</code>.</p>', 'refs' => [ 'ChannelMembershipForAppInstanceUserSummary$ChannelSummary' => '<p>Returns the channel data for an <code>AppInstance</code>.</p>', 'ChannelModeratedByAppInstanceUserSummary$ChannelSummary' => '<p>Summary of the details of a <code>Channel</code>.</p>', 'ChannelSummaryList$member' => NULL, ], ], 'ChannelSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListChannelsResponse$Channels' => '<p>The information about each channel.</p>', 'SearchChannelsResponse$Channels' => '<p>A list of the channels in the request.</p>', ], ], 'ChimeArn' => [ 'base' => NULL, 'refs' => [ 'AssociateChannelFlowRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'AssociateChannelFlowRequest$ChannelFlowArn' => '<p>The ARN of the channel flow.</p>', 'AssociateChannelFlowRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user making the API call.</p>', 'BatchChannelMemberships$ChannelArn' => '<p>The ARN of the channel to which you\\'re adding members.</p>', 'BatchCreateChannelMembershipError$MemberArn' => '<p>The <code>AppInstanceUserArn</code> of the member that the service couldn\\'t add.</p>', 'BatchCreateChannelMembershipRequest$ChannelArn' => '<p>The ARN of the channel to which you\\'re adding users or bots.</p>', 'BatchCreateChannelMembershipRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'Channel$ChannelArn' => '<p>The ARN of a channel.</p>', 'Channel$ChannelFlowArn' => '<p>The ARN of the channel flow.</p>', 'ChannelAssociatedWithFlowSummary$ChannelArn' => '<p>The ARN of the channel.</p>', 'ChannelBan$ChannelArn' => '<p>The ARN of the channel from which a member is being banned.</p>', 'ChannelFlow$ChannelFlowArn' => '<p>The ARN of the channel flow.</p>', 'ChannelFlowCallbackRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'ChannelFlowCallbackResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'ChannelFlowSummary$ChannelFlowArn' => '<p>The ARN of the channel flow.</p>', 'ChannelMemberArns$member' => NULL, 'ChannelMembership$ChannelArn' => '<p>The ARN of the member\\'s channel.</p>', 'ChannelMessage$ChannelArn' => '<p>The ARN of the channel.</p>', 'ChannelModerator$ChannelArn' => '<p>The ARN of the moderator\\'s channel.</p>', 'ChannelModeratorArns$member' => NULL, 'ChannelSummary$ChannelArn' => '<p>The ARN of the channel.</p>', 'CreateChannelBanRequest$ChannelArn' => '<p>The ARN of the ban request.</p>', 'CreateChannelBanRequest$MemberArn' => '<p>The <code>AppInstanceUserArn</code> of the member being banned.</p>', 'CreateChannelBanRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'CreateChannelBanResponse$ChannelArn' => '<p>The ARN of the response to the ban request.</p>', 'CreateChannelFlowRequest$AppInstanceArn' => '<p>The ARN of the channel flow request.</p>', 'CreateChannelFlowResponse$ChannelFlowArn' => '<p>The ARN of the channel flow.</p>', 'CreateChannelMembershipRequest$ChannelArn' => '<p>The ARN of the channel to which you\\'re adding users.</p>', 'CreateChannelMembershipRequest$MemberArn' => '<p>The <code>AppInstanceUserArn</code> of the member you want to add to the channel.</p>', 'CreateChannelMembershipRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'CreateChannelMembershipResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'CreateChannelModeratorRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'CreateChannelModeratorRequest$ChannelModeratorArn' => '<p>The <code>AppInstanceUserArn</code> of the moderator.</p>', 'CreateChannelModeratorRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'CreateChannelModeratorResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'CreateChannelRequest$AppInstanceArn' => '<p>The ARN of the channel request.</p>', 'CreateChannelRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'CreateChannelResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'DeleteChannelBanRequest$ChannelArn' => '<p>The ARN of the channel from which the <code>AppInstanceUser</code> was banned.</p>', 'DeleteChannelBanRequest$MemberArn' => '<p>The ARN of the <code>AppInstanceUser</code> that you want to reinstate.</p>', 'DeleteChannelBanRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'DeleteChannelFlowRequest$ChannelFlowArn' => '<p>The ARN of the channel flow.</p>', 'DeleteChannelMembershipRequest$ChannelArn' => '<p>The ARN of the channel from which you want to remove the user.</p>', 'DeleteChannelMembershipRequest$MemberArn' => '<p>The <code>AppInstanceUserArn</code> of the member that you\\'re removing from the channel.</p>', 'DeleteChannelMembershipRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'DeleteChannelMessageRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'DeleteChannelMessageRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'DeleteChannelModeratorRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'DeleteChannelModeratorRequest$ChannelModeratorArn' => '<p>The <code>AppInstanceUserArn</code> of the moderator being deleted.</p>', 'DeleteChannelModeratorRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'DeleteChannelRequest$ChannelArn' => '<p>The ARN of the channel being deleted.</p>', 'DeleteChannelRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'DeleteMessagingStreamingConfigurationsRequest$AppInstanceArn' => '<p>The ARN of the streaming configurations being deleted.</p>', 'DescribeChannelBanRequest$ChannelArn' => '<p>The ARN of the channel from which the user is banned.</p>', 'DescribeChannelBanRequest$MemberArn' => '<p>The <code>AppInstanceUserArn</code> of the member being banned.</p>', 'DescribeChannelBanRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'DescribeChannelFlowRequest$ChannelFlowArn' => '<p>The ARN of the channel flow.</p>', 'DescribeChannelMembershipForAppInstanceUserRequest$ChannelArn' => '<p>The ARN of the channel to which the user belongs.</p>', 'DescribeChannelMembershipForAppInstanceUserRequest$AppInstanceUserArn' => '<p>The ARN of the user or bot in a channel.</p>', 'DescribeChannelMembershipForAppInstanceUserRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'DescribeChannelMembershipRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'DescribeChannelMembershipRequest$MemberArn' => '<p>The <code>AppInstanceUserArn</code> of the member.</p>', 'DescribeChannelMembershipRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'DescribeChannelModeratedByAppInstanceUserRequest$ChannelArn' => '<p>The ARN of the moderated channel.</p>', 'DescribeChannelModeratedByAppInstanceUserRequest$AppInstanceUserArn' => '<p>The ARN of the user or bot in the moderated channel.</p>', 'DescribeChannelModeratedByAppInstanceUserRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'DescribeChannelModeratorRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'DescribeChannelModeratorRequest$ChannelModeratorArn' => '<p>The <code>AppInstanceUserArn</code> of the channel moderator.</p>', 'DescribeChannelModeratorRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'DescribeChannelRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'DescribeChannelRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'DisassociateChannelFlowRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'DisassociateChannelFlowRequest$ChannelFlowArn' => '<p>The ARN of the channel flow.</p>', 'DisassociateChannelFlowRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user making the API call.</p>', 'GetChannelMembershipPreferencesRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'GetChannelMembershipPreferencesRequest$MemberArn' => '<p>The <code>AppInstanceUserArn</code> of the member retrieving the preferences.</p>', 'GetChannelMembershipPreferencesRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'GetChannelMembershipPreferencesResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'GetChannelMessageRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'GetChannelMessageRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'GetChannelMessageStatusRequest$ChannelArn' => '<p>The ARN of the channel</p>', 'GetChannelMessageStatusRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user making the API call.</p>', 'GetMessagingStreamingConfigurationsRequest$AppInstanceArn' => '<p>The ARN of the streaming configurations.</p>', 'Identity$Arn' => '<p>The ARN in an Identity.</p>', 'ListChannelBansRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'ListChannelBansRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'ListChannelBansResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'ListChannelFlowsRequest$AppInstanceArn' => '<p>The ARN of the app instance.</p>', 'ListChannelMembershipsForAppInstanceUserRequest$AppInstanceUserArn' => '<p>The ARN of the user or bot.</p>', 'ListChannelMembershipsForAppInstanceUserRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'ListChannelMembershipsRequest$ChannelArn' => '<p>The maximum number of channel memberships that you want returned.</p>', 'ListChannelMembershipsRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'ListChannelMembershipsResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'ListChannelMessagesRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'ListChannelMessagesRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'ListChannelMessagesResponse$ChannelArn' => '<p>The ARN of the channel containing the requested messages.</p>', 'ListChannelModeratorsRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'ListChannelModeratorsRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'ListChannelModeratorsResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'ListChannelsAssociatedWithChannelFlowRequest$ChannelFlowArn' => '<p>The ARN of the channel flow.</p>', 'ListChannelsModeratedByAppInstanceUserRequest$AppInstanceUserArn' => '<p>The ARN of the user or bot in the moderated channel.</p>', 'ListChannelsModeratedByAppInstanceUserRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'ListChannelsRequest$AppInstanceArn' => '<p>The ARN of the <code>AppInstance</code>.</p>', 'ListChannelsRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'ListSubChannelsRequest$ChannelArn' => '<p>The ARN of elastic channel.</p>', 'ListSubChannelsRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user making the API call.</p>', 'ListSubChannelsResponse$ChannelArn' => '<p>The ARN of elastic channel.</p>', 'ListTagsForResourceRequest$ResourceARN' => '<p>The ARN of the resource.</p>', 'MemberArns$member' => NULL, 'PutChannelExpirationSettingsRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'PutChannelExpirationSettingsRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'PutChannelExpirationSettingsResponse$ChannelArn' => '<p>The channel ARN.</p>', 'PutChannelMembershipPreferencesRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'PutChannelMembershipPreferencesRequest$MemberArn' => '<p>The ARN of the member setting the preferences.</p>', 'PutChannelMembershipPreferencesRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'PutChannelMembershipPreferencesResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'PutMessagingStreamingConfigurationsRequest$AppInstanceArn' => '<p>The ARN of the streaming configuration.</p>', 'RedactChannelMessageRequest$ChannelArn' => '<p>The ARN of the channel containing the messages that you want to redact.</p>', 'RedactChannelMessageRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'RedactChannelMessageResponse$ChannelArn' => '<p>The ARN of the channel containing the messages that you want to redact.</p>', 'SearchChannelsRequest$ChimeBearer' => '<p>The <code>AppInstanceUserArn</code> of the user making the API call.</p>', 'SendChannelMessageRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'SendChannelMessageRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'SendChannelMessageResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'StreamingConfiguration$ResourceArn' => '<p>The ARN of the resource in the configuration. </p>', 'TagResourceRequest$ResourceARN' => '<p>The resource ARN.</p>', 'Target$MemberArn' => '<p>The ARN of the target channel member.</p>', 'UntagResourceRequest$ResourceARN' => '<p>The resource ARN.</p>', 'UpdateChannelFlowRequest$ChannelFlowArn' => '<p>The ARN of the channel flow.</p>', 'UpdateChannelFlowResponse$ChannelFlowArn' => '<p>The ARN of the channel flow.</p>', 'UpdateChannelMessageRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'UpdateChannelMessageRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'UpdateChannelMessageResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'UpdateChannelReadMarkerRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'UpdateChannelReadMarkerRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'UpdateChannelReadMarkerResponse$ChannelArn' => '<p>The ARN of the channel.</p>', 'UpdateChannelRequest$ChannelArn' => '<p>The ARN of the channel.</p>', 'UpdateChannelRequest$ChimeBearer' => '<p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>', 'UpdateChannelResponse$ChannelArn' => '<p>The ARN of the channel.</p>', ], ], 'ClientRequestToken' => [ 'base' => NULL, 'refs' => [ 'CreateChannelFlowRequest$ClientRequestToken' => '<p>The client token for the request. An Idempotency token.</p>', 'CreateChannelRequest$ClientRequestToken' => '<p>The client token for the request. An <code>Idempotency</code> token.</p>', 'SendChannelMessageRequest$ClientRequestToken' => '<p>The <code>Idempotency</code> token for each client request.</p>', ], ], 'ConflictException' => [ 'base' => '<p>The request could not be processed because of conflict in the current state of the resource.</p>', 'refs' => [], ], 'Content' => [ 'base' => NULL, 'refs' => [ 'ChannelMessage$Content' => '<p>The content of the channel message. For Amazon Lex V2 bot responses, this field holds a list of messages originating from the bot. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html\">Processing responses from an AppInstanceBot</a> in the <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>', 'ChannelMessageSummary$Content' => '<p>The content of the channel message. For Amazon Lex V2 bot responses, this field holds a list of messages originating from the bot. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html\">Processing responses from an AppInstanceBot</a> in the <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>', ], ], 'ContentType' => [ 'base' => NULL, 'refs' => [ 'ChannelMessage$ContentType' => '<p>The content type of the channel message. For Amazon Lex V2 bot responses, the content type is <code>application/amz-chime-lex-msgs</code> for success responses and <code>application/amz-chime-lex-error</code> for failure responses. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html\">Processing responses from an AppInstanceBot</a> in the <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>', 'ChannelMessageCallback$ContentType' => '<p>The content type of the call-back message. For Amazon Lex V2 bot responses, the content type is <code>application/amz-chime-lex-msgs</code> for success responses and <code>application/amz-chime-lex-error</code> for failure responses. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html\">Processing responses from an AppInstanceBot</a> in the <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>', 'ChannelMessageSummary$ContentType' => '<p>The content type of the channel message listed in the summary. For Amazon Lex V2 bot responses, the content type is <code>application/amz-chime-lex-msgs</code> for success responses and <code>application/amz-chime-lex-error</code> for failure responses. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html\">Processing responses from an AppInstanceBot</a> in the <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>', 'SendChannelMessageRequest$ContentType' => '<p>The content type of the channel message.</p>', 'UpdateChannelMessageRequest$ContentType' => '<p>The content type of the channel message.</p>', ], ], 'CreateChannelBanRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelBanResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelFlowRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelFlowResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelMembershipRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelMembershipResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelModeratorRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelModeratorResponse' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateChannelResponse' => [ 'base' => NULL, 'refs' => [], ], 'DeleteChannelBanRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteChannelFlowRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteChannelMembershipRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteChannelMessageRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteChannelModeratorRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteChannelRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteMessagingStreamingConfigurationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelBanRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelBanResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelFlowRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelFlowResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelMembershipForAppInstanceUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelMembershipForAppInstanceUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelMembershipRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelMembershipResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelModeratedByAppInstanceUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelModeratedByAppInstanceUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelModeratorRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelModeratorResponse' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeChannelResponse' => [ 'base' => NULL, 'refs' => [], ], 'DisassociateChannelFlowRequest' => [ 'base' => NULL, 'refs' => [], ], 'ElasticChannelConfiguration' => [ 'base' => '<p>The attributes required to configure and create an elastic channel. An elastic channel can support a maximum of 1-million members.</p>', 'refs' => [ 'Channel$ElasticChannelConfiguration' => '<p>The attributes required to configure and create an elastic channel. An elastic channel can support a maximum of 1-million members.</p>', 'CreateChannelRequest$ElasticChannelConfiguration' => '<p>The attributes required to configure and create an elastic channel. An elastic channel can support a maximum of 1-million users, excluding moderators.</p>', ], ], 'ErrorCode' => [ 'base' => NULL, 'refs' => [ 'BadRequestException$Code' => NULL, 'BatchCreateChannelMembershipError$ErrorCode' => '<p>The error code.</p>', 'ConflictException$Code' => NULL, 'ForbiddenException$Code' => NULL, 'NotFoundException$Code' => NULL, 'ResourceLimitExceededException$Code' => NULL, 'ServiceFailureException$Code' => NULL, 'ServiceUnavailableException$Code' => NULL, 'ThrottledClientException$Code' => NULL, 'UnauthorizedClientException$Code' => NULL, ], ], 'ExpirationCriterion' => [ 'base' => NULL, 'refs' => [ 'ExpirationSettings$ExpirationCriterion' => '<p>The conditions that must be met for a channel to expire.</p>', ], ], 'ExpirationDays' => [ 'base' => NULL, 'refs' => [ 'ExpirationSettings$ExpirationDays' => '<p>The period in days after which the system automatically deletes a channel.</p>', ], ], 'ExpirationSettings' => [ 'base' => '<p>Settings that control the interval after which a channel is deleted.</p>', 'refs' => [ 'Channel$ExpirationSettings' => '<p>Settings that control when a channel expires.</p>', 'CreateChannelRequest$ExpirationSettings' => '<p>Settings that control the interval after which the channel is automatically deleted.</p>', 'PutChannelExpirationSettingsRequest$ExpirationSettings' => '<p>Settings that control the interval after which a channel is deleted.</p>', 'PutChannelExpirationSettingsResponse$ExpirationSettings' => '<p>Settings that control the interval after which a channel is deleted.</p>', ], ], 'FallbackAction' => [ 'base' => NULL, 'refs' => [ 'Processor$FallbackAction' => '<p>Determines whether to continue with message processing or stop it in cases where communication with a processor fails. If a processor has a fallback action of <code>ABORT</code> and communication with it fails, the processor sets the message status to <code>FAILED</code> and does not send the message to any recipients. Note that if the last processor in the channel flow sequence has a fallback action of <code>CONTINUE</code> and communication with the processor fails, then the message is considered processed and sent to recipients of the channel.</p>', ], ], 'FilterRule' => [ 'base' => NULL, 'refs' => [ 'PushNotificationPreferences$FilterRule' => '<p>The simple JSON object used to send a subset of a push notification to the requested member.</p>', ], ], 'ForbiddenException' => [ 'base' => '<p>The client is permanently forbidden from making the request.</p>', 'refs' => [], ], 'GetChannelMembershipPreferencesRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetChannelMembershipPreferencesResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetChannelMessageRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetChannelMessageResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetChannelMessageStatusRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetChannelMessageStatusResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetMessagingSessionEndpointRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetMessagingSessionEndpointResponse' => [ 'base' => NULL, 'refs' => [], ], 'GetMessagingStreamingConfigurationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetMessagingStreamingConfigurationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'Identity' => [ 'base' => '<p>The details of a user or bot.</p>', 'refs' => [ 'BatchChannelMemberships$InvitedBy' => '<p>The identifier of the member who invited another member.</p>', 'Channel$CreatedBy' => '<p>The <code>AppInstanceUser</code> who created the channel.</p>', 'ChannelBan$Member' => '<p>The member being banned from the channel.</p>', 'ChannelBan$CreatedBy' => '<p>The <code>AppInstanceUser</code> who created the ban.</p>', 'ChannelBanSummary$Member' => '<p>The member being banned from a channel.</p>', 'ChannelMembership$InvitedBy' => '<p>The identifier of the member who invited another member.</p>', 'ChannelMembership$Member' => '<p>The data of the channel member.</p>', 'ChannelMembershipSummary$Member' => '<p>A member\\'s summary data.</p>', 'ChannelMessage$Sender' => '<p>The message sender.</p>', 'ChannelMessageSummary$Sender' => '<p>The message sender.</p>', 'ChannelModerator$Moderator' => '<p>The moderator\\'s data.</p>', 'ChannelModerator$CreatedBy' => '<p>The <code>AppInstanceUser</code> who created the moderator.</p>', 'ChannelModeratorSummary$Moderator' => '<p>The data for a moderator.</p>', 'CreateChannelBanResponse$Member' => '<p>The <code>ChannelArn</code> and <code>BannedIdentity</code> of the member in the ban response.</p>', 'CreateChannelMembershipResponse$Member' => '<p>The ARN and metadata of the member being added.</p>', 'CreateChannelModeratorResponse$ChannelModerator' => '<p>The ARNs of the channel and the moderator.</p>', 'GetChannelMembershipPreferencesResponse$Member' => '<p>The details of a user.</p>', 'Members$member' => NULL, 'PutChannelMembershipPreferencesResponse$Member' => '<p>The details of a user.</p>', ], ], 'InvocationType' => [ 'base' => NULL, 'refs' => [ 'LambdaConfiguration$InvocationType' => '<p>Controls how the Lambda function is invoked.</p>', ], ], 'LambdaConfiguration' => [ 'base' => '<p>Stores metadata about a Lambda processor.</p>', 'refs' => [ 'ProcessorConfiguration$Lambda' => '<p>Indicates that the processor is of type Lambda.</p>', ], ], 'LambdaFunctionArn' => [ 'base' => NULL, 'refs' => [ 'LambdaConfiguration$ResourceArn' => '<p>The ARN of the Lambda message processing function.</p>', ], ], 'ListChannelBansRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelBansResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelFlowsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelFlowsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelMembershipsForAppInstanceUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelMembershipsForAppInstanceUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelMembershipsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelMembershipsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelMessagesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelMessagesResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelModeratorsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelModeratorsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelsAssociatedWithChannelFlowRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelsAssociatedWithChannelFlowResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelsModeratedByAppInstanceUserRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelsModeratedByAppInstanceUserResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListChannelsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListSubChannelsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListSubChannelsResponse' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'ListChannelBansRequest$MaxResults' => '<p>The maximum number of bans that you want returned.</p>', 'ListChannelFlowsRequest$MaxResults' => '<p>The maximum number of channel flows that you want to return.</p>', 'ListChannelMembershipsForAppInstanceUserRequest$MaxResults' => '<p>The maximum number of users that you want returned.</p>', 'ListChannelMembershipsRequest$MaxResults' => '<p>The maximum number of channel memberships that you want returned.</p>', 'ListChannelMessagesRequest$MaxResults' => '<p>The maximum number of messages that you want returned.</p>', 'ListChannelModeratorsRequest$MaxResults' => '<p>The maximum number of moderators that you want returned.</p>', 'ListChannelsAssociatedWithChannelFlowRequest$MaxResults' => '<p>The maximum number of channels that you want to return.</p>', 'ListChannelsModeratedByAppInstanceUserRequest$MaxResults' => '<p>The maximum number of channels in the request.</p>', 'ListChannelsRequest$MaxResults' => '<p>The maximum number of channels that you want to return.</p>', 'ListSubChannelsRequest$MaxResults' => '<p>The maximum number of sub-channels that you want to return.</p>', 'SearchChannelsRequest$MaxResults' => '<p>The maximum number of channels that you want returned.</p>', ], ], 'MaximumSubChannels' => [ 'base' => NULL, 'refs' => [ 'ElasticChannelConfiguration$MaximumSubChannels' => '<p>The maximum number of SubChannels that you want to allow in the elastic channel.</p>', ], ], 'MemberArns' => [ 'base' => NULL, 'refs' => [ 'BatchCreateChannelMembershipRequest$MemberArns' => '<p>The ARNs of the members you want to add to the channel. Only <code>AppInstanceUsers</code> and <code>AppInstanceBots</code> can be added as a channel member.</p>', ], ], 'Members' => [ 'base' => NULL, 'refs' => [ 'BatchChannelMemberships$Members' => '<p>The users successfully added to the request.</p>', ], ], 'MembershipCount' => [ 'base' => NULL, 'refs' => [ 'SubChannelSummary$MembershipCount' => '<p>The number of members in a SubChannel.</p>', ], ], 'MessageAttributeMap' => [ 'base' => NULL, 'refs' => [ 'ChannelMessage$MessageAttributes' => '<p>The attributes for the channel message. For Amazon Lex V2 bot responses, the attributes are mapped to specific fields from the bot. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html\">Processing responses from an AppInstanceBot</a> in the <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>', 'ChannelMessageCallback$MessageAttributes' => '<p>The attributes for the channel message. For Amazon Lex V2 bot responses, the attributes are mapped to specific fields from the bot. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html\">Processing responses from an AppInstanceBot</a> in the <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>', 'ChannelMessageSummary$MessageAttributes' => '<p>The attributes for the channel message. For Amazon Lex V2 bot responses, the attributes are mapped to specific fields from the bot. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html\">Processing responses from an AppInstanceBot</a> in the <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>', 'SendChannelMessageRequest$MessageAttributes' => '<p>The attributes for the message, used for message filtering along with a <code>FilterRule</code> defined in the <code>PushNotificationPreferences</code>.</p>', ], ], 'MessageAttributeName' => [ 'base' => NULL, 'refs' => [ 'MessageAttributeMap$key' => NULL, ], ], 'MessageAttributeStringValue' => [ 'base' => NULL, 'refs' => [ 'MessageAttributeStringValues$member' => NULL, ], ], 'MessageAttributeStringValues' => [ 'base' => NULL, 'refs' => [ 'MessageAttributeValue$StringValues' => '<p>The strings in a message attribute value.</p>', ], ], 'MessageAttributeValue' => [ 'base' => '<p>A list of message attribute values.</p>', 'refs' => [ 'MessageAttributeMap$value' => NULL, ], ], 'MessageId' => [ 'base' => NULL, 'refs' => [ 'ChannelMessage$MessageId' => '<p>The ID of a message.</p>', 'ChannelMessageCallback$MessageId' => '<p>The message ID.</p>', 'ChannelMessageSummary$MessageId' => '<p>The ID of the message.</p>', 'DeleteChannelMessageRequest$MessageId' => '<p>The ID of the message being deleted.</p>', 'GetChannelMessageRequest$MessageId' => '<p>The ID of the message.</p>', 'GetChannelMessageStatusRequest$MessageId' => '<p>The ID of the message.</p>', 'RedactChannelMessageRequest$MessageId' => '<p>The ID of the message being redacted.</p>', 'RedactChannelMessageResponse$MessageId' => '<p>The ID of the message being redacted.</p>', 'SendChannelMessageResponse$MessageId' => '<p>The ID string assigned to each message.</p>', 'UpdateChannelMessageRequest$MessageId' => '<p>The ID string of the message being updated.</p>', 'UpdateChannelMessageResponse$MessageId' => '<p>The ID string of the message being updated.</p>', ], ], 'MessagingDataType' => [ 'base' => NULL, 'refs' => [ 'StreamingConfiguration$DataType' => '<p>The data type of the configuration.</p>', ], ], 'MessagingSessionEndpoint' => [ 'base' => '<p>The websocket endpoint used to connect to Amazon Chime SDK messaging.</p>', 'refs' => [ 'GetMessagingSessionEndpointResponse$Endpoint' => '<p>The endpoint returned in the response.</p>', ], ], 'Metadata' => [ 'base' => NULL, 'refs' => [ 'Channel$Metadata' => '<p>The channel\\'s metadata.</p>', 'ChannelAssociatedWithFlowSummary$Metadata' => '<p>The channel\\'s metadata.</p>', 'ChannelMessage$Metadata' => '<p>The message metadata.</p>', 'ChannelMessageCallback$Metadata' => '<p>The message metadata.</p>', 'ChannelMessageSummary$Metadata' => '<p>The metadata of the message.</p>', 'ChannelSummary$Metadata' => '<p>The metadata of the channel.</p>', 'CreateChannelRequest$Metadata' => '<p>The metadata of the creation request. Limited to 1KB and UTF-8.</p>', 'SendChannelMessageRequest$Metadata' => '<p>The optional metadata for each message.</p>', 'UpdateChannelMessageRequest$Metadata' => '<p>The metadata of the message being updated.</p>', 'UpdateChannelRequest$Metadata' => '<p>The metadata for the update request.</p>', ], ], 'MinimumMembershipPercentage' => [ 'base' => NULL, 'refs' => [ 'ElasticChannelConfiguration$MinimumMembershipPercentage' => '<p>The minimum allowed percentage of TargetMembershipsPerSubChannel users. Ceil of the calculated value is used in balancing members among SubChannels of the elastic channel.</p>', ], ], 'NextToken' => [ 'base' => NULL, 'refs' => [ 'ListChannelBansRequest$NextToken' => '<p>The token passed by previous API calls until all requested bans are returned.</p>', 'ListChannelBansResponse$NextToken' => '<p>The token passed by previous API calls until all requested bans are returned.</p>', 'ListChannelFlowsRequest$NextToken' => '<p>The token passed by previous API calls until all requested channel flows are returned.</p>', 'ListChannelFlowsResponse$NextToken' => '<p>The token passed by previous API calls until all requested channels are returned.</p>', 'ListChannelMembershipsForAppInstanceUserRequest$NextToken' => '<p>The token returned from previous API requests until the number of channel memberships is reached.</p>', 'ListChannelMembershipsForAppInstanceUserResponse$NextToken' => '<p>The token passed by previous API calls until all requested users are returned.</p>', 'ListChannelMembershipsRequest$NextToken' => '<p>The token passed by previous API calls until all requested channel memberships are returned.</p>', 'ListChannelMembershipsResponse$NextToken' => '<p>The token passed by previous API calls until all requested channel memberships are returned.</p>', 'ListChannelMessagesRequest$NextToken' => '<p>The token passed by previous API calls until all requested messages are returned.</p>', 'ListChannelMessagesResponse$NextToken' => '<p>The token passed by previous API calls until all requested messages are returned.</p>', 'ListChannelModeratorsRequest$NextToken' => '<p>The token passed by previous API calls until all requested moderators are returned.</p>', 'ListChannelModeratorsResponse$NextToken' => '<p>The token passed by previous API calls until all requested moderators are returned.</p>', 'ListChannelsAssociatedWithChannelFlowRequest$NextToken' => '<p>The token passed by previous API calls until all requested channels are returned.</p>', 'ListChannelsAssociatedWithChannelFlowResponse$NextToken' => '<p>The token passed by previous API calls until all requested channels are returned.</p>', 'ListChannelsModeratedByAppInstanceUserRequest$NextToken' => '<p>The token returned from previous API requests until the number of channels moderated by the user is reached.</p>', 'ListChannelsModeratedByAppInstanceUserResponse$NextToken' => '<p>The token returned from previous API requests until the number of channels moderated by the user is reached.</p>', 'ListChannelsRequest$NextToken' => '<p>The token passed by previous API calls until all requested channels are returned.</p>', 'ListChannelsResponse$NextToken' => '<p>The token returned from previous API requests until the number of channels is reached.</p>', 'ListSubChannelsRequest$NextToken' => '<p>The token passed by previous API calls until all requested sub-channels are returned.</p>', 'ListSubChannelsResponse$NextToken' => '<p>The token passed by previous API calls until all requested sub-channels are returned.</p>', 'SearchChannelsRequest$NextToken' => '<p>The token returned from previous API requests until the number of channels is reached.</p>', 'SearchChannelsResponse$NextToken' => '<p>The token returned from previous API responses until the number of channels is reached.</p>', ], ], 'NonEmptyContent' => [ 'base' => NULL, 'refs' => [ 'ChannelMessageCallback$Content' => '<p>The message content. For Amazon Lex V2 bot responses, this field holds a list of messages originating from the bot. For more information, refer to <a href=\"https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html\">Processing responses from an AppInstanceBot</a> in the <i>Amazon Chime SDK Messaging Developer Guide</i>.</p>', 'SendChannelMessageRequest$Content' => '<p>The content of the channel message.</p>', 'UpdateChannelMessageRequest$Content' => '<p>The content of the channel message. </p>', ], ], 'NonEmptyResourceName' => [ 'base' => NULL, 'refs' => [ 'Channel$Name' => '<p>The name of a channel.</p>', 'ChannelAssociatedWithFlowSummary$Name' => '<p>The name of the channel flow.</p>', 'ChannelFlow$Name' => '<p>The name of the channel flow.</p>', 'ChannelFlowSummary$Name' => '<p>The name of the channel flow.</p>', 'ChannelSummary$Name' => '<p>The name of the channel.</p>', 'CreateChannelFlowRequest$Name' => '<p>The name of the channel flow.</p>', 'CreateChannelRequest$Name' => '<p>The name of the channel.</p>', 'Processor$Name' => '<p>The name of the channel flow.</p>', 'UpdateChannelFlowRequest$Name' => '<p>The name of the channel flow.</p>', 'UpdateChannelRequest$Name' => '<p>The name of the channel.</p>', ], ], 'NonNullableBoolean' => [ 'base' => NULL, 'refs' => [ 'ChannelFlowCallbackRequest$DeleteResource' => '<p>When a processor determines that a message needs to be <code>DENIED</code>, pass this parameter with a value of true.</p>', 'ChannelMessage$Redacted' => '<p>Hides the content of a message.</p>', 'ChannelMessageSummary$Redacted' => '<p>Indicates whether a message was redacted.</p>', ], ], 'NotFoundException' => [ 'base' => '<p>One or more of the resources in the request does not exist in the system.</p>', 'refs' => [], ], 'Processor' => [ 'base' => '<p>The information about a processor in a channel flow.</p>', 'refs' => [ 'ProcessorList$member' => NULL, ], ], 'ProcessorConfiguration' => [ 'base' => '<p>A processor\\'s metadata.</p>', 'refs' => [ 'Processor$Configuration' => '<p>The information about the type of processor and its identifier.</p>', ], ], 'ProcessorList' => [ 'base' => NULL, 'refs' => [ 'ChannelFlow$Processors' => '<p>Information about the processor Lambda functions.</p>', 'ChannelFlowSummary$Processors' => '<p>Information about the processor Lambda functions.</p>', 'CreateChannelFlowRequest$Processors' => '<p>Information about the processor Lambda functions.</p>', 'UpdateChannelFlowRequest$Processors' => '<p>Information about the processor Lambda functions </p>', ], ], 'PushNotificationBody' => [ 'base' => NULL, 'refs' => [ 'PushNotificationConfiguration$Body' => '<p>The body of the push notification.</p>', ], ], 'PushNotificationConfiguration' => [ 'base' => '<p>The push notification configuration of the message.</p>', 'refs' => [ 'ChannelMessageCallback$PushNotification' => '<p>The push notification configuration of the message.</p>', 'SendChannelMessageRequest$PushNotification' => '<p>The push notification configuration of the message.</p>', ], ], 'PushNotificationPreferences' => [ 'base' => '<p>The channel membership preferences for push notification.</p>', 'refs' => [ 'ChannelMembershipPreferences$PushNotifications' => '<p>The push notification configuration of a message.</p>', ], ], 'PushNotificationTitle' => [ 'base' => NULL, 'refs' => [ 'PushNotificationConfiguration$Title' => '<p>The title of the push notification.</p>', ], ], 'PushNotificationType' => [ 'base' => NULL, 'refs' => [ 'PushNotificationConfiguration$Type' => '<p>Enum value that indicates the type of the push notification for a message. <code>DEFAULT</code>: Normal mobile push notification. <code>VOIP</code>: VOIP mobile push notification.</p>', ], ], 'PutChannelExpirationSettingsRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutChannelExpirationSettingsResponse' => [ 'base' => NULL, 'refs' => [], ], 'PutChannelMembershipPreferencesRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutChannelMembershipPreferencesResponse' => [ 'base' => NULL, 'refs' => [], ], 'PutMessagingStreamingConfigurationsRequest' => [ 'base' => NULL, 'refs' => [], ], 'PutMessagingStreamingConfigurationsResponse' => [ 'base' => NULL, 'refs' => [], ], 'RedactChannelMessageRequest' => [ 'base' => NULL, 'refs' => [], ], 'RedactChannelMessageResponse' => [ 'base' => NULL, 'refs' => [], ], 'ResourceLimitExceededException' => [ 'base' => '<p>The request exceeds the resource limit.</p>', 'refs' => [], ], 'ResourceName' => [ 'base' => NULL, 'refs' => [ 'Identity$Name' => '<p>The name in an Identity.</p>', ], ], 'SearchChannelsRequest' => [ 'base' => NULL, 'refs' => [], ], 'SearchChannelsResponse' => [ 'base' => NULL, 'refs' => [], ], 'SearchField' => [ 'base' => '<p>A <code>Field</code> of the channel that you want to search.</p>', 'refs' => [ 'SearchFields$member' => NULL, ], ], 'SearchFieldKey' => [ 'base' => NULL, 'refs' => [ 'SearchField$Key' => '<p>An <code>enum</code> value that indicates the key to search the channel on. <code>MEMBERS</code> allows you to search channels based on memberships. You can use it with the <code>EQUALS</code> operator to get channels whose memberships are equal to the specified values, and with the <code>INCLUDES</code> operator to get channels whose memberships include the specified values.</p>', ], ], 'SearchFieldOperator' => [ 'base' => NULL, 'refs' => [ 'SearchField$Operator' => '<p>The operator used to compare field values, currently <code>EQUALS</code> or <code>INCLUDES</code>. Use the <code>EQUALS</code> operator to find channels whose memberships equal the specified values. Use the <code>INCLUDES</code> operator to find channels whose memberships include the specified values.</p>', ], ], 'SearchFieldValue' => [ 'base' => NULL, 'refs' => [ 'SearchFieldValues$member' => NULL, ], ], 'SearchFieldValues' => [ 'base' => NULL, 'refs' => [ 'SearchField$Values' => '<p>The values that you want to search for, a list of strings. The values must be <code>AppInstanceUserArns</code> specified as a list of strings.</p> <note> <p>This operation isn\\'t supported for <code>AppInstanceUsers</code> with large number of memberships.</p> </note>', ], ], 'SearchFields' => [ 'base' => NULL, 'refs' => [ 'SearchChannelsRequest$Fields' => '<p>A list of the <code>Field</code> objects in the channel being searched.</p>', ], ], 'SendChannelMessageRequest' => [ 'base' => NULL, 'refs' => [], ], 'SendChannelMessageResponse' => [ 'base' => NULL, 'refs' => [], ], 'ServiceFailureException' => [ 'base' => '<p>The service encountered an unexpected error.</p>', 'refs' => [], ], 'ServiceUnavailableException' => [ 'base' => '<p>The service is currently unavailable.</p>', 'refs' => [], ], 'SortOrder' => [ 'base' => NULL, 'refs' => [ 'ListChannelMessagesRequest$SortOrder' => '<p>The order in which you want messages sorted. Default is Descending, based on time created.</p>', ], ], 'StatusDetail' => [ 'base' => NULL, 'refs' => [ 'ChannelMessageStatusStructure$Detail' => '<p>Contains more details about the message status.</p>', ], ], 'StreamingConfiguration' => [ 'base' => '<p>The configuration for connecting a messaging stream to Amazon Kinesis.</p>', 'refs' => [ 'StreamingConfigurationList$member' => NULL, ], ], 'StreamingConfigurationList' => [ 'base' => NULL, 'refs' => [ 'GetMessagingStreamingConfigurationsResponse$StreamingConfigurations' => '<p>The streaming settings.</p>', 'PutMessagingStreamingConfigurationsRequest$StreamingConfigurations' => '<p>The streaming configurations.</p>', 'PutMessagingStreamingConfigurationsResponse$StreamingConfigurations' => '<p>The requested streaming configurations.</p>', ], ], 'String' => [ 'base' => NULL, 'refs' => [ 'BadRequestException$Message' => NULL, 'BatchCreateChannelMembershipError$ErrorMessage' => '<p>The error message.</p>', 'ConflictException$Message' => NULL, 'ForbiddenException$Message' => NULL, 'NotFoundException$Message' => NULL, 'ResourceLimitExceededException$Message' => NULL, 'ServiceFailureException$Message' => NULL, 'ServiceUnavailableException$Message' => NULL, 'ThrottledClientException$Message' => NULL, 'UnauthorizedClientException$Message' => NULL, ], ], 'SubChannelId' => [ 'base' => NULL, 'refs' => [ 'AppInstanceUserMembershipSummary$SubChannelId' => '<p>The ID of the SubChannel that the <code>AppInstanceUser</code> is a member of.</p>', 'BatchChannelMemberships$SubChannelId' => '<p>The ID of the SubChannel.</p>', 'BatchCreateChannelMembershipRequest$SubChannelId' => '<p>The ID of the SubChannel in the request. </p> <note> <p>Only required when creating membership in a SubChannel for a moderator in an elastic channel.</p> </note>', 'ChannelMembership$SubChannelId' => '<p>The ID of the SubChannel that a user belongs to.</p>', 'ChannelMessage$SubChannelId' => '<p>The ID of the SubChannel.</p>', 'ChannelMessageCallback$SubChannelId' => '<p>The ID of the SubChannel.</p>', 'CreateChannelMembershipRequest$SubChannelId' => '<p>The ID of the SubChannel in the request.</p> <note> <p>Only required when creating membership in a SubChannel for a moderator in an elastic channel.</p> </note>', 'CreateChannelMembershipResponse$SubChannelId' => '<p>The ID of the SubChannel in the response.</p>', 'DeleteChannelMembershipRequest$SubChannelId' => '<p>The ID of the SubChannel in the request.</p> <note> <p>Only for use by moderators.</p> </note>', 'DeleteChannelMessageRequest$SubChannelId' => '<p>The ID of the SubChannel in the request.</p> <note> <p>Only required when deleting messages in a SubChannel that the user belongs to.</p> </note>', 'DescribeChannelMembershipRequest$SubChannelId' => '<p>The ID of the SubChannel in the request. The response contains an <code>ElasticChannelConfiguration</code> object.</p> <note> <p>Only required to get a user\u00e2\u20ac\u2122s SubChannel membership details.</p> </note>', 'GetChannelMessageRequest$SubChannelId' => '<p>The ID of the SubChannel in the request.</p> <note> <p>Only required when getting messages in a SubChannel that the user belongs to.</p> </note>', 'GetChannelMessageStatusRequest$SubChannelId' => '<p>The ID of the SubChannel in the request.</p> <note> <p>Only required when getting message status in a SubChannel that the user belongs to.</p> </note>', 'ListChannelMembershipsRequest$SubChannelId' => '<p>The ID of the SubChannel in the request.</p> <note> <p>Only required when listing a user\\'s memberships in a particular sub-channel of an elastic channel.</p> </note>', 'ListChannelMessagesRequest$SubChannelId' => '<p>The ID of the SubChannel in the request.</p> <note> <p>Only required when listing the messages in a SubChannel that the user belongs to.</p> </note>', 'ListChannelMessagesResponse$SubChannelId' => '<p>The ID of the SubChannel in the response.</p>', 'RedactChannelMessageRequest$SubChannelId' => '<p>The ID of the SubChannel in the request.</p>', 'RedactChannelMessageResponse$SubChannelId' => '<p>The ID of the SubChannel in the response.</p> <note> <p>Only required when redacting messages in a SubChannel that the user belongs to.</p> </note>', 'SendChannelMessageRequest$SubChannelId' => '<p>The ID of the SubChannel in the request.</p>', 'SendChannelMessageResponse$SubChannelId' => '<p>The ID of the SubChannel in the response.</p>', 'SubChannelSummary$SubChannelId' => '<p>The unique ID of a SubChannel.</p>', 'UpdateChannelMessageRequest$SubChannelId' => '<p>The ID of the SubChannel in the request.</p> <note> <p>Only required when updating messages in a SubChannel that the user belongs to.</p> </note>', 'UpdateChannelMessageResponse$SubChannelId' => '<p>The ID of the SubChannel in the response.</p>', ], ], 'SubChannelSummary' => [ 'base' => '<p>Summary of the sub-channels associated with the elastic channel.</p>', 'refs' => [ 'SubChannelSummaryList$member' => NULL, ], ], 'SubChannelSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListSubChannelsResponse$SubChannels' => '<p>The information about each sub-channel.</p>', ], ], 'Tag' => [ 'base' => '<p>A tag object containing a key-value pair.</p>', 'refs' => [ 'TagList$member' => NULL, ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'Tag$Key' => '<p>The key in a tag.</p>', 'TagKeyList$member' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$TagKeys' => '<p>The tag keys.</p>', ], ], 'TagList' => [ 'base' => NULL, 'refs' => [ 'CreateChannelFlowRequest$Tags' => '<p>The tags for the creation request.</p>', 'CreateChannelRequest$Tags' => '<p>The tags for the creation request.</p>', 'ListTagsForResourceResponse$Tags' => '<p>The tag key-value pairs.</p>', 'TagResourceRequest$Tags' => '<p>The tag key-value pairs.</p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'Tag$Value' => '<p>The value in a tag.</p>', ], ], 'Target' => [ 'base' => '<p>The target of a message, a sender, a user, or a bot. Only the target and the sender can view targeted messages. Only users who can see targeted messages can take actions on them. However, administrators can delete targeted messages that they can\u00e2\u20ac\u2122t see.</p>', 'refs' => [ 'TargetList$member' => NULL, ], ], 'TargetList' => [ 'base' => NULL, 'refs' => [ 'ChannelMessage$Target' => '<p>The target of a message, a sender, a user, or a bot. Only the target and the sender can view targeted messages. Only users who can see targeted messages can take actions on them. However, administrators can delete targeted messages that they can\u00e2\u20ac\u2122t see.</p>', 'ChannelMessageSummary$Target' => '<p>The target of a message, a sender, a user, or a bot. Only the target and the sender can view targeted messages. Only users who can see targeted messages can take actions on them. However, administrators can delete targeted messages that they can\u00e2\u20ac\u2122t see.</p>', 'SendChannelMessageRequest$Target' => '<p>The target of a message. Must be a member of the channel, such as another user, a bot, or the sender. Only the target and the sender can view targeted messages. Only users who can see targeted messages can take actions on them. However, administrators can delete targeted messages that they can\u00e2\u20ac\u2122t see. </p>', ], ], 'TargetMembershipsPerSubChannel' => [ 'base' => NULL, 'refs' => [ 'ElasticChannelConfiguration$TargetMembershipsPerSubChannel' => '<p>The maximum number of members allowed in a SubChannel.</p>', ], ], 'ThrottledClientException' => [ 'base' => '<p>The client exceeded its request rate limit.</p>', 'refs' => [], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [ 'AppInstanceUserMembershipSummary$ReadMarkerTimestamp' => '<p>The time at which an <code>AppInstanceUser</code> last marked a channel as read.</p>', 'Channel$CreatedTimestamp' => '<p>The time at which the <code>AppInstanceUser</code> created the channel.</p>', 'Channel$LastMessageTimestamp' => '<p>The time at which a member sent the last message in the channel.</p>', 'Channel$LastUpdatedTimestamp' => '<p>The time at which a channel was last updated.</p>', 'ChannelBan$CreatedTimestamp' => '<p>The time at which the ban was created.</p>', 'ChannelFlow$CreatedTimestamp' => '<p>The time at which the channel flow was created.</p>', 'ChannelFlow$LastUpdatedTimestamp' => '<p>The time at which a channel flow was updated.</p>', 'ChannelMembership$CreatedTimestamp' => '<p>The time at which the channel membership was created.</p>', 'ChannelMembership$LastUpdatedTimestamp' => '<p>The time at which a channel membership was last updated.</p>', 'ChannelMessage$CreatedTimestamp' => '<p>The time at which the message was created.</p>', 'ChannelMessage$LastEditedTimestamp' => '<p>The time at which a message was edited.</p>', 'ChannelMessage$LastUpdatedTimestamp' => '<p>The time at which a message was updated.</p>', 'ChannelMessageSummary$CreatedTimestamp' => '<p>The time at which the message summary was created.</p>', 'ChannelMessageSummary$LastUpdatedTimestamp' => '<p>The time at which a message was last updated.</p>', 'ChannelMessageSummary$LastEditedTimestamp' => '<p>The time at which a message was last edited.</p>', 'ChannelModerator$CreatedTimestamp' => '<p>The time at which the moderator was created.</p>', 'ChannelSummary$LastMessageTimestamp' => '<p>The time at which the last persistent message visible to the caller in a channel was sent.</p>', 'ListChannelMessagesRequest$NotBefore' => '<p>The initial or starting time stamp for your requested messages.</p>', 'ListChannelMessagesRequest$NotAfter' => '<p>The final or ending time stamp for your requested messages.</p>', ], ], 'UnauthorizedClientException' => [ 'base' => '<p>The client is not currently authorized to make the request.</p>', 'refs' => [], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateChannelFlowRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateChannelFlowResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateChannelMessageRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateChannelMessageResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateChannelReadMarkerRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateChannelReadMarkerResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateChannelRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateChannelResponse' => [ 'base' => NULL, 'refs' => [], ], 'UrlType' => [ 'base' => NULL, 'refs' => [ 'MessagingSessionEndpoint$Url' => '<p>The endpoint to which you establish a websocket connection.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-messaging/2021-05-15/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://messaging-chime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://messaging-chime-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://messaging-chime.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://messaging-chime.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-messaging/2021-05-15/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => true, 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://messaging-chime.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseFIPS' => false, 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with region set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with region not set and fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => true, 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseFIPS' => false, 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'Missing region', 'expect' => [ 'error' => 'Invalid Configuration: Missing Region', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-messaging/2021-05-15/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-messaging/2021-05-15/paginators-1.json\nreturn [ 'pagination' => [ 'ListChannelBans' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListChannelFlows' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListChannelMemberships' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListChannelMembershipsForAppInstanceUser' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListChannelMessages' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListChannelModerators' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListChannels' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListChannelsAssociatedWithChannelFlow' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListChannelsModeratedByAppInstanceUser' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListSubChannels' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'SearchChannels' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-voice/2022-08-03/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2022-08-03', 'endpointPrefix' => 'voice-chime', 'protocol' => 'rest-json', 'serviceFullName' => 'Amazon Chime SDK Voice', 'serviceId' => 'Chime SDK Voice', 'signatureVersion' => 'v4', 'signingName' => 'chime', 'uid' => 'chime-sdk-voice-2022-08-03', ], 'operations' => [ 'AssociatePhoneNumbersWithVoiceConnector' => [ 'name' => 'AssociatePhoneNumbersWithVoiceConnector', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors/{voiceConnectorId}?operation=associate-phone-numbers', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AssociatePhoneNumbersWithVoiceConnectorRequest', ], 'output' => [ 'shape' => 'AssociatePhoneNumbersWithVoiceConnectorResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'AssociatePhoneNumbersWithVoiceConnectorGroup' => [ 'name' => 'AssociatePhoneNumbersWithVoiceConnectorGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connector-groups/{voiceConnectorGroupId}?operation=associate-phone-numbers', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AssociatePhoneNumbersWithVoiceConnectorGroupRequest', ], 'output' => [ 'shape' => 'AssociatePhoneNumbersWithVoiceConnectorGroupResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'BatchDeletePhoneNumber' => [ 'name' => 'BatchDeletePhoneNumber', 'http' => [ 'method' => 'POST', 'requestUri' => '/phone-numbers?operation=batch-delete', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchDeletePhoneNumberRequest', ], 'output' => [ 'shape' => 'BatchDeletePhoneNumberResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'BatchUpdatePhoneNumber' => [ 'name' => 'BatchUpdatePhoneNumber', 'http' => [ 'method' => 'POST', 'requestUri' => '/phone-numbers?operation=batch-update', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchUpdatePhoneNumberRequest', ], 'output' => [ 'shape' => 'BatchUpdatePhoneNumberResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreatePhoneNumberOrder' => [ 'name' => 'CreatePhoneNumberOrder', 'http' => [ 'method' => 'POST', 'requestUri' => '/phone-number-orders', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreatePhoneNumberOrderRequest', ], 'output' => [ 'shape' => 'CreatePhoneNumberOrderResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateProxySession' => [ 'name' => 'CreateProxySession', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors/{voiceConnectorId}/proxy-sessions', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateProxySessionRequest', ], 'output' => [ 'shape' => 'CreateProxySessionResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateSipMediaApplication' => [ 'name' => 'CreateSipMediaApplication', 'http' => [ 'method' => 'POST', 'requestUri' => '/sip-media-applications', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateSipMediaApplicationRequest', ], 'output' => [ 'shape' => 'CreateSipMediaApplicationResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateSipMediaApplicationCall' => [ 'name' => 'CreateSipMediaApplicationCall', 'http' => [ 'method' => 'POST', 'requestUri' => '/sip-media-applications/{sipMediaApplicationId}/calls', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateSipMediaApplicationCallRequest', ], 'output' => [ 'shape' => 'CreateSipMediaApplicationCallResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateSipRule' => [ 'name' => 'CreateSipRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/sip-rules', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateSipRuleRequest', ], 'output' => [ 'shape' => 'CreateSipRuleResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateVoiceConnector' => [ 'name' => 'CreateVoiceConnector', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateVoiceConnectorRequest', ], 'output' => [ 'shape' => 'CreateVoiceConnectorResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateVoiceConnectorGroup' => [ 'name' => 'CreateVoiceConnectorGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connector-groups', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateVoiceConnectorGroupRequest', ], 'output' => [ 'shape' => 'CreateVoiceConnectorGroupResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateVoiceProfile' => [ 'name' => 'CreateVoiceProfile', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-profiles', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateVoiceProfileRequest', ], 'output' => [ 'shape' => 'CreateVoiceProfileResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'GoneException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'CreateVoiceProfileDomain' => [ 'name' => 'CreateVoiceProfileDomain', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-profile-domains', 'responseCode' => 201, ], 'input' => [ 'shape' => 'CreateVoiceProfileDomainRequest', ], 'output' => [ 'shape' => 'CreateVoiceProfileDomainResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeletePhoneNumber' => [ 'name' => 'DeletePhoneNumber', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/phone-numbers/{phoneNumberId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeletePhoneNumberRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteProxySession' => [ 'name' => 'DeleteProxySession', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-connectors/{voiceConnectorId}/proxy-sessions/{proxySessionId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteProxySessionRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteSipMediaApplication' => [ 'name' => 'DeleteSipMediaApplication', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/sip-media-applications/{sipMediaApplicationId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteSipMediaApplicationRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteSipRule' => [ 'name' => 'DeleteSipRule', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/sip-rules/{sipRuleId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteSipRuleRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteVoiceConnector' => [ 'name' => 'DeleteVoiceConnector', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-connectors/{voiceConnectorId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceConnectorRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteVoiceConnectorEmergencyCallingConfiguration' => [ 'name' => 'DeleteVoiceConnectorEmergencyCallingConfiguration', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-connectors/{voiceConnectorId}/emergency-calling-configuration', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceConnectorEmergencyCallingConfigurationRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteVoiceConnectorGroup' => [ 'name' => 'DeleteVoiceConnectorGroup', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-connector-groups/{voiceConnectorGroupId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceConnectorGroupRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteVoiceConnectorOrigination' => [ 'name' => 'DeleteVoiceConnectorOrigination', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-connectors/{voiceConnectorId}/origination', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceConnectorOriginationRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteVoiceConnectorProxy' => [ 'name' => 'DeleteVoiceConnectorProxy', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-connectors/{voiceConnectorId}/programmable-numbers/proxy', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceConnectorProxyRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteVoiceConnectorStreamingConfiguration' => [ 'name' => 'DeleteVoiceConnectorStreamingConfiguration', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-connectors/{voiceConnectorId}/streaming-configuration', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceConnectorStreamingConfigurationRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteVoiceConnectorTermination' => [ 'name' => 'DeleteVoiceConnectorTermination', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-connectors/{voiceConnectorId}/termination', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceConnectorTerminationRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteVoiceConnectorTerminationCredentials' => [ 'name' => 'DeleteVoiceConnectorTerminationCredentials', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors/{voiceConnectorId}/termination/credentials?operation=delete', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceConnectorTerminationCredentialsRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteVoiceProfile' => [ 'name' => 'DeleteVoiceProfile', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-profiles/{VoiceProfileId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceProfileRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DeleteVoiceProfileDomain' => [ 'name' => 'DeleteVoiceProfileDomain', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/voice-profile-domains/{VoiceProfileDomainId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteVoiceProfileDomainRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DisassociatePhoneNumbersFromVoiceConnector' => [ 'name' => 'DisassociatePhoneNumbersFromVoiceConnector', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors/{voiceConnectorId}?operation=disassociate-phone-numbers', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DisassociatePhoneNumbersFromVoiceConnectorRequest', ], 'output' => [ 'shape' => 'DisassociatePhoneNumbersFromVoiceConnectorResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'DisassociatePhoneNumbersFromVoiceConnectorGroup' => [ 'name' => 'DisassociatePhoneNumbersFromVoiceConnectorGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connector-groups/{voiceConnectorGroupId}?operation=disassociate-phone-numbers', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DisassociatePhoneNumbersFromVoiceConnectorGroupRequest', ], 'output' => [ 'shape' => 'DisassociatePhoneNumbersFromVoiceConnectorGroupResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetGlobalSettings' => [ 'name' => 'GetGlobalSettings', 'http' => [ 'method' => 'GET', 'requestUri' => '/settings', 'responseCode' => 200, ], 'output' => [ 'shape' => 'GetGlobalSettingsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetPhoneNumber' => [ 'name' => 'GetPhoneNumber', 'http' => [ 'method' => 'GET', 'requestUri' => '/phone-numbers/{phoneNumberId}', ], 'input' => [ 'shape' => 'GetPhoneNumberRequest', ], 'output' => [ 'shape' => 'GetPhoneNumberResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetPhoneNumberOrder' => [ 'name' => 'GetPhoneNumberOrder', 'http' => [ 'method' => 'GET', 'requestUri' => '/phone-number-orders/{phoneNumberOrderId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetPhoneNumberOrderRequest', ], 'output' => [ 'shape' => 'GetPhoneNumberOrderResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetPhoneNumberSettings' => [ 'name' => 'GetPhoneNumberSettings', 'http' => [ 'method' => 'GET', 'requestUri' => '/settings/phone-number', 'responseCode' => 200, ], 'output' => [ 'shape' => 'GetPhoneNumberSettingsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetProxySession' => [ 'name' => 'GetProxySession', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/proxy-sessions/{proxySessionId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetProxySessionRequest', ], 'output' => [ 'shape' => 'GetProxySessionResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetSipMediaApplication' => [ 'name' => 'GetSipMediaApplication', 'http' => [ 'method' => 'GET', 'requestUri' => '/sip-media-applications/{sipMediaApplicationId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetSipMediaApplicationRequest', ], 'output' => [ 'shape' => 'GetSipMediaApplicationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetSipMediaApplicationAlexaSkillConfiguration' => [ 'name' => 'GetSipMediaApplicationAlexaSkillConfiguration', 'http' => [ 'method' => 'GET', 'requestUri' => '/sip-media-applications/{sipMediaApplicationId}/alexa-skill-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetSipMediaApplicationAlexaSkillConfigurationRequest', ], 'output' => [ 'shape' => 'GetSipMediaApplicationAlexaSkillConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetSipMediaApplicationLoggingConfiguration' => [ 'name' => 'GetSipMediaApplicationLoggingConfiguration', 'http' => [ 'method' => 'GET', 'requestUri' => '/sip-media-applications/{sipMediaApplicationId}/logging-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetSipMediaApplicationLoggingConfigurationRequest', ], 'output' => [ 'shape' => 'GetSipMediaApplicationLoggingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetSipRule' => [ 'name' => 'GetSipRule', 'http' => [ 'method' => 'GET', 'requestUri' => '/sip-rules/{sipRuleId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetSipRuleRequest', ], 'output' => [ 'shape' => 'GetSipRuleResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetSpeakerSearchTask' => [ 'name' => 'GetSpeakerSearchTask', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{VoiceConnectorId}/speaker-search-tasks/{SpeakerSearchTaskId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetSpeakerSearchTaskRequest', ], 'output' => [ 'shape' => 'GetSpeakerSearchTaskResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ServiceUnavailableException', ], ], ], 'GetVoiceConnector' => [ 'name' => 'GetVoiceConnector', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetVoiceConnectorEmergencyCallingConfiguration' => [ 'name' => 'GetVoiceConnectorEmergencyCallingConfiguration', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/emergency-calling-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorEmergencyCallingConfigurationRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorEmergencyCallingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetVoiceConnectorGroup' => [ 'name' => 'GetVoiceConnectorGroup', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connector-groups/{voiceConnectorGroupId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorGroupRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorGroupResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetVoiceConnectorLoggingConfiguration' => [ 'name' => 'GetVoiceConnectorLoggingConfiguration', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/logging-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorLoggingConfigurationRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorLoggingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetVoiceConnectorOrigination' => [ 'name' => 'GetVoiceConnectorOrigination', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/origination', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorOriginationRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorOriginationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetVoiceConnectorProxy' => [ 'name' => 'GetVoiceConnectorProxy', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/programmable-numbers/proxy', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorProxyRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorProxyResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetVoiceConnectorStreamingConfiguration' => [ 'name' => 'GetVoiceConnectorStreamingConfiguration', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/streaming-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorStreamingConfigurationRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorStreamingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetVoiceConnectorTermination' => [ 'name' => 'GetVoiceConnectorTermination', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/termination', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorTerminationRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorTerminationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetVoiceConnectorTerminationHealth' => [ 'name' => 'GetVoiceConnectorTerminationHealth', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/termination/health', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceConnectorTerminationHealthRequest', ], 'output' => [ 'shape' => 'GetVoiceConnectorTerminationHealthResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetVoiceProfile' => [ 'name' => 'GetVoiceProfile', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-profiles/{VoiceProfileId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceProfileRequest', ], 'output' => [ 'shape' => 'GetVoiceProfileResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetVoiceProfileDomain' => [ 'name' => 'GetVoiceProfileDomain', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-profile-domains/{VoiceProfileDomainId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceProfileDomainRequest', ], 'output' => [ 'shape' => 'GetVoiceProfileDomainResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'GetVoiceToneAnalysisTask' => [ 'name' => 'GetVoiceToneAnalysisTask', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{VoiceConnectorId}/voice-tone-analysis-tasks/{VoiceToneAnalysisTaskId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetVoiceToneAnalysisTaskRequest', ], 'output' => [ 'shape' => 'GetVoiceToneAnalysisTaskResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceFailureException', ], [ 'shape' => 'ServiceUnavailableException', ], ], ], 'ListAvailableVoiceConnectorRegions' => [ 'name' => 'ListAvailableVoiceConnectorRegions', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connector-regions', 'responseCode' => 200, ], 'output' => [ 'shape' => 'ListAvailableVoiceConnectorRegionsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListPhoneNumberOrders' => [ 'name' => 'ListPhoneNumberOrders', 'http' => [ 'method' => 'GET', 'requestUri' => '/phone-number-orders', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListPhoneNumberOrdersRequest', ], 'output' => [ 'shape' => 'ListPhoneNumberOrdersResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListPhoneNumbers' => [ 'name' => 'ListPhoneNumbers', 'http' => [ 'method' => 'GET', 'requestUri' => '/phone-numbers', ], 'input' => [ 'shape' => 'ListPhoneNumbersRequest', ], 'output' => [ 'shape' => 'ListPhoneNumbersResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListProxySessions' => [ 'name' => 'ListProxySessions', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/proxy-sessions', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListProxySessionsRequest', ], 'output' => [ 'shape' => 'ListProxySessionsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListSipMediaApplications' => [ 'name' => 'ListSipMediaApplications', 'http' => [ 'method' => 'GET', 'requestUri' => '/sip-media-applications', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListSipMediaApplicationsRequest', ], 'output' => [ 'shape' => 'ListSipMediaApplicationsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListSipRules' => [ 'name' => 'ListSipRules', 'http' => [ 'method' => 'GET', 'requestUri' => '/sip-rules', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListSipRulesRequest', ], 'output' => [ 'shape' => 'ListSipRulesResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListSupportedPhoneNumberCountries' => [ 'name' => 'ListSupportedPhoneNumberCountries', 'http' => [ 'method' => 'GET', 'requestUri' => '/phone-number-countries', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListSupportedPhoneNumberCountriesRequest', ], 'output' => [ 'shape' => 'ListSupportedPhoneNumberCountriesResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags', ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListVoiceConnectorGroups' => [ 'name' => 'ListVoiceConnectorGroups', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connector-groups', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListVoiceConnectorGroupsRequest', ], 'output' => [ 'shape' => 'ListVoiceConnectorGroupsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListVoiceConnectorTerminationCredentials' => [ 'name' => 'ListVoiceConnectorTerminationCredentials', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors/{voiceConnectorId}/termination/credentials', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListVoiceConnectorTerminationCredentialsRequest', ], 'output' => [ 'shape' => 'ListVoiceConnectorTerminationCredentialsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListVoiceConnectors' => [ 'name' => 'ListVoiceConnectors', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-connectors', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListVoiceConnectorsRequest', ], 'output' => [ 'shape' => 'ListVoiceConnectorsResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListVoiceProfileDomains' => [ 'name' => 'ListVoiceProfileDomains', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-profile-domains', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListVoiceProfileDomainsRequest', ], 'output' => [ 'shape' => 'ListVoiceProfileDomainsResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ListVoiceProfiles' => [ 'name' => 'ListVoiceProfiles', 'http' => [ 'method' => 'GET', 'requestUri' => '/voice-profiles', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListVoiceProfilesRequest', ], 'output' => [ 'shape' => 'ListVoiceProfilesResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'PutSipMediaApplicationAlexaSkillConfiguration' => [ 'name' => 'PutSipMediaApplicationAlexaSkillConfiguration', 'http' => [ 'method' => 'PUT', 'requestUri' => '/sip-media-applications/{sipMediaApplicationId}/alexa-skill-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutSipMediaApplicationAlexaSkillConfigurationRequest', ], 'output' => [ 'shape' => 'PutSipMediaApplicationAlexaSkillConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'PutSipMediaApplicationLoggingConfiguration' => [ 'name' => 'PutSipMediaApplicationLoggingConfiguration', 'http' => [ 'method' => 'PUT', 'requestUri' => '/sip-media-applications/{sipMediaApplicationId}/logging-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutSipMediaApplicationLoggingConfigurationRequest', ], 'output' => [ 'shape' => 'PutSipMediaApplicationLoggingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'PutVoiceConnectorEmergencyCallingConfiguration' => [ 'name' => 'PutVoiceConnectorEmergencyCallingConfiguration', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-connectors/{voiceConnectorId}/emergency-calling-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutVoiceConnectorEmergencyCallingConfigurationRequest', ], 'output' => [ 'shape' => 'PutVoiceConnectorEmergencyCallingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'PutVoiceConnectorLoggingConfiguration' => [ 'name' => 'PutVoiceConnectorLoggingConfiguration', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-connectors/{voiceConnectorId}/logging-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutVoiceConnectorLoggingConfigurationRequest', ], 'output' => [ 'shape' => 'PutVoiceConnectorLoggingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'PutVoiceConnectorOrigination' => [ 'name' => 'PutVoiceConnectorOrigination', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-connectors/{voiceConnectorId}/origination', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutVoiceConnectorOriginationRequest', ], 'output' => [ 'shape' => 'PutVoiceConnectorOriginationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'PutVoiceConnectorProxy' => [ 'name' => 'PutVoiceConnectorProxy', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-connectors/{voiceConnectorId}/programmable-numbers/proxy', ], 'input' => [ 'shape' => 'PutVoiceConnectorProxyRequest', ], 'output' => [ 'shape' => 'PutVoiceConnectorProxyResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'PutVoiceConnectorStreamingConfiguration' => [ 'name' => 'PutVoiceConnectorStreamingConfiguration', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-connectors/{voiceConnectorId}/streaming-configuration', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutVoiceConnectorStreamingConfigurationRequest', ], 'output' => [ 'shape' => 'PutVoiceConnectorStreamingConfigurationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'PutVoiceConnectorTermination' => [ 'name' => 'PutVoiceConnectorTermination', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-connectors/{voiceConnectorId}/termination', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutVoiceConnectorTerminationRequest', ], 'output' => [ 'shape' => 'PutVoiceConnectorTerminationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'PutVoiceConnectorTerminationCredentials' => [ 'name' => 'PutVoiceConnectorTerminationCredentials', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors/{voiceConnectorId}/termination/credentials?operation=put', 'responseCode' => 204, ], 'input' => [ 'shape' => 'PutVoiceConnectorTerminationCredentialsRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'RestorePhoneNumber' => [ 'name' => 'RestorePhoneNumber', 'http' => [ 'method' => 'POST', 'requestUri' => '/phone-numbers/{phoneNumberId}?operation=restore', 'responseCode' => 200, ], 'input' => [ 'shape' => 'RestorePhoneNumberRequest', ], 'output' => [ 'shape' => 'RestorePhoneNumberResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'SearchAvailablePhoneNumbers' => [ 'name' => 'SearchAvailablePhoneNumbers', 'http' => [ 'method' => 'GET', 'requestUri' => '/search?type=phone-numbers', ], 'input' => [ 'shape' => 'SearchAvailablePhoneNumbersRequest', ], 'output' => [ 'shape' => 'SearchAvailablePhoneNumbersResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'StartSpeakerSearchTask' => [ 'name' => 'StartSpeakerSearchTask', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors/{VoiceConnectorId}/speaker-search-tasks', 'responseCode' => 201, ], 'input' => [ 'shape' => 'StartSpeakerSearchTaskRequest', ], 'output' => [ 'shape' => 'StartSpeakerSearchTaskResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'GoneException', ], [ 'shape' => 'UnprocessableEntityException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'StartVoiceToneAnalysisTask' => [ 'name' => 'StartVoiceToneAnalysisTask', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors/{VoiceConnectorId}/voice-tone-analysis-tasks', 'responseCode' => 201, ], 'input' => [ 'shape' => 'StartVoiceToneAnalysisTaskRequest', ], 'output' => [ 'shape' => 'StartVoiceToneAnalysisTaskResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'GoneException', ], [ 'shape' => 'UnprocessableEntityException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'StopSpeakerSearchTask' => [ 'name' => 'StopSpeakerSearchTask', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors/{VoiceConnectorId}/speaker-search-tasks/{SpeakerSearchTaskId}?operation=stop', 'responseCode' => 204, ], 'input' => [ 'shape' => 'StopSpeakerSearchTaskRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'UnprocessableEntityException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'StopVoiceToneAnalysisTask' => [ 'name' => 'StopVoiceToneAnalysisTask', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors/{VoiceConnectorId}/voice-tone-analysis-tasks/{VoiceToneAnalysisTaskId}?operation=stop', 'responseCode' => 204, ], 'input' => [ 'shape' => 'StopVoiceToneAnalysisTaskRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'UnprocessableEntityException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags?operation=tag-resource', 'responseCode' => 204, ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags?operation=untag-resource', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateGlobalSettings' => [ 'name' => 'UpdateGlobalSettings', 'http' => [ 'method' => 'PUT', 'requestUri' => '/settings', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UpdateGlobalSettingsRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdatePhoneNumber' => [ 'name' => 'UpdatePhoneNumber', 'http' => [ 'method' => 'POST', 'requestUri' => '/phone-numbers/{phoneNumberId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdatePhoneNumberRequest', ], 'output' => [ 'shape' => 'UpdatePhoneNumberResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdatePhoneNumberSettings' => [ 'name' => 'UpdatePhoneNumberSettings', 'http' => [ 'method' => 'PUT', 'requestUri' => '/settings/phone-number', 'responseCode' => 204, ], 'input' => [ 'shape' => 'UpdatePhoneNumberSettingsRequest', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateProxySession' => [ 'name' => 'UpdateProxySession', 'http' => [ 'method' => 'POST', 'requestUri' => '/voice-connectors/{voiceConnectorId}/proxy-sessions/{proxySessionId}', 'responseCode' => 201, ], 'input' => [ 'shape' => 'UpdateProxySessionRequest', ], 'output' => [ 'shape' => 'UpdateProxySessionResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateSipMediaApplication' => [ 'name' => 'UpdateSipMediaApplication', 'http' => [ 'method' => 'PUT', 'requestUri' => '/sip-media-applications/{sipMediaApplicationId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateSipMediaApplicationRequest', ], 'output' => [ 'shape' => 'UpdateSipMediaApplicationResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateSipMediaApplicationCall' => [ 'name' => 'UpdateSipMediaApplicationCall', 'http' => [ 'method' => 'POST', 'requestUri' => '/sip-media-applications/{sipMediaApplicationId}/calls/{transactionId}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'UpdateSipMediaApplicationCallRequest', ], 'output' => [ 'shape' => 'UpdateSipMediaApplicationCallResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateSipRule' => [ 'name' => 'UpdateSipRule', 'http' => [ 'method' => 'PUT', 'requestUri' => '/sip-rules/{sipRuleId}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'UpdateSipRuleRequest', ], 'output' => [ 'shape' => 'UpdateSipRuleResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ResourceLimitExceededException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateVoiceConnector' => [ 'name' => 'UpdateVoiceConnector', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-connectors/{voiceConnectorId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateVoiceConnectorRequest', ], 'output' => [ 'shape' => 'UpdateVoiceConnectorResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateVoiceConnectorGroup' => [ 'name' => 'UpdateVoiceConnectorGroup', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-connector-groups/{voiceConnectorGroupId}', 'responseCode' => 202, ], 'input' => [ 'shape' => 'UpdateVoiceConnectorGroupRequest', ], 'output' => [ 'shape' => 'UpdateVoiceConnectorGroupResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateVoiceProfile' => [ 'name' => 'UpdateVoiceProfile', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-profiles/{VoiceProfileId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateVoiceProfileRequest', ], 'output' => [ 'shape' => 'UpdateVoiceProfileResponse', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'GoneException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'UpdateVoiceProfileDomain' => [ 'name' => 'UpdateVoiceProfileDomain', 'http' => [ 'method' => 'PUT', 'requestUri' => '/voice-profile-domains/{VoiceProfileDomainId}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateVoiceProfileDomainRequest', ], 'output' => [ 'shape' => 'UpdateVoiceProfileDomainResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], 'ValidateE911Address' => [ 'name' => 'ValidateE911Address', 'http' => [ 'method' => 'POST', 'requestUri' => '/emergency-calling/address', 'responseCode' => 202, ], 'input' => [ 'shape' => 'ValidateE911AddressRequest', ], 'output' => [ 'shape' => 'ValidateE911AddressResponse', ], 'errors' => [ [ 'shape' => 'UnauthorizedClientException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ThrottledClientException', ], [ 'shape' => 'ServiceUnavailableException', ], [ 'shape' => 'ServiceFailureException', ], ], ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'httpStatusCode' => 403, ], 'exception' => true, ], 'Address' => [ 'type' => 'structure', 'members' => [ 'streetName' => [ 'shape' => 'SensitiveNonEmptyString', ], 'streetSuffix' => [ 'shape' => 'SensitiveNonEmptyString', ], 'postDirectional' => [ 'shape' => 'SensitiveNonEmptyString', ], 'preDirectional' => [ 'shape' => 'SensitiveNonEmptyString', ], 'streetNumber' => [ 'shape' => 'SensitiveNonEmptyString', ], 'city' => [ 'shape' => 'SensitiveNonEmptyString', ], 'state' => [ 'shape' => 'SensitiveNonEmptyString', ], 'postalCode' => [ 'shape' => 'SensitiveNonEmptyString', ], 'postalCodePlus4' => [ 'shape' => 'SensitiveNonEmptyString', ], 'country' => [ 'shape' => 'SensitiveNonEmptyString', ], ], ], 'AlexaSkillId' => [ 'type' => 'string', 'max' => 64, 'pattern' => 'amzn1\\\\.application-oa2-client\\\\.[0-9a-fA-F]{32}', 'sensitive' => true, ], 'AlexaSkillIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AlexaSkillId', ], 'max' => 1, 'min' => 1, ], 'AlexaSkillStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'INACTIVE', ], ], 'Alpha2CountryCode' => [ 'type' => 'string', 'pattern' => '[A-Z]{2}', ], 'AreaCode' => [ 'type' => 'string', 'pattern' => '^$|^[0-9]{3,3}$', ], 'Arn' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, 'pattern' => '^arn[\\\\/\\\\:\\\\-\\\\_\\\\.a-zA-Z0-9]+$', 'sensitive' => true, ], 'AssociatePhoneNumbersWithVoiceConnectorGroupRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorGroupId', 'E164PhoneNumbers', ], 'members' => [ 'VoiceConnectorGroupId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorGroupId', ], 'E164PhoneNumbers' => [ 'shape' => 'E164PhoneNumberList', ], 'ForceAssociate' => [ 'shape' => 'NullableBoolean', ], ], ], 'AssociatePhoneNumbersWithVoiceConnectorGroupResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberErrors' => [ 'shape' => 'PhoneNumberErrorList', ], ], ], 'AssociatePhoneNumbersWithVoiceConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'E164PhoneNumbers', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'E164PhoneNumbers' => [ 'shape' => 'E164PhoneNumberList', ], 'ForceAssociate' => [ 'shape' => 'NullableBoolean', ], ], ], 'AssociatePhoneNumbersWithVoiceConnectorResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberErrors' => [ 'shape' => 'PhoneNumberErrorList', ], ], ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'BatchDeletePhoneNumberRequest' => [ 'type' => 'structure', 'required' => [ 'PhoneNumberIds', ], 'members' => [ 'PhoneNumberIds' => [ 'shape' => 'NonEmptyStringList', ], ], ], 'BatchDeletePhoneNumberResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberErrors' => [ 'shape' => 'PhoneNumberErrorList', ], ], ], 'BatchUpdatePhoneNumberRequest' => [ 'type' => 'structure', 'required' => [ 'UpdatePhoneNumberRequestItems', ], 'members' => [ 'UpdatePhoneNumberRequestItems' => [ 'shape' => 'UpdatePhoneNumberRequestItemList', ], ], ], 'BatchUpdatePhoneNumberResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberErrors' => [ 'shape' => 'PhoneNumberErrorList', ], ], ], 'Boolean' => [ 'type' => 'boolean', ], 'CallDetails' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', ], 'TransactionId' => [ 'shape' => 'NonEmptyString256', ], 'IsCaller' => [ 'shape' => 'Boolean', ], ], ], 'CallLegType' => [ 'type' => 'string', 'enum' => [ 'Caller', 'Callee', ], ], 'CallingName' => [ 'type' => 'string', 'pattern' => '^$|^[a-zA-Z0-9 ]{2,15}$', 'sensitive' => true, ], 'CallingNameStatus' => [ 'type' => 'string', 'enum' => [ 'Unassigned', 'UpdateInProgress', 'UpdateSucceeded', 'UpdateFailed', ], ], 'CallingRegion' => [ 'type' => 'string', ], 'CallingRegionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CallingRegion', ], ], 'CandidateAddress' => [ 'type' => 'structure', 'members' => [ 'streetInfo' => [ 'shape' => 'SensitiveNonEmptyString', ], 'streetNumber' => [ 'shape' => 'SensitiveNonEmptyString', ], 'city' => [ 'shape' => 'SensitiveNonEmptyString', ], 'state' => [ 'shape' => 'SensitiveNonEmptyString', ], 'postalCode' => [ 'shape' => 'SensitiveNonEmptyString', ], 'postalCodePlus4' => [ 'shape' => 'SensitiveNonEmptyString', ], 'country' => [ 'shape' => 'SensitiveNonEmptyString', ], ], ], 'CandidateAddressList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CandidateAddress', ], ], 'Capability' => [ 'type' => 'string', 'enum' => [ 'Voice', 'SMS', ], ], 'CapabilityList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Capability', ], ], 'ClientRequestId' => [ 'type' => 'string', 'pattern' => '^[-_a-zA-Z0-9]*${2,64}$', ], 'ConfidenceScore' => [ 'type' => 'float', 'max' => 1, 'min' => 0, ], 'ConflictException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'Country' => [ 'type' => 'string', 'pattern' => '^$|^[A-Z]{2,2}$', ], 'CountryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Country', ], 'max' => 100, 'min' => 1, ], 'CpsLimit' => [ 'type' => 'integer', 'min' => 1, ], 'CreatePhoneNumberOrderRequest' => [ 'type' => 'structure', 'required' => [ 'ProductType', 'E164PhoneNumbers', ], 'members' => [ 'ProductType' => [ 'shape' => 'PhoneNumberProductType', ], 'E164PhoneNumbers' => [ 'shape' => 'E164PhoneNumberList', ], ], ], 'CreatePhoneNumberOrderResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberOrder' => [ 'shape' => 'PhoneNumberOrder', ], ], ], 'CreateProxySessionRequest' => [ 'type' => 'structure', 'required' => [ 'ParticipantPhoneNumbers', 'Capabilities', 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'ParticipantPhoneNumbers' => [ 'shape' => 'ParticipantPhoneNumberList', ], 'Name' => [ 'shape' => 'ProxySessionNameString', ], 'ExpiryMinutes' => [ 'shape' => 'PositiveInteger', ], 'Capabilities' => [ 'shape' => 'CapabilityList', ], 'NumberSelectionBehavior' => [ 'shape' => 'NumberSelectionBehavior', ], 'GeoMatchLevel' => [ 'shape' => 'GeoMatchLevel', ], 'GeoMatchParams' => [ 'shape' => 'GeoMatchParams', ], ], ], 'CreateProxySessionResponse' => [ 'type' => 'structure', 'members' => [ 'ProxySession' => [ 'shape' => 'ProxySession', ], ], ], 'CreateSipMediaApplicationCallRequest' => [ 'type' => 'structure', 'required' => [ 'FromPhoneNumber', 'ToPhoneNumber', 'SipMediaApplicationId', ], 'members' => [ 'FromPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'ToPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipMediaApplicationId', ], 'SipHeaders' => [ 'shape' => 'SipHeadersMap', ], 'ArgumentsMap' => [ 'shape' => 'SMACreateCallArgumentsMap', ], ], ], 'CreateSipMediaApplicationCallResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplicationCall' => [ 'shape' => 'SipMediaApplicationCall', ], ], ], 'CreateSipMediaApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'AwsRegion', 'Name', 'Endpoints', ], 'members' => [ 'AwsRegion' => [ 'shape' => 'String', ], 'Name' => [ 'shape' => 'SipMediaApplicationName', ], 'Endpoints' => [ 'shape' => 'SipMediaApplicationEndpointList', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateSipMediaApplicationResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplication' => [ 'shape' => 'SipMediaApplication', ], ], ], 'CreateSipRuleRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'TriggerType', 'TriggerValue', ], 'members' => [ 'Name' => [ 'shape' => 'SipRuleName', ], 'TriggerType' => [ 'shape' => 'SipRuleTriggerType', ], 'TriggerValue' => [ 'shape' => 'NonEmptyString', ], 'Disabled' => [ 'shape' => 'NullableBoolean', ], 'TargetApplications' => [ 'shape' => 'SipRuleTargetApplicationList', ], ], ], 'CreateSipRuleResponse' => [ 'type' => 'structure', 'members' => [ 'SipRule' => [ 'shape' => 'SipRule', ], ], ], 'CreateVoiceConnectorGroupRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'VoiceConnectorGroupName', ], 'VoiceConnectorItems' => [ 'shape' => 'VoiceConnectorItemList', ], ], ], 'CreateVoiceConnectorGroupResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectorGroup' => [ 'shape' => 'VoiceConnectorGroup', ], ], ], 'CreateVoiceConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'RequireEncryption', ], 'members' => [ 'Name' => [ 'shape' => 'VoiceConnectorName', ], 'AwsRegion' => [ 'shape' => 'VoiceConnectorAwsRegion', ], 'RequireEncryption' => [ 'shape' => 'Boolean', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateVoiceConnectorResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnector' => [ 'shape' => 'VoiceConnector', ], ], ], 'CreateVoiceProfileDomainRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'ServerSideEncryptionConfiguration', ], 'members' => [ 'Name' => [ 'shape' => 'VoiceProfileDomainName', ], 'Description' => [ 'shape' => 'VoiceProfileDomainDescription', ], 'ServerSideEncryptionConfiguration' => [ 'shape' => 'ServerSideEncryptionConfiguration', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestId', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'CreateVoiceProfileDomainResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceProfileDomain' => [ 'shape' => 'VoiceProfileDomain', ], ], ], 'CreateVoiceProfileRequest' => [ 'type' => 'structure', 'required' => [ 'SpeakerSearchTaskId', ], 'members' => [ 'SpeakerSearchTaskId' => [ 'shape' => 'NonEmptyString256', ], ], ], 'CreateVoiceProfileResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceProfile' => [ 'shape' => 'VoiceProfile', ], ], ], 'Credential' => [ 'type' => 'structure', 'members' => [ 'Username' => [ 'shape' => 'SensitiveString', ], 'Password' => [ 'shape' => 'SensitiveString', ], ], ], 'CredentialList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Credential', ], ], 'DNISEmergencyCallingConfiguration' => [ 'type' => 'structure', 'required' => [ 'EmergencyPhoneNumber', 'CallingCountry', ], 'members' => [ 'EmergencyPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'TestPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'CallingCountry' => [ 'shape' => 'Alpha2CountryCode', ], ], ], 'DNISEmergencyCallingConfigurationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DNISEmergencyCallingConfiguration', ], ], 'DataRetentionInHours' => [ 'type' => 'integer', 'min' => 0, ], 'DeletePhoneNumberRequest' => [ 'type' => 'structure', 'required' => [ 'PhoneNumberId', ], 'members' => [ 'PhoneNumberId' => [ 'shape' => 'SensitiveNonEmptyString', 'location' => 'uri', 'locationName' => 'phoneNumberId', ], ], ], 'DeleteProxySessionRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'ProxySessionId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'ProxySessionId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'proxySessionId', ], ], ], 'DeleteSipMediaApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'SipMediaApplicationId', ], 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipMediaApplicationId', ], ], ], 'DeleteSipRuleRequest' => [ 'type' => 'structure', 'required' => [ 'SipRuleId', ], 'members' => [ 'SipRuleId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipRuleId', ], ], ], 'DeleteVoiceConnectorEmergencyCallingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'DeleteVoiceConnectorGroupRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorGroupId', ], 'members' => [ 'VoiceConnectorGroupId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorGroupId', ], ], ], 'DeleteVoiceConnectorOriginationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'DeleteVoiceConnectorProxyRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'DeleteVoiceConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'DeleteVoiceConnectorStreamingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'DeleteVoiceConnectorTerminationCredentialsRequest' => [ 'type' => 'structure', 'required' => [ 'Usernames', 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'Usernames' => [ 'shape' => 'SensitiveStringList', ], ], ], 'DeleteVoiceConnectorTerminationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'DeleteVoiceProfileDomainRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceProfileDomainId', ], 'members' => [ 'VoiceProfileDomainId' => [ 'shape' => 'NonEmptyString256', 'location' => 'uri', 'locationName' => 'VoiceProfileDomainId', ], ], ], 'DeleteVoiceProfileRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceProfileId', ], 'members' => [ 'VoiceProfileId' => [ 'shape' => 'NonEmptyString256', 'location' => 'uri', 'locationName' => 'VoiceProfileId', ], ], ], 'DisassociatePhoneNumbersFromVoiceConnectorGroupRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorGroupId', 'E164PhoneNumbers', ], 'members' => [ 'VoiceConnectorGroupId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorGroupId', ], 'E164PhoneNumbers' => [ 'shape' => 'E164PhoneNumberList', ], ], ], 'DisassociatePhoneNumbersFromVoiceConnectorGroupResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberErrors' => [ 'shape' => 'PhoneNumberErrorList', ], ], ], 'DisassociatePhoneNumbersFromVoiceConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'E164PhoneNumbers', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'E164PhoneNumbers' => [ 'shape' => 'E164PhoneNumberList', ], ], ], 'DisassociatePhoneNumbersFromVoiceConnectorResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberErrors' => [ 'shape' => 'PhoneNumberErrorList', ], ], ], 'E164PhoneNumber' => [ 'type' => 'string', 'pattern' => '^\\\\+?[1-9]\\\\d{1,14}$', 'sensitive' => true, ], 'E164PhoneNumberList' => [ 'type' => 'list', 'member' => [ 'shape' => 'E164PhoneNumber', ], ], 'EmergencyCallingConfiguration' => [ 'type' => 'structure', 'members' => [ 'DNIS' => [ 'shape' => 'DNISEmergencyCallingConfigurationList', ], ], ], 'ErrorCode' => [ 'type' => 'string', 'enum' => [ 'BadRequest', 'Conflict', 'Forbidden', 'NotFound', 'PreconditionFailed', 'ResourceLimitExceeded', 'ServiceFailure', 'AccessDenied', 'ServiceUnavailable', 'Throttled', 'Throttling', 'Unauthorized', 'Unprocessable', 'VoiceConnectorGroupAssociationsExist', 'PhoneNumberAssociationsExist', 'Gone', ], ], 'ForbiddenException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'httpStatusCode' => 403, ], 'exception' => true, ], 'FunctionArn' => [ 'type' => 'string', 'max' => 10000, 'pattern' => 'arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\\\d{1}:\\\\d{12}:function:[a-zA-Z0-9-_]+(:(\\\\$LATEST|[a-zA-Z0-9-_]+))?', 'sensitive' => true, ], 'GeoMatchLevel' => [ 'type' => 'string', 'enum' => [ 'Country', 'AreaCode', ], ], 'GeoMatchParams' => [ 'type' => 'structure', 'required' => [ 'Country', 'AreaCode', ], 'members' => [ 'Country' => [ 'shape' => 'Country', ], 'AreaCode' => [ 'shape' => 'AreaCode', ], ], ], 'GetGlobalSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnector' => [ 'shape' => 'VoiceConnectorSettings', ], ], ], 'GetPhoneNumberOrderRequest' => [ 'type' => 'structure', 'required' => [ 'PhoneNumberOrderId', ], 'members' => [ 'PhoneNumberOrderId' => [ 'shape' => 'GuidString', 'location' => 'uri', 'locationName' => 'phoneNumberOrderId', ], ], ], 'GetPhoneNumberOrderResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberOrder' => [ 'shape' => 'PhoneNumberOrder', ], ], ], 'GetPhoneNumberRequest' => [ 'type' => 'structure', 'required' => [ 'PhoneNumberId', ], 'members' => [ 'PhoneNumberId' => [ 'shape' => 'SensitiveNonEmptyString', 'location' => 'uri', 'locationName' => 'phoneNumberId', ], ], ], 'GetPhoneNumberResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumber' => [ 'shape' => 'PhoneNumber', ], ], ], 'GetPhoneNumberSettingsResponse' => [ 'type' => 'structure', 'members' => [ 'CallingName' => [ 'shape' => 'CallingName', ], 'CallingNameUpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'GetProxySessionRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'ProxySessionId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'ProxySessionId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'proxySessionId', ], ], ], 'GetProxySessionResponse' => [ 'type' => 'structure', 'members' => [ 'ProxySession' => [ 'shape' => 'ProxySession', ], ], ], 'GetSipMediaApplicationAlexaSkillConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'SipMediaApplicationId', ], 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipMediaApplicationId', ], ], ], 'GetSipMediaApplicationAlexaSkillConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplicationAlexaSkillConfiguration' => [ 'shape' => 'SipMediaApplicationAlexaSkillConfiguration', ], ], ], 'GetSipMediaApplicationLoggingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'SipMediaApplicationId', ], 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipMediaApplicationId', ], ], ], 'GetSipMediaApplicationLoggingConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplicationLoggingConfiguration' => [ 'shape' => 'SipMediaApplicationLoggingConfiguration', ], ], ], 'GetSipMediaApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'SipMediaApplicationId', ], 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipMediaApplicationId', ], ], ], 'GetSipMediaApplicationResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplication' => [ 'shape' => 'SipMediaApplication', ], ], ], 'GetSipRuleRequest' => [ 'type' => 'structure', 'required' => [ 'SipRuleId', ], 'members' => [ 'SipRuleId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipRuleId', ], ], ], 'GetSipRuleResponse' => [ 'type' => 'structure', 'members' => [ 'SipRule' => [ 'shape' => 'SipRule', ], ], ], 'GetSpeakerSearchTaskRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'SpeakerSearchTaskId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'VoiceConnectorId', ], 'SpeakerSearchTaskId' => [ 'shape' => 'NonEmptyString256', 'location' => 'uri', 'locationName' => 'SpeakerSearchTaskId', ], ], ], 'GetSpeakerSearchTaskResponse' => [ 'type' => 'structure', 'members' => [ 'SpeakerSearchTask' => [ 'shape' => 'SpeakerSearchTask', ], ], ], 'GetVoiceConnectorEmergencyCallingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'GetVoiceConnectorEmergencyCallingConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'EmergencyCallingConfiguration' => [ 'shape' => 'EmergencyCallingConfiguration', ], ], ], 'GetVoiceConnectorGroupRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorGroupId', ], 'members' => [ 'VoiceConnectorGroupId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorGroupId', ], ], ], 'GetVoiceConnectorGroupResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectorGroup' => [ 'shape' => 'VoiceConnectorGroup', ], ], ], 'GetVoiceConnectorLoggingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'GetVoiceConnectorLoggingConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'LoggingConfiguration' => [ 'shape' => 'LoggingConfiguration', ], ], ], 'GetVoiceConnectorOriginationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'GetVoiceConnectorOriginationResponse' => [ 'type' => 'structure', 'members' => [ 'Origination' => [ 'shape' => 'Origination', ], ], ], 'GetVoiceConnectorProxyRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'GetVoiceConnectorProxyResponse' => [ 'type' => 'structure', 'members' => [ 'Proxy' => [ 'shape' => 'Proxy', ], ], ], 'GetVoiceConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'GetVoiceConnectorResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnector' => [ 'shape' => 'VoiceConnector', ], ], ], 'GetVoiceConnectorStreamingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'GetVoiceConnectorStreamingConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'StreamingConfiguration' => [ 'shape' => 'StreamingConfiguration', ], ], ], 'GetVoiceConnectorTerminationHealthRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'GetVoiceConnectorTerminationHealthResponse' => [ 'type' => 'structure', 'members' => [ 'TerminationHealth' => [ 'shape' => 'TerminationHealth', ], ], ], 'GetVoiceConnectorTerminationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'GetVoiceConnectorTerminationResponse' => [ 'type' => 'structure', 'members' => [ 'Termination' => [ 'shape' => 'Termination', ], ], ], 'GetVoiceProfileDomainRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceProfileDomainId', ], 'members' => [ 'VoiceProfileDomainId' => [ 'shape' => 'NonEmptyString256', 'location' => 'uri', 'locationName' => 'VoiceProfileDomainId', ], ], ], 'GetVoiceProfileDomainResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceProfileDomain' => [ 'shape' => 'VoiceProfileDomain', ], ], ], 'GetVoiceProfileRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceProfileId', ], 'members' => [ 'VoiceProfileId' => [ 'shape' => 'NonEmptyString256', 'location' => 'uri', 'locationName' => 'VoiceProfileId', ], ], ], 'GetVoiceProfileResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceProfile' => [ 'shape' => 'VoiceProfile', ], ], ], 'GetVoiceToneAnalysisTaskRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'VoiceToneAnalysisTaskId', 'IsCaller', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'VoiceConnectorId', ], 'VoiceToneAnalysisTaskId' => [ 'shape' => 'NonEmptyString256', 'location' => 'uri', 'locationName' => 'VoiceToneAnalysisTaskId', ], 'IsCaller' => [ 'shape' => 'Boolean', 'location' => 'querystring', 'locationName' => 'isCaller', ], ], ], 'GetVoiceToneAnalysisTaskResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceToneAnalysisTask' => [ 'shape' => 'VoiceToneAnalysisTask', ], ], ], 'GoneException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'httpStatusCode' => 410, ], 'exception' => true, ], 'GuidString' => [ 'type' => 'string', 'pattern' => '[a-fA-F0-9]{8}(?:-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}', ], 'Integer' => [ 'type' => 'integer', ], 'Iso8601Timestamp' => [ 'type' => 'timestamp', 'timestampFormat' => 'iso8601', ], 'LanguageCode' => [ 'type' => 'string', 'enum' => [ 'en-US', ], ], 'ListAvailableVoiceConnectorRegionsResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectorRegions' => [ 'shape' => 'VoiceConnectorAwsRegionList', ], ], ], 'ListPhoneNumberOrdersRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListPhoneNumberOrdersResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberOrders' => [ 'shape' => 'PhoneNumberOrderList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListPhoneNumbersRequest' => [ 'type' => 'structure', 'members' => [ 'Status' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'status', ], 'ProductType' => [ 'shape' => 'PhoneNumberProductType', 'location' => 'querystring', 'locationName' => 'product-type', ], 'FilterName' => [ 'shape' => 'PhoneNumberAssociationName', 'location' => 'querystring', 'locationName' => 'filter-name', ], 'FilterValue' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'filter-value', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListPhoneNumbersResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumbers' => [ 'shape' => 'PhoneNumberList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListProxySessionsRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'Status' => [ 'shape' => 'ProxySessionStatus', 'location' => 'querystring', 'locationName' => 'status', ], 'NextToken' => [ 'shape' => 'NextTokenString', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListProxySessionsResponse' => [ 'type' => 'structure', 'members' => [ 'ProxySessions' => [ 'shape' => 'ProxySessions', ], 'NextToken' => [ 'shape' => 'NextTokenString', ], ], ], 'ListSipMediaApplicationsRequest' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextTokenString', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListSipMediaApplicationsResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplications' => [ 'shape' => 'SipMediaApplicationList', ], 'NextToken' => [ 'shape' => 'NextTokenString', ], ], ], 'ListSipRulesRequest' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'querystring', 'locationName' => 'sip-media-application', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'NextTokenString', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'ListSipRulesResponse' => [ 'type' => 'structure', 'members' => [ 'SipRules' => [ 'shape' => 'SipRuleList', ], 'NextToken' => [ 'shape' => 'NextTokenString', ], ], ], 'ListSupportedPhoneNumberCountriesRequest' => [ 'type' => 'structure', 'required' => [ 'ProductType', ], 'members' => [ 'ProductType' => [ 'shape' => 'PhoneNumberProductType', 'location' => 'querystring', 'locationName' => 'product-type', ], ], ], 'ListSupportedPhoneNumberCountriesResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberCountries' => [ 'shape' => 'PhoneNumberCountriesList', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'Arn', 'location' => 'querystring', 'locationName' => 'arn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], ], ], 'ListVoiceConnectorGroupsRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListVoiceConnectorGroupsResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectorGroups' => [ 'shape' => 'VoiceConnectorGroupList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListVoiceConnectorTerminationCredentialsRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], ], ], 'ListVoiceConnectorTerminationCredentialsResponse' => [ 'type' => 'structure', 'members' => [ 'Usernames' => [ 'shape' => 'SensitiveStringList', ], ], ], 'ListVoiceConnectorsRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListVoiceConnectorsResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectors' => [ 'shape' => 'VoiceConnectorList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListVoiceProfileDomainsRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListVoiceProfileDomainsResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceProfileDomains' => [ 'shape' => 'VoiceProfileDomainSummaryList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListVoiceProfilesRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceProfileDomainId', ], 'members' => [ 'VoiceProfileDomainId' => [ 'shape' => 'NonEmptyString256', 'location' => 'querystring', 'locationName' => 'voice-profile-domain-id', ], 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], 'MaxResults' => [ 'shape' => 'ResultMax', 'location' => 'querystring', 'locationName' => 'max-results', ], ], ], 'ListVoiceProfilesResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceProfiles' => [ 'shape' => 'VoiceProfileSummaryList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'LoggingConfiguration' => [ 'type' => 'structure', 'members' => [ 'EnableSIPLogs' => [ 'shape' => 'Boolean', ], 'EnableMediaMetricLogs' => [ 'shape' => 'Boolean', ], ], ], 'MediaInsightsConfiguration' => [ 'type' => 'structure', 'members' => [ 'Disabled' => [ 'shape' => 'Boolean', ], 'ConfigurationArn' => [ 'shape' => 'Arn', ], ], ], 'NextTokenString' => [ 'type' => 'string', 'max' => 65535, ], 'NonEmptyString' => [ 'type' => 'string', 'pattern' => '.*\\\\S.*', ], 'NonEmptyString128' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '.*\\\\S.*', ], 'NonEmptyString256' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '.*\\\\S.*', ], 'NonEmptyStringList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], 'min' => 1, ], 'NotFoundException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'NotificationTarget' => [ 'type' => 'string', 'enum' => [ 'EventBridge', 'SNS', 'SQS', ], ], 'NullableBoolean' => [ 'type' => 'boolean', ], 'NumberSelectionBehavior' => [ 'type' => 'string', 'enum' => [ 'PreferSticky', 'AvoidSticky', ], ], 'OrderedPhoneNumber' => [ 'type' => 'structure', 'members' => [ 'E164PhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'Status' => [ 'shape' => 'OrderedPhoneNumberStatus', ], ], ], 'OrderedPhoneNumberList' => [ 'type' => 'list', 'member' => [ 'shape' => 'OrderedPhoneNumber', ], ], 'OrderedPhoneNumberStatus' => [ 'type' => 'string', 'enum' => [ 'Processing', 'Acquired', 'Failed', ], ], 'Origination' => [ 'type' => 'structure', 'members' => [ 'Routes' => [ 'shape' => 'OriginationRouteList', ], 'Disabled' => [ 'shape' => 'Boolean', ], ], ], 'OriginationRoute' => [ 'type' => 'structure', 'members' => [ 'Host' => [ 'shape' => 'String', ], 'Port' => [ 'shape' => 'Port', ], 'Protocol' => [ 'shape' => 'OriginationRouteProtocol', ], 'Priority' => [ 'shape' => 'OriginationRoutePriority', ], 'Weight' => [ 'shape' => 'OriginationRouteWeight', ], ], ], 'OriginationRouteList' => [ 'type' => 'list', 'member' => [ 'shape' => 'OriginationRoute', ], ], 'OriginationRoutePriority' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'OriginationRouteProtocol' => [ 'type' => 'string', 'enum' => [ 'TCP', 'UDP', ], ], 'OriginationRouteWeight' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'Participant' => [ 'type' => 'structure', 'members' => [ 'PhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'ProxyPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], ], ], 'ParticipantPhoneNumberList' => [ 'type' => 'list', 'member' => [ 'shape' => 'E164PhoneNumber', ], 'max' => 2, 'min' => 2, ], 'Participants' => [ 'type' => 'list', 'member' => [ 'shape' => 'Participant', ], ], 'PhoneNumber' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberId' => [ 'shape' => 'SensitiveNonEmptyString', ], 'E164PhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'Country' => [ 'shape' => 'Alpha2CountryCode', ], 'Type' => [ 'shape' => 'PhoneNumberType', ], 'ProductType' => [ 'shape' => 'PhoneNumberProductType', ], 'Status' => [ 'shape' => 'PhoneNumberStatus', ], 'Capabilities' => [ 'shape' => 'PhoneNumberCapabilities', ], 'Associations' => [ 'shape' => 'PhoneNumberAssociationList', ], 'CallingName' => [ 'shape' => 'CallingName', ], 'CallingNameStatus' => [ 'shape' => 'CallingNameStatus', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'DeletionTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'OrderId' => [ 'shape' => 'GuidString', ], ], ], 'PhoneNumberAssociation' => [ 'type' => 'structure', 'members' => [ 'Value' => [ 'shape' => 'String', ], 'Name' => [ 'shape' => 'PhoneNumberAssociationName', ], 'AssociatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'PhoneNumberAssociationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PhoneNumberAssociation', ], ], 'PhoneNumberAssociationName' => [ 'type' => 'string', 'enum' => [ 'VoiceConnectorId', 'VoiceConnectorGroupId', 'SipRuleId', ], ], 'PhoneNumberCapabilities' => [ 'type' => 'structure', 'members' => [ 'InboundCall' => [ 'shape' => 'NullableBoolean', ], 'OutboundCall' => [ 'shape' => 'NullableBoolean', ], 'InboundSMS' => [ 'shape' => 'NullableBoolean', ], 'OutboundSMS' => [ 'shape' => 'NullableBoolean', ], 'InboundMMS' => [ 'shape' => 'NullableBoolean', ], 'OutboundMMS' => [ 'shape' => 'NullableBoolean', ], ], ], 'PhoneNumberCountriesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PhoneNumberCountry', ], ], 'PhoneNumberCountry' => [ 'type' => 'structure', 'members' => [ 'CountryCode' => [ 'shape' => 'Alpha2CountryCode', ], 'SupportedPhoneNumberTypes' => [ 'shape' => 'PhoneNumberTypeList', ], ], ], 'PhoneNumberError' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberId' => [ 'shape' => 'SensitiveNonEmptyString', ], 'ErrorCode' => [ 'shape' => 'ErrorCode', ], 'ErrorMessage' => [ 'shape' => 'String', ], ], ], 'PhoneNumberErrorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PhoneNumberError', ], ], 'PhoneNumberList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PhoneNumber', ], ], 'PhoneNumberMaxResults' => [ 'type' => 'integer', 'max' => 500, 'min' => 1, ], 'PhoneNumberOrder' => [ 'type' => 'structure', 'members' => [ 'PhoneNumberOrderId' => [ 'shape' => 'GuidString', ], 'ProductType' => [ 'shape' => 'PhoneNumberProductType', ], 'Status' => [ 'shape' => 'PhoneNumberOrderStatus', ], 'OrderType' => [ 'shape' => 'PhoneNumberOrderType', ], 'OrderedPhoneNumbers' => [ 'shape' => 'OrderedPhoneNumberList', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'PhoneNumberOrderList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PhoneNumberOrder', ], ], 'PhoneNumberOrderStatus' => [ 'type' => 'string', 'enum' => [ 'Processing', 'Successful', 'Failed', 'Partial', 'PendingDocuments', 'Submitted', 'FOC', 'ChangeRequested', 'Exception', 'CancelRequested', 'Cancelled', ], ], 'PhoneNumberOrderType' => [ 'type' => 'string', 'enum' => [ 'New', 'Porting', ], ], 'PhoneNumberProductType' => [ 'type' => 'string', 'enum' => [ 'VoiceConnector', 'SipMediaApplicationDialIn', ], ], 'PhoneNumberStatus' => [ 'type' => 'string', 'enum' => [ 'Cancelled', 'PortinCancelRequested', 'PortinInProgress', 'AcquireInProgress', 'AcquireFailed', 'Unassigned', 'Assigned', 'ReleaseInProgress', 'DeleteInProgress', 'ReleaseFailed', 'DeleteFailed', ], ], 'PhoneNumberType' => [ 'type' => 'string', 'enum' => [ 'Local', 'TollFree', ], ], 'PhoneNumberTypeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PhoneNumberType', ], ], 'Port' => [ 'type' => 'integer', 'max' => 65535, 'min' => 0, ], 'PositiveInteger' => [ 'type' => 'integer', 'min' => 1, ], 'Proxy' => [ 'type' => 'structure', 'members' => [ 'DefaultSessionExpiryMinutes' => [ 'shape' => 'Integer', ], 'Disabled' => [ 'shape' => 'Boolean', ], 'FallBackPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'PhoneNumberCountries' => [ 'shape' => 'StringList', ], ], ], 'ProxySession' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', ], 'ProxySessionId' => [ 'shape' => 'NonEmptyString128', ], 'Name' => [ 'shape' => 'String128', ], 'Status' => [ 'shape' => 'ProxySessionStatus', ], 'ExpiryMinutes' => [ 'shape' => 'PositiveInteger', ], 'Capabilities' => [ 'shape' => 'CapabilityList', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'EndedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'Participants' => [ 'shape' => 'Participants', ], 'NumberSelectionBehavior' => [ 'shape' => 'NumberSelectionBehavior', ], 'GeoMatchLevel' => [ 'shape' => 'GeoMatchLevel', ], 'GeoMatchParams' => [ 'shape' => 'GeoMatchParams', ], ], ], 'ProxySessionNameString' => [ 'type' => 'string', 'pattern' => '^$|^[a-zA-Z0-9 ]{0,30}$', 'sensitive' => true, ], 'ProxySessionStatus' => [ 'type' => 'string', 'enum' => [ 'Open', 'InProgress', 'Closed', ], ], 'ProxySessions' => [ 'type' => 'list', 'member' => [ 'shape' => 'ProxySession', ], ], 'PutSipMediaApplicationAlexaSkillConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'SipMediaApplicationId', ], 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipMediaApplicationId', ], 'SipMediaApplicationAlexaSkillConfiguration' => [ 'shape' => 'SipMediaApplicationAlexaSkillConfiguration', ], ], ], 'PutSipMediaApplicationAlexaSkillConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplicationAlexaSkillConfiguration' => [ 'shape' => 'SipMediaApplicationAlexaSkillConfiguration', ], ], ], 'PutSipMediaApplicationLoggingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'SipMediaApplicationId', ], 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipMediaApplicationId', ], 'SipMediaApplicationLoggingConfiguration' => [ 'shape' => 'SipMediaApplicationLoggingConfiguration', ], ], ], 'PutSipMediaApplicationLoggingConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplicationLoggingConfiguration' => [ 'shape' => 'SipMediaApplicationLoggingConfiguration', ], ], ], 'PutVoiceConnectorEmergencyCallingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'EmergencyCallingConfiguration', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'EmergencyCallingConfiguration' => [ 'shape' => 'EmergencyCallingConfiguration', ], ], ], 'PutVoiceConnectorEmergencyCallingConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'EmergencyCallingConfiguration' => [ 'shape' => 'EmergencyCallingConfiguration', ], ], ], 'PutVoiceConnectorLoggingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'LoggingConfiguration', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'LoggingConfiguration' => [ 'shape' => 'LoggingConfiguration', ], ], ], 'PutVoiceConnectorLoggingConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'LoggingConfiguration' => [ 'shape' => 'LoggingConfiguration', ], ], ], 'PutVoiceConnectorOriginationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'Origination', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'Origination' => [ 'shape' => 'Origination', ], ], ], 'PutVoiceConnectorOriginationResponse' => [ 'type' => 'structure', 'members' => [ 'Origination' => [ 'shape' => 'Origination', ], ], ], 'PutVoiceConnectorProxyRequest' => [ 'type' => 'structure', 'required' => [ 'DefaultSessionExpiryMinutes', 'PhoneNumberPoolCountries', 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'DefaultSessionExpiryMinutes' => [ 'shape' => 'Integer', ], 'PhoneNumberPoolCountries' => [ 'shape' => 'CountryList', ], 'FallBackPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'Disabled' => [ 'shape' => 'Boolean', ], ], ], 'PutVoiceConnectorProxyResponse' => [ 'type' => 'structure', 'members' => [ 'Proxy' => [ 'shape' => 'Proxy', ], ], ], 'PutVoiceConnectorStreamingConfigurationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'StreamingConfiguration', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'StreamingConfiguration' => [ 'shape' => 'StreamingConfiguration', ], ], ], 'PutVoiceConnectorStreamingConfigurationResponse' => [ 'type' => 'structure', 'members' => [ 'StreamingConfiguration' => [ 'shape' => 'StreamingConfiguration', ], ], ], 'PutVoiceConnectorTerminationCredentialsRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'Credentials' => [ 'shape' => 'CredentialList', ], ], ], 'PutVoiceConnectorTerminationRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'Termination', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'Termination' => [ 'shape' => 'Termination', ], ], ], 'PutVoiceConnectorTerminationResponse' => [ 'type' => 'structure', 'members' => [ 'Termination' => [ 'shape' => 'Termination', ], ], ], 'ResourceLimitExceededException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'RestorePhoneNumberRequest' => [ 'type' => 'structure', 'required' => [ 'PhoneNumberId', ], 'members' => [ 'PhoneNumberId' => [ 'shape' => 'SensitiveNonEmptyString', 'location' => 'uri', 'locationName' => 'phoneNumberId', ], ], ], 'RestorePhoneNumberResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumber' => [ 'shape' => 'PhoneNumber', ], ], ], 'ResultMax' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'SMACreateCallArgumentsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'SensitiveString', ], 'value' => [ 'shape' => 'SensitiveString', ], 'max' => 20, 'min' => 0, ], 'SMAUpdateCallArgumentsMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'SensitiveString', ], 'value' => [ 'shape' => 'SensitiveString', ], 'max' => 20, 'min' => 0, ], 'SearchAvailablePhoneNumbersRequest' => [ 'type' => 'structure', 'members' => [ 'AreaCode' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'area-code', ], 'City' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'city', ], 'Country' => [ 'shape' => 'Alpha2CountryCode', 'location' => 'querystring', 'locationName' => 'country', ], 'State' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'state', ], 'TollFreePrefix' => [ 'shape' => 'TollFreePrefix', 'location' => 'querystring', 'locationName' => 'toll-free-prefix', ], 'PhoneNumberType' => [ 'shape' => 'PhoneNumberType', 'location' => 'querystring', 'locationName' => 'phone-number-type', ], 'MaxResults' => [ 'shape' => 'PhoneNumberMaxResults', 'location' => 'querystring', 'locationName' => 'max-results', ], 'NextToken' => [ 'shape' => 'String', 'location' => 'querystring', 'locationName' => 'next-token', ], ], ], 'SearchAvailablePhoneNumbersResponse' => [ 'type' => 'structure', 'members' => [ 'E164PhoneNumbers' => [ 'shape' => 'E164PhoneNumberList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'SensitiveNonEmptyString' => [ 'type' => 'string', 'pattern' => '.*\\\\S.*', 'sensitive' => true, ], 'SensitiveString' => [ 'type' => 'string', 'sensitive' => true, ], 'SensitiveStringList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SensitiveString', ], ], 'ServerSideEncryptionConfiguration' => [ 'type' => 'structure', 'required' => [ 'KmsKeyArn', ], 'members' => [ 'KmsKeyArn' => [ 'shape' => 'Arn', ], ], ], 'ServiceFailureException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'ServiceUnavailableException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], 'SipApplicationPriority' => [ 'type' => 'integer', 'min' => 1, ], 'SipHeadersMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'SensitiveString', ], 'value' => [ 'shape' => 'SensitiveString', ], 'max' => 20, 'min' => 0, ], 'SipMediaApplication' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', ], 'AwsRegion' => [ 'shape' => 'String', ], 'Name' => [ 'shape' => 'SipMediaApplicationName', ], 'Endpoints' => [ 'shape' => 'SipMediaApplicationEndpointList', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'SipMediaApplicationArn' => [ 'shape' => 'NonEmptyString', ], ], ], 'SipMediaApplicationAlexaSkillConfiguration' => [ 'type' => 'structure', 'required' => [ 'AlexaSkillStatus', 'AlexaSkillIds', ], 'members' => [ 'AlexaSkillStatus' => [ 'shape' => 'AlexaSkillStatus', ], 'AlexaSkillIds' => [ 'shape' => 'AlexaSkillIdList', ], ], ], 'SipMediaApplicationCall' => [ 'type' => 'structure', 'members' => [ 'TransactionId' => [ 'shape' => 'GuidString', ], ], ], 'SipMediaApplicationEndpoint' => [ 'type' => 'structure', 'members' => [ 'LambdaArn' => [ 'shape' => 'FunctionArn', ], ], ], 'SipMediaApplicationEndpointList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SipMediaApplicationEndpoint', ], 'max' => 1, 'min' => 1, ], 'SipMediaApplicationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SipMediaApplication', ], ], 'SipMediaApplicationLoggingConfiguration' => [ 'type' => 'structure', 'members' => [ 'EnableSipMediaApplicationMessageLogs' => [ 'shape' => 'Boolean', ], ], ], 'SipMediaApplicationName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '[a-zA-Z0-9 _.-]+', ], 'SipRule' => [ 'type' => 'structure', 'members' => [ 'SipRuleId' => [ 'shape' => 'NonEmptyString', ], 'Name' => [ 'shape' => 'SipRuleName', ], 'Disabled' => [ 'shape' => 'Boolean', ], 'TriggerType' => [ 'shape' => 'SipRuleTriggerType', ], 'TriggerValue' => [ 'shape' => 'NonEmptyString', ], 'TargetApplications' => [ 'shape' => 'SipRuleTargetApplicationList', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'SipRuleList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SipRule', ], ], 'SipRuleName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '[a-zA-Z0-9 _.-]+', ], 'SipRuleTargetApplication' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', ], 'Priority' => [ 'shape' => 'SipApplicationPriority', ], 'AwsRegion' => [ 'shape' => 'String', ], ], ], 'SipRuleTargetApplicationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SipRuleTargetApplication', ], 'max' => 25, 'min' => 1, ], 'SipRuleTriggerType' => [ 'type' => 'string', 'enum' => [ 'ToPhoneNumber', 'RequestUriHostname', ], ], 'SpeakerSearchDetails' => [ 'type' => 'structure', 'members' => [ 'Results' => [ 'shape' => 'SpeakerSearchResultList', ], 'VoiceprintGenerationStatus' => [ 'shape' => 'NonEmptyString256', ], ], ], 'SpeakerSearchResult' => [ 'type' => 'structure', 'members' => [ 'ConfidenceScore' => [ 'shape' => 'ConfidenceScore', ], 'VoiceProfileId' => [ 'shape' => 'NonEmptyString256', ], ], ], 'SpeakerSearchResultList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SpeakerSearchResult', ], ], 'SpeakerSearchTask' => [ 'type' => 'structure', 'members' => [ 'SpeakerSearchTaskId' => [ 'shape' => 'NonEmptyString256', ], 'SpeakerSearchTaskStatus' => [ 'shape' => 'NonEmptyString', ], 'CallDetails' => [ 'shape' => 'CallDetails', ], 'SpeakerSearchDetails' => [ 'shape' => 'SpeakerSearchDetails', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'StartedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'StatusMessage' => [ 'shape' => 'String', ], ], ], 'StartSpeakerSearchTaskRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'TransactionId', 'VoiceProfileDomainId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'VoiceConnectorId', ], 'TransactionId' => [ 'shape' => 'NonEmptyString256', ], 'VoiceProfileDomainId' => [ 'shape' => 'NonEmptyString256', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestId', ], 'CallLeg' => [ 'shape' => 'CallLegType', ], ], ], 'StartSpeakerSearchTaskResponse' => [ 'type' => 'structure', 'members' => [ 'SpeakerSearchTask' => [ 'shape' => 'SpeakerSearchTask', ], ], ], 'StartVoiceToneAnalysisTaskRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'TransactionId', 'LanguageCode', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'VoiceConnectorId', ], 'TransactionId' => [ 'shape' => 'NonEmptyString256', ], 'LanguageCode' => [ 'shape' => 'LanguageCode', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestId', ], ], ], 'StartVoiceToneAnalysisTaskResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceToneAnalysisTask' => [ 'shape' => 'VoiceToneAnalysisTask', ], ], ], 'StopSpeakerSearchTaskRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'SpeakerSearchTaskId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'VoiceConnectorId', ], 'SpeakerSearchTaskId' => [ 'shape' => 'NonEmptyString256', 'location' => 'uri', 'locationName' => 'SpeakerSearchTaskId', ], ], ], 'StopVoiceToneAnalysisTaskRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'VoiceToneAnalysisTaskId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'VoiceConnectorId', ], 'VoiceToneAnalysisTaskId' => [ 'shape' => 'NonEmptyString256', 'location' => 'uri', 'locationName' => 'VoiceToneAnalysisTaskId', ], ], ], 'StreamingConfiguration' => [ 'type' => 'structure', 'required' => [ 'DataRetentionInHours', 'Disabled', ], 'members' => [ 'DataRetentionInHours' => [ 'shape' => 'DataRetentionInHours', ], 'Disabled' => [ 'shape' => 'Boolean', ], 'StreamingNotificationTargets' => [ 'shape' => 'StreamingNotificationTargetList', ], 'MediaInsightsConfiguration' => [ 'shape' => 'MediaInsightsConfiguration', ], ], ], 'StreamingNotificationTarget' => [ 'type' => 'structure', 'members' => [ 'NotificationTarget' => [ 'shape' => 'NotificationTarget', ], ], ], 'StreamingNotificationTargetList' => [ 'type' => 'list', 'member' => [ 'shape' => 'StreamingNotificationTarget', ], 'max' => 3, 'min' => 1, ], 'String' => [ 'type' => 'string', ], 'String128' => [ 'type' => 'string', 'max' => 128, ], 'StringList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', ], ], 'Tag' => [ 'type' => 'structure', 'required' => [ 'Key', 'Value', ], 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'sensitive' => true, ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 50, 'min' => 1, ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], 'max' => 50, 'min' => 1, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'Tags', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'Arn', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'sensitive' => true, ], 'Termination' => [ 'type' => 'structure', 'members' => [ 'CpsLimit' => [ 'shape' => 'CpsLimit', ], 'DefaultPhoneNumber' => [ 'shape' => 'E164PhoneNumber', ], 'CallingRegions' => [ 'shape' => 'CallingRegionList', ], 'CidrAllowedList' => [ 'shape' => 'StringList', ], 'Disabled' => [ 'shape' => 'Boolean', ], ], ], 'TerminationHealth' => [ 'type' => 'structure', 'members' => [ 'Timestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'Source' => [ 'shape' => 'String', ], ], ], 'ThrottledClientException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], 'TollFreePrefix' => [ 'type' => 'string', 'max' => 3, 'min' => 3, 'pattern' => '^8(00|33|44|55|66|77|88)$', ], 'UnauthorizedClientException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], 'UnprocessableEntityException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'httpStatusCode' => 422, ], 'exception' => true, ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'TagKeys', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'Arn', ], 'TagKeys' => [ 'shape' => 'TagKeyList', ], ], ], 'UpdateGlobalSettingsRequest' => [ 'type' => 'structure', 'members' => [ 'VoiceConnector' => [ 'shape' => 'VoiceConnectorSettings', ], ], ], 'UpdatePhoneNumberRequest' => [ 'type' => 'structure', 'required' => [ 'PhoneNumberId', ], 'members' => [ 'PhoneNumberId' => [ 'shape' => 'SensitiveNonEmptyString', 'location' => 'uri', 'locationName' => 'phoneNumberId', ], 'ProductType' => [ 'shape' => 'PhoneNumberProductType', ], 'CallingName' => [ 'shape' => 'CallingName', ], ], ], 'UpdatePhoneNumberRequestItem' => [ 'type' => 'structure', 'required' => [ 'PhoneNumberId', ], 'members' => [ 'PhoneNumberId' => [ 'shape' => 'SensitiveNonEmptyString', ], 'ProductType' => [ 'shape' => 'PhoneNumberProductType', ], 'CallingName' => [ 'shape' => 'CallingName', ], ], ], 'UpdatePhoneNumberRequestItemList' => [ 'type' => 'list', 'member' => [ 'shape' => 'UpdatePhoneNumberRequestItem', ], ], 'UpdatePhoneNumberResponse' => [ 'type' => 'structure', 'members' => [ 'PhoneNumber' => [ 'shape' => 'PhoneNumber', ], ], ], 'UpdatePhoneNumberSettingsRequest' => [ 'type' => 'structure', 'required' => [ 'CallingName', ], 'members' => [ 'CallingName' => [ 'shape' => 'CallingName', ], ], ], 'UpdateProxySessionRequest' => [ 'type' => 'structure', 'required' => [ 'Capabilities', 'VoiceConnectorId', 'ProxySessionId', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'ProxySessionId' => [ 'shape' => 'NonEmptyString128', 'location' => 'uri', 'locationName' => 'proxySessionId', ], 'Capabilities' => [ 'shape' => 'CapabilityList', ], 'ExpiryMinutes' => [ 'shape' => 'PositiveInteger', ], ], ], 'UpdateProxySessionResponse' => [ 'type' => 'structure', 'members' => [ 'ProxySession' => [ 'shape' => 'ProxySession', ], ], ], 'UpdateSipMediaApplicationCallRequest' => [ 'type' => 'structure', 'required' => [ 'SipMediaApplicationId', 'TransactionId', 'Arguments', ], 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipMediaApplicationId', ], 'TransactionId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'transactionId', ], 'Arguments' => [ 'shape' => 'SMAUpdateCallArgumentsMap', ], ], ], 'UpdateSipMediaApplicationCallResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplicationCall' => [ 'shape' => 'SipMediaApplicationCall', ], ], ], 'UpdateSipMediaApplicationRequest' => [ 'type' => 'structure', 'required' => [ 'SipMediaApplicationId', ], 'members' => [ 'SipMediaApplicationId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipMediaApplicationId', ], 'Name' => [ 'shape' => 'SipMediaApplicationName', ], 'Endpoints' => [ 'shape' => 'SipMediaApplicationEndpointList', ], ], ], 'UpdateSipMediaApplicationResponse' => [ 'type' => 'structure', 'members' => [ 'SipMediaApplication' => [ 'shape' => 'SipMediaApplication', ], ], ], 'UpdateSipRuleRequest' => [ 'type' => 'structure', 'required' => [ 'SipRuleId', 'Name', ], 'members' => [ 'SipRuleId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'sipRuleId', ], 'Name' => [ 'shape' => 'SipRuleName', ], 'Disabled' => [ 'shape' => 'NullableBoolean', ], 'TargetApplications' => [ 'shape' => 'SipRuleTargetApplicationList', ], ], ], 'UpdateSipRuleResponse' => [ 'type' => 'structure', 'members' => [ 'SipRule' => [ 'shape' => 'SipRule', ], ], ], 'UpdateVoiceConnectorGroupRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorGroupId', 'Name', 'VoiceConnectorItems', ], 'members' => [ 'VoiceConnectorGroupId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorGroupId', ], 'Name' => [ 'shape' => 'VoiceConnectorGroupName', ], 'VoiceConnectorItems' => [ 'shape' => 'VoiceConnectorItemList', ], ], ], 'UpdateVoiceConnectorGroupResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectorGroup' => [ 'shape' => 'VoiceConnectorGroup', ], ], ], 'UpdateVoiceConnectorRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'Name', 'RequireEncryption', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', 'location' => 'uri', 'locationName' => 'voiceConnectorId', ], 'Name' => [ 'shape' => 'VoiceConnectorName', ], 'RequireEncryption' => [ 'shape' => 'Boolean', ], ], ], 'UpdateVoiceConnectorResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceConnector' => [ 'shape' => 'VoiceConnector', ], ], ], 'UpdateVoiceProfileDomainRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceProfileDomainId', ], 'members' => [ 'VoiceProfileDomainId' => [ 'shape' => 'NonEmptyString256', 'location' => 'uri', 'locationName' => 'VoiceProfileDomainId', ], 'Name' => [ 'shape' => 'VoiceProfileDomainName', ], 'Description' => [ 'shape' => 'VoiceProfileDomainDescription', ], ], ], 'UpdateVoiceProfileDomainResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceProfileDomain' => [ 'shape' => 'VoiceProfileDomain', ], ], ], 'UpdateVoiceProfileRequest' => [ 'type' => 'structure', 'required' => [ 'VoiceProfileId', 'SpeakerSearchTaskId', ], 'members' => [ 'VoiceProfileId' => [ 'shape' => 'NonEmptyString256', 'location' => 'uri', 'locationName' => 'VoiceProfileId', ], 'SpeakerSearchTaskId' => [ 'shape' => 'NonEmptyString256', ], ], ], 'UpdateVoiceProfileResponse' => [ 'type' => 'structure', 'members' => [ 'VoiceProfile' => [ 'shape' => 'VoiceProfile', ], ], ], 'ValidateE911AddressRequest' => [ 'type' => 'structure', 'required' => [ 'AwsAccountId', 'StreetNumber', 'StreetInfo', 'City', 'State', 'Country', 'PostalCode', ], 'members' => [ 'AwsAccountId' => [ 'shape' => 'NonEmptyString', ], 'StreetNumber' => [ 'shape' => 'SensitiveNonEmptyString', ], 'StreetInfo' => [ 'shape' => 'SensitiveNonEmptyString', ], 'City' => [ 'shape' => 'SensitiveNonEmptyString', ], 'State' => [ 'shape' => 'SensitiveNonEmptyString', ], 'Country' => [ 'shape' => 'SensitiveNonEmptyString', ], 'PostalCode' => [ 'shape' => 'SensitiveNonEmptyString', ], ], ], 'ValidateE911AddressResponse' => [ 'type' => 'structure', 'members' => [ 'ValidationResult' => [ 'shape' => 'ValidationResult', ], 'AddressExternalId' => [ 'shape' => 'String', ], 'Address' => [ 'shape' => 'Address', ], 'CandidateAddressList' => [ 'shape' => 'CandidateAddressList', ], ], ], 'ValidationResult' => [ 'type' => 'integer', 'max' => 2, 'min' => 0, ], 'VoiceConnector' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', ], 'AwsRegion' => [ 'shape' => 'VoiceConnectorAwsRegion', ], 'Name' => [ 'shape' => 'VoiceConnectorName', ], 'OutboundHostName' => [ 'shape' => 'String', ], 'RequireEncryption' => [ 'shape' => 'Boolean', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'VoiceConnectorArn' => [ 'shape' => 'NonEmptyString', ], ], ], 'VoiceConnectorAwsRegion' => [ 'type' => 'string', 'enum' => [ 'us-east-1', 'us-west-2', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'ap-northeast-2', 'ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2', ], ], 'VoiceConnectorAwsRegionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VoiceConnectorAwsRegion', ], ], 'VoiceConnectorGroup' => [ 'type' => 'structure', 'members' => [ 'VoiceConnectorGroupId' => [ 'shape' => 'NonEmptyString', ], 'Name' => [ 'shape' => 'VoiceConnectorGroupName', ], 'VoiceConnectorItems' => [ 'shape' => 'VoiceConnectorItemList', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'VoiceConnectorGroupArn' => [ 'shape' => 'NonEmptyString', ], ], ], 'VoiceConnectorGroupList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VoiceConnectorGroup', ], ], 'VoiceConnectorGroupName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '[a-zA-Z0-9 _.-]+', ], 'VoiceConnectorItem' => [ 'type' => 'structure', 'required' => [ 'VoiceConnectorId', 'Priority', ], 'members' => [ 'VoiceConnectorId' => [ 'shape' => 'NonEmptyString', ], 'Priority' => [ 'shape' => 'VoiceConnectorItemPriority', ], ], ], 'VoiceConnectorItemList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VoiceConnectorItem', ], ], 'VoiceConnectorItemPriority' => [ 'type' => 'integer', 'max' => 99, 'min' => 1, ], 'VoiceConnectorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VoiceConnector', ], ], 'VoiceConnectorName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '[a-zA-Z0-9 _.-]+', ], 'VoiceConnectorSettings' => [ 'type' => 'structure', 'members' => [ 'CdrBucket' => [ 'shape' => 'String', ], ], ], 'VoiceProfile' => [ 'type' => 'structure', 'members' => [ 'VoiceProfileId' => [ 'shape' => 'NonEmptyString256', ], 'VoiceProfileArn' => [ 'shape' => 'Arn', ], 'VoiceProfileDomainId' => [ 'shape' => 'NonEmptyString256', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'ExpirationTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'VoiceProfileDomain' => [ 'type' => 'structure', 'members' => [ 'VoiceProfileDomainId' => [ 'shape' => 'NonEmptyString256', ], 'VoiceProfileDomainArn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'VoiceProfileDomainName', ], 'Description' => [ 'shape' => 'VoiceProfileDomainDescription', ], 'ServerSideEncryptionConfiguration' => [ 'shape' => 'ServerSideEncryptionConfiguration', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'VoiceProfileDomainDescription' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, ], 'VoiceProfileDomainName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '[a-zA-Z0-9 _.-]+', ], 'VoiceProfileDomainSummary' => [ 'type' => 'structure', 'members' => [ 'VoiceProfileDomainId' => [ 'shape' => 'NonEmptyString256', ], 'VoiceProfileDomainArn' => [ 'shape' => 'Arn', ], 'Name' => [ 'shape' => 'VoiceProfileDomainName', ], 'Description' => [ 'shape' => 'VoiceProfileDomainDescription', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'VoiceProfileDomainSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VoiceProfileDomainSummary', ], ], 'VoiceProfileSummary' => [ 'type' => 'structure', 'members' => [ 'VoiceProfileId' => [ 'shape' => 'NonEmptyString256', ], 'VoiceProfileArn' => [ 'shape' => 'Arn', ], 'VoiceProfileDomainId' => [ 'shape' => 'NonEmptyString256', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'ExpirationTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], ], ], 'VoiceProfileSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'VoiceProfileSummary', ], ], 'VoiceToneAnalysisTask' => [ 'type' => 'structure', 'members' => [ 'VoiceToneAnalysisTaskId' => [ 'shape' => 'NonEmptyString256', ], 'VoiceToneAnalysisTaskStatus' => [ 'shape' => 'NonEmptyString', ], 'CallDetails' => [ 'shape' => 'CallDetails', ], 'CreatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'UpdatedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'StartedTimestamp' => [ 'shape' => 'Iso8601Timestamp', ], 'StatusMessage' => [ 'shape' => 'String', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-voice/2022-08-03/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://voice-chime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://voice-chime-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://voice-chime.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://voice-chime.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-voice/2022-08-03/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://voice-chime-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://voice-chime-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://voice-chime.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://voice-chime.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://voice-chime-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://voice-chime-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://voice-chime.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://voice-chime.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://voice-chime-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://voice-chime.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'Region' => 'us-iso-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://voice-chime-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://voice-chime-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://voice-chime.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://voice-chime.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://voice-chime-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://voice-chime.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'Region' => 'us-isob-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-voice/2022-08-03/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/chime-sdk-voice/2022-08-03/paginators-1.json\nreturn [ 'pagination' => [ 'ListPhoneNumberOrders' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListPhoneNumbers' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListProxySessions' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListSipMediaApplications' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'SipMediaApplications', ], 'ListSipRules' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'SipRules', ], 'ListVoiceConnectorGroups' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListVoiceConnectors' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListVoiceProfileDomains' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListVoiceProfiles' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'SearchAvailablePhoneNumbers' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cleanrooms/2022-02-17/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2022-02-17', 'endpointPrefix' => 'cleanrooms', 'jsonVersion' => '1.1', 'protocol' => 'rest-json', 'serviceFullName' => 'AWS Clean Rooms Service', 'serviceId' => 'CleanRooms', 'signatureVersion' => 'v4', 'signingName' => 'cleanrooms', 'uid' => 'cleanrooms-2022-02-17', ], 'operations' => [ 'BatchGetSchema' => [ 'name' => 'BatchGetSchema', 'http' => [ 'method' => 'POST', 'requestUri' => '/collaborations/{collaborationIdentifier}/batch-schema', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchGetSchemaInput', ], 'output' => [ 'shape' => 'BatchGetSchemaOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'CreateCollaboration' => [ 'name' => 'CreateCollaboration', 'http' => [ 'method' => 'POST', 'requestUri' => '/collaborations', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateCollaborationInput', ], 'output' => [ 'shape' => 'CreateCollaborationOutput', ], 'errors' => [ [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'CreateConfiguredTable' => [ 'name' => 'CreateConfiguredTable', 'http' => [ 'method' => 'POST', 'requestUri' => '/configuredTables', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateConfiguredTableInput', ], 'output' => [ 'shape' => 'CreateConfiguredTableOutput', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'CreateConfiguredTableAnalysisRule' => [ 'name' => 'CreateConfiguredTableAnalysisRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/configuredTables/{configuredTableIdentifier}/analysisRule', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateConfiguredTableAnalysisRuleInput', ], 'output' => [ 'shape' => 'CreateConfiguredTableAnalysisRuleOutput', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'CreateConfiguredTableAssociation' => [ 'name' => 'CreateConfiguredTableAssociation', 'http' => [ 'method' => 'POST', 'requestUri' => '/memberships/{membershipIdentifier}/configuredTableAssociations', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateConfiguredTableAssociationInput', ], 'output' => [ 'shape' => 'CreateConfiguredTableAssociationOutput', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'CreateMembership' => [ 'name' => 'CreateMembership', 'http' => [ 'method' => 'POST', 'requestUri' => '/memberships', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateMembershipInput', ], 'output' => [ 'shape' => 'CreateMembershipOutput', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'DeleteCollaboration' => [ 'name' => 'DeleteCollaboration', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/collaborations/{collaborationIdentifier}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteCollaborationInput', ], 'output' => [ 'shape' => 'DeleteCollaborationOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'DeleteConfiguredTable' => [ 'name' => 'DeleteConfiguredTable', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/configuredTables/{configuredTableIdentifier}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteConfiguredTableInput', ], 'output' => [ 'shape' => 'DeleteConfiguredTableOutput', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'DeleteConfiguredTableAnalysisRule' => [ 'name' => 'DeleteConfiguredTableAnalysisRule', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/configuredTables/{configuredTableIdentifier}/analysisRule/{analysisRuleType}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteConfiguredTableAnalysisRuleInput', ], 'output' => [ 'shape' => 'DeleteConfiguredTableAnalysisRuleOutput', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'DeleteConfiguredTableAssociation' => [ 'name' => 'DeleteConfiguredTableAssociation', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/memberships/{membershipIdentifier}/configuredTableAssociations/{configuredTableAssociationIdentifier}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteConfiguredTableAssociationInput', ], 'output' => [ 'shape' => 'DeleteConfiguredTableAssociationOutput', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'DeleteMember' => [ 'name' => 'DeleteMember', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/collaborations/{collaborationIdentifier}/member/{accountId}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteMemberInput', ], 'output' => [ 'shape' => 'DeleteMemberOutput', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'DeleteMembership' => [ 'name' => 'DeleteMembership', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/memberships/{membershipIdentifier}', 'responseCode' => 204, ], 'input' => [ 'shape' => 'DeleteMembershipInput', ], 'output' => [ 'shape' => 'DeleteMembershipOutput', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], 'GetCollaboration' => [ 'name' => 'GetCollaboration', 'http' => [ 'method' => 'GET', 'requestUri' => '/collaborations/{collaborationIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetCollaborationInput', ], 'output' => [ 'shape' => 'GetCollaborationOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetConfiguredTable' => [ 'name' => 'GetConfiguredTable', 'http' => [ 'method' => 'GET', 'requestUri' => '/configuredTables/{configuredTableIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetConfiguredTableInput', ], 'output' => [ 'shape' => 'GetConfiguredTableOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetConfiguredTableAnalysisRule' => [ 'name' => 'GetConfiguredTableAnalysisRule', 'http' => [ 'method' => 'GET', 'requestUri' => '/configuredTables/{configuredTableIdentifier}/analysisRule/{analysisRuleType}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetConfiguredTableAnalysisRuleInput', ], 'output' => [ 'shape' => 'GetConfiguredTableAnalysisRuleOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetConfiguredTableAssociation' => [ 'name' => 'GetConfiguredTableAssociation', 'http' => [ 'method' => 'GET', 'requestUri' => '/memberships/{membershipIdentifier}/configuredTableAssociations/{configuredTableAssociationIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetConfiguredTableAssociationInput', ], 'output' => [ 'shape' => 'GetConfiguredTableAssociationOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetMembership' => [ 'name' => 'GetMembership', 'http' => [ 'method' => 'GET', 'requestUri' => '/memberships/{membershipIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetMembershipInput', ], 'output' => [ 'shape' => 'GetMembershipOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetProtectedQuery' => [ 'name' => 'GetProtectedQuery', 'http' => [ 'method' => 'GET', 'requestUri' => '/memberships/{membershipIdentifier}/protectedQueries/{protectedQueryIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetProtectedQueryInput', ], 'output' => [ 'shape' => 'GetProtectedQueryOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetSchema' => [ 'name' => 'GetSchema', 'http' => [ 'method' => 'GET', 'requestUri' => '/collaborations/{collaborationIdentifier}/schemas/{name}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetSchemaInput', ], 'output' => [ 'shape' => 'GetSchemaOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetSchemaAnalysisRule' => [ 'name' => 'GetSchemaAnalysisRule', 'http' => [ 'method' => 'GET', 'requestUri' => '/collaborations/{collaborationIdentifier}/schemas/{name}/analysisRule/{type}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetSchemaAnalysisRuleInput', ], 'output' => [ 'shape' => 'GetSchemaAnalysisRuleOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListCollaborations' => [ 'name' => 'ListCollaborations', 'http' => [ 'method' => 'GET', 'requestUri' => '/collaborations', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListCollaborationsInput', ], 'output' => [ 'shape' => 'ListCollaborationsOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListConfiguredTableAssociations' => [ 'name' => 'ListConfiguredTableAssociations', 'http' => [ 'method' => 'GET', 'requestUri' => '/memberships/{membershipIdentifier}/configuredTableAssociations', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListConfiguredTableAssociationsInput', ], 'output' => [ 'shape' => 'ListConfiguredTableAssociationsOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListConfiguredTables' => [ 'name' => 'ListConfiguredTables', 'http' => [ 'method' => 'GET', 'requestUri' => '/configuredTables', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListConfiguredTablesInput', ], 'output' => [ 'shape' => 'ListConfiguredTablesOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListMembers' => [ 'name' => 'ListMembers', 'http' => [ 'method' => 'GET', 'requestUri' => '/collaborations/{collaborationIdentifier}/members', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListMembersInput', ], 'output' => [ 'shape' => 'ListMembersOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListMemberships' => [ 'name' => 'ListMemberships', 'http' => [ 'method' => 'GET', 'requestUri' => '/memberships', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListMembershipsInput', ], 'output' => [ 'shape' => 'ListMembershipsOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListProtectedQueries' => [ 'name' => 'ListProtectedQueries', 'http' => [ 'method' => 'GET', 'requestUri' => '/memberships/{membershipIdentifier}/protectedQueries', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListProtectedQueriesInput', ], 'output' => [ 'shape' => 'ListProtectedQueriesOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListSchemas' => [ 'name' => 'ListSchemas', 'http' => [ 'method' => 'GET', 'requestUri' => '/collaborations/{collaborationIdentifier}/schemas', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListSchemasInput', ], 'output' => [ 'shape' => 'ListSchemasOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'GET', 'requestUri' => '/tags/{resourceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTagsForResourceInput', ], 'output' => [ 'shape' => 'ListTagsForResourceOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], ], ], 'StartProtectedQuery' => [ 'name' => 'StartProtectedQuery', 'http' => [ 'method' => 'POST', 'requestUri' => '/memberships/{membershipIdentifier}/protectedQueries', 'responseCode' => 200, ], 'input' => [ 'shape' => 'StartProtectedQueryInput', ], 'output' => [ 'shape' => 'StartProtectedQueryOutput', ], 'errors' => [ [ 'shape' => 'ServiceQuotaExceededException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/tags/{resourceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'TagResourceInput', ], 'output' => [ 'shape' => 'TagResourceOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/tags/{resourceArn}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UntagResourceInput', ], 'output' => [ 'shape' => 'UntagResourceOutput', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], ], ], 'UpdateCollaboration' => [ 'name' => 'UpdateCollaboration', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/collaborations/{collaborationIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateCollaborationInput', ], 'output' => [ 'shape' => 'UpdateCollaborationOutput', ], 'errors' => [ [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'UpdateConfiguredTable' => [ 'name' => 'UpdateConfiguredTable', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/configuredTables/{configuredTableIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateConfiguredTableInput', ], 'output' => [ 'shape' => 'UpdateConfiguredTableOutput', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'UpdateConfiguredTableAnalysisRule' => [ 'name' => 'UpdateConfiguredTableAnalysisRule', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/configuredTables/{configuredTableIdentifier}/analysisRule/{analysisRuleType}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateConfiguredTableAnalysisRuleInput', ], 'output' => [ 'shape' => 'UpdateConfiguredTableAnalysisRuleOutput', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'UpdateConfiguredTableAssociation' => [ 'name' => 'UpdateConfiguredTableAssociation', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/memberships/{membershipIdentifier}/configuredTableAssociations/{configuredTableAssociationIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateConfiguredTableAssociationInput', ], 'output' => [ 'shape' => 'UpdateConfiguredTableAssociationOutput', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'UpdateMembership' => [ 'name' => 'UpdateMembership', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/memberships/{membershipIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateMembershipInput', ], 'output' => [ 'shape' => 'UpdateMembershipOutput', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'UpdateProtectedQuery' => [ 'name' => 'UpdateProtectedQuery', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/memberships/{membershipIdentifier}/protectedQueries/{protectedQueryIdentifier}', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateProtectedQueryInput', ], 'output' => [ 'shape' => 'UpdateProtectedQueryOutput', ], 'errors' => [ [ 'shape' => 'ConflictException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InternalServerException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'ThrottlingException', ], [ 'shape' => 'AccessDeniedException', ], ], 'idempotent' => true, ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], 'reason' => [ 'shape' => 'AccessDeniedExceptionReason', ], ], 'error' => [ 'httpStatusCode' => 403, 'senderFault' => true, ], 'exception' => true, ], 'AccessDeniedExceptionReason' => [ 'type' => 'string', 'enum' => [ 'INSUFFICIENT_PERMISSIONS', ], ], 'AccountId' => [ 'type' => 'string', 'max' => 12, 'min' => 12, 'pattern' => '\\\\d+', ], 'AggregateColumn' => [ 'type' => 'structure', 'required' => [ 'columnNames', 'function', ], 'members' => [ 'columnNames' => [ 'shape' => 'AggregateColumnColumnNamesList', ], 'function' => [ 'shape' => 'AggregateFunctionName', ], ], ], 'AggregateColumnColumnNamesList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AnalysisRuleColumnName', ], 'min' => 1, ], 'AggregateFunctionName' => [ 'type' => 'string', 'enum' => [ 'SUM', 'SUM_DISTINCT', 'COUNT', 'COUNT_DISTINCT', 'AVG', ], ], 'AggregationConstraint' => [ 'type' => 'structure', 'required' => [ 'columnName', 'minimum', 'type', ], 'members' => [ 'columnName' => [ 'shape' => 'AnalysisRuleColumnName', ], 'minimum' => [ 'shape' => 'AggregationConstraintMinimumInteger', ], 'type' => [ 'shape' => 'AggregationType', ], ], ], 'AggregationConstraintMinimumInteger' => [ 'type' => 'integer', 'box' => true, 'max' => 100000, 'min' => 2, ], 'AggregationConstraints' => [ 'type' => 'list', 'member' => [ 'shape' => 'AggregationConstraint', ], 'min' => 1, ], 'AggregationType' => [ 'type' => 'string', 'enum' => [ 'COUNT_DISTINCT', ], ], 'AllowedColumnList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ColumnName', ], 'max' => 100, 'min' => 1, ], 'AnalysisMethod' => [ 'type' => 'string', 'enum' => [ 'DIRECT_QUERY', ], ], 'AnalysisRule' => [ 'type' => 'structure', 'required' => [ 'collaborationId', 'type', 'name', 'createTime', 'updateTime', 'policy', ], 'members' => [ 'collaborationId' => [ 'shape' => 'CollaborationIdentifier', ], 'type' => [ 'shape' => 'AnalysisRuleType', ], 'name' => [ 'shape' => 'TableAlias', ], 'createTime' => [ 'shape' => 'Timestamp', ], 'updateTime' => [ 'shape' => 'Timestamp', ], 'policy' => [ 'shape' => 'AnalysisRulePolicy', ], ], ], 'AnalysisRuleAggregation' => [ 'type' => 'structure', 'required' => [ 'aggregateColumns', 'joinColumns', 'dimensionColumns', 'scalarFunctions', 'outputConstraints', ], 'members' => [ 'aggregateColumns' => [ 'shape' => 'AnalysisRuleAggregationAggregateColumnsList', ], 'joinColumns' => [ 'shape' => 'AnalysisRuleColumnList', ], 'joinRequired' => [ 'shape' => 'JoinRequiredOption', ], 'allowedJoinOperators' => [ 'shape' => 'JoinOperatorsList', ], 'dimensionColumns' => [ 'shape' => 'AnalysisRuleColumnList', ], 'scalarFunctions' => [ 'shape' => 'ScalarFunctionsList', ], 'outputConstraints' => [ 'shape' => 'AggregationConstraints', ], ], ], 'AnalysisRuleAggregationAggregateColumnsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AggregateColumn', ], 'min' => 1, ], 'AnalysisRuleColumnList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AnalysisRuleColumnName', ], ], 'AnalysisRuleColumnName' => [ 'type' => 'string', 'max' => 127, 'min' => 1, 'pattern' => '[a-z0-9_](([a-z0-9_ ]+-)*([a-z0-9_ ]+))?', ], 'AnalysisRuleList' => [ 'type' => 'structure', 'required' => [ 'joinColumns', 'listColumns', ], 'members' => [ 'joinColumns' => [ 'shape' => 'AnalysisRuleListJoinColumnsList', ], 'allowedJoinOperators' => [ 'shape' => 'JoinOperatorsList', ], 'listColumns' => [ 'shape' => 'AnalysisRuleColumnList', ], ], ], 'AnalysisRuleListJoinColumnsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AnalysisRuleColumnName', ], 'min' => 1, ], 'AnalysisRulePolicy' => [ 'type' => 'structure', 'members' => [ 'v1' => [ 'shape' => 'AnalysisRulePolicyV1', ], ], 'union' => true, ], 'AnalysisRulePolicyV1' => [ 'type' => 'structure', 'members' => [ 'list' => [ 'shape' => 'AnalysisRuleList', ], 'aggregation' => [ 'shape' => 'AnalysisRuleAggregation', ], ], 'union' => true, ], 'AnalysisRuleType' => [ 'type' => 'string', 'enum' => [ 'AGGREGATION', 'LIST', ], ], 'AnalysisRuleTypeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AnalysisRuleType', ], ], 'BatchGetSchemaError' => [ 'type' => 'structure', 'required' => [ 'name', 'code', 'message', ], 'members' => [ 'name' => [ 'shape' => 'TableAlias', ], 'code' => [ 'shape' => 'String', ], 'message' => [ 'shape' => 'String', ], ], ], 'BatchGetSchemaErrorList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BatchGetSchemaError', ], 'max' => 25, 'min' => 0, ], 'BatchGetSchemaInput' => [ 'type' => 'structure', 'required' => [ 'collaborationIdentifier', 'names', ], 'members' => [ 'collaborationIdentifier' => [ 'shape' => 'CollaborationIdentifier', 'location' => 'uri', 'locationName' => 'collaborationIdentifier', ], 'names' => [ 'shape' => 'TableAliasList', ], ], ], 'BatchGetSchemaOutput' => [ 'type' => 'structure', 'required' => [ 'schemas', 'errors', ], 'members' => [ 'schemas' => [ 'shape' => 'SchemaList', ], 'errors' => [ 'shape' => 'BatchGetSchemaErrorList', ], ], ], 'Boolean' => [ 'type' => 'boolean', 'box' => true, ], 'CleanroomsArn' => [ 'type' => 'string', 'max' => 100, 'min' => 0, 'pattern' => 'arn:aws:cleanrooms:[\\\\w]{2}-[\\\\w]{4,9}-[\\\\d]:[\\\\d]{12}:[\\\\d\\\\w/-]+', ], 'Collaboration' => [ 'type' => 'structure', 'required' => [ 'id', 'arn', 'name', 'creatorAccountId', 'creatorDisplayName', 'createTime', 'updateTime', 'memberStatus', 'queryLogStatus', ], 'members' => [ 'id' => [ 'shape' => 'UUID', ], 'arn' => [ 'shape' => 'CollaborationArn', ], 'name' => [ 'shape' => 'CollaborationName', ], 'description' => [ 'shape' => 'CollaborationDescription', ], 'creatorAccountId' => [ 'shape' => 'AccountId', ], 'creatorDisplayName' => [ 'shape' => 'DisplayName', ], 'createTime' => [ 'shape' => 'Timestamp', ], 'updateTime' => [ 'shape' => 'Timestamp', ], 'memberStatus' => [ 'shape' => 'MemberStatus', ], 'membershipId' => [ 'shape' => 'UUID', ], 'membershipArn' => [ 'shape' => 'MembershipArn', ], 'dataEncryptionMetadata' => [ 'shape' => 'DataEncryptionMetadata', ], 'queryLogStatus' => [ 'shape' => 'CollaborationQueryLogStatus', ], ], ], 'CollaborationArn' => [ 'type' => 'string', 'max' => 100, 'min' => 0, 'pattern' => 'arn:aws:[\\\\w]+:[\\\\w]{2}-[\\\\w]{4,9}-[\\\\d]:[\\\\d]{12}:collaboration/[\\\\d\\\\w-]+', ], 'CollaborationDescription' => [ 'type' => 'string', 'max' => 255, 'min' => 1, 'pattern' => '(?!\\\\s*$)[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDBFF-\\\\uDC00\\\\uDFFF\\\\t\\\\r\\\\n]*', ], 'CollaborationIdentifier' => [ 'type' => 'string', 'max' => 36, 'min' => 36, 'pattern' => '.*[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}.*', ], 'CollaborationName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '(?!\\\\s*$)[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDBFF-\\\\uDC00\\\\uDFFF\\\\t]*', ], 'CollaborationQueryLogStatus' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'DISABLED', ], ], 'CollaborationSummary' => [ 'type' => 'structure', 'required' => [ 'id', 'arn', 'name', 'creatorAccountId', 'creatorDisplayName', 'createTime', 'updateTime', 'memberStatus', ], 'members' => [ 'id' => [ 'shape' => 'UUID', ], 'arn' => [ 'shape' => 'CollaborationArn', ], 'name' => [ 'shape' => 'CollaborationName', ], 'creatorAccountId' => [ 'shape' => 'AccountId', ], 'creatorDisplayName' => [ 'shape' => 'DisplayName', ], 'createTime' => [ 'shape' => 'Timestamp', ], 'updateTime' => [ 'shape' => 'Timestamp', ], 'memberStatus' => [ 'shape' => 'MemberStatus', ], 'membershipId' => [ 'shape' => 'UUID', ], 'membershipArn' => [ 'shape' => 'MembershipArn', ], ], ], 'CollaborationSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'CollaborationSummary', ], ], 'Column' => [ 'type' => 'structure', 'required' => [ 'name', 'type', ], 'members' => [ 'name' => [ 'shape' => 'ColumnName', ], 'type' => [ 'shape' => 'ColumnTypeString', ], ], ], 'ColumnList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Column', ], ], 'ColumnName' => [ 'type' => 'string', 'max' => 128, 'min' => 0, 'pattern' => '[a-z0-9_](([a-z0-9_ ]+-)*([a-z0-9_ ]+))?', ], 'ColumnTypeString' => [ 'type' => 'string', 'max' => 255, 'min' => 0, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDBFF-\\\\uDC00\\\\uDFFF\\\\t]*', ], 'ConfiguredTable' => [ 'type' => 'structure', 'required' => [ 'id', 'arn', 'name', 'tableReference', 'createTime', 'updateTime', 'analysisRuleTypes', 'analysisMethod', 'allowedColumns', ], 'members' => [ 'id' => [ 'shape' => 'UUID', ], 'arn' => [ 'shape' => 'ConfiguredTableArn', ], 'name' => [ 'shape' => 'DisplayName', ], 'description' => [ 'shape' => 'TableDescription', ], 'tableReference' => [ 'shape' => 'TableReference', ], 'createTime' => [ 'shape' => 'Timestamp', ], 'updateTime' => [ 'shape' => 'Timestamp', ], 'analysisRuleTypes' => [ 'shape' => 'ConfiguredTableAnalysisRuleTypeList', ], 'analysisMethod' => [ 'shape' => 'AnalysisMethod', ], 'allowedColumns' => [ 'shape' => 'AllowedColumnList', ], ], ], 'ConfiguredTableAnalysisRule' => [ 'type' => 'structure', 'required' => [ 'configuredTableId', 'configuredTableArn', 'policy', 'type', 'createTime', 'updateTime', ], 'members' => [ 'configuredTableId' => [ 'shape' => 'UUID', ], 'configuredTableArn' => [ 'shape' => 'ConfiguredTableArn', ], 'policy' => [ 'shape' => 'ConfiguredTableAnalysisRulePolicy', ], 'type' => [ 'shape' => 'ConfiguredTableAnalysisRuleType', ], 'createTime' => [ 'shape' => 'Timestamp', ], 'updateTime' => [ 'shape' => 'Timestamp', ], ], ], 'ConfiguredTableAnalysisRulePolicy' => [ 'type' => 'structure', 'members' => [ 'v1' => [ 'shape' => 'ConfiguredTableAnalysisRulePolicyV1', ], ], 'union' => true, ], 'ConfiguredTableAnalysisRulePolicyV1' => [ 'type' => 'structure', 'members' => [ 'list' => [ 'shape' => 'AnalysisRuleList', ], 'aggregation' => [ 'shape' => 'AnalysisRuleAggregation', ], ], 'union' => true, ], 'ConfiguredTableAnalysisRuleType' => [ 'type' => 'string', 'enum' => [ 'AGGREGATION', 'LIST', ], ], 'ConfiguredTableAnalysisRuleTypeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConfiguredTableAnalysisRuleType', ], ], 'ConfiguredTableArn' => [ 'type' => 'string', 'max' => 100, 'min' => 0, 'pattern' => 'arn:aws:[\\\\w]+:[\\\\w]{2}-[\\\\w]{4,9}-[\\\\d]:[\\\\d]{12}:configuredTable/[\\\\d\\\\w-]+', ], 'ConfiguredTableAssociation' => [ 'type' => 'structure', 'required' => [ 'arn', 'id', 'configuredTableId', 'configuredTableArn', 'membershipId', 'membershipArn', 'roleArn', 'name', 'createTime', 'updateTime', ], 'members' => [ 'arn' => [ 'shape' => 'ConfiguredTableAssociationArn', ], 'id' => [ 'shape' => 'UUID', ], 'configuredTableId' => [ 'shape' => 'UUID', ], 'configuredTableArn' => [ 'shape' => 'ConfiguredTableArn', ], 'membershipId' => [ 'shape' => 'UUID', ], 'membershipArn' => [ 'shape' => 'MembershipArn', ], 'roleArn' => [ 'shape' => 'RoleArn', ], 'name' => [ 'shape' => 'TableAlias', ], 'description' => [ 'shape' => 'TableDescription', ], 'createTime' => [ 'shape' => 'Timestamp', ], 'updateTime' => [ 'shape' => 'Timestamp', ], ], ], 'ConfiguredTableAssociationArn' => [ 'type' => 'string', 'max' => 100, 'min' => 0, 'pattern' => 'arn:aws:[\\\\w]+:[\\\\w]{2}-[\\\\w]{4,9}-[\\\\d]:[\\\\d]{12}:configuredTableAssociation/[\\\\d\\\\w-]+/[\\\\d\\\\w-]+', ], 'ConfiguredTableAssociationIdentifier' => [ 'type' => 'string', 'max' => 36, 'min' => 36, 'pattern' => '.*[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}.*', ], 'ConfiguredTableAssociationSummary' => [ 'type' => 'structure', 'required' => [ 'configuredTableId', 'membershipId', 'membershipArn', 'name', 'createTime', 'updateTime', 'id', 'arn', ], 'members' => [ 'configuredTableId' => [ 'shape' => 'UUID', ], 'membershipId' => [ 'shape' => 'MembershipIdentifier', ], 'membershipArn' => [ 'shape' => 'MembershipArn', ], 'name' => [ 'shape' => 'TableAlias', ], 'createTime' => [ 'shape' => 'Timestamp', ], 'updateTime' => [ 'shape' => 'Timestamp', ], 'id' => [ 'shape' => 'UUID', ], 'arn' => [ 'shape' => 'ConfiguredTableAssociationArn', ], ], ], 'ConfiguredTableAssociationSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConfiguredTableAssociationSummary', ], ], 'ConfiguredTableIdentifier' => [ 'type' => 'string', 'max' => 36, 'min' => 36, 'pattern' => '.*[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}.*', ], 'ConfiguredTableSummary' => [ 'type' => 'structure', 'required' => [ 'id', 'arn', 'name', 'createTime', 'updateTime', 'analysisRuleTypes', 'analysisMethod', ], 'members' => [ 'id' => [ 'shape' => 'ConfiguredTableIdentifier', ], 'arn' => [ 'shape' => 'ConfiguredTableArn', ], 'name' => [ 'shape' => 'DisplayName', ], 'createTime' => [ 'shape' => 'Timestamp', ], 'updateTime' => [ 'shape' => 'Timestamp', ], 'analysisRuleTypes' => [ 'shape' => 'ConfiguredTableAnalysisRuleTypeList', ], 'analysisMethod' => [ 'shape' => 'AnalysisMethod', ], ], ], 'ConfiguredTableSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ConfiguredTableSummary', ], ], 'ConflictException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], 'resourceId' => [ 'shape' => 'String', ], 'resourceType' => [ 'shape' => 'ResourceType', ], 'reason' => [ 'shape' => 'ConflictExceptionReason', ], ], 'error' => [ 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'ConflictExceptionReason' => [ 'type' => 'string', 'enum' => [ 'ALREADY_EXISTS', 'SUBRESOURCES_EXIST', 'INVALID_STATE', ], ], 'CreateCollaborationInput' => [ 'type' => 'structure', 'required' => [ 'members', 'name', 'description', 'creatorMemberAbilities', 'creatorDisplayName', 'queryLogStatus', ], 'members' => [ 'members' => [ 'shape' => 'MemberList', ], 'name' => [ 'shape' => 'CollaborationName', ], 'description' => [ 'shape' => 'CollaborationDescription', ], 'creatorMemberAbilities' => [ 'shape' => 'MemberAbilities', ], 'creatorDisplayName' => [ 'shape' => 'DisplayName', ], 'dataEncryptionMetadata' => [ 'shape' => 'DataEncryptionMetadata', ], 'queryLogStatus' => [ 'shape' => 'CollaborationQueryLogStatus', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'CreateCollaborationOutput' => [ 'type' => 'structure', 'required' => [ 'collaboration', ], 'members' => [ 'collaboration' => [ 'shape' => 'Collaboration', ], ], ], 'CreateConfiguredTableAnalysisRuleInput' => [ 'type' => 'structure', 'required' => [ 'configuredTableIdentifier', 'analysisRuleType', 'analysisRulePolicy', ], 'members' => [ 'configuredTableIdentifier' => [ 'shape' => 'ConfiguredTableIdentifier', 'location' => 'uri', 'locationName' => 'configuredTableIdentifier', ], 'analysisRuleType' => [ 'shape' => 'ConfiguredTableAnalysisRuleType', ], 'analysisRulePolicy' => [ 'shape' => 'ConfiguredTableAnalysisRulePolicy', ], ], ], 'CreateConfiguredTableAnalysisRuleOutput' => [ 'type' => 'structure', 'required' => [ 'analysisRule', ], 'members' => [ 'analysisRule' => [ 'shape' => 'ConfiguredTableAnalysisRule', ], ], ], 'CreateConfiguredTableAssociationInput' => [ 'type' => 'structure', 'required' => [ 'name', 'membershipIdentifier', 'configuredTableIdentifier', 'roleArn', ], 'members' => [ 'name' => [ 'shape' => 'TableAlias', ], 'description' => [ 'shape' => 'TableDescription', ], 'membershipIdentifier' => [ 'shape' => 'MembershipIdentifier', 'location' => 'uri', 'locationName' => 'membershipIdentifier', ], 'configuredTableIdentifier' => [ 'shape' => 'ConfiguredTableIdentifier', ], 'roleArn' => [ 'shape' => 'RoleArn', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'CreateConfiguredTableAssociationOutput' => [ 'type' => 'structure', 'required' => [ 'configuredTableAssociation', ], 'members' => [ 'configuredTableAssociation' => [ 'shape' => 'ConfiguredTableAssociation', ], ], ], 'CreateConfiguredTableInput' => [ 'type' => 'structure', 'required' => [ 'name', 'tableReference', 'allowedColumns', 'analysisMethod', ], 'members' => [ 'name' => [ 'shape' => 'DisplayName', ], 'description' => [ 'shape' => 'TableDescription', ], 'tableReference' => [ 'shape' => 'TableReference', ], 'allowedColumns' => [ 'shape' => 'AllowedColumnList', ], 'analysisMethod' => [ 'shape' => 'AnalysisMethod', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'CreateConfiguredTableOutput' => [ 'type' => 'structure', 'required' => [ 'configuredTable', ], 'members' => [ 'configuredTable' => [ 'shape' => 'ConfiguredTable', ], ], ], 'CreateMembershipInput' => [ 'type' => 'structure', 'required' => [ 'collaborationIdentifier', 'queryLogStatus', ], 'members' => [ 'collaborationIdentifier' => [ 'shape' => 'CollaborationIdentifier', ], 'queryLogStatus' => [ 'shape' => 'MembershipQueryLogStatus', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'CreateMembershipOutput' => [ 'type' => 'structure', 'required' => [ 'membership', ], 'members' => [ 'membership' => [ 'shape' => 'Membership', ], ], ], 'DataEncryptionMetadata' => [ 'type' => 'structure', 'required' => [ 'allowCleartext', 'allowDuplicates', 'allowJoinsOnColumnsWithDifferentNames', 'preserveNulls', ], 'members' => [ 'allowCleartext' => [ 'shape' => 'Boolean', ], 'allowDuplicates' => [ 'shape' => 'Boolean', ], 'allowJoinsOnColumnsWithDifferentNames' => [ 'shape' => 'Boolean', ], 'preserveNulls' => [ 'shape' => 'Boolean', ], ], ], 'DeleteCollaborationInput' => [ 'type' => 'structure', 'required' => [ 'collaborationIdentifier', ], 'members' => [ 'collaborationIdentifier' => [ 'shape' => 'CollaborationIdentifier', 'location' => 'uri', 'locationName' => 'collaborationIdentifier', ], ], ], 'DeleteCollaborationOutput' => [ 'type' => 'structure', 'members' => [], ], 'DeleteConfiguredTableAnalysisRuleInput' => [ 'type' => 'structure', 'required' => [ 'configuredTableIdentifier', 'analysisRuleType', ], 'members' => [ 'configuredTableIdentifier' => [ 'shape' => 'ConfiguredTableIdentifier', 'location' => 'uri', 'locationName' => 'configuredTableIdentifier', ], 'analysisRuleType' => [ 'shape' => 'ConfiguredTableAnalysisRuleType', 'location' => 'uri', 'locationName' => 'analysisRuleType', ], ], ], 'DeleteConfiguredTableAnalysisRuleOutput' => [ 'type' => 'structure', 'members' => [], ], 'DeleteConfiguredTableAssociationInput' => [ 'type' => 'structure', 'required' => [ 'configuredTableAssociationIdentifier', 'membershipIdentifier', ], 'members' => [ 'configuredTableAssociationIdentifier' => [ 'shape' => 'ConfiguredTableAssociationIdentifier', 'location' => 'uri', 'locationName' => 'configuredTableAssociationIdentifier', ], 'membershipIdentifier' => [ 'shape' => 'MembershipIdentifier', 'location' => 'uri', 'locationName' => 'membershipIdentifier', ], ], ], 'DeleteConfiguredTableAssociationOutput' => [ 'type' => 'structure', 'members' => [], ], 'DeleteConfiguredTableInput' => [ 'type' => 'structure', 'required' => [ 'configuredTableIdentifier', ], 'members' => [ 'configuredTableIdentifier' => [ 'shape' => 'ConfiguredTableIdentifier', 'location' => 'uri', 'locationName' => 'configuredTableIdentifier', ], ], ], 'DeleteConfiguredTableOutput' => [ 'type' => 'structure', 'members' => [], ], 'DeleteMemberInput' => [ 'type' => 'structure', 'required' => [ 'collaborationIdentifier', 'accountId', ], 'members' => [ 'collaborationIdentifier' => [ 'shape' => 'CollaborationIdentifier', 'location' => 'uri', 'locationName' => 'collaborationIdentifier', ], 'accountId' => [ 'shape' => 'AccountId', 'location' => 'uri', 'locationName' => 'accountId', ], ], ], 'DeleteMemberOutput' => [ 'type' => 'structure', 'members' => [], ], 'DeleteMembershipInput' => [ 'type' => 'structure', 'required' => [ 'membershipIdentifier', ], 'members' => [ 'membershipIdentifier' => [ 'shape' => 'MembershipIdentifier', 'location' => 'uri', 'locationName' => 'membershipIdentifier', ], ], ], 'DeleteMembershipOutput' => [ 'type' => 'structure', 'members' => [], ], 'DisplayName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '(?!\\\\s*$)[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDBFF-\\\\uDC00\\\\uDFFF\\\\t]*', ], 'Double' => [ 'type' => 'double', 'box' => true, ], 'FilterableMemberStatus' => [ 'type' => 'string', 'enum' => [ 'INVITED', 'ACTIVE', ], ], 'GetCollaborationInput' => [ 'type' => 'structure', 'required' => [ 'collaborationIdentifier', ], 'members' => [ 'collaborationIdentifier' => [ 'shape' => 'CollaborationIdentifier', 'location' => 'uri', 'locationName' => 'collaborationIdentifier', ], ], ], 'GetCollaborationOutput' => [ 'type' => 'structure', 'required' => [ 'collaboration', ], 'members' => [ 'collaboration' => [ 'shape' => 'Collaboration', ], ], ], 'GetConfiguredTableAnalysisRuleInput' => [ 'type' => 'structure', 'required' => [ 'configuredTableIdentifier', 'analysisRuleType', ], 'members' => [ 'configuredTableIdentifier' => [ 'shape' => 'ConfiguredTableIdentifier', 'location' => 'uri', 'locationName' => 'configuredTableIdentifier', ], 'analysisRuleType' => [ 'shape' => 'ConfiguredTableAnalysisRuleType', 'location' => 'uri', 'locationName' => 'analysisRuleType', ], ], ], 'GetConfiguredTableAnalysisRuleOutput' => [ 'type' => 'structure', 'required' => [ 'analysisRule', ], 'members' => [ 'analysisRule' => [ 'shape' => 'ConfiguredTableAnalysisRule', ], ], ], 'GetConfiguredTableAssociationInput' => [ 'type' => 'structure', 'required' => [ 'configuredTableAssociationIdentifier', 'membershipIdentifier', ], 'members' => [ 'configuredTableAssociationIdentifier' => [ 'shape' => 'ConfiguredTableAssociationIdentifier', 'location' => 'uri', 'locationName' => 'configuredTableAssociationIdentifier', ], 'membershipIdentifier' => [ 'shape' => 'MembershipIdentifier', 'location' => 'uri', 'locationName' => 'membershipIdentifier', ], ], ], 'GetConfiguredTableAssociationOutput' => [ 'type' => 'structure', 'required' => [ 'configuredTableAssociation', ], 'members' => [ 'configuredTableAssociation' => [ 'shape' => 'ConfiguredTableAssociation', ], ], ], 'GetConfiguredTableInput' => [ 'type' => 'structure', 'required' => [ 'configuredTableIdentifier', ], 'members' => [ 'configuredTableIdentifier' => [ 'shape' => 'ConfiguredTableIdentifier', 'location' => 'uri', 'locationName' => 'configuredTableIdentifier', ], ], ], 'GetConfiguredTableOutput' => [ 'type' => 'structure', 'required' => [ 'configuredTable', ], 'members' => [ 'configuredTable' => [ 'shape' => 'ConfiguredTable', ], ], ], 'GetMembershipInput' => [ 'type' => 'structure', 'required' => [ 'membershipIdentifier', ], 'members' => [ 'membershipIdentifier' => [ 'shape' => 'MembershipIdentifier', 'location' => 'uri', 'locationName' => 'membershipIdentifier', ], ], ], 'GetMembershipOutput' => [ 'type' => 'structure', 'required' => [ 'membership', ], 'members' => [ 'membership' => [ 'shape' => 'Membership', ], ], ], 'GetProtectedQueryInput' => [ 'type' => 'structure', 'required' => [ 'membershipIdentifier', 'protectedQueryIdentifier', ], 'members' => [ 'membershipIdentifier' => [ 'shape' => 'MembershipIdentifier', 'location' => 'uri', 'locationName' => 'membershipIdentifier', ], 'protectedQueryIdentifier' => [ 'shape' => 'ProtectedQueryIdentifier', 'location' => 'uri', 'locationName' => 'protectedQueryIdentifier', ], ], ], 'GetProtectedQueryOutput' => [ 'type' => 'structure', 'required' => [ 'protectedQuery', ], 'members' => [ 'protectedQuery' => [ 'shape' => 'ProtectedQuery', ], ], ], 'GetSchemaAnalysisRuleInput' => [ 'type' => 'structure', 'required' => [ 'collaborationIdentifier', 'name', 'type', ], 'members' => [ 'collaborationIdentifier' => [ 'shape' => 'CollaborationIdentifier', 'location' => 'uri', 'locationName' => 'collaborationIdentifier', ], 'name' => [ 'shape' => 'TableAlias', 'location' => 'uri', 'locationName' => 'name', ], 'type' => [ 'shape' => 'AnalysisRuleType', 'location' => 'uri', 'locationName' => 'type', ], ], ], 'GetSchemaAnalysisRuleOutput' => [ 'type' => 'structure', 'required' => [ 'analysisRule', ], 'members' => [ 'analysisRule' => [ 'shape' => 'AnalysisRule', ], ], ], 'GetSchemaInput' => [ 'type' => 'structure', 'required' => [ 'collaborationIdentifier', 'name', ], 'members' => [ 'collaborationIdentifier' => [ 'shape' => 'CollaborationIdentifier', 'location' => 'uri', 'locationName' => 'collaborationIdentifier', ], 'name' => [ 'shape' => 'TableAlias', 'location' => 'uri', 'locationName' => 'name', ], ], ], 'GetSchemaOutput' => [ 'type' => 'structure', 'required' => [ 'schema', ], 'members' => [ 'schema' => [ 'shape' => 'Schema', ], ], ], 'GlueDatabaseName' => [ 'type' => 'string', 'max' => 128, 'min' => 0, 'pattern' => '[a-zA-Z0-9_](([a-zA-Z0-9_]+-)*([a-zA-Z0-9_]+))?', ], 'GlueTableName' => [ 'type' => 'string', 'max' => 128, 'min' => 0, 'pattern' => '[a-zA-Z0-9_](([a-zA-Z0-9_ ]+-)*([a-zA-Z0-9_ ]+))?', ], 'GlueTableReference' => [ 'type' => 'structure', 'required' => [ 'tableName', 'databaseName', ], 'members' => [ 'tableName' => [ 'shape' => 'GlueTableName', ], 'databaseName' => [ 'shape' => 'GlueDatabaseName', ], ], ], 'InternalServerException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'JoinOperator' => [ 'type' => 'string', 'enum' => [ 'OR', 'AND', ], ], 'JoinOperatorsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'JoinOperator', ], 'max' => 2, 'min' => 0, ], 'JoinRequiredOption' => [ 'type' => 'string', 'enum' => [ 'QUERY_RUNNER', ], ], 'KeyPrefix' => [ 'type' => 'string', 'pattern' => '[\\\\w!.*/-]*', ], 'ListCollaborationsInput' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'memberStatus' => [ 'shape' => 'FilterableMemberStatus', 'location' => 'querystring', 'locationName' => 'memberStatus', ], ], ], 'ListCollaborationsOutput' => [ 'type' => 'structure', 'required' => [ 'collaborationList', ], 'members' => [ 'nextToken' => [ 'shape' => 'PaginationToken', ], 'collaborationList' => [ 'shape' => 'CollaborationSummaryList', ], ], ], 'ListConfiguredTableAssociationsInput' => [ 'type' => 'structure', 'required' => [ 'membershipIdentifier', ], 'members' => [ 'membershipIdentifier' => [ 'shape' => 'MembershipIdentifier', 'location' => 'uri', 'locationName' => 'membershipIdentifier', ], 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListConfiguredTableAssociationsOutput' => [ 'type' => 'structure', 'required' => [ 'configuredTableAssociationSummaries', ], 'members' => [ 'configuredTableAssociationSummaries' => [ 'shape' => 'ConfiguredTableAssociationSummaryList', ], 'nextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListConfiguredTablesInput' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListConfiguredTablesOutput' => [ 'type' => 'structure', 'required' => [ 'configuredTableSummaries', ], 'members' => [ 'configuredTableSummaries' => [ 'shape' => 'ConfiguredTableSummaryList', ], 'nextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListMembersInput' => [ 'type' => 'structure', 'required' => [ 'collaborationIdentifier', ], 'members' => [ 'collaborationIdentifier' => [ 'shape' => 'CollaborationIdentifier', 'location' => 'uri', 'locationName' => 'collaborationIdentifier', ], 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListMembersOutput' => [ 'type' => 'structure', 'required' => [ 'memberSummaries', ], 'members' => [ 'nextToken' => [ 'shape' => 'PaginationToken', ], 'memberSummaries' => [ 'shape' => 'MemberSummaryList', ], ], ], 'ListMembershipsInput' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'status' => [ 'shape' => 'MembershipStatus', 'location' => 'querystring', 'locationName' => 'status', ], ], ], 'ListMembershipsOutput' => [ 'type' => 'structure', 'required' => [ 'membershipSummaries', ], 'members' => [ 'nextToken' => [ 'shape' => 'PaginationToken', ], 'membershipSummaries' => [ 'shape' => 'MembershipSummaryList', ], ], ], 'ListProtectedQueriesInput' => [ 'type' => 'structure', 'required' => [ 'membershipIdentifier', ], 'members' => [ 'membershipIdentifier' => [ 'shape' => 'MembershipIdentifier', 'location' => 'uri', 'locationName' => 'membershipIdentifier', ], 'status' => [ 'shape' => 'ProtectedQueryStatus', 'location' => 'querystring', 'locationName' => 'status', ], 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListProtectedQueriesOutput' => [ 'type' => 'structure', 'required' => [ 'protectedQueries', ], 'members' => [ 'nextToken' => [ 'shape' => 'PaginationToken', ], 'protectedQueries' => [ 'shape' => 'ProtectedQuerySummaryList', ], ], ], 'ListSchemasInput' => [ 'type' => 'structure', 'required' => [ 'collaborationIdentifier', ], 'members' => [ 'collaborationIdentifier' => [ 'shape' => 'CollaborationIdentifier', 'location' => 'uri', 'locationName' => 'collaborationIdentifier', ], 'schemaType' => [ 'shape' => 'SchemaType', 'location' => 'querystring', 'locationName' => 'schemaType', ], 'nextToken' => [ 'shape' => 'PaginationToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], ], ], 'ListSchemasOutput' => [ 'type' => 'structure', 'required' => [ 'schemaSummaries', ], 'members' => [ 'schemaSummaries' => [ 'shape' => 'SchemaSummaryList', ], 'nextToken' => [ 'shape' => 'PaginationToken', ], ], ], 'ListTagsForResourceInput' => [ 'type' => 'structure', 'required' => [ 'resourceArn', ], 'members' => [ 'resourceArn' => [ 'shape' => 'CleanroomsArn', 'location' => 'uri', 'locationName' => 'resourceArn', ], ], ], 'ListTagsForResourceOutput' => [ 'type' => 'structure', 'required' => [ 'tags', ], 'members' => [ 'tags' => [ 'shape' => 'TagMap', ], ], ], 'Long' => [ 'type' => 'long', 'box' => true, ], 'MaxResults' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'MemberAbilities' => [ 'type' => 'list', 'member' => [ 'shape' => 'MemberAbility', ], ], 'MemberAbility' => [ 'type' => 'string', 'enum' => [ 'CAN_QUERY', 'CAN_RECEIVE_RESULTS', ], ], 'MemberList' => [ 'type' => 'list', 'member' => [ 'shape' => 'MemberSpecification', ], 'max' => 9, 'min' => 0, ], 'MemberSpecification' => [ 'type' => 'structure', 'required' => [ 'accountId', 'memberAbilities', 'displayName', ], 'members' => [ 'accountId' => [ 'shape' => 'AccountId', ], 'memberAbilities' => [ 'shape' => 'MemberAbilities', ], 'displayName' => [ 'shape' => 'DisplayName', ], ], ], 'MemberStatus' => [ 'type' => 'string', 'enum' => [ 'INVITED', 'ACTIVE', 'LEFT', 'REMOVED', ], ], 'MemberSummary' => [ 'type' => 'structure', 'required' => [ 'accountId', 'status', 'displayName', 'abilities', 'createTime', 'updateTime', ], 'members' => [ 'accountId' => [ 'shape' => 'AccountId', ], 'status' => [ 'shape' => 'MemberStatus', ], 'displayName' => [ 'shape' => 'DisplayName', ], 'abilities' => [ 'shape' => 'MemberAbilities', ], 'createTime' => [ 'shape' => 'Timestamp', ], 'updateTime' => [ 'shape' => 'Timestamp', ], 'membershipId' => [ 'shape' => 'UUID', ], 'membershipArn' => [ 'shape' => 'MembershipArn', ], ], ], 'MemberSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'MemberSummary', ], ], 'Membership' => [ 'type' => 'structure', 'required' => [ 'id', 'arn', 'collaborationArn', 'collaborationId', 'collaborationCreatorAccountId', 'collaborationCreatorDisplayName', 'collaborationName', 'createTime', 'updateTime', 'status', 'memberAbilities', 'queryLogStatus', ], 'members' => [ 'id' => [ 'shape' => 'UUID', ], 'arn' => [ 'shape' => 'MembershipArn', ], 'collaborationArn' => [ 'shape' => 'CollaborationArn', ], 'collaborationId' => [ 'shape' => 'UUID', ], 'collaborationCreatorAccountId' => [ 'shape' => 'AccountId', ], 'collaborationCreatorDisplayName' => [ 'shape' => 'DisplayName', ], 'collaborationName' => [ 'shape' => 'CollaborationName', ], 'createTime' => [ 'shape' => 'Timestamp', ], 'updateTime' => [ 'shape' => 'Timestamp', ], 'status' => [ 'shape' => 'MembershipStatus', ], 'memberAbilities' => [ 'shape' => 'MemberAbilities', ], 'queryLogStatus' => [ 'shape' => 'MembershipQueryLogStatus', ], ], ], 'MembershipArn' => [ 'type' => 'string', 'max' => 100, 'min' => 0, 'pattern' => 'arn:aws:[\\\\w]+:[\\\\w]{2}-[\\\\w]{4,9}-[\\\\d]:[\\\\d]{12}:membership/[\\\\d\\\\w-]+', ], 'MembershipIdentifier' => [ 'type' => 'string', 'max' => 36, 'min' => 36, 'pattern' => '.*[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}.*', ], 'MembershipQueryLogStatus' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'DISABLED', ], ], 'MembershipStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'REMOVED', 'COLLABORATION_DELETED', ], ], 'MembershipSummary' => [ 'type' => 'structure', 'required' => [ 'id', 'arn', 'collaborationArn', 'collaborationId', 'collaborationCreatorAccountId', 'collaborationCreatorDisplayName', 'collaborationName', 'createTime', 'updateTime', 'status', 'memberAbilities', ], 'members' => [ 'id' => [ 'shape' => 'UUID', ], 'arn' => [ 'shape' => 'MembershipArn', ], 'collaborationArn' => [ 'shape' => 'CollaborationArn', ], 'collaborationId' => [ 'shape' => 'CollaborationIdentifier', ], 'collaborationCreatorAccountId' => [ 'shape' => 'AccountId', ], 'collaborationCreatorDisplayName' => [ 'shape' => 'DisplayName', ], 'collaborationName' => [ 'shape' => 'CollaborationName', ], 'createTime' => [ 'shape' => 'Timestamp', ], 'updateTime' => [ 'shape' => 'Timestamp', ], 'status' => [ 'shape' => 'MembershipStatus', ], 'memberAbilities' => [ 'shape' => 'MemberAbilities', ], ], ], 'MembershipSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'MembershipSummary', ], ], 'PaginationToken' => [ 'type' => 'string', 'max' => 10240, 'min' => 0, ], 'ProtectedQuery' => [ 'type' => 'structure', 'required' => [ 'id', 'membershipId', 'membershipArn', 'createTime', 'sqlParameters', 'status', 'resultConfiguration', ], 'members' => [ 'id' => [ 'shape' => 'UUID', ], 'membershipId' => [ 'shape' => 'UUID', ], 'membershipArn' => [ 'shape' => 'MembershipArn', ], 'createTime' => [ 'shape' => 'Timestamp', ], 'sqlParameters' => [ 'shape' => 'ProtectedQuerySQLParameters', ], 'status' => [ 'shape' => 'ProtectedQueryStatus', ], 'resultConfiguration' => [ 'shape' => 'ProtectedQueryResultConfiguration', ], 'statistics' => [ 'shape' => 'ProtectedQueryStatistics', ], 'result' => [ 'shape' => 'ProtectedQueryResult', ], 'error' => [ 'shape' => 'ProtectedQueryError', ], ], ], 'ProtectedQueryError' => [ 'type' => 'structure', 'required' => [ 'message', 'code', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'code' => [ 'shape' => 'String', ], ], ], 'ProtectedQueryIdentifier' => [ 'type' => 'string', 'max' => 36, 'min' => 1, 'pattern' => '.*[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}.*', ], 'ProtectedQueryOutput' => [ 'type' => 'structure', 'members' => [ 's3' => [ 'shape' => 'ProtectedQueryS3Output', ], ], 'union' => true, ], 'ProtectedQueryOutputConfiguration' => [ 'type' => 'structure', 'members' => [ 's3' => [ 'shape' => 'ProtectedQueryS3OutputConfiguration', ], ], 'union' => true, ], 'ProtectedQueryResult' => [ 'type' => 'structure', 'required' => [ 'output', ], 'members' => [ 'output' => [ 'shape' => 'ProtectedQueryOutput', ], ], ], 'ProtectedQueryResultConfiguration' => [ 'type' => 'structure', 'required' => [ 'outputConfiguration', ], 'members' => [ 'outputConfiguration' => [ 'shape' => 'ProtectedQueryOutputConfiguration', ], ], ], 'ProtectedQueryS3Output' => [ 'type' => 'structure', 'required' => [ 'location', ], 'members' => [ 'location' => [ 'shape' => 'String', ], ], ], 'ProtectedQueryS3OutputConfiguration' => [ 'type' => 'structure', 'required' => [ 'resultFormat', 'bucket', ], 'members' => [ 'resultFormat' => [ 'shape' => 'ResultFormat', ], 'bucket' => [ 'shape' => 'ProtectedQueryS3OutputConfigurationBucketString', ], 'keyPrefix' => [ 'shape' => 'KeyPrefix', ], ], ], 'ProtectedQueryS3OutputConfigurationBucketString' => [ 'type' => 'string', 'max' => 63, 'min' => 3, 'pattern' => '.*(?!^(\\\\d+\\\\.)+\\\\d+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\\\-]*[a-z0-9])\\\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\\\-]*[a-z0-9])$).*', ], 'ProtectedQuerySQLParameters' => [ 'type' => 'structure', 'members' => [ 'queryString' => [ 'shape' => 'ProtectedQuerySQLParametersQueryStringString', ], ], 'sensitive' => true, ], 'ProtectedQuerySQLParametersQueryStringString' => [ 'type' => 'string', 'max' => 15000, 'min' => 0, ], 'ProtectedQueryStatistics' => [ 'type' => 'structure', 'members' => [ 'totalDurationInMillis' => [ 'shape' => 'Long', ], ], ], 'ProtectedQueryStatus' => [ 'type' => 'string', 'enum' => [ 'SUBMITTED', 'STARTED', 'CANCELLED', 'CANCELLING', 'FAILED', 'SUCCESS', 'TIMED_OUT', ], ], 'ProtectedQuerySummary' => [ 'type' => 'structure', 'required' => [ 'id', 'membershipId', 'membershipArn', 'createTime', 'status', ], 'members' => [ 'id' => [ 'shape' => 'UUID', ], 'membershipId' => [ 'shape' => 'UUID', ], 'membershipArn' => [ 'shape' => 'MembershipArn', ], 'createTime' => [ 'shape' => 'Timestamp', ], 'status' => [ 'shape' => 'ProtectedQueryStatus', ], ], ], 'ProtectedQuerySummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ProtectedQuerySummary', ], ], 'ProtectedQueryType' => [ 'type' => 'string', 'enum' => [ 'SQL', ], ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'required' => [ 'message', 'resourceId', 'resourceType', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'resourceId' => [ 'shape' => 'String', ], 'resourceType' => [ 'shape' => 'ResourceType', ], ], 'error' => [ 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'ResourceType' => [ 'type' => 'string', 'enum' => [ 'CONFIGURED_TABLE', 'COLLABORATION', 'MEMBERSHIP', 'CONFIGURED_TABLE_ASSOCIATION', ], ], 'ResultFormat' => [ 'type' => 'string', 'enum' => [ 'CSV', 'PARQUET', ], ], 'RoleArn' => [ 'type' => 'string', 'max' => 512, 'min' => 32, 'pattern' => 'arn:aws:iam::[\\\\w]+:role/[\\\\w+=,./@-]+', ], 'ScalarFunctions' => [ 'type' => 'string', 'enum' => [ 'TRUNC', 'ABS', 'CEILING', 'FLOOR', 'LN', 'LOG', 'ROUND', 'SQRT', 'CAST', 'LOWER', 'RTRIM', 'UPPER', 'COALESCE', ], ], 'ScalarFunctionsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ScalarFunctions', ], ], 'Schema' => [ 'type' => 'structure', 'required' => [ 'columns', 'partitionKeys', 'analysisRuleTypes', 'creatorAccountId', 'name', 'collaborationId', 'collaborationArn', 'description', 'createTime', 'updateTime', 'type', ], 'members' => [ 'columns' => [ 'shape' => 'ColumnList', ], 'partitionKeys' => [ 'shape' => 'ColumnList', ], 'analysisRuleTypes' => [ 'shape' => 'AnalysisRuleTypeList', ], 'analysisMethod' => [ 'shape' => 'AnalysisMethod', ], 'creatorAccountId' => [ 'shape' => 'AccountId', ], 'name' => [ 'shape' => 'TableAlias', ], 'collaborationId' => [ 'shape' => 'UUID', ], 'collaborationArn' => [ 'shape' => 'CollaborationArn', ], 'description' => [ 'shape' => 'TableDescription', ], 'createTime' => [ 'shape' => 'Timestamp', ], 'updateTime' => [ 'shape' => 'Timestamp', ], 'type' => [ 'shape' => 'SchemaType', ], ], ], 'SchemaList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Schema', ], 'max' => 25, 'min' => 0, ], 'SchemaSummary' => [ 'type' => 'structure', 'required' => [ 'name', 'type', 'creatorAccountId', 'createTime', 'updateTime', 'collaborationId', 'collaborationArn', 'analysisRuleTypes', ], 'members' => [ 'name' => [ 'shape' => 'TableAlias', ], 'type' => [ 'shape' => 'SchemaType', ], 'creatorAccountId' => [ 'shape' => 'AccountId', ], 'createTime' => [ 'shape' => 'Timestamp', ], 'updateTime' => [ 'shape' => 'Timestamp', ], 'collaborationId' => [ 'shape' => 'UUID', ], 'collaborationArn' => [ 'shape' => 'CollaborationArn', ], 'analysisRuleTypes' => [ 'shape' => 'AnalysisRuleTypeList', ], 'analysisMethod' => [ 'shape' => 'AnalysisMethod', ], ], ], 'SchemaSummaryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SchemaSummary', ], ], 'SchemaType' => [ 'type' => 'string', 'enum' => [ 'TABLE', ], ], 'ServiceQuotaExceededException' => [ 'type' => 'structure', 'required' => [ 'message', 'quotaName', 'quotaValue', ], 'members' => [ 'message' => [ 'shape' => 'String', ], 'quotaName' => [ 'shape' => 'String', ], 'quotaValue' => [ 'shape' => 'Double', ], ], 'error' => [ 'httpStatusCode' => 402, 'senderFault' => true, ], 'exception' => true, ], 'StartProtectedQueryInput' => [ 'type' => 'structure', 'required' => [ 'type', 'membershipIdentifier', 'sqlParameters', 'resultConfiguration', ], 'members' => [ 'type' => [ 'shape' => 'ProtectedQueryType', ], 'membershipIdentifier' => [ 'shape' => 'MembershipIdentifier', 'location' => 'uri', 'locationName' => 'membershipIdentifier', ], 'sqlParameters' => [ 'shape' => 'ProtectedQuerySQLParameters', ], 'resultConfiguration' => [ 'shape' => 'ProtectedQueryResultConfiguration', ], ], ], 'StartProtectedQueryOutput' => [ 'type' => 'structure', 'required' => [ 'protectedQuery', ], 'members' => [ 'protectedQuery' => [ 'shape' => 'ProtectedQuery', ], ], ], 'String' => [ 'type' => 'string', ], 'TableAlias' => [ 'type' => 'string', 'max' => 128, 'min' => 0, 'pattern' => '[a-zA-Z0-9_](([a-zA-Z0-9_ ]+-)*([a-zA-Z0-9_ ]+))?', ], 'TableAliasList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TableAlias', ], 'max' => 25, 'min' => 1, ], 'TableDescription' => [ 'type' => 'string', 'max' => 255, 'min' => 0, 'pattern' => '[\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\uD800\\\\uDBFF-\\\\uDC00\\\\uDFFF\\\\t\\\\r\\\\n]*', ], 'TableReference' => [ 'type' => 'structure', 'members' => [ 'glue' => [ 'shape' => 'GlueTableReference', ], ], 'union' => true, ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'TagKeys' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], ], 'TagMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'TagKey', ], 'value' => [ 'shape' => 'TagValue', ], 'max' => 200, 'min' => 0, ], 'TagResourceInput' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tags', ], 'members' => [ 'resourceArn' => [ 'shape' => 'CleanroomsArn', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tags' => [ 'shape' => 'TagMap', ], ], ], 'TagResourceOutput' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, ], 'TargetProtectedQueryStatus' => [ 'type' => 'string', 'enum' => [ 'CANCELLED', ], ], 'ThrottlingException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], ], 'error' => [ 'httpStatusCode' => 429, 'senderFault' => true, ], 'exception' => true, ], 'Timestamp' => [ 'type' => 'timestamp', ], 'UUID' => [ 'type' => 'string', 'max' => 36, 'min' => 36, 'pattern' => '.*[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}.*', ], 'UntagResourceInput' => [ 'type' => 'structure', 'required' => [ 'resourceArn', 'tagKeys', ], 'members' => [ 'resourceArn' => [ 'shape' => 'CleanroomsArn', 'location' => 'uri', 'locationName' => 'resourceArn', ], 'tagKeys' => [ 'shape' => 'TagKeys', 'location' => 'querystring', 'locationName' => 'tagKeys', ], ], ], 'UntagResourceOutput' => [ 'type' => 'structure', 'members' => [], ], 'UpdateCollaborationInput' => [ 'type' => 'structure', 'required' => [ 'collaborationIdentifier', ], 'members' => [ 'collaborationIdentifier' => [ 'shape' => 'CollaborationIdentifier', 'location' => 'uri', 'locationName' => 'collaborationIdentifier', ], 'name' => [ 'shape' => 'CollaborationName', ], 'description' => [ 'shape' => 'CollaborationDescription', ], ], ], 'UpdateCollaborationOutput' => [ 'type' => 'structure', 'required' => [ 'collaboration', ], 'members' => [ 'collaboration' => [ 'shape' => 'Collaboration', ], ], ], 'UpdateConfiguredTableAnalysisRuleInput' => [ 'type' => 'structure', 'required' => [ 'configuredTableIdentifier', 'analysisRuleType', 'analysisRulePolicy', ], 'members' => [ 'configuredTableIdentifier' => [ 'shape' => 'ConfiguredTableIdentifier', 'location' => 'uri', 'locationName' => 'configuredTableIdentifier', ], 'analysisRuleType' => [ 'shape' => 'ConfiguredTableAnalysisRuleType', 'location' => 'uri', 'locationName' => 'analysisRuleType', ], 'analysisRulePolicy' => [ 'shape' => 'ConfiguredTableAnalysisRulePolicy', ], ], ], 'UpdateConfiguredTableAnalysisRuleOutput' => [ 'type' => 'structure', 'required' => [ 'analysisRule', ], 'members' => [ 'analysisRule' => [ 'shape' => 'ConfiguredTableAnalysisRule', ], ], ], 'UpdateConfiguredTableAssociationInput' => [ 'type' => 'structure', 'required' => [ 'configuredTableAssociationIdentifier', 'membershipIdentifier', ], 'members' => [ 'configuredTableAssociationIdentifier' => [ 'shape' => 'ConfiguredTableAssociationIdentifier', 'location' => 'uri', 'locationName' => 'configuredTableAssociationIdentifier', ], 'membershipIdentifier' => [ 'shape' => 'MembershipIdentifier', 'location' => 'uri', 'locationName' => 'membershipIdentifier', ], 'description' => [ 'shape' => 'TableDescription', ], 'roleArn' => [ 'shape' => 'RoleArn', ], ], ], 'UpdateConfiguredTableAssociationOutput' => [ 'type' => 'structure', 'required' => [ 'configuredTableAssociation', ], 'members' => [ 'configuredTableAssociation' => [ 'shape' => 'ConfiguredTableAssociation', ], ], ], 'UpdateConfiguredTableInput' => [ 'type' => 'structure', 'required' => [ 'configuredTableIdentifier', ], 'members' => [ 'configuredTableIdentifier' => [ 'shape' => 'ConfiguredTableIdentifier', 'location' => 'uri', 'locationName' => 'configuredTableIdentifier', ], 'name' => [ 'shape' => 'DisplayName', ], 'description' => [ 'shape' => 'TableDescription', ], ], ], 'UpdateConfiguredTableOutput' => [ 'type' => 'structure', 'required' => [ 'configuredTable', ], 'members' => [ 'configuredTable' => [ 'shape' => 'ConfiguredTable', ], ], ], 'UpdateMembershipInput' => [ 'type' => 'structure', 'required' => [ 'membershipIdentifier', ], 'members' => [ 'membershipIdentifier' => [ 'shape' => 'MembershipIdentifier', 'location' => 'uri', 'locationName' => 'membershipIdentifier', ], 'queryLogStatus' => [ 'shape' => 'MembershipQueryLogStatus', ], ], ], 'UpdateMembershipOutput' => [ 'type' => 'structure', 'required' => [ 'membership', ], 'members' => [ 'membership' => [ 'shape' => 'Membership', ], ], ], 'UpdateProtectedQueryInput' => [ 'type' => 'structure', 'required' => [ 'membershipIdentifier', 'protectedQueryIdentifier', 'targetStatus', ], 'members' => [ 'membershipIdentifier' => [ 'shape' => 'MembershipIdentifier', 'location' => 'uri', 'locationName' => 'membershipIdentifier', ], 'protectedQueryIdentifier' => [ 'shape' => 'ProtectedQueryIdentifier', 'location' => 'uri', 'locationName' => 'protectedQueryIdentifier', ], 'targetStatus' => [ 'shape' => 'TargetProtectedQueryStatus', ], ], ], 'UpdateProtectedQueryOutput' => [ 'type' => 'structure', 'required' => [ 'protectedQuery', ], 'members' => [ 'protectedQuery' => [ 'shape' => 'ProtectedQuery', ], ], ], 'ValidationException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'String', ], 'reason' => [ 'shape' => 'ValidationExceptionReason', ], 'fieldList' => [ 'shape' => 'ValidationExceptionFieldList', ], ], 'error' => [ 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'ValidationExceptionField' => [ 'type' => 'structure', 'required' => [ 'name', 'message', ], 'members' => [ 'name' => [ 'shape' => 'String', ], 'message' => [ 'shape' => 'String', ], ], ], 'ValidationExceptionFieldList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ValidationExceptionField', ], ], 'ValidationExceptionReason' => [ 'type' => 'string', 'enum' => [ 'FIELD_VALIDATION_FAILED', 'INVALID_CONFIGURATION', 'INVALID_QUERY', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cleanrooms/2022-02-17/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>Welcome to the <i>Clean Rooms API Reference</i>.</p> <p>Clean Rooms is an Amazon Web Services service that helps multiple parties to join their data together in a secure collaboration workspace. In the collaboration, members who can query and receive results can get insights into the collective datasets without either party getting access to the other party\\'s raw data.</p> <p>To learn more about Clean Rooms concepts, procedures, and best practices, see the <a href=\"https://docs.aws.amazon.com/clean-rooms/latest/userguide/what-is.html\">Clean Rooms User Guide</a>.</p>', 'operations' => [ 'BatchGetSchema' => '<p>Retrieves multiple schemas by their identifiers.</p>', 'CreateCollaboration' => '<p>Creates a new collaboration.</p>', 'CreateConfiguredTable' => '<p>Creates a new configured table resource.</p>', 'CreateConfiguredTableAnalysisRule' => '<p>Creates a new analysis rule for a configured table. Currently, only one analysis rule can be created for a given configured table.</p>', 'CreateConfiguredTableAssociation' => '<p>Creates a configured table association. A configured table association links a configured table with a collaboration.</p>', 'CreateMembership' => '<p>Creates a membership for a specific collaboration identifier and joins the collaboration.</p>', 'DeleteCollaboration' => '<p>Deletes a collaboration. It can only be called by the collaboration owner.</p>', 'DeleteConfiguredTable' => '<p>Deletes a configured table.</p>', 'DeleteConfiguredTableAnalysisRule' => '<p>Deletes a configured table analysis rule.</p>', 'DeleteConfiguredTableAssociation' => '<p>Deletes a configured table association.</p>', 'DeleteMember' => '<p>Removes the specified member from a collaboration. The removed member is placed in the Removed status and can\\'t interact with the collaboration. The removed member\\'s data is inaccessible to active members of the collaboration.</p>', 'DeleteMembership' => '<p>Deletes a specified membership. All resources under a membership must be deleted.</p>', 'GetCollaboration' => '<p>Returns metadata about a collaboration.</p>', 'GetConfiguredTable' => '<p>Retrieves a configured table.</p>', 'GetConfiguredTableAnalysisRule' => '<p>Retrieves a configured table analysis rule.</p>', 'GetConfiguredTableAssociation' => '<p>Retrieves a configured table association.</p>', 'GetMembership' => '<p>Retrieves a specified membership for an identifier.</p>', 'GetProtectedQuery' => '<p>Returns query processing metadata.</p>', 'GetSchema' => '<p>Retrieves the schema for a relation within a collaboration.</p>', 'GetSchemaAnalysisRule' => '<p>Retrieves a schema analysis rule.</p>', 'ListCollaborations' => '<p>Lists collaborations the caller owns, is active in, or has been invited to.</p>', 'ListConfiguredTableAssociations' => '<p>Lists configured table associations for a membership.</p>', 'ListConfiguredTables' => '<p>Lists configured tables.</p>', 'ListMembers' => '<p>Lists all members within a collaboration.</p>', 'ListMemberships' => '<p>Lists all memberships resources within the caller\\'s account.</p>', 'ListProtectedQueries' => '<p>Lists protected queries, sorted by the most recent query.</p>', 'ListSchemas' => '<p>Lists the schemas for relations within a collaboration.</p>', 'ListTagsForResource' => '<p>Lists all of the tags that have been added to a resource.</p>', 'StartProtectedQuery' => '<p>Creates a protected query that is started by Clean Rooms .</p>', 'TagResource' => '<p>Tags a resource.</p>', 'UntagResource' => '<p>Removes a tag or list of tags from a resource.</p>', 'UpdateCollaboration' => '<p>Updates collaboration metadata and can only be called by the collaboration owner.</p>', 'UpdateConfiguredTable' => '<p>Updates a configured table.</p>', 'UpdateConfiguredTableAnalysisRule' => '<p>Updates a configured table analysis rule.</p>', 'UpdateConfiguredTableAssociation' => '<p>Updates a configured table association.</p>', 'UpdateMembership' => '<p>Updates a membership.</p>', 'UpdateProtectedQuery' => '<p>Updates the processing of a currently running query.</p>', ], 'shapes' => [ 'AccessDeniedException' => [ 'base' => '<p>Caller does not have sufficient access to perform this action.</p>', 'refs' => [], ], 'AccessDeniedExceptionReason' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$reason' => '<p>A reason code for the exception.</p>', ], ], 'AccountId' => [ 'base' => NULL, 'refs' => [ 'Collaboration$creatorAccountId' => '<p>The identifier used to reference members of the collaboration. Currently only supports Amazon Web Services account ID.</p>', 'CollaborationSummary$creatorAccountId' => '<p>The identifier used to reference members of the collaboration. Currently only supports Amazon Web Services account ID.</p>', 'DeleteMemberInput$accountId' => '<p>The account ID of the member to remove.</p>', 'MemberSpecification$accountId' => '<p>The identifier used to reference members of the collaboration. Currently only supports Amazon Web Services account ID.</p>', 'MemberSummary$accountId' => '<p>The identifier used to reference members of the collaboration. Currently only supports Amazon Web Services account ID.</p>', 'Membership$collaborationCreatorAccountId' => '<p>The identifier used to reference members of the collaboration. Currently only supports Amazon Web Services account ID.</p>', 'MembershipSummary$collaborationCreatorAccountId' => '<p>The identifier of the Amazon Web Services principal that created the collaboration. Currently only supports Amazon Web Services account ID.</p>', 'Schema$creatorAccountId' => '<p>The unique account ID for the Amazon Web Services account that owns the schema.</p>', 'SchemaSummary$creatorAccountId' => '<p>The unique account ID for the Amazon Web Services account that owns the schema.</p>', ], ], 'AggregateColumn' => [ 'base' => '<p>Column in configured table that can be used in aggregate function in query.</p>', 'refs' => [ 'AnalysisRuleAggregationAggregateColumnsList$member' => NULL, ], ], 'AggregateColumnColumnNamesList' => [ 'base' => NULL, 'refs' => [ 'AggregateColumn$columnNames' => '<p>Column names in configured table of aggregate columns.</p>', ], ], 'AggregateFunctionName' => [ 'base' => NULL, 'refs' => [ 'AggregateColumn$function' => '<p>Aggregation function that can be applied to aggregate column in query.</p>', ], ], 'AggregationConstraint' => [ 'base' => '<p>Constraint on query output removing output rows that do not meet a minimum number of distinct values of a specified column.</p>', 'refs' => [ 'AggregationConstraints$member' => NULL, ], ], 'AggregationConstraintMinimumInteger' => [ 'base' => NULL, 'refs' => [ 'AggregationConstraint$minimum' => '<p>The minimum number of distinct values that an output row must be an aggregation of. Minimum threshold of distinct values for a specified column that must exist in an output row for it to be in the query output.</p>', ], ], 'AggregationConstraints' => [ 'base' => NULL, 'refs' => [ 'AnalysisRuleAggregation$outputConstraints' => '<p>Columns that must meet a specific threshold value (after an aggregation function is applied to it) for each output row to be returned.</p>', ], ], 'AggregationType' => [ 'base' => NULL, 'refs' => [ 'AggregationConstraint$type' => '<p>The type of aggregation the constraint allows. The only valid value is currently `COUNT_DISTINCT`.</p>', ], ], 'AllowedColumnList' => [ 'base' => NULL, 'refs' => [ 'ConfiguredTable$allowedColumns' => '<p>The columns within the underlying Glue table that can be utilized within collaborations.</p>', 'CreateConfiguredTableInput$allowedColumns' => '<p>The columns of the underlying table that can be used by collaborations or analysis rules.</p>', ], ], 'AnalysisMethod' => [ 'base' => NULL, 'refs' => [ 'ConfiguredTable$analysisMethod' => '<p>The analysis method for the configured table. The only valid value is currently `DIRECT_QUERY`.</p>', 'ConfiguredTableSummary$analysisMethod' => '<p>The analysis method for the configured tables. The only valid value is currently `DIRECT_QUERY`.</p>', 'CreateConfiguredTableInput$analysisMethod' => '<p>The analysis method for the configured tables. The only valid value is currently `DIRECT_QUERY`.</p>', 'Schema$analysisMethod' => '<p>The analysis method for the schema. The only valid value is currently DIRECT_QUERY.</p>', 'SchemaSummary$analysisMethod' => '<p>The analysis method for the associated schema. The only valid value is currently `DIRECT_QUERY`.</p>', ], ], 'AnalysisRule' => [ 'base' => '<p>A specification about how data from the configured table can be used in a query.</p>', 'refs' => [ 'GetSchemaAnalysisRuleOutput$analysisRule' => '<p>A specification about how data from the configured table can be used.</p>', ], ], 'AnalysisRuleAggregation' => [ 'base' => '<p>Enables query structure and specified queries that produce aggregate statistics.</p>', 'refs' => [ 'AnalysisRulePolicyV1$aggregation' => '<p>Analysis rule type that enables only aggregation queries on a configured table.</p>', 'ConfiguredTableAnalysisRulePolicyV1$aggregation' => '<p>Analysis rule type that enables only aggregation queries on a configured table.</p>', ], ], 'AnalysisRuleAggregationAggregateColumnsList' => [ 'base' => NULL, 'refs' => [ 'AnalysisRuleAggregation$aggregateColumns' => '<p>The columns that query runners are allowed to use in aggregation queries.</p>', ], ], 'AnalysisRuleColumnList' => [ 'base' => NULL, 'refs' => [ 'AnalysisRuleAggregation$joinColumns' => '<p>Columns in configured table that can be used in join statements and/or as aggregate columns. They can never be outputted directly.</p>', 'AnalysisRuleAggregation$dimensionColumns' => '<p>The columns that query runners are allowed to select, group by, or filter by.</p>', 'AnalysisRuleList$listColumns' => '<p>Columns that can be listed in the output.</p>', ], ], 'AnalysisRuleColumnName' => [ 'base' => NULL, 'refs' => [ 'AggregateColumnColumnNamesList$member' => NULL, 'AggregationConstraint$columnName' => '<p>Column in aggregation constraint for which there must be a minimum number of distinct values in an output row for it to be in the query output.</p>', 'AnalysisRuleColumnList$member' => NULL, 'AnalysisRuleListJoinColumnsList$member' => NULL, ], ], 'AnalysisRuleList' => [ 'base' => '<p>A type of analysis rule that enables row-level analysis.</p>', 'refs' => [ 'AnalysisRulePolicyV1$list' => '<p>Analysis rule type that enables only list queries on a configured table.</p>', 'ConfiguredTableAnalysisRulePolicyV1$list' => '<p>Analysis rule type that enables only list queries on a configured table.</p>', ], ], 'AnalysisRuleListJoinColumnsList' => [ 'base' => NULL, 'refs' => [ 'AnalysisRuleList$joinColumns' => '<p>Columns that can be used to join a configured table with the table of the member who can query and other members\\' configured tables.</p>', ], ], 'AnalysisRulePolicy' => [ 'base' => '<p>Controls on the query specifications that can be run on configured table..</p>', 'refs' => [ 'AnalysisRule$policy' => '<p>A policy that describes the associated data usage limitations.</p>', ], ], 'AnalysisRulePolicyV1' => [ 'base' => '<p>Controls on the query specifications that can be run on configured table..</p>', 'refs' => [ 'AnalysisRulePolicy$v1' => '<p>Controls on the query specifications that can be run on configured table..</p>', ], ], 'AnalysisRuleType' => [ 'base' => NULL, 'refs' => [ 'AnalysisRule$type' => '<p>The type of analysis rule. Valid values are `AGGREGATION` and `LIST`.</p>', 'AnalysisRuleTypeList$member' => NULL, 'GetSchemaAnalysisRuleInput$type' => '<p>The type of the schema analysis rule to retrieve. Schema analysis rules are uniquely identified by a combination of the collaboration, the schema name, and their type.</p>', ], ], 'AnalysisRuleTypeList' => [ 'base' => NULL, 'refs' => [ 'Schema$analysisRuleTypes' => '<p>The analysis rule types associated with the schema. Valued values are LIST and AGGREGATION. Currently, only one entry is present.</p>', 'SchemaSummary$analysisRuleTypes' => '<p>The types of analysis rules that are associated with this schema object.</p>', ], ], 'BatchGetSchemaError' => [ 'base' => '<p>An error describing why a schema could not be fetched.</p>', 'refs' => [ 'BatchGetSchemaErrorList$member' => NULL, ], ], 'BatchGetSchemaErrorList' => [ 'base' => NULL, 'refs' => [ 'BatchGetSchemaOutput$errors' => '<p>Error reasons for schemas that could not be retrieved. One error is returned for every schema that could not be retrieved.</p>', ], ], 'BatchGetSchemaInput' => [ 'base' => NULL, 'refs' => [], ], 'BatchGetSchemaOutput' => [ 'base' => NULL, 'refs' => [], ], 'Boolean' => [ 'base' => NULL, 'refs' => [ 'DataEncryptionMetadata$allowCleartext' => '<p>Indicates whether encrypted tables can contain cleartext data (true) or are to cryptographically process every column (false).</p>', 'DataEncryptionMetadata$allowDuplicates' => '<p>Indicates whether Fingerprint columns can contain duplicate entries (true) or are to contain only non-repeated values (false).</p>', 'DataEncryptionMetadata$allowJoinsOnColumnsWithDifferentNames' => '<p>Indicates whether Fingerprint columns can be joined on any other Fingerprint column with a different name (true) or can only be joined on Fingerprint columns of the same name (false).</p>', 'DataEncryptionMetadata$preserveNulls' => '<p>Indicates whether NULL values are to be copied as NULL to encrypted tables (true) or cryptographically processed (false).</p>', ], ], 'CleanroomsArn' => [ 'base' => NULL, 'refs' => [ 'ListTagsForResourceInput$resourceArn' => '<p>The Amazon Resource Name (ARN) associated with the resource you want to list tags on.</p>', 'TagResourceInput$resourceArn' => '<p>The Amazon Resource Name (ARN) associated with the resource you want to tag.</p>', 'UntagResourceInput$resourceArn' => '<p>The Amazon Resource Name (ARN) associated with the resource you want to remove the tag from.</p>', ], ], 'Collaboration' => [ 'base' => '<p>The multi-party data share environment. The collaboration contains metadata about its purpose and participants.</p>', 'refs' => [ 'CreateCollaborationOutput$collaboration' => '<p>The entire created collaboration object.</p>', 'GetCollaborationOutput$collaboration' => '<p>The entire collaboration for this identifier.</p>', 'UpdateCollaborationOutput$collaboration' => '<p>The entire collaboration that has been updated.</p>', ], ], 'CollaborationArn' => [ 'base' => NULL, 'refs' => [ 'Collaboration$arn' => '<p>The unique ARN for the collaboration.</p>', 'CollaborationSummary$arn' => '<p>The ARN of the collaboration.</p>', 'Membership$collaborationArn' => '<p>The unique ARN for the membership\\'s associated collaboration.</p>', 'MembershipSummary$collaborationArn' => '<p>The unique ARN for the membership\\'s associated collaboration.</p>', 'Schema$collaborationArn' => '<p>The unique ARN for the collaboration that the schema belongs to.</p>', 'SchemaSummary$collaborationArn' => '<p>The unique ARN for the collaboration that the schema belongs to.</p>', ], ], 'CollaborationDescription' => [ 'base' => NULL, 'refs' => [ 'Collaboration$description' => '<p>A description of the collaboration provided by the collaboration owner.</p>', 'CreateCollaborationInput$description' => '<p>A description of the collaboration provided by the collaboration owner.</p>', 'UpdateCollaborationInput$description' => '<p>A description of the collaboration.</p>', ], ], 'CollaborationIdentifier' => [ 'base' => NULL, 'refs' => [ 'AnalysisRule$collaborationId' => '<p>The unique ID for the associated collaboration.</p>', 'BatchGetSchemaInput$collaborationIdentifier' => '<p>A unique identifier for the collaboration that the schemas belong to. Currently accepts collaboration ID.</p>', 'CreateMembershipInput$collaborationIdentifier' => '<p>The unique ID for the associated collaboration.</p>', 'DeleteCollaborationInput$collaborationIdentifier' => '<p>The identifier for the collaboration.</p>', 'DeleteMemberInput$collaborationIdentifier' => '<p>The unique identifier for the associated collaboration.</p>', 'GetCollaborationInput$collaborationIdentifier' => '<p>The identifier for the collaboration.</p>', 'GetSchemaAnalysisRuleInput$collaborationIdentifier' => '<p>A unique identifier for the collaboration that the schema belongs to. Currently accepts a collaboration ID.</p>', 'GetSchemaInput$collaborationIdentifier' => '<p>A unique identifier for the collaboration that the schema belongs to. Currently accepts a collaboration ID.</p>', 'ListMembersInput$collaborationIdentifier' => '<p>The identifier of the collaboration in which the members are listed.</p>', 'ListSchemasInput$collaborationIdentifier' => '<p>A unique identifier for the collaboration that the schema belongs to. Currently accepts a collaboration ID.</p>', 'MembershipSummary$collaborationId' => '<p>The unique ID for the membership\\'s collaboration.</p>', 'UpdateCollaborationInput$collaborationIdentifier' => '<p>The identifier for the collaboration.</p>', ], ], 'CollaborationName' => [ 'base' => NULL, 'refs' => [ 'Collaboration$name' => '<p>A human-readable identifier provided by the collaboration owner. Display names are not unique.</p>', 'CollaborationSummary$name' => '<p>A human-readable identifier provided by the collaboration owner. Display names are not unique.</p>', 'CreateCollaborationInput$name' => '<p>The display name for a collaboration.</p>', 'Membership$collaborationName' => '<p>The name of the membership\\'s collaboration.</p>', 'MembershipSummary$collaborationName' => '<p>The name for the membership\\'s collaboration.</p>', 'UpdateCollaborationInput$name' => '<p>A human-readable identifier provided by the collaboration owner. Display names are not unique.</p>', ], ], 'CollaborationQueryLogStatus' => [ 'base' => NULL, 'refs' => [ 'Collaboration$queryLogStatus' => '<p>An indicator as to whether query logging has been enabled or disabled for the collaboration.</p>', 'CreateCollaborationInput$queryLogStatus' => '<p>An indicator as to whether query logging has been enabled or disabled for the collaboration.</p>', ], ], 'CollaborationSummary' => [ 'base' => '<p>The metadata of the collaboration.</p>', 'refs' => [ 'CollaborationSummaryList$member' => NULL, ], ], 'CollaborationSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListCollaborationsOutput$collaborationList' => '<p>The list of collaborations.</p>', ], ], 'Column' => [ 'base' => '<p>A column within a schema relation, derived from the underlying Glue table.</p>', 'refs' => [ 'ColumnList$member' => NULL, ], ], 'ColumnList' => [ 'base' => NULL, 'refs' => [ 'Schema$columns' => '<p>The columns for the relation this schema represents.</p>', 'Schema$partitionKeys' => '<p>The partition keys for the dataset underlying this schema.</p>', ], ], 'ColumnName' => [ 'base' => NULL, 'refs' => [ 'AllowedColumnList$member' => NULL, 'Column$name' => '<p>The name of the column.</p>', ], ], 'ColumnTypeString' => [ 'base' => NULL, 'refs' => [ 'Column$type' => '<p>The type of the column.</p>', ], ], 'ConfiguredTable' => [ 'base' => '<p>A table that has been configured for use in a collaboration.</p>', 'refs' => [ 'CreateConfiguredTableOutput$configuredTable' => '<p>The created configured table.</p>', 'GetConfiguredTableOutput$configuredTable' => '<p>The retrieved configured table.</p>', 'UpdateConfiguredTableOutput$configuredTable' => '<p>The updated configured table.</p>', ], ], 'ConfiguredTableAnalysisRule' => [ 'base' => '<p>A configured table analysis rule, which limits how data for this table can be used.</p>', 'refs' => [ 'CreateConfiguredTableAnalysisRuleOutput$analysisRule' => '<p>The entire created analysis rule.</p>', 'GetConfiguredTableAnalysisRuleOutput$analysisRule' => '<p>The entire analysis rule output.</p>', 'UpdateConfiguredTableAnalysisRuleOutput$analysisRule' => '<p>The entire updated analysis rule.</p>', ], ], 'ConfiguredTableAnalysisRulePolicy' => [ 'base' => '<p>Controls on the query specifications that can be run on a configured table.</p>', 'refs' => [ 'ConfiguredTableAnalysisRule$policy' => '<p>The policy that controls SQL query rules.</p>', 'CreateConfiguredTableAnalysisRuleInput$analysisRulePolicy' => '<p>The entire created configured table analysis rule object.</p>', 'UpdateConfiguredTableAnalysisRuleInput$analysisRulePolicy' => '<p>The new analysis rule policy for the configured table analysis rule.</p>', ], ], 'ConfiguredTableAnalysisRulePolicyV1' => [ 'base' => '<p>Controls on the query specifications that can be run on a configured table.</p>', 'refs' => [ 'ConfiguredTableAnalysisRulePolicy$v1' => '<p>Controls on the query specifications that can be run on a configured table.</p>', ], ], 'ConfiguredTableAnalysisRuleType' => [ 'base' => NULL, 'refs' => [ 'ConfiguredTableAnalysisRule$type' => '<p>The type of configured table analysis rule. Valid values are `AGGREGATION` and `LIST`.</p>', 'ConfiguredTableAnalysisRuleTypeList$member' => NULL, 'CreateConfiguredTableAnalysisRuleInput$analysisRuleType' => '<p>The type of analysis rule. Valid values are AGGREGATION and LIST.</p>', 'DeleteConfiguredTableAnalysisRuleInput$analysisRuleType' => '<p>The analysis rule type to be deleted. Configured table analysis rules are uniquely identified by their configured table identifier and analysis rule type.</p>', 'GetConfiguredTableAnalysisRuleInput$analysisRuleType' => '<p>The analysis rule to be retrieved. Configured table analysis rules are uniquely identified by their configured table identifier and analysis rule type.</p>', 'UpdateConfiguredTableAnalysisRuleInput$analysisRuleType' => '<p>The analysis rule type to be updated. Configured table analysis rules are uniquely identified by their configured table identifier and analysis rule type.</p>', ], ], 'ConfiguredTableAnalysisRuleTypeList' => [ 'base' => NULL, 'refs' => [ 'ConfiguredTable$analysisRuleTypes' => '<p>The types of analysis rules associated with this configured table. Valid values are `AGGREGATION` and `LIST`. Currently, only one analysis rule may be associated with a configured table.</p>', 'ConfiguredTableSummary$analysisRuleTypes' => '<p>The types of analysis rules associated with this configured table.</p>', ], ], 'ConfiguredTableArn' => [ 'base' => NULL, 'refs' => [ 'ConfiguredTable$arn' => '<p>The unique ARN for the configured table.</p>', 'ConfiguredTableAnalysisRule$configuredTableArn' => '<p>The unique ARN for the configured table.</p>', 'ConfiguredTableAssociation$configuredTableArn' => '<p>The unique ARN for the configured table that the association refers to.</p>', 'ConfiguredTableSummary$arn' => '<p>The unique ARN of the configured table.</p>', ], ], 'ConfiguredTableAssociation' => [ 'base' => '<p>A configured table association links a configured table to a collaboration.</p>', 'refs' => [ 'CreateConfiguredTableAssociationOutput$configuredTableAssociation' => '<p>The entire configured table association object.</p>', 'GetConfiguredTableAssociationOutput$configuredTableAssociation' => '<p>The entire configured table association object.</p>', 'UpdateConfiguredTableAssociationOutput$configuredTableAssociation' => '<p>The entire updated configured table association.</p>', ], ], 'ConfiguredTableAssociationArn' => [ 'base' => NULL, 'refs' => [ 'ConfiguredTableAssociation$arn' => '<p>The unique ARN for the configured table association.</p>', 'ConfiguredTableAssociationSummary$arn' => '<p>The unique ARN for the configured table association.</p>', ], ], 'ConfiguredTableAssociationIdentifier' => [ 'base' => NULL, 'refs' => [ 'DeleteConfiguredTableAssociationInput$configuredTableAssociationIdentifier' => '<p>The unique ID for the configured table association to be deleted. Currently accepts the configured table ID.</p>', 'GetConfiguredTableAssociationInput$configuredTableAssociationIdentifier' => '<p>The unique ID for the configured table association to retrieve. Currently accepts the configured table ID.</p>', 'UpdateConfiguredTableAssociationInput$configuredTableAssociationIdentifier' => '<p>The unique identifier for the configured table association to update. Currently accepts the configured table association ID.</p>', ], ], 'ConfiguredTableAssociationSummary' => [ 'base' => '<p>The configured table association summary for the objects listed by the request.</p>', 'refs' => [ 'ConfiguredTableAssociationSummaryList$member' => NULL, ], ], 'ConfiguredTableAssociationSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListConfiguredTableAssociationsOutput$configuredTableAssociationSummaries' => '<p>The retrieved list of configured table associations.</p>', ], ], 'ConfiguredTableIdentifier' => [ 'base' => NULL, 'refs' => [ 'ConfiguredTableSummary$id' => '<p>The unique ID of the configured table.</p>', 'CreateConfiguredTableAnalysisRuleInput$configuredTableIdentifier' => '<p>The identifier for the configured table to create the analysis rule for. Currently accepts the configured table ID. </p>', 'CreateConfiguredTableAssociationInput$configuredTableIdentifier' => '<p>A unique identifier for the configured table to be associated to. Currently accepts a configured table ID.</p>', 'DeleteConfiguredTableAnalysisRuleInput$configuredTableIdentifier' => '<p>The unique identifier for the configured table that the analysis rule applies to. Currently accepts the configured table ID.</p>', 'DeleteConfiguredTableInput$configuredTableIdentifier' => '<p>The unique ID for the configured table to delete.</p>', 'GetConfiguredTableAnalysisRuleInput$configuredTableIdentifier' => '<p>The unique identifier for the configured table to retrieve. Currently accepts the configured table ID.</p>', 'GetConfiguredTableInput$configuredTableIdentifier' => '<p>The unique ID for the configured table to retrieve.</p>', 'UpdateConfiguredTableAnalysisRuleInput$configuredTableIdentifier' => '<p>The unique identifier for the configured table that the analysis rule applies to. Currently accepts the configured table ID.</p>', 'UpdateConfiguredTableInput$configuredTableIdentifier' => '<p>The identifier for the configured table to update. Currently accepts the configured table ID.</p>', ], ], 'ConfiguredTableSummary' => [ 'base' => '<p>The configured table summary for the objects listed by the request.</p>', 'refs' => [ 'ConfiguredTableSummaryList$member' => '<p>The member of the configured table summary list.</p>', ], ], 'ConfiguredTableSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListConfiguredTablesOutput$configuredTableSummaries' => '<p>The configured tables listed by the request.</p>', ], ], 'ConflictException' => [ 'base' => '<p>Updating or deleting a resource can cause an inconsistent state.</p>', 'refs' => [], ], 'ConflictExceptionReason' => [ 'base' => NULL, 'refs' => [ 'ConflictException$reason' => '<p>A reason code for the exception.</p>', ], ], 'CreateCollaborationInput' => [ 'base' => NULL, 'refs' => [], ], 'CreateCollaborationOutput' => [ 'base' => NULL, 'refs' => [], ], 'CreateConfiguredTableAnalysisRuleInput' => [ 'base' => NULL, 'refs' => [], ], 'CreateConfiguredTableAnalysisRuleOutput' => [ 'base' => NULL, 'refs' => [], ], 'CreateConfiguredTableAssociationInput' => [ 'base' => NULL, 'refs' => [], ], 'CreateConfiguredTableAssociationOutput' => [ 'base' => NULL, 'refs' => [], ], 'CreateConfiguredTableInput' => [ 'base' => NULL, 'refs' => [], ], 'CreateConfiguredTableOutput' => [ 'base' => NULL, 'refs' => [], ], 'CreateMembershipInput' => [ 'base' => NULL, 'refs' => [], ], 'CreateMembershipOutput' => [ 'base' => NULL, 'refs' => [], ], 'DataEncryptionMetadata' => [ 'base' => '<p>The settings for client-side encryption for cryptographic computing.</p>', 'refs' => [ 'Collaboration$dataEncryptionMetadata' => '<p>The settings for client-side encryption for cryptographic computing.</p>', 'CreateCollaborationInput$dataEncryptionMetadata' => '<p>The settings for client-side encryption with Cryptographic Computing for Clean Rooms.</p>', ], ], 'DeleteCollaborationInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteCollaborationOutput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteConfiguredTableAnalysisRuleInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteConfiguredTableAnalysisRuleOutput' => [ 'base' => '<p>An empty response that indicates a successful delete.</p>', 'refs' => [], ], 'DeleteConfiguredTableAssociationInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteConfiguredTableAssociationOutput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteConfiguredTableInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteConfiguredTableOutput' => [ 'base' => '<p>The empty output for a successful deletion.</p>', 'refs' => [], ], 'DeleteMemberInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteMemberOutput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteMembershipInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteMembershipOutput' => [ 'base' => NULL, 'refs' => [], ], 'DisplayName' => [ 'base' => NULL, 'refs' => [ 'Collaboration$creatorDisplayName' => '<p>A display name of the collaboration creator.</p>', 'CollaborationSummary$creatorDisplayName' => '<p>The display name of the collaboration creator.</p>', 'ConfiguredTable$name' => '<p>A name for the configured table.</p>', 'ConfiguredTableSummary$name' => '<p>The name of the configured table.</p>', 'CreateCollaborationInput$creatorDisplayName' => '<p>The display name of the collaboration creator.</p>', 'CreateConfiguredTableInput$name' => '<p>The name of the configured table.</p>', 'MemberSpecification$displayName' => '<p>The member\\'s display name.</p>', 'MemberSummary$displayName' => '<p>The member\\'s display name.</p>', 'Membership$collaborationCreatorDisplayName' => '<p>The display name of the collaboration creator.</p>', 'MembershipSummary$collaborationCreatorDisplayName' => '<p>The display name of the collaboration creator.</p>', 'UpdateConfiguredTableInput$name' => '<p>A new name for the configured table.</p>', ], ], 'Double' => [ 'base' => NULL, 'refs' => [ 'ServiceQuotaExceededException$quotaValue' => '<p>The value of the quota.</p>', ], ], 'FilterableMemberStatus' => [ 'base' => NULL, 'refs' => [ 'ListCollaborationsInput$memberStatus' => '<p>The caller\\'s status in a collaboration.</p>', ], ], 'GetCollaborationInput' => [ 'base' => NULL, 'refs' => [], ], 'GetCollaborationOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetConfiguredTableAnalysisRuleInput' => [ 'base' => NULL, 'refs' => [], ], 'GetConfiguredTableAnalysisRuleOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetConfiguredTableAssociationInput' => [ 'base' => NULL, 'refs' => [], ], 'GetConfiguredTableAssociationOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetConfiguredTableInput' => [ 'base' => NULL, 'refs' => [], ], 'GetConfiguredTableOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetMembershipInput' => [ 'base' => NULL, 'refs' => [], ], 'GetMembershipOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetProtectedQueryInput' => [ 'base' => NULL, 'refs' => [], ], 'GetProtectedQueryOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetSchemaAnalysisRuleInput' => [ 'base' => NULL, 'refs' => [], ], 'GetSchemaAnalysisRuleOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetSchemaInput' => [ 'base' => NULL, 'refs' => [], ], 'GetSchemaOutput' => [ 'base' => NULL, 'refs' => [], ], 'GlueDatabaseName' => [ 'base' => NULL, 'refs' => [ 'GlueTableReference$databaseName' => '<p>The name of the database the Glue table belongs to.</p>', ], ], 'GlueTableName' => [ 'base' => NULL, 'refs' => [ 'GlueTableReference$tableName' => '<p>The name of the Glue table.</p>', ], ], 'GlueTableReference' => [ 'base' => '<p>A reference to a table within an Glue data catalog.</p>', 'refs' => [ 'TableReference$glue' => '<p>If present, a reference to the Glue table referred to by this table reference.</p>', ], ], 'InternalServerException' => [ 'base' => '<p>Unexpected error during processing of request.</p>', 'refs' => [], ], 'JoinOperator' => [ 'base' => NULL, 'refs' => [ 'JoinOperatorsList$member' => NULL, ], ], 'JoinOperatorsList' => [ 'base' => NULL, 'refs' => [ 'AnalysisRuleAggregation$allowedJoinOperators' => '<p>Which logical operators (if any) are to be used in an INNER JOIN match condition. Default is <code>AND</code>.</p>', 'AnalysisRuleList$allowedJoinOperators' => '<p>Which logical operators (if any) are to be used in an INNER JOIN match condition. Default is <code>AND</code>.</p>', ], ], 'JoinRequiredOption' => [ 'base' => NULL, 'refs' => [ 'AnalysisRuleAggregation$joinRequired' => '<p>Control that requires member who runs query to do a join with their configured table and/or other configured table in query.</p>', ], ], 'KeyPrefix' => [ 'base' => NULL, 'refs' => [ 'ProtectedQueryS3OutputConfiguration$keyPrefix' => '<p>The S3 prefix to unload the protected query results.</p>', ], ], 'ListCollaborationsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListCollaborationsOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListConfiguredTableAssociationsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListConfiguredTableAssociationsOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListConfiguredTablesInput' => [ 'base' => NULL, 'refs' => [], ], 'ListConfiguredTablesOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListMembersInput' => [ 'base' => NULL, 'refs' => [], ], 'ListMembersOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListMembershipsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListMembershipsOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListProtectedQueriesInput' => [ 'base' => NULL, 'refs' => [], ], 'ListProtectedQueriesOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListSchemasInput' => [ 'base' => NULL, 'refs' => [], ], 'ListSchemasOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceInput' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceOutput' => [ 'base' => NULL, 'refs' => [], ], 'Long' => [ 'base' => NULL, 'refs' => [ 'ProtectedQueryStatistics$totalDurationInMillis' => '<p>The duration of the Protected Query, from creation until query completion.</p>', ], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'ListCollaborationsInput$maxResults' => '<p>The maximum size of the results that is returned per call. Service chooses a default if it has not been set. Service may return a nextToken even if the maximum results has not been met.</p>', 'ListConfiguredTableAssociationsInput$maxResults' => '<p>The maximum size of the results that is returned per call.</p>', 'ListConfiguredTablesInput$maxResults' => '<p>The maximum size of the results that is returned per call.</p>', 'ListMembersInput$maxResults' => '<p>The maximum size of the results that is returned per call.</p>', 'ListMembershipsInput$maxResults' => '<p>The maximum size of the results that is returned per call.</p>', 'ListProtectedQueriesInput$maxResults' => '<p>The maximum size of the results that is returned per call. Service chooses a default if it has not been set. Service can return a nextToken even if the maximum results has not been met. </p>', 'ListSchemasInput$maxResults' => '<p>The maximum size of the results that is returned per call.</p>', ], ], 'MemberAbilities' => [ 'base' => NULL, 'refs' => [ 'CreateCollaborationInput$creatorMemberAbilities' => '<p>The abilities granted to the collaboration creator.</p>', 'MemberSpecification$memberAbilities' => '<p>The abilities granted to the collaboration member.</p>', 'MemberSummary$abilities' => '<p>The abilities granted to the collaboration member.</p>', 'Membership$memberAbilities' => '<p>The abilities granted to the collaboration member.</p>', 'MembershipSummary$memberAbilities' => '<p>The abilities granted to the collaboration member.</p>', ], ], 'MemberAbility' => [ 'base' => NULL, 'refs' => [ 'MemberAbilities$member' => NULL, ], ], 'MemberList' => [ 'base' => NULL, 'refs' => [ 'CreateCollaborationInput$members' => '<p>A list of initial members, not including the creator. This list is immutable.</p>', ], ], 'MemberSpecification' => [ 'base' => '<p>Basic metadata used to construct a new member.</p>', 'refs' => [ 'MemberList$member' => NULL, ], ], 'MemberStatus' => [ 'base' => NULL, 'refs' => [ 'Collaboration$memberStatus' => '<p>The status of a member in a collaboration.</p>', 'CollaborationSummary$memberStatus' => '<p>The status of a member in a collaboration.</p>', 'MemberSummary$status' => '<p>The status of the member. Valid values are `INVITED`, `ACTIVE`, `LEFT`, and `REMOVED`.</p>', ], ], 'MemberSummary' => [ 'base' => '<p>The member object listed by the request.</p>', 'refs' => [ 'MemberSummaryList$member' => NULL, ], ], 'MemberSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListMembersOutput$memberSummaries' => '<p>The list of members returned by the ListMembers operation.</p>', ], ], 'Membership' => [ 'base' => '<p>The membership object.</p>', 'refs' => [ 'CreateMembershipOutput$membership' => '<p>The membership that was created.</p>', 'GetMembershipOutput$membership' => '<p>The membership retrieved for the provided identifier.</p>', 'UpdateMembershipOutput$membership' => NULL, ], ], 'MembershipArn' => [ 'base' => NULL, 'refs' => [ 'Collaboration$membershipArn' => '<p>The unique ARN for your membership within the collaboration.</p>', 'CollaborationSummary$membershipArn' => '<p>The ARN of a member in a collaboration.</p>', 'ConfiguredTableAssociation$membershipArn' => '<p>The unique ARN for the membership this configured table association belongs to.</p>', 'ConfiguredTableAssociationSummary$membershipArn' => '<p>The unique ARN for the membership that the configured table association belongs to.</p>', 'MemberSummary$membershipArn' => '<p>The unique ARN for the member\\'s associated membership, if present.</p>', 'Membership$arn' => '<p>The unique ARN for the membership.</p>', 'MembershipSummary$arn' => '<p>The unique ARN for the membership.</p>', 'ProtectedQuery$membershipArn' => '<p>The ARN of the membership.</p>', 'ProtectedQuerySummary$membershipArn' => '<p>The unique ARN for the membership that initiated the protected query.</p>', ], ], 'MembershipIdentifier' => [ 'base' => NULL, 'refs' => [ 'ConfiguredTableAssociationSummary$membershipId' => '<p>The unique ID for the membership that the configured table association belongs to.</p>', 'CreateConfiguredTableAssociationInput$membershipIdentifier' => '<p>A unique identifier for one of your memberships for a collaboration. The configured table is associated to the collaboration that this membership belongs to. Currently accepts a membership ID.</p>', 'DeleteConfiguredTableAssociationInput$membershipIdentifier' => '<p>A unique identifier for the membership that the configured table association belongs to. Currently accepts the membership ID.</p>', 'DeleteMembershipInput$membershipIdentifier' => '<p>The identifier for a membership resource.</p>', 'GetConfiguredTableAssociationInput$membershipIdentifier' => '<p>A unique identifier for the membership that the configured table association belongs to. Currently accepts the membership ID.</p>', 'GetMembershipInput$membershipIdentifier' => '<p>The identifier for a membership resource.</p>', 'GetProtectedQueryInput$membershipIdentifier' => '<p>The identifier for a membership in a protected query instance.</p>', 'ListConfiguredTableAssociationsInput$membershipIdentifier' => '<p>A unique identifier for the membership to list configured table associations for. Currently accepts the membership ID.</p>', 'ListProtectedQueriesInput$membershipIdentifier' => '<p>The identifier for the membership in the collaboration.</p>', 'StartProtectedQueryInput$membershipIdentifier' => '<p>A unique identifier for the membership to run this query against. Currently accepts a membership ID.</p>', 'UpdateConfiguredTableAssociationInput$membershipIdentifier' => '<p>The unique ID for the membership that the configured table association belongs to.</p>', 'UpdateMembershipInput$membershipIdentifier' => '<p>The unique identifier of the membership.</p>', 'UpdateProtectedQueryInput$membershipIdentifier' => '<p>The identifier for a member of a protected query instance.</p>', ], ], 'MembershipQueryLogStatus' => [ 'base' => NULL, 'refs' => [ 'CreateMembershipInput$queryLogStatus' => '<p>An indicator as to whether query logging has been enabled or disabled for the collaboration.</p>', 'Membership$queryLogStatus' => '<p>An indicator as to whether query logging has been enabled or disabled for the collaboration.</p>', 'UpdateMembershipInput$queryLogStatus' => '<p>An indicator as to whether query logging has been enabled or disabled for the collaboration.</p>', ], ], 'MembershipStatus' => [ 'base' => NULL, 'refs' => [ 'ListMembershipsInput$status' => '<p>A filter which will return only memberships in the specified status.</p>', 'Membership$status' => '<p>The status of the membership. Valid values are `ACTIVE`, `REMOVED`, and `COLLABORATION_DELETED`.</p>', 'MembershipSummary$status' => '<p>The status of the membership. Valid values are `ACTIVE`, `REMOVED`, and `COLLABORATION_DELETED`.</p>', ], ], 'MembershipSummary' => [ 'base' => '<p>The membership object listed by the request.</p>', 'refs' => [ 'MembershipSummaryList$member' => NULL, ], ], 'MembershipSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListMembershipsOutput$membershipSummaries' => '<p>The list of memberships returned from the ListMemberships operation.</p>', ], ], 'PaginationToken' => [ 'base' => NULL, 'refs' => [ 'ListCollaborationsInput$nextToken' => '<p>The token value retrieved from a previous call to access the next page of results.</p>', 'ListCollaborationsOutput$nextToken' => '<p>The token value retrieved from a previous call to access the next page of results.</p>', 'ListConfiguredTableAssociationsInput$nextToken' => '<p>The token value retrieved from a previous call to access the next page of results.</p>', 'ListConfiguredTableAssociationsOutput$nextToken' => '<p>The token value retrieved from a previous call to access the next page of results.</p>', 'ListConfiguredTablesInput$nextToken' => '<p>The token value retrieved from a previous call to access the next page of results.</p>', 'ListConfiguredTablesOutput$nextToken' => '<p>The token value retrieved from a previous call to access the next page of results.</p>', 'ListMembersInput$nextToken' => '<p>The token value retrieved from a previous call to access the next page of results.</p>', 'ListMembersOutput$nextToken' => '<p>The token value retrieved from a previous call to access the next page of results.</p>', 'ListMembershipsInput$nextToken' => '<p>The token value retrieved from a previous call to access the next page of results.</p>', 'ListMembershipsOutput$nextToken' => '<p>The token value retrieved from a previous call to access the next page of results.</p>', 'ListProtectedQueriesInput$nextToken' => '<p>The token value retrieved from a previous call to access the next page of results.</p>', 'ListProtectedQueriesOutput$nextToken' => '<p>The token value retrieved from a previous call to access the next page of results.</p>', 'ListSchemasInput$nextToken' => '<p>The token value retrieved from a previous call to access the next page of results.</p>', 'ListSchemasOutput$nextToken' => '<p>The token value retrieved from a previous call to access the next page of results.</p>', ], ], 'ProtectedQuery' => [ 'base' => '<p>The parameters for an Clean Rooms protected query.</p>', 'refs' => [ 'GetProtectedQueryOutput$protectedQuery' => '<p>The query processing metadata.</p>', 'StartProtectedQueryOutput$protectedQuery' => '<p>The protected query.</p>', 'UpdateProtectedQueryOutput$protectedQuery' => '<p>The protected query output.</p>', ], ], 'ProtectedQueryError' => [ 'base' => '<p>Details of errors thrown by the protected query.</p>', 'refs' => [ 'ProtectedQuery$error' => '<p>An error thrown by the protected query.</p>', ], ], 'ProtectedQueryIdentifier' => [ 'base' => NULL, 'refs' => [ 'GetProtectedQueryInput$protectedQueryIdentifier' => '<p>The identifier for a protected query instance.</p>', 'UpdateProtectedQueryInput$protectedQueryIdentifier' => '<p>The identifier for a protected query instance.</p>', ], ], 'ProtectedQueryOutput' => [ 'base' => '<p>Contains details about the protected query output.</p>', 'refs' => [ 'ProtectedQueryResult$output' => '<p>The output of the protected query.</p>', ], ], 'ProtectedQueryOutputConfiguration' => [ 'base' => '<p>Contains configuration details for protected query output.</p>', 'refs' => [ 'ProtectedQueryResultConfiguration$outputConfiguration' => '<p>Configuration for protected query results.</p>', ], ], 'ProtectedQueryResult' => [ 'base' => '<p>Details about the query results.</p>', 'refs' => [ 'ProtectedQuery$result' => '<p>The result of the protected query.</p>', ], ], 'ProtectedQueryResultConfiguration' => [ 'base' => '<p>Contains configurations for protected query results.</p>', 'refs' => [ 'ProtectedQuery$resultConfiguration' => '<p>Contains any details needed to write the query results.</p>', 'StartProtectedQueryInput$resultConfiguration' => '<p>The details needed to write the query results.</p>', ], ], 'ProtectedQueryS3Output' => [ 'base' => '<p>Contains output information for protected queries with an S3 output type.</p>', 'refs' => [ 'ProtectedQueryOutput$s3' => '<p>If present, the output for a protected query with an `S3` output type.</p>', ], ], 'ProtectedQueryS3OutputConfiguration' => [ 'base' => '<p>Contains the configuration to write the query results to S3.</p>', 'refs' => [ 'ProtectedQueryOutputConfiguration$s3' => '<p>Required configuration for a protected query with an `S3` output type.</p>', ], ], 'ProtectedQueryS3OutputConfigurationBucketString' => [ 'base' => NULL, 'refs' => [ 'ProtectedQueryS3OutputConfiguration$bucket' => '<p>The S3 bucket to unload the protected query results.</p>', ], ], 'ProtectedQuerySQLParameters' => [ 'base' => '<p>The parameters for the SQL type Protected Query.</p>', 'refs' => [ 'ProtectedQuery$sqlParameters' => '<p>The protected query SQL parameters.</p>', 'StartProtectedQueryInput$sqlParameters' => '<p>The protected SQL query parameters.</p>', ], ], 'ProtectedQuerySQLParametersQueryStringString' => [ 'base' => NULL, 'refs' => [ 'ProtectedQuerySQLParameters$queryString' => '<p>The query string to be submitted.</p>', ], ], 'ProtectedQueryStatistics' => [ 'base' => '<p>Contains statistics about the execution of the protected query.</p>', 'refs' => [ 'ProtectedQuery$statistics' => '<p>Statistics about protected query execution.</p>', ], ], 'ProtectedQueryStatus' => [ 'base' => NULL, 'refs' => [ 'ListProtectedQueriesInput$status' => '<p>A filter on the status of the protected query.</p>', 'ProtectedQuery$status' => '<p>The status of the query.</p>', 'ProtectedQuerySummary$status' => '<p>The status of the protected query. Value values are `SUBMITTED`, `STARTED`, `CANCELLED`, `CANCELLING`, `FAILED`, `SUCCESS`, `TIMED_OUT`.</p>', ], ], 'ProtectedQuerySummary' => [ 'base' => '<p>The protected query summary for the objects listed by the request.</p>', 'refs' => [ 'ProtectedQuerySummaryList$member' => NULL, ], ], 'ProtectedQuerySummaryList' => [ 'base' => NULL, 'refs' => [ 'ListProtectedQueriesOutput$protectedQueries' => '<p>A list of protected queries.</p>', ], ], 'ProtectedQueryType' => [ 'base' => NULL, 'refs' => [ 'StartProtectedQueryInput$type' => '<p>The type of the protected query to be started.</p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p>Request references a resource which does not exist.</p>', 'refs' => [], ], 'ResourceType' => [ 'base' => NULL, 'refs' => [ 'ConflictException$resourceType' => '<p>The type of the conflicting resource.</p>', 'ResourceNotFoundException$resourceType' => '<p>The type of the missing resource.</p>', ], ], 'ResultFormat' => [ 'base' => NULL, 'refs' => [ 'ProtectedQueryS3OutputConfiguration$resultFormat' => '<p>Intended file format of the result.</p>', ], ], 'RoleArn' => [ 'base' => NULL, 'refs' => [ 'ConfiguredTableAssociation$roleArn' => '<p>The service will assume this role to access catalog metadata and query the table.</p>', 'CreateConfiguredTableAssociationInput$roleArn' => '<p>The service will assume this role to access catalog metadata and query the table.</p>', 'UpdateConfiguredTableAssociationInput$roleArn' => '<p>The service will assume this role to access catalog metadata and query the table.</p>', ], ], 'ScalarFunctions' => [ 'base' => NULL, 'refs' => [ 'ScalarFunctionsList$member' => NULL, ], ], 'ScalarFunctionsList' => [ 'base' => NULL, 'refs' => [ 'AnalysisRuleAggregation$scalarFunctions' => '<p>Set of scalar functions that are allowed to be used on dimension columns and the output of aggregation of metrics.</p>', ], ], 'Schema' => [ 'base' => '<p>A schema is a relation within a collaboration.</p>', 'refs' => [ 'GetSchemaOutput$schema' => '<p>The entire schema object.</p>', 'SchemaList$member' => NULL, ], ], 'SchemaList' => [ 'base' => NULL, 'refs' => [ 'BatchGetSchemaOutput$schemas' => '<p>The retrieved list of schemas.</p>', ], ], 'SchemaSummary' => [ 'base' => '<p>The schema summary for the objects listed by the request.</p>', 'refs' => [ 'SchemaSummaryList$member' => NULL, ], ], 'SchemaSummaryList' => [ 'base' => NULL, 'refs' => [ 'ListSchemasOutput$schemaSummaries' => '<p>The retrieved list of schemas.</p>', ], ], 'SchemaType' => [ 'base' => NULL, 'refs' => [ 'ListSchemasInput$schemaType' => '<p>If present, filter schemas by schema type. The only valid schema type is currently `TABLE`.</p>', 'Schema$type' => '<p>The type of schema. The only valid value is currently `TABLE`.</p>', 'SchemaSummary$type' => '<p>The type of schema object. The only valid schema type is currently `TABLE`.</p>', ], ], 'ServiceQuotaExceededException' => [ 'base' => '<p>Request denied because service quota has been exceeded.</p>', 'refs' => [], ], 'StartProtectedQueryInput' => [ 'base' => NULL, 'refs' => [], ], 'StartProtectedQueryOutput' => [ 'base' => NULL, 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [ 'AccessDeniedException$message' => NULL, 'BatchGetSchemaError$code' => '<p>An error code for the error. </p>', 'BatchGetSchemaError$message' => '<p>An error message for the error.</p>', 'ConflictException$message' => NULL, 'ConflictException$resourceId' => '<p>The ID of the conflicting resource.</p>', 'InternalServerException$message' => NULL, 'ProtectedQueryError$message' => '<p>A description of why the query failed.</p>', 'ProtectedQueryError$code' => '<p>An error code for the error.</p>', 'ProtectedQueryS3Output$location' => '<p>The S3 location of the result.</p>', 'ResourceNotFoundException$message' => NULL, 'ResourceNotFoundException$resourceId' => '<p>The Id of the missing resource.</p>', 'ServiceQuotaExceededException$message' => NULL, 'ServiceQuotaExceededException$quotaName' => '<p>The name of the quota.</p>', 'ThrottlingException$message' => NULL, 'ValidationException$message' => NULL, 'ValidationExceptionField$name' => '<p>The name of the input parameter.</p>', 'ValidationExceptionField$message' => '<p>A message for the input validation error.</p>', ], ], 'TableAlias' => [ 'base' => NULL, 'refs' => [ 'AnalysisRule$name' => '<p>The name for the analysis rule.</p>', 'BatchGetSchemaError$name' => '<p>An error name for the error.</p>', 'ConfiguredTableAssociation$name' => '<p>The name of the configured table association, in lowercase. The table is identified by this name when running protected queries against the underlying data.</p>', 'ConfiguredTableAssociationSummary$name' => '<p>The name of the configured table association. The table is identified by this name when running Protected Queries against the underlying data.</p>', 'CreateConfiguredTableAssociationInput$name' => '<p>The name of the configured table association. This name is used to query the underlying configured table.</p>', 'GetSchemaAnalysisRuleInput$name' => '<p>The name of the schema to retrieve the analysis rule for.</p>', 'GetSchemaInput$name' => '<p>The name of the relation to retrieve the schema for.</p>', 'Schema$name' => '<p>A name for the schema. The schema relation is referred to by this name when queried by a protected query.</p>', 'SchemaSummary$name' => '<p>The name for the schema object.</p>', 'TableAliasList$member' => NULL, ], ], 'TableAliasList' => [ 'base' => NULL, 'refs' => [ 'BatchGetSchemaInput$names' => '<p>The names for the schema objects to retrieve.&gt;</p>', ], ], 'TableDescription' => [ 'base' => NULL, 'refs' => [ 'ConfiguredTable$description' => '<p>A description for the configured table.</p>', 'ConfiguredTableAssociation$description' => '<p>A description of the configured table association.</p>', 'CreateConfiguredTableAssociationInput$description' => '<p>A description for the configured table association.</p>', 'CreateConfiguredTableInput$description' => '<p>A description for the configured table.</p>', 'Schema$description' => '<p>A description for the schema.</p>', 'UpdateConfiguredTableAssociationInput$description' => '<p>A new description for the configured table association.</p>', 'UpdateConfiguredTableInput$description' => '<p>A new description for the configured table.</p>', ], ], 'TableReference' => [ 'base' => '<p>A pointer to the dataset that underlies this table. Currently, this can only be an Glue table.</p>', 'refs' => [ 'ConfiguredTable$tableReference' => '<p>The Glue table that this configured table represents.</p>', 'CreateConfiguredTableInput$tableReference' => '<p>A reference to the Glue table being configured.</p>', ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'TagKeys$member' => NULL, 'TagMap$key' => NULL, ], ], 'TagKeys' => [ 'base' => NULL, 'refs' => [ 'UntagResourceInput$tagKeys' => '<p>A list of key names of tags to be removed.</p>', ], ], 'TagMap' => [ 'base' => '<p>Map of tags assigned to a resource</p>', 'refs' => [ 'CreateCollaborationInput$tags' => '<p>An optional label that you can assign to a resource when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to this resource.</p>', 'CreateConfiguredTableAssociationInput$tags' => '<p>An optional label that you can assign to a resource when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to this resource.</p>', 'CreateConfiguredTableInput$tags' => '<p>An optional label that you can assign to a resource when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to this resource.</p>', 'CreateMembershipInput$tags' => '<p>An optional label that you can assign to a resource when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to this resource.</p>', 'ListTagsForResourceOutput$tags' => '<p>A map of objects specifying each key name and value.</p>', 'TagResourceInput$tags' => '<p>A map of objects specifying each key name and value.</p>', ], ], 'TagResourceInput' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceOutput' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'TagMap$value' => NULL, ], ], 'TargetProtectedQueryStatus' => [ 'base' => NULL, 'refs' => [ 'UpdateProtectedQueryInput$targetStatus' => '<p>The target status of a query. Used to update the execution status of a currently running query.</p>', ], ], 'ThrottlingException' => [ 'base' => '<p>Request was denied due to request throttling.</p>', 'refs' => [], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [ 'AnalysisRule$createTime' => '<p>The time the analysis rule was created.</p>', 'AnalysisRule$updateTime' => '<p>The time the analysis rule was last updated.</p>', 'Collaboration$createTime' => '<p>The time when the collaboration was created.</p>', 'Collaboration$updateTime' => '<p>The time the collaboration metadata was last updated.</p>', 'CollaborationSummary$createTime' => '<p>The time when the collaboration was created.</p>', 'CollaborationSummary$updateTime' => '<p>The time the collaboration metadata was last updated.</p>', 'ConfiguredTable$createTime' => '<p>The time the configured table was created.</p>', 'ConfiguredTable$updateTime' => '<p>The time the configured table was last updated</p>', 'ConfiguredTableAnalysisRule$createTime' => '<p>The time the configured table analysis rule was created.</p>', 'ConfiguredTableAnalysisRule$updateTime' => '<p>The time the configured table analysis rule was last updated.</p>', 'ConfiguredTableAssociation$createTime' => '<p>The time the configured table association was created.</p>', 'ConfiguredTableAssociation$updateTime' => '<p>The time the configured table association was last updated.</p>', 'ConfiguredTableAssociationSummary$createTime' => '<p>The time the configured table association was created.</p>', 'ConfiguredTableAssociationSummary$updateTime' => '<p>The time the configured table association was last updated.</p>', 'ConfiguredTableSummary$createTime' => '<p>The time the configured table was created.</p>', 'ConfiguredTableSummary$updateTime' => '<p>The time the configured table was last updated.</p>', 'MemberSummary$createTime' => '<p>The time when the member was created.</p>', 'MemberSummary$updateTime' => '<p>The time the member metadata was last updated.</p>', 'Membership$createTime' => '<p>The time when the membership was created.</p>', 'Membership$updateTime' => '<p>The time the membership metadata was last updated.</p>', 'MembershipSummary$createTime' => '<p>The time when the membership was created.</p>', 'MembershipSummary$updateTime' => '<p>The time the membership metadata was last updated.</p>', 'ProtectedQuery$createTime' => '<p>The time at which the protected query was created.</p>', 'ProtectedQuerySummary$createTime' => '<p>The time the protected query was created.</p>', 'Schema$createTime' => '<p>The time the schema was created.</p>', 'Schema$updateTime' => '<p>The time the schema was last updated.</p>', 'SchemaSummary$createTime' => '<p>The time the schema object was created.</p>', 'SchemaSummary$updateTime' => '<p>The time the schema object was last updated.</p>', ], ], 'UUID' => [ 'base' => NULL, 'refs' => [ 'Collaboration$id' => '<p>The unique ID for the collaboration.</p>', 'Collaboration$membershipId' => '<p>The unique ID for your membership within the collaboration.</p>', 'CollaborationSummary$id' => '<p>The identifier for the collaboration.</p>', 'CollaborationSummary$membershipId' => '<p>The identifier of a member in a collaboration.</p>', 'ConfiguredTable$id' => '<p>The unique ID for the configured table.</p>', 'ConfiguredTableAnalysisRule$configuredTableId' => '<p>The unique ID for the configured table.</p>', 'ConfiguredTableAssociation$id' => '<p>The unique ID for the configured table association.</p>', 'ConfiguredTableAssociation$configuredTableId' => '<p>The unique ID for the configured table that the association refers to.</p>', 'ConfiguredTableAssociation$membershipId' => '<p>The unique ID for the membership this configured table association belongs to.</p>', 'ConfiguredTableAssociationSummary$configuredTableId' => '<p>The unique configured table ID that this configured table association refers to.</p>', 'ConfiguredTableAssociationSummary$id' => '<p>The unique ID for the configured table association.</p>', 'MemberSummary$membershipId' => '<p>The unique ID for the member\\'s associated membership, if present.</p>', 'Membership$id' => '<p>The unique ID of the membership.</p>', 'Membership$collaborationId' => '<p>The unique ID for the membership\\'s collaboration.</p>', 'MembershipSummary$id' => '<p>The unique ID for the membership\\'s collaboration.</p>', 'ProtectedQuery$id' => '<p>The identifier for a protected query instance.</p>', 'ProtectedQuery$membershipId' => '<p>The identifier for the membership.</p>', 'ProtectedQuerySummary$id' => '<p>The unique ID of the protected query.</p>', 'ProtectedQuerySummary$membershipId' => '<p>The unique ID for the membership that initiated the protected query.</p>', 'Schema$collaborationId' => '<p>The unique ID for the collaboration that the schema belongs to.</p>', 'SchemaSummary$collaborationId' => '<p>The unique ID for the collaboration that the schema belongs to.</p>', ], ], 'UntagResourceInput' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateCollaborationInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateCollaborationOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateConfiguredTableAnalysisRuleInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateConfiguredTableAnalysisRuleOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateConfiguredTableAssociationInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateConfiguredTableAssociationOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateConfiguredTableInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateConfiguredTableOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateMembershipInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateMembershipOutput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateProtectedQueryInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateProtectedQueryOutput' => [ 'base' => NULL, 'refs' => [], ], 'ValidationException' => [ 'base' => '<p>The input fails to satisfy the specified constraints.</p>', 'refs' => [], ], 'ValidationExceptionField' => [ 'base' => '<p>Describes validation errors for specific input parameters.</p>', 'refs' => [ 'ValidationExceptionFieldList$member' => NULL, ], ], 'ValidationExceptionFieldList' => [ 'base' => NULL, 'refs' => [ 'ValidationException$fieldList' => '<p>Validation errors for specific input parameters.</p>', ], ], 'ValidationExceptionReason' => [ 'base' => NULL, 'refs' => [ 'ValidationException$reason' => '<p>A reason code for the exception.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cleanrooms/2022-02-17/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Region', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cleanrooms-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cleanrooms-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cleanrooms.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cleanrooms.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ], ], [ 'conditions' => [], 'error' => 'Invalid Configuration: Missing Region', 'type' => 'error', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cleanrooms/2022-02-17/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cleanrooms-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cleanrooms-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cleanrooms.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cleanrooms.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cleanrooms-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'cn-north-1', ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cleanrooms-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'cn-north-1', ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cleanrooms.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'cn-north-1', ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cleanrooms.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'cn-north-1', ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'us-iso-east-1', ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cleanrooms-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-iso-east-1', ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'us-iso-east-1', ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cleanrooms.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-iso-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cleanrooms-fips.us-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cleanrooms-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cleanrooms.us-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cleanrooms.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => true, 'Region' => 'us-isob-east-1', ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cleanrooms-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-isob-east-1', ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'error' => 'DualStack is enabled but this partition does not support DualStack', ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'us-isob-east-1', ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cleanrooms.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-isob-east-1', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => false, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'UseFIPS' => true, 'UseDualStack' => false, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'UseFIPS' => false, 'UseDualStack' => true, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cleanrooms/2022-02-17/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cleanrooms/2022-02-17/paginators-1.json\nreturn [ 'pagination' => [ 'ListCollaborations' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'collaborationList', ], 'ListConfiguredTableAssociations' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'configuredTableAssociationSummaries', ], 'ListConfiguredTables' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'configuredTableSummaries', ], 'ListMembers' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'memberSummaries', ], 'ListMemberships' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'membershipSummaries', ], 'ListProtectedQueries' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'protectedQueries', ], 'ListSchemas' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', 'result_key' => 'schemaSummaries', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cleanrooms/2022-02-17/smoke.json\nreturn [ 'version' => 1, 'defaultRegion' => 'us-west-2', 'testCases' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cleanrooms/2022-02-17/waiters-2.json\nreturn [ 'version' => 2, 'waiters' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cloud9/2017-09-23/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2017-09-23', 'endpointPrefix' => 'cloud9', 'jsonVersion' => '1.1', 'protocol' => 'json', 'serviceFullName' => 'AWS Cloud9', 'serviceId' => 'Cloud9', 'signatureVersion' => 'v4', 'targetPrefix' => 'AWSCloud9WorkspaceManagementService', 'uid' => 'cloud9-2017-09-23', ], 'operations' => [ 'CreateEnvironmentEC2' => [ 'name' => 'CreateEnvironmentEC2', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateEnvironmentEC2Request', ], 'output' => [ 'shape' => 'CreateEnvironmentEC2Result', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InternalServerErrorException', ], ], 'idempotent' => true, ], 'CreateEnvironmentMembership' => [ 'name' => 'CreateEnvironmentMembership', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateEnvironmentMembershipRequest', ], 'output' => [ 'shape' => 'CreateEnvironmentMembershipResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InternalServerErrorException', ], ], 'idempotent' => true, ], 'DeleteEnvironment' => [ 'name' => 'DeleteEnvironment', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteEnvironmentRequest', ], 'output' => [ 'shape' => 'DeleteEnvironmentResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InternalServerErrorException', ], ], 'idempotent' => true, ], 'DeleteEnvironmentMembership' => [ 'name' => 'DeleteEnvironmentMembership', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteEnvironmentMembershipRequest', ], 'output' => [ 'shape' => 'DeleteEnvironmentMembershipResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InternalServerErrorException', ], ], 'idempotent' => true, ], 'DescribeEnvironmentMemberships' => [ 'name' => 'DescribeEnvironmentMemberships', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeEnvironmentMembershipsRequest', ], 'output' => [ 'shape' => 'DescribeEnvironmentMembershipsResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'DescribeEnvironmentStatus' => [ 'name' => 'DescribeEnvironmentStatus', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeEnvironmentStatusRequest', ], 'output' => [ 'shape' => 'DescribeEnvironmentStatusResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'DescribeEnvironments' => [ 'name' => 'DescribeEnvironments', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeEnvironmentsRequest', ], 'output' => [ 'shape' => 'DescribeEnvironmentsResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'ListEnvironments' => [ 'name' => 'ListEnvironments', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListEnvironmentsRequest', ], 'output' => [ 'shape' => 'ListEnvironmentsResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InternalServerErrorException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'BadRequestException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentAccessException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'NotFoundException', ], [ 'shape' => 'InternalServerErrorException', ], [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConcurrentAccessException', ], ], ], 'UpdateEnvironment' => [ 'name' => 'UpdateEnvironment', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateEnvironmentRequest', ], 'output' => [ 'shape' => 'UpdateEnvironmentResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InternalServerErrorException', ], ], 'idempotent' => true, ], 'UpdateEnvironmentMembership' => [ 'name' => 'UpdateEnvironmentMembership', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateEnvironmentMembershipRequest', ], 'output' => [ 'shape' => 'UpdateEnvironmentMembershipResult', ], 'errors' => [ [ 'shape' => 'BadRequestException', ], [ 'shape' => 'ConflictException', ], [ 'shape' => 'NotFoundException', ], [ 'shape' => 'ForbiddenException', ], [ 'shape' => 'TooManyRequestsException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'InternalServerErrorException', ], ], 'idempotent' => true, ], ], 'shapes' => [ 'AutomaticStopTimeMinutes' => [ 'type' => 'integer', 'box' => true, 'max' => 20160, 'min' => 0, ], 'BadRequestException' => [ 'type' => 'structure', 'members' => [], 'exception' => true, ], 'BoundedEnvironmentIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'EnvironmentId', ], 'max' => 25, 'min' => 1, ], 'ClientRequestToken' => [ 'type' => 'string', 'pattern' => '[\\\\x20-\\\\x7E]{10,128}', ], 'ConcurrentAccessException' => [ 'type' => 'structure', 'members' => [], 'exception' => true, ], 'ConflictException' => [ 'type' => 'structure', 'members' => [], 'exception' => true, ], 'ConnectionType' => [ 'type' => 'string', 'enum' => [ 'CONNECT_SSH', 'CONNECT_SSM', ], ], 'CreateEnvironmentEC2Request' => [ 'type' => 'structure', 'required' => [ 'name', 'instanceType', ], 'members' => [ 'name' => [ 'shape' => 'EnvironmentName', ], 'description' => [ 'shape' => 'EnvironmentDescription', ], 'clientRequestToken' => [ 'shape' => 'ClientRequestToken', ], 'instanceType' => [ 'shape' => 'InstanceType', ], 'subnetId' => [ 'shape' => 'SubnetId', ], 'imageId' => [ 'shape' => 'ImageId', ], 'automaticStopTimeMinutes' => [ 'shape' => 'AutomaticStopTimeMinutes', ], 'ownerArn' => [ 'shape' => 'UserArn', ], 'tags' => [ 'shape' => 'TagList', ], 'connectionType' => [ 'shape' => 'ConnectionType', ], 'dryRun' => [ 'shape' => 'NullableBoolean', ], ], ], 'CreateEnvironmentEC2Result' => [ 'type' => 'structure', 'members' => [ 'environmentId' => [ 'shape' => 'EnvironmentId', ], ], ], 'CreateEnvironmentMembershipRequest' => [ 'type' => 'structure', 'required' => [ 'environmentId', 'userArn', 'permissions', ], 'members' => [ 'environmentId' => [ 'shape' => 'EnvironmentId', ], 'userArn' => [ 'shape' => 'UserArn', ], 'permissions' => [ 'shape' => 'MemberPermissions', ], ], ], 'CreateEnvironmentMembershipResult' => [ 'type' => 'structure', 'required' => [ 'membership', ], 'members' => [ 'membership' => [ 'shape' => 'EnvironmentMember', ], ], ], 'DeleteEnvironmentMembershipRequest' => [ 'type' => 'structure', 'required' => [ 'environmentId', 'userArn', ], 'members' => [ 'environmentId' => [ 'shape' => 'EnvironmentId', ], 'userArn' => [ 'shape' => 'UserArn', ], ], ], 'DeleteEnvironmentMembershipResult' => [ 'type' => 'structure', 'members' => [], ], 'DeleteEnvironmentRequest' => [ 'type' => 'structure', 'required' => [ 'environmentId', ], 'members' => [ 'environmentId' => [ 'shape' => 'EnvironmentId', ], ], ], 'DeleteEnvironmentResult' => [ 'type' => 'structure', 'members' => [], ], 'DescribeEnvironmentMembershipsRequest' => [ 'type' => 'structure', 'members' => [ 'userArn' => [ 'shape' => 'UserArn', ], 'environmentId' => [ 'shape' => 'EnvironmentId', ], 'permissions' => [ 'shape' => 'PermissionsList', ], 'nextToken' => [ 'shape' => 'String', ], 'maxResults' => [ 'shape' => 'MaxResults', ], ], ], 'DescribeEnvironmentMembershipsResult' => [ 'type' => 'structure', 'members' => [ 'memberships' => [ 'shape' => 'EnvironmentMembersList', ], 'nextToken' => [ 'shape' => 'String', ], ], ], 'DescribeEnvironmentStatusRequest' => [ 'type' => 'structure', 'required' => [ 'environmentId', ], 'members' => [ 'environmentId' => [ 'shape' => 'EnvironmentId', ], ], ], 'DescribeEnvironmentStatusResult' => [ 'type' => 'structure', 'required' => [ 'status', 'message', ], 'members' => [ 'status' => [ 'shape' => 'EnvironmentStatus', ], 'message' => [ 'shape' => 'String', ], ], ], 'DescribeEnvironmentsRequest' => [ 'type' => 'structure', 'required' => [ 'environmentIds', ], 'members' => [ 'environmentIds' => [ 'shape' => 'BoundedEnvironmentIdList', ], ], ], 'DescribeEnvironmentsResult' => [ 'type' => 'structure', 'members' => [ 'environments' => [ 'shape' => 'EnvironmentList', ], ], ], 'Environment' => [ 'type' => 'structure', 'required' => [ 'type', 'arn', 'ownerArn', ], 'members' => [ 'id' => [ 'shape' => 'EnvironmentId', ], 'name' => [ 'shape' => 'EnvironmentName', ], 'description' => [ 'shape' => 'EnvironmentDescription', ], 'type' => [ 'shape' => 'EnvironmentType', ], 'connectionType' => [ 'shape' => 'ConnectionType', ], 'arn' => [ 'shape' => 'String', ], 'ownerArn' => [ 'shape' => 'String', ], 'lifecycle' => [ 'shape' => 'EnvironmentLifecycle', ], 'managedCredentialsStatus' => [ 'shape' => 'ManagedCredentialsStatus', ], ], ], 'EnvironmentArn' => [ 'type' => 'string', 'pattern' => 'arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):cloud9:([a-z]{2}-[a-z]+-\\\\d{1}):[0-9]{12}:environment:[a-zA-Z0-9]{8,32}', ], 'EnvironmentDescription' => [ 'type' => 'string', 'max' => 200, 'sensitive' => true, ], 'EnvironmentId' => [ 'type' => 'string', 'pattern' => '^[a-zA-Z0-9]{8,32}$', ], 'EnvironmentIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'EnvironmentId', ], ], 'EnvironmentLifecycle' => [ 'type' => 'structure', 'members' => [ 'status' => [ 'shape' => 'EnvironmentLifecycleStatus', ], 'reason' => [ 'shape' => 'String', ], 'failureResource' => [ 'shape' => 'String', ], ], ], 'EnvironmentLifecycleStatus' => [ 'type' => 'string', 'enum' => [ 'CREATING', 'CREATED', 'CREATE_FAILED', 'DELETING', 'DELETE_FAILED', ], ], 'EnvironmentList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Environment', ], ], 'EnvironmentMember' => [ 'type' => 'structure', 'required' => [ 'permissions', 'userId', 'userArn', 'environmentId', ], 'members' => [ 'permissions' => [ 'shape' => 'Permissions', ], 'userId' => [ 'shape' => 'String', ], 'userArn' => [ 'shape' => 'UserArn', ], 'environmentId' => [ 'shape' => 'EnvironmentId', ], 'lastAccess' => [ 'shape' => 'Timestamp', ], ], ], 'EnvironmentMembersList' => [ 'type' => 'list', 'member' => [ 'shape' => 'EnvironmentMember', ], ], 'EnvironmentName' => [ 'type' => 'string', 'max' => 60, 'min' => 1, ], 'EnvironmentStatus' => [ 'type' => 'string', 'enum' => [ 'error', 'creating', 'connecting', 'ready', 'stopping', 'stopped', 'deleting', ], ], 'EnvironmentType' => [ 'type' => 'string', 'enum' => [ 'ssh', 'ec2', ], ], 'ForbiddenException' => [ 'type' => 'structure', 'members' => [], 'exception' => true, ], 'ImageId' => [ 'type' => 'string', 'max' => 512, ], 'InstanceType' => [ 'type' => 'string', 'max' => 20, 'min' => 5, 'pattern' => '^[a-z][1-9][.][a-z0-9]+$', ], 'InternalServerErrorException' => [ 'type' => 'structure', 'members' => [], 'exception' => true, 'fault' => true, ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [], 'exception' => true, ], 'ListEnvironmentsRequest' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'String', ], 'maxResults' => [ 'shape' => 'MaxResults', ], ], ], 'ListEnvironmentsResult' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'String', ], 'environmentIds' => [ 'shape' => 'EnvironmentIdList', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'EnvironmentArn', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], ], ], 'ManagedCredentialsAction' => [ 'type' => 'string', 'enum' => [ 'ENABLE', 'DISABLE', ], ], 'ManagedCredentialsStatus' => [ 'type' => 'string', 'enum' => [ 'ENABLED_ON_CREATE', 'ENABLED_BY_OWNER', 'DISABLED_BY_DEFAULT', 'DISABLED_BY_OWNER', 'DISABLED_BY_COLLABORATOR', 'PENDING_REMOVAL_BY_COLLABORATOR', 'PENDING_START_REMOVAL_BY_COLLABORATOR', 'PENDING_REMOVAL_BY_OWNER', 'PENDING_START_REMOVAL_BY_OWNER', 'FAILED_REMOVAL_BY_COLLABORATOR', 'FAILED_REMOVAL_BY_OWNER', ], ], 'MaxResults' => [ 'type' => 'integer', 'box' => true, 'max' => 25, 'min' => 0, ], 'MemberPermissions' => [ 'type' => 'string', 'enum' => [ 'read-write', 'read-only', ], ], 'NotFoundException' => [ 'type' => 'structure', 'members' => [], 'exception' => true, ], 'NullableBoolean' => [ 'type' => 'boolean', ], 'Permissions' => [ 'type' => 'string', 'enum' => [ 'owner', 'read-write', 'read-only', ], ], 'PermissionsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Permissions', ], ], 'String' => [ 'type' => 'string', ], 'SubnetId' => [ 'type' => 'string', 'max' => 24, 'min' => 15, 'pattern' => '^(subnet-[0-9a-f]{8}|subnet-[0-9a-f]{17})$', ], 'Tag' => [ 'type' => 'structure', 'required' => [ 'Key', 'Value', ], 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], 'sensitive' => true, ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'sensitive' => true, ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], 'max' => 200, 'min' => 0, 'sensitive' => true, ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], 'max' => 200, 'min' => 0, 'sensitive' => true, ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'Tags', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'EnvironmentArn', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 0, 'sensitive' => true, ], 'Timestamp' => [ 'type' => 'timestamp', ], 'TooManyRequestsException' => [ 'type' => 'structure', 'members' => [], 'exception' => true, ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceARN', 'TagKeys', ], 'members' => [ 'ResourceARN' => [ 'shape' => 'EnvironmentArn', ], 'TagKeys' => [ 'shape' => 'TagKeyList', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateEnvironmentMembershipRequest' => [ 'type' => 'structure', 'required' => [ 'environmentId', 'userArn', 'permissions', ], 'members' => [ 'environmentId' => [ 'shape' => 'EnvironmentId', ], 'userArn' => [ 'shape' => 'UserArn', ], 'permissions' => [ 'shape' => 'MemberPermissions', ], ], ], 'UpdateEnvironmentMembershipResult' => [ 'type' => 'structure', 'members' => [ 'membership' => [ 'shape' => 'EnvironmentMember', ], ], ], 'UpdateEnvironmentRequest' => [ 'type' => 'structure', 'required' => [ 'environmentId', ], 'members' => [ 'environmentId' => [ 'shape' => 'EnvironmentId', ], 'name' => [ 'shape' => 'EnvironmentName', ], 'description' => [ 'shape' => 'EnvironmentDescription', ], 'managedCredentialsAction' => [ 'shape' => 'ManagedCredentialsAction', ], ], ], 'UpdateEnvironmentResult' => [ 'type' => 'structure', 'members' => [], ], 'UserArn' => [ 'type' => 'string', 'pattern' => '^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):(iam|sts)::\\\\d+:(root|(user\\\\/[\\\\w+=/:,.@-]{1,64}|federated-user\\\\/[\\\\w+=/:,.@-]{2,32}|assumed-role\\\\/[\\\\w+=:,.@-]{1,64}\\\\/[\\\\w+=,.@-]{1,64}))$', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cloud9/2017-09-23/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<fullname>Cloud9</fullname> <p>Cloud9 is a collection of tools that you can use to code, build, run, test, debug, and release software in the cloud.</p> <p>For more information about Cloud9, see the <a href=\"https://docs.aws.amazon.com/cloud9/latest/user-guide\">Cloud9 User Guide</a>.</p> <p>Cloud9 supports these operations:</p> <ul> <li> <p> <code>CreateEnvironmentEC2</code>: Creates an Cloud9 development environment, launches an Amazon EC2 instance, and then connects from the instance to the environment.</p> </li> <li> <p> <code>CreateEnvironmentMembership</code>: Adds an environment member to an environment.</p> </li> <li> <p> <code>DeleteEnvironment</code>: Deletes an environment. If an Amazon EC2 instance is connected to the environment, also terminates the instance.</p> </li> <li> <p> <code>DeleteEnvironmentMembership</code>: Deletes an environment member from an environment.</p> </li> <li> <p> <code>DescribeEnvironmentMemberships</code>: Gets information about environment members for an environment.</p> </li> <li> <p> <code>DescribeEnvironments</code>: Gets information about environments.</p> </li> <li> <p> <code>DescribeEnvironmentStatus</code>: Gets status information for an environment.</p> </li> <li> <p> <code>ListEnvironments</code>: Gets a list of environment identifiers.</p> </li> <li> <p> <code>ListTagsForResource</code>: Gets the tags for an environment.</p> </li> <li> <p> <code>TagResource</code>: Adds tags to an environment.</p> </li> <li> <p> <code>UntagResource</code>: Removes tags from an environment.</p> </li> <li> <p> <code>UpdateEnvironment</code>: Changes the settings of an existing environment.</p> </li> <li> <p> <code>UpdateEnvironmentMembership</code>: Changes the settings of an existing environment member for an environment.</p> </li> </ul>', 'operations' => [ 'CreateEnvironmentEC2' => '<p>Creates an Cloud9 development environment, launches an Amazon Elastic Compute Cloud (Amazon EC2) instance, and then connects from the instance to the environment.</p>', 'CreateEnvironmentMembership' => '<p>Adds an environment member to an Cloud9 development environment.</p>', 'DeleteEnvironment' => '<p>Deletes an Cloud9 development environment. If an Amazon EC2 instance is connected to the environment, also terminates the instance.</p>', 'DeleteEnvironmentMembership' => '<p>Deletes an environment member from a development environment.</p>', 'DescribeEnvironmentMemberships' => '<p>Gets information about environment members for an Cloud9 development environment.</p>', 'DescribeEnvironmentStatus' => '<p>Gets status information for an Cloud9 development environment.</p>', 'DescribeEnvironments' => '<p>Gets information about Cloud9 development environments.</p>', 'ListEnvironments' => '<p>Gets a list of Cloud9 development environment identifiers.</p>', 'ListTagsForResource' => '<p>Gets a list of the tags associated with an Cloud9 development environment.</p>', 'TagResource' => '<p>Adds tags to an Cloud9 development environment.</p> <important> <p>Tags that you add to an Cloud9 environment by using this method will NOT be automatically propagated to underlying resources.</p> </important>', 'UntagResource' => '<p>Removes tags from an Cloud9 development environment.</p>', 'UpdateEnvironment' => '<p>Changes the settings of an existing Cloud9 development environment.</p>', 'UpdateEnvironmentMembership' => '<p>Changes the settings of an existing environment member for an Cloud9 development environment.</p>', ], 'shapes' => [ 'AutomaticStopTimeMinutes' => [ 'base' => NULL, 'refs' => [ 'CreateEnvironmentEC2Request$automaticStopTimeMinutes' => '<p>The number of minutes until the running instance is shut down after the environment has last been used.</p>', ], ], 'BadRequestException' => [ 'base' => '<p>The target request is invalid.</p>', 'refs' => [], ], 'BoundedEnvironmentIdList' => [ 'base' => NULL, 'refs' => [ 'DescribeEnvironmentsRequest$environmentIds' => '<p>The IDs of individual environments to get information about.</p>', ], ], 'ClientRequestToken' => [ 'base' => NULL, 'refs' => [ 'CreateEnvironmentEC2Request$clientRequestToken' => '<p>A unique, case-sensitive string that helps Cloud9 to ensure this operation completes no more than one time.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html\">Client Tokens</a> in the <i>Amazon EC2 API Reference</i>.</p>', ], ], 'ConcurrentAccessException' => [ 'base' => '<p>A concurrent access issue occurred.</p>', 'refs' => [], ], 'ConflictException' => [ 'base' => '<p>A conflict occurred.</p>', 'refs' => [], ], 'ConnectionType' => [ 'base' => NULL, 'refs' => [ 'CreateEnvironmentEC2Request$connectionType' => '<p>The connection type used for connecting to an Amazon EC2 environment. Valid values are <code>CONNECT_SSH</code> (default) and <code>CONNECT_SSM</code> (connected through Amazon EC2 Systems Manager).</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloud9/latest/user-guide/ec2-ssm.html\">Accessing no-ingress EC2 instances with Amazon EC2 Systems Manager</a> in the <i>Cloud9 User Guide</i>.</p>', 'Environment$connectionType' => '<p>The connection type used for connecting to an Amazon EC2 environment. <code>CONNECT_SSH</code> is selected by default.</p>', ], ], 'CreateEnvironmentEC2Request' => [ 'base' => NULL, 'refs' => [], ], 'CreateEnvironmentEC2Result' => [ 'base' => NULL, 'refs' => [], ], 'CreateEnvironmentMembershipRequest' => [ 'base' => NULL, 'refs' => [], ], 'CreateEnvironmentMembershipResult' => [ 'base' => NULL, 'refs' => [], ], 'DeleteEnvironmentMembershipRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteEnvironmentMembershipResult' => [ 'base' => NULL, 'refs' => [], ], 'DeleteEnvironmentRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteEnvironmentResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeEnvironmentMembershipsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeEnvironmentMembershipsResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeEnvironmentStatusRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeEnvironmentStatusResult' => [ 'base' => NULL, 'refs' => [], ], 'DescribeEnvironmentsRequest' => [ 'base' => NULL, 'refs' => [], ], 'DescribeEnvironmentsResult' => [ 'base' => NULL, 'refs' => [], ], 'Environment' => [ 'base' => '<p>Information about an Cloud9 development environment.</p>', 'refs' => [ 'EnvironmentList$member' => NULL, ], ], 'EnvironmentArn' => [ 'base' => NULL, 'refs' => [ 'ListTagsForResourceRequest$ResourceARN' => '<p>The Amazon Resource Name (ARN) of the Cloud9 development environment to get the tags for.</p>', 'TagResourceRequest$ResourceARN' => '<p>The Amazon Resource Name (ARN) of the Cloud9 development environment to add tags to.</p>', 'UntagResourceRequest$ResourceARN' => '<p>The Amazon Resource Name (ARN) of the Cloud9 development environment to remove tags from.</p>', ], ], 'EnvironmentDescription' => [ 'base' => NULL, 'refs' => [ 'CreateEnvironmentEC2Request$description' => '<p>The description of the environment to create.</p>', 'Environment$description' => '<p>The description for the environment.</p>', 'UpdateEnvironmentRequest$description' => '<p>Any new or replacement description for the environment.</p>', ], ], 'EnvironmentId' => [ 'base' => NULL, 'refs' => [ 'BoundedEnvironmentIdList$member' => NULL, 'CreateEnvironmentEC2Result$environmentId' => '<p>The ID of the environment that was created.</p>', 'CreateEnvironmentMembershipRequest$environmentId' => '<p>The ID of the environment that contains the environment member you want to add.</p>', 'DeleteEnvironmentMembershipRequest$environmentId' => '<p>The ID of the environment to delete the environment member from.</p>', 'DeleteEnvironmentRequest$environmentId' => '<p>The ID of the environment to delete.</p>', 'DescribeEnvironmentMembershipsRequest$environmentId' => '<p>The ID of the environment to get environment member information about.</p>', 'DescribeEnvironmentStatusRequest$environmentId' => '<p>The ID of the environment to get status information about.</p>', 'Environment$id' => '<p>The ID of the environment.</p>', 'EnvironmentIdList$member' => NULL, 'EnvironmentMember$environmentId' => '<p>The ID of the environment for the environment member.</p>', 'UpdateEnvironmentMembershipRequest$environmentId' => '<p>The ID of the environment for the environment member whose settings you want to change.</p>', 'UpdateEnvironmentRequest$environmentId' => '<p>The ID of the environment to change settings.</p>', ], ], 'EnvironmentIdList' => [ 'base' => NULL, 'refs' => [ 'ListEnvironmentsResult$environmentIds' => '<p>The list of environment identifiers.</p>', ], ], 'EnvironmentLifecycle' => [ 'base' => '<p>Information about the current creation or deletion lifecycle state of an Cloud9 development environment.</p>', 'refs' => [ 'Environment$lifecycle' => '<p>The state of the environment in its creation or deletion lifecycle.</p>', ], ], 'EnvironmentLifecycleStatus' => [ 'base' => NULL, 'refs' => [ 'EnvironmentLifecycle$status' => '<p>The current creation or deletion lifecycle state of the environment.</p> <ul> <li> <p> <code>CREATING</code>: The environment is in the process of being created.</p> </li> <li> <p> <code>CREATED</code>: The environment was successfully created.</p> </li> <li> <p> <code>CREATE_FAILED</code>: The environment failed to be created.</p> </li> <li> <p> <code>DELETING</code>: The environment is in the process of being deleted.</p> </li> <li> <p> <code>DELETE_FAILED</code>: The environment failed to delete.</p> </li> </ul>', ], ], 'EnvironmentList' => [ 'base' => NULL, 'refs' => [ 'DescribeEnvironmentsResult$environments' => '<p>Information about the environments that are returned.</p>', ], ], 'EnvironmentMember' => [ 'base' => '<p>Information about an environment member for an Cloud9 development environment.</p>', 'refs' => [ 'CreateEnvironmentMembershipResult$membership' => '<p>Information about the environment member that was added.</p>', 'EnvironmentMembersList$member' => NULL, 'UpdateEnvironmentMembershipResult$membership' => '<p>Information about the environment member whose settings were changed.</p>', ], ], 'EnvironmentMembersList' => [ 'base' => NULL, 'refs' => [ 'DescribeEnvironmentMembershipsResult$memberships' => '<p>Information about the environment members for the environment.</p>', ], ], 'EnvironmentName' => [ 'base' => NULL, 'refs' => [ 'CreateEnvironmentEC2Request$name' => '<p>The name of the environment to create.</p> <p>This name is visible to other IAM users in the same Amazon Web Services account.</p>', 'Environment$name' => '<p>The name of the environment.</p>', 'UpdateEnvironmentRequest$name' => '<p>A replacement name for the environment.</p>', ], ], 'EnvironmentStatus' => [ 'base' => NULL, 'refs' => [ 'DescribeEnvironmentStatusResult$status' => '<p>The status of the environment. Available values include:</p> <ul> <li> <p> <code>connecting</code>: The environment is connecting.</p> </li> <li> <p> <code>creating</code>: The environment is being created.</p> </li> <li> <p> <code>deleting</code>: The environment is being deleted.</p> </li> <li> <p> <code>error</code>: The environment is in an error state.</p> </li> <li> <p> <code>ready</code>: The environment is ready.</p> </li> <li> <p> <code>stopped</code>: The environment is stopped.</p> </li> <li> <p> <code>stopping</code>: The environment is stopping.</p> </li> </ul>', ], ], 'EnvironmentType' => [ 'base' => NULL, 'refs' => [ 'Environment$type' => '<p>The type of environment. Valid values include the following:</p> <ul> <li> <p> <code>ec2</code>: An Amazon Elastic Compute Cloud (Amazon EC2) instance connects to the environment.</p> </li> <li> <p> <code>ssh</code>: Your own server connects to the environment.</p> </li> </ul>', ], ], 'ForbiddenException' => [ 'base' => '<p>An access permissions issue occurred.</p>', 'refs' => [], ], 'ImageId' => [ 'base' => NULL, 'refs' => [ 'CreateEnvironmentEC2Request$imageId' => '<p>The identifier for the Amazon Machine Image (AMI) that\\'s used to create the EC2 instance. To choose an AMI for the instance, you must specify a valid AMI alias or a valid Amazon EC2 Systems Manager (SSM) path.</p> <p>The default Amazon Linux AMI is currently used if the parameter isn\\'t explicitly assigned a value in the request. </p> <p>In the future the parameter for Amazon Linux will no longer be available when you specify an AMI for your instance. Amazon Linux 2 will then become the default AMI, which is used to launch your instance if no parameter is explicitly defined.</p> <p> <b>AMI aliases </b> </p> <ul> <li> <p> <b>Amazon Linux (default): <code>amazonlinux-1-x86_64</code> </b> </p> </li> <li> <p>Amazon Linux 2: <code>amazonlinux-2-x86_64</code> </p> </li> <li> <p>Ubuntu 18.04: <code>ubuntu-18.04-x86_64</code> </p> </li> </ul> <p> <b>SSM paths</b> </p> <ul> <li> <p> <b>Amazon Linux (default): <code>resolve:ssm:/aws/service/cloud9/amis/amazonlinux-1-x86_64</code> </b> </p> </li> <li> <p>Amazon Linux 2: <code>resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2-x86_64</code> </p> </li> <li> <p>Ubuntu 18.04: <code>resolve:ssm:/aws/service/cloud9/amis/ubuntu-18.04-x86_64</code> </p> </li> </ul>', ], ], 'InstanceType' => [ 'base' => NULL, 'refs' => [ 'CreateEnvironmentEC2Request$instanceType' => '<p>The type of instance to connect to the environment (for example, <code>t2.micro</code>).</p>', ], ], 'InternalServerErrorException' => [ 'base' => '<p>An internal server error occurred.</p>', 'refs' => [], ], 'LimitExceededException' => [ 'base' => '<p>A service limit was exceeded.</p>', 'refs' => [], ], 'ListEnvironmentsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListEnvironmentsResult' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListTagsForResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'ManagedCredentialsAction' => [ 'base' => NULL, 'refs' => [ 'UpdateEnvironmentRequest$managedCredentialsAction' => '<p>Allows the environment owner to turn on or turn off the Amazon Web Services managed temporary credentials for an Cloud9 environment by using one of the following values:</p> <ul> <li> <p> <code>ENABLE</code> </p> </li> <li> <p> <code>DISABLE</code> </p> </li> </ul> <note> <p>Only the environment owner can change the status of managed temporary credentials. An <code>AccessDeniedException</code> is thrown if an attempt to turn on or turn off managed temporary credentials is made by an account that\\'s not the environment owner.</p> </note>', ], ], 'ManagedCredentialsStatus' => [ 'base' => NULL, 'refs' => [ 'Environment$managedCredentialsStatus' => '<p>Describes the status of Amazon Web Services managed temporary credentials for the Cloud9 environment. Available values are:</p> <ul> <li> <p> <code>ENABLED_ON_CREATE</code> </p> </li> <li> <p> <code>ENABLED_BY_OWNER</code> </p> </li> <li> <p> <code>DISABLED_BY_DEFAULT</code> </p> </li> <li> <p> <code>DISABLED_BY_OWNER</code> </p> </li> <li> <p> <code>DISABLED_BY_COLLABORATOR</code> </p> </li> <li> <p> <code>PENDING_REMOVAL_BY_COLLABORATOR</code> </p> </li> <li> <p> <code>PENDING_REMOVAL_BY_OWNER</code> </p> </li> <li> <p> <code>FAILED_REMOVAL_BY_COLLABORATOR</code> </p> </li> <li> <p> <code>ENABLED_BY_OWNER</code> </p> </li> <li> <p> <code>DISABLED_BY_DEFAULT</code> </p> </li> </ul>', ], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'DescribeEnvironmentMembershipsRequest$maxResults' => '<p>The maximum number of environment members to get information about.</p>', 'ListEnvironmentsRequest$maxResults' => '<p>The maximum number of environments to get identifiers for.</p>', ], ], 'MemberPermissions' => [ 'base' => NULL, 'refs' => [ 'CreateEnvironmentMembershipRequest$permissions' => '<p>The type of environment member permissions you want to associate with this environment member. Available values include:</p> <ul> <li> <p> <code>read-only</code>: Has read-only access to the environment.</p> </li> <li> <p> <code>read-write</code>: Has read-write access to the environment.</p> </li> </ul>', 'UpdateEnvironmentMembershipRequest$permissions' => '<p>The replacement type of environment member permissions you want to associate with this environment member. Available values include:</p> <ul> <li> <p> <code>read-only</code>: Has read-only access to the environment.</p> </li> <li> <p> <code>read-write</code>: Has read-write access to the environment.</p> </li> </ul>', ], ], 'NotFoundException' => [ 'base' => '<p>The target resource cannot be found.</p>', 'refs' => [], ], 'NullableBoolean' => [ 'base' => NULL, 'refs' => [ 'CreateEnvironmentEC2Request$dryRun' => '<p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>', ], ], 'Permissions' => [ 'base' => NULL, 'refs' => [ 'EnvironmentMember$permissions' => '<p>The type of environment member permissions associated with this environment member. Available values include:</p> <ul> <li> <p> <code>owner</code>: Owns the environment.</p> </li> <li> <p> <code>read-only</code>: Has read-only access to the environment.</p> </li> <li> <p> <code>read-write</code>: Has read-write access to the environment.</p> </li> </ul>', 'PermissionsList$member' => NULL, ], ], 'PermissionsList' => [ 'base' => NULL, 'refs' => [ 'DescribeEnvironmentMembershipsRequest$permissions' => '<p>The type of environment member permissions to get information about. Available values include:</p> <ul> <li> <p> <code>owner</code>: Owns the environment.</p> </li> <li> <p> <code>read-only</code>: Has read-only access to the environment.</p> </li> <li> <p> <code>read-write</code>: Has read-write access to the environment.</p> </li> </ul> <p>If no value is specified, information about all environment members are returned.</p>', ], ], 'String' => [ 'base' => NULL, 'refs' => [ 'DescribeEnvironmentMembershipsRequest$nextToken' => '<p>During a previous call, if there are more than 25 items in the list, only the first 25 items are returned, along with a unique string called a <i>next token</i>. To get the next batch of items in the list, call this operation again, adding the next token to the call. To get all of the items in the list, keep calling this operation with each subsequent next token that is returned, until no more next tokens are returned.</p>', 'DescribeEnvironmentMembershipsResult$nextToken' => '<p>If there are more than 25 items in the list, only the first 25 items are returned, along with a unique string called a <i>next token</i>. To get the next batch of items in the list, call this operation again, adding the next token to the call.</p>', 'DescribeEnvironmentStatusResult$message' => '<p>Any informational message about the status of the environment.</p>', 'Environment$arn' => '<p>The Amazon Resource Name (ARN) of the environment.</p>', 'Environment$ownerArn' => '<p>The Amazon Resource Name (ARN) of the environment owner.</p>', 'EnvironmentLifecycle$reason' => '<p>Any informational message about the lifecycle state of the environment.</p>', 'EnvironmentLifecycle$failureResource' => '<p>If the environment failed to delete, the Amazon Resource Name (ARN) of the related Amazon Web Services resource.</p>', 'EnvironmentMember$userId' => '<p>The user ID in Identity and Access Management (IAM) of the environment member.</p>', 'ListEnvironmentsRequest$nextToken' => '<p>During a previous call, if there are more than 25 items in the list, only the first 25 items are returned, along with a unique string called a <i>next token</i>. To get the next batch of items in the list, call this operation again, adding the next token to the call. To get all of the items in the list, keep calling this operation with each subsequent next token that is returned, until no more next tokens are returned.</p>', 'ListEnvironmentsResult$nextToken' => '<p>If there are more than 25 items in the list, only the first 25 items are returned, along with a unique string called a <i>next token</i>. To get the next batch of items in the list, call this operation again, adding the next token to the call.</p>', ], ], 'SubnetId' => [ 'base' => NULL, 'refs' => [ 'CreateEnvironmentEC2Request$subnetId' => '<p>The ID of the subnet in Amazon VPC that Cloud9 will use to communicate with the Amazon EC2 instance.</p>', ], ], 'Tag' => [ 'base' => '<p>Metadata that is associated with Amazon Web Services resources. In particular, a name-value pair that can be associated with an Cloud9 development environment. There are two types of tags: <i>user tags</i> and <i>system tags</i>. A user tag is created by the user. A system tag is automatically created by Amazon Web Services services. A system tag is prefixed with <code>\"aws:\"</code> and cannot be modified by the user.</p>', 'refs' => [ 'TagList$member' => NULL, ], ], 'TagKey' => [ 'base' => NULL, 'refs' => [ 'Tag$Key' => '<p>The <b>name</b> part of a tag.</p>', 'TagKeyList$member' => NULL, ], ], 'TagKeyList' => [ 'base' => NULL, 'refs' => [ 'UntagResourceRequest$TagKeys' => '<p>The tag names of the tags to remove from the given Cloud9 development environment.</p>', ], ], 'TagList' => [ 'base' => NULL, 'refs' => [ 'CreateEnvironmentEC2Request$tags' => '<p>An array of key-value pairs that will be associated with the new Cloud9 development environment.</p>', 'ListTagsForResourceResponse$Tags' => '<p>The list of tags associated with the Cloud9 development environment.</p>', 'TagResourceRequest$Tags' => '<p>The list of tags to add to the given Cloud9 development environment.</p>', ], ], 'TagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'TagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'TagValue' => [ 'base' => NULL, 'refs' => [ 'Tag$Value' => '<p>The <b>value</b> part of a tag.</p>', ], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [ 'EnvironmentMember$lastAccess' => '<p>The time, expressed in epoch time format, when the environment member last opened the environment.</p>', ], ], 'TooManyRequestsException' => [ 'base' => '<p>Too many service requests were made over the given time period.</p>', 'refs' => [], ], 'UntagResourceRequest' => [ 'base' => NULL, 'refs' => [], ], 'UntagResourceResponse' => [ 'base' => NULL, 'refs' => [], ], 'UpdateEnvironmentMembershipRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateEnvironmentMembershipResult' => [ 'base' => NULL, 'refs' => [], ], 'UpdateEnvironmentRequest' => [ 'base' => NULL, 'refs' => [], ], 'UpdateEnvironmentResult' => [ 'base' => NULL, 'refs' => [], ], 'UserArn' => [ 'base' => NULL, 'refs' => [ 'CreateEnvironmentEC2Request$ownerArn' => '<p>The Amazon Resource Name (ARN) of the environment owner. This ARN can be the ARN of any IAM principal. If this value is not specified, the ARN defaults to this environment\\'s creator.</p>', 'CreateEnvironmentMembershipRequest$userArn' => '<p>The Amazon Resource Name (ARN) of the environment member you want to add.</p>', 'DeleteEnvironmentMembershipRequest$userArn' => '<p>The Amazon Resource Name (ARN) of the environment member to delete from the environment.</p>', 'DescribeEnvironmentMembershipsRequest$userArn' => '<p>The Amazon Resource Name (ARN) of an individual environment member to get information about. If no value is specified, information about all environment members are returned.</p>', 'EnvironmentMember$userArn' => '<p>The Amazon Resource Name (ARN) of the environment member.</p>', 'UpdateEnvironmentMembershipRequest$userArn' => '<p>The Amazon Resource Name (ARN) of the environment member whose settings you want to change.</p>', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cloud9/2017-09-23/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => true, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cloud9-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cloud9-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cloud9.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cloud9.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cloud9/2017-09-23/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.ap-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.ap-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.ap-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.ap-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.eu-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.eu-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.eu-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.eu-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.ca-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ca-central-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.ca-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ca-central-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.ca-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ca-central-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.ca-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ca-central-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.eu-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-central-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.eu-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-central-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.eu-central-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-central-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.eu-central-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-central-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.us-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.us-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.us-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.us-west-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-west-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-west-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.us-west-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-west-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-west-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.af-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'af-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.af-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'af-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.af-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'af-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.af-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'af-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.eu-north-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-north-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.eu-north-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-north-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.eu-north-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-north-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.eu-north-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-north-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.eu-west-3.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-3', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.eu-west-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-3', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.eu-west-3.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-3', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.eu-west-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-3', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.eu-west-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.eu-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.eu-west-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.eu-west-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.eu-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.eu-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'eu-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.eu-west-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.eu-west-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'eu-west-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.ap-northeast-3.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-3', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-3', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.ap-northeast-3.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-3', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-3', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.ap-northeast-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.ap-northeast-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.ap-northeast-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-northeast-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.ap-northeast-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-northeast-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.me-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'me-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.me-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'me-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.me-south-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'me-south-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.me-south-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'me-south-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.sa-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'sa-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.sa-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'sa-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.sa-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'sa-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.sa-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'sa-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.ap-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.ap-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.ap-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.ap-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.ap-southeast-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.ap-southeast-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.ap-southeast-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'ap-southeast-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.ap-southeast-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'ap-southeast-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.us-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.us-east-1.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-1', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-1', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.us-east-2.api.aws', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.us-east-2.api.aws', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-2', 'UseDualStack' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloud9.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-2', 'UseDualStack' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-1', 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'UseFIPS' => true, 'Region' => 'us-east-1', 'UseDualStack' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'UseFIPS' => false, 'Region' => 'us-east-1', 'UseDualStack' => true, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cloud9/2017-09-23/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [ 'CreateEnvironmentEC2' => [ [ 'input' => [ 'name' => 'my-demo-environment', 'automaticStopTimeMinutes' => 60, 'description' => 'This is my demonstration environment.', 'instanceType' => 't2.micro', 'ownerArn' => 'arn:aws:iam::123456789012:user/MyDemoUser', 'subnetId' => 'subnet-6300cd1b', ], 'output' => [ 'environmentId' => '8d9967e2f0624182b74e7690ad69ebEX', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => '', 'id' => 'createenvironmentec2-1516821730547', 'title' => 'CreateEnvironmentEC2', ], ], 'CreateEnvironmentMembership' => [ [ 'input' => [ 'environmentId' => '8d9967e2f0624182b74e7690ad69ebEX', 'permissions' => 'read-write', 'userArn' => 'arn:aws:iam::123456789012:user/AnotherDemoUser', ], 'output' => [ 'membership' => [ 'environmentId' => '8d9967e2f0624182b74e7690ad69ebEX', 'permissions' => 'read-write', 'userArn' => 'arn:aws:iam::123456789012:user/AnotherDemoUser', 'userId' => 'AIDAJ3BA6O2FMJWCWXHEX', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => '', 'id' => 'createenvironmentmembership-1516822583452', 'title' => 'CreateEnvironmentMembership', ], ], 'DeleteEnvironment' => [ [ 'input' => [ 'environmentId' => '8d9967e2f0624182b74e7690ad69ebEX', ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => '', 'id' => 'deleteenvironment-1516822903149', 'title' => 'DeleteEnvironment', ], ], 'DeleteEnvironmentMembership' => [ [ 'input' => [ 'environmentId' => '8d9967e2f0624182b74e7690ad69ebEX', 'userArn' => 'arn:aws:iam::123456789012:user/AnotherDemoUser', ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => '', 'id' => 'deleteenvironmentmembership-1516822975655', 'title' => 'DeleteEnvironmentMembership', ], ], 'DescribeEnvironmentMemberships' => [ [ 'input' => [ 'environmentId' => '8d9967e2f0624182b74e7690ad69ebEX', ], 'output' => [ 'memberships' => [ [ 'environmentId' => '8d9967e2f0624182b74e7690ad69ebEX', 'permissions' => 'read-write', 'userArn' => 'arn:aws:iam::123456789012:user/AnotherDemoUser', 'userId' => 'AIDAJ3BA6O2FMJWCWXHEX', ], [ 'environmentId' => '8d9967e2f0624182b74e7690ad69ebEX', 'permissions' => 'owner', 'userArn' => 'arn:aws:iam::123456789012:user/MyDemoUser', 'userId' => 'AIDAJNUEDQAQWFELJDLEX', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'The following example gets information about all of the environment members for the specified development environment.', 'id' => 'describeenvironmentmemberships1-1516823070453', 'title' => 'DescribeEnvironmentMemberships1', ], [ 'input' => [ 'environmentId' => '8d9967e2f0624182b74e7690ad69ebEX', 'permissions' => [ 'owner', ], ], 'output' => [ 'memberships' => [ [ 'environmentId' => '8d9967e2f0624182b74e7690ad69ebEX', 'permissions' => 'owner', 'userArn' => 'arn:aws:iam::123456789012:user/MyDemoUser', 'userId' => 'AIDAJNUEDQAQWFELJDLEX', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'The following example gets information about the owner of the specified development environment.', 'id' => 'describeenvironmentmemberships2-1516823191355', 'title' => 'DescribeEnvironmentMemberships2', ], [ 'input' => [ 'userArn' => 'arn:aws:iam::123456789012:user/MyDemoUser', ], 'output' => [ 'memberships' => [ [ 'environmentId' => '10a75714bd494714929e7f5ec4125aEX', 'lastAccess' => '2018-01-19T11:06:13Z', 'permissions' => 'owner', 'userArn' => 'arn:aws:iam::123456789012:user/MyDemoUser', 'userId' => 'AIDAJNUEDQAQWFELJDLEX', ], [ 'environmentId' => '12bfc3cd537f41cb9776f8af5525c9EX', 'lastAccess' => '2018-01-19T11:39:19Z', 'permissions' => 'owner', 'userArn' => 'arn:aws:iam::123456789012:user/MyDemoUser', 'userId' => 'AIDAJNUEDQAQWFELJDLEX', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => 'The following example gets development environment membership information for the specified user.', 'id' => 'describeenvironmentmemberships3-1516823268793', 'title' => 'DescribeEnvironmentMemberships3', ], ], 'DescribeEnvironmentStatus' => [ [ 'input' => [ 'environmentId' => '8d9967e2f0624182b74e7690ad69ebEX', ], 'output' => [ 'message' => 'Environment is ready to use', 'status' => 'ready', ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => '', 'id' => 'describeenvironmentstatus-1516823462133', 'title' => 'DescribeEnvironmentStatus', ], ], 'DescribeEnvironments' => [ [ 'input' => [ 'environmentIds' => [ '8d9967e2f0624182b74e7690ad69ebEX', '349c86d4579e4e7298d500ff57a6b2EX', ], ], 'output' => [ 'environments' => [ [ 'name' => 'my-demo-environment', 'type' => 'ec2', 'arn' => 'arn:aws:cloud9:us-east-2:123456789012:environment:8d9967e2f0624182b74e7690ad69ebEX', 'description' => 'This is my demonstration environment.', 'id' => '8d9967e2f0624182b74e7690ad69ebEX', 'lifecycle' => [ 'status' => 'CREATED', ], 'ownerArn' => 'arn:aws:iam::123456789012:user/MyDemoUser', ], [ 'name' => 'another-demo-environment', 'type' => 'ssh', 'arn' => 'arn:aws:cloud9:us-east-2:123456789012:environment:349c86d4579e4e7298d500ff57a6b2EX', 'description' => '', 'id' => '349c86d4579e4e7298d500ff57a6b2EX', 'lifecycle' => [ 'status' => 'CREATED', ], 'ownerArn' => 'arn:aws:sts::123456789012:assumed-role/AnotherDemoUser/AnotherDemoUser', ], ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => '', 'id' => 'describeenvironments-1516823568291', 'title' => 'DescribeEnvironments', ], ], 'ListEnvironments' => [ [ 'input' => [], 'output' => [ 'environmentIds' => [ '349c86d4579e4e7298d500ff57a6b2EX', '45a3da47af0840f2b0c0824f5ee232EX', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => '', 'id' => 'listenvironments-1516823687205', 'title' => 'ListEnvironments', ], ], 'UpdateEnvironment' => [ [ 'input' => [ 'name' => 'my-changed-demo-environment', 'description' => 'This is my changed demonstration environment.', 'environmentId' => '8d9967e2f0624182b74e7690ad69ebEX', ], 'output' => [], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => '', 'id' => 'updateenvironment-1516823781910', 'title' => 'UpdateEnvironment', ], ], 'UpdateEnvironmentMembership' => [ [ 'input' => [ 'environmentId' => '8d9967e2f0624182b74e7690ad69ebEX', 'permissions' => 'read-only', 'userArn' => 'arn:aws:iam::123456789012:user/AnotherDemoUser', ], 'output' => [ 'membership' => [ 'environmentId' => '8d9967e2f0624182b74e7690ad69eb31', 'permissions' => 'read-only', 'userArn' => 'arn:aws:iam::123456789012:user/AnotherDemoUser', 'userId' => 'AIDAJ3BA6O2FMJWCWXHEX', ], ], 'comments' => [ 'input' => [], 'output' => [], ], 'description' => '', 'id' => 'updateenvironmentmembership-1516823876645', 'title' => 'UpdateEnvironmentMembership', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cloud9/2017-09-23/paginators-1.json\nreturn [ 'pagination' => [ 'DescribeEnvironmentMemberships' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], 'ListEnvironments' => [ 'input_token' => 'nextToken', 'output_token' => 'nextToken', 'limit_key' => 'maxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cloudcontrol/2021-09-30/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2021-09-30', 'endpointPrefix' => 'cloudcontrolapi', 'jsonVersion' => '1.0', 'protocol' => 'json', 'serviceAbbreviation' => 'CloudControlApi', 'serviceFullName' => 'AWS Cloud Control API', 'serviceId' => 'CloudControl', 'signatureVersion' => 'v4', 'signingName' => 'cloudcontrolapi', 'targetPrefix' => 'CloudApiService', 'uid' => 'cloudcontrol-2021-09-30', ], 'operations' => [ 'CancelResourceRequest' => [ 'name' => 'CancelResourceRequest', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CancelResourceRequestInput', ], 'output' => [ 'shape' => 'CancelResourceRequestOutput', ], 'errors' => [ [ 'shape' => 'ConcurrentModificationException', ], [ 'shape' => 'RequestTokenNotFoundException', ], ], 'idempotent' => true, ], 'CreateResource' => [ 'name' => 'CreateResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateResourceInput', ], 'output' => [ 'shape' => 'CreateResourceOutput', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'HandlerInternalFailureException', ], [ 'shape' => 'GeneralServiceException', ], [ 'shape' => 'NotUpdatableException', ], [ 'shape' => 'TypeNotFoundException', ], [ 'shape' => 'ConcurrentOperationException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'PrivateTypeException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'NetworkFailureException', ], [ 'shape' => 'UnsupportedActionException', ], [ 'shape' => 'NotStabilizedException', ], [ 'shape' => 'ServiceInternalErrorException', ], [ 'shape' => 'HandlerFailureException', ], [ 'shape' => 'ServiceLimitExceededException', ], [ 'shape' => 'InvalidCredentialsException', ], [ 'shape' => 'ResourceConflictException', ], [ 'shape' => 'ClientTokenConflictException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'DeleteResource' => [ 'name' => 'DeleteResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteResourceInput', ], 'output' => [ 'shape' => 'DeleteResourceOutput', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'HandlerInternalFailureException', ], [ 'shape' => 'GeneralServiceException', ], [ 'shape' => 'NotUpdatableException', ], [ 'shape' => 'TypeNotFoundException', ], [ 'shape' => 'ConcurrentOperationException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'PrivateTypeException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'NetworkFailureException', ], [ 'shape' => 'UnsupportedActionException', ], [ 'shape' => 'NotStabilizedException', ], [ 'shape' => 'ServiceInternalErrorException', ], [ 'shape' => 'HandlerFailureException', ], [ 'shape' => 'ServiceLimitExceededException', ], [ 'shape' => 'InvalidCredentialsException', ], [ 'shape' => 'ResourceConflictException', ], [ 'shape' => 'ClientTokenConflictException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'GetResource' => [ 'name' => 'GetResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetResourceInput', ], 'output' => [ 'shape' => 'GetResourceOutput', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'HandlerInternalFailureException', ], [ 'shape' => 'GeneralServiceException', ], [ 'shape' => 'NotUpdatableException', ], [ 'shape' => 'TypeNotFoundException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'PrivateTypeException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'NetworkFailureException', ], [ 'shape' => 'UnsupportedActionException', ], [ 'shape' => 'NotStabilizedException', ], [ 'shape' => 'ServiceInternalErrorException', ], [ 'shape' => 'HandlerFailureException', ], [ 'shape' => 'ServiceLimitExceededException', ], [ 'shape' => 'InvalidCredentialsException', ], [ 'shape' => 'ResourceConflictException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'GetResourceRequestStatus' => [ 'name' => 'GetResourceRequestStatus', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetResourceRequestStatusInput', ], 'output' => [ 'shape' => 'GetResourceRequestStatusOutput', ], 'errors' => [ [ 'shape' => 'RequestTokenNotFoundException', ], ], ], 'ListResourceRequests' => [ 'name' => 'ListResourceRequests', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListResourceRequestsInput', ], 'output' => [ 'shape' => 'ListResourceRequestsOutput', ], ], 'ListResources' => [ 'name' => 'ListResources', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListResourcesInput', ], 'output' => [ 'shape' => 'ListResourcesOutput', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'HandlerInternalFailureException', ], [ 'shape' => 'GeneralServiceException', ], [ 'shape' => 'NotUpdatableException', ], [ 'shape' => 'TypeNotFoundException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'PrivateTypeException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'NetworkFailureException', ], [ 'shape' => 'UnsupportedActionException', ], [ 'shape' => 'NotStabilizedException', ], [ 'shape' => 'ServiceInternalErrorException', ], [ 'shape' => 'HandlerFailureException', ], [ 'shape' => 'ServiceLimitExceededException', ], [ 'shape' => 'InvalidCredentialsException', ], [ 'shape' => 'ResourceConflictException', ], [ 'shape' => 'ThrottlingException', ], ], ], 'UpdateResource' => [ 'name' => 'UpdateResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateResourceInput', ], 'output' => [ 'shape' => 'UpdateResourceOutput', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'HandlerInternalFailureException', ], [ 'shape' => 'GeneralServiceException', ], [ 'shape' => 'NotUpdatableException', ], [ 'shape' => 'TypeNotFoundException', ], [ 'shape' => 'ConcurrentOperationException', ], [ 'shape' => 'InvalidRequestException', ], [ 'shape' => 'PrivateTypeException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'NetworkFailureException', ], [ 'shape' => 'UnsupportedActionException', ], [ 'shape' => 'NotStabilizedException', ], [ 'shape' => 'ServiceInternalErrorException', ], [ 'shape' => 'HandlerFailureException', ], [ 'shape' => 'ServiceLimitExceededException', ], [ 'shape' => 'InvalidCredentialsException', ], [ 'shape' => 'ResourceConflictException', ], [ 'shape' => 'ClientTokenConflictException', ], [ 'shape' => 'ThrottlingException', ], ], ], ], 'shapes' => [ 'AlreadyExistsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'CancelResourceRequestInput' => [ 'type' => 'structure', 'required' => [ 'RequestToken', ], 'members' => [ 'RequestToken' => [ 'shape' => 'RequestToken', ], ], ], 'CancelResourceRequestOutput' => [ 'type' => 'structure', 'members' => [ 'ProgressEvent' => [ 'shape' => 'ProgressEvent', ], ], ], 'ClientToken' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[-A-Za-z0-9+/=]+', ], 'ClientTokenConflictException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ConcurrentModificationException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, 'fault' => true, ], 'ConcurrentOperationException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'CreateResourceInput' => [ 'type' => 'structure', 'required' => [ 'TypeName', 'DesiredState', ], 'members' => [ 'TypeName' => [ 'shape' => 'TypeName', ], 'TypeVersionId' => [ 'shape' => 'TypeVersionId', ], 'RoleArn' => [ 'shape' => 'RoleArn', ], 'ClientToken' => [ 'shape' => 'ClientToken', 'idempotencyToken' => true, ], 'DesiredState' => [ 'shape' => 'Properties', ], ], ], 'CreateResourceOutput' => [ 'type' => 'structure', 'members' => [ 'ProgressEvent' => [ 'shape' => 'ProgressEvent', ], ], ], 'DeleteResourceInput' => [ 'type' => 'structure', 'required' => [ 'TypeName', 'Identifier', ], 'members' => [ 'TypeName' => [ 'shape' => 'TypeName', ], 'TypeVersionId' => [ 'shape' => 'TypeVersionId', ], 'RoleArn' => [ 'shape' => 'RoleArn', ], 'ClientToken' => [ 'shape' => 'ClientToken', 'idempotencyToken' => true, ], 'Identifier' => [ 'shape' => 'Identifier', ], ], ], 'DeleteResourceOutput' => [ 'type' => 'structure', 'members' => [ 'ProgressEvent' => [ 'shape' => 'ProgressEvent', ], ], ], 'ErrorMessage' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, 'pattern' => '.+', ], 'GeneralServiceException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'GetResourceInput' => [ 'type' => 'structure', 'required' => [ 'TypeName', 'Identifier', ], 'members' => [ 'TypeName' => [ 'shape' => 'TypeName', ], 'TypeVersionId' => [ 'shape' => 'TypeVersionId', ], 'RoleArn' => [ 'shape' => 'RoleArn', ], 'Identifier' => [ 'shape' => 'Identifier', ], ], ], 'GetResourceOutput' => [ 'type' => 'structure', 'members' => [ 'TypeName' => [ 'shape' => 'TypeName', ], 'ResourceDescription' => [ 'shape' => 'ResourceDescription', ], ], ], 'GetResourceRequestStatusInput' => [ 'type' => 'structure', 'required' => [ 'RequestToken', ], 'members' => [ 'RequestToken' => [ 'shape' => 'RequestToken', ], ], ], 'GetResourceRequestStatusOutput' => [ 'type' => 'structure', 'members' => [ 'ProgressEvent' => [ 'shape' => 'ProgressEvent', ], ], ], 'HandlerErrorCode' => [ 'type' => 'string', 'enum' => [ 'NotUpdatable', 'InvalidRequest', 'AccessDenied', 'InvalidCredentials', 'AlreadyExists', 'NotFound', 'ResourceConflict', 'Throttling', 'ServiceLimitExceeded', 'NotStabilized', 'GeneralServiceException', 'ServiceInternalError', 'ServiceTimeout', 'NetworkFailure', 'InternalFailure', ], ], 'HandlerFailureException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, 'fault' => true, ], 'HandlerInternalFailureException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, 'fault' => true, ], 'HandlerNextToken' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, 'pattern' => '.+', ], 'Identifier' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, 'pattern' => '.+', ], 'InvalidCredentialsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'InvalidRequestException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ListResourceRequestsInput' => [ 'type' => 'structure', 'members' => [ 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'ResourceRequestStatusFilter' => [ 'shape' => 'ResourceRequestStatusFilter', ], ], ], 'ListResourceRequestsOutput' => [ 'type' => 'structure', 'members' => [ 'ResourceRequestStatusSummaries' => [ 'shape' => 'ResourceRequestStatusSummaries', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListResourcesInput' => [ 'type' => 'structure', 'required' => [ 'TypeName', ], 'members' => [ 'TypeName' => [ 'shape' => 'TypeName', ], 'TypeVersionId' => [ 'shape' => 'TypeVersionId', ], 'RoleArn' => [ 'shape' => 'RoleArn', ], 'NextToken' => [ 'shape' => 'HandlerNextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'ResourceModel' => [ 'shape' => 'Properties', ], ], ], 'ListResourcesOutput' => [ 'type' => 'structure', 'members' => [ 'TypeName' => [ 'shape' => 'TypeName', ], 'ResourceDescriptions' => [ 'shape' => 'ResourceDescriptions', ], 'NextToken' => [ 'shape' => 'HandlerNextToken', ], ], ], 'MaxResults' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'NetworkFailureException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, 'fault' => true, ], 'NextToken' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, 'pattern' => '[-A-Za-z0-9+/=]+', ], 'NotStabilizedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'NotUpdatableException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'Operation' => [ 'type' => 'string', 'enum' => [ 'CREATE', 'DELETE', 'UPDATE', ], ], 'OperationStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING', 'IN_PROGRESS', 'SUCCESS', 'FAILED', 'CANCEL_IN_PROGRESS', 'CANCEL_COMPLETE', ], ], 'OperationStatuses' => [ 'type' => 'list', 'member' => [ 'shape' => 'OperationStatus', ], ], 'Operations' => [ 'type' => 'list', 'member' => [ 'shape' => 'Operation', ], ], 'PatchDocument' => [ 'type' => 'string', 'max' => 65536, 'min' => 1, 'pattern' => '[\\\\s\\\\S]*', 'sensitive' => true, ], 'PrivateTypeException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ProgressEvent' => [ 'type' => 'structure', 'members' => [ 'TypeName' => [ 'shape' => 'TypeName', ], 'Identifier' => [ 'shape' => 'Identifier', ], 'RequestToken' => [ 'shape' => 'RequestToken', ], 'Operation' => [ 'shape' => 'Operation', ], 'OperationStatus' => [ 'shape' => 'OperationStatus', ], 'EventTime' => [ 'shape' => 'Timestamp', ], 'ResourceModel' => [ 'shape' => 'Properties', ], 'StatusMessage' => [ 'shape' => 'StatusMessage', ], 'ErrorCode' => [ 'shape' => 'HandlerErrorCode', ], 'RetryAfter' => [ 'shape' => 'Timestamp', ], ], ], 'Properties' => [ 'type' => 'string', 'max' => 65536, 'min' => 1, 'pattern' => '[\\\\s\\\\S]*', 'sensitive' => true, ], 'RequestToken' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[-A-Za-z0-9+/=]+', ], 'RequestTokenNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ResourceConflictException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ResourceDescription' => [ 'type' => 'structure', 'members' => [ 'Identifier' => [ 'shape' => 'Identifier', ], 'Properties' => [ 'shape' => 'Properties', ], ], ], 'ResourceDescriptions' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResourceDescription', ], ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'ResourceRequestStatusFilter' => [ 'type' => 'structure', 'members' => [ 'Operations' => [ 'shape' => 'Operations', ], 'OperationStatuses' => [ 'shape' => 'OperationStatuses', ], ], ], 'ResourceRequestStatusSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'ProgressEvent', ], ], 'RoleArn' => [ 'type' => 'string', 'max' => 2048, 'min' => 20, 'pattern' => 'arn:.+:iam::[0-9]{12}:role/.+', ], 'ServiceInternalErrorException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, 'fault' => true, ], 'ServiceLimitExceededException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'StatusMessage' => [ 'type' => 'string', 'max' => 1024, 'min' => 0, 'pattern' => '[\\\\s\\\\S]*', ], 'ThrottlingException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'Timestamp' => [ 'type' => 'timestamp', ], 'TypeName' => [ 'type' => 'string', 'max' => 196, 'min' => 10, 'pattern' => '[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}', ], 'TypeNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'TypeVersionId' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[A-Za-z0-9-]+', ], 'UnsupportedActionException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'exception' => true, ], 'UpdateResourceInput' => [ 'type' => 'structure', 'required' => [ 'TypeName', 'Identifier', 'PatchDocument', ], 'members' => [ 'TypeName' => [ 'shape' => 'TypeName', ], 'TypeVersionId' => [ 'shape' => 'TypeVersionId', ], 'RoleArn' => [ 'shape' => 'RoleArn', ], 'ClientToken' => [ 'shape' => 'ClientToken', 'idempotencyToken' => true, ], 'Identifier' => [ 'shape' => 'Identifier', ], 'PatchDocument' => [ 'shape' => 'PatchDocument', ], ], ], 'UpdateResourceOutput' => [ 'type' => 'structure', 'members' => [ 'ProgressEvent' => [ 'shape' => 'ProgressEvent', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cloudcontrol/2021-09-30/docs-2.json\nreturn [ 'version' => '2.0', 'service' => '<p>For more information about Amazon Web Services Cloud Control API, see the <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/what-is-cloudcontrolapi.html\">Amazon Web Services Cloud Control API User Guide</a>.</p>', 'operations' => [ 'CancelResourceRequest' => '<p>Cancels the specified resource operation request. For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html#resource-operations-manage-requests-cancel\">Canceling resource operation requests</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p> <p>Only resource operations requests with a status of <code>PENDING</code> or <code>IN_PROGRESS</code> can be canceled.</p>', 'CreateResource' => '<p>Creates the specified resource. For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-create.html\">Creating a resource</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p> <p>After you have initiated a resource creation request, you can monitor the progress of your request by calling <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html\">GetResourceRequestStatus</a> using the <code>RequestToken</code> of the <code>ProgressEvent</code> type returned by <code>CreateResource</code>.</p>', 'DeleteResource' => '<p>Deletes the specified resource. For details, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-delete.html\">Deleting a resource</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p> <p>After you have initiated a resource deletion request, you can monitor the progress of your request by calling <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html\">GetResourceRequestStatus</a> using the <code>RequestToken</code> of the <code>ProgressEvent</code> returned by <code>DeleteResource</code>.</p>', 'GetResource' => '<p>Returns information about the current state of the specified resource. For details, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-read.html\">Reading a resource\\'s current state</a>.</p> <p>You can use this action to return information about an existing resource in your account and Amazon Web Services Region, whether those resources were provisioned using Cloud Control API.</p>', 'GetResourceRequestStatus' => '<p>Returns the current status of a resource operation request. For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html#resource-operations-manage-requests-track\">Tracking the progress of resource operation requests</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>', 'ListResourceRequests' => '<p>Returns existing resource operation requests. This includes requests of all status types. For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html#resource-operations-manage-requests-list\">Listing active resource operation requests</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p> <note> <p>Resource operation requests expire after 7 days.</p> </note>', 'ListResources' => '<p>Returns information about the specified resources. For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-list.html\">Discovering resources</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p> <p>You can use this action to return information about existing resources in your account and Amazon Web Services Region, whether those resources were provisioned using Cloud Control API.</p>', 'UpdateResource' => '<p>Updates the specified property values in the resource.</p> <p>You specify your resource property updates as a list of patch operations contained in a JSON patch document that adheres to the <a href=\"https://datatracker.ietf.org/doc/html/rfc6902\"> <i>RFC 6902 - JavaScript Object Notation (JSON) Patch</i> </a> standard.</p> <p>For details on how Cloud Control API performs resource update operations, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-update.html\">Updating a resource</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p> <p>After you have initiated a resource update request, you can monitor the progress of your request by calling <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html\">GetResourceRequestStatus</a> using the <code>RequestToken</code> of the <code>ProgressEvent</code> returned by <code>UpdateResource</code>.</p> <p>For more information about the properties of a specific resource, refer to the related topic for the resource in the <a href=\"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html\">Resource and property types reference</a> in the <i>CloudFormation Users Guide</i>.</p>', ], 'shapes' => [ 'AlreadyExistsException' => [ 'base' => '<p>The resource with the name requested already exists.</p>', 'refs' => [], ], 'CancelResourceRequestInput' => [ 'base' => NULL, 'refs' => [], ], 'CancelResourceRequestOutput' => [ 'base' => NULL, 'refs' => [], ], 'ClientToken' => [ 'base' => NULL, 'refs' => [ 'CreateResourceInput$ClientToken' => '<p>A unique identifier to ensure the idempotency of the resource request. As a best practice, specify this token to ensure idempotency, so that Amazon Web Services Cloud Control API can accurately distinguish between request retries and new resource requests. You might retry a resource request to ensure that it was successfully received.</p> <p>A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request.</p> <p>If you do not specify a client token, one is generated for inclusion in the request.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-idempotency\">Ensuring resource operation requests are unique</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>', 'DeleteResourceInput$ClientToken' => '<p>A unique identifier to ensure the idempotency of the resource request. As a best practice, specify this token to ensure idempotency, so that Amazon Web Services Cloud Control API can accurately distinguish between request retries and new resource requests. You might retry a resource request to ensure that it was successfully received.</p> <p>A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request.</p> <p>If you do not specify a client token, one is generated for inclusion in the request.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-idempotency\">Ensuring resource operation requests are unique</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>', 'UpdateResourceInput$ClientToken' => '<p>A unique identifier to ensure the idempotency of the resource request. As a best practice, specify this token to ensure idempotency, so that Amazon Web Services Cloud Control API can accurately distinguish between request retries and new resource requests. You might retry a resource request to ensure that it was successfully received.</p> <p>A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request.</p> <p>If you do not specify a client token, one is generated for inclusion in the request.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-idempotency\">Ensuring resource operation requests are unique</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>', ], ], 'ClientTokenConflictException' => [ 'base' => '<p>The specified client token has already been used in another resource request.</p> <p>It\\'s best practice for client tokens to be unique for each resource operation request. However, client token expire after 36 hours.</p>', 'refs' => [], ], 'ConcurrentModificationException' => [ 'base' => '<p>The resource is currently being modified by another operation.</p>', 'refs' => [], ], 'ConcurrentOperationException' => [ 'base' => '<p>Another resource operation is currently being performed on this resource.</p>', 'refs' => [], ], 'CreateResourceInput' => [ 'base' => NULL, 'refs' => [], ], 'CreateResourceOutput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteResourceInput' => [ 'base' => NULL, 'refs' => [], ], 'DeleteResourceOutput' => [ 'base' => NULL, 'refs' => [], ], 'ErrorMessage' => [ 'base' => NULL, 'refs' => [ 'AlreadyExistsException$Message' => NULL, 'ClientTokenConflictException$Message' => NULL, 'ConcurrentModificationException$Message' => NULL, 'ConcurrentOperationException$Message' => NULL, 'GeneralServiceException$Message' => NULL, 'HandlerFailureException$Message' => NULL, 'HandlerInternalFailureException$Message' => NULL, 'InvalidCredentialsException$Message' => NULL, 'InvalidRequestException$Message' => NULL, 'NetworkFailureException$Message' => NULL, 'NotStabilizedException$Message' => NULL, 'NotUpdatableException$Message' => NULL, 'PrivateTypeException$Message' => NULL, 'RequestTokenNotFoundException$Message' => NULL, 'ResourceConflictException$Message' => NULL, 'ResourceNotFoundException$Message' => NULL, 'ServiceInternalErrorException$Message' => NULL, 'ServiceLimitExceededException$Message' => NULL, 'ThrottlingException$Message' => NULL, 'TypeNotFoundException$Message' => NULL, 'UnsupportedActionException$Message' => NULL, ], ], 'GeneralServiceException' => [ 'base' => '<p>The resource handler has returned that the downstream service generated an error that doesn\\'t map to any other handler error code.</p>', 'refs' => [], ], 'GetResourceInput' => [ 'base' => NULL, 'refs' => [], ], 'GetResourceOutput' => [ 'base' => NULL, 'refs' => [], ], 'GetResourceRequestStatusInput' => [ 'base' => NULL, 'refs' => [], ], 'GetResourceRequestStatusOutput' => [ 'base' => NULL, 'refs' => [], ], 'HandlerErrorCode' => [ 'base' => NULL, 'refs' => [ 'ProgressEvent$ErrorCode' => '<p>For requests with a status of <code>FAILED</code>, the associated error code.</p> <p>For error code definitions, see <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract-errors.html\">Handler error codes</a> in the <i>CloudFormation Command Line Interface User Guide for Extension Development</i>.</p>', ], ], 'HandlerFailureException' => [ 'base' => '<p>The resource handler has failed without a returning a more specific error code. This can include timeouts.</p>', 'refs' => [], ], 'HandlerInternalFailureException' => [ 'base' => '<p>The resource handler has returned that an unexpected error occurred within the resource handler.</p>', 'refs' => [], ], 'HandlerNextToken' => [ 'base' => NULL, 'refs' => [ 'ListResourcesInput$NextToken' => '<p>If the previous paginated request didn\\'t return all of the remaining results, the response object\\'s <code>NextToken</code> parameter value is set to a token. To retrieve the next set of results, call this action again and assign that token to the request object\\'s <code>NextToken</code> parameter. If there are no remaining results, the previous response object\\'s <code>NextToken</code> parameter is set to <code>null</code>.</p>', 'ListResourcesOutput$NextToken' => '<p>If the request doesn\\'t return all of the remaining results, <code>NextToken</code> is set to a token. To retrieve the next set of results, call <code>ListResources</code> again and assign that token to the request object\\'s <code>NextToken</code> parameter. If the request returns all results, <code>NextToken</code> is set to null.</p>', ], ], 'Identifier' => [ 'base' => NULL, 'refs' => [ 'DeleteResourceInput$Identifier' => '<p>The identifier for the resource.</p> <p>You can specify the primary identifier, or any secondary identifier defined for the resource type in its resource schema. You can only specify one identifier. Primary identifiers can be specified as a string or JSON; secondary identifiers must be specified as JSON.</p> <p>For compound primary identifiers (that is, one that consists of multiple resource properties strung together), to specify the primary identifier as a string, list the property values <i>in the order they are specified</i> in the primary identifier definition, separated by <code>|</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html\">Identifying resources</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>', 'GetResourceInput$Identifier' => '<p>The identifier for the resource.</p> <p>You can specify the primary identifier, or any secondary identifier defined for the resource type in its resource schema. You can only specify one identifier. Primary identifiers can be specified as a string or JSON; secondary identifiers must be specified as JSON.</p> <p>For compound primary identifiers (that is, one that consists of multiple resource properties strung together), to specify the primary identifier as a string, list the property values <i>in the order they are specified</i> in the primary identifier definition, separated by <code>|</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html\">Identifying resources</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>', 'ProgressEvent$Identifier' => '<p>The primary identifier for the resource.</p> <note> <p>In some cases, the resource identifier may be available before the resource operation has reached a status of <code>SUCCESS</code>.</p> </note>', 'ResourceDescription$Identifier' => '<p>The primary identifier for the resource.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html\">Identifying resources</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>', 'UpdateResourceInput$Identifier' => '<p>The identifier for the resource.</p> <p>You can specify the primary identifier, or any secondary identifier defined for the resource type in its resource schema. You can only specify one identifier. Primary identifiers can be specified as a string or JSON; secondary identifiers must be specified as JSON.</p> <p>For compound primary identifiers (that is, one that consists of multiple resource properties strung together), to specify the primary identifier as a string, list the property values <i>in the order they are specified</i> in the primary identifier definition, separated by <code>|</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html\">Identifying resources</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>', ], ], 'InvalidCredentialsException' => [ 'base' => '<p>The resource handler has returned that the credentials provided by the user are invalid.</p>', 'refs' => [], ], 'InvalidRequestException' => [ 'base' => '<p>The resource handler has returned that invalid input from the user has generated a generic exception.</p>', 'refs' => [], ], 'ListResourceRequestsInput' => [ 'base' => NULL, 'refs' => [], ], 'ListResourceRequestsOutput' => [ 'base' => NULL, 'refs' => [], ], 'ListResourcesInput' => [ 'base' => NULL, 'refs' => [], ], 'ListResourcesOutput' => [ 'base' => NULL, 'refs' => [], ], 'MaxResults' => [ 'base' => NULL, 'refs' => [ 'ListResourceRequestsInput$MaxResults' => '<p>The maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a <code>NextToken</code> value that you can assign to the <code>NextToken</code> request parameter to get the next set of results.</p> <p>The default is <code>20</code>.</p>', 'ListResourcesInput$MaxResults' => '<p>Reserved.</p>', ], ], 'NetworkFailureException' => [ 'base' => '<p>The resource handler has returned that the request couldn\\'t be completed due to networking issues, such as a failure to receive a response from the server.</p>', 'refs' => [], ], 'NextToken' => [ 'base' => NULL, 'refs' => [ 'ListResourceRequestsInput$NextToken' => '<p>If the previous paginated request didn\\'t return all of the remaining results, the response object\\'s <code>NextToken</code> parameter value is set to a token. To retrieve the next set of results, call this action again and assign that token to the request object\\'s <code>NextToken</code> parameter. If there are no remaining results, the previous response object\\'s <code>NextToken</code> parameter is set to <code>null</code>.</p>', 'ListResourceRequestsOutput$NextToken' => '<p>If the request doesn\\'t return all of the remaining results, <code>NextToken</code> is set to a token. To retrieve the next set of results, call <code>ListResources</code> again and assign that token to the request object\\'s <code>NextToken</code> parameter. If the request returns all results, <code>NextToken</code> is set to null.</p>', ], ], 'NotStabilizedException' => [ 'base' => '<p>The resource handler has returned that the downstream resource failed to complete all of its ready-state checks.</p>', 'refs' => [], ], 'NotUpdatableException' => [ 'base' => '<p>One or more properties included in this resource operation are defined as create-only, and therefore can\\'t be updated.</p>', 'refs' => [], ], 'Operation' => [ 'base' => NULL, 'refs' => [ 'Operations$member' => NULL, 'ProgressEvent$Operation' => '<p>The resource operation type.</p>', ], ], 'OperationStatus' => [ 'base' => NULL, 'refs' => [ 'OperationStatuses$member' => NULL, 'ProgressEvent$OperationStatus' => '<p>The current status of the resource operation request.</p> <ul> <li> <p> <code>PENDING</code>: The resource operation hasn\\'t yet started.</p> </li> <li> <p> <code>IN_PROGRESS</code>: The resource operation is currently in progress.</p> </li> <li> <p> <code>SUCCESS</code>: The resource operation has successfully completed.</p> </li> <li> <p> <code>FAILED</code>: The resource operation has failed. Refer to the error code and status message for more information.</p> </li> <li> <p> <code>CANCEL_IN_PROGRESS</code>: The resource operation is in the process of being canceled.</p> </li> <li> <p> <code>CANCEL_COMPLETE</code>: The resource operation has been canceled.</p> </li> </ul>', ], ], 'OperationStatuses' => [ 'base' => NULL, 'refs' => [ 'ResourceRequestStatusFilter$OperationStatuses' => '<p>The operation statuses to include in the filter.</p> <ul> <li> <p> <code>PENDING</code>: The operation has been requested, but not yet initiated.</p> </li> <li> <p> <code>IN_PROGRESS</code>: The operation is in progress.</p> </li> <li> <p> <code>SUCCESS</code>: The operation completed.</p> </li> <li> <p> <code>FAILED</code>: The operation failed.</p> </li> <li> <p> <code>CANCEL_IN_PROGRESS</code>: The operation is in the process of being canceled.</p> </li> <li> <p> <code>CANCEL_COMPLETE</code>: The operation has been canceled.</p> </li> </ul>', ], ], 'Operations' => [ 'base' => NULL, 'refs' => [ 'ResourceRequestStatusFilter$Operations' => '<p>The operation types to include in the filter.</p>', ], ], 'PatchDocument' => [ 'base' => NULL, 'refs' => [ 'UpdateResourceInput$PatchDocument' => '<p>A JavaScript Object Notation (JSON) document listing the patch operations that represent the updates to apply to the current resource properties. For details, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-update.html#resource-operations-update-patch\">Composing the patch document</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>', ], ], 'PrivateTypeException' => [ 'base' => '<p>Cloud Control API hasn\\'t received a valid response from the resource handler, due to a configuration error. This includes issues such as the resource handler returning an invalid response, or timing out.</p>', 'refs' => [], ], 'ProgressEvent' => [ 'base' => '<p>Represents the current status of a resource operation request. For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html\">Managing resource operation requests</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>', 'refs' => [ 'CancelResourceRequestOutput$ProgressEvent' => NULL, 'CreateResourceOutput$ProgressEvent' => '<p>Represents the current status of the resource creation request.</p> <p>After you have initiated a resource creation request, you can monitor the progress of your request by calling <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html\">GetResourceRequestStatus</a> using the <code>RequestToken</code> of the <code>ProgressEvent</code> returned by <code>CreateResource</code>.</p>', 'DeleteResourceOutput$ProgressEvent' => '<p>Represents the current status of the resource deletion request.</p> <p>After you have initiated a resource deletion request, you can monitor the progress of your request by calling <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html\">GetResourceRequestStatus</a> using the <code>RequestToken</code> of the <code>ProgressEvent</code> returned by <code>DeleteResource</code>.</p>', 'GetResourceRequestStatusOutput$ProgressEvent' => '<p>Represents the current status of the resource operation request.</p>', 'ResourceRequestStatusSummaries$member' => NULL, 'UpdateResourceOutput$ProgressEvent' => '<p>Represents the current status of the resource update request.</p> <p>Use the <code>RequestToken</code> of the <code>ProgressEvent</code> with <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html\">GetResourceRequestStatus</a> to return the current status of a resource operation request.</p>', ], ], 'Properties' => [ 'base' => NULL, 'refs' => [ 'CreateResourceInput$DesiredState' => '<p>Structured data format representing the desired state of the resource, consisting of that resource\\'s properties and their desired values.</p> <note> <p>Cloud Control API currently supports JSON as a structured data format.</p> </note> <pre><code> &lt;p&gt;Specify the desired state as one of the following:&lt;/p&gt; &lt;ul&gt; &lt;li&gt; &lt;p&gt;A JSON blob&lt;/p&gt; &lt;/li&gt; &lt;li&gt; &lt;p&gt;A local path containing the desired state in JSON data format&lt;/p&gt; &lt;/li&gt; &lt;/ul&gt; &lt;p&gt;For more information, see &lt;a href=&quot;https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-create.html#resource-operations-create-desiredstate&quot;&gt;Composing the desired state of the resource&lt;/a&gt; in the &lt;i&gt;Amazon Web Services Cloud Control API User Guide&lt;/i&gt;.&lt;/p&gt; &lt;p&gt;For more information about the properties of a specific resource, refer to the related topic for the resource in the &lt;a href=&quot;https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html&quot;&gt;Resource and property types reference&lt;/a&gt; in the &lt;i&gt;CloudFormation Users Guide&lt;/i&gt;.&lt;/p&gt; </code></pre>', 'ListResourcesInput$ResourceModel' => '<p>The resource model to use to select the resources to return.</p>', 'ProgressEvent$ResourceModel' => '<p>A JSON string containing the resource model, consisting of each resource property and its current value.</p>', 'ResourceDescription$Properties' => '<p>A list of the resource properties and their current values.</p>', ], ], 'RequestToken' => [ 'base' => NULL, 'refs' => [ 'CancelResourceRequestInput$RequestToken' => '<p>The <code>RequestToken</code> of the <code>ProgressEvent</code> object returned by the resource operation request.</p>', 'GetResourceRequestStatusInput$RequestToken' => '<p>A unique token used to track the progress of the resource operation request.</p> <p>Request tokens are included in the <code>ProgressEvent</code> type returned by a resource operation request.</p>', 'ProgressEvent$RequestToken' => '<p>The unique token representing this resource operation request.</p> <p>Use the <code>RequestToken</code> with <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html\">GetResourceRequestStatus</a> to return the current status of a resource operation request.</p>', ], ], 'RequestTokenNotFoundException' => [ 'base' => '<p>A resource operation with the specified request token can\\'t be found.</p>', 'refs' => [], ], 'ResourceConflictException' => [ 'base' => '<p>The resource is temporarily unavailable to be acted upon. For example, if the resource is currently undergoing an operation and can\\'t be acted upon until that operation is finished.</p>', 'refs' => [], ], 'ResourceDescription' => [ 'base' => '<p>Represents information about a provisioned resource.</p>', 'refs' => [ 'GetResourceOutput$ResourceDescription' => NULL, 'ResourceDescriptions$member' => NULL, ], ], 'ResourceDescriptions' => [ 'base' => NULL, 'refs' => [ 'ListResourcesOutput$ResourceDescriptions' => '<p>Information about the specified resources, including primary identifier and resource model.</p>', ], ], 'ResourceNotFoundException' => [ 'base' => '<p>A resource with the specified identifier can\\'t be found.</p>', 'refs' => [], ], 'ResourceRequestStatusFilter' => [ 'base' => '<p>The filter criteria to use in determining the requests returned.</p>', 'refs' => [ 'ListResourceRequestsInput$ResourceRequestStatusFilter' => '<p>The filter criteria to apply to the requests returned.</p>', ], ], 'ResourceRequestStatusSummaries' => [ 'base' => NULL, 'refs' => [ 'ListResourceRequestsOutput$ResourceRequestStatusSummaries' => '<p>The requests that match the specified filter criteria.</p>', ], ], 'RoleArn' => [ 'base' => NULL, 'refs' => [ 'CreateResourceInput$RoleArn' => '<p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the <code> <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers\">handlers</a> </code> section of the <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html\">resource type definition schema</a>.</p> <p>If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions\">Specifying credentials</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>', 'DeleteResourceInput$RoleArn' => '<p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the <code> <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers\">handlers</a> </code> section of the <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html\">resource type definition schema</a>.</p> <p>If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions\">Specifying credentials</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>', 'GetResourceInput$RoleArn' => '<p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the <code> <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers\">handlers</a> </code> section of the <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html\">resource type definition schema</a>.</p> <p>If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions\">Specifying credentials</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>', 'ListResourcesInput$RoleArn' => '<p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the <code> <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers\">handlers</a> </code> section of the <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html\">resource type definition schema</a>.</p> <p>If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions\">Specifying credentials</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>', 'UpdateResourceInput$RoleArn' => '<p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the <code> <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers\">handlers</a> </code> section of the <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html\">resource type definition schema</a>.</p> <p>If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions\">Specifying credentials</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>', ], ], 'ServiceInternalErrorException' => [ 'base' => '<p>The resource handler has returned that the downstream service returned an internal error, typically with a <code>5XX HTTP</code> status code.</p>', 'refs' => [], ], 'ServiceLimitExceededException' => [ 'base' => '<p>The resource handler has returned that a non-transient resource limit was reached on the service side.</p>', 'refs' => [], ], 'StatusMessage' => [ 'base' => NULL, 'refs' => [ 'ProgressEvent$StatusMessage' => '<p>Any message explaining the current status.</p>', ], ], 'ThrottlingException' => [ 'base' => '<p>The request was denied due to request throttling.</p>', 'refs' => [], ], 'Timestamp' => [ 'base' => NULL, 'refs' => [ 'ProgressEvent$EventTime' => '<p>When the resource operation request was initiated.</p>', 'ProgressEvent$RetryAfter' => '<p>When to next request the status of this resource operation request.</p>', ], ], 'TypeName' => [ 'base' => NULL, 'refs' => [ 'CreateResourceInput$TypeName' => '<p>The name of the resource type.</p>', 'DeleteResourceInput$TypeName' => '<p>The name of the resource type.</p>', 'GetResourceInput$TypeName' => '<p>The name of the resource type.</p>', 'GetResourceOutput$TypeName' => '<p>The name of the resource type.</p>', 'ListResourcesInput$TypeName' => '<p>The name of the resource type.</p>', 'ListResourcesOutput$TypeName' => '<p>The name of the resource type.</p>', 'ProgressEvent$TypeName' => '<p>The name of the resource type used in the operation.</p>', 'UpdateResourceInput$TypeName' => '<p>The name of the resource type.</p>', ], ], 'TypeNotFoundException' => [ 'base' => '<p>The specified extension doesn\\'t exist in the CloudFormation registry.</p>', 'refs' => [], ], 'TypeVersionId' => [ 'base' => NULL, 'refs' => [ 'CreateResourceInput$TypeVersionId' => '<p>For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.</p>', 'DeleteResourceInput$TypeVersionId' => '<p>For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.</p>', 'GetResourceInput$TypeVersionId' => '<p>For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.</p>', 'ListResourcesInput$TypeVersionId' => '<p>For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.</p>', 'UpdateResourceInput$TypeVersionId' => '<p>For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.</p>', ], ], 'UnsupportedActionException' => [ 'base' => '<p>The specified resource doesn\\'t support this resource operation.</p>', 'refs' => [], ], 'UpdateResourceInput' => [ 'base' => NULL, 'refs' => [], ], 'UpdateResourceOutput' => [ 'base' => NULL, 'refs' => [], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cloudcontrol/2021-09-30/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], [ 'fn' => 'parseURL', 'argv' => [ [ 'ref' => 'Endpoint', ], ], 'assign' => 'url', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cloudcontrolapi.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://cloudcontrolapi.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cloudcontrol/2021-09-30/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ap-south-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ap-south-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.eu-south-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.eu-south-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.eu-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.eu-south-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.eu-south-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.eu-south-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-south-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-south-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.eu-south-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-south-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.us-gov-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.me-central-1.api.aws', ], ], 'params' => [ 'Region' => 'me-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.me-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.me-central-1.api.aws', ], ], 'params' => [ 'Region' => 'me-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.me-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ca-central-1.api.aws', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ca-central-1.api.aws', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.eu-central-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.eu-central-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.af-south-1.api.aws', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.af-south-1.api.aws', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.eu-north-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.eu-north-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.eu-west-3.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.eu-west-3.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ap-northeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ap-northeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ap-northeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ap-northeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ap-northeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ap-northeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ap-northeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.me-south-1.api.aws', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.me-south-1.api.aws', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.sa-east-1.api.aws', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.sa-east-1.api.aws', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ap-east-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ap-east-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.us-gov-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.us-gov-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ap-southeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ap-southeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ap-southeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ap-southeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ap-southeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ap-southeast-3.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.ap-southeast-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi-fips.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://cloudcontrolapi.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cloudcontrol/2021-09-30/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cloudcontrol/2021-09-30/paginators-1.json\nreturn [ 'pagination' => [ 'ListResourceRequests' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'ResourceRequestStatusSummaries', ], 'ListResources' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', 'result_key' => 'ResourceDescriptions', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cloudcontrol/2021-09-30/smoke.json\nreturn [ 'version' => 1, 'defaultRegion' => 'us-west-2', 'testCases' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cloudcontrol/2021-09-30/waiters-2.json\nreturn [ 'version' => 2, 'waiters' => [ 'ResourceRequestSuccess' => [ 'description' => 'Wait until resource operation request is successful', 'delay' => 5, 'maxAttempts' => 24, 'operation' => 'GetResourceRequestStatus', 'acceptors' => [ [ 'matcher' => 'path', 'argument' => 'ProgressEvent.OperationStatus', 'state' => 'success', 'expected' => 'SUCCESS', ], [ 'matcher' => 'path', 'argument' => 'ProgressEvent.OperationStatus', 'state' => 'failure', 'expected' => 'FAILED', ], [ 'matcher' => 'path', 'argument' => 'ProgressEvent.OperationStatus', 'state' => 'failure', 'expected' => 'CANCEL_COMPLETE', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/clouddirectory/2016-05-10/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2016-05-10', 'endpointPrefix' => 'clouddirectory', 'protocol' => 'rest-json', 'serviceFullName' => 'Amazon CloudDirectory', 'signatureVersion' => 'v4', 'signingName' => 'clouddirectory', 'uid' => 'clouddirectory-2016-05-10', ], 'operations' => [ 'AddFacetToObject' => [ 'name' => 'AddFacetToObject', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/facets', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AddFacetToObjectRequest', ], 'output' => [ 'shape' => 'AddFacetToObjectResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'ApplySchema' => [ 'name' => 'ApplySchema', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/apply', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ApplySchemaRequest', ], 'output' => [ 'shape' => 'ApplySchemaResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidAttachmentException', ], ], ], 'AttachObject' => [ 'name' => 'AttachObject', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/attach', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AttachObjectRequest', ], 'output' => [ 'shape' => 'AttachObjectResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'LinkNameAlreadyInUseException', ], [ 'shape' => 'InvalidAttachmentException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'AttachPolicy' => [ 'name' => 'AttachPolicy', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/policy/attach', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AttachPolicyRequest', ], 'output' => [ 'shape' => 'AttachPolicyResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'NotPolicyException', ], ], ], 'AttachToIndex' => [ 'name' => 'AttachToIndex', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/index/attach', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AttachToIndexRequest', ], 'output' => [ 'shape' => 'AttachToIndexResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'InvalidAttachmentException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'LinkNameAlreadyInUseException', ], [ 'shape' => 'IndexedAttributeMissingException', ], [ 'shape' => 'NotIndexException', ], ], ], 'AttachTypedLink' => [ 'name' => 'AttachTypedLink', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/attach', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AttachTypedLinkRequest', ], 'output' => [ 'shape' => 'AttachTypedLinkResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidAttachmentException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'BatchRead' => [ 'name' => 'BatchRead', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/batchread', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchReadRequest', ], 'output' => [ 'shape' => 'BatchReadResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], ], ], 'BatchWrite' => [ 'name' => 'BatchWrite', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/batchwrite', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchWriteRequest', ], 'output' => [ 'shape' => 'BatchWriteResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'BatchWriteException', ], ], ], 'CreateDirectory' => [ 'name' => 'CreateDirectory', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/directory/create', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateDirectoryRequest', ], 'output' => [ 'shape' => 'CreateDirectoryResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryAlreadyExistsException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'CreateFacet' => [ 'name' => 'CreateFacet', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/facet/create', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateFacetRequest', ], 'output' => [ 'shape' => 'CreateFacetResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetAlreadyExistsException', ], [ 'shape' => 'InvalidRuleException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'CreateIndex' => [ 'name' => 'CreateIndex', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/index', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateIndexRequest', ], 'output' => [ 'shape' => 'CreateIndexResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetValidationException', ], [ 'shape' => 'LinkNameAlreadyInUseException', ], [ 'shape' => 'UnsupportedIndexTypeException', ], ], ], 'CreateObject' => [ 'name' => 'CreateObject', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/object', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateObjectRequest', ], 'output' => [ 'shape' => 'CreateObjectResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetValidationException', ], [ 'shape' => 'LinkNameAlreadyInUseException', ], [ 'shape' => 'UnsupportedIndexTypeException', ], ], ], 'CreateSchema' => [ 'name' => 'CreateSchema', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/create', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateSchemaRequest', ], 'output' => [ 'shape' => 'CreateSchemaResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'SchemaAlreadyExistsException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'CreateTypedLinkFacet' => [ 'name' => 'CreateTypedLinkFacet', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/facet/create', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateTypedLinkFacetRequest', ], 'output' => [ 'shape' => 'CreateTypedLinkFacetResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetAlreadyExistsException', ], [ 'shape' => 'InvalidRuleException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'DeleteDirectory' => [ 'name' => 'DeleteDirectory', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/directory', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteDirectoryRequest', ], 'output' => [ 'shape' => 'DeleteDirectoryResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'DirectoryNotDisabledException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryDeletedException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'InvalidArnException', ], ], ], 'DeleteFacet' => [ 'name' => 'DeleteFacet', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/facet/delete', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteFacetRequest', ], 'output' => [ 'shape' => 'DeleteFacetResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetNotFoundException', ], [ 'shape' => 'FacetInUseException', ], ], ], 'DeleteObject' => [ 'name' => 'DeleteObject', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/delete', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteObjectRequest', ], 'output' => [ 'shape' => 'DeleteObjectResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ObjectNotDetachedException', ], ], ], 'DeleteSchema' => [ 'name' => 'DeleteSchema', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteSchemaRequest', ], 'output' => [ 'shape' => 'DeleteSchemaResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'StillContainsLinksException', ], ], ], 'DeleteTypedLinkFacet' => [ 'name' => 'DeleteTypedLinkFacet', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/facet/delete', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteTypedLinkFacetRequest', ], 'output' => [ 'shape' => 'DeleteTypedLinkFacetResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetNotFoundException', ], ], ], 'DetachFromIndex' => [ 'name' => 'DetachFromIndex', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/index/detach', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DetachFromIndexRequest', ], 'output' => [ 'shape' => 'DetachFromIndexResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ObjectAlreadyDetachedException', ], [ 'shape' => 'NotIndexException', ], ], ], 'DetachObject' => [ 'name' => 'DetachObject', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/detach', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DetachObjectRequest', ], 'output' => [ 'shape' => 'DetachObjectResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'NotNodeException', ], ], ], 'DetachPolicy' => [ 'name' => 'DetachPolicy', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/policy/detach', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DetachPolicyRequest', ], 'output' => [ 'shape' => 'DetachPolicyResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'NotPolicyException', ], ], ], 'DetachTypedLink' => [ 'name' => 'DetachTypedLink', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/detach', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DetachTypedLinkRequest', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'DisableDirectory' => [ 'name' => 'DisableDirectory', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/directory/disable', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DisableDirectoryRequest', ], 'output' => [ 'shape' => 'DisableDirectoryResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'DirectoryDeletedException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'InvalidArnException', ], ], ], 'EnableDirectory' => [ 'name' => 'EnableDirectory', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/directory/enable', 'responseCode' => 200, ], 'input' => [ 'shape' => 'EnableDirectoryRequest', ], 'output' => [ 'shape' => 'EnableDirectoryResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'DirectoryDeletedException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'InvalidArnException', ], ], ], 'GetAppliedSchemaVersion' => [ 'name' => 'GetAppliedSchemaVersion', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/getappliedschema', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetAppliedSchemaVersionRequest', ], 'output' => [ 'shape' => 'GetAppliedSchemaVersionResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetDirectory' => [ 'name' => 'GetDirectory', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/directory/get', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetDirectoryRequest', ], 'output' => [ 'shape' => 'GetDirectoryResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetFacet' => [ 'name' => 'GetFacet', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/facet', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetFacetRequest', ], 'output' => [ 'shape' => 'GetFacetResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetNotFoundException', ], ], ], 'GetLinkAttributes' => [ 'name' => 'GetLinkAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/attributes/get', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetLinkAttributesRequest', ], 'output' => [ 'shape' => 'GetLinkAttributesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'GetObjectAttributes' => [ 'name' => 'GetObjectAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/attributes/get', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetObjectAttributesRequest', ], 'output' => [ 'shape' => 'GetObjectAttributesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'GetObjectInformation' => [ 'name' => 'GetObjectInformation', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/information', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetObjectInformationRequest', ], 'output' => [ 'shape' => 'GetObjectInformationResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetSchemaAsJson' => [ 'name' => 'GetSchemaAsJson', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/json', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetSchemaAsJsonRequest', ], 'output' => [ 'shape' => 'GetSchemaAsJsonResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], ], ], 'GetTypedLinkFacetInformation' => [ 'name' => 'GetTypedLinkFacetInformation', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/facet/get', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetTypedLinkFacetInformationRequest', ], 'output' => [ 'shape' => 'GetTypedLinkFacetInformationResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'FacetNotFoundException', ], ], ], 'ListAppliedSchemaArns' => [ 'name' => 'ListAppliedSchemaArns', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/applied', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAppliedSchemaArnsRequest', ], 'output' => [ 'shape' => 'ListAppliedSchemaArnsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListAttachedIndices' => [ 'name' => 'ListAttachedIndices', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/indices', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAttachedIndicesRequest', ], 'output' => [ 'shape' => 'ListAttachedIndicesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListDevelopmentSchemaArns' => [ 'name' => 'ListDevelopmentSchemaArns', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/development', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListDevelopmentSchemaArnsRequest', ], 'output' => [ 'shape' => 'ListDevelopmentSchemaArnsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListDirectories' => [ 'name' => 'ListDirectories', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/directory/list', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListDirectoriesRequest', ], 'output' => [ 'shape' => 'ListDirectoriesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListFacetAttributes' => [ 'name' => 'ListFacetAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/facet/attributes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListFacetAttributesRequest', ], 'output' => [ 'shape' => 'ListFacetAttributesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListFacetNames' => [ 'name' => 'ListFacetNames', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/facet/list', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListFacetNamesRequest', ], 'output' => [ 'shape' => 'ListFacetNamesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListIncomingTypedLinks' => [ 'name' => 'ListIncomingTypedLinks', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/incoming', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListIncomingTypedLinksRequest', ], 'output' => [ 'shape' => 'ListIncomingTypedLinksResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'ListIndex' => [ 'name' => 'ListIndex', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/index/targets', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListIndexRequest', ], 'output' => [ 'shape' => 'ListIndexResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'FacetValidationException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'NotIndexException', ], ], ], 'ListObjectAttributes' => [ 'name' => 'ListObjectAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/attributes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListObjectAttributesRequest', ], 'output' => [ 'shape' => 'ListObjectAttributesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'ListObjectChildren' => [ 'name' => 'ListObjectChildren', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/children', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListObjectChildrenRequest', ], 'output' => [ 'shape' => 'ListObjectChildrenResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'NotNodeException', ], ], ], 'ListObjectParentPaths' => [ 'name' => 'ListObjectParentPaths', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/parentpaths', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListObjectParentPathsRequest', ], 'output' => [ 'shape' => 'ListObjectParentPathsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListObjectParents' => [ 'name' => 'ListObjectParents', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/parent', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListObjectParentsRequest', ], 'output' => [ 'shape' => 'ListObjectParentsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'CannotListParentOfRootException', ], ], ], 'ListObjectPolicies' => [ 'name' => 'ListObjectPolicies', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/policy', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListObjectPoliciesRequest', ], 'output' => [ 'shape' => 'ListObjectPoliciesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListOutgoingTypedLinks' => [ 'name' => 'ListOutgoingTypedLinks', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/outgoing', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListOutgoingTypedLinksRequest', ], 'output' => [ 'shape' => 'ListOutgoingTypedLinksResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'ListPolicyAttachments' => [ 'name' => 'ListPolicyAttachments', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/policy/attachment', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListPolicyAttachmentsRequest', ], 'output' => [ 'shape' => 'ListPolicyAttachmentsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'NotPolicyException', ], ], ], 'ListPublishedSchemaArns' => [ 'name' => 'ListPublishedSchemaArns', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/published', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListPublishedSchemaArnsRequest', ], 'output' => [ 'shape' => 'ListPublishedSchemaArnsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/tags', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidTaggingRequestException', ], ], ], 'ListTypedLinkFacetAttributes' => [ 'name' => 'ListTypedLinkFacetAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/facet/attributes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTypedLinkFacetAttributesRequest', ], 'output' => [ 'shape' => 'ListTypedLinkFacetAttributesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListTypedLinkFacetNames' => [ 'name' => 'ListTypedLinkFacetNames', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/facet/list', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTypedLinkFacetNamesRequest', ], 'output' => [ 'shape' => 'ListTypedLinkFacetNamesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'LookupPolicy' => [ 'name' => 'LookupPolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/policy/lookup', 'responseCode' => 200, ], 'input' => [ 'shape' => 'LookupPolicyRequest', ], 'output' => [ 'shape' => 'LookupPolicyResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'PublishSchema' => [ 'name' => 'PublishSchema', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/publish', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PublishSchemaRequest', ], 'output' => [ 'shape' => 'PublishSchemaResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'SchemaAlreadyPublishedException', ], ], ], 'PutSchemaFromJson' => [ 'name' => 'PutSchemaFromJson', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/json', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutSchemaFromJsonRequest', ], 'output' => [ 'shape' => 'PutSchemaFromJsonResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InvalidSchemaDocException', ], [ 'shape' => 'InvalidRuleException', ], ], ], 'RemoveFacetFromObject' => [ 'name' => 'RemoveFacetFromObject', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/facets/delete', 'responseCode' => 200, ], 'input' => [ 'shape' => 'RemoveFacetFromObjectRequest', ], 'output' => [ 'shape' => 'RemoveFacetFromObjectResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/tags/add', 'responseCode' => 200, ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidTaggingRequestException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/tags/remove', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidTaggingRequestException', ], ], ], 'UpdateFacet' => [ 'name' => 'UpdateFacet', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/facet', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateFacetRequest', ], 'output' => [ 'shape' => 'UpdateFacetResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InvalidFacetUpdateException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetNotFoundException', ], [ 'shape' => 'InvalidRuleException', ], ], ], 'UpdateLinkAttributes' => [ 'name' => 'UpdateLinkAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/attributes/update', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateLinkAttributesRequest', ], 'output' => [ 'shape' => 'UpdateLinkAttributesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'UpdateObjectAttributes' => [ 'name' => 'UpdateObjectAttributes', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/update', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateObjectAttributesRequest', ], 'output' => [ 'shape' => 'UpdateObjectAttributesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'LinkNameAlreadyInUseException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'UpdateSchema' => [ 'name' => 'UpdateSchema', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/update', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateSchemaRequest', ], 'output' => [ 'shape' => 'UpdateSchemaResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UpdateTypedLinkFacet' => [ 'name' => 'UpdateTypedLinkFacet', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/facet', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateTypedLinkFacetRequest', ], 'output' => [ 'shape' => 'UpdateTypedLinkFacetResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'FacetValidationException', ], [ 'shape' => 'InvalidFacetUpdateException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetNotFoundException', ], [ 'shape' => 'InvalidRuleException', ], ], ], 'UpgradeAppliedSchema' => [ 'name' => 'UpgradeAppliedSchema', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/upgradeapplied', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpgradeAppliedSchemaRequest', ], 'output' => [ 'shape' => 'UpgradeAppliedSchemaResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'IncompatibleSchemaException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidAttachmentException', ], ], ], 'UpgradePublishedSchema' => [ 'name' => 'UpgradePublishedSchema', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/upgradepublished', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpgradePublishedSchemaRequest', ], 'output' => [ 'shape' => 'UpgradePublishedSchemaResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'IncompatibleSchemaException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidAttachmentException', ], [ 'shape' => 'LimitExceededException', ], ], ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 403, ], 'exception' => true, ], 'AddFacetToObjectRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'SchemaFacet', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'SchemaFacet' => [ 'shape' => 'SchemaFacet', ], 'ObjectAttributeList' => [ 'shape' => 'AttributeKeyAndValueList', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'AddFacetToObjectResponse' => [ 'type' => 'structure', 'members' => [], ], 'ApplySchemaRequest' => [ 'type' => 'structure', 'required' => [ 'PublishedSchemaArn', 'DirectoryArn', ], 'members' => [ 'PublishedSchemaArn' => [ 'shape' => 'Arn', ], 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], ], ], 'ApplySchemaResponse' => [ 'type' => 'structure', 'members' => [ 'AppliedSchemaArn' => [ 'shape' => 'Arn', ], 'DirectoryArn' => [ 'shape' => 'Arn', ], ], ], 'Arn' => [ 'type' => 'string', ], 'Arns' => [ 'type' => 'list', 'member' => [ 'shape' => 'Arn', ], ], 'AttachObjectRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ParentReference', 'ChildReference', 'LinkName', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ParentReference' => [ 'shape' => 'ObjectReference', ], 'ChildReference' => [ 'shape' => 'ObjectReference', ], 'LinkName' => [ 'shape' => 'LinkName', ], ], ], 'AttachObjectResponse' => [ 'type' => 'structure', 'members' => [ 'AttachedObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'AttachPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'PolicyReference', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'PolicyReference' => [ 'shape' => 'ObjectReference', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'AttachPolicyResponse' => [ 'type' => 'structure', 'members' => [], ], 'AttachToIndexRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'IndexReference', 'TargetReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'IndexReference' => [ 'shape' => 'ObjectReference', ], 'TargetReference' => [ 'shape' => 'ObjectReference', ], ], ], 'AttachToIndexResponse' => [ 'type' => 'structure', 'members' => [ 'AttachedObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'AttachTypedLinkRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'SourceObjectReference', 'TargetObjectReference', 'TypedLinkFacet', 'Attributes', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'SourceObjectReference' => [ 'shape' => 'ObjectReference', ], 'TargetObjectReference' => [ 'shape' => 'ObjectReference', ], 'TypedLinkFacet' => [ 'shape' => 'TypedLinkSchemaAndFacetName', ], 'Attributes' => [ 'shape' => 'AttributeNameAndValueList', ], ], ], 'AttachTypedLinkResponse' => [ 'type' => 'structure', 'members' => [ 'TypedLinkSpecifier' => [ 'shape' => 'TypedLinkSpecifier', ], ], ], 'AttributeKey' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'FacetName', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], 'FacetName' => [ 'shape' => 'FacetName', ], 'Name' => [ 'shape' => 'AttributeName', ], ], ], 'AttributeKeyAndValue' => [ 'type' => 'structure', 'required' => [ 'Key', 'Value', ], 'members' => [ 'Key' => [ 'shape' => 'AttributeKey', ], 'Value' => [ 'shape' => 'TypedAttributeValue', ], ], ], 'AttributeKeyAndValueList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AttributeKeyAndValue', ], ], 'AttributeKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AttributeKey', ], ], 'AttributeName' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '^[a-zA-Z0-9._-]*$', ], 'AttributeNameAndValue' => [ 'type' => 'structure', 'required' => [ 'AttributeName', 'Value', ], 'members' => [ 'AttributeName' => [ 'shape' => 'AttributeName', ], 'Value' => [ 'shape' => 'TypedAttributeValue', ], ], ], 'AttributeNameAndValueList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AttributeNameAndValue', ], ], 'AttributeNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AttributeName', ], ], 'BatchAddFacetToObject' => [ 'type' => 'structure', 'required' => [ 'SchemaFacet', 'ObjectAttributeList', 'ObjectReference', ], 'members' => [ 'SchemaFacet' => [ 'shape' => 'SchemaFacet', ], 'ObjectAttributeList' => [ 'shape' => 'AttributeKeyAndValueList', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'BatchAddFacetToObjectResponse' => [ 'type' => 'structure', 'members' => [], ], 'BatchAttachObject' => [ 'type' => 'structure', 'required' => [ 'ParentReference', 'ChildReference', 'LinkName', ], 'members' => [ 'ParentReference' => [ 'shape' => 'ObjectReference', ], 'ChildReference' => [ 'shape' => 'ObjectReference', ], 'LinkName' => [ 'shape' => 'LinkName', ], ], ], 'BatchAttachObjectResponse' => [ 'type' => 'structure', 'members' => [ 'attachedObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'BatchAttachPolicy' => [ 'type' => 'structure', 'required' => [ 'PolicyReference', 'ObjectReference', ], 'members' => [ 'PolicyReference' => [ 'shape' => 'ObjectReference', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'BatchAttachPolicyResponse' => [ 'type' => 'structure', 'members' => [], ], 'BatchAttachToIndex' => [ 'type' => 'structure', 'required' => [ 'IndexReference', 'TargetReference', ], 'members' => [ 'IndexReference' => [ 'shape' => 'ObjectReference', ], 'TargetReference' => [ 'shape' => 'ObjectReference', ], ], ], 'BatchAttachToIndexResponse' => [ 'type' => 'structure', 'members' => [ 'AttachedObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'BatchAttachTypedLink' => [ 'type' => 'structure', 'required' => [ 'SourceObjectReference', 'TargetObjectReference', 'TypedLinkFacet', 'Attributes', ], 'members' => [ 'SourceObjectReference' => [ 'shape' => 'ObjectReference', ], 'TargetObjectReference' => [ 'shape' => 'ObjectReference', ], 'TypedLinkFacet' => [ 'shape' => 'TypedLinkSchemaAndFacetName', ], 'Attributes' => [ 'shape' => 'AttributeNameAndValueList', ], ], ], 'BatchAttachTypedLinkResponse' => [ 'type' => 'structure', 'members' => [ 'TypedLinkSpecifier' => [ 'shape' => 'TypedLinkSpecifier', ], ], ], 'BatchCreateIndex' => [ 'type' => 'structure', 'required' => [ 'OrderedIndexedAttributeList', 'IsUnique', ], 'members' => [ 'OrderedIndexedAttributeList' => [ 'shape' => 'AttributeKeyList', ], 'IsUnique' => [ 'shape' => 'Bool', ], 'ParentReference' => [ 'shape' => 'ObjectReference', ], 'LinkName' => [ 'shape' => 'LinkName', ], 'BatchReferenceName' => [ 'shape' => 'BatchReferenceName', ], ], ], 'BatchCreateIndexResponse' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'BatchCreateObject' => [ 'type' => 'structure', 'required' => [ 'SchemaFacet', 'ObjectAttributeList', ], 'members' => [ 'SchemaFacet' => [ 'shape' => 'SchemaFacetList', ], 'ObjectAttributeList' => [ 'shape' => 'AttributeKeyAndValueList', ], 'ParentReference' => [ 'shape' => 'ObjectReference', ], 'LinkName' => [ 'shape' => 'LinkName', ], 'BatchReferenceName' => [ 'shape' => 'BatchReferenceName', ], ], ], 'BatchCreateObjectResponse' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'BatchDeleteObject' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'BatchDeleteObjectResponse' => [ 'type' => 'structure', 'members' => [], ], 'BatchDetachFromIndex' => [ 'type' => 'structure', 'required' => [ 'IndexReference', 'TargetReference', ], 'members' => [ 'IndexReference' => [ 'shape' => 'ObjectReference', ], 'TargetReference' => [ 'shape' => 'ObjectReference', ], ], ], 'BatchDetachFromIndexResponse' => [ 'type' => 'structure', 'members' => [ 'DetachedObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'BatchDetachObject' => [ 'type' => 'structure', 'required' => [ 'ParentReference', 'LinkName', ], 'members' => [ 'ParentReference' => [ 'shape' => 'ObjectReference', ], 'LinkName' => [ 'shape' => 'LinkName', ], 'BatchReferenceName' => [ 'shape' => 'BatchReferenceName', ], ], ], 'BatchDetachObjectResponse' => [ 'type' => 'structure', 'members' => [ 'detachedObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'BatchDetachPolicy' => [ 'type' => 'structure', 'required' => [ 'PolicyReference', 'ObjectReference', ], 'members' => [ 'PolicyReference' => [ 'shape' => 'ObjectReference', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'BatchDetachPolicyResponse' => [ 'type' => 'structure', 'members' => [], ], 'BatchDetachTypedLink' => [ 'type' => 'structure', 'required' => [ 'TypedLinkSpecifier', ], 'members' => [ 'TypedLinkSpecifier' => [ 'shape' => 'TypedLinkSpecifier', ], ], ], 'BatchDetachTypedLinkResponse' => [ 'type' => 'structure', 'members' => [], ], 'BatchGetLinkAttributes' => [ 'type' => 'structure', 'required' => [ 'TypedLinkSpecifier', 'AttributeNames', ], 'members' => [ 'TypedLinkSpecifier' => [ 'shape' => 'TypedLinkSpecifier', ], 'AttributeNames' => [ 'shape' => 'AttributeNameList', ], ], ], 'BatchGetLinkAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'AttributeKeyAndValueList', ], ], ], 'BatchGetObjectAttributes' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', 'SchemaFacet', 'AttributeNames', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'SchemaFacet' => [ 'shape' => 'SchemaFacet', ], 'AttributeNames' => [ 'shape' => 'AttributeNameList', ], ], ], 'BatchGetObjectAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'AttributeKeyAndValueList', ], ], ], 'BatchGetObjectInformation' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'BatchGetObjectInformationResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaFacets' => [ 'shape' => 'SchemaFacetList', ], 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'BatchListAttachedIndices' => [ 'type' => 'structure', 'required' => [ 'TargetReference', ], 'members' => [ 'TargetReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchListAttachedIndicesResponse' => [ 'type' => 'structure', 'members' => [ 'IndexAttachments' => [ 'shape' => 'IndexAttachmentList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListIncomingTypedLinks' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'FilterAttributeRanges' => [ 'shape' => 'TypedLinkAttributeRangeList', ], 'FilterTypedLink' => [ 'shape' => 'TypedLinkSchemaAndFacetName', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchListIncomingTypedLinksResponse' => [ 'type' => 'structure', 'members' => [ 'LinkSpecifiers' => [ 'shape' => 'TypedLinkSpecifierList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListIndex' => [ 'type' => 'structure', 'required' => [ 'IndexReference', ], 'members' => [ 'RangesOnIndexedValues' => [ 'shape' => 'ObjectAttributeRangeList', ], 'IndexReference' => [ 'shape' => 'ObjectReference', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListIndexResponse' => [ 'type' => 'structure', 'members' => [ 'IndexAttachments' => [ 'shape' => 'IndexAttachmentList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListObjectAttributes' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'FacetFilter' => [ 'shape' => 'SchemaFacet', ], ], ], 'BatchListObjectAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'AttributeKeyAndValueList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListObjectChildren' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchListObjectChildrenResponse' => [ 'type' => 'structure', 'members' => [ 'Children' => [ 'shape' => 'LinkNameToObjectIdentifierMap', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListObjectParentPaths' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchListObjectParentPathsResponse' => [ 'type' => 'structure', 'members' => [ 'PathToObjectIdentifiersList' => [ 'shape' => 'PathToObjectIdentifiersList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListObjectPolicies' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchListObjectPoliciesResponse' => [ 'type' => 'structure', 'members' => [ 'AttachedPolicyIds' => [ 'shape' => 'ObjectIdentifierList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListOutgoingTypedLinks' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'FilterAttributeRanges' => [ 'shape' => 'TypedLinkAttributeRangeList', ], 'FilterTypedLink' => [ 'shape' => 'TypedLinkSchemaAndFacetName', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchListOutgoingTypedLinksResponse' => [ 'type' => 'structure', 'members' => [ 'TypedLinkSpecifiers' => [ 'shape' => 'TypedLinkSpecifierList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListPolicyAttachments' => [ 'type' => 'structure', 'required' => [ 'PolicyReference', ], 'members' => [ 'PolicyReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchListPolicyAttachmentsResponse' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifiers' => [ 'shape' => 'ObjectIdentifierList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchLookupPolicy' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchLookupPolicyResponse' => [ 'type' => 'structure', 'members' => [ 'PolicyToPathList' => [ 'shape' => 'PolicyToPathList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchOperationIndex' => [ 'type' => 'integer', ], 'BatchReadException' => [ 'type' => 'structure', 'members' => [ 'Type' => [ 'shape' => 'BatchReadExceptionType', ], 'Message' => [ 'shape' => 'ExceptionMessage', ], ], ], 'BatchReadExceptionType' => [ 'type' => 'string', 'enum' => [ 'ValidationException', 'InvalidArnException', 'ResourceNotFoundException', 'InvalidNextTokenException', 'AccessDeniedException', 'NotNodeException', 'FacetValidationException', 'CannotListParentOfRootException', 'NotIndexException', 'NotPolicyException', 'DirectoryNotEnabledException', 'LimitExceededException', 'InternalServiceException', ], ], 'BatchReadOperation' => [ 'type' => 'structure', 'members' => [ 'ListObjectAttributes' => [ 'shape' => 'BatchListObjectAttributes', ], 'ListObjectChildren' => [ 'shape' => 'BatchListObjectChildren', ], 'ListAttachedIndices' => [ 'shape' => 'BatchListAttachedIndices', ], 'ListObjectParentPaths' => [ 'shape' => 'BatchListObjectParentPaths', ], 'GetObjectInformation' => [ 'shape' => 'BatchGetObjectInformation', ], 'GetObjectAttributes' => [ 'shape' => 'BatchGetObjectAttributes', ], 'ListObjectPolicies' => [ 'shape' => 'BatchListObjectPolicies', ], 'ListPolicyAttachments' => [ 'shape' => 'BatchListPolicyAttachments', ], 'LookupPolicy' => [ 'shape' => 'BatchLookupPolicy', ], 'ListIndex' => [ 'shape' => 'BatchListIndex', ], 'ListOutgoingTypedLinks' => [ 'shape' => 'BatchListOutgoingTypedLinks', ], 'ListIncomingTypedLinks' => [ 'shape' => 'BatchListIncomingTypedLinks', ], 'GetLinkAttributes' => [ 'shape' => 'BatchGetLinkAttributes', ], ], ], 'BatchReadOperationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BatchReadOperation', ], ], 'BatchReadOperationResponse' => [ 'type' => 'structure', 'members' => [ 'SuccessfulResponse' => [ 'shape' => 'BatchReadSuccessfulResponse', ], 'ExceptionResponse' => [ 'shape' => 'BatchReadException', ], ], ], 'BatchReadOperationResponseList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BatchReadOperationResponse', ], ], 'BatchReadRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'Operations', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Operations' => [ 'shape' => 'BatchReadOperationList', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], ], ], 'BatchReadResponse' => [ 'type' => 'structure', 'members' => [ 'Responses' => [ 'shape' => 'BatchReadOperationResponseList', ], ], ], 'BatchReadSuccessfulResponse' => [ 'type' => 'structure', 'members' => [ 'ListObjectAttributes' => [ 'shape' => 'BatchListObjectAttributesResponse', ], 'ListObjectChildren' => [ 'shape' => 'BatchListObjectChildrenResponse', ], 'GetObjectInformation' => [ 'shape' => 'BatchGetObjectInformationResponse', ], 'GetObjectAttributes' => [ 'shape' => 'BatchGetObjectAttributesResponse', ], 'ListAttachedIndices' => [ 'shape' => 'BatchListAttachedIndicesResponse', ], 'ListObjectParentPaths' => [ 'shape' => 'BatchListObjectParentPathsResponse', ], 'ListObjectPolicies' => [ 'shape' => 'BatchListObjectPoliciesResponse', ], 'ListPolicyAttachments' => [ 'shape' => 'BatchListPolicyAttachmentsResponse', ], 'LookupPolicy' => [ 'shape' => 'BatchLookupPolicyResponse', ], 'ListIndex' => [ 'shape' => 'BatchListIndexResponse', ], 'ListOutgoingTypedLinks' => [ 'shape' => 'BatchListOutgoingTypedLinksResponse', ], 'ListIncomingTypedLinks' => [ 'shape' => 'BatchListIncomingTypedLinksResponse', ], 'GetLinkAttributes' => [ 'shape' => 'BatchGetLinkAttributesResponse', ], ], ], 'BatchReferenceName' => [ 'type' => 'string', ], 'BatchRemoveFacetFromObject' => [ 'type' => 'structure', 'required' => [ 'SchemaFacet', 'ObjectReference', ], 'members' => [ 'SchemaFacet' => [ 'shape' => 'SchemaFacet', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'BatchRemoveFacetFromObjectResponse' => [ 'type' => 'structure', 'members' => [], ], 'BatchUpdateLinkAttributes' => [ 'type' => 'structure', 'required' => [ 'TypedLinkSpecifier', 'AttributeUpdates', ], 'members' => [ 'TypedLinkSpecifier' => [ 'shape' => 'TypedLinkSpecifier', ], 'AttributeUpdates' => [ 'shape' => 'LinkAttributeUpdateList', ], ], ], 'BatchUpdateLinkAttributesResponse' => [ 'type' => 'structure', 'members' => [], ], 'BatchUpdateObjectAttributes' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', 'AttributeUpdates', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'AttributeUpdates' => [ 'shape' => 'ObjectAttributeUpdateList', ], ], ], 'BatchUpdateObjectAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'BatchWriteException' => [ 'type' => 'structure', 'members' => [ 'Index' => [ 'shape' => 'BatchOperationIndex', ], 'Type' => [ 'shape' => 'BatchWriteExceptionType', ], 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'exception' => true, ], 'BatchWriteExceptionType' => [ 'type' => 'string', 'enum' => [ 'InternalServiceException', 'ValidationException', 'InvalidArnException', 'LinkNameAlreadyInUseException', 'StillContainsLinksException', 'FacetValidationException', 'ObjectNotDetachedException', 'ResourceNotFoundException', 'AccessDeniedException', 'InvalidAttachmentException', 'NotIndexException', 'NotNodeException', 'IndexedAttributeMissingException', 'ObjectAlreadyDetachedException', 'NotPolicyException', 'DirectoryNotEnabledException', 'LimitExceededException', 'UnsupportedIndexTypeException', ], ], 'BatchWriteOperation' => [ 'type' => 'structure', 'members' => [ 'CreateObject' => [ 'shape' => 'BatchCreateObject', ], 'AttachObject' => [ 'shape' => 'BatchAttachObject', ], 'DetachObject' => [ 'shape' => 'BatchDetachObject', ], 'UpdateObjectAttributes' => [ 'shape' => 'BatchUpdateObjectAttributes', ], 'DeleteObject' => [ 'shape' => 'BatchDeleteObject', ], 'AddFacetToObject' => [ 'shape' => 'BatchAddFacetToObject', ], 'RemoveFacetFromObject' => [ 'shape' => 'BatchRemoveFacetFromObject', ], 'AttachPolicy' => [ 'shape' => 'BatchAttachPolicy', ], 'DetachPolicy' => [ 'shape' => 'BatchDetachPolicy', ], 'CreateIndex' => [ 'shape' => 'BatchCreateIndex', ], 'AttachToIndex' => [ 'shape' => 'BatchAttachToIndex', ], 'DetachFromIndex' => [ 'shape' => 'BatchDetachFromIndex', ], 'AttachTypedLink' => [ 'shape' => 'BatchAttachTypedLink', ], 'DetachTypedLink' => [ 'shape' => 'BatchDetachTypedLink', ], 'UpdateLinkAttributes' => [ 'shape' => 'BatchUpdateLinkAttributes', ], ], ], 'BatchWriteOperationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BatchWriteOperation', ], ], 'BatchWriteOperationResponse' => [ 'type' => 'structure', 'members' => [ 'CreateObject' => [ 'shape' => 'BatchCreateObjectResponse', ], 'AttachObject' => [ 'shape' => 'BatchAttachObjectResponse', ], 'DetachObject' => [ 'shape' => 'BatchDetachObjectResponse', ], 'UpdateObjectAttributes' => [ 'shape' => 'BatchUpdateObjectAttributesResponse', ], 'DeleteObject' => [ 'shape' => 'BatchDeleteObjectResponse', ], 'AddFacetToObject' => [ 'shape' => 'BatchAddFacetToObjectResponse', ], 'RemoveFacetFromObject' => [ 'shape' => 'BatchRemoveFacetFromObjectResponse', ], 'AttachPolicy' => [ 'shape' => 'BatchAttachPolicyResponse', ], 'DetachPolicy' => [ 'shape' => 'BatchDetachPolicyResponse', ], 'CreateIndex' => [ 'shape' => 'BatchCreateIndexResponse', ], 'AttachToIndex' => [ 'shape' => 'BatchAttachToIndexResponse', ], 'DetachFromIndex' => [ 'shape' => 'BatchDetachFromIndexResponse', ], 'AttachTypedLink' => [ 'shape' => 'BatchAttachTypedLinkResponse', ], 'DetachTypedLink' => [ 'shape' => 'BatchDetachTypedLinkResponse', ], 'UpdateLinkAttributes' => [ 'shape' => 'BatchUpdateLinkAttributesResponse', ], ], ], 'BatchWriteOperationResponseList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BatchWriteOperationResponse', ], ], 'BatchWriteRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'Operations', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Operations' => [ 'shape' => 'BatchWriteOperationList', ], ], ], 'BatchWriteResponse' => [ 'type' => 'structure', 'members' => [ 'Responses' => [ 'shape' => 'BatchWriteOperationResponseList', ], ], ], 'BinaryAttributeValue' => [ 'type' => 'blob', ], 'Bool' => [ 'type' => 'boolean', ], 'BooleanAttributeValue' => [ 'type' => 'boolean', ], 'CannotListParentOfRootException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ConsistencyLevel' => [ 'type' => 'string', 'enum' => [ 'SERIALIZABLE', 'EVENTUAL', ], ], 'CreateDirectoryRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'SchemaArn', ], 'members' => [ 'Name' => [ 'shape' => 'DirectoryName', ], 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], ], ], 'CreateDirectoryResponse' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'Name', 'ObjectIdentifier', 'AppliedSchemaArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'DirectoryArn', ], 'Name' => [ 'shape' => 'DirectoryName', ], 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], 'AppliedSchemaArn' => [ 'shape' => 'Arn', ], ], ], 'CreateFacetRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', 'ObjectType', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'FacetName', ], 'Attributes' => [ 'shape' => 'FacetAttributeList', ], 'ObjectType' => [ 'shape' => 'ObjectType', ], ], ], 'CreateFacetResponse' => [ 'type' => 'structure', 'members' => [], ], 'CreateIndexRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'OrderedIndexedAttributeList', 'IsUnique', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'OrderedIndexedAttributeList' => [ 'shape' => 'AttributeKeyList', ], 'IsUnique' => [ 'shape' => 'Bool', ], 'ParentReference' => [ 'shape' => 'ObjectReference', ], 'LinkName' => [ 'shape' => 'LinkName', ], ], ], 'CreateIndexResponse' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'CreateObjectRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'SchemaFacets', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'SchemaFacets' => [ 'shape' => 'SchemaFacetList', ], 'ObjectAttributeList' => [ 'shape' => 'AttributeKeyAndValueList', ], 'ParentReference' => [ 'shape' => 'ObjectReference', ], 'LinkName' => [ 'shape' => 'LinkName', ], ], ], 'CreateObjectResponse' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'CreateSchemaRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'SchemaName', ], ], ], 'CreateSchemaResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], ], ], 'CreateTypedLinkFacetRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Facet', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Facet' => [ 'shape' => 'TypedLinkFacet', ], ], ], 'CreateTypedLinkFacetResponse' => [ 'type' => 'structure', 'members' => [], ], 'Date' => [ 'type' => 'timestamp', ], 'DatetimeAttributeValue' => [ 'type' => 'timestamp', ], 'DeleteDirectoryRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], ], ], 'DeleteDirectoryResponse' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', ], ], ], 'DeleteFacetRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'FacetName', ], ], ], 'DeleteFacetResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteObjectRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'DeleteObjectResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteSchemaRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], ], ], 'DeleteSchemaResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], ], ], 'DeleteTypedLinkFacetRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'TypedLinkName', ], ], ], 'DeleteTypedLinkFacetResponse' => [ 'type' => 'structure', 'members' => [], ], 'DetachFromIndexRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'IndexReference', 'TargetReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'IndexReference' => [ 'shape' => 'ObjectReference', ], 'TargetReference' => [ 'shape' => 'ObjectReference', ], ], ], 'DetachFromIndexResponse' => [ 'type' => 'structure', 'members' => [ 'DetachedObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'DetachObjectRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ParentReference', 'LinkName', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ParentReference' => [ 'shape' => 'ObjectReference', ], 'LinkName' => [ 'shape' => 'LinkName', ], ], ], 'DetachObjectResponse' => [ 'type' => 'structure', 'members' => [ 'DetachedObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'DetachPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'PolicyReference', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'PolicyReference' => [ 'shape' => 'ObjectReference', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'DetachPolicyResponse' => [ 'type' => 'structure', 'members' => [], ], 'DetachTypedLinkRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'TypedLinkSpecifier', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'TypedLinkSpecifier' => [ 'shape' => 'TypedLinkSpecifier', ], ], ], 'Directory' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'DirectoryName', ], 'DirectoryArn' => [ 'shape' => 'DirectoryArn', ], 'State' => [ 'shape' => 'DirectoryState', ], 'CreationDateTime' => [ 'shape' => 'Date', ], ], ], 'DirectoryAlreadyExistsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'DirectoryArn' => [ 'type' => 'string', ], 'DirectoryDeletedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'DirectoryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Directory', ], ], 'DirectoryName' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '^[a-zA-Z0-9._-]*$', ], 'DirectoryNotDisabledException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'DirectoryNotEnabledException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'DirectoryState' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'DISABLED', 'DELETED', ], ], 'DisableDirectoryRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], ], ], 'DisableDirectoryResponse' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', ], ], ], 'EnableDirectoryRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], ], ], 'EnableDirectoryResponse' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', ], ], ], 'ExceptionMessage' => [ 'type' => 'string', ], 'Facet' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'FacetName', ], 'ObjectType' => [ 'shape' => 'ObjectType', ], ], ], 'FacetAlreadyExistsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'FacetAttribute' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'AttributeName', ], 'AttributeDefinition' => [ 'shape' => 'FacetAttributeDefinition', ], 'AttributeReference' => [ 'shape' => 'FacetAttributeReference', ], 'RequiredBehavior' => [ 'shape' => 'RequiredAttributeBehavior', ], ], ], 'FacetAttributeDefinition' => [ 'type' => 'structure', 'required' => [ 'Type', ], 'members' => [ 'Type' => [ 'shape' => 'FacetAttributeType', ], 'DefaultValue' => [ 'shape' => 'TypedAttributeValue', ], 'IsImmutable' => [ 'shape' => 'Bool', ], 'Rules' => [ 'shape' => 'RuleMap', ], ], ], 'FacetAttributeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'FacetAttribute', ], ], 'FacetAttributeReference' => [ 'type' => 'structure', 'required' => [ 'TargetFacetName', 'TargetAttributeName', ], 'members' => [ 'TargetFacetName' => [ 'shape' => 'FacetName', ], 'TargetAttributeName' => [ 'shape' => 'AttributeName', ], ], ], 'FacetAttributeType' => [ 'type' => 'string', 'enum' => [ 'STRING', 'BINARY', 'BOOLEAN', 'NUMBER', 'DATETIME', ], ], 'FacetAttributeUpdate' => [ 'type' => 'structure', 'members' => [ 'Attribute' => [ 'shape' => 'FacetAttribute', ], 'Action' => [ 'shape' => 'UpdateActionType', ], ], ], 'FacetAttributeUpdateList' => [ 'type' => 'list', 'member' => [ 'shape' => 'FacetAttributeUpdate', ], ], 'FacetInUseException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'FacetName' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '^[a-zA-Z0-9._-]*$', ], 'FacetNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'FacetName', ], ], 'FacetNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'FacetValidationException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'GetAppliedSchemaVersionRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], ], ], 'GetAppliedSchemaVersionResponse' => [ 'type' => 'structure', 'members' => [ 'AppliedSchemaArn' => [ 'shape' => 'Arn', ], ], ], 'GetDirectoryRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'DirectoryArn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], ], ], 'GetDirectoryResponse' => [ 'type' => 'structure', 'required' => [ 'Directory', ], 'members' => [ 'Directory' => [ 'shape' => 'Directory', ], ], ], 'GetFacetRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'FacetName', ], ], ], 'GetFacetResponse' => [ 'type' => 'structure', 'members' => [ 'Facet' => [ 'shape' => 'Facet', ], ], ], 'GetLinkAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'TypedLinkSpecifier', 'AttributeNames', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'TypedLinkSpecifier' => [ 'shape' => 'TypedLinkSpecifier', ], 'AttributeNames' => [ 'shape' => 'AttributeNameList', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', ], ], ], 'GetLinkAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'AttributeKeyAndValueList', ], ], ], 'GetObjectAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', 'SchemaFacet', 'AttributeNames', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], 'SchemaFacet' => [ 'shape' => 'SchemaFacet', ], 'AttributeNames' => [ 'shape' => 'AttributeNameList', ], ], ], 'GetObjectAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'AttributeKeyAndValueList', ], ], ], 'GetObjectInformationRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], ], ], 'GetObjectInformationResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaFacets' => [ 'shape' => 'SchemaFacetList', ], 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'GetSchemaAsJsonRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], ], ], 'GetSchemaAsJsonResponse' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'SchemaName', ], 'Document' => [ 'shape' => 'SchemaJsonDocument', ], ], ], 'GetTypedLinkFacetInformationRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'TypedLinkName', ], ], ], 'GetTypedLinkFacetInformationResponse' => [ 'type' => 'structure', 'members' => [ 'IdentityAttributeOrder' => [ 'shape' => 'AttributeNameList', ], ], ], 'IncompatibleSchemaException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'IndexAttachment' => [ 'type' => 'structure', 'members' => [ 'IndexedAttributes' => [ 'shape' => 'AttributeKeyAndValueList', ], 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'IndexAttachmentList' => [ 'type' => 'list', 'member' => [ 'shape' => 'IndexAttachment', ], ], 'IndexedAttributeMissingException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'InternalServiceException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, ], 'InvalidArnException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'InvalidAttachmentException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'InvalidFacetUpdateException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'InvalidNextTokenException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'InvalidRuleException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'InvalidSchemaDocException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'InvalidTaggingRequestException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'LinkAttributeAction' => [ 'type' => 'structure', 'members' => [ 'AttributeActionType' => [ 'shape' => 'UpdateActionType', ], 'AttributeUpdateValue' => [ 'shape' => 'TypedAttributeValue', ], ], ], 'LinkAttributeUpdate' => [ 'type' => 'structure', 'members' => [ 'AttributeKey' => [ 'shape' => 'AttributeKey', ], 'AttributeAction' => [ 'shape' => 'LinkAttributeAction', ], ], ], 'LinkAttributeUpdateList' => [ 'type' => 'list', 'member' => [ 'shape' => 'LinkAttributeUpdate', ], ], 'LinkName' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '[^\\\\/\\\\[\\\\]\\\\(\\\\):\\\\{\\\\}#@!?\\\\s\\\\\\\\;]+', ], 'LinkNameAlreadyInUseException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'LinkNameToObjectIdentifierMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'LinkName', ], 'value' => [ 'shape' => 'ObjectIdentifier', ], ], 'ListAppliedSchemaArnsRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', ], 'SchemaArn' => [ 'shape' => 'Arn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListAppliedSchemaArnsResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaArns' => [ 'shape' => 'Arns', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListAttachedIndicesRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'TargetReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'TargetReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], ], ], 'ListAttachedIndicesResponse' => [ 'type' => 'structure', 'members' => [ 'IndexAttachments' => [ 'shape' => 'IndexAttachmentList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListDevelopmentSchemaArnsRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListDevelopmentSchemaArnsResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaArns' => [ 'shape' => 'Arns', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListDirectoriesRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'state' => [ 'shape' => 'DirectoryState', ], ], ], 'ListDirectoriesResponse' => [ 'type' => 'structure', 'required' => [ 'Directories', ], 'members' => [ 'Directories' => [ 'shape' => 'DirectoryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListFacetAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'FacetName', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListFacetAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'FacetAttributeList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListFacetNamesRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListFacetNamesResponse' => [ 'type' => 'structure', 'members' => [ 'FacetNames' => [ 'shape' => 'FacetNameList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListIncomingTypedLinksRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'FilterAttributeRanges' => [ 'shape' => 'TypedLinkAttributeRangeList', ], 'FilterTypedLink' => [ 'shape' => 'TypedLinkSchemaAndFacetName', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', ], ], ], 'ListIncomingTypedLinksResponse' => [ 'type' => 'structure', 'members' => [ 'LinkSpecifiers' => [ 'shape' => 'TypedLinkSpecifierList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListIndexRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'IndexReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'RangesOnIndexedValues' => [ 'shape' => 'ObjectAttributeRangeList', ], 'IndexReference' => [ 'shape' => 'ObjectReference', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], ], ], 'ListIndexResponse' => [ 'type' => 'structure', 'members' => [ 'IndexAttachments' => [ 'shape' => 'IndexAttachmentList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListObjectAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], 'FacetFilter' => [ 'shape' => 'SchemaFacet', ], ], ], 'ListObjectAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'AttributeKeyAndValueList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListObjectChildrenRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], ], ], 'ListObjectChildrenResponse' => [ 'type' => 'structure', 'members' => [ 'Children' => [ 'shape' => 'LinkNameToObjectIdentifierMap', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListObjectParentPathsRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListObjectParentPathsResponse' => [ 'type' => 'structure', 'members' => [ 'PathToObjectIdentifiersList' => [ 'shape' => 'PathToObjectIdentifiersList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListObjectParentsRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], ], ], 'ListObjectParentsResponse' => [ 'type' => 'structure', 'members' => [ 'Parents' => [ 'shape' => 'ObjectIdentifierToLinkNameMap', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListObjectPoliciesRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], ], ], 'ListObjectPoliciesResponse' => [ 'type' => 'structure', 'members' => [ 'AttachedPolicyIds' => [ 'shape' => 'ObjectIdentifierList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListOutgoingTypedLinksRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'FilterAttributeRanges' => [ 'shape' => 'TypedLinkAttributeRangeList', ], 'FilterTypedLink' => [ 'shape' => 'TypedLinkSchemaAndFacetName', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', ], ], ], 'ListOutgoingTypedLinksResponse' => [ 'type' => 'structure', 'members' => [ 'TypedLinkSpecifiers' => [ 'shape' => 'TypedLinkSpecifierList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListPolicyAttachmentsRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'PolicyReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'PolicyReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], ], ], 'ListPolicyAttachmentsResponse' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifiers' => [ 'shape' => 'ObjectIdentifierList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListPublishedSchemaArnsRequest' => [ 'type' => 'structure', 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListPublishedSchemaArnsResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaArns' => [ 'shape' => 'Arns', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'TagsNumberResults', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTypedLinkFacetAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'TypedLinkName', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListTypedLinkFacetAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'TypedLinkAttributeDefinitionList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTypedLinkFacetNamesRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListTypedLinkFacetNamesResponse' => [ 'type' => 'structure', 'members' => [ 'FacetNames' => [ 'shape' => 'TypedLinkNameList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'LookupPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'LookupPolicyResponse' => [ 'type' => 'structure', 'members' => [ 'PolicyToPathList' => [ 'shape' => 'PolicyToPathList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'NextToken' => [ 'type' => 'string', ], 'NotIndexException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'NotNodeException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'NotPolicyException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'NumberAttributeValue' => [ 'type' => 'string', ], 'NumberResults' => [ 'type' => 'integer', 'min' => 1, ], 'ObjectAlreadyDetachedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ObjectAttributeAction' => [ 'type' => 'structure', 'members' => [ 'ObjectAttributeActionType' => [ 'shape' => 'UpdateActionType', ], 'ObjectAttributeUpdateValue' => [ 'shape' => 'TypedAttributeValue', ], ], ], 'ObjectAttributeRange' => [ 'type' => 'structure', 'members' => [ 'AttributeKey' => [ 'shape' => 'AttributeKey', ], 'Range' => [ 'shape' => 'TypedAttributeValueRange', ], ], ], 'ObjectAttributeRangeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ObjectAttributeRange', ], ], 'ObjectAttributeUpdate' => [ 'type' => 'structure', 'members' => [ 'ObjectAttributeKey' => [ 'shape' => 'AttributeKey', ], 'ObjectAttributeAction' => [ 'shape' => 'ObjectAttributeAction', ], ], ], 'ObjectAttributeUpdateList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ObjectAttributeUpdate', ], ], 'ObjectIdentifier' => [ 'type' => 'string', ], 'ObjectIdentifierList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ObjectIdentifier', ], ], 'ObjectIdentifierToLinkNameMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'ObjectIdentifier', ], 'value' => [ 'shape' => 'LinkName', ], ], 'ObjectNotDetachedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ObjectReference' => [ 'type' => 'structure', 'members' => [ 'Selector' => [ 'shape' => 'SelectorObjectReference', ], ], ], 'ObjectType' => [ 'type' => 'string', 'enum' => [ 'NODE', 'LEAF_NODE', 'POLICY', 'INDEX', ], ], 'PathString' => [ 'type' => 'string', ], 'PathToObjectIdentifiers' => [ 'type' => 'structure', 'members' => [ 'Path' => [ 'shape' => 'PathString', ], 'ObjectIdentifiers' => [ 'shape' => 'ObjectIdentifierList', ], ], ], 'PathToObjectIdentifiersList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PathToObjectIdentifiers', ], ], 'PolicyAttachment' => [ 'type' => 'structure', 'members' => [ 'PolicyId' => [ 'shape' => 'ObjectIdentifier', ], 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], 'PolicyType' => [ 'shape' => 'PolicyType', ], ], ], 'PolicyAttachmentList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PolicyAttachment', ], ], 'PolicyToPath' => [ 'type' => 'structure', 'members' => [ 'Path' => [ 'shape' => 'PathString', ], 'Policies' => [ 'shape' => 'PolicyAttachmentList', ], ], ], 'PolicyToPathList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PolicyToPath', ], ], 'PolicyType' => [ 'type' => 'string', ], 'PublishSchemaRequest' => [ 'type' => 'structure', 'required' => [ 'DevelopmentSchemaArn', 'Version', ], 'members' => [ 'DevelopmentSchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Version' => [ 'shape' => 'Version', ], 'MinorVersion' => [ 'shape' => 'Version', ], 'Name' => [ 'shape' => 'SchemaName', ], ], ], 'PublishSchemaResponse' => [ 'type' => 'structure', 'members' => [ 'PublishedSchemaArn' => [ 'shape' => 'Arn', ], ], ], 'PutSchemaFromJsonRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Document', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Document' => [ 'shape' => 'SchemaJsonDocument', ], ], ], 'PutSchemaFromJsonResponse' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], ], ], 'RangeMode' => [ 'type' => 'string', 'enum' => [ 'FIRST', 'LAST', 'LAST_BEFORE_MISSING_VALUES', 'INCLUSIVE', 'EXCLUSIVE', ], ], 'RemoveFacetFromObjectRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'SchemaFacet', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'SchemaFacet' => [ 'shape' => 'SchemaFacet', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'RemoveFacetFromObjectResponse' => [ 'type' => 'structure', 'members' => [], ], 'RequiredAttributeBehavior' => [ 'type' => 'string', 'enum' => [ 'REQUIRED_ALWAYS', 'NOT_REQUIRED', ], ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'RetryableConflictException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'Rule' => [ 'type' => 'structure', 'members' => [ 'Type' => [ 'shape' => 'RuleType', ], 'Parameters' => [ 'shape' => 'RuleParameterMap', ], ], ], 'RuleKey' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '^[a-zA-Z0-9._-]*$', ], 'RuleMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'RuleKey', ], 'value' => [ 'shape' => 'Rule', ], ], 'RuleParameterKey' => [ 'type' => 'string', ], 'RuleParameterMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'RuleParameterKey', ], 'value' => [ 'shape' => 'RuleParameterValue', ], ], 'RuleParameterValue' => [ 'type' => 'string', ], 'RuleType' => [ 'type' => 'string', 'enum' => [ 'BINARY_LENGTH', 'NUMBER_COMPARISON', 'STRING_FROM_SET', 'STRING_LENGTH', ], ], 'SchemaAlreadyExistsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'SchemaAlreadyPublishedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'SchemaFacet' => [ 'type' => 'structure', 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], 'FacetName' => [ 'shape' => 'FacetName', ], ], ], 'SchemaFacetList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SchemaFacet', ], ], 'SchemaJsonDocument' => [ 'type' => 'string', ], 'SchemaName' => [ 'type' => 'string', 'max' => 32, 'min' => 1, 'pattern' => '^[a-zA-Z0-9._-]*$', ], 'SelectorObjectReference' => [ 'type' => 'string', ], 'StillContainsLinksException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'StringAttributeValue' => [ 'type' => 'string', ], 'Tag' => [ 'type' => 'structure', 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], ], 'TagKey' => [ 'type' => 'string', ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'Tags', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', ], 'TagsNumberResults' => [ 'type' => 'integer', 'min' => 50, ], 'TypedAttributeValue' => [ 'type' => 'structure', 'members' => [ 'StringValue' => [ 'shape' => 'StringAttributeValue', ], 'BinaryValue' => [ 'shape' => 'BinaryAttributeValue', ], 'BooleanValue' => [ 'shape' => 'BooleanAttributeValue', ], 'NumberValue' => [ 'shape' => 'NumberAttributeValue', ], 'DatetimeValue' => [ 'shape' => 'DatetimeAttributeValue', ], ], ], 'TypedAttributeValueRange' => [ 'type' => 'structure', 'required' => [ 'StartMode', 'EndMode', ], 'members' => [ 'StartMode' => [ 'shape' => 'RangeMode', ], 'StartValue' => [ 'shape' => 'TypedAttributeValue', ], 'EndMode' => [ 'shape' => 'RangeMode', ], 'EndValue' => [ 'shape' => 'TypedAttributeValue', ], ], ], 'TypedLinkAttributeDefinition' => [ 'type' => 'structure', 'required' => [ 'Name', 'Type', 'RequiredBehavior', ], 'members' => [ 'Name' => [ 'shape' => 'AttributeName', ], 'Type' => [ 'shape' => 'FacetAttributeType', ], 'DefaultValue' => [ 'shape' => 'TypedAttributeValue', ], 'IsImmutable' => [ 'shape' => 'Bool', ], 'Rules' => [ 'shape' => 'RuleMap', ], 'RequiredBehavior' => [ 'shape' => 'RequiredAttributeBehavior', ], ], ], 'TypedLinkAttributeDefinitionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TypedLinkAttributeDefinition', ], ], 'TypedLinkAttributeRange' => [ 'type' => 'structure', 'required' => [ 'Range', ], 'members' => [ 'AttributeName' => [ 'shape' => 'AttributeName', ], 'Range' => [ 'shape' => 'TypedAttributeValueRange', ], ], ], 'TypedLinkAttributeRangeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TypedLinkAttributeRange', ], ], 'TypedLinkFacet' => [ 'type' => 'structure', 'required' => [ 'Name', 'Attributes', 'IdentityAttributeOrder', ], 'members' => [ 'Name' => [ 'shape' => 'TypedLinkName', ], 'Attributes' => [ 'shape' => 'TypedLinkAttributeDefinitionList', ], 'IdentityAttributeOrder' => [ 'shape' => 'AttributeNameList', ], ], ], 'TypedLinkFacetAttributeUpdate' => [ 'type' => 'structure', 'required' => [ 'Attribute', 'Action', ], 'members' => [ 'Attribute' => [ 'shape' => 'TypedLinkAttributeDefinition', ], 'Action' => [ 'shape' => 'UpdateActionType', ], ], ], 'TypedLinkFacetAttributeUpdateList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TypedLinkFacetAttributeUpdate', ], ], 'TypedLinkName' => [ 'type' => 'string', 'pattern' => '^[a-zA-Z0-9._-]*$', ], 'TypedLinkNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TypedLinkName', ], ], 'TypedLinkSchemaAndFacetName' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'TypedLinkName', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], 'TypedLinkName' => [ 'shape' => 'TypedLinkName', ], ], ], 'TypedLinkSpecifier' => [ 'type' => 'structure', 'required' => [ 'TypedLinkFacet', 'SourceObjectReference', 'TargetObjectReference', 'IdentityAttributeValues', ], 'members' => [ 'TypedLinkFacet' => [ 'shape' => 'TypedLinkSchemaAndFacetName', ], 'SourceObjectReference' => [ 'shape' => 'ObjectReference', ], 'TargetObjectReference' => [ 'shape' => 'ObjectReference', ], 'IdentityAttributeValues' => [ 'shape' => 'AttributeNameAndValueList', ], ], ], 'TypedLinkSpecifierList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TypedLinkSpecifier', ], ], 'UnsupportedIndexTypeException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'TagKeys', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', ], 'TagKeys' => [ 'shape' => 'TagKeyList', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateActionType' => [ 'type' => 'string', 'enum' => [ 'CREATE_OR_UPDATE', 'DELETE', ], ], 'UpdateFacetRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'FacetName', ], 'AttributeUpdates' => [ 'shape' => 'FacetAttributeUpdateList', ], 'ObjectType' => [ 'shape' => 'ObjectType', ], ], ], 'UpdateFacetResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateLinkAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'TypedLinkSpecifier', 'AttributeUpdates', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'TypedLinkSpecifier' => [ 'shape' => 'TypedLinkSpecifier', ], 'AttributeUpdates' => [ 'shape' => 'LinkAttributeUpdateList', ], ], ], 'UpdateLinkAttributesResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateObjectAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', 'AttributeUpdates', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'AttributeUpdates' => [ 'shape' => 'ObjectAttributeUpdateList', ], ], ], 'UpdateObjectAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'UpdateSchemaRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'SchemaName', ], ], ], 'UpdateSchemaResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], ], ], 'UpdateTypedLinkFacetRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', 'AttributeUpdates', 'IdentityAttributeOrder', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'TypedLinkName', ], 'AttributeUpdates' => [ 'shape' => 'TypedLinkFacetAttributeUpdateList', ], 'IdentityAttributeOrder' => [ 'shape' => 'AttributeNameList', ], ], ], 'UpdateTypedLinkFacetResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpgradeAppliedSchemaRequest' => [ 'type' => 'structure', 'required' => [ 'PublishedSchemaArn', 'DirectoryArn', ], 'members' => [ 'PublishedSchemaArn' => [ 'shape' => 'Arn', ], 'DirectoryArn' => [ 'shape' => 'Arn', ], 'DryRun' => [ 'shape' => 'Bool', ], ], ], 'UpgradeAppliedSchemaResponse' => [ 'type' => 'structure', 'members' => [ 'UpgradedSchemaArn' => [ 'shape' => 'Arn', ], 'DirectoryArn' => [ 'shape' => 'Arn', ], ], ], 'UpgradePublishedSchemaRequest' => [ 'type' => 'structure', 'required' => [ 'DevelopmentSchemaArn', 'PublishedSchemaArn', 'MinorVersion', ], 'members' => [ 'DevelopmentSchemaArn' => [ 'shape' => 'Arn', ], 'PublishedSchemaArn' => [ 'shape' => 'Arn', ], 'MinorVersion' => [ 'shape' => 'Version', ], 'DryRun' => [ 'shape' => 'Bool', ], ], ], 'UpgradePublishedSchemaResponse' => [ 'type' => 'structure', 'members' => [ 'UpgradedSchemaArn' => [ 'shape' => 'Arn', ], ], ], 'ValidationException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'Version' => [ 'type' => 'string', 'max' => 10, 'min' => 1, 'pattern' => '^[a-zA-Z0-9._-]*$', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/clouddirectory/2016-05-10/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => false, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], [ 'fn' => 'parseURL', 'argv' => [ [ 'ref' => 'Endpoint', ], ], 'assign' => 'url', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://clouddirectory-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://clouddirectory-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://clouddirectory.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://clouddirectory.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/clouddirectory/2016-05-10/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.ap-south-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ap-south-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ap-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.ca-central-1.api.aws', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ca-central-1.api.aws', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ca-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ca-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.eu-central-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.eu-central-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.eu-central-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-central-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-west-2.api.aws', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.af-south-1.api.aws', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.af-south-1.api.aws', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region af-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.af-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'af-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.eu-north-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.eu-north-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.eu-north-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-north-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.eu-west-3.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.eu-west-3.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-3 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.eu-west-3.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-3', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.eu-west-2.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.eu-west-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.eu-west-1.api.aws', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.eu-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'eu-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.ap-northeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ap-northeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ap-northeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.ap-northeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ap-northeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-northeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ap-northeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-northeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.me-south-1.api.aws', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.me-south-1.api.aws', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region me-south-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.me-south-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'me-south-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.sa-east-1.api.aws', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.sa-east-1.api.aws', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region sa-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.sa-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'sa-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.ap-east-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ap-east-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ap-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.us-gov-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-gov-west-1.api.aws', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-gov-west-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.ap-southeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ap-southeast-1.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.ap-southeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ap-southeast-2.api.aws', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'ap-southeast-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-east-1.api.aws', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-east-1.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-east-2.api.aws', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-east-2.amazonaws.com', ], ], 'params' => [ 'Region' => 'us-east-2', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => true, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => true, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.cn-northwest-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => true, 'UseFIPS' => false, ], ], [ 'documentation' => 'For region cn-northwest-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.cn-northwest-1.amazonaws.com.cn', ], ], 'params' => [ 'Region' => 'cn-northwest-1', 'UseDualStack' => false, 'UseFIPS' => false, ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => false, 'UseFIPS' => true, 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'Region' => 'us-east-1', 'UseDualStack' => true, 'UseFIPS' => false, 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/clouddirectory/2016-05-10/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/clouddirectory/2016-05-10/paginators-1.json\nreturn [ 'pagination' => [ 'ListAppliedSchemaArns' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListAttachedIndices' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListDevelopmentSchemaArns' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListDirectories' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListFacetAttributes' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListFacetNames' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListIndex' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListObjectAttributes' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListObjectChildren' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListObjectParentPaths' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListObjectParents' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListObjectPolicies' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListPolicyAttachments' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListPublishedSchemaArns' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListTagsForResource' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListTypedLinkFacetAttributes' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListTypedLinkFacetNames' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'LookupPolicy' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/clouddirectory/2017-01-11/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2017-01-11', 'endpointPrefix' => 'clouddirectory', 'protocol' => 'rest-json', 'serviceFullName' => 'Amazon CloudDirectory', 'serviceId' => 'CloudDirectory', 'signatureVersion' => 'v4', 'signingName' => 'clouddirectory', 'uid' => 'clouddirectory-2017-01-11', ], 'operations' => [ 'AddFacetToObject' => [ 'name' => 'AddFacetToObject', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/facets', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AddFacetToObjectRequest', ], 'output' => [ 'shape' => 'AddFacetToObjectResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'ApplySchema' => [ 'name' => 'ApplySchema', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/apply', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ApplySchemaRequest', ], 'output' => [ 'shape' => 'ApplySchemaResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'SchemaAlreadyExistsException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidAttachmentException', ], ], ], 'AttachObject' => [ 'name' => 'AttachObject', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/attach', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AttachObjectRequest', ], 'output' => [ 'shape' => 'AttachObjectResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'LinkNameAlreadyInUseException', ], [ 'shape' => 'InvalidAttachmentException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'AttachPolicy' => [ 'name' => 'AttachPolicy', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/policy/attach', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AttachPolicyRequest', ], 'output' => [ 'shape' => 'AttachPolicyResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'NotPolicyException', ], ], ], 'AttachToIndex' => [ 'name' => 'AttachToIndex', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/index/attach', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AttachToIndexRequest', ], 'output' => [ 'shape' => 'AttachToIndexResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'InvalidAttachmentException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'LinkNameAlreadyInUseException', ], [ 'shape' => 'IndexedAttributeMissingException', ], [ 'shape' => 'NotIndexException', ], ], ], 'AttachTypedLink' => [ 'name' => 'AttachTypedLink', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/attach', 'responseCode' => 200, ], 'input' => [ 'shape' => 'AttachTypedLinkRequest', ], 'output' => [ 'shape' => 'AttachTypedLinkResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidAttachmentException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'BatchRead' => [ 'name' => 'BatchRead', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/batchread', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchReadRequest', ], 'output' => [ 'shape' => 'BatchReadResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], ], ], 'BatchWrite' => [ 'name' => 'BatchWrite', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/batchwrite', 'responseCode' => 200, ], 'input' => [ 'shape' => 'BatchWriteRequest', ], 'output' => [ 'shape' => 'BatchWriteResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'BatchWriteException', ], ], ], 'CreateDirectory' => [ 'name' => 'CreateDirectory', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/directory/create', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateDirectoryRequest', ], 'output' => [ 'shape' => 'CreateDirectoryResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryAlreadyExistsException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'CreateFacet' => [ 'name' => 'CreateFacet', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/facet/create', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateFacetRequest', ], 'output' => [ 'shape' => 'CreateFacetResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetAlreadyExistsException', ], [ 'shape' => 'InvalidRuleException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'CreateIndex' => [ 'name' => 'CreateIndex', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/index', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateIndexRequest', ], 'output' => [ 'shape' => 'CreateIndexResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetValidationException', ], [ 'shape' => 'LinkNameAlreadyInUseException', ], [ 'shape' => 'UnsupportedIndexTypeException', ], ], ], 'CreateObject' => [ 'name' => 'CreateObject', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/object', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateObjectRequest', ], 'output' => [ 'shape' => 'CreateObjectResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetValidationException', ], [ 'shape' => 'LinkNameAlreadyInUseException', ], [ 'shape' => 'UnsupportedIndexTypeException', ], ], ], 'CreateSchema' => [ 'name' => 'CreateSchema', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/create', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateSchemaRequest', ], 'output' => [ 'shape' => 'CreateSchemaResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'SchemaAlreadyExistsException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'CreateTypedLinkFacet' => [ 'name' => 'CreateTypedLinkFacet', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/facet/create', 'responseCode' => 200, ], 'input' => [ 'shape' => 'CreateTypedLinkFacetRequest', ], 'output' => [ 'shape' => 'CreateTypedLinkFacetResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetAlreadyExistsException', ], [ 'shape' => 'InvalidRuleException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'DeleteDirectory' => [ 'name' => 'DeleteDirectory', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/directory', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteDirectoryRequest', ], 'output' => [ 'shape' => 'DeleteDirectoryResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'DirectoryNotDisabledException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryDeletedException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'InvalidArnException', ], ], ], 'DeleteFacet' => [ 'name' => 'DeleteFacet', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/facet/delete', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteFacetRequest', ], 'output' => [ 'shape' => 'DeleteFacetResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetNotFoundException', ], [ 'shape' => 'FacetInUseException', ], ], ], 'DeleteObject' => [ 'name' => 'DeleteObject', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/delete', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteObjectRequest', ], 'output' => [ 'shape' => 'DeleteObjectResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ObjectNotDetachedException', ], ], ], 'DeleteSchema' => [ 'name' => 'DeleteSchema', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteSchemaRequest', ], 'output' => [ 'shape' => 'DeleteSchemaResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'StillContainsLinksException', ], ], ], 'DeleteTypedLinkFacet' => [ 'name' => 'DeleteTypedLinkFacet', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/facet/delete', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DeleteTypedLinkFacetRequest', ], 'output' => [ 'shape' => 'DeleteTypedLinkFacetResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetNotFoundException', ], ], ], 'DetachFromIndex' => [ 'name' => 'DetachFromIndex', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/index/detach', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DetachFromIndexRequest', ], 'output' => [ 'shape' => 'DetachFromIndexResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ObjectAlreadyDetachedException', ], [ 'shape' => 'NotIndexException', ], ], ], 'DetachObject' => [ 'name' => 'DetachObject', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/detach', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DetachObjectRequest', ], 'output' => [ 'shape' => 'DetachObjectResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'NotNodeException', ], ], ], 'DetachPolicy' => [ 'name' => 'DetachPolicy', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/policy/detach', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DetachPolicyRequest', ], 'output' => [ 'shape' => 'DetachPolicyResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'NotPolicyException', ], ], ], 'DetachTypedLink' => [ 'name' => 'DetachTypedLink', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/detach', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DetachTypedLinkRequest', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'DisableDirectory' => [ 'name' => 'DisableDirectory', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/directory/disable', 'responseCode' => 200, ], 'input' => [ 'shape' => 'DisableDirectoryRequest', ], 'output' => [ 'shape' => 'DisableDirectoryResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'DirectoryDeletedException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'InvalidArnException', ], ], ], 'EnableDirectory' => [ 'name' => 'EnableDirectory', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/directory/enable', 'responseCode' => 200, ], 'input' => [ 'shape' => 'EnableDirectoryRequest', ], 'output' => [ 'shape' => 'EnableDirectoryResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'DirectoryDeletedException', ], [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'InvalidArnException', ], ], ], 'GetAppliedSchemaVersion' => [ 'name' => 'GetAppliedSchemaVersion', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/getappliedschema', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetAppliedSchemaVersionRequest', ], 'output' => [ 'shape' => 'GetAppliedSchemaVersionResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetDirectory' => [ 'name' => 'GetDirectory', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/directory/get', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetDirectoryRequest', ], 'output' => [ 'shape' => 'GetDirectoryResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], ], ], 'GetFacet' => [ 'name' => 'GetFacet', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/facet', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetFacetRequest', ], 'output' => [ 'shape' => 'GetFacetResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetNotFoundException', ], ], ], 'GetLinkAttributes' => [ 'name' => 'GetLinkAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/attributes/get', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetLinkAttributesRequest', ], 'output' => [ 'shape' => 'GetLinkAttributesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'GetObjectAttributes' => [ 'name' => 'GetObjectAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/attributes/get', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetObjectAttributesRequest', ], 'output' => [ 'shape' => 'GetObjectAttributesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'GetObjectInformation' => [ 'name' => 'GetObjectInformation', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/information', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetObjectInformationRequest', ], 'output' => [ 'shape' => 'GetObjectInformationResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'GetSchemaAsJson' => [ 'name' => 'GetSchemaAsJson', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/json', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetSchemaAsJsonRequest', ], 'output' => [ 'shape' => 'GetSchemaAsJsonResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'ValidationException', ], ], ], 'GetTypedLinkFacetInformation' => [ 'name' => 'GetTypedLinkFacetInformation', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/facet/get', 'responseCode' => 200, ], 'input' => [ 'shape' => 'GetTypedLinkFacetInformationRequest', ], 'output' => [ 'shape' => 'GetTypedLinkFacetInformationResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'FacetNotFoundException', ], ], ], 'ListAppliedSchemaArns' => [ 'name' => 'ListAppliedSchemaArns', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/applied', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAppliedSchemaArnsRequest', ], 'output' => [ 'shape' => 'ListAppliedSchemaArnsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListAttachedIndices' => [ 'name' => 'ListAttachedIndices', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/indices', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListAttachedIndicesRequest', ], 'output' => [ 'shape' => 'ListAttachedIndicesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListDevelopmentSchemaArns' => [ 'name' => 'ListDevelopmentSchemaArns', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/development', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListDevelopmentSchemaArnsRequest', ], 'output' => [ 'shape' => 'ListDevelopmentSchemaArnsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListDirectories' => [ 'name' => 'ListDirectories', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/directory/list', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListDirectoriesRequest', ], 'output' => [ 'shape' => 'ListDirectoriesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListFacetAttributes' => [ 'name' => 'ListFacetAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/facet/attributes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListFacetAttributesRequest', ], 'output' => [ 'shape' => 'ListFacetAttributesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListFacetNames' => [ 'name' => 'ListFacetNames', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/facet/list', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListFacetNamesRequest', ], 'output' => [ 'shape' => 'ListFacetNamesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListIncomingTypedLinks' => [ 'name' => 'ListIncomingTypedLinks', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/incoming', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListIncomingTypedLinksRequest', ], 'output' => [ 'shape' => 'ListIncomingTypedLinksResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'ListIndex' => [ 'name' => 'ListIndex', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/index/targets', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListIndexRequest', ], 'output' => [ 'shape' => 'ListIndexResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'FacetValidationException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'NotIndexException', ], ], ], 'ListManagedSchemaArns' => [ 'name' => 'ListManagedSchemaArns', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/managed', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListManagedSchemaArnsRequest', ], 'output' => [ 'shape' => 'ListManagedSchemaArnsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListObjectAttributes' => [ 'name' => 'ListObjectAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/attributes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListObjectAttributesRequest', ], 'output' => [ 'shape' => 'ListObjectAttributesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'ListObjectChildren' => [ 'name' => 'ListObjectChildren', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/children', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListObjectChildrenRequest', ], 'output' => [ 'shape' => 'ListObjectChildrenResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'NotNodeException', ], ], ], 'ListObjectParentPaths' => [ 'name' => 'ListObjectParentPaths', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/parentpaths', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListObjectParentPathsRequest', ], 'output' => [ 'shape' => 'ListObjectParentPathsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'ListObjectParents' => [ 'name' => 'ListObjectParents', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/parent', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListObjectParentsRequest', ], 'output' => [ 'shape' => 'ListObjectParentsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'CannotListParentOfRootException', ], ], ], 'ListObjectPolicies' => [ 'name' => 'ListObjectPolicies', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/policy', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListObjectPoliciesRequest', ], 'output' => [ 'shape' => 'ListObjectPoliciesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListOutgoingTypedLinks' => [ 'name' => 'ListOutgoingTypedLinks', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/outgoing', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListOutgoingTypedLinksRequest', ], 'output' => [ 'shape' => 'ListOutgoingTypedLinksResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'ListPolicyAttachments' => [ 'name' => 'ListPolicyAttachments', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/policy/attachment', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListPolicyAttachmentsRequest', ], 'output' => [ 'shape' => 'ListPolicyAttachmentsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'NotPolicyException', ], ], ], 'ListPublishedSchemaArns' => [ 'name' => 'ListPublishedSchemaArns', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/published', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListPublishedSchemaArnsRequest', ], 'output' => [ 'shape' => 'ListPublishedSchemaArnsResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListTagsForResource' => [ 'name' => 'ListTagsForResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/tags', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTagsForResourceRequest', ], 'output' => [ 'shape' => 'ListTagsForResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidTaggingRequestException', ], ], ], 'ListTypedLinkFacetAttributes' => [ 'name' => 'ListTypedLinkFacetAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/facet/attributes', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTypedLinkFacetAttributesRequest', ], 'output' => [ 'shape' => 'ListTypedLinkFacetAttributesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'ListTypedLinkFacetNames' => [ 'name' => 'ListTypedLinkFacetNames', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/facet/list', 'responseCode' => 200, ], 'input' => [ 'shape' => 'ListTypedLinkFacetNamesRequest', ], 'output' => [ 'shape' => 'ListTypedLinkFacetNamesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidNextTokenException', ], ], ], 'LookupPolicy' => [ 'name' => 'LookupPolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/policy/lookup', 'responseCode' => 200, ], 'input' => [ 'shape' => 'LookupPolicyRequest', ], 'output' => [ 'shape' => 'LookupPolicyResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'InvalidNextTokenException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'PublishSchema' => [ 'name' => 'PublishSchema', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/publish', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PublishSchemaRequest', ], 'output' => [ 'shape' => 'PublishSchemaResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'SchemaAlreadyPublishedException', ], ], ], 'PutSchemaFromJson' => [ 'name' => 'PutSchemaFromJson', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/json', 'responseCode' => 200, ], 'input' => [ 'shape' => 'PutSchemaFromJsonRequest', ], 'output' => [ 'shape' => 'PutSchemaFromJsonResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InvalidSchemaDocException', ], [ 'shape' => 'InvalidRuleException', ], ], ], 'RemoveFacetFromObject' => [ 'name' => 'RemoveFacetFromObject', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/facets/delete', 'responseCode' => 200, ], 'input' => [ 'shape' => 'RemoveFacetFromObjectRequest', ], 'output' => [ 'shape' => 'RemoveFacetFromObjectResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'TagResource' => [ 'name' => 'TagResource', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/tags/add', 'responseCode' => 200, ], 'input' => [ 'shape' => 'TagResourceRequest', ], 'output' => [ 'shape' => 'TagResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidTaggingRequestException', ], ], ], 'UntagResource' => [ 'name' => 'UntagResource', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/tags/remove', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UntagResourceRequest', ], 'output' => [ 'shape' => 'UntagResourceResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidTaggingRequestException', ], ], ], 'UpdateFacet' => [ 'name' => 'UpdateFacet', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/facet', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateFacetRequest', ], 'output' => [ 'shape' => 'UpdateFacetResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'InvalidFacetUpdateException', ], [ 'shape' => 'FacetValidationException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetNotFoundException', ], [ 'shape' => 'InvalidRuleException', ], ], ], 'UpdateLinkAttributes' => [ 'name' => 'UpdateLinkAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/attributes/update', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateLinkAttributesRequest', ], 'output' => [ 'shape' => 'UpdateLinkAttributesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'UpdateObjectAttributes' => [ 'name' => 'UpdateObjectAttributes', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/object/update', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateObjectAttributesRequest', ], 'output' => [ 'shape' => 'UpdateObjectAttributesResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'DirectoryNotEnabledException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'LinkNameAlreadyInUseException', ], [ 'shape' => 'FacetValidationException', ], ], ], 'UpdateSchema' => [ 'name' => 'UpdateSchema', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/update', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateSchemaRequest', ], 'output' => [ 'shape' => 'UpdateSchemaResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], ], ], 'UpdateTypedLinkFacet' => [ 'name' => 'UpdateTypedLinkFacet', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/typedlink/facet', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpdateTypedLinkFacetRequest', ], 'output' => [ 'shape' => 'UpdateTypedLinkFacetResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'FacetValidationException', ], [ 'shape' => 'InvalidFacetUpdateException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'FacetNotFoundException', ], [ 'shape' => 'InvalidRuleException', ], ], ], 'UpgradeAppliedSchema' => [ 'name' => 'UpgradeAppliedSchema', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/upgradeapplied', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpgradeAppliedSchemaRequest', ], 'output' => [ 'shape' => 'UpgradeAppliedSchemaResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'IncompatibleSchemaException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidAttachmentException', ], [ 'shape' => 'SchemaAlreadyExistsException', ], ], ], 'UpgradePublishedSchema' => [ 'name' => 'UpgradePublishedSchema', 'http' => [ 'method' => 'PUT', 'requestUri' => '/amazonclouddirectory/2017-01-11/schema/upgradepublished', 'responseCode' => 200, ], 'input' => [ 'shape' => 'UpgradePublishedSchemaRequest', ], 'output' => [ 'shape' => 'UpgradePublishedSchemaResponse', ], 'errors' => [ [ 'shape' => 'InternalServiceException', ], [ 'shape' => 'InvalidArnException', ], [ 'shape' => 'RetryableConflictException', ], [ 'shape' => 'ValidationException', ], [ 'shape' => 'IncompatibleSchemaException', ], [ 'shape' => 'AccessDeniedException', ], [ 'shape' => 'ResourceNotFoundException', ], [ 'shape' => 'InvalidAttachmentException', ], [ 'shape' => 'LimitExceededException', ], ], ], ], 'shapes' => [ 'AccessDeniedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 403, ], 'exception' => true, ], 'AddFacetToObjectRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'SchemaFacet', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'SchemaFacet' => [ 'shape' => 'SchemaFacet', ], 'ObjectAttributeList' => [ 'shape' => 'AttributeKeyAndValueList', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'AddFacetToObjectResponse' => [ 'type' => 'structure', 'members' => [], ], 'ApplySchemaRequest' => [ 'type' => 'structure', 'required' => [ 'PublishedSchemaArn', 'DirectoryArn', ], 'members' => [ 'PublishedSchemaArn' => [ 'shape' => 'Arn', ], 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], ], ], 'ApplySchemaResponse' => [ 'type' => 'structure', 'members' => [ 'AppliedSchemaArn' => [ 'shape' => 'Arn', ], 'DirectoryArn' => [ 'shape' => 'Arn', ], ], ], 'Arn' => [ 'type' => 'string', ], 'Arns' => [ 'type' => 'list', 'member' => [ 'shape' => 'Arn', ], ], 'AttachObjectRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ParentReference', 'ChildReference', 'LinkName', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ParentReference' => [ 'shape' => 'ObjectReference', ], 'ChildReference' => [ 'shape' => 'ObjectReference', ], 'LinkName' => [ 'shape' => 'LinkName', ], ], ], 'AttachObjectResponse' => [ 'type' => 'structure', 'members' => [ 'AttachedObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'AttachPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'PolicyReference', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'PolicyReference' => [ 'shape' => 'ObjectReference', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'AttachPolicyResponse' => [ 'type' => 'structure', 'members' => [], ], 'AttachToIndexRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'IndexReference', 'TargetReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'IndexReference' => [ 'shape' => 'ObjectReference', ], 'TargetReference' => [ 'shape' => 'ObjectReference', ], ], ], 'AttachToIndexResponse' => [ 'type' => 'structure', 'members' => [ 'AttachedObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'AttachTypedLinkRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'SourceObjectReference', 'TargetObjectReference', 'TypedLinkFacet', 'Attributes', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'SourceObjectReference' => [ 'shape' => 'ObjectReference', ], 'TargetObjectReference' => [ 'shape' => 'ObjectReference', ], 'TypedLinkFacet' => [ 'shape' => 'TypedLinkSchemaAndFacetName', ], 'Attributes' => [ 'shape' => 'AttributeNameAndValueList', ], ], ], 'AttachTypedLinkResponse' => [ 'type' => 'structure', 'members' => [ 'TypedLinkSpecifier' => [ 'shape' => 'TypedLinkSpecifier', ], ], ], 'AttributeKey' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'FacetName', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], 'FacetName' => [ 'shape' => 'FacetName', ], 'Name' => [ 'shape' => 'AttributeName', ], ], ], 'AttributeKeyAndValue' => [ 'type' => 'structure', 'required' => [ 'Key', 'Value', ], 'members' => [ 'Key' => [ 'shape' => 'AttributeKey', ], 'Value' => [ 'shape' => 'TypedAttributeValue', ], ], ], 'AttributeKeyAndValueList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AttributeKeyAndValue', ], ], 'AttributeKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AttributeKey', ], ], 'AttributeName' => [ 'type' => 'string', 'max' => 230, 'min' => 1, 'pattern' => '^[a-zA-Z0-9._:-]*$', ], 'AttributeNameAndValue' => [ 'type' => 'structure', 'required' => [ 'AttributeName', 'Value', ], 'members' => [ 'AttributeName' => [ 'shape' => 'AttributeName', ], 'Value' => [ 'shape' => 'TypedAttributeValue', ], ], ], 'AttributeNameAndValueList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AttributeNameAndValue', ], ], 'AttributeNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AttributeName', ], ], 'BatchAddFacetToObject' => [ 'type' => 'structure', 'required' => [ 'SchemaFacet', 'ObjectAttributeList', 'ObjectReference', ], 'members' => [ 'SchemaFacet' => [ 'shape' => 'SchemaFacet', ], 'ObjectAttributeList' => [ 'shape' => 'AttributeKeyAndValueList', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'BatchAddFacetToObjectResponse' => [ 'type' => 'structure', 'members' => [], ], 'BatchAttachObject' => [ 'type' => 'structure', 'required' => [ 'ParentReference', 'ChildReference', 'LinkName', ], 'members' => [ 'ParentReference' => [ 'shape' => 'ObjectReference', ], 'ChildReference' => [ 'shape' => 'ObjectReference', ], 'LinkName' => [ 'shape' => 'LinkName', ], ], ], 'BatchAttachObjectResponse' => [ 'type' => 'structure', 'members' => [ 'attachedObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'BatchAttachPolicy' => [ 'type' => 'structure', 'required' => [ 'PolicyReference', 'ObjectReference', ], 'members' => [ 'PolicyReference' => [ 'shape' => 'ObjectReference', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'BatchAttachPolicyResponse' => [ 'type' => 'structure', 'members' => [], ], 'BatchAttachToIndex' => [ 'type' => 'structure', 'required' => [ 'IndexReference', 'TargetReference', ], 'members' => [ 'IndexReference' => [ 'shape' => 'ObjectReference', ], 'TargetReference' => [ 'shape' => 'ObjectReference', ], ], ], 'BatchAttachToIndexResponse' => [ 'type' => 'structure', 'members' => [ 'AttachedObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'BatchAttachTypedLink' => [ 'type' => 'structure', 'required' => [ 'SourceObjectReference', 'TargetObjectReference', 'TypedLinkFacet', 'Attributes', ], 'members' => [ 'SourceObjectReference' => [ 'shape' => 'ObjectReference', ], 'TargetObjectReference' => [ 'shape' => 'ObjectReference', ], 'TypedLinkFacet' => [ 'shape' => 'TypedLinkSchemaAndFacetName', ], 'Attributes' => [ 'shape' => 'AttributeNameAndValueList', ], ], ], 'BatchAttachTypedLinkResponse' => [ 'type' => 'structure', 'members' => [ 'TypedLinkSpecifier' => [ 'shape' => 'TypedLinkSpecifier', ], ], ], 'BatchCreateIndex' => [ 'type' => 'structure', 'required' => [ 'OrderedIndexedAttributeList', 'IsUnique', ], 'members' => [ 'OrderedIndexedAttributeList' => [ 'shape' => 'AttributeKeyList', ], 'IsUnique' => [ 'shape' => 'Bool', ], 'ParentReference' => [ 'shape' => 'ObjectReference', ], 'LinkName' => [ 'shape' => 'LinkName', ], 'BatchReferenceName' => [ 'shape' => 'BatchReferenceName', ], ], ], 'BatchCreateIndexResponse' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'BatchCreateObject' => [ 'type' => 'structure', 'required' => [ 'SchemaFacet', 'ObjectAttributeList', ], 'members' => [ 'SchemaFacet' => [ 'shape' => 'SchemaFacetList', ], 'ObjectAttributeList' => [ 'shape' => 'AttributeKeyAndValueList', ], 'ParentReference' => [ 'shape' => 'ObjectReference', ], 'LinkName' => [ 'shape' => 'LinkName', ], 'BatchReferenceName' => [ 'shape' => 'BatchReferenceName', ], ], ], 'BatchCreateObjectResponse' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'BatchDeleteObject' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'BatchDeleteObjectResponse' => [ 'type' => 'structure', 'members' => [], ], 'BatchDetachFromIndex' => [ 'type' => 'structure', 'required' => [ 'IndexReference', 'TargetReference', ], 'members' => [ 'IndexReference' => [ 'shape' => 'ObjectReference', ], 'TargetReference' => [ 'shape' => 'ObjectReference', ], ], ], 'BatchDetachFromIndexResponse' => [ 'type' => 'structure', 'members' => [ 'DetachedObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'BatchDetachObject' => [ 'type' => 'structure', 'required' => [ 'ParentReference', 'LinkName', ], 'members' => [ 'ParentReference' => [ 'shape' => 'ObjectReference', ], 'LinkName' => [ 'shape' => 'LinkName', ], 'BatchReferenceName' => [ 'shape' => 'BatchReferenceName', ], ], ], 'BatchDetachObjectResponse' => [ 'type' => 'structure', 'members' => [ 'detachedObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'BatchDetachPolicy' => [ 'type' => 'structure', 'required' => [ 'PolicyReference', 'ObjectReference', ], 'members' => [ 'PolicyReference' => [ 'shape' => 'ObjectReference', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'BatchDetachPolicyResponse' => [ 'type' => 'structure', 'members' => [], ], 'BatchDetachTypedLink' => [ 'type' => 'structure', 'required' => [ 'TypedLinkSpecifier', ], 'members' => [ 'TypedLinkSpecifier' => [ 'shape' => 'TypedLinkSpecifier', ], ], ], 'BatchDetachTypedLinkResponse' => [ 'type' => 'structure', 'members' => [], ], 'BatchGetLinkAttributes' => [ 'type' => 'structure', 'required' => [ 'TypedLinkSpecifier', 'AttributeNames', ], 'members' => [ 'TypedLinkSpecifier' => [ 'shape' => 'TypedLinkSpecifier', ], 'AttributeNames' => [ 'shape' => 'AttributeNameList', ], ], ], 'BatchGetLinkAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'AttributeKeyAndValueList', ], ], ], 'BatchGetObjectAttributes' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', 'SchemaFacet', 'AttributeNames', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'SchemaFacet' => [ 'shape' => 'SchemaFacet', ], 'AttributeNames' => [ 'shape' => 'AttributeNameList', ], ], ], 'BatchGetObjectAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'AttributeKeyAndValueList', ], ], ], 'BatchGetObjectInformation' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'BatchGetObjectInformationResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaFacets' => [ 'shape' => 'SchemaFacetList', ], 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'BatchListAttachedIndices' => [ 'type' => 'structure', 'required' => [ 'TargetReference', ], 'members' => [ 'TargetReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchListAttachedIndicesResponse' => [ 'type' => 'structure', 'members' => [ 'IndexAttachments' => [ 'shape' => 'IndexAttachmentList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListIncomingTypedLinks' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'FilterAttributeRanges' => [ 'shape' => 'TypedLinkAttributeRangeList', ], 'FilterTypedLink' => [ 'shape' => 'TypedLinkSchemaAndFacetName', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchListIncomingTypedLinksResponse' => [ 'type' => 'structure', 'members' => [ 'LinkSpecifiers' => [ 'shape' => 'TypedLinkSpecifierList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListIndex' => [ 'type' => 'structure', 'required' => [ 'IndexReference', ], 'members' => [ 'RangesOnIndexedValues' => [ 'shape' => 'ObjectAttributeRangeList', ], 'IndexReference' => [ 'shape' => 'ObjectReference', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListIndexResponse' => [ 'type' => 'structure', 'members' => [ 'IndexAttachments' => [ 'shape' => 'IndexAttachmentList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListObjectAttributes' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'FacetFilter' => [ 'shape' => 'SchemaFacet', ], ], ], 'BatchListObjectAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'AttributeKeyAndValueList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListObjectChildren' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchListObjectChildrenResponse' => [ 'type' => 'structure', 'members' => [ 'Children' => [ 'shape' => 'LinkNameToObjectIdentifierMap', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListObjectParentPaths' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchListObjectParentPathsResponse' => [ 'type' => 'structure', 'members' => [ 'PathToObjectIdentifiersList' => [ 'shape' => 'PathToObjectIdentifiersList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListObjectParents' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchListObjectParentsResponse' => [ 'type' => 'structure', 'members' => [ 'ParentLinks' => [ 'shape' => 'ObjectIdentifierAndLinkNameList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListObjectPolicies' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchListObjectPoliciesResponse' => [ 'type' => 'structure', 'members' => [ 'AttachedPolicyIds' => [ 'shape' => 'ObjectIdentifierList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListOutgoingTypedLinks' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'FilterAttributeRanges' => [ 'shape' => 'TypedLinkAttributeRangeList', ], 'FilterTypedLink' => [ 'shape' => 'TypedLinkSchemaAndFacetName', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchListOutgoingTypedLinksResponse' => [ 'type' => 'structure', 'members' => [ 'TypedLinkSpecifiers' => [ 'shape' => 'TypedLinkSpecifierList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchListPolicyAttachments' => [ 'type' => 'structure', 'required' => [ 'PolicyReference', ], 'members' => [ 'PolicyReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchListPolicyAttachmentsResponse' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifiers' => [ 'shape' => 'ObjectIdentifierList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchLookupPolicy' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'BatchLookupPolicyResponse' => [ 'type' => 'structure', 'members' => [ 'PolicyToPathList' => [ 'shape' => 'PolicyToPathList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'BatchOperationIndex' => [ 'type' => 'integer', ], 'BatchReadException' => [ 'type' => 'structure', 'members' => [ 'Type' => [ 'shape' => 'BatchReadExceptionType', ], 'Message' => [ 'shape' => 'ExceptionMessage', ], ], ], 'BatchReadExceptionType' => [ 'type' => 'string', 'enum' => [ 'ValidationException', 'InvalidArnException', 'ResourceNotFoundException', 'InvalidNextTokenException', 'AccessDeniedException', 'NotNodeException', 'FacetValidationException', 'CannotListParentOfRootException', 'NotIndexException', 'NotPolicyException', 'DirectoryNotEnabledException', 'LimitExceededException', 'InternalServiceException', ], ], 'BatchReadOperation' => [ 'type' => 'structure', 'members' => [ 'ListObjectAttributes' => [ 'shape' => 'BatchListObjectAttributes', ], 'ListObjectChildren' => [ 'shape' => 'BatchListObjectChildren', ], 'ListAttachedIndices' => [ 'shape' => 'BatchListAttachedIndices', ], 'ListObjectParentPaths' => [ 'shape' => 'BatchListObjectParentPaths', ], 'GetObjectInformation' => [ 'shape' => 'BatchGetObjectInformation', ], 'GetObjectAttributes' => [ 'shape' => 'BatchGetObjectAttributes', ], 'ListObjectParents' => [ 'shape' => 'BatchListObjectParents', ], 'ListObjectPolicies' => [ 'shape' => 'BatchListObjectPolicies', ], 'ListPolicyAttachments' => [ 'shape' => 'BatchListPolicyAttachments', ], 'LookupPolicy' => [ 'shape' => 'BatchLookupPolicy', ], 'ListIndex' => [ 'shape' => 'BatchListIndex', ], 'ListOutgoingTypedLinks' => [ 'shape' => 'BatchListOutgoingTypedLinks', ], 'ListIncomingTypedLinks' => [ 'shape' => 'BatchListIncomingTypedLinks', ], 'GetLinkAttributes' => [ 'shape' => 'BatchGetLinkAttributes', ], ], ], 'BatchReadOperationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BatchReadOperation', ], ], 'BatchReadOperationResponse' => [ 'type' => 'structure', 'members' => [ 'SuccessfulResponse' => [ 'shape' => 'BatchReadSuccessfulResponse', ], 'ExceptionResponse' => [ 'shape' => 'BatchReadException', ], ], ], 'BatchReadOperationResponseList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BatchReadOperationResponse', ], ], 'BatchReadRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'Operations', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Operations' => [ 'shape' => 'BatchReadOperationList', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], ], ], 'BatchReadResponse' => [ 'type' => 'structure', 'members' => [ 'Responses' => [ 'shape' => 'BatchReadOperationResponseList', ], ], ], 'BatchReadSuccessfulResponse' => [ 'type' => 'structure', 'members' => [ 'ListObjectAttributes' => [ 'shape' => 'BatchListObjectAttributesResponse', ], 'ListObjectChildren' => [ 'shape' => 'BatchListObjectChildrenResponse', ], 'GetObjectInformation' => [ 'shape' => 'BatchGetObjectInformationResponse', ], 'GetObjectAttributes' => [ 'shape' => 'BatchGetObjectAttributesResponse', ], 'ListAttachedIndices' => [ 'shape' => 'BatchListAttachedIndicesResponse', ], 'ListObjectParentPaths' => [ 'shape' => 'BatchListObjectParentPathsResponse', ], 'ListObjectPolicies' => [ 'shape' => 'BatchListObjectPoliciesResponse', ], 'ListPolicyAttachments' => [ 'shape' => 'BatchListPolicyAttachmentsResponse', ], 'LookupPolicy' => [ 'shape' => 'BatchLookupPolicyResponse', ], 'ListIndex' => [ 'shape' => 'BatchListIndexResponse', ], 'ListOutgoingTypedLinks' => [ 'shape' => 'BatchListOutgoingTypedLinksResponse', ], 'ListIncomingTypedLinks' => [ 'shape' => 'BatchListIncomingTypedLinksResponse', ], 'GetLinkAttributes' => [ 'shape' => 'BatchGetLinkAttributesResponse', ], 'ListObjectParents' => [ 'shape' => 'BatchListObjectParentsResponse', ], ], ], 'BatchReferenceName' => [ 'type' => 'string', ], 'BatchRemoveFacetFromObject' => [ 'type' => 'structure', 'required' => [ 'SchemaFacet', 'ObjectReference', ], 'members' => [ 'SchemaFacet' => [ 'shape' => 'SchemaFacet', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'BatchRemoveFacetFromObjectResponse' => [ 'type' => 'structure', 'members' => [], ], 'BatchUpdateLinkAttributes' => [ 'type' => 'structure', 'required' => [ 'TypedLinkSpecifier', 'AttributeUpdates', ], 'members' => [ 'TypedLinkSpecifier' => [ 'shape' => 'TypedLinkSpecifier', ], 'AttributeUpdates' => [ 'shape' => 'LinkAttributeUpdateList', ], ], ], 'BatchUpdateLinkAttributesResponse' => [ 'type' => 'structure', 'members' => [], ], 'BatchUpdateObjectAttributes' => [ 'type' => 'structure', 'required' => [ 'ObjectReference', 'AttributeUpdates', ], 'members' => [ 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'AttributeUpdates' => [ 'shape' => 'ObjectAttributeUpdateList', ], ], ], 'BatchUpdateObjectAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'BatchWriteException' => [ 'type' => 'structure', 'members' => [ 'Index' => [ 'shape' => 'BatchOperationIndex', ], 'Type' => [ 'shape' => 'BatchWriteExceptionType', ], 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'exception' => true, ], 'BatchWriteExceptionType' => [ 'type' => 'string', 'enum' => [ 'InternalServiceException', 'ValidationException', 'InvalidArnException', 'LinkNameAlreadyInUseException', 'StillContainsLinksException', 'FacetValidationException', 'ObjectNotDetachedException', 'ResourceNotFoundException', 'AccessDeniedException', 'InvalidAttachmentException', 'NotIndexException', 'NotNodeException', 'IndexedAttributeMissingException', 'ObjectAlreadyDetachedException', 'NotPolicyException', 'DirectoryNotEnabledException', 'LimitExceededException', 'UnsupportedIndexTypeException', ], ], 'BatchWriteOperation' => [ 'type' => 'structure', 'members' => [ 'CreateObject' => [ 'shape' => 'BatchCreateObject', ], 'AttachObject' => [ 'shape' => 'BatchAttachObject', ], 'DetachObject' => [ 'shape' => 'BatchDetachObject', ], 'UpdateObjectAttributes' => [ 'shape' => 'BatchUpdateObjectAttributes', ], 'DeleteObject' => [ 'shape' => 'BatchDeleteObject', ], 'AddFacetToObject' => [ 'shape' => 'BatchAddFacetToObject', ], 'RemoveFacetFromObject' => [ 'shape' => 'BatchRemoveFacetFromObject', ], 'AttachPolicy' => [ 'shape' => 'BatchAttachPolicy', ], 'DetachPolicy' => [ 'shape' => 'BatchDetachPolicy', ], 'CreateIndex' => [ 'shape' => 'BatchCreateIndex', ], 'AttachToIndex' => [ 'shape' => 'BatchAttachToIndex', ], 'DetachFromIndex' => [ 'shape' => 'BatchDetachFromIndex', ], 'AttachTypedLink' => [ 'shape' => 'BatchAttachTypedLink', ], 'DetachTypedLink' => [ 'shape' => 'BatchDetachTypedLink', ], 'UpdateLinkAttributes' => [ 'shape' => 'BatchUpdateLinkAttributes', ], ], ], 'BatchWriteOperationList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BatchWriteOperation', ], ], 'BatchWriteOperationResponse' => [ 'type' => 'structure', 'members' => [ 'CreateObject' => [ 'shape' => 'BatchCreateObjectResponse', ], 'AttachObject' => [ 'shape' => 'BatchAttachObjectResponse', ], 'DetachObject' => [ 'shape' => 'BatchDetachObjectResponse', ], 'UpdateObjectAttributes' => [ 'shape' => 'BatchUpdateObjectAttributesResponse', ], 'DeleteObject' => [ 'shape' => 'BatchDeleteObjectResponse', ], 'AddFacetToObject' => [ 'shape' => 'BatchAddFacetToObjectResponse', ], 'RemoveFacetFromObject' => [ 'shape' => 'BatchRemoveFacetFromObjectResponse', ], 'AttachPolicy' => [ 'shape' => 'BatchAttachPolicyResponse', ], 'DetachPolicy' => [ 'shape' => 'BatchDetachPolicyResponse', ], 'CreateIndex' => [ 'shape' => 'BatchCreateIndexResponse', ], 'AttachToIndex' => [ 'shape' => 'BatchAttachToIndexResponse', ], 'DetachFromIndex' => [ 'shape' => 'BatchDetachFromIndexResponse', ], 'AttachTypedLink' => [ 'shape' => 'BatchAttachTypedLinkResponse', ], 'DetachTypedLink' => [ 'shape' => 'BatchDetachTypedLinkResponse', ], 'UpdateLinkAttributes' => [ 'shape' => 'BatchUpdateLinkAttributesResponse', ], ], ], 'BatchWriteOperationResponseList' => [ 'type' => 'list', 'member' => [ 'shape' => 'BatchWriteOperationResponse', ], ], 'BatchWriteRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'Operations', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Operations' => [ 'shape' => 'BatchWriteOperationList', ], ], ], 'BatchWriteResponse' => [ 'type' => 'structure', 'members' => [ 'Responses' => [ 'shape' => 'BatchWriteOperationResponseList', ], ], ], 'BinaryAttributeValue' => [ 'type' => 'blob', ], 'Bool' => [ 'type' => 'boolean', ], 'BooleanAttributeValue' => [ 'type' => 'boolean', ], 'CannotListParentOfRootException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ConsistencyLevel' => [ 'type' => 'string', 'enum' => [ 'SERIALIZABLE', 'EVENTUAL', ], ], 'CreateDirectoryRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'SchemaArn', ], 'members' => [ 'Name' => [ 'shape' => 'DirectoryName', ], 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], ], ], 'CreateDirectoryResponse' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'Name', 'ObjectIdentifier', 'AppliedSchemaArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'DirectoryArn', ], 'Name' => [ 'shape' => 'DirectoryName', ], 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], 'AppliedSchemaArn' => [ 'shape' => 'Arn', ], ], ], 'CreateFacetRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'FacetName', ], 'Attributes' => [ 'shape' => 'FacetAttributeList', ], 'ObjectType' => [ 'shape' => 'ObjectType', ], 'FacetStyle' => [ 'shape' => 'FacetStyle', ], ], ], 'CreateFacetResponse' => [ 'type' => 'structure', 'members' => [], ], 'CreateIndexRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'OrderedIndexedAttributeList', 'IsUnique', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'OrderedIndexedAttributeList' => [ 'shape' => 'AttributeKeyList', ], 'IsUnique' => [ 'shape' => 'Bool', ], 'ParentReference' => [ 'shape' => 'ObjectReference', ], 'LinkName' => [ 'shape' => 'LinkName', ], ], ], 'CreateIndexResponse' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'CreateObjectRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'SchemaFacets', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'SchemaFacets' => [ 'shape' => 'SchemaFacetList', ], 'ObjectAttributeList' => [ 'shape' => 'AttributeKeyAndValueList', ], 'ParentReference' => [ 'shape' => 'ObjectReference', ], 'LinkName' => [ 'shape' => 'LinkName', ], ], ], 'CreateObjectResponse' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'CreateSchemaRequest' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'SchemaName', ], ], ], 'CreateSchemaResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], ], ], 'CreateTypedLinkFacetRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Facet', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Facet' => [ 'shape' => 'TypedLinkFacet', ], ], ], 'CreateTypedLinkFacetResponse' => [ 'type' => 'structure', 'members' => [], ], 'Date' => [ 'type' => 'timestamp', ], 'DatetimeAttributeValue' => [ 'type' => 'timestamp', ], 'DeleteDirectoryRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], ], ], 'DeleteDirectoryResponse' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', ], ], ], 'DeleteFacetRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'FacetName', ], ], ], 'DeleteFacetResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteObjectRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'DeleteObjectResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteSchemaRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], ], ], 'DeleteSchemaResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], ], ], 'DeleteTypedLinkFacetRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'TypedLinkName', ], ], ], 'DeleteTypedLinkFacetResponse' => [ 'type' => 'structure', 'members' => [], ], 'DetachFromIndexRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'IndexReference', 'TargetReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'IndexReference' => [ 'shape' => 'ObjectReference', ], 'TargetReference' => [ 'shape' => 'ObjectReference', ], ], ], 'DetachFromIndexResponse' => [ 'type' => 'structure', 'members' => [ 'DetachedObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'DetachObjectRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ParentReference', 'LinkName', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ParentReference' => [ 'shape' => 'ObjectReference', ], 'LinkName' => [ 'shape' => 'LinkName', ], ], ], 'DetachObjectResponse' => [ 'type' => 'structure', 'members' => [ 'DetachedObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'DetachPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'PolicyReference', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'PolicyReference' => [ 'shape' => 'ObjectReference', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'DetachPolicyResponse' => [ 'type' => 'structure', 'members' => [], ], 'DetachTypedLinkRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'TypedLinkSpecifier', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'TypedLinkSpecifier' => [ 'shape' => 'TypedLinkSpecifier', ], ], ], 'Directory' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'DirectoryName', ], 'DirectoryArn' => [ 'shape' => 'DirectoryArn', ], 'State' => [ 'shape' => 'DirectoryState', ], 'CreationDateTime' => [ 'shape' => 'Date', ], ], ], 'DirectoryAlreadyExistsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'DirectoryArn' => [ 'type' => 'string', ], 'DirectoryDeletedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'DirectoryList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Directory', ], ], 'DirectoryName' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '^[a-zA-Z0-9._-]*$', ], 'DirectoryNotDisabledException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'DirectoryNotEnabledException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'DirectoryState' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'DISABLED', 'DELETED', ], ], 'DisableDirectoryRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], ], ], 'DisableDirectoryResponse' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', ], ], ], 'EnableDirectoryRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], ], ], 'EnableDirectoryResponse' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', ], ], ], 'ExceptionMessage' => [ 'type' => 'string', ], 'Facet' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'FacetName', ], 'ObjectType' => [ 'shape' => 'ObjectType', ], 'FacetStyle' => [ 'shape' => 'FacetStyle', ], ], ], 'FacetAlreadyExistsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'FacetAttribute' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'AttributeName', ], 'AttributeDefinition' => [ 'shape' => 'FacetAttributeDefinition', ], 'AttributeReference' => [ 'shape' => 'FacetAttributeReference', ], 'RequiredBehavior' => [ 'shape' => 'RequiredAttributeBehavior', ], ], ], 'FacetAttributeDefinition' => [ 'type' => 'structure', 'required' => [ 'Type', ], 'members' => [ 'Type' => [ 'shape' => 'FacetAttributeType', ], 'DefaultValue' => [ 'shape' => 'TypedAttributeValue', ], 'IsImmutable' => [ 'shape' => 'Bool', ], 'Rules' => [ 'shape' => 'RuleMap', ], ], ], 'FacetAttributeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'FacetAttribute', ], ], 'FacetAttributeReference' => [ 'type' => 'structure', 'required' => [ 'TargetFacetName', 'TargetAttributeName', ], 'members' => [ 'TargetFacetName' => [ 'shape' => 'FacetName', ], 'TargetAttributeName' => [ 'shape' => 'AttributeName', ], ], ], 'FacetAttributeType' => [ 'type' => 'string', 'enum' => [ 'STRING', 'BINARY', 'BOOLEAN', 'NUMBER', 'DATETIME', 'VARIANT', ], ], 'FacetAttributeUpdate' => [ 'type' => 'structure', 'members' => [ 'Attribute' => [ 'shape' => 'FacetAttribute', ], 'Action' => [ 'shape' => 'UpdateActionType', ], ], ], 'FacetAttributeUpdateList' => [ 'type' => 'list', 'member' => [ 'shape' => 'FacetAttributeUpdate', ], ], 'FacetInUseException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'FacetName' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '^[a-zA-Z0-9._-]*$', ], 'FacetNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'FacetName', ], ], 'FacetNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'FacetStyle' => [ 'type' => 'string', 'enum' => [ 'STATIC', 'DYNAMIC', ], ], 'FacetValidationException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'GetAppliedSchemaVersionRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], ], ], 'GetAppliedSchemaVersionResponse' => [ 'type' => 'structure', 'members' => [ 'AppliedSchemaArn' => [ 'shape' => 'Arn', ], ], ], 'GetDirectoryRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'DirectoryArn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], ], ], 'GetDirectoryResponse' => [ 'type' => 'structure', 'required' => [ 'Directory', ], 'members' => [ 'Directory' => [ 'shape' => 'Directory', ], ], ], 'GetFacetRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'FacetName', ], ], ], 'GetFacetResponse' => [ 'type' => 'structure', 'members' => [ 'Facet' => [ 'shape' => 'Facet', ], ], ], 'GetLinkAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'TypedLinkSpecifier', 'AttributeNames', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'TypedLinkSpecifier' => [ 'shape' => 'TypedLinkSpecifier', ], 'AttributeNames' => [ 'shape' => 'AttributeNameList', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', ], ], ], 'GetLinkAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'AttributeKeyAndValueList', ], ], ], 'GetObjectAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', 'SchemaFacet', 'AttributeNames', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], 'SchemaFacet' => [ 'shape' => 'SchemaFacet', ], 'AttributeNames' => [ 'shape' => 'AttributeNameList', ], ], ], 'GetObjectAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'AttributeKeyAndValueList', ], ], ], 'GetObjectInformationRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], ], ], 'GetObjectInformationResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaFacets' => [ 'shape' => 'SchemaFacetList', ], 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'GetSchemaAsJsonRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], ], ], 'GetSchemaAsJsonResponse' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'SchemaName', ], 'Document' => [ 'shape' => 'SchemaJsonDocument', ], ], ], 'GetTypedLinkFacetInformationRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'TypedLinkName', ], ], ], 'GetTypedLinkFacetInformationResponse' => [ 'type' => 'structure', 'members' => [ 'IdentityAttributeOrder' => [ 'shape' => 'AttributeNameList', ], ], ], 'IncompatibleSchemaException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'IndexAttachment' => [ 'type' => 'structure', 'members' => [ 'IndexedAttributes' => [ 'shape' => 'AttributeKeyAndValueList', ], 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'IndexAttachmentList' => [ 'type' => 'list', 'member' => [ 'shape' => 'IndexAttachment', ], ], 'IndexedAttributeMissingException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'InternalServiceException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, ], 'InvalidArnException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'InvalidAttachmentException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'InvalidFacetUpdateException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'InvalidNextTokenException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'InvalidRuleException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'InvalidSchemaDocException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'InvalidTaggingRequestException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'LinkAttributeAction' => [ 'type' => 'structure', 'members' => [ 'AttributeActionType' => [ 'shape' => 'UpdateActionType', ], 'AttributeUpdateValue' => [ 'shape' => 'TypedAttributeValue', ], ], ], 'LinkAttributeUpdate' => [ 'type' => 'structure', 'members' => [ 'AttributeKey' => [ 'shape' => 'AttributeKey', ], 'AttributeAction' => [ 'shape' => 'LinkAttributeAction', ], ], ], 'LinkAttributeUpdateList' => [ 'type' => 'list', 'member' => [ 'shape' => 'LinkAttributeUpdate', ], ], 'LinkName' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '[^\\\\/\\\\[\\\\]\\\\(\\\\):\\\\{\\\\}#@!?\\\\s\\\\\\\\;]+', ], 'LinkNameAlreadyInUseException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'LinkNameToObjectIdentifierMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'LinkName', ], 'value' => [ 'shape' => 'ObjectIdentifier', ], ], 'ListAppliedSchemaArnsRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', ], 'SchemaArn' => [ 'shape' => 'Arn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListAppliedSchemaArnsResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaArns' => [ 'shape' => 'Arns', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListAttachedIndicesRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'TargetReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'TargetReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], ], ], 'ListAttachedIndicesResponse' => [ 'type' => 'structure', 'members' => [ 'IndexAttachments' => [ 'shape' => 'IndexAttachmentList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListDevelopmentSchemaArnsRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListDevelopmentSchemaArnsResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaArns' => [ 'shape' => 'Arns', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListDirectoriesRequest' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'state' => [ 'shape' => 'DirectoryState', ], ], ], 'ListDirectoriesResponse' => [ 'type' => 'structure', 'required' => [ 'Directories', ], 'members' => [ 'Directories' => [ 'shape' => 'DirectoryList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListFacetAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'FacetName', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListFacetAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'FacetAttributeList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListFacetNamesRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListFacetNamesResponse' => [ 'type' => 'structure', 'members' => [ 'FacetNames' => [ 'shape' => 'FacetNameList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListIncomingTypedLinksRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'FilterAttributeRanges' => [ 'shape' => 'TypedLinkAttributeRangeList', ], 'FilterTypedLink' => [ 'shape' => 'TypedLinkSchemaAndFacetName', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', ], ], ], 'ListIncomingTypedLinksResponse' => [ 'type' => 'structure', 'members' => [ 'LinkSpecifiers' => [ 'shape' => 'TypedLinkSpecifierList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListIndexRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'IndexReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'RangesOnIndexedValues' => [ 'shape' => 'ObjectAttributeRangeList', ], 'IndexReference' => [ 'shape' => 'ObjectReference', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], ], ], 'ListIndexResponse' => [ 'type' => 'structure', 'members' => [ 'IndexAttachments' => [ 'shape' => 'IndexAttachmentList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListManagedSchemaArnsRequest' => [ 'type' => 'structure', 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListManagedSchemaArnsResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaArns' => [ 'shape' => 'Arns', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListObjectAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], 'FacetFilter' => [ 'shape' => 'SchemaFacet', ], ], ], 'ListObjectAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'AttributeKeyAndValueList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListObjectChildrenRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], ], ], 'ListObjectChildrenResponse' => [ 'type' => 'structure', 'members' => [ 'Children' => [ 'shape' => 'LinkNameToObjectIdentifierMap', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListObjectParentPathsRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListObjectParentPathsResponse' => [ 'type' => 'structure', 'members' => [ 'PathToObjectIdentifiersList' => [ 'shape' => 'PathToObjectIdentifiersList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListObjectParentsRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], 'IncludeAllLinksToEachParent' => [ 'shape' => 'Bool', ], ], ], 'ListObjectParentsResponse' => [ 'type' => 'structure', 'members' => [ 'Parents' => [ 'shape' => 'ObjectIdentifierToLinkNameMap', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'ParentLinks' => [ 'shape' => 'ObjectIdentifierAndLinkNameList', ], ], ], 'ListObjectPoliciesRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], ], ], 'ListObjectPoliciesResponse' => [ 'type' => 'structure', 'members' => [ 'AttachedPolicyIds' => [ 'shape' => 'ObjectIdentifierList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListOutgoingTypedLinksRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'FilterAttributeRanges' => [ 'shape' => 'TypedLinkAttributeRangeList', ], 'FilterTypedLink' => [ 'shape' => 'TypedLinkSchemaAndFacetName', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', ], ], ], 'ListOutgoingTypedLinksResponse' => [ 'type' => 'structure', 'members' => [ 'TypedLinkSpecifiers' => [ 'shape' => 'TypedLinkSpecifierList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListPolicyAttachmentsRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'PolicyReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'PolicyReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], 'ConsistencyLevel' => [ 'shape' => 'ConsistencyLevel', 'location' => 'header', 'locationName' => 'x-amz-consistency-level', ], ], ], 'ListPolicyAttachmentsResponse' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifiers' => [ 'shape' => 'ObjectIdentifierList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListPublishedSchemaArnsRequest' => [ 'type' => 'structure', 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListPublishedSchemaArnsResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaArns' => [ 'shape' => 'Arns', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTagsForResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'TagsNumberResults', ], ], ], 'ListTagsForResourceResponse' => [ 'type' => 'structure', 'members' => [ 'Tags' => [ 'shape' => 'TagList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTypedLinkFacetAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'TypedLinkName', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListTypedLinkFacetAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'TypedLinkAttributeDefinitionList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTypedLinkFacetNamesRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'ListTypedLinkFacetNamesResponse' => [ 'type' => 'structure', 'members' => [ 'FacetNames' => [ 'shape' => 'TypedLinkNameList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'LookupPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'NumberResults', ], ], ], 'LookupPolicyResponse' => [ 'type' => 'structure', 'members' => [ 'PolicyToPathList' => [ 'shape' => 'PolicyToPathList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'NextToken' => [ 'type' => 'string', ], 'NotIndexException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'NotNodeException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'NotPolicyException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'NumberAttributeValue' => [ 'type' => 'string', ], 'NumberResults' => [ 'type' => 'integer', 'min' => 1, ], 'ObjectAlreadyDetachedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ObjectAttributeAction' => [ 'type' => 'structure', 'members' => [ 'ObjectAttributeActionType' => [ 'shape' => 'UpdateActionType', ], 'ObjectAttributeUpdateValue' => [ 'shape' => 'TypedAttributeValue', ], ], ], 'ObjectAttributeRange' => [ 'type' => 'structure', 'members' => [ 'AttributeKey' => [ 'shape' => 'AttributeKey', ], 'Range' => [ 'shape' => 'TypedAttributeValueRange', ], ], ], 'ObjectAttributeRangeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ObjectAttributeRange', ], ], 'ObjectAttributeUpdate' => [ 'type' => 'structure', 'members' => [ 'ObjectAttributeKey' => [ 'shape' => 'AttributeKey', ], 'ObjectAttributeAction' => [ 'shape' => 'ObjectAttributeAction', ], ], ], 'ObjectAttributeUpdateList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ObjectAttributeUpdate', ], ], 'ObjectIdentifier' => [ 'type' => 'string', ], 'ObjectIdentifierAndLinkNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ObjectIdentifierAndLinkNameTuple', ], ], 'ObjectIdentifierAndLinkNameTuple' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], 'LinkName' => [ 'shape' => 'LinkName', ], ], ], 'ObjectIdentifierList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ObjectIdentifier', ], ], 'ObjectIdentifierToLinkNameMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'ObjectIdentifier', ], 'value' => [ 'shape' => 'LinkName', ], ], 'ObjectNotDetachedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'ObjectReference' => [ 'type' => 'structure', 'members' => [ 'Selector' => [ 'shape' => 'SelectorObjectReference', ], ], ], 'ObjectType' => [ 'type' => 'string', 'enum' => [ 'NODE', 'LEAF_NODE', 'POLICY', 'INDEX', ], ], 'PathString' => [ 'type' => 'string', ], 'PathToObjectIdentifiers' => [ 'type' => 'structure', 'members' => [ 'Path' => [ 'shape' => 'PathString', ], 'ObjectIdentifiers' => [ 'shape' => 'ObjectIdentifierList', ], ], ], 'PathToObjectIdentifiersList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PathToObjectIdentifiers', ], ], 'PolicyAttachment' => [ 'type' => 'structure', 'members' => [ 'PolicyId' => [ 'shape' => 'ObjectIdentifier', ], 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], 'PolicyType' => [ 'shape' => 'PolicyType', ], ], ], 'PolicyAttachmentList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PolicyAttachment', ], ], 'PolicyToPath' => [ 'type' => 'structure', 'members' => [ 'Path' => [ 'shape' => 'PathString', ], 'Policies' => [ 'shape' => 'PolicyAttachmentList', ], ], ], 'PolicyToPathList' => [ 'type' => 'list', 'member' => [ 'shape' => 'PolicyToPath', ], ], 'PolicyType' => [ 'type' => 'string', ], 'PublishSchemaRequest' => [ 'type' => 'structure', 'required' => [ 'DevelopmentSchemaArn', 'Version', ], 'members' => [ 'DevelopmentSchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Version' => [ 'shape' => 'Version', ], 'MinorVersion' => [ 'shape' => 'Version', ], 'Name' => [ 'shape' => 'SchemaName', ], ], ], 'PublishSchemaResponse' => [ 'type' => 'structure', 'members' => [ 'PublishedSchemaArn' => [ 'shape' => 'Arn', ], ], ], 'PutSchemaFromJsonRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Document', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Document' => [ 'shape' => 'SchemaJsonDocument', ], ], ], 'PutSchemaFromJsonResponse' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], ], ], 'RangeMode' => [ 'type' => 'string', 'enum' => [ 'FIRST', 'LAST', 'LAST_BEFORE_MISSING_VALUES', 'INCLUSIVE', 'EXCLUSIVE', ], ], 'RemoveFacetFromObjectRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'SchemaFacet', 'ObjectReference', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'SchemaFacet' => [ 'shape' => 'SchemaFacet', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], ], ], 'RemoveFacetFromObjectResponse' => [ 'type' => 'structure', 'members' => [], ], 'RequiredAttributeBehavior' => [ 'type' => 'string', 'enum' => [ 'REQUIRED_ALWAYS', 'NOT_REQUIRED', ], ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'RetryableConflictException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'Rule' => [ 'type' => 'structure', 'members' => [ 'Type' => [ 'shape' => 'RuleType', ], 'Parameters' => [ 'shape' => 'RuleParameterMap', ], ], ], 'RuleKey' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '^[a-zA-Z0-9._-]*$', ], 'RuleMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'RuleKey', ], 'value' => [ 'shape' => 'Rule', ], ], 'RuleParameterKey' => [ 'type' => 'string', ], 'RuleParameterMap' => [ 'type' => 'map', 'key' => [ 'shape' => 'RuleParameterKey', ], 'value' => [ 'shape' => 'RuleParameterValue', ], ], 'RuleParameterValue' => [ 'type' => 'string', ], 'RuleType' => [ 'type' => 'string', 'enum' => [ 'BINARY_LENGTH', 'NUMBER_COMPARISON', 'STRING_FROM_SET', 'STRING_LENGTH', ], ], 'SchemaAlreadyExistsException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'SchemaAlreadyPublishedException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'SchemaFacet' => [ 'type' => 'structure', 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], 'FacetName' => [ 'shape' => 'FacetName', ], ], ], 'SchemaFacetList' => [ 'type' => 'list', 'member' => [ 'shape' => 'SchemaFacet', ], ], 'SchemaJsonDocument' => [ 'type' => 'string', ], 'SchemaName' => [ 'type' => 'string', 'max' => 32, 'min' => 1, 'pattern' => '^[a-zA-Z0-9._-]*$', ], 'SelectorObjectReference' => [ 'type' => 'string', ], 'StillContainsLinksException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'StringAttributeValue' => [ 'type' => 'string', ], 'Tag' => [ 'type' => 'structure', 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], ], 'TagKey' => [ 'type' => 'string', ], 'TagKeyList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TagKey', ], ], 'TagList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], ], 'TagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'Tags', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', ], 'Tags' => [ 'shape' => 'TagList', ], ], ], 'TagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'TagValue' => [ 'type' => 'string', ], 'TagsNumberResults' => [ 'type' => 'integer', 'min' => 50, ], 'TypedAttributeValue' => [ 'type' => 'structure', 'members' => [ 'StringValue' => [ 'shape' => 'StringAttributeValue', ], 'BinaryValue' => [ 'shape' => 'BinaryAttributeValue', ], 'BooleanValue' => [ 'shape' => 'BooleanAttributeValue', ], 'NumberValue' => [ 'shape' => 'NumberAttributeValue', ], 'DatetimeValue' => [ 'shape' => 'DatetimeAttributeValue', ], ], ], 'TypedAttributeValueRange' => [ 'type' => 'structure', 'required' => [ 'StartMode', 'EndMode', ], 'members' => [ 'StartMode' => [ 'shape' => 'RangeMode', ], 'StartValue' => [ 'shape' => 'TypedAttributeValue', ], 'EndMode' => [ 'shape' => 'RangeMode', ], 'EndValue' => [ 'shape' => 'TypedAttributeValue', ], ], ], 'TypedLinkAttributeDefinition' => [ 'type' => 'structure', 'required' => [ 'Name', 'Type', 'RequiredBehavior', ], 'members' => [ 'Name' => [ 'shape' => 'AttributeName', ], 'Type' => [ 'shape' => 'FacetAttributeType', ], 'DefaultValue' => [ 'shape' => 'TypedAttributeValue', ], 'IsImmutable' => [ 'shape' => 'Bool', ], 'Rules' => [ 'shape' => 'RuleMap', ], 'RequiredBehavior' => [ 'shape' => 'RequiredAttributeBehavior', ], ], ], 'TypedLinkAttributeDefinitionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TypedLinkAttributeDefinition', ], ], 'TypedLinkAttributeRange' => [ 'type' => 'structure', 'required' => [ 'Range', ], 'members' => [ 'AttributeName' => [ 'shape' => 'AttributeName', ], 'Range' => [ 'shape' => 'TypedAttributeValueRange', ], ], ], 'TypedLinkAttributeRangeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TypedLinkAttributeRange', ], ], 'TypedLinkFacet' => [ 'type' => 'structure', 'required' => [ 'Name', 'Attributes', 'IdentityAttributeOrder', ], 'members' => [ 'Name' => [ 'shape' => 'TypedLinkName', ], 'Attributes' => [ 'shape' => 'TypedLinkAttributeDefinitionList', ], 'IdentityAttributeOrder' => [ 'shape' => 'AttributeNameList', ], ], ], 'TypedLinkFacetAttributeUpdate' => [ 'type' => 'structure', 'required' => [ 'Attribute', 'Action', ], 'members' => [ 'Attribute' => [ 'shape' => 'TypedLinkAttributeDefinition', ], 'Action' => [ 'shape' => 'UpdateActionType', ], ], ], 'TypedLinkFacetAttributeUpdateList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TypedLinkFacetAttributeUpdate', ], ], 'TypedLinkName' => [ 'type' => 'string', 'pattern' => '^[a-zA-Z0-9._-]*$', ], 'TypedLinkNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TypedLinkName', ], ], 'TypedLinkSchemaAndFacetName' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'TypedLinkName', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], 'TypedLinkName' => [ 'shape' => 'TypedLinkName', ], ], ], 'TypedLinkSpecifier' => [ 'type' => 'structure', 'required' => [ 'TypedLinkFacet', 'SourceObjectReference', 'TargetObjectReference', 'IdentityAttributeValues', ], 'members' => [ 'TypedLinkFacet' => [ 'shape' => 'TypedLinkSchemaAndFacetName', ], 'SourceObjectReference' => [ 'shape' => 'ObjectReference', ], 'TargetObjectReference' => [ 'shape' => 'ObjectReference', ], 'IdentityAttributeValues' => [ 'shape' => 'AttributeNameAndValueList', ], ], ], 'TypedLinkSpecifierList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TypedLinkSpecifier', ], ], 'UnsupportedIndexTypeException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'UntagResourceRequest' => [ 'type' => 'structure', 'required' => [ 'ResourceArn', 'TagKeys', ], 'members' => [ 'ResourceArn' => [ 'shape' => 'Arn', ], 'TagKeys' => [ 'shape' => 'TagKeyList', ], ], ], 'UntagResourceResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateActionType' => [ 'type' => 'string', 'enum' => [ 'CREATE_OR_UPDATE', 'DELETE', ], ], 'UpdateFacetRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'FacetName', ], 'AttributeUpdates' => [ 'shape' => 'FacetAttributeUpdateList', ], 'ObjectType' => [ 'shape' => 'ObjectType', ], ], ], 'UpdateFacetResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateLinkAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'TypedLinkSpecifier', 'AttributeUpdates', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'TypedLinkSpecifier' => [ 'shape' => 'TypedLinkSpecifier', ], 'AttributeUpdates' => [ 'shape' => 'LinkAttributeUpdateList', ], ], ], 'UpdateLinkAttributesResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpdateObjectAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'DirectoryArn', 'ObjectReference', 'AttributeUpdates', ], 'members' => [ 'DirectoryArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'ObjectReference' => [ 'shape' => 'ObjectReference', ], 'AttributeUpdates' => [ 'shape' => 'ObjectAttributeUpdateList', ], ], ], 'UpdateObjectAttributesResponse' => [ 'type' => 'structure', 'members' => [ 'ObjectIdentifier' => [ 'shape' => 'ObjectIdentifier', ], ], ], 'UpdateSchemaRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'SchemaName', ], ], ], 'UpdateSchemaResponse' => [ 'type' => 'structure', 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', ], ], ], 'UpdateTypedLinkFacetRequest' => [ 'type' => 'structure', 'required' => [ 'SchemaArn', 'Name', 'AttributeUpdates', 'IdentityAttributeOrder', ], 'members' => [ 'SchemaArn' => [ 'shape' => 'Arn', 'location' => 'header', 'locationName' => 'x-amz-data-partition', ], 'Name' => [ 'shape' => 'TypedLinkName', ], 'AttributeUpdates' => [ 'shape' => 'TypedLinkFacetAttributeUpdateList', ], 'IdentityAttributeOrder' => [ 'shape' => 'AttributeNameList', ], ], ], 'UpdateTypedLinkFacetResponse' => [ 'type' => 'structure', 'members' => [], ], 'UpgradeAppliedSchemaRequest' => [ 'type' => 'structure', 'required' => [ 'PublishedSchemaArn', 'DirectoryArn', ], 'members' => [ 'PublishedSchemaArn' => [ 'shape' => 'Arn', ], 'DirectoryArn' => [ 'shape' => 'Arn', ], 'DryRun' => [ 'shape' => 'Bool', ], ], ], 'UpgradeAppliedSchemaResponse' => [ 'type' => 'structure', 'members' => [ 'UpgradedSchemaArn' => [ 'shape' => 'Arn', ], 'DirectoryArn' => [ 'shape' => 'Arn', ], ], ], 'UpgradePublishedSchemaRequest' => [ 'type' => 'structure', 'required' => [ 'DevelopmentSchemaArn', 'PublishedSchemaArn', 'MinorVersion', ], 'members' => [ 'DevelopmentSchemaArn' => [ 'shape' => 'Arn', ], 'PublishedSchemaArn' => [ 'shape' => 'Arn', ], 'MinorVersion' => [ 'shape' => 'Version', ], 'DryRun' => [ 'shape' => 'Bool', ], ], ], 'UpgradePublishedSchemaResponse' => [ 'type' => 'structure', 'members' => [ 'UpgradedSchemaArn' => [ 'shape' => 'Arn', ], ], ], 'ValidationException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ExceptionMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'Version' => [ 'type' => 'string', 'max' => 10, 'min' => 1, 'pattern' => '^[a-zA-Z0-9._-]*$', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/clouddirectory/2017-01-11/endpoint-rule-set-1.json\nreturn [ 'version' => '1.0', 'parameters' => [ 'Region' => [ 'builtIn' => 'AWS::Region', 'required' => true, 'documentation' => 'The AWS region used to dispatch the request.', 'type' => 'String', ], 'UseDualStack' => [ 'builtIn' => 'AWS::UseDualStack', 'required' => true, 'default' => false, 'documentation' => 'When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.', 'type' => 'Boolean', ], 'UseFIPS' => [ 'builtIn' => 'AWS::UseFIPS', 'required' => true, 'default' => false, 'documentation' => 'When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.', 'type' => 'Boolean', ], 'Endpoint' => [ 'builtIn' => 'SDK::Endpoint', 'required' => false, 'documentation' => 'Override the endpoint used to send this request', 'type' => 'String', ], ], 'rules' => [ [ 'conditions' => [ [ 'fn' => 'aws.partition', 'argv' => [ [ 'ref' => 'Region', ], ], 'assign' => 'PartitionResult', ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'isSet', 'argv' => [ [ 'ref' => 'Endpoint', ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', 'type' => 'error', ], [ 'conditions' => [], 'endpoint' => [ 'url' => [ 'ref' => 'Endpoint', ], 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://clouddirectory-fips.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS and DualStack are enabled, but this partition does not support one or both', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseFIPS', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsFIPS', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'stringEquals', 'argv' => [ 'aws-us-gov', [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'name', ], ], ], ], ], 'endpoint' => [ 'url' => 'https://clouddirectory.{Region}.amazonaws.com', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://clouddirectory-fips.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'FIPS is enabled but this partition does not support FIPS', 'type' => 'error', ], ], ], [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ [ 'ref' => 'UseDualStack', ], true, ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [ [ 'fn' => 'booleanEquals', 'argv' => [ true, [ 'fn' => 'getAttr', 'argv' => [ [ 'ref' => 'PartitionResult', ], 'supportsDualStack', ], ], ], ], ], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://clouddirectory.{Region}.{PartitionResult#dualStackDnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], [ 'conditions' => [], 'error' => 'DualStack is enabled but this partition does not support DualStack', 'type' => 'error', ], ], ], [ 'conditions' => [], 'type' => 'tree', 'rules' => [ [ 'conditions' => [], 'endpoint' => [ 'url' => 'https://clouddirectory.{Region}.{PartitionResult#dnsSuffix}', 'properties' => [], 'headers' => [], ], 'type' => 'endpoint', ], ], ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/clouddirectory/2017-01-11/endpoint-tests-1.json\nreturn [ 'testCases' => [ [ 'documentation' => 'For region us-iso-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'us-iso-east-1', ], ], [ 'documentation' => 'For region us-iso-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-iso-east-1.c2s.ic.gov', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-iso-east-1', ], ], [ 'documentation' => 'For region ap-southeast-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ap-southeast-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'ap-southeast-2', ], ], [ 'documentation' => 'For region us-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-west-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-west-2', ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-east-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-east-2', ], ], [ 'documentation' => 'For region eu-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.eu-central-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'eu-central-1', ], ], [ 'documentation' => 'For region ca-central-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ca-central-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'ca-central-1', ], ], [ 'documentation' => 'For region eu-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.eu-west-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'eu-west-1', ], ], [ 'documentation' => 'For region eu-west-2 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.eu-west-2.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'eu-west-2', ], ], [ 'documentation' => 'For region ap-southeast-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.ap-southeast-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'ap-southeast-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.us-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.us-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'us-east-1', ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-gov-west-1', ], ], [ 'documentation' => 'For region us-gov-west-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-gov-west-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'us-gov-west-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-gov-east-1.api.aws', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-gov-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-gov-east-1.amazonaws.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-gov-east-1', ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'us-isob-east-1', ], ], [ 'documentation' => 'For region us-isob-east-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.us-isob-east-1.sc2s.sgov.gov', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-isob-east-1', ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => true, 'Region' => 'cn-north-1', ], ], [ 'documentation' => 'For region cn-north-1 with FIPS enabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory-fips.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'cn-north-1', ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack enabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.cn-north-1.api.amazonwebservices.com.cn', ], ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'cn-north-1', ], ], [ 'documentation' => 'For region cn-north-1 with FIPS disabled and DualStack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://clouddirectory.cn-north-1.amazonaws.com.cn', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'cn-north-1', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack disabled', 'expect' => [ 'endpoint' => [ 'url' => 'https://example.com', ], ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => false, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips enabled and dualstack disabled', 'expect' => [ 'error' => 'Invalid Configuration: FIPS and custom endpoint are not supported', ], 'params' => [ 'UseDualStack' => false, 'UseFIPS' => true, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], [ 'documentation' => 'For custom endpoint with fips disabled and dualstack enabled', 'expect' => [ 'error' => 'Invalid Configuration: Dualstack and custom endpoint are not supported', ], 'params' => [ 'UseDualStack' => true, 'UseFIPS' => false, 'Region' => 'us-east-1', 'Endpoint' => 'https://example.com', ], ], ], 'version' => '1.0',];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/clouddirectory/2017-01-11/examples-1.json\nreturn [ 'version' => '1.0', 'examples' => [],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/clouddirectory/2017-01-11/paginators-1.json\nreturn [ 'pagination' => [ 'ListAppliedSchemaArns' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListAttachedIndices' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListDevelopmentSchemaArns' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListDirectories' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListFacetAttributes' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListFacetNames' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListIndex' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListManagedSchemaArns' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListObjectAttributes' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListObjectChildren' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListObjectParentPaths' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListObjectParents' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListObjectPolicies' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListPolicyAttachments' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListPublishedSchemaArns' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListTagsForResource' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListTypedLinkFacetAttributes' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'ListTypedLinkFacetNames' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], 'LookupPolicy' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxResults', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/cloudformation/2010-05-15/api-2.json\nreturn [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2010-05-15', 'endpointPrefix' => 'cloudformation', 'protocol' => 'query', 'serviceFullName' => 'AWS CloudFormation', 'serviceId' => 'CloudFormation', 'signatureVersion' => 'v4', 'uid' => 'cloudformation-2010-05-15', 'xmlNamespace' => 'http://cloudformation.amazonaws.com/doc/2010-05-15/', ], 'operations' => [ 'ActivateOrganizationsAccess' => [ 'name' => 'ActivateOrganizationsAccess', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ActivateOrganizationsAccessInput', ], 'output' => [ 'shape' => 'ActivateOrganizationsAccessOutput', 'resultWrapper' => 'ActivateOrganizationsAccessResult', ], 'errors' => [ [ 'shape' => 'InvalidOperationException', ], [ 'shape' => 'OperationNotFoundException', ], ], ], 'ActivateType' => [ 'name' => 'ActivateType', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ActivateTypeInput', ], 'output' => [ 'shape' => 'ActivateTypeOutput', 'resultWrapper' => 'ActivateTypeResult', ], 'errors' => [ [ 'shape' => 'CFNRegistryException', ], [ 'shape' => 'TypeNotFoundException', ], ], 'idempotent' => true, ], 'BatchDescribeTypeConfigurations' => [ 'name' => 'BatchDescribeTypeConfigurations', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'BatchDescribeTypeConfigurationsInput', ], 'output' => [ 'shape' => 'BatchDescribeTypeConfigurationsOutput', 'resultWrapper' => 'BatchDescribeTypeConfigurationsResult', ], 'errors' => [ [ 'shape' => 'TypeConfigurationNotFoundException', ], [ 'shape' => 'CFNRegistryException', ], ], ], 'CancelUpdateStack' => [ 'name' => 'CancelUpdateStack', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CancelUpdateStackInput', ], 'errors' => [ [ 'shape' => 'TokenAlreadyExistsException', ], ], ], 'ContinueUpdateRollback' => [ 'name' => 'ContinueUpdateRollback', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ContinueUpdateRollbackInput', ], 'output' => [ 'shape' => 'ContinueUpdateRollbackOutput', 'resultWrapper' => 'ContinueUpdateRollbackResult', ], 'errors' => [ [ 'shape' => 'TokenAlreadyExistsException', ], ], ], 'CreateChangeSet' => [ 'name' => 'CreateChangeSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateChangeSetInput', ], 'output' => [ 'shape' => 'CreateChangeSetOutput', 'resultWrapper' => 'CreateChangeSetResult', ], 'errors' => [ [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'InsufficientCapabilitiesException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'CreateStack' => [ 'name' => 'CreateStack', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateStackInput', ], 'output' => [ 'shape' => 'CreateStackOutput', 'resultWrapper' => 'CreateStackResult', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'AlreadyExistsException', ], [ 'shape' => 'TokenAlreadyExistsException', ], [ 'shape' => 'InsufficientCapabilitiesException', ], ], ], 'CreateStackInstances' => [ 'name' => 'CreateStackInstances', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateStackInstancesInput', ], 'output' => [ 'shape' => 'CreateStackInstancesOutput', 'resultWrapper' => 'CreateStackInstancesResult', ], 'errors' => [ [ 'shape' => 'StackSetNotFoundException', ], [ 'shape' => 'OperationInProgressException', ], [ 'shape' => 'OperationIdAlreadyExistsException', ], [ 'shape' => 'StaleRequestException', ], [ 'shape' => 'InvalidOperationException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'CreateStackSet' => [ 'name' => 'CreateStackSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateStackSetInput', ], 'output' => [ 'shape' => 'CreateStackSetOutput', 'resultWrapper' => 'CreateStackSetResult', ], 'errors' => [ [ 'shape' => 'NameAlreadyExistsException', ], [ 'shape' => 'CreatedButModifiedException', ], [ 'shape' => 'LimitExceededException', ], ], ], 'DeactivateOrganizationsAccess' => [ 'name' => 'DeactivateOrganizationsAccess', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeactivateOrganizationsAccessInput', ], 'output' => [ 'shape' => 'DeactivateOrganizationsAccessOutput', 'resultWrapper' => 'DeactivateOrganizationsAccessResult', ], 'errors' => [ [ 'shape' => 'InvalidOperationException', ], [ 'shape' => 'OperationNotFoundException', ], ], ], 'DeactivateType' => [ 'name' => 'DeactivateType', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeactivateTypeInput', ], 'output' => [ 'shape' => 'DeactivateTypeOutput', 'resultWrapper' => 'DeactivateTypeResult', ], 'errors' => [ [ 'shape' => 'CFNRegistryException', ], [ 'shape' => 'TypeNotFoundException', ], ], 'idempotent' => true, ], 'DeleteChangeSet' => [ 'name' => 'DeleteChangeSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteChangeSetInput', ], 'output' => [ 'shape' => 'DeleteChangeSetOutput', 'resultWrapper' => 'DeleteChangeSetResult', ], 'errors' => [ [ 'shape' => 'InvalidChangeSetStatusException', ], ], ], 'DeleteStack' => [ 'name' => 'DeleteStack', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteStackInput', ], 'errors' => [ [ 'shape' => 'TokenAlreadyExistsException', ], ], ], 'DeleteStackInstances' => [ 'name' => 'DeleteStackInstances', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteStackInstancesInput', ], 'output' => [ 'shape' => 'DeleteStackInstancesOutput', 'resultWrapper' => 'DeleteStackInstancesResult', ], 'errors' => [ [ 'shape' => 'StackSetNotFoundException', ], [ 'shape' => 'OperationInProgressException', ], [ 'shape' => 'OperationIdAlreadyExistsException', ], [ 'shape' => 'StaleRequestException', ], [ 'shape' => 'InvalidOperationException', ], ], ], 'DeleteStackSet' => [ 'name' => 'DeleteStackSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteStackSetInput', ], 'output' => [ 'shape' => 'DeleteStackSetOutput', 'resultWrapper' => 'DeleteStackSetResult', ], 'errors' => [ [ 'shape' => 'StackSetNotEmptyException', ], [ 'shape' => 'OperationInProgressException', ], ], ], 'DeregisterType' => [ 'name' => 'DeregisterType', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeregisterTypeInput', ], 'output' => [ 'shape' => 'DeregisterTypeOutput', 'resultWrapper' => 'DeregisterTypeResult', ], 'errors' => [ [ 'shape' => 'CFNRegistryException', ], [ 'shape' => 'TypeNotFoundException', ], ], 'idempotent' => true, ], 'DescribeAccountLimits' => [ 'name' => 'DescribeAccountLimits', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeAccountLimitsInput', ], 'output' => [ 'shape' => 'DescribeAccountLimitsOutput', 'resultWrapper' => 'DescribeAccountLimitsResult', ], ], 'DescribeChangeSet' => [ 'name' => 'DescribeChangeSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeChangeSetInput', ], 'output' => [ 'shape' => 'DescribeChangeSetOutput', 'resultWrapper' => 'DescribeChangeSetResult', ], 'errors' => [ [ 'shape' => 'ChangeSetNotFoundException', ], ], ], 'DescribeChangeSetHooks' => [ 'name' => 'DescribeChangeSetHooks', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeChangeSetHooksInput', ], 'output' => [ 'shape' => 'DescribeChangeSetHooksOutput', 'resultWrapper' => 'DescribeChangeSetHooksResult', ], 'errors' => [ [ 'shape' => 'ChangeSetNotFoundException', ], ], ], 'DescribeOrganizationsAccess' => [ 'name' => 'DescribeOrganizationsAccess', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeOrganizationsAccessInput', ], 'output' => [ 'shape' => 'DescribeOrganizationsAccessOutput', 'resultWrapper' => 'DescribeOrganizationsAccessResult', ], 'errors' => [ [ 'shape' => 'InvalidOperationException', ], [ 'shape' => 'OperationNotFoundException', ], ], ], 'DescribePublisher' => [ 'name' => 'DescribePublisher', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribePublisherInput', ], 'output' => [ 'shape' => 'DescribePublisherOutput', 'resultWrapper' => 'DescribePublisherResult', ], 'errors' => [ [ 'shape' => 'CFNRegistryException', ], ], 'idempotent' => true, ], 'DescribeStackDriftDetectionStatus' => [ 'name' => 'DescribeStackDriftDetectionStatus', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeStackDriftDetectionStatusInput', ], 'output' => [ 'shape' => 'DescribeStackDriftDetectionStatusOutput', 'resultWrapper' => 'DescribeStackDriftDetectionStatusResult', ], ], 'DescribeStackEvents' => [ 'name' => 'DescribeStackEvents', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeStackEventsInput', ], 'output' => [ 'shape' => 'DescribeStackEventsOutput', 'resultWrapper' => 'DescribeStackEventsResult', ], ], 'DescribeStackInstance' => [ 'name' => 'DescribeStackInstance', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeStackInstanceInput', ], 'output' => [ 'shape' => 'DescribeStackInstanceOutput', 'resultWrapper' => 'DescribeStackInstanceResult', ], 'errors' => [ [ 'shape' => 'StackSetNotFoundException', ], [ 'shape' => 'StackInstanceNotFoundException', ], ], ], 'DescribeStackResource' => [ 'name' => 'DescribeStackResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeStackResourceInput', ], 'output' => [ 'shape' => 'DescribeStackResourceOutput', 'resultWrapper' => 'DescribeStackResourceResult', ], ], 'DescribeStackResourceDrifts' => [ 'name' => 'DescribeStackResourceDrifts', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeStackResourceDriftsInput', ], 'output' => [ 'shape' => 'DescribeStackResourceDriftsOutput', 'resultWrapper' => 'DescribeStackResourceDriftsResult', ], ], 'DescribeStackResources' => [ 'name' => 'DescribeStackResources', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeStackResourcesInput', ], 'output' => [ 'shape' => 'DescribeStackResourcesOutput', 'resultWrapper' => 'DescribeStackResourcesResult', ], ], 'DescribeStackSet' => [ 'name' => 'DescribeStackSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeStackSetInput', ], 'output' => [ 'shape' => 'DescribeStackSetOutput', 'resultWrapper' => 'DescribeStackSetResult', ], 'errors' => [ [ 'shape' => 'StackSetNotFoundException', ], ], ], 'DescribeStackSetOperation' => [ 'name' => 'DescribeStackSetOperation', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeStackSetOperationInput', ], 'output' => [ 'shape' => 'DescribeStackSetOperationOutput', 'resultWrapper' => 'DescribeStackSetOperationResult', ], 'errors' => [ [ 'shape' => 'StackSetNotFoundException', ], [ 'shape' => 'OperationNotFoundException', ], ], ], 'DescribeStacks' => [ 'name' => 'DescribeStacks', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeStacksInput', ], 'output' => [ 'shape' => 'DescribeStacksOutput', 'resultWrapper' => 'DescribeStacksResult', ], ], 'DescribeType' => [ 'name' => 'DescribeType', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeTypeInput', ], 'output' => [ 'shape' => 'DescribeTypeOutput', 'resultWrapper' => 'DescribeTypeResult', ], 'errors' => [ [ 'shape' => 'CFNRegistryException', ], [ 'shape' => 'TypeNotFoundException', ], ], 'idempotent' => true, ], 'DescribeTypeRegistration' => [ 'name' => 'DescribeTypeRegistration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DescribeTypeRegistrationInput', ], 'output' => [ 'shape' => 'DescribeTypeRegistrationOutput', 'resultWrapper' => 'DescribeTypeRegistrationResult', ], 'errors' => [ [ 'shape' => 'CFNRegistryException', ], ], 'idempotent' => true, ], 'DetectStackDrift' => [ 'name' => 'DetectStackDrift', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DetectStackDriftInput', ], 'output' => [ 'shape' => 'DetectStackDriftOutput', 'resultWrapper' => 'DetectStackDriftResult', ], ], 'DetectStackResourceDrift' => [ 'name' => 'DetectStackResourceDrift', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DetectStackResourceDriftInput', ], 'output' => [ 'shape' => 'DetectStackResourceDriftOutput', 'resultWrapper' => 'DetectStackResourceDriftResult', ], ], 'DetectStackSetDrift' => [ 'name' => 'DetectStackSetDrift', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DetectStackSetDriftInput', ], 'output' => [ 'shape' => 'DetectStackSetDriftOutput', 'resultWrapper' => 'DetectStackSetDriftResult', ], 'errors' => [ [ 'shape' => 'InvalidOperationException', ], [ 'shape' => 'OperationInProgressException', ], [ 'shape' => 'StackSetNotFoundException', ], ], ], 'EstimateTemplateCost' => [ 'name' => 'EstimateTemplateCost', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'EstimateTemplateCostInput', ], 'output' => [ 'shape' => 'EstimateTemplateCostOutput', 'resultWrapper' => 'EstimateTemplateCostResult', ], ], 'ExecuteChangeSet' => [ 'name' => 'ExecuteChangeSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ExecuteChangeSetInput', ], 'output' => [ 'shape' => 'ExecuteChangeSetOutput', 'resultWrapper' => 'ExecuteChangeSetResult', ], 'errors' => [ [ 'shape' => 'InvalidChangeSetStatusException', ], [ 'shape' => 'ChangeSetNotFoundException', ], [ 'shape' => 'InsufficientCapabilitiesException', ], [ 'shape' => 'TokenAlreadyExistsException', ], ], ], 'GetStackPolicy' => [ 'name' => 'GetStackPolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetStackPolicyInput', ], 'output' => [ 'shape' => 'GetStackPolicyOutput', 'resultWrapper' => 'GetStackPolicyResult', ], ], 'GetTemplate' => [ 'name' => 'GetTemplate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetTemplateInput', ], 'output' => [ 'shape' => 'GetTemplateOutput', 'resultWrapper' => 'GetTemplateResult', ], 'errors' => [ [ 'shape' => 'ChangeSetNotFoundException', ], ], ], 'GetTemplateSummary' => [ 'name' => 'GetTemplateSummary', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetTemplateSummaryInput', ], 'output' => [ 'shape' => 'GetTemplateSummaryOutput', 'resultWrapper' => 'GetTemplateSummaryResult', ], 'errors' => [ [ 'shape' => 'StackSetNotFoundException', ], ], ], 'ImportStacksToStackSet' => [ 'name' => 'ImportStacksToStackSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ImportStacksToStackSetInput', ], 'output' => [ 'shape' => 'ImportStacksToStackSetOutput', 'resultWrapper' => 'ImportStacksToStackSetResult', ], 'errors' => [ [ 'shape' => 'LimitExceededException', ], [ 'shape' => 'StackSetNotFoundException', ], [ 'shape' => 'InvalidOperationException', ], [ 'shape' => 'OperationInProgressException', ], [ 'shape' => 'OperationIdAlreadyExistsException', ], [ 'shape' => 'StackNotFoundException', ], [ 'shape' => 'StaleRequestException', ], ], ], 'ListChangeSets' => [ 'name' => 'ListChangeSets', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListChangeSetsInput', ], 'output' => [ 'shape' => 'ListChangeSetsOutput', 'resultWrapper' => 'ListChangeSetsResult', ], ], 'ListExports' => [ 'name' => 'ListExports', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListExportsInput', ], 'output' => [ 'shape' => 'ListExportsOutput', 'resultWrapper' => 'ListExportsResult', ], ], 'ListImports' => [ 'name' => 'ListImports', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListImportsInput', ], 'output' => [ 'shape' => 'ListImportsOutput', 'resultWrapper' => 'ListImportsResult', ], ], 'ListStackInstances' => [ 'name' => 'ListStackInstances', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListStackInstancesInput', ], 'output' => [ 'shape' => 'ListStackInstancesOutput', 'resultWrapper' => 'ListStackInstancesResult', ], 'errors' => [ [ 'shape' => 'StackSetNotFoundException', ], ], ], 'ListStackResources' => [ 'name' => 'ListStackResources', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListStackResourcesInput', ], 'output' => [ 'shape' => 'ListStackResourcesOutput', 'resultWrapper' => 'ListStackResourcesResult', ], ], 'ListStackSetOperationResults' => [ 'name' => 'ListStackSetOperationResults', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListStackSetOperationResultsInput', ], 'output' => [ 'shape' => 'ListStackSetOperationResultsOutput', 'resultWrapper' => 'ListStackSetOperationResultsResult', ], 'errors' => [ [ 'shape' => 'StackSetNotFoundException', ], [ 'shape' => 'OperationNotFoundException', ], ], ], 'ListStackSetOperations' => [ 'name' => 'ListStackSetOperations', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListStackSetOperationsInput', ], 'output' => [ 'shape' => 'ListStackSetOperationsOutput', 'resultWrapper' => 'ListStackSetOperationsResult', ], 'errors' => [ [ 'shape' => 'StackSetNotFoundException', ], ], ], 'ListStackSets' => [ 'name' => 'ListStackSets', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListStackSetsInput', ], 'output' => [ 'shape' => 'ListStackSetsOutput', 'resultWrapper' => 'ListStackSetsResult', ], ], 'ListStacks' => [ 'name' => 'ListStacks', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListStacksInput', ], 'output' => [ 'shape' => 'ListStacksOutput', 'resultWrapper' => 'ListStacksResult', ], ], 'ListTypeRegistrations' => [ 'name' => 'ListTypeRegistrations', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListTypeRegistrationsInput', ], 'output' => [ 'shape' => 'ListTypeRegistrationsOutput', 'resultWrapper' => 'ListTypeRegistrationsResult', ], 'errors' => [ [ 'shape' => 'CFNRegistryException', ], ], 'idempotent' => true, ], 'ListTypeVersions' => [ 'name' => 'ListTypeVersions', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListTypeVersionsInput', ], 'output' => [ 'shape' => 'ListTypeVersionsOutput', 'resultWrapper' => 'ListTypeVersionsResult', ], 'errors' => [ [ 'shape' => 'CFNRegistryException', ], ], 'idempotent' => true, ], 'ListTypes' => [ 'name' => 'ListTypes', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListTypesInput', ], 'output' => [ 'shape' => 'ListTypesOutput', 'resultWrapper' => 'ListTypesResult', ], 'errors' => [ [ 'shape' => 'CFNRegistryException', ], ], 'idempotent' => true, ], 'PublishType' => [ 'name' => 'PublishType', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PublishTypeInput', ], 'output' => [ 'shape' => 'PublishTypeOutput', 'resultWrapper' => 'PublishTypeResult', ], 'errors' => [ [ 'shape' => 'CFNRegistryException', ], [ 'shape' => 'TypeNotFoundException', ], ], 'idempotent' => true, ], 'RecordHandlerProgress' => [ 'name' => 'RecordHandlerProgress', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'RecordHandlerProgressInput', ], 'output' => [ 'shape' => 'RecordHandlerProgressOutput', 'resultWrapper' => 'RecordHandlerProgressResult', ], 'errors' => [ [ 'shape' => 'InvalidStateTransitionException', ], [ 'shape' => 'OperationStatusCheckFailedException', ], ], 'idempotent' => true, ], 'RegisterPublisher' => [ 'name' => 'RegisterPublisher', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'RegisterPublisherInput', ], 'output' => [ 'shape' => 'RegisterPublisherOutput', 'resultWrapper' => 'RegisterPublisherResult', ], 'errors' => [ [ 'shape' => 'CFNRegistryException', ], ], 'idempotent' => true, ], 'RegisterType' => [ 'name' => 'RegisterType', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'RegisterTypeInput', ], 'output' => [ 'shape' => 'RegisterTypeOutput', 'resultWrapper' => 'RegisterTypeResult', ], 'errors' => [ [ 'shape' => 'CFNRegistryException', ], ], 'idempotent' => true, ], 'RollbackStack' => [ 'name' => 'RollbackStack', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'RollbackStackInput', ], 'output' => [ 'shape' => 'RollbackStackOutput', 'resultWrapper' => 'RollbackStackResult', ], 'errors' => [ [ 'shape' => 'TokenAlreadyExistsException', ], ], ], 'SetStackPolicy' => [ 'name' => 'SetStackPolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SetStackPolicyInput', ], ], 'SetTypeConfiguration' => [ 'name' => 'SetTypeConfiguration', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SetTypeConfigurationInput', ], 'output' => [ 'shape' => 'SetTypeConfigurationOutput', 'resultWrapper' => 'SetTypeConfigurationResult', ], 'errors' => [ [ 'shape' => 'CFNRegistryException', ], [ 'shape' => 'TypeNotFoundException', ], ], ], 'SetTypeDefaultVersion' => [ 'name' => 'SetTypeDefaultVersion', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SetTypeDefaultVersionInput', ], 'output' => [ 'shape' => 'SetTypeDefaultVersionOutput', 'resultWrapper' => 'SetTypeDefaultVersionResult', ], 'errors' => [ [ 'shape' => 'CFNRegistryException', ], [ 'shape' => 'TypeNotFoundException', ], ], 'idempotent' => true, ], 'SignalResource' => [ 'name' => 'SignalResource', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SignalResourceInput', ], ], 'StopStackSetOperation' => [ 'name' => 'StopStackSetOperation', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'StopStackSetOperationInput', ], 'output' => [ 'shape' => 'StopStackSetOperationOutput', 'resultWrapper' => 'StopStackSetOperationResult', ], 'errors' => [ [ 'shape' => 'StackSetNotFoundException', ], [ 'shape' => 'OperationNotFoundException', ], [ 'shape' => 'InvalidOperationException', ], ], ], 'TestType' => [ 'name' => 'TestType', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'TestTypeInput', ], 'output' => [ 'shape' => 'TestTypeOutput', 'resultWrapper' => 'TestTypeResult', ], 'errors' => [ [ 'shape' => 'CFNRegistryException', ], [ 'shape' => 'TypeNotFoundException', ], ], 'idempotent' => true, ], 'UpdateStack' => [ 'name' => 'UpdateStack', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateStackInput', ], 'output' => [ 'shape' => 'UpdateStackOutput', 'resultWrapper' => 'UpdateStackResult', ], 'errors' => [ [ 'shape' => 'InsufficientCapabilitiesException', ], [ 'shape' => 'TokenAlreadyExistsException', ], ], ], 'UpdateStackInstances' => [ 'name' => 'UpdateStackInstances', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateStackInstancesInput', ], 'output' => [ 'shape' => 'UpdateStackInstancesOutput', 'resultWrapper' => 'UpdateStackInstancesResult', ], 'errors' => [ [ 'shape' => 'StackSetNotFoundException', ], [ 'shape' => 'StackInstanceNotFoundException', ], [ 'shape' => 'OperationInProgressException', ], [ 'shape' => 'OperationIdAlreadyExistsException', ], [ 'shape' => 'StaleRequestException', ], [ 'shape' => 'InvalidOperationException', ], ], ], 'UpdateStackSet' => [ 'name' => 'UpdateStackSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateStackSetInput', ], 'output' => [ 'shape' => 'UpdateStackSetOutput', 'resultWrapper' => 'UpdateStackSetResult', ], 'errors' => [ [ 'shape' => 'StackSetNotFoundException', ], [ 'shape' => 'OperationInProgressException', ], [ 'shape' => 'OperationIdAlreadyExistsException', ], [ 'shape' => 'StaleRequestException', ], [ 'shape' => 'InvalidOperationException', ], [ 'shape' => 'StackInstanceNotFoundException', ], ], ], 'UpdateTerminationProtection' => [ 'name' => 'UpdateTerminationProtection', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateTerminationProtectionInput', ], 'output' => [ 'shape' => 'UpdateTerminationProtectionOutput', 'resultWrapper' => 'UpdateTerminationProtectionResult', ], ], 'ValidateTemplate' => [ 'name' => 'ValidateTemplate', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ValidateTemplateInput', ], 'output' => [ 'shape' => 'ValidateTemplateOutput', 'resultWrapper' => 'ValidateTemplateResult', ], ], ], 'shapes' => [ 'AcceptTermsAndConditions' => [ 'type' => 'boolean', ], 'Account' => [ 'type' => 'string', 'pattern' => '^[0-9]{12}$', ], 'AccountFilterType' => [ 'type' => 'string', 'enum' => [ 'NONE', 'INTERSECTION', 'DIFFERENCE', 'UNION', ], ], 'AccountGateResult' => [ 'type' => 'structure', 'members' => [ 'Status' => [ 'shape' => 'AccountGateStatus', ], 'StatusReason' => [ 'shape' => 'AccountGateStatusReason', ], ], ], 'AccountGateStatus' => [ 'type' => 'string', 'enum' => [ 'SUCCEEDED', 'FAILED', 'SKIPPED', ], ], 'AccountGateStatusReason' => [ 'type' => 'string', ], 'AccountLimit' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'LimitName', ], 'Value' => [ 'shape' => 'LimitValue', ], ], ], 'AccountLimitList' => [ 'type' => 'list', 'member' => [ 'shape' => 'AccountLimit', ], ], 'AccountList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Account', ], ], 'AccountsUrl' => [ 'type' => 'string', 'max' => 5120, 'min' => 1, 'pattern' => '(s3://|http(s?)://).+', ], 'ActivateOrganizationsAccessInput' => [ 'type' => 'structure', 'members' => [], ], 'ActivateOrganizationsAccessOutput' => [ 'type' => 'structure', 'members' => [], ], 'ActivateTypeInput' => [ 'type' => 'structure', 'members' => [ 'Type' => [ 'shape' => 'ThirdPartyType', ], 'PublicTypeArn' => [ 'shape' => 'ThirdPartyTypeArn', ], 'PublisherId' => [ 'shape' => 'PublisherId', ], 'TypeName' => [ 'shape' => 'TypeName', ], 'TypeNameAlias' => [ 'shape' => 'TypeName', ], 'AutoUpdate' => [ 'shape' => 'AutoUpdate', ], 'LoggingConfig' => [ 'shape' => 'LoggingConfig', ], 'ExecutionRoleArn' => [ 'shape' => 'RoleArn', ], 'VersionBump' => [ 'shape' => 'VersionBump', ], 'MajorVersion' => [ 'shape' => 'MajorVersion', ], ], ], 'ActivateTypeOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'PrivateTypeArn', ], ], ], 'AllowedValue' => [ 'type' => 'string', ], 'AllowedValues' => [ 'type' => 'list', 'member' => [ 'shape' => 'AllowedValue', ], ], 'AlreadyExistsException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'AlreadyExistsException', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'Arn' => [ 'type' => 'string', ], 'AutoDeployment' => [ 'type' => 'structure', 'members' => [ 'Enabled' => [ 'shape' => 'AutoDeploymentNullable', ], 'RetainStacksOnAccountRemoval' => [ 'shape' => 'RetainStacksOnAccountRemovalNullable', ], ], ], 'AutoDeploymentNullable' => [ 'type' => 'boolean', ], 'AutoUpdate' => [ 'type' => 'boolean', ], 'BatchDescribeTypeConfigurationsError' => [ 'type' => 'structure', 'members' => [ 'ErrorCode' => [ 'shape' => 'ErrorCode', ], 'ErrorMessage' => [ 'shape' => 'ErrorMessage', ], 'TypeConfigurationIdentifier' => [ 'shape' => 'TypeConfigurationIdentifier', ], ], ], 'BatchDescribeTypeConfigurationsErrors' => [ 'type' => 'list', 'member' => [ 'shape' => 'BatchDescribeTypeConfigurationsError', ], ], 'BatchDescribeTypeConfigurationsInput' => [ 'type' => 'structure', 'required' => [ 'TypeConfigurationIdentifiers', ], 'members' => [ 'TypeConfigurationIdentifiers' => [ 'shape' => 'TypeConfigurationIdentifiers', ], ], ], 'BatchDescribeTypeConfigurationsOutput' => [ 'type' => 'structure', 'members' => [ 'Errors' => [ 'shape' => 'BatchDescribeTypeConfigurationsErrors', ], 'UnprocessedTypeConfigurations' => [ 'shape' => 'UnprocessedTypeConfigurations', ], 'TypeConfigurations' => [ 'shape' => 'TypeConfigurationDetailsList', ], ], ], 'BoxedInteger' => [ 'type' => 'integer', 'box' => true, ], 'BoxedMaxResults' => [ 'type' => 'integer', 'box' => true, 'max' => 100, 'min' => 1, ], 'CFNRegistryException' => [ 'type' => 'structure', 'members' => [ 'Message' => [ 'shape' => 'ErrorMessage', ], ], 'error' => [ 'code' => 'CFNRegistryException', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'CallAs' => [ 'type' => 'string', 'enum' => [ 'SELF', 'DELEGATED_ADMIN', ], ], 'CancelUpdateStackInput' => [ 'type' => 'structure', 'required' => [ 'StackName', ], 'members' => [ 'StackName' => [ 'shape' => 'StackName', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', ], ], ], 'Capabilities' => [ 'type' => 'list', 'member' => [ 'shape' => 'Capability', ], ], 'CapabilitiesReason' => [ 'type' => 'string', ], 'Capability' => [ 'type' => 'string', 'enum' => [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', 'CAPABILITY_AUTO_EXPAND', ], ], 'Category' => [ 'type' => 'string', 'enum' => [ 'REGISTERED', 'ACTIVATED', 'THIRD_PARTY', 'AWS_TYPES', ], ], 'CausingEntity' => [ 'type' => 'string', ], 'Change' => [ 'type' => 'structure', 'members' => [ 'Type' => [ 'shape' => 'ChangeType', ], 'HookInvocationCount' => [ 'shape' => 'HookInvocationCount', ], 'ResourceChange' => [ 'shape' => 'ResourceChange', ], ], ], 'ChangeAction' => [ 'type' => 'string', 'enum' => [ 'Add', 'Modify', 'Remove', 'Import', 'Dynamic', ], ], 'ChangeSetHook' => [ 'type' => 'structure', 'members' => [ 'InvocationPoint' => [ 'shape' => 'HookInvocationPoint', ], 'FailureMode' => [ 'shape' => 'HookFailureMode', ], 'TypeName' => [ 'shape' => 'HookTypeName', ], 'TypeVersionId' => [ 'shape' => 'HookTypeVersionId', ], 'TypeConfigurationVersionId' => [ 'shape' => 'HookTypeConfigurationVersionId', ], 'TargetDetails' => [ 'shape' => 'ChangeSetHookTargetDetails', ], ], ], 'ChangeSetHookResourceTargetDetails' => [ 'type' => 'structure', 'members' => [ 'LogicalResourceId' => [ 'shape' => 'LogicalResourceId', ], 'ResourceType' => [ 'shape' => 'HookTargetTypeName', ], 'ResourceAction' => [ 'shape' => 'ChangeAction', ], ], ], 'ChangeSetHookTargetDetails' => [ 'type' => 'structure', 'members' => [ 'TargetType' => [ 'shape' => 'HookTargetType', ], 'ResourceTargetDetails' => [ 'shape' => 'ChangeSetHookResourceTargetDetails', ], ], ], 'ChangeSetHooks' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChangeSetHook', ], ], 'ChangeSetHooksStatus' => [ 'type' => 'string', 'enum' => [ 'PLANNING', 'PLANNED', 'UNAVAILABLE', ], ], 'ChangeSetId' => [ 'type' => 'string', 'min' => 1, 'pattern' => 'arn:[-a-zA-Z0-9:/]*', ], 'ChangeSetName' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[a-zA-Z][-a-zA-Z0-9]*', ], 'ChangeSetNameOrId' => [ 'type' => 'string', 'max' => 1600, 'min' => 1, 'pattern' => '[a-zA-Z][-a-zA-Z0-9]*|arn:[-a-zA-Z0-9:/]*', ], 'ChangeSetNotFoundException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'ChangeSetNotFound', 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'ChangeSetStatus' => [ 'type' => 'string', 'enum' => [ 'CREATE_PENDING', 'CREATE_IN_PROGRESS', 'CREATE_COMPLETE', 'DELETE_PENDING', 'DELETE_IN_PROGRESS', 'DELETE_COMPLETE', 'DELETE_FAILED', 'FAILED', ], ], 'ChangeSetStatusReason' => [ 'type' => 'string', ], 'ChangeSetSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'ChangeSetSummary', ], ], 'ChangeSetSummary' => [ 'type' => 'structure', 'members' => [ 'StackId' => [ 'shape' => 'StackId', ], 'StackName' => [ 'shape' => 'StackName', ], 'ChangeSetId' => [ 'shape' => 'ChangeSetId', ], 'ChangeSetName' => [ 'shape' => 'ChangeSetName', ], 'ExecutionStatus' => [ 'shape' => 'ExecutionStatus', ], 'Status' => [ 'shape' => 'ChangeSetStatus', ], 'StatusReason' => [ 'shape' => 'ChangeSetStatusReason', ], 'CreationTime' => [ 'shape' => 'CreationTime', ], 'Description' => [ 'shape' => 'Description', ], 'IncludeNestedStacks' => [ 'shape' => 'IncludeNestedStacks', ], 'ParentChangeSetId' => [ 'shape' => 'ChangeSetId', ], 'RootChangeSetId' => [ 'shape' => 'ChangeSetId', ], ], ], 'ChangeSetType' => [ 'type' => 'string', 'enum' => [ 'CREATE', 'UPDATE', 'IMPORT', ], ], 'ChangeSource' => [ 'type' => 'string', 'enum' => [ 'ResourceReference', 'ParameterReference', 'ResourceAttribute', 'DirectModification', 'Automatic', ], ], 'ChangeType' => [ 'type' => 'string', 'enum' => [ 'Resource', ], ], 'Changes' => [ 'type' => 'list', 'member' => [ 'shape' => 'Change', ], ], 'ClientRequestToken' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[a-zA-Z0-9][-a-zA-Z0-9]*', ], 'ClientToken' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'ConfigurationSchema' => [ 'type' => 'string', 'max' => 60000, 'min' => 1, 'pattern' => '[\\\\s\\\\S]+', ], 'ConnectionArn' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => 'arn:aws(-[\\\\w]+)*:.+:.+:[0-9]{12}:.+', ], 'ContinueUpdateRollbackInput' => [ 'type' => 'structure', 'required' => [ 'StackName', ], 'members' => [ 'StackName' => [ 'shape' => 'StackNameOrId', ], 'RoleARN' => [ 'shape' => 'RoleARN', ], 'ResourcesToSkip' => [ 'shape' => 'ResourcesToSkip', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', ], ], ], 'ContinueUpdateRollbackOutput' => [ 'type' => 'structure', 'members' => [], ], 'CreateChangeSetInput' => [ 'type' => 'structure', 'required' => [ 'StackName', 'ChangeSetName', ], 'members' => [ 'StackName' => [ 'shape' => 'StackNameOrId', ], 'TemplateBody' => [ 'shape' => 'TemplateBody', ], 'TemplateURL' => [ 'shape' => 'TemplateURL', ], 'UsePreviousTemplate' => [ 'shape' => 'UsePreviousTemplate', ], 'Parameters' => [ 'shape' => 'Parameters', ], 'Capabilities' => [ 'shape' => 'Capabilities', ], 'ResourceTypes' => [ 'shape' => 'ResourceTypes', ], 'RoleARN' => [ 'shape' => 'RoleARN', ], 'RollbackConfiguration' => [ 'shape' => 'RollbackConfiguration', ], 'NotificationARNs' => [ 'shape' => 'NotificationARNs', ], 'Tags' => [ 'shape' => 'Tags', ], 'ChangeSetName' => [ 'shape' => 'ChangeSetName', ], 'ClientToken' => [ 'shape' => 'ClientToken', ], 'Description' => [ 'shape' => 'Description', ], 'ChangeSetType' => [ 'shape' => 'ChangeSetType', ], 'ResourcesToImport' => [ 'shape' => 'ResourcesToImport', ], 'IncludeNestedStacks' => [ 'shape' => 'IncludeNestedStacks', ], 'OnStackFailure' => [ 'shape' => 'OnStackFailure', ], ], ], 'CreateChangeSetOutput' => [ 'type' => 'structure', 'members' => [ 'Id' => [ 'shape' => 'ChangeSetId', ], 'StackId' => [ 'shape' => 'StackId', ], ], ], 'CreateStackInput' => [ 'type' => 'structure', 'required' => [ 'StackName', ], 'members' => [ 'StackName' => [ 'shape' => 'StackName', ], 'TemplateBody' => [ 'shape' => 'TemplateBody', ], 'TemplateURL' => [ 'shape' => 'TemplateURL', ], 'Parameters' => [ 'shape' => 'Parameters', ], 'DisableRollback' => [ 'shape' => 'DisableRollback', ], 'RollbackConfiguration' => [ 'shape' => 'RollbackConfiguration', ], 'TimeoutInMinutes' => [ 'shape' => 'TimeoutMinutes', ], 'NotificationARNs' => [ 'shape' => 'NotificationARNs', ], 'Capabilities' => [ 'shape' => 'Capabilities', ], 'ResourceTypes' => [ 'shape' => 'ResourceTypes', ], 'RoleARN' => [ 'shape' => 'RoleARN', ], 'OnFailure' => [ 'shape' => 'OnFailure', ], 'StackPolicyBody' => [ 'shape' => 'StackPolicyBody', ], 'StackPolicyURL' => [ 'shape' => 'StackPolicyURL', ], 'Tags' => [ 'shape' => 'Tags', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', ], 'EnableTerminationProtection' => [ 'shape' => 'EnableTerminationProtection', ], ], ], 'CreateStackInstancesInput' => [ 'type' => 'structure', 'required' => [ 'StackSetName', 'Regions', ], 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetName', ], 'Accounts' => [ 'shape' => 'AccountList', ], 'DeploymentTargets' => [ 'shape' => 'DeploymentTargets', ], 'Regions' => [ 'shape' => 'RegionList', ], 'ParameterOverrides' => [ 'shape' => 'Parameters', ], 'OperationPreferences' => [ 'shape' => 'StackSetOperationPreferences', ], 'OperationId' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'CallAs' => [ 'shape' => 'CallAs', ], ], ], 'CreateStackInstancesOutput' => [ 'type' => 'structure', 'members' => [ 'OperationId' => [ 'shape' => 'ClientRequestToken', ], ], ], 'CreateStackOutput' => [ 'type' => 'structure', 'members' => [ 'StackId' => [ 'shape' => 'StackId', ], ], ], 'CreateStackSetInput' => [ 'type' => 'structure', 'required' => [ 'StackSetName', ], 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetName', ], 'Description' => [ 'shape' => 'Description', ], 'TemplateBody' => [ 'shape' => 'TemplateBody', ], 'TemplateURL' => [ 'shape' => 'TemplateURL', ], 'StackId' => [ 'shape' => 'StackId', ], 'Parameters' => [ 'shape' => 'Parameters', ], 'Capabilities' => [ 'shape' => 'Capabilities', ], 'Tags' => [ 'shape' => 'Tags', ], 'AdministrationRoleARN' => [ 'shape' => 'RoleARN', ], 'ExecutionRoleName' => [ 'shape' => 'ExecutionRoleName', ], 'PermissionModel' => [ 'shape' => 'PermissionModels', ], 'AutoDeployment' => [ 'shape' => 'AutoDeployment', ], 'CallAs' => [ 'shape' => 'CallAs', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'ManagedExecution' => [ 'shape' => 'ManagedExecution', ], ], ], 'CreateStackSetOutput' => [ 'type' => 'structure', 'members' => [ 'StackSetId' => [ 'shape' => 'StackSetId', ], ], ], 'CreatedButModifiedException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'CreatedButModifiedException', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'CreationTime' => [ 'type' => 'timestamp', ], 'DeactivateOrganizationsAccessInput' => [ 'type' => 'structure', 'members' => [], ], 'DeactivateOrganizationsAccessOutput' => [ 'type' => 'structure', 'members' => [], ], 'DeactivateTypeInput' => [ 'type' => 'structure', 'members' => [ 'TypeName' => [ 'shape' => 'TypeName', ], 'Type' => [ 'shape' => 'ThirdPartyType', ], 'Arn' => [ 'shape' => 'PrivateTypeArn', ], ], ], 'DeactivateTypeOutput' => [ 'type' => 'structure', 'members' => [], ], 'DeleteChangeSetInput' => [ 'type' => 'structure', 'required' => [ 'ChangeSetName', ], 'members' => [ 'ChangeSetName' => [ 'shape' => 'ChangeSetNameOrId', ], 'StackName' => [ 'shape' => 'StackNameOrId', ], ], ], 'DeleteChangeSetOutput' => [ 'type' => 'structure', 'members' => [], ], 'DeleteStackInput' => [ 'type' => 'structure', 'required' => [ 'StackName', ], 'members' => [ 'StackName' => [ 'shape' => 'StackName', ], 'RetainResources' => [ 'shape' => 'RetainResources', ], 'RoleARN' => [ 'shape' => 'RoleARN', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', ], ], ], 'DeleteStackInstancesInput' => [ 'type' => 'structure', 'required' => [ 'StackSetName', 'Regions', 'RetainStacks', ], 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetName', ], 'Accounts' => [ 'shape' => 'AccountList', ], 'DeploymentTargets' => [ 'shape' => 'DeploymentTargets', ], 'Regions' => [ 'shape' => 'RegionList', ], 'OperationPreferences' => [ 'shape' => 'StackSetOperationPreferences', ], 'RetainStacks' => [ 'shape' => 'RetainStacks', ], 'OperationId' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'CallAs' => [ 'shape' => 'CallAs', ], ], ], 'DeleteStackInstancesOutput' => [ 'type' => 'structure', 'members' => [ 'OperationId' => [ 'shape' => 'ClientRequestToken', ], ], ], 'DeleteStackSetInput' => [ 'type' => 'structure', 'required' => [ 'StackSetName', ], 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetName', ], 'CallAs' => [ 'shape' => 'CallAs', ], ], ], 'DeleteStackSetOutput' => [ 'type' => 'structure', 'members' => [], ], 'DeletionTime' => [ 'type' => 'timestamp', ], 'DeploymentTargets' => [ 'type' => 'structure', 'members' => [ 'Accounts' => [ 'shape' => 'AccountList', ], 'AccountsUrl' => [ 'shape' => 'AccountsUrl', ], 'OrganizationalUnitIds' => [ 'shape' => 'OrganizationalUnitIdList', ], 'AccountFilterType' => [ 'shape' => 'AccountFilterType', ], ], ], 'DeprecatedStatus' => [ 'type' => 'string', 'enum' => [ 'LIVE', 'DEPRECATED', ], ], 'DeregisterTypeInput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'PrivateTypeArn', ], 'Type' => [ 'shape' => 'RegistryType', ], 'TypeName' => [ 'shape' => 'TypeName', ], 'VersionId' => [ 'shape' => 'TypeVersionId', ], ], ], 'DeregisterTypeOutput' => [ 'type' => 'structure', 'members' => [], ], 'DescribeAccountLimitsInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeAccountLimitsOutput' => [ 'type' => 'structure', 'members' => [ 'AccountLimits' => [ 'shape' => 'AccountLimitList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeChangeSetHooksInput' => [ 'type' => 'structure', 'required' => [ 'ChangeSetName', ], 'members' => [ 'ChangeSetName' => [ 'shape' => 'ChangeSetNameOrId', ], 'StackName' => [ 'shape' => 'StackNameOrId', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'LogicalResourceId' => [ 'shape' => 'LogicalResourceId', ], ], ], 'DescribeChangeSetHooksOutput' => [ 'type' => 'structure', 'members' => [ 'ChangeSetId' => [ 'shape' => 'ChangeSetId', ], 'ChangeSetName' => [ 'shape' => 'ChangeSetName', ], 'Hooks' => [ 'shape' => 'ChangeSetHooks', ], 'Status' => [ 'shape' => 'ChangeSetHooksStatus', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'StackId' => [ 'shape' => 'StackId', ], 'StackName' => [ 'shape' => 'StackName', ], ], ], 'DescribeChangeSetInput' => [ 'type' => 'structure', 'required' => [ 'ChangeSetName', ], 'members' => [ 'ChangeSetName' => [ 'shape' => 'ChangeSetNameOrId', ], 'StackName' => [ 'shape' => 'StackNameOrId', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeChangeSetOutput' => [ 'type' => 'structure', 'members' => [ 'ChangeSetName' => [ 'shape' => 'ChangeSetName', ], 'ChangeSetId' => [ 'shape' => 'ChangeSetId', ], 'StackId' => [ 'shape' => 'StackId', ], 'StackName' => [ 'shape' => 'StackName', ], 'Description' => [ 'shape' => 'Description', ], 'Parameters' => [ 'shape' => 'Parameters', ], 'CreationTime' => [ 'shape' => 'CreationTime', ], 'ExecutionStatus' => [ 'shape' => 'ExecutionStatus', ], 'Status' => [ 'shape' => 'ChangeSetStatus', ], 'StatusReason' => [ 'shape' => 'ChangeSetStatusReason', ], 'NotificationARNs' => [ 'shape' => 'NotificationARNs', ], 'RollbackConfiguration' => [ 'shape' => 'RollbackConfiguration', ], 'Capabilities' => [ 'shape' => 'Capabilities', ], 'Tags' => [ 'shape' => 'Tags', ], 'Changes' => [ 'shape' => 'Changes', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'IncludeNestedStacks' => [ 'shape' => 'IncludeNestedStacks', ], 'ParentChangeSetId' => [ 'shape' => 'ChangeSetId', ], 'RootChangeSetId' => [ 'shape' => 'ChangeSetId', ], 'OnStackFailure' => [ 'shape' => 'OnStackFailure', ], ], ], 'DescribeOrganizationsAccessInput' => [ 'type' => 'structure', 'members' => [ 'CallAs' => [ 'shape' => 'CallAs', ], ], ], 'DescribeOrganizationsAccessOutput' => [ 'type' => 'structure', 'members' => [ 'Status' => [ 'shape' => 'OrganizationStatus', ], ], ], 'DescribePublisherInput' => [ 'type' => 'structure', 'members' => [ 'PublisherId' => [ 'shape' => 'PublisherId', ], ], ], 'DescribePublisherOutput' => [ 'type' => 'structure', 'members' => [ 'PublisherId' => [ 'shape' => 'PublisherId', ], 'PublisherStatus' => [ 'shape' => 'PublisherStatus', ], 'IdentityProvider' => [ 'shape' => 'IdentityProvider', ], 'PublisherProfile' => [ 'shape' => 'PublisherProfile', ], ], ], 'DescribeStackDriftDetectionStatusInput' => [ 'type' => 'structure', 'required' => [ 'StackDriftDetectionId', ], 'members' => [ 'StackDriftDetectionId' => [ 'shape' => 'StackDriftDetectionId', ], ], ], 'DescribeStackDriftDetectionStatusOutput' => [ 'type' => 'structure', 'required' => [ 'StackId', 'StackDriftDetectionId', 'DetectionStatus', 'Timestamp', ], 'members' => [ 'StackId' => [ 'shape' => 'StackId', ], 'StackDriftDetectionId' => [ 'shape' => 'StackDriftDetectionId', ], 'StackDriftStatus' => [ 'shape' => 'StackDriftStatus', ], 'DetectionStatus' => [ 'shape' => 'StackDriftDetectionStatus', ], 'DetectionStatusReason' => [ 'shape' => 'StackDriftDetectionStatusReason', ], 'DriftedStackResourceCount' => [ 'shape' => 'BoxedInteger', ], 'Timestamp' => [ 'shape' => 'Timestamp', ], ], ], 'DescribeStackEventsInput' => [ 'type' => 'structure', 'members' => [ 'StackName' => [ 'shape' => 'StackName', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeStackEventsOutput' => [ 'type' => 'structure', 'members' => [ 'StackEvents' => [ 'shape' => 'StackEvents', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeStackInstanceInput' => [ 'type' => 'structure', 'required' => [ 'StackSetName', 'StackInstanceAccount', 'StackInstanceRegion', ], 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetName', ], 'StackInstanceAccount' => [ 'shape' => 'Account', ], 'StackInstanceRegion' => [ 'shape' => 'Region', ], 'CallAs' => [ 'shape' => 'CallAs', ], ], ], 'DescribeStackInstanceOutput' => [ 'type' => 'structure', 'members' => [ 'StackInstance' => [ 'shape' => 'StackInstance', ], ], ], 'DescribeStackResourceDriftsInput' => [ 'type' => 'structure', 'required' => [ 'StackName', ], 'members' => [ 'StackName' => [ 'shape' => 'StackNameOrId', ], 'StackResourceDriftStatusFilters' => [ 'shape' => 'StackResourceDriftStatusFilters', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'BoxedMaxResults', ], ], ], 'DescribeStackResourceDriftsOutput' => [ 'type' => 'structure', 'required' => [ 'StackResourceDrifts', ], 'members' => [ 'StackResourceDrifts' => [ 'shape' => 'StackResourceDrifts', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeStackResourceInput' => [ 'type' => 'structure', 'required' => [ 'StackName', 'LogicalResourceId', ], 'members' => [ 'StackName' => [ 'shape' => 'StackName', ], 'LogicalResourceId' => [ 'shape' => 'LogicalResourceId', ], ], ], 'DescribeStackResourceOutput' => [ 'type' => 'structure', 'members' => [ 'StackResourceDetail' => [ 'shape' => 'StackResourceDetail', ], ], ], 'DescribeStackResourcesInput' => [ 'type' => 'structure', 'members' => [ 'StackName' => [ 'shape' => 'StackName', ], 'LogicalResourceId' => [ 'shape' => 'LogicalResourceId', ], 'PhysicalResourceId' => [ 'shape' => 'PhysicalResourceId', ], ], ], 'DescribeStackResourcesOutput' => [ 'type' => 'structure', 'members' => [ 'StackResources' => [ 'shape' => 'StackResources', ], ], ], 'DescribeStackSetInput' => [ 'type' => 'structure', 'required' => [ 'StackSetName', ], 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetName', ], 'CallAs' => [ 'shape' => 'CallAs', ], ], ], 'DescribeStackSetOperationInput' => [ 'type' => 'structure', 'required' => [ 'StackSetName', 'OperationId', ], 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetName', ], 'OperationId' => [ 'shape' => 'ClientRequestToken', ], 'CallAs' => [ 'shape' => 'CallAs', ], ], ], 'DescribeStackSetOperationOutput' => [ 'type' => 'structure', 'members' => [ 'StackSetOperation' => [ 'shape' => 'StackSetOperation', ], ], ], 'DescribeStackSetOutput' => [ 'type' => 'structure', 'members' => [ 'StackSet' => [ 'shape' => 'StackSet', ], ], ], 'DescribeStacksInput' => [ 'type' => 'structure', 'members' => [ 'StackName' => [ 'shape' => 'StackName', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeStacksOutput' => [ 'type' => 'structure', 'members' => [ 'Stacks' => [ 'shape' => 'Stacks', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'DescribeTypeInput' => [ 'type' => 'structure', 'members' => [ 'Type' => [ 'shape' => 'RegistryType', ], 'TypeName' => [ 'shape' => 'TypeName', ], 'Arn' => [ 'shape' => 'TypeArn', ], 'VersionId' => [ 'shape' => 'TypeVersionId', ], 'PublisherId' => [ 'shape' => 'PublisherId', ], 'PublicVersionNumber' => [ 'shape' => 'PublicVersionNumber', ], ], ], 'DescribeTypeOutput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'TypeArn', ], 'Type' => [ 'shape' => 'RegistryType', ], 'TypeName' => [ 'shape' => 'TypeName', ], 'DefaultVersionId' => [ 'shape' => 'TypeVersionId', ], 'IsDefaultVersion' => [ 'shape' => 'IsDefaultVersion', ], 'TypeTestsStatus' => [ 'shape' => 'TypeTestsStatus', ], 'TypeTestsStatusDescription' => [ 'shape' => 'TypeTestsStatusDescription', ], 'Description' => [ 'shape' => 'Description', ], 'Schema' => [ 'shape' => 'TypeSchema', ], 'ProvisioningType' => [ 'shape' => 'ProvisioningType', ], 'DeprecatedStatus' => [ 'shape' => 'DeprecatedStatus', ], 'LoggingConfig' => [ 'shape' => 'LoggingConfig', ], 'RequiredActivatedTypes' => [ 'shape' => 'RequiredActivatedTypes', ], 'ExecutionRoleArn' => [ 'shape' => 'RoleArn', ], 'Visibility' => [ 'shape' => 'Visibility', ], 'SourceUrl' => [ 'shape' => 'OptionalSecureUrl', ], 'DocumentationUrl' => [ 'shape' => 'OptionalSecureUrl', ], 'LastUpdated' => [ 'shape' => 'Timestamp', ], 'TimeCreated' => [ 'shape' => 'Timestamp', ], 'ConfigurationSchema' => [ 'shape' => 'ConfigurationSchema', ], 'PublisherId' => [ 'shape' => 'PublisherId', ], 'OriginalTypeName' => [ 'shape' => 'TypeName', ], 'OriginalTypeArn' => [ 'shape' => 'TypeArn', ], 'PublicVersionNumber' => [ 'shape' => 'PublicVersionNumber', ], 'LatestPublicVersion' => [ 'shape' => 'PublicVersionNumber', ], 'IsActivated' => [ 'shape' => 'IsActivated', ], 'AutoUpdate' => [ 'shape' => 'AutoUpdate', ], ], ], 'DescribeTypeRegistrationInput' => [ 'type' => 'structure', 'required' => [ 'RegistrationToken', ], 'members' => [ 'RegistrationToken' => [ 'shape' => 'RegistrationToken', ], ], ], 'DescribeTypeRegistrationOutput' => [ 'type' => 'structure', 'members' => [ 'ProgressStatus' => [ 'shape' => 'RegistrationStatus', ], 'Description' => [ 'shape' => 'Description', ], 'TypeArn' => [ 'shape' => 'TypeArn', ], 'TypeVersionArn' => [ 'shape' => 'TypeArn', ], ], ], 'Description' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, ], 'DetectStackDriftInput' => [ 'type' => 'structure', 'required' => [ 'StackName', ], 'members' => [ 'StackName' => [ 'shape' => 'StackNameOrId', ], 'LogicalResourceIds' => [ 'shape' => 'LogicalResourceIds', ], ], ], 'DetectStackDriftOutput' => [ 'type' => 'structure', 'required' => [ 'StackDriftDetectionId', ], 'members' => [ 'StackDriftDetectionId' => [ 'shape' => 'StackDriftDetectionId', ], ], ], 'DetectStackResourceDriftInput' => [ 'type' => 'structure', 'required' => [ 'StackName', 'LogicalResourceId', ], 'members' => [ 'StackName' => [ 'shape' => 'StackNameOrId', ], 'LogicalResourceId' => [ 'shape' => 'LogicalResourceId', ], ], ], 'DetectStackResourceDriftOutput' => [ 'type' => 'structure', 'required' => [ 'StackResourceDrift', ], 'members' => [ 'StackResourceDrift' => [ 'shape' => 'StackResourceDrift', ], ], ], 'DetectStackSetDriftInput' => [ 'type' => 'structure', 'required' => [ 'StackSetName', ], 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetNameOrId', ], 'OperationPreferences' => [ 'shape' => 'StackSetOperationPreferences', ], 'OperationId' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'CallAs' => [ 'shape' => 'CallAs', ], ], ], 'DetectStackSetDriftOutput' => [ 'type' => 'structure', 'members' => [ 'OperationId' => [ 'shape' => 'ClientRequestToken', ], ], ], 'DifferenceType' => [ 'type' => 'string', 'enum' => [ 'ADD', 'REMOVE', 'NOT_EQUAL', ], ], 'DisableRollback' => [ 'type' => 'boolean', ], 'DriftedStackInstancesCount' => [ 'type' => 'integer', 'min' => 0, ], 'EnableTerminationProtection' => [ 'type' => 'boolean', ], 'ErrorCode' => [ 'type' => 'string', 'max' => 3, 'min' => 3, ], 'ErrorMessage' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'EstimateTemplateCostInput' => [ 'type' => 'structure', 'members' => [ 'TemplateBody' => [ 'shape' => 'TemplateBody', ], 'TemplateURL' => [ 'shape' => 'TemplateURL', ], 'Parameters' => [ 'shape' => 'Parameters', ], ], ], 'EstimateTemplateCostOutput' => [ 'type' => 'structure', 'members' => [ 'Url' => [ 'shape' => 'Url', ], ], ], 'EvaluationType' => [ 'type' => 'string', 'enum' => [ 'Static', 'Dynamic', ], ], 'EventId' => [ 'type' => 'string', ], 'ExecuteChangeSetInput' => [ 'type' => 'structure', 'required' => [ 'ChangeSetName', ], 'members' => [ 'ChangeSetName' => [ 'shape' => 'ChangeSetNameOrId', ], 'StackName' => [ 'shape' => 'StackNameOrId', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', ], 'DisableRollback' => [ 'shape' => 'DisableRollback', ], ], ], 'ExecuteChangeSetOutput' => [ 'type' => 'structure', 'members' => [], ], 'ExecutionRoleName' => [ 'type' => 'string', 'max' => 64, 'min' => 1, 'pattern' => '[a-zA-Z_0-9+=,.@-]+', ], 'ExecutionStatus' => [ 'type' => 'string', 'enum' => [ 'UNAVAILABLE', 'AVAILABLE', 'EXECUTE_IN_PROGRESS', 'EXECUTE_COMPLETE', 'EXECUTE_FAILED', 'OBSOLETE', ], ], 'Export' => [ 'type' => 'structure', 'members' => [ 'ExportingStackId' => [ 'shape' => 'StackId', ], 'Name' => [ 'shape' => 'ExportName', ], 'Value' => [ 'shape' => 'ExportValue', ], ], ], 'ExportName' => [ 'type' => 'string', ], 'ExportValue' => [ 'type' => 'string', ], 'Exports' => [ 'type' => 'list', 'member' => [ 'shape' => 'Export', ], ], 'FailedStackInstancesCount' => [ 'type' => 'integer', 'min' => 0, ], 'FailureToleranceCount' => [ 'type' => 'integer', 'min' => 0, ], 'FailureTolerancePercentage' => [ 'type' => 'integer', 'max' => 100, 'min' => 0, ], 'GetStackPolicyInput' => [ 'type' => 'structure', 'required' => [ 'StackName', ], 'members' => [ 'StackName' => [ 'shape' => 'StackName', ], ], ], 'GetStackPolicyOutput' => [ 'type' => 'structure', 'members' => [ 'StackPolicyBody' => [ 'shape' => 'StackPolicyBody', ], ], ], 'GetTemplateInput' => [ 'type' => 'structure', 'members' => [ 'StackName' => [ 'shape' => 'StackName', ], 'ChangeSetName' => [ 'shape' => 'ChangeSetNameOrId', ], 'TemplateStage' => [ 'shape' => 'TemplateStage', ], ], ], 'GetTemplateOutput' => [ 'type' => 'structure', 'members' => [ 'TemplateBody' => [ 'shape' => 'TemplateBody', ], 'StagesAvailable' => [ 'shape' => 'StageList', ], ], ], 'GetTemplateSummaryInput' => [ 'type' => 'structure', 'members' => [ 'TemplateBody' => [ 'shape' => 'TemplateBody', ], 'TemplateURL' => [ 'shape' => 'TemplateURL', ], 'StackName' => [ 'shape' => 'StackNameOrId', ], 'StackSetName' => [ 'shape' => 'StackSetNameOrId', ], 'CallAs' => [ 'shape' => 'CallAs', ], ], ], 'GetTemplateSummaryOutput' => [ 'type' => 'structure', 'members' => [ 'Parameters' => [ 'shape' => 'ParameterDeclarations', ], 'Description' => [ 'shape' => 'Description', ], 'Capabilities' => [ 'shape' => 'Capabilities', ], 'CapabilitiesReason' => [ 'shape' => 'CapabilitiesReason', ], 'ResourceTypes' => [ 'shape' => 'ResourceTypes', ], 'Version' => [ 'shape' => 'Version', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'DeclaredTransforms' => [ 'shape' => 'TransformsList', ], 'ResourceIdentifierSummaries' => [ 'shape' => 'ResourceIdentifierSummaries', ], ], ], 'HandlerErrorCode' => [ 'type' => 'string', 'enum' => [ 'NotUpdatable', 'InvalidRequest', 'AccessDenied', 'InvalidCredentials', 'AlreadyExists', 'NotFound', 'ResourceConflict', 'Throttling', 'ServiceLimitExceeded', 'NotStabilized', 'GeneralServiceException', 'ServiceInternalError', 'NetworkFailure', 'InternalFailure', 'InvalidTypeConfiguration', 'HandlerInternalFailure', 'NonCompliant', 'Unknown', 'UnsupportedTarget', ], ], 'HookFailureMode' => [ 'type' => 'string', 'enum' => [ 'FAIL', 'WARN', ], ], 'HookInvocationCount' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'HookInvocationPoint' => [ 'type' => 'string', 'enum' => [ 'PRE_PROVISION', ], ], 'HookStatus' => [ 'type' => 'string', 'enum' => [ 'HOOK_IN_PROGRESS', 'HOOK_COMPLETE_SUCCEEDED', 'HOOK_COMPLETE_FAILED', 'HOOK_FAILED', ], ], 'HookStatusReason' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, ], 'HookTargetType' => [ 'type' => 'string', 'enum' => [ 'RESOURCE', ], ], 'HookTargetTypeName' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '^[a-zA-Z0-9]{2,64}::[a-zA-Z0-9]{2,64}::[a-zA-Z0-9]{2,64}$', ], 'HookType' => [ 'type' => 'string', 'max' => 255, 'min' => 1, ], 'HookTypeConfigurationVersionId' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[A-Za-z0-9-]+', ], 'HookTypeName' => [ 'type' => 'string', 'max' => 196, 'min' => 10, ], 'HookTypeVersionId' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[A-Za-z0-9-]+', ], 'IdentityProvider' => [ 'type' => 'string', 'enum' => [ 'AWS_Marketplace', 'GitHub', 'Bitbucket', ], ], 'ImportStacksToStackSetInput' => [ 'type' => 'structure', 'required' => [ 'StackSetName', ], 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetNameOrId', ], 'StackIds' => [ 'shape' => 'StackIdList', ], 'StackIdsUrl' => [ 'shape' => 'StackIdsUrl', ], 'OrganizationalUnitIds' => [ 'shape' => 'OrganizationalUnitIdList', ], 'OperationPreferences' => [ 'shape' => 'StackSetOperationPreferences', ], 'OperationId' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'CallAs' => [ 'shape' => 'CallAs', ], ], ], 'ImportStacksToStackSetOutput' => [ 'type' => 'structure', 'members' => [ 'OperationId' => [ 'shape' => 'ClientRequestToken', ], ], ], 'Imports' => [ 'type' => 'list', 'member' => [ 'shape' => 'StackName', ], ], 'InProgressStackInstancesCount' => [ 'type' => 'integer', 'min' => 0, ], 'InSyncStackInstancesCount' => [ 'type' => 'integer', 'min' => 0, ], 'IncludeNestedStacks' => [ 'type' => 'boolean', ], 'InsufficientCapabilitiesException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'InsufficientCapabilitiesException', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'InvalidChangeSetStatusException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'InvalidChangeSetStatus', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'InvalidOperationException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'InvalidOperationException', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'InvalidStateTransitionException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'InvalidStateTransition', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'IsActivated' => [ 'type' => 'boolean', ], 'IsDefaultConfiguration' => [ 'type' => 'boolean', ], 'IsDefaultVersion' => [ 'type' => 'boolean', ], 'Key' => [ 'type' => 'string', ], 'LastUpdatedTime' => [ 'type' => 'timestamp', ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'LimitExceededException', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'LimitName' => [ 'type' => 'string', ], 'LimitValue' => [ 'type' => 'integer', ], 'ListChangeSetsInput' => [ 'type' => 'structure', 'required' => [ 'StackName', ], 'members' => [ 'StackName' => [ 'shape' => 'StackNameOrId', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListChangeSetsOutput' => [ 'type' => 'structure', 'members' => [ 'Summaries' => [ 'shape' => 'ChangeSetSummaries', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListExportsInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListExportsOutput' => [ 'type' => 'structure', 'members' => [ 'Exports' => [ 'shape' => 'Exports', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListImportsInput' => [ 'type' => 'structure', 'required' => [ 'ExportName', ], 'members' => [ 'ExportName' => [ 'shape' => 'ExportName', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListImportsOutput' => [ 'type' => 'structure', 'members' => [ 'Imports' => [ 'shape' => 'Imports', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListStackInstancesInput' => [ 'type' => 'structure', 'required' => [ 'StackSetName', ], 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetName', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'Filters' => [ 'shape' => 'StackInstanceFilters', ], 'StackInstanceAccount' => [ 'shape' => 'Account', ], 'StackInstanceRegion' => [ 'shape' => 'Region', ], 'CallAs' => [ 'shape' => 'CallAs', ], ], ], 'ListStackInstancesOutput' => [ 'type' => 'structure', 'members' => [ 'Summaries' => [ 'shape' => 'StackInstanceSummaries', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListStackResourcesInput' => [ 'type' => 'structure', 'required' => [ 'StackName', ], 'members' => [ 'StackName' => [ 'shape' => 'StackName', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListStackResourcesOutput' => [ 'type' => 'structure', 'members' => [ 'StackResourceSummaries' => [ 'shape' => 'StackResourceSummaries', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListStackSetOperationResultsInput' => [ 'type' => 'structure', 'required' => [ 'StackSetName', 'OperationId', ], 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetName', ], 'OperationId' => [ 'shape' => 'ClientRequestToken', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'CallAs' => [ 'shape' => 'CallAs', ], 'Filters' => [ 'shape' => 'OperationResultFilters', ], ], ], 'ListStackSetOperationResultsOutput' => [ 'type' => 'structure', 'members' => [ 'Summaries' => [ 'shape' => 'StackSetOperationResultSummaries', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListStackSetOperationsInput' => [ 'type' => 'structure', 'required' => [ 'StackSetName', ], 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetName', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'CallAs' => [ 'shape' => 'CallAs', ], ], ], 'ListStackSetOperationsOutput' => [ 'type' => 'structure', 'members' => [ 'Summaries' => [ 'shape' => 'StackSetOperationSummaries', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListStackSetsInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'Status' => [ 'shape' => 'StackSetStatus', ], 'CallAs' => [ 'shape' => 'CallAs', ], ], ], 'ListStackSetsOutput' => [ 'type' => 'structure', 'members' => [ 'Summaries' => [ 'shape' => 'StackSetSummaries', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListStacksInput' => [ 'type' => 'structure', 'members' => [ 'NextToken' => [ 'shape' => 'NextToken', ], 'StackStatusFilter' => [ 'shape' => 'StackStatusFilter', ], ], ], 'ListStacksOutput' => [ 'type' => 'structure', 'members' => [ 'StackSummaries' => [ 'shape' => 'StackSummaries', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTypeRegistrationsInput' => [ 'type' => 'structure', 'members' => [ 'Type' => [ 'shape' => 'RegistryType', ], 'TypeName' => [ 'shape' => 'TypeName', ], 'TypeArn' => [ 'shape' => 'TypeArn', ], 'RegistrationStatusFilter' => [ 'shape' => 'RegistrationStatus', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTypeRegistrationsOutput' => [ 'type' => 'structure', 'members' => [ 'RegistrationTokenList' => [ 'shape' => 'RegistrationTokenList', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTypeVersionsInput' => [ 'type' => 'structure', 'members' => [ 'Type' => [ 'shape' => 'RegistryType', ], 'TypeName' => [ 'shape' => 'TypeName', ], 'Arn' => [ 'shape' => 'TypeArn', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], 'DeprecatedStatus' => [ 'shape' => 'DeprecatedStatus', ], 'PublisherId' => [ 'shape' => 'PublisherId', ], ], ], 'ListTypeVersionsOutput' => [ 'type' => 'structure', 'members' => [ 'TypeVersionSummaries' => [ 'shape' => 'TypeVersionSummaries', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTypesInput' => [ 'type' => 'structure', 'members' => [ 'Visibility' => [ 'shape' => 'Visibility', ], 'ProvisioningType' => [ 'shape' => 'ProvisioningType', ], 'DeprecatedStatus' => [ 'shape' => 'DeprecatedStatus', ], 'Type' => [ 'shape' => 'RegistryType', ], 'Filters' => [ 'shape' => 'TypeFilters', ], 'MaxResults' => [ 'shape' => 'MaxResults', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTypesOutput' => [ 'type' => 'structure', 'members' => [ 'TypeSummaries' => [ 'shape' => 'TypeSummaries', ], 'NextToken' => [ 'shape' => 'NextToken', ], ], ], 'LogGroupName' => [ 'type' => 'string', 'max' => 512, 'min' => 1, 'pattern' => '[\\\\.\\\\-_/#A-Za-z0-9]+', ], 'LoggingConfig' => [ 'type' => 'structure', 'required' => [ 'LogRoleArn', 'LogGroupName', ], 'members' => [ 'LogRoleArn' => [ 'shape' => 'RoleArn', ], 'LogGroupName' => [ 'shape' => 'LogGroupName', ], ], ], 'LogicalIdHierarchy' => [ 'type' => 'string', ], 'LogicalResourceId' => [ 'type' => 'string', ], 'LogicalResourceIds' => [ 'type' => 'list', 'member' => [ 'shape' => 'LogicalResourceId', ], 'max' => 200, 'min' => 1, ], 'MajorVersion' => [ 'type' => 'long', 'max' => 100000, 'min' => 1, ], 'ManagedExecution' => [ 'type' => 'structure', 'members' => [ 'Active' => [ 'shape' => 'ManagedExecutionNullable', ], ], ], 'ManagedExecutionNullable' => [ 'type' => 'boolean', ], 'MaxConcurrentCount' => [ 'type' => 'integer', 'min' => 1, ], 'MaxConcurrentPercentage' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'MaxResults' => [ 'type' => 'integer', 'max' => 100, 'min' => 1, ], 'Metadata' => [ 'type' => 'string', ], 'ModuleInfo' => [ 'type' => 'structure', 'members' => [ 'TypeHierarchy' => [ 'shape' => 'TypeHierarchy', ], 'LogicalIdHierarchy' => [ 'shape' => 'LogicalIdHierarchy', ], ], ], 'MonitoringTimeInMinutes' => [ 'type' => 'integer', 'max' => 180, 'min' => 0, ], 'NameAlreadyExistsException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'NameAlreadyExistsException', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'NextToken' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, ], 'NoEcho' => [ 'type' => 'boolean', ], 'NotificationARN' => [ 'type' => 'string', ], 'NotificationARNs' => [ 'type' => 'list', 'member' => [ 'shape' => 'NotificationARN', ], 'max' => 5, ], 'OnFailure' => [ 'type' => 'string', 'enum' => [ 'DO_NOTHING', 'ROLLBACK', 'DELETE', ], ], 'OnStackFailure' => [ 'type' => 'string', 'enum' => [ 'DO_NOTHING', 'ROLLBACK', 'DELETE', ], ], 'OperationIdAlreadyExistsException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'OperationIdAlreadyExistsException', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'OperationInProgressException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'OperationInProgressException', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'OperationNotFoundException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'OperationNotFoundException', 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'OperationResultFilter' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'OperationResultFilterName', ], 'Values' => [ 'shape' => 'OperationResultFilterValues', ], ], ], 'OperationResultFilterName' => [ 'type' => 'string', 'enum' => [ 'OPERATION_RESULT_STATUS', ], ], 'OperationResultFilterValues' => [ 'type' => 'string', 'max' => 9, 'min' => 6, 'pattern' => '^\\\\S{6,9}$', ], 'OperationResultFilters' => [ 'type' => 'list', 'member' => [ 'shape' => 'OperationResultFilter', ], 'max' => 1, ], 'OperationStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING', 'IN_PROGRESS', 'SUCCESS', 'FAILED', ], ], 'OperationStatusCheckFailedException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'ConditionalCheckFailed', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'OptionalSecureUrl' => [ 'type' => 'string', 'max' => 4096, ], 'OrganizationStatus' => [ 'type' => 'string', 'enum' => [ 'ENABLED', 'DISABLED', 'DISABLED_PERMANENTLY', ], ], 'OrganizationalUnitId' => [ 'type' => 'string', 'pattern' => '^(ou-[a-z0-9]{4,32}-[a-z0-9]{8,32}|r-[a-z0-9]{4,32})$', ], 'OrganizationalUnitIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'OrganizationalUnitId', ], ], 'Output' => [ 'type' => 'structure', 'members' => [ 'OutputKey' => [ 'shape' => 'OutputKey', ], 'OutputValue' => [ 'shape' => 'OutputValue', ], 'Description' => [ 'shape' => 'Description', ], 'ExportName' => [ 'shape' => 'ExportName', ], ], ], 'OutputKey' => [ 'type' => 'string', ], 'OutputValue' => [ 'type' => 'string', ], 'Outputs' => [ 'type' => 'list', 'member' => [ 'shape' => 'Output', ], ], 'Parameter' => [ 'type' => 'structure', 'members' => [ 'ParameterKey' => [ 'shape' => 'ParameterKey', ], 'ParameterValue' => [ 'shape' => 'ParameterValue', ], 'UsePreviousValue' => [ 'shape' => 'UsePreviousValue', ], 'ResolvedValue' => [ 'shape' => 'ParameterValue', ], ], ], 'ParameterConstraints' => [ 'type' => 'structure', 'members' => [ 'AllowedValues' => [ 'shape' => 'AllowedValues', ], ], ], 'ParameterDeclaration' => [ 'type' => 'structure', 'members' => [ 'ParameterKey' => [ 'shape' => 'ParameterKey', ], 'DefaultValue' => [ 'shape' => 'ParameterValue', ], 'ParameterType' => [ 'shape' => 'ParameterType', ], 'NoEcho' => [ 'shape' => 'NoEcho', ], 'Description' => [ 'shape' => 'Description', ], 'ParameterConstraints' => [ 'shape' => 'ParameterConstraints', ], ], ], 'ParameterDeclarations' => [ 'type' => 'list', 'member' => [ 'shape' => 'ParameterDeclaration', ], ], 'ParameterKey' => [ 'type' => 'string', ], 'ParameterType' => [ 'type' => 'string', ], 'ParameterValue' => [ 'type' => 'string', ], 'Parameters' => [ 'type' => 'list', 'member' => [ 'shape' => 'Parameter', ], ], 'PermissionModels' => [ 'type' => 'string', 'enum' => [ 'SERVICE_MANAGED', 'SELF_MANAGED', ], ], 'PhysicalResourceId' => [ 'type' => 'string', ], 'PhysicalResourceIdContext' => [ 'type' => 'list', 'member' => [ 'shape' => 'PhysicalResourceIdContextKeyValuePair', ], 'max' => 5, ], 'PhysicalResourceIdContextKeyValuePair' => [ 'type' => 'structure', 'required' => [ 'Key', 'Value', ], 'members' => [ 'Key' => [ 'shape' => 'Key', ], 'Value' => [ 'shape' => 'Value', ], ], ], 'PrivateTypeArn' => [ 'type' => 'string', 'max' => 1024, 'pattern' => 'arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:[0-9]{12}:type/.+', ], 'Properties' => [ 'type' => 'string', ], 'PropertyDifference' => [ 'type' => 'structure', 'required' => [ 'PropertyPath', 'ExpectedValue', 'ActualValue', 'DifferenceType', ], 'members' => [ 'PropertyPath' => [ 'shape' => 'PropertyPath', ], 'ExpectedValue' => [ 'shape' => 'PropertyValue', ], 'ActualValue' => [ 'shape' => 'PropertyValue', ], 'DifferenceType' => [ 'shape' => 'DifferenceType', ], ], ], 'PropertyDifferences' => [ 'type' => 'list', 'member' => [ 'shape' => 'PropertyDifference', ], ], 'PropertyName' => [ 'type' => 'string', ], 'PropertyPath' => [ 'type' => 'string', ], 'PropertyValue' => [ 'type' => 'string', ], 'ProvisioningType' => [ 'type' => 'string', 'enum' => [ 'NON_PROVISIONABLE', 'IMMUTABLE', 'FULLY_MUTABLE', ], ], 'PublicVersionNumber' => [ 'type' => 'string', 'min' => 5, 'pattern' => '^(0|[1-9]\\\\d*)\\\\.(0|[1-9]\\\\d*)\\\\.(.*)$', ], 'PublishTypeInput' => [ 'type' => 'structure', 'members' => [ 'Type' => [ 'shape' => 'ThirdPartyType', ], 'Arn' => [ 'shape' => 'PrivateTypeArn', ], 'TypeName' => [ 'shape' => 'TypeName', ], 'PublicVersionNumber' => [ 'shape' => 'PublicVersionNumber', ], ], ], 'PublishTypeOutput' => [ 'type' => 'structure', 'members' => [ 'PublicTypeArn' => [ 'shape' => 'TypeArn', ], ], ], 'PublisherId' => [ 'type' => 'string', 'max' => 40, 'min' => 1, 'pattern' => '[0-9a-zA-Z]{12,40}', ], 'PublisherName' => [ 'type' => 'string', 'max' => 100, 'min' => 1, 'pattern' => '[\\\\s\\\\S]+', ], 'PublisherProfile' => [ 'type' => 'string', 'max' => 1024, 'pattern' => '(http:|https:)+[^\\\\s]+[\\\\w]', ], 'PublisherStatus' => [ 'type' => 'string', 'enum' => [ 'VERIFIED', 'UNVERIFIED', ], ], 'Reason' => [ 'type' => 'string', ], 'RecordHandlerProgressInput' => [ 'type' => 'structure', 'required' => [ 'BearerToken', 'OperationStatus', ], 'members' => [ 'BearerToken' => [ 'shape' => 'ClientToken', ], 'OperationStatus' => [ 'shape' => 'OperationStatus', ], 'CurrentOperationStatus' => [ 'shape' => 'OperationStatus', ], 'StatusMessage' => [ 'shape' => 'StatusMessage', ], 'ErrorCode' => [ 'shape' => 'HandlerErrorCode', ], 'ResourceModel' => [ 'shape' => 'ResourceModel', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', ], ], ], 'RecordHandlerProgressOutput' => [ 'type' => 'structure', 'members' => [], ], 'Region' => [ 'type' => 'string', 'pattern' => '^[a-zA-Z0-9-]{1,128}$', ], 'RegionConcurrencyType' => [ 'type' => 'string', 'enum' => [ 'SEQUENTIAL', 'PARALLEL', ], ], 'RegionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Region', ], ], 'RegisterPublisherInput' => [ 'type' => 'structure', 'members' => [ 'AcceptTermsAndConditions' => [ 'shape' => 'AcceptTermsAndConditions', ], 'ConnectionArn' => [ 'shape' => 'ConnectionArn', ], ], ], 'RegisterPublisherOutput' => [ 'type' => 'structure', 'members' => [ 'PublisherId' => [ 'shape' => 'PublisherId', ], ], ], 'RegisterTypeInput' => [ 'type' => 'structure', 'required' => [ 'TypeName', 'SchemaHandlerPackage', ], 'members' => [ 'Type' => [ 'shape' => 'RegistryType', ], 'TypeName' => [ 'shape' => 'TypeName', ], 'SchemaHandlerPackage' => [ 'shape' => 'S3Url', ], 'LoggingConfig' => [ 'shape' => 'LoggingConfig', ], 'ExecutionRoleArn' => [ 'shape' => 'RoleArn', ], 'ClientRequestToken' => [ 'shape' => 'RequestToken', ], ], ], 'RegisterTypeOutput' => [ 'type' => 'structure', 'members' => [ 'RegistrationToken' => [ 'shape' => 'RegistrationToken', ], ], ], 'RegistrationStatus' => [ 'type' => 'string', 'enum' => [ 'COMPLETE', 'IN_PROGRESS', 'FAILED', ], ], 'RegistrationToken' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[a-zA-Z0-9][-a-zA-Z0-9]*', ], 'RegistrationTokenList' => [ 'type' => 'list', 'member' => [ 'shape' => 'RegistrationToken', ], ], 'RegistryType' => [ 'type' => 'string', 'enum' => [ 'RESOURCE', 'MODULE', 'HOOK', ], ], 'Replacement' => [ 'type' => 'string', 'enum' => [ 'True', 'False', 'Conditional', ], ], 'RequestToken' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[a-zA-Z0-9][-a-zA-Z0-9]*', ], 'RequiredActivatedType' => [ 'type' => 'structure', 'members' => [ 'TypeNameAlias' => [ 'shape' => 'TypeName', ], 'OriginalTypeName' => [ 'shape' => 'TypeName', ], 'PublisherId' => [ 'shape' => 'PublisherId', ], 'SupportedMajorVersions' => [ 'shape' => 'SupportedMajorVersions', ], ], ], 'RequiredActivatedTypes' => [ 'type' => 'list', 'member' => [ 'shape' => 'RequiredActivatedType', ], ], 'RequiresRecreation' => [ 'type' => 'string', 'enum' => [ 'Never', 'Conditionally', 'Always', ], ], 'ResourceAttribute' => [ 'type' => 'string', 'enum' => [ 'Properties', 'Metadata', 'CreationPolicy', 'UpdatePolicy', 'DeletionPolicy', 'Tags', ], ], 'ResourceChange' => [ 'type' => 'structure', 'members' => [ 'Action' => [ 'shape' => 'ChangeAction', ], 'LogicalResourceId' => [ 'shape' => 'LogicalResourceId', ], 'PhysicalResourceId' => [ 'shape' => 'PhysicalResourceId', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'Replacement' => [ 'shape' => 'Replacement', ], 'Scope' => [ 'shape' => 'Scope', ], 'Details' => [ 'shape' => 'ResourceChangeDetails', ], 'ChangeSetId' => [ 'shape' => 'ChangeSetId', ], 'ModuleInfo' => [ 'shape' => 'ModuleInfo', ], ], ], 'ResourceChangeDetail' => [ 'type' => 'structure', 'members' => [ 'Target' => [ 'shape' => 'ResourceTargetDefinition', ], 'Evaluation' => [ 'shape' => 'EvaluationType', ], 'ChangeSource' => [ 'shape' => 'ChangeSource', ], 'CausingEntity' => [ 'shape' => 'CausingEntity', ], ], ], 'ResourceChangeDetails' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResourceChangeDetail', ], ], 'ResourceIdentifierProperties' => [ 'type' => 'map', 'key' => [ 'shape' => 'ResourceIdentifierPropertyKey', ], 'value' => [ 'shape' => 'ResourceIdentifierPropertyValue', ], 'max' => 256, 'min' => 1, ], 'ResourceIdentifierPropertyKey' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, ], 'ResourceIdentifierPropertyValue' => [ 'type' => 'string', 'max' => 2048, 'min' => 1, ], 'ResourceIdentifierSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResourceIdentifierSummary', ], ], 'ResourceIdentifierSummary' => [ 'type' => 'structure', 'members' => [ 'ResourceType' => [ 'shape' => 'ResourceType', ], 'LogicalResourceIds' => [ 'shape' => 'LogicalResourceIds', ], 'ResourceIdentifiers' => [ 'shape' => 'ResourceIdentifiers', ], ], ], 'ResourceIdentifiers' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResourceIdentifierPropertyKey', ], ], 'ResourceModel' => [ 'type' => 'string', 'max' => 16384, 'min' => 1, ], 'ResourceProperties' => [ 'type' => 'string', ], 'ResourceSignalStatus' => [ 'type' => 'string', 'enum' => [ 'SUCCESS', 'FAILURE', ], ], 'ResourceSignalUniqueId' => [ 'type' => 'string', 'max' => 64, 'min' => 1, ], 'ResourceStatus' => [ 'type' => 'string', 'enum' => [ 'CREATE_IN_PROGRESS', 'CREATE_FAILED', 'CREATE_COMPLETE', 'DELETE_IN_PROGRESS', 'DELETE_FAILED', 'DELETE_COMPLETE', 'DELETE_SKIPPED', 'UPDATE_IN_PROGRESS', 'UPDATE_FAILED', 'UPDATE_COMPLETE', 'IMPORT_FAILED', 'IMPORT_COMPLETE', 'IMPORT_IN_PROGRESS', 'IMPORT_ROLLBACK_IN_PROGRESS', 'IMPORT_ROLLBACK_FAILED', 'IMPORT_ROLLBACK_COMPLETE', 'UPDATE_ROLLBACK_IN_PROGRESS', 'UPDATE_ROLLBACK_COMPLETE', 'UPDATE_ROLLBACK_FAILED', 'ROLLBACK_IN_PROGRESS', 'ROLLBACK_COMPLETE', 'ROLLBACK_FAILED', ], ], 'ResourceStatusReason' => [ 'type' => 'string', ], 'ResourceTargetDefinition' => [ 'type' => 'structure', 'members' => [ 'Attribute' => [ 'shape' => 'ResourceAttribute', ], 'Name' => [ 'shape' => 'PropertyName', ], 'RequiresRecreation' => [ 'shape' => 'RequiresRecreation', ], ], ], 'ResourceToImport' => [ 'type' => 'structure', 'required' => [ 'ResourceType', 'LogicalResourceId', 'ResourceIdentifier', ], 'members' => [ 'ResourceType' => [ 'shape' => 'ResourceType', ], 'LogicalResourceId' => [ 'shape' => 'LogicalResourceId', ], 'ResourceIdentifier' => [ 'shape' => 'ResourceIdentifierProperties', ], ], ], 'ResourceToSkip' => [ 'type' => 'string', 'pattern' => '[a-zA-Z0-9]+|[a-zA-Z][-a-zA-Z0-9]*\\\\.[a-zA-Z0-9]+', ], 'ResourceType' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'ResourceTypes' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResourceType', ], ], 'ResourcesToImport' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResourceToImport', ], 'max' => 200, ], 'ResourcesToSkip' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResourceToSkip', ], ], 'RetainResources' => [ 'type' => 'list', 'member' => [ 'shape' => 'LogicalResourceId', ], ], 'RetainStacks' => [ 'type' => 'boolean', ], 'RetainStacksNullable' => [ 'type' => 'boolean', ], 'RetainStacksOnAccountRemovalNullable' => [ 'type' => 'boolean', ], 'RoleARN' => [ 'type' => 'string', 'max' => 2048, 'min' => 20, ], 'RoleArn' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => 'arn:.+:iam::[0-9]{12}:role/.+', ], 'RollbackConfiguration' => [ 'type' => 'structure', 'members' => [ 'RollbackTriggers' => [ 'shape' => 'RollbackTriggers', ], 'MonitoringTimeInMinutes' => [ 'shape' => 'MonitoringTimeInMinutes', ], ], ], 'RollbackStackInput' => [ 'type' => 'structure', 'required' => [ 'StackName', ], 'members' => [ 'StackName' => [ 'shape' => 'StackNameOrId', ], 'RoleARN' => [ 'shape' => 'RoleARN', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', ], ], ], 'RollbackStackOutput' => [ 'type' => 'structure', 'members' => [ 'StackId' => [ 'shape' => 'StackId', ], ], ], 'RollbackTrigger' => [ 'type' => 'structure', 'required' => [ 'Arn', 'Type', ], 'members' => [ 'Arn' => [ 'shape' => 'Arn', ], 'Type' => [ 'shape' => 'Type', ], ], ], 'RollbackTriggers' => [ 'type' => 'list', 'member' => [ 'shape' => 'RollbackTrigger', ], 'max' => 5, ], 'S3Bucket' => [ 'type' => 'string', 'max' => 63, 'min' => 3, 'pattern' => '[\\\\s\\\\S]+', ], 'S3Url' => [ 'type' => 'string', 'max' => 4096, 'min' => 1, ], 'Scope' => [ 'type' => 'list', 'member' => [ 'shape' => 'ResourceAttribute', ], ], 'SetStackPolicyInput' => [ 'type' => 'structure', 'required' => [ 'StackName', ], 'members' => [ 'StackName' => [ 'shape' => 'StackName', ], 'StackPolicyBody' => [ 'shape' => 'StackPolicyBody', ], 'StackPolicyURL' => [ 'shape' => 'StackPolicyURL', ], ], ], 'SetTypeConfigurationInput' => [ 'type' => 'structure', 'required' => [ 'Configuration', ], 'members' => [ 'TypeArn' => [ 'shape' => 'TypeArn', ], 'Configuration' => [ 'shape' => 'TypeConfiguration', ], 'ConfigurationAlias' => [ 'shape' => 'TypeConfigurationAlias', ], 'TypeName' => [ 'shape' => 'TypeName', ], 'Type' => [ 'shape' => 'ThirdPartyType', ], ], ], 'SetTypeConfigurationOutput' => [ 'type' => 'structure', 'members' => [ 'ConfigurationArn' => [ 'shape' => 'TypeConfigurationArn', ], ], ], 'SetTypeDefaultVersionInput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'PrivateTypeArn', ], 'Type' => [ 'shape' => 'RegistryType', ], 'TypeName' => [ 'shape' => 'TypeName', ], 'VersionId' => [ 'shape' => 'TypeVersionId', ], ], ], 'SetTypeDefaultVersionOutput' => [ 'type' => 'structure', 'members' => [], ], 'SignalResourceInput' => [ 'type' => 'structure', 'required' => [ 'StackName', 'LogicalResourceId', 'UniqueId', 'Status', ], 'members' => [ 'StackName' => [ 'shape' => 'StackNameOrId', ], 'LogicalResourceId' => [ 'shape' => 'LogicalResourceId', ], 'UniqueId' => [ 'shape' => 'ResourceSignalUniqueId', ], 'Status' => [ 'shape' => 'ResourceSignalStatus', ], ], ], 'Stack' => [ 'type' => 'structure', 'required' => [ 'StackName', 'CreationTime', 'StackStatus', ], 'members' => [ 'StackId' => [ 'shape' => 'StackId', ], 'StackName' => [ 'shape' => 'StackName', ], 'ChangeSetId' => [ 'shape' => 'ChangeSetId', ], 'Description' => [ 'shape' => 'Description', ], 'Parameters' => [ 'shape' => 'Parameters', ], 'CreationTime' => [ 'shape' => 'CreationTime', ], 'DeletionTime' => [ 'shape' => 'DeletionTime', ], 'LastUpdatedTime' => [ 'shape' => 'LastUpdatedTime', ], 'RollbackConfiguration' => [ 'shape' => 'RollbackConfiguration', ], 'StackStatus' => [ 'shape' => 'StackStatus', ], 'StackStatusReason' => [ 'shape' => 'StackStatusReason', ], 'DisableRollback' => [ 'shape' => 'DisableRollback', ], 'NotificationARNs' => [ 'shape' => 'NotificationARNs', ], 'TimeoutInMinutes' => [ 'shape' => 'TimeoutMinutes', ], 'Capabilities' => [ 'shape' => 'Capabilities', ], 'Outputs' => [ 'shape' => 'Outputs', ], 'RoleARN' => [ 'shape' => 'RoleARN', ], 'Tags' => [ 'shape' => 'Tags', ], 'EnableTerminationProtection' => [ 'shape' => 'EnableTerminationProtection', ], 'ParentId' => [ 'shape' => 'StackId', ], 'RootId' => [ 'shape' => 'StackId', ], 'DriftInformation' => [ 'shape' => 'StackDriftInformation', ], ], ], 'StackDriftDetectionId' => [ 'type' => 'string', 'max' => 36, 'min' => 1, ], 'StackDriftDetectionStatus' => [ 'type' => 'string', 'enum' => [ 'DETECTION_IN_PROGRESS', 'DETECTION_FAILED', 'DETECTION_COMPLETE', ], ], 'StackDriftDetectionStatusReason' => [ 'type' => 'string', ], 'StackDriftInformation' => [ 'type' => 'structure', 'required' => [ 'StackDriftStatus', ], 'members' => [ 'StackDriftStatus' => [ 'shape' => 'StackDriftStatus', ], 'LastCheckTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'StackDriftInformationSummary' => [ 'type' => 'structure', 'required' => [ 'StackDriftStatus', ], 'members' => [ 'StackDriftStatus' => [ 'shape' => 'StackDriftStatus', ], 'LastCheckTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'StackDriftStatus' => [ 'type' => 'string', 'enum' => [ 'DRIFTED', 'IN_SYNC', 'UNKNOWN', 'NOT_CHECKED', ], ], 'StackEvent' => [ 'type' => 'structure', 'required' => [ 'StackId', 'EventId', 'StackName', 'Timestamp', ], 'members' => [ 'StackId' => [ 'shape' => 'StackId', ], 'EventId' => [ 'shape' => 'EventId', ], 'StackName' => [ 'shape' => 'StackName', ], 'LogicalResourceId' => [ 'shape' => 'LogicalResourceId', ], 'PhysicalResourceId' => [ 'shape' => 'PhysicalResourceId', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'Timestamp' => [ 'shape' => 'Timestamp', ], 'ResourceStatus' => [ 'shape' => 'ResourceStatus', ], 'ResourceStatusReason' => [ 'shape' => 'ResourceStatusReason', ], 'ResourceProperties' => [ 'shape' => 'ResourceProperties', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', ], 'HookType' => [ 'shape' => 'HookType', ], 'HookStatus' => [ 'shape' => 'HookStatus', ], 'HookStatusReason' => [ 'shape' => 'HookStatusReason', ], 'HookInvocationPoint' => [ 'shape' => 'HookInvocationPoint', ], 'HookFailureMode' => [ 'shape' => 'HookFailureMode', ], ], ], 'StackEvents' => [ 'type' => 'list', 'member' => [ 'shape' => 'StackEvent', ], ], 'StackId' => [ 'type' => 'string', ], 'StackIdList' => [ 'type' => 'list', 'member' => [ 'shape' => 'StackId', ], ], 'StackIdsUrl' => [ 'type' => 'string', 'max' => 5120, 'min' => 1, 'pattern' => '(s3://|http(s?)://).+', ], 'StackInstance' => [ 'type' => 'structure', 'members' => [ 'StackSetId' => [ 'shape' => 'StackSetId', ], 'Region' => [ 'shape' => 'Region', ], 'Account' => [ 'shape' => 'Account', ], 'StackId' => [ 'shape' => 'StackId', ], 'ParameterOverrides' => [ 'shape' => 'Parameters', ], 'Status' => [ 'shape' => 'StackInstanceStatus', ], 'StackInstanceStatus' => [ 'shape' => 'StackInstanceComprehensiveStatus', ], 'StatusReason' => [ 'shape' => 'Reason', ], 'OrganizationalUnitId' => [ 'shape' => 'OrganizationalUnitId', ], 'DriftStatus' => [ 'shape' => 'StackDriftStatus', ], 'LastDriftCheckTimestamp' => [ 'shape' => 'Timestamp', ], 'LastOperationId' => [ 'shape' => 'ClientRequestToken', ], ], ], 'StackInstanceComprehensiveStatus' => [ 'type' => 'structure', 'members' => [ 'DetailedStatus' => [ 'shape' => 'StackInstanceDetailedStatus', ], ], ], 'StackInstanceDetailedStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING', 'RUNNING', 'SUCCEEDED', 'FAILED', 'CANCELLED', 'INOPERABLE', 'SKIPPED_SUSPENDED_ACCOUNT', ], ], 'StackInstanceFilter' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'StackInstanceFilterName', ], 'Values' => [ 'shape' => 'StackInstanceFilterValues', ], ], ], 'StackInstanceFilterName' => [ 'type' => 'string', 'enum' => [ 'DETAILED_STATUS', 'LAST_OPERATION_ID', ], ], 'StackInstanceFilterValues' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '^\\\\S{1,128}$', ], 'StackInstanceFilters' => [ 'type' => 'list', 'member' => [ 'shape' => 'StackInstanceFilter', ], 'max' => 2, ], 'StackInstanceNotFoundException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'StackInstanceNotFoundException', 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'StackInstanceStatus' => [ 'type' => 'string', 'enum' => [ 'CURRENT', 'OUTDATED', 'INOPERABLE', ], ], 'StackInstanceSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'StackInstanceSummary', ], ], 'StackInstanceSummary' => [ 'type' => 'structure', 'members' => [ 'StackSetId' => [ 'shape' => 'StackSetId', ], 'Region' => [ 'shape' => 'Region', ], 'Account' => [ 'shape' => 'Account', ], 'StackId' => [ 'shape' => 'StackId', ], 'Status' => [ 'shape' => 'StackInstanceStatus', ], 'StatusReason' => [ 'shape' => 'Reason', ], 'StackInstanceStatus' => [ 'shape' => 'StackInstanceComprehensiveStatus', ], 'OrganizationalUnitId' => [ 'shape' => 'OrganizationalUnitId', ], 'DriftStatus' => [ 'shape' => 'StackDriftStatus', ], 'LastDriftCheckTimestamp' => [ 'shape' => 'Timestamp', ], 'LastOperationId' => [ 'shape' => 'ClientRequestToken', ], ], ], 'StackName' => [ 'type' => 'string', ], 'StackNameOrId' => [ 'type' => 'string', 'min' => 1, 'pattern' => '([a-zA-Z][-a-zA-Z0-9]*)|(arn:\\\\b(aws|aws-us-gov|aws-cn)\\\\b:[-a-zA-Z0-9:/._+]*)', ], 'StackNotFoundException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'StackNotFoundException', 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'StackPolicyBody' => [ 'type' => 'string', 'max' => 16384, 'min' => 1, ], 'StackPolicyDuringUpdateBody' => [ 'type' => 'string', 'max' => 16384, 'min' => 1, ], 'StackPolicyDuringUpdateURL' => [ 'type' => 'string', 'max' => 1350, 'min' => 1, ], 'StackPolicyURL' => [ 'type' => 'string', 'max' => 1350, 'min' => 1, ], 'StackResource' => [ 'type' => 'structure', 'required' => [ 'LogicalResourceId', 'ResourceType', 'Timestamp', 'ResourceStatus', ], 'members' => [ 'StackName' => [ 'shape' => 'StackName', ], 'StackId' => [ 'shape' => 'StackId', ], 'LogicalResourceId' => [ 'shape' => 'LogicalResourceId', ], 'PhysicalResourceId' => [ 'shape' => 'PhysicalResourceId', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'Timestamp' => [ 'shape' => 'Timestamp', ], 'ResourceStatus' => [ 'shape' => 'ResourceStatus', ], 'ResourceStatusReason' => [ 'shape' => 'ResourceStatusReason', ], 'Description' => [ 'shape' => 'Description', ], 'DriftInformation' => [ 'shape' => 'StackResourceDriftInformation', ], 'ModuleInfo' => [ 'shape' => 'ModuleInfo', ], ], ], 'StackResourceDetail' => [ 'type' => 'structure', 'required' => [ 'LogicalResourceId', 'ResourceType', 'LastUpdatedTimestamp', 'ResourceStatus', ], 'members' => [ 'StackName' => [ 'shape' => 'StackName', ], 'StackId' => [ 'shape' => 'StackId', ], 'LogicalResourceId' => [ 'shape' => 'LogicalResourceId', ], 'PhysicalResourceId' => [ 'shape' => 'PhysicalResourceId', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], 'ResourceStatus' => [ 'shape' => 'ResourceStatus', ], 'ResourceStatusReason' => [ 'shape' => 'ResourceStatusReason', ], 'Description' => [ 'shape' => 'Description', ], 'Metadata' => [ 'shape' => 'Metadata', ], 'DriftInformation' => [ 'shape' => 'StackResourceDriftInformation', ], 'ModuleInfo' => [ 'shape' => 'ModuleInfo', ], ], ], 'StackResourceDrift' => [ 'type' => 'structure', 'required' => [ 'StackId', 'LogicalResourceId', 'ResourceType', 'StackResourceDriftStatus', 'Timestamp', ], 'members' => [ 'StackId' => [ 'shape' => 'StackId', ], 'LogicalResourceId' => [ 'shape' => 'LogicalResourceId', ], 'PhysicalResourceId' => [ 'shape' => 'PhysicalResourceId', ], 'PhysicalResourceIdContext' => [ 'shape' => 'PhysicalResourceIdContext', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'ExpectedProperties' => [ 'shape' => 'Properties', ], 'ActualProperties' => [ 'shape' => 'Properties', ], 'PropertyDifferences' => [ 'shape' => 'PropertyDifferences', ], 'StackResourceDriftStatus' => [ 'shape' => 'StackResourceDriftStatus', ], 'Timestamp' => [ 'shape' => 'Timestamp', ], 'ModuleInfo' => [ 'shape' => 'ModuleInfo', ], ], ], 'StackResourceDriftInformation' => [ 'type' => 'structure', 'required' => [ 'StackResourceDriftStatus', ], 'members' => [ 'StackResourceDriftStatus' => [ 'shape' => 'StackResourceDriftStatus', ], 'LastCheckTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'StackResourceDriftInformationSummary' => [ 'type' => 'structure', 'required' => [ 'StackResourceDriftStatus', ], 'members' => [ 'StackResourceDriftStatus' => [ 'shape' => 'StackResourceDriftStatus', ], 'LastCheckTimestamp' => [ 'shape' => 'Timestamp', ], ], ], 'StackResourceDriftStatus' => [ 'type' => 'string', 'enum' => [ 'IN_SYNC', 'MODIFIED', 'DELETED', 'NOT_CHECKED', ], ], 'StackResourceDriftStatusFilters' => [ 'type' => 'list', 'member' => [ 'shape' => 'StackResourceDriftStatus', ], 'max' => 4, 'min' => 1, ], 'StackResourceDrifts' => [ 'type' => 'list', 'member' => [ 'shape' => 'StackResourceDrift', ], ], 'StackResourceSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'StackResourceSummary', ], ], 'StackResourceSummary' => [ 'type' => 'structure', 'required' => [ 'LogicalResourceId', 'ResourceType', 'LastUpdatedTimestamp', 'ResourceStatus', ], 'members' => [ 'LogicalResourceId' => [ 'shape' => 'LogicalResourceId', ], 'PhysicalResourceId' => [ 'shape' => 'PhysicalResourceId', ], 'ResourceType' => [ 'shape' => 'ResourceType', ], 'LastUpdatedTimestamp' => [ 'shape' => 'Timestamp', ], 'ResourceStatus' => [ 'shape' => 'ResourceStatus', ], 'ResourceStatusReason' => [ 'shape' => 'ResourceStatusReason', ], 'DriftInformation' => [ 'shape' => 'StackResourceDriftInformationSummary', ], 'ModuleInfo' => [ 'shape' => 'ModuleInfo', ], ], ], 'StackResources' => [ 'type' => 'list', 'member' => [ 'shape' => 'StackResource', ], ], 'StackSet' => [ 'type' => 'structure', 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetName', ], 'StackSetId' => [ 'shape' => 'StackSetId', ], 'Description' => [ 'shape' => 'Description', ], 'Status' => [ 'shape' => 'StackSetStatus', ], 'TemplateBody' => [ 'shape' => 'TemplateBody', ], 'Parameters' => [ 'shape' => 'Parameters', ], 'Capabilities' => [ 'shape' => 'Capabilities', ], 'Tags' => [ 'shape' => 'Tags', ], 'StackSetARN' => [ 'shape' => 'StackSetARN', ], 'AdministrationRoleARN' => [ 'shape' => 'RoleARN', ], 'ExecutionRoleName' => [ 'shape' => 'ExecutionRoleName', ], 'StackSetDriftDetectionDetails' => [ 'shape' => 'StackSetDriftDetectionDetails', ], 'AutoDeployment' => [ 'shape' => 'AutoDeployment', ], 'PermissionModel' => [ 'shape' => 'PermissionModels', ], 'OrganizationalUnitIds' => [ 'shape' => 'OrganizationalUnitIdList', ], 'ManagedExecution' => [ 'shape' => 'ManagedExecution', ], 'Regions' => [ 'shape' => 'RegionList', ], ], ], 'StackSetARN' => [ 'type' => 'string', ], 'StackSetDriftDetectionDetails' => [ 'type' => 'structure', 'members' => [ 'DriftStatus' => [ 'shape' => 'StackSetDriftStatus', ], 'DriftDetectionStatus' => [ 'shape' => 'StackSetDriftDetectionStatus', ], 'LastDriftCheckTimestamp' => [ 'shape' => 'Timestamp', ], 'TotalStackInstancesCount' => [ 'shape' => 'TotalStackInstancesCount', ], 'DriftedStackInstancesCount' => [ 'shape' => 'DriftedStackInstancesCount', ], 'InSyncStackInstancesCount' => [ 'shape' => 'InSyncStackInstancesCount', ], 'InProgressStackInstancesCount' => [ 'shape' => 'InProgressStackInstancesCount', ], 'FailedStackInstancesCount' => [ 'shape' => 'FailedStackInstancesCount', ], ], ], 'StackSetDriftDetectionStatus' => [ 'type' => 'string', 'enum' => [ 'COMPLETED', 'FAILED', 'PARTIAL_SUCCESS', 'IN_PROGRESS', 'STOPPED', ], ], 'StackSetDriftStatus' => [ 'type' => 'string', 'enum' => [ 'DRIFTED', 'IN_SYNC', 'NOT_CHECKED', ], ], 'StackSetId' => [ 'type' => 'string', ], 'StackSetName' => [ 'type' => 'string', ], 'StackSetNameOrId' => [ 'type' => 'string', 'pattern' => '[a-zA-Z][-a-zA-Z0-9]*(?::[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12})?', ], 'StackSetNotEmptyException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'StackSetNotEmptyException', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'StackSetNotFoundException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'StackSetNotFoundException', 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'StackSetOperation' => [ 'type' => 'structure', 'members' => [ 'OperationId' => [ 'shape' => 'ClientRequestToken', ], 'StackSetId' => [ 'shape' => 'StackSetId', ], 'Action' => [ 'shape' => 'StackSetOperationAction', ], 'Status' => [ 'shape' => 'StackSetOperationStatus', ], 'OperationPreferences' => [ 'shape' => 'StackSetOperationPreferences', ], 'RetainStacks' => [ 'shape' => 'RetainStacksNullable', ], 'AdministrationRoleARN' => [ 'shape' => 'RoleARN', ], 'ExecutionRoleName' => [ 'shape' => 'ExecutionRoleName', ], 'CreationTimestamp' => [ 'shape' => 'Timestamp', ], 'EndTimestamp' => [ 'shape' => 'Timestamp', ], 'DeploymentTargets' => [ 'shape' => 'DeploymentTargets', ], 'StackSetDriftDetectionDetails' => [ 'shape' => 'StackSetDriftDetectionDetails', ], 'StatusReason' => [ 'shape' => 'StackSetOperationStatusReason', ], 'StatusDetails' => [ 'shape' => 'StackSetOperationStatusDetails', ], ], ], 'StackSetOperationAction' => [ 'type' => 'string', 'enum' => [ 'CREATE', 'UPDATE', 'DELETE', 'DETECT_DRIFT', ], ], 'StackSetOperationPreferences' => [ 'type' => 'structure', 'members' => [ 'RegionConcurrencyType' => [ 'shape' => 'RegionConcurrencyType', ], 'RegionOrder' => [ 'shape' => 'RegionList', ], 'FailureToleranceCount' => [ 'shape' => 'FailureToleranceCount', ], 'FailureTolerancePercentage' => [ 'shape' => 'FailureTolerancePercentage', ], 'MaxConcurrentCount' => [ 'shape' => 'MaxConcurrentCount', ], 'MaxConcurrentPercentage' => [ 'shape' => 'MaxConcurrentPercentage', ], ], ], 'StackSetOperationResultStatus' => [ 'type' => 'string', 'enum' => [ 'PENDING', 'RUNNING', 'SUCCEEDED', 'FAILED', 'CANCELLED', ], ], 'StackSetOperationResultSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'StackSetOperationResultSummary', ], ], 'StackSetOperationResultSummary' => [ 'type' => 'structure', 'members' => [ 'Account' => [ 'shape' => 'Account', ], 'Region' => [ 'shape' => 'Region', ], 'Status' => [ 'shape' => 'StackSetOperationResultStatus', ], 'StatusReason' => [ 'shape' => 'Reason', ], 'AccountGateResult' => [ 'shape' => 'AccountGateResult', ], 'OrganizationalUnitId' => [ 'shape' => 'OrganizationalUnitId', ], ], ], 'StackSetOperationStatus' => [ 'type' => 'string', 'enum' => [ 'RUNNING', 'SUCCEEDED', 'FAILED', 'STOPPING', 'STOPPED', 'QUEUED', ], ], 'StackSetOperationStatusDetails' => [ 'type' => 'structure', 'members' => [ 'FailedStackInstancesCount' => [ 'shape' => 'FailedStackInstancesCount', ], ], ], 'StackSetOperationStatusReason' => [ 'type' => 'string', ], 'StackSetOperationSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'StackSetOperationSummary', ], ], 'StackSetOperationSummary' => [ 'type' => 'structure', 'members' => [ 'OperationId' => [ 'shape' => 'ClientRequestToken', ], 'Action' => [ 'shape' => 'StackSetOperationAction', ], 'Status' => [ 'shape' => 'StackSetOperationStatus', ], 'CreationTimestamp' => [ 'shape' => 'Timestamp', ], 'EndTimestamp' => [ 'shape' => 'Timestamp', ], 'StatusReason' => [ 'shape' => 'StackSetOperationStatusReason', ], 'StatusDetails' => [ 'shape' => 'StackSetOperationStatusDetails', ], 'OperationPreferences' => [ 'shape' => 'StackSetOperationPreferences', ], ], ], 'StackSetStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'DELETED', ], ], 'StackSetSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'StackSetSummary', ], ], 'StackSetSummary' => [ 'type' => 'structure', 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetName', ], 'StackSetId' => [ 'shape' => 'StackSetId', ], 'Description' => [ 'shape' => 'Description', ], 'Status' => [ 'shape' => 'StackSetStatus', ], 'AutoDeployment' => [ 'shape' => 'AutoDeployment', ], 'PermissionModel' => [ 'shape' => 'PermissionModels', ], 'DriftStatus' => [ 'shape' => 'StackDriftStatus', ], 'LastDriftCheckTimestamp' => [ 'shape' => 'Timestamp', ], 'ManagedExecution' => [ 'shape' => 'ManagedExecution', ], ], ], 'StackStatus' => [ 'type' => 'string', 'enum' => [ 'CREATE_IN_PROGRESS', 'CREATE_FAILED', 'CREATE_COMPLETE', 'ROLLBACK_IN_PROGRESS', 'ROLLBACK_FAILED', 'ROLLBACK_COMPLETE', 'DELETE_IN_PROGRESS', 'DELETE_FAILED', 'DELETE_COMPLETE', 'UPDATE_IN_PROGRESS', 'UPDATE_COMPLETE_CLEANUP_IN_PROGRESS', 'UPDATE_COMPLETE', 'UPDATE_FAILED', 'UPDATE_ROLLBACK_IN_PROGRESS', 'UPDATE_ROLLBACK_FAILED', 'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS', 'UPDATE_ROLLBACK_COMPLETE', 'REVIEW_IN_PROGRESS', 'IMPORT_IN_PROGRESS', 'IMPORT_COMPLETE', 'IMPORT_ROLLBACK_IN_PROGRESS', 'IMPORT_ROLLBACK_FAILED', 'IMPORT_ROLLBACK_COMPLETE', ], ], 'StackStatusFilter' => [ 'type' => 'list', 'member' => [ 'shape' => 'StackStatus', ], ], 'StackStatusReason' => [ 'type' => 'string', ], 'StackSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'StackSummary', ], ], 'StackSummary' => [ 'type' => 'structure', 'required' => [ 'StackName', 'CreationTime', 'StackStatus', ], 'members' => [ 'StackId' => [ 'shape' => 'StackId', ], 'StackName' => [ 'shape' => 'StackName', ], 'TemplateDescription' => [ 'shape' => 'TemplateDescription', ], 'CreationTime' => [ 'shape' => 'CreationTime', ], 'LastUpdatedTime' => [ 'shape' => 'LastUpdatedTime', ], 'DeletionTime' => [ 'shape' => 'DeletionTime', ], 'StackStatus' => [ 'shape' => 'StackStatus', ], 'StackStatusReason' => [ 'shape' => 'StackStatusReason', ], 'ParentId' => [ 'shape' => 'StackId', ], 'RootId' => [ 'shape' => 'StackId', ], 'DriftInformation' => [ 'shape' => 'StackDriftInformationSummary', ], ], ], 'Stacks' => [ 'type' => 'list', 'member' => [ 'shape' => 'Stack', ], ], 'StageList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TemplateStage', ], ], 'StaleRequestException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'StaleRequestException', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'StatusMessage' => [ 'type' => 'string', 'max' => 1024, ], 'StopStackSetOperationInput' => [ 'type' => 'structure', 'required' => [ 'StackSetName', 'OperationId', ], 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetName', ], 'OperationId' => [ 'shape' => 'ClientRequestToken', ], 'CallAs' => [ 'shape' => 'CallAs', ], ], ], 'StopStackSetOperationOutput' => [ 'type' => 'structure', 'members' => [], ], 'SupportedMajorVersion' => [ 'type' => 'integer', 'max' => 65535, 'min' => 1, ], 'SupportedMajorVersions' => [ 'type' => 'list', 'member' => [ 'shape' => 'SupportedMajorVersion', ], ], 'Tag' => [ 'type' => 'structure', 'required' => [ 'Key', 'Value', ], 'members' => [ 'Key' => [ 'shape' => 'TagKey', ], 'Value' => [ 'shape' => 'TagValue', ], ], ], 'TagKey' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'TagValue' => [ 'type' => 'string', 'max' => 256, 'min' => 1, ], 'Tags' => [ 'type' => 'list', 'member' => [ 'shape' => 'Tag', ], 'max' => 50, ], 'TemplateBody' => [ 'type' => 'string', 'min' => 1, ], 'TemplateDescription' => [ 'type' => 'string', ], 'TemplateParameter' => [ 'type' => 'structure', 'members' => [ 'ParameterKey' => [ 'shape' => 'ParameterKey', ], 'DefaultValue' => [ 'shape' => 'ParameterValue', ], 'NoEcho' => [ 'shape' => 'NoEcho', ], 'Description' => [ 'shape' => 'Description', ], ], ], 'TemplateParameters' => [ 'type' => 'list', 'member' => [ 'shape' => 'TemplateParameter', ], ], 'TemplateStage' => [ 'type' => 'string', 'enum' => [ 'Original', 'Processed', ], ], 'TemplateURL' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, ], 'TestTypeInput' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'TypeArn', ], 'Type' => [ 'shape' => 'ThirdPartyType', ], 'TypeName' => [ 'shape' => 'TypeName', ], 'VersionId' => [ 'shape' => 'TypeVersionId', ], 'LogDeliveryBucket' => [ 'shape' => 'S3Bucket', ], ], ], 'TestTypeOutput' => [ 'type' => 'structure', 'members' => [ 'TypeVersionArn' => [ 'shape' => 'TypeArn', ], ], ], 'ThirdPartyType' => [ 'type' => 'string', 'enum' => [ 'RESOURCE', 'MODULE', 'HOOK', ], ], 'ThirdPartyTypeArn' => [ 'type' => 'string', 'max' => 1024, 'pattern' => 'arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}::type/.+/[0-9a-zA-Z]{12,40}/.+', ], 'TimeoutMinutes' => [ 'type' => 'integer', 'min' => 1, ], 'Timestamp' => [ 'type' => 'timestamp', ], 'TokenAlreadyExistsException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'TokenAlreadyExistsException', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'TotalStackInstancesCount' => [ 'type' => 'integer', 'min' => 0, ], 'TransformName' => [ 'type' => 'string', ], 'TransformsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TransformName', ], ], 'Type' => [ 'type' => 'string', ], 'TypeArn' => [ 'type' => 'string', 'max' => 1024, 'pattern' => 'arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/.+', ], 'TypeConfiguration' => [ 'type' => 'string', 'max' => 204800, 'min' => 1, 'pattern' => '[\\\\s\\\\S]+', ], 'TypeConfigurationAlias' => [ 'type' => 'string', 'max' => 256, 'min' => 1, 'pattern' => '^[a-zA-Z0-9]{1,256}$', ], 'TypeConfigurationArn' => [ 'type' => 'string', 'max' => 1024, 'pattern' => 'arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type-configuration/.+', ], 'TypeConfigurationDetails' => [ 'type' => 'structure', 'members' => [ 'Arn' => [ 'shape' => 'TypeConfigurationArn', ], 'Alias' => [ 'shape' => 'TypeConfigurationAlias', ], 'Configuration' => [ 'shape' => 'TypeConfiguration', ], 'LastUpdated' => [ 'shape' => 'Timestamp', ], 'TypeArn' => [ 'shape' => 'TypeArn', ], 'TypeName' => [ 'shape' => 'TypeName', ], 'IsDefaultConfiguration' => [ 'shape' => 'IsDefaultConfiguration', ], ], ], 'TypeConfigurationDetailsList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TypeConfigurationDetails', ], ], 'TypeConfigurationIdentifier' => [ 'type' => 'structure', 'members' => [ 'TypeArn' => [ 'shape' => 'TypeArn', ], 'TypeConfigurationAlias' => [ 'shape' => 'TypeConfigurationAlias', ], 'TypeConfigurationArn' => [ 'shape' => 'TypeConfigurationArn', ], 'Type' => [ 'shape' => 'ThirdPartyType', ], 'TypeName' => [ 'shape' => 'TypeName', ], ], ], 'TypeConfigurationIdentifiers' => [ 'type' => 'list', 'member' => [ 'shape' => 'TypeConfigurationIdentifier', ], 'min' => 1, ], 'TypeConfigurationNotFoundException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'TypeConfigurationNotFoundException', 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'TypeFilters' => [ 'type' => 'structure', 'members' => [ 'Category' => [ 'shape' => 'Category', ], 'PublisherId' => [ 'shape' => 'PublisherId', ], 'TypeNamePrefix' => [ 'shape' => 'TypeNamePrefix', ], ], ], 'TypeHierarchy' => [ 'type' => 'string', ], 'TypeName' => [ 'type' => 'string', 'max' => 204, 'min' => 10, 'pattern' => '[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}(::MODULE){0,1}', ], 'TypeNamePrefix' => [ 'type' => 'string', 'max' => 204, 'min' => 1, 'pattern' => '([A-Za-z0-9]{2,64}::){0,2}([A-Za-z0-9]{2,64}:?){0,1}', ], 'TypeNotFoundException' => [ 'type' => 'structure', 'members' => [], 'error' => [ 'code' => 'TypeNotFoundException', 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'TypeSchema' => [ 'type' => 'string', 'max' => 16777216, 'min' => 1, ], 'TypeSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'TypeSummary', ], ], 'TypeSummary' => [ 'type' => 'structure', 'members' => [ 'Type' => [ 'shape' => 'RegistryType', ], 'TypeName' => [ 'shape' => 'TypeName', ], 'DefaultVersionId' => [ 'shape' => 'TypeVersionId', ], 'TypeArn' => [ 'shape' => 'TypeArn', ], 'LastUpdated' => [ 'shape' => 'Timestamp', ], 'Description' => [ 'shape' => 'Description', ], 'PublisherId' => [ 'shape' => 'PublisherId', ], 'OriginalTypeName' => [ 'shape' => 'TypeName', ], 'PublicVersionNumber' => [ 'shape' => 'PublicVersionNumber', ], 'LatestPublicVersion' => [ 'shape' => 'PublicVersionNumber', ], 'PublisherIdentity' => [ 'shape' => 'IdentityProvider', ], 'PublisherName' => [ 'shape' => 'PublisherName', ], 'IsActivated' => [ 'shape' => 'IsActivated', ], ], ], 'TypeTestsStatus' => [ 'type' => 'string', 'enum' => [ 'PASSED', 'FAILED', 'IN_PROGRESS', 'NOT_TESTED', ], ], 'TypeTestsStatusDescription' => [ 'type' => 'string', 'max' => 1024, 'min' => 1, 'pattern' => '[\\\\s\\\\S]+', ], 'TypeVersionId' => [ 'type' => 'string', 'max' => 128, 'min' => 1, 'pattern' => '[A-Za-z0-9-]+', ], 'TypeVersionSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'TypeVersionSummary', ], ], 'TypeVersionSummary' => [ 'type' => 'structure', 'members' => [ 'Type' => [ 'shape' => 'RegistryType', ], 'TypeName' => [ 'shape' => 'TypeName', ], 'VersionId' => [ 'shape' => 'TypeVersionId', ], 'IsDefaultVersion' => [ 'shape' => 'IsDefaultVersion', ], 'Arn' => [ 'shape' => 'TypeArn', ], 'TimeCreated' => [ 'shape' => 'Timestamp', ], 'Description' => [ 'shape' => 'Description', ], 'PublicVersionNumber' => [ 'shape' => 'PublicVersionNumber', ], ], ], 'UnprocessedTypeConfigurations' => [ 'type' => 'list', 'member' => [ 'shape' => 'TypeConfigurationIdentifier', ], ], 'UpdateStackInput' => [ 'type' => 'structure', 'required' => [ 'StackName', ], 'members' => [ 'StackName' => [ 'shape' => 'StackName', ], 'TemplateBody' => [ 'shape' => 'TemplateBody', ], 'TemplateURL' => [ 'shape' => 'TemplateURL', ], 'UsePreviousTemplate' => [ 'shape' => 'UsePreviousTemplate', ], 'StackPolicyDuringUpdateBody' => [ 'shape' => 'StackPolicyDuringUpdateBody', ], 'StackPolicyDuringUpdateURL' => [ 'shape' => 'StackPolicyDuringUpdateURL', ], 'Parameters' => [ 'shape' => 'Parameters', ], 'Capabilities' => [ 'shape' => 'Capabilities', ], 'ResourceTypes' => [ 'shape' => 'ResourceTypes', ], 'RoleARN' => [ 'shape' => 'RoleARN', ], 'RollbackConfiguration' => [ 'shape' => 'RollbackConfiguration', ], 'StackPolicyBody' => [ 'shape' => 'StackPolicyBody', ], 'StackPolicyURL' => [ 'shape' => 'StackPolicyURL', ], 'NotificationARNs' => [ 'shape' => 'NotificationARNs', ], 'Tags' => [ 'shape' => 'Tags', ], 'DisableRollback' => [ 'shape' => 'DisableRollback', ], 'ClientRequestToken' => [ 'shape' => 'ClientRequestToken', ], ], ], 'UpdateStackInstancesInput' => [ 'type' => 'structure', 'required' => [ 'StackSetName', 'Regions', ], 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetNameOrId', ], 'Accounts' => [ 'shape' => 'AccountList', ], 'DeploymentTargets' => [ 'shape' => 'DeploymentTargets', ], 'Regions' => [ 'shape' => 'RegionList', ], 'ParameterOverrides' => [ 'shape' => 'Parameters', ], 'OperationPreferences' => [ 'shape' => 'StackSetOperationPreferences', ], 'OperationId' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'CallAs' => [ 'shape' => 'CallAs', ], ], ], 'UpdateStackInstancesOutput' => [ 'type' => 'structure', 'members' => [ 'OperationId' => [ 'shape' => 'ClientRequestToken', ], ], ], 'UpdateStackOutput' => [ 'type' => 'structure', 'members' => [ 'StackId' => [ 'shape' => 'StackId', ], ], ], 'UpdateStackSetInput' => [ 'type' => 'structure', 'required' => [ 'StackSetName', ], 'members' => [ 'StackSetName' => [ 'shape' => 'StackSetName', ], 'Description' => [ 'shape' => 'Description', ], 'TemplateBody' => [ 'shape' => 'TemplateBody', ], 'TemplateURL' => [ 'shape' => 'TemplateURL', ], 'UsePreviousTemplate' => [ 'shape' => 'UsePreviousTemplate', ], 'Parameters' => [ 'shape' => 'Parameters', ], 'Capabilities' => [ 'shape' => 'Capabilities', ], 'Tags' => [ 'shape' => 'Tags', ], 'OperationPreferences' => [ 'shape' => 'StackSetOperationPreferences', ], 'AdministrationRoleARN' => [ 'shape' => 'RoleARN', ], 'ExecutionRoleName' => [ 'shape' => 'ExecutionRoleName', ], 'DeploymentTargets' => [ 'shape' => 'DeploymentTargets', ], 'PermissionModel' => [ 'shape' => 'PermissionModels', ], 'AutoDeployment' => [ 'shape' => 'AutoDeployment', ], 'OperationId' => [ 'shape' => 'ClientRequestToken', 'idempotencyToken' => true, ], 'Accounts' => [ 'shape' => 'AccountList', ], 'Regions' => [ 'shape' => 'RegionList', ], 'CallAs' => [ 'shape' => 'CallAs', ], 'ManagedExecution' => [ 'shape' => 'ManagedExecution', ], ], ], 'UpdateStackSetOutput' => [ 'type' => 'structure', 'members' => [ 'OperationId' => [ 'shape' => 'ClientRequestToken', ], ], ], 'UpdateTerminationProtectionInput' => [ 'type' => 'structure', 'required' => [ 'EnableTerminationProtection', 'StackName', ], 'members' => [ 'EnableTerminationProtection' => [ 'shape' => 'EnableTerminationProtection', ], 'StackName' => [ 'shape' => 'StackNameOrId', ], ], ], 'UpdateTerminationProtectionOutput' => [ 'type' => 'structure', 'members' => [ 'StackId' => [ 'shape' => 'StackId', ], ], ], 'Url' => [ 'type' => 'string', ], 'UsePreviousTemplate' => [ 'type' => 'boolean', ], 'UsePreviousValue' => [ 'type' => 'boolean', ], 'ValidateTemplateInput' => [ 'type' => 'structure', 'members' => [ 'TemplateBody' => [ 'shape' => 'TemplateBody', ], 'TemplateURL' => [ 'shape' => 'TemplateURL', ], ], ], 'ValidateTemplateOutput' => [ 'type' => 'structure', 'members' => [ 'Parameters' => [ 'shape' => 'TemplateParameters', ], 'Description' => [ 'shape' => 'Description', ], 'Capabilities' => [ 'shape' => 'Capabilities', ], 'CapabilitiesReason' => [ 'shape' => 'CapabilitiesReason', ], 'DeclaredTransforms' => [ 'shape' => 'TransformsList', ], ], ], 'Value' => [ 'type' => 'string', ], 'Version' => [ 'type' => 'string', ], 'VersionBump' => [ 'type' => 'string', 'enum' => [ 'MAJOR', 'MINOR', ], ], 'Visibility' => [ 'type' => 'string', 'enum' => [ 'PUBLIC', 'PRIVATE', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DatabaseMigrationService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Database Migration Service** service.\n * @method \\Aws\\Result addTagsToResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsToResourceAsync(array $args = [])\n * @method \\Aws\\Result applyPendingMaintenanceAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise applyPendingMaintenanceActionAsync(array $args = [])\n * @method \\Aws\\Result batchStartRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchStartRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result cancelReplicationTaskAssessmentRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelReplicationTaskAssessmentRunAsync(array $args = [])\n * @method \\Aws\\Result createEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEndpointAsync(array $args = [])\n * @method \\Aws\\Result createEventSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEventSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result createFleetAdvisorCollector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFleetAdvisorCollectorAsync(array $args = [])\n * @method \\Aws\\Result createReplicationInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReplicationInstanceAsync(array $args = [])\n * @method \\Aws\\Result createReplicationSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReplicationSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result createReplicationTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReplicationTaskAsync(array $args = [])\n * @method \\Aws\\Result deleteCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCertificateAsync(array $args = [])\n * @method \\Aws\\Result deleteConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteEventSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result deleteFleetAdvisorCollector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFleetAdvisorCollectorAsync(array $args = [])\n * @method \\Aws\\Result deleteFleetAdvisorDatabases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFleetAdvisorDatabasesAsync(array $args = [])\n * @method \\Aws\\Result deleteReplicationInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReplicationInstanceAsync(array $args = [])\n * @method \\Aws\\Result deleteReplicationSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReplicationSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteReplicationTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReplicationTaskAsync(array $args = [])\n * @method \\Aws\\Result deleteReplicationTaskAssessmentRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReplicationTaskAssessmentRunAsync(array $args = [])\n * @method \\Aws\\Result describeAccountAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountAttributesAsync(array $args = [])\n * @method \\Aws\\Result describeApplicableIndividualAssessments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeApplicableIndividualAssessmentsAsync(array $args = [])\n * @method \\Aws\\Result describeCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCertificatesAsync(array $args = [])\n * @method \\Aws\\Result describeConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConnectionsAsync(array $args = [])\n * @method \\Aws\\Result describeEndpointSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEndpointSettingsAsync(array $args = [])\n * @method \\Aws\\Result describeEndpointTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEndpointTypesAsync(array $args = [])\n * @method \\Aws\\Result describeEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEndpointsAsync(array $args = [])\n * @method \\Aws\\Result describeEventCategories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventCategoriesAsync(array $args = [])\n * @method \\Aws\\Result describeEventSubscriptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventSubscriptionsAsync(array $args = [])\n * @method \\Aws\\Result describeEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventsAsync(array $args = [])\n * @method \\Aws\\Result describeFleetAdvisorCollectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetAdvisorCollectorsAsync(array $args = [])\n * @method \\Aws\\Result describeFleetAdvisorDatabases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetAdvisorDatabasesAsync(array $args = [])\n * @method \\Aws\\Result describeFleetAdvisorLsaAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetAdvisorLsaAnalysisAsync(array $args = [])\n * @method \\Aws\\Result describeFleetAdvisorSchemaObjectSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetAdvisorSchemaObjectSummaryAsync(array $args = [])\n * @method \\Aws\\Result describeFleetAdvisorSchemas(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetAdvisorSchemasAsync(array $args = [])\n * @method \\Aws\\Result describeOrderableReplicationInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrderableReplicationInstancesAsync(array $args = [])\n * @method \\Aws\\Result describePendingMaintenanceActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePendingMaintenanceActionsAsync(array $args = [])\n * @method \\Aws\\Result describeRecommendationLimitations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRecommendationLimitationsAsync(array $args = [])\n * @method \\Aws\\Result describeRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result describeRefreshSchemasStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRefreshSchemasStatusAsync(array $args = [])\n * @method \\Aws\\Result describeReplicationInstanceTaskLogs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReplicationInstanceTaskLogsAsync(array $args = [])\n * @method \\Aws\\Result describeReplicationInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReplicationInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeReplicationSubnetGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReplicationSubnetGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeReplicationTaskAssessmentResults(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReplicationTaskAssessmentResultsAsync(array $args = [])\n * @method \\Aws\\Result describeReplicationTaskAssessmentRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReplicationTaskAssessmentRunsAsync(array $args = [])\n * @method \\Aws\\Result describeReplicationTaskIndividualAssessments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReplicationTaskIndividualAssessmentsAsync(array $args = [])\n * @method \\Aws\\Result describeReplicationTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReplicationTasksAsync(array $args = [])\n * @method \\Aws\\Result describeSchemas(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSchemasAsync(array $args = [])\n * @method \\Aws\\Result describeTableStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTableStatisticsAsync(array $args = [])\n * @method \\Aws\\Result importCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importCertificateAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result modifyEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyEndpointAsync(array $args = [])\n * @method \\Aws\\Result modifyEventSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyEventSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result modifyReplicationInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyReplicationInstanceAsync(array $args = [])\n * @method \\Aws\\Result modifyReplicationSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyReplicationSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result modifyReplicationTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyReplicationTaskAsync(array $args = [])\n * @method \\Aws\\Result moveReplicationTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise moveReplicationTaskAsync(array $args = [])\n * @method \\Aws\\Result rebootReplicationInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebootReplicationInstanceAsync(array $args = [])\n * @method \\Aws\\Result refreshSchemas(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise refreshSchemasAsync(array $args = [])\n * @method \\Aws\\Result reloadTables(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise reloadTablesAsync(array $args = [])\n * @method \\Aws\\Result removeTagsFromResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsFromResourceAsync(array $args = [])\n * @method \\Aws\\Result runFleetAdvisorLsaAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise runFleetAdvisorLsaAnalysisAsync(array $args = [])\n * @method \\Aws\\Result startRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result startReplicationTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startReplicationTaskAsync(array $args = [])\n * @method \\Aws\\Result startReplicationTaskAssessment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startReplicationTaskAssessmentAsync(array $args = [])\n * @method \\Aws\\Result startReplicationTaskAssessmentRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startReplicationTaskAssessmentRunAsync(array $args = [])\n * @method \\Aws\\Result stopReplicationTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopReplicationTaskAsync(array $args = [])\n * @method \\Aws\\Result testConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testConnectionAsync(array $args = [])\n * @method \\Aws\\Result updateSubscriptionsToEventBridge(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSubscriptionsToEventBridgeAsync(array $args = [])\n */\nclass DatabaseMigrationServiceClient extends AwsClient {}\n", "num_lines": 148}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DatabaseMigrationService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Database Migration Service** service.\n */\nclass DatabaseMigrationServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DataExchange;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Data Exchange** service.\n * @method \\Aws\\Result cancelJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelJobAsync(array $args = [])\n * @method \\Aws\\Result createDataSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataSetAsync(array $args = [])\n * @method \\Aws\\Result createEventAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEventActionAsync(array $args = [])\n * @method \\Aws\\Result createJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createJobAsync(array $args = [])\n * @method \\Aws\\Result createRevision(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRevisionAsync(array $args = [])\n * @method \\Aws\\Result deleteAsset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAssetAsync(array $args = [])\n * @method \\Aws\\Result deleteDataSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataSetAsync(array $args = [])\n * @method \\Aws\\Result deleteEventAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventActionAsync(array $args = [])\n * @method \\Aws\\Result deleteRevision(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRevisionAsync(array $args = [])\n * @method \\Aws\\Result getAsset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAssetAsync(array $args = [])\n * @method \\Aws\\Result getDataSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataSetAsync(array $args = [])\n * @method \\Aws\\Result getEventAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEventActionAsync(array $args = [])\n * @method \\Aws\\Result getJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobAsync(array $args = [])\n * @method \\Aws\\Result getRevision(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRevisionAsync(array $args = [])\n * @method \\Aws\\Result listDataSetRevisions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataSetRevisionsAsync(array $args = [])\n * @method \\Aws\\Result listDataSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataSetsAsync(array $args = [])\n * @method \\Aws\\Result listEventActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventActionsAsync(array $args = [])\n * @method \\Aws\\Result listJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobsAsync(array $args = [])\n * @method \\Aws\\Result listRevisionAssets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRevisionAssetsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result revokeRevision(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeRevisionAsync(array $args = [])\n * @method \\Aws\\Result sendApiAsset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendApiAssetAsync(array $args = [])\n * @method \\Aws\\Result startJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startJobAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAsset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAssetAsync(array $args = [])\n * @method \\Aws\\Result updateDataSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDataSetAsync(array $args = [])\n * @method \\Aws\\Result updateEventAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEventActionAsync(array $args = [])\n * @method \\Aws\\Result updateRevision(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRevisionAsync(array $args = [])\n */\nclass DataExchangeClient extends AwsClient {}\n", "num_lines": 68}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DataExchange\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Data Exchange** service.\n */\nclass DataExchangeException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DataPipeline;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Data Pipeline** service.\n *\n * @method \\Aws\\Result activatePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise activatePipelineAsync(array $args = [])\n * @method \\Aws\\Result addTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsAsync(array $args = [])\n * @method \\Aws\\Result createPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPipelineAsync(array $args = [])\n * @method \\Aws\\Result deactivatePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deactivatePipelineAsync(array $args = [])\n * @method \\Aws\\Result deletePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePipelineAsync(array $args = [])\n * @method \\Aws\\Result describeObjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeObjectsAsync(array $args = [])\n * @method \\Aws\\Result describePipelines(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePipelinesAsync(array $args = [])\n * @method \\Aws\\Result evaluateExpression(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise evaluateExpressionAsync(array $args = [])\n * @method \\Aws\\Result getPipelineDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPipelineDefinitionAsync(array $args = [])\n * @method \\Aws\\Result listPipelines(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPipelinesAsync(array $args = [])\n * @method \\Aws\\Result pollForTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise pollForTaskAsync(array $args = [])\n * @method \\Aws\\Result putPipelineDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPipelineDefinitionAsync(array $args = [])\n * @method \\Aws\\Result queryObjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise queryObjectsAsync(array $args = [])\n * @method \\Aws\\Result removeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsAsync(array $args = [])\n * @method \\Aws\\Result reportTaskProgress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise reportTaskProgressAsync(array $args = [])\n * @method \\Aws\\Result reportTaskRunnerHeartbeat(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise reportTaskRunnerHeartbeatAsync(array $args = [])\n * @method \\Aws\\Result setStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setStatusAsync(array $args = [])\n * @method \\Aws\\Result setTaskStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setTaskStatusAsync(array $args = [])\n * @method \\Aws\\Result validatePipelineDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise validatePipelineDefinitionAsync(array $args = [])\n */\nclass DataPipelineClient extends AwsClient {}\n", "num_lines": 49}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DataPipeline\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the AWS Data Pipeline service.\n */\nclass DataPipelineException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DataSync;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS DataSync** service.\n * @method \\Aws\\Result addStorageSystem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addStorageSystemAsync(array $args = [])\n * @method \\Aws\\Result cancelTaskExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelTaskExecutionAsync(array $args = [])\n * @method \\Aws\\Result createAgent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAgentAsync(array $args = [])\n * @method \\Aws\\Result createLocationEfs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLocationEfsAsync(array $args = [])\n * @method \\Aws\\Result createLocationFsxLustre(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLocationFsxLustreAsync(array $args = [])\n * @method \\Aws\\Result createLocationFsxOntap(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLocationFsxOntapAsync(array $args = [])\n * @method \\Aws\\Result createLocationFsxOpenZfs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLocationFsxOpenZfsAsync(array $args = [])\n * @method \\Aws\\Result createLocationFsxWindows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLocationFsxWindowsAsync(array $args = [])\n * @method \\Aws\\Result createLocationHdfs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLocationHdfsAsync(array $args = [])\n * @method \\Aws\\Result createLocationNfs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLocationNfsAsync(array $args = [])\n * @method \\Aws\\Result createLocationObjectStorage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLocationObjectStorageAsync(array $args = [])\n * @method \\Aws\\Result createLocationS3(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLocationS3Async(array $args = [])\n * @method \\Aws\\Result createLocationSmb(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLocationSmbAsync(array $args = [])\n * @method \\Aws\\Result createTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTaskAsync(array $args = [])\n * @method \\Aws\\Result deleteAgent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAgentAsync(array $args = [])\n * @method \\Aws\\Result deleteLocation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLocationAsync(array $args = [])\n * @method \\Aws\\Result deleteTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTaskAsync(array $args = [])\n * @method \\Aws\\Result describeAgent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAgentAsync(array $args = [])\n * @method \\Aws\\Result describeDiscoveryJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDiscoveryJobAsync(array $args = [])\n * @method \\Aws\\Result describeLocationEfs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLocationEfsAsync(array $args = [])\n * @method \\Aws\\Result describeLocationFsxLustre(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLocationFsxLustreAsync(array $args = [])\n * @method \\Aws\\Result describeLocationFsxOntap(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLocationFsxOntapAsync(array $args = [])\n * @method \\Aws\\Result describeLocationFsxOpenZfs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLocationFsxOpenZfsAsync(array $args = [])\n * @method \\Aws\\Result describeLocationFsxWindows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLocationFsxWindowsAsync(array $args = [])\n * @method \\Aws\\Result describeLocationHdfs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLocationHdfsAsync(array $args = [])\n * @method \\Aws\\Result describeLocationNfs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLocationNfsAsync(array $args = [])\n * @method \\Aws\\Result describeLocationObjectStorage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLocationObjectStorageAsync(array $args = [])\n * @method \\Aws\\Result describeLocationS3(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLocationS3Async(array $args = [])\n * @method \\Aws\\Result describeLocationSmb(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLocationSmbAsync(array $args = [])\n * @method \\Aws\\Result describeStorageSystem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStorageSystemAsync(array $args = [])\n * @method \\Aws\\Result describeStorageSystemResourceMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStorageSystemResourceMetricsAsync(array $args = [])\n * @method \\Aws\\Result describeStorageSystemResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStorageSystemResourcesAsync(array $args = [])\n * @method \\Aws\\Result describeTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTaskAsync(array $args = [])\n * @method \\Aws\\Result describeTaskExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTaskExecutionAsync(array $args = [])\n * @method \\Aws\\Result generateRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result listAgents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAgentsAsync(array $args = [])\n * @method \\Aws\\Result listDiscoveryJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDiscoveryJobsAsync(array $args = [])\n * @method \\Aws\\Result listLocations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLocationsAsync(array $args = [])\n * @method \\Aws\\Result listStorageSystems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStorageSystemsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTaskExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTaskExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTasksAsync(array $args = [])\n * @method \\Aws\\Result removeStorageSystem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeStorageSystemAsync(array $args = [])\n * @method \\Aws\\Result startDiscoveryJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDiscoveryJobAsync(array $args = [])\n * @method \\Aws\\Result startTaskExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startTaskExecutionAsync(array $args = [])\n * @method \\Aws\\Result stopDiscoveryJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopDiscoveryJobAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAgent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAgentAsync(array $args = [])\n * @method \\Aws\\Result updateDiscoveryJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDiscoveryJobAsync(array $args = [])\n * @method \\Aws\\Result updateLocationHdfs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLocationHdfsAsync(array $args = [])\n * @method \\Aws\\Result updateLocationNfs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLocationNfsAsync(array $args = [])\n * @method \\Aws\\Result updateLocationObjectStorage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLocationObjectStorageAsync(array $args = [])\n * @method \\Aws\\Result updateLocationSmb(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLocationSmbAsync(array $args = [])\n * @method \\Aws\\Result updateStorageSystem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStorageSystemAsync(array $args = [])\n * @method \\Aws\\Result updateTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTaskAsync(array $args = [])\n * @method \\Aws\\Result updateTaskExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTaskExecutionAsync(array $args = [])\n */\nclass DataSyncClient extends AwsClient {}\n", "num_lines": 124}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DataSync\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS DataSync** service.\n */\nclass DataSyncException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DAX;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon DynamoDB Accelerator (DAX)** service.\n * @method \\Aws\\Result createCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClusterAsync(array $args = [])\n * @method \\Aws\\Result createParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result createSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result decreaseReplicationFactor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise decreaseReplicationFactorAsync(array $args = [])\n * @method \\Aws\\Result deleteCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClusterAsync(array $args = [])\n * @method \\Aws\\Result deleteParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result describeClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClustersAsync(array $args = [])\n * @method \\Aws\\Result describeDefaultParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDefaultParametersAsync(array $args = [])\n * @method \\Aws\\Result describeEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventsAsync(array $args = [])\n * @method \\Aws\\Result describeParameterGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeParameterGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeParametersAsync(array $args = [])\n * @method \\Aws\\Result describeSubnetGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSubnetGroupsAsync(array $args = [])\n * @method \\Aws\\Result increaseReplicationFactor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise increaseReplicationFactorAsync(array $args = [])\n * @method \\Aws\\Result listTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsAsync(array $args = [])\n * @method \\Aws\\Result rebootNode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebootNodeAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateClusterAsync(array $args = [])\n * @method \\Aws\\Result updateParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result updateSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSubnetGroupAsync(array $args = [])\n */\nclass DAXClient extends AwsClient {}\n", "num_lines": 52}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DAX\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon DynamoDB Accelerator (DAX)** service.\n */\nclass DAXException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DefaultsMode;\n\nuse Aws\\DefaultsMode\\Exception\\ConfigurationException;\n\nclass Configuration implements ConfigurationInterface\n{\n    private $mode;\n    private $retryMode;\n    private $stsRegionalEndpoints;\n    private $s3UsEast1RegionalEndpoints;\n    private $connectTimeoutInMillis;\n    private $httpRequestTimeoutInMillis;\n    private $validModes = [\n        'legacy',\n        'standard',\n        'cross-region',\n        'in-region',\n        'mobile',\n        'auto',\n    ];\n\n    public function __construct($mode = 'legacy')\n    {\n        $mode = strtolower($mode);\n        if (!in_array($mode, $this->validModes)) {\n            throw new \\InvalidArgumentException(\"'{$mode}' is not a valid mode.\"\n                . \" The mode has to be 'legacy', 'standard', 'cross-region', 'in-region',\"\n                . \" 'mobile', or 'auto'.\");\n        }\n\n        $this->mode = $mode;\n        if ($this->mode == 'legacy') {\n            return;\n        }\n\n        $data = \\Aws\\load_compiled_json(\n            __DIR__ . '/../data/sdk-default-configuration.json'\n        );\n\n        $this->retryMode = $data['base']['retryMode'];\n        $this->stsRegionalEndpoints = $data['base']['stsRegionalEndpoints'];\n        $this->s3UsEast1RegionalEndpoints = $data['base']['s3UsEast1RegionalEndpoints'];\n        $this->connectTimeoutInMillis = $data['base']['connectTimeoutInMillis'];\n\n        if (isset($data['modes'][$mode])) {\n            $modeData = $data['modes'][$mode];\n            foreach ($modeData as $settingName => $settingValue) {\n                if (isset($this->$settingName)) {\n                    if (isset($settingValue['override'])) {\n                        $this->$settingName = $settingValue['override'];\n                    } else if (isset($settingValue['multiply'])) {\n                        $this->$settingName *= $settingValue['multiply'];\n                    } else if (isset($settingValue['add'])) {\n                        $this->$settingName += $settingValue['add'];\n                    }\n                } else {\n                    if (isset($settingValue['override'])) {\n                        if (property_exists($this, $settingName)) {\n                            $this->$settingName = $settingValue['override'];\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getMode()\n    {\n        return $this->mode;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getRetryMode()\n    {\n        return $this->retryMode;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getStsRegionalEndpoints()\n    {\n        return $this->stsRegionalEndpoints;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getS3UsEast1RegionalEndpoints()\n    {\n        return $this->s3UsEast1RegionalEndpoints;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getConnectTimeoutInMillis()\n    {\n        return $this->connectTimeoutInMillis;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getHttpRequestTimeoutInMillis()\n    {\n        return $this->httpRequestTimeoutInMillis;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function toArray()\n    {\n        return [\n            'mode'                                       => $this->getMode(),\n            'retry_mode'                                 => $this->getRetryMode(),\n            'sts_regional_endpoints'                     => $this->getStsRegionalEndpoints(),\n            's3_us_east_1_regional_endpoint'             => $this->getS3UsEast1RegionalEndpoints(),\n            'connect_timeout_in_milliseconds'            => $this->getConnectTimeoutInMillis(),\n            'http_request_timeout_in_milliseconds'       => $this->getHttpRequestTimeoutInMillis(),\n        ];\n    }\n\n}\n", "num_lines": 132}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DefaultsMode;\n\n/**\n * Provides access to defaultsMode configuration\n */\ninterface ConfigurationInterface\n{\n    /**\n     * Returns the configuration mode. Available modes include 'legacy', 'standard', and\n     * 'adapative'.\n     *\n     * @return string\n     */\n    public function getMode();\n\n    /**\n     * Returns the sts regional endpoints option\n     *\n     * @return bool\n     */\n    public function getStsRegionalEndpoints();\n\n    /**\n     * Returns the s3 us-east-1 regional endpoints option\n     *\n     * @return bool\n     */\n    public function getS3UsEast1RegionalEndpoints();\n\n    /**\n     * Returns the connection timeout in milliseconds\n     *\n     * @return int\n     */\n    public function getConnectTimeoutInMillis();\n\n    /**\n     * Returns the http request timeout in milliseconds\n     *\n     * @return int\n     */\n    public function getHttpRequestTimeoutInMillis();\n\n    /**\n     * Returns the configuration as an associative array\n     *\n     * @return array\n     */\n    public function toArray();\n}\n", "num_lines": 52}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DefaultsMode;\n\nuse Aws\\AbstractConfigurationProvider;\nuse Aws\\CacheInterface;\nuse Aws\\ConfigurationProviderInterface;\nuse Aws\\DefaultsMode\\Exception\\ConfigurationException;\nuse GuzzleHttp\\Promise;\nuse GuzzleHttp\\Promise\\PromiseInterface;\n\n/**\n * A configuration provider is a function that returns a promise that is\n * fulfilled with a {@see \\Aws\\DefaultsMode\\ConfigurationInterface}\n * or rejected with an {@see \\Aws\\DefaultsMode\\Exception\\ConfigurationException}.\n *\n * <code>\n * use Aws\\Sts\\RegionalEndpoints\\ConfigurationProvider;\n * $provider = ConfigurationProvider::defaultProvider();\n * // Returns a ConfigurationInterface or throws.\n * $config = $provider()->wait();\n * </code>\n *\n * Configuration providers can be composed to create configuration using\n * conditional logic that can create different configurations in different\n * environments. You can compose multiple providers into a single provider using\n * {@see \\Aws\\DefaultsMode\\ConfigurationProvider::chain}. This function\n * accepts providers as variadic arguments and returns a new function that will\n * invoke each provider until a successful configuration is returned.\n *\n * <code>\n * // First try an INI file at this location.\n * $a = ConfigurationProvider::ini(null, '/path/to/file.ini');\n * // Then try an INI file at this location.\n * $b = ConfigurationProvider::ini(null, '/path/to/other-file.ini');\n * // Then try loading from environment variables.\n * $c = ConfigurationProvider::env();\n * // Combine the three providers together.\n * $composed = ConfigurationProvider::chain($a, $b, $c);\n * // Returns a promise that is fulfilled with a configuration or throws.\n * $promise = $composed();\n * // Wait on the configuration to resolve.\n * $config = $promise->wait();\n * </code>\n */\nclass ConfigurationProvider extends AbstractConfigurationProvider\n    implements ConfigurationProviderInterface\n{\n    const DEFAULT_MODE = 'legacy';\n    const ENV_MODE = 'AWS_DEFAULTS_MODE';\n    const ENV_PROFILE = 'AWS_PROFILE';\n    const INI_MODE = 'defaults_mode';\n\n    public static $cacheKey = 'aws_defaults_mode';\n\n    protected static $interfaceClass = ConfigurationInterface::class;\n    protected static $exceptionClass = ConfigurationException::class;\n\n    /**\n     * Create a default config provider that first checks for environment\n     * variables, then checks for a specified profile in the environment-defined\n     * config file location (env variable is 'AWS_CONFIG_FILE', file location\n     * defaults to ~/.aws/config), then checks for the \"default\" profile in the\n     * environment-defined config file location, and failing those uses a default\n     * fallback set of configuration options.\n     *\n     * This provider is automatically wrapped in a memoize function that caches\n     * previously provided config options.\n     *\n     * @param array $config\n     *\n     * @return callable\n     */\n    public static function defaultProvider(array $config = [])\n    {\n        $configProviders = [self::env()];\n        if (\n            !isset($config['use_aws_shared_config_files'])\n            || $config['use_aws_shared_config_files'] != false\n        ) {\n            $configProviders[] = self::ini();\n        }\n        $configProviders[] = self::fallback();\n\n        $memo = self::memoize(\n            call_user_func_array([ConfigurationProvider::class, 'chain'], $configProviders)\n        );\n\n        if (isset($config['defaultsMode'])\n            && $config['defaultsMode'] instanceof CacheInterface\n        ) {\n            return self::cache($memo, $config['defaultsMode'], self::$cacheKey);\n        }\n\n        return $memo;\n    }\n\n    /**\n     * Provider that creates config from environment variables.\n     *\n     * @return callable\n     */\n    public static function env()\n    {\n        return function () {\n            // Use config from environment variables, if available\n            $mode = getenv(self::ENV_MODE);\n            if (!empty($mode)) {\n                return Promise\\Create::promiseFor(\n                    new Configuration($mode)\n                );\n            }\n\n            return self::reject('Could not find environment variable config'\n                . ' in ' . self::ENV_MODE);\n        };\n    }\n\n    /**\n     * Fallback config options when other sources are not set.\n     *\n     * @return callable\n     */\n    public static function fallback()\n    {\n        return function () {\n            return Promise\\Create::promiseFor(\n                new Configuration( self::DEFAULT_MODE)\n            );\n        };\n    }\n\n    /**\n     * Config provider that creates config using a config file whose location\n     * is specified by an environment variable 'AWS_CONFIG_FILE', defaulting to\n     * ~/.aws/config if not specified\n     *\n     * @param string|null $profile  Profile to use. If not specified will use\n     *                              the \"default\" profile.\n     * @param string|null $filename If provided, uses a custom filename rather\n     *                              than looking in the default directory.\n     *\n     * @return callable\n     */\n    public static function ini(\n        $profile = null,\n        $filename = null\n    ) {\n        $filename = $filename ?: (self::getDefaultConfigFilename());\n        $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');\n\n        return function () use ($profile, $filename) {\n            if (!is_readable($filename)) {\n                return self::reject(\"Cannot read configuration from $filename\");\n            }\n            $data = \\Aws\\parse_ini_file($filename, true);\n            if ($data === false) {\n                return self::reject(\"Invalid config file: $filename\");\n            }\n            if (!isset($data[$profile])) {\n                return self::reject(\"'$profile' not found in config file\");\n            }\n            if (!isset($data[$profile][self::INI_MODE])) {\n                return self::reject(\"Required defaults mode config values\n                    not present in INI profile '{$profile}' ({$filename})\");\n            }\n            return Promise\\Create::promiseFor(\n                new Configuration(\n                    $data[$profile][self::INI_MODE]\n                )\n            );\n        };\n    }\n\n    /**\n     * Unwraps a configuration object in whatever valid form it is in,\n     * always returning a ConfigurationInterface object.\n     *\n     * @param  mixed $config\n     * @return ConfigurationInterface\n     * @throws \\InvalidArgumentException\n     */\n    public static function unwrap($config)\n    {\n        if (is_callable($config)) {\n            $config = $config();\n        }\n        if ($config instanceof PromiseInterface) {\n            $config = $config->wait();\n        }\n        if ($config instanceof ConfigurationInterface) {\n            return $config;\n        }\n\n        if (is_string($config)) {\n            return new Configuration($config);\n        }\n\n        throw new \\InvalidArgumentException('Not a valid defaults mode configuration'\n            . ' argument.');\n    }\n}\n", "num_lines": 202}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DefaultsMode\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\n/**\n * Represents an error interacting with configuration mode\n */\nclass ConfigurationException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 15}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Detective;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Detective** service.\n * @method \\Aws\\Result acceptInvitation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptInvitationAsync(array $args = [])\n * @method \\Aws\\Result batchGetGraphMemberDatasources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetGraphMemberDatasourcesAsync(array $args = [])\n * @method \\Aws\\Result batchGetMembershipDatasources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetMembershipDatasourcesAsync(array $args = [])\n * @method \\Aws\\Result createGraph(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGraphAsync(array $args = [])\n * @method \\Aws\\Result createMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMembersAsync(array $args = [])\n * @method \\Aws\\Result deleteGraph(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGraphAsync(array $args = [])\n * @method \\Aws\\Result deleteMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMembersAsync(array $args = [])\n * @method \\Aws\\Result describeOrganizationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrganizationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result disableOrganizationAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableOrganizationAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result disassociateMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateMembershipAsync(array $args = [])\n * @method \\Aws\\Result enableOrganizationAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableOrganizationAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result getMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMembersAsync(array $args = [])\n * @method \\Aws\\Result listDatasourcePackages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasourcePackagesAsync(array $args = [])\n * @method \\Aws\\Result listGraphs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGraphsAsync(array $args = [])\n * @method \\Aws\\Result listInvitations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInvitationsAsync(array $args = [])\n * @method \\Aws\\Result listMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMembersAsync(array $args = [])\n * @method \\Aws\\Result listOrganizationAdminAccounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOrganizationAdminAccountsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result rejectInvitation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectInvitationAsync(array $args = [])\n * @method \\Aws\\Result startMonitoringMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMonitoringMemberAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDatasourcePackages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDatasourcePackagesAsync(array $args = [])\n * @method \\Aws\\Result updateOrganizationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateOrganizationConfigurationAsync(array $args = [])\n */\nclass DetectiveClient extends AwsClient {}\n", "num_lines": 58}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Detective\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Detective** service.\n */\nclass DetectiveException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DeviceFarm;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon DeviceFarm** service.\n *\n * @method \\Aws\\Result createDevicePool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDevicePoolAsync(array $args = [])\n * @method \\Aws\\Result createInstanceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInstanceProfileAsync(array $args = [])\n * @method \\Aws\\Result createNetworkProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNetworkProfileAsync(array $args = [])\n * @method \\Aws\\Result createProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProjectAsync(array $args = [])\n * @method \\Aws\\Result createRemoteAccessSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRemoteAccessSessionAsync(array $args = [])\n * @method \\Aws\\Result createTestGridProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTestGridProjectAsync(array $args = [])\n * @method \\Aws\\Result createTestGridUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTestGridUrlAsync(array $args = [])\n * @method \\Aws\\Result createUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUploadAsync(array $args = [])\n * @method \\Aws\\Result createVPCEConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVPCEConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteDevicePool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDevicePoolAsync(array $args = [])\n * @method \\Aws\\Result deleteInstanceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInstanceProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteNetworkProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNetworkProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProjectAsync(array $args = [])\n * @method \\Aws\\Result deleteRemoteAccessSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRemoteAccessSessionAsync(array $args = [])\n * @method \\Aws\\Result deleteRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRunAsync(array $args = [])\n * @method \\Aws\\Result deleteTestGridProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTestGridProjectAsync(array $args = [])\n * @method \\Aws\\Result deleteUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUploadAsync(array $args = [])\n * @method \\Aws\\Result deleteVPCEConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVPCEConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getAccountSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountSettingsAsync(array $args = [])\n * @method \\Aws\\Result getDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeviceAsync(array $args = [])\n * @method \\Aws\\Result getDeviceInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeviceInstanceAsync(array $args = [])\n * @method \\Aws\\Result getDevicePool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDevicePoolAsync(array $args = [])\n * @method \\Aws\\Result getDevicePoolCompatibility(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDevicePoolCompatibilityAsync(array $args = [])\n * @method \\Aws\\Result getInstanceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInstanceProfileAsync(array $args = [])\n * @method \\Aws\\Result getJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobAsync(array $args = [])\n * @method \\Aws\\Result getNetworkProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNetworkProfileAsync(array $args = [])\n * @method \\Aws\\Result getOfferingStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOfferingStatusAsync(array $args = [])\n * @method \\Aws\\Result getProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProjectAsync(array $args = [])\n * @method \\Aws\\Result getRemoteAccessSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRemoteAccessSessionAsync(array $args = [])\n * @method \\Aws\\Result getRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRunAsync(array $args = [])\n * @method \\Aws\\Result getSuite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSuiteAsync(array $args = [])\n * @method \\Aws\\Result getTest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTestAsync(array $args = [])\n * @method \\Aws\\Result getTestGridProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTestGridProjectAsync(array $args = [])\n * @method \\Aws\\Result getTestGridSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTestGridSessionAsync(array $args = [])\n * @method \\Aws\\Result getUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUploadAsync(array $args = [])\n * @method \\Aws\\Result getVPCEConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVPCEConfigurationAsync(array $args = [])\n * @method \\Aws\\Result installToRemoteAccessSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise installToRemoteAccessSessionAsync(array $args = [])\n * @method \\Aws\\Result listArtifacts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listArtifactsAsync(array $args = [])\n * @method \\Aws\\Result listDeviceInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeviceInstancesAsync(array $args = [])\n * @method \\Aws\\Result listDevicePools(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDevicePoolsAsync(array $args = [])\n * @method \\Aws\\Result listDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDevicesAsync(array $args = [])\n * @method \\Aws\\Result listInstanceProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInstanceProfilesAsync(array $args = [])\n * @method \\Aws\\Result listJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobsAsync(array $args = [])\n * @method \\Aws\\Result listNetworkProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNetworkProfilesAsync(array $args = [])\n * @method \\Aws\\Result listOfferingPromotions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOfferingPromotionsAsync(array $args = [])\n * @method \\Aws\\Result listOfferingTransactions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOfferingTransactionsAsync(array $args = [])\n * @method \\Aws\\Result listOfferings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOfferingsAsync(array $args = [])\n * @method \\Aws\\Result listProjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProjectsAsync(array $args = [])\n * @method \\Aws\\Result listRemoteAccessSessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRemoteAccessSessionsAsync(array $args = [])\n * @method \\Aws\\Result listRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRunsAsync(array $args = [])\n * @method \\Aws\\Result listSamples(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSamplesAsync(array $args = [])\n * @method \\Aws\\Result listSuites(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSuitesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTestGridProjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTestGridProjectsAsync(array $args = [])\n * @method \\Aws\\Result listTestGridSessionActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTestGridSessionActionsAsync(array $args = [])\n * @method \\Aws\\Result listTestGridSessionArtifacts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTestGridSessionArtifactsAsync(array $args = [])\n * @method \\Aws\\Result listTestGridSessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTestGridSessionsAsync(array $args = [])\n * @method \\Aws\\Result listTests(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTestsAsync(array $args = [])\n * @method \\Aws\\Result listUniqueProblems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUniqueProblemsAsync(array $args = [])\n * @method \\Aws\\Result listUploads(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUploadsAsync(array $args = [])\n * @method \\Aws\\Result listVPCEConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVPCEConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result purchaseOffering(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise purchaseOfferingAsync(array $args = [])\n * @method \\Aws\\Result renewOffering(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise renewOfferingAsync(array $args = [])\n * @method \\Aws\\Result scheduleRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise scheduleRunAsync(array $args = [])\n * @method \\Aws\\Result stopJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopJobAsync(array $args = [])\n * @method \\Aws\\Result stopRemoteAccessSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopRemoteAccessSessionAsync(array $args = [])\n * @method \\Aws\\Result stopRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopRunAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDeviceInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDeviceInstanceAsync(array $args = [])\n * @method \\Aws\\Result updateDevicePool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDevicePoolAsync(array $args = [])\n * @method \\Aws\\Result updateInstanceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateInstanceProfileAsync(array $args = [])\n * @method \\Aws\\Result updateNetworkProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNetworkProfileAsync(array $args = [])\n * @method \\Aws\\Result updateProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProjectAsync(array $args = [])\n * @method \\Aws\\Result updateTestGridProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTestGridProjectAsync(array $args = [])\n * @method \\Aws\\Result updateUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUploadAsync(array $args = [])\n * @method \\Aws\\Result updateVPCEConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVPCEConfigurationAsync(array $args = [])\n */\nclass DeviceFarmClient extends AwsClient {}", "num_lines": 164}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DeviceFarm\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon DeviceFarm service.\n */\nclass DeviceFarmException extends AwsException {}", "num_lines": 9}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DevOpsGuru;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon DevOps Guru** service.\n * @method \\Aws\\Result addNotificationChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addNotificationChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteInsight(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInsightAsync(array $args = [])\n * @method \\Aws\\Result describeAccountHealth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountHealthAsync(array $args = [])\n * @method \\Aws\\Result describeAccountOverview(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountOverviewAsync(array $args = [])\n * @method \\Aws\\Result describeAnomaly(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAnomalyAsync(array $args = [])\n * @method \\Aws\\Result describeEventSourcesConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventSourcesConfigAsync(array $args = [])\n * @method \\Aws\\Result describeFeedback(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFeedbackAsync(array $args = [])\n * @method \\Aws\\Result describeInsight(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInsightAsync(array $args = [])\n * @method \\Aws\\Result describeOrganizationHealth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrganizationHealthAsync(array $args = [])\n * @method \\Aws\\Result describeOrganizationOverview(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrganizationOverviewAsync(array $args = [])\n * @method \\Aws\\Result describeOrganizationResourceCollectionHealth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrganizationResourceCollectionHealthAsync(array $args = [])\n * @method \\Aws\\Result describeResourceCollectionHealth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeResourceCollectionHealthAsync(array $args = [])\n * @method \\Aws\\Result describeServiceIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeServiceIntegrationAsync(array $args = [])\n * @method \\Aws\\Result getCostEstimation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCostEstimationAsync(array $args = [])\n * @method \\Aws\\Result getResourceCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceCollectionAsync(array $args = [])\n * @method \\Aws\\Result listAnomaliesForInsight(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAnomaliesForInsightAsync(array $args = [])\n * @method \\Aws\\Result listAnomalousLogGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAnomalousLogGroupsAsync(array $args = [])\n * @method \\Aws\\Result listEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventsAsync(array $args = [])\n * @method \\Aws\\Result listInsights(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInsightsAsync(array $args = [])\n * @method \\Aws\\Result listMonitoredResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMonitoredResourcesAsync(array $args = [])\n * @method \\Aws\\Result listNotificationChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNotificationChannelsAsync(array $args = [])\n * @method \\Aws\\Result listOrganizationInsights(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOrganizationInsightsAsync(array $args = [])\n * @method \\Aws\\Result listRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result putFeedback(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putFeedbackAsync(array $args = [])\n * @method \\Aws\\Result removeNotificationChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeNotificationChannelAsync(array $args = [])\n * @method \\Aws\\Result searchInsights(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchInsightsAsync(array $args = [])\n * @method \\Aws\\Result searchOrganizationInsights(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchOrganizationInsightsAsync(array $args = [])\n * @method \\Aws\\Result startCostEstimation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startCostEstimationAsync(array $args = [])\n * @method \\Aws\\Result updateEventSourcesConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEventSourcesConfigAsync(array $args = [])\n * @method \\Aws\\Result updateResourceCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResourceCollectionAsync(array $args = [])\n * @method \\Aws\\Result updateServiceIntegration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceIntegrationAsync(array $args = [])\n */\nclass DevOpsGuruClient extends AwsClient {}\n", "num_lines": 72}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DevOpsGuru\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon DevOps Guru** service.\n */\nclass DevOpsGuruException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DirectConnect;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Direct Connect** service.\n *\n * @method \\Aws\\Result acceptDirectConnectGatewayAssociationProposal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptDirectConnectGatewayAssociationProposalAsync(array $args = [])\n * @method \\Aws\\Result allocateConnectionOnInterconnect(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise allocateConnectionOnInterconnectAsync(array $args = [])\n * @method \\Aws\\Result allocateHostedConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise allocateHostedConnectionAsync(array $args = [])\n * @method \\Aws\\Result allocatePrivateVirtualInterface(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise allocatePrivateVirtualInterfaceAsync(array $args = [])\n * @method \\Aws\\Result allocatePublicVirtualInterface(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise allocatePublicVirtualInterfaceAsync(array $args = [])\n * @method \\Aws\\Result allocateTransitVirtualInterface(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise allocateTransitVirtualInterfaceAsync(array $args = [])\n * @method \\Aws\\Result associateConnectionWithLag(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateConnectionWithLagAsync(array $args = [])\n * @method \\Aws\\Result associateHostedConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateHostedConnectionAsync(array $args = [])\n * @method \\Aws\\Result associateMacSecKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateMacSecKeyAsync(array $args = [])\n * @method \\Aws\\Result associateVirtualInterface(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateVirtualInterfaceAsync(array $args = [])\n * @method \\Aws\\Result confirmConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise confirmConnectionAsync(array $args = [])\n * @method \\Aws\\Result confirmCustomerAgreement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise confirmCustomerAgreementAsync(array $args = [])\n * @method \\Aws\\Result confirmPrivateVirtualInterface(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise confirmPrivateVirtualInterfaceAsync(array $args = [])\n * @method \\Aws\\Result confirmPublicVirtualInterface(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise confirmPublicVirtualInterfaceAsync(array $args = [])\n * @method \\Aws\\Result confirmTransitVirtualInterface(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise confirmTransitVirtualInterfaceAsync(array $args = [])\n * @method \\Aws\\Result createBGPPeer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBGPPeerAsync(array $args = [])\n * @method \\Aws\\Result createConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConnectionAsync(array $args = [])\n * @method \\Aws\\Result createDirectConnectGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDirectConnectGatewayAsync(array $args = [])\n * @method \\Aws\\Result createDirectConnectGatewayAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDirectConnectGatewayAssociationAsync(array $args = [])\n * @method \\Aws\\Result createDirectConnectGatewayAssociationProposal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDirectConnectGatewayAssociationProposalAsync(array $args = [])\n * @method \\Aws\\Result createInterconnect(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInterconnectAsync(array $args = [])\n * @method \\Aws\\Result createLag(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLagAsync(array $args = [])\n * @method \\Aws\\Result createPrivateVirtualInterface(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPrivateVirtualInterfaceAsync(array $args = [])\n * @method \\Aws\\Result createPublicVirtualInterface(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPublicVirtualInterfaceAsync(array $args = [])\n * @method \\Aws\\Result createTransitVirtualInterface(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTransitVirtualInterfaceAsync(array $args = [])\n * @method \\Aws\\Result deleteBGPPeer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBGPPeerAsync(array $args = [])\n * @method \\Aws\\Result deleteConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteDirectConnectGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDirectConnectGatewayAsync(array $args = [])\n * @method \\Aws\\Result deleteDirectConnectGatewayAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDirectConnectGatewayAssociationAsync(array $args = [])\n * @method \\Aws\\Result deleteDirectConnectGatewayAssociationProposal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDirectConnectGatewayAssociationProposalAsync(array $args = [])\n * @method \\Aws\\Result deleteInterconnect(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInterconnectAsync(array $args = [])\n * @method \\Aws\\Result deleteLag(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLagAsync(array $args = [])\n * @method \\Aws\\Result deleteVirtualInterface(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVirtualInterfaceAsync(array $args = [])\n * @method \\Aws\\Result describeConnectionLoa(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConnectionLoaAsync(array $args = [])\n * @method \\Aws\\Result describeConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConnectionsAsync(array $args = [])\n * @method \\Aws\\Result describeConnectionsOnInterconnect(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConnectionsOnInterconnectAsync(array $args = [])\n * @method \\Aws\\Result describeCustomerMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCustomerMetadataAsync(array $args = [])\n * @method \\Aws\\Result describeDirectConnectGatewayAssociationProposals(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDirectConnectGatewayAssociationProposalsAsync(array $args = [])\n * @method \\Aws\\Result describeDirectConnectGatewayAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDirectConnectGatewayAssociationsAsync(array $args = [])\n * @method \\Aws\\Result describeDirectConnectGatewayAttachments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDirectConnectGatewayAttachmentsAsync(array $args = [])\n * @method \\Aws\\Result describeDirectConnectGateways(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDirectConnectGatewaysAsync(array $args = [])\n * @method \\Aws\\Result describeHostedConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHostedConnectionsAsync(array $args = [])\n * @method \\Aws\\Result describeInterconnectLoa(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInterconnectLoaAsync(array $args = [])\n * @method \\Aws\\Result describeInterconnects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInterconnectsAsync(array $args = [])\n * @method \\Aws\\Result describeLags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLagsAsync(array $args = [])\n * @method \\Aws\\Result describeLoa(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLoaAsync(array $args = [])\n * @method \\Aws\\Result describeLocations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLocationsAsync(array $args = [])\n * @method \\Aws\\Result describeRouterConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRouterConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTagsAsync(array $args = [])\n * @method \\Aws\\Result describeVirtualGateways(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVirtualGatewaysAsync(array $args = [])\n * @method \\Aws\\Result describeVirtualInterfaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVirtualInterfacesAsync(array $args = [])\n * @method \\Aws\\Result disassociateConnectionFromLag(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateConnectionFromLagAsync(array $args = [])\n * @method \\Aws\\Result disassociateMacSecKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateMacSecKeyAsync(array $args = [])\n * @method \\Aws\\Result listVirtualInterfaceTestHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVirtualInterfaceTestHistoryAsync(array $args = [])\n * @method \\Aws\\Result startBgpFailoverTest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startBgpFailoverTestAsync(array $args = [])\n * @method \\Aws\\Result stopBgpFailoverTest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopBgpFailoverTestAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConnectionAsync(array $args = [])\n * @method \\Aws\\Result updateDirectConnectGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDirectConnectGatewayAsync(array $args = [])\n * @method \\Aws\\Result updateDirectConnectGatewayAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDirectConnectGatewayAssociationAsync(array $args = [])\n * @method \\Aws\\Result updateLag(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLagAsync(array $args = [])\n * @method \\Aws\\Result updateVirtualInterfaceAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVirtualInterfaceAttributesAsync(array $args = [])\n */\nclass DirectConnectClient extends AwsClient {}\n", "num_lines": 137}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DirectConnect\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the AWS Direct Connect service.\n */\nclass DirectConnectException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DirectoryService;\n\nuse Aws\\AwsClient;\n\n/**\n * AWS Directory Service client\n *\n * @method \\Aws\\Result acceptSharedDirectory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptSharedDirectoryAsync(array $args = [])\n * @method \\Aws\\Result addIpRoutes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addIpRoutesAsync(array $args = [])\n * @method \\Aws\\Result addRegion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addRegionAsync(array $args = [])\n * @method \\Aws\\Result addTagsToResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsToResourceAsync(array $args = [])\n * @method \\Aws\\Result cancelSchemaExtension(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelSchemaExtensionAsync(array $args = [])\n * @method \\Aws\\Result connectDirectory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise connectDirectoryAsync(array $args = [])\n * @method \\Aws\\Result createAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAliasAsync(array $args = [])\n * @method \\Aws\\Result createComputer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createComputerAsync(array $args = [])\n * @method \\Aws\\Result createConditionalForwarder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConditionalForwarderAsync(array $args = [])\n * @method \\Aws\\Result createDirectory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDirectoryAsync(array $args = [])\n * @method \\Aws\\Result createLogSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLogSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result createMicrosoftAD(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMicrosoftADAsync(array $args = [])\n * @method \\Aws\\Result createSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createTrust(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTrustAsync(array $args = [])\n * @method \\Aws\\Result deleteConditionalForwarder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConditionalForwarderAsync(array $args = [])\n * @method \\Aws\\Result deleteDirectory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDirectoryAsync(array $args = [])\n * @method \\Aws\\Result deleteLogSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLogSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result deleteSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteTrust(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTrustAsync(array $args = [])\n * @method \\Aws\\Result deregisterCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterCertificateAsync(array $args = [])\n * @method \\Aws\\Result deregisterEventTopic(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterEventTopicAsync(array $args = [])\n * @method \\Aws\\Result describeCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCertificateAsync(array $args = [])\n * @method \\Aws\\Result describeClientAuthenticationSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClientAuthenticationSettingsAsync(array $args = [])\n * @method \\Aws\\Result describeConditionalForwarders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConditionalForwardersAsync(array $args = [])\n * @method \\Aws\\Result describeDirectories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDirectoriesAsync(array $args = [])\n * @method \\Aws\\Result describeDomainControllers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainControllersAsync(array $args = [])\n * @method \\Aws\\Result describeEventTopics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventTopicsAsync(array $args = [])\n * @method \\Aws\\Result describeLDAPSSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLDAPSSettingsAsync(array $args = [])\n * @method \\Aws\\Result describeRegions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRegionsAsync(array $args = [])\n * @method \\Aws\\Result describeSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSettingsAsync(array $args = [])\n * @method \\Aws\\Result describeSharedDirectories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSharedDirectoriesAsync(array $args = [])\n * @method \\Aws\\Result describeSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result describeTrusts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTrustsAsync(array $args = [])\n * @method \\Aws\\Result describeUpdateDirectory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUpdateDirectoryAsync(array $args = [])\n * @method \\Aws\\Result disableClientAuthentication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableClientAuthenticationAsync(array $args = [])\n * @method \\Aws\\Result disableLDAPS(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableLDAPSAsync(array $args = [])\n * @method \\Aws\\Result disableRadius(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableRadiusAsync(array $args = [])\n * @method \\Aws\\Result disableSso(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableSsoAsync(array $args = [])\n * @method \\Aws\\Result enableClientAuthentication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableClientAuthenticationAsync(array $args = [])\n * @method \\Aws\\Result enableLDAPS(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableLDAPSAsync(array $args = [])\n * @method \\Aws\\Result enableRadius(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableRadiusAsync(array $args = [])\n * @method \\Aws\\Result enableSso(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableSsoAsync(array $args = [])\n * @method \\Aws\\Result getDirectoryLimits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDirectoryLimitsAsync(array $args = [])\n * @method \\Aws\\Result getSnapshotLimits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSnapshotLimitsAsync(array $args = [])\n * @method \\Aws\\Result listCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCertificatesAsync(array $args = [])\n * @method \\Aws\\Result listIpRoutes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIpRoutesAsync(array $args = [])\n * @method \\Aws\\Result listLogSubscriptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLogSubscriptionsAsync(array $args = [])\n * @method \\Aws\\Result listSchemaExtensions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSchemaExtensionsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result registerCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerCertificateAsync(array $args = [])\n * @method \\Aws\\Result registerEventTopic(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerEventTopicAsync(array $args = [])\n * @method \\Aws\\Result rejectSharedDirectory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectSharedDirectoryAsync(array $args = [])\n * @method \\Aws\\Result removeIpRoutes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeIpRoutesAsync(array $args = [])\n * @method \\Aws\\Result removeRegion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeRegionAsync(array $args = [])\n * @method \\Aws\\Result removeTagsFromResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsFromResourceAsync(array $args = [])\n * @method \\Aws\\Result resetUserPassword(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetUserPasswordAsync(array $args = [])\n * @method \\Aws\\Result restoreFromSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreFromSnapshotAsync(array $args = [])\n * @method \\Aws\\Result shareDirectory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise shareDirectoryAsync(array $args = [])\n * @method \\Aws\\Result startSchemaExtension(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSchemaExtensionAsync(array $args = [])\n * @method \\Aws\\Result unshareDirectory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unshareDirectoryAsync(array $args = [])\n * @method \\Aws\\Result updateConditionalForwarder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConditionalForwarderAsync(array $args = [])\n * @method \\Aws\\Result updateDirectorySetup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDirectorySetupAsync(array $args = [])\n * @method \\Aws\\Result updateNumberOfDomainControllers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNumberOfDomainControllersAsync(array $args = [])\n * @method \\Aws\\Result updateRadius(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRadiusAsync(array $args = [])\n * @method \\Aws\\Result updateSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateTrust(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTrustAsync(array $args = [])\n * @method \\Aws\\Result verifyTrust(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise verifyTrustAsync(array $args = [])\n */\nclass DirectoryServiceClient extends AwsClient {}\n", "num_lines": 145}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DirectoryService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * AWS Directory Service Exception\n */\nclass DirectoryServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DLM;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Data Lifecycle Manager** service.\n * @method \\Aws\\Result createLifecyclePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLifecyclePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteLifecyclePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLifecyclePolicyAsync(array $args = [])\n * @method \\Aws\\Result getLifecyclePolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLifecyclePoliciesAsync(array $args = [])\n * @method \\Aws\\Result getLifecyclePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLifecyclePolicyAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateLifecyclePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLifecyclePolicyAsync(array $args = [])\n */\nclass DLMClient extends AwsClient {}\n", "num_lines": 26}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DLM\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Data Lifecycle Manager** service.\n */\nclass DLMException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DocDB;\n\nuse Aws\\AwsClient;\nuse Aws\\PresignUrlMiddleware;\n\n/**\n * This client is used to interact with the **Amazon DocumentDB with MongoDB compatibility** service.\n * @method \\Aws\\Result addSourceIdentifierToSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addSourceIdentifierToSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result addTagsToResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsToResourceAsync(array $args = [])\n * @method \\Aws\\Result applyPendingMaintenanceAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise applyPendingMaintenanceActionAsync(array $args = [])\n * @method \\Aws\\Result copyDBClusterParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyDBClusterParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result copyDBClusterSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyDBClusterSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createDBCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBClusterAsync(array $args = [])\n * @method \\Aws\\Result createDBClusterParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBClusterParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result createDBClusterSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBClusterSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createDBInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBInstanceAsync(array $args = [])\n * @method \\Aws\\Result createDBSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result createEventSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEventSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result createGlobalCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGlobalClusterAsync(array $args = [])\n * @method \\Aws\\Result deleteDBCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBClusterAsync(array $args = [])\n * @method \\Aws\\Result deleteDBClusterParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBClusterParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteDBClusterSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBClusterSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteDBInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBInstanceAsync(array $args = [])\n * @method \\Aws\\Result deleteDBSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteEventSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result deleteGlobalCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGlobalClusterAsync(array $args = [])\n * @method \\Aws\\Result describeCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCertificatesAsync(array $args = [])\n * @method \\Aws\\Result describeDBClusterParameterGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClusterParameterGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeDBClusterParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClusterParametersAsync(array $args = [])\n * @method \\Aws\\Result describeDBClusterSnapshotAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClusterSnapshotAttributesAsync(array $args = [])\n * @method \\Aws\\Result describeDBClusterSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClusterSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result describeDBClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClustersAsync(array $args = [])\n * @method \\Aws\\Result describeDBEngineVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBEngineVersionsAsync(array $args = [])\n * @method \\Aws\\Result describeDBInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeDBSubnetGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBSubnetGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeEngineDefaultClusterParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEngineDefaultClusterParametersAsync(array $args = [])\n * @method \\Aws\\Result describeEventCategories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventCategoriesAsync(array $args = [])\n * @method \\Aws\\Result describeEventSubscriptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventSubscriptionsAsync(array $args = [])\n * @method \\Aws\\Result describeEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventsAsync(array $args = [])\n * @method \\Aws\\Result describeGlobalClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGlobalClustersAsync(array $args = [])\n * @method \\Aws\\Result describeOrderableDBInstanceOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrderableDBInstanceOptionsAsync(array $args = [])\n * @method \\Aws\\Result describePendingMaintenanceActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePendingMaintenanceActionsAsync(array $args = [])\n * @method \\Aws\\Result failoverDBCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise failoverDBClusterAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result modifyDBCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBClusterAsync(array $args = [])\n * @method \\Aws\\Result modifyDBClusterParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBClusterParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result modifyDBClusterSnapshotAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBClusterSnapshotAttributeAsync(array $args = [])\n * @method \\Aws\\Result modifyDBInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBInstanceAsync(array $args = [])\n * @method \\Aws\\Result modifyDBSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result modifyEventSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyEventSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result modifyGlobalCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyGlobalClusterAsync(array $args = [])\n * @method \\Aws\\Result rebootDBInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebootDBInstanceAsync(array $args = [])\n * @method \\Aws\\Result removeFromGlobalCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeFromGlobalClusterAsync(array $args = [])\n * @method \\Aws\\Result removeSourceIdentifierFromSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeSourceIdentifierFromSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result removeTagsFromResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsFromResourceAsync(array $args = [])\n * @method \\Aws\\Result resetDBClusterParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetDBClusterParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result restoreDBClusterFromSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreDBClusterFromSnapshotAsync(array $args = [])\n * @method \\Aws\\Result restoreDBClusterToPointInTime(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreDBClusterToPointInTimeAsync(array $args = [])\n * @method \\Aws\\Result startDBCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDBClusterAsync(array $args = [])\n * @method \\Aws\\Result stopDBCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopDBClusterAsync(array $args = [])\n */\nclass DocDBClient extends AwsClient {\n    public function __construct(array $args)\n    {\n        $args['with_resolved'] = function (array $args) {\n            $this->getHandlerList()->appendInit(\n                PresignUrlMiddleware::wrap(\n                    $this,\n                    $args['endpoint_provider'],\n                    [\n                        'operations' => [\n                            'CopyDBClusterSnapshot',\n                            'CreateDBCluster',\n                        ],\n                        'service' => 'rds',\n                        'presign_param' => 'PreSignedUrl',\n                        'require_different_region' => true,\n                        'extra_query_params' => [\n                            'CopyDBClusterSnapshot' => ['DestinationRegion'],\n                            'CreateDBCluster' => ['DestinationRegion'],\n                        ]\n                    ]\n                ),\n                'rds.presigner'\n            );\n        };\n        parent::__construct($args);\n    }\n}\n", "num_lines": 144}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DocDB\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon DocumentDB with MongoDB compatibility** service.\n */\nclass DocDBException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DocDBElastic;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon DocumentDB Elastic Clusters** service.\n * @method \\Aws\\Result createCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClusterAsync(array $args = [])\n * @method \\Aws\\Result createClusterSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClusterSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClusterAsync(array $args = [])\n * @method \\Aws\\Result deleteClusterSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClusterSnapshotAsync(array $args = [])\n * @method \\Aws\\Result getCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getClusterAsync(array $args = [])\n * @method \\Aws\\Result getClusterSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getClusterSnapshotAsync(array $args = [])\n * @method \\Aws\\Result listClusterSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listClusterSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result listClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listClustersAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result restoreClusterFromSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreClusterFromSnapshotAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateClusterAsync(array $args = [])\n */\nclass DocDBElasticClient extends AwsClient {}\n", "num_lines": 36}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DocDBElastic\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon DocumentDB Elastic Clusters** service.\n */\nclass DocDBElasticException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DynamoDb;\n\nuse GuzzleHttp\\Psr7;\n\n/**\n * Special object to represent a DynamoDB binary (B) value.\n */\nclass BinaryValue implements \\JsonSerializable\n{\n    /** @var string Binary value. */\n    private $value;\n\n    /**\n     * @param mixed $value A binary value compatible with Guzzle streams.\n     *\n     * @see GuzzleHttp\\Stream\\Stream::factory\n     */\n    public function __construct($value)\n    {\n        if (!is_string($value)) {\n            $value = Psr7\\Utils::streamFor($value);\n        }\n        $this->value = (string) $value;\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function jsonSerialize()\n    {\n        return $this->value;\n    }\n\n    public function __toString()\n    {\n        return $this->value;\n    }\n}\n", "num_lines": 38}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DynamoDb;\n\nuse Aws\\Api\\Parser\\Crc32ValidatingParser;\nuse Aws\\AwsClient;\nuse Aws\\ClientResolver;\nuse Aws\\Exception\\AwsException;\nuse Aws\\HandlerList;\nuse Aws\\Middleware;\nuse Aws\\RetryMiddleware;\nuse Aws\\RetryMiddlewareV2;\n\n/**\n * This client is used to interact with the **Amazon DynamoDB** service.\n *\n * @method \\Aws\\Result batchGetItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetItemAsync(array $args = [])\n * @method \\Aws\\Result batchWriteItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchWriteItemAsync(array $args = [])\n * @method \\Aws\\Result createTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTableAsync(array $args = [])\n * @method \\Aws\\Result deleteItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteItemAsync(array $args = [])\n * @method \\Aws\\Result deleteTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTableAsync(array $args = [])\n * @method \\Aws\\Result describeTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTableAsync(array $args = [])\n * @method \\Aws\\Result getItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getItemAsync(array $args = [])\n * @method \\Aws\\Result listTables(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTablesAsync(array $args = [])\n * @method \\Aws\\Result putItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putItemAsync(array $args = [])\n * @method \\Aws\\Result query(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise queryAsync(array $args = [])\n * @method \\Aws\\Result scan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise scanAsync(array $args = [])\n * @method \\Aws\\Result updateItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateItemAsync(array $args = [])\n * @method \\Aws\\Result updateTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTableAsync(array $args = [])\n * @method \\Aws\\Result batchExecuteStatement(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise batchExecuteStatementAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result createBackup(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise createBackupAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result createGlobalTable(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise createGlobalTableAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result deleteBackup(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise deleteBackupAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result describeBackup(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise describeBackupAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result describeContinuousBackups(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise describeContinuousBackupsAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result describeContributorInsights(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise describeContributorInsightsAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result describeEndpoints(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise describeEndpointsAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result describeExport(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise describeExportAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result describeGlobalTable(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise describeGlobalTableAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result describeGlobalTableSettings(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise describeGlobalTableSettingsAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result describeImport(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise describeImportAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result describeKinesisStreamingDestination(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise describeKinesisStreamingDestinationAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result describeLimits(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise describeLimitsAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result describeTableReplicaAutoScaling(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise describeTableReplicaAutoScalingAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result describeTimeToLive(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise describeTimeToLiveAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result disableKinesisStreamingDestination(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise disableKinesisStreamingDestinationAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result enableKinesisStreamingDestination(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise enableKinesisStreamingDestinationAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result executeStatement(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise executeStatementAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result executeTransaction(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise executeTransactionAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result exportTableToPointInTime(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise exportTableToPointInTimeAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result importTable(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise importTableAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result listBackups(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise listBackupsAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result listContributorInsights(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise listContributorInsightsAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result listExports(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise listExportsAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result listGlobalTables(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise listGlobalTablesAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result listImports(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise listImportsAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result listTagsOfResource(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise listTagsOfResourceAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result restoreTableFromBackup(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise restoreTableFromBackupAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result restoreTableToPointInTime(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise restoreTableToPointInTimeAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result tagResource(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result transactGetItems(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise transactGetItemsAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result transactWriteItems(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise transactWriteItemsAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result untagResource(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result updateContinuousBackups(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise updateContinuousBackupsAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result updateContributorInsights(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise updateContributorInsightsAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result updateGlobalTable(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise updateGlobalTableAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result updateGlobalTableSettings(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise updateGlobalTableSettingsAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result updateTableReplicaAutoScaling(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise updateTableReplicaAutoScalingAsync(array $args = []) (supported in versions 2012-08-10)\n * @method \\Aws\\Result updateTimeToLive(array $args = []) (supported in versions 2012-08-10)\n * @method \\GuzzleHttp\\Promise\\Promise updateTimeToLiveAsync(array $args = []) (supported in versions 2012-08-10)\n */\nclass DynamoDbClient extends AwsClient\n{\n    public static function getArguments()\n    {\n        $args = parent::getArguments();\n        $args['retries']['default'] = 10;\n        $args['retries']['fn'] = [__CLASS__, '_applyRetryConfig'];\n        $args['api_provider']['fn'] = [__CLASS__, '_applyApiProvider'];\n\n        return $args;\n    }\n\n    /**\n     * Convenience method for instantiating and registering the DynamoDB\n     * Session handler with this DynamoDB client object.\n     *\n     * @param array $config Array of options for the session handler factory\n     *\n     * @return SessionHandler\n     */\n    public function registerSessionHandler(array $config = [])\n    {\n        $handler = SessionHandler::fromClient($this, $config);\n        $handler->register();\n\n        return $handler;\n    }\n\n    /** @internal */\n    public static function _applyRetryConfig($value, array &$args, HandlerList $list)\n    {\n        if ($value) {\n            $config = \\Aws\\Retry\\ConfigurationProvider::unwrap($value);\n\n            if ($config->getMode() === 'legacy') {\n                $list->appendSign(\n                    Middleware::retry(\n                        RetryMiddleware::createDefaultDecider(\n                            $config->getMaxAttempts() - 1,\n                            ['error_codes' => ['TransactionInProgressException']]\n                        ),\n                        function ($retries) {\n                            return $retries\n                                ? RetryMiddleware::exponentialDelay($retries) / 2\n                                : 0;\n                        },\n                        isset($args['stats']['retries'])\n                            ? (bool)$args['stats']['retries']\n                            : false\n                    ),\n                    'retry'\n                );\n            } else {\n                $list->appendSign(\n                    RetryMiddlewareV2::wrap(\n                        $config,\n                        [\n                            'collect_stats' => $args['stats']['retries'],\n                            'transient_error_codes' => ['TransactionInProgressException']\n                        ]\n                    ),\n                    'retry'\n                );\n            }\n        }\n    }\n\n    /** @internal */\n    public static function _applyApiProvider($value, array &$args, HandlerList $list)\n    {\n        ClientResolver::_apply_api_provider($value, $args);\n        $args['parser'] = new Crc32ValidatingParser($args['parser']);\n    }\n}\n", "num_lines": 197}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DynamoDb;\n\nuse Aws\\DynamoDb\\Exception\\DynamoDbException;\n\n/**\n * The locking connection adds locking logic to the read operation.\n */\nclass LockingSessionConnection extends StandardSessionConnection\n{\n    public function __construct(DynamoDbClient $client, array $config = [])\n    {\n        parent::__construct($client, $config);\n    }\n\n    /**\n     * {@inheritdoc}\n     * Retries the request until the lock can be acquired\n     */\n    public function read($id)\n    {\n        // Create the params for the UpdateItem operation so that a lock can be\n        // set and item returned (via ReturnValues) in a one, atomic operation.\n        $params = [\n            'TableName'        => $this->getTableName(),\n            'Key'              => $this->formatKey($id),\n            'Expected'         => ['lock' => ['Exists' => false]],\n            'AttributeUpdates' => ['lock' => ['Value' => ['N' => '1']]],\n            'ReturnValues'     => 'ALL_NEW',\n        ];\n\n        // Acquire the lock and fetch the item data.\n        $timeout  = time() + $this->getMaxLockWaitTime();\n        while (true) {\n            try {\n                $item = [];\n                $result = $this->client->updateItem($params);\n                if (isset($result['Attributes'])) {\n                    foreach ($result['Attributes'] as $key => $value) {\n                        $item[$key] = current($value);\n                    }\n                }\n                return $item;\n            } catch (DynamoDbException $e) {\n                if ($e->getAwsErrorCode() === 'ConditionalCheckFailedException'\n                    && time() < $timeout\n                ) {\n                    usleep(rand(\n                        $this->getMinLockRetryMicrotime(),\n                        $this->getMaxLockRetryMicrotime()\n                    ));\n                } else {\n                    break;\n                }\n            }\n        }\n    }\n}\n", "num_lines": 59}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DynamoDb;\n\nuse Psr\\Http\\Message\\StreamInterface;\n\n/**\n * Marshals and unmarshals JSON documents and PHP arrays into DynamoDB items.\n */\nclass Marshaler\n{\n    /** @var array Default options to merge into provided options. */\n    private static $defaultOptions = [\n        'ignore_invalid'  => false,\n        'nullify_invalid' => false,\n        'wrap_numbers'    => false,\n    ];\n\n    /** @var array Marshaler options. */\n    private $options;\n\n    /**\n     * Instantiates a DynamoDB Marshaler.\n     *\n     * The following options are valid.\n     *\n     * - ignore_invalid: (bool) Set to `true` if invalid values should be\n     *   ignored (i.e., not included) during marshaling.\n     * - nullify_invalid: (bool) Set to `true` if invalid values should be set\n     *   to null.\n     * - wrap_numbers: (bool) Set to `true` to wrap numbers with `NumberValue`\n     *   objects during unmarshaling to preserve the precision.\n     *\n     * @param array $options Marshaler options\n     */\n    public function __construct(array $options = [])\n    {\n        $this->options = $options + self::$defaultOptions;\n    }\n\n    /**\n     * Creates a special object to represent a DynamoDB binary (B) value.\n     *\n     * This helps disambiguate binary values from string (S) values.\n     *\n     * @param mixed $value A binary value compatible with Guzzle streams.\n     *\n     * @return BinaryValue\n     * @see GuzzleHttp\\Stream\\Stream::factory\n     */\n    public function binary($value)\n    {\n        return new BinaryValue($value);\n    }\n\n    /**\n     * Creates a special object to represent a DynamoDB number (N) value.\n     *\n     * This helps maintain the precision of large integer/float in PHP.\n     *\n     * @param string|int|float $value A number value.\n     *\n     * @return NumberValue\n     */\n    public function number($value)\n    {\n        return new NumberValue($value);\n    }\n\n    /**\n     * Creates a special object to represent a DynamoDB set (SS/NS/BS) value.\n     *\n     * This helps disambiguate set values from list (L) values.\n     *\n     * @param array $values The values of the set.\n     *\n     * @return SetValue\n     *\n     */\n    public function set(array $values)\n    {\n        return new SetValue($values);\n    }\n\n    /**\n     * Marshal a JSON document from a string to a DynamoDB item.\n     *\n     * The result is an array formatted in the proper parameter structure\n     * required by the DynamoDB API for items.\n     *\n     * @param string $json A valid JSON document.\n     *\n     * @return array Item formatted for DynamoDB.\n     * @throws \\InvalidArgumentException if the JSON is invalid.\n     */\n    public function marshalJson($json)\n    {\n        $data = json_decode($json);\n        if (!($data instanceof \\stdClass)) {\n            throw new \\InvalidArgumentException(\n                'The JSON document must be valid and be an object at its root.'\n            );\n        }\n\n        return current($this->marshalValue($data));\n    }\n\n    /**\n     * Marshal a native PHP array of data to a DynamoDB item.\n     *\n     * The result is an array formatted in the proper parameter structure\n     * required by the DynamoDB API for items.\n     *\n     * @param array|\\stdClass $item An associative array of data.\n     *\n     * @return array Item formatted for DynamoDB.\n     */\n    public function marshalItem($item)\n    {\n        return current($this->marshalValue($item));\n    }\n\n    /**\n     * Marshal a native PHP value into a DynamoDB attribute value.\n     *\n     * The result is an associative array that is formatted in the proper\n     * `[TYPE => VALUE]` parameter structure required by the DynamoDB API.\n     *\n     * @param mixed $value A scalar, array, or `stdClass` value.\n     *\n     * @return array Attribute formatted for DynamoDB.\n     * @throws \\UnexpectedValueException if the value cannot be marshaled.\n     */\n    public function marshalValue($value)\n    {\n        $type = gettype($value);\n\n        // Handle string values.\n        if ($type === 'string') {\n            return ['S' => $value];\n        }\n\n        // Handle number values.\n        if ($type === 'integer'\n            || $type === 'double'\n            || $value instanceof NumberValue\n        ) {\n            return ['N' => (string) $value];\n        }\n\n        // Handle boolean values.\n        if ($type === 'boolean') {\n            return ['BOOL' => $value];\n        }\n\n        // Handle null values.\n        if ($type === 'NULL') {\n            return ['NULL' => true];\n        }\n\n        // Handle set values.\n        if ($value instanceof SetValue) {\n            if (count($value) === 0) {\n                return $this->handleInvalid('empty sets are invalid');\n            }\n            $previousType = null;\n            $data = [];\n            foreach ($value as $v) {\n                $marshaled = $this->marshalValue($v);\n                $setType = key($marshaled);\n                if (!$previousType) {\n                    $previousType = $setType;\n                } elseif ($setType !== $previousType) {\n                    return $this->handleInvalid('sets must be uniform in type');\n                }\n                $data[] = current($marshaled);\n            }\n\n            return [$previousType . 'S' => array_values(array_unique($data))];\n        }\n\n        // Handle list and map values.\n        $dbType = 'L';\n        if ($value instanceof \\stdClass) {\n            $type = 'array';\n            $dbType = 'M';\n        }\n        if ($type === 'array' || $value instanceof \\Traversable) {\n            $data = [];\n            $index = 0;\n            foreach ($value as $k => $v) {\n                if ($v = $this->marshalValue($v)) {\n                    $data[$k] = $v;\n                    if ($dbType === 'L' && (!is_int($k) || $k != $index++)) {\n                        $dbType = 'M';\n                    }\n                }\n            }\n            return [$dbType => $data];\n        }\n\n        // Handle binary values.\n        if (is_resource($value) || $value instanceof StreamInterface) {\n            $value = $this->binary($value);\n        }\n        if ($value instanceof BinaryValue) {\n            return ['B' => (string) $value];\n        }\n\n        // Handle invalid values.\n        return $this->handleInvalid('encountered unexpected value');\n    }\n\n    /**\n     * Unmarshal a document (item) from a DynamoDB operation result into a JSON\n     * document string.\n     *\n     * @param array $data            Item/document from a DynamoDB result.\n     * @param int   $jsonEncodeFlags Flags to use with `json_encode()`.\n     *\n     * @return string\n     */\n    public function unmarshalJson(array $data, $jsonEncodeFlags = 0)\n    {\n        return json_encode(\n            $this->unmarshalValue(['M' => $data], true),\n            $jsonEncodeFlags\n        );\n    }\n\n    /**\n     * Unmarshal an item from a DynamoDB operation result into a native PHP\n     * array. If you set $mapAsObject to true, then a stdClass value will be\n     * returned instead.\n     *\n     * @param array $data Item from a DynamoDB result.\n     * @param bool  $mapAsObject Whether maps should be represented as stdClass.\n     *\n     * @return array|\\stdClass\n     */\n    public function unmarshalItem(array $data, $mapAsObject = false)\n    {\n        return $this->unmarshalValue(['M' => $data], $mapAsObject);\n    }\n\n    /**\n     * Unmarshal a value from a DynamoDB operation result into a native PHP\n     * value. Will return a scalar, array, or (if you set $mapAsObject to true)\n     * stdClass value.\n     *\n     * @param array $value       Value from a DynamoDB result.\n     * @param bool  $mapAsObject Whether maps should be represented as stdClass.\n     *\n     * @return mixed\n     * @throws \\UnexpectedValueException\n     */\n    public function unmarshalValue(array $value, $mapAsObject = false)\n    {\n        $type = key($value);\n        $value = $value[$type];\n        switch ($type) {\n            case 'S':\n            case 'BOOL':\n                return $value;\n            case 'NULL':\n                return null;\n            case 'N':\n                if ($this->options['wrap_numbers']) {\n                    return new NumberValue($value);\n                }\n\n                // Use type coercion to unmarshal numbers to int/float.\n                return $value + 0;\n            case 'M':\n                if ($mapAsObject) {\n                    $data = new \\stdClass;\n                    foreach ($value as $k => $v) {\n                        $data->$k = $this->unmarshalValue($v, $mapAsObject);\n                    }\n                    return $data;\n                }\n                // NOBREAK: Unmarshal M the same way as L, for arrays.\n            case 'L':\n                foreach ($value as $k => $v) {\n                    $value[$k] = $this->unmarshalValue($v, $mapAsObject);\n                }\n                return $value;\n            case 'B':\n                return new BinaryValue($value);\n            case 'SS':\n            case 'NS':\n            case 'BS':\n                foreach ($value as $k => $v) {\n                    $value[$k] = $this->unmarshalValue([$type[0] => $v]);\n                }\n                return new SetValue($value);\n        }\n\n        throw new \\UnexpectedValueException(\"Unexpected type: {$type}.\");\n    }\n\n    /**\n     * Handle invalid value based on marshaler configuration.\n     *\n     * @param string $message Error message\n     *\n     * @return array|null\n     */\n    private function handleInvalid($message)\n    {\n        if ($this->options['ignore_invalid']) {\n            return null;\n        }\n\n        if ($this->options['nullify_invalid']) {\n            return ['NULL' => true];\n        }\n\n        throw new \\UnexpectedValueException(\"Marshaling error: {$message}.\");\n    }\n}\n", "num_lines": 321}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DynamoDb;\n\n/**\n * Special object to represent a DynamoDB Number (N) value.\n */\nclass NumberValue implements \\JsonSerializable\n{\n    /** @var string Number value. */\n    private $value;\n\n    /**\n     * @param string|int|float $value A number value.\n     */\n    public function __construct($value)\n    {\n        $this->value = (string) $value;\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function jsonSerialize()\n    {\n        return $this->value;\n    }\n\n    public function __toString()\n    {\n        return $this->value;\n    }\n}\n", "num_lines": 31}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DynamoDb;\n\ntrait SessionConnectionConfigTrait\n{\n    /** @var string Name of table to store the sessions */\n    protected $tableName = 'sessions';\n\n    /** @var string Name of hash key in table. Default: \"id\" */\n    protected $hashKey = 'id';\n\n    /** @var string Name of the data attribute in table. Default: \"data\" */\n    protected $dataAttribute = 'data';\n\n    /** @var string Type of the data attribute in table. Default: \"string\" */\n    protected $dataAttributeType = 'string';\n\n    /** @var integer Lifetime of inactive sessions expiration */\n    protected $sessionLifetime;\n\n    /** @var string Name of the session life time attribute in table. Default: \"expires\" */\n    protected $sessionLifetimeAttribute = 'expires';\n\n    /** @var string Whether or not to use consistent reads */\n    protected $consistentRead = true;\n\n    /** @var string Batch options used for garbage collection */\n    protected $batchConfig = [];\n\n    /** @var boolean Whether or not to use session locking */\n    protected $locking = false;\n\n    /** @var integer Max time (s) to wait for lock acquisition */\n    protected $maxLockWaitTime = 10;\n\n    /** @var integer Min time (\u00c2\u00b5s) to wait between lock attempts */\n    protected $minLockRetryMicrotime = 10000;\n\n    /** @var integer Max time (\u00c2\u00b5s) to wait between lock attempts */\n    protected $maxLockRetryMicrotime = 50000;\n\n    /**\n     * It initialize the Config class and\n     * it sets values in case of valid configurations.\n     * \n     * It transforms parameters underscore separated in camelcase \"this_is_a_test\" => ThisIsATest\n     * and it uses it in order to set the values.\n     * \n     * @param array $config\n     */\n    public function initConfig( array $config = [] )\n    {\n        if (!empty($config))\n        {\n            foreach ($config as $key => $value)\n            {\n                $method = 'set' . str_replace('_', '', ucwords($key, '_'));\n                if(method_exists($this,$method))\n                {\n                    call_user_func_array(array($this, $method), array($value));\n                }\n            }\n        }\n\n        // It applies the default PHP session lifetime, if no session lifetime config is provided\n        if(!isset($config['session_lifetime']))\n        {\n            $this->setSessionLifetime((int) ini_get('session.gc_maxlifetime'));\n        }\n    }\n\n    /**\n     * @return string\n     */\n    public function getTableName()\n    {\n        return $this->tableName;\n    }\n\n    /**\n     * @param string $tableName\n     */\n    public function setTableName($tableName)\n    {\n        $this->tableName = $tableName;\n    }\n\n    /**\n     * @return string\n     */\n    public function getHashKey()\n    {\n        return $this->hashKey;\n    }\n\n    /**\n     * @param string $hashKey\n     */\n    public function setHashKey($hashKey)\n    {\n        $this->hashKey = $hashKey;\n    }\n\n    /**\n     * @return string\n     */\n    public function getDataAttribute()\n    {\n        return $this->dataAttribute;\n    }\n\n    /**\n     * @param string $dataAttribute\n     */\n    public function setDataAttribute($dataAttribute)\n    {\n        $this->dataAttribute = $dataAttribute;\n    }\n\n    /**\n     * @return string\n     */\n    public function getDataAttributeType()\n    {\n        return $this->dataAttributeType;\n    }\n\n    /**\n     * @param string $dataAttributeType\n     */\n    public function setDataAttributeType($dataAttributeType)\n    {\n        $this->dataAttributeType = $dataAttributeType;\n    }\n\n    /**\n     * @return number\n     */\n    public function getSessionLifetime()\n    {\n        return $this->sessionLifetime;\n    }\n\n    /**\n     * @param number $sessionLifetime\n     */\n    public function setSessionLifetime($sessionLifetime)\n    {\n        $this->sessionLifetime = $sessionLifetime;\n    }\n\n    /**\n     * @return string\n     */\n    public function getSessionLifetimeAttribute()\n    {\n        return $this->sessionLifetimeAttribute;\n    }\n\n    /**\n     * @param string $sessionLifetimeAttribute\n     */\n    public function setSessionLifetimeAttribute($sessionLifetimeAttribute)\n    {\n        $this->sessionLifetimeAttribute = $sessionLifetimeAttribute;\n    }\n\n    /**\n     * @return boolean\n     */\n    public function isConsistentRead()\n    {\n        return $this->consistentRead;\n    }\n\n    /**\n     * @param boolean $consistentRead\n     */\n    public function setConsistentRead($consistentRead)\n    {\n        $this->consistentRead = $consistentRead;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getBatchConfig()\n    {\n        return $this->batchConfig;\n    }\n\n    /**\n     * @param mixed $batchConfig\n     */\n    public function setBatchConfig($batchConfig)\n    {\n        $this->batchConfig = $batchConfig;\n    }\n    /**\n     * @return boolean\n     */\n    public function isLocking()\n    {\n        return $this->locking;\n    }\n\n    /**\n     * @param boolean $locking\n     */\n    public function setLocking($locking)\n    {\n        $this->locking = $locking;\n    }\n\n    /**\n     * @return number\n     */\n    public function getMaxLockWaitTime()\n    {\n        return $this->maxLockWaitTime;\n    }\n\n    /**\n     * @param number $maxLockWaitTime\n     */\n    public function setMaxLockWaitTime($maxLockWaitTime)\n    {\n        $this->maxLockWaitTime = $maxLockWaitTime;\n    }\n\n    /**\n     * @return number\n     */\n    public function getMinLockRetryMicrotime()\n    {\n        return $this->minLockRetryMicrotime;\n    }\n\n    /**\n     * @param number $minLockRetryMicrotime\n     */\n    public function setMinLockRetryMicrotime($minLockRetryMicrotime)\n    {\n        $this->minLockRetryMicrotime = $minLockRetryMicrotime;\n    }\n\n    /**\n     * @return number\n     */\n    public function getMaxLockRetryMicrotime()\n    {\n        return $this->maxLockRetryMicrotime;\n    }\n\n    /**\n     * @param number $maxLockRetryMicrotime\n     */\n    public function setMaxLockRetryMicrotime($maxLockRetryMicrotime)\n    {\n        $this->maxLockRetryMicrotime = $maxLockRetryMicrotime;\n    }\n}\n", "num_lines": 263}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DynamoDb;\n\n/**\n * The session connection provides the underlying logic for interacting with\n * Amazon DynamoDB and performs all of the reading and writing operations.\n */\ninterface SessionConnectionInterface\n{\n    /**\n     * Reads session data from DynamoDB\n     *\n     * @param string $id Session ID\n     *\n     * @return array\n     */\n    public function read($id);\n\n    /**\n     * Writes session data to DynamoDB\n     *\n     * @param string $id        Session ID\n     * @param string $data      Serialized session data\n     * @param bool   $isChanged Whether or not the data has changed\n     *\n     * @return bool\n     */\n    public function write($id, $data, $isChanged);\n\n    /**\n     * Deletes session record from DynamoDB\n     *\n     * @param string $id Session ID\n     *\n     * @return bool\n     */\n    public function delete($id);\n\n    /**\n     * Performs garbage collection on the sessions stored in the DynamoDB\n     *\n     * @return bool\n     */\n    public function deleteExpired();\n}\n", "num_lines": 46}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DynamoDb;\n\n/**\n * Provides an interface for using Amazon DynamoDB as a session store by hooking\n * into PHP's session handler hooks. Once registered, You may use the native\n * `$_SESSION` superglobal and session functions, and the sessions will be\n * stored automatically in DynamoDB. DynamoDB is a great session storage\n * solution due to its speed, scalability, and fault tolerance.\n *\n * For maximum performance, we recommend that you keep the size of your sessions\n * small. Locking is disabled by default, since it can drive up latencies and\n * costs under high traffic. Only turn it on if you need it.\n *\n * By far, the most expensive operation is garbage collection. Therefore, we\n * encourage you to carefully consider your session garbage collection strategy.\n * Note: the DynamoDB Session Handler does not allow garbage collection to be\n * triggered randomly. You must run garbage collection manually or through other\n * automated means using a cron job or similar scheduling technique.\n */\nclass SessionHandler implements \\SessionHandlerInterface\n{\n    /** @var SessionConnectionInterface Session save logic.*/\n    private $connection;\n\n    /** @var string Session save path. */\n    private $savePath;\n\n    /** @var string Session name. */\n    private $sessionName;\n\n    /** @var string The last known session ID */\n    private $openSessionId = '';\n\n    /** @var string Stores serialized data for tracking changes. */\n    private $dataRead = '';\n\n    /** @var bool Keeps track of whether the session has been written. */\n    private $sessionWritten = false;\n\n    /**\n     * Creates a new DynamoDB Session Handler.\n     *\n     * The configuration array accepts the following array keys and values:\n     * - table_name:                    Name of table to store the sessions.\n     * - hash_key:                      Name of hash key in table. Default: \"id\".\n     * - data_attribute:                Name of the data attribute in table. Default: \"data\".\n     * - session_lifetime:              Lifetime of inactive sessions expiration.\n     * - session_lifetime_attribute:    Name of the session life time attribute in table. Default: \"expires\".\n     * - consistent_read:               Whether or not to use consistent reads.\n     * - batch_config:                  Batch options used for garbage collection.\n     * - locking:                       Whether or not to use session locking.\n     * - max_lock_wait_time:            Max time (s) to wait for lock acquisition.\n     * - min_lock_retry_microtime:      Min time (\u00c2\u00b5s) to wait between lock attempts.\n     * - max_lock_retry_microtime:      Max time (\u00c2\u00b5s) to wait between lock attempts.\n     *\n     * You can find the full list of parameters and defaults within the trait\n     * Aws\\DynamoDb\\SessionConnectionConfigTrait\n     *\n     * @param DynamoDbClient $client Client for doing DynamoDB operations\n     * @param array          $config Configuration for the Session Handler\n     *\n     * @return SessionHandler\n     */\n    public static function fromClient(DynamoDbClient $client, array $config = [])\n    {\n        $config += ['locking' => false];\n        if ($config['locking']) {\n            $connection = new LockingSessionConnection($client, $config);\n        } else {\n            $connection = new StandardSessionConnection($client, $config);\n        }\n\n        return new static($connection);\n    }\n\n    /**\n     * @param SessionConnectionInterface $connection\n     */\n    public function __construct(SessionConnectionInterface $connection)\n    {\n        $this->connection = $connection;\n    }\n\n    /**\n     * Register the DynamoDB session handler.\n     *\n     * @return bool Whether or not the handler was registered.\n     * @codeCoverageIgnore\n     */\n    public function register()\n    {\n         return session_set_save_handler($this, true);\n    }\n\n    /**\n     * Open a session for writing. Triggered by session_start().\n     *\n     * @param string $savePath    Session save path.\n     * @param string $sessionName Session name.\n     *\n     * @return bool Whether or not the operation succeeded.\n     */\n     #[\\ReturnTypeWillChange]\n    public function open($savePath, $sessionName)\n    {\n        $this->savePath = $savePath;\n        $this->sessionName = $sessionName;\n\n        return true;\n    }\n\n    /**\n     * Close a session from writing.\n     *\n     * @return bool Success\n     */\n     #[\\ReturnTypeWillChange]\n    public function close()\n    {\n        $id = session_id();\n        // Make sure the session is unlocked and the expiration time is updated,\n        // even if the write did not occur\n        if ($this->openSessionId !== $id || !$this->sessionWritten) {\n            $result = $this->connection->write($this->formatId($id), '', false);\n            $this->sessionWritten = (bool) $result;\n        }\n\n        return $this->sessionWritten;\n    }\n\n    /**\n     * Read a session stored in DynamoDB.\n     *\n     * @param string $id Session ID.\n     *\n     * @return string Session data.\n     */\n     #[\\ReturnTypeWillChange]\n    public function read($id)\n    {\n        $this->openSessionId = $id;\n        // PHP expects an empty string to be returned from this method if no\n        // data is retrieved\n        $this->dataRead = '';\n\n        // Get session data using the selected locking strategy\n        $item = $this->connection->read($this->formatId($id));\n\n        $dataAttribute = $this->connection->getDataAttribute();\n        $sessionLifetimeAttribute = $this->connection->getSessionLifetimeAttribute();\n\n        // Return the data if it is not expired. If it is expired, remove it\n        if (isset($item[$sessionLifetimeAttribute]) && isset($item[$dataAttribute])) {\n            $this->dataRead = $item[$dataAttribute];\n            if ($item[$sessionLifetimeAttribute] <= time()) {\n                $this->dataRead = '';\n                $this->destroy($id);\n            }\n        }\n\n        return $this->dataRead;\n    }\n\n    /**\n     * Write a session to DynamoDB.\n     *\n     * @param string $id   Session ID.\n     * @param string $data Serialized session data to write.\n     *\n     * @return bool Whether or not the operation succeeded.\n     */\n     #[\\ReturnTypeWillChange]\n    public function write($id, $data)\n    {\n        $changed = $id !== $this->openSessionId\n            || $data !== $this->dataRead;\n        $this->openSessionId = $id;\n\n        // Write the session data using the selected locking strategy\n        $this->sessionWritten = $this->connection\n            ->write($this->formatId($id), $data, $changed);\n\n        return $this->sessionWritten;\n    }\n\n    /**\n     * Delete a session stored in DynamoDB.\n     *\n     * @param string $id Session ID.\n     *\n     * @return bool Whether or not the operation succeeded.\n     */\n     #[\\ReturnTypeWillChange]\n    public function destroy($id)\n    {\n        $this->openSessionId = $id;\n        // Delete the session data using the selected locking strategy\n        $this->sessionWritten\n            = $this->connection->delete($this->formatId($id));\n\n        return $this->sessionWritten;\n    }\n\n    /**\n     * Satisfies the session handler interface, but does nothing. To do garbage\n     * collection, you must manually call the garbageCollect() method.\n     *\n     * @param int $maxLifetime Ignored.\n     *\n     * @return bool Whether or not the operation succeeded.\n     * @codeCoverageIgnore\n     */\n     #[\\ReturnTypeWillChange]\n    public function gc($maxLifetime)\n    {\n        // Garbage collection for a DynamoDB table must be triggered manually.\n        return true;\n    }\n\n    /**\n     * Triggers garbage collection on expired sessions.\n     * @codeCoverageIgnore\n     */\n    public function garbageCollect()\n    {\n        $this->connection->deleteExpired();\n    }\n\n    /**\n     * Prepend the session ID with the session name.\n     *\n     * @param string $id The session ID.\n     *\n     * @return string Prepared session ID.\n     */\n    private function formatId($id)\n    {\n        return trim($this->sessionName . '_' . $id, '_');\n    }\n}\n", "num_lines": 242}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DynamoDb;\n\n/**\n * Special object to represent a DynamoDB set (SS/NS/BS) value.\n */\nclass SetValue implements \\JsonSerializable, \\Countable, \\IteratorAggregate\n{\n    /** @var array Values in the set as provided. */\n    private $values;\n\n    /**\n     * @param array  $values Values in the set.\n     */\n    public function __construct(array $values)\n    {\n        $this->values = $values;\n    }\n\n    /**\n     * Get the values formatted for PHP and JSON.\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        return $this->values;\n    }\n\n    /**\n     * @return int\n     */\n    #[\\ReturnTypeWillChange]\n    public function count()\n    {\n        return count($this->values);\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function getIterator()\n    {\n        return new \\ArrayIterator($this->values);\n    }\n\n    #[\\ReturnTypeWillChange]\n    public function jsonSerialize()\n    {\n        return $this->toArray();\n    }\n}\n", "num_lines": 51}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DynamoDb;\n\nuse Aws\\DynamoDb\\Exception\\DynamoDbException;\n\n/**\n * The standard connection performs the read and write operations to DynamoDB.\n */\nclass StandardSessionConnection implements SessionConnectionInterface\n{\n    use SessionConnectionConfigTrait;\n    \n    /** @var DynamoDbClient The DynamoDB client */\n    protected $client;\n    \n    /**\n     * @param DynamoDbClient    $client DynamoDB client\n     * @param array             $config Session handler config\n     */\n    public function __construct(DynamoDbClient $client, array $config = [])\n    {\n        $this->client = $client;\n        $this->initConfig($config);\n    }\n\n    public function read($id)\n    {\n        $item = [];\n        try {\n            // Execute a GetItem command to retrieve the item.\n            $result = $this->client->getItem([\n                 'TableName'      => $this->getTableName(),\n                 'Key'            => $this->formatKey($id),\n                 'ConsistentRead' => $this->isConsistentRead(),\n             ]);\n\n            // Get the item values\n            $result = isset($result['Item']) ? $result['Item'] : [];\n            foreach ($result as $key => $value) {\n                $item[$key] = current($value);\n            }\n        } catch (DynamoDbException $e) {\n            // Could not retrieve item, so return nothing.\n        }\n\n        return $item;\n    }\n\n    public function write($id, $data, $isChanged)\n    {\n        // Prepare the attributes\n        $expires = time() + $this->getSessionLifetime();\n        $attributes = [\n            $this->getSessionLifetimeAttribute() => ['Value' => ['N' => (string) $expires]],\n            'lock' => ['Action' => 'DELETE'],\n        ];\n        if ($isChanged) {\n            if ($data != '') {\n                $type = $this->getDataAttributeType();\n                if ($type == 'binary') {\n                    $attributes[$this->getDataAttribute()] = ['Value' => ['B' => $data]];\n                } else {\n                    $attributes[$this->getDataAttribute()] = ['Value' => ['S' => $data]];\n                }\n\n            } else {\n                $attributes[$this->getDataAttribute()] = ['Action' => 'DELETE'];\n            }\n        }\n\n        // Perform the UpdateItem command\n        try {\n            return (bool) $this->client->updateItem([\n                'TableName'        => $this->getTableName(),\n                'Key'              => $this->formatKey($id),\n                'AttributeUpdates' => $attributes,\n            ]);\n        } catch (DynamoDbException $e) {\n            return $this->triggerError(\"Error writing session $id: {$e->getMessage()}\");\n        }\n    }\n\n    public function delete($id)\n    {\n        try {\n            return (bool) $this->client->deleteItem([\n                'TableName' => $this->getTableName(),\n                'Key'       => $this->formatKey($id),\n            ]);\n        } catch (DynamoDbException $e) {\n            return $this->triggerError(\"Error deleting session $id: {$e->getMessage()}\");\n        }\n    }\n\n    public function deleteExpired()\n    {\n        // Create a Scan iterator for finding expired session items\n        $scan = $this->client->getPaginator('Scan', [\n            'TableName' => $this->getTableName(),\n            'AttributesToGet' => [$this->getHashKey()],\n            'ScanFilter' => [\n                $this->getSessionLifetimeAttribute() => [\n                    'ComparisonOperator' => 'LT',\n                    'AttributeValueList' => [['N' => (string) time()]],\n                ],\n                'lock' => [\n                    'ComparisonOperator' => 'NULL',\n                ]\n            ],\n        ]);\n\n        // Create a WriteRequestBatch for deleting the expired items\n        $batch = new WriteRequestBatch($this->client, $this->getBatchConfig());\n\n        // Perform Scan and BatchWriteItem (delete) operations as needed\n        foreach ($scan->search('Items') as $item) {\n            $batch->delete(\n                [$this->getHashKey() => $item[$this->getHashKey()]],\n                $this->getTableName()\n            );\n        }\n\n        // Delete any remaining items that were not auto-flushed\n        $batch->flush();\n    }\n\n    /**\n     * @param string $key\n     *\n     * @return array\n     */\n    protected function formatKey($key)\n    {\n        return [$this->getHashKey() => ['S' => $key]];\n    }\n\n    /**\n     * @param string $error\n     *\n     * @return bool\n     */\n    protected function triggerError($error)\n    {\n        trigger_error($error, E_USER_WARNING);\n\n        return false;\n    }\n}\n", "num_lines": 149}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DynamoDb;\n\nuse Aws\\CommandInterface;\nuse Aws\\CommandPool;\nuse Aws\\Exception\\AwsException;\nuse Aws\\ResultInterface;\n\n/**\n * The WriteRequestBatch is an object that is capable of efficiently sending\n * DynamoDB BatchWriteItem requests from queued up put and delete item requests.\n * requests. The batch attempts to send the requests with the fewest requests\n * to DynamoDB as possible and also re-queues any unprocessed items to ensure\n * that all items are sent.\n */\nclass WriteRequestBatch\n{\n    /** @var DynamoDbClient DynamoDB client used to perform write operations. */\n    private $client;\n\n    /** @var array Configuration options for the batch. */\n    private $config;\n\n    /** @var array Queue of pending put/delete requests in the batch. */\n    private $queue;\n\n    /**\n     * Creates a WriteRequestBatch object that is capable of efficiently sending\n     * DynamoDB BatchWriteItem requests from queued up Put and Delete requests.\n     *\n     * @param DynamoDbClient $client DynamoDB client used to send batches.\n     * @param array          $config Batch configuration options.\n     *     - table: (string) DynamoDB table used by the batch, this can be\n     *       overridden for each individual put() or delete() call.\n     *     - batch_size: (int) The size of each batch (default: 25). The batch\n     *       size must be between 2 and 25. If you are sending batches of large\n     *       items, you may consider lowering the batch size, otherwise, you\n     *       should use 25.\n     *     - pool_size: (int) This number dictates how many BatchWriteItem\n     *       requests you would like to do in parallel. For example, if the\n     *       \"batch_size\" is 25, and \"pool_size\" is 3, then you would send 3\n     *       BatchWriteItem requests at a time, each with 25 items. Please keep\n     *       your throughput in mind when choosing the \"pool_size\" option.\n     *     - autoflush: (bool) This option allows the batch to automatically\n     *       flush once there are enough items (i.e., \"batch_size\" * \"pool_size\")\n     *       in the queue. This defaults to true, so you must set this to false\n     *       to stop autoflush.\n     *     - before: (callable) Executed before every BatchWriteItem operation.\n     *       It should accept an \\Aws\\CommandInterface object as its argument.\n     *     - error: Executed if an error was encountered executing a,\n     *       BatchWriteItem operation, otherwise errors are ignored. It should\n     *       accept an \\Aws\\Exception\\AwsException as its argument.\n     *\n     * @throws \\InvalidArgumentException if the batch size is not between 2 and 25.\n     */\n    public function __construct(DynamoDbClient $client, array $config = [])\n    {\n        // Apply defaults\n        $config += [\n            'table'      => null,\n            'batch_size' => 25,\n            'pool_size'  => 1,\n            'autoflush'  => true,\n            'before'     => null,\n            'error'      => null\n        ];\n\n        // Ensure the batch size is valid\n        if ($config['batch_size'] > 25 || $config['batch_size'] < 2) {\n            throw new \\InvalidArgumentException('\"batch_size\" must be between 2 and 25.');\n        }\n\n        // Ensure the callbacks are valid\n        if ($config['before'] && !is_callable($config['before'])) {\n            throw new \\InvalidArgumentException('\"before\" must be callable.');\n        }\n        if ($config['error'] && !is_callable($config['error'])) {\n            throw new \\InvalidArgumentException('\"error\" must be callable.');\n        }\n\n        // If autoflush is enabled, set the threshold\n        if ($config['autoflush']) {\n            $config['threshold'] = $config['batch_size'] * $config['pool_size'];\n        }\n\n        $this->client = $client;\n        $this->config = $config;\n        $this->queue = [];\n    }\n\n    /**\n     * Adds a put item request to the batch.\n     *\n     * @param array       $item  Data for an item to put. Format:\n     *     [\n     *         'attribute1' => ['type' => 'value'],\n     *         'attribute2' => ['type' => 'value'],\n     *         ...\n     *     ]\n     * @param string|null $table The name of the table. This must be specified\n     *                           unless the \"table\" option was provided in the\n     *                           config of the WriteRequestBatch.\n     *\n     * @return $this\n     */\n    public function put(array $item, $table = null)\n    {\n        $this->queue[] = [\n            'table' => $this->determineTable($table),\n            'data'  => ['PutRequest' => ['Item' => $item]],\n        ];\n\n        $this->autoFlush();\n\n        return $this;\n    }\n\n    /**\n     * Adds a delete item request to the batch.\n     *\n     * @param array       $key   Key of an item to delete. Format:\n     *     [\n     *         'key1' => ['type' => 'value'],\n     *         ...\n     *     ]\n     * @param string|null $table The name of the table. This must be specified\n     *                           unless the \"table\" option was provided in the\n     *                           config of the WriteRequestBatch.\n     *\n     * @return $this\n     */\n    public function delete(array $key, $table = null)\n    {\n        $this->queue[] = [\n            'table' => $this->determineTable($table),\n            'data'  => ['DeleteRequest' => ['Key' => $key]],\n        ];\n\n        $this->autoFlush();\n\n        return $this;\n    }\n\n    /**\n     * Flushes the batch by combining all the queued put and delete requests\n     * into BatchWriteItem commands and executing them. Unprocessed items are\n     * automatically re-queued.\n     *\n     * @param bool $untilEmpty If true, flushing will continue until the queue\n     *                         is completely empty. This will make sure that\n     *                         unprocessed items are all eventually sent.\n     *\n     * @return $this\n     */\n    public function flush($untilEmpty = true)\n    {\n        // Send BatchWriteItem requests until the queue is empty\n        $keepFlushing = true;\n        while ($this->queue && $keepFlushing) {\n            $commands = $this->prepareCommands();\n            $pool = new CommandPool($this->client, $commands, [\n                'before' => $this->config['before'],\n                'concurrency' => $this->config['pool_size'],\n                'fulfilled'   => function (ResultInterface $result) {\n                    // Re-queue any unprocessed items\n                    if ($result->hasKey('UnprocessedItems')) {\n                        $this->retryUnprocessed($result['UnprocessedItems']);\n                    }\n                },\n                'rejected' => function ($reason) {\n                    if ($reason instanceof AwsException) {\n                        $code = $reason->getAwsErrorCode();\n                        if ($code === 'ProvisionedThroughputExceededException') {\n                            $this->retryUnprocessed($reason->getCommand()['RequestItems']);\n                        } elseif (is_callable($this->config['error'])) {\n                            $this->config['error']($reason);\n                        }\n                    }\n                }\n            ]);\n            $pool->promise()->wait();\n            $keepFlushing = (bool) $untilEmpty;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Creates BatchWriteItem commands from the items in the queue.\n     *\n     * @return CommandInterface[]\n     */\n    private function prepareCommands()\n    {\n        // Chunk the queue into batches\n        $batches = array_chunk($this->queue, $this->config['batch_size']);\n        $this->queue = [];\n\n        // Create BatchWriteItem commands for each batch\n        $commands = [];\n        foreach ($batches as $batch) {\n            $requests = [];\n            foreach ($batch as $item) {\n                if (!isset($requests[$item['table']])) {\n                    $requests[$item['table']] = [];\n                }\n                $requests[$item['table']][] = $item['data'];\n            }\n            $commands[] = $this->client->getCommand(\n                'BatchWriteItem',\n                ['RequestItems' => $requests]\n            );\n        }\n\n        return $commands;\n    }\n\n    /**\n     * Re-queues unprocessed results with the correct data.\n     *\n     * @param array $unprocessed Unprocessed items from a result.\n     */\n    private function retryUnprocessed(array $unprocessed)\n    {\n        foreach ($unprocessed as $table => $requests) {\n            foreach ($requests as $request) {\n                $this->queue[] = [\n                    'table' => $table,\n                    'data'  => $request,\n                ];\n            }\n        }\n    }\n\n    /**\n     * If autoflush is enabled and the threshold is met, flush the batch\n     */\n    private function autoFlush()\n    {\n        if ($this->config['autoflush']\n            && count($this->queue) >= $this->config['threshold']\n        ) {\n            // Flush only once. Unprocessed items are handled in a later flush.\n            $this->flush(false);\n        }\n    }\n\n    /**\n     * Determine the table name by looking at what was provided and what the\n     * WriteRequestBatch was originally configured with.\n     *\n     * @param string|null $table The table name.\n     *\n     * @return string\n     * @throws \\RuntimeException if there was no table specified.\n     */\n    private function determineTable($table)\n    {\n        $table = $table ?: $this->config['table'];\n        if (!$table) {\n            throw new \\RuntimeException('There was no table specified.');\n        }\n\n        return $table;\n    }\n}\n", "num_lines": 267}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DynamoDb\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon DynamoDB service.\n */\nclass DynamoDbException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DynamoDbStreams;\n\nuse Aws\\AwsClient;\nuse Aws\\DynamoDb\\DynamoDbClient;\n\n/**\n * This client is used to interact with the **Amazon DynamoDb Streams** service.\n *\n * @method \\Aws\\Result describeStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStreamAsync(array $args = [])\n * @method \\Aws\\Result getRecords(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRecordsAsync(array $args = [])\n * @method \\Aws\\Result getShardIterator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getShardIteratorAsync(array $args = [])\n * @method \\Aws\\Result listStreams(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStreamsAsync(array $args = [])\n */\nclass DynamoDbStreamsClient extends AwsClient\n{\n    public static function getArguments()\n    {\n        $args = parent::getArguments();\n        $args['retries']['default'] = 11;\n        $args['retries']['fn'] = [DynamoDbClient::class, '_applyRetryConfig'];\n\n        return $args;\n    }\n}", "num_lines": 29}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\DynamoDbStreams\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon DynamoDB Streams service.\n */\nclass DynamoDbStreamsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EBS;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Elastic Block Store** service.\n * @method \\Aws\\Result completeSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise completeSnapshotAsync(array $args = [])\n * @method \\Aws\\Result getSnapshotBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSnapshotBlockAsync(array $args = [])\n * @method \\Aws\\Result listChangedBlocks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChangedBlocksAsync(array $args = [])\n * @method \\Aws\\Result listSnapshotBlocks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSnapshotBlocksAsync(array $args = [])\n * @method \\Aws\\Result putSnapshotBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSnapshotBlockAsync(array $args = [])\n * @method \\Aws\\Result startSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSnapshotAsync(array $args = [])\n */\nclass EBSClient extends AwsClient {}\n", "num_lines": 22}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EBS\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Elastic Block Store** service.\n */\nclass EBSException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Ec2;\n\nuse Aws\\AwsClient;\nuse Aws\\Api\\Service;\nuse Aws\\Api\\DocModel;\nuse Aws\\Api\\ApiProvider;\nuse Aws\\PresignUrlMiddleware;\n\n/**\n * Client used to interact with Amazon EC2.\n *\n * @method \\Aws\\Result acceptVpcPeeringConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptVpcPeeringConnectionAsync(array $args = [])\n * @method \\Aws\\Result allocateAddress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise allocateAddressAsync(array $args = [])\n * @method \\Aws\\Result allocateHosts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise allocateHostsAsync(array $args = [])\n * @method \\Aws\\Result assignPrivateIpAddresses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise assignPrivateIpAddressesAsync(array $args = [])\n * @method \\Aws\\Result associateAddress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateAddressAsync(array $args = [])\n * @method \\Aws\\Result associateDhcpOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateDhcpOptionsAsync(array $args = [])\n * @method \\Aws\\Result associateRouteTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateRouteTableAsync(array $args = [])\n * @method \\Aws\\Result attachClassicLinkVpc(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachClassicLinkVpcAsync(array $args = [])\n * @method \\Aws\\Result attachInternetGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachInternetGatewayAsync(array $args = [])\n * @method \\Aws\\Result attachNetworkInterface(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachNetworkInterfaceAsync(array $args = [])\n * @method \\Aws\\Result attachVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachVolumeAsync(array $args = [])\n * @method \\Aws\\Result attachVpnGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachVpnGatewayAsync(array $args = [])\n * @method \\Aws\\Result authorizeSecurityGroupEgress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise authorizeSecurityGroupEgressAsync(array $args = [])\n * @method \\Aws\\Result authorizeSecurityGroupIngress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise authorizeSecurityGroupIngressAsync(array $args = [])\n * @method \\Aws\\Result bundleInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise bundleInstanceAsync(array $args = [])\n * @method \\Aws\\Result cancelBundleTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelBundleTaskAsync(array $args = [])\n * @method \\Aws\\Result cancelConversionTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelConversionTaskAsync(array $args = [])\n * @method \\Aws\\Result cancelExportTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelExportTaskAsync(array $args = [])\n * @method \\Aws\\Result cancelImportTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelImportTaskAsync(array $args = [])\n * @method \\Aws\\Result cancelReservedInstancesListing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelReservedInstancesListingAsync(array $args = [])\n * @method \\Aws\\Result cancelSpotFleetRequests(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelSpotFleetRequestsAsync(array $args = [])\n * @method \\Aws\\Result cancelSpotInstanceRequests(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelSpotInstanceRequestsAsync(array $args = [])\n * @method \\Aws\\Result confirmProductInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise confirmProductInstanceAsync(array $args = [])\n * @method \\Aws\\Result copyImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyImageAsync(array $args = [])\n * @method \\Aws\\Result copySnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copySnapshotAsync(array $args = [])\n * @method \\Aws\\Result createCustomerGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCustomerGatewayAsync(array $args = [])\n * @method \\Aws\\Result createDhcpOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDhcpOptionsAsync(array $args = [])\n * @method \\Aws\\Result createFlowLogs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFlowLogsAsync(array $args = [])\n * @method \\Aws\\Result createImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createImageAsync(array $args = [])\n * @method \\Aws\\Result createInstanceExportTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInstanceExportTaskAsync(array $args = [])\n * @method \\Aws\\Result createInternetGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInternetGatewayAsync(array $args = [])\n * @method \\Aws\\Result createKeyPair(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createKeyPairAsync(array $args = [])\n * @method \\Aws\\Result createNatGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNatGatewayAsync(array $args = [])\n * @method \\Aws\\Result createNetworkAcl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNetworkAclAsync(array $args = [])\n * @method \\Aws\\Result createNetworkAclEntry(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNetworkAclEntryAsync(array $args = [])\n * @method \\Aws\\Result createNetworkInterface(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNetworkInterfaceAsync(array $args = [])\n * @method \\Aws\\Result createPlacementGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPlacementGroupAsync(array $args = [])\n * @method \\Aws\\Result createReservedInstancesListing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReservedInstancesListingAsync(array $args = [])\n * @method \\Aws\\Result createRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRouteAsync(array $args = [])\n * @method \\Aws\\Result createRouteTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRouteTableAsync(array $args = [])\n * @method \\Aws\\Result createSecurityGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSecurityGroupAsync(array $args = [])\n * @method \\Aws\\Result createSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createSpotDatafeedSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSpotDatafeedSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result createSubnet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSubnetAsync(array $args = [])\n * @method \\Aws\\Result createTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTagsAsync(array $args = [])\n * @method \\Aws\\Result createVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVolumeAsync(array $args = [])\n * @method \\Aws\\Result createVpc(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpcAsync(array $args = [])\n * @method \\Aws\\Result createVpcEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpcEndpointAsync(array $args = [])\n * @method \\Aws\\Result createVpcPeeringConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpcPeeringConnectionAsync(array $args = [])\n * @method \\Aws\\Result createVpnConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpnConnectionAsync(array $args = [])\n * @method \\Aws\\Result createVpnConnectionRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpnConnectionRouteAsync(array $args = [])\n * @method \\Aws\\Result createVpnGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpnGatewayAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomerGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomerGatewayAsync(array $args = [])\n * @method \\Aws\\Result deleteDhcpOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDhcpOptionsAsync(array $args = [])\n * @method \\Aws\\Result deleteFlowLogs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFlowLogsAsync(array $args = [])\n * @method \\Aws\\Result deleteInternetGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInternetGatewayAsync(array $args = [])\n * @method \\Aws\\Result deleteKeyPair(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteKeyPairAsync(array $args = [])\n * @method \\Aws\\Result deleteNatGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNatGatewayAsync(array $args = [])\n * @method \\Aws\\Result deleteNetworkAcl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNetworkAclAsync(array $args = [])\n * @method \\Aws\\Result deleteNetworkAclEntry(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNetworkAclEntryAsync(array $args = [])\n * @method \\Aws\\Result deleteNetworkInterface(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNetworkInterfaceAsync(array $args = [])\n * @method \\Aws\\Result deletePlacementGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePlacementGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRouteAsync(array $args = [])\n * @method \\Aws\\Result deleteRouteTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRouteTableAsync(array $args = [])\n * @method \\Aws\\Result deleteSecurityGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSecurityGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteSpotDatafeedSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSpotDatafeedSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result deleteSubnet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSubnetAsync(array $args = [])\n * @method \\Aws\\Result deleteTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTagsAsync(array $args = [])\n * @method \\Aws\\Result deleteVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVolumeAsync(array $args = [])\n * @method \\Aws\\Result deleteVpc(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpcAsync(array $args = [])\n * @method \\Aws\\Result deleteVpcEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpcEndpointsAsync(array $args = [])\n * @method \\Aws\\Result deleteVpcPeeringConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpcPeeringConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteVpnConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpnConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteVpnConnectionRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpnConnectionRouteAsync(array $args = [])\n * @method \\Aws\\Result deleteVpnGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpnGatewayAsync(array $args = [])\n * @method \\Aws\\Result deregisterImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterImageAsync(array $args = [])\n * @method \\Aws\\Result describeAccountAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountAttributesAsync(array $args = [])\n * @method \\Aws\\Result describeAddresses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAddressesAsync(array $args = [])\n * @method \\Aws\\Result describeAvailabilityZones(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAvailabilityZonesAsync(array $args = [])\n * @method \\Aws\\Result describeBundleTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBundleTasksAsync(array $args = [])\n * @method \\Aws\\Result describeClassicLinkInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClassicLinkInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeConversionTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConversionTasksAsync(array $args = [])\n * @method \\Aws\\Result describeCustomerGateways(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCustomerGatewaysAsync(array $args = [])\n * @method \\Aws\\Result describeDhcpOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDhcpOptionsAsync(array $args = [])\n * @method \\Aws\\Result describeExportTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeExportTasksAsync(array $args = [])\n * @method \\Aws\\Result describeFlowLogs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFlowLogsAsync(array $args = [])\n * @method \\Aws\\Result describeHosts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHostsAsync(array $args = [])\n * @method \\Aws\\Result describeIdFormat(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeIdFormatAsync(array $args = [])\n * @method \\Aws\\Result describeImageAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImageAttributeAsync(array $args = [])\n * @method \\Aws\\Result describeImages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImagesAsync(array $args = [])\n * @method \\Aws\\Result describeImportImageTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImportImageTasksAsync(array $args = [])\n * @method \\Aws\\Result describeImportSnapshotTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImportSnapshotTasksAsync(array $args = [])\n * @method \\Aws\\Result describeInstanceAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceAttributeAsync(array $args = [])\n * @method \\Aws\\Result describeInstanceStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceStatusAsync(array $args = [])\n * @method \\Aws\\Result describeInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeInternetGateways(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInternetGatewaysAsync(array $args = [])\n * @method \\Aws\\Result describeKeyPairs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeKeyPairsAsync(array $args = [])\n * @method \\Aws\\Result describeMovingAddresses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMovingAddressesAsync(array $args = [])\n * @method \\Aws\\Result describeNatGateways(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNatGatewaysAsync(array $args = [])\n * @method \\Aws\\Result describeNetworkAcls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNetworkAclsAsync(array $args = [])\n * @method \\Aws\\Result describeNetworkInterfaceAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNetworkInterfaceAttributeAsync(array $args = [])\n * @method \\Aws\\Result describeNetworkInterfaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNetworkInterfacesAsync(array $args = [])\n * @method \\Aws\\Result describePlacementGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePlacementGroupsAsync(array $args = [])\n * @method \\Aws\\Result describePrefixLists(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePrefixListsAsync(array $args = [])\n * @method \\Aws\\Result describeRegions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRegionsAsync(array $args = [])\n * @method \\Aws\\Result describeReservedInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeReservedInstancesListings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedInstancesListingsAsync(array $args = [])\n * @method \\Aws\\Result describeReservedInstancesModifications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedInstancesModificationsAsync(array $args = [])\n * @method \\Aws\\Result describeReservedInstancesOfferings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedInstancesOfferingsAsync(array $args = [])\n * @method \\Aws\\Result describeRouteTables(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRouteTablesAsync(array $args = [])\n * @method \\Aws\\Result describeScheduledInstanceAvailability(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScheduledInstanceAvailabilityAsync(array $args = [])\n * @method \\Aws\\Result describeScheduledInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScheduledInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeSecurityGroupReferences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSecurityGroupReferencesAsync(array $args = [])\n * @method \\Aws\\Result describeSecurityGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSecurityGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeSnapshotAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSnapshotAttributeAsync(array $args = [])\n * @method \\Aws\\Result describeSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result describeSpotDatafeedSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSpotDatafeedSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result describeSpotFleetInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSpotFleetInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeSpotFleetRequestHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSpotFleetRequestHistoryAsync(array $args = [])\n * @method \\Aws\\Result describeSpotFleetRequests(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSpotFleetRequestsAsync(array $args = [])\n * @method \\Aws\\Result describeSpotInstanceRequests(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSpotInstanceRequestsAsync(array $args = [])\n * @method \\Aws\\Result describeSpotPriceHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSpotPriceHistoryAsync(array $args = [])\n * @method \\Aws\\Result describeStaleSecurityGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStaleSecurityGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeSubnets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSubnetsAsync(array $args = [])\n * @method \\Aws\\Result describeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTagsAsync(array $args = [])\n * @method \\Aws\\Result describeVolumeAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVolumeAttributeAsync(array $args = [])\n * @method \\Aws\\Result describeVolumeStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVolumeStatusAsync(array $args = [])\n * @method \\Aws\\Result describeVolumes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVolumesAsync(array $args = [])\n * @method \\Aws\\Result describeVpcAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcAttributeAsync(array $args = [])\n * @method \\Aws\\Result describeVpcClassicLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcClassicLinkAsync(array $args = [])\n * @method \\Aws\\Result describeVpcClassicLinkDnsSupport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcClassicLinkDnsSupportAsync(array $args = [])\n * @method \\Aws\\Result describeVpcEndpointServices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcEndpointServicesAsync(array $args = [])\n * @method \\Aws\\Result describeVpcEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcEndpointsAsync(array $args = [])\n * @method \\Aws\\Result describeVpcPeeringConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcPeeringConnectionsAsync(array $args = [])\n * @method \\Aws\\Result describeVpcs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcsAsync(array $args = [])\n * @method \\Aws\\Result describeVpnConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVpnConnectionsAsync(array $args = [])\n * @method \\Aws\\Result describeVpnGateways(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVpnGatewaysAsync(array $args = [])\n * @method \\Aws\\Result detachClassicLinkVpc(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachClassicLinkVpcAsync(array $args = [])\n * @method \\Aws\\Result detachInternetGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachInternetGatewayAsync(array $args = [])\n * @method \\Aws\\Result detachNetworkInterface(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachNetworkInterfaceAsync(array $args = [])\n * @method \\Aws\\Result detachVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachVolumeAsync(array $args = [])\n * @method \\Aws\\Result detachVpnGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachVpnGatewayAsync(array $args = [])\n * @method \\Aws\\Result disableVgwRoutePropagation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableVgwRoutePropagationAsync(array $args = [])\n * @method \\Aws\\Result disableVpcClassicLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableVpcClassicLinkAsync(array $args = [])\n * @method \\Aws\\Result disableVpcClassicLinkDnsSupport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableVpcClassicLinkDnsSupportAsync(array $args = [])\n * @method \\Aws\\Result disassociateAddress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateAddressAsync(array $args = [])\n * @method \\Aws\\Result disassociateRouteTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateRouteTableAsync(array $args = [])\n * @method \\Aws\\Result enableVgwRoutePropagation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableVgwRoutePropagationAsync(array $args = [])\n * @method \\Aws\\Result enableVolumeIO(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableVolumeIOAsync(array $args = [])\n * @method \\Aws\\Result enableVpcClassicLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableVpcClassicLinkAsync(array $args = [])\n * @method \\Aws\\Result enableVpcClassicLinkDnsSupport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableVpcClassicLinkDnsSupportAsync(array $args = [])\n * @method \\Aws\\Result getConsoleOutput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConsoleOutputAsync(array $args = [])\n * @method \\Aws\\Result getConsoleScreenshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConsoleScreenshotAsync(array $args = [])\n * @method \\Aws\\Result getPasswordData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPasswordDataAsync(array $args = [])\n * @method \\Aws\\Result importImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importImageAsync(array $args = [])\n * @method \\Aws\\Result importInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importInstanceAsync(array $args = [])\n * @method \\Aws\\Result importKeyPair(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importKeyPairAsync(array $args = [])\n * @method \\Aws\\Result importSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importSnapshotAsync(array $args = [])\n * @method \\Aws\\Result importVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importVolumeAsync(array $args = [])\n * @method \\Aws\\Result modifyHosts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyHostsAsync(array $args = [])\n * @method \\Aws\\Result modifyIdFormat(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyIdFormatAsync(array $args = [])\n * @method \\Aws\\Result modifyImageAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyImageAttributeAsync(array $args = [])\n * @method \\Aws\\Result modifyInstanceAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyInstanceAttributeAsync(array $args = [])\n * @method \\Aws\\Result modifyInstancePlacement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyInstancePlacementAsync(array $args = [])\n * @method \\Aws\\Result modifyNetworkInterfaceAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyNetworkInterfaceAttributeAsync(array $args = [])\n * @method \\Aws\\Result modifyReservedInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyReservedInstancesAsync(array $args = [])\n * @method \\Aws\\Result modifySnapshotAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifySnapshotAttributeAsync(array $args = [])\n * @method \\Aws\\Result modifySpotFleetRequest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifySpotFleetRequestAsync(array $args = [])\n * @method \\Aws\\Result modifySubnetAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifySubnetAttributeAsync(array $args = [])\n * @method \\Aws\\Result modifyVolumeAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyVolumeAttributeAsync(array $args = [])\n * @method \\Aws\\Result modifyVpcAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyVpcAttributeAsync(array $args = [])\n * @method \\Aws\\Result modifyVpcEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyVpcEndpointAsync(array $args = [])\n * @method \\Aws\\Result modifyVpcPeeringConnectionOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyVpcPeeringConnectionOptionsAsync(array $args = [])\n * @method \\Aws\\Result monitorInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise monitorInstancesAsync(array $args = [])\n * @method \\Aws\\Result moveAddressToVpc(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise moveAddressToVpcAsync(array $args = [])\n * @method \\Aws\\Result purchaseReservedInstancesOffering(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise purchaseReservedInstancesOfferingAsync(array $args = [])\n * @method \\Aws\\Result purchaseScheduledInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise purchaseScheduledInstancesAsync(array $args = [])\n * @method \\Aws\\Result rebootInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebootInstancesAsync(array $args = [])\n * @method \\Aws\\Result registerImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerImageAsync(array $args = [])\n * @method \\Aws\\Result rejectVpcPeeringConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectVpcPeeringConnectionAsync(array $args = [])\n * @method \\Aws\\Result releaseAddress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise releaseAddressAsync(array $args = [])\n * @method \\Aws\\Result releaseHosts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise releaseHostsAsync(array $args = [])\n * @method \\Aws\\Result replaceNetworkAclAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise replaceNetworkAclAssociationAsync(array $args = [])\n * @method \\Aws\\Result replaceNetworkAclEntry(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise replaceNetworkAclEntryAsync(array $args = [])\n * @method \\Aws\\Result replaceRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise replaceRouteAsync(array $args = [])\n * @method \\Aws\\Result replaceRouteTableAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise replaceRouteTableAssociationAsync(array $args = [])\n * @method \\Aws\\Result reportInstanceStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise reportInstanceStatusAsync(array $args = [])\n * @method \\Aws\\Result requestSpotFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise requestSpotFleetAsync(array $args = [])\n * @method \\Aws\\Result requestSpotInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise requestSpotInstancesAsync(array $args = [])\n * @method \\Aws\\Result resetImageAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetImageAttributeAsync(array $args = [])\n * @method \\Aws\\Result resetInstanceAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetInstanceAttributeAsync(array $args = [])\n * @method \\Aws\\Result resetNetworkInterfaceAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetNetworkInterfaceAttributeAsync(array $args = [])\n * @method \\Aws\\Result resetSnapshotAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetSnapshotAttributeAsync(array $args = [])\n * @method \\Aws\\Result restoreAddressToClassic(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreAddressToClassicAsync(array $args = [])\n * @method \\Aws\\Result revokeSecurityGroupEgress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeSecurityGroupEgressAsync(array $args = [])\n * @method \\Aws\\Result revokeSecurityGroupIngress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeSecurityGroupIngressAsync(array $args = [])\n * @method \\Aws\\Result runInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise runInstancesAsync(array $args = [])\n * @method \\Aws\\Result runScheduledInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise runScheduledInstancesAsync(array $args = [])\n * @method \\Aws\\Result startInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startInstancesAsync(array $args = [])\n * @method \\Aws\\Result stopInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopInstancesAsync(array $args = [])\n * @method \\Aws\\Result terminateInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise terminateInstancesAsync(array $args = [])\n * @method \\Aws\\Result unassignPrivateIpAddresses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unassignPrivateIpAddressesAsync(array $args = [])\n * @method \\Aws\\Result unmonitorInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unmonitorInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeHostReservationOfferings(array $args = []) (supported in versions 2016-04-01, 2016-09-15, 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeHostReservationOfferingsAsync(array $args = []) (supported in versions 2016-04-01, 2016-09-15, 2016-11-15)\n * @method \\Aws\\Result describeHostReservations(array $args = []) (supported in versions 2016-04-01, 2016-09-15, 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeHostReservationsAsync(array $args = []) (supported in versions 2016-04-01, 2016-09-15, 2016-11-15)\n * @method \\Aws\\Result describeIdentityIdFormat(array $args = []) (supported in versions 2016-04-01, 2016-09-15, 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeIdentityIdFormatAsync(array $args = []) (supported in versions 2016-04-01, 2016-09-15, 2016-11-15)\n * @method \\Aws\\Result getHostReservationPurchasePreview(array $args = []) (supported in versions 2016-04-01, 2016-09-15, 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getHostReservationPurchasePreviewAsync(array $args = []) (supported in versions 2016-04-01, 2016-09-15, 2016-11-15)\n * @method \\Aws\\Result modifyIdentityIdFormat(array $args = []) (supported in versions 2016-04-01, 2016-09-15, 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyIdentityIdFormatAsync(array $args = []) (supported in versions 2016-04-01, 2016-09-15, 2016-11-15)\n * @method \\Aws\\Result purchaseHostReservation(array $args = []) (supported in versions 2016-04-01, 2016-09-15, 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise purchaseHostReservationAsync(array $args = []) (supported in versions 2016-04-01, 2016-09-15, 2016-11-15)\n * @method \\Aws\\Result acceptReservedInstancesExchangeQuote(array $args = []) (supported in versions 2016-09-15, 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise acceptReservedInstancesExchangeQuoteAsync(array $args = []) (supported in versions 2016-09-15, 2016-11-15)\n * @method \\Aws\\Result getReservedInstancesExchangeQuote(array $args = []) (supported in versions 2016-09-15, 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getReservedInstancesExchangeQuoteAsync(array $args = []) (supported in versions 2016-09-15, 2016-11-15)\n * @method \\Aws\\Result acceptAddressTransfer(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise acceptAddressTransferAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result acceptTransitGatewayMulticastDomainAssociations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise acceptTransitGatewayMulticastDomainAssociationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result acceptTransitGatewayPeeringAttachment(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise acceptTransitGatewayPeeringAttachmentAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result acceptTransitGatewayVpcAttachment(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise acceptTransitGatewayVpcAttachmentAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result acceptVpcEndpointConnections(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise acceptVpcEndpointConnectionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result advertiseByoipCidr(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise advertiseByoipCidrAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result allocateIpamPoolCidr(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise allocateIpamPoolCidrAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result applySecurityGroupsToClientVpnTargetNetwork(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise applySecurityGroupsToClientVpnTargetNetworkAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result assignIpv6Addresses(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise assignIpv6AddressesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result assignPrivateNatGatewayAddress(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise assignPrivateNatGatewayAddressAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result associateClientVpnTargetNetwork(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise associateClientVpnTargetNetworkAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result associateEnclaveCertificateIamRole(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise associateEnclaveCertificateIamRoleAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result associateIamInstanceProfile(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise associateIamInstanceProfileAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result associateInstanceEventWindow(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise associateInstanceEventWindowAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result associateIpamResourceDiscovery(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise associateIpamResourceDiscoveryAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result associateNatGatewayAddress(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise associateNatGatewayAddressAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result associateSubnetCidrBlock(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise associateSubnetCidrBlockAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result associateTransitGatewayMulticastDomain(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise associateTransitGatewayMulticastDomainAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result associateTransitGatewayPolicyTable(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise associateTransitGatewayPolicyTableAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result associateTransitGatewayRouteTable(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise associateTransitGatewayRouteTableAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result associateTrunkInterface(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise associateTrunkInterfaceAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result associateVpcCidrBlock(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise associateVpcCidrBlockAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result attachVerifiedAccessTrustProvider(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise attachVerifiedAccessTrustProviderAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result authorizeClientVpnIngress(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise authorizeClientVpnIngressAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result cancelCapacityReservation(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise cancelCapacityReservationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result cancelCapacityReservationFleets(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise cancelCapacityReservationFleetsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result cancelImageLaunchPermission(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise cancelImageLaunchPermissionAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result copyFpgaImage(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise copyFpgaImageAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createCapacityReservation(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createCapacityReservationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createCapacityReservationFleet(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createCapacityReservationFleetAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createCarrierGateway(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createCarrierGatewayAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createClientVpnEndpoint(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createClientVpnEndpointAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createClientVpnRoute(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createClientVpnRouteAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createCoipCidr(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createCoipCidrAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createCoipPool(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createCoipPoolAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createDefaultSubnet(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createDefaultSubnetAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createDefaultVpc(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createDefaultVpcAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createEgressOnlyInternetGateway(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createEgressOnlyInternetGatewayAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createFleet(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createFleetAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createFpgaImage(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createFpgaImageAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createInstanceConnectEndpoint(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createInstanceConnectEndpointAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createInstanceEventWindow(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createInstanceEventWindowAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createIpam(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createIpamAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createIpamPool(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createIpamPoolAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createIpamResourceDiscovery(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createIpamResourceDiscoveryAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createIpamScope(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createIpamScopeAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createLaunchTemplate(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createLaunchTemplateAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createLaunchTemplateVersion(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createLaunchTemplateVersionAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createLocalGatewayRoute(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createLocalGatewayRouteAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createLocalGatewayRouteTable(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createLocalGatewayRouteTableAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createLocalGatewayRouteTableVirtualInterfaceGroupAssociation(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createLocalGatewayRouteTableVirtualInterfaceGroupAssociationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createLocalGatewayRouteTableVpcAssociation(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createLocalGatewayRouteTableVpcAssociationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createManagedPrefixList(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createManagedPrefixListAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createNetworkInsightsAccessScope(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createNetworkInsightsAccessScopeAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createNetworkInsightsPath(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createNetworkInsightsPathAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createNetworkInterfacePermission(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createNetworkInterfacePermissionAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createPublicIpv4Pool(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createPublicIpv4PoolAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createReplaceRootVolumeTask(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createReplaceRootVolumeTaskAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createRestoreImageTask(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createRestoreImageTaskAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createSnapshots(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createSnapshotsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createStoreImageTask(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createStoreImageTaskAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createSubnetCidrReservation(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createSubnetCidrReservationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createTrafficMirrorFilter(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createTrafficMirrorFilterAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createTrafficMirrorFilterRule(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createTrafficMirrorFilterRuleAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createTrafficMirrorSession(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createTrafficMirrorSessionAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createTrafficMirrorTarget(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createTrafficMirrorTargetAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createTransitGateway(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createTransitGatewayAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createTransitGatewayConnect(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createTransitGatewayConnectAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createTransitGatewayConnectPeer(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createTransitGatewayConnectPeerAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createTransitGatewayMulticastDomain(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createTransitGatewayMulticastDomainAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createTransitGatewayPeeringAttachment(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createTransitGatewayPeeringAttachmentAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createTransitGatewayPolicyTable(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createTransitGatewayPolicyTableAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createTransitGatewayPrefixListReference(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createTransitGatewayPrefixListReferenceAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createTransitGatewayRoute(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createTransitGatewayRouteAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createTransitGatewayRouteTable(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createTransitGatewayRouteTableAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createTransitGatewayRouteTableAnnouncement(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createTransitGatewayRouteTableAnnouncementAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createTransitGatewayVpcAttachment(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createTransitGatewayVpcAttachmentAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createVerifiedAccessEndpoint(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createVerifiedAccessEndpointAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createVerifiedAccessGroup(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createVerifiedAccessGroupAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createVerifiedAccessInstance(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createVerifiedAccessInstanceAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createVerifiedAccessTrustProvider(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createVerifiedAccessTrustProviderAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createVpcEndpointConnectionNotification(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createVpcEndpointConnectionNotificationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result createVpcEndpointServiceConfiguration(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise createVpcEndpointServiceConfigurationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteCarrierGateway(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteCarrierGatewayAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteClientVpnEndpoint(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteClientVpnEndpointAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteClientVpnRoute(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteClientVpnRouteAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteCoipCidr(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteCoipCidrAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteCoipPool(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteCoipPoolAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteEgressOnlyInternetGateway(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteEgressOnlyInternetGatewayAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteFleets(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteFleetsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteFpgaImage(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteFpgaImageAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteInstanceConnectEndpoint(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteInstanceConnectEndpointAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteInstanceEventWindow(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteInstanceEventWindowAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteIpam(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteIpamAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteIpamPool(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteIpamPoolAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteIpamResourceDiscovery(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteIpamResourceDiscoveryAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteIpamScope(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteIpamScopeAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteLaunchTemplate(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteLaunchTemplateAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteLaunchTemplateVersions(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteLaunchTemplateVersionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteLocalGatewayRoute(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteLocalGatewayRouteAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteLocalGatewayRouteTable(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteLocalGatewayRouteTableAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteLocalGatewayRouteTableVpcAssociation(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteLocalGatewayRouteTableVpcAssociationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteManagedPrefixList(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteManagedPrefixListAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteNetworkInsightsAccessScope(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteNetworkInsightsAccessScopeAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteNetworkInsightsAccessScopeAnalysis(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteNetworkInsightsAccessScopeAnalysisAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteNetworkInsightsAnalysis(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteNetworkInsightsAnalysisAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteNetworkInsightsPath(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteNetworkInsightsPathAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteNetworkInterfacePermission(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteNetworkInterfacePermissionAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deletePublicIpv4Pool(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deletePublicIpv4PoolAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteQueuedReservedInstances(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteQueuedReservedInstancesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteSubnetCidrReservation(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteSubnetCidrReservationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteTrafficMirrorFilter(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteTrafficMirrorFilterAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteTrafficMirrorFilterRule(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteTrafficMirrorFilterRuleAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteTrafficMirrorSession(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteTrafficMirrorSessionAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteTrafficMirrorTarget(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteTrafficMirrorTargetAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteTransitGateway(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteTransitGatewayAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteTransitGatewayConnect(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteTransitGatewayConnectAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteTransitGatewayConnectPeer(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteTransitGatewayConnectPeerAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteTransitGatewayMulticastDomain(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteTransitGatewayMulticastDomainAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteTransitGatewayPeeringAttachment(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteTransitGatewayPeeringAttachmentAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteTransitGatewayPolicyTable(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteTransitGatewayPolicyTableAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteTransitGatewayPrefixListReference(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteTransitGatewayPrefixListReferenceAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteTransitGatewayRoute(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteTransitGatewayRouteAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteTransitGatewayRouteTable(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteTransitGatewayRouteTableAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteTransitGatewayRouteTableAnnouncement(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteTransitGatewayRouteTableAnnouncementAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteTransitGatewayVpcAttachment(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteTransitGatewayVpcAttachmentAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteVerifiedAccessEndpoint(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteVerifiedAccessEndpointAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteVerifiedAccessGroup(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteVerifiedAccessGroupAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteVerifiedAccessInstance(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteVerifiedAccessInstanceAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteVerifiedAccessTrustProvider(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteVerifiedAccessTrustProviderAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteVpcEndpointConnectionNotifications(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpcEndpointConnectionNotificationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deleteVpcEndpointServiceConfigurations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpcEndpointServiceConfigurationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deprovisionByoipCidr(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deprovisionByoipCidrAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deprovisionIpamPoolCidr(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deprovisionIpamPoolCidrAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deprovisionPublicIpv4PoolCidr(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deprovisionPublicIpv4PoolCidrAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deregisterInstanceEventNotificationAttributes(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deregisterInstanceEventNotificationAttributesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deregisterTransitGatewayMulticastGroupMembers(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deregisterTransitGatewayMulticastGroupMembersAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result deregisterTransitGatewayMulticastGroupSources(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise deregisterTransitGatewayMulticastGroupSourcesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeAddressTransfers(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeAddressTransfersAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeAddressesAttribute(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeAddressesAttributeAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeAggregateIdFormat(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeAggregateIdFormatAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeAwsNetworkPerformanceMetricSubscriptions(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeAwsNetworkPerformanceMetricSubscriptionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeByoipCidrs(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeByoipCidrsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeCapacityReservationFleets(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeCapacityReservationFleetsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeCapacityReservations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeCapacityReservationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeCarrierGateways(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeCarrierGatewaysAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeClientVpnAuthorizationRules(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeClientVpnAuthorizationRulesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeClientVpnConnections(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeClientVpnConnectionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeClientVpnEndpoints(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeClientVpnEndpointsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeClientVpnRoutes(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeClientVpnRoutesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeClientVpnTargetNetworks(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeClientVpnTargetNetworksAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeCoipPools(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeCoipPoolsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeEgressOnlyInternetGateways(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeEgressOnlyInternetGatewaysAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeElasticGpus(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeElasticGpusAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeExportImageTasks(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeExportImageTasksAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeFastLaunchImages(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeFastLaunchImagesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeFastSnapshotRestores(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeFastSnapshotRestoresAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeFleetHistory(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetHistoryAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeFleetInstances(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetInstancesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeFleets(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeFpgaImageAttribute(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeFpgaImageAttributeAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeFpgaImages(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeFpgaImagesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeIamInstanceProfileAssociations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeIamInstanceProfileAssociationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeInstanceConnectEndpoints(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceConnectEndpointsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeInstanceCreditSpecifications(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceCreditSpecificationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeInstanceEventNotificationAttributes(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceEventNotificationAttributesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeInstanceEventWindows(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceEventWindowsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeInstanceTypeOfferings(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceTypeOfferingsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeInstanceTypes(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceTypesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeIpamPools(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeIpamPoolsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeIpamResourceDiscoveries(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeIpamResourceDiscoveriesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeIpamResourceDiscoveryAssociations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeIpamResourceDiscoveryAssociationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeIpamScopes(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeIpamScopesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeIpams(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeIpamsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeIpv6Pools(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeIpv6PoolsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeLaunchTemplateVersions(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeLaunchTemplateVersionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeLaunchTemplates(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeLaunchTemplatesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeLocalGatewayRouteTableVirtualInterfaceGroupAssociations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeLocalGatewayRouteTableVpcAssociations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeLocalGatewayRouteTableVpcAssociationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeLocalGatewayRouteTables(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeLocalGatewayRouteTablesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeLocalGatewayVirtualInterfaceGroups(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeLocalGatewayVirtualInterfaceGroupsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeLocalGatewayVirtualInterfaces(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeLocalGatewayVirtualInterfacesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeLocalGateways(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeLocalGatewaysAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeManagedPrefixLists(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeManagedPrefixListsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeNetworkInsightsAccessScopeAnalyses(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeNetworkInsightsAccessScopeAnalysesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeNetworkInsightsAccessScopes(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeNetworkInsightsAccessScopesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeNetworkInsightsAnalyses(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeNetworkInsightsAnalysesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeNetworkInsightsPaths(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeNetworkInsightsPathsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeNetworkInterfacePermissions(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeNetworkInterfacePermissionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describePrincipalIdFormat(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describePrincipalIdFormatAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describePublicIpv4Pools(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describePublicIpv4PoolsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeReplaceRootVolumeTasks(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeReplaceRootVolumeTasksAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeSecurityGroupRules(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeSecurityGroupRulesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeSnapshotTierStatus(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeSnapshotTierStatusAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeStoreImageTasks(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeStoreImageTasksAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeTrafficMirrorFilters(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeTrafficMirrorFiltersAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeTrafficMirrorSessions(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeTrafficMirrorSessionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeTrafficMirrorTargets(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeTrafficMirrorTargetsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeTransitGatewayAttachments(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeTransitGatewayAttachmentsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeTransitGatewayConnectPeers(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeTransitGatewayConnectPeersAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeTransitGatewayConnects(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeTransitGatewayConnectsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeTransitGatewayMulticastDomains(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeTransitGatewayMulticastDomainsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeTransitGatewayPeeringAttachments(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeTransitGatewayPeeringAttachmentsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeTransitGatewayPolicyTables(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeTransitGatewayPolicyTablesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeTransitGatewayRouteTableAnnouncements(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeTransitGatewayRouteTableAnnouncementsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeTransitGatewayRouteTables(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeTransitGatewayRouteTablesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeTransitGatewayVpcAttachments(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeTransitGatewayVpcAttachmentsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeTransitGateways(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeTransitGatewaysAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeTrunkInterfaceAssociations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeTrunkInterfaceAssociationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeVerifiedAccessEndpoints(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeVerifiedAccessEndpointsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeVerifiedAccessGroups(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeVerifiedAccessGroupsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeVerifiedAccessInstanceLoggingConfigurations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeVerifiedAccessInstanceLoggingConfigurationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeVerifiedAccessInstances(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeVerifiedAccessInstancesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeVerifiedAccessTrustProviders(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeVerifiedAccessTrustProvidersAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeVolumesModifications(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeVolumesModificationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeVpcEndpointConnectionNotifications(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcEndpointConnectionNotificationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeVpcEndpointConnections(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcEndpointConnectionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeVpcEndpointServiceConfigurations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcEndpointServiceConfigurationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result describeVpcEndpointServicePermissions(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcEndpointServicePermissionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result detachVerifiedAccessTrustProvider(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise detachVerifiedAccessTrustProviderAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disableAddressTransfer(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disableAddressTransferAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disableAwsNetworkPerformanceMetricSubscription(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disableAwsNetworkPerformanceMetricSubscriptionAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disableEbsEncryptionByDefault(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disableEbsEncryptionByDefaultAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disableFastLaunch(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disableFastLaunchAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disableFastSnapshotRestores(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disableFastSnapshotRestoresAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disableImageDeprecation(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disableImageDeprecationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disableIpamOrganizationAdminAccount(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disableIpamOrganizationAdminAccountAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disableSerialConsoleAccess(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disableSerialConsoleAccessAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disableTransitGatewayRouteTablePropagation(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disableTransitGatewayRouteTablePropagationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disassociateClientVpnTargetNetwork(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disassociateClientVpnTargetNetworkAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disassociateEnclaveCertificateIamRole(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disassociateEnclaveCertificateIamRoleAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disassociateIamInstanceProfile(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disassociateIamInstanceProfileAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disassociateInstanceEventWindow(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disassociateInstanceEventWindowAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disassociateIpamResourceDiscovery(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disassociateIpamResourceDiscoveryAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disassociateNatGatewayAddress(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disassociateNatGatewayAddressAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disassociateSubnetCidrBlock(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disassociateSubnetCidrBlockAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disassociateTransitGatewayMulticastDomain(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disassociateTransitGatewayMulticastDomainAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disassociateTransitGatewayPolicyTable(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disassociateTransitGatewayPolicyTableAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disassociateTransitGatewayRouteTable(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disassociateTransitGatewayRouteTableAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disassociateTrunkInterface(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disassociateTrunkInterfaceAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result disassociateVpcCidrBlock(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise disassociateVpcCidrBlockAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result enableAddressTransfer(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise enableAddressTransferAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result enableAwsNetworkPerformanceMetricSubscription(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise enableAwsNetworkPerformanceMetricSubscriptionAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result enableEbsEncryptionByDefault(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise enableEbsEncryptionByDefaultAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result enableFastLaunch(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise enableFastLaunchAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result enableFastSnapshotRestores(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise enableFastSnapshotRestoresAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result enableImageDeprecation(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise enableImageDeprecationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result enableIpamOrganizationAdminAccount(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise enableIpamOrganizationAdminAccountAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result enableReachabilityAnalyzerOrganizationSharing(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise enableReachabilityAnalyzerOrganizationSharingAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result enableSerialConsoleAccess(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise enableSerialConsoleAccessAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result enableTransitGatewayRouteTablePropagation(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise enableTransitGatewayRouteTablePropagationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result exportClientVpnClientCertificateRevocationList(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise exportClientVpnClientCertificateRevocationListAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result exportClientVpnClientConfiguration(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise exportClientVpnClientConfigurationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result exportImage(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise exportImageAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result exportTransitGatewayRoutes(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise exportTransitGatewayRoutesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getAssociatedEnclaveCertificateIamRoles(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getAssociatedEnclaveCertificateIamRolesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getAssociatedIpv6PoolCidrs(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getAssociatedIpv6PoolCidrsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getAwsNetworkPerformanceData(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getAwsNetworkPerformanceDataAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getCapacityReservationUsage(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getCapacityReservationUsageAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getCoipPoolUsage(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getCoipPoolUsageAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getDefaultCreditSpecification(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getDefaultCreditSpecificationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getEbsDefaultKmsKeyId(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getEbsDefaultKmsKeyIdAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getEbsEncryptionByDefault(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getEbsEncryptionByDefaultAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getFlowLogsIntegrationTemplate(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getFlowLogsIntegrationTemplateAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getGroupsForCapacityReservation(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getGroupsForCapacityReservationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getInstanceTypesFromInstanceRequirements(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getInstanceTypesFromInstanceRequirementsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getInstanceUefiData(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getInstanceUefiDataAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getIpamAddressHistory(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getIpamAddressHistoryAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getIpamDiscoveredAccounts(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getIpamDiscoveredAccountsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getIpamDiscoveredResourceCidrs(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getIpamDiscoveredResourceCidrsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getIpamPoolAllocations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getIpamPoolAllocationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getIpamPoolCidrs(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getIpamPoolCidrsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getIpamResourceCidrs(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getIpamResourceCidrsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getLaunchTemplateData(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getLaunchTemplateDataAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getManagedPrefixListAssociations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getManagedPrefixListAssociationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getManagedPrefixListEntries(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getManagedPrefixListEntriesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getNetworkInsightsAccessScopeAnalysisFindings(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getNetworkInsightsAccessScopeAnalysisFindingsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getNetworkInsightsAccessScopeContent(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getNetworkInsightsAccessScopeContentAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getSerialConsoleAccessStatus(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getSerialConsoleAccessStatusAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getSpotPlacementScores(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getSpotPlacementScoresAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getSubnetCidrReservations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getSubnetCidrReservationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getTransitGatewayAttachmentPropagations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getTransitGatewayAttachmentPropagationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getTransitGatewayMulticastDomainAssociations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getTransitGatewayMulticastDomainAssociationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getTransitGatewayPolicyTableAssociations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getTransitGatewayPolicyTableAssociationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getTransitGatewayPolicyTableEntries(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getTransitGatewayPolicyTableEntriesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getTransitGatewayPrefixListReferences(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getTransitGatewayPrefixListReferencesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getTransitGatewayRouteTableAssociations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getTransitGatewayRouteTableAssociationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getTransitGatewayRouteTablePropagations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getTransitGatewayRouteTablePropagationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getVerifiedAccessEndpointPolicy(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getVerifiedAccessEndpointPolicyAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getVerifiedAccessGroupPolicy(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getVerifiedAccessGroupPolicyAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getVpnConnectionDeviceSampleConfiguration(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getVpnConnectionDeviceSampleConfigurationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getVpnConnectionDeviceTypes(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getVpnConnectionDeviceTypesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result getVpnTunnelReplacementStatus(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise getVpnTunnelReplacementStatusAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result importClientVpnClientCertificateRevocationList(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise importClientVpnClientCertificateRevocationListAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result listImagesInRecycleBin(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise listImagesInRecycleBinAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result listSnapshotsInRecycleBin(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise listSnapshotsInRecycleBinAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyAddressAttribute(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyAddressAttributeAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyAvailabilityZoneGroup(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyAvailabilityZoneGroupAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyCapacityReservation(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyCapacityReservationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyCapacityReservationFleet(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyCapacityReservationFleetAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyClientVpnEndpoint(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyClientVpnEndpointAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyDefaultCreditSpecification(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyDefaultCreditSpecificationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyEbsDefaultKmsKeyId(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyEbsDefaultKmsKeyIdAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyFleet(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyFleetAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyFpgaImageAttribute(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyFpgaImageAttributeAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyInstanceCapacityReservationAttributes(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyInstanceCapacityReservationAttributesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyInstanceCreditSpecification(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyInstanceCreditSpecificationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyInstanceEventStartTime(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyInstanceEventStartTimeAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyInstanceEventWindow(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyInstanceEventWindowAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyInstanceMaintenanceOptions(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyInstanceMaintenanceOptionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyInstanceMetadataOptions(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyInstanceMetadataOptionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyIpam(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyIpamAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyIpamPool(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyIpamPoolAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyIpamResourceCidr(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyIpamResourceCidrAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyIpamResourceDiscovery(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyIpamResourceDiscoveryAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyIpamScope(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyIpamScopeAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyLaunchTemplate(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyLaunchTemplateAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyLocalGatewayRoute(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyLocalGatewayRouteAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyManagedPrefixList(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyManagedPrefixListAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyPrivateDnsNameOptions(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyPrivateDnsNameOptionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifySecurityGroupRules(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifySecurityGroupRulesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifySnapshotTier(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifySnapshotTierAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyTrafficMirrorFilterNetworkServices(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyTrafficMirrorFilterNetworkServicesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyTrafficMirrorFilterRule(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyTrafficMirrorFilterRuleAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyTrafficMirrorSession(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyTrafficMirrorSessionAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyTransitGateway(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyTransitGatewayAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyTransitGatewayPrefixListReference(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyTransitGatewayPrefixListReferenceAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyTransitGatewayVpcAttachment(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyTransitGatewayVpcAttachmentAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVerifiedAccessEndpoint(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVerifiedAccessEndpointAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVerifiedAccessEndpointPolicy(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVerifiedAccessEndpointPolicyAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVerifiedAccessGroup(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVerifiedAccessGroupAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVerifiedAccessGroupPolicy(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVerifiedAccessGroupPolicyAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVerifiedAccessInstance(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVerifiedAccessInstanceAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVerifiedAccessInstanceLoggingConfiguration(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVerifiedAccessInstanceLoggingConfigurationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVerifiedAccessTrustProvider(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVerifiedAccessTrustProviderAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVolume(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVolumeAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVpcEndpointConnectionNotification(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVpcEndpointConnectionNotificationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVpcEndpointServiceConfiguration(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVpcEndpointServiceConfigurationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVpcEndpointServicePayerResponsibility(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVpcEndpointServicePayerResponsibilityAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVpcEndpointServicePermissions(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVpcEndpointServicePermissionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVpcTenancy(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVpcTenancyAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVpnConnection(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVpnConnectionAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVpnConnectionOptions(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVpnConnectionOptionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVpnTunnelCertificate(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVpnTunnelCertificateAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result modifyVpnTunnelOptions(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise modifyVpnTunnelOptionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result moveByoipCidrToIpam(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise moveByoipCidrToIpamAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result provisionByoipCidr(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise provisionByoipCidrAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result provisionIpamPoolCidr(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise provisionIpamPoolCidrAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result provisionPublicIpv4PoolCidr(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise provisionPublicIpv4PoolCidrAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result registerInstanceEventNotificationAttributes(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise registerInstanceEventNotificationAttributesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result registerTransitGatewayMulticastGroupMembers(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise registerTransitGatewayMulticastGroupMembersAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result registerTransitGatewayMulticastGroupSources(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise registerTransitGatewayMulticastGroupSourcesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result rejectTransitGatewayMulticastDomainAssociations(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise rejectTransitGatewayMulticastDomainAssociationsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result rejectTransitGatewayPeeringAttachment(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise rejectTransitGatewayPeeringAttachmentAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result rejectTransitGatewayVpcAttachment(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise rejectTransitGatewayVpcAttachmentAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result rejectVpcEndpointConnections(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise rejectVpcEndpointConnectionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result releaseIpamPoolAllocation(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise releaseIpamPoolAllocationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result replaceIamInstanceProfileAssociation(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise replaceIamInstanceProfileAssociationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result replaceTransitGatewayRoute(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise replaceTransitGatewayRouteAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result replaceVpnTunnel(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise replaceVpnTunnelAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result resetAddressAttribute(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise resetAddressAttributeAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result resetEbsDefaultKmsKeyId(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise resetEbsDefaultKmsKeyIdAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result resetFpgaImageAttribute(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise resetFpgaImageAttributeAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result restoreImageFromRecycleBin(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise restoreImageFromRecycleBinAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result restoreManagedPrefixListVersion(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise restoreManagedPrefixListVersionAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result restoreSnapshotFromRecycleBin(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise restoreSnapshotFromRecycleBinAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result restoreSnapshotTier(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise restoreSnapshotTierAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result revokeClientVpnIngress(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise revokeClientVpnIngressAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result searchLocalGatewayRoutes(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise searchLocalGatewayRoutesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result searchTransitGatewayMulticastGroups(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise searchTransitGatewayMulticastGroupsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result searchTransitGatewayRoutes(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise searchTransitGatewayRoutesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result sendDiagnosticInterrupt(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise sendDiagnosticInterruptAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result startNetworkInsightsAccessScopeAnalysis(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise startNetworkInsightsAccessScopeAnalysisAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result startNetworkInsightsAnalysis(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise startNetworkInsightsAnalysisAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result startVpcEndpointServicePrivateDnsVerification(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise startVpcEndpointServicePrivateDnsVerificationAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result terminateClientVpnConnections(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise terminateClientVpnConnectionsAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result unassignIpv6Addresses(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise unassignIpv6AddressesAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result unassignPrivateNatGatewayAddress(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise unassignPrivateNatGatewayAddressAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result updateSecurityGroupRuleDescriptionsEgress(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise updateSecurityGroupRuleDescriptionsEgressAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result updateSecurityGroupRuleDescriptionsIngress(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise updateSecurityGroupRuleDescriptionsIngressAsync(array $args = []) (supported in versions 2016-11-15)\n * @method \\Aws\\Result withdrawByoipCidr(array $args = []) (supported in versions 2016-11-15)\n * @method \\GuzzleHttp\\Promise\\Promise withdrawByoipCidrAsync(array $args = []) (supported in versions 2016-11-15)\n */\nclass Ec2Client extends AwsClient\n{\n    public function __construct(array $args)\n    {\n        $args['with_resolved'] = function (array $args) {\n            $this->getHandlerList()->appendInit(\n                PresignUrlMiddleware::wrap(\n                    $this,\n                    $args['endpoint_provider'],\n                    [\n                        'operations' => [\n                            'CopySnapshot',\n                        ],\n                        'service' => 'ec2',\n                        'presign_param' => 'PresignedUrl',\n                    ]\n                ),\n                'ec2.copy_snapshot'\n            );\n        };\n\n        parent::__construct($args);\n    }\n\n    /**\n     * @internal\n     * @codeCoverageIgnore\n     */\n    public static function applyDocFilters(array $api, array $docs)\n    {\n        // Several copy snapshot parameters are optional.\n        $docs['shapes']['String']['refs']['CopySnapshotRequest$PresignedUrl']\n            = '<div class=\"alert alert-info\">The SDK will compute this value '\n            . 'for you on your behalf.</div>';\n        $docs['shapes']['String']['refs']['CopySnapshotRequest$DestinationRegion']\n            = '<div class=\"alert alert-info\">The SDK will populate this '\n            . 'parameter on your behalf using the configured region value of '\n            . 'the client.</div>';\n\n        return [\n            new Service($api, ApiProvider::defaultProvider()),\n            new DocModel($docs)\n        ];\n    }\n}\n", "num_lines": 1247}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Ec2\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon Elastic Compute Cloud service.\n */\nclass Ec2Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EC2InstanceConnect;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS EC2 Instance Connect** service.\n * @method \\Aws\\Result sendSSHPublicKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendSSHPublicKeyAsync(array $args = [])\n * @method \\Aws\\Result sendSerialConsoleSSHPublicKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendSerialConsoleSSHPublicKeyAsync(array $args = [])\n */\nclass EC2InstanceConnectClient extends AwsClient {}\n", "num_lines": 14}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EC2InstanceConnect\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS EC2 Instance Connect** service.\n */\nclass EC2InstanceConnectException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Ecr;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon EC2 Container Registry** service.\n *\n * @method \\Aws\\Result batchCheckLayerAvailability(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchCheckLayerAvailabilityAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteImageAsync(array $args = [])\n * @method \\Aws\\Result batchGetImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetImageAsync(array $args = [])\n * @method \\Aws\\Result batchGetRepositoryScanningConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetRepositoryScanningConfigurationAsync(array $args = [])\n * @method \\Aws\\Result completeLayerUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise completeLayerUploadAsync(array $args = [])\n * @method \\Aws\\Result createPullThroughCacheRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPullThroughCacheRuleAsync(array $args = [])\n * @method \\Aws\\Result createRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRepositoryAsync(array $args = [])\n * @method \\Aws\\Result deleteLifecyclePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLifecyclePolicyAsync(array $args = [])\n * @method \\Aws\\Result deletePullThroughCacheRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePullThroughCacheRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteRegistryPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRegistryPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRepositoryAsync(array $args = [])\n * @method \\Aws\\Result deleteRepositoryPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRepositoryPolicyAsync(array $args = [])\n * @method \\Aws\\Result describeImageReplicationStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImageReplicationStatusAsync(array $args = [])\n * @method \\Aws\\Result describeImageScanFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImageScanFindingsAsync(array $args = [])\n * @method \\Aws\\Result describeImages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImagesAsync(array $args = [])\n * @method \\Aws\\Result describePullThroughCacheRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePullThroughCacheRulesAsync(array $args = [])\n * @method \\Aws\\Result describeRegistry(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRegistryAsync(array $args = [])\n * @method \\Aws\\Result describeRepositories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRepositoriesAsync(array $args = [])\n * @method \\Aws\\Result getAuthorizationToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAuthorizationTokenAsync(array $args = [])\n * @method \\Aws\\Result getDownloadUrlForLayer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDownloadUrlForLayerAsync(array $args = [])\n * @method \\Aws\\Result getLifecyclePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLifecyclePolicyAsync(array $args = [])\n * @method \\Aws\\Result getLifecyclePolicyPreview(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLifecyclePolicyPreviewAsync(array $args = [])\n * @method \\Aws\\Result getRegistryPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRegistryPolicyAsync(array $args = [])\n * @method \\Aws\\Result getRegistryScanningConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRegistryScanningConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getRepositoryPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRepositoryPolicyAsync(array $args = [])\n * @method \\Aws\\Result initiateLayerUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise initiateLayerUploadAsync(array $args = [])\n * @method \\Aws\\Result listImages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listImagesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putImageAsync(array $args = [])\n * @method \\Aws\\Result putImageScanningConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putImageScanningConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putImageTagMutability(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putImageTagMutabilityAsync(array $args = [])\n * @method \\Aws\\Result putLifecyclePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putLifecyclePolicyAsync(array $args = [])\n * @method \\Aws\\Result putRegistryPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRegistryPolicyAsync(array $args = [])\n * @method \\Aws\\Result putRegistryScanningConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRegistryScanningConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putReplicationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putReplicationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result setRepositoryPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setRepositoryPolicyAsync(array $args = [])\n * @method \\Aws\\Result startImageScan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startImageScanAsync(array $args = [])\n * @method \\Aws\\Result startLifecyclePolicyPreview(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startLifecyclePolicyPreviewAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result uploadLayerPart(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise uploadLayerPartAsync(array $args = [])\n */\nclass EcrClient extends AwsClient {}\n", "num_lines": 93}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Ecr\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon EC2 Container Registry** service.\n */\nclass EcrException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ECRPublic;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Elastic Container Registry Public** service.\n * @method \\Aws\\Result batchCheckLayerAvailability(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchCheckLayerAvailabilityAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteImageAsync(array $args = [])\n * @method \\Aws\\Result completeLayerUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise completeLayerUploadAsync(array $args = [])\n * @method \\Aws\\Result createRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRepositoryAsync(array $args = [])\n * @method \\Aws\\Result deleteRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRepositoryAsync(array $args = [])\n * @method \\Aws\\Result deleteRepositoryPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRepositoryPolicyAsync(array $args = [])\n * @method \\Aws\\Result describeImageTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImageTagsAsync(array $args = [])\n * @method \\Aws\\Result describeImages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImagesAsync(array $args = [])\n * @method \\Aws\\Result describeRegistries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRegistriesAsync(array $args = [])\n * @method \\Aws\\Result describeRepositories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRepositoriesAsync(array $args = [])\n * @method \\Aws\\Result getAuthorizationToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAuthorizationTokenAsync(array $args = [])\n * @method \\Aws\\Result getRegistryCatalogData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRegistryCatalogDataAsync(array $args = [])\n * @method \\Aws\\Result getRepositoryCatalogData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRepositoryCatalogDataAsync(array $args = [])\n * @method \\Aws\\Result getRepositoryPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRepositoryPolicyAsync(array $args = [])\n * @method \\Aws\\Result initiateLayerUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise initiateLayerUploadAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putImageAsync(array $args = [])\n * @method \\Aws\\Result putRegistryCatalogData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRegistryCatalogDataAsync(array $args = [])\n * @method \\Aws\\Result putRepositoryCatalogData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRepositoryCatalogDataAsync(array $args = [])\n * @method \\Aws\\Result setRepositoryPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setRepositoryPolicyAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result uploadLayerPart(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise uploadLayerPartAsync(array $args = [])\n */\nclass ECRPublicClient extends AwsClient {}\n", "num_lines": 56}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ECRPublic\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Elastic Container Registry Public** service.\n */\nclass ECRPublicException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Ecs;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with **Amazon ECS**.\n *\n * @method \\Aws\\Result createCapacityProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCapacityProviderAsync(array $args = [])\n * @method \\Aws\\Result createCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClusterAsync(array $args = [])\n * @method \\Aws\\Result createService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceAsync(array $args = [])\n * @method \\Aws\\Result createTaskSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTaskSetAsync(array $args = [])\n * @method \\Aws\\Result deleteAccountSetting(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccountSettingAsync(array $args = [])\n * @method \\Aws\\Result deleteAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAttributesAsync(array $args = [])\n * @method \\Aws\\Result deleteCapacityProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCapacityProviderAsync(array $args = [])\n * @method \\Aws\\Result deleteCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClusterAsync(array $args = [])\n * @method \\Aws\\Result deleteService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceAsync(array $args = [])\n * @method \\Aws\\Result deleteTaskDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTaskDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result deleteTaskSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTaskSetAsync(array $args = [])\n * @method \\Aws\\Result deregisterContainerInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterContainerInstanceAsync(array $args = [])\n * @method \\Aws\\Result deregisterTaskDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterTaskDefinitionAsync(array $args = [])\n * @method \\Aws\\Result describeCapacityProviders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCapacityProvidersAsync(array $args = [])\n * @method \\Aws\\Result describeClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClustersAsync(array $args = [])\n * @method \\Aws\\Result describeContainerInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeContainerInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeServices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeServicesAsync(array $args = [])\n * @method \\Aws\\Result describeTaskDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTaskDefinitionAsync(array $args = [])\n * @method \\Aws\\Result describeTaskSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTaskSetsAsync(array $args = [])\n * @method \\Aws\\Result describeTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTasksAsync(array $args = [])\n * @method \\Aws\\Result discoverPollEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise discoverPollEndpointAsync(array $args = [])\n * @method \\Aws\\Result executeCommand(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise executeCommandAsync(array $args = [])\n * @method \\Aws\\Result getTaskProtection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTaskProtectionAsync(array $args = [])\n * @method \\Aws\\Result listAccountSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccountSettingsAsync(array $args = [])\n * @method \\Aws\\Result listAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAttributesAsync(array $args = [])\n * @method \\Aws\\Result listClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listClustersAsync(array $args = [])\n * @method \\Aws\\Result listContainerInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listContainerInstancesAsync(array $args = [])\n * @method \\Aws\\Result listServices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServicesAsync(array $args = [])\n * @method \\Aws\\Result listServicesByNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServicesByNamespaceAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTaskDefinitionFamilies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTaskDefinitionFamiliesAsync(array $args = [])\n * @method \\Aws\\Result listTaskDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTaskDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTasksAsync(array $args = [])\n * @method \\Aws\\Result putAccountSetting(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccountSettingAsync(array $args = [])\n * @method \\Aws\\Result putAccountSettingDefault(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccountSettingDefaultAsync(array $args = [])\n * @method \\Aws\\Result putAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAttributesAsync(array $args = [])\n * @method \\Aws\\Result putClusterCapacityProviders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putClusterCapacityProvidersAsync(array $args = [])\n * @method \\Aws\\Result registerContainerInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerContainerInstanceAsync(array $args = [])\n * @method \\Aws\\Result registerTaskDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerTaskDefinitionAsync(array $args = [])\n * @method \\Aws\\Result runTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise runTaskAsync(array $args = [])\n * @method \\Aws\\Result startTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startTaskAsync(array $args = [])\n * @method \\Aws\\Result stopTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopTaskAsync(array $args = [])\n * @method \\Aws\\Result submitAttachmentStateChanges(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise submitAttachmentStateChangesAsync(array $args = [])\n * @method \\Aws\\Result submitContainerStateChange(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise submitContainerStateChangeAsync(array $args = [])\n * @method \\Aws\\Result submitTaskStateChange(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise submitTaskStateChangeAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateCapacityProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCapacityProviderAsync(array $args = [])\n * @method \\Aws\\Result updateCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateClusterAsync(array $args = [])\n * @method \\Aws\\Result updateClusterSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateClusterSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateContainerAgent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContainerAgentAsync(array $args = [])\n * @method \\Aws\\Result updateContainerInstancesState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContainerInstancesStateAsync(array $args = [])\n * @method \\Aws\\Result updateService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceAsync(array $args = [])\n * @method \\Aws\\Result updateServicePrimaryTaskSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServicePrimaryTaskSetAsync(array $args = [])\n * @method \\Aws\\Result updateTaskProtection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTaskProtectionAsync(array $args = [])\n * @method \\Aws\\Result updateTaskSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTaskSetAsync(array $args = [])\n */\nclass EcsClient extends AwsClient {}\n", "num_lines": 123}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Ecs\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Amazon ECS exception.\n */\nclass EcsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Efs;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with **Amazon EFS**.\n *\n * @method \\Aws\\Result createAccessPoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccessPointAsync(array $args = [])\n * @method \\Aws\\Result createFileSystem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFileSystemAsync(array $args = [])\n * @method \\Aws\\Result createMountTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMountTargetAsync(array $args = [])\n * @method \\Aws\\Result createReplicationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReplicationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTagsAsync(array $args = [])\n * @method \\Aws\\Result deleteAccessPoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccessPointAsync(array $args = [])\n * @method \\Aws\\Result deleteFileSystem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFileSystemAsync(array $args = [])\n * @method \\Aws\\Result deleteFileSystemPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFileSystemPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteMountTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMountTargetAsync(array $args = [])\n * @method \\Aws\\Result deleteReplicationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReplicationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTagsAsync(array $args = [])\n * @method \\Aws\\Result describeAccessPoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccessPointsAsync(array $args = [])\n * @method \\Aws\\Result describeAccountPreferences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountPreferencesAsync(array $args = [])\n * @method \\Aws\\Result describeBackupPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBackupPolicyAsync(array $args = [])\n * @method \\Aws\\Result describeFileSystemPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFileSystemPolicyAsync(array $args = [])\n * @method \\Aws\\Result describeFileSystems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFileSystemsAsync(array $args = [])\n * @method \\Aws\\Result describeLifecycleConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLifecycleConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeMountTargetSecurityGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMountTargetSecurityGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeMountTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMountTargetsAsync(array $args = [])\n * @method \\Aws\\Result describeReplicationConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReplicationConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result describeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTagsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result modifyMountTargetSecurityGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyMountTargetSecurityGroupsAsync(array $args = [])\n * @method \\Aws\\Result putAccountPreferences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccountPreferencesAsync(array $args = [])\n * @method \\Aws\\Result putBackupPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBackupPolicyAsync(array $args = [])\n * @method \\Aws\\Result putFileSystemPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putFileSystemPolicyAsync(array $args = [])\n * @method \\Aws\\Result putLifecycleConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putLifecycleConfigurationAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateFileSystem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFileSystemAsync(array $args = [])\n */\nclass EfsClient extends AwsClient {}\n", "num_lines": 71}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Efs\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Amazon EFS exception.\n */\nclass EfsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EKS;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Elastic Container Service for Kubernetes** service.\n * @method \\Aws\\Result associateEncryptionConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateEncryptionConfigAsync(array $args = [])\n * @method \\Aws\\Result associateIdentityProviderConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateIdentityProviderConfigAsync(array $args = [])\n * @method \\Aws\\Result createAddon(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAddonAsync(array $args = [])\n * @method \\Aws\\Result createCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClusterAsync(array $args = [])\n * @method \\Aws\\Result createFargateProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFargateProfileAsync(array $args = [])\n * @method \\Aws\\Result createNodegroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNodegroupAsync(array $args = [])\n * @method \\Aws\\Result deleteAddon(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAddonAsync(array $args = [])\n * @method \\Aws\\Result deleteCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClusterAsync(array $args = [])\n * @method \\Aws\\Result deleteFargateProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFargateProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteNodegroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNodegroupAsync(array $args = [])\n * @method \\Aws\\Result deregisterCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterClusterAsync(array $args = [])\n * @method \\Aws\\Result describeAddon(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAddonAsync(array $args = [])\n * @method \\Aws\\Result describeAddonConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAddonConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeAddonVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAddonVersionsAsync(array $args = [])\n * @method \\Aws\\Result describeCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClusterAsync(array $args = [])\n * @method \\Aws\\Result describeFargateProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFargateProfileAsync(array $args = [])\n * @method \\Aws\\Result describeIdentityProviderConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeIdentityProviderConfigAsync(array $args = [])\n * @method \\Aws\\Result describeNodegroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNodegroupAsync(array $args = [])\n * @method \\Aws\\Result describeUpdate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUpdateAsync(array $args = [])\n * @method \\Aws\\Result disassociateIdentityProviderConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateIdentityProviderConfigAsync(array $args = [])\n * @method \\Aws\\Result listAddons(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAddonsAsync(array $args = [])\n * @method \\Aws\\Result listClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listClustersAsync(array $args = [])\n * @method \\Aws\\Result listFargateProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFargateProfilesAsync(array $args = [])\n * @method \\Aws\\Result listIdentityProviderConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIdentityProviderConfigsAsync(array $args = [])\n * @method \\Aws\\Result listNodegroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNodegroupsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listUpdates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUpdatesAsync(array $args = [])\n * @method \\Aws\\Result registerCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerClusterAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAddon(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAddonAsync(array $args = [])\n * @method \\Aws\\Result updateClusterConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateClusterConfigAsync(array $args = [])\n * @method \\Aws\\Result updateClusterVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateClusterVersionAsync(array $args = [])\n * @method \\Aws\\Result updateNodegroupConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNodegroupConfigAsync(array $args = [])\n * @method \\Aws\\Result updateNodegroupVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNodegroupVersionAsync(array $args = [])\n */\nclass EKSClient extends AwsClient {}\n", "num_lines": 80}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EKS\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Elastic Container Service for Kubernetes** service.\n */\nclass EKSException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ElastiCache;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon ElastiCache** service.\n *\n * @method \\Aws\\Result addTagsToResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsToResourceAsync(array $args = [])\n * @method \\Aws\\Result authorizeCacheSecurityGroupIngress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise authorizeCacheSecurityGroupIngressAsync(array $args = [])\n * @method \\Aws\\Result batchApplyUpdateAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchApplyUpdateActionAsync(array $args = [])\n * @method \\Aws\\Result batchStopUpdateAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchStopUpdateActionAsync(array $args = [])\n * @method \\Aws\\Result completeMigration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise completeMigrationAsync(array $args = [])\n * @method \\Aws\\Result copySnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copySnapshotAsync(array $args = [])\n * @method \\Aws\\Result createCacheCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCacheClusterAsync(array $args = [])\n * @method \\Aws\\Result createCacheParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCacheParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result createCacheSecurityGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCacheSecurityGroupAsync(array $args = [])\n * @method \\Aws\\Result createCacheSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCacheSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result createGlobalReplicationGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGlobalReplicationGroupAsync(array $args = [])\n * @method \\Aws\\Result createReplicationGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReplicationGroupAsync(array $args = [])\n * @method \\Aws\\Result createSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserAsync(array $args = [])\n * @method \\Aws\\Result createUserGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserGroupAsync(array $args = [])\n * @method \\Aws\\Result decreaseNodeGroupsInGlobalReplicationGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise decreaseNodeGroupsInGlobalReplicationGroupAsync(array $args = [])\n * @method \\Aws\\Result decreaseReplicaCount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise decreaseReplicaCountAsync(array $args = [])\n * @method \\Aws\\Result deleteCacheCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCacheClusterAsync(array $args = [])\n * @method \\Aws\\Result deleteCacheParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCacheParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteCacheSecurityGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCacheSecurityGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteCacheSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCacheSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteGlobalReplicationGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGlobalReplicationGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteReplicationGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReplicationGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserAsync(array $args = [])\n * @method \\Aws\\Result deleteUserGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserGroupAsync(array $args = [])\n * @method \\Aws\\Result describeCacheClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCacheClustersAsync(array $args = [])\n * @method \\Aws\\Result describeCacheEngineVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCacheEngineVersionsAsync(array $args = [])\n * @method \\Aws\\Result describeCacheParameterGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCacheParameterGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeCacheParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCacheParametersAsync(array $args = [])\n * @method \\Aws\\Result describeCacheSecurityGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCacheSecurityGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeCacheSubnetGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCacheSubnetGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeEngineDefaultParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEngineDefaultParametersAsync(array $args = [])\n * @method \\Aws\\Result describeEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventsAsync(array $args = [])\n * @method \\Aws\\Result describeGlobalReplicationGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGlobalReplicationGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeReplicationGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReplicationGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeReservedCacheNodes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedCacheNodesAsync(array $args = [])\n * @method \\Aws\\Result describeReservedCacheNodesOfferings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedCacheNodesOfferingsAsync(array $args = [])\n * @method \\Aws\\Result describeServiceUpdates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeServiceUpdatesAsync(array $args = [])\n * @method \\Aws\\Result describeSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result describeUpdateActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUpdateActionsAsync(array $args = [])\n * @method \\Aws\\Result describeUserGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUsersAsync(array $args = [])\n * @method \\Aws\\Result disassociateGlobalReplicationGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateGlobalReplicationGroupAsync(array $args = [])\n * @method \\Aws\\Result failoverGlobalReplicationGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise failoverGlobalReplicationGroupAsync(array $args = [])\n * @method \\Aws\\Result increaseNodeGroupsInGlobalReplicationGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise increaseNodeGroupsInGlobalReplicationGroupAsync(array $args = [])\n * @method \\Aws\\Result increaseReplicaCount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise increaseReplicaCountAsync(array $args = [])\n * @method \\Aws\\Result listAllowedNodeTypeModifications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAllowedNodeTypeModificationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result modifyCacheCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyCacheClusterAsync(array $args = [])\n * @method \\Aws\\Result modifyCacheParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyCacheParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result modifyCacheSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyCacheSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result modifyGlobalReplicationGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyGlobalReplicationGroupAsync(array $args = [])\n * @method \\Aws\\Result modifyReplicationGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyReplicationGroupAsync(array $args = [])\n * @method \\Aws\\Result modifyReplicationGroupShardConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyReplicationGroupShardConfigurationAsync(array $args = [])\n * @method \\Aws\\Result modifyUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyUserAsync(array $args = [])\n * @method \\Aws\\Result modifyUserGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyUserGroupAsync(array $args = [])\n * @method \\Aws\\Result purchaseReservedCacheNodesOffering(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise purchaseReservedCacheNodesOfferingAsync(array $args = [])\n * @method \\Aws\\Result rebalanceSlotsInGlobalReplicationGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebalanceSlotsInGlobalReplicationGroupAsync(array $args = [])\n * @method \\Aws\\Result rebootCacheCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebootCacheClusterAsync(array $args = [])\n * @method \\Aws\\Result removeTagsFromResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsFromResourceAsync(array $args = [])\n * @method \\Aws\\Result resetCacheParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetCacheParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result revokeCacheSecurityGroupIngress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeCacheSecurityGroupIngressAsync(array $args = [])\n * @method \\Aws\\Result startMigration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMigrationAsync(array $args = [])\n * @method \\Aws\\Result testFailover(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testFailoverAsync(array $args = [])\n */\nclass ElastiCacheClient extends AwsClient {}\n", "num_lines": 141}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ElastiCache\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon ElastiCache service.\n */\nclass ElastiCacheException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ElasticBeanstalk;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Elastic Beanstalk** service.\n *\n * @method \\Aws\\Result abortEnvironmentUpdate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise abortEnvironmentUpdateAsync(array $args = [])\n * @method \\Aws\\Result applyEnvironmentManagedAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise applyEnvironmentManagedActionAsync(array $args = [])\n * @method \\Aws\\Result associateEnvironmentOperationsRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateEnvironmentOperationsRoleAsync(array $args = [])\n * @method \\Aws\\Result checkDNSAvailability(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise checkDNSAvailabilityAsync(array $args = [])\n * @method \\Aws\\Result composeEnvironments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise composeEnvironmentsAsync(array $args = [])\n * @method \\Aws\\Result createApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationAsync(array $args = [])\n * @method \\Aws\\Result createApplicationVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationVersionAsync(array $args = [])\n * @method \\Aws\\Result createConfigurationTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfigurationTemplateAsync(array $args = [])\n * @method \\Aws\\Result createEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result createPlatformVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPlatformVersionAsync(array $args = [])\n * @method \\Aws\\Result createStorageLocation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStorageLocationAsync(array $args = [])\n * @method \\Aws\\Result deleteApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteApplicationVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteConfigurationTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigurationTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteEnvironmentConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEnvironmentConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deletePlatformVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePlatformVersionAsync(array $args = [])\n * @method \\Aws\\Result describeAccountAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountAttributesAsync(array $args = [])\n * @method \\Aws\\Result describeApplicationVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeApplicationVersionsAsync(array $args = [])\n * @method \\Aws\\Result describeApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeApplicationsAsync(array $args = [])\n * @method \\Aws\\Result describeConfigurationOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConfigurationOptionsAsync(array $args = [])\n * @method \\Aws\\Result describeConfigurationSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConfigurationSettingsAsync(array $args = [])\n * @method \\Aws\\Result describeEnvironmentHealth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEnvironmentHealthAsync(array $args = [])\n * @method \\Aws\\Result describeEnvironmentManagedActionHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEnvironmentManagedActionHistoryAsync(array $args = [])\n * @method \\Aws\\Result describeEnvironmentManagedActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEnvironmentManagedActionsAsync(array $args = [])\n * @method \\Aws\\Result describeEnvironmentResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEnvironmentResourcesAsync(array $args = [])\n * @method \\Aws\\Result describeEnvironments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEnvironmentsAsync(array $args = [])\n * @method \\Aws\\Result describeEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventsAsync(array $args = [])\n * @method \\Aws\\Result describeInstancesHealth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstancesHealthAsync(array $args = [])\n * @method \\Aws\\Result describePlatformVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePlatformVersionAsync(array $args = [])\n * @method \\Aws\\Result disassociateEnvironmentOperationsRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateEnvironmentOperationsRoleAsync(array $args = [])\n * @method \\Aws\\Result listAvailableSolutionStacks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAvailableSolutionStacksAsync(array $args = [])\n * @method \\Aws\\Result listPlatformBranches(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPlatformBranchesAsync(array $args = [])\n * @method \\Aws\\Result listPlatformVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPlatformVersionsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result rebuildEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebuildEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result requestEnvironmentInfo(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise requestEnvironmentInfoAsync(array $args = [])\n * @method \\Aws\\Result restartAppServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restartAppServerAsync(array $args = [])\n * @method \\Aws\\Result retrieveEnvironmentInfo(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise retrieveEnvironmentInfoAsync(array $args = [])\n * @method \\Aws\\Result swapEnvironmentCNAMEs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise swapEnvironmentCNAMEsAsync(array $args = [])\n * @method \\Aws\\Result terminateEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise terminateEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result updateApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationAsync(array $args = [])\n * @method \\Aws\\Result updateApplicationResourceLifecycle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationResourceLifecycleAsync(array $args = [])\n * @method \\Aws\\Result updateApplicationVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationVersionAsync(array $args = [])\n * @method \\Aws\\Result updateConfigurationTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConfigurationTemplateAsync(array $args = [])\n * @method \\Aws\\Result updateEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result updateTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result validateConfigurationSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise validateConfigurationSettingsAsync(array $args = [])\n */\nclass ElasticBeanstalkClient extends AwsClient {}\n", "num_lines": 105}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ElasticBeanstalk\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the AWS Elastic Beanstalk service.\n */\nclass ElasticBeanstalkException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ElasticInference;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Elastic  Inference** service.\n * @method \\Aws\\Result describeAcceleratorOfferings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAcceleratorOfferingsAsync(array $args = [])\n * @method \\Aws\\Result describeAcceleratorTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAcceleratorTypesAsync(array $args = [])\n * @method \\Aws\\Result describeAccelerators(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAcceleratorsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass ElasticInferenceClient extends AwsClient {}\n", "num_lines": 22}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ElasticInference\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Elastic  Inference** service.\n */\nclass ElasticInferenceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ElasticLoadBalancing;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Elastic Load Balancing** service.\n *\n * @method \\Aws\\Result addTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsAsync(array $args = [])\n * @method \\Aws\\Result applySecurityGroupsToLoadBalancer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise applySecurityGroupsToLoadBalancerAsync(array $args = [])\n * @method \\Aws\\Result attachLoadBalancerToSubnets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachLoadBalancerToSubnetsAsync(array $args = [])\n * @method \\Aws\\Result configureHealthCheck(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise configureHealthCheckAsync(array $args = [])\n * @method \\Aws\\Result createAppCookieStickinessPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppCookieStickinessPolicyAsync(array $args = [])\n * @method \\Aws\\Result createLBCookieStickinessPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLBCookieStickinessPolicyAsync(array $args = [])\n * @method \\Aws\\Result createLoadBalancer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLoadBalancerAsync(array $args = [])\n * @method \\Aws\\Result createLoadBalancerListeners(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLoadBalancerListenersAsync(array $args = [])\n * @method \\Aws\\Result createLoadBalancerPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLoadBalancerPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteLoadBalancer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLoadBalancerAsync(array $args = [])\n * @method \\Aws\\Result deleteLoadBalancerListeners(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLoadBalancerListenersAsync(array $args = [])\n * @method \\Aws\\Result deleteLoadBalancerPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLoadBalancerPolicyAsync(array $args = [])\n * @method \\Aws\\Result deregisterInstancesFromLoadBalancer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterInstancesFromLoadBalancerAsync(array $args = [])\n * @method \\Aws\\Result describeAccountLimits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountLimitsAsync(array $args = [])\n * @method \\Aws\\Result describeInstanceHealth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceHealthAsync(array $args = [])\n * @method \\Aws\\Result describeLoadBalancerAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLoadBalancerAttributesAsync(array $args = [])\n * @method \\Aws\\Result describeLoadBalancerPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLoadBalancerPoliciesAsync(array $args = [])\n * @method \\Aws\\Result describeLoadBalancerPolicyTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLoadBalancerPolicyTypesAsync(array $args = [])\n * @method \\Aws\\Result describeLoadBalancers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLoadBalancersAsync(array $args = [])\n * @method \\Aws\\Result describeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTagsAsync(array $args = [])\n * @method \\Aws\\Result detachLoadBalancerFromSubnets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachLoadBalancerFromSubnetsAsync(array $args = [])\n * @method \\Aws\\Result disableAvailabilityZonesForLoadBalancer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableAvailabilityZonesForLoadBalancerAsync(array $args = [])\n * @method \\Aws\\Result enableAvailabilityZonesForLoadBalancer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableAvailabilityZonesForLoadBalancerAsync(array $args = [])\n * @method \\Aws\\Result modifyLoadBalancerAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyLoadBalancerAttributesAsync(array $args = [])\n * @method \\Aws\\Result registerInstancesWithLoadBalancer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerInstancesWithLoadBalancerAsync(array $args = [])\n * @method \\Aws\\Result removeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsAsync(array $args = [])\n * @method \\Aws\\Result setLoadBalancerListenerSSLCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setLoadBalancerListenerSSLCertificateAsync(array $args = [])\n * @method \\Aws\\Result setLoadBalancerPoliciesForBackendServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setLoadBalancerPoliciesForBackendServerAsync(array $args = [])\n * @method \\Aws\\Result setLoadBalancerPoliciesOfListener(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setLoadBalancerPoliciesOfListenerAsync(array $args = [])\n */\nclass ElasticLoadBalancingClient extends AwsClient {}\n", "num_lines": 69}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ElasticLoadBalancing\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Elastic Load Balancing service.\n */\nclass ElasticLoadBalancingException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ElasticLoadBalancingV2;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Elastic Load Balancing** service.\n * @method \\Aws\\Result addListenerCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addListenerCertificatesAsync(array $args = [])\n * @method \\Aws\\Result addTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsAsync(array $args = [])\n * @method \\Aws\\Result createListener(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createListenerAsync(array $args = [])\n * @method \\Aws\\Result createLoadBalancer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLoadBalancerAsync(array $args = [])\n * @method \\Aws\\Result createRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRuleAsync(array $args = [])\n * @method \\Aws\\Result createTargetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTargetGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteListener(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteListenerAsync(array $args = [])\n * @method \\Aws\\Result deleteLoadBalancer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLoadBalancerAsync(array $args = [])\n * @method \\Aws\\Result deleteRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteTargetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTargetGroupAsync(array $args = [])\n * @method \\Aws\\Result deregisterTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterTargetsAsync(array $args = [])\n * @method \\Aws\\Result describeAccountLimits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountLimitsAsync(array $args = [])\n * @method \\Aws\\Result describeListenerCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeListenerCertificatesAsync(array $args = [])\n * @method \\Aws\\Result describeListeners(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeListenersAsync(array $args = [])\n * @method \\Aws\\Result describeLoadBalancerAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLoadBalancerAttributesAsync(array $args = [])\n * @method \\Aws\\Result describeLoadBalancers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLoadBalancersAsync(array $args = [])\n * @method \\Aws\\Result describeRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRulesAsync(array $args = [])\n * @method \\Aws\\Result describeSSLPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSSLPoliciesAsync(array $args = [])\n * @method \\Aws\\Result describeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTagsAsync(array $args = [])\n * @method \\Aws\\Result describeTargetGroupAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTargetGroupAttributesAsync(array $args = [])\n * @method \\Aws\\Result describeTargetGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTargetGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeTargetHealth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTargetHealthAsync(array $args = [])\n * @method \\Aws\\Result modifyListener(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyListenerAsync(array $args = [])\n * @method \\Aws\\Result modifyLoadBalancerAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyLoadBalancerAttributesAsync(array $args = [])\n * @method \\Aws\\Result modifyRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyRuleAsync(array $args = [])\n * @method \\Aws\\Result modifyTargetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyTargetGroupAsync(array $args = [])\n * @method \\Aws\\Result modifyTargetGroupAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyTargetGroupAttributesAsync(array $args = [])\n * @method \\Aws\\Result registerTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerTargetsAsync(array $args = [])\n * @method \\Aws\\Result removeListenerCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeListenerCertificatesAsync(array $args = [])\n * @method \\Aws\\Result removeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsAsync(array $args = [])\n * @method \\Aws\\Result setIpAddressType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setIpAddressTypeAsync(array $args = [])\n * @method \\Aws\\Result setRulePriorities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setRulePrioritiesAsync(array $args = [])\n * @method \\Aws\\Result setSecurityGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setSecurityGroupsAsync(array $args = [])\n * @method \\Aws\\Result setSubnets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setSubnetsAsync(array $args = [])\n */\nclass ElasticLoadBalancingV2Client extends AwsClient {}\n", "num_lines": 78}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ElasticLoadBalancingV2\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Elastic Load Balancing** service.\n */\nclass ElasticLoadBalancingV2Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ElasticsearchService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Elasticsearch Service** service.\n *\n * @method \\Aws\\Result acceptInboundCrossClusterSearchConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptInboundCrossClusterSearchConnectionAsync(array $args = [])\n * @method \\Aws\\Result addTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsAsync(array $args = [])\n * @method \\Aws\\Result associatePackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associatePackageAsync(array $args = [])\n * @method \\Aws\\Result authorizeVpcEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise authorizeVpcEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result cancelElasticsearchServiceSoftwareUpdate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelElasticsearchServiceSoftwareUpdateAsync(array $args = [])\n * @method \\Aws\\Result createElasticsearchDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createElasticsearchDomainAsync(array $args = [])\n * @method \\Aws\\Result createOutboundCrossClusterSearchConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createOutboundCrossClusterSearchConnectionAsync(array $args = [])\n * @method \\Aws\\Result createPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPackageAsync(array $args = [])\n * @method \\Aws\\Result createVpcEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpcEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteElasticsearchDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteElasticsearchDomainAsync(array $args = [])\n * @method \\Aws\\Result deleteElasticsearchServiceRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteElasticsearchServiceRoleAsync(array $args = [])\n * @method \\Aws\\Result deleteInboundCrossClusterSearchConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInboundCrossClusterSearchConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteOutboundCrossClusterSearchConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOutboundCrossClusterSearchConnectionAsync(array $args = [])\n * @method \\Aws\\Result deletePackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePackageAsync(array $args = [])\n * @method \\Aws\\Result deleteVpcEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpcEndpointAsync(array $args = [])\n * @method \\Aws\\Result describeDomainAutoTunes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainAutoTunesAsync(array $args = [])\n * @method \\Aws\\Result describeDomainChangeProgress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainChangeProgressAsync(array $args = [])\n * @method \\Aws\\Result describeElasticsearchDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeElasticsearchDomainAsync(array $args = [])\n * @method \\Aws\\Result describeElasticsearchDomainConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeElasticsearchDomainConfigAsync(array $args = [])\n * @method \\Aws\\Result describeElasticsearchDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeElasticsearchDomainsAsync(array $args = [])\n * @method \\Aws\\Result describeElasticsearchInstanceTypeLimits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeElasticsearchInstanceTypeLimitsAsync(array $args = [])\n * @method \\Aws\\Result describeInboundCrossClusterSearchConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInboundCrossClusterSearchConnectionsAsync(array $args = [])\n * @method \\Aws\\Result describeOutboundCrossClusterSearchConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOutboundCrossClusterSearchConnectionsAsync(array $args = [])\n * @method \\Aws\\Result describePackages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePackagesAsync(array $args = [])\n * @method \\Aws\\Result describeReservedElasticsearchInstanceOfferings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedElasticsearchInstanceOfferingsAsync(array $args = [])\n * @method \\Aws\\Result describeReservedElasticsearchInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedElasticsearchInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeVpcEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcEndpointsAsync(array $args = [])\n * @method \\Aws\\Result dissociatePackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise dissociatePackageAsync(array $args = [])\n * @method \\Aws\\Result getCompatibleElasticsearchVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCompatibleElasticsearchVersionsAsync(array $args = [])\n * @method \\Aws\\Result getPackageVersionHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPackageVersionHistoryAsync(array $args = [])\n * @method \\Aws\\Result getUpgradeHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUpgradeHistoryAsync(array $args = [])\n * @method \\Aws\\Result getUpgradeStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUpgradeStatusAsync(array $args = [])\n * @method \\Aws\\Result listDomainNames(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainNamesAsync(array $args = [])\n * @method \\Aws\\Result listDomainsForPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainsForPackageAsync(array $args = [])\n * @method \\Aws\\Result listElasticsearchInstanceTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listElasticsearchInstanceTypesAsync(array $args = [])\n * @method \\Aws\\Result listElasticsearchVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listElasticsearchVersionsAsync(array $args = [])\n * @method \\Aws\\Result listPackagesForDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPackagesForDomainAsync(array $args = [])\n * @method \\Aws\\Result listTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsAsync(array $args = [])\n * @method \\Aws\\Result listVpcEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVpcEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result listVpcEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVpcEndpointsAsync(array $args = [])\n * @method \\Aws\\Result listVpcEndpointsForDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVpcEndpointsForDomainAsync(array $args = [])\n * @method \\Aws\\Result purchaseReservedElasticsearchInstanceOffering(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise purchaseReservedElasticsearchInstanceOfferingAsync(array $args = [])\n * @method \\Aws\\Result rejectInboundCrossClusterSearchConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectInboundCrossClusterSearchConnectionAsync(array $args = [])\n * @method \\Aws\\Result removeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsAsync(array $args = [])\n * @method \\Aws\\Result revokeVpcEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeVpcEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result startElasticsearchServiceSoftwareUpdate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startElasticsearchServiceSoftwareUpdateAsync(array $args = [])\n * @method \\Aws\\Result updateElasticsearchDomainConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateElasticsearchDomainConfigAsync(array $args = [])\n * @method \\Aws\\Result updatePackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePackageAsync(array $args = [])\n * @method \\Aws\\Result updateVpcEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVpcEndpointAsync(array $args = [])\n * @method \\Aws\\Result upgradeElasticsearchDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise upgradeElasticsearchDomainAsync(array $args = [])\n */\nclass ElasticsearchServiceClient extends AwsClient {}\n", "num_lines": 111}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ElasticsearchService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Elasticsearch Service** service.\n */\nclass ElasticsearchServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ElasticTranscoder;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Elastic Transcoder** service.\n *\n * @method \\Aws\\Result cancelJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelJobAsync(array $args = [])\n * @method \\Aws\\Result createJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createJobAsync(array $args = [])\n * @method \\Aws\\Result createPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPipelineAsync(array $args = [])\n * @method \\Aws\\Result createPreset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPresetAsync(array $args = [])\n * @method \\Aws\\Result deletePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePipelineAsync(array $args = [])\n * @method \\Aws\\Result deletePreset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePresetAsync(array $args = [])\n * @method \\Aws\\Result listJobsByPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobsByPipelineAsync(array $args = [])\n * @method \\Aws\\Result listJobsByStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobsByStatusAsync(array $args = [])\n * @method \\Aws\\Result listPipelines(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPipelinesAsync(array $args = [])\n * @method \\Aws\\Result listPresets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPresetsAsync(array $args = [])\n * @method \\Aws\\Result readJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise readJobAsync(array $args = [])\n * @method \\Aws\\Result readPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise readPipelineAsync(array $args = [])\n * @method \\Aws\\Result readPreset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise readPresetAsync(array $args = [])\n * @method \\Aws\\Result testRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testRoleAsync(array $args = [])\n * @method \\Aws\\Result updatePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePipelineAsync(array $args = [])\n * @method \\Aws\\Result updatePipelineNotifications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePipelineNotificationsAsync(array $args = [])\n * @method \\Aws\\Result updatePipelineStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePipelineStatusAsync(array $args = [])\n */\nclass ElasticTranscoderClient extends AwsClient {}\n", "num_lines": 45}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ElasticTranscoder\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon Elastic Transcoder service.\n */\nclass ElasticTranscoderException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Emr;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Elastic MapReduce (Amazon EMR)** service.\n *\n * @method \\Aws\\Result addInstanceFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addInstanceFleetAsync(array $args = [])\n * @method \\Aws\\Result addInstanceGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addInstanceGroupsAsync(array $args = [])\n * @method \\Aws\\Result addJobFlowSteps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addJobFlowStepsAsync(array $args = [])\n * @method \\Aws\\Result addTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsAsync(array $args = [])\n * @method \\Aws\\Result cancelSteps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelStepsAsync(array $args = [])\n * @method \\Aws\\Result createSecurityConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSecurityConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createStudio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStudioAsync(array $args = [])\n * @method \\Aws\\Result createStudioSessionMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStudioSessionMappingAsync(array $args = [])\n * @method \\Aws\\Result deleteSecurityConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSecurityConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteStudio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStudioAsync(array $args = [])\n * @method \\Aws\\Result deleteStudioSessionMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStudioSessionMappingAsync(array $args = [])\n * @method \\Aws\\Result describeCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClusterAsync(array $args = [])\n * @method \\Aws\\Result describeJobFlows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJobFlowsAsync(array $args = [])\n * @method \\Aws\\Result describeNotebookExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNotebookExecutionAsync(array $args = [])\n * @method \\Aws\\Result describeReleaseLabel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReleaseLabelAsync(array $args = [])\n * @method \\Aws\\Result describeSecurityConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSecurityConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeStep(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStepAsync(array $args = [])\n * @method \\Aws\\Result describeStudio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStudioAsync(array $args = [])\n * @method \\Aws\\Result getAutoTerminationPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAutoTerminationPolicyAsync(array $args = [])\n * @method \\Aws\\Result getBlockPublicAccessConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBlockPublicAccessConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getClusterSessionCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getClusterSessionCredentialsAsync(array $args = [])\n * @method \\Aws\\Result getManagedScalingPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getManagedScalingPolicyAsync(array $args = [])\n * @method \\Aws\\Result getStudioSessionMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStudioSessionMappingAsync(array $args = [])\n * @method \\Aws\\Result listBootstrapActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBootstrapActionsAsync(array $args = [])\n * @method \\Aws\\Result listClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listClustersAsync(array $args = [])\n * @method \\Aws\\Result listInstanceFleets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInstanceFleetsAsync(array $args = [])\n * @method \\Aws\\Result listInstanceGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInstanceGroupsAsync(array $args = [])\n * @method \\Aws\\Result listInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInstancesAsync(array $args = [])\n * @method \\Aws\\Result listNotebookExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNotebookExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listReleaseLabels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReleaseLabelsAsync(array $args = [])\n * @method \\Aws\\Result listSecurityConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSecurityConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listSteps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStepsAsync(array $args = [])\n * @method \\Aws\\Result listStudioSessionMappings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStudioSessionMappingsAsync(array $args = [])\n * @method \\Aws\\Result listStudios(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStudiosAsync(array $args = [])\n * @method \\Aws\\Result listSupportedInstanceTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSupportedInstanceTypesAsync(array $args = [])\n * @method \\Aws\\Result modifyCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyClusterAsync(array $args = [])\n * @method \\Aws\\Result modifyInstanceFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyInstanceFleetAsync(array $args = [])\n * @method \\Aws\\Result modifyInstanceGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyInstanceGroupsAsync(array $args = [])\n * @method \\Aws\\Result putAutoScalingPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAutoScalingPolicyAsync(array $args = [])\n * @method \\Aws\\Result putAutoTerminationPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAutoTerminationPolicyAsync(array $args = [])\n * @method \\Aws\\Result putBlockPublicAccessConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBlockPublicAccessConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putManagedScalingPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putManagedScalingPolicyAsync(array $args = [])\n * @method \\Aws\\Result removeAutoScalingPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeAutoScalingPolicyAsync(array $args = [])\n * @method \\Aws\\Result removeAutoTerminationPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeAutoTerminationPolicyAsync(array $args = [])\n * @method \\Aws\\Result removeManagedScalingPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeManagedScalingPolicyAsync(array $args = [])\n * @method \\Aws\\Result removeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsAsync(array $args = [])\n * @method \\Aws\\Result runJobFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise runJobFlowAsync(array $args = [])\n * @method \\Aws\\Result setTerminationProtection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setTerminationProtectionAsync(array $args = [])\n * @method \\Aws\\Result setVisibleToAllUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setVisibleToAllUsersAsync(array $args = [])\n * @method \\Aws\\Result startNotebookExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startNotebookExecutionAsync(array $args = [])\n * @method \\Aws\\Result stopNotebookExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopNotebookExecutionAsync(array $args = [])\n * @method \\Aws\\Result terminateJobFlows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise terminateJobFlowsAsync(array $args = [])\n * @method \\Aws\\Result updateStudio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStudioAsync(array $args = [])\n * @method \\Aws\\Result updateStudioSessionMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStudioSessionMappingAsync(array $args = [])\n */\nclass EmrClient extends AwsClient {}\n", "num_lines": 119}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Emr\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon Elastic MapReduce service.\n */\nclass EmrException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EMRContainers;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon EMR Containers** service.\n * @method \\Aws\\Result cancelJobRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelJobRunAsync(array $args = [])\n * @method \\Aws\\Result createJobTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createJobTemplateAsync(array $args = [])\n * @method \\Aws\\Result createManagedEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createManagedEndpointAsync(array $args = [])\n * @method \\Aws\\Result createVirtualCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVirtualClusterAsync(array $args = [])\n * @method \\Aws\\Result deleteJobTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteJobTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteManagedEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteManagedEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteVirtualCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVirtualClusterAsync(array $args = [])\n * @method \\Aws\\Result describeJobRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJobRunAsync(array $args = [])\n * @method \\Aws\\Result describeJobTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJobTemplateAsync(array $args = [])\n * @method \\Aws\\Result describeManagedEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeManagedEndpointAsync(array $args = [])\n * @method \\Aws\\Result describeVirtualCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVirtualClusterAsync(array $args = [])\n * @method \\Aws\\Result getManagedEndpointSessionCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getManagedEndpointSessionCredentialsAsync(array $args = [])\n * @method \\Aws\\Result listJobRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobRunsAsync(array $args = [])\n * @method \\Aws\\Result listJobTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listManagedEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listManagedEndpointsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listVirtualClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVirtualClustersAsync(array $args = [])\n * @method \\Aws\\Result startJobRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startJobRunAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass EMRContainersClient extends AwsClient {}\n", "num_lines": 50}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EMRContainers\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon EMR Containers** service.\n */\nclass EMRContainersException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EMRServerless;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **EMR Serverless** service.\n * @method \\Aws\\Result cancelJobRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelJobRunAsync(array $args = [])\n * @method \\Aws\\Result createApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationAsync(array $args = [])\n * @method \\Aws\\Result getApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApplicationAsync(array $args = [])\n * @method \\Aws\\Result getDashboardForJobRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDashboardForJobRunAsync(array $args = [])\n * @method \\Aws\\Result getJobRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobRunAsync(array $args = [])\n * @method \\Aws\\Result listApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listJobRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobRunsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startApplicationAsync(array $args = [])\n * @method \\Aws\\Result startJobRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startJobRunAsync(array $args = [])\n * @method \\Aws\\Result stopApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopApplicationAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationAsync(array $args = [])\n */\nclass EMRServerlessClient extends AwsClient {}\n", "num_lines": 40}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EMRServerless\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **EMR Serverless** service.\n */\nclass EMRServerlessException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Endpoint;\n\nuse Aws\\Exception\\UnresolvedEndpointException;\n\n/**\n * Endpoint providers.\n *\n * An endpoint provider is a function that accepts a hash of endpoint options,\n * including but not limited to \"service\" and \"region\" key value pairs. The\n * endpoint provider function returns a hash of endpoint data, which MUST\n * include an \"endpoint\" key value pair that represents the resolved endpoint\n * or NULL if an endpoint cannot be determined.\n *\n * You can wrap your calls to an endpoint provider with the\n * {@see EndpointProvider::resolve} function to ensure that an endpoint hash is\n * created. If an endpoint hash is not created, then the resolve() function\n * will throw an {@see Aws\\Exception\\UnresolvedEndpointException}.\n *\n *     use Aws\\Endpoint\\EndpointProvider;\n *     $provider = EndpointProvider::defaultProvider();\n *     // Returns an array or NULL.\n *     $endpoint = $provider(['service' => 'ec2', 'region' => 'us-west-2']);\n *     // Returns an endpoint array or throws.\n *     $endpoint = EndpointProvider::resolve($provider, [\n *         'service' => 'ec2',\n *         'region'  => 'us-west-2'\n *     ]);\n *\n * You can compose multiple providers into a single provider using\n * {@see Aws\\or_chain}. This function accepts providers as arguments and\n * returns a new function that will invoke each provider until a non-null value\n * is returned.\n *\n *     $a = function (array $args) {\n *         if ($args['region'] === 'my-test-region') {\n *             return ['endpoint' => 'http://localhost:123/api'];\n *         }\n *     };\n *     $b = EndpointProvider::defaultProvider();\n *     $c = \\Aws\\or_chain($a, $b);\n *     $config = ['service' => 'ec2', 'region' => 'my-test-region'];\n *     $res = $c($config);  // $a handles this.\n *     $config['region'] = 'us-west-2';\n *     $res = $c($config); // $b handles this.\n */\nclass EndpointProvider\n{\n    /**\n     * Resolves and endpoint provider and ensures a non-null return value.\n     *\n     * @param callable $provider Provider function to invoke.\n     * @param array    $args     Endpoint arguments to pass to the provider.\n     *\n     * @return array\n     * @throws UnresolvedEndpointException\n     */\n    public static function resolve(callable $provider, array $args = [])\n    {\n        $result = $provider($args);\n        if (is_array($result)) {\n            return $result;\n        }\n\n        throw new UnresolvedEndpointException(\n            'Unable to resolve an endpoint using the provider arguments: '\n            . json_encode($args) . '. Note: you can provide an \"endpoint\" '\n            . 'option to a client constructor to bypass invoking an endpoint '\n            . 'provider.');\n    }\n\n    /**\n     * Creates and returns the default SDK endpoint provider.\n     *\n     * @deprecated Use an instance of \\Aws\\Endpoint\\Partition instead.\n     *\n     * @return callable\n     */\n    public static function defaultProvider()\n    {\n        return PartitionEndpointProvider::defaultProvider();\n    }\n\n    /**\n     * Creates and returns an endpoint provider that uses patterns from an\n     * array.\n     *\n     * @param array $patterns Endpoint patterns\n     *\n     * @return callable\n     */\n    public static function patterns(array $patterns)\n    {\n        return new PatternEndpointProvider($patterns);\n    }\n}\n", "num_lines": 97}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Endpoint;\n\nuse ArrayAccess;\nuse Aws\\HasDataTrait;\nuse Aws\\Sts\\RegionalEndpoints\\ConfigurationProvider;\nuse Aws\\S3\\RegionalEndpoint\\ConfigurationProvider as S3ConfigurationProvider;\nuse InvalidArgumentException as Iae;\n\n/**\n * Default implementation of an AWS partition.\n */\nfinal class Partition implements ArrayAccess, PartitionInterface\n{\n    use HasDataTrait;\n\n    private $stsLegacyGlobalRegions = [\n        'ap-northeast-1',\n        'ap-south-1',\n        'ap-southeast-1',\n        'ap-southeast-2',\n        'aws-global',\n        'ca-central-1',\n        'eu-central-1',\n        'eu-north-1',\n        'eu-west-1',\n        'eu-west-2',\n        'eu-west-3',\n        'sa-east-1',\n        'us-east-1',\n        'us-east-2',\n        'us-west-1',\n        'us-west-2',\n    ];\n\n    /**\n     * The partition constructor accepts the following options:\n     *\n     * - `partition`: (string, required) The partition name as specified in an\n     *   ARN (e.g., `aws`)\n     * - `partitionName`: (string) The human readable name of the partition\n     *   (e.g., \"AWS Standard\")\n     * - `dnsSuffix`: (string, required) The DNS suffix of the partition. This\n     *   value is used to determine how endpoints in the partition are resolved.\n     * - `regionRegex`: (string) A PCRE regular expression that specifies the\n     *   pattern that region names in the endpoint adhere to.\n     * - `regions`: (array, required) A map of the regions in the partition.\n     *   Each key is the region as present in a hostname (e.g., `us-east-1`),\n     *   and each value is a structure containing region information.\n     * - `defaults`: (array) A map of default key value pairs to apply to each\n     *   endpoint of the partition. Any value in an `endpoint` definition will\n     *   supersede any values specified in `defaults`.\n     * - `services`: (array, required) A map of service endpoint prefix name\n     *   (the value found in a hostname) to information about the service.\n     *\n     * @param array $definition\n     *\n     * @throws Iae if any required options are missing\n     */\n    public function __construct(array $definition)\n    {\n        foreach (['partition', 'regions', 'services', 'dnsSuffix'] as $key) {\n            if (!isset($definition[$key])) {\n                throw new Iae(\"Partition missing required $key field\");\n            }\n        }\n\n        $this->data = $definition;\n    }\n\n    public function getName()\n    {\n        return $this->data['partition'];\n    }\n\n    /**\n     * @internal\n     * @return mixed\n     */\n    public function getDnsSuffix()\n    {\n        return $this->data['dnsSuffix'];\n    }\n\n    public function isRegionMatch($region, $service)\n    {\n        if (isset($this->data['regions'][$region])\n            || isset($this->data['services'][$service]['endpoints'][$region])\n        ) {\n            return true;\n        }\n\n        if (isset($this->data['regionRegex'])) {\n            return (bool) preg_match(\n                \"@{$this->data['regionRegex']}@\",\n                $region\n            );\n        }\n\n        return false;\n    }\n\n    public function getAvailableEndpoints(\n        $service,\n        $allowNonRegionalEndpoints = false\n    ) {\n        if ($this->isServicePartitionGlobal($service)) {\n            return [$this->getPartitionEndpoint($service)];\n        }\n\n        if (isset($this->data['services'][$service]['endpoints'])) {\n            $serviceRegions = array_keys(\n                $this->data['services'][$service]['endpoints']\n            );\n\n            return $allowNonRegionalEndpoints\n                ? $serviceRegions\n                : array_intersect($serviceRegions, array_keys(\n                    $this->data['regions']\n                ));\n        }\n\n        return [];\n    }\n\n    public function __invoke(array $args = [])\n    {\n        $service = isset($args['service']) ? $args['service'] : '';\n        $region = isset($args['region']) ? $args['region'] : '';\n        $scheme = isset($args['scheme']) ? $args['scheme'] : 'https';\n        $options = isset($args['options']) ? $args['options'] : [];\n        $data = $this->getEndpointData($service, $region, $options);\n        $variant = $this->getVariant($options, $data);\n        if (isset($variant['hostname'])) {\n            $template = $variant['hostname'];\n        } else {\n            $template = isset($data['hostname']) ? $data['hostname'] : '';\n        }\n        $dnsSuffix = isset($variant['dnsSuffix'])\n            ? $variant['dnsSuffix']\n            : $this->data['dnsSuffix'];\n        return [\n            'endpoint' => \"{$scheme}://\" . $this->formatEndpoint(\n                    $template,\n                    $service,\n                    $region,\n                    $dnsSuffix\n                ),\n            'signatureVersion' => $this->getSignatureVersion($data),\n            'signingRegion' => isset($data['credentialScope']['region'])\n                ? $data['credentialScope']['region']\n                : $region,\n            'signingName' => isset($data['credentialScope']['service'])\n                ? $data['credentialScope']['service']\n                : $service,\n        ];\n    }\n\n    private function getEndpointData($service, $region, $options)\n    {\n        $defaultRegion = $this->resolveRegion($service, $region, $options);\n        $data = isset($this->data['services'][$service]['endpoints'][$defaultRegion])\n            ? $this->data['services'][$service]['endpoints'][$defaultRegion]\n            : [];\n        $data += isset($this->data['services'][$service]['defaults'])\n            ? $this->data['services'][$service]['defaults']\n            : [];\n        $data += isset($this->data['defaults'])\n            ? $this->data['defaults']\n            : [];\n\n        return $data;\n    }\n\n    private function getSignatureVersion(array $data)\n    {\n        static $supportedBySdk = [\n            's3v4',\n            'v4',\n            'anonymous',\n        ];\n\n        $possibilities = array_intersect(\n            $supportedBySdk,\n            isset($data['signatureVersions'])\n                ? $data['signatureVersions']\n                : ['v4']\n        );\n\n        return array_shift($possibilities);\n    }\n\n    private function resolveRegion($service, $region, $options)\n    {\n        if (isset($this->data['services'][$service]['endpoints'][$region])\n            && $this->isFipsEndpointUsed($region)\n        ) {\n            return $region;\n        }\n\n        if ($this->isServicePartitionGlobal($service)\n            || $this->isStsLegacyEndpointUsed($service, $region, $options)\n            || $this->isS3LegacyEndpointUsed($service, $region, $options)\n        ) {\n            return $this->getPartitionEndpoint($service);\n        }\n\n        return $region;\n    }\n\n    private function isServicePartitionGlobal($service)\n    {\n        return isset($this->data['services'][$service]['isRegionalized'])\n            && false === $this->data['services'][$service]['isRegionalized']\n            && isset($this->data['services'][$service]['partitionEndpoint']);\n    }\n\n    /**\n     * STS legacy endpoints used for valid regions unless option is explicitly\n     * set to 'regional'\n     *\n     * @param string $service\n     * @param string $region\n     * @param array $options\n     * @return bool\n     */\n    private function isStsLegacyEndpointUsed($service, $region, $options)\n    {\n        return $service === 'sts'\n            && in_array($region, $this->stsLegacyGlobalRegions)\n            && (empty($options['sts_regional_endpoints'])\n                || ConfigurationProvider::unwrap(\n                    $options['sts_regional_endpoints']\n                )->getEndpointsType() !== 'regional'\n            );\n    }\n\n    /**\n     * S3 legacy us-east-1 endpoint used for valid regions unless option is explicitly\n     * set to 'regional'\n     *\n     * @param string $service\n     * @param string $region\n     * @param array $options\n     * @return bool\n     */\n    private function isS3LegacyEndpointUsed($service, $region, $options)\n    {\n        return $service === 's3'\n            && $region === 'us-east-1'\n            && (empty($options['s3_us_east_1_regional_endpoint'])\n                || S3ConfigurationProvider::unwrap(\n                    $options['s3_us_east_1_regional_endpoint']\n                )->getEndpointsType() !== 'regional'\n            );\n    }\n\n    private function getPartitionEndpoint($service)\n    {\n        return $this->data['services'][$service]['partitionEndpoint'];\n    }\n\n    private function formatEndpoint($template, $service, $region, $dnsSuffix)\n    {\n        return strtr($template, [\n            '{service}' => $service,\n            '{region}' => $region,\n            '{dnsSuffix}' => $dnsSuffix,\n        ]);\n    }\n\n    /**\n     * @param $region\n     * @return bool\n     */\n    private function isFipsEndpointUsed($region)\n    {\n        return strpos($region, \"fips\") !== false;\n    }\n\n    /**\n     * @param array $options\n     * @param array $data\n     * @return array\n     */\n    private function getVariant(array $options, array $data)\n    {\n        $variantTags = [];\n        if (isset($options['use_fips_endpoint'])) {\n            $useFips = $options['use_fips_endpoint'];\n            if (is_bool($useFips)) {\n                $useFips && $variantTags[] = 'fips';\n            } elseif ($useFips->isUseFipsEndpoint()) {\n                $variantTags[] = 'fips';\n            }\n        }\n        if (isset($options['use_dual_stack_endpoint'])) {\n            $useDualStack = $options['use_dual_stack_endpoint'];\n            if (is_bool($useDualStack)) {\n                $useDualStack && $variantTags[] = 'dualstack';\n            } elseif ($useDualStack->isUseDualStackEndpoint()) {\n                $variantTags[] = 'dualstack';\n            }\n        }\n        if (!empty($variantTags)) {\n            if (isset($data['variants'])) {\n                foreach ($data['variants'] as $variant) {\n                    if (array_count_values($variant['tags']) == array_count_values($variantTags)) {\n                        return $variant;\n                    }\n                }\n            }\n            if (isset($this->data['defaults']['variants'])) {\n                foreach ($this->data['defaults']['variants'] as $variant) {\n                    if (array_count_values($variant['tags']) == array_count_values($variantTags)) {\n                        return $variant;\n                    }\n                }\n            }\n        }\n    }\n}\n", "num_lines": 323}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Endpoint;\n\nuse JmesPath\\Env;\n\nclass PartitionEndpointProvider\n{\n    /** @var Partition[] */\n    private $partitions;\n    /** @var string */\n    private $defaultPartition;\n    /** @var array  */\n    private $options;\n\n    /**\n     * The 'options' parameter accepts the following arguments:\n     *\n     * - sts_regional_endpoints: For STS legacy regions, set to 'regional' to\n     *   use regional endpoints, 'legacy' to use the legacy global endpoint.\n     *   Defaults to 'legacy'.\n     * - s3_us_east_1_regional_endpoint: For S3 us-east-1 region, set to 'regional'\n     *   to use the regional endpoint, 'legacy' to use the legacy global endpoint.\n     *   Defaults to 'legacy'.\n     *\n     * @param array $partitions\n     * @param string $defaultPartition\n     * @param array $options\n     */\n    public function __construct(\n        array $partitions,\n        $defaultPartition = 'aws',\n        $options = []\n    ) {\n        $this->partitions = array_map(function (array $definition) {\n            return new Partition($definition);\n        }, array_values($partitions));\n        $this->defaultPartition = $defaultPartition;\n        $this->options = $options;\n    }\n\n    public function __invoke(array $args = [])\n    {\n        $partition = $this->getPartition(\n            isset($args['region']) ? $args['region'] : '',\n            isset($args['service']) ? $args['service'] : ''\n        );\n        $args['options'] = $this->options;\n\n        return $partition($args);\n    }\n\n    /**\n     * Returns the partition containing the provided region or the default\n     * partition if no match is found.\n     *\n     * @param string $region\n     * @param string $service\n     *\n     * @return Partition\n     */\n    public function getPartition($region, $service)\n    {\n        foreach ($this->partitions as $partition) {\n            if ($partition->isRegionMatch($region, $service)) {\n                return $partition;\n            }\n        }\n\n        return $this->getPartitionByName($this->defaultPartition);\n    }\n\n    /**\n     * Returns the partition with the provided name or null if no partition with\n     * the provided name can be found.\n     *\n     * @param string $name\n     *\n     * @return Partition|null\n     */\n    public function getPartitionByName($name)\n    {\n        foreach ($this->partitions as $partition) {\n            if ($name === $partition->getName()) {\n                return $partition;\n            }\n        }\n    }\n\n    /**\n     * Creates and returns the default SDK partition provider.\n     *\n     * @param array $options\n     * @return PartitionEndpointProvider\n     */\n    public static function defaultProvider($options = [])\n    {\n        $data = \\Aws\\load_compiled_json(__DIR__ . '/../data/endpoints.json');\n        $prefixData = \\Aws\\load_compiled_json(__DIR__ . '/../data/endpoints_prefix_history.json');\n        $mergedData = self::mergePrefixData($data, $prefixData);\n\n        return new self($mergedData['partitions'], 'aws', $options);\n    }\n\n    /**\n     * Copy endpoint data for other prefixes used by a given service\n     *\n     * @param $data\n     * @param $prefixData\n     * @return array\n     */\n    public static function mergePrefixData($data, $prefixData)\n    {\n        $prefixGroups = $prefixData['prefix-groups'];\n\n        foreach ($data[\"partitions\"] as $index => $partition) {\n            foreach ($prefixGroups as $current => $old) {\n                $serviceData = Env::search(\"services.\\\"{$current}\\\"\", $partition);\n                if (!empty($serviceData)) {\n                    foreach ($old as $prefix) {\n                        if (empty(Env::search(\"services.\\\"{$prefix}\\\"\", $partition))) {\n                            $data[\"partitions\"][$index][\"services\"][$prefix] = $serviceData;\n                        }\n                    }\n                }\n            }\n        }\n\n        return $data;\n    }\n}\n", "num_lines": 131}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Endpoint;\n\n/**\n * Represents a section of the AWS cloud.\n */\ninterface PartitionInterface\n{\n    /**\n     * Returns the partition's short name, e.g., 'aws,' 'aws-cn,' or\n     * 'aws-us-gov.'\n     *\n     * @return string\n     */\n    public function getName();\n\n    /**\n     * Determine if this partition contains the provided region. Include the\n     * name of the service to inspect non-regional endpoints\n     *\n     * @param string $region\n     * @param string $service\n     *\n     * @return bool\n     */\n    public function isRegionMatch($region, $service);\n\n    /**\n     * Return the endpoints supported by a given service.\n     *\n     * @param string    $service                    Identifier of the service\n     *                                              whose endpoints should be\n     *                                              listed (e.g., 's3' or 'ses')\n     * @param bool      $allowNonRegionalEndpoints  Set to `true` to include\n     *                                              endpoints that are not AWS\n     *                                              regions (e.g., 'local' for\n     *                                              DynamoDB or\n     *                                              'fips-us-gov-west-1' for S3)\n     * \n     * @return string[]\n     */\n    public function getAvailableEndpoints(\n        $service,\n        $allowNonRegionalEndpoints = false\n    );\n\n    /**\n     * A partition must be invokable as an endpoint provider.\n     *\n     * @see EndpointProvider\n     * \n     * @param array $args\n     * @return array\n     */\n    public function __invoke(array $args = []);\n}\n", "num_lines": 57}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Endpoint;\n\n/**\n * Provides endpoints based on an endpoint pattern configuration array.\n */\nclass PatternEndpointProvider\n{\n    /** @var array */\n    private $patterns;\n\n    /**\n     * @param array $patterns Hash of endpoint patterns mapping to endpoint\n     *                        configurations.\n     */\n    public function __construct(array $patterns)\n    {\n        $this->patterns = $patterns;\n    }\n\n    public function __invoke(array $args = [])\n    {\n        $service = isset($args['service']) ? $args['service'] : '';\n        $region = isset($args['region']) ? $args['region'] : '';\n        $keys = [\"{$region}/{$service}\", \"{$region}/*\", \"*/{$service}\", \"*/*\"];\n\n        foreach ($keys as $key) {\n            if (isset($this->patterns[$key])) {\n                return $this->expand(\n                    $this->patterns[$key],\n                    isset($args['scheme']) ? $args['scheme'] : 'https',\n                    $service,\n                    $region\n                );\n            }\n        }\n\n        return null;\n    }\n\n    private function expand(array $config, $scheme, $service, $region)\n    {\n        $config['endpoint'] = $scheme . '://'\n            . strtr($config['endpoint'], [\n                '{service}' => $service,\n                '{region}'  => $region\n            ]);\n\n        return $config;\n    }\n}\n", "num_lines": 52}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Endpoint\\UseDualstackEndpoint;\n\nuse Aws;\nuse Aws\\Endpoint\\UseDualstackEndpoint\\Exception\\ConfigurationException;\n\nclass Configuration implements ConfigurationInterface\n{\n    private $useDualstackEndpoint;\n\n    public function __construct($useDualstackEndpoint, $region)\n    {\n        $this->useDualstackEndpoint = Aws\\boolean_value($useDualstackEndpoint);\n        if (is_null($this->useDualstackEndpoint)) {\n            throw new ConfigurationException(\"'use_dual_stack_endpoint' config option\"\n                . \" must be a boolean value.\");\n        }\n        if ($this->useDualstackEndpoint == true\n            && (strpos($region, \"iso-\") !== false || strpos($region, \"-iso\") !== false)\n        ) {\n            throw new ConfigurationException(\"Dual-stack is not supported in ISO regions\");        }\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function isUseDualstackEndpoint()\n    {\n        return $this->useDualstackEndpoint;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function toArray()\n    {\n        return [\n            'use_dual_stack_endpoint' => $this->isUseDualstackEndpoint(),\n        ];\n    }\n}\n", "num_lines": 42}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Endpoint\\UseDualstackEndpoint;\n\ninterface ConfigurationInterface\n{\n    /**\n     * Returns whether or not to use a DUALSTACK endpoint\n     *\n     * @return bool\n     */\n    public function isUseDualstackEndpoint();\n\n    /**\n     * Returns the configuration as an associative array\n     *\n     * @return array\n     */\n    public function toArray();\n}\n", "num_lines": 20}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Endpoint\\UseDualstackEndpoint;\n\nuse Aws\\AbstractConfigurationProvider;\nuse Aws\\CacheInterface;\nuse Aws\\ConfigurationProviderInterface;\nuse Aws\\Endpoint\\UseDualstackEndpoint\\Exception\\ConfigurationException;\nuse GuzzleHttp\\Promise;\n\n/**\n * A configuration provider is a function that returns a promise that is\n * fulfilled with a {@see \\Aws\\Endpoint\\UseDualstackEndpoint\\onfigurationInterface}\n * or rejected with an {@see \\Aws\\Endpoint\\UseDualstackEndpoint\\ConfigurationException}.\n *\n * <code>\n * use Aws\\Endpoint\\UseDualstackEndpoint\\ConfigurationProvider;\n * $provider = ConfigurationProvider::defaultProvider();\n * // Returns a ConfigurationInterface or throws.\n * $config = $provider()->wait();\n * </code>\n *\n * Configuration providers can be composed to create configuration using\n * conditional logic that can create different configurations in different\n * environments. You can compose multiple providers into a single provider using\n * {@see Aws\\Endpoint\\UseDualstackEndpoint\\ConfigurationProvider::chain}. This function\n * accepts providers as variadic arguments and returns a new function that will\n * invoke each provider until a successful configuration is returned.\n *\n * <code>\n * // First try an INI file at this location.\n * $a = ConfigurationProvider::ini(null, '/path/to/file.ini');\n * // Then try an INI file at this location.\n * $b = ConfigurationProvider::ini(null, '/path/to/other-file.ini');\n * // Then try loading from environment variables.\n * $c = ConfigurationProvider::env();\n * // Combine the three providers together.\n * $composed = ConfigurationProvider::chain($a, $b, $c);\n * // Returns a promise that is fulfilled with a configuration or throws.\n * $promise = $composed();\n * // Wait on the configuration to resolve.\n * $config = $promise->wait();\n * </code>\n */\nclass ConfigurationProvider extends AbstractConfigurationProvider\n    implements ConfigurationProviderInterface\n{\n    const ENV_USE_DUAL_STACK_ENDPOINT = 'AWS_USE_DUALSTACK_ENDPOINT';\n    const INI_USE_DUAL_STACK_ENDPOINT = 'use_dualstack_endpoint';\n\n    public static $cacheKey = 'aws_cached_use_dualstack_endpoint_config';\n\n    protected static $interfaceClass = ConfigurationInterface::class;\n    protected static $exceptionClass = ConfigurationException::class;\n\n    /**\n     * Create a default config provider that first checks for environment\n     * variables, then checks for a specified profile in the environment-defined\n     * config file location (env variable is 'AWS_CONFIG_FILE', file location\n     * defaults to ~/.aws/config), then checks for the \"default\" profile in the\n     * environment-defined config file location, and failing those uses a default\n     * fallback set of configuration options.\n     *\n     * This provider is automatically wrapped in a memoize function that caches\n     * previously provided config options.\n     *\n     * @param array $config\n     *\n     * @return callable\n     */\n    public static function defaultProvider(array $config = [])\n    {\n        $region = $config['region'];\n        $configProviders = [self::env($region)];\n        if (\n            !isset($config['use_aws_shared_config_files'])\n            || $config['use_aws_shared_config_files'] != false\n        ) {\n            $configProviders[] = self::ini($region);\n        }\n        $configProviders[] = self::fallback($region);\n\n        $memo = self::memoize(\n            call_user_func_array([ConfigurationProvider::class, 'chain'], $configProviders)\n        );\n\n        if (isset($config['use_dual_stack_endpoint'])\n            && $config['use_dual_stack_endpoint'] instanceof CacheInterface\n        ) {\n            return self::cache($memo, $config['use_dual_stack_endpoint'], self::$cacheKey);\n        }\n\n        return $memo;\n    }\n\n    /**\n     * Provider that creates config from environment variables.\n     *\n     * @return callable\n     */\n    public static function env($region)\n    {\n        return function () use ($region) {\n            // Use config from environment variables, if available\n            $useDualstackEndpoint = getenv(self::ENV_USE_DUAL_STACK_ENDPOINT);\n            if (!empty($useDualstackEndpoint)) {\n                return Promise\\Create::promiseFor(\n                    new Configuration($useDualstackEndpoint, $region)\n                );\n            }\n\n            return self::reject('Could not find environment variable config'\n                . ' in ' . self::ENV_USE_DUAL_STACK_ENDPOINT);\n        };\n    }\n\n    /**\n     * Config provider that creates config using a config file whose location\n     * is specified by an environment variable 'AWS_CONFIG_FILE', defaulting to\n     * ~/.aws/config if not specified\n     *\n     * @param string|null $profile  Profile to use. If not specified will use\n     *                              the \"default\" profile.\n     * @param string|null $filename If provided, uses a custom filename rather\n     *                              than looking in the default directory.\n     *\n     * @return callable\n     */\n    public static function ini($region, $profile = null, $filename = null)\n    {\n        $filename = $filename ?: (self::getDefaultConfigFilename());\n        $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');\n\n        return function () use ($region, $profile, $filename) {\n            if (!@is_readable($filename)) {\n                return self::reject(\"Cannot read configuration from $filename\");\n            }\n\n            // Use INI_SCANNER_NORMAL instead of INI_SCANNER_TYPED for PHP 5.5 compatibility\n            $data = \\Aws\\parse_ini_file($filename, true, INI_SCANNER_NORMAL);\n            if ($data === false) {\n                return self::reject(\"Invalid config file: $filename\");\n            }\n            if (!isset($data[$profile])) {\n                return self::reject(\"'$profile' not found in config file\");\n            }\n            if (!isset($data[$profile][self::INI_USE_DUAL_STACK_ENDPOINT])) {\n                return self::reject(\"Required use dualstack endpoint config values\n                    not present in INI profile '{$profile}' ({$filename})\");\n            }\n\n            // INI_SCANNER_NORMAL parses false-y values as an empty string\n            if ($data[$profile][self::INI_USE_DUAL_STACK_ENDPOINT] === \"\") {\n                $data[$profile][self::INI_USE_DUAL_STACK_ENDPOINT] = false;\n            }\n\n            return Promise\\Create::promiseFor(\n                new Configuration($data[$profile][self::INI_USE_DUAL_STACK_ENDPOINT], $region)\n            );\n        };\n    }\n\n    /**\n     * Fallback config options when other sources are not set.\n     *\n     * @return callable\n     */\n    public static function fallback($region)\n    {\n        return function () use ($region) {\n            return Promise\\Create::promiseFor(new Configuration(false, $region));\n        };\n    }\n}\n", "num_lines": 174}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Endpoint\\UseDualstackEndpoint\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\n/**\n * Represents an error interacting with configuration for useDualstackRegion\n */\nclass ConfigurationException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 15}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Endpoint\\UseFipsEndpoint;\n\nuse Aws;\nuse Aws\\Endpoint\\UseFipsEndpoint\\Exception\\ConfigurationException;\n\nclass Configuration implements ConfigurationInterface\n{\n    private $useFipsEndpoint;\n\n    public function __construct($useFipsEndpoint)\n    {\n        $this->useFipsEndpoint = Aws\\boolean_value($useFipsEndpoint);\n        if (is_null($this->useFipsEndpoint)) {\n            throw new ConfigurationException(\"'use_fips_endpoint' config option\"\n                . \" must be a boolean value.\");\n        }\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function isUseFipsEndpoint()\n    {\n        return $this->useFipsEndpoint;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function toArray()\n    {\n        return [\n            'use_fips_endpoint' => $this->isUseFipsEndpoint(),\n        ];\n    }\n}\n", "num_lines": 38}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Endpoint\\UseFipsEndpoint;\n\ninterface ConfigurationInterface\n{\n    /**\n     * Returns whether or not to use a FIPS endpoint\n     *\n     * @return bool\n     */\n    public function isUseFipsEndpoint();\n\n    /**\n     * Returns the configuration as an associative array\n     *\n     * @return array\n     */\n    public function toArray();\n}\n", "num_lines": 20}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Endpoint\\UseFipsEndpoint;\n\nuse Aws\\AbstractConfigurationProvider;\nuse Aws\\CacheInterface;\nuse Aws\\ConfigurationProviderInterface;\nuse Aws\\Endpoint\\UseFipsEndpoint\\Exception\\ConfigurationException;\nuse GuzzleHttp\\Promise;\n\n/**\n * A configuration provider is a function that returns a promise that is\n * fulfilled with a {@see \\Aws\\Endpoint\\UseFipsEndpoint\\onfigurationInterface}\n * or rejected with an {@see \\Aws\\Endpoint\\UseFipsEndpoint\\ConfigurationException}.\n *\n * <code>\n * use Aws\\Endpoint\\UseFipsEndpoint\\ConfigurationProvider;\n * $provider = ConfigurationProvider::defaultProvider();\n * // Returns a ConfigurationInterface or throws.\n * $config = $provider()->wait();\n * </code>\n *\n * Configuration providers can be composed to create configuration using\n * conditional logic that can create different configurations in different\n * environments. You can compose multiple providers into a single provider using\n * {@see Aws\\Endpoint\\UseFipsEndpoint\\ConfigurationProvider::chain}. This function\n * accepts providers as variadic arguments and returns a new function that will\n * invoke each provider until a successful configuration is returned.\n *\n * <code>\n * // First try an INI file at this location.\n * $a = ConfigurationProvider::ini(null, '/path/to/file.ini');\n * // Then try an INI file at this location.\n * $b = ConfigurationProvider::ini(null, '/path/to/other-file.ini');\n * // Then try loading from environment variables.\n * $c = ConfigurationProvider::env();\n * // Combine the three providers together.\n * $composed = ConfigurationProvider::chain($a, $b, $c);\n * // Returns a promise that is fulfilled with a configuration or throws.\n * $promise = $composed();\n * // Wait on the configuration to resolve.\n * $config = $promise->wait();\n * </code>\n */\nclass ConfigurationProvider extends AbstractConfigurationProvider\n    implements ConfigurationProviderInterface\n{\n    const ENV_USE_FIPS_ENDPOINT = 'AWS_USE_FIPS_ENDPOINT';\n    const INI_USE_FIPS_ENDPOINT = 'use_fips_endpoint';\n\n    public static $cacheKey = 'aws_cached_use_fips_endpoint_config';\n\n    protected static $interfaceClass = ConfigurationInterface::class;\n    protected static $exceptionClass = ConfigurationException::class;\n\n    /**\n     * Create a default config provider that first checks for environment\n     * variables, then checks for a specified profile in the environment-defined\n     * config file location (env variable is 'AWS_CONFIG_FILE', file location\n     * defaults to ~/.aws/config), then checks for the \"default\" profile in the\n     * environment-defined config file location, and failing those uses a default\n     * fallback set of configuration options.\n     *\n     * This provider is automatically wrapped in a memoize function that caches\n     * previously provided config options.\n     *\n     * @param array $config\n     *\n     * @return callable\n     */\n    public static function defaultProvider(array $config = [])\n    {\n        $configProviders = [self::env()];\n        if (\n            !isset($config['use_aws_shared_config_files'])\n            || $config['use_aws_shared_config_files'] != false\n        ) {\n            $configProviders[] = self::ini();\n        }\n        $configProviders[] = self::fallback($config['region']);\n\n        $memo = self::memoize(\n            call_user_func_array([ConfigurationProvider::class, 'chain'], $configProviders)\n        );\n\n        if (isset($config['use_fips_endpoint'])\n            && $config['use_fips_endpoint'] instanceof CacheInterface\n        ) {\n            return self::cache($memo, $config['use_fips_endpoint'], self::$cacheKey);\n        }\n\n        return $memo;\n    }\n\n    /**\n     * Provider that creates config from environment variables.\n     *\n     * @return callable\n     */\n    public static function env()\n    {\n        return function () {\n            // Use config from environment variables, if available\n            $useFipsEndpoint = getenv(self::ENV_USE_FIPS_ENDPOINT);\n            if (!empty($useFipsEndpoint)) {\n                return Promise\\Create::promiseFor(\n                    new Configuration($useFipsEndpoint)\n                );\n            }\n\n            return self::reject('Could not find environment variable config'\n                . ' in ' . self::ENV_USE_FIPS_ENDPOINT);\n        };\n    }\n\n    /**\n     * Config provider that creates config using a config file whose location\n     * is specified by an environment variable 'AWS_CONFIG_FILE', defaulting to\n     * ~/.aws/config if not specified\n     *\n     * @param string|null $profile  Profile to use. If not specified will use\n     *                              the \"default\" profile.\n     * @param string|null $filename If provided, uses a custom filename rather\n     *                              than looking in the default directory.\n     *\n     * @return callable\n     */\n    public static function ini($profile = null, $filename = null)\n    {\n        $filename = $filename ?: (self::getDefaultConfigFilename());\n        $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');\n\n        return function () use ($profile, $filename) {\n            if (!@is_readable($filename)) {\n                return self::reject(\"Cannot read configuration from $filename\");\n            }\n\n            // Use INI_SCANNER_NORMAL instead of INI_SCANNER_TYPED for PHP 5.5 compatibility\n            $data = \\Aws\\parse_ini_file($filename, true, INI_SCANNER_NORMAL);\n            if ($data === false) {\n                return self::reject(\"Invalid config file: $filename\");\n            }\n            if (!isset($data[$profile])) {\n                return self::reject(\"'$profile' not found in config file\");\n            }\n            if (!isset($data[$profile][self::INI_USE_FIPS_ENDPOINT])) {\n                return self::reject(\"Required use fips endpoint config values\n                    not present in INI profile '{$profile}' ({$filename})\");\n            }\n\n            // INI_SCANNER_NORMAL parses false-y values as an empty string\n            if ($data[$profile][self::INI_USE_FIPS_ENDPOINT] === \"\") {\n                $data[$profile][self::INI_USE_FIPS_ENDPOINT] = false;\n            }\n\n            return Promise\\Create::promiseFor(\n                new Configuration($data[$profile][self::INI_USE_FIPS_ENDPOINT])\n            );\n        };\n    }\n\n    /**\n     * Fallback config options when other sources are not set.\n     *\n     * @return callable\n     */\n    public static function fallback($region)\n    {\n        return function () use ($region) {\n            $isFipsPseudoRegion = strpos($region, 'fips-') !== false\n                || strpos($region, '-fips') !== false;\n            if ($isFipsPseudoRegion){\n                $configuration = new Configuration(true);\n            } else {\n                $configuration = new Configuration(false);\n            }\n            return Promise\\Create::promiseFor($configuration);\n        };\n    }\n}\n", "num_lines": 180}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Endpoint\\UseFipsEndpoint\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\n/**\n * Represents an error interacting with configuration for useFipsRegion\n */\nclass ConfigurationException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 15}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EndpointDiscovery;\n\nclass Configuration implements ConfigurationInterface\n{\n    private $cacheLimit;\n    private $enabled;\n\n    public function __construct($enabled, $cacheLimit = 1000)\n    {\n        $this->cacheLimit = filter_var($cacheLimit, FILTER_VALIDATE_INT);\n        if ($this->cacheLimit == false || $this->cacheLimit < 1) {\n            throw new \\InvalidArgumentException(\n                \"'cache_limit' value must be a positive integer.\"\n            );\n        }\n\n        // Unparsable $enabled flag errs on the side of disabling endpoint discovery\n        $this->enabled = filter_var($enabled, FILTER_VALIDATE_BOOLEAN);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function isEnabled()\n    {\n        return $this->enabled;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getCacheLimit()\n    {\n        return $this->cacheLimit;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function toArray()\n    {\n        return [\n            'enabled' => $this->isEnabled(),\n            'cache_limit' => $this->getCacheLimit()\n        ];\n    }\n}\n", "num_lines": 49}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EndpointDiscovery;\n\n/**\n * Provides access to endpoint discovery configuration options:\n * 'enabled', 'cache_limit'\n */\ninterface ConfigurationInterface\n{\n    /**\n     * Checks whether or not endpoint discovery is enabled.\n     *\n     * @return bool\n     */\n    public function isEnabled();\n\n    /**\n     * Returns the cache limit, if available.\n     *\n     * @return string|null\n     */\n    public function getCacheLimit();\n\n    /**\n     * Returns the configuration as an associative array\n     *\n     * @return array\n     */\n    public function toArray();\n}\n", "num_lines": 31}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EndpointDiscovery;\n\nuse Aws\\AbstractConfigurationProvider;\nuse Aws\\CacheInterface;\nuse Aws\\ConfigurationProviderInterface;\nuse Aws\\EndpointDiscovery\\Exception\\ConfigurationException;\nuse GuzzleHttp\\Promise;\nuse GuzzleHttp\\Promise\\PromiseInterface;\n\n/**\n * A configuration provider is a function that returns a promise that is\n * fulfilled with a {@see \\Aws\\EndpointDiscovery\\ConfigurationInterface}\n * or rejected with an {@see \\Aws\\EndpointDiscovery\\Exception\\ConfigurationException}.\n *\n * <code>\n * use Aws\\EndpointDiscovery\\ConfigurationProvider;\n * $provider = ConfigurationProvider::defaultProvider();\n * // Returns a ConfigurationInterface or throws.\n * $config = $provider()->wait();\n * </code>\n *\n * Configuration providers can be composed to create configuration using\n * conditional logic that can create different configurations in different\n * environments. You can compose multiple providers into a single provider using\n * {@see Aws\\EndpointDiscovery\\ConfigurationProvider::chain}. This function\n * accepts providers as variadic arguments and returns a new function that will\n * invoke each provider until a successful configuration is returned.\n *\n * <code>\n * // First try an INI file at this location.\n * $a = ConfigurationProvider::ini(null, '/path/to/file.ini');\n * // Then try an INI file at this location.\n * $b = ConfigurationProvider::ini(null, '/path/to/other-file.ini');\n * // Then try loading from environment variables.\n * $c = ConfigurationProvider::env();\n * // Combine the three providers together.\n * $composed = ConfigurationProvider::chain($a, $b, $c);\n * // Returns a promise that is fulfilled with a configuration or throws.\n * $promise = $composed();\n * // Wait on the configuration to resolve.\n * $config = $promise->wait();\n * </code>\n */\nclass ConfigurationProvider extends AbstractConfigurationProvider\n    implements ConfigurationProviderInterface\n{\n    const DEFAULT_ENABLED = false;\n    const DEFAULT_CACHE_LIMIT = 1000;\n    const ENV_ENABLED = 'AWS_ENDPOINT_DISCOVERY_ENABLED';\n    const ENV_ENABLED_ALT = 'AWS_ENABLE_ENDPOINT_DISCOVERY';\n    const ENV_PROFILE = 'AWS_PROFILE';\n\n    public static $cacheKey = 'aws_cached_endpoint_discovery_config';\n\n    protected static $interfaceClass = ConfigurationInterface::class;\n    protected static $exceptionClass = ConfigurationException::class;\n\n    /**\n     * Create a default config provider that first checks for environment\n     * variables, then checks for a specified profile in the environment-defined\n     * config file location (env variable is 'AWS_CONFIG_FILE', file location\n     * defaults to ~/.aws/config), then checks for the \"default\" profile in the\n     * environment-defined config file location, and failing those uses a default\n     * fallback set of configuration options.\n     *\n     * This provider is automatically wrapped in a memoize function that caches\n     * previously provided config options.\n     *\n     * @param array $config\n     *\n     * @return callable\n     */\n    public static function defaultProvider(array $config = [])\n    {\n        $configProviders = [self::env()];\n        if (\n            !isset($config['use_aws_shared_config_files'])\n            || $config['use_aws_shared_config_files'] != false\n        ) {\n            $configProviders[] = self::ini();\n        }\n        $configProviders[] = self::fallback($config);\n\n        $memo = self::memoize(\n            call_user_func_array([ConfigurationProvider::class, 'chain'], $configProviders)\n        );\n\n        if (isset($config['endpoint_discovery'])\n            && $config['endpoint_discovery'] instanceof CacheInterface\n        ) {\n            return self::cache($memo, $config['endpoint_discovery'], self::$cacheKey);\n        }\n\n        return $memo;\n    }\n\n    /**\n     * Provider that creates config from environment variables.\n     *\n     * @param $cacheLimit\n     * @return callable\n     */\n    public static function env($cacheLimit = self::DEFAULT_CACHE_LIMIT)\n    {\n        return function () use ($cacheLimit) {\n            // Use config from environment variables, if available\n            $enabled = getenv(self::ENV_ENABLED);\n            if ($enabled === false || $enabled === '') {\n                $enabled = getenv(self::ENV_ENABLED_ALT);\n            }\n            if ($enabled !== false && $enabled !== '') {\n                return Promise\\Create::promiseFor(\n                    new Configuration($enabled, $cacheLimit)\n                );\n            }\n\n            return self::reject('Could not find environment variable config'\n                . ' in ' . self::ENV_ENABLED);\n        };\n    }\n\n    /**\n     * Fallback config options when other sources are not set. Will check the\n     * service model for any endpoint discovery required operations, and enable\n     * endpoint discovery in that case. If no required operations found, will use\n     * the class default values.\n     *\n     * @param array $config\n     * @return callable\n     */\n    public static function fallback($config = [])\n    {\n        $enabled = self::DEFAULT_ENABLED;\n        if (!empty($config['api_provider'])\n            && !empty($config['service'])\n            && !empty($config['version'])\n        ) {\n            $provider = $config['api_provider'];\n            $apiData = $provider('api', $config['service'], $config['version']);\n            if (!empty($apiData['operations'])) {\n                foreach ($apiData['operations'] as $operation) {\n                    if (!empty($operation['endpointdiscovery']['required'])) {\n                        $enabled = true;\n                    }\n                }\n            }\n        }\n\n        return function () use ($enabled) {\n            return Promise\\Create::promiseFor(\n                new Configuration(\n                    $enabled,\n                    self::DEFAULT_CACHE_LIMIT\n                )\n            );\n        };\n    }\n\n    /**\n     * Config provider that creates config using a config file whose location\n     * is specified by an environment variable 'AWS_CONFIG_FILE', defaulting to\n     * ~/.aws/config if not specified\n     *\n     * @param string|null $profile  Profile to use. If not specified will use\n     *                              the \"default\" profile.\n     * @param string|null $filename If provided, uses a custom filename rather\n     *                              than looking in the default directory.\n     * @param int         $cacheLimit\n     *\n     * @return callable\n     */\n    public static function ini(\n        $profile = null,\n        $filename = null,\n        $cacheLimit = self::DEFAULT_CACHE_LIMIT\n    ) {\n        $filename = $filename ?: (self::getDefaultConfigFilename());\n        $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');\n\n        return function () use ($profile, $filename, $cacheLimit) {\n            if (!@is_readable($filename)) {\n                return self::reject(\"Cannot read configuration from $filename\");\n            }\n            $data = \\Aws\\parse_ini_file($filename, true);\n            if ($data === false) {\n                return self::reject(\"Invalid config file: $filename\");\n            }\n            if (!isset($data[$profile])) {\n                return self::reject(\"'$profile' not found in config file\");\n            }\n            if (!isset($data[$profile]['endpoint_discovery_enabled'])) {\n                return self::reject(\"Required endpoint discovery config values\n                    not present in INI profile '{$profile}' ({$filename})\");\n            }\n\n            return Promise\\Create::promiseFor(\n                new Configuration(\n                    $data[$profile]['endpoint_discovery_enabled'],\n                    $cacheLimit\n                )\n            );\n        };\n    }\n\n    /**\n     * Unwraps a configuration object in whatever valid form it is in,\n     * always returning a ConfigurationInterface object.\n     *\n     * @param  mixed $config\n     * @return ConfigurationInterface\n     * @throws \\InvalidArgumentException\n     */\n    public static function unwrap($config)\n    {\n        if (is_callable($config)) {\n            $config = $config();\n        }\n        if ($config instanceof PromiseInterface) {\n            $config = $config->wait();\n        }\n        if ($config instanceof ConfigurationInterface) {\n            return $config;\n        } elseif (is_array($config) && isset($config['enabled'])) {\n            if (isset($config['cache_limit'])) {\n                return new Configuration(\n                    $config['enabled'],\n                    $config['cache_limit']\n                );\n            }\n            return new Configuration(\n                $config['enabled'],\n                self::DEFAULT_CACHE_LIMIT\n            );\n        }\n\n        throw new \\InvalidArgumentException('Not a valid endpoint_discovery '\n            . 'configuration argument.');\n    }\n}\n", "num_lines": 241}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EndpointDiscovery;\n\nuse Aws\\AwsClient;\nuse Aws\\CacheInterface;\nuse Aws\\CommandInterface;\nuse Aws\\Credentials\\CredentialsInterface;\nuse Aws\\Exception\\AwsException;\nuse Aws\\Exception\\UnresolvedEndpointException;\nuse Aws\\LruArrayCache;\nuse Aws\\Middleware;\nuse Psr\\Http\\Message\\RequestInterface;\nuse Psr\\Http\\Message\\UriInterface;\n\nclass EndpointDiscoveryMiddleware\n{\n    /**\n     * @var CacheInterface\n     */\n    private static $cache;\n    private static $discoveryCooldown = 60;\n\n    private $args;\n    private $client;\n    private $config;\n    private $discoveryTimes = [];\n    private $nextHandler;\n    private $service;\n\n    public static function wrap(\n        $client,\n        $args,\n        $config\n    ) {\n        return function (callable $handler) use (\n            $client,\n            $args,\n            $config\n        ) {\n            return new static(\n                $handler,\n                $client,\n                $args,\n                $config\n            );\n        };\n    }\n\n    public function __construct(\n        callable $handler,\n        AwsClient $client,\n        array $args,\n        $config\n    ) {\n        $this->nextHandler = $handler;\n        $this->client = $client;\n        $this->args = $args;\n        $this->service = $client->getApi();\n        $this->config = $config;\n    }\n\n    public function __invoke(CommandInterface $cmd, RequestInterface $request)\n    {\n        $nextHandler = $this->nextHandler;\n        $op = $this->service->getOperation($cmd->getName())->toArray();\n\n        // Continue only if endpointdiscovery trait is set\n        if (isset($op['endpointdiscovery'])) {\n            $config = ConfigurationProvider::unwrap($this->config);\n            $isRequired = !empty($op['endpointdiscovery']['required']);\n\n            if ($isRequired && !($config->isEnabled())) {\n                throw new UnresolvedEndpointException('This operation '\n                    . 'requires the use of endpoint discovery, but this has '\n                    . 'been disabled in the configuration. Enable endpoint '\n                    . 'discovery or use a different operation.');\n            }\n\n            // Continue only if enabled by config\n            if ($config->isEnabled()) {\n                if (isset($op['endpointoperation'])) {\n                    throw new UnresolvedEndpointException('This operation is '\n                        . 'contradictorily marked both as using endpoint discovery '\n                        . 'and being the endpoint discovery operation. Please '\n                        . 'verify the accuracy of your model files.');\n                }\n\n                // Original endpoint may be used if discovery optional\n                $originalUri = $request->getUri();\n\n                $identifiers = $this->getIdentifiers($op);\n\n                $cacheKey = $this->getCacheKey(\n                    $this->client->getCredentials()->wait(),\n                    $cmd,\n                    $identifiers\n                );\n\n                // Check/create cache\n                if (!isset(self::$cache)) {\n                    self::$cache = new LruArrayCache($config->getCacheLimit());\n                }\n\n                if (empty($endpointList = self::$cache->get($cacheKey))) {\n                    $endpointList = new EndpointList([]);\n                }\n                $endpoint = $endpointList->getActive();\n\n                // Retrieve endpoints if there is no active endpoint\n                if (empty($endpoint)) {\n                    try {\n                        $endpoint = $this->discoverEndpoint(\n                            $cacheKey,\n                            $cmd,\n                            $identifiers\n                        );\n                    } catch (\\Exception $e) {\n                        // Use cached endpoint, expired or active, if any remain\n                        $endpoint = $endpointList->getEndpoint();\n\n                        if (empty($endpoint)) {\n                            return $this->handleDiscoveryException(\n                                $isRequired,\n                                $originalUri,\n                                $e,\n                                $cmd,\n                                $request\n                            );\n                        }\n                    }\n                }\n\n                $request = $this->modifyRequest($request, $endpoint);\n\n                $g = function ($value) use (\n                    $cacheKey,\n                    $cmd,\n                    $identifiers,\n                    $isRequired,\n                    $originalUri,\n                    $request,\n                    &$endpoint,\n                    &$g\n                ) {\n                    if ($value instanceof AwsException\n                        && (\n                            $value->getAwsErrorCode() == 'InvalidEndpointException'\n                            || $value->getStatusCode() == 421\n                        )\n                    ) {\n                        return $this->handleInvalidEndpoint(\n                            $cacheKey,\n                            $cmd,\n                            $identifiers,\n                            $isRequired,\n                            $originalUri,\n                            $request,\n                            $value,\n                            $endpoint,\n                            $g\n                        );\n                    }\n                    \n                    return $value;\n                };\n\n                return $nextHandler($cmd, $request)->otherwise($g);\n            }\n        }\n\n        return $nextHandler($cmd, $request);\n    }\n\n    private function discoverEndpoint(\n        $cacheKey,\n        CommandInterface $cmd,\n        array $identifiers\n    ) {\n        $discCmd = $this->getDiscoveryCommand($cmd, $identifiers);\n        $this->discoveryTimes[$cacheKey] = time();\n        $result = $this->client->execute($discCmd);\n\n        if (isset($result['Endpoints'])) {\n            $endpointData = [];\n            foreach ($result['Endpoints'] as $datum) {\n                $endpointData[$datum['Address']] = time()\n                    + ($datum['CachePeriodInMinutes'] * 60);\n            }\n            $endpointList = new EndpointList($endpointData);\n            self::$cache->set($cacheKey, $endpointList);\n            return $endpointList->getEndpoint();\n        }\n\n        throw new UnresolvedEndpointException('The endpoint discovery operation '\n            . 'yielded a response that did not contain properly formatted '\n            . 'endpoint data.');\n    }\n\n    private function getCacheKey(\n        CredentialsInterface $creds,\n        CommandInterface $cmd,\n        array $identifiers\n    ) {\n        $key = $this->service->getServiceName() . '_' . $creds->getAccessKeyId();\n        if (!empty($identifiers)) {\n            $key .= '_' . $cmd->getName();\n            foreach ($identifiers as $identifier) {\n                $key .= \"_{$cmd[$identifier]}\";\n            }\n        }\n\n        return $key;\n    }\n\n    private function getDiscoveryCommand(\n        CommandInterface $cmd,\n        array $identifiers\n    ) {\n        foreach ($this->service->getOperations() as $op) {\n            if (isset($op['endpointoperation'])) {\n                $endpointOperation = $op->toArray()['name'];\n                break;\n            }\n        }\n\n        if (!isset($endpointOperation)) {\n            throw new UnresolvedEndpointException('This command is set to use '\n                . 'endpoint discovery, but no endpoint discovery operation was '\n                . 'found. Please verify the accuracy of your model files.');\n        }\n\n        $params = [];\n        if (!empty($identifiers)) {\n            $params['Operation'] = $cmd->getName();\n            $params['Identifiers'] = [];\n            foreach ($identifiers as $identifier) {\n                $params['Identifiers'][$identifier] = $cmd[$identifier];\n            }\n        }\n        $command = $this->client->getCommand($endpointOperation, $params);\n        $command->getHandlerList()->appendBuild(\n            Middleware::mapRequest(function (RequestInterface $r) {\n                return $r->withHeader(\n                    'x-amz-api-version',\n                    $this->service->getApiVersion()\n                );\n            }),\n            'x-amz-api-version-header'\n        );\n\n        return $command;\n    }\n\n    private function getIdentifiers(array $operation)\n    {\n        $inputShape = $this->service->getShapeMap()\n            ->resolve($operation['input'])\n            ->toArray();\n        $identifiers = [];\n        foreach ($inputShape['members'] as $key => $member) {\n            if (!empty($member['endpointdiscoveryid'])) {\n                $identifiers[] = $key;\n            }\n        }\n        return $identifiers;\n    }\n\n    private function handleDiscoveryException(\n        $isRequired,\n        $originalUri,\n        \\Exception $e,\n        CommandInterface $cmd,\n        RequestInterface $request\n    ) {\n        // If no cached endpoints and discovery required,\n        // throw exception\n        if ($isRequired) {\n            $message = 'The endpoint required for this service is currently '\n                . 'unable to be retrieved, and your request can not be fulfilled '\n                . 'unless you manually specify an endpoint.';\n            throw new AwsException(\n                $message,\n                $cmd,\n                [\n                    'code' => 'EndpointDiscoveryException',\n                    'message' => $message\n                ],\n                $e\n            );\n        }\n\n        // If discovery isn't required, use original endpoint\n        return $this->useOriginalUri(\n            $originalUri,\n            $cmd,\n            $request\n        );\n    }\n\n    private function handleInvalidEndpoint(\n        $cacheKey,\n        $cmd,\n        $identifiers,\n        $isRequired,\n        $originalUri,\n        $request,\n        $value,\n        &$endpoint,\n        &$g\n    ) {\n        $nextHandler = $this->nextHandler;\n        $endpointList = self::$cache->get($cacheKey);\n        if ($endpointList instanceof EndpointList) {\n\n            // Remove invalid endpoint from cached list\n            $endpointList->remove($endpoint);\n\n            // If possible, get another cached endpoint\n            $newEndpoint = $endpointList->getEndpoint();\n        }\n        if (empty($newEndpoint)) {\n\n            // If no more cached endpoints, make discovery call\n            // if none made within cooldown for given key\n            if (time() - $this->discoveryTimes[$cacheKey]\n                < self::$discoveryCooldown\n            ) {\n\n                // If no more cached endpoints and it's required,\n                // fail with original exception\n                if ($isRequired) {\n                    return $value;\n                }\n\n                // Use original endpoint if not required\n                return $this->useOriginalUri(\n                    $originalUri,\n                    $cmd,\n                    $request\n                );\n            }\n\n            $newEndpoint = $this->discoverEndpoint(\n                $cacheKey,\n                $cmd,\n                $identifiers\n            );\n        }\n        $endpoint = $newEndpoint;\n        $request = $this->modifyRequest($request, $endpoint);\n        return $nextHandler($cmd, $request)->otherwise($g);\n    }\n\n    private function modifyRequest(RequestInterface $request, $endpoint)\n    {\n        $parsed = $this->parseEndpoint($endpoint);\n        if (!empty($request->getHeader('User-Agent'))) {\n            $userAgent = $request->getHeader('User-Agent')[0];\n            if (strpos($userAgent, 'endpoint-discovery') === false) {\n                $userAgent = $userAgent . ' endpoint-discovery';\n            }\n        } else {\n            $userAgent = 'endpoint-discovery';\n        }\n\n        return $request\n            ->withUri(\n                $request->getUri()\n                    ->withHost($parsed['host'])\n                    ->withPath($parsed['path'])\n            )\n            ->withHeader('User-Agent', $userAgent);\n    }\n\n    /**\n     * Parses an endpoint returned from the discovery API into an array with\n     * 'host' and 'path' keys.\n     *\n     * @param $endpoint\n     * @return array\n     */\n    private function parseEndpoint($endpoint)\n    {\n        $parsed = parse_url($endpoint);\n\n        // parse_url() will correctly parse full URIs with schemes\n        if (isset($parsed['host'])) {\n            return $parsed;\n        }\n\n        // parse_url() will put host & path in 'path' if scheme is not provided\n        if (isset($parsed['path'])) {\n            $split = explode('/', $parsed['path'], 2);\n            $parsed['host'] = $split[0];\n            if (isset($split[1])) {\n                if (substr($split[1], 0 , 1) !== '/') {\n                    $split[1] = '/' . $split[1];\n                }\n                $parsed['path'] = $split[1];\n            } else {\n                $parsed['path'] = '';\n            }\n            return $parsed;\n        }\n\n        throw new UnresolvedEndpointException(\"The supplied endpoint '\"\n            . \"{$endpoint}' is invalid.\");\n    }\n\n    private function useOriginalUri(\n        UriInterface $uri,\n        CommandInterface $cmd,\n        RequestInterface $request\n    ) {\n        $nextHandler = $this->nextHandler;\n        $endpoint = $uri->getHost() . $uri->getPath();\n        $request = $this->modifyRequest(\n            $request,\n            $endpoint\n        );\n        return $nextHandler($cmd, $request);\n    }\n}\n", "num_lines": 424}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EndpointDiscovery;\n\nclass EndpointList\n{\n    private $active;\n    private $expired = [];\n\n    public function __construct(array $endpoints)\n    {\n        $this->active = $endpoints;\n        reset($this->active);\n    }\n\n    /**\n     * Gets an active (unexpired) endpoint. Returns null if none found.\n     *\n     * @return null|string\n     */\n    public function getActive()\n    {\n        if (count($this->active) < 1) {\n            return null;\n        }\n        while (time() > current($this->active)) {\n            $key = key($this->active);\n            $this->expired[$key] = current($this->active);\n            $this->increment($this->active);\n            unset($this->active[$key]);\n            if (count($this->active) < 1) {\n                return null;\n            }\n        }\n        $active = key($this->active);\n        $this->increment($this->active);\n        return $active;\n    }\n\n    /**\n     * Gets an active endpoint if possible, then an expired endpoint if possible.\n     * Returns null if no endpoints found.\n     *\n     * @return null|string\n     */\n    public function getEndpoint()\n    {\n        if (!empty($active = $this->getActive())) {\n            return $active;\n        }\n        return $this->getExpired();\n    }\n\n    /**\n     * Removes an endpoint from both lists.\n     *\n     * @param string $key\n     */\n    public function remove($key)\n    {\n        unset($this->active[$key]);\n        unset($this->expired[$key]);\n    }\n\n    /**\n     * Get an expired endpoint. Returns null if none found.\n     *\n     * @return null|string\n     */\n    private function getExpired()\n    {\n        if (count($this->expired) < 1) {\n            return null;\n        }\n        $expired = key($this->expired);\n        $this->increment($this->expired);\n        return $expired;\n    }\n\n    private function increment(&$array)\n    {\n        if (next($array) === false) {\n            reset($array);\n        }\n    }\n}\n", "num_lines": 86}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EndpointDiscovery\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\n/**\n * Represents an error interacting with configuration for endpoint discovery\n */\nclass ConfigurationException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 15}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\EndpointV2;\n\n/**\n * Provides Endpoint-related artifacts used for endpoint resolution\n * and testing.\n */\nclass EndpointDefinitionProvider\n{\n    public static function getEndpointRuleset($service, $apiVersion)\n    {\n        return self::getData($service, $apiVersion, 'ruleset');\n    }\n\n    public static function getEndpointTests($service, $apiVersion)\n    {\n        return self::getData($service, $apiVersion, 'tests');\n    }\n\n    public static function getPartitions()\n    {\n        $basePath = __DIR__ . '/../data';\n        $file = '/partitions.json';\n\n        if (file_exists($basePath . $file . '.php')) {\n           return require($basePath . $file . '.php');\n        } else {\n            return json_decode(file_get_contents($basePath . $file));\n        }\n    }\n\n    private static function getData($service, $apiVersion, $type)\n    {\n        $basePath = __DIR__ . '/../data';\n        $serviceDir = $basePath . \"/{$service}\";\n        if (!is_dir($serviceDir)) {\n            throw new \\InvalidArgumentException(\n                'Invalid service name.'\n            );\n        }\n\n        if ($apiVersion === 'latest') {\n            $apiVersion = self::getLatest($service);\n        }\n\n        $rulesetPath = $serviceDir . '/' . $apiVersion;\n        if (!is_dir($rulesetPath)) {\n            throw new \\InvalidArgumentException(\n                'Invalid api version.'\n            );\n        }\n        $fileName = $type === 'tests' ? '/endpoint-tests-1' : '/endpoint-rule-set-1';\n\n        if (file_exists($rulesetPath . $fileName . '.json.php')) {\n            return require($rulesetPath . $fileName . '.json.php');\n        } else {\n            return json_decode(file_get_contents($rulesetPath . $fileName . '.json'), true);\n        }\n    }\n\n    private static function getLatest($service)\n    {\n        $manifest = \\Aws\\manifest();\n        return $manifest[$service]['versions']['latest'];\n    }\n}", "num_lines": 67}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\EndpointV2;\n\nuse Aws\\EndpointV2\\Ruleset\\Ruleset;\nuse Aws\\Exception\\UnresolvedEndpointException;\nuse Aws\\LruArrayCache;\n\n/**\n * Given a service's Ruleset and client-provided input parameters, provides\n * either an object reflecting the properties of a resolved endpoint,\n * or throws an error.\n */\nclass EndpointProviderV2\n{\n    /** @var Ruleset */\n    private $ruleset;\n\n    /** @var LruArrayCache */\n    private $cache;\n\n    public function __construct(array $ruleset, array $partitions)\n    {\n        $this->ruleset = new Ruleset($ruleset, $partitions);\n        $this->cache = new LruArrayCache(100);\n    }\n\n    /**\n     * @return Ruleset\n     */\n    public function getRuleset()\n    {\n        return $this->ruleset;\n    }\n\n    /**\n     * Given a Ruleset and input parameters, determines the correct endpoint\n     * or an error to be thrown for a given request.\n     *\n     * @return RulesetEndpoint\n     * @throws UnresolvedEndpointException\n     */\n    public function resolveEndpoint(array $inputParameters)\n    {\n        $hashedParams = $this->hashInputParameters($inputParameters);\n        $match = $this->cache->get($hashedParams);\n\n        if (!is_null($match)) {\n            return $match;\n        }\n\n        $endpoint = $this->ruleset->evaluate($inputParameters);\n        if ($endpoint === false) {\n            throw new UnresolvedEndpointException(\n                'Unable to resolve an endpoint using the provider arguments: '\n                . json_encode($inputParameters)\n            );\n        }\n        $this->cache->set($hashedParams, $endpoint);\n\n        return $endpoint;\n    }\n\n    private function hashInputParameters($inputParameters)\n    {\n        return md5(serialize($inputParameters));\n    }\n}\n", "num_lines": 69}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\EndpointV2;\n\nuse Aws\\Api\\Serializer\\RestSerializer;\nuse GuzzleHttp\\Psr7\\Uri;\n\n/**\n * Set of helper functions used to set endpoints and endpoint\n * properties derived from dynamic endpoint resolution.\n *\n * @internal\n */\ntrait EndpointV2SerializerTrait\n{\n    /**\n     * Merges endpoint resolution arguments passed from the client\n     * and command and attempts to resolve an endpoint. Headers and\n     * auth schemes may be returned in a resolved endpoint object.\n     * A resolved endpoint uri and headers will be applied to the request.\n     * Auth schemes are applied to the command and compared against the default\n     * auth scheme at signing.\n     *\n     * @internal\n     */\n    private function setRequestOptions(\n        $endpointProvider,\n        $command,\n        $operation,\n        $commandArgs,\n        $clientArgs,\n        &$headers\n    )\n    {\n        $providerArgs = $this->resolveProviderArgs(\n            $endpointProvider,\n            $operation,\n            $commandArgs,\n            $clientArgs\n        );\n        $endpoint = $endpointProvider->resolveEndpoint($providerArgs);\n        $resolvedUrl = $endpoint->getUrl();\n\n        $this->applyScheme($resolvedUrl);\n        $this->endpoint = $resolvedUrl;\n        $this->applyAuthSchemeToCommand($endpoint, $command);\n        $this->applyHeaders($endpoint, $headers);\n    }\n\n    private function resolveProviderArgs(\n        $endpointProvider,\n        $operation,\n        $commandArgs,\n        $clientArgs\n    )\n    {\n        $rulesetParams = $endpointProvider->getRuleset()->getParameters();\n        $endpointCommandArgs = $this->filterEndpointCommandArgs(\n            $rulesetParams,\n            $commandArgs\n        );\n        $staticContextParams = $this->bindStaticContextParams(\n            $operation->getStaticContextParams()\n        );\n        $contextParams = $this->bindContextParams(\n            $commandArgs, $operation->getContextParams()\n        );\n        $providerArgs = $this->normalizeEndpointProviderArgs(\n            $endpointCommandArgs,\n            $clientArgs,\n            $contextParams,\n            $staticContextParams\n        );\n\n        return $providerArgs;\n    }\n\n    /**\n     * Merges endpoint provider arguments from different sources.\n     * Client built-ins are superseded by client context params.\n     * Client context params are superseded by context params on\n     * an input member's shape.  Context params are superseded by\n     * static context params. The result of this combination is then\n     * merged with any appropriate arguments from the command.\n     */\n    private function normalizeEndpointProviderArgs(\n        $endpointCommandArgs,\n        $clientArgs,\n        $contextParams,\n        $staticContextParams\n    )\n    {\n        $commandContextParams = array_merge($contextParams, $staticContextParams);\n        $combinedEndpointArgs = array_merge($clientArgs, $commandContextParams);\n\n        return array_merge($combinedEndpointArgs, $endpointCommandArgs);\n    }\n\n    private function bindContextParams($commandArgs, $contextParams)\n    {\n        $scopedParams = [];\n\n        foreach($contextParams as $name => $spec) {\n            if (isset($commandArgs[$spec['shape']])) {\n                $scopedParams[$name] = $commandArgs[$spec['shape']];\n            }\n        }\n        return $scopedParams;\n    }\n\n    private function bindStaticContextParams($staticContextParams)\n    {\n        $scopedParams = [];\n\n        forEach($staticContextParams as $paramName => $paramValue) {\n            $scopedParams[$paramName] = $paramValue['value'];\n        }\n        return $scopedParams;\n    }\n\n    private function filterEndpointCommandArgs(\n        $rulesetParams,\n        $commandArgs\n    )\n    {\n        $endpointMiddlewareOpts = [\n            '@use_dual_stack_endpoint' => 'UseDualStack',\n            '@use_accelerate_endpoint' => 'Accelerate',\n            '@use_path_style_endpoint' => 'ForcePathStyle'\n        ];\n\n        $filteredArgs = [];\n\n        foreach($rulesetParams as $name => $value) {\n            if (isset($commandArgs[$name])) {\n                if (!empty($value->getBuiltIn())) {\n                    continue;\n                }\n                $filteredArgs[$name] = $commandArgs[$name];\n            }\n        }\n\n        if ($this->api->getServiceName() === 's3') {\n            foreach($endpointMiddlewareOpts as $optionName => $newValue) {\n                if (isset($commandArgs[$optionName])) {\n                    $filteredArgs[$newValue] = $commandArgs[$optionName];\n                }\n            }\n        }\n\n        return $filteredArgs;\n    }\n\n    private function applyHeaders($endpoint, &$headers)\n    {\n        if (!is_null($endpoint->getHeaders())) {\n           $headers = array_merge(\n               $headers,\n               $endpoint->getHeaders()\n           );\n        }\n    }\n\n    private function applyAuthSchemeToCommand($endpoint, $command)\n    {\n        if (isset($endpoint->getProperties()['authSchemes'])) {\n            $authScheme = $this->selectAuthScheme(\n                $endpoint->getProperties()['authSchemes']\n            );\n            $command->setAuthSchemes($authScheme);\n        }\n    }\n\n    private function selectAuthScheme($authSchemes)\n    {\n        $validAuthSchemes = ['sigv4', 'sigv4a', 'none', 'bearer'];\n        $invalidAuthSchemes = [];\n\n        foreach($authSchemes as $authScheme) {\n            if (in_array($authScheme['name'], $validAuthSchemes)) {\n                return $this->normalizeAuthScheme($authScheme);\n            } else {\n                $invalidAuthSchemes[] = \"`{$authScheme['name']}`\";\n            }\n        }\n\n        $invalidAuthSchemesString = implode(', ', $invalidAuthSchemes);\n        $validAuthSchemesString = '`' . implode('`, `', $validAuthSchemes) . '`';\n        throw new \\InvalidArgumentException(\n            \"This operation requests {$invalidAuthSchemesString}\"\n            . \" auth schemes, but the client only supports {$validAuthSchemesString}.\"\n        );\n    }\n\n    private function normalizeAuthScheme($authScheme)\n    {\n       /*\n            sigv4a will contain a regionSet property. which is guaranteed to be `*`\n            for now.  The SigV4 class handles this automatically for now. It seems\n            complexity will be added here in the future.\n       */\n        $normalizedAuthScheme = [];\n\n        if (isset($authScheme['disableDoubleEncoding'])\n            && $authScheme['disableDoubleEncoding'] === true\n            && $authScheme['name'] !== 'sigv4a'\n        ) {\n            $normalizedAuthScheme['version'] = 's3v4';\n        } elseif ($authScheme['name'] === 'none') {\n            $normalizedAuthScheme['version'] = 'anonymous';\n        }\n        else {\n            $normalizedAuthScheme['version'] = str_replace(\n                'sig', '', $authScheme['name']\n            );\n        }\n\n        $normalizedAuthScheme['name'] = isset($authScheme['signingName']) ?\n            $authScheme['signingName'] : null;\n        $normalizedAuthScheme['region'] = isset($authScheme['signingRegion']) ?\n            $authScheme['signingRegion'] : null;\n        $normalizedAuthScheme['signingRegionSet'] = isset($authScheme['signingRegionSet']) ?\n            $authScheme['signingRegionSet'] : null;\n\n        return $normalizedAuthScheme;\n    }\n\n    private function applyScheme(&$resolvedUrl)\n    {\n        $resolvedEndpointScheme = parse_url($resolvedUrl, PHP_URL_SCHEME);\n        $scheme = $this->endpoint instanceof Uri\n            ? $this->endpoint->getScheme()\n            : parse_url($this->endpoint, PHP_URL_SCHEME);\n\n        if (!empty($scheme) && $scheme !== $resolvedEndpointScheme) {\n            $resolvedUrl = str_replace(\n                $resolvedEndpointScheme,\n                $scheme,\n                $resolvedUrl\n            );\n        }\n    }\n}\n", "num_lines": 244}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\EndpointV2\\Rule;\n\nuse Aws\\EndpointV2\\Ruleset\\RulesetStandardLibrary;\n\n/**\n *  A rule within a rule set. All rules contain a conditions property,\n * which can be empty, and documentation about the rule.\n */\nabstract Class AbstractRule\n{\n    private $conditions;\n    private $documentation;\n\n    public function __construct(array $definition)\n    {\n        $this->conditions = $definition['conditions'];\n        $this->documentation = isset($definition['documentation']) ?\n            $definition['documentation'] : null;\n    }\n\n    /**\n     * @return array\n     */\n    public function getConditions()\n    {\n        return $this->conditions;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getDocumentation()\n    {\n        return $this->documentation;\n    }\n\n    /**\n     * Determines if all conditions for a given rule are met.\n     *\n     * @return boolean\n     */\n    protected function evaluateConditions(\n        array &$inputParameters,\n        RulesetStandardLibrary $standardLibrary\n    )\n    {\n        foreach($this->getConditions() as $condition) {\n            $result = $standardLibrary->callFunction($condition, $inputParameters);\n            if (is_null($result) || $result === false) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    abstract public function evaluate(\n        array $inputParameters,\n        RulesetStandardLibrary $standardLibrary\n    );\n}\n", "num_lines": 63}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\EndpointV2\\Rule;\n\nuse Aws\\EndpointV2\\Ruleset\\RulesetStandardLibrary;\nuse Aws\\EndpointV2\\Ruleset\\RulesetEndpoint;\n\nClass EndpointRule extends AbstractRule\n{\n    /** @var array */\n    private $endpoint;\n\n    public function __construct(array $definition)\n    {\n        parent::__construct($definition);\n        $this->endpoint = $definition['endpoint'];\n    }\n\n    /**\n     * @return array\n     */\n    public function getEndpoint()\n    {\n        return $this->endpoint;\n    }\n\n    /**\n     * If all the rule's conditions are met, return the resolved\n     * endpoint object.\n     *\n     * @return RulesetEndpoint | null\n     */\n    public function evaluate(array $inputParameters, RulesetStandardLibrary $standardLibrary)\n    {\n        if ($this->evaluateConditions($inputParameters, $standardLibrary)) {\n            return $this->resolve($inputParameters, $standardLibrary);\n        }\n        return false;\n    }\n\n    /**\n     * Given input parameters, resolve an endpoint in its entirety.\n     *\n     * @return RulesetEndpoint\n     */\n    private function resolve(\n        array $inputParameters,\n        RulesetStandardLibrary $standardLibrary\n    )\n    {\n        $uri = $standardLibrary->resolveValue($this->endpoint['url'], $inputParameters);\n        $properties = isset($this->endpoint['properties'])\n                ? $this->resolveProperties($this->endpoint['properties'], $inputParameters, $standardLibrary)\n                : null;\n        $headers = $this->resolveHeaders($inputParameters, $standardLibrary);\n\n        return new RulesetEndpoint($uri, $properties, $headers);\n    }\n\n    /**\n     * Recurse through an endpoint's `properties` attribute, resolving template\n     * strings when found. Return the fully resolved attribute.\n     *\n     * @return array\n     */\n    private function resolveProperties(\n        $properties,\n        array $inputParameters,\n        RulesetStandardLibrary $standardLibrary\n    )\n    {\n        if (is_array($properties)) {\n           $propertiesArr = [];\n           foreach($properties as $key => $val) {\n               $propertiesArr[$key] = $this->resolveProperties($val, $inputParameters, $standardLibrary);\n           }\n           return $propertiesArr;\n        } elseif ($standardLibrary->isTemplate($properties)) {\n            return $standardLibrary->resolveTemplateString($properties, $inputParameters);\n        }\n        return $properties;\n    }\n\n    /**\n     * If present, iterate through an endpoint's headers attribute resolving\n     * values along the way. Return the fully resolved attribute.\n     *\n     * @return array\n     */\n    private function resolveHeaders(\n        array $inputParameters,\n        RulesetStandardLibrary $standardLibrary\n    )\n    {\n        $headers = isset($this->endpoint['headers']) ? $this->endpoint['headers'] : null;\n        if (is_null($headers)) {\n            return null;\n        }\n        $resolvedHeaders = [];\n\n        foreach($headers as $headerName => $headerValues) {\n            $resolvedValues = [];\n            foreach($headerValues as $value) {\n                $resolvedValue = $standardLibrary->resolveValue($value, $inputParameters, $standardLibrary);\n                $resolvedValues[] = $resolvedValue;\n            }\n            $resolvedHeaders[$headerName] = $resolvedValues;\n        }\n        return $resolvedHeaders;\n    }\n}\n", "num_lines": 112}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\EndpointV2\\Rule;\n\nuse Aws\\EndpointV2\\Ruleset\\RulesetStandardLibrary;\nuse Aws\\Exception\\UnresolvedEndpointException;\n\nclass ErrorRule extends AbstractRule\n{\n    /** @var array */\n    private $error;\n\n    public function __construct($definition)\n    {\n        parent::__construct($definition);\n        $this->error = $definition['error'];\n    }\n\n    /**\n     * @return array\n     */\n    public function getError()\n    {\n        return $this->error;\n    }\n\n    /**\n     * If an error rule's conditions are met, raise an\n     * UnresolvedEndpointError containing the fully resolved error string.\n     *\n     * @return null\n     * @throws UnresolvedEndpointException\n     */\n    public function evaluate(\n        array $inputParameters,\n        RulesetStandardLibrary $standardLibrary\n    )\n    {\n        if ($this->evaluateConditions($inputParameters, $standardLibrary)) {\n            $message = $standardLibrary->resolveValue($this->error, $inputParameters);\n            throw new UnresolvedEndpointException($message);\n        }\n        return false;\n    }\n}\n", "num_lines": 46}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\EndpointV2\\Rule;\n\nuse Aws\\Exception\\UnresolvedEndpointException;\n\nclass RuleCreator\n{\n    public static function create($type, $definition)\n    {\n        switch ($type) {\n            case 'endpoint':\n                return new EndpointRule($definition);\n            case 'error':\n                return new ErrorRule($definition);\n            case 'tree':\n                return new TreeRule($definition);\n            default:\n                throw new UnresolvedEndpointException(\n                    'Unknown rule type ' . $type .\n                    ' must be of type `endpoint`, `tree` or `error`'\n                );\n        }\n    }\n}\n\n", "num_lines": 27}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\EndpointV2\\Rule;\n\nuse Aws\\EndpointV2\\Ruleset\\RulesetStandardLibrary;\n\nclass TreeRule extends AbstractRule\n{\n    /** @var array */\n    private $rules;\n\n    public function __construct(array $definition)\n    {\n        parent::__construct($definition);\n        $this->rules = $this->createRules($definition['rules']);\n    }\n\n    /**\n     * @return array\n     */\n    public function getRules()\n    {\n        return $this->rules;\n    }\n\n    /**\n     * If a tree rule's conditions evaluate successfully, iterate over its\n     * subordinate rules and return a result if there is one. If any of the\n     * subsequent rules are trees, the function will recurse until it reaches\n     * an error or an endpoint rule\n     *\n     * @return mixed\n     */\n    public function evaluate(\n        array $inputParameters,\n        RulesetStandardLibrary $standardLibrary\n    )\n    {\n        if ($this->evaluateConditions($inputParameters, $standardLibrary)) {\n            foreach($this->rules as $rule) {\n                $inputParametersCopy = $inputParameters;\n                $evaluation = $rule->evaluate($inputParametersCopy, $standardLibrary);\n                if ($evaluation !== false) {\n                    return $evaluation;\n                }\n            }\n        }\n        return false;\n    }\n\n    private function createRules(array $rules)\n    {\n        $rulesList = [];\n\n        forEach($rules as $rule) {\n            $ruleType = RuleCreator::create($rule['type'], $rule);\n            $rulesList[] = $ruleType;\n        }\n        return $rulesList;\n    }\n}\n", "num_lines": 62}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\EndpointV2\\Ruleset;\n\nuse Aws\\EndpointV2\\Rule\\RuleCreator;\n\n/**\n * A collection of rules, parameter definitions and a class of helper functions\n * used to resolve either an endpoint or an error.\n */\nClass Ruleset\n{\n    /** @var string */\n    private $version;\n\n    /** @var array */\n    private $parameters;\n\n    /** @var array */\n    private $rules;\n\n    /** @var RulesetStandardLibrary */\n    public $standardLibrary;\n\n    public function __construct(array $ruleset, array $partitions)\n    {\n        $this->version = $ruleset['version'];\n        $this->parameters = $this->createParameters($ruleset['parameters']);\n        $this->rules = $this->createRules($ruleset['rules']);\n        $this->standardLibrary = new RulesetStandardLibrary($partitions);\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getVersion()\n    {\n        return $this->version;\n    }\n\n    /**\n     * @return array\n     */\n    public function getParameters()\n    {\n        return $this->parameters;\n    }\n\n    /**\n     * @return array\n     */\n    public function getRules()\n    {\n        return $this->rules;\n    }\n\n    /**\n     * Evaluate the ruleset against the input parameters.\n     * Return the first rule the parameters match against.\n     *\n     * @return mixed\n     */\n    public function evaluate(array $inputParameters)\n    {\n        $this->validateInputParameters($inputParameters);\n\n        foreach($this->rules as $rule) {\n            $evaluation = $rule->evaluate($inputParameters, $this->standardLibrary);\n            if ($evaluation !== false) {\n                return $evaluation;\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Ensures all corresponding client-provided parameters match\n     * the Ruleset parameter's specified type.\n     *\n     * @return void\n     */\n    private function validateInputParameters(array &$inputParameters)\n    {\n        foreach($this->parameters as $paramName => $param) {\n            $inputParam = isset($inputParameters[$paramName]) ? $inputParameters[$paramName] : null;\n\n            if (is_null($inputParam) && !is_null($param->getDefault())) {\n                $inputParameters[$paramName] = $param->getDefault();\n            } elseif (!is_null($inputParam)) {\n                $param->validateInputParam($inputParam);\n            }\n        }\n    }\n\n    private function createParameters(array $parameters)\n    {\n        $parameterList = [];\n\n        foreach($parameters as $name => $definition) {\n            $parameterList[$name] = new RulesetParameter($name, $definition);\n        }\n\n        return $parameterList;\n    }\n\n    private function createRules(array $rules)\n    {\n        $rulesList = [];\n\n        forEach($rules as $rule) {\n            $ruleObj = RuleCreator::create($rule['type'], $rule);\n            $rulesList[] = $ruleObj;\n        }\n        return $rulesList;\n    }\n}\n\n", "num_lines": 118}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\EndpointV2\\Ruleset;\n\n/**\n * Represents a fully resolved endpoint that a\n * rule returns if input parameters meet its requirements.\n */\nclass RulesetEndpoint\n{\n    /** @var string */\n    private $url;\n\n    /** @var array */\n    private $properties;\n\n    /** @var array */\n    private $headers;\n\n    public function __construct($url, $properties = null, $headers = null)\n    {\n        $this->url = $url;\n        $this->properties = $properties;\n        $this->headers = $headers;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getUrl()\n    {\n        return $this->url;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getProperties()\n    {\n        return $this->properties;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getHeaders()\n    {\n        return $this->headers;\n    }\n}\n", "num_lines": 51}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\EndpointV2\\Ruleset;\n\nuse Aws\\Exception\\UnresolvedEndpointException;\n\n/**\n * Houses properties of an individual parameter definition.\n */\nclass RulesetParameter\n{\n    /** @var string */\n    private $name;\n\n    /** @var string */\n    private $type;\n\n    /** @var string */\n    private $builtIn;\n\n    /** @var string */\n    private $default;\n\n    /** @var array */\n    private $required;\n\n    /** @var string */\n    private $documentation;\n\n    /** @var boolean */\n    private $deprecated;\n\n    public function __construct($name, array $definition)\n    {\n        $type = ucfirst($definition['type']);\n        if ($this->isValidType($type)) {\n            $this->type = $type;\n        } else {\n            throw new UnresolvedEndpointException(\n                'Unknown parameter type ' . \"`{$type}`\" .\n                '. Parameters must be of type `String` or `Boolean`.'\n            );\n        }\n        $this->name = $name;\n        $this->builtIn = isset($definition['builtIn']) ? $definition['builtIn'] : null;\n        $this->default = isset($definition['default']) ? $definition['default'] : null;\n        $this->required =  isset($definition['required']) ?\n            $definition['required'] : false;\n        $this->documentation =  isset($definition['documentation']) ?\n            $definition['documentation'] : null;\n        $this->deprecated =  isset($definition['deprecated']) ?\n            $definition['deprecated'] : false;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getType()\n    {\n        return $this->type;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getBuiltIn()\n    {\n        return $this->builtIn;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getDefault()\n    {\n        return $this->default;\n    }\n\n    /**\n     * @return boolean\n     */\n    public function getRequired()\n    {\n        return $this->required;\n    }\n\n    /**\n     * @return string\n     */\n    public function getDocumentation()\n    {\n        return $this->documentation;\n    }\n\n    /**\n     * @return boolean\n     */\n    public function getDeprecated()\n    {\n        return $this->deprecated;\n    }\n\n    /**\n     * Validates that an input parameter matches the type provided in its definition.\n     *\n     * @return void\n     * @throws InvalidArgumentException\n     */\n    public function validateInputParam($inputParam)\n    {\n        $typeMap = [\n            'String' => 'is_string',\n            'Boolean' => 'is_bool'\n        ];\n\n        if ($typeMap[$this->type]($inputParam) === false) {\n            throw new UnresolvedEndpointException(\n                \"Input parameter `{$this->name}` is the wrong type. Must be a {$this->type}.\"\n            );\n        }\n\n        if ($this->deprecated) {\n            $deprecated = $this->deprecated;\n            $deprecationString = \"{$this->name} has been deprecated \";\n            $msg = isset($deprecated['message']) ? $deprecated['message'] : null;\n            $since = isset($deprecated['since']) ? $deprecated['since'] : null;\n\n            if (!is_null($since)) $deprecationString = $deprecationString\n                . 'since '. $since . '. ';\n            if (!is_null($msg)) $deprecationString = $deprecationString . $msg;\n\n            trigger_error($deprecationString, E_USER_WARNING);\n        }\n    }\n\n    private function isValidType($type)\n    {\n        return in_array($type, ['String', 'Boolean']);\n    }\n}\n", "num_lines": 149}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\EndpointV2\\Ruleset;\n\nuse Aws\\Exception\\UnresolvedEndpointException;\n\n/**\n * Provides functions and actions to be performed for endpoint evaluation.\n * This is an internal only class and is not subject to backwards-compatibility guarantees.\n *\n * @internal\n */\nclass RulesetStandardLibrary\n{\n    const IPV4_RE = '/^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}$/';\n    const IPV6_RE = '/([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|\n                    . ([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]\n                    . {1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:)\n                    . {1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|\n                    . [0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:\n                    . (:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|\n                    . 1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]\n                    . {1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]\n                    . |1{0,1}[0-9]){0,1}[0-9])/';\n    const TEMPLATE_ESCAPE_RE = '/{\\{\\s*(.*?)\\s*\\}\\}/';\n    const TEMPLATE_SEARCH_RE = '/\\{[a-zA-Z#]+\\}/';\n    const TEMPLATE_PARSE_RE = '#\\{((?>[^\\{\\}]+)|(?R))*\\}#x';\n    const HOST_LABEL_RE = '/^(?!-)[a-zA-Z\\d-]{1,63}(?<!-)$/';\n\n    private $partitions;\n\n    public function __construct($partitions)\n    {\n        $this->partitions = $partitions;\n    }\n\n    /**\n     * Determines if a value is set.\n     *\n     * @return boolean\n     */\n    public function is_set($value)\n    {\n        return isset($value);\n    }\n\n    /**\n     * Function implementation of logical operator `not`\n     *\n     * @return boolean\n     */\n    public function not($value)\n    {\n        return !$value;\n    }\n\n    /**\n     * Find an attribute within a value given a path string.\n     *\n     * @return mixed\n     */\n    public function getAttr($from, $path)\n    {\n        $parts = explode('.', $path);\n        foreach ($parts as $part) {\n            $sliceIdx = strpos($part, '[');\n            if ($sliceIdx !== false) {\n                if (substr($part, -1) !== ']') {\n                    return null;\n                }\n                $slice = intval(substr($part, $sliceIdx + 1, strlen($part) - 1));\n                $from = isset($from[substr($part,0, $sliceIdx)][$slice])\n                    ? $from[substr($part,0, $sliceIdx)][$slice]\n                    : null;\n            } else {\n                $from = $from[$part];\n            }\n        }\n        return $from;\n    }\n\n    /**\n     * Computes a substring given the start index and end index. If `reverse` is\n     * true, slice the string from the end instead.\n     *\n     * @return mixed\n     */\n    public function substring($input, $start, $stop, $reverse)\n    {\n        if (!is_string($input)) {\n            throw new UnresolvedEndpointException(\n                'Input passed to `substring` must be `string`.'\n            );\n        }\n\n        if (preg_match('/[^\\x00-\\x7F]/', $input)) {\n            return null;\n        }\n        if ($start >= $stop or strlen($input) < $stop) {\n            return null;\n        }\n        if (!$reverse) {\n            return substr($input, $start, $stop - $start);\n        } else {\n            $offset = strlen($input) - $stop;\n            $length = $stop - $start;\n            return substr($input, $offset, $length);\n        }\n    }\n\n    /**\n     * Evaluates two strings for equality.\n     *\n     * @return boolean\n     */\n    public function stringEquals($string1, $string2)\n    {\n        if (!is_string($string1) || !is_string($string2)) {\n            throw new UnresolvedEndpointException(\n                'Values passed to StringEquals must be `string`.'\n            );\n        }\n        return $string1 === $string2;\n    }\n\n    /**\n     * Evaluates two booleans for equality.\n     *\n     * @return boolean\n     */\n    public function booleanEquals($boolean1, $boolean2)\n    {\n        return\n            filter_var($boolean1, FILTER_VALIDATE_BOOLEAN)\n            === filter_var($boolean2, FILTER_VALIDATE_BOOLEAN);\n    }\n\n    /**\n     * Percent-encodes an input string.\n     *\n     * @return mixed\n     */\n    public function uriEncode($input)\n    {\n        if (is_null($input)) {\n            return null;\n        }\n        return str_replace('%7E', '~', rawurlencode($input));\n    }\n\n    /**\n     * Parses URL string into components.\n     *\n     * @return mixed\n     */\n    public function parseUrl($url)\n    {\n        $parsed = parse_url($url);\n\n        if ($parsed === false || !empty($parsed['query'])) {\n            return null;\n        } elseif (!isset($parsed['scheme'])) {\n            return null;\n        }\n\n        if ($parsed['scheme'] !== 'http'\n            && $parsed['scheme'] !== 'https'\n        ) {\n            return null;\n        }\n\n        $urlInfo = [];\n        $urlInfo['scheme'] = $parsed['scheme'];\n        $urlInfo['authority'] = isset($parsed['host']) ? $parsed['host'] : '';\n        if (isset($parsed['port'])) {\n            $urlInfo['authority'] = $urlInfo['authority'] . \":\" . $parsed['port'];\n        }\n        $urlInfo['path'] = isset($parsed['path']) ? $parsed['path'] : '';\n        $urlInfo['normalizedPath'] = !empty($parsed['path'])\n            ? rtrim($urlInfo['path'] ?: '', '/' .  \"/\") . '/'\n            : '/';\n        $urlInfo['isIp'] = !isset($parsed['host']) ?\n            'false' : $this->isValidIp($parsed['host']);\n\n        return $urlInfo;\n    }\n\n    /**\n     * Evaluates whether a value is a valid host label per\n     * RFC 1123. If allow_subdomains is true, split on `.` and validate\n     * each subdomain separately.\n     *\n     * @return boolean\n     */\n    public function isValidHostLabel($hostLabel, $allowSubDomains)\n    {\n        if (!isset($hostLabel)\n            || (!$allowSubDomains && strpos($hostLabel, '.') != false)\n        ) {\n            return false;\n        }\n\n        if ($allowSubDomains) {\n            foreach (explode('.', $hostLabel) as $subdomain) {\n                if (!$this->validateHostLabel($subdomain)) {\n                    return false;\n                }\n            }\n            return true;\n        } else {\n            return $this->validateHostLabel($hostLabel);\n        }\n    }\n\n    /**\n     * Parse and validate string for ARN components.\n     *\n     * @return array|null\n     */\n    public function parseArn($arnString)\n    {\n        if (is_null($arnString)\n            || substr( $arnString, 0, 3 ) !== \"arn\"\n        ) {\n            return null;\n        }\n\n        $arn = [];\n        $parts = explode(':', $arnString, 6);\n        if (sizeof($parts) < 6) {\n            return null;\n        }\n\n        $arn['partition'] = isset($parts[1]) ? $parts[1] : null;\n        $arn['service'] = isset($parts[2]) ? $parts[2] : null;\n        $arn['region'] = isset($parts[3]) ? $parts[3] : null;\n        $arn['accountId'] = isset($parts[4]) ? $parts[4] : null;\n        $arn['resourceId'] = isset($parts[5]) ? $parts[5] : null;\n\n        if (empty($arn['partition'])\n            || empty($arn['service'])\n            || empty($arn['resourceId'])\n        ) {\n            return null;\n        }\n        $resource = $arn['resourceId'];\n        $arn['resourceId'] = preg_split(\"/[:\\/]/\", $resource);\n\n        return $arn;\n    }\n\n    /**\n     * Matches a region string to an AWS partition.\n     *\n     * @return mixed\n     */\n    public function partition($region)\n    {\n        if (!is_string($region)) {\n            throw new UnresolvedEndpointException(\n                'Value passed to `partition` must be `string`.'\n            );\n        }\n\n        $partitions = $this->partitions;\n        foreach ($partitions['partitions'] as $partition) {\n            if (array_key_exists($region, $partition['regions'])\n                || preg_match(\"/{$partition['regionRegex']}/\", $region)\n            ) {\n                return $partition['outputs'];\n            }\n        }\n        //return `aws` partition if no match is found.\n        return $partitions['partitions'][0]['outputs'];\n    }\n\n    /**\n     * Evaluates whether a value is a valid bucket name for virtual host\n     * style bucket URLs.\n     *\n     * @return boolean\n     */\n    public function isVirtualHostableS3Bucket($bucketName, $allowSubdomains)\n    {\n        if ((is_null($bucketName)\n            || (strlen($bucketName) < 3 || strlen($bucketName) > 63))\n            || preg_match(self::IPV4_RE, $bucketName)\n            || strtolower($bucketName) !== $bucketName\n        ) {\n            return false;\n        }\n\n        if ($allowSubdomains) {\n            $labels = explode('.', $bucketName);\n            $results = [];\n            forEach($labels as $label) {\n                $results[] = $this->isVirtualHostableS3Bucket($label, false);\n            }\n            return !in_array(false, $results);\n        }\n        return $this->isValidHostLabel($bucketName, false);\n    }\n\n    public function callFunction($funcCondition, &$inputParameters)\n    {\n        $funcArgs = [];\n\n        forEach($funcCondition['argv'] as $arg) {\n            $funcArgs[] = $this->resolveValue($arg, $inputParameters);\n        }\n\n        $funcName = str_replace('aws.', '', $funcCondition['fn']);\n        if ($funcName === 'isSet') {\n            $funcName = 'is_set';\n        }\n\n        $result = call_user_func_array(\n            [RulesetStandardLibrary::class, $funcName],\n            $funcArgs\n        );\n\n        if (isset($funcCondition['assign'])) {\n            $assign = $funcCondition['assign'];\n            if (isset($inputParameters[$assign])){\n                throw new UnresolvedEndpointException(\n                    \"Assignment `{$assign}` already exists in input parameters\" .\n                    \" or has already been assigned by an endpoint rule and cannot be overwritten.\"\n                );\n            }\n            $inputParameters[$assign] = $result;\n        }\n        return $result;\n    }\n\n    public function resolveValue($value, $inputParameters)\n    {\n        //Given a value, check if it's a function, reference or template.\n        //returns resolved value\n        if ($this->isFunc($value)) {\n            return $this->callFunction($value, $inputParameters);\n        } elseif ($this->isRef($value)) {\n            return isset($inputParameters[$value['ref']]) ? $inputParameters[$value['ref']] : null;\n        } elseif ($this->isTemplate($value)) {\n            return $this->resolveTemplateString($value, $inputParameters);\n        }\n        return $value;\n    }\n\n    public function isFunc($arg)\n    {\n        return is_array($arg) && isset($arg['fn']);\n    }\n\n    public function isRef($arg)\n    {\n        return is_array($arg) && isset($arg['ref']);\n    }\n\n    public function isTemplate($arg)\n    {\n        return is_string($arg) && !empty(preg_match(self::TEMPLATE_SEARCH_RE, $arg));\n    }\n\n    public function resolveTemplateString($value, $inputParameters)\n    {\n        return preg_replace_callback(\n            self::TEMPLATE_PARSE_RE,\n            function ($match) use ($inputParameters) {\n                if (preg_match(self::TEMPLATE_ESCAPE_RE, $match[0])) {\n                    return $match[1];\n                }\n\n                $notFoundMessage = 'Resolved value was null.  Please check rules and ' .\n                    'input parameters and try again.';\n\n                $parts = explode(\"#\", $match[1]);\n                if (count($parts) > 1) {\n                    $resolvedValue = $inputParameters;\n                    foreach($parts as $part) {\n                        if (!isset($resolvedValue[$part])) {\n                            throw new UnresolvedEndpointException($notFoundMessage);\n                        }\n                        $resolvedValue = $resolvedValue[$part];\n                    }\n                    return $resolvedValue;\n                } else {\n                    if (!isset($inputParameters[$parts[0]])) {\n                        throw new UnresolvedEndpointException($notFoundMessage);\n                    }\n                    return $inputParameters[$parts[0]];\n                }\n            },\n            $value\n        );\n    }\n\n    private function validateHostLabel ($hostLabel)\n    {\n        if (empty($hostLabel) || strlen($hostLabel) > 63) {\n            return false;\n        }\n        if (preg_match(self::HOST_LABEL_RE, $hostLabel)) {\n            return true;\n        }\n        return false;\n    }\n\n    private function isValidIp($hostName)\n    {\n        $isWrapped = strpos($hostName, '[') === 0\n            && strrpos($hostName, ']') === strlen($hostName) - 1;\n\n        return preg_match(\n                self::IPV4_RE,\n            $hostName\n        )\n        //IPV6 enclosed in brackets\n        || ($isWrapped && preg_match(\n            self::IPV6_RE,\n            $hostName\n        ))\n            ? 'true' : 'false';\n    }\n}\n", "num_lines": 425}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EventBridge;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon EventBridge** service.\n * @method \\Aws\\Result activateEventSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise activateEventSourceAsync(array $args = [])\n * @method \\Aws\\Result cancelReplay(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelReplayAsync(array $args = [])\n * @method \\Aws\\Result createApiDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApiDestinationAsync(array $args = [])\n * @method \\Aws\\Result createArchive(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createArchiveAsync(array $args = [])\n * @method \\Aws\\Result createConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConnectionAsync(array $args = [])\n * @method \\Aws\\Result createEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEndpointAsync(array $args = [])\n * @method \\Aws\\Result createEventBus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEventBusAsync(array $args = [])\n * @method \\Aws\\Result createPartnerEventSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPartnerEventSourceAsync(array $args = [])\n * @method \\Aws\\Result deactivateEventSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deactivateEventSourceAsync(array $args = [])\n * @method \\Aws\\Result deauthorizeConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deauthorizeConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteApiDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApiDestinationAsync(array $args = [])\n * @method \\Aws\\Result deleteArchive(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteArchiveAsync(array $args = [])\n * @method \\Aws\\Result deleteConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteEventBus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventBusAsync(array $args = [])\n * @method \\Aws\\Result deletePartnerEventSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePartnerEventSourceAsync(array $args = [])\n * @method \\Aws\\Result deleteRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRuleAsync(array $args = [])\n * @method \\Aws\\Result describeApiDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeApiDestinationAsync(array $args = [])\n * @method \\Aws\\Result describeArchive(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeArchiveAsync(array $args = [])\n * @method \\Aws\\Result describeConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConnectionAsync(array $args = [])\n * @method \\Aws\\Result describeEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEndpointAsync(array $args = [])\n * @method \\Aws\\Result describeEventBus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventBusAsync(array $args = [])\n * @method \\Aws\\Result describeEventSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventSourceAsync(array $args = [])\n * @method \\Aws\\Result describePartnerEventSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePartnerEventSourceAsync(array $args = [])\n * @method \\Aws\\Result describeReplay(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReplayAsync(array $args = [])\n * @method \\Aws\\Result describeRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRuleAsync(array $args = [])\n * @method \\Aws\\Result disableRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableRuleAsync(array $args = [])\n * @method \\Aws\\Result enableRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableRuleAsync(array $args = [])\n * @method \\Aws\\Result listApiDestinations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApiDestinationsAsync(array $args = [])\n * @method \\Aws\\Result listArchives(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listArchivesAsync(array $args = [])\n * @method \\Aws\\Result listConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConnectionsAsync(array $args = [])\n * @method \\Aws\\Result listEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEndpointsAsync(array $args = [])\n * @method \\Aws\\Result listEventBuses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventBusesAsync(array $args = [])\n * @method \\Aws\\Result listEventSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventSourcesAsync(array $args = [])\n * @method \\Aws\\Result listPartnerEventSourceAccounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPartnerEventSourceAccountsAsync(array $args = [])\n * @method \\Aws\\Result listPartnerEventSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPartnerEventSourcesAsync(array $args = [])\n * @method \\Aws\\Result listReplays(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReplaysAsync(array $args = [])\n * @method \\Aws\\Result listRuleNamesByTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRuleNamesByTargetAsync(array $args = [])\n * @method \\Aws\\Result listRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRulesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTargetsByRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTargetsByRuleAsync(array $args = [])\n * @method \\Aws\\Result putEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEventsAsync(array $args = [])\n * @method \\Aws\\Result putPartnerEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPartnerEventsAsync(array $args = [])\n * @method \\Aws\\Result putPermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPermissionAsync(array $args = [])\n * @method \\Aws\\Result putRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRuleAsync(array $args = [])\n * @method \\Aws\\Result putTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putTargetsAsync(array $args = [])\n * @method \\Aws\\Result removePermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removePermissionAsync(array $args = [])\n * @method \\Aws\\Result removeTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTargetsAsync(array $args = [])\n * @method \\Aws\\Result startReplay(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startReplayAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result testEventPattern(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testEventPatternAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApiDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApiDestinationAsync(array $args = [])\n * @method \\Aws\\Result updateArchive(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateArchiveAsync(array $args = [])\n * @method \\Aws\\Result updateConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConnectionAsync(array $args = [])\n * @method \\Aws\\Result updateEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEndpointAsync(array $args = [])\n */\nclass EventBridgeClient extends AwsClient {\n    public function __construct(array $args)\n    {\n        parent::__construct($args);\n\n        if ($this->isUseEndpointV2()) {\n            $stack = $this->getHandlerList();\n            $isCustomEndpoint = isset($args['endpoint']);\n            $stack->appendBuild(\n                EventBridgeEndpointMiddleware::wrap(\n                    $this->getRegion(),\n                    [\n                        'use_fips_endpoint' =>\n                            $this->getConfig('use_fips_endpoint')->isUseFipsEndpoint(),\n                        'dual_stack' =>\n                            $this->getConfig('use_dual_stack_endpoint')->isUseDualStackEndpoint(),\n                    ],\n                    $this->getConfig('endpoint_provider'),\n                    $isCustomEndpoint\n                ),\n                'eventbridge.endpoint_middleware'\n            );\n        }\n    }\n}\n", "num_lines": 146}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EventBridge;\n\nuse Aws\\CommandInterface;\nuse Aws\\Endpoint\\EndpointProvider;\nuse Aws\\Endpoint\\PartitionEndpointProvider;\nuse InvalidArgumentException;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Reroutes an eventbridge request to the proper endpoint\n * @internal\n */\nclass EventBridgeEndpointMiddleware\n{\n    private $nextHandler;\n    private $region;\n    private $config;\n    private $endpointProvider;\n    private $isCustomEndpoint;\n\n    /**\n     * Provide the URI scheme of the client sending requests.\n     * @param EndpointProvider $endpointProvider\n     * @return callable\n     */\n    public static function wrap($region, $config, $endpointProvider, $isCustomEndpoint)\n    {\n        return function (callable $handler) use (\n            $region,\n            $config,\n            $endpointProvider,\n            $isCustomEndpoint\n        ) {\n            return new self(\n                $handler,\n                $region,\n                $config,\n                $endpointProvider,\n                $isCustomEndpoint\n            );\n        };\n    }\n\n    public function __construct(\n        callable $nextHandler,\n        $region,\n        $config,\n        $endpointProvider,\n        $isCustomEndpoint\n    ) {\n        $this->nextHandler = $nextHandler;\n        $this->region = $region;\n        $this->config = $config;\n        $this->endpointProvider = is_null($endpointProvider)\n            ? PartitionEndpointProvider::defaultProvider()\n            : $endpointProvider;\n        $this->isCustomEndpoint = $isCustomEndpoint;\n    }\n\n    public function __invoke(CommandInterface $cmd, RequestInterface $req) {\n        $sigV4aCommands = ['PutEvents'];\n        if (in_array($cmd->getName(), $sigV4aCommands)) {\n            if (isset($cmd['EndpointId'])) {\n                $endpointID = $cmd['EndpointId'];\n                $this->validateEndpointId($endpointID);\n                if (!$this->isCustomEndpoint) {\n                    $dnsSuffix = $this->endpointProvider\n                        ->getPartition($this->region, 'eventbridge')\n                        ->getDnsSuffix();\n                    $newUri = \"{$endpointID}.endpoint.events.{$dnsSuffix}\";\n                    $oldUri = $req->getUri();\n                    $req = $req->withUri($oldUri->withHost($newUri));\n                }\n                $cmd['@context']['signature_version'] = 'v4a';\n            }\n        }\n        $f = $this->nextHandler;\n        return $f($cmd, $req);\n    }\n\n    protected static function isValidHostLabel($string)\n    {\n        if (empty($string) || strlen($string) > 63) {\n            return false;\n        }\n        if ($value = preg_match(\"/^[a-zA-Z0-9-.]+$/\", $string)) {\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * @param $endpointID\n     * @param CommandInterface $cmd\n     */\n    private function validateEndpointId($endpointID)\n    {\n        if (empty($endpointID)) {\n            throw new \\InvalidArgumentException(\"EventId must be a non-empty string\");\n        }\n        if (!self::isValidHostLabel($endpointID)) {\n            throw new InvalidArgumentException(\"EventId must be a valid host\");\n        }\n        if ($this->config['use_fips_endpoint']) {\n            throw new InvalidArgumentException(\n                \"EventId is currently not compatible with FIPS pseudo regions\"\n            );\n        }\n        if ($this->config['dual_stack']) {\n            throw new InvalidArgumentException(\n                \"EventId is currently not compatible with dualstack\"\n            );\n        }\n    }\n}\n", "num_lines": 117}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\EventBridge\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon EventBridge** service.\n */\nclass EventBridgeException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Exception;\n\nuse Aws\\Api\\Shape;\nuse Aws\\CommandInterface;\nuse Aws\\HasDataTrait;\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\nuse Aws\\ResponseContainerInterface;\nuse Aws\\ResultInterface;\nuse JmesPath\\Env as JmesPath;\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Represents an AWS exception that is thrown when a command fails.\n */\nclass AwsException extends \\RuntimeException implements\n    MonitoringEventsInterface,\n    ResponseContainerInterface,\n    \\ArrayAccess\n{\n    use HasDataTrait;\n    use HasMonitoringEventsTrait;\n\n    /** @var ResponseInterface */\n    private $response;\n    private $request;\n    private $result;\n    private $command;\n    private $requestId;\n    private $errorType;\n    private $errorCode;\n    private $errorShape;\n    private $connectionError;\n    private $transferInfo;\n    private $errorMessage;\n    private $maxRetriesExceeded;\n\n\n    /**\n     * @param string           $message Exception message\n     * @param CommandInterface $command\n     * @param array            $context Exception context\n     * @param \\Exception       $previous  Previous exception (if any)\n     */\n    public function __construct(\n        $message,\n        CommandInterface $command,\n        array $context = [],\n        \\Exception $previous = null\n    ) {\n        $this->data = isset($context['body']) ? $context['body'] : [];\n        $this->command = $command;\n        $this->response = isset($context['response']) ? $context['response'] : null;\n        $this->request = isset($context['request']) ? $context['request'] : null;\n        $this->requestId = isset($context['request_id'])\n            ? $context['request_id']\n            : null;\n        $this->errorType = isset($context['type']) ? $context['type'] : null;\n        $this->errorCode = isset($context['code']) ? $context['code'] : null;\n        $this->errorShape = isset($context['error_shape']) ? $context['error_shape'] : null;\n        $this->connectionError = !empty($context['connection_error']);\n        $this->result = isset($context['result']) ? $context['result'] : null;\n        $this->transferInfo = isset($context['transfer_stats'])\n            ? $context['transfer_stats']\n            : [];\n        $this->errorMessage = isset($context['message'])\n            ? $context['message']\n            : null;\n        $this->monitoringEvents = [];\n        $this->maxRetriesExceeded = false;\n        parent::__construct($message, 0, $previous);\n    }\n\n    public function __toString()\n    {\n        if (!$this->getPrevious()) {\n            return parent::__toString();\n        }\n\n        // PHP strangely shows the innermost exception first before the outer\n        // exception message. It also has a default character limit for\n        // exception message strings such that the \"next\" exception (this one)\n        // might not even get shown, causing developers to attempt to catch\n        // the inner exception instead of the actual exception because they\n        // can't see the outer exception's __toString output.\n        return sprintf(\n            \"exception '%s' with message '%s'\\n\\n%s\",\n            get_class($this),\n            $this->getMessage(),\n            parent::__toString()\n        );\n    }\n\n    /**\n     * Get the command that was executed.\n     *\n     * @return CommandInterface\n     */\n    public function getCommand()\n    {\n        return $this->command;\n    }\n\n    /**\n     * Get the concise error message if any.\n     *\n     * @return string|null\n     */\n    public function getAwsErrorMessage()\n    {\n        return $this->errorMessage;\n    }\n\n    /**\n     * Get the sent HTTP request if any.\n     *\n     * @return RequestInterface|null\n     */\n    public function getRequest()\n    {\n        return $this->request;\n    }\n\n    /**\n     * Get the received HTTP response if any.\n     *\n     * @return ResponseInterface|null\n     */\n    public function getResponse()\n    {\n        return $this->response;\n    }\n\n    /**\n     * Get the result of the exception if available\n     *\n     * @return ResultInterface|null\n     */\n    public function getResult()\n    {\n        return $this->result;\n    }\n\n    /**\n     * Returns true if this is a connection error.\n     *\n     * @return bool\n     */\n    public function isConnectionError()\n    {\n        return $this->connectionError;\n    }\n\n    /**\n     * If available, gets the HTTP status code of the corresponding response\n     *\n     * @return int|null\n     */\n    public function getStatusCode()\n    {\n        return $this->response ? $this->response->getStatusCode() : null;\n    }\n\n    /**\n     * Get the request ID of the error. This value is only present if a\n     * response was received and is not present in the event of a networking\n     * error.\n     *\n     * @return string|null Returns null if no response was received\n     */\n    public function getAwsRequestId()\n    {\n        return $this->requestId;\n    }\n\n    /**\n     * Get the AWS error type.\n     *\n     * @return string|null Returns null if no response was received\n     */\n    public function getAwsErrorType()\n    {\n        return $this->errorType;\n    }\n\n    /**\n     * Get the AWS error code.\n     *\n     * @return string|null Returns null if no response was received\n     */\n    public function getAwsErrorCode()\n    {\n        return $this->errorCode;\n    }\n\n    /**\n     * Get the AWS error shape.\n     *\n     * @return Shape|null Returns null if no response was received\n     */\n    public function getAwsErrorShape()\n    {\n        return $this->errorShape;\n    }\n\n    /**\n     * Get all transfer information as an associative array if no $name\n     * argument is supplied, or gets a specific transfer statistic if\n     * a $name attribute is supplied (e.g., 'retries_attempted').\n     *\n     * @param string $name Name of the transfer stat to retrieve\n     *\n     * @return mixed|null|array\n     */\n    public function getTransferInfo($name = null)\n    {\n        if (!$name) {\n            return $this->transferInfo;\n        }\n\n        return isset($this->transferInfo[$name])\n            ? $this->transferInfo[$name]\n            : null;\n    }\n\n    /**\n     * Replace the transfer information associated with an exception.\n     *\n     * @param array $info\n     */\n    public function setTransferInfo(array $info)\n    {\n        $this->transferInfo = $info;\n    }\n\n    /**\n     * Returns whether the max number of retries is exceeded.\n     *\n     * @return bool\n     */\n    public function isMaxRetriesExceeded()\n    {\n        return $this->maxRetriesExceeded;\n    }\n\n    /**\n     * Sets the flag for max number of retries exceeded.\n     */\n    public function setMaxRetriesExceeded()\n    {\n        $this->maxRetriesExceeded = true;\n    }\n\n    public function hasKey($name)\n    {\n        return isset($this->data[$name]);\n    }\n\n    public function get($key)\n    {\n        return $this[$key];\n    }\n\n    public function search($expression)\n    {\n        return JmesPath::search($expression, $this->toArray());\n    }\n}\n", "num_lines": 271}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Exception;\n\nclass CommonRuntimeException extends \\RuntimeException\n{\n    \n}\n", "num_lines": 8}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\nclass CouldNotCreateChecksumException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n\n    public function __construct($algorithm, \\Exception $previous = null)\n    {\n        $prefix = $algorithm === 'md5' ? \"An\" : \"A\";\n        parent::__construct(\"{$prefix} {$algorithm} checksum could not be \"\n            . \"calculated for the provided upload body, because it was not \"\n            . \"seekable. To prevent this error you can either 1) include the \"\n            . \"ContentMD5 or ContentSHA256 parameters with your request, 2) \"\n            . \"use a seekable stream for the body, or 3) wrap the non-seekable \"\n            . \"stream in a GuzzleHttp\\\\Psr7\\\\CachingStream object. You \"\n            . \"should be careful though and remember that the CachingStream \"\n            . \"utilizes PHP temp streams. This means that the stream will be \"\n            . \"temporarily stored on the local disk.\", 0, $previous);\n    }\n}\n", "num_lines": 26}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\nclass CredentialsException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Exception;\n\n/**\n * This class represents exceptions related to logic surrounding client-side\n * encryption usage.\n */\nclass CryptoException extends \\RuntimeException\n{\n\n}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Exception;\n\n/**\n * Class CryptoPolyfillException\n * @package Aws\\Exception\n */\nclass CryptoPolyfillException extends \\RuntimeException\n{\n\n}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Exception;\n\n/**\n * Represents an exception that was supplied via an EventStream.\n */\nclass EventStreamDataException extends \\RuntimeException\n{\n    private $errorCode;\n    private $errorMessage;\n\n    public function __construct($code, $message)\n    {\n        $this->errorCode = $code;\n        $this->errorMessage = $message;\n        parent::__construct($message);\n    }\n\n    /**\n     * Get the AWS error code.\n     *\n     * @return string|null Returns null if no response was received\n     */\n    public function getAwsErrorCode()\n    {\n        return $this->errorCode;\n    }\n\n    /**\n     * Get the concise error message if any.\n     *\n     * @return string|null\n     */\n    public function getAwsErrorMessage()\n    {\n        return $this->errorMessage;\n    }\n}\n", "num_lines": 39}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\nclass IncalculablePayloadException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\nclass InvalidJsonException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\nclass InvalidRegionException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\nuse Aws\\Multipart\\UploadState;\n\nclass MultipartUploadException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n\n    /** @var UploadState State of the erroneous transfer */\n    private $state;\n\n    /**\n     * @param UploadState      $state Upload state at time of the exception.\n     * @param \\Exception|array $prev  Exception being thrown.\n     */\n    public function __construct(UploadState $state, $prev = null) {\n        $msg = 'An exception occurred while performing a multipart upload';\n\n        if (is_array($prev)) {\n            $msg = strtr($msg, ['performing' => 'uploading parts to']);\n            $msg .= \". The following parts had errors:\\n\";\n            /** @var $error AwsException */\n            foreach ($prev as $part => $error) {\n                $msg .= \"- Part {$part}: \" . $error->getMessage(). \"\\n\";\n            }\n        } elseif ($prev instanceof AwsException) {\n            switch ($prev->getCommand()->getName()) {\n                case 'CreateMultipartUpload':\n                case 'InitiateMultipartUpload':\n                    $action = 'initiating';\n                    break;\n                case 'CompleteMultipartUpload':\n                    $action = 'completing';\n                    break;\n            }\n            if (isset($action)) {\n                $msg = strtr($msg, ['performing' => $action]);\n            }\n            $msg .= \": {$prev->getMessage()}\";\n        }\n\n        if (!$prev instanceof \\Exception) {\n            $prev = null;\n        }\n\n        parent::__construct($msg, 0, $prev);\n        $this->state = $state;\n    }\n\n    /**\n     * Get the state of the transfer\n     *\n     * @return UploadState\n     */\n    public function getState()\n    {\n        return $this->state;\n    }\n}\n", "num_lines": 64}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\nclass TokenException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\nclass UnresolvedApiException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\nclass UnresolvedEndpointException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\nclass UnresolvedSignatureException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\FinSpaceData;\n\nuse Aws\\AwsClient;\nuse Aws\\CommandInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * This client is used to interact with the **FinSpace Public API** service.\n * @method \\Aws\\Result associateUserToPermissionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateUserToPermissionGroupAsync(array $args = [])\n * @method \\Aws\\Result createChangeset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChangesetAsync(array $args = [])\n * @method \\Aws\\Result createDataView(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataViewAsync(array $args = [])\n * @method \\Aws\\Result createDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatasetAsync(array $args = [])\n * @method \\Aws\\Result createPermissionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPermissionGroupAsync(array $args = [])\n * @method \\Aws\\Result createUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserAsync(array $args = [])\n * @method \\Aws\\Result deleteDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDatasetAsync(array $args = [])\n * @method \\Aws\\Result deletePermissionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePermissionGroupAsync(array $args = [])\n * @method \\Aws\\Result disableUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableUserAsync(array $args = [])\n * @method \\Aws\\Result disassociateUserFromPermissionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateUserFromPermissionGroupAsync(array $args = [])\n * @method \\Aws\\Result enableUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableUserAsync(array $args = [])\n * @method \\Aws\\Result getChangeset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChangesetAsync(array $args = [])\n * @method \\Aws\\Result getDataView(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataViewAsync(array $args = [])\n * @method \\Aws\\Result getDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDatasetAsync(array $args = [])\n * @method \\Aws\\Result getExternalDataViewAccessDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExternalDataViewAccessDetailsAsync(array $args = [])\n * @method \\Aws\\Result getPermissionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPermissionGroupAsync(array $args = [])\n * @method \\Aws\\Result getProgrammaticAccessCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProgrammaticAccessCredentialsAsync(array $args = [])\n * @method \\Aws\\Result getUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUserAsync(array $args = [])\n * @method \\Aws\\Result getWorkingLocation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkingLocationAsync(array $args = [])\n * @method \\Aws\\Result listChangesets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChangesetsAsync(array $args = [])\n * @method \\Aws\\Result listDataViews(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataViewsAsync(array $args = [])\n * @method \\Aws\\Result listDatasets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetsAsync(array $args = [])\n * @method \\Aws\\Result listPermissionGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPermissionGroupsAsync(array $args = [])\n * @method \\Aws\\Result listPermissionGroupsByUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPermissionGroupsByUserAsync(array $args = [])\n * @method \\Aws\\Result listUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUsersAsync(array $args = [])\n * @method \\Aws\\Result listUsersByPermissionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUsersByPermissionGroupAsync(array $args = [])\n * @method \\Aws\\Result resetUserPassword(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetUserPasswordAsync(array $args = [])\n * @method \\Aws\\Result updateChangeset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChangesetAsync(array $args = [])\n * @method \\Aws\\Result updateDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDatasetAsync(array $args = [])\n * @method \\Aws\\Result updatePermissionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePermissionGroupAsync(array $args = [])\n * @method \\Aws\\Result updateUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserAsync(array $args = [])\n */\nclass FinSpaceDataClient extends AwsClient {}\n", "num_lines": 74}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\FinSpaceData\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **FinSpace Public API** service.\n */\nclass FinSpaceDataException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Firehose;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Kinesis Firehose** service.\n *\n * @method \\Aws\\Result createDeliveryStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeliveryStreamAsync(array $args = [])\n * @method \\Aws\\Result deleteDeliveryStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDeliveryStreamAsync(array $args = [])\n * @method \\Aws\\Result describeDeliveryStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDeliveryStreamAsync(array $args = [])\n * @method \\Aws\\Result listDeliveryStreams(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeliveryStreamsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForDeliveryStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForDeliveryStreamAsync(array $args = [])\n * @method \\Aws\\Result putRecord(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRecordAsync(array $args = [])\n * @method \\Aws\\Result putRecordBatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRecordBatchAsync(array $args = [])\n * @method \\Aws\\Result startDeliveryStreamEncryption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDeliveryStreamEncryptionAsync(array $args = [])\n * @method \\Aws\\Result stopDeliveryStreamEncryption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopDeliveryStreamEncryptionAsync(array $args = [])\n * @method \\Aws\\Result tagDeliveryStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagDeliveryStreamAsync(array $args = [])\n * @method \\Aws\\Result untagDeliveryStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagDeliveryStreamAsync(array $args = [])\n * @method \\Aws\\Result updateDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDestinationAsync(array $args = [])\n */\nclass FirehoseClient extends AwsClient {}\n", "num_lines": 35}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Firehose\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Kinesis Firehose** service.\n */\nclass FirehoseException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\FIS;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Fault Injection Simulator** service.\n * @method \\Aws\\Result createExperimentTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createExperimentTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteExperimentTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteExperimentTemplateAsync(array $args = [])\n * @method \\Aws\\Result getAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getActionAsync(array $args = [])\n * @method \\Aws\\Result getExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExperimentAsync(array $args = [])\n * @method \\Aws\\Result getExperimentTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExperimentTemplateAsync(array $args = [])\n * @method \\Aws\\Result getTargetResourceType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTargetResourceTypeAsync(array $args = [])\n * @method \\Aws\\Result listActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listActionsAsync(array $args = [])\n * @method \\Aws\\Result listExperimentTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExperimentTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listExperiments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExperimentsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTargetResourceTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTargetResourceTypesAsync(array $args = [])\n * @method \\Aws\\Result startExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startExperimentAsync(array $args = [])\n * @method \\Aws\\Result stopExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopExperimentAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateExperimentTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateExperimentTemplateAsync(array $args = [])\n */\nclass FISClient extends AwsClient {}\n", "num_lines": 42}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\FIS\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Fault Injection Simulator** service.\n */\nclass FISException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\FMS;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Firewall Management Service** service.\n * @method \\Aws\\Result associateAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result associateThirdPartyFirewall(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateThirdPartyFirewallAsync(array $args = [])\n * @method \\Aws\\Result batchAssociateResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchAssociateResourceAsync(array $args = [])\n * @method \\Aws\\Result batchDisassociateResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDisassociateResourceAsync(array $args = [])\n * @method \\Aws\\Result deleteAppsList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppsListAsync(array $args = [])\n * @method \\Aws\\Result deleteNotificationChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNotificationChannelAsync(array $args = [])\n * @method \\Aws\\Result deletePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteProtocolsList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProtocolsListAsync(array $args = [])\n * @method \\Aws\\Result deleteResourceSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourceSetAsync(array $args = [])\n * @method \\Aws\\Result disassociateAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result disassociateThirdPartyFirewall(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateThirdPartyFirewallAsync(array $args = [])\n * @method \\Aws\\Result getAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result getAdminScope(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAdminScopeAsync(array $args = [])\n * @method \\Aws\\Result getAppsList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppsListAsync(array $args = [])\n * @method \\Aws\\Result getComplianceDetail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getComplianceDetailAsync(array $args = [])\n * @method \\Aws\\Result getNotificationChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNotificationChannelAsync(array $args = [])\n * @method \\Aws\\Result getPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPolicyAsync(array $args = [])\n * @method \\Aws\\Result getProtectionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProtectionStatusAsync(array $args = [])\n * @method \\Aws\\Result getProtocolsList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProtocolsListAsync(array $args = [])\n * @method \\Aws\\Result getResourceSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceSetAsync(array $args = [])\n * @method \\Aws\\Result getThirdPartyFirewallAssociationStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getThirdPartyFirewallAssociationStatusAsync(array $args = [])\n * @method \\Aws\\Result getViolationDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getViolationDetailsAsync(array $args = [])\n * @method \\Aws\\Result listAdminAccountsForOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAdminAccountsForOrganizationAsync(array $args = [])\n * @method \\Aws\\Result listAdminsManagingAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAdminsManagingAccountAsync(array $args = [])\n * @method \\Aws\\Result listAppsLists(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppsListsAsync(array $args = [])\n * @method \\Aws\\Result listComplianceStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listComplianceStatusAsync(array $args = [])\n * @method \\Aws\\Result listDiscoveredResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDiscoveredResourcesAsync(array $args = [])\n * @method \\Aws\\Result listMemberAccounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMemberAccountsAsync(array $args = [])\n * @method \\Aws\\Result listPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listProtocolsLists(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProtocolsListsAsync(array $args = [])\n * @method \\Aws\\Result listResourceSetResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceSetResourcesAsync(array $args = [])\n * @method \\Aws\\Result listResourceSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceSetsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listThirdPartyFirewallFirewallPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listThirdPartyFirewallFirewallPoliciesAsync(array $args = [])\n * @method \\Aws\\Result putAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result putAppsList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAppsListAsync(array $args = [])\n * @method \\Aws\\Result putNotificationChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putNotificationChannelAsync(array $args = [])\n * @method \\Aws\\Result putPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPolicyAsync(array $args = [])\n * @method \\Aws\\Result putProtocolsList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putProtocolsListAsync(array $args = [])\n * @method \\Aws\\Result putResourceSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourceSetAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass FMSClient extends AwsClient {}\n", "num_lines": 94}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\FMS\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Firewall Management Service** service.\n */\nclass FMSException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ForecastQueryService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Forecast Query Service** service.\n * @method \\Aws\\Result queryForecast(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise queryForecastAsync(array $args = [])\n * @method \\Aws\\Result queryWhatIfForecast(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise queryWhatIfForecastAsync(array $args = [])\n */\nclass ForecastQueryServiceClient extends AwsClient {}\n", "num_lines": 14}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ForecastQueryService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Forecast Query Service** service.\n */\nclass ForecastQueryServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ForecastService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Forecast Service** service.\n * @method \\Aws\\Result createAutoPredictor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAutoPredictorAsync(array $args = [])\n * @method \\Aws\\Result createDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatasetAsync(array $args = [])\n * @method \\Aws\\Result createDatasetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatasetGroupAsync(array $args = [])\n * @method \\Aws\\Result createDatasetImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatasetImportJobAsync(array $args = [])\n * @method \\Aws\\Result createExplainability(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createExplainabilityAsync(array $args = [])\n * @method \\Aws\\Result createExplainabilityExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createExplainabilityExportAsync(array $args = [])\n * @method \\Aws\\Result createForecast(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createForecastAsync(array $args = [])\n * @method \\Aws\\Result createForecastExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createForecastExportJobAsync(array $args = [])\n * @method \\Aws\\Result createMonitor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMonitorAsync(array $args = [])\n * @method \\Aws\\Result createPredictor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPredictorAsync(array $args = [])\n * @method \\Aws\\Result createPredictorBacktestExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPredictorBacktestExportJobAsync(array $args = [])\n * @method \\Aws\\Result createWhatIfAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWhatIfAnalysisAsync(array $args = [])\n * @method \\Aws\\Result createWhatIfForecast(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWhatIfForecastAsync(array $args = [])\n * @method \\Aws\\Result createWhatIfForecastExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWhatIfForecastExportAsync(array $args = [])\n * @method \\Aws\\Result deleteDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDatasetAsync(array $args = [])\n * @method \\Aws\\Result deleteDatasetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDatasetGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteDatasetImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDatasetImportJobAsync(array $args = [])\n * @method \\Aws\\Result deleteExplainability(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteExplainabilityAsync(array $args = [])\n * @method \\Aws\\Result deleteExplainabilityExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteExplainabilityExportAsync(array $args = [])\n * @method \\Aws\\Result deleteForecast(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteForecastAsync(array $args = [])\n * @method \\Aws\\Result deleteForecastExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteForecastExportJobAsync(array $args = [])\n * @method \\Aws\\Result deleteMonitor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMonitorAsync(array $args = [])\n * @method \\Aws\\Result deletePredictor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePredictorAsync(array $args = [])\n * @method \\Aws\\Result deletePredictorBacktestExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePredictorBacktestExportJobAsync(array $args = [])\n * @method \\Aws\\Result deleteResourceTree(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourceTreeAsync(array $args = [])\n * @method \\Aws\\Result deleteWhatIfAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWhatIfAnalysisAsync(array $args = [])\n * @method \\Aws\\Result deleteWhatIfForecast(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWhatIfForecastAsync(array $args = [])\n * @method \\Aws\\Result deleteWhatIfForecastExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWhatIfForecastExportAsync(array $args = [])\n * @method \\Aws\\Result describeAutoPredictor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAutoPredictorAsync(array $args = [])\n * @method \\Aws\\Result describeDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDatasetAsync(array $args = [])\n * @method \\Aws\\Result describeDatasetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDatasetGroupAsync(array $args = [])\n * @method \\Aws\\Result describeDatasetImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDatasetImportJobAsync(array $args = [])\n * @method \\Aws\\Result describeExplainability(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeExplainabilityAsync(array $args = [])\n * @method \\Aws\\Result describeExplainabilityExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeExplainabilityExportAsync(array $args = [])\n * @method \\Aws\\Result describeForecast(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeForecastAsync(array $args = [])\n * @method \\Aws\\Result describeForecastExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeForecastExportJobAsync(array $args = [])\n * @method \\Aws\\Result describeMonitor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMonitorAsync(array $args = [])\n * @method \\Aws\\Result describePredictor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePredictorAsync(array $args = [])\n * @method \\Aws\\Result describePredictorBacktestExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePredictorBacktestExportJobAsync(array $args = [])\n * @method \\Aws\\Result describeWhatIfAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWhatIfAnalysisAsync(array $args = [])\n * @method \\Aws\\Result describeWhatIfForecast(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWhatIfForecastAsync(array $args = [])\n * @method \\Aws\\Result describeWhatIfForecastExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWhatIfForecastExportAsync(array $args = [])\n * @method \\Aws\\Result getAccuracyMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccuracyMetricsAsync(array $args = [])\n * @method \\Aws\\Result listDatasetGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetGroupsAsync(array $args = [])\n * @method \\Aws\\Result listDatasetImportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetImportJobsAsync(array $args = [])\n * @method \\Aws\\Result listDatasets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetsAsync(array $args = [])\n * @method \\Aws\\Result listExplainabilities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExplainabilitiesAsync(array $args = [])\n * @method \\Aws\\Result listExplainabilityExports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExplainabilityExportsAsync(array $args = [])\n * @method \\Aws\\Result listForecastExportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listForecastExportJobsAsync(array $args = [])\n * @method \\Aws\\Result listForecasts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listForecastsAsync(array $args = [])\n * @method \\Aws\\Result listMonitorEvaluations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMonitorEvaluationsAsync(array $args = [])\n * @method \\Aws\\Result listMonitors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMonitorsAsync(array $args = [])\n * @method \\Aws\\Result listPredictorBacktestExportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPredictorBacktestExportJobsAsync(array $args = [])\n * @method \\Aws\\Result listPredictors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPredictorsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWhatIfAnalyses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWhatIfAnalysesAsync(array $args = [])\n * @method \\Aws\\Result listWhatIfForecastExports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWhatIfForecastExportsAsync(array $args = [])\n * @method \\Aws\\Result listWhatIfForecasts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWhatIfForecastsAsync(array $args = [])\n * @method \\Aws\\Result resumeResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resumeResourceAsync(array $args = [])\n * @method \\Aws\\Result stopResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDatasetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDatasetGroupAsync(array $args = [])\n */\nclass ForecastServiceClient extends AwsClient {}\n", "num_lines": 136}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ForecastService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Forecast Service** service.\n */\nclass ForecastServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\FraudDetector;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Fraud Detector** service.\n * @method \\Aws\\Result batchCreateVariable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchCreateVariableAsync(array $args = [])\n * @method \\Aws\\Result batchGetVariable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetVariableAsync(array $args = [])\n * @method \\Aws\\Result cancelBatchImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelBatchImportJobAsync(array $args = [])\n * @method \\Aws\\Result cancelBatchPredictionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelBatchPredictionJobAsync(array $args = [])\n * @method \\Aws\\Result createBatchImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBatchImportJobAsync(array $args = [])\n * @method \\Aws\\Result createBatchPredictionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBatchPredictionJobAsync(array $args = [])\n * @method \\Aws\\Result createDetectorVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDetectorVersionAsync(array $args = [])\n * @method \\Aws\\Result createList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createListAsync(array $args = [])\n * @method \\Aws\\Result createModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createModelAsync(array $args = [])\n * @method \\Aws\\Result createModelVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createModelVersionAsync(array $args = [])\n * @method \\Aws\\Result createRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRuleAsync(array $args = [])\n * @method \\Aws\\Result createVariable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVariableAsync(array $args = [])\n * @method \\Aws\\Result deleteBatchImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBatchImportJobAsync(array $args = [])\n * @method \\Aws\\Result deleteBatchPredictionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBatchPredictionJobAsync(array $args = [])\n * @method \\Aws\\Result deleteDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDetectorAsync(array $args = [])\n * @method \\Aws\\Result deleteDetectorVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDetectorVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteEntityType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEntityTypeAsync(array $args = [])\n * @method \\Aws\\Result deleteEvent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventAsync(array $args = [])\n * @method \\Aws\\Result deleteEventType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventTypeAsync(array $args = [])\n * @method \\Aws\\Result deleteEventsByEventType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventsByEventTypeAsync(array $args = [])\n * @method \\Aws\\Result deleteExternalModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteExternalModelAsync(array $args = [])\n * @method \\Aws\\Result deleteLabel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLabelAsync(array $args = [])\n * @method \\Aws\\Result deleteList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteListAsync(array $args = [])\n * @method \\Aws\\Result deleteModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteModelAsync(array $args = [])\n * @method \\Aws\\Result deleteModelVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteModelVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteOutcome(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOutcomeAsync(array $args = [])\n * @method \\Aws\\Result deleteRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteVariable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVariableAsync(array $args = [])\n * @method \\Aws\\Result describeDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDetectorAsync(array $args = [])\n * @method \\Aws\\Result describeModelVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeModelVersionsAsync(array $args = [])\n * @method \\Aws\\Result getBatchImportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBatchImportJobsAsync(array $args = [])\n * @method \\Aws\\Result getBatchPredictionJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBatchPredictionJobsAsync(array $args = [])\n * @method \\Aws\\Result getDeleteEventsByEventTypeStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeleteEventsByEventTypeStatusAsync(array $args = [])\n * @method \\Aws\\Result getDetectorVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDetectorVersionAsync(array $args = [])\n * @method \\Aws\\Result getDetectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDetectorsAsync(array $args = [])\n * @method \\Aws\\Result getEntityTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEntityTypesAsync(array $args = [])\n * @method \\Aws\\Result getEvent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEventAsync(array $args = [])\n * @method \\Aws\\Result getEventPrediction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEventPredictionAsync(array $args = [])\n * @method \\Aws\\Result getEventPredictionMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEventPredictionMetadataAsync(array $args = [])\n * @method \\Aws\\Result getEventTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEventTypesAsync(array $args = [])\n * @method \\Aws\\Result getExternalModels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExternalModelsAsync(array $args = [])\n * @method \\Aws\\Result getKMSEncryptionKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getKMSEncryptionKeyAsync(array $args = [])\n * @method \\Aws\\Result getLabels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLabelsAsync(array $args = [])\n * @method \\Aws\\Result getListElements(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getListElementsAsync(array $args = [])\n * @method \\Aws\\Result getListsMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getListsMetadataAsync(array $args = [])\n * @method \\Aws\\Result getModelVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getModelVersionAsync(array $args = [])\n * @method \\Aws\\Result getModels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getModelsAsync(array $args = [])\n * @method \\Aws\\Result getOutcomes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOutcomesAsync(array $args = [])\n * @method \\Aws\\Result getRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRulesAsync(array $args = [])\n * @method \\Aws\\Result getVariables(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVariablesAsync(array $args = [])\n * @method \\Aws\\Result listEventPredictions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventPredictionsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDetectorAsync(array $args = [])\n * @method \\Aws\\Result putEntityType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEntityTypeAsync(array $args = [])\n * @method \\Aws\\Result putEventType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEventTypeAsync(array $args = [])\n * @method \\Aws\\Result putExternalModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putExternalModelAsync(array $args = [])\n * @method \\Aws\\Result putKMSEncryptionKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putKMSEncryptionKeyAsync(array $args = [])\n * @method \\Aws\\Result putLabel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putLabelAsync(array $args = [])\n * @method \\Aws\\Result putOutcome(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putOutcomeAsync(array $args = [])\n * @method \\Aws\\Result sendEvent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendEventAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDetectorVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDetectorVersionAsync(array $args = [])\n * @method \\Aws\\Result updateDetectorVersionMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDetectorVersionMetadataAsync(array $args = [])\n * @method \\Aws\\Result updateDetectorVersionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDetectorVersionStatusAsync(array $args = [])\n * @method \\Aws\\Result updateEventLabel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEventLabelAsync(array $args = [])\n * @method \\Aws\\Result updateList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateListAsync(array $args = [])\n * @method \\Aws\\Result updateModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateModelAsync(array $args = [])\n * @method \\Aws\\Result updateModelVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateModelVersionAsync(array $args = [])\n * @method \\Aws\\Result updateModelVersionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateModelVersionStatusAsync(array $args = [])\n * @method \\Aws\\Result updateRuleMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRuleMetadataAsync(array $args = [])\n * @method \\Aws\\Result updateRuleVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRuleVersionAsync(array $args = [])\n * @method \\Aws\\Result updateVariable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVariableAsync(array $args = [])\n */\nclass FraudDetectorClient extends AwsClient {}\n", "num_lines": 156}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\FraudDetector\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Fraud Detector** service.\n */\nclass FraudDetectorException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\FSx;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon FSx** service.\n * @method \\Aws\\Result associateFileSystemAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateFileSystemAliasesAsync(array $args = [])\n * @method \\Aws\\Result cancelDataRepositoryTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelDataRepositoryTaskAsync(array $args = [])\n * @method \\Aws\\Result copyBackup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyBackupAsync(array $args = [])\n * @method \\Aws\\Result createBackup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBackupAsync(array $args = [])\n * @method \\Aws\\Result createDataRepositoryAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataRepositoryAssociationAsync(array $args = [])\n * @method \\Aws\\Result createDataRepositoryTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataRepositoryTaskAsync(array $args = [])\n * @method \\Aws\\Result createFileCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFileCacheAsync(array $args = [])\n * @method \\Aws\\Result createFileSystem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFileSystemAsync(array $args = [])\n * @method \\Aws\\Result createFileSystemFromBackup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFileSystemFromBackupAsync(array $args = [])\n * @method \\Aws\\Result createSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createStorageVirtualMachine(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStorageVirtualMachineAsync(array $args = [])\n * @method \\Aws\\Result createVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVolumeAsync(array $args = [])\n * @method \\Aws\\Result createVolumeFromBackup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVolumeFromBackupAsync(array $args = [])\n * @method \\Aws\\Result deleteBackup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBackupAsync(array $args = [])\n * @method \\Aws\\Result deleteDataRepositoryAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataRepositoryAssociationAsync(array $args = [])\n * @method \\Aws\\Result deleteFileCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFileCacheAsync(array $args = [])\n * @method \\Aws\\Result deleteFileSystem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFileSystemAsync(array $args = [])\n * @method \\Aws\\Result deleteSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteStorageVirtualMachine(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStorageVirtualMachineAsync(array $args = [])\n * @method \\Aws\\Result deleteVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVolumeAsync(array $args = [])\n * @method \\Aws\\Result describeBackups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBackupsAsync(array $args = [])\n * @method \\Aws\\Result describeDataRepositoryAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDataRepositoryAssociationsAsync(array $args = [])\n * @method \\Aws\\Result describeDataRepositoryTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDataRepositoryTasksAsync(array $args = [])\n * @method \\Aws\\Result describeFileCaches(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFileCachesAsync(array $args = [])\n * @method \\Aws\\Result describeFileSystemAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFileSystemAliasesAsync(array $args = [])\n * @method \\Aws\\Result describeFileSystems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFileSystemsAsync(array $args = [])\n * @method \\Aws\\Result describeSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result describeStorageVirtualMachines(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStorageVirtualMachinesAsync(array $args = [])\n * @method \\Aws\\Result describeVolumes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVolumesAsync(array $args = [])\n * @method \\Aws\\Result disassociateFileSystemAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateFileSystemAliasesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result releaseFileSystemNfsV3Locks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise releaseFileSystemNfsV3LocksAsync(array $args = [])\n * @method \\Aws\\Result restoreVolumeFromSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreVolumeFromSnapshotAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDataRepositoryAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDataRepositoryAssociationAsync(array $args = [])\n * @method \\Aws\\Result updateFileCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFileCacheAsync(array $args = [])\n * @method \\Aws\\Result updateFileSystem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFileSystemAsync(array $args = [])\n * @method \\Aws\\Result updateSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSnapshotAsync(array $args = [])\n * @method \\Aws\\Result updateStorageVirtualMachine(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStorageVirtualMachineAsync(array $args = [])\n * @method \\Aws\\Result updateVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVolumeAsync(array $args = [])\n */\nclass FSxClient extends AwsClient {}\n", "num_lines": 92}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\FSx\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon FSx** service.\n */\nclass FSxException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\GameLift;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon GameLift** service.\n *\n * @method \\Aws\\Result acceptMatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptMatchAsync(array $args = [])\n * @method \\Aws\\Result claimGameServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise claimGameServerAsync(array $args = [])\n * @method \\Aws\\Result createAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAliasAsync(array $args = [])\n * @method \\Aws\\Result createBuild(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBuildAsync(array $args = [])\n * @method \\Aws\\Result createFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFleetAsync(array $args = [])\n * @method \\Aws\\Result createFleetLocations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFleetLocationsAsync(array $args = [])\n * @method \\Aws\\Result createGameServerGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGameServerGroupAsync(array $args = [])\n * @method \\Aws\\Result createGameSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGameSessionAsync(array $args = [])\n * @method \\Aws\\Result createGameSessionQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGameSessionQueueAsync(array $args = [])\n * @method \\Aws\\Result createLocation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLocationAsync(array $args = [])\n * @method \\Aws\\Result createMatchmakingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMatchmakingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createMatchmakingRuleSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMatchmakingRuleSetAsync(array $args = [])\n * @method \\Aws\\Result createPlayerSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPlayerSessionAsync(array $args = [])\n * @method \\Aws\\Result createPlayerSessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPlayerSessionsAsync(array $args = [])\n * @method \\Aws\\Result createScript(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createScriptAsync(array $args = [])\n * @method \\Aws\\Result createVpcPeeringAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpcPeeringAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result createVpcPeeringConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpcPeeringConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAliasAsync(array $args = [])\n * @method \\Aws\\Result deleteBuild(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBuildAsync(array $args = [])\n * @method \\Aws\\Result deleteFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFleetAsync(array $args = [])\n * @method \\Aws\\Result deleteFleetLocations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFleetLocationsAsync(array $args = [])\n * @method \\Aws\\Result deleteGameServerGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGameServerGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteGameSessionQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGameSessionQueueAsync(array $args = [])\n * @method \\Aws\\Result deleteLocation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLocationAsync(array $args = [])\n * @method \\Aws\\Result deleteMatchmakingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMatchmakingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteMatchmakingRuleSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMatchmakingRuleSetAsync(array $args = [])\n * @method \\Aws\\Result deleteScalingPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteScalingPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteScript(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteScriptAsync(array $args = [])\n * @method \\Aws\\Result deleteVpcPeeringAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpcPeeringAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result deleteVpcPeeringConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpcPeeringConnectionAsync(array $args = [])\n * @method \\Aws\\Result deregisterCompute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterComputeAsync(array $args = [])\n * @method \\Aws\\Result deregisterGameServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterGameServerAsync(array $args = [])\n * @method \\Aws\\Result describeAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAliasAsync(array $args = [])\n * @method \\Aws\\Result describeBuild(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBuildAsync(array $args = [])\n * @method \\Aws\\Result describeCompute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeComputeAsync(array $args = [])\n * @method \\Aws\\Result describeEC2InstanceLimits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEC2InstanceLimitsAsync(array $args = [])\n * @method \\Aws\\Result describeFleetAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetAttributesAsync(array $args = [])\n * @method \\Aws\\Result describeFleetCapacity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetCapacityAsync(array $args = [])\n * @method \\Aws\\Result describeFleetEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetEventsAsync(array $args = [])\n * @method \\Aws\\Result describeFleetLocationAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetLocationAttributesAsync(array $args = [])\n * @method \\Aws\\Result describeFleetLocationCapacity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetLocationCapacityAsync(array $args = [])\n * @method \\Aws\\Result describeFleetLocationUtilization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetLocationUtilizationAsync(array $args = [])\n * @method \\Aws\\Result describeFleetPortSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetPortSettingsAsync(array $args = [])\n * @method \\Aws\\Result describeFleetUtilization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetUtilizationAsync(array $args = [])\n * @method \\Aws\\Result describeGameServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGameServerAsync(array $args = [])\n * @method \\Aws\\Result describeGameServerGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGameServerGroupAsync(array $args = [])\n * @method \\Aws\\Result describeGameServerInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGameServerInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeGameSessionDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGameSessionDetailsAsync(array $args = [])\n * @method \\Aws\\Result describeGameSessionPlacement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGameSessionPlacementAsync(array $args = [])\n * @method \\Aws\\Result describeGameSessionQueues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGameSessionQueuesAsync(array $args = [])\n * @method \\Aws\\Result describeGameSessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGameSessionsAsync(array $args = [])\n * @method \\Aws\\Result describeInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeMatchmaking(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMatchmakingAsync(array $args = [])\n * @method \\Aws\\Result describeMatchmakingConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMatchmakingConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result describeMatchmakingRuleSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMatchmakingRuleSetsAsync(array $args = [])\n * @method \\Aws\\Result describePlayerSessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePlayerSessionsAsync(array $args = [])\n * @method \\Aws\\Result describeRuntimeConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRuntimeConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeScalingPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScalingPoliciesAsync(array $args = [])\n * @method \\Aws\\Result describeScript(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScriptAsync(array $args = [])\n * @method \\Aws\\Result describeVpcPeeringAuthorizations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcPeeringAuthorizationsAsync(array $args = [])\n * @method \\Aws\\Result describeVpcPeeringConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcPeeringConnectionsAsync(array $args = [])\n * @method \\Aws\\Result getComputeAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getComputeAccessAsync(array $args = [])\n * @method \\Aws\\Result getComputeAuthToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getComputeAuthTokenAsync(array $args = [])\n * @method \\Aws\\Result getGameSessionLogUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGameSessionLogUrlAsync(array $args = [])\n * @method \\Aws\\Result getInstanceAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInstanceAccessAsync(array $args = [])\n * @method \\Aws\\Result listAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAliasesAsync(array $args = [])\n * @method \\Aws\\Result listBuilds(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBuildsAsync(array $args = [])\n * @method \\Aws\\Result listCompute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listComputeAsync(array $args = [])\n * @method \\Aws\\Result listFleets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFleetsAsync(array $args = [])\n * @method \\Aws\\Result listGameServerGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGameServerGroupsAsync(array $args = [])\n * @method \\Aws\\Result listGameServers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGameServersAsync(array $args = [])\n * @method \\Aws\\Result listLocations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLocationsAsync(array $args = [])\n * @method \\Aws\\Result listScripts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listScriptsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putScalingPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putScalingPolicyAsync(array $args = [])\n * @method \\Aws\\Result registerCompute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerComputeAsync(array $args = [])\n * @method \\Aws\\Result registerGameServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerGameServerAsync(array $args = [])\n * @method \\Aws\\Result requestUploadCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise requestUploadCredentialsAsync(array $args = [])\n * @method \\Aws\\Result resolveAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resolveAliasAsync(array $args = [])\n * @method \\Aws\\Result resumeGameServerGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resumeGameServerGroupAsync(array $args = [])\n * @method \\Aws\\Result searchGameSessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchGameSessionsAsync(array $args = [])\n * @method \\Aws\\Result startFleetActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startFleetActionsAsync(array $args = [])\n * @method \\Aws\\Result startGameSessionPlacement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startGameSessionPlacementAsync(array $args = [])\n * @method \\Aws\\Result startMatchBackfill(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMatchBackfillAsync(array $args = [])\n * @method \\Aws\\Result startMatchmaking(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMatchmakingAsync(array $args = [])\n * @method \\Aws\\Result stopFleetActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopFleetActionsAsync(array $args = [])\n * @method \\Aws\\Result stopGameSessionPlacement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopGameSessionPlacementAsync(array $args = [])\n * @method \\Aws\\Result stopMatchmaking(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopMatchmakingAsync(array $args = [])\n * @method \\Aws\\Result suspendGameServerGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise suspendGameServerGroupAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAliasAsync(array $args = [])\n * @method \\Aws\\Result updateBuild(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBuildAsync(array $args = [])\n * @method \\Aws\\Result updateFleetAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFleetAttributesAsync(array $args = [])\n * @method \\Aws\\Result updateFleetCapacity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFleetCapacityAsync(array $args = [])\n * @method \\Aws\\Result updateFleetPortSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFleetPortSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateGameServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGameServerAsync(array $args = [])\n * @method \\Aws\\Result updateGameServerGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGameServerGroupAsync(array $args = [])\n * @method \\Aws\\Result updateGameSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGameSessionAsync(array $args = [])\n * @method \\Aws\\Result updateGameSessionQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGameSessionQueueAsync(array $args = [])\n * @method \\Aws\\Result updateMatchmakingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMatchmakingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateRuntimeConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRuntimeConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateScript(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateScriptAsync(array $args = [])\n * @method \\Aws\\Result validateMatchmakingRuleSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise validateMatchmakingRuleSetAsync(array $args = [])\n */\nclass GameLiftClient extends AwsClient {}\n", "num_lines": 219}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\GameLift\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon GameLift** service.\n */\nclass GameLiftException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\GameSparks;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **GameSparks** service.\n * @method \\Aws\\Result createGame(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGameAsync(array $args = [])\n * @method \\Aws\\Result createSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStageAsync(array $args = [])\n * @method \\Aws\\Result deleteGame(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGameAsync(array $args = [])\n * @method \\Aws\\Result deleteStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStageAsync(array $args = [])\n * @method \\Aws\\Result disconnectPlayer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disconnectPlayerAsync(array $args = [])\n * @method \\Aws\\Result exportSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportSnapshotAsync(array $args = [])\n * @method \\Aws\\Result getExtension(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExtensionAsync(array $args = [])\n * @method \\Aws\\Result getExtensionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExtensionVersionAsync(array $args = [])\n * @method \\Aws\\Result getGame(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGameAsync(array $args = [])\n * @method \\Aws\\Result getGameConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGameConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getGeneratedCodeJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGeneratedCodeJobAsync(array $args = [])\n * @method \\Aws\\Result getPlayerConnectionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPlayerConnectionStatusAsync(array $args = [])\n * @method \\Aws\\Result getSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSnapshotAsync(array $args = [])\n * @method \\Aws\\Result getStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStageAsync(array $args = [])\n * @method \\Aws\\Result getStageDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStageDeploymentAsync(array $args = [])\n * @method \\Aws\\Result importGameConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importGameConfigurationAsync(array $args = [])\n * @method \\Aws\\Result listExtensionVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExtensionVersionsAsync(array $args = [])\n * @method \\Aws\\Result listExtensions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExtensionsAsync(array $args = [])\n * @method \\Aws\\Result listGames(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGamesAsync(array $args = [])\n * @method \\Aws\\Result listGeneratedCodeJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGeneratedCodeJobsAsync(array $args = [])\n * @method \\Aws\\Result listSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result listStageDeployments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStageDeploymentsAsync(array $args = [])\n * @method \\Aws\\Result listStages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStagesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startGeneratedCodeJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startGeneratedCodeJobAsync(array $args = [])\n * @method \\Aws\\Result startStageDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startStageDeploymentAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateGame(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGameAsync(array $args = [])\n * @method \\Aws\\Result updateGameConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGameConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSnapshotAsync(array $args = [])\n * @method \\Aws\\Result updateStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStageAsync(array $args = [])\n */\nclass GameSparksClient extends AwsClient {}\n", "num_lines": 76}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\GameSparks\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **GameSparks** service.\n */\nclass GameSparksException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Glacier;\n\nuse Aws\\Api\\ApiProvider;\nuse Aws\\Api\\DocModel;\nuse Aws\\Api\\Service;\nuse Aws\\AwsClient;\nuse Aws\\CommandInterface;\nuse Aws\\Exception\\CouldNotCreateChecksumException;\nuse Aws\\HashingStream;\nuse Aws\\Middleware;\nuse Aws\\PhpHash;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * This client is used to interact with the **Amazon Glacier** service.\n *\n * @method \\Aws\\Result abortMultipartUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise abortMultipartUploadAsync(array $args = [])\n * @method \\Aws\\Result abortVaultLock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise abortVaultLockAsync(array $args = [])\n * @method \\Aws\\Result addTagsToVault(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsToVaultAsync(array $args = [])\n * @method \\Aws\\Result completeMultipartUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise completeMultipartUploadAsync(array $args = [])\n * @method \\Aws\\Result completeVaultLock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise completeVaultLockAsync(array $args = [])\n * @method \\Aws\\Result createVault(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVaultAsync(array $args = [])\n * @method \\Aws\\Result deleteArchive(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteArchiveAsync(array $args = [])\n * @method \\Aws\\Result deleteVault(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVaultAsync(array $args = [])\n * @method \\Aws\\Result deleteVaultAccessPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVaultAccessPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteVaultNotifications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVaultNotificationsAsync(array $args = [])\n * @method \\Aws\\Result describeJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJobAsync(array $args = [])\n * @method \\Aws\\Result describeVault(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVaultAsync(array $args = [])\n * @method \\Aws\\Result getDataRetrievalPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataRetrievalPolicyAsync(array $args = [])\n * @method \\Aws\\Result getJobOutput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobOutputAsync(array $args = [])\n * @method \\Aws\\Result getVaultAccessPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVaultAccessPolicyAsync(array $args = [])\n * @method \\Aws\\Result getVaultLock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVaultLockAsync(array $args = [])\n * @method \\Aws\\Result getVaultNotifications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVaultNotificationsAsync(array $args = [])\n * @method \\Aws\\Result initiateJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise initiateJobAsync(array $args = [])\n * @method \\Aws\\Result initiateMultipartUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise initiateMultipartUploadAsync(array $args = [])\n * @method \\Aws\\Result initiateVaultLock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise initiateVaultLockAsync(array $args = [])\n * @method \\Aws\\Result listJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobsAsync(array $args = [])\n * @method \\Aws\\Result listMultipartUploads(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMultipartUploadsAsync(array $args = [])\n * @method \\Aws\\Result listParts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPartsAsync(array $args = [])\n * @method \\Aws\\Result listProvisionedCapacity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProvisionedCapacityAsync(array $args = [])\n * @method \\Aws\\Result listTagsForVault(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForVaultAsync(array $args = [])\n * @method \\Aws\\Result listVaults(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVaultsAsync(array $args = [])\n * @method \\Aws\\Result purchaseProvisionedCapacity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise purchaseProvisionedCapacityAsync(array $args = [])\n * @method \\Aws\\Result removeTagsFromVault(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsFromVaultAsync(array $args = [])\n * @method \\Aws\\Result setDataRetrievalPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setDataRetrievalPolicyAsync(array $args = [])\n * @method \\Aws\\Result setVaultAccessPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setVaultAccessPolicyAsync(array $args = [])\n * @method \\Aws\\Result setVaultNotifications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setVaultNotificationsAsync(array $args = [])\n * @method \\Aws\\Result uploadArchive(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise uploadArchiveAsync(array $args = [])\n * @method \\Aws\\Result uploadMultipartPart(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise uploadMultipartPartAsync(array $args = [])\n */\nclass GlacierClient extends AwsClient\n{\n    public function __construct(array $args)\n    {\n        parent::__construct($args);\n\n        // Setup middleware.\n        $stack = $this->getHandlerList();\n        $stack->appendBuild($this->getApiVersionMiddleware(), 'glacier.api_version');\n        $stack->appendBuild($this->getChecksumsMiddleware(), 'glacier.checksum');\n        $stack->appendBuild(\n            Middleware::contentType(['UploadArchive', 'UploadPart']),\n            'glacier.content_type'\n        );\n        $stack->appendInit(\n            Middleware::sourceFile($this->getApi(), 'body', 'sourceFile'),\n            'glacier.source_file'\n        );\n    }\n\n    /**\n     * {@inheritdoc}\n     *\n     * Sets the default accountId to \"-\" for all operations.\n     */\n    public function getCommand($name, array $args = [])\n    {\n        return parent::getCommand($name, $args + ['accountId' => '-']);\n    }\n\n    /**\n     * Creates a middleware that updates a command with the content and tree\n     * hash headers for upload operations.\n     *\n     * @return callable\n     * @throws CouldNotCreateChecksumException if the body is not seekable.\n     */\n    private function getChecksumsMiddleware()\n    {\n        return function (callable $handler) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request = null\n            ) use ($handler) {\n                // Accept \"ContentSHA256\" with a lowercase \"c\" to match other Glacier params.\n                if (!$command['ContentSHA256'] && $command['contentSHA256']) {\n                    $command['ContentSHA256'] = $command['contentSHA256'];\n                    unset($command['contentSHA256']);\n                }\n\n                // If uploading, then make sure checksums are added.\n                $name = $command->getName();\n                if (($name === 'UploadArchive' || $name === 'UploadMultipartPart')\n                    && (!$command['checksum'] || !$command['ContentSHA256'])\n                ) {\n                    $body = $request->getBody();\n                    if (!$body->isSeekable()) {\n                        throw new CouldNotCreateChecksumException('sha256');\n                    }\n\n                    // Add a tree hash if not provided.\n                    if (!$command['checksum']) {\n                        $body = new HashingStream(\n                            $body, new TreeHash(),\n                            function ($result) use (&$request) {\n                                $request = $request->withHeader(\n                                    'x-amz-sha256-tree-hash',\n                                    bin2hex($result)\n                                );\n                            }\n                        );\n                    }\n\n                    // Add a linear content hash if not provided.\n                    if (!$command['ContentSHA256']) {\n                        $body = new HashingStream(\n                            $body, new PhpHash('sha256'),\n                            function ($result) use ($command) {\n                                $command['ContentSHA256'] = bin2hex($result);\n                            }\n                        );\n                    }\n\n                    // Read the stream in order to calculate the hashes.\n                    while (!$body->eof()) {\n                        $body->read(1048576);\n                    }\n                    $body->seek(0);\n                }\n\n                // Set the content hash header if a value is in the command.\n                if ($command['ContentSHA256']) {\n                    $request = $request->withHeader(\n                        'x-amz-content-sha256',\n                        $command['ContentSHA256']\n                    );\n                }\n\n                return $handler($command, $request);\n            };\n        };\n    }\n\n    /**\n     * Creates a middleware that adds the API version header for all requests.\n     *\n     * @return callable\n     */\n    private function getApiVersionMiddleware()\n    {\n        return function (callable $handler) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request = null\n            ) use ($handler) {\n                return $handler($command, $request->withHeader(\n                    'x-amz-glacier-version',\n                    $this->getApi()->getMetadata('apiVersion')\n                ));\n            };\n        };\n    }\n\n    /**\n     * @internal\n     * @codeCoverageIgnore\n     */\n    public static function applyDocFilters(array $api, array $docs)\n    {\n        // Add the SourceFile parameter.\n        $docs['shapes']['SourceFile']['base'] = 'The path to a file on disk to use instead of the body parameter.';\n        $api['shapes']['SourceFile'] = ['type' => 'string'];\n        $api['shapes']['UploadArchiveInput']['members']['sourceFile'] = ['shape' => 'SourceFile'];\n        $api['shapes']['UploadMultipartPartInput']['members']['sourceFile'] = ['shape' => 'SourceFile'];\n\n        // Add the ContentSHA256 parameter.\n        $docs['shapes']['ContentSHA256']['base'] = 'A SHA256 hash of the content of the request body';\n        $api['shapes']['ContentSHA256'] = ['type' => 'string'];\n        $api['shapes']['UploadArchiveInput']['members']['contentSHA256'] = ['shape' => 'ContentSHA256'];\n        $api['shapes']['UploadMultipartPartInput']['members']['contentSHA256'] = ['shape' => 'ContentSHA256'];\n\n        // Add information about \"checksum\" and \"ContentSHA256\" being optional.\n        $optional = '<div class=\"alert alert-info\">The SDK will compute this value '\n            . 'for you on your behalf if it is not supplied.</div>';\n        $docs['shapes']['checksum']['append'] = $optional;\n        $docs['shapes']['ContentSHA256']['append'] = $optional;\n\n        // Make \"accountId\" optional for all operations.\n        foreach ($api['operations'] as $operation) {\n            $inputShape =& $api['shapes'][$operation['input']['shape']];\n            $accountIdIndex = array_search('accountId', $inputShape['required']);\n            unset($inputShape['required'][$accountIdIndex]);\n        }\n        // Add information about the default value for \"accountId\".\n        $optional = '<div class=\"alert alert-info\">The SDK will set this value to \"-\" by default.</div>';\n        foreach ($docs['shapes']['string']['refs'] as $name => &$ref) {\n            if (strpos($name, 'accountId')) {\n                $ref .= $optional;\n            }\n        }\n\n        return [\n            new Service($api, ApiProvider::defaultProvider()),\n            new DocModel($docs)\n        ];\n    }\n}\n", "num_lines": 252}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Glacier;\n\nuse Aws\\CommandInterface;\nuse Aws\\HashingStream;\nuse Aws\\Multipart\\AbstractUploader;\nuse Aws\\Multipart\\UploadState;\nuse Aws\\PhpHash;\nuse Aws\\ResultInterface;\nuse GuzzleHttp\\Psr7;\nuse Psr\\Http\\Message\\StreamInterface as Stream;\n\n/**\n * Encapsulates the execution of a multipart upload to Glacier.\n */\nclass MultipartUploader extends AbstractUploader\n{\n    const PART_MIN_SIZE = 1048576;\n\n    private static $validPartSizes = [\n        1048576,    //   1 MB\n        2097152,    //   2 MB\n        4194304,    //   4 MB\n        8388608,    //   8 MB\n        16777216,   //  16 MB\n        33554432,   //  32 MB\n        67108864,   //  64 MB\n        134217728,  // 128 MB\n        268435456,  // 256 MB\n        536870912,  // 512 MB\n        1073741824, //   1 GB\n        2147483648, //   2 GB\n        4294967296, //   4 GB\n    ];\n\n    /**\n     * Creates an UploadState object for a multipart upload by querying the\n     * service for the specified upload's information.\n     *\n     * @param GlacierClient $client    GlacierClient object to use.\n     * @param string        $vaultName Vault name for the multipart upload.\n     * @param string        $uploadId  Upload ID for the multipart upload.\n     * @param string        $accountId Account ID for the multipart upload.\n     *\n     * @return UploadState\n     */\n    public static function getStateFromService(\n        GlacierClient $client,\n        $vaultName,\n        $uploadId,\n        $accountId = '-'\n    ) {\n        $state = new UploadState([\n            'accountId' => $accountId,\n            'vaultName' => $vaultName,\n            'uploadId'  => $uploadId,\n        ]);\n\n        foreach ($client->getPaginator('ListParts', $state->getId()) as $result) {\n            // Get the part size from the first part in the first result.\n            if (!$state->getPartSize()) {\n                $state->setPartSize($result['PartSizeInBytes']);\n            }\n            // Mark all the parts returned by ListParts as uploaded.\n            foreach ($result['Parts'] as $part) {\n                list($rangeIndex, $rangeSize) = self::parseRange(\n                    $part['RangeInBytes'],\n                    $state->getPartSize()\n                );\n                $state->markPartAsUploaded($rangeIndex, [\n                    'size'     => $rangeSize,\n                    'checksum' => $part['SHA256TreeHash'],\n                ]);\n            }\n        }\n\n        $state->setStatus(UploadState::INITIATED);\n\n        return $state;\n    }\n\n    /**\n     * Creates a multipart upload for a Glacier archive.\n     *\n     * The valid configuration options are as follows:\n     *\n     * - account_id: (string, default=string('-')) Account ID for the archive\n     *   being uploaded, if different from the account making the request.\n     * - archive_description: (string) Description of the archive.\n     * - before_complete: (callable) Callback to invoke before the\n     *   `CompleteMultipartUpload` operation. The callback should have a\n     *   function signature like `function (Aws\\Command $command) {...}`.\n     * - before_initiate: (callable) Callback to invoke before the\n     *   `InitiateMultipartUpload` operation. The callback should have a\n     *   function signature like `function (Aws\\Command $command) {...}`.\n     * - before_upload: (callable) Callback to invoke before any\n     *   `UploadMultipartPart` operations. The callback should have a function\n     *   signature like `function (Aws\\Command $command) {...}`.\n     * - concurrency: (int, default=int(3)) Maximum number of concurrent\n     *   `UploadMultipartPart` operations allowed during the multipart upload.\n     * - part_size: (int, default=int(1048576)) Part size, in bytes, to use when\n     *   doing a multipart upload. This must between 1 MB and 4 GB, and must be\n     *   a power of 2 (in megabytes).\n     * - prepare_data_source: (callable) Callback to invoke before starting the\n     *   multipart upload workflow. The callback should have a function\n     *   signature like `function () {...}`.\n     * - state: (Aws\\Multipart\\UploadState) An object that represents the state\n     *   of the multipart upload and that is used to resume a previous upload.\n     *   When this options is provided, the `account_id`, `key`, and `part_size`\n     *   options are ignored.\n     * - vault_name: (string, required) Vault name to use for the archive being\n     *   uploaded.\n     *\n     * @param GlacierClient $client Client used for the upload.\n     * @param mixed         $source Source of the data to upload.\n     * @param array         $config Configuration used to perform the upload.\n     */\n    public function __construct(GlacierClient $client, $source, array $config = [])\n    {\n        parent::__construct($client, $source, $config + [\n            'account_id' => '-',\n            'vault_name' => null,\n        ]);\n    }\n\n    protected function loadUploadWorkflowInfo()\n    {\n        return [\n            'command' => [\n                'initiate' => 'InitiateMultipartUpload',\n                'upload'   => 'UploadMultipartPart',\n                'complete' => 'CompleteMultipartUpload',\n            ],\n            'id' => [\n                'account_id' => 'accountId',\n                'vault_name' => 'vaultName',\n                'upload_id'  => 'uploadId',\n            ],\n            'part_num' => 'range',\n        ];\n    }\n\n    protected function determinePartSize()\n    {\n        // Make sure the part size is set.\n        $partSize = $this->config['part_size'] ?: self::PART_MIN_SIZE;\n\n        // Ensure that the part size is valid.\n        if (!in_array($partSize, self::$validPartSizes)) {\n            throw new \\InvalidArgumentException('The part_size must be a power '\n                . 'of 2, in megabytes, such that 1 MB <= PART_SIZE <= 4 GB.');\n        }\n\n        return $partSize;\n    }\n\n    protected function createPart($seekable, $number)\n    {\n        $data = [];\n        $firstByte = $this->source->tell();\n\n        // Read from the source to create the body stream. This also\n        // calculates the linear and tree hashes as the data is read.\n        if ($seekable) {\n            // Case 1: Stream is seekable, can make stream from new handle.\n            $body = Psr7\\Utils::tryFopen($this->source->getMetadata('uri'), 'r');\n            $body = $this->limitPartStream(Psr7\\Utils::streamFor($body));\n            // Create another stream decorated with hashing streams and read\n            // through it, so we can get the hash values for the part.\n            $decoratedBody = $this->decorateWithHashes($body, $data);\n            while (!$decoratedBody->eof()) $decoratedBody->read(1048576);\n            // Seek the original source forward to the end of the range.\n            $this->source->seek($this->source->tell() + $body->getSize());\n        } else {\n            // Case 2: Stream is not seekable, must store part in temp stream.\n            $source = $this->limitPartStream($this->source);\n            $source = $this->decorateWithHashes($source, $data);\n            $body = Psr7\\Utils::streamFor();\n            Psr7\\Utils::copyToStream($source, $body);\n        }\n\n        // Do not create a part if the body size is zero.\n        if ($body->getSize() === 0) {\n            return false;\n        }\n\n        $body->seek(0);\n        $data['body'] = $body;\n        $lastByte = $this->source->tell() - 1;\n        $data['range'] = \"bytes {$firstByte}-{$lastByte}/*\";\n\n        return $data;\n    }\n\n    protected function handleResult(CommandInterface $command, ResultInterface $result)\n    {\n        list($rangeIndex, $rangeSize) = $this->parseRange(\n            $command['range'],\n            $this->state->getPartSize()\n        );\n\n        $this->state->markPartAsUploaded($rangeIndex, [\n            'size'     => $rangeSize,\n            'checksum' => $command['checksum']\n        ]);\n    }\n\n    protected function getInitiateParams()\n    {\n        $params = ['partSize' => $this->state->getPartSize()];\n        if (isset($this->config['archive_description'])) {\n            $params['archiveDescription'] = $this->config['archive_description'];\n        }\n\n        return $params;\n    }\n\n    protected function getCompleteParams()\n    {\n        $treeHash = new TreeHash();\n        $archiveSize = 0;\n        foreach ($this->state->getUploadedParts() as $part) {\n            $archiveSize += $part['size'];\n            $treeHash->addChecksum($part['checksum']);\n        }\n\n        return [\n            'archiveSize' => $archiveSize,\n            'checksum'    => bin2hex($treeHash->complete()),\n        ];\n    }\n\n    /**\n     * Decorates a stream with a tree AND linear sha256 hashing stream.\n     *\n     * @param Stream $stream Stream to decorate.\n     * @param array  $data   Data bag that results are injected into.\n     *\n     * @return Stream\n     */\n    private function decorateWithHashes(Stream $stream, array &$data)\n    {\n        // Make sure that a tree hash is calculated.\n        $stream = new HashingStream($stream, new TreeHash(),\n            function ($result) use (&$data) {\n                $data['checksum'] = bin2hex($result);\n            }\n        );\n\n        // Make sure that a linear SHA256 hash is calculated.\n        $stream = new HashingStream($stream, new PhpHash('sha256'),\n            function ($result) use (&$data) {\n                $data['ContentSHA256'] = bin2hex($result);\n            }\n        );\n\n        return $stream;\n    }\n\n    /**\n     * Parses a Glacier range string into a size and part number.\n     *\n     * @param string $range    Glacier range string (e.g., \"bytes 5-5000/*\")\n     * @param int    $partSize The chosen part size\n     *\n     * @return array\n     */\n    private static function parseRange($range, $partSize)\n    {\n        // Strip away the prefix and suffix.\n        if (strpos($range, 'bytes') !== false) {\n            $range = substr($range, 6, -2);\n        }\n\n        // Split that range into it's parts.\n        list($firstByte, $lastByte) = explode('-', $range);\n\n        // Calculate and return range index and range size\n        return [\n            intval($firstByte / $partSize) + 1,\n            $lastByte - $firstByte + 1,\n        ];\n    }\n}\n", "num_lines": 285}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Glacier;\n\nuse Aws\\HashInterface;\n\n/**\n * Encapsulates the creation of a tree hash from streamed data\n */\nclass TreeHash implements HashInterface\n{\n    const MB = 1048576;\n    const EMPTY_HASH = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855';\n\n    /** @var string Algorithm used for hashing. */\n    private $algorithm;\n\n    /** @var string Buffered data that has not yet been hashed. */\n    private $buffer;\n\n    /** @var array Binary checksums from which the tree hash is derived. */\n    private $checksums = [];\n\n    /** @var string Resulting hash in binary form. */\n    private $hash;\n\n    public function __construct($algorithm = 'sha256')\n    {\n        $this->algorithm = $algorithm;\n        $this->reset();\n    }\n\n    /**\n     * {@inheritdoc}\n     * @throws \\LogicException if the root tree hash is already calculated\n     */\n    public function update($data)\n    {\n        // Error if hash is already calculated.\n        if ($this->hash) {\n            throw new \\LogicException('You may not add more data to a '\n                . 'complete tree hash.');\n        }\n\n        // Buffer incoming data.\n        $this->buffer .= $data;\n\n        // When there is more than a MB of data, create a checksum.\n        while (strlen($this->buffer) >= self::MB) {\n            $data = substr($this->buffer, 0, self::MB);\n            $this->buffer = substr($this->buffer, self::MB) ?: '';\n            $this->checksums[] = hash($this->algorithm, $data, true);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Add a checksum to the tree hash directly\n     *\n     * @param string $checksum   The checksum to add\n     * @param bool $inBinaryForm TRUE if checksum is in binary form\n     *\n     * @return self\n     * @throws \\LogicException if the root tree hash is already calculated\n     */\n    public function addChecksum($checksum, $inBinaryForm = false)\n    {\n        // Error if hash is already calculated\n        if ($this->hash) {\n            throw new \\LogicException('You may not add more checksums to a '\n                . 'complete tree hash.');\n        }\n\n        // Convert the checksum to binary form if necessary\n        $this->checksums[] = $inBinaryForm ? $checksum : hex2bin($checksum);\n\n        return $this;\n    }\n\n    public function complete()\n    {\n        if (!$this->hash) {\n            // Clear out the remaining buffer.\n            if (strlen($this->buffer) > 0) {\n                $this->checksums[] = hash($this->algorithm, $this->buffer, true);\n                $this->buffer = '';\n            }\n\n            // If no hashes, add the EMPTY_HASH.\n            if (!$this->checksums) {\n                $this->checksums[] = hex2bin(self::EMPTY_HASH);\n            }\n\n            // Perform hashes up the tree to arrive at the root checksum.\n            $hashes = $this->checksums;\n            while (count($hashes) > 1) {\n                $sets = array_chunk($hashes, 2);\n                $hashes = array();\n                foreach ($sets as $set) {\n                    $hashes[] = (count($set) === 1)\n                        ? $set[0]\n                        : hash($this->algorithm, $set[0] . $set[1], true);\n                }\n            }\n\n            $this->hash = $hashes[0];\n        }\n\n        return $this->hash;\n    }\n\n    public function reset()\n    {\n        $this->hash = null;\n        $this->checksums = [];\n        $this->buffer = '';\n    }\n}\n", "num_lines": 119}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Glacier\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon Glacier service.\n */\nclass GlacierException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\GlobalAccelerator;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Global Accelerator** service.\n * @method \\Aws\\Result addCustomRoutingEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addCustomRoutingEndpointsAsync(array $args = [])\n * @method \\Aws\\Result addEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addEndpointsAsync(array $args = [])\n * @method \\Aws\\Result advertiseByoipCidr(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise advertiseByoipCidrAsync(array $args = [])\n * @method \\Aws\\Result allowCustomRoutingTraffic(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise allowCustomRoutingTrafficAsync(array $args = [])\n * @method \\Aws\\Result createAccelerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAcceleratorAsync(array $args = [])\n * @method \\Aws\\Result createCustomRoutingAccelerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCustomRoutingAcceleratorAsync(array $args = [])\n * @method \\Aws\\Result createCustomRoutingEndpointGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCustomRoutingEndpointGroupAsync(array $args = [])\n * @method \\Aws\\Result createCustomRoutingListener(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCustomRoutingListenerAsync(array $args = [])\n * @method \\Aws\\Result createEndpointGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEndpointGroupAsync(array $args = [])\n * @method \\Aws\\Result createListener(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createListenerAsync(array $args = [])\n * @method \\Aws\\Result deleteAccelerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAcceleratorAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomRoutingAccelerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomRoutingAcceleratorAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomRoutingEndpointGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomRoutingEndpointGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomRoutingListener(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomRoutingListenerAsync(array $args = [])\n * @method \\Aws\\Result deleteEndpointGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEndpointGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteListener(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteListenerAsync(array $args = [])\n * @method \\Aws\\Result denyCustomRoutingTraffic(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise denyCustomRoutingTrafficAsync(array $args = [])\n * @method \\Aws\\Result deprovisionByoipCidr(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deprovisionByoipCidrAsync(array $args = [])\n * @method \\Aws\\Result describeAccelerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAcceleratorAsync(array $args = [])\n * @method \\Aws\\Result describeAcceleratorAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAcceleratorAttributesAsync(array $args = [])\n * @method \\Aws\\Result describeCustomRoutingAccelerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCustomRoutingAcceleratorAsync(array $args = [])\n * @method \\Aws\\Result describeCustomRoutingAcceleratorAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCustomRoutingAcceleratorAttributesAsync(array $args = [])\n * @method \\Aws\\Result describeCustomRoutingEndpointGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCustomRoutingEndpointGroupAsync(array $args = [])\n * @method \\Aws\\Result describeCustomRoutingListener(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCustomRoutingListenerAsync(array $args = [])\n * @method \\Aws\\Result describeEndpointGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEndpointGroupAsync(array $args = [])\n * @method \\Aws\\Result describeListener(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeListenerAsync(array $args = [])\n * @method \\Aws\\Result listAccelerators(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAcceleratorsAsync(array $args = [])\n * @method \\Aws\\Result listByoipCidrs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listByoipCidrsAsync(array $args = [])\n * @method \\Aws\\Result listCustomRoutingAccelerators(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCustomRoutingAcceleratorsAsync(array $args = [])\n * @method \\Aws\\Result listCustomRoutingEndpointGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCustomRoutingEndpointGroupsAsync(array $args = [])\n * @method \\Aws\\Result listCustomRoutingListeners(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCustomRoutingListenersAsync(array $args = [])\n * @method \\Aws\\Result listCustomRoutingPortMappings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCustomRoutingPortMappingsAsync(array $args = [])\n * @method \\Aws\\Result listCustomRoutingPortMappingsByDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCustomRoutingPortMappingsByDestinationAsync(array $args = [])\n * @method \\Aws\\Result listEndpointGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEndpointGroupsAsync(array $args = [])\n * @method \\Aws\\Result listListeners(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listListenersAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result provisionByoipCidr(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise provisionByoipCidrAsync(array $args = [])\n * @method \\Aws\\Result removeCustomRoutingEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeCustomRoutingEndpointsAsync(array $args = [])\n * @method \\Aws\\Result removeEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeEndpointsAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAccelerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAcceleratorAsync(array $args = [])\n * @method \\Aws\\Result updateAcceleratorAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAcceleratorAttributesAsync(array $args = [])\n * @method \\Aws\\Result updateCustomRoutingAccelerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCustomRoutingAcceleratorAsync(array $args = [])\n * @method \\Aws\\Result updateCustomRoutingAcceleratorAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCustomRoutingAcceleratorAttributesAsync(array $args = [])\n * @method \\Aws\\Result updateCustomRoutingListener(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCustomRoutingListenerAsync(array $args = [])\n * @method \\Aws\\Result updateEndpointGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEndpointGroupAsync(array $args = [])\n * @method \\Aws\\Result updateListener(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateListenerAsync(array $args = [])\n * @method \\Aws\\Result withdrawByoipCidr(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise withdrawByoipCidrAsync(array $args = [])\n */\nclass GlobalAcceleratorClient extends AwsClient {}\n", "num_lines": 108}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\GlobalAccelerator\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Global Accelerator** service.\n */\nclass GlobalAcceleratorException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Glue;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Glue** service.\n * @method \\Aws\\Result batchCreatePartition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchCreatePartitionAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteConnectionAsync(array $args = [])\n * @method \\Aws\\Result batchDeletePartition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeletePartitionAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteTableAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteTableVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteTableVersionAsync(array $args = [])\n * @method \\Aws\\Result batchGetBlueprints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetBlueprintsAsync(array $args = [])\n * @method \\Aws\\Result batchGetCrawlers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetCrawlersAsync(array $args = [])\n * @method \\Aws\\Result batchGetCustomEntityTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetCustomEntityTypesAsync(array $args = [])\n * @method \\Aws\\Result batchGetDataQualityResult(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetDataQualityResultAsync(array $args = [])\n * @method \\Aws\\Result batchGetDevEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetDevEndpointsAsync(array $args = [])\n * @method \\Aws\\Result batchGetJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetJobsAsync(array $args = [])\n * @method \\Aws\\Result batchGetPartition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetPartitionAsync(array $args = [])\n * @method \\Aws\\Result batchGetTriggers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetTriggersAsync(array $args = [])\n * @method \\Aws\\Result batchGetWorkflows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetWorkflowsAsync(array $args = [])\n * @method \\Aws\\Result batchStopJobRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchStopJobRunAsync(array $args = [])\n * @method \\Aws\\Result batchUpdatePartition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdatePartitionAsync(array $args = [])\n * @method \\Aws\\Result cancelDataQualityRuleRecommendationRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelDataQualityRuleRecommendationRunAsync(array $args = [])\n * @method \\Aws\\Result cancelDataQualityRulesetEvaluationRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelDataQualityRulesetEvaluationRunAsync(array $args = [])\n * @method \\Aws\\Result cancelMLTaskRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelMLTaskRunAsync(array $args = [])\n * @method \\Aws\\Result cancelStatement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelStatementAsync(array $args = [])\n * @method \\Aws\\Result checkSchemaVersionValidity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise checkSchemaVersionValidityAsync(array $args = [])\n * @method \\Aws\\Result createBlueprint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBlueprintAsync(array $args = [])\n * @method \\Aws\\Result createClassifier(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClassifierAsync(array $args = [])\n * @method \\Aws\\Result createConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConnectionAsync(array $args = [])\n * @method \\Aws\\Result createCrawler(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCrawlerAsync(array $args = [])\n * @method \\Aws\\Result createCustomEntityType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCustomEntityTypeAsync(array $args = [])\n * @method \\Aws\\Result createDataQualityRuleset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataQualityRulesetAsync(array $args = [])\n * @method \\Aws\\Result createDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatabaseAsync(array $args = [])\n * @method \\Aws\\Result createDevEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDevEndpointAsync(array $args = [])\n * @method \\Aws\\Result createJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createJobAsync(array $args = [])\n * @method \\Aws\\Result createMLTransform(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMLTransformAsync(array $args = [])\n * @method \\Aws\\Result createPartition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPartitionAsync(array $args = [])\n * @method \\Aws\\Result createPartitionIndex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPartitionIndexAsync(array $args = [])\n * @method \\Aws\\Result createRegistry(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRegistryAsync(array $args = [])\n * @method \\Aws\\Result createSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSchemaAsync(array $args = [])\n * @method \\Aws\\Result createScript(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createScriptAsync(array $args = [])\n * @method \\Aws\\Result createSecurityConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSecurityConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSessionAsync(array $args = [])\n * @method \\Aws\\Result createTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTableAsync(array $args = [])\n * @method \\Aws\\Result createTrigger(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTriggerAsync(array $args = [])\n * @method \\Aws\\Result createUserDefinedFunction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserDefinedFunctionAsync(array $args = [])\n * @method \\Aws\\Result createWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkflowAsync(array $args = [])\n * @method \\Aws\\Result deleteBlueprint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBlueprintAsync(array $args = [])\n * @method \\Aws\\Result deleteClassifier(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClassifierAsync(array $args = [])\n * @method \\Aws\\Result deleteColumnStatisticsForPartition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteColumnStatisticsForPartitionAsync(array $args = [])\n * @method \\Aws\\Result deleteColumnStatisticsForTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteColumnStatisticsForTableAsync(array $args = [])\n * @method \\Aws\\Result deleteConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteCrawler(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCrawlerAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomEntityType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomEntityTypeAsync(array $args = [])\n * @method \\Aws\\Result deleteDataQualityRuleset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataQualityRulesetAsync(array $args = [])\n * @method \\Aws\\Result deleteDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDatabaseAsync(array $args = [])\n * @method \\Aws\\Result deleteDevEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDevEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteJobAsync(array $args = [])\n * @method \\Aws\\Result deleteMLTransform(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMLTransformAsync(array $args = [])\n * @method \\Aws\\Result deletePartition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePartitionAsync(array $args = [])\n * @method \\Aws\\Result deletePartitionIndex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePartitionIndexAsync(array $args = [])\n * @method \\Aws\\Result deleteRegistry(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRegistryAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSchemaAsync(array $args = [])\n * @method \\Aws\\Result deleteSchemaVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSchemaVersionsAsync(array $args = [])\n * @method \\Aws\\Result deleteSecurityConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSecurityConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSessionAsync(array $args = [])\n * @method \\Aws\\Result deleteTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTableAsync(array $args = [])\n * @method \\Aws\\Result deleteTableVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTableVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteTrigger(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTriggerAsync(array $args = [])\n * @method \\Aws\\Result deleteUserDefinedFunction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserDefinedFunctionAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkflowAsync(array $args = [])\n * @method \\Aws\\Result getBlueprint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBlueprintAsync(array $args = [])\n * @method \\Aws\\Result getBlueprintRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBlueprintRunAsync(array $args = [])\n * @method \\Aws\\Result getBlueprintRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBlueprintRunsAsync(array $args = [])\n * @method \\Aws\\Result getCatalogImportStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCatalogImportStatusAsync(array $args = [])\n * @method \\Aws\\Result getClassifier(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getClassifierAsync(array $args = [])\n * @method \\Aws\\Result getClassifiers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getClassifiersAsync(array $args = [])\n * @method \\Aws\\Result getColumnStatisticsForPartition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getColumnStatisticsForPartitionAsync(array $args = [])\n * @method \\Aws\\Result getColumnStatisticsForTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getColumnStatisticsForTableAsync(array $args = [])\n * @method \\Aws\\Result getConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConnectionAsync(array $args = [])\n * @method \\Aws\\Result getConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConnectionsAsync(array $args = [])\n * @method \\Aws\\Result getCrawler(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCrawlerAsync(array $args = [])\n * @method \\Aws\\Result getCrawlerMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCrawlerMetricsAsync(array $args = [])\n * @method \\Aws\\Result getCrawlers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCrawlersAsync(array $args = [])\n * @method \\Aws\\Result getCustomEntityType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCustomEntityTypeAsync(array $args = [])\n * @method \\Aws\\Result getDataCatalogEncryptionSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataCatalogEncryptionSettingsAsync(array $args = [])\n * @method \\Aws\\Result getDataQualityResult(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataQualityResultAsync(array $args = [])\n * @method \\Aws\\Result getDataQualityRuleRecommendationRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataQualityRuleRecommendationRunAsync(array $args = [])\n * @method \\Aws\\Result getDataQualityRuleset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataQualityRulesetAsync(array $args = [])\n * @method \\Aws\\Result getDataQualityRulesetEvaluationRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataQualityRulesetEvaluationRunAsync(array $args = [])\n * @method \\Aws\\Result getDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDatabaseAsync(array $args = [])\n * @method \\Aws\\Result getDatabases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDatabasesAsync(array $args = [])\n * @method \\Aws\\Result getDataflowGraph(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataflowGraphAsync(array $args = [])\n * @method \\Aws\\Result getDevEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDevEndpointAsync(array $args = [])\n * @method \\Aws\\Result getDevEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDevEndpointsAsync(array $args = [])\n * @method \\Aws\\Result getJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobAsync(array $args = [])\n * @method \\Aws\\Result getJobBookmark(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobBookmarkAsync(array $args = [])\n * @method \\Aws\\Result getJobRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobRunAsync(array $args = [])\n * @method \\Aws\\Result getJobRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobRunsAsync(array $args = [])\n * @method \\Aws\\Result getJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobsAsync(array $args = [])\n * @method \\Aws\\Result getMLTaskRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMLTaskRunAsync(array $args = [])\n * @method \\Aws\\Result getMLTaskRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMLTaskRunsAsync(array $args = [])\n * @method \\Aws\\Result getMLTransform(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMLTransformAsync(array $args = [])\n * @method \\Aws\\Result getMLTransforms(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMLTransformsAsync(array $args = [])\n * @method \\Aws\\Result getMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMappingAsync(array $args = [])\n * @method \\Aws\\Result getPartition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPartitionAsync(array $args = [])\n * @method \\Aws\\Result getPartitionIndexes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPartitionIndexesAsync(array $args = [])\n * @method \\Aws\\Result getPartitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPartitionsAsync(array $args = [])\n * @method \\Aws\\Result getPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPlanAsync(array $args = [])\n * @method \\Aws\\Result getRegistry(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRegistryAsync(array $args = [])\n * @method \\Aws\\Result getResourcePolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcePoliciesAsync(array $args = [])\n * @method \\Aws\\Result getResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result getSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSchemaAsync(array $args = [])\n * @method \\Aws\\Result getSchemaByDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSchemaByDefinitionAsync(array $args = [])\n * @method \\Aws\\Result getSchemaVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSchemaVersionAsync(array $args = [])\n * @method \\Aws\\Result getSchemaVersionsDiff(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSchemaVersionsDiffAsync(array $args = [])\n * @method \\Aws\\Result getSecurityConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSecurityConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getSecurityConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSecurityConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result getSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSessionAsync(array $args = [])\n * @method \\Aws\\Result getStatement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStatementAsync(array $args = [])\n * @method \\Aws\\Result getTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTableAsync(array $args = [])\n * @method \\Aws\\Result getTableVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTableVersionAsync(array $args = [])\n * @method \\Aws\\Result getTableVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTableVersionsAsync(array $args = [])\n * @method \\Aws\\Result getTables(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTablesAsync(array $args = [])\n * @method \\Aws\\Result getTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTagsAsync(array $args = [])\n * @method \\Aws\\Result getTrigger(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTriggerAsync(array $args = [])\n * @method \\Aws\\Result getTriggers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTriggersAsync(array $args = [])\n * @method \\Aws\\Result getUnfilteredPartitionMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUnfilteredPartitionMetadataAsync(array $args = [])\n * @method \\Aws\\Result getUnfilteredPartitionsMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUnfilteredPartitionsMetadataAsync(array $args = [])\n * @method \\Aws\\Result getUnfilteredTableMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUnfilteredTableMetadataAsync(array $args = [])\n * @method \\Aws\\Result getUserDefinedFunction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUserDefinedFunctionAsync(array $args = [])\n * @method \\Aws\\Result getUserDefinedFunctions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUserDefinedFunctionsAsync(array $args = [])\n * @method \\Aws\\Result getWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkflowAsync(array $args = [])\n * @method \\Aws\\Result getWorkflowRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkflowRunAsync(array $args = [])\n * @method \\Aws\\Result getWorkflowRunProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkflowRunPropertiesAsync(array $args = [])\n * @method \\Aws\\Result getWorkflowRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkflowRunsAsync(array $args = [])\n * @method \\Aws\\Result importCatalogToGlue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importCatalogToGlueAsync(array $args = [])\n * @method \\Aws\\Result listBlueprints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBlueprintsAsync(array $args = [])\n * @method \\Aws\\Result listCrawlers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCrawlersAsync(array $args = [])\n * @method \\Aws\\Result listCrawls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCrawlsAsync(array $args = [])\n * @method \\Aws\\Result listCustomEntityTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCustomEntityTypesAsync(array $args = [])\n * @method \\Aws\\Result listDataQualityResults(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataQualityResultsAsync(array $args = [])\n * @method \\Aws\\Result listDataQualityRuleRecommendationRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataQualityRuleRecommendationRunsAsync(array $args = [])\n * @method \\Aws\\Result listDataQualityRulesetEvaluationRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataQualityRulesetEvaluationRunsAsync(array $args = [])\n * @method \\Aws\\Result listDataQualityRulesets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataQualityRulesetsAsync(array $args = [])\n * @method \\Aws\\Result listDevEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDevEndpointsAsync(array $args = [])\n * @method \\Aws\\Result listJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobsAsync(array $args = [])\n * @method \\Aws\\Result listMLTransforms(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMLTransformsAsync(array $args = [])\n * @method \\Aws\\Result listRegistries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRegistriesAsync(array $args = [])\n * @method \\Aws\\Result listSchemaVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSchemaVersionsAsync(array $args = [])\n * @method \\Aws\\Result listSchemas(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSchemasAsync(array $args = [])\n * @method \\Aws\\Result listSessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSessionsAsync(array $args = [])\n * @method \\Aws\\Result listStatements(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStatementsAsync(array $args = [])\n * @method \\Aws\\Result listTriggers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTriggersAsync(array $args = [])\n * @method \\Aws\\Result listWorkflows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkflowsAsync(array $args = [])\n * @method \\Aws\\Result putDataCatalogEncryptionSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDataCatalogEncryptionSettingsAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result putSchemaVersionMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSchemaVersionMetadataAsync(array $args = [])\n * @method \\Aws\\Result putWorkflowRunProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putWorkflowRunPropertiesAsync(array $args = [])\n * @method \\Aws\\Result querySchemaVersionMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise querySchemaVersionMetadataAsync(array $args = [])\n * @method \\Aws\\Result registerSchemaVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerSchemaVersionAsync(array $args = [])\n * @method \\Aws\\Result removeSchemaVersionMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeSchemaVersionMetadataAsync(array $args = [])\n * @method \\Aws\\Result resetJobBookmark(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetJobBookmarkAsync(array $args = [])\n * @method \\Aws\\Result resumeWorkflowRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resumeWorkflowRunAsync(array $args = [])\n * @method \\Aws\\Result runStatement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise runStatementAsync(array $args = [])\n * @method \\Aws\\Result searchTables(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchTablesAsync(array $args = [])\n * @method \\Aws\\Result startBlueprintRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startBlueprintRunAsync(array $args = [])\n * @method \\Aws\\Result startCrawler(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startCrawlerAsync(array $args = [])\n * @method \\Aws\\Result startCrawlerSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startCrawlerScheduleAsync(array $args = [])\n * @method \\Aws\\Result startDataQualityRuleRecommendationRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDataQualityRuleRecommendationRunAsync(array $args = [])\n * @method \\Aws\\Result startDataQualityRulesetEvaluationRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDataQualityRulesetEvaluationRunAsync(array $args = [])\n * @method \\Aws\\Result startExportLabelsTaskRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startExportLabelsTaskRunAsync(array $args = [])\n * @method \\Aws\\Result startImportLabelsTaskRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startImportLabelsTaskRunAsync(array $args = [])\n * @method \\Aws\\Result startJobRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startJobRunAsync(array $args = [])\n * @method \\Aws\\Result startMLEvaluationTaskRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMLEvaluationTaskRunAsync(array $args = [])\n * @method \\Aws\\Result startMLLabelingSetGenerationTaskRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMLLabelingSetGenerationTaskRunAsync(array $args = [])\n * @method \\Aws\\Result startTrigger(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startTriggerAsync(array $args = [])\n * @method \\Aws\\Result startWorkflowRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startWorkflowRunAsync(array $args = [])\n * @method \\Aws\\Result stopCrawler(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopCrawlerAsync(array $args = [])\n * @method \\Aws\\Result stopCrawlerSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopCrawlerScheduleAsync(array $args = [])\n * @method \\Aws\\Result stopSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopSessionAsync(array $args = [])\n * @method \\Aws\\Result stopTrigger(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopTriggerAsync(array $args = [])\n * @method \\Aws\\Result stopWorkflowRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopWorkflowRunAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateBlueprint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBlueprintAsync(array $args = [])\n * @method \\Aws\\Result updateClassifier(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateClassifierAsync(array $args = [])\n * @method \\Aws\\Result updateColumnStatisticsForPartition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateColumnStatisticsForPartitionAsync(array $args = [])\n * @method \\Aws\\Result updateColumnStatisticsForTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateColumnStatisticsForTableAsync(array $args = [])\n * @method \\Aws\\Result updateConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConnectionAsync(array $args = [])\n * @method \\Aws\\Result updateCrawler(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCrawlerAsync(array $args = [])\n * @method \\Aws\\Result updateCrawlerSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCrawlerScheduleAsync(array $args = [])\n * @method \\Aws\\Result updateDataQualityRuleset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDataQualityRulesetAsync(array $args = [])\n * @method \\Aws\\Result updateDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDatabaseAsync(array $args = [])\n * @method \\Aws\\Result updateDevEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDevEndpointAsync(array $args = [])\n * @method \\Aws\\Result updateJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateJobAsync(array $args = [])\n * @method \\Aws\\Result updateJobFromSourceControl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateJobFromSourceControlAsync(array $args = [])\n * @method \\Aws\\Result updateMLTransform(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMLTransformAsync(array $args = [])\n * @method \\Aws\\Result updatePartition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePartitionAsync(array $args = [])\n * @method \\Aws\\Result updateRegistry(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRegistryAsync(array $args = [])\n * @method \\Aws\\Result updateSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSchemaAsync(array $args = [])\n * @method \\Aws\\Result updateSourceControlFromJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSourceControlFromJobAsync(array $args = [])\n * @method \\Aws\\Result updateTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTableAsync(array $args = [])\n * @method \\Aws\\Result updateTrigger(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTriggerAsync(array $args = [])\n * @method \\Aws\\Result updateUserDefinedFunction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserDefinedFunctionAsync(array $args = [])\n * @method \\Aws\\Result updateWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkflowAsync(array $args = [])\n */\nclass GlueClient extends AwsClient {}\n", "num_lines": 414}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Glue\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Glue** service.\n */\nclass GlueException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\GlueDataBrew;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Glue DataBrew** service.\n * @method \\Aws\\Result batchDeleteRecipeVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteRecipeVersionAsync(array $args = [])\n * @method \\Aws\\Result createDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatasetAsync(array $args = [])\n * @method \\Aws\\Result createProfileJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProfileJobAsync(array $args = [])\n * @method \\Aws\\Result createProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProjectAsync(array $args = [])\n * @method \\Aws\\Result createRecipe(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRecipeAsync(array $args = [])\n * @method \\Aws\\Result createRecipeJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRecipeJobAsync(array $args = [])\n * @method \\Aws\\Result createRuleset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRulesetAsync(array $args = [])\n * @method \\Aws\\Result createSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createScheduleAsync(array $args = [])\n * @method \\Aws\\Result deleteDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDatasetAsync(array $args = [])\n * @method \\Aws\\Result deleteJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteJobAsync(array $args = [])\n * @method \\Aws\\Result deleteProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProjectAsync(array $args = [])\n * @method \\Aws\\Result deleteRecipeVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRecipeVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteRuleset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRulesetAsync(array $args = [])\n * @method \\Aws\\Result deleteSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteScheduleAsync(array $args = [])\n * @method \\Aws\\Result describeDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDatasetAsync(array $args = [])\n * @method \\Aws\\Result describeJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJobAsync(array $args = [])\n * @method \\Aws\\Result describeJobRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJobRunAsync(array $args = [])\n * @method \\Aws\\Result describeProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProjectAsync(array $args = [])\n * @method \\Aws\\Result describeRecipe(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRecipeAsync(array $args = [])\n * @method \\Aws\\Result describeRuleset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRulesetAsync(array $args = [])\n * @method \\Aws\\Result describeSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScheduleAsync(array $args = [])\n * @method \\Aws\\Result listDatasets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetsAsync(array $args = [])\n * @method \\Aws\\Result listJobRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobRunsAsync(array $args = [])\n * @method \\Aws\\Result listJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobsAsync(array $args = [])\n * @method \\Aws\\Result listProjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProjectsAsync(array $args = [])\n * @method \\Aws\\Result listRecipeVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecipeVersionsAsync(array $args = [])\n * @method \\Aws\\Result listRecipes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecipesAsync(array $args = [])\n * @method \\Aws\\Result listRulesets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRulesetsAsync(array $args = [])\n * @method \\Aws\\Result listSchedules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSchedulesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result publishRecipe(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise publishRecipeAsync(array $args = [])\n * @method \\Aws\\Result sendProjectSessionAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendProjectSessionActionAsync(array $args = [])\n * @method \\Aws\\Result startJobRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startJobRunAsync(array $args = [])\n * @method \\Aws\\Result startProjectSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startProjectSessionAsync(array $args = [])\n * @method \\Aws\\Result stopJobRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopJobRunAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDatasetAsync(array $args = [])\n * @method \\Aws\\Result updateProfileJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProfileJobAsync(array $args = [])\n * @method \\Aws\\Result updateProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProjectAsync(array $args = [])\n * @method \\Aws\\Result updateRecipe(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRecipeAsync(array $args = [])\n * @method \\Aws\\Result updateRecipeJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRecipeJobAsync(array $args = [])\n * @method \\Aws\\Result updateRuleset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRulesetAsync(array $args = [])\n * @method \\Aws\\Result updateSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateScheduleAsync(array $args = [])\n */\nclass GlueDataBrewClient extends AwsClient {}\n", "num_lines": 98}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\GlueDataBrew\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Glue DataBrew** service.\n */\nclass GlueDataBrewException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Greengrass;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Greengrass** service.\n * @method \\Aws\\Result associateRoleToGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateRoleToGroupAsync(array $args = [])\n * @method \\Aws\\Result associateServiceRoleToAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateServiceRoleToAccountAsync(array $args = [])\n * @method \\Aws\\Result createConnectorDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConnectorDefinitionAsync(array $args = [])\n * @method \\Aws\\Result createConnectorDefinitionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConnectorDefinitionVersionAsync(array $args = [])\n * @method \\Aws\\Result createCoreDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCoreDefinitionAsync(array $args = [])\n * @method \\Aws\\Result createCoreDefinitionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCoreDefinitionVersionAsync(array $args = [])\n * @method \\Aws\\Result createDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeploymentAsync(array $args = [])\n * @method \\Aws\\Result createDeviceDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeviceDefinitionAsync(array $args = [])\n * @method \\Aws\\Result createDeviceDefinitionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeviceDefinitionVersionAsync(array $args = [])\n * @method \\Aws\\Result createFunctionDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFunctionDefinitionAsync(array $args = [])\n * @method \\Aws\\Result createFunctionDefinitionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFunctionDefinitionVersionAsync(array $args = [])\n * @method \\Aws\\Result createGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGroupAsync(array $args = [])\n * @method \\Aws\\Result createGroupCertificateAuthority(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGroupCertificateAuthorityAsync(array $args = [])\n * @method \\Aws\\Result createGroupVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGroupVersionAsync(array $args = [])\n * @method \\Aws\\Result createLoggerDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLoggerDefinitionAsync(array $args = [])\n * @method \\Aws\\Result createLoggerDefinitionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLoggerDefinitionVersionAsync(array $args = [])\n * @method \\Aws\\Result createResourceDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResourceDefinitionAsync(array $args = [])\n * @method \\Aws\\Result createResourceDefinitionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResourceDefinitionVersionAsync(array $args = [])\n * @method \\Aws\\Result createSoftwareUpdateJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSoftwareUpdateJobAsync(array $args = [])\n * @method \\Aws\\Result createSubscriptionDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSubscriptionDefinitionAsync(array $args = [])\n * @method \\Aws\\Result createSubscriptionDefinitionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSubscriptionDefinitionVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteConnectorDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectorDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteCoreDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCoreDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteDeviceDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDeviceDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteFunctionDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFunctionDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteLoggerDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLoggerDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteResourceDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourceDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteSubscriptionDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSubscriptionDefinitionAsync(array $args = [])\n * @method \\Aws\\Result disassociateRoleFromGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateRoleFromGroupAsync(array $args = [])\n * @method \\Aws\\Result disassociateServiceRoleFromAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateServiceRoleFromAccountAsync(array $args = [])\n * @method \\Aws\\Result getAssociatedRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAssociatedRoleAsync(array $args = [])\n * @method \\Aws\\Result getBulkDeploymentStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBulkDeploymentStatusAsync(array $args = [])\n * @method \\Aws\\Result getConnectivityInfo(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConnectivityInfoAsync(array $args = [])\n * @method \\Aws\\Result getConnectorDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConnectorDefinitionAsync(array $args = [])\n * @method \\Aws\\Result getConnectorDefinitionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConnectorDefinitionVersionAsync(array $args = [])\n * @method \\Aws\\Result getCoreDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCoreDefinitionAsync(array $args = [])\n * @method \\Aws\\Result getCoreDefinitionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCoreDefinitionVersionAsync(array $args = [])\n * @method \\Aws\\Result getDeploymentStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeploymentStatusAsync(array $args = [])\n * @method \\Aws\\Result getDeviceDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeviceDefinitionAsync(array $args = [])\n * @method \\Aws\\Result getDeviceDefinitionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeviceDefinitionVersionAsync(array $args = [])\n * @method \\Aws\\Result getFunctionDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFunctionDefinitionAsync(array $args = [])\n * @method \\Aws\\Result getFunctionDefinitionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFunctionDefinitionVersionAsync(array $args = [])\n * @method \\Aws\\Result getGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGroupAsync(array $args = [])\n * @method \\Aws\\Result getGroupCertificateAuthority(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGroupCertificateAuthorityAsync(array $args = [])\n * @method \\Aws\\Result getGroupCertificateConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGroupCertificateConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getGroupVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGroupVersionAsync(array $args = [])\n * @method \\Aws\\Result getLoggerDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLoggerDefinitionAsync(array $args = [])\n * @method \\Aws\\Result getLoggerDefinitionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLoggerDefinitionVersionAsync(array $args = [])\n * @method \\Aws\\Result getResourceDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceDefinitionAsync(array $args = [])\n * @method \\Aws\\Result getResourceDefinitionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceDefinitionVersionAsync(array $args = [])\n * @method \\Aws\\Result getServiceRoleForAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceRoleForAccountAsync(array $args = [])\n * @method \\Aws\\Result getSubscriptionDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSubscriptionDefinitionAsync(array $args = [])\n * @method \\Aws\\Result getSubscriptionDefinitionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSubscriptionDefinitionVersionAsync(array $args = [])\n * @method \\Aws\\Result getThingRuntimeConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getThingRuntimeConfigurationAsync(array $args = [])\n * @method \\Aws\\Result listBulkDeploymentDetailedReports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBulkDeploymentDetailedReportsAsync(array $args = [])\n * @method \\Aws\\Result listBulkDeployments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBulkDeploymentsAsync(array $args = [])\n * @method \\Aws\\Result listConnectorDefinitionVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConnectorDefinitionVersionsAsync(array $args = [])\n * @method \\Aws\\Result listConnectorDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConnectorDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listCoreDefinitionVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCoreDefinitionVersionsAsync(array $args = [])\n * @method \\Aws\\Result listCoreDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCoreDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listDeployments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeploymentsAsync(array $args = [])\n * @method \\Aws\\Result listDeviceDefinitionVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeviceDefinitionVersionsAsync(array $args = [])\n * @method \\Aws\\Result listDeviceDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeviceDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listFunctionDefinitionVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFunctionDefinitionVersionsAsync(array $args = [])\n * @method \\Aws\\Result listFunctionDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFunctionDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listGroupCertificateAuthorities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupCertificateAuthoritiesAsync(array $args = [])\n * @method \\Aws\\Result listGroupVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupVersionsAsync(array $args = [])\n * @method \\Aws\\Result listGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupsAsync(array $args = [])\n * @method \\Aws\\Result listLoggerDefinitionVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLoggerDefinitionVersionsAsync(array $args = [])\n * @method \\Aws\\Result listLoggerDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLoggerDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listResourceDefinitionVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceDefinitionVersionsAsync(array $args = [])\n * @method \\Aws\\Result listResourceDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listSubscriptionDefinitionVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSubscriptionDefinitionVersionsAsync(array $args = [])\n * @method \\Aws\\Result listSubscriptionDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSubscriptionDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result resetDeployments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetDeploymentsAsync(array $args = [])\n * @method \\Aws\\Result startBulkDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startBulkDeploymentAsync(array $args = [])\n * @method \\Aws\\Result stopBulkDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopBulkDeploymentAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateConnectivityInfo(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConnectivityInfoAsync(array $args = [])\n * @method \\Aws\\Result updateConnectorDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConnectorDefinitionAsync(array $args = [])\n * @method \\Aws\\Result updateCoreDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCoreDefinitionAsync(array $args = [])\n * @method \\Aws\\Result updateDeviceDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDeviceDefinitionAsync(array $args = [])\n * @method \\Aws\\Result updateFunctionDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFunctionDefinitionAsync(array $args = [])\n * @method \\Aws\\Result updateGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGroupAsync(array $args = [])\n * @method \\Aws\\Result updateGroupCertificateConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGroupCertificateConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateLoggerDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLoggerDefinitionAsync(array $args = [])\n * @method \\Aws\\Result updateResourceDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResourceDefinitionAsync(array $args = [])\n * @method \\Aws\\Result updateSubscriptionDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSubscriptionDefinitionAsync(array $args = [])\n * @method \\Aws\\Result updateThingRuntimeConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateThingRuntimeConfigurationAsync(array $args = [])\n */\nclass GreengrassClient extends AwsClient {}\n", "num_lines": 194}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Greengrass\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Greengrass** service.\n */\nclass GreengrassException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\GreengrassV2;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT Greengrass V2** service.\n * @method \\Aws\\Result associateServiceRoleToAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateServiceRoleToAccountAsync(array $args = [])\n * @method \\Aws\\Result batchAssociateClientDeviceWithCoreDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchAssociateClientDeviceWithCoreDeviceAsync(array $args = [])\n * @method \\Aws\\Result batchDisassociateClientDeviceFromCoreDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDisassociateClientDeviceFromCoreDeviceAsync(array $args = [])\n * @method \\Aws\\Result cancelDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelDeploymentAsync(array $args = [])\n * @method \\Aws\\Result createComponentVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createComponentVersionAsync(array $args = [])\n * @method \\Aws\\Result createDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeploymentAsync(array $args = [])\n * @method \\Aws\\Result deleteComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteComponentAsync(array $args = [])\n * @method \\Aws\\Result deleteCoreDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCoreDeviceAsync(array $args = [])\n * @method \\Aws\\Result deleteDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDeploymentAsync(array $args = [])\n * @method \\Aws\\Result describeComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeComponentAsync(array $args = [])\n * @method \\Aws\\Result disassociateServiceRoleFromAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateServiceRoleFromAccountAsync(array $args = [])\n * @method \\Aws\\Result getComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getComponentAsync(array $args = [])\n * @method \\Aws\\Result getComponentVersionArtifact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getComponentVersionArtifactAsync(array $args = [])\n * @method \\Aws\\Result getConnectivityInfo(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConnectivityInfoAsync(array $args = [])\n * @method \\Aws\\Result getCoreDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCoreDeviceAsync(array $args = [])\n * @method \\Aws\\Result getDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeploymentAsync(array $args = [])\n * @method \\Aws\\Result getServiceRoleForAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceRoleForAccountAsync(array $args = [])\n * @method \\Aws\\Result listClientDevicesAssociatedWithCoreDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listClientDevicesAssociatedWithCoreDeviceAsync(array $args = [])\n * @method \\Aws\\Result listComponentVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listComponentVersionsAsync(array $args = [])\n * @method \\Aws\\Result listComponents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listComponentsAsync(array $args = [])\n * @method \\Aws\\Result listCoreDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCoreDevicesAsync(array $args = [])\n * @method \\Aws\\Result listDeployments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeploymentsAsync(array $args = [])\n * @method \\Aws\\Result listEffectiveDeployments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEffectiveDeploymentsAsync(array $args = [])\n * @method \\Aws\\Result listInstalledComponents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInstalledComponentsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result resolveComponentCandidates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resolveComponentCandidatesAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateConnectivityInfo(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConnectivityInfoAsync(array $args = [])\n */\nclass GreengrassV2Client extends AwsClient {}\n", "num_lines": 68}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\GreengrassV2\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT Greengrass V2** service.\n */\nclass GreengrassV2Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\GroundStation;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Ground Station** service.\n * @method \\Aws\\Result cancelContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelContactAsync(array $args = [])\n * @method \\Aws\\Result createConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfigAsync(array $args = [])\n * @method \\Aws\\Result createDataflowEndpointGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataflowEndpointGroupAsync(array $args = [])\n * @method \\Aws\\Result createEphemeris(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEphemerisAsync(array $args = [])\n * @method \\Aws\\Result createMissionProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMissionProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteDataflowEndpointGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataflowEndpointGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteEphemeris(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEphemerisAsync(array $args = [])\n * @method \\Aws\\Result deleteMissionProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMissionProfileAsync(array $args = [])\n * @method \\Aws\\Result describeContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeContactAsync(array $args = [])\n * @method \\Aws\\Result describeEphemeris(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEphemerisAsync(array $args = [])\n * @method \\Aws\\Result getAgentConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAgentConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getMissionProfileConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMissionProfileConfigAsync(array $args = [])\n * @method \\Aws\\Result getDataflowEndpointGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataflowEndpointGroupAsync(array $args = [])\n * @method \\Aws\\Result getMinuteUsage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMinuteUsageAsync(array $args = [])\n * @method \\Aws\\Result getMissionProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMissionProfileAsync(array $args = [])\n * @method \\Aws\\Result getSatellite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSatelliteAsync(array $args = [])\n * @method \\Aws\\Result listConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConfigsAsync(array $args = [])\n * @method \\Aws\\Result listContacts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listContactsAsync(array $args = [])\n * @method \\Aws\\Result listDataflowEndpointGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataflowEndpointGroupsAsync(array $args = [])\n * @method \\Aws\\Result listEphemerides(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEphemeridesAsync(array $args = [])\n * @method \\Aws\\Result listGroundStations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroundStationsAsync(array $args = [])\n * @method \\Aws\\Result listMissionProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMissionProfilesAsync(array $args = [])\n * @method \\Aws\\Result listSatellites(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSatellitesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result registerAgent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerAgentAsync(array $args = [])\n * @method \\Aws\\Result reserveContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise reserveContactAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAgentStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAgentStatusAsync(array $args = [])\n * @method \\Aws\\Result updateConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConfigAsync(array $args = [])\n * @method \\Aws\\Result updateEphemeris(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEphemerisAsync(array $args = [])\n * @method \\Aws\\Result updateMissionProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMissionProfileAsync(array $args = [])\n */\nclass GroundStationClient extends AwsClient {}\n", "num_lines": 76}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\GroundStation\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Ground Station** service.\n */\nclass GroundStationException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\GuardDuty;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon GuardDuty** service.\n * @method \\Aws\\Result acceptAdministratorInvitation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptAdministratorInvitationAsync(array $args = [])\n * @method \\Aws\\Result acceptInvitation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptInvitationAsync(array $args = [])\n * @method \\Aws\\Result archiveFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise archiveFindingsAsync(array $args = [])\n * @method \\Aws\\Result createDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDetectorAsync(array $args = [])\n * @method \\Aws\\Result createFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFilterAsync(array $args = [])\n * @method \\Aws\\Result createIPSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIPSetAsync(array $args = [])\n * @method \\Aws\\Result createMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMembersAsync(array $args = [])\n * @method \\Aws\\Result createPublishingDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPublishingDestinationAsync(array $args = [])\n * @method \\Aws\\Result createSampleFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSampleFindingsAsync(array $args = [])\n * @method \\Aws\\Result createThreatIntelSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createThreatIntelSetAsync(array $args = [])\n * @method \\Aws\\Result declineInvitations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise declineInvitationsAsync(array $args = [])\n * @method \\Aws\\Result deleteDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDetectorAsync(array $args = [])\n * @method \\Aws\\Result deleteFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFilterAsync(array $args = [])\n * @method \\Aws\\Result deleteIPSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIPSetAsync(array $args = [])\n * @method \\Aws\\Result deleteInvitations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInvitationsAsync(array $args = [])\n * @method \\Aws\\Result deleteMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMembersAsync(array $args = [])\n * @method \\Aws\\Result deletePublishingDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePublishingDestinationAsync(array $args = [])\n * @method \\Aws\\Result deleteThreatIntelSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteThreatIntelSetAsync(array $args = [])\n * @method \\Aws\\Result describeMalwareScans(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMalwareScansAsync(array $args = [])\n * @method \\Aws\\Result describeOrganizationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrganizationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describePublishingDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePublishingDestinationAsync(array $args = [])\n * @method \\Aws\\Result disableOrganizationAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableOrganizationAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result disassociateFromAdministratorAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateFromAdministratorAccountAsync(array $args = [])\n * @method \\Aws\\Result disassociateFromMasterAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateFromMasterAccountAsync(array $args = [])\n * @method \\Aws\\Result disassociateMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateMembersAsync(array $args = [])\n * @method \\Aws\\Result enableOrganizationAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableOrganizationAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result getAdministratorAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAdministratorAccountAsync(array $args = [])\n * @method \\Aws\\Result getCoverageStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCoverageStatisticsAsync(array $args = [])\n * @method \\Aws\\Result getDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDetectorAsync(array $args = [])\n * @method \\Aws\\Result getFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFilterAsync(array $args = [])\n * @method \\Aws\\Result getFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFindingsAsync(array $args = [])\n * @method \\Aws\\Result getFindingsStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFindingsStatisticsAsync(array $args = [])\n * @method \\Aws\\Result getIPSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIPSetAsync(array $args = [])\n * @method \\Aws\\Result getInvitationsCount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInvitationsCountAsync(array $args = [])\n * @method \\Aws\\Result getMalwareScanSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMalwareScanSettingsAsync(array $args = [])\n * @method \\Aws\\Result getMasterAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMasterAccountAsync(array $args = [])\n * @method \\Aws\\Result getMemberDetectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMemberDetectorsAsync(array $args = [])\n * @method \\Aws\\Result getMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMembersAsync(array $args = [])\n * @method \\Aws\\Result getRemainingFreeTrialDays(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRemainingFreeTrialDaysAsync(array $args = [])\n * @method \\Aws\\Result getThreatIntelSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getThreatIntelSetAsync(array $args = [])\n * @method \\Aws\\Result getUsageStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUsageStatisticsAsync(array $args = [])\n * @method \\Aws\\Result inviteMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise inviteMembersAsync(array $args = [])\n * @method \\Aws\\Result listCoverage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCoverageAsync(array $args = [])\n * @method \\Aws\\Result listDetectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDetectorsAsync(array $args = [])\n * @method \\Aws\\Result listFilters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFiltersAsync(array $args = [])\n * @method \\Aws\\Result listFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFindingsAsync(array $args = [])\n * @method \\Aws\\Result listIPSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIPSetsAsync(array $args = [])\n * @method \\Aws\\Result listInvitations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInvitationsAsync(array $args = [])\n * @method \\Aws\\Result listMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMembersAsync(array $args = [])\n * @method \\Aws\\Result listOrganizationAdminAccounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOrganizationAdminAccountsAsync(array $args = [])\n * @method \\Aws\\Result listPublishingDestinations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPublishingDestinationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listThreatIntelSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listThreatIntelSetsAsync(array $args = [])\n * @method \\Aws\\Result startMalwareScan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMalwareScanAsync(array $args = [])\n * @method \\Aws\\Result startMonitoringMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMonitoringMembersAsync(array $args = [])\n * @method \\Aws\\Result stopMonitoringMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopMonitoringMembersAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result unarchiveFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unarchiveFindingsAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDetectorAsync(array $args = [])\n * @method \\Aws\\Result updateFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFilterAsync(array $args = [])\n * @method \\Aws\\Result updateFindingsFeedback(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFindingsFeedbackAsync(array $args = [])\n * @method \\Aws\\Result updateIPSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIPSetAsync(array $args = [])\n * @method \\Aws\\Result updateMalwareScanSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMalwareScanSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateMemberDetectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMemberDetectorsAsync(array $args = [])\n * @method \\Aws\\Result updateOrganizationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateOrganizationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updatePublishingDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePublishingDestinationAsync(array $args = [])\n * @method \\Aws\\Result updateThreatIntelSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateThreatIntelSetAsync(array $args = [])\n */\nclass GuardDutyClient extends AwsClient {}\n", "num_lines": 146}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\GuardDuty\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon GuardDuty** service.\n */\nclass GuardDutyException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Handler\\GuzzleV5;\n\nuse Exception;\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\ClientInterface;\nuse GuzzleHttp\\Event\\EndEvent;\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\Message\\ResponseInterface as GuzzleResponse;\nuse GuzzleHttp\\Promise;\nuse GuzzleHttp\\Psr7\\Response as Psr7Response;\nuse GuzzleHttp\\Stream\\Stream;\nuse Psr\\Http\\Message\\RequestInterface as Psr7Request;\nuse Psr\\Http\\Message\\StreamInterface as Psr7StreamInterface;\n\n/**\n * A request handler that sends PSR-7-compatible requests with Guzzle 5.\n *\n * The handler accepts a PSR-7 Request object and an array of transfer options\n * and returns a Guzzle 6 Promise. The promise is either resolved with a\n * PSR-7 Response object or rejected with an array of error data.\n *\n * @codeCoverageIgnore\n */\nclass GuzzleHandler\n{\n    private static $validOptions = [\n        'proxy'             => true,\n        'expect'            => true,\n        'cert'              => true,\n        'verify'            => true,\n        'timeout'           => true,\n        'debug'             => true,\n        'connect_timeout'   => true,\n        'stream'            => true,\n        'delay'             => true,\n        'sink'              => true,\n    ];\n\n    /** @var ClientInterface */\n    private $client;\n\n    /**\n     * @param ClientInterface $client\n     */\n    public function __construct(ClientInterface $client = null)\n    {\n        $this->client = $client ?: new Client();\n    }\n\n    /**\n     * @param Psr7Request $request\n     * @param array $options\n     * @return Promise\\Promise|Promise\\PromiseInterface\n     * @throws \\GuzzleHttp\\Exception\\GuzzleException\n     */\n    public function __invoke(Psr7Request $request, array $options = [])\n    {\n        // Create and send a Guzzle 5 request\n        $guzzlePromise = $this->client->send(\n            $this->createGuzzleRequest($request, $options)\n        );\n\n        $promise = new Promise\\Promise(\n            function () use ($guzzlePromise) {\n                try {\n                    $guzzlePromise->wait();\n                } catch (\\Exception $e) {\n                    // The promise is already delivered when the exception is\n                    // thrown, so don't rethrow it.\n                }\n            },\n            [$guzzlePromise, 'cancel']\n        );\n\n        $guzzlePromise->then([$promise, 'resolve'], [$promise, 'reject']);\n\n        return $promise->then(\n            function (GuzzleResponse $response) {\n                // Adapt the Guzzle 5 Future to a Guzzle 6 ResponsePromise.\n                return $this->createPsr7Response($response);\n            },\n            function (Exception $exception) use ($options) {\n                // If we got a 'sink' that's a path, set the response body to\n                // the contents of the file. This will build the resulting\n                // exception with more information.\n                if ($exception instanceof RequestException) {\n                    if (isset($options['sink'])) {\n                        if (!($options['sink'] instanceof Psr7StreamInterface)) {\n                            $exception->getResponse()->setBody(\n                                Stream::factory(\n                                    file_get_contents($options['sink'])\n                                )\n                            );\n                        }\n                    }\n                }\n                // Reject with information about the error.\n                return new Promise\\RejectedPromise($this->prepareErrorData($exception));\n            }\n        );\n    }\n\n    private function createGuzzleRequest(Psr7Request $psrRequest, array $options)\n    {\n        $ringConfig = [];\n        $statsCallback = isset($options['http_stats_receiver'])\n            ? $options['http_stats_receiver']\n            : null;\n        unset($options['http_stats_receiver']);\n\n        // Remove unsupported options.\n        foreach (array_keys($options) as $key) {\n            if (!isset(self::$validOptions[$key])) {\n                unset($options[$key]);\n            }\n        }\n\n        // Handle delay option.\n        if (isset($options['delay'])) {\n            $ringConfig['delay'] = $options['delay'];\n            unset($options['delay']);\n        }\n\n        // Prepare sink option.\n        if (isset($options['sink'])) {\n            $ringConfig['save_to'] = ($options['sink'] instanceof Psr7StreamInterface)\n                ? new GuzzleStream($options['sink'])\n                : $options['sink'];\n            unset($options['sink']);\n        }\n\n        // Ensure that all requests are async and lazy like Guzzle 6.\n        $options['future'] = 'lazy';\n\n        // Create the Guzzle 5 request from the provided PSR7 request.\n        $request = $this->client->createRequest(\n            $psrRequest->getMethod(),\n            $psrRequest->getUri(),\n            $options\n        );\n\n        if (is_callable($statsCallback)) {\n            $request->getEmitter()->on(\n                'end',\n                function (EndEvent $event) use ($statsCallback) {\n                    $statsCallback($event->getTransferInfo());\n                }\n            );\n        }\n\n        // For the request body, adapt the PSR stream to a Guzzle stream.\n        $body = $psrRequest->getBody();\n        if ($body->getSize() === 0) {\n            $request->setBody(null);\n        } else {\n            $request->setBody(new GuzzleStream($body));\n        }\n\n        $request->setHeaders($psrRequest->getHeaders());\n\n        $request->setHeader(\n            'User-Agent',\n            $request->getHeader('User-Agent')\n                . ' ' . Client::getDefaultUserAgent()\n        );\n\n        // Make sure the delay is configured, if provided.\n        if ($ringConfig) {\n            foreach ($ringConfig as $k => $v) {\n                $request->getConfig()->set($k, $v);\n            }\n        }\n\n        return $request;\n    }\n\n    private function createPsr7Response(GuzzleResponse $response)\n    {\n        if ($body = $response->getBody()) {\n            $body = new PsrStream($body);\n        }\n\n        return new Psr7Response(\n            $response->getStatusCode(),\n            $response->getHeaders(),\n            $body,\n            $response->getReasonPhrase()\n        );\n    }\n\n    private function prepareErrorData(Exception $e)\n    {\n        $error = [\n            'exception'        => $e,\n            'connection_error' => false,\n            'response'         => null,\n        ];\n\n        if ($e instanceof ConnectException) {\n            $error['connection_error'] = true;\n        }\n\n        if ($e instanceof RequestException && $e->getResponse()) {\n            $error['response'] = $this->createPsr7Response($e->getResponse());\n        }\n\n        return $error;\n    }\n}\n", "num_lines": 212}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Handler\\GuzzleV5;\n\nuse GuzzleHttp\\Stream\\StreamDecoratorTrait;\nuse GuzzleHttp\\Stream\\StreamInterface as GuzzleStreamInterface;\nuse Psr\\Http\\Message\\StreamInterface as Psr7StreamInterface;\n\n/**\n * Adapts a PSR-7 Stream to a Guzzle 5 Stream.\n *\n * @codeCoverageIgnore\n */\nclass GuzzleStream implements GuzzleStreamInterface\n{\n    use StreamDecoratorTrait;\n\n    /** @var Psr7StreamInterface */\n    private $stream;\n\n    public function __construct(Psr7StreamInterface $stream)\n    {\n        $this->stream = $stream;\n    }\n}\n", "num_lines": 25}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Handler\\GuzzleV5;\n\nuse GuzzleHttp\\Stream\\StreamDecoratorTrait;\nuse GuzzleHttp\\Stream\\StreamInterface as GuzzleStreamInterface;\nuse Psr\\Http\\Message\\StreamInterface as Psr7StreamInterface;\n\n/**\n * Adapts a Guzzle 5 Stream to a PSR-7 Stream.\n *\n * @codeCoverageIgnore\n */\nclass PsrStream implements Psr7StreamInterface\n{\n    use StreamDecoratorTrait;\n\n    /** @var GuzzleStreamInterface */\n    private $stream;\n\n    public function __construct(GuzzleStreamInterface $stream)\n    {\n        $this->stream = $stream;\n    }\n\n    public function rewind()\n    {\n        $this->stream->seek(0);\n    }\n\n    public function getContents()\n    {\n        return $this->stream->getContents();\n    }\n}\n", "num_lines": 35}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Handler\\GuzzleV6;\n\nuse Exception;\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\Promise;\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\ClientInterface;\nuse GuzzleHttp\\TransferStats;\nuse Psr\\Http\\Message\\RequestInterface as Psr7Request;\n\n/**\n * A request handler that sends PSR-7-compatible requests with Guzzle 6.\n */\nclass GuzzleHandler\n{\n    /** @var ClientInterface */\n    private $client;\n\n    /**\n     * @param ClientInterface $client\n     */\n    public function __construct(ClientInterface $client = null)\n    {\n        $this->client = $client ?: new Client();\n    }\n\n    /**\n     * @param Psr7Request $request\n     * @param array       $options\n     *\n     * @return Promise\\Promise\n     */\n    public function __invoke(Psr7Request $request, array $options = [])\n    {\n        $request = $request->withHeader(\n            'User-Agent',\n            $request->getHeaderLine('User-Agent')\n                . ' ' . \\GuzzleHttp\\default_user_agent()\n        );\n\n        return $this->client->sendAsync($request, $this->parseOptions($options))\n            ->otherwise(\n                static function ($e) {\n                    $error = [\n                        'exception'        => $e,\n                        'connection_error' => $e instanceof ConnectException,\n                        'response'         => null,\n                    ];\n\n                    if (\n                        ($e instanceof RequestException)\n                        && $e->getResponse()\n                    ) {\n                        $error['response'] = $e->getResponse();\n                    }\n\n                    return new Promise\\RejectedPromise($error);\n                }\n            );\n    }\n\n    private function parseOptions(array $options)\n    {\n        if (isset($options['http_stats_receiver'])) {\n            $fn = $options['http_stats_receiver'];\n            unset($options['http_stats_receiver']);\n\n            $prev = isset($options['on_stats'])\n                ? $options['on_stats']\n                : null;\n\n            $options['on_stats'] = static function (\n                TransferStats $stats\n            ) use ($fn, $prev) {\n                if (is_callable($prev)) {\n                    $prev($stats);\n                }\n                $transferStats = ['total_time' => $stats->getTransferTime()];\n                $transferStats += $stats->getHandlerStats();\n                $fn($transferStats);\n            };\n        }\n\n        return $options;\n    }\n}\n", "num_lines": 89}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Health;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Health APIs and Notifications** service.\n * @method \\Aws\\Result describeAffectedAccountsForOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAffectedAccountsForOrganizationAsync(array $args = [])\n * @method \\Aws\\Result describeAffectedEntities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAffectedEntitiesAsync(array $args = [])\n * @method \\Aws\\Result describeAffectedEntitiesForOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAffectedEntitiesForOrganizationAsync(array $args = [])\n * @method \\Aws\\Result describeEntityAggregates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEntityAggregatesAsync(array $args = [])\n * @method \\Aws\\Result describeEventAggregates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventAggregatesAsync(array $args = [])\n * @method \\Aws\\Result describeEventDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventDetailsAsync(array $args = [])\n * @method \\Aws\\Result describeEventDetailsForOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventDetailsForOrganizationAsync(array $args = [])\n * @method \\Aws\\Result describeEventTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventTypesAsync(array $args = [])\n * @method \\Aws\\Result describeEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventsAsync(array $args = [])\n * @method \\Aws\\Result describeEventsForOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventsForOrganizationAsync(array $args = [])\n * @method \\Aws\\Result describeHealthServiceStatusForOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHealthServiceStatusForOrganizationAsync(array $args = [])\n * @method \\Aws\\Result disableHealthServiceAccessForOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableHealthServiceAccessForOrganizationAsync(array $args = [])\n * @method \\Aws\\Result enableHealthServiceAccessForOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableHealthServiceAccessForOrganizationAsync(array $args = [])\n */\nclass HealthClient extends AwsClient {}\n", "num_lines": 36}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Health\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Health APIs and Notifications** service.\n */\nclass HealthException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\HealthLake;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon HealthLake** service.\n * @method \\Aws\\Result createFHIRDatastore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFHIRDatastoreAsync(array $args = [])\n * @method \\Aws\\Result deleteFHIRDatastore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFHIRDatastoreAsync(array $args = [])\n * @method \\Aws\\Result describeFHIRDatastore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFHIRDatastoreAsync(array $args = [])\n * @method \\Aws\\Result describeFHIRExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFHIRExportJobAsync(array $args = [])\n * @method \\Aws\\Result describeFHIRImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFHIRImportJobAsync(array $args = [])\n * @method \\Aws\\Result listFHIRDatastores(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFHIRDatastoresAsync(array $args = [])\n * @method \\Aws\\Result listFHIRExportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFHIRExportJobsAsync(array $args = [])\n * @method \\Aws\\Result listFHIRImportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFHIRImportJobsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startFHIRExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startFHIRExportJobAsync(array $args = [])\n * @method \\Aws\\Result startFHIRImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startFHIRImportJobAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass HealthLakeClient extends AwsClient {}\n", "num_lines": 36}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\HealthLake\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon HealthLake** service.\n */\nclass HealthLakeException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Honeycode;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Honeycode** service.\n * @method \\Aws\\Result batchCreateTableRows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchCreateTableRowsAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteTableRows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteTableRowsAsync(array $args = [])\n * @method \\Aws\\Result batchUpdateTableRows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdateTableRowsAsync(array $args = [])\n * @method \\Aws\\Result batchUpsertTableRows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpsertTableRowsAsync(array $args = [])\n * @method \\Aws\\Result describeTableDataImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTableDataImportJobAsync(array $args = [])\n * @method \\Aws\\Result getScreenData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getScreenDataAsync(array $args = [])\n * @method \\Aws\\Result invokeScreenAutomation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise invokeScreenAutomationAsync(array $args = [])\n * @method \\Aws\\Result listTableColumns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTableColumnsAsync(array $args = [])\n * @method \\Aws\\Result listTableRows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTableRowsAsync(array $args = [])\n * @method \\Aws\\Result listTables(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTablesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result queryTableRows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise queryTableRowsAsync(array $args = [])\n * @method \\Aws\\Result startTableDataImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startTableDataImportJobAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass HoneycodeClient extends AwsClient {}\n", "num_lines": 40}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Honeycode\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Honeycode** service.\n */\nclass HoneycodeException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Iam;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Identity and Access Management (AWS IAM)** service.\n *\n * @method \\Aws\\Result addClientIDToOpenIDConnectProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addClientIDToOpenIDConnectProviderAsync(array $args = [])\n * @method \\Aws\\Result addRoleToInstanceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addRoleToInstanceProfileAsync(array $args = [])\n * @method \\Aws\\Result addUserToGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addUserToGroupAsync(array $args = [])\n * @method \\Aws\\Result attachGroupPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachGroupPolicyAsync(array $args = [])\n * @method \\Aws\\Result attachRolePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachRolePolicyAsync(array $args = [])\n * @method \\Aws\\Result attachUserPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachUserPolicyAsync(array $args = [])\n * @method \\Aws\\Result changePassword(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise changePasswordAsync(array $args = [])\n * @method \\Aws\\Result createAccessKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccessKeyAsync(array $args = [])\n * @method \\Aws\\Result createAccountAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccountAliasAsync(array $args = [])\n * @method \\Aws\\Result createGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGroupAsync(array $args = [])\n * @method \\Aws\\Result createInstanceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInstanceProfileAsync(array $args = [])\n * @method \\Aws\\Result createLoginProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLoginProfileAsync(array $args = [])\n * @method \\Aws\\Result createOpenIDConnectProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createOpenIDConnectProviderAsync(array $args = [])\n * @method \\Aws\\Result createPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPolicyAsync(array $args = [])\n * @method \\Aws\\Result createPolicyVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPolicyVersionAsync(array $args = [])\n * @method \\Aws\\Result createRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRoleAsync(array $args = [])\n * @method \\Aws\\Result createSAMLProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSAMLProviderAsync(array $args = [])\n * @method \\Aws\\Result createServiceLinkedRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceLinkedRoleAsync(array $args = [])\n * @method \\Aws\\Result createServiceSpecificCredential(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceSpecificCredentialAsync(array $args = [])\n * @method \\Aws\\Result createUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserAsync(array $args = [])\n * @method \\Aws\\Result createVirtualMFADevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVirtualMFADeviceAsync(array $args = [])\n * @method \\Aws\\Result deactivateMFADevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deactivateMFADeviceAsync(array $args = [])\n * @method \\Aws\\Result deleteAccessKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccessKeyAsync(array $args = [])\n * @method \\Aws\\Result deleteAccountAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccountAliasAsync(array $args = [])\n * @method \\Aws\\Result deleteAccountPasswordPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccountPasswordPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteGroupPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGroupPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteInstanceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInstanceProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteLoginProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLoginProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteOpenIDConnectProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOpenIDConnectProviderAsync(array $args = [])\n * @method \\Aws\\Result deletePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePolicyAsync(array $args = [])\n * @method \\Aws\\Result deletePolicyVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePolicyVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRoleAsync(array $args = [])\n * @method \\Aws\\Result deleteRolePermissionsBoundary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRolePermissionsBoundaryAsync(array $args = [])\n * @method \\Aws\\Result deleteRolePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRolePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteSAMLProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSAMLProviderAsync(array $args = [])\n * @method \\Aws\\Result deleteSSHPublicKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSSHPublicKeyAsync(array $args = [])\n * @method \\Aws\\Result deleteServerCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServerCertificateAsync(array $args = [])\n * @method \\Aws\\Result deleteServiceLinkedRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceLinkedRoleAsync(array $args = [])\n * @method \\Aws\\Result deleteServiceSpecificCredential(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceSpecificCredentialAsync(array $args = [])\n * @method \\Aws\\Result deleteSigningCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSigningCertificateAsync(array $args = [])\n * @method \\Aws\\Result deleteUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserAsync(array $args = [])\n * @method \\Aws\\Result deleteUserPermissionsBoundary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserPermissionsBoundaryAsync(array $args = [])\n * @method \\Aws\\Result deleteUserPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteVirtualMFADevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVirtualMFADeviceAsync(array $args = [])\n * @method \\Aws\\Result detachGroupPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachGroupPolicyAsync(array $args = [])\n * @method \\Aws\\Result detachRolePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachRolePolicyAsync(array $args = [])\n * @method \\Aws\\Result detachUserPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachUserPolicyAsync(array $args = [])\n * @method \\Aws\\Result enableMFADevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableMFADeviceAsync(array $args = [])\n * @method \\Aws\\Result generateCredentialReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateCredentialReportAsync(array $args = [])\n * @method \\Aws\\Result generateOrganizationsAccessReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateOrganizationsAccessReportAsync(array $args = [])\n * @method \\Aws\\Result generateServiceLastAccessedDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateServiceLastAccessedDetailsAsync(array $args = [])\n * @method \\Aws\\Result getAccessKeyLastUsed(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccessKeyLastUsedAsync(array $args = [])\n * @method \\Aws\\Result getAccountAuthorizationDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountAuthorizationDetailsAsync(array $args = [])\n * @method \\Aws\\Result getAccountPasswordPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountPasswordPolicyAsync(array $args = [])\n * @method \\Aws\\Result getAccountSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountSummaryAsync(array $args = [])\n * @method \\Aws\\Result getContextKeysForCustomPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContextKeysForCustomPolicyAsync(array $args = [])\n * @method \\Aws\\Result getContextKeysForPrincipalPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContextKeysForPrincipalPolicyAsync(array $args = [])\n * @method \\Aws\\Result getCredentialReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCredentialReportAsync(array $args = [])\n * @method \\Aws\\Result getGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGroupAsync(array $args = [])\n * @method \\Aws\\Result getGroupPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGroupPolicyAsync(array $args = [])\n * @method \\Aws\\Result getInstanceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInstanceProfileAsync(array $args = [])\n * @method \\Aws\\Result getLoginProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLoginProfileAsync(array $args = [])\n * @method \\Aws\\Result getMFADevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMFADeviceAsync(array $args = [])\n * @method \\Aws\\Result getOpenIDConnectProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOpenIDConnectProviderAsync(array $args = [])\n * @method \\Aws\\Result getOrganizationsAccessReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOrganizationsAccessReportAsync(array $args = [])\n * @method \\Aws\\Result getPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPolicyAsync(array $args = [])\n * @method \\Aws\\Result getPolicyVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPolicyVersionAsync(array $args = [])\n * @method \\Aws\\Result getRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRoleAsync(array $args = [])\n * @method \\Aws\\Result getRolePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRolePolicyAsync(array $args = [])\n * @method \\Aws\\Result getSAMLProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSAMLProviderAsync(array $args = [])\n * @method \\Aws\\Result getSSHPublicKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSSHPublicKeyAsync(array $args = [])\n * @method \\Aws\\Result getServerCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServerCertificateAsync(array $args = [])\n * @method \\Aws\\Result getServiceLastAccessedDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceLastAccessedDetailsAsync(array $args = [])\n * @method \\Aws\\Result getServiceLastAccessedDetailsWithEntities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceLastAccessedDetailsWithEntitiesAsync(array $args = [])\n * @method \\Aws\\Result getServiceLinkedRoleDeletionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceLinkedRoleDeletionStatusAsync(array $args = [])\n * @method \\Aws\\Result getUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUserAsync(array $args = [])\n * @method \\Aws\\Result getUserPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUserPolicyAsync(array $args = [])\n * @method \\Aws\\Result listAccessKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccessKeysAsync(array $args = [])\n * @method \\Aws\\Result listAccountAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccountAliasesAsync(array $args = [])\n * @method \\Aws\\Result listAttachedGroupPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAttachedGroupPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listAttachedRolePolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAttachedRolePoliciesAsync(array $args = [])\n * @method \\Aws\\Result listAttachedUserPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAttachedUserPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listEntitiesForPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEntitiesForPolicyAsync(array $args = [])\n * @method \\Aws\\Result listGroupPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupsAsync(array $args = [])\n * @method \\Aws\\Result listGroupsForUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupsForUserAsync(array $args = [])\n * @method \\Aws\\Result listInstanceProfileTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInstanceProfileTagsAsync(array $args = [])\n * @method \\Aws\\Result listInstanceProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInstanceProfilesAsync(array $args = [])\n * @method \\Aws\\Result listInstanceProfilesForRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInstanceProfilesForRoleAsync(array $args = [])\n * @method \\Aws\\Result listMFADeviceTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMFADeviceTagsAsync(array $args = [])\n * @method \\Aws\\Result listMFADevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMFADevicesAsync(array $args = [])\n * @method \\Aws\\Result listOpenIDConnectProviderTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOpenIDConnectProviderTagsAsync(array $args = [])\n * @method \\Aws\\Result listOpenIDConnectProviders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOpenIDConnectProvidersAsync(array $args = [])\n * @method \\Aws\\Result listPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listPoliciesGrantingServiceAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPoliciesGrantingServiceAccessAsync(array $args = [])\n * @method \\Aws\\Result listPolicyTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPolicyTagsAsync(array $args = [])\n * @method \\Aws\\Result listPolicyVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPolicyVersionsAsync(array $args = [])\n * @method \\Aws\\Result listRolePolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRolePoliciesAsync(array $args = [])\n * @method \\Aws\\Result listRoleTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRoleTagsAsync(array $args = [])\n * @method \\Aws\\Result listRoles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRolesAsync(array $args = [])\n * @method \\Aws\\Result listSAMLProviderTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSAMLProviderTagsAsync(array $args = [])\n * @method \\Aws\\Result listSAMLProviders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSAMLProvidersAsync(array $args = [])\n * @method \\Aws\\Result listSSHPublicKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSSHPublicKeysAsync(array $args = [])\n * @method \\Aws\\Result listServerCertificateTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServerCertificateTagsAsync(array $args = [])\n * @method \\Aws\\Result listServerCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServerCertificatesAsync(array $args = [])\n * @method \\Aws\\Result listServiceSpecificCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServiceSpecificCredentialsAsync(array $args = [])\n * @method \\Aws\\Result listSigningCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSigningCertificatesAsync(array $args = [])\n * @method \\Aws\\Result listUserPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUserPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listUserTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUserTagsAsync(array $args = [])\n * @method \\Aws\\Result listUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUsersAsync(array $args = [])\n * @method \\Aws\\Result listVirtualMFADevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVirtualMFADevicesAsync(array $args = [])\n * @method \\Aws\\Result putGroupPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putGroupPolicyAsync(array $args = [])\n * @method \\Aws\\Result putRolePermissionsBoundary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRolePermissionsBoundaryAsync(array $args = [])\n * @method \\Aws\\Result putRolePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRolePolicyAsync(array $args = [])\n * @method \\Aws\\Result putUserPermissionsBoundary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putUserPermissionsBoundaryAsync(array $args = [])\n * @method \\Aws\\Result putUserPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putUserPolicyAsync(array $args = [])\n * @method \\Aws\\Result removeClientIDFromOpenIDConnectProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeClientIDFromOpenIDConnectProviderAsync(array $args = [])\n * @method \\Aws\\Result removeRoleFromInstanceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeRoleFromInstanceProfileAsync(array $args = [])\n * @method \\Aws\\Result removeUserFromGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeUserFromGroupAsync(array $args = [])\n * @method \\Aws\\Result resetServiceSpecificCredential(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetServiceSpecificCredentialAsync(array $args = [])\n * @method \\Aws\\Result resyncMFADevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resyncMFADeviceAsync(array $args = [])\n * @method \\Aws\\Result setDefaultPolicyVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setDefaultPolicyVersionAsync(array $args = [])\n * @method \\Aws\\Result setSecurityTokenServicePreferences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setSecurityTokenServicePreferencesAsync(array $args = [])\n * @method \\Aws\\Result simulateCustomPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise simulateCustomPolicyAsync(array $args = [])\n * @method \\Aws\\Result simulatePrincipalPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise simulatePrincipalPolicyAsync(array $args = [])\n * @method \\Aws\\Result tagInstanceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagInstanceProfileAsync(array $args = [])\n * @method \\Aws\\Result tagMFADevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagMFADeviceAsync(array $args = [])\n * @method \\Aws\\Result tagOpenIDConnectProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagOpenIDConnectProviderAsync(array $args = [])\n * @method \\Aws\\Result tagPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagPolicyAsync(array $args = [])\n * @method \\Aws\\Result tagRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagRoleAsync(array $args = [])\n * @method \\Aws\\Result tagSAMLProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagSAMLProviderAsync(array $args = [])\n * @method \\Aws\\Result tagServerCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagServerCertificateAsync(array $args = [])\n * @method \\Aws\\Result tagUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagUserAsync(array $args = [])\n * @method \\Aws\\Result untagInstanceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagInstanceProfileAsync(array $args = [])\n * @method \\Aws\\Result untagMFADevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagMFADeviceAsync(array $args = [])\n * @method \\Aws\\Result untagOpenIDConnectProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagOpenIDConnectProviderAsync(array $args = [])\n * @method \\Aws\\Result untagPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagPolicyAsync(array $args = [])\n * @method \\Aws\\Result untagRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagRoleAsync(array $args = [])\n * @method \\Aws\\Result untagSAMLProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagSAMLProviderAsync(array $args = [])\n * @method \\Aws\\Result untagServerCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagServerCertificateAsync(array $args = [])\n * @method \\Aws\\Result untagUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagUserAsync(array $args = [])\n * @method \\Aws\\Result updateAccessKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccessKeyAsync(array $args = [])\n * @method \\Aws\\Result updateAccountPasswordPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccountPasswordPolicyAsync(array $args = [])\n * @method \\Aws\\Result updateAssumeRolePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAssumeRolePolicyAsync(array $args = [])\n * @method \\Aws\\Result updateGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGroupAsync(array $args = [])\n * @method \\Aws\\Result updateLoginProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLoginProfileAsync(array $args = [])\n * @method \\Aws\\Result updateOpenIDConnectProviderThumbprint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateOpenIDConnectProviderThumbprintAsync(array $args = [])\n * @method \\Aws\\Result updateRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRoleAsync(array $args = [])\n * @method \\Aws\\Result updateRoleDescription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRoleDescriptionAsync(array $args = [])\n * @method \\Aws\\Result updateSAMLProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSAMLProviderAsync(array $args = [])\n * @method \\Aws\\Result updateSSHPublicKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSSHPublicKeyAsync(array $args = [])\n * @method \\Aws\\Result updateServerCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServerCertificateAsync(array $args = [])\n * @method \\Aws\\Result updateServiceSpecificCredential(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceSpecificCredentialAsync(array $args = [])\n * @method \\Aws\\Result updateSigningCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSigningCertificateAsync(array $args = [])\n * @method \\Aws\\Result updateUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserAsync(array $args = [])\n * @method \\Aws\\Result uploadSSHPublicKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise uploadSSHPublicKeyAsync(array $args = [])\n * @method \\Aws\\Result uploadServerCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise uploadServerCertificateAsync(array $args = [])\n * @method \\Aws\\Result uploadSigningCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise uploadSigningCertificateAsync(array $args = [])\n */\nclass IamClient extends AwsClient {}\n", "num_lines": 329}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Iam\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the AWS Identity and Access Management service.\n */\nclass IamException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IdentityStore;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS SSO Identity Store** service.\n * @method \\Aws\\Result createGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGroupAsync(array $args = [])\n * @method \\Aws\\Result createGroupMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGroupMembershipAsync(array $args = [])\n * @method \\Aws\\Result createUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserAsync(array $args = [])\n * @method \\Aws\\Result deleteGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteGroupMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGroupMembershipAsync(array $args = [])\n * @method \\Aws\\Result deleteUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserAsync(array $args = [])\n * @method \\Aws\\Result describeGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGroupAsync(array $args = [])\n * @method \\Aws\\Result describeGroupMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGroupMembershipAsync(array $args = [])\n * @method \\Aws\\Result describeUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserAsync(array $args = [])\n * @method \\Aws\\Result getGroupId(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGroupIdAsync(array $args = [])\n * @method \\Aws\\Result getGroupMembershipId(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGroupMembershipIdAsync(array $args = [])\n * @method \\Aws\\Result getUserId(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUserIdAsync(array $args = [])\n * @method \\Aws\\Result isMemberInGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise isMemberInGroupsAsync(array $args = [])\n * @method \\Aws\\Result listGroupMemberships(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupMembershipsAsync(array $args = [])\n * @method \\Aws\\Result listGroupMembershipsForMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupMembershipsForMemberAsync(array $args = [])\n * @method \\Aws\\Result listGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupsAsync(array $args = [])\n * @method \\Aws\\Result listUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUsersAsync(array $args = [])\n * @method \\Aws\\Result updateGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGroupAsync(array $args = [])\n * @method \\Aws\\Result updateUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserAsync(array $args = [])\n */\nclass IdentityStoreClient extends AwsClient {}\n", "num_lines": 48}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IdentityStore\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS SSO Identity Store** service.\n */\nclass IdentityStoreException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ImportExport;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Import/Export** service.\n * @method \\Aws\\Result cancelJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelJobAsync(array $args = [])\n * @method \\Aws\\Result createJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createJobAsync(array $args = [])\n * @method \\Aws\\Result getShippingLabel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getShippingLabelAsync(array $args = [])\n * @method \\Aws\\Result getStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStatusAsync(array $args = [])\n * @method \\Aws\\Result listJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobsAsync(array $args = [])\n * @method \\Aws\\Result updateJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateJobAsync(array $args = [])\n */\nclass ImportExportClient extends AwsClient {}\n", "num_lines": 22}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ImportExport\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Import/Export** service.\n */\nclass ImportExportException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Inspector;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Inspector** service.\n *\n * @method \\Aws\\Result addAttributesToFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addAttributesToFindingsAsync(array $args = [])\n * @method \\Aws\\Result createAssessmentTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAssessmentTargetAsync(array $args = [])\n * @method \\Aws\\Result createAssessmentTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAssessmentTemplateAsync(array $args = [])\n * @method \\Aws\\Result createExclusionsPreview(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createExclusionsPreviewAsync(array $args = [])\n * @method \\Aws\\Result createResourceGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResourceGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteAssessmentRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAssessmentRunAsync(array $args = [])\n * @method \\Aws\\Result deleteAssessmentTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAssessmentTargetAsync(array $args = [])\n * @method \\Aws\\Result deleteAssessmentTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAssessmentTemplateAsync(array $args = [])\n * @method \\Aws\\Result describeAssessmentRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAssessmentRunsAsync(array $args = [])\n * @method \\Aws\\Result describeAssessmentTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAssessmentTargetsAsync(array $args = [])\n * @method \\Aws\\Result describeAssessmentTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAssessmentTemplatesAsync(array $args = [])\n * @method \\Aws\\Result describeCrossAccountAccessRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCrossAccountAccessRoleAsync(array $args = [])\n * @method \\Aws\\Result describeExclusions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeExclusionsAsync(array $args = [])\n * @method \\Aws\\Result describeFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFindingsAsync(array $args = [])\n * @method \\Aws\\Result describeResourceGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeResourceGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeRulesPackages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRulesPackagesAsync(array $args = [])\n * @method \\Aws\\Result getAssessmentReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAssessmentReportAsync(array $args = [])\n * @method \\Aws\\Result getExclusionsPreview(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExclusionsPreviewAsync(array $args = [])\n * @method \\Aws\\Result getTelemetryMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTelemetryMetadataAsync(array $args = [])\n * @method \\Aws\\Result listAssessmentRunAgents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssessmentRunAgentsAsync(array $args = [])\n * @method \\Aws\\Result listAssessmentRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssessmentRunsAsync(array $args = [])\n * @method \\Aws\\Result listAssessmentTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssessmentTargetsAsync(array $args = [])\n * @method \\Aws\\Result listAssessmentTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssessmentTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listEventSubscriptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventSubscriptionsAsync(array $args = [])\n * @method \\Aws\\Result listExclusions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExclusionsAsync(array $args = [])\n * @method \\Aws\\Result listFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFindingsAsync(array $args = [])\n * @method \\Aws\\Result listRulesPackages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRulesPackagesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result previewAgents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise previewAgentsAsync(array $args = [])\n * @method \\Aws\\Result registerCrossAccountAccessRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerCrossAccountAccessRoleAsync(array $args = [])\n * @method \\Aws\\Result removeAttributesFromFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeAttributesFromFindingsAsync(array $args = [])\n * @method \\Aws\\Result setTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startAssessmentRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startAssessmentRunAsync(array $args = [])\n * @method \\Aws\\Result stopAssessmentRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopAssessmentRunAsync(array $args = [])\n * @method \\Aws\\Result subscribeToEvent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise subscribeToEventAsync(array $args = [])\n * @method \\Aws\\Result unsubscribeFromEvent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unsubscribeFromEventAsync(array $args = [])\n * @method \\Aws\\Result updateAssessmentTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAssessmentTargetAsync(array $args = [])\n */\nclass InspectorClient extends AwsClient {}\n", "num_lines": 85}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Inspector\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Inspector** service.\n */\nclass InspectorException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Inspector2;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Inspector2** service.\n * @method \\Aws\\Result associateMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateMemberAsync(array $args = [])\n * @method \\Aws\\Result batchGetAccountStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetAccountStatusAsync(array $args = [])\n * @method \\Aws\\Result batchGetCodeSnippet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetCodeSnippetAsync(array $args = [])\n * @method \\Aws\\Result batchGetFreeTrialInfo(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetFreeTrialInfoAsync(array $args = [])\n * @method \\Aws\\Result batchGetMemberEc2DeepInspectionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetMemberEc2DeepInspectionStatusAsync(array $args = [])\n * @method \\Aws\\Result batchUpdateMemberEc2DeepInspectionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdateMemberEc2DeepInspectionStatusAsync(array $args = [])\n * @method \\Aws\\Result cancelFindingsReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelFindingsReportAsync(array $args = [])\n * @method \\Aws\\Result cancelSbomExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelSbomExportAsync(array $args = [])\n * @method \\Aws\\Result createFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFilterAsync(array $args = [])\n * @method \\Aws\\Result createFindingsReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFindingsReportAsync(array $args = [])\n * @method \\Aws\\Result createSbomExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSbomExportAsync(array $args = [])\n * @method \\Aws\\Result deleteFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFilterAsync(array $args = [])\n * @method \\Aws\\Result describeOrganizationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrganizationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result disable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableAsync(array $args = [])\n * @method \\Aws\\Result disableDelegatedAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableDelegatedAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result disassociateMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateMemberAsync(array $args = [])\n * @method \\Aws\\Result enable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableAsync(array $args = [])\n * @method \\Aws\\Result enableDelegatedAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableDelegatedAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result getConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getDelegatedAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDelegatedAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result getEc2DeepInspectionConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEc2DeepInspectionConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getEncryptionKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEncryptionKeyAsync(array $args = [])\n * @method \\Aws\\Result getFindingsReportStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFindingsReportStatusAsync(array $args = [])\n * @method \\Aws\\Result getMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMemberAsync(array $args = [])\n * @method \\Aws\\Result getSbomExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSbomExportAsync(array $args = [])\n * @method \\Aws\\Result listAccountPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccountPermissionsAsync(array $args = [])\n * @method \\Aws\\Result listCoverage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCoverageAsync(array $args = [])\n * @method \\Aws\\Result listCoverageStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCoverageStatisticsAsync(array $args = [])\n * @method \\Aws\\Result listDelegatedAdminAccounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDelegatedAdminAccountsAsync(array $args = [])\n * @method \\Aws\\Result listFilters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFiltersAsync(array $args = [])\n * @method \\Aws\\Result listFindingAggregations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFindingAggregationsAsync(array $args = [])\n * @method \\Aws\\Result listFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFindingsAsync(array $args = [])\n * @method \\Aws\\Result listMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMembersAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listUsageTotals(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUsageTotalsAsync(array $args = [])\n * @method \\Aws\\Result resetEncryptionKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetEncryptionKeyAsync(array $args = [])\n * @method \\Aws\\Result searchVulnerabilities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchVulnerabilitiesAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateEc2DeepInspectionConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEc2DeepInspectionConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateEncryptionKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEncryptionKeyAsync(array $args = [])\n * @method \\Aws\\Result updateFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFilterAsync(array $args = [])\n * @method \\Aws\\Result updateOrgEc2DeepInspectionConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateOrgEc2DeepInspectionConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateOrganizationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateOrganizationConfigurationAsync(array $args = [])\n */\nclass Inspector2Client extends AwsClient {}\n", "num_lines": 100}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Inspector2\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Inspector2** service.\n */\nclass Inspector2Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\InternetMonitor;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon CloudWatch Internet Monitor** service.\n * @method \\Aws\\Result createMonitor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMonitorAsync(array $args = [])\n * @method \\Aws\\Result deleteMonitor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMonitorAsync(array $args = [])\n * @method \\Aws\\Result getHealthEvent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getHealthEventAsync(array $args = [])\n * @method \\Aws\\Result getMonitor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMonitorAsync(array $args = [])\n * @method \\Aws\\Result listHealthEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHealthEventsAsync(array $args = [])\n * @method \\Aws\\Result listMonitors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMonitorsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateMonitor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMonitorAsync(array $args = [])\n */\nclass InternetMonitorClient extends AwsClient {}\n", "num_lines": 30}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\InternetMonitor\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon CloudWatch Internet Monitor** service.\n */\nclass InternetMonitorException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Iot;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT** service.\n *\n * @method \\Aws\\Result acceptCertificateTransfer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptCertificateTransferAsync(array $args = [])\n * @method \\Aws\\Result addThingToBillingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addThingToBillingGroupAsync(array $args = [])\n * @method \\Aws\\Result addThingToThingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addThingToThingGroupAsync(array $args = [])\n * @method \\Aws\\Result associateTargetsWithJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateTargetsWithJobAsync(array $args = [])\n * @method \\Aws\\Result attachPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachPolicyAsync(array $args = [])\n * @method \\Aws\\Result attachPrincipalPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachPrincipalPolicyAsync(array $args = [])\n * @method \\Aws\\Result attachSecurityProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachSecurityProfileAsync(array $args = [])\n * @method \\Aws\\Result attachThingPrincipal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachThingPrincipalAsync(array $args = [])\n * @method \\Aws\\Result cancelAuditMitigationActionsTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelAuditMitigationActionsTaskAsync(array $args = [])\n * @method \\Aws\\Result cancelAuditTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelAuditTaskAsync(array $args = [])\n * @method \\Aws\\Result cancelCertificateTransfer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelCertificateTransferAsync(array $args = [])\n * @method \\Aws\\Result cancelDetectMitigationActionsTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelDetectMitigationActionsTaskAsync(array $args = [])\n * @method \\Aws\\Result cancelJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelJobAsync(array $args = [])\n * @method \\Aws\\Result cancelJobExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelJobExecutionAsync(array $args = [])\n * @method \\Aws\\Result clearDefaultAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise clearDefaultAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result confirmTopicRuleDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise confirmTopicRuleDestinationAsync(array $args = [])\n * @method \\Aws\\Result createAuditSuppression(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAuditSuppressionAsync(array $args = [])\n * @method \\Aws\\Result createAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result createBillingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBillingGroupAsync(array $args = [])\n * @method \\Aws\\Result createCertificateFromCsr(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCertificateFromCsrAsync(array $args = [])\n * @method \\Aws\\Result createCustomMetric(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCustomMetricAsync(array $args = [])\n * @method \\Aws\\Result createDimension(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDimensionAsync(array $args = [])\n * @method \\Aws\\Result createDomainConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDomainConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createDynamicThingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDynamicThingGroupAsync(array $args = [])\n * @method \\Aws\\Result createFleetMetric(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFleetMetricAsync(array $args = [])\n * @method \\Aws\\Result createJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createJobAsync(array $args = [])\n * @method \\Aws\\Result createJobTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createJobTemplateAsync(array $args = [])\n * @method \\Aws\\Result createKeysAndCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createKeysAndCertificateAsync(array $args = [])\n * @method \\Aws\\Result createMitigationAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMitigationActionAsync(array $args = [])\n * @method \\Aws\\Result createOTAUpdate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createOTAUpdateAsync(array $args = [])\n * @method \\Aws\\Result createPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPackageAsync(array $args = [])\n * @method \\Aws\\Result createPackageVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPackageVersionAsync(array $args = [])\n * @method \\Aws\\Result createPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPolicyAsync(array $args = [])\n * @method \\Aws\\Result createPolicyVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPolicyVersionAsync(array $args = [])\n * @method \\Aws\\Result createProvisioningClaim(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProvisioningClaimAsync(array $args = [])\n * @method \\Aws\\Result createProvisioningTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProvisioningTemplateAsync(array $args = [])\n * @method \\Aws\\Result createProvisioningTemplateVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProvisioningTemplateVersionAsync(array $args = [])\n * @method \\Aws\\Result createRoleAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRoleAliasAsync(array $args = [])\n * @method \\Aws\\Result createScheduledAudit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createScheduledAuditAsync(array $args = [])\n * @method \\Aws\\Result createSecurityProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSecurityProfileAsync(array $args = [])\n * @method \\Aws\\Result createStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStreamAsync(array $args = [])\n * @method \\Aws\\Result createThing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createThingAsync(array $args = [])\n * @method \\Aws\\Result createThingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createThingGroupAsync(array $args = [])\n * @method \\Aws\\Result createThingType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createThingTypeAsync(array $args = [])\n * @method \\Aws\\Result createTopicRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTopicRuleAsync(array $args = [])\n * @method \\Aws\\Result createTopicRuleDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTopicRuleDestinationAsync(array $args = [])\n * @method \\Aws\\Result deleteAccountAuditConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccountAuditConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteAuditSuppression(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAuditSuppressionAsync(array $args = [])\n * @method \\Aws\\Result deleteAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result deleteBillingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBillingGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteCACertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCACertificateAsync(array $args = [])\n * @method \\Aws\\Result deleteCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCertificateAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomMetric(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomMetricAsync(array $args = [])\n * @method \\Aws\\Result deleteDimension(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDimensionAsync(array $args = [])\n * @method \\Aws\\Result deleteDomainConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteDynamicThingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDynamicThingGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteFleetMetric(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFleetMetricAsync(array $args = [])\n * @method \\Aws\\Result deleteJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteJobAsync(array $args = [])\n * @method \\Aws\\Result deleteJobExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteJobExecutionAsync(array $args = [])\n * @method \\Aws\\Result deleteJobTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteJobTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteMitigationAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMitigationActionAsync(array $args = [])\n * @method \\Aws\\Result deleteOTAUpdate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOTAUpdateAsync(array $args = [])\n * @method \\Aws\\Result deletePackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePackageAsync(array $args = [])\n * @method \\Aws\\Result deletePackageVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePackageVersionAsync(array $args = [])\n * @method \\Aws\\Result deletePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePolicyAsync(array $args = [])\n * @method \\Aws\\Result deletePolicyVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePolicyVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteProvisioningTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProvisioningTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteProvisioningTemplateVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProvisioningTemplateVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteRegistrationCode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRegistrationCodeAsync(array $args = [])\n * @method \\Aws\\Result deleteRoleAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRoleAliasAsync(array $args = [])\n * @method \\Aws\\Result deleteScheduledAudit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteScheduledAuditAsync(array $args = [])\n * @method \\Aws\\Result deleteSecurityProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSecurityProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStreamAsync(array $args = [])\n * @method \\Aws\\Result deleteThing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteThingAsync(array $args = [])\n * @method \\Aws\\Result deleteThingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteThingGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteThingType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteThingTypeAsync(array $args = [])\n * @method \\Aws\\Result deleteTopicRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTopicRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteTopicRuleDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTopicRuleDestinationAsync(array $args = [])\n * @method \\Aws\\Result deleteV2LoggingLevel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteV2LoggingLevelAsync(array $args = [])\n * @method \\Aws\\Result deprecateThingType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deprecateThingTypeAsync(array $args = [])\n * @method \\Aws\\Result describeAccountAuditConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountAuditConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeAuditFinding(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAuditFindingAsync(array $args = [])\n * @method \\Aws\\Result describeAuditMitigationActionsTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAuditMitigationActionsTaskAsync(array $args = [])\n * @method \\Aws\\Result describeAuditSuppression(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAuditSuppressionAsync(array $args = [])\n * @method \\Aws\\Result describeAuditTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAuditTaskAsync(array $args = [])\n * @method \\Aws\\Result describeAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result describeBillingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBillingGroupAsync(array $args = [])\n * @method \\Aws\\Result describeCACertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCACertificateAsync(array $args = [])\n * @method \\Aws\\Result describeCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCertificateAsync(array $args = [])\n * @method \\Aws\\Result describeCustomMetric(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCustomMetricAsync(array $args = [])\n * @method \\Aws\\Result describeDefaultAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDefaultAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result describeDetectMitigationActionsTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDetectMitigationActionsTaskAsync(array $args = [])\n * @method \\Aws\\Result describeDimension(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDimensionAsync(array $args = [])\n * @method \\Aws\\Result describeDomainConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEndpointAsync(array $args = [])\n * @method \\Aws\\Result describeEventConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result describeFleetMetric(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetMetricAsync(array $args = [])\n * @method \\Aws\\Result describeIndex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeIndexAsync(array $args = [])\n * @method \\Aws\\Result describeJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJobAsync(array $args = [])\n * @method \\Aws\\Result describeJobExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJobExecutionAsync(array $args = [])\n * @method \\Aws\\Result describeJobTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJobTemplateAsync(array $args = [])\n * @method \\Aws\\Result describeManagedJobTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeManagedJobTemplateAsync(array $args = [])\n * @method \\Aws\\Result describeMitigationAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMitigationActionAsync(array $args = [])\n * @method \\Aws\\Result describeProvisioningTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProvisioningTemplateAsync(array $args = [])\n * @method \\Aws\\Result describeProvisioningTemplateVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProvisioningTemplateVersionAsync(array $args = [])\n * @method \\Aws\\Result describeRoleAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRoleAliasAsync(array $args = [])\n * @method \\Aws\\Result describeScheduledAudit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScheduledAuditAsync(array $args = [])\n * @method \\Aws\\Result describeSecurityProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSecurityProfileAsync(array $args = [])\n * @method \\Aws\\Result describeStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStreamAsync(array $args = [])\n * @method \\Aws\\Result describeThing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeThingAsync(array $args = [])\n * @method \\Aws\\Result describeThingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeThingGroupAsync(array $args = [])\n * @method \\Aws\\Result describeThingRegistrationTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeThingRegistrationTaskAsync(array $args = [])\n * @method \\Aws\\Result describeThingType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeThingTypeAsync(array $args = [])\n * @method \\Aws\\Result detachPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachPolicyAsync(array $args = [])\n * @method \\Aws\\Result detachPrincipalPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachPrincipalPolicyAsync(array $args = [])\n * @method \\Aws\\Result detachSecurityProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachSecurityProfileAsync(array $args = [])\n * @method \\Aws\\Result detachThingPrincipal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachThingPrincipalAsync(array $args = [])\n * @method \\Aws\\Result disableTopicRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableTopicRuleAsync(array $args = [])\n * @method \\Aws\\Result enableTopicRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableTopicRuleAsync(array $args = [])\n * @method \\Aws\\Result getBehaviorModelTrainingSummaries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBehaviorModelTrainingSummariesAsync(array $args = [])\n * @method \\Aws\\Result getBucketsAggregation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketsAggregationAsync(array $args = [])\n * @method \\Aws\\Result getCardinality(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCardinalityAsync(array $args = [])\n * @method \\Aws\\Result getEffectivePolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEffectivePoliciesAsync(array $args = [])\n * @method \\Aws\\Result getIndexingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIndexingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getJobDocument(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobDocumentAsync(array $args = [])\n * @method \\Aws\\Result getLoggingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLoggingOptionsAsync(array $args = [])\n * @method \\Aws\\Result getOTAUpdate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOTAUpdateAsync(array $args = [])\n * @method \\Aws\\Result getPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPackageAsync(array $args = [])\n * @method \\Aws\\Result getPackageConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPackageConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getPackageVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPackageVersionAsync(array $args = [])\n * @method \\Aws\\Result getPercentiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPercentilesAsync(array $args = [])\n * @method \\Aws\\Result getPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPolicyAsync(array $args = [])\n * @method \\Aws\\Result getPolicyVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPolicyVersionAsync(array $args = [])\n * @method \\Aws\\Result getRegistrationCode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRegistrationCodeAsync(array $args = [])\n * @method \\Aws\\Result getStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStatisticsAsync(array $args = [])\n * @method \\Aws\\Result getTopicRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTopicRuleAsync(array $args = [])\n * @method \\Aws\\Result getTopicRuleDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTopicRuleDestinationAsync(array $args = [])\n * @method \\Aws\\Result getV2LoggingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getV2LoggingOptionsAsync(array $args = [])\n * @method \\Aws\\Result listActiveViolations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listActiveViolationsAsync(array $args = [])\n * @method \\Aws\\Result listAttachedPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAttachedPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listAuditFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAuditFindingsAsync(array $args = [])\n * @method \\Aws\\Result listAuditMitigationActionsExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAuditMitigationActionsExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listAuditMitigationActionsTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAuditMitigationActionsTasksAsync(array $args = [])\n * @method \\Aws\\Result listAuditSuppressions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAuditSuppressionsAsync(array $args = [])\n * @method \\Aws\\Result listAuditTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAuditTasksAsync(array $args = [])\n * @method \\Aws\\Result listAuthorizers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAuthorizersAsync(array $args = [])\n * @method \\Aws\\Result listBillingGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBillingGroupsAsync(array $args = [])\n * @method \\Aws\\Result listCACertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCACertificatesAsync(array $args = [])\n * @method \\Aws\\Result listCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCertificatesAsync(array $args = [])\n * @method \\Aws\\Result listCertificatesByCA(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCertificatesByCAAsync(array $args = [])\n * @method \\Aws\\Result listCustomMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCustomMetricsAsync(array $args = [])\n * @method \\Aws\\Result listDetectMitigationActionsExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDetectMitigationActionsExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listDetectMitigationActionsTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDetectMitigationActionsTasksAsync(array $args = [])\n * @method \\Aws\\Result listDimensions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDimensionsAsync(array $args = [])\n * @method \\Aws\\Result listDomainConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listFleetMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFleetMetricsAsync(array $args = [])\n * @method \\Aws\\Result listIndices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIndicesAsync(array $args = [])\n * @method \\Aws\\Result listJobExecutionsForJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobExecutionsForJobAsync(array $args = [])\n * @method \\Aws\\Result listJobExecutionsForThing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobExecutionsForThingAsync(array $args = [])\n * @method \\Aws\\Result listJobTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobsAsync(array $args = [])\n * @method \\Aws\\Result listManagedJobTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listManagedJobTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listMetricValues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMetricValuesAsync(array $args = [])\n * @method \\Aws\\Result listMitigationActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMitigationActionsAsync(array $args = [])\n * @method \\Aws\\Result listOTAUpdates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOTAUpdatesAsync(array $args = [])\n * @method \\Aws\\Result listOutgoingCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOutgoingCertificatesAsync(array $args = [])\n * @method \\Aws\\Result listPackageVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPackageVersionsAsync(array $args = [])\n * @method \\Aws\\Result listPackages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPackagesAsync(array $args = [])\n * @method \\Aws\\Result listPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listPolicyPrincipals(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPolicyPrincipalsAsync(array $args = [])\n * @method \\Aws\\Result listPolicyVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPolicyVersionsAsync(array $args = [])\n * @method \\Aws\\Result listPrincipalPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPrincipalPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listPrincipalThings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPrincipalThingsAsync(array $args = [])\n * @method \\Aws\\Result listProvisioningTemplateVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProvisioningTemplateVersionsAsync(array $args = [])\n * @method \\Aws\\Result listProvisioningTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProvisioningTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listRelatedResourcesForAuditFinding(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRelatedResourcesForAuditFindingAsync(array $args = [])\n * @method \\Aws\\Result listRoleAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRoleAliasesAsync(array $args = [])\n * @method \\Aws\\Result listScheduledAudits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listScheduledAuditsAsync(array $args = [])\n * @method \\Aws\\Result listSecurityProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSecurityProfilesAsync(array $args = [])\n * @method \\Aws\\Result listSecurityProfilesForTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSecurityProfilesForTargetAsync(array $args = [])\n * @method \\Aws\\Result listStreams(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStreamsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTargetsForPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTargetsForPolicyAsync(array $args = [])\n * @method \\Aws\\Result listTargetsForSecurityProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTargetsForSecurityProfileAsync(array $args = [])\n * @method \\Aws\\Result listThingGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listThingGroupsAsync(array $args = [])\n * @method \\Aws\\Result listThingGroupsForThing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listThingGroupsForThingAsync(array $args = [])\n * @method \\Aws\\Result listThingPrincipals(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listThingPrincipalsAsync(array $args = [])\n * @method \\Aws\\Result listThingRegistrationTaskReports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listThingRegistrationTaskReportsAsync(array $args = [])\n * @method \\Aws\\Result listThingRegistrationTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listThingRegistrationTasksAsync(array $args = [])\n * @method \\Aws\\Result listThingTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listThingTypesAsync(array $args = [])\n * @method \\Aws\\Result listThings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listThingsAsync(array $args = [])\n * @method \\Aws\\Result listThingsInBillingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listThingsInBillingGroupAsync(array $args = [])\n * @method \\Aws\\Result listThingsInThingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listThingsInThingGroupAsync(array $args = [])\n * @method \\Aws\\Result listTopicRuleDestinations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTopicRuleDestinationsAsync(array $args = [])\n * @method \\Aws\\Result listTopicRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTopicRulesAsync(array $args = [])\n * @method \\Aws\\Result listV2LoggingLevels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listV2LoggingLevelsAsync(array $args = [])\n * @method \\Aws\\Result listViolationEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listViolationEventsAsync(array $args = [])\n * @method \\Aws\\Result putVerificationStateOnViolation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putVerificationStateOnViolationAsync(array $args = [])\n * @method \\Aws\\Result registerCACertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerCACertificateAsync(array $args = [])\n * @method \\Aws\\Result registerCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerCertificateAsync(array $args = [])\n * @method \\Aws\\Result registerCertificateWithoutCA(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerCertificateWithoutCAAsync(array $args = [])\n * @method \\Aws\\Result registerThing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerThingAsync(array $args = [])\n * @method \\Aws\\Result rejectCertificateTransfer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectCertificateTransferAsync(array $args = [])\n * @method \\Aws\\Result removeThingFromBillingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeThingFromBillingGroupAsync(array $args = [])\n * @method \\Aws\\Result removeThingFromThingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeThingFromThingGroupAsync(array $args = [])\n * @method \\Aws\\Result replaceTopicRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise replaceTopicRuleAsync(array $args = [])\n * @method \\Aws\\Result searchIndex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchIndexAsync(array $args = [])\n * @method \\Aws\\Result setDefaultAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setDefaultAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result setDefaultPolicyVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setDefaultPolicyVersionAsync(array $args = [])\n * @method \\Aws\\Result setLoggingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setLoggingOptionsAsync(array $args = [])\n * @method \\Aws\\Result setV2LoggingLevel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setV2LoggingLevelAsync(array $args = [])\n * @method \\Aws\\Result setV2LoggingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setV2LoggingOptionsAsync(array $args = [])\n * @method \\Aws\\Result startAuditMitigationActionsTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startAuditMitigationActionsTaskAsync(array $args = [])\n * @method \\Aws\\Result startDetectMitigationActionsTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDetectMitigationActionsTaskAsync(array $args = [])\n * @method \\Aws\\Result startOnDemandAuditTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startOnDemandAuditTaskAsync(array $args = [])\n * @method \\Aws\\Result startThingRegistrationTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startThingRegistrationTaskAsync(array $args = [])\n * @method \\Aws\\Result stopThingRegistrationTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopThingRegistrationTaskAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result testAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result testInvokeAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testInvokeAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result transferCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise transferCertificateAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAccountAuditConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccountAuditConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateAuditSuppression(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAuditSuppressionAsync(array $args = [])\n * @method \\Aws\\Result updateAuthorizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAuthorizerAsync(array $args = [])\n * @method \\Aws\\Result updateBillingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBillingGroupAsync(array $args = [])\n * @method \\Aws\\Result updateCACertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCACertificateAsync(array $args = [])\n * @method \\Aws\\Result updateCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCertificateAsync(array $args = [])\n * @method \\Aws\\Result updateCustomMetric(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCustomMetricAsync(array $args = [])\n * @method \\Aws\\Result updateDimension(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDimensionAsync(array $args = [])\n * @method \\Aws\\Result updateDomainConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDomainConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateDynamicThingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDynamicThingGroupAsync(array $args = [])\n * @method \\Aws\\Result updateEventConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEventConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result updateFleetMetric(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFleetMetricAsync(array $args = [])\n * @method \\Aws\\Result updateIndexingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIndexingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateJobAsync(array $args = [])\n * @method \\Aws\\Result updateMitigationAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMitigationActionAsync(array $args = [])\n * @method \\Aws\\Result updatePackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePackageAsync(array $args = [])\n * @method \\Aws\\Result updatePackageConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePackageConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updatePackageVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePackageVersionAsync(array $args = [])\n * @method \\Aws\\Result updateProvisioningTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProvisioningTemplateAsync(array $args = [])\n * @method \\Aws\\Result updateRoleAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRoleAliasAsync(array $args = [])\n * @method \\Aws\\Result updateScheduledAudit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateScheduledAuditAsync(array $args = [])\n * @method \\Aws\\Result updateSecurityProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSecurityProfileAsync(array $args = [])\n * @method \\Aws\\Result updateStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStreamAsync(array $args = [])\n * @method \\Aws\\Result updateThing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateThingAsync(array $args = [])\n * @method \\Aws\\Result updateThingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateThingGroupAsync(array $args = [])\n * @method \\Aws\\Result updateThingGroupsForThing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateThingGroupsForThingAsync(array $args = [])\n * @method \\Aws\\Result updateTopicRuleDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTopicRuleDestinationAsync(array $args = [])\n * @method \\Aws\\Result validateSecurityProfileBehaviors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise validateSecurityProfileBehaviorsAsync(array $args = [])\n */\nclass IotClient extends AwsClient {}\n", "num_lines": 511}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Iot\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT** service.\n */\nclass IotException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoT1ClickDevicesService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT 1-Click Devices Service** service.\n * @method \\Aws\\Result claimDevicesByClaimCode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise claimDevicesByClaimCodeAsync(array $args = [])\n * @method \\Aws\\Result describeDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDeviceAsync(array $args = [])\n * @method \\Aws\\Result finalizeDeviceClaim(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise finalizeDeviceClaimAsync(array $args = [])\n * @method \\Aws\\Result getDeviceMethods(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeviceMethodsAsync(array $args = [])\n * @method \\Aws\\Result initiateDeviceClaim(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise initiateDeviceClaimAsync(array $args = [])\n * @method \\Aws\\Result invokeDeviceMethod(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise invokeDeviceMethodAsync(array $args = [])\n * @method \\Aws\\Result listDeviceEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeviceEventsAsync(array $args = [])\n * @method \\Aws\\Result listDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDevicesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result unclaimDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unclaimDeviceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDeviceState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDeviceStateAsync(array $args = [])\n */\nclass IoT1ClickDevicesServiceClient extends AwsClient {}\n", "num_lines": 36}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoT1ClickDevicesService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT 1-Click Devices Service** service.\n */\nclass IoT1ClickDevicesServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoT1ClickProjects;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT 1-Click Projects Service** service.\n * @method \\Aws\\Result associateDeviceWithPlacement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateDeviceWithPlacementAsync(array $args = [])\n * @method \\Aws\\Result createPlacement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPlacementAsync(array $args = [])\n * @method \\Aws\\Result createProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProjectAsync(array $args = [])\n * @method \\Aws\\Result deletePlacement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePlacementAsync(array $args = [])\n * @method \\Aws\\Result deleteProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProjectAsync(array $args = [])\n * @method \\Aws\\Result describePlacement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePlacementAsync(array $args = [])\n * @method \\Aws\\Result describeProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProjectAsync(array $args = [])\n * @method \\Aws\\Result disassociateDeviceFromPlacement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateDeviceFromPlacementAsync(array $args = [])\n * @method \\Aws\\Result getDevicesInPlacement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDevicesInPlacementAsync(array $args = [])\n * @method \\Aws\\Result listPlacements(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPlacementsAsync(array $args = [])\n * @method \\Aws\\Result listProjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProjectsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updatePlacement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePlacementAsync(array $args = [])\n * @method \\Aws\\Result updateProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProjectAsync(array $args = [])\n */\nclass IoT1ClickProjectsClient extends AwsClient {}\n", "num_lines": 42}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoT1ClickProjects\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT 1-Click Projects Service** service.\n */\nclass IoT1ClickProjectsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTAnalytics;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT Analytics** service.\n * @method \\Aws\\Result batchPutMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchPutMessageAsync(array $args = [])\n * @method \\Aws\\Result cancelPipelineReprocessing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelPipelineReprocessingAsync(array $args = [])\n * @method \\Aws\\Result createChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelAsync(array $args = [])\n * @method \\Aws\\Result createDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatasetAsync(array $args = [])\n * @method \\Aws\\Result createDatasetContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatasetContentAsync(array $args = [])\n * @method \\Aws\\Result createDatastore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatastoreAsync(array $args = [])\n * @method \\Aws\\Result createPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPipelineAsync(array $args = [])\n * @method \\Aws\\Result deleteChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDatasetAsync(array $args = [])\n * @method \\Aws\\Result deleteDatasetContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDatasetContentAsync(array $args = [])\n * @method \\Aws\\Result deleteDatastore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDatastoreAsync(array $args = [])\n * @method \\Aws\\Result deletePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePipelineAsync(array $args = [])\n * @method \\Aws\\Result describeChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelAsync(array $args = [])\n * @method \\Aws\\Result describeDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDatasetAsync(array $args = [])\n * @method \\Aws\\Result describeDatastore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDatastoreAsync(array $args = [])\n * @method \\Aws\\Result describeLoggingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLoggingOptionsAsync(array $args = [])\n * @method \\Aws\\Result describePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePipelineAsync(array $args = [])\n * @method \\Aws\\Result getDatasetContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDatasetContentAsync(array $args = [])\n * @method \\Aws\\Result listChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelsAsync(array $args = [])\n * @method \\Aws\\Result listDatasetContents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetContentsAsync(array $args = [])\n * @method \\Aws\\Result listDatasets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetsAsync(array $args = [])\n * @method \\Aws\\Result listDatastores(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatastoresAsync(array $args = [])\n * @method \\Aws\\Result listPipelines(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPipelinesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putLoggingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putLoggingOptionsAsync(array $args = [])\n * @method \\Aws\\Result runPipelineActivity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise runPipelineActivityAsync(array $args = [])\n * @method \\Aws\\Result sampleChannelData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sampleChannelDataAsync(array $args = [])\n * @method \\Aws\\Result startPipelineReprocessing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startPipelineReprocessingAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChannelAsync(array $args = [])\n * @method \\Aws\\Result updateDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDatasetAsync(array $args = [])\n * @method \\Aws\\Result updateDatastore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDatastoreAsync(array $args = [])\n * @method \\Aws\\Result updatePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePipelineAsync(array $args = [])\n */\nclass IoTAnalyticsClient extends AwsClient {}\n", "num_lines": 78}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTAnalytics\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT Analytics** service.\n */\nclass IoTAnalyticsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IotDataPlane;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT Data Plane** service.\n *\n * @method \\Aws\\Result deleteThingShadow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteThingShadowAsync(array $args = [])\n * @method \\Aws\\Result getRetainedMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRetainedMessageAsync(array $args = [])\n * @method \\Aws\\Result getThingShadow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getThingShadowAsync(array $args = [])\n * @method \\Aws\\Result listNamedShadowsForThing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNamedShadowsForThingAsync(array $args = [])\n * @method \\Aws\\Result listRetainedMessages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRetainedMessagesAsync(array $args = [])\n * @method \\Aws\\Result publish(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise publishAsync(array $args = [])\n * @method \\Aws\\Result updateThingShadow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateThingShadowAsync(array $args = [])\n */\nclass IotDataPlaneClient extends AwsClient {}\n", "num_lines": 25}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IotDataPlane\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT Data Plane** service.\n */\nclass IotDataPlaneException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTDeviceAdvisor;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT Core Device Advisor** service.\n * @method \\Aws\\Result createSuiteDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSuiteDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteSuiteDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSuiteDefinitionAsync(array $args = [])\n * @method \\Aws\\Result getEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEndpointAsync(array $args = [])\n * @method \\Aws\\Result getSuiteDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSuiteDefinitionAsync(array $args = [])\n * @method \\Aws\\Result getSuiteRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSuiteRunAsync(array $args = [])\n * @method \\Aws\\Result getSuiteRunReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSuiteRunReportAsync(array $args = [])\n * @method \\Aws\\Result listSuiteDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSuiteDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listSuiteRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSuiteRunsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startSuiteRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSuiteRunAsync(array $args = [])\n * @method \\Aws\\Result stopSuiteRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopSuiteRunAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateSuiteDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSuiteDefinitionAsync(array $args = [])\n */\nclass IoTDeviceAdvisorClient extends AwsClient {}\n", "num_lines": 38}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTDeviceAdvisor\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT Core Device Advisor** service.\n */\nclass IoTDeviceAdvisorException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTEvents;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT Events** service.\n * @method \\Aws\\Result createAlarmModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAlarmModelAsync(array $args = [])\n * @method \\Aws\\Result createDetectorModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDetectorModelAsync(array $args = [])\n * @method \\Aws\\Result createInput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInputAsync(array $args = [])\n * @method \\Aws\\Result deleteAlarmModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAlarmModelAsync(array $args = [])\n * @method \\Aws\\Result deleteDetectorModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDetectorModelAsync(array $args = [])\n * @method \\Aws\\Result deleteInput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInputAsync(array $args = [])\n * @method \\Aws\\Result describeAlarmModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAlarmModelAsync(array $args = [])\n * @method \\Aws\\Result describeDetectorModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDetectorModelAsync(array $args = [])\n * @method \\Aws\\Result describeDetectorModelAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDetectorModelAnalysisAsync(array $args = [])\n * @method \\Aws\\Result describeInput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInputAsync(array $args = [])\n * @method \\Aws\\Result describeLoggingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLoggingOptionsAsync(array $args = [])\n * @method \\Aws\\Result getDetectorModelAnalysisResults(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDetectorModelAnalysisResultsAsync(array $args = [])\n * @method \\Aws\\Result listAlarmModelVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAlarmModelVersionsAsync(array $args = [])\n * @method \\Aws\\Result listAlarmModels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAlarmModelsAsync(array $args = [])\n * @method \\Aws\\Result listDetectorModelVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDetectorModelVersionsAsync(array $args = [])\n * @method \\Aws\\Result listDetectorModels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDetectorModelsAsync(array $args = [])\n * @method \\Aws\\Result listInputRoutings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInputRoutingsAsync(array $args = [])\n * @method \\Aws\\Result listInputs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInputsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putLoggingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putLoggingOptionsAsync(array $args = [])\n * @method \\Aws\\Result startDetectorModelAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDetectorModelAnalysisAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAlarmModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAlarmModelAsync(array $args = [])\n * @method \\Aws\\Result updateDetectorModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDetectorModelAsync(array $args = [])\n * @method \\Aws\\Result updateInput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateInputAsync(array $args = [])\n */\nclass IoTEventsClient extends AwsClient {}\n", "num_lines": 62}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTEvents\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT Events** service.\n */\nclass IoTEventsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTEventsData;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT Events Data** service.\n * @method \\Aws\\Result batchAcknowledgeAlarm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchAcknowledgeAlarmAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteDetectorAsync(array $args = [])\n * @method \\Aws\\Result batchDisableAlarm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDisableAlarmAsync(array $args = [])\n * @method \\Aws\\Result batchEnableAlarm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchEnableAlarmAsync(array $args = [])\n * @method \\Aws\\Result batchPutMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchPutMessageAsync(array $args = [])\n * @method \\Aws\\Result batchResetAlarm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchResetAlarmAsync(array $args = [])\n * @method \\Aws\\Result batchSnoozeAlarm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchSnoozeAlarmAsync(array $args = [])\n * @method \\Aws\\Result batchUpdateDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdateDetectorAsync(array $args = [])\n * @method \\Aws\\Result describeAlarm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAlarmAsync(array $args = [])\n * @method \\Aws\\Result describeDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDetectorAsync(array $args = [])\n * @method \\Aws\\Result listAlarms(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAlarmsAsync(array $args = [])\n * @method \\Aws\\Result listDetectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDetectorsAsync(array $args = [])\n */\nclass IoTEventsDataClient extends AwsClient {}\n", "num_lines": 34}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTEventsData\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT Events Data** service.\n */\nclass IoTEventsDataException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTFleetHub;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT Fleet Hub** service.\n * @method \\Aws\\Result createApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationAsync(array $args = [])\n * @method \\Aws\\Result describeApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeApplicationAsync(array $args = [])\n * @method \\Aws\\Result listApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationAsync(array $args = [])\n */\nclass IoTFleetHubClient extends AwsClient {}\n", "num_lines": 26}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTFleetHub\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT Fleet Hub** service.\n */\nclass IoTFleetHubException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTFleetWise;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT FleetWise** service.\n * @method \\Aws\\Result associateVehicleFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateVehicleFleetAsync(array $args = [])\n * @method \\Aws\\Result batchCreateVehicle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchCreateVehicleAsync(array $args = [])\n * @method \\Aws\\Result batchUpdateVehicle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdateVehicleAsync(array $args = [])\n * @method \\Aws\\Result createCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCampaignAsync(array $args = [])\n * @method \\Aws\\Result createDecoderManifest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDecoderManifestAsync(array $args = [])\n * @method \\Aws\\Result createFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFleetAsync(array $args = [])\n * @method \\Aws\\Result createModelManifest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createModelManifestAsync(array $args = [])\n * @method \\Aws\\Result createSignalCatalog(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSignalCatalogAsync(array $args = [])\n * @method \\Aws\\Result createVehicle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVehicleAsync(array $args = [])\n * @method \\Aws\\Result deleteCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCampaignAsync(array $args = [])\n * @method \\Aws\\Result deleteDecoderManifest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDecoderManifestAsync(array $args = [])\n * @method \\Aws\\Result deleteFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFleetAsync(array $args = [])\n * @method \\Aws\\Result deleteModelManifest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteModelManifestAsync(array $args = [])\n * @method \\Aws\\Result deleteSignalCatalog(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSignalCatalogAsync(array $args = [])\n * @method \\Aws\\Result deleteVehicle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVehicleAsync(array $args = [])\n * @method \\Aws\\Result disassociateVehicleFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateVehicleFleetAsync(array $args = [])\n * @method \\Aws\\Result getCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCampaignAsync(array $args = [])\n * @method \\Aws\\Result getDecoderManifest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDecoderManifestAsync(array $args = [])\n * @method \\Aws\\Result getFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFleetAsync(array $args = [])\n * @method \\Aws\\Result getLoggingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLoggingOptionsAsync(array $args = [])\n * @method \\Aws\\Result getModelManifest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getModelManifestAsync(array $args = [])\n * @method \\Aws\\Result getRegisterAccountStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRegisterAccountStatusAsync(array $args = [])\n * @method \\Aws\\Result getSignalCatalog(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSignalCatalogAsync(array $args = [])\n * @method \\Aws\\Result getVehicle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVehicleAsync(array $args = [])\n * @method \\Aws\\Result getVehicleStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVehicleStatusAsync(array $args = [])\n * @method \\Aws\\Result importDecoderManifest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importDecoderManifestAsync(array $args = [])\n * @method \\Aws\\Result importSignalCatalog(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importSignalCatalogAsync(array $args = [])\n * @method \\Aws\\Result listCampaigns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCampaignsAsync(array $args = [])\n * @method \\Aws\\Result listDecoderManifestNetworkInterfaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDecoderManifestNetworkInterfacesAsync(array $args = [])\n * @method \\Aws\\Result listDecoderManifestSignals(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDecoderManifestSignalsAsync(array $args = [])\n * @method \\Aws\\Result listDecoderManifests(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDecoderManifestsAsync(array $args = [])\n * @method \\Aws\\Result listFleets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFleetsAsync(array $args = [])\n * @method \\Aws\\Result listFleetsForVehicle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFleetsForVehicleAsync(array $args = [])\n * @method \\Aws\\Result listModelManifestNodes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listModelManifestNodesAsync(array $args = [])\n * @method \\Aws\\Result listModelManifests(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listModelManifestsAsync(array $args = [])\n * @method \\Aws\\Result listSignalCatalogNodes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSignalCatalogNodesAsync(array $args = [])\n * @method \\Aws\\Result listSignalCatalogs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSignalCatalogsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listVehicles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVehiclesAsync(array $args = [])\n * @method \\Aws\\Result listVehiclesInFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVehiclesInFleetAsync(array $args = [])\n * @method \\Aws\\Result putLoggingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putLoggingOptionsAsync(array $args = [])\n * @method \\Aws\\Result registerAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerAccountAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCampaignAsync(array $args = [])\n * @method \\Aws\\Result updateDecoderManifest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDecoderManifestAsync(array $args = [])\n * @method \\Aws\\Result updateFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFleetAsync(array $args = [])\n * @method \\Aws\\Result updateModelManifest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateModelManifestAsync(array $args = [])\n * @method \\Aws\\Result updateSignalCatalog(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSignalCatalogAsync(array $args = [])\n * @method \\Aws\\Result updateVehicle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVehicleAsync(array $args = [])\n */\nclass IoTFleetWiseClient extends AwsClient {}\n", "num_lines": 110}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTFleetWise\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT FleetWise** service.\n */\nclass IoTFleetWiseException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTJobsDataPlane;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT Jobs Data Plane** service.\n * @method \\Aws\\Result describeJobExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJobExecutionAsync(array $args = [])\n * @method \\Aws\\Result getPendingJobExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPendingJobExecutionsAsync(array $args = [])\n * @method \\Aws\\Result startNextPendingJobExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startNextPendingJobExecutionAsync(array $args = [])\n * @method \\Aws\\Result updateJobExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateJobExecutionAsync(array $args = [])\n */\nclass IoTJobsDataPlaneClient extends AwsClient {}\n", "num_lines": 18}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTJobsDataPlane\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT Jobs Data Plane** service.\n */\nclass IoTJobsDataPlaneException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTRoboRunner;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT RoboRunner** service.\n * @method \\Aws\\Result createDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDestinationAsync(array $args = [])\n * @method \\Aws\\Result createSite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSiteAsync(array $args = [])\n * @method \\Aws\\Result createWorker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkerAsync(array $args = [])\n * @method \\Aws\\Result createWorkerFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkerFleetAsync(array $args = [])\n * @method \\Aws\\Result deleteDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDestinationAsync(array $args = [])\n * @method \\Aws\\Result deleteSite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSiteAsync(array $args = [])\n * @method \\Aws\\Result deleteWorker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkerAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkerFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkerFleetAsync(array $args = [])\n * @method \\Aws\\Result getDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDestinationAsync(array $args = [])\n * @method \\Aws\\Result getSite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSiteAsync(array $args = [])\n * @method \\Aws\\Result getWorker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkerAsync(array $args = [])\n * @method \\Aws\\Result getWorkerFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkerFleetAsync(array $args = [])\n * @method \\Aws\\Result listDestinations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDestinationsAsync(array $args = [])\n * @method \\Aws\\Result listSites(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSitesAsync(array $args = [])\n * @method \\Aws\\Result listWorkerFleets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkerFleetsAsync(array $args = [])\n * @method \\Aws\\Result listWorkers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkersAsync(array $args = [])\n * @method \\Aws\\Result updateDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDestinationAsync(array $args = [])\n * @method \\Aws\\Result updateSite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSiteAsync(array $args = [])\n * @method \\Aws\\Result updateWorker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkerAsync(array $args = [])\n * @method \\Aws\\Result updateWorkerFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkerFleetAsync(array $args = [])\n */\nclass IoTRoboRunnerClient extends AwsClient {}\n", "num_lines": 50}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTRoboRunner\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT RoboRunner** service.\n */\nclass IoTRoboRunnerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTSecureTunneling;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT Secure Tunneling** service.\n * @method \\Aws\\Result closeTunnel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise closeTunnelAsync(array $args = [])\n * @method \\Aws\\Result describeTunnel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTunnelAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTunnels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTunnelsAsync(array $args = [])\n * @method \\Aws\\Result openTunnel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise openTunnelAsync(array $args = [])\n * @method \\Aws\\Result rotateTunnelAccessToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rotateTunnelAccessTokenAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass IoTSecureTunnelingClient extends AwsClient {}\n", "num_lines": 26}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTSecureTunneling\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT Secure Tunneling** service.\n */\nclass IoTSecureTunnelingException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTSiteWise;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT SiteWise** service.\n * @method \\Aws\\Result associateAssets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateAssetsAsync(array $args = [])\n * @method \\Aws\\Result associateTimeSeriesToAssetProperty(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateTimeSeriesToAssetPropertyAsync(array $args = [])\n * @method \\Aws\\Result batchAssociateProjectAssets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchAssociateProjectAssetsAsync(array $args = [])\n * @method \\Aws\\Result batchDisassociateProjectAssets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDisassociateProjectAssetsAsync(array $args = [])\n * @method \\Aws\\Result batchGetAssetPropertyAggregates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetAssetPropertyAggregatesAsync(array $args = [])\n * @method \\Aws\\Result batchGetAssetPropertyValue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetAssetPropertyValueAsync(array $args = [])\n * @method \\Aws\\Result batchGetAssetPropertyValueHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetAssetPropertyValueHistoryAsync(array $args = [])\n * @method \\Aws\\Result batchPutAssetPropertyValue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchPutAssetPropertyValueAsync(array $args = [])\n * @method \\Aws\\Result createAccessPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccessPolicyAsync(array $args = [])\n * @method \\Aws\\Result createAsset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAssetAsync(array $args = [])\n * @method \\Aws\\Result createAssetModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAssetModelAsync(array $args = [])\n * @method \\Aws\\Result createBulkImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBulkImportJobAsync(array $args = [])\n * @method \\Aws\\Result createDashboard(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDashboardAsync(array $args = [])\n * @method \\Aws\\Result createGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGatewayAsync(array $args = [])\n * @method \\Aws\\Result createPortal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPortalAsync(array $args = [])\n * @method \\Aws\\Result createProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProjectAsync(array $args = [])\n * @method \\Aws\\Result deleteAccessPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccessPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteAsset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAssetAsync(array $args = [])\n * @method \\Aws\\Result deleteAssetModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAssetModelAsync(array $args = [])\n * @method \\Aws\\Result deleteDashboard(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDashboardAsync(array $args = [])\n * @method \\Aws\\Result deleteGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGatewayAsync(array $args = [])\n * @method \\Aws\\Result deletePortal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePortalAsync(array $args = [])\n * @method \\Aws\\Result deleteProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProjectAsync(array $args = [])\n * @method \\Aws\\Result deleteTimeSeries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTimeSeriesAsync(array $args = [])\n * @method \\Aws\\Result describeAccessPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccessPolicyAsync(array $args = [])\n * @method \\Aws\\Result describeAsset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAssetAsync(array $args = [])\n * @method \\Aws\\Result describeAssetModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAssetModelAsync(array $args = [])\n * @method \\Aws\\Result describeAssetProperty(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAssetPropertyAsync(array $args = [])\n * @method \\Aws\\Result describeBulkImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBulkImportJobAsync(array $args = [])\n * @method \\Aws\\Result describeDashboard(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDashboardAsync(array $args = [])\n * @method \\Aws\\Result describeDefaultEncryptionConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDefaultEncryptionConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGatewayAsync(array $args = [])\n * @method \\Aws\\Result describeGatewayCapabilityConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGatewayCapabilityConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeLoggingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLoggingOptionsAsync(array $args = [])\n * @method \\Aws\\Result describePortal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePortalAsync(array $args = [])\n * @method \\Aws\\Result describeProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProjectAsync(array $args = [])\n * @method \\Aws\\Result describeStorageConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStorageConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeTimeSeries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTimeSeriesAsync(array $args = [])\n * @method \\Aws\\Result disassociateAssets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateAssetsAsync(array $args = [])\n * @method \\Aws\\Result disassociateTimeSeriesFromAssetProperty(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateTimeSeriesFromAssetPropertyAsync(array $args = [])\n * @method \\Aws\\Result getAssetPropertyAggregates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAssetPropertyAggregatesAsync(array $args = [])\n * @method \\Aws\\Result getAssetPropertyValue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAssetPropertyValueAsync(array $args = [])\n * @method \\Aws\\Result getAssetPropertyValueHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAssetPropertyValueHistoryAsync(array $args = [])\n * @method \\Aws\\Result getInterpolatedAssetPropertyValues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInterpolatedAssetPropertyValuesAsync(array $args = [])\n * @method \\Aws\\Result listAccessPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccessPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listAssetModelProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssetModelPropertiesAsync(array $args = [])\n * @method \\Aws\\Result listAssetModels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssetModelsAsync(array $args = [])\n * @method \\Aws\\Result listAssetProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssetPropertiesAsync(array $args = [])\n * @method \\Aws\\Result listAssetRelationships(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssetRelationshipsAsync(array $args = [])\n * @method \\Aws\\Result listAssets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssetsAsync(array $args = [])\n * @method \\Aws\\Result listAssociatedAssets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssociatedAssetsAsync(array $args = [])\n * @method \\Aws\\Result listBulkImportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBulkImportJobsAsync(array $args = [])\n * @method \\Aws\\Result listDashboards(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDashboardsAsync(array $args = [])\n * @method \\Aws\\Result listGateways(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGatewaysAsync(array $args = [])\n * @method \\Aws\\Result listPortals(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPortalsAsync(array $args = [])\n * @method \\Aws\\Result listProjectAssets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProjectAssetsAsync(array $args = [])\n * @method \\Aws\\Result listProjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProjectsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTimeSeries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTimeSeriesAsync(array $args = [])\n * @method \\Aws\\Result putDefaultEncryptionConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDefaultEncryptionConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putLoggingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putLoggingOptionsAsync(array $args = [])\n * @method \\Aws\\Result putStorageConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putStorageConfigurationAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAccessPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccessPolicyAsync(array $args = [])\n * @method \\Aws\\Result updateAsset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAssetAsync(array $args = [])\n * @method \\Aws\\Result updateAssetModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAssetModelAsync(array $args = [])\n * @method \\Aws\\Result updateAssetProperty(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAssetPropertyAsync(array $args = [])\n * @method \\Aws\\Result updateDashboard(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDashboardAsync(array $args = [])\n * @method \\Aws\\Result updateGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGatewayAsync(array $args = [])\n * @method \\Aws\\Result updateGatewayCapabilityConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGatewayCapabilityConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updatePortal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePortalAsync(array $args = [])\n * @method \\Aws\\Result updateProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProjectAsync(array $args = [])\n */\nclass IoTSiteWiseClient extends AwsClient {}\n", "num_lines": 156}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTSiteWise\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT SiteWise** service.\n */\nclass IoTSiteWiseException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTThingsGraph;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT Things Graph** service.\n * @method \\Aws\\Result associateEntityToThing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateEntityToThingAsync(array $args = [])\n * @method \\Aws\\Result createFlowTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFlowTemplateAsync(array $args = [])\n * @method \\Aws\\Result createSystemInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSystemInstanceAsync(array $args = [])\n * @method \\Aws\\Result createSystemTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSystemTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteFlowTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFlowTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNamespaceAsync(array $args = [])\n * @method \\Aws\\Result deleteSystemInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSystemInstanceAsync(array $args = [])\n * @method \\Aws\\Result deleteSystemTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSystemTemplateAsync(array $args = [])\n * @method \\Aws\\Result deploySystemInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deploySystemInstanceAsync(array $args = [])\n * @method \\Aws\\Result deprecateFlowTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deprecateFlowTemplateAsync(array $args = [])\n * @method \\Aws\\Result deprecateSystemTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deprecateSystemTemplateAsync(array $args = [])\n * @method \\Aws\\Result describeNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNamespaceAsync(array $args = [])\n * @method \\Aws\\Result dissociateEntityFromThing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise dissociateEntityFromThingAsync(array $args = [])\n * @method \\Aws\\Result getEntities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEntitiesAsync(array $args = [])\n * @method \\Aws\\Result getFlowTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFlowTemplateAsync(array $args = [])\n * @method \\Aws\\Result getFlowTemplateRevisions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFlowTemplateRevisionsAsync(array $args = [])\n * @method \\Aws\\Result getNamespaceDeletionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNamespaceDeletionStatusAsync(array $args = [])\n * @method \\Aws\\Result getSystemInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSystemInstanceAsync(array $args = [])\n * @method \\Aws\\Result getSystemTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSystemTemplateAsync(array $args = [])\n * @method \\Aws\\Result getSystemTemplateRevisions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSystemTemplateRevisionsAsync(array $args = [])\n * @method \\Aws\\Result getUploadStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUploadStatusAsync(array $args = [])\n * @method \\Aws\\Result listFlowExecutionMessages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFlowExecutionMessagesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result searchEntities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchEntitiesAsync(array $args = [])\n * @method \\Aws\\Result searchFlowExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchFlowExecutionsAsync(array $args = [])\n * @method \\Aws\\Result searchFlowTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchFlowTemplatesAsync(array $args = [])\n * @method \\Aws\\Result searchSystemInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchSystemInstancesAsync(array $args = [])\n * @method \\Aws\\Result searchSystemTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchSystemTemplatesAsync(array $args = [])\n * @method \\Aws\\Result searchThings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchThingsAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result undeploySystemInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise undeploySystemInstanceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateFlowTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFlowTemplateAsync(array $args = [])\n * @method \\Aws\\Result updateSystemTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSystemTemplateAsync(array $args = [])\n * @method \\Aws\\Result uploadEntityDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise uploadEntityDefinitionsAsync(array $args = [])\n */\nclass IoTThingsGraphClient extends AwsClient {}\n", "num_lines": 80}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTThingsGraph\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT Things Graph** service.\n */\nclass IoTThingsGraphException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTTwinMaker;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT TwinMaker** service.\n * @method \\Aws\\Result batchPutPropertyValues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchPutPropertyValuesAsync(array $args = [])\n * @method \\Aws\\Result createComponentType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createComponentTypeAsync(array $args = [])\n * @method \\Aws\\Result createEntity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEntityAsync(array $args = [])\n * @method \\Aws\\Result createScene(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSceneAsync(array $args = [])\n * @method \\Aws\\Result createSyncJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSyncJobAsync(array $args = [])\n * @method \\Aws\\Result createWorkspace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkspaceAsync(array $args = [])\n * @method \\Aws\\Result deleteComponentType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteComponentTypeAsync(array $args = [])\n * @method \\Aws\\Result deleteEntity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEntityAsync(array $args = [])\n * @method \\Aws\\Result deleteScene(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSceneAsync(array $args = [])\n * @method \\Aws\\Result deleteSyncJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSyncJobAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkspace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkspaceAsync(array $args = [])\n * @method \\Aws\\Result executeQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise executeQueryAsync(array $args = [])\n * @method \\Aws\\Result getComponentType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getComponentTypeAsync(array $args = [])\n * @method \\Aws\\Result getEntity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEntityAsync(array $args = [])\n * @method \\Aws\\Result getPricingPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPricingPlanAsync(array $args = [])\n * @method \\Aws\\Result getPropertyValue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPropertyValueAsync(array $args = [])\n * @method \\Aws\\Result getPropertyValueHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPropertyValueHistoryAsync(array $args = [])\n * @method \\Aws\\Result getScene(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSceneAsync(array $args = [])\n * @method \\Aws\\Result getSyncJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSyncJobAsync(array $args = [])\n * @method \\Aws\\Result getWorkspace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkspaceAsync(array $args = [])\n * @method \\Aws\\Result listComponentTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listComponentTypesAsync(array $args = [])\n * @method \\Aws\\Result listEntities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEntitiesAsync(array $args = [])\n * @method \\Aws\\Result listScenes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listScenesAsync(array $args = [])\n * @method \\Aws\\Result listSyncJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSyncJobsAsync(array $args = [])\n * @method \\Aws\\Result listSyncResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSyncResourcesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWorkspaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkspacesAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateComponentType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateComponentTypeAsync(array $args = [])\n * @method \\Aws\\Result updateEntity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEntityAsync(array $args = [])\n * @method \\Aws\\Result updatePricingPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePricingPlanAsync(array $args = [])\n * @method \\Aws\\Result updateScene(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSceneAsync(array $args = [])\n * @method \\Aws\\Result updateWorkspace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkspaceAsync(array $args = [])\n */\nclass IoTTwinMakerClient extends AwsClient {}\n", "num_lines": 78}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTTwinMaker\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT TwinMaker** service.\n */\nclass IoTTwinMakerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTWireless;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS IoT Wireless** service.\n * @method \\Aws\\Result associateAwsAccountWithPartnerAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateAwsAccountWithPartnerAccountAsync(array $args = [])\n * @method \\Aws\\Result associateMulticastGroupWithFuotaTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateMulticastGroupWithFuotaTaskAsync(array $args = [])\n * @method \\Aws\\Result associateWirelessDeviceWithFuotaTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateWirelessDeviceWithFuotaTaskAsync(array $args = [])\n * @method \\Aws\\Result associateWirelessDeviceWithMulticastGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateWirelessDeviceWithMulticastGroupAsync(array $args = [])\n * @method \\Aws\\Result associateWirelessDeviceWithThing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateWirelessDeviceWithThingAsync(array $args = [])\n * @method \\Aws\\Result associateWirelessGatewayWithCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateWirelessGatewayWithCertificateAsync(array $args = [])\n * @method \\Aws\\Result associateWirelessGatewayWithThing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateWirelessGatewayWithThingAsync(array $args = [])\n * @method \\Aws\\Result cancelMulticastGroupSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelMulticastGroupSessionAsync(array $args = [])\n * @method \\Aws\\Result createDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDestinationAsync(array $args = [])\n * @method \\Aws\\Result createDeviceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeviceProfileAsync(array $args = [])\n * @method \\Aws\\Result createFuotaTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFuotaTaskAsync(array $args = [])\n * @method \\Aws\\Result createMulticastGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMulticastGroupAsync(array $args = [])\n * @method \\Aws\\Result createNetworkAnalyzerConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNetworkAnalyzerConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createServiceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceProfileAsync(array $args = [])\n * @method \\Aws\\Result createWirelessDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWirelessDeviceAsync(array $args = [])\n * @method \\Aws\\Result createWirelessGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWirelessGatewayAsync(array $args = [])\n * @method \\Aws\\Result createWirelessGatewayTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWirelessGatewayTaskAsync(array $args = [])\n * @method \\Aws\\Result createWirelessGatewayTaskDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWirelessGatewayTaskDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDestinationAsync(array $args = [])\n * @method \\Aws\\Result deleteDeviceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDeviceProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteFuotaTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFuotaTaskAsync(array $args = [])\n * @method \\Aws\\Result deleteMulticastGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMulticastGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteNetworkAnalyzerConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNetworkAnalyzerConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteQueuedMessages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteQueuedMessagesAsync(array $args = [])\n * @method \\Aws\\Result deleteServiceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteWirelessDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWirelessDeviceAsync(array $args = [])\n * @method \\Aws\\Result deleteWirelessDeviceImportTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWirelessDeviceImportTaskAsync(array $args = [])\n * @method \\Aws\\Result deleteWirelessGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWirelessGatewayAsync(array $args = [])\n * @method \\Aws\\Result deleteWirelessGatewayTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWirelessGatewayTaskAsync(array $args = [])\n * @method \\Aws\\Result deleteWirelessGatewayTaskDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWirelessGatewayTaskDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deregisterWirelessDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterWirelessDeviceAsync(array $args = [])\n * @method \\Aws\\Result disassociateAwsAccountFromPartnerAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateAwsAccountFromPartnerAccountAsync(array $args = [])\n * @method \\Aws\\Result disassociateMulticastGroupFromFuotaTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateMulticastGroupFromFuotaTaskAsync(array $args = [])\n * @method \\Aws\\Result disassociateWirelessDeviceFromFuotaTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateWirelessDeviceFromFuotaTaskAsync(array $args = [])\n * @method \\Aws\\Result disassociateWirelessDeviceFromMulticastGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateWirelessDeviceFromMulticastGroupAsync(array $args = [])\n * @method \\Aws\\Result disassociateWirelessDeviceFromThing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateWirelessDeviceFromThingAsync(array $args = [])\n * @method \\Aws\\Result disassociateWirelessGatewayFromCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateWirelessGatewayFromCertificateAsync(array $args = [])\n * @method \\Aws\\Result disassociateWirelessGatewayFromThing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateWirelessGatewayFromThingAsync(array $args = [])\n * @method \\Aws\\Result getDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDestinationAsync(array $args = [])\n * @method \\Aws\\Result getDeviceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeviceProfileAsync(array $args = [])\n * @method \\Aws\\Result getEventConfigurationByResourceTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEventConfigurationByResourceTypesAsync(array $args = [])\n * @method \\Aws\\Result getFuotaTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFuotaTaskAsync(array $args = [])\n * @method \\Aws\\Result getLogLevelsByResourceTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLogLevelsByResourceTypesAsync(array $args = [])\n * @method \\Aws\\Result getMulticastGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMulticastGroupAsync(array $args = [])\n * @method \\Aws\\Result getMulticastGroupSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMulticastGroupSessionAsync(array $args = [])\n * @method \\Aws\\Result getNetworkAnalyzerConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNetworkAnalyzerConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getPartnerAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPartnerAccountAsync(array $args = [])\n * @method \\Aws\\Result getPosition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPositionAsync(array $args = [])\n * @method \\Aws\\Result getPositionConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPositionConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getPositionEstimate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPositionEstimateAsync(array $args = [])\n * @method \\Aws\\Result getResourceEventConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceEventConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getResourceLogLevel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceLogLevelAsync(array $args = [])\n * @method \\Aws\\Result getResourcePosition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcePositionAsync(array $args = [])\n * @method \\Aws\\Result getServiceEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceEndpointAsync(array $args = [])\n * @method \\Aws\\Result getServiceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceProfileAsync(array $args = [])\n * @method \\Aws\\Result getWirelessDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWirelessDeviceAsync(array $args = [])\n * @method \\Aws\\Result getWirelessDeviceImportTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWirelessDeviceImportTaskAsync(array $args = [])\n * @method \\Aws\\Result getWirelessDeviceStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWirelessDeviceStatisticsAsync(array $args = [])\n * @method \\Aws\\Result getWirelessGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWirelessGatewayAsync(array $args = [])\n * @method \\Aws\\Result getWirelessGatewayCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWirelessGatewayCertificateAsync(array $args = [])\n * @method \\Aws\\Result getWirelessGatewayFirmwareInformation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWirelessGatewayFirmwareInformationAsync(array $args = [])\n * @method \\Aws\\Result getWirelessGatewayStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWirelessGatewayStatisticsAsync(array $args = [])\n * @method \\Aws\\Result getWirelessGatewayTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWirelessGatewayTaskAsync(array $args = [])\n * @method \\Aws\\Result getWirelessGatewayTaskDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWirelessGatewayTaskDefinitionAsync(array $args = [])\n * @method \\Aws\\Result listDestinations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDestinationsAsync(array $args = [])\n * @method \\Aws\\Result listDeviceProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeviceProfilesAsync(array $args = [])\n * @method \\Aws\\Result listDevicesForWirelessDeviceImportTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDevicesForWirelessDeviceImportTaskAsync(array $args = [])\n * @method \\Aws\\Result listEventConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listFuotaTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFuotaTasksAsync(array $args = [])\n * @method \\Aws\\Result listMulticastGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMulticastGroupsAsync(array $args = [])\n * @method \\Aws\\Result listMulticastGroupsByFuotaTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMulticastGroupsByFuotaTaskAsync(array $args = [])\n * @method \\Aws\\Result listNetworkAnalyzerConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNetworkAnalyzerConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listPartnerAccounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPartnerAccountsAsync(array $args = [])\n * @method \\Aws\\Result listPositionConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPositionConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listQueuedMessages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listQueuedMessagesAsync(array $args = [])\n * @method \\Aws\\Result listServiceProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServiceProfilesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWirelessDeviceImportTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWirelessDeviceImportTasksAsync(array $args = [])\n * @method \\Aws\\Result listWirelessDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWirelessDevicesAsync(array $args = [])\n * @method \\Aws\\Result listWirelessGatewayTaskDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWirelessGatewayTaskDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listWirelessGateways(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWirelessGatewaysAsync(array $args = [])\n * @method \\Aws\\Result putPositionConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPositionConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putResourceLogLevel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourceLogLevelAsync(array $args = [])\n * @method \\Aws\\Result resetAllResourceLogLevels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetAllResourceLogLevelsAsync(array $args = [])\n * @method \\Aws\\Result resetResourceLogLevel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetResourceLogLevelAsync(array $args = [])\n * @method \\Aws\\Result sendDataToMulticastGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendDataToMulticastGroupAsync(array $args = [])\n * @method \\Aws\\Result sendDataToWirelessDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendDataToWirelessDeviceAsync(array $args = [])\n * @method \\Aws\\Result startBulkAssociateWirelessDeviceWithMulticastGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startBulkAssociateWirelessDeviceWithMulticastGroupAsync(array $args = [])\n * @method \\Aws\\Result startBulkDisassociateWirelessDeviceFromMulticastGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startBulkDisassociateWirelessDeviceFromMulticastGroupAsync(array $args = [])\n * @method \\Aws\\Result startFuotaTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startFuotaTaskAsync(array $args = [])\n * @method \\Aws\\Result startMulticastGroupSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMulticastGroupSessionAsync(array $args = [])\n * @method \\Aws\\Result startSingleWirelessDeviceImportTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSingleWirelessDeviceImportTaskAsync(array $args = [])\n * @method \\Aws\\Result startWirelessDeviceImportTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startWirelessDeviceImportTaskAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result testWirelessDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testWirelessDeviceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDestinationAsync(array $args = [])\n * @method \\Aws\\Result updateEventConfigurationByResourceTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEventConfigurationByResourceTypesAsync(array $args = [])\n * @method \\Aws\\Result updateFuotaTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFuotaTaskAsync(array $args = [])\n * @method \\Aws\\Result updateLogLevelsByResourceTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLogLevelsByResourceTypesAsync(array $args = [])\n * @method \\Aws\\Result updateMulticastGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMulticastGroupAsync(array $args = [])\n * @method \\Aws\\Result updateNetworkAnalyzerConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNetworkAnalyzerConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updatePartnerAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePartnerAccountAsync(array $args = [])\n * @method \\Aws\\Result updatePosition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePositionAsync(array $args = [])\n * @method \\Aws\\Result updateResourceEventConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResourceEventConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateResourcePosition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResourcePositionAsync(array $args = [])\n * @method \\Aws\\Result updateWirelessDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWirelessDeviceAsync(array $args = [])\n * @method \\Aws\\Result updateWirelessDeviceImportTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWirelessDeviceImportTaskAsync(array $args = [])\n * @method \\Aws\\Result updateWirelessGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWirelessGatewayAsync(array $args = [])\n */\nclass IoTWirelessClient extends AwsClient {}\n", "num_lines": 228}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IoTWireless\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS IoT Wireless** service.\n */\nclass IoTWirelessException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IVS;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Interactive Video Service** service.\n * @method \\Aws\\Result batchGetChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetChannelAsync(array $args = [])\n * @method \\Aws\\Result batchGetStreamKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetStreamKeyAsync(array $args = [])\n * @method \\Aws\\Result batchStartViewerSessionRevocation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchStartViewerSessionRevocationAsync(array $args = [])\n * @method \\Aws\\Result createChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelAsync(array $args = [])\n * @method \\Aws\\Result createRecordingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRecordingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createStreamKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStreamKeyAsync(array $args = [])\n * @method \\Aws\\Result deleteChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelAsync(array $args = [])\n * @method \\Aws\\Result deletePlaybackKeyPair(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePlaybackKeyPairAsync(array $args = [])\n * @method \\Aws\\Result deleteRecordingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRecordingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteStreamKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStreamKeyAsync(array $args = [])\n * @method \\Aws\\Result getChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChannelAsync(array $args = [])\n * @method \\Aws\\Result getPlaybackKeyPair(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPlaybackKeyPairAsync(array $args = [])\n * @method \\Aws\\Result getRecordingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRecordingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStreamAsync(array $args = [])\n * @method \\Aws\\Result getStreamKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStreamKeyAsync(array $args = [])\n * @method \\Aws\\Result getStreamSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStreamSessionAsync(array $args = [])\n * @method \\Aws\\Result importPlaybackKeyPair(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importPlaybackKeyPairAsync(array $args = [])\n * @method \\Aws\\Result listChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelsAsync(array $args = [])\n * @method \\Aws\\Result listPlaybackKeyPairs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPlaybackKeyPairsAsync(array $args = [])\n * @method \\Aws\\Result listRecordingConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecordingConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listStreamKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStreamKeysAsync(array $args = [])\n * @method \\Aws\\Result listStreamSessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStreamSessionsAsync(array $args = [])\n * @method \\Aws\\Result listStreams(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStreamsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putMetadataAsync(array $args = [])\n * @method \\Aws\\Result startViewerSessionRevocation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startViewerSessionRevocationAsync(array $args = [])\n * @method \\Aws\\Result stopStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopStreamAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChannelAsync(array $args = [])\n */\nclass IVSClient extends AwsClient {}\n", "num_lines": 70}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IVS\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Interactive Video Service** service.\n */\nclass IVSException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IVSRealTime;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Interactive Video Service RealTime** service.\n * @method \\Aws\\Result createParticipantToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createParticipantTokenAsync(array $args = [])\n * @method \\Aws\\Result createStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStageAsync(array $args = [])\n * @method \\Aws\\Result deleteStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStageAsync(array $args = [])\n * @method \\Aws\\Result disconnectParticipant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disconnectParticipantAsync(array $args = [])\n * @method \\Aws\\Result getParticipant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getParticipantAsync(array $args = [])\n * @method \\Aws\\Result getStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStageAsync(array $args = [])\n * @method \\Aws\\Result getStageSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStageSessionAsync(array $args = [])\n * @method \\Aws\\Result listParticipantEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listParticipantEventsAsync(array $args = [])\n * @method \\Aws\\Result listParticipants(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listParticipantsAsync(array $args = [])\n * @method \\Aws\\Result listStageSessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStageSessionsAsync(array $args = [])\n * @method \\Aws\\Result listStages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStagesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStageAsync(array $args = [])\n */\nclass IVSRealTimeClient extends AwsClient {}\n", "num_lines": 40}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\IVSRealTime\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Interactive Video Service RealTime** service.\n */\nclass IVSRealTimeException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Kafka;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Managed Streaming for Kafka** service.\n * @method \\Aws\\Result batchAssociateScramSecret(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchAssociateScramSecretAsync(array $args = [])\n * @method \\Aws\\Result createCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClusterAsync(array $args = [])\n * @method \\Aws\\Result createClusterV2(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClusterV2Async(array $args = [])\n * @method \\Aws\\Result createConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createVpcConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpcConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClusterAsync(array $args = [])\n * @method \\Aws\\Result deleteConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteVpcConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpcConnectionAsync(array $args = [])\n * @method \\Aws\\Result describeCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClusterAsync(array $args = [])\n * @method \\Aws\\Result describeClusterV2(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClusterV2Async(array $args = [])\n * @method \\Aws\\Result describeClusterOperation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClusterOperationAsync(array $args = [])\n * @method \\Aws\\Result describeConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeConfigurationRevision(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConfigurationRevisionAsync(array $args = [])\n * @method \\Aws\\Result describeVpcConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcConnectionAsync(array $args = [])\n * @method \\Aws\\Result batchDisassociateScramSecret(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDisassociateScramSecretAsync(array $args = [])\n * @method \\Aws\\Result getBootstrapBrokers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBootstrapBrokersAsync(array $args = [])\n * @method \\Aws\\Result getCompatibleKafkaVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCompatibleKafkaVersionsAsync(array $args = [])\n * @method \\Aws\\Result listClusterOperations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listClusterOperationsAsync(array $args = [])\n * @method \\Aws\\Result listClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listClustersAsync(array $args = [])\n * @method \\Aws\\Result listClustersV2(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listClustersV2Async(array $args = [])\n * @method \\Aws\\Result listConfigurationRevisions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConfigurationRevisionsAsync(array $args = [])\n * @method \\Aws\\Result listConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listKafkaVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listKafkaVersionsAsync(array $args = [])\n * @method \\Aws\\Result listNodes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNodesAsync(array $args = [])\n * @method \\Aws\\Result listScramSecrets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listScramSecretsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listClientVpcConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listClientVpcConnectionsAsync(array $args = [])\n * @method \\Aws\\Result listVpcConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVpcConnectionsAsync(array $args = [])\n * @method \\Aws\\Result rejectClientVpcConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectClientVpcConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteClusterPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClusterPolicyAsync(array $args = [])\n * @method \\Aws\\Result getClusterPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getClusterPolicyAsync(array $args = [])\n * @method \\Aws\\Result putClusterPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putClusterPolicyAsync(array $args = [])\n * @method \\Aws\\Result rebootBroker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebootBrokerAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateBrokerCount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBrokerCountAsync(array $args = [])\n * @method \\Aws\\Result updateBrokerType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBrokerTypeAsync(array $args = [])\n * @method \\Aws\\Result updateBrokerStorage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBrokerStorageAsync(array $args = [])\n * @method \\Aws\\Result updateConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateClusterConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateClusterConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateClusterKafkaVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateClusterKafkaVersionAsync(array $args = [])\n * @method \\Aws\\Result updateConnectivity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConnectivityAsync(array $args = [])\n * @method \\Aws\\Result updateMonitoring(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMonitoringAsync(array $args = [])\n * @method \\Aws\\Result updateSecurity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSecurityAsync(array $args = [])\n * @method \\Aws\\Result updateStorage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStorageAsync(array $args = [])\n */\nclass KafkaClient extends AwsClient {}\n", "num_lines": 100}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Kafka\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Managed Streaming for Kafka** service.\n */\nclass KafkaException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KafkaConnect;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Managed Streaming for Kafka Connect** service.\n * @method \\Aws\\Result createConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConnectorAsync(array $args = [])\n * @method \\Aws\\Result createCustomPlugin(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCustomPluginAsync(array $args = [])\n * @method \\Aws\\Result createWorkerConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkerConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectorAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomPlugin(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomPluginAsync(array $args = [])\n * @method \\Aws\\Result describeConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConnectorAsync(array $args = [])\n * @method \\Aws\\Result describeCustomPlugin(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCustomPluginAsync(array $args = [])\n * @method \\Aws\\Result describeWorkerConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkerConfigurationAsync(array $args = [])\n * @method \\Aws\\Result listConnectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConnectorsAsync(array $args = [])\n * @method \\Aws\\Result listCustomPlugins(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCustomPluginsAsync(array $args = [])\n * @method \\Aws\\Result listWorkerConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkerConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result updateConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConnectorAsync(array $args = [])\n */\nclass KafkaConnectClient extends AwsClient {}\n", "num_lines": 34}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KafkaConnect\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Managed Streaming for Kafka Connect** service.\n */\nclass KafkaConnectException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KendraRanking;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Kendra Intelligent Ranking** service.\n * @method \\Aws\\Result createRescoreExecutionPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRescoreExecutionPlanAsync(array $args = [])\n * @method \\Aws\\Result deleteRescoreExecutionPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRescoreExecutionPlanAsync(array $args = [])\n * @method \\Aws\\Result describeRescoreExecutionPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRescoreExecutionPlanAsync(array $args = [])\n * @method \\Aws\\Result listRescoreExecutionPlans(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRescoreExecutionPlansAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result rescore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rescoreAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateRescoreExecutionPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRescoreExecutionPlanAsync(array $args = [])\n */\nclass KendraRankingClient extends AwsClient {}\n", "num_lines": 28}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KendraRanking\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Kendra Intelligent Ranking** service.\n */\nclass KendraRankingException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Keyspaces;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Keyspaces** service.\n * @method \\Aws\\Result createKeyspace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createKeyspaceAsync(array $args = [])\n * @method \\Aws\\Result createTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTableAsync(array $args = [])\n * @method \\Aws\\Result deleteKeyspace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteKeyspaceAsync(array $args = [])\n * @method \\Aws\\Result deleteTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTableAsync(array $args = [])\n * @method \\Aws\\Result getKeyspace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getKeyspaceAsync(array $args = [])\n * @method \\Aws\\Result getTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTableAsync(array $args = [])\n * @method \\Aws\\Result listKeyspaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listKeyspacesAsync(array $args = [])\n * @method \\Aws\\Result listTables(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTablesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result restoreTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreTableAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTableAsync(array $args = [])\n */\nclass KeyspacesClient extends AwsClient {}\n", "num_lines": 36}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Keyspaces\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Keyspaces** service.\n */\nclass KeyspacesException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Kinesis;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Kinesis** service.\n *\n * @method \\Aws\\Result addTagsToStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsToStreamAsync(array $args = [])\n * @method \\Aws\\Result createStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStreamAsync(array $args = [])\n * @method \\Aws\\Result decreaseStreamRetentionPeriod(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise decreaseStreamRetentionPeriodAsync(array $args = [])\n * @method \\Aws\\Result deleteStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStreamAsync(array $args = [])\n * @method \\Aws\\Result deregisterStreamConsumer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterStreamConsumerAsync(array $args = [])\n * @method \\Aws\\Result describeLimits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLimitsAsync(array $args = [])\n * @method \\Aws\\Result describeStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStreamAsync(array $args = [])\n * @method \\Aws\\Result describeStreamConsumer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStreamConsumerAsync(array $args = [])\n * @method \\Aws\\Result describeStreamSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStreamSummaryAsync(array $args = [])\n * @method \\Aws\\Result disableEnhancedMonitoring(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableEnhancedMonitoringAsync(array $args = [])\n * @method \\Aws\\Result enableEnhancedMonitoring(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableEnhancedMonitoringAsync(array $args = [])\n * @method \\Aws\\Result getRecords(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRecordsAsync(array $args = [])\n * @method \\Aws\\Result getShardIterator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getShardIteratorAsync(array $args = [])\n * @method \\Aws\\Result increaseStreamRetentionPeriod(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise increaseStreamRetentionPeriodAsync(array $args = [])\n * @method \\Aws\\Result listShards(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listShardsAsync(array $args = [])\n * @method \\Aws\\Result listStreamConsumers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStreamConsumersAsync(array $args = [])\n * @method \\Aws\\Result listStreams(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStreamsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForStreamAsync(array $args = [])\n * @method \\Aws\\Result mergeShards(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise mergeShardsAsync(array $args = [])\n * @method \\Aws\\Result putRecord(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRecordAsync(array $args = [])\n * @method \\Aws\\Result putRecords(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRecordsAsync(array $args = [])\n * @method \\Aws\\Result registerStreamConsumer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerStreamConsumerAsync(array $args = [])\n * @method \\Aws\\Result removeTagsFromStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsFromStreamAsync(array $args = [])\n * @method \\Aws\\Result splitShard(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise splitShardAsync(array $args = [])\n * @method \\Aws\\Result startStreamEncryption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startStreamEncryptionAsync(array $args = [])\n * @method \\Aws\\Result stopStreamEncryption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopStreamEncryptionAsync(array $args = [])\n * @method \\Aws\\Result updateShardCount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateShardCountAsync(array $args = [])\n * @method \\Aws\\Result updateStreamMode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStreamModeAsync(array $args = [])\n */\nclass KinesisClient extends AwsClient {}\n", "num_lines": 67}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Kinesis\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon Kinesis service.\n */\nclass KinesisException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KinesisAnalytics;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Kinesis Analytics** service.\n * @method \\Aws\\Result addApplicationCloudWatchLoggingOption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addApplicationCloudWatchLoggingOptionAsync(array $args = [])\n * @method \\Aws\\Result addApplicationInput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addApplicationInputAsync(array $args = [])\n * @method \\Aws\\Result addApplicationInputProcessingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addApplicationInputProcessingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result addApplicationOutput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addApplicationOutputAsync(array $args = [])\n * @method \\Aws\\Result addApplicationReferenceDataSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addApplicationReferenceDataSourceAsync(array $args = [])\n * @method \\Aws\\Result createApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteApplicationCloudWatchLoggingOption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationCloudWatchLoggingOptionAsync(array $args = [])\n * @method \\Aws\\Result deleteApplicationInputProcessingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationInputProcessingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteApplicationOutput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationOutputAsync(array $args = [])\n * @method \\Aws\\Result deleteApplicationReferenceDataSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationReferenceDataSourceAsync(array $args = [])\n * @method \\Aws\\Result describeApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeApplicationAsync(array $args = [])\n * @method \\Aws\\Result discoverInputSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise discoverInputSchemaAsync(array $args = [])\n * @method \\Aws\\Result listApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startApplicationAsync(array $args = [])\n * @method \\Aws\\Result stopApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopApplicationAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationAsync(array $args = [])\n */\nclass KinesisAnalyticsClient extends AwsClient {}\n", "num_lines": 50}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KinesisAnalytics\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Kinesis Analytics** service.\n */\nclass KinesisAnalyticsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KinesisAnalyticsV2;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Kinesis Analytics** service.\n * @method \\Aws\\Result addApplicationCloudWatchLoggingOption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addApplicationCloudWatchLoggingOptionAsync(array $args = [])\n * @method \\Aws\\Result addApplicationInput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addApplicationInputAsync(array $args = [])\n * @method \\Aws\\Result addApplicationInputProcessingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addApplicationInputProcessingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result addApplicationOutput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addApplicationOutputAsync(array $args = [])\n * @method \\Aws\\Result addApplicationReferenceDataSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addApplicationReferenceDataSourceAsync(array $args = [])\n * @method \\Aws\\Result addApplicationVpcConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addApplicationVpcConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationAsync(array $args = [])\n * @method \\Aws\\Result createApplicationPresignedUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationPresignedUrlAsync(array $args = [])\n * @method \\Aws\\Result createApplicationSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteApplicationCloudWatchLoggingOption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationCloudWatchLoggingOptionAsync(array $args = [])\n * @method \\Aws\\Result deleteApplicationInputProcessingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationInputProcessingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteApplicationOutput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationOutputAsync(array $args = [])\n * @method \\Aws\\Result deleteApplicationReferenceDataSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationReferenceDataSourceAsync(array $args = [])\n * @method \\Aws\\Result deleteApplicationSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteApplicationVpcConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationVpcConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeApplicationAsync(array $args = [])\n * @method \\Aws\\Result describeApplicationSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeApplicationSnapshotAsync(array $args = [])\n * @method \\Aws\\Result describeApplicationVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeApplicationVersionAsync(array $args = [])\n * @method \\Aws\\Result discoverInputSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise discoverInputSchemaAsync(array $args = [])\n * @method \\Aws\\Result listApplicationSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result listApplicationVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationVersionsAsync(array $args = [])\n * @method \\Aws\\Result listApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result rollbackApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rollbackApplicationAsync(array $args = [])\n * @method \\Aws\\Result startApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startApplicationAsync(array $args = [])\n * @method \\Aws\\Result stopApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopApplicationAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationAsync(array $args = [])\n * @method \\Aws\\Result updateApplicationMaintenanceConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationMaintenanceConfigurationAsync(array $args = [])\n */\nclass KinesisAnalyticsV2Client extends AwsClient {}\n", "num_lines": 72}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KinesisAnalyticsV2\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Kinesis Analytics** service.\n */\nclass KinesisAnalyticsV2Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KinesisVideo;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Kinesis Video Streams** service.\n * @method \\Aws\\Result createSignalingChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSignalingChannelAsync(array $args = [])\n * @method \\Aws\\Result createStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStreamAsync(array $args = [])\n * @method \\Aws\\Result deleteEdgeConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEdgeConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteSignalingChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSignalingChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStreamAsync(array $args = [])\n * @method \\Aws\\Result describeEdgeConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEdgeConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeImageGenerationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImageGenerationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeMappedResourceConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMappedResourceConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeMediaStorageConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMediaStorageConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeNotificationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNotificationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeSignalingChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSignalingChannelAsync(array $args = [])\n * @method \\Aws\\Result describeStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStreamAsync(array $args = [])\n * @method \\Aws\\Result getDataEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataEndpointAsync(array $args = [])\n * @method \\Aws\\Result getSignalingChannelEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSignalingChannelEndpointAsync(array $args = [])\n * @method \\Aws\\Result listEdgeAgentConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEdgeAgentConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listSignalingChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSignalingChannelsAsync(array $args = [])\n * @method \\Aws\\Result listStreams(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStreamsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTagsForStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForStreamAsync(array $args = [])\n * @method \\Aws\\Result startEdgeConfigurationUpdate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startEdgeConfigurationUpdateAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result tagStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagStreamAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagStreamAsync(array $args = [])\n * @method \\Aws\\Result updateDataRetention(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDataRetentionAsync(array $args = [])\n * @method \\Aws\\Result updateImageGenerationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateImageGenerationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateMediaStorageConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMediaStorageConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateNotificationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNotificationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateSignalingChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSignalingChannelAsync(array $args = [])\n * @method \\Aws\\Result updateStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStreamAsync(array $args = [])\n */\nclass KinesisVideoClient extends AwsClient {}\n", "num_lines": 70}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KinesisVideo\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Kinesis Video Streams** service.\n */\nclass KinesisVideoException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KinesisVideoArchivedMedia;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Kinesis Video Streams Archived Media** service.\n * @method \\Aws\\Result getClip(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getClipAsync(array $args = [])\n * @method \\Aws\\Result getDASHStreamingSessionURL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDASHStreamingSessionURLAsync(array $args = [])\n * @method \\Aws\\Result getHLSStreamingSessionURL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getHLSStreamingSessionURLAsync(array $args = [])\n * @method \\Aws\\Result getImages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getImagesAsync(array $args = [])\n * @method \\Aws\\Result getMediaForFragmentList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMediaForFragmentListAsync(array $args = [])\n * @method \\Aws\\Result listFragments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFragmentsAsync(array $args = [])\n */\nclass KinesisVideoArchivedMediaClient extends AwsClient {}\n", "num_lines": 22}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KinesisVideoArchivedMedia\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Kinesis Video Streams Archived Media** service.\n */\nclass KinesisVideoArchivedMediaException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KinesisVideoMedia;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Kinesis Video Streams Media** service.\n * @method \\Aws\\Result getMedia(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMediaAsync(array $args = [])\n */\nclass KinesisVideoMediaClient extends AwsClient {}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KinesisVideoMedia\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Kinesis Video Streams Media** service.\n */\nclass KinesisVideoMediaException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KinesisVideoSignalingChannels;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Kinesis Video Signaling Channels** service.\n * @method \\Aws\\Result getIceServerConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIceServerConfigAsync(array $args = [])\n * @method \\Aws\\Result sendAlexaOfferToMaster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendAlexaOfferToMasterAsync(array $args = [])\n */\nclass KinesisVideoSignalingChannelsClient extends AwsClient {}\n", "num_lines": 14}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KinesisVideoSignalingChannels\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Kinesis Video Signaling Channels** service.\n */\nclass KinesisVideoSignalingChannelsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KinesisVideoWebRTCStorage;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Kinesis Video WebRTC Storage** service.\n * @method \\Aws\\Result joinStorageSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise joinStorageSessionAsync(array $args = [])\n */\nclass KinesisVideoWebRTCStorageClient extends AwsClient {}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\KinesisVideoWebRTCStorage\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Kinesis Video WebRTC Storage** service.\n */\nclass KinesisVideoWebRTCStorageException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Kms;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Key Management Service**.\n *\n * @method \\Aws\\Result cancelKeyDeletion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelKeyDeletionAsync(array $args = [])\n * @method \\Aws\\Result connectCustomKeyStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise connectCustomKeyStoreAsync(array $args = [])\n * @method \\Aws\\Result createAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAliasAsync(array $args = [])\n * @method \\Aws\\Result createCustomKeyStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCustomKeyStoreAsync(array $args = [])\n * @method \\Aws\\Result createGrant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGrantAsync(array $args = [])\n * @method \\Aws\\Result createKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createKeyAsync(array $args = [])\n * @method \\Aws\\Result decrypt(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise decryptAsync(array $args = [])\n * @method \\Aws\\Result deleteAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAliasAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomKeyStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomKeyStoreAsync(array $args = [])\n * @method \\Aws\\Result deleteImportedKeyMaterial(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteImportedKeyMaterialAsync(array $args = [])\n * @method \\Aws\\Result describeCustomKeyStores(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCustomKeyStoresAsync(array $args = [])\n * @method \\Aws\\Result describeKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeKeyAsync(array $args = [])\n * @method \\Aws\\Result disableKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableKeyAsync(array $args = [])\n * @method \\Aws\\Result disableKeyRotation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableKeyRotationAsync(array $args = [])\n * @method \\Aws\\Result disconnectCustomKeyStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disconnectCustomKeyStoreAsync(array $args = [])\n * @method \\Aws\\Result enableKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableKeyAsync(array $args = [])\n * @method \\Aws\\Result enableKeyRotation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableKeyRotationAsync(array $args = [])\n * @method \\Aws\\Result encrypt(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise encryptAsync(array $args = [])\n * @method \\Aws\\Result generateDataKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateDataKeyAsync(array $args = [])\n * @method \\Aws\\Result generateDataKeyPair(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateDataKeyPairAsync(array $args = [])\n * @method \\Aws\\Result generateDataKeyPairWithoutPlaintext(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateDataKeyPairWithoutPlaintextAsync(array $args = [])\n * @method \\Aws\\Result generateDataKeyWithoutPlaintext(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateDataKeyWithoutPlaintextAsync(array $args = [])\n * @method \\Aws\\Result generateMac(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateMacAsync(array $args = [])\n * @method \\Aws\\Result generateRandom(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateRandomAsync(array $args = [])\n * @method \\Aws\\Result getKeyPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getKeyPolicyAsync(array $args = [])\n * @method \\Aws\\Result getKeyRotationStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getKeyRotationStatusAsync(array $args = [])\n * @method \\Aws\\Result getParametersForImport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getParametersForImportAsync(array $args = [])\n * @method \\Aws\\Result getPublicKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPublicKeyAsync(array $args = [])\n * @method \\Aws\\Result importKeyMaterial(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importKeyMaterialAsync(array $args = [])\n * @method \\Aws\\Result listAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAliasesAsync(array $args = [])\n * @method \\Aws\\Result listGrants(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGrantsAsync(array $args = [])\n * @method \\Aws\\Result listKeyPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listKeyPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listKeysAsync(array $args = [])\n * @method \\Aws\\Result listResourceTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceTagsAsync(array $args = [])\n * @method \\Aws\\Result listRetirableGrants(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRetirableGrantsAsync(array $args = [])\n * @method \\Aws\\Result putKeyPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putKeyPolicyAsync(array $args = [])\n * @method \\Aws\\Result reEncrypt(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise reEncryptAsync(array $args = [])\n * @method \\Aws\\Result replicateKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise replicateKeyAsync(array $args = [])\n * @method \\Aws\\Result retireGrant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise retireGrantAsync(array $args = [])\n * @method \\Aws\\Result revokeGrant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeGrantAsync(array $args = [])\n * @method \\Aws\\Result scheduleKeyDeletion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise scheduleKeyDeletionAsync(array $args = [])\n * @method \\Aws\\Result sign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise signAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAliasAsync(array $args = [])\n * @method \\Aws\\Result updateCustomKeyStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCustomKeyStoreAsync(array $args = [])\n * @method \\Aws\\Result updateKeyDescription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateKeyDescriptionAsync(array $args = [])\n * @method \\Aws\\Result updatePrimaryRegion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePrimaryRegionAsync(array $args = [])\n * @method \\Aws\\Result verify(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise verifyAsync(array $args = [])\n * @method \\Aws\\Result verifyMac(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise verifyMacAsync(array $args = [])\n */\nclass KmsClient extends AwsClient {}\n", "num_lines": 111}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Kms\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the AWS Key Management Service.\n */\nclass KmsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LakeFormation;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Lake Formation** service.\n * @method \\Aws\\Result addLFTagsToResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addLFTagsToResourceAsync(array $args = [])\n * @method \\Aws\\Result assumeDecoratedRoleWithSAML(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise assumeDecoratedRoleWithSAMLAsync(array $args = [])\n * @method \\Aws\\Result batchGrantPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGrantPermissionsAsync(array $args = [])\n * @method \\Aws\\Result batchRevokePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchRevokePermissionsAsync(array $args = [])\n * @method \\Aws\\Result cancelTransaction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelTransactionAsync(array $args = [])\n * @method \\Aws\\Result commitTransaction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise commitTransactionAsync(array $args = [])\n * @method \\Aws\\Result createDataCellsFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataCellsFilterAsync(array $args = [])\n * @method \\Aws\\Result createLFTag(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLFTagAsync(array $args = [])\n * @method \\Aws\\Result deleteDataCellsFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataCellsFilterAsync(array $args = [])\n * @method \\Aws\\Result deleteLFTag(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLFTagAsync(array $args = [])\n * @method \\Aws\\Result deleteObjectsOnCancel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteObjectsOnCancelAsync(array $args = [])\n * @method \\Aws\\Result deregisterResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterResourceAsync(array $args = [])\n * @method \\Aws\\Result describeResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeResourceAsync(array $args = [])\n * @method \\Aws\\Result describeTransaction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTransactionAsync(array $args = [])\n * @method \\Aws\\Result extendTransaction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise extendTransactionAsync(array $args = [])\n * @method \\Aws\\Result getDataCellsFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataCellsFilterAsync(array $args = [])\n * @method \\Aws\\Result getDataLakeSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataLakeSettingsAsync(array $args = [])\n * @method \\Aws\\Result getEffectivePermissionsForPath(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEffectivePermissionsForPathAsync(array $args = [])\n * @method \\Aws\\Result getLFTag(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLFTagAsync(array $args = [])\n * @method \\Aws\\Result getQueryState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getQueryStateAsync(array $args = [])\n * @method \\Aws\\Result getQueryStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getQueryStatisticsAsync(array $args = [])\n * @method \\Aws\\Result getResourceLFTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceLFTagsAsync(array $args = [])\n * @method \\Aws\\Result getTableObjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTableObjectsAsync(array $args = [])\n * @method \\Aws\\Result getTemporaryGluePartitionCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTemporaryGluePartitionCredentialsAsync(array $args = [])\n * @method \\Aws\\Result getTemporaryGlueTableCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTemporaryGlueTableCredentialsAsync(array $args = [])\n * @method \\Aws\\Result getWorkUnitResults(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkUnitResultsAsync(array $args = [])\n * @method \\Aws\\Result getWorkUnits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkUnitsAsync(array $args = [])\n * @method \\Aws\\Result grantPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise grantPermissionsAsync(array $args = [])\n * @method \\Aws\\Result listDataCellsFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataCellsFilterAsync(array $args = [])\n * @method \\Aws\\Result listLFTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLFTagsAsync(array $args = [])\n * @method \\Aws\\Result listPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPermissionsAsync(array $args = [])\n * @method \\Aws\\Result listResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourcesAsync(array $args = [])\n * @method \\Aws\\Result listTableStorageOptimizers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTableStorageOptimizersAsync(array $args = [])\n * @method \\Aws\\Result listTransactions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTransactionsAsync(array $args = [])\n * @method \\Aws\\Result putDataLakeSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDataLakeSettingsAsync(array $args = [])\n * @method \\Aws\\Result registerResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerResourceAsync(array $args = [])\n * @method \\Aws\\Result removeLFTagsFromResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeLFTagsFromResourceAsync(array $args = [])\n * @method \\Aws\\Result revokePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokePermissionsAsync(array $args = [])\n * @method \\Aws\\Result searchDatabasesByLFTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchDatabasesByLFTagsAsync(array $args = [])\n * @method \\Aws\\Result searchTablesByLFTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchTablesByLFTagsAsync(array $args = [])\n * @method \\Aws\\Result startQueryPlanning(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startQueryPlanningAsync(array $args = [])\n * @method \\Aws\\Result startTransaction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startTransactionAsync(array $args = [])\n * @method \\Aws\\Result updateDataCellsFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDataCellsFilterAsync(array $args = [])\n * @method \\Aws\\Result updateLFTag(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLFTagAsync(array $args = [])\n * @method \\Aws\\Result updateResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResourceAsync(array $args = [])\n * @method \\Aws\\Result updateTableObjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTableObjectsAsync(array $args = [])\n * @method \\Aws\\Result updateTableStorageOptimizer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTableStorageOptimizerAsync(array $args = [])\n */\nclass LakeFormationClient extends AwsClient {}\n", "num_lines": 104}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LakeFormation\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Lake Formation** service.\n */\nclass LakeFormationException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Lambda;\n\nuse Aws\\AwsClient;\nuse Aws\\CommandInterface;\nuse Aws\\Middleware;\n\n/**\n * This client is used to interact with AWS Lambda\n *\n * @method \\Aws\\Result addLayerVersionPermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addLayerVersionPermissionAsync(array $args = [])\n * @method \\Aws\\Result addPermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addPermissionAsync(array $args = [])\n * @method \\Aws\\Result createAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAliasAsync(array $args = [])\n * @method \\Aws\\Result createCodeSigningConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCodeSigningConfigAsync(array $args = [])\n * @method \\Aws\\Result createEventSourceMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEventSourceMappingAsync(array $args = [])\n * @method \\Aws\\Result createFunction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFunctionAsync(array $args = [])\n * @method \\Aws\\Result createFunctionUrlConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFunctionUrlConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAliasAsync(array $args = [])\n * @method \\Aws\\Result deleteCodeSigningConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCodeSigningConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteEventSourceMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventSourceMappingAsync(array $args = [])\n * @method \\Aws\\Result deleteFunction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFunctionAsync(array $args = [])\n * @method \\Aws\\Result deleteFunctionCodeSigningConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFunctionCodeSigningConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteFunctionConcurrency(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFunctionConcurrencyAsync(array $args = [])\n * @method \\Aws\\Result deleteFunctionEventInvokeConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFunctionEventInvokeConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteFunctionUrlConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFunctionUrlConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteLayerVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLayerVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteProvisionedConcurrencyConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProvisionedConcurrencyConfigAsync(array $args = [])\n * @method \\Aws\\Result getAccountSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountSettingsAsync(array $args = [])\n * @method \\Aws\\Result getAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAliasAsync(array $args = [])\n * @method \\Aws\\Result getCodeSigningConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCodeSigningConfigAsync(array $args = [])\n * @method \\Aws\\Result getEventSourceMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEventSourceMappingAsync(array $args = [])\n * @method \\Aws\\Result getFunction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFunctionAsync(array $args = [])\n * @method \\Aws\\Result getFunctionCodeSigningConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFunctionCodeSigningConfigAsync(array $args = [])\n * @method \\Aws\\Result getFunctionConcurrency(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFunctionConcurrencyAsync(array $args = [])\n * @method \\Aws\\Result getFunctionConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFunctionConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getFunctionEventInvokeConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFunctionEventInvokeConfigAsync(array $args = [])\n * @method \\Aws\\Result getFunctionUrlConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFunctionUrlConfigAsync(array $args = [])\n * @method \\Aws\\Result getLayerVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLayerVersionAsync(array $args = [])\n * @method \\Aws\\Result getLayerVersionByArn(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLayerVersionByArnAsync(array $args = [])\n * @method \\Aws\\Result getLayerVersionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLayerVersionPolicyAsync(array $args = [])\n * @method \\Aws\\Result getPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPolicyAsync(array $args = [])\n * @method \\Aws\\Result getProvisionedConcurrencyConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProvisionedConcurrencyConfigAsync(array $args = [])\n * @method \\Aws\\Result getRuntimeManagementConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRuntimeManagementConfigAsync(array $args = [])\n * @method \\Aws\\Result invoke(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise invokeAsync(array $args = [])\n * @method \\Aws\\Result invokeAsync(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise invokeAsyncAsync(array $args = [])\n * @method \\Aws\\Result invokeWithResponseStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise invokeWithResponseStreamAsync(array $args = [])\n * @method \\Aws\\Result listAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAliasesAsync(array $args = [])\n * @method \\Aws\\Result listCodeSigningConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCodeSigningConfigsAsync(array $args = [])\n * @method \\Aws\\Result listEventSourceMappings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventSourceMappingsAsync(array $args = [])\n * @method \\Aws\\Result listFunctionEventInvokeConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFunctionEventInvokeConfigsAsync(array $args = [])\n * @method \\Aws\\Result listFunctionUrlConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFunctionUrlConfigsAsync(array $args = [])\n * @method \\Aws\\Result listFunctions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFunctionsAsync(array $args = [])\n * @method \\Aws\\Result listFunctionsByCodeSigningConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFunctionsByCodeSigningConfigAsync(array $args = [])\n * @method \\Aws\\Result listLayerVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLayerVersionsAsync(array $args = [])\n * @method \\Aws\\Result listLayers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLayersAsync(array $args = [])\n * @method \\Aws\\Result listProvisionedConcurrencyConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProvisionedConcurrencyConfigsAsync(array $args = [])\n * @method \\Aws\\Result listTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsAsync(array $args = [])\n * @method \\Aws\\Result listVersionsByFunction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVersionsByFunctionAsync(array $args = [])\n * @method \\Aws\\Result publishLayerVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise publishLayerVersionAsync(array $args = [])\n * @method \\Aws\\Result publishVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise publishVersionAsync(array $args = [])\n * @method \\Aws\\Result putFunctionCodeSigningConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putFunctionCodeSigningConfigAsync(array $args = [])\n * @method \\Aws\\Result putFunctionConcurrency(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putFunctionConcurrencyAsync(array $args = [])\n * @method \\Aws\\Result putFunctionEventInvokeConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putFunctionEventInvokeConfigAsync(array $args = [])\n * @method \\Aws\\Result putProvisionedConcurrencyConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putProvisionedConcurrencyConfigAsync(array $args = [])\n * @method \\Aws\\Result putRuntimeManagementConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRuntimeManagementConfigAsync(array $args = [])\n * @method \\Aws\\Result removeLayerVersionPermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeLayerVersionPermissionAsync(array $args = [])\n * @method \\Aws\\Result removePermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removePermissionAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAliasAsync(array $args = [])\n * @method \\Aws\\Result updateCodeSigningConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCodeSigningConfigAsync(array $args = [])\n * @method \\Aws\\Result updateEventSourceMapping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEventSourceMappingAsync(array $args = [])\n * @method \\Aws\\Result updateFunctionCode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFunctionCodeAsync(array $args = [])\n * @method \\Aws\\Result updateFunctionConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFunctionConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateFunctionEventInvokeConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFunctionEventInvokeConfigAsync(array $args = [])\n * @method \\Aws\\Result updateFunctionUrlConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFunctionUrlConfigAsync(array $args = [])\n */\nclass LambdaClient extends AwsClient\n{\n    /**\n     * {@inheritdoc}\n     */\n    public function __construct(array $args)\n    {\n        parent::__construct($args);\n        $list = $this->getHandlerList();\n        if (extension_loaded('curl')) {\n            $list->appendInit($this->getDefaultCurlOptionsMiddleware());\n        }\n    }\n\n    /**\n     * Provides a middleware that sets default Curl options for the command\n     *\n     * @return callable\n     */\n    public function getDefaultCurlOptionsMiddleware()\n    {\n        return Middleware::mapCommand(function (CommandInterface $cmd) {\n            $defaultCurlOptions = [\n                CURLOPT_TCP_KEEPALIVE => 1,\n            ];\n            if (!isset($cmd['@http']['curl'])) {\n                $cmd['@http']['curl'] = $defaultCurlOptions;\n            } else {\n                $cmd['@http']['curl'] += $defaultCurlOptions;\n            }\n            return $cmd;\n        });\n    }\n}\n", "num_lines": 178}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Lambda\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with AWS Lambda\n */\nclass LambdaException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LexModelBuildingService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Lex Model Building Service** service.\n * @method \\Aws\\Result createBotVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBotVersionAsync(array $args = [])\n * @method \\Aws\\Result createIntentVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIntentVersionAsync(array $args = [])\n * @method \\Aws\\Result createSlotTypeVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSlotTypeVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBotAsync(array $args = [])\n * @method \\Aws\\Result deleteBotAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBotAliasAsync(array $args = [])\n * @method \\Aws\\Result deleteBotChannelAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBotChannelAssociationAsync(array $args = [])\n * @method \\Aws\\Result deleteBotVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBotVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteIntent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIntentAsync(array $args = [])\n * @method \\Aws\\Result deleteIntentVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIntentVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteSlotType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSlotTypeAsync(array $args = [])\n * @method \\Aws\\Result deleteSlotTypeVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSlotTypeVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteUtterances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUtterancesAsync(array $args = [])\n * @method \\Aws\\Result getBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBotAsync(array $args = [])\n * @method \\Aws\\Result getBotAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBotAliasAsync(array $args = [])\n * @method \\Aws\\Result getBotAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBotAliasesAsync(array $args = [])\n * @method \\Aws\\Result getBotChannelAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBotChannelAssociationAsync(array $args = [])\n * @method \\Aws\\Result getBotChannelAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBotChannelAssociationsAsync(array $args = [])\n * @method \\Aws\\Result getBotVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBotVersionsAsync(array $args = [])\n * @method \\Aws\\Result getBots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBotsAsync(array $args = [])\n * @method \\Aws\\Result getBuiltinIntent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBuiltinIntentAsync(array $args = [])\n * @method \\Aws\\Result getBuiltinIntents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBuiltinIntentsAsync(array $args = [])\n * @method \\Aws\\Result getBuiltinSlotTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBuiltinSlotTypesAsync(array $args = [])\n * @method \\Aws\\Result getExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExportAsync(array $args = [])\n * @method \\Aws\\Result getImport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getImportAsync(array $args = [])\n * @method \\Aws\\Result getIntent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIntentAsync(array $args = [])\n * @method \\Aws\\Result getIntentVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIntentVersionsAsync(array $args = [])\n * @method \\Aws\\Result getIntents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIntentsAsync(array $args = [])\n * @method \\Aws\\Result getMigration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMigrationAsync(array $args = [])\n * @method \\Aws\\Result getMigrations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMigrationsAsync(array $args = [])\n * @method \\Aws\\Result getSlotType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSlotTypeAsync(array $args = [])\n * @method \\Aws\\Result getSlotTypeVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSlotTypeVersionsAsync(array $args = [])\n * @method \\Aws\\Result getSlotTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSlotTypesAsync(array $args = [])\n * @method \\Aws\\Result getUtterancesView(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUtterancesViewAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBotAsync(array $args = [])\n * @method \\Aws\\Result putBotAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBotAliasAsync(array $args = [])\n * @method \\Aws\\Result putIntent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putIntentAsync(array $args = [])\n * @method \\Aws\\Result putSlotType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSlotTypeAsync(array $args = [])\n * @method \\Aws\\Result startImport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startImportAsync(array $args = [])\n * @method \\Aws\\Result startMigration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMigrationAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass LexModelBuildingServiceClient extends AwsClient {}\n", "num_lines": 94}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LexModelBuildingService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Lex Model Building Service** service.\n */\nclass LexModelBuildingServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LexModelsV2;\n\nuse Aws\\AwsClient;\nuse Aws\\CommandInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * This client is used to interact with the **Amazon Lex Model Building V2** service.\n * @method \\Aws\\Result batchCreateCustomVocabularyItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchCreateCustomVocabularyItemAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteCustomVocabularyItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteCustomVocabularyItemAsync(array $args = [])\n * @method \\Aws\\Result batchUpdateCustomVocabularyItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdateCustomVocabularyItemAsync(array $args = [])\n * @method \\Aws\\Result buildBotLocale(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise buildBotLocaleAsync(array $args = [])\n * @method \\Aws\\Result createBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBotAsync(array $args = [])\n * @method \\Aws\\Result createBotAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBotAliasAsync(array $args = [])\n * @method \\Aws\\Result createBotLocale(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBotLocaleAsync(array $args = [])\n * @method \\Aws\\Result createBotVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBotVersionAsync(array $args = [])\n * @method \\Aws\\Result createExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createExportAsync(array $args = [])\n * @method \\Aws\\Result createIntent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIntentAsync(array $args = [])\n * @method \\Aws\\Result createResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result createResourcePolicyStatement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResourcePolicyStatementAsync(array $args = [])\n * @method \\Aws\\Result createSlot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSlotAsync(array $args = [])\n * @method \\Aws\\Result createSlotType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSlotTypeAsync(array $args = [])\n * @method \\Aws\\Result createTestSetDiscrepancyReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTestSetDiscrepancyReportAsync(array $args = [])\n * @method \\Aws\\Result createUploadUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUploadUrlAsync(array $args = [])\n * @method \\Aws\\Result deleteBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBotAsync(array $args = [])\n * @method \\Aws\\Result deleteBotAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBotAliasAsync(array $args = [])\n * @method \\Aws\\Result deleteBotLocale(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBotLocaleAsync(array $args = [])\n * @method \\Aws\\Result deleteBotVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBotVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomVocabulary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomVocabularyAsync(array $args = [])\n * @method \\Aws\\Result deleteExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteExportAsync(array $args = [])\n * @method \\Aws\\Result deleteImport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteImportAsync(array $args = [])\n * @method \\Aws\\Result deleteIntent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIntentAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicyStatement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyStatementAsync(array $args = [])\n * @method \\Aws\\Result deleteSlot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSlotAsync(array $args = [])\n * @method \\Aws\\Result deleteSlotType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSlotTypeAsync(array $args = [])\n * @method \\Aws\\Result deleteTestSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTestSetAsync(array $args = [])\n * @method \\Aws\\Result deleteUtterances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUtterancesAsync(array $args = [])\n * @method \\Aws\\Result describeBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBotAsync(array $args = [])\n * @method \\Aws\\Result describeBotAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBotAliasAsync(array $args = [])\n * @method \\Aws\\Result describeBotLocale(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBotLocaleAsync(array $args = [])\n * @method \\Aws\\Result describeBotRecommendation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBotRecommendationAsync(array $args = [])\n * @method \\Aws\\Result describeBotVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBotVersionAsync(array $args = [])\n * @method \\Aws\\Result describeCustomVocabularyMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCustomVocabularyMetadataAsync(array $args = [])\n * @method \\Aws\\Result describeExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeExportAsync(array $args = [])\n * @method \\Aws\\Result describeImport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImportAsync(array $args = [])\n * @method \\Aws\\Result describeIntent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeIntentAsync(array $args = [])\n * @method \\Aws\\Result describeResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result describeSlot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSlotAsync(array $args = [])\n * @method \\Aws\\Result describeSlotType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSlotTypeAsync(array $args = [])\n * @method \\Aws\\Result describeTestExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTestExecutionAsync(array $args = [])\n * @method \\Aws\\Result describeTestSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTestSetAsync(array $args = [])\n * @method \\Aws\\Result describeTestSetDiscrepancyReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTestSetDiscrepancyReportAsync(array $args = [])\n * @method \\Aws\\Result describeTestSetGeneration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTestSetGenerationAsync(array $args = [])\n * @method \\Aws\\Result getTestExecutionArtifactsUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTestExecutionArtifactsUrlAsync(array $args = [])\n * @method \\Aws\\Result listAggregatedUtterances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAggregatedUtterancesAsync(array $args = [])\n * @method \\Aws\\Result listBotAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBotAliasesAsync(array $args = [])\n * @method \\Aws\\Result listBotLocales(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBotLocalesAsync(array $args = [])\n * @method \\Aws\\Result listBotRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBotRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result listBotVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBotVersionsAsync(array $args = [])\n * @method \\Aws\\Result listBots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBotsAsync(array $args = [])\n * @method \\Aws\\Result listBuiltInIntents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBuiltInIntentsAsync(array $args = [])\n * @method \\Aws\\Result listBuiltInSlotTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBuiltInSlotTypesAsync(array $args = [])\n * @method \\Aws\\Result listCustomVocabularyItems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCustomVocabularyItemsAsync(array $args = [])\n * @method \\Aws\\Result listExports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExportsAsync(array $args = [])\n * @method \\Aws\\Result listImports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listImportsAsync(array $args = [])\n * @method \\Aws\\Result listIntents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIntentsAsync(array $args = [])\n * @method \\Aws\\Result listRecommendedIntents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecommendedIntentsAsync(array $args = [])\n * @method \\Aws\\Result listSlotTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSlotTypesAsync(array $args = [])\n * @method \\Aws\\Result listSlots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSlotsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTestExecutionResultItems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTestExecutionResultItemsAsync(array $args = [])\n * @method \\Aws\\Result listTestExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTestExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listTestSetRecords(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTestSetRecordsAsync(array $args = [])\n * @method \\Aws\\Result listTestSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTestSetsAsync(array $args = [])\n * @method \\Aws\\Result searchAssociatedTranscripts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchAssociatedTranscriptsAsync(array $args = [])\n * @method \\Aws\\Result startBotRecommendation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startBotRecommendationAsync(array $args = [])\n * @method \\Aws\\Result startImport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startImportAsync(array $args = [])\n * @method \\Aws\\Result startTestExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startTestExecutionAsync(array $args = [])\n * @method \\Aws\\Result startTestSetGeneration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startTestSetGenerationAsync(array $args = [])\n * @method \\Aws\\Result stopBotRecommendation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopBotRecommendationAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateBot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBotAsync(array $args = [])\n * @method \\Aws\\Result updateBotAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBotAliasAsync(array $args = [])\n * @method \\Aws\\Result updateBotLocale(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBotLocaleAsync(array $args = [])\n * @method \\Aws\\Result updateBotRecommendation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBotRecommendationAsync(array $args = [])\n * @method \\Aws\\Result updateExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateExportAsync(array $args = [])\n * @method \\Aws\\Result updateIntent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIntentAsync(array $args = [])\n * @method \\Aws\\Result updateResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result updateSlot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSlotAsync(array $args = [])\n * @method \\Aws\\Result updateSlotType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSlotTypeAsync(array $args = [])\n * @method \\Aws\\Result updateTestSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTestSetAsync(array $args = [])\n */\nclass LexModelsV2Client extends AwsClient {}\n", "num_lines": 182}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LexModelsV2\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Lex Model Building V2** service.\n */\nclass LexModelsV2Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LexRuntimeService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Lex Runtime Service** service.\n * @method \\Aws\\Result deleteSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSessionAsync(array $args = [])\n * @method \\Aws\\Result getSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSessionAsync(array $args = [])\n * @method \\Aws\\Result postContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise postContentAsync(array $args = [])\n * @method \\Aws\\Result postText(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise postTextAsync(array $args = [])\n * @method \\Aws\\Result putSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSessionAsync(array $args = [])\n */\nclass LexRuntimeServiceClient extends AwsClient {}\n", "num_lines": 20}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LexRuntimeService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Lex Runtime Service** service.\n */\nclass LexRuntimeServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LexRuntimeV2;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Lex Runtime V2** service.\n * @method \\Aws\\Result deleteSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSessionAsync(array $args = [])\n * @method \\Aws\\Result getSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSessionAsync(array $args = [])\n * @method \\Aws\\Result putSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSessionAsync(array $args = [])\n * @method \\Aws\\Result recognizeText(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise recognizeTextAsync(array $args = [])\n * @method \\Aws\\Result recognizeUtterance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise recognizeUtteranceAsync(array $args = [])\n */\nclass LexRuntimeV2Client extends AwsClient {}\n", "num_lines": 20}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LexRuntimeV2\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Lex Runtime V2** service.\n */\nclass LexRuntimeV2Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LicenseManager;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS License Manager** service.\n * @method \\Aws\\Result acceptGrant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptGrantAsync(array $args = [])\n * @method \\Aws\\Result checkInLicense(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise checkInLicenseAsync(array $args = [])\n * @method \\Aws\\Result checkoutBorrowLicense(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise checkoutBorrowLicenseAsync(array $args = [])\n * @method \\Aws\\Result checkoutLicense(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise checkoutLicenseAsync(array $args = [])\n * @method \\Aws\\Result createGrant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGrantAsync(array $args = [])\n * @method \\Aws\\Result createGrantVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGrantVersionAsync(array $args = [])\n * @method \\Aws\\Result createLicense(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLicenseAsync(array $args = [])\n * @method \\Aws\\Result createLicenseConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLicenseConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createLicenseConversionTaskForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLicenseConversionTaskForResourceAsync(array $args = [])\n * @method \\Aws\\Result createLicenseManagerReportGenerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLicenseManagerReportGeneratorAsync(array $args = [])\n * @method \\Aws\\Result createLicenseVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLicenseVersionAsync(array $args = [])\n * @method \\Aws\\Result createToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTokenAsync(array $args = [])\n * @method \\Aws\\Result deleteGrant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGrantAsync(array $args = [])\n * @method \\Aws\\Result deleteLicense(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLicenseAsync(array $args = [])\n * @method \\Aws\\Result deleteLicenseConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLicenseConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteLicenseManagerReportGenerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLicenseManagerReportGeneratorAsync(array $args = [])\n * @method \\Aws\\Result deleteToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTokenAsync(array $args = [])\n * @method \\Aws\\Result extendLicenseConsumption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise extendLicenseConsumptionAsync(array $args = [])\n * @method \\Aws\\Result getAccessToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccessTokenAsync(array $args = [])\n * @method \\Aws\\Result getGrant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGrantAsync(array $args = [])\n * @method \\Aws\\Result getLicense(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLicenseAsync(array $args = [])\n * @method \\Aws\\Result getLicenseConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLicenseConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getLicenseConversionTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLicenseConversionTaskAsync(array $args = [])\n * @method \\Aws\\Result getLicenseManagerReportGenerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLicenseManagerReportGeneratorAsync(array $args = [])\n * @method \\Aws\\Result getLicenseUsage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLicenseUsageAsync(array $args = [])\n * @method \\Aws\\Result getServiceSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceSettingsAsync(array $args = [])\n * @method \\Aws\\Result listAssociationsForLicenseConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssociationsForLicenseConfigurationAsync(array $args = [])\n * @method \\Aws\\Result listDistributedGrants(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDistributedGrantsAsync(array $args = [])\n * @method \\Aws\\Result listFailuresForLicenseConfigurationOperations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFailuresForLicenseConfigurationOperationsAsync(array $args = [])\n * @method \\Aws\\Result listLicenseConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLicenseConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listLicenseConversionTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLicenseConversionTasksAsync(array $args = [])\n * @method \\Aws\\Result listLicenseManagerReportGenerators(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLicenseManagerReportGeneratorsAsync(array $args = [])\n * @method \\Aws\\Result listLicenseSpecificationsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLicenseSpecificationsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listLicenseVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLicenseVersionsAsync(array $args = [])\n * @method \\Aws\\Result listLicenses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLicensesAsync(array $args = [])\n * @method \\Aws\\Result listReceivedGrants(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReceivedGrantsAsync(array $args = [])\n * @method \\Aws\\Result listReceivedGrantsForOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReceivedGrantsForOrganizationAsync(array $args = [])\n * @method \\Aws\\Result listReceivedLicenses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReceivedLicensesAsync(array $args = [])\n * @method \\Aws\\Result listReceivedLicensesForOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReceivedLicensesForOrganizationAsync(array $args = [])\n * @method \\Aws\\Result listResourceInventory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceInventoryAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTokens(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTokensAsync(array $args = [])\n * @method \\Aws\\Result listUsageForLicenseConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUsageForLicenseConfigurationAsync(array $args = [])\n * @method \\Aws\\Result rejectGrant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectGrantAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateLicenseConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLicenseConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateLicenseManagerReportGenerator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLicenseManagerReportGeneratorAsync(array $args = [])\n * @method \\Aws\\Result updateLicenseSpecificationsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLicenseSpecificationsForResourceAsync(array $args = [])\n * @method \\Aws\\Result updateServiceSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceSettingsAsync(array $args = [])\n */\nclass LicenseManagerClient extends AwsClient {}\n", "num_lines": 110}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LicenseManager\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS License Manager** service.\n */\nclass LicenseManagerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LicenseManagerLinuxSubscriptions;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS License Manager Linux Subscriptions** service.\n * @method \\Aws\\Result getServiceSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceSettingsAsync(array $args = [])\n * @method \\Aws\\Result listLinuxSubscriptionInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLinuxSubscriptionInstancesAsync(array $args = [])\n * @method \\Aws\\Result listLinuxSubscriptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLinuxSubscriptionsAsync(array $args = [])\n * @method \\Aws\\Result updateServiceSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceSettingsAsync(array $args = [])\n */\nclass LicenseManagerLinuxSubscriptionsClient extends AwsClient {}\n", "num_lines": 18}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LicenseManagerLinuxSubscriptions\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS License Manager Linux Subscriptions** service.\n */\nclass LicenseManagerLinuxSubscriptionsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LicenseManagerUserSubscriptions;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS License Manager User Subscriptions** service.\n * @method \\Aws\\Result associateUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateUserAsync(array $args = [])\n * @method \\Aws\\Result deregisterIdentityProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterIdentityProviderAsync(array $args = [])\n * @method \\Aws\\Result disassociateUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateUserAsync(array $args = [])\n * @method \\Aws\\Result listIdentityProviders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIdentityProvidersAsync(array $args = [])\n * @method \\Aws\\Result listInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInstancesAsync(array $args = [])\n * @method \\Aws\\Result listProductSubscriptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProductSubscriptionsAsync(array $args = [])\n * @method \\Aws\\Result listUserAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUserAssociationsAsync(array $args = [])\n * @method \\Aws\\Result registerIdentityProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerIdentityProviderAsync(array $args = [])\n * @method \\Aws\\Result startProductSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startProductSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result stopProductSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopProductSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result updateIdentityProviderSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIdentityProviderSettingsAsync(array $args = [])\n */\nclass LicenseManagerUserSubscriptionsClient extends AwsClient {}\n", "num_lines": 32}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LicenseManagerUserSubscriptions\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS License Manager User Subscriptions** service.\n */\nclass LicenseManagerUserSubscriptionsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Lightsail;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Lightsail** service.\n * @method \\Aws\\Result allocateStaticIp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise allocateStaticIpAsync(array $args = [])\n * @method \\Aws\\Result attachCertificateToDistribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachCertificateToDistributionAsync(array $args = [])\n * @method \\Aws\\Result attachDisk(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachDiskAsync(array $args = [])\n * @method \\Aws\\Result attachInstancesToLoadBalancer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachInstancesToLoadBalancerAsync(array $args = [])\n * @method \\Aws\\Result attachLoadBalancerTlsCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachLoadBalancerTlsCertificateAsync(array $args = [])\n * @method \\Aws\\Result attachStaticIp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachStaticIpAsync(array $args = [])\n * @method \\Aws\\Result closeInstancePublicPorts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise closeInstancePublicPortsAsync(array $args = [])\n * @method \\Aws\\Result copySnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copySnapshotAsync(array $args = [])\n * @method \\Aws\\Result createBucket(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBucketAsync(array $args = [])\n * @method \\Aws\\Result createBucketAccessKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBucketAccessKeyAsync(array $args = [])\n * @method \\Aws\\Result createCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCertificateAsync(array $args = [])\n * @method \\Aws\\Result createCloudFormationStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCloudFormationStackAsync(array $args = [])\n * @method \\Aws\\Result createContactMethod(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createContactMethodAsync(array $args = [])\n * @method \\Aws\\Result createContainerService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createContainerServiceAsync(array $args = [])\n * @method \\Aws\\Result createContainerServiceDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createContainerServiceDeploymentAsync(array $args = [])\n * @method \\Aws\\Result createContainerServiceRegistryLogin(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createContainerServiceRegistryLoginAsync(array $args = [])\n * @method \\Aws\\Result createDisk(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDiskAsync(array $args = [])\n * @method \\Aws\\Result createDiskFromSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDiskFromSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createDiskSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDiskSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createDistribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDistributionAsync(array $args = [])\n * @method \\Aws\\Result createDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDomainAsync(array $args = [])\n * @method \\Aws\\Result createDomainEntry(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDomainEntryAsync(array $args = [])\n * @method \\Aws\\Result createGUISessionAccessDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGUISessionAccessDetailsAsync(array $args = [])\n * @method \\Aws\\Result createInstanceSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInstanceSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInstancesAsync(array $args = [])\n * @method \\Aws\\Result createInstancesFromSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInstancesFromSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createKeyPair(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createKeyPairAsync(array $args = [])\n * @method \\Aws\\Result createLoadBalancer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLoadBalancerAsync(array $args = [])\n * @method \\Aws\\Result createLoadBalancerTlsCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLoadBalancerTlsCertificateAsync(array $args = [])\n * @method \\Aws\\Result createRelationalDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRelationalDatabaseAsync(array $args = [])\n * @method \\Aws\\Result createRelationalDatabaseFromSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRelationalDatabaseFromSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createRelationalDatabaseSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRelationalDatabaseSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteAlarm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAlarmAsync(array $args = [])\n * @method \\Aws\\Result deleteAutoSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAutoSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteBucket(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketAccessKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketAccessKeyAsync(array $args = [])\n * @method \\Aws\\Result deleteCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCertificateAsync(array $args = [])\n * @method \\Aws\\Result deleteContactMethod(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteContactMethodAsync(array $args = [])\n * @method \\Aws\\Result deleteContainerImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteContainerImageAsync(array $args = [])\n * @method \\Aws\\Result deleteContainerService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteContainerServiceAsync(array $args = [])\n * @method \\Aws\\Result deleteDisk(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDiskAsync(array $args = [])\n * @method \\Aws\\Result deleteDiskSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDiskSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteDistribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDistributionAsync(array $args = [])\n * @method \\Aws\\Result deleteDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainAsync(array $args = [])\n * @method \\Aws\\Result deleteDomainEntry(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainEntryAsync(array $args = [])\n * @method \\Aws\\Result deleteInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInstanceAsync(array $args = [])\n * @method \\Aws\\Result deleteInstanceSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInstanceSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteKeyPair(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteKeyPairAsync(array $args = [])\n * @method \\Aws\\Result deleteKnownHostKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteKnownHostKeysAsync(array $args = [])\n * @method \\Aws\\Result deleteLoadBalancer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLoadBalancerAsync(array $args = [])\n * @method \\Aws\\Result deleteLoadBalancerTlsCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLoadBalancerTlsCertificateAsync(array $args = [])\n * @method \\Aws\\Result deleteRelationalDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRelationalDatabaseAsync(array $args = [])\n * @method \\Aws\\Result deleteRelationalDatabaseSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRelationalDatabaseSnapshotAsync(array $args = [])\n * @method \\Aws\\Result detachCertificateFromDistribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachCertificateFromDistributionAsync(array $args = [])\n * @method \\Aws\\Result detachDisk(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachDiskAsync(array $args = [])\n * @method \\Aws\\Result detachInstancesFromLoadBalancer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachInstancesFromLoadBalancerAsync(array $args = [])\n * @method \\Aws\\Result detachStaticIp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachStaticIpAsync(array $args = [])\n * @method \\Aws\\Result disableAddOn(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableAddOnAsync(array $args = [])\n * @method \\Aws\\Result downloadDefaultKeyPair(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise downloadDefaultKeyPairAsync(array $args = [])\n * @method \\Aws\\Result enableAddOn(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableAddOnAsync(array $args = [])\n * @method \\Aws\\Result exportSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportSnapshotAsync(array $args = [])\n * @method \\Aws\\Result getActiveNames(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getActiveNamesAsync(array $args = [])\n * @method \\Aws\\Result getAlarms(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAlarmsAsync(array $args = [])\n * @method \\Aws\\Result getAutoSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAutoSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result getBlueprints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBlueprintsAsync(array $args = [])\n * @method \\Aws\\Result getBucketAccessKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketAccessKeysAsync(array $args = [])\n * @method \\Aws\\Result getBucketBundles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketBundlesAsync(array $args = [])\n * @method \\Aws\\Result getBucketMetricData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketMetricDataAsync(array $args = [])\n * @method \\Aws\\Result getBuckets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketsAsync(array $args = [])\n * @method \\Aws\\Result getBundles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBundlesAsync(array $args = [])\n * @method \\Aws\\Result getCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCertificatesAsync(array $args = [])\n * @method \\Aws\\Result getCloudFormationStackRecords(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCloudFormationStackRecordsAsync(array $args = [])\n * @method \\Aws\\Result getContactMethods(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContactMethodsAsync(array $args = [])\n * @method \\Aws\\Result getContainerAPIMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContainerAPIMetadataAsync(array $args = [])\n * @method \\Aws\\Result getContainerImages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContainerImagesAsync(array $args = [])\n * @method \\Aws\\Result getContainerLog(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContainerLogAsync(array $args = [])\n * @method \\Aws\\Result getContainerServiceDeployments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContainerServiceDeploymentsAsync(array $args = [])\n * @method \\Aws\\Result getContainerServiceMetricData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContainerServiceMetricDataAsync(array $args = [])\n * @method \\Aws\\Result getContainerServicePowers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContainerServicePowersAsync(array $args = [])\n * @method \\Aws\\Result getContainerServices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContainerServicesAsync(array $args = [])\n * @method \\Aws\\Result getCostEstimate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCostEstimateAsync(array $args = [])\n * @method \\Aws\\Result getDisk(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDiskAsync(array $args = [])\n * @method \\Aws\\Result getDiskSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDiskSnapshotAsync(array $args = [])\n * @method \\Aws\\Result getDiskSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDiskSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result getDisks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDisksAsync(array $args = [])\n * @method \\Aws\\Result getDistributionBundles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDistributionBundlesAsync(array $args = [])\n * @method \\Aws\\Result getDistributionLatestCacheReset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDistributionLatestCacheResetAsync(array $args = [])\n * @method \\Aws\\Result getDistributionMetricData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDistributionMetricDataAsync(array $args = [])\n * @method \\Aws\\Result getDistributions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDistributionsAsync(array $args = [])\n * @method \\Aws\\Result getDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainAsync(array $args = [])\n * @method \\Aws\\Result getDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainsAsync(array $args = [])\n * @method \\Aws\\Result getExportSnapshotRecords(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExportSnapshotRecordsAsync(array $args = [])\n * @method \\Aws\\Result getInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInstanceAsync(array $args = [])\n * @method \\Aws\\Result getInstanceAccessDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInstanceAccessDetailsAsync(array $args = [])\n * @method \\Aws\\Result getInstanceMetricData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInstanceMetricDataAsync(array $args = [])\n * @method \\Aws\\Result getInstancePortStates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInstancePortStatesAsync(array $args = [])\n * @method \\Aws\\Result getInstanceSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInstanceSnapshotAsync(array $args = [])\n * @method \\Aws\\Result getInstanceSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInstanceSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result getInstanceState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInstanceStateAsync(array $args = [])\n * @method \\Aws\\Result getInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInstancesAsync(array $args = [])\n * @method \\Aws\\Result getKeyPair(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getKeyPairAsync(array $args = [])\n * @method \\Aws\\Result getKeyPairs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getKeyPairsAsync(array $args = [])\n * @method \\Aws\\Result getLoadBalancer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLoadBalancerAsync(array $args = [])\n * @method \\Aws\\Result getLoadBalancerMetricData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLoadBalancerMetricDataAsync(array $args = [])\n * @method \\Aws\\Result getLoadBalancerTlsCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLoadBalancerTlsCertificatesAsync(array $args = [])\n * @method \\Aws\\Result getLoadBalancerTlsPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLoadBalancerTlsPoliciesAsync(array $args = [])\n * @method \\Aws\\Result getLoadBalancers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLoadBalancersAsync(array $args = [])\n * @method \\Aws\\Result getOperation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOperationAsync(array $args = [])\n * @method \\Aws\\Result getOperations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOperationsAsync(array $args = [])\n * @method \\Aws\\Result getOperationsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOperationsForResourceAsync(array $args = [])\n * @method \\Aws\\Result getRegions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRegionsAsync(array $args = [])\n * @method \\Aws\\Result getRelationalDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRelationalDatabaseAsync(array $args = [])\n * @method \\Aws\\Result getRelationalDatabaseBlueprints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRelationalDatabaseBlueprintsAsync(array $args = [])\n * @method \\Aws\\Result getRelationalDatabaseBundles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRelationalDatabaseBundlesAsync(array $args = [])\n * @method \\Aws\\Result getRelationalDatabaseEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRelationalDatabaseEventsAsync(array $args = [])\n * @method \\Aws\\Result getRelationalDatabaseLogEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRelationalDatabaseLogEventsAsync(array $args = [])\n * @method \\Aws\\Result getRelationalDatabaseLogStreams(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRelationalDatabaseLogStreamsAsync(array $args = [])\n * @method \\Aws\\Result getRelationalDatabaseMasterUserPassword(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRelationalDatabaseMasterUserPasswordAsync(array $args = [])\n * @method \\Aws\\Result getRelationalDatabaseMetricData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRelationalDatabaseMetricDataAsync(array $args = [])\n * @method \\Aws\\Result getRelationalDatabaseParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRelationalDatabaseParametersAsync(array $args = [])\n * @method \\Aws\\Result getRelationalDatabaseSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRelationalDatabaseSnapshotAsync(array $args = [])\n * @method \\Aws\\Result getRelationalDatabaseSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRelationalDatabaseSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result getRelationalDatabases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRelationalDatabasesAsync(array $args = [])\n * @method \\Aws\\Result getStaticIp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStaticIpAsync(array $args = [])\n * @method \\Aws\\Result getStaticIps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStaticIpsAsync(array $args = [])\n * @method \\Aws\\Result importKeyPair(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importKeyPairAsync(array $args = [])\n * @method \\Aws\\Result isVpcPeered(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise isVpcPeeredAsync(array $args = [])\n * @method \\Aws\\Result openInstancePublicPorts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise openInstancePublicPortsAsync(array $args = [])\n * @method \\Aws\\Result peerVpc(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise peerVpcAsync(array $args = [])\n * @method \\Aws\\Result putAlarm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAlarmAsync(array $args = [])\n * @method \\Aws\\Result putInstancePublicPorts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putInstancePublicPortsAsync(array $args = [])\n * @method \\Aws\\Result rebootInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebootInstanceAsync(array $args = [])\n * @method \\Aws\\Result rebootRelationalDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebootRelationalDatabaseAsync(array $args = [])\n * @method \\Aws\\Result registerContainerImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerContainerImageAsync(array $args = [])\n * @method \\Aws\\Result releaseStaticIp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise releaseStaticIpAsync(array $args = [])\n * @method \\Aws\\Result resetDistributionCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetDistributionCacheAsync(array $args = [])\n * @method \\Aws\\Result sendContactMethodVerification(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendContactMethodVerificationAsync(array $args = [])\n * @method \\Aws\\Result setIpAddressType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setIpAddressTypeAsync(array $args = [])\n * @method \\Aws\\Result setResourceAccessForBucket(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setResourceAccessForBucketAsync(array $args = [])\n * @method \\Aws\\Result startGUISession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startGUISessionAsync(array $args = [])\n * @method \\Aws\\Result startInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startInstanceAsync(array $args = [])\n * @method \\Aws\\Result startRelationalDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startRelationalDatabaseAsync(array $args = [])\n * @method \\Aws\\Result stopGUISession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopGUISessionAsync(array $args = [])\n * @method \\Aws\\Result stopInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopInstanceAsync(array $args = [])\n * @method \\Aws\\Result stopRelationalDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopRelationalDatabaseAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result testAlarm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testAlarmAsync(array $args = [])\n * @method \\Aws\\Result unpeerVpc(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unpeerVpcAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateBucket(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBucketAsync(array $args = [])\n * @method \\Aws\\Result updateBucketBundle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBucketBundleAsync(array $args = [])\n * @method \\Aws\\Result updateContainerService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContainerServiceAsync(array $args = [])\n * @method \\Aws\\Result updateDistribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDistributionAsync(array $args = [])\n * @method \\Aws\\Result updateDistributionBundle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDistributionBundleAsync(array $args = [])\n * @method \\Aws\\Result updateDomainEntry(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDomainEntryAsync(array $args = [])\n * @method \\Aws\\Result updateInstanceMetadataOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateInstanceMetadataOptionsAsync(array $args = [])\n * @method \\Aws\\Result updateLoadBalancerAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLoadBalancerAttributeAsync(array $args = [])\n * @method \\Aws\\Result updateRelationalDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRelationalDatabaseAsync(array $args = [])\n * @method \\Aws\\Result updateRelationalDatabaseParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRelationalDatabaseParametersAsync(array $args = [])\n */\nclass LightsailClient extends AwsClient {}\n", "num_lines": 328}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Lightsail\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Lightsail** service.\n */\nclass LightsailException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LocationService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Location Service** service.\n * @method \\Aws\\Result associateTrackerConsumer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateTrackerConsumerAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteDevicePositionHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteDevicePositionHistoryAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteGeofence(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteGeofenceAsync(array $args = [])\n * @method \\Aws\\Result batchEvaluateGeofences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchEvaluateGeofencesAsync(array $args = [])\n * @method \\Aws\\Result batchGetDevicePosition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetDevicePositionAsync(array $args = [])\n * @method \\Aws\\Result batchPutGeofence(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchPutGeofenceAsync(array $args = [])\n * @method \\Aws\\Result batchUpdateDevicePosition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdateDevicePositionAsync(array $args = [])\n * @method \\Aws\\Result calculateRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise calculateRouteAsync(array $args = [])\n * @method \\Aws\\Result calculateRouteMatrix(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise calculateRouteMatrixAsync(array $args = [])\n * @method \\Aws\\Result createGeofenceCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGeofenceCollectionAsync(array $args = [])\n * @method \\Aws\\Result createKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createKeyAsync(array $args = [])\n * @method \\Aws\\Result createMap(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMapAsync(array $args = [])\n * @method \\Aws\\Result createPlaceIndex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPlaceIndexAsync(array $args = [])\n * @method \\Aws\\Result createRouteCalculator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRouteCalculatorAsync(array $args = [])\n * @method \\Aws\\Result createTracker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTrackerAsync(array $args = [])\n * @method \\Aws\\Result deleteGeofenceCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGeofenceCollectionAsync(array $args = [])\n * @method \\Aws\\Result deleteKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteKeyAsync(array $args = [])\n * @method \\Aws\\Result deleteMap(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMapAsync(array $args = [])\n * @method \\Aws\\Result deletePlaceIndex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePlaceIndexAsync(array $args = [])\n * @method \\Aws\\Result deleteRouteCalculator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRouteCalculatorAsync(array $args = [])\n * @method \\Aws\\Result deleteTracker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTrackerAsync(array $args = [])\n * @method \\Aws\\Result describeGeofenceCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGeofenceCollectionAsync(array $args = [])\n * @method \\Aws\\Result describeKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeKeyAsync(array $args = [])\n * @method \\Aws\\Result describeMap(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMapAsync(array $args = [])\n * @method \\Aws\\Result describePlaceIndex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePlaceIndexAsync(array $args = [])\n * @method \\Aws\\Result describeRouteCalculator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRouteCalculatorAsync(array $args = [])\n * @method \\Aws\\Result describeTracker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTrackerAsync(array $args = [])\n * @method \\Aws\\Result disassociateTrackerConsumer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateTrackerConsumerAsync(array $args = [])\n * @method \\Aws\\Result getDevicePosition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDevicePositionAsync(array $args = [])\n * @method \\Aws\\Result getDevicePositionHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDevicePositionHistoryAsync(array $args = [])\n * @method \\Aws\\Result getGeofence(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGeofenceAsync(array $args = [])\n * @method \\Aws\\Result getMapGlyphs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMapGlyphsAsync(array $args = [])\n * @method \\Aws\\Result getMapSprites(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMapSpritesAsync(array $args = [])\n * @method \\Aws\\Result getMapStyleDescriptor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMapStyleDescriptorAsync(array $args = [])\n * @method \\Aws\\Result getMapTile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMapTileAsync(array $args = [])\n * @method \\Aws\\Result getPlace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPlaceAsync(array $args = [])\n * @method \\Aws\\Result listDevicePositions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDevicePositionsAsync(array $args = [])\n * @method \\Aws\\Result listGeofenceCollections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGeofenceCollectionsAsync(array $args = [])\n * @method \\Aws\\Result listGeofences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGeofencesAsync(array $args = [])\n * @method \\Aws\\Result listKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listKeysAsync(array $args = [])\n * @method \\Aws\\Result listMaps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMapsAsync(array $args = [])\n * @method \\Aws\\Result listPlaceIndexes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPlaceIndexesAsync(array $args = [])\n * @method \\Aws\\Result listRouteCalculators(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRouteCalculatorsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTrackerConsumers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTrackerConsumersAsync(array $args = [])\n * @method \\Aws\\Result listTrackers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTrackersAsync(array $args = [])\n * @method \\Aws\\Result putGeofence(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putGeofenceAsync(array $args = [])\n * @method \\Aws\\Result searchPlaceIndexForPosition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchPlaceIndexForPositionAsync(array $args = [])\n * @method \\Aws\\Result searchPlaceIndexForSuggestions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchPlaceIndexForSuggestionsAsync(array $args = [])\n * @method \\Aws\\Result searchPlaceIndexForText(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchPlaceIndexForTextAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateGeofenceCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGeofenceCollectionAsync(array $args = [])\n * @method \\Aws\\Result updateKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateKeyAsync(array $args = [])\n * @method \\Aws\\Result updateMap(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMapAsync(array $args = [])\n * @method \\Aws\\Result updatePlaceIndex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePlaceIndexAsync(array $args = [])\n * @method \\Aws\\Result updateRouteCalculator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRouteCalculatorAsync(array $args = [])\n * @method \\Aws\\Result updateTracker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTrackerAsync(array $args = [])\n */\nclass LocationServiceClient extends AwsClient {}\n", "num_lines": 126}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LocationService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Location Service** service.\n */\nclass LocationServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LookoutEquipment;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Lookout for Equipment** service.\n * @method \\Aws\\Result createDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatasetAsync(array $args = [])\n * @method \\Aws\\Result createInferenceScheduler(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInferenceSchedulerAsync(array $args = [])\n * @method \\Aws\\Result createLabel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLabelAsync(array $args = [])\n * @method \\Aws\\Result createLabelGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLabelGroupAsync(array $args = [])\n * @method \\Aws\\Result createModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createModelAsync(array $args = [])\n * @method \\Aws\\Result deleteDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDatasetAsync(array $args = [])\n * @method \\Aws\\Result deleteInferenceScheduler(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInferenceSchedulerAsync(array $args = [])\n * @method \\Aws\\Result deleteLabel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLabelAsync(array $args = [])\n * @method \\Aws\\Result deleteLabelGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLabelGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteModelAsync(array $args = [])\n * @method \\Aws\\Result describeDataIngestionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDataIngestionJobAsync(array $args = [])\n * @method \\Aws\\Result describeDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDatasetAsync(array $args = [])\n * @method \\Aws\\Result describeInferenceScheduler(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInferenceSchedulerAsync(array $args = [])\n * @method \\Aws\\Result describeLabel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLabelAsync(array $args = [])\n * @method \\Aws\\Result describeLabelGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLabelGroupAsync(array $args = [])\n * @method \\Aws\\Result describeModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeModelAsync(array $args = [])\n * @method \\Aws\\Result listDataIngestionJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataIngestionJobsAsync(array $args = [])\n * @method \\Aws\\Result listDatasets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetsAsync(array $args = [])\n * @method \\Aws\\Result listInferenceEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInferenceEventsAsync(array $args = [])\n * @method \\Aws\\Result listInferenceExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInferenceExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listInferenceSchedulers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInferenceSchedulersAsync(array $args = [])\n * @method \\Aws\\Result listLabelGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLabelGroupsAsync(array $args = [])\n * @method \\Aws\\Result listLabels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLabelsAsync(array $args = [])\n * @method \\Aws\\Result listModels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listModelsAsync(array $args = [])\n * @method \\Aws\\Result listSensorStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSensorStatisticsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startDataIngestionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDataIngestionJobAsync(array $args = [])\n * @method \\Aws\\Result startInferenceScheduler(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startInferenceSchedulerAsync(array $args = [])\n * @method \\Aws\\Result stopInferenceScheduler(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopInferenceSchedulerAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateInferenceScheduler(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateInferenceSchedulerAsync(array $args = [])\n * @method \\Aws\\Result updateLabelGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLabelGroupAsync(array $args = [])\n */\nclass LookoutEquipmentClient extends AwsClient {}\n", "num_lines": 76}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LookoutEquipment\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Lookout for Equipment** service.\n */\nclass LookoutEquipmentException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LookoutforVision;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Lookout for Vision** service.\n * @method \\Aws\\Result createDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatasetAsync(array $args = [])\n * @method \\Aws\\Result createModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createModelAsync(array $args = [])\n * @method \\Aws\\Result createProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProjectAsync(array $args = [])\n * @method \\Aws\\Result deleteDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDatasetAsync(array $args = [])\n * @method \\Aws\\Result deleteModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteModelAsync(array $args = [])\n * @method \\Aws\\Result deleteProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProjectAsync(array $args = [])\n * @method \\Aws\\Result describeDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDatasetAsync(array $args = [])\n * @method \\Aws\\Result describeModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeModelAsync(array $args = [])\n * @method \\Aws\\Result describeModelPackagingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeModelPackagingJobAsync(array $args = [])\n * @method \\Aws\\Result describeProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProjectAsync(array $args = [])\n * @method \\Aws\\Result detectAnomalies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectAnomaliesAsync(array $args = [])\n * @method \\Aws\\Result listDatasetEntries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetEntriesAsync(array $args = [])\n * @method \\Aws\\Result listModelPackagingJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listModelPackagingJobsAsync(array $args = [])\n * @method \\Aws\\Result listModels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listModelsAsync(array $args = [])\n * @method \\Aws\\Result listProjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProjectsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startModelAsync(array $args = [])\n * @method \\Aws\\Result startModelPackagingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startModelPackagingJobAsync(array $args = [])\n * @method \\Aws\\Result stopModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopModelAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDatasetEntries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDatasetEntriesAsync(array $args = [])\n */\nclass LookoutforVisionClient extends AwsClient {}\n", "num_lines": 54}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LookoutforVision\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Lookout for Vision** service.\n */\nclass LookoutforVisionException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LookoutMetrics;\n\nuse Aws\\AwsClient;\nuse Aws\\CommandInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * This client is used to interact with the **Amazon Lookout for Metrics** service.\n * @method \\Aws\\Result activateAnomalyDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise activateAnomalyDetectorAsync(array $args = [])\n * @method \\Aws\\Result backTestAnomalyDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise backTestAnomalyDetectorAsync(array $args = [])\n * @method \\Aws\\Result createAlert(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAlertAsync(array $args = [])\n * @method \\Aws\\Result createAnomalyDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAnomalyDetectorAsync(array $args = [])\n * @method \\Aws\\Result createMetricSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMetricSetAsync(array $args = [])\n * @method \\Aws\\Result deactivateAnomalyDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deactivateAnomalyDetectorAsync(array $args = [])\n * @method \\Aws\\Result deleteAlert(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAlertAsync(array $args = [])\n * @method \\Aws\\Result deleteAnomalyDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAnomalyDetectorAsync(array $args = [])\n * @method \\Aws\\Result describeAlert(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAlertAsync(array $args = [])\n * @method \\Aws\\Result describeAnomalyDetectionExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAnomalyDetectionExecutionsAsync(array $args = [])\n * @method \\Aws\\Result describeAnomalyDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAnomalyDetectorAsync(array $args = [])\n * @method \\Aws\\Result describeMetricSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMetricSetAsync(array $args = [])\n * @method \\Aws\\Result detectMetricSetConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectMetricSetConfigAsync(array $args = [])\n * @method \\Aws\\Result getAnomalyGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAnomalyGroupAsync(array $args = [])\n * @method \\Aws\\Result getDataQualityMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataQualityMetricsAsync(array $args = [])\n * @method \\Aws\\Result getFeedback(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFeedbackAsync(array $args = [])\n * @method \\Aws\\Result getSampleData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSampleDataAsync(array $args = [])\n * @method \\Aws\\Result listAlerts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAlertsAsync(array $args = [])\n * @method \\Aws\\Result listAnomalyDetectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAnomalyDetectorsAsync(array $args = [])\n * @method \\Aws\\Result listAnomalyGroupRelatedMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAnomalyGroupRelatedMetricsAsync(array $args = [])\n * @method \\Aws\\Result listAnomalyGroupSummaries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAnomalyGroupSummariesAsync(array $args = [])\n * @method \\Aws\\Result listAnomalyGroupTimeSeries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAnomalyGroupTimeSeriesAsync(array $args = [])\n * @method \\Aws\\Result listMetricSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMetricSetsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putFeedback(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putFeedbackAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAlert(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAlertAsync(array $args = [])\n * @method \\Aws\\Result updateAnomalyDetector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAnomalyDetectorAsync(array $args = [])\n * @method \\Aws\\Result updateMetricSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMetricSetAsync(array $args = [])\n */\nclass LookoutMetricsClient extends AwsClient {}\n", "num_lines": 72}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\LookoutMetrics\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Lookout for Metrics** service.\n */\nclass LookoutMetricsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MachineLearning;\n\nuse Aws\\AwsClient;\nuse Aws\\CommandInterface;\nuse GuzzleHttp\\Psr7\\Uri;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Amazon Machine Learning client.\n *\n * @method \\Aws\\Result addTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsAsync(array $args = [])\n * @method \\Aws\\Result createBatchPrediction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBatchPredictionAsync(array $args = [])\n * @method \\Aws\\Result createDataSourceFromRDS(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataSourceFromRDSAsync(array $args = [])\n * @method \\Aws\\Result createDataSourceFromRedshift(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataSourceFromRedshiftAsync(array $args = [])\n * @method \\Aws\\Result createDataSourceFromS3(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataSourceFromS3Async(array $args = [])\n * @method \\Aws\\Result createEvaluation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEvaluationAsync(array $args = [])\n * @method \\Aws\\Result createMLModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMLModelAsync(array $args = [])\n * @method \\Aws\\Result createRealtimeEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRealtimeEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteBatchPrediction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBatchPredictionAsync(array $args = [])\n * @method \\Aws\\Result deleteDataSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataSourceAsync(array $args = [])\n * @method \\Aws\\Result deleteEvaluation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEvaluationAsync(array $args = [])\n * @method \\Aws\\Result deleteMLModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMLModelAsync(array $args = [])\n * @method \\Aws\\Result deleteRealtimeEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRealtimeEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTagsAsync(array $args = [])\n * @method \\Aws\\Result describeBatchPredictions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBatchPredictionsAsync(array $args = [])\n * @method \\Aws\\Result describeDataSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDataSourcesAsync(array $args = [])\n * @method \\Aws\\Result describeEvaluations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEvaluationsAsync(array $args = [])\n * @method \\Aws\\Result describeMLModels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMLModelsAsync(array $args = [])\n * @method \\Aws\\Result describeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTagsAsync(array $args = [])\n * @method \\Aws\\Result getBatchPrediction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBatchPredictionAsync(array $args = [])\n * @method \\Aws\\Result getDataSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataSourceAsync(array $args = [])\n * @method \\Aws\\Result getEvaluation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEvaluationAsync(array $args = [])\n * @method \\Aws\\Result getMLModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMLModelAsync(array $args = [])\n * @method \\Aws\\Result predict(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise predictAsync(array $args = [])\n * @method \\Aws\\Result updateBatchPrediction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBatchPredictionAsync(array $args = [])\n * @method \\Aws\\Result updateDataSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDataSourceAsync(array $args = [])\n * @method \\Aws\\Result updateEvaluation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEvaluationAsync(array $args = [])\n * @method \\Aws\\Result updateMLModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMLModelAsync(array $args = [])\n */\nclass MachineLearningClient extends AwsClient\n{\n    public function __construct(array $config)\n    {\n        parent::__construct($config);\n        $list = $this->getHandlerList();\n        $list->appendBuild($this->predictEndpoint(), 'ml.predict_endpoint');\n    }\n\n    /**\n     * Changes the endpoint of the Predict operation to the provided endpoint.\n     *\n     * @return callable\n     */\n    private function predictEndpoint()\n    {\n        return static function (callable $handler) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request = null\n            ) use ($handler) {\n                if ($command->getName() === 'Predict') {\n                    $request = $request->withUri(new Uri($command['PredictEndpoint']));\n                }\n                return $handler($command, $request);\n            };\n        };\n    }\n}\n", "num_lines": 98}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MachineLearning\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Amazon Machine Learning exception.\n */\nclass MachineLearningException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Macie;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Macie** service.\n * @method \\Aws\\Result associateMemberAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateMemberAccountAsync(array $args = [])\n * @method \\Aws\\Result associateS3Resources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateS3ResourcesAsync(array $args = [])\n * @method \\Aws\\Result disassociateMemberAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateMemberAccountAsync(array $args = [])\n * @method \\Aws\\Result disassociateS3Resources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateS3ResourcesAsync(array $args = [])\n * @method \\Aws\\Result listMemberAccounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMemberAccountsAsync(array $args = [])\n * @method \\Aws\\Result listS3Resources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listS3ResourcesAsync(array $args = [])\n * @method \\Aws\\Result updateS3Resources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateS3ResourcesAsync(array $args = [])\n */\nclass MacieClient extends AwsClient {}\n", "num_lines": 24}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Macie\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Macie** service.\n */\nclass MacieException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Macie2;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Macie 2** service.\n * @method \\Aws\\Result acceptInvitation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptInvitationAsync(array $args = [])\n * @method \\Aws\\Result batchGetCustomDataIdentifiers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetCustomDataIdentifiersAsync(array $args = [])\n * @method \\Aws\\Result createAllowList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAllowListAsync(array $args = [])\n * @method \\Aws\\Result createClassificationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClassificationJobAsync(array $args = [])\n * @method \\Aws\\Result createCustomDataIdentifier(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCustomDataIdentifierAsync(array $args = [])\n * @method \\Aws\\Result createFindingsFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFindingsFilterAsync(array $args = [])\n * @method \\Aws\\Result createInvitations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInvitationsAsync(array $args = [])\n * @method \\Aws\\Result createMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMemberAsync(array $args = [])\n * @method \\Aws\\Result createSampleFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSampleFindingsAsync(array $args = [])\n * @method \\Aws\\Result declineInvitations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise declineInvitationsAsync(array $args = [])\n * @method \\Aws\\Result deleteAllowList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAllowListAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomDataIdentifier(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomDataIdentifierAsync(array $args = [])\n * @method \\Aws\\Result deleteFindingsFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFindingsFilterAsync(array $args = [])\n * @method \\Aws\\Result deleteInvitations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInvitationsAsync(array $args = [])\n * @method \\Aws\\Result deleteMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMemberAsync(array $args = [])\n * @method \\Aws\\Result describeBuckets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBucketsAsync(array $args = [])\n * @method \\Aws\\Result describeClassificationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClassificationJobAsync(array $args = [])\n * @method \\Aws\\Result describeOrganizationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrganizationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result disableMacie(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableMacieAsync(array $args = [])\n * @method \\Aws\\Result disableOrganizationAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableOrganizationAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result disassociateFromAdministratorAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateFromAdministratorAccountAsync(array $args = [])\n * @method \\Aws\\Result disassociateFromMasterAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateFromMasterAccountAsync(array $args = [])\n * @method \\Aws\\Result disassociateMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateMemberAsync(array $args = [])\n * @method \\Aws\\Result enableMacie(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableMacieAsync(array $args = [])\n * @method \\Aws\\Result enableOrganizationAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableOrganizationAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result getAdministratorAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAdministratorAccountAsync(array $args = [])\n * @method \\Aws\\Result getAllowList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAllowListAsync(array $args = [])\n * @method \\Aws\\Result getAutomatedDiscoveryConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAutomatedDiscoveryConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getBucketStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketStatisticsAsync(array $args = [])\n * @method \\Aws\\Result getClassificationExportConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getClassificationExportConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getClassificationScope(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getClassificationScopeAsync(array $args = [])\n * @method \\Aws\\Result getCustomDataIdentifier(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCustomDataIdentifierAsync(array $args = [])\n * @method \\Aws\\Result getFindingStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFindingStatisticsAsync(array $args = [])\n * @method \\Aws\\Result getFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFindingsAsync(array $args = [])\n * @method \\Aws\\Result getFindingsFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFindingsFilterAsync(array $args = [])\n * @method \\Aws\\Result getFindingsPublicationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFindingsPublicationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getInvitationsCount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInvitationsCountAsync(array $args = [])\n * @method \\Aws\\Result getMacieSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMacieSessionAsync(array $args = [])\n * @method \\Aws\\Result getMasterAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMasterAccountAsync(array $args = [])\n * @method \\Aws\\Result getMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMemberAsync(array $args = [])\n * @method \\Aws\\Result getResourceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceProfileAsync(array $args = [])\n * @method \\Aws\\Result getRevealConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRevealConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getSensitiveDataOccurrences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSensitiveDataOccurrencesAsync(array $args = [])\n * @method \\Aws\\Result getSensitiveDataOccurrencesAvailability(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSensitiveDataOccurrencesAvailabilityAsync(array $args = [])\n * @method \\Aws\\Result getSensitivityInspectionTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSensitivityInspectionTemplateAsync(array $args = [])\n * @method \\Aws\\Result getUsageStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUsageStatisticsAsync(array $args = [])\n * @method \\Aws\\Result getUsageTotals(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUsageTotalsAsync(array $args = [])\n * @method \\Aws\\Result listAllowLists(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAllowListsAsync(array $args = [])\n * @method \\Aws\\Result listClassificationJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listClassificationJobsAsync(array $args = [])\n * @method \\Aws\\Result listClassificationScopes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listClassificationScopesAsync(array $args = [])\n * @method \\Aws\\Result listCustomDataIdentifiers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCustomDataIdentifiersAsync(array $args = [])\n * @method \\Aws\\Result listFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFindingsAsync(array $args = [])\n * @method \\Aws\\Result listFindingsFilters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFindingsFiltersAsync(array $args = [])\n * @method \\Aws\\Result listInvitations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInvitationsAsync(array $args = [])\n * @method \\Aws\\Result listManagedDataIdentifiers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listManagedDataIdentifiersAsync(array $args = [])\n * @method \\Aws\\Result listMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMembersAsync(array $args = [])\n * @method \\Aws\\Result listOrganizationAdminAccounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOrganizationAdminAccountsAsync(array $args = [])\n * @method \\Aws\\Result listResourceProfileArtifacts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceProfileArtifactsAsync(array $args = [])\n * @method \\Aws\\Result listResourceProfileDetections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceProfileDetectionsAsync(array $args = [])\n * @method \\Aws\\Result listSensitivityInspectionTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSensitivityInspectionTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putClassificationExportConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putClassificationExportConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putFindingsPublicationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putFindingsPublicationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result searchResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchResourcesAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result testCustomDataIdentifier(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testCustomDataIdentifierAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAllowList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAllowListAsync(array $args = [])\n * @method \\Aws\\Result updateAutomatedDiscoveryConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAutomatedDiscoveryConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateClassificationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateClassificationJobAsync(array $args = [])\n * @method \\Aws\\Result updateClassificationScope(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateClassificationScopeAsync(array $args = [])\n * @method \\Aws\\Result updateFindingsFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFindingsFilterAsync(array $args = [])\n * @method \\Aws\\Result updateMacieSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMacieSessionAsync(array $args = [])\n * @method \\Aws\\Result updateMemberSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMemberSessionAsync(array $args = [])\n * @method \\Aws\\Result updateOrganizationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateOrganizationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateResourceProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResourceProfileAsync(array $args = [])\n * @method \\Aws\\Result updateResourceProfileDetections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResourceProfileDetectionsAsync(array $args = [])\n * @method \\Aws\\Result updateRevealConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRevealConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateSensitivityInspectionTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSensitivityInspectionTemplateAsync(array $args = [])\n */\nclass Macie2Client extends AwsClient {}\n", "num_lines": 168}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Macie2\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Macie 2** service.\n */\nclass Macie2Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MainframeModernization;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWSMainframeModernization** service.\n * @method \\Aws\\Result cancelBatchJobExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelBatchJobExecutionAsync(array $args = [])\n * @method \\Aws\\Result createApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationAsync(array $args = [])\n * @method \\Aws\\Result createDataSetImportTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataSetImportTaskAsync(array $args = [])\n * @method \\Aws\\Result createDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeploymentAsync(array $args = [])\n * @method \\Aws\\Result createEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result deleteApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteApplicationFromEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationFromEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result deleteEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result getApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApplicationAsync(array $args = [])\n * @method \\Aws\\Result getApplicationVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApplicationVersionAsync(array $args = [])\n * @method \\Aws\\Result getBatchJobExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBatchJobExecutionAsync(array $args = [])\n * @method \\Aws\\Result getDataSetDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataSetDetailsAsync(array $args = [])\n * @method \\Aws\\Result getDataSetImportTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataSetImportTaskAsync(array $args = [])\n * @method \\Aws\\Result getDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeploymentAsync(array $args = [])\n * @method \\Aws\\Result getEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result listApplicationVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationVersionsAsync(array $args = [])\n * @method \\Aws\\Result listApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listBatchJobDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBatchJobDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listBatchJobExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBatchJobExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listDataSetImportHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataSetImportHistoryAsync(array $args = [])\n * @method \\Aws\\Result listDataSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataSetsAsync(array $args = [])\n * @method \\Aws\\Result listDeployments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeploymentsAsync(array $args = [])\n * @method \\Aws\\Result listEngineVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEngineVersionsAsync(array $args = [])\n * @method \\Aws\\Result listEnvironments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEnvironmentsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startApplicationAsync(array $args = [])\n * @method \\Aws\\Result startBatchJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startBatchJobAsync(array $args = [])\n * @method \\Aws\\Result stopApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopApplicationAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationAsync(array $args = [])\n * @method \\Aws\\Result updateEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEnvironmentAsync(array $args = [])\n */\nclass MainframeModernizationClient extends AwsClient {}\n", "num_lines": 74}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MainframeModernization\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWSMainframeModernization** service.\n */\nclass MainframeModernizationException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ManagedBlockchain;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Managed Blockchain** service.\n * @method \\Aws\\Result createAccessor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccessorAsync(array $args = [])\n * @method \\Aws\\Result createMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMemberAsync(array $args = [])\n * @method \\Aws\\Result createNetwork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNetworkAsync(array $args = [])\n * @method \\Aws\\Result createNode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNodeAsync(array $args = [])\n * @method \\Aws\\Result createProposal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProposalAsync(array $args = [])\n * @method \\Aws\\Result deleteAccessor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccessorAsync(array $args = [])\n * @method \\Aws\\Result deleteMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMemberAsync(array $args = [])\n * @method \\Aws\\Result deleteNode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNodeAsync(array $args = [])\n * @method \\Aws\\Result getAccessor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccessorAsync(array $args = [])\n * @method \\Aws\\Result getMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMemberAsync(array $args = [])\n * @method \\Aws\\Result getNetwork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNetworkAsync(array $args = [])\n * @method \\Aws\\Result getNode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNodeAsync(array $args = [])\n * @method \\Aws\\Result getProposal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProposalAsync(array $args = [])\n * @method \\Aws\\Result listAccessors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccessorsAsync(array $args = [])\n * @method \\Aws\\Result listInvitations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInvitationsAsync(array $args = [])\n * @method \\Aws\\Result listMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMembersAsync(array $args = [])\n * @method \\Aws\\Result listNetworks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNetworksAsync(array $args = [])\n * @method \\Aws\\Result listNodes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNodesAsync(array $args = [])\n * @method \\Aws\\Result listProposalVotes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProposalVotesAsync(array $args = [])\n * @method \\Aws\\Result listProposals(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProposalsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result rejectInvitation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectInvitationAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMemberAsync(array $args = [])\n * @method \\Aws\\Result updateNode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNodeAsync(array $args = [])\n * @method \\Aws\\Result voteOnProposal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise voteOnProposalAsync(array $args = [])\n */\nclass ManagedBlockchainClient extends AwsClient {}\n", "num_lines": 64}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ManagedBlockchain\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Managed Blockchain** service.\n */\nclass ManagedBlockchainException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ManagedGrafana;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Managed Grafana** service.\n * @method \\Aws\\Result associateLicense(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateLicenseAsync(array $args = [])\n * @method \\Aws\\Result createWorkspace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkspaceAsync(array $args = [])\n * @method \\Aws\\Result createWorkspaceApiKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkspaceApiKeyAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkspace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkspaceAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkspaceApiKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkspaceApiKeyAsync(array $args = [])\n * @method \\Aws\\Result describeWorkspace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkspaceAsync(array $args = [])\n * @method \\Aws\\Result describeWorkspaceAuthentication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkspaceAuthenticationAsync(array $args = [])\n * @method \\Aws\\Result describeWorkspaceConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkspaceConfigurationAsync(array $args = [])\n * @method \\Aws\\Result disassociateLicense(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateLicenseAsync(array $args = [])\n * @method \\Aws\\Result listPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPermissionsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWorkspaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkspacesAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updatePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePermissionsAsync(array $args = [])\n * @method \\Aws\\Result updateWorkspace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkspaceAsync(array $args = [])\n * @method \\Aws\\Result updateWorkspaceAuthentication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkspaceAuthenticationAsync(array $args = [])\n * @method \\Aws\\Result updateWorkspaceConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkspaceConfigurationAsync(array $args = [])\n */\nclass ManagedGrafanaClient extends AwsClient {}\n", "num_lines": 46}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ManagedGrafana\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Managed Grafana** service.\n */\nclass ManagedGrafanaException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MarketplaceCatalog;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Marketplace Catalog Service** service.\n * @method \\Aws\\Result cancelChangeSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelChangeSetAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result describeChangeSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChangeSetAsync(array $args = [])\n * @method \\Aws\\Result describeEntity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEntityAsync(array $args = [])\n * @method \\Aws\\Result getResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result listChangeSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChangeSetsAsync(array $args = [])\n * @method \\Aws\\Result listEntities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEntitiesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result startChangeSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startChangeSetAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass MarketplaceCatalogClient extends AwsClient {}\n", "num_lines": 34}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MarketplaceCatalog\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Marketplace Catalog Service** service.\n */\nclass MarketplaceCatalogException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MarketplaceCommerceAnalytics;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Marketplace Commerce Analytics** service.\n *\n * @method \\Aws\\Result generateDataSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateDataSetAsync(array $args = [])\n * @method \\Aws\\Result startSupportDataExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSupportDataExportAsync(array $args = [])\n */\nclass MarketplaceCommerceAnalyticsClient extends AwsClient {}\n", "num_lines": 15}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MarketplaceCommerceAnalytics\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Marketplace Commerce Analytics** service.\n */\nclass MarketplaceCommerceAnalyticsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MarketplaceEntitlementService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Marketplace Entitlement Service** service.\n * @method \\Aws\\Result getEntitlements(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEntitlementsAsync(array $args = [])\n */\nclass MarketplaceEntitlementServiceClient extends AwsClient {}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MarketplaceEntitlementService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Marketplace Entitlement Service** service.\n */\nclass MarketplaceEntitlementServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MarketplaceMetering;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWSMarketplace Metering** service.\n * @method \\Aws\\Result batchMeterUsage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchMeterUsageAsync(array $args = [])\n * @method \\Aws\\Result meterUsage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise meterUsageAsync(array $args = [])\n * @method \\Aws\\Result registerUsage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerUsageAsync(array $args = [])\n * @method \\Aws\\Result resolveCustomer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resolveCustomerAsync(array $args = [])\n */\nclass MarketplaceMeteringClient extends AwsClient {}\n", "num_lines": 18}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MarketplaceMetering\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWSMarketplace Metering** service.\n */\nclass MarketplaceMeteringException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaConnect;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS MediaConnect** service.\n * @method \\Aws\\Result addBridgeOutputs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addBridgeOutputsAsync(array $args = [])\n * @method \\Aws\\Result addBridgeSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addBridgeSourcesAsync(array $args = [])\n * @method \\Aws\\Result addFlowMediaStreams(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addFlowMediaStreamsAsync(array $args = [])\n * @method \\Aws\\Result addFlowOutputs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addFlowOutputsAsync(array $args = [])\n * @method \\Aws\\Result addFlowSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addFlowSourcesAsync(array $args = [])\n * @method \\Aws\\Result addFlowVpcInterfaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addFlowVpcInterfacesAsync(array $args = [])\n * @method \\Aws\\Result createBridge(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBridgeAsync(array $args = [])\n * @method \\Aws\\Result createFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFlowAsync(array $args = [])\n * @method \\Aws\\Result createGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGatewayAsync(array $args = [])\n * @method \\Aws\\Result deleteBridge(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBridgeAsync(array $args = [])\n * @method \\Aws\\Result deleteFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFlowAsync(array $args = [])\n * @method \\Aws\\Result deleteGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGatewayAsync(array $args = [])\n * @method \\Aws\\Result deregisterGatewayInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterGatewayInstanceAsync(array $args = [])\n * @method \\Aws\\Result describeBridge(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBridgeAsync(array $args = [])\n * @method \\Aws\\Result describeFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFlowAsync(array $args = [])\n * @method \\Aws\\Result describeGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGatewayAsync(array $args = [])\n * @method \\Aws\\Result describeGatewayInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGatewayInstanceAsync(array $args = [])\n * @method \\Aws\\Result describeOffering(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOfferingAsync(array $args = [])\n * @method \\Aws\\Result describeReservation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservationAsync(array $args = [])\n * @method \\Aws\\Result grantFlowEntitlements(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise grantFlowEntitlementsAsync(array $args = [])\n * @method \\Aws\\Result listBridges(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBridgesAsync(array $args = [])\n * @method \\Aws\\Result listEntitlements(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEntitlementsAsync(array $args = [])\n * @method \\Aws\\Result listFlows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFlowsAsync(array $args = [])\n * @method \\Aws\\Result listGatewayInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGatewayInstancesAsync(array $args = [])\n * @method \\Aws\\Result listGateways(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGatewaysAsync(array $args = [])\n * @method \\Aws\\Result listOfferings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOfferingsAsync(array $args = [])\n * @method \\Aws\\Result listReservations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReservationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result purchaseOffering(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise purchaseOfferingAsync(array $args = [])\n * @method \\Aws\\Result removeBridgeOutput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeBridgeOutputAsync(array $args = [])\n * @method \\Aws\\Result removeBridgeSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeBridgeSourceAsync(array $args = [])\n * @method \\Aws\\Result removeFlowMediaStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeFlowMediaStreamAsync(array $args = [])\n * @method \\Aws\\Result removeFlowOutput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeFlowOutputAsync(array $args = [])\n * @method \\Aws\\Result removeFlowSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeFlowSourceAsync(array $args = [])\n * @method \\Aws\\Result removeFlowVpcInterface(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeFlowVpcInterfaceAsync(array $args = [])\n * @method \\Aws\\Result revokeFlowEntitlement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeFlowEntitlementAsync(array $args = [])\n * @method \\Aws\\Result startFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startFlowAsync(array $args = [])\n * @method \\Aws\\Result stopFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopFlowAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateBridge(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBridgeAsync(array $args = [])\n * @method \\Aws\\Result updateBridgeOutput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBridgeOutputAsync(array $args = [])\n * @method \\Aws\\Result updateBridgeSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBridgeSourceAsync(array $args = [])\n * @method \\Aws\\Result updateBridgeState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBridgeStateAsync(array $args = [])\n * @method \\Aws\\Result updateFlow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFlowAsync(array $args = [])\n * @method \\Aws\\Result updateFlowEntitlement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFlowEntitlementAsync(array $args = [])\n * @method \\Aws\\Result updateFlowMediaStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFlowMediaStreamAsync(array $args = [])\n * @method \\Aws\\Result updateFlowOutput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFlowOutputAsync(array $args = [])\n * @method \\Aws\\Result updateFlowSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFlowSourceAsync(array $args = [])\n * @method \\Aws\\Result updateGatewayInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGatewayInstanceAsync(array $args = [])\n */\nclass MediaConnectClient extends AwsClient {}\n", "num_lines": 110}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaConnect\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS MediaConnect** service.\n */\nclass MediaConnectException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaConvert;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Elemental MediaConvert** service.\n * @method \\Aws\\Result associateCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateCertificateAsync(array $args = [])\n * @method \\Aws\\Result cancelJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelJobAsync(array $args = [])\n * @method \\Aws\\Result createJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createJobAsync(array $args = [])\n * @method \\Aws\\Result createJobTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createJobTemplateAsync(array $args = [])\n * @method \\Aws\\Result createPreset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPresetAsync(array $args = [])\n * @method \\Aws\\Result createQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createQueueAsync(array $args = [])\n * @method \\Aws\\Result deleteJobTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteJobTemplateAsync(array $args = [])\n * @method \\Aws\\Result deletePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePolicyAsync(array $args = [])\n * @method \\Aws\\Result deletePreset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePresetAsync(array $args = [])\n * @method \\Aws\\Result deleteQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteQueueAsync(array $args = [])\n * @method \\Aws\\Result describeEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEndpointsAsync(array $args = [])\n * @method \\Aws\\Result disassociateCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateCertificateAsync(array $args = [])\n * @method \\Aws\\Result getJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobAsync(array $args = [])\n * @method \\Aws\\Result getJobTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobTemplateAsync(array $args = [])\n * @method \\Aws\\Result getPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPolicyAsync(array $args = [])\n * @method \\Aws\\Result getPreset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPresetAsync(array $args = [])\n * @method \\Aws\\Result getQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getQueueAsync(array $args = [])\n * @method \\Aws\\Result listJobTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobsAsync(array $args = [])\n * @method \\Aws\\Result listPresets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPresetsAsync(array $args = [])\n * @method \\Aws\\Result listQueues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listQueuesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPolicyAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateJobTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateJobTemplateAsync(array $args = [])\n * @method \\Aws\\Result updatePreset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePresetAsync(array $args = [])\n * @method \\Aws\\Result updateQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateQueueAsync(array $args = [])\n */\nclass MediaConvertClient extends AwsClient {}\n", "num_lines": 66}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaConvert\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Elemental MediaConvert** service.\n */\nclass MediaConvertException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaLive;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Elemental MediaLive** service.\n * @method \\Aws\\Result acceptInputDeviceTransfer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptInputDeviceTransferAsync(array $args = [])\n * @method \\Aws\\Result batchDelete(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteAsync(array $args = [])\n * @method \\Aws\\Result batchStart(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchStartAsync(array $args = [])\n * @method \\Aws\\Result batchStop(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchStopAsync(array $args = [])\n * @method \\Aws\\Result batchUpdateSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdateScheduleAsync(array $args = [])\n * @method \\Aws\\Result cancelInputDeviceTransfer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelInputDeviceTransferAsync(array $args = [])\n * @method \\Aws\\Result claimDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise claimDeviceAsync(array $args = [])\n * @method \\Aws\\Result createChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelAsync(array $args = [])\n * @method \\Aws\\Result createInput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInputAsync(array $args = [])\n * @method \\Aws\\Result createInputSecurityGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInputSecurityGroupAsync(array $args = [])\n * @method \\Aws\\Result createMultiplex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMultiplexAsync(array $args = [])\n * @method \\Aws\\Result createMultiplexProgram(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMultiplexProgramAsync(array $args = [])\n * @method \\Aws\\Result createPartnerInput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPartnerInputAsync(array $args = [])\n * @method \\Aws\\Result createTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTagsAsync(array $args = [])\n * @method \\Aws\\Result deleteChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteInput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInputAsync(array $args = [])\n * @method \\Aws\\Result deleteInputSecurityGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInputSecurityGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteMultiplex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMultiplexAsync(array $args = [])\n * @method \\Aws\\Result deleteMultiplexProgram(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMultiplexProgramAsync(array $args = [])\n * @method \\Aws\\Result deleteReservation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReservationAsync(array $args = [])\n * @method \\Aws\\Result deleteSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteScheduleAsync(array $args = [])\n * @method \\Aws\\Result deleteTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTagsAsync(array $args = [])\n * @method \\Aws\\Result describeChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelAsync(array $args = [])\n * @method \\Aws\\Result describeInput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInputAsync(array $args = [])\n * @method \\Aws\\Result describeInputDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInputDeviceAsync(array $args = [])\n * @method \\Aws\\Result describeInputDeviceThumbnail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInputDeviceThumbnailAsync(array $args = [])\n * @method \\Aws\\Result describeInputSecurityGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInputSecurityGroupAsync(array $args = [])\n * @method \\Aws\\Result describeMultiplex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMultiplexAsync(array $args = [])\n * @method \\Aws\\Result describeMultiplexProgram(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMultiplexProgramAsync(array $args = [])\n * @method \\Aws\\Result describeOffering(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOfferingAsync(array $args = [])\n * @method \\Aws\\Result describeReservation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservationAsync(array $args = [])\n * @method \\Aws\\Result describeSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScheduleAsync(array $args = [])\n * @method \\Aws\\Result listChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelsAsync(array $args = [])\n * @method \\Aws\\Result listInputDeviceTransfers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInputDeviceTransfersAsync(array $args = [])\n * @method \\Aws\\Result listInputDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInputDevicesAsync(array $args = [])\n * @method \\Aws\\Result listInputSecurityGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInputSecurityGroupsAsync(array $args = [])\n * @method \\Aws\\Result listInputs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInputsAsync(array $args = [])\n * @method \\Aws\\Result listMultiplexPrograms(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMultiplexProgramsAsync(array $args = [])\n * @method \\Aws\\Result listMultiplexes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMultiplexesAsync(array $args = [])\n * @method \\Aws\\Result listOfferings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOfferingsAsync(array $args = [])\n * @method \\Aws\\Result listReservations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReservationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result purchaseOffering(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise purchaseOfferingAsync(array $args = [])\n * @method \\Aws\\Result rebootInputDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebootInputDeviceAsync(array $args = [])\n * @method \\Aws\\Result rejectInputDeviceTransfer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectInputDeviceTransferAsync(array $args = [])\n * @method \\Aws\\Result startChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startChannelAsync(array $args = [])\n * @method \\Aws\\Result startInputDeviceMaintenanceWindow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startInputDeviceMaintenanceWindowAsync(array $args = [])\n * @method \\Aws\\Result startMultiplex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMultiplexAsync(array $args = [])\n * @method \\Aws\\Result stopChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopChannelAsync(array $args = [])\n * @method \\Aws\\Result stopMultiplex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopMultiplexAsync(array $args = [])\n * @method \\Aws\\Result transferInputDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise transferInputDeviceAsync(array $args = [])\n * @method \\Aws\\Result updateChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChannelAsync(array $args = [])\n * @method \\Aws\\Result updateChannelClass(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChannelClassAsync(array $args = [])\n * @method \\Aws\\Result updateInput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateInputAsync(array $args = [])\n * @method \\Aws\\Result updateInputDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateInputDeviceAsync(array $args = [])\n * @method \\Aws\\Result updateInputSecurityGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateInputSecurityGroupAsync(array $args = [])\n * @method \\Aws\\Result updateMultiplex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMultiplexAsync(array $args = [])\n * @method \\Aws\\Result updateMultiplexProgram(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMultiplexProgramAsync(array $args = [])\n * @method \\Aws\\Result updateReservation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateReservationAsync(array $args = [])\n */\nclass MediaLiveClient extends AwsClient {}\n", "num_lines": 128}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaLive\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Elemental MediaLive** service.\n */\nclass MediaLiveException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaPackage;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Elemental MediaPackage** service.\n * @method \\Aws\\Result configureLogs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise configureLogsAsync(array $args = [])\n * @method \\Aws\\Result createChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelAsync(array $args = [])\n * @method \\Aws\\Result createHarvestJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHarvestJobAsync(array $args = [])\n * @method \\Aws\\Result createOriginEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createOriginEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteOriginEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOriginEndpointAsync(array $args = [])\n * @method \\Aws\\Result describeChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelAsync(array $args = [])\n * @method \\Aws\\Result describeHarvestJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHarvestJobAsync(array $args = [])\n * @method \\Aws\\Result describeOriginEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOriginEndpointAsync(array $args = [])\n * @method \\Aws\\Result listChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelsAsync(array $args = [])\n * @method \\Aws\\Result listHarvestJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHarvestJobsAsync(array $args = [])\n * @method \\Aws\\Result listOriginEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOriginEndpointsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result rotateChannelCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rotateChannelCredentialsAsync(array $args = [])\n * @method \\Aws\\Result rotateIngestEndpointCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rotateIngestEndpointCredentialsAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChannelAsync(array $args = [])\n * @method \\Aws\\Result updateOriginEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateOriginEndpointAsync(array $args = [])\n */\nclass MediaPackageClient extends AwsClient {}\n", "num_lines": 48}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaPackage\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Elemental MediaPackage** service.\n */\nclass MediaPackageException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaPackageV2;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Elemental MediaPackage v2** service.\n * @method \\Aws\\Result createChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelAsync(array $args = [])\n * @method \\Aws\\Result createChannelGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelGroupAsync(array $args = [])\n * @method \\Aws\\Result createOriginEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createOriginEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteChannelGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteChannelPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteOriginEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOriginEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteOriginEndpointPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOriginEndpointPolicyAsync(array $args = [])\n * @method \\Aws\\Result getChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChannelAsync(array $args = [])\n * @method \\Aws\\Result getChannelGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChannelGroupAsync(array $args = [])\n * @method \\Aws\\Result getChannelPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChannelPolicyAsync(array $args = [])\n * @method \\Aws\\Result getOriginEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOriginEndpointAsync(array $args = [])\n * @method \\Aws\\Result getOriginEndpointPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOriginEndpointPolicyAsync(array $args = [])\n * @method \\Aws\\Result listChannelGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelGroupsAsync(array $args = [])\n * @method \\Aws\\Result listChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelsAsync(array $args = [])\n * @method \\Aws\\Result listOriginEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOriginEndpointsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putChannelPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putChannelPolicyAsync(array $args = [])\n * @method \\Aws\\Result putOriginEndpointPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putOriginEndpointPolicyAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChannelAsync(array $args = [])\n * @method \\Aws\\Result updateChannelGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChannelGroupAsync(array $args = [])\n * @method \\Aws\\Result updateOriginEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateOriginEndpointAsync(array $args = [])\n */\nclass MediaPackageV2Client extends AwsClient {}\n", "num_lines": 58}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaPackageV2\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Elemental MediaPackage v2** service.\n */\nclass MediaPackageV2Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaPackageVod;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Elemental MediaPackage VOD** service.\n * @method \\Aws\\Result configureLogs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise configureLogsAsync(array $args = [])\n * @method \\Aws\\Result createAsset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAssetAsync(array $args = [])\n * @method \\Aws\\Result createPackagingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPackagingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createPackagingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPackagingGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteAsset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAssetAsync(array $args = [])\n * @method \\Aws\\Result deletePackagingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePackagingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deletePackagingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePackagingGroupAsync(array $args = [])\n * @method \\Aws\\Result describeAsset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAssetAsync(array $args = [])\n * @method \\Aws\\Result describePackagingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePackagingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describePackagingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePackagingGroupAsync(array $args = [])\n * @method \\Aws\\Result listAssets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssetsAsync(array $args = [])\n * @method \\Aws\\Result listPackagingConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPackagingConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listPackagingGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPackagingGroupsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updatePackagingGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePackagingGroupAsync(array $args = [])\n */\nclass MediaPackageVodClient extends AwsClient {}\n", "num_lines": 44}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaPackageVod\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Elemental MediaPackage VOD** service.\n */\nclass MediaPackageVodException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaStore;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Elemental MediaStore** service.\n * @method \\Aws\\Result createContainer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createContainerAsync(array $args = [])\n * @method \\Aws\\Result deleteContainer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteContainerAsync(array $args = [])\n * @method \\Aws\\Result deleteContainerPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteContainerPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteCorsPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCorsPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteLifecyclePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLifecyclePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteMetricPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMetricPolicyAsync(array $args = [])\n * @method \\Aws\\Result describeContainer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeContainerAsync(array $args = [])\n * @method \\Aws\\Result getContainerPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContainerPolicyAsync(array $args = [])\n * @method \\Aws\\Result getCorsPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCorsPolicyAsync(array $args = [])\n * @method \\Aws\\Result getLifecyclePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLifecyclePolicyAsync(array $args = [])\n * @method \\Aws\\Result getMetricPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMetricPolicyAsync(array $args = [])\n * @method \\Aws\\Result listContainers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listContainersAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putContainerPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putContainerPolicyAsync(array $args = [])\n * @method \\Aws\\Result putCorsPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putCorsPolicyAsync(array $args = [])\n * @method \\Aws\\Result putLifecyclePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putLifecyclePolicyAsync(array $args = [])\n * @method \\Aws\\Result putMetricPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putMetricPolicyAsync(array $args = [])\n * @method \\Aws\\Result startAccessLogging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startAccessLoggingAsync(array $args = [])\n * @method \\Aws\\Result stopAccessLogging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopAccessLoggingAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass MediaStoreClient extends AwsClient {}\n", "num_lines": 52}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaStore\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Elemental MediaStore** service.\n */\nclass MediaStoreException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaStoreData;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Elemental MediaStore Data Plane** service.\n * @method \\Aws\\Result deleteObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteObjectAsync(array $args = [])\n * @method \\Aws\\Result describeObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeObjectAsync(array $args = [])\n * @method \\Aws\\Result getObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectAsync(array $args = [])\n * @method \\Aws\\Result listItems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listItemsAsync(array $args = [])\n * @method \\Aws\\Result putObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putObjectAsync(array $args = [])\n */\nclass MediaStoreDataClient extends AwsClient {}\n", "num_lines": 20}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaStoreData\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Elemental MediaStore Data Plane** service.\n */\nclass MediaStoreDataException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaTailor;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS MediaTailor** service.\n * @method \\Aws\\Result configureLogsForChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise configureLogsForChannelAsync(array $args = [])\n * @method \\Aws\\Result configureLogsForPlaybackConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise configureLogsForPlaybackConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createChannelAsync(array $args = [])\n * @method \\Aws\\Result createLiveSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLiveSourceAsync(array $args = [])\n * @method \\Aws\\Result createPrefetchSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPrefetchScheduleAsync(array $args = [])\n * @method \\Aws\\Result createProgram(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProgramAsync(array $args = [])\n * @method \\Aws\\Result createSourceLocation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSourceLocationAsync(array $args = [])\n * @method \\Aws\\Result createVodSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVodSourceAsync(array $args = [])\n * @method \\Aws\\Result deleteChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteChannelPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChannelPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteLiveSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLiveSourceAsync(array $args = [])\n * @method \\Aws\\Result deletePlaybackConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePlaybackConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deletePrefetchSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePrefetchScheduleAsync(array $args = [])\n * @method \\Aws\\Result deleteProgram(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProgramAsync(array $args = [])\n * @method \\Aws\\Result deleteSourceLocation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSourceLocationAsync(array $args = [])\n * @method \\Aws\\Result deleteVodSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVodSourceAsync(array $args = [])\n * @method \\Aws\\Result describeChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChannelAsync(array $args = [])\n * @method \\Aws\\Result describeLiveSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLiveSourceAsync(array $args = [])\n * @method \\Aws\\Result describeProgram(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProgramAsync(array $args = [])\n * @method \\Aws\\Result describeSourceLocation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSourceLocationAsync(array $args = [])\n * @method \\Aws\\Result describeVodSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVodSourceAsync(array $args = [])\n * @method \\Aws\\Result getChannelPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChannelPolicyAsync(array $args = [])\n * @method \\Aws\\Result getChannelSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChannelScheduleAsync(array $args = [])\n * @method \\Aws\\Result getPlaybackConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPlaybackConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getPrefetchSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPrefetchScheduleAsync(array $args = [])\n * @method \\Aws\\Result listAlerts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAlertsAsync(array $args = [])\n * @method \\Aws\\Result listChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChannelsAsync(array $args = [])\n * @method \\Aws\\Result listLiveSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLiveSourcesAsync(array $args = [])\n * @method \\Aws\\Result listPlaybackConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPlaybackConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listPrefetchSchedules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPrefetchSchedulesAsync(array $args = [])\n * @method \\Aws\\Result listSourceLocations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSourceLocationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listVodSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVodSourcesAsync(array $args = [])\n * @method \\Aws\\Result putChannelPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putChannelPolicyAsync(array $args = [])\n * @method \\Aws\\Result putPlaybackConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPlaybackConfigurationAsync(array $args = [])\n * @method \\Aws\\Result startChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startChannelAsync(array $args = [])\n * @method \\Aws\\Result stopChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopChannelAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChannelAsync(array $args = [])\n * @method \\Aws\\Result updateLiveSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLiveSourceAsync(array $args = [])\n * @method \\Aws\\Result updateProgram(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProgramAsync(array $args = [])\n * @method \\Aws\\Result updateSourceLocation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSourceLocationAsync(array $args = [])\n * @method \\Aws\\Result updateVodSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVodSourceAsync(array $args = [])\n */\nclass MediaTailorClient extends AwsClient {}\n", "num_lines": 98}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MediaTailor\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS MediaTailor** service.\n */\nclass MediaTailorException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MemoryDB;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon MemoryDB** service.\n * @method \\Aws\\Result batchUpdateCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdateClusterAsync(array $args = [])\n * @method \\Aws\\Result copySnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copySnapshotAsync(array $args = [])\n * @method \\Aws\\Result createACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createACLAsync(array $args = [])\n * @method \\Aws\\Result createCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClusterAsync(array $args = [])\n * @method \\Aws\\Result createParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result createSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result createUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserAsync(array $args = [])\n * @method \\Aws\\Result deleteACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteACLAsync(array $args = [])\n * @method \\Aws\\Result deleteCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClusterAsync(array $args = [])\n * @method \\Aws\\Result deleteParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserAsync(array $args = [])\n * @method \\Aws\\Result describeACLs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeACLsAsync(array $args = [])\n * @method \\Aws\\Result describeClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClustersAsync(array $args = [])\n * @method \\Aws\\Result describeEngineVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEngineVersionsAsync(array $args = [])\n * @method \\Aws\\Result describeEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventsAsync(array $args = [])\n * @method \\Aws\\Result describeParameterGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeParameterGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeParametersAsync(array $args = [])\n * @method \\Aws\\Result describeReservedNodes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedNodesAsync(array $args = [])\n * @method \\Aws\\Result describeReservedNodesOfferings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedNodesOfferingsAsync(array $args = [])\n * @method \\Aws\\Result describeServiceUpdates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeServiceUpdatesAsync(array $args = [])\n * @method \\Aws\\Result describeSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result describeSubnetGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSubnetGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUsersAsync(array $args = [])\n * @method \\Aws\\Result failoverShard(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise failoverShardAsync(array $args = [])\n * @method \\Aws\\Result listAllowedNodeTypeUpdates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAllowedNodeTypeUpdatesAsync(array $args = [])\n * @method \\Aws\\Result listTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsAsync(array $args = [])\n * @method \\Aws\\Result purchaseReservedNodesOffering(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise purchaseReservedNodesOfferingAsync(array $args = [])\n * @method \\Aws\\Result resetParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateACLAsync(array $args = [])\n * @method \\Aws\\Result updateCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateClusterAsync(array $args = [])\n * @method \\Aws\\Result updateParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result updateSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result updateUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserAsync(array $args = [])\n */\nclass MemoryDBClient extends AwsClient {}\n", "num_lines": 86}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MemoryDB\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon MemoryDB** service.\n */\nclass MemoryDBException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MigrationHub;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Migration Hub** service.\n * @method \\Aws\\Result associateCreatedArtifact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateCreatedArtifactAsync(array $args = [])\n * @method \\Aws\\Result associateDiscoveredResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateDiscoveredResourceAsync(array $args = [])\n * @method \\Aws\\Result createProgressUpdateStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProgressUpdateStreamAsync(array $args = [])\n * @method \\Aws\\Result deleteProgressUpdateStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProgressUpdateStreamAsync(array $args = [])\n * @method \\Aws\\Result describeApplicationState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeApplicationStateAsync(array $args = [])\n * @method \\Aws\\Result describeMigrationTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMigrationTaskAsync(array $args = [])\n * @method \\Aws\\Result disassociateCreatedArtifact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateCreatedArtifactAsync(array $args = [])\n * @method \\Aws\\Result disassociateDiscoveredResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateDiscoveredResourceAsync(array $args = [])\n * @method \\Aws\\Result importMigrationTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importMigrationTaskAsync(array $args = [])\n * @method \\Aws\\Result listApplicationStates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationStatesAsync(array $args = [])\n * @method \\Aws\\Result listCreatedArtifacts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCreatedArtifactsAsync(array $args = [])\n * @method \\Aws\\Result listDiscoveredResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDiscoveredResourcesAsync(array $args = [])\n * @method \\Aws\\Result listMigrationTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMigrationTasksAsync(array $args = [])\n * @method \\Aws\\Result listProgressUpdateStreams(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProgressUpdateStreamsAsync(array $args = [])\n * @method \\Aws\\Result notifyApplicationState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise notifyApplicationStateAsync(array $args = [])\n * @method \\Aws\\Result notifyMigrationTaskState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise notifyMigrationTaskStateAsync(array $args = [])\n * @method \\Aws\\Result putResourceAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourceAttributesAsync(array $args = [])\n */\nclass MigrationHubClient extends AwsClient {}\n", "num_lines": 44}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MigrationHub\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Migration Hub** service.\n */\nclass MigrationHubException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MigrationHubConfig;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Migration Hub Config** service.\n * @method \\Aws\\Result createHomeRegionControl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHomeRegionControlAsync(array $args = [])\n * @method \\Aws\\Result describeHomeRegionControls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHomeRegionControlsAsync(array $args = [])\n * @method \\Aws\\Result getHomeRegion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getHomeRegionAsync(array $args = [])\n */\nclass MigrationHubConfigClient extends AwsClient {}\n", "num_lines": 16}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MigrationHubConfig\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Migration Hub Config** service.\n */\nclass MigrationHubConfigException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MigrationHubOrchestrator;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Migration Hub Orchestrator** service.\n * @method \\Aws\\Result createWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkflowAsync(array $args = [])\n * @method \\Aws\\Result createWorkflowStep(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkflowStepAsync(array $args = [])\n * @method \\Aws\\Result createWorkflowStepGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkflowStepGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkflowAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkflowStep(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkflowStepAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkflowStepGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkflowStepGroupAsync(array $args = [])\n * @method \\Aws\\Result getTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTemplateAsync(array $args = [])\n * @method \\Aws\\Result getTemplateStep(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTemplateStepAsync(array $args = [])\n * @method \\Aws\\Result getTemplateStepGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTemplateStepGroupAsync(array $args = [])\n * @method \\Aws\\Result getWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkflowAsync(array $args = [])\n * @method \\Aws\\Result getWorkflowStep(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkflowStepAsync(array $args = [])\n * @method \\Aws\\Result getWorkflowStepGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkflowStepGroupAsync(array $args = [])\n * @method \\Aws\\Result listPlugins(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPluginsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTemplateStepGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTemplateStepGroupsAsync(array $args = [])\n * @method \\Aws\\Result listTemplateSteps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTemplateStepsAsync(array $args = [])\n * @method \\Aws\\Result listTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listWorkflowStepGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkflowStepGroupsAsync(array $args = [])\n * @method \\Aws\\Result listWorkflowSteps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkflowStepsAsync(array $args = [])\n * @method \\Aws\\Result listWorkflows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkflowsAsync(array $args = [])\n * @method \\Aws\\Result retryWorkflowStep(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise retryWorkflowStepAsync(array $args = [])\n * @method \\Aws\\Result startWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startWorkflowAsync(array $args = [])\n * @method \\Aws\\Result stopWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopWorkflowAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkflowAsync(array $args = [])\n * @method \\Aws\\Result updateWorkflowStep(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkflowStepAsync(array $args = [])\n * @method \\Aws\\Result updateWorkflowStepGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkflowStepGroupAsync(array $args = [])\n */\nclass MigrationHubOrchestratorClient extends AwsClient {}\n", "num_lines": 66}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MigrationHubOrchestrator\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Migration Hub Orchestrator** service.\n */\nclass MigrationHubOrchestratorException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MigrationHubRefactorSpaces;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Migration Hub Refactor Spaces** service.\n * @method \\Aws\\Result createApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationAsync(array $args = [])\n * @method \\Aws\\Result createEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result createRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRouteAsync(array $args = [])\n * @method \\Aws\\Result createService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceAsync(array $args = [])\n * @method \\Aws\\Result deleteApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRouteAsync(array $args = [])\n * @method \\Aws\\Result deleteService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceAsync(array $args = [])\n * @method \\Aws\\Result getApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApplicationAsync(array $args = [])\n * @method \\Aws\\Result getEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result getResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result getRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRouteAsync(array $args = [])\n * @method \\Aws\\Result getService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceAsync(array $args = [])\n * @method \\Aws\\Result listApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listEnvironmentVpcs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEnvironmentVpcsAsync(array $args = [])\n * @method \\Aws\\Result listEnvironments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEnvironmentsAsync(array $args = [])\n * @method \\Aws\\Result listRoutes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRoutesAsync(array $args = [])\n * @method \\Aws\\Result listServices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServicesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateRoute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRouteAsync(array $args = [])\n */\nclass MigrationHubRefactorSpacesClient extends AwsClient {}\n", "num_lines": 58}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MigrationHubRefactorSpaces\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Migration Hub Refactor Spaces** service.\n */\nclass MigrationHubRefactorSpacesException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MigrationHubStrategyRecommendations;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Migration Hub Strategy Recommendations** service.\n * @method \\Aws\\Result getApplicationComponentDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApplicationComponentDetailsAsync(array $args = [])\n * @method \\Aws\\Result getApplicationComponentStrategies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApplicationComponentStrategiesAsync(array $args = [])\n * @method \\Aws\\Result getAssessment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAssessmentAsync(array $args = [])\n * @method \\Aws\\Result getImportFileTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getImportFileTaskAsync(array $args = [])\n * @method \\Aws\\Result getLatestAssessmentId(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLatestAssessmentIdAsync(array $args = [])\n * @method \\Aws\\Result getPortfolioPreferences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPortfolioPreferencesAsync(array $args = [])\n * @method \\Aws\\Result getPortfolioSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPortfolioSummaryAsync(array $args = [])\n * @method \\Aws\\Result getRecommendationReportDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRecommendationReportDetailsAsync(array $args = [])\n * @method \\Aws\\Result getServerDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServerDetailsAsync(array $args = [])\n * @method \\Aws\\Result getServerStrategies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServerStrategiesAsync(array $args = [])\n * @method \\Aws\\Result listApplicationComponents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationComponentsAsync(array $args = [])\n * @method \\Aws\\Result listCollectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCollectorsAsync(array $args = [])\n * @method \\Aws\\Result listImportFileTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listImportFileTaskAsync(array $args = [])\n * @method \\Aws\\Result listServers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServersAsync(array $args = [])\n * @method \\Aws\\Result putPortfolioPreferences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPortfolioPreferencesAsync(array $args = [])\n * @method \\Aws\\Result startAssessment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startAssessmentAsync(array $args = [])\n * @method \\Aws\\Result startImportFileTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startImportFileTaskAsync(array $args = [])\n * @method \\Aws\\Result startRecommendationReportGeneration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startRecommendationReportGenerationAsync(array $args = [])\n * @method \\Aws\\Result stopAssessment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopAssessmentAsync(array $args = [])\n * @method \\Aws\\Result updateApplicationComponentConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationComponentConfigAsync(array $args = [])\n * @method \\Aws\\Result updateServerConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServerConfigAsync(array $args = [])\n */\nclass MigrationHubStrategyRecommendationsClient extends AwsClient {}\n", "num_lines": 52}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MigrationHubStrategyRecommendations\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Migration Hub Strategy Recommendations** service.\n */\nclass MigrationHubStrategyRecommendationsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Mobile;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Mobile** service.\n * @method \\Aws\\Result createProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProjectAsync(array $args = [])\n * @method \\Aws\\Result deleteProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProjectAsync(array $args = [])\n * @method \\Aws\\Result describeBundle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBundleAsync(array $args = [])\n * @method \\Aws\\Result describeProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProjectAsync(array $args = [])\n * @method \\Aws\\Result exportBundle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportBundleAsync(array $args = [])\n * @method \\Aws\\Result exportProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportProjectAsync(array $args = [])\n * @method \\Aws\\Result listBundles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBundlesAsync(array $args = [])\n * @method \\Aws\\Result listProjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProjectsAsync(array $args = [])\n * @method \\Aws\\Result updateProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProjectAsync(array $args = [])\n */\nclass MobileClient extends AwsClient {}\n", "num_lines": 28}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Mobile\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Mobile** service.\n */\nclass MobileException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MQ;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AmazonMQ** service.\n * @method \\Aws\\Result createBroker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBrokerAsync(array $args = [])\n * @method \\Aws\\Result createConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTagsAsync(array $args = [])\n * @method \\Aws\\Result createUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserAsync(array $args = [])\n * @method \\Aws\\Result deleteBroker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBrokerAsync(array $args = [])\n * @method \\Aws\\Result deleteTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTagsAsync(array $args = [])\n * @method \\Aws\\Result deleteUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserAsync(array $args = [])\n * @method \\Aws\\Result describeBroker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBrokerAsync(array $args = [])\n * @method \\Aws\\Result describeBrokerEngineTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBrokerEngineTypesAsync(array $args = [])\n * @method \\Aws\\Result describeBrokerInstanceOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBrokerInstanceOptionsAsync(array $args = [])\n * @method \\Aws\\Result describeConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeConfigurationRevision(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConfigurationRevisionAsync(array $args = [])\n * @method \\Aws\\Result describeUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserAsync(array $args = [])\n * @method \\Aws\\Result listBrokers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBrokersAsync(array $args = [])\n * @method \\Aws\\Result listConfigurationRevisions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConfigurationRevisionsAsync(array $args = [])\n * @method \\Aws\\Result listConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsAsync(array $args = [])\n * @method \\Aws\\Result listUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUsersAsync(array $args = [])\n * @method \\Aws\\Result promote(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise promoteAsync(array $args = [])\n * @method \\Aws\\Result rebootBroker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebootBrokerAsync(array $args = [])\n * @method \\Aws\\Result updateBroker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBrokerAsync(array $args = [])\n * @method \\Aws\\Result updateConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserAsync(array $args = [])\n */\nclass MQClient extends AwsClient {}\n", "num_lines": 56}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MQ\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AmazonMQ** service.\n */\nclass MQException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MTurk;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Mechanical Turk Requester Service** service.\n * @method \\Aws\\Result acceptQualificationRequest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptQualificationRequestAsync(array $args = [])\n * @method \\Aws\\Result approveAssignment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise approveAssignmentAsync(array $args = [])\n * @method \\Aws\\Result associateQualificationWithWorker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateQualificationWithWorkerAsync(array $args = [])\n * @method \\Aws\\Result createAdditionalAssignmentsForHIT(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAdditionalAssignmentsForHITAsync(array $args = [])\n * @method \\Aws\\Result createHIT(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHITAsync(array $args = [])\n * @method \\Aws\\Result createHITType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHITTypeAsync(array $args = [])\n * @method \\Aws\\Result createHITWithHITType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHITWithHITTypeAsync(array $args = [])\n * @method \\Aws\\Result createQualificationType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createQualificationTypeAsync(array $args = [])\n * @method \\Aws\\Result createWorkerBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkerBlockAsync(array $args = [])\n * @method \\Aws\\Result deleteHIT(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHITAsync(array $args = [])\n * @method \\Aws\\Result deleteQualificationType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteQualificationTypeAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkerBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkerBlockAsync(array $args = [])\n * @method \\Aws\\Result disassociateQualificationFromWorker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateQualificationFromWorkerAsync(array $args = [])\n * @method \\Aws\\Result getAccountBalance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountBalanceAsync(array $args = [])\n * @method \\Aws\\Result getAssignment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAssignmentAsync(array $args = [])\n * @method \\Aws\\Result getFileUploadURL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFileUploadURLAsync(array $args = [])\n * @method \\Aws\\Result getHIT(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getHITAsync(array $args = [])\n * @method \\Aws\\Result getQualificationScore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getQualificationScoreAsync(array $args = [])\n * @method \\Aws\\Result getQualificationType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getQualificationTypeAsync(array $args = [])\n * @method \\Aws\\Result listAssignmentsForHIT(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssignmentsForHITAsync(array $args = [])\n * @method \\Aws\\Result listBonusPayments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBonusPaymentsAsync(array $args = [])\n * @method \\Aws\\Result listHITs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHITsAsync(array $args = [])\n * @method \\Aws\\Result listHITsForQualificationType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHITsForQualificationTypeAsync(array $args = [])\n * @method \\Aws\\Result listQualificationRequests(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listQualificationRequestsAsync(array $args = [])\n * @method \\Aws\\Result listQualificationTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listQualificationTypesAsync(array $args = [])\n * @method \\Aws\\Result listReviewPolicyResultsForHIT(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReviewPolicyResultsForHITAsync(array $args = [])\n * @method \\Aws\\Result listReviewableHITs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReviewableHITsAsync(array $args = [])\n * @method \\Aws\\Result listWorkerBlocks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkerBlocksAsync(array $args = [])\n * @method \\Aws\\Result listWorkersWithQualificationType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkersWithQualificationTypeAsync(array $args = [])\n * @method \\Aws\\Result notifyWorkers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise notifyWorkersAsync(array $args = [])\n * @method \\Aws\\Result rejectAssignment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectAssignmentAsync(array $args = [])\n * @method \\Aws\\Result rejectQualificationRequest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectQualificationRequestAsync(array $args = [])\n * @method \\Aws\\Result sendBonus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendBonusAsync(array $args = [])\n * @method \\Aws\\Result sendTestEventNotification(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendTestEventNotificationAsync(array $args = [])\n * @method \\Aws\\Result updateExpirationForHIT(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateExpirationForHITAsync(array $args = [])\n * @method \\Aws\\Result updateHITReviewStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateHITReviewStatusAsync(array $args = [])\n * @method \\Aws\\Result updateHITTypeOfHIT(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateHITTypeOfHITAsync(array $args = [])\n * @method \\Aws\\Result updateNotificationSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNotificationSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateQualificationType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateQualificationTypeAsync(array $args = [])\n */\nclass MTurkClient extends AwsClient {}\n", "num_lines": 88}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MTurk\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Mechanical Turk Requester Service** service.\n */\nclass MTurkException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Multipart;\n\nuse Aws\\AwsClientInterface as Client;\nuse Aws\\Exception\\AwsException;\nuse GuzzleHttp\\Psr7;\nuse InvalidArgumentException as IAE;\nuse Psr\\Http\\Message\\StreamInterface as Stream;\n\nabstract class AbstractUploader extends AbstractUploadManager\n{\n    /** @var Stream Source of the data to be uploaded. */\n    protected $source;\n\n    /**\n     * @param Client $client\n     * @param mixed  $source\n     * @param array  $config\n     */\n    public function __construct(Client $client, $source, array $config = [])\n    {\n        $this->source = $this->determineSource($source);\n        parent::__construct($client, $config);\n    }\n\n    /**\n     * Create a stream for a part that starts at the current position and\n     * has a length of the upload part size (or less with the final part).\n     *\n     * @param Stream $stream\n     *\n     * @return Psr7\\LimitStream\n     */\n    protected function limitPartStream(Stream $stream)\n    {\n        // Limit what is read from the stream to the part size.\n        return new Psr7\\LimitStream(\n            $stream,\n            $this->state->getPartSize(),\n            $this->source->tell()\n        );\n    }\n\n    protected function getUploadCommands(callable $resultHandler)\n    {\n        // Determine if the source can be seeked.\n        $seekable = $this->source->isSeekable()\n            && $this->source->getMetadata('wrapper_type') === 'plainfile';\n\n        for ($partNumber = 1; $this->isEof($seekable); $partNumber++) {\n            // If we haven't already uploaded this part, yield a new part.\n            if (!$this->state->hasPartBeenUploaded($partNumber)) {\n                $partStartPos = $this->source->tell();\n                if (!($data = $this->createPart($seekable, $partNumber))) {\n                    break;\n                }\n                $command = $this->client->getCommand(\n                    $this->info['command']['upload'],\n                    $data + $this->state->getId()\n                );\n                $command->getHandlerList()->appendSign($resultHandler, 'mup');\n                $numberOfParts = $this->getNumberOfParts($this->state->getPartSize());\n                if (isset($numberOfParts) && $partNumber > $numberOfParts) {\n                    throw new $this->config['exception_class'](\n                        $this->state,\n                        new AwsException(\n                            \"Maximum part number for this job exceeded, file has likely been corrupted.\" .\n                            \"  Please restart this upload.\",\n                            $command\n                        )\n                    );\n                }\n\n                yield $command;\n                if ($this->source->tell() > $partStartPos) {\n                    continue;\n                }\n            }\n\n            // Advance the source's offset if not already advanced.\n            if ($seekable) {\n                $this->source->seek(min(\n                    $this->source->tell() + $this->state->getPartSize(),\n                    $this->source->getSize()\n                ));\n            } else {\n                $this->source->read($this->state->getPartSize());\n            }\n        }\n    }\n\n    /**\n     * Generates the parameters for an upload part by analyzing a range of the\n     * source starting from the current offset up to the part size.\n     *\n     * @param bool $seekable\n     * @param int  $number\n     *\n     * @return array|null\n     */\n    abstract protected function createPart($seekable, $number);\n\n    /**\n     * Checks if the source is at EOF.\n     *\n     * @param bool $seekable\n     *\n     * @return bool\n     */\n    private function isEof($seekable)\n    {\n        return $seekable\n            ? $this->source->tell() < $this->source->getSize()\n            : !$this->source->eof();\n    }\n\n    /**\n     * Turns the provided source into a stream and stores it.\n     *\n     * If a string is provided, it is assumed to be a filename, otherwise, it\n     * passes the value directly to `Psr7\\Utils::streamFor()`.\n     *\n     * @param mixed $source\n     *\n     * @return Stream\n     */\n    private function determineSource($source)\n    {\n        // Use the contents of a file as the data source.\n        if (is_string($source)) {\n            $source = Psr7\\Utils::tryFopen($source, 'r');\n        }\n\n        // Create a source stream.\n        $stream = Psr7\\Utils::streamFor($source);\n        if (!$stream->isReadable()) {\n            throw new IAE('Source stream must be readable.');\n        }\n\n        return $stream;\n    }\n\n    protected function getNumberOfParts($partSize)\n    {\n        if ($sourceSize = $this->source->getSize()) {\n            return ceil($sourceSize/$partSize);\n        }\n        return null;\n    }\n}\n", "num_lines": 151}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Multipart;\n\nuse Aws\\AwsClientInterface as Client;\nuse Aws\\CommandInterface;\nuse Aws\\CommandPool;\nuse Aws\\Exception\\AwsException;\nuse Aws\\Exception\\MultipartUploadException;\nuse Aws\\Result;\nuse Aws\\ResultInterface;\nuse GuzzleHttp\\Promise;\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse InvalidArgumentException as IAE;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Encapsulates the execution of a multipart upload to S3 or Glacier.\n *\n * @internal\n */\nabstract class AbstractUploadManager implements Promise\\PromisorInterface\n{\n    const DEFAULT_CONCURRENCY = 5;\n\n    /** @var array Default values for base multipart configuration */\n    private static $defaultConfig = [\n        'part_size'           => null,\n        'state'               => null,\n        'concurrency'         => self::DEFAULT_CONCURRENCY,\n        'prepare_data_source' => null,\n        'before_initiate'     => null,\n        'before_upload'       => null,\n        'before_complete'     => null,\n        'exception_class'     => MultipartUploadException::class,\n    ];\n\n    /** @var Client Client used for the upload. */\n    protected $client;\n\n    /** @var array Configuration used to perform the upload. */\n    protected $config;\n\n    /** @var array Service-specific information about the upload workflow. */\n    protected $info;\n\n    /** @var PromiseInterface Promise that represents the multipart upload. */\n    protected $promise;\n\n    /** @var UploadState State used to manage the upload. */\n    protected $state;\n\n    /**\n     * @param Client $client\n     * @param array  $config\n     */\n    public function __construct(Client $client, array $config = [])\n    {\n        $this->client = $client;\n        $this->info = $this->loadUploadWorkflowInfo();\n        $this->config = $config + self::$defaultConfig;\n        $this->state = $this->determineState();\n    }\n\n    /**\n     * Returns the current state of the upload\n     *\n     * @return UploadState\n     */\n    public function getState()\n    {\n        return $this->state;\n    }\n\n    /**\n     * Upload the source using multipart upload operations.\n     *\n     * @return Result The result of the CompleteMultipartUpload operation.\n     * @throws \\LogicException if the upload is already complete or aborted.\n     * @throws MultipartUploadException if an upload operation fails.\n     */\n    public function upload()\n    {\n        return $this->promise()->wait();\n    }\n\n    /**\n     * Upload the source asynchronously using multipart upload operations.\n     *\n     * @return PromiseInterface\n     */\n    public function promise()\n    {\n        if ($this->promise) {\n            return $this->promise;\n        }\n\n        return $this->promise = Promise\\Coroutine::of(function () {\n            // Initiate the upload.\n            if ($this->state->isCompleted()) {\n                throw new \\LogicException('This multipart upload has already '\n                    . 'been completed or aborted.'\n                );\n            }\n\n            if (!$this->state->isInitiated()) {\n                // Execute the prepare callback.\n                if (is_callable($this->config[\"prepare_data_source\"])) {\n                    $this->config[\"prepare_data_source\"]();\n                }\n\n                $result = (yield $this->execCommand('initiate', $this->getInitiateParams()));\n                $this->state->setUploadId(\n                    $this->info['id']['upload_id'],\n                    $result[$this->info['id']['upload_id']]\n                );\n                $this->state->setStatus(UploadState::INITIATED);\n            }\n\n            // Create a command pool from a generator that yields UploadPart\n            // commands for each upload part.\n            $resultHandler = $this->getResultHandler($errors);\n            $commands = new CommandPool(\n                $this->client,\n                $this->getUploadCommands($resultHandler),\n                [\n                    'concurrency' => $this->config['concurrency'],\n                    'before'      => $this->config['before_upload'],\n                ]\n            );\n\n            // Execute the pool of commands concurrently, and process errors.\n            yield $commands->promise();\n            if ($errors) {\n                throw new $this->config['exception_class']($this->state, $errors);\n            }\n\n            // Complete the multipart upload.\n            yield $this->execCommand('complete', $this->getCompleteParams());\n            $this->state->setStatus(UploadState::COMPLETED);\n        })->otherwise($this->buildFailureCatch());\n    }\n\n    private function transformException($e)\n    {\n        // Throw errors from the operations as a specific Multipart error.\n        if ($e instanceof AwsException) {\n            $e = new $this->config['exception_class']($this->state, $e);\n        }\n        throw $e;\n    }\n\n    private function buildFailureCatch()\n    {\n        if (interface_exists(\"Throwable\")) {\n            return function (\\Throwable $e) {\n                return $this->transformException($e);\n            };\n        } else {\n            return function (\\Exception $e) {\n                return $this->transformException($e);\n            };\n        }\n    }\n\n    protected function getConfig()\n    {\n        return $this->config;\n    }\n\n    /**\n     * Provides service-specific information about the multipart upload\n     * workflow.\n     *\n     * This array of data should include the keys: 'command', 'id', and 'part_num'.\n     *\n     * @return array\n     */\n    abstract protected function loadUploadWorkflowInfo();\n\n    /**\n     * Determines the part size to use for upload parts.\n     *\n     * Examines the provided partSize value and the source to determine the\n     * best possible part size.\n     *\n     * @throws \\InvalidArgumentException if the part size is invalid.\n     *\n     * @return int\n     */\n    abstract protected function determinePartSize();\n\n    /**\n     * Uses information from the Command and Result to determine which part was\n     * uploaded and mark it as uploaded in the upload's state.\n     *\n     * @param CommandInterface $command\n     * @param ResultInterface  $result\n     */\n    abstract protected function handleResult(\n        CommandInterface $command,\n        ResultInterface $result\n    );\n\n    /**\n     * Gets the service-specific parameters used to initiate the upload.\n     *\n     * @return array\n     */\n    abstract protected function getInitiateParams();\n\n    /**\n     * Gets the service-specific parameters used to complete the upload.\n     *\n     * @return array\n     */\n    abstract protected function getCompleteParams();\n\n    /**\n     * Based on the config and service-specific workflow info, creates a\n     * `Promise` for an `UploadState` object.\n     *\n     * @return PromiseInterface A `Promise` that resolves to an `UploadState`.\n     */\n    private function determineState()\n    {\n        // If the state was provided via config, then just use it.\n        if ($this->config['state'] instanceof UploadState) {\n            return $this->config['state'];\n        }\n\n        // Otherwise, construct a new state from the provided identifiers.\n        $required = $this->info['id'];\n        $id = [$required['upload_id'] => null];\n        unset($required['upload_id']);\n        foreach ($required as $key => $param) {\n            if (!$this->config[$key]) {\n                throw new IAE('You must provide a value for \"' . $key . '\" in '\n                    . 'your config for the MultipartUploader for '\n                    . $this->client->getApi()->getServiceFullName() . '.');\n            }\n            $id[$param] = $this->config[$key];\n        }\n        $state = new UploadState($id);\n        $state->setPartSize($this->determinePartSize());\n\n        return $state;\n    }\n\n    /**\n     * Executes a MUP command with all of the parameters for the operation.\n     *\n     * @param string $operation Name of the operation.\n     * @param array  $params    Service-specific params for the operation.\n     *\n     * @return PromiseInterface\n     */\n    protected function execCommand($operation, array $params)\n    {\n        // Create the command.\n        $command = $this->client->getCommand(\n            $this->info['command'][$operation],\n            $params + $this->state->getId()\n        );\n\n        // Execute the before callback.\n        if (is_callable($this->config[\"before_{$operation}\"])) {\n            $this->config[\"before_{$operation}\"]($command);\n        }\n\n        // Execute the command asynchronously and return the promise.\n        return $this->client->executeAsync($command);\n    }\n\n    /**\n     * Returns a middleware for processing responses of part upload operations.\n     *\n     * - Adds an onFulfilled callback that calls the service-specific\n     *   handleResult method on the Result of the operation.\n     * - Adds an onRejected callback that adds the error to an array of errors.\n     * - Has a passedByRef $errors arg that the exceptions get added to. The\n     *   caller should use that &$errors array to do error handling.\n     *\n     * @param array $errors Errors from upload operations are added to this.\n     *\n     * @return callable\n     */\n    protected function getResultHandler(&$errors = [])\n    {\n        return function (callable $handler) use (&$errors) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request = null\n            ) use ($handler, &$errors) {\n                return $handler($command, $request)->then(\n                    function (ResultInterface $result) use ($command) {\n                        $this->handleResult($command, $result);\n                        return $result;\n                    },\n                    function (AwsException $e) use (&$errors) {\n                        $errors[$e->getCommand()[$this->info['part_num']]] = $e;\n                        return new Result();\n                    }\n                );\n            };\n        };\n    }\n\n    /**\n     * Creates a generator that yields part data for the upload's source.\n     *\n     * Yields associative arrays of parameters that are ultimately merged in\n     * with others to form the complete parameters of a  command. This can\n     * include the Body parameter, which is a limited stream (i.e., a Stream\n     * object, decorated with a LimitStream).\n     *\n     * @param callable $resultHandler\n     *\n     * @return \\Generator\n     */\n    abstract protected function getUploadCommands(callable $resultHandler);\n}\n", "num_lines": 322}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Multipart;\n\n/**\n * Representation of the multipart upload.\n *\n * This object keeps track of the state of the upload, including the status and\n * which parts have been uploaded.\n */\nclass UploadState\n{\n    const CREATED = 0;\n    const INITIATED = 1;\n    const COMPLETED = 2;\n\n    /** @var array Params used to identity the upload. */\n    private $id;\n\n    /** @var int Part size being used by the upload. */\n    private $partSize;\n\n    /** @var array Parts that have been uploaded. */\n    private $uploadedParts = [];\n\n    /** @var int Identifies the status the upload. */\n    private $status = self::CREATED;\n\n    /**\n     * @param array $id Params used to identity the upload.\n     */\n    public function __construct(array $id)\n    {\n        $this->id = $id;\n    }\n\n    /**\n     * Get the upload's ID, which is a tuple of parameters that can uniquely\n     * identify the upload.\n     *\n     * @return array\n     */\n    public function getId()\n    {\n        return $this->id;\n    }\n\n    /**\n     * Set's the \"upload_id\", or 3rd part of the upload's ID. This typically\n     * only needs to be done after initiating an upload.\n     *\n     * @param string $key   The param key of the upload_id.\n     * @param string $value The param value of the upload_id.\n     */\n    public function setUploadId($key, $value)\n    {\n        $this->id[$key] = $value;\n    }\n\n    /**\n     * Get the part size.\n     *\n     * @return int\n     */\n    public function getPartSize()\n    {\n        return $this->partSize;\n    }\n\n    /**\n     * Set the part size.\n     *\n     * @param $partSize int Size of upload parts.\n     */\n    public function setPartSize($partSize)\n    {\n        $this->partSize = $partSize;\n    }\n\n    /**\n     * Marks a part as being uploaded.\n     *\n     * @param int   $partNumber The part number.\n     * @param array $partData   Data from the upload operation that needs to be\n     *                          recalled during the complete operation.\n     */\n    public function markPartAsUploaded($partNumber, array $partData = [])\n    {\n        $this->uploadedParts[$partNumber] = $partData;\n    }\n\n    /**\n     * Returns whether a part has been uploaded.\n     *\n     * @param int $partNumber The part number.\n     *\n     * @return bool\n     */\n    public function hasPartBeenUploaded($partNumber)\n    {\n        return isset($this->uploadedParts[$partNumber]);\n    }\n\n    /**\n     * Returns a sorted list of all the uploaded parts.\n     *\n     * @return array\n     */\n    public function getUploadedParts()\n    {\n        ksort($this->uploadedParts);\n\n        return $this->uploadedParts;\n    }\n\n    /**\n     * Set the status of the upload.\n     *\n     * @param int $status Status is an integer code defined by the constants\n     *                    CREATED, INITIATED, and COMPLETED on this class.\n     */\n    public function setStatus($status)\n    {\n        $this->status = $status;\n    }\n\n    /**\n     * Determines whether the upload state is in the INITIATED status.\n     *\n     * @return bool\n     */\n    public function isInitiated()\n    {\n        return $this->status === self::INITIATED;\n    }\n\n    /**\n     * Determines whether the upload state is in the COMPLETED status.\n     *\n     * @return bool\n     */\n    public function isCompleted()\n    {\n        return $this->status === self::COMPLETED;\n    }\n}\n", "num_lines": 146}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MWAA;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AmazonMWAA** service.\n * @method \\Aws\\Result createCliToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCliTokenAsync(array $args = [])\n * @method \\Aws\\Result createEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result createWebLoginToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWebLoginTokenAsync(array $args = [])\n * @method \\Aws\\Result deleteEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result getEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result listEnvironments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEnvironmentsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result publishMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise publishMetricsAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEnvironmentAsync(array $args = [])\n */\nclass MWAAClient extends AwsClient {}\n", "num_lines": 32}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\MWAA\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AmazonMWAA** service.\n */\nclass MWAAException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Neptune;\n\nuse Aws\\AwsClient;\nuse Aws\\PresignUrlMiddleware;\n\n/**\n * This client is used to interact with the **Amazon Neptune** service.\n * @method \\Aws\\Result addRoleToDBCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addRoleToDBClusterAsync(array $args = [])\n * @method \\Aws\\Result addSourceIdentifierToSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addSourceIdentifierToSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result addTagsToResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsToResourceAsync(array $args = [])\n * @method \\Aws\\Result applyPendingMaintenanceAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise applyPendingMaintenanceActionAsync(array $args = [])\n * @method \\Aws\\Result copyDBClusterParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyDBClusterParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result copyDBClusterSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyDBClusterSnapshotAsync(array $args = [])\n * @method \\Aws\\Result copyDBParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyDBParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result createDBCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBClusterAsync(array $args = [])\n * @method \\Aws\\Result createDBClusterEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBClusterEndpointAsync(array $args = [])\n * @method \\Aws\\Result createDBClusterParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBClusterParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result createDBClusterSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBClusterSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createDBInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBInstanceAsync(array $args = [])\n * @method \\Aws\\Result createDBParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result createDBSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result createEventSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEventSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result createGlobalCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGlobalClusterAsync(array $args = [])\n * @method \\Aws\\Result deleteDBCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBClusterAsync(array $args = [])\n * @method \\Aws\\Result deleteDBClusterEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBClusterEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteDBClusterParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBClusterParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteDBClusterSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBClusterSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteDBInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBInstanceAsync(array $args = [])\n * @method \\Aws\\Result deleteDBParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteDBSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteEventSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result deleteGlobalCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGlobalClusterAsync(array $args = [])\n * @method \\Aws\\Result describeDBClusterEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClusterEndpointsAsync(array $args = [])\n * @method \\Aws\\Result describeDBClusterParameterGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClusterParameterGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeDBClusterParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClusterParametersAsync(array $args = [])\n * @method \\Aws\\Result describeDBClusterSnapshotAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClusterSnapshotAttributesAsync(array $args = [])\n * @method \\Aws\\Result describeDBClusterSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClusterSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result describeDBClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClustersAsync(array $args = [])\n * @method \\Aws\\Result describeDBEngineVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBEngineVersionsAsync(array $args = [])\n * @method \\Aws\\Result describeDBInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeDBParameterGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBParameterGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeDBParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBParametersAsync(array $args = [])\n * @method \\Aws\\Result describeDBSubnetGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBSubnetGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeEngineDefaultClusterParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEngineDefaultClusterParametersAsync(array $args = [])\n * @method \\Aws\\Result describeEngineDefaultParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEngineDefaultParametersAsync(array $args = [])\n * @method \\Aws\\Result describeEventCategories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventCategoriesAsync(array $args = [])\n * @method \\Aws\\Result describeEventSubscriptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventSubscriptionsAsync(array $args = [])\n * @method \\Aws\\Result describeEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventsAsync(array $args = [])\n * @method \\Aws\\Result describeGlobalClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGlobalClustersAsync(array $args = [])\n * @method \\Aws\\Result describeOrderableDBInstanceOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrderableDBInstanceOptionsAsync(array $args = [])\n * @method \\Aws\\Result describePendingMaintenanceActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePendingMaintenanceActionsAsync(array $args = [])\n * @method \\Aws\\Result describeValidDBInstanceModifications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeValidDBInstanceModificationsAsync(array $args = [])\n * @method \\Aws\\Result failoverDBCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise failoverDBClusterAsync(array $args = [])\n * @method \\Aws\\Result failoverGlobalCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise failoverGlobalClusterAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result modifyDBCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBClusterAsync(array $args = [])\n * @method \\Aws\\Result modifyDBClusterEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBClusterEndpointAsync(array $args = [])\n * @method \\Aws\\Result modifyDBClusterParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBClusterParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result modifyDBClusterSnapshotAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBClusterSnapshotAttributeAsync(array $args = [])\n * @method \\Aws\\Result modifyDBInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBInstanceAsync(array $args = [])\n * @method \\Aws\\Result modifyDBParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result modifyDBSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result modifyEventSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyEventSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result modifyGlobalCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyGlobalClusterAsync(array $args = [])\n * @method \\Aws\\Result promoteReadReplicaDBCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise promoteReadReplicaDBClusterAsync(array $args = [])\n * @method \\Aws\\Result rebootDBInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebootDBInstanceAsync(array $args = [])\n * @method \\Aws\\Result removeFromGlobalCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeFromGlobalClusterAsync(array $args = [])\n * @method \\Aws\\Result removeRoleFromDBCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeRoleFromDBClusterAsync(array $args = [])\n * @method \\Aws\\Result removeSourceIdentifierFromSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeSourceIdentifierFromSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result removeTagsFromResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsFromResourceAsync(array $args = [])\n * @method \\Aws\\Result resetDBClusterParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetDBClusterParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result resetDBParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetDBParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result restoreDBClusterFromSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreDBClusterFromSnapshotAsync(array $args = [])\n * @method \\Aws\\Result restoreDBClusterToPointInTime(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreDBClusterToPointInTimeAsync(array $args = [])\n * @method \\Aws\\Result startDBCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDBClusterAsync(array $args = [])\n * @method \\Aws\\Result stopDBCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopDBClusterAsync(array $args = [])\n */\nclass NeptuneClient extends AwsClient {\n    public function __construct(array $args)\n    {\n        $args['with_resolved'] = function (array $args) {\n            $this->getHandlerList()->appendInit(\n                PresignUrlMiddleware::wrap(\n                    $this,\n                    $args['endpoint_provider'],\n                    [\n                        'operations' => [\n                            'CopyDBClusterSnapshot',\n                            'CreateDBCluster',\n                        ],\n                        'service' => 'rds',\n                        'presign_param' => 'PreSignedUrl',\n                        'require_different_region' => true,\n                        'extra_query_params' => [\n                            'CopyDBClusterSnapshot' => ['DestinationRegion'],\n                            'CreateDBCluster' => ['DestinationRegion'],\n                        ]\n                    ]\n                ),\n                'rds.presigner'\n            );\n        };\n        parent::__construct($args);\n    }\n}\n", "num_lines": 176}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Neptune\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Neptune** service.\n */\nclass NeptuneException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\NetworkFirewall;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Network Firewall** service.\n * @method \\Aws\\Result associateFirewallPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateFirewallPolicyAsync(array $args = [])\n * @method \\Aws\\Result associateSubnets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateSubnetsAsync(array $args = [])\n * @method \\Aws\\Result createFirewall(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFirewallAsync(array $args = [])\n * @method \\Aws\\Result createFirewallPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFirewallPolicyAsync(array $args = [])\n * @method \\Aws\\Result createRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result createTLSInspectionConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTLSInspectionConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteFirewall(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFirewallAsync(array $args = [])\n * @method \\Aws\\Result deleteFirewallPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFirewallPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteTLSInspectionConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTLSInspectionConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeFirewall(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFirewallAsync(array $args = [])\n * @method \\Aws\\Result describeFirewallPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFirewallPolicyAsync(array $args = [])\n * @method \\Aws\\Result describeLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result describeRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result describeRuleGroupMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRuleGroupMetadataAsync(array $args = [])\n * @method \\Aws\\Result describeTLSInspectionConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTLSInspectionConfigurationAsync(array $args = [])\n * @method \\Aws\\Result disassociateSubnets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateSubnetsAsync(array $args = [])\n * @method \\Aws\\Result listFirewallPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFirewallPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listFirewalls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFirewallsAsync(array $args = [])\n * @method \\Aws\\Result listRuleGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRuleGroupsAsync(array $args = [])\n * @method \\Aws\\Result listTLSInspectionConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTLSInspectionConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateFirewallDeleteProtection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFirewallDeleteProtectionAsync(array $args = [])\n * @method \\Aws\\Result updateFirewallDescription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFirewallDescriptionAsync(array $args = [])\n * @method \\Aws\\Result updateFirewallEncryptionConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFirewallEncryptionConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateFirewallPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFirewallPolicyAsync(array $args = [])\n * @method \\Aws\\Result updateFirewallPolicyChangeProtection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFirewallPolicyChangeProtectionAsync(array $args = [])\n * @method \\Aws\\Result updateLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result updateSubnetChangeProtection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSubnetChangeProtectionAsync(array $args = [])\n * @method \\Aws\\Result updateTLSInspectionConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTLSInspectionConfigurationAsync(array $args = [])\n */\nclass NetworkFirewallClient extends AwsClient {}\n", "num_lines": 82}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\NetworkFirewall\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Network Firewall** service.\n */\nclass NetworkFirewallException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\NetworkManager;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Network Manager** service.\n * @method \\Aws\\Result acceptAttachment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptAttachmentAsync(array $args = [])\n * @method \\Aws\\Result associateConnectPeer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateConnectPeerAsync(array $args = [])\n * @method \\Aws\\Result associateCustomerGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateCustomerGatewayAsync(array $args = [])\n * @method \\Aws\\Result associateLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateLinkAsync(array $args = [])\n * @method \\Aws\\Result associateTransitGatewayConnectPeer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateTransitGatewayConnectPeerAsync(array $args = [])\n * @method \\Aws\\Result createConnectAttachment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConnectAttachmentAsync(array $args = [])\n * @method \\Aws\\Result createConnectPeer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConnectPeerAsync(array $args = [])\n * @method \\Aws\\Result createConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConnectionAsync(array $args = [])\n * @method \\Aws\\Result createCoreNetwork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCoreNetworkAsync(array $args = [])\n * @method \\Aws\\Result createDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeviceAsync(array $args = [])\n * @method \\Aws\\Result createGlobalNetwork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGlobalNetworkAsync(array $args = [])\n * @method \\Aws\\Result createLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLinkAsync(array $args = [])\n * @method \\Aws\\Result createSite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSiteAsync(array $args = [])\n * @method \\Aws\\Result createSiteToSiteVpnAttachment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSiteToSiteVpnAttachmentAsync(array $args = [])\n * @method \\Aws\\Result createTransitGatewayPeering(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTransitGatewayPeeringAsync(array $args = [])\n * @method \\Aws\\Result createTransitGatewayRouteTableAttachment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTransitGatewayRouteTableAttachmentAsync(array $args = [])\n * @method \\Aws\\Result createVpcAttachment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpcAttachmentAsync(array $args = [])\n * @method \\Aws\\Result deleteAttachment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAttachmentAsync(array $args = [])\n * @method \\Aws\\Result deleteConnectPeer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectPeerAsync(array $args = [])\n * @method \\Aws\\Result deleteConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteCoreNetwork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCoreNetworkAsync(array $args = [])\n * @method \\Aws\\Result deleteCoreNetworkPolicyVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCoreNetworkPolicyVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDeviceAsync(array $args = [])\n * @method \\Aws\\Result deleteGlobalNetwork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGlobalNetworkAsync(array $args = [])\n * @method \\Aws\\Result deleteLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLinkAsync(array $args = [])\n * @method \\Aws\\Result deletePeering(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePeeringAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteSite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSiteAsync(array $args = [])\n * @method \\Aws\\Result deregisterTransitGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterTransitGatewayAsync(array $args = [])\n * @method \\Aws\\Result describeGlobalNetworks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGlobalNetworksAsync(array $args = [])\n * @method \\Aws\\Result disassociateConnectPeer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateConnectPeerAsync(array $args = [])\n * @method \\Aws\\Result disassociateCustomerGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateCustomerGatewayAsync(array $args = [])\n * @method \\Aws\\Result disassociateLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateLinkAsync(array $args = [])\n * @method \\Aws\\Result disassociateTransitGatewayConnectPeer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateTransitGatewayConnectPeerAsync(array $args = [])\n * @method \\Aws\\Result executeCoreNetworkChangeSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise executeCoreNetworkChangeSetAsync(array $args = [])\n * @method \\Aws\\Result getConnectAttachment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConnectAttachmentAsync(array $args = [])\n * @method \\Aws\\Result getConnectPeer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConnectPeerAsync(array $args = [])\n * @method \\Aws\\Result getConnectPeerAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConnectPeerAssociationsAsync(array $args = [])\n * @method \\Aws\\Result getConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConnectionsAsync(array $args = [])\n * @method \\Aws\\Result getCoreNetwork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCoreNetworkAsync(array $args = [])\n * @method \\Aws\\Result getCoreNetworkChangeEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCoreNetworkChangeEventsAsync(array $args = [])\n * @method \\Aws\\Result getCoreNetworkChangeSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCoreNetworkChangeSetAsync(array $args = [])\n * @method \\Aws\\Result getCoreNetworkPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCoreNetworkPolicyAsync(array $args = [])\n * @method \\Aws\\Result getCustomerGatewayAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCustomerGatewayAssociationsAsync(array $args = [])\n * @method \\Aws\\Result getDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDevicesAsync(array $args = [])\n * @method \\Aws\\Result getLinkAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLinkAssociationsAsync(array $args = [])\n * @method \\Aws\\Result getLinks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLinksAsync(array $args = [])\n * @method \\Aws\\Result getNetworkResourceCounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNetworkResourceCountsAsync(array $args = [])\n * @method \\Aws\\Result getNetworkResourceRelationships(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNetworkResourceRelationshipsAsync(array $args = [])\n * @method \\Aws\\Result getNetworkResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNetworkResourcesAsync(array $args = [])\n * @method \\Aws\\Result getNetworkRoutes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNetworkRoutesAsync(array $args = [])\n * @method \\Aws\\Result getNetworkTelemetry(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNetworkTelemetryAsync(array $args = [])\n * @method \\Aws\\Result getResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result getRouteAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRouteAnalysisAsync(array $args = [])\n * @method \\Aws\\Result getSiteToSiteVpnAttachment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSiteToSiteVpnAttachmentAsync(array $args = [])\n * @method \\Aws\\Result getSites(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSitesAsync(array $args = [])\n * @method \\Aws\\Result getTransitGatewayConnectPeerAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTransitGatewayConnectPeerAssociationsAsync(array $args = [])\n * @method \\Aws\\Result getTransitGatewayPeering(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTransitGatewayPeeringAsync(array $args = [])\n * @method \\Aws\\Result getTransitGatewayRegistrations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTransitGatewayRegistrationsAsync(array $args = [])\n * @method \\Aws\\Result getTransitGatewayRouteTableAttachment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTransitGatewayRouteTableAttachmentAsync(array $args = [])\n * @method \\Aws\\Result getVpcAttachment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVpcAttachmentAsync(array $args = [])\n * @method \\Aws\\Result listAttachments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAttachmentsAsync(array $args = [])\n * @method \\Aws\\Result listConnectPeers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConnectPeersAsync(array $args = [])\n * @method \\Aws\\Result listCoreNetworkPolicyVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCoreNetworkPolicyVersionsAsync(array $args = [])\n * @method \\Aws\\Result listCoreNetworks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCoreNetworksAsync(array $args = [])\n * @method \\Aws\\Result listOrganizationServiceAccessStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOrganizationServiceAccessStatusAsync(array $args = [])\n * @method \\Aws\\Result listPeerings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPeeringsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putCoreNetworkPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putCoreNetworkPolicyAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result registerTransitGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerTransitGatewayAsync(array $args = [])\n * @method \\Aws\\Result rejectAttachment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectAttachmentAsync(array $args = [])\n * @method \\Aws\\Result restoreCoreNetworkPolicyVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreCoreNetworkPolicyVersionAsync(array $args = [])\n * @method \\Aws\\Result startOrganizationServiceAccessUpdate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startOrganizationServiceAccessUpdateAsync(array $args = [])\n * @method \\Aws\\Result startRouteAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startRouteAnalysisAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConnectionAsync(array $args = [])\n * @method \\Aws\\Result updateCoreNetwork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCoreNetworkAsync(array $args = [])\n * @method \\Aws\\Result updateDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDeviceAsync(array $args = [])\n * @method \\Aws\\Result updateGlobalNetwork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGlobalNetworkAsync(array $args = [])\n * @method \\Aws\\Result updateLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLinkAsync(array $args = [])\n * @method \\Aws\\Result updateNetworkResourceMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNetworkResourceMetadataAsync(array $args = [])\n * @method \\Aws\\Result updateSite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSiteAsync(array $args = [])\n * @method \\Aws\\Result updateVpcAttachment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVpcAttachmentAsync(array $args = [])\n */\nclass NetworkManagerClient extends AwsClient {}\n", "num_lines": 180}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\NetworkManager\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Network Manager** service.\n */\nclass NetworkManagerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\NimbleStudio;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AmazonNimbleStudio** service.\n * @method \\Aws\\Result acceptEulas(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptEulasAsync(array $args = [])\n * @method \\Aws\\Result createLaunchProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLaunchProfileAsync(array $args = [])\n * @method \\Aws\\Result createStreamingImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStreamingImageAsync(array $args = [])\n * @method \\Aws\\Result createStreamingSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStreamingSessionAsync(array $args = [])\n * @method \\Aws\\Result createStreamingSessionStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStreamingSessionStreamAsync(array $args = [])\n * @method \\Aws\\Result createStudio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStudioAsync(array $args = [])\n * @method \\Aws\\Result createStudioComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStudioComponentAsync(array $args = [])\n * @method \\Aws\\Result deleteLaunchProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLaunchProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteLaunchProfileMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLaunchProfileMemberAsync(array $args = [])\n * @method \\Aws\\Result deleteStreamingImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStreamingImageAsync(array $args = [])\n * @method \\Aws\\Result deleteStreamingSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStreamingSessionAsync(array $args = [])\n * @method \\Aws\\Result deleteStudio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStudioAsync(array $args = [])\n * @method \\Aws\\Result deleteStudioComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStudioComponentAsync(array $args = [])\n * @method \\Aws\\Result deleteStudioMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStudioMemberAsync(array $args = [])\n * @method \\Aws\\Result getEula(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEulaAsync(array $args = [])\n * @method \\Aws\\Result getLaunchProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLaunchProfileAsync(array $args = [])\n * @method \\Aws\\Result getLaunchProfileDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLaunchProfileDetailsAsync(array $args = [])\n * @method \\Aws\\Result getLaunchProfileInitialization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLaunchProfileInitializationAsync(array $args = [])\n * @method \\Aws\\Result getLaunchProfileMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLaunchProfileMemberAsync(array $args = [])\n * @method \\Aws\\Result getStreamingImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStreamingImageAsync(array $args = [])\n * @method \\Aws\\Result getStreamingSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStreamingSessionAsync(array $args = [])\n * @method \\Aws\\Result getStreamingSessionBackup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStreamingSessionBackupAsync(array $args = [])\n * @method \\Aws\\Result getStreamingSessionStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStreamingSessionStreamAsync(array $args = [])\n * @method \\Aws\\Result getStudio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStudioAsync(array $args = [])\n * @method \\Aws\\Result getStudioComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStudioComponentAsync(array $args = [])\n * @method \\Aws\\Result getStudioMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStudioMemberAsync(array $args = [])\n * @method \\Aws\\Result listEulaAcceptances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEulaAcceptancesAsync(array $args = [])\n * @method \\Aws\\Result listEulas(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEulasAsync(array $args = [])\n * @method \\Aws\\Result listLaunchProfileMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLaunchProfileMembersAsync(array $args = [])\n * @method \\Aws\\Result listLaunchProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLaunchProfilesAsync(array $args = [])\n * @method \\Aws\\Result listStreamingImages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStreamingImagesAsync(array $args = [])\n * @method \\Aws\\Result listStreamingSessionBackups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStreamingSessionBackupsAsync(array $args = [])\n * @method \\Aws\\Result listStreamingSessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStreamingSessionsAsync(array $args = [])\n * @method \\Aws\\Result listStudioComponents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStudioComponentsAsync(array $args = [])\n * @method \\Aws\\Result listStudioMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStudioMembersAsync(array $args = [])\n * @method \\Aws\\Result listStudios(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStudiosAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putLaunchProfileMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putLaunchProfileMembersAsync(array $args = [])\n * @method \\Aws\\Result putStudioMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putStudioMembersAsync(array $args = [])\n * @method \\Aws\\Result startStreamingSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startStreamingSessionAsync(array $args = [])\n * @method \\Aws\\Result startStudioSSOConfigurationRepair(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startStudioSSOConfigurationRepairAsync(array $args = [])\n * @method \\Aws\\Result stopStreamingSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopStreamingSessionAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateLaunchProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLaunchProfileAsync(array $args = [])\n * @method \\Aws\\Result updateLaunchProfileMember(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLaunchProfileMemberAsync(array $args = [])\n * @method \\Aws\\Result updateStreamingImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStreamingImageAsync(array $args = [])\n * @method \\Aws\\Result updateStudio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStudioAsync(array $args = [])\n * @method \\Aws\\Result updateStudioComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStudioComponentAsync(array $args = [])\n */\nclass NimbleStudioClient extends AwsClient {}\n", "num_lines": 108}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\NimbleStudio\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AmazonNimbleStudio** service.\n */\nclass NimbleStudioException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\OAM;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **CloudWatch Observability Access Manager** service.\n * @method \\Aws\\Result createLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLinkAsync(array $args = [])\n * @method \\Aws\\Result createSink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSinkAsync(array $args = [])\n * @method \\Aws\\Result deleteLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLinkAsync(array $args = [])\n * @method \\Aws\\Result deleteSink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSinkAsync(array $args = [])\n * @method \\Aws\\Result getLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLinkAsync(array $args = [])\n * @method \\Aws\\Result getSink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSinkAsync(array $args = [])\n * @method \\Aws\\Result getSinkPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSinkPolicyAsync(array $args = [])\n * @method \\Aws\\Result listAttachedLinks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAttachedLinksAsync(array $args = [])\n * @method \\Aws\\Result listLinks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLinksAsync(array $args = [])\n * @method \\Aws\\Result listSinks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSinksAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putSinkPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSinkPolicyAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateLink(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLinkAsync(array $args = [])\n */\nclass OAMClient extends AwsClient {}\n", "num_lines": 40}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\OAM\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **CloudWatch Observability Access Manager** service.\n */\nclass OAMException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Omics;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Omics** service.\n * @method \\Aws\\Result abortMultipartReadSetUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise abortMultipartReadSetUploadAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteReadSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteReadSetAsync(array $args = [])\n * @method \\Aws\\Result cancelAnnotationImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelAnnotationImportJobAsync(array $args = [])\n * @method \\Aws\\Result cancelRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelRunAsync(array $args = [])\n * @method \\Aws\\Result cancelVariantImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelVariantImportJobAsync(array $args = [])\n * @method \\Aws\\Result completeMultipartReadSetUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise completeMultipartReadSetUploadAsync(array $args = [])\n * @method \\Aws\\Result createAnnotationStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAnnotationStoreAsync(array $args = [])\n * @method \\Aws\\Result createMultipartReadSetUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMultipartReadSetUploadAsync(array $args = [])\n * @method \\Aws\\Result createReferenceStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReferenceStoreAsync(array $args = [])\n * @method \\Aws\\Result createRunGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRunGroupAsync(array $args = [])\n * @method \\Aws\\Result createSequenceStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSequenceStoreAsync(array $args = [])\n * @method \\Aws\\Result createVariantStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVariantStoreAsync(array $args = [])\n * @method \\Aws\\Result createWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkflowAsync(array $args = [])\n * @method \\Aws\\Result deleteAnnotationStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAnnotationStoreAsync(array $args = [])\n * @method \\Aws\\Result deleteReference(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReferenceAsync(array $args = [])\n * @method \\Aws\\Result deleteReferenceStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReferenceStoreAsync(array $args = [])\n * @method \\Aws\\Result deleteRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRunAsync(array $args = [])\n * @method \\Aws\\Result deleteRunGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRunGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteSequenceStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSequenceStoreAsync(array $args = [])\n * @method \\Aws\\Result deleteVariantStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVariantStoreAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkflowAsync(array $args = [])\n * @method \\Aws\\Result getAnnotationImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAnnotationImportJobAsync(array $args = [])\n * @method \\Aws\\Result getAnnotationStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAnnotationStoreAsync(array $args = [])\n * @method \\Aws\\Result getReadSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReadSetAsync(array $args = [])\n * @method \\Aws\\Result getReadSetActivationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReadSetActivationJobAsync(array $args = [])\n * @method \\Aws\\Result getReadSetExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReadSetExportJobAsync(array $args = [])\n * @method \\Aws\\Result getReadSetImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReadSetImportJobAsync(array $args = [])\n * @method \\Aws\\Result getReadSetMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReadSetMetadataAsync(array $args = [])\n * @method \\Aws\\Result getReference(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReferenceAsync(array $args = [])\n * @method \\Aws\\Result getReferenceImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReferenceImportJobAsync(array $args = [])\n * @method \\Aws\\Result getReferenceMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReferenceMetadataAsync(array $args = [])\n * @method \\Aws\\Result getReferenceStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReferenceStoreAsync(array $args = [])\n * @method \\Aws\\Result getRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRunAsync(array $args = [])\n * @method \\Aws\\Result getRunGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRunGroupAsync(array $args = [])\n * @method \\Aws\\Result getRunTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRunTaskAsync(array $args = [])\n * @method \\Aws\\Result getSequenceStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSequenceStoreAsync(array $args = [])\n * @method \\Aws\\Result getVariantImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVariantImportJobAsync(array $args = [])\n * @method \\Aws\\Result getVariantStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVariantStoreAsync(array $args = [])\n * @method \\Aws\\Result getWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkflowAsync(array $args = [])\n * @method \\Aws\\Result listAnnotationImportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAnnotationImportJobsAsync(array $args = [])\n * @method \\Aws\\Result listAnnotationStores(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAnnotationStoresAsync(array $args = [])\n * @method \\Aws\\Result listMultipartReadSetUploads(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMultipartReadSetUploadsAsync(array $args = [])\n * @method \\Aws\\Result listReadSetActivationJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReadSetActivationJobsAsync(array $args = [])\n * @method \\Aws\\Result listReadSetExportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReadSetExportJobsAsync(array $args = [])\n * @method \\Aws\\Result listReadSetImportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReadSetImportJobsAsync(array $args = [])\n * @method \\Aws\\Result listReadSetUploadParts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReadSetUploadPartsAsync(array $args = [])\n * @method \\Aws\\Result listReadSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReadSetsAsync(array $args = [])\n * @method \\Aws\\Result listReferenceImportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReferenceImportJobsAsync(array $args = [])\n * @method \\Aws\\Result listReferenceStores(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReferenceStoresAsync(array $args = [])\n * @method \\Aws\\Result listReferences(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReferencesAsync(array $args = [])\n * @method \\Aws\\Result listRunGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRunGroupsAsync(array $args = [])\n * @method \\Aws\\Result listRunTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRunTasksAsync(array $args = [])\n * @method \\Aws\\Result listRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRunsAsync(array $args = [])\n * @method \\Aws\\Result listSequenceStores(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSequenceStoresAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listVariantImportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVariantImportJobsAsync(array $args = [])\n * @method \\Aws\\Result listVariantStores(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVariantStoresAsync(array $args = [])\n * @method \\Aws\\Result listWorkflows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkflowsAsync(array $args = [])\n * @method \\Aws\\Result startAnnotationImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startAnnotationImportJobAsync(array $args = [])\n * @method \\Aws\\Result startReadSetActivationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startReadSetActivationJobAsync(array $args = [])\n * @method \\Aws\\Result startReadSetExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startReadSetExportJobAsync(array $args = [])\n * @method \\Aws\\Result startReadSetImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startReadSetImportJobAsync(array $args = [])\n * @method \\Aws\\Result startReferenceImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startReferenceImportJobAsync(array $args = [])\n * @method \\Aws\\Result startRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startRunAsync(array $args = [])\n * @method \\Aws\\Result startVariantImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startVariantImportJobAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAnnotationStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAnnotationStoreAsync(array $args = [])\n * @method \\Aws\\Result updateRunGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRunGroupAsync(array $args = [])\n * @method \\Aws\\Result updateVariantStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVariantStoreAsync(array $args = [])\n * @method \\Aws\\Result updateWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkflowAsync(array $args = [])\n * @method \\Aws\\Result uploadReadSetPart(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise uploadReadSetPartAsync(array $args = [])\n */\nclass OmicsClient extends AwsClient {}\n", "num_lines": 154}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Omics\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Omics** service.\n */\nclass OmicsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\OpenSearchServerless;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **OpenSearch Service Serverless** service.\n * @method \\Aws\\Result batchGetCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetCollectionAsync(array $args = [])\n * @method \\Aws\\Result batchGetVpcEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetVpcEndpointAsync(array $args = [])\n * @method \\Aws\\Result createAccessPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccessPolicyAsync(array $args = [])\n * @method \\Aws\\Result createCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCollectionAsync(array $args = [])\n * @method \\Aws\\Result createSecurityConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSecurityConfigAsync(array $args = [])\n * @method \\Aws\\Result createSecurityPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSecurityPolicyAsync(array $args = [])\n * @method \\Aws\\Result createVpcEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpcEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteAccessPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccessPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCollectionAsync(array $args = [])\n * @method \\Aws\\Result deleteSecurityConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSecurityConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteSecurityPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSecurityPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteVpcEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpcEndpointAsync(array $args = [])\n * @method \\Aws\\Result getAccessPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccessPolicyAsync(array $args = [])\n * @method \\Aws\\Result getAccountSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountSettingsAsync(array $args = [])\n * @method \\Aws\\Result getPoliciesStats(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPoliciesStatsAsync(array $args = [])\n * @method \\Aws\\Result getSecurityConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSecurityConfigAsync(array $args = [])\n * @method \\Aws\\Result getSecurityPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSecurityPolicyAsync(array $args = [])\n * @method \\Aws\\Result listAccessPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccessPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listCollections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCollectionsAsync(array $args = [])\n * @method \\Aws\\Result listSecurityConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSecurityConfigsAsync(array $args = [])\n * @method \\Aws\\Result listSecurityPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSecurityPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listVpcEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVpcEndpointsAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAccessPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccessPolicyAsync(array $args = [])\n * @method \\Aws\\Result updateAccountSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccountSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCollectionAsync(array $args = [])\n * @method \\Aws\\Result updateSecurityConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSecurityConfigAsync(array $args = [])\n * @method \\Aws\\Result updateSecurityPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSecurityPolicyAsync(array $args = [])\n * @method \\Aws\\Result updateVpcEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVpcEndpointAsync(array $args = [])\n */\nclass OpenSearchServerlessClient extends AwsClient {}\n", "num_lines": 72}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\OpenSearchServerless\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **OpenSearch Service Serverless** service.\n */\nclass OpenSearchServerlessException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\OpenSearchService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon OpenSearch Service** service.\n * @method \\Aws\\Result acceptInboundConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptInboundConnectionAsync(array $args = [])\n * @method \\Aws\\Result addTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsAsync(array $args = [])\n * @method \\Aws\\Result associatePackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associatePackageAsync(array $args = [])\n * @method \\Aws\\Result authorizeVpcEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise authorizeVpcEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result cancelServiceSoftwareUpdate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelServiceSoftwareUpdateAsync(array $args = [])\n * @method \\Aws\\Result createDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDomainAsync(array $args = [])\n * @method \\Aws\\Result createOutboundConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createOutboundConnectionAsync(array $args = [])\n * @method \\Aws\\Result createPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPackageAsync(array $args = [])\n * @method \\Aws\\Result createVpcEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVpcEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainAsync(array $args = [])\n * @method \\Aws\\Result deleteInboundConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInboundConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteOutboundConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOutboundConnectionAsync(array $args = [])\n * @method \\Aws\\Result deletePackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePackageAsync(array $args = [])\n * @method \\Aws\\Result deleteVpcEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVpcEndpointAsync(array $args = [])\n * @method \\Aws\\Result describeDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainAsync(array $args = [])\n * @method \\Aws\\Result describeDomainAutoTunes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainAutoTunesAsync(array $args = [])\n * @method \\Aws\\Result describeDomainChangeProgress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainChangeProgressAsync(array $args = [])\n * @method \\Aws\\Result describeDomainConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainConfigAsync(array $args = [])\n * @method \\Aws\\Result describeDomainHealth(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainHealthAsync(array $args = [])\n * @method \\Aws\\Result describeDomainNodes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainNodesAsync(array $args = [])\n * @method \\Aws\\Result describeDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainsAsync(array $args = [])\n * @method \\Aws\\Result describeDryRunProgress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDryRunProgressAsync(array $args = [])\n * @method \\Aws\\Result describeInboundConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInboundConnectionsAsync(array $args = [])\n * @method \\Aws\\Result describeInstanceTypeLimits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceTypeLimitsAsync(array $args = [])\n * @method \\Aws\\Result describeOutboundConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOutboundConnectionsAsync(array $args = [])\n * @method \\Aws\\Result describePackages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePackagesAsync(array $args = [])\n * @method \\Aws\\Result describeReservedInstanceOfferings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedInstanceOfferingsAsync(array $args = [])\n * @method \\Aws\\Result describeReservedInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeVpcEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVpcEndpointsAsync(array $args = [])\n * @method \\Aws\\Result dissociatePackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise dissociatePackageAsync(array $args = [])\n * @method \\Aws\\Result getCompatibleVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCompatibleVersionsAsync(array $args = [])\n * @method \\Aws\\Result getPackageVersionHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPackageVersionHistoryAsync(array $args = [])\n * @method \\Aws\\Result getUpgradeHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUpgradeHistoryAsync(array $args = [])\n * @method \\Aws\\Result getUpgradeStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUpgradeStatusAsync(array $args = [])\n * @method \\Aws\\Result listDomainNames(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainNamesAsync(array $args = [])\n * @method \\Aws\\Result listDomainsForPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainsForPackageAsync(array $args = [])\n * @method \\Aws\\Result listInstanceTypeDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInstanceTypeDetailsAsync(array $args = [])\n * @method \\Aws\\Result listPackagesForDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPackagesForDomainAsync(array $args = [])\n * @method \\Aws\\Result listScheduledActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listScheduledActionsAsync(array $args = [])\n * @method \\Aws\\Result listTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsAsync(array $args = [])\n * @method \\Aws\\Result listVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVersionsAsync(array $args = [])\n * @method \\Aws\\Result listVpcEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVpcEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result listVpcEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVpcEndpointsAsync(array $args = [])\n * @method \\Aws\\Result listVpcEndpointsForDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVpcEndpointsForDomainAsync(array $args = [])\n * @method \\Aws\\Result purchaseReservedInstanceOffering(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise purchaseReservedInstanceOfferingAsync(array $args = [])\n * @method \\Aws\\Result rejectInboundConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectInboundConnectionAsync(array $args = [])\n * @method \\Aws\\Result removeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsAsync(array $args = [])\n * @method \\Aws\\Result revokeVpcEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeVpcEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result startServiceSoftwareUpdate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startServiceSoftwareUpdateAsync(array $args = [])\n * @method \\Aws\\Result updateDomainConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDomainConfigAsync(array $args = [])\n * @method \\Aws\\Result updatePackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePackageAsync(array $args = [])\n * @method \\Aws\\Result updateScheduledAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateScheduledActionAsync(array $args = [])\n * @method \\Aws\\Result updateVpcEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVpcEndpointAsync(array $args = [])\n * @method \\Aws\\Result upgradeDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise upgradeDomainAsync(array $args = [])\n */\nclass OpenSearchServiceClient extends AwsClient {}\n", "num_lines": 118}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\OpenSearchService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon OpenSearch Service** service.\n */\nclass OpenSearchServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\OpsWorks;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS OpsWorks** service.\n *\n * @method \\Aws\\Result assignInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise assignInstanceAsync(array $args = [])\n * @method \\Aws\\Result assignVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise assignVolumeAsync(array $args = [])\n * @method \\Aws\\Result associateElasticIp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateElasticIpAsync(array $args = [])\n * @method \\Aws\\Result attachElasticLoadBalancer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachElasticLoadBalancerAsync(array $args = [])\n * @method \\Aws\\Result cloneStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cloneStackAsync(array $args = [])\n * @method \\Aws\\Result createApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppAsync(array $args = [])\n * @method \\Aws\\Result createDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeploymentAsync(array $args = [])\n * @method \\Aws\\Result createInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInstanceAsync(array $args = [])\n * @method \\Aws\\Result createLayer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLayerAsync(array $args = [])\n * @method \\Aws\\Result createStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStackAsync(array $args = [])\n * @method \\Aws\\Result createUserProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppAsync(array $args = [])\n * @method \\Aws\\Result deleteInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInstanceAsync(array $args = [])\n * @method \\Aws\\Result deleteLayer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLayerAsync(array $args = [])\n * @method \\Aws\\Result deleteStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStackAsync(array $args = [])\n * @method \\Aws\\Result deleteUserProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserProfileAsync(array $args = [])\n * @method \\Aws\\Result deregisterEcsCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterEcsClusterAsync(array $args = [])\n * @method \\Aws\\Result deregisterElasticIp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterElasticIpAsync(array $args = [])\n * @method \\Aws\\Result deregisterInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterInstanceAsync(array $args = [])\n * @method \\Aws\\Result deregisterRdsDbInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterRdsDbInstanceAsync(array $args = [])\n * @method \\Aws\\Result deregisterVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterVolumeAsync(array $args = [])\n * @method \\Aws\\Result describeAgentVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAgentVersionsAsync(array $args = [])\n * @method \\Aws\\Result describeApps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppsAsync(array $args = [])\n * @method \\Aws\\Result describeCommands(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCommandsAsync(array $args = [])\n * @method \\Aws\\Result describeDeployments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDeploymentsAsync(array $args = [])\n * @method \\Aws\\Result describeEcsClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEcsClustersAsync(array $args = [])\n * @method \\Aws\\Result describeElasticIps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeElasticIpsAsync(array $args = [])\n * @method \\Aws\\Result describeElasticLoadBalancers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeElasticLoadBalancersAsync(array $args = [])\n * @method \\Aws\\Result describeInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeLayers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLayersAsync(array $args = [])\n * @method \\Aws\\Result describeLoadBasedAutoScaling(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLoadBasedAutoScalingAsync(array $args = [])\n * @method \\Aws\\Result describeMyUserProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMyUserProfileAsync(array $args = [])\n * @method \\Aws\\Result describeOperatingSystems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOperatingSystemsAsync(array $args = [])\n * @method \\Aws\\Result describePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePermissionsAsync(array $args = [])\n * @method \\Aws\\Result describeRaidArrays(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRaidArraysAsync(array $args = [])\n * @method \\Aws\\Result describeRdsDbInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRdsDbInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeServiceErrors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeServiceErrorsAsync(array $args = [])\n * @method \\Aws\\Result describeStackProvisioningParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStackProvisioningParametersAsync(array $args = [])\n * @method \\Aws\\Result describeStackSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStackSummaryAsync(array $args = [])\n * @method \\Aws\\Result describeStacks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStacksAsync(array $args = [])\n * @method \\Aws\\Result describeTimeBasedAutoScaling(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTimeBasedAutoScalingAsync(array $args = [])\n * @method \\Aws\\Result describeUserProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserProfilesAsync(array $args = [])\n * @method \\Aws\\Result describeVolumes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVolumesAsync(array $args = [])\n * @method \\Aws\\Result detachElasticLoadBalancer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachElasticLoadBalancerAsync(array $args = [])\n * @method \\Aws\\Result disassociateElasticIp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateElasticIpAsync(array $args = [])\n * @method \\Aws\\Result getHostnameSuggestion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getHostnameSuggestionAsync(array $args = [])\n * @method \\Aws\\Result grantAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise grantAccessAsync(array $args = [])\n * @method \\Aws\\Result listTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsAsync(array $args = [])\n * @method \\Aws\\Result rebootInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebootInstanceAsync(array $args = [])\n * @method \\Aws\\Result registerEcsCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerEcsClusterAsync(array $args = [])\n * @method \\Aws\\Result registerElasticIp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerElasticIpAsync(array $args = [])\n * @method \\Aws\\Result registerInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerInstanceAsync(array $args = [])\n * @method \\Aws\\Result registerRdsDbInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerRdsDbInstanceAsync(array $args = [])\n * @method \\Aws\\Result registerVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerVolumeAsync(array $args = [])\n * @method \\Aws\\Result setLoadBasedAutoScaling(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setLoadBasedAutoScalingAsync(array $args = [])\n * @method \\Aws\\Result setPermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setPermissionAsync(array $args = [])\n * @method \\Aws\\Result setTimeBasedAutoScaling(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setTimeBasedAutoScalingAsync(array $args = [])\n * @method \\Aws\\Result startInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startInstanceAsync(array $args = [])\n * @method \\Aws\\Result startStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startStackAsync(array $args = [])\n * @method \\Aws\\Result stopInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopInstanceAsync(array $args = [])\n * @method \\Aws\\Result stopStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopStackAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result unassignInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unassignInstanceAsync(array $args = [])\n * @method \\Aws\\Result unassignVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unassignVolumeAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppAsync(array $args = [])\n * @method \\Aws\\Result updateElasticIp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateElasticIpAsync(array $args = [])\n * @method \\Aws\\Result updateInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateInstanceAsync(array $args = [])\n * @method \\Aws\\Result updateLayer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLayerAsync(array $args = [])\n * @method \\Aws\\Result updateMyUserProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMyUserProfileAsync(array $args = [])\n * @method \\Aws\\Result updateRdsDbInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRdsDbInstanceAsync(array $args = [])\n * @method \\Aws\\Result updateStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStackAsync(array $args = [])\n * @method \\Aws\\Result updateUserProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserProfileAsync(array $args = [])\n * @method \\Aws\\Result updateVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVolumeAsync(array $args = [])\n */\nclass OpsWorksClient extends AwsClient {}\n", "num_lines": 159}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\OpsWorks\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the AWS OpsWorks service.\n */\nclass OpsWorksException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\OpsWorksCM;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS OpsWorks for Chef Automate** service.\n * @method \\Aws\\Result associateNode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateNodeAsync(array $args = [])\n * @method \\Aws\\Result createBackup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBackupAsync(array $args = [])\n * @method \\Aws\\Result createServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServerAsync(array $args = [])\n * @method \\Aws\\Result deleteBackup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBackupAsync(array $args = [])\n * @method \\Aws\\Result deleteServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServerAsync(array $args = [])\n * @method \\Aws\\Result describeAccountAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountAttributesAsync(array $args = [])\n * @method \\Aws\\Result describeBackups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBackupsAsync(array $args = [])\n * @method \\Aws\\Result describeEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventsAsync(array $args = [])\n * @method \\Aws\\Result describeNodeAssociationStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNodeAssociationStatusAsync(array $args = [])\n * @method \\Aws\\Result describeServers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeServersAsync(array $args = [])\n * @method \\Aws\\Result disassociateNode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateNodeAsync(array $args = [])\n * @method \\Aws\\Result exportServerEngineAttribute(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportServerEngineAttributeAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result restoreServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreServerAsync(array $args = [])\n * @method \\Aws\\Result startMaintenance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMaintenanceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServerAsync(array $args = [])\n * @method \\Aws\\Result updateServerEngineAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServerEngineAttributesAsync(array $args = [])\n */\nclass OpsWorksCMClient extends AwsClient {}\n", "num_lines": 48}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\OpsWorksCM\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS OpsWorks for Chef Automate** service.\n */\nclass OpsWorksCMException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Organizations;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Organizations** service.\n * @method \\Aws\\Result acceptHandshake(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptHandshakeAsync(array $args = [])\n * @method \\Aws\\Result attachPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachPolicyAsync(array $args = [])\n * @method \\Aws\\Result cancelHandshake(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelHandshakeAsync(array $args = [])\n * @method \\Aws\\Result closeAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise closeAccountAsync(array $args = [])\n * @method \\Aws\\Result createAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccountAsync(array $args = [])\n * @method \\Aws\\Result createGovCloudAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGovCloudAccountAsync(array $args = [])\n * @method \\Aws\\Result createOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createOrganizationAsync(array $args = [])\n * @method \\Aws\\Result createOrganizationalUnit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createOrganizationalUnitAsync(array $args = [])\n * @method \\Aws\\Result createPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPolicyAsync(array $args = [])\n * @method \\Aws\\Result declineHandshake(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise declineHandshakeAsync(array $args = [])\n * @method \\Aws\\Result deleteOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOrganizationAsync(array $args = [])\n * @method \\Aws\\Result deleteOrganizationalUnit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOrganizationalUnitAsync(array $args = [])\n * @method \\Aws\\Result deletePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result deregisterDelegatedAdministrator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterDelegatedAdministratorAsync(array $args = [])\n * @method \\Aws\\Result describeAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountAsync(array $args = [])\n * @method \\Aws\\Result describeCreateAccountStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCreateAccountStatusAsync(array $args = [])\n * @method \\Aws\\Result describeEffectivePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEffectivePolicyAsync(array $args = [])\n * @method \\Aws\\Result describeHandshake(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHandshakeAsync(array $args = [])\n * @method \\Aws\\Result describeOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrganizationAsync(array $args = [])\n * @method \\Aws\\Result describeOrganizationalUnit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrganizationalUnitAsync(array $args = [])\n * @method \\Aws\\Result describePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePolicyAsync(array $args = [])\n * @method \\Aws\\Result describeResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result detachPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachPolicyAsync(array $args = [])\n * @method \\Aws\\Result disableAWSServiceAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableAWSServiceAccessAsync(array $args = [])\n * @method \\Aws\\Result disablePolicyType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disablePolicyTypeAsync(array $args = [])\n * @method \\Aws\\Result enableAWSServiceAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableAWSServiceAccessAsync(array $args = [])\n * @method \\Aws\\Result enableAllFeatures(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableAllFeaturesAsync(array $args = [])\n * @method \\Aws\\Result enablePolicyType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enablePolicyTypeAsync(array $args = [])\n * @method \\Aws\\Result inviteAccountToOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise inviteAccountToOrganizationAsync(array $args = [])\n * @method \\Aws\\Result leaveOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise leaveOrganizationAsync(array $args = [])\n * @method \\Aws\\Result listAWSServiceAccessForOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAWSServiceAccessForOrganizationAsync(array $args = [])\n * @method \\Aws\\Result listAccounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccountsAsync(array $args = [])\n * @method \\Aws\\Result listAccountsForParent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccountsForParentAsync(array $args = [])\n * @method \\Aws\\Result listChildren(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listChildrenAsync(array $args = [])\n * @method \\Aws\\Result listCreateAccountStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCreateAccountStatusAsync(array $args = [])\n * @method \\Aws\\Result listDelegatedAdministrators(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDelegatedAdministratorsAsync(array $args = [])\n * @method \\Aws\\Result listDelegatedServicesForAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDelegatedServicesForAccountAsync(array $args = [])\n * @method \\Aws\\Result listHandshakesForAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHandshakesForAccountAsync(array $args = [])\n * @method \\Aws\\Result listHandshakesForOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHandshakesForOrganizationAsync(array $args = [])\n * @method \\Aws\\Result listOrganizationalUnitsForParent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOrganizationalUnitsForParentAsync(array $args = [])\n * @method \\Aws\\Result listParents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listParentsAsync(array $args = [])\n * @method \\Aws\\Result listPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listPoliciesForTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPoliciesForTargetAsync(array $args = [])\n * @method \\Aws\\Result listRoots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRootsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTargetsForPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTargetsForPolicyAsync(array $args = [])\n * @method \\Aws\\Result moveAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise moveAccountAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result registerDelegatedAdministrator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerDelegatedAdministratorAsync(array $args = [])\n * @method \\Aws\\Result removeAccountFromOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeAccountFromOrganizationAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateOrganizationalUnit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateOrganizationalUnitAsync(array $args = [])\n * @method \\Aws\\Result updatePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePolicyAsync(array $args = [])\n */\nclass OrganizationsClient extends AwsClient {}\n", "num_lines": 120}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Organizations\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Organizations** service.\n */\nclass OrganizationsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\OSIS;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon OpenSearch Ingestion** service.\n * @method \\Aws\\Result createPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPipelineAsync(array $args = [])\n * @method \\Aws\\Result deletePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePipelineAsync(array $args = [])\n * @method \\Aws\\Result getPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPipelineAsync(array $args = [])\n * @method \\Aws\\Result getPipelineBlueprint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPipelineBlueprintAsync(array $args = [])\n * @method \\Aws\\Result getPipelineChangeProgress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPipelineChangeProgressAsync(array $args = [])\n * @method \\Aws\\Result listPipelineBlueprints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPipelineBlueprintsAsync(array $args = [])\n * @method \\Aws\\Result listPipelines(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPipelinesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startPipelineAsync(array $args = [])\n * @method \\Aws\\Result stopPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopPipelineAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updatePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePipelineAsync(array $args = [])\n * @method \\Aws\\Result validatePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise validatePipelineAsync(array $args = [])\n */\nclass OSISClient extends AwsClient {}\n", "num_lines": 38}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\OSIS\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon OpenSearch Ingestion** service.\n */\nclass OSISException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Outposts;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Outposts** service.\n * @method \\Aws\\Result cancelOrder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelOrderAsync(array $args = [])\n * @method \\Aws\\Result createOrder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createOrderAsync(array $args = [])\n * @method \\Aws\\Result createOutpost(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createOutpostAsync(array $args = [])\n * @method \\Aws\\Result createSite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSiteAsync(array $args = [])\n * @method \\Aws\\Result deleteOutpost(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOutpostAsync(array $args = [])\n * @method \\Aws\\Result deleteSite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSiteAsync(array $args = [])\n * @method \\Aws\\Result getCatalogItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCatalogItemAsync(array $args = [])\n * @method \\Aws\\Result getConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConnectionAsync(array $args = [])\n * @method \\Aws\\Result getOrder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOrderAsync(array $args = [])\n * @method \\Aws\\Result getOutpost(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOutpostAsync(array $args = [])\n * @method \\Aws\\Result getOutpostInstanceTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOutpostInstanceTypesAsync(array $args = [])\n * @method \\Aws\\Result getSite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSiteAsync(array $args = [])\n * @method \\Aws\\Result getSiteAddress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSiteAddressAsync(array $args = [])\n * @method \\Aws\\Result listAssets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssetsAsync(array $args = [])\n * @method \\Aws\\Result listCatalogItems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCatalogItemsAsync(array $args = [])\n * @method \\Aws\\Result listOrders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOrdersAsync(array $args = [])\n * @method \\Aws\\Result listOutposts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOutpostsAsync(array $args = [])\n * @method \\Aws\\Result listSites(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSitesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startConnectionAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateOutpost(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateOutpostAsync(array $args = [])\n * @method \\Aws\\Result updateSite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSiteAsync(array $args = [])\n * @method \\Aws\\Result updateSiteAddress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSiteAddressAsync(array $args = [])\n * @method \\Aws\\Result updateSiteRackPhysicalProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSiteRackPhysicalPropertiesAsync(array $args = [])\n */\nclass OutpostsClient extends AwsClient {}\n", "num_lines": 62}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Outposts\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Outposts** service.\n */\nclass OutpostsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Panorama;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Panorama** service.\n * @method \\Aws\\Result createApplicationInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationInstanceAsync(array $args = [])\n * @method \\Aws\\Result createJobForDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createJobForDevicesAsync(array $args = [])\n * @method \\Aws\\Result createNodeFromTemplateJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNodeFromTemplateJobAsync(array $args = [])\n * @method \\Aws\\Result createPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPackageAsync(array $args = [])\n * @method \\Aws\\Result createPackageImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPackageImportJobAsync(array $args = [])\n * @method \\Aws\\Result deleteDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDeviceAsync(array $args = [])\n * @method \\Aws\\Result deletePackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePackageAsync(array $args = [])\n * @method \\Aws\\Result deregisterPackageVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterPackageVersionAsync(array $args = [])\n * @method \\Aws\\Result describeApplicationInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeApplicationInstanceAsync(array $args = [])\n * @method \\Aws\\Result describeApplicationInstanceDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeApplicationInstanceDetailsAsync(array $args = [])\n * @method \\Aws\\Result describeDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDeviceAsync(array $args = [])\n * @method \\Aws\\Result describeDeviceJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDeviceJobAsync(array $args = [])\n * @method \\Aws\\Result describeNode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNodeAsync(array $args = [])\n * @method \\Aws\\Result describeNodeFromTemplateJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNodeFromTemplateJobAsync(array $args = [])\n * @method \\Aws\\Result describePackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePackageAsync(array $args = [])\n * @method \\Aws\\Result describePackageImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePackageImportJobAsync(array $args = [])\n * @method \\Aws\\Result describePackageVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePackageVersionAsync(array $args = [])\n * @method \\Aws\\Result listApplicationInstanceDependencies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationInstanceDependenciesAsync(array $args = [])\n * @method \\Aws\\Result listApplicationInstanceNodeInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationInstanceNodeInstancesAsync(array $args = [])\n * @method \\Aws\\Result listApplicationInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationInstancesAsync(array $args = [])\n * @method \\Aws\\Result listDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDevicesAsync(array $args = [])\n * @method \\Aws\\Result listDevicesJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDevicesJobsAsync(array $args = [])\n * @method \\Aws\\Result listNodeFromTemplateJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNodeFromTemplateJobsAsync(array $args = [])\n * @method \\Aws\\Result listNodes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNodesAsync(array $args = [])\n * @method \\Aws\\Result listPackageImportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPackageImportJobsAsync(array $args = [])\n * @method \\Aws\\Result listPackages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPackagesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result provisionDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise provisionDeviceAsync(array $args = [])\n * @method \\Aws\\Result registerPackageVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerPackageVersionAsync(array $args = [])\n * @method \\Aws\\Result removeApplicationInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeApplicationInstanceAsync(array $args = [])\n * @method \\Aws\\Result signalApplicationInstanceNodeInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise signalApplicationInstanceNodeInstancesAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDeviceMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDeviceMetadataAsync(array $args = [])\n */\nclass PanoramaClient extends AwsClient {}\n", "num_lines": 78}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Panorama\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Panorama** service.\n */\nclass PanoramaException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PaymentCryptography;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Payment Cryptography Control Plane** service.\n * @method \\Aws\\Result createAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAliasAsync(array $args = [])\n * @method \\Aws\\Result createKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createKeyAsync(array $args = [])\n * @method \\Aws\\Result deleteAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAliasAsync(array $args = [])\n * @method \\Aws\\Result deleteKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteKeyAsync(array $args = [])\n * @method \\Aws\\Result exportKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportKeyAsync(array $args = [])\n * @method \\Aws\\Result getAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAliasAsync(array $args = [])\n * @method \\Aws\\Result getKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getKeyAsync(array $args = [])\n * @method \\Aws\\Result getParametersForExport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getParametersForExportAsync(array $args = [])\n * @method \\Aws\\Result getParametersForImport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getParametersForImportAsync(array $args = [])\n * @method \\Aws\\Result getPublicKeyCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPublicKeyCertificateAsync(array $args = [])\n * @method \\Aws\\Result importKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importKeyAsync(array $args = [])\n * @method \\Aws\\Result listAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAliasesAsync(array $args = [])\n * @method \\Aws\\Result listKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listKeysAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result restoreKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreKeyAsync(array $args = [])\n * @method \\Aws\\Result startKeyUsage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startKeyUsageAsync(array $args = [])\n * @method \\Aws\\Result stopKeyUsage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopKeyUsageAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAliasAsync(array $args = [])\n */\nclass PaymentCryptographyClient extends AwsClient {}\n", "num_lines": 50}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PaymentCryptography\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Payment Cryptography Control Plane** service.\n */\nclass PaymentCryptographyException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PaymentCryptographyData;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Payment Cryptography Data Plane** service.\n * @method \\Aws\\Result decryptData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise decryptDataAsync(array $args = [])\n * @method \\Aws\\Result encryptData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise encryptDataAsync(array $args = [])\n * @method \\Aws\\Result generateCardValidationData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateCardValidationDataAsync(array $args = [])\n * @method \\Aws\\Result generateMac(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateMacAsync(array $args = [])\n * @method \\Aws\\Result generatePinData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generatePinDataAsync(array $args = [])\n * @method \\Aws\\Result reEncryptData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise reEncryptDataAsync(array $args = [])\n * @method \\Aws\\Result translatePinData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise translatePinDataAsync(array $args = [])\n * @method \\Aws\\Result verifyAuthRequestCryptogram(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise verifyAuthRequestCryptogramAsync(array $args = [])\n * @method \\Aws\\Result verifyCardValidationData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise verifyCardValidationDataAsync(array $args = [])\n * @method \\Aws\\Result verifyMac(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise verifyMacAsync(array $args = [])\n * @method \\Aws\\Result verifyPinData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise verifyPinDataAsync(array $args = [])\n */\nclass PaymentCryptographyDataClient extends AwsClient {}\n", "num_lines": 32}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PaymentCryptographyData\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Payment Cryptography Data Plane** service.\n */\nclass PaymentCryptographyDataException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Personalize;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Personalize** service.\n * @method \\Aws\\Result createBatchInferenceJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBatchInferenceJobAsync(array $args = [])\n * @method \\Aws\\Result createBatchSegmentJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBatchSegmentJobAsync(array $args = [])\n * @method \\Aws\\Result createCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCampaignAsync(array $args = [])\n * @method \\Aws\\Result createDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatasetAsync(array $args = [])\n * @method \\Aws\\Result createDatasetExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatasetExportJobAsync(array $args = [])\n * @method \\Aws\\Result createDatasetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatasetGroupAsync(array $args = [])\n * @method \\Aws\\Result createDatasetImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatasetImportJobAsync(array $args = [])\n * @method \\Aws\\Result createEventTracker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEventTrackerAsync(array $args = [])\n * @method \\Aws\\Result createFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFilterAsync(array $args = [])\n * @method \\Aws\\Result createMetricAttribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMetricAttributionAsync(array $args = [])\n * @method \\Aws\\Result createRecommender(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRecommenderAsync(array $args = [])\n * @method \\Aws\\Result createSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSchemaAsync(array $args = [])\n * @method \\Aws\\Result createSolution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSolutionAsync(array $args = [])\n * @method \\Aws\\Result createSolutionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSolutionVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCampaignAsync(array $args = [])\n * @method \\Aws\\Result deleteDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDatasetAsync(array $args = [])\n * @method \\Aws\\Result deleteDatasetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDatasetGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteEventTracker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventTrackerAsync(array $args = [])\n * @method \\Aws\\Result deleteFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFilterAsync(array $args = [])\n * @method \\Aws\\Result deleteMetricAttribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMetricAttributionAsync(array $args = [])\n * @method \\Aws\\Result deleteRecommender(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRecommenderAsync(array $args = [])\n * @method \\Aws\\Result deleteSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSchemaAsync(array $args = [])\n * @method \\Aws\\Result deleteSolution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSolutionAsync(array $args = [])\n * @method \\Aws\\Result describeAlgorithm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAlgorithmAsync(array $args = [])\n * @method \\Aws\\Result describeBatchInferenceJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBatchInferenceJobAsync(array $args = [])\n * @method \\Aws\\Result describeBatchSegmentJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBatchSegmentJobAsync(array $args = [])\n * @method \\Aws\\Result describeCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCampaignAsync(array $args = [])\n * @method \\Aws\\Result describeDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDatasetAsync(array $args = [])\n * @method \\Aws\\Result describeDatasetExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDatasetExportJobAsync(array $args = [])\n * @method \\Aws\\Result describeDatasetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDatasetGroupAsync(array $args = [])\n * @method \\Aws\\Result describeDatasetImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDatasetImportJobAsync(array $args = [])\n * @method \\Aws\\Result describeEventTracker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventTrackerAsync(array $args = [])\n * @method \\Aws\\Result describeFeatureTransformation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFeatureTransformationAsync(array $args = [])\n * @method \\Aws\\Result describeFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFilterAsync(array $args = [])\n * @method \\Aws\\Result describeMetricAttribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMetricAttributionAsync(array $args = [])\n * @method \\Aws\\Result describeRecipe(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRecipeAsync(array $args = [])\n * @method \\Aws\\Result describeRecommender(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRecommenderAsync(array $args = [])\n * @method \\Aws\\Result describeSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSchemaAsync(array $args = [])\n * @method \\Aws\\Result describeSolution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSolutionAsync(array $args = [])\n * @method \\Aws\\Result describeSolutionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSolutionVersionAsync(array $args = [])\n * @method \\Aws\\Result getSolutionMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSolutionMetricsAsync(array $args = [])\n * @method \\Aws\\Result listBatchInferenceJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBatchInferenceJobsAsync(array $args = [])\n * @method \\Aws\\Result listBatchSegmentJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBatchSegmentJobsAsync(array $args = [])\n * @method \\Aws\\Result listCampaigns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCampaignsAsync(array $args = [])\n * @method \\Aws\\Result listDatasetExportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetExportJobsAsync(array $args = [])\n * @method \\Aws\\Result listDatasetGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetGroupsAsync(array $args = [])\n * @method \\Aws\\Result listDatasetImportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetImportJobsAsync(array $args = [])\n * @method \\Aws\\Result listDatasets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetsAsync(array $args = [])\n * @method \\Aws\\Result listEventTrackers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEventTrackersAsync(array $args = [])\n * @method \\Aws\\Result listFilters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFiltersAsync(array $args = [])\n * @method \\Aws\\Result listMetricAttributionMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMetricAttributionMetricsAsync(array $args = [])\n * @method \\Aws\\Result listMetricAttributions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMetricAttributionsAsync(array $args = [])\n * @method \\Aws\\Result listRecipes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecipesAsync(array $args = [])\n * @method \\Aws\\Result listRecommenders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecommendersAsync(array $args = [])\n * @method \\Aws\\Result listSchemas(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSchemasAsync(array $args = [])\n * @method \\Aws\\Result listSolutionVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSolutionVersionsAsync(array $args = [])\n * @method \\Aws\\Result listSolutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSolutionsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startRecommender(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startRecommenderAsync(array $args = [])\n * @method \\Aws\\Result stopRecommender(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopRecommenderAsync(array $args = [])\n * @method \\Aws\\Result stopSolutionVersionCreation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopSolutionVersionCreationAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCampaignAsync(array $args = [])\n * @method \\Aws\\Result updateMetricAttribution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMetricAttributionAsync(array $args = [])\n * @method \\Aws\\Result updateRecommender(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRecommenderAsync(array $args = [])\n */\nclass PersonalizeClient extends AwsClient {}\n", "num_lines": 142}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Personalize\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Personalize** service.\n */\nclass PersonalizeException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PersonalizeEvents;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Personalize Events** service.\n * @method \\Aws\\Result putEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEventsAsync(array $args = [])\n * @method \\Aws\\Result putItems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putItemsAsync(array $args = [])\n * @method \\Aws\\Result putUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putUsersAsync(array $args = [])\n */\nclass PersonalizeEventsClient extends AwsClient {}\n", "num_lines": 16}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PersonalizeEvents\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Personalize Events** service.\n */\nclass PersonalizeEventsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PersonalizeRuntime;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Personalize Runtime** service.\n * @method \\Aws\\Result getPersonalizedRanking(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPersonalizedRankingAsync(array $args = [])\n * @method \\Aws\\Result getRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRecommendationsAsync(array $args = [])\n */\nclass PersonalizeRuntimeClient extends AwsClient {}\n", "num_lines": 14}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PersonalizeRuntime\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Personalize Runtime** service.\n */\nclass PersonalizeRuntimeException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PI;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Performance Insights** service.\n * @method \\Aws\\Result describeDimensionKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDimensionKeysAsync(array $args = [])\n * @method \\Aws\\Result getDimensionKeyDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDimensionKeyDetailsAsync(array $args = [])\n * @method \\Aws\\Result getResourceMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceMetadataAsync(array $args = [])\n * @method \\Aws\\Result getResourceMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceMetricsAsync(array $args = [])\n * @method \\Aws\\Result listAvailableResourceDimensions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAvailableResourceDimensionsAsync(array $args = [])\n * @method \\Aws\\Result listAvailableResourceMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAvailableResourceMetricsAsync(array $args = [])\n */\nclass PIClient extends AwsClient {}\n", "num_lines": 22}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PI\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Performance Insights** service.\n */\nclass PIException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Pinpoint;\n\nuse Aws\\Api\\ApiProvider;\nuse Aws\\Api\\DocModel;\nuse Aws\\Api\\Service;\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Pinpoint** service.\n * @method \\Aws\\Result createApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppAsync(array $args = [])\n * @method \\Aws\\Result createCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCampaignAsync(array $args = [])\n * @method \\Aws\\Result createEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEmailTemplateAsync(array $args = [])\n * @method \\Aws\\Result createExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createExportJobAsync(array $args = [])\n * @method \\Aws\\Result createImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createImportJobAsync(array $args = [])\n * @method \\Aws\\Result createInAppTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInAppTemplateAsync(array $args = [])\n * @method \\Aws\\Result createJourney(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createJourneyAsync(array $args = [])\n * @method \\Aws\\Result createPushTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPushTemplateAsync(array $args = [])\n * @method \\Aws\\Result createRecommenderConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRecommenderConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createSegment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSegmentAsync(array $args = [])\n * @method \\Aws\\Result createSmsTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSmsTemplateAsync(array $args = [])\n * @method \\Aws\\Result createVoiceTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVoiceTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteAdmChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAdmChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteApnsChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApnsChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteApnsSandboxChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApnsSandboxChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteApnsVoipChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApnsVoipChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteApnsVoipSandboxChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApnsVoipSandboxChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppAsync(array $args = [])\n * @method \\Aws\\Result deleteBaiduChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBaiduChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCampaignAsync(array $args = [])\n * @method \\Aws\\Result deleteEmailChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEmailChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEmailTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteEventStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventStreamAsync(array $args = [])\n * @method \\Aws\\Result deleteGcmChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGcmChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteInAppTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInAppTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteJourney(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteJourneyAsync(array $args = [])\n * @method \\Aws\\Result deletePushTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePushTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteRecommenderConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRecommenderConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteSegment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSegmentAsync(array $args = [])\n * @method \\Aws\\Result deleteSmsChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSmsChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteSmsTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSmsTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteUserEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserEndpointsAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceTemplateAsync(array $args = [])\n * @method \\Aws\\Result getAdmChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAdmChannelAsync(array $args = [])\n * @method \\Aws\\Result getApnsChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApnsChannelAsync(array $args = [])\n * @method \\Aws\\Result getApnsSandboxChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApnsSandboxChannelAsync(array $args = [])\n * @method \\Aws\\Result getApnsVoipChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApnsVoipChannelAsync(array $args = [])\n * @method \\Aws\\Result getApnsVoipSandboxChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApnsVoipSandboxChannelAsync(array $args = [])\n * @method \\Aws\\Result getApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppAsync(array $args = [])\n * @method \\Aws\\Result getApplicationDateRangeKpi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApplicationDateRangeKpiAsync(array $args = [])\n * @method \\Aws\\Result getApplicationSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApplicationSettingsAsync(array $args = [])\n * @method \\Aws\\Result getApps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppsAsync(array $args = [])\n * @method \\Aws\\Result getBaiduChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBaiduChannelAsync(array $args = [])\n * @method \\Aws\\Result getCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCampaignAsync(array $args = [])\n * @method \\Aws\\Result getCampaignActivities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCampaignActivitiesAsync(array $args = [])\n * @method \\Aws\\Result getCampaignDateRangeKpi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCampaignDateRangeKpiAsync(array $args = [])\n * @method \\Aws\\Result getCampaignVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCampaignVersionAsync(array $args = [])\n * @method \\Aws\\Result getCampaignVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCampaignVersionsAsync(array $args = [])\n * @method \\Aws\\Result getCampaigns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCampaignsAsync(array $args = [])\n * @method \\Aws\\Result getChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChannelsAsync(array $args = [])\n * @method \\Aws\\Result getEmailChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEmailChannelAsync(array $args = [])\n * @method \\Aws\\Result getEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEmailTemplateAsync(array $args = [])\n * @method \\Aws\\Result getUserEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUserEndpointAsync(array $args = [])\n * @method \\Aws\\Result getEventStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEventStreamAsync(array $args = [])\n * @method \\Aws\\Result getExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExportJobAsync(array $args = [])\n * @method \\Aws\\Result getExportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExportJobsAsync(array $args = [])\n * @method \\Aws\\Result getGcmChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGcmChannelAsync(array $args = [])\n * @method \\Aws\\Result getImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getImportJobAsync(array $args = [])\n * @method \\Aws\\Result getImportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getImportJobsAsync(array $args = [])\n * @method \\Aws\\Result getInAppMessages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInAppMessagesAsync(array $args = [])\n * @method \\Aws\\Result getInAppTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInAppTemplateAsync(array $args = [])\n * @method \\Aws\\Result getJourney(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJourneyAsync(array $args = [])\n * @method \\Aws\\Result getJourneyDateRangeKpi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJourneyDateRangeKpiAsync(array $args = [])\n * @method \\Aws\\Result getJourneyExecutionActivityMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJourneyExecutionActivityMetricsAsync(array $args = [])\n * @method \\Aws\\Result getJourneyExecutionMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJourneyExecutionMetricsAsync(array $args = [])\n * @method \\Aws\\Result getJourneyRunExecutionActivityMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJourneyRunExecutionActivityMetricsAsync(array $args = [])\n * @method \\Aws\\Result getJourneyRunExecutionMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJourneyRunExecutionMetricsAsync(array $args = [])\n * @method \\Aws\\Result getJourneyRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJourneyRunsAsync(array $args = [])\n * @method \\Aws\\Result getPushTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPushTemplateAsync(array $args = [])\n * @method \\Aws\\Result getRecommenderConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRecommenderConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getRecommenderConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRecommenderConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result getSegment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSegmentAsync(array $args = [])\n * @method \\Aws\\Result getSegmentExportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSegmentExportJobsAsync(array $args = [])\n * @method \\Aws\\Result getSegmentImportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSegmentImportJobsAsync(array $args = [])\n * @method \\Aws\\Result getSegmentVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSegmentVersionAsync(array $args = [])\n * @method \\Aws\\Result getSegmentVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSegmentVersionsAsync(array $args = [])\n * @method \\Aws\\Result getSegments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSegmentsAsync(array $args = [])\n * @method \\Aws\\Result getSmsChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSmsChannelAsync(array $args = [])\n * @method \\Aws\\Result getSmsTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSmsTemplateAsync(array $args = [])\n * @method \\Aws\\Result getUserEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUserEndpointsAsync(array $args = [])\n * @method \\Aws\\Result getVoiceChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceChannelAsync(array $args = [])\n * @method \\Aws\\Result getVoiceTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVoiceTemplateAsync(array $args = [])\n * @method \\Aws\\Result listJourneys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJourneysAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTemplateVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTemplateVersionsAsync(array $args = [])\n * @method \\Aws\\Result listTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTemplatesAsync(array $args = [])\n * @method \\Aws\\Result phoneNumberValidate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise phoneNumberValidateAsync(array $args = [])\n * @method \\Aws\\Result putEventStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEventStreamAsync(array $args = [])\n * @method \\Aws\\Result putEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEventsAsync(array $args = [])\n * @method \\Aws\\Result removeAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeAttributesAsync(array $args = [])\n * @method \\Aws\\Result sendMessages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendMessagesAsync(array $args = [])\n * @method \\Aws\\Result sendOTPMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendOTPMessageAsync(array $args = [])\n * @method \\Aws\\Result sendUsersMessages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendUsersMessagesAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAdmChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAdmChannelAsync(array $args = [])\n * @method \\Aws\\Result updateApnsChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApnsChannelAsync(array $args = [])\n * @method \\Aws\\Result updateApnsSandboxChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApnsSandboxChannelAsync(array $args = [])\n * @method \\Aws\\Result updateApnsVoipChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApnsVoipChannelAsync(array $args = [])\n * @method \\Aws\\Result updateApnsVoipSandboxChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApnsVoipSandboxChannelAsync(array $args = [])\n * @method \\Aws\\Result updateApplicationSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateBaiduChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBaiduChannelAsync(array $args = [])\n * @method \\Aws\\Result updateCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCampaignAsync(array $args = [])\n * @method \\Aws\\Result updateEmailChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEmailChannelAsync(array $args = [])\n * @method \\Aws\\Result updateEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEmailTemplateAsync(array $args = [])\n * @method \\Aws\\Result updateUserEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserEndpointAsync(array $args = [])\n * @method \\Aws\\Result updateUserEndpointsBatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserEndpointsBatchAsync(array $args = [])\n * @method \\Aws\\Result updateGcmChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGcmChannelAsync(array $args = [])\n * @method \\Aws\\Result updateInAppTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateInAppTemplateAsync(array $args = [])\n * @method \\Aws\\Result updateJourney(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateJourneyAsync(array $args = [])\n * @method \\Aws\\Result updateJourneyState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateJourneyStateAsync(array $args = [])\n * @method \\Aws\\Result updatePushTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePushTemplateAsync(array $args = [])\n * @method \\Aws\\Result updateRecommenderConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRecommenderConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateSegment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSegmentAsync(array $args = [])\n * @method \\Aws\\Result updateSmsChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSmsChannelAsync(array $args = [])\n * @method \\Aws\\Result updateSmsTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSmsTemplateAsync(array $args = [])\n * @method \\Aws\\Result updateTemplateActiveVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTemplateActiveVersionAsync(array $args = [])\n * @method \\Aws\\Result updateVoiceChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVoiceChannelAsync(array $args = [])\n * @method \\Aws\\Result updateVoiceTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVoiceTemplateAsync(array $args = [])\n * @method \\Aws\\Result verifyOTPMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise verifyOTPMessageAsync(array $args = [])\n */\nclass PinpointClient extends AwsClient {}", "num_lines": 256}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Pinpoint\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Pinpoint** service.\n */\nclass PinpointException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PinpointEmail;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Pinpoint Email Service** service.\n * @method \\Aws\\Result createConfigurationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfigurationSetAsync(array $args = [])\n * @method \\Aws\\Result createConfigurationSetEventDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfigurationSetEventDestinationAsync(array $args = [])\n * @method \\Aws\\Result createDedicatedIpPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDedicatedIpPoolAsync(array $args = [])\n * @method \\Aws\\Result createDeliverabilityTestReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeliverabilityTestReportAsync(array $args = [])\n * @method \\Aws\\Result createEmailIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEmailIdentityAsync(array $args = [])\n * @method \\Aws\\Result deleteConfigurationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigurationSetAsync(array $args = [])\n * @method \\Aws\\Result deleteConfigurationSetEventDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigurationSetEventDestinationAsync(array $args = [])\n * @method \\Aws\\Result deleteDedicatedIpPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDedicatedIpPoolAsync(array $args = [])\n * @method \\Aws\\Result deleteEmailIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEmailIdentityAsync(array $args = [])\n * @method \\Aws\\Result getAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountAsync(array $args = [])\n * @method \\Aws\\Result getBlacklistReports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBlacklistReportsAsync(array $args = [])\n * @method \\Aws\\Result getConfigurationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConfigurationSetAsync(array $args = [])\n * @method \\Aws\\Result getConfigurationSetEventDestinations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConfigurationSetEventDestinationsAsync(array $args = [])\n * @method \\Aws\\Result getDedicatedIp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDedicatedIpAsync(array $args = [])\n * @method \\Aws\\Result getDedicatedIps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDedicatedIpsAsync(array $args = [])\n * @method \\Aws\\Result getDeliverabilityDashboardOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeliverabilityDashboardOptionsAsync(array $args = [])\n * @method \\Aws\\Result getDeliverabilityTestReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeliverabilityTestReportAsync(array $args = [])\n * @method \\Aws\\Result getDomainDeliverabilityCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainDeliverabilityCampaignAsync(array $args = [])\n * @method \\Aws\\Result getDomainStatisticsReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainStatisticsReportAsync(array $args = [])\n * @method \\Aws\\Result getEmailIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEmailIdentityAsync(array $args = [])\n * @method \\Aws\\Result listConfigurationSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConfigurationSetsAsync(array $args = [])\n * @method \\Aws\\Result listDedicatedIpPools(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDedicatedIpPoolsAsync(array $args = [])\n * @method \\Aws\\Result listDeliverabilityTestReports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeliverabilityTestReportsAsync(array $args = [])\n * @method \\Aws\\Result listDomainDeliverabilityCampaigns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainDeliverabilityCampaignsAsync(array $args = [])\n * @method \\Aws\\Result listEmailIdentities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEmailIdentitiesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putAccountDedicatedIpWarmupAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccountDedicatedIpWarmupAttributesAsync(array $args = [])\n * @method \\Aws\\Result putAccountSendingAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccountSendingAttributesAsync(array $args = [])\n * @method \\Aws\\Result putConfigurationSetDeliveryOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConfigurationSetDeliveryOptionsAsync(array $args = [])\n * @method \\Aws\\Result putConfigurationSetReputationOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConfigurationSetReputationOptionsAsync(array $args = [])\n * @method \\Aws\\Result putConfigurationSetSendingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConfigurationSetSendingOptionsAsync(array $args = [])\n * @method \\Aws\\Result putConfigurationSetTrackingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConfigurationSetTrackingOptionsAsync(array $args = [])\n * @method \\Aws\\Result putDedicatedIpInPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDedicatedIpInPoolAsync(array $args = [])\n * @method \\Aws\\Result putDedicatedIpWarmupAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDedicatedIpWarmupAttributesAsync(array $args = [])\n * @method \\Aws\\Result putDeliverabilityDashboardOption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDeliverabilityDashboardOptionAsync(array $args = [])\n * @method \\Aws\\Result putEmailIdentityDkimAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEmailIdentityDkimAttributesAsync(array $args = [])\n * @method \\Aws\\Result putEmailIdentityFeedbackAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEmailIdentityFeedbackAttributesAsync(array $args = [])\n * @method \\Aws\\Result putEmailIdentityMailFromAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEmailIdentityMailFromAttributesAsync(array $args = [])\n * @method \\Aws\\Result sendEmail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendEmailAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateConfigurationSetEventDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConfigurationSetEventDestinationAsync(array $args = [])\n */\nclass PinpointEmailClient extends AwsClient {}\n", "num_lines": 94}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PinpointEmail\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Pinpoint Email Service** service.\n */\nclass PinpointEmailException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PinpointSMSVoice;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Pinpoint SMS and Voice Service** service.\n * @method \\Aws\\Result createConfigurationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfigurationSetAsync(array $args = [])\n * @method \\Aws\\Result createConfigurationSetEventDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfigurationSetEventDestinationAsync(array $args = [])\n * @method \\Aws\\Result deleteConfigurationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigurationSetAsync(array $args = [])\n * @method \\Aws\\Result deleteConfigurationSetEventDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigurationSetEventDestinationAsync(array $args = [])\n * @method \\Aws\\Result getConfigurationSetEventDestinations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConfigurationSetEventDestinationsAsync(array $args = [])\n * @method \\Aws\\Result listConfigurationSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConfigurationSetsAsync(array $args = [])\n * @method \\Aws\\Result sendVoiceMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendVoiceMessageAsync(array $args = [])\n * @method \\Aws\\Result updateConfigurationSetEventDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConfigurationSetEventDestinationAsync(array $args = [])\n */\nclass PinpointSMSVoiceClient extends AwsClient {}\n", "num_lines": 26}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PinpointSMSVoice\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Pinpoint SMS and Voice Service** service.\n */\nclass PinpointSMSVoiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PinpointSMSVoiceV2;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Pinpoint SMS Voice V2** service.\n * @method \\Aws\\Result associateOriginationIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateOriginationIdentityAsync(array $args = [])\n * @method \\Aws\\Result createConfigurationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfigurationSetAsync(array $args = [])\n * @method \\Aws\\Result createEventDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEventDestinationAsync(array $args = [])\n * @method \\Aws\\Result createOptOutList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createOptOutListAsync(array $args = [])\n * @method \\Aws\\Result createPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPoolAsync(array $args = [])\n * @method \\Aws\\Result deleteConfigurationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigurationSetAsync(array $args = [])\n * @method \\Aws\\Result deleteDefaultMessageType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDefaultMessageTypeAsync(array $args = [])\n * @method \\Aws\\Result deleteDefaultSenderId(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDefaultSenderIdAsync(array $args = [])\n * @method \\Aws\\Result deleteEventDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventDestinationAsync(array $args = [])\n * @method \\Aws\\Result deleteKeyword(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteKeywordAsync(array $args = [])\n * @method \\Aws\\Result deleteOptOutList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOptOutListAsync(array $args = [])\n * @method \\Aws\\Result deleteOptedOutNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOptedOutNumberAsync(array $args = [])\n * @method \\Aws\\Result deletePool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePoolAsync(array $args = [])\n * @method \\Aws\\Result deleteTextMessageSpendLimitOverride(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTextMessageSpendLimitOverrideAsync(array $args = [])\n * @method \\Aws\\Result deleteVoiceMessageSpendLimitOverride(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVoiceMessageSpendLimitOverrideAsync(array $args = [])\n * @method \\Aws\\Result describeAccountAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountAttributesAsync(array $args = [])\n * @method \\Aws\\Result describeAccountLimits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountLimitsAsync(array $args = [])\n * @method \\Aws\\Result describeConfigurationSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConfigurationSetsAsync(array $args = [])\n * @method \\Aws\\Result describeKeywords(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeKeywordsAsync(array $args = [])\n * @method \\Aws\\Result describeOptOutLists(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOptOutListsAsync(array $args = [])\n * @method \\Aws\\Result describeOptedOutNumbers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOptedOutNumbersAsync(array $args = [])\n * @method \\Aws\\Result describePhoneNumbers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePhoneNumbersAsync(array $args = [])\n * @method \\Aws\\Result describePools(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePoolsAsync(array $args = [])\n * @method \\Aws\\Result describeSenderIds(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSenderIdsAsync(array $args = [])\n * @method \\Aws\\Result describeSpendLimits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSpendLimitsAsync(array $args = [])\n * @method \\Aws\\Result disassociateOriginationIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateOriginationIdentityAsync(array $args = [])\n * @method \\Aws\\Result listPoolOriginationIdentities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPoolOriginationIdentitiesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putKeyword(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putKeywordAsync(array $args = [])\n * @method \\Aws\\Result putOptedOutNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putOptedOutNumberAsync(array $args = [])\n * @method \\Aws\\Result releasePhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise releasePhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result requestPhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise requestPhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result sendTextMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendTextMessageAsync(array $args = [])\n * @method \\Aws\\Result sendVoiceMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendVoiceMessageAsync(array $args = [])\n * @method \\Aws\\Result setDefaultMessageType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setDefaultMessageTypeAsync(array $args = [])\n * @method \\Aws\\Result setDefaultSenderId(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setDefaultSenderIdAsync(array $args = [])\n * @method \\Aws\\Result setTextMessageSpendLimitOverride(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setTextMessageSpendLimitOverrideAsync(array $args = [])\n * @method \\Aws\\Result setVoiceMessageSpendLimitOverride(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setVoiceMessageSpendLimitOverrideAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateEventDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEventDestinationAsync(array $args = [])\n * @method \\Aws\\Result updatePhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result updatePool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePoolAsync(array $args = [])\n */\nclass PinpointSMSVoiceV2Client extends AwsClient {}\n", "num_lines": 96}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PinpointSMSVoiceV2\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Pinpoint SMS Voice V2** service.\n */\nclass PinpointSMSVoiceV2Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Pipes;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon EventBridge Pipes** service.\n * @method \\Aws\\Result createPipe(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPipeAsync(array $args = [])\n * @method \\Aws\\Result deletePipe(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePipeAsync(array $args = [])\n * @method \\Aws\\Result describePipe(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePipeAsync(array $args = [])\n * @method \\Aws\\Result listPipes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPipesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startPipe(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startPipeAsync(array $args = [])\n * @method \\Aws\\Result stopPipe(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopPipeAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updatePipe(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePipeAsync(array $args = [])\n */\nclass PipesClient extends AwsClient {}\n", "num_lines": 30}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Pipes\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon EventBridge Pipes** service.\n */\nclass PipesException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Polly;\n\nuse Aws\\Api\\Serializer\\JsonBody;\nuse Aws\\AwsClient;\nuse Aws\\Signature\\SignatureV4;\nuse GuzzleHttp\\Psr7\\Request;\nuse GuzzleHttp\\Psr7\\Uri;\nuse GuzzleHttp\\Psr7;\n\n/**\n * This client is used to interact with the **Amazon Polly** service.\n * @method \\Aws\\Result deleteLexicon(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLexiconAsync(array $args = [])\n * @method \\Aws\\Result describeVoices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVoicesAsync(array $args = [])\n * @method \\Aws\\Result getLexicon(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLexiconAsync(array $args = [])\n * @method \\Aws\\Result getSpeechSynthesisTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSpeechSynthesisTaskAsync(array $args = [])\n * @method \\Aws\\Result listLexicons(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLexiconsAsync(array $args = [])\n * @method \\Aws\\Result listSpeechSynthesisTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSpeechSynthesisTasksAsync(array $args = [])\n * @method \\Aws\\Result putLexicon(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putLexiconAsync(array $args = [])\n * @method \\Aws\\Result startSpeechSynthesisTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSpeechSynthesisTaskAsync(array $args = [])\n * @method \\Aws\\Result synthesizeSpeech(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise synthesizeSpeechAsync(array $args = [])\n */\nclass PollyClient extends AwsClient\n{\n    /** @var JsonBody */\n    private $formatter;\n\n    /**\n     * Create a pre-signed URL for Polly operation `SynthesizeSpeech`\n     *\n     * @param array $args parameters array for `SynthesizeSpeech`\n     *                    More information @see Aws\\Polly\\PollyClient::SynthesizeSpeech\n     *\n     * @return string\n     */\n    public function createSynthesizeSpeechPreSignedUrl(array $args)\n    {\n        $uri = new Uri($this->getEndpoint());\n        $uri = $uri->withPath('/v1/speech');\n\n        // Formatting parameters follows rest-json protocol\n        $this->formatter = $this->formatter ?: new JsonBody($this->getApi());\n        $queryArray = json_decode(\n            $this->formatter->build(\n                $this->getApi()->getOperation('SynthesizeSpeech')->getInput(),\n                $args\n            ),\n            true\n        );\n\n        // Mocking a 'GET' request in pre-signing the Url\n        $query = Psr7\\Query::build($queryArray);\n        $uri = $uri->withQuery($query);\n\n        $request = new Request('GET', $uri);\n        $request = $request->withBody(Psr7\\Utils::streamFor(''));\n        $signer = new SignatureV4('polly', $this->getRegion());\n        return (string) $signer->presign(\n            $request,\n            $this->getCredentials()->wait(),\n            '+15 minutes'\n        )->getUri();\n    }\n}\n", "num_lines": 74}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Polly\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Polly** service.\n */\nclass PollyException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Pricing;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Price List Service** service.\n * @method \\Aws\\Result describeServices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeServicesAsync(array $args = [])\n * @method \\Aws\\Result getAttributeValues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAttributeValuesAsync(array $args = [])\n * @method \\Aws\\Result getPriceListFileUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPriceListFileUrlAsync(array $args = [])\n * @method \\Aws\\Result getProducts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProductsAsync(array $args = [])\n * @method \\Aws\\Result listPriceLists(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPriceListsAsync(array $args = [])\n */\nclass PricingClient extends AwsClient {}\n", "num_lines": 20}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Pricing\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Price List Service** service.\n */\nclass PricingException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PrivateNetworks;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Private 5G** service.\n * @method \\Aws\\Result acknowledgeOrderReceipt(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acknowledgeOrderReceiptAsync(array $args = [])\n * @method \\Aws\\Result activateDeviceIdentifier(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise activateDeviceIdentifierAsync(array $args = [])\n * @method \\Aws\\Result activateNetworkSite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise activateNetworkSiteAsync(array $args = [])\n * @method \\Aws\\Result configureAccessPoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise configureAccessPointAsync(array $args = [])\n * @method \\Aws\\Result createNetwork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNetworkAsync(array $args = [])\n * @method \\Aws\\Result createNetworkSite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNetworkSiteAsync(array $args = [])\n * @method \\Aws\\Result deactivateDeviceIdentifier(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deactivateDeviceIdentifierAsync(array $args = [])\n * @method \\Aws\\Result deleteNetwork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNetworkAsync(array $args = [])\n * @method \\Aws\\Result deleteNetworkSite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNetworkSiteAsync(array $args = [])\n * @method \\Aws\\Result getDeviceIdentifier(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeviceIdentifierAsync(array $args = [])\n * @method \\Aws\\Result getNetwork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNetworkAsync(array $args = [])\n * @method \\Aws\\Result getNetworkResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNetworkResourceAsync(array $args = [])\n * @method \\Aws\\Result getNetworkSite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNetworkSiteAsync(array $args = [])\n * @method \\Aws\\Result getOrder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOrderAsync(array $args = [])\n * @method \\Aws\\Result listDeviceIdentifiers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeviceIdentifiersAsync(array $args = [])\n * @method \\Aws\\Result listNetworkResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNetworkResourcesAsync(array $args = [])\n * @method \\Aws\\Result listNetworkSites(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNetworkSitesAsync(array $args = [])\n * @method \\Aws\\Result listNetworks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNetworksAsync(array $args = [])\n * @method \\Aws\\Result listOrders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOrdersAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result ping(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise pingAsync(array $args = [])\n * @method \\Aws\\Result startNetworkResourceUpdate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startNetworkResourceUpdateAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateNetworkSite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNetworkSiteAsync(array $args = [])\n * @method \\Aws\\Result updateNetworkSitePlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNetworkSitePlanAsync(array $args = [])\n */\nclass PrivateNetworksClient extends AwsClient {}\n", "num_lines": 62}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PrivateNetworks\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Private 5G** service.\n */\nclass PrivateNetworksException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PrometheusService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Prometheus Service** service.\n * @method \\Aws\\Result createAlertManagerDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAlertManagerDefinitionAsync(array $args = [])\n * @method \\Aws\\Result createLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createRuleGroupsNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRuleGroupsNamespaceAsync(array $args = [])\n * @method \\Aws\\Result createWorkspace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkspaceAsync(array $args = [])\n * @method \\Aws\\Result deleteAlertManagerDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAlertManagerDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteRuleGroupsNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRuleGroupsNamespaceAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkspace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkspaceAsync(array $args = [])\n * @method \\Aws\\Result describeAlertManagerDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAlertManagerDefinitionAsync(array $args = [])\n * @method \\Aws\\Result describeLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeRuleGroupsNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRuleGroupsNamespaceAsync(array $args = [])\n * @method \\Aws\\Result describeWorkspace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkspaceAsync(array $args = [])\n * @method \\Aws\\Result listRuleGroupsNamespaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRuleGroupsNamespacesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWorkspaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkspacesAsync(array $args = [])\n * @method \\Aws\\Result putAlertManagerDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAlertManagerDefinitionAsync(array $args = [])\n * @method \\Aws\\Result putRuleGroupsNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRuleGroupsNamespaceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateWorkspaceAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkspaceAliasAsync(array $args = [])\n */\nclass PrometheusServiceClient extends AwsClient {}\n", "num_lines": 52}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\PrometheusService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Prometheus Service** service.\n */\nclass PrometheusServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Proton;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Proton** service.\n * @method \\Aws\\Result acceptEnvironmentAccountConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptEnvironmentAccountConnectionAsync(array $args = [])\n * @method \\Aws\\Result cancelComponentDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelComponentDeploymentAsync(array $args = [])\n * @method \\Aws\\Result cancelEnvironmentDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelEnvironmentDeploymentAsync(array $args = [])\n * @method \\Aws\\Result cancelServiceInstanceDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelServiceInstanceDeploymentAsync(array $args = [])\n * @method \\Aws\\Result cancelServicePipelineDeployment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelServicePipelineDeploymentAsync(array $args = [])\n * @method \\Aws\\Result createComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createComponentAsync(array $args = [])\n * @method \\Aws\\Result createEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result createEnvironmentAccountConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEnvironmentAccountConnectionAsync(array $args = [])\n * @method \\Aws\\Result createEnvironmentTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEnvironmentTemplateAsync(array $args = [])\n * @method \\Aws\\Result createEnvironmentTemplateVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEnvironmentTemplateVersionAsync(array $args = [])\n * @method \\Aws\\Result createRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRepositoryAsync(array $args = [])\n * @method \\Aws\\Result createService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceAsync(array $args = [])\n * @method \\Aws\\Result createServiceInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceInstanceAsync(array $args = [])\n * @method \\Aws\\Result createServiceSyncConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceSyncConfigAsync(array $args = [])\n * @method \\Aws\\Result createServiceTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceTemplateAsync(array $args = [])\n * @method \\Aws\\Result createServiceTemplateVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceTemplateVersionAsync(array $args = [])\n * @method \\Aws\\Result createTemplateSyncConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTemplateSyncConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteComponentAsync(array $args = [])\n * @method \\Aws\\Result deleteEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result deleteEnvironmentAccountConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEnvironmentAccountConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteEnvironmentTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEnvironmentTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteEnvironmentTemplateVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEnvironmentTemplateVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRepositoryAsync(array $args = [])\n * @method \\Aws\\Result deleteService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceAsync(array $args = [])\n * @method \\Aws\\Result deleteServiceSyncConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceSyncConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteServiceTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteServiceTemplateVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceTemplateVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteTemplateSyncConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTemplateSyncConfigAsync(array $args = [])\n * @method \\Aws\\Result getAccountSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountSettingsAsync(array $args = [])\n * @method \\Aws\\Result getComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getComponentAsync(array $args = [])\n * @method \\Aws\\Result getEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result getEnvironmentAccountConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEnvironmentAccountConnectionAsync(array $args = [])\n * @method \\Aws\\Result getEnvironmentTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEnvironmentTemplateAsync(array $args = [])\n * @method \\Aws\\Result getEnvironmentTemplateVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEnvironmentTemplateVersionAsync(array $args = [])\n * @method \\Aws\\Result getRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRepositoryAsync(array $args = [])\n * @method \\Aws\\Result getRepositorySyncStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRepositorySyncStatusAsync(array $args = [])\n * @method \\Aws\\Result getResourcesSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcesSummaryAsync(array $args = [])\n * @method \\Aws\\Result getService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceAsync(array $args = [])\n * @method \\Aws\\Result getServiceInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceInstanceAsync(array $args = [])\n * @method \\Aws\\Result getServiceInstanceSyncStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceInstanceSyncStatusAsync(array $args = [])\n * @method \\Aws\\Result getServiceSyncBlockerSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceSyncBlockerSummaryAsync(array $args = [])\n * @method \\Aws\\Result getServiceSyncConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceSyncConfigAsync(array $args = [])\n * @method \\Aws\\Result getServiceTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceTemplateAsync(array $args = [])\n * @method \\Aws\\Result getServiceTemplateVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceTemplateVersionAsync(array $args = [])\n * @method \\Aws\\Result getTemplateSyncConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTemplateSyncConfigAsync(array $args = [])\n * @method \\Aws\\Result getTemplateSyncStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTemplateSyncStatusAsync(array $args = [])\n * @method \\Aws\\Result listComponentOutputs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listComponentOutputsAsync(array $args = [])\n * @method \\Aws\\Result listComponentProvisionedResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listComponentProvisionedResourcesAsync(array $args = [])\n * @method \\Aws\\Result listComponents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listComponentsAsync(array $args = [])\n * @method \\Aws\\Result listEnvironmentAccountConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEnvironmentAccountConnectionsAsync(array $args = [])\n * @method \\Aws\\Result listEnvironmentOutputs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEnvironmentOutputsAsync(array $args = [])\n * @method \\Aws\\Result listEnvironmentProvisionedResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEnvironmentProvisionedResourcesAsync(array $args = [])\n * @method \\Aws\\Result listEnvironmentTemplateVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEnvironmentTemplateVersionsAsync(array $args = [])\n * @method \\Aws\\Result listEnvironmentTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEnvironmentTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listEnvironments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEnvironmentsAsync(array $args = [])\n * @method \\Aws\\Result listRepositories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRepositoriesAsync(array $args = [])\n * @method \\Aws\\Result listRepositorySyncDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRepositorySyncDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listServiceInstanceOutputs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServiceInstanceOutputsAsync(array $args = [])\n * @method \\Aws\\Result listServiceInstanceProvisionedResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServiceInstanceProvisionedResourcesAsync(array $args = [])\n * @method \\Aws\\Result listServiceInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServiceInstancesAsync(array $args = [])\n * @method \\Aws\\Result listServicePipelineOutputs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServicePipelineOutputsAsync(array $args = [])\n * @method \\Aws\\Result listServicePipelineProvisionedResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServicePipelineProvisionedResourcesAsync(array $args = [])\n * @method \\Aws\\Result listServiceTemplateVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServiceTemplateVersionsAsync(array $args = [])\n * @method \\Aws\\Result listServiceTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServiceTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listServices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServicesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result notifyResourceDeploymentStatusChange(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise notifyResourceDeploymentStatusChangeAsync(array $args = [])\n * @method \\Aws\\Result rejectEnvironmentAccountConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectEnvironmentAccountConnectionAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAccountSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccountSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateComponentAsync(array $args = [])\n * @method \\Aws\\Result updateEnvironment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEnvironmentAsync(array $args = [])\n * @method \\Aws\\Result updateEnvironmentAccountConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEnvironmentAccountConnectionAsync(array $args = [])\n * @method \\Aws\\Result updateEnvironmentTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEnvironmentTemplateAsync(array $args = [])\n * @method \\Aws\\Result updateEnvironmentTemplateVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEnvironmentTemplateVersionAsync(array $args = [])\n * @method \\Aws\\Result updateService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceAsync(array $args = [])\n * @method \\Aws\\Result updateServiceInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceInstanceAsync(array $args = [])\n * @method \\Aws\\Result updateServicePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServicePipelineAsync(array $args = [])\n * @method \\Aws\\Result updateServiceSyncBlocker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceSyncBlockerAsync(array $args = [])\n * @method \\Aws\\Result updateServiceSyncConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceSyncConfigAsync(array $args = [])\n * @method \\Aws\\Result updateServiceTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceTemplateAsync(array $args = [])\n * @method \\Aws\\Result updateServiceTemplateVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceTemplateVersionAsync(array $args = [])\n * @method \\Aws\\Result updateTemplateSyncConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTemplateSyncConfigAsync(array $args = [])\n */\nclass ProtonClient extends AwsClient {}\n", "num_lines": 178}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Proton\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Proton** service.\n */\nclass ProtonException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\QLDB;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon QLDB** service.\n * @method \\Aws\\Result cancelJournalKinesisStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelJournalKinesisStreamAsync(array $args = [])\n * @method \\Aws\\Result createLedger(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLedgerAsync(array $args = [])\n * @method \\Aws\\Result deleteLedger(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLedgerAsync(array $args = [])\n * @method \\Aws\\Result describeJournalKinesisStream(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJournalKinesisStreamAsync(array $args = [])\n * @method \\Aws\\Result describeJournalS3Export(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJournalS3ExportAsync(array $args = [])\n * @method \\Aws\\Result describeLedger(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLedgerAsync(array $args = [])\n * @method \\Aws\\Result exportJournalToS3(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportJournalToS3Async(array $args = [])\n * @method \\Aws\\Result getBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBlockAsync(array $args = [])\n * @method \\Aws\\Result getDigest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDigestAsync(array $args = [])\n * @method \\Aws\\Result getRevision(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRevisionAsync(array $args = [])\n * @method \\Aws\\Result listJournalKinesisStreamsForLedger(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJournalKinesisStreamsForLedgerAsync(array $args = [])\n * @method \\Aws\\Result listJournalS3Exports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJournalS3ExportsAsync(array $args = [])\n * @method \\Aws\\Result listJournalS3ExportsForLedger(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJournalS3ExportsForLedgerAsync(array $args = [])\n * @method \\Aws\\Result listLedgers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLedgersAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result streamJournalToKinesis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise streamJournalToKinesisAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateLedger(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLedgerAsync(array $args = [])\n * @method \\Aws\\Result updateLedgerPermissionsMode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLedgerPermissionsModeAsync(array $args = [])\n */\nclass QLDBClient extends AwsClient {}\n", "num_lines": 50}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\QLDB\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon QLDB** service.\n */\nclass QLDBException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\QLDBSession;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon QLDB Session** service.\n * @method \\Aws\\Result sendCommand(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendCommandAsync(array $args = [])\n */\nclass QLDBSessionClient extends AwsClient {}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\QLDBSession\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon QLDB Session** service.\n */\nclass QLDBSessionException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\QuickSight;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon QuickSight** service.\n * @method \\Aws\\Result cancelIngestion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelIngestionAsync(array $args = [])\n * @method \\Aws\\Result createAccountCustomization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccountCustomizationAsync(array $args = [])\n * @method \\Aws\\Result createAccountSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccountSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result createAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAnalysisAsync(array $args = [])\n * @method \\Aws\\Result createDashboard(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDashboardAsync(array $args = [])\n * @method \\Aws\\Result createDataSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataSetAsync(array $args = [])\n * @method \\Aws\\Result createDataSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataSourceAsync(array $args = [])\n * @method \\Aws\\Result createFolder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFolderAsync(array $args = [])\n * @method \\Aws\\Result createFolderMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFolderMembershipAsync(array $args = [])\n * @method \\Aws\\Result createGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGroupAsync(array $args = [])\n * @method \\Aws\\Result createGroupMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGroupMembershipAsync(array $args = [])\n * @method \\Aws\\Result createIAMPolicyAssignment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIAMPolicyAssignmentAsync(array $args = [])\n * @method \\Aws\\Result createIngestion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIngestionAsync(array $args = [])\n * @method \\Aws\\Result createNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNamespaceAsync(array $args = [])\n * @method \\Aws\\Result createRefreshSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRefreshScheduleAsync(array $args = [])\n * @method \\Aws\\Result createTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTemplateAsync(array $args = [])\n * @method \\Aws\\Result createTemplateAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTemplateAliasAsync(array $args = [])\n * @method \\Aws\\Result createTheme(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createThemeAsync(array $args = [])\n * @method \\Aws\\Result createThemeAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createThemeAliasAsync(array $args = [])\n * @method \\Aws\\Result createTopic(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTopicAsync(array $args = [])\n * @method \\Aws\\Result createTopicRefreshSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTopicRefreshScheduleAsync(array $args = [])\n * @method \\Aws\\Result createVPCConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVPCConnectionAsync(array $args = [])\n * @method \\Aws\\Result deleteAccountCustomization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccountCustomizationAsync(array $args = [])\n * @method \\Aws\\Result deleteAccountSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccountSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result deleteAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAnalysisAsync(array $args = [])\n * @method \\Aws\\Result deleteDashboard(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDashboardAsync(array $args = [])\n * @method \\Aws\\Result deleteDataSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataSetAsync(array $args = [])\n * @method \\Aws\\Result deleteDataSetRefreshProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataSetRefreshPropertiesAsync(array $args = [])\n * @method \\Aws\\Result deleteDataSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataSourceAsync(array $args = [])\n * @method \\Aws\\Result deleteFolder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFolderAsync(array $args = [])\n * @method \\Aws\\Result deleteFolderMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFolderMembershipAsync(array $args = [])\n * @method \\Aws\\Result deleteGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteGroupMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGroupMembershipAsync(array $args = [])\n * @method \\Aws\\Result deleteIAMPolicyAssignment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIAMPolicyAssignmentAsync(array $args = [])\n * @method \\Aws\\Result deleteNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNamespaceAsync(array $args = [])\n * @method \\Aws\\Result deleteRefreshSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRefreshScheduleAsync(array $args = [])\n * @method \\Aws\\Result deleteTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteTemplateAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTemplateAliasAsync(array $args = [])\n * @method \\Aws\\Result deleteTheme(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteThemeAsync(array $args = [])\n * @method \\Aws\\Result deleteThemeAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteThemeAliasAsync(array $args = [])\n * @method \\Aws\\Result deleteTopic(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTopicAsync(array $args = [])\n * @method \\Aws\\Result deleteTopicRefreshSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTopicRefreshScheduleAsync(array $args = [])\n * @method \\Aws\\Result deleteUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserAsync(array $args = [])\n * @method \\Aws\\Result deleteUserByPrincipalId(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserByPrincipalIdAsync(array $args = [])\n * @method \\Aws\\Result deleteVPCConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVPCConnectionAsync(array $args = [])\n * @method \\Aws\\Result describeAccountCustomization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountCustomizationAsync(array $args = [])\n * @method \\Aws\\Result describeAccountSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountSettingsAsync(array $args = [])\n * @method \\Aws\\Result describeAccountSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result describeAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAnalysisAsync(array $args = [])\n * @method \\Aws\\Result describeAnalysisDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAnalysisDefinitionAsync(array $args = [])\n * @method \\Aws\\Result describeAnalysisPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAnalysisPermissionsAsync(array $args = [])\n * @method \\Aws\\Result describeAssetBundleExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAssetBundleExportJobAsync(array $args = [])\n * @method \\Aws\\Result describeAssetBundleImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAssetBundleImportJobAsync(array $args = [])\n * @method \\Aws\\Result describeDashboard(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDashboardAsync(array $args = [])\n * @method \\Aws\\Result describeDashboardDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDashboardDefinitionAsync(array $args = [])\n * @method \\Aws\\Result describeDashboardPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDashboardPermissionsAsync(array $args = [])\n * @method \\Aws\\Result describeDataSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDataSetAsync(array $args = [])\n * @method \\Aws\\Result describeDataSetPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDataSetPermissionsAsync(array $args = [])\n * @method \\Aws\\Result describeDataSetRefreshProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDataSetRefreshPropertiesAsync(array $args = [])\n * @method \\Aws\\Result describeDataSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDataSourceAsync(array $args = [])\n * @method \\Aws\\Result describeDataSourcePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDataSourcePermissionsAsync(array $args = [])\n * @method \\Aws\\Result describeFolder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFolderAsync(array $args = [])\n * @method \\Aws\\Result describeFolderPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFolderPermissionsAsync(array $args = [])\n * @method \\Aws\\Result describeFolderResolvedPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFolderResolvedPermissionsAsync(array $args = [])\n * @method \\Aws\\Result describeGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGroupAsync(array $args = [])\n * @method \\Aws\\Result describeGroupMembership(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGroupMembershipAsync(array $args = [])\n * @method \\Aws\\Result describeIAMPolicyAssignment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeIAMPolicyAssignmentAsync(array $args = [])\n * @method \\Aws\\Result describeIngestion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeIngestionAsync(array $args = [])\n * @method \\Aws\\Result describeIpRestriction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeIpRestrictionAsync(array $args = [])\n * @method \\Aws\\Result describeNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNamespaceAsync(array $args = [])\n * @method \\Aws\\Result describeRefreshSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRefreshScheduleAsync(array $args = [])\n * @method \\Aws\\Result describeTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTemplateAsync(array $args = [])\n * @method \\Aws\\Result describeTemplateAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTemplateAliasAsync(array $args = [])\n * @method \\Aws\\Result describeTemplateDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTemplateDefinitionAsync(array $args = [])\n * @method \\Aws\\Result describeTemplatePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTemplatePermissionsAsync(array $args = [])\n * @method \\Aws\\Result describeTheme(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeThemeAsync(array $args = [])\n * @method \\Aws\\Result describeThemeAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeThemeAliasAsync(array $args = [])\n * @method \\Aws\\Result describeThemePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeThemePermissionsAsync(array $args = [])\n * @method \\Aws\\Result describeTopic(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTopicAsync(array $args = [])\n * @method \\Aws\\Result describeTopicPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTopicPermissionsAsync(array $args = [])\n * @method \\Aws\\Result describeTopicRefresh(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTopicRefreshAsync(array $args = [])\n * @method \\Aws\\Result describeTopicRefreshSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTopicRefreshScheduleAsync(array $args = [])\n * @method \\Aws\\Result describeUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserAsync(array $args = [])\n * @method \\Aws\\Result describeVPCConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVPCConnectionAsync(array $args = [])\n * @method \\Aws\\Result generateEmbedUrlForAnonymousUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateEmbedUrlForAnonymousUserAsync(array $args = [])\n * @method \\Aws\\Result generateEmbedUrlForRegisteredUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateEmbedUrlForRegisteredUserAsync(array $args = [])\n * @method \\Aws\\Result getDashboardEmbedUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDashboardEmbedUrlAsync(array $args = [])\n * @method \\Aws\\Result getSessionEmbedUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSessionEmbedUrlAsync(array $args = [])\n * @method \\Aws\\Result listAnalyses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAnalysesAsync(array $args = [])\n * @method \\Aws\\Result listAssetBundleExportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssetBundleExportJobsAsync(array $args = [])\n * @method \\Aws\\Result listAssetBundleImportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssetBundleImportJobsAsync(array $args = [])\n * @method \\Aws\\Result listDashboardVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDashboardVersionsAsync(array $args = [])\n * @method \\Aws\\Result listDashboards(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDashboardsAsync(array $args = [])\n * @method \\Aws\\Result listDataSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataSetsAsync(array $args = [])\n * @method \\Aws\\Result listDataSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataSourcesAsync(array $args = [])\n * @method \\Aws\\Result listFolderMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFolderMembersAsync(array $args = [])\n * @method \\Aws\\Result listFolders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFoldersAsync(array $args = [])\n * @method \\Aws\\Result listGroupMemberships(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupMembershipsAsync(array $args = [])\n * @method \\Aws\\Result listGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupsAsync(array $args = [])\n * @method \\Aws\\Result listIAMPolicyAssignments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIAMPolicyAssignmentsAsync(array $args = [])\n * @method \\Aws\\Result listIAMPolicyAssignmentsForUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIAMPolicyAssignmentsForUserAsync(array $args = [])\n * @method \\Aws\\Result listIngestions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIngestionsAsync(array $args = [])\n * @method \\Aws\\Result listNamespaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNamespacesAsync(array $args = [])\n * @method \\Aws\\Result listRefreshSchedules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRefreshSchedulesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTemplateAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTemplateAliasesAsync(array $args = [])\n * @method \\Aws\\Result listTemplateVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTemplateVersionsAsync(array $args = [])\n * @method \\Aws\\Result listTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listThemeAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listThemeAliasesAsync(array $args = [])\n * @method \\Aws\\Result listThemeVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listThemeVersionsAsync(array $args = [])\n * @method \\Aws\\Result listThemes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listThemesAsync(array $args = [])\n * @method \\Aws\\Result listTopicRefreshSchedules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTopicRefreshSchedulesAsync(array $args = [])\n * @method \\Aws\\Result listTopics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTopicsAsync(array $args = [])\n * @method \\Aws\\Result listUserGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUserGroupsAsync(array $args = [])\n * @method \\Aws\\Result listUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUsersAsync(array $args = [])\n * @method \\Aws\\Result listVPCConnections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVPCConnectionsAsync(array $args = [])\n * @method \\Aws\\Result putDataSetRefreshProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDataSetRefreshPropertiesAsync(array $args = [])\n * @method \\Aws\\Result registerUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerUserAsync(array $args = [])\n * @method \\Aws\\Result restoreAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreAnalysisAsync(array $args = [])\n * @method \\Aws\\Result searchAnalyses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchAnalysesAsync(array $args = [])\n * @method \\Aws\\Result searchDashboards(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchDashboardsAsync(array $args = [])\n * @method \\Aws\\Result searchDataSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchDataSetsAsync(array $args = [])\n * @method \\Aws\\Result searchDataSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchDataSourcesAsync(array $args = [])\n * @method \\Aws\\Result searchFolders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchFoldersAsync(array $args = [])\n * @method \\Aws\\Result searchGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchGroupsAsync(array $args = [])\n * @method \\Aws\\Result startAssetBundleExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startAssetBundleExportJobAsync(array $args = [])\n * @method \\Aws\\Result startAssetBundleImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startAssetBundleImportJobAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAccountCustomization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccountCustomizationAsync(array $args = [])\n * @method \\Aws\\Result updateAccountSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccountSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAnalysisAsync(array $args = [])\n * @method \\Aws\\Result updateAnalysisPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAnalysisPermissionsAsync(array $args = [])\n * @method \\Aws\\Result updateDashboard(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDashboardAsync(array $args = [])\n * @method \\Aws\\Result updateDashboardPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDashboardPermissionsAsync(array $args = [])\n * @method \\Aws\\Result updateDashboardPublishedVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDashboardPublishedVersionAsync(array $args = [])\n * @method \\Aws\\Result updateDataSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDataSetAsync(array $args = [])\n * @method \\Aws\\Result updateDataSetPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDataSetPermissionsAsync(array $args = [])\n * @method \\Aws\\Result updateDataSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDataSourceAsync(array $args = [])\n * @method \\Aws\\Result updateDataSourcePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDataSourcePermissionsAsync(array $args = [])\n * @method \\Aws\\Result updateFolder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFolderAsync(array $args = [])\n * @method \\Aws\\Result updateFolderPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFolderPermissionsAsync(array $args = [])\n * @method \\Aws\\Result updateGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGroupAsync(array $args = [])\n * @method \\Aws\\Result updateIAMPolicyAssignment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIAMPolicyAssignmentAsync(array $args = [])\n * @method \\Aws\\Result updateIpRestriction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIpRestrictionAsync(array $args = [])\n * @method \\Aws\\Result updatePublicSharingSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePublicSharingSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateRefreshSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRefreshScheduleAsync(array $args = [])\n * @method \\Aws\\Result updateTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTemplateAsync(array $args = [])\n * @method \\Aws\\Result updateTemplateAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTemplateAliasAsync(array $args = [])\n * @method \\Aws\\Result updateTemplatePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTemplatePermissionsAsync(array $args = [])\n * @method \\Aws\\Result updateTheme(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateThemeAsync(array $args = [])\n * @method \\Aws\\Result updateThemeAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateThemeAliasAsync(array $args = [])\n * @method \\Aws\\Result updateThemePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateThemePermissionsAsync(array $args = [])\n * @method \\Aws\\Result updateTopic(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTopicAsync(array $args = [])\n * @method \\Aws\\Result updateTopicPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTopicPermissionsAsync(array $args = [])\n * @method \\Aws\\Result updateTopicRefreshSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTopicRefreshScheduleAsync(array $args = [])\n * @method \\Aws\\Result updateUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserAsync(array $args = [])\n * @method \\Aws\\Result updateVPCConnection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVPCConnectionAsync(array $args = [])\n */\nclass QuickSightClient extends AwsClient {}\n", "num_lines": 326}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\QuickSight\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon QuickSight** service.\n */\nclass QuickSightException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\RAM;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Resource Access Manager** service.\n * @method \\Aws\\Result acceptResourceShareInvitation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptResourceShareInvitationAsync(array $args = [])\n * @method \\Aws\\Result associateResourceShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateResourceShareAsync(array $args = [])\n * @method \\Aws\\Result associateResourceSharePermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateResourceSharePermissionAsync(array $args = [])\n * @method \\Aws\\Result createPermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPermissionAsync(array $args = [])\n * @method \\Aws\\Result createPermissionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPermissionVersionAsync(array $args = [])\n * @method \\Aws\\Result createResourceShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResourceShareAsync(array $args = [])\n * @method \\Aws\\Result deletePermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePermissionAsync(array $args = [])\n * @method \\Aws\\Result deletePermissionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePermissionVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteResourceShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourceShareAsync(array $args = [])\n * @method \\Aws\\Result disassociateResourceShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateResourceShareAsync(array $args = [])\n * @method \\Aws\\Result disassociateResourceSharePermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateResourceSharePermissionAsync(array $args = [])\n * @method \\Aws\\Result enableSharingWithAwsOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableSharingWithAwsOrganizationAsync(array $args = [])\n * @method \\Aws\\Result getPermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPermissionAsync(array $args = [])\n * @method \\Aws\\Result getResourcePolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcePoliciesAsync(array $args = [])\n * @method \\Aws\\Result getResourceShareAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceShareAssociationsAsync(array $args = [])\n * @method \\Aws\\Result getResourceShareInvitations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceShareInvitationsAsync(array $args = [])\n * @method \\Aws\\Result getResourceShares(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceSharesAsync(array $args = [])\n * @method \\Aws\\Result listPendingInvitationResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPendingInvitationResourcesAsync(array $args = [])\n * @method \\Aws\\Result listPermissionAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPermissionAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listPermissionVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPermissionVersionsAsync(array $args = [])\n * @method \\Aws\\Result listPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPermissionsAsync(array $args = [])\n * @method \\Aws\\Result listPrincipals(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPrincipalsAsync(array $args = [])\n * @method \\Aws\\Result listReplacePermissionAssociationsWork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReplacePermissionAssociationsWorkAsync(array $args = [])\n * @method \\Aws\\Result listResourceSharePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceSharePermissionsAsync(array $args = [])\n * @method \\Aws\\Result listResourceTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceTypesAsync(array $args = [])\n * @method \\Aws\\Result listResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourcesAsync(array $args = [])\n * @method \\Aws\\Result promotePermissionCreatedFromPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise promotePermissionCreatedFromPolicyAsync(array $args = [])\n * @method \\Aws\\Result promoteResourceShareCreatedFromPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise promoteResourceShareCreatedFromPolicyAsync(array $args = [])\n * @method \\Aws\\Result rejectResourceShareInvitation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectResourceShareInvitationAsync(array $args = [])\n * @method \\Aws\\Result replacePermissionAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise replacePermissionAssociationsAsync(array $args = [])\n * @method \\Aws\\Result setDefaultPermissionVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setDefaultPermissionVersionAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateResourceShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResourceShareAsync(array $args = [])\n */\nclass RAMClient extends AwsClient {}\n", "num_lines": 78}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\RAM\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Resource Access Manager** service.\n */\nclass RAMException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Rds;\n\nuse Aws\\Credentials\\CredentialsInterface;\nuse Aws\\Credentials\\Credentials;\nuse Aws\\Signature\\SignatureV4;\nuse GuzzleHttp\\Psr7\\Request;\nuse GuzzleHttp\\Psr7\\Uri;\nuse GuzzleHttp\\Promise;\nuse Aws;\n\n/**\n * Generates RDS auth tokens for use with IAM authentication.\n */\nclass AuthTokenGenerator\n{\n\n    private $credentialProvider;\n\n    /**\n     * The constructor takes an instance of Credentials or a CredentialProvider\n     *\n     * @param callable|Credentials $creds\n     */\n    public function __construct($creds)\n    {\n        if ($creds instanceof CredentialsInterface) {\n            $promise = new Promise\\FulfilledPromise($creds);\n            $this->credentialProvider = Aws\\constantly($promise);\n        } else {\n            $this->credentialProvider = $creds;\n        }\n    }\n\n    /**\n     * Create the token for database login\n     *\n     * @param string $endpoint The database hostname with port number specified\n     *                         (e.g., host:port)\n     * @param string $region The region where the database is located\n     * @param string $username The username to login as\n     * @param int $lifetime The lifetime of the token in minutes\n     *\n     * @return string Token generated\n     */\n    public function createToken($endpoint, $region, $username, $lifetime = 15)\n    {\n        if (!is_numeric($lifetime) || $lifetime > 15 || $lifetime <= 0) {\n            throw new \\InvalidArgumentException(\n                \"Lifetime must be a positive number less than or equal to 15, was {$lifetime}\",\n                null\n            );\n        }\n\n        $uri = new Uri($endpoint);\n        $uri = $uri->withPath('/');\n        $uri = $uri->withQuery('Action=connect&DBUser=' . $username);\n\n        $request = new Request('GET', $uri);\n        $signer = new SignatureV4('rds-db', $region);\n        $provider = $this->credentialProvider;\n\n        $url = (string) $signer->presign(\n            $request,\n            $provider()->wait(),\n            '+' . $lifetime . ' minutes'\n        )->getUri();\n\n        // Remove 2 extra slash from the presigned url result\n        return substr($url, 2);\n    }\n}\n", "num_lines": 73}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Rds;\n\nuse Aws\\AwsClient;\nuse Aws\\Api\\Service;\nuse Aws\\Api\\DocModel;\nuse Aws\\Api\\ApiProvider;\nuse Aws\\PresignUrlMiddleware;\n\n/**\n * This client is used to interact with the **Amazon Relational Database Service (Amazon RDS)**.\n *\n * @method \\Aws\\Result addSourceIdentifierToSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addSourceIdentifierToSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result addTagsToResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsToResourceAsync(array $args = [])\n * @method \\Aws\\Result authorizeDBSecurityGroupIngress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise authorizeDBSecurityGroupIngressAsync(array $args = [])\n * @method \\Aws\\Result copyDBParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyDBParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result copyDBSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyDBSnapshotAsync(array $args = [])\n * @method \\Aws\\Result copyOptionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyOptionGroupAsync(array $args = [])\n * @method \\Aws\\Result createDBInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBInstanceAsync(array $args = [])\n * @method \\Aws\\Result createDBInstanceReadReplica(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBInstanceReadReplicaAsync(array $args = [])\n * @method \\Aws\\Result createDBParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result createDBSecurityGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBSecurityGroupAsync(array $args = [])\n * @method \\Aws\\Result createDBSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createDBSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDBSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result createEventSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEventSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result createOptionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createOptionGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteDBInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBInstanceAsync(array $args = [])\n * @method \\Aws\\Result deleteDBParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteDBSecurityGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBSecurityGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteDBSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteDBSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteEventSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result deleteOptionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOptionGroupAsync(array $args = [])\n * @method \\Aws\\Result describeDBEngineVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBEngineVersionsAsync(array $args = [])\n * @method \\Aws\\Result describeDBInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeDBLogFiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBLogFilesAsync(array $args = [])\n * @method \\Aws\\Result describeDBParameterGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBParameterGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeDBParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBParametersAsync(array $args = [])\n * @method \\Aws\\Result describeDBSecurityGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBSecurityGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeDBSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result describeDBSubnetGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDBSubnetGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeEngineDefaultParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEngineDefaultParametersAsync(array $args = [])\n * @method \\Aws\\Result describeEventCategories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventCategoriesAsync(array $args = [])\n * @method \\Aws\\Result describeEventSubscriptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventSubscriptionsAsync(array $args = [])\n * @method \\Aws\\Result describeEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventsAsync(array $args = [])\n * @method \\Aws\\Result describeOptionGroupOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOptionGroupOptionsAsync(array $args = [])\n * @method \\Aws\\Result describeOptionGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOptionGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeOrderableDBInstanceOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrderableDBInstanceOptionsAsync(array $args = [])\n * @method \\Aws\\Result describeReservedDBInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedDBInstancesAsync(array $args = [])\n * @method \\Aws\\Result describeReservedDBInstancesOfferings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedDBInstancesOfferingsAsync(array $args = [])\n * @method \\Aws\\Result downloadDBLogFilePortion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise downloadDBLogFilePortionAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result modifyDBInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBInstanceAsync(array $args = [])\n * @method \\Aws\\Result modifyDBParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result modifyDBSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result modifyEventSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyEventSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result modifyOptionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyOptionGroupAsync(array $args = [])\n * @method \\Aws\\Result promoteReadReplica(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise promoteReadReplicaAsync(array $args = [])\n * @method \\Aws\\Result purchaseReservedDBInstancesOffering(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise purchaseReservedDBInstancesOfferingAsync(array $args = [])\n * @method \\Aws\\Result rebootDBInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebootDBInstanceAsync(array $args = [])\n * @method \\Aws\\Result removeSourceIdentifierFromSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeSourceIdentifierFromSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result removeTagsFromResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsFromResourceAsync(array $args = [])\n * @method \\Aws\\Result resetDBParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetDBParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result restoreDBInstanceFromDBSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreDBInstanceFromDBSnapshotAsync(array $args = [])\n * @method \\Aws\\Result restoreDBInstanceToPointInTime(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreDBInstanceToPointInTimeAsync(array $args = [])\n * @method \\Aws\\Result revokeDBSecurityGroupIngress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeDBSecurityGroupIngressAsync(array $args = [])\n * @method \\Aws\\Result addRoleToDBCluster(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise addRoleToDBClusterAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result addRoleToDBInstance(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise addRoleToDBInstanceAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result applyPendingMaintenanceAction(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise applyPendingMaintenanceActionAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result backtrackDBCluster(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise backtrackDBClusterAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result cancelExportTask(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise cancelExportTaskAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result copyDBClusterParameterGroup(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise copyDBClusterParameterGroupAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result copyDBClusterSnapshot(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise copyDBClusterSnapshotAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result createBlueGreenDeployment(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise createBlueGreenDeploymentAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result createCustomDBEngineVersion(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise createCustomDBEngineVersionAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result createDBCluster(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise createDBClusterAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result createDBClusterEndpoint(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise createDBClusterEndpointAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result createDBClusterParameterGroup(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise createDBClusterParameterGroupAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result createDBClusterSnapshot(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise createDBClusterSnapshotAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result createDBProxy(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise createDBProxyAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result createDBProxyEndpoint(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise createDBProxyEndpointAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result createGlobalCluster(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise createGlobalClusterAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result deleteBlueGreenDeployment(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteBlueGreenDeploymentAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result deleteCustomDBEngineVersion(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomDBEngineVersionAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result deleteDBCluster(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBClusterAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result deleteDBClusterEndpoint(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBClusterEndpointAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result deleteDBClusterParameterGroup(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBClusterParameterGroupAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result deleteDBClusterSnapshot(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBClusterSnapshotAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result deleteDBInstanceAutomatedBackup(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBInstanceAutomatedBackupAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result deleteDBProxy(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBProxyAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result deleteDBProxyEndpoint(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteDBProxyEndpointAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result deleteGlobalCluster(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise deleteGlobalClusterAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result deregisterDBProxyTargets(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise deregisterDBProxyTargetsAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeAccountAttributes(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountAttributesAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeBlueGreenDeployments(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeBlueGreenDeploymentsAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeCertificates(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeCertificatesAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeDBClusterBacktracks(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClusterBacktracksAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeDBClusterEndpoints(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClusterEndpointsAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeDBClusterParameterGroups(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClusterParameterGroupsAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeDBClusterParameters(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClusterParametersAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeDBClusterSnapshotAttributes(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClusterSnapshotAttributesAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeDBClusterSnapshots(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClusterSnapshotsAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeDBClusters(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeDBClustersAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeDBInstanceAutomatedBackups(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeDBInstanceAutomatedBackupsAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeDBProxies(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeDBProxiesAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeDBProxyEndpoints(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeDBProxyEndpointsAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeDBProxyTargetGroups(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeDBProxyTargetGroupsAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeDBProxyTargets(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeDBProxyTargetsAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeDBSnapshotAttributes(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeDBSnapshotAttributesAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeEngineDefaultClusterParameters(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeEngineDefaultClusterParametersAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeExportTasks(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeExportTasksAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeGlobalClusters(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeGlobalClustersAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describePendingMaintenanceActions(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describePendingMaintenanceActionsAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeSourceRegions(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeSourceRegionsAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result describeValidDBInstanceModifications(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise describeValidDBInstanceModificationsAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result failoverDBCluster(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise failoverDBClusterAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result failoverGlobalCluster(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise failoverGlobalClusterAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result modifyActivityStream(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise modifyActivityStreamAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result modifyCertificates(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise modifyCertificatesAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result modifyCurrentDBClusterCapacity(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise modifyCurrentDBClusterCapacityAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result modifyCustomDBEngineVersion(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise modifyCustomDBEngineVersionAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result modifyDBCluster(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBClusterAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result modifyDBClusterEndpoint(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBClusterEndpointAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result modifyDBClusterParameterGroup(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBClusterParameterGroupAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result modifyDBClusterSnapshotAttribute(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBClusterSnapshotAttributeAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result modifyDBProxy(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBProxyAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result modifyDBProxyEndpoint(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBProxyEndpointAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result modifyDBProxyTargetGroup(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBProxyTargetGroupAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result modifyDBSnapshot(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBSnapshotAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result modifyDBSnapshotAttribute(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise modifyDBSnapshotAttributeAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result modifyGlobalCluster(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise modifyGlobalClusterAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result promoteReadReplicaDBCluster(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise promoteReadReplicaDBClusterAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result rebootDBCluster(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise rebootDBClusterAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result registerDBProxyTargets(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise registerDBProxyTargetsAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result removeFromGlobalCluster(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise removeFromGlobalClusterAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result removeRoleFromDBCluster(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise removeRoleFromDBClusterAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result removeRoleFromDBInstance(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise removeRoleFromDBInstanceAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result resetDBClusterParameterGroup(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise resetDBClusterParameterGroupAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result restoreDBClusterFromS3(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise restoreDBClusterFromS3Async(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result restoreDBClusterFromSnapshot(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise restoreDBClusterFromSnapshotAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result restoreDBClusterToPointInTime(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise restoreDBClusterToPointInTimeAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result restoreDBInstanceFromS3(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise restoreDBInstanceFromS3Async(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result startActivityStream(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise startActivityStreamAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result startDBCluster(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise startDBClusterAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result startDBInstance(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise startDBInstanceAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result startDBInstanceAutomatedBackupsReplication(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise startDBInstanceAutomatedBackupsReplicationAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result startExportTask(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise startExportTaskAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result stopActivityStream(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise stopActivityStreamAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result stopDBCluster(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise stopDBClusterAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result stopDBInstance(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise stopDBInstanceAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result stopDBInstanceAutomatedBackupsReplication(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise stopDBInstanceAutomatedBackupsReplicationAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result switchoverBlueGreenDeployment(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise switchoverBlueGreenDeploymentAsync(array $args = []) (supported in versions 2014-10-31)\n * @method \\Aws\\Result switchoverReadReplica(array $args = []) (supported in versions 2014-10-31)\n * @method \\GuzzleHttp\\Promise\\Promise switchoverReadReplicaAsync(array $args = []) (supported in versions 2014-10-31)\n */\nclass RdsClient extends AwsClient\n{\n    public function __construct(array $args)\n    {\n        $args['with_resolved'] = function (array $args) {\n            $this->getHandlerList()->appendInit(\n                PresignUrlMiddleware::wrap(\n                    $this,\n                    $args['endpoint_provider'],\n                    [\n                        'operations' => [\n                            'CopyDBSnapshot',\n                            'CreateDBInstanceReadReplica',\n                            'CopyDBClusterSnapshot',\n                            'CreateDBCluster',\n                            'StartDBInstanceAutomatedBackupsReplication'\n                        ],\n                        'service' => 'rds',\n                        'presign_param' => 'PreSignedUrl',\n                        'require_different_region' => true,\n                    ]\n                ),\n                'rds.presigner'\n            );\n        };\n\n        parent::__construct($args);\n    }\n\n    /**\n     * @internal\n     * @codeCoverageIgnore\n     */\n    public static function applyDocFilters(array $api, array $docs)\n    {\n        // Add the SourceRegion parameter\n        $docs['shapes']['SourceRegion']['base'] = 'A required parameter that indicates '\n            . 'the region that the DB snapshot will be copied from.';\n        $api['shapes']['SourceRegion'] = ['type' => 'string'];\n        $api['shapes']['CopyDBSnapshotMessage']['members']['SourceRegion'] = ['shape' => 'SourceRegion'];\n        $api['shapes']['CreateDBInstanceReadReplicaMessage']['members']['SourceRegion'] = ['shape' => 'SourceRegion'];\n\n        // Add the DestinationRegion parameter\n        $docs['shapes']['DestinationRegion']['base']\n            = '<div class=\"alert alert-info\">The SDK will populate this '\n            . 'parameter on your behalf using the configured region value of '\n            . 'the client.</div>';\n        $api['shapes']['DestinationRegion'] = ['type' => 'string'];\n        $api['shapes']['CopyDBSnapshotMessage']['members']['DestinationRegion'] = ['shape' => 'DestinationRegion'];\n        $api['shapes']['CreateDBInstanceReadReplicaMessage']['members']['DestinationRegion'] = ['shape' => 'DestinationRegion'];\n\n        // Several parameters in presign APIs are optional.\n        $docs['shapes']['String']['refs']['CopyDBSnapshotMessage$PreSignedUrl']\n            = '<div class=\"alert alert-info\">The SDK will compute this value '\n            . 'for you on your behalf.</div>';\n        $docs['shapes']['String']['refs']['CopyDBSnapshotMessage$DestinationRegion']\n            = '<div class=\"alert alert-info\">The SDK will populate this '\n            . 'parameter on your behalf using the configured region value of '\n            . 'the client.</div>';\n\n        // Several parameters in presign APIs are optional.\n        $docs['shapes']['String']['refs']['CreateDBInstanceReadReplicaMessage$PreSignedUrl']\n            = '<div class=\"alert alert-info\">The SDK will compute this value '\n            . 'for you on your behalf.</div>';\n        $docs['shapes']['String']['refs']['CreateDBInstanceReadReplicaMessage$DestinationRegion']\n            = '<div class=\"alert alert-info\">The SDK will populate this '\n            . 'parameter on your behalf using the configured region value of '\n            . 'the client.</div>';\n\n        if ($api['metadata']['apiVersion'] != '2014-09-01') {\n            $api['shapes']['CopyDBClusterSnapshotMessage']['members']['SourceRegion'] = ['shape' => 'SourceRegion'];\n            $api['shapes']['CreateDBClusterMessage']['members']['SourceRegion'] = ['shape' => 'SourceRegion'];\n\n            $api['shapes']['CopyDBClusterSnapshotMessage']['members']['DestinationRegion'] = ['shape' => 'DestinationRegion'];\n            $api['shapes']['CreateDBClusterMessage']['members']['DestinationRegion'] = ['shape' => 'DestinationRegion'];\n\n            // Several parameters in presign APIs are optional.\n            $docs['shapes']['String']['refs']['CopyDBClusterSnapshotMessage$PreSignedUrl']\n                = '<div class=\"alert alert-info\">The SDK will compute this value '\n                . 'for you on your behalf.</div>';\n            $docs['shapes']['String']['refs']['CopyDBClusterSnapshotMessage$DestinationRegion']\n                = '<div class=\"alert alert-info\">The SDK will populate this '\n                . 'parameter on your behalf using the configured region value of '\n                . 'the client.</div>';\n\n            // Several parameters in presign APIs are optional.\n            $docs['shapes']['String']['refs']['CreateDBClusterMessage$PreSignedUrl']\n                = '<div class=\"alert alert-info\">The SDK will compute this value '\n                . 'for you on your behalf.</div>';\n            $docs['shapes']['String']['refs']['CreateDBClusterMessage$DestinationRegion']\n                = '<div class=\"alert alert-info\">The SDK will populate this '\n                . 'parameter on your behalf using the configured region value of '\n                . 'the client.</div>';\n        }\n\n        return [\n            new Service($api, ApiProvider::defaultProvider()),\n            new DocModel($docs)\n        ];\n    }\n}\n", "num_lines": 397}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Rds\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon Relational Database Service.\n */\nclass RdsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\RDSDataService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS RDS DataService** service.\n * @method \\Aws\\Result batchExecuteStatement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchExecuteStatementAsync(array $args = [])\n * @method \\Aws\\Result beginTransaction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise beginTransactionAsync(array $args = [])\n * @method \\Aws\\Result commitTransaction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise commitTransactionAsync(array $args = [])\n * @method \\Aws\\Result executeSql(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise executeSqlAsync(array $args = [])\n * @method \\Aws\\Result executeStatement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise executeStatementAsync(array $args = [])\n * @method \\Aws\\Result rollbackTransaction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rollbackTransactionAsync(array $args = [])\n */\nclass RDSDataServiceClient extends AwsClient {}\n", "num_lines": 22}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\RDSDataService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS RDS DataService** service.\n */\nclass RDSDataServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\RecycleBin;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Recycle Bin** service.\n * @method \\Aws\\Result createRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRuleAsync(array $args = [])\n * @method \\Aws\\Result getRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRuleAsync(array $args = [])\n * @method \\Aws\\Result listRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRulesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result lockRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise lockRuleAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result unlockRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unlockRuleAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRuleAsync(array $args = [])\n */\nclass RecycleBinClient extends AwsClient {}\n", "num_lines": 30}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\RecycleBin\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Recycle Bin** service.\n */\nclass RecycleBinException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Redshift;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Redshift** service.\n *\n * @method \\Aws\\Result acceptReservedNodeExchange(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptReservedNodeExchangeAsync(array $args = [])\n * @method \\Aws\\Result addPartner(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addPartnerAsync(array $args = [])\n * @method \\Aws\\Result associateDataShareConsumer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateDataShareConsumerAsync(array $args = [])\n * @method \\Aws\\Result authorizeClusterSecurityGroupIngress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise authorizeClusterSecurityGroupIngressAsync(array $args = [])\n * @method \\Aws\\Result authorizeDataShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise authorizeDataShareAsync(array $args = [])\n * @method \\Aws\\Result authorizeEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise authorizeEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result authorizeSnapshotAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise authorizeSnapshotAccessAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteClusterSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteClusterSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result batchModifyClusterSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchModifyClusterSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result cancelResize(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelResizeAsync(array $args = [])\n * @method \\Aws\\Result copyClusterSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyClusterSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createAuthenticationProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAuthenticationProfileAsync(array $args = [])\n * @method \\Aws\\Result createCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClusterAsync(array $args = [])\n * @method \\Aws\\Result createClusterParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClusterParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result createClusterSecurityGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClusterSecurityGroupAsync(array $args = [])\n * @method \\Aws\\Result createClusterSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClusterSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createClusterSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClusterSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result createCustomDomainAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCustomDomainAssociationAsync(array $args = [])\n * @method \\Aws\\Result createEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result createEventSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEventSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result createHsmClientCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHsmClientCertificateAsync(array $args = [])\n * @method \\Aws\\Result createHsmConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHsmConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createScheduledAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createScheduledActionAsync(array $args = [])\n * @method \\Aws\\Result createSnapshotCopyGrant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSnapshotCopyGrantAsync(array $args = [])\n * @method \\Aws\\Result createSnapshotSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSnapshotScheduleAsync(array $args = [])\n * @method \\Aws\\Result createTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTagsAsync(array $args = [])\n * @method \\Aws\\Result createUsageLimit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUsageLimitAsync(array $args = [])\n * @method \\Aws\\Result deauthorizeDataShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deauthorizeDataShareAsync(array $args = [])\n * @method \\Aws\\Result deleteAuthenticationProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAuthenticationProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClusterAsync(array $args = [])\n * @method \\Aws\\Result deleteClusterParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClusterParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteClusterSecurityGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClusterSecurityGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteClusterSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClusterSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteClusterSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClusterSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomDomainAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomDomainAssociationAsync(array $args = [])\n * @method \\Aws\\Result deleteEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result deleteEventSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEventSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result deleteHsmClientCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHsmClientCertificateAsync(array $args = [])\n * @method \\Aws\\Result deleteHsmConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHsmConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deletePartner(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePartnerAsync(array $args = [])\n * @method \\Aws\\Result deleteScheduledAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteScheduledActionAsync(array $args = [])\n * @method \\Aws\\Result deleteSnapshotCopyGrant(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSnapshotCopyGrantAsync(array $args = [])\n * @method \\Aws\\Result deleteSnapshotSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSnapshotScheduleAsync(array $args = [])\n * @method \\Aws\\Result deleteTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTagsAsync(array $args = [])\n * @method \\Aws\\Result deleteUsageLimit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUsageLimitAsync(array $args = [])\n * @method \\Aws\\Result describeAccountAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountAttributesAsync(array $args = [])\n * @method \\Aws\\Result describeAuthenticationProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAuthenticationProfilesAsync(array $args = [])\n * @method \\Aws\\Result describeClusterDbRevisions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClusterDbRevisionsAsync(array $args = [])\n * @method \\Aws\\Result describeClusterParameterGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClusterParameterGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeClusterParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClusterParametersAsync(array $args = [])\n * @method \\Aws\\Result describeClusterSecurityGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClusterSecurityGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeClusterSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClusterSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result describeClusterSubnetGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClusterSubnetGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeClusterTracks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClusterTracksAsync(array $args = [])\n * @method \\Aws\\Result describeClusterVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClusterVersionsAsync(array $args = [])\n * @method \\Aws\\Result describeClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClustersAsync(array $args = [])\n * @method \\Aws\\Result describeCustomDomainAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCustomDomainAssociationsAsync(array $args = [])\n * @method \\Aws\\Result describeDataShares(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDataSharesAsync(array $args = [])\n * @method \\Aws\\Result describeDataSharesForConsumer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDataSharesForConsumerAsync(array $args = [])\n * @method \\Aws\\Result describeDataSharesForProducer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDataSharesForProducerAsync(array $args = [])\n * @method \\Aws\\Result describeDefaultClusterParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDefaultClusterParametersAsync(array $args = [])\n * @method \\Aws\\Result describeEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result describeEndpointAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEndpointAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result describeEventCategories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventCategoriesAsync(array $args = [])\n * @method \\Aws\\Result describeEventSubscriptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventSubscriptionsAsync(array $args = [])\n * @method \\Aws\\Result describeEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEventsAsync(array $args = [])\n * @method \\Aws\\Result describeHsmClientCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHsmClientCertificatesAsync(array $args = [])\n * @method \\Aws\\Result describeHsmConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHsmConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result describeLoggingStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLoggingStatusAsync(array $args = [])\n * @method \\Aws\\Result describeNodeConfigurationOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNodeConfigurationOptionsAsync(array $args = [])\n * @method \\Aws\\Result describeOrderableClusterOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrderableClusterOptionsAsync(array $args = [])\n * @method \\Aws\\Result describePartners(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePartnersAsync(array $args = [])\n * @method \\Aws\\Result describeReservedNodeExchangeStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedNodeExchangeStatusAsync(array $args = [])\n * @method \\Aws\\Result describeReservedNodeOfferings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedNodeOfferingsAsync(array $args = [])\n * @method \\Aws\\Result describeReservedNodes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReservedNodesAsync(array $args = [])\n * @method \\Aws\\Result describeResize(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeResizeAsync(array $args = [])\n * @method \\Aws\\Result describeScheduledActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScheduledActionsAsync(array $args = [])\n * @method \\Aws\\Result describeSnapshotCopyGrants(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSnapshotCopyGrantsAsync(array $args = [])\n * @method \\Aws\\Result describeSnapshotSchedules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSnapshotSchedulesAsync(array $args = [])\n * @method \\Aws\\Result describeStorage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStorageAsync(array $args = [])\n * @method \\Aws\\Result describeTableRestoreStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTableRestoreStatusAsync(array $args = [])\n * @method \\Aws\\Result describeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTagsAsync(array $args = [])\n * @method \\Aws\\Result describeUsageLimits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUsageLimitsAsync(array $args = [])\n * @method \\Aws\\Result disableLogging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableLoggingAsync(array $args = [])\n * @method \\Aws\\Result disableSnapshotCopy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableSnapshotCopyAsync(array $args = [])\n * @method \\Aws\\Result disassociateDataShareConsumer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateDataShareConsumerAsync(array $args = [])\n * @method \\Aws\\Result enableLogging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableLoggingAsync(array $args = [])\n * @method \\Aws\\Result enableSnapshotCopy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableSnapshotCopyAsync(array $args = [])\n * @method \\Aws\\Result getClusterCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getClusterCredentialsAsync(array $args = [])\n * @method \\Aws\\Result getClusterCredentialsWithIAM(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getClusterCredentialsWithIAMAsync(array $args = [])\n * @method \\Aws\\Result getReservedNodeExchangeConfigurationOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReservedNodeExchangeConfigurationOptionsAsync(array $args = [])\n * @method \\Aws\\Result getReservedNodeExchangeOfferings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReservedNodeExchangeOfferingsAsync(array $args = [])\n * @method \\Aws\\Result modifyAquaConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyAquaConfigurationAsync(array $args = [])\n * @method \\Aws\\Result modifyAuthenticationProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyAuthenticationProfileAsync(array $args = [])\n * @method \\Aws\\Result modifyCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyClusterAsync(array $args = [])\n * @method \\Aws\\Result modifyClusterDbRevision(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyClusterDbRevisionAsync(array $args = [])\n * @method \\Aws\\Result modifyClusterIamRoles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyClusterIamRolesAsync(array $args = [])\n * @method \\Aws\\Result modifyClusterMaintenance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyClusterMaintenanceAsync(array $args = [])\n * @method \\Aws\\Result modifyClusterParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyClusterParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result modifyClusterSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyClusterSnapshotAsync(array $args = [])\n * @method \\Aws\\Result modifyClusterSnapshotSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyClusterSnapshotScheduleAsync(array $args = [])\n * @method \\Aws\\Result modifyClusterSubnetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyClusterSubnetGroupAsync(array $args = [])\n * @method \\Aws\\Result modifyCustomDomainAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyCustomDomainAssociationAsync(array $args = [])\n * @method \\Aws\\Result modifyEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result modifyEventSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyEventSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result modifyScheduledAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyScheduledActionAsync(array $args = [])\n * @method \\Aws\\Result modifySnapshotCopyRetentionPeriod(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifySnapshotCopyRetentionPeriodAsync(array $args = [])\n * @method \\Aws\\Result modifySnapshotSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifySnapshotScheduleAsync(array $args = [])\n * @method \\Aws\\Result modifyUsageLimit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyUsageLimitAsync(array $args = [])\n * @method \\Aws\\Result pauseCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise pauseClusterAsync(array $args = [])\n * @method \\Aws\\Result purchaseReservedNodeOffering(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise purchaseReservedNodeOfferingAsync(array $args = [])\n * @method \\Aws\\Result rebootCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebootClusterAsync(array $args = [])\n * @method \\Aws\\Result rejectDataShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectDataShareAsync(array $args = [])\n * @method \\Aws\\Result resetClusterParameterGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetClusterParameterGroupAsync(array $args = [])\n * @method \\Aws\\Result resizeCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resizeClusterAsync(array $args = [])\n * @method \\Aws\\Result restoreFromClusterSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreFromClusterSnapshotAsync(array $args = [])\n * @method \\Aws\\Result restoreTableFromClusterSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreTableFromClusterSnapshotAsync(array $args = [])\n * @method \\Aws\\Result resumeCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resumeClusterAsync(array $args = [])\n * @method \\Aws\\Result revokeClusterSecurityGroupIngress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeClusterSecurityGroupIngressAsync(array $args = [])\n * @method \\Aws\\Result revokeEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result revokeSnapshotAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeSnapshotAccessAsync(array $args = [])\n * @method \\Aws\\Result rotateEncryptionKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rotateEncryptionKeyAsync(array $args = [])\n * @method \\Aws\\Result updatePartnerStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePartnerStatusAsync(array $args = [])\n */\nclass RedshiftClient extends AwsClient {}\n", "num_lines": 257}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Redshift\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon Redshift service.\n */\nclass RedshiftException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\RedshiftDataAPIService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Redshift Data API Service** service.\n * @method \\Aws\\Result batchExecuteStatement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchExecuteStatementAsync(array $args = [])\n * @method \\Aws\\Result cancelStatement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelStatementAsync(array $args = [])\n * @method \\Aws\\Result describeStatement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStatementAsync(array $args = [])\n * @method \\Aws\\Result describeTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTableAsync(array $args = [])\n * @method \\Aws\\Result executeStatement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise executeStatementAsync(array $args = [])\n * @method \\Aws\\Result getStatementResult(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStatementResultAsync(array $args = [])\n * @method \\Aws\\Result listDatabases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatabasesAsync(array $args = [])\n * @method \\Aws\\Result listSchemas(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSchemasAsync(array $args = [])\n * @method \\Aws\\Result listStatements(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStatementsAsync(array $args = [])\n * @method \\Aws\\Result listTables(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTablesAsync(array $args = [])\n */\nclass RedshiftDataAPIServiceClient extends AwsClient {}\n", "num_lines": 30}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\RedshiftDataAPIService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Redshift Data API Service** service.\n */\nclass RedshiftDataAPIServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\RedshiftServerless;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Redshift Serverless** service.\n * @method \\Aws\\Result convertRecoveryPointToSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise convertRecoveryPointToSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result createNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNamespaceAsync(array $args = [])\n * @method \\Aws\\Result createSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createUsageLimit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUsageLimitAsync(array $args = [])\n * @method \\Aws\\Result createWorkgroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkgroupAsync(array $args = [])\n * @method \\Aws\\Result deleteEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result deleteNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNamespaceAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteUsageLimit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUsageLimitAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkgroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkgroupAsync(array $args = [])\n * @method \\Aws\\Result getCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCredentialsAsync(array $args = [])\n * @method \\Aws\\Result getEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result getNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNamespaceAsync(array $args = [])\n * @method \\Aws\\Result getRecoveryPoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRecoveryPointAsync(array $args = [])\n * @method \\Aws\\Result getResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result getSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSnapshotAsync(array $args = [])\n * @method \\Aws\\Result getTableRestoreStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTableRestoreStatusAsync(array $args = [])\n * @method \\Aws\\Result getUsageLimit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUsageLimitAsync(array $args = [])\n * @method \\Aws\\Result getWorkgroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkgroupAsync(array $args = [])\n * @method \\Aws\\Result listEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result listNamespaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNamespacesAsync(array $args = [])\n * @method \\Aws\\Result listRecoveryPoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecoveryPointsAsync(array $args = [])\n * @method \\Aws\\Result listSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result listTableRestoreStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTableRestoreStatusAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listUsageLimits(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUsageLimitsAsync(array $args = [])\n * @method \\Aws\\Result listWorkgroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkgroupsAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result restoreFromRecoveryPoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreFromRecoveryPointAsync(array $args = [])\n * @method \\Aws\\Result restoreFromSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreFromSnapshotAsync(array $args = [])\n * @method \\Aws\\Result restoreTableFromSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreTableFromSnapshotAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateEndpointAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEndpointAccessAsync(array $args = [])\n * @method \\Aws\\Result updateNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNamespaceAsync(array $args = [])\n * @method \\Aws\\Result updateSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSnapshotAsync(array $args = [])\n * @method \\Aws\\Result updateUsageLimit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUsageLimitAsync(array $args = [])\n * @method \\Aws\\Result updateWorkgroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkgroupAsync(array $args = [])\n */\nclass RedshiftServerlessClient extends AwsClient {}\n", "num_lines": 90}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\RedshiftServerless\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Redshift Serverless** service.\n */\nclass RedshiftServerlessException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Rekognition;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Rekognition** service.\n * @method \\Aws\\Result associateFaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateFacesAsync(array $args = [])\n * @method \\Aws\\Result compareFaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise compareFacesAsync(array $args = [])\n * @method \\Aws\\Result copyProjectVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyProjectVersionAsync(array $args = [])\n * @method \\Aws\\Result createCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCollectionAsync(array $args = [])\n * @method \\Aws\\Result createDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatasetAsync(array $args = [])\n * @method \\Aws\\Result createFaceLivenessSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFaceLivenessSessionAsync(array $args = [])\n * @method \\Aws\\Result createProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProjectAsync(array $args = [])\n * @method \\Aws\\Result createProjectVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProjectVersionAsync(array $args = [])\n * @method \\Aws\\Result createStreamProcessor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStreamProcessorAsync(array $args = [])\n * @method \\Aws\\Result createUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserAsync(array $args = [])\n * @method \\Aws\\Result deleteCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCollectionAsync(array $args = [])\n * @method \\Aws\\Result deleteDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDatasetAsync(array $args = [])\n * @method \\Aws\\Result deleteFaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFacesAsync(array $args = [])\n * @method \\Aws\\Result deleteProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProjectAsync(array $args = [])\n * @method \\Aws\\Result deleteProjectPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProjectPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteProjectVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProjectVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteStreamProcessor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStreamProcessorAsync(array $args = [])\n * @method \\Aws\\Result deleteUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserAsync(array $args = [])\n * @method \\Aws\\Result describeCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCollectionAsync(array $args = [])\n * @method \\Aws\\Result describeDataset(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDatasetAsync(array $args = [])\n * @method \\Aws\\Result describeProjectVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProjectVersionsAsync(array $args = [])\n * @method \\Aws\\Result describeProjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProjectsAsync(array $args = [])\n * @method \\Aws\\Result describeStreamProcessor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStreamProcessorAsync(array $args = [])\n * @method \\Aws\\Result detectCustomLabels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectCustomLabelsAsync(array $args = [])\n * @method \\Aws\\Result detectFaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectFacesAsync(array $args = [])\n * @method \\Aws\\Result detectLabels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectLabelsAsync(array $args = [])\n * @method \\Aws\\Result detectModerationLabels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectModerationLabelsAsync(array $args = [])\n * @method \\Aws\\Result detectProtectiveEquipment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectProtectiveEquipmentAsync(array $args = [])\n * @method \\Aws\\Result detectText(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectTextAsync(array $args = [])\n * @method \\Aws\\Result disassociateFaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateFacesAsync(array $args = [])\n * @method \\Aws\\Result distributeDatasetEntries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise distributeDatasetEntriesAsync(array $args = [])\n * @method \\Aws\\Result getCelebrityInfo(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCelebrityInfoAsync(array $args = [])\n * @method \\Aws\\Result getCelebrityRecognition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCelebrityRecognitionAsync(array $args = [])\n * @method \\Aws\\Result getContentModeration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContentModerationAsync(array $args = [])\n * @method \\Aws\\Result getFaceDetection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFaceDetectionAsync(array $args = [])\n * @method \\Aws\\Result getFaceLivenessSessionResults(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFaceLivenessSessionResultsAsync(array $args = [])\n * @method \\Aws\\Result getFaceSearch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFaceSearchAsync(array $args = [])\n * @method \\Aws\\Result getLabelDetection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLabelDetectionAsync(array $args = [])\n * @method \\Aws\\Result getPersonTracking(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPersonTrackingAsync(array $args = [])\n * @method \\Aws\\Result getSegmentDetection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSegmentDetectionAsync(array $args = [])\n * @method \\Aws\\Result getTextDetection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTextDetectionAsync(array $args = [])\n * @method \\Aws\\Result indexFaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise indexFacesAsync(array $args = [])\n * @method \\Aws\\Result listCollections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCollectionsAsync(array $args = [])\n * @method \\Aws\\Result listDatasetEntries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetEntriesAsync(array $args = [])\n * @method \\Aws\\Result listDatasetLabels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatasetLabelsAsync(array $args = [])\n * @method \\Aws\\Result listFaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFacesAsync(array $args = [])\n * @method \\Aws\\Result listProjectPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProjectPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listStreamProcessors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStreamProcessorsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUsersAsync(array $args = [])\n * @method \\Aws\\Result putProjectPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putProjectPolicyAsync(array $args = [])\n * @method \\Aws\\Result recognizeCelebrities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise recognizeCelebritiesAsync(array $args = [])\n * @method \\Aws\\Result searchFaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchFacesAsync(array $args = [])\n * @method \\Aws\\Result searchFacesByImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchFacesByImageAsync(array $args = [])\n * @method \\Aws\\Result searchUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchUsersAsync(array $args = [])\n * @method \\Aws\\Result searchUsersByImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchUsersByImageAsync(array $args = [])\n * @method \\Aws\\Result startCelebrityRecognition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startCelebrityRecognitionAsync(array $args = [])\n * @method \\Aws\\Result startContentModeration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startContentModerationAsync(array $args = [])\n * @method \\Aws\\Result startFaceDetection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startFaceDetectionAsync(array $args = [])\n * @method \\Aws\\Result startFaceSearch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startFaceSearchAsync(array $args = [])\n * @method \\Aws\\Result startLabelDetection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startLabelDetectionAsync(array $args = [])\n * @method \\Aws\\Result startPersonTracking(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startPersonTrackingAsync(array $args = [])\n * @method \\Aws\\Result startProjectVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startProjectVersionAsync(array $args = [])\n * @method \\Aws\\Result startSegmentDetection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSegmentDetectionAsync(array $args = [])\n * @method \\Aws\\Result startStreamProcessor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startStreamProcessorAsync(array $args = [])\n * @method \\Aws\\Result startTextDetection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startTextDetectionAsync(array $args = [])\n * @method \\Aws\\Result stopProjectVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopProjectVersionAsync(array $args = [])\n * @method \\Aws\\Result stopStreamProcessor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopStreamProcessorAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDatasetEntries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDatasetEntriesAsync(array $args = [])\n * @method \\Aws\\Result updateStreamProcessor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStreamProcessorAsync(array $args = [])\n */\nclass RekognitionClient extends AwsClient {}\n", "num_lines": 154}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Rekognition\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Rekognition** service.\n */\nclass RekognitionException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ResilienceHub;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Resilience Hub** service.\n * @method \\Aws\\Result addDraftAppVersionResourceMappings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addDraftAppVersionResourceMappingsAsync(array $args = [])\n * @method \\Aws\\Result createApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppAsync(array $args = [])\n * @method \\Aws\\Result createAppVersionAppComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppVersionAppComponentAsync(array $args = [])\n * @method \\Aws\\Result createAppVersionResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppVersionResourceAsync(array $args = [])\n * @method \\Aws\\Result createRecommendationTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRecommendationTemplateAsync(array $args = [])\n * @method \\Aws\\Result createResiliencyPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResiliencyPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppAsync(array $args = [])\n * @method \\Aws\\Result deleteAppAssessment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppAssessmentAsync(array $args = [])\n * @method \\Aws\\Result deleteAppInputSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppInputSourceAsync(array $args = [])\n * @method \\Aws\\Result deleteAppVersionAppComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppVersionAppComponentAsync(array $args = [])\n * @method \\Aws\\Result deleteAppVersionResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppVersionResourceAsync(array $args = [])\n * @method \\Aws\\Result deleteRecommendationTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRecommendationTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteResiliencyPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResiliencyPolicyAsync(array $args = [])\n * @method \\Aws\\Result describeApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppAsync(array $args = [])\n * @method \\Aws\\Result describeAppAssessment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppAssessmentAsync(array $args = [])\n * @method \\Aws\\Result describeAppVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppVersionAsync(array $args = [])\n * @method \\Aws\\Result describeAppVersionAppComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppVersionAppComponentAsync(array $args = [])\n * @method \\Aws\\Result describeAppVersionResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppVersionResourceAsync(array $args = [])\n * @method \\Aws\\Result describeAppVersionResourcesResolutionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppVersionResourcesResolutionStatusAsync(array $args = [])\n * @method \\Aws\\Result describeAppVersionTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppVersionTemplateAsync(array $args = [])\n * @method \\Aws\\Result describeDraftAppVersionResourcesImportStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDraftAppVersionResourcesImportStatusAsync(array $args = [])\n * @method \\Aws\\Result describeResiliencyPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeResiliencyPolicyAsync(array $args = [])\n * @method \\Aws\\Result importResourcesToDraftAppVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importResourcesToDraftAppVersionAsync(array $args = [])\n * @method \\Aws\\Result listAlarmRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAlarmRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result listAppAssessments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppAssessmentsAsync(array $args = [])\n * @method \\Aws\\Result listAppComponentCompliances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppComponentCompliancesAsync(array $args = [])\n * @method \\Aws\\Result listAppComponentRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppComponentRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result listAppInputSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppInputSourcesAsync(array $args = [])\n * @method \\Aws\\Result listAppVersionAppComponents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppVersionAppComponentsAsync(array $args = [])\n * @method \\Aws\\Result listAppVersionResourceMappings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppVersionResourceMappingsAsync(array $args = [])\n * @method \\Aws\\Result listAppVersionResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppVersionResourcesAsync(array $args = [])\n * @method \\Aws\\Result listAppVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppVersionsAsync(array $args = [])\n * @method \\Aws\\Result listApps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppsAsync(array $args = [])\n * @method \\Aws\\Result listRecommendationTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecommendationTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listResiliencyPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResiliencyPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listSopRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSopRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result listSuggestedResiliencyPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSuggestedResiliencyPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTestRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTestRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result listUnsupportedAppVersionResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUnsupportedAppVersionResourcesAsync(array $args = [])\n * @method \\Aws\\Result publishAppVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise publishAppVersionAsync(array $args = [])\n * @method \\Aws\\Result putDraftAppVersionTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDraftAppVersionTemplateAsync(array $args = [])\n * @method \\Aws\\Result removeDraftAppVersionResourceMappings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeDraftAppVersionResourceMappingsAsync(array $args = [])\n * @method \\Aws\\Result resolveAppVersionResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resolveAppVersionResourcesAsync(array $args = [])\n * @method \\Aws\\Result startAppAssessment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startAppAssessmentAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppAsync(array $args = [])\n * @method \\Aws\\Result updateAppVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppVersionAsync(array $args = [])\n * @method \\Aws\\Result updateAppVersionAppComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppVersionAppComponentAsync(array $args = [])\n * @method \\Aws\\Result updateAppVersionResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppVersionResourceAsync(array $args = [])\n * @method \\Aws\\Result updateResiliencyPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResiliencyPolicyAsync(array $args = [])\n */\nclass ResilienceHubClient extends AwsClient {}\n", "num_lines": 114}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ResilienceHub\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Resilience Hub** service.\n */\nclass ResilienceHubException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ResourceExplorer2;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Resource Explorer** service.\n * @method \\Aws\\Result associateDefaultView(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateDefaultViewAsync(array $args = [])\n * @method \\Aws\\Result batchGetView(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetViewAsync(array $args = [])\n * @method \\Aws\\Result createIndex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIndexAsync(array $args = [])\n * @method \\Aws\\Result createView(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createViewAsync(array $args = [])\n * @method \\Aws\\Result deleteIndex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIndexAsync(array $args = [])\n * @method \\Aws\\Result deleteView(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteViewAsync(array $args = [])\n * @method \\Aws\\Result disassociateDefaultView(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateDefaultViewAsync(array $args = [])\n * @method \\Aws\\Result getDefaultView(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDefaultViewAsync(array $args = [])\n * @method \\Aws\\Result getIndex(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIndexAsync(array $args = [])\n * @method \\Aws\\Result getView(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getViewAsync(array $args = [])\n * @method \\Aws\\Result listIndexes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIndexesAsync(array $args = [])\n * @method \\Aws\\Result listSupportedResourceTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSupportedResourceTypesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listViews(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listViewsAsync(array $args = [])\n * @method \\Aws\\Result search(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateIndexType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIndexTypeAsync(array $args = [])\n * @method \\Aws\\Result updateView(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateViewAsync(array $args = [])\n */\nclass ResourceExplorer2Client extends AwsClient {}\n", "num_lines": 48}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ResourceExplorer2\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Resource Explorer** service.\n */\nclass ResourceExplorer2Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ResourceGroups;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Resource Groups** service.\n * @method \\Aws\\Result createGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGroupAsync(array $args = [])\n * @method \\Aws\\Result getAccountSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountSettingsAsync(array $args = [])\n * @method \\Aws\\Result getGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGroupAsync(array $args = [])\n * @method \\Aws\\Result getGroupConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGroupConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getGroupQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGroupQueryAsync(array $args = [])\n * @method \\Aws\\Result getTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTagsAsync(array $args = [])\n * @method \\Aws\\Result groupResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise groupResourcesAsync(array $args = [])\n * @method \\Aws\\Result listGroupResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupResourcesAsync(array $args = [])\n * @method \\Aws\\Result listGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupsAsync(array $args = [])\n * @method \\Aws\\Result putGroupConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putGroupConfigurationAsync(array $args = [])\n * @method \\Aws\\Result searchResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchResourcesAsync(array $args = [])\n * @method \\Aws\\Result tag(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagAsync(array $args = [])\n * @method \\Aws\\Result ungroupResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise ungroupResourcesAsync(array $args = [])\n * @method \\Aws\\Result untag(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagAsync(array $args = [])\n * @method \\Aws\\Result updateAccountSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccountSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGroupAsync(array $args = [])\n * @method \\Aws\\Result updateGroupQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGroupQueryAsync(array $args = [])\n */\nclass ResourceGroupsClient extends AwsClient {}\n", "num_lines": 46}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ResourceGroups\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Resource Groups** service.\n */\nclass ResourceGroupsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ResourceGroupsTaggingAPI;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Resource Groups Tagging API** service.\n * @method \\Aws\\Result describeReportCreation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReportCreationAsync(array $args = [])\n * @method \\Aws\\Result getComplianceSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getComplianceSummaryAsync(array $args = [])\n * @method \\Aws\\Result getResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcesAsync(array $args = [])\n * @method \\Aws\\Result getTagKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTagKeysAsync(array $args = [])\n * @method \\Aws\\Result getTagValues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTagValuesAsync(array $args = [])\n * @method \\Aws\\Result startReportCreation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startReportCreationAsync(array $args = [])\n * @method \\Aws\\Result tagResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourcesAsync(array $args = [])\n * @method \\Aws\\Result untagResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourcesAsync(array $args = [])\n */\nclass ResourceGroupsTaggingAPIClient extends AwsClient {}\n", "num_lines": 26}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ResourceGroupsTaggingAPI\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Resource Groups Tagging API** service.\n */\nclass ResourceGroupsTaggingAPIException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Retry;\n\nuse Aws\\Retry\\Exception\\ConfigurationException;\n\nclass Configuration implements ConfigurationInterface\n{\n    private $mode;\n    private $maxAttempts;\n    private $validModes = [\n        'legacy',\n        'standard',\n        'adaptive'\n    ];\n\n    public function __construct($mode = 'legacy', $maxAttempts = 3)\n    {\n        $mode = strtolower($mode);\n        if (!in_array($mode, $this->validModes)) {\n            throw new ConfigurationException(\"'{$mode}' is not a valid mode.\"\n                . \" The mode has to be 'legacy', 'standard', or 'adaptive'.\");\n        }\n        if (!is_numeric($maxAttempts)\n            || intval($maxAttempts) != $maxAttempts\n            || $maxAttempts < 1\n        ) {\n            throw new ConfigurationException(\"The 'maxAttempts' parameter has\"\n                . \" to be an integer >= 1.\");\n        }\n\n        $this->mode = $mode;\n        $this->maxAttempts = intval($maxAttempts);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getMode()\n    {\n        return $this->mode;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getMaxAttempts()\n    {\n        return $this->maxAttempts;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function toArray()\n    {\n        return [\n            'mode' => $this->getMode(),\n            'max_attempts' => $this->getMaxAttempts(),\n        ];\n    }\n}\n", "num_lines": 62}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Retry;\n\n/**\n * Provides access to retry configuration\n */\ninterface ConfigurationInterface\n{\n    /**\n     * Returns the retry mode. Available modes include 'legacy', 'standard', and\n     * 'adapative'.\n     *\n     * @return string\n     */\n    public function getMode();\n\n    /**\n     * Returns the maximum number of attempts that will be used for a request\n     *\n     * @return string\n     */\n    public function getMaxAttempts();\n\n    /**\n     * Returns the configuration as an associative array\n     *\n     * @return array\n     */\n    public function toArray();\n}\n", "num_lines": 31}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Retry;\n\nuse Aws\\AbstractConfigurationProvider;\nuse Aws\\CacheInterface;\nuse Aws\\ConfigurationProviderInterface;\nuse Aws\\Retry\\Exception\\ConfigurationException;\nuse GuzzleHttp\\Promise;\nuse GuzzleHttp\\Promise\\PromiseInterface;\n\n/**\n * A configuration provider is a function that returns a promise that is\n * fulfilled with a {@see \\Aws\\Retry\\ConfigurationInterface}\n * or rejected with an {@see \\Aws\\Retry\\Exception\\ConfigurationException}.\n *\n * <code>\n * use Aws\\Sts\\RegionalEndpoints\\ConfigurationProvider;\n * $provider = ConfigurationProvider::defaultProvider();\n * // Returns a ConfigurationInterface or throws.\n * $config = $provider()->wait();\n * </code>\n *\n * Configuration providers can be composed to create configuration using\n * conditional logic that can create different configurations in different\n * environments. You can compose multiple providers into a single provider using\n * {@see \\Aws\\Retry\\ConfigurationProvider::chain}. This function\n * accepts providers as variadic arguments and returns a new function that will\n * invoke each provider until a successful configuration is returned.\n *\n * <code>\n * // First try an INI file at this location.\n * $a = ConfigurationProvider::ini(null, '/path/to/file.ini');\n * // Then try an INI file at this location.\n * $b = ConfigurationProvider::ini(null, '/path/to/other-file.ini');\n * // Then try loading from environment variables.\n * $c = ConfigurationProvider::env();\n * // Combine the three providers together.\n * $composed = ConfigurationProvider::chain($a, $b, $c);\n * // Returns a promise that is fulfilled with a configuration or throws.\n * $promise = $composed();\n * // Wait on the configuration to resolve.\n * $config = $promise->wait();\n * </code>\n */\nclass ConfigurationProvider extends AbstractConfigurationProvider\n    implements ConfigurationProviderInterface\n{\n    const DEFAULT_MAX_ATTEMPTS = 3;\n    const DEFAULT_MODE = 'legacy';\n    const ENV_MAX_ATTEMPTS = 'AWS_MAX_ATTEMPTS';\n    const ENV_MODE = 'AWS_RETRY_MODE';\n    const ENV_PROFILE = 'AWS_PROFILE';\n    const INI_MAX_ATTEMPTS = 'max_attempts';\n    const INI_MODE = 'retry_mode';\n\n    public static $cacheKey = 'aws_retries_config';\n\n    protected static $interfaceClass = ConfigurationInterface::class;\n    protected static $exceptionClass = ConfigurationException::class;\n\n    /**\n     * Create a default config provider that first checks for environment\n     * variables, then checks for a specified profile in the environment-defined\n     * config file location (env variable is 'AWS_CONFIG_FILE', file location\n     * defaults to ~/.aws/config), then checks for the \"default\" profile in the\n     * environment-defined config file location, and failing those uses a default\n     * fallback set of configuration options.\n     *\n     * This provider is automatically wrapped in a memoize function that caches\n     * previously provided config options.\n     *\n     * @param array $config\n     *\n     * @return callable\n     */\n    public static function defaultProvider(array $config = [])\n    {\n        $configProviders = [self::env()];\n        if (\n            !isset($config['use_aws_shared_config_files'])\n            || $config['use_aws_shared_config_files'] != false\n        ) {\n            $configProviders[] = self::ini();\n        }\n        $configProviders[] = self::fallback();\n\n        $memo = self::memoize(\n            call_user_func_array([ConfigurationProvider::class, 'chain'], $configProviders)\n        );\n\n        if (isset($config['retries'])\n            && $config['retries'] instanceof CacheInterface\n        ) {\n            return self::cache($memo, $config['retries'], self::$cacheKey);\n        }\n\n        return $memo;\n    }\n\n    /**\n     * Provider that creates config from environment variables.\n     *\n     * @return callable\n     */\n    public static function env()\n    {\n        return function () {\n            // Use config from environment variables, if available\n            $mode = getenv(self::ENV_MODE);\n            $maxAttempts = getenv(self::ENV_MAX_ATTEMPTS)\n                ? getenv(self::ENV_MAX_ATTEMPTS)\n                : self::DEFAULT_MAX_ATTEMPTS;\n            if (!empty($mode)) {\n                return Promise\\Create::promiseFor(\n                    new Configuration($mode, $maxAttempts)\n                );\n            }\n\n            return self::reject('Could not find environment variable config'\n                . ' in ' . self::ENV_MODE);\n        };\n    }\n\n    /**\n     * Fallback config options when other sources are not set.\n     *\n     * @return callable\n     */\n    public static function fallback()\n    {\n        return function () {\n            return Promise\\Create::promiseFor(\n                new Configuration(self::DEFAULT_MODE, self::DEFAULT_MAX_ATTEMPTS)\n            );\n        };\n    }\n\n    /**\n     * Config provider that creates config using a config file whose location\n     * is specified by an environment variable 'AWS_CONFIG_FILE', defaulting to\n     * ~/.aws/config if not specified\n     *\n     * @param string|null $profile  Profile to use. If not specified will use\n     *                              the \"default\" profile.\n     * @param string|null $filename If provided, uses a custom filename rather\n     *                              than looking in the default directory.\n     *\n     * @return callable\n     */\n    public static function ini(\n        $profile = null,\n        $filename = null\n    ) {\n        $filename = $filename ?: (self::getDefaultConfigFilename());\n        $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');\n\n        return function () use ($profile, $filename) {\n            if (!@is_readable($filename)) {\n                return self::reject(\"Cannot read configuration from $filename\");\n            }\n            $data = \\Aws\\parse_ini_file($filename, true);\n            if ($data === false) {\n                return self::reject(\"Invalid config file: $filename\");\n            }\n            if (!isset($data[$profile])) {\n                return self::reject(\"'$profile' not found in config file\");\n            }\n            if (!isset($data[$profile][self::INI_MODE])) {\n                return self::reject(\"Required retry config values\n                    not present in INI profile '{$profile}' ({$filename})\");\n            }\n\n            $maxAttempts = isset($data[$profile][self::INI_MAX_ATTEMPTS])\n                ? $data[$profile][self::INI_MAX_ATTEMPTS]\n                : self::DEFAULT_MAX_ATTEMPTS;\n\n            return Promise\\Create::promiseFor(\n                new Configuration(\n                    $data[$profile][self::INI_MODE],\n                    $maxAttempts\n                )\n            );\n        };\n    }\n\n    /**\n     * Unwraps a configuration object in whatever valid form it is in,\n     * always returning a ConfigurationInterface object.\n     *\n     * @param  mixed $config\n     * @return ConfigurationInterface\n     * @throws \\InvalidArgumentException\n     */\n    public static function unwrap($config)\n    {\n        if (is_callable($config)) {\n            $config = $config();\n        }\n        if ($config instanceof PromiseInterface) {\n            $config = $config->wait();\n        }\n        if ($config instanceof ConfigurationInterface) {\n            return $config;\n        }\n\n        // An integer value for this config indicates the legacy 'retries'\n        // config option, which is incremented to translate to max attempts\n        if (is_int($config)) {\n            return new Configuration('legacy', $config + 1);\n        }\n\n        if (is_array($config) && isset($config['mode'])) {\n            $maxAttempts = isset($config['max_attempts'])\n                ? $config['max_attempts']\n                : self::DEFAULT_MAX_ATTEMPTS;\n            return new Configuration($config['mode'], $maxAttempts);\n        }\n\n        throw new \\InvalidArgumentException('Not a valid retry configuration'\n            . ' argument.');\n    }\n}\n", "num_lines": 223}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Retry;\n\nuse Aws\\Exception\\AwsException;\nuse Aws\\ResultInterface;\n\n/**\n * @internal\n */\nclass QuotaManager\n{\n    private $availableCapacity;\n    private $capacityAmount;\n    private $initialRetryTokens;\n    private $maxCapacity;\n    private $noRetryIncrement;\n    private $retryCost;\n    private $timeoutRetryCost;\n\n    public function __construct($config = [])\n    {\n        $this->initialRetryTokens = isset($config['initial_retry_tokens'])\n            ? $config['initial_retry_tokens']\n            : 500;\n        $this->noRetryIncrement = isset($config['no_retry_increment'])\n            ? $config['no_retry_increment']\n            : 1;\n        $this->retryCost = isset($config['retry_cost'])\n            ? $config['retry_cost']\n            : 5;\n        $this->timeoutRetryCost = isset($config['timeout_retry_cost'])\n            ? $config['timeout_retry_cost']\n            : 10;\n        $this->maxCapacity = $this->initialRetryTokens;\n        $this->availableCapacity = $this->initialRetryTokens;\n    }\n\n    public function hasRetryQuota($result)\n    {\n        if ($result instanceof AwsException && $result->isConnectionError()) {\n            $this->capacityAmount = $this->timeoutRetryCost;\n        } else {\n            $this->capacityAmount = $this->retryCost;\n        }\n\n        if ($this->capacityAmount > $this->availableCapacity) {\n            return false;\n        }\n\n        $this->availableCapacity -= $this->capacityAmount;\n        return true;\n    }\n\n    public function releaseToQuota($result)\n    {\n        if ($result instanceof AwsException) {\n            $statusCode = (int) $result->getStatusCode();\n        } elseif ($result instanceof ResultInterface) {\n            $statusCode = isset($result['@metadata']['statusCode'])\n                ? (int) $result['@metadata']['statusCode']\n                : null;\n        }\n\n        if (!empty($statusCode) && $statusCode >= 200 && $statusCode < 300) {\n            if (isset($this->capacityAmount)) {\n                $amount = $this->capacityAmount;\n                $this->availableCapacity += $amount;\n                unset($this->capacityAmount);\n            } else {\n                $amount = $this->noRetryIncrement;\n                $this->availableCapacity += $amount;\n            }\n            $this->availableCapacity = min(\n                $this->availableCapacity,\n                $this->maxCapacity\n            );\n        }\n\n        return (isset($amount) ? $amount : 0);\n    }\n\n    public function getAvailableCapacity()\n    {\n        return $this->availableCapacity;\n    }\n}\n", "num_lines": 87}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Retry;\n\n\n/**\n * @internal\n */\nclass RateLimiter\n{\n    // User-configurable constants\n    private $beta;\n    private $minCapacity;\n    private $minFillRate;\n    private $scaleConstant;\n    private $smooth;\n\n    // Optional callable time provider\n    private $timeProvider;\n\n    // Pre-set state variables\n    private $currentCapacity = 0;\n    private $enabled = false;\n    private $lastMaxRate = 0;\n    private $measuredTxRate = 0;\n    private $requestCount = 0;\n\n    // Other state variables\n    private $fillRate;\n    private $lastThrottleTime;\n    private $lastTimestamp;\n    private $lastTxRateBucket;\n    private $maxCapacity;\n    private $timeWindow;\n\n    public function __construct($options = [])\n    {\n        $this->beta = isset($options['beta'])\n            ? $options['beta']\n            : 0.7;\n        $this->minCapacity = isset($options['min_capacity'])\n            ? $options['min_capacity']\n            : 1;\n        $this->minFillRate = isset($options['min_fill_rate'])\n            ? $options['min_fill_rate']\n            : 0.5;\n        $this->scaleConstant = isset($options['scale_constant'])\n            ? $options['scale_constant']\n            : 0.4;\n        $this->smooth = isset($options['smooth'])\n            ? $options['smooth']\n            : 0.8;\n        $this->timeProvider = isset($options['time_provider'])\n            ? $options['time_provider']\n            : null;\n\n        $this->lastTxRateBucket = floor($this->time());\n        $this->lastThrottleTime = $this->time();\n    }\n\n    public function isEnabled()\n    {\n        return $this->enabled;\n    }\n\n    public function getSendToken()\n    {\n        $this->acquireToken(1);\n    }\n\n    public function updateSendingRate($isThrottled)\n    {\n        $this->updateMeasuredRate();\n\n        if ($isThrottled) {\n            if (!$this->isEnabled()) {\n                $rateToUse = $this->measuredTxRate;\n            } else {\n                $rateToUse = min($this->measuredTxRate, $this->fillRate);\n            }\n\n            $this->lastMaxRate = $rateToUse;\n            $this->calculateTimeWindow();\n            $this->lastThrottleTime = $this->time();\n            $calculatedRate = $this->cubicThrottle($rateToUse);\n            $this->enableTokenBucket();\n        } else {\n            $this->calculateTimeWindow();\n            $calculatedRate = $this->cubicSuccess($this->time());\n        }\n        $newRate = min($calculatedRate, 2 * $this->measuredTxRate);\n        $this->updateTokenBucketRate($newRate);\n        return $newRate;\n    }\n\n    private function acquireToken($amount)\n    {\n        if (!$this->enabled) {\n            return true;\n        }\n\n        $this->refillTokenBucket();\n\n        if ($amount > $this->currentCapacity) {\n            usleep((int) (1000000 * ($amount - $this->currentCapacity) / $this->fillRate));\n        }\n\n        $this->currentCapacity -= $amount;\n        return true;\n    }\n\n    private function calculateTimeWindow()\n    {\n        $this->timeWindow = pow(($this->lastMaxRate * (1 - $this->beta) / $this->scaleConstant), 0.333);\n    }\n\n    private function cubicSuccess($timestamp)\n    {\n        $dt = $timestamp - $this->lastThrottleTime;\n        return $this->scaleConstant * pow($dt - $this->timeWindow, 3) + $this->lastMaxRate;\n    }\n\n    private function cubicThrottle($rateToUse)\n    {\n        return $rateToUse * $this->beta;\n    }\n\n    private function enableTokenBucket()\n    {\n        $this->enabled = true;\n    }\n\n    private function refillTokenBucket()\n    {\n        $timestamp = $this->time();\n        if (!isset($this->lastTimestamp)) {\n            $this->lastTimestamp = $timestamp;\n            return;\n        }\n        $fillAmount = ($timestamp - $this->lastTimestamp) * $this->fillRate;\n        $this->currentCapacity = $this->currentCapacity + $fillAmount;\n        if (!is_null($this->maxCapacity)) {\n            $this->currentCapacity = min(\n                $this->maxCapacity,\n                $this->currentCapacity\n            );\n        }\n\n        $this->lastTimestamp = $timestamp;\n    }\n\n    private function time()\n    {\n        if (is_callable($this->timeProvider)) {\n            $provider = $this->timeProvider;\n            $time = $provider();\n            return $time;\n        }\n        return microtime(true);\n    }\n\n    private function updateMeasuredRate()\n    {\n        $timestamp = $this->time();\n        $timeBucket = floor(round($timestamp, 3) * 2) / 2;\n        $this->requestCount++;\n        if ($timeBucket > $this->lastTxRateBucket) {\n            $currentRate = $this->requestCount / ($timeBucket - $this->lastTxRateBucket);\n            $this->measuredTxRate = ($currentRate * $this->smooth)\n                + ($this->measuredTxRate * (1 - $this->smooth));\n            $this->requestCount = 0;\n            $this->lastTxRateBucket = $timeBucket;\n        }\n    }\n\n    private function updateTokenBucketRate($newRps)\n    {\n        $this->refillTokenBucket();\n        $this->fillRate = max($newRps, $this->minFillRate);\n        $this->maxCapacity = max($newRps, $this->minCapacity);\n        $this->currentCapacity = min($this->currentCapacity, $this->maxCapacity);\n    }\n}\n", "num_lines": 183}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Retry;\n\nuse Aws\\Exception\\AwsException;\nuse Aws\\ResultInterface;\n\ntrait RetryHelperTrait\n{\n    private function addRetryHeader($request, $retries, $delayBy)\n    {\n        return $request->withHeader('aws-sdk-retry', \"{$retries}/{$delayBy}\");\n    }\n\n\n    private function updateStats($retries, $delay, array &$stats)\n    {\n        if (!isset($stats['total_retry_delay'])) {\n            $stats['total_retry_delay'] = 0;\n        }\n\n        $stats['total_retry_delay'] += $delay;\n        $stats['retries_attempted'] = $retries;\n    }\n\n    private function updateHttpStats($value, array &$stats)\n    {\n        if (empty($stats['http'])) {\n            $stats['http'] = [];\n        }\n\n        if ($value instanceof AwsException) {\n            $resultStats = $value->getTransferInfo();\n            $stats['http'] []= $resultStats;\n        } elseif ($value instanceof ResultInterface) {\n            $resultStats = isset($value['@metadata']['transferStats']['http'][0])\n                ? $value['@metadata']['transferStats']['http'][0]\n                : [];\n            $stats['http'] []= $resultStats;\n        }\n    }\n\n    private function bindStatsToReturn($return, array $stats)\n    {\n        if ($return instanceof ResultInterface) {\n            if (!isset($return['@metadata'])) {\n                $return['@metadata'] = [];\n            }\n\n            $return['@metadata']['transferStats'] = $stats;\n        } elseif ($return instanceof AwsException) {\n            $return->setTransferInfo($stats);\n        }\n\n        return $return;\n    }\n}\n", "num_lines": 57}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Retry\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\n/**\n * Represents an error interacting with retry configuration\n */\nclass ConfigurationException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 15}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\RoboMaker;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS RoboMaker** service.\n * @method \\Aws\\Result batchDeleteWorlds(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteWorldsAsync(array $args = [])\n * @method \\Aws\\Result batchDescribeSimulationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDescribeSimulationJobAsync(array $args = [])\n * @method \\Aws\\Result cancelDeploymentJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelDeploymentJobAsync(array $args = [])\n * @method \\Aws\\Result cancelSimulationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelSimulationJobAsync(array $args = [])\n * @method \\Aws\\Result cancelSimulationJobBatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelSimulationJobBatchAsync(array $args = [])\n * @method \\Aws\\Result cancelWorldExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelWorldExportJobAsync(array $args = [])\n * @method \\Aws\\Result cancelWorldGenerationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelWorldGenerationJobAsync(array $args = [])\n * @method \\Aws\\Result createDeploymentJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeploymentJobAsync(array $args = [])\n * @method \\Aws\\Result createFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFleetAsync(array $args = [])\n * @method \\Aws\\Result createRobot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRobotAsync(array $args = [])\n * @method \\Aws\\Result createRobotApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRobotApplicationAsync(array $args = [])\n * @method \\Aws\\Result createRobotApplicationVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRobotApplicationVersionAsync(array $args = [])\n * @method \\Aws\\Result createSimulationApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSimulationApplicationAsync(array $args = [])\n * @method \\Aws\\Result createSimulationApplicationVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSimulationApplicationVersionAsync(array $args = [])\n * @method \\Aws\\Result createSimulationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSimulationJobAsync(array $args = [])\n * @method \\Aws\\Result createWorldExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorldExportJobAsync(array $args = [])\n * @method \\Aws\\Result createWorldGenerationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorldGenerationJobAsync(array $args = [])\n * @method \\Aws\\Result createWorldTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorldTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFleetAsync(array $args = [])\n * @method \\Aws\\Result deleteRobot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRobotAsync(array $args = [])\n * @method \\Aws\\Result deleteRobotApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRobotApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteSimulationApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSimulationApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteWorldTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorldTemplateAsync(array $args = [])\n * @method \\Aws\\Result deregisterRobot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterRobotAsync(array $args = [])\n * @method \\Aws\\Result describeDeploymentJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDeploymentJobAsync(array $args = [])\n * @method \\Aws\\Result describeFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetAsync(array $args = [])\n * @method \\Aws\\Result describeRobot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRobotAsync(array $args = [])\n * @method \\Aws\\Result describeRobotApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRobotApplicationAsync(array $args = [])\n * @method \\Aws\\Result describeSimulationApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSimulationApplicationAsync(array $args = [])\n * @method \\Aws\\Result describeSimulationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSimulationJobAsync(array $args = [])\n * @method \\Aws\\Result describeSimulationJobBatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSimulationJobBatchAsync(array $args = [])\n * @method \\Aws\\Result describeWorld(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorldAsync(array $args = [])\n * @method \\Aws\\Result describeWorldExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorldExportJobAsync(array $args = [])\n * @method \\Aws\\Result describeWorldGenerationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorldGenerationJobAsync(array $args = [])\n * @method \\Aws\\Result describeWorldTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorldTemplateAsync(array $args = [])\n * @method \\Aws\\Result getWorldTemplateBody(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorldTemplateBodyAsync(array $args = [])\n * @method \\Aws\\Result listDeploymentJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeploymentJobsAsync(array $args = [])\n * @method \\Aws\\Result listFleets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFleetsAsync(array $args = [])\n * @method \\Aws\\Result listRobotApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRobotApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listRobots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRobotsAsync(array $args = [])\n * @method \\Aws\\Result listSimulationApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSimulationApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listSimulationJobBatches(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSimulationJobBatchesAsync(array $args = [])\n * @method \\Aws\\Result listSimulationJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSimulationJobsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWorldExportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorldExportJobsAsync(array $args = [])\n * @method \\Aws\\Result listWorldGenerationJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorldGenerationJobsAsync(array $args = [])\n * @method \\Aws\\Result listWorldTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorldTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listWorlds(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorldsAsync(array $args = [])\n * @method \\Aws\\Result registerRobot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerRobotAsync(array $args = [])\n * @method \\Aws\\Result restartSimulationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restartSimulationJobAsync(array $args = [])\n * @method \\Aws\\Result startSimulationJobBatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSimulationJobBatchAsync(array $args = [])\n * @method \\Aws\\Result syncDeploymentJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise syncDeploymentJobAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateRobotApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRobotApplicationAsync(array $args = [])\n * @method \\Aws\\Result updateSimulationApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSimulationApplicationAsync(array $args = [])\n * @method \\Aws\\Result updateWorldTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorldTemplateAsync(array $args = [])\n */\nclass RoboMakerClient extends AwsClient {}\n", "num_lines": 124}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\RoboMaker\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS RoboMaker** service.\n */\nclass RoboMakerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\RolesAnywhere;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **IAM Roles Anywhere** service.\n * @method \\Aws\\Result createProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProfileAsync(array $args = [])\n * @method \\Aws\\Result createTrustAnchor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTrustAnchorAsync(array $args = [])\n * @method \\Aws\\Result deleteCrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCrlAsync(array $args = [])\n * @method \\Aws\\Result deleteProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteTrustAnchor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTrustAnchorAsync(array $args = [])\n * @method \\Aws\\Result disableCrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableCrlAsync(array $args = [])\n * @method \\Aws\\Result disableProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableProfileAsync(array $args = [])\n * @method \\Aws\\Result disableTrustAnchor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableTrustAnchorAsync(array $args = [])\n * @method \\Aws\\Result enableCrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableCrlAsync(array $args = [])\n * @method \\Aws\\Result enableProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableProfileAsync(array $args = [])\n * @method \\Aws\\Result enableTrustAnchor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableTrustAnchorAsync(array $args = [])\n * @method \\Aws\\Result getCrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCrlAsync(array $args = [])\n * @method \\Aws\\Result getProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProfileAsync(array $args = [])\n * @method \\Aws\\Result getSubject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSubjectAsync(array $args = [])\n * @method \\Aws\\Result getTrustAnchor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTrustAnchorAsync(array $args = [])\n * @method \\Aws\\Result importCrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importCrlAsync(array $args = [])\n * @method \\Aws\\Result listCrls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCrlsAsync(array $args = [])\n * @method \\Aws\\Result listProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProfilesAsync(array $args = [])\n * @method \\Aws\\Result listSubjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSubjectsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTrustAnchors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTrustAnchorsAsync(array $args = [])\n * @method \\Aws\\Result putNotificationSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putNotificationSettingsAsync(array $args = [])\n * @method \\Aws\\Result resetNotificationSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetNotificationSettingsAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateCrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCrlAsync(array $args = [])\n * @method \\Aws\\Result updateProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProfileAsync(array $args = [])\n * @method \\Aws\\Result updateTrustAnchor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTrustAnchorAsync(array $args = [])\n */\nclass RolesAnywhereClient extends AwsClient {}\n", "num_lines": 66}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\RolesAnywhere\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **IAM Roles Anywhere** service.\n */\nclass RolesAnywhereException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Route53;\n\nuse Aws\\AwsClient;\nuse Aws\\CommandInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * This client is used to interact with the **Amazon Route 53** service.\n *\n * @method \\Aws\\Result activateKeySigningKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise activateKeySigningKeyAsync(array $args = [])\n * @method \\Aws\\Result associateVPCWithHostedZone(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateVPCWithHostedZoneAsync(array $args = [])\n * @method \\Aws\\Result changeCidrCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise changeCidrCollectionAsync(array $args = [])\n * @method \\Aws\\Result changeResourceRecordSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise changeResourceRecordSetsAsync(array $args = [])\n * @method \\Aws\\Result changeTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise changeTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result createCidrCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCidrCollectionAsync(array $args = [])\n * @method \\Aws\\Result createHealthCheck(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHealthCheckAsync(array $args = [])\n * @method \\Aws\\Result createHostedZone(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHostedZoneAsync(array $args = [])\n * @method \\Aws\\Result createKeySigningKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createKeySigningKeyAsync(array $args = [])\n * @method \\Aws\\Result createQueryLoggingConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createQueryLoggingConfigAsync(array $args = [])\n * @method \\Aws\\Result createReusableDelegationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReusableDelegationSetAsync(array $args = [])\n * @method \\Aws\\Result createTrafficPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTrafficPolicyAsync(array $args = [])\n * @method \\Aws\\Result createTrafficPolicyInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTrafficPolicyInstanceAsync(array $args = [])\n * @method \\Aws\\Result createTrafficPolicyVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTrafficPolicyVersionAsync(array $args = [])\n * @method \\Aws\\Result createVPCAssociationAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVPCAssociationAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result deactivateKeySigningKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deactivateKeySigningKeyAsync(array $args = [])\n * @method \\Aws\\Result deleteCidrCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCidrCollectionAsync(array $args = [])\n * @method \\Aws\\Result deleteHealthCheck(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHealthCheckAsync(array $args = [])\n * @method \\Aws\\Result deleteHostedZone(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHostedZoneAsync(array $args = [])\n * @method \\Aws\\Result deleteKeySigningKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteKeySigningKeyAsync(array $args = [])\n * @method \\Aws\\Result deleteQueryLoggingConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteQueryLoggingConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteReusableDelegationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReusableDelegationSetAsync(array $args = [])\n * @method \\Aws\\Result deleteTrafficPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTrafficPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteTrafficPolicyInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTrafficPolicyInstanceAsync(array $args = [])\n * @method \\Aws\\Result deleteVPCAssociationAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVPCAssociationAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result disableHostedZoneDNSSEC(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableHostedZoneDNSSECAsync(array $args = [])\n * @method \\Aws\\Result disassociateVPCFromHostedZone(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateVPCFromHostedZoneAsync(array $args = [])\n * @method \\Aws\\Result enableHostedZoneDNSSEC(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableHostedZoneDNSSECAsync(array $args = [])\n * @method \\Aws\\Result getAccountLimit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountLimitAsync(array $args = [])\n * @method \\Aws\\Result getChange(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChangeAsync(array $args = [])\n * @method \\Aws\\Result getCheckerIpRanges(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCheckerIpRangesAsync(array $args = [])\n * @method \\Aws\\Result getDNSSEC(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDNSSECAsync(array $args = [])\n * @method \\Aws\\Result getGeoLocation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGeoLocationAsync(array $args = [])\n * @method \\Aws\\Result getHealthCheck(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getHealthCheckAsync(array $args = [])\n * @method \\Aws\\Result getHealthCheckCount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getHealthCheckCountAsync(array $args = [])\n * @method \\Aws\\Result getHealthCheckLastFailureReason(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getHealthCheckLastFailureReasonAsync(array $args = [])\n * @method \\Aws\\Result getHealthCheckStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getHealthCheckStatusAsync(array $args = [])\n * @method \\Aws\\Result getHostedZone(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getHostedZoneAsync(array $args = [])\n * @method \\Aws\\Result getHostedZoneCount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getHostedZoneCountAsync(array $args = [])\n * @method \\Aws\\Result getHostedZoneLimit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getHostedZoneLimitAsync(array $args = [])\n * @method \\Aws\\Result getQueryLoggingConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getQueryLoggingConfigAsync(array $args = [])\n * @method \\Aws\\Result getReusableDelegationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReusableDelegationSetAsync(array $args = [])\n * @method \\Aws\\Result getReusableDelegationSetLimit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReusableDelegationSetLimitAsync(array $args = [])\n * @method \\Aws\\Result getTrafficPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTrafficPolicyAsync(array $args = [])\n * @method \\Aws\\Result getTrafficPolicyInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTrafficPolicyInstanceAsync(array $args = [])\n * @method \\Aws\\Result getTrafficPolicyInstanceCount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTrafficPolicyInstanceCountAsync(array $args = [])\n * @method \\Aws\\Result listCidrBlocks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCidrBlocksAsync(array $args = [])\n * @method \\Aws\\Result listCidrCollections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCidrCollectionsAsync(array $args = [])\n * @method \\Aws\\Result listCidrLocations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCidrLocationsAsync(array $args = [])\n * @method \\Aws\\Result listGeoLocations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGeoLocationsAsync(array $args = [])\n * @method \\Aws\\Result listHealthChecks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHealthChecksAsync(array $args = [])\n * @method \\Aws\\Result listHostedZones(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHostedZonesAsync(array $args = [])\n * @method \\Aws\\Result listHostedZonesByName(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHostedZonesByNameAsync(array $args = [])\n * @method \\Aws\\Result listHostedZonesByVPC(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHostedZonesByVPCAsync(array $args = [])\n * @method \\Aws\\Result listQueryLoggingConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listQueryLoggingConfigsAsync(array $args = [])\n * @method \\Aws\\Result listResourceRecordSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceRecordSetsAsync(array $args = [])\n * @method \\Aws\\Result listReusableDelegationSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReusableDelegationSetsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourcesAsync(array $args = [])\n * @method \\Aws\\Result listTrafficPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTrafficPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listTrafficPolicyInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTrafficPolicyInstancesAsync(array $args = [])\n * @method \\Aws\\Result listTrafficPolicyInstancesByHostedZone(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTrafficPolicyInstancesByHostedZoneAsync(array $args = [])\n * @method \\Aws\\Result listTrafficPolicyInstancesByPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTrafficPolicyInstancesByPolicyAsync(array $args = [])\n * @method \\Aws\\Result listTrafficPolicyVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTrafficPolicyVersionsAsync(array $args = [])\n * @method \\Aws\\Result listVPCAssociationAuthorizations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVPCAssociationAuthorizationsAsync(array $args = [])\n * @method \\Aws\\Result testDNSAnswer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testDNSAnswerAsync(array $args = [])\n * @method \\Aws\\Result updateHealthCheck(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateHealthCheckAsync(array $args = [])\n * @method \\Aws\\Result updateHostedZoneComment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateHostedZoneCommentAsync(array $args = [])\n * @method \\Aws\\Result updateTrafficPolicyComment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTrafficPolicyCommentAsync(array $args = [])\n * @method \\Aws\\Result updateTrafficPolicyInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTrafficPolicyInstanceAsync(array $args = [])\n */\nclass Route53Client extends AwsClient\n{\n    public function __construct(array $args)\n    {\n        parent::__construct($args);\n        $this->getHandlerList()->appendInit($this->cleanIdFn(), 'route53.clean_id');\n    }\n\n    private function cleanIdFn()\n    {\n        return function (callable $handler) {\n            return function (CommandInterface $c, RequestInterface $r = null) use ($handler) {\n                foreach (['Id', 'HostedZoneId', 'DelegationSetId'] as $clean) {\n                    if ($c->hasParam($clean)) {\n                        $c[$clean] = $this->cleanId($c[$clean]);\n                    }\n                }\n                return $handler($c, $r);\n            };\n        };\n    }\n\n    private function cleanId($id)\n    {\n        static $toClean = ['/hostedzone/', '/change/', '/delegationset/'];\n\n        return str_replace($toClean, '', $id);\n    }\n}\n", "num_lines": 181}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Route53\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon Route 53 service.\n */\nclass Route53Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Route53Domains;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Route 53 Domains** service.\n *\n * @method \\Aws\\Result acceptDomainTransferFromAnotherAwsAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptDomainTransferFromAnotherAwsAccountAsync(array $args = [])\n * @method \\Aws\\Result associateDelegationSignerToDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateDelegationSignerToDomainAsync(array $args = [])\n * @method \\Aws\\Result cancelDomainTransferToAnotherAwsAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelDomainTransferToAnotherAwsAccountAsync(array $args = [])\n * @method \\Aws\\Result checkDomainAvailability(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise checkDomainAvailabilityAsync(array $args = [])\n * @method \\Aws\\Result checkDomainTransferability(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise checkDomainTransferabilityAsync(array $args = [])\n * @method \\Aws\\Result deleteDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainAsync(array $args = [])\n * @method \\Aws\\Result deleteTagsForDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTagsForDomainAsync(array $args = [])\n * @method \\Aws\\Result disableDomainAutoRenew(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableDomainAutoRenewAsync(array $args = [])\n * @method \\Aws\\Result disableDomainTransferLock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableDomainTransferLockAsync(array $args = [])\n * @method \\Aws\\Result disassociateDelegationSignerFromDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateDelegationSignerFromDomainAsync(array $args = [])\n * @method \\Aws\\Result enableDomainAutoRenew(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableDomainAutoRenewAsync(array $args = [])\n * @method \\Aws\\Result enableDomainTransferLock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableDomainTransferLockAsync(array $args = [])\n * @method \\Aws\\Result getContactReachabilityStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContactReachabilityStatusAsync(array $args = [])\n * @method \\Aws\\Result getDomainDetail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainDetailAsync(array $args = [])\n * @method \\Aws\\Result getDomainSuggestions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainSuggestionsAsync(array $args = [])\n * @method \\Aws\\Result getOperationDetail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOperationDetailAsync(array $args = [])\n * @method \\Aws\\Result listDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainsAsync(array $args = [])\n * @method \\Aws\\Result listOperations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOperationsAsync(array $args = [])\n * @method \\Aws\\Result listPrices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPricesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForDomainAsync(array $args = [])\n * @method \\Aws\\Result pushDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise pushDomainAsync(array $args = [])\n * @method \\Aws\\Result registerDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerDomainAsync(array $args = [])\n * @method \\Aws\\Result rejectDomainTransferFromAnotherAwsAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectDomainTransferFromAnotherAwsAccountAsync(array $args = [])\n * @method \\Aws\\Result renewDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise renewDomainAsync(array $args = [])\n * @method \\Aws\\Result resendContactReachabilityEmail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resendContactReachabilityEmailAsync(array $args = [])\n * @method \\Aws\\Result resendOperationAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resendOperationAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result retrieveDomainAuthCode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise retrieveDomainAuthCodeAsync(array $args = [])\n * @method \\Aws\\Result transferDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise transferDomainAsync(array $args = [])\n * @method \\Aws\\Result transferDomainToAnotherAwsAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise transferDomainToAnotherAwsAccountAsync(array $args = [])\n * @method \\Aws\\Result updateDomainContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDomainContactAsync(array $args = [])\n * @method \\Aws\\Result updateDomainContactPrivacy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDomainContactPrivacyAsync(array $args = [])\n * @method \\Aws\\Result updateDomainNameservers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDomainNameserversAsync(array $args = [])\n * @method \\Aws\\Result updateTagsForDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTagsForDomainAsync(array $args = [])\n * @method \\Aws\\Result viewBilling(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise viewBillingAsync(array $args = [])\n */\nclass Route53DomainsClient extends AwsClient {}\n", "num_lines": 79}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Route53Domains\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon Route 53 Domains service.\n */\nclass Route53DomainsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Route53RecoveryCluster;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Route53 Recovery Cluster** service.\n * @method \\Aws\\Result getRoutingControlState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRoutingControlStateAsync(array $args = [])\n * @method \\Aws\\Result listRoutingControls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRoutingControlsAsync(array $args = [])\n * @method \\Aws\\Result updateRoutingControlState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRoutingControlStateAsync(array $args = [])\n * @method \\Aws\\Result updateRoutingControlStates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRoutingControlStatesAsync(array $args = [])\n */\nclass Route53RecoveryClusterClient extends AwsClient {}\n", "num_lines": 18}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Route53RecoveryCluster\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Route53 Recovery Cluster** service.\n */\nclass Route53RecoveryClusterException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Route53RecoveryControlConfig;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Route53 Recovery Control Config** service.\n * @method \\Aws\\Result createCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClusterAsync(array $args = [])\n * @method \\Aws\\Result createControlPanel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createControlPanelAsync(array $args = [])\n * @method \\Aws\\Result createRoutingControl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRoutingControlAsync(array $args = [])\n * @method \\Aws\\Result createSafetyRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSafetyRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClusterAsync(array $args = [])\n * @method \\Aws\\Result deleteControlPanel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteControlPanelAsync(array $args = [])\n * @method \\Aws\\Result deleteRoutingControl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRoutingControlAsync(array $args = [])\n * @method \\Aws\\Result deleteSafetyRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSafetyRuleAsync(array $args = [])\n * @method \\Aws\\Result describeCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClusterAsync(array $args = [])\n * @method \\Aws\\Result describeControlPanel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeControlPanelAsync(array $args = [])\n * @method \\Aws\\Result describeRoutingControl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRoutingControlAsync(array $args = [])\n * @method \\Aws\\Result describeSafetyRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSafetyRuleAsync(array $args = [])\n * @method \\Aws\\Result listAssociatedRoute53HealthChecks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssociatedRoute53HealthChecksAsync(array $args = [])\n * @method \\Aws\\Result listClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listClustersAsync(array $args = [])\n * @method \\Aws\\Result listControlPanels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listControlPanelsAsync(array $args = [])\n * @method \\Aws\\Result listRoutingControls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRoutingControlsAsync(array $args = [])\n * @method \\Aws\\Result listSafetyRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSafetyRulesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateControlPanel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateControlPanelAsync(array $args = [])\n * @method \\Aws\\Result updateRoutingControl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRoutingControlAsync(array $args = [])\n * @method \\Aws\\Result updateSafetyRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSafetyRuleAsync(array $args = [])\n */\nclass Route53RecoveryControlConfigClient extends AwsClient {}\n", "num_lines": 56}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Route53RecoveryControlConfig\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Route53 Recovery Control Config** service.\n */\nclass Route53RecoveryControlConfigException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Route53RecoveryReadiness;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Route53 Recovery Readiness** service.\n * @method \\Aws\\Result createCell(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCellAsync(array $args = [])\n * @method \\Aws\\Result createCrossAccountAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCrossAccountAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result createReadinessCheck(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReadinessCheckAsync(array $args = [])\n * @method \\Aws\\Result createRecoveryGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRecoveryGroupAsync(array $args = [])\n * @method \\Aws\\Result createResourceSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResourceSetAsync(array $args = [])\n * @method \\Aws\\Result deleteCell(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCellAsync(array $args = [])\n * @method \\Aws\\Result deleteCrossAccountAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCrossAccountAuthorizationAsync(array $args = [])\n * @method \\Aws\\Result deleteReadinessCheck(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReadinessCheckAsync(array $args = [])\n * @method \\Aws\\Result deleteRecoveryGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRecoveryGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteResourceSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourceSetAsync(array $args = [])\n * @method \\Aws\\Result getArchitectureRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getArchitectureRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result getCell(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCellAsync(array $args = [])\n * @method \\Aws\\Result getCellReadinessSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCellReadinessSummaryAsync(array $args = [])\n * @method \\Aws\\Result getReadinessCheck(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReadinessCheckAsync(array $args = [])\n * @method \\Aws\\Result getReadinessCheckResourceStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReadinessCheckResourceStatusAsync(array $args = [])\n * @method \\Aws\\Result getReadinessCheckStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReadinessCheckStatusAsync(array $args = [])\n * @method \\Aws\\Result getRecoveryGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRecoveryGroupAsync(array $args = [])\n * @method \\Aws\\Result getRecoveryGroupReadinessSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRecoveryGroupReadinessSummaryAsync(array $args = [])\n * @method \\Aws\\Result getResourceSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourceSetAsync(array $args = [])\n * @method \\Aws\\Result listCells(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCellsAsync(array $args = [])\n * @method \\Aws\\Result listCrossAccountAuthorizations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCrossAccountAuthorizationsAsync(array $args = [])\n * @method \\Aws\\Result listReadinessChecks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReadinessChecksAsync(array $args = [])\n * @method \\Aws\\Result listRecoveryGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecoveryGroupsAsync(array $args = [])\n * @method \\Aws\\Result listResourceSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceSetsAsync(array $args = [])\n * @method \\Aws\\Result listRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRulesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourcesAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateCell(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCellAsync(array $args = [])\n * @method \\Aws\\Result updateReadinessCheck(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateReadinessCheckAsync(array $args = [])\n * @method \\Aws\\Result updateRecoveryGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRecoveryGroupAsync(array $args = [])\n * @method \\Aws\\Result updateResourceSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResourceSetAsync(array $args = [])\n */\nclass Route53RecoveryReadinessClient extends AwsClient {}\n", "num_lines": 74}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Route53RecoveryReadiness\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Route53 Recovery Readiness** service.\n */\nclass Route53RecoveryReadinessException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Route53Resolver;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Route 53 Resolver** service.\n * @method \\Aws\\Result associateFirewallRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateFirewallRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result associateResolverEndpointIpAddress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateResolverEndpointIpAddressAsync(array $args = [])\n * @method \\Aws\\Result associateResolverQueryLogConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateResolverQueryLogConfigAsync(array $args = [])\n * @method \\Aws\\Result associateResolverRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateResolverRuleAsync(array $args = [])\n * @method \\Aws\\Result createFirewallDomainList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFirewallDomainListAsync(array $args = [])\n * @method \\Aws\\Result createFirewallRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFirewallRuleAsync(array $args = [])\n * @method \\Aws\\Result createFirewallRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFirewallRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result createResolverEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResolverEndpointAsync(array $args = [])\n * @method \\Aws\\Result createResolverQueryLogConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResolverQueryLogConfigAsync(array $args = [])\n * @method \\Aws\\Result createResolverRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResolverRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteFirewallDomainList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFirewallDomainListAsync(array $args = [])\n * @method \\Aws\\Result deleteFirewallRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFirewallRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteFirewallRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFirewallRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteResolverEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResolverEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteResolverQueryLogConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResolverQueryLogConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteResolverRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResolverRuleAsync(array $args = [])\n * @method \\Aws\\Result disassociateFirewallRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateFirewallRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result disassociateResolverEndpointIpAddress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateResolverEndpointIpAddressAsync(array $args = [])\n * @method \\Aws\\Result disassociateResolverQueryLogConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateResolverQueryLogConfigAsync(array $args = [])\n * @method \\Aws\\Result disassociateResolverRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateResolverRuleAsync(array $args = [])\n * @method \\Aws\\Result getFirewallConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFirewallConfigAsync(array $args = [])\n * @method \\Aws\\Result getFirewallDomainList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFirewallDomainListAsync(array $args = [])\n * @method \\Aws\\Result getFirewallRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFirewallRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result getFirewallRuleGroupAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFirewallRuleGroupAssociationAsync(array $args = [])\n * @method \\Aws\\Result getFirewallRuleGroupPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFirewallRuleGroupPolicyAsync(array $args = [])\n * @method \\Aws\\Result getResolverConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResolverConfigAsync(array $args = [])\n * @method \\Aws\\Result getResolverDnssecConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResolverDnssecConfigAsync(array $args = [])\n * @method \\Aws\\Result getResolverEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResolverEndpointAsync(array $args = [])\n * @method \\Aws\\Result getResolverQueryLogConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResolverQueryLogConfigAsync(array $args = [])\n * @method \\Aws\\Result getResolverQueryLogConfigAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResolverQueryLogConfigAssociationAsync(array $args = [])\n * @method \\Aws\\Result getResolverQueryLogConfigPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResolverQueryLogConfigPolicyAsync(array $args = [])\n * @method \\Aws\\Result getResolverRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResolverRuleAsync(array $args = [])\n * @method \\Aws\\Result getResolverRuleAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResolverRuleAssociationAsync(array $args = [])\n * @method \\Aws\\Result getResolverRulePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResolverRulePolicyAsync(array $args = [])\n * @method \\Aws\\Result importFirewallDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importFirewallDomainsAsync(array $args = [])\n * @method \\Aws\\Result listFirewallConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFirewallConfigsAsync(array $args = [])\n * @method \\Aws\\Result listFirewallDomainLists(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFirewallDomainListsAsync(array $args = [])\n * @method \\Aws\\Result listFirewallDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFirewallDomainsAsync(array $args = [])\n * @method \\Aws\\Result listFirewallRuleGroupAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFirewallRuleGroupAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listFirewallRuleGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFirewallRuleGroupsAsync(array $args = [])\n * @method \\Aws\\Result listFirewallRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFirewallRulesAsync(array $args = [])\n * @method \\Aws\\Result listResolverConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResolverConfigsAsync(array $args = [])\n * @method \\Aws\\Result listResolverDnssecConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResolverDnssecConfigsAsync(array $args = [])\n * @method \\Aws\\Result listResolverEndpointIpAddresses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResolverEndpointIpAddressesAsync(array $args = [])\n * @method \\Aws\\Result listResolverEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResolverEndpointsAsync(array $args = [])\n * @method \\Aws\\Result listResolverQueryLogConfigAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResolverQueryLogConfigAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listResolverQueryLogConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResolverQueryLogConfigsAsync(array $args = [])\n * @method \\Aws\\Result listResolverRuleAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResolverRuleAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listResolverRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResolverRulesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putFirewallRuleGroupPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putFirewallRuleGroupPolicyAsync(array $args = [])\n * @method \\Aws\\Result putResolverQueryLogConfigPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResolverQueryLogConfigPolicyAsync(array $args = [])\n * @method \\Aws\\Result putResolverRulePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResolverRulePolicyAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateFirewallConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFirewallConfigAsync(array $args = [])\n * @method \\Aws\\Result updateFirewallDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFirewallDomainsAsync(array $args = [])\n * @method \\Aws\\Result updateFirewallRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFirewallRuleAsync(array $args = [])\n * @method \\Aws\\Result updateFirewallRuleGroupAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFirewallRuleGroupAssociationAsync(array $args = [])\n * @method \\Aws\\Result updateResolverConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResolverConfigAsync(array $args = [])\n * @method \\Aws\\Result updateResolverDnssecConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResolverDnssecConfigAsync(array $args = [])\n * @method \\Aws\\Result updateResolverEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResolverEndpointAsync(array $args = [])\n * @method \\Aws\\Result updateResolverRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResolverRuleAsync(array $args = [])\n */\nclass Route53ResolverClient extends AwsClient {}\n", "num_lines": 136}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Route53Resolver\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Route 53 Resolver** service.\n */\nclass Route53ResolverException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\Api\\Parser\\AbstractParser;\nuse Aws\\Api\\Parser\\Exception\\ParserException;\nuse Aws\\Api\\StructureShape;\nuse Aws\\CommandInterface;\nuse Aws\\Exception\\AwsException;\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Psr\\Http\\Message\\StreamInterface;\n\n/**\n * Converts errors returned with a status code of 200 to a retryable error type.\n *\n * @internal\n */\nclass AmbiguousSuccessParser extends AbstractParser\n{\n    private static $ambiguousSuccesses = [\n        'UploadPart' => true,\n        'UploadPartCopy' => true,\n        'CopyObject' => true,\n        'CompleteMultipartUpload' => true,\n    ];\n\n    /** @var callable */\n    private $errorParser;\n    /** @var string */\n    private $exceptionClass;\n\n    public function __construct(\n        callable $parser,\n        callable $errorParser,\n        $exceptionClass = AwsException::class\n    ) {\n        $this->parser = $parser;\n        $this->errorParser = $errorParser;\n        $this->exceptionClass = $exceptionClass;\n    }\n\n    public function __invoke(\n        CommandInterface $command,\n        ResponseInterface $response\n    ) {\n        if (200 === $response->getStatusCode()\n            && isset(self::$ambiguousSuccesses[$command->getName()])\n        ) {\n            $errorParser = $this->errorParser;\n            try {\n                $parsed = $errorParser($response);\n            } catch (ParserException $e) {\n                $parsed = [\n                    'code' => 'ConnectionError',\n                    'message' => \"An error connecting to the service occurred\"\n                        . \" while performing the \" . $command->getName()\n                        . \" operation.\"\n                ];\n            }\n            if (isset($parsed['code']) && isset($parsed['message'])) {\n                throw new $this->exceptionClass(\n                    $parsed['message'],\n                    $command,\n                    ['connection_error' => true]\n                );\n            }\n        }\n\n        $fn = $this->parser;\n        return $fn($command, $response);\n    }\n\n    public function parseMemberFromStream(\n        StreamInterface $stream,\n        StructureShape $member,\n        $response\n    ) {\n        return $this->parser->parseMemberFromStream($stream, $member, $response);\n    }\n}\n", "num_lines": 80}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\Api\\Service;\nuse Aws\\CommandInterface;\nuse GuzzleHttp\\Psr7;\nuse InvalidArgumentException;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Apply required or optional checksums to requests before sending.\n *\n * IMPORTANT: This middleware must be added after the \"build\" step.\n *\n * @internal\n */\nclass ApplyChecksumMiddleware\n{\n    use CalculatesChecksumTrait;\n    private static $sha256AndMd5 = [\n        'PutObject',\n        'UploadPart',\n    ];\n\n    /** @var Service */\n    private $api;\n\n    private $nextHandler;\n\n    /**\n     * Create a middleware wrapper function.\n     *\n     * @param Service $api\n     * @return callable\n     */\n    public static function wrap(Service $api)\n    {\n        return function (callable $handler) use ($api) {\n            return new self($handler, $api);\n        };\n    }\n\n    public function __construct(callable $nextHandler, Service $api)\n    {\n        $this->api = $api;\n        $this->nextHandler = $nextHandler;\n    }\n\n    public function __invoke(\n        CommandInterface $command,\n        RequestInterface $request\n    ) {\n        $next = $this->nextHandler;\n        $name = $command->getName();\n        $body = $request->getBody();\n\n        //Checks if AddContentMD5 has been specified for PutObject or UploadPart\n        $addContentMD5 = isset($command['AddContentMD5'])\n            ?  $command['AddContentMD5']\n            : null;\n\n        $op = $this->api->getOperation($command->getName());\n\n        $checksumInfo = isset($op['httpChecksum'])\n            ? $op['httpChecksum']\n            : [];\n        $checksumMemberName = array_key_exists('requestAlgorithmMember', $checksumInfo)\n            ? $checksumInfo['requestAlgorithmMember']\n            : \"\";\n        $requestedAlgorithm = isset($command[$checksumMemberName])\n            ? $command[$checksumMemberName]\n            : null;\n        if (!empty($checksumMemberName) && !empty($requestedAlgorithm)) {\n            $requestedAlgorithm = strtolower($requestedAlgorithm);\n            $checksumMember = $op->getInput()->getMember($checksumMemberName);\n            $supportedAlgorithms = isset($checksumMember['enum'])\n                ? array_map('strtolower', $checksumMember['enum'])\n                : null;\n            if (is_array($supportedAlgorithms)\n                && in_array($requestedAlgorithm, $supportedAlgorithms)\n            ) {\n                $headerName = \"x-amz-checksum-{$requestedAlgorithm}\";\n                $encoded = $this->getEncodedValue($requestedAlgorithm, $body);\n                if (!$request->hasHeader($headerName)) {\n                    $request = $request->withHeader($headerName, $encoded);\n                }\n            } else {\n                throw new InvalidArgumentException(\n                    \"Unsupported algorithm supplied for input variable {$checksumMemberName}.\"\n                    . \"  Supported checksums for this operation include: \"\n                    . implode(\", \", $supportedAlgorithms) . \".\"\n                );\n            }\n            return $next($command, $request);\n        }\n\n        if (!empty($checksumInfo)) {\n        //if the checksum member is absent, check if it's required\n        $checksumRequired = isset($checksumInfo['requestChecksumRequired'])\n            ? $checksumInfo['requestChecksumRequired']\n            : null;\n            if ((!empty($checksumRequired) && !$request->hasHeader('Content-MD5'))\n                || (in_array($name, self::$sha256AndMd5) && $addContentMD5)\n            ) {\n                // Set the content MD5 header for operations that require it.\n                $request = $request->withHeader(\n                    'Content-MD5',\n                    base64_encode(Psr7\\Utils::hash($body, 'md5', true))\n                );\n                return $next($command, $request);\n            }\n        }\n\n        if (in_array($name, self::$sha256AndMd5) && $command['ContentSHA256']) {\n            // Set the content hash header if provided in the parameters.\n            $request = $request->withHeader(\n                'X-Amz-Content-Sha256',\n                $command['ContentSHA256']\n            );\n        }\n\n        return $next($command, $request);\n    }\n}\n", "num_lines": 125}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\AwsClientInterface;\nuse Aws\\S3\\Exception\\DeleteMultipleObjectsException;\nuse GuzzleHttp\\Promise;\nuse GuzzleHttp\\Promise\\PromisorInterface;\nuse GuzzleHttp\\Promise\\PromiseInterface;\n\n/**\n * Efficiently deletes many objects from a single Amazon S3 bucket using an\n * iterator that yields keys. Deletes are made using the DeleteObjects API\n * operation.\n *\n *     $s3 = new Aws\\S3\\Client([\n *         'region' => 'us-west-2',\n *         'version' => 'latest'\n *     ]);\n *\n *     $listObjectsParams = ['Bucket' => 'foo', 'Prefix' => 'starts/with/'];\n *     $delete = Aws\\S3\\BatchDelete::fromListObjects($s3, $listObjectsParams);\n *     // Asynchronously delete\n *     $promise = $delete->promise();\n *     // Force synchronous completion\n *     $delete->delete();\n *\n * When using one of the batch delete creational static methods, you can supply\n * an associative array of options:\n *\n * - before: Function invoked before executing a command. The function is\n *   passed the command that is about to be executed. This can be useful\n *   for logging, adding custom request headers, etc.\n * - batch_size: The size of each delete batch. Defaults to 1000.\n *\n * @link http://docs.aws.amazon.com/AmazonS3/latest/API/multiobjectdeleteapi.html\n */\nclass BatchDelete implements PromisorInterface\n{\n    private $bucket;\n    /** @var AwsClientInterface */\n    private $client;\n    /** @var callable */\n    private $before;\n    /** @var PromiseInterface */\n    private $cachedPromise;\n    /** @var callable */\n    private $promiseCreator;\n    private $batchSize = 1000;\n    private $queue = [];\n\n    /**\n     * Creates a BatchDelete object from all of the paginated results of a\n     * ListObjects operation. Each result that is returned by the ListObjects\n     * operation will be deleted.\n     *\n     * @param AwsClientInterface $client            AWS Client to use.\n     * @param array              $listObjectsParams ListObjects API parameters\n     * @param array              $options           BatchDelete options.\n     *\n     * @return BatchDelete\n     */\n    public static function fromListObjects(\n        AwsClientInterface $client,\n        array $listObjectsParams,\n        array $options = []\n    ) {\n        $iter = $client->getPaginator('ListObjects', $listObjectsParams);\n        $bucket = $listObjectsParams['Bucket'];\n        $fn = function (BatchDelete $that) use ($iter) {\n            return $iter->each(function ($result) use ($that) {\n                $promises = [];\n                if (is_array($result['Contents'])) {\n                    foreach ($result['Contents'] as $object) {\n                        if ($promise = $that->enqueue($object)) {\n                            $promises[] = $promise;\n                        }\n                    }\n                }\n                return $promises ? Promise\\Utils::all($promises) : null;\n            });\n        };\n\n        return new self($client, $bucket, $fn, $options);\n    }\n\n    /**\n     * Creates a BatchDelete object from an iterator that yields results.\n     *\n     * @param AwsClientInterface $client  AWS Client to use to execute commands\n     * @param string             $bucket  Bucket where the objects are stored\n     * @param \\Iterator          $iter    Iterator that yields assoc arrays\n     * @param array              $options BatchDelete options\n     *\n     * @return BatchDelete\n     */\n    public static function fromIterator(\n        AwsClientInterface $client,\n        $bucket,\n        \\Iterator $iter,\n        array $options = []\n    ) {\n        $fn = function (BatchDelete $that) use ($iter) {\n            return Promise\\Coroutine::of(function () use ($that, $iter) {\n                foreach ($iter as $obj) {\n                    if ($promise = $that->enqueue($obj)) {\n                        yield $promise;\n                    }\n                }\n            });\n        };\n\n        return new self($client, $bucket, $fn, $options);\n    }\n\n    /**\n     * @return PromiseInterface\n     */\n    public function promise()\n    {\n        if (!$this->cachedPromise) {\n            $this->cachedPromise = $this->createPromise();\n        }\n\n        return $this->cachedPromise;\n    }\n\n    /**\n     * Synchronously deletes all of the objects.\n     *\n     * @throws DeleteMultipleObjectsException on error.\n     */\n    public function delete()\n    {\n        $this->promise()->wait();\n    }\n\n    /**\n     * @param AwsClientInterface $client    Client used to transfer the requests\n     * @param string             $bucket    Bucket to delete from.\n     * @param callable           $promiseFn Creates a promise.\n     * @param array              $options   Hash of options used with the batch\n     *\n     * @throws \\InvalidArgumentException if the provided batch_size is <= 0\n     */\n    private function __construct(\n        AwsClientInterface $client,\n        $bucket,\n        callable $promiseFn,\n        array $options = []\n    ) {\n        $this->client = $client;\n        $this->bucket = $bucket;\n        $this->promiseCreator = $promiseFn;\n\n        if (isset($options['before'])) {\n            if (!is_callable($options['before'])) {\n                throw new \\InvalidArgumentException('before must be callable');\n            }\n            $this->before = $options['before'];\n        }\n\n        if (isset($options['batch_size'])) {\n            if ($options['batch_size'] <= 0) {\n                throw new \\InvalidArgumentException('batch_size is not > 0');\n            }\n            $this->batchSize = min($options['batch_size'], 1000);\n        }\n    }\n\n    private function enqueue(array $obj)\n    {\n        $this->queue[] = $obj;\n        return count($this->queue) >= $this->batchSize\n            ? $this->flushQueue()\n            : null;\n    }\n\n    private function flushQueue()\n    {\n        static $validKeys = ['Key' => true, 'VersionId' => true];\n\n        if (count($this->queue) === 0) {\n            return null;\n        }\n\n        $batch = [];\n        while ($obj = array_shift($this->queue)) {\n            $batch[] = array_intersect_key($obj, $validKeys);\n        }\n\n        $command = $this->client->getCommand('DeleteObjects', [\n            'Bucket' => $this->bucket,\n            'Delete' => ['Objects' => $batch]\n        ]);\n\n        if ($this->before) {\n            call_user_func($this->before, $command);\n        }\n\n        return $this->client->executeAsync($command)\n            ->then(function ($result) {\n                if (!empty($result['Errors'])) {\n                    throw new DeleteMultipleObjectsException(\n                        $result['Deleted'] ?: [],\n                        $result['Errors']\n                    );\n                }\n                return $result;\n            });\n    }\n\n    /**\n     * Returns a promise that will clean up any references when it completes.\n     *\n     * @return PromiseInterface\n     */\n    private function createPromise()\n    {\n        // Create the promise\n        $promise = call_user_func($this->promiseCreator, $this);\n        $this->promiseCreator = null;\n\n        // Cleans up the promise state and references.\n        $cleanup = function () {\n            $this->before = $this->client = $this->queue = null;\n        };\n\n        // When done, ensure cleanup and that any remaining are processed.\n        return $promise->then(\n            function () use ($cleanup)  {\n                return Promise\\Create::promiseFor($this->flushQueue())\n                    ->then($cleanup);\n            },\n            function ($reason) use ($cleanup)  {\n                $cleanup();\n                return Promise\\Create::rejectionFor($reason);\n            }\n        );\n    }\n}\n", "num_lines": 241}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\Api\\Service;\nuse Aws\\Arn\\AccessPointArnInterface;\nuse Aws\\Arn\\ArnParser;\nuse Aws\\Arn\\ObjectLambdaAccessPointArn;\nuse Aws\\Arn\\Exception\\InvalidArnException;\nuse Aws\\Arn\\AccessPointArn as BaseAccessPointArn;\nuse Aws\\Arn\\S3\\OutpostsAccessPointArn;\nuse Aws\\Arn\\S3\\MultiRegionAccessPointArn;\nuse Aws\\Arn\\S3\\OutpostsArnInterface;\nuse Aws\\CommandInterface;\nuse Aws\\Endpoint\\PartitionEndpointProvider;\nuse Aws\\Exception\\InvalidRegionException;\nuse Aws\\Exception\\UnresolvedEndpointException;\nuse Aws\\S3\\Exception\\S3Exception;\nuse InvalidArgumentException;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Checks for access point ARN in members targeting BucketName, modifying\n * endpoint as appropriate\n *\n * @internal\n */\nclass BucketEndpointArnMiddleware\n{\n    use EndpointRegionHelperTrait;\n\n    /** @var callable */\n    private $nextHandler;\n\n    /** @var array */\n    private $nonArnableCommands = ['CreateBucket'];\n\n    /** @var boolean */\n    private $isUseEndpointV2;\n\n    /**\n     * Create a middleware wrapper function.\n     *\n     * @param Service $service\n     * @param $region\n     * @param array $config\n     * @return callable\n     */\n    public static function wrap(\n        Service $service,\n        $region,\n        array $config,\n        $isUseEndpointV2\n    ) {\n        return function (callable $handler) use ($service, $region, $config, $isUseEndpointV2) {\n            return new self($handler, $service, $region, $config, $isUseEndpointV2);\n        };\n    }\n\n    public function __construct(\n        callable $nextHandler,\n        Service $service,\n        $region,\n        array $config = [],\n        $isUseEndpointV2 = false\n    ) {\n        $this->partitionProvider = PartitionEndpointProvider::defaultProvider();\n        $this->region = $region;\n        $this->service = $service;\n        $this->config = $config;\n        $this->nextHandler = $nextHandler;\n        $this->isUseEndpointV2 = $isUseEndpointV2;\n    }\n\n    public function __invoke(CommandInterface $cmd, RequestInterface $req)\n    {\n        $nextHandler = $this->nextHandler;\n\n        $op = $this->service->getOperation($cmd->getName())->toArray();\n        if (!empty($op['input']['shape'])) {\n            $service = $this->service->toArray();\n            if (!empty($input = $service['shapes'][$op['input']['shape']])) {\n                foreach ($input['members'] as $key => $member) {\n                    if ($member['shape'] === 'BucketName') {\n                        $arnableKey = $key;\n                        break;\n                    }\n                }\n\n                if (!empty($arnableKey) && ArnParser::isArn($cmd[$arnableKey])) {\n\n                    try {\n                        // Throw for commands that do not support ARN inputs\n                        if (in_array($cmd->getName(), $this->nonArnableCommands)) {\n                            throw new S3Exception(\n                                'ARN values cannot be used in the bucket field for'\n                                . ' the ' . $cmd->getName() . ' operation.',\n                                $cmd\n                            );\n                        }\n\n                        if (!$this->isUseEndpointV2) {\n                            $arn = ArnParser::parse($cmd[$arnableKey]);\n                            $partition = $this->validateArn($arn);\n                            $host = $this->generateAccessPointHost($arn, $req);\n                        }\n                        // Remove encoded bucket string from path\n                        $path = $req->getUri()->getPath();\n                        $encoded = rawurlencode($cmd[$arnableKey]);\n                        $len = strlen($encoded) + 1;\n                        if (trim(substr($path, 0, $len), '/') === \"{$encoded}\") {\n                            $path = substr($path, $len);\n                            if (substr($path, 0, 1) !== \"/\") {\n                                $path = '/' . $path;\n                            }\n                        }\n                        if (empty($path)) {\n                            $path = '';\n                        }\n\n                        // Set modified request\n                        if ($this->isUseEndpointV2) {\n                            $req = $req->withUri(\n                                $req->getUri()->withPath($path)\n\n                            );\n                            goto next;\n                        }\n\n                        $req = $req->withUri(\n                            $req->getUri()->withPath($path)->withHost($host)\n                        );\n\n                        // Update signing region based on ARN data if configured to do so\n                        if ($this->config['use_arn_region']->isUseArnRegion()\n                            && !$this->config['use_fips_endpoint']->isUseFipsEndpoint()\n                        ) {\n                            $region = $arn->getRegion();\n                        } else {\n                            $region = $this->region;\n                        }\n                        $endpointData = $partition([\n                            'region' => $region,\n                            'service' => $arn->getService()\n                        ]);\n                        $cmd['@context']['signing_region'] = $endpointData['signingRegion'];\n\n                        // Update signing service for Outposts and Lambda ARNs\n                        if ($arn instanceof OutpostsArnInterface\n                            || $arn instanceof ObjectLambdaAccessPointArn\n                        ) {\n                            $cmd['@context']['signing_service'] = $arn->getService();\n                        }\n                    } catch (InvalidArnException $e) {\n                        // Add context to ARN exception\n                        throw new S3Exception(\n                            'Bucket parameter parsed as ARN and failed with: '\n                            . $e->getMessage(),\n                            $cmd,\n                            [],\n                            $e\n                        );\n                    }\n                }\n            }\n        }\n        next:\n            return $nextHandler($cmd, $req);\n    }\n\n\n    private function generateAccessPointHost(\n        BaseAccessPointArn $arn,\n        RequestInterface $req\n    ) {\n        if ($arn instanceof OutpostsAccessPointArn) {\n            $accesspointName = $arn->getAccesspointName();\n        } else {\n            $accesspointName = $arn->getResourceId();\n        }\n\n        if ($arn instanceof MultiRegionAccessPointArn) {\n            $partition = $this->partitionProvider->getPartitionByName(\n                $arn->getPartition(),\n                's3'\n            );\n            $dnsSuffix = $partition->getDnsSuffix();\n            return \"{$accesspointName}.accesspoint.s3-global.{$dnsSuffix}\";\n        }\n\n        $host = \"{$accesspointName}-\" . $arn->getAccountId();\n\n        $useFips = $this->config['use_fips_endpoint']->isUseFipsEndpoint();\n        $fipsString = $useFips ? \"-fips\" : \"\";\n\n        if ($arn instanceof OutpostsAccessPointArn) {\n            $host .= '.' . $arn->getOutpostId() . '.s3-outposts';\n        } else if ($arn instanceof ObjectLambdaAccessPointArn) {\n            if (!empty($this->config['endpoint'])) {\n                return $host . '.' . $this->config['endpoint'];\n            } else {\n                $host .= \".s3-object-lambda{$fipsString}\";\n            }\n        } else {\n            $host .= \".s3-accesspoint{$fipsString}\";\n            if (!empty($this->config['dual_stack'])) {\n                $host .= '.dualstack';\n            }\n        }\n\n        if (!empty($this->config['use_arn_region']->isUseArnRegion())) {\n            $region = $arn->getRegion();\n        } else {\n            $region = $this->region;\n        }\n        $region = \\Aws\\strip_fips_pseudo_regions($region);\n        $host .= '.' . $region . '.' . $this->getPartitionSuffix($arn, $this->partitionProvider);\n        return $host;\n    }\n\n    /**\n     * Validates an ARN, returning a partition object corresponding to the ARN\n     * if successful\n     *\n     * @param $arn\n     * @return \\Aws\\Endpoint\\Partition\n     */\n    private function validateArn($arn)\n    {\n        if ($arn instanceof AccessPointArnInterface) {\n\n            // Dualstack is not supported with Outposts access points\n            if ($arn instanceof OutpostsAccessPointArn\n                && !empty($this->config['dual_stack'])\n            ) {\n                throw new UnresolvedEndpointException(\n                    'Dualstack is currently not supported with S3 Outposts access'\n                    . ' points. Please disable dualstack or do not supply an'\n                    . ' access point ARN.');\n            }\n            if ($arn instanceof MultiRegionAccessPointArn) {\n                if (!empty($this->config['disable_multiregion_access_points'])) {\n                    throw new UnresolvedEndpointException(\n                        'Multi-Region Access Point ARNs are disabled, but one was provided.  Please'\n                        . ' enable them or provide a different ARN.'\n                    );\n                }\n                if (!empty($this->config['dual_stack'])) {\n                    throw new UnresolvedEndpointException(\n                        'Multi-Region Access Point ARNs do not currently support dual stack. Please'\n                        . ' disable dual stack or provide a different ARN.'\n                    );\n                }\n            }\n            // Accelerate is not supported with access points\n            if (!empty($this->config['accelerate'])) {\n                throw new UnresolvedEndpointException(\n                    'Accelerate is currently not supported with access points.'\n                    . ' Please disable accelerate or do not supply an access'\n                    . ' point ARN.');\n            }\n\n            // Path-style is not supported with access points\n            if (!empty($this->config['path_style'])) {\n                throw new UnresolvedEndpointException(\n                    'Path-style addressing is currently not supported with'\n                    . ' access points. Please disable path-style or do not'\n                    . ' supply an access point ARN.');\n            }\n\n            // Custom endpoint is not supported with access points\n            if (!is_null($this->config['endpoint'])\n                && !$arn instanceof  ObjectLambdaAccessPointArn\n            ) {\n                throw new UnresolvedEndpointException(\n                    'A custom endpoint has been supplied along with an access'\n                    . ' point ARN, and these are not compatible with each other.'\n                    . ' Please only use one or the other.');\n            }\n\n            // Dualstack is not supported with object lambda access points\n            if ($arn instanceof ObjectLambdaAccessPointArn\n                && !empty($this->config['dual_stack'])\n            ) {\n                throw new UnresolvedEndpointException(\n                    'Dualstack is currently not supported with Object Lambda access'\n                    . ' points. Please disable dualstack or do not supply an'\n                    . ' access point ARN.');\n            }\n            // Global endpoints do not support cross-region requests\n            if ($this->isGlobal($this->region)\n                && $this->config['use_arn_region']->isUseArnRegion() == false\n                && $arn->getRegion() != $this->region\n                && !$arn instanceof MultiRegionAccessPointArn\n            ) {\n                throw new UnresolvedEndpointException(\n                    'Global endpoints do not support cross region requests.'\n                    . ' Please enable use_arn_region or do not supply a global region'\n                    . ' with a different region in the ARN.');\n            }\n\n            // Get partitions for ARN and client region\n            $arnPart = $this->partitionProvider->getPartition(\n                $arn->getRegion(),\n                's3'\n            );\n            $clientPart = $this->partitionProvider->getPartition(\n                $this->region,\n                's3'\n            );\n\n            // If client partition not found, try removing pseudo-region qualifiers\n            if (!($clientPart->isRegionMatch($this->region, 's3'))) {\n                $clientPart = $this->partitionProvider->getPartition(\n                    \\Aws\\strip_fips_pseudo_regions($this->region),\n                    's3'\n                );\n            }\n            if (!$arn instanceof MultiRegionAccessPointArn) {\n                // Verify that the partition matches for supplied partition and region\n                if ($arn->getPartition() !== $clientPart->getName()) {\n                    throw new InvalidRegionException('The supplied ARN partition'\n                        . \" does not match the client's partition.\");\n                }\n                if ($clientPart->getName() !== $arnPart->getName()) {\n                    throw new InvalidRegionException('The corresponding partition'\n                        . ' for the supplied ARN region does not match the'\n                        . \" client's partition.\");\n                }\n\n                // Ensure ARN region matches client region unless\n                // configured for using ARN region over client region\n                $this->validateMatchingRegion($arn);\n\n                // Ensure it is not resolved to fips pseudo-region for S3 Outposts\n                $this->validateFipsConfigurations($arn);\n            }\n\n            return $arnPart;\n        }\n\n        throw new InvalidArnException('Provided ARN was not a valid S3 access'\n            . ' point ARN or S3 Outposts access point ARN.');\n    }\n\n    /**\n     * Checks if a region is global\n     *\n     * @param $region\n     * @return bool\n     */\n    private function isGlobal($region)\n    {\n        return $region == 's3-external-1' || $region == 'aws-global';\n    }\n}\n", "num_lines": 356}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\CommandInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Used to update the host used for S3 requests in the case of using a\n * \"bucket endpoint\" or CNAME bucket.\n *\n * IMPORTANT: this middleware must be added after the \"build\" step.\n *\n * @internal\n */\nclass BucketEndpointMiddleware\n{\n    private static $exclusions = ['GetBucketLocation' => true];\n    private $nextHandler;\n\n    /**\n     * Create a middleware wrapper function.\n     *\n     * @return callable\n     */\n    public static function wrap()\n    {\n        return function (callable $handler) {\n            return new self($handler);\n        };\n    }\n\n    public function __construct(callable $nextHandler)\n    {\n        $this->nextHandler = $nextHandler;\n    }\n\n    public function __invoke(CommandInterface $command, RequestInterface $request)\n    {\n        $nextHandler = $this->nextHandler;\n        $bucket = $command['Bucket'];\n\n        if ($bucket && !isset(self::$exclusions[$command->getName()])) {\n            $request = $this->modifyRequest($request, $command);\n        }\n\n        return $nextHandler($command, $request);\n    }\n\n    /**\n     * Performs a one-time removal of Bucket from path, then if\n     * the bucket name is duplicated in the path, performs additional\n     * removal which is dependent on the number of occurrences of the bucket\n     * name in a path-like format in the key name.\n     *\n     * @return string\n     */\n    private function removeBucketFromPath($path, $bucket, $key)\n    {\n        $occurrencesInKey = $this->getBucketNameOccurrencesInKey($key, $bucket);\n        do {\n            $len = strlen($bucket) + 1;\n            if (substr($path, 0, $len) === \"/{$bucket}\") {\n                $path = substr($path, $len);\n            }\n        } while (substr_count($path, \"/{$bucket}\") > $occurrencesInKey + 1);\n\n        return $path ?: '/';\n    }\n\n    private function removeDuplicateBucketFromHost($host, $bucket)\n    {\n        if (substr_count($host, $bucket) > 1) {\n            while (strpos($host, \"{$bucket}.{$bucket}\") === 0) {\n                $hostArr = explode('.', $host);\n                array_shift($hostArr);\n                $host = implode('.', $hostArr);\n            }\n        }\n        return $host;\n    }\n\n    private function getBucketNameOccurrencesInKey($key, $bucket)\n    {\n        $occurrences = 0;\n        if (empty($key)) {\n            return $occurrences;\n        }\n\n        $segments = explode('/', $key);\n        foreach($segments as $segment) {\n            if (strpos($segment, $bucket) === 0) {\n                $occurrences++;\n            }\n        }\n        return $occurrences;\n    }\n\n    private function modifyRequest(\n        RequestInterface $request,\n        CommandInterface $command\n    ) {\n        $key = isset($command['Key']) ? $command['Key'] : null;\n        $uri = $request->getUri();\n        $path = $uri->getPath();\n        $host = $uri->getHost();\n        $bucket = $command['Bucket'];\n        $path = $this->removeBucketFromPath($path, $bucket, $key);\n        $host = $this->removeDuplicateBucketFromHost($host, $bucket);\n\n        // Modify the Key to make sure the key is encoded, but slashes are not.\n        if ($key) {\n            $path = S3Client::encodeKey(rawurldecode($path));\n        }\n\n        return $request->withUri(\n            $uri->withHost($host)\n                ->withPath($path)\n        );\n    }\n}\n", "num_lines": 121}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse AWS\\CRT\\CRT;\nuse Aws\\Exception\\CommonRuntimeException;\nuse GuzzleHttp\\Psr7;\nuse InvalidArgumentException;\n\ntrait CalculatesChecksumTrait\n{\n    /**\n     * @param string $requestedAlgorithm  the algorithm to encode with\n     * @param string $value               the value to be encoded\n     * @return string\n     */\n    public static function getEncodedValue($requestedAlgorithm, $value) {\n        $requestedAlgorithm = strtolower($requestedAlgorithm);\n        $useCrt = extension_loaded('awscrt');\n        if ($useCrt) {\n            $crt = new Crt();\n            switch ($requestedAlgorithm) {\n                case 'crc32c':\n                    return base64_encode(pack('N*',($crt->crc32c($value))));\n                case 'crc32':\n                    return base64_encode(pack('N*',($crt->crc32($value))));\n                case 'sha256':\n                case 'sha1':\n                    return base64_encode(Psr7\\Utils::hash($value, $requestedAlgorithm, true));\n                default:\n                    break;\n                throw new InvalidArgumentException(\n                    \"Invalid checksum requested: {$requestedAlgorithm}.\"\n                    . \"  Valid algorithms are CRC32C, CRC32, SHA256, and SHA1.\"\n                );\n            }\n        }  else {\n            if ($requestedAlgorithm == 'crc32c') {\n                throw new CommonRuntimeException(\"crc32c is not supported for checksums \"\n                    . \"without use of the common runtime for php.  Please enable the CRT or choose \"\n                    . \"a different algorithm.\"\n                );\n            }\n            if ($requestedAlgorithm == \"crc32\") {\n                $requestedAlgorithm = \"crc32b\";\n            }\n            return base64_encode(Psr7\\Utils::hash($value, $requestedAlgorithm, true));\n        }\n    }\n\n}\n", "num_lines": 51}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\Api\\Service;\nuse Aws\\Arn\\ArnInterface;\nuse Aws\\Arn\\S3\\OutpostsArnInterface;\nuse Aws\\Endpoint\\PartitionEndpointProvider;\nuse Aws\\Exception\\InvalidRegionException;\n\n/**\n * @internal\n */\ntrait EndpointRegionHelperTrait\n{\n    /** @var array */\n    private $config;\n\n    /** @var PartitionEndpointProvider */\n    private $partitionProvider;\n\n    /** @var string */\n    private $region;\n\n    /** @var Service */\n    private $service;\n\n    private function getPartitionSuffix(\n        ArnInterface $arn,\n        PartitionEndpointProvider $provider\n    ) {\n        $partition = $provider->getPartition(\n            $arn->getRegion(),\n            $arn->getService()\n        );\n        return $partition->getDnsSuffix();\n    }\n\n    private function getSigningRegion(\n        $region,\n        $service,\n        PartitionEndpointProvider $provider\n    ) {\n        $partition = $provider->getPartition($region, $service);\n        $data = $partition->toArray();\n        if (isset($data['services'][$service]['endpoints'][$region]['credentialScope']['region'])) {\n            return $data['services'][$service]['endpoints'][$region]['credentialScope']['region'];\n        }\n        return $region;\n    }\n\n    private function isMatchingSigningRegion(\n        $arnRegion,\n        $clientRegion,\n        $service,\n        PartitionEndpointProvider $provider\n    ) {\n        $arnRegion = \\Aws\\strip_fips_pseudo_regions(strtolower($arnRegion));\n        $clientRegion = strtolower($clientRegion);\n        if ($arnRegion === $clientRegion) {\n            return true;\n        }\n        if ($this->getSigningRegion($clientRegion, $service, $provider) === $arnRegion) {\n            return true;\n        }\n        return false;\n    }\n\n    private function validateFipsConfigurations(ArnInterface $arn)\n    {\n        $useFipsEndpoint = !empty($this->config['use_fips_endpoint']);\n        if ($arn instanceof OutpostsArnInterface) {\n            if (empty($this->config['use_arn_region'])\n                || !($this->config['use_arn_region']->isUseArnRegion())\n            ) {\n                $region = $this->region;\n            } else {\n                $region = $arn->getRegion();\n            }\n            if (\\Aws\\is_fips_pseudo_region($region)) {\n                throw new InvalidRegionException(\n                    'Fips is currently not supported with S3 Outposts access'\n                    . ' points. Please provide a non-fips region or do not supply an'\n                    . ' access point ARN.');\n            }\n        }\n    }\n\n    private function validateMatchingRegion(ArnInterface $arn)\n    {\n        if (!($this->isMatchingSigningRegion(\n            $arn->getRegion(),\n            $this->region,\n            $this->service->getEndpointPrefix(),\n            $this->partitionProvider)\n        )) {\n            if (empty($this->config['use_arn_region'])\n                || !($this->config['use_arn_region']->isUseArnRegion())\n            ) {\n                throw new InvalidRegionException('The region'\n                    . \" specified in the ARN (\" . $arn->getRegion()\n                    . \") does not match the client region (\"\n                    . \"{$this->region}).\");\n            }\n        }\n    }\n}\n", "num_lines": 107}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\Api\\Parser\\AbstractParser;\nuse Aws\\Api\\StructureShape;\nuse Aws\\CommandInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Psr\\Http\\Message\\StreamInterface;\n\n/**\n * @internal Decorates a parser for the S3 service to correctly handle the\n *           GetBucketLocation operation.\n */\nclass GetBucketLocationParser extends AbstractParser\n{\n    /**\n     * @param callable $parser Parser to wrap.\n     */\n    public function __construct(callable $parser)\n    {\n        $this->parser = $parser;\n    }\n\n    public function __invoke(\n        CommandInterface $command,\n        ResponseInterface $response\n    ) {\n        $fn = $this->parser;\n        $result = $fn($command, $response);\n\n        if ($command->getName() === 'GetBucketLocation') {\n            $location = 'us-east-1';\n            if (preg_match('/>(.+?)<\\/LocationConstraint>/', $response->getBody(), $matches)) {\n                $location = $matches[1] === 'EU' ? 'eu-west-1' : $matches[1];\n            }\n            $result['LocationConstraint'] = $location;\n        }\n\n        return $result;\n    }\n\n    public function parseMemberFromStream(\n        StreamInterface $stream,\n        StructureShape $member,\n        $response\n    ) {\n        return $this->parser->parseMemberFromStream($stream, $member, $response);\n    }\n}\n", "num_lines": 50}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\S3;\n\nuse Aws\\Arn\\ArnParser;\nuse Aws\\Multipart\\AbstractUploadManager;\nuse Aws\\ResultInterface;\nuse GuzzleHttp\\Psr7;\n\nclass MultipartCopy extends AbstractUploadManager\n{\n    use MultipartUploadingTrait;\n\n    /** @var string|array */\n    private $source;\n    /** @var string */\n    private $sourceVersionId;\n    /** @var ResultInterface */\n    private $sourceMetadata;\n\n    /**\n     * Creates a multipart upload for copying an S3 object.\n     *\n     * The valid configuration options are as follows:\n     *\n     * - acl: (string) ACL to set on the object being upload. Objects are\n     *   private by default.\n     * - before_complete: (callable) Callback to invoke before the\n     *   `CompleteMultipartUpload` operation. The callback should have a\n     *   function signature like `function (Aws\\Command $command) {...}`.\n     * - before_initiate: (callable) Callback to invoke before the\n     *   `CreateMultipartUpload` operation. The callback should have a function\n     *   signature like `function (Aws\\Command $command) {...}`.\n     * - before_upload: (callable) Callback to invoke before `UploadPartCopy`\n     *   operations. The callback should have a function signature like\n     *   `function (Aws\\Command $command) {...}`.\n     * - bucket: (string, required) Name of the bucket to which the object is\n     *   being uploaded.\n     * - concurrency: (int, default=int(5)) Maximum number of concurrent\n     *   `UploadPart` operations allowed during the multipart upload.\n     * - key: (string, required) Key to use for the object being uploaded.\n     * - params: (array) An array of key/value parameters that will be applied\n     *   to each of the sub-commands run by the uploader as a base.\n     *   Auto-calculated options will override these parameters. If you need\n     *   more granularity over parameters to each sub-command, use the before_*\n     *   options detailed above to update the commands directly.\n     * - part_size: (int, default=int(5242880)) Part size, in bytes, to use when\n     *   doing a multipart upload. This must between 5 MB and 5 GB, inclusive.\n     * - state: (Aws\\Multipart\\UploadState) An object that represents the state\n     *   of the multipart upload and that is used to resume a previous upload.\n     *   When this option is provided, the `bucket`, `key`, and `part_size`\n     *   options are ignored.\n     * - source_metadata: (Aws\\ResultInterface) An object that represents the\n     *   result of executing a HeadObject command on the copy source.\n     *\n     * @param S3ClientInterface $client Client used for the upload.\n     * @param string|array $source Location of the data to be copied (in the\n     *                       form /<bucket>/<key>).  If the key contains a '?'\n     *                       character, instead pass an array of source_key,\n     *                       source_bucket, and source_version_id.\n     * @param array $config Configuration used to perform the upload.\n     */\n    public function __construct(\n        S3ClientInterface $client,\n        $source,\n        array $config = []\n    ) {\n        if (is_array($source)) {\n            $this->source = $source;\n        } else {\n            $this->source = $this->getInputSource($source);\n        }\n\n        parent::__construct(\n            $client,\n            array_change_key_case($config) + ['source_metadata' => null]\n        );\n    }\n\n    /**\n     * An alias of the self::upload method.\n     *\n     * @see self::upload\n     */\n    public function copy()\n    {\n        return $this->upload();\n    }\n\n    protected function loadUploadWorkflowInfo()\n    {\n        return [\n            'command' => [\n                'initiate' => 'CreateMultipartUpload',\n                'upload' => 'UploadPartCopy',\n                'complete' => 'CompleteMultipartUpload',\n            ],\n            'id' => [\n                'bucket' => 'Bucket',\n                'key' => 'Key',\n                'upload_id' => 'UploadId',\n            ],\n            'part_num' => 'PartNumber',\n        ];\n    }\n\n    protected function getUploadCommands(callable $resultHandler)\n    {\n        $parts = ceil($this->getSourceSize() / $this->determinePartSize());\n\n        for ($partNumber = 1; $partNumber <= $parts; $partNumber++) {\n            // If we haven't already uploaded this part, yield a new part.\n            if (!$this->state->hasPartBeenUploaded($partNumber)) {\n                $command = $this->client->getCommand(\n                    $this->info['command']['upload'],\n                    $this->createPart($partNumber, $parts) + $this->getState()->getId()\n                );\n                $command->getHandlerList()->appendSign($resultHandler, 'mup');\n                yield $command;\n            }\n        }\n    }\n\n    private function createPart($partNumber, $partsCount)\n    {\n        $data = [];\n\n        // Apply custom params to UploadPartCopy data\n        $config = $this->getConfig();\n        $params = isset($config['params']) ? $config['params'] : [];\n        foreach ($params as $k => $v) {\n            $data[$k] = $v;\n        }\n        // The source parameter here is usually a string, but can be overloaded as an array\n        // if the key contains a '?' character to specify where the query parameters start\n        if (is_array($this->source)) {\n            $key = str_replace('%2F', '/', rawurlencode($this->source['source_key']));\n            $bucket = $this->source['source_bucket'];\n        } else {\n            list($bucket, $key) = explode('/', ltrim($this->source, '/'), 2);\n            $key = implode(\n                '/',\n                array_map(\n                    'urlencode',\n                    explode('/', rawurldecode($key))\n                )\n            );\n        }\n\n        $uri = ArnParser::isArn($bucket) ? '' : '/';\n        $uri .= $bucket . '/' . $key;\n        $data['CopySource'] = $uri;\n        $data['PartNumber'] = $partNumber;\n        if (!empty($this->sourceVersionId)) {\n            $data['CopySource'] .= \"?versionId=\" . $this->sourceVersionId;\n        }\n\n        $defaultPartSize = $this->determinePartSize();\n        $startByte = $defaultPartSize * ($partNumber - 1);\n        $data['ContentLength'] = $partNumber < $partsCount\n            ? $defaultPartSize\n            : $this->getSourceSize() - ($defaultPartSize * ($partsCount - 1));\n        $endByte = $startByte + $data['ContentLength'] - 1;\n        $data['CopySourceRange'] = \"bytes=$startByte-$endByte\";\n\n        return $data;\n    }\n\n    protected function extractETag(ResultInterface $result)\n    {\n        return $result->search('CopyPartResult.ETag');\n    }\n\n    protected function getSourceMimeType()\n    {\n        return $this->getSourceMetadata()['ContentType'];\n    }\n\n    protected function getSourceSize()\n    {\n        return $this->getSourceMetadata()['ContentLength'];\n    }\n\n    private function getSourceMetadata()\n    {\n        if (empty($this->sourceMetadata)) {\n            $this->sourceMetadata = $this->fetchSourceMetadata();\n        }\n\n        return $this->sourceMetadata;\n    }\n\n    private function fetchSourceMetadata()\n    {\n        if ($this->config['source_metadata'] instanceof ResultInterface) {\n            return $this->config['source_metadata'];\n        }\n        //if the source variable was overloaded with an array, use the inputs for key and bucket\n        if (is_array($this->source)) {\n            $headParams = [\n                'Key' => $this->source['source_key'],\n                'Bucket' => $this->source['source_bucket']\n            ];\n            if (isset($this->source['source_version_id'])) {\n                $this->sourceVersionId = $this->source['source_version_id'];\n                $headParams['VersionId'] = $this->sourceVersionId;\n            }\n        //otherwise, use the default source parsing behavior\n        } else {\n            list($bucket, $key) = explode('/', ltrim($this->source, '/'), 2);\n            $headParams = [\n                'Bucket' => $bucket,\n                'Key' => $key,\n            ];\n            if (strpos($key, '?')) {\n                list($key, $query) = explode('?', $key, 2);\n                $headParams['Key'] = $key;\n                $query = Psr7\\Query::parse($query, false);\n                if (isset($query['versionId'])) {\n                    $this->sourceVersionId = $query['versionId'];\n                    $headParams['VersionId'] = $this->sourceVersionId;\n                }\n            }\n        }\n        return $this->client->headObject($headParams);\n    }\n\n    /**\n     * Get the url decoded input source, starting with a slash if it is not an\n     * ARN to standardize the source location syntax.\n     *\n     * @param string $inputSource The source that was passed to the constructor\n     * @return string The source, starting with a slash if it's not an arn\n     */\n    private function getInputSource($inputSource)\n    {\n        $sourceBuilder = ArnParser::isArn($inputSource) ? '' : '/';\n        $sourceBuilder .= ltrim(rawurldecode($inputSource), '/');\n        return $sourceBuilder;\n    }\n\n}\n", "num_lines": 243}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\HashingStream;\nuse Aws\\Multipart\\AbstractUploader;\nuse Aws\\PhpHash;\nuse Aws\\ResultInterface;\nuse GuzzleHttp\\Psr7;\nuse Psr\\Http\\Message\\StreamInterface as Stream;\nuse Aws\\S3\\Exception\\S3MultipartUploadException;\n\n/**\n * Encapsulates the execution of a multipart upload to S3 or Glacier.\n */\nclass MultipartUploader extends AbstractUploader\n{\n    use MultipartUploadingTrait;\n\n    const PART_MIN_SIZE = 5242880;\n    const PART_MAX_SIZE = 5368709120;\n    const PART_MAX_NUM = 10000;\n\n    /**\n     * Creates a multipart upload for an S3 object.\n     *\n     * The valid configuration options are as follows:\n     *\n     * - acl: (string) ACL to set on the object being upload. Objects are\n     *   private by default.\n     * - before_complete: (callable) Callback to invoke before the\n     *   `CompleteMultipartUpload` operation. The callback should have a\n     *   function signature like `function (Aws\\Command $command) {...}`.\n     * - before_initiate: (callable) Callback to invoke before the\n     *   `CreateMultipartUpload` operation. The callback should have a function\n     *   signature like `function (Aws\\Command $command) {...}`.\n     * - before_upload: (callable) Callback to invoke before any `UploadPart`\n     *   operations. The callback should have a function signature like\n     *   `function (Aws\\Command $command) {...}`.\n     * - bucket: (string, required) Name of the bucket to which the object is\n     *   being uploaded, or an S3 access point ARN.\n     * - concurrency: (int, default=int(5)) Maximum number of concurrent\n     *   `UploadPart` operations allowed during the multipart upload.\n     * - key: (string, required) Key to use for the object being uploaded.\n     * - params: (array) An array of key/value parameters that will be applied\n     *   to each of the sub-commands run by the uploader as a base.\n     *   Auto-calculated options will override these parameters. If you need\n     *   more granularity over parameters to each sub-command, use the before_*\n     *   options detailed above to update the commands directly.\n     * - part_size: (int, default=int(5242880)) Part size, in bytes, to use when\n     *   doing a multipart upload. This must between 5 MB and 5 GB, inclusive.\n     * - prepare_data_source: (callable) Callback to invoke before starting the\n     *   multipart upload workflow. The callback should have a function\n     *   signature like `function () {...}`.\n     * - state: (Aws\\Multipart\\UploadState) An object that represents the state\n     *   of the multipart upload and that is used to resume a previous upload.\n     *   When this option is provided, the `bucket`, `key`, and `part_size`\n     *   options are ignored.\n     *\n     * @param S3ClientInterface $client Client used for the upload.\n     * @param mixed             $source Source of the data to upload.\n     * @param array             $config Configuration used to perform the upload.\n     */\n    public function __construct(\n        S3ClientInterface $client,\n        $source,\n        array $config = []\n    ) {\n        parent::__construct($client, $source, array_change_key_case($config) + [\n            'bucket' => null,\n            'key'    => null,\n            'exception_class' => S3MultipartUploadException::class,\n        ]);\n    }\n\n    protected function loadUploadWorkflowInfo()\n    {\n        return [\n            'command' => [\n                'initiate' => 'CreateMultipartUpload',\n                'upload'   => 'UploadPart',\n                'complete' => 'CompleteMultipartUpload',\n            ],\n            'id' => [\n                'bucket'    => 'Bucket',\n                'key'       => 'Key',\n                'upload_id' => 'UploadId',\n            ],\n            'part_num' => 'PartNumber',\n        ];\n    }\n\n    protected function createPart($seekable, $number)\n    {\n        // Initialize the array of part data that will be returned.\n        $data = [];\n\n        // Apply custom params to UploadPart data\n        $config = $this->getConfig();\n        $params = isset($config['params']) ? $config['params'] : [];\n        foreach ($params as $k => $v) {\n            $data[$k] = $v;\n        }\n\n        $data['PartNumber'] = $number;\n\n        // Read from the source to create the body stream.\n        if ($seekable) {\n            // Case 1: Source is seekable, use lazy stream to defer work.\n            $body = $this->limitPartStream(\n                new Psr7\\LazyOpenStream($this->source->getMetadata('uri'), 'r')\n            );\n        } else {\n            // Case 2: Stream is not seekable; must store in temp stream.\n            $source = $this->limitPartStream($this->source);\n            $source = $this->decorateWithHashes($source, $data);\n            $body = Psr7\\Utils::streamFor();\n            Psr7\\Utils::copyToStream($source, $body);\n        }\n\n        $contentLength = $body->getSize();\n\n        // Do not create a part if the body size is zero.\n        if ($contentLength === 0) {\n            return false;\n        }\n\n        $body->seek(0);\n        $data['Body'] = $body;\n\n        if (isset($config['add_content_md5'])\n            && $config['add_content_md5'] === true\n        ) {\n            $data['AddContentMD5'] = true;\n        }\n\n        $data['ContentLength'] = $contentLength;\n\n        return $data;\n    }\n\n    protected function extractETag(ResultInterface $result)\n    {\n        return $result['ETag'];\n    }\n\n    protected function getSourceMimeType()\n    {\n        if ($uri = $this->source->getMetadata('uri')) {\n            return Psr7\\MimeType::fromFilename($uri)\n                ?: 'application/octet-stream';\n        }\n    }\n\n    protected function getSourceSize()\n    {\n        return $this->source->getSize();\n    }\n\n    /**\n     * Decorates a stream with a sha256 linear hashing stream.\n     *\n     * @param Stream $stream Stream to decorate.\n     * @param array  $data   Part data to augment with the hash result.\n     *\n     * @return Stream\n     */\n    private function decorateWithHashes(Stream $stream, array &$data)\n    {\n        // Decorate source with a hashing stream\n        $hash = new PhpHash('sha256');\n        return new HashingStream($stream, $hash, function ($result) use (&$data) {\n            $data['ContentSHA256'] = bin2hex($result);\n        });\n    }\n}\n", "num_lines": 176}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\CommandInterface;\nuse Aws\\Multipart\\UploadState;\nuse Aws\\ResultInterface;\n\ntrait MultipartUploadingTrait\n{\n    /**\n     * Creates an UploadState object for a multipart upload by querying the\n     * service for the specified upload's information.\n     *\n     * @param S3ClientInterface $client   S3Client used for the upload.\n     * @param string            $bucket   Bucket for the multipart upload.\n     * @param string            $key      Object key for the multipart upload.\n     * @param string            $uploadId Upload ID for the multipart upload.\n     *\n     * @return UploadState\n     */\n    public static function getStateFromService(\n        S3ClientInterface $client,\n        $bucket,\n        $key,\n        $uploadId\n    ) {\n        $state = new UploadState([\n            'Bucket'   => $bucket,\n            'Key'      => $key,\n            'UploadId' => $uploadId,\n        ]);\n\n        foreach ($client->getPaginator('ListParts', $state->getId()) as $result) {\n            // Get the part size from the first part in the first result.\n            if (!$state->getPartSize()) {\n                $state->setPartSize($result->search('Parts[0].Size'));\n            }\n            // Mark all the parts returned by ListParts as uploaded.\n            foreach ($result['Parts'] as $part) {\n                $state->markPartAsUploaded($part['PartNumber'], [\n                    'PartNumber' => $part['PartNumber'],\n                    'ETag'       => $part['ETag']\n                ]);\n            }\n        }\n\n        $state->setStatus(UploadState::INITIATED);\n\n        return $state;\n    }\n\n    protected function handleResult(CommandInterface $command, ResultInterface $result)\n    {\n        $this->getState()->markPartAsUploaded($command['PartNumber'], [\n            'PartNumber' => $command['PartNumber'],\n            'ETag'       => $this->extractETag($result),\n        ]);\n    }\n\n    abstract protected function extractETag(ResultInterface $result);\n\n    protected function getCompleteParams()\n    {\n        $config = $this->getConfig();\n        $params = isset($config['params']) ? $config['params'] : [];\n\n        $params['MultipartUpload'] = [\n            'Parts' => $this->getState()->getUploadedParts()\n        ];\n\n        return $params;\n    }\n\n    protected function determinePartSize()\n    {\n        // Make sure the part size is set.\n        $partSize = $this->getConfig()['part_size'] ?: MultipartUploader::PART_MIN_SIZE;\n\n        // Adjust the part size to be larger for known, x-large uploads.\n        if ($sourceSize = $this->getSourceSize()) {\n            $partSize = (int) max(\n                $partSize,\n                ceil($sourceSize / MultipartUploader::PART_MAX_NUM)\n            );\n        }\n\n        // Ensure that the part size follows the rules: 5 MB <= size <= 5 GB.\n        if ($partSize < MultipartUploader::PART_MIN_SIZE || $partSize > MultipartUploader::PART_MAX_SIZE) {\n            throw new \\InvalidArgumentException('The part size must be no less '\n                . 'than 5 MB and no greater than 5 GB.');\n        }\n\n        return $partSize;\n    }\n\n    protected function getInitiateParams()\n    {\n        $config = $this->getConfig();\n        $params = isset($config['params']) ? $config['params'] : [];\n\n        if (isset($config['acl'])) {\n            $params['ACL'] = $config['acl'];\n        }\n\n        // Set the ContentType if not already present\n        if (empty($params['ContentType']) && $type = $this->getSourceMimeType()) {\n            $params['ContentType'] = $type;\n        }\n\n        return $params;\n    }\n\n    /**\n     * @return UploadState\n     */\n    abstract protected function getState();\n\n    /**\n     * @return array\n     */\n    abstract protected function getConfig();\n\n    /**\n     * @return int\n     */\n    abstract protected function getSourceSize();\n\n    /**\n     * @return string|null\n     */\n    abstract protected function getSourceMimeType();\n}\n", "num_lines": 133}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\Arn\\ArnParser;\nuse Aws\\Arn\\S3\\AccessPointArn;\nuse Aws\\Exception\\MultipartUploadException;\nuse Aws\\Result;\nuse Aws\\S3\\Exception\\S3Exception;\nuse GuzzleHttp\\Promise\\Coroutine;\nuse GuzzleHttp\\Promise\\PromisorInterface;\nuse InvalidArgumentException;\n\n/**\n * Copies objects from one S3 location to another, utilizing a multipart copy\n * when appropriate.\n */\nclass ObjectCopier implements PromisorInterface\n{\n    const DEFAULT_MULTIPART_THRESHOLD = MultipartUploader::PART_MAX_SIZE;\n\n    private $client;\n    private $source;\n    private $destination;\n    private $acl;\n    private $options;\n\n    private static $defaults = [\n        'before_lookup' => null,\n        'before_upload' => null,\n        'concurrency'   => 5,\n        'mup_threshold' => self::DEFAULT_MULTIPART_THRESHOLD,\n        'params'        => [],\n        'part_size'     => null,\n        'version_id'    => null,\n    ];\n\n    /**\n     * @param S3ClientInterface $client         The S3 Client used to execute\n     *                                          the copy command(s).\n     * @param array             $source         The object to copy, specified as\n     *                                          an array with a 'Bucket' and\n     *                                          'Key' keys. Provide a\n     *                                          'VersionID' key to copy a\n     *                                          specified version of an object.\n     * @param array             $destination    The bucket and key to which to\n     *                                          copy the $source, specified as\n     *                                          an array with a 'Bucket' and\n     *                                          'Key' keys.\n     * @param string            $acl            ACL to apply to the copy\n     *                                          (default: private).\n     * @param array             $options        Options used to configure the\n     *                                          copy process. Options passed in\n     *                                          through 'params' are added to\n     *                                          the sub commands.\n     *\n     * @throws InvalidArgumentException\n     */\n    public function __construct(\n        S3ClientInterface $client,\n        array $source,\n        array $destination,\n        $acl = 'private',\n        array $options = []\n    ) {\n        $this->validateLocation($source);\n        $this->validateLocation($destination);\n\n        $this->client = $client;\n        $this->source = $source;\n        $this->destination = $destination;\n        $this->acl = $acl;\n        $this->options = $options + self::$defaults;\n    }\n\n    /**\n     * Perform the configured copy asynchronously. Returns a promise that is\n     * fulfilled with the result of the CompleteMultipartUpload or CopyObject\n     * operation or rejected with an exception.\n     *\n     * @return Coroutine\n     */\n    public function promise()\n    {\n        return Coroutine::of(function () {\n            $headObjectCommand = $this->client->getCommand(\n                'HeadObject',\n                $this->options['params'] + $this->source\n            );\n            if (is_callable($this->options['before_lookup'])) {\n                $this->options['before_lookup']($headObjectCommand);\n            }\n            $objectStats = (yield $this->client->executeAsync(\n                $headObjectCommand\n            ));\n\n            if ($objectStats['ContentLength'] > $this->options['mup_threshold']) {\n                $mup = new MultipartCopy(\n                    $this->client,\n                    $this->getSourcePath(),\n                    ['source_metadata' => $objectStats, 'acl' => $this->acl]\n                        + $this->destination\n                        + $this->options\n                );\n\n                yield $mup->promise();\n            } else {\n                $defaults = [\n                    'ACL' => $this->acl,\n                    'MetadataDirective' => 'COPY',\n                    'CopySource' => $this->getSourcePath(),\n                ];\n\n                $params = array_diff_key($this->options, self::$defaults)\n                    + $this->destination + $defaults + $this->options['params'];\n\n                yield $this->client->executeAsync(\n                    $this->client->getCommand('CopyObject', $params)\n                );\n            }\n        });\n    }\n\n    /**\n     * Perform the configured copy synchronously. Returns the result of the\n     * CompleteMultipartUpload or CopyObject operation.\n     *\n     * @return Result\n     *\n     * @throws S3Exception\n     * @throws MultipartUploadException\n     */\n    public function copy()\n    {\n        return $this->promise()->wait();\n    }\n\n    private function validateLocation(array $location)\n    {\n        if (empty($location['Bucket']) || empty($location['Key'])) {\n            throw new \\InvalidArgumentException('Locations provided to an'\n                . ' Aws\\S3\\ObjectCopier must have a non-empty Bucket and Key');\n        }\n    }\n\n    private function getSourcePath()\n    {\n        $path = \"/{$this->source['Bucket']}/\";\n        if (ArnParser::isArn($this->source['Bucket'])) {\n            try {\n                new AccessPointArn($this->source['Bucket']);\n                $path = \"{$this->source['Bucket']}/object/\";\n            } catch (\\Exception $e) {\n                throw new \\InvalidArgumentException(\n                    'Provided ARN was a not a valid S3 access point ARN ('\n                    . $e->getMessage() . ')',\n                    0,\n                    $e\n                );\n            }\n        }\n\n        $sourcePath = $path . rawurlencode($this->source['Key']);\n        if (isset($this->source['VersionId'])) {\n            $sourcePath .= \"?versionId={$this->source['VersionId']}\";\n        }\n\n        return $sourcePath;\n    }\n}\n", "num_lines": 170}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse GuzzleHttp\\Promise\\PromisorInterface;\nuse GuzzleHttp\\Psr7;\nuse Psr\\Http\\Message\\StreamInterface;\n\n/**\n * Uploads an object to S3, using a PutObject command or a multipart upload as\n * appropriate.\n */\nclass ObjectUploader implements PromisorInterface\n{\n    const DEFAULT_MULTIPART_THRESHOLD = 16777216;\n\n    private $client;\n    private $bucket;\n    private $key;\n    private $body;\n    private $acl;\n    private $options;\n    private static $defaults = [\n        'before_upload' => null,\n        'concurrency'   => 3,\n        'mup_threshold' => self::DEFAULT_MULTIPART_THRESHOLD,\n        'params'        => [],\n        'part_size'     => null,\n    ];\n    private $addContentMD5;\n\n    /**\n     * @param S3ClientInterface $client         The S3 Client used to execute\n     *                                          the upload command(s).\n     * @param string            $bucket         Bucket to upload the object, or\n     *                                          an S3 access point ARN.\n     * @param string            $key            Key of the object.\n     * @param mixed             $body           Object data to upload. Can be a\n     *                                          StreamInterface, PHP stream\n     *                                          resource, or a string of data to\n     *                                          upload.\n     * @param string            $acl            ACL to apply to the copy\n     *                                          (default: private).\n     * @param array             $options        Options used to configure the\n     *                                          copy process. Options passed in\n     *                                          through 'params' are added to\n     *                                          the sub command(s).\n     */\n    public function __construct(\n        S3ClientInterface $client,\n        $bucket,\n        $key,\n        $body,\n        $acl = 'private',\n        array $options = []\n    ) {\n        $this->client = $client;\n        $this->bucket = $bucket;\n        $this->key = $key;\n        $this->body = Psr7\\Utils::streamFor($body);\n        $this->acl = $acl;\n        $this->options = $options + self::$defaults;\n        // Handle \"add_content_md5\" option.\n        $this->addContentMD5 = isset($options['add_content_md5'])\n            && $options['add_content_md5'] === true;\n    }\n\n    /**\n     * @return PromiseInterface\n     */\n    public function promise()\n    {\n        /** @var int $mup_threshold */\n        $mup_threshold = $this->options['mup_threshold'];\n        if ($this->requiresMultipart($this->body, $mup_threshold)) {\n            // Perform a multipart upload.\n            return (new MultipartUploader($this->client, $this->body, [\n                    'bucket' => $this->bucket,\n                    'key'    => $this->key,\n                    'acl'    => $this->acl\n                ] + $this->options))->promise();\n        }\n\n        // Perform a regular PutObject operation.\n        $command = $this->client->getCommand('PutObject', [\n                'Bucket' => $this->bucket,\n                'Key'    => $this->key,\n                'Body'   => $this->body,\n                'ACL'    => $this->acl,\n                'AddContentMD5' => $this->addContentMD5\n            ] + $this->options['params']);\n        if (is_callable($this->options['before_upload'])) {\n            $this->options['before_upload']($command);\n        }\n        return $this->client->executeAsync($command);\n    }\n\n    public function upload()\n    {\n        return $this->promise()->wait();\n    }\n\n    /**\n     * Determines if the body should be uploaded using PutObject or the\n     * Multipart Upload System. It also modifies the passed-in $body as needed\n     * to support the upload.\n     *\n     * @param StreamInterface $body      Stream representing the body.\n     * @param integer             $threshold Minimum bytes before using Multipart.\n     *\n     * @return bool\n     */\n    private function requiresMultipart(StreamInterface &$body, $threshold)\n    {\n        // If body size known, compare to threshold to determine if Multipart.\n        if ($body->getSize() !== null) {\n            return $body->getSize() >= $threshold;\n        }\n\n        /**\n         * Handle the situation where the body size is unknown.\n         * Read up to 5MB into a buffer to determine how to upload the body.\n         * @var StreamInterface $buffer\n         */\n        $buffer = Psr7\\Utils::streamFor();\n        Psr7\\Utils::copyToStream($body, $buffer, MultipartUploader::PART_MIN_SIZE);\n\n        // If body < 5MB, use PutObject with the buffer.\n        if ($buffer->getSize() < MultipartUploader::PART_MIN_SIZE) {\n            $buffer->seek(0);\n            $body = $buffer;\n            return false;\n        }\n\n        // If body >= 5 MB, then use multipart. [YES]\n        if ($body->isSeekable() && $body->getMetadata('uri') !== 'php://input') {\n            // If the body is seekable, just rewind the body.\n            $body->seek(0);\n        } else {\n            // If the body is non-seekable, stitch the rewind the buffer and\n            // the partially read body together into one stream. This avoids\n            // unnecessary disc usage and does not require seeking on the\n            // original stream.\n            $buffer->seek(0);\n            $body = new Psr7\\AppendStream([$buffer, $body]);\n        }\n\n        return true;\n    }\n}\n", "num_lines": 151}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\CommandInterface;\nuse Aws\\ResultInterface;\nuse Aws\\S3\\Exception\\PermanentRedirectException;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Throws a PermanentRedirectException exception when a 301 redirect is\n * encountered.\n *\n * @internal\n */\nclass PermanentRedirectMiddleware\n{\n    /** @var callable  */\n    private $nextHandler;\n\n    /**\n     * Create a middleware wrapper function.\n     *\n     * @return callable\n     */\n    public static function wrap()\n    {\n        return function (callable $handler) {\n            return new self($handler);\n        };\n    }\n\n    /**\n     * @param callable $nextHandler Next handler to invoke.\n     */\n    public function __construct(callable $nextHandler)\n    {\n        $this->nextHandler = $nextHandler;\n    }\n\n    public function __invoke(CommandInterface $command, RequestInterface $request = null)\n    {\n        $next = $this->nextHandler;\n        return $next($command, $request)->then(\n            function (ResultInterface $result) use ($command) {\n                $status = isset($result['@metadata']['statusCode'])\n                    ? $result['@metadata']['statusCode']\n                    : null;\n                if ($status == 301) {\n                    throw new PermanentRedirectException(\n                        'Encountered a permanent redirect while requesting '\n                        . $result->search('\"@metadata\".effectiveUri') . '. '\n                        . 'Are you sure you are using the correct region for '\n                        . 'this bucket?',\n                        $command,\n                        ['result' => $result]\n                    );\n                }\n                return $result;\n            }\n        );\n    }\n}\n", "num_lines": 63}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\Credentials\\CredentialsInterface;\nuse GuzzleHttp\\Psr7\\Uri;\n\n/**\n * @deprecated\n */\nclass PostObject\n{\n    private $client;\n    private $bucket;\n    private $formAttributes;\n    private $formInputs;\n    private $jsonPolicy;\n\n    /**\n     * Constructs the PostObject.\n     *\n     * @param S3ClientInterface $client     Client used with the POST object\n     * @param string            $bucket     Bucket to use\n     * @param array             $formInputs Associative array of form input\n     *                                      fields.\n     * @param string|array      $jsonPolicy JSON encoded POST policy document.\n     *                                      The policy will be base64 encoded\n     *                                      and applied to the form on your\n     *                                      behalf.\n     */\n    public function __construct(\n        S3ClientInterface $client,\n        $bucket,\n        array $formInputs,\n        $jsonPolicy\n    ) {\n        $this->client = $client;\n        $this->bucket = $bucket;\n\n        if (is_array($jsonPolicy)) {\n            $jsonPolicy = json_encode($jsonPolicy);\n        }\n\n        $this->jsonPolicy = $jsonPolicy;\n        $this->formAttributes = [\n            'action'  => $this->generateUri(),\n            'method'  => 'POST',\n            'enctype' => 'multipart/form-data'\n        ];\n\n        $this->formInputs = $formInputs + ['key' => '${filename}'];\n        $credentials = $client->getCredentials()->wait();\n        $this->formInputs += $this->getPolicyAndSignature($credentials);\n    }\n\n    /**\n     * Gets the S3 client.\n     *\n     * @return S3ClientInterface\n     */\n    public function getClient()\n    {\n        return $this->client;\n    }\n\n    /**\n     * Gets the bucket name.\n     *\n     * @return string\n     */\n    public function getBucket()\n    {\n        return $this->bucket;\n    }\n\n    /**\n     * Gets the form attributes as an array.\n     *\n     * @return array\n     */\n    public function getFormAttributes()\n    {\n        return $this->formAttributes;\n    }\n\n    /**\n     * Set a form attribute.\n     *\n     * @param string $attribute Form attribute to set.\n     * @param string $value     Value to set.\n     */\n    public function setFormAttribute($attribute, $value)\n    {\n        $this->formAttributes[$attribute] = $value;\n    }\n\n    /**\n     * Gets the form inputs as an array.\n     *\n     * @return array\n     */\n    public function getFormInputs()\n    {\n        return $this->formInputs;\n    }\n\n    /**\n     * Set a form input.\n     *\n     * @param string $field Field name to set\n     * @param string $value Value to set.\n     */\n    public function setFormInput($field, $value)\n    {\n        $this->formInputs[$field] = $value;\n    }\n\n    /**\n     * Gets the raw JSON policy.\n     *\n     * @return string\n     */\n    public function getJsonPolicy()\n    {\n        return $this->jsonPolicy;\n    }\n\n    private function generateUri()\n    {\n        $uri = new Uri($this->client->getEndpoint());\n\n        if ($this->client->getConfig('use_path_style_endpoint') === true\n            || ($uri->getScheme() === 'https'\n            && strpos($this->bucket, '.') !== false)\n        ) {\n            // Use path-style URLs\n            $uri = $uri->withPath(\"/{$this->bucket}\");\n        } else {\n            // Use virtual-style URLs\n            $uri = $uri->withHost($this->bucket . '.' . $uri->getHost());\n        }\n\n        return (string) $uri;\n    }\n\n    protected function getPolicyAndSignature(CredentialsInterface $creds)\n    {\n        $jsonPolicy64 = base64_encode($this->jsonPolicy);\n\n        return [\n            'AWSAccessKeyId' => $creds->getAccessKeyId(),\n            'policy'    => $jsonPolicy64,\n            'signature' => base64_encode(hash_hmac(\n                'sha1',\n                $jsonPolicy64,\n                $creds->getSecretKey(),\n                true\n            ))\n        ];\n    }\n}\n", "num_lines": 161}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\Credentials\\CredentialsInterface;\nuse GuzzleHttp\\Psr7\\Uri;\nuse Aws\\Signature\\SignatureTrait;\nuse Aws\\Signature\\SignatureV4 as SignatureV4;\nuse Aws\\Api\\TimestampShape as TimestampShape;\n\n/**\n * Encapsulates the logic for getting the data for an S3 object POST upload form\n *\n * @link http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html\n * @link http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html\n */\nclass PostObjectV4\n{\n    use SignatureTrait;\n\n    private $client;\n    private $bucket;\n    private $formAttributes;\n    private $formInputs;\n\n    /**\n     * Constructs the PostObject.\n     *\n     * The options array accepts the following keys:\n     * @link http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html\n     *\n     * @param S3ClientInterface $client     Client used with the POST object\n     * @param string            $bucket     Bucket to use\n     * @param array             $formInputs Associative array of form input\n     *                                      fields.\n     * @param array             $options    Policy condition options\n     * @param mixed             $expiration Upload expiration time value. By\n     *                                      default: 1 hour valid period.\n     */\n    public function __construct(\n        S3ClientInterface $client,\n        $bucket,\n        array $formInputs,\n        array $options = [],\n        $expiration = '+1 hours'\n    ) {\n        $this->client = $client;\n        $this->bucket = $bucket;\n\n        // setup form attributes\n        $this->formAttributes = [\n            'action'  => $this->generateUri(),\n            'method'  => 'POST',\n            'enctype' => 'multipart/form-data'\n        ];\n\n        $credentials   = $this->client->getCredentials()->wait();\n\n        if ($securityToken = $credentials->getSecurityToken()) {\n            $options [] = ['x-amz-security-token' => $securityToken];\n            $formInputs['X-Amz-Security-Token'] = $securityToken;\n        }\n\n        // setup basic policy\n        $policy = [\n            'expiration' => TimestampShape::format($expiration, 'iso8601'),\n            'conditions' => $options,\n        ];\n\n        // setup basic formInputs\n        $this->formInputs = $formInputs + ['key' => '${filename}'];\n\n        // finalize policy and signature\n\n        $this->formInputs += $this->getPolicyAndSignature(\n            $credentials,\n            $policy\n        );\n    }\n\n    /**\n     * Gets the S3 client.\n     *\n     * @return S3ClientInterface\n     */\n    public function getClient()\n    {\n        return $this->client;\n    }\n\n    /**\n     * Gets the bucket name.\n     *\n     * @return string\n     */\n    public function getBucket()\n    {\n        return $this->bucket;\n    }\n\n    /**\n     * Gets the form attributes as an array.\n     *\n     * @return array\n     */\n    public function getFormAttributes()\n    {\n        return $this->formAttributes;\n    }\n\n    /**\n     * Set a form attribute.\n     *\n     * @param string $attribute Form attribute to set.\n     * @param string $value     Value to set.\n     */\n    public function setFormAttribute($attribute, $value)\n    {\n        $this->formAttributes[$attribute] = $value;\n    }\n\n    /**\n     * Gets the form inputs as an array.\n     *\n     * @return array\n     */\n    public function getFormInputs()\n    {\n        return $this->formInputs;\n    }\n\n    /**\n     * Set a form input.\n     *\n     * @param string $field Field name to set\n     * @param string $value Value to set.\n     */\n    public function setFormInput($field, $value)\n    {\n        $this->formInputs[$field] = $value;\n    }\n\n    private function generateUri()\n    {\n        $uri = new Uri($this->client->getEndpoint());\n\n        if ($this->client->getConfig('use_path_style_endpoint') === true\n            || ($uri->getScheme() === 'https'\n            && strpos($this->bucket, '.') !== false)\n        ) {\n            // Use path-style URLs\n            $uri = $uri->withPath(\"/{$this->bucket}\");\n        } else {\n            // Use virtual-style URLs if haven't been set up already\n            if (strpos($uri->getHost(), $this->bucket . '.') !== 0) {\n                $uri = $uri->withHost($this->bucket . '.' . $uri->getHost());\n            }\n        }\n\n        return (string) $uri;\n    }\n\n    protected function getPolicyAndSignature(\n        CredentialsInterface $credentials,\n        array $policy\n    ){\n        $ldt = gmdate(SignatureV4::ISO8601_BASIC);\n        $sdt = substr($ldt, 0, 8);\n        $policy['conditions'][] = ['X-Amz-Date' => $ldt];\n\n        $region = $this->client->getRegion();\n        $scope = $this->createScope($sdt, $region, 's3');\n        $creds = \"{$credentials->getAccessKeyId()}/$scope\";\n        $policy['conditions'][] = ['X-Amz-Credential' => $creds];\n\n        $policy['conditions'][] = ['X-Amz-Algorithm' => \"AWS4-HMAC-SHA256\"];\n\n        $jsonPolicy64 = base64_encode(json_encode($policy));\n        $key = $this->getSigningKey(\n            $sdt,\n            $region,\n            's3',\n            $credentials->getSecretKey()\n        );\n\n        return [\n            'X-Amz-Credential' => $creds,\n            'X-Amz-Algorithm' => \"AWS4-HMAC-SHA256\",\n            'X-Amz-Date' => $ldt,\n            'Policy'           => $jsonPolicy64,\n            'X-Amz-Signature'  => bin2hex(\n                hash_hmac('sha256', $jsonPolicy64, $key, true)\n            ),\n        ];\n    }\n}\n", "num_lines": 196}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\CommandInterface;\nuse Aws\\ResultInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Injects ObjectURL into the result of the PutObject operation.\n *\n * @internal\n */\nclass PutObjectUrlMiddleware\n{\n    /** @var callable  */\n    private $nextHandler;\n\n    /**\n     * Create a middleware wrapper function.\n     *\n     * @return callable\n     */\n    public static function wrap()\n    {\n        return function (callable $handler) {\n            return new self($handler);\n        };\n    }\n\n    /**\n     * @param callable $nextHandler Next handler to invoke.\n     */\n    public function __construct(callable $nextHandler)\n    {\n        $this->nextHandler = $nextHandler;\n    }\n\n    public function __invoke(CommandInterface $command, RequestInterface $request = null)\n    {\n        $next = $this->nextHandler;\n        return $next($command, $request)->then(\n            function (ResultInterface $result) use ($command) {\n                $name = $command->getName();\n                switch ($name) {\n                    case 'PutObject':\n                    case 'CopyObject':\n                        $result['ObjectURL'] = isset($result['@metadata']['effectiveUri'])\n                            ? $result['@metadata']['effectiveUri']\n                            : null;\n                        break;\n                    case 'CompleteMultipartUpload':\n                        $result['ObjectURL'] = $result['Location'];\n                        break;\n                }\n                return $result;\n            }\n        );\n    }\n}\n", "num_lines": 60}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\Api\\Parser\\AbstractParser;\nuse Aws\\Api\\StructureShape;\nuse Aws\\Api\\Parser\\Exception\\ParserException;\nuse Aws\\CommandInterface;\nuse Aws\\Exception\\AwsException;\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Psr\\Http\\Message\\StreamInterface;\n\n/**\n * Converts malformed responses to a retryable error type.\n *\n * @internal\n */\nclass RetryableMalformedResponseParser extends AbstractParser\n{\n    /** @var string */\n    private $exceptionClass;\n\n    public function __construct(\n        callable $parser,\n        $exceptionClass = AwsException::class\n    ) {\n        $this->parser = $parser;\n        $this->exceptionClass = $exceptionClass;\n    }\n\n    public function __invoke(\n        CommandInterface $command,\n        ResponseInterface $response\n    ) {\n        $fn = $this->parser;\n\n        try {\n            return $fn($command, $response);\n        } catch (ParserException $e) {\n            throw new $this->exceptionClass(\n                \"Error parsing response for {$command->getName()}:\"\n                    . \" AWS parsing error: {$e->getMessage()}\",\n                $command,\n                ['connection_error' => true, 'exception' => $e],\n                $e\n            );\n        }\n    }\n\n    public function parseMemberFromStream(\n        StreamInterface $stream,\n        StructureShape $member,\n        $response\n    ) {\n        return $this->parser->parseMemberFromStream($stream, $member, $response);\n    }\n}\n", "num_lines": 57}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\Api\\ApiProvider;\nuse Aws\\Api\\DocModel;\nuse Aws\\Api\\Service;\nuse Aws\\AwsClient;\nuse Aws\\CacheInterface;\nuse Aws\\ClientResolver;\nuse Aws\\Command;\nuse Aws\\Exception\\AwsException;\nuse Aws\\HandlerList;\nuse Aws\\InputValidationMiddleware;\nuse Aws\\Middleware;\nuse Aws\\Retry\\QuotaManager;\nuse Aws\\RetryMiddleware;\nuse Aws\\ResultInterface;\nuse Aws\\CommandInterface;\nuse Aws\\RetryMiddlewareV2;\nuse Aws\\S3\\UseArnRegion\\Configuration;\nuse Aws\\S3\\UseArnRegion\\ConfigurationInterface;\nuse Aws\\S3\\UseArnRegion\\ConfigurationProvider as UseArnRegionConfigurationProvider;\nuse Aws\\S3\\RegionalEndpoint\\ConfigurationProvider;\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\Promise\\Promise;\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Client used to interact with **Amazon Simple Storage Service (Amazon S3)**.\n *\n * @method \\Aws\\Result abortMultipartUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise abortMultipartUploadAsync(array $args = [])\n * @method \\Aws\\Result completeMultipartUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise completeMultipartUploadAsync(array $args = [])\n * @method \\Aws\\Result copyObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyObjectAsync(array $args = [])\n * @method \\Aws\\Result createBucket(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBucketAsync(array $args = [])\n * @method \\Aws\\Result createMultipartUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMultipartUploadAsync(array $args = [])\n * @method \\Aws\\Result deleteBucket(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketAnalyticsConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketAnalyticsConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketCors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketCorsAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketEncryption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketEncryptionAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketIntelligentTieringConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketIntelligentTieringConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketInventoryConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketInventoryConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketLifecycle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketLifecycleAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketMetricsConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketMetricsConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketOwnershipControls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketOwnershipControlsAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketReplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketReplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketTaggingAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketWebsite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketWebsiteAsync(array $args = [])\n * @method \\Aws\\Result deleteObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteObjectAsync(array $args = [])\n * @method \\Aws\\Result deleteObjectTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteObjectTaggingAsync(array $args = [])\n * @method \\Aws\\Result deleteObjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteObjectsAsync(array $args = [])\n * @method \\Aws\\Result deletePublicAccessBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePublicAccessBlockAsync(array $args = [])\n * @method \\Aws\\Result getBucketAccelerateConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketAccelerateConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getBucketAcl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketAclAsync(array $args = [])\n * @method \\Aws\\Result getBucketAnalyticsConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketAnalyticsConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getBucketCors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketCorsAsync(array $args = [])\n * @method \\Aws\\Result getBucketEncryption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketEncryptionAsync(array $args = [])\n * @method \\Aws\\Result getBucketIntelligentTieringConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketIntelligentTieringConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getBucketInventoryConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketInventoryConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getBucketLifecycle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketLifecycleAsync(array $args = [])\n * @method \\Aws\\Result getBucketLifecycleConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketLifecycleConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getBucketLocation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketLocationAsync(array $args = [])\n * @method \\Aws\\Result getBucketLogging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketLoggingAsync(array $args = [])\n * @method \\Aws\\Result getBucketMetricsConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketMetricsConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getBucketNotification(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketNotificationAsync(array $args = [])\n * @method \\Aws\\Result getBucketNotificationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketNotificationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getBucketOwnershipControls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketOwnershipControlsAsync(array $args = [])\n * @method \\Aws\\Result getBucketPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketPolicyAsync(array $args = [])\n * @method \\Aws\\Result getBucketPolicyStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketPolicyStatusAsync(array $args = [])\n * @method \\Aws\\Result getBucketReplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketReplicationAsync(array $args = [])\n * @method \\Aws\\Result getBucketRequestPayment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketRequestPaymentAsync(array $args = [])\n * @method \\Aws\\Result getBucketTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketTaggingAsync(array $args = [])\n * @method \\Aws\\Result getBucketVersioning(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketVersioningAsync(array $args = [])\n * @method \\Aws\\Result getBucketWebsite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketWebsiteAsync(array $args = [])\n * @method \\Aws\\Result getObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectAsync(array $args = [])\n * @method \\Aws\\Result getObjectAcl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectAclAsync(array $args = [])\n * @method \\Aws\\Result getObjectAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectAttributesAsync(array $args = [])\n * @method \\Aws\\Result getObjectLegalHold(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectLegalHoldAsync(array $args = [])\n * @method \\Aws\\Result getObjectLockConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectLockConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getObjectRetention(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectRetentionAsync(array $args = [])\n * @method \\Aws\\Result getObjectTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectTaggingAsync(array $args = [])\n * @method \\Aws\\Result getObjectTorrent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectTorrentAsync(array $args = [])\n * @method \\Aws\\Result getPublicAccessBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPublicAccessBlockAsync(array $args = [])\n * @method \\Aws\\Result headBucket(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise headBucketAsync(array $args = [])\n * @method \\Aws\\Result headObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise headObjectAsync(array $args = [])\n * @method \\Aws\\Result listBucketAnalyticsConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBucketAnalyticsConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listBucketIntelligentTieringConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBucketIntelligentTieringConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listBucketInventoryConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBucketInventoryConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listBucketMetricsConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBucketMetricsConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listBuckets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBucketsAsync(array $args = [])\n * @method \\Aws\\Result listMultipartUploads(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMultipartUploadsAsync(array $args = [])\n * @method \\Aws\\Result listObjectVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listObjectVersionsAsync(array $args = [])\n * @method \\Aws\\Result listObjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listObjectsAsync(array $args = [])\n * @method \\Aws\\Result listObjectsV2(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listObjectsV2Async(array $args = [])\n * @method \\Aws\\Result listParts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPartsAsync(array $args = [])\n * @method \\Aws\\Result putBucketAccelerateConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketAccelerateConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putBucketAcl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketAclAsync(array $args = [])\n * @method \\Aws\\Result putBucketAnalyticsConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketAnalyticsConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putBucketCors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketCorsAsync(array $args = [])\n * @method \\Aws\\Result putBucketEncryption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketEncryptionAsync(array $args = [])\n * @method \\Aws\\Result putBucketIntelligentTieringConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketIntelligentTieringConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putBucketInventoryConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketInventoryConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putBucketLifecycle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketLifecycleAsync(array $args = [])\n * @method \\Aws\\Result putBucketLifecycleConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketLifecycleConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putBucketLogging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketLoggingAsync(array $args = [])\n * @method \\Aws\\Result putBucketMetricsConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketMetricsConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putBucketNotification(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketNotificationAsync(array $args = [])\n * @method \\Aws\\Result putBucketNotificationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketNotificationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putBucketOwnershipControls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketOwnershipControlsAsync(array $args = [])\n * @method \\Aws\\Result putBucketPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketPolicyAsync(array $args = [])\n * @method \\Aws\\Result putBucketReplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketReplicationAsync(array $args = [])\n * @method \\Aws\\Result putBucketRequestPayment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketRequestPaymentAsync(array $args = [])\n * @method \\Aws\\Result putBucketTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketTaggingAsync(array $args = [])\n * @method \\Aws\\Result putBucketVersioning(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketVersioningAsync(array $args = [])\n * @method \\Aws\\Result putBucketWebsite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketWebsiteAsync(array $args = [])\n * @method \\Aws\\Result putObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putObjectAsync(array $args = [])\n * @method \\Aws\\Result putObjectAcl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putObjectAclAsync(array $args = [])\n * @method \\Aws\\Result putObjectLegalHold(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putObjectLegalHoldAsync(array $args = [])\n * @method \\Aws\\Result putObjectLockConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putObjectLockConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putObjectRetention(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putObjectRetentionAsync(array $args = [])\n * @method \\Aws\\Result putObjectTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putObjectTaggingAsync(array $args = [])\n * @method \\Aws\\Result putPublicAccessBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPublicAccessBlockAsync(array $args = [])\n * @method \\Aws\\Result restoreObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreObjectAsync(array $args = [])\n * @method \\Aws\\Result selectObjectContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise selectObjectContentAsync(array $args = [])\n * @method \\Aws\\Result uploadPart(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise uploadPartAsync(array $args = [])\n * @method \\Aws\\Result uploadPartCopy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise uploadPartCopyAsync(array $args = [])\n * @method \\Aws\\Result writeGetObjectResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise writeGetObjectResponseAsync(array $args = [])\n */\nclass S3Client extends AwsClient implements S3ClientInterface\n{\n    use S3ClientTrait;\n\n    /** @var array */\n    private static $mandatoryAttributes = ['Bucket', 'Key'];\n\n    public static function getArguments()\n    {\n        $args = parent::getArguments();\n        $args['retries']['fn'] = [__CLASS__, '_applyRetryConfig'];\n        $args['api_provider']['fn'] = [__CLASS__, '_applyApiProvider'];\n\n        return $args + [\n            'bucket_endpoint' => [\n                'type'    => 'config',\n                'valid'   => ['bool'],\n                'doc'     => 'Set to true to send requests to a hardcoded '\n                    . 'bucket endpoint rather than create an endpoint as a '\n                    . 'result of injecting the bucket into the URL. This '\n                    . 'option is useful for interacting with CNAME endpoints.',\n            ],\n            'use_arn_region' => [\n                'type'    => 'config',\n                'valid'   => [\n                    'bool',\n                    Configuration::class,\n                    CacheInterface::class,\n                    'callable'\n                ],\n                'doc'     => 'Set to true to allow passed in ARNs to override'\n                    . ' client region. Accepts...',\n                'fn' => [__CLASS__, '_apply_use_arn_region'],\n                'default' => [UseArnRegionConfigurationProvider::class, 'defaultProvider'],\n            ],\n            'use_accelerate_endpoint' => [\n                'type' => 'config',\n                'valid' => ['bool'],\n                'doc' => 'Set to true to send requests to an S3 Accelerate'\n                    . ' endpoint by default. Can be enabled or disabled on'\n                    . ' individual operations by setting'\n                    . ' \\'@use_accelerate_endpoint\\' to true or false. Note:'\n                    . ' you must enable S3 Accelerate on a bucket before it can'\n                    . ' be accessed via an Accelerate endpoint.',\n                'default' => false,\n            ],\n            'use_path_style_endpoint' => [\n                'type' => 'config',\n                'valid' => ['bool'],\n                'doc' => 'Set to true to send requests to an S3 path style'\n                    . ' endpoint by default.'\n                    . ' Can be enabled or disabled on individual operations by setting'\n                    . ' \\'@use_path_style_endpoint\\' to true or false.',\n                'default' => false,\n            ],\n            'disable_multiregion_access_points' => [\n                'type' => 'config',\n                'valid' => ['bool'],\n                'doc' => 'Set to true to disable the usage of'\n                    . ' multi region access points. These are enabled by default.'\n                    . ' Can be enabled or disabled on individual operations by setting'\n                    . ' \\'@disable_multiregion_access_points\\' to true or false.',\n                'default' => false,\n            ],\n        ];\n    }\n\n    /**\n     * {@inheritdoc}\n     *\n     * In addition to the options available to\n     * {@see Aws\\AwsClient::__construct}, S3Client accepts the following\n     * options:\n     *\n     * - bucket_endpoint: (bool) Set to true to send requests to a\n     *   hardcoded bucket endpoint rather than create an endpoint as a result\n     *   of injecting the bucket into the URL. This option is useful for\n     *   interacting with CNAME endpoints. Note: if you are using version 2.243.0\n     *   and above and do not expect the bucket name to appear in the host, you will\n     *   also need to set `use_path_style_endpoint` to `true`.\n     * - calculate_md5: (bool) Set to false to disable calculating an MD5\n     *   for all Amazon S3 signed uploads.\n     * - s3_us_east_1_regional_endpoint:\n     *   (Aws\\S3\\RegionalEndpoint\\ConfigurationInterface|Aws\\CacheInterface\\|callable|string|array)\n     *   Specifies whether to use regional or legacy endpoints for the us-east-1\n     *   region. Provide an Aws\\S3\\RegionalEndpoint\\ConfigurationInterface object, an\n     *   instance of Aws\\CacheInterface, a callable configuration provider used\n     *   to create endpoint configuration, a string value of `legacy` or\n     *   `regional`, or an associative array with the following keys:\n     *   endpoint_types: (string)  Set to `legacy` or `regional`, defaults to\n     *   `legacy`\n     * - use_accelerate_endpoint: (bool) Set to true to send requests to an S3\n     *   Accelerate endpoint by default. Can be enabled or disabled on\n     *   individual operations by setting '@use_accelerate_endpoint' to true or\n     *   false. Note: you must enable S3 Accelerate on a bucket before it can be\n     *   accessed via an Accelerate endpoint.\n     * - use_arn_region: (Aws\\S3\\UseArnRegion\\ConfigurationInterface,\n     *   Aws\\CacheInterface, bool, callable) Set to true to enable the client\n     *   to use the region from a supplied ARN argument instead of the client's\n     *   region. Provide an instance of Aws\\S3\\UseArnRegion\\ConfigurationInterface,\n     *   an instance of Aws\\CacheInterface, a callable that provides a promise for\n     *   a Configuration object, or a boolean value. Defaults to false (i.e.\n     *   the SDK will not follow the ARN region if it conflicts with the client\n     *   region and instead throw an error).\n     * - use_dual_stack_endpoint: (bool) Set to true to send requests to an S3\n     *   Dual Stack endpoint by default, which enables IPv6 Protocol.\n     *   Can be enabled or disabled on individual operations by setting\n     *   '@use_dual_stack_endpoint\\' to true or false. Note:\n     *   you cannot use it together with an accelerate endpoint.\n     * - use_path_style_endpoint: (bool) Set to true to send requests to an S3\n     *   path style endpoint by default.\n     *   Can be enabled or disabled on individual operations by setting\n     *   '@use_path_style_endpoint\\' to true or false. Note:\n     *   you cannot use it together with an accelerate endpoint.\n     * - disable_multiregion_access_points: (bool) Set to true to disable\n     *   sending multi region requests.  They are enabled by default.\n     *   Can be enabled or disabled on individual operations by setting\n     *   '@disable_multiregion_access_points\\' to true or false. Note:\n     *   you cannot use it together with an accelerate or dualstack endpoint.\n     *\n     * @param array $args\n     */\n    public function __construct(array $args)\n    {\n        if (\n            !isset($args['s3_us_east_1_regional_endpoint'])\n            || $args['s3_us_east_1_regional_endpoint'] instanceof CacheInterface\n        ) {\n            $args['s3_us_east_1_regional_endpoint'] = ConfigurationProvider::defaultProvider($args);\n        }\n        $this->addBuiltIns($args);\n        parent::__construct($args);\n        $stack = $this->getHandlerList();\n        $stack->appendInit(SSECMiddleware::wrap($this->getEndpoint()->getScheme()), 's3.ssec');\n        $stack->appendBuild(ApplyChecksumMiddleware::wrap($this->getApi()), 's3.checksum');\n        $stack->appendBuild(\n            Middleware::contentType(['PutObject', 'UploadPart']),\n            's3.content_type'\n        );\n\n        if ($this->getConfig('bucket_endpoint')) {\n            $stack->appendBuild(BucketEndpointMiddleware::wrap(), 's3.bucket_endpoint');\n        } elseif (!$this->isUseEndpointV2()) {\n            $stack->appendBuild(\n                S3EndpointMiddleware::wrap(\n                    $this->getRegion(),\n                    $this->getConfig('endpoint_provider'),\n                    [\n                        'accelerate' => $this->getConfig('use_accelerate_endpoint'),\n                        'path_style' => $this->getConfig('use_path_style_endpoint'),\n                        'use_fips_endpoint' => $this->getConfig('use_fips_endpoint'),\n                        'dual_stack' =>\n                            $this->getConfig('use_dual_stack_endpoint')->isUseDualStackEndpoint(),\n\n                    ]\n                ),\n                's3.endpoint_middleware'\n            );\n        }\n\n        $stack->appendBuild(\n            BucketEndpointArnMiddleware::wrap(\n                $this->getApi(),\n                $this->getRegion(),\n                [\n                    'use_arn_region' => $this->getConfig('use_arn_region'),\n                    'accelerate' => $this->getConfig('use_accelerate_endpoint'),\n                    'path_style' => $this->getConfig('use_path_style_endpoint'),\n                    'dual_stack' =>\n                        $this->getConfig('use_dual_stack_endpoint')->isUseDualStackEndpoint(),\n                    'use_fips_endpoint' => $this->getConfig('use_fips_endpoint'),\n                    'disable_multiregion_access_points' =>\n                        $this->getConfig('disable_multiregion_access_points'),\n                    'endpoint' => isset($args['endpoint'])\n                        ? $args['endpoint']\n                        : null\n                ],\n                $this->isUseEndpointV2()\n            ),\n            's3.bucket_endpoint_arn'\n        );\n\n        $stack->appendValidate(\n            InputValidationMiddleware::wrap($this->getApi(), self::$mandatoryAttributes),\n            'input_validation_middleware'\n        );\n        $stack->appendSign(PutObjectUrlMiddleware::wrap(), 's3.put_object_url');\n        $stack->appendSign(PermanentRedirectMiddleware::wrap(), 's3.permanent_redirect');\n        $stack->appendInit(Middleware::sourceFile($this->getApi()), 's3.source_file');\n        $stack->appendInit($this->getSaveAsParameter(), 's3.save_as');\n        $stack->appendInit($this->getLocationConstraintMiddleware(), 's3.location');\n        $stack->appendInit($this->getEncodingTypeMiddleware(), 's3.auto_encode');\n        $stack->appendInit($this->getHeadObjectMiddleware(), 's3.head_object');\n        if ($this->isUseEndpointV2()) {\n            $this->processEndpointV2Model();\n            $stack->after('builderV2',\n                's3.check_empty_path_with_query',\n                $this->getEmptyPathWithQuery());\n        }\n    }\n\n    /**\n     * Determine if a string is a valid name for a DNS compatible Amazon S3\n     * bucket.\n     *\n     * DNS compatible bucket names can be used as a subdomain in a URL (e.g.,\n     * \"<bucket>.s3.amazonaws.com\").\n     *\n     * @param string $bucket Bucket name to check.\n     *\n     * @return bool\n     */\n    public static function isBucketDnsCompatible($bucket)\n    {\n        if (!is_string($bucket)) {\n            return false;\n        }\n        $bucketLen = strlen($bucket);\n\n        return ($bucketLen >= 3 && $bucketLen <= 63) &&\n            // Cannot look like an IP address\n            !filter_var($bucket, FILTER_VALIDATE_IP) &&\n            preg_match('/^[a-z0-9]([a-z0-9\\-\\.]*[a-z0-9])?$/', $bucket);\n    }\n\n    public static function _apply_use_arn_region($value, array &$args, HandlerList $list)\n    {\n        if ($value instanceof CacheInterface) {\n            $value = UseArnRegionConfigurationProvider::defaultProvider($args);\n        }\n        if (is_callable($value)) {\n            $value = $value();\n        }\n        if ($value instanceof PromiseInterface) {\n            $value = $value->wait();\n        }\n        if ($value instanceof ConfigurationInterface) {\n            $args['use_arn_region'] = $value;\n        } else {\n            // The Configuration class itself will validate other inputs\n            $args['use_arn_region'] = new Configuration($value);\n        }\n    }\n\n    public function createPresignedRequest(CommandInterface $command, $expires, array $options = [])\n    {\n        $command = clone $command;\n        $command->getHandlerList()->remove('signer');\n        $request = \\Aws\\serialize($command);\n        $signing_name = empty($command->getAuthSchemes())\n            ? $this->getSigningName($request->getUri()->getHost())\n            : $command->getAuthSchemes()['name'];\n        $signature_version = empty($command->getAuthSchemes())\n            ? $this->getConfig('signature_version')\n            : $command->getAuthSchemes()['version'];\n\n        /** @var \\Aws\\Signature\\SignatureInterface $signer */\n        $signer = call_user_func(\n            $this->getSignatureProvider(),\n            $signature_version,\n            $signing_name,\n            $this->getConfig('signing_region')\n        );\n\n        return $signer->presign(\n            $request,\n            $this->getCredentials()->wait(),\n            $expires,\n            $options\n        );\n    }\n\n    /**\n     * Returns the URL to an object identified by its bucket and key.\n     *\n     * The URL returned by this method is not signed nor does it ensure that the\n     * bucket and key given to the method exist. If you need a signed URL, then\n     * use the {@see \\Aws\\S3\\S3Client::createPresignedRequest} method and get\n     * the URI of the signed request.\n     *\n     * @param string $bucket  The name of the bucket where the object is located\n     * @param string $key     The key of the object\n     *\n     * @return string The URL to the object\n     */\n    public function getObjectUrl($bucket, $key)\n    {\n        $command = $this->getCommand('GetObject', [\n            'Bucket' => $bucket,\n            'Key'    => $key\n        ]);\n\n        return (string) \\Aws\\serialize($command)->getUri();\n    }\n\n    /**\n     * Raw URL encode a key and allow for '/' characters\n     *\n     * @param string $key Key to encode\n     *\n     * @return string Returns the encoded key\n     */\n    public static function encodeKey($key)\n    {\n        return str_replace('%2F', '/', rawurlencode($key));\n    }\n\n    /**\n     * Provides a middleware that removes the need to specify LocationConstraint on CreateBucket.\n     *\n     * @return \\Closure\n     */\n    private function getLocationConstraintMiddleware()\n    {\n        $region = $this->getRegion();\n        return static function (callable $handler) use ($region) {\n            return function (Command $command, $request = null) use ($handler, $region) {\n                if ($command->getName() === 'CreateBucket') {\n                    $locationConstraint = isset($command['CreateBucketConfiguration']['LocationConstraint'])\n                        ? $command['CreateBucketConfiguration']['LocationConstraint']\n                        : null;\n\n                    if ($locationConstraint === 'us-east-1') {\n                        unset($command['CreateBucketConfiguration']);\n                    } elseif ('us-east-1' !== $region && empty($locationConstraint)) {\n                        $command['CreateBucketConfiguration'] = ['LocationConstraint' => $region];\n                    }\n                }\n\n                return $handler($command, $request);\n            };\n        };\n    }\n\n    /**\n     * Provides a middleware that supports the `SaveAs` parameter.\n     *\n     * @return \\Closure\n     */\n    private function getSaveAsParameter()\n    {\n        return static function (callable $handler) {\n            return function (Command $command, $request = null) use ($handler) {\n                if ($command->getName() === 'GetObject' && isset($command['SaveAs'])) {\n                    $command['@http']['sink'] = $command['SaveAs'];\n                    unset($command['SaveAs']);\n                }\n\n                return $handler($command, $request);\n            };\n        };\n    }\n\n    /**\n     * Provides a middleware that disables content decoding on HeadObject\n     * commands.\n     *\n     * @return \\Closure\n     */\n    private function getHeadObjectMiddleware()\n    {\n        return static function (callable $handler) {\n            return function (\n                CommandInterface $command,\n                RequestInterface $request = null\n            ) use ($handler) {\n                if ($command->getName() === 'HeadObject'\n                    && !isset($command['@http']['decode_content'])\n                ) {\n                    $command['@http']['decode_content'] = false;\n                }\n\n                return $handler($command, $request);\n            };\n        };\n    }\n\n    /**\n     * Provides a middleware that autopopulates the EncodingType parameter on\n     * ListObjects commands.\n     *\n     * @return \\Closure\n     */\n    private function getEncodingTypeMiddleware()\n    {\n        return static function (callable $handler) {\n            return function (Command $command, $request = null) use ($handler) {\n                $autoSet = false;\n                if ($command->getName() === 'ListObjects'\n                    && empty($command['EncodingType'])\n                ) {\n                    $command['EncodingType'] = 'url';\n                    $autoSet = true;\n                }\n\n                return $handler($command, $request)\n                    ->then(function (ResultInterface $result) use ($autoSet) {\n                        if ($result['EncodingType'] === 'url' && $autoSet) {\n                            static $topLevel = [\n                                'Delimiter',\n                                'Marker',\n                                'NextMarker',\n                                'Prefix',\n                            ];\n                            static $nested = [\n                                ['Contents', 'Key'],\n                                ['CommonPrefixes', 'Prefix'],\n                            ];\n\n                            foreach ($topLevel as $key) {\n                                if (isset($result[$key])) {\n                                    $result[$key] = urldecode($result[$key]);\n                                }\n                            }\n                            foreach ($nested as $steps) {\n                                if (isset($result[$steps[0]])) {\n                                    foreach ($result[$steps[0]] as $key => $part) {\n                                        if (isset($part[$steps[1]])) {\n                                            $result[$steps[0]][$key][$steps[1]]\n                                                = urldecode($part[$steps[1]]);\n                                        }\n                                    }\n                                }\n                            }\n\n                        }\n\n                        return $result;\n                    });\n            };\n        };\n    }\n\n    /**\n     * Provides a middleware that checks for an empty path and a\n     * non-empty query string.\n     *\n     * @return \\Closure\n     */\n    private function getEmptyPathWithQuery()\n    {\n        return static function (callable $handler) {\n            return function (Command $command, RequestInterface $request) use ($handler) {\n                $uri = $request->getUri();\n                if (empty($uri->getPath()) && !empty($uri->getQuery())) {\n                    $uri = $uri->withPath('/');\n                    $request = $request->withUri($uri);\n                }\n\n                return $handler($command, $request);\n            };\n        };\n    }\n\n    /**\n     * Special handling for when the service name is s3-object-lambda.\n     * So, if the host contains s3-object-lambda, then the service name\n     * returned is s3-object-lambda, otherwise the default signing service is returned.\n     * @param string $host The host to validate if is a s3-object-lambda URL.\n     * @return string returns the signing service name to be used\n     */\n    private function getSigningName($host)\n    {\n        if (strpos( $host, 's3-object-lambda')) {\n            return 's3-object-lambda';\n        }\n\n        return $this->getConfig('signing_name');\n    }\n\n    /**\n     * Modifies API definition to remove `Bucket` from request URIs.\n     * This is now handled by the endpoint ruleset.\n     *\n     * @return void\n     *\n     * @internal\n     */\n    private function processEndpointV2Model()\n    {\n        $definition = $this->getApi()->getDefinition();\n\n        foreach($definition['operations'] as &$operation) {\n            if (isset($operation['http']['requestUri'])) {\n                $requestUri = $operation['http']['requestUri'];\n                if ($requestUri === \"/{Bucket}\") {\n                    $requestUri = str_replace('/{Bucket}', '/', $requestUri);\n                } else {\n                    $requestUri = str_replace('/{Bucket}', '', $requestUri);\n                }\n                $operation['http']['requestUri'] = $requestUri;\n            }\n        }\n        $this->getApi()->setDefinition($definition);\n    }\n\n    /**\n     * Adds service-specific client built-in values\n     *\n     * @return void\n     */\n    private function addBuiltIns($args)\n    {\n        if ($args['region'] !== 'us-east-1') {\n            return false;\n        }\n        $key = 'AWS::S3::UseGlobalEndpoint';\n        $result = $args['s3_us_east_1_regional_endpoint'] instanceof \\Closure ?\n            $args['s3_us_east_1_regional_endpoint']()->wait() : $args['s3_us_east_1_regional_endpoint'];\n\n        if (is_string($result)) {\n            if ($result === 'regional') {\n                $value = false;\n            } else if ($result === 'legacy') {\n                $value = true;\n            } else {\n                return;\n            }\n        } else {\n            if ($result->isFallback()\n                || $result->getEndpointsType() === 'legacy'\n            ) {\n                $value = true;\n            } else {\n                $value = false;\n            }\n        }\n        $this->clientBuiltIns[$key] = $value;\n    }\n\n    /** @internal */\n    public static function _applyRetryConfig($value, $args, HandlerList $list)\n    {\n        if ($value) {\n            $config = \\Aws\\Retry\\ConfigurationProvider::unwrap($value);\n\n            if ($config->getMode() === 'legacy') {\n                $maxRetries = $config->getMaxAttempts() - 1;\n                $decider = RetryMiddleware::createDefaultDecider($maxRetries);\n                $decider = function ($retries, $command, $request, $result, $error) use ($decider, $maxRetries) {\n                    $maxRetries = null !== $command['@retries']\n                        ? $command['@retries']\n                        : $maxRetries;\n\n                    if ($decider($retries, $command, $request, $result, $error)) {\n                        return true;\n                    }\n\n                    if ($error instanceof AwsException\n                        && $retries < $maxRetries\n                    ) {\n                        if ($error->getResponse()\n                            && $error->getResponse()->getStatusCode() >= 400\n                        ) {\n                            return strpos(\n                                    $error->getResponse()->getBody(),\n                                    'Your socket connection to the server'\n                                ) !== false;\n                        }\n\n                        if ($error->getPrevious() instanceof RequestException) {\n                            // All commands except CompleteMultipartUpload are\n                            // idempotent and may be retried without worry if a\n                            // networking error has occurred.\n                            return $command->getName() !== 'CompleteMultipartUpload';\n                        }\n                    }\n\n                    return false;\n                };\n\n                $delay = [RetryMiddleware::class, 'exponentialDelay'];\n                $list->appendSign(Middleware::retry($decider, $delay), 'retry');\n            } else {\n                $defaultDecider = RetryMiddlewareV2::createDefaultDecider(\n                    new QuotaManager(),\n                    $config->getMaxAttempts()\n                );\n\n                $list->appendSign(\n                    RetryMiddlewareV2::wrap(\n                        $config,\n                        [\n                            'collect_stats' => $args['stats']['retries'],\n                            'decider' => function(\n                                $attempts,\n                                CommandInterface $cmd,\n                                $result\n                            ) use ($defaultDecider, $config) {\n                                $isRetryable = $defaultDecider($attempts, $cmd, $result);\n                                if (!$isRetryable\n                                    && $result instanceof AwsException\n                                    && $attempts < $config->getMaxAttempts()\n                                ) {\n                                    if (!empty($result->getResponse())\n                                        && $result->getResponse()->getStatusCode() >= 400\n                                    ) {\n                                        return strpos(\n                                                $result->getResponse()->getBody(),\n                                                'Your socket connection to the server'\n                                            ) !== false;\n                                    }\n\n                                    if ($result->getPrevious() instanceof RequestException\n                                        && $cmd->getName() !== 'CompleteMultipartUpload'\n                                    ) {\n                                        $isRetryable = true;\n                                    }\n                                }\n\n                                return $isRetryable;\n                            }\n                        ]\n                    ),\n                    'retry'\n                );\n            }\n        }\n    }\n\n    /** @internal */\n    public static function _applyApiProvider($value, array &$args, HandlerList $list)\n    {\n        ClientResolver::_apply_api_provider($value, $args);\n        $args['parser'] = new GetBucketLocationParser(\n            new ValidateResponseChecksumParser(\n                new AmbiguousSuccessParser(\n                    new RetryableMalformedResponseParser(\n                        $args['parser'],\n                        $args['exception_class']\n                    ),\n                    $args['error_parser'],\n                    $args['exception_class']\n                ),\n                $args['api']\n            )\n        );\n    }\n\n    /**\n     * @internal\n     * @codeCoverageIgnore\n     */\n    public static function applyDocFilters(array $api, array $docs)\n    {\n        $b64 = '<div class=\"alert alert-info\">This value will be base64 encoded on your behalf.</div>';\n        $opt = '<div class=\"alert alert-info\">This value will be computed for you it is not supplied.</div>';\n\n        // Add a note on the CopyObject docs\n         $s3ExceptionRetryMessage = \"<p>Additional info on response behavior: if there is\"\n            . \" an internal error in S3 after the request was successfully recieved,\"\n            . \" a 200 response will be returned with an <code>S3Exception</code> embedded\"\n            . \" in it; this will still be caught and retried by\"\n            . \" <code>RetryMiddleware.</code></p>\";\n\n        $docs['operations']['CopyObject'] .=  $s3ExceptionRetryMessage;\n        $docs['operations']['CompleteMultipartUpload'] .=  $s3ExceptionRetryMessage;\n        $docs['operations']['UploadPartCopy'] .=  $s3ExceptionRetryMessage;\n        $docs['operations']['UploadPart'] .=  $s3ExceptionRetryMessage;\n\n        // Add note about stream ownership in the putObject call\n        $guzzleStreamMessage = \"<p>Additional info on behavior of the stream\"\n            . \" parameters: Psr7 takes ownership of streams and will automatically close\"\n            . \" streams when this method is called with a stream as the <code>Body</code>\"\n            . \" parameter.  To prevent this, set the <code>Body</code> using\"\n            . \" <code>GuzzleHttp\\Psr7\\stream_for</code> method with a is an instance of\"\n            . \" <code>Psr\\Http\\Message\\StreamInterface</code>, and it will be returned\"\n            . \" unmodified. This will allow you to keep the stream in scope. </p>\";\n        $docs['operations']['PutObject'] .=  $guzzleStreamMessage;\n\n        // Add the SourceFile parameter.\n        $docs['shapes']['SourceFile']['base'] = 'The path to a file on disk to use instead of the Body parameter.';\n        $api['shapes']['SourceFile'] = ['type' => 'string'];\n        $api['shapes']['PutObjectRequest']['members']['SourceFile'] = ['shape' => 'SourceFile'];\n        $api['shapes']['UploadPartRequest']['members']['SourceFile'] = ['shape' => 'SourceFile'];\n\n        // Add the ContentSHA256 parameter.\n        $docs['shapes']['ContentSHA256']['base'] = 'A SHA256 hash of the body content of the request.';\n        $api['shapes']['ContentSHA256'] = ['type' => 'string'];\n        $api['shapes']['PutObjectRequest']['members']['ContentSHA256'] = ['shape' => 'ContentSHA256'];\n        $api['shapes']['UploadPartRequest']['members']['ContentSHA256'] = ['shape' => 'ContentSHA256'];\n        $docs['shapes']['ContentSHA256']['append'] = $opt;\n\n        // Add the AddContentMD5 parameter.\n        $docs['shapes']['AddContentMD5']['base'] = 'Set to true to calculate the ContentMD5 for the upload.';\n        $api['shapes']['AddContentMD5'] = ['type' => 'boolean'];\n        $api['shapes']['PutObjectRequest']['members']['AddContentMD5'] = ['shape' => 'AddContentMD5'];\n        $api['shapes']['UploadPartRequest']['members']['AddContentMD5'] = ['shape' => 'AddContentMD5'];\n\n        // Add the SaveAs parameter.\n        $docs['shapes']['SaveAs']['base'] = 'The path to a file on disk to save the object data.';\n        $api['shapes']['SaveAs'] = ['type' => 'string'];\n        $api['shapes']['GetObjectRequest']['members']['SaveAs'] = ['shape' => 'SaveAs'];\n\n        // Several SSECustomerKey documentation updates.\n        $docs['shapes']['SSECustomerKey']['append'] = $b64;\n        $docs['shapes']['CopySourceSSECustomerKey']['append'] = $b64;\n        $docs['shapes']['SSECustomerKeyMd5']['append'] = $opt;\n\n        // Add the ObjectURL to various output shapes and documentation.\n        $docs['shapes']['ObjectURL']['base'] = 'The URI of the created object.';\n        $api['shapes']['ObjectURL'] = ['type' => 'string'];\n        $api['shapes']['PutObjectOutput']['members']['ObjectURL'] = ['shape' => 'ObjectURL'];\n        $api['shapes']['CopyObjectOutput']['members']['ObjectURL'] = ['shape' => 'ObjectURL'];\n        $api['shapes']['CompleteMultipartUploadOutput']['members']['ObjectURL'] = ['shape' => 'ObjectURL'];\n\n        // Fix references to Location Constraint.\n        unset($api['shapes']['CreateBucketRequest']['payload']);\n        $api['shapes']['BucketLocationConstraint']['enum'] = [\n            \"ap-northeast-1\",\n            \"ap-southeast-2\",\n            \"ap-southeast-1\",\n            \"cn-north-1\",\n            \"eu-central-1\",\n            \"eu-west-1\",\n            \"us-east-1\",\n            \"us-west-1\",\n            \"us-west-2\",\n            \"sa-east-1\",\n        ];\n\n        // Add a note that the ContentMD5 is automatically computed, except for with PutObject and UploadPart\n        $docs['shapes']['ContentMD5']['append'] = '<div class=\"alert alert-info\">The value will be computed on '\n            . 'your behalf.</div>';\n        $docs['shapes']['ContentMD5']['excludeAppend'] = ['PutObjectRequest', 'UploadPartRequest'];\n\n        //Add a note to ContentMD5 for PutObject and UploadPart that specifies the value is required\n        // When uploading to a bucket with object lock enabled and that it is not computed automatically\n        $objectLock = '<div class=\"alert alert-info\">This value is required if uploading to a bucket '\n            . 'which has Object Lock enabled. It will not be calculated for you automatically. If you wish to have '\n            . 'the value calculated for you, use the `AddContentMD5` parameter.</div>';\n        $docs['shapes']['ContentMD5']['appendOnly'] = [\n            'message' => $objectLock,\n            'shapes' => ['PutObjectRequest', 'UploadPartRequest']\n        ];\n\n        return [\n            new Service($api, ApiProvider::defaultProvider()),\n            new DocModel($docs)\n        ];\n    }\n\n    /**\n     * @internal\n     * @codeCoverageIgnore\n     */\n    public static function addDocExamples($examples)\n    {\n        $getObjectExample = [\n            'input' => [\n                'Bucket' => 'arn:aws:s3:us-east-1:123456789012:accesspoint:myaccesspoint',\n                'Key' => 'my-key'\n            ],\n            'output' => [\n                'Body' => 'class GuzzleHttp\\Psr7\\Stream#208 (7) {...}',\n                'ContentLength' => '11',\n                'ContentType' => 'application/octet-stream',\n            ],\n            'comments' => [\n                'input' => '',\n                'output' => 'Simplified example output'\n            ],\n            'description' => 'The following example retrieves an object by referencing the bucket via an S3 accesss point ARN. Result output is simplified for the example.',\n            'id' => '',\n            'title' => 'To get an object via an S3 access point ARN'\n        ];\n        if (isset($examples['GetObject'])) {\n            $examples['GetObject'] []= $getObjectExample;\n        } else {\n            $examples['GetObject'] = [$getObjectExample];\n        }\n\n        $putObjectExample = [\n            'input' => [\n                'Bucket' => 'arn:aws:s3:us-east-1:123456789012:accesspoint:myaccesspoint',\n                'Key' => 'my-key',\n                'Body' => 'my-body',\n            ],\n            'output' => [\n                'ObjectURL' => 'https://my-bucket.s3.us-east-1.amazonaws.com/my-key'\n            ],\n            'comments' => [\n                'input' => '',\n                'output' => 'Simplified example output'\n            ],\n            'description' => 'The following example uploads an object by referencing the bucket via an S3 accesss point ARN. Result output is simplified for the example.',\n            'id' => '',\n            'title' => 'To upload an object via an S3 access point ARN'\n        ];\n        if (isset($examples['PutObject'])) {\n            $examples['PutObject'] []= $putObjectExample;\n        } else {\n            $examples['PutObject'] = [$putObjectExample];\n        }\n\n        return $examples;\n    }\n}\n", "num_lines": 1025}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\AwsClientInterface;\nuse Aws\\CommandInterface;\nuse Aws\\ResultInterface;\nuse Aws\\S3\\Exception\\S3Exception;\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\ninterface S3ClientInterface extends AwsClientInterface\n{\n    /**\n     * Create a pre-signed URL for the given S3 command object.\n     *\n     * @param CommandInterface              $command Command to create a pre-signed\n     *                                               URL for.\n     * @param int|string|\\DateTimeInterface $expires The time at which the URL should\n     *                                               expire. This can be a Unix\n     *                                               timestamp, a PHP DateTime object,\n     *                                               or a string that can be evaluated\n     *                                               by strtotime().\n     *\n     * @return RequestInterface\n     */\n    public function createPresignedRequest(CommandInterface $command, $expires, array $options = []);\n\n    /**\n     * Returns the URL to an object identified by its bucket and key.\n     *\n     * The URL returned by this method is not signed nor does it ensure that the\n     * bucket and key given to the method exist. If you need a signed URL, then\n     * use the {@see \\Aws\\S3\\S3Client::createPresignedRequest} method and get\n     * the URI of the signed request.\n     *\n     * @param string $bucket  The name of the bucket where the object is located\n     * @param string $key     The key of the object\n     *\n     * @return string The URL to the object\n     */\n    public function getObjectUrl($bucket, $key);\n\n    /**\n     * @deprecated Use doesBucketExistV2() instead\n     *\n     * Determines whether or not a bucket exists by name.\n     *\n     * @param string $bucket  The name of the bucket\n     *\n     * @return bool\n     */\n    public function doesBucketExist($bucket);\n\n    /**\n     * Determines whether or not a bucket exists by name. This method uses S3's\n     * HeadBucket operation and requires the relevant bucket permissions in the\n     * default case to prevent errors.\n     *\n     * @param string $bucket  The name of the bucket\n     * @param bool $accept403 Set to true for this method to return true in the case of\n     *                        invalid bucket-level permissions. Credentials MUST be valid\n     *                        to avoid inaccuracies. Using the default value of false will\n     *                        cause an exception to be thrown instead.\n     *\n     * @return bool\n     * @throws S3Exception|\\Exception if there is an unhandled exception\n     */\n    public function doesBucketExistV2($bucket, $accept403);\n\n    /**\n     * @deprecated Use doesObjectExistV2() instead\n     *\n     * Determines whether or not an object exists by name.\n     *\n     * @param string $bucket  The name of the bucket\n     * @param string $key     The key of the object\n     * @param array  $options Additional options available in the HeadObject\n     *                        operation (e.g., VersionId).\n     *\n     * @return bool\n     */\n    public function doesObjectExist($bucket, $key, array $options = []);\n\n    /**\n     * Determines whether or not an object exists by name. This method uses S3's HeadObject\n     * operation and requires the relevant bucket and object permissions to prevent errors.\n     *\n     * @param string $bucket The name of the bucket\n     * @param string $key The key of the object\n     * @param bool $includeDeleteMarkers Set to true to consider delete markers\n     *                                   existing objects. Using the default value\n     *                                   of false will ignore delete markers and\n     *                                   return false.\n     * @param array $options Additional options available in the HeadObject\n     *                        operation (e.g., VersionId).\n     *\n     * @return bool\n     * @throws S3Exception|\\Exception if there is an unhandled exception\n     */\n    public function doesObjectExistV2($bucket, $key, $includeDeleteMarkers = false, array $options = []);\n\n    /**\n     * Register the Amazon S3 stream wrapper with this client instance.\n     */\n    public function registerStreamWrapper();\n\n    /**\n     * Registers the Amazon S3 stream wrapper with this client instance.\n     *\n     *This version uses doesObjectExistV2 and doesBucketExistV2 to check\n     * resource existence.\n     */\n    public function registerStreamWrapperV2();\n\n    /**\n     * Deletes objects from Amazon S3 that match the result of a ListObjects\n     * operation. For example, this allows you to do things like delete all\n     * objects that match a specific key prefix.\n     *\n     * @param string $bucket  Bucket that contains the object keys\n     * @param string $prefix  Optionally delete only objects under this key prefix\n     * @param string $regex   Delete only objects that match this regex\n     * @param array  $options Aws\\S3\\BatchDelete options array.\n     *\n     * @see Aws\\S3\\S3Client::listObjects\n     * @throws \\RuntimeException if no prefix and no regex is given\n     */\n    public function deleteMatchingObjects(\n        $bucket,\n        $prefix = '',\n        $regex = '',\n        array $options = []\n    );\n\n    /**\n     * Deletes objects from Amazon S3 that match the result of a ListObjects\n     * operation. For example, this allows you to do things like delete all\n     * objects that match a specific key prefix.\n     *\n     * @param string $bucket  Bucket that contains the object keys\n     * @param string $prefix  Optionally delete only objects under this key prefix\n     * @param string $regex   Delete only objects that match this regex\n     * @param array  $options Aws\\S3\\BatchDelete options array.\n     *\n     * @see Aws\\S3\\S3Client::listObjects\n     *\n     * @return PromiseInterface     A promise that is settled when matching\n     *                              objects are deleted.\n     */\n    public function deleteMatchingObjectsAsync(\n        $bucket,\n        $prefix = '',\n        $regex = '',\n        array $options = []\n    );\n\n    /**\n     * Upload a file, stream, or string to a bucket.\n     *\n     * If the upload size exceeds the specified threshold, the upload will be\n     * performed using concurrent multipart uploads.\n     *\n     * The options array accepts the following options:\n     *\n     * - before_upload: (callable) Callback to invoke before any upload\n     *   operations during the upload process. The callback should have a\n     *   function signature like `function (Aws\\Command $command) {...}`.\n     * - concurrency: (int, default=int(3)) Maximum number of concurrent\n     *   `UploadPart` operations allowed during a multipart upload.\n     * - mup_threshold: (int, default=int(16777216)) The size, in bytes, allowed\n     *   before the upload must be sent via a multipart upload. Default: 16 MB.\n     * - params: (array, default=array([])) Custom parameters to use with the\n     *   upload. For single uploads, they must correspond to those used for the\n     *   `PutObject` operation. For multipart uploads, they correspond to the\n     *   parameters of the `CreateMultipartUpload` operation.\n     * - part_size: (int) Part size to use when doing a multipart upload.\n     *\n     * @param string $bucket  Bucket to upload the object.\n     * @param string $key     Key of the object.\n     * @param mixed  $body    Object data to upload. Can be a\n     *                        StreamInterface, PHP stream resource, or a\n     *                        string of data to upload.\n     * @param string $acl     ACL to apply to the object (default: private).\n     * @param array  $options Options used to configure the upload process.\n     *\n     * @see Aws\\S3\\MultipartUploader for more info about multipart uploads.\n     * @return ResultInterface Returns the result of the upload.\n     */\n    public function upload(\n        $bucket,\n        $key,\n        $body,\n        $acl = 'private',\n        array $options = []\n    );\n\n    /**\n     * Upload a file, stream, or string to a bucket asynchronously.\n     *\n     * @param string $bucket  Bucket to upload the object.\n     * @param string $key     Key of the object.\n     * @param mixed  $body    Object data to upload. Can be a\n     *                        StreamInterface, PHP stream resource, or a\n     *                        string of data to upload.\n     * @param string $acl     ACL to apply to the object (default: private).\n     * @param array  $options Options used to configure the upload process.\n     *\n     * @see self::upload\n     * @return PromiseInterface     Returns a promise that will be fulfilled\n     *                              with the result of the upload.\n     */\n    public function uploadAsync(\n        $bucket,\n        $key,\n        $body,\n        $acl = 'private',\n        array $options = []\n    );\n\n    /**\n     * Copy an object of any size to a different location.\n     *\n     * If the upload size exceeds the maximum allowable size for direct S3\n     * copying, a multipart copy will be used.\n     *\n     * The options array accepts the following options:\n     *\n     * - before_upload: (callable) Callback to invoke before any upload\n     *   operations during the upload process. The callback should have a\n     *   function signature like `function (Aws\\Command $command) {...}`.\n     * - concurrency: (int, default=int(5)) Maximum number of concurrent\n     *   `UploadPart` operations allowed during a multipart upload.\n     * - params: (array, default=array([])) Custom parameters to use with the\n     *   upload. For single uploads, they must correspond to those used for the\n     *   `CopyObject` operation. For multipart uploads, they correspond to the\n     *   parameters of the `CreateMultipartUpload` operation.\n     * - part_size: (int) Part size to use when doing a multipart upload.\n     *\n     * @param string $fromBucket    Bucket where the copy source resides.\n     * @param string $fromKey       Key of the copy source.\n     * @param string $destBucket    Bucket to which to copy the object.\n     * @param string $destKey       Key to which to copy the object.\n     * @param string $acl           ACL to apply to the copy (default: private).\n     * @param array  $options       Options used to configure the upload process.\n     *\n     * @see Aws\\S3\\MultipartCopy for more info about multipart uploads.\n     * @return ResultInterface Returns the result of the copy.\n     */\n    public function copy(\n        $fromBucket,\n        $fromKey,\n        $destBucket,\n        $destKey,\n        $acl = 'private',\n        array $options = []\n    );\n\n    /**\n     * Copy an object of any size to a different location asynchronously.\n     *\n     * @param string $fromBucket    Bucket where the copy source resides.\n     * @param string $fromKey       Key of the copy source.\n     * @param string $destBucket    Bucket to which to copy the object.\n     * @param string $destKey       Key to which to copy the object.\n     * @param string $acl           ACL to apply to the copy (default: private).\n     * @param array  $options       Options used to configure the upload process.\n     *\n     * @see self::copy for more info about the parameters above.\n     * @return PromiseInterface     Returns a promise that will be fulfilled\n     *                              with the result of the copy.\n     */\n    public function copyAsync(\n        $fromBucket,\n        $fromKey,\n        $destBucket,\n        $destKey,\n        $acl = 'private',\n        array $options = []\n    );\n\n    /**\n     * Recursively uploads all files in a given directory to a given bucket.\n     *\n     * @param string $directory Full path to a directory to upload\n     * @param string $bucket    Name of the bucket\n     * @param string $keyPrefix Virtual directory key prefix to add to each upload\n     * @param array  $options   Options available in Aws\\S3\\Transfer::__construct\n     *\n     * @see Aws\\S3\\Transfer for more options and customization\n     */\n    public function uploadDirectory(\n        $directory,\n        $bucket,\n        $keyPrefix = null,\n        array $options = []\n    );\n\n    /**\n     * Recursively uploads all files in a given directory to a given bucket.\n     *\n     * @param string $directory Full path to a directory to upload\n     * @param string $bucket    Name of the bucket\n     * @param string $keyPrefix Virtual directory key prefix to add to each upload\n     * @param array  $options   Options available in Aws\\S3\\Transfer::__construct\n     *\n     * @see Aws\\S3\\Transfer for more options and customization\n     *\n     * @return PromiseInterface A promise that is settled when the upload is\n     *                          complete.\n     */\n    public function uploadDirectoryAsync(\n        $directory,\n        $bucket,\n        $keyPrefix = null,\n        array $options = []\n    );\n\n    /**\n     * Downloads a bucket to the local filesystem\n     *\n     * @param string $directory Directory to download to\n     * @param string $bucket    Bucket to download from\n     * @param string $keyPrefix Only download objects that use this key prefix\n     * @param array  $options   Options available in Aws\\S3\\Transfer::__construct\n     */\n    public function downloadBucket(\n        $directory,\n        $bucket,\n        $keyPrefix = '',\n        array $options = []\n    );\n\n    /**\n     * Downloads a bucket to the local filesystem\n     *\n     * @param string $directory Directory to download to\n     * @param string $bucket    Bucket to download from\n     * @param string $keyPrefix Only download objects that use this key prefix\n     * @param array  $options   Options available in Aws\\S3\\Transfer::__construct\n     *\n     * @return PromiseInterface A promise that is settled when the download is\n     *                          complete.\n     */\n    public function downloadBucketAsync(\n        $directory,\n        $bucket,\n        $keyPrefix = '',\n        array $options = []\n    );\n\n    /**\n     * Returns the region in which a given bucket is located.\n     *\n     * @param string $bucketName\n     *\n     * @return string\n     */\n    public function determineBucketRegion($bucketName);\n\n    /**\n     * Returns a promise fulfilled with the region in which a given bucket is\n     * located.\n     *\n     * @param string $bucketName\n     *\n     * @return PromiseInterface\n     */\n    public function determineBucketRegionAsync($bucketName);\n}\n", "num_lines": 370}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\Api\\Parser\\PayloadParserTrait;\nuse Aws\\CommandInterface;\nuse Aws\\Exception\\AwsException;\nuse Aws\\HandlerList;\nuse Aws\\ResultInterface;\nuse Aws\\S3\\Exception\\PermanentRedirectException;\nuse Aws\\S3\\Exception\\S3Exception;\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse GuzzleHttp\\Promise\\RejectedPromise;\nuse Psr\\Http\\Message\\ResponseInterface;\n\n/**\n * A trait providing S3-specific functionality. This is meant to be used in\n * classes implementing \\Aws\\S3\\S3ClientInterface\n */\ntrait S3ClientTrait\n{\n    use PayloadParserTrait;\n\n    /**\n     * @see S3ClientInterface::upload()\n     */\n    public function upload(\n        $bucket,\n        $key,\n        $body,\n        $acl = 'private',\n        array $options = []\n    ) {\n        return $this\n            ->uploadAsync($bucket, $key, $body, $acl, $options)\n            ->wait();\n    }\n\n    /**\n     * @see S3ClientInterface::uploadAsync()\n     */\n    public function uploadAsync(\n        $bucket,\n        $key,\n        $body,\n        $acl = 'private',\n        array $options = []\n    ) {\n        return (new ObjectUploader($this, $bucket, $key, $body, $acl, $options))\n            ->promise();\n    }\n\n    /**\n     * @see S3ClientInterface::copy()\n     */\n    public function copy(\n        $fromB,\n        $fromK,\n        $destB,\n        $destK,\n        $acl = 'private',\n        array $opts = []\n    ) {\n        return $this->copyAsync($fromB, $fromK, $destB, $destK, $acl, $opts)\n            ->wait();\n    }\n\n    /**\n     * @see S3ClientInterface::copyAsync()\n     */\n    public function copyAsync(\n        $fromB,\n        $fromK,\n        $destB,\n        $destK,\n        $acl = 'private',\n        array $opts = []\n    ) {\n        $source = [\n            'Bucket' => $fromB,\n            'Key' => $fromK,\n        ];\n        if (isset($opts['version_id'])) {\n            $source['VersionId'] = $opts['version_id'];\n        }\n        $destination = [\n            'Bucket' => $destB,\n            'Key' => $destK\n        ];\n\n        return (new ObjectCopier($this, $source, $destination, $acl, $opts))\n            ->promise();\n    }\n\n    /**\n     * @see S3ClientInterface::registerStreamWrapper()\n     */\n    public function registerStreamWrapper()\n    {\n        StreamWrapper::register($this);\n    }\n\n    /**\n     * @see S3ClientInterface::registerStreamWrapperV2()\n     */\n    public function registerStreamWrapperV2()\n    {\n        StreamWrapper::register(\n            $this,\n            's3',\n            null,\n            true\n        );\n    }\n\n    /**\n     * @see S3ClientInterface::deleteMatchingObjects()\n     */\n    public function deleteMatchingObjects(\n        $bucket,\n        $prefix = '',\n        $regex = '',\n        array $options = []\n    ) {\n        $this->deleteMatchingObjectsAsync($bucket, $prefix, $regex, $options)\n            ->wait();\n    }\n\n    /**\n     * @see S3ClientInterface::deleteMatchingObjectsAsync()\n     */\n    public function deleteMatchingObjectsAsync(\n        $bucket,\n        $prefix = '',\n        $regex = '',\n        array $options = []\n    ) {\n        if (!$prefix && !$regex) {\n            return new RejectedPromise(\n                new \\RuntimeException('A prefix or regex is required.')\n            );\n        }\n\n        $params = ['Bucket' => $bucket, 'Prefix' => $prefix];\n        $iter = $this->getIterator('ListObjects', $params);\n\n        if ($regex) {\n            $iter = \\Aws\\filter($iter, function ($c) use ($regex) {\n                return preg_match($regex, $c['Key']);\n            });\n        }\n\n        return BatchDelete::fromIterator($this, $bucket, $iter, $options)\n            ->promise();\n    }\n\n    /**\n     * @see S3ClientInterface::uploadDirectory()\n     */\n    public function uploadDirectory(\n        $directory,\n        $bucket,\n        $keyPrefix = null,\n        array $options = []\n    ) {\n        $this->uploadDirectoryAsync($directory, $bucket, $keyPrefix, $options)\n            ->wait();\n    }\n\n    /**\n     * @see S3ClientInterface::uploadDirectoryAsync()\n     */\n    public function uploadDirectoryAsync(\n        $directory,\n        $bucket,\n        $keyPrefix = null,\n        array $options = []\n    ) {\n        $d = \"s3://$bucket\" . ($keyPrefix ? '/' . ltrim($keyPrefix, '/') : '');\n        return (new Transfer($this, $directory, $d, $options))->promise();\n    }\n\n    /**\n     * @see S3ClientInterface::downloadBucket()\n     */\n    public function downloadBucket(\n        $directory,\n        $bucket,\n        $keyPrefix = '',\n        array $options = []\n    ) {\n        $this->downloadBucketAsync($directory, $bucket, $keyPrefix, $options)\n            ->wait();\n    }\n\n    /**\n     * @see S3ClientInterface::downloadBucketAsync()\n     */\n    public function downloadBucketAsync(\n        $directory,\n        $bucket,\n        $keyPrefix = '',\n        array $options = []\n    ) {\n        $s = \"s3://$bucket\" . ($keyPrefix ? '/' . ltrim($keyPrefix, '/') : '');\n        return (new Transfer($this, $s, $directory, $options))->promise();\n    }\n\n    /**\n     * @see S3ClientInterface::determineBucketRegion()\n     */\n    public function determineBucketRegion($bucketName)\n    {\n        return $this->determineBucketRegionAsync($bucketName)->wait();\n    }\n\n    /**\n     * @see S3ClientInterface::determineBucketRegionAsync()\n     *\n     * @param string $bucketName\n     *\n     * @return PromiseInterface\n     */\n    public function determineBucketRegionAsync($bucketName)\n    {\n        $command = $this->getCommand('HeadBucket', ['Bucket' => $bucketName]);\n        $handlerList = clone $this->getHandlerList();\n        $handlerList->remove('s3.permanent_redirect');\n        $handlerList->remove('signer');\n        $handler = $handlerList->resolve();\n\n        return $handler($command)\n            ->then(static function (ResultInterface $result) {\n                return $result['@metadata']['headers']['x-amz-bucket-region'];\n            }, function (AwsException $e) {\n                $response = $e->getResponse();\n                if ($response === null) {\n                    throw $e;\n                }\n\n                if ($e->getAwsErrorCode() === 'AuthorizationHeaderMalformed') {\n                    $region = $this->determineBucketRegionFromExceptionBody(\n                        $response\n                    );\n                    if (!empty($region)) {\n                        return $region;\n                    }\n                    throw $e;\n                }\n\n                return $response->getHeaderLine('x-amz-bucket-region');\n            });\n    }\n\n    private function determineBucketRegionFromExceptionBody(ResponseInterface $response)\n    {\n        try {\n            $element = $this->parseXml($response->getBody(), $response);\n            if (!empty($element->Region)) {\n                return (string)$element->Region;\n            }\n        } catch (\\Exception $e) {\n            // Fallthrough on exceptions from parsing\n        }\n        return false;\n    }\n\n    /**\n     * @see S3ClientInterface::doesBucketExist()\n     */\n    public function doesBucketExist($bucket)\n    {\n        return $this->checkExistenceWithCommand(\n            $this->getCommand('HeadBucket', ['Bucket' => $bucket])\n        );\n    }\n\n    /**\n     * @see S3ClientInterface::doesBucketExistV2()\n     */\n    public function doesBucketExistV2($bucket, $accept403 = false)\n    {\n        $command = $this->getCommand('HeadBucket', ['Bucket' => $bucket]);\n\n        try {\n            $this->execute($command);\n            return true;\n        } catch (S3Exception $e) {\n            if (\n                ($accept403 && $e->getStatusCode() === 403)\n                || $e instanceof PermanentRedirectException\n            ) {\n                return true;\n            }\n            if ($e->getStatusCode() === 404)  {\n                return false;\n            }\n            throw $e;\n        }\n    }\n\n    /**\n     * @see S3ClientInterface::doesObjectExist()\n     */\n    public function doesObjectExist($bucket, $key, array $options = [])\n    {\n        return $this->checkExistenceWithCommand(\n            $this->getCommand('HeadObject', [\n                    'Bucket' => $bucket,\n                    'Key'    => $key\n                ] + $options)\n        );\n    }\n\n    /**\n     * @see S3ClientInterface::doesObjectExistV2()\n     */\n    public function doesObjectExistV2(\n        $bucket,\n        $key,\n        $includeDeleteMarkers = false,\n        array $options = []\n    ){\n        $command = $this->getCommand('HeadObject', [\n                'Bucket' => $bucket,\n                'Key'    => $key\n            ] + $options\n        );\n\n        try {\n            $this->execute($command);\n            return true;\n        } catch (S3Exception $e) {\n            if ($includeDeleteMarkers\n                && $this->useDeleteMarkers($e)\n            ) {\n                return true;\n            }\n            if ($e->getStatusCode() === 404) {\n                return false;\n            }\n            throw $e;\n        }\n    }\n\n    private function useDeleteMarkers($exception)\n    {\n        $response = $exception->getResponse();\n        return !empty($response)\n            && $response->getHeader('x-amz-delete-marker');\n    }\n\n    /**\n     * Determines whether or not a resource exists using a command\n     *\n     * @param CommandInterface $command Command used to poll for the resource\n     *\n     * @return bool\n     * @throws S3Exception|\\Exception if there is an unhandled exception\n     */\n    private function checkExistenceWithCommand(CommandInterface $command)\n    {\n        try {\n            $this->execute($command);\n            return true;\n        } catch (S3Exception $e) {\n            if ($e->getAwsErrorCode() == 'AccessDenied') {\n                return true;\n            }\n            if ($e->getStatusCode() >= 500) {\n                throw $e;\n            }\n            return false;\n        }\n    }\n\n    /**\n     * @see S3ClientInterface::execute()\n     */\n    abstract public function execute(CommandInterface $command);\n\n    /**\n     * @see S3ClientInterface::getCommand()\n     */\n    abstract public function getCommand($name, array $args = []);\n\n    /**\n     * @see S3ClientInterface::getHandlerList()\n     *\n     * @return HandlerList\n     */\n    abstract public function getHandlerList();\n\n    /**\n     * @see S3ClientInterface::getIterator()\n     *\n     * @return \\Iterator\n     */\n    abstract public function getIterator($name, array $args = []);\n}\n", "num_lines": 400}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\Arn\\ArnParser;\nuse Aws\\Arn\\ObjectLambdaAccessPointArn;\nuse Aws\\ClientResolver;\nuse Aws\\CommandInterface;\nuse Aws\\Endpoint\\EndpointProvider;\nuse Aws\\Endpoint\\PartitionEndpointProvider;\nuse GuzzleHttp\\Exception\\InvalidArgumentException;\nuse GuzzleHttp\\Psr7\\Uri;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Used to update the URL used for S3 requests to support:\n * S3 Accelerate, S3 DualStack or Both. It will build to\n * host style paths unless specified, including for S3\n * DualStack.\n *\n * IMPORTANT: this middleware must be added after the \"build\" step.\n *\n * @internal\n */\nclass S3EndpointMiddleware\n{\n    private static $exclusions = [\n        'CreateBucket' => true,\n        'DeleteBucket' => true,\n        'ListBuckets' => true,\n    ];\n\n    const NO_PATTERN = 0;\n    const DUALSTACK = 1;\n    const ACCELERATE = 2;\n    const ACCELERATE_DUALSTACK = 3;\n    const PATH_STYLE = 4;\n    const HOST_STYLE = 5;\n\n    /** @var bool */\n    private $accelerateByDefault;\n    /** @var bool */\n    private $dualStackByDefault;\n    /** @var bool */\n    private $pathStyleByDefault;\n    /** @var string */\n    private $region;\n    /** @var callable */\n    private $endpointProvider;\n    /** @var callable */\n    private $nextHandler;\n    /** @var string */\n    private $endpoint;\n\n    /**\n     * Create a middleware wrapper function\n     *\n     * @param string $region\n     * @param EndpointProvider $endpointProvider\n     * @param array  $options\n     *\n     * @return callable\n     */\n    public static function wrap($region, $endpointProvider, array $options)\n    {\n        return function (callable $handler) use ($region, $endpointProvider, $options) {\n            return new self($handler, $region, $options, $endpointProvider);\n        };\n    }\n\n    public function __construct(\n        callable $nextHandler,\n        $region,\n        array $options,\n        $endpointProvider = null\n    ) {\n        $this->pathStyleByDefault = isset($options['path_style'])\n            ? (bool) $options['path_style'] : false;\n        $this->dualStackByDefault = isset($options['dual_stack'])\n            ? (bool) $options['dual_stack'] : false;\n        $this->accelerateByDefault = isset($options['accelerate'])\n            ? (bool) $options['accelerate'] : false;\n        $this->region = (string) $region;\n        $this->endpoint = isset($options['endpoint'])\n            ? $options['endpoint'] : \"\";\n        $this->endpointProvider = is_null($endpointProvider)\n            ? PartitionEndpointProvider::defaultProvider()\n            : $endpointProvider;\n        $this->nextHandler = $nextHandler;\n    }\n\n    public function __invoke(CommandInterface $command, RequestInterface $request)\n    {\n        if (!empty($this->endpoint)) {\n            $request = $this->applyEndpoint($command, $request);\n        } else {\n            switch ($this->endpointPatternDecider($command, $request)) {\n                case self::HOST_STYLE:\n                    $request = $this->applyHostStyleEndpoint($command, $request);\n                    break;\n                case self::NO_PATTERN:\n                    break;\n                case self::PATH_STYLE:\n                    $request = $this->applyPathStyleEndpointCustomizations($command, $request);\n                    break;\n                case self::DUALSTACK:\n                    $request = $this->applyDualStackEndpoint($command, $request);\n                    break;\n                case self::ACCELERATE:\n                    $request = $this->applyAccelerateEndpoint(\n                        $command,\n                        $request,\n                        's3-accelerate'\n                    );\n                    break;\n                case self::ACCELERATE_DUALSTACK:\n                    $request = $this->applyAccelerateEndpoint(\n                        $command,\n                        $request,\n                        's3-accelerate.dualstack'\n                    );\n                    break;\n            }\n        }\n        $nextHandler = $this->nextHandler;\n        return $nextHandler($command, $request);\n    }\n\n    private static function isRequestHostStyleCompatible(\n        CommandInterface $command,\n        RequestInterface $request\n    ) {\n        return S3Client::isBucketDnsCompatible($command['Bucket'])\n            && (\n                $request->getUri()->getScheme() === 'http'\n                || strpos($command['Bucket'], '.') === false\n            )\n            && filter_var($request->getUri()->getHost(), FILTER_VALIDATE_IP) === false;\n    }\n\n    private function endpointPatternDecider(\n        CommandInterface $command,\n        RequestInterface $request\n    ) {\n        $accelerate = isset($command['@use_accelerate_endpoint'])\n            ? $command['@use_accelerate_endpoint'] : $this->accelerateByDefault;\n        $dualStack = isset($command['@use_dual_stack_endpoint'])\n            ? $command['@use_dual_stack_endpoint'] : $this->dualStackByDefault;\n        $pathStyle = isset($command['@use_path_style_endpoint'])\n            ? $command['@use_path_style_endpoint'] : $this->pathStyleByDefault;\n\n        if ($accelerate && $dualStack) {\n            // When try to enable both for operations excluded from s3-accelerate,\n            // only dualstack endpoints will be enabled.\n            return $this->canAccelerate($command)\n                ? self::ACCELERATE_DUALSTACK\n                : self::DUALSTACK;\n        }\n\n        if ($accelerate && $this->canAccelerate($command)) {\n            return self::ACCELERATE;\n        }\n\n        if ($dualStack) {\n            return self::DUALSTACK;\n        }\n\n        if (!$pathStyle\n            && self::isRequestHostStyleCompatible($command, $request)\n        ) {\n            return self::HOST_STYLE;\n        }\n\n        return self::PATH_STYLE;\n    }\n\n    private function canAccelerate(CommandInterface $command)\n    {\n        return empty(self::$exclusions[$command->getName()])\n            && S3Client::isBucketDnsCompatible($command['Bucket']);\n    }\n\n    private function getBucketStyleHost(CommandInterface $command, $host)\n    {\n        // For operations on the base host (e.g. ListBuckets)\n        if (!isset($command['Bucket'])) {\n            return $host;\n        }\n\n        return \"{$command['Bucket']}.{$host}\";\n    }\n\n    private function applyHostStyleEndpoint(\n        CommandInterface $command,\n        RequestInterface $request\n    ) {\n        $uri = $request->getUri();\n        $request = $request->withUri(\n            $uri->withHost($this->getBucketStyleHost(\n                    $command,\n                    $uri->getHost()\n                ))\n                ->withPath($this->getBucketlessPath(\n                    $uri->getPath(),\n                    $command\n                ))\n        );\n        return $request;\n    }\n\n    private function applyPathStyleEndpointCustomizations(\n        CommandInterface $command,\n        RequestInterface $request\n    ) {\n        if ($command->getName() == 'WriteGetObjectResponse') {\n            $dnsSuffix = $this->endpointProvider\n                ->getPartition($this->region, 's3')\n                ->getDnsSuffix();\n            $fips = \\Aws\\is_fips_pseudo_region($this->region) ? \"-fips\" : \"\";\n            $region = \\Aws\\strip_fips_pseudo_regions($this->region);\n            $host =\n                \"{$command['RequestRoute']}.s3-object-lambda{$fips}.{$region}.{$dnsSuffix}\";\n\n            $uri = $request->getUri();\n            $request = $request->withUri(\n                $uri->withHost($host)\n                    ->withPath($this->getBucketlessPath(\n                        $uri->getPath(),\n                        $command\n                    ))\n            );\n        }\n        return $request;\n    }\n\n\n    private function applyDualStackEndpoint(\n        CommandInterface $command,\n        RequestInterface $request\n    ) {\n        $request = $request->withUri(\n            $request->getUri()->withHost($this->getDualStackHost())\n        );\n\n        if (empty($command['@use_path_style_endpoint'])\n            && !$this->pathStyleByDefault\n            && self::isRequestHostStyleCompatible($command, $request)\n        ) {\n            $request = $this->applyHostStyleEndpoint($command, $request);\n        }\n        return $request;\n    }\n\n    private function getDualStackHost()\n    {\n        $dnsSuffix = $this->endpointProvider\n            ->getPartition($this->region, 's3')\n            ->getDnsSuffix();\n        return \"s3.dualstack.{$this->region}.{$dnsSuffix}\";\n    }\n\n    private function applyAccelerateEndpoint(\n        CommandInterface $command,\n        RequestInterface $request,\n        $pattern\n    ) {\n        $request = $request->withUri(\n            $request->getUri()\n                ->withHost($this->getAccelerateHost($command, $pattern))\n                ->withPath($this->getBucketlessPath(\n                    $request->getUri()->getPath(),\n                    $command\n                ))\n        );\n        return $request;\n    }\n\n    private function getAccelerateHost(CommandInterface $command, $pattern)\n    {\n        $dnsSuffix = $this->endpointProvider\n            ->getPartition($this->region, 's3')\n            ->getDnsSuffix();\n        return \"{$command['Bucket']}.{$pattern}.{$dnsSuffix}\";\n    }\n\n    private function getBucketlessPath($path, CommandInterface $command)\n    {\n        $pattern = '/^\\\\/' . preg_quote($command['Bucket'], '/') . '/';\n        $path = preg_replace($pattern, '', $path) ?: '/';\n        if (substr($path, 0 , 1) !== '/') {\n            $path = '/' . $path;\n        }\n        return $path;\n    }\n\n    private function applyEndpoint(\n        CommandInterface $command,\n        RequestInterface $request\n    ) {\n        $dualStack = isset($command['@use_dual_stack_endpoint'])\n            ? $command['@use_dual_stack_endpoint'] : $this->dualStackByDefault;\n        if (ArnParser::isArn($command['Bucket'])) {\n            $arn = ArnParser::parse($command['Bucket']);\n            $outpost = $arn->getService() == 's3-outposts';\n            if ($outpost && $dualStack) {\n                throw new InvalidArgumentException(\"Outposts + dualstack is not supported\");\n            }\n            if ($arn instanceof ObjectLambdaAccessPointArn) {\n                return $request;\n            }\n        }\n        if ($dualStack) {\n            throw new InvalidArgumentException(\"Custom Endpoint + Dualstack not supported\");\n        }\n        if ($command->getName() == 'WriteGetObjectResponse') {\n            $host = \"{$command['RequestRoute']}.{$this->endpoint}\";\n            $uri = $request->getUri();\n            return $request = $request->withUri(\n                $uri->withHost($host)\n                    ->withPath($this->getBucketlessPath(\n                        $uri->getPath(),\n                        $command\n                    ))\n            );\n        }\n        $host = ($this->pathStyleByDefault) ?\n            $this->endpoint :\n            $this->getBucketStyleHost(\n                $command,\n                $this->endpoint\n            );\n        $uri = $request->getUri();\n        $scheme = $uri->getScheme();\n        if(empty($scheme)){\n            $request = $request->withUri(\n                $uri->withHost($host)\n            );\n        } else {\n            $request = $request->withUri($uri);\n        }\n\n        return $request;\n    }\n}\n", "num_lines": 344}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\CacheInterface;\nuse Aws\\CommandInterface;\nuse Aws\\LruArrayCache;\nuse Aws\\MultiRegionClient as BaseClient;\nuse Aws\\Exception\\AwsException;\nuse Aws\\S3\\Exception\\PermanentRedirectException;\nuse GuzzleHttp\\Promise;\n\n/**\n * **Amazon Simple Storage Service** multi-region client.\n *\n * @method \\Aws\\Result abortMultipartUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise abortMultipartUploadAsync(array $args = [])\n * @method \\Aws\\Result completeMultipartUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise completeMultipartUploadAsync(array $args = [])\n * @method \\Aws\\Result copyObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyObjectAsync(array $args = [])\n * @method \\Aws\\Result createBucket(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBucketAsync(array $args = [])\n * @method \\Aws\\Result createMultipartUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMultipartUploadAsync(array $args = [])\n * @method \\Aws\\Result deleteBucket(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketAnalyticsConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketAnalyticsConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketCors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketCorsAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketEncryption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketEncryptionAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketIntelligentTieringConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketIntelligentTieringConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketInventoryConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketInventoryConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketLifecycle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketLifecycleAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketMetricsConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketMetricsConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketOwnershipControls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketOwnershipControlsAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketReplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketReplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketTaggingAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketWebsite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketWebsiteAsync(array $args = [])\n * @method \\Aws\\Result deleteObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteObjectAsync(array $args = [])\n * @method \\Aws\\Result deleteObjectTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteObjectTaggingAsync(array $args = [])\n * @method \\Aws\\Result deleteObjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteObjectsAsync(array $args = [])\n * @method \\Aws\\Result deletePublicAccessBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePublicAccessBlockAsync(array $args = [])\n * @method \\Aws\\Result getBucketAccelerateConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketAccelerateConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getBucketAcl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketAclAsync(array $args = [])\n * @method \\Aws\\Result getBucketAnalyticsConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketAnalyticsConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getBucketCors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketCorsAsync(array $args = [])\n * @method \\Aws\\Result getBucketEncryption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketEncryptionAsync(array $args = [])\n * @method \\Aws\\Result getBucketIntelligentTieringConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketIntelligentTieringConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getBucketInventoryConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketInventoryConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getBucketLifecycle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketLifecycleAsync(array $args = [])\n * @method \\Aws\\Result getBucketLifecycleConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketLifecycleConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getBucketLocation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketLocationAsync(array $args = [])\n * @method \\Aws\\Result getBucketLogging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketLoggingAsync(array $args = [])\n * @method \\Aws\\Result getBucketMetricsConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketMetricsConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getBucketNotification(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketNotificationAsync(array $args = [])\n * @method \\Aws\\Result getBucketNotificationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketNotificationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getBucketOwnershipControls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketOwnershipControlsAsync(array $args = [])\n * @method \\Aws\\Result getBucketPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketPolicyAsync(array $args = [])\n * @method \\Aws\\Result getBucketPolicyStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketPolicyStatusAsync(array $args = [])\n * @method \\Aws\\Result getBucketReplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketReplicationAsync(array $args = [])\n * @method \\Aws\\Result getBucketRequestPayment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketRequestPaymentAsync(array $args = [])\n * @method \\Aws\\Result getBucketTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketTaggingAsync(array $args = [])\n * @method \\Aws\\Result getBucketVersioning(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketVersioningAsync(array $args = [])\n * @method \\Aws\\Result getBucketWebsite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketWebsiteAsync(array $args = [])\n * @method \\Aws\\Result getObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectAsync(array $args = [])\n * @method \\Aws\\Result getObjectAcl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectAclAsync(array $args = [])\n * @method \\Aws\\Result getObjectAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectAttributesAsync(array $args = [])\n * @method \\Aws\\Result getObjectLegalHold(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectLegalHoldAsync(array $args = [])\n * @method \\Aws\\Result getObjectLockConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectLockConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getObjectRetention(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectRetentionAsync(array $args = [])\n * @method \\Aws\\Result getObjectTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectTaggingAsync(array $args = [])\n * @method \\Aws\\Result getObjectTorrent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getObjectTorrentAsync(array $args = [])\n * @method \\Aws\\Result getPublicAccessBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPublicAccessBlockAsync(array $args = [])\n * @method \\Aws\\Result headBucket(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise headBucketAsync(array $args = [])\n * @method \\Aws\\Result headObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise headObjectAsync(array $args = [])\n * @method \\Aws\\Result listBucketAnalyticsConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBucketAnalyticsConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listBucketIntelligentTieringConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBucketIntelligentTieringConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listBucketInventoryConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBucketInventoryConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listBucketMetricsConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBucketMetricsConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listBuckets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBucketsAsync(array $args = [])\n * @method \\Aws\\Result listMultipartUploads(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMultipartUploadsAsync(array $args = [])\n * @method \\Aws\\Result listObjectVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listObjectVersionsAsync(array $args = [])\n * @method \\Aws\\Result listObjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listObjectsAsync(array $args = [])\n * @method \\Aws\\Result listObjectsV2(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listObjectsV2Async(array $args = [])\n * @method \\Aws\\Result listParts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPartsAsync(array $args = [])\n * @method \\Aws\\Result putBucketAccelerateConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketAccelerateConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putBucketAcl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketAclAsync(array $args = [])\n * @method \\Aws\\Result putBucketAnalyticsConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketAnalyticsConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putBucketCors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketCorsAsync(array $args = [])\n * @method \\Aws\\Result putBucketEncryption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketEncryptionAsync(array $args = [])\n * @method \\Aws\\Result putBucketIntelligentTieringConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketIntelligentTieringConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putBucketInventoryConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketInventoryConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putBucketLifecycle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketLifecycleAsync(array $args = [])\n * @method \\Aws\\Result putBucketLifecycleConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketLifecycleConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putBucketLogging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketLoggingAsync(array $args = [])\n * @method \\Aws\\Result putBucketMetricsConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketMetricsConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putBucketNotification(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketNotificationAsync(array $args = [])\n * @method \\Aws\\Result putBucketNotificationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketNotificationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putBucketOwnershipControls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketOwnershipControlsAsync(array $args = [])\n * @method \\Aws\\Result putBucketPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketPolicyAsync(array $args = [])\n * @method \\Aws\\Result putBucketReplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketReplicationAsync(array $args = [])\n * @method \\Aws\\Result putBucketRequestPayment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketRequestPaymentAsync(array $args = [])\n * @method \\Aws\\Result putBucketTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketTaggingAsync(array $args = [])\n * @method \\Aws\\Result putBucketVersioning(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketVersioningAsync(array $args = [])\n * @method \\Aws\\Result putBucketWebsite(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketWebsiteAsync(array $args = [])\n * @method \\Aws\\Result putObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putObjectAsync(array $args = [])\n * @method \\Aws\\Result putObjectAcl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putObjectAclAsync(array $args = [])\n * @method \\Aws\\Result putObjectLegalHold(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putObjectLegalHoldAsync(array $args = [])\n * @method \\Aws\\Result putObjectLockConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putObjectLockConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putObjectRetention(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putObjectRetentionAsync(array $args = [])\n * @method \\Aws\\Result putObjectTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putObjectTaggingAsync(array $args = [])\n * @method \\Aws\\Result putPublicAccessBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPublicAccessBlockAsync(array $args = [])\n * @method \\Aws\\Result restoreObject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreObjectAsync(array $args = [])\n * @method \\Aws\\Result selectObjectContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise selectObjectContentAsync(array $args = [])\n * @method \\Aws\\Result uploadPart(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise uploadPartAsync(array $args = [])\n * @method \\Aws\\Result uploadPartCopy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise uploadPartCopyAsync(array $args = [])\n * @method \\Aws\\Result writeGetObjectResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise writeGetObjectResponseAsync(array $args = [])\n */\nclass S3MultiRegionClient extends BaseClient implements S3ClientInterface\n{\n    use S3ClientTrait;\n\n    /** @var CacheInterface */\n    private $cache;\n\n    public static function getArguments()\n    {\n        $args = parent::getArguments();\n        $regionDef = $args['region'] + ['default' => function (array &$args) {\n            $availableRegions = array_keys($args['partition']['regions']);\n            return end($availableRegions);\n        }];\n        unset($args['region']);\n\n        return $args + [\n            'bucket_region_cache' => [\n                'type' => 'config',\n                'valid' => [CacheInterface::class],\n                'doc' => 'Cache of regions in which given buckets are located.',\n                'default' => function () { return new LruArrayCache; },\n            ],\n            'region' => $regionDef,\n        ];\n    }\n\n    public function __construct(array $args)\n    {\n        parent::__construct($args);\n        $this->cache = $this->getConfig('bucket_region_cache');\n\n        $this->getHandlerList()->prependInit(\n            $this->determineRegionMiddleware(),\n            'determine_region'\n        );\n    }\n\n    private function determineRegionMiddleware()\n    {\n        return function (callable $handler) {\n            return function (CommandInterface $command) use ($handler) {\n                $cacheKey = $this->getCacheKey($command['Bucket']);\n                if (\n                    empty($command['@region']) &&\n                    $region = $this->cache->get($cacheKey)\n                ) {\n                    $command['@region'] = $region;\n                }\n\n                return Promise\\Coroutine::of(function () use (\n                    $handler,\n                    $command,\n                    $cacheKey\n                ) {\n                    try {\n                        yield $handler($command);\n                    } catch (PermanentRedirectException $e) {\n                        if (empty($command['Bucket'])) {\n                            throw $e;\n                        }\n                        $result = $e->getResult();\n                        $region = null;\n                        if (isset($result['@metadata']['headers']['x-amz-bucket-region'])) {\n                            $region = $result['@metadata']['headers']['x-amz-bucket-region'];\n                            $this->cache->set($cacheKey, $region);\n                        } else {\n                            $region = (yield $this->determineBucketRegionAsync(\n                                $command['Bucket']\n                            ));\n                        }\n\n                        $command['@region'] = $region;\n                        yield $handler($command);\n                    } catch (AwsException $e) {\n                        if ($e->getAwsErrorCode() === 'AuthorizationHeaderMalformed') {\n                            $region = $this->determineBucketRegionFromExceptionBody(\n                                $e->getResponse()\n                            );\n                            if (!empty($region)) {\n                                $this->cache->set($cacheKey, $region);\n\n                                $command['@region'] = $region;\n                                yield $handler($command);\n                            } else {\n                                throw $e;\n                            }\n                        } else {\n                            throw $e;\n                        }\n                    }\n                });\n            };\n        };\n    }\n\n    public function createPresignedRequest(CommandInterface $command, $expires, array $options = [])\n    {\n        if (empty($command['Bucket'])) {\n            throw new \\InvalidArgumentException('The S3\\\\MultiRegionClient'\n                . ' cannot create presigned requests for commands without a'\n                . ' specified bucket.');\n        }\n\n        /** @var S3ClientInterface $client */\n        $client = $this->getClientFromPool(\n            $this->determineBucketRegion($command['Bucket'])\n        );\n        return $client->createPresignedRequest(\n            $client->getCommand($command->getName(), $command->toArray()),\n            $expires\n        );\n    }\n\n    public function getObjectUrl($bucket, $key)\n    {\n        /** @var S3Client $regionalClient */\n        $regionalClient = $this->getClientFromPool(\n            $this->determineBucketRegion($bucket)\n        );\n\n        return $regionalClient->getObjectUrl($bucket, $key);\n    }\n\n    public function determineBucketRegionAsync($bucketName)\n    {\n        $cacheKey = $this->getCacheKey($bucketName);\n        if ($cached = $this->cache->get($cacheKey)) {\n            return Promise\\Create::promiseFor($cached);\n        }\n\n        /** @var S3ClientInterface $regionalClient */\n        $regionalClient = $this->getClientFromPool();\n        return $regionalClient->determineBucketRegionAsync($bucketName)\n            ->then(\n                function ($region) use ($cacheKey) {\n                    $this->cache->set($cacheKey, $region);\n\n                    return $region;\n                }\n            );\n    }\n\n    private function getCacheKey($bucketName)\n    {\n        return \"aws:s3:{$bucketName}:location\";\n    }\n}\n", "num_lines": 358}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\Arn\\Exception\\InvalidArnException;\nuse Aws\\Arn\\S3\\AccessPointArn;\nuse Aws\\Arn\\ArnParser;\nuse GuzzleHttp\\Psr7;\nuse Psr\\Http\\Message\\UriInterface;\n\n/**\n * Extracts a region, bucket, key, and and if a URI is in path-style\n */\nclass S3UriParser\n{\n    private $pattern = '/^(.+\\\\.)?s3[.-]([A-Za-z0-9-]+)\\\\./';\n    private $streamWrapperScheme = 's3';\n\n    private static $defaultResult = [\n        'path_style' => true,\n        'bucket'     => null,\n        'key'        => null,\n        'region'     => null\n    ];\n\n    /**\n     * Parses a URL or S3 StreamWrapper Uri (s3://) into an associative array\n     * of Amazon S3 data including:\n     *\n     * - bucket: The Amazon S3 bucket (null if none)\n     * - key: The Amazon S3 key (null if none)\n     * - path_style: Set to true if using path style, or false if not\n     * - region: Set to a string if a non-class endpoint is used or null.\n     *\n     * @param string|UriInterface $uri\n     *\n     * @return array\n     * @throws \\InvalidArgumentException|InvalidArnException\n     */\n    public function parse($uri)\n    {\n        // Attempt to parse host component of uri as an ARN\n        $components = $this->parseS3UrlComponents($uri);\n        if (!empty($components)) {\n            if (ArnParser::isArn($components['host'])) {\n                $arn = new AccessPointArn($components['host']);\n                return [\n                    'bucket' => $components['host'],\n                    'key' => $components['path'],\n                    'path_style' => false,\n                    'region' => $arn->getRegion()\n                ];\n            }\n        }\n\n        $url = Psr7\\Utils::uriFor($uri);\n\n        if ($url->getScheme() == $this->streamWrapperScheme) {\n            return $this->parseStreamWrapper($url);\n        }\n\n        if (!$url->getHost()) {\n            throw new \\InvalidArgumentException('No hostname found in URI: '\n                . $uri);\n        }\n\n        if (!preg_match($this->pattern, $url->getHost(), $matches)) {\n            return $this->parseCustomEndpoint($url);\n        }\n\n        // Parse the URI based on the matched format (path / virtual)\n        $result = empty($matches[1])\n            ? $this->parsePathStyle($url)\n            : $this->parseVirtualHosted($url, $matches);\n\n        // Add the region if one was found and not the classic endpoint\n        $result['region'] = $matches[2] == 'amazonaws' ? null : $matches[2];\n\n        return $result;\n    }\n\n    private function parseS3UrlComponents($uri)\n    {\n        preg_match(\"/^([a-zA-Z0-9]*):\\/\\/([a-zA-Z0-9:-]*)\\/(.*)/\", $uri, $components);\n        if (empty($components)) {\n            return [];\n        }\n        return [\n            'scheme' => $components[1],\n            'host' => $components[2],\n            'path' => $components[3],\n        ];\n    }\n\n    private function parseStreamWrapper(UriInterface $url)\n    {\n        $result = self::$defaultResult;\n        $result['path_style'] = false;\n\n        $result['bucket'] = $url->getHost();\n        if ($url->getPath()) {\n            $key = ltrim($url->getPath(), '/ ');\n            if (!empty($key)) {\n                $result['key'] = $key;\n            }\n        }\n\n        return $result;\n    }\n\n    private function parseCustomEndpoint(UriInterface $url)\n    {\n        $result = self::$defaultResult;\n        $path = ltrim($url->getPath(), '/ ');\n        $segments = explode('/', $path, 2);\n\n        if (isset($segments[0])) {\n            $result['bucket'] = $segments[0];\n            if (isset($segments[1])) {\n                $result['key'] = $segments[1];\n            }\n        }\n\n        return $result;\n    }\n\n    private function parsePathStyle(UriInterface $url)\n    {\n        $result = self::$defaultResult;\n\n        if ($url->getPath() != '/') {\n            $path = ltrim($url->getPath(), '/');\n            if ($path) {\n                $pathPos = strpos($path, '/');\n                if ($pathPos === false) {\n                    // https://s3.amazonaws.com/bucket\n                    $result['bucket'] = $path;\n                } elseif ($pathPos == strlen($path) - 1) {\n                    // https://s3.amazonaws.com/bucket/\n                    $result['bucket'] = substr($path, 0, -1);\n                } else {\n                    // https://s3.amazonaws.com/bucket/key\n                    $result['bucket'] = substr($path, 0, $pathPos);\n                    $result['key'] = substr($path, $pathPos + 1) ?: null;\n                }\n            }\n        }\n\n        return $result;\n    }\n\n    private function parseVirtualHosted(UriInterface $url, array $matches)\n    {\n        $result = self::$defaultResult;\n        $result['path_style'] = false;\n        // Remove trailing \".\" from the prefix to get the bucket\n        $result['bucket'] = substr($matches[1], 0, -1);\n        $path = $url->getPath();\n        // Check if a key was present, and if so, removing the leading \"/\"\n        $result['key'] = !$path || $path == '/' ? null : substr($path, 1);\n\n        return $result;\n    }\n}\n", "num_lines": 164}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\CommandInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Simplifies the SSE-C process by encoding and hashing the key.\n * @internal\n */\nclass SSECMiddleware\n{\n    private $endpointScheme;\n    private $nextHandler;\n\n    /**\n     * Provide the URI scheme of the client sending requests.\n     *\n     * @param string $endpointScheme URI scheme (http/https).\n     *\n     * @return callable\n     */\n    public static function wrap($endpointScheme)\n    {\n        return function (callable $handler) use ($endpointScheme) {\n            return new self($endpointScheme, $handler);\n        };\n    }\n\n    public function __construct($endpointScheme, callable $nextHandler)\n    {\n        $this->nextHandler = $nextHandler;\n        $this->endpointScheme = $endpointScheme;\n    }\n\n    public function __invoke(\n        CommandInterface $command,\n        RequestInterface $request = null\n    ) {\n        // Allows only HTTPS connections when using SSE-C\n        if (($command['SSECustomerKey'] || $command['CopySourceSSECustomerKey'])\n            && $this->endpointScheme !== 'https'\n        ) {\n            throw new \\RuntimeException('You must configure your S3 client to '\n                . 'use HTTPS in order to use the SSE-C features.');\n        }\n\n        // Prepare the normal SSE-CPK headers\n        if ($command['SSECustomerKey']) {\n            $this->prepareSseParams($command);\n        }\n\n        // If it's a copy operation, prepare the SSE-CPK headers for the source.\n        if ($command['CopySourceSSECustomerKey']) {\n            $this->prepareSseParams($command, 'CopySource');\n        }\n\n        $f = $this->nextHandler;\n        return $f($command, $request);\n    }\n\n    private function prepareSseParams(CommandInterface $command, $prefix = '')\n    {\n        // Base64 encode the provided key\n        $key = $command[$prefix . 'SSECustomerKey'];\n        $command[$prefix . 'SSECustomerKey'] = base64_encode($key);\n\n        // Base64 the provided MD5 or, generate an MD5 if not provided\n        if ($md5 = $command[$prefix . 'SSECustomerKeyMD5']) {\n            $command[$prefix . 'SSECustomerKeyMD5'] = base64_encode($md5);\n        } else {\n            $command[$prefix . 'SSECustomerKeyMD5'] = base64_encode(md5($key, true));\n        }\n    }\n}\n", "num_lines": 76}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\CacheInterface;\nuse Aws\\LruArrayCache;\nuse Aws\\Result;\nuse Aws\\S3\\Exception\\S3Exception;\nuse GuzzleHttp\\Psr7;\nuse GuzzleHttp\\Psr7\\Stream;\nuse GuzzleHttp\\Psr7\\CachingStream;\nuse Psr\\Http\\Message\\StreamInterface;\n\n/**\n * Amazon S3 stream wrapper to use \"s3://<bucket>/<key>\" files with PHP\n * streams, supporting \"r\", \"w\", \"a\", \"x\".\n *\n * # Opening \"r\" (read only) streams:\n *\n * Read only streams are truly streaming by default and will not allow you to\n * seek. This is because data read from the stream is not kept in memory or on\n * the local filesystem. You can force a \"r\" stream to be seekable by setting\n * the \"seekable\" stream context option true. This will allow true streaming of\n * data from Amazon S3, but will maintain a buffer of previously read bytes in\n * a 'php://temp' stream to allow seeking to previously read bytes from the\n * stream.\n *\n * You may pass any GetObject parameters as 's3' stream context options. These\n * options will affect how the data is downloaded from Amazon S3.\n *\n * # Opening \"w\" and \"x\" (write only) streams:\n *\n * Because Amazon S3 requires a Content-Length header, write only streams will\n * maintain a 'php://temp' stream to buffer data written to the stream until\n * the stream is flushed (usually by closing the stream with fclose).\n *\n * You may pass any PutObject parameters as 's3' stream context options. These\n * options will affect how the data is uploaded to Amazon S3.\n *\n * When opening an \"x\" stream, the file must exist on Amazon S3 for the stream\n * to open successfully.\n *\n * # Opening \"a\" (write only append) streams:\n *\n * Similar to \"w\" streams, opening append streams requires that the data be\n * buffered in a \"php://temp\" stream. Append streams will attempt to download\n * the contents of an object in Amazon S3, seek to the end of the object, then\n * allow you to append to the contents of the object. The data will then be\n * uploaded using a PutObject operation when the stream is flushed (usually\n * with fclose).\n *\n * You may pass any GetObject and/or PutObject parameters as 's3' stream\n * context options. These options will affect how the data is downloaded and\n * uploaded from Amazon S3.\n *\n * Stream context options:\n *\n * - \"seekable\": Set to true to create a seekable \"r\" (read only) stream by\n *   using a php://temp stream buffer\n * - For \"unlink\" only: Any option that can be passed to the DeleteObject\n *   operation\n */\nclass StreamWrapper\n{\n    /** @var resource|null Stream context (this is set by PHP) */\n    public $context;\n\n    /** @var StreamInterface Underlying stream resource */\n    private $body;\n\n    /** @var int Size of the body that is opened */\n    private $size;\n\n    /** @var array Hash of opened stream parameters */\n    private $params = [];\n\n    /** @var string Mode in which the stream was opened */\n    private $mode;\n\n    /** @var \\Iterator Iterator used with opendir() related calls */\n    private $objectIterator;\n\n    /** @var string The bucket that was opened when opendir() was called */\n    private $openedBucket;\n\n    /** @var string The prefix of the bucket that was opened with opendir() */\n    private $openedBucketPrefix;\n\n    /** @var string Opened bucket path */\n    private $openedPath;\n\n    /** @var CacheInterface Cache for object and dir lookups */\n    private $cache;\n\n    /** @var string The opened protocol (e.g., \"s3\") */\n    private $protocol = 's3';\n\n    /** @var bool Keeps track of whether stream has been flushed since opening */\n    private $isFlushed = false;\n\n    /** @var bool Whether or not to use V2 bucket and object existence methods */\n    private static $useV2Existence = false;\n\n    /**\n     * Register the 's3://' stream wrapper\n     *\n     * @param S3ClientInterface $client   Client to use with the stream wrapper\n     * @param string            $protocol Protocol to register as.\n     * @param CacheInterface    $cache    Default cache for the protocol.\n     */\n    public static function register(\n        S3ClientInterface $client,\n        $protocol = 's3',\n        CacheInterface $cache = null,\n        $v2Existence = false\n    ) {\n        self::$useV2Existence = $v2Existence;\n        if (in_array($protocol, stream_get_wrappers())) {\n            stream_wrapper_unregister($protocol);\n        }\n\n        // Set the client passed in as the default stream context client\n        stream_wrapper_register($protocol, get_called_class(), STREAM_IS_URL);\n        $default = stream_context_get_options(stream_context_get_default());\n        $default[$protocol]['client'] = $client;\n\n        if ($cache) {\n            $default[$protocol]['cache'] = $cache;\n        } elseif (!isset($default[$protocol]['cache'])) {\n            // Set a default cache adapter.\n            $default[$protocol]['cache'] = new LruArrayCache();\n        }\n\n        stream_context_set_default($default);\n    }\n\n    public function stream_close()\n    {\n        if (!$this->isFlushed\n            && empty($this->body->getSize())\n            && $this->mode !== 'r'\n        ) {\n            $this->stream_flush();\n        }\n        $this->body = $this->cache = null;\n    }\n\n    public function stream_open($path, $mode, $options, &$opened_path)\n    {\n        $this->initProtocol($path);\n        $this->isFlushed = false;\n        $this->params = $this->getBucketKey($path);\n        $this->mode = rtrim($mode, 'bt');\n\n        if ($errors = $this->validate($path, $this->mode)) {\n            return $this->triggerError($errors);\n        }\n\n        return $this->boolCall(function() {\n            switch ($this->mode) {\n                case 'r': return $this->openReadStream();\n                case 'a': return $this->openAppendStream();\n                default: return $this->openWriteStream();\n            }\n        });\n    }\n\n    public function stream_eof()\n    {\n        return $this->body->eof();\n    }\n\n    public function stream_flush()\n    {\n        // Check if stream body size has been\n        // calculated via a flush or close\n        if($this->body->getSize() === null && $this->mode !== 'r') {\n            return $this->triggerError(\n                \"Unable to determine stream size. Did you forget to close or flush the stream?\"\n            );\n        }\n\n        $this->isFlushed = true;\n        if ($this->mode == 'r') {\n            return false;\n        }\n\n        if ($this->body->isSeekable()) {\n            $this->body->seek(0);\n        }\n        $params = $this->getOptions(true);\n        $params['Body'] = $this->body;\n\n        // Attempt to guess the ContentType of the upload based on the\n        // file extension of the key\n        if (!isset($params['ContentType']) &&\n            ($type = Psr7\\MimeType::fromFilename($params['Key']))\n        ) {\n            $params['ContentType'] = $type;\n        }\n\n        $this->clearCacheKey(\"{$this->protocol}://{$params['Bucket']}/{$params['Key']}\");\n        return $this->boolCall(function () use ($params) {\n            return (bool) $this->getClient()->putObject($params);\n        });\n    }\n\n    public function stream_read($count)\n    {\n        return $this->body->read($count);\n    }\n\n    public function stream_seek($offset, $whence = SEEK_SET)\n    {\n        return !$this->body->isSeekable()\n            ? false\n            : $this->boolCall(function () use ($offset, $whence) {\n                $this->body->seek($offset, $whence);\n                return true;\n            });\n    }\n\n    public function stream_tell()\n    {\n        return $this->boolCall(function() { return $this->body->tell(); });\n    }\n\n    public function stream_write($data)\n    {\n        return $this->body->write($data);\n    }\n\n    public function unlink($path)\n    {\n        $this->initProtocol($path);\n\n        return $this->boolCall(function () use ($path) {\n            $this->clearCacheKey($path);\n            $this->getClient()->deleteObject($this->withPath($path));\n            return true;\n        });\n    }\n\n    public function stream_stat()\n    {\n        $stat = $this->getStatTemplate();\n        $stat[7] = $stat['size'] = $this->getSize();\n        $stat[2] = $stat['mode'] = $this->mode;\n\n        return $stat;\n    }\n\n    /**\n     * Provides information for is_dir, is_file, filesize, etc. Works on\n     * buckets, keys, and prefixes.\n     * @link http://www.php.net/manual/en/streamwrapper.url-stat.php\n     */\n    public function url_stat($path, $flags)\n    {\n        $this->initProtocol($path);\n\n        // Some paths come through as S3:// for some reason.\n        $split = explode('://', $path);\n        $path = strtolower($split[0]) . '://' . $split[1];\n\n        // Check if this path is in the url_stat cache\n        if ($value = $this->getCacheStorage()->get($path)) {\n            return $value;\n        }\n\n        $stat = $this->createStat($path, $flags);\n\n        if (is_array($stat)) {\n            $this->getCacheStorage()->set($path, $stat);\n        }\n\n        return $stat;\n    }\n\n    /**\n     * Parse the protocol out of the given path.\n     *\n     * @param $path\n     */\n    private function initProtocol($path)\n    {\n        $parts = explode('://', $path, 2);\n        $this->protocol = $parts[0] ?: 's3';\n    }\n\n    private function createStat($path, $flags)\n    {\n        $this->initProtocol($path);\n        $parts = $this->withPath($path);\n\n        if (!$parts['Key']) {\n            return $this->statDirectory($parts, $path, $flags);\n        }\n\n        return $this->boolCall(function () use ($parts, $path) {\n            try {\n                $result = $this->getClient()->headObject($parts);\n                if (substr($parts['Key'], -1, 1) == '/' &&\n                    $result['ContentLength'] == 0\n                ) {\n                    // Return as if it is a bucket to account for console\n                    // bucket objects (e.g., zero-byte object \"foo/\")\n                    return $this->formatUrlStat($path);\n                }\n\n                // Attempt to stat and cache regular object\n                return $this->formatUrlStat($result->toArray());\n            } catch (S3Exception $e) {\n                // Maybe this isn't an actual key, but a prefix. Do a prefix\n                // listing of objects to determine.\n                $result = $this->getClient()->listObjects([\n                    'Bucket'  => $parts['Bucket'],\n                    'Prefix'  => rtrim($parts['Key'], '/') . '/',\n                    'MaxKeys' => 1\n                ]);\n                if (!$result['Contents'] && !$result['CommonPrefixes']) {\n                    throw new \\Exception(\"File or directory not found: $path\");\n                }\n                return $this->formatUrlStat($path);\n            }\n        }, $flags);\n    }\n\n    private function statDirectory($parts, $path, $flags)\n    {\n        // Stat \"directories\": buckets, or \"s3://\"\n        $method = self::$useV2Existence ? 'doesBucketExistV2' : 'doesBucketExist';\n\n        if (!$parts['Bucket'] ||\n            $this->getClient()->$method($parts['Bucket'])\n        ) {\n            return $this->formatUrlStat($path);\n        }\n\n        return $this->triggerError(\"File or directory not found: $path\", $flags);\n    }\n\n    /**\n     * Support for mkdir().\n     *\n     * @param string $path    Directory which should be created.\n     * @param int    $mode    Permissions. 700-range permissions map to\n     *                        ACL_PUBLIC. 600-range permissions map to\n     *                        ACL_AUTH_READ. All other permissions map to\n     *                        ACL_PRIVATE. Expects octal form.\n     * @param int    $options A bitwise mask of values, such as\n     *                        STREAM_MKDIR_RECURSIVE.\n     *\n     * @return bool\n     * @link http://www.php.net/manual/en/streamwrapper.mkdir.php\n     */\n    public function mkdir($path, $mode, $options)\n    {\n        $this->initProtocol($path);\n        $params = $this->withPath($path);\n        $this->clearCacheKey($path);\n        if (!$params['Bucket']) {\n            return false;\n        }\n\n        if (!isset($params['ACL'])) {\n            $params['ACL'] = $this->determineAcl($mode);\n        }\n\n        return empty($params['Key'])\n            ? $this->createBucket($path, $params)\n            : $this->createSubfolder($path, $params);\n    }\n\n    public function rmdir($path, $options)\n    {\n        $this->initProtocol($path);\n        $this->clearCacheKey($path);\n        $params = $this->withPath($path);\n        $client = $this->getClient();\n\n        if (!$params['Bucket']) {\n            return $this->triggerError('You must specify a bucket');\n        }\n\n        return $this->boolCall(function () use ($params, $path, $client) {\n            if (!$params['Key']) {\n                $client->deleteBucket(['Bucket' => $params['Bucket']]);\n                return true;\n            }\n            return $this->deleteSubfolder($path, $params);\n        });\n    }\n\n    /**\n     * Support for opendir().\n     *\n     * The opendir() method of the Amazon S3 stream wrapper supports a stream\n     * context option of \"listFilter\". listFilter must be a callable that\n     * accepts an associative array of object data and returns true if the\n     * object should be yielded when iterating the keys in a bucket.\n     *\n     * @param string $path    The path to the directory\n     *                        (e.g. \"s3://dir[</prefix>]\")\n     * @param string $options Unused option variable\n     *\n     * @return bool true on success\n     * @see http://www.php.net/manual/en/function.opendir.php\n     */\n    public function dir_opendir($path, $options)\n    {\n        $this->initProtocol($path);\n        $this->openedPath = $path;\n        $params = $this->withPath($path);\n        $delimiter = $this->getOption('delimiter');\n        /** @var callable $filterFn */\n        $filterFn = $this->getOption('listFilter');\n        $op = ['Bucket' => $params['Bucket']];\n        $this->openedBucket = $params['Bucket'];\n\n        if ($delimiter === null) {\n            $delimiter = '/';\n        }\n\n        if ($delimiter) {\n            $op['Delimiter'] = $delimiter;\n        }\n\n        if ($params['Key']) {\n            $params['Key'] = rtrim($params['Key'], $delimiter) . $delimiter;\n            $op['Prefix'] = $params['Key'];\n        }\n\n        $this->openedBucketPrefix = $params['Key'];\n\n        // Filter our \"/\" keys added by the console as directories, and ensure\n        // that if a filter function is provided that it passes the filter.\n        $this->objectIterator = \\Aws\\flatmap(\n            $this->getClient()->getPaginator('ListObjects', $op),\n            function (Result $result) use ($filterFn) {\n                $contentsAndPrefixes = $result->search('[Contents[], CommonPrefixes[]][]');\n                // Filter out dir place holder keys and use the filter fn.\n                return array_filter(\n                    $contentsAndPrefixes,\n                    function ($key) use ($filterFn) {\n                        return (!$filterFn || call_user_func($filterFn, $key))\n                            && (!isset($key['Key']) || substr($key['Key'], -1, 1) !== '/');\n                    }\n                );\n            }\n        );\n\n        return true;\n    }\n\n    /**\n     * Close the directory listing handles\n     *\n     * @return bool true on success\n     */\n    public function dir_closedir()\n    {\n        $this->objectIterator = null;\n        gc_collect_cycles();\n\n        return true;\n    }\n\n    /**\n     * This method is called in response to rewinddir()\n     *\n     * @return boolean true on success\n     */\n    public function dir_rewinddir()\n    {\n        return $this->boolCall(function() {\n            $this->objectIterator = null;\n            $this->dir_opendir($this->openedPath, null);\n            return true;\n        });\n    }\n\n    /**\n     * This method is called in response to readdir()\n     *\n     * @return string Should return a string representing the next filename, or\n     *                false if there is no next file.\n     * @link http://www.php.net/manual/en/function.readdir.php\n     */\n    public function dir_readdir()\n    {\n        // Skip empty result keys\n        if (!$this->objectIterator->valid()) {\n            return false;\n        }\n\n        // First we need to create a cache key. This key is the full path to\n        // then object in s3: protocol://bucket/key.\n        // Next we need to create a result value. The result value is the\n        // current value of the iterator without the opened bucket prefix to\n        // emulate how readdir() works on directories.\n        // The cache key and result value will depend on if this is a prefix\n        // or a key.\n        $cur = $this->objectIterator->current();\n        if (isset($cur['Prefix'])) {\n            // Include \"directories\". Be sure to strip a trailing \"/\"\n            // on prefixes.\n            $result = rtrim($cur['Prefix'], '/');\n            $key = $this->formatKey($result);\n            $stat = $this->formatUrlStat($key);\n        } else {\n            $result = $cur['Key'];\n            $key = $this->formatKey($cur['Key']);\n            $stat = $this->formatUrlStat($cur);\n        }\n\n        // Cache the object data for quick url_stat lookups used with\n        // RecursiveDirectoryIterator.\n        $this->getCacheStorage()->set($key, $stat);\n        $this->objectIterator->next();\n\n        // Remove the prefix from the result to emulate other stream wrappers.\n        return $this->openedBucketPrefix\n            ? substr($result, strlen($this->openedBucketPrefix))\n            : $result;\n    }\n\n    private function formatKey($key)\n    {\n        $protocol = explode('://', $this->openedPath)[0];\n        return \"{$protocol}://{$this->openedBucket}/{$key}\";\n    }\n\n    /**\n     * Called in response to rename() to rename a file or directory. Currently\n     * only supports renaming objects.\n     *\n     * @param string $path_from the path to the file to rename\n     * @param string $path_to   the new path to the file\n     *\n     * @return bool true if file was successfully renamed\n     * @link http://www.php.net/manual/en/function.rename.php\n     */\n    public function rename($path_from, $path_to)\n    {\n        // PHP will not allow rename across wrapper types, so we can safely\n        // assume $path_from and $path_to have the same protocol\n        $this->initProtocol($path_from);\n        $partsFrom = $this->withPath($path_from);\n        $partsTo = $this->withPath($path_to);\n        $this->clearCacheKey($path_from);\n        $this->clearCacheKey($path_to);\n\n        if (!$partsFrom['Key'] || !$partsTo['Key']) {\n            return $this->triggerError('The Amazon S3 stream wrapper only '\n                . 'supports copying objects');\n        }\n\n        return $this->boolCall(function () use ($partsFrom, $partsTo) {\n            $options = $this->getOptions(true);\n            // Copy the object and allow overriding default parameters if\n            // desired, but by default copy metadata\n            $this->getClient()->copy(\n                $partsFrom['Bucket'],\n                $partsFrom['Key'],\n                $partsTo['Bucket'],\n                $partsTo['Key'],\n                isset($options['acl']) ? $options['acl'] : 'private',\n                $options\n            );\n            // Delete the original object\n            $this->getClient()->deleteObject([\n                'Bucket' => $partsFrom['Bucket'],\n                'Key'    => $partsFrom['Key']\n            ] + $options);\n            return true;\n        });\n    }\n\n    public function stream_cast($cast_as)\n    {\n        return false;\n    }\n\n    /**\n     * Validates the provided stream arguments for fopen and returns an array\n     * of errors.\n     */\n    private function validate($path, $mode)\n    {\n        $errors = [];\n\n        if (!$this->getOption('Key')) {\n            $errors[] = 'Cannot open a bucket. You must specify a path in the '\n                . 'form of s3://bucket/key';\n        }\n\n        if (!in_array($mode, ['r', 'w', 'a', 'x'])) {\n            $errors[] = \"Mode not supported: {$mode}. \"\n                . \"Use one 'r', 'w', 'a', or 'x'.\";\n        }\n\n        if ($mode === 'x') {\n            $method = self::$useV2Existence ? 'doesObjectExistV2' : 'doesObjectExist';\n\n            if ($this->getClient()->$method(\n                $this->getOption('Bucket'),\n                $this->getOption('Key'),\n                $this->getOptions(true)\n            )) {\n                $errors[] = \"{$path} already exists on Amazon S3\";\n            }\n        }\n\n        return $errors;\n    }\n\n    /**\n     * Get the stream context options available to the current stream\n     *\n     * @param bool $removeContextData Set to true to remove contextual kvp's\n     *                                like 'client' from the result.\n     *\n     * @return array\n     */\n    private function getOptions($removeContextData = false)\n    {\n        // Context is not set when doing things like stat\n        if ($this->context === null) {\n            $options = [];\n        } else {\n            $options = stream_context_get_options($this->context);\n            $options = isset($options[$this->protocol])\n                ? $options[$this->protocol]\n                : [];\n        }\n\n        $default = stream_context_get_options(stream_context_get_default());\n        $default = isset($default[$this->protocol])\n            ? $default[$this->protocol]\n            : [];\n        $result = $this->params + $options + $default;\n\n        if ($removeContextData) {\n            unset($result['client'], $result['seekable'], $result['cache']);\n        }\n\n        return $result;\n    }\n\n    /**\n     * Get a specific stream context option\n     *\n     * @param string $name Name of the option to retrieve\n     *\n     * @return mixed|null\n     */\n    private function getOption($name)\n    {\n        $options = $this->getOptions();\n\n        return isset($options[$name]) ? $options[$name] : null;\n    }\n\n    /**\n     * Gets the client from the stream context\n     *\n     * @return S3ClientInterface\n     * @throws \\RuntimeException if no client has been configured\n     */\n    private function getClient()\n    {\n        if (!$client = $this->getOption('client')) {\n            throw new \\RuntimeException('No client in stream context');\n        }\n\n        return $client;\n    }\n\n    private function getBucketKey($path)\n    {\n        // Remove the protocol\n        $parts = explode('://', $path);\n        // Get the bucket, key\n        $parts = explode('/', $parts[1], 2);\n\n        return [\n            'Bucket' => $parts[0],\n            'Key'    => isset($parts[1]) ? $parts[1] : null\n        ];\n    }\n\n    /**\n     * Get the bucket and key from the passed path (e.g. s3://bucket/key)\n     *\n     * @param string $path Path passed to the stream wrapper\n     *\n     * @return array Hash of 'Bucket', 'Key', and custom params from the context\n     */\n    private function withPath($path)\n    {\n        $params = $this->getOptions(true);\n\n        return $this->getBucketKey($path) + $params;\n    }\n\n    private function openReadStream()\n    {\n        $client = $this->getClient();\n        $command = $client->getCommand('GetObject', $this->getOptions(true));\n        $command['@http']['stream'] = true;\n        $result = $client->execute($command);\n        $this->size = $result['ContentLength'];\n        $this->body = $result['Body'];\n\n        // Wrap the body in a caching entity body if seeking is allowed\n        if ($this->getOption('seekable') && !$this->body->isSeekable()) {\n            $this->body = new CachingStream($this->body);\n        }\n\n        return true;\n    }\n\n    private function openWriteStream()\n    {\n        $this->body = new Stream(fopen('php://temp', 'r+'));\n        return true;\n    }\n\n    private function openAppendStream()\n    {\n        try {\n            // Get the body of the object and seek to the end of the stream\n            $client = $this->getClient();\n            $this->body = $client->getObject($this->getOptions(true))['Body'];\n            $this->body->seek(0, SEEK_END);\n            return true;\n        } catch (S3Exception $e) {\n            // The object does not exist, so use a simple write stream\n            return $this->openWriteStream();\n        }\n    }\n\n    /**\n     * Trigger one or more errors\n     *\n     * @param string|array $errors Errors to trigger\n     * @param mixed        $flags  If set to STREAM_URL_STAT_QUIET, then no\n     *                             error or exception occurs\n     *\n     * @return bool Returns false\n     * @throws \\RuntimeException if throw_errors is true\n     */\n    private function triggerError($errors, $flags = null)\n    {\n        // This is triggered with things like file_exists()\n        if ($flags & STREAM_URL_STAT_QUIET) {\n            return $flags & STREAM_URL_STAT_LINK\n                // This is triggered for things like is_link()\n                ? $this->formatUrlStat(false)\n                : false;\n        }\n\n        // This is triggered when doing things like lstat() or stat()\n        trigger_error(implode(\"\\n\", (array) $errors), E_USER_WARNING);\n\n        return false;\n    }\n\n    /**\n     * Prepare a url_stat result array\n     *\n     * @param string|array $result Data to add\n     *\n     * @return array Returns the modified url_stat result\n     */\n    private function formatUrlStat($result = null)\n    {\n        $stat = $this->getStatTemplate();\n        switch (gettype($result)) {\n            case 'NULL':\n            case 'string':\n                // Directory with 0777 access - see \"man 2 stat\".\n                $stat['mode'] = $stat[2] = 0040777;\n                break;\n            case 'array':\n                // Regular file with 0777 access - see \"man 2 stat\".\n                $stat['mode'] = $stat[2] = 0100777;\n                // Pluck the content-length if available.\n                if (isset($result['ContentLength'])) {\n                    $stat['size'] = $stat[7] = $result['ContentLength'];\n                } elseif (isset($result['Size'])) {\n                    $stat['size'] = $stat[7] = $result['Size'];\n                }\n                if (isset($result['LastModified'])) {\n                    // ListObjects or HeadObject result\n                    $stat['mtime'] = $stat[9] = $stat['ctime'] = $stat[10]\n                        = strtotime($result['LastModified']);\n                }\n        }\n\n        return $stat;\n    }\n\n    /**\n     * Creates a bucket for the given parameters.\n     *\n     * @param string $path   Stream wrapper path\n     * @param array  $params A result of StreamWrapper::withPath()\n     *\n     * @return bool Returns true on success or false on failure\n     */\n    private function createBucket($path, array $params)\n    {\n        $method = self::$useV2Existence ? 'doesBucketExistV2' : 'doesBucketExist';\n\n        if ($this->getClient()->$method($params['Bucket'])) {\n            return $this->triggerError(\"Bucket already exists: {$path}\");\n        }\n\n        unset($params['ACL']);\n        return $this->boolCall(function () use ($params, $path) {\n            $this->getClient()->createBucket($params);\n            $this->clearCacheKey($path);\n            return true;\n        });\n    }\n\n    /**\n     * Creates a pseudo-folder by creating an empty \"/\" suffixed key\n     *\n     * @param string $path   Stream wrapper path\n     * @param array  $params A result of StreamWrapper::withPath()\n     *\n     * @return bool\n     */\n    private function createSubfolder($path, array $params)\n    {\n        // Ensure the path ends in \"/\" and the body is empty.\n        $params['Key'] = rtrim($params['Key'], '/') . '/';\n        $params['Body'] = '';\n\n        // Fail if this pseudo directory key already exists\n        $method = self::$useV2Existence ? 'doesObjectExistV2' : 'doesObjectExist';\n\n        if ($this->getClient()->$method(\n            $params['Bucket'],\n            $params['Key']\n        )) {\n            return $this->triggerError(\"Subfolder already exists: {$path}\");\n        }\n\n        return $this->boolCall(function () use ($params, $path) {\n            $this->getClient()->putObject($params);\n            $this->clearCacheKey($path);\n            return true;\n        });\n    }\n\n    /**\n     * Deletes a nested subfolder if it is empty.\n     *\n     * @param string $path   Path that is being deleted (e.g., 's3://a/b/c')\n     * @param array  $params A result of StreamWrapper::withPath()\n     *\n     * @return bool\n     */\n    private function deleteSubfolder($path, $params)\n    {\n        // Use a key that adds a trailing slash if needed.\n        $prefix = rtrim($params['Key'], '/') . '/';\n        $result = $this->getClient()->listObjects([\n            'Bucket'  => $params['Bucket'],\n            'Prefix'  => $prefix,\n            'MaxKeys' => 1\n        ]);\n\n        // Check if the bucket contains keys other than the placeholder\n        if ($contents = $result['Contents']) {\n            return (count($contents) > 1 || $contents[0]['Key'] != $prefix)\n                ? $this->triggerError('Subfolder is not empty')\n                : $this->unlink(rtrim($path, '/') . '/');\n        }\n\n        return $result['CommonPrefixes']\n            ? $this->triggerError('Subfolder contains nested folders')\n            : true;\n    }\n\n    /**\n     * Determine the most appropriate ACL based on a file mode.\n     *\n     * @param int $mode File mode\n     *\n     * @return string\n     */\n    private function determineAcl($mode)\n    {\n        switch (substr(decoct($mode), 0, 1)) {\n            case '7': return 'public-read';\n            case '6': return 'authenticated-read';\n            default: return 'private';\n        }\n    }\n\n    /**\n     * Gets a URL stat template with default values\n     *\n     * @return array\n     */\n    private function getStatTemplate()\n    {\n        return [\n            0  => 0,  'dev'     => 0,\n            1  => 0,  'ino'     => 0,\n            2  => 0,  'mode'    => 0,\n            3  => 0,  'nlink'   => 0,\n            4  => 0,  'uid'     => 0,\n            5  => 0,  'gid'     => 0,\n            6  => -1, 'rdev'    => -1,\n            7  => 0,  'size'    => 0,\n            8  => 0,  'atime'   => 0,\n            9  => 0,  'mtime'   => 0,\n            10 => 0,  'ctime'   => 0,\n            11 => -1, 'blksize' => -1,\n            12 => -1, 'blocks'  => -1,\n        ];\n    }\n\n    /**\n     * Invokes a callable and triggers an error if an exception occurs while\n     * calling the function.\n     *\n     * @param callable $fn\n     * @param int      $flags\n     *\n     * @return bool\n     */\n    private function boolCall(callable $fn, $flags = null)\n    {\n        try {\n            return $fn();\n        } catch (\\Exception $e) {\n            return $this->triggerError($e->getMessage(), $flags);\n        }\n    }\n\n    /**\n     * @return LruArrayCache\n     */\n    private function getCacheStorage()\n    {\n        if (!$this->cache) {\n            $this->cache = $this->getOption('cache') ?: new LruArrayCache();\n        }\n\n        return $this->cache;\n    }\n\n    /**\n     * Clears a specific stat cache value from the stat cache and LRU cache.\n     *\n     * @param string $key S3 path (s3://bucket/key).\n     */\n    private function clearCacheKey($key)\n    {\n        clearstatcache(true, $key);\n        $this->getCacheStorage()->remove($key);\n    }\n\n    /**\n     * Returns the size of the opened object body.\n     *\n     * @return int|null\n     */\n    private function getSize()\n    {\n        $size = $this->body->getSize();\n\n        return !empty($size) ? $size : $this->size;\n    }\n}\n", "num_lines": 982}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws;\nuse Aws\\CommandInterface;\nuse Aws\\Exception\\AwsException;\nuse GuzzleHttp\\Promise;\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse GuzzleHttp\\Promise\\PromisorInterface;\nuse Iterator;\n\n/**\n * Transfers files from the local filesystem to S3 or from S3 to the local\n * filesystem.\n *\n * This class does not support copying from the local filesystem to somewhere\n * else on the local filesystem or from one S3 bucket to another.\n */\nclass Transfer implements PromisorInterface\n{\n    private $client;\n    private $promise;\n    private $source;\n    private $sourceMetadata;\n    private $destination;\n    private $concurrency;\n    private $mupThreshold;\n    private $before;\n    private $s3Args = [];\n    private $addContentMD5;\n\n    /**\n     * When providing the $source argument, you may provide a string referencing\n     * the path to a directory on disk to upload, an s3 scheme URI that contains\n     * the bucket and key (e.g., \"s3://bucket/key\"), or an \\Iterator object\n     * that yields strings containing filenames that are the path to a file on\n     * disk or an s3 scheme URI. The bucket portion of the s3 URI may be an S3\n     * access point ARN. The \"/key\" portion of an s3 URI is optional.\n     *\n     * When providing an iterator for the $source argument, you must also\n     * provide a 'base_dir' key value pair in the $options argument.\n     *\n     * The $dest argument can be the path to a directory on disk or an s3\n     * scheme URI (e.g., \"s3://bucket/key\").\n     *\n     * The options array can contain the following key value pairs:\n     *\n     * - base_dir: (string) Base directory of the source, if $source is an\n     *   iterator. If the $source option is not an array, then this option is\n     *   ignored.\n     * - before: (callable) A callback to invoke before each transfer. The\n     *   callback accepts a single argument: Aws\\CommandInterface $command.\n     *   The provided command will be either a GetObject, PutObject,\n     *   InitiateMultipartUpload, or UploadPart command.\n     * - mup_threshold: (int) Size in bytes in which a multipart upload should\n     *   be used instead of PutObject. Defaults to 20971520 (20 MB).\n     * - concurrency: (int, default=5) Number of files to upload concurrently.\n     *   The ideal concurrency value will vary based on the number of files\n     *   being uploaded and the average size of each file. Generally speaking,\n     *   smaller files benefit from a higher concurrency while larger files\n     *   will not.\n     * - debug: (bool) Set to true to print out debug information for\n     *   transfers. Set to an fopen() resource to write to a specific stream\n     *   rather than writing to STDOUT.\n     *\n     * @param S3ClientInterface $client  Client used for transfers.\n     * @param string|Iterator   $source  Where the files are transferred from.\n     * @param string            $dest    Where the files are transferred to.\n     * @param array             $options Hash of options.\n     */\n    public function __construct(\n        S3ClientInterface $client,\n        $source,\n        $dest,\n        array $options = []\n    ) {\n        $this->client = $client;\n\n        // Prepare the destination.\n        $this->destination = $this->prepareTarget($dest);\n        if ($this->destination['scheme'] === 's3') {\n            $this->s3Args = $this->getS3Args($this->destination['path']);\n        }\n\n        // Prepare the source.\n        if (is_string($source)) {\n            $this->sourceMetadata = $this->prepareTarget($source);\n            $this->source = $source;\n        } elseif ($source instanceof Iterator) {\n            if (empty($options['base_dir'])) {\n                throw new \\InvalidArgumentException('You must provide the source'\n                    . ' argument as a string or provide the \"base_dir\" option.');\n            }\n\n            $this->sourceMetadata = $this->prepareTarget($options['base_dir']);\n            $this->source = $source;\n        } else {\n            throw new \\InvalidArgumentException('source must be the path to a '\n                . 'directory or an iterator that yields file names.');\n        }\n\n        // Validate schemes.\n        if ($this->sourceMetadata['scheme'] === $this->destination['scheme']) {\n            throw new \\InvalidArgumentException(\"You cannot copy from\"\n                . \" {$this->sourceMetadata['scheme']} to\"\n                . \" {$this->destination['scheme']}.\"\n            );\n        }\n\n        // Handle multipart-related options.\n        $this->concurrency = isset($options['concurrency'])\n            ? $options['concurrency']\n            : MultipartUploader::DEFAULT_CONCURRENCY;\n        $this->mupThreshold = isset($options['mup_threshold'])\n            ? $options['mup_threshold']\n            : 16777216;\n        if ($this->mupThreshold < MultipartUploader::PART_MIN_SIZE) {\n            throw new \\InvalidArgumentException('mup_threshold must be >= 5MB');\n        }\n\n        // Handle \"before\" callback option.\n        if (isset($options['before'])) {\n            $this->before = $options['before'];\n            if (!is_callable($this->before)) {\n                throw new \\InvalidArgumentException('before must be a callable.');\n            }\n        }\n\n        // Handle \"debug\" option.\n        if (isset($options['debug'])) {\n            if ($options['debug'] === true) {\n                $options['debug'] = fopen('php://output', 'w');\n            }\n            if (is_resource($options['debug'])) {\n                $this->addDebugToBefore($options['debug']);\n            }\n        }\n\n        // Handle \"add_content_md5\" option.\n        $this->addContentMD5 = isset($options['add_content_md5'])\n            && $options['add_content_md5'] === true;\n    }\n\n    /**\n     * Transfers the files.\n     *\n     * @return PromiseInterface\n     */\n    public function promise()\n    {\n        // If the promise has been created, just return it.\n        if (!$this->promise) {\n            // Create an upload/download promise for the transfer.\n            $this->promise = $this->sourceMetadata['scheme'] === 'file'\n                ? $this->createUploadPromise()\n                : $this->createDownloadPromise();\n        }\n\n        return $this->promise;\n    }\n\n    /**\n     * Transfers the files synchronously.\n     */\n    public function transfer()\n    {\n        $this->promise()->wait();\n    }\n\n    private function prepareTarget($targetPath)\n    {\n        $target = [\n            'path'   => $this->normalizePath($targetPath),\n            'scheme' => $this->determineScheme($targetPath),\n        ];\n\n        if ($target['scheme'] !== 's3' && $target['scheme'] !== 'file') {\n            throw new \\InvalidArgumentException('Scheme must be \"s3\" or \"file\".');\n        }\n\n        return $target;\n    }\n\n    /**\n     * Creates an array that contains Bucket and Key by parsing the filename.\n     *\n     * @param string $path Path to parse.\n     *\n     * @return array\n     */\n    private function getS3Args($path)\n    {\n        $parts = explode('/', str_replace('s3://', '', $path), 2);\n        $args = ['Bucket' => $parts[0]];\n        if (isset($parts[1])) {\n            $args['Key'] = $parts[1];\n        }\n\n        return $args;\n    }\n\n    /**\n     * Parses the scheme from a filename.\n     *\n     * @param string $path Path to parse.\n     *\n     * @return string\n     */\n    private function determineScheme($path)\n    {\n        return !strpos($path, '://') ? 'file' : explode('://', $path)[0];\n    }\n\n    /**\n     * Normalize a path so that it has UNIX-style directory separators and no trailing /\n     *\n     * @param string $path\n     *\n     * @return string\n     */\n    private function normalizePath($path)\n    {\n        return rtrim(str_replace('\\\\', '/', $path), '/');\n    }\n\n    private function resolvesOutsideTargetDirectory($sink, $objectKey)\n    {\n        $resolved = [];\n        $sections = explode('/', $sink);\n        $targetSectionsLength = count(explode('/', $objectKey));\n        $targetSections = array_slice($sections, -($targetSectionsLength + 1));\n        $targetDirectory = $targetSections[0];\n\n        foreach ($targetSections as $section) {\n            if ($section === '.' || $section === '') {\n                continue;\n            }\n            if ($section === '..') {\n                array_pop($resolved);\n                if (empty($resolved) || $resolved[0] !== $targetDirectory) {\n                    return true;\n                }\n            } else {\n                $resolved []= $section;\n            }\n        }\n        return false;\n    }\n\n    private function createDownloadPromise()\n    {\n        $parts = $this->getS3Args($this->sourceMetadata['path']);\n        $prefix = \"s3://{$parts['Bucket']}/\"\n            . (isset($parts['Key']) ? $parts['Key'] . '/' : '');\n\n        $commands = [];\n        foreach ($this->getDownloadsIterator() as $object) {\n            // Prepare the sink.\n            $objectKey = preg_replace('/^' . preg_quote($prefix, '/') . '/', '', $object);\n            $sink = $this->destination['path'] . '/' . $objectKey;\n\n            $command = $this->client->getCommand(\n                'GetObject',\n                $this->getS3Args($object) + ['@http'  => ['sink'  => $sink]]\n            );\n\n            if ($this->resolvesOutsideTargetDirectory($sink, $objectKey)) {\n                throw new AwsException(\n                    'Cannot download key ' . $objectKey\n                    . ', its relative path resolves outside the'\n                    . ' parent directory', $command);\n            }\n\n            // Create the directory if needed.\n            $dir = dirname($sink);\n            if (!is_dir($dir) && !mkdir($dir, 0777, true)) {\n                throw new \\RuntimeException(\"Could not create dir: {$dir}\");\n            }\n\n            // Create the command.\n            $commands []= $command;\n        }\n\n        // Create a GetObject command pool and return the promise.\n        return (new Aws\\CommandPool($this->client, $commands, [\n            'concurrency' => $this->concurrency,\n            'before'      => $this->before,\n            'rejected'    => function ($reason, $idx, Promise\\PromiseInterface $p) {\n                $p->reject($reason);\n            }\n        ]))->promise();\n    }\n\n    private function createUploadPromise()\n    {\n        // Map each file into a promise that performs the actual transfer.\n        $files = \\Aws\\map($this->getUploadsIterator(), function ($file) {\n            return (filesize($file) >= $this->mupThreshold)\n                ? $this->uploadMultipart($file)\n                : $this->upload($file);\n        });\n\n        // Create an EachPromise, that will concurrently handle the upload\n        // operations' yielded promises from the iterator.\n        return Promise\\Each::ofLimitAll($files, $this->concurrency);\n    }\n\n    /** @return Iterator */\n    private function getUploadsIterator()\n    {\n        if (is_string($this->source)) {\n            return Aws\\filter(\n                Aws\\recursive_dir_iterator($this->sourceMetadata['path']),\n                function ($file) { return !is_dir($file); }\n            );\n        }\n\n        return $this->source;\n    }\n\n    /** @return Iterator */\n    private function getDownloadsIterator()\n    {\n        if (is_string($this->source)) {\n            $listArgs = $this->getS3Args($this->sourceMetadata['path']);\n            if (isset($listArgs['Key'])) {\n                $listArgs['Prefix'] = $listArgs['Key'] . '/';\n                unset($listArgs['Key']);\n            }\n\n            $files = $this->client\n                ->getPaginator('ListObjects', $listArgs)\n                ->search('Contents[].Key');\n            $files = Aws\\map($files, function ($key) use ($listArgs) {\n                return \"s3://{$listArgs['Bucket']}/$key\";\n            });\n            return Aws\\filter($files, function ($key) {\n                return substr($key, -1, 1) !== '/';\n            });\n        }\n\n        return $this->source;\n    }\n\n    private function upload($filename)\n    {\n        $args = $this->s3Args;\n        $args['SourceFile'] = $filename;\n        $args['Key'] = $this->createS3Key($filename);\n        $args['AddContentMD5'] = $this->addContentMD5;\n        $command = $this->client->getCommand('PutObject', $args);\n        $this->before and call_user_func($this->before, $command);\n\n        return $this->client->executeAsync($command);\n    }\n\n    private function uploadMultipart($filename)\n    {\n        $args = $this->s3Args;\n        $args['Key'] = $this->createS3Key($filename);\n        $filename = $filename instanceof \\SplFileInfo ? $filename->getPathname() : $filename;\n\n        return (new MultipartUploader($this->client, $filename, [\n            'bucket'          => $args['Bucket'],\n            'key'             => $args['Key'],\n            'before_initiate' => $this->before,\n            'before_upload'   => $this->before,\n            'before_complete' => $this->before,\n            'concurrency'     => $this->concurrency,\n            'add_content_md5' => $this->addContentMD5\n        ]))->promise();\n    }\n\n    private function createS3Key($filename)\n    {\n        $filename = $this->normalizePath($filename);\n        $relative_file_path = ltrim(\n            preg_replace('#^' . preg_quote($this->sourceMetadata['path']) . '#', '', $filename),\n            '/\\\\'\n        );\n\n        if (isset($this->s3Args['Key'])) {\n            return rtrim($this->s3Args['Key'], '/').'/'.$relative_file_path;\n        }\n\n        return $relative_file_path;\n    }\n\n    private function addDebugToBefore($debug)\n    {\n        $before = $this->before;\n        $sourcePath = $this->sourceMetadata['path'];\n        $s3Args = $this->s3Args;\n\n        $this->before = static function (\n            CommandInterface $command\n        ) use ($before, $debug, $sourcePath, $s3Args) {\n            // Call the composed before function.\n            $before and $before($command);\n\n            // Determine the source and dest values based on operation.\n            switch ($operation = $command->getName()) {\n                case 'GetObject':\n                    $source = \"s3://{$command['Bucket']}/{$command['Key']}\";\n                    $dest = $command['@http']['sink'];\n                    break;\n                case 'PutObject':\n                    $source = $command['SourceFile'];\n                    $dest = \"s3://{$command['Bucket']}/{$command['Key']}\";\n                    break;\n                case 'UploadPart':\n                    $part = $command['PartNumber'];\n                case 'CreateMultipartUpload':\n                case 'CompleteMultipartUpload':\n                    $sourceKey = $command['Key'];\n                    if (isset($s3Args['Key']) && strpos($sourceKey, $s3Args['Key']) === 0) {\n                        $sourceKey = substr($sourceKey, strlen($s3Args['Key']) + 1);\n                    }\n                    $source = \"{$sourcePath}/{$sourceKey}\";\n                    $dest = \"s3://{$command['Bucket']}/{$command['Key']}\";\n                    break;\n                default:\n                    throw new \\UnexpectedValueException(\n                        \"Transfer encountered an unexpected operation: {$operation}.\"\n                    );\n            }\n\n            // Print the debugging message.\n            $context = sprintf('%s -> %s (%s)', $source, $dest, $operation);\n            if (isset($part)) {\n                $context .= \" : Part={$part}\";\n            }\n            fwrite($debug, \"Transferring {$context}\\n\");\n        };\n    }\n}\n", "num_lines": 437}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3;\n\nuse Aws\\Api\\Parser\\AbstractParser;\nuse Aws\\Api\\Service;\nuse Aws\\Api\\StructureShape;\nuse Aws\\CommandInterface;\nuse Aws\\S3\\Exception\\S3Exception;\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Psr\\Http\\Message\\StreamInterface;\n\n/**\n * @internal Decorates a parser for the S3 service to validate the response checksum.\n */\nclass ValidateResponseChecksumParser extends AbstractParser\n{\n    use CalculatesChecksumTrait;\n    /**\n     * @param callable $parser Parser to wrap.\n     */\n    public function __construct(callable $parser, Service $api)\n    {\n        $this->api = $api;\n        $this->parser = $parser;\n    }\n\n    public function __invoke(\n        CommandInterface $command,\n        ResponseInterface $response\n    ) {\n        $fn = $this->parser;\n        $result = $fn($command, $response);\n\n        //Skip this middleware if the operation doesn't have an httpChecksum\n        $op = $this->api->getOperation($command->getName());\n        $checksumInfo = isset($op['httpChecksum'])\n            ? $op['httpChecksum']\n            : [];\n        if (empty($checksumInfo)) {\n            return $result;\n        }\n\n        //Skip this middleware if the operation doesn't send back a checksum, or the user doesn't opt in\n        $checksumModeEnabledMember = isset($checksumInfo['requestValidationModeMember'])\n            ? $checksumInfo['requestValidationModeMember']\n            : \"\";\n        $checksumModeEnabled = isset($command[$checksumModeEnabledMember])\n            ? $command[$checksumModeEnabledMember]\n            : \"\";\n        $responseAlgorithms = isset($checksumInfo['responseAlgorithms'])\n            ? $checksumInfo['responseAlgorithms']\n            : [];\n        if (empty($responseAlgorithms)\n            || strtolower($checksumModeEnabled) !== \"enabled\"\n        ) {\n            return $result;\n        }\n\n        if (extension_loaded('awscrt')) {\n            $checksumPriority = ['CRC32C', 'CRC32', 'SHA1', 'SHA256'];\n        } else {\n            $checksumPriority = ['CRC32', 'SHA1', 'SHA256'];\n        }\n        $checksumsToCheck = array_intersect($responseAlgorithms, $checksumPriority);\n        $checksumValidationInfo = $this->validateChecksum($checksumsToCheck, $response);\n\n        if ($checksumValidationInfo['status'] == \"SUCCEEDED\") {\n            $result['ChecksumValidated'] = $checksumValidationInfo['checksum'];\n        } else if ($checksumValidationInfo['status'] == \"FAILED\"){\n            //Ignore failed validations on GetObject if it's a multipart get which returned a full multipart object\n            if ($command->getName() == \"GetObject\"\n                && !empty($checksumValidationInfo['checksumHeaderValue'])\n            ) {\n                $headerValue = $checksumValidationInfo['checksumHeaderValue'];\n                $lastDashPos = strrpos($headerValue, '-');\n                $endOfChecksum = substr($headerValue, $lastDashPos + 1);\n                if (is_numeric($endOfChecksum)\n                    && intval($endOfChecksum) > 1\n                    && intval($endOfChecksum) < 10000) {\n                    return $result;\n                }\n            }\n            throw new S3Exception(\n                \"Calculated response checksum did not match the expected value\",\n                $command\n            );\n        }\n        return $result;\n    }\n\n    public function parseMemberFromStream(\n        StreamInterface $stream,\n        StructureShape $member,\n        $response\n    ) {\n        return $this->parser->parseMemberFromStream($stream, $member, $response);\n    }\n\n    /**\n     * @param $checksumPriority\n     * @param ResponseInterface $response\n     */\n    public function validateChecksum($checksumPriority, ResponseInterface $response)\n    {\n        $checksumToValidate = $this->chooseChecksumHeaderToValidate(\n            $checksumPriority,\n            $response\n        );\n        $validationStatus = \"SKIPPED\";\n        $checksumHeaderValue = null;\n        if (!empty($checksumToValidate)) {\n            $checksumHeaderValue = $response->getHeader(\n                'x-amz-checksum-' . $checksumToValidate\n            );\n            if (isset($checksumHeaderValue)) {\n                $checksumHeaderValue = $checksumHeaderValue[0];\n                $calculatedChecksumValue = $this->getEncodedValue(\n                    $checksumToValidate,\n                    $response->getBody()\n                );\n                $validationStatus = $checksumHeaderValue == $calculatedChecksumValue\n                    ? \"SUCCEEDED\"\n                    : \"FAILED\";\n            }\n        }\n        return [\n            \"status\" => $validationStatus,\n            \"checksum\" => $checksumToValidate,\n            \"checksumHeaderValue\" => $checksumHeaderValue,\n        ];\n    }\n\n    /**\n     * @param $checksumPriority\n     * @param ResponseInterface $response\n     */\n    public function chooseChecksumHeaderToValidate(\n        $checksumPriority,\n        ResponseInterface $response\n    ) {\n        foreach ($checksumPriority as $checksum) {\n            $checksumHeader = 'x-amz-checksum-' . $checksum;\n            if ($response->hasHeader($checksumHeader)) {\n                return $checksum;\n            }\n        }\n        return null;\n    }\n}\n", "num_lines": 150}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\Crypto;\n\nuse Aws\\Crypto\\MaterialsProvider;\nuse Aws\\Crypto\\MetadataEnvelope;\nuse Aws\\Crypto\\MetadataStrategyInterface;\n\ntrait CryptoParamsTrait\n{\n    protected function getMaterialsProvider(array $args)\n    {\n        if ($args['@MaterialsProvider'] instanceof MaterialsProvider) {\n            return $args['@MaterialsProvider'];\n        }\n\n        throw new \\InvalidArgumentException('An instance of MaterialsProvider'\n            . ' must be passed in the \"MaterialsProvider\" field.');\n    }\n\n    protected function getInstructionFileSuffix(array $args)\n    {\n        return !empty($args['@InstructionFileSuffix'])\n            ? $args['@InstructionFileSuffix']\n            : $this->instructionFileSuffix;\n    }\n\n    protected function determineGetObjectStrategy(\n        $result,\n        $instructionFileSuffix\n    ) {\n        if (isset($result['Metadata'][MetadataEnvelope::CONTENT_KEY_V2_HEADER])) {\n            return new HeadersMetadataStrategy();\n        }\n\n        return new InstructionFileMetadataStrategy(\n            $this->client,\n            $instructionFileSuffix\n        );\n    }\n\n    protected function getMetadataStrategy(array $args, $instructionFileSuffix)\n    {\n        if (!empty($args['@MetadataStrategy'])) {\n            if ($args['@MetadataStrategy'] instanceof MetadataStrategyInterface) {\n                return $args['@MetadataStrategy'];\n            }\n\n            if (is_string($args['@MetadataStrategy'])) {\n                switch ($args['@MetadataStrategy']) {\n                    case HeadersMetadataStrategy::class:\n                        return new HeadersMetadataStrategy();\n                    case InstructionFileMetadataStrategy::class:\n                        return new InstructionFileMetadataStrategy(\n                            $this->client,\n                            $instructionFileSuffix\n                        );\n                    default:\n                        throw new \\InvalidArgumentException('Could not match the'\n                            . ' specified string in \"MetadataStrategy\" to a'\n                            . ' predefined strategy.');\n                }\n            } else {\n                throw new \\InvalidArgumentException('The metadata strategy that'\n                    . ' was passed to \"MetadataStrategy\" was unrecognized.');\n            }\n        } elseif ($instructionFileSuffix) {\n            return new InstructionFileMetadataStrategy(\n                $this->client,\n                $instructionFileSuffix\n            );\n        }\n\n        return null;\n    }\n}\n", "num_lines": 76}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\Crypto;\n\nuse Aws\\Crypto\\MaterialsProviderInterfaceV2;\n\ntrait CryptoParamsTraitV2\n{\n    use CryptoParamsTrait;\n\n    protected function getMaterialsProvider(array $args)\n    {\n        if ($args['@MaterialsProvider'] instanceof MaterialsProviderInterfaceV2) {\n            return $args['@MaterialsProvider'];\n        }\n\n        throw new \\InvalidArgumentException('An instance of MaterialsProviderInterfaceV2'\n            . ' must be passed in the \"MaterialsProvider\" field.');\n    }\n}\n", "num_lines": 20}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\Crypto;\n\nuse \\Aws\\Crypto\\MetadataStrategyInterface;\nuse \\Aws\\Crypto\\MetadataEnvelope;\n\nclass HeadersMetadataStrategy implements MetadataStrategyInterface\n{\n    /**\n     * Places the information in the MetadataEnvelope in to the metadata for\n     * the PutObject request of the encrypted object.\n     *\n     * @param MetadataEnvelope $envelope Encryption data to save according to\n     *                                   the strategy.\n     * @param array $args Arguments for PutObject that can be manipulated to\n     *                    store strategy related information.\n     *\n     * @return array Updated arguments for PutObject.\n     */\n    public function save(MetadataEnvelope $envelope, array $args)\n    {\n        foreach ($envelope as $header=>$value) {\n            $args['Metadata'][$header] = $value;\n        }\n\n        return $args;\n    }\n\n    /**\n     * Generates a MetadataEnvelope according to the metadata headers from the\n     * GetObject result.\n     *\n     * @param array $args Arguments from Command and Result that contains\n     *                    S3 Object information, relevant headers, and command\n     *                    configuration.\n     *\n     * @return MetadataEnvelope\n     */\n    public function load(array $args)\n    {\n        $envelope = new MetadataEnvelope();\n        $constantValues = MetadataEnvelope::getConstantValues();\n\n        foreach ($constantValues as $constant) {\n            if (!empty($args['Metadata'][$constant])) {\n                $envelope[$constant] = $args['Metadata'][$constant];\n            }\n        }\n\n        return $envelope;\n    }\n}\n", "num_lines": 53}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\Crypto;\n\nuse \\Aws\\Crypto\\MetadataStrategyInterface;\nuse \\Aws\\Crypto\\MetadataEnvelope;\nuse \\Aws\\S3\\S3Client;\n\n/**\n * Stores and reads encryption MetadataEnvelope information in a file on Amazon\n * S3.\n *\n * A file with the contents of a MetadataEnvelope will be created or read from\n * alongside the base file on Amazon S3. The provided client will be used for\n * reading or writing this object. A specified suffix (default of '.instruction'\n * will be applied to each of the operations involved with the instruction file.\n *\n * If there is a failure after an instruction file has been uploaded, it will\n * not be automatically deleted.\n */\nclass InstructionFileMetadataStrategy implements MetadataStrategyInterface\n{\n    const DEFAULT_FILE_SUFFIX = '.instruction';\n\n    private $client;\n    private $suffix;\n\n    /**\n     * @param S3Client $client Client for use in uploading the instruction file.\n     * @param string|null $suffix Optional override suffix for instruction file\n     *                            object keys.\n     */\n    public function __construct(S3Client $client, $suffix = null)\n    {\n        $this->suffix = empty($suffix)\n            ? self::DEFAULT_FILE_SUFFIX\n            : $suffix;\n        $this->client = $client;\n    }\n\n    /**\n     * Places the information in the MetadataEnvelope to a location on S3.\n     *\n     * @param MetadataEnvelope $envelope Encryption data to save according to\n     *                                   the strategy.\n     * @param array $args Starting arguments for PutObject, used for saving\n     *                    extra the instruction file.\n     *\n     * @return array Updated arguments for PutObject.\n     */\n    public function save(MetadataEnvelope $envelope, array $args)\n    {\n        $this->client->putObject([\n            'Bucket' => $args['Bucket'],\n            'Key' => $args['Key'] . $this->suffix,\n            'Body' => json_encode($envelope)\n        ]);\n\n        return $args;\n    }\n\n    /**\n     * Uses the strategy's client to retrieve the instruction file from S3 and generates\n     * a MetadataEnvelope from its contents.\n     *\n     * @param array $args Arguments from Command and Result that contains\n     *                    S3 Object information, relevant headers, and command\n     *                    configuration.\n     *\n     * @return MetadataEnvelope\n     */\n    public function load(array $args)\n    {\n        $result = $this->client->getObject([\n            'Bucket' => $args['Bucket'],\n            'Key' => $args['Key'] . $this->suffix\n        ]);\n\n        $metadataHeaders = json_decode($result['Body'], true);\n        $envelope = new MetadataEnvelope();\n        $constantValues = MetadataEnvelope::getConstantValues();\n\n        foreach ($constantValues as $constant) {\n            if (!empty($metadataHeaders[$constant])) {\n                $envelope[$constant] = $metadataHeaders[$constant];\n            }\n        }\n\n        return $envelope;\n    }\n}\n", "num_lines": 91}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\Crypto;\n\nuse Aws\\Crypto\\DecryptionTrait;\nuse Aws\\HashingStream;\nuse Aws\\PhpHash;\nuse Aws\\Crypto\\AbstractCryptoClient;\nuse Aws\\Crypto\\EncryptionTrait;\nuse Aws\\Crypto\\MetadataEnvelope;\nuse Aws\\Crypto\\MaterialsProvider;\nuse Aws\\Crypto\\Cipher\\CipherBuilderTrait;\nuse Aws\\S3\\S3Client;\nuse GuzzleHttp\\Promise;\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse GuzzleHttp\\Psr7;\n\n/**\n * Provides a wrapper for an S3Client that supplies functionality to encrypt\n * data on putObject[Async] calls and decrypt data on getObject[Async] calls.\n *\n * Legacy implementation using older encryption workflow.\n *\n * AWS strongly recommends the upgrade to the S3EncryptionClientV2 (over the\n * S3EncryptionClient), as it offers updated data security best practices to our\n * customers who upgrade. S3EncryptionClientV2 contains breaking changes, so this\n * will require planning by engineering teams to migrate. New workflows should\n * just start with S3EncryptionClientV2.\n *\n * @deprecated\n */\nclass S3EncryptionClient extends AbstractCryptoClient\n{\n    use CipherBuilderTrait;\n    use CryptoParamsTrait;\n    use DecryptionTrait;\n    use EncryptionTrait;\n    use UserAgentTrait;\n\n    const CRYPTO_VERSION = '1n';\n\n    private $client;\n    private $instructionFileSuffix;\n\n    /**\n     * @param S3Client $client The S3Client to be used for true uploading and\n     *                         retrieving objects from S3 when using the\n     *                         encryption client.\n     * @param string|null $instructionFileSuffix Suffix for a client wide\n     *                                           default when using instruction\n     *                                           files for metadata storage.\n     */\n    public function __construct(\n        S3Client $client,\n        $instructionFileSuffix = null\n    ) {\n        $this->appendUserAgent($client, 'feat/s3-encrypt/' . self::CRYPTO_VERSION);\n        $this->client = $client;\n        $this->instructionFileSuffix = $instructionFileSuffix;\n    }\n\n    private static function getDefaultStrategy()\n    {\n        return new HeadersMetadataStrategy();\n    }\n\n    /**\n     * Encrypts the data in the 'Body' field of $args and promises to upload it\n     * to the specified location on S3.\n     *\n     * @param array $args Arguments for encrypting an object and uploading it\n     *                    to S3 via PutObject.\n     *\n     * The required configuration arguments are as follows:\n     *\n     * - @MaterialsProvider: (MaterialsProvider) Provides Cek, Iv, and Cek\n     *   encrypting/decrypting for encryption metadata.\n     * - @CipherOptions: (array) Cipher options for encrypting data. Only the\n     *   Cipher option is required. Accepts the following:\n     *       - Cipher: (string) cbc|gcm\n     *            See also: AbstractCryptoClient::$supportedCiphers. Note that\n     *            cbc is deprecated and gcm should be used when possible.\n     *       - KeySize: (int) 128|192|256\n     *            See also: MaterialsProvider::$supportedKeySizes\n     *       - Aad: (string) Additional authentication data. This option is\n     *            passed directly to OpenSSL when using gcm. It is ignored when\n     *            using cbc. Note if you pass in Aad for gcm encryption, the\n     *            PHP SDK will be able to decrypt the resulting object, but other\n     *            AWS SDKs may not be able to do so.\n     *\n     * The optional configuration arguments are as follows:\n     *\n     * - @MetadataStrategy: (MetadataStrategy|string|null) Strategy for storing\n     *   MetadataEnvelope information. Defaults to using a\n     *   HeadersMetadataStrategy. Can either be a class implementing\n     *   MetadataStrategy, a class name of a predefined strategy, or empty/null\n     *   to default.\n     * - @InstructionFileSuffix: (string|null) Suffix used when writing to an\n     *   instruction file if using an InstructionFileMetadataHandler.\n     *\n     * @return PromiseInterface\n     *\n     * @throws \\InvalidArgumentException Thrown when arguments above are not\n     *                                   passed or are passed incorrectly.\n     */\n    public function putObjectAsync(array $args)\n    {\n        $provider = $this->getMaterialsProvider($args);\n        unset($args['@MaterialsProvider']);\n\n        $instructionFileSuffix = $this->getInstructionFileSuffix($args);\n        unset($args['@InstructionFileSuffix']);\n\n        $strategy = $this->getMetadataStrategy($args, $instructionFileSuffix);\n        unset($args['@MetadataStrategy']);\n\n        $envelope = new MetadataEnvelope();\n\n        return Promise\\Create::promiseFor($this->encrypt(\n            Psr7\\Utils::streamFor($args['Body']),\n            $args['@CipherOptions'] ?: [],\n            $provider,\n            $envelope\n        ))->then(\n            function ($encryptedBodyStream) use ($args) {\n                $hash = new PhpHash('sha256');\n                $hashingEncryptedBodyStream = new HashingStream(\n                    $encryptedBodyStream,\n                    $hash,\n                    self::getContentShaDecorator($args)\n                );\n                return [$hashingEncryptedBodyStream, $args];\n            }\n        )->then(\n            function ($putObjectContents) use ($strategy, $envelope) {\n                list($bodyStream, $args) = $putObjectContents;\n                if ($strategy === null) {\n                    $strategy = self::getDefaultStrategy();\n                }\n\n                $updatedArgs = $strategy->save($envelope, $args);\n                $updatedArgs['Body'] = $bodyStream;\n                return $updatedArgs;\n            }\n        )->then(\n            function ($args) {\n                unset($args['@CipherOptions']);\n                return $this->client->putObjectAsync($args);\n            }\n        );\n    }\n\n    private static function getContentShaDecorator(&$args)\n    {\n        return function ($hash) use (&$args) {\n            $args['ContentSHA256'] = bin2hex($hash);\n        };\n    }\n\n    /**\n     * Encrypts the data in the 'Body' field of $args and uploads it to the\n     * specified location on S3.\n     *\n     * @param array $args Arguments for encrypting an object and uploading it\n     *                    to S3 via PutObject.\n     *\n     * The required configuration arguments are as follows:\n     *\n     * - @MaterialsProvider: (MaterialsProvider) Provides Cek, Iv, and Cek\n     *   encrypting/decrypting for encryption metadata.\n     * - @CipherOptions: (array) Cipher options for encrypting data. A Cipher\n     *   is required. Accepts the following options:\n     *       - Cipher: (string) cbc|gcm\n     *            See also: AbstractCryptoClient::$supportedCiphers. Note that\n     *            cbc is deprecated and gcm should be used when possible.\n     *       - KeySize: (int) 128|192|256\n     *            See also: MaterialsProvider::$supportedKeySizes\n     *       - Aad: (string) Additional authentication data. This option is\n     *            passed directly to OpenSSL when using gcm. It is ignored when\n     *            using cbc. Note if you pass in Aad for gcm encryption, the\n     *            PHP SDK will be able to decrypt the resulting object, but other\n     *            AWS SDKs may not be able to do so.\n     *\n     * The optional configuration arguments are as follows:\n     *\n     * - @MetadataStrategy: (MetadataStrategy|string|null) Strategy for storing\n     *   MetadataEnvelope information. Defaults to using a\n     *   HeadersMetadataStrategy. Can either be a class implementing\n     *   MetadataStrategy, a class name of a predefined strategy, or empty/null\n     *   to default.\n     * - @InstructionFileSuffix: (string|null) Suffix used when writing to an\n     *   instruction file if an using an InstructionFileMetadataHandler was\n     *   determined.\n     *\n     * @return \\Aws\\Result PutObject call result with the details of uploading\n     *                     the encrypted file.\n     *\n     * @throws \\InvalidArgumentException Thrown when arguments above are not\n     *                                   passed or are passed incorrectly.\n     */\n    public function putObject(array $args)\n    {\n        return $this->putObjectAsync($args)->wait();\n    }\n\n    /**\n     * Promises to retrieve an object from S3 and decrypt the data in the\n     * 'Body' field.\n     *\n     * @param array $args Arguments for retrieving an object from S3 via\n     *                    GetObject and decrypting it.\n     *\n     * The required configuration argument is as follows:\n     *\n     * - @MaterialsProvider: (MaterialsProvider) Provides Cek, Iv, and Cek\n     *   encrypting/decrypting for decryption metadata. May have data loaded\n     *   from the MetadataEnvelope upon decryption.\n     *\n     * The optional configuration arguments are as follows:\n     *\n     * - SaveAs: (string) The path to a file on disk to save the decrypted\n     *   object data. This will be handled by file_put_contents instead of the\n     *   Guzzle sink.\n     *\n     * - @MetadataStrategy: (MetadataStrategy|string|null) Strategy for reading\n     *   MetadataEnvelope information. Defaults to determining based on object\n     *   response headers. Can either be a class implementing MetadataStrategy,\n     *   a class name of a predefined strategy, or empty/null to default.\n     * - @InstructionFileSuffix: (string) Suffix used when looking for an\n     *   instruction file if an InstructionFileMetadataHandler is being used.\n     * - @CipherOptions: (array) Cipher options for decrypting data. A Cipher\n     *   is required. Accepts the following options:\n     *       - Aad: (string) Additional authentication data. This option is\n     *            passed directly to OpenSSL when using gcm. It is ignored when\n     *            using cbc.\n     *\n     * @return PromiseInterface\n     *\n     * @throws \\InvalidArgumentException Thrown when required arguments are not\n     *                                   passed or are passed incorrectly.\n     */\n    public function getObjectAsync(array $args)\n    {\n        $provider = $this->getMaterialsProvider($args);\n        unset($args['@MaterialsProvider']);\n\n        $instructionFileSuffix = $this->getInstructionFileSuffix($args);\n        unset($args['@InstructionFileSuffix']);\n\n        $strategy = $this->getMetadataStrategy($args, $instructionFileSuffix);\n        unset($args['@MetadataStrategy']);\n\n        $saveAs = null;\n        if (!empty($args['SaveAs'])) {\n            $saveAs = $args['SaveAs'];\n        }\n\n        $promise = $this->client->getObjectAsync($args)\n            ->then(\n                function ($result) use (\n                    $provider,\n                    $instructionFileSuffix,\n                    $strategy,\n                    $args\n                ) {\n                    if ($strategy === null) {\n                        $strategy = $this->determineGetObjectStrategy(\n                            $result,\n                            $instructionFileSuffix\n                        );\n                    }\n\n                    $envelope = $strategy->load($args + [\n                        'Metadata' => $result['Metadata']\n                    ]);\n\n                    $provider = $provider->fromDecryptionEnvelope($envelope);\n\n                    $result['Body'] = $this->decrypt(\n                        $result['Body'],\n                        $provider,\n                        $envelope,\n                        isset($args['@CipherOptions'])\n                            ? $args['@CipherOptions']\n                            : []\n                    );\n                    return $result;\n                }\n            )->then(\n                function ($result) use ($saveAs) {\n                    if (!empty($saveAs)) {\n                        file_put_contents(\n                            $saveAs,\n                            (string)$result['Body'],\n                            LOCK_EX\n                        );\n                    }\n                    return $result;\n                }\n            );\n\n        return $promise;\n    }\n\n    /**\n     * Retrieves an object from S3 and decrypts the data in the 'Body' field.\n     *\n     * @param array $args Arguments for retrieving an object from S3 via\n     *                    GetObject and decrypting it.\n     *\n     * The required configuration argument is as follows:\n     *\n     * - @MaterialsProvider: (MaterialsProvider) Provides Cek, Iv, and Cek\n     *   encrypting/decrypting for decryption metadata. May have data loaded\n     *   from the MetadataEnvelope upon decryption.\n     *\n     * The optional configuration arguments are as follows:\n     *\n     * - SaveAs: (string) The path to a file on disk to save the decrypted\n     *   object data. This will be handled by file_put_contents instead of the\n     *   Guzzle sink.\n     * - @InstructionFileSuffix: (string|null) Suffix used when looking for an\n     *   instruction file if an InstructionFileMetadataHandler was detected.\n     * - @CipherOptions: (array) Cipher options for encrypting data. A Cipher\n     *   is required. Accepts the following options:\n     *       - Aad: (string) Additional authentication data. This option is\n     *            passed directly to OpenSSL when using gcm. It is ignored when\n     *            using cbc.\n     *\n     * @return \\Aws\\Result GetObject call result with the 'Body' field\n     *                     wrapped in a decryption stream with its metadata\n     *                     information.\n     *\n     * @throws \\InvalidArgumentException Thrown when arguments above are not\n     *                                   passed or are passed incorrectly.\n     */\n    public function getObject(array $args)\n    {\n        return $this->getObjectAsync($args)->wait();\n    }\n}\n", "num_lines": 341}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\Crypto;\n\nuse Aws\\Crypto\\DecryptionTraitV2;\nuse Aws\\Exception\\CryptoException;\nuse Aws\\HashingStream;\nuse Aws\\PhpHash;\nuse Aws\\Crypto\\AbstractCryptoClientV2;\nuse Aws\\Crypto\\EncryptionTraitV2;\nuse Aws\\Crypto\\MetadataEnvelope;\nuse Aws\\Crypto\\MaterialsProvider;\nuse Aws\\Crypto\\Cipher\\CipherBuilderTrait;\nuse Aws\\S3\\S3Client;\nuse GuzzleHttp\\Promise;\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse GuzzleHttp\\Psr7;\n\n/**\n * Provides a wrapper for an S3Client that supplies functionality to encrypt\n * data on putObject[Async] calls and decrypt data on getObject[Async] calls.\n *\n * AWS strongly recommends the upgrade to the S3EncryptionClientV2 (over the\n * S3EncryptionClient), as it offers updated data security best practices to our\n * customers who upgrade. S3EncryptionClientV2 contains breaking changes, so this\n * will require planning by engineering teams to migrate. New workflows should\n * just start with S3EncryptionClientV2.\n *\n * Note that for PHP versions of < 7.1, this class uses an AES-GCM polyfill\n * for encryption since there is no native PHP support. The performance for large\n * inputs will be a lot slower than for PHP 7.1+, so upgrading older PHP version\n * environments may be necessary to use this effectively.\n *\n * Example write path:\n *\n * <code>\n * use Aws\\Crypto\\KmsMaterialsProviderV2;\n * use Aws\\S3\\Crypto\\S3EncryptionClientV2;\n * use Aws\\S3\\S3Client;\n *\n * $encryptionClient = new S3EncryptionClientV2(\n *     new S3Client([\n *         'region' => 'us-west-2',\n *         'version' => 'latest'\n *     ])\n * );\n * $materialsProvider = new KmsMaterialsProviderV2(\n *     new KmsClient([\n *         'profile' => 'default',\n *         'region' => 'us-east-1',\n *         'version' => 'latest',\n *     ],\n *    'your-kms-key-id'\n * );\n *\n * $encryptionClient->putObject([\n *     '@MaterialsProvider' => $materialsProvider,\n *     '@CipherOptions' => [\n *         'Cipher' => 'gcm',\n *         'KeySize' => 256,\n *     ],\n *     '@KmsEncryptionContext' => ['foo' => 'bar'],\n *     'Bucket' => 'your-bucket',\n *     'Key' => 'your-key',\n *     'Body' => 'your-encrypted-data',\n * ]);\n * </code>\n *\n * Example read call (using objects from previous example):\n *\n * <code>\n * $encryptionClient->getObject([\n *     '@MaterialsProvider' => $materialsProvider,\n *     '@CipherOptions' => [\n *         'Cipher' => 'gcm',\n *         'KeySize' => 256,\n *     ],\n *     'Bucket' => 'your-bucket',\n *     'Key' => 'your-key',\n * ]);\n * </code>\n */\nclass S3EncryptionClientV2 extends AbstractCryptoClientV2\n{\n    use CipherBuilderTrait;\n    use CryptoParamsTraitV2;\n    use DecryptionTraitV2;\n    use EncryptionTraitV2;\n    use UserAgentTrait;\n\n    const CRYPTO_VERSION = '2.1';\n\n    private $client;\n    private $instructionFileSuffix;\n    private $legacyWarningCount;\n\n    /**\n     * @param S3Client $client The S3Client to be used for true uploading and\n     *                         retrieving objects from S3 when using the\n     *                         encryption client.\n     * @param string|null $instructionFileSuffix Suffix for a client wide\n     *                                           default when using instruction\n     *                                           files for metadata storage.\n     */\n    public function __construct(\n        S3Client $client,\n        $instructionFileSuffix = null\n    ) {\n        $this->appendUserAgent($client, 'feat/s3-encrypt/' . self::CRYPTO_VERSION);\n        $this->client = $client;\n        $this->instructionFileSuffix = $instructionFileSuffix;\n        $this->legacyWarningCount = 0;\n    }\n\n    private static function getDefaultStrategy()\n    {\n        return new HeadersMetadataStrategy();\n    }\n\n    /**\n     * Encrypts the data in the 'Body' field of $args and promises to upload it\n     * to the specified location on S3.\n     *\n     * Note that for PHP versions of < 7.1, this operation uses an AES-GCM\n     * polyfill for encryption since there is no native PHP support. The\n     * performance for large inputs will be a lot slower than for PHP 7.1+, so\n     * upgrading older PHP version environments may be necessary to use this\n     * effectively.\n     *\n     * @param array $args Arguments for encrypting an object and uploading it\n     *                    to S3 via PutObject.\n     *\n     * The required configuration arguments are as follows:\n     *\n     * - @MaterialsProvider: (MaterialsProviderV2) Provides Cek, Iv, and Cek\n     *   encrypting/decrypting for encryption metadata.\n     * - @CipherOptions: (array) Cipher options for encrypting data. Only the\n     *   Cipher option is required. Accepts the following:\n     *       - Cipher: (string) gcm\n     *            See also: AbstractCryptoClientV2::$supportedCiphers\n     *       - KeySize: (int) 128|256\n     *            See also: MaterialsProvider::$supportedKeySizes\n     *       - Aad: (string) Additional authentication data. This option is\n     *            passed directly to OpenSSL when using gcm. Note if you pass in\n     *            Aad, the PHP SDK will be able to decrypt the resulting object,\n     *            but other AWS SDKs may not be able to do so.\n     * - @KmsEncryptionContext: (array) Only required if using\n     *   KmsMaterialsProviderV2. An associative array of key-value\n     *   pairs to be added to the encryption context for KMS key encryption. An\n     *   empty array may be passed if no additional context is desired.\n     *\n     * The optional configuration arguments are as follows:\n     *\n     * - @MetadataStrategy: (MetadataStrategy|string|null) Strategy for storing\n     *   MetadataEnvelope information. Defaults to using a\n     *   HeadersMetadataStrategy. Can either be a class implementing\n     *   MetadataStrategy, a class name of a predefined strategy, or empty/null\n     *   to default.\n     * - @InstructionFileSuffix: (string|null) Suffix used when writing to an\n     *   instruction file if using an InstructionFileMetadataHandler.\n     *\n     * @return PromiseInterface\n     *\n     * @throws \\InvalidArgumentException Thrown when arguments above are not\n     *                                   passed or are passed incorrectly.\n     */\n    public function putObjectAsync(array $args)\n    {\n        $provider = $this->getMaterialsProvider($args);\n        unset($args['@MaterialsProvider']);\n\n        $instructionFileSuffix = $this->getInstructionFileSuffix($args);\n        unset($args['@InstructionFileSuffix']);\n\n        $strategy = $this->getMetadataStrategy($args, $instructionFileSuffix);\n        unset($args['@MetadataStrategy']);\n\n        $envelope = new MetadataEnvelope();\n\n        return Promise\\Create::promiseFor($this->encrypt(\n            Psr7\\Utils::streamFor($args['Body']),\n            $args,\n            $provider,\n            $envelope\n        ))->then(\n            function ($encryptedBodyStream) use ($args) {\n                $hash = new PhpHash('sha256');\n                $hashingEncryptedBodyStream = new HashingStream(\n                    $encryptedBodyStream,\n                    $hash,\n                    self::getContentShaDecorator($args)\n                );\n                return [$hashingEncryptedBodyStream, $args];\n            }\n        )->then(\n            function ($putObjectContents) use ($strategy, $envelope) {\n                list($bodyStream, $args) = $putObjectContents;\n                if ($strategy === null) {\n                    $strategy = self::getDefaultStrategy();\n                }\n\n                $updatedArgs = $strategy->save($envelope, $args);\n                $updatedArgs['Body'] = $bodyStream;\n                return $updatedArgs;\n            }\n        )->then(\n            function ($args) {\n                unset($args['@CipherOptions']);\n                return $this->client->putObjectAsync($args);\n            }\n        );\n    }\n\n    private static function getContentShaDecorator(&$args)\n    {\n        return function ($hash) use (&$args) {\n            $args['ContentSHA256'] = bin2hex($hash);\n        };\n    }\n\n    /**\n     * Encrypts the data in the 'Body' field of $args and uploads it to the\n     * specified location on S3.\n     *\n     * Note that for PHP versions of < 7.1, this operation uses an AES-GCM\n     * polyfill for encryption since there is no native PHP support. The\n     * performance for large inputs will be a lot slower than for PHP 7.1+, so\n     * upgrading older PHP version environments may be necessary to use this\n     * effectively.\n     *\n     * @param array $args Arguments for encrypting an object and uploading it\n     *                    to S3 via PutObject.\n     *\n     * The required configuration arguments are as follows:\n     *\n     * - @MaterialsProvider: (MaterialsProvider) Provides Cek, Iv, and Cek\n     *   encrypting/decrypting for encryption metadata.\n     * - @CipherOptions: (array) Cipher options for encrypting data. A Cipher\n     *   is required. Accepts the following options:\n     *       - Cipher: (string) gcm\n     *            See also: AbstractCryptoClientV2::$supportedCiphers\n     *       - KeySize: (int) 128|256\n     *            See also: MaterialsProvider::$supportedKeySizes\n     *       - Aad: (string) Additional authentication data. This option is\n     *            passed directly to OpenSSL when using gcm. Note if you pass in\n     *            Aad, the PHP SDK will be able to decrypt the resulting object,\n     *            but other AWS SDKs may not be able to do so.\n     * - @KmsEncryptionContext: (array) Only required if using\n     *   KmsMaterialsProviderV2. An associative array of key-value\n     *   pairs to be added to the encryption context for KMS key encryption. An\n     *   empty array may be passed if no additional context is desired.\n     *\n     * The optional configuration arguments are as follows:\n     *\n     * - @MetadataStrategy: (MetadataStrategy|string|null) Strategy for storing\n     *   MetadataEnvelope information. Defaults to using a\n     *   HeadersMetadataStrategy. Can either be a class implementing\n     *   MetadataStrategy, a class name of a predefined strategy, or empty/null\n     *   to default.\n     * - @InstructionFileSuffix: (string|null) Suffix used when writing to an\n     *   instruction file if an using an InstructionFileMetadataHandler was\n     *   determined.\n     *\n     * @return \\Aws\\Result PutObject call result with the details of uploading\n     *                     the encrypted file.\n     *\n     * @throws \\InvalidArgumentException Thrown when arguments above are not\n     *                                   passed or are passed incorrectly.\n     */\n    public function putObject(array $args)\n    {\n        return $this->putObjectAsync($args)->wait();\n    }\n\n    /**\n     * Promises to retrieve an object from S3 and decrypt the data in the\n     * 'Body' field.\n     *\n     * @param array $args Arguments for retrieving an object from S3 via\n     *                    GetObject and decrypting it.\n     *\n     * The required configuration argument is as follows:\n     *\n     * - @MaterialsProvider: (MaterialsProviderInterface) Provides Cek, Iv, and Cek\n     *   encrypting/decrypting for decryption metadata. May have data loaded\n     *   from the MetadataEnvelope upon decryption.\n     * - @SecurityProfile: (string) Must be set to 'V2' or 'V2_AND_LEGACY'.\n     *      - 'V2' indicates that only objects encrypted with S3EncryptionClientV2\n     *        content encryption and key wrap schemas are able to be decrypted.\n     *      - 'V2_AND_LEGACY' indicates that objects encrypted with both\n     *        S3EncryptionClientV2 and older legacy encryption clients are able\n     *        to be decrypted.\n     *\n     * The optional configuration arguments are as follows:\n     *\n     * - SaveAs: (string) The path to a file on disk to save the decrypted\n     *   object data. This will be handled by file_put_contents instead of the\n     *   Guzzle sink.\n     *\n     * - @MetadataStrategy: (MetadataStrategy|string|null) Strategy for reading\n     *   MetadataEnvelope information. Defaults to determining based on object\n     *   response headers. Can either be a class implementing MetadataStrategy,\n     *   a class name of a predefined strategy, or empty/null to default.\n     * - @InstructionFileSuffix: (string) Suffix used when looking for an\n     *   instruction file if an InstructionFileMetadataHandler is being used.\n     * - @CipherOptions: (array) Cipher options for decrypting data. A Cipher\n     *   is required. Accepts the following options:\n     *       - Aad: (string) Additional authentication data. This option is\n     *            passed directly to OpenSSL when using gcm. It is ignored when\n     *            using cbc.\n     * - @KmsAllowDecryptWithAnyCmk: (bool) This allows decryption with\n     *   KMS materials for any KMS key ID, instead of needing the KMS key ID to\n     *   be specified and provided to the decrypt operation. Ignored for non-KMS\n     *   materials providers. Defaults to false.\n     *\n     * @return PromiseInterface\n     *\n     * @throws \\InvalidArgumentException Thrown when required arguments are not\n     *                                   passed or are passed incorrectly.\n     */\n    public function getObjectAsync(array $args)\n    {\n        $provider = $this->getMaterialsProvider($args);\n        unset($args['@MaterialsProvider']);\n\n        $instructionFileSuffix = $this->getInstructionFileSuffix($args);\n        unset($args['@InstructionFileSuffix']);\n\n        $strategy = $this->getMetadataStrategy($args, $instructionFileSuffix);\n        unset($args['@MetadataStrategy']);\n\n        if (!isset($args['@SecurityProfile'])\n            || !in_array($args['@SecurityProfile'], self::$supportedSecurityProfiles)\n        ) {\n            throw new CryptoException(\"@SecurityProfile is required and must be\"\n                . \" set to 'V2' or 'V2_AND_LEGACY'\");\n        }\n\n        // Only throw this legacy warning once per client\n        if (in_array($args['@SecurityProfile'], self::$legacySecurityProfiles)\n            && $this->legacyWarningCount < 1\n        ) {\n            $this->legacyWarningCount++;\n            trigger_error(\n                \"This S3 Encryption Client operation is configured to\"\n                    . \" read encrypted data with legacy encryption modes. If you\"\n                    . \" don't have objects encrypted with these legacy modes,\"\n                    . \" you should disable support for them to enhance security. \",\n                E_USER_WARNING\n            );\n        }\n\n        $saveAs = null;\n        if (!empty($args['SaveAs'])) {\n            $saveAs = $args['SaveAs'];\n        }\n\n        $promise = $this->client->getObjectAsync($args)\n            ->then(\n                function ($result) use (\n                    $provider,\n                    $instructionFileSuffix,\n                    $strategy,\n                    $args\n                ) {\n                    if ($strategy === null) {\n                        $strategy = $this->determineGetObjectStrategy(\n                            $result,\n                            $instructionFileSuffix\n                        );\n                    }\n\n                    $envelope = $strategy->load($args + [\n                        'Metadata' => $result['Metadata']\n                    ]);\n\n                    $result['Body'] = $this->decrypt(\n                        $result['Body'],\n                        $provider,\n                        $envelope,\n                        $args\n                    );\n                    return $result;\n                }\n            )->then(\n                function ($result) use ($saveAs) {\n                    if (!empty($saveAs)) {\n                        file_put_contents(\n                            $saveAs,\n                            (string)$result['Body'],\n                            LOCK_EX\n                        );\n                    }\n                    return $result;\n                }\n            );\n\n        return $promise;\n    }\n\n    /**\n     * Retrieves an object from S3 and decrypts the data in the 'Body' field.\n     *\n     * @param array $args Arguments for retrieving an object from S3 via\n     *                    GetObject and decrypting it.\n     *\n     * The required configuration argument is as follows:\n     *\n     * - @MaterialsProvider: (MaterialsProviderInterface) Provides Cek, Iv, and Cek\n     *   encrypting/decrypting for decryption metadata. May have data loaded\n     *   from the MetadataEnvelope upon decryption.\n     * - @SecurityProfile: (string) Must be set to 'V2' or 'V2_AND_LEGACY'.\n     *      - 'V2' indicates that only objects encrypted with S3EncryptionClientV2\n     *        content encryption and key wrap schemas are able to be decrypted.\n     *      - 'V2_AND_LEGACY' indicates that objects encrypted with both\n     *        S3EncryptionClientV2 and older legacy encryption clients are able\n     *        to be decrypted.\n     *\n     * The optional configuration arguments are as follows:\n     *\n     * - SaveAs: (string) The path to a file on disk to save the decrypted\n     *   object data. This will be handled by file_put_contents instead of the\n     *   Guzzle sink.\n     * - @InstructionFileSuffix: (string|null) Suffix used when looking for an\n     *   instruction file if an InstructionFileMetadataHandler was detected.\n     * - @CipherOptions: (array) Cipher options for encrypting data. A Cipher\n     *   is required. Accepts the following options:\n     *       - Aad: (string) Additional authentication data. This option is\n     *            passed directly to OpenSSL when using gcm. It is ignored when\n     *            using cbc.\n     * - @KmsAllowDecryptWithAnyCmk: (bool) This allows decryption with\n     *   KMS materials for any KMS key ID, instead of needing the KMS key ID to\n     *   be specified and provided to the decrypt operation. Ignored for non-KMS\n     *   materials providers. Defaults to false.\n     *\n     * @return \\Aws\\Result GetObject call result with the 'Body' field\n     *                     wrapped in a decryption stream with its metadata\n     *                     information.\n     *\n     * @throws \\InvalidArgumentException Thrown when arguments above are not\n     *                                   passed or are passed incorrectly.\n     */\n    public function getObject(array $args)\n    {\n        return $this->getObjectAsync($args)->wait();\n    }\n}\n", "num_lines": 447}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\Crypto;\n\nuse Aws\\Crypto\\AbstractCryptoClient;\nuse Aws\\Crypto\\EncryptionTrait;\nuse Aws\\Crypto\\MetadataEnvelope;\nuse Aws\\Crypto\\Cipher\\CipherBuilderTrait;\nuse Aws\\S3\\MultipartUploader;\nuse Aws\\S3\\S3ClientInterface;\nuse GuzzleHttp\\Promise;\n\n/**\n * Encapsulates the execution of a multipart upload of an encrypted object to S3.\n *\n * Legacy implementation using older encryption workflow. Use\n * S3EncryptionMultipartUploaderV2 if possible.\n *\n * @deprecated\n */\nclass S3EncryptionMultipartUploader extends MultipartUploader\n{\n    use CipherBuilderTrait;\n    use CryptoParamsTrait;\n    use EncryptionTrait;\n    use UserAgentTrait;\n\n    const CRYPTO_VERSION = '1n';\n\n    /**\n     * Returns if the passed cipher name is supported for encryption by the SDK.\n     *\n     * @param string $cipherName The name of a cipher to verify is registered.\n     *\n     * @return bool If the cipher passed is in our supported list.\n     */\n    public static function isSupportedCipher($cipherName)\n    {\n        return in_array($cipherName, AbstractCryptoClient::$supportedCiphers);\n    }\n\n    private $provider;\n    private $instructionFileSuffix;\n    private $strategy;\n\n    /**\n     * Creates a multipart upload for an S3 object after encrypting it.\n     *\n     * The required configuration options are as follows:\n     *\n     * - @MaterialsProvider: (MaterialsProvider) Provides Cek, Iv, and Cek\n     *   encrypting/decrypting for encryption metadata.\n     * - @CipherOptions: (array) Cipher options for encrypting data. A Cipher\n     *   is required. Accepts the following options:\n     *       - Cipher: (string) cbc|gcm\n     *            See also: AbstractCryptoClient::$supportedCiphers. Note that\n     *            cbc is deprecated and gcm should be used when possible.\n     *       - KeySize: (int) 128|192|256\n     *            See also: MaterialsProvider::$supportedKeySizes\n     *       - Aad: (string) Additional authentication data. This option is\n     *            passed directly to OpenSSL when using gcm. It is ignored when\n     *            using cbc.\n     * - bucket: (string) Name of the bucket to which the object is\n     *   being uploaded.\n     * - key: (string) Key to use for the object being uploaded.\n     *\n     * The optional configuration arguments are as follows:\n     *\n     * - @MetadataStrategy: (MetadataStrategy|string|null) Strategy for storing\n     *   MetadataEnvelope information. Defaults to using a\n     *   HeadersMetadataStrategy. Can either be a class implementing\n     *   MetadataStrategy, a class name of a predefined strategy, or empty/null\n     *   to default.\n     * - @InstructionFileSuffix: (string|null) Suffix used when writing to an\n     *   instruction file if an using an InstructionFileMetadataHandler was\n     *   determined.\n     * - acl: (string) ACL to set on the object being upload. Objects are\n     *   private by default.\n     * - before_complete: (callable) Callback to invoke before the\n     *   `CompleteMultipartUpload` operation. The callback should have a\n     *   function signature like `function (Aws\\Command $command) {...}`.\n     * - before_initiate: (callable) Callback to invoke before the\n     *   `CreateMultipartUpload` operation. The callback should have a function\n     *   signature like `function (Aws\\Command $command) {...}`.\n     * - before_upload: (callable) Callback to invoke before any `UploadPart`\n     *   operations. The callback should have a function signature like\n     *   `function (Aws\\Command $command) {...}`.\n     * - concurrency: (int, default=int(5)) Maximum number of concurrent\n     *   `UploadPart` operations allowed during the multipart upload.\n     * - params: (array) An array of key/value parameters that will be applied\n     *   to each of the sub-commands run by the uploader as a base.\n     *   Auto-calculated options will override these parameters. If you need\n     *   more granularity over parameters to each sub-command, use the before_*\n     *   options detailed above to update the commands directly.\n     * - part_size: (int, default=int(5242880)) Part size, in bytes, to use when\n     *   doing a multipart upload. This must between 5 MB and 5 GB, inclusive.\n     * - state: (Aws\\Multipart\\UploadState) An object that represents the state\n     *   of the multipart upload and that is used to resume a previous upload.\n     *   When this option is provided, the `bucket`, `key`, and `part_size`\n     *   options are ignored.\n     *\n     * @param S3ClientInterface $client Client used for the upload.\n     * @param mixed             $source Source of the data to upload.\n     * @param array             $config Configuration used to perform the upload.\n     */\n    public function __construct(\n        S3ClientInterface $client,\n        $source,\n        array $config = []\n    ) {\n        $this->appendUserAgent($client, 'feat/s3-encrypt/' . self::CRYPTO_VERSION);\n        $this->client = $client;\n        $config['params'] = [];\n        if (!empty($config['bucket'])) {\n            $config['params']['Bucket'] = $config['bucket'];\n        }\n        if (!empty($config['key'])) {\n            $config['params']['Key'] = $config['key'];\n        }\n\n        $this->provider = $this->getMaterialsProvider($config);\n        unset($config['@MaterialsProvider']);\n\n        $this->instructionFileSuffix = $this->getInstructionFileSuffix($config);\n        unset($config['@InstructionFileSuffix']);\n        $this->strategy = $this->getMetadataStrategy(\n            $config,\n            $this->instructionFileSuffix\n        );\n        if ($this->strategy === null) {\n            $this->strategy = self::getDefaultStrategy();\n        }\n        unset($config['@MetadataStrategy']);\n\n        $config['prepare_data_source'] = $this->getEncryptingDataPreparer();\n\n        parent::__construct($client, $source, $config);\n    }\n\n    private static function getDefaultStrategy()\n    {\n        return new HeadersMetadataStrategy();\n    }\n\n    private function getEncryptingDataPreparer()\n    {\n        return function() {\n            // Defer encryption work until promise is executed\n            $envelope = new MetadataEnvelope();\n\n            list($this->source, $params) = Promise\\Create::promiseFor($this->encrypt(\n                $this->source,\n                $this->config['@cipheroptions'] ?: [],\n                $this->provider,\n                $envelope\n            ))->then(\n                function ($bodyStream) use ($envelope) {\n                    $params = $this->strategy->save(\n                        $envelope,\n                        $this->config['params']\n                    );\n                    return [$bodyStream, $params];\n                }\n            )->wait();\n\n            $this->source->rewind();\n            $this->config['params'] = $params;\n        };\n    }\n}", "num_lines": 169}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\Crypto;\n\nuse Aws\\Crypto\\AbstractCryptoClientV2;\nuse Aws\\Crypto\\EncryptionTraitV2;\nuse Aws\\Crypto\\MetadataEnvelope;\nuse Aws\\Crypto\\Cipher\\CipherBuilderTrait;\nuse Aws\\S3\\MultipartUploader;\nuse Aws\\S3\\S3ClientInterface;\nuse GuzzleHttp\\Promise;\n\n/**\n * Encapsulates the execution of a multipart upload of an encrypted object to S3.\n *\n * Note that for PHP versions of < 7.1, this class uses an AES-GCM polyfill\n * for encryption since there is no native PHP support. The performance for large\n * inputs will be a lot slower than for PHP 7.1+, so upgrading older PHP version\n * environments may be necessary to use this effectively.\n */\nclass S3EncryptionMultipartUploaderV2 extends MultipartUploader\n{\n    use CipherBuilderTrait;\n    use CryptoParamsTraitV2;\n    use EncryptionTraitV2;\n    use UserAgentTrait;\n\n    CONST CRYPTO_VERSION = '2.1';\n\n    /**\n     * Returns if the passed cipher name is supported for encryption by the SDK.\n     *\n     * @param string $cipherName The name of a cipher to verify is registered.\n     *\n     * @return bool If the cipher passed is in our supported list.\n     */\n    public static function isSupportedCipher($cipherName)\n    {\n        return in_array($cipherName, AbstractCryptoClientV2::$supportedCiphers);\n    }\n\n    private $provider;\n    private $instructionFileSuffix;\n    private $strategy;\n\n    /**\n     * Creates a multipart upload for an S3 object after encrypting it.\n     *\n     * Note that for PHP versions of < 7.1, this class uses an AES-GCM polyfill\n     * for encryption since there is no native PHP support. The performance for\n     * large inputs will be a lot slower than for PHP 7.1+, so upgrading older\n     * PHP version environments may be necessary to use this effectively.\n     *\n     * The required configuration options are as follows:\n     *\n     * - @MaterialsProvider: (MaterialsProviderV2) Provides Cek, Iv, and Cek\n     *   encrypting/decrypting for encryption metadata.\n     * - @CipherOptions: (array) Cipher options for encrypting data. A Cipher\n     *   is required. Accepts the following options:\n     *       - Cipher: (string) gcm\n     *            See also: AbstractCryptoClientV2::$supportedCiphers\n     *       - KeySize: (int) 128|256\n     *            See also: MaterialsProvider::$supportedKeySizes\n     *       - Aad: (string) Additional authentication data. This option is\n     *            passed directly to OpenSSL when using gcm.\n     * - @KmsEncryptionContext: (array) Only required if using\n     *   KmsMaterialsProviderV2. An associative array of key-value\n     *   pairs to be added to the encryption context for KMS key encryption. An\n     *   empty array may be passed if no additional context is desired.\n     * - bucket: (string) Name of the bucket to which the object is\n     *   being uploaded.\n     * - key: (string) Key to use for the object being uploaded.\n     *\n     * The optional configuration arguments are as follows:\n     *\n     * - @MetadataStrategy: (MetadataStrategy|string|null) Strategy for storing\n     *   MetadataEnvelope information. Defaults to using a\n     *   HeadersMetadataStrategy. Can either be a class implementing\n     *   MetadataStrategy, a class name of a predefined strategy, or empty/null\n     *   to default.\n     * - @InstructionFileSuffix: (string|null) Suffix used when writing to an\n     *   instruction file if an using an InstructionFileMetadataHandler was\n     *   determined.\n     * - acl: (string) ACL to set on the object being upload. Objects are\n     *   private by default.\n     * - before_complete: (callable) Callback to invoke before the\n     *   `CompleteMultipartUpload` operation. The callback should have a\n     *   function signature like `function (Aws\\Command $command) {...}`.\n     * - before_initiate: (callable) Callback to invoke before the\n     *   `CreateMultipartUpload` operation. The callback should have a function\n     *   signature like `function (Aws\\Command $command) {...}`.\n     * - before_upload: (callable) Callback to invoke before any `UploadPart`\n     *   operations. The callback should have a function signature like\n     *   `function (Aws\\Command $command) {...}`.\n     * - concurrency: (int, default=int(5)) Maximum number of concurrent\n     *   `UploadPart` operations allowed during the multipart upload.\n     * - params: (array) An array of key/value parameters that will be applied\n     *   to each of the sub-commands run by the uploader as a base.\n     *   Auto-calculated options will override these parameters. If you need\n     *   more granularity over parameters to each sub-command, use the before_*\n     *   options detailed above to update the commands directly.\n     * - part_size: (int, default=int(5242880)) Part size, in bytes, to use when\n     *   doing a multipart upload. This must between 5 MB and 5 GB, inclusive.\n     * - state: (Aws\\Multipart\\UploadState) An object that represents the state\n     *   of the multipart upload and that is used to resume a previous upload.\n     *   When this option is provided, the `bucket`, `key`, and `part_size`\n     *   options are ignored.\n     *\n     * @param S3ClientInterface $client Client used for the upload.\n     * @param mixed             $source Source of the data to upload.\n     * @param array             $config Configuration used to perform the upload.\n     */\n    public function __construct(\n        S3ClientInterface $client,\n        $source,\n        array $config = []\n    ) {\n        $this->appendUserAgent($client, 'feat/s3-encrypt/' . self::CRYPTO_VERSION);\n        $this->client = $client;\n        $config['params'] = [];\n        if (!empty($config['bucket'])) {\n            $config['params']['Bucket'] = $config['bucket'];\n        }\n        if (!empty($config['key'])) {\n            $config['params']['Key'] = $config['key'];\n        }\n\n        $this->provider = $this->getMaterialsProvider($config);\n        unset($config['@MaterialsProvider']);\n\n        $this->instructionFileSuffix = $this->getInstructionFileSuffix($config);\n        unset($config['@InstructionFileSuffix']);\n        $this->strategy = $this->getMetadataStrategy(\n            $config,\n            $this->instructionFileSuffix\n        );\n        if ($this->strategy === null) {\n            $this->strategy = self::getDefaultStrategy();\n        }\n        unset($config['@MetadataStrategy']);\n\n        $config['prepare_data_source'] = $this->getEncryptingDataPreparer();\n\n        parent::__construct($client, $source, $config);\n    }\n\n    private static function getDefaultStrategy()\n    {\n        return new HeadersMetadataStrategy();\n    }\n\n    private function getEncryptingDataPreparer()\n    {\n        return function() {\n            // Defer encryption work until promise is executed\n            $envelope = new MetadataEnvelope();\n\n            list($this->source, $params) = Promise\\Create::promiseFor($this->encrypt(\n                $this->source,\n                $this->config ?: [],\n                $this->provider,\n                $envelope\n            ))->then(\n                function ($bodyStream) use ($envelope) {\n                    $params = $this->strategy->save(\n                        $envelope,\n                        $this->config['params']\n                    );\n                    return [$bodyStream, $params];\n                }\n            )->wait();\n\n            $this->source->rewind();\n            $this->config['params'] = $params;\n        };\n    }\n}\n", "num_lines": 177}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\Crypto;\n\nuse Aws\\AwsClientInterface;\nuse Aws\\Middleware;\nuse Psr\\Http\\Message\\RequestInterface;\n\ntrait UserAgentTrait\n{\n    private function appendUserAgent(AwsClientInterface $client, $agentString)\n    {\n        $list = $client->getHandlerList();\n        $list->appendBuild(Middleware::mapRequest(\n            function(RequestInterface $req) use ($agentString) {\n                if (!empty($req->getHeader('User-Agent'))\n                    && !empty($req->getHeader('User-Agent')[0])\n                ) {\n                    $userAgent = $req->getHeader('User-Agent')[0];\n                    if (strpos($userAgent, $agentString) === false) {\n                        $userAgent .= \" {$agentString}\";\n                    };\n                } else {\n                    $userAgent = $agentString;\n                }\n\n                $req =  $req->withHeader('User-Agent', $userAgent);\n                return $req;\n            }\n        ));\n    }\n}\n", "num_lines": 32}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\n/**\n * Exception thrown when errors occur while deleting objects using a\n * {@see S3\\BatchDelete} object.\n */\nclass DeleteMultipleObjectsException extends \\Exception implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n\n    private $deleted = [];\n    private $errors = [];\n\n    /**\n     * @param array       $deleted Array of successfully deleted keys\n     * @param array       $errors  Array of errors that were encountered\n     */\n    public function __construct(array $deleted, array $errors)\n    {\n        $this->deleted = array_values($deleted);\n        $this->errors = array_values($errors);\n        parent::__construct('Unable to delete certain keys when executing a'\n            . ' DeleteMultipleObjects request: '\n            . self::createMessageFromErrors($errors));\n    }\n\n    /**\n     * Create a single error message from multiple errors.\n     *\n     * @param array $errors Errors encountered\n     *\n     * @return string\n     */\n    public static function createMessageFromErrors(array $errors)\n    {\n        return \"\\n- \" . implode(\"\\n- \", array_map(function ($key) {\n            return json_encode($key);\n        }, $errors));\n    }\n\n    /**\n     * Get the errored objects\n     *\n     * @return array Returns an array of associative arrays, each containing\n     *               a 'Code', 'Message', and 'Key' key.\n     */\n    public function getErrors()\n    {\n        return $this->errors;\n    }\n\n    /**\n     * Get the successfully deleted objects\n     *\n     * @return array Returns an array of associative arrays, each containing\n     *               a 'Key' and optionally 'DeleteMarker' and\n     *              'DeleterMarkerVersionId'\n     */\n    public function getDeleted()\n    {\n        return $this->deleted;\n    }\n}\n", "num_lines": 69}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\Exception;\n\nclass PermanentRedirectException extends S3Exception {}\n", "num_lines": 5}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon Simple Storage Service.\n */\nclass S3Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\Exception;\n\nuse Aws\\CommandInterface;\nuse Aws\\Exception\\AwsException;\nuse Aws\\Multipart\\UploadState;\n\nclass S3MultipartUploadException extends \\Aws\\Exception\\MultipartUploadException\n{\n    /** @var string Bucket of the transfer object */\n    private $bucket;\n    /** @var string Key of the transfer object */\n    private $key;\n    /** @var string Source file name of the transfer object */\n    private $filename;\n\n    /**\n     * @param UploadState      $state Upload state at time of the exception.\n     * @param \\Exception|array $prev  Exception being thrown. Could be an array of\n     *                                AwsExceptions being thrown when uploading parts\n     *                                for one object, or an instance of AwsException\n     *                                for a specific Multipart error being thrown in\n     *                                the MultipartUpload process.\n     */\n    public function __construct(UploadState $state, $prev = null) {\n        if (is_array($prev) && $error = $prev[key($prev)]) {\n            $this->collectPathInfo($error->getCommand());\n        } elseif ($prev instanceof AwsException) {\n            $this->collectPathInfo($prev->getCommand());\n        }\n        parent::__construct($state, $prev);\n    }\n\n    /**\n     * Get the Bucket information of the transfer object\n     *\n     * @return string|null Returns null when 'Bucket' information\n     *                     is unavailable.\n     */\n    public function getBucket()\n    {\n        return $this->bucket;\n    }\n\n    /**\n     * Get the Key information of the transfer object\n     *\n     * @return string|null Returns null when 'Key' information\n     *                     is unavailable.\n     */\n    public function getKey()\n    {\n        return $this->key;\n    }\n\n    /**\n     * Get the source file name of the transfer object\n     *\n     * @return string|null Returns null when metadata of the stream\n     *                     wrapped in 'Body' parameter is unavailable.\n     */\n    public function getSourceFileName()\n    {\n        return $this->filename;\n    }\n\n    /**\n     * Collect file path information when accessible. (Bucket, Key)\n     *\n     * @param CommandInterface $cmd\n     */\n    private function collectPathInfo(CommandInterface $cmd)\n    {\n        if (empty($this->bucket) && isset($cmd['Bucket'])) {\n            $this->bucket = $cmd['Bucket'];\n        }\n        if (empty($this->key) && isset($cmd['Key'])) {\n            $this->key = $cmd['Key'];\n        }\n        if (empty($this->filename) && isset($cmd['Body'])) {\n            $this->filename = $cmd['Body']->getMetadata('uri');\n        }\n    }\n}\n", "num_lines": 85}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\RegionalEndpoint;\n\nclass Configuration implements ConfigurationInterface\n{\n    private $endpointsType;\n    private $isFallback;\n\n    public function __construct($endpointsType, $isFallback = false)\n    {\n        $this->endpointsType = strtolower($endpointsType);\n        $this->isFallback = $isFallback;\n        if (!in_array($this->endpointsType, ['legacy', 'regional'])) {\n            throw new \\InvalidArgumentException(\n                \"Configuration parameter must either be 'legacy' or 'regional'.\"\n            );\n        }\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getEndpointsType()\n    {\n        return $this->endpointsType;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function toArray()\n    {\n        return [\n            'endpoints_type' => $this->getEndpointsType()\n        ];\n    }\n\n    public function isFallback()\n    {\n        return $this->isFallback;\n    }\n}\n", "num_lines": 43}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\RegionalEndpoint;\n\n/**\n * Provides access to S3 regional endpoints configuration options: endpoints_type\n */\ninterface ConfigurationInterface\n{\n    /**\n     * Returns the endpoints type\n     *\n     * @return string\n     */\n    public function getEndpointsType();\n\n    /**\n     * Returns the configuration as an associative array\n     *\n     * @return array\n     */\n    public function toArray();\n}\n", "num_lines": 23}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\RegionalEndpoint;\n\nuse Aws\\AbstractConfigurationProvider;\nuse Aws\\CacheInterface;\nuse Aws\\ConfigurationProviderInterface;\nuse Aws\\S3\\RegionalEndpoint\\Exception\\ConfigurationException;\nuse GuzzleHttp\\Promise;\n\n/**\n * A configuration provider is a function that returns a promise that is\n * fulfilled with a {@see \\Aws\\S3\\RegionalEndpoint\\ConfigurationInterface}\n * or rejected with an {@see \\Aws\\S3\\RegionalEndpoint\\Exception\\ConfigurationException}.\n *\n * <code>\n * use Aws\\S3\\RegionalEndpoint\\ConfigurationProvider;\n * $provider = ConfigurationProvider::defaultProvider();\n * // Returns a ConfigurationInterface or throws.\n * $config = $provider()->wait();\n * </code>\n *\n * Configuration providers can be composed to create configuration using\n * conditional logic that can create different configurations in different\n * environments. You can compose multiple providers into a single provider using\n * {@see \\Aws\\S3\\RegionalEndpoint\\ConfigurationProvider::chain}. This function\n * accepts providers as variadic arguments and returns a new function that will\n * invoke each provider until a successful configuration is returned.\n *\n * <code>\n * // First try an INI file at this location.\n * $a = ConfigurationProvider::ini(null, '/path/to/file.ini');\n * // Then try an INI file at this location.\n * $b = ConfigurationProvider::ini(null, '/path/to/other-file.ini');\n * // Then try loading from environment variables.\n * $c = ConfigurationProvider::env();\n * // Combine the three providers together.\n * $composed = ConfigurationProvider::chain($a, $b, $c);\n * // Returns a promise that is fulfilled with a configuration or throws.\n * $promise = $composed();\n * // Wait on the configuration to resolve.\n * $config = $promise->wait();\n * </code>\n */\nclass ConfigurationProvider extends AbstractConfigurationProvider\n    implements ConfigurationProviderInterface\n{\n    const ENV_ENDPOINTS_TYPE = 'AWS_S3_US_EAST_1_REGIONAL_ENDPOINT';\n    const INI_ENDPOINTS_TYPE = 's3_us_east_1_regional_endpoint';\n    const DEFAULT_ENDPOINTS_TYPE = 'legacy';\n\n    public static $cacheKey = 'aws_s3_us_east_1_regional_endpoint_config';\n\n    protected static $interfaceClass = ConfigurationInterface::class;\n    protected static $exceptionClass = ConfigurationException::class;\n\n    /**\n     * Create a default config provider that first checks for environment\n     * variables, then checks for a specified profile in the environment-defined\n     * config file location (env variable is 'AWS_CONFIG_FILE', file location\n     * defaults to ~/.aws/config), then checks for the \"default\" profile in the\n     * environment-defined config file location, and failing those uses a default\n     * fallback set of configuration options.\n     *\n     * This provider is automatically wrapped in a memoize function that caches\n     * previously provided config options.\n     *\n     * @param array $config\n     *\n     * @return callable\n     */\n    public static function defaultProvider(array $config = [])\n    {\n        $configProviders = [self::env()];\n        if (\n            !isset($config['use_aws_shared_config_files'])\n            || $config['use_aws_shared_config_files'] != false\n        ) {\n            $configProviders[] = self::ini();\n        }\n        $configProviders[] = self::fallback();\n\n        $memo = self::memoize(\n            call_user_func_array([ConfigurationProvider::class, 'chain'], $configProviders)\n        );\n\n        if (isset($config['s3_us_east_1_regional_endpoint'])\n            && $config['s3_us_east_1_regional_endpoint'] instanceof CacheInterface\n        ) {\n            return self::cache($memo, $config['s3_us_east_1_regional_endpoint'], self::$cacheKey);\n        }\n\n        return $memo;\n    }\n\n    public static function env()\n    {\n        return function () {\n            // Use config from environment variables, if available\n            $endpointsType = getenv(self::ENV_ENDPOINTS_TYPE);\n            if (!empty($endpointsType)) {\n                return Promise\\Create::promiseFor(\n                    new Configuration($endpointsType)\n                );\n            }\n\n            return self::reject('Could not find environment variable config'\n                . ' in ' . self::ENV_ENDPOINTS_TYPE);\n        };\n    }\n\n    /**\n     * Config provider that creates config using a config file whose location\n     * is specified by an environment variable 'AWS_CONFIG_FILE', defaulting to\n     * ~/.aws/config if not specified\n     *\n     * @param string|null $profile  Profile to use. If not specified will use\n     *                              the \"default\" profile.\n     * @param string|null $filename If provided, uses a custom filename rather\n     *                              than looking in the default directory.\n     *\n     * @return callable\n     */\n    public static function ini(\n        $profile = null,\n        $filename = null\n    ) {\n        $filename = $filename ?: (self::getDefaultConfigFilename());\n        $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');\n\n        return function () use ($profile, $filename) {\n            if (!@is_readable($filename)) {\n                return self::reject(\"Cannot read configuration from $filename\");\n            }\n            $data = \\Aws\\parse_ini_file($filename, true);\n            if ($data === false) {\n                return self::reject(\"Invalid config file: $filename\");\n            }\n            if (!isset($data[$profile])) {\n                return self::reject(\"'$profile' not found in config file\");\n            }\n            if (!isset($data[$profile][self::INI_ENDPOINTS_TYPE])) {\n                return self::reject(\"Required S3 regional endpoint config values\n                    not present in INI profile '{$profile}' ({$filename})\");\n            }\n\n            return Promise\\Create::promiseFor(\n                new Configuration($data[$profile][self::INI_ENDPOINTS_TYPE])\n            );\n        };\n    }\n\n    /**\n     * Fallback config options when other sources are not set.\n     *\n     * @return callable\n     */\n    public static function fallback()\n    {\n        return function () {\n            return Promise\\Create::promiseFor(\n                new Configuration(self::DEFAULT_ENDPOINTS_TYPE, true)\n            );\n        };\n    }\n\n    /**\n     * Unwraps a configuration object in whatever valid form it is in,\n     * always returning a ConfigurationInterface object.\n     *\n     * @param  mixed $config\n     * @return ConfigurationInterface\n     * @throws \\InvalidArgumentException\n     */\n    public static function unwrap($config)\n    {\n        if (is_callable($config)) {\n            $config = $config();\n        }\n        if ($config instanceof Promise\\PromiseInterface) {\n            $config = $config->wait();\n        }\n        if ($config instanceof ConfigurationInterface) {\n            return $config;\n        }\n        if (is_string($config)) {\n            return new Configuration($config);\n        }\n        if (is_array($config) && isset($config['endpoints_type'])) {\n            return new Configuration($config['endpoints_type']);\n        }\n\n        throw new \\InvalidArgumentException('Not a valid S3 regional endpoint '\n            . 'configuration argument.');\n    }\n}\n", "num_lines": 196}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\RegionalEndpoint\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\n/**\n * Represents an error interacting with configuration for sts regional endpoints\n */\nclass ConfigurationException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 15}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\UseArnRegion;\n\nuse Aws;\nuse Aws\\S3\\UseArnRegion\\Exception\\ConfigurationException;\n\nclass Configuration implements ConfigurationInterface\n{\n    private $useArnRegion;\n\n    public function __construct($useArnRegion)\n    {\n        $this->useArnRegion = Aws\\boolean_value($useArnRegion);\n        if (is_null($this->useArnRegion)) {\n            throw new ConfigurationException(\"'use_arn_region' config option\"\n                . \" must be a boolean value.\");\n        }\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function isUseArnRegion()\n    {\n        return $this->useArnRegion;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function toArray()\n    {\n        return [\n            'use_arn_region' => $this->isUseArnRegion(),\n        ];\n    }\n}\n", "num_lines": 38}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\UseArnRegion;\n\ninterface ConfigurationInterface\n{\n    /**\n     * Returns whether or not to use the ARN region if it differs from client\n     *\n     * @return bool\n     */\n    public function isUseArnRegion();\n\n    /**\n     * Returns the configuration as an associative array\n     *\n     * @return array\n     */\n    public function toArray();\n}\n", "num_lines": 20}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\UseArnRegion;\n\nuse Aws\\AbstractConfigurationProvider;\nuse Aws\\CacheInterface;\nuse Aws\\ConfigurationProviderInterface;\nuse Aws\\S3\\UseArnRegion\\Exception\\ConfigurationException;\nuse GuzzleHttp\\Promise;\n\n/**\n * A configuration provider is a function that returns a promise that is\n * fulfilled with a {@see \\Aws\\S3\\UseArnRegion\\ConfigurationInterface}\n * or rejected with an {@see \\Aws\\S3\\UseArnRegion\\Exception\\ConfigurationException}.\n *\n * <code>\n * use Aws\\S3\\UseArnRegion\\ConfigurationProvider;\n * $provider = ConfigurationProvider::defaultProvider();\n * // Returns a ConfigurationInterface or throws.\n * $config = $provider()->wait();\n * </code>\n *\n * Configuration providers can be composed to create configuration using\n * conditional logic that can create different configurations in different\n * environments. You can compose multiple providers into a single provider using\n * {@see Aws\\S3\\UseArnRegion\\ConfigurationProvider::chain}. This function\n * accepts providers as variadic arguments and returns a new function that will\n * invoke each provider until a successful configuration is returned.\n *\n * <code>\n * // First try an INI file at this location.\n * $a = ConfigurationProvider::ini(null, '/path/to/file.ini');\n * // Then try an INI file at this location.\n * $b = ConfigurationProvider::ini(null, '/path/to/other-file.ini');\n * // Then try loading from environment variables.\n * $c = ConfigurationProvider::env();\n * // Combine the three providers together.\n * $composed = ConfigurationProvider::chain($a, $b, $c);\n * // Returns a promise that is fulfilled with a configuration or throws.\n * $promise = $composed();\n * // Wait on the configuration to resolve.\n * $config = $promise->wait();\n * </code>\n */\nclass ConfigurationProvider extends AbstractConfigurationProvider\n    implements ConfigurationProviderInterface\n{\n    const ENV_USE_ARN_REGION = 'AWS_S3_USE_ARN_REGION';\n    const INI_USE_ARN_REGION = 's3_use_arn_region';\n    const DEFAULT_USE_ARN_REGION = true;\n\n    public static $cacheKey = 'aws_s3_use_arn_region_config';\n\n    protected static $interfaceClass = ConfigurationInterface::class;\n    protected static $exceptionClass = ConfigurationException::class;\n\n    /**\n     * Create a default config provider that first checks for environment\n     * variables, then checks for a specified profile in the environment-defined\n     * config file location (env variable is 'AWS_CONFIG_FILE', file location\n     * defaults to ~/.aws/config), then checks for the \"default\" profile in the\n     * environment-defined config file location, and failing those uses a default\n     * fallback set of configuration options.\n     *\n     * This provider is automatically wrapped in a memoize function that caches\n     * previously provided config options.\n     *\n     * @param array $config\n     *\n     * @return callable\n     */\n    public static function defaultProvider(array $config = [])\n    {\n        $configProviders = [self::env()];\n        if (\n            !isset($config['use_aws_shared_config_files'])\n            || $config['use_aws_shared_config_files'] != false\n        ) {\n            $configProviders[] = self::ini();\n        }\n        $configProviders[] = self::fallback();\n\n        $memo = self::memoize(\n            call_user_func_array([ConfigurationProvider::class, 'chain'], $configProviders)\n        );\n\n        if (isset($config['use_arn_region'])\n            && $config['use_arn_region'] instanceof CacheInterface\n        ) {\n            return self::cache($memo, $config['use_arn_region'], self::$cacheKey);\n        }\n\n        return $memo;\n    }\n\n    /**\n     * Provider that creates config from environment variables.\n     *\n     * @return callable\n     */\n    public static function env()\n    {\n        return function () {\n            // Use config from environment variables, if available\n            $useArnRegion = getenv(self::ENV_USE_ARN_REGION);\n            if (!empty($useArnRegion)) {\n                return Promise\\Create::promiseFor(\n                    new Configuration($useArnRegion)\n                );\n            }\n\n            return self::reject('Could not find environment variable config'\n                . ' in ' . self::ENV_USE_ARN_REGION);\n        };\n    }\n\n    /**\n     * Config provider that creates config using a config file whose location\n     * is specified by an environment variable 'AWS_CONFIG_FILE', defaulting to\n     * ~/.aws/config if not specified\n     *\n     * @param string|null $profile  Profile to use. If not specified will use\n     *                              the \"default\" profile.\n     * @param string|null $filename If provided, uses a custom filename rather\n     *                              than looking in the default directory.\n     *\n     * @return callable\n     */\n    public static function ini($profile = null, $filename = null)\n    {\n        $filename = $filename ?: (self::getDefaultConfigFilename());\n        $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');\n\n        return function () use ($profile, $filename) {\n            if (!@is_readable($filename)) {\n                return self::reject(\"Cannot read configuration from $filename\");\n            }\n\n            // Use INI_SCANNER_NORMAL instead of INI_SCANNER_TYPED for PHP 5.5 compatibility\n            $data = \\Aws\\parse_ini_file($filename, true, INI_SCANNER_NORMAL);\n            if ($data === false) {\n                return self::reject(\"Invalid config file: $filename\");\n            }\n            if (!isset($data[$profile])) {\n                return self::reject(\"'$profile' not found in config file\");\n            }\n            if (!isset($data[$profile][self::INI_USE_ARN_REGION])) {\n                return self::reject(\"Required S3 Use Arn Region config values\n                    not present in INI profile '{$profile}' ({$filename})\");\n            }\n\n            // INI_SCANNER_NORMAL parses false-y values as an empty string\n            if ($data[$profile][self::INI_USE_ARN_REGION] === \"\") {\n                $data[$profile][self::INI_USE_ARN_REGION] = false;\n            }\n\n            return Promise\\Create::promiseFor(\n                new Configuration($data[$profile][self::INI_USE_ARN_REGION])\n            );\n        };\n    }\n\n    /**\n     * Fallback config options when other sources are not set.\n     *\n     * @return callable\n     */\n    public static function fallback()\n    {\n        return function () {\n            return Promise\\Create::promiseFor(\n                new Configuration(self::DEFAULT_USE_ARN_REGION)\n            );\n        };\n    }\n}\n", "num_lines": 176}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3\\UseArnRegion\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\n/**\n * Represents an error interacting with configuration for S3's UseArnRegion\n */\nclass ConfigurationException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 15}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3Control;\n\nuse Aws\\Api\\Service;\nuse Aws\\Arn\\AccessPointArnInterface;\nuse Aws\\Arn\\ArnInterface;\nuse Aws\\Arn\\ArnParser;\nuse Aws\\Arn\\Exception\\InvalidArnException;\nuse Aws\\Arn\\S3\\BucketArnInterface;\nuse Aws\\Arn\\S3\\OutpostsArnInterface;\nuse Aws\\CommandInterface;\nuse Aws\\Endpoint\\PartitionEndpointProvider;\nuse Aws\\Exception\\InvalidRegionException;\nuse Aws\\Exception\\UnresolvedEndpointException;\nuse Aws\\S3\\EndpointRegionHelperTrait;\nuse GuzzleHttp\\Psr7;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Checks for access point ARN in members targeting BucketName, modifying\n * endpoint as appropriate\n *\n * @internal\n */\nclass EndpointArnMiddleware\n{\n    use EndpointRegionHelperTrait;\n\n    /**\n     * Commands which do not do ARN expansion for a specific given shape name\n     * @var array\n     */\n    private static $selectiveNonArnableCmds = [\n        'AccessPointName' => [\n            'CreateAccessPoint',\n        ],\n        'BucketName' => [],\n    ];\n\n    /**\n     * Commands which do not do ARN expansion at all for relevant members\n     * @var array\n     */\n    private static $nonArnableCmds = [\n        'CreateBucket',\n        'ListRegionalBuckets',\n    ];\n\n    /**\n     * Commands which trigger endpoint and signer redirection based on presence\n     * of OutpostId\n     * @var array\n     */\n    private static $outpostIdRedirectCmds = [\n        'CreateBucket',\n        'ListRegionalBuckets',\n    ];\n\n    /** @var callable */\n    private $nextHandler;\n\n    /** @var boolean */\n    private $isUseEndpointV2;\n\n    /**\n     * Create a middleware wrapper function.\n     *\n     * @param Service $service\n     * @param $region\n     * @param array $config\n     * @return callable\n     */\n    public static function wrap(\n        Service $service,\n                $region,\n        array   $config,\n                $isUseEndpointV2\n    )\n    {\n        return function (callable $handler) use ($service, $region, $config, $isUseEndpointV2) {\n            return new self($handler, $service, $region, $config, $isUseEndpointV2);\n        };\n    }\n\n    public function __construct(\n        callable $nextHandler,\n        Service  $service,\n                 $region,\n        array    $config = [],\n        $isUseEndpointV2 = false\n    )\n    {\n        $this->partitionProvider = PartitionEndpointProvider::defaultProvider();\n        $this->region = $region;\n        $this->service = $service;\n        $this->config = $config;\n        $this->nextHandler = $nextHandler;\n        $this->isUseEndpointV2 = $isUseEndpointV2;\n    }\n\n    public function __invoke(CommandInterface $cmd, RequestInterface $req)\n    {\n        $nextHandler = $this->nextHandler;\n\n        $op = $this->service->getOperation($cmd->getName())->toArray();\n        if (!empty($op['input']['shape'])\n            && !in_array($cmd->getName(), self::$nonArnableCmds)\n        ) {\n            $service = $this->service->toArray();\n            if (!empty($input = $service['shapes'][$op['input']['shape']])) {\n\n                // Stores member name that targets 'BucketName' shape\n                $bucketNameMember = null;\n\n                // Stores member name that targets 'AccessPointName' shape\n                $accesspointNameMember = null;\n\n                foreach ($input['members'] as $key => $member) {\n                    if ($member['shape'] === 'BucketName') {\n                        $bucketNameMember = $key;\n                    }\n                    if ($member['shape'] === 'AccessPointName') {\n                        $accesspointNameMember = $key;\n                    }\n                }\n\n                // Determine if appropriate member contains ARN value and is\n                // eligible for ARN expansion\n                if (!is_null($bucketNameMember)\n                    && !empty($cmd[$bucketNameMember])\n                    && !in_array($cmd->getName(), self::$selectiveNonArnableCmds['BucketName'])\n                    && ArnParser::isArn($cmd[$bucketNameMember])\n                ) {\n                    $arn = ArnParser::parse($cmd[$bucketNameMember]);\n                    !$this->isUseEndpointV2 && $partition = $this->validateBucketArn($arn);\n                } elseif (!is_null($accesspointNameMember)\n                    && !empty($cmd[$accesspointNameMember])\n                    && !in_array($cmd->getName(), self::$selectiveNonArnableCmds['AccessPointName'])\n                    && ArnParser::isArn($cmd[$accesspointNameMember])\n                ) {\n                    $arn = ArnParser::parse($cmd[$accesspointNameMember]);\n                    !$this->isUseEndpointV2 && $partition = $this->validateAccessPointArn($arn);\n                }\n\n                // Process only if an appropriate member contains an ARN value\n                // and is an Outposts ARN\n                if (!empty($arn) && $arn instanceof OutpostsArnInterface) {\n                    if (!$this->isUseEndpointV2) {\n                        // Generate host based on ARN\n                        $host = $this->generateOutpostsArnHost($arn, $req);\n                        $req = $req->withHeader('x-amz-outpost-id', $arn->getOutpostId());\n                    }\n\n                    // ARN replacement\n                    $path = $req->getUri()->getPath();\n                    if ($arn instanceof AccessPointArnInterface) {\n                        // Replace ARN with access point name\n                        $path = str_replace(\n                            urlencode($cmd[$accesspointNameMember]),\n                            $arn->getAccesspointName(),\n                            $path\n                        );\n\n                        // Replace ARN in the payload\n                        $req->getBody()->seek(0);\n                        $body = Psr7\\Utils::streamFor(str_replace(\n                            $cmd[$accesspointNameMember],\n                            $arn->getAccesspointName(),\n                            $req->getBody()->getContents()\n                        ));\n\n                        // Replace ARN in the command\n                        $cmd[$accesspointNameMember] = $arn->getAccesspointName();\n                    } elseif ($arn instanceof BucketArnInterface) {\n\n                        // Replace ARN in the path\n                        $path = str_replace(\n                            urlencode($cmd[$bucketNameMember]),\n                            $arn->getBucketName(),\n                            $path\n                        );\n\n                        // Replace ARN in the payload\n                        $req->getBody()->seek(0);\n                        $newBody = str_replace(\n                            $cmd[$bucketNameMember],\n                            $arn->getBucketName(),\n                            $req->getBody()->getContents()\n                        );\n                        $body = Psr7\\Utils::streamFor($newBody);\n\n                        // Replace ARN in the command\n                        $cmd[$bucketNameMember] = $arn->getBucketName();\n                    }\n\n                    // Validate or set account ID in command\n                    if (isset($cmd['AccountId'])) {\n                        if ($cmd['AccountId'] !== $arn->getAccountId()) {\n                            throw new \\InvalidArgumentException(\"The account ID\"\n                                . \" supplied in the command ({$cmd['AccountId']})\"\n                                . \" does not match the account ID supplied in the\"\n                                . \" ARN (\" . $arn->getAccountId() . \").\");\n                        }\n                    } else {\n                        $cmd['AccountId'] = $arn->getAccountId();\n                    }\n\n                    // Set modified request\n                    if (isset($body)) {\n                        $req = $req->withBody($body);\n                    }\n                    if ($this->isUseEndpointV2) {\n                        $req = $req->withUri($req->getUri()->withPath($path));\n                        goto next;\n                    }\n                    $req = $req\n                        ->withUri($req->getUri()->withHost($host)->withPath($path))\n                        ->withHeader('x-amz-account-id', $arn->getAccountId());\n\n                    // Update signing region based on ARN data if configured to do so\n                    if ($this->config['use_arn_region']->isUseArnRegion()) {\n                        $region = $arn->getRegion();\n                    } else {\n                        $region = $this->region;\n                    }\n                    $endpointData = $partition([\n                        'region' => $region,\n                        'service' => $arn->getService()\n                    ]);\n                    $cmd['@context']['signing_region'] = $endpointData['signingRegion'];\n\n                    // Update signing service for Outposts ARNs\n                    if ($arn instanceof OutpostsArnInterface) {\n                        $cmd['@context']['signing_service'] = $arn->getService();\n                    }\n\n\n                }\n            }\n        }\n        if ($this->isUseEndpointV2) {\n            goto next;\n        }\n        // For operations that redirect endpoint & signing service based on\n        // presence of OutpostId member. These operations will likely not\n        // overlap with operations that perform ARN expansion.\n        if (in_array($cmd->getName(), self::$outpostIdRedirectCmds)\n            && !empty($cmd['OutpostId'])\n        ) {\n            $req = $req->withUri(\n                $req->getUri()->withHost($this->generateOutpostIdHost())\n            );\n            $cmd['@context']['signing_service'] = 's3-outposts';\n        }\n\n        next:\n            return $nextHandler($cmd, $req);\n    }\n\n    private function generateOutpostsArnHost(\n        OutpostsArnInterface $arn,\n        RequestInterface $req\n    ) {\n        if (!empty($this->config['use_arn_region']->isUseArnRegion())) {\n            $region = $arn->getRegion();\n        } else {\n            $region = $this->region;\n        }\n        $fipsString = $this->config['use_fips_endpoint']->isUseFipsEndpoint()\n            ? \"-fips\"\n            : \"\";\n        $suffix = $this->getPartitionSuffix($arn, $this->partitionProvider);\n        return \"s3-outposts{$fipsString}.{$region}.{$suffix}\";\n    }\n\n    private function generateOutpostIdHost()\n    {\n        $partition = $this->partitionProvider->getPartition(\n            $this->region,\n            $this->service->getEndpointPrefix()\n        );\n        $suffix = $partition->getDnsSuffix();\n        return \"s3-outposts.{$this->region}.{$suffix}\";\n    }\n\n    private function validateBucketArn(ArnInterface $arn)\n    {\n        if ($arn instanceof BucketArnInterface) {\n            return $this->validateArn($arn);\n        }\n\n        throw new InvalidArnException('Provided ARN was not a valid S3 bucket'\n            . ' ARN.');\n    }\n\n    private function validateAccessPointArn(ArnInterface $arn)\n    {\n        if ($arn instanceof AccessPointArnInterface) {\n            return $this->validateArn($arn);\n        }\n\n        throw new InvalidArnException('Provided ARN was not a valid S3 access'\n            . ' point ARN.');\n    }\n\n    /**\n     * Validates an ARN, returning a partition object corresponding to the ARN\n     * if successful\n     *\n     * @param $arn\n     * @return \\Aws\\Endpoint\\Partition\n     */\n    private function validateArn(ArnInterface $arn)\n    {\n        // Dualstack is not supported with Outposts ARNs\n        if ($arn instanceof OutpostsArnInterface\n            && !empty($this->config['dual_stack'])\n        ) {\n            throw new UnresolvedEndpointException(\n                'Dualstack is currently not supported with S3 Outposts ARNs.'\n                . ' Please disable dualstack or do not supply an Outposts ARN.');\n        }\n\n        // Get partitions for ARN and client region\n        $arnPart = $this->partitionProvider->getPartitionByName(\n            $arn->getPartition()\n        );\n        $clientPart = $this->partitionProvider->getPartition(\n            $this->region,\n            's3'\n        );\n\n        // If client partition not found, try removing pseudo-region qualifiers\n        if (!($clientPart->isRegionMatch($this->region, 's3'))) {\n            $clientPart = $this->partitionProvider->getPartition(\n                \\Aws\\strip_fips_pseudo_regions($this->region),\n                's3'\n            );\n        }\n\n        // Verify that the partition matches for supplied partition and region\n        if ($arn->getPartition() !== $clientPart->getName()) {\n            throw new InvalidRegionException('The supplied ARN partition'\n                . \" does not match the client's partition.\");\n        }\n        if ($clientPart->getName() !== $arnPart->getName()) {\n            throw new InvalidRegionException('The corresponding partition'\n                . ' for the supplied ARN region does not match the'\n                . \" client's partition.\");\n        }\n\n        // Ensure ARN region matches client region unless\n        // configured for using ARN region over client region\n        $this->validateMatchingRegion($arn);\n\n        // Ensure it is not resolved to fips pseudo-region for S3 Outposts\n        $this->validateFipsConfigurations($arn);\n\n        return $arnPart;\n    }\n}", "num_lines": 361}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3Control;\n\nuse Aws\\AwsClient;\nuse Aws\\CacheInterface;\nuse Aws\\HandlerList;\nuse Aws\\S3\\UseArnRegion\\Configuration;\nuse Aws\\S3\\UseArnRegion\\ConfigurationInterface;\nuse Aws\\S3\\UseArnRegion\\ConfigurationProvider as UseArnRegionConfigurationProvider;\nuse GuzzleHttp\\Promise\\PromiseInterface;\n\n/**\n * This client is used to interact with the **AWS S3 Control** service.\n * @method \\Aws\\Result createAccessPoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccessPointAsync(array $args = [])\n * @method \\Aws\\Result createAccessPointForObjectLambda(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccessPointForObjectLambdaAsync(array $args = [])\n * @method \\Aws\\Result createBucket(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBucketAsync(array $args = [])\n * @method \\Aws\\Result createJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createJobAsync(array $args = [])\n * @method \\Aws\\Result createMultiRegionAccessPoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMultiRegionAccessPointAsync(array $args = [])\n * @method \\Aws\\Result deleteAccessPoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccessPointAsync(array $args = [])\n * @method \\Aws\\Result deleteAccessPointForObjectLambda(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccessPointForObjectLambdaAsync(array $args = [])\n * @method \\Aws\\Result deleteAccessPointPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccessPointPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteAccessPointPolicyForObjectLambda(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccessPointPolicyForObjectLambdaAsync(array $args = [])\n * @method \\Aws\\Result deleteBucket(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketLifecycleConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketLifecycleConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketReplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketReplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteBucketTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBucketTaggingAsync(array $args = [])\n * @method \\Aws\\Result deleteJobTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteJobTaggingAsync(array $args = [])\n * @method \\Aws\\Result deleteMultiRegionAccessPoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMultiRegionAccessPointAsync(array $args = [])\n * @method \\Aws\\Result deletePublicAccessBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePublicAccessBlockAsync(array $args = [])\n * @method \\Aws\\Result deleteStorageLensConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStorageLensConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteStorageLensConfigurationTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStorageLensConfigurationTaggingAsync(array $args = [])\n * @method \\Aws\\Result describeJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJobAsync(array $args = [])\n * @method \\Aws\\Result describeMultiRegionAccessPointOperation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMultiRegionAccessPointOperationAsync(array $args = [])\n * @method \\Aws\\Result getAccessPoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccessPointAsync(array $args = [])\n * @method \\Aws\\Result getAccessPointConfigurationForObjectLambda(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccessPointConfigurationForObjectLambdaAsync(array $args = [])\n * @method \\Aws\\Result getAccessPointForObjectLambda(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccessPointForObjectLambdaAsync(array $args = [])\n * @method \\Aws\\Result getAccessPointPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccessPointPolicyAsync(array $args = [])\n * @method \\Aws\\Result getAccessPointPolicyForObjectLambda(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccessPointPolicyForObjectLambdaAsync(array $args = [])\n * @method \\Aws\\Result getAccessPointPolicyStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccessPointPolicyStatusAsync(array $args = [])\n * @method \\Aws\\Result getAccessPointPolicyStatusForObjectLambda(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccessPointPolicyStatusForObjectLambdaAsync(array $args = [])\n * @method \\Aws\\Result getBucket(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketAsync(array $args = [])\n * @method \\Aws\\Result getBucketLifecycleConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketLifecycleConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getBucketPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketPolicyAsync(array $args = [])\n * @method \\Aws\\Result getBucketReplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketReplicationAsync(array $args = [])\n * @method \\Aws\\Result getBucketTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketTaggingAsync(array $args = [])\n * @method \\Aws\\Result getBucketVersioning(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBucketVersioningAsync(array $args = [])\n * @method \\Aws\\Result getJobTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobTaggingAsync(array $args = [])\n * @method \\Aws\\Result getMultiRegionAccessPoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMultiRegionAccessPointAsync(array $args = [])\n * @method \\Aws\\Result getMultiRegionAccessPointPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMultiRegionAccessPointPolicyAsync(array $args = [])\n * @method \\Aws\\Result getMultiRegionAccessPointPolicyStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMultiRegionAccessPointPolicyStatusAsync(array $args = [])\n * @method \\Aws\\Result getMultiRegionAccessPointRoutes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMultiRegionAccessPointRoutesAsync(array $args = [])\n * @method \\Aws\\Result getPublicAccessBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPublicAccessBlockAsync(array $args = [])\n * @method \\Aws\\Result getStorageLensConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStorageLensConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getStorageLensConfigurationTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getStorageLensConfigurationTaggingAsync(array $args = [])\n * @method \\Aws\\Result listAccessPoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccessPointsAsync(array $args = [])\n * @method \\Aws\\Result listAccessPointsForObjectLambda(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccessPointsForObjectLambdaAsync(array $args = [])\n * @method \\Aws\\Result listJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobsAsync(array $args = [])\n * @method \\Aws\\Result listMultiRegionAccessPoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMultiRegionAccessPointsAsync(array $args = [])\n * @method \\Aws\\Result listRegionalBuckets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRegionalBucketsAsync(array $args = [])\n * @method \\Aws\\Result listStorageLensConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStorageLensConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result putAccessPointConfigurationForObjectLambda(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccessPointConfigurationForObjectLambdaAsync(array $args = [])\n * @method \\Aws\\Result putAccessPointPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccessPointPolicyAsync(array $args = [])\n * @method \\Aws\\Result putAccessPointPolicyForObjectLambda(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccessPointPolicyForObjectLambdaAsync(array $args = [])\n * @method \\Aws\\Result putBucketLifecycleConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketLifecycleConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putBucketPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketPolicyAsync(array $args = [])\n * @method \\Aws\\Result putBucketReplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketReplicationAsync(array $args = [])\n * @method \\Aws\\Result putBucketTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketTaggingAsync(array $args = [])\n * @method \\Aws\\Result putBucketVersioning(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putBucketVersioningAsync(array $args = [])\n * @method \\Aws\\Result putJobTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putJobTaggingAsync(array $args = [])\n * @method \\Aws\\Result putMultiRegionAccessPointPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putMultiRegionAccessPointPolicyAsync(array $args = [])\n * @method \\Aws\\Result putPublicAccessBlock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPublicAccessBlockAsync(array $args = [])\n * @method \\Aws\\Result putStorageLensConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putStorageLensConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putStorageLensConfigurationTagging(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putStorageLensConfigurationTaggingAsync(array $args = [])\n * @method \\Aws\\Result submitMultiRegionAccessPointRoutes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise submitMultiRegionAccessPointRoutesAsync(array $args = [])\n * @method \\Aws\\Result updateJobPriority(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateJobPriorityAsync(array $args = [])\n * @method \\Aws\\Result updateJobStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateJobStatusAsync(array $args = [])\n */\nclass S3ControlClient extends AwsClient \n{\n    public static function getArguments()\n    {\n        $args = parent::getArguments();\n        return $args + [\n            'use_dual_stack_endpoint' => [\n                'type' => 'config',\n                'valid' => ['bool'],\n                'doc' => 'Set to true to send requests to an S3 Control Dual Stack'\n                    . ' endpoint by default, which enables IPv6 Protocol.'\n                    . ' Can be enabled or disabled on individual operations by setting'\n                    . ' \\'@use_dual_stack_endpoint\\' to true or false.',\n                'default' => false,\n            ],\n            'use_arn_region' => [\n                'type'    => 'config',\n                'valid'   => [\n                    'bool',\n                    Configuration::class,\n                    CacheInterface::class,\n                    'callable'\n                ],\n                'doc'     => 'Set to true to allow passed in ARNs to override'\n                    . ' client region. Accepts...',\n                'fn' => [__CLASS__, '_apply_use_arn_region'],\n                'default' => [UseArnRegionConfigurationProvider::class, 'defaultProvider'],\n            ],\n        ];\n    }\n\n    public static function _apply_use_arn_region($value, array &$args, HandlerList $list)\n    {\n        if ($value instanceof CacheInterface) {\n            $value = UseArnRegionConfigurationProvider::defaultProvider($args);\n        }\n        if (is_callable($value)) {\n            $value = $value();\n        }\n        if ($value instanceof PromiseInterface) {\n            $value = $value->wait();\n        }\n        if ($value instanceof ConfigurationInterface) {\n            $args['use_arn_region'] = $value;\n        } else {\n            // The Configuration class itself will validate other inputs\n            $args['use_arn_region'] = new Configuration($value);\n        }\n    }\n\n    /**\n     * {@inheritdoc}\n     *\n     * In addition to the options available to\n     * {@see Aws\\AwsClient::__construct}, S3ControlClient accepts the following\n     * option:\n     *\n     * - use_dual_stack_endpoint: (bool) Set to true to send requests to an S3\n     *   Control Dual Stack endpoint by default, which enables IPv6 Protocol.\n     *   Can be enabled or disabled on individual operations by setting\n     *   '@use_dual_stack_endpoint\\' to true or false. Note:\n     *   you cannot use it together with an accelerate endpoint.\n     *\n     * @param array $args\n     */\n    public function __construct(array $args)\n    {\n        parent::__construct($args);\n\n        if ($this->isUseEndpointV2()) {\n            $this->processEndpointV2Model();\n        }\n        $stack = $this->getHandlerList();\n        $stack->appendBuild(\n            EndpointArnMiddleware::wrap(\n                $this->getApi(),\n                $this->getRegion(),\n                [\n                    'use_arn_region' => $this->getConfig('use_arn_region'),\n                    'dual_stack' =>\n                        $this->getConfig('use_dual_stack_endpoint')->isUseDualStackEndpoint(),\n                    'endpoint' => isset($args['endpoint'])\n                        ? $args['endpoint']\n                        : null,\n                    'use_fips_endpoint' => $this->getConfig('use_fips_endpoint'),\n                ],\n                $this->isUseEndpointV2()\n            ),\n            's3control.endpoint_arn_middleware'\n        );\n    }\n\n    /**\n     * Modifies API definition to remove `AccountId`\n     * host prefix.  This is now handled by the endpoint ruleset.\n     *\n     * @return void\n     *\n     * @internal\n     */\n    private function processEndpointV2Model()\n    {\n        $definition = $this->getApi()->getDefinition();\n        $this->removeHostPrefix($definition);\n        $this->removeRequiredMember($definition);\n        $this->getApi()->setDefinition($definition);\n    }\n\n    private function removeHostPrefix(&$definition)\n    {\n        foreach($definition['operations'] as &$operation) {\n            if (isset($operation['endpoint']['hostPrefix'])\n                && $operation['endpoint']['hostPrefix'] === '{AccountId}.'\n            ) {\n                $operation['endpoint']['hostPrefix'] = str_replace(\n                    '{AccountId}.',\n                    '',\n                    $operation['endpoint']['hostPrefix']\n                );\n            }\n        }\n    }\n\n    private function removeRequiredMember(&$definition)\n    {\n        foreach($definition['shapes'] as &$shape) {\n            if (isset($shape['required'])\n            ) {\n                $found = array_search('AccountId', $shape['required']);\n\n                if ($found !== false) {\n                    unset($shape['required'][$found]);\n                }\n            }\n        }\n    }\n}\n", "num_lines": 280}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3Control\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS S3 Control** service.\n */\nclass S3ControlException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3Outposts;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon S3 on Outposts** service.\n * @method \\Aws\\Result createEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEndpointAsync(array $args = [])\n * @method \\Aws\\Result listEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEndpointsAsync(array $args = [])\n * @method \\Aws\\Result listOutpostsWithS3(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOutpostsWithS3Async(array $args = [])\n * @method \\Aws\\Result listSharedEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSharedEndpointsAsync(array $args = [])\n */\nclass S3OutpostsClient extends AwsClient {}\n", "num_lines": 20}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\S3Outposts\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon S3 on Outposts** service.\n */\nclass S3OutpostsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SageMaker;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon SageMaker Service** service.\n * @method \\Aws\\Result addAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addAssociationAsync(array $args = [])\n * @method \\Aws\\Result addTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsAsync(array $args = [])\n * @method \\Aws\\Result associateTrialComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateTrialComponentAsync(array $args = [])\n * @method \\Aws\\Result batchDescribeModelPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDescribeModelPackageAsync(array $args = [])\n * @method \\Aws\\Result createAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createActionAsync(array $args = [])\n * @method \\Aws\\Result createAlgorithm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAlgorithmAsync(array $args = [])\n * @method \\Aws\\Result createApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppAsync(array $args = [])\n * @method \\Aws\\Result createAppImageConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppImageConfigAsync(array $args = [])\n * @method \\Aws\\Result createArtifact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createArtifactAsync(array $args = [])\n * @method \\Aws\\Result createAutoMLJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAutoMLJobAsync(array $args = [])\n * @method \\Aws\\Result createAutoMLJobV2(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAutoMLJobV2Async(array $args = [])\n * @method \\Aws\\Result createCodeRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCodeRepositoryAsync(array $args = [])\n * @method \\Aws\\Result createCompilationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCompilationJobAsync(array $args = [])\n * @method \\Aws\\Result createContext(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createContextAsync(array $args = [])\n * @method \\Aws\\Result createDataQualityJobDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataQualityJobDefinitionAsync(array $args = [])\n * @method \\Aws\\Result createDeviceFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeviceFleetAsync(array $args = [])\n * @method \\Aws\\Result createDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDomainAsync(array $args = [])\n * @method \\Aws\\Result createEdgeDeploymentPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEdgeDeploymentPlanAsync(array $args = [])\n * @method \\Aws\\Result createEdgeDeploymentStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEdgeDeploymentStageAsync(array $args = [])\n * @method \\Aws\\Result createEdgePackagingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEdgePackagingJobAsync(array $args = [])\n * @method \\Aws\\Result createEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEndpointAsync(array $args = [])\n * @method \\Aws\\Result createEndpointConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEndpointConfigAsync(array $args = [])\n * @method \\Aws\\Result createExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createExperimentAsync(array $args = [])\n * @method \\Aws\\Result createFeatureGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFeatureGroupAsync(array $args = [])\n * @method \\Aws\\Result createFlowDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFlowDefinitionAsync(array $args = [])\n * @method \\Aws\\Result createHub(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHubAsync(array $args = [])\n * @method \\Aws\\Result createHumanTaskUi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHumanTaskUiAsync(array $args = [])\n * @method \\Aws\\Result createHyperParameterTuningJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHyperParameterTuningJobAsync(array $args = [])\n * @method \\Aws\\Result createImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createImageAsync(array $args = [])\n * @method \\Aws\\Result createImageVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createImageVersionAsync(array $args = [])\n * @method \\Aws\\Result createInferenceExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInferenceExperimentAsync(array $args = [])\n * @method \\Aws\\Result createInferenceRecommendationsJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInferenceRecommendationsJobAsync(array $args = [])\n * @method \\Aws\\Result createLabelingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLabelingJobAsync(array $args = [])\n * @method \\Aws\\Result createModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createModelAsync(array $args = [])\n * @method \\Aws\\Result createModelBiasJobDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createModelBiasJobDefinitionAsync(array $args = [])\n * @method \\Aws\\Result createModelCard(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createModelCardAsync(array $args = [])\n * @method \\Aws\\Result createModelCardExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createModelCardExportJobAsync(array $args = [])\n * @method \\Aws\\Result createModelExplainabilityJobDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createModelExplainabilityJobDefinitionAsync(array $args = [])\n * @method \\Aws\\Result createModelPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createModelPackageAsync(array $args = [])\n * @method \\Aws\\Result createModelPackageGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createModelPackageGroupAsync(array $args = [])\n * @method \\Aws\\Result createModelQualityJobDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createModelQualityJobDefinitionAsync(array $args = [])\n * @method \\Aws\\Result createMonitoringSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMonitoringScheduleAsync(array $args = [])\n * @method \\Aws\\Result createNotebookInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNotebookInstanceAsync(array $args = [])\n * @method \\Aws\\Result createNotebookInstanceLifecycleConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNotebookInstanceLifecycleConfigAsync(array $args = [])\n * @method \\Aws\\Result createPipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPipelineAsync(array $args = [])\n * @method \\Aws\\Result createPresignedDomainUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPresignedDomainUrlAsync(array $args = [])\n * @method \\Aws\\Result createPresignedNotebookInstanceUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPresignedNotebookInstanceUrlAsync(array $args = [])\n * @method \\Aws\\Result createProcessingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProcessingJobAsync(array $args = [])\n * @method \\Aws\\Result createProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProjectAsync(array $args = [])\n * @method \\Aws\\Result createSpace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSpaceAsync(array $args = [])\n * @method \\Aws\\Result createStudioLifecycleConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStudioLifecycleConfigAsync(array $args = [])\n * @method \\Aws\\Result createTrainingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTrainingJobAsync(array $args = [])\n * @method \\Aws\\Result createTransformJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTransformJobAsync(array $args = [])\n * @method \\Aws\\Result createTrial(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTrialAsync(array $args = [])\n * @method \\Aws\\Result createTrialComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTrialComponentAsync(array $args = [])\n * @method \\Aws\\Result createUserProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserProfileAsync(array $args = [])\n * @method \\Aws\\Result createWorkforce(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkforceAsync(array $args = [])\n * @method \\Aws\\Result createWorkteam(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkteamAsync(array $args = [])\n * @method \\Aws\\Result deleteAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteActionAsync(array $args = [])\n * @method \\Aws\\Result deleteAlgorithm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAlgorithmAsync(array $args = [])\n * @method \\Aws\\Result deleteApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppAsync(array $args = [])\n * @method \\Aws\\Result deleteAppImageConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppImageConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteArtifact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteArtifactAsync(array $args = [])\n * @method \\Aws\\Result deleteAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAssociationAsync(array $args = [])\n * @method \\Aws\\Result deleteCodeRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCodeRepositoryAsync(array $args = [])\n * @method \\Aws\\Result deleteContext(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteContextAsync(array $args = [])\n * @method \\Aws\\Result deleteDataQualityJobDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataQualityJobDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteDeviceFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDeviceFleetAsync(array $args = [])\n * @method \\Aws\\Result deleteDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainAsync(array $args = [])\n * @method \\Aws\\Result deleteEdgeDeploymentPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEdgeDeploymentPlanAsync(array $args = [])\n * @method \\Aws\\Result deleteEdgeDeploymentStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEdgeDeploymentStageAsync(array $args = [])\n * @method \\Aws\\Result deleteEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEndpointAsync(array $args = [])\n * @method \\Aws\\Result deleteEndpointConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEndpointConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteExperimentAsync(array $args = [])\n * @method \\Aws\\Result deleteFeatureGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFeatureGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteFlowDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFlowDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteHub(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHubAsync(array $args = [])\n * @method \\Aws\\Result deleteHubContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHubContentAsync(array $args = [])\n * @method \\Aws\\Result deleteHumanTaskUi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHumanTaskUiAsync(array $args = [])\n * @method \\Aws\\Result deleteImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteImageAsync(array $args = [])\n * @method \\Aws\\Result deleteImageVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteImageVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteInferenceExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInferenceExperimentAsync(array $args = [])\n * @method \\Aws\\Result deleteModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteModelAsync(array $args = [])\n * @method \\Aws\\Result deleteModelBiasJobDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteModelBiasJobDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteModelCard(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteModelCardAsync(array $args = [])\n * @method \\Aws\\Result deleteModelExplainabilityJobDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteModelExplainabilityJobDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteModelPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteModelPackageAsync(array $args = [])\n * @method \\Aws\\Result deleteModelPackageGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteModelPackageGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteModelPackageGroupPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteModelPackageGroupPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteModelQualityJobDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteModelQualityJobDefinitionAsync(array $args = [])\n * @method \\Aws\\Result deleteMonitoringSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMonitoringScheduleAsync(array $args = [])\n * @method \\Aws\\Result deleteNotebookInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNotebookInstanceAsync(array $args = [])\n * @method \\Aws\\Result deleteNotebookInstanceLifecycleConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNotebookInstanceLifecycleConfigAsync(array $args = [])\n * @method \\Aws\\Result deletePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePipelineAsync(array $args = [])\n * @method \\Aws\\Result deleteProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProjectAsync(array $args = [])\n * @method \\Aws\\Result deleteSpace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSpaceAsync(array $args = [])\n * @method \\Aws\\Result deleteStudioLifecycleConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStudioLifecycleConfigAsync(array $args = [])\n * @method \\Aws\\Result deleteTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTagsAsync(array $args = [])\n * @method \\Aws\\Result deleteTrial(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTrialAsync(array $args = [])\n * @method \\Aws\\Result deleteTrialComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTrialComponentAsync(array $args = [])\n * @method \\Aws\\Result deleteUserProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkforce(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkforceAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkteam(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkteamAsync(array $args = [])\n * @method \\Aws\\Result deregisterDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterDevicesAsync(array $args = [])\n * @method \\Aws\\Result describeAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeActionAsync(array $args = [])\n * @method \\Aws\\Result describeAlgorithm(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAlgorithmAsync(array $args = [])\n * @method \\Aws\\Result describeApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppAsync(array $args = [])\n * @method \\Aws\\Result describeAppImageConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppImageConfigAsync(array $args = [])\n * @method \\Aws\\Result describeArtifact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeArtifactAsync(array $args = [])\n * @method \\Aws\\Result describeAutoMLJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAutoMLJobAsync(array $args = [])\n * @method \\Aws\\Result describeAutoMLJobV2(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAutoMLJobV2Async(array $args = [])\n * @method \\Aws\\Result describeCodeRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCodeRepositoryAsync(array $args = [])\n * @method \\Aws\\Result describeCompilationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCompilationJobAsync(array $args = [])\n * @method \\Aws\\Result describeContext(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeContextAsync(array $args = [])\n * @method \\Aws\\Result describeDataQualityJobDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDataQualityJobDefinitionAsync(array $args = [])\n * @method \\Aws\\Result describeDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDeviceAsync(array $args = [])\n * @method \\Aws\\Result describeDeviceFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDeviceFleetAsync(array $args = [])\n * @method \\Aws\\Result describeDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainAsync(array $args = [])\n * @method \\Aws\\Result describeEdgeDeploymentPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEdgeDeploymentPlanAsync(array $args = [])\n * @method \\Aws\\Result describeEdgePackagingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEdgePackagingJobAsync(array $args = [])\n * @method \\Aws\\Result describeEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEndpointAsync(array $args = [])\n * @method \\Aws\\Result describeEndpointConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEndpointConfigAsync(array $args = [])\n * @method \\Aws\\Result describeExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeExperimentAsync(array $args = [])\n * @method \\Aws\\Result describeFeatureGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFeatureGroupAsync(array $args = [])\n * @method \\Aws\\Result describeFeatureMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFeatureMetadataAsync(array $args = [])\n * @method \\Aws\\Result describeFlowDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFlowDefinitionAsync(array $args = [])\n * @method \\Aws\\Result describeHub(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHubAsync(array $args = [])\n * @method \\Aws\\Result describeHubContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHubContentAsync(array $args = [])\n * @method \\Aws\\Result describeHumanTaskUi(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHumanTaskUiAsync(array $args = [])\n * @method \\Aws\\Result describeHyperParameterTuningJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHyperParameterTuningJobAsync(array $args = [])\n * @method \\Aws\\Result describeImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImageAsync(array $args = [])\n * @method \\Aws\\Result describeImageVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeImageVersionAsync(array $args = [])\n * @method \\Aws\\Result describeInferenceExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInferenceExperimentAsync(array $args = [])\n * @method \\Aws\\Result describeInferenceRecommendationsJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInferenceRecommendationsJobAsync(array $args = [])\n * @method \\Aws\\Result describeLabelingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLabelingJobAsync(array $args = [])\n * @method \\Aws\\Result describeLineageGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLineageGroupAsync(array $args = [])\n * @method \\Aws\\Result describeModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeModelAsync(array $args = [])\n * @method \\Aws\\Result describeModelBiasJobDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeModelBiasJobDefinitionAsync(array $args = [])\n * @method \\Aws\\Result describeModelCard(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeModelCardAsync(array $args = [])\n * @method \\Aws\\Result describeModelCardExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeModelCardExportJobAsync(array $args = [])\n * @method \\Aws\\Result describeModelExplainabilityJobDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeModelExplainabilityJobDefinitionAsync(array $args = [])\n * @method \\Aws\\Result describeModelPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeModelPackageAsync(array $args = [])\n * @method \\Aws\\Result describeModelPackageGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeModelPackageGroupAsync(array $args = [])\n * @method \\Aws\\Result describeModelQualityJobDefinition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeModelQualityJobDefinitionAsync(array $args = [])\n * @method \\Aws\\Result describeMonitoringSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMonitoringScheduleAsync(array $args = [])\n * @method \\Aws\\Result describeNotebookInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNotebookInstanceAsync(array $args = [])\n * @method \\Aws\\Result describeNotebookInstanceLifecycleConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNotebookInstanceLifecycleConfigAsync(array $args = [])\n * @method \\Aws\\Result describePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePipelineAsync(array $args = [])\n * @method \\Aws\\Result describePipelineDefinitionForExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePipelineDefinitionForExecutionAsync(array $args = [])\n * @method \\Aws\\Result describePipelineExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePipelineExecutionAsync(array $args = [])\n * @method \\Aws\\Result describeProcessingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProcessingJobAsync(array $args = [])\n * @method \\Aws\\Result describeProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProjectAsync(array $args = [])\n * @method \\Aws\\Result describeSpace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSpaceAsync(array $args = [])\n * @method \\Aws\\Result describeStudioLifecycleConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStudioLifecycleConfigAsync(array $args = [])\n * @method \\Aws\\Result describeSubscribedWorkteam(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSubscribedWorkteamAsync(array $args = [])\n * @method \\Aws\\Result describeTrainingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTrainingJobAsync(array $args = [])\n * @method \\Aws\\Result describeTransformJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTransformJobAsync(array $args = [])\n * @method \\Aws\\Result describeTrial(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTrialAsync(array $args = [])\n * @method \\Aws\\Result describeTrialComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTrialComponentAsync(array $args = [])\n * @method \\Aws\\Result describeUserProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserProfileAsync(array $args = [])\n * @method \\Aws\\Result describeWorkforce(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkforceAsync(array $args = [])\n * @method \\Aws\\Result describeWorkteam(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkteamAsync(array $args = [])\n * @method \\Aws\\Result disableSagemakerServicecatalogPortfolio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableSagemakerServicecatalogPortfolioAsync(array $args = [])\n * @method \\Aws\\Result disassociateTrialComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateTrialComponentAsync(array $args = [])\n * @method \\Aws\\Result enableSagemakerServicecatalogPortfolio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableSagemakerServicecatalogPortfolioAsync(array $args = [])\n * @method \\Aws\\Result getDeviceFleetReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeviceFleetReportAsync(array $args = [])\n * @method \\Aws\\Result getLineageGroupPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLineageGroupPolicyAsync(array $args = [])\n * @method \\Aws\\Result getModelPackageGroupPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getModelPackageGroupPolicyAsync(array $args = [])\n * @method \\Aws\\Result getSagemakerServicecatalogPortfolioStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSagemakerServicecatalogPortfolioStatusAsync(array $args = [])\n * @method \\Aws\\Result getSearchSuggestions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSearchSuggestionsAsync(array $args = [])\n * @method \\Aws\\Result importHubContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importHubContentAsync(array $args = [])\n * @method \\Aws\\Result listActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listActionsAsync(array $args = [])\n * @method \\Aws\\Result listAlgorithms(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAlgorithmsAsync(array $args = [])\n * @method \\Aws\\Result listAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAliasesAsync(array $args = [])\n * @method \\Aws\\Result listAppImageConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppImageConfigsAsync(array $args = [])\n * @method \\Aws\\Result listApps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppsAsync(array $args = [])\n * @method \\Aws\\Result listArtifacts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listArtifactsAsync(array $args = [])\n * @method \\Aws\\Result listAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listAutoMLJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAutoMLJobsAsync(array $args = [])\n * @method \\Aws\\Result listCandidatesForAutoMLJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCandidatesForAutoMLJobAsync(array $args = [])\n * @method \\Aws\\Result listCodeRepositories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCodeRepositoriesAsync(array $args = [])\n * @method \\Aws\\Result listCompilationJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCompilationJobsAsync(array $args = [])\n * @method \\Aws\\Result listContexts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listContextsAsync(array $args = [])\n * @method \\Aws\\Result listDataQualityJobDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataQualityJobDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listDeviceFleets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeviceFleetsAsync(array $args = [])\n * @method \\Aws\\Result listDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDevicesAsync(array $args = [])\n * @method \\Aws\\Result listDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainsAsync(array $args = [])\n * @method \\Aws\\Result listEdgeDeploymentPlans(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEdgeDeploymentPlansAsync(array $args = [])\n * @method \\Aws\\Result listEdgePackagingJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEdgePackagingJobsAsync(array $args = [])\n * @method \\Aws\\Result listEndpointConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEndpointConfigsAsync(array $args = [])\n * @method \\Aws\\Result listEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEndpointsAsync(array $args = [])\n * @method \\Aws\\Result listExperiments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExperimentsAsync(array $args = [])\n * @method \\Aws\\Result listFeatureGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFeatureGroupsAsync(array $args = [])\n * @method \\Aws\\Result listFlowDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFlowDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listHubContentVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHubContentVersionsAsync(array $args = [])\n * @method \\Aws\\Result listHubContents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHubContentsAsync(array $args = [])\n * @method \\Aws\\Result listHubs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHubsAsync(array $args = [])\n * @method \\Aws\\Result listHumanTaskUis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHumanTaskUisAsync(array $args = [])\n * @method \\Aws\\Result listHyperParameterTuningJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHyperParameterTuningJobsAsync(array $args = [])\n * @method \\Aws\\Result listImageVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listImageVersionsAsync(array $args = [])\n * @method \\Aws\\Result listImages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listImagesAsync(array $args = [])\n * @method \\Aws\\Result listInferenceExperiments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInferenceExperimentsAsync(array $args = [])\n * @method \\Aws\\Result listInferenceRecommendationsJobSteps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInferenceRecommendationsJobStepsAsync(array $args = [])\n * @method \\Aws\\Result listInferenceRecommendationsJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInferenceRecommendationsJobsAsync(array $args = [])\n * @method \\Aws\\Result listLabelingJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLabelingJobsAsync(array $args = [])\n * @method \\Aws\\Result listLabelingJobsForWorkteam(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLabelingJobsForWorkteamAsync(array $args = [])\n * @method \\Aws\\Result listLineageGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLineageGroupsAsync(array $args = [])\n * @method \\Aws\\Result listModelBiasJobDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listModelBiasJobDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listModelCardExportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listModelCardExportJobsAsync(array $args = [])\n * @method \\Aws\\Result listModelCardVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listModelCardVersionsAsync(array $args = [])\n * @method \\Aws\\Result listModelCards(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listModelCardsAsync(array $args = [])\n * @method \\Aws\\Result listModelExplainabilityJobDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listModelExplainabilityJobDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listModelMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listModelMetadataAsync(array $args = [])\n * @method \\Aws\\Result listModelPackageGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listModelPackageGroupsAsync(array $args = [])\n * @method \\Aws\\Result listModelPackages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listModelPackagesAsync(array $args = [])\n * @method \\Aws\\Result listModelQualityJobDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listModelQualityJobDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listModels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listModelsAsync(array $args = [])\n * @method \\Aws\\Result listMonitoringAlertHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMonitoringAlertHistoryAsync(array $args = [])\n * @method \\Aws\\Result listMonitoringAlerts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMonitoringAlertsAsync(array $args = [])\n * @method \\Aws\\Result listMonitoringExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMonitoringExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listMonitoringSchedules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMonitoringSchedulesAsync(array $args = [])\n * @method \\Aws\\Result listNotebookInstanceLifecycleConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNotebookInstanceLifecycleConfigsAsync(array $args = [])\n * @method \\Aws\\Result listNotebookInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNotebookInstancesAsync(array $args = [])\n * @method \\Aws\\Result listPipelineExecutionSteps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPipelineExecutionStepsAsync(array $args = [])\n * @method \\Aws\\Result listPipelineExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPipelineExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listPipelineParametersForExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPipelineParametersForExecutionAsync(array $args = [])\n * @method \\Aws\\Result listPipelines(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPipelinesAsync(array $args = [])\n * @method \\Aws\\Result listProcessingJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProcessingJobsAsync(array $args = [])\n * @method \\Aws\\Result listProjects(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProjectsAsync(array $args = [])\n * @method \\Aws\\Result listSpaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSpacesAsync(array $args = [])\n * @method \\Aws\\Result listStageDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStageDevicesAsync(array $args = [])\n * @method \\Aws\\Result listStudioLifecycleConfigs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStudioLifecycleConfigsAsync(array $args = [])\n * @method \\Aws\\Result listSubscribedWorkteams(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSubscribedWorkteamsAsync(array $args = [])\n * @method \\Aws\\Result listTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsAsync(array $args = [])\n * @method \\Aws\\Result listTrainingJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTrainingJobsAsync(array $args = [])\n * @method \\Aws\\Result listTrainingJobsForHyperParameterTuningJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTrainingJobsForHyperParameterTuningJobAsync(array $args = [])\n * @method \\Aws\\Result listTransformJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTransformJobsAsync(array $args = [])\n * @method \\Aws\\Result listTrialComponents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTrialComponentsAsync(array $args = [])\n * @method \\Aws\\Result listTrials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTrialsAsync(array $args = [])\n * @method \\Aws\\Result listUserProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUserProfilesAsync(array $args = [])\n * @method \\Aws\\Result listWorkforces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkforcesAsync(array $args = [])\n * @method \\Aws\\Result listWorkteams(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkteamsAsync(array $args = [])\n * @method \\Aws\\Result putModelPackageGroupPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putModelPackageGroupPolicyAsync(array $args = [])\n * @method \\Aws\\Result queryLineage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise queryLineageAsync(array $args = [])\n * @method \\Aws\\Result registerDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerDevicesAsync(array $args = [])\n * @method \\Aws\\Result renderUiTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise renderUiTemplateAsync(array $args = [])\n * @method \\Aws\\Result retryPipelineExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise retryPipelineExecutionAsync(array $args = [])\n * @method \\Aws\\Result search(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchAsync(array $args = [])\n * @method \\Aws\\Result sendPipelineExecutionStepFailure(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendPipelineExecutionStepFailureAsync(array $args = [])\n * @method \\Aws\\Result sendPipelineExecutionStepSuccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendPipelineExecutionStepSuccessAsync(array $args = [])\n * @method \\Aws\\Result startEdgeDeploymentStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startEdgeDeploymentStageAsync(array $args = [])\n * @method \\Aws\\Result startInferenceExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startInferenceExperimentAsync(array $args = [])\n * @method \\Aws\\Result startMonitoringSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMonitoringScheduleAsync(array $args = [])\n * @method \\Aws\\Result startNotebookInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startNotebookInstanceAsync(array $args = [])\n * @method \\Aws\\Result startPipelineExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startPipelineExecutionAsync(array $args = [])\n * @method \\Aws\\Result stopAutoMLJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopAutoMLJobAsync(array $args = [])\n * @method \\Aws\\Result stopCompilationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopCompilationJobAsync(array $args = [])\n * @method \\Aws\\Result stopEdgeDeploymentStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopEdgeDeploymentStageAsync(array $args = [])\n * @method \\Aws\\Result stopEdgePackagingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopEdgePackagingJobAsync(array $args = [])\n * @method \\Aws\\Result stopHyperParameterTuningJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopHyperParameterTuningJobAsync(array $args = [])\n * @method \\Aws\\Result stopInferenceExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopInferenceExperimentAsync(array $args = [])\n * @method \\Aws\\Result stopInferenceRecommendationsJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopInferenceRecommendationsJobAsync(array $args = [])\n * @method \\Aws\\Result stopLabelingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopLabelingJobAsync(array $args = [])\n * @method \\Aws\\Result stopMonitoringSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopMonitoringScheduleAsync(array $args = [])\n * @method \\Aws\\Result stopNotebookInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopNotebookInstanceAsync(array $args = [])\n * @method \\Aws\\Result stopPipelineExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopPipelineExecutionAsync(array $args = [])\n * @method \\Aws\\Result stopProcessingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopProcessingJobAsync(array $args = [])\n * @method \\Aws\\Result stopTrainingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopTrainingJobAsync(array $args = [])\n * @method \\Aws\\Result stopTransformJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopTransformJobAsync(array $args = [])\n * @method \\Aws\\Result updateAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateActionAsync(array $args = [])\n * @method \\Aws\\Result updateAppImageConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppImageConfigAsync(array $args = [])\n * @method \\Aws\\Result updateArtifact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateArtifactAsync(array $args = [])\n * @method \\Aws\\Result updateCodeRepository(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCodeRepositoryAsync(array $args = [])\n * @method \\Aws\\Result updateContext(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContextAsync(array $args = [])\n * @method \\Aws\\Result updateDeviceFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDeviceFleetAsync(array $args = [])\n * @method \\Aws\\Result updateDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDevicesAsync(array $args = [])\n * @method \\Aws\\Result updateDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDomainAsync(array $args = [])\n * @method \\Aws\\Result updateEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEndpointAsync(array $args = [])\n * @method \\Aws\\Result updateEndpointWeightsAndCapacities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEndpointWeightsAndCapacitiesAsync(array $args = [])\n * @method \\Aws\\Result updateExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateExperimentAsync(array $args = [])\n * @method \\Aws\\Result updateFeatureGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFeatureGroupAsync(array $args = [])\n * @method \\Aws\\Result updateFeatureMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFeatureMetadataAsync(array $args = [])\n * @method \\Aws\\Result updateHub(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateHubAsync(array $args = [])\n * @method \\Aws\\Result updateImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateImageAsync(array $args = [])\n * @method \\Aws\\Result updateImageVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateImageVersionAsync(array $args = [])\n * @method \\Aws\\Result updateInferenceExperiment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateInferenceExperimentAsync(array $args = [])\n * @method \\Aws\\Result updateModelCard(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateModelCardAsync(array $args = [])\n * @method \\Aws\\Result updateModelPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateModelPackageAsync(array $args = [])\n * @method \\Aws\\Result updateMonitoringAlert(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMonitoringAlertAsync(array $args = [])\n * @method \\Aws\\Result updateMonitoringSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMonitoringScheduleAsync(array $args = [])\n * @method \\Aws\\Result updateNotebookInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNotebookInstanceAsync(array $args = [])\n * @method \\Aws\\Result updateNotebookInstanceLifecycleConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNotebookInstanceLifecycleConfigAsync(array $args = [])\n * @method \\Aws\\Result updatePipeline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePipelineAsync(array $args = [])\n * @method \\Aws\\Result updatePipelineExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePipelineExecutionAsync(array $args = [])\n * @method \\Aws\\Result updateProject(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProjectAsync(array $args = [])\n * @method \\Aws\\Result updateSpace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSpaceAsync(array $args = [])\n * @method \\Aws\\Result updateTrainingJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTrainingJobAsync(array $args = [])\n * @method \\Aws\\Result updateTrial(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTrialAsync(array $args = [])\n * @method \\Aws\\Result updateTrialComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTrialComponentAsync(array $args = [])\n * @method \\Aws\\Result updateUserProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserProfileAsync(array $args = [])\n * @method \\Aws\\Result updateWorkforce(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkforceAsync(array $args = [])\n * @method \\Aws\\Result updateWorkteam(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkteamAsync(array $args = [])\n */\nclass SageMakerClient extends AwsClient {}\n", "num_lines": 614}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SageMaker\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon SageMaker Service** service.\n */\nclass SageMakerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SagemakerEdgeManager;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Sagemaker Edge Manager** service.\n * @method \\Aws\\Result getDeployments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeploymentsAsync(array $args = [])\n * @method \\Aws\\Result getDeviceRegistration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeviceRegistrationAsync(array $args = [])\n * @method \\Aws\\Result sendHeartbeat(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendHeartbeatAsync(array $args = [])\n */\nclass SagemakerEdgeManagerClient extends AwsClient {}\n", "num_lines": 16}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SagemakerEdgeManager\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Sagemaker Edge Manager** service.\n */\nclass SagemakerEdgeManagerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SageMakerFeatureStoreRuntime;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon SageMaker Feature Store Runtime** service.\n * @method \\Aws\\Result batchGetRecord(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetRecordAsync(array $args = [])\n * @method \\Aws\\Result deleteRecord(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRecordAsync(array $args = [])\n * @method \\Aws\\Result getRecord(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRecordAsync(array $args = [])\n * @method \\Aws\\Result putRecord(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRecordAsync(array $args = [])\n */\nclass SageMakerFeatureStoreRuntimeClient extends AwsClient {}\n", "num_lines": 18}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SageMakerFeatureStoreRuntime\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon SageMaker Feature Store Runtime** service.\n */\nclass SageMakerFeatureStoreRuntimeException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SageMakerGeospatial;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon SageMaker geospatial capabilities** service.\n * @method \\Aws\\Result deleteEarthObservationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEarthObservationJobAsync(array $args = [])\n * @method \\Aws\\Result deleteVectorEnrichmentJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVectorEnrichmentJobAsync(array $args = [])\n * @method \\Aws\\Result exportEarthObservationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportEarthObservationJobAsync(array $args = [])\n * @method \\Aws\\Result exportVectorEnrichmentJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportVectorEnrichmentJobAsync(array $args = [])\n * @method \\Aws\\Result getEarthObservationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEarthObservationJobAsync(array $args = [])\n * @method \\Aws\\Result getRasterDataCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRasterDataCollectionAsync(array $args = [])\n * @method \\Aws\\Result getTile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTileAsync(array $args = [])\n * @method \\Aws\\Result getVectorEnrichmentJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVectorEnrichmentJobAsync(array $args = [])\n * @method \\Aws\\Result listEarthObservationJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEarthObservationJobsAsync(array $args = [])\n * @method \\Aws\\Result listRasterDataCollections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRasterDataCollectionsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listVectorEnrichmentJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVectorEnrichmentJobsAsync(array $args = [])\n * @method \\Aws\\Result searchRasterDataCollection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchRasterDataCollectionAsync(array $args = [])\n * @method \\Aws\\Result startEarthObservationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startEarthObservationJobAsync(array $args = [])\n * @method \\Aws\\Result startVectorEnrichmentJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startVectorEnrichmentJobAsync(array $args = [])\n * @method \\Aws\\Result stopEarthObservationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopEarthObservationJobAsync(array $args = [])\n * @method \\Aws\\Result stopVectorEnrichmentJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopVectorEnrichmentJobAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass SageMakerGeospatialClient extends AwsClient {}\n", "num_lines": 48}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SageMakerGeospatial\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon SageMaker geospatial capabilities** service.\n */\nclass SageMakerGeospatialException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SageMakerMetrics;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon SageMaker Metrics Service** service.\n * @method \\Aws\\Result batchPutMetrics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchPutMetricsAsync(array $args = [])\n */\nclass SageMakerMetricsClient extends AwsClient {}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SageMakerMetrics\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon SageMaker Metrics Service** service.\n */\nclass SageMakerMetricsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SageMakerRuntime;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon SageMaker Runtime** service.\n * @method \\Aws\\Result invokeEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise invokeEndpointAsync(array $args = [])\n * @method \\Aws\\Result invokeEndpointAsync(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise invokeEndpointAsyncAsync(array $args = [])\n */\nclass SageMakerRuntimeClient extends AwsClient {}\n", "num_lines": 14}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SageMakerRuntime\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon SageMaker Runtime** service.\n */\nclass SageMakerRuntimeException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SavingsPlans;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Savings Plans** service.\n * @method \\Aws\\Result createSavingsPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSavingsPlanAsync(array $args = [])\n * @method \\Aws\\Result deleteQueuedSavingsPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteQueuedSavingsPlanAsync(array $args = [])\n * @method \\Aws\\Result describeSavingsPlanRates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSavingsPlanRatesAsync(array $args = [])\n * @method \\Aws\\Result describeSavingsPlans(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSavingsPlansAsync(array $args = [])\n * @method \\Aws\\Result describeSavingsPlansOfferingRates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSavingsPlansOfferingRatesAsync(array $args = [])\n * @method \\Aws\\Result describeSavingsPlansOfferings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSavingsPlansOfferingsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass SavingsPlansClient extends AwsClient {}\n", "num_lines": 28}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SavingsPlans\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Savings Plans** service.\n */\nclass SavingsPlansException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Scheduler;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon EventBridge Scheduler** service.\n * @method \\Aws\\Result createSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createScheduleAsync(array $args = [])\n * @method \\Aws\\Result createScheduleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createScheduleGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteScheduleAsync(array $args = [])\n * @method \\Aws\\Result deleteScheduleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteScheduleGroupAsync(array $args = [])\n * @method \\Aws\\Result getSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getScheduleAsync(array $args = [])\n * @method \\Aws\\Result getScheduleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getScheduleGroupAsync(array $args = [])\n * @method \\Aws\\Result listScheduleGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listScheduleGroupsAsync(array $args = [])\n * @method \\Aws\\Result listSchedules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSchedulesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateScheduleAsync(array $args = [])\n */\nclass SchedulerClient extends AwsClient {}\n", "num_lines": 34}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Scheduler\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon EventBridge Scheduler** service.\n */\nclass SchedulerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Schemas;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Schemas** service.\n * @method \\Aws\\Result createDiscoverer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDiscovererAsync(array $args = [])\n * @method \\Aws\\Result createRegistry(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRegistryAsync(array $args = [])\n * @method \\Aws\\Result createSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSchemaAsync(array $args = [])\n * @method \\Aws\\Result deleteDiscoverer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDiscovererAsync(array $args = [])\n * @method \\Aws\\Result deleteRegistry(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRegistryAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSchemaAsync(array $args = [])\n * @method \\Aws\\Result deleteSchemaVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSchemaVersionAsync(array $args = [])\n * @method \\Aws\\Result describeCodeBinding(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCodeBindingAsync(array $args = [])\n * @method \\Aws\\Result describeDiscoverer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDiscovererAsync(array $args = [])\n * @method \\Aws\\Result describeRegistry(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRegistryAsync(array $args = [])\n * @method \\Aws\\Result describeSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSchemaAsync(array $args = [])\n * @method \\Aws\\Result getCodeBindingSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCodeBindingSourceAsync(array $args = [])\n * @method \\Aws\\Result getDiscoveredSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDiscoveredSchemaAsync(array $args = [])\n * @method \\Aws\\Result getResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result listDiscoverers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDiscoverersAsync(array $args = [])\n * @method \\Aws\\Result listRegistries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRegistriesAsync(array $args = [])\n * @method \\Aws\\Result listSchemaVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSchemaVersionsAsync(array $args = [])\n * @method \\Aws\\Result listSchemas(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSchemasAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putCodeBinding(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putCodeBindingAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result searchSchemas(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchSchemasAsync(array $args = [])\n * @method \\Aws\\Result startDiscoverer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDiscovererAsync(array $args = [])\n * @method \\Aws\\Result stopDiscoverer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopDiscovererAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDiscoverer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDiscovererAsync(array $args = [])\n * @method \\Aws\\Result updateRegistry(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRegistryAsync(array $args = [])\n * @method \\Aws\\Result updateSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSchemaAsync(array $args = [])\n * @method \\Aws\\Result exportSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportSchemaAsync(array $args = [])\n */\nclass SchemasClient extends AwsClient {}\n", "num_lines": 72}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Schemas\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Schemas** service.\n */\nclass SchemasException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Script\\Composer;\n\nuse Composer\\Script\\Event;\nuse Symfony\\Component\\Filesystem\\Filesystem;\n\nclass Composer\n{\n    public static function removeUnusedServices(\n        Event      $event,\n        Filesystem $filesystem = null\n    )\n    {\n        $composer = $event->getComposer();\n        $extra = $composer->getPackage()->getExtra();\n        $listedServices = isset($extra['aws/aws-sdk-php'])\n            ? $extra['aws/aws-sdk-php']\n            : [];\n\n        if ($listedServices) {\n            $serviceMapping = self::buildServiceMapping();\n            self::verifyListedServices($serviceMapping, $listedServices);\n            $filesystem = $filesystem ?: new Filesystem();\n            $vendorPath = $composer->getConfig()->get('vendor-dir');\n            self::removeServiceDirs(\n                $event,\n                $filesystem,\n                $serviceMapping,\n                $listedServices,\n                $vendorPath\n            );\n        } else {\n            throw new \\InvalidArgumentException(\n                'There are no services listed. Did you intend to use this script?'\n            );\n        }\n    }\n\n    public static function buildServiceMapping()\n    {\n        $serviceMapping = [];\n        $manifest = require(__DIR__ . '/../../data/manifest.json.php');\n\n        foreach ($manifest as $service => $attributes) {\n            $serviceMapping[$attributes['namespace']] = $service;\n        }\n\n        return $serviceMapping;\n    }\n\n    private static function verifyListedServices($serviceMapping, $listedServices)\n    {\n        foreach ($listedServices as $serviceToKeep) {\n            if (!isset($serviceMapping[$serviceToKeep])) {\n                throw new \\InvalidArgumentException(\n                    \"'$serviceToKeep' is not a valid AWS service namespace. Please check spelling and casing.\"\n                );\n            }\n        }\n    }\n\n    private static function removeServiceDirs(\n        $event,\n        $filesystem,\n        $serviceMapping,\n        $listedServices,\n        $vendorPath\n    ) {\n        $unsafeForDeletion = ['Kms', 'S3', 'SSO', 'SSOOIDC', 'Sts'];\n        if (in_array('DynamoDbStreams', $listedServices)) {\n            $unsafeForDeletion[] = 'DynamoDb';\n        }\n\n        $clientPath = $vendorPath . '/aws/aws-sdk-php/src/';\n        $modelPath = $clientPath . 'data/';\n        $deleteCount = 0;\n\n        foreach ($serviceMapping as $clientName => $modelName) {\n            if (!in_array($clientName, $listedServices) &&\n                !in_array($clientName, $unsafeForDeletion)\n            ) {\n                $clientDir = $clientPath . $clientName;\n                $modelDir = $modelPath . $modelName;\n\n                if ($filesystem->exists([$clientDir, $modelDir])) {\n                    $filesystem->remove([$clientDir, $modelDir]);;\n                    $deleteCount++;\n                }\n            }\n        }\n        $event->getIO()->write(\n            \"Removed $deleteCount AWS service\" . ($deleteCount === 1 ? '' : 's')\n        );\n    }\n}", "num_lines": 95}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SecretsManager;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Secrets Manager** service.\n * @method \\Aws\\Result cancelRotateSecret(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelRotateSecretAsync(array $args = [])\n * @method \\Aws\\Result createSecret(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSecretAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteSecret(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSecretAsync(array $args = [])\n * @method \\Aws\\Result describeSecret(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSecretAsync(array $args = [])\n * @method \\Aws\\Result getRandomPassword(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRandomPasswordAsync(array $args = [])\n * @method \\Aws\\Result getResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result getSecretValue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSecretValueAsync(array $args = [])\n * @method \\Aws\\Result listSecretVersionIds(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSecretVersionIdsAsync(array $args = [])\n * @method \\Aws\\Result listSecrets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSecretsAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result putSecretValue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSecretValueAsync(array $args = [])\n * @method \\Aws\\Result removeRegionsFromReplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeRegionsFromReplicationAsync(array $args = [])\n * @method \\Aws\\Result replicateSecretToRegions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise replicateSecretToRegionsAsync(array $args = [])\n * @method \\Aws\\Result restoreSecret(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreSecretAsync(array $args = [])\n * @method \\Aws\\Result rotateSecret(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rotateSecretAsync(array $args = [])\n * @method \\Aws\\Result stopReplicationToReplica(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopReplicationToReplicaAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateSecret(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSecretAsync(array $args = [])\n * @method \\Aws\\Result updateSecretVersionStage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSecretVersionStageAsync(array $args = [])\n * @method \\Aws\\Result validateResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise validateResourcePolicyAsync(array $args = [])\n */\nclass SecretsManagerClient extends AwsClient {}\n", "num_lines": 54}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SecretsManager\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Secrets Manager** service.\n */\nclass SecretsManagerException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SecurityHub;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS SecurityHub** service.\n * @method \\Aws\\Result acceptAdministratorInvitation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptAdministratorInvitationAsync(array $args = [])\n * @method \\Aws\\Result acceptInvitation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptInvitationAsync(array $args = [])\n * @method \\Aws\\Result batchDeleteAutomationRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteAutomationRulesAsync(array $args = [])\n * @method \\Aws\\Result batchDisableStandards(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDisableStandardsAsync(array $args = [])\n * @method \\Aws\\Result batchEnableStandards(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchEnableStandardsAsync(array $args = [])\n * @method \\Aws\\Result batchGetAutomationRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetAutomationRulesAsync(array $args = [])\n * @method \\Aws\\Result batchGetSecurityControls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetSecurityControlsAsync(array $args = [])\n * @method \\Aws\\Result batchGetStandardsControlAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetStandardsControlAssociationsAsync(array $args = [])\n * @method \\Aws\\Result batchImportFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchImportFindingsAsync(array $args = [])\n * @method \\Aws\\Result batchUpdateAutomationRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdateAutomationRulesAsync(array $args = [])\n * @method \\Aws\\Result batchUpdateFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdateFindingsAsync(array $args = [])\n * @method \\Aws\\Result batchUpdateStandardsControlAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdateStandardsControlAssociationsAsync(array $args = [])\n * @method \\Aws\\Result createActionTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createActionTargetAsync(array $args = [])\n * @method \\Aws\\Result createAutomationRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAutomationRuleAsync(array $args = [])\n * @method \\Aws\\Result createFindingAggregator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFindingAggregatorAsync(array $args = [])\n * @method \\Aws\\Result createInsight(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInsightAsync(array $args = [])\n * @method \\Aws\\Result createMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMembersAsync(array $args = [])\n * @method \\Aws\\Result declineInvitations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise declineInvitationsAsync(array $args = [])\n * @method \\Aws\\Result deleteActionTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteActionTargetAsync(array $args = [])\n * @method \\Aws\\Result deleteFindingAggregator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFindingAggregatorAsync(array $args = [])\n * @method \\Aws\\Result deleteInsight(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInsightAsync(array $args = [])\n * @method \\Aws\\Result deleteInvitations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInvitationsAsync(array $args = [])\n * @method \\Aws\\Result deleteMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMembersAsync(array $args = [])\n * @method \\Aws\\Result describeActionTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeActionTargetsAsync(array $args = [])\n * @method \\Aws\\Result describeHub(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHubAsync(array $args = [])\n * @method \\Aws\\Result describeOrganizationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrganizationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeProducts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProductsAsync(array $args = [])\n * @method \\Aws\\Result describeStandards(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStandardsAsync(array $args = [])\n * @method \\Aws\\Result describeStandardsControls(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStandardsControlsAsync(array $args = [])\n * @method \\Aws\\Result disableImportFindingsForProduct(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableImportFindingsForProductAsync(array $args = [])\n * @method \\Aws\\Result disableOrganizationAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableOrganizationAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result disableSecurityHub(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableSecurityHubAsync(array $args = [])\n * @method \\Aws\\Result disassociateFromAdministratorAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateFromAdministratorAccountAsync(array $args = [])\n * @method \\Aws\\Result disassociateFromMasterAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateFromMasterAccountAsync(array $args = [])\n * @method \\Aws\\Result disassociateMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateMembersAsync(array $args = [])\n * @method \\Aws\\Result enableImportFindingsForProduct(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableImportFindingsForProductAsync(array $args = [])\n * @method \\Aws\\Result enableOrganizationAdminAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableOrganizationAdminAccountAsync(array $args = [])\n * @method \\Aws\\Result enableSecurityHub(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableSecurityHubAsync(array $args = [])\n * @method \\Aws\\Result getAdministratorAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAdministratorAccountAsync(array $args = [])\n * @method \\Aws\\Result getEnabledStandards(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEnabledStandardsAsync(array $args = [])\n * @method \\Aws\\Result getFindingAggregator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFindingAggregatorAsync(array $args = [])\n * @method \\Aws\\Result getFindingHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFindingHistoryAsync(array $args = [])\n * @method \\Aws\\Result getFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFindingsAsync(array $args = [])\n * @method \\Aws\\Result getInsightResults(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInsightResultsAsync(array $args = [])\n * @method \\Aws\\Result getInsights(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInsightsAsync(array $args = [])\n * @method \\Aws\\Result getInvitationsCount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInvitationsCountAsync(array $args = [])\n * @method \\Aws\\Result getMasterAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMasterAccountAsync(array $args = [])\n * @method \\Aws\\Result getMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMembersAsync(array $args = [])\n * @method \\Aws\\Result inviteMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise inviteMembersAsync(array $args = [])\n * @method \\Aws\\Result listAutomationRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAutomationRulesAsync(array $args = [])\n * @method \\Aws\\Result listEnabledProductsForImport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEnabledProductsForImportAsync(array $args = [])\n * @method \\Aws\\Result listFindingAggregators(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFindingAggregatorsAsync(array $args = [])\n * @method \\Aws\\Result listInvitations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInvitationsAsync(array $args = [])\n * @method \\Aws\\Result listMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMembersAsync(array $args = [])\n * @method \\Aws\\Result listOrganizationAdminAccounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOrganizationAdminAccountsAsync(array $args = [])\n * @method \\Aws\\Result listSecurityControlDefinitions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSecurityControlDefinitionsAsync(array $args = [])\n * @method \\Aws\\Result listStandardsControlAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStandardsControlAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateActionTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateActionTargetAsync(array $args = [])\n * @method \\Aws\\Result updateFindingAggregator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFindingAggregatorAsync(array $args = [])\n * @method \\Aws\\Result updateFindings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFindingsAsync(array $args = [])\n * @method \\Aws\\Result updateInsight(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateInsightAsync(array $args = [])\n * @method \\Aws\\Result updateOrganizationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateOrganizationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateSecurityHubConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSecurityHubConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateStandardsControl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStandardsControlAsync(array $args = [])\n */\nclass SecurityHubClient extends AwsClient {}\n", "num_lines": 144}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SecurityHub\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS SecurityHub** service.\n */\nclass SecurityHubException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SecurityLake;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Security Lake** service.\n * @method \\Aws\\Result createAwsLogSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAwsLogSourceAsync(array $args = [])\n * @method \\Aws\\Result createCustomLogSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCustomLogSourceAsync(array $args = [])\n * @method \\Aws\\Result createDataLake(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataLakeAsync(array $args = [])\n * @method \\Aws\\Result createDataLakeExceptionSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataLakeExceptionSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result createDataLakeOrganizationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDataLakeOrganizationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createSubscriber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSubscriberAsync(array $args = [])\n * @method \\Aws\\Result createSubscriberNotification(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSubscriberNotificationAsync(array $args = [])\n * @method \\Aws\\Result deleteAwsLogSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAwsLogSourceAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomLogSource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomLogSourceAsync(array $args = [])\n * @method \\Aws\\Result deleteDataLake(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataLakeAsync(array $args = [])\n * @method \\Aws\\Result deleteDataLakeExceptionSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataLakeExceptionSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result deleteDataLakeOrganizationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDataLakeOrganizationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteSubscriber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSubscriberAsync(array $args = [])\n * @method \\Aws\\Result deleteSubscriberNotification(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSubscriberNotificationAsync(array $args = [])\n * @method \\Aws\\Result deregisterDataLakeDelegatedAdministrator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterDataLakeDelegatedAdministratorAsync(array $args = [])\n * @method \\Aws\\Result getDataLakeExceptionSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataLakeExceptionSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result getDataLakeOrganizationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataLakeOrganizationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getDataLakeSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataLakeSourcesAsync(array $args = [])\n * @method \\Aws\\Result getSubscriber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSubscriberAsync(array $args = [])\n * @method \\Aws\\Result listDataLakeExceptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataLakeExceptionsAsync(array $args = [])\n * @method \\Aws\\Result listDataLakes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDataLakesAsync(array $args = [])\n * @method \\Aws\\Result listLogSources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLogSourcesAsync(array $args = [])\n * @method \\Aws\\Result listSubscribers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSubscribersAsync(array $args = [])\n * @method \\Aws\\Result registerDataLakeDelegatedAdministrator(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerDataLakeDelegatedAdministratorAsync(array $args = [])\n * @method \\Aws\\Result updateDataLake(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDataLakeAsync(array $args = [])\n * @method \\Aws\\Result updateDataLakeExceptionSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDataLakeExceptionSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result updateSubscriber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSubscriberAsync(array $args = [])\n * @method \\Aws\\Result updateSubscriberNotification(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSubscriberNotificationAsync(array $args = [])\n */\nclass SecurityLakeClient extends AwsClient {}\n", "num_lines": 66}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SecurityLake\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Security Lake** service.\n */\nclass SecurityLakeException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ServerlessApplicationRepository;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWSServerlessApplicationRepository** service.\n * @method \\Aws\\Result createApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationAsync(array $args = [])\n * @method \\Aws\\Result createApplicationVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createApplicationVersionAsync(array $args = [])\n * @method \\Aws\\Result createCloudFormationChangeSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCloudFormationChangeSetAsync(array $args = [])\n * @method \\Aws\\Result createCloudFormationTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCloudFormationTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteApplicationAsync(array $args = [])\n * @method \\Aws\\Result getApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApplicationAsync(array $args = [])\n * @method \\Aws\\Result getApplicationPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApplicationPolicyAsync(array $args = [])\n * @method \\Aws\\Result getCloudFormationTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCloudFormationTemplateAsync(array $args = [])\n * @method \\Aws\\Result listApplicationDependencies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationDependenciesAsync(array $args = [])\n * @method \\Aws\\Result listApplicationVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationVersionsAsync(array $args = [])\n * @method \\Aws\\Result listApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationsAsync(array $args = [])\n * @method \\Aws\\Result putApplicationPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putApplicationPolicyAsync(array $args = [])\n * @method \\Aws\\Result unshareApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unshareApplicationAsync(array $args = [])\n * @method \\Aws\\Result updateApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationAsync(array $args = [])\n */\nclass ServerlessApplicationRepositoryClient extends AwsClient {}\n", "num_lines": 38}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ServerlessApplicationRepository\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWSServerlessApplicationRepository** service.\n */\nclass ServerlessApplicationRepositoryException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ServiceCatalog;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Service Catalog** service.\n * @method \\Aws\\Result acceptPortfolioShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptPortfolioShareAsync(array $args = [])\n * @method \\Aws\\Result associateBudgetWithResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateBudgetWithResourceAsync(array $args = [])\n * @method \\Aws\\Result associatePrincipalWithPortfolio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associatePrincipalWithPortfolioAsync(array $args = [])\n * @method \\Aws\\Result associateProductWithPortfolio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateProductWithPortfolioAsync(array $args = [])\n * @method \\Aws\\Result associateServiceActionWithProvisioningArtifact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateServiceActionWithProvisioningArtifactAsync(array $args = [])\n * @method \\Aws\\Result associateTagOptionWithResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateTagOptionWithResourceAsync(array $args = [])\n * @method \\Aws\\Result batchAssociateServiceActionWithProvisioningArtifact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchAssociateServiceActionWithProvisioningArtifactAsync(array $args = [])\n * @method \\Aws\\Result batchDisassociateServiceActionFromProvisioningArtifact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDisassociateServiceActionFromProvisioningArtifactAsync(array $args = [])\n * @method \\Aws\\Result copyProduct(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyProductAsync(array $args = [])\n * @method \\Aws\\Result createConstraint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConstraintAsync(array $args = [])\n * @method \\Aws\\Result createPortfolio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPortfolioAsync(array $args = [])\n * @method \\Aws\\Result createPortfolioShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPortfolioShareAsync(array $args = [])\n * @method \\Aws\\Result createProduct(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProductAsync(array $args = [])\n * @method \\Aws\\Result createProvisionedProductPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProvisionedProductPlanAsync(array $args = [])\n * @method \\Aws\\Result createProvisioningArtifact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProvisioningArtifactAsync(array $args = [])\n * @method \\Aws\\Result createServiceAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceActionAsync(array $args = [])\n * @method \\Aws\\Result createTagOption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTagOptionAsync(array $args = [])\n * @method \\Aws\\Result deleteConstraint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConstraintAsync(array $args = [])\n * @method \\Aws\\Result deletePortfolio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePortfolioAsync(array $args = [])\n * @method \\Aws\\Result deletePortfolioShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePortfolioShareAsync(array $args = [])\n * @method \\Aws\\Result deleteProduct(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProductAsync(array $args = [])\n * @method \\Aws\\Result deleteProvisionedProductPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProvisionedProductPlanAsync(array $args = [])\n * @method \\Aws\\Result deleteProvisioningArtifact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProvisioningArtifactAsync(array $args = [])\n * @method \\Aws\\Result deleteServiceAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceActionAsync(array $args = [])\n * @method \\Aws\\Result deleteTagOption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTagOptionAsync(array $args = [])\n * @method \\Aws\\Result describeConstraint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConstraintAsync(array $args = [])\n * @method \\Aws\\Result describeCopyProductStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCopyProductStatusAsync(array $args = [])\n * @method \\Aws\\Result describePortfolio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePortfolioAsync(array $args = [])\n * @method \\Aws\\Result describePortfolioShareStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePortfolioShareStatusAsync(array $args = [])\n * @method \\Aws\\Result describePortfolioShares(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePortfolioSharesAsync(array $args = [])\n * @method \\Aws\\Result describeProduct(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProductAsync(array $args = [])\n * @method \\Aws\\Result describeProductAsAdmin(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProductAsAdminAsync(array $args = [])\n * @method \\Aws\\Result describeProductView(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProductViewAsync(array $args = [])\n * @method \\Aws\\Result describeProvisionedProduct(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProvisionedProductAsync(array $args = [])\n * @method \\Aws\\Result describeProvisionedProductPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProvisionedProductPlanAsync(array $args = [])\n * @method \\Aws\\Result describeProvisioningArtifact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProvisioningArtifactAsync(array $args = [])\n * @method \\Aws\\Result describeProvisioningParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProvisioningParametersAsync(array $args = [])\n * @method \\Aws\\Result describeRecord(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRecordAsync(array $args = [])\n * @method \\Aws\\Result describeServiceAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeServiceActionAsync(array $args = [])\n * @method \\Aws\\Result describeServiceActionExecutionParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeServiceActionExecutionParametersAsync(array $args = [])\n * @method \\Aws\\Result describeTagOption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTagOptionAsync(array $args = [])\n * @method \\Aws\\Result disableAWSOrganizationsAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableAWSOrganizationsAccessAsync(array $args = [])\n * @method \\Aws\\Result disassociateBudgetFromResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateBudgetFromResourceAsync(array $args = [])\n * @method \\Aws\\Result disassociatePrincipalFromPortfolio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociatePrincipalFromPortfolioAsync(array $args = [])\n * @method \\Aws\\Result disassociateProductFromPortfolio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateProductFromPortfolioAsync(array $args = [])\n * @method \\Aws\\Result disassociateServiceActionFromProvisioningArtifact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateServiceActionFromProvisioningArtifactAsync(array $args = [])\n * @method \\Aws\\Result disassociateTagOptionFromResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateTagOptionFromResourceAsync(array $args = [])\n * @method \\Aws\\Result enableAWSOrganizationsAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableAWSOrganizationsAccessAsync(array $args = [])\n * @method \\Aws\\Result executeProvisionedProductPlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise executeProvisionedProductPlanAsync(array $args = [])\n * @method \\Aws\\Result executeProvisionedProductServiceAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise executeProvisionedProductServiceActionAsync(array $args = [])\n * @method \\Aws\\Result getAWSOrganizationsAccessStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAWSOrganizationsAccessStatusAsync(array $args = [])\n * @method \\Aws\\Result getProvisionedProductOutputs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProvisionedProductOutputsAsync(array $args = [])\n * @method \\Aws\\Result importAsProvisionedProduct(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importAsProvisionedProductAsync(array $args = [])\n * @method \\Aws\\Result listAcceptedPortfolioShares(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAcceptedPortfolioSharesAsync(array $args = [])\n * @method \\Aws\\Result listBudgetsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBudgetsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listConstraintsForPortfolio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConstraintsForPortfolioAsync(array $args = [])\n * @method \\Aws\\Result listLaunchPaths(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLaunchPathsAsync(array $args = [])\n * @method \\Aws\\Result listOrganizationPortfolioAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOrganizationPortfolioAccessAsync(array $args = [])\n * @method \\Aws\\Result listPortfolioAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPortfolioAccessAsync(array $args = [])\n * @method \\Aws\\Result listPortfolios(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPortfoliosAsync(array $args = [])\n * @method \\Aws\\Result listPortfoliosForProduct(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPortfoliosForProductAsync(array $args = [])\n * @method \\Aws\\Result listPrincipalsForPortfolio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPrincipalsForPortfolioAsync(array $args = [])\n * @method \\Aws\\Result listProvisionedProductPlans(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProvisionedProductPlansAsync(array $args = [])\n * @method \\Aws\\Result listProvisioningArtifacts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProvisioningArtifactsAsync(array $args = [])\n * @method \\Aws\\Result listProvisioningArtifactsForServiceAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProvisioningArtifactsForServiceActionAsync(array $args = [])\n * @method \\Aws\\Result listRecordHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecordHistoryAsync(array $args = [])\n * @method \\Aws\\Result listResourcesForTagOption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourcesForTagOptionAsync(array $args = [])\n * @method \\Aws\\Result listServiceActions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServiceActionsAsync(array $args = [])\n * @method \\Aws\\Result listServiceActionsForProvisioningArtifact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServiceActionsForProvisioningArtifactAsync(array $args = [])\n * @method \\Aws\\Result listStackInstancesForProvisionedProduct(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStackInstancesForProvisionedProductAsync(array $args = [])\n * @method \\Aws\\Result listTagOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagOptionsAsync(array $args = [])\n * @method \\Aws\\Result notifyProvisionProductEngineWorkflowResult(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise notifyProvisionProductEngineWorkflowResultAsync(array $args = [])\n * @method \\Aws\\Result notifyTerminateProvisionedProductEngineWorkflowResult(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise notifyTerminateProvisionedProductEngineWorkflowResultAsync(array $args = [])\n * @method \\Aws\\Result notifyUpdateProvisionedProductEngineWorkflowResult(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise notifyUpdateProvisionedProductEngineWorkflowResultAsync(array $args = [])\n * @method \\Aws\\Result provisionProduct(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise provisionProductAsync(array $args = [])\n * @method \\Aws\\Result rejectPortfolioShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rejectPortfolioShareAsync(array $args = [])\n * @method \\Aws\\Result scanProvisionedProducts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise scanProvisionedProductsAsync(array $args = [])\n * @method \\Aws\\Result searchProducts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchProductsAsync(array $args = [])\n * @method \\Aws\\Result searchProductsAsAdmin(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchProductsAsAdminAsync(array $args = [])\n * @method \\Aws\\Result searchProvisionedProducts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchProvisionedProductsAsync(array $args = [])\n * @method \\Aws\\Result terminateProvisionedProduct(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise terminateProvisionedProductAsync(array $args = [])\n * @method \\Aws\\Result updateConstraint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConstraintAsync(array $args = [])\n * @method \\Aws\\Result updatePortfolio(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePortfolioAsync(array $args = [])\n * @method \\Aws\\Result updatePortfolioShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePortfolioShareAsync(array $args = [])\n * @method \\Aws\\Result updateProduct(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProductAsync(array $args = [])\n * @method \\Aws\\Result updateProvisionedProduct(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProvisionedProductAsync(array $args = [])\n * @method \\Aws\\Result updateProvisionedProductProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProvisionedProductPropertiesAsync(array $args = [])\n * @method \\Aws\\Result updateProvisioningArtifact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProvisioningArtifactAsync(array $args = [])\n * @method \\Aws\\Result updateServiceAction(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceActionAsync(array $args = [])\n * @method \\Aws\\Result updateTagOption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTagOptionAsync(array $args = [])\n */\nclass ServiceCatalogClient extends AwsClient {}\n", "num_lines": 190}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ServiceCatalog\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Service Catalog** service.\n */\nclass ServiceCatalogException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ServiceDiscovery;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Route 53 Auto Naming** service.\n * @method \\Aws\\Result createHttpNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createHttpNamespaceAsync(array $args = [])\n * @method \\Aws\\Result createPrivateDnsNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPrivateDnsNamespaceAsync(array $args = [])\n * @method \\Aws\\Result createPublicDnsNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPublicDnsNamespaceAsync(array $args = [])\n * @method \\Aws\\Result createService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceAsync(array $args = [])\n * @method \\Aws\\Result deleteNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNamespaceAsync(array $args = [])\n * @method \\Aws\\Result deleteService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceAsync(array $args = [])\n * @method \\Aws\\Result deregisterInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterInstanceAsync(array $args = [])\n * @method \\Aws\\Result discoverInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise discoverInstancesAsync(array $args = [])\n * @method \\Aws\\Result getInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInstanceAsync(array $args = [])\n * @method \\Aws\\Result getInstancesHealthStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInstancesHealthStatusAsync(array $args = [])\n * @method \\Aws\\Result getNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNamespaceAsync(array $args = [])\n * @method \\Aws\\Result getOperation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOperationAsync(array $args = [])\n * @method \\Aws\\Result getService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceAsync(array $args = [])\n * @method \\Aws\\Result listInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInstancesAsync(array $args = [])\n * @method \\Aws\\Result listNamespaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNamespacesAsync(array $args = [])\n * @method \\Aws\\Result listOperations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOperationsAsync(array $args = [])\n * @method \\Aws\\Result listServices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServicesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result registerInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerInstanceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateHttpNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateHttpNamespaceAsync(array $args = [])\n * @method \\Aws\\Result updateInstanceCustomHealthStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateInstanceCustomHealthStatusAsync(array $args = [])\n * @method \\Aws\\Result updatePrivateDnsNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePrivateDnsNamespaceAsync(array $args = [])\n * @method \\Aws\\Result updatePublicDnsNamespace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePublicDnsNamespaceAsync(array $args = [])\n * @method \\Aws\\Result updateService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceAsync(array $args = [])\n */\nclass ServiceDiscoveryClient extends AwsClient {}\n", "num_lines": 62}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ServiceDiscovery\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Route 53 Auto Naming** service.\n */\nclass ServiceDiscoveryException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ServiceQuotas;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Service Quotas** service.\n * @method \\Aws\\Result associateServiceQuotaTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateServiceQuotaTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteServiceQuotaIncreaseRequestFromTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceQuotaIncreaseRequestFromTemplateAsync(array $args = [])\n * @method \\Aws\\Result disassociateServiceQuotaTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateServiceQuotaTemplateAsync(array $args = [])\n * @method \\Aws\\Result getAWSDefaultServiceQuota(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAWSDefaultServiceQuotaAsync(array $args = [])\n * @method \\Aws\\Result getAssociationForServiceQuotaTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAssociationForServiceQuotaTemplateAsync(array $args = [])\n * @method \\Aws\\Result getRequestedServiceQuotaChange(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRequestedServiceQuotaChangeAsync(array $args = [])\n * @method \\Aws\\Result getServiceQuota(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceQuotaAsync(array $args = [])\n * @method \\Aws\\Result getServiceQuotaIncreaseRequestFromTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceQuotaIncreaseRequestFromTemplateAsync(array $args = [])\n * @method \\Aws\\Result listAWSDefaultServiceQuotas(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAWSDefaultServiceQuotasAsync(array $args = [])\n * @method \\Aws\\Result listRequestedServiceQuotaChangeHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRequestedServiceQuotaChangeHistoryAsync(array $args = [])\n * @method \\Aws\\Result listRequestedServiceQuotaChangeHistoryByQuota(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRequestedServiceQuotaChangeHistoryByQuotaAsync(array $args = [])\n * @method \\Aws\\Result listServiceQuotaIncreaseRequestsInTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServiceQuotaIncreaseRequestsInTemplateAsync(array $args = [])\n * @method \\Aws\\Result listServiceQuotas(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServiceQuotasAsync(array $args = [])\n * @method \\Aws\\Result listServices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServicesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putServiceQuotaIncreaseRequestIntoTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putServiceQuotaIncreaseRequestIntoTemplateAsync(array $args = [])\n * @method \\Aws\\Result requestServiceQuotaIncrease(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise requestServiceQuotaIncreaseAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass ServiceQuotasClient extends AwsClient {}\n", "num_lines": 48}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\ServiceQuotas\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Service Quotas** service.\n */\nclass ServiceQuotasException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Ses;\n\nuse Aws\\Api\\ApiProvider;\nuse Aws\\Api\\DocModel;\nuse Aws\\Api\\Service;\nuse Aws\\Credentials\\CredentialsInterface;\n\n/**\n * This client is used to interact with the **Amazon Simple Email Service (Amazon SES)**.\n *\n * @method \\Aws\\Result cloneReceiptRuleSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cloneReceiptRuleSetAsync(array $args = [])\n * @method \\Aws\\Result createConfigurationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfigurationSetAsync(array $args = [])\n * @method \\Aws\\Result createConfigurationSetEventDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfigurationSetEventDestinationAsync(array $args = [])\n * @method \\Aws\\Result createConfigurationSetTrackingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfigurationSetTrackingOptionsAsync(array $args = [])\n * @method \\Aws\\Result createCustomVerificationEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCustomVerificationEmailTemplateAsync(array $args = [])\n * @method \\Aws\\Result createReceiptFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReceiptFilterAsync(array $args = [])\n * @method \\Aws\\Result createReceiptRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReceiptRuleAsync(array $args = [])\n * @method \\Aws\\Result createReceiptRuleSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReceiptRuleSetAsync(array $args = [])\n * @method \\Aws\\Result createTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteConfigurationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigurationSetAsync(array $args = [])\n * @method \\Aws\\Result deleteConfigurationSetEventDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigurationSetEventDestinationAsync(array $args = [])\n * @method \\Aws\\Result deleteConfigurationSetTrackingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigurationSetTrackingOptionsAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomVerificationEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomVerificationEmailTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIdentityAsync(array $args = [])\n * @method \\Aws\\Result deleteIdentityPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIdentityPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteReceiptFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReceiptFilterAsync(array $args = [])\n * @method \\Aws\\Result deleteReceiptRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReceiptRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteReceiptRuleSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReceiptRuleSetAsync(array $args = [])\n * @method \\Aws\\Result deleteTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteVerifiedEmailAddress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVerifiedEmailAddressAsync(array $args = [])\n * @method \\Aws\\Result describeActiveReceiptRuleSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeActiveReceiptRuleSetAsync(array $args = [])\n * @method \\Aws\\Result describeConfigurationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConfigurationSetAsync(array $args = [])\n * @method \\Aws\\Result describeReceiptRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReceiptRuleAsync(array $args = [])\n * @method \\Aws\\Result describeReceiptRuleSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReceiptRuleSetAsync(array $args = [])\n * @method \\Aws\\Result getAccountSendingEnabled(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountSendingEnabledAsync(array $args = [])\n * @method \\Aws\\Result getCustomVerificationEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCustomVerificationEmailTemplateAsync(array $args = [])\n * @method \\Aws\\Result getIdentityDkimAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIdentityDkimAttributesAsync(array $args = [])\n * @method \\Aws\\Result getIdentityMailFromDomainAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIdentityMailFromDomainAttributesAsync(array $args = [])\n * @method \\Aws\\Result getIdentityNotificationAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIdentityNotificationAttributesAsync(array $args = [])\n * @method \\Aws\\Result getIdentityPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIdentityPoliciesAsync(array $args = [])\n * @method \\Aws\\Result getIdentityVerificationAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIdentityVerificationAttributesAsync(array $args = [])\n * @method \\Aws\\Result getSendQuota(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSendQuotaAsync(array $args = [])\n * @method \\Aws\\Result getSendStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSendStatisticsAsync(array $args = [])\n * @method \\Aws\\Result getTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTemplateAsync(array $args = [])\n * @method \\Aws\\Result listConfigurationSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConfigurationSetsAsync(array $args = [])\n * @method \\Aws\\Result listCustomVerificationEmailTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCustomVerificationEmailTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listIdentities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIdentitiesAsync(array $args = [])\n * @method \\Aws\\Result listIdentityPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIdentityPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listReceiptFilters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReceiptFiltersAsync(array $args = [])\n * @method \\Aws\\Result listReceiptRuleSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReceiptRuleSetsAsync(array $args = [])\n * @method \\Aws\\Result listTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listVerifiedEmailAddresses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVerifiedEmailAddressesAsync(array $args = [])\n * @method \\Aws\\Result putConfigurationSetDeliveryOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConfigurationSetDeliveryOptionsAsync(array $args = [])\n * @method \\Aws\\Result putIdentityPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putIdentityPolicyAsync(array $args = [])\n * @method \\Aws\\Result reorderReceiptRuleSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise reorderReceiptRuleSetAsync(array $args = [])\n * @method \\Aws\\Result sendBounce(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendBounceAsync(array $args = [])\n * @method \\Aws\\Result sendBulkTemplatedEmail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendBulkTemplatedEmailAsync(array $args = [])\n * @method \\Aws\\Result sendCustomVerificationEmail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendCustomVerificationEmailAsync(array $args = [])\n * @method \\Aws\\Result sendEmail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendEmailAsync(array $args = [])\n * @method \\Aws\\Result sendRawEmail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendRawEmailAsync(array $args = [])\n * @method \\Aws\\Result sendTemplatedEmail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendTemplatedEmailAsync(array $args = [])\n * @method \\Aws\\Result setActiveReceiptRuleSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setActiveReceiptRuleSetAsync(array $args = [])\n * @method \\Aws\\Result setIdentityDkimEnabled(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setIdentityDkimEnabledAsync(array $args = [])\n * @method \\Aws\\Result setIdentityFeedbackForwardingEnabled(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setIdentityFeedbackForwardingEnabledAsync(array $args = [])\n * @method \\Aws\\Result setIdentityHeadersInNotificationsEnabled(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setIdentityHeadersInNotificationsEnabledAsync(array $args = [])\n * @method \\Aws\\Result setIdentityMailFromDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setIdentityMailFromDomainAsync(array $args = [])\n * @method \\Aws\\Result setIdentityNotificationTopic(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setIdentityNotificationTopicAsync(array $args = [])\n * @method \\Aws\\Result setReceiptRulePosition(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setReceiptRulePositionAsync(array $args = [])\n * @method \\Aws\\Result testRenderTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testRenderTemplateAsync(array $args = [])\n * @method \\Aws\\Result updateAccountSendingEnabled(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccountSendingEnabledAsync(array $args = [])\n * @method \\Aws\\Result updateConfigurationSetEventDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConfigurationSetEventDestinationAsync(array $args = [])\n * @method \\Aws\\Result updateConfigurationSetReputationMetricsEnabled(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConfigurationSetReputationMetricsEnabledAsync(array $args = [])\n * @method \\Aws\\Result updateConfigurationSetSendingEnabled(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConfigurationSetSendingEnabledAsync(array $args = [])\n * @method \\Aws\\Result updateConfigurationSetTrackingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConfigurationSetTrackingOptionsAsync(array $args = [])\n * @method \\Aws\\Result updateCustomVerificationEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCustomVerificationEmailTemplateAsync(array $args = [])\n * @method \\Aws\\Result updateReceiptRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateReceiptRuleAsync(array $args = [])\n * @method \\Aws\\Result updateTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTemplateAsync(array $args = [])\n * @method \\Aws\\Result verifyDomainDkim(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise verifyDomainDkimAsync(array $args = [])\n * @method \\Aws\\Result verifyDomainIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise verifyDomainIdentityAsync(array $args = [])\n * @method \\Aws\\Result verifyEmailAddress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise verifyEmailAddressAsync(array $args = [])\n * @method \\Aws\\Result verifyEmailIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise verifyEmailIdentityAsync(array $args = [])\n */\nclass SesClient extends \\Aws\\AwsClient\n{\n    /**\n     * @deprecated This method will no longer work due to the deprecation of\n     *             V2 credentials with SES as of 03/25/2021\n     * Create an SMTP password for a given IAM user's credentials.\n     *\n     * The SMTP username is the Access Key ID for the provided credentials.\n     *\n     * @link http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html#smtp-credentials-convert\n     *\n     * @param CredentialsInterface $creds\n     *\n     * @return string\n     */\n    public static function generateSmtpPassword(CredentialsInterface $creds)\n    {\n        static $version = \"\\x02\";\n        static $algo = 'sha256';\n        static $message = 'SendRawEmail';\n        $signature = hash_hmac($algo, $message, $creds->getSecretKey(), true);\n\n        return base64_encode($version . $signature);\n    }\n\n    /**\n     * Create an SMTP password for a given IAM user's credentials.\n     *\n     * The SMTP username is the Access Key ID for the provided credentials. This\n     * utility method is not guaranteed to work indefinitely and is provided as\n     * a convenience to customers using the generateSmtpPassword method.  It is\n     * not recommended for use in production\n     *\n     * @link https://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html#smtp-credentials-convert\n     *\n     * @param CredentialsInterface $creds\n     * @param string $region\n     *\n     * @return string\n     */\n    public static function generateSmtpPasswordV4(CredentialsInterface $creds, $region)\n    {\n        $key = $creds->getSecretKey();\n\n        $date = \"11111111\";\n        $service = \"ses\";\n        $terminal = \"aws4_request\";\n        $message = \"SendRawEmail\";\n        $version = 0x04;\n\n        $signature = self::sign($date, \"AWS4\" . $key);\n        $signature = self::sign($region, $signature);\n        $signature = self::sign($service, $signature);\n        $signature = self::sign($terminal, $signature);\n        $signature = self::sign($message, $signature);\n        $signatureAndVersion = pack('c', $version) . $signature;\n\n        return  base64_encode($signatureAndVersion);\n    }\n\n    private static function sign($key, $message) {\n        return hash_hmac('sha256', $key, $message, true);\n    }\n\n    /**\n     * @internal\n     * @codeCoverageIgnore\n     */\n    public static function applyDocFilters(array $api, array $docs)\n    {\n        $b64 = '<div class=\"alert alert-info\">This value will be base64 encoded on your behalf.</div>';\n\n        $docs['shapes']['RawMessage']['append'] = $b64;\n\n        return [\n            new Service($api, ApiProvider::defaultProvider()),\n            new DocModel($docs)\n        ];\n    }\n}\n", "num_lines": 235}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Ses\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon Simple Email Service.\n */\nclass SesException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SesV2;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Simple Email Service** service.\n * @method \\Aws\\Result batchGetMetricData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetMetricDataAsync(array $args = [])\n * @method \\Aws\\Result createConfigurationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfigurationSetAsync(array $args = [])\n * @method \\Aws\\Result createConfigurationSetEventDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConfigurationSetEventDestinationAsync(array $args = [])\n * @method \\Aws\\Result createContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createContactAsync(array $args = [])\n * @method \\Aws\\Result createContactList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createContactListAsync(array $args = [])\n * @method \\Aws\\Result createCustomVerificationEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCustomVerificationEmailTemplateAsync(array $args = [])\n * @method \\Aws\\Result createDedicatedIpPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDedicatedIpPoolAsync(array $args = [])\n * @method \\Aws\\Result createDeliverabilityTestReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDeliverabilityTestReportAsync(array $args = [])\n * @method \\Aws\\Result createEmailIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEmailIdentityAsync(array $args = [])\n * @method \\Aws\\Result createEmailIdentityPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEmailIdentityPolicyAsync(array $args = [])\n * @method \\Aws\\Result createEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createEmailTemplateAsync(array $args = [])\n * @method \\Aws\\Result createImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createImportJobAsync(array $args = [])\n * @method \\Aws\\Result deleteConfigurationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigurationSetAsync(array $args = [])\n * @method \\Aws\\Result deleteConfigurationSetEventDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConfigurationSetEventDestinationAsync(array $args = [])\n * @method \\Aws\\Result deleteContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteContactAsync(array $args = [])\n * @method \\Aws\\Result deleteContactList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteContactListAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomVerificationEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomVerificationEmailTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteDedicatedIpPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDedicatedIpPoolAsync(array $args = [])\n * @method \\Aws\\Result deleteEmailIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEmailIdentityAsync(array $args = [])\n * @method \\Aws\\Result deleteEmailIdentityPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEmailIdentityPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEmailTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteSuppressedDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSuppressedDestinationAsync(array $args = [])\n * @method \\Aws\\Result getAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountAsync(array $args = [])\n * @method \\Aws\\Result getBlacklistReports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBlacklistReportsAsync(array $args = [])\n * @method \\Aws\\Result getConfigurationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConfigurationSetAsync(array $args = [])\n * @method \\Aws\\Result getConfigurationSetEventDestinations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConfigurationSetEventDestinationsAsync(array $args = [])\n * @method \\Aws\\Result getContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContactAsync(array $args = [])\n * @method \\Aws\\Result getContactList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContactListAsync(array $args = [])\n * @method \\Aws\\Result getCustomVerificationEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCustomVerificationEmailTemplateAsync(array $args = [])\n * @method \\Aws\\Result getDedicatedIp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDedicatedIpAsync(array $args = [])\n * @method \\Aws\\Result getDedicatedIpPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDedicatedIpPoolAsync(array $args = [])\n * @method \\Aws\\Result getDedicatedIps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDedicatedIpsAsync(array $args = [])\n * @method \\Aws\\Result getDeliverabilityDashboardOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeliverabilityDashboardOptionsAsync(array $args = [])\n * @method \\Aws\\Result getDeliverabilityTestReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeliverabilityTestReportAsync(array $args = [])\n * @method \\Aws\\Result getDomainDeliverabilityCampaign(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainDeliverabilityCampaignAsync(array $args = [])\n * @method \\Aws\\Result getDomainStatisticsReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDomainStatisticsReportAsync(array $args = [])\n * @method \\Aws\\Result getEmailIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEmailIdentityAsync(array $args = [])\n * @method \\Aws\\Result getEmailIdentityPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEmailIdentityPoliciesAsync(array $args = [])\n * @method \\Aws\\Result getEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEmailTemplateAsync(array $args = [])\n * @method \\Aws\\Result getImportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getImportJobAsync(array $args = [])\n * @method \\Aws\\Result getSuppressedDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSuppressedDestinationAsync(array $args = [])\n * @method \\Aws\\Result listConfigurationSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConfigurationSetsAsync(array $args = [])\n * @method \\Aws\\Result listContactLists(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listContactListsAsync(array $args = [])\n * @method \\Aws\\Result listContacts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listContactsAsync(array $args = [])\n * @method \\Aws\\Result listCustomVerificationEmailTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCustomVerificationEmailTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listDedicatedIpPools(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDedicatedIpPoolsAsync(array $args = [])\n * @method \\Aws\\Result listDeliverabilityTestReports(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeliverabilityTestReportsAsync(array $args = [])\n * @method \\Aws\\Result listDomainDeliverabilityCampaigns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainDeliverabilityCampaignsAsync(array $args = [])\n * @method \\Aws\\Result listEmailIdentities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEmailIdentitiesAsync(array $args = [])\n * @method \\Aws\\Result listEmailTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEmailTemplatesAsync(array $args = [])\n * @method \\Aws\\Result listImportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listImportJobsAsync(array $args = [])\n * @method \\Aws\\Result listRecommendations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRecommendationsAsync(array $args = [])\n * @method \\Aws\\Result listSuppressedDestinations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSuppressedDestinationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putAccountDedicatedIpWarmupAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccountDedicatedIpWarmupAttributesAsync(array $args = [])\n * @method \\Aws\\Result putAccountDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccountDetailsAsync(array $args = [])\n * @method \\Aws\\Result putAccountSendingAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccountSendingAttributesAsync(array $args = [])\n * @method \\Aws\\Result putAccountSuppressionAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccountSuppressionAttributesAsync(array $args = [])\n * @method \\Aws\\Result putAccountVdmAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccountVdmAttributesAsync(array $args = [])\n * @method \\Aws\\Result putConfigurationSetDeliveryOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConfigurationSetDeliveryOptionsAsync(array $args = [])\n * @method \\Aws\\Result putConfigurationSetReputationOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConfigurationSetReputationOptionsAsync(array $args = [])\n * @method \\Aws\\Result putConfigurationSetSendingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConfigurationSetSendingOptionsAsync(array $args = [])\n * @method \\Aws\\Result putConfigurationSetSuppressionOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConfigurationSetSuppressionOptionsAsync(array $args = [])\n * @method \\Aws\\Result putConfigurationSetTrackingOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConfigurationSetTrackingOptionsAsync(array $args = [])\n * @method \\Aws\\Result putConfigurationSetVdmOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putConfigurationSetVdmOptionsAsync(array $args = [])\n * @method \\Aws\\Result putDedicatedIpInPool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDedicatedIpInPoolAsync(array $args = [])\n * @method \\Aws\\Result putDedicatedIpPoolScalingAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDedicatedIpPoolScalingAttributesAsync(array $args = [])\n * @method \\Aws\\Result putDedicatedIpWarmupAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDedicatedIpWarmupAttributesAsync(array $args = [])\n * @method \\Aws\\Result putDeliverabilityDashboardOption(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDeliverabilityDashboardOptionAsync(array $args = [])\n * @method \\Aws\\Result putEmailIdentityConfigurationSetAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEmailIdentityConfigurationSetAttributesAsync(array $args = [])\n * @method \\Aws\\Result putEmailIdentityDkimAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEmailIdentityDkimAttributesAsync(array $args = [])\n * @method \\Aws\\Result putEmailIdentityDkimSigningAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEmailIdentityDkimSigningAttributesAsync(array $args = [])\n * @method \\Aws\\Result putEmailIdentityFeedbackAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEmailIdentityFeedbackAttributesAsync(array $args = [])\n * @method \\Aws\\Result putEmailIdentityMailFromAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEmailIdentityMailFromAttributesAsync(array $args = [])\n * @method \\Aws\\Result putSuppressedDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSuppressedDestinationAsync(array $args = [])\n * @method \\Aws\\Result sendBulkEmail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendBulkEmailAsync(array $args = [])\n * @method \\Aws\\Result sendCustomVerificationEmail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendCustomVerificationEmailAsync(array $args = [])\n * @method \\Aws\\Result sendEmail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendEmailAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result testRenderEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testRenderEmailTemplateAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateConfigurationSetEventDestination(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConfigurationSetEventDestinationAsync(array $args = [])\n * @method \\Aws\\Result updateContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContactAsync(array $args = [])\n * @method \\Aws\\Result updateContactList(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContactListAsync(array $args = [])\n * @method \\Aws\\Result updateCustomVerificationEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCustomVerificationEmailTemplateAsync(array $args = [])\n * @method \\Aws\\Result updateEmailIdentityPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEmailIdentityPolicyAsync(array $args = [])\n * @method \\Aws\\Result updateEmailTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEmailTemplateAsync(array $args = [])\n */\nclass SesV2Client extends AwsClient {}\n", "num_lines": 184}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SesV2\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Simple Email Service** service.\n */\nclass SesV2Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sfn;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Step Functions** service.\n * @method \\Aws\\Result createActivity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createActivityAsync(array $args = [])\n * @method \\Aws\\Result createStateMachine(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStateMachineAsync(array $args = [])\n * @method \\Aws\\Result createStateMachineAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStateMachineAliasAsync(array $args = [])\n * @method \\Aws\\Result deleteActivity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteActivityAsync(array $args = [])\n * @method \\Aws\\Result deleteStateMachine(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStateMachineAsync(array $args = [])\n * @method \\Aws\\Result deleteStateMachineAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStateMachineAliasAsync(array $args = [])\n * @method \\Aws\\Result deleteStateMachineVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteStateMachineVersionAsync(array $args = [])\n * @method \\Aws\\Result describeActivity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeActivityAsync(array $args = [])\n * @method \\Aws\\Result describeExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeExecutionAsync(array $args = [])\n * @method \\Aws\\Result describeMapRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMapRunAsync(array $args = [])\n * @method \\Aws\\Result describeStateMachine(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStateMachineAsync(array $args = [])\n * @method \\Aws\\Result describeStateMachineAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStateMachineAliasAsync(array $args = [])\n * @method \\Aws\\Result describeStateMachineForExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStateMachineForExecutionAsync(array $args = [])\n * @method \\Aws\\Result getActivityTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getActivityTaskAsync(array $args = [])\n * @method \\Aws\\Result getExecutionHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExecutionHistoryAsync(array $args = [])\n * @method \\Aws\\Result listActivities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listActivitiesAsync(array $args = [])\n * @method \\Aws\\Result listExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listMapRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMapRunsAsync(array $args = [])\n * @method \\Aws\\Result listStateMachineAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStateMachineAliasesAsync(array $args = [])\n * @method \\Aws\\Result listStateMachineVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStateMachineVersionsAsync(array $args = [])\n * @method \\Aws\\Result listStateMachines(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listStateMachinesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result publishStateMachineVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise publishStateMachineVersionAsync(array $args = [])\n * @method \\Aws\\Result sendTaskFailure(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendTaskFailureAsync(array $args = [])\n * @method \\Aws\\Result sendTaskHeartbeat(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendTaskHeartbeatAsync(array $args = [])\n * @method \\Aws\\Result sendTaskSuccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendTaskSuccessAsync(array $args = [])\n * @method \\Aws\\Result startExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startExecutionAsync(array $args = [])\n * @method \\Aws\\Result startSyncExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSyncExecutionAsync(array $args = [])\n * @method \\Aws\\Result stopExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopExecutionAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateMapRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMapRunAsync(array $args = [])\n * @method \\Aws\\Result updateStateMachine(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStateMachineAsync(array $args = [])\n * @method \\Aws\\Result updateStateMachineAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateStateMachineAliasAsync(array $args = [])\n */\nclass SfnClient extends AwsClient {}\n", "num_lines": 78}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sfn\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Step Functions** service.\n */\nclass SfnException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Shield;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Shield** service.\n * @method \\Aws\\Result associateDRTLogBucket(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateDRTLogBucketAsync(array $args = [])\n * @method \\Aws\\Result associateDRTRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateDRTRoleAsync(array $args = [])\n * @method \\Aws\\Result associateHealthCheck(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateHealthCheckAsync(array $args = [])\n * @method \\Aws\\Result associateProactiveEngagementDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateProactiveEngagementDetailsAsync(array $args = [])\n * @method \\Aws\\Result createProtection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProtectionAsync(array $args = [])\n * @method \\Aws\\Result createProtectionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProtectionGroupAsync(array $args = [])\n * @method \\Aws\\Result createSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result deleteProtection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProtectionAsync(array $args = [])\n * @method \\Aws\\Result deleteProtectionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProtectionGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result describeAttack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAttackAsync(array $args = [])\n * @method \\Aws\\Result describeAttackStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAttackStatisticsAsync(array $args = [])\n * @method \\Aws\\Result describeDRTAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDRTAccessAsync(array $args = [])\n * @method \\Aws\\Result describeEmergencyContactSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEmergencyContactSettingsAsync(array $args = [])\n * @method \\Aws\\Result describeProtection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProtectionAsync(array $args = [])\n * @method \\Aws\\Result describeProtectionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProtectionGroupAsync(array $args = [])\n * @method \\Aws\\Result describeSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result disableApplicationLayerAutomaticResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableApplicationLayerAutomaticResponseAsync(array $args = [])\n * @method \\Aws\\Result disableProactiveEngagement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableProactiveEngagementAsync(array $args = [])\n * @method \\Aws\\Result disassociateDRTLogBucket(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateDRTLogBucketAsync(array $args = [])\n * @method \\Aws\\Result disassociateDRTRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateDRTRoleAsync(array $args = [])\n * @method \\Aws\\Result disassociateHealthCheck(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateHealthCheckAsync(array $args = [])\n * @method \\Aws\\Result enableApplicationLayerAutomaticResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableApplicationLayerAutomaticResponseAsync(array $args = [])\n * @method \\Aws\\Result enableProactiveEngagement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise enableProactiveEngagementAsync(array $args = [])\n * @method \\Aws\\Result getSubscriptionState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSubscriptionStateAsync(array $args = [])\n * @method \\Aws\\Result listAttacks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAttacksAsync(array $args = [])\n * @method \\Aws\\Result listProtectionGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProtectionGroupsAsync(array $args = [])\n * @method \\Aws\\Result listProtections(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProtectionsAsync(array $args = [])\n * @method \\Aws\\Result listResourcesInProtectionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourcesInProtectionGroupAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApplicationLayerAutomaticResponse(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationLayerAutomaticResponseAsync(array $args = [])\n * @method \\Aws\\Result updateEmergencyContactSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateEmergencyContactSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateProtectionGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProtectionGroupAsync(array $args = [])\n * @method \\Aws\\Result updateSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSubscriptionAsync(array $args = [])\n */\nclass ShieldClient extends AwsClient {}\n", "num_lines": 82}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Shield\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Shield** service.\n */\nclass ShieldException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Signature;\n\nuse Aws\\Credentials\\CredentialsInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Provides anonymous client access (does not sign requests).\n */\nclass AnonymousSignature implements SignatureInterface\n{\n    /**\n     * /** {@inheritdoc}\n     */\n    public function signRequest(\n        RequestInterface $request,\n        CredentialsInterface $credentials\n    ) {\n        return $request;\n    }\n\n    /**\n     * /** {@inheritdoc}\n     */\n    public function presign(\n        RequestInterface $request,\n        CredentialsInterface $credentials,\n        $expires,\n        array $options = []\n    ) {\n        return $request;\n    }\n}\n", "num_lines": 34}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Signature;\n\nuse Aws\\Credentials\\CredentialsInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Amazon S3 signature version 4 support.\n */\nclass S3SignatureV4 extends SignatureV4\n{\n    /**\n     * S3-specific signing logic\n     *\n     * {@inheritdoc}\n     */\n    use SignatureTrait;\n\n    public function signRequest(\n        RequestInterface $request,\n        CredentialsInterface $credentials,\n        $signingService = null\n    ) {\n        // Always add a x-amz-content-sha-256 for data integrity\n        if (!$request->hasHeader('x-amz-content-sha256')) {\n            $request = $request->withHeader(\n                'x-amz-content-sha256',\n                $this->getPayload($request)\n            );\n        }\n        $useCrt =\n            strpos($request->getUri()->getHost(), \"accesspoint.s3-global\")\n            !== false;\n        if (!$useCrt) {\n            if (strpos($request->getUri()->getHost(), \"s3-object-lambda\")) {\n                return parent::signRequest($request, $credentials, \"s3-object-lambda\");\n            }\n            return parent::signRequest($request, $credentials);\n        }\n        $signingService = $signingService ?: 's3';\n        return $this->signWithV4a($credentials, $request, $signingService);\n    }\n\n    /**\n     * Always add a x-amz-content-sha-256 for data integrity.\n     *\n     * {@inheritdoc}\n     */\n    public function presign(\n        RequestInterface $request,\n        CredentialsInterface $credentials,\n        $expires,\n        array $options = []\n    ) {\n        if (!$request->hasHeader('x-amz-content-sha256')) {\n            $request = $request->withHeader(\n                'X-Amz-Content-Sha256',\n                $this->getPresignedPayload($request)\n            );\n        }\n        if (strpos($request->getUri()->getHost(), \"accesspoint.s3-global\")) {\n            $request = $request->withHeader(\"x-amz-region-set\", \"*\");\n        }\n\n        return parent::presign($request, $credentials, $expires, $options);\n    }\n\n    /**\n     * Override used to allow pre-signed URLs to be created for an\n     * in-determinate request payload.\n     */\n    protected function getPresignedPayload(RequestInterface $request)\n    {\n        return SignatureV4::UNSIGNED_PAYLOAD;\n    }\n\n    /**\n     * Amazon S3 does not double-encode the path component in the canonical request\n     */\n    protected function createCanonicalizedPath($path)\n    {\n        // Only remove one slash in case of keys that have a preceding slash\n        if (substr($path, 0, 1) === '/') {\n            $path = substr($path, 1);\n        }\n        return '/' . $path;\n    }\n}\n", "num_lines": 89}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Signature;\n\nuse Aws\\Credentials\\CredentialsInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Interface used to provide interchangeable strategies for signing requests\n * using the various AWS signature protocols.\n */\ninterface SignatureInterface\n{\n    /**\n     * Signs the specified request with an AWS signing protocol by using the\n     * provided AWS account credentials and adding the required headers to the\n     * request.\n     *\n     * @param RequestInterface     $request     Request to sign\n     * @param CredentialsInterface $credentials Signing credentials\n     *\n     * @return RequestInterface Returns the modified request.\n     */\n    public function signRequest(\n        RequestInterface $request,\n        CredentialsInterface $credentials\n    );\n\n    /**\n     * Create a pre-signed request.\n     *\n     * @param RequestInterface              $request     Request to sign\n     * @param CredentialsInterface          $credentials Credentials used to sign\n     * @param int|string|\\DateTimeInterface $expires The time at which the URL should\n     *     expire. This can be a Unix timestamp, a PHP DateTime object, or a\n     *     string that can be evaluated by strtotime.\n     *\n     * @return RequestInterface\n     */\n    public function presign(\n        RequestInterface $request,\n        CredentialsInterface $credentials,\n        $expires,\n        array $options = []\n    );\n}\n", "num_lines": 46}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Signature;\n\nuse Aws\\Exception\\UnresolvedSignatureException;\nuse Aws\\Token\\BearerTokenAuthorization;\n\n/**\n * Signature providers.\n *\n * A signature provider is a function that accepts a version, service, and\n * region and returns a {@see SignatureInterface} object on success or NULL if\n * no signature can be created from the provided arguments.\n *\n * You can wrap your calls to a signature provider with the\n * {@see SignatureProvider::resolve} function to ensure that a signature object\n * is created. If a signature object is not created, then the resolve()\n * function will throw a {@see Aws\\Exception\\UnresolvedSignatureException}.\n *\n *     use Aws\\Signature\\SignatureProvider;\n *     $provider = SignatureProvider::defaultProvider();\n *     // Returns a SignatureInterface or NULL.\n *     $signer = $provider('v4', 's3', 'us-west-2');\n *     // Returns a SignatureInterface or throws.\n *     $signer = SignatureProvider::resolve($provider, 'no', 's3', 'foo');\n *\n * You can compose multiple providers into a single provider using\n * {@see Aws\\or_chain}. This function accepts providers as arguments and\n * returns a new function that will invoke each provider until a non-null value\n * is returned.\n *\n *     $a = SignatureProvider::defaultProvider();\n *     $b = function ($version, $service, $region) {\n *         if ($version === 'foo') {\n *             return new MyFooSignature();\n *         }\n *     };\n *     $c = \\Aws\\or_chain($a, $b);\n *     $signer = $c('v4', 'abc', '123');     // $a handles this.\n *     $signer = $c('foo', 'abc', '123');    // $b handles this.\n *     $nullValue = $c('???', 'abc', '123'); // Neither can handle this.\n */\nclass SignatureProvider\n{\n    private static $s3v4SignedServices = [\n        's3' => true,\n        's3control' => true,\n        's3-object-lambda' => true,\n    ];\n\n    /**\n     * Resolves and signature provider and ensures a non-null return value.\n     *\n     * @param callable $provider Provider function to invoke.\n     * @param string   $version  Signature version.\n     * @param string   $service  Service name.\n     * @param string   $region   Region name.\n     *\n     * @return SignatureInterface\n     * @throws UnresolvedSignatureException\n     */\n    public static function resolve(callable $provider, $version, $service, $region)\n    {\n        $result = $provider($version, $service, $region);\n        if ($result instanceof SignatureInterface\n            || $result instanceof BearerTokenAuthorization\n        ) {\n            return $result;\n        }\n\n        throw new UnresolvedSignatureException(\n            \"Unable to resolve a signature for $version/$service/$region.\\n\"\n            . \"Valid signature versions include v4 and anonymous.\"\n        );\n    }\n\n    /**\n     * Default SDK signature provider.\n     *\n     * @return callable\n     */\n    public static function defaultProvider()\n    {\n        return self::memoize(self::version());\n    }\n\n    /**\n     * Creates a signature provider that caches previously created signature\n     * objects. The computed cache key is the concatenation of the version,\n     * service, and region.\n     *\n     * @param callable $provider Signature provider to wrap.\n     *\n     * @return callable\n     */\n    public static function memoize(callable $provider)\n    {\n        $cache = [];\n        return function ($version, $service, $region) use (&$cache, $provider) {\n            $key = \"($version)($service)($region)\";\n            if (!isset($cache[$key])) {\n                $cache[$key] = $provider($version, $service, $region);\n            }\n            return $cache[$key];\n        };\n    }\n\n    /**\n     * Creates signature objects from known signature versions.\n     *\n     * This provider currently recognizes the following signature versions:\n     *\n     * - v4: Signature version 4.\n     * - anonymous: Does not sign requests.\n     *\n     * @return callable\n     */\n    public static function version()\n    {\n        return function ($version, $service, $region) {\n            switch ($version) {\n                case 's3v4':\n                case 'v4':\n                    return !empty(self::$s3v4SignedServices[$service])\n                        ? new S3SignatureV4($service, $region)\n                        : new SignatureV4($service, $region);\n                case 'v4a':\n                    return !empty(self::$s3v4SignedServices[$service])\n                        ? new S3SignatureV4($service, $region, ['use_v4a' => true])\n                        : new SignatureV4($service, $region, ['use_v4a' => true]);\n                case 'v4-unsigned-body':\n                    return !empty(self::$s3v4SignedServices[$service])\n                    ? new S3SignatureV4($service, $region, ['unsigned-body' => 'true'])\n                    : new SignatureV4($service, $region, ['unsigned-body' => 'true']);\n                case 'bearer':\n                    return new BearerTokenAuthorization();\n                case 'anonymous':\n                    return new AnonymousSignature();\n                default:\n                    return null;\n            }\n        };\n    }\n}\n", "num_lines": 144}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Signature;\n\n/**\n * Provides signature calculation for SignatureV4.\n */\ntrait SignatureTrait\n{\n    /** @var array Cache of previously signed values */\n    private $cache = [];\n\n    /** @var int Size of the hash cache */\n    private $cacheSize = 0;\n    \n    private function createScope($shortDate, $region, $service)\n    {\n        return \"$shortDate/$region/$service/aws4_request\";\n    }\n\n    private function getSigningKey($shortDate, $region, $service, $secretKey)\n    {\n        $k = $shortDate . '_' . $region . '_' . $service . '_' . $secretKey;\n\n        if (!isset($this->cache[$k])) {\n            // Clear the cache when it reaches 50 entries\n            if (++$this->cacheSize > 50) {\n                $this->cache = [];\n                $this->cacheSize = 0;\n            }\n\n            $dateKey = hash_hmac(\n                'sha256',\n                $shortDate,\n                \"AWS4{$secretKey}\",\n                true\n            );\n            $regionKey = hash_hmac('sha256', $region, $dateKey, true);\n            $serviceKey = hash_hmac('sha256', $service, $regionKey, true);\n            $this->cache[$k] = hash_hmac(\n                'sha256',\n                'aws4_request',\n                $serviceKey,\n                true\n            );\n        }\n        return $this->cache[$k];\n    }\n}\n", "num_lines": 49}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Signature;\n\nuse Aws\\Credentials\\CredentialsInterface;\nuse AWS\\CRT\\Auth\\Signable;\nuse AWS\\CRT\\Auth\\SignatureType;\nuse AWS\\CRT\\Auth\\Signing;\nuse AWS\\CRT\\Auth\\SigningAlgorithm;\nuse AWS\\CRT\\Auth\\SigningConfigAWS;\nuse AWS\\CRT\\Auth\\StaticCredentialsProvider;\nuse AWS\\CRT\\HTTP\\Request;\nuse Aws\\Exception\\CommonRuntimeException;\nuse Aws\\Exception\\CouldNotCreateChecksumException;\nuse GuzzleHttp\\Psr7;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Signature Version 4\n * @link http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nclass SignatureV4 implements SignatureInterface\n{\n    use SignatureTrait;\n    const ISO8601_BASIC = 'Ymd\\THis\\Z';\n    const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD';\n    const AMZ_CONTENT_SHA256_HEADER = 'X-Amz-Content-Sha256';\n\n    /** @var string */\n    private $service;\n\n    /** @var string */\n    protected $region;\n\n    /** @var bool */\n    private $unsigned;\n\n    /** @var bool */\n    private $useV4a;\n\n    /**\n     * The following headers are not signed because signing these headers\n     * would potentially cause a signature mismatch when sending a request\n     * through a proxy or if modified at the HTTP client level.\n     *\n     * @return array\n     */\n    protected function getHeaderBlacklist()\n    {\n        return [\n            'cache-control'         => true,\n            'content-type'          => true,\n            'content-length'        => true,\n            'expect'                => true,\n            'max-forwards'          => true,\n            'pragma'                => true,\n            'range'                 => true,\n            'te'                    => true,\n            'if-match'              => true,\n            'if-none-match'         => true,\n            'if-modified-since'     => true,\n            'if-unmodified-since'   => true,\n            'if-range'              => true,\n            'accept'                => true,\n            'authorization'         => true,\n            'proxy-authorization'   => true,\n            'from'                  => true,\n            'referer'               => true,\n            'user-agent'            => true,\n            'X-Amz-User-Agent'      => true,\n            'x-amzn-trace-id'       => true,\n            'aws-sdk-invocation-id' => true,\n            'aws-sdk-retry'         => true,\n        ];\n    }\n\n    /**\n     * @param string $service Service name to use when signing\n     * @param string $region  Region name to use when signing\n     * @param array $options Array of configuration options used when signing\n     *      - unsigned-body: Flag to make request have unsigned payload.\n     *        Unsigned body is used primarily for streaming requests.\n     */\n    public function __construct($service, $region, array $options = [])\n    {\n        $this->service = $service;\n        $this->region = $region;\n        $this->unsigned = isset($options['unsigned-body']) ? $options['unsigned-body'] : false;\n        $this->useV4a = isset($options['use_v4a']) && $options['use_v4a'] === true;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function signRequest(\n        RequestInterface $request,\n        CredentialsInterface $credentials,\n        $signingService = null\n    ) {\n        $ldt = gmdate(self::ISO8601_BASIC);\n        $sdt = substr($ldt, 0, 8);\n        $parsed = $this->parseRequest($request);\n        $parsed['headers']['X-Amz-Date'] = [$ldt];\n\n        if ($token = $credentials->getSecurityToken()) {\n            $parsed['headers']['X-Amz-Security-Token'] = [$token];\n        }\n        $service = isset($signingService) ? $signingService : $this->service;\n\n        if ($this->useV4a) {\n            return $this->signWithV4a($credentials, $request, $service);\n        }\n\n        $cs = $this->createScope($sdt, $this->region, $service);\n        $payload = $this->getPayload($request);\n\n        if ($payload == self::UNSIGNED_PAYLOAD) {\n            $parsed['headers'][self::AMZ_CONTENT_SHA256_HEADER] = [$payload];\n        }\n\n        $context = $this->createContext($parsed, $payload);\n        $toSign = $this->createStringToSign($ldt, $cs, $context['creq']);\n        $signingKey = $this->getSigningKey(\n            $sdt,\n            $this->region,\n            $service,\n            $credentials->getSecretKey()\n        );\n        $signature = hash_hmac('sha256', $toSign, $signingKey);\n        $parsed['headers']['Authorization'] = [\n            \"AWS4-HMAC-SHA256 \"\n            . \"Credential={$credentials->getAccessKeyId()}/{$cs}, \"\n            . \"SignedHeaders={$context['headers']}, Signature={$signature}\"\n        ];\n\n        return $this->buildRequest($parsed);\n    }\n\n    /**\n     * Get the headers that were used to pre-sign the request.\n     * Used for the X-Amz-SignedHeaders header.\n     *\n     * @param array $headers\n     * @return array\n     */\n    private function getPresignHeaders(array $headers)\n    {\n        $presignHeaders = [];\n        $blacklist = $this->getHeaderBlacklist();\n        foreach ($headers as $name => $value) {\n            $lName = strtolower($name);\n            if (!isset($blacklist[$lName])\n                && $name !== self::AMZ_CONTENT_SHA256_HEADER\n            ) {\n                $presignHeaders[] = $lName;\n            }\n        }\n        return $presignHeaders;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function presign(\n        RequestInterface $request,\n        CredentialsInterface $credentials,\n        $expires,\n        array $options = []\n    ) {\n        $startTimestamp = isset($options['start_time'])\n            ? $this->convertToTimestamp($options['start_time'], null)\n            : time();\n        $expiresTimestamp = $this->convertToTimestamp($expires, $startTimestamp);\n\n        if ($this->useV4a) {\n            return $this->presignWithV4a(\n                $request,\n                $credentials,\n                $this->convertExpires($expiresTimestamp, $startTimestamp)\n            );\n        }\n\n        $parsed = $this->createPresignedRequest($request, $credentials);\n\n        $payload = $this->getPresignedPayload($request);\n        $httpDate = gmdate(self::ISO8601_BASIC, $startTimestamp);\n        $shortDate = substr($httpDate, 0, 8);\n        $scope = $this->createScope($shortDate, $this->region, $this->service);\n        $credential = $credentials->getAccessKeyId() . '/' . $scope;\n        if ($credentials->getSecurityToken()) {\n            unset($parsed['headers']['X-Amz-Security-Token']);\n        }\n        $parsed['query']['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256';\n        $parsed['query']['X-Amz-Credential'] = $credential;\n        $parsed['query']['X-Amz-Date'] = gmdate('Ymd\\THis\\Z', $startTimestamp);\n        $parsed['query']['X-Amz-SignedHeaders'] = implode(';', $this->getPresignHeaders($parsed['headers']));\n        $parsed['query']['X-Amz-Expires'] = $this->convertExpires($expiresTimestamp, $startTimestamp);\n        $context = $this->createContext($parsed, $payload);\n        $stringToSign = $this->createStringToSign($httpDate, $scope, $context['creq']);\n        $key = $this->getSigningKey(\n            $shortDate,\n            $this->region,\n            $this->service,\n            $credentials->getSecretKey()\n        );\n        $parsed['query']['X-Amz-Signature'] = hash_hmac('sha256', $stringToSign, $key);\n\n        return $this->buildRequest($parsed);\n    }\n\n    /**\n     * Converts a POST request to a GET request by moving POST fields into the\n     * query string.\n     *\n     * Useful for pre-signing query protocol requests.\n     *\n     * @param RequestInterface $request Request to clone\n     *\n     * @return RequestInterface\n     * @throws \\InvalidArgumentException if the method is not POST\n     */\n    public static function convertPostToGet(RequestInterface $request, $additionalQueryParams = \"\")\n    {\n        if ($request->getMethod() !== 'POST') {\n            throw new \\InvalidArgumentException('Expected a POST request but '\n                . 'received a ' . $request->getMethod() . ' request.');\n        }\n\n        $sr = $request->withMethod('GET')\n            ->withBody(Psr7\\Utils::streamFor(''))\n            ->withoutHeader('Content-Type')\n            ->withoutHeader('Content-Length');\n\n        // Move POST fields to the query if they are present\n        if ($request->getHeaderLine('Content-Type') === 'application/x-www-form-urlencoded') {\n            $body = (string) $request->getBody() . $additionalQueryParams;\n            $sr = $sr->withUri($sr->getUri()->withQuery($body));\n        }\n\n        return $sr;\n    }\n\n    protected function getPayload(RequestInterface $request)\n    {\n        if ($this->unsigned && $request->getUri()->getScheme() == 'https') {\n            return self::UNSIGNED_PAYLOAD;\n        }\n        // Calculate the request signature payload\n        if ($request->hasHeader(self::AMZ_CONTENT_SHA256_HEADER)) {\n            // Handle streaming operations (e.g. Glacier.UploadArchive)\n            return $request->getHeaderLine(self::AMZ_CONTENT_SHA256_HEADER);\n        }\n\n        if (!$request->getBody()->isSeekable()) {\n            throw new CouldNotCreateChecksumException('sha256');\n        }\n\n        try {\n            return Psr7\\Utils::hash($request->getBody(), 'sha256');\n        } catch (\\Exception $e) {\n            throw new CouldNotCreateChecksumException('sha256', $e);\n        }\n    }\n\n    protected function getPresignedPayload(RequestInterface $request)\n    {\n        return $this->getPayload($request);\n    }\n\n    protected function createCanonicalizedPath($path)\n    {\n        $doubleEncoded = rawurlencode(ltrim($path, '/'));\n\n        return '/' . str_replace('%2F', '/', $doubleEncoded);\n    }\n\n    private function createStringToSign($longDate, $credentialScope, $creq)\n    {\n        $hash = hash('sha256', $creq);\n\n        return \"AWS4-HMAC-SHA256\\n{$longDate}\\n{$credentialScope}\\n{$hash}\";\n    }\n\n    private function createPresignedRequest(\n        RequestInterface $request,\n        CredentialsInterface $credentials\n    ) {\n        $parsedRequest = $this->parseRequest($request);\n\n        // Make sure to handle temporary credentials\n        if ($token = $credentials->getSecurityToken()) {\n            $parsedRequest['headers']['X-Amz-Security-Token'] = [$token];\n        }\n\n        return $this->moveHeadersToQuery($parsedRequest);\n    }\n\n    /**\n     * @param array  $parsedRequest\n     * @param string $payload Hash of the request payload\n     * @return array Returns an array of context information\n     */\n    private function createContext(array $parsedRequest, $payload)\n    {\n        $blacklist = $this->getHeaderBlacklist();\n\n        // Normalize the path as required by SigV4\n        $canon = $parsedRequest['method'] . \"\\n\"\n            . $this->createCanonicalizedPath($parsedRequest['path']) . \"\\n\"\n            . $this->getCanonicalizedQuery($parsedRequest['query']) . \"\\n\";\n\n        // Case-insensitively aggregate all of the headers.\n        $aggregate = [];\n        foreach ($parsedRequest['headers'] as $key => $values) {\n            $key = strtolower($key);\n            if (!isset($blacklist[$key])) {\n                foreach ($values as $v) {\n                    $aggregate[$key][] = $v;\n                }\n            }\n        }\n\n        ksort($aggregate);\n        $canonHeaders = [];\n        foreach ($aggregate as $k => $v) {\n            if (count($v) > 0) {\n                sort($v);\n            }\n            $canonHeaders[] = $k . ':' . preg_replace('/\\s+/', ' ', implode(',', $v));\n        }\n\n        $signedHeadersString = implode(';', array_keys($aggregate));\n        $canon .= implode(\"\\n\", $canonHeaders) . \"\\n\\n\"\n            . $signedHeadersString . \"\\n\"\n            . $payload;\n\n        return ['creq' => $canon, 'headers' => $signedHeadersString];\n    }\n\n    private function getCanonicalizedQuery(array $query)\n    {\n        unset($query['X-Amz-Signature']);\n\n        if (!$query) {\n            return '';\n        }\n\n        $qs = '';\n        ksort($query);\n        foreach ($query as $k => $v) {\n            if (!is_array($v)) {\n                $qs .= rawurlencode($k) . '=' . rawurlencode($v !== null ? $v : '') . '&';\n            } else {\n                sort($v);\n                foreach ($v as $value) {\n                    $qs .= rawurlencode($k) . '=' . rawurlencode($value !== null ? $value : '') . '&';\n                }\n            }\n        }\n\n        return substr($qs, 0, -1);\n    }\n\n    private function convertToTimestamp($dateValue, $relativeTimeBase = null)\n    {\n        if ($dateValue instanceof \\DateTimeInterface) {\n            $timestamp = $dateValue->getTimestamp();\n        } elseif (!is_numeric($dateValue)) {\n            $timestamp = strtotime($dateValue,\n                $relativeTimeBase === null ? time() : $relativeTimeBase\n            );\n        } else {\n            $timestamp = $dateValue;\n        }\n\n        return $timestamp;\n    }\n\n    private function convertExpires($expiresTimestamp, $startTimestamp)\n    {\n        $duration = $expiresTimestamp - $startTimestamp;\n\n        // Ensure that the duration of the signature is not longer than a week\n        if ($duration > 604800) {\n            throw new \\InvalidArgumentException('The expiration date of a '\n                . 'signature version 4 presigned URL must be less than one '\n                . 'week');\n        }\n\n        return $duration;\n    }\n\n    private function moveHeadersToQuery(array $parsedRequest)\n    {\n        //x-amz-user-agent shouldn't be put in a query param\n        unset($parsedRequest['headers']['X-Amz-User-Agent']);\n\n        foreach ($parsedRequest['headers'] as $name => $header) {\n            $lname = strtolower($name);\n            if (substr($lname, 0, 5) == 'x-amz') {\n                $parsedRequest['query'][$name] = $header;\n            }\n            $blacklist = $this->getHeaderBlacklist();\n            if (isset($blacklist[$lname])\n                || $lname === strtolower(self::AMZ_CONTENT_SHA256_HEADER)\n            ) {\n                unset($parsedRequest['headers'][$name]);\n            }\n        }\n\n        return $parsedRequest;\n    }\n\n    private function parseRequest(RequestInterface $request)\n    {\n        // Clean up any previously set headers.\n        /** @var RequestInterface $request */\n        $request = $request\n            ->withoutHeader('X-Amz-Date')\n            ->withoutHeader('Date')\n            ->withoutHeader('Authorization');\n        $uri = $request->getUri();\n\n        return [\n            'method'  => $request->getMethod(),\n            'path'    => $uri->getPath(),\n            'query'   => Psr7\\Query::parse($uri->getQuery()),\n            'uri'     => $uri,\n            'headers' => $request->getHeaders(),\n            'body'    => $request->getBody(),\n            'version' => $request->getProtocolVersion()\n        ];\n    }\n\n    private function buildRequest(array $req)\n    {\n        if ($req['query']) {\n            $req['uri'] = $req['uri']->withQuery(Psr7\\Query::build($req['query']));\n        }\n\n        return new Psr7\\Request(\n            $req['method'],\n            $req['uri'],\n            $req['headers'],\n            $req['body'],\n            $req['version']\n        );\n    }\n\n    private function verifyCRTLoaded()\n    {\n        if (!extension_loaded('awscrt')) {\n            throw new CommonRuntimeException(\n                \"AWS Common Runtime for PHP is required to use Signature V4A\"\n                . \".  Please install it using the instructions found at\"\n                . \" https://github.com/aws/aws-sdk-php/blob/master/CRT_INSTRUCTIONS.md\"\n            );\n        }\n    }\n\n    private function createCRTStaticCredentialsProvider($credentials)\n    {\n        return new StaticCredentialsProvider([\n            'access_key_id' => $credentials->getAccessKeyId(),\n            'secret_access_key' => $credentials->getSecretKey(),\n            'session_token' => $credentials->getSecurityToken(),\n        ]);\n    }\n\n    private function removeIllegalV4aHeaders(&$request)\n    {\n        $illegalV4aHeaders = [\n            self::AMZ_CONTENT_SHA256_HEADER,\n            \"aws-sdk-invocation-id\",\n            \"aws-sdk-retry\",\n            'x-amz-region-set'\n        ];\n        $storedHeaders = [];\n\n        foreach ($illegalV4aHeaders as $header) {\n            if ($request->hasHeader($header)){\n                $storedHeaders[$header] = $request->getHeader($header);\n                $request = $request->withoutHeader($header);\n            }\n        }\n\n        return $storedHeaders;\n    }\n\n    private function CRTRequestFromGuzzleRequest($request)\n    {\n        return new Request(\n            $request->getMethod(),\n            (string) $request->getUri(),\n            [], //leave empty as the query is parsed from the uri object\n            array_map(function ($header) {return $header[0];}, $request->getHeaders())\n        );\n    }\n\n    /**\n     * @param CredentialsInterface $credentials\n     * @param RequestInterface $request\n     * @param $signingService\n     * @return RequestInterface\n     */\n    protected function signWithV4a(CredentialsInterface $credentials, RequestInterface $request, $signingService)\n    {\n        $this->verifyCRTLoaded();\n        $credentials_provider = $this->createCRTStaticCredentialsProvider($credentials);\n        $signingConfig = new SigningConfigAWS([\n            'algorithm' => SigningAlgorithm::SIGv4_ASYMMETRIC,\n            'signature_type' => SignatureType::HTTP_REQUEST_HEADERS,\n            'credentials_provider' => $credentials_provider,\n            'signed_body_value' => $this->getPayload($request),\n            'region' => \"*\",\n            'service' => $signingService,\n            'date' => time(),\n        ]);\n\n        $removedIllegalHeaders = $this->removeIllegalV4aHeaders($request);\n        $http_request = $this->CRTRequestFromGuzzleRequest($request);\n\n        Signing::signRequestAws(\n            Signable::fromHttpRequest($http_request),\n            $signingConfig, function ($signing_result, $error_code) use (&$http_request) {\n            $signing_result->applyToHttpRequest($http_request);\n        });\n        foreach ($removedIllegalHeaders as $header => $value) {\n            $request = $request->withHeader($header, $value);\n        }\n\n        $sigV4AHeaders = $http_request->headers();\n        foreach ($sigV4AHeaders->toArray() as $h => $v) {\n            $request = $request->withHeader($h, $v);\n        }\n\n        return $request;\n    }\n\n    protected function presignWithV4a(\n        RequestInterface $request,\n        CredentialsInterface $credentials,\n        $expires\n    )\n    {\n        $this->verifyCRTLoaded();\n        $credentials_provider = $this->createCRTStaticCredentialsProvider($credentials);\n        $signingConfig = new SigningConfigAWS([\n            'algorithm' => SigningAlgorithm::SIGv4_ASYMMETRIC,\n            'signature_type' => SignatureType::HTTP_REQUEST_QUERY_PARAMS,\n            'credentials_provider' => $credentials_provider,\n            'signed_body_value' => $this->getPresignedPayload($request),\n            'region' => \"*\",\n            'service' => $this->service,\n            'date' => time(),\n            'expiration_in_seconds' => $expires\n        ]);\n\n        $this->removeIllegalV4aHeaders($request);\n        foreach ($this->getHeaderBlacklist() as $headerName => $headerValue) {\n            if ($request->hasHeader($headerName)) {\n                $request = $request->withoutHeader($headerName);\n            }\n        }\n\n        $http_request = $this->CRTRequestFromGuzzleRequest($request);\n        Signing::signRequestAws(\n            Signable::fromHttpRequest($http_request),\n            $signingConfig, function ($signing_result, $error_code) use (&$http_request) {\n            $signing_result->applyToHttpRequest($http_request);\n        });\n\n        return $request->withUri(\n            new Psr7\\Uri($http_request->pathAndQuery())\n        );\n    }\n}\n", "num_lines": 577}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SimSpaceWeaver;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS SimSpace Weaver** service.\n * @method \\Aws\\Result createSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSnapshotAsync(array $args = [])\n * @method \\Aws\\Result deleteApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppAsync(array $args = [])\n * @method \\Aws\\Result deleteSimulation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSimulationAsync(array $args = [])\n * @method \\Aws\\Result describeApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAppAsync(array $args = [])\n * @method \\Aws\\Result describeSimulation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSimulationAsync(array $args = [])\n * @method \\Aws\\Result listApps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppsAsync(array $args = [])\n * @method \\Aws\\Result listSimulations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSimulationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startAppAsync(array $args = [])\n * @method \\Aws\\Result startClock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startClockAsync(array $args = [])\n * @method \\Aws\\Result startSimulation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSimulationAsync(array $args = [])\n * @method \\Aws\\Result stopApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopAppAsync(array $args = [])\n * @method \\Aws\\Result stopClock(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopClockAsync(array $args = [])\n * @method \\Aws\\Result stopSimulation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopSimulationAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass SimSpaceWeaverClient extends AwsClient {}\n", "num_lines": 42}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SimSpaceWeaver\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS SimSpace Weaver** service.\n */\nclass SimSpaceWeaverException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sms;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Server Migration Service** service.\n * @method \\Aws\\Result createApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAppAsync(array $args = [])\n * @method \\Aws\\Result createReplicationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReplicationJobAsync(array $args = [])\n * @method \\Aws\\Result deleteApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppAsync(array $args = [])\n * @method \\Aws\\Result deleteAppLaunchConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppLaunchConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteAppReplicationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppReplicationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteAppValidationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAppValidationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteReplicationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReplicationJobAsync(array $args = [])\n * @method \\Aws\\Result deleteServerCatalog(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServerCatalogAsync(array $args = [])\n * @method \\Aws\\Result disassociateConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateConnectorAsync(array $args = [])\n * @method \\Aws\\Result generateChangeSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateChangeSetAsync(array $args = [])\n * @method \\Aws\\Result generateTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateTemplateAsync(array $args = [])\n * @method \\Aws\\Result getApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppAsync(array $args = [])\n * @method \\Aws\\Result getAppLaunchConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppLaunchConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getAppReplicationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppReplicationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getAppValidationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppValidationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getAppValidationOutput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAppValidationOutputAsync(array $args = [])\n * @method \\Aws\\Result getConnectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConnectorsAsync(array $args = [])\n * @method \\Aws\\Result getReplicationJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReplicationJobsAsync(array $args = [])\n * @method \\Aws\\Result getReplicationRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReplicationRunsAsync(array $args = [])\n * @method \\Aws\\Result getServers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServersAsync(array $args = [])\n * @method \\Aws\\Result importAppCatalog(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importAppCatalogAsync(array $args = [])\n * @method \\Aws\\Result importServerCatalog(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importServerCatalogAsync(array $args = [])\n * @method \\Aws\\Result launchApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise launchAppAsync(array $args = [])\n * @method \\Aws\\Result listApps(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAppsAsync(array $args = [])\n * @method \\Aws\\Result notifyAppValidationOutput(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise notifyAppValidationOutputAsync(array $args = [])\n * @method \\Aws\\Result putAppLaunchConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAppLaunchConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putAppReplicationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAppReplicationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putAppValidationConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAppValidationConfigurationAsync(array $args = [])\n * @method \\Aws\\Result startAppReplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startAppReplicationAsync(array $args = [])\n * @method \\Aws\\Result startOnDemandAppReplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startOnDemandAppReplicationAsync(array $args = [])\n * @method \\Aws\\Result startOnDemandReplicationRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startOnDemandReplicationRunAsync(array $args = [])\n * @method \\Aws\\Result stopAppReplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopAppReplicationAsync(array $args = [])\n * @method \\Aws\\Result terminateApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise terminateAppAsync(array $args = [])\n * @method \\Aws\\Result updateApp(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAppAsync(array $args = [])\n * @method \\Aws\\Result updateReplicationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateReplicationJobAsync(array $args = [])\n */\nclass SmsClient extends AwsClient {}\n", "num_lines": 80}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sms\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Server Migration Service** service.\n */\nclass SmsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SnowBall;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Import/Export Snowball** service.\n * @method \\Aws\\Result cancelCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelClusterAsync(array $args = [])\n * @method \\Aws\\Result cancelJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelJobAsync(array $args = [])\n * @method \\Aws\\Result createAddress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAddressAsync(array $args = [])\n * @method \\Aws\\Result createCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createClusterAsync(array $args = [])\n * @method \\Aws\\Result createJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createJobAsync(array $args = [])\n * @method \\Aws\\Result createLongTermPricing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLongTermPricingAsync(array $args = [])\n * @method \\Aws\\Result createReturnShippingLabel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReturnShippingLabelAsync(array $args = [])\n * @method \\Aws\\Result describeAddress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAddressAsync(array $args = [])\n * @method \\Aws\\Result describeAddresses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAddressesAsync(array $args = [])\n * @method \\Aws\\Result describeCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClusterAsync(array $args = [])\n * @method \\Aws\\Result describeJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeJobAsync(array $args = [])\n * @method \\Aws\\Result describeReturnShippingLabel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeReturnShippingLabelAsync(array $args = [])\n * @method \\Aws\\Result getJobManifest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobManifestAsync(array $args = [])\n * @method \\Aws\\Result getJobUnlockCode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getJobUnlockCodeAsync(array $args = [])\n * @method \\Aws\\Result getSnowballUsage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSnowballUsageAsync(array $args = [])\n * @method \\Aws\\Result getSoftwareUpdates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSoftwareUpdatesAsync(array $args = [])\n * @method \\Aws\\Result listClusterJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listClusterJobsAsync(array $args = [])\n * @method \\Aws\\Result listClusters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listClustersAsync(array $args = [])\n * @method \\Aws\\Result listCompatibleImages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCompatibleImagesAsync(array $args = [])\n * @method \\Aws\\Result listJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listJobsAsync(array $args = [])\n * @method \\Aws\\Result listLongTermPricing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLongTermPricingAsync(array $args = [])\n * @method \\Aws\\Result listServiceVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServiceVersionsAsync(array $args = [])\n * @method \\Aws\\Result updateCluster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateClusterAsync(array $args = [])\n * @method \\Aws\\Result updateJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateJobAsync(array $args = [])\n * @method \\Aws\\Result updateJobShipmentState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateJobShipmentStateAsync(array $args = [])\n * @method \\Aws\\Result updateLongTermPricing(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLongTermPricingAsync(array $args = [])\n */\nclass SnowBallClient extends AwsClient {}\n", "num_lines": 62}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SnowBall\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Import/Export Snowball** service.\n */\nclass SnowBallException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SnowDeviceManagement;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Snow Device Management** service.\n * @method \\Aws\\Result cancelTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelTaskAsync(array $args = [])\n * @method \\Aws\\Result createTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTaskAsync(array $args = [])\n * @method \\Aws\\Result describeDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDeviceAsync(array $args = [])\n * @method \\Aws\\Result describeDeviceEc2Instances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDeviceEc2InstancesAsync(array $args = [])\n * @method \\Aws\\Result describeExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeExecutionAsync(array $args = [])\n * @method \\Aws\\Result describeTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTaskAsync(array $args = [])\n * @method \\Aws\\Result listDeviceResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeviceResourcesAsync(array $args = [])\n * @method \\Aws\\Result listDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDevicesAsync(array $args = [])\n * @method \\Aws\\Result listExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTasksAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass SnowDeviceManagementClient extends AwsClient {}\n", "num_lines": 36}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SnowDeviceManagement\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Snow Device Management** service.\n */\nclass SnowDeviceManagementException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sns;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Simple Notification Service (Amazon SNS)**.\n *\n * @method \\Aws\\Result addPermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addPermissionAsync(array $args = [])\n * @method \\Aws\\Result checkIfPhoneNumberIsOptedOut(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise checkIfPhoneNumberIsOptedOutAsync(array $args = [])\n * @method \\Aws\\Result confirmSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise confirmSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result createPlatformApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPlatformApplicationAsync(array $args = [])\n * @method \\Aws\\Result createPlatformEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPlatformEndpointAsync(array $args = [])\n * @method \\Aws\\Result createSMSSandboxPhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSMSSandboxPhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result createTopic(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTopicAsync(array $args = [])\n * @method \\Aws\\Result deleteEndpoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEndpointAsync(array $args = [])\n * @method \\Aws\\Result deletePlatformApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePlatformApplicationAsync(array $args = [])\n * @method \\Aws\\Result deleteSMSSandboxPhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSMSSandboxPhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result deleteTopic(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTopicAsync(array $args = [])\n * @method \\Aws\\Result getDataProtectionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDataProtectionPolicyAsync(array $args = [])\n * @method \\Aws\\Result getEndpointAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEndpointAttributesAsync(array $args = [])\n * @method \\Aws\\Result getPlatformApplicationAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPlatformApplicationAttributesAsync(array $args = [])\n * @method \\Aws\\Result getSMSAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSMSAttributesAsync(array $args = [])\n * @method \\Aws\\Result getSMSSandboxAccountStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSMSSandboxAccountStatusAsync(array $args = [])\n * @method \\Aws\\Result getSubscriptionAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSubscriptionAttributesAsync(array $args = [])\n * @method \\Aws\\Result getTopicAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTopicAttributesAsync(array $args = [])\n * @method \\Aws\\Result listEndpointsByPlatformApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEndpointsByPlatformApplicationAsync(array $args = [])\n * @method \\Aws\\Result listOriginationNumbers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOriginationNumbersAsync(array $args = [])\n * @method \\Aws\\Result listPhoneNumbersOptedOut(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPhoneNumbersOptedOutAsync(array $args = [])\n * @method \\Aws\\Result listPlatformApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPlatformApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listSMSSandboxPhoneNumbers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSMSSandboxPhoneNumbersAsync(array $args = [])\n * @method \\Aws\\Result listSubscriptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSubscriptionsAsync(array $args = [])\n * @method \\Aws\\Result listSubscriptionsByTopic(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSubscriptionsByTopicAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTopics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTopicsAsync(array $args = [])\n * @method \\Aws\\Result optInPhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise optInPhoneNumberAsync(array $args = [])\n * @method \\Aws\\Result publish(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise publishAsync(array $args = [])\n * @method \\Aws\\Result publishBatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise publishBatchAsync(array $args = [])\n * @method \\Aws\\Result putDataProtectionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putDataProtectionPolicyAsync(array $args = [])\n * @method \\Aws\\Result removePermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removePermissionAsync(array $args = [])\n * @method \\Aws\\Result setEndpointAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setEndpointAttributesAsync(array $args = [])\n * @method \\Aws\\Result setPlatformApplicationAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setPlatformApplicationAttributesAsync(array $args = [])\n * @method \\Aws\\Result setSMSAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setSMSAttributesAsync(array $args = [])\n * @method \\Aws\\Result setSubscriptionAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setSubscriptionAttributesAsync(array $args = [])\n * @method \\Aws\\Result setTopicAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setTopicAttributesAsync(array $args = [])\n * @method \\Aws\\Result subscribe(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise subscribeAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result unsubscribe(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unsubscribeAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result verifySMSSandboxPhoneNumber(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise verifySMSSandboxPhoneNumberAsync(array $args = [])\n */\nclass SnsClient extends AwsClient {}\n", "num_lines": 95}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sns\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon Simple Notification Service.\n */\nclass SnsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sqs;\n\nuse Aws\\AwsClient;\nuse Aws\\CommandInterface;\nuse Aws\\Sqs\\Exception\\SqsException;\nuse GuzzleHttp\\Psr7\\Uri;\nuse GuzzleHttp\\Psr7\\UriResolver;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Client used to interact Amazon Simple Queue Service (Amazon SQS)\n *\n * @method \\Aws\\Result addPermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addPermissionAsync(array $args = [])\n * @method \\Aws\\Result cancelMessageMoveTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelMessageMoveTaskAsync(array $args = [])\n * @method \\Aws\\Result changeMessageVisibility(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise changeMessageVisibilityAsync(array $args = [])\n * @method \\Aws\\Result changeMessageVisibilityBatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise changeMessageVisibilityBatchAsync(array $args = [])\n * @method \\Aws\\Result createQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createQueueAsync(array $args = [])\n * @method \\Aws\\Result deleteMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMessageAsync(array $args = [])\n * @method \\Aws\\Result deleteMessageBatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMessageBatchAsync(array $args = [])\n * @method \\Aws\\Result deleteQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteQueueAsync(array $args = [])\n * @method \\Aws\\Result getQueueAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getQueueAttributesAsync(array $args = [])\n * @method \\Aws\\Result getQueueUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getQueueUrlAsync(array $args = [])\n * @method \\Aws\\Result listDeadLetterSourceQueues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDeadLetterSourceQueuesAsync(array $args = [])\n * @method \\Aws\\Result listMessageMoveTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMessageMoveTasksAsync(array $args = [])\n * @method \\Aws\\Result listQueueTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listQueueTagsAsync(array $args = [])\n * @method \\Aws\\Result listQueues(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listQueuesAsync(array $args = [])\n * @method \\Aws\\Result purgeQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise purgeQueueAsync(array $args = [])\n * @method \\Aws\\Result receiveMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise receiveMessageAsync(array $args = [])\n * @method \\Aws\\Result removePermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removePermissionAsync(array $args = [])\n * @method \\Aws\\Result sendMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendMessageAsync(array $args = [])\n * @method \\Aws\\Result sendMessageBatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendMessageBatchAsync(array $args = [])\n * @method \\Aws\\Result setQueueAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setQueueAttributesAsync(array $args = [])\n * @method \\Aws\\Result startMessageMoveTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMessageMoveTaskAsync(array $args = [])\n * @method \\Aws\\Result tagQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagQueueAsync(array $args = [])\n * @method \\Aws\\Result untagQueue(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagQueueAsync(array $args = [])\n */\nclass SqsClient extends AwsClient\n{\n    public function __construct(array $config)\n    {\n        parent::__construct($config);\n        $list = $this->getHandlerList();\n        $list->appendBuild($this->queueUrl(), 'sqs.queue_url');\n        $list->appendSign($this->validateMd5(), 'sqs.md5');\n    }\n\n    /**\n     * Converts a queue URL into a queue ARN.\n     *\n     * @param string $queueUrl The queue URL to perform the action on.\n     *                         Retrieved when the queue is first created.\n     *\n     * @return string An ARN representation of the queue URL.\n     */\n    public function getQueueArn($queueUrl)\n    {\n        $queueArn = strtr($queueUrl, [\n            'http://'        => 'arn:aws:',\n            'https://'       => 'arn:aws:',\n            '.amazonaws.com' => '',\n            '/'              => ':',\n            '.'              => ':',\n        ]);\n\n        // Cope with SQS' .fifo / :fifo arn inconsistency\n        if (substr($queueArn, -5) === ':fifo') {\n            $queueArn = substr_replace($queueArn, '.fifo', -5);\n        }\n        return $queueArn;\n    }\n\n    /**\n     * Moves the URI of the queue to the URI in the input parameter.\n     *\n     * @return callable\n     */\n    private function queueUrl()\n    {\n        return static function (callable $handler) {\n            return function (\n                CommandInterface $c,\n                RequestInterface $r = null\n            ) use ($handler) {\n                if ($c->hasParam('QueueUrl')) {\n                    $r = $r->withUri(UriResolver::resolve(\n                        $r->getUri(),\n                        new Uri($c['QueueUrl'])\n                    ));\n                }\n                return $handler($c, $r);\n            };\n        };\n    }\n\n    /**\n     * Calculates the expected md5 hash of message attributes according to the encoding\n     * scheme detailed in SQS documentation.\n     *\n     * @param array $message Message containing attributes for validation.\n     *                       Retrieved when using MessageAttributeNames on\n     *                       ReceiveMessage.\n     *\n     * @return string|null The md5 hash of the message attributes according to\n     *                     the encoding scheme. Returns null when there are no\n     *                     attributes.\n     * @link http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html#message-attributes-items-validation\n     */\n    private static function calculateMessageAttributesMd5($message)\n    {\n        if (empty($message['MessageAttributes'])\n            || !is_array($message['MessageAttributes'])\n        ) {\n            return null;\n        }\n\n        ksort($message['MessageAttributes']);\n        $attributeValues = \"\";\n        foreach ($message['MessageAttributes'] as $name => $details) {\n            $attributeValues .= self::getEncodedStringPiece($name);\n            $attributeValues .= self::getEncodedStringPiece($details['DataType']);\n            if (substr($details['DataType'], 0, 6) === 'Binary') {\n                $attributeValues .= pack('c', 0x02);\n                $attributeValues .= self::getEncodedBinaryPiece(\n                    $details['BinaryValue']\n                );\n            } else {\n                $attributeValues .= pack('c', 0x01);\n                $attributeValues .= self::getEncodedStringPiece(\n                    $details['StringValue']\n                );\n            }\n        }\n\n        return md5($attributeValues);\n    }\n\n    private static function calculateBodyMd5($message)\n    {\n        return md5($message['Body']);\n    }\n\n    private static function getEncodedStringPiece($piece)\n    {\n        $utf8Piece = iconv(\n            mb_detect_encoding($piece, mb_detect_order(), true),\n            \"UTF-8\",\n            $piece\n        );\n        return self::getFourBytePieceLength($utf8Piece) . $utf8Piece;\n    }\n\n    private static function getEncodedBinaryPiece($piece)\n    {\n        return self::getFourBytePieceLength($piece) . $piece;\n    }\n\n    private static function getFourBytePieceLength($piece)\n    {\n        return pack('N', (int)strlen($piece));\n    }\n\n    /**\n     * Validates ReceiveMessage body and message attribute MD5s.\n     *\n     * @return callable\n     */\n    private function validateMd5()\n    {\n        return static function (callable $handler) {\n            return function (\n                CommandInterface $c,\n                RequestInterface $r = null\n            ) use ($handler) {\n                if ($c->getName() !== 'ReceiveMessage') {\n                    return $handler($c, $r);\n                }\n\n                return $handler($c, $r)\n                    ->then(\n                        function ($result) use ($c, $r) {\n                            foreach ((array) $result['Messages'] as $msg) {\n                                $bodyMd5 = self::calculateBodyMd5($msg);\n                                if (isset($msg['MD5OfBody'])\n                                    && $bodyMd5 !== $msg['MD5OfBody']\n                                ) {\n                                    throw new SqsException(\n                                        sprintf(\n                                            'MD5 mismatch. Expected %s, found %s',\n                                            $msg['MD5OfBody'],\n                                            $bodyMd5\n                                        ),\n                                        $c,\n                                        [\n                                            'code' => 'ClientChecksumMismatch',\n                                            'request' => $r\n                                        ]\n                                    );\n                                }\n\n                                if (isset($msg['MD5OfMessageAttributes'])) {\n                                    $messageAttributesMd5 = self::calculateMessageAttributesMd5($msg);\n                                    if ($messageAttributesMd5 !== $msg['MD5OfMessageAttributes']) {\n                                        throw new SqsException(\n                                            sprintf(\n                                                'Attribute MD5 mismatch. Expected %s, found %s',\n                                                $msg['MD5OfMessageAttributes'],\n                                                $messageAttributesMd5\n                                                    ? $messageAttributesMd5\n                                                    : 'No Attributes'\n                                            ),\n                                            $c,\n                                            [\n                                                'code' => 'ClientChecksumMismatch',\n                                                'request' => $r\n                                            ]\n                                        );\n                                    }\n                                } else if (isset($msg['MessageAttributes'])) {\n                                    throw new SqsException(\n                                        sprintf(\n                                            'No Attribute MD5 found. Expected %s',\n                                            self::calculateMessageAttributesMd5($msg)\n                                        ),\n                                        $c,\n                                        [\n                                            'code' => 'ClientChecksumMismatch',\n                                            'request' => $r\n                                        ]\n                                    );\n                                }\n                            }\n                            return $result;\n                        }\n                    );\n            };\n        };\n    }\n}\n", "num_lines": 263}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sqs\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon Simple Queue Service.\n */\nclass SqsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Ssm;\n\nuse Aws\\AwsClient;\n\n/**\n * Amazon EC2 Simple Systems Manager client.\n *\n * @method \\Aws\\Result addTagsToResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsToResourceAsync(array $args = [])\n * @method \\Aws\\Result associateOpsItemRelatedItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateOpsItemRelatedItemAsync(array $args = [])\n * @method \\Aws\\Result cancelCommand(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelCommandAsync(array $args = [])\n * @method \\Aws\\Result cancelMaintenanceWindowExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelMaintenanceWindowExecutionAsync(array $args = [])\n * @method \\Aws\\Result createActivation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createActivationAsync(array $args = [])\n * @method \\Aws\\Result createAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAssociationAsync(array $args = [])\n * @method \\Aws\\Result createAssociationBatch(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAssociationBatchAsync(array $args = [])\n * @method \\Aws\\Result createDocument(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDocumentAsync(array $args = [])\n * @method \\Aws\\Result createMaintenanceWindow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMaintenanceWindowAsync(array $args = [])\n * @method \\Aws\\Result createOpsItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createOpsItemAsync(array $args = [])\n * @method \\Aws\\Result createOpsMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createOpsMetadataAsync(array $args = [])\n * @method \\Aws\\Result createPatchBaseline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPatchBaselineAsync(array $args = [])\n * @method \\Aws\\Result createResourceDataSync(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResourceDataSyncAsync(array $args = [])\n * @method \\Aws\\Result deleteActivation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteActivationAsync(array $args = [])\n * @method \\Aws\\Result deleteAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAssociationAsync(array $args = [])\n * @method \\Aws\\Result deleteDocument(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDocumentAsync(array $args = [])\n * @method \\Aws\\Result deleteInventory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInventoryAsync(array $args = [])\n * @method \\Aws\\Result deleteMaintenanceWindow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMaintenanceWindowAsync(array $args = [])\n * @method \\Aws\\Result deleteOpsMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOpsMetadataAsync(array $args = [])\n * @method \\Aws\\Result deleteParameter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteParameterAsync(array $args = [])\n * @method \\Aws\\Result deleteParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteParametersAsync(array $args = [])\n * @method \\Aws\\Result deletePatchBaseline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePatchBaselineAsync(array $args = [])\n * @method \\Aws\\Result deleteResourceDataSync(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourceDataSyncAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result deregisterManagedInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterManagedInstanceAsync(array $args = [])\n * @method \\Aws\\Result deregisterPatchBaselineForPatchGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterPatchBaselineForPatchGroupAsync(array $args = [])\n * @method \\Aws\\Result deregisterTargetFromMaintenanceWindow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterTargetFromMaintenanceWindowAsync(array $args = [])\n * @method \\Aws\\Result deregisterTaskFromMaintenanceWindow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterTaskFromMaintenanceWindowAsync(array $args = [])\n * @method \\Aws\\Result describeActivations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeActivationsAsync(array $args = [])\n * @method \\Aws\\Result describeAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAssociationAsync(array $args = [])\n * @method \\Aws\\Result describeAssociationExecutionTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAssociationExecutionTargetsAsync(array $args = [])\n * @method \\Aws\\Result describeAssociationExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAssociationExecutionsAsync(array $args = [])\n * @method \\Aws\\Result describeAutomationExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAutomationExecutionsAsync(array $args = [])\n * @method \\Aws\\Result describeAutomationStepExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAutomationStepExecutionsAsync(array $args = [])\n * @method \\Aws\\Result describeAvailablePatches(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAvailablePatchesAsync(array $args = [])\n * @method \\Aws\\Result describeDocument(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDocumentAsync(array $args = [])\n * @method \\Aws\\Result describeDocumentPermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDocumentPermissionAsync(array $args = [])\n * @method \\Aws\\Result describeEffectiveInstanceAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEffectiveInstanceAssociationsAsync(array $args = [])\n * @method \\Aws\\Result describeEffectivePatchesForPatchBaseline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEffectivePatchesForPatchBaselineAsync(array $args = [])\n * @method \\Aws\\Result describeInstanceAssociationsStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceAssociationsStatusAsync(array $args = [])\n * @method \\Aws\\Result describeInstanceInformation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceInformationAsync(array $args = [])\n * @method \\Aws\\Result describeInstancePatchStates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstancePatchStatesAsync(array $args = [])\n * @method \\Aws\\Result describeInstancePatchStatesForPatchGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstancePatchStatesForPatchGroupAsync(array $args = [])\n * @method \\Aws\\Result describeInstancePatches(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstancePatchesAsync(array $args = [])\n * @method \\Aws\\Result describeInventoryDeletions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInventoryDeletionsAsync(array $args = [])\n * @method \\Aws\\Result describeMaintenanceWindowExecutionTaskInvocations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMaintenanceWindowExecutionTaskInvocationsAsync(array $args = [])\n * @method \\Aws\\Result describeMaintenanceWindowExecutionTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMaintenanceWindowExecutionTasksAsync(array $args = [])\n * @method \\Aws\\Result describeMaintenanceWindowExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMaintenanceWindowExecutionsAsync(array $args = [])\n * @method \\Aws\\Result describeMaintenanceWindowSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMaintenanceWindowScheduleAsync(array $args = [])\n * @method \\Aws\\Result describeMaintenanceWindowTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMaintenanceWindowTargetsAsync(array $args = [])\n * @method \\Aws\\Result describeMaintenanceWindowTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMaintenanceWindowTasksAsync(array $args = [])\n * @method \\Aws\\Result describeMaintenanceWindows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMaintenanceWindowsAsync(array $args = [])\n * @method \\Aws\\Result describeMaintenanceWindowsForTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMaintenanceWindowsForTargetAsync(array $args = [])\n * @method \\Aws\\Result describeOpsItems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOpsItemsAsync(array $args = [])\n * @method \\Aws\\Result describeParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeParametersAsync(array $args = [])\n * @method \\Aws\\Result describePatchBaselines(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePatchBaselinesAsync(array $args = [])\n * @method \\Aws\\Result describePatchGroupState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePatchGroupStateAsync(array $args = [])\n * @method \\Aws\\Result describePatchGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePatchGroupsAsync(array $args = [])\n * @method \\Aws\\Result describePatchProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePatchPropertiesAsync(array $args = [])\n * @method \\Aws\\Result describeSessions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSessionsAsync(array $args = [])\n * @method \\Aws\\Result disassociateOpsItemRelatedItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateOpsItemRelatedItemAsync(array $args = [])\n * @method \\Aws\\Result getAutomationExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAutomationExecutionAsync(array $args = [])\n * @method \\Aws\\Result getCalendarState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCalendarStateAsync(array $args = [])\n * @method \\Aws\\Result getCommandInvocation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCommandInvocationAsync(array $args = [])\n * @method \\Aws\\Result getConnectionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConnectionStatusAsync(array $args = [])\n * @method \\Aws\\Result getDefaultPatchBaseline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDefaultPatchBaselineAsync(array $args = [])\n * @method \\Aws\\Result getDeployablePatchSnapshotForInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDeployablePatchSnapshotForInstanceAsync(array $args = [])\n * @method \\Aws\\Result getDocument(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDocumentAsync(array $args = [])\n * @method \\Aws\\Result getInventory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInventoryAsync(array $args = [])\n * @method \\Aws\\Result getInventorySchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInventorySchemaAsync(array $args = [])\n * @method \\Aws\\Result getMaintenanceWindow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMaintenanceWindowAsync(array $args = [])\n * @method \\Aws\\Result getMaintenanceWindowExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMaintenanceWindowExecutionAsync(array $args = [])\n * @method \\Aws\\Result getMaintenanceWindowExecutionTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMaintenanceWindowExecutionTaskAsync(array $args = [])\n * @method \\Aws\\Result getMaintenanceWindowExecutionTaskInvocation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMaintenanceWindowExecutionTaskInvocationAsync(array $args = [])\n * @method \\Aws\\Result getMaintenanceWindowTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMaintenanceWindowTaskAsync(array $args = [])\n * @method \\Aws\\Result getOpsItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOpsItemAsync(array $args = [])\n * @method \\Aws\\Result getOpsMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOpsMetadataAsync(array $args = [])\n * @method \\Aws\\Result getOpsSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOpsSummaryAsync(array $args = [])\n * @method \\Aws\\Result getParameter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getParameterAsync(array $args = [])\n * @method \\Aws\\Result getParameterHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getParameterHistoryAsync(array $args = [])\n * @method \\Aws\\Result getParameters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getParametersAsync(array $args = [])\n * @method \\Aws\\Result getParametersByPath(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getParametersByPathAsync(array $args = [])\n * @method \\Aws\\Result getPatchBaseline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPatchBaselineAsync(array $args = [])\n * @method \\Aws\\Result getPatchBaselineForPatchGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPatchBaselineForPatchGroupAsync(array $args = [])\n * @method \\Aws\\Result getResourcePolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcePoliciesAsync(array $args = [])\n * @method \\Aws\\Result getServiceSetting(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceSettingAsync(array $args = [])\n * @method \\Aws\\Result labelParameterVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise labelParameterVersionAsync(array $args = [])\n * @method \\Aws\\Result listAssociationVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssociationVersionsAsync(array $args = [])\n * @method \\Aws\\Result listAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listCommandInvocations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCommandInvocationsAsync(array $args = [])\n * @method \\Aws\\Result listCommands(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCommandsAsync(array $args = [])\n * @method \\Aws\\Result listComplianceItems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listComplianceItemsAsync(array $args = [])\n * @method \\Aws\\Result listComplianceSummaries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listComplianceSummariesAsync(array $args = [])\n * @method \\Aws\\Result listDocumentMetadataHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDocumentMetadataHistoryAsync(array $args = [])\n * @method \\Aws\\Result listDocumentVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDocumentVersionsAsync(array $args = [])\n * @method \\Aws\\Result listDocuments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDocumentsAsync(array $args = [])\n * @method \\Aws\\Result listInventoryEntries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInventoryEntriesAsync(array $args = [])\n * @method \\Aws\\Result listOpsItemEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOpsItemEventsAsync(array $args = [])\n * @method \\Aws\\Result listOpsItemRelatedItems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOpsItemRelatedItemsAsync(array $args = [])\n * @method \\Aws\\Result listOpsMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOpsMetadataAsync(array $args = [])\n * @method \\Aws\\Result listResourceComplianceSummaries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceComplianceSummariesAsync(array $args = [])\n * @method \\Aws\\Result listResourceDataSync(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceDataSyncAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result modifyDocumentPermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyDocumentPermissionAsync(array $args = [])\n * @method \\Aws\\Result putComplianceItems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putComplianceItemsAsync(array $args = [])\n * @method \\Aws\\Result putInventory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putInventoryAsync(array $args = [])\n * @method \\Aws\\Result putParameter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putParameterAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result registerDefaultPatchBaseline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerDefaultPatchBaselineAsync(array $args = [])\n * @method \\Aws\\Result registerPatchBaselineForPatchGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerPatchBaselineForPatchGroupAsync(array $args = [])\n * @method \\Aws\\Result registerTargetWithMaintenanceWindow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerTargetWithMaintenanceWindowAsync(array $args = [])\n * @method \\Aws\\Result registerTaskWithMaintenanceWindow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerTaskWithMaintenanceWindowAsync(array $args = [])\n * @method \\Aws\\Result removeTagsFromResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsFromResourceAsync(array $args = [])\n * @method \\Aws\\Result resetServiceSetting(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetServiceSettingAsync(array $args = [])\n * @method \\Aws\\Result resumeSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resumeSessionAsync(array $args = [])\n * @method \\Aws\\Result sendAutomationSignal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendAutomationSignalAsync(array $args = [])\n * @method \\Aws\\Result sendCommand(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendCommandAsync(array $args = [])\n * @method \\Aws\\Result startAssociationsOnce(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startAssociationsOnceAsync(array $args = [])\n * @method \\Aws\\Result startAutomationExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startAutomationExecutionAsync(array $args = [])\n * @method \\Aws\\Result startChangeRequestExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startChangeRequestExecutionAsync(array $args = [])\n * @method \\Aws\\Result startSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSessionAsync(array $args = [])\n * @method \\Aws\\Result stopAutomationExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopAutomationExecutionAsync(array $args = [])\n * @method \\Aws\\Result terminateSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise terminateSessionAsync(array $args = [])\n * @method \\Aws\\Result unlabelParameterVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise unlabelParameterVersionAsync(array $args = [])\n * @method \\Aws\\Result updateAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAssociationAsync(array $args = [])\n * @method \\Aws\\Result updateAssociationStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAssociationStatusAsync(array $args = [])\n * @method \\Aws\\Result updateDocument(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDocumentAsync(array $args = [])\n * @method \\Aws\\Result updateDocumentDefaultVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDocumentDefaultVersionAsync(array $args = [])\n * @method \\Aws\\Result updateDocumentMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDocumentMetadataAsync(array $args = [])\n * @method \\Aws\\Result updateMaintenanceWindow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMaintenanceWindowAsync(array $args = [])\n * @method \\Aws\\Result updateMaintenanceWindowTarget(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMaintenanceWindowTargetAsync(array $args = [])\n * @method \\Aws\\Result updateMaintenanceWindowTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMaintenanceWindowTaskAsync(array $args = [])\n * @method \\Aws\\Result updateManagedInstanceRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateManagedInstanceRoleAsync(array $args = [])\n * @method \\Aws\\Result updateOpsItem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateOpsItemAsync(array $args = [])\n * @method \\Aws\\Result updateOpsMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateOpsMetadataAsync(array $args = [])\n * @method \\Aws\\Result updatePatchBaseline(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePatchBaselineAsync(array $args = [])\n * @method \\Aws\\Result updateResourceDataSync(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResourceDataSyncAsync(array $args = [])\n * @method \\Aws\\Result updateServiceSetting(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceSettingAsync(array $args = [])\n */\nclass SsmClient extends AwsClient {}\n", "num_lines": 287}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Ssm\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Amazon EC2 Simple Systems Manager exception.\n */\nclass SsmException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SSMContacts;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Systems Manager Incident Manager Contacts** service.\n * @method \\Aws\\Result acceptPage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise acceptPageAsync(array $args = [])\n * @method \\Aws\\Result activateContactChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise activateContactChannelAsync(array $args = [])\n * @method \\Aws\\Result createContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createContactAsync(array $args = [])\n * @method \\Aws\\Result createContactChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createContactChannelAsync(array $args = [])\n * @method \\Aws\\Result createRotation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRotationAsync(array $args = [])\n * @method \\Aws\\Result createRotationOverride(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRotationOverrideAsync(array $args = [])\n * @method \\Aws\\Result deactivateContactChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deactivateContactChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteContactAsync(array $args = [])\n * @method \\Aws\\Result deleteContactChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteContactChannelAsync(array $args = [])\n * @method \\Aws\\Result deleteRotation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRotationAsync(array $args = [])\n * @method \\Aws\\Result deleteRotationOverride(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRotationOverrideAsync(array $args = [])\n * @method \\Aws\\Result describeEngagement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEngagementAsync(array $args = [])\n * @method \\Aws\\Result describePage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePageAsync(array $args = [])\n * @method \\Aws\\Result getContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContactAsync(array $args = [])\n * @method \\Aws\\Result getContactChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContactChannelAsync(array $args = [])\n * @method \\Aws\\Result getContactPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getContactPolicyAsync(array $args = [])\n * @method \\Aws\\Result getRotation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRotationAsync(array $args = [])\n * @method \\Aws\\Result getRotationOverride(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRotationOverrideAsync(array $args = [])\n * @method \\Aws\\Result listContactChannels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listContactChannelsAsync(array $args = [])\n * @method \\Aws\\Result listContacts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listContactsAsync(array $args = [])\n * @method \\Aws\\Result listEngagements(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listEngagementsAsync(array $args = [])\n * @method \\Aws\\Result listPageReceipts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPageReceiptsAsync(array $args = [])\n * @method \\Aws\\Result listPageResolutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPageResolutionsAsync(array $args = [])\n * @method \\Aws\\Result listPagesByContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPagesByContactAsync(array $args = [])\n * @method \\Aws\\Result listPagesByEngagement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPagesByEngagementAsync(array $args = [])\n * @method \\Aws\\Result listPreviewRotationShifts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPreviewRotationShiftsAsync(array $args = [])\n * @method \\Aws\\Result listRotationOverrides(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRotationOverridesAsync(array $args = [])\n * @method \\Aws\\Result listRotationShifts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRotationShiftsAsync(array $args = [])\n * @method \\Aws\\Result listRotations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRotationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putContactPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putContactPolicyAsync(array $args = [])\n * @method \\Aws\\Result sendActivationCode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendActivationCodeAsync(array $args = [])\n * @method \\Aws\\Result startEngagement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startEngagementAsync(array $args = [])\n * @method \\Aws\\Result stopEngagement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopEngagementAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateContact(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContactAsync(array $args = [])\n * @method \\Aws\\Result updateContactChannel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateContactChannelAsync(array $args = [])\n * @method \\Aws\\Result updateRotation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRotationAsync(array $args = [])\n */\nclass SSMContactsClient extends AwsClient {}\n", "num_lines": 88}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SSMContacts\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Systems Manager Incident Manager Contacts** service.\n */\nclass SSMContactsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SSMIncidents;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Systems Manager Incident Manager** service.\n * @method \\Aws\\Result createReplicationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createReplicationSetAsync(array $args = [])\n * @method \\Aws\\Result createResponsePlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResponsePlanAsync(array $args = [])\n * @method \\Aws\\Result createTimelineEvent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTimelineEventAsync(array $args = [])\n * @method \\Aws\\Result deleteIncidentRecord(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIncidentRecordAsync(array $args = [])\n * @method \\Aws\\Result deleteReplicationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteReplicationSetAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteResponsePlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResponsePlanAsync(array $args = [])\n * @method \\Aws\\Result deleteTimelineEvent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTimelineEventAsync(array $args = [])\n * @method \\Aws\\Result getIncidentRecord(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIncidentRecordAsync(array $args = [])\n * @method \\Aws\\Result getReplicationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getReplicationSetAsync(array $args = [])\n * @method \\Aws\\Result getResourcePolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcePoliciesAsync(array $args = [])\n * @method \\Aws\\Result getResponsePlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResponsePlanAsync(array $args = [])\n * @method \\Aws\\Result getTimelineEvent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTimelineEventAsync(array $args = [])\n * @method \\Aws\\Result listIncidentRecords(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIncidentRecordsAsync(array $args = [])\n * @method \\Aws\\Result listRelatedItems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRelatedItemsAsync(array $args = [])\n * @method \\Aws\\Result listReplicationSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listReplicationSetsAsync(array $args = [])\n * @method \\Aws\\Result listResponsePlans(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResponsePlansAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTimelineEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTimelineEventsAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result startIncident(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startIncidentAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDeletionProtection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDeletionProtectionAsync(array $args = [])\n * @method \\Aws\\Result updateIncidentRecord(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIncidentRecordAsync(array $args = [])\n * @method \\Aws\\Result updateRelatedItems(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRelatedItemsAsync(array $args = [])\n * @method \\Aws\\Result updateReplicationSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateReplicationSetAsync(array $args = [])\n * @method \\Aws\\Result updateResponsePlan(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResponsePlanAsync(array $args = [])\n * @method \\Aws\\Result updateTimelineEvent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTimelineEventAsync(array $args = [])\n */\nclass SSMIncidentsClient extends AwsClient {}\n", "num_lines": 68}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SSMIncidents\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Systems Manager Incident Manager** service.\n */\nclass SSMIncidentsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SsmSap;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Systems Manager for SAP** service.\n * @method \\Aws\\Result deleteResourcePermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePermissionAsync(array $args = [])\n * @method \\Aws\\Result deregisterApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterApplicationAsync(array $args = [])\n * @method \\Aws\\Result getApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getApplicationAsync(array $args = [])\n * @method \\Aws\\Result getComponent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getComponentAsync(array $args = [])\n * @method \\Aws\\Result getDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDatabaseAsync(array $args = [])\n * @method \\Aws\\Result getOperation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getOperationAsync(array $args = [])\n * @method \\Aws\\Result getResourcePermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcePermissionAsync(array $args = [])\n * @method \\Aws\\Result listApplications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listApplicationsAsync(array $args = [])\n * @method \\Aws\\Result listComponents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listComponentsAsync(array $args = [])\n * @method \\Aws\\Result listDatabases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatabasesAsync(array $args = [])\n * @method \\Aws\\Result listOperations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOperationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putResourcePermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePermissionAsync(array $args = [])\n * @method \\Aws\\Result registerApplication(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerApplicationAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateApplicationSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateApplicationSettingsAsync(array $args = [])\n */\nclass SsmSapClient extends AwsClient {}\n", "num_lines": 44}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SsmSap\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Systems Manager for SAP** service.\n */\nclass SsmSapException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SSO;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Single Sign-On** service.\n * @method \\Aws\\Result getRoleCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRoleCredentialsAsync(array $args = [])\n * @method \\Aws\\Result listAccountRoles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccountRolesAsync(array $args = [])\n * @method \\Aws\\Result listAccounts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccountsAsync(array $args = [])\n * @method \\Aws\\Result logout(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise logoutAsync(array $args = [])\n */\nclass SSOClient extends AwsClient {}\n", "num_lines": 18}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SSO\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Single Sign-On** service.\n */\nclass SSOException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SSOAdmin;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Single Sign-On Admin** service.\n * @method \\Aws\\Result attachCustomerManagedPolicyReferenceToPermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachCustomerManagedPolicyReferenceToPermissionSetAsync(array $args = [])\n * @method \\Aws\\Result attachManagedPolicyToPermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachManagedPolicyToPermissionSetAsync(array $args = [])\n * @method \\Aws\\Result createAccountAssignment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccountAssignmentAsync(array $args = [])\n * @method \\Aws\\Result createInstanceAccessControlAttributeConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createInstanceAccessControlAttributeConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createPermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPermissionSetAsync(array $args = [])\n * @method \\Aws\\Result deleteAccountAssignment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccountAssignmentAsync(array $args = [])\n * @method \\Aws\\Result deleteInlinePolicyFromPermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInlinePolicyFromPermissionSetAsync(array $args = [])\n * @method \\Aws\\Result deleteInstanceAccessControlAttributeConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteInstanceAccessControlAttributeConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deletePermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePermissionSetAsync(array $args = [])\n * @method \\Aws\\Result deletePermissionsBoundaryFromPermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePermissionsBoundaryFromPermissionSetAsync(array $args = [])\n * @method \\Aws\\Result describeAccountAssignmentCreationStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountAssignmentCreationStatusAsync(array $args = [])\n * @method \\Aws\\Result describeAccountAssignmentDeletionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountAssignmentDeletionStatusAsync(array $args = [])\n * @method \\Aws\\Result describeInstanceAccessControlAttributeConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInstanceAccessControlAttributeConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describePermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePermissionSetAsync(array $args = [])\n * @method \\Aws\\Result describePermissionSetProvisioningStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describePermissionSetProvisioningStatusAsync(array $args = [])\n * @method \\Aws\\Result detachCustomerManagedPolicyReferenceFromPermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachCustomerManagedPolicyReferenceFromPermissionSetAsync(array $args = [])\n * @method \\Aws\\Result detachManagedPolicyFromPermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachManagedPolicyFromPermissionSetAsync(array $args = [])\n * @method \\Aws\\Result getInlinePolicyForPermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInlinePolicyForPermissionSetAsync(array $args = [])\n * @method \\Aws\\Result getPermissionsBoundaryForPermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPermissionsBoundaryForPermissionSetAsync(array $args = [])\n * @method \\Aws\\Result listAccountAssignmentCreationStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccountAssignmentCreationStatusAsync(array $args = [])\n * @method \\Aws\\Result listAccountAssignmentDeletionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccountAssignmentDeletionStatusAsync(array $args = [])\n * @method \\Aws\\Result listAccountAssignments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccountAssignmentsAsync(array $args = [])\n * @method \\Aws\\Result listAccountsForProvisionedPermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccountsForProvisionedPermissionSetAsync(array $args = [])\n * @method \\Aws\\Result listCustomerManagedPolicyReferencesInPermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCustomerManagedPolicyReferencesInPermissionSetAsync(array $args = [])\n * @method \\Aws\\Result listInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listInstancesAsync(array $args = [])\n * @method \\Aws\\Result listManagedPoliciesInPermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listManagedPoliciesInPermissionSetAsync(array $args = [])\n * @method \\Aws\\Result listPermissionSetProvisioningStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPermissionSetProvisioningStatusAsync(array $args = [])\n * @method \\Aws\\Result listPermissionSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPermissionSetsAsync(array $args = [])\n * @method \\Aws\\Result listPermissionSetsProvisionedToAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPermissionSetsProvisionedToAccountAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result provisionPermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise provisionPermissionSetAsync(array $args = [])\n * @method \\Aws\\Result putInlinePolicyToPermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putInlinePolicyToPermissionSetAsync(array $args = [])\n * @method \\Aws\\Result putPermissionsBoundaryToPermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPermissionsBoundaryToPermissionSetAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateInstanceAccessControlAttributeConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateInstanceAccessControlAttributeConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updatePermissionSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePermissionSetAsync(array $args = [])\n */\nclass SSOAdminClient extends AwsClient {}\n", "num_lines": 84}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SSOAdmin\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Single Sign-On Admin** service.\n */\nclass SSOAdminException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SSOOIDC;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS SSO OIDC** service.\n * @method \\Aws\\Result createToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTokenAsync(array $args = [])\n * @method \\Aws\\Result registerClient(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerClientAsync(array $args = [])\n * @method \\Aws\\Result startDeviceAuthorization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDeviceAuthorizationAsync(array $args = [])\n */\nclass SSOOIDCClient extends AwsClient {}\n", "num_lines": 16}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SSOOIDC\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS SSO OIDC** service.\n */\nclass SSOOIDCException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\StorageGateway;\n\nuse Aws\\AwsClient;\n\n/**\n * AWS Storage Gateway client.\n *\n * @method \\Aws\\Result activateGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise activateGatewayAsync(array $args = [])\n * @method \\Aws\\Result addCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addCacheAsync(array $args = [])\n * @method \\Aws\\Result addTagsToResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addTagsToResourceAsync(array $args = [])\n * @method \\Aws\\Result addUploadBuffer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addUploadBufferAsync(array $args = [])\n * @method \\Aws\\Result addWorkingStorage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addWorkingStorageAsync(array $args = [])\n * @method \\Aws\\Result assignTapePool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise assignTapePoolAsync(array $args = [])\n * @method \\Aws\\Result associateFileSystem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateFileSystemAsync(array $args = [])\n * @method \\Aws\\Result attachVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise attachVolumeAsync(array $args = [])\n * @method \\Aws\\Result cancelArchival(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelArchivalAsync(array $args = [])\n * @method \\Aws\\Result cancelRetrieval(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelRetrievalAsync(array $args = [])\n * @method \\Aws\\Result createCachediSCSIVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCachediSCSIVolumeAsync(array $args = [])\n * @method \\Aws\\Result createNFSFileShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNFSFileShareAsync(array $args = [])\n * @method \\Aws\\Result createSMBFileShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSMBFileShareAsync(array $args = [])\n * @method \\Aws\\Result createSnapshot(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSnapshotAsync(array $args = [])\n * @method \\Aws\\Result createSnapshotFromVolumeRecoveryPoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSnapshotFromVolumeRecoveryPointAsync(array $args = [])\n * @method \\Aws\\Result createStorediSCSIVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStorediSCSIVolumeAsync(array $args = [])\n * @method \\Aws\\Result createTapePool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTapePoolAsync(array $args = [])\n * @method \\Aws\\Result createTapeWithBarcode(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTapeWithBarcodeAsync(array $args = [])\n * @method \\Aws\\Result createTapes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTapesAsync(array $args = [])\n * @method \\Aws\\Result deleteAutomaticTapeCreationPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAutomaticTapeCreationPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteBandwidthRateLimit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBandwidthRateLimitAsync(array $args = [])\n * @method \\Aws\\Result deleteChapCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteChapCredentialsAsync(array $args = [])\n * @method \\Aws\\Result deleteFileShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFileShareAsync(array $args = [])\n * @method \\Aws\\Result deleteGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGatewayAsync(array $args = [])\n * @method \\Aws\\Result deleteSnapshotSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSnapshotScheduleAsync(array $args = [])\n * @method \\Aws\\Result deleteTape(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTapeAsync(array $args = [])\n * @method \\Aws\\Result deleteTapeArchive(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTapeArchiveAsync(array $args = [])\n * @method \\Aws\\Result deleteTapePool(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTapePoolAsync(array $args = [])\n * @method \\Aws\\Result deleteVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVolumeAsync(array $args = [])\n * @method \\Aws\\Result describeAvailabilityMonitorTest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAvailabilityMonitorTestAsync(array $args = [])\n * @method \\Aws\\Result describeBandwidthRateLimit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBandwidthRateLimitAsync(array $args = [])\n * @method \\Aws\\Result describeBandwidthRateLimitSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBandwidthRateLimitScheduleAsync(array $args = [])\n * @method \\Aws\\Result describeCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCacheAsync(array $args = [])\n * @method \\Aws\\Result describeCachediSCSIVolumes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCachediSCSIVolumesAsync(array $args = [])\n * @method \\Aws\\Result describeChapCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeChapCredentialsAsync(array $args = [])\n * @method \\Aws\\Result describeFileSystemAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFileSystemAssociationsAsync(array $args = [])\n * @method \\Aws\\Result describeGatewayInformation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGatewayInformationAsync(array $args = [])\n * @method \\Aws\\Result describeMaintenanceStartTime(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMaintenanceStartTimeAsync(array $args = [])\n * @method \\Aws\\Result describeNFSFileShares(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNFSFileSharesAsync(array $args = [])\n * @method \\Aws\\Result describeSMBFileShares(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSMBFileSharesAsync(array $args = [])\n * @method \\Aws\\Result describeSMBSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSMBSettingsAsync(array $args = [])\n * @method \\Aws\\Result describeSnapshotSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSnapshotScheduleAsync(array $args = [])\n * @method \\Aws\\Result describeStorediSCSIVolumes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeStorediSCSIVolumesAsync(array $args = [])\n * @method \\Aws\\Result describeTapeArchives(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTapeArchivesAsync(array $args = [])\n * @method \\Aws\\Result describeTapeRecoveryPoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTapeRecoveryPointsAsync(array $args = [])\n * @method \\Aws\\Result describeTapes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTapesAsync(array $args = [])\n * @method \\Aws\\Result describeUploadBuffer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUploadBufferAsync(array $args = [])\n * @method \\Aws\\Result describeVTLDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeVTLDevicesAsync(array $args = [])\n * @method \\Aws\\Result describeWorkingStorage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkingStorageAsync(array $args = [])\n * @method \\Aws\\Result detachVolume(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detachVolumeAsync(array $args = [])\n * @method \\Aws\\Result disableGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disableGatewayAsync(array $args = [])\n * @method \\Aws\\Result disassociateFileSystem(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateFileSystemAsync(array $args = [])\n * @method \\Aws\\Result joinDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise joinDomainAsync(array $args = [])\n * @method \\Aws\\Result listAutomaticTapeCreationPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAutomaticTapeCreationPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listFileShares(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFileSharesAsync(array $args = [])\n * @method \\Aws\\Result listFileSystemAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFileSystemAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listGateways(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGatewaysAsync(array $args = [])\n * @method \\Aws\\Result listLocalDisks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLocalDisksAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTapePools(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTapePoolsAsync(array $args = [])\n * @method \\Aws\\Result listTapes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTapesAsync(array $args = [])\n * @method \\Aws\\Result listVolumeInitiators(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVolumeInitiatorsAsync(array $args = [])\n * @method \\Aws\\Result listVolumeRecoveryPoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVolumeRecoveryPointsAsync(array $args = [])\n * @method \\Aws\\Result listVolumes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVolumesAsync(array $args = [])\n * @method \\Aws\\Result notifyWhenUploaded(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise notifyWhenUploadedAsync(array $args = [])\n * @method \\Aws\\Result refreshCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise refreshCacheAsync(array $args = [])\n * @method \\Aws\\Result removeTagsFromResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeTagsFromResourceAsync(array $args = [])\n * @method \\Aws\\Result resetCache(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetCacheAsync(array $args = [])\n * @method \\Aws\\Result retrieveTapeArchive(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise retrieveTapeArchiveAsync(array $args = [])\n * @method \\Aws\\Result retrieveTapeRecoveryPoint(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise retrieveTapeRecoveryPointAsync(array $args = [])\n * @method \\Aws\\Result setLocalConsolePassword(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setLocalConsolePasswordAsync(array $args = [])\n * @method \\Aws\\Result setSMBGuestPassword(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise setSMBGuestPasswordAsync(array $args = [])\n * @method \\Aws\\Result shutdownGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise shutdownGatewayAsync(array $args = [])\n * @method \\Aws\\Result startAvailabilityMonitorTest(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startAvailabilityMonitorTestAsync(array $args = [])\n * @method \\Aws\\Result startGateway(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startGatewayAsync(array $args = [])\n * @method \\Aws\\Result updateAutomaticTapeCreationPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAutomaticTapeCreationPolicyAsync(array $args = [])\n * @method \\Aws\\Result updateBandwidthRateLimit(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBandwidthRateLimitAsync(array $args = [])\n * @method \\Aws\\Result updateBandwidthRateLimitSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBandwidthRateLimitScheduleAsync(array $args = [])\n * @method \\Aws\\Result updateChapCredentials(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateChapCredentialsAsync(array $args = [])\n * @method \\Aws\\Result updateFileSystemAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFileSystemAssociationAsync(array $args = [])\n * @method \\Aws\\Result updateGatewayInformation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGatewayInformationAsync(array $args = [])\n * @method \\Aws\\Result updateGatewaySoftwareNow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGatewaySoftwareNowAsync(array $args = [])\n * @method \\Aws\\Result updateMaintenanceStartTime(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMaintenanceStartTimeAsync(array $args = [])\n * @method \\Aws\\Result updateNFSFileShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNFSFileShareAsync(array $args = [])\n * @method \\Aws\\Result updateSMBFileShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSMBFileShareAsync(array $args = [])\n * @method \\Aws\\Result updateSMBFileShareVisibility(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSMBFileShareVisibilityAsync(array $args = [])\n * @method \\Aws\\Result updateSMBLocalGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSMBLocalGroupsAsync(array $args = [])\n * @method \\Aws\\Result updateSMBSecurityStrategy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSMBSecurityStrategyAsync(array $args = [])\n * @method \\Aws\\Result updateSnapshotSchedule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSnapshotScheduleAsync(array $args = [])\n * @method \\Aws\\Result updateVTLDeviceType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVTLDeviceTypeAsync(array $args = [])\n */\nclass StorageGatewayClient extends AwsClient {}\n", "num_lines": 191}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\StorageGateway\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the AWS Storage Gateway service.\n */\nclass StorageGatewayException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sts;\n\nuse Aws\\AwsClient;\nuse Aws\\CacheInterface;\nuse Aws\\Credentials\\Credentials;\nuse Aws\\Result;\nuse Aws\\Sts\\RegionalEndpoints\\ConfigurationProvider;\n\n/**\n * This client is used to interact with the **AWS Security Token Service (AWS STS)**.\n *\n * @method \\Aws\\Result assumeRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise assumeRoleAsync(array $args = [])\n * @method \\Aws\\Result assumeRoleWithSAML(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise assumeRoleWithSAMLAsync(array $args = [])\n * @method \\Aws\\Result assumeRoleWithWebIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise assumeRoleWithWebIdentityAsync(array $args = [])\n * @method \\Aws\\Result decodeAuthorizationMessage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise decodeAuthorizationMessageAsync(array $args = [])\n * @method \\Aws\\Result getAccessKeyInfo(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccessKeyInfoAsync(array $args = [])\n * @method \\Aws\\Result getCallerIdentity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCallerIdentityAsync(array $args = [])\n * @method \\Aws\\Result getFederationToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFederationTokenAsync(array $args = [])\n * @method \\Aws\\Result getSessionToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSessionTokenAsync(array $args = [])\n */\nclass StsClient extends AwsClient\n{\n\n    /**\n     * {@inheritdoc}\n     *\n     * In addition to the options available to\n     * {@see \\Aws\\AwsClient::__construct}, StsClient accepts the following\n     * options:\n     *\n     * - sts_regional_endpoints:\n     *   (Aws\\Sts\\RegionalEndpoints\\ConfigurationInterface|Aws\\CacheInterface\\|callable|string|array)\n     *   Specifies whether to use regional or legacy endpoints for legacy regions.\n     *   Provide an Aws\\Sts\\RegionalEndpoints\\ConfigurationInterface object, an\n     *   instance of Aws\\CacheInterface, a callable configuration provider used\n     *   to create endpoint configuration, a string value of `legacy` or\n     *   `regional`, or an associative array with the following keys:\n     *   endpoint_types (string)  Set to `legacy` or `regional`, defaults to\n     *   `legacy`\n     *\n     * @param array $args\n     */\n    public function __construct(array $args)\n    {\n        if (\n            !isset($args['sts_regional_endpoints'])\n            || $args['sts_regional_endpoints'] instanceof CacheInterface\n        ) {\n            $args['sts_regional_endpoints'] = ConfigurationProvider::defaultProvider($args);\n        }\n        $this->addBuiltIns($args);\n        parent::__construct($args);\n    }\n\n    /**\n     * Creates credentials from the result of an STS operations\n     *\n     * @param Result $result Result of an STS operation\n     *\n     * @return Credentials\n     * @throws \\InvalidArgumentException if the result contains no credentials\n     */\n    public function createCredentials(Result $result)\n    {\n        if (!$result->hasKey('Credentials')) {\n            throw new \\InvalidArgumentException('Result contains no credentials');\n        }\n\n        $c = $result['Credentials'];\n\n        return new Credentials(\n            $c['AccessKeyId'],\n            $c['SecretAccessKey'],\n            isset($c['SessionToken']) ? $c['SessionToken'] : null,\n            isset($c['Expiration']) && $c['Expiration'] instanceof \\DateTimeInterface\n                ? (int) $c['Expiration']->format('U')\n                : null\n        );\n    }\n\n    /**\n     * Adds service-specific client built-in value\n     *\n     * @return void\n     */\n    private function addBuiltIns($args)\n    {\n        $key = 'AWS::STS::UseGlobalEndpoint';\n        $result = $args['sts_regional_endpoints'] instanceof \\Closure ?\n            $args['sts_regional_endpoints']()->wait() : $args['sts_regional_endpoints'];\n\n        if (is_string($result)) {\n            if ($result === 'regional') {\n                $value = false;\n            } else if ($result === 'legacy') {\n                $value = true;\n            } else {\n                return;\n            }\n        } else {\n            if ($result->getEndpointsType() === 'regional') {\n                $value = false;\n            } else {\n                $value = true;\n            }\n        }\n\n        $this->clientBuiltIns[$key] = $value;\n    }\n}\n", "num_lines": 120}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sts\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * AWS Security Token Service exception.\n */\nclass StsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sts\\RegionalEndpoints;\n\nclass Configuration implements ConfigurationInterface\n{\n    private $endpointsType;\n    private $isFallback;\n\n    public function __construct($endpointsType, $isFallback = false)\n    {\n        $this->endpointsType = strtolower($endpointsType);\n        $this->isFallback = $isFallback;\n        if (!in_array($this->endpointsType, ['legacy', 'regional'])) {\n            throw new \\InvalidArgumentException(\n                \"Configuration parameter must either be 'legacy' or 'regional'.\"\n            );\n        }\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getEndpointsType()\n    {\n        return $this->endpointsType;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function toArray()\n    {\n        return [\n            'endpoints_type' => $this->getEndpointsType()\n        ];\n    }\n\n    public function isFallback()\n    {\n        return $this->isFallback;\n    }\n}\n", "num_lines": 43}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sts\\RegionalEndpoints;\n\n/**\n * Provides access to STS regional endpoints configuration options: endpoints_type\n */\ninterface ConfigurationInterface\n{\n    /**\n     * Returns the endpoints type\n     *\n     * @return string\n     */\n    public function getEndpointsType();\n\n    /**\n     * Returns the configuration as an associative array\n     *\n     * @return array\n     */\n    public function toArray();\n}\n", "num_lines": 23}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sts\\RegionalEndpoints;\n\nuse Aws\\AbstractConfigurationProvider;\nuse Aws\\CacheInterface;\nuse Aws\\ConfigurationProviderInterface;\nuse Aws\\Sts\\RegionalEndpoints\\Exception\\ConfigurationException;\nuse GuzzleHttp\\Promise;\nuse GuzzleHttp\\Promise\\PromiseInterface;\n\n/**\n * A configuration provider is a function that returns a promise that is\n * fulfilled with a {@see \\Aws\\Sts\\RegionalEndpoints\\ConfigurationInterface}\n * or rejected with an {@see \\Aws\\Sts\\RegionalEndpoints\\Exception\\ConfigurationException}.\n *\n * <code>\n * use Aws\\Sts\\RegionalEndpoints\\ConfigurationProvider;\n * $provider = ConfigurationProvider::defaultProvider();\n * // Returns a ConfigurationInterface or throws.\n * $config = $provider()->wait();\n * </code>\n *\n * Configuration providers can be composed to create configuration using\n * conditional logic that can create different configurations in different\n * environments. You can compose multiple providers into a single provider using\n * {@see \\Aws\\Sts\\RegionalEndpoints\\ConfigurationProvider::chain}. This function\n * accepts providers as variadic arguments and returns a new function that will\n * invoke each provider until a successful configuration is returned.\n *\n * <code>\n * // First try an INI file at this location.\n * $a = ConfigurationProvider::ini(null, '/path/to/file.ini');\n * // Then try an INI file at this location.\n * $b = ConfigurationProvider::ini(null, '/path/to/other-file.ini');\n * // Then try loading from environment variables.\n * $c = ConfigurationProvider::env();\n * // Combine the three providers together.\n * $composed = ConfigurationProvider::chain($a, $b, $c);\n * // Returns a promise that is fulfilled with a configuration or throws.\n * $promise = $composed();\n * // Wait on the configuration to resolve.\n * $config = $promise->wait();\n * </code>\n */\nclass ConfigurationProvider extends AbstractConfigurationProvider\n    implements ConfigurationProviderInterface\n{\n    const DEFAULT_ENDPOINTS_TYPE = 'legacy';\n    const ENV_ENDPOINTS_TYPE = 'AWS_STS_REGIONAL_ENDPOINTS';\n    const ENV_PROFILE = 'AWS_PROFILE';\n    const INI_ENDPOINTS_TYPE = 'sts_regional_endpoints';\n\n    public static $cacheKey = 'aws_sts_regional_endpoints_config';\n\n    protected static $interfaceClass = ConfigurationInterface::class;\n    protected static $exceptionClass = ConfigurationException::class;\n\n    /**\n     * Create a default config provider that first checks for environment\n     * variables, then checks for a specified profile in the environment-defined\n     * config file location (env variable is 'AWS_CONFIG_FILE', file location\n     * defaults to ~/.aws/config), then checks for the \"default\" profile in the\n     * environment-defined config file location, and failing those uses a default\n     * fallback set of configuration options.\n     *\n     * This provider is automatically wrapped in a memoize function that caches\n     * previously provided config options.\n     *\n     * @param array $config\n     *\n     * @return callable\n     */\n    public static function defaultProvider(array $config = [])\n    {\n        $configProviders = [self::env()];\n        if (\n            !isset($config['use_aws_shared_config_files'])\n            || $config['use_aws_shared_config_files'] != false\n        ) {\n            $configProviders[] = self::ini();\n        }\n        $configProviders[] = self::fallback();\n\n        $memo = self::memoize(\n            call_user_func_array([ConfigurationProvider::class, 'chain'], $configProviders)\n        );\n\n        if (isset($config['sts_regional_endpoints'])\n            && $config['sts_regional_endpoints'] instanceof CacheInterface\n        ) {\n            return self::cache($memo, $config['sts_regional_endpoints'], self::$cacheKey);\n        }\n\n        return $memo;\n    }\n\n    /**\n     * Provider that creates config from environment variables.\n     *\n     * @return callable\n     */\n    public static function env()\n    {\n        return function () {\n            // Use config from environment variables, if available\n            $endpointsType = getenv(self::ENV_ENDPOINTS_TYPE);\n            if (!empty($endpointsType)) {\n                return Promise\\Create::promiseFor(\n                    new Configuration($endpointsType)\n                );\n            }\n\n            return self::reject('Could not find environment variable config'\n                . ' in ' . self::ENV_ENDPOINTS_TYPE);\n        };\n    }\n\n    /**\n     * Fallback config options when other sources are not set.\n     *\n     * @return callable\n     */\n    public static function fallback()\n    {\n        return function () {\n            return Promise\\Create::promiseFor(\n                new Configuration(self::DEFAULT_ENDPOINTS_TYPE, true)\n            );\n        };\n    }\n\n    /**\n     * Config provider that creates config using a config file whose location\n     * is specified by an environment variable 'AWS_CONFIG_FILE', defaulting to\n     * ~/.aws/config if not specified\n     *\n     * @param string|null $profile  Profile to use. If not specified will use\n     *                              the \"default\" profile.\n     * @param string|null $filename If provided, uses a custom filename rather\n     *                              than looking in the default directory.\n     *\n     * @return callable\n     */\n    public static function ini(\n        $profile = null,\n        $filename = null\n    ) {\n        $filename = $filename ?: (self::getDefaultConfigFilename());\n        $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');\n\n        return function () use ($profile, $filename) {\n            if (!@is_readable($filename)) {\n                return self::reject(\"Cannot read configuration from $filename\");\n            }\n            $data = \\Aws\\parse_ini_file($filename, true);\n            if ($data === false) {\n                return self::reject(\"Invalid config file: $filename\");\n            }\n            if (!isset($data[$profile])) {\n                return self::reject(\"'$profile' not found in config file\");\n            }\n            if (!isset($data[$profile][self::INI_ENDPOINTS_TYPE])) {\n                return self::reject(\"Required STS regional endpoints config values\n                    not present in INI profile '{$profile}' ({$filename})\");\n            }\n\n            return Promise\\Create::promiseFor(\n                new Configuration($data[$profile][self::INI_ENDPOINTS_TYPE])\n            );\n        };\n    }\n\n    /**\n     * Unwraps a configuration object in whatever valid form it is in,\n     * always returning a ConfigurationInterface object.\n     *\n     * @param  mixed $config\n     * @return ConfigurationInterface\n     * @throws \\InvalidArgumentException\n     */\n    public static function unwrap($config)\n    {\n        if (is_callable($config)) {\n            $config = $config();\n        }\n        if ($config instanceof PromiseInterface) {\n            $config = $config->wait();\n        }\n        if ($config instanceof ConfigurationInterface) {\n            return $config;\n        }\n        if (is_string($config)) {\n            return new Configuration($config);\n        }\n        if (is_array($config) && isset($config['endpoints_type'])) {\n            return new Configuration($config['endpoints_type']);\n        }\n\n        throw new \\InvalidArgumentException('Not a valid STS regional endpoints '\n            . 'configuration argument.');\n    }\n}\n", "num_lines": 203}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Sts\\RegionalEndpoints\\Exception;\n\nuse Aws\\HasMonitoringEventsTrait;\nuse Aws\\MonitoringEventsInterface;\n\n/**\n * Represents an error interacting with configuration for sts regional endpoints\n */\nclass ConfigurationException extends \\RuntimeException implements\n    MonitoringEventsInterface\n{\n    use HasMonitoringEventsTrait;\n}\n", "num_lines": 15}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Support;\n\nuse Aws\\AwsClient;\n\n/**\n * AWS Support client.\n *\n * @method \\Aws\\Result addAttachmentsToSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addAttachmentsToSetAsync(array $args = [])\n * @method \\Aws\\Result addCommunicationToCase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addCommunicationToCaseAsync(array $args = [])\n * @method \\Aws\\Result createCase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCaseAsync(array $args = [])\n * @method \\Aws\\Result describeAttachment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAttachmentAsync(array $args = [])\n * @method \\Aws\\Result describeCases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCasesAsync(array $args = [])\n * @method \\Aws\\Result describeCommunications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCommunicationsAsync(array $args = [])\n * @method \\Aws\\Result describeCreateCaseOptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCreateCaseOptionsAsync(array $args = [])\n * @method \\Aws\\Result describeServices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeServicesAsync(array $args = [])\n * @method \\Aws\\Result describeSeverityLevels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSeverityLevelsAsync(array $args = [])\n * @method \\Aws\\Result describeSupportedLanguages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSupportedLanguagesAsync(array $args = [])\n * @method \\Aws\\Result describeTrustedAdvisorCheckRefreshStatuses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTrustedAdvisorCheckRefreshStatusesAsync(array $args = [])\n * @method \\Aws\\Result describeTrustedAdvisorCheckResult(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTrustedAdvisorCheckResultAsync(array $args = [])\n * @method \\Aws\\Result describeTrustedAdvisorCheckSummaries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTrustedAdvisorCheckSummariesAsync(array $args = [])\n * @method \\Aws\\Result describeTrustedAdvisorChecks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTrustedAdvisorChecksAsync(array $args = [])\n * @method \\Aws\\Result refreshTrustedAdvisorCheck(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise refreshTrustedAdvisorCheckAsync(array $args = [])\n * @method \\Aws\\Result resolveCase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resolveCaseAsync(array $args = [])\n */\nclass SupportClient extends AwsClient {}\n", "num_lines": 43}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Support\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * AWS Support service exception.\n */\nclass SupportException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SupportApp;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Support App** service.\n * @method \\Aws\\Result createSlackChannelConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSlackChannelConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteAccountAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccountAliasAsync(array $args = [])\n * @method \\Aws\\Result deleteSlackChannelConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSlackChannelConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteSlackWorkspaceConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSlackWorkspaceConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getAccountAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccountAliasAsync(array $args = [])\n * @method \\Aws\\Result listSlackChannelConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSlackChannelConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listSlackWorkspaceConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSlackWorkspaceConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result putAccountAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccountAliasAsync(array $args = [])\n * @method \\Aws\\Result registerSlackWorkspaceForOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerSlackWorkspaceForOrganizationAsync(array $args = [])\n * @method \\Aws\\Result updateSlackChannelConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSlackChannelConfigurationAsync(array $args = [])\n */\nclass SupportAppClient extends AwsClient {}\n", "num_lines": 30}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SupportApp\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Support App** service.\n */\nclass SupportAppException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Swf;\n\nuse Aws\\AwsClient;\n\n/**\n * Amazon Simple Workflow Service (Amazon SWF) client.\n *\n * @method \\Aws\\Result countClosedWorkflowExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise countClosedWorkflowExecutionsAsync(array $args = [])\n * @method \\Aws\\Result countOpenWorkflowExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise countOpenWorkflowExecutionsAsync(array $args = [])\n * @method \\Aws\\Result countPendingActivityTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise countPendingActivityTasksAsync(array $args = [])\n * @method \\Aws\\Result countPendingDecisionTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise countPendingDecisionTasksAsync(array $args = [])\n * @method \\Aws\\Result deprecateActivityType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deprecateActivityTypeAsync(array $args = [])\n * @method \\Aws\\Result deprecateDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deprecateDomainAsync(array $args = [])\n * @method \\Aws\\Result deprecateWorkflowType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deprecateWorkflowTypeAsync(array $args = [])\n * @method \\Aws\\Result describeActivityType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeActivityTypeAsync(array $args = [])\n * @method \\Aws\\Result describeDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainAsync(array $args = [])\n * @method \\Aws\\Result describeWorkflowExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkflowExecutionAsync(array $args = [])\n * @method \\Aws\\Result describeWorkflowType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkflowTypeAsync(array $args = [])\n * @method \\Aws\\Result getWorkflowExecutionHistory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkflowExecutionHistoryAsync(array $args = [])\n * @method \\Aws\\Result listActivityTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listActivityTypesAsync(array $args = [])\n * @method \\Aws\\Result listClosedWorkflowExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listClosedWorkflowExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainsAsync(array $args = [])\n * @method \\Aws\\Result listOpenWorkflowExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOpenWorkflowExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWorkflowTypes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkflowTypesAsync(array $args = [])\n * @method \\Aws\\Result pollForActivityTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise pollForActivityTaskAsync(array $args = [])\n * @method \\Aws\\Result pollForDecisionTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise pollForDecisionTaskAsync(array $args = [])\n * @method \\Aws\\Result recordActivityTaskHeartbeat(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise recordActivityTaskHeartbeatAsync(array $args = [])\n * @method \\Aws\\Result registerActivityType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerActivityTypeAsync(array $args = [])\n * @method \\Aws\\Result registerDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerDomainAsync(array $args = [])\n * @method \\Aws\\Result registerWorkflowType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerWorkflowTypeAsync(array $args = [])\n * @method \\Aws\\Result requestCancelWorkflowExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise requestCancelWorkflowExecutionAsync(array $args = [])\n * @method \\Aws\\Result respondActivityTaskCanceled(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise respondActivityTaskCanceledAsync(array $args = [])\n * @method \\Aws\\Result respondActivityTaskCompleted(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise respondActivityTaskCompletedAsync(array $args = [])\n * @method \\Aws\\Result respondActivityTaskFailed(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise respondActivityTaskFailedAsync(array $args = [])\n * @method \\Aws\\Result respondDecisionTaskCompleted(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise respondDecisionTaskCompletedAsync(array $args = [])\n * @method \\Aws\\Result signalWorkflowExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise signalWorkflowExecutionAsync(array $args = [])\n * @method \\Aws\\Result startWorkflowExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startWorkflowExecutionAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result terminateWorkflowExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise terminateWorkflowExecutionAsync(array $args = [])\n * @method \\Aws\\Result undeprecateActivityType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise undeprecateActivityTypeAsync(array $args = [])\n * @method \\Aws\\Result undeprecateDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise undeprecateDomainAsync(array $args = [])\n * @method \\Aws\\Result undeprecateWorkflowType(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise undeprecateWorkflowTypeAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n */\nclass SwfClient extends AwsClient {}\n", "num_lines": 85}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Swf\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon Simple Workflow Service.\n */\nclass SwfException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Synthetics;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Synthetics** service.\n * @method \\Aws\\Result associateResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateResourceAsync(array $args = [])\n * @method \\Aws\\Result createCanary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCanaryAsync(array $args = [])\n * @method \\Aws\\Result createGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteCanary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCanaryAsync(array $args = [])\n * @method \\Aws\\Result deleteGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGroupAsync(array $args = [])\n * @method \\Aws\\Result describeCanaries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCanariesAsync(array $args = [])\n * @method \\Aws\\Result describeCanariesLastRun(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCanariesLastRunAsync(array $args = [])\n * @method \\Aws\\Result describeRuntimeVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRuntimeVersionsAsync(array $args = [])\n * @method \\Aws\\Result disassociateResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateResourceAsync(array $args = [])\n * @method \\Aws\\Result getCanary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCanaryAsync(array $args = [])\n * @method \\Aws\\Result getCanaryRuns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCanaryRunsAsync(array $args = [])\n * @method \\Aws\\Result getGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGroupAsync(array $args = [])\n * @method \\Aws\\Result listAssociatedGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAssociatedGroupsAsync(array $args = [])\n * @method \\Aws\\Result listGroupResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupResourcesAsync(array $args = [])\n * @method \\Aws\\Result listGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result startCanary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startCanaryAsync(array $args = [])\n * @method \\Aws\\Result stopCanary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopCanaryAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateCanary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCanaryAsync(array $args = [])\n */\nclass SyntheticsClient extends AwsClient {}\n", "num_lines": 52}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Synthetics\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Synthetics** service.\n */\nclass SyntheticsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Textract;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Textract** service.\n * @method \\Aws\\Result analyzeDocument(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise analyzeDocumentAsync(array $args = [])\n * @method \\Aws\\Result analyzeExpense(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise analyzeExpenseAsync(array $args = [])\n * @method \\Aws\\Result analyzeID(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise analyzeIDAsync(array $args = [])\n * @method \\Aws\\Result detectDocumentText(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise detectDocumentTextAsync(array $args = [])\n * @method \\Aws\\Result getDocumentAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDocumentAnalysisAsync(array $args = [])\n * @method \\Aws\\Result getDocumentTextDetection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDocumentTextDetectionAsync(array $args = [])\n * @method \\Aws\\Result getExpenseAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getExpenseAnalysisAsync(array $args = [])\n * @method \\Aws\\Result getLendingAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLendingAnalysisAsync(array $args = [])\n * @method \\Aws\\Result getLendingAnalysisSummary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLendingAnalysisSummaryAsync(array $args = [])\n * @method \\Aws\\Result startDocumentAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDocumentAnalysisAsync(array $args = [])\n * @method \\Aws\\Result startDocumentTextDetection(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startDocumentTextDetectionAsync(array $args = [])\n * @method \\Aws\\Result startExpenseAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startExpenseAnalysisAsync(array $args = [])\n * @method \\Aws\\Result startLendingAnalysis(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startLendingAnalysisAsync(array $args = [])\n */\nclass TextractClient extends AwsClient {}\n", "num_lines": 36}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Textract\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Textract** service.\n */\nclass TextractException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\TimestreamQuery;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Timestream Query** service.\n * @method \\Aws\\Result cancelQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelQueryAsync(array $args = [])\n * @method \\Aws\\Result createScheduledQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createScheduledQueryAsync(array $args = [])\n * @method \\Aws\\Result deleteScheduledQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteScheduledQueryAsync(array $args = [])\n * @method \\Aws\\Result describeEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEndpointsAsync(array $args = [])\n * @method \\Aws\\Result describeScheduledQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeScheduledQueryAsync(array $args = [])\n * @method \\Aws\\Result executeScheduledQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise executeScheduledQueryAsync(array $args = [])\n * @method \\Aws\\Result listScheduledQueries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listScheduledQueriesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result prepareQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise prepareQueryAsync(array $args = [])\n * @method \\Aws\\Result query(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise queryAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateScheduledQuery(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateScheduledQueryAsync(array $args = [])\n */\nclass TimestreamQueryClient extends AwsClient {}\n", "num_lines": 36}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\TimestreamQuery\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Timestream Query** service.\n */\nclass TimestreamQueryException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\TimestreamWrite;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Timestream Write** service.\n * @method \\Aws\\Result createBatchLoadTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBatchLoadTaskAsync(array $args = [])\n * @method \\Aws\\Result createDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDatabaseAsync(array $args = [])\n * @method \\Aws\\Result createTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTableAsync(array $args = [])\n * @method \\Aws\\Result deleteDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDatabaseAsync(array $args = [])\n * @method \\Aws\\Result deleteTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTableAsync(array $args = [])\n * @method \\Aws\\Result describeBatchLoadTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeBatchLoadTaskAsync(array $args = [])\n * @method \\Aws\\Result describeDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDatabaseAsync(array $args = [])\n * @method \\Aws\\Result describeEndpoints(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEndpointsAsync(array $args = [])\n * @method \\Aws\\Result describeTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTableAsync(array $args = [])\n * @method \\Aws\\Result listBatchLoadTasks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBatchLoadTasksAsync(array $args = [])\n * @method \\Aws\\Result listDatabases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDatabasesAsync(array $args = [])\n * @method \\Aws\\Result listTables(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTablesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result resumeBatchLoadTask(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resumeBatchLoadTaskAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDatabase(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDatabaseAsync(array $args = [])\n * @method \\Aws\\Result updateTable(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTableAsync(array $args = [])\n * @method \\Aws\\Result writeRecords(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise writeRecordsAsync(array $args = [])\n */\nclass TimestreamWriteClient extends AwsClient {}\n", "num_lines": 48}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\TimestreamWrite\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Timestream Write** service.\n */\nclass TimestreamWriteException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Tnb;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Telco Network Builder** service.\n * @method \\Aws\\Result cancelSolNetworkOperation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelSolNetworkOperationAsync(array $args = [])\n * @method \\Aws\\Result createSolFunctionPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSolFunctionPackageAsync(array $args = [])\n * @method \\Aws\\Result createSolNetworkInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSolNetworkInstanceAsync(array $args = [])\n * @method \\Aws\\Result createSolNetworkPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSolNetworkPackageAsync(array $args = [])\n * @method \\Aws\\Result deleteSolFunctionPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSolFunctionPackageAsync(array $args = [])\n * @method \\Aws\\Result deleteSolNetworkInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSolNetworkInstanceAsync(array $args = [])\n * @method \\Aws\\Result deleteSolNetworkPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSolNetworkPackageAsync(array $args = [])\n * @method \\Aws\\Result getSolFunctionInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSolFunctionInstanceAsync(array $args = [])\n * @method \\Aws\\Result getSolFunctionPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSolFunctionPackageAsync(array $args = [])\n * @method \\Aws\\Result getSolFunctionPackageContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSolFunctionPackageContentAsync(array $args = [])\n * @method \\Aws\\Result getSolFunctionPackageDescriptor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSolFunctionPackageDescriptorAsync(array $args = [])\n * @method \\Aws\\Result getSolNetworkInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSolNetworkInstanceAsync(array $args = [])\n * @method \\Aws\\Result getSolNetworkOperation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSolNetworkOperationAsync(array $args = [])\n * @method \\Aws\\Result getSolNetworkPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSolNetworkPackageAsync(array $args = [])\n * @method \\Aws\\Result getSolNetworkPackageContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSolNetworkPackageContentAsync(array $args = [])\n * @method \\Aws\\Result getSolNetworkPackageDescriptor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSolNetworkPackageDescriptorAsync(array $args = [])\n * @method \\Aws\\Result instantiateSolNetworkInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise instantiateSolNetworkInstanceAsync(array $args = [])\n * @method \\Aws\\Result listSolFunctionInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSolFunctionInstancesAsync(array $args = [])\n * @method \\Aws\\Result listSolFunctionPackages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSolFunctionPackagesAsync(array $args = [])\n * @method \\Aws\\Result listSolNetworkInstances(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSolNetworkInstancesAsync(array $args = [])\n * @method \\Aws\\Result listSolNetworkOperations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSolNetworkOperationsAsync(array $args = [])\n * @method \\Aws\\Result listSolNetworkPackages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSolNetworkPackagesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putSolFunctionPackageContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSolFunctionPackageContentAsync(array $args = [])\n * @method \\Aws\\Result putSolNetworkPackageContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSolNetworkPackageContentAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result terminateSolNetworkInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise terminateSolNetworkInstanceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateSolFunctionPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSolFunctionPackageAsync(array $args = [])\n * @method \\Aws\\Result updateSolNetworkInstance(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSolNetworkInstanceAsync(array $args = [])\n * @method \\Aws\\Result updateSolNetworkPackage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSolNetworkPackageAsync(array $args = [])\n * @method \\Aws\\Result validateSolFunctionPackageContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise validateSolFunctionPackageContentAsync(array $args = [])\n * @method \\Aws\\Result validateSolNetworkPackageContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise validateSolNetworkPackageContentAsync(array $args = [])\n */\nclass TnbClient extends AwsClient {}\n", "num_lines": 76}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Tnb\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Telco Network Builder** service.\n */\nclass TnbException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Token;\n\nuse InvalidArgumentException;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Interface used to provide interchangeable strategies for adding authorization\n * to requests using the various AWS signature protocols.\n */\nclass BearerTokenAuthorization implements TokenAuthorization\n{\n    /**\n     * Adds the specified token to a request by adding the required headers.\n     *\n     * @param RequestInterface     $request     Request to sign\n     * @param TokenInterface       $token       Token\n     *\n     * @return RequestInterface Returns the modified request.\n     */\n    public function authorizeRequest(\n        RequestInterface $request,\n        TokenInterface $token\n    ) {\n        if (empty($token) || empty($token->getToken())) {\n            throw new InvalidArgumentException(\n                \"Cannot authorize a request with an empty token\"\n            );\n        }\n        $accessToken = $token->getToken();\n        return $request->withHeader('Authorization', \"Bearer {$accessToken}\");\n    }\n}\n", "num_lines": 34}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Token;\n\ntrait ParsesIniTrait\n{\n    /**\n     * Gets profiles from specified $filename, or default ini files.\n     */\n    private static function loadProfiles($filename)\n    {\n        $profileData = \\Aws\\parse_ini_file($filename, true, INI_SCANNER_RAW);\n        $configFilename = self::getHomeDir() . '/.aws/config';\n        if (is_readable($configFilename)) {\n            $configProfiles = \\Aws\\parse_ini_file($configFilename, true, INI_SCANNER_RAW);\n            $profileData = array_merge($configProfiles, $profileData);\n        }\n        foreach ($profileData as $name => $profile) {\n            // standardize config profile names\n            $name = str_replace('profile ', '', $name);\n            $profileData[$name] = $profile;\n        }\n\n        return $profileData;\n    }\n\n    /**\n     * Gets the environment's HOME directory if available.\n     *\n     * @return null|string\n     */\n    private static function getHomeDir()\n    {\n        // On Linux/Unix-like systems, use the HOME environment variable\n        if ($homeDir = getenv('HOME')) {\n            return $homeDir;\n        }\n\n        // Get the HOMEDRIVE and HOMEPATH values for Windows hosts\n        $homeDrive = getenv('HOMEDRIVE');\n        $homePath = getenv('HOMEPATH');\n\n        return ($homeDrive && $homePath) ? $homeDrive . $homePath : null;\n    }\n}\n", "num_lines": 45}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Token;\n\n/**\n * Provides access to an AWS token used for accessing AWS services\n *\n */\ninterface RefreshableTokenProviderInterface\n{\n    /**\n     * Attempts to refresh this token object\n     *\n     * @return Token | Exception\n     */\n    public function refresh();\n\n    /**\n     * Check if a refresh should be attempted\n     *\n     * @return boolean\n     */\n    public function shouldAttemptRefresh();\n}\n", "num_lines": 24}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Token;\n\n/**\n * Token that comes from the SSO provider\n */\nclass SsoToken extends Token\n{\n    private $refreshToken;\n    private $clientId;\n    private $clientSecret;\n    private $registrationExpiresAt;\n    private $region;\n    private $startUrl;\n\n    /**\n     * Constructs a new SSO token object, with the specified AWS\n     * token\n     *\n     * @param string $token   Security token to use\n     * @param int    $expires UNIX timestamp for when the token expires\n     * @param int    $refreshToken An opaque string returned by the sso-oidc service\n     * @param int    $clientId  The client ID generated when performing the registration portion of the OIDC authorization flow\n     * @param int    $clientSecret The client secret generated when performing the registration portion of the OIDC authorization flow\n     * @param int    $registrationExpiresAt The expiration time of the client registration (clientId and clientSecret)\n     * @param int    $region The configured sso_region for the profile that credentials are being resolved for\n     * @param int    $startUrl The configured sso_start_url for the profile that credentials are being resolved for\n     */\n    public function __construct(\n        $token,\n        $expires,\n        $refreshToken = null,\n        $clientId = null,\n        $clientSecret = null,\n        $registrationExpiresAt = null,\n        $region = null,\n        $startUrl = null\n    ) {\n        parent::__construct($token, $expires);\n        $this->refreshToken = $refreshToken;\n        $this->clientId = $clientId;\n        $this->clientSecret = $clientSecret;\n        $this->registrationExpiresAt = $registrationExpiresAt;\n        $this->region = $region;\n        $this->startUrl = $startUrl;\n    }\n\n    /**\n     * @return bool\n     */\n    public function isExpired()\n    {\n        if (isset($this->registrationExpiresAt)\n            && time() >= $this->registrationExpiresAt\n        ) {\n            return false;\n        }\n        return $this->expires !== null && time() >= $this->expires;\n    }\n\n    /**\n     * @return string|null\n     */\n    public function getRefreshToken()\n    {\n        return $this->refreshToken;\n    }\n\n    /**\n     * @return string|null\n     */\n    public function getClientId()\n    {\n        return $this->clientId;\n    }\n\n    /**\n     * @return string|null\n     */\n    public function getClientSecret()\n    {\n        return $this->clientSecret;\n    }\n\n    /**\n     * @return int|null\n     */\n    public function getRegistrationExpiresAt()\n    {\n        return $this->registrationExpiresAt;\n    }\n\n    /**\n     * @return string|null\n     */\n    public function getRegion()\n    {\n        return $this->region;\n    }\n\n    /**\n     * @return string|null\n     */\n    public function getStartUrl()\n    {\n        return $this->startUrl;\n    }\n}\n", "num_lines": 109}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Token;\n\nuse Aws\\Exception\\TokenException;\nuse GuzzleHttp\\Promise;\n\n/**\n * Token that comes from the SSO provider\n */\nclass SsoTokenProvider implements RefreshableTokenProviderInterface\n{\n    use ParsesIniTrait;\n\n    const ENV_PROFILE = 'AWS_PROFILE';\n\n    private $ssoProfileName;\n    private $filename;\n    private $ssoOidcClient;\n\n    /**\n     * Constructs a new SsoTokenProvider object, which will fetch a token from an authenticated SSO profile\n     * @param string $ssoProfileName The name of the profile that contains the sso_session key\n     * @param int    $filename Name of the config file to sso profile from\n     */\n    public function __construct($ssoProfileName, $filename = null, $ssoOidcClient = null) {\n        $profileName = getenv(self::ENV_PROFILE) ?: 'default';\n        $this->ssoProfileName = !empty($ssoProfileName) ? $ssoProfileName : $profileName;\n        $this->filename =  !empty($filename)\n            ? $filename :\n            self::getHomeDir() . '/.aws/config';\n        $this->ssoOidcClient = $ssoOidcClient;\n    }\n\n    /*\n     * Loads cached sso credentials\n     *\n     * @return PromiseInterface\n     */\n    public function __invoke()\n    {\n        return Promise\\Coroutine::of(function () {\n            if (!@is_readable($this->filename)) {\n                throw new TokenException(\"Cannot read profiles from $this->filename\");\n            }\n            $profiles = self::loadProfiles($this->filename);\n            if (!isset($profiles[$this->ssoProfileName])) {\n                throw new TokenException(\"Profile {$this->ssoProfileName} does not exist in {$this->filename}.\");\n            }\n            $ssoProfile = $profiles[$this->ssoProfileName];\n            if (empty($ssoProfile['sso_session'])) {\n                throw new TokenException(\n                    \"Profile {$this->ssoProfileName} in {$this->filename} must contain an sso_session.\"\n                );\n            }\n\n            $sessionProfileName = 'sso-session ' . $ssoProfile['sso_session'];\n            if (empty($profiles[$sessionProfileName])) {\n                throw new TokenException(\n                    \"Profile {$this->ssoProfileName} does not exist in {$this->filename}\"\n                );\n            }\n\n            $sessionProfileData = $profiles[$sessionProfileName];\n            if (empty($sessionProfileData['sso_start_url'])\n                || empty($sessionProfileData['sso_region'])\n            ) {\n                throw new TokenException(\n                    \"Profile {$this->ssoProfileName} in {$this->filename} must contain the following keys: \"\n                    . \"sso_start_url and sso_region.\"\n                );\n            }\n\n            $tokenLocation = self::getTokenLocation($ssoProfile['sso_session']);\n            if (!@is_readable($tokenLocation)) {\n                throw new TokenException(\"Unable to read token file at $tokenLocation\");\n            }\n            $tokenData = $this->getTokenData($tokenLocation);\n            $this->validateTokenData($tokenLocation, $tokenData);\n            yield new SsoToken(\n                $tokenData['accessToken'],\n                $tokenData['expiresAt'],\n                isset($tokenData['refreshToken']) ? $tokenData['refreshToken'] : null,\n                isset($tokenData['clientId']) ? $tokenData['clientId'] : null,\n                isset($tokenData['clientSecret']) ? $tokenData['clientSecret'] : null,\n                isset($tokenData['registrationExpiresAt']) ? $tokenData['registrationExpiresAt'] : null,\n                isset($tokenData['region']) ? $tokenData['region'] : null,\n                isset($tokenData['startUrl']) ? $tokenData['startUrl'] : null\n            );\n        });\n    }\n\n    /**\n     * Refreshes the token\n     * @return mixed|null\n     */\n    public function refresh() {\n        try {\n            //try to reload from disk\n            $token = $this();\n            if (\n                $token instanceof SsoToken\n                && !$token->shouldAttemptRefresh()\n            ) {\n                return $token;\n            }\n        } finally {\n            //if reload from disk fails, try refreshing\n            $tokenLocation = self::getTokenLocation($this->ssoProfileName);\n            $tokenData = $this->getTokenData($tokenLocation);\n            if (\n                empty($this->ssoOidcClient)\n                || empty($tokenData['startUrl'])\n            ) {\n                throw new TokenException(\n                    \"Cannot refresh this token without an 'ssooidcClient' \"\n                    . \"and a 'start_url'\"\n                );\n            }\n            $response = $this->ssoOidcClient->createToken([\n                'clientId' => $tokenData['clientId'],\n                'clientSecret' => $tokenData['clientSecret'],\n                'grantType' => 'refresh_token', // REQUIRED\n                'refreshToken' => $tokenData['refreshToken'],\n            ]);\n            if ($response['@metadata']['statusCode'] == 200) {\n                $tokenData['accessToken'] = $response['accessToken'];\n                $tokenData['expiresAt'] = time () + $response['expiresIn'];\n                $tokenData['refreshToken'] = $response['refreshToken'];\n                $token = new SsoToken(\n                    $tokenData['accessToken'],\n                    $tokenData['expiresAt'],\n                    $tokenData['refreshToken'],\n                    isset($tokenData['clientId']) ? $tokenData['clientId'] : null,\n                    isset($tokenData['clientSecret']) ? $tokenData['clientSecret'] : null,\n                    isset($tokenData['registrationExpiresAt']) ? $tokenData['registrationExpiresAt'] : null,\n                    isset($tokenData['region']) ? $tokenData['region'] : null,\n                    isset($tokenData['startUrl']) ? $tokenData['startUrl'] : null                );\n\n                $this->writeNewTokenDataToDisk($tokenData, $tokenLocation);\n\n                return $token;\n            }\n        }\n    }\n\n    public function shouldAttemptRefresh()\n    {\n        $tokenLocation = self::getTokenLocation($this->ssoProfileName);\n        $tokenData = $this->getTokenData($tokenLocation);\n        return strtotime(\"-10 minutes\") >= strtotime($tokenData['expiresAt']);\n    }\n\n    /**\n     * @param $sso_session\n     * @return string\n     */\n    public static function getTokenLocation($sso_session)\n    {\n        return self::getHomeDir()\n            . '/.aws/sso/cache/'\n            . mb_convert_encoding(sha1($sso_session), \"UTF-8\")\n            . \".json\";\n    }\n\n    /**\n     * @param $tokenLocation\n     * @return array\n     */\n    function getTokenData($tokenLocation)\n    {\n        return json_decode(file_get_contents($tokenLocation), true);\n    }\n\n    /**\n     * @param $tokenData\n     * @param $tokenLocation\n     * @return mixed\n     */\n    private function validateTokenData($tokenLocation, $tokenData)\n    {\n        if (empty($tokenData['accessToken']) || empty($tokenData['expiresAt'])) {\n            throw new TokenException(\n                \"Token file at {$tokenLocation} must contain an access token and an expiration\"\n            );\n        }\n\n        $expiration = strtotime($tokenData['expiresAt']);\n        if ($expiration === false) {\n            throw new TokenException(\"Cached SSO token returned an invalid expiration\");\n        } elseif ($expiration < time()) {\n            throw new TokenException(\"Cached SSO token returned an expired token\");\n        }\n        return $tokenData;\n    }\n\n    /**\n     * @param array $tokenData\n     * @param string $tokenLocation\n     * @return void\n     */\n    private function writeNewTokenDataToDisk(array $tokenData, $tokenLocation)\n    {\n        $tokenData['expiresAt'] = gmdate(\n            'Y-m-d\\TH:i:s\\Z',\n            $tokenData['expiresAt']\n        );\n        file_put_contents($tokenLocation, json_encode(array_filter($tokenData)));\n    }\n}\n", "num_lines": 210}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Token;\n\nuse Aws\\Token\\TokenInterface;\n\n/**\n * Basic implementation of the AWS Token interface that allows callers to\n * pass in an AWS token in the constructor.\n */\nclass Token implements TokenInterface, \\Serializable\n{\n    protected $token;\n    protected $expires;\n\n    /**\n     * Constructs a new basic token object, with the specified AWS\n     * token\n     *\n     * @param string $token   Security token to use\n     * @param int    $expires UNIX timestamp for when the token expires\n     */\n    public function __construct($token, $expires = null)\n    {\n        $this->token = $token;\n        $this->expires = $expires;\n    }\n\n    /**\n     * Sets the state of a token object\n     *\n     * @param array $state   array containing 'token' and 'expires'\n     */\n    public static function __set_state(array $state)\n    {\n        return new self(\n            $state['token'],\n            $state['expires']\n        );\n    }\n\n    /**\n     * @return string\n     */\n    public function getToken()\n    {\n        return $this->token;\n    }\n\n    /**\n     * @return int\n     */\n    public function getExpiration()\n    {\n        return $this->expires;\n    }\n\n    /**\n     * @return bool\n     */\n    public function isExpired()\n    {\n        return $this->expires !== null && time() >= $this->expires;\n    }\n\n    /**\n     * @return array\n     */\n    public function toArray()\n    {\n        return [\n            'token'   => $this->token,\n            'expires' => $this->expires\n        ];\n    }\n\n    /**\n     * @return string\n     */\n    public function serialize()\n    {\n        return json_encode($this->__serialize());\n    }\n\n    /**\n     * Sets the state of the object from serialized json data\n     */\n    public function unserialize($serialized)\n    {\n        $data = json_decode($serialized, true);\n\n        $this->__unserialize($data);\n    }\n\n    /**\n     * @return array\n     */\n    public function __serialize()\n    {\n        return $this->toArray();\n    }\n\n    /**\n     *  Sets the state of this object from an array\n     */\n    public function __unserialize($data)\n    {\n        $this->token = $data['token'];\n        $this->expires = $data['expires'];\n    }\n}\n", "num_lines": 111}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Token;\n\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Interface used to provide interchangeable strategies for adding authorization\n * to requests using the various AWS signature protocols.\n */\ninterface TokenAuthorization\n{\n    /**\n     * Adds the specified token to a request by adding the required headers.\n     *\n     * @param RequestInterface     $request     Request to sign\n     * @param TokenInterface       $token       Token\n     *\n     * @return RequestInterface Returns the modified request.\n     */\n    public function authorizeRequest(\n        RequestInterface $request,\n        TokenInterface $token\n    );\n}\n", "num_lines": 25}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Token;\n\n/**\n * Provides access to an AWS token used for accessing AWS services\n */\ninterface TokenInterface\n{\n    /**\n     * Returns the token this token object.\n     *\n     * @return string\n     */\n    public function getToken();\n\n    /**\n     * Get the UNIX timestamp in which the token will expire\n     *\n     * @return int|null\n     */\n    public function getExpiration();\n\n    /**\n     * Check if the token are expired\n     *\n     * @return bool\n     */\n    public function isExpired();\n\n    /**\n     * Converts the token to an associative array.\n     *\n     * @return array\n     */\n    public function toArray();\n}\n", "num_lines": 37}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Token;\n\nuse Aws;\nuse Aws\\Api\\DateTimeResult;\nuse Aws\\CacheInterface;\nuse Aws\\Exception\\TokenException;\nuse GuzzleHttp\\Promise;\n\n/**\n * Token providers are functions that accept no arguments and return a\n * promise that is fulfilled with an {@see \\Aws\\Token\\TokenInterface}\n * or rejected with an {@see \\Aws\\Exception\\TokenException}.\n *\n * <code>\n * use Aws\\Token\\TokenProvider;\n * $provider = TokenProvider::defaultProvider();\n * // Returns a TokenInterface or throws.\n * $token = $provider()->wait();\n * </code>\n *\n * Token providers can be composed to create a token using conditional\n * logic that can create different tokens in different environments. You\n * can compose multiple providers into a single provider using\n * {@see Aws\\Token\\TokenProvider::chain}. This function accepts\n * providers as variadic arguments and returns a new function that will invoke\n * each provider until a token is successfully returned.\n */\nclass TokenProvider\n{\n    use ParsesIniTrait;\n    const ENV_PROFILE = 'AWS_PROFILE';\n\n    /**\n     * Create a default token provider tha checks for cached a SSO token from\n     * the CLI\n     *\n     * This provider is automatically wrapped in a memoize function that caches\n     * previously provided tokens.\n     *\n     * @param array $config Optional array of token provider options.\n     *\n     * @return callable\n     */\n    public static function defaultProvider(array $config = [])\n    {\n\n        $cacheable = [\n            'sso',\n        ];\n\n        $defaultChain = [];\n\n        if (\n            !isset($config['use_aws_shared_config_files'])\n            || $config['use_aws_shared_config_files'] !== false\n        ) {\n            $profileName = getenv(self::ENV_PROFILE) ?: 'default';\n            $defaultChain['sso'] = self::sso(\n                $profileName,\n                self::getHomeDir() . '/.aws/config',\n                $config\n            );\n        }\n\n        if (isset($config['token'])\n            && $config['token'] instanceof CacheInterface\n        ) {\n            foreach ($cacheable as $provider) {\n                if (isset($defaultChain[$provider])) {\n                    $defaultChain[$provider] = self::cache(\n                        $defaultChain[$provider],\n                        $config['token'],\n                        'aws_cached_' . $provider . '_token'\n                    );\n                }\n            }\n        }\n\n        return self::memoize(\n            call_user_func_array(\n                [TokenProvider::class, 'chain'],\n                array_values($defaultChain)\n            )\n        );\n    }\n\n    /**\n     * Create a token provider function from a static token.\n     *\n     * @param TokenInterface $token\n     *\n     * @return callable\n     */\n    public static function fromToken(TokenInterface $token)\n    {\n        $promise = Promise\\Create::promiseFor($token);\n\n        return function () use ($promise) {\n            return $promise;\n        };\n    }\n\n    /**\n     * Creates an aggregate token provider that invokes the provided\n     * variadic providers one after the other until a provider returns\n     * a token.\n     *\n     * @return callable\n     */\n    public static function chain()\n    {\n        $links = func_get_args();\n        //Common use case for when aws_shared_config_files is false\n        if (empty($links)) {\n            return function () {\n                return Promise\\Create::promiseFor(false);\n            };\n        }\n\n        return function () use ($links) {\n            /** @var callable $parent */\n            $parent = array_shift($links);\n            $promise = $parent();\n            while ($next = array_shift($links)) {\n                $promise = $promise->otherwise($next);\n            }\n            return $promise;\n        };\n    }\n\n    /**\n     * Wraps a token provider and caches a previously provided token.\n     * Ensures that cached tokens are refreshed when they expire.\n     *\n     * @param callable $provider Token provider function to wrap.\n     * @return callable\n     */\n    public static function memoize(callable $provider)\n    {\n        return function () use ($provider) {\n            static $result;\n            static $isConstant;\n\n            // Constant tokens will be returned constantly.\n            if ($isConstant) {\n                return $result;\n            }\n\n            // Create the initial promise that will be used as the cached value\n            // until it expires.\n            if (null === $result) {\n                $result = $provider();\n            }\n\n            // Return a token that could expire and refresh when needed.\n            return $result\n                ->then(function (TokenInterface $token) use ($provider, &$isConstant, &$result) {\n                    // Determine if the token is constant.\n                    if (!$token->getExpiration()) {\n                        $isConstant = true;\n                        return $token;\n                    }\n\n                    if (!$token->isExpired()) {\n                        return $token;\n                    }\n                    return $result = $provider();\n                })\n                ->otherwise(function($reason) use (&$result) {\n                    // Cleanup rejected promise.\n                    $result = null;\n                    return Promise\\Create::promiseFor(null);\n                });\n        };\n    }\n\n    /**\n     * Wraps a token provider and saves provided token in an\n     * instance of Aws\\CacheInterface. Forwards calls when no token found\n     * in cache and updates cache with the results.\n     *\n     * @param callable $provider Token provider function to wrap\n     * @param CacheInterface $cache Cache to store the token\n     * @param string|null $cacheKey (optional) Cache key to use\n     *\n     * @return callable\n     */\n    public static function cache(\n        callable $provider,\n        CacheInterface $cache,\n        $cacheKey = null\n    ) {\n        $cacheKey = $cacheKey ?: 'aws_cached_token';\n\n        return function () use ($provider, $cache, $cacheKey) {\n            $found = $cache->get($cacheKey);\n            if (is_array($found) && isset($found['token'])) {\n                if (isset($found['token']) && $found['token'] instanceof TokenInterface) {\n                    $foundToken = $found['token'];\n                    if (!$foundToken->isExpired()) {\n                        return Promise\\Create::promiseFor($foundToken);\n                    }\n                    if (isset($found['refreshMethod']) && is_callable($found['refreshMethod'])) {\n                        return Promise\\Create::promiseFor($found['refreshMethod']());\n                    }\n                }\n            }\n\n            return $provider()\n                ->then(function (TokenInterface $token) use (\n                    $cache,\n                    $cacheKey\n                ) {\n                    $cache->set(\n                        $cacheKey,\n                        $token,\n                        null === $token->getExpiration() ?\n                            0 : $token->getExpiration() - time()\n                    );\n\n                    return $token;\n                });\n        };\n    }\n\n    /**\n     * Gets profiles from the ~/.aws/config ini file\n     */\n    private static function loadDefaultProfiles() {\n        $profiles = [];\n        $configFile = self::getHomeDir() . '/.aws/config';\n\n        if (file_exists($configFile)) {\n            $configProfileData = \\Aws\\parse_ini_file($configFile, true, INI_SCANNER_RAW);\n            foreach ($configProfileData as $name => $profile) {\n                // standardize config profile names\n                $name = str_replace('profile ', '', $name);\n                if (!isset($profiles[$name])) {\n                    $profiles[$name] = $profile;\n                }\n            }\n        }\n\n        return $profiles;\n    }\n\n    private static function reject($msg)\n    {\n        return new Promise\\RejectedPromise(new TokenException($msg));\n    }\n\n    /**\n     * Token provider that creates a token from cached sso credentials\n     *\n     * @param string $ssoProfileName the name of the ini profile name\n     * @param string $filename the location of the ini file\n     * @param array $config configuration options\n     *\n     * @return SsoToken\n     * @see Aws\\Token\\SsoToken for $config details.\n     */\n    public static function sso($profileName, $filename, $config = [])\n    {\n        return new SsoTokenProvider($profileName, $filename, $config);\n    }\n}\n\n", "num_lines": 269}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\TranscribeService;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Transcribe Service** service.\n * @method \\Aws\\Result createCallAnalyticsCategory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCallAnalyticsCategoryAsync(array $args = [])\n * @method \\Aws\\Result createLanguageModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLanguageModelAsync(array $args = [])\n * @method \\Aws\\Result createMedicalVocabulary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMedicalVocabularyAsync(array $args = [])\n * @method \\Aws\\Result createVocabulary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVocabularyAsync(array $args = [])\n * @method \\Aws\\Result createVocabularyFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createVocabularyFilterAsync(array $args = [])\n * @method \\Aws\\Result deleteCallAnalyticsCategory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCallAnalyticsCategoryAsync(array $args = [])\n * @method \\Aws\\Result deleteCallAnalyticsJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCallAnalyticsJobAsync(array $args = [])\n * @method \\Aws\\Result deleteLanguageModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLanguageModelAsync(array $args = [])\n * @method \\Aws\\Result deleteMedicalTranscriptionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMedicalTranscriptionJobAsync(array $args = [])\n * @method \\Aws\\Result deleteMedicalVocabulary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMedicalVocabularyAsync(array $args = [])\n * @method \\Aws\\Result deleteTranscriptionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTranscriptionJobAsync(array $args = [])\n * @method \\Aws\\Result deleteVocabulary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVocabularyAsync(array $args = [])\n * @method \\Aws\\Result deleteVocabularyFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteVocabularyFilterAsync(array $args = [])\n * @method \\Aws\\Result describeLanguageModel(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeLanguageModelAsync(array $args = [])\n * @method \\Aws\\Result getCallAnalyticsCategory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCallAnalyticsCategoryAsync(array $args = [])\n * @method \\Aws\\Result getCallAnalyticsJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCallAnalyticsJobAsync(array $args = [])\n * @method \\Aws\\Result getMedicalTranscriptionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMedicalTranscriptionJobAsync(array $args = [])\n * @method \\Aws\\Result getMedicalVocabulary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMedicalVocabularyAsync(array $args = [])\n * @method \\Aws\\Result getTranscriptionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTranscriptionJobAsync(array $args = [])\n * @method \\Aws\\Result getVocabulary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVocabularyAsync(array $args = [])\n * @method \\Aws\\Result getVocabularyFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getVocabularyFilterAsync(array $args = [])\n * @method \\Aws\\Result listCallAnalyticsCategories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCallAnalyticsCategoriesAsync(array $args = [])\n * @method \\Aws\\Result listCallAnalyticsJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCallAnalyticsJobsAsync(array $args = [])\n * @method \\Aws\\Result listLanguageModels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLanguageModelsAsync(array $args = [])\n * @method \\Aws\\Result listMedicalTranscriptionJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMedicalTranscriptionJobsAsync(array $args = [])\n * @method \\Aws\\Result listMedicalVocabularies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMedicalVocabulariesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTranscriptionJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTranscriptionJobsAsync(array $args = [])\n * @method \\Aws\\Result listVocabularies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVocabulariesAsync(array $args = [])\n * @method \\Aws\\Result listVocabularyFilters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listVocabularyFiltersAsync(array $args = [])\n * @method \\Aws\\Result startCallAnalyticsJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startCallAnalyticsJobAsync(array $args = [])\n * @method \\Aws\\Result startMedicalTranscriptionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMedicalTranscriptionJobAsync(array $args = [])\n * @method \\Aws\\Result startTranscriptionJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startTranscriptionJobAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateCallAnalyticsCategory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCallAnalyticsCategoryAsync(array $args = [])\n * @method \\Aws\\Result updateMedicalVocabulary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMedicalVocabularyAsync(array $args = [])\n * @method \\Aws\\Result updateVocabulary(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVocabularyAsync(array $args = [])\n * @method \\Aws\\Result updateVocabularyFilter(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateVocabularyFilterAsync(array $args = [])\n */\nclass TranscribeServiceClient extends AwsClient {}\n", "num_lines": 88}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\TranscribeService\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Transcribe Service** service.\n */\nclass TranscribeServiceException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Transfer;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Transfer for SFTP** service.\n * @method \\Aws\\Result createAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccessAsync(array $args = [])\n * @method \\Aws\\Result createAgreement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAgreementAsync(array $args = [])\n * @method \\Aws\\Result createConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConnectorAsync(array $args = [])\n * @method \\Aws\\Result createProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProfileAsync(array $args = [])\n * @method \\Aws\\Result createServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServerAsync(array $args = [])\n * @method \\Aws\\Result createUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserAsync(array $args = [])\n * @method \\Aws\\Result createWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkflowAsync(array $args = [])\n * @method \\Aws\\Result deleteAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccessAsync(array $args = [])\n * @method \\Aws\\Result deleteAgreement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAgreementAsync(array $args = [])\n * @method \\Aws\\Result deleteCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCertificateAsync(array $args = [])\n * @method \\Aws\\Result deleteConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectorAsync(array $args = [])\n * @method \\Aws\\Result deleteHostKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteHostKeyAsync(array $args = [])\n * @method \\Aws\\Result deleteProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServerAsync(array $args = [])\n * @method \\Aws\\Result deleteSshPublicKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSshPublicKeyAsync(array $args = [])\n * @method \\Aws\\Result deleteUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkflowAsync(array $args = [])\n * @method \\Aws\\Result describeAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccessAsync(array $args = [])\n * @method \\Aws\\Result describeAgreement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAgreementAsync(array $args = [])\n * @method \\Aws\\Result describeCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCertificateAsync(array $args = [])\n * @method \\Aws\\Result describeConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConnectorAsync(array $args = [])\n * @method \\Aws\\Result describeExecution(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeExecutionAsync(array $args = [])\n * @method \\Aws\\Result describeHostKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeHostKeyAsync(array $args = [])\n * @method \\Aws\\Result describeProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeProfileAsync(array $args = [])\n * @method \\Aws\\Result describeSecurityPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSecurityPolicyAsync(array $args = [])\n * @method \\Aws\\Result describeServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeServerAsync(array $args = [])\n * @method \\Aws\\Result describeUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserAsync(array $args = [])\n * @method \\Aws\\Result describeWorkflow(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkflowAsync(array $args = [])\n * @method \\Aws\\Result importCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importCertificateAsync(array $args = [])\n * @method \\Aws\\Result importHostKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importHostKeyAsync(array $args = [])\n * @method \\Aws\\Result importSshPublicKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importSshPublicKeyAsync(array $args = [])\n * @method \\Aws\\Result listAccesses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccessesAsync(array $args = [])\n * @method \\Aws\\Result listAgreements(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAgreementsAsync(array $args = [])\n * @method \\Aws\\Result listCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCertificatesAsync(array $args = [])\n * @method \\Aws\\Result listConnectors(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listConnectorsAsync(array $args = [])\n * @method \\Aws\\Result listExecutions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listExecutionsAsync(array $args = [])\n * @method \\Aws\\Result listHostKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listHostKeysAsync(array $args = [])\n * @method \\Aws\\Result listProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProfilesAsync(array $args = [])\n * @method \\Aws\\Result listSecurityPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSecurityPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listServers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServersAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUsersAsync(array $args = [])\n * @method \\Aws\\Result listWorkflows(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkflowsAsync(array $args = [])\n * @method \\Aws\\Result sendWorkflowStepState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise sendWorkflowStepStateAsync(array $args = [])\n * @method \\Aws\\Result startFileTransfer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startFileTransferAsync(array $args = [])\n * @method \\Aws\\Result startServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startServerAsync(array $args = [])\n * @method \\Aws\\Result stopServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopServerAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result testIdentityProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testIdentityProviderAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccessAsync(array $args = [])\n * @method \\Aws\\Result updateAgreement(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAgreementAsync(array $args = [])\n * @method \\Aws\\Result updateCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCertificateAsync(array $args = [])\n * @method \\Aws\\Result updateConnector(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConnectorAsync(array $args = [])\n * @method \\Aws\\Result updateHostKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateHostKeyAsync(array $args = [])\n * @method \\Aws\\Result updateProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProfileAsync(array $args = [])\n * @method \\Aws\\Result updateServer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServerAsync(array $args = [])\n * @method \\Aws\\Result updateUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserAsync(array $args = [])\n */\nclass TransferClient extends AwsClient {}\n", "num_lines": 126}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Transfer\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Transfer for SFTP** service.\n */\nclass TransferException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Translate;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Translate** service.\n * @method \\Aws\\Result createParallelData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createParallelDataAsync(array $args = [])\n * @method \\Aws\\Result deleteParallelData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteParallelDataAsync(array $args = [])\n * @method \\Aws\\Result deleteTerminology(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTerminologyAsync(array $args = [])\n * @method \\Aws\\Result describeTextTranslationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTextTranslationJobAsync(array $args = [])\n * @method \\Aws\\Result getParallelData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getParallelDataAsync(array $args = [])\n * @method \\Aws\\Result getTerminology(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTerminologyAsync(array $args = [])\n * @method \\Aws\\Result importTerminology(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importTerminologyAsync(array $args = [])\n * @method \\Aws\\Result listLanguages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLanguagesAsync(array $args = [])\n * @method \\Aws\\Result listParallelData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listParallelDataAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTerminologies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTerminologiesAsync(array $args = [])\n * @method \\Aws\\Result listTextTranslationJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTextTranslationJobsAsync(array $args = [])\n * @method \\Aws\\Result startTextTranslationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startTextTranslationJobAsync(array $args = [])\n * @method \\Aws\\Result stopTextTranslationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopTextTranslationJobAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result translateDocument(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise translateDocumentAsync(array $args = [])\n * @method \\Aws\\Result translateText(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise translateTextAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateParallelData(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateParallelDataAsync(array $args = [])\n */\nclass TranslateClient extends AwsClient {}\n", "num_lines": 48}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Translate\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Translate** service.\n */\nclass TranslateException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\VerifiedPermissions;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Verified Permissions** service.\n * @method \\Aws\\Result createIdentitySource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIdentitySourceAsync(array $args = [])\n * @method \\Aws\\Result createPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPolicyAsync(array $args = [])\n * @method \\Aws\\Result createPolicyStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPolicyStoreAsync(array $args = [])\n * @method \\Aws\\Result createPolicyTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPolicyTemplateAsync(array $args = [])\n * @method \\Aws\\Result deleteIdentitySource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIdentitySourceAsync(array $args = [])\n * @method \\Aws\\Result deletePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePolicyAsync(array $args = [])\n * @method \\Aws\\Result deletePolicyStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePolicyStoreAsync(array $args = [])\n * @method \\Aws\\Result deletePolicyTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePolicyTemplateAsync(array $args = [])\n * @method \\Aws\\Result getIdentitySource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIdentitySourceAsync(array $args = [])\n * @method \\Aws\\Result getPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPolicyAsync(array $args = [])\n * @method \\Aws\\Result getPolicyStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPolicyStoreAsync(array $args = [])\n * @method \\Aws\\Result getPolicyTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPolicyTemplateAsync(array $args = [])\n * @method \\Aws\\Result getSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSchemaAsync(array $args = [])\n * @method \\Aws\\Result isAuthorized(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise isAuthorizedAsync(array $args = [])\n * @method \\Aws\\Result isAuthorizedWithToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise isAuthorizedWithTokenAsync(array $args = [])\n * @method \\Aws\\Result listIdentitySources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIdentitySourcesAsync(array $args = [])\n * @method \\Aws\\Result listPolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPoliciesAsync(array $args = [])\n * @method \\Aws\\Result listPolicyStores(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPolicyStoresAsync(array $args = [])\n * @method \\Aws\\Result listPolicyTemplates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPolicyTemplatesAsync(array $args = [])\n * @method \\Aws\\Result putSchema(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putSchemaAsync(array $args = [])\n * @method \\Aws\\Result updateIdentitySource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIdentitySourceAsync(array $args = [])\n * @method \\Aws\\Result updatePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePolicyAsync(array $args = [])\n * @method \\Aws\\Result updatePolicyStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePolicyStoreAsync(array $args = [])\n * @method \\Aws\\Result updatePolicyTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePolicyTemplateAsync(array $args = [])\n */\nclass VerifiedPermissionsClient extends AwsClient {}\n", "num_lines": 58}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\VerifiedPermissions\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Verified Permissions** service.\n */\nclass VerifiedPermissionsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\VoiceID;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon Voice ID** service.\n * @method \\Aws\\Result associateFraudster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateFraudsterAsync(array $args = [])\n * @method \\Aws\\Result createDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDomainAsync(array $args = [])\n * @method \\Aws\\Result createWatchlist(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWatchlistAsync(array $args = [])\n * @method \\Aws\\Result deleteDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainAsync(array $args = [])\n * @method \\Aws\\Result deleteFraudster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFraudsterAsync(array $args = [])\n * @method \\Aws\\Result deleteSpeaker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSpeakerAsync(array $args = [])\n * @method \\Aws\\Result deleteWatchlist(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWatchlistAsync(array $args = [])\n * @method \\Aws\\Result describeDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainAsync(array $args = [])\n * @method \\Aws\\Result describeFraudster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFraudsterAsync(array $args = [])\n * @method \\Aws\\Result describeFraudsterRegistrationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFraudsterRegistrationJobAsync(array $args = [])\n * @method \\Aws\\Result describeSpeaker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSpeakerAsync(array $args = [])\n * @method \\Aws\\Result describeSpeakerEnrollmentJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeSpeakerEnrollmentJobAsync(array $args = [])\n * @method \\Aws\\Result describeWatchlist(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWatchlistAsync(array $args = [])\n * @method \\Aws\\Result disassociateFraudster(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateFraudsterAsync(array $args = [])\n * @method \\Aws\\Result evaluateSession(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise evaluateSessionAsync(array $args = [])\n * @method \\Aws\\Result listDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainsAsync(array $args = [])\n * @method \\Aws\\Result listFraudsterRegistrationJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFraudsterRegistrationJobsAsync(array $args = [])\n * @method \\Aws\\Result listFraudsters(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFraudstersAsync(array $args = [])\n * @method \\Aws\\Result listSpeakerEnrollmentJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSpeakerEnrollmentJobsAsync(array $args = [])\n * @method \\Aws\\Result listSpeakers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSpeakersAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWatchlists(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWatchlistsAsync(array $args = [])\n * @method \\Aws\\Result optOutSpeaker(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise optOutSpeakerAsync(array $args = [])\n * @method \\Aws\\Result startFraudsterRegistrationJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startFraudsterRegistrationJobAsync(array $args = [])\n * @method \\Aws\\Result startSpeakerEnrollmentJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startSpeakerEnrollmentJobAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDomainAsync(array $args = [])\n * @method \\Aws\\Result updateWatchlist(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWatchlistAsync(array $args = [])\n */\nclass VoiceIDClient extends AwsClient {}\n", "num_lines": 68}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\VoiceID\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon Voice ID** service.\n */\nclass VoiceIDException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\VPCLattice;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon VPC Lattice** service.\n * @method \\Aws\\Result batchUpdateRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchUpdateRuleAsync(array $args = [])\n * @method \\Aws\\Result createAccessLogSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAccessLogSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result createListener(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createListenerAsync(array $args = [])\n * @method \\Aws\\Result createRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRuleAsync(array $args = [])\n * @method \\Aws\\Result createService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceAsync(array $args = [])\n * @method \\Aws\\Result createServiceNetwork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceNetworkAsync(array $args = [])\n * @method \\Aws\\Result createServiceNetworkServiceAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceNetworkServiceAssociationAsync(array $args = [])\n * @method \\Aws\\Result createServiceNetworkVpcAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createServiceNetworkVpcAssociationAsync(array $args = [])\n * @method \\Aws\\Result createTargetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTargetGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteAccessLogSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccessLogSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result deleteAuthPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAuthPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteListener(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteListenerAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceAsync(array $args = [])\n * @method \\Aws\\Result deleteServiceNetwork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceNetworkAsync(array $args = [])\n * @method \\Aws\\Result deleteServiceNetworkServiceAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceNetworkServiceAssociationAsync(array $args = [])\n * @method \\Aws\\Result deleteServiceNetworkVpcAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteServiceNetworkVpcAssociationAsync(array $args = [])\n * @method \\Aws\\Result deleteTargetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTargetGroupAsync(array $args = [])\n * @method \\Aws\\Result deregisterTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterTargetsAsync(array $args = [])\n * @method \\Aws\\Result getAccessLogSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccessLogSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result getAuthPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAuthPolicyAsync(array $args = [])\n * @method \\Aws\\Result getListener(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getListenerAsync(array $args = [])\n * @method \\Aws\\Result getResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result getRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRuleAsync(array $args = [])\n * @method \\Aws\\Result getService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceAsync(array $args = [])\n * @method \\Aws\\Result getServiceNetwork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceNetworkAsync(array $args = [])\n * @method \\Aws\\Result getServiceNetworkServiceAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceNetworkServiceAssociationAsync(array $args = [])\n * @method \\Aws\\Result getServiceNetworkVpcAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceNetworkVpcAssociationAsync(array $args = [])\n * @method \\Aws\\Result getTargetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTargetGroupAsync(array $args = [])\n * @method \\Aws\\Result listAccessLogSubscriptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccessLogSubscriptionsAsync(array $args = [])\n * @method \\Aws\\Result listListeners(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listListenersAsync(array $args = [])\n * @method \\Aws\\Result listRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRulesAsync(array $args = [])\n * @method \\Aws\\Result listServiceNetworkServiceAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServiceNetworkServiceAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listServiceNetworkVpcAssociations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServiceNetworkVpcAssociationsAsync(array $args = [])\n * @method \\Aws\\Result listServiceNetworks(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServiceNetworksAsync(array $args = [])\n * @method \\Aws\\Result listServices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listServicesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTargetGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTargetGroupsAsync(array $args = [])\n * @method \\Aws\\Result listTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTargetsAsync(array $args = [])\n * @method \\Aws\\Result putAuthPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAuthPolicyAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result registerTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerTargetsAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAccessLogSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAccessLogSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result updateListener(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateListenerAsync(array $args = [])\n * @method \\Aws\\Result updateRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRuleAsync(array $args = [])\n * @method \\Aws\\Result updateService(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceAsync(array $args = [])\n * @method \\Aws\\Result updateServiceNetwork(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceNetworkAsync(array $args = [])\n * @method \\Aws\\Result updateServiceNetworkVpcAssociation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateServiceNetworkVpcAssociationAsync(array $args = [])\n * @method \\Aws\\Result updateTargetGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTargetGroupAsync(array $args = [])\n */\nclass VPCLatticeClient extends AwsClient {}\n", "num_lines": 114}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\VPCLattice\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon VPC Lattice** service.\n */\nclass VPCLatticeException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Waf;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS WAF** service.\n *\n * @method \\Aws\\Result createByteMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createByteMatchSetAsync(array $args = [])\n * @method \\Aws\\Result createGeoMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGeoMatchSetAsync(array $args = [])\n * @method \\Aws\\Result createIPSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIPSetAsync(array $args = [])\n * @method \\Aws\\Result createRateBasedRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRateBasedRuleAsync(array $args = [])\n * @method \\Aws\\Result createRegexMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRegexMatchSetAsync(array $args = [])\n * @method \\Aws\\Result createRegexPatternSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRegexPatternSetAsync(array $args = [])\n * @method \\Aws\\Result createRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRuleAsync(array $args = [])\n * @method \\Aws\\Result createRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result createSizeConstraintSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSizeConstraintSetAsync(array $args = [])\n * @method \\Aws\\Result createSqlInjectionMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSqlInjectionMatchSetAsync(array $args = [])\n * @method \\Aws\\Result createWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWebACLAsync(array $args = [])\n * @method \\Aws\\Result createWebACLMigrationStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWebACLMigrationStackAsync(array $args = [])\n * @method \\Aws\\Result createXssMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createXssMatchSetAsync(array $args = [])\n * @method \\Aws\\Result deleteByteMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteByteMatchSetAsync(array $args = [])\n * @method \\Aws\\Result deleteGeoMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGeoMatchSetAsync(array $args = [])\n * @method \\Aws\\Result deleteIPSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIPSetAsync(array $args = [])\n * @method \\Aws\\Result deleteLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deletePermissionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePermissionPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteRateBasedRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRateBasedRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteRegexMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRegexMatchSetAsync(array $args = [])\n * @method \\Aws\\Result deleteRegexPatternSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRegexPatternSetAsync(array $args = [])\n * @method \\Aws\\Result deleteRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteSizeConstraintSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSizeConstraintSetAsync(array $args = [])\n * @method \\Aws\\Result deleteSqlInjectionMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSqlInjectionMatchSetAsync(array $args = [])\n * @method \\Aws\\Result deleteWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWebACLAsync(array $args = [])\n * @method \\Aws\\Result deleteXssMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteXssMatchSetAsync(array $args = [])\n * @method \\Aws\\Result getByteMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getByteMatchSetAsync(array $args = [])\n * @method \\Aws\\Result getChangeToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChangeTokenAsync(array $args = [])\n * @method \\Aws\\Result getChangeTokenStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChangeTokenStatusAsync(array $args = [])\n * @method \\Aws\\Result getGeoMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGeoMatchSetAsync(array $args = [])\n * @method \\Aws\\Result getIPSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIPSetAsync(array $args = [])\n * @method \\Aws\\Result getLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getPermissionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPermissionPolicyAsync(array $args = [])\n * @method \\Aws\\Result getRateBasedRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRateBasedRuleAsync(array $args = [])\n * @method \\Aws\\Result getRateBasedRuleManagedKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRateBasedRuleManagedKeysAsync(array $args = [])\n * @method \\Aws\\Result getRegexMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRegexMatchSetAsync(array $args = [])\n * @method \\Aws\\Result getRegexPatternSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRegexPatternSetAsync(array $args = [])\n * @method \\Aws\\Result getRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRuleAsync(array $args = [])\n * @method \\Aws\\Result getRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result getSampledRequests(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSampledRequestsAsync(array $args = [])\n * @method \\Aws\\Result getSizeConstraintSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSizeConstraintSetAsync(array $args = [])\n * @method \\Aws\\Result getSqlInjectionMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSqlInjectionMatchSetAsync(array $args = [])\n * @method \\Aws\\Result getWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWebACLAsync(array $args = [])\n * @method \\Aws\\Result getXssMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getXssMatchSetAsync(array $args = [])\n * @method \\Aws\\Result listActivatedRulesInRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listActivatedRulesInRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result listByteMatchSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listByteMatchSetsAsync(array $args = [])\n * @method \\Aws\\Result listGeoMatchSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGeoMatchSetsAsync(array $args = [])\n * @method \\Aws\\Result listIPSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIPSetsAsync(array $args = [])\n * @method \\Aws\\Result listLoggingConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLoggingConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listRateBasedRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRateBasedRulesAsync(array $args = [])\n * @method \\Aws\\Result listRegexMatchSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRegexMatchSetsAsync(array $args = [])\n * @method \\Aws\\Result listRegexPatternSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRegexPatternSetsAsync(array $args = [])\n * @method \\Aws\\Result listRuleGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRuleGroupsAsync(array $args = [])\n * @method \\Aws\\Result listRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRulesAsync(array $args = [])\n * @method \\Aws\\Result listSizeConstraintSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSizeConstraintSetsAsync(array $args = [])\n * @method \\Aws\\Result listSqlInjectionMatchSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSqlInjectionMatchSetsAsync(array $args = [])\n * @method \\Aws\\Result listSubscribedRuleGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSubscribedRuleGroupsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWebACLs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWebACLsAsync(array $args = [])\n * @method \\Aws\\Result listXssMatchSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listXssMatchSetsAsync(array $args = [])\n * @method \\Aws\\Result putLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putPermissionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPermissionPolicyAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateByteMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateByteMatchSetAsync(array $args = [])\n * @method \\Aws\\Result updateGeoMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGeoMatchSetAsync(array $args = [])\n * @method \\Aws\\Result updateIPSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIPSetAsync(array $args = [])\n * @method \\Aws\\Result updateRateBasedRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRateBasedRuleAsync(array $args = [])\n * @method \\Aws\\Result updateRegexMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRegexMatchSetAsync(array $args = [])\n * @method \\Aws\\Result updateRegexPatternSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRegexPatternSetAsync(array $args = [])\n * @method \\Aws\\Result updateRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRuleAsync(array $args = [])\n * @method \\Aws\\Result updateRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result updateSizeConstraintSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSizeConstraintSetAsync(array $args = [])\n * @method \\Aws\\Result updateSqlInjectionMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSqlInjectionMatchSetAsync(array $args = [])\n * @method \\Aws\\Result updateWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWebACLAsync(array $args = [])\n * @method \\Aws\\Result updateXssMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateXssMatchSetAsync(array $args = [])\n */\nclass WafClient extends AwsClient {}\n", "num_lines": 165}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Waf\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS WAF** service.\n */\nclass WafException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WafRegional;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS WAF Regional** service.\n * @method \\Aws\\Result associateWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateWebACLAsync(array $args = [])\n * @method \\Aws\\Result createByteMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createByteMatchSetAsync(array $args = [])\n * @method \\Aws\\Result createGeoMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGeoMatchSetAsync(array $args = [])\n * @method \\Aws\\Result createIPSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIPSetAsync(array $args = [])\n * @method \\Aws\\Result createRateBasedRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRateBasedRuleAsync(array $args = [])\n * @method \\Aws\\Result createRegexMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRegexMatchSetAsync(array $args = [])\n * @method \\Aws\\Result createRegexPatternSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRegexPatternSetAsync(array $args = [])\n * @method \\Aws\\Result createRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRuleAsync(array $args = [])\n * @method \\Aws\\Result createRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result createSizeConstraintSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSizeConstraintSetAsync(array $args = [])\n * @method \\Aws\\Result createSqlInjectionMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSqlInjectionMatchSetAsync(array $args = [])\n * @method \\Aws\\Result createWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWebACLAsync(array $args = [])\n * @method \\Aws\\Result createWebACLMigrationStack(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWebACLMigrationStackAsync(array $args = [])\n * @method \\Aws\\Result createXssMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createXssMatchSetAsync(array $args = [])\n * @method \\Aws\\Result deleteByteMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteByteMatchSetAsync(array $args = [])\n * @method \\Aws\\Result deleteGeoMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGeoMatchSetAsync(array $args = [])\n * @method \\Aws\\Result deleteIPSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIPSetAsync(array $args = [])\n * @method \\Aws\\Result deleteLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deletePermissionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePermissionPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteRateBasedRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRateBasedRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteRegexMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRegexMatchSetAsync(array $args = [])\n * @method \\Aws\\Result deleteRegexPatternSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRegexPatternSetAsync(array $args = [])\n * @method \\Aws\\Result deleteRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteSizeConstraintSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSizeConstraintSetAsync(array $args = [])\n * @method \\Aws\\Result deleteSqlInjectionMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSqlInjectionMatchSetAsync(array $args = [])\n * @method \\Aws\\Result deleteWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWebACLAsync(array $args = [])\n * @method \\Aws\\Result deleteXssMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteXssMatchSetAsync(array $args = [])\n * @method \\Aws\\Result disassociateWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateWebACLAsync(array $args = [])\n * @method \\Aws\\Result getByteMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getByteMatchSetAsync(array $args = [])\n * @method \\Aws\\Result getChangeToken(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChangeTokenAsync(array $args = [])\n * @method \\Aws\\Result getChangeTokenStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getChangeTokenStatusAsync(array $args = [])\n * @method \\Aws\\Result getGeoMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGeoMatchSetAsync(array $args = [])\n * @method \\Aws\\Result getIPSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIPSetAsync(array $args = [])\n * @method \\Aws\\Result getLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getPermissionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPermissionPolicyAsync(array $args = [])\n * @method \\Aws\\Result getRateBasedRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRateBasedRuleAsync(array $args = [])\n * @method \\Aws\\Result getRateBasedRuleManagedKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRateBasedRuleManagedKeysAsync(array $args = [])\n * @method \\Aws\\Result getRegexMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRegexMatchSetAsync(array $args = [])\n * @method \\Aws\\Result getRegexPatternSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRegexPatternSetAsync(array $args = [])\n * @method \\Aws\\Result getRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRuleAsync(array $args = [])\n * @method \\Aws\\Result getRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result getSampledRequests(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSampledRequestsAsync(array $args = [])\n * @method \\Aws\\Result getSizeConstraintSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSizeConstraintSetAsync(array $args = [])\n * @method \\Aws\\Result getSqlInjectionMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSqlInjectionMatchSetAsync(array $args = [])\n * @method \\Aws\\Result getWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWebACLAsync(array $args = [])\n * @method \\Aws\\Result getWebACLForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWebACLForResourceAsync(array $args = [])\n * @method \\Aws\\Result getXssMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getXssMatchSetAsync(array $args = [])\n * @method \\Aws\\Result listActivatedRulesInRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listActivatedRulesInRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result listByteMatchSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listByteMatchSetsAsync(array $args = [])\n * @method \\Aws\\Result listGeoMatchSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGeoMatchSetsAsync(array $args = [])\n * @method \\Aws\\Result listIPSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIPSetsAsync(array $args = [])\n * @method \\Aws\\Result listLoggingConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLoggingConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listRateBasedRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRateBasedRulesAsync(array $args = [])\n * @method \\Aws\\Result listRegexMatchSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRegexMatchSetsAsync(array $args = [])\n * @method \\Aws\\Result listRegexPatternSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRegexPatternSetsAsync(array $args = [])\n * @method \\Aws\\Result listResourcesForWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourcesForWebACLAsync(array $args = [])\n * @method \\Aws\\Result listRuleGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRuleGroupsAsync(array $args = [])\n * @method \\Aws\\Result listRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRulesAsync(array $args = [])\n * @method \\Aws\\Result listSizeConstraintSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSizeConstraintSetsAsync(array $args = [])\n * @method \\Aws\\Result listSqlInjectionMatchSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSqlInjectionMatchSetsAsync(array $args = [])\n * @method \\Aws\\Result listSubscribedRuleGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listSubscribedRuleGroupsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWebACLs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWebACLsAsync(array $args = [])\n * @method \\Aws\\Result listXssMatchSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listXssMatchSetsAsync(array $args = [])\n * @method \\Aws\\Result putLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putPermissionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPermissionPolicyAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateByteMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateByteMatchSetAsync(array $args = [])\n * @method \\Aws\\Result updateGeoMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGeoMatchSetAsync(array $args = [])\n * @method \\Aws\\Result updateIPSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIPSetAsync(array $args = [])\n * @method \\Aws\\Result updateRateBasedRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRateBasedRuleAsync(array $args = [])\n * @method \\Aws\\Result updateRegexMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRegexMatchSetAsync(array $args = [])\n * @method \\Aws\\Result updateRegexPatternSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRegexPatternSetAsync(array $args = [])\n * @method \\Aws\\Result updateRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRuleAsync(array $args = [])\n * @method \\Aws\\Result updateRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result updateSizeConstraintSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSizeConstraintSetAsync(array $args = [])\n * @method \\Aws\\Result updateSqlInjectionMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSqlInjectionMatchSetAsync(array $args = [])\n * @method \\Aws\\Result updateWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWebACLAsync(array $args = [])\n * @method \\Aws\\Result updateXssMatchSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateXssMatchSetAsync(array $args = [])\n */\nclass WafRegionalClient extends AwsClient {}\n", "num_lines": 172}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WafRegional\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS WAF Regional** service.\n */\nclass WafRegionalException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WAFV2;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS WAFV2** service.\n * @method \\Aws\\Result associateWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateWebACLAsync(array $args = [])\n * @method \\Aws\\Result checkCapacity(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise checkCapacityAsync(array $args = [])\n * @method \\Aws\\Result createAPIKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAPIKeyAsync(array $args = [])\n * @method \\Aws\\Result createIPSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIPSetAsync(array $args = [])\n * @method \\Aws\\Result createRegexPatternSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRegexPatternSetAsync(array $args = [])\n * @method \\Aws\\Result createRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result createWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWebACLAsync(array $args = [])\n * @method \\Aws\\Result deleteFirewallManagerRuleGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFirewallManagerRuleGroupsAsync(array $args = [])\n * @method \\Aws\\Result deleteIPSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIPSetAsync(array $args = [])\n * @method \\Aws\\Result deleteLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deletePermissionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePermissionPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteRegexPatternSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRegexPatternSetAsync(array $args = [])\n * @method \\Aws\\Result deleteRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWebACLAsync(array $args = [])\n * @method \\Aws\\Result describeAllManagedProducts(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAllManagedProductsAsync(array $args = [])\n * @method \\Aws\\Result describeManagedProductsByVendor(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeManagedProductsByVendorAsync(array $args = [])\n * @method \\Aws\\Result describeManagedRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeManagedRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result disassociateWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateWebACLAsync(array $args = [])\n * @method \\Aws\\Result generateMobileSdkReleaseUrl(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise generateMobileSdkReleaseUrlAsync(array $args = [])\n * @method \\Aws\\Result getDecryptedAPIKey(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDecryptedAPIKeyAsync(array $args = [])\n * @method \\Aws\\Result getIPSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIPSetAsync(array $args = [])\n * @method \\Aws\\Result getLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result getManagedRuleSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getManagedRuleSetAsync(array $args = [])\n * @method \\Aws\\Result getMobileSdkRelease(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMobileSdkReleaseAsync(array $args = [])\n * @method \\Aws\\Result getPermissionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPermissionPolicyAsync(array $args = [])\n * @method \\Aws\\Result getRateBasedStatementManagedKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRateBasedStatementManagedKeysAsync(array $args = [])\n * @method \\Aws\\Result getRegexPatternSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRegexPatternSetAsync(array $args = [])\n * @method \\Aws\\Result getRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result getSampledRequests(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSampledRequestsAsync(array $args = [])\n * @method \\Aws\\Result getWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWebACLAsync(array $args = [])\n * @method \\Aws\\Result getWebACLForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWebACLForResourceAsync(array $args = [])\n * @method \\Aws\\Result listAPIKeys(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAPIKeysAsync(array $args = [])\n * @method \\Aws\\Result listAvailableManagedRuleGroupVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAvailableManagedRuleGroupVersionsAsync(array $args = [])\n * @method \\Aws\\Result listAvailableManagedRuleGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAvailableManagedRuleGroupsAsync(array $args = [])\n * @method \\Aws\\Result listIPSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIPSetsAsync(array $args = [])\n * @method \\Aws\\Result listLoggingConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLoggingConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listManagedRuleSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listManagedRuleSetsAsync(array $args = [])\n * @method \\Aws\\Result listMobileSdkReleases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMobileSdkReleasesAsync(array $args = [])\n * @method \\Aws\\Result listRegexPatternSets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRegexPatternSetsAsync(array $args = [])\n * @method \\Aws\\Result listResourcesForWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourcesForWebACLAsync(array $args = [])\n * @method \\Aws\\Result listRuleGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listRuleGroupsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWebACLs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWebACLsAsync(array $args = [])\n * @method \\Aws\\Result putLoggingConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putLoggingConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putManagedRuleSetVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putManagedRuleSetVersionsAsync(array $args = [])\n * @method \\Aws\\Result putPermissionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putPermissionPolicyAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateIPSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIPSetAsync(array $args = [])\n * @method \\Aws\\Result updateManagedRuleSetVersionExpiryDate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateManagedRuleSetVersionExpiryDateAsync(array $args = [])\n * @method \\Aws\\Result updateRegexPatternSet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRegexPatternSetAsync(array $args = [])\n * @method \\Aws\\Result updateRuleGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRuleGroupAsync(array $args = [])\n * @method \\Aws\\Result updateWebACL(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWebACLAsync(array $args = [])\n */\nclass WAFV2Client extends AwsClient {}\n", "num_lines": 116}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WAFV2\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS WAFV2** service.\n */\nclass WAFV2Exception extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WellArchitected;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS Well-Architected Tool** service.\n * @method \\Aws\\Result associateLenses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateLensesAsync(array $args = [])\n * @method \\Aws\\Result associateProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateProfilesAsync(array $args = [])\n * @method \\Aws\\Result createLensShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLensShareAsync(array $args = [])\n * @method \\Aws\\Result createLensVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLensVersionAsync(array $args = [])\n * @method \\Aws\\Result createMilestone(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMilestoneAsync(array $args = [])\n * @method \\Aws\\Result createProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProfileAsync(array $args = [])\n * @method \\Aws\\Result createProfileShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createProfileShareAsync(array $args = [])\n * @method \\Aws\\Result createWorkload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkloadAsync(array $args = [])\n * @method \\Aws\\Result createWorkloadShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkloadShareAsync(array $args = [])\n * @method \\Aws\\Result deleteLens(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLensAsync(array $args = [])\n * @method \\Aws\\Result deleteLensShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLensShareAsync(array $args = [])\n * @method \\Aws\\Result deleteProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProfileAsync(array $args = [])\n * @method \\Aws\\Result deleteProfileShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteProfileShareAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkloadAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkloadShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkloadShareAsync(array $args = [])\n * @method \\Aws\\Result disassociateLenses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateLensesAsync(array $args = [])\n * @method \\Aws\\Result disassociateProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateProfilesAsync(array $args = [])\n * @method \\Aws\\Result exportLens(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise exportLensAsync(array $args = [])\n * @method \\Aws\\Result getAnswer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAnswerAsync(array $args = [])\n * @method \\Aws\\Result getConsolidatedReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getConsolidatedReportAsync(array $args = [])\n * @method \\Aws\\Result getLens(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLensAsync(array $args = [])\n * @method \\Aws\\Result getLensReview(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLensReviewAsync(array $args = [])\n * @method \\Aws\\Result getLensReviewReport(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLensReviewReportAsync(array $args = [])\n * @method \\Aws\\Result getLensVersionDifference(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getLensVersionDifferenceAsync(array $args = [])\n * @method \\Aws\\Result getMilestone(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMilestoneAsync(array $args = [])\n * @method \\Aws\\Result getProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProfileAsync(array $args = [])\n * @method \\Aws\\Result getProfileTemplate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getProfileTemplateAsync(array $args = [])\n * @method \\Aws\\Result getWorkload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getWorkloadAsync(array $args = [])\n * @method \\Aws\\Result importLens(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importLensAsync(array $args = [])\n * @method \\Aws\\Result listAnswers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAnswersAsync(array $args = [])\n * @method \\Aws\\Result listCheckDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCheckDetailsAsync(array $args = [])\n * @method \\Aws\\Result listCheckSummaries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listCheckSummariesAsync(array $args = [])\n * @method \\Aws\\Result listLensReviewImprovements(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLensReviewImprovementsAsync(array $args = [])\n * @method \\Aws\\Result listLensReviews(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLensReviewsAsync(array $args = [])\n * @method \\Aws\\Result listLensShares(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLensSharesAsync(array $args = [])\n * @method \\Aws\\Result listLenses(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listLensesAsync(array $args = [])\n * @method \\Aws\\Result listMilestones(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMilestonesAsync(array $args = [])\n * @method \\Aws\\Result listNotifications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNotificationsAsync(array $args = [])\n * @method \\Aws\\Result listProfileNotifications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProfileNotificationsAsync(array $args = [])\n * @method \\Aws\\Result listProfileShares(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProfileSharesAsync(array $args = [])\n * @method \\Aws\\Result listProfiles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listProfilesAsync(array $args = [])\n * @method \\Aws\\Result listShareInvitations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listShareInvitationsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWorkloadShares(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkloadSharesAsync(array $args = [])\n * @method \\Aws\\Result listWorkloads(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWorkloadsAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAnswer(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAnswerAsync(array $args = [])\n * @method \\Aws\\Result updateGlobalSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGlobalSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateLensReview(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateLensReviewAsync(array $args = [])\n * @method \\Aws\\Result updateProfile(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateProfileAsync(array $args = [])\n * @method \\Aws\\Result updateShareInvitation(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateShareInvitationAsync(array $args = [])\n * @method \\Aws\\Result updateWorkload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkloadAsync(array $args = [])\n * @method \\Aws\\Result updateWorkloadShare(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkloadShareAsync(array $args = [])\n * @method \\Aws\\Result upgradeLensReview(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise upgradeLensReviewAsync(array $args = [])\n * @method \\Aws\\Result upgradeProfileVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise upgradeProfileVersionAsync(array $args = [])\n */\nclass WellArchitectedClient extends AwsClient {}\n", "num_lines": 122}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WellArchitected\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS Well-Architected Tool** service.\n */\nclass WellArchitectedException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WorkDocs;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon WorkDocs** service.\n * @method \\Aws\\Result abortDocumentVersionUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise abortDocumentVersionUploadAsync(array $args = [])\n * @method \\Aws\\Result activateUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise activateUserAsync(array $args = [])\n * @method \\Aws\\Result addResourcePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise addResourcePermissionsAsync(array $args = [])\n * @method \\Aws\\Result createComment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCommentAsync(array $args = [])\n * @method \\Aws\\Result createCustomMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createCustomMetadataAsync(array $args = [])\n * @method \\Aws\\Result createFolder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFolderAsync(array $args = [])\n * @method \\Aws\\Result createLabels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createLabelsAsync(array $args = [])\n * @method \\Aws\\Result createNotificationSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNotificationSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result createUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserAsync(array $args = [])\n * @method \\Aws\\Result deactivateUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deactivateUserAsync(array $args = [])\n * @method \\Aws\\Result deleteComment(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCommentAsync(array $args = [])\n * @method \\Aws\\Result deleteCustomMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteCustomMetadataAsync(array $args = [])\n * @method \\Aws\\Result deleteDocument(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDocumentAsync(array $args = [])\n * @method \\Aws\\Result deleteDocumentVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDocumentVersionAsync(array $args = [])\n * @method \\Aws\\Result deleteFolder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFolderAsync(array $args = [])\n * @method \\Aws\\Result deleteFolderContents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFolderContentsAsync(array $args = [])\n * @method \\Aws\\Result deleteLabels(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteLabelsAsync(array $args = [])\n * @method \\Aws\\Result deleteNotificationSubscription(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNotificationSubscriptionAsync(array $args = [])\n * @method \\Aws\\Result deleteUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserAsync(array $args = [])\n * @method \\Aws\\Result describeActivities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeActivitiesAsync(array $args = [])\n * @method \\Aws\\Result describeComments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCommentsAsync(array $args = [])\n * @method \\Aws\\Result describeDocumentVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDocumentVersionsAsync(array $args = [])\n * @method \\Aws\\Result describeFolderContents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFolderContentsAsync(array $args = [])\n * @method \\Aws\\Result describeGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeNotificationSubscriptions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeNotificationSubscriptionsAsync(array $args = [])\n * @method \\Aws\\Result describeResourcePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeResourcePermissionsAsync(array $args = [])\n * @method \\Aws\\Result describeRootFolders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeRootFoldersAsync(array $args = [])\n * @method \\Aws\\Result describeUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUsersAsync(array $args = [])\n * @method \\Aws\\Result getCurrentUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getCurrentUserAsync(array $args = [])\n * @method \\Aws\\Result getDocument(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDocumentAsync(array $args = [])\n * @method \\Aws\\Result getDocumentPath(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDocumentPathAsync(array $args = [])\n * @method \\Aws\\Result getDocumentVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDocumentVersionAsync(array $args = [])\n * @method \\Aws\\Result getFolder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFolderAsync(array $args = [])\n * @method \\Aws\\Result getFolderPath(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getFolderPathAsync(array $args = [])\n * @method \\Aws\\Result getResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getResourcesAsync(array $args = [])\n * @method \\Aws\\Result initiateDocumentVersionUpload(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise initiateDocumentVersionUploadAsync(array $args = [])\n * @method \\Aws\\Result removeAllResourcePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeAllResourcePermissionsAsync(array $args = [])\n * @method \\Aws\\Result removeResourcePermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise removeResourcePermissionAsync(array $args = [])\n * @method \\Aws\\Result restoreDocumentVersions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreDocumentVersionsAsync(array $args = [])\n * @method \\Aws\\Result searchResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise searchResourcesAsync(array $args = [])\n * @method \\Aws\\Result updateDocument(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDocumentAsync(array $args = [])\n * @method \\Aws\\Result updateDocumentVersion(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDocumentVersionAsync(array $args = [])\n * @method \\Aws\\Result updateFolder(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFolderAsync(array $args = [])\n * @method \\Aws\\Result updateUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserAsync(array $args = [])\n */\nclass WorkDocsClient extends AwsClient {}\n", "num_lines": 98}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WorkDocs\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon WorkDocs** service.\n */\nclass WorkDocsException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WorkLink;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon WorkLink** service.\n * @method \\Aws\\Result associateDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateDomainAsync(array $args = [])\n * @method \\Aws\\Result associateWebsiteAuthorizationProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateWebsiteAuthorizationProviderAsync(array $args = [])\n * @method \\Aws\\Result associateWebsiteCertificateAuthority(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateWebsiteCertificateAuthorityAsync(array $args = [])\n * @method \\Aws\\Result createFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createFleetAsync(array $args = [])\n * @method \\Aws\\Result deleteFleet(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteFleetAsync(array $args = [])\n * @method \\Aws\\Result describeAuditStreamConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAuditStreamConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeCompanyNetworkConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeCompanyNetworkConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeDevice(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDeviceAsync(array $args = [])\n * @method \\Aws\\Result describeDevicePolicyConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDevicePolicyConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeDomainAsync(array $args = [])\n * @method \\Aws\\Result describeFleetMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeFleetMetadataAsync(array $args = [])\n * @method \\Aws\\Result describeIdentityProviderConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeIdentityProviderConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeWebsiteCertificateAuthority(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWebsiteCertificateAuthorityAsync(array $args = [])\n * @method \\Aws\\Result disassociateDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateDomainAsync(array $args = [])\n * @method \\Aws\\Result disassociateWebsiteAuthorizationProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateWebsiteAuthorizationProviderAsync(array $args = [])\n * @method \\Aws\\Result disassociateWebsiteCertificateAuthority(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateWebsiteCertificateAuthorityAsync(array $args = [])\n * @method \\Aws\\Result listDevices(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDevicesAsync(array $args = [])\n * @method \\Aws\\Result listDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainsAsync(array $args = [])\n * @method \\Aws\\Result listFleets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listFleetsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listWebsiteAuthorizationProviders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWebsiteAuthorizationProvidersAsync(array $args = [])\n * @method \\Aws\\Result listWebsiteCertificateAuthorities(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listWebsiteCertificateAuthoritiesAsync(array $args = [])\n * @method \\Aws\\Result restoreDomainAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreDomainAccessAsync(array $args = [])\n * @method \\Aws\\Result revokeDomainAccess(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeDomainAccessAsync(array $args = [])\n * @method \\Aws\\Result signOutUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise signOutUserAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAuditStreamConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAuditStreamConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateCompanyNetworkConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateCompanyNetworkConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateDevicePolicyConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDevicePolicyConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateDomainMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDomainMetadataAsync(array $args = [])\n * @method \\Aws\\Result updateFleetMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateFleetMetadataAsync(array $args = [])\n * @method \\Aws\\Result updateIdentityProviderConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIdentityProviderConfigurationAsync(array $args = [])\n */\nclass WorkLinkClient extends AwsClient {}\n", "num_lines": 76}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WorkLink\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon WorkLink** service.\n */\nclass WorkLinkException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WorkMail;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon WorkMail** service.\n * @method \\Aws\\Result associateDelegateToResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateDelegateToResourceAsync(array $args = [])\n * @method \\Aws\\Result associateMemberToGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateMemberToGroupAsync(array $args = [])\n * @method \\Aws\\Result assumeImpersonationRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise assumeImpersonationRoleAsync(array $args = [])\n * @method \\Aws\\Result cancelMailboxExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise cancelMailboxExportJobAsync(array $args = [])\n * @method \\Aws\\Result createAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAliasAsync(array $args = [])\n * @method \\Aws\\Result createAvailabilityConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createAvailabilityConfigurationAsync(array $args = [])\n * @method \\Aws\\Result createGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGroupAsync(array $args = [])\n * @method \\Aws\\Result createImpersonationRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createImpersonationRoleAsync(array $args = [])\n * @method \\Aws\\Result createMobileDeviceAccessRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createMobileDeviceAccessRuleAsync(array $args = [])\n * @method \\Aws\\Result createOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createOrganizationAsync(array $args = [])\n * @method \\Aws\\Result createResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createResourceAsync(array $args = [])\n * @method \\Aws\\Result createUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserAsync(array $args = [])\n * @method \\Aws\\Result deleteAccessControlRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAccessControlRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAliasAsync(array $args = [])\n * @method \\Aws\\Result deleteAvailabilityConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAvailabilityConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteEmailMonitoringConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteEmailMonitoringConfigurationAsync(array $args = [])\n * @method \\Aws\\Result deleteGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteImpersonationRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteImpersonationRoleAsync(array $args = [])\n * @method \\Aws\\Result deleteMailboxPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMailboxPermissionsAsync(array $args = [])\n * @method \\Aws\\Result deleteMobileDeviceAccessOverride(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMobileDeviceAccessOverrideAsync(array $args = [])\n * @method \\Aws\\Result deleteMobileDeviceAccessRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteMobileDeviceAccessRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteOrganizationAsync(array $args = [])\n * @method \\Aws\\Result deleteResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourceAsync(array $args = [])\n * @method \\Aws\\Result deleteRetentionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteRetentionPolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserAsync(array $args = [])\n * @method \\Aws\\Result deregisterFromWorkMail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterFromWorkMailAsync(array $args = [])\n * @method \\Aws\\Result deregisterMailDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterMailDomainAsync(array $args = [])\n * @method \\Aws\\Result describeEmailMonitoringConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeEmailMonitoringConfigurationAsync(array $args = [])\n * @method \\Aws\\Result describeGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeGroupAsync(array $args = [])\n * @method \\Aws\\Result describeInboundDmarcSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeInboundDmarcSettingsAsync(array $args = [])\n * @method \\Aws\\Result describeMailboxExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeMailboxExportJobAsync(array $args = [])\n * @method \\Aws\\Result describeOrganization(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeOrganizationAsync(array $args = [])\n * @method \\Aws\\Result describeResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeResourceAsync(array $args = [])\n * @method \\Aws\\Result describeUser(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeUserAsync(array $args = [])\n * @method \\Aws\\Result disassociateDelegateFromResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateDelegateFromResourceAsync(array $args = [])\n * @method \\Aws\\Result disassociateMemberFromGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateMemberFromGroupAsync(array $args = [])\n * @method \\Aws\\Result getAccessControlEffect(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAccessControlEffectAsync(array $args = [])\n * @method \\Aws\\Result getDefaultRetentionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getDefaultRetentionPolicyAsync(array $args = [])\n * @method \\Aws\\Result getImpersonationRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getImpersonationRoleAsync(array $args = [])\n * @method \\Aws\\Result getImpersonationRoleEffect(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getImpersonationRoleEffectAsync(array $args = [])\n * @method \\Aws\\Result getMailDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMailDomainAsync(array $args = [])\n * @method \\Aws\\Result getMailboxDetails(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMailboxDetailsAsync(array $args = [])\n * @method \\Aws\\Result getMobileDeviceAccessEffect(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMobileDeviceAccessEffectAsync(array $args = [])\n * @method \\Aws\\Result getMobileDeviceAccessOverride(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getMobileDeviceAccessOverrideAsync(array $args = [])\n * @method \\Aws\\Result listAccessControlRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAccessControlRulesAsync(array $args = [])\n * @method \\Aws\\Result listAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAliasesAsync(array $args = [])\n * @method \\Aws\\Result listAvailabilityConfigurations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAvailabilityConfigurationsAsync(array $args = [])\n * @method \\Aws\\Result listGroupMembers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupMembersAsync(array $args = [])\n * @method \\Aws\\Result listGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listGroupsAsync(array $args = [])\n * @method \\Aws\\Result listImpersonationRoles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listImpersonationRolesAsync(array $args = [])\n * @method \\Aws\\Result listMailDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMailDomainsAsync(array $args = [])\n * @method \\Aws\\Result listMailboxExportJobs(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMailboxExportJobsAsync(array $args = [])\n * @method \\Aws\\Result listMailboxPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMailboxPermissionsAsync(array $args = [])\n * @method \\Aws\\Result listMobileDeviceAccessOverrides(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMobileDeviceAccessOverridesAsync(array $args = [])\n * @method \\Aws\\Result listMobileDeviceAccessRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listMobileDeviceAccessRulesAsync(array $args = [])\n * @method \\Aws\\Result listOrganizations(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listOrganizationsAsync(array $args = [])\n * @method \\Aws\\Result listResourceDelegates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourceDelegatesAsync(array $args = [])\n * @method \\Aws\\Result listResources(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourcesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listUsers(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUsersAsync(array $args = [])\n * @method \\Aws\\Result putAccessControlRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAccessControlRuleAsync(array $args = [])\n * @method \\Aws\\Result putEmailMonitoringConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEmailMonitoringConfigurationAsync(array $args = [])\n * @method \\Aws\\Result putInboundDmarcSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putInboundDmarcSettingsAsync(array $args = [])\n * @method \\Aws\\Result putMailboxPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putMailboxPermissionsAsync(array $args = [])\n * @method \\Aws\\Result putMobileDeviceAccessOverride(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putMobileDeviceAccessOverrideAsync(array $args = [])\n * @method \\Aws\\Result putRetentionPolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRetentionPolicyAsync(array $args = [])\n * @method \\Aws\\Result registerMailDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerMailDomainAsync(array $args = [])\n * @method \\Aws\\Result registerToWorkMail(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerToWorkMailAsync(array $args = [])\n * @method \\Aws\\Result resetPassword(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise resetPasswordAsync(array $args = [])\n * @method \\Aws\\Result startMailboxExportJob(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startMailboxExportJobAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result testAvailabilityConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise testAvailabilityConfigurationAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateAvailabilityConfiguration(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateAvailabilityConfigurationAsync(array $args = [])\n * @method \\Aws\\Result updateDefaultMailDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateDefaultMailDomainAsync(array $args = [])\n * @method \\Aws\\Result updateImpersonationRole(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateImpersonationRoleAsync(array $args = [])\n * @method \\Aws\\Result updateMailboxQuota(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMailboxQuotaAsync(array $args = [])\n * @method \\Aws\\Result updateMobileDeviceAccessRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateMobileDeviceAccessRuleAsync(array $args = [])\n * @method \\Aws\\Result updatePrimaryEmailAddress(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePrimaryEmailAddressAsync(array $args = [])\n * @method \\Aws\\Result updateResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateResourceAsync(array $args = [])\n */\nclass WorkMailClient extends AwsClient {}\n", "num_lines": 170}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WorkMail\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon WorkMail** service.\n */\nclass WorkMailException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WorkMailMessageFlow;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon WorkMail Message Flow** service.\n * @method \\Aws\\Result getRawMessageContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getRawMessageContentAsync(array $args = [])\n * @method \\Aws\\Result putRawMessageContent(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putRawMessageContentAsync(array $args = [])\n */\nclass WorkMailMessageFlowClient extends AwsClient {}\n", "num_lines": 14}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WorkMailMessageFlow\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon WorkMail Message Flow** service.\n */\nclass WorkMailMessageFlowException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WorkSpaces;\n\nuse Aws\\AwsClient;\n\n/**\n * Amazon WorkSpaces client.\n *\n * @method \\Aws\\Result associateConnectionAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateConnectionAliasAsync(array $args = [])\n * @method \\Aws\\Result associateIpGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateIpGroupsAsync(array $args = [])\n * @method \\Aws\\Result authorizeIpRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise authorizeIpRulesAsync(array $args = [])\n * @method \\Aws\\Result copyWorkspaceImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise copyWorkspaceImageAsync(array $args = [])\n * @method \\Aws\\Result createConnectClientAddIn(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConnectClientAddInAsync(array $args = [])\n * @method \\Aws\\Result createConnectionAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createConnectionAliasAsync(array $args = [])\n * @method \\Aws\\Result createIpGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIpGroupAsync(array $args = [])\n * @method \\Aws\\Result createStandbyWorkspaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createStandbyWorkspacesAsync(array $args = [])\n * @method \\Aws\\Result createTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTagsAsync(array $args = [])\n * @method \\Aws\\Result createUpdatedWorkspaceImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUpdatedWorkspaceImageAsync(array $args = [])\n * @method \\Aws\\Result createWorkspaceBundle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkspaceBundleAsync(array $args = [])\n * @method \\Aws\\Result createWorkspaceImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkspaceImageAsync(array $args = [])\n * @method \\Aws\\Result createWorkspaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createWorkspacesAsync(array $args = [])\n * @method \\Aws\\Result deleteClientBranding(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteClientBrandingAsync(array $args = [])\n * @method \\Aws\\Result deleteConnectClientAddIn(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectClientAddInAsync(array $args = [])\n * @method \\Aws\\Result deleteConnectionAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteConnectionAliasAsync(array $args = [])\n * @method \\Aws\\Result deleteIpGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIpGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTagsAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkspaceBundle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkspaceBundleAsync(array $args = [])\n * @method \\Aws\\Result deleteWorkspaceImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteWorkspaceImageAsync(array $args = [])\n * @method \\Aws\\Result deregisterWorkspaceDirectory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deregisterWorkspaceDirectoryAsync(array $args = [])\n * @method \\Aws\\Result describeAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountAsync(array $args = [])\n * @method \\Aws\\Result describeAccountModifications(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeAccountModificationsAsync(array $args = [])\n * @method \\Aws\\Result describeClientBranding(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClientBrandingAsync(array $args = [])\n * @method \\Aws\\Result describeClientProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeClientPropertiesAsync(array $args = [])\n * @method \\Aws\\Result describeConnectClientAddIns(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConnectClientAddInsAsync(array $args = [])\n * @method \\Aws\\Result describeConnectionAliasPermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConnectionAliasPermissionsAsync(array $args = [])\n * @method \\Aws\\Result describeConnectionAliases(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeConnectionAliasesAsync(array $args = [])\n * @method \\Aws\\Result describeIpGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeIpGroupsAsync(array $args = [])\n * @method \\Aws\\Result describeTags(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeTagsAsync(array $args = [])\n * @method \\Aws\\Result describeWorkspaceBundles(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkspaceBundlesAsync(array $args = [])\n * @method \\Aws\\Result describeWorkspaceDirectories(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkspaceDirectoriesAsync(array $args = [])\n * @method \\Aws\\Result describeWorkspaceImagePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkspaceImagePermissionsAsync(array $args = [])\n * @method \\Aws\\Result describeWorkspaceImages(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkspaceImagesAsync(array $args = [])\n * @method \\Aws\\Result describeWorkspaceSnapshots(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkspaceSnapshotsAsync(array $args = [])\n * @method \\Aws\\Result describeWorkspaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkspacesAsync(array $args = [])\n * @method \\Aws\\Result describeWorkspacesConnectionStatus(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise describeWorkspacesConnectionStatusAsync(array $args = [])\n * @method \\Aws\\Result disassociateConnectionAlias(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateConnectionAliasAsync(array $args = [])\n * @method \\Aws\\Result disassociateIpGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateIpGroupsAsync(array $args = [])\n * @method \\Aws\\Result importClientBranding(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importClientBrandingAsync(array $args = [])\n * @method \\Aws\\Result importWorkspaceImage(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise importWorkspaceImageAsync(array $args = [])\n * @method \\Aws\\Result listAvailableManagementCidrRanges(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listAvailableManagementCidrRangesAsync(array $args = [])\n * @method \\Aws\\Result migrateWorkspace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise migrateWorkspaceAsync(array $args = [])\n * @method \\Aws\\Result modifyAccount(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyAccountAsync(array $args = [])\n * @method \\Aws\\Result modifyCertificateBasedAuthProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyCertificateBasedAuthPropertiesAsync(array $args = [])\n * @method \\Aws\\Result modifyClientProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyClientPropertiesAsync(array $args = [])\n * @method \\Aws\\Result modifySamlProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifySamlPropertiesAsync(array $args = [])\n * @method \\Aws\\Result modifySelfservicePermissions(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifySelfservicePermissionsAsync(array $args = [])\n * @method \\Aws\\Result modifyWorkspaceAccessProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyWorkspaceAccessPropertiesAsync(array $args = [])\n * @method \\Aws\\Result modifyWorkspaceCreationProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyWorkspaceCreationPropertiesAsync(array $args = [])\n * @method \\Aws\\Result modifyWorkspaceProperties(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyWorkspacePropertiesAsync(array $args = [])\n * @method \\Aws\\Result modifyWorkspaceState(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise modifyWorkspaceStateAsync(array $args = [])\n * @method \\Aws\\Result rebootWorkspaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebootWorkspacesAsync(array $args = [])\n * @method \\Aws\\Result rebuildWorkspaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise rebuildWorkspacesAsync(array $args = [])\n * @method \\Aws\\Result registerWorkspaceDirectory(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise registerWorkspaceDirectoryAsync(array $args = [])\n * @method \\Aws\\Result restoreWorkspace(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise restoreWorkspaceAsync(array $args = [])\n * @method \\Aws\\Result revokeIpRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise revokeIpRulesAsync(array $args = [])\n * @method \\Aws\\Result startWorkspaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise startWorkspacesAsync(array $args = [])\n * @method \\Aws\\Result stopWorkspaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise stopWorkspacesAsync(array $args = [])\n * @method \\Aws\\Result terminateWorkspaces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise terminateWorkspacesAsync(array $args = [])\n * @method \\Aws\\Result updateConnectClientAddIn(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConnectClientAddInAsync(array $args = [])\n * @method \\Aws\\Result updateConnectionAliasPermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateConnectionAliasPermissionAsync(array $args = [])\n * @method \\Aws\\Result updateRulesOfIpGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateRulesOfIpGroupAsync(array $args = [])\n * @method \\Aws\\Result updateWorkspaceBundle(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkspaceBundleAsync(array $args = [])\n * @method \\Aws\\Result updateWorkspaceImagePermission(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateWorkspaceImagePermissionAsync(array $args = [])\n */\nclass WorkSpacesClient extends AwsClient {}\n", "num_lines": 141}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WorkSpaces\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error while interacting with Amazon WorkSpaces.\n */\nclass WorkSpacesException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WorkSpacesWeb;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **Amazon WorkSpaces Web** service.\n * @method \\Aws\\Result associateBrowserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateBrowserSettingsAsync(array $args = [])\n * @method \\Aws\\Result associateIpAccessSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateIpAccessSettingsAsync(array $args = [])\n * @method \\Aws\\Result associateNetworkSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateNetworkSettingsAsync(array $args = [])\n * @method \\Aws\\Result associateTrustStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateTrustStoreAsync(array $args = [])\n * @method \\Aws\\Result associateUserAccessLoggingSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateUserAccessLoggingSettingsAsync(array $args = [])\n * @method \\Aws\\Result associateUserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise associateUserSettingsAsync(array $args = [])\n * @method \\Aws\\Result createBrowserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createBrowserSettingsAsync(array $args = [])\n * @method \\Aws\\Result createIdentityProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIdentityProviderAsync(array $args = [])\n * @method \\Aws\\Result createIpAccessSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createIpAccessSettingsAsync(array $args = [])\n * @method \\Aws\\Result createNetworkSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createNetworkSettingsAsync(array $args = [])\n * @method \\Aws\\Result createPortal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createPortalAsync(array $args = [])\n * @method \\Aws\\Result createTrustStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createTrustStoreAsync(array $args = [])\n * @method \\Aws\\Result createUserAccessLoggingSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserAccessLoggingSettingsAsync(array $args = [])\n * @method \\Aws\\Result createUserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createUserSettingsAsync(array $args = [])\n * @method \\Aws\\Result deleteBrowserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteBrowserSettingsAsync(array $args = [])\n * @method \\Aws\\Result deleteIdentityProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIdentityProviderAsync(array $args = [])\n * @method \\Aws\\Result deleteIpAccessSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteIpAccessSettingsAsync(array $args = [])\n * @method \\Aws\\Result deleteNetworkSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteNetworkSettingsAsync(array $args = [])\n * @method \\Aws\\Result deletePortal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deletePortalAsync(array $args = [])\n * @method \\Aws\\Result deleteTrustStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteTrustStoreAsync(array $args = [])\n * @method \\Aws\\Result deleteUserAccessLoggingSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserAccessLoggingSettingsAsync(array $args = [])\n * @method \\Aws\\Result deleteUserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteUserSettingsAsync(array $args = [])\n * @method \\Aws\\Result disassociateBrowserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateBrowserSettingsAsync(array $args = [])\n * @method \\Aws\\Result disassociateIpAccessSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateIpAccessSettingsAsync(array $args = [])\n * @method \\Aws\\Result disassociateNetworkSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateNetworkSettingsAsync(array $args = [])\n * @method \\Aws\\Result disassociateTrustStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateTrustStoreAsync(array $args = [])\n * @method \\Aws\\Result disassociateUserAccessLoggingSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateUserAccessLoggingSettingsAsync(array $args = [])\n * @method \\Aws\\Result disassociateUserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise disassociateUserSettingsAsync(array $args = [])\n * @method \\Aws\\Result getBrowserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getBrowserSettingsAsync(array $args = [])\n * @method \\Aws\\Result getIdentityProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIdentityProviderAsync(array $args = [])\n * @method \\Aws\\Result getIpAccessSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getIpAccessSettingsAsync(array $args = [])\n * @method \\Aws\\Result getNetworkSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getNetworkSettingsAsync(array $args = [])\n * @method \\Aws\\Result getPortal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPortalAsync(array $args = [])\n * @method \\Aws\\Result getPortalServiceProviderMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getPortalServiceProviderMetadataAsync(array $args = [])\n * @method \\Aws\\Result getTrustStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTrustStoreAsync(array $args = [])\n * @method \\Aws\\Result getTrustStoreCertificate(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTrustStoreCertificateAsync(array $args = [])\n * @method \\Aws\\Result getUserAccessLoggingSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUserAccessLoggingSettingsAsync(array $args = [])\n * @method \\Aws\\Result getUserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getUserSettingsAsync(array $args = [])\n * @method \\Aws\\Result listBrowserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listBrowserSettingsAsync(array $args = [])\n * @method \\Aws\\Result listIdentityProviders(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIdentityProvidersAsync(array $args = [])\n * @method \\Aws\\Result listIpAccessSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listIpAccessSettingsAsync(array $args = [])\n * @method \\Aws\\Result listNetworkSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listNetworkSettingsAsync(array $args = [])\n * @method \\Aws\\Result listPortals(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listPortalsAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result listTrustStoreCertificates(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTrustStoreCertificatesAsync(array $args = [])\n * @method \\Aws\\Result listTrustStores(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTrustStoresAsync(array $args = [])\n * @method \\Aws\\Result listUserAccessLoggingSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUserAccessLoggingSettingsAsync(array $args = [])\n * @method \\Aws\\Result listUserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listUserSettingsAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateBrowserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateBrowserSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateIdentityProvider(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIdentityProviderAsync(array $args = [])\n * @method \\Aws\\Result updateIpAccessSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateIpAccessSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateNetworkSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateNetworkSettingsAsync(array $args = [])\n * @method \\Aws\\Result updatePortal(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updatePortalAsync(array $args = [])\n * @method \\Aws\\Result updateTrustStore(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateTrustStoreAsync(array $args = [])\n * @method \\Aws\\Result updateUserAccessLoggingSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserAccessLoggingSettingsAsync(array $args = [])\n * @method \\Aws\\Result updateUserSettings(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateUserSettingsAsync(array $args = [])\n */\nclass WorkSpacesWebClient extends AwsClient {}\n", "num_lines": 126}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\WorkSpacesWeb\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **Amazon WorkSpaces Web** service.\n */\nclass WorkSpacesWebException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\XRay;\n\nuse Aws\\AwsClient;\n\n/**\n * This client is used to interact with the **AWS X-Ray** service.\n * @method \\Aws\\Result batchGetTraces(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchGetTracesAsync(array $args = [])\n * @method \\Aws\\Result createGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createGroupAsync(array $args = [])\n * @method \\Aws\\Result createSamplingRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createSamplingRuleAsync(array $args = [])\n * @method \\Aws\\Result deleteGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteGroupAsync(array $args = [])\n * @method \\Aws\\Result deleteResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result deleteSamplingRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteSamplingRuleAsync(array $args = [])\n * @method \\Aws\\Result getEncryptionConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getEncryptionConfigAsync(array $args = [])\n * @method \\Aws\\Result getGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGroupAsync(array $args = [])\n * @method \\Aws\\Result getGroups(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getGroupsAsync(array $args = [])\n * @method \\Aws\\Result getInsight(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInsightAsync(array $args = [])\n * @method \\Aws\\Result getInsightEvents(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInsightEventsAsync(array $args = [])\n * @method \\Aws\\Result getInsightImpactGraph(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInsightImpactGraphAsync(array $args = [])\n * @method \\Aws\\Result getInsightSummaries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getInsightSummariesAsync(array $args = [])\n * @method \\Aws\\Result getSamplingRules(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSamplingRulesAsync(array $args = [])\n * @method \\Aws\\Result getSamplingStatisticSummaries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSamplingStatisticSummariesAsync(array $args = [])\n * @method \\Aws\\Result getSamplingTargets(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getSamplingTargetsAsync(array $args = [])\n * @method \\Aws\\Result getServiceGraph(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getServiceGraphAsync(array $args = [])\n * @method \\Aws\\Result getTimeSeriesServiceStatistics(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTimeSeriesServiceStatisticsAsync(array $args = [])\n * @method \\Aws\\Result getTraceGraph(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTraceGraphAsync(array $args = [])\n * @method \\Aws\\Result getTraceSummaries(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getTraceSummariesAsync(array $args = [])\n * @method \\Aws\\Result listResourcePolicies(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listResourcePoliciesAsync(array $args = [])\n * @method \\Aws\\Result listTagsForResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listTagsForResourceAsync(array $args = [])\n * @method \\Aws\\Result putEncryptionConfig(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putEncryptionConfigAsync(array $args = [])\n * @method \\Aws\\Result putResourcePolicy(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putResourcePolicyAsync(array $args = [])\n * @method \\Aws\\Result putTelemetryRecords(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putTelemetryRecordsAsync(array $args = [])\n * @method \\Aws\\Result putTraceSegments(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putTraceSegmentsAsync(array $args = [])\n * @method \\Aws\\Result tagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise tagResourceAsync(array $args = [])\n * @method \\Aws\\Result untagResource(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise untagResourceAsync(array $args = [])\n * @method \\Aws\\Result updateGroup(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateGroupAsync(array $args = [])\n * @method \\Aws\\Result updateSamplingRule(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise updateSamplingRuleAsync(array $args = [])\n */\nclass XRayClient extends AwsClient {}\n", "num_lines": 70}
{"repo_name": "aws-sdk-php", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\XRay\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the **AWS X-Ray** service.\n */\nclass XRayException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php-laravel", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nuse Aws\\Laravel\\AwsServiceProvider;\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | AWS SDK Configuration\n    |--------------------------------------------------------------------------\n    |\n    | The configuration options set in this file will be passed directly to the\n    | `Aws\\Sdk` object, from which all client objects are created. This file\n    | sets the default minimum configuration used by the service provider even\n    | if no configuration is set by the user. The full set of possible options\n    | are documented at:\n    | http://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/configuration.html\n    |\n    */\n    'region' => env('AWS_REGION', 'us-east-1'),\n    'version' => 'latest',\n    'ua_append' => [\n        'L5MOD/' . AwsServiceProvider::VERSION,\n    ],\n];\n", "num_lines": 26}
{"repo_name": "aws-sdk-php-laravel", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nuse Aws\\Laravel\\AwsServiceProvider;\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | AWS SDK Configuration\n    |--------------------------------------------------------------------------\n    |\n    | The configuration options set in this file will be passed directly to the\n    | `Aws\\Sdk` object, from which all client objects are created. This file\n    | is published to the application config directory for modification by the\n    | user. The full set of possible options are documented at:\n    | http://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/configuration.html\n    |\n    */\n    'credentials' => [\n        'key'    => env('AWS_ACCESS_KEY_ID', ''),\n        'secret' => env('AWS_SECRET_ACCESS_KEY', ''),\n    ],\n    'region' => env('AWS_REGION', 'us-east-1'),\n    'version' => 'latest',\n    'ua_append' => [\n        'L5MOD/' . AwsServiceProvider::VERSION,\n    ],\n];\n", "num_lines": 29}
{"repo_name": "aws-sdk-php-laravel", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php namespace Aws\\Laravel;\n\nuse Aws\\AwsClientInterface;\nuse Illuminate\\Support\\Facades\\Facade;\n\n/**\n * Facade for the AWS service\n *\n * @method static AwsClientInterface createClient($name, array $args = []) Get a client from the service builder.\n */\nclass AwsFacade extends Facade\n{\n\n    /**\n     * Get the registered name of the component.\n     *\n     * @return string\n     */\n    protected static function getFacadeAccessor()\n    {\n        return 'aws';\n    }\n\n}\n", "num_lines": 25}
{"repo_name": "aws-sdk-php-laravel", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php namespace Aws\\Laravel;\n\nuse Aws\\Sdk;\nuse Illuminate\\Foundation\\Application as LaravelApplication;\nuse Illuminate\\Support\\ServiceProvider;\nuse Laravel\\Lumen\\Application as LumenApplication;\n\n/**\n * AWS SDK for PHP service provider for Laravel applications\n */\nclass AwsServiceProvider extends ServiceProvider\n{\n    const VERSION = '3.7.0';\n\n    /**\n     * Indicates if loading of the provider is deferred.\n     *\n     * @var bool\n     */\n    protected $defer = true;\n\n    /**\n     * Bootstrap the configuration\n     *\n     * @return void\n     */\n    public function boot()\n    {\n        if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {\n            $this->publishes(\n                [__DIR__.'/../config/aws_publish.php' => config_path('aws.php')],\n                'aws-config'\n            );\n        } elseif ($this->app instanceof LumenApplication) {\n            $this->app->configure('aws');\n        }\n    }\n\n    /**\n     * Register the service provider.\n     *\n     * @return void\n     */\n    public function register()\n    {\n        $this->mergeConfigFrom(\n            __DIR__.'/../config/aws_default.php',\n            'aws'\n        );\n\n        $this->app->singleton('aws', function ($app) {\n            $config = $app->make('config')->get('aws');\n\n            return new Sdk($config);\n        });\n\n        $this->app->alias('aws', 'Aws\\Sdk');\n    }\n\n    /**\n     * Get the services provided by the provider.\n     *\n     * @return array\n     */\n    public function provides()\n    {\n        return ['aws', 'Aws\\Sdk'];\n    }\n\n}\n", "num_lines": 71}
{"repo_name": "aws-sdk-php-laravel", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php namespace Aws\\Laravel\\Test;\n\nuse Aws\\Laravel\\AwsFacade as AWS;\nuse Aws\\Laravel\\AwsServiceProvider;\nuse Illuminate\\Container\\Container;\nuse Yoast\\PHPUnitPolyfills\\TestCases\\TestCase;\n\nabstract class AwsServiceProviderTest extends TestCase\n{\n\n    public function testFacadeCanBeResolvedToServiceInstance()\n    {\n        $app = $this->setupApplication();\n        $this->setupServiceProvider($app);\n\n        // Mount facades\n        AWS::setFacadeApplication($app);\n\n        // Get an instance of a client (S3) via the facade.\n        $s3 = AWS::createClient('S3');\n        $this->assertInstanceOf('Aws\\S3\\S3Client', $s3);\n    }\n\n    public function testRegisterAwsServiceProviderWithPackageConfigAndEnv()\n    {\n        $app = $this->setupApplication();\n        $this->setupServiceProvider($app);\n\n        // Get an instance of a client (S3).\n        /** @var $s3 \\Aws\\S3\\S3Client */\n        $s3 = $app['aws']->createClient('S3');\n        $this->assertInstanceOf('Aws\\S3\\S3Client', $s3);\n\n        // Verify that the client received the credentials from the package config.\n        /** @var \\Aws\\Credentials\\CredentialsInterface $credentials */\n        $credentials = $s3->getCredentials()->wait();\n        $this->assertEquals('foo', $credentials->getAccessKeyId());\n        $this->assertEquals('bar', $credentials->getSecretKey());\n        $this->assertEquals('baz', $s3->getRegion());\n    }\n\n    public function testServiceNameIsProvided()\n    {\n        $app = $this->setupApplication();\n        $provider = $this->setupServiceProvider($app);\n        $this->assertContains('aws', $provider->provides());\n    }\n\n    public function testVersionInformationIsProvidedToSdkUserAgent()\n    {\n        $app = $this->setupApplication();\n        $this->setupServiceProvider($app);\n        $config = $app['config']->get('aws');\n\n        $this->assertArrayHasKey('ua_append', $config);\n        $this->assertIsArray($config['ua_append']);\n        $this->assertNotEmpty($config['ua_append']);\n        $this->assertNotEmpty(array_filter($config['ua_append'], function ($ua) {\n            return false !== strpos($ua, AwsServiceProvider::VERSION);\n        }));\n    }\n\n    /**\n     * @return Container\n     */\n    abstract protected function setupApplication();\n\n    /**\n     * @param Container $app\n     *\n     * @return AwsServiceProvider\n     */\n    private function setupServiceProvider(Container $app)\n    {\n        // Create and register the provider.\n        $provider = new AwsServiceProvider($app);\n        $app->register($provider);\n        $provider->boot();\n\n        return $provider;\n    }\n}\n", "num_lines": 83}
{"repo_name": "aws-sdk-php-laravel", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php namespace Aws\\Laravel\\Test;\n\nuse Illuminate\\Config\\Repository;\nuse Illuminate\\Foundation\\Application;\n\nclass LaravelAwsServiceProviderTest extends AwsServiceProviderTest\n{\n    protected function setupApplication()\n    {\n        if (!class_exists(Application::class)) {\n            $this->markTestSkipped();\n        }\n        // Create the application such that the config is loaded.\n        $app = new Application();\n        $app->setBasePath(sys_get_temp_dir());\n        $app->instance('config', new Repository());\n\n        return $app;\n    }\n}\n", "num_lines": 21}
{"repo_name": "aws-sdk-php-laravel", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Laravel\\Test;\n\nuse Illuminate\\Config\\Repository;\nuse Laravel\\Lumen\\Application;\n\nclass LumenAwsServiceProviderTest extends AwsServiceProviderTest\n{\n    protected function setupApplication()\n    {\n        if (!class_exists(Application::class)) {\n            $this->markTestSkipped();\n        }\n        // Create the application such that the config is loaded.\n        $app = new Application(sys_get_temp_dir());\n        $app->instance('config', new Repository());\n\n        return $app;\n    }\n}\n", "num_lines": 21}
{"repo_name": "aws-sdk-php-silex", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\n\nnamespace Aws\\Silex;\n\nuse Aws\\Sdk;\nuse Pimple\\Container;\nuse Pimple\\ServiceProviderInterface;\nuse Silex\\Application;\n\n/**\n * AWS SDK for PHP service provider for Silex applications\n */\nclass AwsServiceProvider implements ServiceProviderInterface\n{\n    const VERSION = '3.0.0';\n\n    public function register(Container $container)\n    {\n        $container['aws'] = function (Application $container) {\n            $config = isset($container['aws.config']) ? $container['aws.config'] : [];\n\n            return new Sdk($config + ['ua_append' => [\n                'Silex/' . Application::VERSION,\n                'SXMOD/' . self::VERSION,\n            ]]);\n        };\n    }\n}\n", "num_lines": 43}
{"repo_name": "aws-sdk-php-silex", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n/**\n * Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\n\nnamespace Aws\\Silex;\n\nuse Silex\\Application;\n\n/**\n * AwsServiceProvider test cases\n */\nclass AwsServiceProviderTest extends \\PHPUnit_Framework_TestCase\n{\n    public function testRegisterAwsServiceProvider()\n    {\n        // Setup the Silex app and AWS service provider\n        $app = new Application();\n        $provider = new AwsServiceProvider();\n        $app->register($provider, array(\n            'aws.config' => array(\n                'version' => '2006-03-01',\n                'region' => 'us-east-1',\n                'credentials' => [\n                    'key' => 'fake-aws-key',\n                    'secret' => 'fake-aws-secret',\n                ],\n            )\n        ));\n\n        // Get an instance of a client (S3) to use for testing\n        $s3 = $app['aws']->createS3();\n\n        // Verify that the app and clients created by the SDK receive the provided credentials\n        $this->assertEquals('2006-03-01', $app['aws.config']['version']);\n        $this->assertEquals('us-east-1', $app['aws.config']['region']);\n        $this->assertEquals('2006-03-01', $s3->getApi()->getApiVersion());\n        $this->assertEquals('us-east-1', $s3->getRegion());\n    }\n\n    /**\n     * @expectedException \\InvalidArgumentException\n     */\n    public function testNoConfigProvided()\n    {\n        // Setup the Silex app and AWS service provider\n        $app = new Application();\n        $provider = new AwsServiceProvider();\n        $app->register($provider, array(\n            'aws.config' => array(\n                'credentials' => [\n                    'key' => 'fake-aws-key',\n                    'secret' => 'fake-aws-secret',\n                ],\n            )\n        ));\n\n        // Instantiate a client, which should trigger an exception for missing configs\n        $s3 = $app['aws']->createS3();\n    }\n}\n", "num_lines": 73}
{"repo_name": "aws-sdk-php-symfony", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Symfony;\n\nuse Symfony\\Component\\HttpKernel\\Bundle\\Bundle;\n\nclass AwsBundle extends Bundle\n{\n    const VERSION = '2.5.0';\n}\n", "num_lines": 11}
{"repo_name": "aws-sdk-php-symfony", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Symfony\\DependencyInjection;\n\nuse Aws;\nuse Aws\\AwsClient;\nuse Aws\\Symfony\\AwsBundle;\nuse Symfony\\Component\\Config\\FileLocator;\nuse Symfony\\Component\\DependencyInjection\\ContainerBuilder;\nuse Symfony\\Component\\DependencyInjection\\Definition;\nuse Symfony\\Component\\DependencyInjection\\Extension\\Extension;\nuse Symfony\\Component\\DependencyInjection\\Loader\\YamlFileLoader;\nuse Symfony\\Component\\DependencyInjection\\Reference;\nuse Symfony\\Component\\HttpKernel\\Kernel;\n\nclass AwsExtension extends Extension\n{\n    public function load(array $configs, ContainerBuilder $container)\n    {\n        $loader = new YamlFileLoader(\n            $container,\n            new FileLocator(__DIR__ . '/../Resources/config')\n        );\n        $loader->load('services.yml');\n\n        $configuration = new Configuration();\n        $config = $this->processConfiguration($configuration, $configs);\n        $this->inflateServicesInConfig($config);\n\n        $container\n            ->getDefinition('aws_sdk')\n            ->replaceArgument(0, $config + ['ua_append' => [\n                'Symfony/' . Kernel::VERSION,\n                'SYMOD/' . AwsBundle::VERSION,\n            ]]);\n\n        foreach (array_column(Aws\\manifest(), 'namespace') as $awsService) {\n            $serviceName = 'aws.' . strtolower($awsService);\n            $serviceDefinition = $this->createServiceDefinition($awsService);\n            $container->setDefinition($serviceName, $serviceDefinition);\n\n            $container->setAlias($serviceDefinition->getClass(), $serviceName);\n        }\n    }\n\n\n    private function createServiceDefinition($name)\n    {\n        $clientClass = \"Aws\\\\{$name}\\\\{$name}Client\";\n        $serviceDefinition = new Definition(\n            class_exists($clientClass) ? $clientClass : AwsClient::class\n        );\n\n        $serviceDefinition->setLazy(true);\n\n        // Handle Symfony >= 2.6\n        if (method_exists($serviceDefinition, 'setFactory')) {\n            return $serviceDefinition->setFactory([\n                new Reference('aws_sdk'),\n                'createClient',\n            ])->setArguments([$name]);\n        }\n\n        return $serviceDefinition\n                ->setFactoryService('aws_sdk')\n                ->setFactoryMethod('createClient')\n                ->setArguments([$name]);\n    }\n\n    private function inflateServicesInConfig(array &$config)\n    {\n        array_walk($config, function (&$value) {\n            if (is_array($value)) {\n                $this->inflateServicesInConfig($value);\n            }\n\n            if (is_string($value) && 0 === strpos($value, '@')) {\n                // this is either a service reference or a string meant to\n                // start with an '@' symbol. In any case, lop off the first '@'\n                $value = substr($value, 1);\n                if (0 !== strpos($value, '@')) {\n                    // this is a service reference, not a string literal\n                    $value = new Reference($value);\n                }\n            }\n        });\n    }\n}\n", "num_lines": 89}
{"repo_name": "aws-sdk-php-symfony", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Symfony\\DependencyInjection;\n\nuse Aws;\nuse Symfony\\Component\\Config\\Definition\\Builder\\TreeBuilder;\nuse Symfony\\Component\\Config\\Definition\\ConfigurationInterface;\n\nclass Configuration implements ConfigurationInterface\n{\n    public function getConfigTreeBuilder()\n    {\n        // Maintain backwars compatibility, only merge when AWS_MERGE_CONFIG is set\n        $mergeConfig = $this->shouldMergeConfig();\n        $treeType = 'variable';\n\n        if ($mergeConfig) {\n            $treeType = 'array';\n        }\n\n        // Most recent versions of TreeBuilder have a constructor\n        if (\\method_exists(TreeBuilder::class, '__construct')) {\n            $treeBuilder = new TreeBuilder('aws', $treeType);\n        } else { // which is not the case for older versions\n            $treeBuilder = new TreeBuilder;\n            $treeBuilder->root('aws', $treeType);\n        }\n\n        // If not AWS_MERGE_CONFIG, return empty, variable TreeBuilder\n        if (!$mergeConfig) {\n            return $treeBuilder;\n        }\n\n        if (method_exists($treeBuilder, 'getRootNode')) {\n            $rootNode = $treeBuilder->getRootNode();\n        } else {\n            $rootNode = $treeBuilder->root('aws', $treeType);\n        }\n\n        // Define TreeBuilder to allow config validation and merging\n        $rootNode\n            ->ignoreExtraKeys(false)\n            ->children()\n                ->variableNode('credentials')->end()\n                ->variableNode('debug')->end()\n                ->variableNode('stats')->end()\n                ->scalarNode('endpoint')->end()\n                ->variableNode('endpoint_discovery')->end()\n                ->arrayNode('http')\n                    ->children()\n                        ->floatNode('connect_timeout')->end()\n                        ->booleanNode('debug')->end()\n                        ->booleanNode('decode_content')->end()\n                        ->integerNode('delay')->end()\n                        ->variableNode('expect')->end()\n                        ->variableNode('proxy')->end()\n                        ->scalarNode('sink')->end()\n                        ->booleanNode('synchronous')->end()\n                        ->booleanNode('stream')->end()\n                        ->floatNode('timeout')->end()\n                        ->scalarNode('verify')->end()\n                    ->end()\n                ->end()\n                ->scalarNode('profile')->end()\n                ->scalarNode('region')->end()\n                ->integerNode('retries')->end()\n                ->scalarNode('scheme')->end()\n                ->scalarNode('service')->end()\n                ->scalarNode('signature_version')->end()\n                ->variableNode('ua_append')->end()\n                ->variableNode('validate')->end()\n                ->scalarNode('version')->end()\n            ->end()\n        ;\n\n        //Setup config trees for each of the services\n        foreach (array_column(Aws\\manifest(), 'namespace') as $awsService) {\n            $rootNode\n                ->children()\n                    ->arrayNode($awsService)\n                        ->ignoreExtraKeys(false)\n                        ->children()\n                            ->variableNode('credentials')->end()\n                            ->variableNode('debug')->end()\n                            ->variableNode('stats')->end()\n                            ->scalarNode('endpoint')->end()\n                            ->variableNode('endpoint_discovery')->end()\n                            ->arrayNode('http')\n                                ->children()\n                                    ->floatNode('connect_timeout')->end()\n                                    ->booleanNode('debug')->end()\n                                    ->booleanNode('decode_content')->end()\n                                    ->integerNode('delay')->end()\n                                    ->variableNode('expect')->end()\n                                    ->variableNode('proxy')->end()\n                                    ->scalarNode('sink')->end()\n                                    ->booleanNode('synchronous')->end()\n                                    ->booleanNode('stream')->end()\n                                    ->floatNode('timeout')->end()\n                                    ->scalarNode('verify')->end()\n                                ->end()\n                            ->end()\n                            ->scalarNode('profile')->end()\n                            ->scalarNode('region')->end()\n                            ->integerNode('retries')->end()\n                            ->scalarNode('scheme')->end()\n                            ->scalarNode('service')->end()\n                            ->scalarNode('signature_version')->end()\n                            ->variableNode('ua_append')->end()\n                            ->variableNode('validate')->end()\n                            ->scalarNode('version')->end()\n                        ->end()\n                    ->end()\n                ->end()\n            ;\n        }\n\n        return $treeBuilder;\n    }\n\n    protected function shouldMergeConfig()\n    {\n        # works with symfony/dotenv\n        if (isset($_ENV['AWS_MERGE_CONFIG'])) {\n            return $_ENV['AWS_MERGE_CONFIG'];\n        }\n\n        # works with case-insensitive names on windows and doesn't work with symfony/dotenv\n        $mergeConfig = getenv('AWS_MERGE_CONFIG');\n\n        if ($mergeConfig) {\n            @trigger_error(\n                'Since aws/aws-sdk-php-symfony 2.5.0: Support for case-insensitive'\n                . ' AWS_MERGE_CONFIG is deprecated and will be removed in 3.0.0',\n                \\E_USER_DEPRECATED\n            );\n        }\n\n        return $mergeConfig;\n    }\n}\n", "num_lines": 142}
{"repo_name": "aws-sdk-php-symfony", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Symfony\\DependencyInjection;\n\nuse AppKernel;\nuse Aws\\AwsClient;\nuse Aws\\CodeDeploy\\CodeDeployClient;\nuse Aws\\Lambda\\LambdaClient;\nuse Aws\\S3\\S3Client;\nuse PHPUnit\\Framework\\TestCase;\nuse Symfony\\Component\\DependencyInjection\\ContainerBuilder;\nuse Symfony\\Component\\DependencyInjection\\ContainerInterface;\nuse Symfony\\Component\\DependencyInjection\\Reference;\n\nclass AwsExtensionTest extends TestCase\n{\n    /**\n     * @var AppKernel\n     */\n    protected $kernel;\n\n    /**\n     * @var ContainerInterface\n     */\n    protected $container;\n\n    public function setUp()\n    {\n        $this->kernel = new AppKernel('test', true);\n        $this->kernel->boot();\n\n        $this->container = $this->kernel->getContainer();\n    }\n\n    /**\n     * @test\n     */\n    public function sdk_config_should_be_passed_directly_to_the_constructor_and_resolved_by_the_sdk()\n    {\n        $config           = $this->kernel->getTestConfig()['aws'];\n        $s3Region         = isset($config['S3']['region']) ? $config['S3']['region'] : $config['region'];\n        $lambdaRegion     = isset($config['Lambda']['region']) ? $config['Lambda']['region'] : $config['region'];\n        $codeDeployRegion = isset($config['CodeDeploy']['region']) ? $config['CodeDeploy']['region'] : $config['region'];\n\n        $testService = $this->container->get('test_service');\n\n        $this->assertSame($s3Region, $testService->getS3Client()->getRegion());\n        $this->assertSame($lambdaRegion, $testService->getLambdaClient()->getRegion());\n        $this->assertSame($codeDeployRegion, $testService->getCodeDeployClient()->getRegion());\n    }\n\n    /**\n     * @test\n     *\n     */\n    public function all_web_services_in_sdk_manifest_should_be_accessible_as_container_services() {\n        $testService = $this->container->get('test_service');\n\n        $this->assertInstanceOf(S3Client::class, $testService->getS3Client());\n        $this->assertInstanceOf(LambdaClient::class, $testService->getLambdaClient());\n        $this->assertInstanceOf(CodeDeployClient::class, $testService->getCodeDeployClient());\n\n        foreach ($testService->getClients() as $client) {\n            $this->assertInstanceOf(AwsClient::class, $client);\n        }\n    }\n\n    /**\n     * @test\n     */\n    public function extension_should_escape_strings_that_begin_with_at_sign()\n    {\n        $extension = new AwsExtension;\n        $config = ['credentials' => [\n            'key' => '@@key',\n            'secret' => '@@secret'\n        ]];\n        $container = $this->getMockBuilder(ContainerBuilder::class)\n            ->setMethods(['getDefinition', 'replaceArgument'])\n            ->getMock();\n        $container->expects($this->once())\n            ->method('getDefinition')\n            ->with('aws_sdk')\n            ->willReturnSelf();\n        $container->expects($this->once())\n            ->method('replaceArgument')\n            ->with(0, $this->callback(function ($arg) {\n                return is_array($arg)\n                    && isset($arg['credentials'])\n                    && $arg['credentials'] === [\n                        'key' => '@key',\n                        'secret' => '@secret'\n                    ];\n            }));\n\n        $extension->load([$config], $container);\n    }\n\n    /**\n     * @test\n     */\n    public function extension_should_expand_service_references()\n    {\n        $extension = new AwsExtension;\n        $config = ['credentials' => '@aws_sdk'];\n        $container = $this->getMockBuilder(ContainerBuilder::class)\n            ->setMethods(['getDefinition', 'replaceArgument'])\n            ->getMock();\n        $container->expects($this->once())\n            ->method('getDefinition')\n            ->with('aws_sdk')\n            ->willReturnSelf();\n        $container->expects($this->once())\n            ->method('replaceArgument')\n            ->with(0, $this->callback(function ($arg) {\n                return is_array($arg)\n                    && isset($arg['credentials'])\n                    && $arg['credentials'] instanceof Reference\n                    && (string) $arg['credentials'] === 'aws_sdk';\n            }));\n\n        $extension->load([$config], $container);\n    }\n\n    /**\n     * @test\n     */\n    public function extension_should_validate_and_merge_configs()\n    {\n        putenv('AWS_MERGE_CONFIG=true');\n        $extension = new AwsExtension;\n        $config = [\n            'credentials' => false,\n            'debug' => [\n                'http' => true\n            ],\n            'stats' => [\n                'http' => true\n            ],\n            'retries' => 5,\n            'endpoint' => 'http://localhost:8000',\n            'endpoint_discovery' => [\n                'enabled' => true,\n                'cache_limit' => 1000\n            ],\n            'http' => [\n                'connect_timeout' => 5.5,\n                'debug' => true,\n                'decode_content' => true,\n                'delay' => 1,\n                'expect' => true,\n                'proxy' => 'http://localhost:9000',\n                'sink' => '/path/to/sink',\n                'synchronous' => true,\n                'stream' => true,\n                'timeout' => 3.14,\n                'verify' => '/path/to/ca_cert_bundle'\n            ],\n            'profile' => 'prod',\n            'region' => 'us-west-2',\n            'retries' => 5,\n            'scheme' => 'http',\n            'signature_version' => 'v4',\n            'ua_append' => [\n                'prod',\n                'foo'\n            ],\n            'validate' => [\n                'required' => true\n            ],\n            'version' => 'latest',\n            'S3' => [\n                'version' => '2006-03-01',\n            ]\n        ];\n        $configDev = [\n            'credentials' => '@aws_sdk',\n            'debug' => true,\n            'stats' => true,\n            'ua_append' => 'dev',\n            'validate' => true,\n        ];\n        $container = $this->getMockBuilder(ContainerBuilder::class)\n            ->setMethods(['getDefinition', 'replaceArgument'])\n            ->getMock();\n        $container->expects($this->once())\n            ->method('getDefinition')\n            ->with('aws_sdk')\n            ->willReturnSelf();\n        $container->expects($this->once())\n            ->method('replaceArgument')\n            ->with(0, $this->callback(function ($arg) {\n                return is_array($arg)\n                    && isset($arg['credentials'])\n                    && $arg['credentials'] instanceof Reference\n                    && (string) $arg['credentials'] === 'aws_sdk'\n                    && isset($arg['debug'])\n                    && (bool) $arg['debug'] === true\n                    && isset($arg['stats'])\n                    && (bool) $arg['stats'] === true\n                    && isset($arg['retries'])\n                    && (integer) $arg['retries'] === 5\n                    && isset($arg['endpoint'])\n                    && (string) $arg['endpoint'] === 'http://localhost:8000'\n                    && isset($arg['validate'])\n                    && (bool) $arg['validate'] === true\n                    && isset($arg['endpoint_discovery']['enabled'])\n                    && isset($arg['endpoint_discovery']['cache_limit'])\n                    && (bool) $arg['endpoint_discovery']['enabled'] === true\n                    && (integer) $arg['endpoint_discovery']['cache_limit'] === 1000\n                    && isset($arg['S3']['version'])\n                    && (string) $arg['S3']['version'] === '2006-03-01'\n                ;\n            }));\n\n        $extension->load([$config, $configDev], $container);\n    }\n\n    /**\n     * @test\n     */\n    public function extension_should_error_merging_unknown_config_options()\n    {\n        putenv('AWS_MERGE_CONFIG=true');\n        $extension = new AwsExtension;\n        $config = [\n            'foo' => 'bar'\n        ];\n        $configDev = [\n            'foo' => 'baz'\n        ];\n        $container = $this->getMockBuilder(ContainerBuilder::class)\n            ->setMethods(['getDefinition', 'replaceArgument'])\n            ->getMock();\n\n        try {\n            $extension->load([$config, $configDev], $container);\n            $this->fail('Should have thrown an Error or RuntimeException');\n        } catch (\\Exception $e) {\n            $this->assertTrue($e instanceof \\RuntimeException);\n        } catch (\\Throwable $e) {\n            $this->assertTrue($e instanceof \\Error);\n        }\n    }\n}\n", "num_lines": 246}
{"repo_name": "aws-sdk-php-symfony", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Symfony\\DependencyInjection;\n\nuse AppKernel;\nuse Aws\\DynamoDb\\DynamoDbClient;\nuse Aws\\Lambda\\LambdaClient;\nuse Aws\\S3\\S3Client;\nuse PHPUnit\\Framework\\TestCase;\nuse Symfony\\Component\\Filesystem\\Filesystem;\n\nclass ConfigurationTest extends TestCase\n{\n    public function setUp()\n    {\n        (new Filesystem)\n            ->remove(implode(DIRECTORY_SEPARATOR, [\n                dirname(__DIR__),\n                'fixtures',\n                'cache',\n                'test',\n            ]));\n    }\n\n    /**\n     * @test\n     * @dataProvider formatProvider\n     *\n     * @param string $format\n     */\n    public function container_should_compile_and_load($format)\n    {\n        $kernel = new AppKernel('test', true, $format);\n        $kernel->boot();\n\n        $testService = $kernel->getContainer()->get('test_service');\n\n        $this->assertInstanceOf(S3Client::class, $testService->getS3Client());\n        $this->assertInstanceOf(LambdaClient::class, $testService->getLambdaClient());\n        $this->assertNotInstanceOf(DynamoDbClient::class, $testService->getCodeDeployClient());\n    }\n\n    public function formatProvider()\n    {\n        return [\n            ['yml'],\n            ['php'],\n            ['xml'],\n        ];\n    }\n}\n", "num_lines": 51}
{"repo_name": "aws-sdk-php-symfony", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nuse Aws\\Symfony\\AwsBundle;\nuse Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle;\nuse Symfony\\Component\\Config\\Loader\\LoaderInterface;\nuse Symfony\\Component\\HttpKernel\\Kernel;\nuse Symfony\\Component\\Yaml\\Yaml;\n\nclass AppKernel extends Kernel\n{\n    private $extension;\n\n    public function __construct($env, $debug, $extension = 'yml')\n    {\n        $this->extension = $extension;\n        parent::__construct($env, $debug);\n    }\n\n    public function registerBundles()\n    {\n        return [\n            new FrameworkBundle(),\n            new AwsBundle(),\n        ];\n    }\n\n    public function registerContainerConfiguration(LoaderInterface $loader)\n    {\n        $loader->load($this->getTestConfigFile($this->extension));\n    }\n\n    public function getTestConfig()\n    {\n        return Yaml::parse(file_get_contents($this->getTestConfigFile('yml')));\n    }\n\n\n    private function getTestConfigFile($extension)\n    {\n        return __DIR__ . '/config.' . $extension;\n    }\n}\n", "num_lines": 43}
{"repo_name": "aws-sdk-php-symfony", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nuse Aws\\DynamoDb\\DynamoDbClient;\nuse Symfony\\Component\\DependencyInjection\\Reference;\n\n$container->loadFromExtension('framework', [\n    'secret' =>  'Rosebud was the name of his sled.',\n]);\n\n$container->loadFromExtension('aws', [\n    'version' => 'latest',\n    'region' => 'us-east-1',\n    'credentials' => [\n        'key' => 'not-a-real-key',\n        'secret' => '@@not-a-real-secret', // this will be escaped as '@not-a-real-secret'\n    ],\n    'DynamoDb' =>[\n        'region' => 'us-west-2',\n    ],\n    'S3' => [\n        'version' => '2006-03-01',\n    ],\n    'Lambda' => [\n        'region' => 'us-central-1'\n    ],\n    'CodeDeploy' => [\n        'region' => 'us-west-2'\n    ],\n    'Sqs' =>[\n        'credentials' => new Reference('a_service'), // '@a_service' would also work in a PHP config\n    ],\n    'CloudSearchDomain' => [\n        'endpoint' => 'https://search-with-some-subdomain.us-east-1.cloudsearch.amazonaws.com',\n    ],\n]);\n\n$container\n    ->register('a_service', 'Aws\\\\Credentials\\\\Credentials')\n    ->addArgument('a-different-fake-key')\n    ->addArgument('a-different-fake-secret');\n\n$container\n    ->register('test_service', 'Aws\\\\Symfony\\\\fixtures\\\\TestService')\n    ->setPublic(true)\n    ->addArgument(new Reference('aws.s3'))\n    ->addArgument(new Reference('aws.lambda'))\n    ->addArgument(new Reference('aws.codedeploy'));\n\n$container\n    ->register(DynamoDbClient::class, DynamoDbClient::class)\n    ->addArgument([\n        'region' => 'eu-central-1',\n        'version' => '2012-08-10',\n    ]);\n", "num_lines": 55}
{"repo_name": "aws-sdk-php-symfony", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Symfony\\fixtures;\n\nuse Aws\\CodeDeploy\\CodeDeployClient;\nuse Aws\\Lambda\\LambdaClient;\nuse Aws\\S3\\S3Client;\n\nclass TestService\n{\n    /** @var S3Client */\n    protected $s3Client;\n\n    /** @var LambdaClient */\n    protected $lambdaClient;\n\n    /** @var CodeDeployClient */\n    protected $codeDeployClient;\n\n    /**\n     * @param S3Client $s3Client\n     * @param LambdaClient $lambdaClient\n     * @param CodeDeployClient $codeDeployClient\n     */\n    public function __construct(\n        S3Client $s3Client,\n        LambdaClient $lambdaClient,\n        CodeDeployClient $codeDeployClient\n    ) {\n        $this->s3Client         = $s3Client;\n        $this->lambdaClient     = $lambdaClient;\n        $this->codeDeployClient = $codeDeployClient;\n    }\n\n    /**\n     * @return S3Client\n     */\n    public function getS3Client()\n    {\n        return $this->s3Client;\n    }\n\n    /**\n     * @return LambdaClient\n     */\n    public function getLambdaClient()\n    {\n        return $this->lambdaClient;\n    }\n\n    /**\n     * @return CodeDeployClient\n     */\n    public function getCodeDeployClient()\n    {\n        return $this->codeDeployClient;\n    }\n\n    /**\n     * @return array\n     */\n    public function getClients()\n    {\n        return [\n            $this->s3Client,\n            $this->lambdaClient,\n            $this->codeDeployClient\n        ];\n    }\n}\n", "num_lines": 71}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n/**\n * This file is responsible for adding @method annotations to each client class.\n */\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse Aws\\SimpleDb\\SimpleDbClient;\nuse Aws\\ImportExport\\ImportExportClient;\n\nforeach ([SimpleDbClient::class, ImportExportClient::class] as $classToUpdate) {\n    // Update the @method annotations on a client.\n    $annotator = new ClientAnnotator($classToUpdate);\n\n    if (!$annotator->updateApiMethodAnnotations()) {\n        trigger_error(\n            \"Unable to update annotations on $classToUpdate\",\n            E_USER_WARNING\n        );\n    }\n}\n", "num_lines": 21}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\n/**\n * Adds and removes annotations to a class.\n *\n * @internal\n */\nclass ClassAnnotationUpdater\n{\n    use PhpFileLinterTrait;\n\n    /** @var ReflectionClass */\n    private $reflection;\n    /** @var string[] */\n    private $linesToAppend;\n    /** @var string */\n    private $defaultDocBlock;\n    /** @var string */\n    private $removeMatching;\n\n    public function __construct(\n        ReflectionClass $reflection,\n        array $linesToAppend,\n        $defaultDocBlock,\n        $removeMatching = ''\n    ) {\n        $this->reflection = $reflection;\n        $this->linesToAppend = $linesToAppend;\n        $this->defaultDocBlock = $defaultDocBlock;\n        $this->removeMatching = $removeMatching;\n    }\n\n    /**\n     * Performs update on class file and lints the output. If the output fails\n     * linting, the change is reverted.\n     *\n     * @return bool TRUE on success, FALSE on failure\n     */\n    public function update()\n    {\n        // copy the code into memory\n        $backup = file($this->reflection->getFileName());\n\n        list($preamble, $class) = $this->splitClassFile($backup);\n        $preamble = $this->stripOutExistingDocBlock($preamble);\n        $preamble .= $this->buildUpdatedDocBlock();\n\n        if ($this->writeClassFile(implode(PHP_EOL, [$preamble, $class]))\n            && $this->commandLineLint($this->reflection->getFileName())\n        ) {\n            return true;\n        }\n\n        $this->writeClassFile(implode('', $backup));\n        return false;\n    }\n\n    private function splitClassFile(array $lines)\n    {\n        $classLineOffset = $this->reflection->getStartLine() - 1;\n        return [\n            implode('', array_slice($lines, 0, $classLineOffset)),\n            implode('', array_slice($lines, $classLineOffset)),\n        ];\n    }\n\n    private function stripOutExistingDocBlock($preamble)\n    {\n        if ($this->reflection->getDocComment()) {\n            return str_replace(\n                $this->reflection->getDocComment() . PHP_EOL,\n                '',\n                $preamble\n            );\n        }\n\n        return $preamble;\n    }\n\n    private function buildUpdatedDocBlock()\n    {\n        $docBlockLines = explode(\n            PHP_EOL,\n            $this->reflection->getDocComment() ?: $this->defaultDocBlock\n        );\n\n        // remove lines matching exclusion patterns\n        if ($this->removeMatching) {\n            $docBlockLines = array_filter($docBlockLines, function ($line) {\n                return !preg_match($this->removeMatching, trim($line));\n            });\n        }\n\n        // hold on to the closing line\n        $lastLine = array_pop($docBlockLines);\n\n        // add a padding line if needed\n        if (' *' !== end($docBlockLines)) {\n            $docLines []= ' *';\n        }\n\n        // append API @method annotations\n        $docBlockLines = array_merge($docBlockLines, $this->linesToAppend);\n\n        // add back the closing line\n        $docBlockLines []= $lastLine;\n\n        // send everything back as a string\n        return implode(PHP_EOL, $docBlockLines);\n    }\n\n    private function writeClassFile($contents)\n    {\n        return (bool) file_put_contents(\n            $this->reflection->getFileName(),\n            $contents,\n            LOCK_EX\n        );\n    }\n}\n", "num_lines": 121}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nuse Aws\\Api\\BridgeApiProvider;\n\nclass ClientAnnotator\n{\n    /** @var ReflectionClass */\n    private $reflection;\n    /** @var string */\n    private $endpoint;\n    /** @var string[] */\n    private $versions;\n    /** @var array */\n    private $methods;\n\n\n    public function __construct($clientClassName)\n    {\n        $this->reflection = new ReflectionClass($clientClassName);\n    }\n\n    /**\n     * Adds @method annotations to a client class.\n     *\n     * @return bool TRUE on success, FALSE on failure\n     */\n    public function updateApiMethodAnnotations()\n    {\n        $updater = new ClassAnnotationUpdater(\n            $this->reflection,\n            $this->getMethodAnnotations(),\n            $this->getDefaultDocComment(),\n            '/^\\* @method (\\\\\\\\Aws\\\\\\\\Result|\\\\\\\\GuzzleHttp\\\\\\\\Promise\\\\\\\\Promise) /'\n        );\n\n        return $updater->update();\n    }\n\n    private function getMethodAnnotations()\n    {\n        $annotations = [];\n\n        foreach ($this->getMethods() as $command => $apiVersions) {\n            $commandMethods = [\n                $command => '\\\\Aws\\\\Result',\n                \"{$command}Async\" => '\\\\GuzzleHttp\\\\Promise\\\\Promise',\n            ];\n            foreach ($commandMethods as $method => $returnType) {\n                $annotations []= $this->getAnnotationLine(\n                    $method,\n                    $returnType,\n                    $apiVersions\n                );\n            }\n        }\n\n        return $annotations;\n    }\n\n    private function getAnnotationLine($method, $return, array $versionsWithSupport)\n    {\n        $signature = lcfirst($method) . '(array $args = [])';\n        $annotation = \" * @method $return $signature\";\n\n        if ($versionsWithSupport !== $this->getVersions()) {\n            $supportedIn = implode(', ', $versionsWithSupport);\n            $annotation .= \" (supported in versions $supportedIn)\";\n        }\n\n        return $annotation;\n    }\n\n    private function getMethods()\n    {\n        if (empty($this->methods)) {\n            $this->methods = [];\n\n            foreach ($this->getVersions() as $version) {\n                $methodsInVersion = array_keys(\n                    $this->getApiDefinition($version)['operations']\n                );\n                foreach ($methodsInVersion as $method) {\n                    if (empty($this->methods[$method])) {\n                        $this->methods[$method] = [];\n                    }\n\n                    $this->methods[$method] []= $version;\n                }\n            }\n        }\n\n        return $this->methods;\n    }\n\n    private function getVersions()\n    {\n        if (empty($this->versions)) {\n            $this->versions = BridgeApiProvider::defaultProvider()\n                ->getVersions($this->getEndpoint());\n\n            // ensure that versions are always iterated from oldest to newest\n            sort($this->versions);\n        }\n\n        return $this->versions;\n    }\n\n    private function getApiDefinition($version = 'latest')\n    {\n        $provider = BridgeApiProvider::defaultProvider();\n        return $provider('api', $this->getEndpoint(), $version);\n    }\n\n    private function getEndpoint()\n    {\n        if (empty($this->endpoint)) {\n            $service = strtolower(\n                preg_replace('/Client$/', '', $this->reflection->getShortName())\n            );\n\n            $this->endpoint = [\n                'simpledb' => 'sdb',\n                'importexport' => 'importexport'\n            ][$service];\n        }\n\n        return $this->endpoint;\n    }\n\n    private function getDefaultDocComment()\n    {\n        return <<<EODC\n/**\n * **{$this->getApiDefinition()['metadata']['serviceFullName']}** client.\n */\nEODC;\n    }\n}\n", "num_lines": 139}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\n$lock = json_decode(file_get_contents(__DIR__ . '/../composer.lock'), true);\n$sdkVersion = null;\n\nforeach ($lock['packages'] as $installedPackage) {\n    if ('aws/aws-sdk-php' === $installedPackage['name']) {\n        $sdkVersion = $installedPackage['version'];\n        break;\n    }\n}\n\nif (isset($sdkVersion)) {\n    exec(\"git clone --branch=$sdkVersion --depth=1 git@github.com:aws/aws-sdk-php.git\");\n} else {\n    exit(255);\n}\n", "num_lines": 18}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nrequire __DIR__ . '/../vendor/autoload.php';\n\n/**\n * Finds all JSON files in src/data, converts them to PHP files that return\n * arrays, and writes those files to $originalFileName.json.php.\n */\n$dataFilesIterator = \\Aws\\recursive_dir_iterator(realpath(__DIR__ . '/../src/data'));\n\nforeach (new RegexIterator($dataFilesIterator, '/\\.json$/') as $dataFile) {\n    (new JsonCompiler($dataFile))\n        ->compile(\"$dataFile.php\");\n}\n", "num_lines": 14}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nclass JsonCompiler\n{\n    use PhpFileLinterTrait;\n\n    private static $tokensToReplace = [\n        '(' => '__OPEN_PARENTHESIS__',\n        ')' => '__CLOSE_PARENTHESIS__',\n    ];\n\n    /** @var string */\n    private $path;\n\n    public function __construct($path)\n    {\n        if (!file_exists($path)) {\n            throw new InvalidArgumentException(\"No JSON file found at $path\");\n        }\n\n        $this->path = realpath($path);\n    }\n\n    public function compile($outputPath)\n    {\n        $backup = $this->readPhpFile($outputPath);\n\n        $this->writeFile($outputPath, $this->getTranspiledPhp());\n        if (!$this->lintFile($outputPath)) {\n            $this->writeFile($outputPath, $backup);\n            trigger_error(\n                \"Unable to compile {$this->path} to valid PHP\",\n                E_USER_WARNING\n            );\n        }\n    }\n\n    private function getTranspiledPhp()\n    {\n        // Use var_export as a starting point.\n        $code = var_export($this->getDecodedData(), true);\n\n        // Convert \"array()\" to \"[]\".\n        $code = str_replace('array (', '[', $code);\n        $code = str_replace(')', ']', $code);\n\n        // Removing trailing whitespace.\n        $code = preg_replace('/\\s+$/m', '', $code);\n\n        // Move arrays to the same line.\n        $code = preg_replace('/=>\\s*\\n\\s*\\[/', '=> [', $code);\n\n        // Get rid of numbered array indexes.\n        $code = preg_replace('/(\\s*)(\\d+ => )/', '$1', $code);\n\n        // Make empty arrays span only a single line.\n        $code = preg_replace('/=>\\s*\\[\\n\\s*\\]/', '=> []', $code);\n\n        // Minify the PHP file\n        $code = preg_replace('/\\s+/', ' ', str_replace(\"\\n\", '', $code));\n\n        $originalPath = preg_replace('/^.+?(?=\\/src\\/data\\/)/', '', $this->path);\n\n        return <<<EOPHP\n<?php\n// This file was auto-generated from sdk-root$originalPath\nreturn $code;\n\nEOPHP;\n    }\n\n    private function getDecodedData()\n    {\n        return json_decode(\n            strtr(file_get_contents($this->path), self::$tokensToReplace),\n            true\n        );\n    }\n\n    private function readPhpFile($path)\n    {\n        return file_exists($path) ?\n            file_get_contents($path)\n            : '<?php return [];';\n    }\n\n    private function writeFile($path, $contents)\n    {\n        return file_put_contents(\n            $path,\n            strtr($contents, array_flip(self::$tokensToReplace)),\n            LOCK_EX\n        );\n    }\n}\n", "num_lines": 96}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\n/**\n * A trait that provides a method for linting a PHP file. It will use\n * `opcache_compile` if available and fall back to shelling out to `php -l`\n * otherwise.\n *\n * @internal\n */\ntrait PhpFileLinterTrait\n{\n    /**\n     * @param string $path\n     *\n     * @return bool\n     */\n    private function lintFile($path)\n    {\n        static $linter;\n\n        if (empty($linter)) {\n            $linter = function_exists('opcache_get_status')\n                && !empty(opcache_get_status(false)['opcache_enabled'])\n                    ? [$this, 'opcacheLint']\n                    : [$this, 'commandLineLint'];\n        }\n\n        return call_user_func($linter, $path);\n    }\n\n    /**\n     * @param string $path\n     *\n     * @return bool\n     */\n    private function commandLineLint($path)\n    {\n        list($output, $exitCode) = [[], 1];\n        exec(\"php -l $path\", $output, $exitCode);\n\n        return 0 === $exitCode;\n    }\n\n    /**\n     * Uses the Zend OPCache control functions to perform an in-process\n     * validation of a file. This function will fail on code that declares new\n     * symbols (e.g., classes or functions) if they have already been loaded\n     * into the current process.\n     *\n     * @param string $path\n     *\n     * @return bool\n     */\n    private function opcacheLint($path)\n    {\n        opcache_invalidate($path, true);\n\n        return @opcache_compile_file($path);\n    }\n}\n", "num_lines": 61}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Test;\n\nuse Aws;\nuse Aws\\Api\\ApiProvider;\nuse Aws\\Api\\Service;\nuse Aws\\Result;\nuse Aws\\S3\\S3Client;\nuse Behat\\Behat\\Context\\Context;\nuse Behat\\Behat\\Context\\SnippetAcceptingContext;\nuse Behat\\Behat\\Hook\\Scope\\AfterScenarioScope;\nuse Behat\\Behat\\Hook\\Scope\\BeforeScenarioScope;\nuse DomainException;\nuse PHPUnit_Framework_Assert as Assert;\nuse GuzzleHttp\\Psr7;\n\n/**\n * Defines application features from the specific context.\n */\nclass PerformanceContext implements Context, SnippetAcceptingContext\n{\n    use UsesServiceTrait;\n\n    /** @var array */\n    private $resourceUsageSnapshot = [];\n    /** @var string[] */\n    private $serviceList = [];\n    /** @var array */\n    private $clients = [];\n    /** @var string */\n    private $tempFilePath;\n    /** @var S3Client */\n    private $s3Client;\n\n    /**\n     * @BeforeScenario @streaming\n     *\n     * @param BeforeScenarioScope $scope\n     */\n    public function setUp(BeforeScenarioScope $scope)\n    {\n        $this->s3Client = $this->getTestClient('s3');\n    }\n\n    /**\n     * @AfterScenario @streaming\n     *\n     * @param AfterScenarioScope $scope\n     */\n    public function cleanUpFile(AfterScenarioScope $scope)\n    {\n        if ($this->tempFilePath) {\n            unlink($this->tempFilePath);\n        }\n    }\n\n    /**\n     * @Given I have loaded my SDK and its dependencies\n     */\n    public function iHaveLoadedMySdkAndItsDependencies()\n    {\n        $this->iCreateAndDiscardClientSForEachService(1);\n    }\n\n    /**\n     * @Given I take a snapshot of my resources\n     */\n    public function iTakeASnapshotOfMyResources()\n    {\n        $this->resourceUsageSnapshot = [\n            'memory' => memory_get_usage(),\n            'open_file_handles' => $this->getOpenFileHandleCount(),\n        ];\n    }\n\n    /**\n     * @Given I have a list of services\n     */\n    public function iHaveAListOfServices()\n    {\n        $this->serviceList = array_keys(Aws\\manifest());\n    }\n\n    /**\n     * @Given /^I have a (\\d+) byte file$/\n     */\n    public function iHaveAByteFile($fileSize)\n    {\n        $path = tempnam(sys_get_temp_dir(), 'performance_test');\n        $kb = ceil($fileSize / 1024);\n\n        if (self::isRunningOnWindows()) {\n            // dd is not available, so write out a file of the requisite size\n            $handle = fopen($path, 'w');\n            $dummyText = str_repeat('x', 1024);\n            for ($i = 0; $i < $kb; $i++) {\n                fwrite($handle, $dummyText);\n            }\n            fclose($handle);\n        } else {\n            shell_exec(\"dd if=/dev/zero of=$path bs=1024 count=$kb >& /dev/null\");\n        }\n\n        $this->tempFilePath = $path;\n    }\n\n    /**\n     * @When I create a client for each service\n     */\n    public function iCreateAClientForEachService()\n    {\n        foreach ($this->serviceList as $service) {\n            $this->clients[$service] = $this->getTestClient($service, [\n                'CloudSearchDomain' => [\n                    'endpoint' => 'https://aws.amazon.com',\n                ],\n            ]);\n        }\n    }\n\n    /**\n     * @When /^I create and discard (\\d+) clients for each service$/\n     */\n    public function iCreateAndDiscardClientSForEachService($numClients)\n    {\n        foreach ($this->serviceList as $service) {\n            for ($i = 0; $i < $numClients; $i++) {\n                $this->getTestClient($service, [\n                    'CloudSearchDomain' => [\n                        'endpoint' => 'https://aws.amazon.com',\n                    ],\n                ]);\n            }\n        }\n    }\n\n    /**\n     * @When /^I execute (\\d+) command\\(s\\) on each client$/\n     */\n    public function iExecuteCommandsOnEachClient($numCommands)\n    {\n        foreach ($this->serviceList as $service) {\n            try {\n                $operation = $this\n                    ->findOperationWithNoRequiredParameters($service);\n                $this->addMockResults(\n                    $this->clients[$service],\n                    array_fill(0, $numCommands, new Result)\n                );\n\n                for ($i = 0; $i < $numCommands; $i++) {\n                    $this->clients[$service]->execute(\n                        $this->clients[$service]->getCommand($operation)\n                    );\n                }\n            } catch (DomainException $e) {\n                // This step cannot be completed due to service constraints.\n            }\n        }\n    }\n\n    /**\n     * @When I upload the file\n     */\n    public function iUploadTheFile()\n    {\n        $options = [\n            'concurrency' => 5,\n            'mup_threshold' => 16 * 1024 * 1024,\n            'part_size' => 5 * 1024 * 1024,\n        ];\n        $putObject = new Result();\n        $initiate = new Result(['UploadId' => 'foo']);\n        $putPart = new Result(['ETag' => 'bar']);\n        $complete = new Result(['Location' => 'https://s3.amazonaws.com/bucket/key']);\n\n        $filesize = filesize($this->tempFilePath);\n        if ($filesize < $options['mup_threshold']) {\n            $this->addMockResults($this->s3Client, [$putObject]);\n        } else {\n            $parts = ceil($filesize / $options['part_size']);\n            $this->addMockResults(\n                $this->s3Client,\n                array_merge(\n                    [$initiate],\n                    array_fill(0, $parts, $putPart),\n                    [$complete]\n                )\n            );\n        }\n\n        $this->s3Client->upload(\n            'bucket',\n            'key',\n            fopen($this->tempFilePath, 'rb'),\n            'private',\n            $options\n        );\n    }\n\n    /**\n     * @When then download the file\n     */\n    public function thenDownloadTheFile()\n    {\n        $this->addMockResults($this->s3Client, [new Result([\n            'Body' => Psr7\\Utils::streamFor(Psr7\\Utils::tryFopen($this->tempFilePath, 'rb')),\n        ])]);\n\n        $this->s3Client->getObject([\n            'Bucket' => 'bucket',\n            'Key' => 'key',\n        ]);\n    }\n\n    /**\n     * @When I destroy all the clients\n     */\n    public function iDestroyAllTheClients()\n    {\n        $this->clients = [];\n        gc_collect_cycles();\n    }\n\n    /**\n     * @Then I should not have leaked any resources\n     */\n    public function iShouldNotHaveLeakedAnyResources()\n    {\n        // These should account for additional memory and files handles used to\n        // load class definitions into the PHP runtime\n        static $memoryFudge;\n        static $handlesFudge;\n        if (empty($memoryFudge)) {\n            $opcacheEnabled = function_exists('opcache_get_status')\n                && !empty(opcache_get_status(false)['opcache_enabled']);\n            $memoryFudge = $opcacheEnabled\n                ? 256 * 1024 // 256KB if OPCache is enabled\n                : 5 * 1024 * 1024; // 5MB otherwise\n            $handlesFudge = 5;\n        }\n\n        // Make sure you're not counting anything that's eligible for GC\n        gc_collect_cycles();\n\n        Assert::assertLessThanOrEqual(\n            $this->resourceUsageSnapshot['memory'] + $memoryFudge,\n            memory_get_usage()\n        );\n        Assert::assertLessThanOrEqual(\n            $this->resourceUsageSnapshot['open_file_handles'] + $handlesFudge,\n            $this->getOpenFileHandleCount()\n        );\n    }\n\n    private function findOperationWithNoRequiredParameters($service)\n    {\n        $provider = ApiProvider::defaultProvider();\n        $definition = new Service($provider('api', $service, 'latest'), $provider);\n\n        foreach ($definition->getOperations() as $name => $operation) {\n            if (empty($operation->getInput()['required'])) {\n                return $name;\n            }\n        }\n\n        throw new DomainException(\"The $service service has no operations\"\n            . \" without required parameters\");\n    }\n\n    private function getOpenFileHandleCount()\n    {\n        if (self::isRunningOnWindows()) {\n            return 0;\n        }\n\n        return (int) shell_exec('lsof -p ' . getmypid() . ' | wc -l');\n    }\n\n    private static function isRunningOnWindows()\n    {\n        return 'WIN' === strtoupper(substr(PHP_OS, 0, 3));\n    }\n}\n", "num_lines": 286}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Test;\n\nuse Aws\\AwsClientInterface;\nuse Aws\\Exception\\AwsException;\nuse Aws\\MockHandler;\nuse Aws\\Result;\nuse Aws\\Sdk;\nuse Aws\\Api\\Service;\n\n/**\n * @internal\n */\ntrait UsesServiceTrait\n{\n    private $_mock_handler;\n\n    /**\n     * Creates an instance of the AWS SDK for a test\n     *\n     * @param array $args\n     *\n     * @return Sdk\n     */\n    private function getTestSdk(array $args = [])\n    {\n        return new Sdk($args + [\n            'region'      => 'us-east-1',\n            'version'     => 'latest',\n            'retries'     => 0\n        ]);\n    }\n\n    /**\n     * Creates an instance of a service client for a test\n     *\n     * @param string $service\n     * @param array  $args\n     *\n     * @return AwsClientInterface\n     */\n    private function getTestClient($service, array $args = [])\n    {\n        // Disable network access. If the INTEGRATION envvar is set, then this\n        // disabling is not done.\n        if (!isset($_SERVER['INTEGRATION'])\n            && !isset($args['handler'])\n            && !isset($args['http_handler'])\n        ) {\n            $this->_mock_handler = $args['handler'] = new MockHandler([]);\n        }\n\n        return $this->getTestSdk($args)->createClient($service);\n    }\n\n    /**\n     * Queues up mock Result objects for a client\n     *\n     * @param AwsClientInterface $client\n     * @param Result[]|array[]   $results\n     * @param callable $onFulfilled Callback to invoke when the return value is fulfilled.\n     * @param callable $onRejected  Callback to invoke when the return value is rejected.\n     *\n     * @return AwsClientInterface\n     */\n    private function addMockResults(\n        AwsClientInterface $client,\n        array $results,\n        callable $onFulfilled = null,\n        callable $onRejected = null\n    ) {\n        foreach ($results as &$res) {\n            if (is_array($res)) {\n                $res = new Result($res);\n            }\n        }\n\n        $this->_mock_handler = new MockHandler($results, $onFulfilled, $onRejected);\n        $client->getHandlerList()->setHandler($this->_mock_handler);\n\n        return $client;\n    }\n\n    private function mockQueueEmpty()\n    {\n        return 0 === count($this->_mock_handler);\n    }\n\n    /**\n     * Creates a mock CommandException with a given error code\n     *\n     * @param string $code\n     * @param string $type\n     * @param string|null $message\n     *\n     * @return AwsException\n     */\n    private function createMockAwsException(\n        $code = null,\n        $type = null,\n        $message = null\n    ) {\n        $code = $code ?: 'ERROR';\n        $type = $type ?: 'Aws\\Exception\\AwsException';\n\n        $client = $this->getMockBuilder('Aws\\AwsClientInterface')\n            ->setMethods(['getApi'])\n            ->getMockForAbstractClass();\n\n        $client->expects($this->any())\n            ->method('getApi')\n            ->will($this->returnValue(\n                new Service(\n                    [\n                        'metadata' => [\n                            'endpointPrefix' => 'foo',\n                            'apiVersion' => 'version'\n                        ]\n                    ],\n                    function () { return []; }\n                )));\n\n        return new $type(\n            $message ?: 'Test error',\n            $this->getMock('Aws\\CommandInterface'),\n            [\n                'message' => $message ?: 'Test error',\n                'code'    => $code\n            ]\n        );\n    }\n}\n", "num_lines": 133}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Test\\Integ;\n\nuse Aws\\DynamoDb\\DynamoDbClient;\nuse Aws\\DynamoDb\\WriteRequestBatch;\nuse Aws\\Exception\\AwsException;\nuse Aws\\Result;\nuse Aws\\Sqs\\SqsClient;\nuse Behat\\Behat\\Hook\\Scope\\AfterFeatureScope;\nuse Behat\\Behat\\Hook\\Scope\\BeforeFeatureScope;\nuse Behat\\Behat\\Tester\\Exception\\PendingException;\nuse Behat\\Behat\\Context\\Context;\nuse Behat\\Behat\\Context\\SnippetAcceptingContext;\nuse Behat\\Gherkin\\Node\\PyStringNode;\nuse Behat\\Gherkin\\Node\\TableNode;\n\nclass BatchingContext extends \\PHPUnit_Framework_Assert implements\n    Context,\n    SnippetAcceptingContext\n{\n    use IntegUtils;\n\n    private static $resource;\n\n    /** @var DynamoDbClient|SqsClient */\n    private $client;\n    /** @var WriteRequestBatch */\n    private $batch;\n    /** @var int */\n    private $flushCount;\n    /** @var Result */\n    private $response;\n\n    /**\n     * @Given I have a :service client\n     */\n    public function iHaveAClient($service)\n    {\n        $this->client = self::getSdk()->createClient($service);\n    }\n\n    /**\n     * @BeforeFeature @dynamodb\n     *\n     * @param BeforeFeatureScope $scope\n     */\n    public static function setUpDynamoTable(BeforeFeatureScope $scope)\n    {\n        self::$resource = self::getResourcePrefix()\n            . str_replace(' ', '-', strtolower($scope->getName()));\n\n        $client = self::getSdk()->createDynamoDb();\n        $client->createTable([\n            'TableName' => self::$resource,\n            'AttributeDefinitions' => [\n                ['AttributeName' => 'id', 'AttributeType' => 'N']\n            ],\n            'KeySchema' => [\n                ['AttributeName' => 'id', 'KeyType' => 'HASH']\n            ],\n            'ProvisionedThroughput' => [\n                'ReadCapacityUnits'  => 1,\n                'WriteCapacityUnits' => 1\n            ]\n        ]);\n\n        $client->waitUntil('TableExists', ['TableName' => self::$resource]);\n    }\n\n    /**\n     * @AfterFeature @dynamodb\n     *\n     * @param AfterFeatureScope $scope\n     */\n    public static function tearDownDynamoTable(AfterFeatureScope $scope)\n    {\n        self::getSdk()\n            ->createDynamoDb()\n            ->deleteTable(['TableName' => self::$resource]);\n\n        self::$resource = null;\n    }\n\n    /**\n     * @BeforeFeature @sqs\n     *\n     * @param BeforeFeatureScope $scope\n     */\n    public static function setUpQueue(BeforeFeatureScope $scope)\n    {\n        $sqs = self::getSdk()->createSqs();\n        self::$resource = self::getResourcePrefix()\n            . preg_replace('/\\W/', '-', strtolower($scope->getName()));\n\n        $sqs->createQueue(['QueueName' => self::$resource]);\n        $sqs->waitUntil('QueueExists', ['QueueName' => self::$resource]);\n    }\n\n    /**\n     * @AfterFeature @sqs\n     *\n     * @param AfterFeatureScope $scope\n     */\n    public static function tearDownQueue(AfterFeatureScope $scope)\n    {\n        $sqs = self::getSdk()\n            ->createSqs();\n\n        $sqs->deleteQueue([\n            'QueueUrl' => $sqs->getQueueUrl([\n                'QueueName' => self::$resource,\n            ])['QueueUrl']\n        ]);\n\n        self::$resource = null;\n    }\n\n    /**\n     * @When /^I create a WriteRequestBatch with a batch size of (\\d+) and a pool size of (\\d+)$/\n     */\n    public function iCreateAWriteRequestBatch($batchSize, $poolSize)\n    {\n        $this->batch = new WriteRequestBatch($this->client, [\n            'table' => self::$resource,\n            'batch_size' => $batchSize,\n            'pool_size' => $poolSize,\n            'before' => function () {\n                $this->flushCount++;\n            },\n            'error' => function (AwsException $e) {\n                trigger_error($e->getMessage(), E_USER_WARNING);\n            }\n        ]);\n    }\n\n    /**\n     * @When /^I put (\\d+) items in the batch$/\n     */\n    public function iPutItemsInTheBatch($itemCount)\n    {\n        for ($i = 0; $i < $itemCount; $i++) {\n            $this->batch->put(['id' => ['N' => (string) $i]]);\n        }\n    }\n\n    /**\n     * @When I flush the batch\n     */\n    public function iFlushTheBatch()\n    {\n        $this->batch->flush();\n    }\n\n    /**\n     * @Then /^(\\d+) items should have been written$/\n     */\n    public function itemsShouldHaveBeenWritten($itemCount)\n    {\n        $actualItems = $this->client->getIterator('Scan', [\n            'TableName' => self::$resource,\n        ]);\n\n        $this->assertSame((int) $itemCount, iterator_count($actualItems));\n    }\n\n    /**\n     * @Then /^the batch should have been flushed at least (\\d+) times$/\n     */\n    public function theBatchShouldHaveBeenFlushedTimes($flushCount)\n    {\n        $this->assertGreaterThanOrEqual((int) $flushCount, $this->flushCount);\n    }\n\n    /**\n     * @Given /^I have put (\\d+) messages in a queue$/\n     */\n    public function iHavePutMessagesInAQueue($messageCount)\n    {\n        $queueUrl = $this->client\n            ->getQueueUrl(['QueueName' => self::$resource])['QueueUrl'];\n        for ($i = 0; $i < $messageCount; $i++) {\n            $this->client->sendMessage([\n                'QueueUrl' => $queueUrl,\n                'MessageBody' => json_encode(['testing' => 'testing']),\n            ]);\n        }\n    }\n\n    /**\n     * @When /^I delete a batch of (\\d+) messages$/\n     */\n    public function iDeleteABatchOfMessages($messageCount)\n    {\n        $queueUrl = $this->client\n            ->getQueueUrl(['QueueName' => self::$resource])['QueueUrl'];\n        $messages = [];\n        while (count($messages) < $messageCount) {\n            $result = $this->client->receiveMessage([\n                'QueueUrl' => $queueUrl,\n                'MaxNumberOfMessages' => $messageCount,\n            ]);\n\n            foreach ($result['Messages'] as $message) {\n                $messages[$message['MessageId']] = [\n                    'Id' => $message['MessageId'],\n                    'ReceiptHandle' => $message['ReceiptHandle'],\n                ];\n            }\n        }\n\n        $this->response = $this->client\n            ->deleteMessageBatch([\n                'QueueUrl' => $queueUrl,\n                'Entries' => array_values($messages),\n            ]);\n    }\n\n    /**\n     * @Then /^(\\d+) messages should have been deleted from the queue$/\n     */\n    public function messagesShouldHaveBeenDeletedFromTheQueue($messageCount)\n    {\n        $this->assertSame((int) $messageCount, count($this->response['Failed'])\n            + count($this->response['Successful']));\n    }\n}\n", "num_lines": 228}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Test\\Integ;\n\nuse Aws\\AwsClient;\nuse Aws\\DynamoDb\\Exception\\DynamoDbException;\nuse Behat\\Behat\\Hook\\Scope\\AfterFeatureScope;\nuse Behat\\Behat\\Tester\\Exception\\PendingException;\nuse Behat\\Behat\\Context\\Context;\nuse Behat\\Behat\\Context\\SnippetAcceptingContext;\nuse Behat\\Gherkin\\Node\\PyStringNode;\nuse Behat\\Gherkin\\Node\\TableNode;\nuse GuzzleHttp\\Promise;\n\n/**\n * Defines application features from the specific context.\n */\nclass BlockingContext extends \\PHPUnit_Framework_Assert implements Context, SnippetAcceptingContext\n{\n    use IntegUtils;\n\n    /** @var AwsClient */\n    private $client;\n    /** @var Promise\\Promise[] */\n    private $promises;\n\n    /**\n     * @Given I have a :service client\n     */\n    public function iHaveAClient($service)\n    {\n        $this->client = self::getSdk()->createClient($service);\n    }\n\n    /**\n     * @When I create a table named :table\n     */\n    public function iCreateATableNamed($table)\n    {\n        $this->client->createTable([\n            'TableName' => self::getResourcePrefix() . \"-$table\",\n            'AttributeDefinitions' => [\n                ['AttributeName' => 'id', 'AttributeType' => 'N']\n            ],\n            'KeySchema' => [\n                ['AttributeName' => 'id', 'KeyType' => 'HASH']\n            ],\n            'ProvisionedThroughput' => [\n                'ReadCapacityUnits'  => 20,\n                'WriteCapacityUnits' => 20\n            ]\n        ]);\n    }\n\n    /**\n     * @When wait for the table named :table to exist\n     */\n    public function waitForTheTableNamedToExist($table)\n    {\n        $this->client->waitUntil('TableExists', [\n            'TableName' => self::getResourcePrefix() . \"-$table\",\n        ]);\n    }\n\n    /**\n     * @When the table named :table exists\n     */\n    public function theTableNamedWillExist($table)\n    {\n        self::getSdk(['http' => ['synchronous' => true]])\n            ->createDynamoDb()\n            ->describeTable(['TableName' => self::getResourcePrefix() . \"-$table\"]);\n    }\n\n    /**\n     * @Then I can delete the table named :table\n     */\n    public function iCanDeleteTheTableNamed($table)\n    {\n        $this->client->deleteTable([\n            'TableName' => self::getResourcePrefix() . \"-$table\",\n        ]);\n    }\n\n    /**\n     * @Then wait for the table named :table to be deleted\n     */\n    public function waitForTheTableNamedToBeDeleted($table)\n    {\n        $this->client->waitUntil('TableNotExists', [\n            'TableName' => self::getResourcePrefix() . \"-$table\",\n        ]);\n    }\n\n    /**\n     * @Then the table named :table does not exist\n     */\n    public function theTableNamedWillNotExist($table)\n    {\n        try {\n            $this->theTableNamedWillExist($table);\n            $this->fail(\"$table exists but should not.\");\n        } catch (DynamoDbException $e) {\n            $this->assertSame('ResourceNotFoundException', $e->getAwsErrorCode());\n        }\n    }\n\n    /**\n     * @When I create a promise to create and await a table named :table\n     */\n    public function iCreateAPromiseToCreateAndAwaitATableNamed($table)\n    {\n        $this->promises []= $this->client->createTableAsync([\n            'TableName' => self::getResourcePrefix() . \"-$table\",\n            'AttributeDefinitions' => [\n                ['AttributeName' => 'id', 'AttributeType' => 'N']\n            ],\n            'KeySchema' => [\n                ['AttributeName' => 'id', 'KeyType' => 'HASH']\n            ],\n            'ProvisionedThroughput' => [\n                'ReadCapacityUnits'  => 20,\n                'WriteCapacityUnits' => 20\n            ]\n        ])\n            ->then(function () use ($table) {\n                return $this->client\n                    ->getWaiter('TableExists', [\n                        'TableName' => self::getResourcePrefix() . \"-$table\",\n                    ])->promise();\n            });\n    }\n\n    /**\n     * @Then I can wait on all promises\n     */\n    public function iCanWaitOnAllPromises()\n    {\n        Promise\\all($this->promises)\n            ->wait();\n    }\n\n    /**\n     * @When I create a promise to delete and await the purging of the table named :table\n     */\n    public function iCreateAPromiseToDeleteAndAwaitThePurgingOfTheTableNamed($table)\n    {\n        $this->promises []= $this->client\n            ->deleteTableAsync([\n                'TableName' => self::getResourcePrefix() . \"-$table\",\n            ])->then(function () use ($table) {\n                return $this->client\n                    ->getWaiter('TableNotExists', [\n                        'TableName' => self::getResourcePrefix() . \"-$table\",\n                    ])->promise();\n            });\n    }\n}\n", "num_lines": 159}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Test\\Integ;\n\nuse Aws\\CommandInterface;\nuse Aws\\CommandPool;\nuse Aws\\Exception\\AwsException;\nuse Aws\\Result;\nuse Aws\\S3\\S3Client;\nuse Behat\\Behat\\Hook\\Scope\\AfterFeatureScope;\nuse Behat\\Behat\\Hook\\Scope\\BeforeFeatureScope;\nuse Behat\\Behat\\Tester\\Exception\\PendingException;\nuse Behat\\Behat\\Context\\Context;\nuse Behat\\Behat\\Context\\SnippetAcceptingContext;\nuse Behat\\Gherkin\\Node\\PyStringNode;\nuse Behat\\Gherkin\\Node\\TableNode;\nuse GuzzleHttp\\Promise;\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse JmesPath;\n\n/**\n * Defines application features from the specific context.\n */\nclass ConcurrencyContext extends \\PHPUnit_Framework_Assert implements\n    Context,\n    SnippetAcceptingContext\n{\n    use IntegUtils;\n\n    /** @var S3Client */\n    private $client;\n    /** @var Result|Result[] */\n    private $result;\n    /** @var PromiseInterface */\n    private $promise;\n    /** @var CommandInterface[] */\n    private $commands;\n    /** @var string */\n    private static $bucket;\n\n    /**\n     * @BeforeFeature @s3\n     *\n     * @param BeforeFeatureScope $scope\n     */\n    public static function setUpS3Bucket(BeforeFeatureScope $scope)\n    {\n        $client = self::getSdk()\n            ->createS3();\n\n        self::$bucket = self::getResourcePrefix()\n            . str_replace(' ', '-', strtolower($scope->getName()));\n\n        $client->createBucket(['Bucket' => self::$bucket]);\n        $client->waitUntil('BucketExists', ['Bucket' => self::$bucket]);\n    }\n\n    /**\n     * @AfterFeature @s3\n     *\n     * @param AfterFeatureScope $scope\n     */\n    public static function tearDownS3Bucket(AfterFeatureScope $scope)\n    {\n        $client = self::getSdk()->createS3();\n\n        $client->deleteMatchingObjects(self::$bucket, '', '//');\n        $client->deleteBucket(['Bucket' => self::$bucket]);\n\n        self::$bucket = null;\n    }\n\n    /**\n     * @Given I have a :service client\n     */\n    public function iHaveAClient($service)\n    {\n        $this->client = self::getSdk()->createClient($service);\n    }\n\n    /**\n     * @When I call the :command API\n     */\n    public function iCallTheApi($command)\n    {\n        $this->result = $this->client->{$command}();\n    }\n\n    /**\n     * @Then the value at :key should be a :type\n     */\n    public function theValueAtShouldBeA($key, $type)\n    {\n        $this->assertInstanceOf(Result::class, $this->result);\n        $this->assertInternalType($type, $this->result->search($key));\n    }\n\n    /**\n     * @When I call the :command API asynchronously\n     */\n    public function iCallTheApiAsynchronously($command)\n    {\n        $this->promise = call_user_func([$this->client, \"{$command}Async\"]);\n    }\n\n    /**\n     * @When I wait on the promise\n     */\n    public function thenWaitOnThePromise()\n    {\n        $this->result = $this->promise->wait();\n    }\n\n    /**\n     * @Given a promise composed of the following asynchronous operations:\n     */\n    public function aPromiseComposedOfTheFollowingAsynchronousOperations(TableNode $table)\n    {\n        $this->promise = Promise\\all(array_map(function (array $row) {\n            return call_user_func(\n                [\n                    self::getSdk()->createClient($row['service']),\n                    \"{$row['command']}Async\",\n                ],\n                json_decode($row['payload'], true) ?: []\n            );\n        }, iterator_to_array($table)));\n    }\n\n    /**\n     * @Given a pool composed of the following commands:\n     */\n    public function aPoolComposedOfTheFollowingCommands(TableNode $table)\n    {\n        $this->commands = array_map(function (array $row) {\n            return self::getSdk()\n                ->createClient($row['service'])\n                ->getCommand(\n                    $row['command'],\n                    json_decode($row['payload'], true) ?: []\n                );\n        }, iterator_to_array($table));\n    }\n\n    /**\n     * @When I send the commands as a batch to :service\n     */\n    public function iSendTheCommandsAsABatchTo($service)\n    {\n        $this->result = CommandPool::batch(\n            self::getSdk()->createClient($service),\n            $this->commands\n        );\n    }\n\n    /**\n     * @Then there should be :count results\n     */\n    public function thereShouldBeResults($count)\n    {\n        $this->assertCount((int) $count, $this->result);\n    }\n\n    /**\n     * @Then there should be :count value at :path\n     */\n    public function thereShouldBeValueAt($count, $path)\n    {\n        $this->assertCount((int) $count, array_unique(\n                JmesPath\\search($path, $this->result)\n        ));\n    }\n}\n", "num_lines": 174}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Test\\Integ;\n\ntrait IntegUtils\n{\n    private static function getSdk(array $args = [])\n    {\n        return new \\Aws\\Sdk($args + [\n            'region'  => 'us-east-1',\n            'version' => 'latest',\n            'ua_append' => 'PHPUnit/Integration'\n        ]);\n    }\n\n    public static function log($message)\n    {\n        fwrite(STDERR, date('c') . ': ' . $message . \"\\n\");\n    }\n\n    /**\n     * Get the resource prefix to add to created resources\n     *\n     * @return string\n     */\n    public static function getResourcePrefix()\n    {\n        if (!isset($_SERVER['PREFIX']) || $_SERVER['PREFIX'] == 'hostname') {\n            $_SERVER['PREFIX'] = crc32(gethostname()) . rand(0, 10000);\n        }\n\n        return $_SERVER['PREFIX'];\n    }\n}\n", "num_lines": 34}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Test\\Integ;\n\nuse Aws\\Exception\\MultipartUploadException;\nuse Aws\\Glacier\\MultipartUploader as GlacierMultipartUploader;\nuse Aws\\ResultInterface;\nuse Aws\\S3\\MultipartUploader as S3MultipartUploader;\nuse Behat\\Behat\\Tester\\Exception\\PendingException;\nuse Aws\\S3\\BatchDelete;\nuse Behat\\Behat\\Context\\Context;\nuse Behat\\Behat\\Context\\SnippetAcceptingContext;\nuse Behat\\Gherkin\\Node\\PyStringNode;\nuse Behat\\Gherkin\\Node\\TableNode;\nuse GuzzleHttp\\Psr7;\nuse GuzzleHttp\\Psr7\\NoSeekStream;\nuse PHPUnit_Framework_Assert as Assert;\nuse Psr\\Http\\Message\\StreamInterface;\n\n/**\n * Defines application features from the specific context.\n */\nclass MultipartContext implements Context, SnippetAcceptingContext\n{\n    use IntegUtils;\n\n    const MB = 1048576;\n    const RESOURCE_POSTFIX = 'php-integration-multipart-test';\n\n    private static $tempFile;\n    /** @var StreamInterface */\n    private $stream;\n    /** @var ResultInterface */\n    private $result;\n\n    /**\n     * @Given I have a seekable read stream\n     */\n    public function iHaveASeekableReadStream()\n    {\n        $this->stream = Psr7\\Utils::streamFor(Psr7\\Utils::tryFopen(self::$tempFile, 'r'));\n    }\n\n    /**\n     * @When /^I upload the stream to S3 with a concurrency factor of \"(\\d+)\"$/\n     */\n    public function iUploadTheStreamToS3WithAConcurrencyFactorOf($concurrency)\n    {\n        $client = self::getSdk()->createS3();\n        $uploader = new S3MultipartUploader($client, $this->stream, [\n            'bucket' => self::getResourceName(),\n            'key' => get_class($this->stream) . $concurrency,\n            'concurrency' => $concurrency,\n        ]);\n\n        try {\n            $this->result = $uploader->upload();\n        } catch (MultipartUploadException $e) {\n            $client->abortMultipartUpload($e->getState()->getId());\n            $message = \"=====\\n\";\n            while ($e) {\n                $message .= $e->getMessage() . \"\\n\";\n                $e = $e->getPrevious();\n            }\n            $message .= \"=====\\n\";\n            Assert::fail($message);\n        }\n    }\n\n    /**\n     * @When /^I upload the stream to Glacier with a concurrency factor of \"(\\d+)\"$/\n     */\n    public function iUploadTheStreamToGlacierWithAConcurrencyFactorOf($concurrency)\n    {\n        $client = self::getSdk()->createGlacier();\n        $uploader = new GlacierMultipartUploader($client, $this->stream, [\n            'vault_name' => self::RESOURCE_POSTFIX,\n            'archive_description' => get_class($this->stream) . $concurrency,\n            'concurrency' => $concurrency,\n        ]);\n\n        try {\n            $this->result = $uploader->upload();\n        } catch (MultipartUploadException $e) {\n            $client->abortMultipartUpload($e->getState()->getId());\n            $message = \"=====\\n\";\n            while ($e) {\n                $message .= $e->getMessage() . \"\\n\";\n                $e = $e->getPrevious();\n            }\n            $message .= \"=====\\n\";\n            Assert::fail($message);\n        }\n    }\n\n    /**\n     * @Then /^the result should contain a\\(n\\) \"([^\"]+)\"$/\n     */\n    public function theResultShouldContainA($key)\n    {\n        Assert::assertArrayHasKey($key, $this->result);\n    }\n\n    /**\n     * @Given I have a non-seekable read stream\n     */\n    public function iHaveANonSeekableReadStream()\n    {\n        $this->iHaveASeekableReadStream();\n        $this->stream = new NoSeekStream($this->stream);\n    }\n\n    /**\n     * @BeforeSuite\n     */\n    public static function createTempFile()\n    {\n        self::$tempFile = tempnam(sys_get_temp_dir(), self::getResourceName());\n        file_put_contents(self::$tempFile, str_repeat('x', 10 * self::MB + 1024));\n    }\n\n    /**\n     * @AfterSuite\n     */\n    public static function deleteTempFile()\n    {\n        unlink(self::$tempFile);\n    }\n\n    /**\n     * @BeforeFeature @s3\n     */\n    public static function createTestBucket()\n    {\n        $client = self::getSdk()->createS3();\n        if (!$client->doesBucketExist(self::getResourceName())) {\n            $client->createBucket(['Bucket' => self::getResourceName()]);\n            $client->waitUntil('BucketExists', ['Bucket' => self::getResourceName()]);\n        }\n    }\n\n    /**\n     * @AfterFeature @s3\n     */\n    public static function deleteTestBucket()\n    {\n        $client = self::getSdk()->createS3();\n        BatchDelete::fromListObjects($client, ['Bucket' => self::getResourceName()])->delete();\n        $client->deleteBucket(['Bucket' => self::getResourceName()]);\n        $client->waitUntil('BucketNotExists', ['Bucket' => self::getResourceName()]);\n    }\n\n    /**\n     * @BeforeFeature @glacier\n     */\n    public static function createTestVault()\n    {\n        $client = self::getSdk()->createGlacier();\n        $client->createVault(['vaultName' => self::RESOURCE_POSTFIX]);\n        $client->waitUntil('VaultExists', ['vaultName' => self::RESOURCE_POSTFIX]);\n    }\n\n    private static function getResourceName()\n    {\n        static $bucketName;\n\n        if (empty($bucketName)) {\n            $bucketName = self::getResourcePrefix() . self::RESOURCE_POSTFIX;\n        }\n\n        return $bucketName;\n    }\n}\n", "num_lines": 174}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace Aws\\Test\\Integ;\n\nuse Aws\\S3\\S3Client;\nuse Behat\\Behat\\Hook\\Scope\\AfterFeatureScope;\nuse Behat\\Behat\\Hook\\Scope\\BeforeFeatureScope;\nuse Behat\\Behat\\Tester\\Exception\\PendingException;\nuse Behat\\Behat\\Context\\Context;\nuse Behat\\Behat\\Context\\SnippetAcceptingContext;\nuse Behat\\Gherkin\\Node\\PyStringNode;\nuse Behat\\Gherkin\\Node\\TableNode;\n\n/**\n * Defines application features from the specific context.\n */\nclass NativeStreamContext extends \\PHPUnit_Framework_Assert implements\n    Context,\n    SnippetAcceptingContext\n{\n    use IntegUtils;\n\n    /** @var S3Client */\n    private $client;\n    /** @var bool */\n    private $callSucceeded;\n    /** @var resource */\n    private $handle;\n    /** @var string */\n    private static $bucket;\n\n    public function __destruct()\n    {\n        if (is_resource($this->handle)) {\n            fclose($this->handle);\n        }\n    }\n\n    /**\n     * @BeforeFeature @s3\n     *\n     * @param BeforeFeatureScope $scope\n     */\n    public static function setUpS3Bucket(BeforeFeatureScope $scope)\n    {\n        $client = self::getSdk()\n            ->createS3();\n\n        self::$bucket = self::getResourcePrefix()\n            . str_replace(' ', '-', strtolower($scope->getName()));\n\n        $client->createBucket(['Bucket' => self::$bucket]);\n        $client->waitUntil('BucketExists', ['Bucket' => self::$bucket]);\n    }\n\n    /**\n     * @AfterFeature @s3\n     *\n     * @param AfterFeatureScope $scope\n     */\n    public static function tearDownS3Bucket(AfterFeatureScope $scope)\n    {\n        $client = self::getSdk()->createS3();\n\n        $client->deleteMatchingObjects(self::$bucket, '', '//');\n        $client->deleteBucket(['Bucket' => self::$bucket]);\n\n        self::$bucket = null;\n    }\n\n    /**\n     * @Given I have a :service client\n     */\n    public function iHaveAClient($service)\n    {\n        $this->client = self::getSdk()->createClient($service);\n    }\n\n    /**\n     * @Given have registered an s3 stream wrapper\n     */\n    public function haveRegisteredAnS3StreamWrapper()\n    {\n        $this->client->registerStreamWrapper();\n    }\n\n    /**\n     * @Given I create a subdirectory :subdir with mkdir\n     */\n    public function iCreateASubdirectory($subdir)\n    {\n        mkdir($this->getS3Path($subdir));\n        sleep(1);\n    }\n\n    /**\n     * @When /^I call (\\w+) on the (\\S+) path$/\n     */\n    public function iCallOnThePath($method, $path)\n    {\n        $this->callSucceeded = call_user_func($method, $this->getS3Path($path));\n    }\n\n    /**\n     * @Then /^the call should return (true|false)$/\n     */\n    public function theCallShouldReturn($booleanString)\n    {\n        $this->assertSame(\n            filter_var($booleanString, FILTER_VALIDATE_BOOLEAN),\n            $this->callSucceeded\n        );\n    }\n\n    /**\n     * @Given I have a file at :path with the content :contents\n     */\n    public function iHaveAFileAtWithTheContent($path, $contents)\n    {\n        $this->assertGreaterThan(\n            0,\n            file_put_contents($this->getS3Path($path), $contents)\n        );\n    }\n\n    /**\n     * @Given I have a file at :path with no content\n     */\n    public function iHaveAFileAtWithNoContent($path)\n    {\n        $this->assertSame(0, file_put_contents($this->getS3Path($path), ''));\n    }\n\n    /**\n     * @Then the file at :arg1 should contain :arg2\n     */\n    public function theFileAtShouldContain($key, $contents)\n    {\n        $this->assertSame($contents, file_get_contents($this->getS3Path($key)));\n    }\n\n    /**\n     * @Given I have a read handle on the file at :arg1\n     */\n    public function iHaveAReadHandleOnTheFileAt($key)\n    {\n        $this->handle = fopen($this->getS3Path($key), 'r');\n    }\n\n    /**\n     * @Then /^reading (\\d+) bytes should return (.+)$/\n     */\n    public function readingBytesShouldReturn($byteCount, $expected)\n    {\n        $this->assertSame($expected, fread($this->handle, $byteCount));\n    }\n\n    /**\n     * @Then /^calling fstat should report a size of (\\d+)$/\n     */\n    public function callingFstatShouldReportASizeOf($size)\n    {\n        $this->assertSame((int) $size, fstat($this->handle)['size']);\n    }\n\n    /**\n     * @Given I have cleared the last error\n     */\n    public function iHaveClearedTheLastError()\n    {\n        while (error_get_last()) {\n            error_clear_last();\n        }\n    }\n\n    /**\n     * @Then no errors should have been raised\n     */\n    public function errorsShouldHaveBeenRaised()\n    {\n        $this->assertNull(error_get_last());\n    }\n\n    /**\n     * @Then scanning the directory at :dir should return a list with one member named :file\n     */\n    public function scanningTheDirectoryAtShouldReturnAListWithOneMemberNamed($dir, $file)\n    {\n        $this->assertSame([$file], scandir($this->getS3Path($dir)));\n    }\n\n    private function getS3Path($path)\n    {\n        return 's3://' . self::$bucket . '/' . ltrim($path, '/');\n    }\n}\n", "num_lines": 197}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Test\\Integ;\n\nuse Behat\\Behat\\Tester\\Exception\\PendingException;\nuse Behat\\Behat\\Context\\Context;\nuse Behat\\Behat\\Context\\SnippetAcceptingContext;\nuse Behat\\Gherkin\\Node\\PyStringNode;\nuse Behat\\Gherkin\\Node\\TableNode;\nuse Aws\\S3\\S3Client;\nuse Aws\\S3\\PostObject;\nuse Aws\\S3\\PostObjectV4;\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\Psr7;\nuse PHPUnit_Framework_Assert as Assert;\nuse Psr\\Http\\Message\\RequestInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Psr\\Http\\Message\\StreamInterface;\n\nclass S3Context implements Context, SnippetAcceptingContext\n{\n    use IntegUtils;\n\n    /** @var RequestInterface */\n    private $presignedRequest;\n\n    /** @var S3Client */\n    private $s3Client;\n    /** @var StreamInterface */\n    private $stream;\n    private static $tempFile;\n    private $inputs;\n    private $attributes;\n    // for post object\n    private $formInputs = [];\n    private $jsonPolicy;\n    private $options;\n    private $expires;\n\n    private static function getResourceName()\n    {\n        static $bucketName;\n\n        if (empty($bucketName)) {\n            $bucketName =\n                self::getResourcePrefix() . 'aws-test-integ-s3-context';\n        }\n\n        return $bucketName;\n    }\n\n    /**\n     * @BeforeSuite\n     */\n    public static function createTempFile()\n    {\n        self::$tempFile = tempnam(sys_get_temp_dir(), self::getResourceName());\n        file_put_contents(self::$tempFile, str_repeat('x', 128 * 1024));\n    }\n\n    /**\n     * @AfterSuite\n     */\n    public static function deleteTempFile()\n    {\n        unlink(self::$tempFile);\n    }\n\n    /**\n     * @BeforeSuite\n     */\n    public static function createTestBucket()\n    {\n        $client = self::getSdk()->createS3();\n        if (!$client->doesBucketExist(self::getResourceName())) {\n            $client->createBucket(['Bucket' => self::getResourceName()]);\n            $client->waitUntil('BucketExists', [\n                'Bucket' => self::getResourceName(),\n            ]);\n        }\n    }\n\n    /**\n     * @AfterSuite\n     */\n    public static function deleteTestBucket()\n    {\n        $client = self::getSdk()->createS3();\n        $client->deleteMatchingObjects(self::getResourceName(), '', '//');\n        $client->deleteBucket(['Bucket' => self::getResourceName()]);\n        $client->waitUntil('BucketNotExists', [\n            'Bucket' => self::getResourceName(),\n        ]);\n    }\n\n    /**\n     * @Given I have uploaded an object to S3 with a key of :key and a body of :body\n     */\n    public function iHaveUploadedThatStringToSWithAKeyOfAndABodyOf($key, $body)\n    {\n        self::getSdk()\n            ->createS3()\n            ->putObject([\n                'Bucket' => self::getResourceName(),\n                'Key' => $key,\n                'Body' => $body,\n            ]);\n    }\n\n    /**\n     * @When I create a pre-signed request for a :command command with:\n     */\n    public function iCreateAPreSignedUrlForACommandWith(\n        $commandName,\n        TableNode $table\n    ) {\n        $args = ['Bucket' => self::getResourceName()];\n        foreach ($table as $row) {\n            $args[$row['key']] = $row['value'];\n        }\n        $client = self::getSdk()->createS3();\n        $command = $client->getCommand($commandName, $args);\n        $this->presignedRequest = $client\n            ->createPresignedRequest($command, '+1 hour');\n    }\n\n    /**\n     * @Then the contents of the response to the presigned request should be :body\n     */\n    public function theContentsAtThePresignedUrlShouldBe($body)\n    {\n        Assert::assertSame(\n            $body,\n            file_get_contents((string) $this->presignedRequest->getUri())\n        );\n    }\n\n    /**\n     * @Given I send the pre-signed request\n     */\n    public function iSendThePreSignedRequest()\n    {\n        (new Client)->send($this->presignedRequest);\n    }\n\n    /**\n     * @Given I change the body of the pre-signed request to be :body\n     */\n    public function iChangeTheBodyOfThePreSignedRequestToBe($body)\n    {\n        $this->presignedRequest = $this->presignedRequest\n            ->withBody(Psr7\\Utils::streamFor($body));\n    }\n\n    /**\n     * @Given I have an s3 client and I have a file\n     */\n    public function iHaveAnClientAndIHaveAFile()\n    {\n        $this->s3Client = self::getSdk()->createS3();\n        $this->stream = Psr7\\Utils::streamFor(Psr7\\Utils::tryFopen(self::$tempFile, 'r'));\n    }\n\n    /**\n     * @Given I have an array of form inputs as following:\n     */\n    public function iHaveAnArrayOfFormInputsAsFollowing(TableNode $table)\n    {\n        foreach ($table as $row) {\n            $this->formInputs += [$row['key'] => $row['value']];\n        }\n    }\n\n    /**\n     * @Given I provide a json string policy as following:\n     */\n    public function iProvideAJsonStringPolicyAsFollowing(PyStringNode $string)\n    {\n        $policy = json_decode($string->getRaw(),true);\n        $policy['conditions'][] = [\"bucket\" => self::getResourceName()];\n        $policy['conditions'][] = [\"starts-with\", '$key', \"\"];\n\n        $this->jsonPolicy = json_encode($policy);\n    }\n\n    /**\n     * @When I create a POST object SigV2 with inputs and policy\n     */\n    public function iCreateAPostObjectSigvWithInputsAndPolicy()\n    {\n        $postObject = new PostObject(\n            $this->s3Client,\n            self::getResourceName(),\n            $this->formInputs,\n            $this->jsonPolicy\n        );\n        $this->preparePostData($postObject);\n    }\n\n    /**\n     * @Given I provide an array of policy conditions as following:\n     */\n    public function iProvideAnArrayOfPolicyConditionsAsFollowing(TableNode $table)\n    {\n        $this->options = [\n            [\"bucket\" => self::getResourceName()],\n            [\"starts-with\", '$key', \"\"],\n        ];\n        foreach ($table as $row) {\n            $this->options[] = [$row['key'] => $row['value']];\n        }\n    }\n\n    /**\n     * @Given I want the policy expires after :expires\n     */\n    public function iWantThePolicyExpiresAfter($expires)\n    {\n        $this->expires = $expires;\n    }\n\n    /**\n     * @When I create a POST object SigV4 with inputs and policy\n     */\n    public function iCreateAPostObjectSigvWithInputsAndPolicy2()\n    {\n        $postObject = new PostObjectV4(\n            $this->s3Client,\n            self::getResourceName(),\n            $this->formInputs,\n            $this->options,\n            $this->expires\n        );\n\n        $this->preparePostData($postObject);\n    }\n\n    /**\n     * @When I make a HTTP POST request\n     */\n    public function iMakeAHttpPostRequest()\n    {\n        try {\n            (new Client)->request(\n                $this->attributes['method'],\n                $this->attributes['action'],\n                [\n                    'multipart' => $this->inputs,\n                ]\n            );\n        } catch (\\GuzzleHttp\\Exception\\ClientException $e) {\n            echo $e->getResponse()->getBody();\n        }\n    }\n\n    /**\n     * @Then the file called :filename is uploaded\n     */\n    public function theFileCalledIsUploaded($filename)\n    {\n        Assert::assertTrue($this->s3Client->doesObjectExist(\n            self::getResourceName(),\n            $filename\n        ));\n\n        $fileContents = str_repeat('x', 128 * 1024);\n        Assert::assertEquals(\n            $fileContents,\n            $this->s3Client->getObject([\n                'Bucket' => self::getResourceName(),\n                'Key' => $filename,\n            ])['Body']->getContents()\n        );\n    }\n\n    /**\n     * Prepare form inputs and attribute for POST\n     */\n    private function preparePostData($postObject)\n    {\n        $this->attributes = $postObject->getFormAttributes();\n        foreach ($postObject->getFormInputs() as $name => $contents) {\n            $this->inputs[] = [\n                'name' => $name,\n                'contents' => $contents,\n            ];\n        }\n        $this->inputs[] = [\n            'name' => 'file',\n            'contents' => $this->stream,\n            'filename' => 'file.ext',\n        ];\n    }\n}\n", "num_lines": 294}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Test\\Integ;\n\nuse Aws;\nuse Aws\\Exception\\AwsException;\nuse Aws\\JsonCompiler;\nuse Aws\\Result;\nuse Aws\\Sdk;\nuse Behat\\Behat\\Context\\Context;\nuse Behat\\Behat\\Context\\SnippetAcceptingContext;\nuse Behat\\Behat\\Hook\\Scope\\AfterFeatureScope;\nuse Behat\\Behat\\Hook\\Scope\\BeforeFeatureScope;\nuse Behat\\Behat\\Hook\\Scope\\BeforeScenarioScope;\nuse Behat\\Behat\\Tester\\Exception\\PendingException;\nuse Behat\\Gherkin\\Node\\PyStringNode;\nuse Behat\\Gherkin\\Node\\TableNode;\nuse JmesPath\\Env;\nuse PHPUnit_Framework_Assert;\n\nclass SmokeContext extends PHPUnit_Framework_Assert implements\n    Context,\n    SnippetAcceptingContext\n{\n    use IntegUtils;\n\n    /**\n     * @var Sdk\n     */\n    protected $sdk;\n\n    /**\n     * @var string\n     */\n    protected $serviceName;\n\n    /**\n     * @var \\Aws\\AwsClientInterface\n     */\n    protected $client;\n\n    /**\n     * @var Result\n     */\n    protected $response;\n\n    /**\n     * @var AwsException\n     */\n    protected $error;\n\n    private static $cloudFrontOriginAccessId;\n\n    private static $cloudFrontETag;\n\n    private static $configOverrides = [\n        'DeviceFarm' => [\n            'region' => 'us-west-2',\n        ],\n        'Efs' => [\n            'region' => 'us-west-2',\n        ],\n        'Inspector' => [\n            'region' => 'us-west-2',\n        ],\n    ];\n\n    /**\n     * @BeforeSuite\n     */\n    public static function prepare()\n    {\n        error_reporting(-1);\n        date_default_timezone_set('UTC');\n\n        // Clear out any previously compiled JMESPath files.\n        Env::cleanCompileDir();\n    }\n\n    /**\n     * @BeforeFeature @cloudfront\n     *\n     * @param BeforeFeatureScope $scope\n     */\n    public static function setUpCloudFront(BeforeFeatureScope $scope)\n    {\n        /** @var \\Aws\\Result $result */\n        $result = self::getSdk(self::$configOverrides)\n            ->createCloudFront()\n            ->createCloudFrontOriginAccessIdentity([\n                'CloudFrontOriginAccessIdentityConfig' => [\n                    'CallerReference' => rand(0, PHP_INT_MAX),\n                    'Comment' => 'Foo Bar, Baz!',\n                ],\n            ]);\n\n        self::$cloudFrontOriginAccessId = $result\n            ->search('CloudFrontOriginAccessIdentity.Id');\n        self::$cloudFrontETag = $result['ETag'];\n    }\n\n    /**\n     * @AfterFeature @cloudfront\n     *\n     * @param AfterFeatureScope $scope\n     */\n    public static function tearDownCloudFront(AfterFeatureScope $scope)\n    {\n        self::getSdk(self::$configOverrides)\n            ->createCloudFront()\n            ->deleteCloudFrontOriginAccessIdentity([\n                'Id' => self::$cloudFrontOriginAccessId,\n                'IfMatch' => self::$cloudFrontETag,\n            ]);\n    }\n\n    /**\n     * @BeforeFeature @efs\n     *\n     * Ensure that the testing credentials have access to the EFS preview;\n     * skip entire feature otherwise.\n     *\n     * @param BeforeFeatureScope $scope\n     */\n    public static function setUpEfs(BeforeFeatureScope $scope)\n    {\n        try {\n            self::getSdk(self::$configOverrides)\n                ->createEfs()\n                ->describeFileSystems();\n        } catch (\\Exception $e) {\n            // If the test failed because the account has no access to EFS,\n            // throw the exception to cause the feature to be skipped.\n            if ($e instanceof AwsException\n                && 'AccessDeniedException' === $e->getAwsErrorCode()\n            ) {\n                throw $e;\n            }\n        }\n    }\n\n    /**\n     * @BeforeFeature @inspector\n     *\n     * Ensure that the testing credentials have access to the Inspector preview;\n     * skip entire feature otherwise.\n     *\n     * @param BeforeFeatureScope $scope\n     */\n    public static function setUpInspector(BeforeFeatureScope $scope)\n    {\n        try {\n            self::getSdk(self::$configOverrides)\n                ->createInspector()\n                ->listApplications();\n        } catch (\\Exception $e) {\n            // If the test failed because the account has no access to EFS,\n            // throw the exception to cause the feature to be skipped.\n            if ($e instanceof AwsException\n                && 'AccessDeniedException' === $e->getAwsErrorCode()\n            ) {\n                throw $e;\n            }\n        }\n    }\n\n    /**\n     * @BeforeFeature @marketplacecommerceanalytics\n     *\n     * Ensure that the testing credentials have a Marketplace Commerce Analytics\n     * subscription; skip entire feature otherwise.\n     *\n     * @param BeforeFeatureScope $scope\n     */\n    public static function setUpMarketplaceCommerceAnalytics(BeforeFeatureScope $scope)\n    {\n        try {\n            self::getSdk(self::$configOverrides)\n                ->createMarketplaceCommerceAnalytics()\n                ->generateDataSet([\n                    'dataSetType' => 'fake-type',\n                    'dataSetPublicationDate' => 'fake-date',\n                    'roleNameArn' => 'fake-arn',\n                    'destinationS3BucketName' => 'fake-bucket',\n                    'snsTopicArn' => 'fake-arn',\n                ]);\n        } catch (\\Exception $e) {\n            // If the test failed because the account has no support subscription,\n            // throw the exception to cause the feature to be skipped.\n            if ($e instanceof AwsException\n                && 'SubscriptionRequiredException' === $e->getAwsErrorCode()\n            ) {\n                throw $e;\n            }\n        }\n    }\n\n    /**\n     * @BeforeFeature @sqs\n     *\n     * @param BeforeFeatureScope $scope\n     */\n    public static function setUpSqs(BeforeFeatureScope $scope)\n    {\n        $sqs = self::getSdk(self::$configOverrides)\n            ->createSqs();\n        $queueName = self::getResourcePrefix() . 'testing-queue';\n\n        $sqs->createQueue(['QueueName' => $queueName]);\n        $sqs->waitUntil('QueueExists', ['QueueName' => $queueName]);\n    }\n\n    /**\n     * @AfterFeature @sqs\n     *\n     * @param AfterFeatureScope $scope\n     */\n    public static function tearDownSqs(AfterFeatureScope $scope)\n    {\n        $sqs = self::getSdk(self::$configOverrides)\n            ->createSqs();\n\n        $sqs->deleteQueue([\n            'QueueUrl' => $sqs->getQueueUrl([\n                'QueueName' => self::getResourcePrefix() . 'testing-queue',\n            ])['QueueUrl']\n        ]);\n    }\n\n    /**\n     * @BeforeFeature @support\n     *\n     * Ensure that the testing credentials have a support subscription;\n     * skip entire feature otherwise.\n     *\n     * @param BeforeFeatureScope $scope\n     */\n    public static function setUpSupport(BeforeFeatureScope $scope)\n    {\n        try {\n            self::getSdk(self::$configOverrides)\n                ->createSupport()\n                ->describeServices();\n        } catch (\\Exception $e) {\n            // If the test failed because the account has no support subscription,\n            // throw the exception to cause the feature to be skipped.\n            if ($e instanceof AwsException\n                && 'SubscriptionRequiredException' === $e->getAwsErrorCode()\n            ) {\n                throw $e;\n            }\n        }\n    }\n\n    /**\n     * @BeforeScenario\n     *\n     * @param BeforeScenarioScope $scope\n     */\n    public function setUp(BeforeScenarioScope $scope)\n    {\n        foreach ($scope->getFeature()->getTags() as $tag) {\n            try{\n                $this->serviceName = Aws\\manifest($tag)['namespace'];\n                break;\n            } catch (\\Exception $e) {\n                // just in case an additional tag managed to sneak into the smoke tests\n            }\n        }\n\n        if (empty($this->serviceName)) {\n            throw new PendingException(\n                'No service found for smoke test tagged with: '\n                    . implode(', ', $scope->getFeature()->getTags())\n            );\n        }\n\n        $this->sdk = self::getSdk(self::$configOverrides);\n\n        $this->client = $this->sdk->createClient($this->serviceName);\n    }\n\n    /**\n     * @When I call the :commandName API\n     *\n     * @param string $commandName\n     * @param array $payload\n     */\n    public function iCallTheApi($commandName, array $payload = [])\n    {\n        $this->response = $this->client->{$commandName}($payload);\n    }\n\n    /**\n     * @When I call the :commandName API with:\n     *\n     * @param string $command\n     * @param TableNode $payload\n     */\n    public function iCallTheApiWith($command, TableNode $payload)\n    {\n        $this->iCallTheApi($command, $payload->getRowsHash());\n    }\n\n    /**\n     * @When I call the :command API with JSON:\n     *\n     * @param string $command\n     * @param PyStringNode $payload\n     */\n    public function iCallTheApiWithJson($command, PyStringNode $payload)\n    {\n        $this->iCallTheApi($command, json_decode($payload->getRaw(), true));\n    }\n\n    /**\n     * @When I attempt to call the :commandName API with:\n     *\n     * @param string $command\n     * @param TableNode $payload\n     */\n    public function iAttemptToCallTheApiWith($command, TableNode $payload)\n    {\n        try {\n            $this->iCallTheApiWith($command, $payload);\n        } catch (AwsException $e) {\n            $this->error= $e;\n        }\n    }\n\n    /**\n     * @When I attempt to call the :command API with JSON:\n     *\n     * @param string $command\n     * @param PyStringNode $payload\n     */\n    public function iAttemptToCallTheApiWithJson($command, PyStringNode $payload)\n    {\n        try {\n            $this->iCallTheApiWithJson($command, $payload);\n        } catch (AwsException $e) {\n            $this->error= $e;\n        }\n    }\n\n    /**\n     * @Then the value at :key should be a list\n     *\n     * @param string $key\n     */\n    public function theValueAtShouldBeAList($key)\n    {\n        $this->assertInstanceOf(Result::class, $this->response);\n        $this->assertInternalType('array', $this->response->search($key));\n    }\n\n    /**\n     * @Then I expect the response error code to be :errorCode\n     *\n     * @param string $errorCode\n     */\n    public function iExpectTheResponseErrorCodeToBe($errorCode)\n    {\n        $this->assertSame($errorCode, $this->error->getAwsErrorCode());\n    }\n\n    /**\n     * @Then I expect the response error message to include:\n     *\n     * @param PyStringNode $string\n     */\n    public function iExpectTheResponseErrorMessageToInclude(PyStringNode $string)\n    {\n        $this->assertContains($string->getRaw(), $this->error->getMessage());\n    }\n\n    /**\n     * @Then the response should contain a :key\n     *\n     * @param string $key\n     */\n    public function theResponseShouldContainA($key)\n    {\n        $this->assertInstanceOf(Result::class, $this->response);\n        $this->assertNotNull($this->response->search($key));\n    }\n\n    /**\n     * @Then the error code should be :errorCode\n     *\n     * @param string $errorCode\n     * @param PyStringNode $string\n     */\n    public function theErrorCodeShouldBe($errorCode, PyStringNode $string = null)\n    {\n        $this->iExpectTheResponseErrorCodeToBe($errorCode);\n\n        if (null !== $string) {\n            $this->theErrorMessageShouldContain($string);\n        }\n    }\n\n    /**\n     * @Then the request should be successful\n     */\n    public function theRequestShouldBeSuccessful()\n    {\n        $this->assertEmpty($this->error);\n    }\n\n    /**\n     * @Then the error message should contain:\n     *\n     * @param PyStringNode $string\n     */\n    public function theErrorMessageShouldContain(PyStringNode $string)\n    {\n        $this->assertContains($string->getRaw(), $this->error->getMessage());\n    }\n}\n", "num_lines": 420}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Api\\BridgeApiProvider;\nuse Aws\\Signature\\SignatureProvider;\nuse Aws\\Signature\\SignatureV2;\n\nclass AwsCompatibilityClient extends AwsClient\n{\n    private static $compatibilityServices = [\n        'simpledb' => 'sdb',\n    ];\n\n    public static function getArguments()\n    {\n        $args = parent::getArguments();\n        $args['api_provider']['default']\n            = [BridgeApiProvider::class, 'defaultProvider'];\n        $args['signature_provider']['default']\n            = [__CLASS__, '_default_signature_provider'];\n\n        return $args;\n    }\n\n    public function __construct(array $args)\n    {\n        parent::__construct($args + [\n            'service' => $this->getService(),\n            'signature_version' => 'v2',\n        ]);\n    }\n\n    private function getService()\n    {\n        $klass = get_class($this);\n        $service = strtolower(substr($klass, strrpos($klass, '\\\\') + 1, -6));\n\n        if (isset(self::$compatibilityServices[$service])) {\n            return self::$compatibilityServices[$service];\n        }\n\n        return $service;\n    }\n\n    public static function _default_signature_provider()\n    {\n        return SignatureProvider::memoize(function ($version, $service, $region) {\n            if ('v2' === $version) {\n                return new SignatureV2();\n            }\n\n            static $fallback;\n            if (empty($fallback)) {\n                $fallback = SignatureProvider::version();\n            }\n\n            return $fallback($version, $service, $region);\n        });\n    }\n}\n", "num_lines": 61}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api;\n\nclass BridgeApiProvider\n{\n    public static function defaultProvider()\n    {\n        $dir = __DIR__ . '/../data';\n\n        return ApiProvider::manifest(\n            $dir,\n            \\Aws\\load_compiled_json(\"$dir/manifest.json\")\n        );\n    }\n}\n", "num_lines": 16}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/manifest.json\nreturn [ 'sdb' => [ 'namespace' => 'SimpleDb', 'versions' => [ 'latest' => '2009-04-15', '2009-04-15' => '2009-04-15', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/sdb/2009-04-15/api-2.json\nreturn [ 'metadata' => [ 'apiVersion' => '2009-04-15', 'endpointPrefix' => 'sdb', 'serviceFullName' => 'Amazon SimpleDB', 'signatureVersion' => 'v2', 'xmlNamespace' => 'http://sdb.amazonaws.com/doc/2009-04-15/', 'protocol' => 'query', ], 'operations' => [ 'BatchDeleteAttributes' => [ 'name' => 'BatchDeleteAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'BatchDeleteAttributesRequest', ], ], 'BatchPutAttributes' => [ 'name' => 'BatchPutAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'BatchPutAttributesRequest', ], 'errors' => [ [ 'shape' => 'DuplicateItemName', 'error' => [ 'code' => 'DuplicateItemName', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'InvalidParameterValue', 'error' => [ 'code' => 'InvalidParameterValue', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'MissingParameter', 'error' => [ 'code' => 'MissingParameter', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'NoSuchDomain', 'error' => [ 'code' => 'NoSuchDomain', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'NumberItemAttributesExceeded', 'error' => [ 'code' => 'NumberItemAttributesExceeded', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'NumberDomainAttributesExceeded', 'error' => [ 'code' => 'NumberDomainAttributesExceeded', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'NumberDomainBytesExceeded', 'error' => [ 'code' => 'NumberDomainBytesExceeded', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'NumberSubmittedItemsExceeded', 'error' => [ 'code' => 'NumberSubmittedItemsExceeded', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'NumberSubmittedAttributesExceeded', 'error' => [ 'code' => 'NumberSubmittedAttributesExceeded', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], ], ], 'CreateDomain' => [ 'name' => 'CreateDomain', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateDomainRequest', ], 'errors' => [ [ 'shape' => 'InvalidParameterValue', 'error' => [ 'code' => 'InvalidParameterValue', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'MissingParameter', 'error' => [ 'code' => 'MissingParameter', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'NumberDomainsExceeded', 'error' => [ 'code' => 'NumberDomainsExceeded', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], ], ], 'DeleteAttributes' => [ 'name' => 'DeleteAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteAttributesRequest', ], 'errors' => [ [ 'shape' => 'InvalidParameterValue', 'error' => [ 'code' => 'InvalidParameterValue', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'MissingParameter', 'error' => [ 'code' => 'MissingParameter', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'NoSuchDomain', 'error' => [ 'code' => 'NoSuchDomain', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'AttributeDoesNotExist', 'error' => [ 'code' => 'AttributeDoesNotExist', 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], ], ], 'DeleteDomain' => [ 'name' => 'DeleteDomain', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteDomainRequest', ], 'errors' => [ [ 'shape' => 'MissingParameter', 'error' => [ 'code' => 'MissingParameter', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], ], ], 'DomainMetadata' => [ 'name' => 'DomainMetadata', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DomainMetadataRequest', ], 'output' => [ 'shape' => 'DomainMetadataResult', 'resultWrapper' => 'DomainMetadataResult', ], 'errors' => [ [ 'shape' => 'MissingParameter', 'error' => [ 'code' => 'MissingParameter', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'NoSuchDomain', 'error' => [ 'code' => 'NoSuchDomain', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], ], ], 'GetAttributes' => [ 'name' => 'GetAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetAttributesRequest', ], 'output' => [ 'shape' => 'GetAttributesResult', 'resultWrapper' => 'GetAttributesResult', ], 'errors' => [ [ 'shape' => 'InvalidParameterValue', 'error' => [ 'code' => 'InvalidParameterValue', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'MissingParameter', 'error' => [ 'code' => 'MissingParameter', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'NoSuchDomain', 'error' => [ 'code' => 'NoSuchDomain', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], ], ], 'ListDomains' => [ 'name' => 'ListDomains', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListDomainsRequest', ], 'output' => [ 'shape' => 'ListDomainsResult', 'resultWrapper' => 'ListDomainsResult', ], 'errors' => [ [ 'shape' => 'InvalidParameterValue', 'error' => [ 'code' => 'InvalidParameterValue', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'InvalidNextToken', 'error' => [ 'code' => 'InvalidNextToken', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], ], ], 'PutAttributes' => [ 'name' => 'PutAttributes', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'PutAttributesRequest', ], 'errors' => [ [ 'shape' => 'InvalidParameterValue', 'error' => [ 'code' => 'InvalidParameterValue', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'MissingParameter', 'error' => [ 'code' => 'MissingParameter', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'NoSuchDomain', 'error' => [ 'code' => 'NoSuchDomain', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'NumberDomainAttributesExceeded', 'error' => [ 'code' => 'NumberDomainAttributesExceeded', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'NumberDomainBytesExceeded', 'error' => [ 'code' => 'NumberDomainBytesExceeded', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'NumberItemAttributesExceeded', 'error' => [ 'code' => 'NumberItemAttributesExceeded', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'AttributeDoesNotExist', 'error' => [ 'code' => 'AttributeDoesNotExist', 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], ], ], 'Select' => [ 'name' => 'Select', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'SelectRequest', ], 'output' => [ 'shape' => 'SelectResult', 'resultWrapper' => 'SelectResult', ], 'errors' => [ [ 'shape' => 'InvalidParameterValue', 'error' => [ 'code' => 'InvalidParameterValue', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'InvalidNextToken', 'error' => [ 'code' => 'InvalidNextToken', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'InvalidNumberPredicates', 'error' => [ 'code' => 'InvalidNumberPredicates', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'InvalidNumberValueTests', 'error' => [ 'code' => 'InvalidNumberValueTests', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'InvalidQueryExpression', 'error' => [ 'code' => 'InvalidQueryExpression', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'MissingParameter', 'error' => [ 'code' => 'MissingParameter', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'NoSuchDomain', 'error' => [ 'code' => 'NoSuchDomain', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'RequestTimeout', 'error' => [ 'code' => 'RequestTimeout', 'httpStatusCode' => 408, 'senderFault' => true, ], 'exception' => true, ], [ 'shape' => 'TooManyRequestedAttributes', 'error' => [ 'code' => 'TooManyRequestedAttributes', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], ], ], ], 'shapes' => [ 'Attribute' => [ 'type' => 'structure', 'required' => [ 'Name', 'Value', ], 'members' => [ 'Name' => [ 'shape' => 'String', ], 'AlternateNameEncoding' => [ 'shape' => 'String', ], 'Value' => [ 'shape' => 'String', ], 'AlternateValueEncoding' => [ 'shape' => 'String', ], ], ], 'AttributeDoesNotExist' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'AttributeDoesNotExist', 'httpStatusCode' => 404, 'senderFault' => true, ], 'exception' => true, ], 'AttributeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Attribute', 'locationName' => 'Attribute', ], 'flattened' => true, ], 'AttributeNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', 'locationName' => 'AttributeName', ], 'flattened' => true, ], 'BatchDeleteAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'DomainName', 'Items', ], 'members' => [ 'DomainName' => [ 'shape' => 'String', ], 'Items' => [ 'shape' => 'DeletableItemList', ], ], ], 'BatchPutAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'DomainName', 'Items', ], 'members' => [ 'DomainName' => [ 'shape' => 'String', ], 'Items' => [ 'shape' => 'ReplaceableItemList', ], ], ], 'Boolean' => [ 'type' => 'boolean', ], 'CreateDomainRequest' => [ 'type' => 'structure', 'required' => [ 'DomainName', ], 'members' => [ 'DomainName' => [ 'shape' => 'String', ], ], ], 'DeletableItem' => [ 'type' => 'structure', 'required' => [ 'Name', ], 'members' => [ 'Name' => [ 'shape' => 'String', 'locationName' => 'ItemName', ], 'Attributes' => [ 'shape' => 'AttributeList', ], ], ], 'DeletableItemList' => [ 'type' => 'list', 'member' => [ 'shape' => 'DeletableItem', 'locationName' => 'Item', ], 'flattened' => true, ], 'DeleteAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'DomainName', 'ItemName', ], 'members' => [ 'DomainName' => [ 'shape' => 'String', ], 'ItemName' => [ 'shape' => 'String', ], 'Attributes' => [ 'shape' => 'AttributeList', ], 'Expected' => [ 'shape' => 'UpdateCondition', ], ], ], 'DeleteDomainRequest' => [ 'type' => 'structure', 'required' => [ 'DomainName', ], 'members' => [ 'DomainName' => [ 'shape' => 'String', ], ], ], 'DomainMetadataRequest' => [ 'type' => 'structure', 'required' => [ 'DomainName', ], 'members' => [ 'DomainName' => [ 'shape' => 'String', ], ], ], 'DomainMetadataResult' => [ 'type' => 'structure', 'members' => [ 'ItemCount' => [ 'shape' => 'Integer', ], 'ItemNamesSizeBytes' => [ 'shape' => 'Long', ], 'AttributeNameCount' => [ 'shape' => 'Integer', ], 'AttributeNamesSizeBytes' => [ 'shape' => 'Long', ], 'AttributeValueCount' => [ 'shape' => 'Integer', ], 'AttributeValuesSizeBytes' => [ 'shape' => 'Long', ], 'Timestamp' => [ 'shape' => 'Integer', ], ], ], 'DomainNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'String', 'locationName' => 'DomainName', ], 'flattened' => true, ], 'DuplicateItemName' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'DuplicateItemName', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'Float' => [ 'type' => 'float', ], 'GetAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'DomainName', 'ItemName', ], 'members' => [ 'DomainName' => [ 'shape' => 'String', ], 'ItemName' => [ 'shape' => 'String', ], 'AttributeNames' => [ 'shape' => 'AttributeNameList', ], 'ConsistentRead' => [ 'shape' => 'Boolean', ], ], ], 'GetAttributesResult' => [ 'type' => 'structure', 'members' => [ 'Attributes' => [ 'shape' => 'AttributeList', ], ], ], 'Integer' => [ 'type' => 'integer', ], 'InvalidNextToken' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'InvalidNextToken', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'InvalidNumberPredicates' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'InvalidNumberPredicates', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'InvalidNumberValueTests' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'InvalidNumberValueTests', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'InvalidParameterValue' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'InvalidParameterValue', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'InvalidQueryExpression' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'InvalidQueryExpression', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'Item' => [ 'type' => 'structure', 'required' => [ 'Name', 'Attributes', ], 'members' => [ 'Name' => [ 'shape' => 'String', ], 'AlternateNameEncoding' => [ 'shape' => 'String', ], 'Attributes' => [ 'shape' => 'AttributeList', ], ], ], 'ItemList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Item', 'locationName' => 'Item', ], 'flattened' => true, ], 'ListDomainsRequest' => [ 'type' => 'structure', 'members' => [ 'MaxNumberOfDomains' => [ 'shape' => 'Integer', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'ListDomainsResult' => [ 'type' => 'structure', 'members' => [ 'DomainNames' => [ 'shape' => 'DomainNameList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'Long' => [ 'type' => 'long', ], 'MissingParameter' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'MissingParameter', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'NoSuchDomain' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'NoSuchDomain', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'NumberDomainAttributesExceeded' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'NumberDomainAttributesExceeded', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'NumberDomainBytesExceeded' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'NumberDomainBytesExceeded', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'NumberDomainsExceeded' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'NumberDomainsExceeded', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'NumberItemAttributesExceeded' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'NumberItemAttributesExceeded', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'NumberSubmittedAttributesExceeded' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'NumberSubmittedAttributesExceeded', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'NumberSubmittedItemsExceeded' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'NumberSubmittedItemsExceeded', 'httpStatusCode' => 409, 'senderFault' => true, ], 'exception' => true, ], 'PutAttributesRequest' => [ 'type' => 'structure', 'required' => [ 'DomainName', 'ItemName', 'Attributes', ], 'members' => [ 'DomainName' => [ 'shape' => 'String', ], 'ItemName' => [ 'shape' => 'String', ], 'Attributes' => [ 'shape' => 'ReplaceableAttributeList', ], 'Expected' => [ 'shape' => 'UpdateCondition', ], ], ], 'ReplaceableAttribute' => [ 'type' => 'structure', 'required' => [ 'Name', 'Value', ], 'members' => [ 'Name' => [ 'shape' => 'String', ], 'Value' => [ 'shape' => 'String', ], 'Replace' => [ 'shape' => 'Boolean', ], ], ], 'ReplaceableAttributeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ReplaceableAttribute', 'locationName' => 'Attribute', ], 'flattened' => true, ], 'ReplaceableItem' => [ 'type' => 'structure', 'required' => [ 'Name', 'Attributes', ], 'members' => [ 'Name' => [ 'shape' => 'String', 'locationName' => 'ItemName', ], 'Attributes' => [ 'shape' => 'ReplaceableAttributeList', ], ], ], 'ReplaceableItemList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ReplaceableItem', 'locationName' => 'Item', ], 'flattened' => true, ], 'RequestTimeout' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'RequestTimeout', 'httpStatusCode' => 408, 'senderFault' => true, ], 'exception' => true, ], 'SelectRequest' => [ 'type' => 'structure', 'required' => [ 'SelectExpression', ], 'members' => [ 'SelectExpression' => [ 'shape' => 'String', ], 'NextToken' => [ 'shape' => 'String', ], 'ConsistentRead' => [ 'shape' => 'Boolean', ], ], ], 'SelectResult' => [ 'type' => 'structure', 'members' => [ 'Items' => [ 'shape' => 'ItemList', ], 'NextToken' => [ 'shape' => 'String', ], ], ], 'String' => [ 'type' => 'string', ], 'TooManyRequestedAttributes' => [ 'type' => 'structure', 'members' => [ 'BoxUsage' => [ 'shape' => 'Float', ], ], 'error' => [ 'code' => 'TooManyRequestedAttributes', 'httpStatusCode' => 400, 'senderFault' => true, ], 'exception' => true, ], 'UpdateCondition' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'String', ], 'Value' => [ 'shape' => 'String', ], 'Exists' => [ 'shape' => 'Boolean', ], ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/sdb/2009-04-15/docs-2.json\nreturn [ 'operations' => [ 'BatchDeleteAttributes' => '<p> Performs multiple DeleteAttributes operations in a single call, which reduces round trips and latencies. This enables Amazon SimpleDB to optimize requests, which generally yields better throughput. </p> <p> The following limitations are enforced for this operation: <ul> <li>1 MB request size</li> <li>25 item limit per BatchDeleteAttributes operation</li> </ul> </p>', 'BatchPutAttributes' => '<p> The <code>BatchPutAttributes</code> operation creates or replaces attributes within one or more items. By using this operation, the client can perform multiple <a>PutAttribute</a> operation with a single call. This helps yield savings in round trips and latencies, enabling Amazon SimpleDB to optimize requests and generally produce better throughput. </p> <p> The client may specify the item name with the <code>Item.X.ItemName</code> parameter. The client may specify new attributes using a combination of the <code>Item.X.Attribute.Y.Name</code> and <code>Item.X.Attribute.Y.Value</code> parameters. The client may specify the first attribute for the first item using the parameters <code>Item.0.Attribute.0.Name</code> and <code>Item.0.Attribute.0.Value</code>, and for the second attribute for the first item by the parameters <code>Item.0.Attribute.1.Name</code> and <code>Item.0.Attribute.1.Value</code>, and so on. </p> <p> Attributes are uniquely identified within an item by their name/value combination. For example, a single item can have the attributes <code>{ \"first_name\", \"first_value\" }</code> and <code>{ \"first_name\", \"second_value\" }</code>. However, it cannot have two attribute instances where both the <code>Item.X.Attribute.Y.Name</code> and <code>Item.X.Attribute.Y.Value</code> are the same. </p> <p> Optionally, the requester can supply the <code>Replace</code> parameter for each individual value. Setting this value to <code>true</code> will cause the new attribute values to replace the existing attribute values. For example, if an item <code>I</code> has the attributes <code>{ \\'a\\', \\'1\\' }, { \\'b\\', \\'2\\'}</code> and <code>{ \\'b\\', \\'3\\' }</code> and the requester does a BatchPutAttributes of <code>{\\'I\\', \\'b\\', \\'4\\' }</code> with the Replace parameter set to true, the final attributes of the item will be <code>{ \\'a\\', \\'1\\' }</code> and <code>{ \\'b\\', \\'4\\' }</code>, replacing the previous values of the \\'b\\' attribute with the new value. </p> <important> This operation is vulnerable to exceeding the maximum URL size when making a REST request using the HTTP GET method. This operation does not support conditions using <code>Expected.X.Name</code>, <code>Expected.X.Value</code>, or <code>Expected.X.Exists</code>. </important> <p> You can execute multiple <code>BatchPutAttributes</code> operations and other operations in parallel. However, large numbers of concurrent <code>BatchPutAttributes</code> calls can result in Service Unavailable (503) responses. </p> <p> The following limitations are enforced for this operation: <ul> <li>256 attribute name-value pairs per item</li> <li>1 MB request size</li> <li>1 billion attributes per domain</li> <li>10 GB of total user data storage per domain</li> <li>25 item limit per <code>BatchPutAttributes</code> operation</li> </ul> </p>', 'CreateDomain' => '<p> The <code>CreateDomain</code> operation creates a new domain. The domain name should be unique among the domains associated with the Access Key ID provided in the request. The <code>CreateDomain</code> operation may take 10 or more seconds to complete. </p> <p> The client can create up to 100 domains per account. </p> <p> If the client requires additional domains, go to <a href=\"http://aws.amazon.com/contact-us/simpledb-limit-request/\"> http://aws.amazon.com/contact-us/simpledb-limit-request/</a>. </p>', 'DeleteAttributes' => '<p> Deletes one or more attributes associated with an item. If all attributes of the item are deleted, the item is deleted. </p> <p> <code>DeleteAttributes</code> is an idempotent operation; running it multiple times on the same item or attribute does not result in an error response. </p> <p> Because Amazon SimpleDB makes multiple copies of item data and uses an eventual consistency update model, performing a <a>GetAttributes</a> or <a>Select</a> operation (read) immediately after a <code>DeleteAttributes</code> or <a>PutAttributes</a> operation (write) might not return updated item data. </p>', 'DeleteDomain' => '<p> The <code>DeleteDomain</code> operation deletes a domain. Any items (and their attributes) in the domain are deleted as well. The <code>DeleteDomain</code> operation might take 10 or more seconds to complete. </p>', 'DomainMetadata' => '<p> Returns information about the domain, including when the domain was created, the number of items and attributes in the domain, and the size of the attribute names and values. </p>', 'GetAttributes' => '<p> Returns all of the attributes associated with the specified item. Optionally, the attributes returned can be limited to one or more attributes by specifying an attribute name parameter. </p> <p> If the item does not exist on the replica that was accessed for this operation, an empty set is returned. The system does not return an error as it cannot guarantee the item does not exist on other replicas. </p>', 'ListDomains' => '<p> The <code>ListDomains</code> operation lists all domains associated with the Access Key ID. It returns domain names up to the limit set by <a href=\"#MaxNumberOfDomains\">MaxNumberOfDomains</a>. A <a href=\"#NextToken\">NextToken</a> is returned if there are more than <code>MaxNumberOfDomains</code> domains. Calling <code>ListDomains</code> successive times with the <code>NextToken</code> provided by the operation returns up to <code>MaxNumberOfDomains</code> more domain names with each successive operation call. </p>', 'PutAttributes' => '<p> The PutAttributes operation creates or replaces attributes in an item. The client may specify new attributes using a combination of the <code>Attribute.X.Name</code> and <code>Attribute.X.Value</code> parameters. The client specifies the first attribute by the parameters <code>Attribute.0.Name</code> and <code>Attribute.0.Value</code>, the second attribute by the parameters <code>Attribute.1.Name</code> and <code>Attribute.1.Value</code>, and so on. </p> <p> Attributes are uniquely identified in an item by their name/value combination. For example, a single item can have the attributes <code>{ \"first_name\", \"first_value\" }</code> and <code>{ \"first_name\", second_value\" }</code>. However, it cannot have two attribute instances where both the <code>Attribute.X.Name</code> and <code>Attribute.X.Value</code> are the same. </p> <p> Optionally, the requestor can supply the <code>Replace</code> parameter for each individual attribute. Setting this value to <code>true</code> causes the new attribute value to replace the existing attribute value(s). For example, if an item has the attributes <code>{ \\'a\\', \\'1\\' }</code>, <code>{ \\'b\\', \\'2\\'}</code> and <code>{ \\'b\\', \\'3\\' }</code> and the requestor calls <code>PutAttributes</code> using the attributes <code>{ \\'b\\', \\'4\\' }</code> with the <code>Replace</code> parameter set to true, the final attributes of the item are changed to <code>{ \\'a\\', \\'1\\' }</code> and <code>{ \\'b\\', \\'4\\' }</code>, which replaces the previous values of the \\'b\\' attribute with the new value. </p> <p> You cannot specify an empty string as an attribute name. </p> <p> Because Amazon SimpleDB makes multiple copies of client data and uses an eventual consistency update model, an immediate <a>GetAttributes</a> or <a>Select</a> operation (read) immediately after a <a>PutAttributes</a> or <a>DeleteAttributes</a> operation (write) might not return the updated data. </p> <p> The following limitations are enforced for this operation: <ul> <li>256 total attribute name-value pairs per item</li> <li>One billion attributes per domain</li> <li>10 GB of total user data storage per domain</li> </ul> </p>', 'Select' => '<p> The <code>Select</code> operation returns a set of attributes for <code>ItemNames</code> that match the select expression. <code>Select</code> is similar to the standard SQL SELECT statement. </p> <p> The total size of the response cannot exceed 1 MB in total size. Amazon SimpleDB automatically adjusts the number of items returned per page to enforce this limit. For example, if the client asks to retrieve 2500 items, but each individual item is 10 kB in size, the system returns 100 items and an appropriate <code>NextToken</code> so the client can access the next page of results. </p> <p> For information on how to construct select expressions, see Using Select to Create Amazon SimpleDB Queries in the Developer Guide. </p>', ], 'service' => 'Amazon SimpleDB is a web service providing the core database functions of data indexing and querying in the cloud. By offloading the time and effort associated with building and operating a web-scale database, SimpleDB provides developers the freedom to focus on application development. <p> A traditional, clustered relational database requires a sizable upfront capital outlay, is complex to design, and often requires extensive and repetitive database administration. Amazon SimpleDB is dramatically simpler, requiring no schema, automatically indexing your data and providing a simple API for storage and access. This approach eliminates the administrative burden of data modeling, index maintenance, and performance tuning. Developers gain access to this functionality within Amazon\\'s proven computing environment, are able to scale instantly, and pay only for what they use. </p> <p> Visit <a href=\"http://aws.amazon.com/simpledb/\">http://aws.amazon.com/simpledb/</a> for more information. </p>', 'shapes' => [ 'Attribute' => [ 'base' => '<p></p>', 'refs' => [ 'AttributeList$member' => NULL, ], ], 'AttributeDoesNotExist' => [ 'base' => '<p>The specified attribute does not exist.</p>', 'refs' => [], ], 'AttributeList' => [ 'base' => NULL, 'refs' => [ 'DeletableItem$Attributes' => NULL, 'DeleteAttributesRequest$Attributes' => 'A list of Attributes. Similar to columns on a spreadsheet, attributes represent categories of data that can be assigned to items.', 'GetAttributesResult$Attributes' => 'The list of attributes returned by the operation.', 'Item$Attributes' => 'A list of attributes.', ], ], 'AttributeNameList' => [ 'base' => NULL, 'refs' => [ 'GetAttributesRequest$AttributeNames' => 'The names of the attributes.', ], ], 'BatchDeleteAttributesRequest' => [ 'base' => NULL, 'refs' => [], ], 'BatchPutAttributesRequest' => [ 'base' => NULL, 'refs' => [], ], 'Boolean' => [ 'base' => NULL, 'refs' => [ 'GetAttributesRequest$ConsistentRead' => 'Determines whether or not strong consistency should be enforced when data is read from SimpleDB. If <code>true</code>, any data previously written to SimpleDB will be returned. Otherwise, results will be consistent eventually, and the client may not see data that was written immediately before your read.', 'ReplaceableAttribute$Replace' => 'A flag specifying whether or not to replace the attribute/value pair or to add a new attribute/value pair. The default setting is <code>false</code>.', 'SelectRequest$ConsistentRead' => 'Determines whether or not strong consistency should be enforced when data is read from SimpleDB. If <code>true</code>, any data previously written to SimpleDB will be returned. Otherwise, results will be consistent eventually, and the client may not see data that was written immediately before your read.', 'UpdateCondition$Exists' => '<p>A value specifying whether or not the specified attribute must exist with the specified value in order for the update condition to be satisfied. Specify <code>true</code> if the attribute must exist for the update condition to be satisfied. Specify <code>false</code> if the attribute should not exist in order for the update condition to be satisfied.</p>', ], ], 'CreateDomainRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeletableItem' => [ 'base' => NULL, 'refs' => [ 'DeletableItemList$member' => NULL, ], ], 'DeletableItemList' => [ 'base' => NULL, 'refs' => [ 'BatchDeleteAttributesRequest$Items' => 'A list of items on which to perform the operation.', ], ], 'DeleteAttributesRequest' => [ 'base' => NULL, 'refs' => [], ], 'DeleteDomainRequest' => [ 'base' => NULL, 'refs' => [], ], 'DomainMetadataRequest' => [ 'base' => NULL, 'refs' => [], ], 'DomainMetadataResult' => [ 'base' => NULL, 'refs' => [], ], 'DomainNameList' => [ 'base' => NULL, 'refs' => [ 'ListDomainsResult$DomainNames' => 'A list of domain names that match the expression.', ], ], 'DuplicateItemName' => [ 'base' => '<p>The item name was specified more than once. </p>', 'refs' => [], ], 'Float' => [ 'base' => NULL, 'refs' => [ 'AttributeDoesNotExist$BoxUsage' => NULL, 'DuplicateItemName$BoxUsage' => NULL, 'InvalidNextToken$BoxUsage' => NULL, 'InvalidNumberPredicates$BoxUsage' => NULL, 'InvalidNumberValueTests$BoxUsage' => NULL, 'InvalidParameterValue$BoxUsage' => NULL, 'InvalidQueryExpression$BoxUsage' => NULL, 'MissingParameter$BoxUsage' => NULL, 'NoSuchDomain$BoxUsage' => NULL, 'NumberDomainAttributesExceeded$BoxUsage' => NULL, 'NumberDomainBytesExceeded$BoxUsage' => NULL, 'NumberDomainsExceeded$BoxUsage' => NULL, 'NumberItemAttributesExceeded$BoxUsage' => NULL, 'NumberSubmittedAttributesExceeded$BoxUsage' => NULL, 'NumberSubmittedItemsExceeded$BoxUsage' => NULL, 'RequestTimeout$BoxUsage' => NULL, 'TooManyRequestedAttributes$BoxUsage' => NULL, ], ], 'GetAttributesRequest' => [ 'base' => NULL, 'refs' => [], ], 'GetAttributesResult' => [ 'base' => NULL, 'refs' => [], ], 'Integer' => [ 'base' => NULL, 'refs' => [ 'DomainMetadataResult$ItemCount' => 'The number of all items in the domain.', 'DomainMetadataResult$AttributeNameCount' => 'The number of unique attribute names in the domain.', 'DomainMetadataResult$AttributeValueCount' => 'The number of all attribute name/value pairs in the domain.', 'DomainMetadataResult$Timestamp' => 'The data and time when metadata was calculated, in Epoch (UNIX) seconds.', 'ListDomainsRequest$MaxNumberOfDomains' => 'The maximum number of domain names you want returned. The range is 1 to 100. The default setting is 100.', ], ], 'InvalidNextToken' => [ 'base' => '<p>The specified NextToken is not valid. </p>', 'refs' => [], ], 'InvalidNumberPredicates' => [ 'base' => '<p>Too many predicates exist in the query expression.</p>', 'refs' => [], ], 'InvalidNumberValueTests' => [ 'base' => '<p>Too many predicates exist in the query expression.</p>', 'refs' => [], ], 'InvalidParameterValue' => [ 'base' => '<p>The value for a parameter is invalid.</p>', 'refs' => [], ], 'InvalidQueryExpression' => [ 'base' => '<p>The specified query expression syntax is not valid.</p>', 'refs' => [], ], 'Item' => [ 'base' => '<p></p>', 'refs' => [ 'ItemList$member' => NULL, ], ], 'ItemList' => [ 'base' => NULL, 'refs' => [ 'SelectResult$Items' => 'A list of items that match the select expression.', ], ], 'ListDomainsRequest' => [ 'base' => NULL, 'refs' => [], ], 'ListDomainsResult' => [ 'base' => NULL, 'refs' => [], ], 'Long' => [ 'base' => NULL, 'refs' => [ 'DomainMetadataResult$ItemNamesSizeBytes' => 'The total size of all item names in the domain, in bytes.', 'DomainMetadataResult$AttributeNamesSizeBytes' => 'The total size of all unique attribute names in the domain, in bytes.', 'DomainMetadataResult$AttributeValuesSizeBytes' => 'The total size of all attribute values in the domain, in bytes.', ], ], 'MissingParameter' => [ 'base' => '<p>The request must contain the specified missing parameter.</p>', 'refs' => [], ], 'NoSuchDomain' => [ 'base' => '<p>The specified domain does not exist.</p>', 'refs' => [], ], 'NumberDomainAttributesExceeded' => [ 'base' => '<p>Too many attributes in this domain.</p>', 'refs' => [], ], 'NumberDomainBytesExceeded' => [ 'base' => '<p>Too many bytes in this domain.</p>', 'refs' => [], ], 'NumberDomainsExceeded' => [ 'base' => '<p>Too many domains exist per this account.</p>', 'refs' => [], ], 'NumberItemAttributesExceeded' => [ 'base' => '<p>Too many attributes in this item.</p>', 'refs' => [], ], 'NumberSubmittedAttributesExceeded' => [ 'base' => '<p>Too many attributes exist in a single call.</p>', 'refs' => [], ], 'NumberSubmittedItemsExceeded' => [ 'base' => '<p>Too many items exist in a single call.</p>', 'refs' => [], ], 'PutAttributesRequest' => [ 'base' => NULL, 'refs' => [], ], 'ReplaceableAttribute' => [ 'base' => '<p></p>', 'refs' => [ 'ReplaceableAttributeList$member' => NULL, ], ], 'ReplaceableAttributeList' => [ 'base' => NULL, 'refs' => [ 'PutAttributesRequest$Attributes' => 'The list of attributes.', 'ReplaceableItem$Attributes' => 'The list of attributes for a replaceable item.', ], ], 'ReplaceableItem' => [ 'base' => '<p></p>', 'refs' => [ 'ReplaceableItemList$member' => NULL, ], ], 'ReplaceableItemList' => [ 'base' => NULL, 'refs' => [ 'BatchPutAttributesRequest$Items' => 'A list of items on which to perform the operation.', ], ], 'RequestTimeout' => [ 'base' => '<p>A timeout occurred when attempting to query the specified domain with specified query expression.</p>', 'refs' => [], ], 'SelectRequest' => [ 'base' => NULL, 'refs' => [], ], 'SelectResult' => [ 'base' => NULL, 'refs' => [], ], 'String' => [ 'base' => NULL, 'refs' => [ 'Attribute$Name' => 'The name of the attribute.', 'Attribute$AlternateNameEncoding' => '<p></p>', 'Attribute$Value' => 'The value of the attribute.', 'Attribute$AlternateValueEncoding' => '<p></p>', 'AttributeNameList$member' => NULL, 'BatchDeleteAttributesRequest$DomainName' => 'The name of the domain in which the attributes are being deleted.', 'BatchPutAttributesRequest$DomainName' => 'The name of the domain in which the attributes are being stored.', 'CreateDomainRequest$DomainName' => 'The name of the domain to create. The name can range between 3 and 255 characters and can contain the following characters: a-z, A-Z, 0-9, \\'_\\', \\'-\\', and \\'.\\'.', 'DeletableItem$Name' => NULL, 'DeleteAttributesRequest$DomainName' => 'The name of the domain in which to perform the operation.', 'DeleteAttributesRequest$ItemName' => 'The name of the item. Similar to rows on a spreadsheet, items represent individual objects that contain one or more value-attribute pairs.', 'DeleteDomainRequest$DomainName' => 'The name of the domain to delete.', 'DomainMetadataRequest$DomainName' => 'The name of the domain for which to display the metadata of.', 'DomainNameList$member' => NULL, 'GetAttributesRequest$DomainName' => 'The name of the domain in which to perform the operation.', 'GetAttributesRequest$ItemName' => 'The name of the item.', 'Item$Name' => 'The name of the item.', 'Item$AlternateNameEncoding' => '<p></p>', 'ListDomainsRequest$NextToken' => 'A string informing Amazon SimpleDB where to start the next list of domain names.', 'ListDomainsResult$NextToken' => 'An opaque token indicating that there are more domains than the specified <code>MaxNumberOfDomains</code> still available.', 'PutAttributesRequest$DomainName' => 'The name of the domain in which to perform the operation.', 'PutAttributesRequest$ItemName' => 'The name of the item.', 'ReplaceableAttribute$Name' => 'The name of the replaceable attribute.', 'ReplaceableAttribute$Value' => 'The value of the replaceable attribute.', 'ReplaceableItem$Name' => 'The name of the replaceable item.', 'SelectRequest$SelectExpression' => 'The expression used to query the domain.', 'SelectRequest$NextToken' => 'A string informing Amazon SimpleDB where to start the next list of <code>ItemNames</code>.', 'SelectResult$NextToken' => 'An opaque token indicating that more items than <code>MaxNumberOfItems</code> were matched, the response size exceeded 1 megabyte, or the execution time exceeded 5 seconds.', 'UpdateCondition$Name' => '<p>The name of the attribute involved in the condition.</p>', 'UpdateCondition$Value' => '<p>The value of an attribute. This value can only be specified when the <code>Exists</code> parameter is equal to <code>true</code>.</p>', ], ], 'TooManyRequestedAttributes' => [ 'base' => '<p>Too many attributes requested.</p>', 'refs' => [], ], 'UpdateCondition' => [ 'base' => '<p> Specifies the conditions under which data should be updated. If an update condition is specified for a request, the data will only be updated if the condition is satisfied. For example, if an attribute with a specific name and value exists, or if a specific attribute doesn\\'t exist. </p>', 'refs' => [ 'DeleteAttributesRequest$Expected' => 'The update condition which, if specified, determines whether the specified attributes will be deleted or not. The update condition must be satisfied in order for this request to be processed and the attributes to be deleted.', 'PutAttributesRequest$Expected' => 'The update condition which, if specified, determines whether the specified attributes will be updated or not. The update condition must be satisfied in order for this request to be processed and the attributes to be updated.', ], ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n// This file was auto-generated from sdk-root/src/data/sdb/2009-04-15/paginators-1.json\nreturn [ 'pagination' => [ 'ListDomains' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'MaxNumberOfDomains', 'result_key' => 'DomainNames', ], 'Select' => [ 'input_token' => 'NextToken', 'output_token' => 'NextToken', 'result_key' => 'Items', ], ],];\n", "num_lines": 4}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Signature;\n\nuse Aws\\Credentials\\CredentialsInterface;\nuse GuzzleHttp\\Psr7;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Implementation of Signature Version 2\n * @link http://aws.amazon.com/articles/1928\n */\nclass SignatureV2 implements SignatureInterface\n{\n    public function signRequest(\n        RequestInterface $request,\n        CredentialsInterface $credentials\n    ) {\n        $params = Psr7\\Query::parse($request->getBody());\n        $params['Timestamp'] = gmdate('c');\n        $params['SignatureVersion'] = '2';\n        $params['SignatureMethod'] = 'HmacSHA256';\n        $params['AWSAccessKeyId'] = $credentials->getAccessKeyId();\n\n        if ($token = $credentials->getSecurityToken()) {\n            $params['SecurityToken'] = $token;\n        }\n\n        // build string to sign\n        $sign = $request->getMethod() . \"\\n\"\n            . $request->getHeaderLine('Host') . \"\\n\"\n            . '/' . \"\\n\"\n            . $this->getCanonicalizedParameterString($params);\n\n        $params['Signature'] = base64_encode(\n            hash_hmac(\n                'sha256',\n                $sign,\n                $credentials->getSecretKey(),\n                true\n            )\n        );\n\n        return $request->withBody(Psr7\\Utils::streamFor(http_build_query($params)));\n    }\n\n    public function presign(\n        RequestInterface $request,\n        CredentialsInterface $credentials,\n        $expires,\n        array $options = []\n    ) {\n        throw new \\BadMethodCallException(__METHOD__ . ' not implemented');\n    }\n\n    private function getCanonicalizedParameterString(array $params)\n    {\n        unset($params['Signature']);\n        uksort($params, 'strcmp');\n\n        $str = '';\n        foreach ($params as $key => $val) {\n            $str .= rawurlencode($key) . '=' . rawurlencode($val) . '&';\n        }\n\n        return substr($str, 0, -1);\n    }\n}\n", "num_lines": 68}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SimpleDb;\n\nuse Aws\\AwsCompatibilityClient;\n\n/**\n * This client is used to interact with the **Amazon SimpleDB** service.\n *\n * @method \\Aws\\Result batchDeleteAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchDeleteAttributesAsync(array $args = [])\n * @method \\Aws\\Result batchPutAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise batchPutAttributesAsync(array $args = [])\n * @method \\Aws\\Result createDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise createDomainAsync(array $args = [])\n * @method \\Aws\\Result deleteAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteAttributesAsync(array $args = [])\n * @method \\Aws\\Result deleteDomain(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise deleteDomainAsync(array $args = [])\n * @method \\Aws\\Result domainMetadata(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise domainMetadataAsync(array $args = [])\n * @method \\Aws\\Result getAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise getAttributesAsync(array $args = [])\n * @method \\Aws\\Result listDomains(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise listDomainsAsync(array $args = [])\n * @method \\Aws\\Result putAttributes(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise putAttributesAsync(array $args = [])\n * @method \\Aws\\Result select(array $args = [])\n * @method \\GuzzleHttp\\Promise\\Promise selectAsync(array $args = [])\n */\nclass SimpleDbClient extends AwsCompatibilityClient {}\n", "num_lines": 31}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\SimpleDb\\Exception;\n\nuse Aws\\Exception\\AwsException;\n\n/**\n * Represents an error interacting with the Amazon SimpleDB service.\n */\nclass SimpleDbException extends AwsException {}\n", "num_lines": 10}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws;\n\nuse Aws\\Signature\\AnonymousSignature;\nuse Aws\\Signature\\S3SignatureV4;\nuse Aws\\Signature\\SignatureV2;\nuse Aws\\Signature\\SignatureV4;\n\nclass AwsCompatibilityClientTest extends \\PHPUnit_Framework_TestCase\n{\n    /**\n     * @dataProvider signatureVersionProvider\n     *\n     * @param string $classSought\n     * @param array $providerArgs\n     */\n    public function testCanCreateV2Signer($classSought, array $providerArgs)\n    {\n        $args = AwsCompatibilityClient::getArguments();\n        /** @var callable $provider */\n        $provider = call_user_func($args['signature_provider']['default']);\n\n        $this->assertInstanceOf($classSought, call_user_func_array($provider, $providerArgs));\n    }\n\n    public function signatureVersionProvider()\n    {\n        return [\n            [SignatureV2::class, ['v2', 'sdb', 'us-east-1']],\n            [SignatureV4::class, ['v4', 'iam', 'us-east-1']],\n            [S3SignatureV4::class, ['v4', 's3', 'us-east-1']],\n            [AnonymousSignature::class, ['anonymous', 'service', 'us-east-1']],\n        ];\n    }\n}\n", "num_lines": 36}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Api;\n\nclass BridgeApiProviderTest extends \\PHPUnit_Framework_TestCase\n{\n    public function testCanGetDefaultProvider()\n    {\n        $p = BridgeApiProvider::defaultProvider();\n        $this->assertArrayHasKey('sdb', $this->readAttribute($p, 'manifest'));\n    }\n}\n", "num_lines": 12}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Integ;\n\nuse Aws\\ImportExport\\ImportExportClient;\nuse Aws\\SimpleDb\\SimpleDbClient;\nuse Aws\\Test\\Integ\\SmokeContext;\nuse Behat\\Behat\\Hook\\Scope\\BeforeScenarioScope;\n\nclass BridgeSmokeContext extends SmokeContext\n{\n    private static $defaultOptions = [\n        'region' => 'us-east-1',\n        'version' => 'latest',\n        'ua_append' => 'PHPUnit/Integration',\n        'validate' => false,\n    ];\n\n    /**\n     * @BeforeScenario\n     *\n     * @param BeforeScenarioScope $scope\n     */\n    public function setUp(BeforeScenarioScope $scope)\n    {\n        // no-op\n    }\n\n    /**\n     * @BeforeScenario @sdb\n     */\n    public function setUpSdb()\n    {\n        $this->client = new SimpleDbClient(self::$defaultOptions);\n    }\n\n    /**\n     * @BeforeScenario @importexport\n     */\n    public function setUpImportExport()\n    {\n        $this->client = new ImportExportClient(self::$defaultOptions);\n    }\n}\n", "num_lines": 44}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Signature;\n\nrequire_once __DIR__ . '/sig_hack.php';\n\nuse Aws\\Credentials\\Credentials;\nuse GuzzleHttp\\Psr7\\Request;\nuse GuzzleHttp\\Psr7;\n\n/**\n * @covers Aws\\Signature\\SignatureV2\n */\nclass SignatureV2Test extends \\PHPUnit_Framework_TestCase\n{\n    const DEFAULT_KEY = 'AKIDEXAMPLE';\n    const DEFAULT_SECRET = 'wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY';\n\n    public function testSignsRequestsWithSecurityToken()\n    {\n        $_SERVER['aws_time'] = 'Fri, 09 Sep 2011 23:36:00 GMT';\n        $request = new Request(\n            'POST',\n            'http://foo.com',\n            ['Content-Type' => 'application/x-www-form-urlencoded'],\n            'Test=123&Other=456'\n        );\n        $c = new Credentials(self::DEFAULT_KEY, self::DEFAULT_SECRET, 'foo');\n        $sig = new SignatureV2();\n        $result = $sig->signRequest($request, $c);\n\n        $expected = \"POST / HTTP/1.1\\r\\n\"\n            . \"Host: foo.com\\r\\n\"\n            . \"Content-Type: application/x-www-form-urlencoded\\r\\n\\r\\n\"\n            . \"Test=123&Other=456&Timestamp=Fri%2C+09+Sep+2011+23%3A36%3A00+GMT&SignatureVersion=2&SignatureMethod=HmacSHA256&AWSAccessKeyId=AKIDEXAMPLE&SecurityToken=foo&Signature=NzQ9b5Kx6qlKj2UIK6QHIrmq5ypogh9PhBHVXKA4RU4%3D\";\n        $this->assertEquals($expected, Psr7\\Message::toString($result));\n    }\n\n    public function testCanSignBodyWithStructureShapes()\n    {\n        $_SERVER['aws_time'] = 'Fri, 09 Sep 2011 23:36:00 GMT';\n        $request = new Request(\n            'POST',\n            'http://foo.com',\n            ['Content-Type' => 'application/x-www-form-urlencoded'],\n            'Test=123&Other=456&Nested.1.Name=foo&Nested.1.Value=bar'\n        );\n        $c = new Credentials(self::DEFAULT_KEY, self::DEFAULT_SECRET, 'foo');\n        $sig = new SignatureV2();\n        $result = $sig->signRequest($request, $c);\n\n        $expected = \"POST / HTTP/1.1\\r\\n\"\n            . \"Host: foo.com\\r\\n\"\n            . \"Content-Type: application/x-www-form-urlencoded\\r\\n\\r\\n\"\n            . \"Test=123&Other=456&Nested.1.Name=foo&Nested.1.Value=bar&Timestamp=Fri%2C+09+Sep+2011+23%3A36%3A00+GMT&SignatureVersion=2&SignatureMethod=HmacSHA256&AWSAccessKeyId=AKIDEXAMPLE&SecurityToken=foo&Signature=MbXBpe7leHe6O49B0CU86h%2By0GKFfQ9rBVCNvQWQlB0%3D\";\n        $this->assertEquals($expected, Psr7\\Message::toString($result));\n    }\n\n    /**\n     * @expectedException \\BadMethodCallException\n     */\n    public function testThrowsWhenNotImplemented()\n    {\n        $mock = $sig = new SignatureV2();\n        $request = new Request('GET', 'http://foo.com');\n        $credentials = new Credentials('foo', 'bar');\n        $mock->presign($request, $credentials, '+10 minutes');\n    }\n}\n", "num_lines": 69}
{"repo_name": "aws-sdk-php-v3-bridge", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\nnamespace Aws\\Signature;\n\n// Hack gmdate() to returned the canned result.\nfunction gmdate($format, $ts = null)\n{\n    return isset($_SERVER['aws_time'])\n        ? $_SERVER['aws_time']\n        : \\gmdate($format, $ts ?: time());\n}\n\nfunction time()\n{\n    if (isset($_SERVER['aws_time'])) {\n        return $_SERVER['aws_time'] === true\n            ? strtotime('December 5, 2013 00:00:00 UTC')\n            : $_SERVER['aws_time'];\n    }\n\n    return \\time();\n}\n", "num_lines": 22}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule;\n\nuse Laminas\\ModuleManager\\Feature\\ConfigProviderInterface;\n\n/**\n * Zend Framework 2 module that allows easy consumption of the AWS SDK for PHP\n */\nclass Module implements ConfigProviderInterface\n{\n    const VERSION = '4.3.0';\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getConfig()\n    {\n        return include __DIR__ . '/config/module.config.php';\n    }\n}\n", "num_lines": 22}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nuse AwsModule\\Factory\\AwsFactory;\nuse AwsModule\\Factory\\CloudFrontLinkViewHelperFactory;\nuse AwsModule\\Factory\\DynamoDbSessionSaveHandlerFactory;\nuse AwsModule\\Factory\\S3LinkViewHelperFactory;\nuse AwsModule\\Factory\\S3RenameUploadFactory;\nuse AwsModule\\Filter\\File\\S3RenameUpload;\nuse Aws\\Sdk as Aws;\nuse AwsModule\\Session\\SaveHandler\\DynamoDb as DynamoDbSaveHandler;\nuse AwsModule\\View\\Helper\\CloudFrontLink;\nuse AwsModule\\View\\Helper\\S3Link;\n\nreturn [\n    'service_manager' => [\n        'factories' => [\n            Aws::class                 => AwsFactory::class,\n            DynamoDbSaveHandler::class => DynamoDbSessionSaveHandlerFactory::class\n        ]\n    ],\n\n    'filters' => [\n        'factories' => [\n            S3RenameUpload::class => S3RenameUploadFactory::class\n        ],\n        'aliases' => [\n            's3renameupload' => S3RenameUpload::class\n        ]\n    ],\n\n    'view_helpers' => [\n        'factories' => [\n            S3Link::class         => S3LinkViewHelperFactory::class,\n            CloudFrontLink::class => CloudFrontLinkViewHelperFactory::class\n        ],\n\n        'aliases' => [\n            'cloudfrontlink' => CloudFrontLink::class,\n            's3link'         => S3Link::class\n        ]\n    ],\n];\n", "num_lines": 43}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\Factory;\n\nuse Aws\\Sdk as AwsSdk;\nuse AwsModule\\Module;\nuse Interop\\Container\\ContainerInterface;\nuse Laminas\\ServiceManager\\Factory\\FactoryInterface;\nuse Laminas\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * Factory used to instantiate an AWS client\n */\nclass AwsFactory implements FactoryInterface\n{\n    /**\n     * @param ContainerInterface $container\n     * @param string $requestedName\n     * @param array|null $options\n     * @return AwsSdk\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)\n    {\n        // Instantiate the AWS SDK for PHP\n        $config = $container->get('Config');\n        $config = isset($config['aws']) ? $config['aws'] : [];\n\n        $config += [\n            'ua_append' => [\n                'ZF2/' . Module::VERSION,\n                'ZFMOD/' . Module::VERSION,\n            ]\n        ];\n\n        return new AwsSdk($config);\n    }\n\n    /**\n     * {@inheritDoc}\n     * @return AwsSdk\n     */\n    public function createService(ServiceLocatorInterface $serviceLocator)\n    {\n        return $this($serviceLocator, AwsSdk::class);\n    }\n}\n", "num_lines": 47}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\Factory;\n\nuse Aws\\Sdk as AwsSdk;\nuse AwsModule\\View\\Helper\\CloudFrontLink;\nuse Interop\\Container\\ContainerInterface;\nuse Laminas\\ServiceManager\\Factory\\FactoryInterface;\nuse Laminas\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * Factory used to instantiate a CloudFront link view helper\n */\nclass CloudFrontLinkViewHelperFactory implements FactoryInterface\n{\n\n    /**\n     * @param ContainerInterface $container\n     * @param string             $requestedName\n     * @param array|null         $options\n     * @return CloudFrontLink\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)\n    {\n        /** @var AwsSdk $awsSdk */\n        $awsSdk = $container->get(AwsSdk::class);\n\n        return new CloudFrontLink($awsSdk->createCloudFront());\n    }\n\n    /**\n     * {@inheritDoc}\n     * @return CloudFrontLink\n     */\n    public function createService(ServiceLocatorInterface $serviceLocator)\n    {\n        $parentLocator = $serviceLocator->getServiceLocator();\n\n        return $this($parentLocator, CloudFrontLink::class);\n    }\n}\n", "num_lines": 42}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\Factory;\n\nuse Aws\\Sdk as AwsSdk;\nuse Aws\\DynamoDb\\SessionHandler;\nuse AwsModule\\Session\\SaveHandler\\DynamoDb as DynamoDbSaveHandler;\nuse Interop\\Container\\ContainerInterface;\nuse Laminas\\ServiceManager\\Exception\\ServiceNotCreatedException;\nuse Laminas\\ServiceManager\\Factory\\FactoryInterface;\nuse Laminas\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * Factory used to instantiate a DynamoDB-backed session save handler\n */\nclass DynamoDbSessionSaveHandlerFactory implements FactoryInterface\n{\n    /**\n     * @param ContainerInterface $container\n     * @param string             $requestedName\n     * @param array|null         $options\n     * @return DynamoDbSaveHandler\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)\n    {\n        $config = $container->get('Config');\n\n        if (!isset($config['aws_zf2']['session']['save_handler']['dynamodb'])) {\n            throw new ServiceNotCreatedException(\n                'ZF2 AWS PHP SDK configuration is missing a \"dynamodb\" key. ' .\n                'Have you copied \"config/aws_zf2.local.php.dist\" into your ' .\n                'project (without the .dist extension)?'\n            );\n        }\n\n        /** @var AwsSdk $awsSdk */\n        $awsSdk = $container->get(AwsSdk::class);\n\n        $saveHandlerConfig = $config['aws_zf2']['session']['save_handler']['dynamodb'];\n        $sessionHandler    = SessionHandler::fromClient($awsSdk->createDynamoDb(), $saveHandlerConfig);\n\n        return new DynamoDbSaveHandler($sessionHandler);\n    }\n\n    /**\n     * {@inheritDoc}\n     * @return DynamoDbSaveHandler\n     * @throws ServiceNotCreatedException if \"dynamodb\" configuration is not set up correctly\n     */\n    public function createService(ServiceLocatorInterface $serviceLocator)\n    {\n        return $this($serviceLocator, DynamoDbSaveHandler::class);\n    }\n}\n", "num_lines": 55}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\Factory;\n\nuse Aws\\Sdk as AwsSdk;\nuse AwsModule\\View\\Helper\\S3Link;\nuse Interop\\Container\\ContainerInterface;\nuse Laminas\\ServiceManager\\Factory\\FactoryInterface;\nuse Laminas\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * Factory used to instantiate a S3 link view helper\n */\nclass S3LinkViewHelperFactory implements FactoryInterface\n{\n    /**\n     * @param ContainerInterface $container\n     * @param string             $requestedName\n     * @param array|null         $options\n     * @return S3Link\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)\n    {\n        /** @var AwsSdk $awsSdk */\n        $awsSdk = $container->get(AwsSdk::class);\n\n        return new S3Link($awsSdk->createS3());\n    }\n\n    /**\n     * {@inheritDoc}\n     * @return S3Link\n     */\n    public function createService(ServiceLocatorInterface $serviceLocator)\n    {\n        $parentLocator = $serviceLocator->getServiceLocator();\n\n        return $this($parentLocator, S3Link::class);\n    }\n}\n", "num_lines": 41}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\Factory;\n\nuse Aws\\Sdk as AwsSdk;\nuse AwsModule\\Filter\\File\\S3RenameUpload;\nuse Interop\\Container\\ContainerInterface;\nuse Laminas\\ServiceManager\\Factory\\FactoryInterface;\nuse Laminas\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * Factory used to instantiate a S3RenameUpload file filter\n */\nclass S3RenameUploadFactory implements FactoryInterface\n{\n    /**\n     * @param ContainerInterface $container\n     * @param string             $requestedName\n     * @param array|null         $options\n     * @return S3RenameUpload\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)\n    {\n        /** @var AwsSdk $awsSdk */\n        $awsSdk = $container->get(AwsSdk::class);\n\n        return new S3RenameUpload($awsSdk->createS3());\n    }\n\n    public function createService(ServiceLocatorInterface $serviceLocator)\n    {\n        $parentLocator = $serviceLocator->getServiceLocator();\n\n        return $this($parentLocator, S3RenameUpload::class);\n    }\n}\n", "num_lines": 37}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\Filter\\Exception;\n\nuse InvalidArgumentException;\n\n/**\n * Exception thrown when no bucket is passed\n */\nclass MissingBucketException extends InvalidArgumentException\n{\n}\n", "num_lines": 13}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\Filter\\File;\n\nuse Aws\\S3\\S3Client;\nuse AwsModule\\Filter\\Exception\\MissingBucketException;\nuse Laminas\\Filter\\File\\RenameUpload;\n\n/**\n * File filter that allow to directly upload to Amazon S3, and optionally rename the file\n */\nclass S3RenameUpload extends RenameUpload\n{\n    /**\n     * @var S3Client\n     */\n    protected $client;\n\n    /**\n     * @var array\n     */\n    protected $options = [\n        'bucket'               => null,\n        'target'               => null,\n        'use_upload_name'      => false,\n        'use_upload_extension' => false,\n        'overwrite'            => false,\n        'randomize'            => false,\n    ];\n\n    /**\n     * @param S3Client $client\n     * @param array    $options\n     */\n    public function __construct(S3Client $client, $options = [])\n    {\n        parent::__construct($options);\n\n        // We need to register the S3 stream wrapper so that we can take advantage of the base class\n        $this->client = $client;\n        $this->client->registerStreamWrapper();\n    }\n\n    /**\n     * Set the bucket name\n     *\n     * @param  string $bucket\n     *\n     * @return S3RenameUpload\n     */\n    public function setBucket($bucket)\n    {\n        $this->options['bucket'] = trim($bucket, '/');\n        return $this;\n    }\n\n    /**\n     * Get the bucket name\n     *\n     * @return string\n     */\n    public function getBucket()\n    {\n        return $this->options['bucket'];\n    }\n\n    /**\n     * This method is overloaded so that the final target points to a URI using S3 protocol\n     *\n     * {@inheritdoc}\n     */\n    protected function getFinalTarget($source, $clientFileName)\n    {\n        // We cannot upload without a bucket\n        if (null === $this->options['bucket']) {\n            throw new MissingBucketException('No bucket was set when trying to upload a file to S3');\n        }\n\n        // Get the tmp file name and convert it to an S3 key\n        $key = trim(str_replace('\\\\', '/', parent::getFinalTarget($source, $clientFileName)), '/');\n        if (strpos($key, './') === 0) {\n            $key = substr($key, 2);\n        }\n\n        return \"s3://{$this->options['bucket']}/{$key}\";\n    }\n}\n", "num_lines": 88}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\Session\\SaveHandler;\n\nuse Aws\\Dynamodb\\SessionHandler;\nuse Laminas\\Session\\SaveHandler\\SaveHandlerInterface;\n\n/**\n * DynamoDB session save handler\n */\nclass DynamoDb implements SaveHandlerInterface\n{\n    /**\n     * @var SessionHandler\n     */\n    protected $sessionHandler;\n\n    /**\n     * Constructor\n     *\n     * @param SessionHandler $sessionHandler DynamoDB session handler\n     */\n    public function __construct(SessionHandler $sessionHandler)\n    {\n        $this->sessionHandler = $sessionHandler;\n    }\n\n    /**\n     * Open a session for writing. Triggered by session_start()\n     *\n     * Part of the standard PHP session handler interface\n     *\n     * @param  string $savePath Session save path\n     * @param  string $name     Session name\n     *\n     * @return bool Whether or not the operation succeeded\n     */\n    public function open($savePath, $name)\n    {\n        return $this->sessionHandler->open($savePath, $name);\n    }\n\n    /**\n     * Close a session\n     *\n     * Part of the standard PHP session handler interface\n     *\n     * @return bool Whether or not the operation succeeded\n     */\n    public function close()\n    {\n        return $this->sessionHandler->close();\n    }\n\n    /**\n     * Read session data stored in DynamoDB\n     *\n     * Part of the standard PHP session handler interface\n     *\n     * @param string $id The session ID\n     *\n     * @return string Session data\n     */\n    public function read($id)\n    {\n        return $this->sessionHandler->read($id);\n    }\n\n    /**\n     * Write session data to DynamoDB\n     *\n     * Part of the standard PHP session handler interface\n     *\n     * @param string $id   The session ID\n     * @param string $data The serialized session data\n     *\n     * @return bool Whether or not the operation succeeded\n     */\n    public function write($id, $data)\n    {\n        return $this->sessionHandler->write($id, $data);\n    }\n\n    /**\n     * Destroy a session stored in DynamoDB\n     *\n     * Part of the standard PHP session handler interface\n     *\n     * @param string $id The session ID\n     *\n     * @return bool Whether or not the operation succeeded\n     */\n    public function destroy($id)\n    {\n        return $this->sessionHandler->destroy($id);\n    }\n\n    /**\n     * Trigger garbage collection on expired sessions\n     *\n     * Part of the standard PHP session handler interface\n     *\n     * @param int $maxlifetime The value of `session.gc_maxlifetime`. Ignored.\n     *\n     * @return bool Whether or not the operation succeeded\n     */\n    public function gc($maxlifetime)\n    {\n        return $this->sessionHandler->gc($maxlifetime);\n    }\n}\n", "num_lines": 112}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\View\\Exception;\n\nuse InvalidArgumentException;\n\n/**\n * Exception thrown when an invalid CloudFront domain is passed\n */\nclass InvalidDomainNameException extends InvalidArgumentException\n{\n}\n", "num_lines": 13}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\View\\Helper;\n\nuse Aws\\CloudFront\\CloudFrontClient;\nuse AwsModule\\View\\Exception\\InvalidDomainNameException;\nuse Laminas\\View\\Helper\\AbstractHelper;\n\n/**\n * View helper that can render a link to a CloudFront object. It can also create signed URLs\n * using a canned policy\n */\nclass CloudFrontLink extends AbstractHelper\n{\n    /**\n     * @var string The hostname for CloudFront domains\n     */\n    protected $hostname = '.cloudfront.net';\n\n    /**\n     * @var CloudFrontClient An instance of CloudFrontClient to be used by the helper\n     */\n    protected $client;\n\n    /**\n     * @var string The default CloudFront domain to use\n     */\n    protected $defaultDomain = '';\n\n    /**\n     * @param CloudFrontClient $client\n     */\n    public function __construct(CloudFrontClient $client)\n    {\n        $this->client = $client;\n    }\n\n    /**\n     * Set the CloudFront hostname to use if you are using a custom hostname\n     *\n     * @param string $hostname\n     *\n     * @return self\n     */\n    public function setHostname($hostname)\n    {\n        $this->hostname = '.' . ltrim($hostname, '.');\n\n        return $this;\n    }\n\n    /**\n     * Get the CloudFront hostname being used\n     *\n     * @return string\n     */\n    public function getHostname()\n    {\n        return $this->hostname;\n    }\n\n    /**\n     * Set the CloudFront domain to use if none is provided\n     *\n     * @param string $defaultDomain\n     *\n     * @return self\n     */\n    public function setDefaultDomain($defaultDomain)\n    {\n        $this->defaultDomain = (string) $defaultDomain;\n\n        return $this;\n    }\n\n    /**\n     * Get the CloudFront domain to use if none is provided\n     *\n     * @return string\n     */\n    public function getDefaultDomain()\n    {\n        return $this->defaultDomain;\n    }\n\n    /**\n     * Create a link to a CloudFront object\n     *\n     * @param  string     $object\n     * @param  string     $domain\n     * @param  string|int $expiration\n     * @param  string     $keyPairId\n     * @param  string     $privateKey\n     *\n     * @return string\n     * @throws InvalidDomainNameException\n     */\n    public function __invoke($object, $domain = '', $expiration = '', $keyPairId = '', $privateKey = '')\n    {\n        if (empty($domain)) {\n            $domain = $this->getDefaultDomain();\n        }\n\n        // If $domain is still empty, we throw an exception as it makes no sense\n        if (empty($domain)) {\n            throw new InvalidDomainNameException('An empty CloudFront domain name was given');\n        }\n\n        $url = sprintf(\n            'https://%s%s/%s',\n            str_replace($this->hostname, '', rtrim($domain, '/')),\n            $this->hostname,\n            ltrim($object, '/')\n        );\n\n        if (empty($expiration)) {\n            return $url;\n        }\n\n        return $this->client->getSignedUrl([\n            'url'         => $url,\n            'expires'     => $expiration,\n            'key_pair_id' => $keyPairId,\n            'private_key' => $privateKey\n        ]);\n    }\n}\n", "num_lines": 128}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\View\\Helper;\n\nuse Aws\\S3\\S3Client;\nuse AwsModule\\View\\Exception\\InvalidDomainNameException;\nuse Laminas\\View\\Helper\\AbstractHelper;\n\n/**\n * View helper that can render a link to a S3 object. It can also create signed URLs\n */\nclass S3Link extends AbstractHelper\n{\n    /**\n     * @var S3Client\n     */\n    protected $client;\n\n    /**\n     * @var string\n     */\n    protected $defaultBucket = '';\n\n    /**\n     * @param S3Client $client\n     */\n    public function __construct(S3Client $client)\n    {\n        $this->client = $client;\n    }\n\n    /**\n     * Set the default bucket to use if none is provided\n     *\n     * @param string $defaultBucket\n     *\n     * @return self\n     */\n    public function setDefaultBucket($defaultBucket)\n    {\n        $this->defaultBucket = (string) $defaultBucket;\n\n        return $this;\n    }\n\n    /**\n     * Get the default bucket to use if none is provided\n     *\n     * @return string\n     */\n    public function getDefaultBucket()\n    {\n        return $this->defaultBucket;\n    }\n\n    /**\n     * Create a link to a S3 object from a bucket. If expiration is not empty, then it is used to create\n     * a signed URL\n     *\n     * @param  string     $object The object name (full path)\n     * @param  string     $bucket The bucket name\n     * @param  string|int $expiration The Unix timestamp to expire at or a string that can be evaluated by strtotime\n     * @throws InvalidDomainNameException\n     * @return string\n     */\n    public function __invoke($object, $bucket = '', $expiration = '')\n    {\n        $bucket = trim($bucket ?: $this->getDefaultBucket(), '/');\n\n        if (empty($bucket)) {\n            throw new InvalidDomainNameException('An empty bucket name was given');\n        }\n\n        if ($expiration) {\n            $command = $this->client->getCommand('GetObject', [\n                'Bucket' => $bucket,\n                'Key'    => $object\n            ]);\n\n            return $this->client->createPresignedRequest($command, $expiration)->getUri()->__toString();\n        } else {\n            return $this->client->getObjectUrl($bucket, $object);\n        }\n    }\n}\n", "num_lines": 86}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nini_set('error_reporting', E_ALL);\n\n$files = array(__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../../autoload.php');\nforeach ($files as $file) {\n    if (file_exists($file)) {\n        $loader = require $file;\n        break;\n    }\n}\n\nif (!isset($loader)) {\n    throw new RuntimeException('The vendor/autoload.php could not be found. Did you run `php composer.phar install`?');\n}\n\nunset($files, $file, $loader);\n", "num_lines": 18}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\Tests\\Factory;\n\nuse AwsModule\\Factory\\AwsFactory;\nuse Aws\\Sdk as AwsSdk;\nuse AwsModule\\Module;\nuse Laminas\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * AWS Module test cases\n */\nclass AwsFactoryTest extends \\PHPUnit_Framework_TestCase\n{\n    public function testCanFetchAwsFromServiceManager()\n    {\n        $serviceLocator = $this->getMockServiceLocator();\n        $awsFactory = new AwsFactory();\n\n        /** @var $aws AwsSdk */\n        $aws = $awsFactory->createService($serviceLocator);\n\n        $this->assertInstanceOf(AwsSdk::class, $aws);\n    }\n\n    public function testProvidesVersionInformationForSdkUserAgent()\n    {\n        $serviceLocator = $this->getMockServiceLocator();\n        $awsFactory = new AwsFactory();\n        $aws = $awsFactory->createService($serviceLocator);\n        $argsProperty = (new \\ReflectionClass($aws))->getProperty('args');\n        $argsProperty->setAccessible(true);\n        $args = $argsProperty->getValue($aws);\n\n\n        $this->assertArrayHasKey('ua_append', $args);\n        $this->assertInternalType('array', $args['ua_append']);\n        $this->assertNotEmpty($args['ua_append']);\n        $this->assertNotEmpty(array_filter($args['ua_append'], function ($ua) {\n            return false !== strpos($ua, Module::VERSION);\n        }));\n    }\n\n    private function getMockServiceLocator()\n    {\n        $serviceLocator = $this->createMock(ServiceLocatorInterface::class);\n        $serviceLocator\n            ->expects($this->once())\n            ->method('get')\n            ->with('Config')\n            ->willReturn([]);\n\n        return $serviceLocator;\n    }\n}\n", "num_lines": 56}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\Tests\\Factory;\n\nuse AwsModule\\Factory\\DynamoDbSessionSaveHandlerFactory;\nuse Aws\\Sdk as AwsSdk;\nuse AwsModule\\Session\\SaveHandler\\DynamoDb as DynamoDbSaveHandler;\nuse Laminas\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * DynamoDB-backed session save handler tests\n */\nclass DynamoDbSessionSaveHandlerFactoryTest extends \\PHPUnit_Framework_TestCase\n{\n    public function testCanFetchSaveHandlerFromServiceManager()\n    {\n        $config = [\n            'aws' => [\n                'region'  => 'us-east-1',\n                'version' => 'latest'\n            ],\n            'aws_zf2' => [\n                'session' => [\n                    'save_handler' => [\n                        'dynamodb' => []\n                    ]\n                ]\n            ]\n        ];\n\n        $awsSdk = new AwsSdk($config['aws']);\n\n        $serviceLocator = $this->createMock(ServiceLocatorInterface::class);\n        $serviceLocator->expects($this->at(0))->method('get')->with('Config')->willReturn($config);\n        $serviceLocator->expects($this->at(1))->method('get')->with(AwsSdk::class)->willReturn($awsSdk);\n\n\n        $saveHandlerFactory = new DynamoDbSessionSaveHandlerFactory();\n\n        /** @var $saveHandler \\AwsModule\\Session\\SaveHandler\\DynamoDb */\n        $saveHandler = $saveHandlerFactory->createService($serviceLocator);\n\n        $this->assertInstanceOf(DynamoDbSaveHandler::class, $saveHandler);\n    }\n\n    /**\n     * @expectedException \\Laminas\\ServiceManager\\Exception\\ServiceNotCreatedException\n     */\n    public function testExceptionThrownWhenSaveHandlerConfigurationDoesNotExist()\n    {\n        $serviceLocator = $this->createMock(ServiceLocatorInterface::class);\n        $serviceLocator->expects($this->once())->method('get')->with('Config')->willReturn([]);\n\n        $saveHandlerFactory = new DynamoDbSessionSaveHandlerFactory();\n\n        $saveHandlerFactory->createService($serviceLocator);\n    }\n}\n", "num_lines": 59}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\Tests\\Filter\\File;\n\nuse AwsModule\\Filter\\Exception\\MissingBucketException;\nuse AwsModule\\Filter\\File\\S3RenameUpload;\nuse Aws\\S3\\S3Client;\nuse ReflectionMethod;\n\nclass S3RenameUploadTest extends \\PHPUnit_Framework_TestCase\n{\n    /**\n     * @var S3RenameUpload\n     */\n    protected $filter;\n\n    public function setUp()\n    {\n        $s3Client = new S3Client([\n            'credentials' => [\n                'key'    => '1234',\n                'secret' => '5678'\n            ],\n            'region'  => 'us-east-1',\n            'version' => 'latest'\n        ]);\n\n        $this->filter = new S3RenameUpload($s3Client);\n    }\n\n    public function testAssertFilterAlwaysRegistersS3StreamWrapper()\n    {\n        $this->assertContains('s3', stream_get_wrappers());\n    }\n\n    public function testBucketNameIsTrimmedWhenSet()\n    {\n        $this->filter->setBucket('/my-bucket/');\n        $this->assertEquals('my-bucket', $this->filter->getBucket());\n\n        $this->filter->setOptions([\n            'bucket' => '/my-bucket/'\n        ]);\n        $this->assertEquals('my-bucket', $this->filter->getBucket());\n    }\n\n    public function testThrowExceptionIfNoBucketIsSet()\n    {\n        $this->setExpectedException(MissingBucketException::class);\n        $this->filter->filter(['tmp_name' => 'foo', 'name' => 'foo']);\n    }\n\n    /**\n     * @dataProvider tmpNameProvider\n     */\n    public function testAssertS3UriIsGenerated($tmpName, $expectedKey)\n    {\n        $reflMethod = new ReflectionMethod($this->filter, 'getFinalTarget');\n        $reflMethod->setAccessible(true);\n\n        $this->filter->setBucket('my-bucket');\n\n        $result = $reflMethod->invokeArgs($this->filter, [$tmpName, $tmpName]);\n\n        $this->assertEquals(\"s3://my-bucket/{$expectedKey}\", $result);\n    }\n\n    public function tmpNameProvider()\n    {\n        return [\n            ['temp/phptmpname', 'temp/phptmpname'],\n            ['temp/phptmpname/', 'temp/phptmpname'],\n            ['temp\\\\phptmpname', 'temp/phptmpname'],\n            ['temp\\\\phptmpname\\\\', 'temp/phptmpname'],\n        ];\n    }\n}\n", "num_lines": 78}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\Tests\\Session\\SaveHandler;\n\nuse Aws\\DynamoDb\\SessionHandler;\nuse AwsModule\\Session\\SaveHandler\\DynamoDb as DynamoDbSaveHandler;\n\nclass DynamoDbTest extends \\PHPUnit_Framework_TestCase\n{\n    /**\n     * @var SessionHandler\n     */\n    protected $sessionHandler;\n\n    /**\n     * @var DynamoDbSaveHandler\n     */\n    protected $saveHandler;\n\n    public function setUp()\n    {\n        parent::setUp();\n\n        $this->sessionHandler = $this->createMock(\n            SessionHandler::class,\n            [\n                'open',\n                'close',\n                'read',\n                'write',\n                'destroy',\n                'gc',\n            ],\n            [],\n            '',\n            false\n        );\n\n        $this->saveHandler = new DynamoDbSaveHandler($this->sessionHandler);\n    }\n\n    public function testSessionHandlerOpenIsCalled()\n    {\n        $this->sessionHandler->expects($this->once())\n            ->method('open')\n            ->with($this->equalTo('mypath'), $this->equalTo('myname'))\n            ->will($this->returnValue(true));\n\n        $result = $this->saveHandler->open('mypath', 'myname');\n\n        $this->assertTrue($result);\n    }\n\n    public function testSessionHandlerCloseIsCalled()\n    {\n        $this->sessionHandler->expects($this->once())\n            ->method('close')\n            ->with()\n            ->will($this->returnValue(true));\n\n        $result = $this->saveHandler->close();\n\n        $this->assertTrue($result);\n    }\n\n    public function testSessionHandlerReadIsCalled()\n    {\n        $this->sessionHandler->expects($this->once())\n            ->method('read')\n            ->with($this->equalTo('myid'))\n            ->will($this->returnValue('mydata'));\n\n        $result = $this->saveHandler->read('myid');\n\n        $this->assertEquals('mydata', $result);\n    }\n\n    public function testSessionHandlerWriteIsCalled()\n    {\n        $this->sessionHandler->expects($this->once())\n            ->method('write')\n            ->with($this->equalTo('myid'), $this->equalTo('mydata'))\n            ->will($this->returnValue(true));\n\n        $result = $this->saveHandler->write('myid', 'mydata');\n\n        $this->assertTrue($result);\n    }\n\n    public function testSessionHandlerDestroyIsCalled()\n    {\n        $this->sessionHandler->expects($this->once())\n            ->method('destroy')\n            ->with($this->equalTo('myid'))\n            ->will($this->returnValue(true));\n\n        $result = $this->saveHandler->destroy('myid');\n\n        $this->assertTrue($result);\n    }\n\n    public function testSessionHandlerGcIsCalled()\n    {\n        $this->sessionHandler->expects($this->once())\n            ->method('gc')\n            ->with($this->equalTo(420))\n            ->will($this->returnValue(true));\n\n        $result = $this->saveHandler->gc(420);\n\n        $this->assertTrue($result);\n    }\n}\n", "num_lines": 114}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\Tests\\View\\Helper;\n\nuse Aws\\CloudFront\\CloudFrontClient;\nuse AwsModule\\View\\Helper\\CloudFrontLink;\n\nclass CloudFrontLinkTest extends \\PHPUnit_Framework_TestCase\n{\n    /**\n     * @var CloudFrontClient\n     */\n    protected $cloudFrontClient;\n\n    /**\n     * @var CloudFrontLink\n     */\n    protected $viewHelper;\n\n    public function setUp()\n    {\n        $this->cloudFrontClient = new CloudFrontClient([\n            'credentials' => [\n                'key'    => '1234',\n                'secret' => '5678',\n            ],\n            'region'  => 'us-east-1',\n            'version' => 'latest'\n        ]);\n\n        $this->viewHelper = new CloudFrontLink($this->cloudFrontClient);\n    }\n\n    public function testGenerateSimpleLink()\n    {\n        $link = $this->viewHelper->__invoke('my-object', 'my-domain');\n        $this->assertEquals('https://my-domain.cloudfront.net/my-object', $link);\n    }\n\n    public function testCanUseDefaultDomain()\n    {\n        $this->viewHelper->setDefaultDomain('my-default-domain');\n\n        $link = $this->viewHelper->__invoke('my-object');\n        $this->assertEquals('https://my-default-domain.cloudfront.net/my-object', $link);\n    }\n\n    public function testAssertGivenDomainOverrideDefaultDomain()\n    {\n        $this->viewHelper->setDefaultDomain('my-default-domain');\n\n        $link = $this->viewHelper->__invoke('my-object', 'my-overriden-domain');\n        $this->assertEquals('https://my-overriden-domain.cloudfront.net/my-object', $link);\n    }\n\n    public function testCanTrimCloudFrontPartInDomain()\n    {\n        $link = $this->viewHelper->__invoke('my-object', '123abc.cloudfront.net');\n        $this->assertEquals('https://123abc.cloudfront.net/my-object', $link);\n\n        $link = $this->viewHelper->__invoke('my-object', '123abc.cloudfront.net/');\n        $this->assertEquals('https://123abc.cloudfront.net/my-object', $link);\n    }\n\n    public function testCanUseCustomHostname()\n    {\n        $this->viewHelper->setHostname('example.com');\n        $this->assertEquals('.example.com', $this->viewHelper->getHostname());\n\n        $link = $this->viewHelper->__invoke('my-object', '123abc');\n        $this->assertEquals('https://123abc.example.com/my-object', $link);\n    }\n\n    /**\n     * @expectedException \\AwsModule\\View\\Exception\\InvalidDomainNameException\n     */\n    public function testFailsWhenDomainIsInvalid()\n    {\n        $this->viewHelper->setDefaultDomain('');\n        $link = $this->viewHelper->__invoke('my-object');\n    }\n\n    public function testGenerateSignedLink()\n    {\n        if (!extension_loaded('openssl')) {\n            $this->markTestSkipped('OpenSSL is required for this test.');\n        }\n\n        $pemFile = sys_get_temp_dir() . '/aws-sdk-php-zf2-cloudfront-test.pem';\n        if (!file_exists($pemFile)) {\n            // Generate a new Certificate Signing Request and public/private keypair\n            $csr = openssl_csr_new([], $keypair);\n\n            // Create a self-signed certificate\n            $x509 = openssl_csr_sign($csr, null, $keypair, 1);\n            openssl_x509_export($x509, $certificate);\n\n            // Create and save a private key\n            $privateKey = openssl_get_privatekey($keypair);\n            openssl_pkey_export_to_file($privateKey, $pemFile);\n        }\n\n        $this->viewHelper->setHostname('example.com');\n        $link = $this->viewHelper->__invoke('my-object', '123abc', time() + 600, 'kpid', $pemFile);\n        $this->assertRegExp(\n            '#^https\\:\\/\\/123abc\\.example\\.com\\/my-object\\?Expires\\=(.*)\\&Signature\\=(.*)\\&Key-Pair-Id\\=kpid$#',\n            $link\n        );\n    }\n}\n", "num_lines": 111}
{"repo_name": "aws-sdk-php-zf2", "repo_creator": "aws", "programming_language": "PHP", "code": "<?php\n\nnamespace AwsModule\\Tests\\View\\Helper;\n\nuse Aws\\S3\\S3Client;\nuse AwsModule\\View\\Helper\\S3Link;\n\nclass S3LinkTest extends \\PHPUnit_Framework_TestCase\n{\n    /**\n     * @var S3Client\n     */\n    protected $s3Client;\n\n    /**\n     * @var S3Link\n     */\n    protected $viewHelper;\n\n    public function setUp()\n    {\n        $this->s3Client = new S3Client([\n            'credentials' => [\n                'key'    => '1234',\n                'secret' => '5678'\n            ],\n            'region'  => 'us-east-1',\n            'version' => 'latest'\n        ]);\n\n        $this->viewHelper = new S3Link($this->s3Client);\n    }\n\n    public function testGenerateSimpleLink()\n    {\n        $link = $this->viewHelper->__invoke('my-object', 'my-bucket');\n        $this->assertEquals('https://my-bucket.s3.amazonaws.com/my-object', $link);\n    }\n\n    public function testCanUseDefaultBucket()\n    {\n        $this->viewHelper->setDefaultBucket('my-default-bucket');\n\n        $link = $this->viewHelper->__invoke('my-object');\n        $this->assertEquals('https://my-default-bucket.s3.amazonaws.com/my-object', $link);\n    }\n\n    public function testAssertGivenBucketOverrideDefaultBucket()\n    {\n        $this->viewHelper->setDefaultBucket('my-default-bucket');\n\n        $link = $this->viewHelper->__invoke('my-object', 'my-overriden-bucket');\n        $this->assertEquals('https://my-overriden-bucket.s3.amazonaws.com/my-object', $link);\n    }\n\n    public function testCreatesUrlsForRegionalBuckets()\n    {\n        $s3Client = new S3Client([\n            'credentials' => [\n                'key'    => '1234',\n                'secret' => '5678'\n            ],\n            'region'  => 'sa-east-1',\n            'version' => 'latest'\n        ]);\n\n        $viewHelper = new S3Link($s3Client);\n\n        $link = $viewHelper->__invoke('my-object', 'my-bucket');\n        $this->assertEquals('https://my-bucket.s3.sa-east-1.amazonaws.com/my-object', $link);\n    }\n\n    /**\n     * @expectedException \\AwsModule\\View\\Exception\\InvalidDomainNameException\n     */\n    public function testFailsWhenNoBucketSpecified()\n    {\n        $link = $this->viewHelper->__invoke('my-object');\n    }\n\n    public function testGenerateSignedLink()\n    {\n        $expires = time() + 10;\n        $s3Client = new S3Client([\n            'credentials' => [\n                'key'    => '1234',\n                'secret' => '5678',\n                'token'  => '999'\n            ],\n            'region'  => 'sa-east-1',\n            'version' => 'latest'\n        ]);\n\n        $viewHelper = new S3Link($s3Client);\n\n        $url = $viewHelper->__invoke('my-object', 'my-bucket', $expires);\n\n        $this->assertStringStartsWith('https://my-bucket.s3.sa-east-1.amazonaws.com/my-object?', $url);\n        $this->assertContains('X-Amz-Security-Token=999', $url);\n        $this->assertContains('X-Amz-Content-Sha256=', $url);\n        $this->assertContains('X-Amz-Expires=', $url);\n    }\n}\n", "num_lines": 104}
{"repo_name": "aks-bestpractices-ignite19", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n#define connection parameters \n$host = getenv('MYSQL_HOST');\n$username = getenv('MYSQL_USERNAME');\n$password = getenv('MYSQL_PASSWORD');\n$db_name = getenv('DATABASE_NAME');\n$pod_name = getenv('POD_NAME');\n$node_name= getenv('NODE_NAME');\n\n//Establishes the connection\n$conn = mysqli_init();\nmysqli_real_connect($conn, $host, $username, $password, $db_name, 3306);\nif (mysqli_connect_errno($conn)) {\ndie('Failed to connect to MySQL: '.mysqli_connect_error());\n}\n\n\n\n//Run the Select query\n$res = mysqli_query($conn, 'SELECT name FROM messages');\n\nif ($res->num_rows > 0) {\n    // output data of each row\n    while($row = $res->fetch_assoc()) {\n        echo \"Message: \" . $row[\"name\"]. \"<br><br><br>\";\n    }\n} else {\n    echo \"0 results\";\n}\n\n##print pod and node hostnames \necho \"Data Was Read From Pod: \" . gethostname().\"<br><br>\"; \n\necho \"Pod is located on Node: \" . $node_name.\"<br><br>\";\n\n//Close the connection\nmysqli_close($conn);\n?>", "num_lines": 38}
{"repo_name": "aks-engine", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n$x = 0.0001;\nfor ($i = 0; $i <= 1000000; $i++) {\n\t$x += sqrt($x);\n}\necho \"OK!\";\n?>\n", "num_lines": 8}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = 'localhost';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n?>\n", "num_lines": 29}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = 'localhost';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n$cfg['ForceSSL']=false;\n\n?>\n", "num_lines": 31}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = 'localhost';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n$cfg['ForceSSL']=false;\n\n?>\n", "num_lines": 31}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = 'localhost';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n$cfg['ForceSSL']=false;\n\n?>\n", "num_lines": 31}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = 'localhost';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n$cfg['ForceSSL']=false;\n\n?>\n", "num_lines": 31}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = 'localhost';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n$cfg['ForceSSL']=false;\n\n?>\n", "num_lines": 31}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = 'localhost';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n$hostname = getenv('WEBSITE_SITE_NAME');\n$cfg['PmaAbsoluteUri'] = 'http://'.$hostname.'.azurewebsites.net/phpmyadmin'; \n?>\n", "num_lines": 30}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace Drupal\\Core\\Database\\Install;\nuse Drupal\\Core\\Database\\Database;\n/**\n * Database installer structure.\n *\n * Defines basic Drupal requirements for databases.\n */\nabstract class Tasks {\n  /**\n   * The name of the PDO driver this database type requires.\n   *\n   * @var string\n   */\n  protected $pdoDriver;\n  /**\n   * Structure that describes each task to run.\n   *\n   * @var array\n   *\n   * Each value of the tasks array is an associative array defining the function\n   * to call (optional) and any arguments to be passed to the function.\n   */\n  protected $tasks = [\n    [\n      'function'    => 'checkEngineVersion',\n      'arguments'   => [],\n    ],\n    [\n      'arguments'   => [\n        'CREATE TABLE {drupal_install_test} (id int NULL)',\n        'Drupal can use CREATE TABLE database commands.',\n        'Failed to <strong>CREATE</strong> a test table on your database server with the command %query. The server reports the following message: %error.<p>Are you sure the configured username has the necessary permissions to create tables in the database?</p>',\n        TRUE,\n      ],\n    ],\n    [\n      'arguments'   => [\n        'INSERT INTO {drupal_install_test} (id) VALUES (1)',\n        'Drupal can use INSERT database commands.',\n        'Failed to <strong>INSERT</strong> a value into a test table on your database server. We tried inserting a value with the command %query and the server reported the following error: %error.',\n      ],\n    ],\n    [\n      'arguments'   => [\n        'UPDATE {drupal_install_test} SET id = 2',\n        'Drupal can use UPDATE database commands.',\n        'Failed to <strong>UPDATE</strong> a value in a test table on your database server. We tried updating a value with the command %query and the server reported the following error: %error.',\n      ],\n    ],\n    [\n      'arguments'   => [\n        'DELETE FROM {drupal_install_test}',\n        'Drupal can use DELETE database commands.',\n        'Failed to <strong>DELETE</strong> a value from a test table on your database server. We tried deleting a value with the command %query and the server reported the following error: %error.',\n      ],\n    ],\n    [\n      'arguments'   => [\n        'DROP TABLE {drupal_install_test}',\n        'Drupal can use DROP TABLE database commands.',\n        'Failed to <strong>DROP</strong> a test table from your database server. We tried dropping a table with the command %query and the server reported the following error %error.',\n      ],\n    ],\n  ];\n  /**\n   * Results from tasks.\n   *\n   * @var array\n   */\n  protected $results = [\n    'fail' => [],\n    'pass' => [],\n  ];\n  /**\n   * Ensure the PDO driver is supported by the version of PHP in use.\n   */\n  protected function hasPdoDriver() {\n    return in_array($this->pdoDriver, \\PDO::getAvailableDrivers());\n  }\n  /**\n   * Assert test as failed.\n   */\n  protected function fail($message) {\n    $this->results['fail'][] = $message;\n  }\n  /**\n   * Assert test as a pass.\n   */\n  protected function pass($message) {\n    $this->results['pass'][] = $message;\n  }\n  /**\n   * Check whether Drupal is installable on the database.\n   */\n  public function installable() {\n    return $this->hasPdoDriver() && empty($this->error);\n  }\n  /**\n   * Return the human-readable name of the driver.\n   */\n  abstract public function name();\n  /**\n   * Return the minimum required version of the engine.\n   *\n   * @return\n   *   A version string. If not NULL, it will be checked against the version\n   *   reported by the Database engine using version_compare().\n   */\n  public function minimumVersion() {\n    return NULL;\n  }\n  /**\n   * Run database tasks and tests to see if Drupal can run on the database.\n   *\n   * @return array\n   *   A list of error messages.\n   */\n  public function runTasks() {\n    // We need to establish a connection before we can run tests.\n    if ($this->connect()) {\n      foreach ($this->tasks as $task) {\n        if (!isset($task['function'])) {\n          $task['function'] = 'runTestQuery';\n        }\n        if (method_exists($this, $task['function'])) {\n          // Returning false is fatal. No other tasks can run.\n          if (FALSE === call_user_func_array([$this, $task['function']], $task['arguments'])) {\n            break;\n          }\n        }\n        else {\n          $this->fail(t(\"Failed to run all tasks against the database server. The task %task wasn't found.\", ['%task' => $task['function']]));\n        }\n      }\n    }\n    return $this->results['fail'];\n  }\n  /**\n   * Check if we can connect to the database.\n   */\n  protected function connect() {\n    try {\n      // This doesn't actually test the connection.\n      db_set_active();\n      // Now actually do a check.\n      Database::getConnection();\n      $this->pass('Drupal can CONNECT to the database ok.');\n    }\n    catch (\\Exception $e) {\n      $this->fail(t('Failed to connect to your database server. The server reports the following message: %error.<ul><li>Is the database server running?</li><li>Does the database exist, and have you entered the correct database name?</li><li>Have you entered the correct username and password?</li><li>Have you entered the correct database hostname?</li></ul>', ['%error' => $e->getMessage()]));\n      return FALSE;\n    }\n    return TRUE;\n  }\n  /**\n   * Run SQL tests to ensure the database can execute commands with the current user.\n   */\n  protected function runTestQuery($query, $pass, $fail, $fatal = FALSE) {\n    try {\n      Database::getConnection()->query($query);\n      $this->pass(t($pass));\n    }\n    catch (\\Exception $e) {\n      $this->fail(t($fail, ['%query' => $query, '%error' => $e->getMessage(), '%name' => $this->name()]));\n      return !$fatal;\n    }\n  }\n  /**\n   * Check the engine version.\n   */\n  protected function checkEngineVersion() {\n    // Ensure that the database server has the right version.\n    if ($this->minimumVersion() && version_compare(Database::getConnection()->version(), $this->minimumVersion(), '<')) {\n      $this->fail(t(\"The database server version %version is less than the minimum required version %minimum_version.\", ['%version' => Database::getConnection()->version(), '%minimum_version' => $this->minimumVersion()]));\n    }\n  }\n  /**\n   * Return driver specific configuration options.\n   *\n   * @param $database\n   *   An array of driver specific configuration options.\n   *\n   * @return\n   *   The options form array.\n   */\n  public function getFormOptions(array $database) {\n      \n    $connectstr_dbhost = '';\n    $connectstr_dbfullhost = '';\n    $connectstr_dbname = '';\n    $connectstr_dbusername = '';\n    $connectstr_dbpassword = '';\n            \n        $connectstr_dbfullhost = getenv('DATABASE_HOST');\n        //$connectstr_dbhost = substr($connectstr_dbfullhost, 0 , strpos($connectstr_dbfullhost ,\":\"));\n        $connectstr_dbhost = $connectstr_dbfullhost;\n        $connectstr_dbname = getenv('DATABASE_NAME');\n        $connectstr_dbusername = getenv('DATABASE_USERNAME');\n        $connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n    \n    //Port for MYSQL in-app or ClearDB \n    $connectstr_port = getenv('WEBSITE_MYSQL_PORT');\n    if (empty($connectstr_port))\n    {\n      $connectstr_port= 3306;\n    }\n    $form['database'] = [\n      '#type' => 'textfield',\n      '#title' => t('Database name'),\n      '#default_value' => $connectstr_dbname,\n      '#size' => 45,\n      '#required' => TRUE,\n      '#states' => [\n        'required' => [\n          ':input[name=driver]' => ['value' => $this->pdoDriver],\n        ],\n      ],\n    ];\n    $form['username'] = [\n      '#type' => 'textfield',\n      '#title' => t('Database username'),\n      '#default_value' => $connectstr_dbusername,\n      '#size' => 45,\n      '#required' => TRUE,\n      '#states' => [\n        'required' => [\n          ':input[name=driver]' => ['value' => $this->pdoDriver],\n        ],\n      ],\n    ];\n    $form['password'] = [\n      '#type' => 'password',\n      '#title' => t('Database password'),\n      '#default_value' => $connectstr_dbpassword,\n      '#attributes' => array('value' => $connectstr_dbpassword),\n      '#required' => TRUE,\n      '#size' => 45,\n    ];\n    $form['advanced_options'] = [\n      '#type' => 'details',\n      '#title' => t('Advanced options'),\n      '#weight' => 10,\n    ];\n    $profile = drupal_get_profile();\n    $db_prefix = ($profile == 'standard') ? 'drupal_' : $profile . '_';\n    $form['advanced_options']['prefix'] = [\n      '#type' => 'textfield',\n      '#title' => t('Table name prefix'),\n      '#default_value' => empty($database['prefix']) ? '' : $database['prefix'],\n      '#size' => 45,\n      '#description' => t('If more than one application will be sharing this database, a unique table name prefix \u00e2\u20ac\u201c such as %prefix \u00e2\u20ac\u201c will prevent collisions.', ['%prefix' => $db_prefix]),\n      '#weight' => 10,\n    ];\n    $form['advanced_options']['host'] = [\n      '#type' => 'textfield',\n      '#title' => t('Host'),\n      '#default_value' => $connectstr_dbhost,\n      '#size' => 45,\n      // Hostnames can be 255 characters long.\n      '#maxlength' => 255,\n      '#required' => TRUE,\n    ];\n    $form['advanced_options']['port'] = [\n      '#type' => 'number',\n      '#title' => t('Port number'),\n      '#default_value' => $connectstr_port,\n      '#min' => 0,\n      '#max' => 65535,\n    ];\n    return $form;\n  }\n  /**\n   * Validates driver specific configuration settings.\n   *\n   * Checks to ensure correct basic database settings and that a proper\n   * connection to the database can be established.\n   *\n   * @param $database\n   *   An array of driver specific configuration options.\n   *\n   * @return\n   *   An array of driver configuration errors, keyed by form element name.\n   */\n  public function validateDatabaseSettings($database) {\n    $errors = [];\n    // Verify the table prefix.\n    if (!empty($database['prefix']) && is_string($database['prefix']) && !preg_match('/^[A-Za-z0-9_.]+$/', $database['prefix'])) {\n      $errors[$database['driver'] . '][prefix'] = t('The database table prefix you have entered, %prefix, is invalid. The table prefix can only contain alphanumeric characters, periods, or underscores.', ['%prefix' => $database['prefix']]);\n    }\n    return $errors;\n  }\n}", "num_lines": 293}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = 'localhost';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n$hostname = getenv('WEBSITE_SITE_NAME');\n$cfg['PmaAbsoluteUri'] = 'http://'.$hostname.'.azurewebsites.net/phpmyadmin'; \n?>\n", "num_lines": 30}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace Drupal\\Core\\Database\\Install;\nuse Drupal\\Core\\Database\\Database;\n/**\n * Database installer structure.\n *\n * Defines basic Drupal requirements for databases.\n */\nabstract class Tasks {\n  /**\n   * The name of the PDO driver this database type requires.\n   *\n   * @var string\n   */\n  protected $pdoDriver;\n  /**\n   * Structure that describes each task to run.\n   *\n   * @var array\n   *\n   * Each value of the tasks array is an associative array defining the function\n   * to call (optional) and any arguments to be passed to the function.\n   */\n  protected $tasks = [\n    [\n      'function'    => 'checkEngineVersion',\n      'arguments'   => [],\n    ],\n    [\n      'arguments'   => [\n        'CREATE TABLE {drupal_install_test} (id int NULL)',\n        'Drupal can use CREATE TABLE database commands.',\n        'Failed to <strong>CREATE</strong> a test table on your database server with the command %query. The server reports the following message: %error.<p>Are you sure the configured username has the necessary permissions to create tables in the database?</p>',\n        TRUE,\n      ],\n    ],\n    [\n      'arguments'   => [\n        'INSERT INTO {drupal_install_test} (id) VALUES (1)',\n        'Drupal can use INSERT database commands.',\n        'Failed to <strong>INSERT</strong> a value into a test table on your database server. We tried inserting a value with the command %query and the server reported the following error: %error.',\n      ],\n    ],\n    [\n      'arguments'   => [\n        'UPDATE {drupal_install_test} SET id = 2',\n        'Drupal can use UPDATE database commands.',\n        'Failed to <strong>UPDATE</strong> a value in a test table on your database server. We tried updating a value with the command %query and the server reported the following error: %error.',\n      ],\n    ],\n    [\n      'arguments'   => [\n        'DELETE FROM {drupal_install_test}',\n        'Drupal can use DELETE database commands.',\n        'Failed to <strong>DELETE</strong> a value from a test table on your database server. We tried deleting a value with the command %query and the server reported the following error: %error.',\n      ],\n    ],\n    [\n      'arguments'   => [\n        'DROP TABLE {drupal_install_test}',\n        'Drupal can use DROP TABLE database commands.',\n        'Failed to <strong>DROP</strong> a test table from your database server. We tried dropping a table with the command %query and the server reported the following error %error.',\n      ],\n    ],\n  ];\n  /**\n   * Results from tasks.\n   *\n   * @var array\n   */\n  protected $results = [\n    'fail' => [],\n    'pass' => [],\n  ];\n  /**\n   * Ensure the PDO driver is supported by the version of PHP in use.\n   */\n  protected function hasPdoDriver() {\n    return in_array($this->pdoDriver, \\PDO::getAvailableDrivers());\n  }\n  /**\n   * Assert test as failed.\n   */\n  protected function fail($message) {\n    $this->results['fail'][] = $message;\n  }\n  /**\n   * Assert test as a pass.\n   */\n  protected function pass($message) {\n    $this->results['pass'][] = $message;\n  }\n  /**\n   * Check whether Drupal is installable on the database.\n   */\n  public function installable() {\n    return $this->hasPdoDriver() && empty($this->error);\n  }\n  /**\n   * Return the human-readable name of the driver.\n   */\n  abstract public function name();\n  /**\n   * Return the minimum required version of the engine.\n   *\n   * @return\n   *   A version string. If not NULL, it will be checked against the version\n   *   reported by the Database engine using version_compare().\n   */\n  public function minimumVersion() {\n    return NULL;\n  }\n  /**\n   * Run database tasks and tests to see if Drupal can run on the database.\n   *\n   * @return array\n   *   A list of error messages.\n   */\n  public function runTasks() {\n    // We need to establish a connection before we can run tests.\n    if ($this->connect()) {\n      foreach ($this->tasks as $task) {\n        if (!isset($task['function'])) {\n          $task['function'] = 'runTestQuery';\n        }\n        if (method_exists($this, $task['function'])) {\n          // Returning false is fatal. No other tasks can run.\n          if (FALSE === call_user_func_array([$this, $task['function']], $task['arguments'])) {\n            break;\n          }\n        }\n        else {\n          $this->fail(t(\"Failed to run all tasks against the database server. The task %task wasn't found.\", ['%task' => $task['function']]));\n        }\n      }\n    }\n    return $this->results['fail'];\n  }\n  /**\n   * Check if we can connect to the database.\n   */\n  protected function connect() {\n    try {\n      // This doesn't actually test the connection.\n      db_set_active();\n      // Now actually do a check.\n      Database::getConnection();\n      $this->pass('Drupal can CONNECT to the database ok.');\n    }\n    catch (\\Exception $e) {\n      $this->fail(t('Failed to connect to your database server. The server reports the following message: %error.<ul><li>Is the database server running?</li><li>Does the database exist, and have you entered the correct database name?</li><li>Have you entered the correct username and password?</li><li>Have you entered the correct database hostname?</li></ul>', ['%error' => $e->getMessage()]));\n      return FALSE;\n    }\n    return TRUE;\n  }\n  /**\n   * Run SQL tests to ensure the database can execute commands with the current user.\n   */\n  protected function runTestQuery($query, $pass, $fail, $fatal = FALSE) {\n    try {\n      Database::getConnection()->query($query);\n      $this->pass(t($pass));\n    }\n    catch (\\Exception $e) {\n      $this->fail(t($fail, ['%query' => $query, '%error' => $e->getMessage(), '%name' => $this->name()]));\n      return !$fatal;\n    }\n  }\n  /**\n   * Check the engine version.\n   */\n  protected function checkEngineVersion() {\n    // Ensure that the database server has the right version.\n    if ($this->minimumVersion() && version_compare(Database::getConnection()->version(), $this->minimumVersion(), '<')) {\n      $this->fail(t(\"The database server version %version is less than the minimum required version %minimum_version.\", ['%version' => Database::getConnection()->version(), '%minimum_version' => $this->minimumVersion()]));\n    }\n  }\n  /**\n   * Return driver specific configuration options.\n   *\n   * @param $database\n   *   An array of driver specific configuration options.\n   *\n   * @return\n   *   The options form array.\n   */\n  public function getFormOptions(array $database) {\n      \n    $connectstr_dbhost = '';\n    $connectstr_dbfullhost = '';\n    $connectstr_dbname = '';\n    $connectstr_dbusername = '';\n    $connectstr_dbpassword = '';\n            \n        $connectstr_dbfullhost = getenv('DATABASE_HOST');\n        //$connectstr_dbhost = substr($connectstr_dbfullhost, 0 , strpos($connectstr_dbfullhost ,\":\"));\n        $connectstr_dbhost = $connectstr_dbfullhost;\n        $connectstr_dbname = getenv('DATABASE_NAME');\n        $connectstr_dbusername = getenv('DATABASE_USERNAME');\n        $connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n    \n    //Port for MYSQL in-app or ClearDB \n    $connectstr_port = getenv('WEBSITE_MYSQL_PORT');\n    if (empty($connectstr_port))\n    {\n      $connectstr_port= 3306;\n    }\n    $form['database'] = [\n      '#type' => 'textfield',\n      '#title' => t('Database name'),\n      '#default_value' => $connectstr_dbname,\n      '#size' => 45,\n      '#required' => TRUE,\n      '#states' => [\n        'required' => [\n          ':input[name=driver]' => ['value' => $this->pdoDriver],\n        ],\n      ],\n    ];\n    $form['username'] = [\n      '#type' => 'textfield',\n      '#title' => t('Database username'),\n      '#default_value' => $connectstr_dbusername,\n      '#size' => 45,\n      '#required' => TRUE,\n      '#states' => [\n        'required' => [\n          ':input[name=driver]' => ['value' => $this->pdoDriver],\n        ],\n      ],\n    ];\n    $form['password'] = [\n      '#type' => 'password',\n      '#title' => t('Database password'),\n      '#default_value' => $connectstr_dbpassword,\n      '#attributes' => array('value' => $connectstr_dbpassword),\n      '#required' => TRUE,\n      '#size' => 45,\n    ];\n    $form['advanced_options'] = [\n      '#type' => 'details',\n      '#title' => t('Advanced options'),\n      '#weight' => 10,\n    ];\n    $profile = drupal_get_profile();\n    $db_prefix = ($profile == 'standard') ? 'drupal_' : $profile . '_';\n    $form['advanced_options']['prefix'] = [\n      '#type' => 'textfield',\n      '#title' => t('Table name prefix'),\n      '#default_value' => empty($database['prefix']) ? '' : $database['prefix'],\n      '#size' => 45,\n      '#description' => t('If more than one application will be sharing this database, a unique table name prefix \u00e2\u20ac\u201c such as %prefix \u00e2\u20ac\u201c will prevent collisions.', ['%prefix' => $db_prefix]),\n      '#weight' => 10,\n    ];\n    $form['advanced_options']['host'] = [\n      '#type' => 'textfield',\n      '#title' => t('Host'),\n      '#default_value' => $connectstr_dbhost,\n      '#size' => 45,\n      // Hostnames can be 255 characters long.\n      '#maxlength' => 255,\n      '#required' => TRUE,\n    ];\n    $form['advanced_options']['port'] = [\n      '#type' => 'number',\n      '#title' => t('Port number'),\n      '#default_value' => $connectstr_port,\n      '#min' => 0,\n      '#max' => 65535,\n    ];\n    return $form;\n  }\n  /**\n   * Validates driver specific configuration settings.\n   *\n   * Checks to ensure correct basic database settings and that a proper\n   * connection to the database can be established.\n   *\n   * @param $database\n   *   An array of driver specific configuration options.\n   *\n   * @return\n   *   An array of driver configuration errors, keyed by form element name.\n   */\n  public function validateDatabaseSettings($database) {\n    $errors = [];\n    // Verify the table prefix.\n    if (!empty($database['prefix']) && is_string($database['prefix']) && !preg_match('/^[A-Za-z0-9_.]+$/', $database['prefix'])) {\n      $errors[$database['driver'] . '][prefix'] = t('The database table prefix you have entered, %prefix, is invalid. The table prefix can only contain alphanumeric characters, periods, or underscores.', ['%prefix' => $database['prefix']]);\n    }\n    return $errors;\n  }\n}", "num_lines": 293}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = 'localhost';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n$hostname = getenv('WEBSITE_SITE_NAME');\n$cfg['PmaAbsoluteUri'] = 'http://'.$hostname.'.azurewebsites.net/phpmyadmin'; \n?>\n", "num_lines": 30}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Drupal\\Core\\Database\\Install;\n\nuse Drupal\\Core\\Database\\Database;\n\n/**\n * Database installer structure.\n *\n * Defines basic Drupal requirements for databases.\n */\nabstract class Tasks {\n\n  /**\n   * The name of the PDO driver this database type requires.\n   *\n   * @var string\n   */\n  protected $pdoDriver;\n\n  /**\n   * Structure that describes each task to run.\n   *\n   * @var array\n   *\n   * Each value of the tasks array is an associative array defining the function\n   * to call (optional) and any arguments to be passed to the function.\n   */\n  protected $tasks = [\n    [\n      'function'    => 'checkEngineVersion',\n      'arguments'   => [],\n    ],\n    [\n      'arguments'   => [\n        'CREATE TABLE {drupal_install_test} (id int NOT NULL PRIMARY KEY)',\n        'Drupal can use CREATE TABLE database commands.',\n        'Failed to <strong>CREATE</strong> a test table on your database server with the command %query. The server reports the following message: %error.<p>Are you sure the configured username has the necessary permissions to create tables in the database?</p>',\n        TRUE,\n      ],\n    ],\n    [\n      'arguments'   => [\n        'INSERT INTO {drupal_install_test} (id) VALUES (1)',\n        'Drupal can use INSERT database commands.',\n        'Failed to <strong>INSERT</strong> a value into a test table on your database server. We tried inserting a value with the command %query and the server reported the following error: %error.',\n      ],\n    ],\n    [\n      'arguments'   => [\n        'UPDATE {drupal_install_test} SET id = 2',\n        'Drupal can use UPDATE database commands.',\n        'Failed to <strong>UPDATE</strong> a value in a test table on your database server. We tried updating a value with the command %query and the server reported the following error: %error.',\n      ],\n    ],\n    [\n      'arguments'   => [\n        'DELETE FROM {drupal_install_test}',\n        'Drupal can use DELETE database commands.',\n        'Failed to <strong>DELETE</strong> a value from a test table on your database server. We tried deleting a value with the command %query and the server reported the following error: %error.',\n      ],\n    ],\n    [\n      'arguments'   => [\n        'DROP TABLE {drupal_install_test}',\n        'Drupal can use DROP TABLE database commands.',\n        'Failed to <strong>DROP</strong> a test table from your database server. We tried dropping a table with the command %query and the server reported the following error %error.',\n      ],\n    ],\n  ];\n\n  /**\n   * Results from tasks.\n   *\n   * @var array\n   */\n  protected $results = [\n    'fail' => [],\n    'pass' => [],\n  ];\n\n  /**\n   * Ensure the PDO driver is supported by the version of PHP in use.\n   */\n  protected function hasPdoDriver() {\n    return in_array($this->pdoDriver, \\PDO::getAvailableDrivers());\n  }\n\n  /**\n   * Assert test as failed.\n   */\n  protected function fail($message) {\n    $this->results['fail'][] = $message;\n  }\n\n  /**\n   * Assert test as a pass.\n   */\n  protected function pass($message) {\n    $this->results['pass'][] = $message;\n  }\n\n  /**\n   * Check whether Drupal is installable on the database.\n   */\n  public function installable() {\n    return $this->hasPdoDriver() && empty($this->error);\n  }\n\n  /**\n   * Return the human-readable name of the driver.\n   */\n  abstract public function name();\n\n  /**\n   * Return the minimum required version of the engine.\n   *\n   * @return\n   *   A version string. If not NULL, it will be checked against the version\n   *   reported by the Database engine using version_compare().\n   */\n  public function minimumVersion() {\n    return NULL;\n  }\n\n  /**\n   * Run database tasks and tests to see if Drupal can run on the database.\n   *\n   * @return array\n   *   A list of error messages.\n   */\n  public function runTasks() {\n    // We need to establish a connection before we can run tests.\n    if ($this->connect()) {\n      foreach ($this->tasks as $task) {\n        if (!isset($task['function'])) {\n          $task['function'] = 'runTestQuery';\n        }\n        if (method_exists($this, $task['function'])) {\n          // Returning false is fatal. No other tasks can run.\n          if (FALSE === call_user_func_array([$this, $task['function']], $task['arguments'])) {\n            break;\n          }\n        }\n        else {\n          $this->fail(t(\"Failed to run all tasks against the database server. The task %task wasn't found.\", ['%task' => $task['function']]));\n        }\n      }\n    }\n    return $this->results['fail'];\n  }\n\n  /**\n   * Check if we can connect to the database.\n   */\n  protected function connect() {\n    try {\n      // This doesn't actually test the connection.\n      Database::setActiveConnection();\n      // Now actually do a check.\n      Database::getConnection();\n      $this->pass('Drupal can CONNECT to the database ok.');\n    }\n    catch (\\Exception $e) {\n      $this->fail(t('Failed to connect to your database server. The server reports the following message: %error.<ul><li>Is the database server running?</li><li>Does the database exist, and have you entered the correct database name?</li><li>Have you entered the correct username and password?</li><li>Have you entered the correct database hostname?</li></ul>', ['%error' => $e->getMessage()]));\n      return FALSE;\n    }\n    return TRUE;\n  }\n\n  /**\n   * Run SQL tests to ensure the database can execute commands with the current user.\n   */\n  protected function runTestQuery($query, $pass, $fail, $fatal = FALSE) {\n    try {\n      Database::getConnection()->query($query);\n      $this->pass(t($pass));\n    }\n    catch (\\Exception $e) {\n      $this->fail(t($fail, ['%query' => $query, '%error' => $e->getMessage(), '%name' => $this->name()]));\n      return !$fatal;\n    }\n  }\n\n  /**\n   * Check the engine version.\n   */\n  protected function checkEngineVersion() {\n    // Ensure that the database server has the right version.\n    if ($this->minimumVersion() && version_compare(Database::getConnection()->version(), $this->minimumVersion(), '<')) {\n      $this->fail(t(\"The database server version %version is less than the minimum required version %minimum_version.\", ['%version' => Database::getConnection()->version(), '%minimum_version' => $this->minimumVersion()]));\n    }\n  }\n\n  /**\n   * Return driver specific configuration options.\n   *\n   * @param $database\n   *   An array of driver specific configuration options.\n   *\n   * @return\n   *   The options form array.\n   */\n  public function getFormOptions(array $database) {\n      \n    $connectstr_dbhost = '';\n    $connectstr_dbfullhost = '';\n    $connectstr_dbname = '';\n    $connectstr_dbusername = '';\n    $connectstr_dbpassword = '';\n            \n        $connectstr_dbfullhost = getenv('DATABASE_HOST');\n        //$connectstr_dbhost = substr($connectstr_dbfullhost, 0 , strpos($connectstr_dbfullhost ,\":\"));\n        $connectstr_dbhost = $connectstr_dbfullhost;\n        $connectstr_dbname = getenv('DATABASE_NAME');\n        $connectstr_dbusername = getenv('DATABASE_USERNAME');\n        $connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n    \n    //Port for MYSQL in-app or ClearDB \n    $connectstr_port = getenv('WEBSITE_MYSQL_PORT');\n    if (empty($connectstr_port))\n    {\n      $connectstr_port= 3306;\n    }\n    $form['database'] = [\n      '#type' => 'textfield',\n      '#title' => t('Database name'),\n      '#default_value' => $connectstr_dbname,\n      '#size' => 45,\n      '#required' => TRUE,\n      '#states' => [\n        'required' => [\n          ':input[name=driver]' => ['value' => $this->pdoDriver],\n        ],\n      ],\n    ];\n\n    $form['username'] = [\n      '#type' => 'textfield',\n      '#title' => t('Database username'),\n      '#default_value' => $connectstr_dbusername,\n      '#size' => 45,\n      '#required' => TRUE,\n      '#states' => [\n        'required' => [\n          ':input[name=driver]' => ['value' => $this->pdoDriver],\n        ],\n      ],\n    ];\n\n    $form['password'] = [\n      '#type' => 'password',\n      '#title' => t('Database password'),\n      '#default_value' => $connectstr_dbpassword,\n      '#attributes' => array('value' => $connectstr_dbpassword),\n      '#required' => TRUE,\n      '#size' => 45,\n    ];\n\n    $form['advanced_options'] = [\n      '#type' => 'details',\n      '#title' => t('Advanced options'),\n      '#weight' => 10,\n    ];\n\n    $profile = drupal_get_profile();\n    $db_prefix = ($profile == 'standard') ? 'drupal_' : $profile . '_';\n    $form['advanced_options']['prefix'] = [\n      '#type' => 'textfield',\n      '#title' => t('Table name prefix'),\n      '#default_value' => empty($database['prefix']) ? '' : $database['prefix'],\n      '#size' => 45,\n      '#description' => t('If more than one application will be sharing this database, a unique table name prefix \u00e2\u20ac\u201c such as %prefix \u00e2\u20ac\u201c will prevent collisions.', ['%prefix' => $db_prefix]),\n      '#weight' => 10,\n    ];\n\n    $form['advanced_options']['host'] = [\n      '#type' => 'textfield',\n      '#title' => t('Host'),\n      '#default_value' => $connectstr_dbhost,\n      '#size' => 45,\n      // Hostnames can be 255 characters long.\n      '#maxlength' => 255,\n      '#required' => TRUE,\n    ];\n\n    $form['advanced_options']['port'] = [\n      '#type' => 'number',\n      '#title' => t('Port number'),\n      '#default_value' => $connectstr_port,\n      '#min' => 0,\n      '#max' => 65535,\n    ];\n\n    return $form;\n  }\n\n  /**\n   * Validates driver specific configuration settings.\n   *\n   * Checks to ensure correct basic database settings and that a proper\n   * connection to the database can be established.\n   *\n   * @param $database\n   *   An array of driver specific configuration options.\n   *\n   * @return\n   *   An array of driver configuration errors, keyed by form element name.\n   */\n  public function validateDatabaseSettings($database) {\n    $errors = [];\n\n    // Verify the table prefix.\n    if (!empty($database['prefix']) && is_string($database['prefix']) && !preg_match('/^[A-Za-z0-9_.]+$/', $database['prefix'])) {\n      $errors[$database['driver'] . '][prefix'] = t('The database table prefix you have entered, %prefix, is invalid. The table prefix can only contain alphanumeric characters, periods, or underscores.', ['%prefix' => $database['prefix']]);\n    }\n\n    return $errors;\n  }\n\n}\n", "num_lines": 322}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = '127.0.0.1';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n$hostname = getenv('WEBSITE_SITE_NAME');\n$cfg['PmaAbsoluteUri'] = 'http://'.$hostname.'.azurewebsites.net/phpmyadmin'; \n?>\n", "num_lines": 30}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Drupal\\Core\\Database\\Install;\n\nuse Drupal\\Core\\Database\\Database;\n\n/**\n * Database installer structure.\n *\n * Defines basic Drupal requirements for databases.\n */\nabstract class Tasks {\n\n  /**\n   * The name of the PDO driver this database type requires.\n   *\n   * @var string\n   */\n  protected $pdoDriver;\n\n  /**\n   * Structure that describes each task to run.\n   *\n   * @var array\n   *\n   * Each value of the tasks array is an associative array defining the function\n   * to call (optional) and any arguments to be passed to the function.\n   */\n  protected $tasks = [\n    [\n      'function'    => 'checkEngineVersion',\n      'arguments'   => [],\n    ],\n    [\n      'arguments'   => [\n        'CREATE TABLE {drupal_install_test} (id int NOT NULL PRIMARY KEY)',\n        'Drupal can use CREATE TABLE database commands.',\n        'Failed to <strong>CREATE</strong> a test table on your database server with the command %query. The server reports the following message: %error.<p>Are you sure the configured username has the necessary permissions to create tables in the database?</p>',\n        TRUE,\n      ],\n    ],\n    [\n      'arguments'   => [\n        'INSERT INTO {drupal_install_test} (id) VALUES (1)',\n        'Drupal can use INSERT database commands.',\n        'Failed to <strong>INSERT</strong> a value into a test table on your database server. We tried inserting a value with the command %query and the server reported the following error: %error.',\n      ],\n    ],\n    [\n      'arguments'   => [\n        'UPDATE {drupal_install_test} SET id = 2',\n        'Drupal can use UPDATE database commands.',\n        'Failed to <strong>UPDATE</strong> a value in a test table on your database server. We tried updating a value with the command %query and the server reported the following error: %error.',\n      ],\n    ],\n    [\n      'arguments'   => [\n        'DELETE FROM {drupal_install_test}',\n        'Drupal can use DELETE database commands.',\n        'Failed to <strong>DELETE</strong> a value from a test table on your database server. We tried deleting a value with the command %query and the server reported the following error: %error.',\n      ],\n    ],\n    [\n      'arguments'   => [\n        'DROP TABLE {drupal_install_test}',\n        'Drupal can use DROP TABLE database commands.',\n        'Failed to <strong>DROP</strong> a test table from your database server. We tried dropping a table with the command %query and the server reported the following error %error.',\n      ],\n    ],\n  ];\n\n  /**\n   * Results from tasks.\n   *\n   * @var array\n   */\n  protected $results = [\n    'fail' => [],\n    'pass' => [],\n  ];\n\n  /**\n   * Ensure the PDO driver is supported by the version of PHP in use.\n   */\n  protected function hasPdoDriver() {\n    return in_array($this->pdoDriver, \\PDO::getAvailableDrivers());\n  }\n\n  /**\n   * Assert test as failed.\n   */\n  protected function fail($message) {\n    $this->results['fail'][] = $message;\n  }\n\n  /**\n   * Assert test as a pass.\n   */\n  protected function pass($message) {\n    $this->results['pass'][] = $message;\n  }\n\n  /**\n   * Check whether Drupal is installable on the database.\n   */\n  public function installable() {\n    return $this->hasPdoDriver() && empty($this->error);\n  }\n\n  /**\n   * Return the human-readable name of the driver.\n   */\n  abstract public function name();\n\n  /**\n   * Return the minimum required version of the engine.\n   *\n   * @return\n   *   A version string. If not NULL, it will be checked against the version\n   *   reported by the Database engine using version_compare().\n   */\n  public function minimumVersion() {\n    return NULL;\n  }\n\n  /**\n   * Run database tasks and tests to see if Drupal can run on the database.\n   *\n   * @return array\n   *   A list of error messages.\n   */\n  public function runTasks() {\n    // We need to establish a connection before we can run tests.\n    if ($this->connect()) {\n      foreach ($this->tasks as $task) {\n        if (!isset($task['function'])) {\n          $task['function'] = 'runTestQuery';\n        }\n        if (method_exists($this, $task['function'])) {\n          // Returning false is fatal. No other tasks can run.\n          if (FALSE === call_user_func_array([$this, $task['function']], $task['arguments'])) {\n            break;\n          }\n        }\n        else {\n          $this->fail(t(\"Failed to run all tasks against the database server. The task %task wasn't found.\", ['%task' => $task['function']]));\n        }\n      }\n    }\n    return $this->results['fail'];\n  }\n\n  /**\n   * Check if we can connect to the database.\n   */\n  protected function connect() {\n    try {\n      // This doesn't actually test the connection.\n      Database::setActiveConnection();\n      // Now actually do a check.\n      Database::getConnection();\n      $this->pass('Drupal can CONNECT to the database ok.');\n    }\n    catch (\\Exception $e) {\n      $this->fail(t('Failed to connect to your database server. The server reports the following message: %error.<ul><li>Is the database server running?</li><li>Does the database exist, and have you entered the correct database name?</li><li>Have you entered the correct username and password?</li><li>Have you entered the correct database hostname?</li></ul>', ['%error' => $e->getMessage()]));\n      return FALSE;\n    }\n    return TRUE;\n  }\n\n  /**\n   * Run SQL tests to ensure the database can execute commands with the current user.\n   */\n  protected function runTestQuery($query, $pass, $fail, $fatal = FALSE) {\n    try {\n      Database::getConnection()->query($query);\n      $this->pass(t($pass));\n    }\n    catch (\\Exception $e) {\n      $this->fail(t($fail, ['%query' => $query, '%error' => $e->getMessage(), '%name' => $this->name()]));\n      return !$fatal;\n    }\n  }\n\n  /**\n   * Check the engine version.\n   */\n  protected function checkEngineVersion() {\n    // Ensure that the database server has the right version.\n    if ($this->minimumVersion() && version_compare(Database::getConnection()->version(), $this->minimumVersion(), '<')) {\n      $this->fail(t(\"The database server version %version is less than the minimum required version %minimum_version.\", ['%version' => Database::getConnection()->version(), '%minimum_version' => $this->minimumVersion()]));\n    }\n  }\n\n  /**\n   * Return driver specific configuration options.\n   *\n   * @param $database\n   *   An array of driver specific configuration options.\n   *\n   * @return\n   *   The options form array.\n   */\n  public function getFormOptions(array $database) {\n      \n    $connectstr_dbhost = '';\n    $connectstr_dbfullhost = '';\n    $connectstr_dbname = '';\n    $connectstr_dbusername = '';\n    $connectstr_dbpassword = '';\n            \n        $connectstr_dbfullhost = getenv('DATABASE_HOST');\n        //$connectstr_dbhost = substr($connectstr_dbfullhost, 0 , strpos($connectstr_dbfullhost ,\":\"));\n        $connectstr_dbhost = $connectstr_dbfullhost;\n        $connectstr_dbname = getenv('DATABASE_NAME');\n        $connectstr_dbusername = getenv('DATABASE_USERNAME');\n        $connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n    \n    //Port for MYSQL in-app or ClearDB \n    $connectstr_port = getenv('WEBSITE_MYSQL_PORT');\n    if (empty($connectstr_port))\n    {\n      $connectstr_port= 3306;\n    }\n    $form['database'] = [\n      '#type' => 'textfield',\n      '#title' => t('Database name'),\n      '#default_value' => $connectstr_dbname,\n      '#size' => 45,\n      '#required' => TRUE,\n      '#states' => [\n        'required' => [\n          ':input[name=driver]' => ['value' => $this->pdoDriver],\n        ],\n      ],\n    ];\n\n    $form['username'] = [\n      '#type' => 'textfield',\n      '#title' => t('Database username'),\n      '#default_value' => $connectstr_dbusername,\n      '#size' => 45,\n      '#required' => TRUE,\n      '#states' => [\n        'required' => [\n          ':input[name=driver]' => ['value' => $this->pdoDriver],\n        ],\n      ],\n    ];\n\n    $form['password'] = [\n      '#type' => 'password',\n      '#title' => t('Database password'),\n      '#default_value' => $connectstr_dbpassword,\n      '#attributes' => array('value' => $connectstr_dbpassword),\n      '#required' => TRUE,\n      '#size' => 45,\n    ];\n\n    $form['advanced_options'] = [\n      '#type' => 'details',\n      '#title' => t('Advanced options'),\n      '#weight' => 10,\n    ];\n\n    $profile = drupal_get_profile();\n    $db_prefix = ($profile == 'standard') ? 'drupal_' : $profile . '_';\n    $form['advanced_options']['prefix'] = [\n      '#type' => 'textfield',\n      '#title' => t('Table name prefix'),\n      '#default_value' => empty($database['prefix']) ? '' : $database['prefix'],\n      '#size' => 45,\n      '#description' => t('If more than one application will be sharing this database, a unique table name prefix \u00e2\u20ac\u201c such as %prefix \u00e2\u20ac\u201c will prevent collisions.', ['%prefix' => $db_prefix]),\n      '#weight' => 10,\n    ];\n\n    $form['advanced_options']['host'] = [\n      '#type' => 'textfield',\n      '#title' => t('Host'),\n      '#default_value' => $connectstr_dbhost,\n      '#size' => 45,\n      // Hostnames can be 255 characters long.\n      '#maxlength' => 255,\n      '#required' => TRUE,\n    ];\n\n    $form['advanced_options']['port'] = [\n      '#type' => 'number',\n      '#title' => t('Port number'),\n      '#default_value' => $connectstr_port,\n      '#min' => 0,\n      '#max' => 65535,\n    ];\n\n    return $form;\n  }\n\n  /**\n   * Validates driver specific configuration settings.\n   *\n   * Checks to ensure correct basic database settings and that a proper\n   * connection to the database can be established.\n   *\n   * @param $database\n   *   An array of driver specific configuration options.\n   *\n   * @return\n   *   An array of driver configuration errors, keyed by form element name.\n   */\n  public function validateDatabaseSettings($database) {\n    $errors = [];\n\n    // Verify the table prefix.\n    if (!empty($database['prefix']) && is_string($database['prefix']) && !preg_match('/^[A-Za-z0-9_.]+$/', $database['prefix'])) {\n      $errors[$database['driver'] . '][prefix'] = t('The database table prefix you have entered, %prefix, is invalid. The table prefix can only contain alphanumeric characters, periods, or underscores.', ['%prefix' => $database['prefix']]);\n    }\n\n    return $errors;\n  }\n\n}\n", "num_lines": 322}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = '127.0.0.1';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n$hostname = getenv('WEBSITE_SITE_NAME');\n$cfg['PmaAbsoluteUri'] = 'http://'.$hostname.'.azurewebsites.net/phpmyadmin'; \n?>\n", "num_lines": 30}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Drupal\\Core\\Database\\Install;\n\nuse Drupal\\Core\\Database\\Database;\n\n/**\n * Database installer structure.\n *\n * Defines basic Drupal requirements for databases.\n */\nabstract class Tasks {\n\n  /**\n   * The name of the PDO driver this database type requires.\n   *\n   * @var string\n   */\n  protected $pdoDriver;\n\n  /**\n   * Structure that describes each task to run.\n   *\n   * @var array\n   *\n   * Each value of the tasks array is an associative array defining the function\n   * to call (optional) and any arguments to be passed to the function.\n   */\n  protected $tasks = [\n    [\n      'function'    => 'checkEngineVersion',\n      'arguments'   => [],\n    ],\n    [\n      'arguments'   => [\n        'CREATE TABLE {drupal_install_test} (id int NOT NULL PRIMARY KEY)',\n        'Drupal can use CREATE TABLE database commands.',\n        'Failed to <strong>CREATE</strong> a test table on your database server with the command %query. The server reports the following message: %error.<p>Are you sure the configured username has the necessary permissions to create tables in the database?</p>',\n        TRUE,\n      ],\n    ],\n    [\n      'arguments'   => [\n        'INSERT INTO {drupal_install_test} (id) VALUES (1)',\n        'Drupal can use INSERT database commands.',\n        'Failed to <strong>INSERT</strong> a value into a test table on your database server. We tried inserting a value with the command %query and the server reported the following error: %error.',\n      ],\n    ],\n    [\n      'arguments'   => [\n        'UPDATE {drupal_install_test} SET id = 2',\n        'Drupal can use UPDATE database commands.',\n        'Failed to <strong>UPDATE</strong> a value in a test table on your database server. We tried updating a value with the command %query and the server reported the following error: %error.',\n      ],\n    ],\n    [\n      'arguments'   => [\n        'DELETE FROM {drupal_install_test}',\n        'Drupal can use DELETE database commands.',\n        'Failed to <strong>DELETE</strong> a value from a test table on your database server. We tried deleting a value with the command %query and the server reported the following error: %error.',\n      ],\n    ],\n    [\n      'arguments'   => [\n        'DROP TABLE {drupal_install_test}',\n        'Drupal can use DROP TABLE database commands.',\n        'Failed to <strong>DROP</strong> a test table from your database server. We tried dropping a table with the command %query and the server reported the following error %error.',\n      ],\n    ],\n  ];\n\n  /**\n   * Results from tasks.\n   *\n   * @var array\n   */\n  protected $results = [\n    'fail' => [],\n    'pass' => [],\n  ];\n\n  /**\n   * Ensure the PDO driver is supported by the version of PHP in use.\n   */\n  protected function hasPdoDriver() {\n    return in_array($this->pdoDriver, \\PDO::getAvailableDrivers());\n  }\n\n  /**\n   * Assert test as failed.\n   */\n  protected function fail($message) {\n    $this->results['fail'][] = $message;\n  }\n\n  /**\n   * Assert test as a pass.\n   */\n  protected function pass($message) {\n    $this->results['pass'][] = $message;\n  }\n\n  /**\n   * Check whether Drupal is installable on the database.\n   */\n  public function installable() {\n    return $this->hasPdoDriver() && empty($this->error);\n  }\n\n  /**\n   * Return the human-readable name of the driver.\n   */\n  abstract public function name();\n\n  /**\n   * Return the minimum required version of the engine.\n   *\n   * @return\n   *   A version string. If not NULL, it will be checked against the version\n   *   reported by the Database engine using version_compare().\n   */\n  public function minimumVersion() {\n    return NULL;\n  }\n\n  /**\n   * Run database tasks and tests to see if Drupal can run on the database.\n   *\n   * @return array\n   *   A list of error messages.\n   */\n  public function runTasks() {\n    // We need to establish a connection before we can run tests.\n    if ($this->connect()) {\n      foreach ($this->tasks as $task) {\n        if (!isset($task['function'])) {\n          $task['function'] = 'runTestQuery';\n        }\n        if (method_exists($this, $task['function'])) {\n          // Returning false is fatal. No other tasks can run.\n          if (FALSE === call_user_func_array([$this, $task['function']], $task['arguments'])) {\n            break;\n          }\n        }\n        else {\n          $this->fail(t(\"Failed to run all tasks against the database server. The task %task wasn't found.\", ['%task' => $task['function']]));\n        }\n      }\n    }\n    return $this->results['fail'];\n  }\n\n  /**\n   * Check if we can connect to the database.\n   */\n  protected function connect() {\n    try {\n      // This doesn't actually test the connection.\n      Database::setActiveConnection();\n      // Now actually do a check.\n      Database::getConnection();\n      $this->pass('Drupal can CONNECT to the database ok.');\n    }\n    catch (\\Exception $e) {\n      $this->fail(t('Failed to connect to your database server. The server reports the following message: %error.<ul><li>Is the database server running?</li><li>Does the database exist, and have you entered the correct database name?</li><li>Have you entered the correct username and password?</li><li>Have you entered the correct database hostname?</li></ul>', ['%error' => $e->getMessage()]));\n      return FALSE;\n    }\n    return TRUE;\n  }\n\n  /**\n   * Run SQL tests to ensure the database can execute commands with the current user.\n   */\n  protected function runTestQuery($query, $pass, $fail, $fatal = FALSE) {\n    try {\n      Database::getConnection()->query($query);\n      $this->pass(t($pass));\n    }\n    catch (\\Exception $e) {\n      $this->fail(t($fail, ['%query' => $query, '%error' => $e->getMessage(), '%name' => $this->name()]));\n      return !$fatal;\n    }\n  }\n\n  /**\n   * Check the engine version.\n   */\n  protected function checkEngineVersion() {\n    // Ensure that the database server has the right version.\n    if ($this->minimumVersion() && version_compare(Database::getConnection()->version(), $this->minimumVersion(), '<')) {\n      $this->fail(t(\"The database server version %version is less than the minimum required version %minimum_version.\", ['%version' => Database::getConnection()->version(), '%minimum_version' => $this->minimumVersion()]));\n    }\n  }\n\n  /**\n   * Return driver specific configuration options.\n   *\n   * @param $database\n   *   An array of driver specific configuration options.\n   *\n   * @return\n   *   The options form array.\n   */\n  public function getFormOptions(array $database) {\n      \n    $connectstr_dbhost = '';\n    $connectstr_dbfullhost = '';\n    $connectstr_dbname = '';\n    $connectstr_dbusername = '';\n    $connectstr_dbpassword = '';\n            \n        $connectstr_dbfullhost = getenv('DATABASE_HOST');\n        //$connectstr_dbhost = substr($connectstr_dbfullhost, 0 , strpos($connectstr_dbfullhost ,\":\"));\n        $connectstr_dbhost = $connectstr_dbfullhost;\n        $connectstr_dbname = getenv('DATABASE_NAME');\n        $connectstr_dbusername = getenv('DATABASE_USERNAME');\n        $connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n    \n    //Port for MYSQL in-app or ClearDB \n    $connectstr_port = getenv('WEBSITE_MYSQL_PORT');\n    if (empty($connectstr_port))\n    {\n      $connectstr_port= 3306;\n    }\n    $form['database'] = [\n      '#type' => 'textfield',\n      '#title' => t('Database name'),\n      '#default_value' => $connectstr_dbname,\n      '#size' => 45,\n      '#required' => TRUE,\n      '#states' => [\n        'required' => [\n          ':input[name=driver]' => ['value' => $this->pdoDriver],\n        ],\n      ],\n    ];\n\n    $form['username'] = [\n      '#type' => 'textfield',\n      '#title' => t('Database username'),\n      '#default_value' => $connectstr_dbusername,\n      '#size' => 45,\n      '#required' => TRUE,\n      '#states' => [\n        'required' => [\n          ':input[name=driver]' => ['value' => $this->pdoDriver],\n        ],\n      ],\n    ];\n\n    $form['password'] = [\n      '#type' => 'password',\n      '#title' => t('Database password'),\n      '#default_value' => $connectstr_dbpassword,\n      '#attributes' => array('value' => $connectstr_dbpassword),\n      '#required' => TRUE,\n      '#size' => 45,\n    ];\n\n    $form['advanced_options'] = [\n      '#type' => 'details',\n      '#title' => t('Advanced options'),\n      '#weight' => 10,\n    ];\n\n    $profile = drupal_get_profile();\n    $db_prefix = ($profile == 'standard') ? 'drupal_' : $profile . '_';\n    $form['advanced_options']['prefix'] = [\n      '#type' => 'textfield',\n      '#title' => t('Table name prefix'),\n      '#default_value' => empty($database['prefix']) ? '' : $database['prefix'],\n      '#size' => 45,\n      '#description' => t('If more than one application will be sharing this database, a unique table name prefix \u00e2\u20ac\u201c such as %prefix \u00e2\u20ac\u201c will prevent collisions.', ['%prefix' => $db_prefix]),\n      '#weight' => 10,\n    ];\n\n    $form['advanced_options']['host'] = [\n      '#type' => 'textfield',\n      '#title' => t('Host'),\n      '#default_value' => $connectstr_dbhost,\n      '#size' => 45,\n      // Hostnames can be 255 characters long.\n      '#maxlength' => 255,\n      '#required' => TRUE,\n    ];\n\n    $form['advanced_options']['port'] = [\n      '#type' => 'number',\n      '#title' => t('Port number'),\n      '#default_value' => $connectstr_port,\n      '#min' => 0,\n      '#max' => 65535,\n    ];\n\n    return $form;\n  }\n\n  /**\n   * Validates driver specific configuration settings.\n   *\n   * Checks to ensure correct basic database settings and that a proper\n   * connection to the database can be established.\n   *\n   * @param $database\n   *   An array of driver specific configuration options.\n   *\n   * @return\n   *   An array of driver configuration errors, keyed by form element name.\n   */\n  public function validateDatabaseSettings($database) {\n    $errors = [];\n\n    // Verify the table prefix.\n    if (!empty($database['prefix']) && is_string($database['prefix']) && !preg_match('/^[A-Za-z0-9_.]+$/', $database['prefix'])) {\n      $errors[$database['driver'] . '][prefix'] = t('The database table prefix you have entered, %prefix, is invalid. The table prefix can only contain alphanumeric characters, periods, or underscores.', ['%prefix' => $database['prefix']]);\n    }\n\n    return $errors;\n  }\n\n}\n", "num_lines": 322}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = '127.0.0.1';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n$hostname = getenv('WEBSITE_SITE_NAME');\n$cfg['PmaAbsoluteUri'] = 'http://'.$hostname.'.azurewebsites.net/phpmyadmin'; \n?>\n", "num_lines": 30}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php  /// Moodle Configuration File \n\nunset($CFG);\nglobal $CFG;\n$CFG = new stdClass();\n//=========================================================================\n// 1. DATABASE SETUP\n//=========================================================================\n//GET database configuration from azure\n$connectstr_dbtype = ''; \n$connectstr_dbhost = '';\n$connectstr_dbname = '';\n$connectstr_dbusername = '';\n$connectstr_dbpassword = '';\n\n    $connectstr_dbtype = getenv('DATABASE_TYPE');\n    $connectstr_dbhost = getenv('DATABASE_HOST');\n    $connectstr_dbname = getenv('DATABASE_NAME');\n    $connectstr_dbusername = getenv('DATABASE_USERNAME');\n    $connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n$CFG->dbtype    = $connectstr_dbtype;\n$CFG->dblibrary = 'native';\n$CFG->dbhost    = $connectstr_dbhost;\n$CFG->dbname    = $connectstr_dbname;\n$CFG->dbuser    = $connectstr_dbusername;\n$CFG->dbpass    = $connectstr_dbpassword;\n$CFG->prefix    = 'mdl_';\n$CFG->dboptions = array (\n  'dbpersist' => false,\n  'dbsocket'  => false,\n  'dbport' => '',\n  'dbhandlesoptions' => false,\n  'dbcollation' => 'utf8mb4_unicode_ci',\n);\n\n//=========================================================================\n// 2. WEB SITE LOCATION\n//=========================================================================\n// Now you need to tell Moodle where it is located. Specify the full\n// web address to where moodle has been installed.  If your web site\n// is accessible via multiple URLs then choose the most natural one\n// that your students would use.  Do not include a trailing slash\n//\n// If you need both intranet and Internet access please read\n// http://docs.moodle.org/en/masquerading\n\n$CFG->wwwroot   = \"http://\".$_SERVER['HTTP_HOST'];\n//=========================================================================\n// 3. DATA FILES LOCATION\n//=========================================================================\n// Now you need a place where Moodle can save uploaded files.  This\n// directory should be readable AND WRITEABLE by the web server user\n// (usually 'nobody' or 'apache'), but it should not be accessible\n// directly via the web.\n//\n// - On hosting systems you might need to make sure that your \"group\" has\n//   no permissions at all, but that \"others\" have full permissions.\n//\n// - On Windows systems you might specify something like 'c:\\moodledata'\n\n$CFG->dataroot  = '/home/site/wwwroot/moodledata';\n\n\n//=========================================================================\n// 4. DATA FILES PERMISSIONS\n//=========================================================================\n// The following parameter sets the permissions of new directories\n// created by Moodle within the data directory.  The format is in\n// octal format (as used by the Unix utility chmod, for example).\n// The default is usually OK, but you may want to change it to 0750\n// if you are concerned about world-access to the files (you will need\n// to make sure the web server process (eg Apache) can access the files.\n// NOTE: the prefixed 0 is important, and don't use quotes.\n\n$CFG->directorypermissions = 0777;\n\n\n//=========================================================================\n// 5. DIRECTORY LOCATION  (most people can just ignore this setting)\n//=========================================================================\n// A very few webhosts use /admin as a special URL for you to access a\n// control panel or something.  Unfortunately this conflicts with the\n// standard location for the Moodle admin pages.  You can work around this\n// by renaming the admin directory in your installation, and putting that\n// new name here.  eg \"moodleadmin\".  This should fix all admin links in Moodle.\n// After any change you need to visit your new admin directory\n// and purge all caches.\n\n$CFG->admin = 'admin';\n\n\n//=========================================================================\n// 6. OTHER MISCELLANEOUS SETTINGS (ignore these for new installations)\n//=========================================================================\n//\n// These are additional tweaks for which no GUI exists in Moodle yet.\n//\n// Starting in PHP 5.3 administrators should specify default timezone\n// in PHP.ini, you can also specify it here if needed.\n// See details at: http://php.net/manual/en/function.date-default-timezone-set.php\n// List of time zones at: http://php.net/manual/en/timezones.php\n//     date_default_timezone_set('Australia/Perth');\n//\n// Change the key pair lifetime for Moodle Networking\n// The default is 28 days. You would only want to change this if the key\n// was not getting regenerated for any reason. You would probably want\n// make it much longer. Note that you'll need to delete and manually update\n// any existing key.\n//      $CFG->mnetkeylifetime = 28;\n//\n// Not recommended: Set the following to true to allow the use\n// off non-Moodle standard characters in usernames.\n//      $CFG->extendedusernamechars = true;\n//\n// Allow user passwords to be included in backup files. Very dangerous\n// setting as far as it publishes password hashes that can be unencrypted\n// if the backup file is publicy available. Use it only if you can guarantee\n// that all your backup files remain only privacy available and are never\n// shared out from your site/institution!\n//      $CFG->includeuserpasswordsinbackup = true;\n//\n// Completely disable user creation when restoring a course, bypassing any\n// permissions granted via roles and capabilities. Enabling this setting\n// results in the restore process stopping when a user attempts to restore a\n// course requiring users to be created.\n//     $CFG->disableusercreationonrestore = true;\n//\n// Keep the temporary directories used by backup and restore without being\n// deleted at the end of the process. Use it if you want to debug / view\n// all the information stored there after the process has ended. Note that\n// those directories may be deleted (after some ttl) both by cron and / or\n// by new backup / restore invocations.\n//     $CFG->keeptempdirectoriesonbackup = true;\n//\n// Modify the restore process in order to force the \"user checks\" to assume\n// that the backup originated from a different site, so detection of matching\n// users is performed with different (more \"relaxed\") rules. Note that this is\n// only useful if the backup file has been created using Moodle < 1.9.4 and the\n// site has been rebuilt from scratch using backup files (not the best way btw).\n// If you obtain user conflicts on restore, rather than enabling this setting\n// permanently, try restoring the backup on a different site, back it up again\n// and then restore on the target server.\n//    $CFG->forcedifferentsitecheckingusersonrestore = true;\n//\n// Force the backup system to continue to create backups in the legacy zip\n// format instead of the new tgz format. Does not affect restore, which\n// auto-detects the underlying file format.\n//    $CFG->usezipbackups = true;\n//\n// Prevent stats processing and hide the GUI\n//      $CFG->disablestatsprocessing = true;\n//\n// Setting this to true will enable admins to edit any post at any time\n//      $CFG->admineditalways = true;\n//\n// These variables define DEFAULT block variables for new courses\n// If this one is set it overrides all others and is the only one used.\n//      $CFG->defaultblocks_override = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// These variables define the specific settings for defined course formats.\n// They override any settings defined in the formats own config file.\n//      $CFG->defaultblocks_site = 'site_main_menu,course_list:course_summary,calendar_month';\n//      $CFG->defaultblocks_social = 'participants,search_forums,calendar_month,calendar_upcoming,social_activities,recent_activity,course_list';\n//      $CFG->defaultblocks_topics = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//      $CFG->defaultblocks_weeks = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// These blocks are used when no other default setting is found.\n//      $CFG->defaultblocks = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// You can specify a different class to be created for the $PAGE global, and to\n// compute which blocks appear on each page. However, I cannot think of any good\n// reason why you would need to change that. It just felt wrong to hard-code the\n// the class name. You are strongly advised not to use these to settings unless\n// you are absolutely sure you know what you are doing.\n//      $CFG->moodlepageclass = 'moodle_page';\n//      $CFG->moodlepageclassfile = \"$CFG->dirroot/local/myplugin/mypageclass.php\";\n//      $CFG->blockmanagerclass = 'block_manager';\n//      $CFG->blockmanagerclassfile = \"$CFG->dirroot/local/myplugin/myblockamanagerclass.php\";\n//\n// Seconds for files to remain in caches. Decrease this if you are worried\n// about students being served outdated versions of uploaded files.\n//     $CFG->filelifetime = 60*60*6;\n//\n// Some web servers can offload the file serving from PHP process,\n// comment out one the following options to enable it in Moodle:\n//     $CFG->xsendfile = 'X-Sendfile';           // Apache {@see https://tn123.org/mod_xsendfile/}\n//     $CFG->xsendfile = 'X-LIGHTTPD-send-file'; // Lighttpd {@see http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file}\n//     $CFG->xsendfile = 'X-Accel-Redirect';     // Nginx {@see http://wiki.nginx.org/XSendfile}\n// If your X-Sendfile implementation (usually Nginx) uses directory aliases specify them\n// in the following array setting:\n//     $CFG->xsendfilealiases = array(\n//         '/dataroot/' => $CFG->dataroot,\n//         '/cachedir/' => '/var/www/moodle/cache',    // for custom $CFG->cachedir locations\n//         '/localcachedir/' => '/var/local/cache',    // for custom $CFG->localcachedir locations\n//         '/tempdir/'  => '/var/www/moodle/temp',     // for custom $CFG->tempdir locations\n//         '/filedir'   => '/var/www/moodle/filedir',  // for custom $CFG->filedir locations\n//     );\n//\n// YUI caching may be sometimes improved by slasharguments:\n//     $CFG->yuislasharguments = 1;\n// Some servers may need a special rewrite rule to work around internal path length limitations:\n// RewriteRule (^.*/theme/yui_combo\\.php)(/.*) $1?file=$2\n//\n//\n// Following settings may be used to select session driver, uncomment only one of the handlers.\n//   Database session handler (not compatible with MyISAM):\n//      $CFG->session_handler_class = '\\core\\session\\database';\n//      $CFG->session_database_acquire_lock_timeout = 120;\n//\n//   File session handler (file system locking required):\n//      $CFG->session_handler_class = '\\core\\session\\file';\n//      $CFG->session_file_save_path = $CFG->dataroot.'/sessions';\n$CFG->session_file_save_path = '/usr/local/php/tmp';\n//\n//   Memcached session handler (requires memcached server and extension):\n//      $CFG->session_handler_class = '\\core\\session\\memcached';\n//      $CFG->session_memcached_save_path = '127.0.0.1:11211';\n//      $CFG->session_memcached_prefix = 'memc.sess.key.';\n//      $CFG->session_memcached_acquire_lock_timeout = 120;\n//      $CFG->session_memcached_lock_expire = 7200;       // Ignored if PECL memcached is below version 2.2.0\n//      $CFG->session_memcached_lock_retry_sleep = 150;   // Spin-lock retry sleeptime (msec). Only effective\n//                                                        // for tuning php-memcached 3.0.x (PHP 7)\n//\n//   Redis session handler (requires redis server and redis extension):\n//      $CFG->session_handler_class = '\\core\\session\\redis';\n//      $CFG->session_redis_host = '127.0.0.1';\n//      $CFG->session_redis_port = 6379;  // Optional.\n//      $CFG->session_redis_database = 0;  // Optional, default is db 0.\n//      $CFG->session_redis_auth = ''; // Optional, default is don't set one.\n//      $CFG->session_redis_prefix = ''; // Optional, default is don't set one.\n//      $CFG->session_redis_acquire_lock_timeout = 120;\n//      $CFG->session_redis_lock_expire = 7200;\n//      Use the igbinary serializer instead of the php default one. Note that phpredis must be compiled with\n//      igbinary support to make the setting to work. Also, if you change the serializer you have to flush the database!\n//      $CFG->session_redis_serializer_use_igbinary = false; // Optional, default is PHP builtin serializer.\n//\n//   Memcache session handler (requires memcached server and memcache extension):\n//      $CFG->session_handler_class = '\\core\\session\\memcache';\n//      $CFG->session_memcache_save_path = '127.0.0.1:11211';\n//      $CFG->session_memcache_acquire_lock_timeout = 120;\n//      ** NOTE: Memcache extension has less features than memcached and may be\n//         less reliable. Use memcached where possible or if you encounter\n//         session problems. **\n//\n// Please be aware that when selecting either Memcached or Memcache for sessions that it is advised to use a dedicated\n// memcache server. The memcache and memcached extensions do not provide isolated environments for individual uses.\n// Using the same server for other purposes (MUC for example) can lead to sessions being prematurely removed should\n// the other uses of the server purge the cache.\n//\n// Following setting allows you to alter how frequently is timemodified updated in sessions table.\n//      $CFG->session_update_timemodified_frequency = 20; // In seconds.\n//\n// If this setting is set to true, then Moodle will track the IP of the\n// current user to make sure it hasn't changed during a session.  This\n// will prevent the possibility of sessions being hijacked via XSS, but it\n// may break things for users coming using proxies that change all the time,\n// like AOL.\n//      $CFG->tracksessionip = true;\n//\n// The following lines are for handling email bounces.\n//      $CFG->handlebounces = true;\n//      $CFG->minbounces = 10;\n//      $CFG->bounceratio = .20;\n// The next lines are needed both for bounce handling and any other email to module processing.\n// mailprefix must be EXACTLY four characters.\n// Uncomment and customise this block for Postfix\n//      $CFG->mailprefix = 'mdl+'; // + is the separator for Exim and Postfix.\n//      $CFG->mailprefix = 'mdl-'; // - is the separator for qmail\n//      $CFG->maildomain = 'youremaildomain.com';\n//\n// Enable when setting up advanced reverse proxy load balancing configurations,\n// it may be also necessary to enable this when using port forwarding.\n//      $CFG->reverseproxy = true;\n//\n// Enable when using external SSL appliance for performance reasons.\n// Please note that site may be accessible via http: or https:, but not both!\n//      $CFG->sslproxy = true;\n//\n// This setting will cause the userdate() function not to fix %d in\n// date strings, and just let them show with a zero prefix.\n//      $CFG->nofixday = true;\n//\n// This setting will make some graphs (eg user logs) use lines instead of bars\n//      $CFG->preferlinegraphs = true;\n//\n// This setting allows you to specify a class to rewrite outgoing urls\n// enabling 'clean urls' in conjunction with an apache / nginx handler.\n// The handler must implement \\core\\output\\url_rewriter.\n//      $CFG->urlrewriteclass = '\\local_cleanurls\\url_rewriter';\n//\n// Enabling this will allow custom scripts to replace existing moodle scripts.\n// For example: if $CFG->customscripts/course/view.php exists then\n// it will be used instead of $CFG->wwwroot/course/view.php\n// At present this will only work for files that include config.php and are called\n// as part of the url (index.php is implied).\n// Some examples are:\n//      http://my.moodle.site/course/view.php\n//      http://my.moodle.site/index.php\n//      http://my.moodle.site/admin            (index.php implied)\n// Custom scripts should not include config.php\n// Warning: Replacing standard moodle scripts may pose security risks and/or may not\n// be compatible with upgrades. Use this option only if you are aware of the risks\n// involved.\n// Specify the full directory path to the custom scripts\n//      $CFG->customscripts = '/home/example/customscripts';\n//\n// Performance profiling\n//\n//   If you set Debug to \"Yes\" in the Configuration->Variables page some\n//   performance profiling data will show up on your footer (in default theme).\n//   With these settings you get more granular control over the capture\n//   and printout of the data\n//\n//   Capture performance profiling data\n//   define('MDL_PERF'  , true);\n//\n//   Capture additional data from DB\n//   define('MDL_PERFDB'  , true);\n//\n//   Print to log (for passive profiling of production servers)\n//   define('MDL_PERFTOLOG'  , true);\n//\n//   Print to footer (works with the default theme)\n//   define('MDL_PERFTOFOOT', true);\n//\n//   Enable earlier profiling that causes more code to be covered\n//   on every request (db connections, config load, other inits...).\n//   Requires extra configuration to be defined in config.php like:\n//   profilingincluded, profilingexcluded, profilingautofrec,\n//   profilingallowme, profilingallowall, profilinglifetime\n//       $CFG->earlyprofilingenabled = true;\n//\n// Force displayed usernames\n//   A little hack to anonymise user names for all students.  If you set these\n//   then all non-teachers will always see these for every person.\n//       $CFG->forcefirstname = 'Bruce';\n//       $CFG->forcelastname  = 'Simpson';\n//\n// The following setting will turn on username logging into Apache log. For full details regarding setting\n// up of this function please refer to the install section of the document.\n//     $CFG->apacheloguser = 0; // Turn this feature off. Default value.\n//     $CFG->apacheloguser = 1; // Log user id.\n//     $CFG->apacheloguser = 2; // Log full name in cleaned format. ie, Darth Vader will be displayed as darth_vader.\n//     $CFG->apacheloguser = 3; // Log username.\n// To get the values logged in Apache's log, add to your httpd.conf\n// the following statements. In the General part put:\n//     LogFormat \"%h %l %{MOODLEUSER}n %t \\\"%r\\\" %s %b \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" moodleformat\n// And in the part specific to your Moodle install / virtualhost:\n//     CustomLog \"/your/path/to/log\" moodleformat\n//\n// Alternatively for other webservers such as nginx, you can instead have the username sent via a http header\n// 'X-MOODLEUSER' which can be saved in the logfile and then stripped out before being sent to the browser:\n//     $CFG->headerloguser = 0; // Turn this feature off. Default value.\n//     $CFG->headerloguser = 1; // Log user id.\n//     $CFG->headerloguser = 2; // Log full name in cleaned format. ie, Darth Vader will be displayed as darth_vader.\n//     $CFG->headerloguser = 3; // Log username.\n//\n// CAUTION: Use of this option will expose usernames in the Apache / nginx log,\n// If you are going to publish your log, or the output of your web stats analyzer\n// this will weaken the security of your website.\n//\n// Email database connection errors to someone.  If Moodle cannot connect to the\n// database, then email this address with a notice.\n//\n//     $CFG->emailconnectionerrorsto = 'your@emailaddress.com';\n//\n// Set the priority of themes from highest to lowest. This is useful (for\n// example) in sites where the user theme should override all other theme\n// settings for accessibility reasons. You can also disable types of themes\n// (other than site)  by removing them from the array. The default setting is:\n//\n//     $CFG->themeorder = array('course', 'category', 'session', 'user', 'cohort', 'site');\n//\n// NOTE: course, category, session, user, cohort themes still require the\n// respective settings to be enabled\n//\n// It is possible to add extra themes directory stored outside of $CFG->dirroot.\n// This local directory does not have to be accessible from internet.\n//\n//     $CFG->themedir = '/location/of/extra/themes';\n//\n// It is possible to specify different cache and temp directories, use local fast filesystem\n// for normal web servers. Server clusters MUST use shared filesystem for cachedir!\n// Localcachedir is intended for server clusters, it does not have to be shared by cluster nodes.\n// The directories must not be accessible via web.\n//\n//     $CFG->tempdir = '/var/www/moodle/temp';        // Directory MUST BE SHARED by all cluster nodes.\n//     $CFG->cachedir = '/var/www/moodle/cache';      // Directory MUST BE SHARED by all cluster nodes, locking required.\n//     $CFG->localcachedir = '/var/local/cache';      // Intended for local node caching.\n//\n// It is possible to specify a different backup temp directory, use local fast filesystem\n// for normal web servers. Server clusters MUST use shared filesystem for backuptempdir!\n// The directory must not be accessible via web.\n//\n//     $CFG->backuptempdir = '/var/www/moodle/backuptemp';  // Directory MUST BE SHARED by all cluster nodes.\n//\n// Some filesystems such as NFS may not support file locking operations.\n// Locking resolves race conditions and is strongly recommended for production servers.\n//     $CFG->preventfilelocking = false;\n//\n// Site default language can be set via standard administration interface. If you\n// want to have initial error messages for eventual database connection problems\n// localized too, you have to set your language code here.\n//\n//     $CFG->lang = 'yourlangcode'; // for example 'cs'\n//\n// When Moodle is about to perform an intensive operation it raises PHP's memory\n// limit. The following setting should be used on large sites to set the raised\n// memory limit to something higher.\n// The value for the settings should be a valid PHP memory value. e.g. 512M, 1G\n//\n//     $CFG->extramemorylimit = '1024M';\n//\n// Moodle 2.4 introduced a new cache API.\n// The cache API stores a configuration file within the Moodle data directory and\n// uses that rather than the database in order to function in a stand-alone manner.\n// Using altcacheconfigpath you can change the location where this config file is\n// looked for.\n// It can either be a directory in which to store the file, or the full path to the\n// file if you want to take full control. Either way it must be writable by the\n// webserver.\n//\n//     $CFG->altcacheconfigpath = '/var/www/shared/moodle.cache.config.php\n//\n// Use the following flag to completely disable the Available update notifications\n// feature and hide it from the server administration UI.\n//\n//      $CFG->disableupdatenotifications = true;\n//\n// Use the following flag to completely disable the installation of plugins\n// (new plugins, available updates and missing dependencies) and related\n// features (such as cancelling the plugin installation or upgrade) via the\n// server administration web interface.\n//\n//      $CFG->disableupdateautodeploy = true;\n//\n// Use the following flag to disable the warning on the system notifications page\n// about present development libraries. This flag will not disable the warning within\n// the security overview report. Use this flag only if you really have prohibited web\n// access to the development libraries in your webserver configuration.\n//\n//      $CFG->disabledevlibdirscheck = true;\n//\n// Use the following flag to disable modifications to scheduled tasks\n// whilst still showing the state of tasks.\n//\n//      $CFG->preventscheduledtaskchanges = true;\n//\n// As of version 2.4 Moodle serves icons as SVG images if the users browser appears\n// to support SVG.\n// For those wanting to control the serving of SVG images the following setting can\n// be defined in your config.php.\n// If it is not defined then the default (browser detection) will occur.\n//\n// To ensure they are always used when available:\n//      $CFG->svgicons = true;\n//\n// To ensure they are never used even when available:\n//      $CFG->svgicons = false;\n//\n// Some administration options allow setting the path to executable files. This can\n// potentially cause a security risk. Set this option to true to disable editing\n// those config settings via the web. They will need to be set explicitly in the\n// config.php file\n//      $CFG->preventexecpath = true;\n//\n// Use the following flag to set userid for noreply user. If not set then moodle will\n// create dummy user and use -ve value as user id.\n//      $CFG->noreplyuserid = -10;\n//\n// As of version 2.6 Moodle supports admin to set support user. If not set, all mails\n// will be sent to supportemail.\n//      $CFG->supportuserid = -20;\n//\n// Moodle 2.7 introduces a locking api for critical tasks (e.g. cron).\n// The default locking system to use is DB locking for Postgres, and file locking for\n// MySQL, Oracle and SQLServer. If $CFG->preventfilelocking is set, then the default\n// will always be DB locking. It can be manually set to one of the lock\n// factory classes listed below, or one of your own custom classes implementing the\n// \\core\\lock\\lock_factory interface.\n//\n//      $CFG->lock_factory = \"auto\";\n//\n// The list of available lock factories is:\n//\n// \"\\\\core\\\\lock\\\\file_lock_factory\" - File locking\n//      Uses lock files stored by default in the dataroot. Whether this\n//      works on clusters depends on the file system used for the dataroot.\n//\n// \"\\\\core\\\\lock\\\\db_record_lock_factory\" - DB locking based on table rows.\n//\n// \"\\\\core\\\\lock\\\\postgres_lock_factory\" - DB locking based on postgres advisory locks.\n//\n// Settings used by the lock factories\n//\n// Location for lock files used by the File locking factory. This must exist\n// on a shared file system that supports locking.\n//      $CFG->lock_file_root = $CFG->dataroot . '/lock';\n//\n// Moodle 2.9 allows administrators to customise the list of supported file types.\n// To add a new filetype or override the definition of an existing one, set the\n// customfiletypes variable like this:\n//\n// $CFG->customfiletypes = array(\n//     (object)array(\n//         'extension' => 'frog',\n//         'icon' => 'archive',\n//         'type' => 'application/frog',\n//         'customdescription' => 'Amphibian-related file archive'\n//     )\n// );\n//\n// The extension, icon, and type fields are required. The icon field can refer to\n// any icon inside the pix/f folder. You can also set the customdescription field\n// (shown above) and (for advanced use) the groups, string, and defaulticon fields.\n//\n// Upgrade key\n//\n// If the upgrade key is defined here, then the value must be provided every time\n// the site is being upgraded though the web interface, regardless of whether the\n// administrator is logged in or not. This prevents anonymous access to the upgrade\n// screens where the real authentication and authorization mechanisms can not be\n// relied on.\n//\n// It is strongly recommended to use a value different from your real account\n// password.\n//\n//      $CFG->upgradekey = 'put_some_password-like_value_here';\n//\n//=========================================================================\n// 7. SETTINGS FOR DEVELOPMENT SERVERS - not intended for production use!!!\n//=========================================================================\n//\n// Force a debugging mode regardless the settings in the site administration\n @error_reporting(E_ALL); // NOT FOR PRODUCTION SERVERS!\n @ini_set('display_errors', '1');    // NOT FOR PRODUCTION SERVERS!\n $CFG->debug = (E_ALL);   // === DEBUG_DEVELOPER - NOT FOR PRODUCTION SERVERS!\n $CFG->debugdisplay = 1;             // NOT FOR PRODUCTION SERVERS!\n//\n// You can specify a comma separated list of user ids that that always see\n// debug messages, this overrides the debug flag in $CFG->debug and $CFG->debugdisplay\n// for these users only.\n// $CFG->debugusers = '2';\n//\n// Prevent theme caching\n// $CFG->themedesignermode = true; // NOT FOR PRODUCTION SERVERS!\n//\n// Enable verbose debug information during fetching of email messages from IMAP server.\n// $CFG->debugimap = true;\n//\n// Prevent JS caching\n// $CFG->cachejs = false; // NOT FOR PRODUCTION SERVERS!\n//\n// Restrict which YUI logging statements are shown in the browser console.\n// For details see the upstream documentation:\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logInclude\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logExclude\n// $CFG->yuiloginclude = array(\n//     'moodle-core-dock-loader' => true,\n//     'moodle-course-categoryexpander' => true,\n// );\n// $CFG->yuilogexclude = array(\n//     'moodle-core-dock' => true,\n//     'moodle-core-notification' => true,\n// );\n//\n// Set the minimum log level for YUI logging statements.\n// For details see the upstream documentation:\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logLevel\n// $CFG->yuiloglevel = 'debug';\n//\n// Prevent core_string_manager application caching\n// $CFG->langstringcache = false; // NOT FOR PRODUCTION SERVERS!\n//\n// When working with production data on test servers, no emails or other messages\n// should ever be send to real users\n// $CFG->noemailever = true;    // NOT FOR PRODUCTION SERVERS!\n//\n// Divert all outgoing emails to this address to test and debug emailing features\n// $CFG->divertallemailsto = 'root@localhost.local'; // NOT FOR PRODUCTION SERVERS!\n//\n// Except for certain email addresses you want to let through for testing. Accepts\n// a comma separated list of regexes.\n// $CFG->divertallemailsexcept = 'tester@dev.com, fred(\\+.*)?@example.com'; // NOT FOR PRODUCTION SERVERS!\n//\n// Uncomment if you want to allow empty comments when modifying install.xml files.\n// $CFG->xmldbdisablecommentchecking = true;    // NOT FOR PRODUCTION SERVERS!\n//\n// Since 2.0 sql queries are not shown during upgrade by default.\n// Please note that this setting may produce very long upgrade page on large sites.\n// $CFG->upgradeshowsql = true; // NOT FOR PRODUCTION SERVERS!\n//\n// Add SQL queries to the output of cron, just before their execution\n// $CFG->showcronsql = true;\n//\n// Force developer level debug and add debug info to the output of cron\n// $CFG->showcrondebugging = true;\n//\n//=========================================================================\n// 8. FORCED SETTINGS\n//=========================================================================\n// It is possible to specify normal admin settings here, the point is that\n// they can not be changed through the standard admin settings pages any more.\n//\n// Core settings are specified directly via assignment to $CFG variable.\n// Example:\n//   $CFG->somecoresetting = 'value';\n//\n// Plugin settings have to be put into a special array.\n// Example:\n//   $CFG->forced_plugin_settings = array('pluginname'  => array('settingname' => 'value', 'secondsetting' => 'othervalue'),\n//                                        'otherplugin' => array('mysetting' => 'myvalue', 'thesetting' => 'thevalue'));\n// Module default settings with advanced/locked checkboxes can be set too. To do this, add\n// an extra config with '_adv' or '_locked' as a suffix and set the value to true or false.\n// Example:\n//   $CFG->forced_plugin_settings = array('pluginname'  => array('settingname' => 'value', 'settingname_locked' => true, 'settingname_adv' => true));\n//\n//=========================================================================\n// 9. PHPUNIT SUPPORT\n//=========================================================================\n// $CFG->phpunit_prefix = 'phpu_';\n// $CFG->phpunit_dataroot = '/home/example/phpu_moodledata';\n// $CFG->phpunit_directorypermissions = 02777; // optional\n// $CFG->phpunit_profilingenabled = true; // optional to profile PHPUnit runs.\n//\n//\n//=========================================================================\n// 10. SECRET PASSWORD SALT\n//=========================================================================\n// A site-wide password salt is no longer used in new installations.\n// If upgrading from 2.6 or older, keep all existing salts in config.php file.\n//\n// $CFG->passwordsaltmain = 'a_very_long_random_string_of_characters#@6&*1';\n//\n// You may also have some alternative salts to allow migration from previously\n// used salts.\n//\n// $CFG->passwordsaltalt1 = '';\n// $CFG->passwordsaltalt2 = '';\n// $CFG->passwordsaltalt3 = '';\n// ....\n// $CFG->passwordsaltalt19 = '';\n// $CFG->passwordsaltalt20 = '';\n//\n//\n//=========================================================================\n// 11. BEHAT SUPPORT\n//=========================================================================\n// Behat test site needs a unique www root, data directory and database prefix:\n//\n// $CFG->behat_wwwroot = 'http://127.0.0.1/moodle';\n// $CFG->behat_prefix = 'bht_';\n// $CFG->behat_dataroot = '/home/example/bht_moodledata';\n//\n// You can override default Moodle configuration for Behat and add your own\n// params; here you can add more profiles, use different Mink drivers than Selenium...\n// These params would be merged with the default Moodle behat.yml, giving priority\n// to the ones specified here. The array format is YAML, following the Behat\n// params hierarchy. More info: http://docs.behat.org/guides/7.config.html\n// Example:\n//   $CFG->behat_config = array(\n//       'Mac-Firefox' => array(\n//           'suites' => array (\n//               'default' => array(\n//                   'filters' => array(\n//                      'tags' => '~@_file_upload'\n//                   ),\n//               ),\n//           ),\n//           'extensions' => array(\n//               'Behat\\MinkExtension' => array(\n//                   'selenium2' => array(\n//                       'browser' => 'firefox',\n//                       'capabilities' => array(\n//                           'platform' => 'OS X 10.6',\n//                           'version' => 20\n//                       )\n//                   )\n//               )\n//           )\n//       ),\n//       'Mac-Safari' => array(\n//           'extensions' => array(\n//               'Behat\\MinkExtension' => array(\n//                   'selenium2' => array(\n//                       'browser' => 'safari',\n//                       'capabilities' => array(\n//                           'platform' => 'OS X 10.8',\n//                           'version' => 6\n//                       )\n//                   )\n//               )\n//           )\n//       )\n//   );\n// You can also use the following config to override default Moodle configuration for Behat.\n// This config is limited to default suite and will be supported in later versions.\n// It will have precedence over $CFG->behat_config.\n// $CFG->behat_profiles = array(\n//     'phantomjs' => array(\n//         'browser' => 'phantomjs',\n//         'tags' => '~@_file_upload&&~@_alert&&~@_bug_phantomjs',\n//         'wd_host' => 'http://127.0.0.1:4443/wd/hub',\n//         'capabilities' => array(\n//             'platform' => 'Linux',\n//             'version' => 2.1\n//         )\n//     ),\n// );\n//\n// You can force the browser session (not user's sessions) to restart after N seconds. This could\n// be useful if you are using a cloud-based service with time restrictions in the browser side.\n// Setting this value the browser session that Behat is using will be restarted. Set the time in\n// seconds. Is not recommended to use this setting if you don't explicitly need it.\n// Example:\n//   $CFG->behat_restart_browser_after = 7200;     // Restarts the browser session after 2 hours\n//\n// All this page's extra Moodle settings are compared against a white list of allowed settings\n// (the basic and behat_* ones) to avoid problems with production environments. This setting can be\n// used to expand the default white list with an array of extra settings.\n// Example:\n//   $CFG->behat_extraallowedsettings = array('somecoresetting', ...);\n//\n// You should explicitly allow the usage of the deprecated behat steps, otherwise an exception will\n// be thrown when using them. The setting is disabled by default.\n// Example:\n//   $CFG->behat_usedeprecated = true;\n//\n// Including feature files from directories outside the dirroot is possible if required. The setting\n// requires that the running user has executable permissions on all parent directories in the paths.\n// Example:\n//   $CFG->behat_additionalfeatures = array('/home/developer/code/wipfeatures');\n//\n// You can make behat save several dumps when a scenario fails. The dumps currently saved are:\n// * a dump of the DOM in it's state at the time of failure; and\n// * a screenshot (JavaScript is required for the screenshot functionality, so not all browsers support this option)\n// Example:\n//   $CFG->behat_faildump_path = '/my/path/to/save/failure/dumps';\n//\n// You can specify db, selenium wd_host etc. for behat parallel run by setting following variable.\n// Example:\n//   $CFG->behat_parallel_run = array (\n//       array (\n//           'dbtype' => 'mysqli',\n//           'dblibrary' => 'native',\n//           'dbhost' => 'localhost',\n//           'dbname' => 'moodletest',\n//           'dbuser' => 'moodle',\n//           'dbpass' => 'moodle',\n//           'behat_prefix' => 'mdl_',\n//           'wd_host' => 'http://127.0.0.1:4444/wd/hub',\n//           'behat_wwwroot' => 'http://127.0.0.1/moodle',\n//           'behat_dataroot' => '/home/example/bht_moodledata'\n//       ),\n//   );\n//\n// To change name of behat parallel run site, define BEHAT_PARALLEL_SITE_NAME and parallel run sites will be suffixed\n// with this value\n// Example:\n//   define('BEHAT_PARALLEL_SITE_NAME', 'behatparallelsite');\n//\n// Command line output for parallel behat install is limited to 80 chars, if you are installing more then 4 sites and\n// want to expand output to more then 80 chars, then define BEHAT_MAX_CMD_LINE_OUTPUT\n// Example:\n//   define('BEHAT_MAX_CMD_LINE_OUTPUT', 120);\n//\n// Behat feature files will be distributed randomly between the processes by default. If you have timing file or want\n// to create timing file then define BEHAT_FEATURE_TIMING_FILE with path to timing file. It will be updated for each\n// run with latest time taken to execute feature.\n// Example:\n//   define('BEHAT_FEATURE_TIMING_FILE', '/PATH_TO_TIMING_FILE/timing.json');\n//\n// If you don't have timing file and want some stable distribution of features, then you can use step counts to\n// distribute the features. You can generate step file by executing php admin/tool/behat/cli/util.php --updatesteps\n// this will update step file which is defined by BEHAT_FEATURE_STEP_FILE.\n// Example:\n//   define('BEHAT_FEATURE_STEP_FILE', '/PATH_TO_FEATURE_STEP_COUNT_FILE/stepcount.json');\n//\n// Feature distribution for each process is displayed as histogram. you can disable it by setting\n// BEHAT_DISABLE_HISTOGRAM\n// Example:\n//   define('BEHAT_DISABLE_HISTOGRAM', true);\n//\n//=========================================================================\n// 12. DEVELOPER DATA GENERATOR\n//=========================================================================\n//\n// The developer data generator tool is intended to be used only in development or testing sites and\n// it's usage in production environments is not recommended; if it is used to create JMeter test plans\n// is even less recommended as JMeter needs to log in as site course users. JMeter needs to know the\n// users passwords but would be dangerous to have a default password as everybody would know it, which would\n// be specially dangerouse if somebody uses this tool in a production site, so in order to prevent unintended\n// uses of the tool and undesired accesses as well, is compulsory to set a password for the users\n// generated by this tool, but only in case you want to generate a JMeter test. The value should be a string.\n// Example:\n//   $CFG->tool_generator_users_password = 'examplepassword';\n//\n//=========================================================================\n// 13. SYSTEM PATHS (You need to set following, depending on your system)\n//=========================================================================\n// Ghostscript path.\n// On most Linux installs, this can be left as '/usr/bin/gs'.\n// On Windows it will be something like 'c:\\gs\\bin\\gswin32c.exe' (make sure\n// there are no spaces in the path - if necessary copy the files 'gswin32c.exe'\n// and 'gsdll32.dll' to a new folder without a space in the path)\n//      $CFG->pathtogs = '/usr/bin/gs';\n//\n// Path to du.\n// Probably something like /usr/bin/du. If you enter this, pages that display\n// directory contents will run much faster for directories with a lot of files.\n//      $CFG->pathtodu = '';\n//\n// Path to aspell.\n// To use spell-checking within the editor, you MUST have aspell 0.50 or later\n// installed on your server, and you must specify the correct path to access the\n// aspell binary. On Unix/Linux systems, this path is usually /usr/bin/aspell,\n// but it might be something else.\n//      $CFG->aspellpath = '';\n//\n// Path to dot.\n// Probably something like /usr/bin/dot. To be able to generate graphics from\n// DOT files, you must have installed the dot executable and point to it here.\n// Note that, for now, this only used by the profiling features\n// (Development->Profiling) built into Moodle.\n//      $CFG->pathtodot = '';\n//\n// Path to unoconv.\n// Probably something like /usr/bin/unoconv. Used as a fallback to convert between document formats.\n// Unoconv is used convert between file formats supported by LibreOffice.\n// Use a recent version of unoconv ( >= 0.7 ), older versions have trouble running from a webserver.\n//      $CFG->pathtounoconv = '';\n//\n//=========================================================================\n// 14. ALTERNATIVE FILE SYSTEM SETTINGS\n//=========================================================================\n//\n// Alternative file system.\n// Since 3.3 it is possible to override file_storage and file_system API and use alternative storage systems (e.g. S3,\n// Rackspace Cloud Files, Google Cloud Storage, Azure Storage, etc.).\n// To set the alternative file storage system in config.php you can use the following setting, providing the\n// alternative system class name that will be auto-loaded by file_storage API.\n//\n//      $CFG->alternative_file_system_class = '\\\\local_myfilestorage\\\\file_system';\n//\n//=========================================================================\n// ALL DONE!  To continue installation, visit your main page with a browser\n//=========================================================================\n\nrequire_once(__DIR__ . '/lib/setup.php'); // Do not edit\n\n// There is no php closing tag in this file,\n// it is intentional because it prevents trailing whitespace problems!\n", "num_lines": 854}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Functions to support installation process\n *\n * @package    core\n * @subpackage install\n * @copyright  2009 Petr Skoda (http://skodak.org)\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefined('MOODLE_INTERNAL') || die();\n\n/** INSTALL_WELCOME = 0 */\ndefine('INSTALL_WELCOME',       0);\n/** INSTALL_ENVIRONMENT = 1 */\ndefine('INSTALL_ENVIRONMENT',   1);\n/** INSTALL_PATHS = 2 */\ndefine('INSTALL_PATHS',         2);\n/** INSTALL_DOWNLOADLANG = 3 */\ndefine('INSTALL_DOWNLOADLANG',  3);\n/** INSTALL_DATABASETYPE = 4 */\ndefine('INSTALL_DATABASETYPE',  4);\n/** INSTALL_DATABASE = 5 */\ndefine('INSTALL_DATABASE',      5);\n/** INSTALL_SAVE = 6 */\ndefine('INSTALL_SAVE',          6);\n\n/**\n * Tries to detect the right www root setting.\n * @return string detected www root\n */\nfunction install_guess_wwwroot() {\n    $wwwroot = '';\n    if (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off') {\n        $wwwroot .= 'http://';\n    } else {\n        $wwwroot .= 'https://';\n    }\n    $hostport = explode(':', $_SERVER['HTTP_HOST']);\n    $wwwroot .= reset($hostport);\n    if ($_SERVER['SERVER_PORT'] != 80 and $_SERVER['SERVER_PORT'] != '443') {\n        $wwwroot .= ':'.$_SERVER['SERVER_PORT'];\n    }\n    $wwwroot .= $_SERVER['SCRIPT_NAME'];\n\n    list($wwwroot, $xtra) = explode('/install.php', $wwwroot);\n\n    return $wwwroot;\n}\n\n/**\n * Copy of @see{ini_get_bool()}\n * @param string $ini_get_arg\n * @return bool\n */\nfunction install_ini_get_bool($ini_get_arg) {\n    $temp = ini_get($ini_get_arg);\n\n    if ($temp == '1' or strtolower($temp) == 'on') {\n        return true;\n    }\n    return false;\n}\n\n/**\n * Creates dataroot if not exists yet,\n * makes sure it is writable, add lang directory\n * and add .htaccess just in case it works.\n *\n * @param string $dataroot full path to dataroot\n * @param int $dirpermissions\n * @return bool success\n */\nfunction install_init_dataroot($dataroot, $dirpermissions) {\n    if (file_exists($dataroot) and !is_dir($dataroot)) {\n        // file with the same name exists\n        return false;\n    }\n\n    umask(0000); // $CFG->umaskpermissions is not set yet.\n    if (!file_exists($dataroot)) {\n        if (!mkdir($dataroot, $dirpermissions, true)) {\n            // most probably this does not work, but anyway\n            return false;\n        }\n    }\n    @chmod($dataroot, $dirpermissions);\n\n    if (!is_writable($dataroot)) {\n        return false; // we can not continue\n    }\n\n    // create the directory for $CFG->tempdir\n    if (!is_dir(\"$dataroot/temp\")) {\n        if (!mkdir(\"$dataroot/temp\", $dirpermissions, true)) {\n            return false;\n        }\n    }\n    if (!is_writable(\"$dataroot/temp\")) {\n        return false; // we can not continue\n    }\n\n    // create the directory for $CFG->cachedir\n    if (!is_dir(\"$dataroot/cache\")) {\n        if (!mkdir(\"$dataroot/cache\", $dirpermissions, true)) {\n            return false;\n        }\n    }\n    if (!is_writable(\"$dataroot/cache\")) {\n        return false; // we can not continue\n    }\n\n    // create the directory for $CFG->langotherroot\n    if (!is_dir(\"$dataroot/lang\")) {\n        if (!mkdir(\"$dataroot/lang\", $dirpermissions, true)) {\n            return false;\n        }\n    }\n    if (!is_writable(\"$dataroot/lang\")) {\n        return false; // we can not continue\n    }\n\n    // finally just in case some broken .htaccess that prevents access just in case it is allowed\n    if (!file_exists(\"$dataroot/.htaccess\")) {\n        if ($handle = fopen(\"$dataroot/.htaccess\", 'w')) {\n            fwrite($handle, \"deny from all\\r\\nAllowOverride None\\r\\nNote: this file is broken intentionally, we do not want anybody to undo it in subdirectory!\\r\\n\");\n            fclose($handle);\n        } else {\n            return false;\n        }\n    }\n\n    return true;\n}\n\n/**\n * Print help button\n * @param string $url\n * @param string $titel\n * @return void\n */\nfunction install_helpbutton($url, $title='') {\n    if ($title == '') {\n        $title = get_string('help');\n    }\n    echo \"<a href=\\\"javascript:void(0)\\\" \";\n    echo \"onclick=\\\"return window.open('$url','Help','menubar=0,location=0,scrollbars,resizable,width=500,height=400')\\\"\";\n    echo \">\";\n    echo \"<img src=\\\"pix/help.gif\\\" class=\\\"iconhelp\\\" alt=\\\"$title\\\" title=\\\"$title\\\"/>\";\n    echo \"</a>\\n\";\n}\n\n/**\n * This is in function because we want the /install.php to parse in PHP4\n *\n * @param object $database\n * @param string $dbhsot\n * @param string $dbuser\n * @param string $dbpass\n * @param string $dbname\n * @param string $prefix\n * @param mixed $dboptions\n * @return string\n */\nfunction install_db_validate($database, $dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions) {\n    try {\n        try {\n            $database->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions);\n        } catch (moodle_exception $e) {\n            // let's try to create new database\n            if ($database->create_database($dbhost, $dbuser, $dbpass, $dbname, $dboptions)) {\n                $database->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions);\n            } else {\n                throw $e;\n            }\n        }\n        return '';\n    } catch (dml_exception $ex) {\n        $stringmanager = get_string_manager();\n        $errorstring = $ex->errorcode.'oninstall';\n        $legacystring = $ex->errorcode;\n        if ($stringmanager->string_exists($errorstring, $ex->module)) {\n            // By using a different string id from the error code we are separating exception handling and output.\n            $returnstring = $stringmanager->get_string($errorstring, $ex->module, $ex->a);\n            if ($ex->debuginfo) {\n                $returnstring .= '<br />'.$ex->debuginfo;\n            }\n\n            return $returnstring;\n        } else if ($stringmanager->string_exists($legacystring, $ex->module)) {\n            // There are some DML exceptions that may be thrown here as well as during normal operation.\n            // If we have a translated message already we still want to serve it here.\n            // However it is not the preferred way.\n            $returnstring = $stringmanager->get_string($legacystring, $ex->module, $ex->a);\n            if ($ex->debuginfo) {\n                $returnstring .= '<br />'.$ex->debuginfo;\n            }\n\n            return $returnstring;\n        }\n        // No specific translation. Deliver a generic error message.\n        return $stringmanager->get_string('dmlexceptiononinstall', 'error', $ex);\n    }\n}\n\n/**\n * Returns content of config.php file.\n *\n * Uses PHP_EOL for generating proper end of lines for the given platform.\n *\n * @param moodle_database $database database instance\n * @param object $cfg copy of $CFG\n * @return string\n */\nfunction install_generate_configphp($database, $cfg) {\n    $configphp = '<?php  // Moodle configuration file' . PHP_EOL . PHP_EOL;\n\n    $configphp .= 'unset($CFG);' . PHP_EOL;\n    $configphp .= 'global $CFG;' . PHP_EOL;\n    $configphp .= '$CFG = new stdClass();' . PHP_EOL . PHP_EOL; // prevent PHP5 strict warnings\n\n    $dbconfig = $database->export_dbconfig();\n\n    foreach ($dbconfig as $key=>$value) {\n        $key = str_pad($key, 9);\n        $configphp .= '$CFG->'.$key.' = '.var_export($value, true) . ';' . PHP_EOL;\n    }\n    $configphp .= PHP_EOL;\n\n    $configphp .= '$CFG->wwwroot   = '.var_export($cfg->wwwroot, true) . ';' . PHP_EOL ;\n\n    $configphp .= '$CFG->dataroot  = '.var_export($cfg->dataroot, true) . ';' . PHP_EOL;\n\n    $configphp .= '$CFG->admin     = '.var_export($cfg->admin, true) . ';' . PHP_EOL . PHP_EOL;\n\n    if (empty($cfg->directorypermissions)) {\n        $chmod = '02777';\n    } else {\n        $chmod = '0' . decoct($cfg->directorypermissions);\n    }\n    $configphp .= '$CFG->directorypermissions = ' . $chmod . ';' . PHP_EOL . PHP_EOL;\n\n    if (isset($cfg->upgradekey) and $cfg->upgradekey !== '') {\n        $configphp .= '$CFG->upgradekey = ' . var_export($cfg->upgradekey, true) . ';' . PHP_EOL . PHP_EOL;\n    }\n    $configphp .= '$CFG->session_file_save_path = \\'/usr/local/php/tmp\\';'.PHP_EOL . PHP_EOL;\n    $configphp .= 'require_once(__DIR__ . \\'/lib/setup.php\\');' . PHP_EOL . PHP_EOL;\n    $configphp .= '// There is no php closing tag in this file,' . PHP_EOL;\n    $configphp .= '// it is intentional because it prevents trailing whitespace problems!' . PHP_EOL;\n\n    return $configphp;\n}\n\n/**\n * Prints complete help page used during installation.\n * Does not return.\n *\n * @global object\n * @param string $help\n */\nfunction install_print_help_page($help) {\n    global $CFG, $OUTPUT; //TODO: MUST NOT USE $OUTPUT HERE!!!\n\n    @header('Content-Type: text/html; charset=UTF-8');\n    @header('X-UA-Compatible: IE=edge');\n    @header('Cache-Control: no-store, no-cache, must-revalidate');\n    @header('Cache-Control: post-check=0, pre-check=0', false);\n    @header('Pragma: no-cache');\n    @header('Expires: Mon, 20 Aug 1969 09:23:00 GMT');\n    @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');\n\n    echo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">';\n    echo '<html dir=\"'.(right_to_left() ? 'rtl' : 'ltr').'\">\n          <head>\n          <link rel=\"shortcut icon\" href=\"theme/clean/pix/favicon.ico\" />\n          <link rel=\"stylesheet\" type=\"text/css\" href=\"'.$CFG->wwwroot.'/install/css.php\" />\n          <title>'.get_string('installation','install').'</title>\n          <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n          </head><body>';\n    switch ($help) {\n        case 'phpversionhelp':\n            print_string($help, 'install', phpversion());\n            break;\n        case 'memorylimithelp':\n            print_string($help, 'install', @ini_get('memory_limit'));\n            break;\n        default:\n            print_string($help, 'install');\n    }\n    echo $OUTPUT->close_window_button(); //TODO: MUST NOT USE $OUTPUT HERE!!!\n    echo '</body></html>';\n    die;\n}\n\n/**\n * Prints installation page header, we can no use weblib yet in installer.\n *\n * @global object\n * @param array $config\n * @param string $stagename\n * @param string $heading\n * @param string $stagetext\n * @param string $stageclass\n * @return void\n */\nfunction install_print_header($config, $stagename, $heading, $stagetext, $stageclass = \"alert-info\") {\n    global $CFG;\n\n    @header('Content-Type: text/html; charset=UTF-8');\n    @header('X-UA-Compatible: IE=edge');\n    @header('Cache-Control: no-store, no-cache, must-revalidate');\n    @header('Cache-Control: post-check=0, pre-check=0', false);\n    @header('Pragma: no-cache');\n    @header('Expires: Mon, 20 Aug 1969 09:23:00 GMT');\n    @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');\n\n    echo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">';\n    echo '<html dir=\"'.(right_to_left() ? 'rtl' : 'ltr').'\">\n          <head>\n          <link rel=\"shortcut icon\" href=\"theme/clean/pix/favicon.ico\" />';\n\n    echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.$CFG->wwwroot.'/install/css.php\" />\n          <title>'.get_string('installation','install').' - Moodle '.$CFG->target_release.'</title>\n          <meta name=\"robots\" content=\"noindex\">\n          <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n          <meta http-equiv=\"pragma\" content=\"no-cache\" />\n          <meta http-equiv=\"expires\" content=\"0\" />';\n\n    echo '</head><body class=\"notloggedin\">\n            <div id=\"page\" class=\"stage'.$config->stage.'\">\n                <div id=\"page-header\">\n                    <div id=\"header\" class=\" clearfix\">\n                        <h1 class=\"headermain\">'.get_string('installation','install').'</h1>\n                        <div class=\"headermenu\">&nbsp;</div>\n                    </div>\n                    <div class=\"navbar clearfix\">\n                        <nav class=\"breadcrumb-nav\">\n                            <ul class=\"breadcrumb\"><li class=\"first\">'.$stagename.'</li></ul>\n                        </nav>\n                        <div class=\"navbutton\">&nbsp;</div>\n                    </div>\n                </div>\n          <!-- END OF HEADER -->\n          <div id=\"installdiv\">';\n\n    echo '<h2>'.$heading.'</h2>';\n\n    if ($stagetext !== '') {\n        echo '<div class=\"alert ' . $stageclass . '\">';\n        echo $stagetext;\n        echo '</div>';\n    }\n    // main\n    echo '<form id=\"installform\" method=\"post\" action=\"install.php\"><fieldset>';\n    foreach ($config as $name=>$value) {\n        echo '<input type=\"hidden\" name=\"'.$name.'\" value=\"'.s($value).'\" />';\n    }\n}\n\n/**\n * Prints installation page header, we can no use weblib yet in isntaller.\n *\n * @global object\n * @param array $config\n * @param bool $reload print reload button instead of next\n * @return void\n */\nfunction install_print_footer($config, $reload=false) {\n    global $CFG;\n\n    if ($config->stage > INSTALL_WELCOME) {\n        $first = '<input type=\"submit\" id=\"previousbutton\" name=\"previous\" value=\"&laquo; '.s(get_string('previous')).'\" />';\n    } else {\n        $first = '<input type=\"submit\" id=\"previousbutton\" name=\"next\" value=\"'.s(get_string('reload')).'\" />';\n        $first .= '<script type=\"text/javascript\">\n//<![CDATA[\n    var first = document.getElementById(\"previousbutton\");\n    first.style.visibility = \"hidden\";\n//]]>\n</script>\n';\n    }\n\n    if ($reload) {\n        $next = '<input type=\"submit\" id=\"nextbutton\" class=\"btn btn-primary\" name=\"next\" value=\"'.s(get_string('reload')).'\" />';\n    } else {\n        $next = '<input type=\"submit\" id=\"nextbutton\" class=\"btn btn-primary\" name=\"next\" value=\"'.s(get_string('next')).' &raquo;\" />';\n    }\n\n    echo '</fieldset><fieldset id=\"nav_buttons\">'.$first.$next.'</fieldset>';\n\n    $homelink  = '<div class=\"sitelink\">'.\n       '<a title=\"Moodle '. $CFG->target_release .'\" href=\"http://docs.moodle.org/en/Administrator_documentation\" onclick=\"this.target=\\'_blank\\'\">'.\n       '<img src=\"pix/moodlelogo.png\" alt=\"'.get_string('moodlelogo').'\" /></a></div>';\n\n    echo '</form></div>';\n    echo '<div id=\"page-footer\">'.$homelink.'</div>';\n    echo '</div></body></html>';\n}\n\n/**\n * Install Moodle DB,\n * config.php must exist, there must not be any tables in db yet.\n *\n * @param array $options adminpass is mandatory\n * @param bool $interactive\n * @return void\n */\nfunction install_cli_database(array $options, $interactive) {\n    global $CFG, $DB;\n    require_once($CFG->libdir.'/environmentlib.php');\n    require_once($CFG->libdir.'/upgradelib.php');\n\n    // show as much debug as possible\n    @error_reporting(E_ALL | E_STRICT);\n    @ini_set('display_errors', '1');\n    $CFG->debug = (E_ALL | E_STRICT);\n    $CFG->debugdisplay = true;\n    $CFG->debugdeveloper = true;\n\n    $CFG->version = '';\n    $CFG->release = '';\n    $CFG->branch = '';\n\n    $version = null;\n    $release = null;\n    $branch = null;\n\n    // read $version and $release\n    require($CFG->dirroot.'/version.php');\n\n    if ($DB->get_tables() ) {\n        cli_error(get_string('clitablesexist', 'install'));\n    }\n\n    if (empty($options['adminpass'])) {\n        cli_error('Missing required admin password');\n    }\n\n    // test environment first\n    list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);\n    if (!$envstatus) {\n        $errors = environment_get_errors($environment_results);\n        cli_heading(get_string('environment', 'admin'));\n        foreach ($errors as $error) {\n            list($info, $report) = $error;\n            echo \"!! $info !!\\n$report\\n\\n\";\n        }\n        exit(1);\n    }\n\n    if (!$DB->setup_is_unicodedb()) {\n        if (!$DB->change_db_encoding()) {\n            // If could not convert successfully, throw error, and prevent installation\n            cli_error(get_string('unicoderequired', 'admin'));\n        }\n    }\n\n    if ($interactive) {\n        cli_separator();\n        cli_heading(get_string('databasesetup'));\n    }\n\n    // install core\n    install_core($version, true);\n    set_config('release', $release);\n    set_config('branch', $branch);\n\n    if (PHPUNIT_TEST) {\n        // mark as test database as soon as possible\n        set_config('phpunittest', 'na');\n    }\n\n    // install all plugins types, local, etc.\n    upgrade_noncore(true);\n\n    // set up admin user password\n    $DB->set_field('user', 'password', hash_internal_user_password($options['adminpass']), array('username' => 'admin'));\n\n    // Set the admin email address if specified.\n    if (isset($options['adminemail'])) {\n        $DB->set_field('user', 'email', $options['adminemail'], array('username' => 'admin'));\n    }\n\n    // rename admin username if needed\n    if (isset($options['adminuser']) and $options['adminuser'] !== 'admin' and $options['adminuser'] !== 'guest') {\n        $DB->set_field('user', 'username', $options['adminuser'], array('username' => 'admin'));\n    }\n\n    // indicate that this site is fully configured\n    set_config('rolesactive', 1);\n    upgrade_finished();\n\n    // log in as admin - we need do anything when applying defaults\n    \\core\\session\\manager::set_user(get_admin());\n\n    // apply all default settings, do it twice to fill all defaults - some settings depend on other setting\n    admin_apply_default_settings(NULL, true);\n    admin_apply_default_settings(NULL, true);\n    set_config('registerauth', '');\n\n    // set the site name\n    if (isset($options['shortname']) and $options['shortname'] !== '') {\n        $DB->set_field('course', 'shortname', $options['shortname'], array('format' => 'site'));\n    }\n    if (isset($options['fullname']) and $options['fullname'] !== '') {\n        $DB->set_field('course', 'fullname', $options['fullname'], array('format' => 'site'));\n    }\n    if (isset($options['summary'])) {\n        $DB->set_field('course', 'summary', $options['summary'], array('format' => 'site'));\n    }\n\n    // Redirect to site registration on first login.\n    set_config('registrationpending', 1);\n}\n", "num_lines": 532}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php  /// Moodle Configuration File \n\nunset($CFG);\nglobal $CFG;\n$CFG = new stdClass();\n//=========================================================================\n// 1. DATABASE SETUP\n//=========================================================================\n//GET database configuration from azure\n$connectstr_dbtype = ''; \n$connectstr_dbhost = '';\n$connectstr_dbname = '';\n$connectstr_dbusername = '';\n$connectstr_dbpassword = '';\n\n    $connectstr_dbtype = getenv('DATABASE_TYPE');\n    $connectstr_dbhost = getenv('DATABASE_HOST');\n    $connectstr_dbname = getenv('DATABASE_NAME');\n    $connectstr_dbusername = getenv('DATABASE_USERNAME');\n    $connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n$CFG->dbtype    = $connectstr_dbtype;\n$CFG->dblibrary = 'native';\n$CFG->dbhost    = $connectstr_dbhost;\n$CFG->dbname    = $connectstr_dbname;\n$CFG->dbuser    = $connectstr_dbusername;\n$CFG->dbpass    = $connectstr_dbpassword;\n$CFG->prefix    = 'mdl_';\n$CFG->dboptions = array (\n  'dbpersist' => false,\n  'dbsocket'  => false,\n  'dbport' => '',\n  'dbhandlesoptions' => false,\n  'dbcollation' => 'utf8mb4_unicode_ci',\n);\n\n//=========================================================================\n// 2. WEB SITE LOCATION\n//=========================================================================\n// Now you need to tell Moodle where it is located. Specify the full\n// web address to where moodle has been installed.  If your web site\n// is accessible via multiple URLs then choose the most natural one\n// that your students would use.  Do not include a trailing slash\n//\n// If you need both intranet and Internet access please read\n// http://docs.moodle.org/en/masquerading\n\n$CFG->wwwroot   = \"http://\".$_SERVER['HTTP_HOST'];\n//=========================================================================\n// 3. DATA FILES LOCATION\n//=========================================================================\n// Now you need a place where Moodle can save uploaded files.  This\n// directory should be readable AND WRITEABLE by the web server user\n// (usually 'nobody' or 'apache'), but it should not be accessible\n// directly via the web.\n//\n// - On hosting systems you might need to make sure that your \"group\" has\n//   no permissions at all, but that \"others\" have full permissions.\n//\n// - On Windows systems you might specify something like 'c:\\moodledata'\n\n$CFG->dataroot  = '/home/site/wwwroot/moodledata';\n\n\n//=========================================================================\n// 4. DATA FILES PERMISSIONS\n//=========================================================================\n// The following parameter sets the permissions of new directories\n// created by Moodle within the data directory.  The format is in\n// octal format (as used by the Unix utility chmod, for example).\n// The default is usually OK, but you may want to change it to 0750\n// if you are concerned about world-access to the files (you will need\n// to make sure the web server process (eg Apache) can access the files.\n// NOTE: the prefixed 0 is important, and don't use quotes.\n\n$CFG->directorypermissions = 0777;\n\n\n//=========================================================================\n// 5. DIRECTORY LOCATION  (most people can just ignore this setting)\n//=========================================================================\n// A very few webhosts use /admin as a special URL for you to access a\n// control panel or something.  Unfortunately this conflicts with the\n// standard location for the Moodle admin pages.  You can work around this\n// by renaming the admin directory in your installation, and putting that\n// new name here.  eg \"moodleadmin\".  This should fix all admin links in Moodle.\n// After any change you need to visit your new admin directory\n// and purge all caches.\n\n$CFG->admin = 'admin';\n\n\n//=========================================================================\n// 6. OTHER MISCELLANEOUS SETTINGS (ignore these for new installations)\n//=========================================================================\n//\n// These are additional tweaks for which no GUI exists in Moodle yet.\n//\n// Starting in PHP 5.3 administrators should specify default timezone\n// in PHP.ini, you can also specify it here if needed.\n// See details at: http://php.net/manual/en/function.date-default-timezone-set.php\n// List of time zones at: http://php.net/manual/en/timezones.php\n//     date_default_timezone_set('Australia/Perth');\n//\n// Change the key pair lifetime for Moodle Networking\n// The default is 28 days. You would only want to change this if the key\n// was not getting regenerated for any reason. You would probably want\n// make it much longer. Note that you'll need to delete and manually update\n// any existing key.\n//      $CFG->mnetkeylifetime = 28;\n//\n// Not recommended: Set the following to true to allow the use\n// off non-Moodle standard characters in usernames.\n//      $CFG->extendedusernamechars = true;\n//\n// Allow user passwords to be included in backup files. Very dangerous\n// setting as far as it publishes password hashes that can be unencrypted\n// if the backup file is publicy available. Use it only if you can guarantee\n// that all your backup files remain only privacy available and are never\n// shared out from your site/institution!\n//      $CFG->includeuserpasswordsinbackup = true;\n//\n// Completely disable user creation when restoring a course, bypassing any\n// permissions granted via roles and capabilities. Enabling this setting\n// results in the restore process stopping when a user attempts to restore a\n// course requiring users to be created.\n//     $CFG->disableusercreationonrestore = true;\n//\n// Keep the temporary directories used by backup and restore without being\n// deleted at the end of the process. Use it if you want to debug / view\n// all the information stored there after the process has ended. Note that\n// those directories may be deleted (after some ttl) both by cron and / or\n// by new backup / restore invocations.\n//     $CFG->keeptempdirectoriesonbackup = true;\n//\n// Modify the restore process in order to force the \"user checks\" to assume\n// that the backup originated from a different site, so detection of matching\n// users is performed with different (more \"relaxed\") rules. Note that this is\n// only useful if the backup file has been created using Moodle < 1.9.4 and the\n// site has been rebuilt from scratch using backup files (not the best way btw).\n// If you obtain user conflicts on restore, rather than enabling this setting\n// permanently, try restoring the backup on a different site, back it up again\n// and then restore on the target server.\n//    $CFG->forcedifferentsitecheckingusersonrestore = true;\n//\n// Force the backup system to continue to create backups in the legacy zip\n// format instead of the new tgz format. Does not affect restore, which\n// auto-detects the underlying file format.\n//    $CFG->usezipbackups = true;\n//\n// Prevent stats processing and hide the GUI\n//      $CFG->disablestatsprocessing = true;\n//\n// Setting this to true will enable admins to edit any post at any time\n//      $CFG->admineditalways = true;\n//\n// These variables define DEFAULT block variables for new courses\n// If this one is set it overrides all others and is the only one used.\n//      $CFG->defaultblocks_override = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// These variables define the specific settings for defined course formats.\n// They override any settings defined in the formats own config file.\n//      $CFG->defaultblocks_site = 'site_main_menu,course_list:course_summary,calendar_month';\n//      $CFG->defaultblocks_social = 'participants,search_forums,calendar_month,calendar_upcoming,social_activities,recent_activity,course_list';\n//      $CFG->defaultblocks_topics = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//      $CFG->defaultblocks_weeks = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// These blocks are used when no other default setting is found.\n//      $CFG->defaultblocks = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// You can specify a different class to be created for the $PAGE global, and to\n// compute which blocks appear on each page. However, I cannot think of any good\n// reason why you would need to change that. It just felt wrong to hard-code the\n// the class name. You are strongly advised not to use these to settings unless\n// you are absolutely sure you know what you are doing.\n//      $CFG->moodlepageclass = 'moodle_page';\n//      $CFG->moodlepageclassfile = \"$CFG->dirroot/local/myplugin/mypageclass.php\";\n//      $CFG->blockmanagerclass = 'block_manager';\n//      $CFG->blockmanagerclassfile = \"$CFG->dirroot/local/myplugin/myblockamanagerclass.php\";\n//\n// Seconds for files to remain in caches. Decrease this if you are worried\n// about students being served outdated versions of uploaded files.\n//     $CFG->filelifetime = 60*60*6;\n//\n// Some web servers can offload the file serving from PHP process,\n// comment out one the following options to enable it in Moodle:\n//     $CFG->xsendfile = 'X-Sendfile';           // Apache {@see https://tn123.org/mod_xsendfile/}\n//     $CFG->xsendfile = 'X-LIGHTTPD-send-file'; // Lighttpd {@see http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file}\n//     $CFG->xsendfile = 'X-Accel-Redirect';     // Nginx {@see http://wiki.nginx.org/XSendfile}\n// If your X-Sendfile implementation (usually Nginx) uses directory aliases specify them\n// in the following array setting:\n//     $CFG->xsendfilealiases = array(\n//         '/dataroot/' => $CFG->dataroot,\n//         '/cachedir/' => '/var/www/moodle/cache',    // for custom $CFG->cachedir locations\n//         '/localcachedir/' => '/var/local/cache',    // for custom $CFG->localcachedir locations\n//         '/tempdir/'  => '/var/www/moodle/temp',     // for custom $CFG->tempdir locations\n//         '/filedir'   => '/var/www/moodle/filedir',  // for custom $CFG->filedir locations\n//     );\n//\n// YUI caching may be sometimes improved by slasharguments:\n//     $CFG->yuislasharguments = 1;\n// Some servers may need a special rewrite rule to work around internal path length limitations:\n// RewriteRule (^.*/theme/yui_combo\\.php)(/.*) $1?file=$2\n//\n//\n// Following settings may be used to select session driver, uncomment only one of the handlers.\n//   Database session handler (not compatible with MyISAM):\n//      $CFG->session_handler_class = '\\core\\session\\database';\n//      $CFG->session_database_acquire_lock_timeout = 120;\n//\n//   File session handler (file system locking required):\n//      $CFG->session_handler_class = '\\core\\session\\file';\n//      $CFG->session_file_save_path = $CFG->dataroot.'/sessions';\n$CFG->session_file_save_path = '/usr/local/php/tmp';\n//\n//   Memcached session handler (requires memcached server and extension):\n//      $CFG->session_handler_class = '\\core\\session\\memcached';\n//      $CFG->session_memcached_save_path = '127.0.0.1:11211';\n//      $CFG->session_memcached_prefix = 'memc.sess.key.';\n//      $CFG->session_memcached_acquire_lock_timeout = 120;\n//      $CFG->session_memcached_lock_expire = 7200;       // Ignored if PECL memcached is below version 2.2.0\n//      $CFG->session_memcached_lock_retry_sleep = 150;   // Spin-lock retry sleeptime (msec). Only effective\n//                                                        // for tuning php-memcached 3.0.x (PHP 7)\n//\n//   Redis session handler (requires redis server and redis extension):\n//      $CFG->session_handler_class = '\\core\\session\\redis';\n//      $CFG->session_redis_host = '127.0.0.1';\n//      $CFG->session_redis_port = 6379;  // Optional.\n//      $CFG->session_redis_database = 0;  // Optional, default is db 0.\n//      $CFG->session_redis_auth = ''; // Optional, default is don't set one.\n//      $CFG->session_redis_prefix = ''; // Optional, default is don't set one.\n//      $CFG->session_redis_acquire_lock_timeout = 120;\n//      $CFG->session_redis_lock_expire = 7200;\n//      Use the igbinary serializer instead of the php default one. Note that phpredis must be compiled with\n//      igbinary support to make the setting to work. Also, if you change the serializer you have to flush the database!\n//      $CFG->session_redis_serializer_use_igbinary = false; // Optional, default is PHP builtin serializer.\n//\n//   Memcache session handler (requires memcached server and memcache extension):\n//      $CFG->session_handler_class = '\\core\\session\\memcache';\n//      $CFG->session_memcache_save_path = '127.0.0.1:11211';\n//      $CFG->session_memcache_acquire_lock_timeout = 120;\n//      ** NOTE: Memcache extension has less features than memcached and may be\n//         less reliable. Use memcached where possible or if you encounter\n//         session problems. **\n//\n// Please be aware that when selecting either Memcached or Memcache for sessions that it is advised to use a dedicated\n// memcache server. The memcache and memcached extensions do not provide isolated environments for individual uses.\n// Using the same server for other purposes (MUC for example) can lead to sessions being prematurely removed should\n// the other uses of the server purge the cache.\n//\n// Following setting allows you to alter how frequently is timemodified updated in sessions table.\n//      $CFG->session_update_timemodified_frequency = 20; // In seconds.\n//\n// If this setting is set to true, then Moodle will track the IP of the\n// current user to make sure it hasn't changed during a session.  This\n// will prevent the possibility of sessions being hijacked via XSS, but it\n// may break things for users coming using proxies that change all the time,\n// like AOL.\n//      $CFG->tracksessionip = true;\n//\n// The following lines are for handling email bounces.\n//      $CFG->handlebounces = true;\n//      $CFG->minbounces = 10;\n//      $CFG->bounceratio = .20;\n// The next lines are needed both for bounce handling and any other email to module processing.\n// mailprefix must be EXACTLY four characters.\n// Uncomment and customise this block for Postfix\n//      $CFG->mailprefix = 'mdl+'; // + is the separator for Exim and Postfix.\n//      $CFG->mailprefix = 'mdl-'; // - is the separator for qmail\n//      $CFG->maildomain = 'youremaildomain.com';\n//\n// Enable when setting up advanced reverse proxy load balancing configurations,\n// it may be also necessary to enable this when using port forwarding.\n//      $CFG->reverseproxy = true;\n//\n// Enable when using external SSL appliance for performance reasons.\n// Please note that site may be accessible via http: or https:, but not both!\n//      $CFG->sslproxy = true;\n//\n// This setting will cause the userdate() function not to fix %d in\n// date strings, and just let them show with a zero prefix.\n//      $CFG->nofixday = true;\n//\n// This setting will make some graphs (eg user logs) use lines instead of bars\n//      $CFG->preferlinegraphs = true;\n//\n// This setting allows you to specify a class to rewrite outgoing urls\n// enabling 'clean urls' in conjunction with an apache / nginx handler.\n// The handler must implement \\core\\output\\url_rewriter.\n//      $CFG->urlrewriteclass = '\\local_cleanurls\\url_rewriter';\n//\n// Enabling this will allow custom scripts to replace existing moodle scripts.\n// For example: if $CFG->customscripts/course/view.php exists then\n// it will be used instead of $CFG->wwwroot/course/view.php\n// At present this will only work for files that include config.php and are called\n// as part of the url (index.php is implied).\n// Some examples are:\n//      http://my.moodle.site/course/view.php\n//      http://my.moodle.site/index.php\n//      http://my.moodle.site/admin            (index.php implied)\n// Custom scripts should not include config.php\n// Warning: Replacing standard moodle scripts may pose security risks and/or may not\n// be compatible with upgrades. Use this option only if you are aware of the risks\n// involved.\n// Specify the full directory path to the custom scripts\n//      $CFG->customscripts = '/home/example/customscripts';\n//\n// Performance profiling\n//\n//   If you set Debug to \"Yes\" in the Configuration->Variables page some\n//   performance profiling data will show up on your footer (in default theme).\n//   With these settings you get more granular control over the capture\n//   and printout of the data\n//\n//   Capture performance profiling data\n//   define('MDL_PERF'  , true);\n//\n//   Capture additional data from DB\n//   define('MDL_PERFDB'  , true);\n//\n//   Print to log (for passive profiling of production servers)\n//   define('MDL_PERFTOLOG'  , true);\n//\n//   Print to footer (works with the default theme)\n//   define('MDL_PERFTOFOOT', true);\n//\n//   Enable earlier profiling that causes more code to be covered\n//   on every request (db connections, config load, other inits...).\n//   Requires extra configuration to be defined in config.php like:\n//   profilingincluded, profilingexcluded, profilingautofrec,\n//   profilingallowme, profilingallowall, profilinglifetime\n//       $CFG->earlyprofilingenabled = true;\n//\n// Force displayed usernames\n//   A little hack to anonymise user names for all students.  If you set these\n//   then all non-teachers will always see these for every person.\n//       $CFG->forcefirstname = 'Bruce';\n//       $CFG->forcelastname  = 'Simpson';\n//\n// The following setting will turn on username logging into Apache log. For full details regarding setting\n// up of this function please refer to the install section of the document.\n//     $CFG->apacheloguser = 0; // Turn this feature off. Default value.\n//     $CFG->apacheloguser = 1; // Log user id.\n//     $CFG->apacheloguser = 2; // Log full name in cleaned format. ie, Darth Vader will be displayed as darth_vader.\n//     $CFG->apacheloguser = 3; // Log username.\n// To get the values logged in Apache's log, add to your httpd.conf\n// the following statements. In the General part put:\n//     LogFormat \"%h %l %{MOODLEUSER}n %t \\\"%r\\\" %s %b \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" moodleformat\n// And in the part specific to your Moodle install / virtualhost:\n//     CustomLog \"/your/path/to/log\" moodleformat\n//\n// Alternatively for other webservers such as nginx, you can instead have the username sent via a http header\n// 'X-MOODLEUSER' which can be saved in the logfile and then stripped out before being sent to the browser:\n//     $CFG->headerloguser = 0; // Turn this feature off. Default value.\n//     $CFG->headerloguser = 1; // Log user id.\n//     $CFG->headerloguser = 2; // Log full name in cleaned format. ie, Darth Vader will be displayed as darth_vader.\n//     $CFG->headerloguser = 3; // Log username.\n//\n// CAUTION: Use of this option will expose usernames in the Apache / nginx log,\n// If you are going to publish your log, or the output of your web stats analyzer\n// this will weaken the security of your website.\n//\n// Email database connection errors to someone.  If Moodle cannot connect to the\n// database, then email this address with a notice.\n//\n//     $CFG->emailconnectionerrorsto = 'your@emailaddress.com';\n//\n// Set the priority of themes from highest to lowest. This is useful (for\n// example) in sites where the user theme should override all other theme\n// settings for accessibility reasons. You can also disable types of themes\n// (other than site)  by removing them from the array. The default setting is:\n//\n//     $CFG->themeorder = array('course', 'category', 'session', 'user', 'cohort', 'site');\n//\n// NOTE: course, category, session, user, cohort themes still require the\n// respective settings to be enabled\n//\n// It is possible to add extra themes directory stored outside of $CFG->dirroot.\n// This local directory does not have to be accessible from internet.\n//\n//     $CFG->themedir = '/location/of/extra/themes';\n//\n// It is possible to specify different cache and temp directories, use local fast filesystem\n// for normal web servers. Server clusters MUST use shared filesystem for cachedir!\n// Localcachedir is intended for server clusters, it does not have to be shared by cluster nodes.\n// The directories must not be accessible via web.\n//\n//     $CFG->tempdir = '/var/www/moodle/temp';        // Directory MUST BE SHARED by all cluster nodes.\n//     $CFG->cachedir = '/var/www/moodle/cache';      // Directory MUST BE SHARED by all cluster nodes, locking required.\n//     $CFG->localcachedir = '/var/local/cache';      // Intended for local node caching.\n//\n// It is possible to specify a different backup temp directory, use local fast filesystem\n// for normal web servers. Server clusters MUST use shared filesystem for backuptempdir!\n// The directory must not be accessible via web.\n//\n//     $CFG->backuptempdir = '/var/www/moodle/backuptemp';  // Directory MUST BE SHARED by all cluster nodes.\n//\n// Some filesystems such as NFS may not support file locking operations.\n// Locking resolves race conditions and is strongly recommended for production servers.\n//     $CFG->preventfilelocking = false;\n//\n// Site default language can be set via standard administration interface. If you\n// want to have initial error messages for eventual database connection problems\n// localized too, you have to set your language code here.\n//\n//     $CFG->lang = 'yourlangcode'; // for example 'cs'\n//\n// When Moodle is about to perform an intensive operation it raises PHP's memory\n// limit. The following setting should be used on large sites to set the raised\n// memory limit to something higher.\n// The value for the settings should be a valid PHP memory value. e.g. 512M, 1G\n//\n//     $CFG->extramemorylimit = '1024M';\n//\n// Moodle 2.4 introduced a new cache API.\n// The cache API stores a configuration file within the Moodle data directory and\n// uses that rather than the database in order to function in a stand-alone manner.\n// Using altcacheconfigpath you can change the location where this config file is\n// looked for.\n// It can either be a directory in which to store the file, or the full path to the\n// file if you want to take full control. Either way it must be writable by the\n// webserver.\n//\n//     $CFG->altcacheconfigpath = '/var/www/shared/moodle.cache.config.php\n//\n// Use the following flag to completely disable the Available update notifications\n// feature and hide it from the server administration UI.\n//\n//      $CFG->disableupdatenotifications = true;\n//\n// Use the following flag to completely disable the installation of plugins\n// (new plugins, available updates and missing dependencies) and related\n// features (such as cancelling the plugin installation or upgrade) via the\n// server administration web interface.\n//\n//      $CFG->disableupdateautodeploy = true;\n//\n// Use the following flag to disable the warning on the system notifications page\n// about present development libraries. This flag will not disable the warning within\n// the security overview report. Use this flag only if you really have prohibited web\n// access to the development libraries in your webserver configuration.\n//\n//      $CFG->disabledevlibdirscheck = true;\n//\n// Use the following flag to disable modifications to scheduled tasks\n// whilst still showing the state of tasks.\n//\n//      $CFG->preventscheduledtaskchanges = true;\n//\n// As of version 2.4 Moodle serves icons as SVG images if the users browser appears\n// to support SVG.\n// For those wanting to control the serving of SVG images the following setting can\n// be defined in your config.php.\n// If it is not defined then the default (browser detection) will occur.\n//\n// To ensure they are always used when available:\n//      $CFG->svgicons = true;\n//\n// To ensure they are never used even when available:\n//      $CFG->svgicons = false;\n//\n// Some administration options allow setting the path to executable files. This can\n// potentially cause a security risk. Set this option to true to disable editing\n// those config settings via the web. They will need to be set explicitly in the\n// config.php file\n//      $CFG->preventexecpath = true;\n//\n// Use the following flag to set userid for noreply user. If not set then moodle will\n// create dummy user and use -ve value as user id.\n//      $CFG->noreplyuserid = -10;\n//\n// As of version 2.6 Moodle supports admin to set support user. If not set, all mails\n// will be sent to supportemail.\n//      $CFG->supportuserid = -20;\n//\n// Moodle 2.7 introduces a locking api for critical tasks (e.g. cron).\n// The default locking system to use is DB locking for Postgres, and file locking for\n// MySQL, Oracle and SQLServer. If $CFG->preventfilelocking is set, then the default\n// will always be DB locking. It can be manually set to one of the lock\n// factory classes listed below, or one of your own custom classes implementing the\n// \\core\\lock\\lock_factory interface.\n//\n//      $CFG->lock_factory = \"auto\";\n//\n// The list of available lock factories is:\n//\n// \"\\\\core\\\\lock\\\\file_lock_factory\" - File locking\n//      Uses lock files stored by default in the dataroot. Whether this\n//      works on clusters depends on the file system used for the dataroot.\n//\n// \"\\\\core\\\\lock\\\\db_record_lock_factory\" - DB locking based on table rows.\n//\n// \"\\\\core\\\\lock\\\\postgres_lock_factory\" - DB locking based on postgres advisory locks.\n//\n// Settings used by the lock factories\n//\n// Location for lock files used by the File locking factory. This must exist\n// on a shared file system that supports locking.\n//      $CFG->lock_file_root = $CFG->dataroot . '/lock';\n//\n// Moodle 2.9 allows administrators to customise the list of supported file types.\n// To add a new filetype or override the definition of an existing one, set the\n// customfiletypes variable like this:\n//\n// $CFG->customfiletypes = array(\n//     (object)array(\n//         'extension' => 'frog',\n//         'icon' => 'archive',\n//         'type' => 'application/frog',\n//         'customdescription' => 'Amphibian-related file archive'\n//     )\n// );\n//\n// The extension, icon, and type fields are required. The icon field can refer to\n// any icon inside the pix/f folder. You can also set the customdescription field\n// (shown above) and (for advanced use) the groups, string, and defaulticon fields.\n//\n// Upgrade key\n//\n// If the upgrade key is defined here, then the value must be provided every time\n// the site is being upgraded though the web interface, regardless of whether the\n// administrator is logged in or not. This prevents anonymous access to the upgrade\n// screens where the real authentication and authorization mechanisms can not be\n// relied on.\n//\n// It is strongly recommended to use a value different from your real account\n// password.\n//\n//      $CFG->upgradekey = 'put_some_password-like_value_here';\n//\n//=========================================================================\n// 7. SETTINGS FOR DEVELOPMENT SERVERS - not intended for production use!!!\n//=========================================================================\n//\n// Force a debugging mode regardless the settings in the site administration\n @error_reporting(E_ALL); // NOT FOR PRODUCTION SERVERS!\n @ini_set('display_errors', '1');    // NOT FOR PRODUCTION SERVERS!\n $CFG->debug = (E_ALL);   // === DEBUG_DEVELOPER - NOT FOR PRODUCTION SERVERS!\n $CFG->debugdisplay = 1;             // NOT FOR PRODUCTION SERVERS!\n//\n// You can specify a comma separated list of user ids that that always see\n// debug messages, this overrides the debug flag in $CFG->debug and $CFG->debugdisplay\n// for these users only.\n// $CFG->debugusers = '2';\n//\n// Prevent theme caching\n// $CFG->themedesignermode = true; // NOT FOR PRODUCTION SERVERS!\n//\n// Enable verbose debug information during fetching of email messages from IMAP server.\n// $CFG->debugimap = true;\n//\n// Prevent JS caching\n// $CFG->cachejs = false; // NOT FOR PRODUCTION SERVERS!\n//\n// Restrict which YUI logging statements are shown in the browser console.\n// For details see the upstream documentation:\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logInclude\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logExclude\n// $CFG->yuiloginclude = array(\n//     'moodle-core-dock-loader' => true,\n//     'moodle-course-categoryexpander' => true,\n// );\n// $CFG->yuilogexclude = array(\n//     'moodle-core-dock' => true,\n//     'moodle-core-notification' => true,\n// );\n//\n// Set the minimum log level for YUI logging statements.\n// For details see the upstream documentation:\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logLevel\n// $CFG->yuiloglevel = 'debug';\n//\n// Prevent core_string_manager application caching\n// $CFG->langstringcache = false; // NOT FOR PRODUCTION SERVERS!\n//\n// When working with production data on test servers, no emails or other messages\n// should ever be send to real users\n// $CFG->noemailever = true;    // NOT FOR PRODUCTION SERVERS!\n//\n// Divert all outgoing emails to this address to test and debug emailing features\n// $CFG->divertallemailsto = 'root@localhost.local'; // NOT FOR PRODUCTION SERVERS!\n//\n// Except for certain email addresses you want to let through for testing. Accepts\n// a comma separated list of regexes.\n// $CFG->divertallemailsexcept = 'tester@dev.com, fred(\\+.*)?@example.com'; // NOT FOR PRODUCTION SERVERS!\n//\n// Uncomment if you want to allow empty comments when modifying install.xml files.\n// $CFG->xmldbdisablecommentchecking = true;    // NOT FOR PRODUCTION SERVERS!\n//\n// Since 2.0 sql queries are not shown during upgrade by default.\n// Please note that this setting may produce very long upgrade page on large sites.\n// $CFG->upgradeshowsql = true; // NOT FOR PRODUCTION SERVERS!\n//\n// Add SQL queries to the output of cron, just before their execution\n// $CFG->showcronsql = true;\n//\n// Force developer level debug and add debug info to the output of cron\n// $CFG->showcrondebugging = true;\n//\n//=========================================================================\n// 8. FORCED SETTINGS\n//=========================================================================\n// It is possible to specify normal admin settings here, the point is that\n// they can not be changed through the standard admin settings pages any more.\n//\n// Core settings are specified directly via assignment to $CFG variable.\n// Example:\n//   $CFG->somecoresetting = 'value';\n//\n// Plugin settings have to be put into a special array.\n// Example:\n//   $CFG->forced_plugin_settings = array('pluginname'  => array('settingname' => 'value', 'secondsetting' => 'othervalue'),\n//                                        'otherplugin' => array('mysetting' => 'myvalue', 'thesetting' => 'thevalue'));\n// Module default settings with advanced/locked checkboxes can be set too. To do this, add\n// an extra config with '_adv' or '_locked' as a suffix and set the value to true or false.\n// Example:\n//   $CFG->forced_plugin_settings = array('pluginname'  => array('settingname' => 'value', 'settingname_locked' => true, 'settingname_adv' => true));\n//\n//=========================================================================\n// 9. PHPUNIT SUPPORT\n//=========================================================================\n// $CFG->phpunit_prefix = 'phpu_';\n// $CFG->phpunit_dataroot = '/home/example/phpu_moodledata';\n// $CFG->phpunit_directorypermissions = 02777; // optional\n// $CFG->phpunit_profilingenabled = true; // optional to profile PHPUnit runs.\n//\n//\n//=========================================================================\n// 10. SECRET PASSWORD SALT\n//=========================================================================\n// A site-wide password salt is no longer used in new installations.\n// If upgrading from 2.6 or older, keep all existing salts in config.php file.\n//\n// $CFG->passwordsaltmain = 'a_very_long_random_string_of_characters#@6&*1';\n//\n// You may also have some alternative salts to allow migration from previously\n// used salts.\n//\n// $CFG->passwordsaltalt1 = '';\n// $CFG->passwordsaltalt2 = '';\n// $CFG->passwordsaltalt3 = '';\n// ....\n// $CFG->passwordsaltalt19 = '';\n// $CFG->passwordsaltalt20 = '';\n//\n//\n//=========================================================================\n// 11. BEHAT SUPPORT\n//=========================================================================\n// Behat test site needs a unique www root, data directory and database prefix:\n//\n// $CFG->behat_wwwroot = 'http://127.0.0.1/moodle';\n// $CFG->behat_prefix = 'bht_';\n// $CFG->behat_dataroot = '/home/example/bht_moodledata';\n//\n// You can override default Moodle configuration for Behat and add your own\n// params; here you can add more profiles, use different Mink drivers than Selenium...\n// These params would be merged with the default Moodle behat.yml, giving priority\n// to the ones specified here. The array format is YAML, following the Behat\n// params hierarchy. More info: http://docs.behat.org/guides/7.config.html\n// Example:\n//   $CFG->behat_config = array(\n//       'Mac-Firefox' => array(\n//           'suites' => array (\n//               'default' => array(\n//                   'filters' => array(\n//                      'tags' => '~@_file_upload'\n//                   ),\n//               ),\n//           ),\n//           'extensions' => array(\n//               'Behat\\MinkExtension' => array(\n//                   'selenium2' => array(\n//                       'browser' => 'firefox',\n//                       'capabilities' => array(\n//                           'platform' => 'OS X 10.6',\n//                           'version' => 20\n//                       )\n//                   )\n//               )\n//           )\n//       ),\n//       'Mac-Safari' => array(\n//           'extensions' => array(\n//               'Behat\\MinkExtension' => array(\n//                   'selenium2' => array(\n//                       'browser' => 'safari',\n//                       'capabilities' => array(\n//                           'platform' => 'OS X 10.8',\n//                           'version' => 6\n//                       )\n//                   )\n//               )\n//           )\n//       )\n//   );\n// You can also use the following config to override default Moodle configuration for Behat.\n// This config is limited to default suite and will be supported in later versions.\n// It will have precedence over $CFG->behat_config.\n// $CFG->behat_profiles = array(\n//     'phantomjs' => array(\n//         'browser' => 'phantomjs',\n//         'tags' => '~@_file_upload&&~@_alert&&~@_bug_phantomjs',\n//         'wd_host' => 'http://127.0.0.1:4443/wd/hub',\n//         'capabilities' => array(\n//             'platform' => 'Linux',\n//             'version' => 2.1\n//         )\n//     ),\n// );\n//\n// You can force the browser session (not user's sessions) to restart after N seconds. This could\n// be useful if you are using a cloud-based service with time restrictions in the browser side.\n// Setting this value the browser session that Behat is using will be restarted. Set the time in\n// seconds. Is not recommended to use this setting if you don't explicitly need it.\n// Example:\n//   $CFG->behat_restart_browser_after = 7200;     // Restarts the browser session after 2 hours\n//\n// All this page's extra Moodle settings are compared against a white list of allowed settings\n// (the basic and behat_* ones) to avoid problems with production environments. This setting can be\n// used to expand the default white list with an array of extra settings.\n// Example:\n//   $CFG->behat_extraallowedsettings = array('somecoresetting', ...);\n//\n// You should explicitly allow the usage of the deprecated behat steps, otherwise an exception will\n// be thrown when using them. The setting is disabled by default.\n// Example:\n//   $CFG->behat_usedeprecated = true;\n//\n// Including feature files from directories outside the dirroot is possible if required. The setting\n// requires that the running user has executable permissions on all parent directories in the paths.\n// Example:\n//   $CFG->behat_additionalfeatures = array('/home/developer/code/wipfeatures');\n//\n// You can make behat save several dumps when a scenario fails. The dumps currently saved are:\n// * a dump of the DOM in it's state at the time of failure; and\n// * a screenshot (JavaScript is required for the screenshot functionality, so not all browsers support this option)\n// Example:\n//   $CFG->behat_faildump_path = '/my/path/to/save/failure/dumps';\n//\n// You can specify db, selenium wd_host etc. for behat parallel run by setting following variable.\n// Example:\n//   $CFG->behat_parallel_run = array (\n//       array (\n//           'dbtype' => 'mysqli',\n//           'dblibrary' => 'native',\n//           'dbhost' => 'localhost',\n//           'dbname' => 'moodletest',\n//           'dbuser' => 'moodle',\n//           'dbpass' => 'moodle',\n//           'behat_prefix' => 'mdl_',\n//           'wd_host' => 'http://127.0.0.1:4444/wd/hub',\n//           'behat_wwwroot' => 'http://127.0.0.1/moodle',\n//           'behat_dataroot' => '/home/example/bht_moodledata'\n//       ),\n//   );\n//\n// To change name of behat parallel run site, define BEHAT_PARALLEL_SITE_NAME and parallel run sites will be suffixed\n// with this value\n// Example:\n//   define('BEHAT_PARALLEL_SITE_NAME', 'behatparallelsite');\n//\n// Command line output for parallel behat install is limited to 80 chars, if you are installing more then 4 sites and\n// want to expand output to more then 80 chars, then define BEHAT_MAX_CMD_LINE_OUTPUT\n// Example:\n//   define('BEHAT_MAX_CMD_LINE_OUTPUT', 120);\n//\n// Behat feature files will be distributed randomly between the processes by default. If you have timing file or want\n// to create timing file then define BEHAT_FEATURE_TIMING_FILE with path to timing file. It will be updated for each\n// run with latest time taken to execute feature.\n// Example:\n//   define('BEHAT_FEATURE_TIMING_FILE', '/PATH_TO_TIMING_FILE/timing.json');\n//\n// If you don't have timing file and want some stable distribution of features, then you can use step counts to\n// distribute the features. You can generate step file by executing php admin/tool/behat/cli/util.php --updatesteps\n// this will update step file which is defined by BEHAT_FEATURE_STEP_FILE.\n// Example:\n//   define('BEHAT_FEATURE_STEP_FILE', '/PATH_TO_FEATURE_STEP_COUNT_FILE/stepcount.json');\n//\n// Feature distribution for each process is displayed as histogram. you can disable it by setting\n// BEHAT_DISABLE_HISTOGRAM\n// Example:\n//   define('BEHAT_DISABLE_HISTOGRAM', true);\n//\n//=========================================================================\n// 12. DEVELOPER DATA GENERATOR\n//=========================================================================\n//\n// The developer data generator tool is intended to be used only in development or testing sites and\n// it's usage in production environments is not recommended; if it is used to create JMeter test plans\n// is even less recommended as JMeter needs to log in as site course users. JMeter needs to know the\n// users passwords but would be dangerous to have a default password as everybody would know it, which would\n// be specially dangerouse if somebody uses this tool in a production site, so in order to prevent unintended\n// uses of the tool and undesired accesses as well, is compulsory to set a password for the users\n// generated by this tool, but only in case you want to generate a JMeter test. The value should be a string.\n// Example:\n//   $CFG->tool_generator_users_password = 'examplepassword';\n//\n//=========================================================================\n// 13. SYSTEM PATHS (You need to set following, depending on your system)\n//=========================================================================\n// Ghostscript path.\n// On most Linux installs, this can be left as '/usr/bin/gs'.\n// On Windows it will be something like 'c:\\gs\\bin\\gswin32c.exe' (make sure\n// there are no spaces in the path - if necessary copy the files 'gswin32c.exe'\n// and 'gsdll32.dll' to a new folder without a space in the path)\n//      $CFG->pathtogs = '/usr/bin/gs';\n//\n// Path to du.\n// Probably something like /usr/bin/du. If you enter this, pages that display\n// directory contents will run much faster for directories with a lot of files.\n//      $CFG->pathtodu = '';\n//\n// Path to aspell.\n// To use spell-checking within the editor, you MUST have aspell 0.50 or later\n// installed on your server, and you must specify the correct path to access the\n// aspell binary. On Unix/Linux systems, this path is usually /usr/bin/aspell,\n// but it might be something else.\n//      $CFG->aspellpath = '';\n//\n// Path to dot.\n// Probably something like /usr/bin/dot. To be able to generate graphics from\n// DOT files, you must have installed the dot executable and point to it here.\n// Note that, for now, this only used by the profiling features\n// (Development->Profiling) built into Moodle.\n//      $CFG->pathtodot = '';\n//\n// Path to unoconv.\n// Probably something like /usr/bin/unoconv. Used as a fallback to convert between document formats.\n// Unoconv is used convert between file formats supported by LibreOffice.\n// Use a recent version of unoconv ( >= 0.7 ), older versions have trouble running from a webserver.\n//      $CFG->pathtounoconv = '';\n//\n//=========================================================================\n// 14. ALTERNATIVE FILE SYSTEM SETTINGS\n//=========================================================================\n//\n// Alternative file system.\n// Since 3.3 it is possible to override file_storage and file_system API and use alternative storage systems (e.g. S3,\n// Rackspace Cloud Files, Google Cloud Storage, Azure Storage, etc.).\n// To set the alternative file storage system in config.php you can use the following setting, providing the\n// alternative system class name that will be auto-loaded by file_storage API.\n//\n//      $CFG->alternative_file_system_class = '\\\\local_myfilestorage\\\\file_system';\n//\n//=========================================================================\n// ALL DONE!  To continue installation, visit your main page with a browser\n//=========================================================================\n\nrequire_once(__DIR__ . '/lib/setup.php'); // Do not edit\n\n// There is no php closing tag in this file,\n// it is intentional because it prevents trailing whitespace problems!\n", "num_lines": 854}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Functions to support installation process\n *\n * @package    core\n * @subpackage install\n * @copyright  2009 Petr Skoda (http://skodak.org)\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefined('MOODLE_INTERNAL') || die();\n\n/** INSTALL_WELCOME = 0 */\ndefine('INSTALL_WELCOME',       0);\n/** INSTALL_ENVIRONMENT = 1 */\ndefine('INSTALL_ENVIRONMENT',   1);\n/** INSTALL_PATHS = 2 */\ndefine('INSTALL_PATHS',         2);\n/** INSTALL_DOWNLOADLANG = 3 */\ndefine('INSTALL_DOWNLOADLANG',  3);\n/** INSTALL_DATABASETYPE = 4 */\ndefine('INSTALL_DATABASETYPE',  4);\n/** INSTALL_DATABASE = 5 */\ndefine('INSTALL_DATABASE',      5);\n/** INSTALL_SAVE = 6 */\ndefine('INSTALL_SAVE',          6);\n\n/**\n * Tries to detect the right www root setting.\n * @return string detected www root\n */\nfunction install_guess_wwwroot() {\n    $wwwroot = '';\n    if (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off') {\n        $wwwroot .= 'http://';\n    } else {\n        $wwwroot .= 'https://';\n    }\n    $hostport = explode(':', $_SERVER['HTTP_HOST']);\n    $wwwroot .= reset($hostport);\n    if ($_SERVER['SERVER_PORT'] != 80 and $_SERVER['SERVER_PORT'] != '443') {\n        $wwwroot .= ':'.$_SERVER['SERVER_PORT'];\n    }\n    $wwwroot .= $_SERVER['SCRIPT_NAME'];\n\n    list($wwwroot, $xtra) = explode('/install.php', $wwwroot);\n\n    return $wwwroot;\n}\n\n/**\n * Copy of @see{ini_get_bool()}\n * @param string $ini_get_arg\n * @return bool\n */\nfunction install_ini_get_bool($ini_get_arg) {\n    $temp = ini_get($ini_get_arg);\n\n    if ($temp == '1' or strtolower($temp) == 'on') {\n        return true;\n    }\n    return false;\n}\n\n/**\n * Creates dataroot if not exists yet,\n * makes sure it is writable, add lang directory\n * and add .htaccess just in case it works.\n *\n * @param string $dataroot full path to dataroot\n * @param int $dirpermissions\n * @return bool success\n */\nfunction install_init_dataroot($dataroot, $dirpermissions) {\n    if (file_exists($dataroot) and !is_dir($dataroot)) {\n        // file with the same name exists\n        return false;\n    }\n\n    umask(0000); // $CFG->umaskpermissions is not set yet.\n    if (!file_exists($dataroot)) {\n        if (!mkdir($dataroot, $dirpermissions, true)) {\n            // most probably this does not work, but anyway\n            return false;\n        }\n    }\n    @chmod($dataroot, $dirpermissions);\n\n    if (!is_writable($dataroot)) {\n        return false; // we can not continue\n    }\n\n    // create the directory for $CFG->tempdir\n    if (!is_dir(\"$dataroot/temp\")) {\n        if (!mkdir(\"$dataroot/temp\", $dirpermissions, true)) {\n            return false;\n        }\n    }\n    if (!is_writable(\"$dataroot/temp\")) {\n        return false; // we can not continue\n    }\n\n    // create the directory for $CFG->cachedir\n    if (!is_dir(\"$dataroot/cache\")) {\n        if (!mkdir(\"$dataroot/cache\", $dirpermissions, true)) {\n            return false;\n        }\n    }\n    if (!is_writable(\"$dataroot/cache\")) {\n        return false; // we can not continue\n    }\n\n    // create the directory for $CFG->langotherroot\n    if (!is_dir(\"$dataroot/lang\")) {\n        if (!mkdir(\"$dataroot/lang\", $dirpermissions, true)) {\n            return false;\n        }\n    }\n    if (!is_writable(\"$dataroot/lang\")) {\n        return false; // we can not continue\n    }\n\n    // finally just in case some broken .htaccess that prevents access just in case it is allowed\n    if (!file_exists(\"$dataroot/.htaccess\")) {\n        if ($handle = fopen(\"$dataroot/.htaccess\", 'w')) {\n            fwrite($handle, \"deny from all\\r\\nAllowOverride None\\r\\nNote: this file is broken intentionally, we do not want anybody to undo it in subdirectory!\\r\\n\");\n            fclose($handle);\n        } else {\n            return false;\n        }\n    }\n\n    return true;\n}\n\n/**\n * Print help button\n * @param string $url\n * @param string $titel\n * @return void\n */\nfunction install_helpbutton($url, $title='') {\n    if ($title == '') {\n        $title = get_string('help');\n    }\n    echo \"<a href=\\\"javascript:void(0)\\\" \";\n    echo \"onclick=\\\"return window.open('$url','Help','menubar=0,location=0,scrollbars,resizable,width=500,height=400')\\\"\";\n    echo \">\";\n    echo \"<img src=\\\"pix/help.gif\\\" class=\\\"iconhelp\\\" alt=\\\"$title\\\" title=\\\"$title\\\"/>\";\n    echo \"</a>\\n\";\n}\n\n/**\n * This is in function because we want the /install.php to parse in PHP4\n *\n * @param object $database\n * @param string $dbhsot\n * @param string $dbuser\n * @param string $dbpass\n * @param string $dbname\n * @param string $prefix\n * @param mixed $dboptions\n * @return string\n */\nfunction install_db_validate($database, $dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions) {\n    try {\n        try {\n            $database->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions);\n        } catch (moodle_exception $e) {\n            // let's try to create new database\n            if ($database->create_database($dbhost, $dbuser, $dbpass, $dbname, $dboptions)) {\n                $database->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions);\n            } else {\n                throw $e;\n            }\n        }\n        return '';\n    } catch (dml_exception $ex) {\n        $stringmanager = get_string_manager();\n        $errorstring = $ex->errorcode.'oninstall';\n        $legacystring = $ex->errorcode;\n        if ($stringmanager->string_exists($errorstring, $ex->module)) {\n            // By using a different string id from the error code we are separating exception handling and output.\n            $returnstring = $stringmanager->get_string($errorstring, $ex->module, $ex->a);\n            if ($ex->debuginfo) {\n                $returnstring .= '<br />'.$ex->debuginfo;\n            }\n\n            return $returnstring;\n        } else if ($stringmanager->string_exists($legacystring, $ex->module)) {\n            // There are some DML exceptions that may be thrown here as well as during normal operation.\n            // If we have a translated message already we still want to serve it here.\n            // However it is not the preferred way.\n            $returnstring = $stringmanager->get_string($legacystring, $ex->module, $ex->a);\n            if ($ex->debuginfo) {\n                $returnstring .= '<br />'.$ex->debuginfo;\n            }\n\n            return $returnstring;\n        }\n        // No specific translation. Deliver a generic error message.\n        return $stringmanager->get_string('dmlexceptiononinstall', 'error', $ex);\n    }\n}\n\n/**\n * Returns content of config.php file.\n *\n * Uses PHP_EOL for generating proper end of lines for the given platform.\n *\n * @param moodle_database $database database instance\n * @param object $cfg copy of $CFG\n * @return string\n */\nfunction install_generate_configphp($database, $cfg) {\n    $configphp = '<?php  // Moodle configuration file' . PHP_EOL . PHP_EOL;\n\n    $configphp .= 'unset($CFG);' . PHP_EOL;\n    $configphp .= 'global $CFG;' . PHP_EOL;\n    $configphp .= '$CFG = new stdClass();' . PHP_EOL . PHP_EOL; // prevent PHP5 strict warnings\n\n    $dbconfig = $database->export_dbconfig();\n\n    foreach ($dbconfig as $key=>$value) {\n        $key = str_pad($key, 9);\n        $configphp .= '$CFG->'.$key.' = '.var_export($value, true) . ';' . PHP_EOL;\n    }\n    $configphp .= PHP_EOL;\n\n    $configphp .= '$CFG->wwwroot   = '.var_export($cfg->wwwroot, true) . ';' . PHP_EOL ;\n\n    $configphp .= '$CFG->dataroot  = '.var_export($cfg->dataroot, true) . ';' . PHP_EOL;\n\n    $configphp .= '$CFG->admin     = '.var_export($cfg->admin, true) . ';' . PHP_EOL . PHP_EOL;\n\n    if (empty($cfg->directorypermissions)) {\n        $chmod = '02777';\n    } else {\n        $chmod = '0' . decoct($cfg->directorypermissions);\n    }\n    $configphp .= '$CFG->directorypermissions = ' . $chmod . ';' . PHP_EOL . PHP_EOL;\n\n    if (isset($cfg->upgradekey) and $cfg->upgradekey !== '') {\n        $configphp .= '$CFG->upgradekey = ' . var_export($cfg->upgradekey, true) . ';' . PHP_EOL . PHP_EOL;\n    }\n    $configphp .= '$CFG->session_file_save_path = \\'/usr/local/php/tmp\\';'.PHP_EOL . PHP_EOL;\n    $configphp .= 'require_once(__DIR__ . \\'/lib/setup.php\\');' . PHP_EOL . PHP_EOL;\n    $configphp .= '// There is no php closing tag in this file,' . PHP_EOL;\n    $configphp .= '// it is intentional because it prevents trailing whitespace problems!' . PHP_EOL;\n\n    return $configphp;\n}\n\n/**\n * Prints complete help page used during installation.\n * Does not return.\n *\n * @global object\n * @param string $help\n */\nfunction install_print_help_page($help) {\n    global $CFG, $OUTPUT; //TODO: MUST NOT USE $OUTPUT HERE!!!\n\n    @header('Content-Type: text/html; charset=UTF-8');\n    @header('X-UA-Compatible: IE=edge');\n    @header('Cache-Control: no-store, no-cache, must-revalidate');\n    @header('Cache-Control: post-check=0, pre-check=0', false);\n    @header('Pragma: no-cache');\n    @header('Expires: Mon, 20 Aug 1969 09:23:00 GMT');\n    @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');\n\n    echo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">';\n    echo '<html dir=\"'.(right_to_left() ? 'rtl' : 'ltr').'\">\n          <head>\n          <link rel=\"shortcut icon\" href=\"theme/clean/pix/favicon.ico\" />\n          <link rel=\"stylesheet\" type=\"text/css\" href=\"'.$CFG->wwwroot.'/install/css.php\" />\n          <title>'.get_string('installation','install').'</title>\n          <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n          </head><body>';\n    switch ($help) {\n        case 'phpversionhelp':\n            print_string($help, 'install', phpversion());\n            break;\n        case 'memorylimithelp':\n            print_string($help, 'install', @ini_get('memory_limit'));\n            break;\n        default:\n            print_string($help, 'install');\n    }\n    echo $OUTPUT->close_window_button(); //TODO: MUST NOT USE $OUTPUT HERE!!!\n    echo '</body></html>';\n    die;\n}\n\n/**\n * Prints installation page header, we can no use weblib yet in installer.\n *\n * @global object\n * @param array $config\n * @param string $stagename\n * @param string $heading\n * @param string $stagetext\n * @param string $stageclass\n * @return void\n */\nfunction install_print_header($config, $stagename, $heading, $stagetext, $stageclass = \"alert-info\") {\n    global $CFG;\n\n    @header('Content-Type: text/html; charset=UTF-8');\n    @header('X-UA-Compatible: IE=edge');\n    @header('Cache-Control: no-store, no-cache, must-revalidate');\n    @header('Cache-Control: post-check=0, pre-check=0', false);\n    @header('Pragma: no-cache');\n    @header('Expires: Mon, 20 Aug 1969 09:23:00 GMT');\n    @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');\n\n    echo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">';\n    echo '<html dir=\"'.(right_to_left() ? 'rtl' : 'ltr').'\">\n          <head>\n          <link rel=\"shortcut icon\" href=\"theme/clean/pix/favicon.ico\" />';\n\n    echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.$CFG->wwwroot.'/install/css.php\" />\n          <title>'.get_string('installation','install').' - Moodle '.$CFG->target_release.'</title>\n          <meta name=\"robots\" content=\"noindex\">\n          <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n          <meta http-equiv=\"pragma\" content=\"no-cache\" />\n          <meta http-equiv=\"expires\" content=\"0\" />';\n\n    echo '</head><body class=\"notloggedin\">\n            <div id=\"page\" class=\"stage'.$config->stage.'\">\n                <div id=\"page-header\">\n                    <div id=\"header\" class=\" clearfix\">\n                        <h1 class=\"headermain\">'.get_string('installation','install').'</h1>\n                        <div class=\"headermenu\">&nbsp;</div>\n                    </div>\n                    <div class=\"navbar clearfix\">\n                        <nav class=\"breadcrumb-nav\">\n                            <ul class=\"breadcrumb\"><li class=\"first\">'.$stagename.'</li></ul>\n                        </nav>\n                        <div class=\"navbutton\">&nbsp;</div>\n                    </div>\n                </div>\n          <!-- END OF HEADER -->\n          <div id=\"installdiv\">';\n\n    echo '<h2>'.$heading.'</h2>';\n\n    if ($stagetext !== '') {\n        echo '<div class=\"alert ' . $stageclass . '\">';\n        echo $stagetext;\n        echo '</div>';\n    }\n    // main\n    echo '<form id=\"installform\" method=\"post\" action=\"install.php\"><fieldset>';\n    foreach ($config as $name=>$value) {\n        echo '<input type=\"hidden\" name=\"'.$name.'\" value=\"'.s($value).'\" />';\n    }\n}\n\n/**\n * Prints installation page header, we can no use weblib yet in isntaller.\n *\n * @global object\n * @param array $config\n * @param bool $reload print reload button instead of next\n * @return void\n */\nfunction install_print_footer($config, $reload=false) {\n    global $CFG;\n\n    if ($config->stage > INSTALL_WELCOME) {\n        $first = '<input type=\"submit\" id=\"previousbutton\" name=\"previous\" value=\"&laquo; '.s(get_string('previous')).'\" />';\n    } else {\n        $first = '<input type=\"submit\" id=\"previousbutton\" name=\"next\" value=\"'.s(get_string('reload')).'\" />';\n        $first .= '<script type=\"text/javascript\">\n//<![CDATA[\n    var first = document.getElementById(\"previousbutton\");\n    first.style.visibility = \"hidden\";\n//]]>\n</script>\n';\n    }\n\n    if ($reload) {\n        $next = '<input type=\"submit\" id=\"nextbutton\" class=\"btn btn-primary\" name=\"next\" value=\"'.s(get_string('reload')).'\" />';\n    } else {\n        $next = '<input type=\"submit\" id=\"nextbutton\" class=\"btn btn-primary\" name=\"next\" value=\"'.s(get_string('next')).' &raquo;\" />';\n    }\n\n    echo '</fieldset><fieldset id=\"nav_buttons\">'.$first.$next.'</fieldset>';\n\n    $homelink  = '<div class=\"sitelink\">'.\n       '<a title=\"Moodle '. $CFG->target_release .'\" href=\"http://docs.moodle.org/en/Administrator_documentation\" onclick=\"this.target=\\'_blank\\'\">'.\n       '<img src=\"pix/moodlelogo.png\" alt=\"'.get_string('moodlelogo').'\" /></a></div>';\n\n    echo '</form></div>';\n    echo '<div id=\"page-footer\">'.$homelink.'</div>';\n    echo '</div></body></html>';\n}\n\n/**\n * Install Moodle DB,\n * config.php must exist, there must not be any tables in db yet.\n *\n * @param array $options adminpass is mandatory\n * @param bool $interactive\n * @return void\n */\nfunction install_cli_database(array $options, $interactive) {\n    global $CFG, $DB;\n    require_once($CFG->libdir.'/environmentlib.php');\n    require_once($CFG->libdir.'/upgradelib.php');\n\n    // show as much debug as possible\n    @error_reporting(E_ALL | E_STRICT);\n    @ini_set('display_errors', '1');\n    $CFG->debug = (E_ALL | E_STRICT);\n    $CFG->debugdisplay = true;\n    $CFG->debugdeveloper = true;\n\n    $CFG->version = '';\n    $CFG->release = '';\n    $CFG->branch = '';\n\n    $version = null;\n    $release = null;\n    $branch = null;\n\n    // read $version and $release\n    require($CFG->dirroot.'/version.php');\n\n    if ($DB->get_tables() ) {\n        cli_error(get_string('clitablesexist', 'install'));\n    }\n\n    if (empty($options['adminpass'])) {\n        cli_error('Missing required admin password');\n    }\n\n    // test environment first\n    list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);\n    if (!$envstatus) {\n        $errors = environment_get_errors($environment_results);\n        cli_heading(get_string('environment', 'admin'));\n        foreach ($errors as $error) {\n            list($info, $report) = $error;\n            echo \"!! $info !!\\n$report\\n\\n\";\n        }\n        exit(1);\n    }\n\n    if (!$DB->setup_is_unicodedb()) {\n        if (!$DB->change_db_encoding()) {\n            // If could not convert successfully, throw error, and prevent installation\n            cli_error(get_string('unicoderequired', 'admin'));\n        }\n    }\n\n    if ($interactive) {\n        cli_separator();\n        cli_heading(get_string('databasesetup'));\n    }\n\n    // install core\n    install_core($version, true);\n    set_config('release', $release);\n    set_config('branch', $branch);\n\n    if (PHPUNIT_TEST) {\n        // mark as test database as soon as possible\n        set_config('phpunittest', 'na');\n    }\n\n    // install all plugins types, local, etc.\n    upgrade_noncore(true);\n\n    // set up admin user password\n    $DB->set_field('user', 'password', hash_internal_user_password($options['adminpass']), array('username' => 'admin'));\n\n    // Set the admin email address if specified.\n    if (isset($options['adminemail'])) {\n        $DB->set_field('user', 'email', $options['adminemail'], array('username' => 'admin'));\n    }\n\n    // rename admin username if needed\n    if (isset($options['adminuser']) and $options['adminuser'] !== 'admin' and $options['adminuser'] !== 'guest') {\n        $DB->set_field('user', 'username', $options['adminuser'], array('username' => 'admin'));\n    }\n\n    // indicate that this site is fully configured\n    set_config('rolesactive', 1);\n    upgrade_finished();\n\n    // log in as admin - we need do anything when applying defaults\n    \\core\\session\\manager::set_user(get_admin());\n\n    // apply all default settings, do it twice to fill all defaults - some settings depend on other setting\n    admin_apply_default_settings(NULL, true);\n    admin_apply_default_settings(NULL, true);\n    set_config('registerauth', '');\n\n    // set the site name\n    if (isset($options['shortname']) and $options['shortname'] !== '') {\n        $DB->set_field('course', 'shortname', $options['shortname'], array('format' => 'site'));\n    }\n    if (isset($options['fullname']) and $options['fullname'] !== '') {\n        $DB->set_field('course', 'fullname', $options['fullname'], array('format' => 'site'));\n    }\n    if (isset($options['summary'])) {\n        $DB->set_field('course', 'summary', $options['summary'], array('format' => 'site'));\n    }\n\n    // Redirect to site registration on first login.\n    set_config('registrationpending', 1);\n}\n", "num_lines": 532}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n///////////////////////////////////////////////////////////////////////////\n//                                                                       //\n// Moodle configuration file                                             //\n//                                                                       //\n// This file should be renamed \"config.php\" in the top-level directory   //\n//                                                                       //\n///////////////////////////////////////////////////////////////////////////\n//                                                                       //\n// NOTICE OF COPYRIGHT                                                   //\n//                                                                       //\n// Moodle - Modular Object-Oriented Dynamic Learning Environment         //\n//          http://moodle.org                                            //\n//                                                                       //\n// Copyright (C) 1999 onwards  Martin Dougiamas  http://moodle.com       //\n//                                                                       //\n// This program is free software; you can redistribute it and/or modify  //\n// it under the terms of the GNU General Public License as published by  //\n// the Free Software Foundation; either version 3 of the License, or     //\n// (at your option) any later version.                                   //\n//                                                                       //\n// This program is distributed in the hope that it will be useful,       //\n// but WITHOUT ANY WARRANTY; without even the implied warranty of        //\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //\n// GNU General Public License for more details:                          //\n//                                                                       //\n//          http://www.gnu.org/copyleft/gpl.html                         //\n//                                                                       //\n///////////////////////////////////////////////////////////////////////////\nunset($CFG);  // Ignore this line\nglobal $CFG;  // This is necessary here for PHPUnit execution\n$CFG = new stdClass();\n\n//=========================================================================\n// 1. DATABASE SETUP\n//=========================================================================\n// First, you need to configure the database where all Moodle data       //\n// will be stored.  This database must already have been created         //\n// and a username/password created to access it.                         //\n\n$CFG->dbtype    = 'pgsql';      // 'pgsql', 'mariadb', 'mysqli', 'sqlsrv' or 'oci'\n$CFG->dblibrary = 'native';     // 'native' only at the moment\n$CFG->dbhost    = 'localhost';  // eg 'localhost' or 'db.isp.com' or IP\n$CFG->dbname    = 'moodle';     // database name, eg moodle\n$CFG->dbuser    = 'username';   // your database username\n$CFG->dbpass    = 'password';   // your database password\n$CFG->prefix    = 'mdl_';       // prefix to use for all table names\n$CFG->dboptions = array(\n    'dbpersist' => false,       // should persistent database connections be\n                                //  used? set to 'false' for the most stable\n                                //  setting, 'true' can improve performance\n                                //  sometimes\n    'dbsocket'  => false,       // should connection via UNIX socket be used?\n                                //  if you set it to 'true' or custom path\n                                //  here set dbhost to 'localhost',\n                                //  (please note mysql is always using socket\n                                //  if dbhost is 'localhost' - if you need\n                                //  local port connection use '127.0.0.1')\n    'dbport'    => '',          // the TCP port number to use when connecting\n                                //  to the server. keep empty string for the\n                                //  default port\n    'dbhandlesoptions' => false,// On PostgreSQL poolers like pgbouncer don't\n                                // support advanced options on connection.\n                                // If you set those in the database then\n                                // the advanced settings will not be sent.\n    'dbcollation' => 'utf8mb4_unicode_ci', // MySQL has partial and full UTF-8\n                                // support. If you wish to use partial UTF-8\n                                // (three bytes) then set this option to\n                                // 'utf8_unicode_ci', otherwise this option\n                                // can be removed for MySQL (by default it will\n                                // use 'utf8mb4_unicode_ci'. This option should\n                                // be removed for all other databases.\n    // 'fetchbuffersize' => 100000, // On PostgreSQL, this option sets a limit\n                                // on the number of rows that are fetched into\n                                // memory when doing a large recordset query\n                                // (e.g. search indexing). Default is 100000.\n                                // Uncomment and set to a value to change it,\n                                // or zero to turn off the limit. You need to\n                                // set to zero if you are using pg_bouncer in\n                                // 'transaction' mode (it is fine in 'session'\n                                // mode).\n);\n\n\n//=========================================================================\n// 2. WEB SITE LOCATION\n//=========================================================================\n// Now you need to tell Moodle where it is located. Specify the full\n// web address to where moodle has been installed.  If your web site\n// is accessible via multiple URLs then choose the most natural one\n// that your students would use.  Do not include a trailing slash\n//\n// If you need both intranet and Internet access please read\n// http://docs.moodle.org/en/masquerading\n\n$CFG->wwwroot   = 'http://example.com/moodle';\n\n\n//=========================================================================\n// 3. DATA FILES LOCATION\n//=========================================================================\n// Now you need a place where Moodle can save uploaded files.  This\n// directory should be readable AND WRITEABLE by the web server user\n// (usually 'nobody' or 'apache'), but it should not be accessible\n// directly via the web.\n//\n// - On hosting systems you might need to make sure that your \"group\" has\n//   no permissions at all, but that \"others\" have full permissions.\n//\n// - On Windows systems you might specify something like 'c:\\moodledata'\n\n$CFG->dataroot  = '/home/example/moodledata';\n\n\n//=========================================================================\n// 4. DATA FILES PERMISSIONS\n//=========================================================================\n// The following parameter sets the permissions of new directories\n// created by Moodle within the data directory.  The format is in\n// octal format (as used by the Unix utility chmod, for example).\n// The default is usually OK, but you may want to change it to 0750\n// if you are concerned about world-access to the files (you will need\n// to make sure the web server process (eg Apache) can access the files.\n// NOTE: the prefixed 0 is important, and don't use quotes.\n\n$CFG->directorypermissions = 02777;\n\n\n//=========================================================================\n// 5. DIRECTORY LOCATION  (most people can just ignore this setting)\n//=========================================================================\n// A very few webhosts use /admin as a special URL for you to access a\n// control panel or something.  Unfortunately this conflicts with the\n// standard location for the Moodle admin pages.  You can work around this\n// by renaming the admin directory in your installation, and putting that\n// new name here.  eg \"moodleadmin\".  This should fix all admin links in Moodle.\n// After any change you need to visit your new admin directory\n// and purge all caches.\n\n$CFG->admin = 'admin';\n\n\n//=========================================================================\n// 6. OTHER MISCELLANEOUS SETTINGS (ignore these for new installations)\n//=========================================================================\n//\n// These are additional tweaks for which no GUI exists in Moodle yet.\n//\n// Starting in PHP 5.3 administrators should specify default timezone\n// in PHP.ini, you can also specify it here if needed.\n// See details at: http://php.net/manual/en/function.date-default-timezone-set.php\n// List of time zones at: http://php.net/manual/en/timezones.php\n//     date_default_timezone_set('Australia/Perth');\n//\n// Change the key pair lifetime for Moodle Networking\n// The default is 28 days. You would only want to change this if the key\n// was not getting regenerated for any reason. You would probably want\n// make it much longer. Note that you'll need to delete and manually update\n// any existing key.\n//      $CFG->mnetkeylifetime = 28;\n//\n// Not recommended: Set the following to true to allow the use\n// off non-Moodle standard characters in usernames.\n//      $CFG->extendedusernamechars = true;\n//\n// Allow user passwords to be included in backup files. Very dangerous\n// setting as far as it publishes password hashes that can be unencrypted\n// if the backup file is publicy available. Use it only if you can guarantee\n// that all your backup files remain only privacy available and are never\n// shared out from your site/institution!\n//      $CFG->includeuserpasswordsinbackup = true;\n//\n// Completely disable user creation when restoring a course, bypassing any\n// permissions granted via roles and capabilities. Enabling this setting\n// results in the restore process stopping when a user attempts to restore a\n// course requiring users to be created.\n//     $CFG->disableusercreationonrestore = true;\n//\n// Keep the temporary directories used by backup and restore without being\n// deleted at the end of the process. Use it if you want to debug / view\n// all the information stored there after the process has ended. Note that\n// those directories may be deleted (after some ttl) both by cron and / or\n// by new backup / restore invocations.\n//     $CFG->keeptempdirectoriesonbackup = true;\n//\n// Modify the restore process in order to force the \"user checks\" to assume\n// that the backup originated from a different site, so detection of matching\n// users is performed with different (more \"relaxed\") rules. Note that this is\n// only useful if the backup file has been created using Moodle < 1.9.4 and the\n// site has been rebuilt from scratch using backup files (not the best way btw).\n// If you obtain user conflicts on restore, rather than enabling this setting\n// permanently, try restoring the backup on a different site, back it up again\n// and then restore on the target server.\n//    $CFG->forcedifferentsitecheckingusersonrestore = true;\n//\n// Force the backup system to continue to create backups in the legacy zip\n// format instead of the new tgz format. Does not affect restore, which\n// auto-detects the underlying file format.\n//    $CFG->usezipbackups = true;\n//\n// Prevent stats processing and hide the GUI\n//      $CFG->disablestatsprocessing = true;\n//\n// Setting this to true will enable admins to edit any post at any time\n//      $CFG->admineditalways = true;\n//\n// These variables define DEFAULT block variables for new courses\n// If this one is set it overrides all others and is the only one used.\n//      $CFG->defaultblocks_override = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// These variables define the specific settings for defined course formats.\n// They override any settings defined in the formats own config file.\n//      $CFG->defaultblocks_site = 'site_main_menu,course_list:course_summary,calendar_month';\n//      $CFG->defaultblocks_social = 'participants,search_forums,calendar_month,calendar_upcoming,social_activities,recent_activity,course_list';\n//      $CFG->defaultblocks_topics = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//      $CFG->defaultblocks_weeks = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// These blocks are used when no other default setting is found.\n//      $CFG->defaultblocks = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// You can specify a different class to be created for the $PAGE global, and to\n// compute which blocks appear on each page. However, I cannot think of any good\n// reason why you would need to change that. It just felt wrong to hard-code the\n// the class name. You are strongly advised not to use these to settings unless\n// you are absolutely sure you know what you are doing.\n//      $CFG->moodlepageclass = 'moodle_page';\n//      $CFG->moodlepageclassfile = \"$CFG->dirroot/local/myplugin/mypageclass.php\";\n//      $CFG->blockmanagerclass = 'block_manager';\n//      $CFG->blockmanagerclassfile = \"$CFG->dirroot/local/myplugin/myblockamanagerclass.php\";\n//\n// Seconds for files to remain in caches. Decrease this if you are worried\n// about students being served outdated versions of uploaded files.\n//     $CFG->filelifetime = 60*60*6;\n//\n// Some web servers can offload the file serving from PHP process,\n// comment out one the following options to enable it in Moodle:\n//     $CFG->xsendfile = 'X-Sendfile';           // Apache {@see https://tn123.org/mod_xsendfile/}\n//     $CFG->xsendfile = 'X-LIGHTTPD-send-file'; // Lighttpd {@see http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file}\n//     $CFG->xsendfile = 'X-Accel-Redirect';     // Nginx {@see http://wiki.nginx.org/XSendfile}\n// If your X-Sendfile implementation (usually Nginx) uses directory aliases specify them\n// in the following array setting:\n//     $CFG->xsendfilealiases = array(\n//         '/dataroot/' => $CFG->dataroot,\n//         '/cachedir/' => '/var/www/moodle/cache',    // for custom $CFG->cachedir locations\n//         '/localcachedir/' => '/var/local/cache',    // for custom $CFG->localcachedir locations\n//         '/tempdir/'  => '/var/www/moodle/temp',     // for custom $CFG->tempdir locations\n//         '/filedir'   => '/var/www/moodle/filedir',  // for custom $CFG->filedir locations\n//     );\n//\n// YUI caching may be sometimes improved by slasharguments:\n//     $CFG->yuislasharguments = 1;\n// Some servers may need a special rewrite rule to work around internal path length limitations:\n// RewriteRule (^.*/theme/yui_combo\\.php)(/.*) $1?file=$2\n//\n//\n// Following settings may be used to select session driver, uncomment only one of the handlers.\n//   Database session handler (not compatible with MyISAM):\n//      $CFG->session_handler_class = '\\core\\session\\database';\n//      $CFG->session_database_acquire_lock_timeout = 120;\n//\n//   File session handler (file system locking required):\n//      $CFG->session_handler_class = '\\core\\session\\file';\n//      $CFG->session_file_save_path = $CFG->dataroot.'/sessions';\n//\n//   Memcached session handler (requires memcached server and extension):\n//      $CFG->session_handler_class = '\\core\\session\\memcached';\n//      $CFG->session_memcached_save_path = '127.0.0.1:11211';\n//      $CFG->session_memcached_prefix = 'memc.sess.key.';\n//      $CFG->session_memcached_acquire_lock_timeout = 120;\n//      $CFG->session_memcached_lock_expire = 7200;       // Ignored if PECL memcached is below version 2.2.0\n//      $CFG->session_memcached_lock_retry_sleep = 150;   // Spin-lock retry sleeptime (msec). Only effective\n//                                                        // for tuning php-memcached 3.0.x (PHP 7)\n//\n//   Redis session handler (requires redis server and redis extension):\n//      $CFG->session_handler_class = '\\core\\session\\redis';\n//      $CFG->session_redis_host = '127.0.0.1';\n//      $CFG->session_redis_port = 6379;  // Optional.\n//      $CFG->session_redis_database = 0;  // Optional, default is db 0.\n//      $CFG->session_redis_auth = ''; // Optional, default is don't set one.\n//      $CFG->session_redis_prefix = ''; // Optional, default is don't set one.\n//      $CFG->session_redis_acquire_lock_timeout = 120;\n//      $CFG->session_redis_lock_expire = 7200;\n//      Use the igbinary serializer instead of the php default one. Note that phpredis must be compiled with\n//      igbinary support to make the setting to work. Also, if you change the serializer you have to flush the database!\n//      $CFG->session_redis_serializer_use_igbinary = false; // Optional, default is PHP builtin serializer.\n//\n// Please be aware that when selecting Memcached for sessions that it is advised to use a dedicated\n// memcache server. The memcached extension does not provide isolated environments for individual uses.\n// Using the same server for other purposes (MUC for example) can lead to sessions being prematurely removed should\n// the other uses of the server purge the cache.\n//\n// Following setting allows you to alter how frequently is timemodified updated in sessions table.\n//      $CFG->session_update_timemodified_frequency = 20; // In seconds.\n//\n// If this setting is set to true, then Moodle will track the IP of the\n// current user to make sure it hasn't changed during a session.  This\n// will prevent the possibility of sessions being hijacked via XSS, but it\n// may break things for users coming using proxies that change all the time,\n// like AOL.\n//      $CFG->tracksessionip = true;\n//\n// The following lines are for handling email bounces.\n//      $CFG->handlebounces = true;\n//      $CFG->minbounces = 10;\n//      $CFG->bounceratio = .20;\n// The next lines are needed both for bounce handling and any other email to module processing.\n// mailprefix must be EXACTLY four characters.\n// Uncomment and customise this block for Postfix\n//      $CFG->mailprefix = 'mdl+'; // + is the separator for Exim and Postfix.\n//      $CFG->mailprefix = 'mdl-'; // - is the separator for qmail\n//      $CFG->maildomain = 'youremaildomain.com';\n//\n// Enable when setting up advanced reverse proxy load balancing configurations,\n// it may be also necessary to enable this when using port forwarding.\n//      $CFG->reverseproxy = true;\n//\n// Enable when using external SSL appliance for performance reasons.\n// Please note that site may be accessible via http: or https:, but not both!\n//      $CFG->sslproxy = true;\n//\n// This setting will cause the userdate() function not to fix %d in\n// date strings, and just let them show with a zero prefix.\n//      $CFG->nofixday = true;\n//\n// This setting will make some graphs (eg user logs) use lines instead of bars\n//      $CFG->preferlinegraphs = true;\n//\n// This setting allows you to specify a class to rewrite outgoing urls\n// enabling 'clean urls' in conjunction with an apache / nginx handler.\n// The handler must implement \\core\\output\\url_rewriter.\n//      $CFG->urlrewriteclass = '\\local_cleanurls\\url_rewriter';\n//\n// Enabling this will allow custom scripts to replace existing moodle scripts.\n// For example: if $CFG->customscripts/course/view.php exists then\n// it will be used instead of $CFG->wwwroot/course/view.php\n// At present this will only work for files that include config.php and are called\n// as part of the url (index.php is implied).\n// Some examples are:\n//      http://my.moodle.site/course/view.php\n//      http://my.moodle.site/index.php\n//      http://my.moodle.site/admin            (index.php implied)\n// Custom scripts should not include config.php\n// Warning: Replacing standard moodle scripts may pose security risks and/or may not\n// be compatible with upgrades. Use this option only if you are aware of the risks\n// involved.\n// Specify the full directory path to the custom scripts\n//      $CFG->customscripts = '/home/example/customscripts';\n//\n// Performance profiling\n//\n//   If you set Debug to \"Yes\" in the Configuration->Variables page some\n//   performance profiling data will show up on your footer (in default theme).\n//   With these settings you get more granular control over the capture\n//   and printout of the data\n//\n//   Capture performance profiling data\n//   define('MDL_PERF'  , true);\n//\n//   Capture additional data from DB\n//   define('MDL_PERFDB'  , true);\n//\n//   Print to log (for passive profiling of production servers)\n//   define('MDL_PERFTOLOG'  , true);\n//\n//   Print to footer (works with the default theme)\n//   define('MDL_PERFTOFOOT', true);\n//\n//   Enable earlier profiling that causes more code to be covered\n//   on every request (db connections, config load, other inits...).\n//   Requires extra configuration to be defined in config.php like:\n//   profilingincluded, profilingexcluded, profilingautofrec,\n//   profilingallowme, profilingallowall, profilinglifetime\n//       $CFG->earlyprofilingenabled = true;\n//\n// Disable database storage for profile data.\n// When using an exernal plugin to store profiling data it is often\n// desirable to not store the data in the database.\n//\n//      $CFG->disableprofilingtodatabase = true;\n//\n// Force displayed usernames\n//   A little hack to anonymise user names for all students.  If you set these\n//   then all non-teachers will always see these for every person.\n//       $CFG->forcefirstname = 'Bruce';\n//       $CFG->forcelastname  = 'Simpson';\n//\n// The following setting will turn on username logging into Apache log. For full details regarding setting\n// up of this function please refer to the install section of the document.\n//     $CFG->apacheloguser = 0; // Turn this feature off. Default value.\n//     $CFG->apacheloguser = 1; // Log user id.\n//     $CFG->apacheloguser = 2; // Log full name in cleaned format. ie, Darth Vader will be displayed as darth_vader.\n//     $CFG->apacheloguser = 3; // Log username.\n// To get the values logged in Apache's log, add to your httpd.conf\n// the following statements. In the General part put:\n//     LogFormat \"%h %l %{MOODLEUSER}n %t \\\"%r\\\" %s %b \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" moodleformat\n// And in the part specific to your Moodle install / virtualhost:\n//     CustomLog \"/your/path/to/log\" moodleformat\n//\n// Alternatively for other webservers such as nginx, you can instead have the username sent via a http header\n// 'X-MOODLEUSER' which can be saved in the logfile and then stripped out before being sent to the browser:\n//     $CFG->headerloguser = 0; // Turn this feature off. Default value.\n//     $CFG->headerloguser = 1; // Log user id.\n//     $CFG->headerloguser = 2; // Log full name in cleaned format. ie, Darth Vader will be displayed as darth_vader.\n//     $CFG->headerloguser = 3; // Log username.\n//\n// CAUTION: Use of this option will expose usernames in the Apache / nginx log,\n// If you are going to publish your log, or the output of your web stats analyzer\n// this will weaken the security of your website.\n//\n// Email database connection errors to someone.  If Moodle cannot connect to the\n// database, then email this address with a notice.\n//\n//     $CFG->emailconnectionerrorsto = 'your@emailaddress.com';\n//\n// Set the priority of themes from highest to lowest. This is useful (for\n// example) in sites where the user theme should override all other theme\n// settings for accessibility reasons. You can also disable types of themes\n// (other than site)  by removing them from the array. The default setting is:\n//\n//     $CFG->themeorder = array('course', 'category', 'session', 'user', 'cohort', 'site');\n//\n// NOTE: course, category, session, user, cohort themes still require the\n// respective settings to be enabled\n//\n// It is possible to add extra themes directory stored outside of $CFG->dirroot.\n// This local directory does not have to be accessible from internet.\n//\n//     $CFG->themedir = '/location/of/extra/themes';\n//\n// It is possible to specify different cache and temp directories, use local fast filesystem\n// for normal web servers. Server clusters MUST use shared filesystem for cachedir!\n// Localcachedir is intended for server clusters, it does not have to be shared by cluster nodes.\n// The directories must not be accessible via web.\n//\n//     $CFG->tempdir = '/var/www/moodle/temp';        // Directory MUST BE SHARED by all cluster nodes.\n//     $CFG->cachedir = '/var/www/moodle/cache';      // Directory MUST BE SHARED by all cluster nodes, locking required.\n//     $CFG->localcachedir = '/var/local/cache';      // Intended for local node caching.\n//\n// It is possible to specify a different backup temp directory, use local fast filesystem\n// for normal web servers. Server clusters MUST use shared filesystem for backuptempdir!\n// The directory must not be accessible via web.\n//\n//     $CFG->backuptempdir = '/var/www/moodle/backuptemp';  // Directory MUST BE SHARED by all cluster nodes.\n//\n// Some filesystems such as NFS may not support file locking operations.\n// Locking resolves race conditions and is strongly recommended for production servers.\n//     $CFG->preventfilelocking = false;\n//\n// Site default language can be set via standard administration interface. If you\n// want to have initial error messages for eventual database connection problems\n// localized too, you have to set your language code here.\n//\n//     $CFG->lang = 'yourlangcode'; // for example 'cs'\n//\n// When Moodle is about to perform an intensive operation it raises PHP's memory\n// limit. The following setting should be used on large sites to set the raised\n// memory limit to something higher.\n// The value for the settings should be a valid PHP memory value. e.g. 512M, 1G\n//\n//     $CFG->extramemorylimit = '1024M';\n//\n// Moodle 2.4 introduced a new cache API.\n// The cache API stores a configuration file within the Moodle data directory and\n// uses that rather than the database in order to function in a stand-alone manner.\n// Using altcacheconfigpath you can change the location where this config file is\n// looked for.\n// It can either be a directory in which to store the file, or the full path to the\n// file if you want to take full control. Either way it must be writable by the\n// webserver.\n//\n//     $CFG->altcacheconfigpath = '/var/www/shared/moodle.cache.config.php\n//\n// Use the following flag to completely disable the Available update notifications\n// feature and hide it from the server administration UI.\n//\n//      $CFG->disableupdatenotifications = true;\n//\n// Use the following flag to completely disable the installation of plugins\n// (new plugins, available updates and missing dependencies) and related\n// features (such as cancelling the plugin installation or upgrade) via the\n// server administration web interface.\n//\n//      $CFG->disableupdateautodeploy = true;\n//\n// Use the following flag to disable the warning on the system notifications page\n// about present development libraries. This flag will not disable the warning within\n// the security overview report. Use this flag only if you really have prohibited web\n// access to the development libraries in your webserver configuration.\n//\n//      $CFG->disabledevlibdirscheck = true;\n//\n// Use the following flag to disable modifications to scheduled tasks\n// whilst still showing the state of tasks.\n//\n//      $CFG->preventscheduledtaskchanges = true;\n//\n// As of version 2.4 Moodle serves icons as SVG images if the users browser appears\n// to support SVG.\n// For those wanting to control the serving of SVG images the following setting can\n// be defined in your config.php.\n// If it is not defined then the default (browser detection) will occur.\n//\n// To ensure they are always used when available:\n//      $CFG->svgicons = true;\n//\n// To ensure they are never used even when available:\n//      $CFG->svgicons = false;\n//\n// Some administration options allow setting the path to executable files. This can\n// potentially cause a security risk. Set this option to true to disable editing\n// those config settings via the web. They will need to be set explicitly in the\n// config.php file\n//      $CFG->preventexecpath = true;\n//\n// Use the following flag to set userid for noreply user. If not set then moodle will\n// create dummy user and use -ve value as user id.\n//      $CFG->noreplyuserid = -10;\n//\n// As of version 2.6 Moodle supports admin to set support user. If not set, all mails\n// will be sent to supportemail.\n//      $CFG->supportuserid = -20;\n//\n// Moodle 2.7 introduces a locking api for critical tasks (e.g. cron).\n// The default locking system to use is DB locking for Postgres, and file locking for\n// MySQL, Oracle and SQLServer. If $CFG->preventfilelocking is set, then the default\n// will always be DB locking. It can be manually set to one of the lock\n// factory classes listed below, or one of your own custom classes implementing the\n// \\core\\lock\\lock_factory interface.\n//\n//      $CFG->lock_factory = \"auto\";\n//\n// The list of available lock factories is:\n//\n// \"\\\\core\\\\lock\\\\file_lock_factory\" - File locking\n//      Uses lock files stored by default in the dataroot. Whether this\n//      works on clusters depends on the file system used for the dataroot.\n//\n// \"\\\\core\\\\lock\\\\db_record_lock_factory\" - DB locking based on table rows.\n//\n// \"\\\\core\\\\lock\\\\postgres_lock_factory\" - DB locking based on postgres advisory locks.\n//\n// Settings used by the lock factories\n//\n// Location for lock files used by the File locking factory. This must exist\n// on a shared file system that supports locking.\n//      $CFG->lock_file_root = $CFG->dataroot . '/lock';\n//\n// Moodle 2.9 allows administrators to customise the list of supported file types.\n// To add a new filetype or override the definition of an existing one, set the\n// customfiletypes variable like this:\n//\n// $CFG->customfiletypes = array(\n//     (object)array(\n//         'extension' => 'frog',\n//         'icon' => 'archive',\n//         'type' => 'application/frog',\n//         'customdescription' => 'Amphibian-related file archive'\n//     )\n// );\n//\n// The extension, icon, and type fields are required. The icon field can refer to\n// any icon inside the pix/f folder. You can also set the customdescription field\n// (shown above) and (for advanced use) the groups, string, and defaulticon fields.\n//\n// Upgrade key\n//\n// If the upgrade key is defined here, then the value must be provided every time\n// the site is being upgraded though the web interface, regardless of whether the\n// administrator is logged in or not. This prevents anonymous access to the upgrade\n// screens where the real authentication and authorization mechanisms can not be\n// relied on.\n//\n// It is strongly recommended to use a value different from your real account\n// password.\n//\n//      $CFG->upgradekey = 'put_some_password-like_value_here';\n//\n// Document conversion limit\n//\n// How many times the background task should attempt to convert a given attempt\n// before removing it from the queue. Currently this limit is only used by the\n// mod_assign conversion task.\n//\n//      $CFG->conversionattemptlimit = 3;\n//\n// Font used in exported PDF files. When generating a PDF, Moodle embeds a subset of\n// the font in the PDF file so it will be readable on the widest range of devices.\n// The default font is 'freesans' which is part of the GNU FreeFont collection.\n//\n//      $CFG->pdfexportfont = 'freesans';\n//\n// Use the following flag to enable messagingallusers and set the default preference\n// value for existing users to allow them to be contacted by other site users.\n//\n//      $CFG->keepmessagingallusersenabled = true;\n//\n// Disable login token validation for login pages. Login token validation is enabled\n// by default unless $CFG->alternateloginurl is set.\n//\n//      $CFG->disablelogintoken = true;\n//\n//=========================================================================\n// 7. SETTINGS FOR DEVELOPMENT SERVERS - not intended for production use!!!\n//=========================================================================\n//\n// Force a debugging mode regardless the settings in the site administration\n// @error_reporting(E_ALL | E_STRICT); // NOT FOR PRODUCTION SERVERS!\n// @ini_set('display_errors', '1');    // NOT FOR PRODUCTION SERVERS!\n// $CFG->debug = (E_ALL | E_STRICT);   // === DEBUG_DEVELOPER - NOT FOR PRODUCTION SERVERS!\n// $CFG->debugdisplay = 1;             // NOT FOR PRODUCTION SERVERS!\n//\n// You can specify a comma separated list of user ids that that always see\n// debug messages, this overrides the debug flag in $CFG->debug and $CFG->debugdisplay\n// for these users only.\n// $CFG->debugusers = '2';\n//\n// Prevent theme caching\n// $CFG->themedesignermode = true; // NOT FOR PRODUCTION SERVERS!\n//\n// Enable verbose debug information during fetching of email messages from IMAP server.\n// $CFG->debugimap = true;\n//\n// Prevent JS caching\n// $CFG->cachejs = false; // NOT FOR PRODUCTION SERVERS!\n//\n// Restrict which YUI logging statements are shown in the browser console.\n// For details see the upstream documentation:\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logInclude\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logExclude\n// $CFG->yuiloginclude = array(\n//     'moodle-core-dock-loader' => true,\n//     'moodle-course-categoryexpander' => true,\n// );\n// $CFG->yuilogexclude = array(\n//     'moodle-core-dock' => true,\n//     'moodle-core-notification' => true,\n// );\n//\n// Set the minimum log level for YUI logging statements.\n// For details see the upstream documentation:\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logLevel\n// $CFG->yuiloglevel = 'debug';\n//\n// Prevent core_string_manager application caching\n// $CFG->langstringcache = false; // NOT FOR PRODUCTION SERVERS!\n//\n// When working with production data on test servers, no emails or other messages\n// should ever be send to real users\n// $CFG->noemailever = true;    // NOT FOR PRODUCTION SERVERS!\n//\n// Divert all outgoing emails to this address to test and debug emailing features\n// $CFG->divertallemailsto = 'root@localhost.local'; // NOT FOR PRODUCTION SERVERS!\n//\n// Except for certain email addresses you want to let through for testing. Accepts\n// a comma separated list of regexes.\n// $CFG->divertallemailsexcept = 'tester@dev.com, fred(\\+.*)?@example.com'; // NOT FOR PRODUCTION SERVERS!\n//\n// Uncomment if you want to allow empty comments when modifying install.xml files.\n// $CFG->xmldbdisablecommentchecking = true;    // NOT FOR PRODUCTION SERVERS!\n//\n// Since 2.0 sql queries are not shown during upgrade by default.\n// Please note that this setting may produce very long upgrade page on large sites.\n// $CFG->upgradeshowsql = true; // NOT FOR PRODUCTION SERVERS!\n//\n// Add SQL queries to the output of cron, just before their execution\n// $CFG->showcronsql = true;\n//\n// Force developer level debug and add debug info to the output of cron\n// $CFG->showcrondebugging = true;\n//\n//=========================================================================\n// 8. FORCED SETTINGS\n//=========================================================================\n// It is possible to specify normal admin settings here, the point is that\n// they can not be changed through the standard admin settings pages any more.\n//\n// Core settings are specified directly via assignment to $CFG variable.\n// Example:\n//   $CFG->somecoresetting = 'value';\n//\n// Plugin settings have to be put into a special array.\n// Example:\n//   $CFG->forced_plugin_settings = array('pluginname'  => array('settingname' => 'value', 'secondsetting' => 'othervalue'),\n//                                        'otherplugin' => array('mysetting' => 'myvalue', 'thesetting' => 'thevalue'));\n// Module default settings with advanced/locked checkboxes can be set too. To do this, add\n// an extra config with '_adv' or '_locked' as a suffix and set the value to true or false.\n// Example:\n//   $CFG->forced_plugin_settings = array('pluginname'  => array('settingname' => 'value', 'settingname_locked' => true, 'settingname_adv' => true));\n//\n//=========================================================================\n// 9. PHPUNIT SUPPORT\n//=========================================================================\n// $CFG->phpunit_prefix = 'phpu_';\n// $CFG->phpunit_dataroot = '/home/example/phpu_moodledata';\n// $CFG->phpunit_directorypermissions = 02777; // optional\n// $CFG->phpunit_profilingenabled = true; // optional to profile PHPUnit runs.\n//\n//\n//=========================================================================\n// 10. SECRET PASSWORD SALT\n//=========================================================================\n// A site-wide password salt is no longer used in new installations.\n// If upgrading from 2.6 or older, keep all existing salts in config.php file.\n//\n// $CFG->passwordsaltmain = 'a_very_long_random_string_of_characters#@6&*1';\n//\n// You may also have some alternative salts to allow migration from previously\n// used salts.\n//\n// $CFG->passwordsaltalt1 = '';\n// $CFG->passwordsaltalt2 = '';\n// $CFG->passwordsaltalt3 = '';\n// ....\n// $CFG->passwordsaltalt19 = '';\n// $CFG->passwordsaltalt20 = '';\n//\n//\n//=========================================================================\n// 11. BEHAT SUPPORT\n//=========================================================================\n// Behat test site needs a unique www root, data directory and database prefix:\n//\n// $CFG->behat_wwwroot = 'http://127.0.0.1/moodle';\n// $CFG->behat_prefix = 'bht_';\n// $CFG->behat_dataroot = '/home/example/bht_moodledata';\n//\n// You can override default Moodle configuration for Behat and add your own\n// params; here you can add more profiles, use different Mink drivers than Selenium...\n// These params would be merged with the default Moodle behat.yml, giving priority\n// to the ones specified here. The array format is YAML, following the Behat\n// params hierarchy. More info: http://docs.behat.org/guides/7.config.html\n// Example:\n//   $CFG->behat_config = array(\n//       'Mac-Firefox' => array(\n//           'suites' => array (\n//               'default' => array(\n//                   'filters' => array(\n//                      'tags' => '~@_file_upload'\n//                   ),\n//               ),\n//           ),\n//           'extensions' => array(\n//               'Behat\\MinkExtension' => array(\n//                   'selenium2' => array(\n//                       'browser' => 'firefox',\n//                       'capabilities' => array(\n//                           'platform' => 'OS X 10.6',\n//                           'version' => 20\n//                       )\n//                   )\n//               )\n//           )\n//       ),\n//       'Mac-Safari' => array(\n//           'extensions' => array(\n//               'Behat\\MinkExtension' => array(\n//                   'selenium2' => array(\n//                       'browser' => 'safari',\n//                       'capabilities' => array(\n//                           'platform' => 'OS X 10.8',\n//                           'version' => 6\n//                       )\n//                   )\n//               )\n//           )\n//       )\n//   );\n// You can also use the following config to override default Moodle configuration for Behat.\n// This config is limited to default suite and will be supported in later versions.\n// It will have precedence over $CFG->behat_config.\n// $CFG->behat_profiles = array(\n//     'phantomjs' => array(\n//         'browser' => 'phantomjs',\n//         'tags' => '~@_file_upload&&~@_alert&&~@_bug_phantomjs',\n//         'wd_host' => 'http://127.0.0.1:4443/wd/hub',\n//         'capabilities' => array(\n//             'platform' => 'Linux',\n//             'version' => 2.1\n//         )\n//     ),\n// );\n//\n// You can force the browser session (not user's sessions) to restart after N seconds. This could\n// be useful if you are using a cloud-based service with time restrictions in the browser side.\n// Setting this value the browser session that Behat is using will be restarted. Set the time in\n// seconds. Is not recommended to use this setting if you don't explicitly need it.\n// Example:\n//   $CFG->behat_restart_browser_after = 7200;     // Restarts the browser session after 2 hours\n//\n// All this page's extra Moodle settings are compared against a white list of allowed settings\n// (the basic and behat_* ones) to avoid problems with production environments. This setting can be\n// used to expand the default white list with an array of extra settings.\n// Example:\n//   $CFG->behat_extraallowedsettings = array('somecoresetting', ...);\n//\n// You should explicitly allow the usage of the deprecated behat steps, otherwise an exception will\n// be thrown when using them. The setting is disabled by default.\n// Example:\n//   $CFG->behat_usedeprecated = true;\n//\n// Including feature files from directories outside the dirroot is possible if required. The setting\n// requires that the running user has executable permissions on all parent directories in the paths.\n// Example:\n//   $CFG->behat_additionalfeatures = array('/home/developer/code/wipfeatures');\n//\n// You can make behat save several dumps when a scenario fails. The dumps currently saved are:\n// * a dump of the DOM in it's state at the time of failure; and\n// * a screenshot (JavaScript is required for the screenshot functionality, so not all browsers support this option)\n// Example:\n//   $CFG->behat_faildump_path = '/my/path/to/save/failure/dumps';\n//\n// You can specify db, selenium wd_host etc. for behat parallel run by setting following variable.\n// Example:\n//   $CFG->behat_parallel_run = array (\n//       array (\n//           'dbtype' => 'mysqli',\n//           'dblibrary' => 'native',\n//           'dbhost' => 'localhost',\n//           'dbname' => 'moodletest',\n//           'dbuser' => 'moodle',\n//           'dbpass' => 'moodle',\n//           'behat_prefix' => 'mdl_',\n//           'wd_host' => 'http://127.0.0.1:4444/wd/hub',\n//           'behat_wwwroot' => 'http://127.0.0.1/moodle',\n//           'behat_dataroot' => '/home/example/bht_moodledata'\n//       ),\n//   );\n//\n// To change name of behat parallel run site, define BEHAT_PARALLEL_SITE_NAME and parallel run sites will be suffixed\n// with this value\n// Example:\n//   define('BEHAT_PARALLEL_SITE_NAME', 'behatparallelsite');\n//\n// Command line output for parallel behat install is limited to 80 chars, if you are installing more then 4 sites and\n// want to expand output to more then 80 chars, then define BEHAT_MAX_CMD_LINE_OUTPUT\n// Example:\n//   define('BEHAT_MAX_CMD_LINE_OUTPUT', 120);\n//\n// Behat feature files will be distributed randomly between the processes by default. If you have timing file or want\n// to create timing file then define BEHAT_FEATURE_TIMING_FILE with path to timing file. It will be updated for each\n// run with latest time taken to execute feature.\n// Example:\n//   define('BEHAT_FEATURE_TIMING_FILE', '/PATH_TO_TIMING_FILE/timing.json');\n//\n// If you don't have timing file and want some stable distribution of features, then you can use step counts to\n// distribute the features. You can generate step file by executing php admin/tool/behat/cli/util.php --updatesteps\n// this will update step file which is defined by BEHAT_FEATURE_STEP_FILE.\n// Example:\n//   define('BEHAT_FEATURE_STEP_FILE', '/PATH_TO_FEATURE_STEP_COUNT_FILE/stepcount.json');\n//\n// Feature distribution for each process is displayed as histogram. you can disable it by setting\n// BEHAT_DISABLE_HISTOGRAM\n// Example:\n//   define('BEHAT_DISABLE_HISTOGRAM', true);\n//\n//=========================================================================\n// 12. DEVELOPER DATA GENERATOR\n//=========================================================================\n//\n// The developer data generator tool is intended to be used only in development or testing sites and\n// it's usage in production environments is not recommended; if it is used to create JMeter test plans\n// is even less recommended as JMeter needs to log in as site course users. JMeter needs to know the\n// users passwords but would be dangerous to have a default password as everybody would know it, which would\n// be specially dangerouse if somebody uses this tool in a production site, so in order to prevent unintended\n// uses of the tool and undesired accesses as well, is compulsory to set a password for the users\n// generated by this tool, but only in case you want to generate a JMeter test. The value should be a string.\n// Example:\n//   $CFG->tool_generator_users_password = 'examplepassword';\n//\n//=========================================================================\n// 13. SYSTEM PATHS (You need to set following, depending on your system)\n//=========================================================================\n// Ghostscript path.\n// On most Linux installs, this can be left as '/usr/bin/gs'.\n// On Windows it will be something like 'c:\\gs\\bin\\gswin32c.exe' (make sure\n// there are no spaces in the path - if necessary copy the files 'gswin32c.exe'\n// and 'gsdll32.dll' to a new folder without a space in the path)\n//      $CFG->pathtogs = '/usr/bin/gs';\n//\n// Path to PHP CLI.\n// Probably something like /usr/bin/php. If you enter this, cron scripts can be\n// executed from admin web interface.\n// $CFG->pathtophp = '';\n//\n// Path to du.\n// Probably something like /usr/bin/du. If you enter this, pages that display\n// directory contents will run much faster for directories with a lot of files.\n//      $CFG->pathtodu = '';\n//\n// Path to aspell.\n// To use spell-checking within the editor, you MUST have aspell 0.50 or later\n// installed on your server, and you must specify the correct path to access the\n// aspell binary. On Unix/Linux systems, this path is usually /usr/bin/aspell,\n// but it might be something else.\n//      $CFG->aspellpath = '';\n//\n// Path to dot.\n// Probably something like /usr/bin/dot. To be able to generate graphics from\n// DOT files, you must have installed the dot executable and point to it here.\n// Note that, for now, this only used by the profiling features\n// (Development->Profiling) built into Moodle.\n//      $CFG->pathtodot = '';\n//\n// Path to unoconv.\n// Probably something like /usr/bin/unoconv. Used as a fallback to convert between document formats.\n// Unoconv is used convert between file formats supported by LibreOffice.\n// Use a recent version of unoconv ( >= 0.7 ), older versions have trouble running from a webserver.\n//      $CFG->pathtounoconv = '';\n//\n//=========================================================================\n// 14. ALTERNATIVE FILE SYSTEM SETTINGS\n//=========================================================================\n//\n// Alternative file system.\n// Since 3.3 it is possible to override file_storage and file_system API and use alternative storage systems (e.g. S3,\n// Rackspace Cloud Files, Google Cloud Storage, Azure Storage, etc.).\n// To set the alternative file storage system in config.php you can use the following setting, providing the\n// alternative system class name that will be auto-loaded by file_storage API.\n//\n//      $CFG->alternative_file_system_class = '\\\\local_myfilestorage\\\\file_system';\n//\n//=========================================================================\n// ALL DONE!  To continue installation, visit your main page with a browser\n//=========================================================================\n\nrequire_once(__DIR__ . '/lib/setup.php'); // Do not edit\n\n// There is no php closing tag in this file,\n// it is intentional because it prevents trailing whitespace problems!\n", "num_lines": 930}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n///////////////////////////////////////////////////////////////////////////\n//                                                                       //\n// Moodle configuration file                                             //\n//                                                                       //\n// This file should be renamed \"config.php\" in the top-level directory   //\n//                                                                       //\n///////////////////////////////////////////////////////////////////////////\n//                                                                       //\n// NOTICE OF COPYRIGHT                                                   //\n//                                                                       //\n// Moodle - Modular Object-Oriented Dynamic Learning Environment         //\n//          http://moodle.org                                            //\n//                                                                       //\n// Copyright (C) 1999 onwards  Martin Dougiamas  http://moodle.com       //\n//                                                                       //\n// This program is free software; you can redistribute it and/or modify  //\n// it under the terms of the GNU General Public License as published by  //\n// the Free Software Foundation; either version 3 of the License, or     //\n// (at your option) any later version.                                   //\n//                                                                       //\n// This program is distributed in the hope that it will be useful,       //\n// but WITHOUT ANY WARRANTY; without even the implied warranty of        //\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //\n// GNU General Public License for more details:                          //\n//                                                                       //\n//          http://www.gnu.org/copyleft/gpl.html                         //\n//                                                                       //\n///////////////////////////////////////////////////////////////////////////\nunset($CFG);  // Ignore this line\nglobal $CFG;  // This is necessary here for PHPUnit execution\n$CFG = new stdClass();\n\n//=========================================================================\n// 1. DATABASE SETUP\n//=========================================================================\n//GET database configuration from azure\n$connectstr_dbtype = ''; \n$connectstr_dbhost = '';\n$connectstr_dbname = '';\n$connectstr_dbusername = '';\n$connectstr_dbpassword = '';\n\n    $connectstr_dbtype = getenv('DATABASE_TYPE');\n    $connectstr_dbhost = getenv('DATABASE_HOST');\n    $connectstr_dbname = getenv('DATABASE_NAME');\n    $connectstr_dbusername = getenv('DATABASE_USERNAME');\n    $connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n$CFG->dbtype    = $connectstr_dbtype;\n$CFG->dblibrary = 'native';\n$CFG->dbhost    = $connectstr_dbhost;\n$CFG->dbname    = $connectstr_dbname;\n$CFG->dbuser    = $connectstr_dbusername;\n$CFG->dbpass    = $connectstr_dbpassword;\n$CFG->prefix    = 'mdl_';\n$CFG->dboptions = array(\n  'dbpersist' => false,       // should persistent database connections be\n                              //  used? set to 'false' for the most stable\n                              //  setting, 'true' can improve performance\n                              //  sometimes\n  'dbsocket'  => false,       // should connection via UNIX socket be used?\n                              //  if you set it to 'true' or custom path\n                              //  here set dbhost to 'localhost',\n                              //  (please note mysql is always using socket\n                              //  if dbhost is 'localhost' - if you need\n                              //  local port connection use '127.0.0.1')\n  'dbport'    => '',          // the TCP port number to use when connecting\n                              //  to the server. keep empty string for the\n                              //  default port\n  'dbhandlesoptions' => false,// On PostgreSQL poolers like pgbouncer don't\n                              // support advanced options on connection.\n                              // If you set those in the database then\n                              // the advanced settings will not be sent.\n  'dbcollation' => 'utf8mb4_unicode_ci', // MySQL has partial and full UTF-8\n                              // support. If you wish to use partial UTF-8\n                              // (three bytes) then set this option to\n                              // 'utf8_unicode_ci', otherwise this option\n                              // can be removed for MySQL (by default it will\n                              // use 'utf8mb4_unicode_ci'. This option should\n                              // be removed for all other databases.\n  // 'fetchbuffersize' => 100000, // On PostgreSQL, this option sets a limit\n                              // on the number of rows that are fetched into\n                              // memory when doing a large recordset query\n                              // (e.g. search indexing). Default is 100000.\n                              // Uncomment and set to a value to change it,\n                              // or zero to turn off the limit. You need to\n                              // set to zero if you are using pg_bouncer in\n                              // 'transaction' mode (it is fine in 'session'\n                              // mode).\n);\n\n\n//=========================================================================\n// 2. WEB SITE LOCATION\n//=========================================================================\n// Now you need to tell Moodle where it is located. Specify the full\n// web address to where moodle has been installed.  If your web site\n// is accessible via multiple URLs then choose the most natural one\n// that your students would use.  Do not include a trailing slash\n//\n// If you need both intranet and Internet access please read\n// http://docs.moodle.org/en/masquerading\n\n$CFG->wwwroot   = \"http://\".$_SERVER['HTTP_HOST'];\n//=========================================================================\n// 3. DATA FILES LOCATION\n//=========================================================================\n// Now you need a place where Moodle can save uploaded files.  This\n// directory should be readable AND WRITEABLE by the web server user\n// (usually 'nobody' or 'apache'), but it should not be accessible\n// directly via the web.\n//\n// - On hosting systems you might need to make sure that your \"group\" has\n//   no permissions at all, but that \"others\" have full permissions.\n//\n// - On Windows systems you might specify something like 'c:\\moodledata'\n\n$CFG->dataroot  = '/home/site/wwwroot/moodledata';\n\n\n//=========================================================================\n// 4. DATA FILES PERMISSIONS\n//=========================================================================\n// The following parameter sets the permissions of new directories\n// created by Moodle within the data directory.  The format is in\n// octal format (as used by the Unix utility chmod, for example).\n// The default is usually OK, but you may want to change it to 0750\n// if you are concerned about world-access to the files (you will need\n// to make sure the web server process (eg Apache) can access the files.\n// NOTE: the prefixed 0 is important, and don't use quotes.\n\n$CFG->directorypermissions = 02777;\n\n\n//=========================================================================\n// 5. DIRECTORY LOCATION  (most people can just ignore this setting)\n//=========================================================================\n// A very few webhosts use /admin as a special URL for you to access a\n// control panel or something.  Unfortunately this conflicts with the\n// standard location for the Moodle admin pages.  You can work around this\n// by renaming the admin directory in your installation, and putting that\n// new name here.  eg \"moodleadmin\".  This should fix all admin links in Moodle.\n// After any change you need to visit your new admin directory\n// and purge all caches.\n\n$CFG->admin = 'admin';\n\n\n//=========================================================================\n// 6. OTHER MISCELLANEOUS SETTINGS (ignore these for new installations)\n//=========================================================================\n//\n// These are additional tweaks for which no GUI exists in Moodle yet.\n//\n// Starting in PHP 5.3 administrators should specify default timezone\n// in PHP.ini, you can also specify it here if needed.\n// See details at: http://php.net/manual/en/function.date-default-timezone-set.php\n// List of time zones at: http://php.net/manual/en/timezones.php\n//     date_default_timezone_set('Australia/Perth');\n//\n// Change the key pair lifetime for Moodle Networking\n// The default is 28 days. You would only want to change this if the key\n// was not getting regenerated for any reason. You would probably want\n// make it much longer. Note that you'll need to delete and manually update\n// any existing key.\n//      $CFG->mnetkeylifetime = 28;\n//\n// Not recommended: Set the following to true to allow the use\n// off non-Moodle standard characters in usernames.\n//      $CFG->extendedusernamechars = true;\n//\n// Allow user passwords to be included in backup files. Very dangerous\n// setting as far as it publishes password hashes that can be unencrypted\n// if the backup file is publicy available. Use it only if you can guarantee\n// that all your backup files remain only privacy available and are never\n// shared out from your site/institution!\n//      $CFG->includeuserpasswordsinbackup = true;\n//\n// Completely disable user creation when restoring a course, bypassing any\n// permissions granted via roles and capabilities. Enabling this setting\n// results in the restore process stopping when a user attempts to restore a\n// course requiring users to be created.\n//     $CFG->disableusercreationonrestore = true;\n//\n// Keep the temporary directories used by backup and restore without being\n// deleted at the end of the process. Use it if you want to debug / view\n// all the information stored there after the process has ended. Note that\n// those directories may be deleted (after some ttl) both by cron and / or\n// by new backup / restore invocations.\n//     $CFG->keeptempdirectoriesonbackup = true;\n//\n// Modify the restore process in order to force the \"user checks\" to assume\n// that the backup originated from a different site, so detection of matching\n// users is performed with different (more \"relaxed\") rules. Note that this is\n// only useful if the backup file has been created using Moodle < 1.9.4 and the\n// site has been rebuilt from scratch using backup files (not the best way btw).\n// If you obtain user conflicts on restore, rather than enabling this setting\n// permanently, try restoring the backup on a different site, back it up again\n// and then restore on the target server.\n//    $CFG->forcedifferentsitecheckingusersonrestore = true;\n//\n// Force the backup system to continue to create backups in the legacy zip\n// format instead of the new tgz format. Does not affect restore, which\n// auto-detects the underlying file format.\n//    $CFG->usezipbackups = true;\n//\n// Prevent stats processing and hide the GUI\n//      $CFG->disablestatsprocessing = true;\n//\n// Setting this to true will enable admins to edit any post at any time\n//      $CFG->admineditalways = true;\n//\n// These variables define DEFAULT block variables for new courses\n// If this one is set it overrides all others and is the only one used.\n//      $CFG->defaultblocks_override = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// These variables define the specific settings for defined course formats.\n// They override any settings defined in the formats own config file.\n//      $CFG->defaultblocks_site = 'site_main_menu,course_list:course_summary,calendar_month';\n//      $CFG->defaultblocks_social = 'participants,search_forums,calendar_month,calendar_upcoming,social_activities,recent_activity,course_list';\n//      $CFG->defaultblocks_topics = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//      $CFG->defaultblocks_weeks = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// These blocks are used when no other default setting is found.\n//      $CFG->defaultblocks = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// You can specify a different class to be created for the $PAGE global, and to\n// compute which blocks appear on each page. However, I cannot think of any good\n// reason why you would need to change that. It just felt wrong to hard-code the\n// the class name. You are strongly advised not to use these to settings unless\n// you are absolutely sure you know what you are doing.\n//      $CFG->moodlepageclass = 'moodle_page';\n//      $CFG->moodlepageclassfile = \"$CFG->dirroot/local/myplugin/mypageclass.php\";\n//      $CFG->blockmanagerclass = 'block_manager';\n//      $CFG->blockmanagerclassfile = \"$CFG->dirroot/local/myplugin/myblockamanagerclass.php\";\n//\n// Seconds for files to remain in caches. Decrease this if you are worried\n// about students being served outdated versions of uploaded files.\n//     $CFG->filelifetime = 60*60*6;\n//\n// Some web servers can offload the file serving from PHP process,\n// comment out one the following options to enable it in Moodle:\n//     $CFG->xsendfile = 'X-Sendfile';           // Apache {@see https://tn123.org/mod_xsendfile/}\n//     $CFG->xsendfile = 'X-LIGHTTPD-send-file'; // Lighttpd {@see http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file}\n//     $CFG->xsendfile = 'X-Accel-Redirect';     // Nginx {@see http://wiki.nginx.org/XSendfile}\n// If your X-Sendfile implementation (usually Nginx) uses directory aliases specify them\n// in the following array setting:\n//     $CFG->xsendfilealiases = array(\n//         '/dataroot/' => $CFG->dataroot,\n//         '/cachedir/' => '/var/www/moodle/cache',    // for custom $CFG->cachedir locations\n//         '/localcachedir/' => '/var/local/cache',    // for custom $CFG->localcachedir locations\n//         '/tempdir/'  => '/var/www/moodle/temp',     // for custom $CFG->tempdir locations\n//         '/filedir'   => '/var/www/moodle/filedir',  // for custom $CFG->filedir locations\n//     );\n//\n// YUI caching may be sometimes improved by slasharguments:\n//     $CFG->yuislasharguments = 1;\n// Some servers may need a special rewrite rule to work around internal path length limitations:\n// RewriteRule (^.*/theme/yui_combo\\.php)(/.*) $1?file=$2\n//\n//\n// Following settings may be used to select session driver, uncomment only one of the handlers.\n//   Database session handler (not compatible with MyISAM):\n//      $CFG->session_handler_class = '\\core\\session\\database';\n//      $CFG->session_database_acquire_lock_timeout = 120;\n//\n//   File session handler (file system locking required):\n//      $CFG->session_handler_class = '\\core\\session\\file';\n//      $CFG->session_file_save_path = $CFG->dataroot.'/sessions';\n        $CFG->session_file_save_path = '/usr/local/php/tmp';\n//\n//   Memcached session handler (requires memcached server and extension):\n//      $CFG->session_handler_class = '\\core\\session\\memcached';\n//      $CFG->session_memcached_save_path = '127.0.0.1:11211';\n//      $CFG->session_memcached_prefix = 'memc.sess.key.';\n//      $CFG->session_memcached_acquire_lock_timeout = 120;\n//      $CFG->session_memcached_lock_expire = 7200;       // Ignored if PECL memcached is below version 2.2.0\n//      $CFG->session_memcached_lock_retry_sleep = 150;   // Spin-lock retry sleeptime (msec). Only effective\n//                                                        // for tuning php-memcached 3.0.x (PHP 7)\n//\n//   Redis session handler (requires redis server and redis extension):\n//      $CFG->session_handler_class = '\\core\\session\\redis';\n//     $CFG->session_redis_host = '127.0.0.1';\n//      $CFG->session_redis_port = 6379;  // Optional.\n//      $CFG->session_redis_database = 0;  // Optional, default is db 0.\n//      $CFG->session_redis_auth = ''; // Optional, default is don't set one.\n//      $CFG->session_redis_prefix = ''; // Optional, default is don't set one.\n//      $CFG->session_redis_acquire_lock_timeout = 120;\n//      $CFG->session_redis_lock_expire = 7200;\n//      Use the igbinary serializer instead of the php default one. Note that phpredis must be compiled with\n//      igbinary support to make the setting to work. Also, if you change the serializer you have to flush the database!\n//      $CFG->session_redis_serializer_use_igbinary = false; // Optional, default is PHP builtin serializer.\n//\n// Please be aware that when selecting Memcached for sessions that it is advised to use a dedicated\n// memcache server. The memcached extension does not provide isolated environments for individual uses.\n// Using the same server for other purposes (MUC for example) can lead to sessions being prematurely removed should\n// the other uses of the server purge the cache.\n//\n// Following setting allows you to alter how frequently is timemodified updated in sessions table.\n//      $CFG->session_update_timemodified_frequency = 20; // In seconds.\n//\n// If this setting is set to true, then Moodle will track the IP of the\n// current user to make sure it hasn't changed during a session.  This\n// will prevent the possibility of sessions being hijacked via XSS, but it\n// may break things for users coming using proxies that change all the time,\n// like AOL.\n//      $CFG->tracksessionip = true;\n//\n// The following lines are for handling email bounces.\n//      $CFG->handlebounces = true;\n//      $CFG->minbounces = 10;\n//      $CFG->bounceratio = .20;\n// The next lines are needed both for bounce handling and any other email to module processing.\n// mailprefix must be EXACTLY four characters.\n// Uncomment and customise this block for Postfix\n//      $CFG->mailprefix = 'mdl+'; // + is the separator for Exim and Postfix.\n//      $CFG->mailprefix = 'mdl-'; // - is the separator for qmail\n//      $CFG->maildomain = 'youremaildomain.com';\n//\n// Enable when setting up advanced reverse proxy load balancing configurations,\n// it may be also necessary to enable this when using port forwarding.\n//      $CFG->reverseproxy = true;\n//\n// Enable when using external SSL appliance for performance reasons.\n// Please note that site may be accessible via http: or https:, but not both!\n//      $CFG->sslproxy = true;\n//\n// This setting will cause the userdate() function not to fix %d in\n// date strings, and just let them show with a zero prefix.\n//      $CFG->nofixday = true;\n//\n// This setting will make some graphs (eg user logs) use lines instead of bars\n//      $CFG->preferlinegraphs = true;\n//\n// This setting allows you to specify a class to rewrite outgoing urls\n// enabling 'clean urls' in conjunction with an apache / nginx handler.\n// The handler must implement \\core\\output\\url_rewriter.\n//      $CFG->urlrewriteclass = '\\local_cleanurls\\url_rewriter';\n//\n// Enabling this will allow custom scripts to replace existing moodle scripts.\n// For example: if $CFG->customscripts/course/view.php exists then\n// it will be used instead of $CFG->wwwroot/course/view.php\n// At present this will only work for files that include config.php and are called\n// as part of the url (index.php is implied).\n// Some examples are:\n//      http://my.moodle.site/course/view.php\n//      http://my.moodle.site/index.php\n//      http://my.moodle.site/admin            (index.php implied)\n// Custom scripts should not include config.php\n// Warning: Replacing standard moodle scripts may pose security risks and/or may not\n// be compatible with upgrades. Use this option only if you are aware of the risks\n// involved.\n// Specify the full directory path to the custom scripts\n//      $CFG->customscripts = '/home/example/customscripts';\n//\n// Performance profiling\n//\n//   If you set Debug to \"Yes\" in the Configuration->Variables page some\n//   performance profiling data will show up on your footer (in default theme).\n//   With these settings you get more granular control over the capture\n//   and printout of the data\n//\n//   Capture performance profiling data\n//   define('MDL_PERF'  , true);\n//\n//   Capture additional data from DB\n//   define('MDL_PERFDB'  , true);\n//\n//   Print to log (for passive profiling of production servers)\n//   define('MDL_PERFTOLOG'  , true);\n//\n//   Print to footer (works with the default theme)\n//   define('MDL_PERFTOFOOT', true);\n//\n//   Enable earlier profiling that causes more code to be covered\n//   on every request (db connections, config load, other inits...).\n//   Requires extra configuration to be defined in config.php like:\n//   profilingincluded, profilingexcluded, profilingautofrec,\n//   profilingallowme, profilingallowall, profilinglifetime\n//       $CFG->earlyprofilingenabled = true;\n//\n// Disable database storage for profile data.\n// When using an exernal plugin to store profiling data it is often\n// desirable to not store the data in the database.\n//\n//      $CFG->disableprofilingtodatabase = true;\n//\n// Force displayed usernames\n//   A little hack to anonymise user names for all students.  If you set these\n//   then all non-teachers will always see these for every person.\n//       $CFG->forcefirstname = 'Bruce';\n//       $CFG->forcelastname  = 'Simpson';\n//\n// The following setting will turn on username logging into Apache log. For full details regarding setting\n// up of this function please refer to the install section of the document.\n//     $CFG->apacheloguser = 0; // Turn this feature off. Default value.\n//     $CFG->apacheloguser = 1; // Log user id.\n//     $CFG->apacheloguser = 2; // Log full name in cleaned format. ie, Darth Vader will be displayed as darth_vader.\n//     $CFG->apacheloguser = 3; // Log username.\n// To get the values logged in Apache's log, add to your httpd.conf\n// the following statements. In the General part put:\n//     LogFormat \"%h %l %{MOODLEUSER}n %t \\\"%r\\\" %s %b \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" moodleformat\n// And in the part specific to your Moodle install / virtualhost:\n//     CustomLog \"/your/path/to/log\" moodleformat\n//\n// Alternatively for other webservers such as nginx, you can instead have the username sent via a http header\n// 'X-MOODLEUSER' which can be saved in the logfile and then stripped out before being sent to the browser:\n//     $CFG->headerloguser = 0; // Turn this feature off. Default value.\n//     $CFG->headerloguser = 1; // Log user id.\n//     $CFG->headerloguser = 2; // Log full name in cleaned format. ie, Darth Vader will be displayed as darth_vader.\n//     $CFG->headerloguser = 3; // Log username.\n//\n// CAUTION: Use of this option will expose usernames in the Apache / nginx log,\n// If you are going to publish your log, or the output of your web stats analyzer\n// this will weaken the security of your website.\n//\n// Email database connection errors to someone.  If Moodle cannot connect to the\n// database, then email this address with a notice.\n//\n//     $CFG->emailconnectionerrorsto = 'your@emailaddress.com';\n//\n// Set the priority of themes from highest to lowest. This is useful (for\n// example) in sites where the user theme should override all other theme\n// settings for accessibility reasons. You can also disable types of themes\n// (other than site)  by removing them from the array. The default setting is:\n//\n//     $CFG->themeorder = array('course', 'category', 'session', 'user', 'cohort', 'site');\n//\n// NOTE: course, category, session, user, cohort themes still require the\n// respective settings to be enabled\n//\n// It is possible to add extra themes directory stored outside of $CFG->dirroot.\n// This local directory does not have to be accessible from internet.\n//\n//     $CFG->themedir = '/location/of/extra/themes';\n//\n// It is possible to specify different cache and temp directories, use local fast filesystem\n// for normal web servers. Server clusters MUST use shared filesystem for cachedir!\n// Localcachedir is intended for server clusters, it does not have to be shared by cluster nodes.\n// The directories must not be accessible via web.\n//\n//     $CFG->tempdir = '/var/www/moodle/temp';        // Directory MUST BE SHARED by all cluster nodes.\n//     $CFG->cachedir = '/var/www/moodle/cache';      // Directory MUST BE SHARED by all cluster nodes, locking required.\n//     $CFG->localcachedir = '/var/local/cache';      // Intended for local node caching.\n//\n// It is possible to specify a different backup temp directory, use local fast filesystem\n// for normal web servers. Server clusters MUST use shared filesystem for backuptempdir!\n// The directory must not be accessible via web.\n//\n//     $CFG->backuptempdir = '/var/www/moodle/backuptemp';  // Directory MUST BE SHARED by all cluster nodes.\n//\n// Some filesystems such as NFS may not support file locking operations.\n// Locking resolves race conditions and is strongly recommended for production servers.\n//     $CFG->preventfilelocking = false;\n//\n// Site default language can be set via standard administration interface. If you\n// want to have initial error messages for eventual database connection problems\n// localized too, you have to set your language code here.\n//\n//     $CFG->lang = 'yourlangcode'; // for example 'cs'\n//\n// When Moodle is about to perform an intensive operation it raises PHP's memory\n// limit. The following setting should be used on large sites to set the raised\n// memory limit to something higher.\n// The value for the settings should be a valid PHP memory value. e.g. 512M, 1G\n//\n//     $CFG->extramemorylimit = '1024M';\n//\n// Moodle 2.4 introduced a new cache API.\n// The cache API stores a configuration file within the Moodle data directory and\n// uses that rather than the database in order to function in a stand-alone manner.\n// Using altcacheconfigpath you can change the location where this config file is\n// looked for.\n// It can either be a directory in which to store the file, or the full path to the\n// file if you want to take full control. Either way it must be writable by the\n// webserver.\n//\n//     $CFG->altcacheconfigpath = '/var/www/shared/moodle.cache.config.php\n//\n// Use the following flag to completely disable the Available update notifications\n// feature and hide it from the server administration UI.\n//\n//      $CFG->disableupdatenotifications = true;\n//\n// Use the following flag to completely disable the installation of plugins\n// (new plugins, available updates and missing dependencies) and related\n// features (such as cancelling the plugin installation or upgrade) via the\n// server administration web interface.\n//\n//      $CFG->disableupdateautodeploy = true;\n//\n// Use the following flag to disable the warning on the system notifications page\n// about present development libraries. This flag will not disable the warning within\n// the security overview report. Use this flag only if you really have prohibited web\n// access to the development libraries in your webserver configuration.\n//\n//      $CFG->disabledevlibdirscheck = true;\n//\n// Use the following flag to disable modifications to scheduled tasks\n// whilst still showing the state of tasks.\n//\n//      $CFG->preventscheduledtaskchanges = true;\n//\n// As of version 2.4 Moodle serves icons as SVG images if the users browser appears\n// to support SVG.\n// For those wanting to control the serving of SVG images the following setting can\n// be defined in your config.php.\n// If it is not defined then the default (browser detection) will occur.\n//\n// To ensure they are always used when available:\n//      $CFG->svgicons = true;\n//\n// To ensure they are never used even when available:\n//      $CFG->svgicons = false;\n//\n// Some administration options allow setting the path to executable files. This can\n// potentially cause a security risk. Set this option to true to disable editing\n// those config settings via the web. They will need to be set explicitly in the\n// config.php file\n//      $CFG->preventexecpath = true;\n//\n// Use the following flag to set userid for noreply user. If not set then moodle will\n// create dummy user and use -ve value as user id.\n//      $CFG->noreplyuserid = -10;\n//\n// As of version 2.6 Moodle supports admin to set support user. If not set, all mails\n// will be sent to supportemail.\n//      $CFG->supportuserid = -20;\n//\n// Moodle 2.7 introduces a locking api for critical tasks (e.g. cron).\n// The default locking system to use is DB locking for Postgres, and file locking for\n// MySQL, Oracle and SQLServer. If $CFG->preventfilelocking is set, then the default\n// will always be DB locking. It can be manually set to one of the lock\n// factory classes listed below, or one of your own custom classes implementing the\n// \\core\\lock\\lock_factory interface.\n//\n//      $CFG->lock_factory = \"auto\";\n//\n// The list of available lock factories is:\n//\n// \"\\\\core\\\\lock\\\\file_lock_factory\" - File locking\n//      Uses lock files stored by default in the dataroot. Whether this\n//      works on clusters depends on the file system used for the dataroot.\n//\n// \"\\\\core\\\\lock\\\\db_record_lock_factory\" - DB locking based on table rows.\n//\n// \"\\\\core\\\\lock\\\\postgres_lock_factory\" - DB locking based on postgres advisory locks.\n//\n// Settings used by the lock factories\n//\n// Location for lock files used by the File locking factory. This must exist\n// on a shared file system that supports locking.\n//      $CFG->lock_file_root = $CFG->dataroot . '/lock';\n//\n// Moodle 2.9 allows administrators to customise the list of supported file types.\n// To add a new filetype or override the definition of an existing one, set the\n// customfiletypes variable like this:\n//\n// $CFG->customfiletypes = array(\n//     (object)array(\n//         'extension' => 'frog',\n//         'icon' => 'archive',\n//         'type' => 'application/frog',\n//         'customdescription' => 'Amphibian-related file archive'\n//     )\n// );\n//\n// The extension, icon, and type fields are required. The icon field can refer to\n// any icon inside the pix/f folder. You can also set the customdescription field\n// (shown above) and (for advanced use) the groups, string, and defaulticon fields.\n//\n// Upgrade key\n//\n// If the upgrade key is defined here, then the value must be provided every time\n// the site is being upgraded though the web interface, regardless of whether the\n// administrator is logged in or not. This prevents anonymous access to the upgrade\n// screens where the real authentication and authorization mechanisms can not be\n// relied on.\n//\n// It is strongly recommended to use a value different from your real account\n// password.\n//\n//      $CFG->upgradekey = 'put_some_password-like_value_here';\n//\n// Document conversion limit\n//\n// How many times the background task should attempt to convert a given attempt\n// before removing it from the queue. Currently this limit is only used by the\n// mod_assign conversion task.\n//\n//      $CFG->conversionattemptlimit = 3;\n//\n// Font used in exported PDF files. When generating a PDF, Moodle embeds a subset of\n// the font in the PDF file so it will be readable on the widest range of devices.\n// The default font is 'freesans' which is part of the GNU FreeFont collection.\n//\n//      $CFG->pdfexportfont = 'freesans';\n//\n// Use the following flag to enable messagingallusers and set the default preference\n// value for existing users to allow them to be contacted by other site users.\n//\n//      $CFG->keepmessagingallusersenabled = true;\n//\n// Disable login token validation for login pages. Login token validation is enabled\n// by default unless $CFG->alternateloginurl is set.\n//\n//      $CFG->disablelogintoken = true;\n//\n//=========================================================================\n// 7. SETTINGS FOR DEVELOPMENT SERVERS - not intended for production use!!!\n//=========================================================================\n//\n// Force a debugging mode regardless the settings in the site administration\n// @error_reporting(E_ALL | E_STRICT); // NOT FOR PRODUCTION SERVERS!\n// @ini_set('display_errors', '1');    // NOT FOR PRODUCTION SERVERS!\n// $CFG->debug = (E_ALL | E_STRICT);   // === DEBUG_DEVELOPER - NOT FOR PRODUCTION SERVERS!\n// $CFG->debugdisplay = 1;             // NOT FOR PRODUCTION SERVERS!\n//\n// You can specify a comma separated list of user ids that that always see\n// debug messages, this overrides the debug flag in $CFG->debug and $CFG->debugdisplay\n// for these users only.\n// $CFG->debugusers = '2';\n//\n// Prevent theme caching\n// $CFG->themedesignermode = true; // NOT FOR PRODUCTION SERVERS!\n//\n// Enable verbose debug information during fetching of email messages from IMAP server.\n// $CFG->debugimap = true;\n//\n// Prevent JS caching\n// $CFG->cachejs = false; // NOT FOR PRODUCTION SERVERS!\n//\n// Restrict which YUI logging statements are shown in the browser console.\n// For details see the upstream documentation:\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logInclude\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logExclude\n// $CFG->yuiloginclude = array(\n//     'moodle-core-dock-loader' => true,\n//     'moodle-course-categoryexpander' => true,\n// );\n// $CFG->yuilogexclude = array(\n//     'moodle-core-dock' => true,\n//     'moodle-core-notification' => true,\n// );\n//\n// Set the minimum log level for YUI logging statements.\n// For details see the upstream documentation:\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logLevel\n// $CFG->yuiloglevel = 'debug';\n//\n// Prevent core_string_manager application caching\n// $CFG->langstringcache = false; // NOT FOR PRODUCTION SERVERS!\n//\n// When working with production data on test servers, no emails or other messages\n// should ever be send to real users\n// $CFG->noemailever = true;    // NOT FOR PRODUCTION SERVERS!\n//\n// Divert all outgoing emails to this address to test and debug emailing features\n// $CFG->divertallemailsto = 'root@localhost.local'; // NOT FOR PRODUCTION SERVERS!\n//\n// Except for certain email addresses you want to let through for testing. Accepts\n// a comma separated list of regexes.\n// $CFG->divertallemailsexcept = 'tester@dev.com, fred(\\+.*)?@example.com'; // NOT FOR PRODUCTION SERVERS!\n//\n// Uncomment if you want to allow empty comments when modifying install.xml files.\n// $CFG->xmldbdisablecommentchecking = true;    // NOT FOR PRODUCTION SERVERS!\n//\n// Since 2.0 sql queries are not shown during upgrade by default.\n// Please note that this setting may produce very long upgrade page on large sites.\n// $CFG->upgradeshowsql = true; // NOT FOR PRODUCTION SERVERS!\n//\n// Add SQL queries to the output of cron, just before their execution\n// $CFG->showcronsql = true;\n//\n// Force developer level debug and add debug info to the output of cron\n// $CFG->showcrondebugging = true;\n//\n//=========================================================================\n// 8. FORCED SETTINGS\n//=========================================================================\n// It is possible to specify normal admin settings here, the point is that\n// they can not be changed through the standard admin settings pages any more.\n//\n// Core settings are specified directly via assignment to $CFG variable.\n// Example:\n//   $CFG->somecoresetting = 'value';\n//\n// Plugin settings have to be put into a special array.\n// Example:\n//   $CFG->forced_plugin_settings = array('pluginname'  => array('settingname' => 'value', 'secondsetting' => 'othervalue'),\n//                                        'otherplugin' => array('mysetting' => 'myvalue', 'thesetting' => 'thevalue'));\n// Module default settings with advanced/locked checkboxes can be set too. To do this, add\n// an extra config with '_adv' or '_locked' as a suffix and set the value to true or false.\n// Example:\n//   $CFG->forced_plugin_settings = array('pluginname'  => array('settingname' => 'value', 'settingname_locked' => true, 'settingname_adv' => true));\n//\n//=========================================================================\n// 9. PHPUNIT SUPPORT\n//=========================================================================\n// $CFG->phpunit_prefix = 'phpu_';\n// $CFG->phpunit_dataroot = '/home/example/phpu_moodledata';\n// $CFG->phpunit_directorypermissions = 02777; // optional\n// $CFG->phpunit_profilingenabled = true; // optional to profile PHPUnit runs.\n//\n//\n//=========================================================================\n// 10. SECRET PASSWORD SALT\n//=========================================================================\n// A site-wide password salt is no longer used in new installations.\n// If upgrading from 2.6 or older, keep all existing salts in config.php file.\n//\n// $CFG->passwordsaltmain = 'a_very_long_random_string_of_characters#@6&*1';\n//\n// You may also have some alternative salts to allow migration from previously\n// used salts.\n//\n// $CFG->passwordsaltalt1 = '';\n// $CFG->passwordsaltalt2 = '';\n// $CFG->passwordsaltalt3 = '';\n// ....\n// $CFG->passwordsaltalt19 = '';\n// $CFG->passwordsaltalt20 = '';\n//\n//\n//=========================================================================\n// 11. BEHAT SUPPORT\n//=========================================================================\n// Behat test site needs a unique www root, data directory and database prefix:\n//\n// $CFG->behat_wwwroot = 'http://127.0.0.1/moodle';\n// $CFG->behat_prefix = 'bht_';\n// $CFG->behat_dataroot = '/home/example/bht_moodledata';\n//\n// You can override default Moodle configuration for Behat and add your own\n// params; here you can add more profiles, use different Mink drivers than Selenium...\n// These params would be merged with the default Moodle behat.yml, giving priority\n// to the ones specified here. The array format is YAML, following the Behat\n// params hierarchy. More info: http://docs.behat.org/guides/7.config.html\n// Example:\n//   $CFG->behat_config = array(\n//       'Mac-Firefox' => array(\n//           'suites' => array (\n//               'default' => array(\n//                   'filters' => array(\n//                      'tags' => '~@_file_upload'\n//                   ),\n//               ),\n//           ),\n//           'extensions' => array(\n//               'Behat\\MinkExtension' => array(\n//                   'selenium2' => array(\n//                       'browser' => 'firefox',\n//                       'capabilities' => array(\n//                           'platform' => 'OS X 10.6',\n//                           'version' => 20\n//                       )\n//                   )\n//               )\n//           )\n//       ),\n//       'Mac-Safari' => array(\n//           'extensions' => array(\n//               'Behat\\MinkExtension' => array(\n//                   'selenium2' => array(\n//                       'browser' => 'safari',\n//                       'capabilities' => array(\n//                           'platform' => 'OS X 10.8',\n//                           'version' => 6\n//                       )\n//                   )\n//               )\n//           )\n//       )\n//   );\n// You can also use the following config to override default Moodle configuration for Behat.\n// This config is limited to default suite and will be supported in later versions.\n// It will have precedence over $CFG->behat_config.\n// $CFG->behat_profiles = array(\n//     'phantomjs' => array(\n//         'browser' => 'phantomjs',\n//         'tags' => '~@_file_upload&&~@_alert&&~@_bug_phantomjs',\n//         'wd_host' => 'http://127.0.0.1:4443/wd/hub',\n//         'capabilities' => array(\n//             'platform' => 'Linux',\n//             'version' => 2.1\n//         )\n//     ),\n// );\n//\n// You can force the browser session (not user's sessions) to restart after N seconds. This could\n// be useful if you are using a cloud-based service with time restrictions in the browser side.\n// Setting this value the browser session that Behat is using will be restarted. Set the time in\n// seconds. Is not recommended to use this setting if you don't explicitly need it.\n// Example:\n//   $CFG->behat_restart_browser_after = 7200;     // Restarts the browser session after 2 hours\n//\n// All this page's extra Moodle settings are compared against a white list of allowed settings\n// (the basic and behat_* ones) to avoid problems with production environments. This setting can be\n// used to expand the default white list with an array of extra settings.\n// Example:\n//   $CFG->behat_extraallowedsettings = array('somecoresetting', ...);\n//\n// You should explicitly allow the usage of the deprecated behat steps, otherwise an exception will\n// be thrown when using them. The setting is disabled by default.\n// Example:\n//   $CFG->behat_usedeprecated = true;\n//\n// Including feature files from directories outside the dirroot is possible if required. The setting\n// requires that the running user has executable permissions on all parent directories in the paths.\n// Example:\n//   $CFG->behat_additionalfeatures = array('/home/developer/code/wipfeatures');\n//\n// You can make behat save several dumps when a scenario fails. The dumps currently saved are:\n// * a dump of the DOM in it's state at the time of failure; and\n// * a screenshot (JavaScript is required for the screenshot functionality, so not all browsers support this option)\n// Example:\n//   $CFG->behat_faildump_path = '/my/path/to/save/failure/dumps';\n//\n// You can specify db, selenium wd_host etc. for behat parallel run by setting following variable.\n// Example:\n//   $CFG->behat_parallel_run = array (\n//       array (\n//           'dbtype' => 'mysqli',\n//           'dblibrary' => 'native',\n//           'dbhost' => 'localhost',\n//           'dbname' => 'moodletest',\n//           'dbuser' => 'moodle',\n//           'dbpass' => 'moodle',\n//           'behat_prefix' => 'mdl_',\n//           'wd_host' => 'http://127.0.0.1:4444/wd/hub',\n//           'behat_wwwroot' => 'http://127.0.0.1/moodle',\n//           'behat_dataroot' => '/home/example/bht_moodledata'\n//       ),\n//   );\n//\n// To change name of behat parallel run site, define BEHAT_PARALLEL_SITE_NAME and parallel run sites will be suffixed\n// with this value\n// Example:\n//   define('BEHAT_PARALLEL_SITE_NAME', 'behatparallelsite');\n//\n// Command line output for parallel behat install is limited to 80 chars, if you are installing more then 4 sites and\n// want to expand output to more then 80 chars, then define BEHAT_MAX_CMD_LINE_OUTPUT\n// Example:\n//   define('BEHAT_MAX_CMD_LINE_OUTPUT', 120);\n//\n// Behat feature files will be distributed randomly between the processes by default. If you have timing file or want\n// to create timing file then define BEHAT_FEATURE_TIMING_FILE with path to timing file. It will be updated for each\n// run with latest time taken to execute feature.\n// Example:\n//   define('BEHAT_FEATURE_TIMING_FILE', '/PATH_TO_TIMING_FILE/timing.json');\n//\n// If you don't have timing file and want some stable distribution of features, then you can use step counts to\n// distribute the features. You can generate step file by executing php admin/tool/behat/cli/util.php --updatesteps\n// this will update step file which is defined by BEHAT_FEATURE_STEP_FILE.\n// Example:\n//   define('BEHAT_FEATURE_STEP_FILE', '/PATH_TO_FEATURE_STEP_COUNT_FILE/stepcount.json');\n//\n// Feature distribution for each process is displayed as histogram. you can disable it by setting\n// BEHAT_DISABLE_HISTOGRAM\n// Example:\n//   define('BEHAT_DISABLE_HISTOGRAM', true);\n//\n//=========================================================================\n// 12. DEVELOPER DATA GENERATOR\n//=========================================================================\n//\n// The developer data generator tool is intended to be used only in development or testing sites and\n// it's usage in production environments is not recommended; if it is used to create JMeter test plans\n// is even less recommended as JMeter needs to log in as site course users. JMeter needs to know the\n// users passwords but would be dangerous to have a default password as everybody would know it, which would\n// be specially dangerouse if somebody uses this tool in a production site, so in order to prevent unintended\n// uses of the tool and undesired accesses as well, is compulsory to set a password for the users\n// generated by this tool, but only in case you want to generate a JMeter test. The value should be a string.\n// Example:\n   $CFG->tool_generator_users_password = 'testpassword';\n//\n//=========================================================================\n// 13. SYSTEM PATHS (You need to set following, depending on your system)\n//=========================================================================\n// Ghostscript path.\n// On most Linux installs, this can be left as '/usr/bin/gs'.\n// On Windows it will be something like 'c:\\gs\\bin\\gswin32c.exe' (make sure\n// there are no spaces in the path - if necessary copy the files 'gswin32c.exe'\n// and 'gsdll32.dll' to a new folder without a space in the path)\n//      $CFG->pathtogs = '/usr/bin/gs';\n//\n// Path to PHP CLI.\n// Probably something like /usr/bin/php. If you enter this, cron scripts can be\n// executed from admin web interface.\n// $CFG->pathtophp = '';\n//\n// Path to du.\n// Probably something like /usr/bin/du. If you enter this, pages that display\n// directory contents will run much faster for directories with a lot of files.\n//      $CFG->pathtodu = '';\n//\n// Path to aspell.\n// To use spell-checking within the editor, you MUST have aspell 0.50 or later\n// installed on your server, and you must specify the correct path to access the\n// aspell binary. On Unix/Linux systems, this path is usually /usr/bin/aspell,\n// but it might be something else.\n//      $CFG->aspellpath = '';\n//\n// Path to dot.\n// Probably something like /usr/bin/dot. To be able to generate graphics from\n// DOT files, you must have installed the dot executable and point to it here.\n// Note that, for now, this only used by the profiling features\n// (Development->Profiling) built into Moodle.\n//      $CFG->pathtodot = '';\n//\n// Path to unoconv.\n// Probably something like /usr/bin/unoconv. Used as a fallback to convert between document formats.\n// Unoconv is used convert between file formats supported by LibreOffice.\n// Use a recent version of unoconv ( >= 0.7 ), older versions have trouble running from a webserver.\n//      $CFG->pathtounoconv = '';\n//\n//=========================================================================\n// 14. ALTERNATIVE FILE SYSTEM SETTINGS\n//=========================================================================\n//\n// Alternative file system.\n// Since 3.3 it is possible to override file_storage and file_system API and use alternative storage systems (e.g. S3,\n// Rackspace Cloud Files, Google Cloud Storage, Azure Storage, etc.).\n// To set the alternative file storage system in config.php you can use the following setting, providing the\n// alternative system class name that will be auto-loaded by file_storage API.\n//\n//      $CFG->alternative_file_system_class = '\\\\local_myfilestorage\\\\file_system';\n//\n//=========================================================================\n// ALL DONE!  To continue installation, visit your main page with a browser\n//=========================================================================\n\nrequire_once(__DIR__ . '/lib/setup.php'); // Do not edit\n\n// There is no php closing tag in this file,\n// it is intentional because it prevents trailing whitespace problems!\n", "num_lines": 938}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Functions to support installation process\n *\n * @package    core\n * @subpackage install\n * @copyright  2009 Petr Skoda (http://skodak.org)\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefined('MOODLE_INTERNAL') || die();\n\n/** INSTALL_WELCOME = 0 */\ndefine('INSTALL_WELCOME',       0);\n/** INSTALL_ENVIRONMENT = 1 */\ndefine('INSTALL_ENVIRONMENT',   1);\n/** INSTALL_PATHS = 2 */\ndefine('INSTALL_PATHS',         2);\n/** INSTALL_DOWNLOADLANG = 3 */\ndefine('INSTALL_DOWNLOADLANG',  3);\n/** INSTALL_DATABASETYPE = 4 */\ndefine('INSTALL_DATABASETYPE',  4);\n/** INSTALL_DATABASE = 5 */\ndefine('INSTALL_DATABASE',      5);\n/** INSTALL_SAVE = 6 */\ndefine('INSTALL_SAVE',          6);\n\n/**\n * Tries to detect the right www root setting.\n * @return string detected www root\n */\nfunction install_guess_wwwroot() {\n    $wwwroot = '';\n    if (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off') {\n        $wwwroot .= 'http://';\n    } else {\n        $wwwroot .= 'https://';\n    }\n    $hostport = explode(':', $_SERVER['HTTP_HOST']);\n    $wwwroot .= reset($hostport);\n    if ($_SERVER['SERVER_PORT'] != 80 and $_SERVER['SERVER_PORT'] != '443') {\n        $wwwroot .= ':'.$_SERVER['SERVER_PORT'];\n    }\n    $wwwroot .= $_SERVER['SCRIPT_NAME'];\n\n    list($wwwroot, $xtra) = explode('/install.php', $wwwroot);\n\n    return $wwwroot;\n}\n\n/**\n * Copy of @see{ini_get_bool()}\n * @param string $ini_get_arg\n * @return bool\n */\nfunction install_ini_get_bool($ini_get_arg) {\n    $temp = ini_get($ini_get_arg);\n\n    if ($temp == '1' or strtolower($temp) == 'on') {\n        return true;\n    }\n    return false;\n}\n\n/**\n * Creates dataroot if not exists yet,\n * makes sure it is writable, add lang directory\n * and add .htaccess just in case it works.\n *\n * @param string $dataroot full path to dataroot\n * @param int $dirpermissions\n * @return bool success\n */\nfunction install_init_dataroot($dataroot, $dirpermissions) {\n    if (file_exists($dataroot) and !is_dir($dataroot)) {\n        // file with the same name exists\n        return false;\n    }\n\n    umask(0000); // $CFG->umaskpermissions is not set yet.\n    if (!file_exists($dataroot)) {\n        if (!mkdir($dataroot, $dirpermissions, true)) {\n            // most probably this does not work, but anyway\n            return false;\n        }\n    }\n    @chmod($dataroot, $dirpermissions);\n\n    if (!is_writable($dataroot)) {\n        return false; // we can not continue\n    }\n\n    // create the directory for $CFG->tempdir\n    if (!is_dir(\"$dataroot/temp\")) {\n        if (!mkdir(\"$dataroot/temp\", $dirpermissions, true)) {\n            return false;\n        }\n    }\n    if (!is_writable(\"$dataroot/temp\")) {\n        return false; // we can not continue\n    }\n\n    // create the directory for $CFG->cachedir\n    if (!is_dir(\"$dataroot/cache\")) {\n        if (!mkdir(\"$dataroot/cache\", $dirpermissions, true)) {\n            return false;\n        }\n    }\n    if (!is_writable(\"$dataroot/cache\")) {\n        return false; // we can not continue\n    }\n\n    // create the directory for $CFG->langotherroot\n    if (!is_dir(\"$dataroot/lang\")) {\n        if (!mkdir(\"$dataroot/lang\", $dirpermissions, true)) {\n            return false;\n        }\n    }\n    if (!is_writable(\"$dataroot/lang\")) {\n        return false; // we can not continue\n    }\n\n    // finally just in case some broken .htaccess that prevents access just in case it is allowed\n    if (!file_exists(\"$dataroot/.htaccess\")) {\n        if ($handle = fopen(\"$dataroot/.htaccess\", 'w')) {\n            fwrite($handle, \"deny from all\\r\\nAllowOverride None\\r\\nNote: this file is broken intentionally, we do not want anybody to undo it in subdirectory!\\r\\n\");\n            fclose($handle);\n        } else {\n            return false;\n        }\n    }\n\n    return true;\n}\n\n/**\n * Print help button\n * @param string $url\n * @param string $titel\n * @return void\n */\nfunction install_helpbutton($url, $title='') {\n    if ($title == '') {\n        $title = get_string('help');\n    }\n    echo \"<a href=\\\"javascript:void(0)\\\" \";\n    echo \"onclick=\\\"return window.open('$url','Help','menubar=0,location=0,scrollbars,resizable,width=500,height=400')\\\"\";\n    echo \">\";\n    echo \"<img src=\\\"pix/help.gif\\\" class=\\\"iconhelp\\\" alt=\\\"$title\\\" title=\\\"$title\\\"/>\";\n    echo \"</a>\\n\";\n}\n\n/**\n * This is in function because we want the /install.php to parse in PHP4\n *\n * @param object $database\n * @param string $dbhsot\n * @param string $dbuser\n * @param string $dbpass\n * @param string $dbname\n * @param string $prefix\n * @param mixed $dboptions\n * @return string\n */\nfunction install_db_validate($database, $dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions) {\n    try {\n        try {\n            $database->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions);\n        } catch (moodle_exception $e) {\n            // let's try to create new database\n            if ($database->create_database($dbhost, $dbuser, $dbpass, $dbname, $dboptions)) {\n                $database->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions);\n            } else {\n                throw $e;\n            }\n        }\n        return '';\n    } catch (dml_exception $ex) {\n        $stringmanager = get_string_manager();\n        $errorstring = $ex->errorcode.'oninstall';\n        $legacystring = $ex->errorcode;\n        if ($stringmanager->string_exists($errorstring, $ex->module)) {\n            // By using a different string id from the error code we are separating exception handling and output.\n            $returnstring = $stringmanager->get_string($errorstring, $ex->module, $ex->a);\n            if ($ex->debuginfo) {\n                $returnstring .= '<br />'.$ex->debuginfo;\n            }\n\n            return $returnstring;\n        } else if ($stringmanager->string_exists($legacystring, $ex->module)) {\n            // There are some DML exceptions that may be thrown here as well as during normal operation.\n            // If we have a translated message already we still want to serve it here.\n            // However it is not the preferred way.\n            $returnstring = $stringmanager->get_string($legacystring, $ex->module, $ex->a);\n            if ($ex->debuginfo) {\n                $returnstring .= '<br />'.$ex->debuginfo;\n            }\n\n            return $returnstring;\n        }\n        // No specific translation. Deliver a generic error message.\n        return $stringmanager->get_string('dmlexceptiononinstall', 'error', $ex);\n    }\n}\n\n/**\n * Returns content of config.php file.\n *\n * Uses PHP_EOL for generating proper end of lines for the given platform.\n *\n * @param moodle_database $database database instance\n * @param object $cfg copy of $CFG\n * @return string\n */\nfunction install_generate_configphp($database, $cfg) {\n    $configphp = '<?php  // Moodle configuration file' . PHP_EOL . PHP_EOL;\n\n    $configphp .= 'unset($CFG);' . PHP_EOL;\n    $configphp .= 'global $CFG;' . PHP_EOL;\n    $configphp .= '$CFG = new stdClass();' . PHP_EOL . PHP_EOL; // prevent PHP5 strict warnings\n\n    $dbconfig = $database->export_dbconfig();\n\n    foreach ($dbconfig as $key=>$value) {\n        $key = str_pad($key, 9);\n        $configphp .= '$CFG->'.$key.' = '.var_export($value, true) . ';' . PHP_EOL;\n    }\n    $configphp .= PHP_EOL;\n\n    $configphp .= '$CFG->wwwroot   = '.var_export($cfg->wwwroot, true) . ';' . PHP_EOL ;\n\n    $configphp .= '$CFG->dataroot  = '.var_export($cfg->dataroot, true) . ';' . PHP_EOL;\n\n    $configphp .= '$CFG->admin     = '.var_export($cfg->admin, true) . ';' . PHP_EOL . PHP_EOL;\n\n    if (empty($cfg->directorypermissions)) {\n        $chmod = '02777';\n    } else {\n        $chmod = '0' . decoct($cfg->directorypermissions);\n    }\n    $configphp .= '$CFG->directorypermissions = ' . $chmod . ';' . PHP_EOL . PHP_EOL;\n\n    if (isset($cfg->upgradekey) and $cfg->upgradekey !== '') {\n        $configphp .= '$CFG->upgradekey = ' . var_export($cfg->upgradekey, true) . ';' . PHP_EOL . PHP_EOL;\n    }\n    $configphp .= '$CFG->session_file_save_path = \\'/usr/local/php/tmp\\';'.PHP_EOL . PHP_EOL;\n    $configphp .= 'require_once(__DIR__ . \\'/lib/setup.php\\');' . PHP_EOL . PHP_EOL;\n    $configphp .= '// There is no php closing tag in this file,' . PHP_EOL;\n    $configphp .= '// it is intentional because it prevents trailing whitespace problems!' . PHP_EOL;\n\n    return $configphp;\n}\n\n/**\n * Prints complete help page used during installation.\n * Does not return.\n *\n * @global object\n * @param string $help\n */\nfunction install_print_help_page($help) {\n    global $CFG, $OUTPUT; //TODO: MUST NOT USE $OUTPUT HERE!!!\n\n    @header('Content-Type: text/html; charset=UTF-8');\n    @header('X-UA-Compatible: IE=edge');\n    @header('Cache-Control: no-store, no-cache, must-revalidate');\n    @header('Cache-Control: post-check=0, pre-check=0', false);\n    @header('Pragma: no-cache');\n    @header('Expires: Mon, 20 Aug 1969 09:23:00 GMT');\n    @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');\n\n    echo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">';\n    echo '<html dir=\"'.(right_to_left() ? 'rtl' : 'ltr').'\">\n          <head>\n          <link rel=\"shortcut icon\" href=\"theme/clean/pix/favicon.ico\" />\n          <link rel=\"stylesheet\" type=\"text/css\" href=\"'.$CFG->wwwroot.'/install/css.php\" />\n          <title>'.get_string('installation','install').'</title>\n          <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n          </head><body>';\n    switch ($help) {\n        case 'phpversionhelp':\n            print_string($help, 'install', phpversion());\n            break;\n        case 'memorylimithelp':\n            print_string($help, 'install', @ini_get('memory_limit'));\n            break;\n        default:\n            print_string($help, 'install');\n    }\n    echo $OUTPUT->close_window_button(); //TODO: MUST NOT USE $OUTPUT HERE!!!\n    echo '</body></html>';\n    die;\n}\n\n/**\n * Prints installation page header, we can no use weblib yet in installer.\n *\n * @global object\n * @param array $config\n * @param string $stagename\n * @param string $heading\n * @param string $stagetext\n * @param string $stageclass\n * @return void\n */\nfunction install_print_header($config, $stagename, $heading, $stagetext, $stageclass = \"alert-info\") {\n    global $CFG;\n\n    @header('Content-Type: text/html; charset=UTF-8');\n    @header('X-UA-Compatible: IE=edge');\n    @header('Cache-Control: no-store, no-cache, must-revalidate');\n    @header('Cache-Control: post-check=0, pre-check=0', false);\n    @header('Pragma: no-cache');\n    @header('Expires: Mon, 20 Aug 1969 09:23:00 GMT');\n    @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');\n\n    echo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">';\n    echo '<html dir=\"'.(right_to_left() ? 'rtl' : 'ltr').'\">\n          <head>\n          <link rel=\"shortcut icon\" href=\"theme/clean/pix/favicon.ico\" />';\n\n    echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.$CFG->wwwroot.'/install/css.php\" />\n          <title>'.get_string('installation','install').' - Moodle '.$CFG->target_release.'</title>\n          <meta name=\"robots\" content=\"noindex\">\n          <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n          <meta http-equiv=\"pragma\" content=\"no-cache\" />\n          <meta http-equiv=\"expires\" content=\"0\" />';\n\n    echo '</head><body class=\"notloggedin\">\n            <div id=\"page\" class=\"stage'.$config->stage.'\">\n                <div id=\"page-header\">\n                    <div id=\"header\" class=\" clearfix\">\n                        <h1 class=\"headermain\">'.get_string('installation','install').'</h1>\n                        <div class=\"headermenu\">&nbsp;</div>\n                    </div>\n                    <div class=\"navbar clearfix\">\n                        <nav class=\"breadcrumb-nav\">\n                            <ul class=\"breadcrumb\"><li class=\"first\">'.$stagename.'</li></ul>\n                        </nav>\n                        <div class=\"navbutton\">&nbsp;</div>\n                    </div>\n                </div>\n          <!-- END OF HEADER -->\n          <div id=\"installdiv\">';\n\n    echo '<h2>'.$heading.'</h2>';\n\n    if ($stagetext !== '') {\n        echo '<div class=\"alert ' . $stageclass . '\">';\n        echo $stagetext;\n        echo '</div>';\n    }\n    // main\n    echo '<form id=\"installform\" method=\"post\" action=\"install.php\"><fieldset>';\n    foreach ($config as $name=>$value) {\n        echo '<input type=\"hidden\" name=\"'.$name.'\" value=\"'.s($value).'\" />';\n    }\n}\n\n/**\n * Prints installation page header, we can no use weblib yet in isntaller.\n *\n * @global object\n * @param array $config\n * @param bool $reload print reload button instead of next\n * @return void\n */\nfunction install_print_footer($config, $reload=false) {\n    global $CFG;\n\n    if ($config->stage > INSTALL_WELCOME) {\n        $first = '<input type=\"submit\" id=\"previousbutton\" name=\"previous\" value=\"&laquo; '.s(get_string('previous')).'\" />';\n    } else {\n        $first = '<input type=\"submit\" id=\"previousbutton\" name=\"next\" value=\"'.s(get_string('reload')).'\" />';\n        $first .= '<script type=\"text/javascript\">\n//<![CDATA[\n    var first = document.getElementById(\"previousbutton\");\n    first.style.visibility = \"hidden\";\n//]]>\n</script>\n';\n    }\n\n    if ($reload) {\n        $next = '<input type=\"submit\" id=\"nextbutton\" class=\"btn btn-primary\" name=\"next\" value=\"'.s(get_string('reload')).'\" />';\n    } else {\n        $next = '<input type=\"submit\" id=\"nextbutton\" class=\"btn btn-primary\" name=\"next\" value=\"'.s(get_string('next')).' &raquo;\" />';\n    }\n\n    echo '</fieldset><fieldset id=\"nav_buttons\">'.$first.$next.'</fieldset>';\n\n    $homelink  = '<div class=\"sitelink\">'.\n       '<a title=\"Moodle '. $CFG->target_release .'\" href=\"http://docs.moodle.org/en/Administrator_documentation\" onclick=\"this.target=\\'_blank\\'\">'.\n       '<img src=\"pix/moodlelogo.png\" alt=\"'.get_string('moodlelogo').'\" /></a></div>';\n\n    echo '</form></div>';\n    echo '<div id=\"page-footer\">'.$homelink.'</div>';\n    echo '</div></body></html>';\n}\n\n/**\n * Install Moodle DB,\n * config.php must exist, there must not be any tables in db yet.\n *\n * @param array $options adminpass is mandatory\n * @param bool $interactive\n * @return void\n */\nfunction install_cli_database(array $options, $interactive) {\n    global $CFG, $DB;\n    require_once($CFG->libdir.'/environmentlib.php');\n    require_once($CFG->libdir.'/upgradelib.php');\n\n    // show as much debug as possible\n    @error_reporting(E_ALL | E_STRICT);\n    @ini_set('display_errors', '1');\n    $CFG->debug = (E_ALL | E_STRICT);\n    $CFG->debugdisplay = true;\n    $CFG->debugdeveloper = true;\n\n    $CFG->version = '';\n    $CFG->release = '';\n    $CFG->branch = '';\n\n    $version = null;\n    $release = null;\n    $branch = null;\n\n    // read $version and $release\n    require($CFG->dirroot.'/version.php');\n\n    if ($DB->get_tables() ) {\n        cli_error(get_string('clitablesexist', 'install'));\n    }\n\n    if (empty($options['adminpass'])) {\n        cli_error('Missing required admin password');\n    }\n\n    // test environment first\n    list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);\n    if (!$envstatus) {\n        $errors = environment_get_errors($environment_results);\n        cli_heading(get_string('environment', 'admin'));\n        foreach ($errors as $error) {\n            list($info, $report) = $error;\n            echo \"!! $info !!\\n$report\\n\\n\";\n        }\n        exit(1);\n    }\n\n    if (!$DB->setup_is_unicodedb()) {\n        if (!$DB->change_db_encoding()) {\n            // If could not convert successfully, throw error, and prevent installation\n            cli_error(get_string('unicoderequired', 'admin'));\n        }\n    }\n\n    if ($interactive) {\n        cli_separator();\n        cli_heading(get_string('databasesetup'));\n    }\n\n    // install core\n    install_core($version, true);\n    set_config('release', $release);\n    set_config('branch', $branch);\n\n    if (PHPUNIT_TEST) {\n        // mark as test database as soon as possible\n        set_config('phpunittest', 'na');\n    }\n\n    // install all plugins types, local, etc.\n    upgrade_noncore(true);\n\n    // set up admin user password\n    $DB->set_field('user', 'password', hash_internal_user_password($options['adminpass']), array('username' => 'admin'));\n\n    // Set the admin email address if specified.\n    if (isset($options['adminemail'])) {\n        $DB->set_field('user', 'email', $options['adminemail'], array('username' => 'admin'));\n    }\n\n    // rename admin username if needed\n    if (isset($options['adminuser']) and $options['adminuser'] !== 'admin' and $options['adminuser'] !== 'guest') {\n        $DB->set_field('user', 'username', $options['adminuser'], array('username' => 'admin'));\n    }\n\n    // indicate that this site is fully configured\n    set_config('rolesactive', 1);\n    upgrade_finished();\n\n    // log in as admin - we need do anything when applying defaults\n    \\core\\session\\manager::set_user(get_admin());\n\n    // apply all default settings, do it twice to fill all defaults - some settings depend on other setting\n    admin_apply_default_settings(NULL, true);\n    admin_apply_default_settings(NULL, true);\n    set_config('registerauth', '');\n\n    // set the site name\n    if (isset($options['shortname']) and $options['shortname'] !== '') {\n        $DB->set_field('course', 'shortname', $options['shortname'], array('format' => 'site'));\n    }\n    if (isset($options['fullname']) and $options['fullname'] !== '') {\n        $DB->set_field('course', 'fullname', $options['fullname'], array('format' => 'site'));\n    }\n    if (isset($options['summary'])) {\n        $DB->set_field('course', 'summary', $options['summary'], array('format' => 'site'));\n    }\n\n    // Redirect to site registration on first login.\n    set_config('registrationpending', 1);\n}\n", "num_lines": 532}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n///////////////////////////////////////////////////////////////////////////\n//                                                                       //\n// Moodle configuration file                                             //\n//                                                                       //\n// This file should be renamed \"config.php\" in the top-level directory   //\n//                                                                       //\n///////////////////////////////////////////////////////////////////////////\n//                                                                       //\n// NOTICE OF COPYRIGHT                                                   //\n//                                                                       //\n// Moodle - Modular Object-Oriented Dynamic Learning Environment         //\n//          http://moodle.org                                            //\n//                                                                       //\n// Copyright (C) 1999 onwards  Martin Dougiamas  http://moodle.com       //\n//                                                                       //\n// This program is free software; you can redistribute it and/or modify  //\n// it under the terms of the GNU General Public License as published by  //\n// the Free Software Foundation; either version 3 of the License, or     //\n// (at your option) any later version.                                   //\n//                                                                       //\n// This program is distributed in the hope that it will be useful,       //\n// but WITHOUT ANY WARRANTY; without even the implied warranty of        //\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //\n// GNU General Public License for more details:                          //\n//                                                                       //\n//          http://www.gnu.org/copyleft/gpl.html                         //\n//                                                                       //\n///////////////////////////////////////////////////////////////////////////\nunset($CFG);  // Ignore this line\nglobal $CFG;  // This is necessary here for PHPUnit execution\n$CFG = new stdClass();\n\n//=========================================================================\n// 1. DATABASE SETUP\n//=========================================================================\n//GET database configuration from azure\n$connectstr_dbtype = ''; \n$connectstr_dbhost = '';\n$connectstr_dbname = '';\n$connectstr_dbusername = '';\n$connectstr_dbpassword = '';\n\n    $connectstr_dbtype = getenv('DATABASE_TYPE');\n    $connectstr_dbhost = getenv('DATABASE_HOST');\n    $connectstr_dbname = getenv('DATABASE_NAME');\n    $connectstr_dbusername = getenv('DATABASE_USERNAME');\n    $connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n$CFG->dbtype    = $connectstr_dbtype;\n$CFG->dblibrary = 'native';\n$CFG->dbhost    = $connectstr_dbhost;\n$CFG->dbname    = $connectstr_dbname;\n$CFG->dbuser    = $connectstr_dbusername;\n$CFG->dbpass    = $connectstr_dbpassword;\n$CFG->prefix    = 'mdl_';\n$CFG->dboptions = array(\n  'dbpersist' => false,       // should persistent database connections be\n                              //  used? set to 'false' for the most stable\n                              //  setting, 'true' can improve performance\n                              //  sometimes\n  'dbsocket'  => false,       // should connection via UNIX socket be used?\n                              //  if you set it to 'true' or custom path\n                              //  here set dbhost to 'localhost',\n                              //  (please note mysql is always using socket\n                              //  if dbhost is 'localhost' - if you need\n                              //  local port connection use '127.0.0.1')\n  'dbport'    => '',          // the TCP port number to use when connecting\n                              //  to the server. keep empty string for the\n                              //  default port\n  'dbhandlesoptions' => false,// On PostgreSQL poolers like pgbouncer don't\n                              // support advanced options on connection.\n                              // If you set those in the database then\n                              // the advanced settings will not be sent.\n  'dbcollation' => 'utf8mb4_unicode_ci', // MySQL has partial and full UTF-8\n                              // support. If you wish to use partial UTF-8\n                              // (three bytes) then set this option to\n                              // 'utf8_unicode_ci', otherwise this option\n                              // can be removed for MySQL (by default it will\n                              // use 'utf8mb4_unicode_ci'. This option should\n                              // be removed for all other databases.\n  // 'fetchbuffersize' => 100000, // On PostgreSQL, this option sets a limit\n                              // on the number of rows that are fetched into\n                              // memory when doing a large recordset query\n                              // (e.g. search indexing). Default is 100000.\n                              // Uncomment and set to a value to change it,\n                              // or zero to turn off the limit. You need to\n                              // set to zero if you are using pg_bouncer in\n                              // 'transaction' mode (it is fine in 'session'\n                              // mode).\n);\n\n\n//=========================================================================\n// 2. WEB SITE LOCATION\n//=========================================================================\n// Now you need to tell Moodle where it is located. Specify the full\n// web address to where moodle has been installed.  If your web site\n// is accessible via multiple URLs then choose the most natural one\n// that your students would use.  Do not include a trailing slash\n//\n// If you need both intranet and Internet access please read\n// http://docs.moodle.org/en/masquerading\n\n$CFG->wwwroot   = \"http://\".$_SERVER['HTTP_HOST'];\n//=========================================================================\n// 3. DATA FILES LOCATION\n//=========================================================================\n// Now you need a place where Moodle can save uploaded files.  This\n// directory should be readable AND WRITEABLE by the web server user\n// (usually 'nobody' or 'apache'), but it should not be accessible\n// directly via the web.\n//\n// - On hosting systems you might need to make sure that your \"group\" has\n//   no permissions at all, but that \"others\" have full permissions.\n//\n// - On Windows systems you might specify something like 'c:\\moodledata'\n\n$CFG->dataroot  = '/var/moodledata';\n\n\n//=========================================================================\n// 4. DATA FILES PERMISSIONS\n//=========================================================================\n// The following parameter sets the permissions of new directories\n// created by Moodle within the data directory.  The format is in\n// octal format (as used by the Unix utility chmod, for example).\n// The default is usually OK, but you may want to change it to 0750\n// if you are concerned about world-access to the files (you will need\n// to make sure the web server process (eg Apache) can access the files.\n// NOTE: the prefixed 0 is important, and don't use quotes.\n\n$CFG->directorypermissions = 02777;\n\n\n//=========================================================================\n// 5. DIRECTORY LOCATION  (most people can just ignore this setting)\n//=========================================================================\n// A very few webhosts use /admin as a special URL for you to access a\n// control panel or something.  Unfortunately this conflicts with the\n// standard location for the Moodle admin pages.  You can work around this\n// by renaming the admin directory in your installation, and putting that\n// new name here.  eg \"moodleadmin\".  This should fix all admin links in Moodle.\n// After any change you need to visit your new admin directory\n// and purge all caches.\n\n$CFG->admin = 'admin';\n\n\n//=========================================================================\n// 6. OTHER MISCELLANEOUS SETTINGS (ignore these for new installations)\n//=========================================================================\n//\n// These are additional tweaks for which no GUI exists in Moodle yet.\n//\n// Starting in PHP 5.3 administrators should specify default timezone\n// in PHP.ini, you can also specify it here if needed.\n// See details at: http://php.net/manual/en/function.date-default-timezone-set.php\n// List of time zones at: http://php.net/manual/en/timezones.php\n//     date_default_timezone_set('Australia/Perth');\n//\n// Change the key pair lifetime for Moodle Networking\n// The default is 28 days. You would only want to change this if the key\n// was not getting regenerated for any reason. You would probably want\n// make it much longer. Note that you'll need to delete and manually update\n// any existing key.\n//      $CFG->mnetkeylifetime = 28;\n//\n// Not recommended: Set the following to true to allow the use\n// off non-Moodle standard characters in usernames.\n//      $CFG->extendedusernamechars = true;\n//\n// Allow user passwords to be included in backup files. Very dangerous\n// setting as far as it publishes password hashes that can be unencrypted\n// if the backup file is publicy available. Use it only if you can guarantee\n// that all your backup files remain only privacy available and are never\n// shared out from your site/institution!\n//      $CFG->includeuserpasswordsinbackup = true;\n//\n// Completely disable user creation when restoring a course, bypassing any\n// permissions granted via roles and capabilities. Enabling this setting\n// results in the restore process stopping when a user attempts to restore a\n// course requiring users to be created.\n//     $CFG->disableusercreationonrestore = true;\n//\n// Keep the temporary directories used by backup and restore without being\n// deleted at the end of the process. Use it if you want to debug / view\n// all the information stored there after the process has ended. Note that\n// those directories may be deleted (after some ttl) both by cron and / or\n// by new backup / restore invocations.\n//     $CFG->keeptempdirectoriesonbackup = true;\n//\n// Modify the restore process in order to force the \"user checks\" to assume\n// that the backup originated from a different site, so detection of matching\n// users is performed with different (more \"relaxed\") rules. Note that this is\n// only useful if the backup file has been created using Moodle < 1.9.4 and the\n// site has been rebuilt from scratch using backup files (not the best way btw).\n// If you obtain user conflicts on restore, rather than enabling this setting\n// permanently, try restoring the backup on a different site, back it up again\n// and then restore on the target server.\n//    $CFG->forcedifferentsitecheckingusersonrestore = true;\n//\n// Force the backup system to continue to create backups in the legacy zip\n// format instead of the new tgz format. Does not affect restore, which\n// auto-detects the underlying file format.\n//    $CFG->usezipbackups = true;\n//\n// Prevent stats processing and hide the GUI\n//      $CFG->disablestatsprocessing = true;\n//\n// Setting this to true will enable admins to edit any post at any time\n//      $CFG->admineditalways = true;\n//\n// These variables define DEFAULT block variables for new courses\n// If this one is set it overrides all others and is the only one used.\n//      $CFG->defaultblocks_override = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// These variables define the specific settings for defined course formats.\n// They override any settings defined in the formats own config file.\n//      $CFG->defaultblocks_site = 'site_main_menu,course_list:course_summary,calendar_month';\n//      $CFG->defaultblocks_social = 'participants,search_forums,calendar_month,calendar_upcoming,social_activities,recent_activity,course_list';\n//      $CFG->defaultblocks_topics = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//      $CFG->defaultblocks_weeks = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// These blocks are used when no other default setting is found.\n//      $CFG->defaultblocks = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// You can specify a different class to be created for the $PAGE global, and to\n// compute which blocks appear on each page. However, I cannot think of any good\n// reason why you would need to change that. It just felt wrong to hard-code the\n// the class name. You are strongly advised not to use these to settings unless\n// you are absolutely sure you know what you are doing.\n//      $CFG->moodlepageclass = 'moodle_page';\n//      $CFG->moodlepageclassfile = \"$CFG->dirroot/local/myplugin/mypageclass.php\";\n//      $CFG->blockmanagerclass = 'block_manager';\n//      $CFG->blockmanagerclassfile = \"$CFG->dirroot/local/myplugin/myblockamanagerclass.php\";\n//\n// Seconds for files to remain in caches. Decrease this if you are worried\n// about students being served outdated versions of uploaded files.\n//     $CFG->filelifetime = 60*60*6;\n//\n// Some web servers can offload the file serving from PHP process,\n// comment out one the following options to enable it in Moodle:\n//     $CFG->xsendfile = 'X-Sendfile';           // Apache {@see https://tn123.org/mod_xsendfile/}\n//     $CFG->xsendfile = 'X-LIGHTTPD-send-file'; // Lighttpd {@see http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file}\n//     $CFG->xsendfile = 'X-Accel-Redirect';     // Nginx {@see http://wiki.nginx.org/XSendfile}\n// If your X-Sendfile implementation (usually Nginx) uses directory aliases specify them\n// in the following array setting:\n//     $CFG->xsendfilealiases = array(\n//         '/dataroot/' => $CFG->dataroot,\n//         '/cachedir/' => '/var/moodledata/cache/',    // for custom $CFG->cachedir locations\n//         '/localcachedir/' => '/var/moodledata/localcache/',    // for custom $CFG->localcachedir locations\n//         '/tempdir/'  => '/var/moodledata/temp/',     // for custom $CFG->tempdir locations\n//         '/filedir'   => $CFG->dataroot.'/filedir',  // for custom $CFG->filedir locations\n//     );\n//\n// YUI caching may be sometimes improved by slasharguments:\n//     $CFG->yuislasharguments = 1;\n// Some servers may need a special rewrite rule to work around internal path length limitations:\n// RewriteRule (^.*/theme/yui_combo\\.php)(/.*) $1?file=$2\n//\n//\n// Following settings may be used to select session driver, uncomment only one of the handlers.\n//   Database session handler (not compatible with MyISAM):\n//      $CFG->session_handler_class = '\\core\\session\\database';\n//      $CFG->session_database_acquire_lock_timeout = 120;\n//\n//   File session handler (file system locking required):\n//      $CFG->session_handler_class = '\\core\\session\\file';\n//      $CFG->session_file_save_path = $CFG->dataroot.'/sessions';\n        $CFG->session_file_save_path = '/usr/local/php/tmp';\n//\n//   Memcached session handler (requires memcached server and extension):\n//      $CFG->session_handler_class = '\\core\\session\\memcached';\n//      $CFG->session_memcached_save_path = '127.0.0.1:11211';\n//      $CFG->session_memcached_prefix = 'memc.sess.key.';\n//      $CFG->session_memcached_acquire_lock_timeout = 120;\n//      $CFG->session_memcached_lock_expire = 7200;       // Ignored if PECL memcached is below version 2.2.0\n//      $CFG->session_memcached_lock_retry_sleep = 150;   // Spin-lock retry sleeptime (msec). Only effective\n//                                                        // for tuning php-memcached 3.0.x (PHP 7)\n//\n//   Redis session handler (requires redis server and redis extension):\n//      $CFG->session_handler_class = '\\core\\session\\redis';\n//     $CFG->session_redis_host = '127.0.0.1';\n//      $CFG->session_redis_port = 6379;  // Optional.\n//      $CFG->session_redis_database = 0;  // Optional, default is db 0.\n//      $CFG->session_redis_auth = ''; // Optional, default is don't set one.\n//      $CFG->session_redis_prefix = ''; // Optional, default is don't set one.\n//      $CFG->session_redis_acquire_lock_timeout = 120;\n//      $CFG->session_redis_lock_expire = 7200;\n//      Use the igbinary serializer instead of the php default one. Note that phpredis must be compiled with\n//      igbinary support to make the setting to work. Also, if you change the serializer you have to flush the database!\n//      $CFG->session_redis_serializer_use_igbinary = false; // Optional, default is PHP builtin serializer.\n//\n// Please be aware that when selecting Memcached for sessions that it is advised to use a dedicated\n// memcache server. The memcached extension does not provide isolated environments for individual uses.\n// Using the same server for other purposes (MUC for example) can lead to sessions being prematurely removed should\n// the other uses of the server purge the cache.\n//\n// Following setting allows you to alter how frequently is timemodified updated in sessions table.\n//      $CFG->session_update_timemodified_frequency = 20; // In seconds.\n//\n// If this setting is set to true, then Moodle will track the IP of the\n// current user to make sure it hasn't changed during a session.  This\n// will prevent the possibility of sessions being hijacked via XSS, but it\n// may break things for users coming using proxies that change all the time,\n// like AOL.\n//      $CFG->tracksessionip = true;\n//\n// The following lines are for handling email bounces.\n//      $CFG->handlebounces = true;\n//      $CFG->minbounces = 10;\n//      $CFG->bounceratio = .20;\n// The next lines are needed both for bounce handling and any other email to module processing.\n// mailprefix must be EXACTLY four characters.\n// Uncomment and customise this block for Postfix\n//      $CFG->mailprefix = 'mdl+'; // + is the separator for Exim and Postfix.\n//      $CFG->mailprefix = 'mdl-'; // - is the separator for qmail\n//      $CFG->maildomain = 'youremaildomain.com';\n//\n// Enable when setting up advanced reverse proxy load balancing configurations,\n// it may be also necessary to enable this when using port forwarding.\n//      $CFG->reverseproxy = true;\n//\n// Enable when using external SSL appliance for performance reasons.\n// Please note that site may be accessible via http: or https:, but not both!\n//      $CFG->sslproxy = true;\n//\n// This setting will cause the userdate() function not to fix %d in\n// date strings, and just let them show with a zero prefix.\n//      $CFG->nofixday = true;\n//\n// This setting will make some graphs (eg user logs) use lines instead of bars\n//      $CFG->preferlinegraphs = true;\n//\n// This setting allows you to specify a class to rewrite outgoing urls\n// enabling 'clean urls' in conjunction with an apache / nginx handler.\n// The handler must implement \\core\\output\\url_rewriter.\n//      $CFG->urlrewriteclass = '\\local_cleanurls\\url_rewriter';\n//\n// Enabling this will allow custom scripts to replace existing moodle scripts.\n// For example: if $CFG->customscripts/course/view.php exists then\n// it will be used instead of $CFG->wwwroot/course/view.php\n// At present this will only work for files that include config.php and are called\n// as part of the url (index.php is implied).\n// Some examples are:\n//      http://my.moodle.site/course/view.php\n//      http://my.moodle.site/index.php\n//      http://my.moodle.site/admin            (index.php implied)\n// Custom scripts should not include config.php\n// Warning: Replacing standard moodle scripts may pose security risks and/or may not\n// be compatible with upgrades. Use this option only if you are aware of the risks\n// involved.\n// Specify the full directory path to the custom scripts\n//      $CFG->customscripts = '/home/example/customscripts';\n//\n// Performance profiling\n//\n//   If you set Debug to \"Yes\" in the Configuration->Variables page some\n//   performance profiling data will show up on your footer (in default theme).\n//   With these settings you get more granular control over the capture\n//   and printout of the data\n//\n//   Capture performance profiling data\n//   define('MDL_PERF'  , true);\n//\n//   Capture additional data from DB\n//   define('MDL_PERFDB'  , true);\n//\n//   Print to log (for passive profiling of production servers)\n//   define('MDL_PERFTOLOG'  , true);\n//\n//   Print to footer (works with the default theme)\n//   define('MDL_PERFTOFOOT', true);\n//\n//   Enable earlier profiling that causes more code to be covered\n//   on every request (db connections, config load, other inits...).\n//   Requires extra configuration to be defined in config.php like:\n//   profilingincluded, profilingexcluded, profilingautofrec,\n//   profilingallowme, profilingallowall, profilinglifetime\n//       $CFG->earlyprofilingenabled = true;\n//\n// Disable database storage for profile data.\n// When using an exernal plugin to store profiling data it is often\n// desirable to not store the data in the database.\n//\n//      $CFG->disableprofilingtodatabase = true;\n//\n// Force displayed usernames\n//   A little hack to anonymise user names for all students.  If you set these\n//   then all non-teachers will always see these for every person.\n//       $CFG->forcefirstname = 'Bruce';\n//       $CFG->forcelastname  = 'Simpson';\n//\n// The following setting will turn on username logging into Apache log. For full details regarding setting\n// up of this function please refer to the install section of the document.\n//     $CFG->apacheloguser = 0; // Turn this feature off. Default value.\n//     $CFG->apacheloguser = 1; // Log user id.\n//     $CFG->apacheloguser = 2; // Log full name in cleaned format. ie, Darth Vader will be displayed as darth_vader.\n//     $CFG->apacheloguser = 3; // Log username.\n// To get the values logged in Apache's log, add to your httpd.conf\n// the following statements. In the General part put:\n//     LogFormat \"%h %l %{MOODLEUSER}n %t \\\"%r\\\" %s %b \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" moodleformat\n// And in the part specific to your Moodle install / virtualhost:\n//     CustomLog \"/your/path/to/log\" moodleformat\n//\n// Alternatively for other webservers such as nginx, you can instead have the username sent via a http header\n// 'X-MOODLEUSER' which can be saved in the logfile and then stripped out before being sent to the browser:\n//     $CFG->headerloguser = 0; // Turn this feature off. Default value.\n//     $CFG->headerloguser = 1; // Log user id.\n//     $CFG->headerloguser = 2; // Log full name in cleaned format. ie, Darth Vader will be displayed as darth_vader.\n//     $CFG->headerloguser = 3; // Log username.\n//\n// CAUTION: Use of this option will expose usernames in the Apache / nginx log,\n// If you are going to publish your log, or the output of your web stats analyzer\n// this will weaken the security of your website.\n//\n// Email database connection errors to someone.  If Moodle cannot connect to the\n// database, then email this address with a notice.\n//\n//     $CFG->emailconnectionerrorsto = 'your@emailaddress.com';\n//\n// Set the priority of themes from highest to lowest. This is useful (for\n// example) in sites where the user theme should override all other theme\n// settings for accessibility reasons. You can also disable types of themes\n// (other than site)  by removing them from the array. The default setting is:\n//\n//     $CFG->themeorder = array('course', 'category', 'session', 'user', 'cohort', 'site');\n//\n// NOTE: course, category, session, user, cohort themes still require the\n// respective settings to be enabled\n//\n// It is possible to add extra themes directory stored outside of $CFG->dirroot.\n// This local directory does not have to be accessible from internet.\n//\n//     $CFG->themedir = '/location/of/extra/themes';\n//\n// It is possible to specify different cache and temp directories, use local fast filesystem\n// for normal web servers. Server clusters MUST use shared filesystem for cachedir!\n// Localcachedir is intended for server clusters, it does not have to be shared by cluster nodes.\n// The directories must not be accessible via web.\n//\n//     $CFG->tempdir = '/var/www/moodle/temp';        // Directory MUST BE SHARED by all cluster nodes.\n//     $CFG->cachedir = '/var/www/moodle/cache';      // Directory MUST BE SHARED by all cluster nodes, locking required.\n//     $CFG->localcachedir = '/var/local/cache';      // Intended for local node caching.\n//\n// It is possible to specify a different backup temp directory, use local fast filesystem\n// for normal web servers. Server clusters MUST use shared filesystem for backuptempdir!\n// The directory must not be accessible via web.\n//\n//     $CFG->backuptempdir = '/var/www/moodle/backuptemp';  // Directory MUST BE SHARED by all cluster nodes.\n//\n// Some filesystems such as NFS may not support file locking operations.\n// Locking resolves race conditions and is strongly recommended for production servers.\n//     $CFG->preventfilelocking = false;\n//\n// Site default language can be set via standard administration interface. If you\n// want to have initial error messages for eventual database connection problems\n// localized too, you have to set your language code here.\n//\n//     $CFG->lang = 'yourlangcode'; // for example 'cs'\n//\n// When Moodle is about to perform an intensive operation it raises PHP's memory\n// limit. The following setting should be used on large sites to set the raised\n// memory limit to something higher.\n// The value for the settings should be a valid PHP memory value. e.g. 512M, 1G\n//\n//     $CFG->extramemorylimit = '1024M';\n//\n// Moodle 2.4 introduced a new cache API.\n// The cache API stores a configuration file within the Moodle data directory and\n// uses that rather than the database in order to function in a stand-alone manner.\n// Using altcacheconfigpath you can change the location where this config file is\n// looked for.\n// It can either be a directory in which to store the file, or the full path to the\n// file if you want to take full control. Either way it must be writable by the\n// webserver.\n//\n//     $CFG->altcacheconfigpath = '/var/www/shared/moodle.cache.config.php\n//\n// Use the following flag to completely disable the Available update notifications\n// feature and hide it from the server administration UI.\n//\n//      $CFG->disableupdatenotifications = true;\n//\n// Use the following flag to completely disable the installation of plugins\n// (new plugins, available updates and missing dependencies) and related\n// features (such as cancelling the plugin installation or upgrade) via the\n// server administration web interface.\n//\n//      $CFG->disableupdateautodeploy = true;\n//\n// Use the following flag to disable the warning on the system notifications page\n// about present development libraries. This flag will not disable the warning within\n// the security overview report. Use this flag only if you really have prohibited web\n// access to the development libraries in your webserver configuration.\n//\n//      $CFG->disabledevlibdirscheck = true;\n//\n// Use the following flag to disable modifications to scheduled tasks\n// whilst still showing the state of tasks.\n//\n//      $CFG->preventscheduledtaskchanges = true;\n//\n// As of version 2.4 Moodle serves icons as SVG images if the users browser appears\n// to support SVG.\n// For those wanting to control the serving of SVG images the following setting can\n// be defined in your config.php.\n// If it is not defined then the default (browser detection) will occur.\n//\n// To ensure they are always used when available:\n//      $CFG->svgicons = true;\n//\n// To ensure they are never used even when available:\n//      $CFG->svgicons = false;\n//\n// Some administration options allow setting the path to executable files. This can\n// potentially cause a security risk. Set this option to true to disable editing\n// those config settings via the web. They will need to be set explicitly in the\n// config.php file\n//      $CFG->preventexecpath = true;\n//\n// Use the following flag to set userid for noreply user. If not set then moodle will\n// create dummy user and use -ve value as user id.\n//      $CFG->noreplyuserid = -10;\n//\n// As of version 2.6 Moodle supports admin to set support user. If not set, all mails\n// will be sent to supportemail.\n//      $CFG->supportuserid = -20;\n//\n// Moodle 2.7 introduces a locking api for critical tasks (e.g. cron).\n// The default locking system to use is DB locking for Postgres, and file locking for\n// MySQL, Oracle and SQLServer. If $CFG->preventfilelocking is set, then the default\n// will always be DB locking. It can be manually set to one of the lock\n// factory classes listed below, or one of your own custom classes implementing the\n// \\core\\lock\\lock_factory interface.\n//\n//      $CFG->lock_factory = \"auto\";\n//\n// The list of available lock factories is:\n//\n// \"\\\\core\\\\lock\\\\file_lock_factory\" - File locking\n//      Uses lock files stored by default in the dataroot. Whether this\n//      works on clusters depends on the file system used for the dataroot.\n//\n// \"\\\\core\\\\lock\\\\db_record_lock_factory\" - DB locking based on table rows.\n//\n// \"\\\\core\\\\lock\\\\postgres_lock_factory\" - DB locking based on postgres advisory locks.\n//\n// Settings used by the lock factories\n//\n// Location for lock files used by the File locking factory. This must exist\n// on a shared file system that supports locking.\n//      $CFG->lock_file_root = $CFG->dataroot . '/lock';\n//\n// Moodle 2.9 allows administrators to customise the list of supported file types.\n// To add a new filetype or override the definition of an existing one, set the\n// customfiletypes variable like this:\n//\n// $CFG->customfiletypes = array(\n//     (object)array(\n//         'extension' => 'frog',\n//         'icon' => 'archive',\n//         'type' => 'application/frog',\n//         'customdescription' => 'Amphibian-related file archive'\n//     )\n// );\n//\n// The extension, icon, and type fields are required. The icon field can refer to\n// any icon inside the pix/f folder. You can also set the customdescription field\n// (shown above) and (for advanced use) the groups, string, and defaulticon fields.\n//\n// Upgrade key\n//\n// If the upgrade key is defined here, then the value must be provided every time\n// the site is being upgraded though the web interface, regardless of whether the\n// administrator is logged in or not. This prevents anonymous access to the upgrade\n// screens where the real authentication and authorization mechanisms can not be\n// relied on.\n//\n// It is strongly recommended to use a value different from your real account\n// password.\n//\n//      $CFG->upgradekey = 'put_some_password-like_value_here';\n//\n// Document conversion limit\n//\n// How many times the background task should attempt to convert a given attempt\n// before removing it from the queue. Currently this limit is only used by the\n// mod_assign conversion task.\n//\n//      $CFG->conversionattemptlimit = 3;\n//\n// Font used in exported PDF files. When generating a PDF, Moodle embeds a subset of\n// the font in the PDF file so it will be readable on the widest range of devices.\n// The default font is 'freesans' which is part of the GNU FreeFont collection.\n//\n//      $CFG->pdfexportfont = 'freesans';\n//\n// Use the following flag to enable messagingallusers and set the default preference\n// value for existing users to allow them to be contacted by other site users.\n//\n//      $CFG->keepmessagingallusersenabled = true;\n//\n// Disable login token validation for login pages. Login token validation is enabled\n// by default unless $CFG->alternateloginurl is set.\n//\n//      $CFG->disablelogintoken = true;\n//\n//=========================================================================\n// 7. SETTINGS FOR DEVELOPMENT SERVERS - not intended for production use!!!\n//=========================================================================\n//\n// Force a debugging mode regardless the settings in the site administration\n// @error_reporting(E_ALL | E_STRICT); // NOT FOR PRODUCTION SERVERS!\n// @ini_set('display_errors', '1');    // NOT FOR PRODUCTION SERVERS!\n// $CFG->debug = (E_ALL | E_STRICT);   // === DEBUG_DEVELOPER - NOT FOR PRODUCTION SERVERS!\n// $CFG->debugdisplay = 1;             // NOT FOR PRODUCTION SERVERS!\n//\n// You can specify a comma separated list of user ids that that always see\n// debug messages, this overrides the debug flag in $CFG->debug and $CFG->debugdisplay\n// for these users only.\n// $CFG->debugusers = '2';\n//\n// Prevent theme caching\n// $CFG->themedesignermode = true; // NOT FOR PRODUCTION SERVERS!\n//\n// Enable verbose debug information during fetching of email messages from IMAP server.\n// $CFG->debugimap = true;\n//\n// Prevent JS caching\n// $CFG->cachejs = false; // NOT FOR PRODUCTION SERVERS!\n//\n// Restrict which YUI logging statements are shown in the browser console.\n// For details see the upstream documentation:\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logInclude\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logExclude\n// $CFG->yuiloginclude = array(\n//     'moodle-core-dock-loader' => true,\n//     'moodle-course-categoryexpander' => true,\n// );\n// $CFG->yuilogexclude = array(\n//     'moodle-core-dock' => true,\n//     'moodle-core-notification' => true,\n// );\n//\n// Set the minimum log level for YUI logging statements.\n// For details see the upstream documentation:\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logLevel\n// $CFG->yuiloglevel = 'debug';\n//\n// Prevent core_string_manager application caching\n// $CFG->langstringcache = false; // NOT FOR PRODUCTION SERVERS!\n//\n// When working with production data on test servers, no emails or other messages\n// should ever be send to real users\n// $CFG->noemailever = true;    // NOT FOR PRODUCTION SERVERS!\n//\n// Divert all outgoing emails to this address to test and debug emailing features\n// $CFG->divertallemailsto = 'root@localhost.local'; // NOT FOR PRODUCTION SERVERS!\n//\n// Except for certain email addresses you want to let through for testing. Accepts\n// a comma separated list of regexes.\n// $CFG->divertallemailsexcept = 'tester@dev.com, fred(\\+.*)?@example.com'; // NOT FOR PRODUCTION SERVERS!\n//\n// Uncomment if you want to allow empty comments when modifying install.xml files.\n// $CFG->xmldbdisablecommentchecking = true;    // NOT FOR PRODUCTION SERVERS!\n//\n// Since 2.0 sql queries are not shown during upgrade by default.\n// Please note that this setting may produce very long upgrade page on large sites.\n// $CFG->upgradeshowsql = true; // NOT FOR PRODUCTION SERVERS!\n//\n// Add SQL queries to the output of cron, just before their execution\n// $CFG->showcronsql = true;\n//\n// Force developer level debug and add debug info to the output of cron\n// $CFG->showcrondebugging = true;\n//\n//=========================================================================\n// 8. FORCED SETTINGS\n//=========================================================================\n// It is possible to specify normal admin settings here, the point is that\n// they can not be changed through the standard admin settings pages any more.\n//\n// Core settings are specified directly via assignment to $CFG variable.\n// Example:\n//   $CFG->somecoresetting = 'value';\n//\n// Plugin settings have to be put into a special array.\n// Example:\n//   $CFG->forced_plugin_settings = array('pluginname'  => array('settingname' => 'value', 'secondsetting' => 'othervalue'),\n//                                        'otherplugin' => array('mysetting' => 'myvalue', 'thesetting' => 'thevalue'));\n// Module default settings with advanced/locked checkboxes can be set too. To do this, add\n// an extra config with '_adv' or '_locked' as a suffix and set the value to true or false.\n// Example:\n//   $CFG->forced_plugin_settings = array('pluginname'  => array('settingname' => 'value', 'settingname_locked' => true, 'settingname_adv' => true));\n//\n//=========================================================================\n// 9. PHPUNIT SUPPORT\n//=========================================================================\n// $CFG->phpunit_prefix = 'phpu_';\n// $CFG->phpunit_dataroot = '/home/example/phpu_moodledata';\n// $CFG->phpunit_directorypermissions = 02777; // optional\n// $CFG->phpunit_profilingenabled = true; // optional to profile PHPUnit runs.\n//\n//\n//=========================================================================\n// 10. SECRET PASSWORD SALT\n//=========================================================================\n// A site-wide password salt is no longer used in new installations.\n// If upgrading from 2.6 or older, keep all existing salts in config.php file.\n//\n// $CFG->passwordsaltmain = 'a_very_long_random_string_of_characters#@6&*1';\n//\n// You may also have some alternative salts to allow migration from previously\n// used salts.\n//\n// $CFG->passwordsaltalt1 = '';\n// $CFG->passwordsaltalt2 = '';\n// $CFG->passwordsaltalt3 = '';\n// ....\n// $CFG->passwordsaltalt19 = '';\n// $CFG->passwordsaltalt20 = '';\n//\n//\n//=========================================================================\n// 11. BEHAT SUPPORT\n//=========================================================================\n// Behat test site needs a unique www root, data directory and database prefix:\n//\n// $CFG->behat_wwwroot = 'http://127.0.0.1/moodle';\n// $CFG->behat_prefix = 'bht_';\n// $CFG->behat_dataroot = '/home/example/bht_moodledata';\n//\n// You can override default Moodle configuration for Behat and add your own\n// params; here you can add more profiles, use different Mink drivers than Selenium...\n// These params would be merged with the default Moodle behat.yml, giving priority\n// to the ones specified here. The array format is YAML, following the Behat\n// params hierarchy. More info: http://docs.behat.org/guides/7.config.html\n// Example:\n//   $CFG->behat_config = array(\n//       'Mac-Firefox' => array(\n//           'suites' => array (\n//               'default' => array(\n//                   'filters' => array(\n//                      'tags' => '~@_file_upload'\n//                   ),\n//               ),\n//           ),\n//           'extensions' => array(\n//               'Behat\\MinkExtension' => array(\n//                   'selenium2' => array(\n//                       'browser' => 'firefox',\n//                       'capabilities' => array(\n//                           'platform' => 'OS X 10.6',\n//                           'version' => 20\n//                       )\n//                   )\n//               )\n//           )\n//       ),\n//       'Mac-Safari' => array(\n//           'extensions' => array(\n//               'Behat\\MinkExtension' => array(\n//                   'selenium2' => array(\n//                       'browser' => 'safari',\n//                       'capabilities' => array(\n//                           'platform' => 'OS X 10.8',\n//                           'version' => 6\n//                       )\n//                   )\n//               )\n//           )\n//       )\n//   );\n// You can also use the following config to override default Moodle configuration for Behat.\n// This config is limited to default suite and will be supported in later versions.\n// It will have precedence over $CFG->behat_config.\n// $CFG->behat_profiles = array(\n//     'phantomjs' => array(\n//         'browser' => 'phantomjs',\n//         'tags' => '~@_file_upload&&~@_alert&&~@_bug_phantomjs',\n//         'wd_host' => 'http://127.0.0.1:4443/wd/hub',\n//         'capabilities' => array(\n//             'platform' => 'Linux',\n//             'version' => 2.1\n//         )\n//     ),\n// );\n//\n// You can force the browser session (not user's sessions) to restart after N seconds. This could\n// be useful if you are using a cloud-based service with time restrictions in the browser side.\n// Setting this value the browser session that Behat is using will be restarted. Set the time in\n// seconds. Is not recommended to use this setting if you don't explicitly need it.\n// Example:\n//   $CFG->behat_restart_browser_after = 7200;     // Restarts the browser session after 2 hours\n//\n// All this page's extra Moodle settings are compared against a white list of allowed settings\n// (the basic and behat_* ones) to avoid problems with production environments. This setting can be\n// used to expand the default white list with an array of extra settings.\n// Example:\n//   $CFG->behat_extraallowedsettings = array('somecoresetting', ...);\n//\n// You should explicitly allow the usage of the deprecated behat steps, otherwise an exception will\n// be thrown when using them. The setting is disabled by default.\n// Example:\n//   $CFG->behat_usedeprecated = true;\n//\n// Including feature files from directories outside the dirroot is possible if required. The setting\n// requires that the running user has executable permissions on all parent directories in the paths.\n// Example:\n//   $CFG->behat_additionalfeatures = array('/home/developer/code/wipfeatures');\n//\n// You can make behat save several dumps when a scenario fails. The dumps currently saved are:\n// * a dump of the DOM in it's state at the time of failure; and\n// * a screenshot (JavaScript is required for the screenshot functionality, so not all browsers support this option)\n// Example:\n//   $CFG->behat_faildump_path = '/my/path/to/save/failure/dumps';\n//\n// You can specify db, selenium wd_host etc. for behat parallel run by setting following variable.\n// Example:\n//   $CFG->behat_parallel_run = array (\n//       array (\n//           'dbtype' => 'mysqli',\n//           'dblibrary' => 'native',\n//           'dbhost' => 'localhost',\n//           'dbname' => 'moodletest',\n//           'dbuser' => 'moodle',\n//           'dbpass' => 'moodle',\n//           'behat_prefix' => 'mdl_',\n//           'wd_host' => 'http://127.0.0.1:4444/wd/hub',\n//           'behat_wwwroot' => 'http://127.0.0.1/moodle',\n//           'behat_dataroot' => '/home/example/bht_moodledata'\n//       ),\n//   );\n//\n// To change name of behat parallel run site, define BEHAT_PARALLEL_SITE_NAME and parallel run sites will be suffixed\n// with this value\n// Example:\n//   define('BEHAT_PARALLEL_SITE_NAME', 'behatparallelsite');\n//\n// Command line output for parallel behat install is limited to 80 chars, if you are installing more then 4 sites and\n// want to expand output to more then 80 chars, then define BEHAT_MAX_CMD_LINE_OUTPUT\n// Example:\n//   define('BEHAT_MAX_CMD_LINE_OUTPUT', 120);\n//\n// Behat feature files will be distributed randomly between the processes by default. If you have timing file or want\n// to create timing file then define BEHAT_FEATURE_TIMING_FILE with path to timing file. It will be updated for each\n// run with latest time taken to execute feature.\n// Example:\n//   define('BEHAT_FEATURE_TIMING_FILE', '/PATH_TO_TIMING_FILE/timing.json');\n//\n// If you don't have timing file and want some stable distribution of features, then you can use step counts to\n// distribute the features. You can generate step file by executing php admin/tool/behat/cli/util.php --updatesteps\n// this will update step file which is defined by BEHAT_FEATURE_STEP_FILE.\n// Example:\n//   define('BEHAT_FEATURE_STEP_FILE', '/PATH_TO_FEATURE_STEP_COUNT_FILE/stepcount.json');\n//\n// Feature distribution for each process is displayed as histogram. you can disable it by setting\n// BEHAT_DISABLE_HISTOGRAM\n// Example:\n//   define('BEHAT_DISABLE_HISTOGRAM', true);\n//\n//=========================================================================\n// 12. DEVELOPER DATA GENERATOR\n//=========================================================================\n//\n// The developer data generator tool is intended to be used only in development or testing sites and\n// it's usage in production environments is not recommended; if it is used to create JMeter test plans\n// is even less recommended as JMeter needs to log in as site course users. JMeter needs to know the\n// users passwords but would be dangerous to have a default password as everybody would know it, which would\n// be specially dangerouse if somebody uses this tool in a production site, so in order to prevent unintended\n// uses of the tool and undesired accesses as well, is compulsory to set a password for the users\n// generated by this tool, but only in case you want to generate a JMeter test. The value should be a string.\n// Example:\n   $CFG->tool_generator_users_password = 'testpassword';\n//\n//=========================================================================\n// 13. SYSTEM PATHS (You need to set following, depending on your system)\n//=========================================================================\n// Ghostscript path.\n// On most Linux installs, this can be left as '/usr/bin/gs'.\n// On Windows it will be something like 'c:\\gs\\bin\\gswin32c.exe' (make sure\n// there are no spaces in the path - if necessary copy the files 'gswin32c.exe'\n// and 'gsdll32.dll' to a new folder without a space in the path)\n//      $CFG->pathtogs = '/usr/bin/gs';\n//\n// Path to PHP CLI.\n// Probably something like /usr/bin/php. If you enter this, cron scripts can be\n// executed from admin web interface.\n// $CFG->pathtophp = '';\n//\n// Path to du.\n// Probably something like /usr/bin/du. If you enter this, pages that display\n// directory contents will run much faster for directories with a lot of files.\n//      $CFG->pathtodu = '';\n//\n// Path to aspell.\n// To use spell-checking within the editor, you MUST have aspell 0.50 or later\n// installed on your server, and you must specify the correct path to access the\n// aspell binary. On Unix/Linux systems, this path is usually /usr/bin/aspell,\n// but it might be something else.\n//      $CFG->aspellpath = '';\n//\n// Path to dot.\n// Probably something like /usr/bin/dot. To be able to generate graphics from\n// DOT files, you must have installed the dot executable and point to it here.\n// Note that, for now, this only used by the profiling features\n// (Development->Profiling) built into Moodle.\n//      $CFG->pathtodot = '';\n//\n// Path to unoconv.\n// Probably something like /usr/bin/unoconv. Used as a fallback to convert between document formats.\n// Unoconv is used convert between file formats supported by LibreOffice.\n// Use a recent version of unoconv ( >= 0.7 ), older versions have trouble running from a webserver.\n//      $CFG->pathtounoconv = '';\n//\n//=========================================================================\n// 14. ALTERNATIVE FILE SYSTEM SETTINGS\n//=========================================================================\n//\n// Alternative file system.\n// Since 3.3 it is possible to override file_storage and file_system API and use alternative storage systems (e.g. S3,\n// Rackspace Cloud Files, Google Cloud Storage, Azure Storage, etc.).\n// To set the alternative file storage system in config.php you can use the following setting, providing the\n// alternative system class name that will be auto-loaded by file_storage API.\n//\n//      $CFG->alternative_file_system_class = '\\\\local_myfilestorage\\\\file_system';\n//\n//=========================================================================\n// ALL DONE!  To continue installation, visit your main page with a browser\n//=========================================================================\n\nrequire_once(__DIR__ . '/lib/setup.php'); // Do not edit\n\n// There is no php closing tag in this file,\n// it is intentional because it prevents trailing whitespace problems!\n", "num_lines": 938}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n///////////////////////////////////////////////////////////////////////////\n//                                                                       //\n// Moodle configuration file                                             //\n//                                                                       //\n// This file should be renamed \"config.php\" in the top-level directory   //\n//                                                                       //\n///////////////////////////////////////////////////////////////////////////\n//                                                                       //\n// NOTICE OF COPYRIGHT                                                   //\n//                                                                       //\n// Moodle - Modular Object-Oriented Dynamic Learning Environment         //\n//          http://moodle.org                                            //\n//                                                                       //\n// Copyright (C) 1999 onwards  Martin Dougiamas  http://moodle.com       //\n//                                                                       //\n// This program is free software; you can redistribute it and/or modify  //\n// it under the terms of the GNU General Public License as published by  //\n// the Free Software Foundation; either version 3 of the License, or     //\n// (at your option) any later version.                                   //\n//                                                                       //\n// This program is distributed in the hope that it will be useful,       //\n// but WITHOUT ANY WARRANTY; without even the implied warranty of        //\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //\n// GNU General Public License for more details:                          //\n//                                                                       //\n//          http://www.gnu.org/copyleft/gpl.html                         //\n//                                                                       //\n///////////////////////////////////////////////////////////////////////////\nunset($CFG);  // Ignore this line\nglobal $CFG;  // This is necessary here for PHPUnit execution\n$CFG = new stdClass();\n\n//=========================================================================\n// 1. DATABASE SETUP\n//=========================================================================\n// First, you need to configure the database where all Moodle data       //\n// will be stored.  This database must already have been created         //\n// and a username/password created to access it.                         //\n\n$CFG->dbtype    = 'pgsql';      // 'pgsql', 'mariadb', 'mysqli', 'sqlsrv' or 'oci'\n$CFG->dblibrary = 'native';     // 'native' only at the moment\n$CFG->dbhost    = 'localhost';  // eg 'localhost' or 'db.isp.com' or IP\n$CFG->dbname    = 'moodle';     // database name, eg moodle\n$CFG->dbuser    = 'username';   // your database username\n$CFG->dbpass    = 'password';   // your database password\n$CFG->prefix    = 'mdl_';       // prefix to use for all table names\n$CFG->dboptions = array(\n    'dbpersist' => false,       // should persistent database connections be\n                                //  used? set to 'false' for the most stable\n                                //  setting, 'true' can improve performance\n                                //  sometimes\n    'dbsocket'  => false,       // should connection via UNIX socket be used?\n                                //  if you set it to 'true' or custom path\n                                //  here set dbhost to 'localhost',\n                                //  (please note mysql is always using socket\n                                //  if dbhost is 'localhost' - if you need\n                                //  local port connection use '127.0.0.1')\n    'dbport'    => '',          // the TCP port number to use when connecting\n                                //  to the server. keep empty string for the\n                                //  default port\n    'dbhandlesoptions' => false,// On PostgreSQL poolers like pgbouncer don't\n                                // support advanced options on connection.\n                                // If you set those in the database then\n                                // the advanced settings will not be sent.\n    'dbcollation' => 'utf8mb4_unicode_ci', // MySQL has partial and full UTF-8\n                                // support. If you wish to use partial UTF-8\n                                // (three bytes) then set this option to\n                                // 'utf8_unicode_ci', otherwise this option\n                                // can be removed for MySQL (by default it will\n                                // use 'utf8mb4_unicode_ci'. This option should\n                                // be removed for all other databases.\n    // 'fetchbuffersize' => 100000, // On PostgreSQL, this option sets a limit\n                                // on the number of rows that are fetched into\n                                // memory when doing a large recordset query\n                                // (e.g. search indexing). Default is 100000.\n                                // Uncomment and set to a value to change it,\n                                // or zero to turn off the limit. You need to\n                                // set to zero if you are using pg_bouncer in\n                                // 'transaction' mode (it is fine in 'session'\n                                // mode).\n);\n\n\n//=========================================================================\n// 2. WEB SITE LOCATION\n//=========================================================================\n// Now you need to tell Moodle where it is located. Specify the full\n// web address to where moodle has been installed.  If your web site\n// is accessible via multiple URLs then choose the most natural one\n// that your students would use.  Do not include a trailing slash\n//\n// If you need both intranet and Internet access please read\n// http://docs.moodle.org/en/masquerading\n\n$CFG->wwwroot   = 'http://example.com/moodle';\n\n\n//=========================================================================\n// 3. DATA FILES LOCATION\n//=========================================================================\n// Now you need a place where Moodle can save uploaded files.  This\n// directory should be readable AND WRITEABLE by the web server user\n// (usually 'nobody' or 'apache'), but it should not be accessible\n// directly via the web.\n//\n// - On hosting systems you might need to make sure that your \"group\" has\n//   no permissions at all, but that \"others\" have full permissions.\n//\n// - On Windows systems you might specify something like 'c:\\moodledata'\n\n$CFG->dataroot  = '/home/example/moodledata';\n\n\n//=========================================================================\n// 4. DATA FILES PERMISSIONS\n//=========================================================================\n// The following parameter sets the permissions of new directories\n// created by Moodle within the data directory.  The format is in\n// octal format (as used by the Unix utility chmod, for example).\n// The default is usually OK, but you may want to change it to 0750\n// if you are concerned about world-access to the files (you will need\n// to make sure the web server process (eg Apache) can access the files.\n// NOTE: the prefixed 0 is important, and don't use quotes.\n\n$CFG->directorypermissions = 02777;\n\n\n//=========================================================================\n// 5. DIRECTORY LOCATION  (most people can just ignore this setting)\n//=========================================================================\n// A very few webhosts use /admin as a special URL for you to access a\n// control panel or something.  Unfortunately this conflicts with the\n// standard location for the Moodle admin pages.  You can work around this\n// by renaming the admin directory in your installation, and putting that\n// new name here.  eg \"moodleadmin\".  This should fix all admin links in Moodle.\n// After any change you need to visit your new admin directory\n// and purge all caches.\n\n$CFG->admin = 'admin';\n\n\n//=========================================================================\n// 6. OTHER MISCELLANEOUS SETTINGS (ignore these for new installations)\n//=========================================================================\n//\n// These are additional tweaks for which no GUI exists in Moodle yet.\n//\n// Starting in PHP 5.3 administrators should specify default timezone\n// in PHP.ini, you can also specify it here if needed.\n// See details at: http://php.net/manual/en/function.date-default-timezone-set.php\n// List of time zones at: http://php.net/manual/en/timezones.php\n//     date_default_timezone_set('Australia/Perth');\n//\n// Change the key pair lifetime for Moodle Networking\n// The default is 28 days. You would only want to change this if the key\n// was not getting regenerated for any reason. You would probably want\n// make it much longer. Note that you'll need to delete and manually update\n// any existing key.\n//      $CFG->mnetkeylifetime = 28;\n//\n// Not recommended: Set the following to true to allow the use\n// off non-Moodle standard characters in usernames.\n//      $CFG->extendedusernamechars = true;\n//\n// Allow user passwords to be included in backup files. Very dangerous\n// setting as far as it publishes password hashes that can be unencrypted\n// if the backup file is publicy available. Use it only if you can guarantee\n// that all your backup files remain only privacy available and are never\n// shared out from your site/institution!\n//      $CFG->includeuserpasswordsinbackup = true;\n//\n// Completely disable user creation when restoring a course, bypassing any\n// permissions granted via roles and capabilities. Enabling this setting\n// results in the restore process stopping when a user attempts to restore a\n// course requiring users to be created.\n//     $CFG->disableusercreationonrestore = true;\n//\n// Keep the temporary directories used by backup and restore without being\n// deleted at the end of the process. Use it if you want to debug / view\n// all the information stored there after the process has ended. Note that\n// those directories may be deleted (after some ttl) both by cron and / or\n// by new backup / restore invocations.\n//     $CFG->keeptempdirectoriesonbackup = true;\n//\n// Modify the restore process in order to force the \"user checks\" to assume\n// that the backup originated from a different site, so detection of matching\n// users is performed with different (more \"relaxed\") rules. Note that this is\n// only useful if the backup file has been created using Moodle < 1.9.4 and the\n// site has been rebuilt from scratch using backup files (not the best way btw).\n// If you obtain user conflicts on restore, rather than enabling this setting\n// permanently, try restoring the backup on a different site, back it up again\n// and then restore on the target server.\n//    $CFG->forcedifferentsitecheckingusersonrestore = true;\n//\n// Force the backup system to continue to create backups in the legacy zip\n// format instead of the new tgz format. Does not affect restore, which\n// auto-detects the underlying file format.\n//    $CFG->usezipbackups = true;\n//\n// Prevent stats processing and hide the GUI\n//      $CFG->disablestatsprocessing = true;\n//\n// Setting this to true will enable admins to edit any post at any time\n//      $CFG->admineditalways = true;\n//\n// These variables define DEFAULT block variables for new courses\n// If this one is set it overrides all others and is the only one used.\n//      $CFG->defaultblocks_override = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// These variables define the specific settings for defined course formats.\n// They override any settings defined in the formats own config file.\n//      $CFG->defaultblocks_site = 'site_main_menu,course_list:course_summary,calendar_month';\n//      $CFG->defaultblocks_social = 'participants,search_forums,calendar_month,calendar_upcoming,social_activities,recent_activity,course_list';\n//      $CFG->defaultblocks_topics = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//      $CFG->defaultblocks_weeks = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// These blocks are used when no other default setting is found.\n//      $CFG->defaultblocks = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// You can specify a different class to be created for the $PAGE global, and to\n// compute which blocks appear on each page. However, I cannot think of any good\n// reason why you would need to change that. It just felt wrong to hard-code the\n// the class name. You are strongly advised not to use these to settings unless\n// you are absolutely sure you know what you are doing.\n//      $CFG->moodlepageclass = 'moodle_page';\n//      $CFG->moodlepageclassfile = \"$CFG->dirroot/local/myplugin/mypageclass.php\";\n//      $CFG->blockmanagerclass = 'block_manager';\n//      $CFG->blockmanagerclassfile = \"$CFG->dirroot/local/myplugin/myblockamanagerclass.php\";\n//\n// Seconds for files to remain in caches. Decrease this if you are worried\n// about students being served outdated versions of uploaded files.\n//     $CFG->filelifetime = 60*60*6;\n//\n// Some web servers can offload the file serving from PHP process,\n// comment out one the following options to enable it in Moodle:\n//     $CFG->xsendfile = 'X-Sendfile';           // Apache {@see https://tn123.org/mod_xsendfile/}\n//     $CFG->xsendfile = 'X-LIGHTTPD-send-file'; // Lighttpd {@see http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file}\n//     $CFG->xsendfile = 'X-Accel-Redirect';     // Nginx {@see http://wiki.nginx.org/XSendfile}\n// If your X-Sendfile implementation (usually Nginx) uses directory aliases specify them\n// in the following array setting:\n//     $CFG->xsendfilealiases = array(\n//         '/dataroot/' => $CFG->dataroot,\n//         '/cachedir/' => '/var/www/moodle/cache',    // for custom $CFG->cachedir locations\n//         '/localcachedir/' => '/var/local/cache',    // for custom $CFG->localcachedir locations\n//         '/tempdir/'  => '/var/www/moodle/temp',     // for custom $CFG->tempdir locations\n//         '/filedir'   => '/var/www/moodle/filedir',  // for custom $CFG->filedir locations\n//     );\n//\n// YUI caching may be sometimes improved by slasharguments:\n//     $CFG->yuislasharguments = 1;\n// Some servers may need a special rewrite rule to work around internal path length limitations:\n// RewriteRule (^.*/theme/yui_combo\\.php)(/.*) $1?file=$2\n//\n//\n// Following settings may be used to select session driver, uncomment only one of the handlers.\n//   Database session handler (not compatible with MyISAM):\n//      $CFG->session_handler_class = '\\core\\session\\database';\n//      $CFG->session_database_acquire_lock_timeout = 120;\n//\n//   File session handler (file system locking required):\n//      $CFG->session_handler_class = '\\core\\session\\file';\n//      $CFG->session_file_save_path = $CFG->dataroot.'/sessions';\n//\n//   Memcached session handler (requires memcached server and extension):\n//      $CFG->session_handler_class = '\\core\\session\\memcached';\n//      $CFG->session_memcached_save_path = '127.0.0.1:11211';\n//      $CFG->session_memcached_prefix = 'memc.sess.key.';\n//      $CFG->session_memcached_acquire_lock_timeout = 120;\n//      $CFG->session_memcached_lock_expire = 7200;       // Ignored if PECL memcached is below version 2.2.0\n//      $CFG->session_memcached_lock_retry_sleep = 150;   // Spin-lock retry sleeptime (msec). Only effective\n//                                                        // for tuning php-memcached 3.0.x (PHP 7)\n//\n//   Redis session handler (requires redis server and redis extension):\n//      $CFG->session_handler_class = '\\core\\session\\redis';\n//      $CFG->session_redis_host = '127.0.0.1';\n//      $CFG->session_redis_port = 6379;  // Optional.\n//      $CFG->session_redis_database = 0;  // Optional, default is db 0.\n//      $CFG->session_redis_auth = ''; // Optional, default is don't set one.\n//      $CFG->session_redis_prefix = ''; // Optional, default is don't set one.\n//      $CFG->session_redis_acquire_lock_timeout = 120;\n//      $CFG->session_redis_lock_expire = 7200;\n//      Use the igbinary serializer instead of the php default one. Note that phpredis must be compiled with\n//      igbinary support to make the setting to work. Also, if you change the serializer you have to flush the database!\n//      $CFG->session_redis_serializer_use_igbinary = false; // Optional, default is PHP builtin serializer.\n//\n// Please be aware that when selecting Memcached for sessions that it is advised to use a dedicated\n// memcache server. The memcached extension does not provide isolated environments for individual uses.\n// Using the same server for other purposes (MUC for example) can lead to sessions being prematurely removed should\n// the other uses of the server purge the cache.\n//\n// Following setting allows you to alter how frequently is timemodified updated in sessions table.\n//      $CFG->session_update_timemodified_frequency = 20; // In seconds.\n//\n// If this setting is set to true, then Moodle will track the IP of the\n// current user to make sure it hasn't changed during a session.  This\n// will prevent the possibility of sessions being hijacked via XSS, but it\n// may break things for users coming using proxies that change all the time,\n// like AOL.\n//      $CFG->tracksessionip = true;\n//\n// The following lines are for handling email bounces.\n//      $CFG->handlebounces = true;\n//      $CFG->minbounces = 10;\n//      $CFG->bounceratio = .20;\n// The next lines are needed both for bounce handling and any other email to module processing.\n// mailprefix must be EXACTLY four characters.\n// Uncomment and customise this block for Postfix\n//      $CFG->mailprefix = 'mdl+'; // + is the separator for Exim and Postfix.\n//      $CFG->mailprefix = 'mdl-'; // - is the separator for qmail\n//      $CFG->maildomain = 'youremaildomain.com';\n//\n// Enable when setting up advanced reverse proxy load balancing configurations,\n// it may be also necessary to enable this when using port forwarding.\n//      $CFG->reverseproxy = true;\n//\n// Enable when using external SSL appliance for performance reasons.\n// Please note that site may be accessible via http: or https:, but not both!\n//      $CFG->sslproxy = true;\n//\n// This setting will cause the userdate() function not to fix %d in\n// date strings, and just let them show with a zero prefix.\n//      $CFG->nofixday = true;\n//\n// This setting will make some graphs (eg user logs) use lines instead of bars\n//      $CFG->preferlinegraphs = true;\n//\n// This setting allows you to specify a class to rewrite outgoing urls\n// enabling 'clean urls' in conjunction with an apache / nginx handler.\n// The handler must implement \\core\\output\\url_rewriter.\n//      $CFG->urlrewriteclass = '\\local_cleanurls\\url_rewriter';\n//\n// Enabling this will allow custom scripts to replace existing moodle scripts.\n// For example: if $CFG->customscripts/course/view.php exists then\n// it will be used instead of $CFG->wwwroot/course/view.php\n// At present this will only work for files that include config.php and are called\n// as part of the url (index.php is implied).\n// Some examples are:\n//      http://my.moodle.site/course/view.php\n//      http://my.moodle.site/index.php\n//      http://my.moodle.site/admin            (index.php implied)\n// Custom scripts should not include config.php\n// Warning: Replacing standard moodle scripts may pose security risks and/or may not\n// be compatible with upgrades. Use this option only if you are aware of the risks\n// involved.\n// Specify the full directory path to the custom scripts\n//      $CFG->customscripts = '/home/example/customscripts';\n//\n// Performance profiling\n//\n//   If you set Debug to \"Yes\" in the Configuration->Variables page some\n//   performance profiling data will show up on your footer (in default theme).\n//   With these settings you get more granular control over the capture\n//   and printout of the data\n//\n//   Capture performance profiling data\n//   define('MDL_PERF'  , true);\n//\n//   Capture additional data from DB\n//   define('MDL_PERFDB'  , true);\n//\n//   Print to log (for passive profiling of production servers)\n//   define('MDL_PERFTOLOG'  , true);\n//\n//   Print to footer (works with the default theme)\n//   define('MDL_PERFTOFOOT', true);\n//\n//   Enable earlier profiling that causes more code to be covered\n//   on every request (db connections, config load, other inits...).\n//   Requires extra configuration to be defined in config.php like:\n//   profilingincluded, profilingexcluded, profilingautofrec,\n//   profilingallowme, profilingallowall, profilinglifetime\n//       $CFG->earlyprofilingenabled = true;\n//\n// Disable database storage for profile data.\n// When using an exernal plugin to store profiling data it is often\n// desirable to not store the data in the database.\n//\n//      $CFG->disableprofilingtodatabase = true;\n//\n// Force displayed usernames\n//   A little hack to anonymise user names for all students.  If you set these\n//   then all non-teachers will always see these for every person.\n//       $CFG->forcefirstname = 'Bruce';\n//       $CFG->forcelastname  = 'Simpson';\n//\n// The following setting will turn on username logging into Apache log. For full details regarding setting\n// up of this function please refer to the install section of the document.\n//     $CFG->apacheloguser = 0; // Turn this feature off. Default value.\n//     $CFG->apacheloguser = 1; // Log user id.\n//     $CFG->apacheloguser = 2; // Log full name in cleaned format. ie, Darth Vader will be displayed as darth_vader.\n//     $CFG->apacheloguser = 3; // Log username.\n// To get the values logged in Apache's log, add to your httpd.conf\n// the following statements. In the General part put:\n//     LogFormat \"%h %l %{MOODLEUSER}n %t \\\"%r\\\" %s %b \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" moodleformat\n// And in the part specific to your Moodle install / virtualhost:\n//     CustomLog \"/your/path/to/log\" moodleformat\n//\n// Alternatively for other webservers such as nginx, you can instead have the username sent via a http header\n// 'X-MOODLEUSER' which can be saved in the logfile and then stripped out before being sent to the browser:\n//     $CFG->headerloguser = 0; // Turn this feature off. Default value.\n//     $CFG->headerloguser = 1; // Log user id.\n//     $CFG->headerloguser = 2; // Log full name in cleaned format. ie, Darth Vader will be displayed as darth_vader.\n//     $CFG->headerloguser = 3; // Log username.\n//\n// CAUTION: Use of this option will expose usernames in the Apache / nginx log,\n// If you are going to publish your log, or the output of your web stats analyzer\n// this will weaken the security of your website.\n//\n// Email database connection errors to someone.  If Moodle cannot connect to the\n// database, then email this address with a notice.\n//\n//     $CFG->emailconnectionerrorsto = 'your@emailaddress.com';\n//\n// Set the priority of themes from highest to lowest. This is useful (for\n// example) in sites where the user theme should override all other theme\n// settings for accessibility reasons. You can also disable types of themes\n// (other than site)  by removing them from the array. The default setting is:\n//\n//     $CFG->themeorder = array('course', 'category', 'session', 'user', 'cohort', 'site');\n//\n// NOTE: course, category, session, user, cohort themes still require the\n// respective settings to be enabled\n//\n// It is possible to add extra themes directory stored outside of $CFG->dirroot.\n// This local directory does not have to be accessible from internet.\n//\n//     $CFG->themedir = '/location/of/extra/themes';\n//\n// It is possible to specify different cache and temp directories, use local fast filesystem\n// for normal web servers. Server clusters MUST use shared filesystem for cachedir!\n// Localcachedir is intended for server clusters, it does not have to be shared by cluster nodes.\n// The directories must not be accessible via web.\n//\n//     $CFG->tempdir = '/var/www/moodle/temp';        // Directory MUST BE SHARED by all cluster nodes.\n//     $CFG->cachedir = '/var/www/moodle/cache';      // Directory MUST BE SHARED by all cluster nodes, locking required.\n//     $CFG->localcachedir = '/var/local/cache';      // Intended for local node caching.\n//\n// It is possible to specify a different backup temp directory, use local fast filesystem\n// for normal web servers. Server clusters MUST use shared filesystem for backuptempdir!\n// The directory must not be accessible via web.\n//\n//     $CFG->backuptempdir = '/var/www/moodle/backuptemp';  // Directory MUST BE SHARED by all cluster nodes.\n//\n// Some filesystems such as NFS may not support file locking operations.\n// Locking resolves race conditions and is strongly recommended for production servers.\n//     $CFG->preventfilelocking = false;\n//\n// Site default language can be set via standard administration interface. If you\n// want to have initial error messages for eventual database connection problems\n// localized too, you have to set your language code here.\n//\n//     $CFG->lang = 'yourlangcode'; // for example 'cs'\n//\n// When Moodle is about to perform an intensive operation it raises PHP's memory\n// limit. The following setting should be used on large sites to set the raised\n// memory limit to something higher.\n// The value for the settings should be a valid PHP memory value. e.g. 512M, 1G\n//\n//     $CFG->extramemorylimit = '1024M';\n//\n// Moodle 2.4 introduced a new cache API.\n// The cache API stores a configuration file within the Moodle data directory and\n// uses that rather than the database in order to function in a stand-alone manner.\n// Using altcacheconfigpath you can change the location where this config file is\n// looked for.\n// It can either be a directory in which to store the file, or the full path to the\n// file if you want to take full control. Either way it must be writable by the\n// webserver.\n//\n//     $CFG->altcacheconfigpath = '/var/www/shared/moodle.cache.config.php\n//\n// Use the following flag to completely disable the Available update notifications\n// feature and hide it from the server administration UI.\n//\n//      $CFG->disableupdatenotifications = true;\n//\n// Use the following flag to completely disable the installation of plugins\n// (new plugins, available updates and missing dependencies) and related\n// features (such as cancelling the plugin installation or upgrade) via the\n// server administration web interface.\n//\n//      $CFG->disableupdateautodeploy = true;\n//\n// Use the following flag to disable the warning on the system notifications page\n// about present development libraries. This flag will not disable the warning within\n// the security overview report. Use this flag only if you really have prohibited web\n// access to the development libraries in your webserver configuration.\n//\n//      $CFG->disabledevlibdirscheck = true;\n//\n// Use the following flag to disable modifications to scheduled tasks\n// whilst still showing the state of tasks.\n//\n//      $CFG->preventscheduledtaskchanges = true;\n//\n// As of version 2.4 Moodle serves icons as SVG images if the users browser appears\n// to support SVG.\n// For those wanting to control the serving of SVG images the following setting can\n// be defined in your config.php.\n// If it is not defined then the default (browser detection) will occur.\n//\n// To ensure they are always used when available:\n//      $CFG->svgicons = true;\n//\n// To ensure they are never used even when available:\n//      $CFG->svgicons = false;\n//\n// Some administration options allow setting the path to executable files. This can\n// potentially cause a security risk. Set this option to true to disable editing\n// those config settings via the web. They will need to be set explicitly in the\n// config.php file\n//      $CFG->preventexecpath = true;\n//\n// Use the following flag to set userid for noreply user. If not set then moodle will\n// create dummy user and use -ve value as user id.\n//      $CFG->noreplyuserid = -10;\n//\n// As of version 2.6 Moodle supports admin to set support user. If not set, all mails\n// will be sent to supportemail.\n//      $CFG->supportuserid = -20;\n//\n// Moodle 2.7 introduces a locking api for critical tasks (e.g. cron).\n// The default locking system to use is DB locking for Postgres, and file locking for\n// MySQL, Oracle and SQLServer. If $CFG->preventfilelocking is set, then the default\n// will always be DB locking. It can be manually set to one of the lock\n// factory classes listed below, or one of your own custom classes implementing the\n// \\core\\lock\\lock_factory interface.\n//\n//      $CFG->lock_factory = \"auto\";\n//\n// The list of available lock factories is:\n//\n// \"\\\\core\\\\lock\\\\file_lock_factory\" - File locking\n//      Uses lock files stored by default in the dataroot. Whether this\n//      works on clusters depends on the file system used for the dataroot.\n//\n// \"\\\\core\\\\lock\\\\db_record_lock_factory\" - DB locking based on table rows.\n//\n// \"\\\\core\\\\lock\\\\postgres_lock_factory\" - DB locking based on postgres advisory locks.\n//\n// Settings used by the lock factories\n//\n// Location for lock files used by the File locking factory. This must exist\n// on a shared file system that supports locking.\n//      $CFG->lock_file_root = $CFG->dataroot . '/lock';\n//\n// Moodle 2.9 allows administrators to customise the list of supported file types.\n// To add a new filetype or override the definition of an existing one, set the\n// customfiletypes variable like this:\n//\n// $CFG->customfiletypes = array(\n//     (object)array(\n//         'extension' => 'frog',\n//         'icon' => 'archive',\n//         'type' => 'application/frog',\n//         'customdescription' => 'Amphibian-related file archive'\n//     )\n// );\n//\n// The extension, icon, and type fields are required. The icon field can refer to\n// any icon inside the pix/f folder. You can also set the customdescription field\n// (shown above) and (for advanced use) the groups, string, and defaulticon fields.\n//\n// Upgrade key\n//\n// If the upgrade key is defined here, then the value must be provided every time\n// the site is being upgraded though the web interface, regardless of whether the\n// administrator is logged in or not. This prevents anonymous access to the upgrade\n// screens where the real authentication and authorization mechanisms can not be\n// relied on.\n//\n// It is strongly recommended to use a value different from your real account\n// password.\n//\n//      $CFG->upgradekey = 'put_some_password-like_value_here';\n//\n// Document conversion limit\n//\n// How many times the background task should attempt to convert a given attempt\n// before removing it from the queue. Currently this limit is only used by the\n// mod_assign conversion task.\n//\n//      $CFG->conversionattemptlimit = 3;\n//\n// Font used in exported PDF files. When generating a PDF, Moodle embeds a subset of\n// the font in the PDF file so it will be readable on the widest range of devices.\n// The default font is 'freesans' which is part of the GNU FreeFont collection.\n//\n//      $CFG->pdfexportfont = 'freesans';\n//\n// Use the following flag to enable messagingallusers and set the default preference\n// value for existing users to allow them to be contacted by other site users.\n//\n//      $CFG->keepmessagingallusersenabled = true;\n//\n// Disable login token validation for login pages. Login token validation is enabled\n// by default unless $CFG->alternateloginurl is set.\n//\n//      $CFG->disablelogintoken = true;\n//\n//=========================================================================\n// 7. SETTINGS FOR DEVELOPMENT SERVERS - not intended for production use!!!\n//=========================================================================\n//\n// Force a debugging mode regardless the settings in the site administration\n// @error_reporting(E_ALL | E_STRICT); // NOT FOR PRODUCTION SERVERS!\n// @ini_set('display_errors', '1');    // NOT FOR PRODUCTION SERVERS!\n// $CFG->debug = (E_ALL | E_STRICT);   // === DEBUG_DEVELOPER - NOT FOR PRODUCTION SERVERS!\n// $CFG->debugdisplay = 1;             // NOT FOR PRODUCTION SERVERS!\n//\n// You can specify a comma separated list of user ids that that always see\n// debug messages, this overrides the debug flag in $CFG->debug and $CFG->debugdisplay\n// for these users only.\n// $CFG->debugusers = '2';\n//\n// Prevent theme caching\n// $CFG->themedesignermode = true; // NOT FOR PRODUCTION SERVERS!\n//\n// Enable verbose debug information during fetching of email messages from IMAP server.\n// $CFG->debugimap = true;\n//\n// Prevent JS caching\n// $CFG->cachejs = false; // NOT FOR PRODUCTION SERVERS!\n//\n// Restrict which YUI logging statements are shown in the browser console.\n// For details see the upstream documentation:\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logInclude\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logExclude\n// $CFG->yuiloginclude = array(\n//     'moodle-core-dock-loader' => true,\n//     'moodle-course-categoryexpander' => true,\n// );\n// $CFG->yuilogexclude = array(\n//     'moodle-core-dock' => true,\n//     'moodle-core-notification' => true,\n// );\n//\n// Set the minimum log level for YUI logging statements.\n// For details see the upstream documentation:\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logLevel\n// $CFG->yuiloglevel = 'debug';\n//\n// Prevent core_string_manager application caching\n// $CFG->langstringcache = false; // NOT FOR PRODUCTION SERVERS!\n//\n// When working with production data on test servers, no emails or other messages\n// should ever be send to real users\n// $CFG->noemailever = true;    // NOT FOR PRODUCTION SERVERS!\n//\n// Divert all outgoing emails to this address to test and debug emailing features\n// $CFG->divertallemailsto = 'root@localhost.local'; // NOT FOR PRODUCTION SERVERS!\n//\n// Except for certain email addresses you want to let through for testing. Accepts\n// a comma separated list of regexes.\n// $CFG->divertallemailsexcept = 'tester@dev.com, fred(\\+.*)?@example.com'; // NOT FOR PRODUCTION SERVERS!\n//\n// Uncomment if you want to allow empty comments when modifying install.xml files.\n// $CFG->xmldbdisablecommentchecking = true;    // NOT FOR PRODUCTION SERVERS!\n//\n// Since 2.0 sql queries are not shown during upgrade by default.\n// Please note that this setting may produce very long upgrade page on large sites.\n// $CFG->upgradeshowsql = true; // NOT FOR PRODUCTION SERVERS!\n//\n// Add SQL queries to the output of cron, just before their execution\n// $CFG->showcronsql = true;\n//\n// Force developer level debug and add debug info to the output of cron\n// $CFG->showcrondebugging = true;\n//\n//=========================================================================\n// 8. FORCED SETTINGS\n//=========================================================================\n// It is possible to specify normal admin settings here, the point is that\n// they can not be changed through the standard admin settings pages any more.\n//\n// Core settings are specified directly via assignment to $CFG variable.\n// Example:\n//   $CFG->somecoresetting = 'value';\n//\n// Plugin settings have to be put into a special array.\n// Example:\n//   $CFG->forced_plugin_settings = array('pluginname'  => array('settingname' => 'value', 'secondsetting' => 'othervalue'),\n//                                        'otherplugin' => array('mysetting' => 'myvalue', 'thesetting' => 'thevalue'));\n// Module default settings with advanced/locked checkboxes can be set too. To do this, add\n// an extra config with '_adv' or '_locked' as a suffix and set the value to true or false.\n// Example:\n//   $CFG->forced_plugin_settings = array('pluginname'  => array('settingname' => 'value', 'settingname_locked' => true, 'settingname_adv' => true));\n//\n//=========================================================================\n// 9. PHPUNIT SUPPORT\n//=========================================================================\n// $CFG->phpunit_prefix = 'phpu_';\n// $CFG->phpunit_dataroot = '/home/example/phpu_moodledata';\n// $CFG->phpunit_directorypermissions = 02777; // optional\n// $CFG->phpunit_profilingenabled = true; // optional to profile PHPUnit runs.\n//\n//\n//=========================================================================\n// 10. SECRET PASSWORD SALT\n//=========================================================================\n// A site-wide password salt is no longer used in new installations.\n// If upgrading from 2.6 or older, keep all existing salts in config.php file.\n//\n// $CFG->passwordsaltmain = 'a_very_long_random_string_of_characters#@6&*1';\n//\n// You may also have some alternative salts to allow migration from previously\n// used salts.\n//\n// $CFG->passwordsaltalt1 = '';\n// $CFG->passwordsaltalt2 = '';\n// $CFG->passwordsaltalt3 = '';\n// ....\n// $CFG->passwordsaltalt19 = '';\n// $CFG->passwordsaltalt20 = '';\n//\n//\n//=========================================================================\n// 11. BEHAT SUPPORT\n//=========================================================================\n// Behat test site needs a unique www root, data directory and database prefix:\n//\n// $CFG->behat_wwwroot = 'http://127.0.0.1/moodle';\n// $CFG->behat_prefix = 'bht_';\n// $CFG->behat_dataroot = '/home/example/bht_moodledata';\n//\n// You can override default Moodle configuration for Behat and add your own\n// params; here you can add more profiles, use different Mink drivers than Selenium...\n// These params would be merged with the default Moodle behat.yml, giving priority\n// to the ones specified here. The array format is YAML, following the Behat\n// params hierarchy. More info: http://docs.behat.org/guides/7.config.html\n// Example:\n//   $CFG->behat_config = array(\n//       'Mac-Firefox' => array(\n//           'suites' => array (\n//               'default' => array(\n//                   'filters' => array(\n//                      'tags' => '~@_file_upload'\n//                   ),\n//               ),\n//           ),\n//           'extensions' => array(\n//               'Behat\\MinkExtension' => array(\n//                   'selenium2' => array(\n//                       'browser' => 'firefox',\n//                       'capabilities' => array(\n//                           'platform' => 'OS X 10.6',\n//                           'version' => 20\n//                       )\n//                   )\n//               )\n//           )\n//       ),\n//       'Mac-Safari' => array(\n//           'extensions' => array(\n//               'Behat\\MinkExtension' => array(\n//                   'selenium2' => array(\n//                       'browser' => 'safari',\n//                       'capabilities' => array(\n//                           'platform' => 'OS X 10.8',\n//                           'version' => 6\n//                       )\n//                   )\n//               )\n//           )\n//       )\n//   );\n// You can also use the following config to override default Moodle configuration for Behat.\n// This config is limited to default suite and will be supported in later versions.\n// It will have precedence over $CFG->behat_config.\n// $CFG->behat_profiles = array(\n//     'phantomjs' => array(\n//         'browser' => 'phantomjs',\n//         'tags' => '~@_file_upload&&~@_alert&&~@_bug_phantomjs',\n//         'wd_host' => 'http://127.0.0.1:4443/wd/hub',\n//         'capabilities' => array(\n//             'platform' => 'Linux',\n//             'version' => 2.1\n//         )\n//     ),\n// );\n//\n// You can force the browser session (not user's sessions) to restart after N seconds. This could\n// be useful if you are using a cloud-based service with time restrictions in the browser side.\n// Setting this value the browser session that Behat is using will be restarted. Set the time in\n// seconds. Is not recommended to use this setting if you don't explicitly need it.\n// Example:\n//   $CFG->behat_restart_browser_after = 7200;     // Restarts the browser session after 2 hours\n//\n// All this page's extra Moodle settings are compared against a white list of allowed settings\n// (the basic and behat_* ones) to avoid problems with production environments. This setting can be\n// used to expand the default white list with an array of extra settings.\n// Example:\n//   $CFG->behat_extraallowedsettings = array('somecoresetting', ...);\n//\n// You should explicitly allow the usage of the deprecated behat steps, otherwise an exception will\n// be thrown when using them. The setting is disabled by default.\n// Example:\n//   $CFG->behat_usedeprecated = true;\n//\n// Including feature files from directories outside the dirroot is possible if required. The setting\n// requires that the running user has executable permissions on all parent directories in the paths.\n// Example:\n//   $CFG->behat_additionalfeatures = array('/home/developer/code/wipfeatures');\n//\n// You can make behat save several dumps when a scenario fails. The dumps currently saved are:\n// * a dump of the DOM in it's state at the time of failure; and\n// * a screenshot (JavaScript is required for the screenshot functionality, so not all browsers support this option)\n// Example:\n//   $CFG->behat_faildump_path = '/my/path/to/save/failure/dumps';\n//\n// You can specify db, selenium wd_host etc. for behat parallel run by setting following variable.\n// Example:\n//   $CFG->behat_parallel_run = array (\n//       array (\n//           'dbtype' => 'mysqli',\n//           'dblibrary' => 'native',\n//           'dbhost' => 'localhost',\n//           'dbname' => 'moodletest',\n//           'dbuser' => 'moodle',\n//           'dbpass' => 'moodle',\n//           'behat_prefix' => 'mdl_',\n//           'wd_host' => 'http://127.0.0.1:4444/wd/hub',\n//           'behat_wwwroot' => 'http://127.0.0.1/moodle',\n//           'behat_dataroot' => '/home/example/bht_moodledata'\n//       ),\n//   );\n//\n// To change name of behat parallel run site, define BEHAT_PARALLEL_SITE_NAME and parallel run sites will be suffixed\n// with this value\n// Example:\n//   define('BEHAT_PARALLEL_SITE_NAME', 'behatparallelsite');\n//\n// Command line output for parallel behat install is limited to 80 chars, if you are installing more then 4 sites and\n// want to expand output to more then 80 chars, then define BEHAT_MAX_CMD_LINE_OUTPUT\n// Example:\n//   define('BEHAT_MAX_CMD_LINE_OUTPUT', 120);\n//\n// Behat feature files will be distributed randomly between the processes by default. If you have timing file or want\n// to create timing file then define BEHAT_FEATURE_TIMING_FILE with path to timing file. It will be updated for each\n// run with latest time taken to execute feature.\n// Example:\n//   define('BEHAT_FEATURE_TIMING_FILE', '/PATH_TO_TIMING_FILE/timing.json');\n//\n// If you don't have timing file and want some stable distribution of features, then you can use step counts to\n// distribute the features. You can generate step file by executing php admin/tool/behat/cli/util.php --updatesteps\n// this will update step file which is defined by BEHAT_FEATURE_STEP_FILE.\n// Example:\n//   define('BEHAT_FEATURE_STEP_FILE', '/PATH_TO_FEATURE_STEP_COUNT_FILE/stepcount.json');\n//\n// Feature distribution for each process is displayed as histogram. you can disable it by setting\n// BEHAT_DISABLE_HISTOGRAM\n// Example:\n//   define('BEHAT_DISABLE_HISTOGRAM', true);\n//\n//=========================================================================\n// 12. DEVELOPER DATA GENERATOR\n//=========================================================================\n//\n// The developer data generator tool is intended to be used only in development or testing sites and\n// it's usage in production environments is not recommended; if it is used to create JMeter test plans\n// is even less recommended as JMeter needs to log in as site course users. JMeter needs to know the\n// users passwords but would be dangerous to have a default password as everybody would know it, which would\n// be specially dangerouse if somebody uses this tool in a production site, so in order to prevent unintended\n// uses of the tool and undesired accesses as well, is compulsory to set a password for the users\n// generated by this tool, but only in case you want to generate a JMeter test. The value should be a string.\n// Example:\n//   $CFG->tool_generator_users_password = 'examplepassword';\n//\n//=========================================================================\n// 13. SYSTEM PATHS (You need to set following, depending on your system)\n//=========================================================================\n// Ghostscript path.\n// On most Linux installs, this can be left as '/usr/bin/gs'.\n// On Windows it will be something like 'c:\\gs\\bin\\gswin32c.exe' (make sure\n// there are no spaces in the path - if necessary copy the files 'gswin32c.exe'\n// and 'gsdll32.dll' to a new folder without a space in the path)\n//      $CFG->pathtogs = '/usr/bin/gs';\n//\n// Path to PHP CLI.\n// Probably something like /usr/bin/php. If you enter this, cron scripts can be\n// executed from admin web interface.\n// $CFG->pathtophp = '';\n//\n// Path to du.\n// Probably something like /usr/bin/du. If you enter this, pages that display\n// directory contents will run much faster for directories with a lot of files.\n//      $CFG->pathtodu = '';\n//\n// Path to aspell.\n// To use spell-checking within the editor, you MUST have aspell 0.50 or later\n// installed on your server, and you must specify the correct path to access the\n// aspell binary. On Unix/Linux systems, this path is usually /usr/bin/aspell,\n// but it might be something else.\n//      $CFG->aspellpath = '';\n//\n// Path to dot.\n// Probably something like /usr/bin/dot. To be able to generate graphics from\n// DOT files, you must have installed the dot executable and point to it here.\n// Note that, for now, this only used by the profiling features\n// (Development->Profiling) built into Moodle.\n//      $CFG->pathtodot = '';\n//\n// Path to unoconv.\n// Probably something like /usr/bin/unoconv. Used as a fallback to convert between document formats.\n// Unoconv is used convert between file formats supported by LibreOffice.\n// Use a recent version of unoconv ( >= 0.7 ), older versions have trouble running from a webserver.\n//      $CFG->pathtounoconv = '';\n//\n//=========================================================================\n// 14. ALTERNATIVE FILE SYSTEM SETTINGS\n//=========================================================================\n//\n// Alternative file system.\n// Since 3.3 it is possible to override file_storage and file_system API and use alternative storage systems (e.g. S3,\n// Rackspace Cloud Files, Google Cloud Storage, Azure Storage, etc.).\n// To set the alternative file storage system in config.php you can use the following setting, providing the\n// alternative system class name that will be auto-loaded by file_storage API.\n//\n//      $CFG->alternative_file_system_class = '\\\\local_myfilestorage\\\\file_system';\n//\n//=========================================================================\n// ALL DONE!  To continue installation, visit your main page with a browser\n//=========================================================================\n\nrequire_once(__DIR__ . '/lib/setup.php'); // Do not edit\n\n// There is no php closing tag in this file,\n// it is intentional because it prevents trailing whitespace problems!\n", "num_lines": 930}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n///////////////////////////////////////////////////////////////////////////\n//                                                                       //\n// Moodle configuration file                                             //\n//                                                                       //\n// This file should be renamed \"config.php\" in the top-level directory   //\n//                                                                       //\n///////////////////////////////////////////////////////////////////////////\n//                                                                       //\n// NOTICE OF COPYRIGHT                                                   //\n//                                                                       //\n// Moodle - Modular Object-Oriented Dynamic Learning Environment         //\n//          http://moodle.org                                            //\n//                                                                       //\n// Copyright (C) 1999 onwards  Martin Dougiamas  http://moodle.com       //\n//                                                                       //\n// This program is free software; you can redistribute it and/or modify  //\n// it under the terms of the GNU General Public License as published by  //\n// the Free Software Foundation; either version 3 of the License, or     //\n// (at your option) any later version.                                   //\n//                                                                       //\n// This program is distributed in the hope that it will be useful,       //\n// but WITHOUT ANY WARRANTY; without even the implied warranty of        //\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //\n// GNU General Public License for more details:                          //\n//                                                                       //\n//          http://www.gnu.org/copyleft/gpl.html                         //\n//                                                                       //\n///////////////////////////////////////////////////////////////////////////\nunset($CFG);  // Ignore this line\nglobal $CFG;  // This is necessary here for PHPUnit execution\n$CFG = new stdClass();\n\n//=========================================================================\n// 1. DATABASE SETUP\n//=========================================================================\n//GET database configuration from azure\n$connectstr_dbtype = ''; \n$connectstr_dbhost = '';\n$connectstr_dbname = '';\n$connectstr_dbusername = '';\n$connectstr_dbpassword = '';\n\n    $connectstr_dbtype = getenv('DATABASE_TYPE');\n    $connectstr_dbhost = getenv('DATABASE_HOST');\n    $connectstr_dbname = getenv('DATABASE_NAME');\n    $connectstr_dbusername = getenv('DATABASE_USERNAME');\n    $connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n$CFG->dbtype    = $connectstr_dbtype;\n$CFG->dblibrary = 'native';\n$CFG->dbhost    = $connectstr_dbhost;\n$CFG->dbname    = $connectstr_dbname;\n$CFG->dbuser    = $connectstr_dbusername;\n$CFG->dbpass    = $connectstr_dbpassword;\n$CFG->prefix    = 'mdl_';\n$CFG->dboptions = array(\n  'dbpersist' => false,       // should persistent database connections be\n                              //  used? set to 'false' for the most stable\n                              //  setting, 'true' can improve performance\n                              //  sometimes\n  'dbsocket'  => false,       // should connection via UNIX socket be used?\n                              //  if you set it to 'true' or custom path\n                              //  here set dbhost to 'localhost',\n                              //  (please note mysql is always using socket\n                              //  if dbhost is 'localhost' - if you need\n                              //  local port connection use '127.0.0.1')\n  'dbport'    => '',          // the TCP port number to use when connecting\n                              //  to the server. keep empty string for the\n                              //  default port\n  'dbhandlesoptions' => false,// On PostgreSQL poolers like pgbouncer don't\n                              // support advanced options on connection.\n                              // If you set those in the database then\n                              // the advanced settings will not be sent.\n  'dbcollation' => 'utf8mb4_unicode_ci', // MySQL has partial and full UTF-8\n                              // support. If you wish to use partial UTF-8\n                              // (three bytes) then set this option to\n                              // 'utf8_unicode_ci', otherwise this option\n                              // can be removed for MySQL (by default it will\n                              // use 'utf8mb4_unicode_ci'. This option should\n                              // be removed for all other databases.\n  // 'fetchbuffersize' => 100000, // On PostgreSQL, this option sets a limit\n                              // on the number of rows that are fetched into\n                              // memory when doing a large recordset query\n                              // (e.g. search indexing). Default is 100000.\n                              // Uncomment and set to a value to change it,\n                              // or zero to turn off the limit. You need to\n                              // set to zero if you are using pg_bouncer in\n                              // 'transaction' mode (it is fine in 'session'\n                              // mode).\n);\n\n\n//=========================================================================\n// 2. WEB SITE LOCATION\n//=========================================================================\n// Now you need to tell Moodle where it is located. Specify the full\n// web address to where moodle has been installed.  If your web site\n// is accessible via multiple URLs then choose the most natural one\n// that your students would use.  Do not include a trailing slash\n//\n// If you need both intranet and Internet access please read\n// http://docs.moodle.org/en/masquerading\n\n$CFG->wwwroot   = \"http://\".$_SERVER['HTTP_HOST'];\n//=========================================================================\n// 3. DATA FILES LOCATION\n//=========================================================================\n// Now you need a place where Moodle can save uploaded files.  This\n// directory should be readable AND WRITEABLE by the web server user\n// (usually 'nobody' or 'apache'), but it should not be accessible\n// directly via the web.\n//\n// - On hosting systems you might need to make sure that your \"group\" has\n//   no permissions at all, but that \"others\" have full permissions.\n//\n// - On Windows systems you might specify something like 'c:\\moodledata'\n\n$CFG->dataroot  = '/var/moodledata';\n\n\n//=========================================================================\n// 4. DATA FILES PERMISSIONS\n//=========================================================================\n// The following parameter sets the permissions of new directories\n// created by Moodle within the data directory.  The format is in\n// octal format (as used by the Unix utility chmod, for example).\n// The default is usually OK, but you may want to change it to 0750\n// if you are concerned about world-access to the files (you will need\n// to make sure the web server process (eg Apache) can access the files.\n// NOTE: the prefixed 0 is important, and don't use quotes.\n\n$CFG->directorypermissions = 02777;\n\n\n//=========================================================================\n// 5. DIRECTORY LOCATION  (most people can just ignore this setting)\n//=========================================================================\n// A very few webhosts use /admin as a special URL for you to access a\n// control panel or something.  Unfortunately this conflicts with the\n// standard location for the Moodle admin pages.  You can work around this\n// by renaming the admin directory in your installation, and putting that\n// new name here.  eg \"moodleadmin\".  This should fix all admin links in Moodle.\n// After any change you need to visit your new admin directory\n// and purge all caches.\n\n$CFG->admin = 'admin';\n\n\n//=========================================================================\n// 6. OTHER MISCELLANEOUS SETTINGS (ignore these for new installations)\n//=========================================================================\n//\n// These are additional tweaks for which no GUI exists in Moodle yet.\n//\n// Starting in PHP 5.3 administrators should specify default timezone\n// in PHP.ini, you can also specify it here if needed.\n// See details at: http://php.net/manual/en/function.date-default-timezone-set.php\n// List of time zones at: http://php.net/manual/en/timezones.php\n//     date_default_timezone_set('Australia/Perth');\n//\n// Change the key pair lifetime for Moodle Networking\n// The default is 28 days. You would only want to change this if the key\n// was not getting regenerated for any reason. You would probably want\n// make it much longer. Note that you'll need to delete and manually update\n// any existing key.\n//      $CFG->mnetkeylifetime = 28;\n//\n// Not recommended: Set the following to true to allow the use\n// off non-Moodle standard characters in usernames.\n//      $CFG->extendedusernamechars = true;\n//\n// Allow user passwords to be included in backup files. Very dangerous\n// setting as far as it publishes password hashes that can be unencrypted\n// if the backup file is publicy available. Use it only if you can guarantee\n// that all your backup files remain only privacy available and are never\n// shared out from your site/institution!\n//      $CFG->includeuserpasswordsinbackup = true;\n//\n// Completely disable user creation when restoring a course, bypassing any\n// permissions granted via roles and capabilities. Enabling this setting\n// results in the restore process stopping when a user attempts to restore a\n// course requiring users to be created.\n//     $CFG->disableusercreationonrestore = true;\n//\n// Keep the temporary directories used by backup and restore without being\n// deleted at the end of the process. Use it if you want to debug / view\n// all the information stored there after the process has ended. Note that\n// those directories may be deleted (after some ttl) both by cron and / or\n// by new backup / restore invocations.\n//     $CFG->keeptempdirectoriesonbackup = true;\n//\n// Modify the restore process in order to force the \"user checks\" to assume\n// that the backup originated from a different site, so detection of matching\n// users is performed with different (more \"relaxed\") rules. Note that this is\n// only useful if the backup file has been created using Moodle < 1.9.4 and the\n// site has been rebuilt from scratch using backup files (not the best way btw).\n// If you obtain user conflicts on restore, rather than enabling this setting\n// permanently, try restoring the backup on a different site, back it up again\n// and then restore on the target server.\n//    $CFG->forcedifferentsitecheckingusersonrestore = true;\n//\n// Force the backup system to continue to create backups in the legacy zip\n// format instead of the new tgz format. Does not affect restore, which\n// auto-detects the underlying file format.\n//    $CFG->usezipbackups = true;\n//\n// Prevent stats processing and hide the GUI\n//      $CFG->disablestatsprocessing = true;\n//\n// Setting this to true will enable admins to edit any post at any time\n//      $CFG->admineditalways = true;\n//\n// These variables define DEFAULT block variables for new courses\n// If this one is set it overrides all others and is the only one used.\n//      $CFG->defaultblocks_override = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// These variables define the specific settings for defined course formats.\n// They override any settings defined in the formats own config file.\n//      $CFG->defaultblocks_site = 'site_main_menu,course_list:course_summary,calendar_month';\n//      $CFG->defaultblocks_social = 'participants,search_forums,calendar_month,calendar_upcoming,social_activities,recent_activity,course_list';\n//      $CFG->defaultblocks_topics = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//      $CFG->defaultblocks_weeks = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// These blocks are used when no other default setting is found.\n//      $CFG->defaultblocks = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';\n//\n// You can specify a different class to be created for the $PAGE global, and to\n// compute which blocks appear on each page. However, I cannot think of any good\n// reason why you would need to change that. It just felt wrong to hard-code the\n// the class name. You are strongly advised not to use these to settings unless\n// you are absolutely sure you know what you are doing.\n//      $CFG->moodlepageclass = 'moodle_page';\n//      $CFG->moodlepageclassfile = \"$CFG->dirroot/local/myplugin/mypageclass.php\";\n//      $CFG->blockmanagerclass = 'block_manager';\n//      $CFG->blockmanagerclassfile = \"$CFG->dirroot/local/myplugin/myblockamanagerclass.php\";\n//\n// Seconds for files to remain in caches. Decrease this if you are worried\n// about students being served outdated versions of uploaded files.\n//     $CFG->filelifetime = 60*60*6;\n//\n// Some web servers can offload the file serving from PHP process,\n// comment out one the following options to enable it in Moodle:\n//     $CFG->xsendfile = 'X-Sendfile';           // Apache {@see https://tn123.org/mod_xsendfile/}\n//     $CFG->xsendfile = 'X-LIGHTTPD-send-file'; // Lighttpd {@see http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file}\n//     $CFG->xsendfile = 'X-Accel-Redirect';     // Nginx {@see http://wiki.nginx.org/XSendfile}\n// If your X-Sendfile implementation (usually Nginx) uses directory aliases specify them\n// in the following array setting:\n//     $CFG->xsendfilealiases = array(\n//         '/dataroot/' => $CFG->dataroot,\n//         '/cachedir/' => '/var/moodledata/cache/',    // for custom $CFG->cachedir locations\n//         '/localcachedir/' => '/var/moodledata/localcache/',    // for custom $CFG->localcachedir locations\n//         '/tempdir/'  => '/var/moodledata/temp/',     // for custom $CFG->tempdir locations\n//         '/filedir'   => $CFG->dataroot.'/filedir',  // for custom $CFG->filedir locations\n//     );\n//\n// YUI caching may be sometimes improved by slasharguments:\n//     $CFG->yuislasharguments = 1;\n// Some servers may need a special rewrite rule to work around internal path length limitations:\n// RewriteRule (^.*/theme/yui_combo\\.php)(/.*) $1?file=$2\n//\n//\n// Following settings may be used to select session driver, uncomment only one of the handlers.\n//   Database session handler (not compatible with MyISAM):\n//      $CFG->session_handler_class = '\\core\\session\\database';\n//      $CFG->session_database_acquire_lock_timeout = 120;\n//\n//   File session handler (file system locking required):\n//      $CFG->session_handler_class = '\\core\\session\\file';\n//      $CFG->session_file_save_path = $CFG->dataroot.'/sessions';\n        $CFG->session_file_save_path = '/usr/local/php/tmp';\n//\n//   Memcached session handler (requires memcached server and extension):\n//      $CFG->session_handler_class = '\\core\\session\\memcached';\n//      $CFG->session_memcached_save_path = '127.0.0.1:11211';\n//      $CFG->session_memcached_prefix = 'memc.sess.key.';\n//      $CFG->session_memcached_acquire_lock_timeout = 120;\n//      $CFG->session_memcached_lock_expire = 7200;       // Ignored if PECL memcached is below version 2.2.0\n//      $CFG->session_memcached_lock_retry_sleep = 150;   // Spin-lock retry sleeptime (msec). Only effective\n//                                                        // for tuning php-memcached 3.0.x (PHP 7)\n//\n//   Redis session handler (requires redis server and redis extension):\n//      $CFG->session_handler_class = '\\core\\session\\redis';\n//     $CFG->session_redis_host = '127.0.0.1';\n//      $CFG->session_redis_port = 6379;  // Optional.\n//      $CFG->session_redis_database = 0;  // Optional, default is db 0.\n//      $CFG->session_redis_auth = ''; // Optional, default is don't set one.\n//      $CFG->session_redis_prefix = ''; // Optional, default is don't set one.\n//      $CFG->session_redis_acquire_lock_timeout = 120;\n//      $CFG->session_redis_lock_expire = 7200;\n//      Use the igbinary serializer instead of the php default one. Note that phpredis must be compiled with\n//      igbinary support to make the setting to work. Also, if you change the serializer you have to flush the database!\n//      $CFG->session_redis_serializer_use_igbinary = false; // Optional, default is PHP builtin serializer.\n//\n// Please be aware that when selecting Memcached for sessions that it is advised to use a dedicated\n// memcache server. The memcached extension does not provide isolated environments for individual uses.\n// Using the same server for other purposes (MUC for example) can lead to sessions being prematurely removed should\n// the other uses of the server purge the cache.\n//\n// Following setting allows you to alter how frequently is timemodified updated in sessions table.\n//      $CFG->session_update_timemodified_frequency = 20; // In seconds.\n//\n// If this setting is set to true, then Moodle will track the IP of the\n// current user to make sure it hasn't changed during a session.  This\n// will prevent the possibility of sessions being hijacked via XSS, but it\n// may break things for users coming using proxies that change all the time,\n// like AOL.\n//      $CFG->tracksessionip = true;\n//\n// The following lines are for handling email bounces.\n//      $CFG->handlebounces = true;\n//      $CFG->minbounces = 10;\n//      $CFG->bounceratio = .20;\n// The next lines are needed both for bounce handling and any other email to module processing.\n// mailprefix must be EXACTLY four characters.\n// Uncomment and customise this block for Postfix\n//      $CFG->mailprefix = 'mdl+'; // + is the separator for Exim and Postfix.\n//      $CFG->mailprefix = 'mdl-'; // - is the separator for qmail\n//      $CFG->maildomain = 'youremaildomain.com';\n//\n// Enable when setting up advanced reverse proxy load balancing configurations,\n// it may be also necessary to enable this when using port forwarding.\n//      $CFG->reverseproxy = true;\n//\n// Enable when using external SSL appliance for performance reasons.\n// Please note that site may be accessible via http: or https:, but not both!\n//      $CFG->sslproxy = true;\n//\n// This setting will cause the userdate() function not to fix %d in\n// date strings, and just let them show with a zero prefix.\n//      $CFG->nofixday = true;\n//\n// This setting will make some graphs (eg user logs) use lines instead of bars\n//      $CFG->preferlinegraphs = true;\n//\n// This setting allows you to specify a class to rewrite outgoing urls\n// enabling 'clean urls' in conjunction with an apache / nginx handler.\n// The handler must implement \\core\\output\\url_rewriter.\n//      $CFG->urlrewriteclass = '\\local_cleanurls\\url_rewriter';\n//\n// Enabling this will allow custom scripts to replace existing moodle scripts.\n// For example: if $CFG->customscripts/course/view.php exists then\n// it will be used instead of $CFG->wwwroot/course/view.php\n// At present this will only work for files that include config.php and are called\n// as part of the url (index.php is implied).\n// Some examples are:\n//      http://my.moodle.site/course/view.php\n//      http://my.moodle.site/index.php\n//      http://my.moodle.site/admin            (index.php implied)\n// Custom scripts should not include config.php\n// Warning: Replacing standard moodle scripts may pose security risks and/or may not\n// be compatible with upgrades. Use this option only if you are aware of the risks\n// involved.\n// Specify the full directory path to the custom scripts\n//      $CFG->customscripts = '/home/example/customscripts';\n//\n// Performance profiling\n//\n//   If you set Debug to \"Yes\" in the Configuration->Variables page some\n//   performance profiling data will show up on your footer (in default theme).\n//   With these settings you get more granular control over the capture\n//   and printout of the data\n//\n//   Capture performance profiling data\n//   define('MDL_PERF'  , true);\n//\n//   Capture additional data from DB\n//   define('MDL_PERFDB'  , true);\n//\n//   Print to log (for passive profiling of production servers)\n//   define('MDL_PERFTOLOG'  , true);\n//\n//   Print to footer (works with the default theme)\n//   define('MDL_PERFTOFOOT', true);\n//\n//   Enable earlier profiling that causes more code to be covered\n//   on every request (db connections, config load, other inits...).\n//   Requires extra configuration to be defined in config.php like:\n//   profilingincluded, profilingexcluded, profilingautofrec,\n//   profilingallowme, profilingallowall, profilinglifetime\n//       $CFG->earlyprofilingenabled = true;\n//\n// Disable database storage for profile data.\n// When using an exernal plugin to store profiling data it is often\n// desirable to not store the data in the database.\n//\n//      $CFG->disableprofilingtodatabase = true;\n//\n// Force displayed usernames\n//   A little hack to anonymise user names for all students.  If you set these\n//   then all non-teachers will always see these for every person.\n//       $CFG->forcefirstname = 'Bruce';\n//       $CFG->forcelastname  = 'Simpson';\n//\n// The following setting will turn on username logging into Apache log. For full details regarding setting\n// up of this function please refer to the install section of the document.\n//     $CFG->apacheloguser = 0; // Turn this feature off. Default value.\n//     $CFG->apacheloguser = 1; // Log user id.\n//     $CFG->apacheloguser = 2; // Log full name in cleaned format. ie, Darth Vader will be displayed as darth_vader.\n//     $CFG->apacheloguser = 3; // Log username.\n// To get the values logged in Apache's log, add to your httpd.conf\n// the following statements. In the General part put:\n//     LogFormat \"%h %l %{MOODLEUSER}n %t \\\"%r\\\" %s %b \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" moodleformat\n// And in the part specific to your Moodle install / virtualhost:\n//     CustomLog \"/your/path/to/log\" moodleformat\n//\n// Alternatively for other webservers such as nginx, you can instead have the username sent via a http header\n// 'X-MOODLEUSER' which can be saved in the logfile and then stripped out before being sent to the browser:\n//     $CFG->headerloguser = 0; // Turn this feature off. Default value.\n//     $CFG->headerloguser = 1; // Log user id.\n//     $CFG->headerloguser = 2; // Log full name in cleaned format. ie, Darth Vader will be displayed as darth_vader.\n//     $CFG->headerloguser = 3; // Log username.\n//\n// CAUTION: Use of this option will expose usernames in the Apache / nginx log,\n// If you are going to publish your log, or the output of your web stats analyzer\n// this will weaken the security of your website.\n//\n// Email database connection errors to someone.  If Moodle cannot connect to the\n// database, then email this address with a notice.\n//\n//     $CFG->emailconnectionerrorsto = 'your@emailaddress.com';\n//\n// Set the priority of themes from highest to lowest. This is useful (for\n// example) in sites where the user theme should override all other theme\n// settings for accessibility reasons. You can also disable types of themes\n// (other than site)  by removing them from the array. The default setting is:\n//\n//     $CFG->themeorder = array('course', 'category', 'session', 'user', 'cohort', 'site');\n//\n// NOTE: course, category, session, user, cohort themes still require the\n// respective settings to be enabled\n//\n// It is possible to add extra themes directory stored outside of $CFG->dirroot.\n// This local directory does not have to be accessible from internet.\n//\n//     $CFG->themedir = '/location/of/extra/themes';\n//\n// It is possible to specify different cache and temp directories, use local fast filesystem\n// for normal web servers. Server clusters MUST use shared filesystem for cachedir!\n// Localcachedir is intended for server clusters, it does not have to be shared by cluster nodes.\n// The directories must not be accessible via web.\n//\n//     $CFG->tempdir = '/var/www/moodle/temp';        // Directory MUST BE SHARED by all cluster nodes.\n//     $CFG->cachedir = '/var/www/moodle/cache';      // Directory MUST BE SHARED by all cluster nodes, locking required.\n//     $CFG->localcachedir = '/var/local/cache';      // Intended for local node caching.\n//\n// It is possible to specify a different backup temp directory, use local fast filesystem\n// for normal web servers. Server clusters MUST use shared filesystem for backuptempdir!\n// The directory must not be accessible via web.\n//\n//     $CFG->backuptempdir = '/var/www/moodle/backuptemp';  // Directory MUST BE SHARED by all cluster nodes.\n//\n// Some filesystems such as NFS may not support file locking operations.\n// Locking resolves race conditions and is strongly recommended for production servers.\n//     $CFG->preventfilelocking = false;\n//\n// Site default language can be set via standard administration interface. If you\n// want to have initial error messages for eventual database connection problems\n// localized too, you have to set your language code here.\n//\n//     $CFG->lang = 'yourlangcode'; // for example 'cs'\n//\n// When Moodle is about to perform an intensive operation it raises PHP's memory\n// limit. The following setting should be used on large sites to set the raised\n// memory limit to something higher.\n// The value for the settings should be a valid PHP memory value. e.g. 512M, 1G\n//\n//     $CFG->extramemorylimit = '1024M';\n//\n// Moodle 2.4 introduced a new cache API.\n// The cache API stores a configuration file within the Moodle data directory and\n// uses that rather than the database in order to function in a stand-alone manner.\n// Using altcacheconfigpath you can change the location where this config file is\n// looked for.\n// It can either be a directory in which to store the file, or the full path to the\n// file if you want to take full control. Either way it must be writable by the\n// webserver.\n//\n//     $CFG->altcacheconfigpath = '/var/www/shared/moodle.cache.config.php\n//\n// Use the following flag to completely disable the Available update notifications\n// feature and hide it from the server administration UI.\n//\n//      $CFG->disableupdatenotifications = true;\n//\n// Use the following flag to completely disable the installation of plugins\n// (new plugins, available updates and missing dependencies) and related\n// features (such as cancelling the plugin installation or upgrade) via the\n// server administration web interface.\n//\n//      $CFG->disableupdateautodeploy = true;\n//\n// Use the following flag to disable the warning on the system notifications page\n// about present development libraries. This flag will not disable the warning within\n// the security overview report. Use this flag only if you really have prohibited web\n// access to the development libraries in your webserver configuration.\n//\n//      $CFG->disabledevlibdirscheck = true;\n//\n// Use the following flag to disable modifications to scheduled tasks\n// whilst still showing the state of tasks.\n//\n//      $CFG->preventscheduledtaskchanges = true;\n//\n// As of version 2.4 Moodle serves icons as SVG images if the users browser appears\n// to support SVG.\n// For those wanting to control the serving of SVG images the following setting can\n// be defined in your config.php.\n// If it is not defined then the default (browser detection) will occur.\n//\n// To ensure they are always used when available:\n//      $CFG->svgicons = true;\n//\n// To ensure they are never used even when available:\n//      $CFG->svgicons = false;\n//\n// Some administration options allow setting the path to executable files. This can\n// potentially cause a security risk. Set this option to true to disable editing\n// those config settings via the web. They will need to be set explicitly in the\n// config.php file\n//      $CFG->preventexecpath = true;\n//\n// Use the following flag to set userid for noreply user. If not set then moodle will\n// create dummy user and use -ve value as user id.\n//      $CFG->noreplyuserid = -10;\n//\n// As of version 2.6 Moodle supports admin to set support user. If not set, all mails\n// will be sent to supportemail.\n//      $CFG->supportuserid = -20;\n//\n// Moodle 2.7 introduces a locking api for critical tasks (e.g. cron).\n// The default locking system to use is DB locking for Postgres, and file locking for\n// MySQL, Oracle and SQLServer. If $CFG->preventfilelocking is set, then the default\n// will always be DB locking. It can be manually set to one of the lock\n// factory classes listed below, or one of your own custom classes implementing the\n// \\core\\lock\\lock_factory interface.\n//\n//      $CFG->lock_factory = \"auto\";\n//\n// The list of available lock factories is:\n//\n// \"\\\\core\\\\lock\\\\file_lock_factory\" - File locking\n//      Uses lock files stored by default in the dataroot. Whether this\n//      works on clusters depends on the file system used for the dataroot.\n//\n// \"\\\\core\\\\lock\\\\db_record_lock_factory\" - DB locking based on table rows.\n//\n// \"\\\\core\\\\lock\\\\postgres_lock_factory\" - DB locking based on postgres advisory locks.\n//\n// Settings used by the lock factories\n//\n// Location for lock files used by the File locking factory. This must exist\n// on a shared file system that supports locking.\n//      $CFG->lock_file_root = $CFG->dataroot . '/lock';\n//\n// Moodle 2.9 allows administrators to customise the list of supported file types.\n// To add a new filetype or override the definition of an existing one, set the\n// customfiletypes variable like this:\n//\n// $CFG->customfiletypes = array(\n//     (object)array(\n//         'extension' => 'frog',\n//         'icon' => 'archive',\n//         'type' => 'application/frog',\n//         'customdescription' => 'Amphibian-related file archive'\n//     )\n// );\n//\n// The extension, icon, and type fields are required. The icon field can refer to\n// any icon inside the pix/f folder. You can also set the customdescription field\n// (shown above) and (for advanced use) the groups, string, and defaulticon fields.\n//\n// Upgrade key\n//\n// If the upgrade key is defined here, then the value must be provided every time\n// the site is being upgraded though the web interface, regardless of whether the\n// administrator is logged in or not. This prevents anonymous access to the upgrade\n// screens where the real authentication and authorization mechanisms can not be\n// relied on.\n//\n// It is strongly recommended to use a value different from your real account\n// password.\n//\n//      $CFG->upgradekey = 'put_some_password-like_value_here';\n//\n// Document conversion limit\n//\n// How many times the background task should attempt to convert a given attempt\n// before removing it from the queue. Currently this limit is only used by the\n// mod_assign conversion task.\n//\n//      $CFG->conversionattemptlimit = 3;\n//\n// Font used in exported PDF files. When generating a PDF, Moodle embeds a subset of\n// the font in the PDF file so it will be readable on the widest range of devices.\n// The default font is 'freesans' which is part of the GNU FreeFont collection.\n//\n//      $CFG->pdfexportfont = 'freesans';\n//\n// Use the following flag to enable messagingallusers and set the default preference\n// value for existing users to allow them to be contacted by other site users.\n//\n//      $CFG->keepmessagingallusersenabled = true;\n//\n// Disable login token validation for login pages. Login token validation is enabled\n// by default unless $CFG->alternateloginurl is set.\n//\n//      $CFG->disablelogintoken = true;\n//\n//=========================================================================\n// 7. SETTINGS FOR DEVELOPMENT SERVERS - not intended for production use!!!\n//=========================================================================\n//\n// Force a debugging mode regardless the settings in the site administration\n// @error_reporting(E_ALL | E_STRICT); // NOT FOR PRODUCTION SERVERS!\n// @ini_set('display_errors', '1');    // NOT FOR PRODUCTION SERVERS!\n// $CFG->debug = (E_ALL | E_STRICT);   // === DEBUG_DEVELOPER - NOT FOR PRODUCTION SERVERS!\n// $CFG->debugdisplay = 1;             // NOT FOR PRODUCTION SERVERS!\n//\n// You can specify a comma separated list of user ids that that always see\n// debug messages, this overrides the debug flag in $CFG->debug and $CFG->debugdisplay\n// for these users only.\n// $CFG->debugusers = '2';\n//\n// Prevent theme caching\n// $CFG->themedesignermode = true; // NOT FOR PRODUCTION SERVERS!\n//\n// Enable verbose debug information during fetching of email messages from IMAP server.\n// $CFG->debugimap = true;\n//\n// Prevent JS caching\n// $CFG->cachejs = false; // NOT FOR PRODUCTION SERVERS!\n//\n// Restrict which YUI logging statements are shown in the browser console.\n// For details see the upstream documentation:\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logInclude\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logExclude\n// $CFG->yuiloginclude = array(\n//     'moodle-core-dock-loader' => true,\n//     'moodle-course-categoryexpander' => true,\n// );\n// $CFG->yuilogexclude = array(\n//     'moodle-core-dock' => true,\n//     'moodle-core-notification' => true,\n// );\n//\n// Set the minimum log level for YUI logging statements.\n// For details see the upstream documentation:\n//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logLevel\n// $CFG->yuiloglevel = 'debug';\n//\n// Prevent core_string_manager application caching\n// $CFG->langstringcache = false; // NOT FOR PRODUCTION SERVERS!\n//\n// When working with production data on test servers, no emails or other messages\n// should ever be send to real users\n// $CFG->noemailever = true;    // NOT FOR PRODUCTION SERVERS!\n//\n// Divert all outgoing emails to this address to test and debug emailing features\n// $CFG->divertallemailsto = 'root@localhost.local'; // NOT FOR PRODUCTION SERVERS!\n//\n// Except for certain email addresses you want to let through for testing. Accepts\n// a comma separated list of regexes.\n// $CFG->divertallemailsexcept = 'tester@dev.com, fred(\\+.*)?@example.com'; // NOT FOR PRODUCTION SERVERS!\n//\n// Uncomment if you want to allow empty comments when modifying install.xml files.\n// $CFG->xmldbdisablecommentchecking = true;    // NOT FOR PRODUCTION SERVERS!\n//\n// Since 2.0 sql queries are not shown during upgrade by default.\n// Please note that this setting may produce very long upgrade page on large sites.\n// $CFG->upgradeshowsql = true; // NOT FOR PRODUCTION SERVERS!\n//\n// Add SQL queries to the output of cron, just before their execution\n// $CFG->showcronsql = true;\n//\n// Force developer level debug and add debug info to the output of cron\n// $CFG->showcrondebugging = true;\n//\n//=========================================================================\n// 8. FORCED SETTINGS\n//=========================================================================\n// It is possible to specify normal admin settings here, the point is that\n// they can not be changed through the standard admin settings pages any more.\n//\n// Core settings are specified directly via assignment to $CFG variable.\n// Example:\n//   $CFG->somecoresetting = 'value';\n//\n// Plugin settings have to be put into a special array.\n// Example:\n//   $CFG->forced_plugin_settings = array('pluginname'  => array('settingname' => 'value', 'secondsetting' => 'othervalue'),\n//                                        'otherplugin' => array('mysetting' => 'myvalue', 'thesetting' => 'thevalue'));\n// Module default settings with advanced/locked checkboxes can be set too. To do this, add\n// an extra config with '_adv' or '_locked' as a suffix and set the value to true or false.\n// Example:\n//   $CFG->forced_plugin_settings = array('pluginname'  => array('settingname' => 'value', 'settingname_locked' => true, 'settingname_adv' => true));\n//\n//=========================================================================\n// 9. PHPUNIT SUPPORT\n//=========================================================================\n// $CFG->phpunit_prefix = 'phpu_';\n// $CFG->phpunit_dataroot = '/home/example/phpu_moodledata';\n// $CFG->phpunit_directorypermissions = 02777; // optional\n// $CFG->phpunit_profilingenabled = true; // optional to profile PHPUnit runs.\n//\n//\n//=========================================================================\n// 10. SECRET PASSWORD SALT\n//=========================================================================\n// A site-wide password salt is no longer used in new installations.\n// If upgrading from 2.6 or older, keep all existing salts in config.php file.\n//\n// $CFG->passwordsaltmain = 'a_very_long_random_string_of_characters#@6&*1';\n//\n// You may also have some alternative salts to allow migration from previously\n// used salts.\n//\n// $CFG->passwordsaltalt1 = '';\n// $CFG->passwordsaltalt2 = '';\n// $CFG->passwordsaltalt3 = '';\n// ....\n// $CFG->passwordsaltalt19 = '';\n// $CFG->passwordsaltalt20 = '';\n//\n//\n//=========================================================================\n// 11. BEHAT SUPPORT\n//=========================================================================\n// Behat test site needs a unique www root, data directory and database prefix:\n//\n// $CFG->behat_wwwroot = 'http://127.0.0.1/moodle';\n// $CFG->behat_prefix = 'bht_';\n// $CFG->behat_dataroot = '/home/example/bht_moodledata';\n//\n// You can override default Moodle configuration for Behat and add your own\n// params; here you can add more profiles, use different Mink drivers than Selenium...\n// These params would be merged with the default Moodle behat.yml, giving priority\n// to the ones specified here. The array format is YAML, following the Behat\n// params hierarchy. More info: http://docs.behat.org/guides/7.config.html\n// Example:\n//   $CFG->behat_config = array(\n//       'Mac-Firefox' => array(\n//           'suites' => array (\n//               'default' => array(\n//                   'filters' => array(\n//                      'tags' => '~@_file_upload'\n//                   ),\n//               ),\n//           ),\n//           'extensions' => array(\n//               'Behat\\MinkExtension' => array(\n//                   'selenium2' => array(\n//                       'browser' => 'firefox',\n//                       'capabilities' => array(\n//                           'platform' => 'OS X 10.6',\n//                           'version' => 20\n//                       )\n//                   )\n//               )\n//           )\n//       ),\n//       'Mac-Safari' => array(\n//           'extensions' => array(\n//               'Behat\\MinkExtension' => array(\n//                   'selenium2' => array(\n//                       'browser' => 'safari',\n//                       'capabilities' => array(\n//                           'platform' => 'OS X 10.8',\n//                           'version' => 6\n//                       )\n//                   )\n//               )\n//           )\n//       )\n//   );\n// You can also use the following config to override default Moodle configuration for Behat.\n// This config is limited to default suite and will be supported in later versions.\n// It will have precedence over $CFG->behat_config.\n// $CFG->behat_profiles = array(\n//     'phantomjs' => array(\n//         'browser' => 'phantomjs',\n//         'tags' => '~@_file_upload&&~@_alert&&~@_bug_phantomjs',\n//         'wd_host' => 'http://127.0.0.1:4443/wd/hub',\n//         'capabilities' => array(\n//             'platform' => 'Linux',\n//             'version' => 2.1\n//         )\n//     ),\n// );\n//\n// You can force the browser session (not user's sessions) to restart after N seconds. This could\n// be useful if you are using a cloud-based service with time restrictions in the browser side.\n// Setting this value the browser session that Behat is using will be restarted. Set the time in\n// seconds. Is not recommended to use this setting if you don't explicitly need it.\n// Example:\n//   $CFG->behat_restart_browser_after = 7200;     // Restarts the browser session after 2 hours\n//\n// All this page's extra Moodle settings are compared against a white list of allowed settings\n// (the basic and behat_* ones) to avoid problems with production environments. This setting can be\n// used to expand the default white list with an array of extra settings.\n// Example:\n//   $CFG->behat_extraallowedsettings = array('somecoresetting', ...);\n//\n// You should explicitly allow the usage of the deprecated behat steps, otherwise an exception will\n// be thrown when using them. The setting is disabled by default.\n// Example:\n//   $CFG->behat_usedeprecated = true;\n//\n// Including feature files from directories outside the dirroot is possible if required. The setting\n// requires that the running user has executable permissions on all parent directories in the paths.\n// Example:\n//   $CFG->behat_additionalfeatures = array('/home/developer/code/wipfeatures');\n//\n// You can make behat save several dumps when a scenario fails. The dumps currently saved are:\n// * a dump of the DOM in it's state at the time of failure; and\n// * a screenshot (JavaScript is required for the screenshot functionality, so not all browsers support this option)\n// Example:\n//   $CFG->behat_faildump_path = '/my/path/to/save/failure/dumps';\n//\n// You can specify db, selenium wd_host etc. for behat parallel run by setting following variable.\n// Example:\n//   $CFG->behat_parallel_run = array (\n//       array (\n//           'dbtype' => 'mysqli',\n//           'dblibrary' => 'native',\n//           'dbhost' => 'localhost',\n//           'dbname' => 'moodletest',\n//           'dbuser' => 'moodle',\n//           'dbpass' => 'moodle',\n//           'behat_prefix' => 'mdl_',\n//           'wd_host' => 'http://127.0.0.1:4444/wd/hub',\n//           'behat_wwwroot' => 'http://127.0.0.1/moodle',\n//           'behat_dataroot' => '/home/example/bht_moodledata'\n//       ),\n//   );\n//\n// To change name of behat parallel run site, define BEHAT_PARALLEL_SITE_NAME and parallel run sites will be suffixed\n// with this value\n// Example:\n//   define('BEHAT_PARALLEL_SITE_NAME', 'behatparallelsite');\n//\n// Command line output for parallel behat install is limited to 80 chars, if you are installing more then 4 sites and\n// want to expand output to more then 80 chars, then define BEHAT_MAX_CMD_LINE_OUTPUT\n// Example:\n//   define('BEHAT_MAX_CMD_LINE_OUTPUT', 120);\n//\n// Behat feature files will be distributed randomly between the processes by default. If you have timing file or want\n// to create timing file then define BEHAT_FEATURE_TIMING_FILE with path to timing file. It will be updated for each\n// run with latest time taken to execute feature.\n// Example:\n//   define('BEHAT_FEATURE_TIMING_FILE', '/PATH_TO_TIMING_FILE/timing.json');\n//\n// If you don't have timing file and want some stable distribution of features, then you can use step counts to\n// distribute the features. You can generate step file by executing php admin/tool/behat/cli/util.php --updatesteps\n// this will update step file which is defined by BEHAT_FEATURE_STEP_FILE.\n// Example:\n//   define('BEHAT_FEATURE_STEP_FILE', '/PATH_TO_FEATURE_STEP_COUNT_FILE/stepcount.json');\n//\n// Feature distribution for each process is displayed as histogram. you can disable it by setting\n// BEHAT_DISABLE_HISTOGRAM\n// Example:\n//   define('BEHAT_DISABLE_HISTOGRAM', true);\n//\n//=========================================================================\n// 12. DEVELOPER DATA GENERATOR\n//=========================================================================\n//\n// The developer data generator tool is intended to be used only in development or testing sites and\n// it's usage in production environments is not recommended; if it is used to create JMeter test plans\n// is even less recommended as JMeter needs to log in as site course users. JMeter needs to know the\n// users passwords but would be dangerous to have a default password as everybody would know it, which would\n// be specially dangerouse if somebody uses this tool in a production site, so in order to prevent unintended\n// uses of the tool and undesired accesses as well, is compulsory to set a password for the users\n// generated by this tool, but only in case you want to generate a JMeter test. The value should be a string.\n// Example:\n   $CFG->tool_generator_users_password = 'testpassword';\n//\n//=========================================================================\n// 13. SYSTEM PATHS (You need to set following, depending on your system)\n//=========================================================================\n// Ghostscript path.\n// On most Linux installs, this can be left as '/usr/bin/gs'.\n// On Windows it will be something like 'c:\\gs\\bin\\gswin32c.exe' (make sure\n// there are no spaces in the path - if necessary copy the files 'gswin32c.exe'\n// and 'gsdll32.dll' to a new folder without a space in the path)\n//      $CFG->pathtogs = '/usr/bin/gs';\n//\n// Path to PHP CLI.\n// Probably something like /usr/bin/php. If you enter this, cron scripts can be\n// executed from admin web interface.\n// $CFG->pathtophp = '';\n//\n// Path to du.\n// Probably something like /usr/bin/du. If you enter this, pages that display\n// directory contents will run much faster for directories with a lot of files.\n//      $CFG->pathtodu = '';\n//\n// Path to aspell.\n// To use spell-checking within the editor, you MUST have aspell 0.50 or later\n// installed on your server, and you must specify the correct path to access the\n// aspell binary. On Unix/Linux systems, this path is usually /usr/bin/aspell,\n// but it might be something else.\n//      $CFG->aspellpath = '';\n//\n// Path to dot.\n// Probably something like /usr/bin/dot. To be able to generate graphics from\n// DOT files, you must have installed the dot executable and point to it here.\n// Note that, for now, this only used by the profiling features\n// (Development->Profiling) built into Moodle.\n//      $CFG->pathtodot = '';\n//\n// Path to unoconv.\n// Probably something like /usr/bin/unoconv. Used as a fallback to convert between document formats.\n// Unoconv is used convert between file formats supported by LibreOffice.\n// Use a recent version of unoconv ( >= 0.7 ), older versions have trouble running from a webserver.\n//      $CFG->pathtounoconv = '';\n//\n//=========================================================================\n// 14. ALTERNATIVE FILE SYSTEM SETTINGS\n//=========================================================================\n//\n// Alternative file system.\n// Since 3.3 it is possible to override file_storage and file_system API and use alternative storage systems (e.g. S3,\n// Rackspace Cloud Files, Google Cloud Storage, Azure Storage, etc.).\n// To set the alternative file storage system in config.php you can use the following setting, providing the\n// alternative system class name that will be auto-loaded by file_storage API.\n//\n//      $CFG->alternative_file_system_class = '\\\\local_myfilestorage\\\\file_system';\n//\n//=========================================================================\n// ALL DONE!  To continue installation, visit your main page with a browser\n//=========================================================================\n\nrequire_once(__DIR__ . '/lib/setup.php'); // Do not edit\n\n// There is no php closing tag in this file,\n// it is intentional because it prevents trailing whitespace problems!\n", "num_lines": 938}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Functions to support installation process\n *\n * @package    core\n * @subpackage install\n * @copyright  2009 Petr Skoda (http://skodak.org)\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefined('MOODLE_INTERNAL') || die();\n\n/** INSTALL_WELCOME = 0 */\ndefine('INSTALL_WELCOME',       0);\n/** INSTALL_ENVIRONMENT = 1 */\ndefine('INSTALL_ENVIRONMENT',   1);\n/** INSTALL_PATHS = 2 */\ndefine('INSTALL_PATHS',         2);\n/** INSTALL_DOWNLOADLANG = 3 */\ndefine('INSTALL_DOWNLOADLANG',  3);\n/** INSTALL_DATABASETYPE = 4 */\ndefine('INSTALL_DATABASETYPE',  4);\n/** INSTALL_DATABASE = 5 */\ndefine('INSTALL_DATABASE',      5);\n/** INSTALL_SAVE = 6 */\ndefine('INSTALL_SAVE',          6);\n\n/**\n * Tries to detect the right www root setting.\n * @return string detected www root\n */\nfunction install_guess_wwwroot() {\n    $wwwroot = '';\n    if (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off') {\n        $wwwroot .= 'http://';\n    } else {\n        $wwwroot .= 'https://';\n    }\n    $hostport = explode(':', $_SERVER['HTTP_HOST']);\n    $wwwroot .= reset($hostport);\n    if ($_SERVER['SERVER_PORT'] != 80 and $_SERVER['SERVER_PORT'] != '443') {\n        $wwwroot .= ':'.$_SERVER['SERVER_PORT'];\n    }\n    $wwwroot .= $_SERVER['SCRIPT_NAME'];\n\n    list($wwwroot, $xtra) = explode('/install.php', $wwwroot);\n\n    return $wwwroot;\n}\n\n/**\n * Copy of @see{ini_get_bool()}\n * @param string $ini_get_arg\n * @return bool\n */\nfunction install_ini_get_bool($ini_get_arg) {\n    $temp = ini_get($ini_get_arg);\n\n    if ($temp == '1' or strtolower($temp) == 'on') {\n        return true;\n    }\n    return false;\n}\n\n/**\n * Creates dataroot if not exists yet,\n * makes sure it is writable, add lang directory\n * and add .htaccess just in case it works.\n *\n * @param string $dataroot full path to dataroot\n * @param int $dirpermissions\n * @return bool success\n */\nfunction install_init_dataroot($dataroot, $dirpermissions) {\n    if (file_exists($dataroot) and !is_dir($dataroot)) {\n        // file with the same name exists\n        return false;\n    }\n\n    umask(0000); // $CFG->umaskpermissions is not set yet.\n    if (!file_exists($dataroot)) {\n        if (!mkdir($dataroot, $dirpermissions, true)) {\n            // most probably this does not work, but anyway\n            return false;\n        }\n    }\n    @chmod($dataroot, $dirpermissions);\n\n    if (!is_writable($dataroot)) {\n        return false; // we can not continue\n    }\n\n    // create the directory for $CFG->tempdir\n    if (!is_dir(\"$dataroot/temp\")) {\n        if (!mkdir(\"$dataroot/temp\", $dirpermissions, true)) {\n            return false;\n        }\n    }\n    if (!is_writable(\"$dataroot/temp\")) {\n        return false; // we can not continue\n    }\n\n    // create the directory for $CFG->cachedir\n    if (!is_dir(\"$dataroot/cache\")) {\n        if (!mkdir(\"$dataroot/cache\", $dirpermissions, true)) {\n            return false;\n        }\n    }\n    if (!is_writable(\"$dataroot/cache\")) {\n        return false; // we can not continue\n    }\n\n    // create the directory for $CFG->langotherroot\n    if (!is_dir(\"$dataroot/lang\")) {\n        if (!mkdir(\"$dataroot/lang\", $dirpermissions, true)) {\n            return false;\n        }\n    }\n    if (!is_writable(\"$dataroot/lang\")) {\n        return false; // we can not continue\n    }\n\n    // finally just in case some broken .htaccess that prevents access just in case it is allowed\n    if (!file_exists(\"$dataroot/.htaccess\")) {\n        if ($handle = fopen(\"$dataroot/.htaccess\", 'w')) {\n            fwrite($handle, \"deny from all\\r\\nAllowOverride None\\r\\nNote: this file is broken intentionally, we do not want anybody to undo it in subdirectory!\\r\\n\");\n            fclose($handle);\n        } else {\n            return false;\n        }\n    }\n\n    return true;\n}\n\n/**\n * Print help button\n * @param string $url\n * @param string $titel\n * @return void\n */\nfunction install_helpbutton($url, $title='') {\n    if ($title == '') {\n        $title = get_string('help');\n    }\n    echo \"<a href=\\\"javascript:void(0)\\\" \";\n    echo \"onclick=\\\"return window.open('$url','Help','menubar=0,location=0,scrollbars,resizable,width=500,height=400')\\\"\";\n    echo \">\";\n    echo \"<img src=\\\"pix/help.gif\\\" class=\\\"iconhelp\\\" alt=\\\"$title\\\" title=\\\"$title\\\"/>\";\n    echo \"</a>\\n\";\n}\n\n/**\n * This is in function because we want the /install.php to parse in PHP4\n *\n * @param object $database\n * @param string $dbhsot\n * @param string $dbuser\n * @param string $dbpass\n * @param string $dbname\n * @param string $prefix\n * @param mixed $dboptions\n * @return string\n */\nfunction install_db_validate($database, $dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions) {\n    try {\n        try {\n            $database->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions);\n        } catch (moodle_exception $e) {\n            // let's try to create new database\n            if ($database->create_database($dbhost, $dbuser, $dbpass, $dbname, $dboptions)) {\n                $database->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions);\n            } else {\n                throw $e;\n            }\n        }\n        return '';\n    } catch (dml_exception $ex) {\n        $stringmanager = get_string_manager();\n        $errorstring = $ex->errorcode.'oninstall';\n        $legacystring = $ex->errorcode;\n        if ($stringmanager->string_exists($errorstring, $ex->module)) {\n            // By using a different string id from the error code we are separating exception handling and output.\n            $returnstring = $stringmanager->get_string($errorstring, $ex->module, $ex->a);\n            if ($ex->debuginfo) {\n                $returnstring .= '<br />'.$ex->debuginfo;\n            }\n\n            return $returnstring;\n        } else if ($stringmanager->string_exists($legacystring, $ex->module)) {\n            // There are some DML exceptions that may be thrown here as well as during normal operation.\n            // If we have a translated message already we still want to serve it here.\n            // However it is not the preferred way.\n            $returnstring = $stringmanager->get_string($legacystring, $ex->module, $ex->a);\n            if ($ex->debuginfo) {\n                $returnstring .= '<br />'.$ex->debuginfo;\n            }\n\n            return $returnstring;\n        }\n        // No specific translation. Deliver a generic error message.\n        return $stringmanager->get_string('dmlexceptiononinstall', 'error', $ex);\n    }\n}\n\n/**\n * Returns content of config.php file.\n *\n * Uses PHP_EOL for generating proper end of lines for the given platform.\n *\n * @param moodle_database $database database instance\n * @param object $cfg copy of $CFG\n * @return string\n */\nfunction install_generate_configphp($database, $cfg) {\n    $configphp = '<?php  // Moodle configuration file' . PHP_EOL . PHP_EOL;\n\n    $configphp .= 'unset($CFG);' . PHP_EOL;\n    $configphp .= 'global $CFG;' . PHP_EOL;\n    $configphp .= '$CFG = new stdClass();' . PHP_EOL . PHP_EOL; // prevent PHP5 strict warnings\n\n    $dbconfig = $database->export_dbconfig();\n\n    foreach ($dbconfig as $key=>$value) {\n        $key = str_pad($key, 9);\n        $configphp .= '$CFG->'.$key.' = '.var_export($value, true) . ';' . PHP_EOL;\n    }\n    $configphp .= PHP_EOL;\n\n    $configphp .= '$CFG->wwwroot   = '.var_export($cfg->wwwroot, true) . ';' . PHP_EOL ;\n\n    $configphp .= '$CFG->dataroot  = '.var_export($cfg->dataroot, true) . ';' . PHP_EOL;\n\n    $configphp .= '$CFG->admin     = '.var_export($cfg->admin, true) . ';' . PHP_EOL . PHP_EOL;\n\n    if (empty($cfg->directorypermissions)) {\n        $chmod = '02777';\n    } else {\n        $chmod = '0' . decoct($cfg->directorypermissions);\n    }\n    $configphp .= '$CFG->directorypermissions = ' . $chmod . ';' . PHP_EOL . PHP_EOL;\n\n    if (isset($cfg->upgradekey) and $cfg->upgradekey !== '') {\n        $configphp .= '$CFG->upgradekey = ' . var_export($cfg->upgradekey, true) . ';' . PHP_EOL . PHP_EOL;\n    }\n    $configphp .= '$CFG->session_file_save_path = \\'/usr/local/php/tmp\\';'.PHP_EOL . PHP_EOL;\n    $configphp .= 'require_once(__DIR__ . \\'/lib/setup.php\\');' . PHP_EOL . PHP_EOL;\n    $configphp .= '// There is no php closing tag in this file,' . PHP_EOL;\n    $configphp .= '// it is intentional because it prevents trailing whitespace problems!' . PHP_EOL;\n\n    return $configphp;\n}\n\n/**\n * Prints complete help page used during installation.\n * Does not return.\n *\n * @global object\n * @param string $help\n */\nfunction install_print_help_page($help) {\n    global $CFG, $OUTPUT; //TODO: MUST NOT USE $OUTPUT HERE!!!\n\n    @header('Content-Type: text/html; charset=UTF-8');\n    @header('X-UA-Compatible: IE=edge');\n    @header('Cache-Control: no-store, no-cache, must-revalidate');\n    @header('Cache-Control: post-check=0, pre-check=0', false);\n    @header('Pragma: no-cache');\n    @header('Expires: Mon, 20 Aug 1969 09:23:00 GMT');\n    @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');\n\n    echo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">';\n    echo '<html dir=\"'.(right_to_left() ? 'rtl' : 'ltr').'\">\n          <head>\n          <link rel=\"shortcut icon\" href=\"theme/clean/pix/favicon.ico\" />\n          <link rel=\"stylesheet\" type=\"text/css\" href=\"'.$CFG->wwwroot.'/install/css.php\" />\n          <title>'.get_string('installation','install').'</title>\n          <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n          </head><body>';\n    switch ($help) {\n        case 'phpversionhelp':\n            print_string($help, 'install', phpversion());\n            break;\n        case 'memorylimithelp':\n            print_string($help, 'install', @ini_get('memory_limit'));\n            break;\n        default:\n            print_string($help, 'install');\n    }\n    echo $OUTPUT->close_window_button(); //TODO: MUST NOT USE $OUTPUT HERE!!!\n    echo '</body></html>';\n    die;\n}\n\n/**\n * Prints installation page header, we can no use weblib yet in installer.\n *\n * @global object\n * @param array $config\n * @param string $stagename\n * @param string $heading\n * @param string $stagetext\n * @param string $stageclass\n * @return void\n */\nfunction install_print_header($config, $stagename, $heading, $stagetext, $stageclass = \"alert-info\") {\n    global $CFG;\n\n    @header('Content-Type: text/html; charset=UTF-8');\n    @header('X-UA-Compatible: IE=edge');\n    @header('Cache-Control: no-store, no-cache, must-revalidate');\n    @header('Cache-Control: post-check=0, pre-check=0', false);\n    @header('Pragma: no-cache');\n    @header('Expires: Mon, 20 Aug 1969 09:23:00 GMT');\n    @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');\n\n    echo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">';\n    echo '<html dir=\"'.(right_to_left() ? 'rtl' : 'ltr').'\">\n          <head>\n          <link rel=\"shortcut icon\" href=\"theme/clean/pix/favicon.ico\" />';\n\n    echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.$CFG->wwwroot.'/install/css.php\" />\n          <title>'.get_string('installation','install').' - Moodle '.$CFG->target_release.'</title>\n          <meta name=\"robots\" content=\"noindex\">\n          <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n          <meta http-equiv=\"pragma\" content=\"no-cache\" />\n          <meta http-equiv=\"expires\" content=\"0\" />';\n\n    echo '</head><body class=\"notloggedin\">\n            <div id=\"page\" class=\"stage'.$config->stage.'\">\n                <div id=\"page-header\">\n                    <div id=\"header\" class=\" clearfix\">\n                        <h1 class=\"headermain\">'.get_string('installation','install').'</h1>\n                        <div class=\"headermenu\">&nbsp;</div>\n                    </div>\n                    <div class=\"navbar clearfix\">\n                        <nav class=\"breadcrumb-nav\">\n                            <ul class=\"breadcrumb\"><li class=\"first\">'.$stagename.'</li></ul>\n                        </nav>\n                        <div class=\"navbutton\">&nbsp;</div>\n                    </div>\n                </div>\n          <!-- END OF HEADER -->\n          <div id=\"installdiv\">';\n\n    echo '<h2>'.$heading.'</h2>';\n\n    if ($stagetext !== '') {\n        echo '<div class=\"alert ' . $stageclass . '\">';\n        echo $stagetext;\n        echo '</div>';\n    }\n    // main\n    echo '<form id=\"installform\" method=\"post\" action=\"install.php\"><fieldset>';\n    foreach ($config as $name=>$value) {\n        echo '<input type=\"hidden\" name=\"'.$name.'\" value=\"'.s($value).'\" />';\n    }\n}\n\n/**\n * Prints installation page header, we can no use weblib yet in isntaller.\n *\n * @global object\n * @param array $config\n * @param bool $reload print reload button instead of next\n * @return void\n */\nfunction install_print_footer($config, $reload=false) {\n    global $CFG;\n\n    if ($config->stage > INSTALL_WELCOME) {\n        $first = '<input type=\"submit\" id=\"previousbutton\" name=\"previous\" value=\"&laquo; '.s(get_string('previous')).'\" />';\n    } else {\n        $first = '<input type=\"submit\" id=\"previousbutton\" name=\"next\" value=\"'.s(get_string('reload')).'\" />';\n        $first .= '<script type=\"text/javascript\">\n//<![CDATA[\n    var first = document.getElementById(\"previousbutton\");\n    first.style.visibility = \"hidden\";\n//]]>\n</script>\n';\n    }\n\n    if ($reload) {\n        $next = '<input type=\"submit\" id=\"nextbutton\" class=\"btn btn-primary\" name=\"next\" value=\"'.s(get_string('reload')).'\" />';\n    } else {\n        $next = '<input type=\"submit\" id=\"nextbutton\" class=\"btn btn-primary\" name=\"next\" value=\"'.s(get_string('next')).' &raquo;\" />';\n    }\n\n    echo '</fieldset><fieldset id=\"nav_buttons\">'.$first.$next.'</fieldset>';\n\n    $homelink  = '<div class=\"sitelink\">'.\n       '<a title=\"Moodle '. $CFG->target_release .'\" href=\"http://docs.moodle.org/en/Administrator_documentation\" onclick=\"this.target=\\'_blank\\'\">'.\n       '<img src=\"pix/moodlelogo.png\" alt=\"'.get_string('moodlelogo').'\" /></a></div>';\n\n    echo '</form></div>';\n    echo '<div id=\"page-footer\">'.$homelink.'</div>';\n    echo '</div></body></html>';\n}\n\n/**\n * Install Moodle DB,\n * config.php must exist, there must not be any tables in db yet.\n *\n * @param array $options adminpass is mandatory\n * @param bool $interactive\n * @return void\n */\nfunction install_cli_database(array $options, $interactive) {\n    global $CFG, $DB;\n    require_once($CFG->libdir.'/environmentlib.php');\n    require_once($CFG->libdir.'/upgradelib.php');\n\n    // show as much debug as possible\n    @error_reporting(E_ALL | E_STRICT);\n    @ini_set('display_errors', '1');\n    $CFG->debug = (E_ALL | E_STRICT);\n    $CFG->debugdisplay = true;\n    $CFG->debugdeveloper = true;\n\n    $CFG->version = '';\n    $CFG->release = '';\n    $CFG->branch = '';\n\n    $version = null;\n    $release = null;\n    $branch = null;\n\n    // read $version and $release\n    require($CFG->dirroot.'/version.php');\n\n    if ($DB->get_tables() ) {\n        cli_error(get_string('clitablesexist', 'install'));\n    }\n\n    if (empty($options['adminpass'])) {\n        cli_error('Missing required admin password');\n    }\n\n    // test environment first\n    list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);\n    if (!$envstatus) {\n        $errors = environment_get_errors($environment_results);\n        cli_heading(get_string('environment', 'admin'));\n        foreach ($errors as $error) {\n            list($info, $report) = $error;\n            echo \"!! $info !!\\n$report\\n\\n\";\n        }\n        exit(1);\n    }\n\n    if (!$DB->setup_is_unicodedb()) {\n        if (!$DB->change_db_encoding()) {\n            // If could not convert successfully, throw error, and prevent installation\n            cli_error(get_string('unicoderequired', 'admin'));\n        }\n    }\n\n    if ($interactive) {\n        cli_separator();\n        cli_heading(get_string('databasesetup'));\n    }\n\n    // install core\n    install_core($version, true);\n    set_config('release', $release);\n    set_config('branch', $branch);\n\n    if (PHPUNIT_TEST) {\n        // mark as test database as soon as possible\n        set_config('phpunittest', 'na');\n    }\n\n    // install all plugins types, local, etc.\n    upgrade_noncore(true);\n\n    // set up admin user password\n    $DB->set_field('user', 'password', hash_internal_user_password($options['adminpass']), array('username' => 'admin'));\n\n    // Set the admin email address if specified.\n    if (isset($options['adminemail'])) {\n        $DB->set_field('user', 'email', $options['adminemail'], array('username' => 'admin'));\n    }\n\n    // rename admin username if needed\n    if (isset($options['adminuser']) and $options['adminuser'] !== 'admin' and $options['adminuser'] !== 'guest') {\n        $DB->set_field('user', 'username', $options['adminuser'], array('username' => 'admin'));\n    }\n\n    // indicate that this site is fully configured\n    set_config('rolesactive', 1);\n    upgrade_finished();\n\n    // log in as admin - we need do anything when applying defaults\n    \\core\\session\\manager::set_user(get_admin());\n\n    // apply all default settings, do it twice to fill all defaults - some settings depend on other setting\n    admin_apply_default_settings(NULL, true);\n    admin_apply_default_settings(NULL, true);\n    set_config('registerauth', '');\n\n    // set the site name\n    if (isset($options['shortname']) and $options['shortname'] !== '') {\n        $DB->set_field('course', 'shortname', $options['shortname'], array('format' => 'site'));\n    }\n    if (isset($options['fullname']) and $options['fullname'] !== '') {\n        $DB->set_field('course', 'fullname', $options['fullname'], array('format' => 'site'));\n    }\n    if (isset($options['summary'])) {\n        $DB->set_field('course', 'summary', $options['summary'], array('format' => 'site'));\n    }\n\n    // Redirect to site registration on first login.\n    set_config('registrationpending', 1);\n}\n", "num_lines": 532}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n$cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin'\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = 'localhost';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n?>\n", "num_lines": 30}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n#$cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin';\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = 'localhost';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n$cfg['ForceSSL']=false;\n\n?>\n", "num_lines": 32}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n#$cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin';\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = 'localhost';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n$cfg['ForceSSL']=false;\n\n?>\n", "num_lines": 32}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n#$cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin';\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = 'localhost';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n$cfg['ForceSSL']=false;\n\n?>\n", "num_lines": 32}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n#$cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin';\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = '127.0.0.1';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n$cfg['ForceSSL']=false;\n\n?>\n", "num_lines": 32}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n#$cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin';\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = '127.0.0.1';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n$cfg['ForceSSL']=false;\n\n?>\n", "num_lines": 32}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n#$cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin';\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = 'localhost';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n$cfg['ForceSSL']=false;\n\n?>\n", "num_lines": 32}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n#$cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin';\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = '127.0.0.1';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n$cfg['ForceSSL']=false;\n\n?>\n", "num_lines": 32}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n#$cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin';\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = '127.0.0.1';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n$cfg['ForceSSL']=false;\n\n?>\n", "num_lines": 32}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n#$cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin';\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = '127.0.0.1';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n$cfg['ForceSSL']=false;\n\n?>\n", "num_lines": 32}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');;\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');;\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');;\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');;\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');;\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');;\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\t\n/**https://codex.wordpress.org/Function_Reference/is_ssl */\nif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')\n\t$_SERVER['HTTPS'] = 'on';\n\t\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 109}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine( 'DB_CHARSET', 'utf8' );\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine( 'DB_COLLATE', '' );\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine( 'AUTH_KEY',         'put your unique phrase here' );\ndefine( 'SECURE_AUTH_KEY',  'put your unique phrase here' );\ndefine( 'LOGGED_IN_KEY',    'put your unique phrase here' );\ndefine( 'NONCE_KEY',        'put your unique phrase here' );\ndefine( 'AUTH_SALT',        'put your unique phrase here' );\ndefine( 'SECURE_AUTH_SALT', 'put your unique phrase here' );\ndefine( 'LOGGED_IN_SALT',   'put your unique phrase here' );\ndefine( 'NONCE_SALT',       'put your unique phrase here' );\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine( 'WP_DEBUG', false );\n\n/* That's all, stop editing! Happy blogging. */\n/**https://codex.wordpress.org/Function_Reference/is_ssl */\nif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')\n\t$_SERVER['HTTPS'] = 'on';\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. $_SERVER['HTTP_HOST']);\ndefine('WP_SITEURL', 'http://'. $_SERVER['HTTP_HOST']);\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', $_SERVER['HTTP_HOST']);\n\n/** Absolute path to the WordPress directory. */\nif ( ! defined( 'ABSPATH' ) ) {\n\tdefine( 'ABSPATH', dirname( __FILE__ ) . '/' );\n}\n\t\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 109}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine( 'DB_CHARSET', 'utf8' );\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine( 'DB_COLLATE', '' );\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine( 'AUTH_KEY',         'put your unique phrase here' );\ndefine( 'SECURE_AUTH_KEY',  'put your unique phrase here' );\ndefine( 'LOGGED_IN_KEY',    'put your unique phrase here' );\ndefine( 'NONCE_KEY',        'put your unique phrase here' );\ndefine( 'AUTH_SALT',        'put your unique phrase here' );\ndefine( 'SECURE_AUTH_SALT', 'put your unique phrase here' );\ndefine( 'LOGGED_IN_SALT',   'put your unique phrase here' );\ndefine( 'NONCE_SALT',       'put your unique phrase here' );\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine( 'WP_DEBUG', false );\n\n/* That's all, stop editing! Happy blogging. */\n/**https://codex.wordpress.org/Function_Reference/is_ssl */\nif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')\n\t$_SERVER['HTTPS'] = 'on';\n\n//Relative URLs for swapping across app service deployment slots\ndefine('WP_HOME', 'http://'. $_SERVER['HTTP_HOST']);\ndefine('WP_SITEURL', 'http://'. $_SERVER['HTTP_HOST']);\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', $_SERVER['HTTP_HOST']);\n\n/** Absolute path to the WordPress directory. */\nif ( ! defined( 'ABSPATH' ) ) {\n\tdefine( 'ABSPATH', dirname( __FILE__ ) . '/' );\n}\n\t\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 109}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine( 'DB_CHARSET', 'utf8' );\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine( 'DB_COLLATE', '' );\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine( 'AUTH_KEY',         'put your unique phrase here' );\ndefine( 'SECURE_AUTH_KEY',  'put your unique phrase here' );\ndefine( 'LOGGED_IN_KEY',    'put your unique phrase here' );\ndefine( 'NONCE_KEY',        'put your unique phrase here' );\ndefine( 'AUTH_SALT',        'put your unique phrase here' );\ndefine( 'SECURE_AUTH_SALT', 'put your unique phrase here' );\ndefine( 'LOGGED_IN_SALT',   'put your unique phrase here' );\ndefine( 'NONCE_SALT',       'put your unique phrase here' );\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine( 'WP_DEBUG', false );\n\n/* That's all, stop editing! Happy blogging. */\n/**https://codex.wordpress.org/Function_Reference/is_ssl */\nif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')\n\t$_SERVER['HTTPS'] = 'on';\n\n//Relative URLs for swapping across app service deployment slots\ndefine('WP_HOME', 'http://'. $_SERVER['HTTP_HOST']);\ndefine('WP_SITEURL', 'http://'. $_SERVER['HTTP_HOST']);\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', $_SERVER['HTTP_HOST']);\n\n/** Absolute path to the WordPress directory. */\nif ( ! defined( 'ABSPATH' ) ) {\n\tdefine( 'ABSPATH', dirname( __FILE__ ) . '/' );\n}\n\t\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 109}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');;\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');;\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');;\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');;\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');;\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 106}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/* Servers configuration */\n$i = 0;\n\n/* Server: localhost [1] */\n$i++;\n\n/* http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo/1819767#1819767 */\n$cfg['Servers'][$i]['host'] = 'db';\n$cfg['Servers'][$i]['port'] = '';\n$cfg['Servers'][$i]['connect_type'] = 'socket';\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\n$cfg['Servers'][$i]['AllowRoot'] = false;\n$cfg['Servers'][$i]['AllowNoPassword'] = false;\n\n/* End of servers configuration */\n\n$cfg['blowfish_secret'] = '\"|5o$cGlh7%j\"f\"BKN)5cY%-(&,T(yh%';\n$cfg['DefaultLang'] = 'en';\n$cfg['ServerDefault'] = 1;\n$cfg['UploadDir'] = '';\n$cfg['SaveDir'] = '';\n\n/* https://boss.vvc.edu/database_access/doc/html/config.html#cfg_CheckConfigurationPermissions */\n$cfg['CheckConfigurationPermissions']=false;\n\n$cfg['ForceSSL']=false;\n\n?>\n", "num_lines": 31}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\ndefine('DB_NAME', 'database_name_here');\n\n/** MySQL database username */\ndefine('DB_USER', 'username_here');\n\n/** MySQL database password */\ndefine('DB_PASSWORD', 'password_here');\n\n/** MySQL hostname */\ndefine('DB_HOST', 'localhost');\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\ndefine('WP_REDIS_HOST', getenv('WP_REDIS_HOST'));\n#define('MYSQL_SSL_CA', getenv('MYSQL_SSL_CA'));\n#define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL | MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT);\n\n#// If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact\n#// see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy\nif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {\n\t$_SERVER['HTTPS'] = 'on';\n}\n/* That's all, stop editing! Happy blogging. */\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 98}
{"repo_name": "app-service-quickstart-docker-images", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = getenv('DATABASE_NAME');\n$connectstr_dbusername = getenv('DATABASE_USERNAME');\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\ndefine('WP_REDIS_HOST', getenv('WP_REDIS_HOST'));\n#define('MYSQL_SSL_CA', getenv('MYSQL_SSL_CA'));\n#define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL | MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT);\n\n#// If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact\n#// see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy\nif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {\n\t$_SERVER['HTTPS'] = 'on';\n}\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 114}
{"repo_name": "AzMigrate-Hydration", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nfunction echo_unordered_docs(\n    $map,\n    $equivalent_keys)\n{\n    $name = 'unordered_'.\n        ($equivalent_keys ? 'multi' : '').\n        ($map ? 'map' : 'set');\n    // For merge....\n    $node_partner = 'unordered_'.\n        ($equivalent_keys ? '' : 'multi').\n        ($map ? 'map' : 'set');\n\n    if ($map)\n    {\n        $template_value = <<<EOL\n            <template-type-parameter name=\"Key\">\n            </template-type-parameter>\n            <template-type-parameter name=\"Mapped\">\n            </template-type-parameter>\n\nEOL;\n\n        $key_type = 'Key';\n        $key_name = 'key';\n        $value_type = 'std::pair&lt;Key const, Mapped&gt;';\n        $full_type = $name.'&lt;Key, Mapped, Hash, Pred, Alloc&gt;';\n    }\n    else\n    {\n        $template_value = <<<EOL\n            <template-type-parameter name=\"Value\">\n            </template-type-parameter>\n\nEOL;\n\n        $key_type = 'Value';\n        $key_name = 'value';\n        $value_type = 'Value';\n        $full_type = $name.'&lt;Value, Hash, Pred, Alloc&gt;';\n    }\n?>\n        <class name=\"<?php echo $name ?>\">\n          <template>\n<?php echo $template_value; ?>\n            <template-type-parameter name=\"Hash\">\n              <default><type>boost::hash&lt;<?php echo $key_type; ?>&gt;</type></default>\n            </template-type-parameter>\n            <template-type-parameter name=\"Pred\">\n              <default><type>std::equal_to&lt;<?php echo $key_type; ?>&gt;</type></default>\n            </template-type-parameter>\n            <template-type-parameter name=\"Alloc\">\n              <default><type>std::allocator&lt;<?php echo $value_type; ?>&gt;</type></default>\n            </template-type-parameter>\n          </template>\n          <purpose><simpara>\n            An unordered associative container that <?php\n            echo $map ? 'associates ' : 'stores ';\n            echo $equivalent_keys ? '' : 'unique ';\n            echo $map ? 'keys with another value.' : 'values.';\n            echo $equivalent_keys ? ' The same key can be stored multiple times.' : '';\n          ?>\n\n          </simpara></purpose>\n          <description>\n            <para><emphasis role=\"bold\">Template Parameters</emphasis>\n              <informaltable>\n                <tgroup cols=\"2\">\n                  <tbody>\n<?php if ($map): ?>\n                    <row>\n                      <entry><emphasis>Key</emphasis></entry>\n                      <entry><code>Key</code> must be <code>Erasable</code> from the container\n                        (i.e. <code>allocator_traits</code> can <code>destroy</code> it).\n                      </entry></row>\n                    <row>\n                      <entry><emphasis>Mapped</emphasis></entry>\n                      <entry><code>Mapped</code> must be <code>Erasable</code> from the container\n                        (i.e. <code>allocator_traits</code> can <code>destroy</code> it).\n                      </entry></row>\n<?php else: ?>\n                    <row>\n                      <entry><emphasis>Value</emphasis></entry>\n                      <entry><code>Value</code> must be <code>Erasable</code> from the container\n                        (i.e. <code>allocator_traits</code> can <code>destroy</code> it).\n                      </entry></row>\n<?php endif ?>\n                    <row>\n                      <entry><emphasis>Hash</emphasis></entry>\n                      <entry>A unary function object type that acts a hash function for a <code><?php echo $key_type; ?></code>. It takes a single argument of type <code><?php echo $key_type; ?></code> and returns a value of type std::size_t.</entry></row>\n                    <row>\n                      <entry><emphasis>Pred</emphasis></entry>\n                      <entry>A binary function object that implements an equivalence relation on values of type <code><?php echo $key_type; ?></code>.\n                        A binary function object that induces an equivalence relation on values of type <code><?php echo $key_type; ?></code>.\n                        It takes two arguments of type <code><?php echo $key_type; ?></code> and returns a value of type bool.</entry></row>\n                    <row>\n                      <entry><emphasis>Alloc</emphasis></entry>\n                      <entry>An allocator whose value type is the same as the container's value type.</entry></row></tbody></tgroup></informaltable></para>\n            <para>The elements are organized into buckets. <?php\n            echo $equivalent_keys ?\n                'Keys with the same hash code are stored in the same bucket and elements with equivalent keys are stored next to each other.' :\n                'Keys with the same hash code are stored in the same bucket.';\n            ?></para>\n            <para>The number of buckets can be automatically increased by a call to insert, or as the result of calling rehash.</para>\n          </description>\n          <typedef name=\"key_type\">\n            <type><?php echo $key_type; ?></type>\n          </typedef>\n          <typedef name=\"value_type\">\n            <type><?php echo $value_type; ?></type>\n          </typedef>\n<?php if ($map): ?>\n          <typedef name=\"mapped_type\">\n            <type>Mapped</type>\n          </typedef>\n<?php endif; ?>\n          <typedef name=\"hasher\">\n            <type>Hash</type>\n          </typedef>\n          <typedef name=\"key_equal\">\n            <type>Pred</type>\n          </typedef>\n          <typedef name=\"allocator_type\">\n            <type>Alloc</type>\n          </typedef>\n          <typedef name=\"pointer\">\n            <type>typename allocator_type::pointer</type>\n            <description>\n              <para>\n                <code>value_type*</code> if\n                <code>allocator_type::pointer</code> is not defined.\n              </para>\n            </description>\n          </typedef>\n          <typedef name=\"const_pointer\">\n            <type>typename allocator_type::const_pointer</type>\n            <description>\n              <para>\n                <code>boost::pointer_to_other&lt;pointer, value_type&gt;::type</code>\n                if <code>allocator_type::const_pointer</code> is not defined.\n              </para>\n            </description>\n          </typedef>\n          <typedef name=\"reference\">\n            <type>value_type&amp;</type>\n            <purpose><simpara>lvalue of <type>value_type</type>.</simpara></purpose>\n          </typedef>\n          <typedef name=\"const_reference\">\n            <type>value_type const&amp;</type>\n            <purpose><simpara>const lvalue of <type>value_type</type>.</simpara></purpose>\n          </typedef>\n          <typedef name=\"size_type\">\n            <type><emphasis>implementation-defined</emphasis></type>\n            <description>\n              <para>An unsigned integral type.</para>\n              <para><type>size_type</type> can represent any non-negative value of <type>difference_type</type>.</para>\n            </description>\n          </typedef>\n          <typedef name=\"difference_type\">\n            <type><emphasis>implementation-defined</emphasis></type>\n            <description>\n              <para>A signed integral type.</para>\n              <para>Is identical to the difference type of <type>iterator</type> and <type>const_iterator</type>.</para>\n            </description>\n          </typedef>\n          <typedef name=\"iterator\">\n            <type><emphasis>implementation-defined</emphasis></type>\n            <description>\n              <para><?php echo $map ? 'An' : 'A constant' ?> iterator whose value type is <type>value_type</type>. </para>\n              <para>The iterator category is at least a forward iterator.</para>\n              <para>Convertible to <type>const_iterator</type>.</para>\n            </description>\n          </typedef>\n          <typedef name=\"const_iterator\">\n            <type><emphasis>implementation-defined</emphasis></type>\n            <description>\n              <para>A constant iterator whose value type is <type>value_type</type>. </para>\n              <para>The iterator category is at least a forward iterator.</para>\n            </description>\n          </typedef>\n          <typedef name=\"local_iterator\">\n            <type><emphasis>implementation-defined</emphasis></type>\n            <description>\n              <para>An iterator with the same value type, difference type and pointer and reference type as <type>iterator</type>.</para>\n              <para>A local_iterator object can be used to iterate through a single bucket.</para>\n            </description>\n          </typedef>\n          <typedef name=\"const_local_iterator\">\n            <type><emphasis>implementation-defined</emphasis></type>\n            <description>\n              <para>A constant iterator with the same value type, difference type and pointer and reference type as <type>const_iterator</type>.</para>\n              <para>A const_local_iterator object can be used to iterate through a single bucket.</para>\n            </description>\n          </typedef>\n          <typedef name=\"node_type\">\n            <type><emphasis>implementation-defined</emphasis></type>\n            <description>\n              <para>See <classname>node_handle_<?php echo $map ? 'map' : 'set'; ?></classname> for details.</para>\n            </description>\n          </typedef>\n<?php if (!$equivalent_keys): ?>\n          <typedef name=\"insert_return_type\">\n            <type><emphasis>implementation-defined</emphasis></type>\n            <description>\n              Structure returned by inserting <code>node_type</code>.\n            </description>\n          </typedef>\n<?php endif; ?>\n          <constructor>\n            <postconditions>\n              <code><methodname>size</methodname>() == 0</code>\n            </postconditions>\n            <description>\n              <para>Constructs an empty container using hasher() as the hash function, key_equal() as the key equality predicate, allocator_type() as the allocator and a maximum load factor of 1.0.</para>\n            </description>\n            <requires>\n              <para>If the defaults are used, <code>hasher</code>, <code>key_equal</code> and\n                <code>allocator_type</code> need to be <code>DefaultConstructible</code>.\n              </para>\n            </requires>\n          </constructor>\n          <constructor specifiers=\"explicit\">\n            <parameter name=\"n\">\n              <paramtype>size_type</paramtype>\n            </parameter>\n            <parameter name=\"hf\">\n              <paramtype>hasher const&amp;</paramtype>\n              <default>hasher()</default>\n            </parameter>\n            <parameter name=\"eq\">\n              <paramtype>key_equal const&amp;</paramtype>\n              <default>key_equal()</default>\n            </parameter>\n            <parameter name=\"a\">\n              <paramtype>allocator_type const&amp;</paramtype>\n              <default>allocator_type()</default>\n            </parameter>\n            <postconditions>\n              <code><methodname>size</methodname>() == 0</code>\n            </postconditions>\n            <description>\n              <para>Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0.</para>\n            </description>\n            <requires>\n              <para>If the defaults are used, <code>hasher</code>, <code>key_equal</code> and\n                <code>allocator_type</code> need to be <code>DefaultConstructible</code>.\n              </para>\n            </requires>\n          </constructor>\n          <constructor>\n            <template>\n              <template-type-parameter name=\"InputIterator\">\n              </template-type-parameter>\n            </template>\n            <parameter name=\"f\">\n              <paramtype>InputIterator</paramtype>\n            </parameter>\n            <parameter name=\"l\">\n              <paramtype>InputIterator</paramtype>\n            </parameter>\n            <parameter name=\"n\">\n              <paramtype>size_type</paramtype>\n              <default><emphasis>implementation-defined</emphasis></default>\n            </parameter>\n            <parameter name=\"hf\">\n              <paramtype>hasher const&amp;</paramtype>\n              <default>hasher()</default>\n            </parameter>\n            <parameter name=\"eq\">\n              <paramtype>key_equal const&amp;</paramtype>\n              <default>key_equal()</default>\n            </parameter>\n            <parameter name=\"a\">\n              <paramtype>allocator_type const&amp;</paramtype>\n              <default>allocator_type()</default>\n            </parameter>\n            <description>\n              <para>Constructs an empty container with at least <code>n</code> buckets,\n              using <code>hf</code> as the hash function,\n              <code>eq</code> as the key equality predicate,\n              <code>a</code> as the allocator and a maximum load factor of 1.0\n              and inserts the elements from [f, l) into it.\n              </para>\n            </description>\n            <requires>\n              <para>If the defaults are used, <code>hasher</code>, <code>key_equal</code> and\n                <code>allocator_type</code> need to be <code>DefaultConstructible</code>.\n              </para>\n            </requires>\n          </constructor>\n          <constructor>\n            <parameter>\n              <paramtype><?php echo $name; ?> const&amp;</paramtype>\n            </parameter>\n            <description>\n              <para>The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.</para>\n              <para>If <code>Allocator::select_on_container_copy_construction</code>\n              exists and has the right signature, the allocator will be\n              constructed from its result.</para>\n            </description>\n            <requires>\n              <para><code>value_type</code> is copy constructible</para>\n            </requires>\n          </constructor>\n          <constructor>\n            <parameter>\n              <paramtype><?php echo $name; ?> &amp;&amp;</paramtype>\n            </parameter>\n            <description>\n              <para>The move constructor.</para>\n            </description>\n            <notes>\n              <para>This is implemented using Boost.Move.</para>\n            </notes>\n            <requires>\n              <para>\n                <code>value_type</code> is move constructible.\n              </para>\n              <para>\n                On compilers without rvalue reference support the\n                emulation does not support moving without calling\n                <code>boost::move</code> if <code>value_type</code> is\n                not copyable. So, for example, you can't return the\n                container from a function.\n              </para>\n            </requires>\n          </constructor>\n          <constructor specifiers=\"explicit\">\n            <parameter name=\"a\">\n              <paramtype>Allocator const&amp;</paramtype>\n            </parameter>\n            <description>\n                <para>Constructs an empty container, using allocator <code>a</code>.</para>\n            </description>\n          </constructor>\n          <constructor>\n            <parameter name=\"x\">\n              <paramtype><?php echo $name; ?> const&amp;</paramtype>\n            </parameter>\n            <parameter name=\"a\">\n              <paramtype>Allocator const&amp;</paramtype>\n            </parameter>\n            <description>\n                <para>Constructs an container, copying <code>x</code>'s contained elements, hash function, predicate, maximum load factor, but using allocator <code>a</code>.</para>\n            </description>\n          </constructor>\n          <constructor>\n            <parameter name=\"x\">\n              <paramtype><?php echo $name; ?> &amp;&amp;</paramtype>\n            </parameter>\n            <parameter name=\"a\">\n              <paramtype>Allocator const&amp;</paramtype>\n            </parameter>\n            <description>\n              <para>Construct a container moving <code>x</code>'s contained elements, and having the hash function, predicate and maximum load factor, but using allocate <code>a</code>.</para>\n            </description>\n            <notes>\n              <para>This is implemented using Boost.Move.</para>\n            </notes>\n            <requires>\n              <para>\n                <code>value_type</code> is move insertable.\n              </para>\n            </requires>\n          </constructor>\n          <constructor>\n            <parameter name=\"il\">\n              <paramtype>initializer_list&lt;value_type&gt;</paramtype>\n            </parameter>\n            <parameter name=\"n\">\n              <paramtype>size_type</paramtype>\n              <default><emphasis>implementation-defined</emphasis></default>\n            </parameter>\n            <parameter name=\"hf\">\n              <paramtype>hasher const&amp;</paramtype>\n              <default>hasher()</default>\n            </parameter>\n            <parameter name=\"eq\">\n              <paramtype>key_equal const&amp;</paramtype>\n              <default>key_equal()</default>\n            </parameter>\n            <parameter name=\"a\">\n              <paramtype>allocator_type const&amp;</paramtype>\n              <default>allocator_type()</default>\n            </parameter>\n            <description>\n              <para>Constructs an empty container with at least <code>n</code> buckets,\n                using <code>hf</code> as the hash function,\n                <code>eq</code> as the key equality predicate,\n                <code>a</code> as the allocator and a maximum load factor of 1.0\n                and inserts the elements from <code>il</code> into it.\n              </para>\n            </description>\n            <requires>\n              <para>If the defaults are used, <code>hasher</code>, <code>key_equal</code> and\n                <code>allocator_type</code> need to be <code>DefaultConstructible</code>.\n              </para>\n            </requires>\n          </constructor>\n          <constructor>\n            <parameter name=\"n\">\n              <paramtype>size_type</paramtype>\n            </parameter>\n            <parameter name=\"a\">\n              <paramtype>allocator_type const&amp;</paramtype>\n            </parameter>\n            <postconditions>\n              <code><methodname>size</methodname>() == 0</code>\n            </postconditions>\n            <description>\n              <para>Constructs an empty container with at least <code>n</code> buckets,\n              using <code>hf</code> as the hash function,\n              the default hash function and key equality predicate,\n              <code>a</code> as the allocator and a maximum load factor of 1.0.</para>\n            </description>\n            <requires>\n              <para><code>hasher</code> and <code>key_equal</code> need to be <code>DefaultConstructible</code>.\n              </para>\n            </requires>\n          </constructor>\n          <constructor>\n            <parameter name=\"n\">\n              <paramtype>size_type</paramtype>\n            </parameter>\n            <parameter name=\"hf\">\n              <paramtype>hasher const&amp;</paramtype>\n            </parameter>\n            <parameter name=\"a\">\n              <paramtype>allocator_type const&amp;</paramtype>\n            </parameter>\n            <postconditions>\n              <code><methodname>size</methodname>() == 0</code>\n            </postconditions>\n            <description>\n              <para>Constructs an empty container with at least <code>n</code> buckets,\n              using <code>hf</code> as the hash function,\n              the default key equality predicate,\n              <code>a</code> as the allocator and a maximum load factor of 1.0.</para>\n            </description>\n            <requires>\n              <para><code>key_equal</code> needs to be <code>DefaultConstructible</code>.\n              </para>\n            </requires>\n          </constructor>\n          <constructor>\n            <template>\n              <template-type-parameter name=\"InputIterator\">\n              </template-type-parameter>\n            </template>\n            <parameter name=\"f\">\n              <paramtype>InputIterator</paramtype>\n            </parameter>\n            <parameter name=\"l\">\n              <paramtype>InputIterator</paramtype>\n            </parameter>\n            <parameter name=\"n\">\n              <paramtype>size_type</paramtype>\n            </parameter>\n            <parameter name=\"a\">\n              <paramtype>allocator_type const&amp;</paramtype>\n            </parameter>\n            <description>\n              <para>Constructs an empty container with at least <code>n</code> buckets,\n              using  <code>a</code> as the allocator, with the\n              default hash function and key equality predicate\n              and a maximum load factor of 1.0\n              and inserts the elements from [f, l) into it.\n              </para>\n            </description>\n            <requires>\n              <para><code>hasher</code>, <code>key_equal</code> need to be <code>DefaultConstructible</code>.\n              </para>\n            </requires>\n          </constructor>\n          <constructor>\n            <template>\n              <template-type-parameter name=\"InputIterator\">\n              </template-type-parameter>\n            </template>\n            <parameter name=\"f\">\n              <paramtype>InputIterator</paramtype>\n            </parameter>\n            <parameter name=\"l\">\n              <paramtype>InputIterator</paramtype>\n            </parameter>\n            <parameter name=\"n\">\n              <paramtype>size_type</paramtype>\n            </parameter>\n            <parameter name=\"hf\">\n              <paramtype>hasher const&amp;</paramtype>\n            </parameter>\n            <parameter name=\"a\">\n              <paramtype>allocator_type const&amp;</paramtype>\n            </parameter>\n            <description>\n              <para>Constructs an empty container with at least <code>n</code> buckets,\n              using <code>hf</code> as the hash function,\n              <code>a</code> as the allocator, with the\n              default key equality predicate\n              and a maximum load factor of 1.0\n              and inserts the elements from [f, l) into it.\n              </para>\n            </description>\n            <requires>\n              <para><code>key_equal</code> needs to be <code>DefaultConstructible</code>.\n              </para>\n            </requires>\n          </constructor>\n          <destructor>\n            <notes>\n              <para>The destructor is applied to every element, and all memory is deallocated</para>\n            </notes>\n          </destructor>\n          <method name=\"operator=\">\n            <parameter>\n              <paramtype><?php echo $name; ?> const&amp;</paramtype>\n            </parameter>\n            <type><?php echo $name; ?>&amp;</type>\n            <description>\n              <para>The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator.</para>\n              <para>If <code>Alloc::propagate_on_container_copy_assignment</code>\n              exists and <code>Alloc::propagate_on_container_copy_assignment::value\n              </code> is true, the allocator is overwritten, if not the\n              copied elements are created using the existing\n              allocator.</para>\n            </description>\n            <requires>\n              <para><code>value_type</code> is copy constructible</para>\n            </requires>\n          </method>\n          <method name=\"operator=\">\n            <parameter>\n              <paramtype><?php echo $name; ?> &amp;&amp;</paramtype>\n            </parameter>\n            <type><?php echo $name; ?>&amp;</type>\n            <description>\n              <para>The move assignment operator.</para>\n              <para>If <code>Alloc::propagate_on_container_move_assignment</code>\n              exists and <code>Alloc::propagate_on_container_move_assignment::value\n              </code> is true, the allocator is overwritten, if not the\n              moved elements are created using the existing\n              allocator.</para>\n            </description>\n            <notes>\n              <para>\n                On compilers without rvalue references, this is emulated using\n                Boost.Move. Note that on some compilers the copy assignment\n                operator may be used in some circumstances.\n              </para>\n            </notes>\n            <requires>\n              <para>\n                <code>value_type</code> is move constructible.\n              </para>\n            </requires>\n          </method>\n          <method name=\"operator=\">\n            <parameter>\n              <paramtype>initializer_list&lt;value_type&gt;</paramtype>\n            </parameter>\n            <type><?php echo $name; ?>&amp;</type>\n            <description>\n              <para>Assign from values in initializer list. All existing elements are either overwritten by the new elements or destroyed.</para>\n            </description>\n            <requires>\n              <para>\n                <code>value_type</code> is <code>CopyInsertable</code> into the container and\n                <code>CopyAssignable</code>.\n              </para>\n            </requires>\n          </method>\n          <method name=\"get_allocator\" cv=\"const\">\n            <type>allocator_type</type>\n          </method>\n          <method-group name=\"size and capacity\">\n            <method name=\"empty\" cv=\"const\">\n              <type>bool</type>\n              <returns>\n                <code><methodname>size</methodname>() == 0</code>\n              </returns>\n            </method>\n            <method name=\"size\" cv=\"const\">\n              <type>size_type</type>\n              <returns>\n                <code>std::distance(<methodname>begin</methodname>(), <methodname>end</methodname>())</code>\n              </returns>\n            </method>\n            <method name=\"max_size\" cv=\"const\">\n              <type>size_type</type>\n              <returns><code><methodname>size</methodname>()</code> of the largest possible container.\n              </returns>\n            </method>\n          </method-group>\n          <method-group name=\"iterators\">\n            <overloaded-method name=\"begin\">\n              <signature><type>iterator</type></signature>\n              <signature cv=\"const\"><type>const_iterator</type></signature>\n              <returns>An iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container.\n              </returns>\n            </overloaded-method>\n            <overloaded-method name=\"end\">\n              <signature>\n                <type>iterator</type>\n              </signature>\n              <signature cv=\"const\">\n                <type>const_iterator</type>\n              </signature>\n              <returns>An iterator which refers to the past-the-end value for the container.\n              </returns>\n            </overloaded-method>\n            <method name=\"cbegin\" cv=\"const\">\n              <type>const_iterator</type>\n              <returns>A constant iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container.\n              </returns>\n            </method>\n            <method name=\"cend\" cv=\"const\">\n              <type>const_iterator</type>\n              <returns>A constant iterator which refers to the past-the-end value for the container.\n              </returns>\n            </method>\n          </method-group>\n          <method-group name=\"modifiers\">\n            <method name=\"emplace\">\n              <template>\n                <template-type-parameter name=\"Args\" pack=\"1\">\n                </template-type-parameter>\n              </template>\n              <parameter name=\"args\" pack=\"1\">\n                <paramtype>Args&amp;&amp;</paramtype>\n              </parameter>\n              <type><?php echo $equivalent_keys ? 'iterator' : 'std::pair&lt;iterator, bool&gt;' ?></type>\n              <description>\n                <para>Inserts an object, constructed with the arguments <code>args</code>, in the container<?php\n                echo $equivalent_keys ? '.' :\n                    ' if and only if there is no element in the container with an equivalent '.$key_name. '.';\n                ?></para>\n              </description>\n              <requires>\n                <para><code>value_type</code> is <code>EmplaceConstructible</code> into\n                  <code>X</code> from <code>args</code>.\n                </para>\n              </requires>\n              <returns>\n<?php if ($equivalent_keys): ?>\n                <para>An iterator pointing to the inserted element.</para>\n<?php else: ?>\n                <para>The bool component of the return type is true if an insert took place.</para>\n                <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent <?php echo $key_name; ?>.</para>\n<?php endif; ?>\n              </returns>\n              <throws>\n                <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>\n              </throws>\n              <notes>\n                <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>\n                <para>Pointers and references to elements are never invalidated.</para>\n                <para>If the compiler doesn't support variadic template arguments or rvalue\n                      references, this is emulated for up to 10 arguments, with no support\n                      for rvalue references or move semantics.</para>\n                <para>Since existing <code>std::pair</code> implementations don't support\n                      <code>std::piecewise_construct</code> this emulates it,\n                      but using <code>boost::unordered::piecewise_construct</code>.</para>\n              </notes>\n            </method>\n            <method name=\"emplace_hint\">\n              <template>\n                <template-type-parameter name=\"Args\" pack=\"1\">\n                </template-type-parameter>\n              </template>\n              <parameter name=\"hint\">\n                <paramtype>const_iterator</paramtype>\n              </parameter>\n              <parameter name=\"args\" pack=\"1\">\n                <paramtype>Args&amp;&amp;</paramtype>\n              </parameter>\n              <type>iterator</type>\n              <description>\n                <para>Inserts an object, constructed with the arguments <code>args</code>, in the container<?php\n                echo $equivalent_keys ? '.' :\n                    ' if and only if there is no element in the container with an equivalent '.$key_name. '.';\n                ?></para>\n                <para><code>hint</code> is a suggestion to where the element should be inserted.</para>\n              </description>\n              <requires>\n                <para><code>value_type</code> is <code>EmplaceConstructible</code> into\n                  <code>X</code> from <code>args</code>.\n                </para>\n              </requires>\n              <returns>\n<?php if ($equivalent_keys): ?>\n                <para>An iterator pointing to the inserted element.</para>\n<?php else: ?>\n                <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent <?php echo $key_name; ?>.</para>\n<?php endif; ?>\n              </returns>\n              <throws>\n                <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>\n              </throws>\n              <notes>\n                <para>The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same <?php echo $key_name; ?>. </para>\n                <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>\n                <para>Pointers and references to elements are never invalidated.</para>\n                <para>If the compiler doesn't support variadic template arguments or rvalue\n                      references, this is emulated for up to 10 arguments, with no support\n                      for rvalue references or move semantics.</para>\n                <para>Since existing <code>std::pair</code> implementations don't support\n                      <code>std::piecewise_construct</code> this emulates it,\n                      but using <code>boost::unordered::piecewise_construct</code>.</para>\n              </notes>\n            </method>\n            <method name=\"insert\">\n              <parameter name=\"obj\">\n                <paramtype>value_type const&amp;</paramtype>\n              </parameter>\n              <type><?php echo $equivalent_keys ? 'iterator' : 'std::pair&lt;iterator, bool&gt;' ?></type>\n              <description>\n                <para>Inserts <code>obj</code> in the container<?php\n                echo $equivalent_keys ? '.' :\n                    ' if and only if there is no element in the container with an equivalent '.$key_name. '.';\n                ?></para>\n              </description>\n              <requires>\n                <para><code>value_type</code> is <code>CopyInsertable</code>.</para>\n              </requires>\n              <returns>\n<?php if ($equivalent_keys): ?>\n                <para>An iterator pointing to the inserted element.</para>\n<?php else: ?>\n                <para>The bool component of the return type is true if an insert took place.</para>\n                <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent <?php echo $key_name; ?>.</para>\n<?php endif; ?>\n              </returns>\n              <throws>\n                <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>\n              </throws>\n              <notes>\n                <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>\n                <para>Pointers and references to elements are never invalidated.</para>\n              </notes>\n            </method>\n            <method name=\"insert\">\n              <parameter name=\"obj\">\n                <paramtype>value_type&amp;&amp;</paramtype>\n              </parameter>\n              <type><?php echo $equivalent_keys ? 'iterator' : 'std::pair&lt;iterator, bool&gt;' ?></type>\n              <description>\n                <para>Inserts <code>obj</code> in the container<?php\n                echo $equivalent_keys ? '.' :\n                    ' if and only if there is no element in the container with an equivalent '.$key_name. '.';\n                ?></para>\n              </description>\n              <requires>\n                <para><code>value_type</code> is <code>MoveInsertable</code>.</para>\n              </requires>\n              <returns>\n<?php if ($equivalent_keys): ?>\n                <para>An iterator pointing to the inserted element.</para>\n<?php else: ?>\n                <para>The bool component of the return type is true if an insert took place.</para>\n                <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent <?php echo $key_name; ?>.</para>\n<?php endif; ?>\n              </returns>\n              <throws>\n                <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>\n              </throws>\n              <notes>\n                <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>\n                <para>Pointers and references to elements are never invalidated.</para>\n              </notes>\n            </method>\n            <method name=\"insert\">\n              <parameter name=\"hint\">\n                <paramtype>const_iterator</paramtype>\n              </parameter>\n              <parameter name=\"obj\">\n                <paramtype>value_type const&amp;</paramtype>\n              </parameter>\n              <type>iterator</type>\n              <description>\n<?php if ($equivalent_keys): ?>\n                <para>Inserts <code>obj</code> in the container.</para>\n<?php else: ?>\n                <para>Inserts <code>obj</code> in the container if and only if there is no element in the container with an equivalent <?php echo $key_name; ?>.</para>\n<?php endif; ?>\n                <para>hint is a suggestion to where the element should be inserted.</para>\n              </description>\n              <requires>\n                <para><code>value_type</code> is <code>CopyInsertable</code>.</para>\n              </requires>\n              <returns>\n<?php if ($equivalent_keys): ?>\n                <para>An iterator pointing to the inserted element.</para>\n<?php else: ?>\n                <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent <?php echo $key_name; ?>.</para>\n<?php endif; ?>\n              </returns>\n              <throws>\n                <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>\n              </throws>\n              <notes>\n                <para>The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same <?php echo $key_name; ?>. </para>\n                <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>\n                <para>Pointers and references to elements are never invalidated.</para>\n              </notes>\n            </method>\n            <method name=\"insert\">\n              <parameter name=\"hint\">\n                <paramtype>const_iterator</paramtype>\n              </parameter>\n              <parameter name=\"obj\">\n                <paramtype>value_type&amp;&amp;</paramtype>\n              </parameter>\n              <type>iterator</type>\n              <description>\n<?php if ($equivalent_keys): ?>\n                <para>Inserts <code>obj</code> in the container.</para>\n<?php else: ?>\n                <para>Inserts <code>obj</code> in the container if and only if there is no element in the container with an equivalent <?php echo $key_name; ?>.</para>\n<?php endif; ?>\n                <para>hint is a suggestion to where the element should be inserted.</para>\n              </description>\n              <requires>\n                <para><code>value_type</code> is <code>MoveInsertable</code>.</para>\n              </requires>\n              <returns>\n<?php if ($equivalent_keys): ?>\n                <para>An iterator pointing to the inserted element.</para>\n<?php else: ?>\n                <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent <?php echo $key_name; ?>.</para>\n<?php endif; ?>\n              </returns>\n              <throws>\n                <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>\n              </throws>\n              <notes>\n                <para>The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same <?php echo $key_name; ?>. </para>\n                <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>\n                <para>Pointers and references to elements are never invalidated.</para>\n              </notes>\n            </method>\n            <method name=\"insert\">\n              <template>\n                <template-type-parameter name=\"InputIterator\">\n                </template-type-parameter>\n              </template>\n              <parameter name=\"first\">\n                <paramtype>InputIterator</paramtype>\n              </parameter>\n              <parameter name=\"last\">\n                <paramtype>InputIterator</paramtype>\n              </parameter>\n              <type>void</type>\n              <description>\n                <para>Inserts a range of elements into the container.\n<?php if (!$equivalent_keys): ?>\n                Elements are inserted if and only if there is no element in the container with an equivalent <?php echo $key_name; ?>.\n<?php endif; ?>\n                </para>\n              </description>\n              <requires>\n                <para><code>value_type</code> is <code>EmplaceConstructible</code> into\n                  <code>X</code> from <code>*first</code>.</para>\n              </requires>\n              <throws>\n                <para>When inserting a single element, if an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>\n              </throws>\n              <notes>\n                <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>\n                <para>Pointers and references to elements are never invalidated.</para>\n              </notes>\n            </method>\n            <method name=\"insert\">\n              <parameter name=\"il\">\n                <paramtype>initializer_list&lt;value_type&gt;</paramtype>\n              </parameter>\n              <type>void</type>\n              <description>\n                <para>Inserts a range of elements into the container.\n                <?php if (!$equivalent_keys): ?>\n                Elements are inserted if and only if there is no element in the container with an equivalent <?php echo $key_name; ?>.\n                <?php endif; ?>\n                </para>\n              </description>\n              <requires>\n                <para><code>value_type</code> is <code>EmplaceConstructible</code> into\n                  <code>X</code> from <code>*first</code>.</para>\n              </requires>\n              <throws>\n                <para>When inserting a single element, if an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>\n              </throws>\n              <notes>\n                <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>\n                <para>Pointers and references to elements are never invalidated.</para>\n              </notes>\n            </method>\n            <method name=\"insert\">\n              <parameter name=\"il\">\n                <paramtype>initializer_list&lt;value_type&gt;</paramtype>\n              </parameter>\n              <type>void</type>\n              <description>\n                <para>Inserts a range of elements into the container. Elements are inserted if and only if there is no element in the container with an equivalent <?php echo $key_name; ?>.</para>\n              </description>\n              <requires>\n                <para><code>value_type</code> is <code>EmplaceConstructible</code> into\n                  <code>X</code> from <code>*first</code>.</para>\n              </requires>\n              <throws>\n                <para>When inserting a single element, if an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>\n              </throws>\n              <notes>\n                <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>\n                <para>Pointers and references to elements are never invalidated.</para>\n              </notes>\n            </method>\n            <method name=\"extract\">\n              <parameter name=\"position\">\n                <paramtype>const_iterator</paramtype>\n              </parameter>\n              <type>node_type</type>\n              <description>\n                <para>Removes the element pointed to by <code>position</code>.</para>\n              </description>\n              <returns>\n                <para>A <code>node_type</code> owning the element.</para>\n              </returns>\n              <notes>\n                <para>\n                  In C++17 a node extracted using this method can be inserted into a compatible <code><?php echo $node_partner; ?></code>,\n                  but that is not supported yet.\n                </para>\n              </notes>\n            </method>\n            <method name=\"extract\">\n              <parameter name=\"k\">\n                <paramtype>key_type const&amp;</paramtype>\n              </parameter>\n              <type>node_type</type>\n              <description>\n                <para>Removes an element with key equivalent to <code>k</code>.</para>\n              </description>\n              <returns>\n                <para>A <code>node_type</code> owning the element if found, otherwise an empty <code>node_type</code>.</para>\n              </returns>\n              <throws>\n                <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para>\n              </throws>\n              <notes>\n                <para>\n                  In C++17 a node extracted using this method can be inserted into a compatible <code><?php echo $node_partner; ?></code>,\n                  but that is not supported yet.\n                </para>\n              </notes>\n            </method>\n            <method name=\"insert\">\n              <parameter name=\"nh\">\n                <paramtype>node_type&amp;&amp;</paramtype>\n              </parameter>\n              <type><?php echo $equivalent_keys ? 'iterator' : 'insert_return_type' ?></type>\n              <description>\n                <para>If <code>nh</code> is empty, has no affect.</para>\n<?php if ($equivalent_keys): ?>\n                <para>Otherwise inserts the element owned by <code>nh</code></para>\n<?php else: ?>\n                <para>Otherwise inserts the element owned by <code>nh</code>\n                      if and only if there is no element in the container with an equivalent <?php echo $key_name; ?>.\n                </para>\n<?php endif ?>\n              </description>\n              <requires>\n                <para><code>nh</code> is empty or <code>nh.get_allocator()</code> is equal to the container's allocator.</para>\n              </requires>\n              <returns>\n<?php if ($equivalent_keys): ?>\n                <para>If <code>nh</code> was empty, returns <code>end()</code>.</para>\n                <para>Otherwise returns an iterator pointing to the newly inserted element.</para>\n<?php else: ?>\n                <para>If <code>nh</code> was empty, returns an <code>insert_return_type</code> with:\n                      <code>inserted</code> equal to <code>false</code>,\n                      <code>position</code> equal to <code>end()</code> and\n                      <code>node</code> empty.</para>\n                <para>Otherwise if there was already an element with an equivalent key, returns an <code>insert_return_type</code> with:\n                      <code>inserted</code> equal to <code>false</code>,\n                      <code>position</code> pointing to a matching element and\n                      <code>node</code> contains the node from <code>nh</code>.</para>\n                <para>Otherwise if the insertion succeeded, returns an <code>insert_return_type</code> with:\n                      <code>inserted</code> equal to <code>true</code>,\n                      <code>position</code> pointing to the newly inserted element and\n                      <code>node</code> empty.</para>\n<?php endif; ?>\n              </returns>\n              <throws>\n                <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>\n              </throws>\n              <notes>\n                <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>\n                <para>Pointers and references to elements are never invalidated.</para>\n                <para>In C++17 this can be used to insert a node extracted from a compatible <code><?php echo $node_partner; ?></code>,\n                    but that is not supported yet.</para>\n              </notes>\n            </method>\n            <method name=\"insert\">\n              <parameter name=\"hint\">\n                <paramtype>const_iterator</paramtype>\n              </parameter>\n              <parameter name=\"nh\">\n                <paramtype>node_type&amp;&amp;</paramtype>\n              </parameter>\n              <type>iterator</type>\n              <description>\n                <para>If <code>nh</code> is empty, has no affect.</para>\n<?php if ($equivalent_keys): ?>\n                <para>Otherwise inserts the element owned by <code>nh</code></para>\n<?php else: ?>\n                <para>Otherwise inserts the element owned by <code>nh</code>\n                      if and only if there is no element in the container with an equivalent <?php echo $key_name; ?>.\n                </para>\n                <para>If there is already an element in the container with an equivalent <?php echo $key_name; ?>\n                      has no effect on <code>nh</code> (i.e. <code>nh</code> still contains the node.)</para>\n<?php endif ?>\n                <para>hint is a suggestion to where the element should be inserted.</para>\n              </description>\n              <requires>\n                <para><code>nh</code> is empty or <code>nh.get_allocator()</code> is equal to the container's allocator.</para>\n              </requires>\n              <returns>\n<?php if ($equivalent_keys): ?>\n                <para>If <code>nh</code> was empty, returns <code>end()</code>.</para>\n                <para>Otherwise returns an iterator pointing to the newly inserted element.</para>\n<?php else: ?>\n                <para>If <code>nh</code> was empty returns <code>end()</code>.</para>\n                <para>If there was already an element in the container with an equivalent <?php echo $key_name; ?>\n                      returns an iterator pointing to that.</para>\n                <para>Otherwise returns an iterator pointing to the newly inserted element.</para>\n<?php endif; ?>\n              </returns>\n              <throws>\n                <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>\n              </throws>\n              <notes>\n                <para>The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same <?php echo $key_name; ?>. </para>\n                <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>\n                <para>Pointers and references to elements are never invalidated.</para>\n                <para>In C++17 this can be used to insert a node extracted from a compatible <code><?php echo $node_partner; ?></code>,\n                    but that is not supported yet.</para>\n              </notes>\n            </method>\n            <method name=\"erase\">\n              <parameter name=\"position\">\n                <paramtype>const_iterator</paramtype>\n              </parameter>\n              <type>iterator</type>\n              <description>\n                <para>Erase the element pointed to by <code>position</code>.</para>\n              </description>\n              <returns>\n                <para>The iterator following <code>position</code> before the erasure.</para>\n              </returns>\n              <throws>\n                <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para>\n              </throws>\n              <notes>\n                <para>\n                  In older versions this could be inefficient because it had to search\n                  through several buckets to find the position of the returned iterator.\n                  The data structure has been changed so that this is no longer the case,\n                  and the alternative erase methods have been deprecated.\n                </para>\n              </notes>\n            </method>\n            <method name=\"erase\">\n              <parameter name=\"k\">\n                <paramtype>key_type const&amp;</paramtype>\n              </parameter>\n              <type>size_type</type>\n              <description>\n                <para>Erase all elements with key equivalent to <code>k</code>.</para>\n              </description>\n              <returns>\n                <para>The number of elements erased.</para>\n              </returns>\n              <throws>\n                <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para>\n              </throws>\n            </method>\n            <method name=\"erase\">\n              <parameter name=\"first\">\n                <paramtype>const_iterator</paramtype>\n              </parameter>\n              <parameter name=\"last\">\n                <paramtype>const_iterator</paramtype>\n              </parameter>\n              <type>iterator</type>\n              <description>\n                <para>Erases the elements in the range from <code>first</code> to <code>last</code>.</para>\n              </description>\n              <returns>\n                <para>The iterator following the erased elements - i.e. <code>last</code>.</para>\n              </returns>\n              <throws>\n                <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para>\n                <para>In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.</para>\n              </throws>\n            </method>\n            <method name=\"quick_erase\">\n              <parameter name=\"position\">\n                <paramtype>const_iterator</paramtype>\n              </parameter>\n              <type>void</type>\n              <description>\n                <para>Erase the element pointed to by <code>position</code>.</para>\n              </description>\n              <throws>\n                <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para>\n                <para>In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.</para>\n              </throws>\n              <notes>\n                <para>\n                  This method was implemented because returning an iterator to\n                  the next element from <code>erase</code> was expensive, but\n                  the container has been redesigned so that is no longer the\n                  case. So this method is now deprecated.\n                </para>\n              </notes>\n            </method>\n            <method name=\"erase_return_void\">\n              <parameter name=\"position\">\n                <paramtype>const_iterator</paramtype>\n              </parameter>\n              <type>void</type>\n              <description>\n                <para>Erase the element pointed to by <code>position</code>.</para>\n              </description>\n              <throws>\n                <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para>\n                <para>In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.</para>\n              </throws>\n              <notes>\n                <para>\n                  This method was implemented because returning an iterator to\n                  the next element from <code>erase</code> was expensive, but\n                  the container has been redesigned so that is no longer the\n                  case. So this method is now deprecated.\n                </para>\n              </notes>\n            </method>\n            <method name=\"clear\">\n              <type>void</type>\n              <description>\n                <para>Erases all elements in the container.</para>\n              </description>\n              <postconditions>\n                <para><code><methodname>size</methodname>() == 0</code></para>\n              </postconditions>\n              <throws>\n                <para>Never throws an exception.</para>\n              </throws>\n            </method>\n            <method name=\"swap\">\n              <parameter>\n                <paramtype><?php echo $name; ?>&amp;</paramtype>\n              </parameter>\n              <type>void</type>\n              <description>\n                <para>Swaps the contents of the container with the parameter.</para>\n                <para>If <code>Allocator::propagate_on_container_swap</code> is declared and\n                  <code>Allocator::propagate_on_container_swap::value</code> is true then the\n                  containers' allocators are swapped. Otherwise, swapping with unequal allocators\n                  results in undefined behavior.</para>\n              </description>\n              <throws>\n                <para>Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of <code>key_equal</code> or <code>hasher</code>.</para>\n              </throws>\n              <notes>\n                <para>The exception specifications aren't quite the same as the C++11 standard, as\n                  the equality predieate and hash function are swapped using their copy constructors.</para>\n              </notes>\n            </method>\n            <method name=\"merge\">\n              <template>\n                <template-type-parameter name=\"H2\">\n                </template-type-parameter>\n                <template-type-parameter name=\"P2\">\n                </template-type-parameter>\n              </template>\n              <parameter name=\"source\">\n<?php if ($map): ?>\n                <paramtype><?php echo $name; ?>&lt;Key, Mapped, H2, P2, Alloc&gt;&amp;</paramtype>\n<?php else: ?>\n                <paramtype><?php echo $name; ?>&lt;Value, H2, P2, Alloc&gt;&amp;</paramtype>\n<?php endif; ?>\n              </parameter>\n              <notes>\n                <para>Does not support merging with a compatible <code><?php echo $node_partner; ?></code> yet.</para>\n              </notes>\n            </method>\n            <method name=\"merge\">\n              <template>\n                <template-type-parameter name=\"H2\">\n                </template-type-parameter>\n                <template-type-parameter name=\"P2\">\n                </template-type-parameter>\n              </template>\n              <parameter name=\"source\">\n<?php if ($map): ?>\n                <paramtype><?php echo $name; ?>&lt;Key, Mapped, H2, P2, Alloc&gt;&amp;&amp;</paramtype>\n<?php else: ?>\n                <paramtype><?php echo $name; ?>&lt;Value, H2, P2, Alloc&gt;&amp;&amp;</paramtype>\n<?php endif; ?>\n              </parameter>\n              <notes>\n                <para>Does not support merging with a compatible <code><?php echo $node_partner; ?></code> yet.</para>\n              </notes>\n            </method>\n<?php /*\n            <method name=\"merge\">\n              <template>\n                <template-type-parameter name=\"H2\">\n                </template-type-parameter>\n                <template-type-parameter name=\"P2\">\n                </template-type-parameter>\n              </template>\n              <parameter name=\"source\">\n<?php if ($map): ?>\n                <paramtype><?php echo $node_partner; ?>&lt;Key, Mapped, H2, P2, Alloc&gt;&amp;</paramtype>\n<?php else: ?>\n                <paramtype><?php echo $node_partner; ?>&lt;Value, H2, P2, Alloc&gt;&amp;</paramtype>\n<?php endif; ?>\n              </parameter>\n            </method>\n            <method name=\"merge\">\n              <template>\n                <template-type-parameter name=\"H2\">\n                </template-type-parameter>\n                <template-type-parameter name=\"P2\">\n                </template-type-parameter>\n              </template>\n              <parameter name=\"source\">\n<?php if ($map): ?>\n                <paramtype><?php echo $node_partner; ?>&lt;Key, Mapped, H2, P2, Alloc&gt;&amp;&amp;</paramtype>\n<?php else: ?>\n                <paramtype><?php echo $node_partner; ?>&lt;Value, H2, P2, Alloc&gt;&amp;&amp;</paramtype>\n<?php endif; ?>\n              </parameter>\n            </method>\n*/ ?>\n          </method-group>\n          <method-group name=\"observers\">\n            <method name=\"hash_function\" cv=\"const\">\n              <type>hasher</type>\n              <returns>The container's hash function.\n              </returns>\n            </method>\n            <method name=\"key_eq\" cv=\"const\">\n              <type>key_equal</type>\n              <returns>The container's key equality predicate.\n              </returns>\n            </method>\n          </method-group>\n          <method-group name=\"lookup\">\n            <overloaded-method name=\"find\">\n              <signature>\n                <parameter name=\"k\">\n                  <paramtype>key_type const&amp;</paramtype>\n                </parameter>\n                <type>iterator</type>\n              </signature>\n              <signature cv=\"const\">\n                <parameter name=\"k\">\n                  <paramtype>key_type const&amp;</paramtype>\n                </parameter>\n                <type>const_iterator</type>\n              </signature>\n              <signature>\n                <template>\n                  <template-type-parameter name=\"CompatibleKey\"/>\n                  <template-type-parameter name=\"CompatibleHash\"/>\n                  <template-type-parameter name=\"CompatiblePredicate\"/>\n                </template>\n                <parameter name=\"k\">\n                  <paramtype>CompatibleKey const&amp;</paramtype>\n                </parameter>\n                <parameter name=\"hash\">\n                  <paramtype>CompatibleHash const&amp;</paramtype>\n                </parameter>\n                <parameter name=\"eq\">\n                  <paramtype>CompatiblePredicate const&amp;</paramtype>\n                </parameter>\n                <type>iterator</type>\n              </signature>\n              <signature cv=\"const\">\n                <template>\n                  <template-type-parameter name=\"CompatibleKey\"/>\n                  <template-type-parameter name=\"CompatibleHash\"/>\n                  <template-type-parameter name=\"CompatiblePredicate\"/>\n                </template>\n                <parameter name=\"k\">\n                  <paramtype>CompatibleKey const&amp;</paramtype>\n                </parameter>\n                <parameter name=\"hash\">\n                  <paramtype>CompatibleHash const&amp;</paramtype>\n                </parameter>\n                <parameter name=\"eq\">\n                  <paramtype>CompatiblePredicate const&amp;</paramtype>\n                </parameter>\n                <type>const_iterator</type>\n              </signature>\n              <returns>\n                <para>An iterator pointing to an element with key equivalent to <code>k</code>, or <code>b.end()</code> if no such element exists.</para>\n              </returns>\n              <notes><para>\n                The templated overloads are a non-standard extensions which\n                allows you to use a compatible hash function and equality\n                predicate for a key of a different type in order to avoid\n                an expensive type cast. In general, its use is not encouraged.\n              </para></notes>\n            </overloaded-method>\n            <method name=\"count\" cv=\"const\">\n              <parameter name=\"k\">\n                <paramtype>key_type const&amp;</paramtype>\n              </parameter>\n              <type>size_type</type>\n              <returns>\n                <para>The number of elements with key equivalent to <code>k</code>.</para>\n              </returns>\n            </method>\n            <overloaded-method name=\"equal_range\">\n              <signature>\n                <parameter name=\"k\">\n                  <paramtype>key_type const&amp;</paramtype>\n                </parameter>\n                <type>std::pair&lt;iterator, iterator&gt;</type>\n              </signature>\n              <signature cv=\"const\">\n                <parameter name=\"k\">\n                  <paramtype>key_type const&amp;</paramtype>\n                </parameter>\n                <type>std::pair&lt;const_iterator, const_iterator&gt;</type>\n              </signature>\n              <returns>\n                <para>A range containing all elements with key equivalent to <code>k</code>.\n                  If the container doesn't container any such elements, returns\n                  <code><functionname>std::make_pair</functionname>(<methodname>b.end</methodname>(),<methodname>b.end</methodname>())</code>.\n                  </para>\n              </returns>\n            </overloaded-method>\n<?php if ($map && !$equivalent_keys): ?>\n            <method name=\"operator[]\">\n              <parameter name=\"k\">\n                <paramtype>key_type const&amp;</paramtype>\n              </parameter>\n              <type>mapped_type&amp;</type>\n              <effects>\n                <para>If the container does not already contain an elements with a key equivalent to <code>k</code>, inserts the value <code>std::pair&lt;key_type const, mapped_type&gt;(k, mapped_type())</code></para>\n              </effects>\n              <returns>\n                <para>A reference to <code>x.second</code> where x is the element already in the container, or the newly inserted element with a key equivalent to <code>k</code></para>\n              </returns>\n              <throws>\n                <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>\n              </throws>\n              <notes>\n                <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>\n                <para>Pointers and references to elements are never invalidated.</para>\n              </notes>\n            </method>\n            <overloaded-method name=\"at\">\n              <signature><type>Mapped&amp;</type>\n                <parameter name=\"k\"><paramtype>key_type const&amp;</paramtype></parameter></signature>\n              <signature cv=\"const\"><type>Mapped const&amp;</type>\n                <parameter name=\"k\"><paramtype>key_type const&amp;</paramtype></parameter></signature>\n              <returns>\n                <para>A reference to <code>x.second</code> where <code>x</code> is the (unique) element whose key is equivalent to <code>k</code>.</para>\n              </returns>\n              <throws>\n                <para>An exception object of type <code>std::out_of_range</code> if no such element is present.</para>\n              </throws>\n            </overloaded-method>\n<?php endif; ?>\n          </method-group>\n          <method-group name=\"bucket interface\">\n            <method name=\"bucket_count\" cv=\"const\">\n              <type>size_type</type>\n              <returns>\n                <para>The number of buckets.</para>\n              </returns>\n            </method>\n            <method name=\"max_bucket_count\" cv=\"const\">\n              <type>size_type</type>\n              <returns>\n                <para>An upper bound on the number of buckets.</para>\n              </returns>\n            </method>\n            <method name=\"bucket_size\" cv=\"const\">\n              <parameter name=\"n\">\n                <paramtype>size_type</paramtype>\n              </parameter>\n              <type>size_type</type>\n              <requires>\n                <para><code>n &lt; <methodname>bucket_count</methodname>()</code></para>\n              </requires>\n              <returns>\n                <para>The number of elements in bucket <code>n</code>.</para>\n              </returns>\n            </method>\n            <method name=\"bucket\" cv=\"const\">\n              <parameter name=\"k\">\n                <paramtype>key_type const&amp;</paramtype>\n              </parameter>\n              <type>size_type</type>\n              <returns>\n                <para>The index of the bucket which would contain an element with key <code>k</code>.</para>\n              </returns>\n              <postconditions>\n                <para>The return value is less than <code>bucket_count()</code></para>\n              </postconditions>\n            </method>\n            <overloaded-method name=\"begin\">\n              <signature>\n                <parameter name=\"n\">\n                  <paramtype>size_type</paramtype>\n                </parameter>\n                <type>local_iterator</type>\n              </signature>\n              <signature cv=\"const\">\n                <parameter name=\"n\">\n                  <paramtype>size_type</paramtype>\n                </parameter>\n                <type>const_local_iterator</type>\n              </signature>\n              <requires>\n                <para><code>n</code> shall be in the range <code>[0, bucket_count())</code>.</para>\n              </requires>\n              <returns>\n                <para>A local iterator pointing the first element in the bucket with index <code>n</code>.</para>\n              </returns>\n            </overloaded-method>\n            <overloaded-method name=\"end\">\n              <signature>\n                <parameter name=\"n\">\n                  <paramtype>size_type</paramtype>\n                </parameter>\n                <type>local_iterator</type>\n              </signature>\n              <signature cv=\"const\">\n                <parameter name=\"n\">\n                  <paramtype>size_type</paramtype>\n                </parameter>\n                <type>const_local_iterator</type>\n              </signature>\n              <requires>\n                <para><code>n</code> shall be in the range <code>[0, bucket_count())</code>.</para>\n              </requires>\n              <returns>\n                <para>A local iterator pointing the 'one past the end' element in the bucket with index <code>n</code>.</para>\n              </returns>\n            </overloaded-method>\n            <method name=\"cbegin\" cv=\"const\">\n              <parameter name=\"n\">\n                <paramtype>size_type</paramtype>\n              </parameter>\n              <type>const_local_iterator</type>\n              <requires>\n                <para><code>n</code> shall be in the range <code>[0, bucket_count())</code>.</para>\n              </requires>\n              <returns>\n                <para>A constant local iterator pointing the first element in the bucket with index <code>n</code>.</para>\n              </returns>\n            </method>\n            <method name=\"cend\">\n              <parameter name=\"n\">\n                <paramtype>size_type</paramtype>\n              </parameter>\n              <type>const_local_iterator</type>\n              <requires>\n                <para><code>n</code> shall be in the range <code>[0, bucket_count())</code>.</para>\n              </requires>\n              <returns>\n                <para>A constant local iterator pointing the 'one past the end' element in the bucket with index <code>n</code>.</para>\n              </returns>\n            </method>\n          </method-group>\n          <method-group name=\"hash policy\">\n            <method name=\"load_factor\" cv=\"const\">\n              <type>float</type>\n              <returns>\n                <para>The average number of elements per bucket.</para>\n              </returns>\n            </method>\n            <method name=\"max_load_factor\" cv=\"const\">\n              <type>float</type>\n              <returns>\n                <para>Returns the current maximum load factor.</para>\n              </returns>\n            </method>\n            <method name=\"max_load_factor\">\n              <parameter name=\"z\">\n                <paramtype>float</paramtype>\n              </parameter>\n              <type>void</type>\n              <effects>\n                <para>Changes the container's maximum load factor, using <code>z</code> as a hint.</para>\n              </effects>\n            </method>\n            <method name=\"rehash\">\n              <parameter name=\"n\">\n                <paramtype>size_type</paramtype>\n              </parameter>\n              <type>void</type>\n              <description>\n                <para>Changes the number of buckets so that there at least <code>n</code> buckets, and so that the load factor is less than the maximum load factor.</para>\n                <para>Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.</para>\n              </description>\n              <throws>\n                <para>The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function.</para>\n              </throws>\n            </method>\n            <method name=\"reserve\">\n              <parameter name=\"n\">\n                <paramtype>size_type</paramtype>\n              </parameter>\n              <type>void</type>\n              <description>\n                <para>Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.</para>\n              </description>\n              <throws>\n                <para>The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function.</para>\n              </throws>\n            </method>\n          </method-group>\n          <free-function-group name=\"Equality Comparisons\">\n            <function name=\"operator==\">\n              <template>\n<?php echo $template_value; ?>\n                <template-type-parameter name=\"Hash\">\n                </template-type-parameter>\n                <template-type-parameter name=\"Pred\">\n                </template-type-parameter>\n                <template-type-parameter name=\"Alloc\">\n                </template-type-parameter>\n              </template>\n              <parameter name=\"x\">\n                <paramtype><?php echo $full_type; ?> const&amp;</paramtype>\n              </parameter>\n              <parameter name=\"y\">\n                <paramtype><?php echo $full_type; ?> const&amp;</paramtype>\n              </parameter>\n              <type>bool</type>\n              <description>\n<?php if($equivalent_keys): ?>\n                <para>Return <code>true</code> if <code>x.size() ==\n                y.size</code> and for every equivalent key group in\n                <code>x</code>, there is a group in <code>y</code>\n                for the same key, which is a permutation (using\n                <code>operator==</code> to compare the value types).\n                </para>\n<?php else: ?>\n                <para>Return <code>true</code> if <code>x.size() ==\n                y.size</code> and for every element in <code>x</code>,\n                there is an element in <code>y</code> with the same\n                for the same key, with an equal value (using\n                <code>operator==</code> to compare the value types).\n                </para>\n<?php endif; ?>\n              </description>\n              <notes>\n                <para>The behavior of this function was changed to match\n                  the C++11 standard in Boost 1.48.</para>\n                <para>Behavior is undefined if the two containers don't have\n                    equivalent equality predicates.</para>\n              </notes>\n            </function>\n            <function name=\"operator!=\">\n              <template>\n<?php echo $template_value; ?>\n                <template-type-parameter name=\"Hash\">\n                </template-type-parameter>\n                <template-type-parameter name=\"Pred\">\n                </template-type-parameter>\n                <template-type-parameter name=\"Alloc\">\n                </template-type-parameter>\n              </template>\n              <parameter name=\"x\">\n                <paramtype><?php echo $full_type; ?> const&amp;</paramtype>\n              </parameter>\n              <parameter name=\"y\">\n                <paramtype><?php echo $full_type; ?> const&amp;</paramtype>\n              </parameter>\n              <type>bool</type>\n              <description>\n<?php if($equivalent_keys): ?>\n                <para>Return <code>false</code> if <code>x.size() ==\n                y.size</code> and for every equivalent key group in\n                <code>x</code>, there is a group in <code>y</code>\n                for the same key, which is a permutation (using\n                <code>operator==</code> to compare the value types).\n                </para>\n<?php else: ?>\n                <para>Return <code>false</code> if <code>x.size() ==\n                y.size</code> and for every element in <code>x</code>,\n                there is an element in <code>y</code> with the same\n                for the same key, with an equal value (using\n                <code>operator==</code> to compare the value types).\n                </para>\n<?php endif; ?>\n              </description>\n              <notes>\n                <para>The behavior of this function was changed to match\n                  the C++11 standard in Boost 1.48.</para>\n                <para>Behavior is undefined if the two containers don't have\n                    equivalent equality predicates.</para>\n              </notes>\n            </function>\n          </free-function-group>\n          <free-function-group name=\"swap\">\n            <function name=\"swap\">\n              <template>\n<?php echo $template_value; ?>\n                <template-type-parameter name=\"Hash\">\n                </template-type-parameter>\n                <template-type-parameter name=\"Pred\">\n                </template-type-parameter>\n                <template-type-parameter name=\"Alloc\">\n                </template-type-parameter>\n              </template>\n              <parameter name=\"x\">\n                <paramtype><?php echo $full_type; ?>&amp;</paramtype>\n              </parameter>\n              <parameter name=\"y\">\n                <paramtype><?php echo $full_type; ?>&amp;</paramtype>\n              </parameter>\n              <type>void</type>\n              <effects>\n                <para><code>x.swap(y)</code></para>\n              </effects>\n              <description>\n                <para>Swaps the contents of <code>x</code> and <code>y</code>.</para>\n                <para>If <code>Allocator::propagate_on_container_swap</code> is declared and\n                  <code>Allocator::propagate_on_container_swap::value</code> is true then the\n                  containers' allocators are swapped. Otherwise, swapping with unequal allocators\n                  results in undefined behavior.</para>\n              </description>\n              <throws>\n                <para>Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of <code>key_equal</code> or <code>hasher</code>.</para>\n              </throws>\n              <notes>\n                <para>The exception specifications aren't quite the same as the C++11 standard, as\n                  the equality predieate and hash function are swapped using their copy constructors.</para>\n              </notes>\n            </function>\n          </free-function-group>\n        </class>\n<?php\n}\n\nfunction echo_node_handle_docs($map)\n{\n    $type = $map ? 'map' : 'set';\n    $name = 'node_handle_'.$type;\n    $full_type = \"{$name}&lt;ImplementationDefined&gt;\";\n?>\n      <namespace name=\"unordered\">\n        <class name=\"<?php echo $name ?>\">\n          <template pack=\"true\">\n            <template-type-parameter name=\"ImplementationDefined\"/>\n          </template>\n          <purpose>\n            <para>\n              An object that owns a single element extracted from an\n              <classname>unordered_<?php echo $type ?></classname> or an\n              <classname>unordered_multi<?php echo $type ?></classname>, that\n              can then be inserted into a compatible container type.\n            </para>\n            <para>\n              The name and template parameters of this type are implementation\n              defined, and should be obtained using the <code>node_type</code>\n              member typedef from the appropriate container.\n            </para>\n          </purpose>\n<?php if ($map): ?>\n          <typedef name=\"key_type\">\n            <type>typename Container::key_type</type>\n          </typedef>\n          <typedef name=\"mapped_type\">\n            <type>typename Container::mapped_type</type>\n          </typedef>\n<?php else: ?>\n          <typedef name=\"value_type\">\n            <type>typename Container::value_type></type>\n          </typedef>\n<?php endif ?>\n          <typedef name=\"allocator_type\">\n            <type>typename Container::allocator_type></type>\n          </typedef>\n          <constructor specifiers=\"constexpr\" cv=\"noexcept\">\n          </constructor>\n          <destructor/>\n          <constructor cv=\"noexcept\">\n            <parameter>\n              <paramtype><?php echo $name; ?> &amp;&amp;</paramtype>\n            </parameter>\n          </constructor>\n          <method name=\"operator=\">\n            <parameter>\n              <paramtype><?php echo $name; ?>&amp;&amp;</paramtype>\n            </parameter>\n            <type><?php echo $name; ?>&amp;</type>\n          </method>\n<?php if ($map): ?>\n          <method name=\"key\" cv=\"const\">\n            <type>key_type&amp;</type>\n          </method>\n          <method name=\"mapped\" cv=\"const\">\n            <type>mapped_type&amp;</type>\n          </method>\n<?php else: ?>\n          <method name=\"value\" cv=\"const\">\n            <type>value_type&amp;</type>\n          </method>\n<?php endif; ?>\n          <method name=\"get_allocator\" cv=\"const\">\n            <type>allocator_type</type>\n          </method>\n          <method name=\"operator bool\" specifiers=\"explicit\" cv=\"const noexcept\">\n          </method>\n          <method name=\"empty\" cv=\"const noexcept\">\n            <type>bool</type>\n          </method>\n          <method name=\"swap\" cv=\"noexcept(ator_traits::propagate_on_container_swap::value)\">\n            <parameter>\n              <paramtype><?php echo $name; ?>&amp;</paramtype>\n            </parameter>\n            <type>void</type>\n            <notes>\n              <para>\n                In C++17 is also <code>noexcept</code> if <code>ator_traits::is_always_equal::value</code> is true.\n                But we don't support that trait yet.\n              </para>\n            </notes>\n          </method>\n          <free-function-group name=\"swap\" cv=\"noexcept(noexcept(x.swap(y)))\">\n            <function name=\"swap\">\n              <template pack=\"true\">\n                <template-type-parameter name=\"ImplementationDefined\"/>\n              </template>\n              <parameter name=\"x\">\n                <paramtype><?php echo $full_type; ?>&amp;</paramtype>\n              </parameter>\n              <parameter name=\"y\">\n                <paramtype><?php echo $full_type; ?>&amp;</paramtype>\n              </parameter>\n              <type>void</type>\n              <effects>\n                <para><code>x.swap(y)</code></para>\n              </effects>\n            </function>\n          </free-function-group>\n        </class>\n      </namespace>\n<?php\n}\n\n?>\n<!--\nCopyright Daniel James 2006-2009\nDistributed under the Boost Software License, Version 1.0. (See accompanying\nfile LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\n--><library-reference>\n    <header name=\"boost/unordered_set.hpp\">\n      <namespace name=\"boost\">\n<?php\necho_unordered_docs(false, false);\necho_unordered_docs(false, true);\necho_node_handle_docs(false);\n?>\n      </namespace>\n    </header>\n    <header name=\"boost/unordered_map.hpp\">\n      <namespace name=\"boost\">\n<?php\necho_unordered_docs(true, false);\necho_unordered_docs(true, true);\necho_node_handle_docs(true);\n?>\n      </namespace>\n    </header>\n  </library-reference>\n", "num_lines": 1789}
{"repo_name": "AzMigrate-Hydration", "repo_creator": "Azure", "programming_language": "PHP", "code": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n<link rel=\"SHORTCUT ICON\" href=\"/favicon.ico\">\n<style type=\"text/css\"><!--\nTD {font-family: Verdana,Arial,Helvetica}\nBODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}\nH1 {font-family: Verdana,Arial,Helvetica}\nH2 {font-family: Verdana,Arial,Helvetica}\nH3 {font-family: Verdana,Arial,Helvetica}\nA:link, A:visited, A:active { text-decoration: underline }\n--></style>\n<title>Search the documentation on XMLSoft.org</title>\n</head>\n<body bgcolor=\"#8b7765\" text=\"#000000\" link=\"#000000\" vlink=\"#000000\">\n<table border=\"0\" width=\"100%\" cellpadding=\"5\" cellspacing=\"0\" align=\"center\"><tr>\n<td width=\"180\">\n<a href=\"http://www.gnome.org/\"><img src=\"gnome2.png\" alt=\"Gnome2 Logo\"></a><a href=\"http://www.w3.org/Status\"><img src=\"w3c.png\" alt=\"W3C Logo\"></a><a href=\"http://www.redhat.com/\"><img src=\"redhat.gif\" alt=\"Red Hat Logo\"></a><div align=\"left\"><a href=\"http://xmlsoft.org/\"><img src=\"Libxml2-Logo-180x168.gif\" alt=\"Made with Libxml2 Logo\"></a></div>\n</td>\n<td><table border=\"0\" width=\"90%\" cellpadding=\"2\" cellspacing=\"0\" align=\"center\" bgcolor=\"#000000\"><tr><td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\" bgcolor=\"#fffacd\"><tr><td align=\"center\">\n<h1>The XML C library for Gnome</h1>\n<h2>Search engine</h2>\n</td></tr></table></td></tr></table></td>\n</tr></table>\n<table border=\"0\" cellpadding=\"4\" cellspacing=\"0\" width=\"100%\" align=\"center\"><tr><td bgcolor=\"#8b7765\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\"><tr>\n<td valign=\"top\" width=\"200\" bgcolor=\"#8b7765\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"100%\" bgcolor=\"#000000\"><tr><td>\n<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\">\n<tr><td colspan=\"1\" bgcolor=\"#eecfa1\" align=\"center\"><center><b>Main Menu</b></center></td></tr>\n<tr><td bgcolor=\"#fffacd\"><ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"intro.html\">Introduction</a></li>\n<li><a href=\"FAQ.html\">FAQ</a></li>\n<li><a href=\"docs.html\">Documentation</a></li>\n<li><a href=\"bugs.html\">Reporting bugs and getting help</a></li>\n<li><a href=\"help.html\">How to help</a></li>\n<li><a href=\"downloads.html\">Downloads</a></li>\n<li><a href=\"news.html\">News</a></li>\n<li><a href=\"XMLinfo.html\">XML</a></li>\n<li><a href=\"XSLT.html\">XSLT</a></li>\n<li><a href=\"python.html\">Python and bindings</a></li>\n<li><a href=\"architecture.html\">libxml architecture</a></li>\n<li><a href=\"tree.html\">The tree output</a></li>\n<li><a href=\"interface.html\">The SAX interface</a></li>\n<li><a href=\"xmldtd.html\">Validation &amp; DTDs</a></li>\n<li><a href=\"xmlmem.html\">Memory Management</a></li>\n<li><a href=\"encoding.html\">Encodings support</a></li>\n<li><a href=\"xmlio.html\">I/O Interfaces</a></li>\n<li><a href=\"catalog.html\">Catalog support</a></li>\n<li><a href=\"library.html\">The parser interfaces</a></li>\n<li><a href=\"entities.html\">Entities or no entities</a></li>\n<li><a href=\"namespaces.html\">Namespaces</a></li>\n<li><a href=\"upgrade.html\">Upgrading 1.x code</a></li>\n<li><a href=\"threads.html\">Thread safety</a></li>\n<li><a href=\"DOM.html\">DOM Principles</a></li>\n<li><a href=\"example.html\">A real example</a></li>\n<li><a href=\"contribs.html\">Contributions</a></li>\n<li><a href=\"tutorial/index.html\">Tutorial</a></li>\n<li>\n<a href=\"xml.html\">flat page</a>, <a href=\"site.xsl\">stylesheet</a>\n</li>\n</ul></td></tr>\n</table>\n<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\">\n<tr><td colspan=\"1\" bgcolor=\"#eecfa1\" align=\"center\"><center><b>API Indexes</b></center></td></tr>\n<tr><td bgcolor=\"#fffacd\"><ul>\n<li><a href=\"APIchunk0.html\">Alphabetic</a></li>\n<li><a href=\"APIconstructors.html\">Constructors</a></li>\n<li><a href=\"APIfunctions.html\">Functions/Types</a></li>\n<li><a href=\"APIfiles.html\">Modules</a></li>\n<li><a href=\"APIsymbols.html\">Symbols</a></li>\n</ul></td></tr>\n</table>\n<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\">\n<tr><td colspan=\"1\" bgcolor=\"#eecfa1\" align=\"center\"><center><b>Related links</b></center></td></tr>\n<tr><td bgcolor=\"#fffacd\"><ul>\n<li><a href=\"http://mail.gnome.org/archives/xml/\">Mail archive</a></li>\n<li><a href=\"http://xmlsoft.org/XSLT/\">XSLT libxslt</a></li>\n<li><a href=\"http://phd.cs.unibo.it/gdome2/\">DOM gdome2</a></li>\n<li><a href=\"http://www.aleksey.com/xmlsec/\">XML-DSig xmlsec</a></li>\n<li><a href=\"ftp://xmlsoft.org/\">FTP</a></li>\n<li><a href=\"http://ww.zlatkovic.com/projects/libxml/\">Windows binaries</a></li>\n<li><a href=\"http://garypennington.net/libxml2/\">Solaris binaries</a></li>\n<li><a href=\"http://www.zveno.com/open_source/libxml2xslt.html\">MacOsX binaries</a></li>\n<li><a href=\"http://sourceforge.net/projects/libxml2-pas/\">Pascal bindings</a></li>\n<li><a href=\"http://bugzilla.gnome.org/buglist.cgi?product=libxml&amp;product=libxml2\">Bug Tracker</a></li>\n</ul></td></tr>\n</table>\n</td></tr></table></td>\n<td valign=\"top\" bgcolor=\"#8b7765\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"100%\"><tr><td><table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"100%\" bgcolor=\"#000000\"><tr><td><table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\"><tr><td bgcolor=\"#fffacd\">\n<?php\n    $query = $HTTP_GET_VARS[ \"query\" ];\n    $scope = $HTTP_GET_VARS[ \"scope\" ];\n    // We handle only the first argument so far\n    $query = $_GET['query'];\n    $query = ltrim ($query);\n    if (! $query) {\n        echo \"<h1 align='center'>Search the documentation on XMLSoft.org</h1>\";\n    }\n    if ($scope == NULL)\n        $scope = \"any\";\n    $scope = ltrim ($scope);\n    if ($scope == \"\")\n        $scope = \"any\";\n    $querystr = htmlspecialchars($query, ENT_QUOTES, 'UTF-8');\n\n?>\n<p> The search service indexes the libxml2 and libxslt APIs and documentation as well as the xml@gnome.org and xslt@gnome.org mailing-list archives. To use it simply provide a set of keywords:\n<p>\n<form action=\"<?php echo \"$PHP_SELF\", \"?query=\", rawurlencode($query) ?>\"\n      enctype=\"application/x-www-form-urlencoded\" method=\"GET\">\n  <input name=\"query\" type=\"TEXT\" size=\"50\" value=\"<?php echo $querystr?>\">\n  <select name=\"scope\">\n    <option value=\"any\">Search All</option>\n    <option value=\"XML\" <?php if ($scope == 'XML') print \"selected\"?>>XML resources</option>\n    <option value=\"XSLT\" <?php if ($scope == 'XSLT') print \"selected\"?>>XSLT resources</option>\n    <option value=\"API\" <?php if ($scope == 'API') print \"selected\"?>>Only the APIs</option>\n    <option value=\"XMLAPI\" <?php if ($scope == 'XMLAPI') print \"selected\"?>>Only the XML API</option>\n    <option value=\"XSLTAPI\" <?php if ($scope == 'XSLTAPI') print \"selected\"?>>Only the XSLT API</option>\n    <option value=\"DOCS\" <?php if ($scope == 'DOCS') print \"selected\"?>>Only the Documentation</option>\n    <option value=\"XMLDOC\" <?php if ($scope == 'XMLDOC') print \"selected\"?>>Only the XML Documentation</option>\n    <option value=\"XSLTDOC\" <?php if ($scope == 'XSLTDOC') print \"selected\"?>>Only the XSLT Documentation</option>\n    <option value=\"LISTS\" <?php if ($scope == 'LISTS') print \"selected\"?>>Only the lists archives</option>\n    <option value=\"XMLLIST\" <?php if ($scope == 'XMLLIST') print \"selected\"?>>Only the XML list archive</option>\n    <option value=\"XSLTLIST\" <?php if ($scope == 'XSLTLIST') print \"selected\"?>>Only the XSLT list archive</option>\n  </select>\n  <input name=submit type=submit value=\"Search ...\">\n</form>\n<?php\n    function logQueryWord($word) {\n        $result = mysql_query (\"SELECT ID,Count FROM Queries WHERE Value='$word'\");\n\tif ($result) {\n\t    $i = mysql_num_rows($result);\n\t    if ($i == 0) {\n\t        mysql_free_result($result);\n\t\tmysql_query (\"INSERT INTO Queries (Value,Count) VALUES ('$word',1)\");\n\t    } else {\n\t        $id = mysql_result($result, 0, 0);\n\t\t$count = mysql_result($result, 0, 1);\n\t\t$count ++;\n\t\tmysql_query (\"UPDATE Queries SET Count=$count WHERE ID=$id\");\n\t    }\n\t} else {\n\t    mysql_query (\"INSERT INTO Queries (Value,Count) VALUES ('$word',1)\");\n\t}\n    }\n    function queryWord($word) {\n        $result = NULL;\n\t$j = 0;\n        if ($word) {\n\t    $result = mysql_query (\"SELECT words.relevance, symbols.name, symbols.type, symbols.module, symbols.descr FROM words, symbols WHERE LCASE(words.name) LIKE LCASE('$word') and words.symbol = symbols.name ORDER BY words.relevance DESC LIMIT 75\");\n\t    if ($result) {\n\t\t$j = mysql_num_rows($result);\n\t\tif ($j == 0) \n\t\t    mysql_free_result($result);\n\t    }\n\t    logQueryWord($word);\n\t}\n\treturn array($result, $j);\n    }\n    function queryHTMLWord($word) {\n        $result = NULL;\n\t$j = 0;\n        if ($word) {\n\t    $result = mysql_query (\"SELECT relevance, name, id, resource, section FROM wordsHTML WHERE LCASE(name) LIKE LCASE('$word') ORDER BY relevance DESC LIMIT 75\");\n\t    if ($result) {\n\t\t$j = mysql_num_rows($result);\n\t\tif ($j == 0) \n\t\t    mysql_free_result($result);\n\t    }\n\t    logQueryWord($word);\n\t}\n\treturn array($result, $j);\n    }\n    function queryArchiveWord($word) {\n        $result = NULL;\n\t$j = 0;\n        if ($word) {\n\t    $result = mysql_query (\"SELECT wordsArchive.relevance, wordsArchive.name, 'xml-list', archives.resource, archives.title FROM wordsArchive, archives WHERE LCASE(wordsArchive.name) LIKE LCASE('$word') and wordsArchive.ID = archives.ID ORDER BY relevance DESC LIMIT 75\");\n\t    if ($result) {\n\t\t$j = mysql_num_rows($result);\n\t\tif ($j == 0) \n\t\t    mysql_free_result($result);\n\t    }\n\t    logQueryWord($word);\n\t}\n\treturn array($result, $j);\n    }\n    function XSLTqueryWord($word) {\n        $result = NULL;\n\t$j = 0;\n        if ($word) {\n\t    $result = mysql_query (\"SELECT XSLTwords.relevance, XSLTsymbols.name, XSLTsymbols.type, XSLTsymbols.module, XSLTsymbols.descr FROM XSLTwords, XSLTsymbols WHERE LCASE(XSLTwords.name) LIKE LCASE('$word') and XSLTwords.symbol = XSLTsymbols.name ORDER BY XSLTwords.relevance DESC LIMIT 75\");\n\t    if ($result) {\n\t\t$j = mysql_num_rows($result);\n\t\tif ($j == 0) \n\t\t    mysql_free_result($result);\n\t    }\n\t    logQueryWord($word);\n\t}\n\treturn array($result, $j);\n    }\n    function XSLTqueryHTMLWord($word) {\n        $result = NULL;\n\t$j = 0;\n        if ($word) {\n\t    $result = mysql_query (\"SELECT relevance, name, id, resource, section FROM XSLTwordsHTML WHERE LCASE(name) LIKE LCASE('$word') ORDER BY relevance DESC LIMIT 75\");\n\t    if ($result) {\n\t\t$j = mysql_num_rows($result);\n\t\tif ($j == 0) \n\t\t    mysql_free_result($result);\n\t    }\n\t    logQueryWord($word);\n\t}\n\treturn array($result, $j);\n    }\n    function XSLTqueryArchiveWord($word) {\n        $result = NULL;\n\t$j = 0;\n        if ($word) {\n\t    $result = mysql_query (\"SELECT XSLTwordsArchive.relevance, XSLTwordsArchive.name, 'xslt-list', archives.resource, archives.title FROM XSLTwordsArchive, archives WHERE LCASE(XSLTwordsArchive.name) LIKE LCASE('$word') and XSLTwordsArchive.ID = archives.ID ORDER BY relevance DESC LIMIT 75\");\n\t    if ($result) {\n\t\t$j = mysql_num_rows($result);\n\t\tif ($j == 0) \n\t\t    mysql_free_result($result);\n\t    }\n\t    logQueryWord($word);\n\t}\n\treturn array($result, $j);\n    }\n    function resSort ($a, $b) {\n\tlist($ra,$ta,$ma,$na,$da) = $a;\n\tlist($rb,$tb,$mb,$nb,$db) = $b;\n\tif ($ra == $rb) return 0;\n\treturn ($ra > $rb) ? -1 : 1;\n    }\n    if (($query) && (strlen($query) <= 50)) {\n\t$link = mysql_connect (\"localhost\", \"nobody\");\n\tif (!$link) {\n\t    echo \"<p> Could not connect to the database: \", mysql_error();\n\t} else {\n\t    mysql_select_db(\"xmlsoft\", $link);\n\t    $list = explode (\" \", $query);\n\t    $results = array();\n\t    $number = 0;\n\t    for ($number = 0;$number < count($list);$number++) {\n\n\t\t$word = $list[$number];\n\t\tif (($scope == 'any') || ($scope == 'XML') ||\n\t\t    ($scope == 'API') || ($scope == 'XMLAPI')) {\n\t\t    list($result, $j) = queryWord($word);\n\t\t    if ($j > 0) {\n\t\t\tfor ($i = 0; $i < $j; $i++) {\n\t\t\t    $relevance = mysql_result($result, $i, 0);\n\t\t\t    $name = mysql_result($result, $i, 1);\n\t\t\t    $type = mysql_result($result, $i, 2);\n\t\t\t    $module = mysql_result($result, $i, 3);\n\t\t\t    $desc = mysql_result($result, $i, 4);\n\t\t\t    if (array_key_exists($name, $results)) {\n\t\t\t\tlist($r,$t,$m,$d,$w,$u) = $results[$name];\n\t\t\t\t$results[$name] = array(($r + $relevance) * 2,\n\t\t\t\t\t\t\t$t,$m,$d,$w,$u);\n\t\t\t    } else {\n\t\t\t\t$id = $name;\n\t\t\t\t$m = strtolower($module);\n\t\t\t\t$url = \"html/libxml-$module.html#$id\";\n\t\t\t\t$results[$name] = array($relevance,$type,\n\t\t\t\t\t\t$module, $desc, $name, $url);\n\t\t\t    }\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t    }\n\t\t}\n\t\tif (($scope == 'any') || ($scope == 'XSLT') ||\n\t\t    ($scope == 'API') || ($scope == 'XSLTAPI')) {\n\t\t    list($result, $j) = XSLTqueryWord($word);\n\t\t    if ($j > 0) {\n\t\t\tfor ($i = 0; $i < $j; $i++) {\n\t\t\t    $relevance = mysql_result($result, $i, 0);\n\t\t\t    $name = mysql_result($result, $i, 1);\n\t\t\t    $type = mysql_result($result, $i, 2);\n\t\t\t    $module = mysql_result($result, $i, 3);\n\t\t\t    $desc = mysql_result($result, $i, 4);\n\t\t\t    if (array_key_exists($name, $results)) {\n\t\t\t\tlist($r,$t,$m,$d,$w,$u) = $results[$name];\n\t\t\t\t$results[$name] = array(($r + $relevance) * 2,\n\t\t\t\t\t\t\t$t,$m,$d,$w,$u);\n\t\t\t    } else {\n\t\t\t\t$id = $name;\n\t\t\t\t$m = strtolower($module);\n\t\t\t\t$url = \"XSLT/html/libxslt-$module.html#$id\";\n\t\t\t\t$results[$name] = array($relevance,$type,\n\t\t\t\t\t\t$module, $desc, $name, $url);\n\t\t\t    }\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t    }\n\t\t}\n\t\tif (($scope == 'any') || ($scope == 'XML') ||\n\t\t    ($scope == 'DOCS') || ($scope == 'XMLDOC')) {\n\t\t    list($result, $k) = queryHTMLWord($word);\n\t\t    if ($k > 0) {\n\t\t\tfor ($i = 0; $i < $k; $i++) {\n\t\t\t    $relevance = mysql_result($result, $i, 0);\n\t\t\t    $name = mysql_result($result, $i, 1);\n\t\t\t    $id = mysql_result($result, $i, 2);\n\t\t\t    $module = mysql_result($result, $i, 3);\n\t\t\t    $desc = mysql_result($result, $i, 4);\n\t\t\t    if (strncmp($module, \"libxml-\", 7) == 0)\n\t\t\t        $url = \"html/$module\";\n\t\t\t    if ($id != \"\") {\n\t\t\t\t$url = $url + \"#$id\";\n\t\t\t    }\n\t\t\t    $results[\"$name _html_ $number _ $i\"] =\n\t\t\t\t\t  array($relevance, \"XML docs\",\n\t\t\t\t\t\t$module, $desc, $name, $url);\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t    }\n\t\t}\n\t\tif (($scope == 'any') || ($scope == 'XSLT') ||\n\t\t    ($scope == 'DOCS') || ($scope == 'XSLTDOC')) {\n\t\t    list($result, $k) = XSLTqueryHTMLWord($word);\n\t\t    if ($k > 0) {\n\t\t\tfor ($i = 0; $i < $k; $i++) {\n\t\t\t    $relevance = mysql_result($result, $i, 0);\n\t\t\t    $name = mysql_result($result, $i, 1);\n\t\t\t    $id = mysql_result($result, $i, 2);\n\t\t\t    $module = mysql_result($result, $i, 3);\n\t\t\t    $desc = mysql_result($result, $i, 4);\n\t\t\t    $url = \"XSLT/$module\";\n\t\t\t    if ($id != \"\") {\n\t\t\t\t$url = $url + \"#$id\";\n\t\t\t    }\n\t\t\t    $results[\"$name xslthtml $number _ $i \"] =\n\t\t\t\t\t  array($relevance, \"XSLT docs\",\n\t\t\t\t\t\t$module, $desc, $name, $url);\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t    }\n\t\t}\n\t\tif (($scope == 'any') || ($scope == 'XML') ||\n\t\t    ($scope == 'LISTS') || ($scope == 'XMLLIST')) {\n\t\t    list($result, $j) = queryArchiveWord($word);\n\t\t    if ($j > 0) {\n\t\t\tfor ($i = 0; $i < $j; $i++) {\n\t\t\t    $relevance = mysql_result($result, $i, 0);\n\t\t\t    $name = mysql_result($result, $i, 1);\n\t\t\t    $type = mysql_result($result, $i, 2);\n\t\t\t    $url = mysql_result($result, $i, 3);\n\t\t\t    $desc = mysql_result($result, $i, 4);\n\t\t\t    if (array_key_exists($url, $results)) {\n\t\t\t\tlist($r,$t,$m,$d,$w,$u) = $results[$url];\n\t\t\t\t$results[$name] = array(($r + $relevance) * 2,\n\t\t\t\t\t\t\t$t,$m,$d,$w,$u);\n\t\t\t    } else {\n\t\t\t\t$id = $name;\n\t\t\t\t$m = strtolower($module);\n\t\t\t\t$u = str_replace(\n\t\t\t\"http://mail.gnome.org/archives/xml/\", \"\", $url);\n\t\t\t\t$results[$url] = array($relevance,$type,\n\t\t\t\t\t\t$u, $desc, $name, $url);\n\t\t\t    }\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t    }\n\t\t}\n\t\tif (($scope == 'any') || ($scope == 'XSLT') ||\n\t\t    ($scope == 'LISTS') || ($scope == 'XSLTLIST')) {\n\t\t    list($result, $j) = XSLTqueryArchiveWord($word);\n\t\t    if ($j > 0) {\n\t\t\tfor ($i = 0; $i < $j; $i++) {\n\t\t\t    $relevance = mysql_result($result, $i, 0);\n\t\t\t    $name = mysql_result($result, $i, 1);\n\t\t\t    $type = mysql_result($result, $i, 2);\n\t\t\t    $url = mysql_result($result, $i, 3);\n\t\t\t    $desc = mysql_result($result, $i, 4);\n\t\t\t    if (array_key_exists($url, $results)) {\n\t\t\t\tlist($r,$t,$m,$d,$w,$u) = $results[$url];\n\t\t\t\t$results[$name] = array(($r + $relevance) * 2,\n\t\t\t\t\t\t\t$t,$m,$d,$w,$u);\n\t\t\t    } else {\n\t\t\t\t$id = $name;\n\t\t\t\t$m = strtolower($module);\n\t\t\t\t$u = str_replace(\n\t\t\t\"http://mail.gnome.org/archives/xslt/\", \"\", $url);\n\t\t\t\t$results[$url] = array($relevance,$type,\n\t\t\t\t\t\t$u, $desc, $name, $url);\n\t\t\t    }\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t    }\n\t\t}\n\t    }\n\t    if ((count($results) == 0) && (count($list) == 1)) {\n\t\t$word = $list[0];\n\t\tif (($scope == 'any') || ($scope == 'XML') ||\n\t\t    ($scope == 'API') || ($scope == 'XMLAPI')) {\n\t\t    list($result, $j) = queryWord(\"xml$word\");\n\t\t    if ($j > 0) {\n\t\t\tfor ($i = 0; $i < $j; $i++) {\n\t\t\t    $relevance = mysql_result($result, $i, 0);\n\t\t\t    $name = mysql_result($result, $i, 1);\n\t\t\t    $type = mysql_result($result, $i, 2);\n\t\t\t    $module = mysql_result($result, $i, 3);\n\t\t\t    $desc = mysql_result($result, $i, 4);\n\t\t\t    if (array_key_exists($name, $results)) {\n\t\t\t\tlist($r,$t,$m,$d,$w,$u) = $results[$name];\n\t\t\t\t$results[$name] = array(($r + $relevance) * 2,\n\t\t\t\t\t\t\t$t,$m,$d,$w,$u);\n\t\t\t    } else {\n\t\t\t\t$id = $name;\n\t\t\t\t$m = strtolower($module);\n\t\t\t\t$url = \"html/libxml-$module.html#$id\";\n\t\t\t\t$results[$name] = array($relevance,$type,\n\t\t\t\t\t\t$module, $desc, $name, $url);\n\t\t\t    }\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t    }\n\t\t}\n\t\tif (($scope == 'any') || ($scope == 'XSLT') ||\n\t\t    ($scope == 'API') || ($scope == 'XSLTAPI')) {\n\t\t    list($result, $j) = XSLTqueryWord(\"xslt$word\");\n\t\t    if ($j > 0) {\n\t\t\tfor ($i = 0; $i < $j; $i++) {\n\t\t\t    $relevance = mysql_result($result, $i, 0);\n\t\t\t    $name = mysql_result($result, $i, 1);\n\t\t\t    $type = mysql_result($result, $i, 2);\n\t\t\t    $module = mysql_result($result, $i, 3);\n\t\t\t    $desc = mysql_result($result, $i, 4);\n\t\t\t    if (array_key_exists($name, $results)) {\n\t\t\t\tlist($r,$t,$m,$d,$w,$u) = $results[$name];\n\t\t\t\t$results[$name] = array(($r + $relevance) * 2,\n\t\t\t\t\t\t\t$t,$m,$d,$w,$u);\n\t\t\t    } else {\n\t\t\t\t$id = $name;\n\t\t\t\t$m = strtolower($module);\n\t\t\t\t$url = \"XSLT/html/libxslt-$module.html#$id\";\n\t\t\t\t$results[$name] = array($relevance,$type,\n\t\t\t\t\t\t$module, $desc, $name, $url);\n\t\t\t    }\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t    }\n\t\t}\n\t    }\n\t    mysql_close($link);\n\t    $nb = count($results);\n\t    echo \"<h3 align='center'>Found $nb results for query $querystr</h3>\\n\";\n\t    usort($results, \"resSort\");\n\n            if ($nb > 0) {\n\t\tprintf(\"<table><tbody>\\n\");\n\t\tprintf(\"<tr><td>Quality</td><td>Symbol</td><td>Type</td><td>module</td><td>Description</td></tr>\\n\");\n\t\t$i = 0;\n\t\twhile (list ($name, $val) = each ($results)) {\n\t\t    list($r,$t,$m,$d,$s,$u) = $val;\n\t\t    $m = str_replace(\"<\", \"&lt;\", $m);\n\t\t    $s = str_replace(\"<\", \"&lt;\", $s);\n\t\t    $d = str_replace(\"<\", \"&lt;\", $d);\n\t\t    echo \"<tr><td>$r</td><td><a href='$u'>$s</a></td><td>$t</td><td>$m</td><td>$d</td></tr>\";\n\t\t    $i = $i + 1;\n\t\t    if ($i > 75)\n\t\t        break;\n\t\t}\n\t\tprintf(\"</tbody></table>\\n\");\n\t    }\n\t}\n    }\n?>\n\n</td></tr></table></td></tr></table></td></tr></table></td>\n</tr></table></td></tr></table>\n</body>\n</html>\n\n", "num_lines": 478}
{"repo_name": "AzMigrate-Hydration", "repo_creator": "Azure", "programming_language": "PHP", "code": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n<link rel=\"SHORTCUT ICON\" href=\"/favicon.ico\">\n<style type=\"text/css\"><!--\nTD {font-family: Verdana,Arial,Helvetica}\nBODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}\nH1 {font-family: Verdana,Arial,Helvetica}\nH2 {font-family: Verdana,Arial,Helvetica}\nH3 {font-family: Verdana,Arial,Helvetica}\nA:link, A:visited, A:active { text-decoration: underline }\n--></style>\n<title>Search the documentation on XMLSoft.org</title>\n</head>\n<body bgcolor=\"#8b7765\" text=\"#000000\" link=\"#000000\" vlink=\"#000000\">\n<table border=\"0\" width=\"100%\" cellpadding=\"5\" cellspacing=\"0\" align=\"center\"><tr>\n<td width=\"180\">\n<a href=\"http://www.gnome.org/\"><img src=\"gnome2.png\" alt=\"Gnome2 Logo\"></a><a href=\"http://www.w3.org/Status\"><img src=\"w3c.png\" alt=\"W3C Logo\"></a><a href=\"http://www.redhat.com/\"><img src=\"redhat.gif\" alt=\"Red Hat Logo\"></a><div align=\"left\"><a href=\"http://xmlsoft.org/\"><img src=\"Libxml2-Logo-180x168.gif\" alt=\"Made with Libxml2 Logo\"></a></div>\n</td>\n<td><table border=\"0\" width=\"90%\" cellpadding=\"2\" cellspacing=\"0\" align=\"center\" bgcolor=\"#000000\"><tr><td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\" bgcolor=\"#fffacd\"><tr><td align=\"center\">\n<h1>The XML C library for Gnome</h1>\n<h2>Search engine</h2>\n</td></tr></table></td></tr></table></td>\n</tr></table>\n<table border=\"0\" cellpadding=\"4\" cellspacing=\"0\" width=\"100%\" align=\"center\"><tr><td bgcolor=\"#8b7765\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\"><tr>\n<td valign=\"top\" width=\"200\" bgcolor=\"#8b7765\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"100%\" bgcolor=\"#000000\"><tr><td>\n<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\">\n<tr><td colspan=\"1\" bgcolor=\"#eecfa1\" align=\"center\"><center><b>Main Menu</b></center></td></tr>\n<tr><td bgcolor=\"#fffacd\"><ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"intro.html\">Introduction</a></li>\n<li><a href=\"FAQ.html\">FAQ</a></li>\n<li><a href=\"docs.html\">Documentation</a></li>\n<li><a href=\"bugs.html\">Reporting bugs and getting help</a></li>\n<li><a href=\"help.html\">How to help</a></li>\n<li><a href=\"downloads.html\">Downloads</a></li>\n<li><a href=\"news.html\">News</a></li>\n<li><a href=\"XMLinfo.html\">XML</a></li>\n<li><a href=\"XSLT.html\">XSLT</a></li>\n<li><a href=\"python.html\">Python and bindings</a></li>\n<li><a href=\"architecture.html\">libxml architecture</a></li>\n<li><a href=\"tree.html\">The tree output</a></li>\n<li><a href=\"interface.html\">The SAX interface</a></li>\n<li><a href=\"xmldtd.html\">Validation &amp; DTDs</a></li>\n<li><a href=\"xmlmem.html\">Memory Management</a></li>\n<li><a href=\"encoding.html\">Encodings support</a></li>\n<li><a href=\"xmlio.html\">I/O Interfaces</a></li>\n<li><a href=\"catalog.html\">Catalog support</a></li>\n<li><a href=\"library.html\">The parser interfaces</a></li>\n<li><a href=\"entities.html\">Entities or no entities</a></li>\n<li><a href=\"namespaces.html\">Namespaces</a></li>\n<li><a href=\"upgrade.html\">Upgrading 1.x code</a></li>\n<li><a href=\"threads.html\">Thread safety</a></li>\n<li><a href=\"DOM.html\">DOM Principles</a></li>\n<li><a href=\"example.html\">A real example</a></li>\n<li><a href=\"contribs.html\">Contributions</a></li>\n<li><a href=\"tutorial/index.html\">Tutorial</a></li>\n<li>\n<a href=\"xml.html\">flat page</a>, <a href=\"site.xsl\">stylesheet</a>\n</li>\n</ul></td></tr>\n</table>\n<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\">\n<tr><td colspan=\"1\" bgcolor=\"#eecfa1\" align=\"center\"><center><b>API Indexes</b></center></td></tr>\n<tr><td bgcolor=\"#fffacd\"><ul>\n<li><a href=\"APIchunk0.html\">Alphabetic</a></li>\n<li><a href=\"APIconstructors.html\">Constructors</a></li>\n<li><a href=\"APIfunctions.html\">Functions/Types</a></li>\n<li><a href=\"APIfiles.html\">Modules</a></li>\n<li><a href=\"APIsymbols.html\">Symbols</a></li>\n</ul></td></tr>\n</table>\n<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\">\n<tr><td colspan=\"1\" bgcolor=\"#eecfa1\" align=\"center\"><center><b>Related links</b></center></td></tr>\n<tr><td bgcolor=\"#fffacd\"><ul>\n<li><a href=\"http://mail.gnome.org/archives/xml/\">Mail archive</a></li>\n<li><a href=\"http://xmlsoft.org/XSLT/\">XSLT libxslt</a></li>\n<li><a href=\"http://phd.cs.unibo.it/gdome2/\">DOM gdome2</a></li>\n<li><a href=\"http://www.aleksey.com/xmlsec/\">XML-DSig xmlsec</a></li>\n<li><a href=\"ftp://xmlsoft.org/\">FTP</a></li>\n<li><a href=\"http://ww.zlatkovic.com/projects/libxml/\">Windows binaries</a></li>\n<li><a href=\"http://garypennington.net/libxml2/\">Solaris binaries</a></li>\n<li><a href=\"http://www.zveno.com/open_source/libxml2xslt.html\">MacOsX binaries</a></li>\n<li><a href=\"http://sourceforge.net/projects/libxml2-pas/\">Pascal bindings</a></li>\n<li><a href=\"http://bugzilla.gnome.org/buglist.cgi?product=libxml&amp;product=libxml2\">Bug Tracker</a></li>\n</ul></td></tr>\n</table>\n</td></tr></table></td>\n<td valign=\"top\" bgcolor=\"#8b7765\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"100%\"><tr><td><table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"100%\" bgcolor=\"#000000\"><tr><td><table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\"><tr><td bgcolor=\"#fffacd\">\n<?php\n    $query = $HTTP_GET_VARS[ \"query\" ];\n    $scope = $HTTP_GET_VARS[ \"scope\" ];\n    // We handle only the first argument so far\n    $query = $_GET['query'];\n    $query = ltrim ($query);\n    if (! $query) {\n        echo \"<h1 align='center'>Search the documentation on XMLSoft.org</h1>\";\n    }\n    if ($scope == NULL)\n        $scope = \"any\";\n    $scope = ltrim ($scope);\n    if ($scope == \"\")\n        $scope = \"any\";\n    $querystr = htmlspecialchars($query, ENT_QUOTES, 'UTF-8');\n\n?>\n<p> The search service indexes the libxml2 and libxslt APIs and documentation as well as the xml@gnome.org and xslt@gnome.org mailing-list archives. To use it simply provide a set of keywords:\n<p>\n<form action=\"<?php echo \"$PHP_SELF\", \"?query=\", rawurlencode($query) ?>\"\n      enctype=\"application/x-www-form-urlencoded\" method=\"GET\">\n  <input name=\"query\" type=\"TEXT\" size=\"50\" value=\"<?php echo $querystr?>\">\n  <select name=\"scope\">\n    <option value=\"any\">Search All</option>\n    <option value=\"XML\" <?php if ($scope == 'XML') print \"selected\"?>>XML resources</option>\n    <option value=\"XSLT\" <?php if ($scope == 'XSLT') print \"selected\"?>>XSLT resources</option>\n    <option value=\"API\" <?php if ($scope == 'API') print \"selected\"?>>Only the APIs</option>\n    <option value=\"XMLAPI\" <?php if ($scope == 'XMLAPI') print \"selected\"?>>Only the XML API</option>\n    <option value=\"XSLTAPI\" <?php if ($scope == 'XSLTAPI') print \"selected\"?>>Only the XSLT API</option>\n    <option value=\"DOCS\" <?php if ($scope == 'DOCS') print \"selected\"?>>Only the Documentation</option>\n    <option value=\"XMLDOC\" <?php if ($scope == 'XMLDOC') print \"selected\"?>>Only the XML Documentation</option>\n    <option value=\"XSLTDOC\" <?php if ($scope == 'XSLTDOC') print \"selected\"?>>Only the XSLT Documentation</option>\n    <option value=\"LISTS\" <?php if ($scope == 'LISTS') print \"selected\"?>>Only the lists archives</option>\n    <option value=\"XMLLIST\" <?php if ($scope == 'XMLLIST') print \"selected\"?>>Only the XML list archive</option>\n    <option value=\"XSLTLIST\" <?php if ($scope == 'XSLTLIST') print \"selected\"?>>Only the XSLT list archive</option>\n  </select>\n  <input name=submit type=submit value=\"Search ...\">\n</form>\n<?php\n    function logQueryWord($word) {\n        $result = mysql_query (\"SELECT ID,Count FROM Queries WHERE Value='$word'\");\n\tif ($result) {\n\t    $i = mysql_num_rows($result);\n\t    if ($i == 0) {\n\t        mysql_free_result($result);\n\t\tmysql_query (\"INSERT INTO Queries (Value,Count) VALUES ('$word',1)\");\n\t    } else {\n\t        $id = mysql_result($result, 0, 0);\n\t\t$count = mysql_result($result, 0, 1);\n\t\t$count ++;\n\t\tmysql_query (\"UPDATE Queries SET Count=$count WHERE ID=$id\");\n\t    }\n\t} else {\n\t    mysql_query (\"INSERT INTO Queries (Value,Count) VALUES ('$word',1)\");\n\t}\n    }\n    function queryWord($word) {\n        $result = NULL;\n\t$j = 0;\n        if ($word) {\n\t    $result = mysql_query (\"SELECT words.relevance, symbols.name, symbols.type, symbols.module, symbols.descr FROM words, symbols WHERE LCASE(words.name) LIKE LCASE('$word') and words.symbol = symbols.name ORDER BY words.relevance DESC LIMIT 75\");\n\t    if ($result) {\n\t\t$j = mysql_num_rows($result);\n\t\tif ($j == 0) \n\t\t    mysql_free_result($result);\n\t    }\n\t    logQueryWord($word);\n\t}\n\treturn array($result, $j);\n    }\n    function queryHTMLWord($word) {\n        $result = NULL;\n\t$j = 0;\n        if ($word) {\n\t    $result = mysql_query (\"SELECT relevance, name, id, resource, section FROM wordsHTML WHERE LCASE(name) LIKE LCASE('$word') ORDER BY relevance DESC LIMIT 75\");\n\t    if ($result) {\n\t\t$j = mysql_num_rows($result);\n\t\tif ($j == 0) \n\t\t    mysql_free_result($result);\n\t    }\n\t    logQueryWord($word);\n\t}\n\treturn array($result, $j);\n    }\n    function queryArchiveWord($word) {\n        $result = NULL;\n\t$j = 0;\n        if ($word) {\n\t    $result = mysql_query (\"SELECT wordsArchive.relevance, wordsArchive.name, 'xml-list', archives.resource, archives.title FROM wordsArchive, archives WHERE LCASE(wordsArchive.name) LIKE LCASE('$word') and wordsArchive.ID = archives.ID ORDER BY relevance DESC LIMIT 75\");\n\t    if ($result) {\n\t\t$j = mysql_num_rows($result);\n\t\tif ($j == 0) \n\t\t    mysql_free_result($result);\n\t    }\n\t    logQueryWord($word);\n\t}\n\treturn array($result, $j);\n    }\n    function XSLTqueryWord($word) {\n        $result = NULL;\n\t$j = 0;\n        if ($word) {\n\t    $result = mysql_query (\"SELECT XSLTwords.relevance, XSLTsymbols.name, XSLTsymbols.type, XSLTsymbols.module, XSLTsymbols.descr FROM XSLTwords, XSLTsymbols WHERE LCASE(XSLTwords.name) LIKE LCASE('$word') and XSLTwords.symbol = XSLTsymbols.name ORDER BY XSLTwords.relevance DESC LIMIT 75\");\n\t    if ($result) {\n\t\t$j = mysql_num_rows($result);\n\t\tif ($j == 0) \n\t\t    mysql_free_result($result);\n\t    }\n\t    logQueryWord($word);\n\t}\n\treturn array($result, $j);\n    }\n    function XSLTqueryHTMLWord($word) {\n        $result = NULL;\n\t$j = 0;\n        if ($word) {\n\t    $result = mysql_query (\"SELECT relevance, name, id, resource, section FROM XSLTwordsHTML WHERE LCASE(name) LIKE LCASE('$word') ORDER BY relevance DESC LIMIT 75\");\n\t    if ($result) {\n\t\t$j = mysql_num_rows($result);\n\t\tif ($j == 0) \n\t\t    mysql_free_result($result);\n\t    }\n\t    logQueryWord($word);\n\t}\n\treturn array($result, $j);\n    }\n    function XSLTqueryArchiveWord($word) {\n        $result = NULL;\n\t$j = 0;\n        if ($word) {\n\t    $result = mysql_query (\"SELECT XSLTwordsArchive.relevance, XSLTwordsArchive.name, 'xslt-list', archives.resource, archives.title FROM XSLTwordsArchive, archives WHERE LCASE(XSLTwordsArchive.name) LIKE LCASE('$word') and XSLTwordsArchive.ID = archives.ID ORDER BY relevance DESC LIMIT 75\");\n\t    if ($result) {\n\t\t$j = mysql_num_rows($result);\n\t\tif ($j == 0) \n\t\t    mysql_free_result($result);\n\t    }\n\t    logQueryWord($word);\n\t}\n\treturn array($result, $j);\n    }\n    function resSort ($a, $b) {\n\tlist($ra,$ta,$ma,$na,$da) = $a;\n\tlist($rb,$tb,$mb,$nb,$db) = $b;\n\tif ($ra == $rb) return 0;\n\treturn ($ra > $rb) ? -1 : 1;\n    }\n    if (($query) && (strlen($query) <= 50)) {\n\t$link = mysql_connect (\"localhost\", \"nobody\");\n\tif (!$link) {\n\t    echo \"<p> Could not connect to the database: \", mysql_error();\n\t} else {\n\t    mysql_select_db(\"xmlsoft\", $link);\n\t    $list = explode (\" \", $query);\n\t    $results = array();\n\t    $number = 0;\n\t    for ($number = 0;$number < count($list);$number++) {\n\n\t\t$word = $list[$number];\n\t\tif (($scope == 'any') || ($scope == 'XML') ||\n\t\t    ($scope == 'API') || ($scope == 'XMLAPI')) {\n\t\t    list($result, $j) = queryWord($word);\n\t\t    if ($j > 0) {\n\t\t\tfor ($i = 0; $i < $j; $i++) {\n\t\t\t    $relevance = mysql_result($result, $i, 0);\n\t\t\t    $name = mysql_result($result, $i, 1);\n\t\t\t    $type = mysql_result($result, $i, 2);\n\t\t\t    $module = mysql_result($result, $i, 3);\n\t\t\t    $desc = mysql_result($result, $i, 4);\n\t\t\t    if (array_key_exists($name, $results)) {\n\t\t\t\tlist($r,$t,$m,$d,$w,$u) = $results[$name];\n\t\t\t\t$results[$name] = array(($r + $relevance) * 2,\n\t\t\t\t\t\t\t$t,$m,$d,$w,$u);\n\t\t\t    } else {\n\t\t\t\t$id = $name;\n\t\t\t\t$m = strtolower($module);\n\t\t\t\t$url = \"html/libxml-$module.html#$id\";\n\t\t\t\t$results[$name] = array($relevance,$type,\n\t\t\t\t\t\t$module, $desc, $name, $url);\n\t\t\t    }\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t    }\n\t\t}\n\t\tif (($scope == 'any') || ($scope == 'XSLT') ||\n\t\t    ($scope == 'API') || ($scope == 'XSLTAPI')) {\n\t\t    list($result, $j) = XSLTqueryWord($word);\n\t\t    if ($j > 0) {\n\t\t\tfor ($i = 0; $i < $j; $i++) {\n\t\t\t    $relevance = mysql_result($result, $i, 0);\n\t\t\t    $name = mysql_result($result, $i, 1);\n\t\t\t    $type = mysql_result($result, $i, 2);\n\t\t\t    $module = mysql_result($result, $i, 3);\n\t\t\t    $desc = mysql_result($result, $i, 4);\n\t\t\t    if (array_key_exists($name, $results)) {\n\t\t\t\tlist($r,$t,$m,$d,$w,$u) = $results[$name];\n\t\t\t\t$results[$name] = array(($r + $relevance) * 2,\n\t\t\t\t\t\t\t$t,$m,$d,$w,$u);\n\t\t\t    } else {\n\t\t\t\t$id = $name;\n\t\t\t\t$m = strtolower($module);\n\t\t\t\t$url = \"XSLT/html/libxslt-$module.html#$id\";\n\t\t\t\t$results[$name] = array($relevance,$type,\n\t\t\t\t\t\t$module, $desc, $name, $url);\n\t\t\t    }\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t    }\n\t\t}\n\t\tif (($scope == 'any') || ($scope == 'XML') ||\n\t\t    ($scope == 'DOCS') || ($scope == 'XMLDOC')) {\n\t\t    list($result, $k) = queryHTMLWord($word);\n\t\t    if ($k > 0) {\n\t\t\tfor ($i = 0; $i < $k; $i++) {\n\t\t\t    $relevance = mysql_result($result, $i, 0);\n\t\t\t    $name = mysql_result($result, $i, 1);\n\t\t\t    $id = mysql_result($result, $i, 2);\n\t\t\t    $module = mysql_result($result, $i, 3);\n\t\t\t    $desc = mysql_result($result, $i, 4);\n\t\t\t    if (strncmp($module, \"libxml-\", 7) == 0)\n\t\t\t        $url = \"html/$module\";\n\t\t\t    if ($id != \"\") {\n\t\t\t\t$url = $url + \"#$id\";\n\t\t\t    }\n\t\t\t    $results[\"$name _html_ $number _ $i\"] =\n\t\t\t\t\t  array($relevance, \"XML docs\",\n\t\t\t\t\t\t$module, $desc, $name, $url);\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t    }\n\t\t}\n\t\tif (($scope == 'any') || ($scope == 'XSLT') ||\n\t\t    ($scope == 'DOCS') || ($scope == 'XSLTDOC')) {\n\t\t    list($result, $k) = XSLTqueryHTMLWord($word);\n\t\t    if ($k > 0) {\n\t\t\tfor ($i = 0; $i < $k; $i++) {\n\t\t\t    $relevance = mysql_result($result, $i, 0);\n\t\t\t    $name = mysql_result($result, $i, 1);\n\t\t\t    $id = mysql_result($result, $i, 2);\n\t\t\t    $module = mysql_result($result, $i, 3);\n\t\t\t    $desc = mysql_result($result, $i, 4);\n\t\t\t    $url = \"XSLT/$module\";\n\t\t\t    if ($id != \"\") {\n\t\t\t\t$url = $url + \"#$id\";\n\t\t\t    }\n\t\t\t    $results[\"$name xslthtml $number _ $i \"] =\n\t\t\t\t\t  array($relevance, \"XSLT docs\",\n\t\t\t\t\t\t$module, $desc, $name, $url);\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t    }\n\t\t}\n\t\tif (($scope == 'any') || ($scope == 'XML') ||\n\t\t    ($scope == 'LISTS') || ($scope == 'XMLLIST')) {\n\t\t    list($result, $j) = queryArchiveWord($word);\n\t\t    if ($j > 0) {\n\t\t\tfor ($i = 0; $i < $j; $i++) {\n\t\t\t    $relevance = mysql_result($result, $i, 0);\n\t\t\t    $name = mysql_result($result, $i, 1);\n\t\t\t    $type = mysql_result($result, $i, 2);\n\t\t\t    $url = mysql_result($result, $i, 3);\n\t\t\t    $desc = mysql_result($result, $i, 4);\n\t\t\t    if (array_key_exists($url, $results)) {\n\t\t\t\tlist($r,$t,$m,$d,$w,$u) = $results[$url];\n\t\t\t\t$results[$name] = array(($r + $relevance) * 2,\n\t\t\t\t\t\t\t$t,$m,$d,$w,$u);\n\t\t\t    } else {\n\t\t\t\t$id = $name;\n\t\t\t\t$m = strtolower($module);\n\t\t\t\t$u = str_replace(\n\t\t\t\"http://mail.gnome.org/archives/xml/\", \"\", $url);\n\t\t\t\t$results[$url] = array($relevance,$type,\n\t\t\t\t\t\t$u, $desc, $name, $url);\n\t\t\t    }\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t    }\n\t\t}\n\t\tif (($scope == 'any') || ($scope == 'XSLT') ||\n\t\t    ($scope == 'LISTS') || ($scope == 'XSLTLIST')) {\n\t\t    list($result, $j) = XSLTqueryArchiveWord($word);\n\t\t    if ($j > 0) {\n\t\t\tfor ($i = 0; $i < $j; $i++) {\n\t\t\t    $relevance = mysql_result($result, $i, 0);\n\t\t\t    $name = mysql_result($result, $i, 1);\n\t\t\t    $type = mysql_result($result, $i, 2);\n\t\t\t    $url = mysql_result($result, $i, 3);\n\t\t\t    $desc = mysql_result($result, $i, 4);\n\t\t\t    if (array_key_exists($url, $results)) {\n\t\t\t\tlist($r,$t,$m,$d,$w,$u) = $results[$url];\n\t\t\t\t$results[$name] = array(($r + $relevance) * 2,\n\t\t\t\t\t\t\t$t,$m,$d,$w,$u);\n\t\t\t    } else {\n\t\t\t\t$id = $name;\n\t\t\t\t$m = strtolower($module);\n\t\t\t\t$u = str_replace(\n\t\t\t\"http://mail.gnome.org/archives/xslt/\", \"\", $url);\n\t\t\t\t$results[$url] = array($relevance,$type,\n\t\t\t\t\t\t$u, $desc, $name, $url);\n\t\t\t    }\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t    }\n\t\t}\n\t    }\n\t    if ((count($results) == 0) && (count($list) == 1)) {\n\t\t$word = $list[0];\n\t\tif (($scope == 'any') || ($scope == 'XML') ||\n\t\t    ($scope == 'API') || ($scope == 'XMLAPI')) {\n\t\t    list($result, $j) = queryWord(\"xml$word\");\n\t\t    if ($j > 0) {\n\t\t\tfor ($i = 0; $i < $j; $i++) {\n\t\t\t    $relevance = mysql_result($result, $i, 0);\n\t\t\t    $name = mysql_result($result, $i, 1);\n\t\t\t    $type = mysql_result($result, $i, 2);\n\t\t\t    $module = mysql_result($result, $i, 3);\n\t\t\t    $desc = mysql_result($result, $i, 4);\n\t\t\t    if (array_key_exists($name, $results)) {\n\t\t\t\tlist($r,$t,$m,$d,$w,$u) = $results[$name];\n\t\t\t\t$results[$name] = array(($r + $relevance) * 2,\n\t\t\t\t\t\t\t$t,$m,$d,$w,$u);\n\t\t\t    } else {\n\t\t\t\t$id = $name;\n\t\t\t\t$m = strtolower($module);\n\t\t\t\t$url = \"html/libxml-$module.html#$id\";\n\t\t\t\t$results[$name] = array($relevance,$type,\n\t\t\t\t\t\t$module, $desc, $name, $url);\n\t\t\t    }\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t    }\n\t\t}\n\t\tif (($scope == 'any') || ($scope == 'XSLT') ||\n\t\t    ($scope == 'API') || ($scope == 'XSLTAPI')) {\n\t\t    list($result, $j) = XSLTqueryWord(\"xslt$word\");\n\t\t    if ($j > 0) {\n\t\t\tfor ($i = 0; $i < $j; $i++) {\n\t\t\t    $relevance = mysql_result($result, $i, 0);\n\t\t\t    $name = mysql_result($result, $i, 1);\n\t\t\t    $type = mysql_result($result, $i, 2);\n\t\t\t    $module = mysql_result($result, $i, 3);\n\t\t\t    $desc = mysql_result($result, $i, 4);\n\t\t\t    if (array_key_exists($name, $results)) {\n\t\t\t\tlist($r,$t,$m,$d,$w,$u) = $results[$name];\n\t\t\t\t$results[$name] = array(($r + $relevance) * 2,\n\t\t\t\t\t\t\t$t,$m,$d,$w,$u);\n\t\t\t    } else {\n\t\t\t\t$id = $name;\n\t\t\t\t$m = strtolower($module);\n\t\t\t\t$url = \"XSLT/html/libxslt-$module.html#$id\";\n\t\t\t\t$results[$name] = array($relevance,$type,\n\t\t\t\t\t\t$module, $desc, $name, $url);\n\t\t\t    }\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t    }\n\t\t}\n\t    }\n\t    mysql_close($link);\n\t    $nb = count($results);\n\t    echo \"<h3 align='center'>Found $nb results for query $querystr</h3>\\n\";\n\t    usort($results, \"resSort\");\n\n            if ($nb > 0) {\n\t\tprintf(\"<table><tbody>\\n\");\n\t\tprintf(\"<tr><td>Quality</td><td>Symbol</td><td>Type</td><td>module</td><td>Description</td></tr>\\n\");\n\t\t$i = 0;\n\t\twhile (list ($name, $val) = each ($results)) {\n\t\t    list($r,$t,$m,$d,$s,$u) = $val;\n\t\t    $m = str_replace(\"<\", \"&lt;\", $m);\n\t\t    $s = str_replace(\"<\", \"&lt;\", $s);\n\t\t    $d = str_replace(\"<\", \"&lt;\", $d);\n\t\t    echo \"<tr><td>$r</td><td><a href='$u'>$s</a></td><td>$t</td><td>$m</td><td>$d</td></tr>\";\n\t\t    $i = $i + 1;\n\t\t    if ($i > 75)\n\t\t        break;\n\t\t}\n\t\tprintf(\"</tbody></table>\\n\");\n\t    }\n\t}\n    }\n?>\n\n</td></tr></table></td></tr></table></td></tr></table></td>\n</tr></table></td></tr></table>\n</body>\n</html>\n\n", "num_lines": 478}
{"repo_name": "Azure-Apache-Migration-Tool", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n$drupalPath = $argv[1];\n$configFile = $argv[2];\nrequire($drupalPath);\n$fh = fopen($configFile, 'w') or die(\"can't open file\");\n\n$wpSetting = $databases[\"default\"][\"default\"][\"database\"];\nfwrite($fh, \"DB_NAME=$wpSetting\\n\");\n\n$wpSetting = $databases[\"default\"][\"default\"][\"username\"];\nfwrite($fh, \"DB_USER=$wpSetting\\n\");\n\n$wpSetting = $databases[\"default\"][\"default\"][\"password\"];\nfwrite($fh, \"DB_PASSWORD=$wpSetting\\n\");\n\n$wpSetting = $databases[\"default\"][\"default\"][\"host\"];\nfwrite($fh, \"DB_HOST=$wpSetting\\n\");\n\n$files = get_included_files();\nfwrite($fh, \"INCLUDED_FILES=\");\nforeach ($files as $file) \n{ \n    if ($file != __FILE__)\n    {\n        fwrite($fh, \"${file};\");\n    }\n}\n\nfclose($fh);\n?>", "num_lines": 30}
{"repo_name": "Azure-Apache-Migration-Tool", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n$settingsPath = $argv[1];\n$configFile = $argv[2];\nrequire($settingsPath);\n$fh = fopen($configFile, 'w') or die(\"can't open file\");\n\n$config = new JConfig(); \n$setting = $config->db;\nfwrite($fh, \"DB_NAME=$setting\\n\");\n\n$setting = $config->user;\nfwrite($fh, \"DB_USER=$setting\\n\");\n\n$setting = $config->password;\nfwrite($fh, \"DB_PASSWORD=$setting\\n\");\n\n$setting = $config->host;\nfwrite($fh, \"DB_HOST=$setting\\n\");\n\n$files = get_included_files();\nfwrite($fh, \"INCLUDED_FILES=\");\nforeach ($files as $file) \n{ \n    if ($file != __FILE__)\n    {\n        fwrite($fh, \"${file};\");\n    }\n}\n\nfclose($fh);\n?>", "num_lines": 31}
{"repo_name": "Azure-Apache-Migration-Tool", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n$wpPath = $argv[1];\n$configFile = $argv[2];\nrequire($wpPath);\n$fh = fopen($configFile, 'w') or die(\"can't open file\");\n\n$wpSetting = DB_NAME;\nfwrite($fh, \"DB_NAME=$wpSetting\\n\");\n\n$wpSetting = DB_USER;\nfwrite($fh, \"DB_USER=$wpSetting\\n\");\n\n$wpSetting = DB_PASSWORD;\nfwrite($fh, \"DB_PASSWORD=$wpSetting\\n\");\n\n$wpSetting = DB_HOST;\nfwrite($fh, \"DB_HOST=$wpSetting\\n\");\n\n$wpSetting = WP_SITEURL;\nfwrite($fh, \"WP_SITEURL=$wpSetting\\n\");\n\n$files = get_included_files();\nfwrite($fh, \"INCLUDED_FILES=\");\nforeach ($files as $file) \n{ \n    if ($file != __FILE__)\n    {\n        fwrite($fh, \"${file};\");\n    }\n}\n\nfclose($fh);\n?>", "num_lines": 33}
{"repo_name": "Azure-kusto-opentelemetry-demo", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n// Copyright The OpenTelemetry Authors\n// SPDX-License-Identifier: Apache-2.0\n\n\n\ndeclare(strict_types=1);\n\nuse App\\Application\\Settings\\SettingsInterface;\nuse DI\\ContainerBuilder;\nuse Monolog\\Handler\\StreamHandler;\nuse Monolog\\Logger;\nuse Monolog\\Processor\\UidProcessor;\nuse Psr\\Container\\ContainerInterface;\nuse Psr\\Log\\LoggerInterface;\n\nreturn function (ContainerBuilder $containerBuilder) {\n    $containerBuilder->addDefinitions([\n        LoggerInterface::class => function (ContainerInterface $c) {\n            $settings = $c->get(SettingsInterface::class);\n\n            $loggerSettings = $settings->get('logger');\n            $logger = new Logger($loggerSettings['name']);\n\n            $processor = new UidProcessor();\n            $logger->pushProcessor($processor);\n\n            $handler = new StreamHandler($loggerSettings['path'], $loggerSettings['level']);\n            $logger->pushHandler($handler);\n\n            return $logger;\n        },\n    ]);\n};\n", "num_lines": 35}
{"repo_name": "Azure-kusto-opentelemetry-demo", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n// Copyright The OpenTelemetry Authors\n// SPDX-License-Identifier: Apache-2.0\n\n\n\nuse OpenTelemetry\\API\\Common\\Instrumentation\\Globals;\nuse OpenTelemetry\\API\\Trace\\Span;\nuse OpenTelemetry\\API\\Trace\\SpanKind;\nuse Psr\\Http\\Message\\ResponseInterface as Response;\nuse Psr\\Http\\Message\\ServerRequestInterface as Request;\nuse Slim\\App;\n\nfunction calculateQuote($jsonObject): float\n{\n    $quote = 0.0;\n    $childSpan = Globals::tracerProvider()->getTracer('manual-instrumentation')\n        ->spanBuilder('calculate-quote')\n        ->setSpanKind(SpanKind::KIND_INTERNAL)\n        ->startSpan();\n    $childSpan->addEvent('Calculating quote');\n\n    try {\n        if (!array_key_exists('numberOfItems', $jsonObject)) {\n            throw new \\InvalidArgumentException('numberOfItems not provided');\n        }\n        $numberOfItems = intval($jsonObject['numberOfItems']);\n        $quote = round(8.90 * $numberOfItems, 2);\n\n        $childSpan->setAttribute('app.quote.items.count', $numberOfItems);\n        $childSpan->setAttribute('app.quote.cost.total', $quote);\n\n        $childSpan->addEvent('Quote calculated, returning its value');\n    } catch (\\Exception $exception) {\n        $childSpan->recordException($exception);\n    } finally {\n        $childSpan->end();\n        return $quote;\n    }\n}\n\nreturn function (App $app) {\n    $app->post('/getquote', function (Request $request, Response $response) {\n        $span = Span::getCurrent();\n        $span->addEvent('Received get quote request, processing it');\n\n        $jsonObject = $request->getParsedBody();\n\n        $data = calculateQuote($jsonObject);\n\n        $payload = json_encode($data);\n        $response->getBody()->write($payload);\n\n        $span->addEvent('Quote processed, response sent back', [\n            'app.quote.cost.total' => $data\n        ]);\n\n        return $response\n            ->withHeader('Content-Type', 'application/json');\n    });\n};\n", "num_lines": 62}
{"repo_name": "Azure-kusto-opentelemetry-demo", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n// Copyright The OpenTelemetry Authors\n// SPDX-License-Identifier: Apache-2.0\n\n\n\ndeclare(strict_types=1);\n\nuse App\\Application\\Settings\\Settings;\nuse App\\Application\\Settings\\SettingsInterface;\nuse DI\\ContainerBuilder;\nuse Monolog\\Logger;\n\nreturn function (ContainerBuilder $containerBuilder) {\n    // Global Settings Object\n    $containerBuilder->addDefinitions([\n        SettingsInterface::class => function () {\n            return new Settings([\n                'displayErrorDetails' => true, // Should be set to false in production\n                'logError'            => false,\n                'logErrorDetails'     => false,\n                'logger' => [\n                    'name' => 'slim-app',\n                    'path' => 'php://stdout',\n                    'level' => Logger::DEBUG,\n                ],\n            ]);\n        }\n    ]);\n};\n", "num_lines": 31}
{"repo_name": "Azure-kusto-opentelemetry-demo", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n// Copyright The OpenTelemetry Authors\n// SPDX-License-Identifier: Apache-2.0\n\n\n\ndeclare(strict_types=1);\n\nuse DI\\Bridge\\Slim\\Bridge;\nuse DI\\ContainerBuilder;\nuse Monolog\\Handler\\StreamHandler;\nuse Monolog\\Logger;\nuse OpenTelemetry\\API\\Common\\Instrumentation\\Globals;\nuse OpenTelemetry\\API\\Common\\Log\\LoggerHolder;\nuse OpenTelemetry\\SDK\\Common\\Configuration\\Configuration;\nuse OpenTelemetry\\SDK\\Common\\Configuration\\Variables;\nuse OpenTelemetry\\SDK\\Metrics\\MeterProviderInterface;\nuse OpenTelemetry\\SDK\\Trace\\TracerProviderInterface;\nuse Psr\\Http\\Message\\ServerRequestInterface;\nuse Psr\\Log\\LogLevel;\nuse React\\EventLoop\\Loop;\nuse React\\Http\\HttpServer;\nuse React\\Socket\\SocketServer;\nuse Slim\\Factory\\AppFactory;\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nLoggerHolder::set(\n    new Logger('otel-php', [new StreamHandler('php://stdout', LogLevel::DEBUG)])\n);\n\n// Instantiate PHP-DI ContainerBuilder\n$containerBuilder = new ContainerBuilder();\n\n// Set up settings\n$settings = require __DIR__ . '/../app/settings.php';\n$settings($containerBuilder);\n\n// Set up dependencies\n$dependencies = require __DIR__ . '/../app/dependencies.php';\n$dependencies($containerBuilder);\n\n// Build PHP-DI Container instance\n$container = $containerBuilder->build();\n\n// Instantiate the app\nAppFactory::setContainer($container);\n$app = Bridge::create($container);\n\n// Register middleware\n$app->addRoutingMiddleware();\n\n// Register routes\n$routes = require __DIR__ . '/../app/routes.php';\n$routes($app);\n\n// Add Body Parsing Middleware\n$app->addBodyParsingMiddleware();\n\n// Add Error Middleware\n$errorMiddleware = $app->addErrorMiddleware(true, true, true);\nLoop::get()->addSignal(SIGTERM, function() {\n    exit;\n});\n\n/* workaround for non-async batch processors */\nif (($tracerProvider = Globals::tracerProvider()) instanceof TracerProviderInterface) {\n    Loop::addPeriodicTimer(Configuration::getInt(Variables::OTEL_BSP_SCHEDULE_DELAY)/1000, function() use ($tracerProvider) {\n        $tracerProvider->forceFlush();\n    });\n}\nif (($meterProvider = Globals::meterProvider()) instanceof MeterProviderInterface) {\n    Loop::addPeriodicTimer(Configuration::getInt(Variables::OTEL_METRIC_EXPORT_INTERVAL)/1000, function() use ($meterProvider) {\n        $meterProvider->forceFlush();\n    });\n}\n\n$server = new HttpServer(function (ServerRequestInterface $request) use ($app) {\n    $response = $app->handle($request);\n    echo sprintf('[%s] \"%s %s HTTP/%s\" %d %d %s',\n        date('Y-m-d H:i:sP'),\n        $request->getMethod(),\n        $request->getUri()->getPath(),\n        $request->getProtocolVersion(),\n        $response->getStatusCode(),\n        $response->getBody()->getSize(),\n        PHP_EOL,\n    );\n\n    return $response;\n});\n$address = '0.0.0.0:' . getenv('QUOTE_SERVICE_PORT');\n$socket = new SocketServer($address);\n$server->listen($socket);\n\necho \"Listening on: {$address}\" . PHP_EOL;\n", "num_lines": 97}
{"repo_name": "Azure-kusto-opentelemetry-demo", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n// Copyright The OpenTelemetry Authors\n// SPDX-License-Identifier: Apache-2.0\n\n\n\ndeclare(strict_types=1);\n\nnamespace App\\Application\\Settings;\n\nclass Settings implements SettingsInterface\n{\n    private array $settings;\n\n    public function __construct(array $settings)\n    {\n        $this->settings = $settings;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function get(string $key = '')\n    {\n        return (empty($key)) ? $this->settings : $this->settings[$key];\n    }\n}\n", "num_lines": 28}
{"repo_name": "Azure-kusto-opentelemetry-demo", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n// Copyright The OpenTelemetry Authors\n// SPDX-License-Identifier: Apache-2.0\n\n\n\ndeclare(strict_types=1);\n\nnamespace App\\Application\\Settings;\n\ninterface SettingsInterface\n{\n    /**\n     * @param string $key\n     * @return mixed\n     */\n    public function get(string $key = '');\n}\n", "num_lines": 19}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Front to the WordPress application. This file doesn't do anything, but loads\n * wp-blog-header.php which does and tells WordPress to load the theme.\n *\n * @package WordPress\n */\n\n\n/**\n * Tells WordPress to load the WordPress theme and output it.\n *\n * @var bool\n */\ndefine( 'WP_USE_THEMES', true );\n\n/** Loads the WordPress Environment and Template */\nrequire __DIR__ . '/wp-blog-header.php';\n", "num_lines": 19}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Confirms that the activation key that is sent in an email after a user signs\n * up for a new site matches the key for that user and then displays confirmation.\n *\n * @package WordPress\n */\n\ndefine( 'WP_INSTALLING', true );\n\n/** Sets up the WordPress Environment. */\nrequire __DIR__ . '/wp-load.php';\n\nrequire __DIR__ . '/wp-blog-header.php';\n\nif ( ! is_multisite() ) {\n\twp_redirect( wp_registration_url() );\n\tdie();\n}\n\n$valid_error_codes = array( 'already_active', 'blog_taken' );\n\nlist( $activate_path ) = explode( '?', wp_unslash( $_SERVER['REQUEST_URI'] ) );\n$activate_cookie       = 'wp-activate-' . COOKIEHASH;\n\n$key    = '';\n$result = null;\n\nif ( isset( $_GET['key'] ) && isset( $_POST['key'] ) && $_GET['key'] !== $_POST['key'] ) {\n\twp_die( __( 'A key value mismatch has been detected. Please follow the link provided in your activation email.' ), __( 'An error occurred during the activation' ), 400 );\n} elseif ( ! empty( $_GET['key'] ) ) {\n\t$key = $_GET['key'];\n} elseif ( ! empty( $_POST['key'] ) ) {\n\t$key = $_POST['key'];\n}\n\nif ( $key ) {\n\t$redirect_url = remove_query_arg( 'key' );\n\n\tif ( remove_query_arg( false ) !== $redirect_url ) {\n\t\tsetcookie( $activate_cookie, $key, 0, $activate_path, COOKIE_DOMAIN, is_ssl(), true );\n\t\twp_safe_redirect( $redirect_url );\n\t\texit;\n\t} else {\n\t\t$result = wpmu_activate_signup( $key );\n\t}\n}\n\nif ( null === $result && isset( $_COOKIE[ $activate_cookie ] ) ) {\n\t$key    = $_COOKIE[ $activate_cookie ];\n\t$result = wpmu_activate_signup( $key );\n\tsetcookie( $activate_cookie, ' ', time() - YEAR_IN_SECONDS, $activate_path, COOKIE_DOMAIN, is_ssl(), true );\n}\n\nif ( null === $result || ( is_wp_error( $result ) && 'invalid_key' === $result->get_error_code() ) ) {\n\tstatus_header( 404 );\n} elseif ( is_wp_error( $result ) ) {\n\t$error_code = $result->get_error_code();\n\n\tif ( ! in_array( $error_code, $valid_error_codes, true ) ) {\n\t\tstatus_header( 400 );\n\t}\n}\n\nnocache_headers();\n\nif ( is_object( $wp_object_cache ) ) {\n\t$wp_object_cache->cache_enabled = false;\n}\n\n// Fix for page title.\n$wp_query->is_404 = false;\n\n/**\n * Fires before the Site Activation page is loaded.\n *\n * @since 3.0.0\n */\ndo_action( 'activate_header' );\n\n/**\n * Adds an action hook specific to this page.\n *\n * Fires on {@see 'wp_head'}.\n *\n * @since MU (3.0.0)\n */\nfunction do_activate_header() {\n\t/**\n\t * Fires before the Site Activation page is loaded.\n\t *\n\t * Fires on the {@see 'wp_head'} action.\n\t *\n\t * @since 3.0.0\n\t */\n\tdo_action( 'activate_wp_head' );\n}\nadd_action( 'wp_head', 'do_activate_header' );\n\n/**\n * Loads styles specific to this page.\n *\n * @since MU (3.0.0)\n */\nfunction wpmu_activate_stylesheet() {\n\t?>\n\t<style type=\"text/css\">\n\t\tform { margin-top: 2em; }\n\t\t#submit, #key { width: 90%; font-size: 24px; }\n\t\t#language { margin-top: .5em; }\n\t\t.error { background: #f66; }\n\t\tspan.h3 { padding: 0 8px; font-size: 1.3em; font-weight: 600; }\n\t</style>\n\t<?php\n}\nadd_action( 'wp_head', 'wpmu_activate_stylesheet' );\nadd_action( 'wp_head', 'wp_sensitive_page_meta' );\n\nget_header( 'wp-activate' );\n\n$blog_details = get_blog_details();\n?>\n\n<div id=\"signup-content\" class=\"widecolumn\">\n\t<div class=\"wp-activate-container\">\n\t<?php if ( ! $key ) { ?>\n\n\t\t<h2><?php _e( 'Activation Key Required' ); ?></h2>\n\t\t<form name=\"activateform\" id=\"activateform\" method=\"post\" action=\"<?php echo network_site_url( $blog_details->path . 'wp-activate.php' ); ?>\">\n\t\t\t<p>\n\t\t\t\t<label for=\"key\"><?php _e( 'Activation Key:' ); ?></label>\n\t\t\t\t<br /><input type=\"text\" name=\"key\" id=\"key\" value=\"\" size=\"50\" />\n\t\t\t</p>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input id=\"submit\" type=\"submit\" name=\"Submit\" class=\"submit\" value=\"<?php esc_attr_e( 'Activate' ); ?>\" />\n\t\t\t</p>\n\t\t</form>\n\n\t\t<?php\n\t} else {\n\t\tif ( is_wp_error( $result ) && in_array( $result->get_error_code(), $valid_error_codes, true ) ) {\n\t\t\t$signup = $result->get_error_data();\n\t\t\t?>\n\t\t\t<h2><?php _e( 'Your account is now active!' ); ?></h2>\n\t\t\t<?php\n\t\t\techo '<p class=\"lead-in\">';\n\t\t\tif ( '' === $signup->domain . $signup->path ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: Login URL, 2: Username, 3: User email address, 4: Lost password URL. */\n\t\t\t\t\t__( 'Your account has been activated. You may now <a href=\"%1$s\">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href=\"%4$s\">reset your password</a>.' ),\n\t\t\t\t\tnetwork_site_url( $blog_details->path . 'wp-login.php', 'login' ),\n\t\t\t\t\t$signup->user_login,\n\t\t\t\t\t$signup->user_email,\n\t\t\t\t\twp_lostpassword_url()\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: Site URL, 2: Username, 3: User email address, 4: Lost password URL. */\n\t\t\t\t\t__( 'Your site at %1$s is active. You may now log in to your site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href=\"%4$s\">reset your password</a>.' ),\n\t\t\t\t\tsprintf( '<a href=\"http://%1$s%2$s\">%1$s%2$s</a>', $signup->domain, $blog_details->path ),\n\t\t\t\t\t$signup->user_login,\n\t\t\t\t\t$signup->user_email,\n\t\t\t\t\twp_lostpassword_url()\n\t\t\t\t);\n\t\t\t}\n\t\t\techo '</p>';\n\t\t} elseif ( null === $result || is_wp_error( $result ) ) {\n\t\t\t?>\n\t\t\t<h2><?php _e( 'An error occurred during the activation' ); ?></h2>\n\t\t\t<?php if ( is_wp_error( $result ) ) : ?>\n\t\t\t\t<p><?php echo $result->get_error_message(); ?></p>\n\t\t\t<?php endif; ?>\n\t\t\t<?php\n\t\t} else {\n\t\t\t$url  = isset( $result['blog_id'] ) ? get_home_url( (int) $result['blog_id'] ) : '';\n\t\t\t$user = get_userdata( (int) $result['user_id'] );\n\t\t\t?>\n\t\t\t<h2><?php _e( 'Your account is now active!' ); ?></h2>\n\n\t\t\t<div id=\"signup-welcome\">\n\t\t\t<p><span class=\"h3\"><?php _e( 'Username:' ); ?></span> <?php echo $user->user_login; ?></p>\n\t\t\t<p><span class=\"h3\"><?php _e( 'Password:' ); ?></span> <?php echo $result['password']; ?></p>\n\t\t\t</div>\n\n\t\t\t<?php\n\t\t\tif ( $url && network_home_url( '', 'http' ) !== $url ) :\n\t\t\t\tswitch_to_blog( (int) $result['blog_id'] );\n\t\t\t\t$login_url = wp_login_url();\n\t\t\t\trestore_current_blog();\n\t\t\t\t?>\n\t\t\t\t<p class=\"view\">\n\t\t\t\t<?php\n\t\t\t\t\t/* translators: 1: Site URL, 2: Login URL. */\n\t\t\t\t\tprintf( __( 'Your account is now activated. <a href=\"%1$s\">View your site</a> or <a href=\"%2$s\">Log in</a>' ), $url, esc_url( $login_url ) );\n\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t<?php else : ?>\n\t\t\t\t<p class=\"view\">\n\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: Login URL, 2: Network home URL. */\n\t\t\t\t\t\t__( 'Your account is now activated. <a href=\"%1$s\">Log in</a> or go back to the <a href=\"%2$s\">homepage</a>.' ),\n\t\t\t\t\t\tnetwork_site_url( $blog_details->path . 'wp-login.php', 'login' ),\n\t\t\t\t\t\tnetwork_home_url( $blog_details->path )\n\t\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t\t<?php\n\t\t\t\tendif;\n\t\t}\n\t}\n\t?>\n\t</div>\n</div>\n<script type=\"text/javascript\">\n\tvar key_input = document.getElementById('key');\n\tkey_input && key_input.focus();\n</script>\n<?php\nget_footer( 'wp-activate' );\n", "num_lines": 221}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Loads the WordPress environment and template.\n *\n * @package WordPress\n */\n\nif ( ! isset( $wp_did_header ) ) {\n\n\t$wp_did_header = true;\n\n\t// Load the WordPress library.\n\trequire_once __DIR__ . '/wp-load.php';\n\n\t// Set up the WordPress query.\n\twp();\n\n\t// Load the theme template.\n\trequire_once ABSPATH . WPINC . '/template-loader.php';\n\n}\n", "num_lines": 22}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Handles Comment Post to WordPress and prevents duplicate comment posting.\n *\n * @package WordPress\n */\n\nif ( 'POST' !== $_SERVER['REQUEST_METHOD'] ) {\n\t$protocol = $_SERVER['SERVER_PROTOCOL'];\n\tif ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ), true ) ) {\n\t\t$protocol = 'HTTP/1.0';\n\t}\n\n\theader( 'Allow: POST' );\n\theader( \"$protocol 405 Method Not Allowed\" );\n\theader( 'Content-Type: text/plain' );\n\texit;\n}\n\n/** Sets up the WordPress Environment. */\nrequire __DIR__ . '/wp-load.php';\n\nnocache_headers();\n\n$comment = wp_handle_comment_submission( wp_unslash( $_POST ) );\nif ( is_wp_error( $comment ) ) {\n\t$data = intval( $comment->get_error_data() );\n\tif ( ! empty( $data ) ) {\n\t\twp_die(\n\t\t\t'<p>' . $comment->get_error_message() . '</p>',\n\t\t\t__( 'Comment Submission Failure' ),\n\t\t\tarray(\n\t\t\t\t'response'  => $data,\n\t\t\t\t'back_link' => true,\n\t\t\t)\n\t\t);\n\t} else {\n\t\texit;\n\t}\n}\n\n$user            = wp_get_current_user();\n$cookies_consent = ( isset( $_POST['wp-comment-cookies-consent'] ) );\n\n/**\n * Perform other actions when comment cookies are set.\n *\n * @since 3.4.0\n * @since 4.9.6 The `$cookies_consent` parameter was added.\n *\n * @param WP_Comment $comment         Comment object.\n * @param WP_User    $user            Comment author's user object. The user may not exist.\n * @param bool       $cookies_consent Comment author's consent to store cookies.\n */\ndo_action( 'set_comment_cookies', $comment, $user, $cookies_consent );\n\n$location = empty( $_POST['redirect_to'] ) ? get_comment_link( $comment ) : $_POST['redirect_to'] . '#comment-' . $comment->comment_ID;\n\n// If user didn't consent to cookies, add specific query arguments to display the awaiting moderation message.\nif ( ! $cookies_consent && 'unapproved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_author_email ) ) {\n\t$location = add_query_arg(\n\t\tarray(\n\t\t\t'unapproved'      => $comment->comment_ID,\n\t\t\t'moderation-hash' => wp_hash( $comment->comment_date_gmt ),\n\t\t),\n\t\t$location\n\t);\n}\n\n/**\n * Filters the location URI to send the commenter after posting.\n *\n * @since 2.0.5\n *\n * @param string     $location The 'redirect_to' URI sent via $_POST.\n * @param WP_Comment $comment  Comment object.\n */\n$location = apply_filters( 'comment_post_redirect', $location, $comment );\n\nwp_safe_redirect( $location );\nexit;\n", "num_lines": 82}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://wordpress.org/support/article/editing-wp-config-php/\n *\n * @package WordPress\n */\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\ndefine( 'DB_NAME', 'database_name_here' );\n\n/** MySQL database username */\ndefine( 'DB_USER', 'username_here' );\n\n/** MySQL database password */\ndefine( 'DB_PASSWORD', 'password_here' );\n\n/** MySQL hostname */\ndefine( 'DB_HOST', 'localhost' );\n\n/** Database Charset to use in creating database tables. */\ndefine( 'DB_CHARSET', 'utf8' );\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine( 'DB_COLLATE', '' );\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine( 'AUTH_KEY',         'put your unique phrase here' );\ndefine( 'SECURE_AUTH_KEY',  'put your unique phrase here' );\ndefine( 'LOGGED_IN_KEY',    'put your unique phrase here' );\ndefine( 'NONCE_KEY',        'put your unique phrase here' );\ndefine( 'AUTH_SALT',        'put your unique phrase here' );\ndefine( 'SECURE_AUTH_SALT', 'put your unique phrase here' );\ndefine( 'LOGGED_IN_SALT',   'put your unique phrase here' );\ndefine( 'NONCE_SALT',       'put your unique phrase here' );\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the documentation.\n *\n * @link https://wordpress.org/support/article/debugging-in-wordpress/\n */\ndefine( 'WP_DEBUG', false );\n\n/* That's all, stop editing! Happy publishing. */\n\n/** Absolute path to the WordPress directory. */\nif ( ! defined( 'ABSPATH' ) ) {\n\tdefine( 'ABSPATH', __DIR__ . '/' );\n}\n\n/** Sets up WordPress vars and included files. */\nrequire_once ABSPATH . 'wp-settings.php';\n", "num_lines": 91}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The base configuration for WordPress\n *\n * The wp-config.php creation script uses this file during the\n * installation. You don't have to use the web site, you can\n * copy this file to \"wp-config.php\" and fill in the values.\n *\n * This file contains the following configurations:\n *\n * * MySQL settings\n * * Secret keys\n * * Database table prefix\n * * ABSPATH\n *\n * @link https://codex.wordpress.org/Editing_wp-config.php\n *\n * @package WordPress\n */\n\n//Using environment variables for DB connection information\n\n// ** MySQL settings - You can get this info from your web host ** //\n/** The name of the database for WordPress */\n\n$connectstr_dbhost = getenv('DATABASE_HOST');\n$connectstr_dbname = 'flexibleserverdb';\n$connectstr_dbusername = getenv('DATABASE_USERNAME');\n$connectstr_dbpassword = getenv('DATABASE_PASSWORD');\n\n\ndefine('DB_NAME', $connectstr_dbname);\n\n/** MySQL database username */\ndefine('DB_USER', $connectstr_dbusername);\n\n/** MySQL database password */\ndefine('DB_PASSWORD',$connectstr_dbpassword);\n\n/** MySQL hostname */\ndefine('DB_HOST', $connectstr_dbhost);\n\n/** Database Charset to use in creating database tables. */\ndefine('DB_CHARSET', 'utf8');\n\n/** The Database Collate type. Don't change this if in doubt. */\ndefine('DB_COLLATE', '');\n\n\n/** SSL*/\ndefine('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL);\n\n\n/**#@+\n * Authentication Unique Keys and Salts.\n *\n * Change these to different unique phrases!\n * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}\n * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.\n *\n * @since 2.6.0\n */\ndefine('AUTH_KEY',         'put your unique phrase here');\ndefine('SECURE_AUTH_KEY',  'put your unique phrase here');\ndefine('LOGGED_IN_KEY',    'put your unique phrase here');\ndefine('NONCE_KEY',        'put your unique phrase here');\ndefine('AUTH_SALT',        'put your unique phrase here');\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');\ndefine('LOGGED_IN_SALT',   'put your unique phrase here');\ndefine('NONCE_SALT',       'put your unique phrase here');\n\n/**#@-*/\n\n/**\n * WordPress Database Table prefix.\n *\n * You can have multiple installations in one database if you give each\n * a unique prefix. Only numbers, letters, and underscores please!\n */\n$table_prefix  = 'wp_';\n\n/**\n * For developers: WordPress debugging mode.\n *\n * Change this to true to enable the display of notices during development.\n * It is strongly recommended that plugin and theme developers use WP_DEBUG\n * in their development environments.\n *\n * For information on other constants that can be used for debugging,\n * visit the Codex.\n *\n * @link https://codex.wordpress.org/Debugging_in_WordPress\n */\ndefine('WP_DEBUG', false);\n\n/* That's all, stop editing! Happy blogging. */\n\n//Relative URLs for swapping across app service deployment slots \ndefine('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\ndefine('WP_CONTENT_URL', '/wp-content');\ndefine('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));\n\n\n/** Absolute path to the WordPress directory. */\nif ( !defined('ABSPATH') )\n\tdefine('ABSPATH', dirname(__FILE__) . '/');\n\n/** Sets up WordPress vars and included files. */\nrequire_once(ABSPATH . 'wp-settings.php');\n", "num_lines": 111}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * A pseudo-CRON daemon for scheduling WordPress tasks\n *\n * WP Cron is triggered when the site receives a visit. In the scenario\n * where a site may not receive enough visits to execute scheduled tasks\n * in a timely manner, this file can be called directly or via a server\n * CRON daemon for X number of times.\n *\n * Defining DISABLE_WP_CRON as true and calling this file directly are\n * mutually exclusive and the latter does not rely on the former to work.\n *\n * The HTTP request to this file will not slow down the visitor who happens to\n * visit when the cron job is needed to run.\n *\n * @package WordPress\n */\n\nignore_user_abort( true );\n\n/* Don't make the request block till we finish, if possible. */\nif ( function_exists( 'fastcgi_finish_request' ) && version_compare( phpversion(), '7.0.16', '>=' ) ) {\n\tif ( ! headers_sent() ) {\n\t\theader( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );\n\t\theader( 'Cache-Control: no-cache, must-revalidate, max-age=0' );\n\t}\n\n\tfastcgi_finish_request();\n}\n\nif ( ! empty( $_POST ) || defined( 'DOING_AJAX' ) || defined( 'DOING_CRON' ) ) {\n\tdie();\n}\n\n/**\n * Tell WordPress we are doing the CRON task.\n *\n * @var bool\n */\ndefine( 'DOING_CRON', true );\n\nif ( ! defined( 'ABSPATH' ) ) {\n\t/** Set up WordPress environment */\n\trequire_once __DIR__ . '/wp-load.php';\n}\n\n/**\n * Retrieves the cron lock.\n *\n * Returns the uncached `doing_cron` transient.\n *\n * @ignore\n * @since 3.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @return string|false Value of the `doing_cron` transient, 0|false otherwise.\n */\nfunction _get_cron_lock() {\n\tglobal $wpdb;\n\n\t$value = 0;\n\tif ( wp_using_ext_object_cache() ) {\n\t\t/*\n\t\t * Skip local cache and force re-fetch of doing_cron transient\n\t\t * in case another process updated the cache.\n\t\t */\n\t\t$value = wp_cache_get( 'doing_cron', 'transient', true );\n\t} else {\n\t\t$row = $wpdb->get_row( $wpdb->prepare( \"SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1\", '_transient_doing_cron' ) );\n\t\tif ( is_object( $row ) ) {\n\t\t\t$value = $row->option_value;\n\t\t}\n\t}\n\n\treturn $value;\n}\n\n$crons = wp_get_ready_cron_jobs();\nif ( empty( $crons ) ) {\n\tdie();\n}\n\n$gmt_time = microtime( true );\n\n// The cron lock: a unix timestamp from when the cron was spawned.\n$doing_cron_transient = get_transient( 'doing_cron' );\n\n// Use global $doing_wp_cron lock, otherwise use the GET lock. If no lock, try to grab a new lock.\nif ( empty( $doing_wp_cron ) ) {\n\tif ( empty( $_GET['doing_wp_cron'] ) ) {\n\t\t// Called from external script/job. Try setting a lock.\n\t\tif ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $gmt_time ) ) {\n\t\t\treturn;\n\t\t}\n\t\t$doing_wp_cron        = sprintf( '%.22F', microtime( true ) );\n\t\t$doing_cron_transient = $doing_wp_cron;\n\t\tset_transient( 'doing_cron', $doing_wp_cron );\n\t} else {\n\t\t$doing_wp_cron = $_GET['doing_wp_cron'];\n\t}\n}\n\n/*\n * The cron lock (a unix timestamp set when the cron was spawned),\n * must match $doing_wp_cron (the \"key\").\n */\nif ( $doing_cron_transient !== $doing_wp_cron ) {\n\treturn;\n}\n\nforeach ( $crons as $timestamp => $cronhooks ) {\n\tif ( $timestamp > $gmt_time ) {\n\t\tbreak;\n\t}\n\n\tforeach ( $cronhooks as $hook => $keys ) {\n\n\t\tforeach ( $keys as $k => $v ) {\n\n\t\t\t$schedule = $v['schedule'];\n\n\t\t\tif ( $schedule ) {\n\t\t\t\twp_reschedule_event( $timestamp, $schedule, $hook, $v['args'] );\n\t\t\t}\n\n\t\t\twp_unschedule_event( $timestamp, $hook, $v['args'] );\n\n\t\t\t/**\n\t\t\t * Fires scheduled events.\n\t\t\t *\n\t\t\t * @ignore\n\t\t\t * @since 2.1.0\n\t\t\t *\n\t\t\t * @param string $hook Name of the hook that was scheduled to be fired.\n\t\t\t * @param array  $args The arguments to be passed to the hook.\n\t\t\t */\n\t\t\tdo_action_ref_array( $hook, $v['args'] );\n\n\t\t\t// If the hook ran too long and another cron process stole the lock, quit.\n\t\t\tif ( _get_cron_lock() !== $doing_wp_cron ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n}\n\nif ( _get_cron_lock() === $doing_wp_cron ) {\n\tdelete_transient( 'doing_cron' );\n}\n\ndie();\n", "num_lines": 153}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Outputs the OPML XML format for getting the links defined in the link\n * administration. This can be used to export links from one blog over to\n * another. Links aren't exported by the WordPress export, so this file handles\n * that.\n *\n * This file is not added by default to WordPress theme pages when outputting\n * feed links. It will have to be added manually for browsers and users to pick\n * up that this file exists.\n *\n * @package WordPress\n */\n\nrequire_once __DIR__ . '/wp-load.php';\n\nheader( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );\n$link_cat = '';\nif ( ! empty( $_GET['link_cat'] ) ) {\n\t$link_cat = $_GET['link_cat'];\n\tif ( ! in_array( $link_cat, array( 'all', '0' ), true ) ) {\n\t\t$link_cat = absint( (string) urldecode( $link_cat ) );\n\t}\n}\n\necho '<?xml version=\"1.0\"?' . \">\\n\";\n?>\n<opml version=\"1.0\">\n\t<head>\n\t\t<title>\n\t\t<?php\n\t\t\t/* translators: %s: Site title. */\n\t\t\tprintf( __( 'Links for %s' ), esc_attr( get_bloginfo( 'name', 'display' ) ) );\n\t\t?>\n\t\t</title>\n\t\t<dateCreated><?php echo gmdate( 'D, d M Y H:i:s' ); ?> GMT</dateCreated>\n\t\t<?php\n\t\t/**\n\t\t * Fires in the OPML header.\n\t\t *\n\t\t * @since 3.0.0\n\t\t */\n\t\tdo_action( 'opml_head' );\n\t\t?>\n\t</head>\n\t<body>\n<?php\nif ( empty( $link_cat ) ) {\n\t$cats = get_categories(\n\t\tarray(\n\t\t\t'taxonomy'     => 'link_category',\n\t\t\t'hierarchical' => 0,\n\t\t)\n\t);\n} else {\n\t$cats = get_categories(\n\t\tarray(\n\t\t\t'taxonomy'     => 'link_category',\n\t\t\t'hierarchical' => 0,\n\t\t\t'include'      => $link_cat,\n\t\t)\n\t);\n}\n\nforeach ( (array) $cats as $cat ) :\n\t/** This filter is documented in wp-includes/bookmark-template.php */\n\t$catname = apply_filters( 'link_category', $cat->name );\n\n\t?>\n<outline type=\"category\" title=\"<?php echo esc_attr( $catname ); ?>\">\n\t<?php\n\t$bookmarks = get_bookmarks( array( 'category' => $cat->term_id ) );\n\tforeach ( (array) $bookmarks as $bookmark ) :\n\t\t/**\n\t\t * Filters the OPML outline link title text.\n\t\t *\n\t\t * @since 2.2.0\n\t\t *\n\t\t * @param string $title The OPML outline title text.\n\t\t */\n\t\t$title = apply_filters( 'link_title', $bookmark->link_name );\n\t\t?>\n<outline text=\"<?php echo esc_attr( $title ); ?>\" type=\"link\" xmlUrl=\"<?php echo esc_attr( $bookmark->link_rss ); ?>\" htmlUrl=\"<?php echo esc_attr( $bookmark->link_url ); ?>\" updated=\"\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( '0000-00-00 00:00:00' !== $bookmark->link_updated ) {\n\t\t\t\t\t\t\t\techo $bookmark->link_updated;}\n\t\t\t\t\t\t\t?>\n\" />\n\t\t<?php\n\tendforeach; // $bookmarks\n\t?>\n</outline>\n\t<?php\nendforeach; // $cats\n?>\n</body>\n</opml>\n", "num_lines": 98}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Bootstrap file for setting the ABSPATH constant\n * and loading the wp-config.php file. The wp-config.php\n * file will then load the wp-settings.php file, which\n * will then set up the WordPress environment.\n *\n * If the wp-config.php file is not found then an error\n * will be displayed asking the visitor to set up the\n * wp-config.php file.\n *\n * Will also search for wp-config.php in WordPress' parent\n * directory to allow the WordPress directory to remain\n * untouched.\n *\n * @package WordPress\n */\n\n/** Define ABSPATH as this file's directory */\nif ( ! defined( 'ABSPATH' ) ) {\n\tdefine( 'ABSPATH', __DIR__ . '/' );\n}\n\nerror_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );\n\n/*\n * If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php\n * doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit\n * of avoiding cases where the current directory is a nested installation, e.g. / is WordPress(a)\n * and /blog/ is WordPress(b).\n *\n * If neither set of conditions is true, initiate loading the setup process.\n */\nif ( file_exists( ABSPATH . 'wp-config.php' ) ) {\n\n\t/** The config file resides in ABSPATH */\n\trequire_once ABSPATH . 'wp-config.php';\n\n} elseif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) {\n\n\t/** The config file resides one level above ABSPATH but is not part of another installation */\n\trequire_once dirname( ABSPATH ) . '/wp-config.php';\n\n} else {\n\n\t// A config file doesn't exist.\n\n\tdefine( 'WPINC', 'wp-includes' );\n\trequire_once ABSPATH . WPINC . '/load.php';\n\n\t// Standardize $_SERVER variables across setups.\n\twp_fix_server_vars();\n\n\trequire_once ABSPATH . WPINC . '/functions.php';\n\n\t$path = wp_guess_url() . '/wp-admin/setup-config.php';\n\n\t/*\n\t * We're going to redirect to setup-config.php. While this shouldn't result\n\t * in an infinite loop, that's a silly thing to assume, don't you think? If\n\t * we're traveling in circles, our last-ditch effort is \"Need more help?\"\n\t */\n\tif ( false === strpos( $_SERVER['REQUEST_URI'], 'setup-config' ) ) {\n\t\theader( 'Location: ' . $path );\n\t\texit;\n\t}\n\n\tdefine( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );\n\trequire_once ABSPATH . WPINC . '/version.php';\n\n\twp_check_php_mysql_versions();\n\twp_load_translations_early();\n\n\t// Die with an error message\n\t$die = sprintf(\n\t\t/* translators: %s: wp-config.php */\n\t\t__( \"There doesn't seem to be a %s file. I need this before we can get started.\" ),\n\t\t'<code>wp-config.php</code>'\n\t) . '</p>';\n\t$die .= '<p>' . sprintf(\n\t\t/* translators: %s: Documentation URL. */\n\t\t__( \"Need more help? <a href='%s'>We got it</a>.\" ),\n\t\t__( 'https://wordpress.org/support/article/editing-wp-config-php/' )\n\t) . '</p>';\n\t$die .= '<p>' . sprintf(\n\t\t/* translators: %s: wp-config.php */\n\t\t__( \"You can create a %s file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.\" ),\n\t\t'<code>wp-config.php</code>'\n\t) . '</p>';\n\t$die .= '<p><a href=\"' . $path . '\" class=\"button button-large\">' . __( 'Create a Configuration File' ) . '</a>';\n\n\twp_die( $die, __( 'WordPress &rsaquo; Error' ) );\n}\n", "num_lines": 94}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress User Page\n *\n * Handles authentication, registering, resetting passwords, forgot password,\n * and other user handling.\n *\n * @package WordPress\n */\n\n/** Make sure that the WordPress bootstrap has run before continuing. */\nrequire __DIR__ . '/wp-load.php';\n\n// Redirect to HTTPS login if forced to use SSL.\nif ( force_ssl_admin() && ! is_ssl() ) {\n\tif ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {\n\t\twp_safe_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );\n\t\texit;\n\t} else {\n\t\twp_safe_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );\n\t\texit;\n\t}\n}\n\n/**\n * Output the login page header.\n *\n * @since 2.1.0\n *\n * @global string      $error         Login error message set by deprecated pluggable wp_login() function\n *                                    or plugins replacing it.\n * @global bool|string $interim_login Whether interim login modal is being displayed. String 'success'\n *                                    upon successful login.\n * @global string      $action        The action that brought the visitor to the login page.\n *\n * @param string   $title    Optional. WordPress login Page title to display in the `<title>` element.\n *                           Default 'Log In'.\n * @param string   $message  Optional. Message to display in header. Default empty.\n * @param WP_Error $wp_error Optional. The error to pass. Default is a WP_Error instance.\n */\nfunction login_header( $title = 'Log In', $message = '', $wp_error = null ) {\n\tglobal $error, $interim_login, $action;\n\n\t// Don't index any of these forms.\n\tadd_action( 'login_head', 'wp_sensitive_page_meta' );\n\n\tadd_action( 'login_head', 'wp_login_viewport_meta' );\n\n\tif ( ! is_wp_error( $wp_error ) ) {\n\t\t$wp_error = new WP_Error();\n\t}\n\n\t// Shake it!\n\t$shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password', 'retrieve_password_email_failure' );\n\t/**\n\t * Filters the error codes array for shaking the login form.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param array $shake_error_codes Error codes that shake the login form.\n\t */\n\t$shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes );\n\n\tif ( $shake_error_codes && $wp_error->has_errors() && in_array( $wp_error->get_error_code(), $shake_error_codes, true ) ) {\n\t\tadd_action( 'login_footer', 'wp_shake_js', 12 );\n\t}\n\n\t$login_title = get_bloginfo( 'name', 'display' );\n\n\t/* translators: Login screen title. 1: Login screen name, 2: Network or site name. */\n\t$login_title = sprintf( __( '%1$s &lsaquo; %2$s &#8212; WordPress' ), $title, $login_title );\n\n\tif ( wp_is_recovery_mode() ) {\n\t\t/* translators: %s: Login screen title. */\n\t\t$login_title = sprintf( __( 'Recovery Mode &#8212; %s' ), $login_title );\n\t}\n\n\t/**\n\t * Filters the title tag content for login page.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param string $login_title The page title, with extra context added.\n\t * @param string $title       The original page title.\n\t */\n\t$login_title = apply_filters( 'login_title', $login_title, $title );\n\n\t?><!DOCTYPE html>\n\t<html <?php language_attributes(); ?>>\n\t<head>\n\t<meta http-equiv=\"Content-Type\" content=\"<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>\" />\n\t<title><?php echo $login_title; ?></title>\n\t<?php\n\n\twp_enqueue_style( 'login' );\n\n\t/*\n\t * Remove all stored post data on logging out.\n\t * This could be added by add_action('login_head'...) like wp_shake_js(),\n\t * but maybe better if it's not removable by plugins.\n\t */\n\tif ( 'loggedout' === $wp_error->get_error_code() ) {\n\t\t?>\n\t\t<script>if(\"sessionStorage\" in window){try{for(var key in sessionStorage){if(key.indexOf(\"wp-autosave-\")!=-1){sessionStorage.removeItem(key)}}}catch(e){}};</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * Enqueue scripts and styles for the login page.\n\t *\n\t * @since 3.1.0\n\t */\n\tdo_action( 'login_enqueue_scripts' );\n\n\t/**\n\t * Fires in the login page header after scripts are enqueued.\n\t *\n\t * @since 2.1.0\n\t */\n\tdo_action( 'login_head' );\n\n\t$login_header_url = __( 'https://wordpress.org/' );\n\n\t/**\n\t * Filters link URL of the header logo above login form.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $login_header_url Login header logo URL.\n\t */\n\t$login_header_url = apply_filters( 'login_headerurl', $login_header_url );\n\n\t$login_header_title = '';\n\n\t/**\n\t * Filters the title attribute of the header logo above login form.\n\t *\n\t * @since 2.1.0\n\t * @deprecated 5.2.0 Use {@see 'login_headertext'} instead.\n\t *\n\t * @param string $login_header_title Login header logo title attribute.\n\t */\n\t$login_header_title = apply_filters_deprecated(\n\t\t'login_headertitle',\n\t\tarray( $login_header_title ),\n\t\t'5.2.0',\n\t\t'login_headertext',\n\t\t__( 'Usage of the title attribute on the login logo is not recommended for accessibility reasons. Use the link text instead.' )\n\t);\n\n\t$login_header_text = empty( $login_header_title ) ? __( 'Powered by WordPress' ) : $login_header_title;\n\n\t/**\n\t * Filters the link text of the header logo above the login form.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string $login_header_text The login header logo link text.\n\t */\n\t$login_header_text = apply_filters( 'login_headertext', $login_header_text );\n\n\t$classes = array( 'login-action-' . $action, 'wp-core-ui' );\n\n\tif ( is_rtl() ) {\n\t\t$classes[] = 'rtl';\n\t}\n\n\tif ( $interim_login ) {\n\t\t$classes[] = 'interim-login';\n\n\t\t?>\n\t\t<style type=\"text/css\">html{background-color: transparent;}</style>\n\t\t<?php\n\n\t\tif ( 'success' === $interim_login ) {\n\t\t\t$classes[] = 'interim-login-success';\n\t\t}\n\t}\n\n\t$classes[] = ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );\n\n\t/**\n\t * Filters the login page body classes.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param array  $classes An array of body classes.\n\t * @param string $action  The action that brought the visitor to the login page.\n\t */\n\t$classes = apply_filters( 'login_body_class', $classes, $action );\n\n\t?>\n\t</head>\n\t<body class=\"login no-js <?php echo esc_attr( implode( ' ', $classes ) ); ?>\">\n\t<script type=\"text/javascript\">\n\t\tdocument.body.className = document.body.className.replace('no-js','js');\n\t</script>\n\t<?php\n\t/**\n\t * Fires in the login page header after the body tag is opened.\n\t *\n\t * @since 4.6.0\n\t */\n\tdo_action( 'login_header' );\n\n\t?>\n\t<div id=\"login\">\n\t\t<h1><a href=\"<?php echo esc_url( $login_header_url ); ?>\"><?php echo $login_header_text; ?></a></h1>\n\t<?php\n\t/**\n\t * Filters the message to display above the login form.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $message Login message text.\n\t */\n\t$message = apply_filters( 'login_message', $message );\n\n\tif ( ! empty( $message ) ) {\n\t\techo $message . \"\\n\";\n\t}\n\n\t// In case a plugin uses $error rather than the $wp_errors object.\n\tif ( ! empty( $error ) ) {\n\t\t$wp_error->add( 'error', $error );\n\t\tunset( $error );\n\t}\n\n\tif ( $wp_error->has_errors() ) {\n\t\t$errors   = '';\n\t\t$messages = '';\n\n\t\tforeach ( $wp_error->get_error_codes() as $code ) {\n\t\t\t$severity = $wp_error->get_error_data( $code );\n\t\t\tforeach ( $wp_error->get_error_messages( $code ) as $error_message ) {\n\t\t\t\tif ( 'message' === $severity ) {\n\t\t\t\t\t$messages .= '\t' . $error_message . \"<br />\\n\";\n\t\t\t\t} else {\n\t\t\t\t\t$errors .= '\t' . $error_message . \"<br />\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $errors ) ) {\n\t\t\t/**\n\t\t\t * Filters the error messages displayed above the login form.\n\t\t\t *\n\t\t\t * @since 2.1.0\n\t\t\t *\n\t\t\t * @param string $errors Login error message.\n\t\t\t */\n\t\t\techo '<div id=\"login_error\">' . apply_filters( 'login_errors', $errors ) . \"</div>\\n\";\n\t\t}\n\n\t\tif ( ! empty( $messages ) ) {\n\t\t\t/**\n\t\t\t * Filters instructional messages displayed above the login form.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t *\n\t\t\t * @param string $messages Login messages.\n\t\t\t */\n\t\t\techo '<p class=\"message\">' . apply_filters( 'login_messages', $messages ) . \"</p>\\n\";\n\t\t}\n\t}\n} // End of login_header().\n\n/**\n * Outputs the footer for the login page.\n *\n * @since 3.1.0\n *\n * @global bool|string $interim_login Whether interim login modal is being displayed. String 'success'\n *                                    upon successful login.\n *\n * @param string $input_id Which input to auto-focus.\n */\nfunction login_footer( $input_id = '' ) {\n\tglobal $interim_login;\n\n\t// Don't allow interim logins to navigate away from the page.\n\tif ( ! $interim_login ) {\n\t\t?>\n\t\t<p id=\"backtoblog\"><a href=\"<?php echo esc_url( home_url( '/' ) ); ?>\">\n\t\t<?php\n\n\t\t/* translators: %s: Site title. */\n\t\tprintf( _x( '&larr; Back to %s', 'site' ), get_bloginfo( 'title', 'display' ) );\n\n\t\t?>\n\t\t</a></p>\n\t\t<?php\n\n\t\tthe_privacy_policy_link( '<div class=\"privacy-policy-page-link\">', '</div>' );\n\t}\n\n\t?>\n\t</div><?php // End of <div id=\"login\">. ?>\n\n\t<?php\n\n\tif ( ! empty( $input_id ) ) {\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\ttry{document.getElementById('<?php echo $input_id; ?>').focus();}catch(e){}\n\t\tif(typeof wpOnload=='function')wpOnload();\n\t\t</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * Fires in the login page footer.\n\t *\n\t * @since 3.1.0\n\t */\n\tdo_action( 'login_footer' );\n\n\t?>\n\t<div class=\"clear\"></div>\n\t</body>\n\t</html>\n\t<?php\n}\n\n/**\n * Outputs the Javascript to handle the form shaking.\n *\n * @since 3.0.0\n */\nfunction wp_shake_js() {\n\t?>\n\t<script type=\"text/javascript\">\n\tdocument.querySelector('form').classList.add('shake');\n\t</script>\n\t<?php\n}\n\n/**\n * Outputs the viewport meta tag.\n *\n * @since 3.7.0\n */\nfunction wp_login_viewport_meta() {\n\t?>\n\t<meta name=\"viewport\" content=\"width=device-width\" />\n\t<?php\n}\n\n/**\n * Handles sending password retrieval email to user.\n *\n * @since 2.5.0\n *\n * @return bool|WP_Error True: when finish. WP_Error on error\n */\nfunction retrieve_password() {\n\t$errors    = new WP_Error();\n\t$user_data = false;\n\n\tif ( empty( $_POST['user_login'] ) || ! is_string( $_POST['user_login'] ) ) {\n\t\t$errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter a username or email address.' ) );\n\t} elseif ( strpos( $_POST['user_login'], '@' ) ) {\n\t\t$user_data = get_user_by( 'email', trim( wp_unslash( $_POST['user_login'] ) ) );\n\t\tif ( empty( $user_data ) ) {\n\t\t\t$errors->add( 'invalid_email', __( '<strong>Error</strong>: There is no account with that username or email address.' ) );\n\t\t}\n\t} else {\n\t\t$login     = trim( wp_unslash( $_POST['user_login'] ) );\n\t\t$user_data = get_user_by( 'login', $login );\n\t}\n\n\t/**\n\t * Fires before errors are returned from a password reset request.\n\t *\n\t * @since 2.1.0\n\t * @since 4.4.0 Added the `$errors` parameter.\n\t * @since 5.4.0 Added the `$user_data` parameter.\n\t *\n\t * @param WP_Error      $errors    A WP_Error object containing any errors generated\n\t *                                 by using invalid credentials.\n\t * @param WP_User|false $user_data WP_User object if found, false if the user does not exist.\n\t */\n\tdo_action( 'lostpassword_post', $errors, $user_data );\n\n\t/**\n\t * Filters the errors encountered on a password reset request.\n\t *\n\t * The filtered WP_Error object may, for example, contain errors for an invalid\n\t * username or email address. A WP_Error object should always be returned,\n\t * but may or may not contain errors.\n\t *\n\t * If any errors are present in $errors, this will abort the password reset request.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_Error      $errors    A WP_Error object containing any errors generated\n\t *                                 by using invalid credentials.\n\t * @param WP_User|false $user_data WP_User object if found, false if the user does not exist.\n\t */\n\t$errors = apply_filters( 'lostpassword_errors', $errors, $user_data );\n\n\tif ( $errors->has_errors() ) {\n\t\treturn $errors;\n\t}\n\n\tif ( ! $user_data ) {\n\t\t$errors->add( 'invalidcombo', __( '<strong>Error</strong>: There is no account with that username or email address.' ) );\n\t\treturn $errors;\n\t}\n\n\t// Redefining user_login ensures we return the right case in the email.\n\t$user_login = $user_data->user_login;\n\t$user_email = $user_data->user_email;\n\t$key        = get_password_reset_key( $user_data );\n\n\tif ( is_wp_error( $key ) ) {\n\t\treturn $key;\n\t}\n\n\tif ( is_multisite() ) {\n\t\t$site_name = get_network()->site_name;\n\t} else {\n\t\t/*\n\t\t * The blogname option is escaped with esc_html on the way into the database\n\t\t * in sanitize_option we want to reverse this for the plain text arena of emails.\n\t\t */\n\t\t$site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );\n\t}\n\n\t$message = __( 'Someone has requested a password reset for the following account:' ) . \"\\r\\n\\r\\n\";\n\t/* translators: %s: Site name. */\n\t$message .= sprintf( __( 'Site Name: %s' ), $site_name ) . \"\\r\\n\\r\\n\";\n\t/* translators: %s: User login. */\n\t$message .= sprintf( __( 'Username: %s' ), $user_login ) . \"\\r\\n\\r\\n\";\n\t$message .= __( 'If this was a mistake, just ignore this email and nothing will happen.' ) . \"\\r\\n\\r\\n\";\n\t$message .= __( 'To reset your password, visit the following address:' ) . \"\\r\\n\\r\\n\";\n\t$message .= network_site_url( \"wp-login.php?action=rp&key=$key&login=\" . rawurlencode( $user_login ), 'login' ) . \"\\r\\n\";\n\n\t/* translators: Password reset notification email subject. %s: Site title. */\n\t$title = sprintf( __( '[%s] Password Reset' ), $site_name );\n\n\t/**\n\t * Filters the subject of the password reset email.\n\t *\n\t * @since 2.8.0\n\t * @since 4.4.0 Added the `$user_login` and `$user_data` parameters.\n\t *\n\t * @param string  $title      Default email title.\n\t * @param string  $user_login The username for the user.\n\t * @param WP_User $user_data  WP_User object.\n\t */\n\t$title = apply_filters( 'retrieve_password_title', $title, $user_login, $user_data );\n\n\t/**\n\t * Filters the message body of the password reset mail.\n\t *\n\t * If the filtered message is empty, the password reset email will not be sent.\n\t *\n\t * @since 2.8.0\n\t * @since 4.1.0 Added `$user_login` and `$user_data` parameters.\n\t *\n\t * @param string  $message    Default mail message.\n\t * @param string  $key        The activation key.\n\t * @param string  $user_login The username for the user.\n\t * @param WP_User $user_data  WP_User object.\n\t */\n\t$message = apply_filters( 'retrieve_password_message', $message, $key, $user_login, $user_data );\n\n\tif ( $message && ! wp_mail( $user_email, wp_specialchars_decode( $title ), $message ) ) {\n\t\t$errors->add(\n\t\t\t'retrieve_password_email_failure',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Documentation URL. */\n\t\t\t\t__( '<strong>Error</strong>: The email could not be sent. Your site may not be correctly configured to send emails. <a href=\"%s\">Get support for resetting your password</a>.' ),\n\t\t\t\tesc_url( __( 'https://wordpress.org/support/article/resetting-your-password/' ) )\n\t\t\t)\n\t\t);\n\t\treturn $errors;\n\t}\n\n\treturn true;\n}\n\n//\n// Main.\n//\n\n$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'login';\n$errors = new WP_Error();\n\nif ( isset( $_GET['key'] ) ) {\n\t$action = 'resetpass';\n}\n\nif ( isset( $_GET['checkemail'] ) ) {\n\t$action = 'checkemail';\n}\n\n$default_actions = array(\n\t'confirm_admin_email',\n\t'postpass',\n\t'logout',\n\t'lostpassword',\n\t'retrievepassword',\n\t'resetpass',\n\t'rp',\n\t'register',\n\t'checkemail',\n\t'confirmaction',\n\t'login',\n\tWP_Recovery_Mode_Link_Service::LOGIN_ACTION_ENTERED,\n);\n\n// Validate action so as to default to the login screen.\nif ( ! in_array( $action, $default_actions, true ) && false === has_filter( 'login_form_' . $action ) ) {\n\t$action = 'login';\n}\n\nnocache_headers();\n\nheader( 'Content-Type: ' . get_bloginfo( 'html_type' ) . '; charset=' . get_bloginfo( 'charset' ) );\n\nif ( defined( 'RELOCATE' ) && RELOCATE ) { // Move flag is set.\n\tif ( isset( $_SERVER['PATH_INFO'] ) && ( $_SERVER['PATH_INFO'] !== $_SERVER['PHP_SELF'] ) ) {\n\t\t$_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );\n\t}\n\n\t$url = dirname( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ) );\n\n\tif ( get_option( 'siteurl' ) !== $url ) {\n\t\tupdate_option( 'siteurl', $url );\n\t}\n}\n\n// Set a cookie now to see if they are supported by the browser.\n$secure = ( 'https' === parse_url( wp_login_url(), PHP_URL_SCHEME ) );\nsetcookie( TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN, $secure );\n\nif ( SITECOOKIEPATH !== COOKIEPATH ) {\n\tsetcookie( TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN, $secure );\n}\n\n/**\n * Fires when the login form is initialized.\n *\n * @since 3.2.0\n */\ndo_action( 'login_init' );\n\n/**\n * Fires before a specified login form action.\n *\n * The dynamic portion of the hook name, `$action`, refers to the action\n * that brought the visitor to the login form. Actions include 'postpass',\n * 'logout', 'lostpassword', etc.\n *\n * @since 2.8.0\n */\ndo_action( \"login_form_{$action}\" );\n\n$http_post     = ( 'POST' === $_SERVER['REQUEST_METHOD'] );\n$interim_login = isset( $_REQUEST['interim-login'] );\n\n/**\n * Filters the separator used between login form navigation links.\n *\n * @since 4.9.0\n *\n * @param string $login_link_separator The separator used between login form navigation links.\n */\n$login_link_separator = apply_filters( 'login_link_separator', ' | ' );\n\nswitch ( $action ) {\n\n\tcase 'confirm_admin_email':\n\t\t/*\n\t\t * Note that `is_user_logged_in()` will return false immediately after logging in\n\t\t * as the current user is not set, see wp-includes/pluggable.php.\n\t\t * However this action runs on a redirect after logging in.\n\t\t */\n\t\tif ( ! is_user_logged_in() ) {\n\t\t\twp_safe_redirect( wp_login_url() );\n\t\t\texit;\n\t\t}\n\n\t\tif ( ! empty( $_REQUEST['redirect_to'] ) ) {\n\t\t\t$redirect_to = $_REQUEST['redirect_to'];\n\t\t} else {\n\t\t\t$redirect_to = admin_url();\n\t\t}\n\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\t$admin_email = get_option( 'admin_email' );\n\t\t} else {\n\t\t\twp_safe_redirect( $redirect_to );\n\t\t\texit;\n\t\t}\n\n\t\t/**\n\t\t * Filters the interval for dismissing the admin email confirmation screen.\n\t\t *\n\t\t * If `0` (zero) is returned, the \"Remind me later\" link will not be displayed.\n\t\t *\n\t\t * @since 5.3.1\n\t\t *\n\t\t * @param int $interval Interval time (in seconds). Default is 3 days.\n\t\t */\n\t\t$remind_interval = (int) apply_filters( 'admin_email_remind_interval', 3 * DAY_IN_SECONDS );\n\n\t\tif ( ! empty( $_GET['remind_me_later'] ) ) {\n\t\t\tif ( ! wp_verify_nonce( $_GET['remind_me_later'], 'remind_me_later_nonce' ) ) {\n\t\t\t\twp_safe_redirect( wp_login_url() );\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tif ( $remind_interval > 0 ) {\n\t\t\t\tupdate_option( 'admin_email_lifespan', time() + $remind_interval );\n\t\t\t}\n\n\t\t\t$redirect_to = add_query_arg( 'admin_email_remind_later', 1, $redirect_to );\n\t\t\twp_safe_redirect( $redirect_to );\n\t\t\texit;\n\t\t}\n\n\t\tif ( ! empty( $_POST['correct-admin-email'] ) ) {\n\t\t\tif ( ! check_admin_referer( 'confirm_admin_email', 'confirm_admin_email_nonce' ) ) {\n\t\t\t\twp_safe_redirect( wp_login_url() );\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the interval for redirecting the user to the admin email confirmation screen.\n\t\t\t *\n\t\t\t * If `0` (zero) is returned, the user will not be redirected.\n\t\t\t *\n\t\t\t * @since 5.3.0\n\t\t\t *\n\t\t\t * @param int $interval Interval time (in seconds). Default is 6 months.\n\t\t\t */\n\t\t\t$admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 6 * MONTH_IN_SECONDS );\n\n\t\t\tif ( $admin_email_check_interval > 0 ) {\n\t\t\t\tupdate_option( 'admin_email_lifespan', time() + $admin_email_check_interval );\n\t\t\t}\n\n\t\t\twp_safe_redirect( $redirect_to );\n\t\t\texit;\n\t\t}\n\n\t\tlogin_header( __( 'Confirm your administration email' ), '', $errors );\n\n\t\t/**\n\t\t * Fires before the admin email confirm form.\n\t\t *\n\t\t * @since 5.3.0\n\t\t *\n\t\t * @param WP_Error $errors A `WP_Error` object containing any errors generated by using invalid\n\t\t *                         credentials. Note that the error object may not contain any errors.\n\t\t */\n\t\tdo_action( 'admin_email_confirm', $errors );\n\n\t\t?>\n\n\t\t<form class=\"admin-email-confirm-form\" name=\"admin-email-confirm-form\" action=\"<?php echo esc_url( site_url( 'wp-login.php?action=confirm_admin_email', 'login_post' ) ); ?>\" method=\"post\">\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * Fires inside the admin-email-confirm-form form tags, before the hidden fields.\n\t\t\t *\n\t\t\t * @since 5.3.0\n\t\t\t */\n\t\t\tdo_action( 'admin_email_confirm_form' );\n\n\t\t\twp_nonce_field( 'confirm_admin_email', 'confirm_admin_email_nonce' );\n\n\t\t\t?>\n\t\t\t<input type=\"hidden\" name=\"redirect_to\" value=\"<?php echo esc_attr( $redirect_to ); ?>\" />\n\n\t\t\t<h1 class=\"admin-email__heading\">\n\t\t\t\t<?php _e( 'Administration email verification' ); ?>\n\t\t\t</h1>\n\t\t\t<p class=\"admin-email__details\">\n\t\t\t\t<?php _e( 'Please verify that the <strong>administration email</strong> for this website is still correct.' ); ?>\n\t\t\t\t<?php\n\n\t\t\t\t/* translators: URL to the WordPress help section about admin email. */\n\t\t\t\t$admin_email_help_url = __( 'https://wordpress.org/support/article/settings-general-screen/#email-address' );\n\n\t\t\t\t/* translators: accessibility text */\n\t\t\t\t$accessibility_text = sprintf( '<span class=\"screen-reader-text\"> %s</span>', __( '(opens in a new tab)' ) );\n\n\t\t\t\tprintf(\n\t\t\t\t\t'<a href=\"%s\" rel=\"noopener noreferrer\" target=\"_blank\">%s%s</a>',\n\t\t\t\t\tesc_url( $admin_email_help_url ),\n\t\t\t\t\t__( 'Why is this important?' ),\n\t\t\t\t\t$accessibility_text\n\t\t\t\t);\n\n\t\t\t\t?>\n\t\t\t</p>\n\t\t\t<p class=\"admin-email__details\">\n\t\t\t\t<?php\n\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: Admin email address. */\n\t\t\t\t\t__( 'Current administration email: %s' ),\n\t\t\t\t\t'<strong>' . esc_html( $admin_email ) . '</strong>'\n\t\t\t\t);\n\n\t\t\t\t?>\n\t\t\t</p>\n\t\t\t<p class=\"admin-email__details\">\n\t\t\t\t<?php _e( 'This email may be different from your personal email address.' ); ?>\n\t\t\t</p>\n\n\t\t\t<div class=\"admin-email__actions\">\n\t\t\t\t<div class=\"admin-email__actions-primary\">\n\t\t\t\t\t<?php\n\n\t\t\t\t\t$change_link = admin_url( 'options-general.php' );\n\t\t\t\t\t$change_link = add_query_arg( 'highlight', 'confirm_admin_email', $change_link );\n\n\t\t\t\t\t?>\n\t\t\t\t\t<a class=\"button button-large\" href=\"<?php echo esc_url( $change_link ); ?>\"><?php _e( 'Update' ); ?></a>\n\t\t\t\t\t<input type=\"submit\" name=\"correct-admin-email\" id=\"correct-admin-email\" class=\"button button-primary button-large\" value=\"<?php esc_attr_e( 'The email is correct' ); ?>\" />\n\t\t\t\t</div>\n\t\t\t\t<?php if ( $remind_interval > 0 ) : ?>\n\t\t\t\t\t<div class=\"admin-email__actions-secondary\">\n\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t$remind_me_link = wp_login_url( $redirect_to );\n\t\t\t\t\t\t$remind_me_link = add_query_arg(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'action'          => 'confirm_admin_email',\n\t\t\t\t\t\t\t\t'remind_me_later' => wp_create_nonce( 'remind_me_later_nonce' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t$remind_me_link\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<a href=\"<?php echo esc_url( $remind_me_link ); ?>\"><?php _e( 'Remind me later' ); ?></a>\n\t\t\t\t\t</div>\n\t\t\t\t<?php endif; ?>\n\t\t\t</div>\n\t\t</form>\n\n\t\t<?php\n\n\t\tlogin_footer();\n\t\tbreak;\n\n\tcase 'postpass':\n\t\tif ( ! array_key_exists( 'post_password', $_POST ) ) {\n\t\t\twp_safe_redirect( wp_get_referer() );\n\t\t\texit;\n\t\t}\n\n\t\trequire_once ABSPATH . WPINC . '/class-phpass.php';\n\t\t$hasher = new PasswordHash( 8, true );\n\n\t\t/**\n\t\t * Filters the life span of the post password cookie.\n\t\t *\n\t\t * By default, the cookie expires 10 days from creation. To turn this\n\t\t * into a session cookie, return 0.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param int $expires The expiry time, as passed to setcookie().\n\t\t */\n\t\t$expire  = apply_filters( 'post_password_expires', time() + 10 * DAY_IN_SECONDS );\n\t\t$referer = wp_get_referer();\n\n\t\tif ( $referer ) {\n\t\t\t$secure = ( 'https' === parse_url( $referer, PHP_URL_SCHEME ) );\n\t\t} else {\n\t\t\t$secure = false;\n\t\t}\n\n\t\tsetcookie( 'wp-postpass_' . COOKIEHASH, $hasher->HashPassword( wp_unslash( $_POST['post_password'] ) ), $expire, COOKIEPATH, COOKIE_DOMAIN, $secure );\n\n\t\twp_safe_redirect( wp_get_referer() );\n\t\texit;\n\n\tcase 'logout':\n\t\tcheck_admin_referer( 'log-out' );\n\n\t\t$user = wp_get_current_user();\n\n\t\twp_logout();\n\n\t\tif ( ! empty( $_REQUEST['redirect_to'] ) ) {\n\t\t\t$redirect_to           = $_REQUEST['redirect_to'];\n\t\t\t$requested_redirect_to = $redirect_to;\n\t\t} else {\n\t\t\t$redirect_to = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'loggedout' => 'true',\n\t\t\t\t\t'wp_lang'   => get_user_locale( $user ),\n\t\t\t\t),\n\t\t\t\twp_login_url()\n\t\t\t);\n\n\t\t\t$requested_redirect_to = '';\n\t\t}\n\n\t\t/**\n\t\t * Filters the log out redirect URL.\n\t\t *\n\t\t * @since 4.2.0\n\t\t *\n\t\t * @param string  $redirect_to           The redirect destination URL.\n\t\t * @param string  $requested_redirect_to The requested redirect destination URL passed as a parameter.\n\t\t * @param WP_User $user                  The WP_User object for the user that's logging out.\n\t\t */\n\t\t$redirect_to = apply_filters( 'logout_redirect', $redirect_to, $requested_redirect_to, $user );\n\n\t\twp_safe_redirect( $redirect_to );\n\t\texit;\n\n\tcase 'lostpassword':\n\tcase 'retrievepassword':\n\t\tif ( $http_post ) {\n\t\t\t$errors = retrieve_password();\n\n\t\t\tif ( ! is_wp_error( $errors ) ) {\n\t\t\t\t$redirect_to = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?checkemail=confirm';\n\t\t\t\twp_safe_redirect( $redirect_to );\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $_GET['error'] ) ) {\n\t\t\tif ( 'invalidkey' === $_GET['error'] ) {\n\t\t\t\t$errors->add( 'invalidkey', __( 'Your password reset link appears to be invalid. Please request a new link below.' ) );\n\t\t\t} elseif ( 'expiredkey' === $_GET['error'] ) {\n\t\t\t\t$errors->add( 'expiredkey', __( 'Your password reset link has expired. Please request a new link below.' ) );\n\t\t\t}\n\t\t}\n\n\t\t$lostpassword_redirect = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';\n\t\t/**\n\t\t * Filters the URL redirected to after submitting the lostpassword/retrievepassword form.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string $lostpassword_redirect The redirect destination URL.\n\t\t */\n\t\t$redirect_to = apply_filters( 'lostpassword_redirect', $lostpassword_redirect );\n\n\t\t/**\n\t\t * Fires before the lost password form.\n\t\t *\n\t\t * @since 1.5.1\n\t\t * @since 5.1.0 Added the `$errors` parameter.\n\t\t *\n\t\t * @param WP_Error $errors A `WP_Error` object containing any errors generated by using invalid\n\t\t *                         credentials. Note that the error object may not contain any errors.\n\t\t */\n\t\tdo_action( 'lost_password', $errors );\n\n\t\tlogin_header( __( 'Lost Password' ), '<p class=\"message\">' . __( 'Please enter your username or email address. You will receive an email message with instructions on how to reset your password.' ) . '</p>', $errors );\n\n\t\t$user_login = '';\n\n\t\tif ( isset( $_POST['user_login'] ) && is_string( $_POST['user_login'] ) ) {\n\t\t\t$user_login = wp_unslash( $_POST['user_login'] );\n\t\t}\n\n\t\t?>\n\n\t\t<form name=\"lostpasswordform\" id=\"lostpasswordform\" action=\"<?php echo esc_url( network_site_url( 'wp-login.php?action=lostpassword', 'login_post' ) ); ?>\" method=\"post\">\n\t\t\t<p>\n\t\t\t\t<label for=\"user_login\"><?php _e( 'Username or Email Address' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"user_login\" id=\"user_login\" class=\"input\" value=\"<?php echo esc_attr( $user_login ); ?>\" size=\"20\" autocapitalize=\"off\" />\n\t\t\t</p>\n\t\t\t<?php\n\n\t\t\t/**\n\t\t\t * Fires inside the lostpassword form tags, before the hidden fields.\n\t\t\t *\n\t\t\t * @since 2.1.0\n\t\t\t */\n\t\t\tdo_action( 'lostpassword_form' );\n\n\t\t\t?>\n\t\t\t<input type=\"hidden\" name=\"redirect_to\" value=\"<?php echo esc_attr( $redirect_to ); ?>\" />\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"submit\" name=\"wp-submit\" id=\"wp-submit\" class=\"button button-primary button-large\" value=\"<?php esc_attr_e( 'Get New Password' ); ?>\" />\n\t\t\t</p>\n\t\t</form>\n\n\t\t<p id=\"nav\">\n\t\t\t<a href=\"<?php echo esc_url( wp_login_url() ); ?>\"><?php _e( 'Log in' ); ?></a>\n\t\t\t<?php\n\n\t\t\tif ( get_option( 'users_can_register' ) ) {\n\t\t\t\t$registration_url = sprintf( '<a href=\"%s\">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );\n\n\t\t\t\techo esc_html( $login_link_separator );\n\n\t\t\t\t/** This filter is documented in wp-includes/general-template.php */\n\t\t\t\techo apply_filters( 'register', $registration_url );\n\t\t\t}\n\n\t\t\t?>\n\t\t</p>\n\t\t<?php\n\n\t\tlogin_footer( 'user_login' );\n\t\tbreak;\n\n\tcase 'resetpass':\n\tcase 'rp':\n\t\tlist( $rp_path ) = explode( '?', wp_unslash( $_SERVER['REQUEST_URI'] ) );\n\t\t$rp_cookie       = 'wp-resetpass-' . COOKIEHASH;\n\n\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t$value = sprintf( '%s:%s', wp_unslash( $_GET['login'] ), wp_unslash( $_GET['key'] ) );\n\t\t\tsetcookie( $rp_cookie, $value, 0, $rp_path, COOKIE_DOMAIN, is_ssl(), true );\n\n\t\t\twp_safe_redirect( remove_query_arg( array( 'key', 'login' ) ) );\n\t\t\texit;\n\t\t}\n\n\t\tif ( isset( $_COOKIE[ $rp_cookie ] ) && 0 < strpos( $_COOKIE[ $rp_cookie ], ':' ) ) {\n\t\t\tlist( $rp_login, $rp_key ) = explode( ':', wp_unslash( $_COOKIE[ $rp_cookie ] ), 2 );\n\n\t\t\t$user = check_password_reset_key( $rp_key, $rp_login );\n\n\t\t\tif ( isset( $_POST['pass1'] ) && ! hash_equals( $rp_key, $_POST['rp_key'] ) ) {\n\t\t\t\t$user = false;\n\t\t\t}\n\t\t} else {\n\t\t\t$user = false;\n\t\t}\n\n\t\tif ( ! $user || is_wp_error( $user ) ) {\n\t\t\tsetcookie( $rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true );\n\n\t\t\tif ( $user && $user->get_error_code() === 'expired_key' ) {\n\t\t\t\twp_redirect( site_url( 'wp-login.php?action=lostpassword&error=expiredkey' ) );\n\t\t\t} else {\n\t\t\t\twp_redirect( site_url( 'wp-login.php?action=lostpassword&error=invalidkey' ) );\n\t\t\t}\n\n\t\t\texit;\n\t\t}\n\n\t\t$errors = new WP_Error();\n\n\t\tif ( isset( $_POST['pass1'] ) && $_POST['pass1'] !== $_POST['pass2'] ) {\n\t\t\t$errors->add( 'password_reset_mismatch', __( 'The passwords do not match.' ) );\n\t\t}\n\n\t\t/**\n\t\t * Fires before the password reset procedure is validated.\n\t\t *\n\t\t * @since 3.5.0\n\t\t *\n\t\t * @param WP_Error         $errors WP Error object.\n\t\t * @param WP_User|WP_Error $user   WP_User object if the login and reset key match. WP_Error object otherwise.\n\t\t */\n\t\tdo_action( 'validate_password_reset', $errors, $user );\n\n\t\tif ( ( ! $errors->has_errors() ) && isset( $_POST['pass1'] ) && ! empty( $_POST['pass1'] ) ) {\n\t\t\treset_password( $user, $_POST['pass1'] );\n\t\t\tsetcookie( $rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true );\n\t\t\tlogin_header( __( 'Password Reset' ), '<p class=\"message reset-pass\">' . __( 'Your password has been reset.' ) . ' <a href=\"' . esc_url( wp_login_url() ) . '\">' . __( 'Log in' ) . '</a></p>' );\n\t\t\tlogin_footer();\n\t\t\texit;\n\t\t}\n\n\t\twp_enqueue_script( 'utils' );\n\t\twp_enqueue_script( 'user-profile' );\n\n\t\tlogin_header( __( 'Reset Password' ), '<p class=\"message reset-pass\">' . __( 'Enter your new password below.' ) . '</p>', $errors );\n\n\t\t?>\n\t\t<form name=\"resetpassform\" id=\"resetpassform\" action=\"<?php echo esc_url( network_site_url( 'wp-login.php?action=resetpass', 'login_post' ) ); ?>\" method=\"post\" autocomplete=\"off\">\n\t\t\t<input type=\"hidden\" id=\"user_login\" value=\"<?php echo esc_attr( $rp_login ); ?>\" autocomplete=\"off\" />\n\n\t\t\t<div class=\"user-pass1-wrap\">\n\t\t\t\t<p>\n\t\t\t\t\t<label for=\"pass1\"><?php _e( 'New password' ); ?></label>\n\t\t\t\t</p>\n\n\t\t\t\t<div class=\"wp-pwd\">\n\t\t\t\t\t<input type=\"password\" data-reveal=\"1\" data-pw=\"<?php echo esc_attr( wp_generate_password( 16 ) ); ?>\" name=\"pass1\" id=\"pass1\" class=\"input password-input\" size=\"24\" value=\"\" autocomplete=\"off\" aria-describedby=\"pass-strength-result\" />\n\n\t\t\t\t\t<button type=\"button\" class=\"button button-secondary wp-hide-pw hide-if-no-js\" data-toggle=\"0\" aria-label=\"<?php esc_attr_e( 'Hide password' ); ?>\">\n\t\t\t\t\t\t<span class=\"dashicons dashicons-hidden\" aria-hidden=\"true\"></span>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div id=\"pass-strength-result\" class=\"hide-if-no-js\" aria-live=\"polite\"><?php _e( 'Strength indicator' ); ?></div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"pw-weak\">\n\t\t\t\t\t<input type=\"checkbox\" name=\"pw_weak\" id=\"pw-weak\" class=\"pw-checkbox\" />\n\t\t\t\t\t<label for=\"pw-weak\"><?php _e( 'Confirm use of weak password' ); ?></label>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<p class=\"user-pass2-wrap\">\n\t\t\t\t<label for=\"pass2\"><?php _e( 'Confirm new password' ); ?></label>\n\t\t\t\t<input type=\"password\" name=\"pass2\" id=\"pass2\" class=\"input\" size=\"20\" value=\"\" autocomplete=\"off\" />\n\t\t\t</p>\n\n\t\t\t<p class=\"description indicator-hint\"><?php echo wp_get_password_hint(); ?></p>\n\t\t\t<br class=\"clear\" />\n\n\t\t\t<?php\n\n\t\t\t/**\n\t\t\t * Fires following the 'Strength indicator' meter in the user password reset form.\n\t\t\t *\n\t\t\t * @since 3.9.0\n\t\t\t *\n\t\t\t * @param WP_User $user User object of the user whose password is being reset.\n\t\t\t */\n\t\t\tdo_action( 'resetpass_form', $user );\n\n\t\t\t?>\n\t\t\t<input type=\"hidden\" name=\"rp_key\" value=\"<?php echo esc_attr( $rp_key ); ?>\" />\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"submit\" name=\"wp-submit\" id=\"wp-submit\" class=\"button button-primary button-large\" value=\"<?php esc_attr_e( 'Reset Password' ); ?>\" />\n\t\t\t</p>\n\t\t</form>\n\n\t\t<p id=\"nav\">\n\t\t\t<a href=\"<?php echo esc_url( wp_login_url() ); ?>\"><?php _e( 'Log in' ); ?></a>\n\t\t\t<?php\n\n\t\t\tif ( get_option( 'users_can_register' ) ) {\n\t\t\t\t$registration_url = sprintf( '<a href=\"%s\">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );\n\n\t\t\t\techo esc_html( $login_link_separator );\n\n\t\t\t\t/** This filter is documented in wp-includes/general-template.php */\n\t\t\t\techo apply_filters( 'register', $registration_url );\n\t\t\t}\n\n\t\t\t?>\n\t\t</p>\n\t\t<?php\n\n\t\tlogin_footer( 'user_pass' );\n\t\tbreak;\n\n\tcase 'register':\n\t\tif ( is_multisite() ) {\n\t\t\t/**\n\t\t\t * Filters the Multisite sign up URL.\n\t\t\t *\n\t\t\t * @since 3.0.0\n\t\t\t *\n\t\t\t * @param string $sign_up_url The sign up URL.\n\t\t\t */\n\t\t\twp_redirect( apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ) );\n\t\t\texit;\n\t\t}\n\n\t\tif ( ! get_option( 'users_can_register' ) ) {\n\t\t\twp_redirect( site_url( 'wp-login.php?registration=disabled' ) );\n\t\t\texit;\n\t\t}\n\n\t\t$user_login = '';\n\t\t$user_email = '';\n\n\t\tif ( $http_post ) {\n\t\t\tif ( isset( $_POST['user_login'] ) && is_string( $_POST['user_login'] ) ) {\n\t\t\t\t$user_login = wp_unslash( $_POST['user_login'] );\n\t\t\t}\n\n\t\t\tif ( isset( $_POST['user_email'] ) && is_string( $_POST['user_email'] ) ) {\n\t\t\t\t$user_email = wp_unslash( $_POST['user_email'] );\n\t\t\t}\n\n\t\t\t$errors = register_new_user( $user_login, $user_email );\n\n\t\t\tif ( ! is_wp_error( $errors ) ) {\n\t\t\t\t$redirect_to = ! empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'wp-login.php?checkemail=registered';\n\t\t\t\twp_safe_redirect( $redirect_to );\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t\t$registration_redirect = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';\n\n\t\t/**\n\t\t * Filters the registration redirect URL.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string $registration_redirect The redirect destination URL.\n\t\t */\n\t\t$redirect_to = apply_filters( 'registration_redirect', $registration_redirect );\n\n\t\tlogin_header( __( 'Registration Form' ), '<p class=\"message register\">' . __( 'Register For This Site' ) . '</p>', $errors );\n\n\t\t?>\n\t\t<form name=\"registerform\" id=\"registerform\" action=\"<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login_post' ) ); ?>\" method=\"post\" novalidate=\"novalidate\">\n\t\t\t<p>\n\t\t\t\t<label for=\"user_login\"><?php _e( 'Username' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"user_login\" id=\"user_login\" class=\"input\" value=\"<?php echo esc_attr( wp_unslash( $user_login ) ); ?>\" size=\"20\" autocapitalize=\"off\" />\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label for=\"user_email\"><?php _e( 'Email' ); ?></label>\n\t\t\t\t<input type=\"email\" name=\"user_email\" id=\"user_email\" class=\"input\" value=\"<?php echo esc_attr( wp_unslash( $user_email ) ); ?>\" size=\"25\" />\n\t\t\t</p>\n\t\t\t<?php\n\n\t\t\t/**\n\t\t\t * Fires following the 'Email' field in the user registration form.\n\t\t\t *\n\t\t\t * @since 2.1.0\n\t\t\t */\n\t\t\tdo_action( 'register_form' );\n\n\t\t\t?>\n\t\t\t<p id=\"reg_passmail\">\n\t\t\t\t<?php _e( 'Registration confirmation will be emailed to you.' ); ?>\n\t\t\t</p>\n\t\t\t<br class=\"clear\" />\n\t\t\t<input type=\"hidden\" name=\"redirect_to\" value=\"<?php echo esc_attr( $redirect_to ); ?>\" />\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"submit\" name=\"wp-submit\" id=\"wp-submit\" class=\"button button-primary button-large\" value=\"<?php esc_attr_e( 'Register' ); ?>\" />\n\t\t\t</p>\n\t\t</form>\n\n\t\t<p id=\"nav\">\n\t\t\t<a href=\"<?php echo esc_url( wp_login_url() ); ?>\"><?php _e( 'Log in' ); ?></a>\n\t\t\t\t<?php echo esc_html( $login_link_separator ); ?>\n\t\t\t<a href=\"<?php echo esc_url( wp_lostpassword_url() ); ?>\"><?php _e( 'Lost your password?' ); ?></a>\n\t\t</p>\n\t\t<?php\n\n\t\tlogin_footer( 'user_login' );\n\t\tbreak;\n\n\tcase 'checkemail':\n\t\t$redirect_to = admin_url();\n\t\t$errors      = new WP_Error();\n\n\t\tif ( 'confirm' === $_GET['checkemail'] ) {\n\t\t\t$errors->add(\n\t\t\t\t'confirm',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Link to the login page. */\n\t\t\t\t\t__( 'Check your email for the confirmation link, then visit the <a href=\"%s\">login page</a>.' ),\n\t\t\t\t\twp_login_url()\n\t\t\t\t),\n\t\t\t\t'message'\n\t\t\t);\n\t\t} elseif ( 'registered' === $_GET['checkemail'] ) {\n\t\t\t$errors->add(\n\t\t\t\t'registered',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Link to the login page. */\n\t\t\t\t\t__( 'Registration complete. Please check your email, then visit the <a href=\"%s\">login page</a>.' ),\n\t\t\t\t\twp_login_url()\n\t\t\t\t),\n\t\t\t\t'message'\n\t\t\t);\n\t\t}\n\n\t\t/** This action is documented in wp-login.php */\n\t\t$errors = apply_filters( 'wp_login_errors', $errors, $redirect_to );\n\n\t\tlogin_header( __( 'Check your email' ), '', $errors );\n\t\tlogin_footer();\n\t\tbreak;\n\n\tcase 'confirmaction':\n\t\tif ( ! isset( $_GET['request_id'] ) ) {\n\t\t\twp_die( __( 'Missing request ID.' ) );\n\t\t}\n\n\t\tif ( ! isset( $_GET['confirm_key'] ) ) {\n\t\t\twp_die( __( 'Missing confirm key.' ) );\n\t\t}\n\n\t\t$request_id = (int) $_GET['request_id'];\n\t\t$key        = sanitize_text_field( wp_unslash( $_GET['confirm_key'] ) );\n\t\t$result     = wp_validate_user_request_key( $request_id, $key );\n\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\twp_die( $result );\n\t\t}\n\n\t\t/**\n\t\t * Fires an action hook when the account action has been confirmed by the user.\n\t\t *\n\t\t * Using this you can assume the user has agreed to perform the action by\n\t\t * clicking on the link in the confirmation email.\n\t\t *\n\t\t * After firing this action hook the page will redirect to wp-login a callback\n\t\t * redirects or exits first.\n\t\t *\n\t\t * @since 4.9.6\n\t\t *\n\t\t * @param int $request_id Request ID.\n\t\t */\n\t\tdo_action( 'user_request_action_confirmed', $request_id );\n\n\t\t$message = _wp_privacy_account_request_confirmed_message( $request_id );\n\n\t\tlogin_header( __( 'User action confirmed.' ), $message );\n\t\tlogin_footer();\n\t\texit;\n\n\tcase 'login':\n\tdefault:\n\t\t$secure_cookie   = '';\n\t\t$customize_login = isset( $_REQUEST['customize-login'] );\n\n\t\tif ( $customize_login ) {\n\t\t\twp_enqueue_script( 'customize-base' );\n\t\t}\n\n\t\t// If the user wants SSL but the session is not SSL, force a secure cookie.\n\t\tif ( ! empty( $_POST['log'] ) && ! force_ssl_admin() ) {\n\t\t\t$user_name = sanitize_user( wp_unslash( $_POST['log'] ) );\n\t\t\t$user      = get_user_by( 'login', $user_name );\n\n\t\t\tif ( ! $user && strpos( $user_name, '@' ) ) {\n\t\t\t\t$user = get_user_by( 'email', $user_name );\n\t\t\t}\n\n\t\t\tif ( $user ) {\n\t\t\t\tif ( get_user_option( 'use_ssl', $user->ID ) ) {\n\t\t\t\t\t$secure_cookie = true;\n\t\t\t\t\tforce_ssl_admin( true );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $_REQUEST['redirect_to'] ) ) {\n\t\t\t$redirect_to = $_REQUEST['redirect_to'];\n\t\t\t// Redirect to HTTPS if user wants SSL.\n\t\t\tif ( $secure_cookie && false !== strpos( $redirect_to, 'wp-admin' ) ) {\n\t\t\t\t$redirect_to = preg_replace( '|^http://|', 'https://', $redirect_to );\n\t\t\t}\n\t\t} else {\n\t\t\t$redirect_to = admin_url();\n\t\t}\n\n\t\t$reauth = empty( $_REQUEST['reauth'] ) ? false : true;\n\n\t\t$user = wp_signon( array(), $secure_cookie );\n\n\t\tif ( empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {\n\t\t\tif ( headers_sent() ) {\n\t\t\t\t$user = new WP_Error(\n\t\t\t\t\t'test_cookie',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1: Browser cookie documentation URL, 2: Support forums URL. */\n\t\t\t\t\t\t__( '<strong>Error</strong>: Cookies are blocked due to unexpected output. For help, please see <a href=\"%1$s\">this documentation</a> or try the <a href=\"%2$s\">support forums</a>.' ),\n\t\t\t\t\t\t__( 'https://wordpress.org/support/article/cookies/' ),\n\t\t\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} elseif ( isset( $_POST['testcookie'] ) && empty( $_COOKIE[ TEST_COOKIE ] ) ) {\n\t\t\t\t// If cookies are disabled, we can't log in even with a valid user and password.\n\t\t\t\t$user = new WP_Error(\n\t\t\t\t\t'test_cookie',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: Browser cookie documentation URL. */\n\t\t\t\t\t\t__( '<strong>Error</strong>: Cookies are blocked or not supported by your browser. You must <a href=\"%s\">enable cookies</a> to use WordPress.' ),\n\t\t\t\t\t\t__( 'https://wordpress.org/support/article/cookies/#enable-cookies-in-your-browser' )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$requested_redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';\n\t\t/**\n\t\t * Filters the login redirect URL.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string           $redirect_to           The redirect destination URL.\n\t\t * @param string           $requested_redirect_to The requested redirect destination URL passed as a parameter.\n\t\t * @param WP_User|WP_Error $user                  WP_User object if login was successful, WP_Error object otherwise.\n\t\t */\n\t\t$redirect_to = apply_filters( 'login_redirect', $redirect_to, $requested_redirect_to, $user );\n\n\t\tif ( ! is_wp_error( $user ) && ! $reauth ) {\n\t\t\tif ( $interim_login ) {\n\t\t\t\t$message       = '<p class=\"message\">' . __( 'You have logged in successfully.' ) . '</p>';\n\t\t\t\t$interim_login = 'success';\n\t\t\t\tlogin_header( '', $message );\n\n\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\n\t\t\t\t/** This action is documented in wp-login.php */\n\t\t\t\tdo_action( 'login_footer' );\n\n\t\t\t\tif ( $customize_login ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<script type=\"text/javascript\">setTimeout( function(){ new wp.customize.Messenger({ url: '<?php echo wp_customize_url(); ?>', channel: 'login' }).send('login') }, 1000 );</script>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\n\t\t\t\t?>\n\t\t\t\t</body></html>\n\t\t\t\t<?php\n\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t// Check if it is time to add a redirect to the admin email confirmation screen.\n\t\t\tif ( is_a( $user, 'WP_User' ) && $user->exists() && $user->has_cap( 'manage_options' ) ) {\n\t\t\t\t$admin_email_lifespan = (int) get_option( 'admin_email_lifespan' );\n\n\t\t\t\t// If `0` (or anything \"falsey\" as it is cast to int) is returned, the user will not be redirected\n\t\t\t\t// to the admin email confirmation screen.\n\t\t\t\t/** This filter is documented in wp-login.php */\n\t\t\t\t$admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 6 * MONTH_IN_SECONDS );\n\n\t\t\t\tif ( $admin_email_check_interval > 0 && time() > $admin_email_lifespan ) {\n\t\t\t\t\t$redirect_to = add_query_arg(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'action'  => 'confirm_admin_email',\n\t\t\t\t\t\t\t'wp_lang' => get_user_locale( $user ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\twp_login_url( $redirect_to )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ( empty( $redirect_to ) || 'wp-admin/' === $redirect_to || admin_url() === $redirect_to ) ) {\n\t\t\t\t// If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile.\n\t\t\t\tif ( is_multisite() && ! get_active_blog_for_user( $user->ID ) && ! is_super_admin( $user->ID ) ) {\n\t\t\t\t\t$redirect_to = user_admin_url();\n\t\t\t\t} elseif ( is_multisite() && ! $user->has_cap( 'read' ) ) {\n\t\t\t\t\t$redirect_to = get_dashboard_url( $user->ID );\n\t\t\t\t} elseif ( ! $user->has_cap( 'edit_posts' ) ) {\n\t\t\t\t\t$redirect_to = $user->has_cap( 'read' ) ? admin_url( 'profile.php' ) : home_url();\n\t\t\t\t}\n\n\t\t\t\twp_redirect( $redirect_to );\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\twp_safe_redirect( $redirect_to );\n\t\t\texit;\n\t\t}\n\n\t\t$errors = $user;\n\t\t// Clear errors if loggedout is set.\n\t\tif ( ! empty( $_GET['loggedout'] ) || $reauth ) {\n\t\t\t$errors = new WP_Error();\n\t\t}\n\n\t\tif ( empty( $_POST ) && $errors->get_error_codes() === array( 'empty_username', 'empty_password' ) ) {\n\t\t\t$errors = new WP_Error( '', '' );\n\t\t}\n\n\t\tif ( $interim_login ) {\n\t\t\tif ( ! $errors->has_errors() ) {\n\t\t\t\t$errors->add( 'expired', __( 'Your session has expired. Please log in to continue where you left off.' ), 'message' );\n\t\t\t}\n\t\t} else {\n\t\t\t// Some parts of this script use the main login form to display a message.\n\t\t\tif ( isset( $_GET['loggedout'] ) && $_GET['loggedout'] ) {\n\t\t\t\t$errors->add( 'loggedout', __( 'You are now logged out.' ), 'message' );\n\t\t\t} elseif ( isset( $_GET['registration'] ) && 'disabled' === $_GET['registration'] ) {\n\t\t\t\t$errors->add( 'registerdisabled', __( 'User registration is currently not allowed.' ) );\n\t\t\t} elseif ( strpos( $redirect_to, 'about.php?updated' ) ) {\n\t\t\t\t$errors->add( 'updated', __( '<strong>You have successfully updated WordPress!</strong> Please log back in to see what&#8217;s new.' ), 'message' );\n\t\t\t} elseif ( WP_Recovery_Mode_Link_Service::LOGIN_ACTION_ENTERED === $action ) {\n\t\t\t\t$errors->add( 'enter_recovery_mode', __( 'Recovery Mode Initialized. Please log in to continue.' ), 'message' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the login page errors.\n\t\t *\n\t\t * @since 3.6.0\n\t\t *\n\t\t * @param WP_Error $errors      WP Error object.\n\t\t * @param string   $redirect_to Redirect destination URL.\n\t\t */\n\t\t$errors = apply_filters( 'wp_login_errors', $errors, $redirect_to );\n\n\t\t// Clear any stale cookies.\n\t\tif ( $reauth ) {\n\t\t\twp_clear_auth_cookie();\n\t\t}\n\n\t\tlogin_header( __( 'Log In' ), '', $errors );\n\n\t\tif ( isset( $_POST['log'] ) ) {\n\t\t\t$user_login = ( 'incorrect_password' === $errors->get_error_code() || 'empty_password' === $errors->get_error_code() ) ? esc_attr( wp_unslash( $_POST['log'] ) ) : '';\n\t\t}\n\n\t\t$rememberme = ! empty( $_POST['rememberme'] );\n\n\t\tif ( $errors->has_errors() ) {\n\t\t\t$aria_describedby_error = ' aria-describedby=\"login_error\"';\n\t\t} else {\n\t\t\t$aria_describedby_error = '';\n\t\t}\n\n\t\twp_enqueue_script( 'user-profile' );\n\t\t?>\n\n\t\t<form name=\"loginform\" id=\"loginform\" action=\"<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>\" method=\"post\">\n\t\t\t<p>\n\t\t\t\t<label for=\"user_login\"><?php _e( 'Username or Email Address' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"log\" id=\"user_login\"<?php echo $aria_describedby_error; ?> class=\"input\" value=\"<?php echo esc_attr( $user_login ); ?>\" size=\"20\" autocapitalize=\"off\" />\n\t\t\t</p>\n\n\t\t\t<div class=\"user-pass-wrap\">\n\t\t\t\t<label for=\"user_pass\"><?php _e( 'Password' ); ?></label>\n\t\t\t\t<div class=\"wp-pwd\">\n\t\t\t\t\t<input type=\"password\" name=\"pwd\" id=\"user_pass\"<?php echo $aria_describedby_error; ?> class=\"input password-input\" value=\"\" size=\"20\" />\n\t\t\t\t\t<button type=\"button\" class=\"button button-secondary wp-hide-pw hide-if-no-js\" data-toggle=\"0\" aria-label=\"<?php esc_attr_e( 'Show password' ); ?>\">\n\t\t\t\t\t\t<span class=\"dashicons dashicons-visibility\" aria-hidden=\"true\"></span>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<?php\n\n\t\t\t/**\n\t\t\t * Fires following the 'Password' field in the login form.\n\t\t\t *\n\t\t\t * @since 2.1.0\n\t\t\t */\n\t\t\tdo_action( 'login_form' );\n\n\t\t\t?>\n\t\t\t<p class=\"forgetmenot\"><input name=\"rememberme\" type=\"checkbox\" id=\"rememberme\" value=\"forever\" <?php checked( $rememberme ); ?> /> <label for=\"rememberme\"><?php esc_html_e( 'Remember Me' ); ?></label></p>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"submit\" name=\"wp-submit\" id=\"wp-submit\" class=\"button button-primary button-large\" value=\"<?php esc_attr_e( 'Log In' ); ?>\" />\n\t\t\t\t<?php\n\n\t\t\t\tif ( $interim_login ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<input type=\"hidden\" name=\"interim-login\" value=\"1\" />\n\t\t\t\t\t<?php\n\t\t\t\t} else {\n\t\t\t\t\t?>\n\t\t\t\t\t<input type=\"hidden\" name=\"redirect_to\" value=\"<?php echo esc_attr( $redirect_to ); ?>\" />\n\t\t\t\t\t<?php\n\t\t\t\t}\n\n\t\t\t\tif ( $customize_login ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<input type=\"hidden\" name=\"customize-login\" value=\"1\" />\n\t\t\t\t\t<?php\n\t\t\t\t}\n\n\t\t\t\t?>\n\t\t\t\t<input type=\"hidden\" name=\"testcookie\" value=\"1\" />\n\t\t\t</p>\n\t\t</form>\n\n\t\t<?php\n\n\t\tif ( ! $interim_login ) {\n\t\t\t?>\n\t\t\t<p id=\"nav\">\n\t\t\t\t<?php\n\n\t\t\t\tif ( get_option( 'users_can_register' ) ) {\n\t\t\t\t\t$registration_url = sprintf( '<a href=\"%s\">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );\n\n\t\t\t\t\t/** This filter is documented in wp-includes/general-template.php */\n\t\t\t\t\techo apply_filters( 'register', $registration_url );\n\n\t\t\t\t\techo esc_html( $login_link_separator );\n\t\t\t\t}\n\n\t\t\t\t?>\n\t\t\t\t<a href=\"<?php echo esc_url( wp_lostpassword_url() ); ?>\"><?php _e( 'Lost your password?' ); ?></a>\n\t\t\t</p>\n\t\t\t<?php\n\t\t}\n\n\t\t$login_script  = 'function wp_attempt_focus() {';\n\t\t$login_script .= 'setTimeout( function() {';\n\t\t$login_script .= 'try {';\n\n\t\tif ( $user_login ) {\n\t\t\t$login_script .= 'd = document.getElementById( \"user_pass\" ); d.value = \"\";';\n\t\t} else {\n\t\t\t$login_script .= 'd = document.getElementById( \"user_login\" );';\n\n\t\t\tif ( $errors->get_error_code() === 'invalid_username' ) {\n\t\t\t\t$login_script .= 'd.value = \"\";';\n\t\t\t}\n\t\t}\n\n\t\t$login_script .= 'd.focus(); d.select();';\n\t\t$login_script .= '} catch( er ) {}';\n\t\t$login_script .= '}, 200);';\n\t\t$login_script .= \"}\\n\"; // End of wp_attempt_focus().\n\n\t\t/**\n\t\t * Filters whether to print the call to `wp_attempt_focus()` on the login screen.\n\t\t *\n\t\t * @since 4.8.0\n\t\t *\n\t\t * @param bool $print Whether to print the function call. Default true.\n\t\t */\n\t\tif ( apply_filters( 'enable_login_autofocus', true ) && ! $error ) {\n\t\t\t$login_script .= \"wp_attempt_focus();\\n\";\n\t\t}\n\n\t\t// Run `wpOnload()` if defined.\n\t\t$login_script .= \"if ( typeof wpOnload === 'function' ) { wpOnload() }\";\n\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t\t<?php echo $login_script; ?>\n\t\t</script>\n\t\t<?php\n\n\t\tif ( $interim_login ) {\n\t\t\t?>\n\t\t\t<script type=\"text/javascript\">\n\t\t\t( function() {\n\t\t\t\ttry {\n\t\t\t\t\tvar i, links = document.getElementsByTagName( 'a' );\n\t\t\t\t\tfor ( i in links ) {\n\t\t\t\t\t\tif ( links[i].href ) {\n\t\t\t\t\t\t\tlinks[i].target = '_blank';\n\t\t\t\t\t\t\tlinks[i].rel = 'noreferrer noopener';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch( er ) {}\n\t\t\t}());\n\t\t\t</script>\n\t\t\t<?php\n\t\t}\n\n\t\tlogin_footer();\n\t\tbreak;\n} // End action switch.\n", "num_lines": 1542}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Gets the email message from the user's mailbox to add as\n * a WordPress post. Mailbox connection information must be\n * configured under Settings > Writing\n *\n * @package WordPress\n */\n\n/** Make sure that the WordPress bootstrap has run before continuing. */\nrequire __DIR__ . '/wp-load.php';\n\n/** This filter is documented in wp-admin/options.php */\nif ( ! apply_filters( 'enable_post_by_email_configuration', true ) ) {\n\twp_die( __( 'This action has been disabled by the administrator.' ), 403 );\n}\n\n$mailserver_url = get_option( 'mailserver_url' );\n\nif ( 'mail.example.com' === $mailserver_url || empty( $mailserver_url ) ) {\n\twp_die( __( 'This action has been disabled by the administrator.' ), 403 );\n}\n\n/**\n * Fires to allow a plugin to do a complete takeover of Post by Email.\n *\n * @since 2.9.0\n */\ndo_action( 'wp-mail.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n/** Get the POP3 class with which to access the mailbox. */\nrequire_once ABSPATH . WPINC . '/class-pop3.php';\n\n/** Only check at this interval for new messages. */\nif ( ! defined( 'WP_MAIL_INTERVAL' ) ) {\n\tdefine( 'WP_MAIL_INTERVAL', 5 * MINUTE_IN_SECONDS );\n}\n\n$last_checked = get_transient( 'mailserver_last_checked' );\n\nif ( $last_checked ) {\n\twp_die( __( 'Slow down cowboy, no need to check for new mails so often!' ) );\n}\n\nset_transient( 'mailserver_last_checked', true, WP_MAIL_INTERVAL );\n\n$time_difference = get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;\n\n$phone_delim = '::';\n\n$pop3 = new POP3();\n\nif ( ! $pop3->connect( get_option( 'mailserver_url' ), get_option( 'mailserver_port' ) ) || ! $pop3->user( get_option( 'mailserver_login' ) ) ) {\n\twp_die( esc_html( $pop3->ERROR ) );\n}\n\n$count = $pop3->pass( get_option( 'mailserver_pass' ) );\n\nif ( false === $count ) {\n\twp_die( esc_html( $pop3->ERROR ) );\n}\n\nif ( 0 === $count ) {\n\t$pop3->quit();\n\twp_die( __( 'There doesn&#8217;t seem to be any new mail.' ) );\n}\n\nfor ( $i = 1; $i <= $count; $i++ ) {\n\n\t$message = $pop3->get( $i );\n\n\t$bodysignal                = false;\n\t$boundary                  = '';\n\t$charset                   = '';\n\t$content                   = '';\n\t$content_type              = '';\n\t$content_transfer_encoding = '';\n\t$post_author               = 1;\n\t$author_found              = false;\n\tforeach ( $message as $line ) {\n\t\t// Body signal.\n\t\tif ( strlen( $line ) < 3 ) {\n\t\t\t$bodysignal = true;\n\t\t}\n\t\tif ( $bodysignal ) {\n\t\t\t$content .= $line;\n\t\t} else {\n\t\t\tif ( preg_match( '/Content-Type: /i', $line ) ) {\n\t\t\t\t$content_type = trim( $line );\n\t\t\t\t$content_type = substr( $content_type, 14, strlen( $content_type ) - 14 );\n\t\t\t\t$content_type = explode( ';', $content_type );\n\t\t\t\tif ( ! empty( $content_type[1] ) ) {\n\t\t\t\t\t$charset = explode( '=', $content_type[1] );\n\t\t\t\t\t$charset = ( ! empty( $charset[1] ) ) ? trim( $charset[1] ) : '';\n\t\t\t\t}\n\t\t\t\t$content_type = $content_type[0];\n\t\t\t}\n\t\t\tif ( preg_match( '/Content-Transfer-Encoding: /i', $line ) ) {\n\t\t\t\t$content_transfer_encoding = trim( $line );\n\t\t\t\t$content_transfer_encoding = substr( $content_transfer_encoding, 27, strlen( $content_transfer_encoding ) - 27 );\n\t\t\t\t$content_transfer_encoding = explode( ';', $content_transfer_encoding );\n\t\t\t\t$content_transfer_encoding = $content_transfer_encoding[0];\n\t\t\t}\n\t\t\tif ( ( 'multipart/alternative' === $content_type ) && ( false !== strpos( $line, 'boundary=\"' ) ) && ( '' === $boundary ) ) {\n\t\t\t\t$boundary = trim( $line );\n\t\t\t\t$boundary = explode( '\"', $boundary );\n\t\t\t\t$boundary = $boundary[1];\n\t\t\t}\n\t\t\tif ( preg_match( '/Subject: /i', $line ) ) {\n\t\t\t\t$subject = trim( $line );\n\t\t\t\t$subject = substr( $subject, 9, strlen( $subject ) - 9 );\n\t\t\t\t// Captures any text in the subject before $phone_delim as the subject.\n\t\t\t\tif ( function_exists( 'iconv_mime_decode' ) ) {\n\t\t\t\t\t$subject = iconv_mime_decode( $subject, 2, get_option( 'blog_charset' ) );\n\t\t\t\t} else {\n\t\t\t\t\t$subject = wp_iso_descrambler( $subject );\n\t\t\t\t}\n\t\t\t\t$subject = explode( $phone_delim, $subject );\n\t\t\t\t$subject = $subject[0];\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Set the author using the email address (From or Reply-To, the last used)\n\t\t\t * otherwise use the site admin.\n\t\t\t */\n\t\t\tif ( ! $author_found && preg_match( '/^(From|Reply-To): /', $line ) ) {\n\t\t\t\tif ( preg_match( '|[a-z0-9_.-]+@[a-z0-9_.-]+(?!.*<)|i', $line, $matches ) ) {\n\t\t\t\t\t$author = $matches[0];\n\t\t\t\t} else {\n\t\t\t\t\t$author = trim( $line );\n\t\t\t\t}\n\t\t\t\t$author = sanitize_email( $author );\n\t\t\t\tif ( is_email( $author ) ) {\n\t\t\t\t\t/* translators: %s: Post author email address. */\n\t\t\t\t\techo '<p>' . sprintf( __( 'Author is %s' ), $author ) . '</p>';\n\t\t\t\t\t$userdata = get_user_by( 'email', $author );\n\t\t\t\t\tif ( ! empty( $userdata ) ) {\n\t\t\t\t\t\t$post_author  = $userdata->ID;\n\t\t\t\t\t\t$author_found = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( preg_match( '/Date: /i', $line ) ) { // Of the form '20 Mar 2002 20:32:37 +0100'.\n\t\t\t\t$ddate = str_replace( 'Date: ', '', trim( $line ) );\n\t\t\t\t// Remove parenthesised timezone string if it exists, as this confuses strtotime().\n\t\t\t\t$ddate           = preg_replace( '!\\s*\\(.+\\)\\s*$!', '', $ddate );\n\t\t\t\t$ddate_timestamp = strtotime( $ddate );\n\t\t\t\t$post_date       = gmdate( 'Y-m-d H:i:s', $ddate_timestamp + $time_difference );\n\t\t\t\t$post_date_gmt   = gmdate( 'Y-m-d H:i:s', $ddate_timestamp );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set $post_status based on $author_found and on author's publish_posts capability.\n\tif ( $author_found ) {\n\t\t$user        = new WP_User( $post_author );\n\t\t$post_status = ( $user->has_cap( 'publish_posts' ) ) ? 'publish' : 'pending';\n\t} else {\n\t\t// Author not found in DB, set status to pending. Author already set to admin.\n\t\t$post_status = 'pending';\n\t}\n\n\t$subject = trim( $subject );\n\n\tif ( 'multipart/alternative' === $content_type ) {\n\t\t$content = explode( '--' . $boundary, $content );\n\t\t$content = $content[2];\n\n\t\t// Match case-insensitive content-transfer-encoding.\n\t\tif ( preg_match( '/Content-Transfer-Encoding: quoted-printable/i', $content, $delim ) ) {\n\t\t\t$content = explode( $delim[0], $content );\n\t\t\t$content = $content[1];\n\t\t}\n\t\t$content = strip_tags( $content, '<img><p><br><i><b><u><em><strong><strike><font><span><div>' );\n\t}\n\t$content = trim( $content );\n\n\t/**\n\t * Filters the original content of the email.\n\t *\n\t * Give Post-By-Email extending plugins full access to the content, either\n\t * the raw content, or the content of the last quoted-printable section.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $content The original email content.\n\t */\n\t$content = apply_filters( 'wp_mail_original_content', $content );\n\n\tif ( false !== stripos( $content_transfer_encoding, 'quoted-printable' ) ) {\n\t\t$content = quoted_printable_decode( $content );\n\t}\n\n\tif ( function_exists( 'iconv' ) && ! empty( $charset ) ) {\n\t\t$content = iconv( $charset, get_option( 'blog_charset' ), $content );\n\t}\n\n\t// Captures any text in the body after $phone_delim as the body.\n\t$content = explode( $phone_delim, $content );\n\t$content = empty( $content[1] ) ? $content[0] : $content[1];\n\n\t$content = trim( $content );\n\n\t/**\n\t * Filters the content of the post submitted by email before saving.\n\t *\n\t * @since 1.2.0\n\t *\n\t * @param string $content The email content.\n\t */\n\t$post_content = apply_filters( 'phone_content', $content );\n\n\t$post_title = xmlrpc_getposttitle( $content );\n\n\tif ( '' === trim( $post_title ) ) {\n\t\t$post_title = $subject;\n\t}\n\n\t$post_category = array( get_option( 'default_email_category' ) );\n\n\t$post_data = compact( 'post_content', 'post_title', 'post_date', 'post_date_gmt', 'post_author', 'post_category', 'post_status' );\n\t$post_data = wp_slash( $post_data );\n\n\t$post_ID = wp_insert_post( $post_data );\n\tif ( is_wp_error( $post_ID ) ) {\n\t\techo \"\\n\" . $post_ID->get_error_message();\n\t}\n\n\t// We couldn't post, for whatever reason. Better move forward to the next email.\n\tif ( empty( $post_ID ) ) {\n\t\tcontinue;\n\t}\n\n\t/**\n\t * Fires after a post submitted by email is published.\n\t *\n\t * @since 1.2.0\n\t *\n\t * @param int $post_ID The post ID.\n\t */\n\tdo_action( 'publish_phone', $post_ID );\n\n\techo \"\\n<p><strong>\" . __( 'Author:' ) . '</strong> ' . esc_html( $post_author ) . '</p>';\n\techo \"\\n<p><strong>\" . __( 'Posted title:' ) . '</strong> ' . esc_html( $post_title ) . '</p>';\n\n\tif ( ! $pop3->delete( $i ) ) {\n\t\techo '<p>' . sprintf(\n\t\t\t/* translators: %s: POP3 error. */\n\t\t\t__( 'Oops: %s' ),\n\t\t\tesc_html( $pop3->ERROR )\n\t\t) . '</p>';\n\t\t$pop3->reset();\n\t\texit;\n\t} else {\n\t\techo '<p>' . sprintf(\n\t\t\t/* translators: %s: The message ID. */\n\t\t\t__( 'Mission complete. Message %s deleted.' ),\n\t\t\t'<strong>' . $i . '</strong>'\n\t\t) . '</p>';\n\t}\n}\n\n$pop3->quit();\n", "num_lines": 265}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Used to set up and fix common variables and include\n * the WordPress procedural and class library.\n *\n * Allows for some configuration in wp-config.php (see default-constants.php)\n *\n * @package WordPress\n */\n\n/**\n * Stores the location of the WordPress directory of functions, classes, and core content.\n *\n * @since 1.0.0\n */\ndefine( 'WPINC', 'wp-includes' );\n\n/**\n * Version information for the current WordPress release.\n *\n * These can't be directly globalized in version.php. When updating,\n * we're including version.php from another installation and don't want\n * these values to be overridden if already set.\n *\n * @global string $wp_version             The WordPress version string.\n * @global int    $wp_db_version          WordPress database version.\n * @global string $tinymce_version        TinyMCE version.\n * @global string $required_php_version   The required PHP version string.\n * @global string $required_mysql_version The required MySQL version string.\n * @global string $wp_local_package       Locale code of the package.\n */\nglobal $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version, $wp_local_package;\nrequire ABSPATH . WPINC . '/version.php';\nrequire ABSPATH . WPINC . '/load.php';\n\n// Check for the required PHP version and for the MySQL extension or a database drop-in.\nwp_check_php_mysql_versions();\n\n// Include files required for initialization.\nrequire ABSPATH . WPINC . '/class-wp-paused-extensions-storage.php';\nrequire ABSPATH . WPINC . '/class-wp-fatal-error-handler.php';\nrequire ABSPATH . WPINC . '/class-wp-recovery-mode-cookie-service.php';\nrequire ABSPATH . WPINC . '/class-wp-recovery-mode-key-service.php';\nrequire ABSPATH . WPINC . '/class-wp-recovery-mode-link-service.php';\nrequire ABSPATH . WPINC . '/class-wp-recovery-mode-email-service.php';\nrequire ABSPATH . WPINC . '/class-wp-recovery-mode.php';\nrequire ABSPATH . WPINC . '/error-protection.php';\nrequire ABSPATH . WPINC . '/default-constants.php';\nrequire_once ABSPATH . WPINC . '/plugin.php';\n\n/**\n * If not already configured, `$blog_id` will default to 1 in a single site\n * configuration. In multisite, it will be overridden by default in ms-settings.php.\n *\n * @global int $blog_id\n * @since 2.0.0\n */\nglobal $blog_id;\n\n// Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, SCRIPT_DEBUG, WP_CONTENT_DIR and WP_CACHE.\nwp_initial_constants();\n\n// Make sure we register the shutdown handler for fatal errors as soon as possible.\nwp_register_fatal_error_handler();\n\n// WordPress calculates offsets from UTC.\n// phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set\ndate_default_timezone_set( 'UTC' );\n\n// Standardize $_SERVER variables across setups.\nwp_fix_server_vars();\n\n// Check if we're in maintenance mode.\nwp_maintenance();\n\n// Start loading timer.\ntimer_start();\n\n// Check if we're in WP_DEBUG mode.\nwp_debug_mode();\n\n/**\n * Filters whether to enable loading of the advanced-cache.php drop-in.\n *\n * This filter runs before it can be used by plugins. It is designed for non-web\n * run-times. If false is returned, advanced-cache.php will never be loaded.\n *\n * @since 4.6.0\n *\n * @param bool $enable_advanced_cache Whether to enable loading advanced-cache.php (if present).\n *                                    Default true.\n */\nif ( WP_CACHE && apply_filters( 'enable_loading_advanced_cache_dropin', true ) && file_exists( WP_CONTENT_DIR . '/advanced-cache.php' ) ) {\n\t// For an advanced caching plugin to use. Uses a static drop-in because you would only want one.\n\tinclude WP_CONTENT_DIR . '/advanced-cache.php';\n\n\t// Re-initialize any hooks added manually by advanced-cache.php.\n\tif ( $wp_filter ) {\n\t\t$wp_filter = WP_Hook::build_preinitialized_hooks( $wp_filter );\n\t}\n}\n\n// Define WP_LANG_DIR if not set.\nwp_set_lang_dir();\n\n// Load early WordPress files.\nrequire ABSPATH . WPINC . '/compat.php';\nrequire ABSPATH . WPINC . '/class-wp-list-util.php';\nrequire ABSPATH . WPINC . '/formatting.php';\nrequire ABSPATH . WPINC . '/meta.php';\nrequire ABSPATH . WPINC . '/functions.php';\nrequire ABSPATH . WPINC . '/class-wp-meta-query.php';\nrequire ABSPATH . WPINC . '/class-wp-matchesmapregex.php';\nrequire ABSPATH . WPINC . '/class-wp.php';\nrequire ABSPATH . WPINC . '/class-wp-error.php';\nrequire ABSPATH . WPINC . '/pomo/mo.php';\n\n/**\n * @global wpdb $wpdb WordPress database abstraction object.\n * @since 0.71\n */\nglobal $wpdb;\n// Include the wpdb class and, if present, a db.php database drop-in.\nrequire_wp_db();\n\n// Set the database table prefix and the format specifiers for database table columns.\n$GLOBALS['table_prefix'] = $table_prefix;\nwp_set_wpdb_vars();\n\n// Start the WordPress object cache, or an external object cache if the drop-in is present.\nwp_start_object_cache();\n\n// Attach the default filters.\nrequire ABSPATH . WPINC . '/default-filters.php';\n\n// Initialize multisite if enabled.\nif ( is_multisite() ) {\n\trequire ABSPATH . WPINC . '/class-wp-site-query.php';\n\trequire ABSPATH . WPINC . '/class-wp-network-query.php';\n\trequire ABSPATH . WPINC . '/ms-blogs.php';\n\trequire ABSPATH . WPINC . '/ms-settings.php';\n} elseif ( ! defined( 'MULTISITE' ) ) {\n\tdefine( 'MULTISITE', false );\n}\n\nregister_shutdown_function( 'shutdown_action_hook' );\n\n// Stop most of WordPress from being loaded if we just want the basics.\nif ( SHORTINIT ) {\n\treturn false;\n}\n\n// Load the L10n library.\nrequire_once ABSPATH . WPINC . '/l10n.php';\nrequire_once ABSPATH . WPINC . '/class-wp-locale.php';\nrequire_once ABSPATH . WPINC . '/class-wp-locale-switcher.php';\n\n// Run the installer if WordPress is not installed.\nwp_not_installed();\n\n// Load most of WordPress.\nrequire ABSPATH . WPINC . '/class-wp-walker.php';\nrequire ABSPATH . WPINC . '/class-wp-ajax-response.php';\nrequire ABSPATH . WPINC . '/capabilities.php';\nrequire ABSPATH . WPINC . '/class-wp-roles.php';\nrequire ABSPATH . WPINC . '/class-wp-role.php';\nrequire ABSPATH . WPINC . '/class-wp-user.php';\nrequire ABSPATH . WPINC . '/class-wp-query.php';\nrequire ABSPATH . WPINC . '/query.php';\nrequire ABSPATH . WPINC . '/class-wp-date-query.php';\nrequire ABSPATH . WPINC . '/theme.php';\nrequire ABSPATH . WPINC . '/class-wp-theme.php';\nrequire ABSPATH . WPINC . '/template.php';\nrequire ABSPATH . WPINC . '/class-wp-user-request.php';\nrequire ABSPATH . WPINC . '/user.php';\nrequire ABSPATH . WPINC . '/class-wp-user-query.php';\nrequire ABSPATH . WPINC . '/class-wp-session-tokens.php';\nrequire ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php';\nrequire ABSPATH . WPINC . '/class-wp-metadata-lazyloader.php';\nrequire ABSPATH . WPINC . '/general-template.php';\nrequire ABSPATH . WPINC . '/link-template.php';\nrequire ABSPATH . WPINC . '/author-template.php';\nrequire ABSPATH . WPINC . '/post.php';\nrequire ABSPATH . WPINC . '/class-walker-page.php';\nrequire ABSPATH . WPINC . '/class-walker-page-dropdown.php';\nrequire ABSPATH . WPINC . '/class-wp-post-type.php';\nrequire ABSPATH . WPINC . '/class-wp-post.php';\nrequire ABSPATH . WPINC . '/post-template.php';\nrequire ABSPATH . WPINC . '/revision.php';\nrequire ABSPATH . WPINC . '/post-formats.php';\nrequire ABSPATH . WPINC . '/post-thumbnail-template.php';\nrequire ABSPATH . WPINC . '/category.php';\nrequire ABSPATH . WPINC . '/class-walker-category.php';\nrequire ABSPATH . WPINC . '/class-walker-category-dropdown.php';\nrequire ABSPATH . WPINC . '/category-template.php';\nrequire ABSPATH . WPINC . '/comment.php';\nrequire ABSPATH . WPINC . '/class-wp-comment.php';\nrequire ABSPATH . WPINC . '/class-wp-comment-query.php';\nrequire ABSPATH . WPINC . '/class-walker-comment.php';\nrequire ABSPATH . WPINC . '/comment-template.php';\nrequire ABSPATH . WPINC . '/rewrite.php';\nrequire ABSPATH . WPINC . '/class-wp-rewrite.php';\nrequire ABSPATH . WPINC . '/feed.php';\nrequire ABSPATH . WPINC . '/bookmark.php';\nrequire ABSPATH . WPINC . '/bookmark-template.php';\nrequire ABSPATH . WPINC . '/kses.php';\nrequire ABSPATH . WPINC . '/cron.php';\nrequire ABSPATH . WPINC . '/deprecated.php';\nrequire ABSPATH . WPINC . '/script-loader.php';\nrequire ABSPATH . WPINC . '/taxonomy.php';\nrequire ABSPATH . WPINC . '/class-wp-taxonomy.php';\nrequire ABSPATH . WPINC . '/class-wp-term.php';\nrequire ABSPATH . WPINC . '/class-wp-term-query.php';\nrequire ABSPATH . WPINC . '/class-wp-tax-query.php';\nrequire ABSPATH . WPINC . '/update.php';\nrequire ABSPATH . WPINC . '/canonical.php';\nrequire ABSPATH . WPINC . '/shortcodes.php';\nrequire ABSPATH . WPINC . '/embed.php';\nrequire ABSPATH . WPINC . '/class-wp-embed.php';\nrequire ABSPATH . WPINC . '/class-wp-oembed.php';\nrequire ABSPATH . WPINC . '/class-wp-oembed-controller.php';\nrequire ABSPATH . WPINC . '/media.php';\nrequire ABSPATH . WPINC . '/http.php';\nrequire ABSPATH . WPINC . '/class-http.php';\nrequire ABSPATH . WPINC . '/class-wp-http-streams.php';\nrequire ABSPATH . WPINC . '/class-wp-http-curl.php';\nrequire ABSPATH . WPINC . '/class-wp-http-proxy.php';\nrequire ABSPATH . WPINC . '/class-wp-http-cookie.php';\nrequire ABSPATH . WPINC . '/class-wp-http-encoding.php';\nrequire ABSPATH . WPINC . '/class-wp-http-response.php';\nrequire ABSPATH . WPINC . '/class-wp-http-requests-response.php';\nrequire ABSPATH . WPINC . '/class-wp-http-requests-hooks.php';\nrequire ABSPATH . WPINC . '/widgets.php';\nrequire ABSPATH . WPINC . '/class-wp-widget.php';\nrequire ABSPATH . WPINC . '/class-wp-widget-factory.php';\nrequire ABSPATH . WPINC . '/nav-menu.php';\nrequire ABSPATH . WPINC . '/nav-menu-template.php';\nrequire ABSPATH . WPINC . '/admin-bar.php';\nrequire ABSPATH . WPINC . '/rest-api.php';\nrequire ABSPATH . WPINC . '/rest-api/class-wp-rest-server.php';\nrequire ABSPATH . WPINC . '/rest-api/class-wp-rest-response.php';\nrequire ABSPATH . WPINC . '/rest-api/class-wp-rest-request.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-posts-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-attachments-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-types-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-statuses-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-revisions-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-autosaves-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-taxonomies-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-terms-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-users-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-comments-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-search-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-blocks-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-types-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-renderer-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-settings-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-themes-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-plugins-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-directory-controller.php';\nrequire ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-meta-fields.php';\nrequire ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-comment-meta-fields.php';\nrequire ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-post-meta-fields.php';\nrequire ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-term-meta-fields.php';\nrequire ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-user-meta-fields.php';\nrequire ABSPATH . WPINC . '/rest-api/search/class-wp-rest-search-handler.php';\nrequire ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-search-handler.php';\nrequire ABSPATH . WPINC . '/sitemaps.php';\nrequire ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps.php';\nrequire ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-index.php';\nrequire ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-provider.php';\nrequire ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-registry.php';\nrequire ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-renderer.php';\nrequire ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-stylesheet.php';\nrequire ABSPATH . WPINC . '/sitemaps/providers/class-wp-sitemaps-posts.php';\nrequire ABSPATH . WPINC . '/sitemaps/providers/class-wp-sitemaps-taxonomies.php';\nrequire ABSPATH . WPINC . '/sitemaps/providers/class-wp-sitemaps-users.php';\nrequire ABSPATH . WPINC . '/class-wp-block-type.php';\nrequire ABSPATH . WPINC . '/class-wp-block-pattern-categories-registry.php';\nrequire ABSPATH . WPINC . '/class-wp-block-patterns-registry.php';\nrequire ABSPATH . WPINC . '/class-wp-block-styles-registry.php';\nrequire ABSPATH . WPINC . '/class-wp-block-type-registry.php';\nrequire ABSPATH . WPINC . '/class-wp-block.php';\nrequire ABSPATH . WPINC . '/class-wp-block-list.php';\nrequire ABSPATH . WPINC . '/class-wp-block-parser.php';\nrequire ABSPATH . WPINC . '/blocks.php';\nrequire ABSPATH . WPINC . '/blocks/index.php';\nrequire ABSPATH . WPINC . '/block-patterns.php';\n\n$GLOBALS['wp_embed'] = new WP_Embed();\n\n// Load multisite-specific files.\nif ( is_multisite() ) {\n\trequire ABSPATH . WPINC . '/ms-functions.php';\n\trequire ABSPATH . WPINC . '/ms-default-filters.php';\n\trequire ABSPATH . WPINC . '/ms-deprecated.php';\n}\n\n// Define constants that rely on the API to obtain the default value.\n// Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in.\nwp_plugin_directory_constants();\n\n$GLOBALS['wp_plugin_paths'] = array();\n\n// Load must-use plugins.\nforeach ( wp_get_mu_plugins() as $mu_plugin ) {\n\tinclude_once $mu_plugin;\n\n\t/**\n\t * Fires once a single must-use plugin has loaded.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param string $mu_plugin Full path to the plugin's main file.\n\t */\n\tdo_action( 'mu_plugin_loaded', $mu_plugin );\n}\nunset( $mu_plugin );\n\n// Load network activated plugins.\nif ( is_multisite() ) {\n\tforeach ( wp_get_active_network_plugins() as $network_plugin ) {\n\t\twp_register_plugin_realpath( $network_plugin );\n\t\tinclude_once $network_plugin;\n\n\t\t/**\n\t\t * Fires once a single network-activated plugin has loaded.\n\t\t *\n\t\t * @since 5.1.0\n\t\t *\n\t\t * @param string $network_plugin Full path to the plugin's main file.\n\t\t */\n\t\tdo_action( 'network_plugin_loaded', $network_plugin );\n\t}\n\tunset( $network_plugin );\n}\n\n/**\n * Fires once all must-use and network-activated plugins have loaded.\n *\n * @since 2.8.0\n */\ndo_action( 'muplugins_loaded' );\n\nif ( is_multisite() ) {\n\tms_cookie_constants();\n}\n\n// Define constants after multisite is loaded.\nwp_cookie_constants();\n\n// Define and enforce our SSL constants.\nwp_ssl_constants();\n\n// Create common globals.\nrequire ABSPATH . WPINC . '/vars.php';\n\n// Make taxonomies and posts available to plugins and themes.\n// @plugin authors: warning: these get registered again on the init hook.\ncreate_initial_taxonomies();\ncreate_initial_post_types();\n\nwp_start_scraping_edited_file_errors();\n\n// Register the default theme directory root.\nregister_theme_directory( get_theme_root() );\n\nif ( ! is_multisite() ) {\n\t// Handle users requesting a recovery mode link and initiating recovery mode.\n\twp_recovery_mode()->initialize();\n}\n\n// Load active plugins.\nforeach ( wp_get_active_and_valid_plugins() as $plugin ) {\n\twp_register_plugin_realpath( $plugin );\n\tinclude_once $plugin;\n\n\t/**\n\t * Fires once a single activated plugin has loaded.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param string $plugin Full path to the plugin's main file.\n\t */\n\tdo_action( 'plugin_loaded', $plugin );\n}\nunset( $plugin );\n\n// Load pluggable functions.\nrequire ABSPATH . WPINC . '/pluggable.php';\nrequire ABSPATH . WPINC . '/pluggable-deprecated.php';\n\n// Set internal encoding.\nwp_set_internal_encoding();\n\n// Run wp_cache_postload() if object cache is enabled and the function exists.\nif ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) {\n\twp_cache_postload();\n}\n\n/**\n * Fires once activated plugins have loaded.\n *\n * Pluggable functions are also available at this point in the loading order.\n *\n * @since 1.5.0\n */\ndo_action( 'plugins_loaded' );\n\n// Define constants which affect functionality if not already defined.\nwp_functionality_constants();\n\n// Add magic quotes and set up $_REQUEST ( $_GET + $_POST ).\nwp_magic_quotes();\n\n/**\n * Fires when comment cookies are sanitized.\n *\n * @since 2.0.11\n */\ndo_action( 'sanitize_comment_cookies' );\n\n/**\n * WordPress Query object\n *\n * @global WP_Query $wp_the_query WordPress Query object.\n * @since 2.0.0\n */\n$GLOBALS['wp_the_query'] = new WP_Query();\n\n/**\n * Holds the reference to @see $wp_the_query\n * Use this global for WordPress queries\n *\n * @global WP_Query $wp_query WordPress Query object.\n * @since 1.5.0\n */\n$GLOBALS['wp_query'] = $GLOBALS['wp_the_query'];\n\n/**\n * Holds the WordPress Rewrite object for creating pretty URLs\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n * @since 1.5.0\n */\n$GLOBALS['wp_rewrite'] = new WP_Rewrite();\n\n/**\n * WordPress Object\n *\n * @global WP $wp Current WordPress environment instance.\n * @since 2.0.0\n */\n$GLOBALS['wp'] = new WP();\n\n/**\n * WordPress Widget Factory Object\n *\n * @global WP_Widget_Factory $wp_widget_factory\n * @since 2.8.0\n */\n$GLOBALS['wp_widget_factory'] = new WP_Widget_Factory();\n\n/**\n * WordPress User Roles\n *\n * @global WP_Roles $wp_roles WordPress role management object.\n * @since 2.0.0\n */\n$GLOBALS['wp_roles'] = new WP_Roles();\n\n/**\n * Fires before the theme is loaded.\n *\n * @since 2.6.0\n */\ndo_action( 'setup_theme' );\n\n// Define the template related constants.\nwp_templating_constants();\n\n// Load the default text localization domain.\nload_default_textdomain();\n\n$locale      = get_locale();\n$locale_file = WP_LANG_DIR . \"/$locale.php\";\nif ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) {\n\trequire $locale_file;\n}\nunset( $locale_file );\n\n/**\n * WordPress Locale object for loading locale domain date and various strings.\n *\n * @global WP_Locale $wp_locale WordPress date and time locale object.\n * @since 2.1.0\n */\n$GLOBALS['wp_locale'] = new WP_Locale();\n\n/**\n * WordPress Locale Switcher object for switching locales.\n *\n * @since 4.7.0\n *\n * @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.\n */\n$GLOBALS['wp_locale_switcher'] = new WP_Locale_Switcher();\n$GLOBALS['wp_locale_switcher']->init();\n\n// Load the functions for the active theme, for both parent and child theme if applicable.\nforeach ( wp_get_active_and_valid_themes() as $theme ) {\n\tif ( file_exists( $theme . '/functions.php' ) ) {\n\t\tinclude $theme . '/functions.php';\n\t}\n}\nunset( $theme );\n\n/**\n * Fires after the theme is loaded.\n *\n * @since 3.0.0\n */\ndo_action( 'after_setup_theme' );\n\n// Create an instance of WP_Site_Health so that Cron events may fire.\nif ( ! class_exists( 'WP_Site_Health' ) ) {\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';\n}\nWP_Site_Health::get_instance();\n\n// Set up current user.\n$GLOBALS['wp']->init();\n\n/**\n * Fires after WordPress has finished loading but before any headers are sent.\n *\n * Most of WP is loaded at this stage, and the user is authenticated. WP continues\n * to load on the {@see 'init'} hook that follows (e.g. widgets), and many plugins instantiate\n * themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.).\n *\n * If you wish to plug an action once WP is loaded, use the {@see 'wp_loaded'} hook below.\n *\n * @since 1.5.0\n */\ndo_action( 'init' );\n\n// Check site status.\nif ( is_multisite() ) {\n\t$file = ms_site_check();\n\tif ( true !== $file ) {\n\t\trequire $file;\n\t\tdie();\n\t}\n\tunset( $file );\n}\n\n/**\n * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated.\n *\n * Ajax requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for\n * users not logged in.\n *\n * @link https://codex.wordpress.org/AJAX_in_Plugins\n *\n * @since 3.0.0\n */\ndo_action( 'wp_loaded' );\n", "num_lines": 569}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/** Sets up the WordPress Environment. */\nrequire __DIR__ . '/wp-load.php';\n\nadd_action( 'wp_head', 'wp_no_robots' );\n\nrequire __DIR__ . '/wp-blog-header.php';\n\nnocache_headers();\n\nif ( is_array( get_site_option( 'illegal_names' ) ) && isset( $_GET['new'] ) && in_array( $_GET['new'], get_site_option( 'illegal_names' ), true ) ) {\n\twp_redirect( network_home_url() );\n\tdie();\n}\n\n/**\n * Prints signup_header via wp_head\n *\n * @since MU (3.0.0)\n */\nfunction do_signup_header() {\n\t/**\n\t * Fires within the head section of the site sign-up screen.\n\t *\n\t * @since 3.0.0\n\t */\n\tdo_action( 'signup_header' );\n}\nadd_action( 'wp_head', 'do_signup_header' );\n\nif ( ! is_multisite() ) {\n\twp_redirect( wp_registration_url() );\n\tdie();\n}\n\nif ( ! is_main_site() ) {\n\twp_redirect( network_site_url( 'wp-signup.php' ) );\n\tdie();\n}\n\n// Fix for page title.\n$wp_query->is_404 = false;\n\n/**\n * Fires before the Site Signup page is loaded.\n *\n * @since 4.4.0\n */\ndo_action( 'before_signup_header' );\n\n/**\n * Prints styles for front-end Multisite signup pages\n *\n * @since MU (3.0.0)\n */\nfunction wpmu_signup_stylesheet() {\n\t?>\n\t<style type=\"text/css\">\n\t\t.mu_register { width: 90%; margin:0 auto; }\n\t\t.mu_register form { margin-top: 2em; }\n\t\t.mu_register .error { font-weight: 600; padding: 10px; color: #333333; background: #FFEBE8; border: 1px solid #CC0000; }\n\t\t.mu_register input[type=\"submit\"],\n\t\t\t.mu_register #blog_title,\n\t\t\t.mu_register #user_email,\n\t\t\t.mu_register #blogname,\n\t\t\t.mu_register #user_name { width:100%; font-size: 24px; margin:5px 0; }\n\t\t.mu_register #site-language { display: block; }\n\t\t.mu_register .prefix_address,\n\t\t\t.mu_register .suffix_address { font-size: 18px; display:inline; }\n\t\t.mu_register label { font-weight: 600; font-size: 15px; display: block; margin: 10px 0; }\n\t\t.mu_register label.checkbox { display:inline; }\n\t\t.mu_register .mu_alert { font-weight: 600; padding: 10px; color: #333333; background: #ffffe0; border: 1px solid #e6db55; }\n\t</style>\n\t<?php\n}\n\nadd_action( 'wp_head', 'wpmu_signup_stylesheet' );\nget_header( 'wp-signup' );\n\n/**\n * Fires before the site sign-up form.\n *\n * @since 3.0.0\n */\ndo_action( 'before_signup_form' );\n?>\n<div id=\"signup-content\" class=\"widecolumn\">\n<div class=\"mu_register wp-signup-container\" role=\"main\">\n<?php\n/**\n * Generates and displays the Signup and Create Site forms\n *\n * @since MU (3.0.0)\n *\n * @param string          $blogname   The new site name.\n * @param string          $blog_title The new site title.\n * @param WP_Error|string $errors     A WP_Error object containing existing errors. Defaults to empty string.\n */\nfunction show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {\n\tif ( ! is_wp_error( $errors ) ) {\n\t\t$errors = new WP_Error();\n\t}\n\n\t$current_network = get_network();\n\t// Blog name.\n\tif ( ! is_subdomain_install() ) {\n\t\techo '<label for=\"blogname\">' . __( 'Site Name:' ) . '</label>';\n\t} else {\n\t\techo '<label for=\"blogname\">' . __( 'Site Domain:' ) . '</label>';\n\t}\n\n\t$errmsg = $errors->get_error_message( 'blogname' );\n\tif ( $errmsg ) {\n\t\t?>\n\t\t<p class=\"error\"><?php echo $errmsg; ?></p>\n\t\t<?php\n\t}\n\n\tif ( ! is_subdomain_install() ) {\n\t\techo '<span class=\"prefix_address\">' . $current_network->domain . $current_network->path . '</span><input name=\"blogname\" type=\"text\" id=\"blogname\" value=\"' . esc_attr( $blogname ) . '\" maxlength=\"60\" /><br />';\n\t} else {\n\t\t$site_domain = preg_replace( '|^www\\.|', '', $current_network->domain );\n\t\techo '<input name=\"blogname\" type=\"text\" id=\"blogname\" value=\"' . esc_attr( $blogname ) . '\" maxlength=\"60\" /><span class=\"suffix_address\">.' . esc_html( $site_domain ) . '</span><br />';\n\t}\n\n\tif ( ! is_user_logged_in() ) {\n\t\tif ( ! is_subdomain_install() ) {\n\t\t\t$site = $current_network->domain . $current_network->path . __( 'sitename' );\n\t\t} else {\n\t\t\t$site = __( 'domain' ) . '.' . $site_domain . $current_network->path;\n\t\t}\n\n\t\tprintf(\n\t\t\t'<p>(<strong>%s</strong>) %s</p>',\n\t\t\t/* translators: %s: Site address. */\n\t\t\tsprintf( __( 'Your address will be %s.' ), $site ),\n\t\t\t__( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' )\n\t\t);\n\t}\n\n\t// Site Title.\n\t?>\n\t<label for=\"blog_title\"><?php _e( 'Site Title:' ); ?></label>\n\t<?php\n\t$errmsg = $errors->get_error_message( 'blog_title' );\n\tif ( $errmsg ) {\n\t\t?>\n\t\t<p class=\"error\"><?php echo $errmsg; ?></p>\n\t\t<?php\n\t}\n\techo '<input name=\"blog_title\" type=\"text\" id=\"blog_title\" value=\"' . esc_attr( $blog_title ) . '\" />';\n\t?>\n\n\t<?php\n\t// Site Language.\n\t$languages = signup_get_available_languages();\n\n\tif ( ! empty( $languages ) ) :\n\t\t?>\n\t\t<p>\n\t\t\t<label for=\"site-language\"><?php _e( 'Site Language:' ); ?></label>\n\t\t\t<?php\n\t\t\t// Network default.\n\t\t\t$lang = get_site_option( 'WPLANG' );\n\n\t\t\tif ( isset( $_POST['WPLANG'] ) ) {\n\t\t\t\t$lang = $_POST['WPLANG'];\n\t\t\t}\n\n\t\t\t// Use US English if the default isn't available.\n\t\t\tif ( ! in_array( $lang, $languages, true ) ) {\n\t\t\t\t$lang = '';\n\t\t\t}\n\n\t\t\twp_dropdown_languages(\n\t\t\t\tarray(\n\t\t\t\t\t'name'                        => 'WPLANG',\n\t\t\t\t\t'id'                          => 'site-language',\n\t\t\t\t\t'selected'                    => $lang,\n\t\t\t\t\t'languages'                   => $languages,\n\t\t\t\t\t'show_available_translations' => false,\n\t\t\t\t)\n\t\t\t);\n\t\t\t?>\n\t\t</p>\n\t\t<?php\n\t\tendif; // Languages.\n\n\t\t$blog_public_on_checked  = '';\n\t\t$blog_public_off_checked = '';\n\tif ( isset( $_POST['blog_public'] ) && '0' === $_POST['blog_public'] ) {\n\t\t$blog_public_off_checked = 'checked=\"checked\"';\n\t} else {\n\t\t$blog_public_on_checked = 'checked=\"checked\"';\n\t}\n\t?>\n\n\t<div id=\"privacy\">\n\t\t<p class=\"privacy-intro\">\n\t\t\t<?php _e( 'Privacy:' ); ?>\n\t\t\t<?php _e( 'Allow search engines to index this site.' ); ?>\n\t\t\t<br style=\"clear:both\" />\n\t\t\t<label class=\"checkbox\" for=\"blog_public_on\">\n\t\t\t\t<input type=\"radio\" id=\"blog_public_on\" name=\"blog_public\" value=\"1\" <?php echo $blog_public_on_checked; ?> />\n\t\t\t\t<strong><?php _e( 'Yes' ); ?></strong>\n\t\t\t</label>\n\t\t\t<label class=\"checkbox\" for=\"blog_public_off\">\n\t\t\t\t<input type=\"radio\" id=\"blog_public_off\" name=\"blog_public\" value=\"0\" <?php echo $blog_public_off_checked; ?> />\n\t\t\t\t<strong><?php _e( 'No' ); ?></strong>\n\t\t\t</label>\n\t\t</p>\n\t</div>\n\n\t<?php\n\t/**\n\t * Fires after the site sign-up form.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param WP_Error $errors A WP_Error object possibly containing 'blogname' or 'blog_title' errors.\n\t */\n\tdo_action( 'signup_blogform', $errors );\n}\n\n/**\n * Validate the new site signup\n *\n * @since MU (3.0.0)\n *\n * @return array Contains the new site data and error messages.\n */\nfunction validate_blog_form() {\n\t$user = '';\n\tif ( is_user_logged_in() ) {\n\t\t$user = wp_get_current_user();\n\t}\n\n\treturn wpmu_validate_blog_signup( $_POST['blogname'], $_POST['blog_title'], $user );\n}\n\n/**\n * Display user registration form\n *\n * @since MU (3.0.0)\n *\n * @param string          $user_name  The entered username.\n * @param string          $user_email The entered email address.\n * @param WP_Error|string $errors     A WP_Error object containing existing errors. Defaults to empty string.\n */\nfunction show_user_form( $user_name = '', $user_email = '', $errors = '' ) {\n\tif ( ! is_wp_error( $errors ) ) {\n\t\t$errors = new WP_Error();\n\t}\n\n\t// Username.\n\techo '<label for=\"user_name\">' . __( 'Username:' ) . '</label>';\n\t$errmsg = $errors->get_error_message( 'user_name' );\n\tif ( $errmsg ) {\n\t\techo '<p class=\"error\">' . $errmsg . '</p>';\n\t}\n\techo '<input name=\"user_name\" type=\"text\" id=\"user_name\" value=\"' . esc_attr( $user_name ) . '\" autocapitalize=\"none\" autocorrect=\"off\" maxlength=\"60\" /><br />';\n\t_e( '(Must be at least 4 characters, letters and numbers only.)' );\n\t?>\n\n\t<label for=\"user_email\"><?php _e( 'Email&nbsp;Address:' ); ?></label>\n\t<?php\n\t$errmsg = $errors->get_error_message( 'user_email' );\n\tif ( $errmsg ) {\n\t\t?>\n\t\t<p class=\"error\"><?php echo $errmsg; ?></p>\n\t<?php } ?>\n\t<input name=\"user_email\" type=\"email\" id=\"user_email\" value=\"<?php echo esc_attr( $user_email ); ?>\" maxlength=\"200\" /><br /><?php _e( 'We send your registration email to this address. (Double-check your email address before continuing.)' ); ?>\n\t<?php\n\t$errmsg = $errors->get_error_message( 'generic' );\n\tif ( $errmsg ) {\n\t\techo '<p class=\"error\">' . $errmsg . '</p>';\n\t}\n\t/**\n\t * Fires at the end of the user registration form on the site sign-up form.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param WP_Error $errors A WP_Error object containing 'user_name' or 'user_email' errors.\n\t */\n\tdo_action( 'signup_extra_fields', $errors );\n}\n\n/**\n * Validate user signup name and email\n *\n * @since MU (3.0.0)\n *\n * @return array Contains username, email, and error messages.\n */\nfunction validate_user_form() {\n\treturn wpmu_validate_user_signup( $_POST['user_name'], $_POST['user_email'] );\n}\n\n/**\n * Allow returning users to sign up for another site\n *\n * @since MU (3.0.0)\n *\n * @param string          $blogname   The new site name\n * @param string          $blog_title The new site title.\n * @param WP_Error|string $errors     A WP_Error object containing existing errors. Defaults to empty string.\n */\nfunction signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) {\n\t$current_user = wp_get_current_user();\n\n\tif ( ! is_wp_error( $errors ) ) {\n\t\t$errors = new WP_Error();\n\t}\n\n\t$signup_defaults = array(\n\t\t'blogname'   => $blogname,\n\t\t'blog_title' => $blog_title,\n\t\t'errors'     => $errors,\n\t);\n\n\t/**\n\t * Filters the default site sign-up variables.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param array $signup_defaults {\n\t *     An array of default site sign-up variables.\n\t *\n\t *     @type string   $blogname   The site blogname.\n\t *     @type string   $blog_title The site title.\n\t *     @type WP_Error $errors     A WP_Error object possibly containing 'blogname' or 'blog_title' errors.\n\t * }\n\t */\n\t$filtered_results = apply_filters( 'signup_another_blog_init', $signup_defaults );\n\n\t$blogname   = $filtered_results['blogname'];\n\t$blog_title = $filtered_results['blog_title'];\n\t$errors     = $filtered_results['errors'];\n\n\t/* translators: %s: Network title. */\n\techo '<h2>' . sprintf( __( 'Get <em>another</em> %s site in seconds' ), get_network()->site_name ) . '</h2>';\n\n\tif ( $errors->has_errors() ) {\n\t\techo '<p>' . __( 'There was a problem, please correct the form below and try again.' ) . '</p>';\n\t}\n\t?>\n\t<p>\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: Current user's display name. */\n\t\t\t__( 'Welcome back, %s. By filling out the form below, you can <strong>add another site to your account</strong>. There is no limit to the number of sites you can have, so create to your heart&#8217;s content, but write responsibly!' ),\n\t\t\t$current_user->display_name\n\t\t);\n\t\t?>\n\t</p>\n\n\t<?php\n\t$blogs = get_blogs_of_user( $current_user->ID );\n\tif ( ! empty( $blogs ) ) {\n\t\t?>\n\n\t\t\t<p><?php _e( 'Sites you are already a member of:' ); ?></p>\n\t\t\t<ul>\n\t\t\t\t<?php\n\t\t\t\tforeach ( $blogs as $blog ) {\n\t\t\t\t\t$home_url = get_home_url( $blog->userblog_id );\n\t\t\t\t\techo '<li><a href=\"' . esc_url( $home_url ) . '\">' . $home_url . '</a></li>';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</ul>\n\t<?php } ?>\n\n\t<p><?php _e( 'If you&#8217;re not going to use a great site domain, leave it for a new user. Now have at it!' ); ?></p>\n\t<form id=\"setupform\" method=\"post\" action=\"wp-signup.php\">\n\t\t<input type=\"hidden\" name=\"stage\" value=\"gimmeanotherblog\" />\n\t\t<?php\n\t\t/**\n\t\t * Hidden sign-up form fields output when creating another site or user.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t *\n\t\t * @param string $context A string describing the steps of the sign-up process. The value can be\n\t\t *                        'create-another-site', 'validate-user', or 'validate-site'.\n\t\t */\n\t\tdo_action( 'signup_hidden_fields', 'create-another-site' );\n\t\t?>\n\t\t<?php show_blog_form( $blogname, $blog_title, $errors ); ?>\n\t\t<p class=\"submit\"><input type=\"submit\" name=\"submit\" class=\"submit\" value=\"<?php esc_attr_e( 'Create Site' ); ?>\" /></p>\n\t</form>\n\t<?php\n}\n\n/**\n * Validate a new site signup for an existing user.\n *\n * @global string          $blogname   The new site's subdomain or directory name.\n * @global string          $blog_title The new site's title.\n * @global WP_Error        $errors     Existing errors in the global scope.\n * @global string          $domain     The new site's domain.\n * @global string          $path       The new site's path.\n *\n * @since MU (3.0.0)\n *\n * @return null|bool True if site signup was validated, false if error.\n *                   The function halts all execution if the user is not logged in.\n */\nfunction validate_another_blog_signup() {\n\tglobal $blogname, $blog_title, $errors, $domain, $path;\n\t$current_user = wp_get_current_user();\n\tif ( ! is_user_logged_in() ) {\n\t\tdie();\n\t}\n\n\t$result = validate_blog_form();\n\n\t// Extracted values set/overwrite globals.\n\t$domain     = $result['domain'];\n\t$path       = $result['path'];\n\t$blogname   = $result['blogname'];\n\t$blog_title = $result['blog_title'];\n\t$errors     = $result['errors'];\n\n\tif ( $errors->has_errors() ) {\n\t\tsignup_another_blog( $blogname, $blog_title, $errors );\n\t\treturn false;\n\t}\n\n\t$public = (int) $_POST['blog_public'];\n\n\t$blog_meta_defaults = array(\n\t\t'lang_id' => 1,\n\t\t'public'  => $public,\n\t);\n\n\t// Handle the language setting for the new site.\n\tif ( ! empty( $_POST['WPLANG'] ) ) {\n\n\t\t$languages = signup_get_available_languages();\n\n\t\tif ( in_array( $_POST['WPLANG'], $languages, true ) ) {\n\t\t\t$language = wp_unslash( sanitize_text_field( $_POST['WPLANG'] ) );\n\n\t\t\tif ( $language ) {\n\t\t\t\t$blog_meta_defaults['WPLANG'] = $language;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filters the new site meta variables.\n\t *\n\t * Use the {@see 'add_signup_meta'} filter instead.\n\t *\n\t * @since MU (3.0.0)\n\t * @deprecated 3.0.0 Use the {@see 'add_signup_meta'} filter instead.\n\t *\n\t * @param array $blog_meta_defaults An array of default blog meta variables.\n\t */\n\t$meta_defaults = apply_filters_deprecated( 'signup_create_blog_meta', array( $blog_meta_defaults ), '3.0.0', 'add_signup_meta' );\n\n\t/**\n\t * Filters the new default site meta variables.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param array $meta {\n\t *     An array of default site meta variables.\n\t *\n\t *     @type int $lang_id     The language ID.\n\t *     @type int $blog_public Whether search engines should be discouraged from indexing the site. 1 for true, 0 for false.\n\t * }\n\t */\n\t$meta = apply_filters( 'add_signup_meta', $meta_defaults );\n\n\t$blog_id = wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, get_current_network_id() );\n\n\tif ( is_wp_error( $blog_id ) ) {\n\t\treturn false;\n\t}\n\n\tconfirm_another_blog_signup( $domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta, $blog_id );\n\treturn true;\n}\n\n/**\n * Confirm a new site signup.\n *\n * @since MU (3.0.0)\n * @since 4.4.0 Added the `$blog_id` parameter.\n *\n * @param string $domain     The domain URL.\n * @param string $path       The site root path.\n * @param string $blog_title The site title.\n * @param string $user_name  The username.\n * @param string $user_email The user's email address.\n * @param array  $meta       Any additional meta from the {@see 'add_signup_meta'} filter in validate_blog_signup().\n * @param int    $blog_id    The site ID.\n */\nfunction confirm_another_blog_signup( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = array(), $blog_id = 0 ) {\n\n\tif ( $blog_id ) {\n\t\tswitch_to_blog( $blog_id );\n\t\t$home_url  = home_url( '/' );\n\t\t$login_url = wp_login_url();\n\t\trestore_current_blog();\n\t} else {\n\t\t$home_url  = 'http://' . $domain . $path;\n\t\t$login_url = 'http://' . $domain . $path . 'wp-login.php';\n\t}\n\n\t$site = sprintf(\n\t\t'<a href=\"%1$s\">%2$s</a>',\n\t\tesc_url( $home_url ),\n\t\t$blog_title\n\t);\n\n\t?>\n\t<h2>\n\t<?php\n\t\t/* translators: %s: Site title. */\n\t\tprintf( __( 'The site %s is yours.' ), $site );\n\t?>\n\t</h2>\n\t<p>\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: 1: Link to new site, 2: Login URL, 3: Username. */\n\t\t\t__( '%1$s is your new site. <a href=\"%2$s\">Log in</a> as &#8220;%3$s&#8221; using your existing password.' ),\n\t\t\tsprintf(\n\t\t\t\t'<a href=\"%s\">%s</a>',\n\t\t\t\tesc_url( $home_url ),\n\t\t\t\tuntrailingslashit( $domain . $path )\n\t\t\t),\n\t\t\tesc_url( $login_url ),\n\t\t\t$user_name\n\t\t);\n\t\t?>\n\t</p>\n\t<?php\n\t/**\n\t * Fires when the site or user sign-up process is complete.\n\t *\n\t * @since 3.0.0\n\t */\n\tdo_action( 'signup_finished' );\n}\n\n/**\n * Setup the new user signup process\n *\n * @since MU (3.0.0)\n *\n * @param string          $user_name  The username.\n * @param string          $user_email The user's email.\n * @param WP_Error|string $errors     A WP_Error object containing existing errors. Defaults to empty string.\n */\nfunction signup_user( $user_name = '', $user_email = '', $errors = '' ) {\n\tglobal $active_signup;\n\n\tif ( ! is_wp_error( $errors ) ) {\n\t\t$errors = new WP_Error();\n\t}\n\n\t$signup_for = isset( $_POST['signup_for'] ) ? esc_html( $_POST['signup_for'] ) : 'blog';\n\n\t$signup_user_defaults = array(\n\t\t'user_name'  => $user_name,\n\t\t'user_email' => $user_email,\n\t\t'errors'     => $errors,\n\t);\n\n\t/**\n\t * Filters the default user variables used on the user sign-up form.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param array $signup_user_defaults {\n\t *     An array of default user variables.\n\t *\n\t *     @type string   $user_name  The user username.\n\t *     @type string   $user_email The user email address.\n\t *     @type WP_Error $errors     A WP_Error object with possible errors relevant to the sign-up user.\n\t * }\n\t */\n\t$filtered_results = apply_filters( 'signup_user_init', $signup_user_defaults );\n\t$user_name        = $filtered_results['user_name'];\n\t$user_email       = $filtered_results['user_email'];\n\t$errors           = $filtered_results['errors'];\n\n\t?>\n\n\t<h2>\n\t<?php\n\t\t/* translators: %s: Name of the network. */\n\t\tprintf( __( 'Get your own %s account in seconds' ), get_network()->site_name );\n\t?>\n\t</h2>\n\t<form id=\"setupform\" method=\"post\" action=\"wp-signup.php\" novalidate=\"novalidate\">\n\t\t<input type=\"hidden\" name=\"stage\" value=\"validate-user-signup\" />\n\t\t<?php\n\t\t/** This action is documented in wp-signup.php */\n\t\tdo_action( 'signup_hidden_fields', 'validate-user' );\n\t\t?>\n\t\t<?php show_user_form( $user_name, $user_email, $errors ); ?>\n\n\t\t<p>\n\t\t<?php if ( 'blog' === $active_signup ) { ?>\n\t\t\t<input id=\"signupblog\" type=\"hidden\" name=\"signup_for\" value=\"blog\" />\n\t\t<?php } elseif ( 'user' === $active_signup ) { ?>\n\t\t\t<input id=\"signupblog\" type=\"hidden\" name=\"signup_for\" value=\"user\" />\n\t\t<?php } else { ?>\n\t\t\t<input id=\"signupblog\" type=\"radio\" name=\"signup_for\" value=\"blog\" <?php checked( $signup_for, 'blog' ); ?> />\n\t\t\t<label class=\"checkbox\" for=\"signupblog\"><?php _e( 'Gimme a site!' ); ?></label>\n\t\t\t<br />\n\t\t\t<input id=\"signupuser\" type=\"radio\" name=\"signup_for\" value=\"user\" <?php checked( $signup_for, 'user' ); ?> />\n\t\t\t<label class=\"checkbox\" for=\"signupuser\"><?php _e( 'Just a username, please.' ); ?></label>\n\t\t<?php } ?>\n\t\t</p>\n\n\t\t<p class=\"submit\"><input type=\"submit\" name=\"submit\" class=\"submit\" value=\"<?php esc_attr_e( 'Next' ); ?>\" /></p>\n\t</form>\n\t<?php\n}\n\n/**\n * Validate the new user signup\n *\n * @since MU (3.0.0)\n *\n * @return bool True if new user signup was validated, false if error\n */\nfunction validate_user_signup() {\n\t$result     = validate_user_form();\n\t$user_name  = $result['user_name'];\n\t$user_email = $result['user_email'];\n\t$errors     = $result['errors'];\n\n\tif ( $errors->has_errors() ) {\n\t\tsignup_user( $user_name, $user_email, $errors );\n\t\treturn false;\n\t}\n\n\tif ( 'blog' === $_POST['signup_for'] ) {\n\t\tsignup_blog( $user_name, $user_email );\n\t\treturn false;\n\t}\n\n\t/** This filter is documented in wp-signup.php */\n\twpmu_signup_user( $user_name, $user_email, apply_filters( 'add_signup_meta', array() ) );\n\n\tconfirm_user_signup( $user_name, $user_email );\n\treturn true;\n}\n\n/**\n * New user signup confirmation\n *\n * @since MU (3.0.0)\n *\n * @param string $user_name The username\n * @param string $user_email The user's email address\n */\nfunction confirm_user_signup( $user_name, $user_email ) {\n\t?>\n\t<h2>\n\t<?php\n\t/* translators: %s: Username. */\n\tprintf( __( '%s is your new username' ), $user_name )\n\t?>\n\t</h2>\n\t<p><?php _e( 'But, before you can start using your new username, <strong>you must activate it</strong>.' ); ?></p>\n\t<p>\n\t<?php\n\t/* translators: %s: Email address. */\n\tprintf( __( 'Check your inbox at %s and click the link given.' ), '<strong>' . $user_email . '</strong>' );\n\t?>\n\t</p>\n\t<p><?php _e( 'If you do not activate your username within two days, you will have to sign up again.' ); ?></p>\n\t<?php\n\t/** This action is documented in wp-signup.php */\n\tdo_action( 'signup_finished' );\n}\n\n/**\n * Setup the new site signup\n *\n * @since MU (3.0.0)\n *\n * @param string          $user_name  The username.\n * @param string          $user_email The user's email address.\n * @param string          $blogname   The site name.\n * @param string          $blog_title The site title.\n * @param WP_Error|string $errors     A WP_Error object containing existing errors. Defaults to empty string.\n */\nfunction signup_blog( $user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '' ) {\n\tif ( ! is_wp_error( $errors ) ) {\n\t\t$errors = new WP_Error();\n\t}\n\n\t$signup_blog_defaults = array(\n\t\t'user_name'  => $user_name,\n\t\t'user_email' => $user_email,\n\t\t'blogname'   => $blogname,\n\t\t'blog_title' => $blog_title,\n\t\t'errors'     => $errors,\n\t);\n\n\t/**\n\t * Filters the default site creation variables for the site sign-up form.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param array $signup_blog_defaults {\n\t *     An array of default site creation variables.\n\t *\n\t *     @type string   $user_name  The user username.\n\t *     @type string   $user_email The user email address.\n\t *     @type string   $blogname   The blogname.\n\t *     @type string   $blog_title The title of the site.\n\t *     @type WP_Error $errors     A WP_Error object with possible errors relevant to new site creation variables.\n\t * }\n\t */\n\t$filtered_results = apply_filters( 'signup_blog_init', $signup_blog_defaults );\n\n\t$user_name  = $filtered_results['user_name'];\n\t$user_email = $filtered_results['user_email'];\n\t$blogname   = $filtered_results['blogname'];\n\t$blog_title = $filtered_results['blog_title'];\n\t$errors     = $filtered_results['errors'];\n\n\tif ( empty( $blogname ) ) {\n\t\t$blogname = $user_name;\n\t}\n\t?>\n\t<form id=\"setupform\" method=\"post\" action=\"wp-signup.php\">\n\t\t<input type=\"hidden\" name=\"stage\" value=\"validate-blog-signup\" />\n\t\t<input type=\"hidden\" name=\"user_name\" value=\"<?php echo esc_attr( $user_name ); ?>\" />\n\t\t<input type=\"hidden\" name=\"user_email\" value=\"<?php echo esc_attr( $user_email ); ?>\" />\n\t\t<?php\n\t\t/** This action is documented in wp-signup.php */\n\t\tdo_action( 'signup_hidden_fields', 'validate-site' );\n\t\t?>\n\t\t<?php show_blog_form( $blogname, $blog_title, $errors ); ?>\n\t\t<p class=\"submit\"><input type=\"submit\" name=\"submit\" class=\"submit\" value=\"<?php esc_attr_e( 'Signup' ); ?>\" /></p>\n\t</form>\n\t<?php\n}\n\n/**\n * Validate new site signup\n *\n * @since MU (3.0.0)\n *\n * @return bool True if the site signup was validated, false if error\n */\nfunction validate_blog_signup() {\n\t// Re-validate user info.\n\t$user_result = wpmu_validate_user_signup( $_POST['user_name'], $_POST['user_email'] );\n\t$user_name   = $user_result['user_name'];\n\t$user_email  = $user_result['user_email'];\n\t$user_errors = $user_result['errors'];\n\n\tif ( $user_errors->has_errors() ) {\n\t\tsignup_user( $user_name, $user_email, $user_errors );\n\t\treturn false;\n\t}\n\n\t$result     = wpmu_validate_blog_signup( $_POST['blogname'], $_POST['blog_title'] );\n\t$domain     = $result['domain'];\n\t$path       = $result['path'];\n\t$blogname   = $result['blogname'];\n\t$blog_title = $result['blog_title'];\n\t$errors     = $result['errors'];\n\n\tif ( $errors->has_errors() ) {\n\t\tsignup_blog( $user_name, $user_email, $blogname, $blog_title, $errors );\n\t\treturn false;\n\t}\n\n\t$public      = (int) $_POST['blog_public'];\n\t$signup_meta = array(\n\t\t'lang_id' => 1,\n\t\t'public'  => $public,\n\t);\n\n\t// Handle the language setting for the new site.\n\tif ( ! empty( $_POST['WPLANG'] ) ) {\n\n\t\t$languages = signup_get_available_languages();\n\n\t\tif ( in_array( $_POST['WPLANG'], $languages, true ) ) {\n\t\t\t$language = wp_unslash( sanitize_text_field( $_POST['WPLANG'] ) );\n\n\t\t\tif ( $language ) {\n\t\t\t\t$signup_meta['WPLANG'] = $language;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** This filter is documented in wp-signup.php */\n\t$meta = apply_filters( 'add_signup_meta', $signup_meta );\n\n\twpmu_signup_blog( $domain, $path, $blog_title, $user_name, $user_email, $meta );\n\tconfirm_blog_signup( $domain, $path, $blog_title, $user_name, $user_email, $meta );\n\treturn true;\n}\n\n/**\n * New site signup confirmation\n *\n * @since MU (3.0.0)\n *\n * @param string $domain     The domain URL.\n * @param string $path       The site root path.\n * @param string $blog_title The new site title.\n * @param string $user_name  The user's username.\n * @param string $user_email The user's email address.\n * @param array  $meta       Any additional meta from the {@see 'add_signup_meta'} filter in validate_blog_signup().\n */\nfunction confirm_blog_signup( $domain, $path, $blog_title, $user_name = '', $user_email = '', $meta = array() ) {\n\t?>\n\t<h2>\n\t<?php\n\t/* translators: %s: Site address. */\n\tprintf( __( 'Congratulations! Your new site, %s, is almost ready.' ), \"<a href='http://{$domain}{$path}'>{$blog_title}</a>\" )\n\t?>\n\t</h2>\n\n\t<p><?php _e( 'But, before you can start using your site, <strong>you must activate it</strong>.' ); ?></p>\n\t<p>\n\t<?php\n\t/* translators: %s: Email address. */\n\tprintf( __( 'Check your inbox at %s and click the link given.' ), '<strong>' . $user_email . '</strong>' );\n\t?>\n\t</p>\n\t<p><?php _e( 'If you do not activate your site within two days, you will have to sign up again.' ); ?></p>\n\t<h2><?php _e( 'Still waiting for your email?' ); ?></h2>\n\t<p>\n\t\t<?php _e( 'If you haven&#8217;t received your email yet, there are a number of things you can do:' ); ?>\n\t\t<ul id=\"noemail-tips\">\n\t\t\t<li><p><strong><?php _e( 'Wait a little longer. Sometimes delivery of email can be delayed by processes outside of our control.' ); ?></strong></p></li>\n\t\t\t<li><p><?php _e( 'Check the junk or spam folder of your email client. Sometime emails wind up there by mistake.' ); ?></p></li>\n\t\t\t<li>\n\t\t\t<?php\n\t\t\t\t/* translators: %s: Email address. */\n\t\t\t\tprintf( __( 'Have you entered your email correctly? You have entered %s, if it&#8217;s incorrect, you will not receive your email.' ), $user_email );\n\t\t\t?>\n\t\t\t</li>\n\t\t</ul>\n\t</p>\n\t<?php\n\t/** This action is documented in wp-signup.php */\n\tdo_action( 'signup_finished' );\n}\n\n/**\n * Retrieves languages available during the site/user signup process.\n *\n * @since 4.4.0\n *\n * @see get_available_languages()\n *\n * @return array List of available languages.\n */\nfunction signup_get_available_languages() {\n\t/**\n\t * Filters the list of available languages for front-end site signups.\n\t *\n\t * Passing an empty array to this hook will disable output of the setting on the\n\t * signup form, and the default language will be used when creating the site.\n\t *\n\t * Languages not already installed will be stripped.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $available_languages Available languages.\n\t */\n\t$languages = (array) apply_filters( 'signup_get_available_languages', get_available_languages() );\n\n\t/*\n\t * Strip any non-installed languages and return.\n\t *\n\t * Re-call get_available_languages() here in case a language pack was installed\n\t * in a callback hooked to the 'signup_get_available_languages' filter before this point.\n\t */\n\treturn array_intersect_assoc( $languages, get_available_languages() );\n}\n\n// Main.\n$active_signup = get_site_option( 'registration', 'none' );\n\n/**\n * Filters the type of site sign-up.\n *\n * @since 3.0.0\n *\n * @param string $active_signup String that returns registration type. The value can be\n *                              'all', 'none', 'blog', or 'user'.\n */\n$active_signup = apply_filters( 'wpmu_active_signup', $active_signup );\n\nif ( current_user_can( 'manage_network' ) ) {\n\techo '<div class=\"mu_alert\">';\n\t_e( 'Greetings Network Administrator!' );\n\techo ' ';\n\n\tswitch ( $active_signup ) {\n\t\tcase 'none':\n\t\t\t_e( 'The network currently disallows registrations.' );\n\t\t\tbreak;\n\t\tcase 'blog':\n\t\t\t_e( 'The network currently allows site registrations.' );\n\t\t\tbreak;\n\t\tcase 'user':\n\t\t\t_e( 'The network currently allows user registrations.' );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t_e( 'The network currently allows both site and user registrations.' );\n\t\t\tbreak;\n\t}\n\n\techo ' ';\n\n\t/* translators: %s: URL to Network Settings screen. */\n\tprintf( __( 'To change or disable registration go to your <a href=\"%s\">Options page</a>.' ), esc_url( network_admin_url( 'settings.php' ) ) );\n\techo '</div>';\n}\n\n$newblogname = isset( $_GET['new'] ) ? strtolower( preg_replace( '/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'] ) ) : null;\n\n$current_user = wp_get_current_user();\nif ( 'none' === $active_signup ) {\n\t_e( 'Registration has been disabled.' );\n} elseif ( 'blog' === $active_signup && ! is_user_logged_in() ) {\n\t$login_url = wp_login_url( network_site_url( 'wp-signup.php' ) );\n\t/* translators: %s: Login URL. */\n\tprintf( __( 'You must first <a href=\"%s\">log in</a>, and then you can create a new site.' ), $login_url );\n} else {\n\t$stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default';\n\tswitch ( $stage ) {\n\t\tcase 'validate-user-signup':\n\t\t\tif ( 'all' === $active_signup\n\t\t\t\t|| ( 'blog' === $_POST['signup_for'] && 'blog' === $active_signup )\n\t\t\t\t|| ( 'user' === $_POST['signup_for'] && 'user' === $active_signup )\n\t\t\t) {\n\t\t\t\tvalidate_user_signup();\n\t\t\t} else {\n\t\t\t\t_e( 'User registration has been disabled.' );\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'validate-blog-signup':\n\t\t\tif ( 'all' === $active_signup || 'blog' === $active_signup ) {\n\t\t\t\tvalidate_blog_signup();\n\t\t\t} else {\n\t\t\t\t_e( 'Site registration has been disabled.' );\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'gimmeanotherblog':\n\t\t\tvalidate_another_blog_signup();\n\t\t\tbreak;\n\t\tcase 'default':\n\t\tdefault:\n\t\t\t$user_email = isset( $_POST['user_email'] ) ? $_POST['user_email'] : '';\n\t\t\t/**\n\t\t\t * Fires when the site sign-up form is sent.\n\t\t\t *\n\t\t\t * @since 3.0.0\n\t\t\t */\n\t\t\tdo_action( 'preprocess_signup_form' );\n\t\t\tif ( is_user_logged_in() && ( 'all' === $active_signup || 'blog' === $active_signup ) ) {\n\t\t\t\tsignup_another_blog( $newblogname );\n\t\t\t} elseif ( ! is_user_logged_in() && ( 'all' === $active_signup || 'user' === $active_signup ) ) {\n\t\t\t\tsignup_user( $newblogname, $user_email );\n\t\t\t} elseif ( ! is_user_logged_in() && ( 'blog' === $active_signup ) ) {\n\t\t\t\t_e( 'Sorry, new registrations are not allowed at this time.' );\n\t\t\t} else {\n\t\t\t\t_e( 'You are logged in already. No need to register again!' );\n\t\t\t}\n\n\t\t\tif ( $newblogname ) {\n\t\t\t\t$newblog = get_blogaddress_by_name( $newblogname );\n\n\t\t\t\tif ( 'blog' === $active_signup || 'all' === $active_signup ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Site address. */\n\t\t\t\t\t\t'<p><em>' . __( 'The site you were looking for, %s, does not exist, but you can create it now!' ) . '</em></p>',\n\t\t\t\t\t\t'<strong>' . $newblog . '</strong>'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Site address. */\n\t\t\t\t\t\t'<p><em>' . __( 'The site you were looking for, %s, does not exist.' ) . '</em></p>',\n\t\t\t\t\t\t'<strong>' . $newblog . '</strong>'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t}\n}\n?>\n</div>\n</div>\n<?php\n/**\n * Fires after the sign-up forms, before wp_footer.\n *\n * @since 3.0.0\n */\ndo_action( 'after_signup_form' );\n?>\n\n<?php\nget_footer( 'wp-signup' );\n", "num_lines": 1015}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Handle Trackbacks and Pingbacks Sent to WordPress\n *\n * @since 0.71\n *\n * @package WordPress\n * @subpackage Trackbacks\n */\n\nif ( empty( $wp ) ) {\n\trequire_once __DIR__ . '/wp-load.php';\n\twp( array( 'tb' => '1' ) );\n}\n\n/**\n * Response to a trackback.\n *\n * Responds with an error or success XML message.\n *\n * @since 0.71\n *\n * @param int|bool $error         Whether there was an error.\n *                                Default '0'. Accepts '0' or '1', true or false.\n * @param string   $error_message Error message if an error occurred.\n */\nfunction trackback_response( $error = 0, $error_message = '' ) {\n\theader( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ) );\n\tif ( $error ) {\n\t\techo '<?xml version=\"1.0\" encoding=\"utf-8\"?' . \">\\n\";\n\t\techo \"<response>\\n\";\n\t\techo \"<error>1</error>\\n\";\n\t\techo \"<message>$error_message</message>\\n\";\n\t\techo '</response>';\n\t\tdie();\n\t} else {\n\t\techo '<?xml version=\"1.0\" encoding=\"utf-8\"?' . \">\\n\";\n\t\techo \"<response>\\n\";\n\t\techo \"<error>0</error>\\n\";\n\t\techo '</response>';\n\t}\n}\n\n// Trackback is done by a POST.\n$request_array = 'HTTP_POST_VARS';\n\nif ( ! isset( $_GET['tb_id'] ) || ! $_GET['tb_id'] ) {\n\t$tb_id = explode( '/', $_SERVER['REQUEST_URI'] );\n\t$tb_id = intval( $tb_id[ count( $tb_id ) - 1 ] );\n}\n\n$tb_url  = isset( $_POST['url'] ) ? $_POST['url'] : '';\n$charset = isset( $_POST['charset'] ) ? $_POST['charset'] : '';\n\n// These three are stripslashed here so they can be properly escaped after mb_convert_encoding().\n$title     = isset( $_POST['title'] ) ? wp_unslash( $_POST['title'] ) : '';\n$excerpt   = isset( $_POST['excerpt'] ) ? wp_unslash( $_POST['excerpt'] ) : '';\n$blog_name = isset( $_POST['blog_name'] ) ? wp_unslash( $_POST['blog_name'] ) : '';\n\nif ( $charset ) {\n\t$charset = str_replace( array( ',', ' ' ), '', strtoupper( trim( $charset ) ) );\n} else {\n\t$charset = 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS';\n}\n\n// No valid uses for UTF-7.\nif ( false !== strpos( $charset, 'UTF-7' ) ) {\n\tdie;\n}\n\n// For international trackbacks.\nif ( function_exists( 'mb_convert_encoding' ) ) {\n\t$title     = mb_convert_encoding( $title, get_option( 'blog_charset' ), $charset );\n\t$excerpt   = mb_convert_encoding( $excerpt, get_option( 'blog_charset' ), $charset );\n\t$blog_name = mb_convert_encoding( $blog_name, get_option( 'blog_charset' ), $charset );\n}\n\n// Now that mb_convert_encoding() has been given a swing, we need to escape these three.\n$title     = wp_slash( $title );\n$excerpt   = wp_slash( $excerpt );\n$blog_name = wp_slash( $blog_name );\n\nif ( is_single() || is_page() ) {\n\t$tb_id = $posts[0]->ID;\n}\n\nif ( ! isset( $tb_id ) || ! intval( $tb_id ) ) {\n\ttrackback_response( 1, __( 'I really need an ID for this to work.' ) );\n}\n\nif ( empty( $title ) && empty( $tb_url ) && empty( $blog_name ) ) {\n\t// If it doesn't look like a trackback at all.\n\twp_redirect( get_permalink( $tb_id ) );\n\texit;\n}\n\nif ( ! empty( $tb_url ) && ! empty( $title ) ) {\n\t/**\n\t * Fires before the trackback is added to a post.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param int    $tb_id     Post ID related to the trackback.\n\t * @param string $tb_url    Trackback URL.\n\t * @param string $charset   Character Set.\n\t * @param string $title     Trackback Title.\n\t * @param string $excerpt   Trackback Excerpt.\n\t * @param string $blog_name Blog Name.\n\t */\n\tdo_action( 'pre_trackback_post', $tb_id, $tb_url, $charset, $title, $excerpt, $blog_name );\n\n\theader( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ) );\n\n\tif ( ! pings_open( $tb_id ) ) {\n\t\ttrackback_response( 1, __( 'Sorry, trackbacks are closed for this item.' ) );\n\t}\n\n\t$title   = wp_html_excerpt( $title, 250, '&#8230;' );\n\t$excerpt = wp_html_excerpt( $excerpt, 252, '&#8230;' );\n\n\t$comment_post_ID      = (int) $tb_id;\n\t$comment_author       = $blog_name;\n\t$comment_author_email = '';\n\t$comment_author_url   = $tb_url;\n\t$comment_content      = \"<strong>$title</strong>\\n\\n$excerpt\";\n\t$comment_type         = 'trackback';\n\n\t$dupe = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s\", $comment_post_ID, $comment_author_url ) );\n\tif ( $dupe ) {\n\t\ttrackback_response( 1, __( 'We already have a ping from that URL for this post.' ) );\n\t}\n\n\t$commentdata = compact( 'comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type' );\n\n\t$result = wp_new_comment( $commentdata );\n\n\tif ( is_wp_error( $result ) ) {\n\t\ttrackback_response( 1, $result->get_error_message() );\n\t}\n\n\t$trackback_id = $wpdb->insert_id;\n\n\t/**\n\t * Fires after a trackback is added to a post.\n\t *\n\t * @since 1.2.0\n\t *\n\t * @param int $trackback_id Trackback ID.\n\t */\n\tdo_action( 'trackback_post', $trackback_id );\n\ttrackback_response( 0 );\n}\n", "num_lines": 153}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * XML-RPC protocol support for WordPress\n *\n * @package WordPress\n */\n\n/**\n * Whether this is an XML-RPC Request\n *\n * @var bool\n */\ndefine( 'XMLRPC_REQUEST', true );\n\n// Some browser-embedded clients send cookies. We don't want them.\n$_COOKIE = array();\n\n// $HTTP_RAW_POST_DATA was deprecated in PHP 5.6 and removed in PHP 7.0.\n// phpcs:disable PHPCompatibility.Variables.RemovedPredefinedGlobalVariables.http_raw_post_dataDeprecatedRemoved\nif ( ! isset( $HTTP_RAW_POST_DATA ) ) {\n\t$HTTP_RAW_POST_DATA = file_get_contents( 'php://input' );\n}\n\n// Fix for mozBlog and other cases where '<?xml' isn't on the very first line.\nif ( isset( $HTTP_RAW_POST_DATA ) ) {\n\t$HTTP_RAW_POST_DATA = trim( $HTTP_RAW_POST_DATA );\n}\n// phpcs:enable\n\n/** Include the bootstrap for setting up WordPress environment */\nrequire_once __DIR__ . '/wp-load.php';\n\nif ( isset( $_GET['rsd'] ) ) { // http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html\n\theader( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );\n\techo '<?xml version=\"1.0\" encoding=\"' . get_option( 'blog_charset' ) . '\"?' . '>';\n\t?>\n<rsd version=\"1.0\" xmlns=\"http://archipelago.phrasewise.com/rsd\">\n\t<service>\n\t\t<engineName>WordPress</engineName>\n\t\t<engineLink>https://wordpress.org/</engineLink>\n\t\t<homePageLink><?php bloginfo_rss( 'url' ); ?></homePageLink>\n\t\t<apis>\n\t\t\t<api name=\"WordPress\" blogID=\"1\" preferred=\"true\" apiLink=\"<?php echo site_url( 'xmlrpc.php', 'rpc' ); ?>\" />\n\t\t\t<api name=\"Movable Type\" blogID=\"1\" preferred=\"false\" apiLink=\"<?php echo site_url( 'xmlrpc.php', 'rpc' ); ?>\" />\n\t\t\t<api name=\"MetaWeblog\" blogID=\"1\" preferred=\"false\" apiLink=\"<?php echo site_url( 'xmlrpc.php', 'rpc' ); ?>\" />\n\t\t\t<api name=\"Blogger\" blogID=\"1\" preferred=\"false\" apiLink=\"<?php echo site_url( 'xmlrpc.php', 'rpc' ); ?>\" />\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * Add additional APIs to the Really Simple Discovery (RSD) endpoint.\n\t\t\t *\n\t\t\t * @link http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html\n\t\t\t *\n\t\t\t * @since 3.5.0\n\t\t\t */\n\t\t\tdo_action( 'xmlrpc_rsd_apis' );\n\t\t\t?>\n\t\t</apis>\n\t</service>\n</rsd>\n\t<?php\n\texit;\n}\n\nrequire_once ABSPATH . 'wp-admin/includes/admin.php';\nrequire_once ABSPATH . WPINC . '/class-IXR.php';\nrequire_once ABSPATH . WPINC . '/class-wp-xmlrpc-server.php';\n\n/**\n * Posts submitted via the XML-RPC interface get that title\n *\n * @name post_default_title\n * @var string\n */\n$post_default_title = '';\n\n/**\n * Filters the class used for handling XML-RPC requests.\n *\n * @since 3.1.0\n *\n * @param string $class The name of the XML-RPC server class.\n */\n$wp_xmlrpc_server_class = apply_filters( 'wp_xmlrpc_server_class', 'wp_xmlrpc_server' );\n$wp_xmlrpc_server       = new $wp_xmlrpc_server_class;\n\n// Fire off the request.\n$wp_xmlrpc_server->serve_request();\n\nexit;\n\n/**\n * logIO() - Writes logging info to a file.\n *\n * @deprecated 3.4.0 Use error_log()\n * @see error_log()\n *\n * @param string $io Whether input or output\n * @param string $msg Information describing logging reason.\n */\nfunction logIO( $io, $msg ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'error_log()' );\n\tif ( ! empty( $GLOBALS['xmlrpc_logging'] ) ) {\n\t\terror_log( $io . ' - ' . $msg );\n\t}\n}\n", "num_lines": 106}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * About This Version administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n/* translators: Page title of the About WordPress page in the admin. */\n$title = _x( 'About', 'page title' );\n\nlist( $display_version ) = explode( '-', get_bloginfo( 'version' ) );\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n\t<div class=\"wrap about__container\">\n\n\t\t<div class=\"about__header\">\n\t\t\t<div class=\"about__header-text\">\n\t\t\t\t<?php _e( 'Speed. Search. Security.' ); ?>\n\t\t\t</div>\n\n\t\t\t<div class=\"about__header-title\">\n\t\t\t\t<p>\n\t\t\t\t\t<?php _e( 'WordPress' ); ?>\n\t\t\t\t\t<span><?php echo $display_version; ?></span>\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t<nav class=\"about__header-navigation nav-tab-wrapper wp-clearfix\" aria-label=\"<?php esc_attr_e( 'Secondary menu' ); ?>\">\n\t\t\t\t<a href=\"about.php\" class=\"nav-tab nav-tab-active\" aria-current=\"page\"><?php _e( 'What&#8217;s New' ); ?></a>\n\t\t\t\t<a href=\"credits.php\" class=\"nav-tab\"><?php _e( 'Credits' ); ?></a>\n\t\t\t\t<a href=\"freedoms.php\" class=\"nav-tab\"><?php _e( 'Freedoms' ); ?></a>\n\t\t\t\t<a href=\"privacy.php\" class=\"nav-tab\"><?php _e( 'Privacy' ); ?></a>\n\t\t\t</nav>\n\t\t</div>\n\n\t\t<div class=\"about__section is-feature has-subtle-background-color\">\n\t\t\t<h1>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: The current WordPress version number. */\n\t\t\t\t\t__( 'Welcome to WordPress %s.' ),\n\t\t\t\t\t$display_version\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</h1>\n\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: The current WordPress version number. */\n\t\t\t\t\t__( 'In WordPress %s, your site gets new power in three major areas: speed, search, and security.' ),\n\t\t\t\t\t$display_version\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</p>\n\t\t</div>\n\n\t\t<hr />\n\n\t\t<div class=\"about__section has-subtle-background-color\">\n\t\t\t<div class=\"column\">\n\t\t\t\t<h2><?php _e( 'Maintenance and Security Releases' ); ?></h2>\n\t\t\t\t<p>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: WordPress version number, 2: Plural number of bugs. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'<strong>Version %1$s</strong> addressed %2$s bug.',\n\t\t\t\t\t\t\t'<strong>Version %1$s</strong> addressed %2$s bugs.',\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'5.5.3',\n\t\t\t\t\t\tnumber_format_i18n( 1 )\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: HelpHub URL. */\n\t\t\t\t\t\t__( 'For more information, see <a href=\"%s\">the release notes</a>.' ),\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: WordPress version. */\n\t\t\t\t\t\t\tesc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),\n\t\t\t\t\t\t\tsanitize_title( '5.5.3' )\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t\t<p>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: WordPress version number, 2: plural number of bugs. More than one security issue. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',\n\t\t\t\t\t\t\t'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.',\n\t\t\t\t\t\t\t14\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'5.5.2',\n\t\t\t\t\t\tnumber_format_i18n( 14 )\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: HelpHub URL */\n\t\t\t\t\t\t__( 'For more information, see <a href=\"%s\">the release notes</a>.' ),\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: WordPress version */\n\t\t\t\t\t\t\tesc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),\n\t\t\t\t\t\t\tsanitize_title( '5.5.2' )\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t\t<p>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: WordPress version number, 2: Plural number of bugs. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'<strong>Version %1$s</strong> addressed %2$s bug.',\n\t\t\t\t\t\t\t'<strong>Version %1$s</strong> addressed %2$s bugs.',\n\t\t\t\t\t\t\t44\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'5.5.1',\n\t\t\t\t\t\tnumber_format_i18n( 44 )\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: HelpHub URL. */\n\t\t\t\t\t\t__( 'For more information, see <a href=\"%s\">the release notes</a>.' ),\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: WordPress version. */\n\t\t\t\t\t\t\tesc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),\n\t\t\t\t\t\t\tsanitize_title( '5.5.1' )\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<hr />\n\n\t\t<div class=\"about__section has-1-column\">\n\t\t\t<div class=\"column\">\n\t\t\t\t<h2><?php _e( 'Speed' ); ?></h2>\n\t\t\t\t<p><strong><?php _e( 'Posts and pages feel faster, thanks to lazy-loaded images.' ); ?></strong></p>\n\t\t\t\t<p><?php _e( 'Images give your story a lot of impact, but they can sometimes make your site seem slow.' ); ?></p>\n\t\t\t\t<p><?php _e( 'In WordPress 5.5, images wait to load until they\u00e2\u20ac\u2122re just about to scroll into view. The technical term is \u00e2\u20ac\u02dclazy loading\u00e2\u20ac\u2122.' ); ?></p>\n\t\t\t\t<p><?php _e( 'On mobile, lazy loading can also keep browsers from loading files meant for other devices. That can save your readers money on data \u00e2\u20ac\u201d and help preserve battery life.' ); ?></p>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"about__section has-1-column\">\n\t\t\t<div class=\"column\">\n\t\t\t\t<h2><?php _ex( 'Search', 'sitemap' ); ?></h2>\n\t\t\t\t<p><strong><?php _e( 'Say hello to your new sitemap.' ); ?></strong></p>\n\t\t\t\t<p><?php _e( 'WordPress sites work well with search engines.' ); ?></p>\n\t\t\t\t<p><?php _e( 'Now, by default, WordPress 5.5 includes an XML sitemap that helps search engines discover your most important pages from the very minute you go live.' ); ?></p>\n\t\t\t\t<p><?php _e( 'So more people will find your site sooner, giving you more time to engage, retain and convert them to subscribers, customers or whatever fits your definition of success.' ); ?></p>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<hr />\n\n\t\t<div class=\"about__section has-2-columns has-accent-background-color is-wider-right\">\n\t\t\t<div class=\"column\">\n\t\t\t\t<h2><?php _e( 'Security' ); ?></h2>\n\t\t\t\t<p><strong><?php _e( 'Auto-updates for Plugins and Themes' ); ?></strong></p>\n\t\t\t\t<p><?php _e( 'Now you can set plugins and themes to update automatically \u00e2\u20ac\u201d or not! \u00e2\u20ac\u201d in the WordPress admin. So you always know your site is running the latest code available.' ); ?></p>\n\t\t\t\t<p><?php _e( 'You can also turn auto-updates on or off for each plugin or theme you have installed \u00e2\u20ac\u201d all on the same screens you\u00e2\u20ac\u2122ve always used.' ); ?></p>\n\t\t\t\t<p><strong><?php _e( 'Update by uploading ZIP files' ); ?></strong></p>\n\t\t\t\t<p><?php _e( 'If updating plugins and themes manually is your thing, now that\u00e2\u20ac\u2122s easier too \u00e2\u20ac\u201d just upload a ZIP file.' ); ?></p>\n\t\t\t</div>\n\t\t\t<div class=\"column about__image is-vertically-aligned-center\">\n\t\t\t\t<figure aria-labelledby=\"about-security\" class=\"about__image\">\n\t\t\t\t\t<video controls poster=\"https://s.w.org/images/core/5.5/auto-updates-poster.png\">\n\t\t\t\t\t\t<source src=\"https://s.w.org/images/core/5.5/auto-updates.mp4\" type=\"video/mp4\" />\n\t\t\t\t\t\t<source src=\"https://s.w.org/images/core/5.5/auto-updates.webm\" type=\"video/webm\" />\n\t\t\t\t\t</video>\n\t\t\t\t\t<figcaption id=\"about-security\" class=\"screen-reader-text\"><?php _e( 'Video: Installed plugin screen, which shows a new column, Automatic Updates. In this column are buttons that say \"Enable auto-updates\". When clicked, the auto-updates feature is turned on for that plugin, and the button switches to say \"Disable auto-updates\".' ); ?></figcaption>\n\t\t\t\t</figure>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<hr />\n\n\t\t<div class=\"about__section has-subtle-background-color\">\n\t\t\t<div class=\"column\">\n\t\t\t\t<h2><?php _e( 'Highlights from the block editor' ); ?></h2>\n\t\t\t\t<p><?php _e( 'Once again, the latest WordPress release packs a long list of exciting new features for the block editor. For example:' ); ?></p>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"about__section has-2-columns has-subtle-background-color\">\n\t\t\t<div class=\"column about__image is-vertically-aligned-center\">\n\t\t\t\t<figure aria-labelledby=\"about-block-pattern\" class=\"about__image\">\n\t\t\t\t\t<video controls poster=\"https://s.w.org/images/core/5.5/block-patterns-poster.png\">\n\t\t\t\t\t\t<source src=\"https://s.w.org/images/core/5.5/block-patterns.mp4\" type=\"video/mp4\" />\n\t\t\t\t\t\t<source src=\"https://s.w.org/images/core/5.5/block-patterns.webm\" type=\"video/webm\" />\n\t\t\t\t\t</video>\n\t\t\t\t\t<figcaption id=\"about-block-pattern\" class=\"screen-reader-text\"><?php _e( 'Video: In the editor, the block inserter shows two tabs, Blocks and Patterns. The Patterns tab is selected. There are different block layouts in this tab. After scrolling through options including buttons and columns, a pattern called \"Large header with a heading\" is chosen. This adds a cover block, which is customized with a photo and the name of the WordPress 5.5 jazz musician.' ); ?></figcaption>\n\t\t\t\t</figure>\n\t\t\t\t<hr />\n\t\t\t\t<figure aria-labelledby=\"about-image-editor\" class=\"about__image\">\n\t\t\t\t\t<video controls poster=\"https://s.w.org/images/core/5.5/inline-image-editing-poster.png\">\n\t\t\t\t\t\t<source src=\"https://s.w.org/images/core/5.5/inline-image-editing.mp4\" type=\"video/mp4\" />\n\t\t\t\t\t\t<source src=\"https://s.w.org/images/core/5.5/inline-image-editing-1.webm\" type=\"video/webm\" />\n\t\t\t\t\t</video>\n\t\t\t\t\t<figcaption id=\"about-image-editor\" class=\"screen-reader-text\"><?php _e( 'Video: An image is added with an image block. In the block toolbar, an icon called \"Crop\" is selected, which changes the toolbar to show image resizing tools. First, zoom is used to zoom into the center of the image. Next, aspect ratio is clicked. This shows a dropdown of common aspect ratios. Square is chosen, and the image is moved within the new square outline. The crop is completed by clicking \"Apply.\"' ); ?></figcaption>\n\t\t\t\t</figure>\n\t\t\t</div>\n\t\t\t<div class=\"column\">\n\t\t\t\t<h3><?php _e( 'Block patterns' ); ?></h3>\n\t\t\t\t<p><?php _e( 'New block patterns make it simple and fun to create complex, beautiful layouts, using combinations of text and media that you can mix and match to fit your story.' ); ?></p>\n\t\t\t\t<p><?php _e( 'You will also find block patterns in a wide variety of plugins and themes, with more added all the time. Pick any of them from a single place \u00e2\u20ac\u201d just click and go!' ); ?></p>\n\t\t\t\t<h3><?php _e( 'Inline image editing' ); ?></h3>\n\t\t\t\t<p><?php _e( 'Crop, rotate, and zoom your photos right from the image block. If you spend a lot of time on images, this could save you hours!' ); ?></p>\n\n\t\t\t\t<h3><?php _e( 'The New Block Directory' ); ?></h3>\n\t\t\t\t<p><?php _e( 'Now it\u00e2\u20ac\u2122s easier than ever to find the block you need. The new block directory is built right into the block editor, so you can install new block types to your site without ever leaving the editor.' ); ?></p>\n\n\t\t\t\t<h3><?php _e( 'And so much more.' ); ?></h3>\n\t\t\t\t<p><?php _e( 'The highlights above are a tiny fraction of the new block editor features you\u00e2\u20ac\u2122ve just installed. Open the block editor and enjoy!' ); ?></p>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<hr />\n\n\t\t<div class=\"about__section has-1-column\">\n\t\t\t<div class=\"column\">\n\t\t\t\t<h2><?php _e( 'Accessibility' ); ?></h2>\n\t\t\t\t<p><?php _e( 'Every release adds improvements to the accessible publishing experience, and that remains true for WordPress 5.5.' ); ?></p>\n\t\t\t\t<p><?php _e( 'Now you can copy links in media screens and modal dialogs with a button, instead of trying to highlight a line of text.' ); ?></p>\n\t\t\t\t<p><?php _e( 'You can also move meta boxes with the keyboard, and edit images in WordPress with your assistive device, as it can read you the instructions in the image editor.' ); ?></p>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<hr />\n\n\t\t<div class=\"about__section has-subtle-background-color has-2-columns\">\n\t\t\t<header class=\"is-section-header\">\n\t\t\t\t<h2><?php _e( 'For developers' ); ?></h2>\n\t\t\t\t<p><?php _e( '5.5 also brings a big box of changes just for developers.' ); ?></p>\n\t\t\t</header>\n\t\t\t<div class=\"column\">\n\t\t\t\t<h3><?php _e( 'Server-side registered blocks in the REST API' ); ?></h3>\n\t\t\t\t<p><?php _e( 'The addition of block types endpoints means that JavaScript apps (like the block editor) can retrieve definitions for any blocks registered on the server.' ); ?></p>\n\t\t\t</div>\n\t\t\t<div class=\"column\">\n\t\t\t\t<h3><?php _e( 'Dashicons' ); ?></h3>\n\t\t\t\t<p><?php _e( 'The Dashicons library has received its final update in 5.5. It adds 39 block editor icons along with 26 others.' ); ?></p>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"about__section has-subtle-background-color has-2-columns\">\n\t\t\t<div class=\"column\">\n\t\t\t\t<h3><?php _e( 'Defining environments' ); ?></h3>\n\t\t\t\t<p>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: 'wp_get_environment_type' function name. */\n\t\t\t\t\t\t__( 'WordPress now has a standardized way to define a site\u00e2\u20ac\u2122s environment type (staging, production, etc). Retrieve that type with %s and execute only the appropriate code.' ),\n\t\t\t\t\t\t'<code>wp_get_environment_type()</code>'\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<div class=\"column\">\n\t\t\t\t<h3><?php _e( 'Passing data to template files' ); ?></h3>\n\t\t\t\t<p>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %1$s: 'get_header' function name, %2$s: 'get_template_part' function name, %3$s: '$args' variable name. */\n\t\t\t\t\t\t__( 'The template loading functions (%1$s, %2$s, etc.) have a new %3$s argument. So now you can pass an entire array\u00e2\u20ac\u2122s worth of data to those templates.' ),\n\t\t\t\t\t\t'<code>get_header()</code>',\n\t\t\t\t\t\t'<code>get_template_part()</code>',\n\t\t\t\t\t\t'<code>$args</code>'\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"about__section has-subtle-background-color\">\n\t\t\t<div class=\"column\">\n\t\t\t\t<h3><?php _e( 'More changes for developers' ); ?></h3>\n\t\t\t\t<ul>\n\t\t\t\t\t<li><?php _e( 'The PHPMailer library just got a major update, going from version 5.2.27 to 6.1.6.' ); ?></li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: 'redirect_guess_404_permalink' function name. */\n\t\t\t\t\t\t\t__( 'Now get more fine-grained control of %s.' ),\n\t\t\t\t\t\t\t'<code>redirect_guess_404_permalink()</code>'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: 'wp_opcache_invalidate' function name. */\n\t\t\t\t\t\t\t__( 'Sites that use PHP\u00e2\u20ac\u2122s OPcache will see more reliable cache invalidation, thanks to the new %s function during updates (including to plugins and themes).' ),\n\t\t\t\t\t\t\t'<code>wp_opcache_invalidate()</code>'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li><?php _e( 'Custom post types associated with the category taxonomy can now opt-in to supporting the default term.' ); ?></li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: 'register_taxonomy' function name. */\n\t\t\t\t\t\t\t__( 'Default terms can now be specified for custom taxonomies in %s.' ),\n\t\t\t\t\t\t\t'<code>register_taxonomy()</code>'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: 'register_meta' function name. */\n\t\t\t\t\t\t\t__( 'The REST API now officially supports specifying default metadata values through %s.' ),\n\t\t\t\t\t\t\t'<code>register_meta()</code>'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li><?php _e( 'You will find updated versions of these bundled libraries: SimplePie, Twemoji, Masonry, imagesLoaded, getID3, Moment.js, and clipboard.js.' ); ?></li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<hr class=\"is-small\" />\n\n\t\t<div class=\"about__section\">\n\t\t\t<div class=\"column\">\n\t\t\t\t<h3><?php _e( 'Check the Field Guide for more!' ); ?></h3>\n\t\t\t\t<p>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: WordPress 5.5 Field Guide link. */\n\t\t\t\t\t\t__( 'There\u00e2\u20ac\u2122s a lot more for developers to love in WordPress 5.5. To discover more and learn how to make these changes shine on your sites, themes, plugins and more, check the <a href=\"%s\">WordPress 5.5 Field Guide.</a>' ),\n\t\t\t\t\t\t'https://make.wordpress.org/core/wordpress-5-5-field-guide/'\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<hr />\n\n\t\t<div class=\"return-to-dashboard\">\n\t\t\t<?php if ( current_user_can( 'update_core' ) && isset( $_GET['updated'] ) ) : ?>\n\t\t\t\t<a href=\"<?php echo esc_url( self_admin_url( 'update-core.php' ) ); ?>\">\n\t\t\t\t\t<?php is_multisite() ? _e( 'Return to Updates' ) : _e( 'Return to Dashboard &rarr; Updates' ); ?>\n\t\t\t\t</a> |\n\t\t\t<?php endif; ?>\n\t\t\t<a href=\"<?php echo esc_url( self_admin_url() ); ?>\"><?php is_blog_admin() ? _e( 'Go to Dashboard &rarr; Home' ) : _e( 'Go to Dashboard' ); ?></a>\n\t\t</div>\n\t</div>\n<?php\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\n// These are strings we may use to describe maintenance/security releases, where we aim for no new strings.\nreturn;\n\n__( 'Maintenance Release' );\n__( 'Maintenance Releases' );\n\n__( 'Security Release' );\n__( 'Security Releases' );\n\n__( 'Maintenance and Security Release' );\n__( 'Maintenance and Security Releases' );\n\n/* translators: %s: WordPress version number. */\n__( '<strong>Version %s</strong> addressed one security issue.' );\n/* translators: %s: WordPress version number. */\n__( '<strong>Version %s</strong> addressed some security issues.' );\n\n/* translators: 1: WordPress version number, 2: Plural number of bugs. */\n_n_noop(\n\t'<strong>Version %1$s</strong> addressed %2$s bug.',\n\t'<strong>Version %1$s</strong> addressed %2$s bugs.'\n);\n\n/* translators: 1: WordPress version number, 2: Plural number of bugs. Singular security issue. */\n_n_noop(\n\t'<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bug.',\n\t'<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bugs.'\n);\n\n/* translators: 1: WordPress version number, 2: Plural number of bugs. More than one security issue. */\n_n_noop(\n\t'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',\n\t'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.'\n);\n\n/* translators: %s: Documentation URL. */\n__( 'For more information, see <a href=\"%s\">the release notes</a>.' );\n", "num_lines": 403}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Ajax Process Execution\n *\n * @package WordPress\n * @subpackage Administration\n *\n * @link https://codex.wordpress.org/AJAX_in_Plugins\n */\n\n/**\n * Executing Ajax process.\n *\n * @since 2.1.0\n */\ndefine( 'DOING_AJAX', true );\nif ( ! defined( 'WP_ADMIN' ) ) {\n\tdefine( 'WP_ADMIN', true );\n}\n\n/** Load WordPress Bootstrap */\nrequire_once dirname( __DIR__ ) . '/wp-load.php';\n\n/** Allow for cross-domain requests (from the front end). */\nsend_origin_headers();\n\nheader( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );\nheader( 'X-Robots-Tag: noindex' );\n\n// Require an action parameter.\nif ( empty( $_REQUEST['action'] ) ) {\n\twp_die( '0', 400 );\n}\n\n/** Load WordPress Administration APIs */\nrequire_once ABSPATH . 'wp-admin/includes/admin.php';\n\n/** Load Ajax Handlers for WordPress Core */\nrequire_once ABSPATH . 'wp-admin/includes/ajax-actions.php';\n\nsend_nosniff_header();\nnocache_headers();\n\n/** This action is documented in wp-admin/admin.php */\ndo_action( 'admin_init' );\n\n$core_actions_get = array(\n\t'fetch-list',\n\t'ajax-tag-search',\n\t'wp-compression-test',\n\t'imgedit-preview',\n\t'oembed-cache',\n\t'autocomplete-user',\n\t'dashboard-widgets',\n\t'logged-in',\n\t'rest-nonce',\n);\n\n$core_actions_post = array(\n\t'oembed-cache',\n\t'image-editor',\n\t'delete-comment',\n\t'delete-tag',\n\t'delete-link',\n\t'delete-meta',\n\t'delete-post',\n\t'trash-post',\n\t'untrash-post',\n\t'delete-page',\n\t'dim-comment',\n\t'add-link-category',\n\t'add-tag',\n\t'get-tagcloud',\n\t'get-comments',\n\t'replyto-comment',\n\t'edit-comment',\n\t'add-menu-item',\n\t'add-meta',\n\t'add-user',\n\t'closed-postboxes',\n\t'hidden-columns',\n\t'update-welcome-panel',\n\t'menu-get-metabox',\n\t'wp-link-ajax',\n\t'menu-locations-save',\n\t'menu-quick-search',\n\t'meta-box-order',\n\t'get-permalink',\n\t'sample-permalink',\n\t'inline-save',\n\t'inline-save-tax',\n\t'find_posts',\n\t'widgets-order',\n\t'save-widget',\n\t'delete-inactive-widgets',\n\t'set-post-thumbnail',\n\t'date_format',\n\t'time_format',\n\t'wp-remove-post-lock',\n\t'dismiss-wp-pointer',\n\t'upload-attachment',\n\t'get-attachment',\n\t'query-attachments',\n\t'save-attachment',\n\t'save-attachment-compat',\n\t'send-link-to-editor',\n\t'send-attachment-to-editor',\n\t'save-attachment-order',\n\t'media-create-image-subsizes',\n\t'heartbeat',\n\t'get-revision-diffs',\n\t'save-user-color-scheme',\n\t'update-widget',\n\t'query-themes',\n\t'parse-embed',\n\t'set-attachment-thumbnail',\n\t'parse-media-shortcode',\n\t'destroy-sessions',\n\t'install-plugin',\n\t'update-plugin',\n\t'crop-image',\n\t'generate-password',\n\t'save-wporg-username',\n\t'delete-plugin',\n\t'search-plugins',\n\t'search-install-plugins',\n\t'activate-plugin',\n\t'update-theme',\n\t'delete-theme',\n\t'install-theme',\n\t'get-post-thumbnail-html',\n\t'get-community-events',\n\t'edit-theme-plugin-file',\n\t'wp-privacy-export-personal-data',\n\t'wp-privacy-erase-personal-data',\n\t'health-check-site-status-result',\n\t'health-check-dotorg-communication',\n\t'health-check-is-in-debug-mode',\n\t'health-check-background-updates',\n\t'health-check-loopback-requests',\n\t'health-check-get-sizes',\n\t'toggle-auto-updates',\n);\n\n// Deprecated.\n$core_actions_post_deprecated = array( 'wp-fullscreen-save-post', 'press-this-save-post', 'press-this-add-category' );\n$core_actions_post            = array_merge( $core_actions_post, $core_actions_post_deprecated );\n\n// Register core Ajax calls.\nif ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get, true ) ) {\n\tadd_action( 'wp_ajax_' . $_GET['action'], 'wp_ajax_' . str_replace( '-', '_', $_GET['action'] ), 1 );\n}\n\nif ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post, true ) ) {\n\tadd_action( 'wp_ajax_' . $_POST['action'], 'wp_ajax_' . str_replace( '-', '_', $_POST['action'] ), 1 );\n}\n\nadd_action( 'wp_ajax_nopriv_heartbeat', 'wp_ajax_nopriv_heartbeat', 1 );\n\n$action = ( isset( $_REQUEST['action'] ) ) ? $_REQUEST['action'] : '';\n\nif ( is_user_logged_in() ) {\n\t// If no action is registered, return a Bad Request response.\n\tif ( ! has_action( \"wp_ajax_{$action}\" ) ) {\n\t\twp_die( '0', 400 );\n\t}\n\n\t/**\n\t * Fires authenticated Ajax actions for logged-in users.\n\t *\n\t * The dynamic portion of the hook name, `$action`, refers\n\t * to the name of the Ajax action callback being fired.\n\t *\n\t * @since 2.1.0\n\t */\n\tdo_action( \"wp_ajax_{$action}\" );\n} else {\n\t// If no action is registered, return a Bad Request response.\n\tif ( ! has_action( \"wp_ajax_nopriv_{$action}\" ) ) {\n\t\twp_die( '0', 400 );\n\t}\n\n\t/**\n\t * Fires non-authenticated Ajax actions for logged-out users.\n\t *\n\t * The dynamic portion of the hook name, `$action`, refers\n\t * to the name of the Ajax action callback being fired.\n\t *\n\t * @since 2.8.0\n\t */\n\tdo_action( \"wp_ajax_nopriv_{$action}\" );\n}\n// Default status.\nwp_die( '0' );\n", "num_lines": 195}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Administration Template Footer\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n// Don't load directly.\nif ( ! defined( 'ABSPATH' ) ) {\n\tdie( '-1' );\n}\n\n/**\n * @global string $hook_suffix\n */\nglobal $hook_suffix;\n?>\n\n<div class=\"clear\"></div></div><!-- wpbody-content -->\n<div class=\"clear\"></div></div><!-- wpbody -->\n<div class=\"clear\"></div></div><!-- wpcontent -->\n\n<div id=\"wpfooter\" role=\"contentinfo\">\n\t<?php\n\t/**\n\t * Fires after the opening tag for the admin footer.\n\t *\n\t * @since 2.5.0\n\t */\n\tdo_action( 'in_admin_footer' );\n\t?>\n\t<p id=\"footer-left\" class=\"alignleft\">\n\t\t<?php\n\t\t$text = sprintf(\n\t\t\t/* translators: %s: https://wordpress.org/ */\n\t\t\t__( 'Thank you for creating with <a href=\"%s\">WordPress</a>.' ),\n\t\t\t__( 'https://wordpress.org/' )\n\t\t);\n\n\t\t/**\n\t\t * Filters the \"Thank you\" text displayed in the admin footer.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string $text The content that will be printed.\n\t\t */\n\t\techo apply_filters( 'admin_footer_text', '<span id=\"footer-thankyou\">' . $text . '</span>' );\n\t\t?>\n\t</p>\n\t<p id=\"footer-upgrade\" class=\"alignright\">\n\t\t<?php\n\t\t/**\n\t\t * Filters the version/update text displayed in the admin footer.\n\t\t *\n\t\t * WordPress prints the current version and update information,\n\t\t * using core_update_footer() at priority 10.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @see core_update_footer()\n\t\t *\n\t\t * @param string $content The content that will be printed.\n\t\t */\n\t\techo apply_filters( 'update_footer', '' );\n\t\t?>\n\t</p>\n\t<div class=\"clear\"></div>\n</div>\n<?php\n/**\n * Prints scripts or data before the default footer scripts.\n *\n * @since 1.2.0\n *\n * @param string $data The data to print.\n */\ndo_action( 'admin_footer', '' );\n\n/**\n * Prints scripts and data queued for the footer.\n *\n * The dynamic portion of the hook name, `$hook_suffix`,\n * refers to the global hook suffix of the current page.\n *\n * @since 4.6.0\n */\ndo_action( \"admin_print_footer_scripts-{$hook_suffix}\" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n/**\n * Prints any scripts and data queued for the footer.\n *\n * @since 2.8.0\n */\ndo_action( 'admin_print_footer_scripts' );\n\n/**\n * Prints scripts or data after the default footer scripts.\n *\n * The dynamic portion of the hook name, `$hook_suffix`,\n * refers to the global hook suffix of the current page.\n *\n * @since 2.8.0\n */\ndo_action( \"admin_footer-{$hook_suffix}\" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n// get_site_option() won't exist when auto upgrading from <= 2.7.\nif ( function_exists( 'get_site_option' ) ) {\n\tif ( false === get_site_option( 'can_compress_scripts' ) ) {\n\t\tcompression_test();\n\t}\n}\n\n?>\n\n<div class=\"clear\"></div></div><!-- wpwrap -->\n<script type=\"text/javascript\">if(typeof wpOnload=='function')wpOnload();</script>\n</body>\n</html>\n", "num_lines": 120}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Administration Functions\n *\n * This file is deprecated, use 'wp-admin/includes/admin.php' instead.\n *\n * @deprecated 2.5.0\n * @package WordPress\n * @subpackage Administration\n */\n\n_deprecated_file( basename( __FILE__ ), '2.5.0', 'wp-admin/includes/admin.php' );\n\n/** WordPress Administration API: Includes all Administration functions. */\nrequire_once ABSPATH . 'wp-admin/includes/admin.php';\n", "num_lines": 16}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Administration Template Header\n *\n * @package WordPress\n * @subpackage Administration\n */\n\nheader( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );\nif ( ! defined( 'WP_ADMIN' ) ) {\n\trequire_once __DIR__ . '/admin.php';\n}\n\n/**\n * In case admin-header.php is included in a function.\n *\n * @global string    $title\n * @global string    $hook_suffix\n * @global WP_Screen $current_screen     WordPress current screen object.\n * @global WP_Locale $wp_locale          WordPress date and time locale object.\n * @global string    $pagenow\n * @global string    $update_title\n * @global int       $total_update_count\n * @global string    $parent_file\n */\nglobal $title, $hook_suffix, $current_screen, $wp_locale, $pagenow,\n\t$update_title, $total_update_count, $parent_file;\n\n// Catch plugins that include admin-header.php before admin.php completes.\nif ( empty( $current_screen ) ) {\n\tset_current_screen();\n}\n\nget_admin_page_title();\n$title = strip_tags( $title );\n\nif ( is_network_admin() ) {\n\t/* translators: Network admin screen title. %s: Network title. */\n\t$admin_title = sprintf( __( 'Network Admin: %s' ), get_network()->site_name );\n} elseif ( is_user_admin() ) {\n\t/* translators: User dashboard screen title. %s: Network title. */\n\t$admin_title = sprintf( __( 'User Dashboard: %s' ), get_network()->site_name );\n} else {\n\t$admin_title = get_bloginfo( 'name' );\n}\n\nif ( $admin_title === $title ) {\n\t/* translators: Admin screen title. %s: Admin screen name. */\n\t$admin_title = sprintf( __( '%s &#8212; WordPress' ), $title );\n} else {\n\t/* translators: Admin screen title. 1: Admin screen name, 2: Network or site name. */\n\t$admin_title = sprintf( __( '%1$s &lsaquo; %2$s &#8212; WordPress' ), $title, $admin_title );\n}\n\nif ( wp_is_recovery_mode() ) {\n\t/* translators: %s: Admin screen title. */\n\t$admin_title = sprintf( __( 'Recovery Mode &#8212; %s' ), $admin_title );\n}\n\n/**\n * Filters the title tag content for an admin page.\n *\n * @since 3.1.0\n *\n * @param string $admin_title The page title, with extra context added.\n * @param string $title       The original page title.\n */\n$admin_title = apply_filters( 'admin_title', $admin_title, $title );\n\nwp_user_settings();\n\n_wp_admin_html_begin();\n?>\n<title><?php echo esc_html( $admin_title ); ?></title>\n<?php\n\nwp_enqueue_style( 'colors' );\nwp_enqueue_script( 'utils' );\nwp_enqueue_script( 'svg-painter' );\n\n$admin_body_class = preg_replace( '/[^a-z0-9_-]+/i', '-', $hook_suffix );\n?>\n<script type=\"text/javascript\">\naddLoadEvent = function(func){if(typeof jQuery!=='undefined')jQuery(document).ready(func);else if(typeof wpOnload!=='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};\nvar ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>',\n\tpagenow = '<?php echo esc_js( $current_screen->id ); ?>',\n\ttypenow = '<?php echo esc_js( $current_screen->post_type ); ?>',\n\tadminpage = '<?php echo esc_js( $admin_body_class ); ?>',\n\tthousandsSeparator = '<?php echo esc_js( $wp_locale->number_format['thousands_sep'] ); ?>',\n\tdecimalPoint = '<?php echo esc_js( $wp_locale->number_format['decimal_point'] ); ?>',\n\tisRtl = <?php echo (int) is_rtl(); ?>;\n</script>\n<?php\n\n/**\n * Enqueue scripts for all admin pages.\n *\n * @since 2.8.0\n *\n * @param string $hook_suffix The current admin page.\n */\ndo_action( 'admin_enqueue_scripts', $hook_suffix );\n\n/**\n * Fires when styles are printed for a specific admin page based on $hook_suffix.\n *\n * @since 2.6.0\n */\ndo_action( \"admin_print_styles-{$hook_suffix}\" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n/**\n * Fires when styles are printed for all admin pages.\n *\n * @since 2.6.0\n */\ndo_action( 'admin_print_styles' );\n\n/**\n * Fires when scripts are printed for a specific admin page based on $hook_suffix.\n *\n * @since 2.1.0\n */\ndo_action( \"admin_print_scripts-{$hook_suffix}\" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n/**\n * Fires when scripts are printed for all admin pages.\n *\n * @since 2.1.0\n */\ndo_action( 'admin_print_scripts' );\n\n/**\n * Fires in head section for a specific admin page.\n *\n * The dynamic portion of the hook, `$hook_suffix`, refers to the hook suffix\n * for the admin page.\n *\n * @since 2.1.0\n */\ndo_action( \"admin_head-{$hook_suffix}\" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n/**\n * Fires in head section for all admin pages.\n *\n * @since 2.1.0\n */\ndo_action( 'admin_head' );\n\nif ( 'f' === get_user_setting( 'mfold' ) ) {\n\t$admin_body_class .= ' folded';\n}\n\nif ( ! get_user_setting( 'unfold' ) ) {\n\t$admin_body_class .= ' auto-fold';\n}\n\nif ( is_admin_bar_showing() ) {\n\t$admin_body_class .= ' admin-bar';\n}\n\nif ( is_rtl() ) {\n\t$admin_body_class .= ' rtl';\n}\n\nif ( $current_screen->post_type ) {\n\t$admin_body_class .= ' post-type-' . $current_screen->post_type;\n}\n\nif ( $current_screen->taxonomy ) {\n\t$admin_body_class .= ' taxonomy-' . $current_screen->taxonomy;\n}\n\n$admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( get_bloginfo( 'version' ) ) );\n$admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', get_bloginfo( 'version' ) ) );\n$admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' );\n$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );\n\nif ( wp_is_mobile() ) {\n\t$admin_body_class .= ' mobile';\n}\n\nif ( is_multisite() ) {\n\t$admin_body_class .= ' multisite';\n}\n\nif ( is_network_admin() ) {\n\t$admin_body_class .= ' network-admin';\n}\n\n$admin_body_class .= ' no-customize-support no-svg';\n\nif ( $current_screen->is_block_editor() ) {\n\t// Default to is-fullscreen-mode to avoid jumps in the UI.\n\t$admin_body_class .= ' block-editor-page is-fullscreen-mode wp-embed-responsive';\n\n\tif ( current_theme_supports( 'editor-styles' ) && current_theme_supports( 'dark-editor-style' ) ) {\n\t\t$admin_body_class .= ' is-dark-theme';\n\t}\n}\n\n$error_get_last = error_get_last();\n\n// Print a CSS class to make PHP errors visible.\nif ( $error_get_last && WP_DEBUG && WP_DEBUG_DISPLAY && ini_get( 'display_errors' )\n\t// Don't print the class for PHP notices in wp-config.php, as they happen before WP_DEBUG takes effect,\n\t// and should not be displayed with the `error_reporting` level previously set in wp-load.php.\n\t&& ( E_NOTICE !== $error_get_last['type'] || 'wp-config.php' !== wp_basename( $error_get_last['file'] ) )\n) {\n\t$admin_body_class .= ' php-error';\n}\n\nunset( $error_get_last );\n\n?>\n</head>\n<?php\n/**\n * Filters the CSS classes for the body tag in the admin.\n *\n * This filter differs from the {@see 'post_class'} and {@see 'body_class'} filters\n * in two important ways:\n *\n * 1. `$classes` is a space-separated string of class names instead of an array.\n * 2. Not all core admin classes are filterable, notably: wp-admin, wp-core-ui,\n *    and no-js cannot be removed.\n *\n * @since 2.3.0\n *\n * @param string $classes Space-separated list of CSS classes.\n */\n$admin_body_classes = apply_filters( 'admin_body_class', '' );\n$admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class );\n?>\n<body class=\"wp-admin wp-core-ui no-js <?php echo $admin_body_classes; ?>\">\n<script type=\"text/javascript\">\n\tdocument.body.className = document.body.className.replace('no-js','js');\n</script>\n\n<?php\n// Make sure the customize body classes are correct as early as possible.\nif ( current_user_can( 'customize' ) ) {\n\twp_customize_support_script();\n}\n?>\n\n<div id=\"wpwrap\">\n<?php require ABSPATH . 'wp-admin/menu-header.php'; ?>\n<div id=\"wpcontent\">\n\n<?php\n/**\n * Fires at the beginning of the content section in an admin page.\n *\n * @since 3.0.0\n */\ndo_action( 'in_admin_header' );\n?>\n\n<div id=\"wpbody\" role=\"main\">\n<?php\nunset( $blog_name, $total_update_count, $update_title );\n\n$current_screen->set_parentage( $parent_file );\n\n?>\n\n<div id=\"wpbody-content\">\n<?php\n\n$current_screen->render_screen_meta();\n\nif ( is_network_admin() ) {\n\t/**\n\t * Prints network admin screen notices.\n\t *\n\t * @since 3.1.0\n\t */\n\tdo_action( 'network_admin_notices' );\n} elseif ( is_user_admin() ) {\n\t/**\n\t * Prints user admin screen notices.\n\t *\n\t * @since 3.1.0\n\t */\n\tdo_action( 'user_admin_notices' );\n} else {\n\t/**\n\t * Prints admin screen notices.\n\t *\n\t * @since 3.1.0\n\t */\n\tdo_action( 'admin_notices' );\n}\n\n/**\n * Prints generic admin screen notices.\n *\n * @since 3.1.0\n */\ndo_action( 'all_admin_notices' );\n\nif ( 'options-general.php' === $parent_file ) {\n\trequire ABSPATH . 'wp-admin/options-head.php';\n}\n", "num_lines": 305}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Generic Request (POST/GET) Handler\n *\n * Intended for form submission handling in themes and plugins.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** We are located in WordPress Administration Screens */\nif ( ! defined( 'WP_ADMIN' ) ) {\n\tdefine( 'WP_ADMIN', true );\n}\n\nif ( defined( 'ABSPATH' ) ) {\n\trequire_once ABSPATH . 'wp-load.php';\n} else {\n\trequire_once dirname( __DIR__ ) . '/wp-load.php';\n}\n\n/** Allow for cross-domain requests (from the front end). */\nsend_origin_headers();\n\nrequire_once ABSPATH . 'wp-admin/includes/admin.php';\n\nnocache_headers();\n\n/** This action is documented in wp-admin/admin.php */\ndo_action( 'admin_init' );\n\n$action = empty( $_REQUEST['action'] ) ? '' : $_REQUEST['action'];\n\nif ( ! is_user_logged_in() ) {\n\tif ( empty( $action ) ) {\n\t\t/**\n\t\t * Fires on a non-authenticated admin post request where no action is supplied.\n\t\t *\n\t\t * @since 2.6.0\n\t\t */\n\t\tdo_action( 'admin_post_nopriv' );\n\t} else {\n\t\t/**\n\t\t * Fires on a non-authenticated admin post request for the given action.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$action`, refers to the given\n\t\t * request action.\n\t\t *\n\t\t * @since 2.6.0\n\t\t */\n\t\tdo_action( \"admin_post_nopriv_{$action}\" );\n\t}\n} else {\n\tif ( empty( $action ) ) {\n\t\t/**\n\t\t * Fires on an authenticated admin post request where no action is supplied.\n\t\t *\n\t\t * @since 2.6.0\n\t\t */\n\t\tdo_action( 'admin_post' );\n\t} else {\n\t\t/**\n\t\t * Fires on an authenticated admin post request for the given action.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$action`, refers to the given\n\t\t * request action.\n\t\t *\n\t\t * @since 2.6.0\n\t\t */\n\t\tdo_action( \"admin_post_{$action}\" );\n\t}\n}\n", "num_lines": 73}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Administration Bootstrap\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * In WordPress Administration Screens\n *\n * @since 2.3.2\n */\nif ( ! defined( 'WP_ADMIN' ) ) {\n\tdefine( 'WP_ADMIN', true );\n}\n\nif ( ! defined( 'WP_NETWORK_ADMIN' ) ) {\n\tdefine( 'WP_NETWORK_ADMIN', false );\n}\n\nif ( ! defined( 'WP_USER_ADMIN' ) ) {\n\tdefine( 'WP_USER_ADMIN', false );\n}\n\nif ( ! WP_NETWORK_ADMIN && ! WP_USER_ADMIN ) {\n\tdefine( 'WP_BLOG_ADMIN', true );\n}\n\nif ( isset( $_GET['import'] ) && ! defined( 'WP_LOAD_IMPORTERS' ) ) {\n\tdefine( 'WP_LOAD_IMPORTERS', true );\n}\n\nrequire_once dirname( __DIR__ ) . '/wp-load.php';\n\nnocache_headers();\n\nif ( get_option( 'db_upgraded' ) ) {\n\n\tflush_rewrite_rules();\n\tupdate_option( 'db_upgraded', false );\n\n\t/**\n\t * Fires on the next page load after a successful DB upgrade.\n\t *\n\t * @since 2.8.0\n\t */\n\tdo_action( 'after_db_upgrade' );\n\n} elseif ( ! wp_doing_ajax() && empty( $_POST )\n\t&& (int) get_option( 'db_version' ) !== $wp_db_version\n) {\n\n\tif ( ! is_multisite() ) {\n\t\twp_redirect( admin_url( 'upgrade.php?_wp_http_referer=' . urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );\n\t\texit;\n\t}\n\n\t/**\n\t * Filters whether to attempt to perform the multisite DB upgrade routine.\n\t *\n\t * In single site, the user would be redirected to wp-admin/upgrade.php.\n\t * In multisite, the DB upgrade routine is automatically fired, but only\n\t * when this filter returns true.\n\t *\n\t * If the network is 50 sites or less, it will run every time. Otherwise,\n\t * it will throttle itself to reduce load.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param bool $do_mu_upgrade Whether to perform the Multisite upgrade routine. Default true.\n\t */\n\tif ( apply_filters( 'do_mu_upgrade', true ) ) {\n\t\t$c = get_blog_count();\n\n\t\t/*\n\t\t * If there are 50 or fewer sites, run every time. Otherwise, throttle to reduce load:\n\t\t * attempt to do no more than threshold value, with some +/- allowed.\n\t\t */\n\t\tif ( $c <= 50 || ( $c > 50 && mt_rand( 0, (int) ( $c / 50 ) ) === 1 ) ) {\n\t\t\trequire_once ABSPATH . WPINC . '/http.php';\n\t\t\t$response = wp_remote_get(\n\t\t\t\tadmin_url( 'upgrade.php?step=1' ),\n\t\t\t\tarray(\n\t\t\t\t\t'timeout'     => 120,\n\t\t\t\t\t'httpversion' => '1.1',\n\t\t\t\t)\n\t\t\t);\n\t\t\t/** This action is documented in wp-admin/network/upgrade.php */\n\t\t\tdo_action( 'after_mu_upgrade', $response );\n\t\t\tunset( $response );\n\t\t}\n\t\tunset( $c );\n\t}\n}\n\nrequire_once ABSPATH . 'wp-admin/includes/admin.php';\n\nauth_redirect();\n\n// Schedule Trash collection.\nif ( ! wp_next_scheduled( 'wp_scheduled_delete' ) && ! wp_installing() ) {\n\twp_schedule_event( time(), 'daily', 'wp_scheduled_delete' );\n}\n\n// Schedule transient cleanup.\nif ( ! wp_next_scheduled( 'delete_expired_transients' ) && ! wp_installing() ) {\n\twp_schedule_event( time(), 'daily', 'delete_expired_transients' );\n}\n\nset_screen_options();\n\n$date_format = __( 'F j, Y' );\n$time_format = __( 'g:i a' );\n\nwp_enqueue_script( 'common' );\n\n/**\n * $pagenow is set in vars.php\n * $wp_importers is sometimes set in wp-admin/includes/import.php\n * The remaining variables are imported as globals elsewhere, declared as globals here\n *\n * @global string $pagenow\n * @global array  $wp_importers\n * @global string $hook_suffix\n * @global string $plugin_page\n * @global string $typenow\n * @global string $taxnow\n */\nglobal $pagenow, $wp_importers, $hook_suffix, $plugin_page, $typenow, $taxnow;\n\n$page_hook = null;\n\n$editing = false;\n\nif ( isset( $_GET['page'] ) ) {\n\t$plugin_page = wp_unslash( $_GET['page'] );\n\t$plugin_page = plugin_basename( $plugin_page );\n}\n\nif ( isset( $_REQUEST['post_type'] ) && post_type_exists( $_REQUEST['post_type'] ) ) {\n\t$typenow = $_REQUEST['post_type'];\n} else {\n\t$typenow = '';\n}\n\nif ( isset( $_REQUEST['taxonomy'] ) && taxonomy_exists( $_REQUEST['taxonomy'] ) ) {\n\t$taxnow = $_REQUEST['taxonomy'];\n} else {\n\t$taxnow = '';\n}\n\nif ( WP_NETWORK_ADMIN ) {\n\trequire ABSPATH . 'wp-admin/network/menu.php';\n} elseif ( WP_USER_ADMIN ) {\n\trequire ABSPATH . 'wp-admin/user/menu.php';\n} else {\n\trequire ABSPATH . 'wp-admin/menu.php';\n}\n\nif ( current_user_can( 'manage_options' ) ) {\n\twp_raise_memory_limit( 'admin' );\n}\n\n/**\n * Fires as an admin screen or script is being initialized.\n *\n * Note, this does not just run on user-facing admin screens.\n * It runs on admin-ajax.php and admin-post.php as well.\n *\n * This is roughly analogous to the more general {@see 'init'} hook, which fires earlier.\n *\n * @since 2.5.0\n */\ndo_action( 'admin_init' );\n\nif ( isset( $plugin_page ) ) {\n\tif ( ! empty( $typenow ) ) {\n\t\t$the_parent = $pagenow . '?post_type=' . $typenow;\n\t} else {\n\t\t$the_parent = $pagenow;\n\t}\n\n\t$page_hook = get_plugin_page_hook( $plugin_page, $the_parent );\n\tif ( ! $page_hook ) {\n\t\t$page_hook = get_plugin_page_hook( $plugin_page, $plugin_page );\n\n\t\t// Back-compat for plugins using add_management_page().\n\t\tif ( empty( $page_hook ) && 'edit.php' === $pagenow && get_plugin_page_hook( $plugin_page, 'tools.php' ) ) {\n\t\t\t// There could be plugin specific params on the URL, so we need the whole query string.\n\t\t\tif ( ! empty( $_SERVER['QUERY_STRING'] ) ) {\n\t\t\t\t$query_string = $_SERVER['QUERY_STRING'];\n\t\t\t} else {\n\t\t\t\t$query_string = 'page=' . $plugin_page;\n\t\t\t}\n\t\t\twp_redirect( admin_url( 'tools.php?' . $query_string ) );\n\t\t\texit;\n\t\t}\n\t}\n\tunset( $the_parent );\n}\n\n$hook_suffix = '';\nif ( isset( $page_hook ) ) {\n\t$hook_suffix = $page_hook;\n} elseif ( isset( $plugin_page ) ) {\n\t$hook_suffix = $plugin_page;\n} elseif ( isset( $pagenow ) ) {\n\t$hook_suffix = $pagenow;\n}\n\nset_current_screen();\n\n// Handle plugin admin pages.\nif ( isset( $plugin_page ) ) {\n\tif ( $page_hook ) {\n\t\t/**\n\t\t * Fires before a particular screen is loaded.\n\t\t *\n\t\t * The load-* hook fires in a number of contexts. This hook is for plugin screens\n\t\t * where a callback is provided when the screen is registered.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$page_hook`, refers to a mixture of plugin\n\t\t * page information including:\n\t\t * 1. The page type. If the plugin page is registered as a submenu page, such as for\n\t\t *    Settings, the page type would be 'settings'. Otherwise the type is 'toplevel'.\n\t\t * 2. A separator of '_page_'.\n\t\t * 3. The plugin basename minus the file extension.\n\t\t *\n\t\t * Together, the three parts form the `$page_hook`. Citing the example above,\n\t\t * the hook name used would be 'load-settings_page_pluginbasename'.\n\t\t *\n\t\t * @see get_plugin_page_hook()\n\t\t *\n\t\t * @since 2.1.0\n\t\t */\n\t\tdo_action( \"load-{$page_hook}\" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t\tif ( ! isset( $_GET['noheader'] ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t\t}\n\n\t\t/**\n\t\t * Used to call the registered callback for a plugin screen.\n\t\t *\n\t\t * This hook uses a dynamic hook name, `$page_hook`, which refers to a mixture of plugin\n\t\t * page information including:\n\t\t * 1. The page type. If the plugin page is registered as a submenu page, such as for\n\t\t *    Settings, the page type would be 'settings'. Otherwise the type is 'toplevel'.\n\t\t * 2. A separator of '_page_'.\n\t\t * 3. The plugin basename minus the file extension.\n\t\t *\n\t\t * Together, the three parts form the `$page_hook`. Citing the example above,\n\t\t * the hook name used would be 'settings_page_pluginbasename'.\n\t\t *\n\t\t * @see get_plugin_page_hook()\n\t\t *\n\t\t * @since 1.5.0\n\t\t */\n\t\tdo_action( $page_hook );\n\t} else {\n\t\tif ( validate_file( $plugin_page ) ) {\n\t\t\twp_die( __( 'Invalid plugin page.' ) );\n\t\t}\n\n\t\tif ( ! ( file_exists( WP_PLUGIN_DIR . \"/$plugin_page\" ) && is_file( WP_PLUGIN_DIR . \"/$plugin_page\" ) )\n\t\t\t&& ! ( file_exists( WPMU_PLUGIN_DIR . \"/$plugin_page\" ) && is_file( WPMU_PLUGIN_DIR . \"/$plugin_page\" ) )\n\t\t) {\n\t\t\t/* translators: %s: Admin page generated by a plugin. */\n\t\t\twp_die( sprintf( __( 'Cannot load %s.' ), htmlentities( $plugin_page ) ) );\n\t\t}\n\n\t\t/**\n\t\t * Fires before a particular screen is loaded.\n\t\t *\n\t\t * The load-* hook fires in a number of contexts. This hook is for plugin screens\n\t\t * where the file to load is directly included, rather than the use of a function.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$plugin_page`, refers to the plugin basename.\n\t\t *\n\t\t * @see plugin_basename()\n\t\t *\n\t\t * @since 1.5.0\n\t\t */\n\t\tdo_action( \"load-{$plugin_page}\" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\tif ( ! isset( $_GET['noheader'] ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t\t}\n\n\t\tif ( file_exists( WPMU_PLUGIN_DIR . \"/$plugin_page\" ) ) {\n\t\t\tinclude WPMU_PLUGIN_DIR . \"/$plugin_page\";\n\t\t} else {\n\t\t\tinclude WP_PLUGIN_DIR . \"/$plugin_page\";\n\t\t}\n\t}\n\n\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\n\texit;\n} elseif ( isset( $_GET['import'] ) ) {\n\n\t$importer = $_GET['import'];\n\n\tif ( ! current_user_can( 'import' ) ) {\n\t\twp_die( __( 'Sorry, you are not allowed to import content into this site.' ) );\n\t}\n\n\tif ( validate_file( $importer ) ) {\n\t\twp_redirect( admin_url( 'import.php?invalid=' . $importer ) );\n\t\texit;\n\t}\n\n\tif ( ! isset( $wp_importers[ $importer ] ) || ! is_callable( $wp_importers[ $importer ][2] ) ) {\n\t\twp_redirect( admin_url( 'import.php?invalid=' . $importer ) );\n\t\texit;\n\t}\n\n\t/**\n\t * Fires before an importer screen is loaded.\n\t *\n\t * The dynamic portion of the hook name, `$importer`, refers to the importer slug.\n\t *\n\t * @since 3.5.0\n\t */\n\tdo_action( \"load-importer-{$importer}\" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t$parent_file  = 'tools.php';\n\t$submenu_file = 'import.php';\n\t$title        = __( 'Import' );\n\n\tif ( ! isset( $_GET['noheader'] ) ) {\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t}\n\n\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\n\tdefine( 'WP_IMPORTING', true );\n\n\t/**\n\t * Whether to filter imported data through kses on import.\n\t *\n\t * Multisite uses this hook to filter all data through kses by default,\n\t * as a super administrator may be assisting an untrusted user.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param bool $force Whether to force data to be filtered through kses. Default false.\n\t */\n\tif ( apply_filters( 'force_filtered_html_on_import', false ) ) {\n\t\tkses_init_filters();  // Always filter imported data with kses on multisite.\n\t}\n\n\tcall_user_func( $wp_importers[ $importer ][2] );\n\n\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\n\t// Make sure rules are flushed.\n\tflush_rewrite_rules( false );\n\n\texit;\n} else {\n\t/**\n\t * Fires before a particular screen is loaded.\n\t *\n\t * The load-* hook fires in a number of contexts. This hook is for core screens.\n\t *\n\t * The dynamic portion of the hook name, `$pagenow`, is a global variable\n\t * referring to the filename of the current page, such as 'admin.php',\n\t * 'post-new.php' etc. A complete hook for the latter would be\n\t * 'load-post-new.php'.\n\t *\n\t * @since 2.1.0\n\t */\n\tdo_action( \"load-{$pagenow}\" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t/*\n\t * The following hooks are fired to ensure backward compatibility.\n\t * In all other cases, 'load-' . $pagenow should be used instead.\n\t */\n\tif ( 'page' === $typenow ) {\n\t\tif ( 'post-new.php' === $pagenow ) {\n\t\t\tdo_action( 'load-page-new.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t\t} elseif ( 'post.php' === $pagenow ) {\n\t\t\tdo_action( 'load-page.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t\t}\n\t} elseif ( 'edit-tags.php' === $pagenow ) {\n\t\tif ( 'category' === $taxnow ) {\n\t\t\tdo_action( 'load-categories.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t\t} elseif ( 'link_category' === $taxnow ) {\n\t\t\tdo_action( 'load-edit-link-categories.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t\t}\n\t} elseif ( 'term.php' === $pagenow ) {\n\t\tdo_action( 'load-edit-tags.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t}\n}\n\nif ( ! empty( $_REQUEST['action'] ) ) {\n\t$action = $_REQUEST['action'];\n\n\t/**\n\t * Fires when an 'action' request variable is sent.\n\t *\n\t * The dynamic portion of the hook name, `$action`, refers to\n\t * the action derived from the `GET` or `POST` request.\n\t *\n\t * @since 2.6.0\n\t */\n\tdo_action( \"admin_action_{$action}\" );\n}\n", "num_lines": 410}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Server-side file upload handler from wp-plupload or other asynchronous upload methods.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\nif ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {\n\tdefine( 'DOING_AJAX', true );\n}\n\nif ( ! defined( 'WP_ADMIN' ) ) {\n\tdefine( 'WP_ADMIN', true );\n}\n\nif ( defined( 'ABSPATH' ) ) {\n\trequire_once ABSPATH . 'wp-load.php';\n} else {\n\trequire_once dirname( __DIR__ ) . '/wp-load.php';\n}\n\nrequire_once ABSPATH . 'wp-admin/admin.php';\n\nheader( 'Content-Type: text/plain; charset=' . get_option( 'blog_charset' ) );\n\nif ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {\n\trequire ABSPATH . 'wp-admin/includes/ajax-actions.php';\n\n\tsend_nosniff_header();\n\tnocache_headers();\n\n\twp_ajax_upload_attachment();\n\tdie( '0' );\n}\n\nif ( ! current_user_can( 'upload_files' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to upload files.' ) );\n}\n\n// Just fetch the detail form for that attachment.\nif ( isset( $_REQUEST['attachment_id'] ) && intval( $_REQUEST['attachment_id'] ) && $_REQUEST['fetch'] ) {\n\t$id   = intval( $_REQUEST['attachment_id'] );\n\t$post = get_post( $id );\n\tif ( 'attachment' !== $post->post_type ) {\n\t\twp_die( __( 'Invalid post type.' ) );\n\t}\n\n\tswitch ( $_REQUEST['fetch'] ) {\n\t\tcase 3:\n\t\t\t$thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true );\n\t\t\tif ( $thumb_url ) {\n\t\t\t\techo '<img class=\"pinkynail\" src=\"' . esc_url( $thumb_url[0] ) . '\" alt=\"\" />';\n\t\t\t}\n\t\t\tif ( current_user_can( 'edit_post', $id ) ) {\n\t\t\t\techo '<a class=\"edit-attachment\" href=\"' . esc_url( get_edit_post_link( $id ) ) . '\" target=\"_blank\">' . _x( 'Edit', 'media item' ) . '</a>';\n\t\t\t} else {\n\t\t\t\techo '<span class=\"edit-attachment\">' . _x( 'Success', 'media item' ) . '</span>';\n\t\t\t}\n\n\t\t\t// Title shouldn't ever be empty, but use filename just in case.\n\t\t\t$file  = get_attached_file( $post->ID );\n\t\t\t$title = $post->post_title ? $post->post_title : wp_basename( $file );\n\t\t\techo '<div class=\"filename new\"><span class=\"title\">' . esc_html( wp_html_excerpt( $title, 60, '&hellip;' ) ) . '</span></div>';\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tadd_filter( 'attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2 );\n\t\t\techo get_media_item(\n\t\t\t\t$id,\n\t\t\t\tarray(\n\t\t\t\t\t'send'   => false,\n\t\t\t\t\t'delete' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tadd_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 );\n\t\t\techo get_media_item( $id );\n\t\t\tbreak;\n\t}\n\texit;\n}\n\ncheck_admin_referer( 'media-form' );\n\n$post_id = 0;\nif ( isset( $_REQUEST['post_id'] ) ) {\n\t$post_id = absint( $_REQUEST['post_id'] );\n\tif ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t$post_id = 0;\n\t}\n}\n\n$id = media_handle_upload( 'async-upload', $post_id );\nif ( is_wp_error( $id ) ) {\n\tprintf(\n\t\t'<div class=\"error-div error\">%s <strong>%s</strong><br />%s</div>',\n\t\tsprintf(\n\t\t\t'<button type=\"button\" class=\"dismiss button-link\" onclick=\"jQuery(this).parents(\\'div.media-item\\').slideUp(200, function(){jQuery(this).remove();});\">%s</button>',\n\t\t\t__( 'Dismiss' )\n\t\t),\n\t\tsprintf(\n\t\t\t/* translators: %s: Name of the file that failed to upload. */\n\t\t\t__( '&#8220;%s&#8221; has failed to upload.' ),\n\t\t\tesc_html( $_FILES['async-upload']['name'] )\n\t\t),\n\t\tesc_html( $id->get_error_message() )\n\t);\n\texit;\n}\n\nif ( $_REQUEST['short'] ) {\n\t// Short form response - attachment ID only.\n\techo $id;\n} else {\n\t// Long form response - big chunk of HTML.\n\t$type = $_REQUEST['type'];\n\n\t/**\n\t * Filters the returned ID of an uploaded attachment.\n\t *\n\t * The dynamic portion of the hook name, `$type`, refers to the attachment type,\n\t * such as 'image', 'audio', 'video', 'file', etc.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param int $id Uploaded attachment ID.\n\t */\n\techo apply_filters( \"async_upload_{$type}\", $id );\n}\n", "num_lines": 131}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Comment Management Screen\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** Load WordPress Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n$parent_file  = 'edit-comments.php';\n$submenu_file = 'edit-comments.php';\n\n/**\n * @global string $action\n */\nglobal $action;\nwp_reset_vars( array( 'action' ) );\n\nif ( isset( $_POST['deletecomment'] ) ) {\n\t$action = 'deletecomment';\n}\n\nif ( 'cdc' === $action ) {\n\t$action = 'delete';\n} elseif ( 'mac' === $action ) {\n\t$action = 'approve';\n}\n\nif ( isset( $_GET['dt'] ) ) {\n\tif ( 'spam' === $_GET['dt'] ) {\n\t\t$action = 'spam';\n\t} elseif ( 'trash' === $_GET['dt'] ) {\n\t\t$action = 'trash';\n\t}\n}\n\nif ( isset( $_REQUEST['c'] ) ) {\n\t$comment_id = absint( $_REQUEST['c'] );\n\t$comment    = get_comment( $comment_id );\n\n\t// Prevent actions on a comment associated with a trashed post.\n\tif ( $comment && 'trash' === get_post_status( $comment->comment_post_ID ) ) {\n\t\twp_die(\n\t\t\t__( 'You can&#8217;t edit this comment because the associated post is in the Trash. Please restore the post first, then try again.' )\n\t\t);\n\t}\n} else {\n\t$comment = null;\n}\n\nswitch ( $action ) {\n\n\tcase 'editcomment':\n\t\t$title = __( 'Edit Comment' );\n\n\t\tget_current_screen()->add_help_tab(\n\t\t\tarray(\n\t\t\t\t'id'      => 'overview',\n\t\t\t\t'title'   => __( 'Overview' ),\n\t\t\t\t'content' =>\n\t\t\t\t\t'<p>' . __( 'You can edit the information left in a comment if needed. This is often useful when you notice that a commenter has made a typographical error.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'You can also moderate the comment from this screen using the Status box, where you can also change the timestamp of the comment.' ) . '</p>',\n\t\t\t)\n\t\t);\n\n\t\tget_current_screen()->set_help_sidebar(\n\t\t\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/comments-screen/\">Documentation on Comments</a>' ) . '</p>' .\n\t\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n\t\t);\n\n\t\twp_enqueue_script( 'comment' );\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n\t\tif ( ! $comment ) {\n\t\t\tcomment_footer_die( __( 'Invalid comment ID.' ) . sprintf( ' <a href=\"%s\">' . __( 'Go back' ) . '</a>.', 'javascript:history.go(-1)' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_comment', $comment_id ) ) {\n\t\t\tcomment_footer_die( __( 'Sorry, you are not allowed to edit this comment.' ) );\n\t\t}\n\n\t\tif ( 'trash' === $comment->comment_approved ) {\n\t\t\tcomment_footer_die( __( 'This comment is in the Trash. Please move it out of the Trash if you want to edit it.' ) );\n\t\t}\n\n\t\t$comment = get_comment_to_edit( $comment_id );\n\n\t\trequire ABSPATH . 'wp-admin/edit-form-comment.php';\n\n\t\tbreak;\n\n\tcase 'delete':\n\tcase 'approve':\n\tcase 'trash':\n\tcase 'spam':\n\t\t$title = __( 'Moderate Comment' );\n\n\t\tif ( ! $comment ) {\n\t\t\twp_redirect( admin_url( 'edit-comments.php?error=1' ) );\n\t\t\tdie();\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {\n\t\t\twp_redirect( admin_url( 'edit-comments.php?error=2' ) );\n\t\t\tdie();\n\t\t}\n\n\t\t// No need to re-approve/re-trash/re-spam a comment.\n\t\tif ( str_replace( '1', 'approve', $comment->comment_approved ) === $action ) {\n\t\t\twp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) );\n\t\t\tdie();\n\t\t}\n\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n\t\t$formaction    = $action . 'comment';\n\t\t$nonce_action  = ( 'approve' === $action ) ? 'approve-comment_' : 'delete-comment_';\n\t\t$nonce_action .= $comment_id;\n\n\t\t?>\n\t<div class=\"wrap\">\n\n\t<h1><?php echo esc_html( $title ); ?></h1>\n\n\t\t<?php\n\t\tswitch ( $action ) {\n\t\t\tcase 'spam':\n\t\t\t\t$caution_msg = __( 'You are about to mark the following comment as spam:' );\n\t\t\t\t$button      = _x( 'Mark as spam', 'comment' );\n\t\t\t\tbreak;\n\t\t\tcase 'trash':\n\t\t\t\t$caution_msg = __( 'You are about to move the following comment to the Trash:' );\n\t\t\t\t$button      = __( 'Move to Trash' );\n\t\t\t\tbreak;\n\t\t\tcase 'delete':\n\t\t\t\t$caution_msg = __( 'You are about to delete the following comment:' );\n\t\t\t\t$button      = __( 'Permanently delete comment' );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$caution_msg = __( 'You are about to approve the following comment:' );\n\t\t\t\t$button      = __( 'Approve comment' );\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( '0' !== $comment->comment_approved ) { // If not unapproved.\n\t\t\t$message = '';\n\t\t\tswitch ( $comment->comment_approved ) {\n\t\t\t\tcase '1':\n\t\t\t\t\t$message = __( 'This comment is currently approved.' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'spam':\n\t\t\t\t\t$message = __( 'This comment is currently marked as spam.' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'trash':\n\t\t\t\t\t$message = __( 'This comment is currently in the Trash.' );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( $message ) {\n\t\t\t\techo '<div id=\"message\" class=\"notice notice-info\"><p>' . $message . '</p></div>';\n\t\t\t}\n\t\t}\n\t\t?>\n<div id=\"message\" class=\"notice notice-warning\"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo $caution_msg; ?></p></div>\n\n<table class=\"form-table comment-ays\">\n<tr>\n<th scope=\"row\"><?php _e( 'Author' ); ?></th>\n<td><?php comment_author( $comment ); ?></td>\n</tr>\n\t\t<?php if ( get_comment_author_email( $comment ) ) { ?>\n<tr>\n<th scope=\"row\"><?php _e( 'Email' ); ?></th>\n<td><?php comment_author_email( $comment ); ?></td>\n</tr>\n<?php } ?>\n\t\t<?php if ( get_comment_author_url( $comment ) ) { ?>\n<tr>\n<th scope=\"row\"><?php _e( 'URL' ); ?></th>\n<td><a href=\"<?php comment_author_url( $comment ); ?>\"><?php comment_author_url( $comment ); ?></a></td>\n</tr>\n<?php } ?>\n<tr>\n\t<th scope=\"row\"><?php /* translators: Column name or table row header. */ _e( 'In response to' ); ?></th>\n\t<td>\n\t\t<?php\n\t\t$post_id = $comment->comment_post_ID;\n\t\tif ( current_user_can( 'edit_post', $post_id ) ) {\n\t\t\t$post_link  = \"<a href='\" . esc_url( get_edit_post_link( $post_id ) ) . \"'>\";\n\t\t\t$post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';\n\t\t} else {\n\t\t\t$post_link = esc_html( get_the_title( $post_id ) );\n\t\t}\n\t\techo $post_link;\n\n\t\tif ( $comment->comment_parent ) {\n\t\t\t$parent      = get_comment( $comment->comment_parent );\n\t\t\t$parent_link = esc_url( get_comment_link( $parent ) );\n\t\t\t$name        = get_comment_author( $parent );\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: Comment link. */\n\t\t\t\t' | ' . __( 'In reply to %s.' ),\n\t\t\t\t'<a href=\"' . $parent_link . '\">' . $name . '</a>'\n\t\t\t);\n\t\t}\n\t\t?>\n\t</td>\n\t</tr>\n\t<tr>\n\t<th scope=\"row\"><?php _e( 'Submitted on' ); ?></th>\n\t<td>\n\t\t<?php\n\t\t$submitted = sprintf(\n\t\t\t/* translators: 1: Comment date, 2: Comment time. */\n\t\t\t__( '%1$s at %2$s' ),\n\t\t\t/* translators: Comment date format. See https://www.php.net/date */\n\t\t\tget_comment_date( __( 'Y/m/d' ), $comment ),\n\t\t\t/* translators: Comment time format. See https://www.php.net/date */\n\t\t\tget_comment_date( __( 'g:i a' ), $comment )\n\t\t);\n\t\tif ( 'approved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) {\n\t\t\techo '<a href=\"' . esc_url( get_comment_link( $comment ) ) . '\">' . $submitted . '</a>';\n\t\t} else {\n\t\t\techo $submitted;\n\t\t}\n\t\t?>\n\t\t</td>\n\t</tr>\n\t<tr>\n\t<th scope=\"row\"><?php /* translators: Field name in comment form. */ _ex( 'Comment', 'noun' ); ?></th>\n\t<td class=\"comment-content\">\n\t\t<?php comment_text( $comment ); ?>\n\t<p class=\"edit-comment\"><a href=\"<?php echo admin_url( \"comment.php?action=editcomment&amp;c={$comment->comment_ID}\" ); ?>\"><?php esc_html_e( 'Edit' ); ?></a></p>\n\t</td>\n\t</tr>\n\t</table>\n\n\t<form action=\"comment.php\" method=\"get\" class=\"comment-ays-submit\">\n\n\t<p>\n\t\t<?php submit_button( $button, 'primary', 'submit', false ); ?>\n\t<a href=\"<?php echo admin_url( 'edit-comments.php' ); ?>\" class=\"button-cancel\"><?php esc_html_e( 'Cancel' ); ?></a>\n\t</p>\n\n\t\t<?php wp_nonce_field( $nonce_action ); ?>\n\t<input type=\"hidden\" name=\"action\" value=\"<?php echo esc_attr( $formaction ); ?>\" />\n\t<input type=\"hidden\" name=\"c\" value=\"<?php echo esc_attr( $comment->comment_ID ); ?>\" />\n\t<input type=\"hidden\" name=\"noredir\" value=\"1\" />\n\t</form>\n\n\t</div>\n\t\t<?php\n\t\tbreak;\n\n\tcase 'deletecomment':\n\tcase 'trashcomment':\n\tcase 'untrashcomment':\n\tcase 'spamcomment':\n\tcase 'unspamcomment':\n\tcase 'approvecomment':\n\tcase 'unapprovecomment':\n\t\t$comment_id = absint( $_REQUEST['c'] );\n\n\t\tif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ), true ) ) {\n\t\t\tcheck_admin_referer( 'approve-comment_' . $comment_id );\n\t\t} else {\n\t\t\tcheck_admin_referer( 'delete-comment_' . $comment_id );\n\t\t}\n\n\t\t$noredir = isset( $_REQUEST['noredir'] );\n\n\t\t$comment = get_comment( $comment_id );\n\t\tif ( ! $comment ) {\n\t\t\tcomment_footer_die( __( 'Invalid comment ID.' ) . sprintf( ' <a href=\"%s\">' . __( 'Go back' ) . '</a>.', 'edit-comments.php' ) );\n\t\t}\n\t\tif ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {\n\t\t\tcomment_footer_die( __( 'Sorry, you are not allowed to edit comments on this post.' ) );\n\t\t}\n\n\t\tif ( wp_get_referer() && ! $noredir && false === strpos( wp_get_referer(), 'comment.php' ) ) {\n\t\t\t$redir = wp_get_referer();\n\t\t} elseif ( wp_get_original_referer() && ! $noredir ) {\n\t\t\t$redir = wp_get_original_referer();\n\t\t} elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ), true ) ) {\n\t\t\t$redir = admin_url( 'edit-comments.php?p=' . absint( $comment->comment_post_ID ) );\n\t\t} else {\n\t\t\t$redir = admin_url( 'edit-comments.php' );\n\t\t}\n\n\t\t$redir = remove_query_arg( array( 'spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids', 'approved', 'unapproved' ), $redir );\n\n\t\tswitch ( $action ) {\n\t\t\tcase 'deletecomment':\n\t\t\t\twp_delete_comment( $comment );\n\t\t\t\t$redir = add_query_arg( array( 'deleted' => '1' ), $redir );\n\t\t\t\tbreak;\n\t\t\tcase 'trashcomment':\n\t\t\t\twp_trash_comment( $comment );\n\t\t\t\t$redir = add_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'trashed' => '1',\n\t\t\t\t\t\t'ids'     => $comment_id,\n\t\t\t\t\t),\n\t\t\t\t\t$redir\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'untrashcomment':\n\t\t\t\twp_untrash_comment( $comment );\n\t\t\t\t$redir = add_query_arg( array( 'untrashed' => '1' ), $redir );\n\t\t\t\tbreak;\n\t\t\tcase 'spamcomment':\n\t\t\t\twp_spam_comment( $comment );\n\t\t\t\t$redir = add_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'spammed' => '1',\n\t\t\t\t\t\t'ids'     => $comment_id,\n\t\t\t\t\t),\n\t\t\t\t\t$redir\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'unspamcomment':\n\t\t\t\twp_unspam_comment( $comment );\n\t\t\t\t$redir = add_query_arg( array( 'unspammed' => '1' ), $redir );\n\t\t\t\tbreak;\n\t\t\tcase 'approvecomment':\n\t\t\t\twp_set_comment_status( $comment, 'approve' );\n\t\t\t\t$redir = add_query_arg( array( 'approved' => 1 ), $redir );\n\t\t\t\tbreak;\n\t\t\tcase 'unapprovecomment':\n\t\t\t\twp_set_comment_status( $comment, 'hold' );\n\t\t\t\t$redir = add_query_arg( array( 'unapproved' => 1 ), $redir );\n\t\t\t\tbreak;\n\t\t}\n\n\t\twp_redirect( $redir );\n\t\tdie;\n\n\tcase 'editedcomment':\n\t\t$comment_id      = absint( $_POST['comment_ID'] );\n\t\t$comment_post_id = absint( $_POST['comment_post_ID'] );\n\n\t\tcheck_admin_referer( 'update-comment_' . $comment_id );\n\n\t\t$updated = edit_comment();\n\t\tif ( is_wp_error( $updated ) ) {\n\t\t\twp_die( $updated->get_error_message() );\n\t\t}\n\n\t\t$location = ( empty( $_POST['referredby'] ) ? \"edit-comments.php?p=$comment_post_id\" : $_POST['referredby'] ) . '#comment-' . $comment_id;\n\n\t\t/**\n\t\t * Filters the URI the user is redirected to after editing a comment in the admin.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param string $location The URI the user will be redirected to.\n\t\t * @param int $comment_id The ID of the comment being edited.\n\t\t */\n\t\t$location = apply_filters( 'comment_edit_redirect', $location, $comment_id );\n\n\t\twp_redirect( $location );\n\t\texit;\n\n\tdefault:\n\t\twp_die( __( 'Unknown action.' ) );\n\n} // End switch.\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 372}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Credits administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\nrequire_once __DIR__ . '/includes/credits.php';\n\n$title = __( 'Credits' );\n\nlist( $display_version ) = explode( '-', get_bloginfo( 'version' ) );\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n$credits = wp_credits();\n?>\n<div class=\"wrap about__container\">\n\n\t<div class=\"about__header\">\n\t\t<div class=\"about__header-text\">\n\t\t\t<?php _e( 'Speed. Search. Security.' ); ?>\n\t\t</div>\n\n\t\t<div class=\"about__header-title\">\n\t\t\t<p>\n\t\t\t\t<?php _e( 'WordPress' ); ?>\n\t\t\t\t<span><?php echo $display_version; ?></span>\n\t\t\t</p>\n\t\t</div>\n\n\t\t<nav class=\"about__header-navigation nav-tab-wrapper wp-clearfix\" aria-label=\"<?php esc_attr_e( 'Secondary menu' ); ?>\">\n\t\t\t<a href=\"about.php\" class=\"nav-tab\"><?php _e( 'What&#8217;s New' ); ?></a>\n\t\t\t<a href=\"credits.php\" class=\"nav-tab nav-tab-active\" aria-current=\"page\"><?php _e( 'Credits' ); ?></a>\n\t\t\t<a href=\"freedoms.php\" class=\"nav-tab\"><?php _e( 'Freedoms' ); ?></a>\n\t\t\t<a href=\"privacy.php\" class=\"nav-tab\"><?php _e( 'Privacy' ); ?></a>\n\t\t</nav>\n\t</div>\n\n\t<div class=\"about__section is-feature\">\n\t\t<div class=\"column\">\n\t\t\t<h1><?php _e( 'Credits' ); ?></h1>\n\n\t\t\t<?php if ( ! $credits ) : ?>\n\n\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: https://wordpress.org/about/, 2: https://make.wordpress.org/ */\n\t\t\t\t\t__( 'WordPress is created by a <a href=\"%1$s\">worldwide team</a> of passionate individuals. <a href=\"%2$s\">Get involved in WordPress</a>.' ),\n\t\t\t\t\t__( 'https://wordpress.org/about/' ),\n\t\t\t\t\t__( 'https://make.wordpress.org/' )\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</p>\n\n\t\t\t<?php else : ?>\n\n\t\t\t<p>\n\t\t\t\t<?php _e( 'WordPress is created by a worldwide team of passionate individuals.' ); ?>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: https://make.wordpress.org/ */\n\t\t\t\t\t__( 'Want to see your name in lights on this page? <a href=\"%s\">Get involved in WordPress</a>.' ),\n\t\t\t\t\t__( 'https://make.wordpress.org/' )\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</p>\n\n\t\t\t<?php endif; ?>\n\t\t</div>\n\t</div>\n\n<?php\nif ( ! $credits ) {\n\techo '</div>';\n\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\texit;\n}\n?>\n\n\t<hr />\n\n\t<div class=\"about__section\">\n\t\t<div class=\"column has-subtle-background-color\">\n\t\t\t<?php wp_credits_section_title( $credits['groups']['core-developers'] ); ?>\n\t\t\t<?php wp_credits_section_list( $credits, 'core-developers' ); ?>\n\t\t\t<?php wp_credits_section_list( $credits, 'contributing-developers' ); ?>\n\t\t</div>\n\t</div>\n\n\t<hr />\n\n\t<div class=\"about__section\">\n\t\t<div class=\"column\">\n\t\t\t<?php wp_credits_section_title( $credits['groups']['props'] ); ?>\n\t\t\t<?php wp_credits_section_list( $credits, 'props' ); ?>\n\t\t</div>\n\t</div>\n\n\t<hr />\n\n\t<?php if ( isset( $credits['groups']['translators'] ) || isset( $credits['groups']['validators'] ) ) : ?>\n\t<div class=\"about__section\">\n\t\t<div class=\"column\">\n\t\t\t<?php wp_credits_section_title( $credits['groups']['validators'] ); ?>\n\t\t\t<?php wp_credits_section_list( $credits, 'validators' ); ?>\n\t\t\t<?php wp_credits_section_list( $credits, 'translators' ); ?>\n\t\t</div>\n\t</div>\n\n\t<hr />\n\t<?php endif; ?>\n\n\t<div class=\"about__section\">\n\t\t<div class=\"column\">\n\t\t\t<?php wp_credits_section_title( $credits['groups']['libraries'] ); ?>\n\t\t\t<?php wp_credits_section_list( $credits, 'libraries' ); ?>\n\t\t</div>\n\t</div>\n</div>\n<?php\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\nreturn;\n\n// These are strings returned by the API that we want to be translatable.\n__( 'Project Leaders' );\n/* translators: %s: The current WordPress version number. */\n__( 'Core Contributors to WordPress %s' );\n__( 'Noteworthy Contributors' );\n__( 'Cofounder, Project Lead' );\n__( 'Lead Developer' );\n__( 'Release Lead' );\n__( 'Release Design Lead' );\n__( 'Release Deputy' );\n__( 'Core Developer' );\n__( 'External Libraries' );\n", "num_lines": 145}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Custom background script.\n *\n * This file is deprecated, use 'wp-admin/includes/class-custom-background.php' instead.\n *\n * @deprecated 5.3.0\n * @package WordPress\n * @subpackage Administration\n */\n\n_deprecated_file( basename( __FILE__ ), '5.3.0', 'wp-admin/includes/class-custom-background.php' );\n\n/** Custom_Background class */\nrequire_once ABSPATH . 'wp-admin/includes/class-custom-background.php';\n", "num_lines": 16}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Custom header image script.\n *\n * This file is deprecated, use 'wp-admin/includes/class-custom-image-header.php' instead.\n *\n * @deprecated 5.3.0\n * @package WordPress\n * @subpackage Administration\n */\n\n_deprecated_file( basename( __FILE__ ), '5.3.0', 'wp-admin/includes/class-custom-image-header.php' );\n\n/** Custom_Image_Header class */\nrequire_once ABSPATH . 'wp-admin/includes/class-custom-image-header.php';\n", "num_lines": 16}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Theme Customize Screen.\n *\n * @package WordPress\n * @subpackage Customize\n * @since 3.4.0\n */\n\ndefine( 'IFRAME_REQUEST', true );\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'customize' ) ) {\n\twp_die(\n\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t'<p>' . __( 'Sorry, you are not allowed to customize this site.' ) . '</p>',\n\t\t403\n\t);\n}\n\n/**\n * @global WP_Scripts           $wp_scripts\n * @global WP_Customize_Manager $wp_customize\n */\nglobal $wp_scripts, $wp_customize;\n\nif ( $wp_customize->changeset_post_id() ) {\n\t$changeset_post = get_post( $wp_customize->changeset_post_id() );\n\n\tif ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $changeset_post->ID ) ) {\n\t\twp_die(\n\t\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t\t'<p>' . __( 'Sorry, you are not allowed to edit this changeset.' ) . '</p>',\n\t\t\t403\n\t\t);\n\t}\n\n\t$missed_schedule = (\n\t\t'future' === $changeset_post->post_status &&\n\t\tget_post_time( 'G', true, $changeset_post ) < time()\n\t);\n\tif ( $missed_schedule ) {\n\t\t/*\n\t\t * Note that an Ajax request spawns here instead of just calling `wp_publish_post( $changeset_post->ID )`.\n\t\t *\n\t\t * Because WP_Customize_Manager is not instantiated for customize.php with the `settings_previewed=false`\n\t\t * argument, settings cannot be reliably saved. Some logic short-circuits if the current value is the\n\t\t * same as the value being saved. This is particularly true for options via `update_option()`.\n\t\t *\n\t\t * By opening an Ajax request, this is avoided and the changeset is published. See #39221.\n\t\t */\n\t\t$nonces       = $wp_customize->get_nonces();\n\t\t$request_args = array(\n\t\t\t'nonce'                      => $nonces['save'],\n\t\t\t'customize_changeset_uuid'   => $wp_customize->changeset_uuid(),\n\t\t\t'wp_customize'               => 'on',\n\t\t\t'customize_changeset_status' => 'publish',\n\t\t);\n\t\tob_start();\n\t\t?>\n\t\t<?php wp_print_scripts( array( 'wp-util' ) ); ?>\n\t\t<script>\n\t\t\twp.ajax.post( 'customize_save', <?php echo wp_json_encode( $request_args ); ?> );\n\t\t</script>\n\t\t<?php\n\t\t$script = ob_get_clean();\n\n\t\twp_die(\n\t\t\t'<h1>' . __( 'Your scheduled changes just published' ) . '</h1>' .\n\t\t\t'<p><a href=\"' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '\">' . __( 'Customize New Changes' ) . '</a></p>' . $script,\n\t\t\t200\n\t\t);\n\t}\n\n\tif ( in_array( get_post_status( $changeset_post->ID ), array( 'publish', 'trash' ), true ) ) {\n\t\twp_die(\n\t\t\t'<h1>' . __( 'Something went wrong.' ) . '</h1>' .\n\t\t\t'<p>' . __( 'This changeset cannot be further modified.' ) . '</p>' .\n\t\t\t'<p><a href=\"' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '\">' . __( 'Customize New Changes' ) . '</a></p>',\n\t\t\t403\n\t\t);\n\t}\n}\n\n\nwp_reset_vars( array( 'url', 'return', 'autofocus' ) );\nif ( ! empty( $url ) ) {\n\t$wp_customize->set_preview_url( wp_unslash( $url ) );\n}\nif ( ! empty( $return ) ) {\n\t$wp_customize->set_return_url( wp_unslash( $return ) );\n}\nif ( ! empty( $autofocus ) && is_array( $autofocus ) ) {\n\t$wp_customize->set_autofocus( wp_unslash( $autofocus ) );\n}\n\n$registered             = $wp_scripts->registered;\n$wp_scripts             = new WP_Scripts;\n$wp_scripts->registered = $registered;\n\nadd_action( 'customize_controls_print_scripts', 'print_head_scripts', 20 );\nadd_action( 'customize_controls_print_footer_scripts', '_wp_footer_scripts' );\nadd_action( 'customize_controls_print_styles', 'print_admin_styles', 20 );\n\n/**\n * Fires when Customizer controls are initialized, before scripts are enqueued.\n *\n * @since 3.4.0\n */\ndo_action( 'customize_controls_init' );\n\nwp_enqueue_script( 'heartbeat' );\nwp_enqueue_script( 'customize-controls' );\nwp_enqueue_style( 'customize-controls' );\n\n/**\n * Enqueue Customizer control scripts.\n *\n * @since 3.4.0\n */\ndo_action( 'customize_controls_enqueue_scripts' );\n\n// Let's roll.\nheader( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );\n\nwp_user_settings();\n_wp_admin_html_begin();\n\n$body_class = 'wp-core-ui wp-customizer js';\n\nif ( wp_is_mobile() ) :\n\t$body_class .= ' mobile';\n\tadd_filter( 'admin_viewport_meta', '_customizer_mobile_viewport_meta' );\nendif;\n\nif ( $wp_customize->is_ios() ) {\n\t$body_class .= ' ios';\n}\n\nif ( is_rtl() ) {\n\t$body_class .= ' rtl';\n}\n$body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );\n\n$admin_title = sprintf( $wp_customize->get_document_title_template(), __( 'Loading&hellip;' ) );\n\n?>\n<title><?php echo esc_html( $admin_title ); ?></title>\n\n<script type=\"text/javascript\">\nvar ajaxurl = <?php echo wp_json_encode( admin_url( 'admin-ajax.php', 'relative' ) ); ?>,\n\tpagenow = 'customize';\n</script>\n\n<?php\n/**\n * Fires when Customizer control styles are printed.\n *\n * @since 3.4.0\n */\ndo_action( 'customize_controls_print_styles' );\n\n/**\n * Fires when Customizer control scripts are printed.\n *\n * @since 3.4.0\n */\ndo_action( 'customize_controls_print_scripts' );\n\n/**\n * Fires in head section of Customizer controls.\n *\n * @since 5.5.0\n */\ndo_action( 'customize_controls_head' );\n?>\n</head>\n<body class=\"<?php echo esc_attr( $body_class ); ?>\">\n<div class=\"wp-full-overlay expanded\">\n\t<form id=\"customize-controls\" class=\"wrap wp-full-overlay-sidebar\">\n\t\t<div id=\"customize-header-actions\" class=\"wp-full-overlay-header\">\n\t\t\t<?php\n\t\t\t$compatible_wp  = is_wp_version_compatible( $wp_customize->theme()->get( 'RequiresWP' ) );\n\t\t\t$compatible_php = is_php_version_compatible( $wp_customize->theme()->get( 'RequiresPHP' ) );\n\t\t\t?>\n\t\t\t<?php if ( $compatible_wp && $compatible_php ) : ?>\n\t\t\t\t<?php $save_text = $wp_customize->is_theme_active() ? __( 'Publish' ) : __( 'Activate &amp; Publish' ); ?>\n\t\t\t\t<div id=\"customize-save-button-wrapper\" class=\"customize-save-button-wrapper\" >\n\t\t\t\t\t<?php submit_button( $save_text, 'primary save', 'save', false ); ?>\n\t\t\t\t\t<button id=\"publish-settings\" class=\"publish-settings button-primary button dashicons dashicons-admin-generic\" aria-label=\"<?php esc_attr_e( 'Publish Settings' ); ?>\" aria-expanded=\"false\" disabled></button>\n\t\t\t\t</div>\n\t\t\t<?php else : ?>\n\t\t\t\t<?php $save_text = _x( 'Cannot Activate', 'theme' ); ?>\n\t\t\t\t<div id=\"customize-save-button-wrapper\" class=\"customize-save-button-wrapper disabled\" >\n\t\t\t\t\t<button class=\"button button-primary disabled\" aria-label=\"<?php esc_attr_e( 'Publish Settings' ); ?>\" aria-expanded=\"false\" disabled><?php echo $save_text; ?></button>\n\t\t\t\t</div>\n\t\t\t<?php endif; ?>\n\t\t\t<span class=\"spinner\"></span>\n\t\t\t<button type=\"button\" class=\"customize-controls-preview-toggle\">\n\t\t\t\t<span class=\"controls\"><?php _e( 'Customize' ); ?></span>\n\t\t\t\t<span class=\"preview\"><?php _e( 'Preview' ); ?></span>\n\t\t\t</button>\n\t\t\t<a class=\"customize-controls-close\" href=\"<?php echo esc_url( $wp_customize->get_return_url() ); ?>\">\n\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Close the Customizer and go back to the previous page' ); ?></span>\n\t\t\t</a>\n\t\t</div>\n\n\t\t<div id=\"customize-sidebar-outer-content\">\n\t\t\t<div id=\"customize-outer-theme-controls\">\n\t\t\t\t<ul class=\"customize-outer-pane-parent\"><?php // Outer panel and sections are not implemented, but its here as a placeholder to avoid any side-effect in api.Section. ?></ul>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div id=\"widgets-right\" class=\"wp-clearfix\"><!-- For Widget Customizer, many widgets try to look for instances under div#widgets-right, so we have to add that ID to a container div in the Customizer for compat -->\n\t\t\t<div id=\"customize-notifications-area\" class=\"customize-control-notifications-container\">\n\t\t\t\t<ul></ul>\n\t\t\t</div>\n\t\t\t<div class=\"wp-full-overlay-sidebar-content\" tabindex=\"-1\">\n\t\t\t\t<div id=\"customize-info\" class=\"accordion-section customize-info\">\n\t\t\t\t\t<div class=\"accordion-section-title\">\n\t\t\t\t\t\t<span class=\"preview-notice\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/* translators: %s: The site/panel title in the Customizer. */\n\t\t\t\t\t\t\tprintf( __( 'You are customizing %s' ), '<strong class=\"panel-title site-title\">' . get_bloginfo( 'name', 'display' ) . '</strong>' );\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<button type=\"button\" class=\"customize-help-toggle dashicons dashicons-editor-help\" aria-expanded=\"false\"><span class=\"screen-reader-text\"><?php _e( 'Help' ); ?></span></button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"customize-panel-description\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t_e( 'The Customizer allows you to preview changes to your site before publishing them. You can navigate to different pages on your site within the preview. Edit shortcuts are shown for some editable elements.' );\n\t\t\t\t\t?>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div id=\"customize-theme-controls\">\n\t\t\t\t\t<ul class=\"customize-pane-parent\"><?php // Panels and sections are managed here via JavaScript ?></ul>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div id=\"customize-footer-actions\" class=\"wp-full-overlay-footer\">\n\t\t\t<button type=\"button\" class=\"collapse-sidebar button\" aria-expanded=\"true\" aria-label=\"<?php echo esc_attr( _x( 'Hide Controls', 'label for hide controls button without length constraints' ) ); ?>\">\n\t\t\t\t<span class=\"collapse-sidebar-arrow\"></span>\n\t\t\t\t<span class=\"collapse-sidebar-label\"><?php _ex( 'Hide Controls', 'short (~12 characters) label for hide controls button' ); ?></span>\n\t\t\t</button>\n\t\t\t<?php $previewable_devices = $wp_customize->get_previewable_devices(); ?>\n\t\t\t<?php if ( ! empty( $previewable_devices ) ) : ?>\n\t\t\t<div class=\"devices-wrapper\">\n\t\t\t\t<div class=\"devices\">\n\t\t\t\t\t<?php foreach ( (array) $previewable_devices as $device => $settings ) : ?>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( empty( $settings['label'] ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$active = ! empty( $settings['default'] );\n\t\t\t\t\t\t$class  = 'preview-' . $device;\n\t\t\t\t\t\tif ( $active ) {\n\t\t\t\t\t\t\t$class .= ' active';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<button type=\"button\" class=\"<?php echo esc_attr( $class ); ?>\" aria-pressed=\"<?php echo esc_attr( $active ); ?>\" data-device=\"<?php echo esc_attr( $device ); ?>\">\n\t\t\t\t\t\t\t<span class=\"screen-reader-text\"><?php echo esc_html( $settings['label'] ); ?></span>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<?php endif; ?>\n\t\t</div>\n\t</form>\n\t<div id=\"customize-preview\" class=\"wp-full-overlay-main\"></div>\n\t<?php\n\n\t/**\n\t * Prints templates, control scripts, and settings in the footer.\n\t *\n\t * @since 3.4.0\n\t */\n\tdo_action( 'customize_controls_print_footer_scripts' );\n\t?>\n</div>\n</body>\n</html>\n", "num_lines": 286}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit Comments Administration Screen.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\nif ( ! current_user_can( 'edit_posts' ) ) {\n\twp_die(\n\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t'<p>' . __( 'Sorry, you are not allowed to edit comments.' ) . '</p>',\n\t\t403\n\t);\n}\n\n$wp_list_table = _get_list_table( 'WP_Comments_List_Table' );\n$pagenum       = $wp_list_table->get_pagenum();\n\n$doaction = $wp_list_table->current_action();\n\nif ( $doaction ) {\n\tcheck_admin_referer( 'bulk-comments' );\n\n\tif ( 'delete_all' === $doaction && ! empty( $_REQUEST['pagegen_timestamp'] ) ) {\n\t\t$comment_status = wp_unslash( $_REQUEST['comment_status'] );\n\t\t$delete_time    = wp_unslash( $_REQUEST['pagegen_timestamp'] );\n\t\t$comment_ids    = $wpdb->get_col( $wpdb->prepare( \"SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = %s AND %s > comment_date_gmt\", $comment_status, $delete_time ) );\n\t\t$doaction       = 'delete';\n\t} elseif ( isset( $_REQUEST['delete_comments'] ) ) {\n\t\t$comment_ids = $_REQUEST['delete_comments'];\n\t\t$doaction    = ( '-1' !== $_REQUEST['action'] ) ? $_REQUEST['action'] : $_REQUEST['action2'];\n\t} elseif ( isset( $_REQUEST['ids'] ) ) {\n\t\t$comment_ids = array_map( 'absint', explode( ',', $_REQUEST['ids'] ) );\n\t} elseif ( wp_get_referer() ) {\n\t\twp_safe_redirect( wp_get_referer() );\n\t\texit;\n\t}\n\n\t$approved   = 0;\n\t$unapproved = 0;\n\t$spammed    = 0;\n\t$unspammed  = 0;\n\t$trashed    = 0;\n\t$untrashed  = 0;\n\t$deleted    = 0;\n\n\t$redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() );\n\t$redirect_to = add_query_arg( 'paged', $pagenum, $redirect_to );\n\n\twp_defer_comment_counting( true );\n\n\tforeach ( $comment_ids as $comment_id ) { // Check the permissions on each.\n\t\tif ( ! current_user_can( 'edit_comment', $comment_id ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tswitch ( $doaction ) {\n\t\t\tcase 'approve':\n\t\t\t\twp_set_comment_status( $comment_id, 'approve' );\n\t\t\t\t$approved++;\n\t\t\t\tbreak;\n\t\t\tcase 'unapprove':\n\t\t\t\twp_set_comment_status( $comment_id, 'hold' );\n\t\t\t\t$unapproved++;\n\t\t\t\tbreak;\n\t\t\tcase 'spam':\n\t\t\t\twp_spam_comment( $comment_id );\n\t\t\t\t$spammed++;\n\t\t\t\tbreak;\n\t\t\tcase 'unspam':\n\t\t\t\twp_unspam_comment( $comment_id );\n\t\t\t\t$unspammed++;\n\t\t\t\tbreak;\n\t\t\tcase 'trash':\n\t\t\t\twp_trash_comment( $comment_id );\n\t\t\t\t$trashed++;\n\t\t\t\tbreak;\n\t\t\tcase 'untrash':\n\t\t\t\twp_untrash_comment( $comment_id );\n\t\t\t\t$untrashed++;\n\t\t\t\tbreak;\n\t\t\tcase 'delete':\n\t\t\t\twp_delete_comment( $comment_id );\n\t\t\t\t$deleted++;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ( ! in_array( $doaction, array( 'approve', 'unapprove', 'spam', 'unspam', 'trash', 'delete' ), true ) ) {\n\t\t$screen = get_current_screen()->id;\n\n\t\t/** This action is documented in wp-admin/edit.php */\n\t\t$redirect_to = apply_filters( \"handle_bulk_actions-{$screen}\", $redirect_to, $doaction, $comment_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t}\n\n\twp_defer_comment_counting( false );\n\n\tif ( $approved ) {\n\t\t$redirect_to = add_query_arg( 'approved', $approved, $redirect_to );\n\t}\n\tif ( $unapproved ) {\n\t\t$redirect_to = add_query_arg( 'unapproved', $unapproved, $redirect_to );\n\t}\n\tif ( $spammed ) {\n\t\t$redirect_to = add_query_arg( 'spammed', $spammed, $redirect_to );\n\t}\n\tif ( $unspammed ) {\n\t\t$redirect_to = add_query_arg( 'unspammed', $unspammed, $redirect_to );\n\t}\n\tif ( $trashed ) {\n\t\t$redirect_to = add_query_arg( 'trashed', $trashed, $redirect_to );\n\t}\n\tif ( $untrashed ) {\n\t\t$redirect_to = add_query_arg( 'untrashed', $untrashed, $redirect_to );\n\t}\n\tif ( $deleted ) {\n\t\t$redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to );\n\t}\n\tif ( $trashed || $spammed ) {\n\t\t$redirect_to = add_query_arg( 'ids', join( ',', $comment_ids ), $redirect_to );\n\t}\n\n\twp_safe_redirect( $redirect_to );\n\texit;\n} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {\n\twp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );\n\texit;\n}\n\n$wp_list_table->prepare_items();\n\nwp_enqueue_script( 'admin-comments' );\nenqueue_comment_hotkeys_js();\n\nif ( $post_id ) {\n\t$comments_count      = wp_count_comments( $post_id );\n\t$draft_or_post_title = wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '&hellip;' );\n\tif ( $comments_count->moderated > 0 ) {\n\t\t$title = sprintf(\n\t\t\t/* translators: 1: Comments count, 2: Post title. */\n\t\t\t__( 'Comments (%1$s) on &#8220;%2$s&#8221;' ),\n\t\t\tnumber_format_i18n( $comments_count->moderated ),\n\t\t\t$draft_or_post_title\n\t\t);\n\t} else {\n\t\t$title = sprintf(\n\t\t\t/* translators: %s: Post title. */\n\t\t\t__( 'Comments on &#8220;%s&#8221;' ),\n\t\t\t$draft_or_post_title\n\t\t);\n\t}\n} else {\n\t$comments_count = wp_count_comments();\n\tif ( $comments_count->moderated > 0 ) {\n\t\t$title = sprintf(\n\t\t\t/* translators: %s: Comments count. */\n\t\t\t__( 'Comments (%s)' ),\n\t\t\tnumber_format_i18n( $comments_count->moderated )\n\t\t);\n\t} else {\n\t\t$title = __( 'Comments' );\n\t}\n}\n\nadd_screen_option( 'per_page' );\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t\t'<p>' . __( 'You can manage comments made on your site similar to the way you manage posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the bulk actions.' ) . '</p>',\n\t)\n);\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'moderating-comments',\n\t\t'title'   => __( 'Moderating Comments' ),\n\t\t'content' =>\n\t\t\t\t\t'<p>' . __( 'A red bar on the left means the comment is waiting for you to moderate it.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'In the <strong>Author</strong> column, in addition to the author&#8217;s name, email address, and blog URL, the commenter&#8217;s IP address is shown. Clicking on this link will show you all the comments made from this IP address.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'In the <strong>Comment</strong> column, hovering over any comment gives you options to approve, reply (and approve), quick edit, edit, spam mark, or trash that comment.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'In the <strong>In response to</strong> column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The View Post link leads to that post on your live site. The small bubble with the number in it shows the number of approved comments that post has received. If there are pending comments, a red notification circle with the number of pending comments is displayed. Clicking the notification circle will filter the comments screen to show only pending comments on that post.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'In the <strong>Submitted on</strong> column, the date and time the comment was left on your site appears. Clicking on the date/time link will take you to that comment on your live site.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link to the side to learn more.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/comments-screen/\">Documentation on Comments</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/comment-spam/\">Documentation on Comment Spam</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/keyboard-shortcuts/\">Documentation on Keyboard Shortcuts</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nget_current_screen()->set_screen_reader_content(\n\tarray(\n\t\t'heading_views'      => __( 'Filter comments list' ),\n\t\t'heading_pagination' => __( 'Comments list navigation' ),\n\t\t'heading_list'       => __( 'Comments list' ),\n\t)\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n\n<div class=\"wrap\">\n<h1 class=\"wp-heading-inline\">\n<?php\nif ( $post_id ) {\n\tprintf(\n\t\t/* translators: %s: Link to post. */\n\t\t__( 'Comments on &#8220;%s&#8221;' ),\n\t\tsprintf(\n\t\t\t'<a href=\"%1$s\">%2$s</a>',\n\t\t\tget_edit_post_link( $post_id ),\n\t\t\twp_html_excerpt( _draft_or_post_title( $post_id ), 50, '&hellip;' )\n\t\t)\n\t);\n} else {\n\t_e( 'Comments' );\n}\n?>\n</h1>\n\n<?php\nif ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {\n\techo '<span class=\"subtitle\">';\n\tprintf(\n\t\t/* translators: %s: Search query. */\n\t\t__( 'Search results for &#8220;%s&#8221;' ),\n\t\twp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '&hellip;' )\n\t);\n\techo '</span>';\n}\n?>\n\n<hr class=\"wp-header-end\">\n\n<?php\nif ( isset( $_REQUEST['error'] ) ) {\n\t$error     = (int) $_REQUEST['error'];\n\t$error_msg = '';\n\tswitch ( $error ) {\n\t\tcase 1:\n\t\t\t$error_msg = __( 'Invalid comment ID.' );\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$error_msg = __( 'Sorry, you are not allowed to edit comments on this post.' );\n\t\t\tbreak;\n\t}\n\tif ( $error_msg ) {\n\t\techo '<div id=\"moderated\" class=\"error\"><p>' . $error_msg . '</p></div>';\n\t}\n}\n\nif ( isset( $_REQUEST['approved'] ) || isset( $_REQUEST['deleted'] ) || isset( $_REQUEST['trashed'] ) || isset( $_REQUEST['untrashed'] ) || isset( $_REQUEST['spammed'] ) || isset( $_REQUEST['unspammed'] ) || isset( $_REQUEST['same'] ) ) {\n\t$approved  = isset( $_REQUEST['approved'] ) ? (int) $_REQUEST['approved'] : 0;\n\t$deleted   = isset( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0;\n\t$trashed   = isset( $_REQUEST['trashed'] ) ? (int) $_REQUEST['trashed'] : 0;\n\t$untrashed = isset( $_REQUEST['untrashed'] ) ? (int) $_REQUEST['untrashed'] : 0;\n\t$spammed   = isset( $_REQUEST['spammed'] ) ? (int) $_REQUEST['spammed'] : 0;\n\t$unspammed = isset( $_REQUEST['unspammed'] ) ? (int) $_REQUEST['unspammed'] : 0;\n\t$same      = isset( $_REQUEST['same'] ) ? (int) $_REQUEST['same'] : 0;\n\n\tif ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 || $same > 0 ) {\n\t\tif ( $approved > 0 ) {\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t$messages[] = sprintf( _n( '%s comment approved.', '%s comments approved.', $approved ), $approved );\n\t\t}\n\n\t\tif ( $spammed > 0 ) {\n\t\t\t$ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0;\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t$messages[] = sprintf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed ) . ' <a href=\"' . esc_url( wp_nonce_url( \"edit-comments.php?doaction=undo&action=unspam&ids=$ids\", 'bulk-comments' ) ) . '\">' . __( 'Undo' ) . '</a><br />';\n\t\t}\n\n\t\tif ( $unspammed > 0 ) {\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t$messages[] = sprintf( _n( '%s comment restored from the spam.', '%s comments restored from the spam.', $unspammed ), $unspammed );\n\t\t}\n\n\t\tif ( $trashed > 0 ) {\n\t\t\t$ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0;\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t$messages[] = sprintf( _n( '%s comment moved to the Trash.', '%s comments moved to the Trash.', $trashed ), $trashed ) . ' <a href=\"' . esc_url( wp_nonce_url( \"edit-comments.php?doaction=undo&action=untrash&ids=$ids\", 'bulk-comments' ) ) . '\">' . __( 'Undo' ) . '</a><br />';\n\t\t}\n\n\t\tif ( $untrashed > 0 ) {\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t$messages[] = sprintf( _n( '%s comment restored from the Trash.', '%s comments restored from the Trash.', $untrashed ), $untrashed );\n\t\t}\n\n\t\tif ( $deleted > 0 ) {\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t$messages[] = sprintf( _n( '%s comment permanently deleted.', '%s comments permanently deleted.', $deleted ), $deleted );\n\t\t}\n\n\t\tif ( $same > 0 ) {\n\t\t\t$comment = get_comment( $same );\n\t\t\tif ( $comment ) {\n\t\t\t\tswitch ( $comment->comment_approved ) {\n\t\t\t\t\tcase '1':\n\t\t\t\t\t\t$messages[] = __( 'This comment is already approved.' ) . ' <a href=\"' . esc_url( admin_url( \"comment.php?action=editcomment&c=$same\" ) ) . '\">' . __( 'Edit comment' ) . '</a>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'trash':\n\t\t\t\t\t\t$messages[] = __( 'This comment is already in the Trash.' ) . ' <a href=\"' . esc_url( admin_url( 'edit-comments.php?comment_status=trash' ) ) . '\"> ' . __( 'View Trash' ) . '</a>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'spam':\n\t\t\t\t\t\t$messages[] = __( 'This comment is already marked as spam.' ) . ' <a href=\"' . esc_url( admin_url( \"comment.php?action=editcomment&c=$same\" ) ) . '\">' . __( 'Edit comment' ) . '</a>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\techo '<div id=\"moderated\" class=\"updated notice is-dismissible\"><p>' . implode( \"<br/>\\n\", $messages ) . '</p></div>';\n\t}\n}\n?>\n\n<?php $wp_list_table->views(); ?>\n\n<form id=\"comments-form\" method=\"get\">\n\n<?php $wp_list_table->search_box( __( 'Search Comments' ), 'comment' ); ?>\n\n<?php if ( $post_id ) : ?>\n<input type=\"hidden\" name=\"p\" value=\"<?php echo esc_attr( intval( $post_id ) ); ?>\" />\n<?php endif; ?>\n<input type=\"hidden\" name=\"comment_status\" value=\"<?php echo esc_attr( $comment_status ); ?>\" />\n<input type=\"hidden\" name=\"pagegen_timestamp\" value=\"<?php echo esc_attr( current_time( 'mysql', 1 ) ); ?>\" />\n\n<input type=\"hidden\" name=\"_total\" value=\"<?php echo esc_attr( $wp_list_table->get_pagination_arg( 'total_items' ) ); ?>\" />\n<input type=\"hidden\" name=\"_per_page\" value=\"<?php echo esc_attr( $wp_list_table->get_pagination_arg( 'per_page' ) ); ?>\" />\n<input type=\"hidden\" name=\"_page\" value=\"<?php echo esc_attr( $wp_list_table->get_pagination_arg( 'page' ) ); ?>\" />\n\n<?php if ( isset( $_REQUEST['paged'] ) ) { ?>\n\t<input type=\"hidden\" name=\"paged\" value=\"<?php echo esc_attr( absint( $_REQUEST['paged'] ) ); ?>\" />\n<?php } ?>\n\n<?php $wp_list_table->display(); ?>\n</form>\n</div>\n\n<div id=\"ajax-response\"></div>\n\n<?php\nwp_comment_reply( '-1', true, 'detail' );\nwp_comment_trashnotice();\nrequire_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 355}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Post advanced form for inclusion in the administration panels.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n// Don't load directly.\nif ( ! defined( 'ABSPATH' ) ) {\n\tdie( '-1' );\n}\n\n/**\n * @global string       $post_type\n * @global WP_Post_Type $post_type_object\n * @global WP_Post      $post             Global post object.\n */\nglobal $post_type, $post_type_object, $post;\n\n// Flag that we're not loading the block editor.\n$current_screen = get_current_screen();\n$current_screen->is_block_editor( false );\n\nif ( is_multisite() ) {\n\tadd_action( 'admin_footer', '_admin_notice_post_locked' );\n} else {\n\t$check_users = get_users(\n\t\tarray(\n\t\t\t'fields' => 'ID',\n\t\t\t'number' => 2,\n\t\t)\n\t);\n\n\tif ( count( $check_users ) > 1 ) {\n\t\tadd_action( 'admin_footer', '_admin_notice_post_locked' );\n\t}\n\n\tunset( $check_users );\n}\n\nwp_enqueue_script( 'post' );\n\n$_wp_editor_expand   = false;\n$_content_editor_dfw = false;\n\n/**\n * Filters whether to enable the 'expand' functionality in the post editor.\n *\n * @since 4.0.0\n * @since 4.1.0 Added the `$post_type` parameter.\n *\n * @param bool   $expand    Whether to enable the 'expand' functionality. Default true.\n * @param string $post_type Post type.\n */\nif ( post_type_supports( $post_type, 'editor' ) && ! wp_is_mobile() &&\n\t! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) ) &&\n\tapply_filters( 'wp_editor_expand', true, $post_type ) ) {\n\n\twp_enqueue_script( 'editor-expand' );\n\t$_content_editor_dfw = true;\n\t$_wp_editor_expand   = ( 'on' === get_user_setting( 'editor_expand', 'on' ) );\n}\n\nif ( wp_is_mobile() ) {\n\twp_enqueue_script( 'jquery-touch-punch' );\n}\n\n/**\n * Post ID global\n *\n * @name $post_ID\n * @var int\n */\n$post_ID = isset( $post_ID ) ? (int) $post_ID : 0;\n$user_ID = isset( $user_ID ) ? (int) $user_ID : 0;\n$action  = isset( $action ) ? $action : '';\n\nif ( (int) get_option( 'page_for_posts' ) === $post_ID && empty( $post->post_content ) ) {\n\tadd_action( 'edit_form_after_title', '_wp_posts_page_notice' );\n\tremove_post_type_support( $post_type, 'editor' );\n}\n\n$thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );\nif ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) {\n\tif ( wp_attachment_is( 'audio', $post ) ) {\n\t\t$thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );\n\t} elseif ( wp_attachment_is( 'video', $post ) ) {\n\t\t$thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );\n\t}\n}\n\nif ( $thumbnail_support ) {\n\tadd_thickbox();\n\twp_enqueue_media( array( 'post' => $post_ID ) );\n}\n\n// Add the local autosave notice HTML.\nadd_action( 'admin_footer', '_local_storage_notice' );\n\n/*\n * @todo Document the $messages array(s).\n */\n$permalink = get_permalink( $post_ID );\nif ( ! $permalink ) {\n\t$permalink = '';\n}\n\n$messages = array();\n\n$preview_post_link_html   = '';\n$scheduled_post_link_html = '';\n$view_post_link_html      = '';\n\n$preview_page_link_html   = '';\n$scheduled_page_link_html = '';\n$view_page_link_html      = '';\n\n$preview_url = get_preview_post_link( $post );\n\n$viewable = is_post_type_viewable( $post_type_object );\n\nif ( $viewable ) {\n\n\t// Preview post link.\n\t$preview_post_link_html = sprintf(\n\t\t' <a target=\"_blank\" href=\"%1$s\">%2$s</a>',\n\t\tesc_url( $preview_url ),\n\t\t__( 'Preview post' )\n\t);\n\n\t// Scheduled post preview link.\n\t$scheduled_post_link_html = sprintf(\n\t\t' <a target=\"_blank\" href=\"%1$s\">%2$s</a>',\n\t\tesc_url( $permalink ),\n\t\t__( 'Preview post' )\n\t);\n\n\t// View post link.\n\t$view_post_link_html = sprintf(\n\t\t' <a href=\"%1$s\">%2$s</a>',\n\t\tesc_url( $permalink ),\n\t\t__( 'View post' )\n\t);\n\n\t// Preview page link.\n\t$preview_page_link_html = sprintf(\n\t\t' <a target=\"_blank\" href=\"%1$s\">%2$s</a>',\n\t\tesc_url( $preview_url ),\n\t\t__( 'Preview page' )\n\t);\n\n\t// Scheduled page preview link.\n\t$scheduled_page_link_html = sprintf(\n\t\t' <a target=\"_blank\" href=\"%1$s\">%2$s</a>',\n\t\tesc_url( $permalink ),\n\t\t__( 'Preview page' )\n\t);\n\n\t// View page link.\n\t$view_page_link_html = sprintf(\n\t\t' <a href=\"%1$s\">%2$s</a>',\n\t\tesc_url( $permalink ),\n\t\t__( 'View page' )\n\t);\n\n}\n\n$scheduled_date = sprintf(\n\t/* translators: Publish box date string. 1: Date, 2: Time. */\n\t__( '%1$s at %2$s' ),\n\t/* translators: Publish box date format, see https://www.php.net/date */\n\tdate_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ),\n\t/* translators: Publish box time format, see https://www.php.net/date */\n\tdate_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) )\n);\n\n$messages['post']       = array(\n\t0  => '', // Unused. Messages start at index 1.\n\t1  => __( 'Post updated.' ) . $view_post_link_html,\n\t2  => __( 'Custom field updated.' ),\n\t3  => __( 'Custom field deleted.' ),\n\t4  => __( 'Post updated.' ),\n\t/* translators: %s: Date and time of the revision. */\n\t5  => isset( $_GET['revision'] ) ? sprintf( __( 'Post restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,\n\t6  => __( 'Post published.' ) . $view_post_link_html,\n\t7  => __( 'Post saved.' ),\n\t8  => __( 'Post submitted.' ) . $preview_post_link_html,\n\t/* translators: %s: Scheduled date for the post. */\n\t9  => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,\n\t10 => __( 'Post draft updated.' ) . $preview_post_link_html,\n);\n$messages['page']       = array(\n\t0  => '', // Unused. Messages start at index 1.\n\t1  => __( 'Page updated.' ) . $view_page_link_html,\n\t2  => __( 'Custom field updated.' ),\n\t3  => __( 'Custom field deleted.' ),\n\t4  => __( 'Page updated.' ),\n\t/* translators: %s: Date and time of the revision. */\n\t5  => isset( $_GET['revision'] ) ? sprintf( __( 'Page restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,\n\t6  => __( 'Page published.' ) . $view_page_link_html,\n\t7  => __( 'Page saved.' ),\n\t8  => __( 'Page submitted.' ) . $preview_page_link_html,\n\t/* translators: %s: Scheduled date for the page. */\n\t9  => sprintf( __( 'Page scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_page_link_html,\n\t10 => __( 'Page draft updated.' ) . $preview_page_link_html,\n);\n$messages['attachment'] = array_fill( 1, 10, __( 'Media file updated.' ) ); // Hack, for now.\n\n/**\n * Filters the post updated messages.\n *\n * @since 3.0.0\n *\n * @param array[] $messages Post updated messages. For defaults see `$messages` declarations above.\n */\n$messages = apply_filters( 'post_updated_messages', $messages );\n\n$message = false;\nif ( isset( $_GET['message'] ) ) {\n\t$_GET['message'] = absint( $_GET['message'] );\n\tif ( isset( $messages[ $post_type ][ $_GET['message'] ] ) ) {\n\t\t$message = $messages[ $post_type ][ $_GET['message'] ];\n\t} elseif ( ! isset( $messages[ $post_type ] ) && isset( $messages['post'][ $_GET['message'] ] ) ) {\n\t\t$message = $messages['post'][ $_GET['message'] ];\n\t}\n}\n\n$notice     = false;\n$form_extra = '';\nif ( 'auto-draft' === $post->post_status ) {\n\tif ( 'edit' === $action ) {\n\t\t$post->post_title = '';\n\t}\n\t$autosave    = false;\n\t$form_extra .= \"<input type='hidden' id='auto_draft' name='auto_draft' value='1' />\";\n} else {\n\t$autosave = wp_get_post_autosave( $post_ID );\n}\n\n$form_action  = 'editpost';\n$nonce_action = 'update-post_' . $post_ID;\n$form_extra  .= \"<input type='hidden' id='post_ID' name='post_ID' value='\" . esc_attr( $post_ID ) . \"' />\";\n\n// Detect if there exists an autosave newer than the post and if that autosave is different than the post.\nif ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {\n\tforeach ( _wp_post_revision_fields( $post ) as $autosave_field => $_autosave_field ) {\n\t\tif ( normalize_whitespace( $autosave->$autosave_field ) !== normalize_whitespace( $post->$autosave_field ) ) {\n\t\t\t$notice = sprintf(\n\t\t\t\t/* translators: %s: URL to view the autosave. */\n\t\t\t\t__( 'There is an autosave of this post that is more recent than the version below. <a href=\"%s\">View the autosave</a>' ),\n\t\t\t\tget_edit_post_link( $autosave->ID )\n\t\t\t);\n\t\t\tbreak;\n\t\t}\n\t}\n\t// If this autosave isn't different from the current post, begone.\n\tif ( ! $notice ) {\n\t\twp_delete_post_revision( $autosave->ID );\n\t}\n\tunset( $autosave_field, $_autosave_field );\n}\n\n$post_type_object = get_post_type_object( $post_type );\n\n// All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).\nrequire_once ABSPATH . 'wp-admin/includes/meta-boxes.php';\n\nregister_and_do_post_meta_boxes( $post );\n\nadd_screen_option(\n\t'layout_columns',\n\tarray(\n\t\t'max'     => 2,\n\t\t'default' => 2,\n\t)\n);\n\nif ( 'post' === $post_type ) {\n\t$customize_display = '<p>' . __( 'The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes using drag and drop. You can also minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.' ) . '</p>';\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'customize-display',\n\t\t\t'title'   => __( 'Customizing This Display' ),\n\t\t\t'content' => $customize_display,\n\t\t)\n\t);\n\n\t$title_and_editor  = '<p>' . __( '<strong>Title</strong> &mdash; Enter a title for your post. After you enter a title, you&#8217;ll see the permalink below, which you can edit.' ) . '</p>';\n\t$title_and_editor .= '<p>' . __( '<strong>Post editor</strong> &mdash; Enter the text for your post. There are two modes of editing: Visual and Text. Choose the mode by clicking on the appropriate tab.' ) . '</p>';\n\t$title_and_editor .= '<p>' . __( 'Visual mode gives you an editor that is similar to a word processor. Click the Toolbar Toggle button to get a second row of controls.' ) . '</p>';\n\t$title_and_editor .= '<p>' . __( 'The Text mode allows you to enter HTML along with your post text. Note that &lt;p&gt; and &lt;br&gt; tags are converted to line breaks when switching to the Text editor to make it less cluttered. When you type, a single line break can be used instead of typing &lt;br&gt;, and two line breaks instead of paragraph tags. The line breaks are converted back to tags automatically.' ) . '</p>';\n\t$title_and_editor .= '<p>' . __( 'You can insert media files by clicking the button above the post editor and following the directions. You can align or edit images using the inline formatting toolbar available in Visual mode.' ) . '</p>';\n\t$title_and_editor .= '<p>' . __( 'You can enable distraction-free writing mode using the icon to the right. This feature is not available for old browsers or devices with small screens, and requires that the full-height editor be enabled in Screen Options.' ) . '</p>';\n\t$title_and_editor .= '<p>' . sprintf(\n\t\t/* translators: %s: Alt + F10 */\n\t\t__( 'Keyboard users: When you&#8217;re working in the visual editor, you can use %s to access the toolbar.' ),\n\t\t'<kbd>Alt + F10</kbd>'\n\t) . '</p>';\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'title-post-editor',\n\t\t\t'title'   => __( 'Title and Post Editor' ),\n\t\t\t'content' => $title_and_editor,\n\t\t)\n\t);\n\n\tget_current_screen()->set_help_sidebar(\n\t\t'<p>' . sprintf(\n\t\t\t/* translators: %s: URL to Press This bookmarklet. */\n\t\t\t__( 'You can also create posts with the <a href=\"%s\">Press This bookmarklet</a>.' ),\n\t\t\t'tools.php'\n\t\t) . '</p>' .\n\t\t\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/wordpress-editor/\">Documentation on Writing and Editing Posts</a>' ) . '</p>' .\n\t\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n\t);\n} elseif ( 'page' === $post_type ) {\n\t$about_pages = '<p>' . __( 'Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the &#8220;Parent&#8221; of the other, creating a group of pages.' ) . '</p>' .\n\t\t'<p>' . __( 'Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the distraction-free writing space, available in both the Visual and Text modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box.' ) . '</p>';\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'about-pages',\n\t\t\t'title'   => __( 'About Pages' ),\n\t\t\t'content' => $about_pages,\n\t\t)\n\t);\n\n\tget_current_screen()->set_help_sidebar(\n\t\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/pages-add-new-screen/\">Documentation on Adding New Pages</a>' ) . '</p>' .\n\t\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/pages-screen/\">Documentation on Editing Pages</a>' ) . '</p>' .\n\t\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n\t);\n} elseif ( 'attachment' === $post_type ) {\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'overview',\n\t\t\t'title'   => __( 'Overview' ),\n\t\t\t'content' =>\n\t\t\t\t'<p>' . __( 'This screen allows you to edit fields for metadata in a file within the media library.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'For images only, you can click on Edit Image under the thumbnail to expand out an inline image editor with icons for cropping, rotating, or flipping the image as well as for undoing and redoing. The boxes on the right give you more options for scaling the image, for cropping it, and for cropping the thumbnail in a different way than you crop the original image. You can click on Help in those boxes to get more information.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'Note that you crop the image by clicking on it (the Crop icon is already selected) and dragging the cropping frame to select the desired part. Then click Save to retain the cropping.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'Remember to click Update Media to save metadata entered or changed.' ) . '</p>',\n\t\t)\n\t);\n\n\tget_current_screen()->set_help_sidebar(\n\t\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/edit-media/\">Documentation on Edit Media</a>' ) . '</p>' .\n\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n\t);\n}\n\nif ( 'post' === $post_type || 'page' === $post_type ) {\n\t$inserting_media  = '<p>' . __( 'You can upload and insert media (images, audio, documents, etc.) by clicking the Add Media button. You can select from the images and files already uploaded to the Media Library, or upload new media to add to your page or post. To create an image gallery, select the images to add and click the &#8220;Create a new gallery&#8221; button.' ) . '</p>';\n\t$inserting_media .= '<p>' . __( 'You can also embed media from many popular websites including Twitter, YouTube, Flickr and others by pasting the media URL on its own line into the content of your post/page. <a href=\"https://wordpress.org/support/article/embeds/\">Learn more about embeds</a>.' ) . '</p>';\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'inserting-media',\n\t\t\t'title'   => __( 'Inserting Media' ),\n\t\t\t'content' => $inserting_media,\n\t\t)\n\t);\n}\n\nif ( 'post' === $post_type ) {\n\t$publish_box  = '<p>' . __( 'Several boxes on this screen contain settings for how your content will be published, including:' ) . '</p>';\n\t$publish_box .= '<ul><li>' .\n\t\t__( '<strong>Publish</strong> &mdash; You can set the terms of publishing your post in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a post or making it stay at the top of your blog indefinitely (sticky). The Password protected option allows you to set an arbitrary password for each post. The Private option hides the post from everyone except editors and administrators. Publish (immediately) allows you to set a future or past date and time, so you can schedule a post to be published in the future or backdate a post.' ) .\n\t'</li>';\n\n\tif ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) {\n\t\t$publish_box .= '<li>' . __( '<strong>Format</strong> &mdash; Post Formats designate how your theme will display a specific post. For example, you could have a <em>standard</em> blog post with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Your theme could enable all or some of 10 possible formats. <a href=\"https://wordpress.org/support/article/post-formats/#supported-formats\">Learn more about each post format</a>.' ) . '</li>';\n\t}\n\n\tif ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) {\n\t\t$publish_box .= '<li>' . sprintf(\n\t\t\t/* translators: %s: Featured image. */\n\t\t\t__( '<strong>%s</strong> &mdash; This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the image as a post thumbnail on the home page, a custom header, etc.' ),\n\t\t\tesc_html( $post_type_object->labels->featured_image )\n\t\t) . '</li>';\n\t}\n\n\t$publish_box .= '</ul>';\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'publish-box',\n\t\t\t'title'   => __( 'Publish Settings' ),\n\t\t\t'content' => $publish_box,\n\t\t)\n\t);\n\n\t$discussion_settings  = '<p>' . __( '<strong>Send Trackbacks</strong> &mdash; Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they&#8217;ll be notified automatically using pingbacks, and this field is unnecessary.' ) . '</p>';\n\t$discussion_settings .= '<p>' . __( '<strong>Discussion</strong> &mdash; You can turn comments and pings on or off, and if there are comments on the post, you can see them here and moderate them.' ) . '</p>';\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'discussion-settings',\n\t\t\t'title'   => __( 'Discussion Settings' ),\n\t\t\t'content' => $discussion_settings,\n\t\t)\n\t);\n} elseif ( 'page' === $post_type ) {\n\t$page_attributes = '<p>' . __( '<strong>Parent</strong> &mdash; You can arrange your pages in hierarchies. For example, you could have an &#8220;About&#8221; page that has &#8220;Life Story&#8221; and &#8220;My Dog&#8221; pages under it. There are no limits to how many levels you can nest pages.' ) . '</p>' .\n\t\t'<p>' . __( '<strong>Template</strong> &mdash; Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you&#8217;ll see them in this dropdown menu.' ) . '</p>' .\n\t\t'<p>' . __( '<strong>Order</strong> &mdash; Pages are usually ordered alphabetically, but you can choose your own order by entering a number (1 for first, etc.) in this field.' ) . '</p>';\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'page-attributes',\n\t\t\t'title'   => __( 'Page Attributes' ),\n\t\t\t'content' => $page_attributes,\n\t\t)\n\t);\n}\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n\n<div class=\"wrap\">\n<h1 class=\"wp-heading-inline\">\n<?php\necho esc_html( $title );\n?>\n</h1>\n\n<?php\nif ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) ) {\n\techo ' <a href=\"' . esc_url( admin_url( $post_new_file ) ) . '\" class=\"page-title-action\">' . esc_html( $post_type_object->labels->add_new ) . '</a>';\n}\n?>\n\n<hr class=\"wp-header-end\">\n\n<?php if ( $notice ) : ?>\n<div id=\"notice\" class=\"notice notice-warning\"><p id=\"has-newer-autosave\"><?php echo $notice; ?></p></div>\n<?php endif; ?>\n<?php if ( $message ) : ?>\n<div id=\"message\" class=\"updated notice notice-success is-dismissible\"><p><?php echo $message; ?></p></div>\n<?php endif; ?>\n<div id=\"lost-connection-notice\" class=\"error hidden\">\n\t<p><span class=\"spinner\"></span> <?php _e( '<strong>Connection lost.</strong> Saving has been disabled until you&#8217;re reconnected.' ); ?>\n\t<span class=\"hide-if-no-sessionstorage\"><?php _e( 'We&#8217;re backing up this post in your browser, just in case.' ); ?></span>\n\t</p>\n</div>\n<form name=\"post\" action=\"post.php\" method=\"post\" id=\"post\"\n<?php\n/**\n * Fires inside the post editor form tag.\n *\n * @since 3.0.0\n *\n * @param WP_Post $post Post object.\n */\ndo_action( 'post_edit_form_tag', $post );\n\n$referer = wp_get_referer();\n?>\n>\n<?php wp_nonce_field( $nonce_action ); ?>\n<input type=\"hidden\" id=\"user-id\" name=\"user_ID\" value=\"<?php echo (int) $user_ID; ?>\" />\n<input type=\"hidden\" id=\"hiddenaction\" name=\"action\" value=\"<?php echo esc_attr( $form_action ); ?>\" />\n<input type=\"hidden\" id=\"originalaction\" name=\"originalaction\" value=\"<?php echo esc_attr( $form_action ); ?>\" />\n<input type=\"hidden\" id=\"post_author\" name=\"post_author\" value=\"<?php echo esc_attr( $post->post_author ); ?>\" />\n<input type=\"hidden\" id=\"post_type\" name=\"post_type\" value=\"<?php echo esc_attr( $post_type ); ?>\" />\n<input type=\"hidden\" id=\"original_post_status\" name=\"original_post_status\" value=\"<?php echo esc_attr( $post->post_status ); ?>\" />\n<input type=\"hidden\" id=\"referredby\" name=\"referredby\" value=\"<?php echo $referer ? esc_url( $referer ) : ''; ?>\" />\n<?php if ( ! empty( $active_post_lock ) ) { ?>\n<input type=\"hidden\" id=\"active_post_lock\" value=\"<?php echo esc_attr( implode( ':', $active_post_lock ) ); ?>\" />\n\t<?php\n}\nif ( 'draft' !== get_post_status( $post ) ) {\n\twp_original_referer_field( true, 'previous' );\n}\n\necho $form_extra;\n\nwp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );\nwp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );\n?>\n\n<?php\n/**\n * Fires at the beginning of the edit form.\n *\n * At this point, the required hidden fields and nonces have already been output.\n *\n * @since 3.7.0\n *\n * @param WP_Post $post Post object.\n */\ndo_action( 'edit_form_top', $post );\n?>\n\n<div id=\"poststuff\">\n<div id=\"post-body\" class=\"metabox-holder columns-<?php echo ( 1 === get_current_screen()->get_columns() ) ? '1' : '2'; ?>\">\n<div id=\"post-body-content\">\n\n<?php if ( post_type_supports( $post_type, 'title' ) ) { ?>\n<div id=\"titlediv\">\n<div id=\"titlewrap\">\n\t<?php\n\t/**\n\t * Filters the title field placeholder text.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string  $text Placeholder text. Default 'Add title'.\n\t * @param WP_Post $post Post object.\n\t */\n\t$title_placeholder = apply_filters( 'enter_title_here', __( 'Add title' ), $post );\n\t?>\n\t<label class=\"screen-reader-text\" id=\"title-prompt-text\" for=\"title\"><?php echo $title_placeholder; ?></label>\n\t<input type=\"text\" name=\"post_title\" size=\"30\" value=\"<?php echo esc_attr( $post->post_title ); ?>\" id=\"title\" spellcheck=\"true\" autocomplete=\"off\" />\n</div>\n\t<?php\n\t/**\n\t * Fires before the permalink field in the edit form.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param WP_Post $post Post object.\n\t */\n\tdo_action( 'edit_form_before_permalink', $post );\n\t?>\n<div class=\"inside\">\n\t<?php\n\tif ( $viewable ) :\n\t\t$sample_permalink_html = $post_type_object->public ? get_sample_permalink_html( $post->ID ) : '';\n\n\t\t// As of 4.4, the Get Shortlink button is hidden by default.\n\t\tif ( has_filter( 'pre_get_shortlink' ) || has_filter( 'get_shortlink' ) ) {\n\t\t\t$shortlink = wp_get_shortlink( $post->ID, 'post' );\n\n\t\t\tif ( ! empty( $shortlink ) && $shortlink !== $permalink && home_url( '?page_id=' . $post->ID ) !== $permalink ) {\n\t\t\t\t$sample_permalink_html .= '<input id=\"shortlink\" type=\"hidden\" value=\"' . esc_attr( $shortlink ) . '\" />' .\n\t\t\t\t\t'<button type=\"button\" class=\"button button-small\" onclick=\"prompt(&#39;URL:&#39;, jQuery(\\'#shortlink\\').val());\">' .\n\t\t\t\t\t__( 'Get Shortlink' ) .\n\t\t\t\t\t'</button>';\n\t\t\t}\n\t\t}\n\n\t\tif ( $post_type_object->public\n\t\t\t&& ! ( 'pending' === get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) )\n\t\t) {\n\t\t\t$has_sample_permalink = $sample_permalink_html && 'auto-draft' !== $post->post_status;\n\t\t\t?>\n\t<div id=\"edit-slug-box\" class=\"hide-if-no-js\">\n\t\t\t<?php\n\t\t\tif ( $has_sample_permalink ) {\n\t\t\t\techo $sample_permalink_html;\n\t\t\t}\n\t\t\t?>\n\t</div>\n\t\t\t<?php\n\t\t}\nendif;\n\t?>\n</div>\n\t<?php\n\twp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );\n\t?>\n</div><!-- /titlediv -->\n\t<?php\n}\n/**\n * Fires after the title field.\n *\n * @since 3.5.0\n *\n * @param WP_Post $post Post object.\n */\ndo_action( 'edit_form_after_title', $post );\n\nif ( post_type_supports( $post_type, 'editor' ) ) {\n\t$_wp_editor_expand_class = '';\n\tif ( $_wp_editor_expand ) {\n\t\t$_wp_editor_expand_class = ' wp-editor-expand';\n\t}\n\t?>\n<div id=\"postdivrich\" class=\"postarea<?php echo $_wp_editor_expand_class; ?>\">\n\n\t<?php\n\twp_editor(\n\t\t$post->post_content,\n\t\t'content',\n\t\tarray(\n\t\t\t'_content_editor_dfw' => $_content_editor_dfw,\n\t\t\t'drag_drop_upload'    => true,\n\t\t\t'tabfocus_elements'   => 'content-html,save-post',\n\t\t\t'editor_height'       => 300,\n\t\t\t'tinymce'             => array(\n\t\t\t\t'resize'                  => false,\n\t\t\t\t'wp_autoresize_on'        => $_wp_editor_expand,\n\t\t\t\t'add_unload_trigger'      => false,\n\t\t\t\t'wp_keep_scroll_position' => ! $is_IE,\n\t\t\t),\n\t\t)\n\t);\n\t?>\n<table id=\"post-status-info\"><tbody><tr>\n\t<td id=\"wp-word-count\" class=\"hide-if-no-js\">\n\t<?php\n\tprintf(\n\t\t/* translators: %s: Number of words. */\n\t\t__( 'Word count: %s' ),\n\t\t'<span class=\"word-count\">0</span>'\n\t);\n\t?>\n\t</td>\n\t<td class=\"autosave-info\">\n\t<span class=\"autosave-message\">&nbsp;</span>\n\t<?php\n\tif ( 'auto-draft' !== $post->post_status ) {\n\t\techo '<span id=\"last-edit\">';\n\t\t$last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) );\n\t\tif ( $last_user ) {\n\t\t\t/* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time. */\n\t\t\tprintf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );\n\t\t} else {\n\t\t\t/* translators: 1: Post edited date, 2: Post edited time. */\n\t\t\tprintf( __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );\n\t\t}\n\t\techo '</span>';\n\t}\n\t?>\n\t</td>\n\t<td id=\"content-resize-handle\" class=\"hide-if-no-js\"><br /></td>\n</tr></tbody></table>\n\n</div>\n\t<?php\n}\n/**\n * Fires after the content editor.\n *\n * @since 3.5.0\n *\n * @param WP_Post $post Post object.\n */\ndo_action( 'edit_form_after_editor', $post );\n?>\n</div><!-- /post-body-content -->\n\n<div id=\"postbox-container-1\" class=\"postbox-container\">\n<?php\n\nif ( 'page' === $post_type ) {\n\t/**\n\t * Fires before meta boxes with 'side' context are output for the 'page' post type.\n\t *\n\t * The submitpage box is a meta box with 'side' context, so this hook fires just before it is output.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param WP_Post $post Post object.\n\t */\n\tdo_action( 'submitpage_box', $post );\n} else {\n\t/**\n\t * Fires before meta boxes with 'side' context are output for all post types other than 'page'.\n\t *\n\t * The submitpost box is a meta box with 'side' context, so this hook fires just before it is output.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param WP_Post $post Post object.\n\t */\n\tdo_action( 'submitpost_box', $post );\n}\n\n\ndo_meta_boxes( $post_type, 'side', $post );\n\n?>\n</div>\n<div id=\"postbox-container-2\" class=\"postbox-container\">\n<?php\n\ndo_meta_boxes( null, 'normal', $post );\n\nif ( 'page' === $post_type ) {\n\t/**\n\t * Fires after 'normal' context meta boxes have been output for the 'page' post type.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param WP_Post $post Post object.\n\t */\n\tdo_action( 'edit_page_form', $post );\n} else {\n\t/**\n\t * Fires after 'normal' context meta boxes have been output for all post types other than 'page'.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param WP_Post $post Post object.\n\t */\n\tdo_action( 'edit_form_advanced', $post );\n}\n\n\ndo_meta_boxes( null, 'advanced', $post );\n\n?>\n</div>\n<?php\n/**\n * Fires after all meta box sections have been output, before the closing #post-body div.\n *\n * @since 2.1.0\n *\n * @param WP_Post $post Post object.\n */\ndo_action( 'dbx_post_sidebar', $post );\n\n?>\n</div><!-- /post-body -->\n<br class=\"clear\" />\n</div><!-- /poststuff -->\n</form>\n</div>\n\n<?php\nif ( post_type_supports( $post_type, 'comments' ) ) {\n\twp_comment_reply();\n}\n?>\n\n<?php if ( ! wp_is_mobile() && post_type_supports( $post_type, 'title' ) && '' === $post->post_title ) : ?>\n<script type=\"text/javascript\">\ntry{document.post.title.focus();}catch(e){}\n</script>\n<?php endif; ?>\n", "num_lines": 741}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The block editor page.\n *\n * @since 5.0.0\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n// Don't load directly.\nif ( ! defined( 'ABSPATH' ) ) {\n\tdie( '-1' );\n}\n\n/**\n * @global string       $post_type\n * @global WP_Post_Type $post_type_object\n * @global WP_Post      $post             Global post object.\n * @global string       $title\n * @global array        $editor_styles\n * @global array        $wp_meta_boxes\n */\nglobal $post_type, $post_type_object, $post, $title, $editor_styles, $wp_meta_boxes;\n\n// Flag that we're loading the block editor.\n$current_screen = get_current_screen();\n$current_screen->is_block_editor( true );\n\n/*\n * Emoji replacement is disabled for now, until it plays nicely with React.\n */\nremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\nwp_enqueue_script( 'heartbeat' );\nwp_enqueue_script( 'wp-edit-post' );\nwp_enqueue_script( 'wp-format-library' );\n\n$rest_base = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name;\n\n// Preload common data.\n$preload_paths = array(\n\t'/',\n\t'/wp/v2/types?context=edit',\n\t'/wp/v2/taxonomies?per_page=-1&context=edit',\n\t'/wp/v2/themes?status=active',\n\tsprintf( '/wp/v2/%s/%s?context=edit', $rest_base, $post->ID ),\n\tsprintf( '/wp/v2/types/%s?context=edit', $post_type ),\n\tsprintf( '/wp/v2/users/me?post_type=%s&context=edit', $post_type ),\n\tarray( '/wp/v2/media', 'OPTIONS' ),\n\tarray( '/wp/v2/blocks', 'OPTIONS' ),\n\tsprintf( '/wp/v2/%s/%d/autosaves?context=edit', $rest_base, $post->ID ),\n);\n\n/**\n * Preload common data by specifying an array of REST API paths that will be preloaded.\n *\n * Filters the array of paths that will be preloaded.\n *\n * @since 5.0.0\n *\n * @param string[] $preload_paths Array of paths to preload.\n * @param WP_Post  $post          Post being edited.\n */\n$preload_paths = apply_filters( 'block_editor_preload_paths', $preload_paths, $post );\n\n/*\n * Ensure the global $post remains the same after API data is preloaded.\n * Because API preloading can call the_content and other filters, plugins\n * can unexpectedly modify $post.\n */\n$backup_global_post = $post;\n\n$preload_data = array_reduce(\n\t$preload_paths,\n\t'rest_preload_api_request',\n\tarray()\n);\n\n// Restore the global $post as it was before API preloading.\n$post = $backup_global_post;\n\nwp_add_inline_script(\n\t'wp-api-fetch',\n\tsprintf( 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', wp_json_encode( $preload_data ) ),\n\t'after'\n);\n\nwp_add_inline_script(\n\t'wp-blocks',\n\tsprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( $post ) ) ),\n\t'after'\n);\n\n/*\n * Assign initial edits, if applicable. These are not initially assigned to the persisted post,\n * but should be included in its save payload.\n */\n$initial_edits = null;\n$is_new_post   = false;\nif ( 'auto-draft' === $post->post_status ) {\n\t$is_new_post = true;\n\t// Override \"(Auto Draft)\" new post default title with empty string, or filtered value.\n\t$initial_edits = array(\n\t\t'title'   => $post->post_title,\n\t\t'content' => $post->post_content,\n\t\t'excerpt' => $post->post_excerpt,\n\t);\n}\n\n// Preload server-registered block schemas.\nwp_add_inline_script(\n\t'wp-blocks',\n\t'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . wp_json_encode( get_block_editor_server_block_settings() ) . ');'\n);\n\n// Get admin url for handling meta boxes.\n$meta_box_url = admin_url( 'post.php' );\n$meta_box_url = add_query_arg(\n\tarray(\n\t\t'post'                  => $post->ID,\n\t\t'action'                => 'edit',\n\t\t'meta-box-loader'       => true,\n\t\t'meta-box-loader-nonce' => wp_create_nonce( 'meta-box-loader' ),\n\t),\n\t$meta_box_url\n);\nwp_localize_script( 'wp-editor', '_wpMetaBoxUrl', $meta_box_url );\n\n\n/*\n * Initialize the editor.\n */\n\n$align_wide         = get_theme_support( 'align-wide' );\n$color_palette      = current( (array) get_theme_support( 'editor-color-palette' ) );\n$font_sizes         = current( (array) get_theme_support( 'editor-font-sizes' ) );\n$gradient_presets   = current( (array) get_theme_support( 'editor-gradient-presets' ) );\n$custom_line_height = get_theme_support( 'custom-line-height' );\n$custom_units       = get_theme_support( 'custom-units' );\n\n/**\n * Filters the allowed block types for the editor, defaulting to true (all\n * block types supported).\n *\n * @since 5.0.0\n *\n * @param bool|array $allowed_block_types Array of block type slugs, or\n *                                        boolean to enable/disable all.\n * @param WP_Post    $post                The post resource data.\n */\n$allowed_block_types = apply_filters( 'allowed_block_types', true, $post );\n\n/*\n * Get all available templates for the post/page attributes meta-box.\n * The \"Default template\" array element should only be added if the array is\n * not empty so we do not trigger the template select element without any options\n * besides the default value.\n */\n$available_templates = wp_get_theme()->get_page_templates( get_post( $post->ID ) );\n$available_templates = ! empty( $available_templates ) ? array_merge(\n\tarray(\n\t\t/** This filter is documented in wp-admin/includes/meta-boxes.php */\n\t\t'' => apply_filters( 'default_page_template_title', __( 'Default template' ), 'rest-api' ),\n\t),\n\t$available_templates\n) : $available_templates;\n\n// Media settings.\n$max_upload_size = wp_max_upload_size();\nif ( ! $max_upload_size ) {\n\t$max_upload_size = 0;\n}\n\n// Editor Styles.\n$styles = array(\n\tarray(\n\t\t'css' => file_get_contents(\n\t\t\tABSPATH . WPINC . '/css/dist/editor/editor-styles.css'\n\t\t),\n\t),\n);\n\n/* translators: Use this to specify the CSS font family for the default font. */\n$locale_font_family = esc_html_x( 'Noto Serif', 'CSS Font Family for Editor Font' );\n$styles[]           = array(\n\t'css' => \"body { font-family: '$locale_font_family' }\",\n);\n\nif ( $editor_styles && current_theme_supports( 'editor-styles' ) ) {\n\tforeach ( $editor_styles as $style ) {\n\t\tif ( preg_match( '~^(https?:)?//~', $style ) ) {\n\t\t\t$response = wp_remote_get( $style );\n\t\t\tif ( ! is_wp_error( $response ) ) {\n\t\t\t\t$styles[] = array(\n\t\t\t\t\t'css' => wp_remote_retrieve_body( $response ),\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\t$file = get_theme_file_path( $style );\n\t\t\tif ( is_file( $file ) ) {\n\t\t\t\t$styles[] = array(\n\t\t\t\t\t'css'     => file_get_contents( $file ),\n\t\t\t\t\t'baseURL' => get_theme_file_uri( $style ),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Image sizes.\n\n/** This filter is documented in wp-admin/includes/media.php */\n$image_size_names = apply_filters(\n\t'image_size_names_choose',\n\tarray(\n\t\t'thumbnail' => __( 'Thumbnail' ),\n\t\t'medium'    => __( 'Medium' ),\n\t\t'large'     => __( 'Large' ),\n\t\t'full'      => __( 'Full Size' ),\n\t)\n);\n\n$available_image_sizes = array();\nforeach ( $image_size_names as $image_size_slug => $image_size_name ) {\n\t$available_image_sizes[] = array(\n\t\t'slug' => $image_size_slug,\n\t\t'name' => $image_size_name,\n\t);\n}\n\n$image_dimensions = array();\n$all_sizes        = wp_get_registered_image_subsizes();\nforeach ( $available_image_sizes as $size ) {\n\t$key = $size['slug'];\n\tif ( isset( $all_sizes[ $key ] ) ) {\n\t\t$image_dimensions[ $key ] = $all_sizes[ $key ];\n\t}\n}\n\n// Lock settings.\n$user_id = wp_check_post_lock( $post->ID );\nif ( $user_id ) {\n\t$locked = false;\n\n\t/** This filter is documented in wp-admin/includes/post.php */\n\tif ( apply_filters( 'show_post_locked_dialog', true, $post, $user_id ) ) {\n\t\t$locked = true;\n\t}\n\n\t$user_details = null;\n\tif ( $locked ) {\n\t\t$user         = get_userdata( $user_id );\n\t\t$user_details = array(\n\t\t\t'name' => $user->display_name,\n\t\t);\n\t\t$avatar       = get_avatar_url( $user_id, array( 'size' => 64 ) );\n\t}\n\n\t$lock_details = array(\n\t\t'isLocked' => $locked,\n\t\t'user'     => $user_details,\n\t);\n} else {\n\t// Lock the post.\n\t$active_post_lock = wp_set_post_lock( $post->ID );\n\tif ( $active_post_lock ) {\n\t\t$active_post_lock = esc_attr( implode( ':', $active_post_lock ) );\n\t}\n\n\t$lock_details = array(\n\t\t'isLocked'       => false,\n\t\t'activePostLock' => $active_post_lock,\n\t);\n}\n\n/**\n * Filters the body placeholder text.\n *\n * @since 5.0.0\n *\n * @param string  $text Placeholder text. Default 'Start writing or type / to choose a block'.\n * @param WP_Post $post Post object.\n */\n$body_placeholder = apply_filters( 'write_your_story', __( 'Start writing or type / to choose a block' ), $post );\n\n$editor_settings = array(\n\t'alignWide'                            => $align_wide,\n\t'availableTemplates'                   => $available_templates,\n\t'allowedBlockTypes'                    => $allowed_block_types,\n\t'disableCustomColors'                  => get_theme_support( 'disable-custom-colors' ),\n\t'disableCustomFontSizes'               => get_theme_support( 'disable-custom-font-sizes' ),\n\t'disableCustomGradients'               => get_theme_support( 'disable-custom-gradients' ),\n\t'disablePostFormats'                   => ! current_theme_supports( 'post-formats' ),\n\t/** This filter is documented in wp-admin/edit-form-advanced.php */\n\t'titlePlaceholder'                     => apply_filters( 'enter_title_here', __( 'Add title' ), $post ),\n\t'bodyPlaceholder'                      => $body_placeholder,\n\t'isRTL'                                => is_rtl(),\n\t'autosaveInterval'                     => AUTOSAVE_INTERVAL,\n\t'maxUploadFileSize'                    => $max_upload_size,\n\t'allowedMimeTypes'                     => get_allowed_mime_types(),\n\t'styles'                               => $styles,\n\t'imageSizes'                           => $available_image_sizes,\n\t'imageDimensions'                      => $image_dimensions,\n\t'richEditingEnabled'                   => user_can_richedit(),\n\t'postLock'                             => $lock_details,\n\t'postLockUtils'                        => array(\n\t\t'nonce'       => wp_create_nonce( 'lock-post_' . $post->ID ),\n\t\t'unlockNonce' => wp_create_nonce( 'update-post_' . $post->ID ),\n\t\t'ajaxUrl'     => admin_url( 'admin-ajax.php' ),\n\t),\n\t'__experimentalBlockPatterns'          => WP_Block_Patterns_Registry::get_instance()->get_all_registered(),\n\t'__experimentalBlockPatternCategories' => WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered(),\n\n\t// Whether or not to load the 'postcustom' meta box is stored as a user meta\n\t// field so that we're not always loading its assets.\n\t'enableCustomFields'                   => (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ),\n\t'enableCustomLineHeight'               => $custom_line_height,\n\t'enableCustomUnits'                    => $custom_units,\n);\n\n$autosave = wp_get_post_autosave( $post_ID );\nif ( $autosave ) {\n\tif ( mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {\n\t\t$editor_settings['autosave'] = array(\n\t\t\t'editLink' => get_edit_post_link( $autosave->ID ),\n\t\t);\n\t} else {\n\t\twp_delete_post_revision( $autosave->ID );\n\t}\n}\n\nif ( false !== $color_palette ) {\n\t$editor_settings['colors'] = $color_palette;\n}\n\nif ( false !== $font_sizes ) {\n\t$editor_settings['fontSizes'] = $font_sizes;\n}\n\nif ( false !== $gradient_presets ) {\n\t$editor_settings['gradients'] = $gradient_presets;\n}\n\nif ( ! empty( $post_type_object->template ) ) {\n\t$editor_settings['template']     = $post_type_object->template;\n\t$editor_settings['templateLock'] = ! empty( $post_type_object->template_lock ) ? $post_type_object->template_lock : false;\n}\n\n// If there's no template set on a new post, use the post format, instead.\nif ( $is_new_post && ! isset( $editor_settings['template'] ) && 'post' === $post->post_type ) {\n\t$post_format = get_post_format( $post );\n\tif ( in_array( $post_format, array( 'audio', 'gallery', 'image', 'quote', 'video' ), true ) ) {\n\t\t$editor_settings['template'] = array( array( \"core/$post_format\" ) );\n\t}\n}\n\n/**\n * Scripts\n */\nwp_enqueue_media(\n\tarray(\n\t\t'post' => $post->ID,\n\t)\n);\nwp_tinymce_inline_scripts();\nwp_enqueue_editor();\n\n\n/**\n * Styles\n */\nwp_enqueue_style( 'wp-edit-post' );\nwp_enqueue_style( 'wp-format-library' );\n\n/**\n * Fires after block assets have been enqueued for the editing interface.\n *\n * Call `add_action` on any hook before 'admin_enqueue_scripts'.\n *\n * In the function call you supply, simply use `wp_enqueue_script` and\n * `wp_enqueue_style` to add your functionality to the block editor.\n *\n * @since 5.0.0\n */\ndo_action( 'enqueue_block_editor_assets' );\n\n// In order to duplicate classic meta box behaviour, we need to run the classic meta box actions.\nrequire_once ABSPATH . 'wp-admin/includes/meta-boxes.php';\nregister_and_do_post_meta_boxes( $post );\n\n// Check if the Custom Fields meta box has been removed at some point.\n$core_meta_boxes = $wp_meta_boxes[ $current_screen->id ]['normal']['core'];\nif ( ! isset( $core_meta_boxes['postcustom'] ) || ! $core_meta_boxes['postcustom'] ) {\n\tunset( $editor_settings['enableCustomFields'] );\n}\n\n/**\n * Filters the settings to pass to the block editor.\n *\n * @since 5.0.0\n *\n * @param array   $editor_settings Default editor settings.\n * @param WP_Post $post            Post being edited.\n */\n$editor_settings = apply_filters( 'block_editor_settings', $editor_settings, $post );\n\n$init_script = <<<JS\n( function() {\n\twindow._wpLoadBlockEditor = new Promise( function( resolve ) {\n\t\twp.domReady( function() {\n\t\t\tresolve( wp.editPost.initializeEditor( 'editor', \"%s\", %d, %s, %s ) );\n\t\t} );\n\t} );\n} )();\nJS;\n\n$script = sprintf(\n\t$init_script,\n\t$post->post_type,\n\t$post->ID,\n\twp_json_encode( $editor_settings ),\n\twp_json_encode( $initial_edits )\n);\nwp_add_inline_script( 'wp-edit-post', $script );\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n\n<div class=\"block-editor\">\n\t<h1 class=\"screen-reader-text hide-if-no-js\"><?php echo esc_html( $title ); ?></h1>\n\t<div id=\"editor\" class=\"block-editor__container hide-if-no-js\"></div>\n\t<div id=\"metaboxes\" class=\"hidden\">\n\t\t<?php the_block_editor_meta_boxes(); ?>\n\t</div>\n\n\t<?php // JavaScript is disabled. ?>\n\t<div class=\"wrap hide-if-js block-editor-no-js\">\n\t\t<h1 class=\"wp-heading-inline\"><?php echo esc_html( $title ); ?></h1>\n\t\t<div class=\"notice notice-error notice-alt\">\n\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\t\t$message = sprintf(\n\t\t\t\t\t\t/* translators: %s: A link to install the Classic Editor plugin. */\n\t\t\t\t\t\t__( 'The block editor requires JavaScript. Please enable JavaScript in your browser settings, or try the <a href=\"%s\">Classic Editor plugin</a>.' ),\n\t\t\t\t\t\tesc_url( wp_nonce_url( self_admin_url( 'plugin-install.php?tab=favorites&user=wordpressdotorg&save=0' ), 'save_wporg_username_' . get_current_user_id() ) )\n\t\t\t\t\t);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters the message displayed in the block editor interface when JavaScript is\n\t\t\t\t\t * not enabled in the browser.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 5.0.3\n\t\t\t\t\t *\n\t\t\t\t\t * @param string  $message The message being displayed.\n\t\t\t\t\t * @param WP_Post $post    The post being edited.\n\t\t\t\t\t */\n\t\t\t\t\techo apply_filters( 'block_editor_no_javascript_message', $message, $post );\n\t\t\t\t\t?>\n\t\t\t</p>\n\t\t</div>\n\t</div>\n</div>\n", "num_lines": 464}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit comment form for inclusion in another file.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n// Don't load directly.\nif ( ! defined( 'ABSPATH' ) ) {\n\tdie( '-1' );\n}\n?>\n<form name=\"post\" action=\"comment.php\" method=\"post\" id=\"post\">\n<?php wp_nonce_field( 'update-comment_' . $comment->comment_ID ); ?>\n<div class=\"wrap\">\n<h1><?php _e( 'Edit Comment' ); ?></h1>\n\n<div id=\"poststuff\">\n<input type=\"hidden\" name=\"action\" value=\"editedcomment\" />\n<input type=\"hidden\" name=\"comment_ID\" value=\"<?php echo esc_attr( $comment->comment_ID ); ?>\" />\n<input type=\"hidden\" name=\"comment_post_ID\" value=\"<?php echo esc_attr( $comment->comment_post_ID ); ?>\" />\n\n<div id=\"post-body\" class=\"metabox-holder columns-2\">\n<div id=\"post-body-content\" class=\"edit-form-section edit-comment-section\">\n<?php\nif ( 'approved' === wp_get_comment_status( $comment ) && $comment->comment_post_ID > 0 ) :\n\t$comment_link = get_comment_link( $comment );\n\t?>\n<div class=\"inside\">\n\t<div id=\"comment-link-box\">\n\t\t<strong><?php _ex( 'Permalink:', 'comment' ); ?></strong>\n\t\t<span id=\"sample-permalink\">\n\t\t\t<a href=\"<?php echo esc_url( $comment_link ); ?>\">\n\t\t\t\t<?php echo esc_html( $comment_link ); ?>\n\t\t\t</a>\n\t\t</span>\n\t</div>\n</div>\n<?php endif; ?>\n<div id=\"namediv\" class=\"stuffbox\">\n<div class=\"inside\">\n<h2 class=\"edit-comment-author\"><?php _e( 'Author' ); ?></h2>\n<fieldset>\n<legend class=\"screen-reader-text\"><?php _e( 'Comment Author' ); ?></legend>\n<table class=\"form-table editcomment\" role=\"presentation\">\n<tbody>\n<tr>\n\t<td class=\"first\"><label for=\"name\"><?php _e( 'Name' ); ?></label></td>\n\t<td><input type=\"text\" name=\"newcomment_author\" size=\"30\" value=\"<?php echo esc_attr( $comment->comment_author ); ?>\" id=\"name\" /></td>\n</tr>\n<tr>\n\t<td class=\"first\"><label for=\"email\"><?php _e( 'Email' ); ?></label></td>\n\t<td>\n\t\t<input type=\"text\" name=\"newcomment_author_email\" size=\"30\" value=\"<?php echo $comment->comment_author_email; ?>\" id=\"email\" />\n\t</td>\n</tr>\n<tr>\n\t<td class=\"first\"><label for=\"newcomment_author_url\"><?php _e( 'URL' ); ?></label></td>\n\t<td>\n\t\t<input type=\"text\" id=\"newcomment_author_url\" name=\"newcomment_author_url\" size=\"30\" class=\"code\" value=\"<?php echo esc_attr( $comment->comment_author_url ); ?>\" />\n\t</td>\n</tr>\n</tbody>\n</table>\n</fieldset>\n</div>\n</div>\n\n<div id=\"postdiv\" class=\"postarea\">\n<?php\n\techo '<label for=\"content\" class=\"screen-reader-text\">' . __( 'Comment' ) . '</label>';\n\t$quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );\n\twp_editor(\n\t\t$comment->comment_content,\n\t\t'content',\n\t\tarray(\n\t\t\t'media_buttons' => false,\n\t\t\t'tinymce'       => false,\n\t\t\t'quicktags'     => $quicktags_settings,\n\t\t)\n\t);\n\twp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );\n\t?>\n</div>\n</div><!-- /post-body-content -->\n\n<div id=\"postbox-container-1\" class=\"postbox-container\">\n<div id=\"submitdiv\" class=\"stuffbox\" >\n<h2><?php _e( 'Save' ); ?></h2>\n<div class=\"inside\">\n<div class=\"submitbox\" id=\"submitcomment\">\n<div id=\"minor-publishing\">\n\n<div id=\"misc-publishing-actions\">\n\n<div class=\"misc-pub-section misc-pub-comment-status\" id=\"comment-status\">\n<?php _e( 'Status:' ); ?> <span id=\"comment-status-display\">\n<?php\nswitch ( $comment->comment_approved ) {\n\tcase '1':\n\t\t_e( 'Approved' );\n\t\tbreak;\n\tcase '0':\n\t\t_e( 'Pending' );\n\t\tbreak;\n\tcase 'spam':\n\t\t_e( 'Spam' );\n\t\tbreak;\n}\n?>\n</span>\n\n<fieldset id=\"comment-status-radio\">\n<legend class=\"screen-reader-text\"><?php _e( 'Comment status' ); ?></legend>\n<label><input type=\"radio\"<?php checked( $comment->comment_approved, '1' ); ?> name=\"comment_status\" value=\"1\" /><?php _ex( 'Approved', 'comment status' ); ?></label><br />\n<label><input type=\"radio\"<?php checked( $comment->comment_approved, '0' ); ?> name=\"comment_status\" value=\"0\" /><?php _ex( 'Pending', 'comment status' ); ?></label><br />\n<label><input type=\"radio\"<?php checked( $comment->comment_approved, 'spam' ); ?> name=\"comment_status\" value=\"spam\" /><?php _ex( 'Spam', 'comment status' ); ?></label>\n</fieldset>\n</div><!-- .misc-pub-section -->\n\n<div class=\"misc-pub-section curtime misc-pub-curtime\">\n<?php\n$submitted = sprintf(\n\t/* translators: 1: Comment date, 2: Comment time. */\n\t__( '%1$s at %2$s' ),\n\t/* translators: Publish box date format, see https://www.php.net/date */\n\tdate_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $comment->comment_date ) ),\n\t/* translators: Publish box time format, see https://www.php.net/date */\n\tdate_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $comment->comment_date ) )\n);\n?>\n<span id=\"timestamp\">\n<?php\n/* translators: %s: Comment date. */\nprintf( __( 'Submitted on: %s' ), '<b>' . $submitted . '</b>' );\n?>\n</span>\n<a href=\"#edit_timestamp\" class=\"edit-timestamp hide-if-no-js\"><span aria-hidden=\"true\"><?php _e( 'Edit' ); ?></span> <span class=\"screen-reader-text\"><?php _e( 'Edit date and time' ); ?></span></a>\n<fieldset id='timestampdiv' class='hide-if-js'>\n<legend class=\"screen-reader-text\"><?php _e( 'Date and time' ); ?></legend>\n<?php touch_time( ( 'editcomment' === $action ), 0 ); ?>\n</fieldset>\n</div>\n\n<?php\n$post_id = $comment->comment_post_ID;\nif ( current_user_can( 'edit_post', $post_id ) ) {\n\t$post_link  = \"<a href='\" . esc_url( get_edit_post_link( $post_id ) ) . \"'>\";\n\t$post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';\n} else {\n\t$post_link = esc_html( get_the_title( $post_id ) );\n}\n?>\n\n<div class=\"misc-pub-section misc-pub-response-to\">\n\t<?php\n\tprintf(\n\t\t/* translators: %s: Post link. */\n\t\t__( 'In response to: %s' ),\n\t\t'<b>' . $post_link . '</b>'\n\t);\n\t?>\n</div>\n\n<?php\nif ( $comment->comment_parent ) :\n\t$parent = get_comment( $comment->comment_parent );\n\tif ( $parent ) :\n\t\t$parent_link = esc_url( get_comment_link( $parent ) );\n\t\t$name        = get_comment_author( $parent );\n\t\t?>\n\t<div class=\"misc-pub-section misc-pub-reply-to\">\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: Comment link. */\n\t\t\t__( 'In reply to: %s' ),\n\t\t\t'<b><a href=\"' . $parent_link . '\">' . $name . '</a></b>'\n\t\t);\n\t\t?>\n\t</div>\n\t\t<?php\nendif;\nendif;\n?>\n\n<?php\n\t/**\n\t * Filters miscellaneous actions for the edit comment form sidebar.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param string     $html    Output HTML to display miscellaneous action.\n\t * @param WP_Comment $comment Current comment object.\n\t */\n\techo apply_filters( 'edit_comment_misc_actions', '', $comment );\n?>\n\n</div> <!-- misc actions -->\n<div class=\"clear\"></div>\n</div>\n\n<div id=\"major-publishing-actions\">\n<div id=\"delete-action\">\n<?php echo \"<a class='submitdelete deletion' href='\" . wp_nonce_url( 'comment.php?action=' . ( ! EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . \"&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=\" . urlencode( wp_get_referer() ), 'delete-comment_' . $comment->comment_ID ) . \"'>\" . ( ! EMPTY_TRASH_DAYS ? __( 'Delete Permanently' ) : __( 'Move to Trash' ) ) . \"</a>\\n\"; ?>\n</div>\n<div id=\"publishing-action\">\n<?php submit_button( __( 'Update' ), 'primary large', 'save', false ); ?>\n</div>\n<div class=\"clear\"></div>\n</div>\n</div>\n</div>\n</div><!-- /submitdiv -->\n</div>\n\n<div id=\"postbox-container-2\" class=\"postbox-container\">\n<?php\n/** This action is documented in wp-admin/includes/meta-boxes.php */\ndo_action( 'add_meta_boxes', 'comment', $comment );\n\n/**\n * Fires when comment-specific meta boxes are added.\n *\n * @since 3.0.0\n *\n * @param WP_Comment $comment Comment object.\n */\ndo_action( 'add_meta_boxes_comment', $comment );\n\ndo_meta_boxes( null, 'normal', $comment );\n\n$referer = wp_get_referer();\n?>\n</div>\n\n<input type=\"hidden\" name=\"c\" value=\"<?php echo esc_attr( $comment->comment_ID ); ?>\" />\n<input type=\"hidden\" name=\"p\" value=\"<?php echo esc_attr( $comment->comment_post_ID ); ?>\" />\n<input name=\"referredby\" type=\"hidden\" id=\"referredby\" value=\"<?php echo $referer ? esc_url( $referer ) : ''; ?>\" />\n<?php wp_original_referer_field( true, 'previous' ); ?>\n<input type=\"hidden\" name=\"noredir\" value=\"1\" />\n\n</div><!-- /post-body -->\n</div>\n</div>\n</form>\n\n<?php if ( ! wp_is_mobile() ) : ?>\n<script type=\"text/javascript\">\ntry{document.post.name.focus();}catch(e){}\n</script>\n\t<?php\nendif;\n", "num_lines": 254}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit links form for inclusion in administration panels.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n// Don't load directly.\nif ( ! defined( 'ABSPATH' ) ) {\n\tdie( '-1' );\n}\n\nif ( ! empty( $link_id ) ) {\n\t/* translators: %s: URL to Links screen. */\n\t$heading      = sprintf( __( '<a href=\"%s\">Links</a> / Edit Link' ), 'link-manager.php' );\n\t$submit_text  = __( 'Update Link' );\n\t$form_name    = 'editlink';\n\t$nonce_action = 'update-bookmark_' . $link_id;\n} else {\n\t/* translators: %s: URL to Links screen. */\n\t$heading      = sprintf( __( '<a href=\"%s\">Links</a> / Add New Link' ), 'link-manager.php' );\n\t$submit_text  = __( 'Add Link' );\n\t$form_name    = 'addlink';\n\t$nonce_action = 'add-bookmark';\n}\n\nrequire_once ABSPATH . 'wp-admin/includes/meta-boxes.php';\n\nadd_meta_box( 'linksubmitdiv', __( 'Save' ), 'link_submit_meta_box', null, 'side', 'core' );\nadd_meta_box( 'linkcategorydiv', __( 'Categories' ), 'link_categories_meta_box', null, 'normal', 'core' );\nadd_meta_box( 'linktargetdiv', __( 'Target' ), 'link_target_meta_box', null, 'normal', 'core' );\nadd_meta_box( 'linkxfndiv', __( 'Link Relationship (XFN)' ), 'link_xfn_meta_box', null, 'normal', 'core' );\nadd_meta_box( 'linkadvanceddiv', __( 'Advanced' ), 'link_advanced_meta_box', null, 'normal', 'core' );\n\n/** This action is documented in wp-admin/includes/meta-boxes.php */\ndo_action( 'add_meta_boxes', 'link', $link );\n\n/**\n * Fires when link-specific meta boxes are added.\n *\n * @since 3.0.0\n *\n * @param object $link Link object.\n */\ndo_action( 'add_meta_boxes_link', $link );\n\n/** This action is documented in wp-admin/includes/meta-boxes.php */\ndo_action( 'do_meta_boxes', 'link', 'normal', $link );\n/** This action is documented in wp-admin/includes/meta-boxes.php */\ndo_action( 'do_meta_boxes', 'link', 'advanced', $link );\n/** This action is documented in wp-admin/includes/meta-boxes.php */\ndo_action( 'do_meta_boxes', 'link', 'side', $link );\n\nadd_screen_option(\n\t'layout_columns',\n\tarray(\n\t\t'max'     => 2,\n\t\t'default' => 2,\n\t)\n);\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t'<p>' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link&#8217;s web address and name (the text you want to display on your site as the link) are required fields.' ) . '</p>' .\n\t\t'<p>' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you don&#8217;t use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '</p>' .\n\t\t'<p>' . __( 'XFN stands for <a href=\"https://gmpg.org/xfn/\">XHTML Friends Network</a>, which is optional. WordPress allows the generation of XFN attributes to show how you are related to the authors/owners of the site to which you are linking.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://codex.wordpress.org/Links_Add_New_Screen\">Documentation on Creating Links</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n\n<div class=\"wrap\">\n<h1 class=\"wp-heading-inline\">\n<?php\necho esc_html( $title );\n?>\n</h1>\n\n<a href=\"link-add.php\" class=\"page-title-action\"><?php echo esc_html_x( 'Add New', 'link' ); ?></a>\n\n<hr class=\"wp-header-end\">\n\n<?php if ( isset( $_GET['added'] ) ) : ?>\n<div id=\"message\" class=\"updated notice is-dismissible\"><p><?php _e( 'Link added.' ); ?></p></div>\n<?php endif; ?>\n\n<form name=\"<?php echo esc_attr( $form_name ); ?>\" id=\"<?php echo esc_attr( $form_name ); ?>\" method=\"post\" action=\"link.php\">\n<?php\nif ( ! empty( $link_added ) ) {\n\techo $link_added;\n}\n\nwp_nonce_field( $nonce_action );\nwp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );\nwp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );\n?>\n\n<div id=\"poststuff\">\n\n<div id=\"post-body\" class=\"metabox-holder columns-<?php echo ( 1 === get_current_screen()->get_columns() ) ? '1' : '2'; ?>\">\n<div id=\"post-body-content\">\n<div id=\"namediv\" class=\"stuffbox\">\n<h2><label for=\"link_name\"><?php _ex( 'Name', 'link name' ); ?></label></h2>\n<div class=\"inside\">\n\t<input type=\"text\" name=\"link_name\" size=\"30\" maxlength=\"255\" value=\"<?php echo esc_attr( $link->link_name ); ?>\" id=\"link_name\" />\n\t<p><?php _e( 'Example: Nifty blogging software' ); ?></p>\n</div>\n</div>\n\n<div id=\"addressdiv\" class=\"stuffbox\">\n<h2><label for=\"link_url\"><?php _e( 'Web Address' ); ?></label></h2>\n<div class=\"inside\">\n\t<input type=\"text\" name=\"link_url\" size=\"30\" maxlength=\"255\" class=\"code\" value=\"<?php echo esc_attr( $link->link_url ); ?>\" id=\"link_url\" />\n\t<p><?php _e( 'Example: <code>https://wordpress.org/</code> &#8212; don&#8217;t forget the <code>https://</code>' ); ?></p>\n</div>\n</div>\n\n<div id=\"descriptiondiv\" class=\"stuffbox\">\n<h2><label for=\"link_description\"><?php _e( 'Description' ); ?></label></h2>\n<div class=\"inside\">\n\t<input type=\"text\" name=\"link_description\" size=\"30\" maxlength=\"255\" value=\"<?php echo isset( $link->link_description ) ? esc_attr( $link->link_description ) : ''; ?>\" id=\"link_description\" />\n\t<p><?php _e( 'This will be shown when someone hovers over the link in the blogroll, or optionally below the link.' ); ?></p>\n</div>\n</div>\n</div><!-- /post-body-content -->\n\n<div id=\"postbox-container-1\" class=\"postbox-container\">\n<?php\n\n/** This action is documented in wp-admin/includes/meta-boxes.php */\ndo_action( 'submitlink_box' );\n$side_meta_boxes = do_meta_boxes( 'link', 'side', $link );\n\n?>\n</div>\n<div id=\"postbox-container-2\" class=\"postbox-container\">\n<?php\n\ndo_meta_boxes( null, 'normal', $link );\n\ndo_meta_boxes( null, 'advanced', $link );\n\n?>\n</div>\n<?php\n\nif ( $link_id ) :\n\t?>\n<input type=\"hidden\" name=\"action\" value=\"save\" />\n<input type=\"hidden\" name=\"link_id\" value=\"<?php echo (int) $link_id; ?>\" />\n<input type=\"hidden\" name=\"cat_id\" value=\"<?php echo (int) $cat_id; ?>\" />\n<?php else : ?>\n<input type=\"hidden\" name=\"action\" value=\"add\" />\n<?php endif; ?>\n\n</div>\n</div>\n\n</form>\n</div>\n", "num_lines": 172}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit tag form for inclusion in administration panels.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n// Don't load directly.\nif ( ! defined( 'ABSPATH' ) ) {\n\tdie( '-1' );\n}\n\n// Back compat hooks.\nif ( 'category' === $taxonomy ) {\n\t/**\n\t * Fires before the Edit Category form.\n\t *\n\t * @since 2.1.0\n\t * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_edit_form'} instead.\n\t *\n\t * @param WP_Term $tag Current category term object.\n\t */\n\tdo_action_deprecated( 'edit_category_form_pre', array( $tag ), '3.0.0', '{$taxonomy}_pre_edit_form' );\n} elseif ( 'link_category' === $taxonomy ) {\n\t/**\n\t * Fires before the Edit Link Category form.\n\t *\n\t * @since 2.3.0\n\t * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_edit_form'} instead.\n\t *\n\t * @param WP_Term $tag Current link category term object.\n\t */\n\tdo_action_deprecated( 'edit_link_category_form_pre', array( $tag ), '3.0.0', '{$taxonomy}_pre_edit_form' );\n} else {\n\t/**\n\t * Fires before the Edit Tag form.\n\t *\n\t * @since 2.5.0\n\t * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_edit_form'} instead.\n\t *\n\t * @param WP_Term $tag Current tag term object.\n\t */\n\tdo_action_deprecated( 'edit_tag_form_pre', array( $tag ), '3.0.0', '{$taxonomy}_pre_edit_form' );\n}\n\n/**\n * Use with caution, see https://developer.wordpress.org/reference/functions/wp_reset_vars/\n */\nwp_reset_vars( array( 'wp_http_referer' ) );\n\n$wp_http_referer = remove_query_arg( array( 'action', 'message', 'tag_ID' ), $wp_http_referer );\n\n/** Also used by Edit Tags */\nrequire_once ABSPATH . 'wp-admin/includes/edit-tag-messages.php';\n\n/**\n * Fires before the Edit Term form for all taxonomies.\n *\n * The dynamic portion of the hook name, `$taxonomy`, refers to\n * the taxonomy slug.\n *\n * @since 3.0.0\n *\n * @param WP_Term $tag      Current taxonomy term object.\n * @param string  $taxonomy Current $taxonomy slug.\n */\ndo_action( \"{$taxonomy}_pre_edit_form\", $tag, $taxonomy ); ?>\n\n<div class=\"wrap\">\n<h1><?php echo $tax->labels->edit_item; ?></h1>\n\n<?php\n$class = ( isset( $msg ) && 5 === $msg ) ? 'error' : 'success';\n\nif ( $message ) {\n\t?>\n<div id=\"message\" class=\"notice notice-<?php echo $class; ?>\">\n\t<p><strong><?php echo $message; ?></strong></p>\n\t<?php if ( $wp_http_referer ) { ?>\n\t<p><a href=\"<?php echo esc_url( wp_validate_redirect( esc_url_raw( $wp_http_referer ), admin_url( 'term.php?taxonomy=' . $taxonomy ) ) ); ?>\">\n\t\t<?php echo esc_html( $tax->labels->back_to_items ); ?>\n\t</a></p>\n\t<?php } ?>\n</div>\n\t<?php\n}\n?>\n\n<div id=\"ajax-response\"></div>\n\n<form name=\"edittag\" id=\"edittag\" method=\"post\" action=\"edit-tags.php\" class=\"validate\"\n<?php\n/**\n * Fires inside the Edit Term form tag.\n *\n * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.\n *\n * @since 3.7.0\n */\ndo_action( \"{$taxonomy}_term_edit_form_tag\" );\n?>\n>\n<input type=\"hidden\" name=\"action\" value=\"editedtag\"/>\n<input type=\"hidden\" name=\"tag_ID\" value=\"<?php echo esc_attr( $tag_ID ); ?>\"/>\n<input type=\"hidden\" name=\"taxonomy\" value=\"<?php echo esc_attr( $taxonomy ); ?>\"/>\n<?php\nwp_original_referer_field( true, 'previous' );\nwp_nonce_field( 'update-tag_' . $tag_ID );\n\n/**\n * Fires at the beginning of the Edit Term form.\n *\n * At this point, the required hidden fields and nonces have already been output.\n *\n * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.\n *\n * @since 4.5.0\n *\n * @param WP_Term $tag      Current taxonomy term object.\n * @param string  $taxonomy Current $taxonomy slug.\n */\ndo_action( \"{$taxonomy}_term_edit_form_top\", $tag, $taxonomy );\n\n$tag_name_value = '';\nif ( isset( $tag->name ) ) {\n\t$tag_name_value = esc_attr( $tag->name );\n}\n?>\n\t<table class=\"form-table\" role=\"presentation\">\n\t\t<tr class=\"form-field form-required term-name-wrap\">\n\t\t\t<th scope=\"row\"><label for=\"name\"><?php _ex( 'Name', 'term name' ); ?></label></th>\n\t\t\t<td><input name=\"name\" id=\"name\" type=\"text\" value=\"<?php echo $tag_name_value; ?>\" size=\"40\" aria-required=\"true\" />\n\t\t\t<p class=\"description\"><?php _e( 'The name is how it appears on your site.' ); ?></p></td>\n\t\t</tr>\n<?php if ( ! global_terms_enabled() ) { ?>\n\t\t<tr class=\"form-field term-slug-wrap\">\n\t\t\t<th scope=\"row\"><label for=\"slug\"><?php _e( 'Slug' ); ?></label></th>\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * Filters the editable slug.\n\t\t\t *\n\t\t\t * Note: This is a multi-use hook in that it is leveraged both for editable\n\t\t\t * post URIs and term slugs.\n\t\t\t *\n\t\t\t * @since 2.6.0\n\t\t\t * @since 4.4.0 The `$tag` parameter was added.\n\t\t\t *\n\t\t\t * @param string          $slug The editable slug. Will be either a term slug or post URI depending\n\t\t\t *                              upon the context in which it is evaluated.\n\t\t\t * @param WP_Term|WP_Post $tag  Term or WP_Post object.\n\t\t\t */\n\t\t\t$slug = isset( $tag->slug ) ? apply_filters( 'editable_slug', $tag->slug, $tag ) : '';\n\t\t\t?>\n\t\t\t<td><input name=\"slug\" id=\"slug\" type=\"text\" value=\"<?php echo esc_attr( $slug ); ?>\" size=\"40\" />\n\t\t\t<p class=\"description\"><?php _e( 'The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ); ?></p></td>\n\t\t</tr>\n<?php } ?>\n<?php if ( is_taxonomy_hierarchical( $taxonomy ) ) : ?>\n\t\t<tr class=\"form-field term-parent-wrap\">\n\t\t\t<th scope=\"row\"><label for=\"parent\"><?php echo esc_html( $tax->labels->parent_item ); ?></label></th>\n\t\t\t<td>\n\t\t\t\t<?php\n\t\t\t\t$dropdown_args = array(\n\t\t\t\t\t'hide_empty'       => 0,\n\t\t\t\t\t'hide_if_empty'    => false,\n\t\t\t\t\t'taxonomy'         => $taxonomy,\n\t\t\t\t\t'name'             => 'parent',\n\t\t\t\t\t'orderby'          => 'name',\n\t\t\t\t\t'selected'         => $tag->parent,\n\t\t\t\t\t'exclude_tree'     => $tag->term_id,\n\t\t\t\t\t'hierarchical'     => true,\n\t\t\t\t\t'show_option_none' => __( 'None' ),\n\t\t\t\t);\n\n\t\t\t\t/** This filter is documented in wp-admin/edit-tags.php */\n\t\t\t\t$dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'edit' );\n\t\t\t\twp_dropdown_categories( $dropdown_args );\n\t\t\t\t?>\n\t\t\t\t<?php if ( 'category' === $taxonomy ) : ?>\n\t\t\t\t\t<p class=\"description\"><?php _e( 'Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.' ); ?></p>\n\t\t\t\t<?php else : ?>\n\t\t\t\t\t<p class=\"description\"><?php _e( 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.' ); ?></p>\n\t\t\t\t<?php endif; ?>\n\t\t\t</td>\n\t\t</tr>\n<?php endif; // is_taxonomy_hierarchical() ?>\n\t\t<tr class=\"form-field term-description-wrap\">\n\t\t\t<th scope=\"row\"><label for=\"description\"><?php _e( 'Description' ); ?></label></th>\n\t\t\t<td><textarea name=\"description\" id=\"description\" rows=\"5\" cols=\"50\" class=\"large-text\"><?php echo $tag->description; // textarea_escaped ?></textarea>\n\t\t\t<p class=\"description\"><?php _e( 'The description is not prominent by default; however, some themes may show it.' ); ?></p></td>\n\t\t</tr>\n\t\t<?php\n\t\t// Back compat hooks.\n\t\tif ( 'category' === $taxonomy ) {\n\t\t\t/**\n\t\t\t * Fires after the Edit Category form fields are displayed.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t * @deprecated 3.0.0 Use {@see '{$taxonomy}_edit_form_fields'} instead.\n\t\t\t *\n\t\t\t * @param WP_Term $tag Current category term object.\n\t\t\t */\n\t\t\tdo_action_deprecated( 'edit_category_form_fields', array( $tag ), '3.0.0', '{$taxonomy}_edit_form_fields' );\n\t\t} elseif ( 'link_category' === $taxonomy ) {\n\t\t\t/**\n\t\t\t * Fires after the Edit Link Category form fields are displayed.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t * @deprecated 3.0.0 Use {@see '{$taxonomy}_edit_form_fields'} instead.\n\t\t\t *\n\t\t\t * @param WP_Term $tag Current link category term object.\n\t\t\t */\n\t\t\tdo_action_deprecated( 'edit_link_category_form_fields', array( $tag ), '3.0.0', '{$taxonomy}_edit_form_fields' );\n\t\t} else {\n\t\t\t/**\n\t\t\t * Fires after the Edit Tag form fields are displayed.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t * @deprecated 3.0.0 Use {@see '{$taxonomy}_edit_form_fields'} instead.\n\t\t\t *\n\t\t\t * @param WP_Term $tag Current tag term object.\n\t\t\t */\n\t\t\tdo_action_deprecated( 'edit_tag_form_fields', array( $tag ), '3.0.0', '{$taxonomy}_edit_form_fields' );\n\t\t}\n\t\t/**\n\t\t * Fires after the Edit Term form fields are displayed.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$taxonomy`, refers to\n\t\t * the taxonomy slug.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param WP_Term $tag      Current taxonomy term object.\n\t\t * @param string  $taxonomy Current taxonomy slug.\n\t\t */\n\t\tdo_action( \"{$taxonomy}_edit_form_fields\", $tag, $taxonomy );\n\t\t?>\n\t</table>\n<?php\n// Back compat hooks.\nif ( 'category' === $taxonomy ) {\n\t/** This action is documented in wp-admin/edit-tags.php */\n\tdo_action_deprecated( 'edit_category_form', array( $tag ), '3.0.0', '{$taxonomy}_add_form' );\n} elseif ( 'link_category' === $taxonomy ) {\n\t/** This action is documented in wp-admin/edit-tags.php */\n\tdo_action_deprecated( 'edit_link_category_form', array( $tag ), '3.0.0', '{$taxonomy}_add_form' );\n} else {\n\t/**\n\t * Fires at the end of the Edit Term form.\n\t *\n\t * @since 2.5.0\n\t * @deprecated 3.0.0 Use {@see '{$taxonomy}_edit_form'} instead.\n\t *\n\t * @param WP_Term $tag Current taxonomy term object.\n\t */\n\tdo_action_deprecated( 'edit_tag_form', array( $tag ), '3.0.0', '{$taxonomy}_edit_form' );\n}\n/**\n * Fires at the end of the Edit Term form for all taxonomies.\n *\n * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.\n *\n * @since 3.0.0\n *\n * @param WP_Term $tag      Current taxonomy term object.\n * @param string  $taxonomy Current taxonomy slug.\n */\ndo_action( \"{$taxonomy}_edit_form\", $tag, $taxonomy );\n?>\n\n<div class=\"edit-tag-actions\">\n\n\t<?php submit_button( __( 'Update' ), 'primary', null, false ); ?>\n\n\t<?php if ( current_user_can( 'delete_term', $tag->term_id ) ) : ?>\n\t\t<span id=\"delete-link\">\n\t\t\t<a class=\"delete\" href=\"<?php echo admin_url( wp_nonce_url( \"edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id\", 'delete-tag_' . $tag->term_id ) ); ?>\"><?php _e( 'Delete' ); ?></a>\n\t\t</span>\n\t<?php endif; ?>\n\n</div>\n\n</form>\n</div>\n\n<?php if ( ! wp_is_mobile() ) : ?>\n<script type=\"text/javascript\">\ntry{document.forms.edittag.name.focus();}catch(e){}\n</script>\n\t<?php\nendif;\n", "num_lines": 293}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit Tags Administration Screen.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! $taxnow ) {\n\twp_die( __( 'Invalid taxonomy.' ) );\n}\n\n$tax = get_taxonomy( $taxnow );\n\nif ( ! $tax ) {\n\twp_die( __( 'Invalid taxonomy.' ) );\n}\n\nif ( ! in_array( $tax->name, get_taxonomies( array( 'show_ui' => true ) ), true ) ) {\n\twp_die( __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ) );\n}\n\nif ( ! current_user_can( $tax->cap->manage_terms ) ) {\n\twp_die(\n\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t'<p>' . __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ) . '</p>',\n\t\t403\n\t);\n}\n\n/**\n * $post_type is set when the WP_Terms_List_Table instance is created\n *\n * @global string $post_type\n */\nglobal $post_type;\n\n$wp_list_table = _get_list_table( 'WP_Terms_List_Table' );\n$pagenum       = $wp_list_table->get_pagenum();\n\n$title = $tax->labels->name;\n\nif ( 'post' !== $post_type ) {\n\t$parent_file  = ( 'attachment' === $post_type ) ? 'upload.php' : \"edit.php?post_type=$post_type\";\n\t$submenu_file = \"edit-tags.php?taxonomy=$taxonomy&amp;post_type=$post_type\";\n} elseif ( 'link_category' === $tax->name ) {\n\t$parent_file  = 'link-manager.php';\n\t$submenu_file = 'edit-tags.php?taxonomy=link_category';\n} else {\n\t$parent_file  = 'edit.php';\n\t$submenu_file = \"edit-tags.php?taxonomy=$taxonomy\";\n}\n\nadd_screen_option(\n\t'per_page',\n\tarray(\n\t\t'default' => 20,\n\t\t'option'  => 'edit_' . $tax->name . '_per_page',\n\t)\n);\n\nget_current_screen()->set_screen_reader_content(\n\tarray(\n\t\t'heading_pagination' => $tax->labels->items_list_navigation,\n\t\t'heading_list'       => $tax->labels->items_list,\n\t)\n);\n\n$location = false;\n$referer  = wp_get_referer();\nif ( ! $referer ) { // For POST requests.\n\t$referer = wp_unslash( $_SERVER['REQUEST_URI'] );\n}\n$referer = remove_query_arg( array( '_wp_http_referer', '_wpnonce', 'error', 'message', 'paged' ), $referer );\nswitch ( $wp_list_table->current_action() ) {\n\n\tcase 'add-tag':\n\t\tcheck_admin_referer( 'add-tag', '_wpnonce_add-tag' );\n\n\t\tif ( ! current_user_can( $tax->cap->edit_terms ) ) {\n\t\t\twp_die(\n\t\t\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t\t\t'<p>' . __( 'Sorry, you are not allowed to create terms in this taxonomy.' ) . '</p>',\n\t\t\t\t403\n\t\t\t);\n\t\t}\n\n\t\t$ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );\n\t\tif ( $ret && ! is_wp_error( $ret ) ) {\n\t\t\t$location = add_query_arg( 'message', 1, $referer );\n\t\t} else {\n\t\t\t$location = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'error'   => true,\n\t\t\t\t\t'message' => 4,\n\t\t\t\t),\n\t\t\t\t$referer\n\t\t\t);\n\t\t}\n\n\t\tbreak;\n\n\tcase 'delete':\n\t\tif ( ! isset( $_REQUEST['tag_ID'] ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\t$tag_ID = (int) $_REQUEST['tag_ID'];\n\t\tcheck_admin_referer( 'delete-tag_' . $tag_ID );\n\n\t\tif ( ! current_user_can( 'delete_term', $tag_ID ) ) {\n\t\t\twp_die(\n\t\t\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t\t\t'<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>',\n\t\t\t\t403\n\t\t\t);\n\t\t}\n\n\t\twp_delete_term( $tag_ID, $taxonomy );\n\n\t\t$location = add_query_arg( 'message', 2, $referer );\n\n\t\t// When deleting a term, prevent the action from redirecting back to a term that no longer exists.\n\t\t$location = remove_query_arg( array( 'tag_ID', 'action' ), $location );\n\n\t\tbreak;\n\n\tcase 'bulk-delete':\n\t\tcheck_admin_referer( 'bulk-tags' );\n\n\t\tif ( ! current_user_can( $tax->cap->delete_terms ) ) {\n\t\t\twp_die(\n\t\t\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t\t\t'<p>' . __( 'Sorry, you are not allowed to delete these items.' ) . '</p>',\n\t\t\t\t403\n\t\t\t);\n\t\t}\n\n\t\t$tags = (array) $_REQUEST['delete_tags'];\n\t\tforeach ( $tags as $tag_ID ) {\n\t\t\twp_delete_term( $tag_ID, $taxonomy );\n\t\t}\n\n\t\t$location = add_query_arg( 'message', 6, $referer );\n\n\t\tbreak;\n\n\tcase 'edit':\n\t\tif ( ! isset( $_REQUEST['tag_ID'] ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\t$term_id = (int) $_REQUEST['tag_ID'];\n\t\t$term    = get_term( $term_id );\n\n\t\tif ( ! $term instanceof WP_Term ) {\n\t\t\twp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );\n\t\t}\n\n\t\twp_redirect( esc_url_raw( get_edit_term_link( $term_id, $taxonomy, $post_type ) ) );\n\t\texit;\n\n\tcase 'editedtag':\n\t\t$tag_ID = (int) $_POST['tag_ID'];\n\t\tcheck_admin_referer( 'update-tag_' . $tag_ID );\n\n\t\tif ( ! current_user_can( 'edit_term', $tag_ID ) ) {\n\t\t\twp_die(\n\t\t\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t\t\t'<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',\n\t\t\t\t403\n\t\t\t);\n\t\t}\n\n\t\t$tag = get_term( $tag_ID, $taxonomy );\n\t\tif ( ! $tag ) {\n\t\t\twp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );\n\t\t}\n\n\t\t$ret = wp_update_term( $tag_ID, $taxonomy, $_POST );\n\n\t\tif ( $ret && ! is_wp_error( $ret ) ) {\n\t\t\t$location = add_query_arg( 'message', 3, $referer );\n\t\t} else {\n\t\t\t$location = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'error'   => true,\n\t\t\t\t\t'message' => 5,\n\t\t\t\t),\n\t\t\t\t$referer\n\t\t\t);\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tif ( ! $wp_list_table->current_action() || ! isset( $_REQUEST['delete_tags'] ) ) {\n\t\t\tbreak;\n\t\t}\n\t\tcheck_admin_referer( 'bulk-tags' );\n\n\t\t$screen = get_current_screen()->id;\n\t\t$tags   = (array) $_REQUEST['delete_tags'];\n\n\t\t/** This action is documented in wp-admin/edit.php */\n\t\t$location = apply_filters( \"handle_bulk_actions-{$screen}\", $location, $wp_list_table->current_action(), $tags ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t\tbreak;\n}\n\nif ( ! $location && ! empty( $_REQUEST['_wp_http_referer'] ) ) {\n\t$location = remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) );\n}\n\nif ( $location ) {\n\tif ( $pagenum > 1 ) {\n\t\t$location = add_query_arg( 'paged', $pagenum, $location ); // $pagenum takes care of $total_pages.\n\t}\n\n\t/**\n\t * Filters the taxonomy redirect destination URL.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string      $location The destination URL.\n\t * @param WP_Taxonomy $tax      The taxonomy object.\n\t */\n\twp_redirect( apply_filters( 'redirect_term_location', $location, $tax ) );\n\texit;\n}\n\n$wp_list_table->prepare_items();\n$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );\n\nif ( $pagenum > $total_pages && $total_pages > 0 ) {\n\twp_redirect( add_query_arg( 'paged', $total_pages ) );\n\texit;\n}\n\nwp_enqueue_script( 'admin-tags' );\nif ( current_user_can( $tax->cap->edit_terms ) ) {\n\twp_enqueue_script( 'inline-edit-tax' );\n}\n\nif ( 'category' === $taxonomy || 'link_category' === $taxonomy || 'post_tag' === $taxonomy ) {\n\t$help = '';\n\tif ( 'category' === $taxonomy ) {\n\t\t$help = '<p>' . sprintf(\n\t\t\t/* translators: %s: URL to Writing Settings screen. */\n\t\t\t__( 'You can use categories to define sections of your site and group related posts. The default category is &#8220;Uncategorized&#8221; until you change it in your <a href=\"%s\">writing settings</a>.' ),\n\t\t\t'options-writing.php'\n\t\t) . '</p>';\n\t} elseif ( 'link_category' === $taxonomy ) {\n\t\t$help = '<p>' . __( 'You can create groups of links by using Link Categories. Link Category names must be unique and Link Categories are separate from the categories you use for posts.' ) . '</p>';\n\t} else {\n\t\t$help = '<p>' . __( 'You can assign keywords to your posts using <strong>tags</strong>. Unlike categories, tags have no hierarchy, meaning there&#8217;s no relationship from one tag to another.' ) . '</p>';\n\t}\n\n\tif ( 'link_category' === $taxonomy ) {\n\t\t$help .= '<p>' . __( 'You can delete Link Categories in the Bulk Action pull-down, but that action does not delete the links within the category. Instead, it moves them to the default Link Category.' ) . '</p>';\n\t} else {\n\t\t$help .= '<p>' . __( 'What&#8217;s the difference between categories and tags? Normally, tags are ad-hoc keywords that identify important information in your post (names, subjects, etc) that may or may not recur in other posts, while categories are pre-determined sections. If you think of your site like a book, the categories are like the Table of Contents and the tags are like the terms in the index.' ) . '</p>';\n\t}\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'overview',\n\t\t\t'title'   => __( 'Overview' ),\n\t\t\t'content' => $help,\n\t\t)\n\t);\n\n\tif ( 'category' === $taxonomy || 'post_tag' === $taxonomy ) {\n\t\tif ( 'category' === $taxonomy ) {\n\t\t\t$help = '<p>' . __( 'When adding a new category on this screen, you&#8217;ll fill in the following fields:' ) . '</p>';\n\t\t} else {\n\t\t\t$help = '<p>' . __( 'When adding a new tag on this screen, you&#8217;ll fill in the following fields:' ) . '</p>';\n\t\t}\n\n\t\t$help .= '<ul>' .\n\t\t'<li>' . __( '<strong>Name</strong> &mdash; The name is how it appears on your site.' ) . '</li>';\n\n\t\tif ( ! global_terms_enabled() ) {\n\t\t\t$help .= '<li>' . __( '<strong>Slug</strong> &mdash; The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) . '</li>';\n\t\t}\n\n\t\tif ( 'category' === $taxonomy ) {\n\t\t\t$help .= '<li>' . __( '<strong>Parent</strong> &mdash; Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have child categories for Bebop and Big Band. Totally optional. To create a subcategory, just choose another category from the Parent dropdown.' ) . '</li>';\n\t\t}\n\n\t\t$help .= '<li>' . __( '<strong>Description</strong> &mdash; The description is not prominent by default; however, some themes may display it.' ) . '</li>' .\n\t\t'</ul>' .\n\t\t'<p>' . __( 'You can change the display of this screen using the Screen Options tab to set how many items are displayed per screen and to display/hide columns in the table.' ) . '</p>';\n\n\t\tget_current_screen()->add_help_tab(\n\t\t\tarray(\n\t\t\t\t'id'      => 'adding-terms',\n\t\t\t\t'title'   => 'category' === $taxonomy ? __( 'Adding Categories' ) : __( 'Adding Tags' ),\n\t\t\t\t'content' => $help,\n\t\t\t)\n\t\t);\n\t}\n\n\t$help = '<p><strong>' . __( 'For more information:' ) . '</strong></p>';\n\n\tif ( 'category' === $taxonomy ) {\n\t\t$help .= '<p>' . __( '<a href=\"https://wordpress.org/support/article/posts-categories-screen/\">Documentation on Categories</a>' ) . '</p>';\n\t} elseif ( 'link_category' === $taxonomy ) {\n\t\t$help .= '<p>' . __( '<a href=\"https://codex.wordpress.org/Links_Link_Categories_Screen\">Documentation on Link Categories</a>' ) . '</p>';\n\t} else {\n\t\t$help .= '<p>' . __( '<a href=\"https://wordpress.org/support/article/posts-tags-screen/\">Documentation on Tags</a>' ) . '</p>';\n\t}\n\n\t$help .= '<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>';\n\n\tget_current_screen()->set_help_sidebar( $help );\n\n\tunset( $help );\n}\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n/** Also used by the Edit Tag  form */\nrequire_once ABSPATH . 'wp-admin/includes/edit-tag-messages.php';\n\n$class = ( isset( $_REQUEST['error'] ) ) ? 'error' : 'updated';\n\nif ( is_plugin_active( 'wpcat2tag-importer/wpcat2tag-importer.php' ) ) {\n\t$import_link = admin_url( 'admin.php?import=wpcat2tag' );\n} else {\n\t$import_link = admin_url( 'import.php' );\n}\n\n?>\n\n<div class=\"wrap nosubsub\">\n<h1 class=\"wp-heading-inline\"><?php echo esc_html( $title ); ?></h1>\n\n<?php\nif ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {\n\t/* translators: %s: Search query. */\n\tprintf( '<span class=\"subtitle\">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( wp_unslash( $_REQUEST['s'] ) ) );\n}\n?>\n\n<hr class=\"wp-header-end\">\n\n<?php if ( $message ) : ?>\n<div id=\"message\" class=\"<?php echo $class; ?> notice is-dismissible\"><p><?php echo $message; ?></p></div>\n\t<?php\n\t$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'message', 'error' ), $_SERVER['REQUEST_URI'] );\nendif;\n?>\n<div id=\"ajax-response\"></div>\n\n<form class=\"search-form wp-clearfix\" method=\"get\">\n<input type=\"hidden\" name=\"taxonomy\" value=\"<?php echo esc_attr( $taxonomy ); ?>\" />\n<input type=\"hidden\" name=\"post_type\" value=\"<?php echo esc_attr( $post_type ); ?>\" />\n\n<?php $wp_list_table->search_box( $tax->labels->search_items, 'tag' ); ?>\n\n</form>\n\n<?php\n$can_edit_terms = current_user_can( $tax->cap->edit_terms );\n\nif ( $can_edit_terms ) {\n\t?>\n<div id=\"col-container\" class=\"wp-clearfix\">\n\n<div id=\"col-left\">\n<div class=\"col-wrap\">\n\n\t<?php\n\tif ( 'category' === $taxonomy ) {\n\t\t/**\n\t\t * Fires before the Add Category form.\n\t\t *\n\t\t * @since 2.1.0\n\t\t * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_add_form'} instead.\n\t\t *\n\t\t * @param object $arg Optional arguments cast to an object.\n\t\t */\n\t\tdo_action_deprecated( 'add_category_form_pre', array( (object) array( 'parent' => 0 ) ), '3.0.0', '{$taxonomy}_pre_add_form' );\n\t} elseif ( 'link_category' === $taxonomy ) {\n\t\t/**\n\t\t * Fires before the link category form.\n\t\t *\n\t\t * @since 2.3.0\n\t\t * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_add_form'} instead.\n\t\t *\n\t\t * @param object $arg Optional arguments cast to an object.\n\t\t */\n\t\tdo_action_deprecated( 'add_link_category_form_pre', array( (object) array( 'parent' => 0 ) ), '3.0.0', '{$taxonomy}_pre_add_form' );\n\t} else {\n\t\t/**\n\t\t * Fires before the Add Tag form.\n\t\t *\n\t\t * @since 2.5.0\n\t\t * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_add_form'} instead.\n\t\t *\n\t\t * @param string $taxonomy The taxonomy slug.\n\t\t */\n\t\tdo_action_deprecated( 'add_tag_form_pre', array( $taxonomy ), '3.0.0', '{$taxonomy}_pre_add_form' );\n\t}\n\n\t/**\n\t * Fires before the Add Term form for all taxonomies.\n\t *\n\t * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $taxonomy The taxonomy slug.\n\t */\n\tdo_action( \"{$taxonomy}_pre_add_form\", $taxonomy );\n\t?>\n\n<div class=\"form-wrap\">\n<h2><?php echo $tax->labels->add_new_item; ?></h2>\n<form id=\"addtag\" method=\"post\" action=\"edit-tags.php\" class=\"validate\"\n\t<?php\n\t/**\n\t * Fires inside the Add Tag form tag.\n\t *\n\t * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.\n\t *\n\t * @since 3.7.0\n\t */\n\tdo_action( \"{$taxonomy}_term_new_form_tag\" );\n\t?>\n>\n<input type=\"hidden\" name=\"action\" value=\"add-tag\" />\n<input type=\"hidden\" name=\"screen\" value=\"<?php echo esc_attr( $current_screen->id ); ?>\" />\n<input type=\"hidden\" name=\"taxonomy\" value=\"<?php echo esc_attr( $taxonomy ); ?>\" />\n<input type=\"hidden\" name=\"post_type\" value=\"<?php echo esc_attr( $post_type ); ?>\" />\n\t<?php wp_nonce_field( 'add-tag', '_wpnonce_add-tag' ); ?>\n\n<div class=\"form-field form-required term-name-wrap\">\n\t<label for=\"tag-name\"><?php _ex( 'Name', 'term name' ); ?></label>\n\t<input name=\"tag-name\" id=\"tag-name\" type=\"text\" value=\"\" size=\"40\" aria-required=\"true\" />\n\t<p><?php _e( 'The name is how it appears on your site.' ); ?></p>\n</div>\n\t<?php if ( ! global_terms_enabled() ) : ?>\n<div class=\"form-field term-slug-wrap\">\n\t<label for=\"tag-slug\"><?php _e( 'Slug' ); ?></label>\n\t<input name=\"slug\" id=\"tag-slug\" type=\"text\" value=\"\" size=\"40\" />\n\t<p><?php _e( 'The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ); ?></p>\n</div>\n<?php endif; // global_terms_enabled() ?>\n\t<?php if ( is_taxonomy_hierarchical( $taxonomy ) ) : ?>\n<div class=\"form-field term-parent-wrap\">\n\t<label for=\"parent\"><?php echo esc_html( $tax->labels->parent_item ); ?></label>\n\t\t<?php\n\t\t$dropdown_args = array(\n\t\t\t'hide_empty'       => 0,\n\t\t\t'hide_if_empty'    => false,\n\t\t\t'taxonomy'         => $taxonomy,\n\t\t\t'name'             => 'parent',\n\t\t\t'orderby'          => 'name',\n\t\t\t'hierarchical'     => true,\n\t\t\t'show_option_none' => __( 'None' ),\n\t\t);\n\n\t\t/**\n\t\t * Filters the taxonomy parent drop-down on the Edit Term page.\n\t\t *\n\t\t * @since 3.7.0\n\t\t * @since 4.2.0 Added `$context` parameter.\n\t\t *\n\t\t * @param array  $dropdown_args {\n\t\t *     An array of taxonomy parent drop-down arguments.\n\t\t *\n\t\t *     @type int|bool $hide_empty       Whether to hide terms not attached to any posts. Default 0|false.\n\t\t *     @type bool     $hide_if_empty    Whether to hide the drop-down if no terms exist. Default false.\n\t\t *     @type string   $taxonomy         The taxonomy slug.\n\t\t *     @type string   $name             Value of the name attribute to use for the drop-down select element.\n\t\t *                                      Default 'parent'.\n\t\t *     @type string   $orderby          The field to order by. Default 'name'.\n\t\t *     @type bool     $hierarchical     Whether the taxonomy is hierarchical. Default true.\n\t\t *     @type string   $show_option_none Label to display if there are no terms. Default 'None'.\n\t\t * }\n\t\t * @param string $taxonomy The taxonomy slug.\n\t\t * @param string $context  Filter context. Accepts 'new' or 'edit'.\n\t\t */\n\t\t$dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'new' );\n\n\t\twp_dropdown_categories( $dropdown_args );\n\t\t?>\n\t\t<?php if ( 'category' === $taxonomy ) : ?>\n\t\t<p><?php _e( 'Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.' ); ?></p>\n\t<?php else : ?>\n\t\t<p><?php _e( 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.' ); ?></p>\n\t<?php endif; ?>\n</div>\n\t<?php endif; // is_taxonomy_hierarchical() ?>\n<div class=\"form-field term-description-wrap\">\n\t<label for=\"tag-description\"><?php _e( 'Description' ); ?></label>\n\t<textarea name=\"description\" id=\"tag-description\" rows=\"5\" cols=\"40\"></textarea>\n\t<p><?php _e( 'The description is not prominent by default; however, some themes may show it.' ); ?></p>\n</div>\n\n\t<?php\n\tif ( ! is_taxonomy_hierarchical( $taxonomy ) ) {\n\t\t/**\n\t\t * Fires after the Add Tag form fields for non-hierarchical taxonomies.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string $taxonomy The taxonomy slug.\n\t\t */\n\t\tdo_action( 'add_tag_form_fields', $taxonomy );\n\t}\n\n\t/**\n\t * Fires after the Add Term form fields.\n\t *\n\t * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $taxonomy The taxonomy slug.\n\t */\n\tdo_action( \"{$taxonomy}_add_form_fields\", $taxonomy );\n\t?>\n\t<p class=\"submit\">\n\t\t<?php submit_button( $tax->labels->add_new_item, 'primary', 'submit', false ); ?>\n\t\t<span class=\"spinner\"></span>\n\t</p>\n\t<?php\n\tif ( 'category' === $taxonomy ) {\n\t\t/**\n\t\t * Fires at the end of the Edit Category form.\n\t\t *\n\t\t * @since 2.1.0\n\t\t * @deprecated 3.0.0 Use {@see '{$taxonomy}_add_form'} instead.\n\t\t *\n\t\t * @param object $arg Optional arguments cast to an object.\n\t\t */\n\t\tdo_action_deprecated( 'edit_category_form', array( (object) array( 'parent' => 0 ) ), '3.0.0', '{$taxonomy}_add_form' );\n\t} elseif ( 'link_category' === $taxonomy ) {\n\t\t/**\n\t\t * Fires at the end of the Edit Link form.\n\t\t *\n\t\t * @since 2.3.0\n\t\t * @deprecated 3.0.0 Use {@see '{$taxonomy}_add_form'} instead.\n\t\t *\n\t\t * @param object $arg Optional arguments cast to an object.\n\t\t */\n\t\tdo_action_deprecated( 'edit_link_category_form', array( (object) array( 'parent' => 0 ) ), '3.0.0', '{$taxonomy}_add_form' );\n\t} else {\n\t\t/**\n\t\t * Fires at the end of the Add Tag form.\n\t\t *\n\t\t * @since 2.7.0\n\t\t * @deprecated 3.0.0 Use {@see '{$taxonomy}_add_form'} instead.\n\t\t *\n\t\t * @param string $taxonomy The taxonomy slug.\n\t\t */\n\t\tdo_action_deprecated( 'add_tag_form', array( $taxonomy ), '3.0.0', '{$taxonomy}_add_form' );\n\t}\n\n\t/**\n\t * Fires at the end of the Add Term form for all taxonomies.\n\t *\n\t * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $taxonomy The taxonomy slug.\n\t */\n\tdo_action( \"{$taxonomy}_add_form\", $taxonomy );\n\t?>\n</form></div>\n</div>\n</div><!-- /col-left -->\n\n<div id=\"col-right\">\n<div class=\"col-wrap\">\n<?php } ?>\n\n<?php $wp_list_table->views(); ?>\n\n<form id=\"posts-filter\" method=\"post\">\n<input type=\"hidden\" name=\"taxonomy\" value=\"<?php echo esc_attr( $taxonomy ); ?>\" />\n<input type=\"hidden\" name=\"post_type\" value=\"<?php echo esc_attr( $post_type ); ?>\" />\n\n<?php $wp_list_table->display(); ?>\n\n</form>\n\n<?php if ( 'category' === $taxonomy ) : ?>\n<div class=\"form-wrap edit-term-notes\">\n<p>\n\t<?php\n\tprintf(\n\t\t/* translators: %s: Default category. */\n\t\t__( 'Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the default category %s. The default category cannot be deleted.' ),\n\t\t/** This filter is documented in wp-includes/category-template.php */\n\t\t'<strong>' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category' ) ), '', '' ) . '</strong>'\n\t);\n\t?>\n</p>\n\t<?php if ( current_user_can( 'import' ) ) : ?>\n\t<p>\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: URL to Categories to Tags Converter tool. */\n\t\t\t__( 'Categories can be selectively converted to tags using the <a href=\"%s\">category to tag converter</a>.' ),\n\t\t\tesc_url( $import_link )\n\t\t);\n\t\t?>\n\t</p>\n\t<?php endif; ?>\n</div>\n<?php elseif ( 'post_tag' === $taxonomy && current_user_can( 'import' ) ) : ?>\n<div class=\"form-wrap edit-term-notes\">\n<p>\n\t<?php\n\tprintf(\n\t\t/* translators: %s: URL to Categories to Tags Converter tool. */\n\t\t__( 'Tags can be selectively converted to categories using the <a href=\"%s\">tag to category converter</a>.' ),\n\t\tesc_url( $import_link )\n\t);\n\t?>\n\t</p>\n</div>\n\t<?php\nendif;\n\n/**\n * Fires after the taxonomy list table.\n *\n * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.\n *\n * @since 3.0.0\n *\n * @param string $taxonomy The taxonomy name.\n */\ndo_action( \"after-{$taxonomy}-table\", $taxonomy );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\nif ( $can_edit_terms ) {\n\t?>\n</div>\n</div><!-- /col-right -->\n\n</div><!-- /col-container -->\n<?php } ?>\n\n</div><!-- /wrap -->\n\n<?php if ( ! wp_is_mobile() ) : ?>\n<script type=\"text/javascript\">\ntry{document.forms.addtag['tag-name'].focus();}catch(e){}\n</script>\n\t<?php\nendif;\n\n$wp_list_table->inline_edit();\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 662}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit Posts Administration Screen.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! $typenow ) {\n\twp_die( __( 'Invalid post type.' ) );\n}\n\nif ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ), true ) ) {\n\twp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) );\n}\n\nif ( 'attachment' === $typenow ) {\n\tif ( wp_redirect( admin_url( 'upload.php' ) ) ) {\n\t\texit;\n\t}\n}\n\n/**\n * @global string       $post_type\n * @global WP_Post_Type $post_type_object\n */\nglobal $post_type, $post_type_object;\n\n$post_type        = $typenow;\n$post_type_object = get_post_type_object( $post_type );\n\nif ( ! $post_type_object ) {\n\twp_die( __( 'Invalid post type.' ) );\n}\n\nif ( ! current_user_can( $post_type_object->cap->edit_posts ) ) {\n\twp_die(\n\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t'<p>' . __( 'Sorry, you are not allowed to edit posts in this post type.' ) . '</p>',\n\t\t403\n\t);\n}\n\n$wp_list_table = _get_list_table( 'WP_Posts_List_Table' );\n$pagenum       = $wp_list_table->get_pagenum();\n\n// Back-compat for viewing comments of an entry.\nforeach ( array( 'p', 'attachment_id', 'page_id' ) as $_redirect ) {\n\tif ( ! empty( $_REQUEST[ $_redirect ] ) ) {\n\t\twp_redirect( admin_url( 'edit-comments.php?p=' . absint( $_REQUEST[ $_redirect ] ) ) );\n\t\texit;\n\t}\n}\nunset( $_redirect );\n\nif ( 'post' !== $post_type ) {\n\t$parent_file   = \"edit.php?post_type=$post_type\";\n\t$submenu_file  = \"edit.php?post_type=$post_type\";\n\t$post_new_file = \"post-new.php?post_type=$post_type\";\n} else {\n\t$parent_file   = 'edit.php';\n\t$submenu_file  = 'edit.php';\n\t$post_new_file = 'post-new.php';\n}\n\n$doaction = $wp_list_table->current_action();\n\nif ( $doaction ) {\n\tcheck_admin_referer( 'bulk-posts' );\n\n\t$sendback = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'locked', 'ids' ), wp_get_referer() );\n\tif ( ! $sendback ) {\n\t\t$sendback = admin_url( $parent_file );\n\t}\n\t$sendback = add_query_arg( 'paged', $pagenum, $sendback );\n\tif ( strpos( $sendback, 'post.php' ) !== false ) {\n\t\t$sendback = admin_url( $post_new_file );\n\t}\n\n\tif ( 'delete_all' === $doaction ) {\n\t\t// Prepare for deletion of all posts with a specified post status (i.e. Empty Trash).\n\t\t$post_status = preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['post_status'] );\n\t\t// Validate the post status exists.\n\t\tif ( get_post_status_object( $post_status ) ) {\n\t\t\t$post_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE post_type=%s AND post_status = %s\", $post_type, $post_status ) );\n\t\t}\n\t\t$doaction = 'delete';\n\t} elseif ( isset( $_REQUEST['media'] ) ) {\n\t\t$post_ids = $_REQUEST['media'];\n\t} elseif ( isset( $_REQUEST['ids'] ) ) {\n\t\t$post_ids = explode( ',', $_REQUEST['ids'] );\n\t} elseif ( ! empty( $_REQUEST['post'] ) ) {\n\t\t$post_ids = array_map( 'intval', $_REQUEST['post'] );\n\t}\n\n\tif ( ! isset( $post_ids ) ) {\n\t\twp_redirect( $sendback );\n\t\texit;\n\t}\n\n\tswitch ( $doaction ) {\n\t\tcase 'trash':\n\t\t\t$trashed = 0;\n\t\t\t$locked  = 0;\n\n\t\t\tforeach ( (array) $post_ids as $post_id ) {\n\t\t\t\tif ( ! current_user_can( 'delete_post', $post_id ) ) {\n\t\t\t\t\twp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) );\n\t\t\t\t}\n\n\t\t\t\tif ( wp_check_post_lock( $post_id ) ) {\n\t\t\t\t\t$locked++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( ! wp_trash_post( $post_id ) ) {\n\t\t\t\t\twp_die( __( 'Error in moving the item to Trash.' ) );\n\t\t\t\t}\n\n\t\t\t\t$trashed++;\n\t\t\t}\n\n\t\t\t$sendback = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'trashed' => $trashed,\n\t\t\t\t\t'ids'     => join( ',', $post_ids ),\n\t\t\t\t\t'locked'  => $locked,\n\t\t\t\t),\n\t\t\t\t$sendback\n\t\t\t);\n\t\t\tbreak;\n\t\tcase 'untrash':\n\t\t\t$untrashed = 0;\n\t\t\tforeach ( (array) $post_ids as $post_id ) {\n\t\t\t\tif ( ! current_user_can( 'delete_post', $post_id ) ) {\n\t\t\t\t\twp_die( __( 'Sorry, you are not allowed to restore this item from the Trash.' ) );\n\t\t\t\t}\n\n\t\t\t\tif ( ! wp_untrash_post( $post_id ) ) {\n\t\t\t\t\twp_die( __( 'Error in restoring the item from Trash.' ) );\n\t\t\t\t}\n\n\t\t\t\t$untrashed++;\n\t\t\t}\n\t\t\t$sendback = add_query_arg( 'untrashed', $untrashed, $sendback );\n\t\t\tbreak;\n\t\tcase 'delete':\n\t\t\t$deleted = 0;\n\t\t\tforeach ( (array) $post_ids as $post_id ) {\n\t\t\t\t$post_del = get_post( $post_id );\n\n\t\t\t\tif ( ! current_user_can( 'delete_post', $post_id ) ) {\n\t\t\t\t\twp_die( __( 'Sorry, you are not allowed to delete this item.' ) );\n\t\t\t\t}\n\n\t\t\t\tif ( 'attachment' === $post_del->post_type ) {\n\t\t\t\t\tif ( ! wp_delete_attachment( $post_id ) ) {\n\t\t\t\t\t\twp_die( __( 'Error in deleting the attachment.' ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( ! wp_delete_post( $post_id ) ) {\n\t\t\t\t\t\twp_die( __( 'Error in deleting the item.' ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$deleted++;\n\t\t\t}\n\t\t\t$sendback = add_query_arg( 'deleted', $deleted, $sendback );\n\t\t\tbreak;\n\t\tcase 'edit':\n\t\t\tif ( isset( $_REQUEST['bulk_edit'] ) ) {\n\t\t\t\t$done = bulk_edit_posts( $_REQUEST );\n\n\t\t\t\tif ( is_array( $done ) ) {\n\t\t\t\t\t$done['updated'] = count( $done['updated'] );\n\t\t\t\t\t$done['skipped'] = count( $done['skipped'] );\n\t\t\t\t\t$done['locked']  = count( $done['locked'] );\n\t\t\t\t\t$sendback        = add_query_arg( $done, $sendback );\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$screen = get_current_screen()->id;\n\n\t\t\t/**\n\t\t\t * Fires when a custom bulk action should be handled.\n\t\t\t *\n\t\t\t * The redirect link should be modified with success or failure feedback\n\t\t\t * from the action to be used to display feedback to the user.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$screen`, refers to the current screen ID.\n\t\t\t *\n\t\t\t * @since 4.7.0\n\t\t\t *\n\t\t\t * @param string $sendback The redirect URL.\n\t\t\t * @param string $doaction The action being taken.\n\t\t\t * @param array  $items    The items to take the action on. Accepts an array of IDs of posts,\n\t\t\t *                         comments, terms, links, plugins, attachments, or users.\n\t\t\t */\n\t\t\t$sendback = apply_filters( \"handle_bulk_actions-{$screen}\", $sendback, $doaction, $post_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t\t\tbreak;\n\t}\n\n\t$sendback = remove_query_arg( array( 'action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view' ), $sendback );\n\n\twp_redirect( $sendback );\n\texit;\n} elseif ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {\n\twp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );\n\texit;\n}\n\n$wp_list_table->prepare_items();\n\nwp_enqueue_script( 'inline-edit-post' );\nwp_enqueue_script( 'heartbeat' );\n\nif ( 'wp_block' === $post_type ) {\n\twp_enqueue_script( 'wp-list-reusable-blocks' );\n\twp_enqueue_style( 'wp-list-reusable-blocks' );\n}\n\n$title = $post_type_object->labels->name;\n\nif ( 'post' === $post_type ) {\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'overview',\n\t\t\t'title'   => __( 'Overview' ),\n\t\t\t'content' =>\n\t\t\t\t\t'<p>' . __( 'This screen provides access to all of your posts. You can customize the display of this screen to suit your workflow.' ) . '</p>',\n\t\t)\n\t);\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'screen-content',\n\t\t\t'title'   => __( 'Screen Content' ),\n\t\t\t'content' =>\n\t\t\t\t\t'<p>' . __( 'You can customize the display of this screen&#8217;s contents in a number of ways:' ) . '</p>' .\n\t\t\t\t\t'<ul>' .\n\t\t\t\t\t\t'<li>' . __( 'You can hide/display columns based on your needs and decide how many posts to list per screen using the Screen Options tab.' ) . '</li>' .\n\t\t\t\t\t\t'<li>' . __( 'You can filter the list of posts by post status using the text links above the posts list to only show posts with that status. The default view is to show all posts.' ) . '</li>' .\n\t\t\t\t\t\t'<li>' . __( 'You can view posts in a simple title list or with an excerpt using the Screen Options tab.' ) . '</li>' .\n\t\t\t\t\t\t'<li>' . __( 'You can refine the list to show only posts in a specific category or from a specific month by using the dropdown menus above the posts list. Click the Filter button after making your selection. You also can refine the list by clicking on the post author, category or tag in the posts list.' ) . '</li>' .\n\t\t\t\t\t'</ul>',\n\t\t)\n\t);\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'action-links',\n\t\t\t'title'   => __( 'Available Actions' ),\n\t\t\t'content' =>\n\t\t\t\t\t'<p>' . __( 'Hovering over a row in the posts list will display action links that allow you to manage your post. You can perform the following actions:' ) . '</p>' .\n\t\t\t\t\t'<ul>' .\n\t\t\t\t\t\t'<li>' . __( '<strong>Edit</strong> takes you to the editing screen for that post. You can also reach that screen by clicking on the post title.' ) . '</li>' .\n\t\t\t\t\t\t'<li>' . __( '<strong>Quick Edit</strong> provides inline access to the metadata of your post, allowing you to update post details without leaving this screen.' ) . '</li>' .\n\t\t\t\t\t\t'<li>' . __( '<strong>Trash</strong> removes your post from this list and places it in the Trash, from which you can permanently delete it.' ) . '</li>' .\n\t\t\t\t\t\t'<li>' . __( '<strong>Preview</strong> will show you what your draft post will look like if you publish it. View will take you to your live site to view the post. Which link is available depends on your post&#8217;s status.' ) . '</li>' .\n\t\t\t\t\t'</ul>',\n\t\t)\n\t);\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'bulk-actions',\n\t\t\t'title'   => __( 'Bulk actions' ),\n\t\t\t'content' =>\n\t\t\t\t\t'<p>' . __( 'You can also edit or move multiple posts to the Trash at once. Select the posts you want to act on using the checkboxes, then select the action you want to take from the Bulk actions menu and click Apply.' ) . '</p>' .\n\t\t\t\t\t\t\t'<p>' . __( 'When using Bulk Edit, you can change the metadata (categories, author, etc.) for all selected posts at once. To remove a post from the grouping, just click the x next to its name in the Bulk Edit area that appears.' ) . '</p>',\n\t\t)\n\t);\n\n\tget_current_screen()->set_help_sidebar(\n\t\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/posts-screen/\">Documentation on Managing Posts</a>' ) . '</p>' .\n\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n\t);\n\n} elseif ( 'page' === $post_type ) {\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'overview',\n\t\t\t'title'   => __( 'Overview' ),\n\t\t\t'content' =>\n\t\t\t\t\t'<p>' . __( 'Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the &#8220;Parent&#8221; of the other, creating a group of pages.' ) . '</p>',\n\t\t)\n\t);\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'managing-pages',\n\t\t\t'title'   => __( 'Managing Pages' ),\n\t\t\t'content' =>\n\t\t\t\t\t'<p>' . __( 'Managing pages is very similar to managing posts, and the screens can be customized in the same way.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'You can also perform the same types of actions, including narrowing the list by using the filters, acting on a page using the action links that appear when you hover over a row, or using the Bulk actions menu to edit the metadata for multiple pages at once.' ) . '</p>',\n\t\t)\n\t);\n\n\tget_current_screen()->set_help_sidebar(\n\t\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/pages-screen/\">Documentation on Managing Pages</a>' ) . '</p>' .\n\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n\t);\n\n}\n\nget_current_screen()->set_screen_reader_content(\n\tarray(\n\t\t'heading_views'      => $post_type_object->labels->filter_items_list,\n\t\t'heading_pagination' => $post_type_object->labels->items_list_navigation,\n\t\t'heading_list'       => $post_type_object->labels->items_list,\n\t)\n);\n\nadd_screen_option(\n\t'per_page',\n\tarray(\n\t\t'default' => 20,\n\t\t'option'  => 'edit_' . $post_type . '_per_page',\n\t)\n);\n\n$bulk_counts = array(\n\t'updated'   => isset( $_REQUEST['updated'] ) ? absint( $_REQUEST['updated'] ) : 0,\n\t'locked'    => isset( $_REQUEST['locked'] ) ? absint( $_REQUEST['locked'] ) : 0,\n\t'deleted'   => isset( $_REQUEST['deleted'] ) ? absint( $_REQUEST['deleted'] ) : 0,\n\t'trashed'   => isset( $_REQUEST['trashed'] ) ? absint( $_REQUEST['trashed'] ) : 0,\n\t'untrashed' => isset( $_REQUEST['untrashed'] ) ? absint( $_REQUEST['untrashed'] ) : 0,\n);\n\n$bulk_messages             = array();\n$bulk_messages['post']     = array(\n\t/* translators: %s: Number of posts. */\n\t'updated'   => _n( '%s post updated.', '%s posts updated.', $bulk_counts['updated'] ),\n\t'locked'    => ( 1 === $bulk_counts['locked'] ) ? __( '1 post not updated, somebody is editing it.' ) :\n\t\t\t\t\t/* translators: %s: Number of posts. */\n\t\t\t\t\t_n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $bulk_counts['locked'] ),\n\t/* translators: %s: Number of posts. */\n\t'deleted'   => _n( '%s post permanently deleted.', '%s posts permanently deleted.', $bulk_counts['deleted'] ),\n\t/* translators: %s: Number of posts. */\n\t'trashed'   => _n( '%s post moved to the Trash.', '%s posts moved to the Trash.', $bulk_counts['trashed'] ),\n\t/* translators: %s: Number of posts. */\n\t'untrashed' => _n( '%s post restored from the Trash.', '%s posts restored from the Trash.', $bulk_counts['untrashed'] ),\n);\n$bulk_messages['page']     = array(\n\t/* translators: %s: Number of pages. */\n\t'updated'   => _n( '%s page updated.', '%s pages updated.', $bulk_counts['updated'] ),\n\t'locked'    => ( 1 === $bulk_counts['locked'] ) ? __( '1 page not updated, somebody is editing it.' ) :\n\t\t\t\t\t/* translators: %s: Number of pages. */\n\t\t\t\t\t_n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $bulk_counts['locked'] ),\n\t/* translators: %s: Number of pages. */\n\t'deleted'   => _n( '%s page permanently deleted.', '%s pages permanently deleted.', $bulk_counts['deleted'] ),\n\t/* translators: %s: Number of pages. */\n\t'trashed'   => _n( '%s page moved to the Trash.', '%s pages moved to the Trash.', $bulk_counts['trashed'] ),\n\t/* translators: %s: Number of pages. */\n\t'untrashed' => _n( '%s page restored from the Trash.', '%s pages restored from the Trash.', $bulk_counts['untrashed'] ),\n);\n$bulk_messages['wp_block'] = array(\n\t/* translators: %s: Number of blocks. */\n\t'updated'   => _n( '%s block updated.', '%s blocks updated.', $bulk_counts['updated'] ),\n\t'locked'    => ( 1 === $bulk_counts['locked'] ) ? __( '1 block not updated, somebody is editing it.' ) :\n\t\t\t\t\t/* translators: %s: Number of blocks. */\n\t\t\t\t\t_n( '%s block not updated, somebody is editing it.', '%s blocks not updated, somebody is editing them.', $bulk_counts['locked'] ),\n\t/* translators: %s: Number of blocks. */\n\t'deleted'   => _n( '%s block permanently deleted.', '%s blocks permanently deleted.', $bulk_counts['deleted'] ),\n\t/* translators: %s: Number of blocks. */\n\t'trashed'   => _n( '%s block moved to the Trash.', '%s blocks moved to the Trash.', $bulk_counts['trashed'] ),\n\t/* translators: %s: Number of blocks. */\n\t'untrashed' => _n( '%s block restored from the Trash.', '%s blocks restored from the Trash.', $bulk_counts['untrashed'] ),\n);\n\n/**\n * Filters the bulk action updated messages.\n *\n * By default, custom post types use the messages for the 'post' post type.\n *\n * @since 3.7.0\n *\n * @param array[] $bulk_messages Arrays of messages, each keyed by the corresponding post type. Messages are\n *                               keyed with 'updated', 'locked', 'deleted', 'trashed', and 'untrashed'.\n * @param int[]   $bulk_counts   Array of item counts for each message, used to build internationalized strings.\n */\n$bulk_messages = apply_filters( 'bulk_post_updated_messages', $bulk_messages, $bulk_counts );\n$bulk_counts   = array_filter( $bulk_counts );\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n<div class=\"wrap\">\n<h1 class=\"wp-heading-inline\">\n<?php\necho esc_html( $post_type_object->labels->name );\n?>\n</h1>\n\n<?php\nif ( current_user_can( $post_type_object->cap->create_posts ) ) {\n\techo ' <a href=\"' . esc_url( admin_url( $post_new_file ) ) . '\" class=\"page-title-action\">' . esc_html( $post_type_object->labels->add_new ) . '</a>';\n}\n\nif ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {\n\t/* translators: %s: Search query. */\n\tprintf( ' <span class=\"subtitle\">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', get_search_query() );\n}\n?>\n\n<hr class=\"wp-header-end\">\n\n<?php\n// If we have a bulk message to issue:\n$messages = array();\nforeach ( $bulk_counts as $message => $count ) {\n\tif ( isset( $bulk_messages[ $post_type ][ $message ] ) ) {\n\t\t$messages[] = sprintf( $bulk_messages[ $post_type ][ $message ], number_format_i18n( $count ) );\n\t} elseif ( isset( $bulk_messages['post'][ $message ] ) ) {\n\t\t$messages[] = sprintf( $bulk_messages['post'][ $message ], number_format_i18n( $count ) );\n\t}\n\n\tif ( 'trashed' === $message && isset( $_REQUEST['ids'] ) ) {\n\t\t$ids        = preg_replace( '/[^0-9,]/', '', $_REQUEST['ids'] );\n\t\t$messages[] = '<a href=\"' . esc_url( wp_nonce_url( \"edit.php?post_type=$post_type&doaction=undo&action=untrash&ids=$ids\", 'bulk-posts' ) ) . '\">' . __( 'Undo' ) . '</a>';\n\t}\n}\n\nif ( $messages ) {\n\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . join( ' ', $messages ) . '</p></div>';\n}\nunset( $messages );\n\n$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed' ), $_SERVER['REQUEST_URI'] );\n?>\n\n<?php $wp_list_table->views(); ?>\n\n<form id=\"posts-filter\" method=\"get\">\n\n<?php $wp_list_table->search_box( $post_type_object->labels->search_items, 'post' ); ?>\n\n<input type=\"hidden\" name=\"post_status\" class=\"post_status_page\" value=\"<?php echo ! empty( $_REQUEST['post_status'] ) ? esc_attr( $_REQUEST['post_status'] ) : 'all'; ?>\" />\n<input type=\"hidden\" name=\"post_type\" class=\"post_type_page\" value=\"<?php echo $post_type; ?>\" />\n\n<?php if ( ! empty( $_REQUEST['author'] ) ) { ?>\n<input type=\"hidden\" name=\"author\" value=\"<?php echo esc_attr( $_REQUEST['author'] ); ?>\" />\n<?php } ?>\n\n<?php if ( ! empty( $_REQUEST['show_sticky'] ) ) { ?>\n<input type=\"hidden\" name=\"show_sticky\" value=\"1\" />\n<?php } ?>\n\n<?php $wp_list_table->display(); ?>\n\n</form>\n\n<?php\nif ( $wp_list_table->has_items() ) {\n\t$wp_list_table->inline_edit();\n}\n?>\n\n<div id=\"ajax-response\"></div>\n<br class=\"clear\" />\n</div>\n\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 465}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Privacy tools, Erase Personal Data screen.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'erase_others_personal_data' ) || ! current_user_can( 'delete_users' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to erase data on this site.' ) );\n}\n\n// Handle list table actions.\n_wp_personal_data_handle_actions();\n\n// Cleans up failed and expired requests before displaying the list table.\n_wp_personal_data_cleanup_requests();\n\nwp_enqueue_script( 'privacy-tools' );\n\nadd_screen_option(\n\t'per_page',\n\tarray(\n\t\t'default' => 20,\n\t\t'option'  => 'remove_personal_data_requests_per_page',\n\t)\n);\n\n$_list_table_args = array(\n\t'plural'   => 'privacy_requests',\n\t'singular' => 'privacy_request',\n);\n\n$requests_table = _get_list_table( 'WP_Privacy_Data_Removal_Requests_List_Table', $_list_table_args );\n\n$requests_table->screen->set_screen_reader_content(\n\tarray(\n\t\t'heading_views'      => __( 'Filter erase personal data list' ),\n\t\t'heading_pagination' => __( 'Erase personal data list navigation' ),\n\t\t'heading_list'       => __( 'Erase personal data list' ),\n\t)\n);\n\n$requests_table->process_bulk_action();\n$requests_table->prepare_items();\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n\n<div class=\"wrap nosubsub\">\n\t<h1><?php esc_html_e( 'Erase Personal Data' ); ?></h1>\n\t<hr class=\"wp-header-end\" />\n\n\t<?php settings_errors(); ?>\n\n\t<form action=\"<?php echo esc_url( admin_url( 'erase-personal-data.php' ) ); ?>\" method=\"post\" class=\"wp-privacy-request-form\">\n\t\t<h2><?php esc_html_e( 'Add Data Erasure Request' ); ?></h2>\n\t\t<p><?php esc_html_e( 'An email will be sent to the user at this email address asking them to verify the request.' ); ?></p>\n\n\t\t<div class=\"wp-privacy-request-form-field\">\n\t\t\t<label for=\"username_or_email_for_privacy_request\"><?php esc_html_e( 'Username or email address' ); ?></label>\n\t\t\t<input type=\"text\" required class=\"regular-text ltr\" id=\"username_or_email_for_privacy_request\" name=\"username_or_email_for_privacy_request\" />\n\t\t\t<?php submit_button( __( 'Send Request' ), 'secondary', 'submit', false ); ?>\n\t\t</div>\n\t\t<?php wp_nonce_field( 'personal-data-request' ); ?>\n\t\t<input type=\"hidden\" name=\"action\" value=\"add_remove_personal_data_request\" />\n\t\t<input type=\"hidden\" name=\"type_of_action\" value=\"remove_personal_data\" />\n\t</form>\n\t<hr />\n\n\t<?php $requests_table->views(); ?>\n\n\t<form class=\"search-form wp-clearfix\">\n\t\t<?php $requests_table->search_box( __( 'Search Requests' ), 'requests' ); ?>\n\t\t<input type=\"hidden\" name=\"filter-status\" value=\"<?php echo isset( $_REQUEST['filter-status'] ) ? esc_attr( sanitize_text_field( $_REQUEST['filter-status'] ) ) : ''; ?>\" />\n\t\t<input type=\"hidden\" name=\"orderby\" value=\"<?php echo isset( $_REQUEST['orderby'] ) ? esc_attr( sanitize_text_field( $_REQUEST['orderby'] ) ) : ''; ?>\" />\n\t\t<input type=\"hidden\" name=\"order\" value=\"<?php echo isset( $_REQUEST['order'] ) ? esc_attr( sanitize_text_field( $_REQUEST['order'] ) ) : ''; ?>\" />\n\t</form>\n\n\t<form method=\"post\">\n\t\t<?php\n\t\t$requests_table->display();\n\t\t$requests_table->embed_scripts();\n\t\t?>\n\t</form>\n</div>\n\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 93}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Privacy tools, Export Personal Data screen.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'export_others_personal_data' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to export personal data on this site.' ) );\n}\n\n// Handle list table actions.\n_wp_personal_data_handle_actions();\n\n// Cleans up failed and expired requests before displaying the list table.\n_wp_personal_data_cleanup_requests();\n\nwp_enqueue_script( 'privacy-tools' );\n\nadd_screen_option(\n\t'per_page',\n\tarray(\n\t\t'default' => 20,\n\t\t'option'  => 'export_personal_data_requests_per_page',\n\t)\n);\n\n$_list_table_args = array(\n\t'plural'   => 'privacy_requests',\n\t'singular' => 'privacy_request',\n);\n\n$requests_table = _get_list_table( 'WP_Privacy_Data_Export_Requests_List_Table', $_list_table_args );\n\n$requests_table->screen->set_screen_reader_content(\n\tarray(\n\t\t'heading_views'      => __( 'Filter export personal data list' ),\n\t\t'heading_pagination' => __( 'Export personal data list navigation' ),\n\t\t'heading_list'       => __( 'Export personal data list' ),\n\t)\n);\n\n$requests_table->process_bulk_action();\n$requests_table->prepare_items();\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n\n<div class=\"wrap nosubsub\">\n\t<h1><?php esc_html_e( 'Export Personal Data' ); ?></h1>\n\t<hr class=\"wp-header-end\" />\n\n\t<?php settings_errors(); ?>\n\n\t<form action=\"<?php echo esc_url( admin_url( 'export-personal-data.php' ) ); ?>\" method=\"post\" class=\"wp-privacy-request-form\">\n\t\t<h2><?php esc_html_e( 'Add Data Export Request' ); ?></h2>\n\t\t<p><?php esc_html_e( 'An email will be sent to the user at this email address asking them to verify the request.' ); ?></p>\n\n\t\t<div class=\"wp-privacy-request-form-field\">\n\t\t\t<label for=\"username_or_email_for_privacy_request\"><?php esc_html_e( 'Username or email address' ); ?></label>\n\t\t\t<input type=\"text\" required class=\"regular-text ltr\" id=\"username_or_email_for_privacy_request\" name=\"username_or_email_for_privacy_request\" />\n\t\t\t<?php submit_button( __( 'Send Request' ), 'secondary', 'submit', false ); ?>\n\t\t</div>\n\t\t<?php wp_nonce_field( 'personal-data-request' ); ?>\n\t\t<input type=\"hidden\" name=\"action\" value=\"add_export_personal_data_request\" />\n\t\t<input type=\"hidden\" name=\"type_of_action\" value=\"export_personal_data\" />\n\t</form>\n\t<hr />\n\n\t<?php $requests_table->views(); ?>\n\n\t<form class=\"search-form wp-clearfix\">\n\t\t<?php $requests_table->search_box( __( 'Search Requests' ), 'requests' ); ?>\n\t\t<input type=\"hidden\" name=\"filter-status\" value=\"<?php echo isset( $_REQUEST['filter-status'] ) ? esc_attr( sanitize_text_field( $_REQUEST['filter-status'] ) ) : ''; ?>\" />\n\t\t<input type=\"hidden\" name=\"orderby\" value=\"<?php echo isset( $_REQUEST['orderby'] ) ? esc_attr( sanitize_text_field( $_REQUEST['orderby'] ) ) : ''; ?>\" />\n\t\t<input type=\"hidden\" name=\"order\" value=\"<?php echo isset( $_REQUEST['order'] ) ? esc_attr( sanitize_text_field( $_REQUEST['order'] ) ) : ''; ?>\" />\n\t</form>\n\n\t<form method=\"post\">\n\t\t<?php\n\t\t$requests_table->display();\n\t\t$requests_table->embed_scripts();\n\t\t?>\n\t</form>\n</div>\n\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 93}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Export Administration Screen\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** Load WordPress Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'export' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to export the content of this site.' ) );\n}\n\n/** Load WordPress export API */\nrequire_once ABSPATH . 'wp-admin/includes/export.php';\n$title = __( 'Export' );\n\n/**\n * Display JavaScript on the page.\n *\n * @since 3.5.0\n */\nfunction export_add_js() {\n\t?>\n<script type=\"text/javascript\">\n\tjQuery(document).ready(function($){\n\t\tvar form = $('#export-filters'),\n\t\t\tfilters = form.find('.export-filters');\n\t\tfilters.hide();\n\t\tform.find('input:radio').change(function() {\n\t\t\tfilters.slideUp('fast');\n\t\t\tswitch ( $(this).val() ) {\n\t\t\t\tcase 'attachment': $('#attachment-filters').slideDown(); break;\n\t\t\t\tcase 'posts': $('#post-filters').slideDown(); break;\n\t\t\t\tcase 'pages': $('#page-filters').slideDown(); break;\n\t\t\t}\n\t\t});\n\t});\n</script>\n\t<?php\n}\nadd_action( 'admin_head', 'export_add_js' );\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' => '<p>' . __( 'You can export a file of your site&#8217;s content in order to import it into another installation or platform. The export file will be an XML file format called WXR. Posts, pages, comments, custom fields, categories, and tags can be included. You can choose for the WXR file to include only certain posts or pages by setting the dropdown filters to limit the export by category, author, date range by month, or publishing status.' ) . '</p>' .\n\t\t\t'<p>' . __( 'Once generated, your WXR file can be imported by another WordPress site or by another blogging platform able to access this format.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/tools-export-screen/\">Documentation on Export</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\n// If the 'download' URL parameter is set, a WXR export file is baked and returned.\nif ( isset( $_GET['download'] ) ) {\n\t$args = array();\n\n\tif ( ! isset( $_GET['content'] ) || 'all' === $_GET['content'] ) {\n\t\t$args['content'] = 'all';\n\t} elseif ( 'posts' === $_GET['content'] ) {\n\t\t$args['content'] = 'post';\n\n\t\tif ( $_GET['cat'] ) {\n\t\t\t$args['category'] = (int) $_GET['cat'];\n\t\t}\n\n\t\tif ( $_GET['post_author'] ) {\n\t\t\t$args['author'] = (int) $_GET['post_author'];\n\t\t}\n\n\t\tif ( $_GET['post_start_date'] || $_GET['post_end_date'] ) {\n\t\t\t$args['start_date'] = $_GET['post_start_date'];\n\t\t\t$args['end_date']   = $_GET['post_end_date'];\n\t\t}\n\n\t\tif ( $_GET['post_status'] ) {\n\t\t\t$args['status'] = $_GET['post_status'];\n\t\t}\n\t} elseif ( 'pages' === $_GET['content'] ) {\n\t\t$args['content'] = 'page';\n\n\t\tif ( $_GET['page_author'] ) {\n\t\t\t$args['author'] = (int) $_GET['page_author'];\n\t\t}\n\n\t\tif ( $_GET['page_start_date'] || $_GET['page_end_date'] ) {\n\t\t\t$args['start_date'] = $_GET['page_start_date'];\n\t\t\t$args['end_date']   = $_GET['page_end_date'];\n\t\t}\n\n\t\tif ( $_GET['page_status'] ) {\n\t\t\t$args['status'] = $_GET['page_status'];\n\t\t}\n\t} elseif ( 'attachment' === $_GET['content'] ) {\n\t\t$args['content'] = 'attachment';\n\n\t\tif ( $_GET['attachment_start_date'] || $_GET['attachment_end_date'] ) {\n\t\t\t$args['start_date'] = $_GET['attachment_start_date'];\n\t\t\t$args['end_date']   = $_GET['attachment_end_date'];\n\t\t}\n\t} else {\n\t\t$args['content'] = $_GET['content'];\n\t}\n\n\t/**\n\t * Filters the export args.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param array $args The arguments to send to the exporter.\n\t */\n\t$args = apply_filters( 'export_args', $args );\n\n\texport_wp( $args );\n\tdie();\n}\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n/**\n * Create the date options fields for exporting a given post type.\n *\n * @global wpdb      $wpdb      WordPress database abstraction object.\n * @global WP_Locale $wp_locale WordPress date and time locale object.\n *\n * @since 3.1.0\n *\n * @param string $post_type The post type. Default 'post'.\n */\nfunction export_date_options( $post_type = 'post' ) {\n\tglobal $wpdb, $wp_locale;\n\n\t$months = $wpdb->get_results(\n\t\t$wpdb->prepare(\n\t\t\t\"\n\t\tSELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month\n\t\tFROM $wpdb->posts\n\t\tWHERE post_type = %s AND post_status != 'auto-draft'\n\t\tORDER BY post_date DESC\n\t\t\t\",\n\t\t\t$post_type\n\t\t)\n\t);\n\n\t$month_count = count( $months );\n\tif ( ! $month_count || ( 1 === $month_count && 0 === (int) $months[0]->month ) ) {\n\t\treturn;\n\t}\n\n\tforeach ( $months as $date ) {\n\t\tif ( 0 === (int) $date->year ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$month = zeroise( $date->month, 2 );\n\t\techo '<option value=\"' . $date->year . '-' . $month . '\">' . $wp_locale->get_month( $month ) . ' ' . $date->year . '</option>';\n\t}\n}\n?>\n\n<div class=\"wrap\">\n<h1><?php echo esc_html( $title ); ?></h1>\n\n<p><?php _e( 'When you click the button below WordPress will create an XML file for you to save to your computer.' ); ?></p>\n<p><?php _e( 'This format, which we call WordPress eXtended RSS or WXR, will contain your posts, pages, comments, custom fields, categories, and tags.' ); ?></p>\n<p><?php _e( 'Once you&#8217;ve saved the download file, you can use the Import function in another WordPress installation to import the content from this site.' ); ?></p>\n\n<h2><?php _e( 'Choose what to export' ); ?></h2>\n<form method=\"get\" id=\"export-filters\">\n<fieldset>\n<legend class=\"screen-reader-text\"><?php _e( 'Content to export' ); ?></legend>\n<input type=\"hidden\" name=\"download\" value=\"true\" />\n<p><label><input type=\"radio\" name=\"content\" value=\"all\" checked=\"checked\" aria-describedby=\"all-content-desc\" /> <?php _e( 'All content' ); ?></label></p>\n<p class=\"description\" id=\"all-content-desc\"><?php _e( 'This will contain all of your posts, pages, comments, custom fields, terms, navigation menus, and custom posts.' ); ?></p>\n\n<p><label><input type=\"radio\" name=\"content\" value=\"posts\" /> <?php _ex( 'Posts', 'post type general name' ); ?></label></p>\n<ul id=\"post-filters\" class=\"export-filters\">\n\t<li>\n\t\t<label><span class=\"label-responsive\"><?php _e( 'Categories:' ); ?></span>\n\t\t<?php wp_dropdown_categories( array( 'show_option_all' => __( 'All' ) ) ); ?>\n\t\t</label>\n\t</li>\n\t<li>\n\t\t<label><span class=\"label-responsive\"><?php _e( 'Authors:' ); ?></span>\n\t\t<?php\n\t\t$authors = $wpdb->get_col( \"SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'post'\" );\n\t\twp_dropdown_users(\n\t\t\tarray(\n\t\t\t\t'include'         => $authors,\n\t\t\t\t'name'            => 'post_author',\n\t\t\t\t'multi'           => true,\n\t\t\t\t'show_option_all' => __( 'All' ),\n\t\t\t\t'show'            => 'display_name_with_login',\n\t\t\t)\n\t\t);\n\t\t?>\n\t\t</label>\n\t</li>\n\t<li>\n\t\t<fieldset>\n\t\t<legend class=\"screen-reader-text\"><?php _e( 'Date range:' ); ?></legend>\n\t\t<label for=\"post-start-date\" class=\"label-responsive\"><?php _e( 'Start date:' ); ?></label>\n\t\t<select name=\"post_start_date\" id=\"post-start-date\">\n\t\t\t<option value=\"0\"><?php _e( '&mdash; Select &mdash;' ); ?></option>\n\t\t\t<?php export_date_options(); ?>\n\t\t</select>\n\t\t<label for=\"post-end-date\" class=\"label-responsive\"><?php _e( 'End date:' ); ?></label>\n\t\t<select name=\"post_end_date\" id=\"post-end-date\">\n\t\t\t<option value=\"0\"><?php _e( '&mdash; Select &mdash;' ); ?></option>\n\t\t\t<?php export_date_options(); ?>\n\t\t</select>\n\t\t</fieldset>\n\t</li>\n\t<li>\n\t\t<label for=\"post-status\" class=\"label-responsive\"><?php _e( 'Status:' ); ?></label>\n\t\t<select name=\"post_status\" id=\"post-status\">\n\t\t\t<option value=\"0\"><?php _e( 'All' ); ?></option>\n\t\t\t<?php\n\t\t\t$post_stati = get_post_stati( array( 'internal' => false ), 'objects' );\n\t\t\tforeach ( $post_stati as $status ) :\n\t\t\t\t?>\n\t\t\t<option value=\"<?php echo esc_attr( $status->name ); ?>\"><?php echo esc_html( $status->label ); ?></option>\n\t\t\t<?php endforeach; ?>\n\t\t</select>\n\t</li>\n</ul>\n\n<p><label><input type=\"radio\" name=\"content\" value=\"pages\" /> <?php _e( 'Pages' ); ?></label></p>\n<ul id=\"page-filters\" class=\"export-filters\">\n\t<li>\n\t\t<label><span class=\"label-responsive\"><?php _e( 'Authors:' ); ?></span>\n\t\t<?php\n\t\t$authors = $wpdb->get_col( \"SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'page'\" );\n\t\twp_dropdown_users(\n\t\t\tarray(\n\t\t\t\t'include'         => $authors,\n\t\t\t\t'name'            => 'page_author',\n\t\t\t\t'multi'           => true,\n\t\t\t\t'show_option_all' => __( 'All' ),\n\t\t\t\t'show'            => 'display_name_with_login',\n\t\t\t)\n\t\t);\n\t\t?>\n\t\t</label>\n\t</li>\n\t<li>\n\t\t<fieldset>\n\t\t<legend class=\"screen-reader-text\"><?php _e( 'Date range:' ); ?></legend>\n\t\t<label for=\"page-start-date\" class=\"label-responsive\"><?php _e( 'Start date:' ); ?></label>\n\t\t<select name=\"page_start_date\" id=\"page-start-date\">\n\t\t\t<option value=\"0\"><?php _e( '&mdash; Select &mdash;' ); ?></option>\n\t\t\t<?php export_date_options( 'page' ); ?>\n\t\t</select>\n\t\t<label for=\"page-end-date\" class=\"label-responsive\"><?php _e( 'End date:' ); ?></label>\n\t\t<select name=\"page_end_date\" id=\"page-end-date\">\n\t\t\t<option value=\"0\"><?php _e( '&mdash; Select &mdash;' ); ?></option>\n\t\t\t<?php export_date_options( 'page' ); ?>\n\t\t</select>\n\t\t</fieldset>\n\t</li>\n\t<li>\n\t\t<label for=\"page-status\" class=\"label-responsive\"><?php _e( 'Status:' ); ?></label>\n\t\t<select name=\"page_status\" id=\"page-status\">\n\t\t\t<option value=\"0\"><?php _e( 'All' ); ?></option>\n\t\t\t<?php foreach ( $post_stati as $status ) : ?>\n\t\t\t<option value=\"<?php echo esc_attr( $status->name ); ?>\"><?php echo esc_html( $status->label ); ?></option>\n\t\t\t<?php endforeach; ?>\n\t\t</select>\n\t</li>\n</ul>\n\n<?php\nforeach ( get_post_types(\n\tarray(\n\t\t'_builtin'   => false,\n\t\t'can_export' => true,\n\t),\n\t'objects'\n) as $post_type ) :\n\t?>\n<p><label><input type=\"radio\" name=\"content\" value=\"<?php echo esc_attr( $post_type->name ); ?>\" /> <?php echo esc_html( $post_type->label ); ?></label></p>\n<?php endforeach; ?>\n\n<p><label><input type=\"radio\" name=\"content\" value=\"attachment\" /> <?php _e( 'Media' ); ?></label></p>\n<ul id=\"attachment-filters\" class=\"export-filters\">\n\t<li>\n\t\t<fieldset>\n\t\t<legend class=\"screen-reader-text\"><?php _e( 'Date range:' ); ?></legend>\n\t\t<label for=\"attachment-start-date\" class=\"label-responsive\"><?php _e( 'Start date:' ); ?></label>\n\t\t<select name=\"attachment_start_date\" id=\"attachment-start-date\">\n\t\t\t<option value=\"0\"><?php _e( '&mdash; Select &mdash;' ); ?></option>\n\t\t\t<?php export_date_options( 'attachment' ); ?>\n\t\t</select>\n\t\t<label for=\"attachment-end-date\" class=\"label-responsive\"><?php _e( 'End date:' ); ?></label>\n\t\t<select name=\"attachment_end_date\" id=\"attachment-end-date\">\n\t\t\t<option value=\"0\"><?php _e( '&mdash; Select &mdash;' ); ?></option>\n\t\t\t<?php export_date_options( 'attachment' ); ?>\n\t\t</select>\n\t\t</fieldset>\n\t</li>\n</ul>\n\n</fieldset>\n<?php\n/**\n * Fires at the end of the export filters form.\n *\n * @since 3.5.0\n */\ndo_action( 'export_filters' );\n?>\n\n<?php submit_button( __( 'Download Export File' ) ); ?>\n</form>\n</div>\n\n<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 325}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Your Rights administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n// This file was used to also display the Privacy tab on the About screen from 4.9.6 until 5.3.0.\nif ( isset( $_GET['privacy-notice'] ) ) {\n\twp_redirect( admin_url( 'privacy.php' ), 301 );\n\texit;\n}\n\n$title = __( 'Freedoms' );\n\nlist( $display_version ) = explode( '-', get_bloginfo( 'version' ) );\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n<div class=\"wrap about__container\">\n\n\t<div class=\"about__header\">\n\t\t<div class=\"about__header-text\">\n\t\t\t<?php _e( 'Speed. Search. Security.' ); ?>\n\t\t</div>\n\n\t\t<div class=\"about__header-title\">\n\t\t\t<p>\n\t\t\t\t<?php _e( 'WordPress' ); ?>\n\t\t\t\t<span><?php echo $display_version; ?></span>\n\t\t\t</p>\n\t\t</div>\n\n\t\t<nav class=\"about__header-navigation nav-tab-wrapper wp-clearfix\" aria-label=\"<?php esc_attr_e( 'Secondary menu' ); ?>\">\n\t\t\t<a href=\"about.php\" class=\"nav-tab\"><?php _e( 'What&#8217;s New' ); ?></a>\n\t\t\t<a href=\"credits.php\" class=\"nav-tab\"><?php _e( 'Credits' ); ?></a>\n\t\t\t<a href=\"freedoms.php\" class=\"nav-tab nav-tab-active\" aria-current=\"page\"><?php _e( 'Freedoms' ); ?></a>\n\t\t\t<a href=\"privacy.php\" class=\"nav-tab\"><?php _e( 'Privacy' ); ?></a>\n\t\t</nav>\n\t</div>\n\n\t<div class=\"about__section has-subtle-background-color is-feature\">\n\t\t<h1><?php _e( 'Freedoms' ); ?></h1>\n\n\t\t<p class=\"about-description\">\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: https://wordpress.org/about/license/ */\n\t\t\t__( 'WordPress is Free and open source software, built by a distributed community of mostly volunteer developers from around the world. WordPress comes with some awesome, worldview-changing rights courtesy of its <a href=\"%s\">license</a>, the GPL.' ),\n\t\t\t__( 'https://wordpress.org/about/license/' )\n\t\t);\n\t\t?>\n\t\t</p>\n\t</div>\n\n\t<hr />\n\n\t<div class=\"about__section has-4-columns\">\n\t\t<div class=\"column\">\n\t\t\t<div class=\"freedoms-image\"></div>\n\t\t\t<h2 class=\"is-smaller-heading\"><?php _e( 'The 1st Freedom' ); ?></h2>\n\t\t\t<p><?php _e( 'To run the program for any purpose.' ); ?></p>\n\t\t</div>\n\t\t<div class=\"column\">\n\t\t\t<div class=\"freedoms-image\"></div>\n\t\t\t<h2 class=\"is-smaller-heading\"><?php _e( 'The 2nd Freedom' ); ?></h2>\n\t\t\t<p><?php _e( 'To study how the program works and change it to make it do what you wish.' ); ?></p>\n\t\t</div>\n\t\t<div class=\"column\">\n\t\t\t<div class=\"freedoms-image\"></div>\n\t\t\t<h2 class=\"is-smaller-heading\"><?php _e( 'The 3rd Freedom' ); ?></h2>\n\t\t\t<p><?php _e( 'To redistribute.' ); ?></p>\n\t\t</div>\n\t\t<div class=\"column\">\n\t\t\t<div class=\"freedoms-image\"></div>\n\t\t\t<h2 class=\"is-smaller-heading\"><?php _e( 'The 4th Freedom' ); ?></h2>\n\t\t\t<p><?php _e( 'To distribute copies of your modified versions to others.' ); ?></p>\n\t\t</div>\n\t</div>\n\n\t<hr />\n\n\t<div class=\"about__section\">\n\t\t<div class=\"column\">\n\t\t\t<p>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: https://wordpressfoundation.org/trademark-policy/ */\n\t\t\t\t__( 'WordPress grows when people like you tell their friends about it, and the thousands of businesses and services that are built on and around WordPress share that fact with their users. We&#8217;re flattered every time someone spreads the good word, just make sure to <a href=\"%s\">check out our trademark guidelines</a> first.' ),\n\t\t\t\t'https://wordpressfoundation.org/trademark-policy/'\n\t\t\t);\n\t\t\t?>\n\t\t\t</p>\n\n\t\t\t<p>\n\t\t\t<?php\n\t\t\t$plugins_url = current_user_can( 'activate_plugins' ) ? admin_url( 'plugins.php' ) : __( 'https://wordpress.org/plugins/' );\n\t\t\t$themes_url  = current_user_can( 'switch_themes' ) ? admin_url( 'themes.php' ) : __( 'https://wordpress.org/themes/' );\n\t\t\tprintf(\n\t\t\t\t/* translators: 1: URL to Plugins screen, 2: URL to Themes screen, 3: https://wordpress.org/about/license/ */\n\t\t\t\t__( 'Every plugin and theme in WordPress.org&#8217;s directory is 100%% GPL or a similarly free and compatible license, so you can feel safe finding <a href=\"%1$s\">plugins</a> and <a href=\"%2$s\">themes</a> there. If you get a plugin or theme from another source, make sure to <a href=\"%3$s\">ask them if it&#8217;s GPL</a> first. If they don&#8217;t respect the WordPress license, we don&#8217;t recommend them.' ),\n\t\t\t\t$plugins_url,\n\t\t\t\t$themes_url,\n\t\t\t\t__( 'https://wordpress.org/about/license/' )\n\t\t\t);\n\t\t\t?>\n\t\t\t</p>\n\n\t\t\t<p><?php _e( 'Don&#8217;t you wish all software came with these freedoms? So do we! For more information, check out the <a href=\"https://www.fsf.org/\">Free Software Foundation</a>.' ); ?></p>\n\t\t</div>\n\t</div>\n\n</div>\n<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 119}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Import WordPress Administration Screen\n *\n * @package WordPress\n * @subpackage Administration\n */\n\ndefine( 'WP_LOAD_IMPORTERS', true );\n\n/** Load WordPress Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'import' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to import content into this site.' ) );\n}\n\n$title = __( 'Import' );\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' => '<p>' . __( 'This screen lists links to plugins to import data from blogging/content management platforms. Choose the platform you want to import from, and click Install Now when you are prompted in the popup window. If your platform is not listed, click the link to search the plugin directory for other importer plugins to see if there is one for your platform.' ) . '</p>' .\n\t\t\t'<p>' . __( 'In previous versions of WordPress, all importers were built-in. They have been turned into plugins since most people only use them once or infrequently.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/tools-import-screen/\">Documentation on Import</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nif ( current_user_can( 'install_plugins' ) ) {\n\t// List of popular importer plugins from the WordPress.org API.\n\t$popular_importers = wp_get_popular_importers();\n} else {\n\t$popular_importers = array();\n}\n\n// Detect and redirect invalid importers like 'movabletype', which is registered as 'mt'.\nif ( ! empty( $_GET['invalid'] ) && isset( $popular_importers[ $_GET['invalid'] ] ) ) {\n\t$importer_id = $popular_importers[ $_GET['invalid'] ]['importer-id'];\n\tif ( $importer_id !== $_GET['invalid'] ) { // Prevent redirect loops.\n\t\twp_redirect( admin_url( 'admin.php?import=' . $importer_id ) );\n\t\texit;\n\t}\n\tunset( $importer_id );\n}\n\nadd_thickbox();\nwp_enqueue_script( 'plugin-install' );\nwp_enqueue_script( 'updates' );\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n$parent_file = 'tools.php';\n?>\n\n<div class=\"wrap\">\n<h1><?php echo esc_html( $title ); ?></h1>\n<?php if ( ! empty( $_GET['invalid'] ) ) : ?>\n\t<div class=\"error\">\n\t\t<p><strong><?php _e( 'Error:' ); ?></strong>\n\t\t\t<?php\n\t\t\t/* translators: %s: Importer slug. */\n\t\t\tprintf( __( 'The %s importer is invalid or is not installed.' ), '<strong>' . esc_html( $_GET['invalid'] ) . '</strong>' );\n\t\t\t?>\n\t\t</p>\n\t</div>\n<?php endif; ?>\n<p><?php _e( 'If you have posts or comments in another system, WordPress can import those into this site. To get started, choose a system to import from below:' ); ?></p>\n\n<?php\n// Registered (already installed) importers. They're stored in the global $wp_importers.\n$importers = get_importers();\n\n// If a popular importer is not registered, create a dummy registration that links to the plugin installer.\nforeach ( $popular_importers as $pop_importer => $pop_data ) {\n\tif ( isset( $importers[ $pop_importer ] ) ) {\n\t\tcontinue;\n\t}\n\tif ( isset( $importers[ $pop_data['importer-id'] ] ) ) {\n\t\tcontinue;\n\t}\n\n\t// Fill the array of registered (already installed) importers with data of the popular importers from the WordPress.org API.\n\t$importers[ $pop_data['importer-id'] ] = array(\n\t\t$pop_data['name'],\n\t\t$pop_data['description'],\n\t\t'install' => $pop_data['plugin-slug'],\n\t);\n}\n\nif ( empty( $importers ) ) {\n\techo '<p>' . __( 'No importers are available.' ) . '</p>'; // TODO: Make more helpful.\n} else {\n\tuasort( $importers, '_usort_by_first_member' );\n\t?>\n<table class=\"widefat importers striped\">\n\n\t<?php\n\tforeach ( $importers as $importer_id => $data ) {\n\t\t$plugin_slug         = '';\n\t\t$action              = '';\n\t\t$is_plugin_installed = false;\n\n\t\tif ( isset( $data['install'] ) ) {\n\t\t\t$plugin_slug = $data['install'];\n\n\t\t\tif ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_slug ) ) {\n\t\t\t\t// Looks like an importer is installed, but not active.\n\t\t\t\t$plugins = get_plugins( '/' . $plugin_slug );\n\t\t\t\tif ( ! empty( $plugins ) ) {\n\t\t\t\t\t$keys        = array_keys( $plugins );\n\t\t\t\t\t$plugin_file = $plugin_slug . '/' . $keys[0];\n\t\t\t\t\t$url         = wp_nonce_url(\n\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'action' => 'activate',\n\t\t\t\t\t\t\t\t'plugin' => $plugin_file,\n\t\t\t\t\t\t\t\t'from'   => 'import',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tadmin_url( 'plugins.php' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'activate-plugin_' . $plugin_file\n\t\t\t\t\t);\n\t\t\t\t\t$action      = sprintf(\n\t\t\t\t\t\t'<a href=\"%s\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t\tesc_url( $url ),\n\t\t\t\t\t\t/* translators: %s: Importer name. */\n\t\t\t\t\t\tesc_attr( sprintf( __( 'Run %s' ), $data[0] ) ),\n\t\t\t\t\t\t__( 'Run Importer' )\n\t\t\t\t\t);\n\n\t\t\t\t\t$is_plugin_installed = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( empty( $action ) ) {\n\t\t\t\tif ( is_main_site() ) {\n\t\t\t\t\t$url    = wp_nonce_url(\n\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'action' => 'install-plugin',\n\t\t\t\t\t\t\t\t'plugin' => $plugin_slug,\n\t\t\t\t\t\t\t\t'from'   => 'import',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tself_admin_url( 'update.php' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'install-plugin_' . $plugin_slug\n\t\t\t\t\t);\n\t\t\t\t\t$action = sprintf(\n\t\t\t\t\t\t'<a href=\"%1$s\" class=\"install-now\" data-slug=\"%2$s\" data-name=\"%3$s\" aria-label=\"%4$s\">%5$s</a>',\n\t\t\t\t\t\tesc_url( $url ),\n\t\t\t\t\t\tesc_attr( $plugin_slug ),\n\t\t\t\t\t\tesc_attr( $data[0] ),\n\t\t\t\t\t\t/* translators: %s: Importer name. */\n\t\t\t\t\t\tesc_attr( sprintf( _x( 'Install %s now', 'plugin' ), $data[0] ) ),\n\t\t\t\t\t\t__( 'Install Now' )\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$action = sprintf(\n\t\t\t\t\t\t/* translators: %s: URL to Import screen on the main site. */\n\t\t\t\t\t\t__( 'This importer is not installed. Please install importers from <a href=\"%s\">the main site</a>.' ),\n\t\t\t\t\t\tget_admin_url( get_current_network_id(), 'import.php' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$url    = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'import' => $importer_id,\n\t\t\t\t),\n\t\t\t\tself_admin_url( 'admin.php' )\n\t\t\t);\n\t\t\t$action = sprintf(\n\t\t\t\t'<a href=\"%1$s\" aria-label=\"%2$s\">%3$s</a>',\n\t\t\t\tesc_url( $url ),\n\t\t\t\t/* translators: %s: Importer name. */\n\t\t\t\tesc_attr( sprintf( __( 'Run %s' ), $data[0] ) ),\n\t\t\t\t__( 'Run Importer' )\n\t\t\t);\n\n\t\t\t$is_plugin_installed = true;\n\t\t}\n\n\t\tif ( ! $is_plugin_installed && is_main_site() ) {\n\t\t\t$url     = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'tab'       => 'plugin-information',\n\t\t\t\t\t'plugin'    => $plugin_slug,\n\t\t\t\t\t'from'      => 'import',\n\t\t\t\t\t'TB_iframe' => 'true',\n\t\t\t\t\t'width'     => 600,\n\t\t\t\t\t'height'    => 550,\n\t\t\t\t),\n\t\t\t\tnetwork_admin_url( 'plugin-install.php' )\n\t\t\t);\n\t\t\t$action .= sprintf(\n\t\t\t\t' | <a href=\"%1$s\" class=\"thickbox open-plugin-details-modal\" aria-label=\"%2$s\">%3$s</a>',\n\t\t\t\tesc_url( $url ),\n\t\t\t\t/* translators: %s: Importer name. */\n\t\t\t\tesc_attr( sprintf( __( 'More information about %s' ), $data[0] ) ),\n\t\t\t\t__( 'Details' )\n\t\t\t);\n\t\t}\n\n\t\techo \"\n\t\t\t<tr class='importer-item'>\n\t\t\t\t<td class='import-system'>\n\t\t\t\t\t<span class='importer-title'>{$data[0]}</span>\n\t\t\t\t\t<span class='importer-action'>{$action}</span>\n\t\t\t\t</td>\n\t\t\t\t<td class='desc'>\n\t\t\t\t\t<span class='importer-desc'>{$data[1]}</span>\n\t\t\t\t</td>\n\t\t\t</tr>\";\n\t}\n\t?>\n</table>\n\t<?php\n}\n\nif ( current_user_can( 'install_plugins' ) ) {\n\techo '<p>' . sprintf(\n\t\t/* translators: %s: URL to Add Plugins screen. */\n\t\t__( 'If the importer you need is not listed, <a href=\"%s\">search the plugin directory</a> to see if an importer is available.' ),\n\t\tesc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) )\n\t) . '</p>';\n}\n?>\n\n</div>\n\n<?php\nwp_print_request_filesystem_credentials_modal();\nwp_print_admin_notice_templates();\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 241}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Dashboard Administration Screen\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** Load WordPress Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n/** Load WordPress dashboard API */\nrequire_once ABSPATH . 'wp-admin/includes/dashboard.php';\n\nwp_dashboard_setup();\n\nwp_enqueue_script( 'dashboard' );\n\nif ( current_user_can( 'install_plugins' ) ) {\n\twp_enqueue_script( 'plugin-install' );\n\twp_enqueue_script( 'updates' );\n}\nif ( current_user_can( 'upload_files' ) ) {\n\twp_enqueue_script( 'media-upload' );\n}\nadd_thickbox();\n\nif ( wp_is_mobile() ) {\n\twp_enqueue_script( 'jquery-touch-punch' );\n}\n\n$title       = __( 'Dashboard' );\n$parent_file = 'index.php';\n\n$help = '<p>' . __( 'Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab above the screen title.' ) . '</p>';\n\n$screen = get_current_screen();\n\n$screen->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' => $help,\n\t)\n);\n\n// Help tabs.\n\n$help  = '<p>' . __( 'The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.' ) . '</p>';\n$help .= '<p>' . __( 'Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.' ) . '</p>';\n\n$screen->add_help_tab(\n\tarray(\n\t\t'id'      => 'help-navigation',\n\t\t'title'   => __( 'Navigation' ),\n\t\t'content' => $help,\n\t)\n);\n\n$help  = '<p>' . __( 'You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.' ) . '</p>';\n$help .= '<p>' . __( '<strong>Screen Options</strong> &mdash; Use the Screen Options tab to choose which Dashboard boxes to show.' ) . '</p>';\n$help .= '<p>' . __( '<strong>Drag and Drop</strong> &mdash; To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.' ) . '</p>';\n$help .= '<p>' . __( '<strong>Box Controls</strong> &mdash; Click the title bar of the box to expand or collapse it. Some boxes added by plugins may have configurable content, and will show a &#8220;Configure&#8221; link in the title bar if you hover over it.' ) . '</p>';\n\n$screen->add_help_tab(\n\tarray(\n\t\t'id'      => 'help-layout',\n\t\t'title'   => __( 'Layout' ),\n\t\t'content' => $help,\n\t)\n);\n\n$help = '<p>' . __( 'The boxes on your Dashboard screen are:' ) . '</p>';\n\nif ( current_user_can( 'edit_posts' ) ) {\n\t$help .= '<p>' . __( '<strong>At A Glance</strong> &mdash; Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '</p>';\n}\n\n$help .= '<p>' . __( '<strong>Activity</strong> &mdash; Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.' ) . '</p>';\n\nif ( is_blog_admin() && current_user_can( 'edit_posts' ) ) {\n\t$help .= '<p>' . __( \"<strong>Quick Draft</strong> &mdash; Allows you to create a new post and save it as a draft. Also displays links to the 3 most recent draft posts you've started.\" ) . '</p>';\n}\n\n$help .= '<p>' . sprintf(\n\t/* translators: %s: WordPress Planet URL. */\n\t__( '<strong>WordPress Events and News</strong> &mdash; Upcoming events near you as well as the latest news from the official WordPress project and the <a href=\"%s\">WordPress Planet</a>.' ),\n\t__( 'https://planet.wordpress.org/' )\n) . '</p>';\n\nif ( current_user_can( 'edit_theme_options' ) ) {\n\t$help .= '<p>' . __( '<strong>Welcome</strong> &mdash; Shows links for some of the most common tasks when setting up a new site.' ) . '</p>';\n}\n\n$screen->add_help_tab(\n\tarray(\n\t\t'id'      => 'help-content',\n\t\t'title'   => __( 'Content' ),\n\t\t'content' => $help,\n\t)\n);\n\nunset( $help );\n\n$screen->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/dashboard-screen/\">Documentation on Dashboard</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n\n<div class=\"wrap\">\n\t<h1><?php echo esc_html( $title ); ?></h1>\n\n\t<?php\n\tif ( ! empty( $_GET['admin_email_remind_later'] ) ) :\n\t\t/** This filter is documented in wp-login.php */\n\t\t$remind_interval = (int) apply_filters( 'admin_email_remind_interval', 3 * DAY_IN_SECONDS );\n\t\t$postponed_time  = get_option( 'admin_email_lifespan' );\n\n\t\t/*\n\t\t * Calculate how many seconds it's been since the reminder was postponed.\n\t\t * This allows us to not show it if the query arg is set, but visited due to caches, bookmarks or similar.\n\t\t */\n\t\t$time_passed = time() - ( $postponed_time - $remind_interval );\n\n\t\t// Only show the dashboard notice if it's been less than a minute since the message was postponed.\n\t\tif ( $time_passed < MINUTE_IN_SECONDS ) :\n\t\t\t?>\n\t\t<div class=\"notice notice-success is-dismissible\">\n\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: Human-readable time interval. */\n\t\t\t\t\t__( 'The admin email verification page will reappear after %s.' ),\n\t\t\t\t\thuman_time_diff( time() + $remind_interval )\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php endif; ?>\n\t<?php endif; ?>\n\n<?php\nif ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :\n\t$classes = 'welcome-panel';\n\n\t$option = (int) get_user_meta( get_current_user_id(), 'show_welcome_panel', true );\n\t// 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner.\n\t$hide = ( 0 === $option || ( 2 === $option && wp_get_current_user()->user_email !== get_option( 'admin_email' ) ) );\n\tif ( $hide ) {\n\t\t$classes .= ' hidden';\n\t}\n\t?>\n\n\t<div id=\"welcome-panel\" class=\"<?php echo esc_attr( $classes ); ?>\">\n\t\t<?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>\n\t\t<a class=\"welcome-panel-close\" href=\"<?php echo esc_url( admin_url( '?welcome=0' ) ); ?>\" aria-label=\"<?php esc_attr_e( 'Dismiss the welcome panel' ); ?>\"><?php _e( 'Dismiss' ); ?></a>\n\t\t<?php\n\t\t/**\n\t\t * Add content to the welcome panel on the admin dashboard.\n\t\t *\n\t\t * To remove the default welcome panel, use remove_action():\n\t\t *\n\t\t *     remove_action( 'welcome_panel', 'wp_welcome_panel' );\n\t\t *\n\t\t * @since 3.5.0\n\t\t */\n\t\tdo_action( 'welcome_panel' );\n\t\t?>\n\t</div>\n<?php endif; ?>\n\n\t<div id=\"dashboard-widgets-wrap\">\n\t<?php wp_dashboard(); ?>\n\t</div><!-- dashboard-widgets-wrap -->\n\n</div><!-- wrap -->\n\n<?php\nwp_print_community_events_templates();\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 186}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Plugins may load this file to gain access to special helper functions for\n * plugin installation. This file is not included by WordPress and it is\n * recommended, to prevent fatal errors, that this file is included using\n * require_once.\n *\n * These functions are not optimized for speed, but they should only be used\n * once in a while, so speed shouldn't be a concern. If it is and you are\n * needing to use these functions a lot, you might experience time outs. If you\n * do, then it is advised to just write the SQL code yourself.\n *\n *     check_column( 'wp_links', 'link_description', 'mediumtext' );\n *     if ( check_column( $wpdb->comments, 'comment_author', 'tinytext' ) ) {\n *         echo \"ok\\n\";\n *     }\n *\n *     $error_count = 0;\n *     $tablename = $wpdb->links;\n *     // Check the column.\n *     if ( ! check_column( $wpdb->links, 'link_description', 'varchar( 255 )' ) ) {\n *         $ddl = \"ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' \";\n *         $q = $wpdb->query( $ddl );\n *     }\n *\n *     if ( check_column( $wpdb->links, 'link_description', 'varchar( 255 )' ) ) {\n *         $res .= $tablename . ' - ok <br />';\n *     } else {\n *         $res .= 'There was a problem with ' . $tablename . '<br />';\n *         ++$error_count;\n *     }\n *\n * @package WordPress\n * @subpackage Plugin\n */\n\n/** Load WordPress Bootstrap */\nrequire_once dirname( __DIR__ ) . '/wp-load.php';\n\nif ( ! function_exists( 'maybe_create_table' ) ) :\n\t/**\n\t * Creates a table in the database if it doesn't already exist.\n\t *\n\t * @since 1.0.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $table_name Database table name.\n\t * @param string $create_ddl SQL statement to create table.\n\t * @return bool True on success or if the table already exists. False on failure.\n\t */\n\tfunction maybe_create_table( $table_name, $create_ddl ) {\n\t\tglobal $wpdb;\n\n\t\tforeach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) {\n\t\t\tif ( $table === $table_name ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// Didn't find it, so try to create it.\n\t\t$wpdb->query( $create_ddl );\n\n\t\t// We cannot directly tell that whether this succeeded!\n\t\tforeach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) {\n\t\t\tif ( $table === $table_name ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\nendif;\n\nif ( ! function_exists( 'maybe_add_column' ) ) :\n\t/**\n\t * Adds column to database table, if it doesn't already exist.\n\t *\n\t * @since 1.0.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $table_name  Database table name.\n\t * @param string $column_name Table column name.\n\t * @param string $create_ddl  SQL statement to add column.\n\t * @return bool True on success or if the column already exists. False on failure.\n\t */\n\tfunction maybe_add_column( $table_name, $column_name, $create_ddl ) {\n\t\tglobal $wpdb;\n\n\t\tforeach ( $wpdb->get_col( \"DESC $table_name\", 0 ) as $column ) {\n\t\t\tif ( $column === $column_name ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// Didn't find it, so try to create it.\n\t\t$wpdb->query( $create_ddl );\n\n\t\t// We cannot directly tell that whether this succeeded!\n\t\tforeach ( $wpdb->get_col( \"DESC $table_name\", 0 ) as $column ) {\n\t\t\tif ( $column === $column_name ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\nendif;\n\n/**\n * Drops column from database table, if it exists.\n *\n * @since 1.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $table_name  Database table name.\n * @param string $column_name Table column name.\n * @param string $drop_ddl    SQL statement to drop column.\n * @return bool True on success or if the column doesn't exist. False on failure.\n */\nfunction maybe_drop_column( $table_name, $column_name, $drop_ddl ) {\n\tglobal $wpdb;\n\n\tforeach ( $wpdb->get_col( \"DESC $table_name\", 0 ) as $column ) {\n\t\tif ( $column === $column_name ) {\n\n\t\t\t// Found it, so try to drop it.\n\t\t\t$wpdb->query( $drop_ddl );\n\n\t\t\t// We cannot directly tell that whether this succeeded!\n\t\t\tforeach ( $wpdb->get_col( \"DESC $table_name\", 0 ) as $column ) {\n\t\t\t\tif ( $column === $column_name ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Else didn't find it.\n\treturn true;\n}\n\n/**\n * Checks that database table column matches the criteria.\n *\n * Uses the SQL DESC for retrieving the table info for the column. It will help\n * understand the parameters, if you do more research on what column information\n * is returned by the SQL statement. Pass in null to skip checking that\n * criteria.\n *\n * Column names returned from DESC table are case sensitive and are listed:\n *      Field\n *      Type\n *      Null\n *      Key\n *      Default\n *      Extra\n *\n * @since 1.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $table_name Database table name.\n * @param string $col_name   Table column name.\n * @param string $col_type   Table column type.\n * @param bool   $is_null    Optional. Check is null.\n * @param mixed  $key        Optional. Key info.\n * @param mixed  $default    Optional. Default value.\n * @param mixed  $extra      Optional. Extra value.\n * @return bool True, if matches. False, if not matching.\n */\nfunction check_column( $table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null ) {\n\tglobal $wpdb;\n\n\t$diffs   = 0;\n\t$results = $wpdb->get_results( \"DESC $table_name\" );\n\n\tforeach ( $results as $row ) {\n\n\t\tif ( $row->Field === $col_name ) {\n\n\t\t\t// Got our column, check the params.\n\t\t\tif ( ( null !== $col_type ) && ( $row->Type !== $col_type ) ) {\n\t\t\t\t++$diffs;\n\t\t\t}\n\t\t\tif ( ( null !== $is_null ) && ( $row->Null !== $is_null ) ) {\n\t\t\t\t++$diffs;\n\t\t\t}\n\t\t\tif ( ( null !== $key ) && ( $row->Key !== $key ) ) {\n\t\t\t\t++$diffs;\n\t\t\t}\n\t\t\tif ( ( null !== $default ) && ( $row->Default !== $default ) ) {\n\t\t\t\t++$diffs;\n\t\t\t}\n\t\t\tif ( ( null !== $extra ) && ( $row->Extra !== $extra ) ) {\n\t\t\t\t++$diffs;\n\t\t\t}\n\n\t\t\tif ( $diffs > 0 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} // End if found our column.\n\t}\n\n\treturn false;\n}\n", "num_lines": 211}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Installer\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n// Sanity check.\nif ( false ) {\n\t?>\n<!DOCTYPE html>\n<html>\n<head>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\t<title>Error: PHP is not running</title>\n</head>\n<body class=\"wp-core-ui\">\n\t<p id=\"logo\"><a href=\"https://wordpress.org/\">WordPress</a></p>\n\t<h1>Error: PHP is not running</h1>\n\t<p>WordPress requires that your web server is running PHP. Your server does not have PHP installed, or PHP is turned off.</p>\n</body>\n</html>\n\t<?php\n}\n\n/**\n * We are installing WordPress.\n *\n * @since 1.5.1\n * @var bool\n */\ndefine( 'WP_INSTALLING', true );\n\n/** Load WordPress Bootstrap */\nrequire_once dirname( __DIR__ ) . '/wp-load.php';\n\n/** Load WordPress Administration Upgrade API */\nrequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\n/** Load WordPress Translation Install API */\nrequire_once ABSPATH . 'wp-admin/includes/translation-install.php';\n\n/** Load wpdb */\nrequire_once ABSPATH . WPINC . '/wp-db.php';\n\nnocache_headers();\n\n$step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0;\n\n/**\n * Display installation header.\n *\n * @since 2.5.0\n *\n * @param string $body_classes\n */\nfunction display_header( $body_classes = '' ) {\n\theader( 'Content-Type: text/html; charset=utf-8' );\n\tif ( is_rtl() ) {\n\t\t$body_classes .= 'rtl';\n\t}\n\tif ( $body_classes ) {\n\t\t$body_classes = ' ' . $body_classes;\n\t}\n\t?>\n<!DOCTYPE html>\n<html <?php language_attributes(); ?>>\n<head>\n\t<meta name=\"viewport\" content=\"width=device-width\" />\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\t<meta name=\"robots\" content=\"noindex,nofollow\" />\n\t<title><?php _e( 'WordPress &rsaquo; Installation' ); ?></title>\n\t<?php wp_admin_css( 'install', true ); ?>\n</head>\n<body class=\"wp-core-ui<?php echo $body_classes; ?>\">\n<p id=\"logo\"><?php _e( 'WordPress' ); ?></p>\n\n\t<?php\n} // End display_header().\n\n/**\n * Display installer setup form.\n *\n * @since 2.8.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string|null $error\n */\nfunction display_setup_form( $error = null ) {\n\tglobal $wpdb;\n\n\t$user_table = ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->users ) ) ) !== null );\n\n\t// Ensure that sites appear in search engines by default.\n\t$blog_public = 1;\n\tif ( isset( $_POST['weblog_title'] ) ) {\n\t\t$blog_public = isset( $_POST['blog_public'] );\n\t}\n\n\t$weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';\n\t$user_name    = isset( $_POST['user_name'] ) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';\n\t$admin_email  = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : '';\n\n\tif ( ! is_null( $error ) ) {\n\t\t?>\n<h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1>\n<p class=\"message\"><?php echo $error; ?></p>\n<?php } ?>\n<form id=\"setup\" method=\"post\" action=\"install.php?step=2\" novalidate=\"novalidate\">\n\t<table class=\"form-table\" role=\"presentation\">\n\t\t<tr>\n\t\t\t<th scope=\"row\"><label for=\"weblog_title\"><?php _e( 'Site Title' ); ?></label></th>\n\t\t\t<td><input name=\"weblog_title\" type=\"text\" id=\"weblog_title\" size=\"25\" value=\"<?php echo esc_attr( $weblog_title ); ?>\" /></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th scope=\"row\"><label for=\"user_login\"><?php _e( 'Username' ); ?></label></th>\n\t\t\t<td>\n\t\t\t<?php\n\t\t\tif ( $user_table ) {\n\t\t\t\t_e( 'User(s) already exists.' );\n\t\t\t\techo '<input name=\"user_name\" type=\"hidden\" value=\"admin\" />';\n\t\t\t} else {\n\t\t\t\t?>\n\t\t\t\t<input name=\"user_name\" type=\"text\" id=\"user_login\" size=\"25\" value=\"<?php echo esc_attr( sanitize_user( $user_name, true ) ); ?>\" />\n\t\t\t\t<p><?php _e( 'Usernames can have only alphanumeric characters, spaces, underscores, hyphens, periods, and the @ symbol.' ); ?></p>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<?php if ( ! $user_table ) : ?>\n\t\t<tr class=\"form-field form-required user-pass1-wrap\">\n\t\t\t<th scope=\"row\">\n\t\t\t\t<label for=\"pass1\">\n\t\t\t\t\t<?php _e( 'Password' ); ?>\n\t\t\t\t</label>\n\t\t\t</th>\n\t\t\t<td>\n\t\t\t\t<div class=\"wp-pwd\">\n\t\t\t\t\t<?php $initial_password = isset( $_POST['admin_password'] ) ? stripslashes( $_POST['admin_password'] ) : wp_generate_password( 18 ); ?>\n\t\t\t\t\t<input type=\"password\" name=\"admin_password\" id=\"pass1\" class=\"regular-text\" autocomplete=\"off\" data-reveal=\"1\" data-pw=\"<?php echo esc_attr( $initial_password ); ?>\" aria-describedby=\"pass-strength-result\" />\n\t\t\t\t\t<button type=\"button\" class=\"button wp-hide-pw hide-if-no-js\" data-start-masked=\"<?php echo (int) isset( $_POST['admin_password'] ); ?>\" data-toggle=\"0\" aria-label=\"<?php esc_attr_e( 'Hide password' ); ?>\">\n\t\t\t\t\t\t<span class=\"dashicons dashicons-hidden\"></span>\n\t\t\t\t\t\t<span class=\"text\"><?php _e( 'Hide' ); ?></span>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div id=\"pass-strength-result\" aria-live=\"polite\"></div>\n\t\t\t\t</div>\n\t\t\t\t<p><span class=\"description important hide-if-no-js\">\n\t\t\t\t<strong><?php _e( 'Important:' ); ?></strong>\n\t\t\t\t<?php /* translators: The non-breaking space prevents 1Password from thinking the text \"log in\" should trigger a password save prompt. */ ?>\n\t\t\t\t<?php _e( 'You will need this password to log&nbsp;in. Please store it in a secure location.' ); ?></span></p>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"form-field form-required user-pass2-wrap hide-if-js\">\n\t\t\t<th scope=\"row\">\n\t\t\t\t<label for=\"pass2\"><?php _e( 'Repeat Password' ); ?>\n\t\t\t\t\t<span class=\"description\"><?php _e( '(required)' ); ?></span>\n\t\t\t\t</label>\n\t\t\t</th>\n\t\t\t<td>\n\t\t\t\t<input name=\"admin_password2\" type=\"password\" id=\"pass2\" autocomplete=\"off\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"pw-weak\">\n\t\t\t<th scope=\"row\"><?php _e( 'Confirm Password' ); ?></th>\n\t\t\t<td>\n\t\t\t\t<label>\n\t\t\t\t\t<input type=\"checkbox\" name=\"pw_weak\" class=\"pw-checkbox\" />\n\t\t\t\t\t<?php _e( 'Confirm use of weak password' ); ?>\n\t\t\t\t</label>\n\t\t\t</td>\n\t\t</tr>\n\t\t<?php endif; ?>\n\t\t<tr>\n\t\t\t<th scope=\"row\"><label for=\"admin_email\"><?php _e( 'Your Email' ); ?></label></th>\n\t\t\t<td><input name=\"admin_email\" type=\"email\" id=\"admin_email\" size=\"25\" value=\"<?php echo esc_attr( $admin_email ); ?>\" />\n\t\t\t<p><?php _e( 'Double-check your email address before continuing.' ); ?></p></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th scope=\"row\"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site visibility' ) : _e( 'Search engine visibility' ); ?></th>\n\t\t\t<td>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<legend class=\"screen-reader-text\"><span><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site visibility' ) : _e( 'Search engine visibility' ); ?> </span></legend>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( has_action( 'blog_privacy_selector' ) ) {\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<input id=\"blog-public\" type=\"radio\" name=\"blog_public\" value=\"1\" <?php checked( 1, $blog_public ); ?> />\n\t\t\t\t\t\t<label for=\"blog-public\"><?php _e( 'Allow search engines to index this site' ); ?></label><br/>\n\t\t\t\t\t\t<input id=\"blog-norobots\" type=\"radio\" name=\"blog_public\" value=\"0\" <?php checked( 0, $blog_public ); ?> />\n\t\t\t\t\t\t<label for=\"blog-norobots\"><?php _e( 'Discourage search engines from indexing this site' ); ?></label>\n\t\t\t\t\t\t<p class=\"description\"><?php _e( 'Note: Neither of these options blocks access to your site &mdash; it is up to search engines to honor your request.' ); ?></p>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t/** This action is documented in wp-admin/options-reading.php */\n\t\t\t\t\t\tdo_action( 'blog_privacy_selector' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<label for=\"blog_public\"><input name=\"blog_public\" type=\"checkbox\" id=\"blog_public\" value=\"0\" <?php checked( 0, $blog_public ); ?> />\n\t\t\t\t\t\t<?php _e( 'Discourage search engines from indexing this site' ); ?></label>\n\t\t\t\t\t\t<p class=\"description\"><?php _e( 'It is up to search engines to honor this request.' ); ?></p>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</fieldset>\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n\t<p class=\"step\"><?php submit_button( __( 'Install WordPress' ), 'large', 'Submit', false, array( 'id' => 'submit' ) ); ?></p>\n\t<input type=\"hidden\" name=\"language\" value=\"<?php echo isset( $_REQUEST['language'] ) ? esc_attr( $_REQUEST['language'] ) : ''; ?>\" />\n</form>\n\t<?php\n} // End display_setup_form().\n\n// Let's check to make sure WP isn't already installed.\nif ( is_blog_installed() ) {\n\tdisplay_header();\n\tdie(\n\t\t'<h1>' . __( 'Already Installed' ) . '</h1>' .\n\t\t'<p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p>' .\n\t\t'<p class=\"step\"><a href=\"' . esc_url( wp_login_url() ) . '\" class=\"button button-large\">' . __( 'Log In' ) . '</a></p>' .\n\t\t'</body></html>'\n\t);\n}\n\n/**\n * @global string $wp_version             The WordPress version string.\n * @global string $required_php_version   The required PHP version string.\n * @global string $required_mysql_version The required MySQL version string.\n */\nglobal $wp_version, $required_php_version, $required_mysql_version;\n\n$php_version   = phpversion();\n$mysql_version = $wpdb->db_version();\n$php_compat    = version_compare( $php_version, $required_php_version, '>=' );\n$mysql_compat  = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );\n\n$version_url = sprintf(\n\t/* translators: %s: WordPress version. */\n\tesc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),\n\tsanitize_title( $wp_version )\n);\n\n/* translators: %s: URL to Update PHP page. */\n$php_update_message = '</p><p>' . sprintf(\n\t__( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\tesc_url( wp_get_update_php_url() )\n);\n\n$annotation = wp_get_update_php_annotation();\n\nif ( $annotation ) {\n\t$php_update_message .= '</p><p><em>' . $annotation . '</em>';\n}\n\nif ( ! $mysql_compat && ! $php_compat ) {\n\t$compat = sprintf(\n\t\t/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number. */\n\t\t__( 'You cannot install because <a href=\"%1$s\">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ),\n\t\t$version_url,\n\t\t$wp_version,\n\t\t$required_php_version,\n\t\t$required_mysql_version,\n\t\t$php_version,\n\t\t$mysql_version\n\t) . $php_update_message;\n} elseif ( ! $php_compat ) {\n\t$compat = sprintf(\n\t\t/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number. */\n\t\t__( 'You cannot install because <a href=\"%1$s\">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ),\n\t\t$version_url,\n\t\t$wp_version,\n\t\t$required_php_version,\n\t\t$php_version\n\t) . $php_update_message;\n} elseif ( ! $mysql_compat ) {\n\t$compat = sprintf(\n\t\t/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number. */\n\t\t__( 'You cannot install because <a href=\"%1$s\">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ),\n\t\t$version_url,\n\t\t$wp_version,\n\t\t$required_mysql_version,\n\t\t$mysql_version\n\t);\n}\n\nif ( ! $mysql_compat || ! $php_compat ) {\n\tdisplay_header();\n\tdie( '<h1>' . __( 'Requirements Not Met' ) . '</h1><p>' . $compat . '</p></body></html>' );\n}\n\nif ( ! is_string( $wpdb->base_prefix ) || '' === $wpdb->base_prefix ) {\n\tdisplay_header();\n\tdie(\n\t\t'<h1>' . __( 'Configuration Error' ) . '</h1>' .\n\t\t'<p>' . sprintf(\n\t\t\t/* translators: %s: wp-config.php */\n\t\t\t__( 'Your %s file has an empty database table prefix, which is not supported.' ),\n\t\t\t'<code>wp-config.php</code>'\n\t\t) . '</p></body></html>'\n\t);\n}\n\n// Set error message if DO_NOT_UPGRADE_GLOBAL_TABLES isn't set as it will break install.\nif ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {\n\tdisplay_header();\n\tdie(\n\t\t'<h1>' . __( 'Configuration Error' ) . '</h1>' .\n\t\t'<p>' . sprintf(\n\t\t\t/* translators: %s: DO_NOT_UPGRADE_GLOBAL_TABLES */\n\t\t\t__( 'The constant %s cannot be defined when installing WordPress.' ),\n\t\t\t'<code>DO_NOT_UPGRADE_GLOBAL_TABLES</code>'\n\t\t) . '</p></body></html>'\n\t);\n}\n\n/**\n * @global string    $wp_local_package Locale code of the package.\n * @global WP_Locale $wp_locale        WordPress date and time locale object.\n */\n$language = '';\nif ( ! empty( $_REQUEST['language'] ) ) {\n\t$language = preg_replace( '/[^a-zA-Z0-9_]/', '', $_REQUEST['language'] );\n} elseif ( isset( $GLOBALS['wp_local_package'] ) ) {\n\t$language = $GLOBALS['wp_local_package'];\n}\n\n$scripts_to_print = array( 'jquery' );\n\nswitch ( $step ) {\n\tcase 0: // Step 0.\n\t\tif ( wp_can_install_language_pack() && empty( $language ) ) {\n\t\t\t$languages = wp_get_available_translations();\n\t\t\tif ( $languages ) {\n\t\t\t\t$scripts_to_print[] = 'language-chooser';\n\t\t\t\tdisplay_header( 'language-chooser' );\n\t\t\t\techo '<form id=\"setup\" method=\"post\" action=\"?step=1\">';\n\t\t\t\twp_install_language_form( $languages );\n\t\t\t\techo '</form>';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Deliberately fall through if we can't reach the translations API.\n\n\tcase 1: // Step 1, direct link or from language chooser.\n\t\tif ( ! empty( $language ) ) {\n\t\t\t$loaded_language = wp_download_language_pack( $language );\n\t\t\tif ( $loaded_language ) {\n\t\t\t\tload_default_textdomain( $loaded_language );\n\t\t\t\t$GLOBALS['wp_locale'] = new WP_Locale();\n\t\t\t}\n\t\t}\n\n\t\t$scripts_to_print[] = 'user-profile';\n\n\t\tdisplay_header();\n\t\t?>\n<h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1>\n<p><?php _e( 'Welcome to the famous five-minute WordPress installation process! Just fill in the information below and you&#8217;ll be on your way to using the most extendable and powerful personal publishing platform in the world.' ); ?></p>\n\n<h2><?php _e( 'Information needed' ); ?></h2>\n<p><?php _e( 'Please provide the following information. Don&#8217;t worry, you can always change these settings later.' ); ?></p>\n\n\t\t<?php\n\t\tdisplay_setup_form();\n\t\tbreak;\n\tcase 2:\n\t\tif ( ! empty( $language ) && load_default_textdomain( $language ) ) {\n\t\t\t$loaded_language      = $language;\n\t\t\t$GLOBALS['wp_locale'] = new WP_Locale();\n\t\t} else {\n\t\t\t$loaded_language = 'en_US';\n\t\t}\n\n\t\tif ( ! empty( $wpdb->error ) ) {\n\t\t\twp_die( $wpdb->error->get_error_message() );\n\t\t}\n\n\t\t$scripts_to_print[] = 'user-profile';\n\n\t\tdisplay_header();\n\t\t// Fill in the data we gathered.\n\t\t$weblog_title         = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';\n\t\t$user_name            = isset( $_POST['user_name'] ) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';\n\t\t$admin_password       = isset( $_POST['admin_password'] ) ? wp_unslash( $_POST['admin_password'] ) : '';\n\t\t$admin_password_check = isset( $_POST['admin_password2'] ) ? wp_unslash( $_POST['admin_password2'] ) : '';\n\t\t$admin_email          = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : '';\n\t\t$public               = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 1;\n\n\t\t// Check email address.\n\t\t$error = false;\n\t\tif ( empty( $user_name ) ) {\n\t\t\t// TODO: Poka-yoke.\n\t\t\tdisplay_setup_form( __( 'Please provide a valid username.' ) );\n\t\t\t$error = true;\n\t\t} elseif ( sanitize_user( $user_name, true ) !== $user_name ) {\n\t\t\tdisplay_setup_form( __( 'The username you provided has invalid characters.' ) );\n\t\t\t$error = true;\n\t\t} elseif ( $admin_password !== $admin_password_check ) {\n\t\t\t// TODO: Poka-yoke.\n\t\t\tdisplay_setup_form( __( 'Your passwords do not match. Please try again.' ) );\n\t\t\t$error = true;\n\t\t} elseif ( empty( $admin_email ) ) {\n\t\t\t// TODO: Poka-yoke.\n\t\t\tdisplay_setup_form( __( 'You must provide an email address.' ) );\n\t\t\t$error = true;\n\t\t} elseif ( ! is_email( $admin_email ) ) {\n\t\t\t// TODO: Poka-yoke.\n\t\t\tdisplay_setup_form( __( 'Sorry, that isn&#8217;t a valid email address. Email addresses look like <code>username@example.com</code>.' ) );\n\t\t\t$error = true;\n\t\t}\n\n\t\tif ( false === $error ) {\n\t\t\t$wpdb->show_errors();\n\t\t\t$result = wp_install( $weblog_title, $user_name, $admin_email, $public, '', wp_slash( $admin_password ), $loaded_language );\n\t\t\t?>\n\n<h1><?php _e( 'Success!' ); ?></h1>\n\n<p><?php _e( 'WordPress has been installed. Thank you, and enjoy!' ); ?></p>\n\n<table class=\"form-table install-success\">\n\t<tr>\n\t\t<th><?php _e( 'Username' ); ?></th>\n\t\t<td><?php echo esc_html( sanitize_user( $user_name, true ) ); ?></td>\n\t</tr>\n\t<tr>\n\t\t<th><?php _e( 'Password' ); ?></th>\n\t\t<td>\n\t\t\t<?php\n\t\t\tif ( ! empty( $result['password'] ) && empty( $admin_password_check ) ) :\n\t\t\t\t?>\n\t\t\t<code><?php echo esc_html( $result['password'] ); ?></code><br />\n\t\t<?php endif ?>\n\t\t\t<p><?php echo $result['password_message']; ?></p>\n\t\t</td>\n\t</tr>\n</table>\n\n<p class=\"step\"><a href=\"<?php echo esc_url( wp_login_url() ); ?>\" class=\"button button-large\"><?php _e( 'Log In' ); ?></a></p>\n\n\t\t\t<?php\n\t\t}\n\t\tbreak;\n}\n\nif ( ! wp_is_mobile() ) {\n\t?>\n<script type=\"text/javascript\">var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script>\n\t<?php\n}\n\nwp_print_scripts( $scripts_to_print );\n?>\n<script type=\"text/javascript\">\njQuery( function( $ ) {\n\t$( '.hide-if-no-js' ).removeClass( 'hide-if-no-js' );\n} );\n</script>\n</body>\n</html>\n", "num_lines": 461}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Add Link Administration Screen.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'manage_links' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to add links to this site.' ) );\n}\n\n$title       = __( 'Add New Link' );\n$parent_file = 'link-manager.php';\n\nwp_reset_vars( array( 'action', 'cat_id', 'link_id' ) );\n\nwp_enqueue_script( 'link' );\nwp_enqueue_script( 'xfn' );\n\nif ( wp_is_mobile() ) {\n\twp_enqueue_script( 'jquery-touch-punch' );\n}\n\n$link = get_default_link_to_edit();\nrequire ABSPATH . 'wp-admin/edit-link-form.php';\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 32}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Link Management Administration Screen.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\nif ( ! current_user_can( 'manage_links' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) );\n}\n\n$wp_list_table = _get_list_table( 'WP_Links_List_Table' );\n\n// Handle bulk deletes.\n$doaction = $wp_list_table->current_action();\n\nif ( $doaction && isset( $_REQUEST['linkcheck'] ) ) {\n\tcheck_admin_referer( 'bulk-bookmarks' );\n\n\t$redirect_to = admin_url( 'link-manager.php' );\n\t$bulklinks   = (array) $_REQUEST['linkcheck'];\n\n\tif ( 'delete' === $doaction ) {\n\t\tforeach ( $bulklinks as $link_id ) {\n\t\t\t$link_id = (int) $link_id;\n\n\t\t\twp_delete_link( $link_id );\n\t\t}\n\n\t\t$redirect_to = add_query_arg( 'deleted', count( $bulklinks ), $redirect_to );\n\t} else {\n\t\t$screen = get_current_screen()->id;\n\n\t\t/** This action is documented in wp-admin/edit.php */\n\t\t$redirect_to = apply_filters( \"handle_bulk_actions-{$screen}\", $redirect_to, $doaction, $bulklinks ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t}\n\twp_redirect( $redirect_to );\n\texit;\n} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {\n\twp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );\n\texit;\n}\n\n$wp_list_table->prepare_items();\n\n$title       = __( 'Links' );\n$this_file   = 'link-manager.php';\n$parent_file = $this_file;\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t'<p>' . sprintf(\n\t\t\t\t/* translators: %s: URL to Widgets screen. */\n\t\t\t\t__( 'You can add links here to be displayed on your site, usually using <a href=\"%s\">Widgets</a>. By default, links to several sites in the WordPress community are included as examples.' ),\n\t\t\t\t'widgets.php'\n\t\t\t) . '</p>' .\n\t\t\t'<p>' . __( 'Links may be separated into Link Categories; these are different than the categories used on your posts.' ) . '</p>' .\n\t\t\t'<p>' . __( 'You can customize the display of this screen using the Screen Options tab and/or the dropdown filters above the links table.' ) . '</p>',\n\t)\n);\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'deleting-links',\n\t\t'title'   => __( 'Deleting Links' ),\n\t\t'content' =>\n\t\t\t'<p>' . __( 'If you delete a link, it will be removed permanently, as Links do not have a Trash function yet.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://codex.wordpress.org/Links_Screen\">Documentation on Managing Links</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nget_current_screen()->set_screen_reader_content(\n\tarray(\n\t\t'heading_list' => __( 'Links list' ),\n\t)\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\nif ( ! current_user_can( 'manage_links' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) );\n}\n\n?>\n\n<div class=\"wrap nosubsub\">\n<h1 class=\"wp-heading-inline\">\n<?php\necho esc_html( $title );\n?>\n</h1>\n\n<a href=\"link-add.php\" class=\"page-title-action\"><?php echo esc_html_x( 'Add New', 'link' ); ?></a>\n\n<?php\nif ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {\n\t/* translators: %s: Search query. */\n\tprintf( '<span class=\"subtitle\">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( wp_unslash( $_REQUEST['s'] ) ) );\n}\n?>\n\n<hr class=\"wp-header-end\">\n\n<?php\nif ( isset( $_REQUEST['deleted'] ) ) {\n\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>';\n\t$deleted = (int) $_REQUEST['deleted'];\n\t/* translators: %s: Number of links. */\n\tprintf( _n( '%s link deleted.', '%s links deleted.', $deleted ), $deleted );\n\techo '</p></div>';\n\t$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'deleted' ), $_SERVER['REQUEST_URI'] );\n}\n?>\n\n<form id=\"posts-filter\" method=\"get\">\n\n<?php $wp_list_table->search_box( __( 'Search Links' ), 'link' ); ?>\n\n<?php $wp_list_table->display(); ?>\n\n<div id=\"ajax-response\"></div>\n</form>\n\n</div>\n\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 138}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Parse OPML XML files and store in globals.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\tdie();\n}\n\n/**\n * @global string $opml\n */\nglobal $opml;\n\n/**\n * XML callback function for the start of a new XML tag.\n *\n * @since 0.71\n * @access private\n *\n * @global array $names\n * @global array $urls\n * @global array $targets\n * @global array $descriptions\n * @global array $feeds\n *\n * @param resource $parser   XML Parser resource.\n * @param string   $tag_name XML element name.\n * @param array    $attrs    XML element attributes.\n */\nfunction startElement( $parser, $tag_name, $attrs ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid\n\tglobal $names, $urls, $targets, $descriptions, $feeds;\n\n\tif ( 'OUTLINE' === $tag_name ) {\n\t\t$name = '';\n\t\tif ( isset( $attrs['TEXT'] ) ) {\n\t\t\t$name = $attrs['TEXT'];\n\t\t}\n\t\tif ( isset( $attrs['TITLE'] ) ) {\n\t\t\t$name = $attrs['TITLE'];\n\t\t}\n\t\t$url = '';\n\t\tif ( isset( $attrs['URL'] ) ) {\n\t\t\t$url = $attrs['URL'];\n\t\t}\n\t\tif ( isset( $attrs['HTMLURL'] ) ) {\n\t\t\t$url = $attrs['HTMLURL'];\n\t\t}\n\n\t\t// Save the data away.\n\t\t$names[]        = $name;\n\t\t$urls[]         = $url;\n\t\t$targets[]      = isset( $attrs['TARGET'] ) ? $attrs['TARGET'] : '';\n\t\t$feeds[]        = isset( $attrs['XMLURL'] ) ? $attrs['XMLURL'] : '';\n\t\t$descriptions[] = isset( $attrs['DESCRIPTION'] ) ? $attrs['DESCRIPTION'] : '';\n\t} // End if outline.\n}\n\n/**\n * XML callback function that is called at the end of a XML tag.\n *\n * @since 0.71\n * @access private\n *\n * @param resource $parser   XML Parser resource.\n * @param string   $tag_name XML tag name.\n */\nfunction endElement( $parser, $tag_name ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid\n\t// Nothing to do.\n}\n\n// Create an XML parser.\nif ( ! function_exists( 'xml_parser_create' ) ) {\n\ttrigger_error( __( \"PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension.\" ) );\n\twp_die( __( \"PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension.\" ) );\n}\n\n$xml_parser = xml_parser_create();\n\n// Set the functions to handle opening and closing tags.\nxml_set_element_handler( $xml_parser, 'startElement', 'endElement' );\n\nif ( ! xml_parse( $xml_parser, $opml, true ) ) {\n\tprintf(\n\t\t/* translators: 1: Error message, 2: Line number. */\n\t\t__( 'XML Error: %1$s at line %2$s' ),\n\t\txml_error_string( xml_get_error_code( $xml_parser ) ),\n\t\txml_get_current_line_number( $xml_parser )\n\t);\n}\n\n// Free up memory used by the XML parser.\nxml_parser_free( $xml_parser );\nunset( $xml_parser );\n", "num_lines": 98}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Manage link administration actions.\n *\n * This page is accessed by the link management pages and handles the forms and\n * Ajax processes for link actions.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nwp_reset_vars( array( 'action', 'cat_id', 'link_id' ) );\n\nif ( ! current_user_can( 'manage_links' ) ) {\n\twp_link_manager_disabled_message();\n}\n\nif ( ! empty( $_POST['deletebookmarks'] ) ) {\n\t$action = 'deletebookmarks';\n}\nif ( ! empty( $_POST['move'] ) ) {\n\t$action = 'move';\n}\nif ( ! empty( $_POST['linkcheck'] ) ) {\n\t$linkcheck = $_POST['linkcheck'];\n}\n\n$this_file = admin_url( 'link-manager.php' );\n\nswitch ( $action ) {\n\tcase 'deletebookmarks':\n\t\tcheck_admin_referer( 'bulk-bookmarks' );\n\n\t\t// For each link id (in $linkcheck[]) change category to selected value.\n\t\tif ( count( $linkcheck ) === 0 ) {\n\t\t\twp_redirect( $this_file );\n\t\t\texit;\n\t\t}\n\n\t\t$deleted = 0;\n\t\tforeach ( $linkcheck as $link_id ) {\n\t\t\t$link_id = (int) $link_id;\n\n\t\t\tif ( wp_delete_link( $link_id ) ) {\n\t\t\t\t$deleted++;\n\t\t\t}\n\t\t}\n\n\t\twp_redirect( \"$this_file?deleted=$deleted\" );\n\t\texit;\n\n\tcase 'move':\n\t\tcheck_admin_referer( 'bulk-bookmarks' );\n\n\t\t// For each link id (in $linkcheck[]) change category to selected value.\n\t\tif ( count( $linkcheck ) === 0 ) {\n\t\t\twp_redirect( $this_file );\n\t\t\texit;\n\t\t}\n\t\t$all_links = join( ',', $linkcheck );\n\t\t/*\n\t\t * Should now have an array of links we can change:\n\t\t *     $q = $wpdb->query(\"update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)\");\n\t\t */\n\n\t\twp_redirect( $this_file );\n\t\texit;\n\n\tcase 'add':\n\t\tcheck_admin_referer( 'add-bookmark' );\n\n\t\t$redir = wp_get_referer();\n\t\tif ( add_link() ) {\n\t\t\t$redir = add_query_arg( 'added', 'true', $redir );\n\t\t}\n\n\t\twp_redirect( $redir );\n\t\texit;\n\n\tcase 'save':\n\t\t$link_id = (int) $_POST['link_id'];\n\t\tcheck_admin_referer( 'update-bookmark_' . $link_id );\n\n\t\tedit_link( $link_id );\n\n\t\twp_redirect( $this_file );\n\t\texit;\n\n\tcase 'delete':\n\t\t$link_id = (int) $_GET['link_id'];\n\t\tcheck_admin_referer( 'delete-bookmark_' . $link_id );\n\n\t\twp_delete_link( $link_id );\n\n\t\twp_redirect( $this_file );\n\t\texit;\n\n\tcase 'edit':\n\t\twp_enqueue_script( 'link' );\n\t\twp_enqueue_script( 'xfn' );\n\n\t\tif ( wp_is_mobile() ) {\n\t\t\twp_enqueue_script( 'jquery-touch-punch' );\n\t\t}\n\n\t\t$parent_file  = 'link-manager.php';\n\t\t$submenu_file = 'link-manager.php';\n\t\t$title        = __( 'Edit Link' );\n\n\t\t$link_id = (int) $_GET['link_id'];\n\n\t\t$link = get_link_to_edit( $link_id );\n\t\tif ( ! $link ) {\n\t\t\twp_die( __( 'Link not found.' ) );\n\t\t}\n\n\t\trequire ABSPATH . 'wp-admin/edit-link-form.php';\n\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t\tbreak;\n\n\tdefault:\n\t\tbreak;\n}\n", "num_lines": 127}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * Disable error reporting\n *\n * Set this to error_reporting( -1 ) for debugging.\n */\nerror_reporting( 0 );\n\n/** Set ABSPATH for execution */\nif ( ! defined( 'ABSPATH' ) ) {\n\tdefine( 'ABSPATH', dirname( __DIR__ ) . '/' );\n}\n\ndefine( 'WPINC', 'wp-includes' );\n\n$protocol = $_SERVER['SERVER_PROTOCOL'];\nif ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ), true ) ) {\n\t$protocol = 'HTTP/1.0';\n}\n\n$load = $_GET['load'];\nif ( is_array( $load ) ) {\n\tksort( $load );\n\t$load = implode( '', $load );\n}\n\n$load = preg_replace( '/[^a-z0-9,_-]+/i', '', $load );\n$load = array_unique( explode( ',', $load ) );\n\nif ( empty( $load ) ) {\n\theader( \"$protocol 400 Bad Request\" );\n\texit;\n}\n\nrequire ABSPATH . 'wp-admin/includes/noop.php';\nrequire ABSPATH . WPINC . '/script-loader.php';\nrequire ABSPATH . WPINC . '/version.php';\n\n$expires_offset = 31536000; // 1 year.\n$out            = '';\n\n$wp_scripts = new WP_Scripts();\nwp_default_scripts( $wp_scripts );\nwp_default_packages_vendor( $wp_scripts );\nwp_default_packages_scripts( $wp_scripts );\n\nif ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) {\n\theader( \"$protocol 304 Not Modified\" );\n\texit;\n}\n\nforeach ( $load as $handle ) {\n\tif ( ! array_key_exists( $handle, $wp_scripts->registered ) ) {\n\t\tcontinue;\n\t}\n\n\t$path = ABSPATH . $wp_scripts->registered[ $handle ]->src;\n\t$out .= get_file( $path ) . \"\\n\";\n}\n\nheader( \"Etag: $wp_version\" );\nheader( 'Content-Type: application/javascript; charset=UTF-8' );\nheader( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' );\nheader( \"Cache-Control: public, max-age=$expires_offset\" );\n\necho $out;\nexit;\n", "num_lines": 69}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * Disable error reporting\n *\n * Set this to error_reporting( -1 ) for debugging\n */\nerror_reporting( 0 );\n\n/** Set ABSPATH for execution */\nif ( ! defined( 'ABSPATH' ) ) {\n\tdefine( 'ABSPATH', dirname( __DIR__ ) . '/' );\n}\n\ndefine( 'WPINC', 'wp-includes' );\n\nrequire ABSPATH . 'wp-admin/includes/noop.php';\nrequire ABSPATH . WPINC . '/script-loader.php';\nrequire ABSPATH . WPINC . '/version.php';\n\n$protocol = $_SERVER['SERVER_PROTOCOL'];\nif ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ), true ) ) {\n\t$protocol = 'HTTP/1.0';\n}\n\n$load = $_GET['load'];\nif ( is_array( $load ) ) {\n\tksort( $load );\n\t$load = implode( '', $load );\n}\n\n$load = preg_replace( '/[^a-z0-9,_-]+/i', '', $load );\n$load = array_unique( explode( ',', $load ) );\n\nif ( empty( $load ) ) {\n\theader( \"$protocol 400 Bad Request\" );\n\texit;\n}\n\n$rtl            = ( isset( $_GET['dir'] ) && 'rtl' === $_GET['dir'] );\n$expires_offset = 31536000; // 1 year.\n$out            = '';\n\n$wp_styles = new WP_Styles();\nwp_default_styles( $wp_styles );\n\nif ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) {\n\theader( \"$protocol 304 Not Modified\" );\n\texit;\n}\n\nforeach ( $load as $handle ) {\n\tif ( ! array_key_exists( $handle, $wp_styles->registered ) ) {\n\t\tcontinue;\n\t}\n\n\t$style = $wp_styles->registered[ $handle ];\n\n\tif ( empty( $style->src ) ) {\n\t\tcontinue;\n\t}\n\n\t$path = ABSPATH . $style->src;\n\n\tif ( $rtl && ! empty( $style->extra['rtl'] ) ) {\n\t\t// All default styles have fully independent RTL files.\n\t\t$path = str_replace( '.min.css', '-rtl.min.css', $path );\n\t}\n\n\t$content = get_file( $path ) . \"\\n\";\n\n\tif ( strpos( $style->src, '/' . WPINC . '/css/' ) === 0 ) {\n\t\t$content = str_replace( '../images/', '../' . WPINC . '/images/', $content );\n\t\t$content = str_replace( '../js/tinymce/', '../' . WPINC . '/js/tinymce/', $content );\n\t\t$content = str_replace( '../fonts/', '../' . WPINC . '/fonts/', $content );\n\t\t$out    .= $content;\n\t} else {\n\t\t$out .= str_replace( '../images/', 'images/', $content );\n\t}\n}\n\nheader( \"Etag: $wp_version\" );\nheader( 'Content-Type: text/css; charset=UTF-8' );\nheader( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' );\nheader( \"Cache-Control: public, max-age=$expires_offset\" );\n\necho $out;\nexit;\n", "num_lines": 89}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Manage media uploaded file.\n *\n * There are many filters in here for media. Plugins can extend functionality\n * by hooking into the filters.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'upload_files' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to upload files.' ) );\n}\n\nwp_enqueue_script( 'plupload-handlers' );\n\n$post_id = 0;\nif ( isset( $_REQUEST['post_id'] ) ) {\n\t$post_id = absint( $_REQUEST['post_id'] );\n\tif ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t$post_id = 0;\n\t}\n}\n\nif ( $_POST ) {\n\tif ( isset( $_POST['html-upload'] ) && ! empty( $_FILES ) ) {\n\t\tcheck_admin_referer( 'media-form' );\n\t\t// Upload File button was clicked.\n\t\t$upload_id = media_handle_upload( 'async-upload', $post_id );\n\t\tif ( is_wp_error( $upload_id ) ) {\n\t\t\twp_die( $upload_id );\n\t\t}\n\t}\n\twp_redirect( admin_url( 'upload.php' ) );\n\texit;\n}\n\n$title       = __( 'Upload New Media' );\n$parent_file = 'upload.php';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t\t'<p>' . __( 'You can upload media files here without creating a post first. This allows you to upload files to use with posts and pages later and/or to get a web link for a particular file that you can share. There are three options for uploading files:' ) . '</p>' .\n\t\t\t\t'<ul>' .\n\t\t\t\t\t'<li>' . __( '<strong>Drag and drop</strong> your files into the area below. Multiple files are allowed.' ) . '</li>' .\n\t\t\t\t\t'<li>' . __( 'Clicking <strong>Select Files</strong> opens a navigation window showing you files in your operating system. Selecting <strong>Open</strong> after clicking on the file you want activates a progress bar on the uploader screen.' ) . '</li>' .\n\t\t\t\t\t'<li>' . __( 'Revert to the <strong>Browser Uploader</strong> by clicking the link below the drag and drop box.' ) . '</li>' .\n\t\t\t\t'</ul>',\n\t)\n);\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/media-add-new-screen/\">Documentation on Uploading Media Files</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n$form_class = 'media-upload-form type-form validate';\n\nif ( get_user_setting( 'uploader' ) || isset( $_GET['browser-uploader'] ) ) {\n\t$form_class .= ' html-uploader';\n}\n?>\n<div class=\"wrap\">\n\t<h1><?php echo esc_html( $title ); ?></h1>\n\n\t<form enctype=\"multipart/form-data\" method=\"post\" action=\"<?php echo admin_url( 'media-new.php' ); ?>\" class=\"<?php echo esc_attr( $form_class ); ?>\" id=\"file-form\">\n\n\t<?php media_upload_form(); ?>\n\n\t<script type=\"text/javascript\">\n\tvar post_id = <?php echo absint( $post_id ); ?>, shortform = 3;\n\t</script>\n\t<input type=\"hidden\" name=\"post_id\" id=\"post_id\" value=\"<?php echo absint( $post_id ); ?>\" />\n\t<?php wp_nonce_field( 'media-form' ); ?>\n\t<div id=\"media-items\" class=\"hide-if-no-js\"></div>\n\t</form>\n</div>\n\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 90}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Manage media uploaded file.\n *\n * There are many filters in here for media. Plugins can extend functionality\n * by hooking into the filters.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\nif ( ! isset( $_GET['inline'] ) ) {\n\tdefine( 'IFRAME_REQUEST', true );\n}\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'upload_files' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to upload files.' ), 403 );\n}\n\nwp_enqueue_script( 'plupload-handlers' );\nwp_enqueue_script( 'image-edit' );\nwp_enqueue_script( 'set-post-thumbnail' );\nwp_enqueue_style( 'imgareaselect' );\nwp_enqueue_script( 'media-gallery' );\n\nheader( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );\n\n// IDs should be integers.\n$ID      = isset( $ID ) ? (int) $ID : 0; // phpcs:ignore WordPress.NamingConventions.ValidVariableName\n$post_id = isset( $post_id ) ? (int) $post_id : 0;\n\n// Require an ID for the edit screen.\nif ( isset( $action ) && 'edit' === $action && ! $ID ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName\n\twp_die(\n\t\t'<h1>' . __( 'Something went wrong.' ) . '</h1>' .\n\t\t'<p>' . __( 'Invalid item ID.' ) . '</p>',\n\t\t403\n\t);\n}\n\nif ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post', $_REQUEST['post_id'] ) ) {\n\twp_die(\n\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t'<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',\n\t\t403\n\t);\n}\n\n// Upload type: image, video, file, ...?\nif ( isset( $_GET['type'] ) ) {\n\t$type = strval( $_GET['type'] );\n} else {\n\t/**\n\t * Filters the default media upload type in the legacy (pre-3.5.0) media popup.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $type The default media upload type. Possible values include\n\t *                     'image', 'audio', 'video', 'file', etc. Default 'file'.\n\t */\n\t$type = apply_filters( 'media_upload_default_type', 'file' );\n}\n\n// Tab: gallery, library, or type-specific.\nif ( isset( $_GET['tab'] ) ) {\n\t$tab = strval( $_GET['tab'] );\n} else {\n\t/**\n\t * Filters the default tab in the legacy (pre-3.5.0) media popup.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $type The default media popup tab. Default 'type' (From Computer).\n\t */\n\t$tab = apply_filters( 'media_upload_default_tab', 'type' );\n}\n\n$body_id = 'media-upload';\n\n// Let the action code decide how to handle the request.\nif ( 'type' === $tab || 'type_url' === $tab || ! array_key_exists( $tab, media_upload_tabs() ) ) {\n\t/**\n\t * Fires inside specific upload-type views in the legacy (pre-3.5.0)\n\t * media popup based on the current tab.\n\t *\n\t * The dynamic portion of the hook name, `$type`, refers to the specific\n\t * media upload type. Possible values include 'image', 'audio', 'video',\n\t * 'file', etc.\n\t *\n\t * The hook only fires if the current `$tab` is 'type' (From Computer),\n\t * 'type_url' (From URL), or, if the tab does not exist (i.e., has not\n\t * been registered via the {@see 'media_upload_tabs'} filter.\n\t *\n\t * @since 2.5.0\n\t */\n\tdo_action( \"media_upload_{$type}\" );\n} else {\n\t/**\n\t * Fires inside limited and specific upload-tab views in the legacy\n\t * (pre-3.5.0) media popup.\n\t *\n\t * The dynamic portion of the hook name, `$tab`, refers to the specific\n\t * media upload tab. Possible values include 'library' (Media Library),\n\t * or any custom tab registered via the {@see 'media_upload_tabs'} filter.\n\t *\n\t * @since 2.5.0\n\t */\n\tdo_action( \"media_upload_{$tab}\" );\n}\n\n", "num_lines": 114}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Media management action handler.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n$parent_file  = 'upload.php';\n$submenu_file = 'upload.php';\n\nwp_reset_vars( array( 'action' ) );\n\nswitch ( $action ) {\n\tcase 'editattachment':\n\t\t$attachment_id = (int) $_POST['attachment_id'];\n\t\tcheck_admin_referer( 'media-form' );\n\n\t\tif ( ! current_user_can( 'edit_post', $attachment_id ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to edit this attachment.' ) );\n\t\t}\n\n\t\t$errors = media_upload_form_handler();\n\n\t\tif ( empty( $errors ) ) {\n\t\t\t$location = 'media.php';\n\t\t\t$referer  = wp_get_original_referer();\n\t\t\tif ( $referer ) {\n\t\t\t\tif ( false !== strpos( $referer, 'upload.php' ) || ( url_to_postid( $referer ) === $attachment_id ) ) {\n\t\t\t\t\t$location = $referer;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( false !== strpos( $location, 'upload.php' ) ) {\n\t\t\t\t$location = remove_query_arg( 'message', $location );\n\t\t\t\t$location = add_query_arg( 'posted', $attachment_id, $location );\n\t\t\t} elseif ( false !== strpos( $location, 'media.php' ) ) {\n\t\t\t\t$location = add_query_arg( 'message', 'updated', $location );\n\t\t\t}\n\t\t\twp_redirect( $location );\n\t\t\texit;\n\t\t}\n\n\t\t// No break.\n\tcase 'edit':\n\t\t$title = __( 'Edit Media' );\n\n\t\tif ( empty( $errors ) ) {\n\t\t\t$errors = null;\n\t\t}\n\n\t\tif ( empty( $_GET['attachment_id'] ) ) {\n\t\t\twp_redirect( admin_url( 'upload.php' ) );\n\t\t\texit;\n\t\t}\n\t\t$att_id = (int) $_GET['attachment_id'];\n\n\t\tif ( ! current_user_can( 'edit_post', $att_id ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to edit this attachment.' ) );\n\t\t}\n\n\t\t$att = get_post( $att_id );\n\n\t\tif ( empty( $att->ID ) ) {\n\t\t\twp_die( __( 'You attempted to edit an attachment that doesn&#8217;t exist. Perhaps it was deleted?' ) );\n\t\t}\n\t\tif ( 'attachment' !== $att->post_type ) {\n\t\t\twp_die( __( 'You attempted to edit an item that isn&#8217;t an attachment. Please go back and try again.' ) );\n\t\t}\n\t\tif ( 'trash' === $att->post_status ) {\n\t\t\twp_die( __( 'You can&#8217;t edit this attachment because it is in the Trash. Please move it out of the Trash and try again.' ) );\n\t\t}\n\n\t\tadd_filter( 'attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2 );\n\n\t\twp_enqueue_script( 'wp-ajax-response' );\n\t\twp_enqueue_script( 'image-edit' );\n\t\twp_enqueue_style( 'imgareaselect' );\n\n\t\tget_current_screen()->add_help_tab(\n\t\t\tarray(\n\t\t\t\t'id'      => 'overview',\n\t\t\t\t'title'   => __( 'Overview' ),\n\t\t\t\t'content' =>\n\t\t\t\t\t'<p>' . __( 'This screen allows you to edit fields for metadata in a file within the media library.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'For images only, you can click on Edit Image under the thumbnail to expand out an inline image editor with icons for cropping, rotating, or flipping the image as well as for undoing and redoing. The boxes on the right give you more options for scaling the image, for cropping it, and for cropping the thumbnail in a different way than you crop the original image. You can click on Help in those boxes to get more information.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'Note that you crop the image by clicking on it (the Crop icon is already selected) and dragging the cropping frame to select the desired part. Then click Save to retain the cropping.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'Remember to click Update Media to save metadata entered or changed.' ) . '</p>',\n\t\t\t)\n\t\t);\n\n\t\tget_current_screen()->set_help_sidebar(\n\t\t\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/edit-media/\">Documentation on Edit Media</a>' ) . '</p>' .\n\t\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n\t\t);\n\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n\t\t$parent_file = 'upload.php';\n\t\t$message     = '';\n\t\t$class       = '';\n\t\tif ( isset( $_GET['message'] ) ) {\n\t\t\tswitch ( $_GET['message'] ) {\n\t\t\t\tcase 'updated':\n\t\t\t\t\t$message = __( 'Media file updated.' );\n\t\t\t\t\t$class   = 'updated';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ( $message ) {\n\t\t\techo \"<div id='message' class='$class'><p>$message</p></div>\\n\";\n\t\t}\n\n\t\t?>\n\n\t<div class=\"wrap\">\n\t<h1 class=\"wp-heading-inline\">\n\t\t<?php\n\t\techo esc_html( $title );\n\t\t?>\n</h1>\n\n\t\t<?php\n\t\tif ( current_user_can( 'upload_files' ) ) {\n\t\t\t?>\n\t<a href=\"media-new.php\" class=\"page-title-action\"><?php echo esc_html_x( 'Add New', 'file' ); ?></a>\n<?php } ?>\n\n\t<hr class=\"wp-header-end\">\n\n\t<form method=\"post\" class=\"media-upload-form\" id=\"media-single-form\">\n\t<p class=\"submit\" style=\"padding-bottom: 0;\">\n\t\t<?php submit_button( __( 'Update Media' ), 'primary', 'save', false ); ?>\n\t</p>\n\n\t<div class=\"media-single\">\n\t<div id=\"media-item-<?php echo $att_id; ?>\" class=\"media-item\">\n\t\t<?php\n\t\techo get_media_item(\n\t\t\t$att_id,\n\t\t\tarray(\n\t\t\t\t'toggle'     => false,\n\t\t\t\t'send'       => false,\n\t\t\t\t'delete'     => false,\n\t\t\t\t'show_title' => false,\n\t\t\t\t'errors'     => ! empty( $errors[ $att_id ] ) ? $errors[ $att_id ] : null,\n\t\t\t)\n\t\t);\n\t\t?>\n\t</div>\n\t</div>\n\n\t\t<?php submit_button( __( 'Update Media' ), 'primary', 'save' ); ?>\n\t<input type=\"hidden\" name=\"post_id\" id=\"post_id\" value=\"<?php echo isset( $post_id ) ? esc_attr( $post_id ) : ''; ?>\" />\n\t<input type=\"hidden\" name=\"attachment_id\" id=\"attachment_id\" value=\"<?php echo esc_attr( $att_id ); ?>\" />\n\t<input type=\"hidden\" name=\"action\" value=\"editattachment\" />\n\t\t<?php wp_original_referer_field( true, 'previous' ); ?>\n\t\t<?php wp_nonce_field( 'media-form' ); ?>\n\n\t</form>\n\n\t</div>\n\n\t\t<?php\n\n\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\n\t\texit;\n\n\tdefault:\n\t\twp_redirect( admin_url( 'upload.php' ) );\n\t\texit;\n\n}\n", "num_lines": 178}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays Administration Menu.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * The current page.\n *\n * @global string $self\n */\n$self = preg_replace( '|^.*/wp-admin/network/|i', '', $_SERVER['PHP_SELF'] );\n$self = preg_replace( '|^.*/wp-admin/|i', '', $self );\n$self = preg_replace( '|^.*/plugins/|i', '', $self );\n$self = preg_replace( '|^.*/mu-plugins/|i', '', $self );\n\n/**\n * For when admin-header is included from within a function.\n *\n * @global array  $menu\n * @global array  $submenu\n * @global string $parent_file\n * @global string $submenu_file\n */\nglobal $menu, $submenu, $parent_file, $submenu_file;\n\n/**\n * Filters the parent file of an admin menu sub-menu item.\n *\n * Allows plugins to move sub-menu items around.\n *\n * @since MU (3.0.0)\n *\n * @param string $parent_file The parent file.\n */\n$parent_file = apply_filters( 'parent_file', $parent_file );\n\n/**\n * Filters the file of an admin menu sub-menu item.\n *\n * @since 4.4.0\n *\n * @param string $submenu_file The submenu file.\n * @param string $parent_file  The submenu item's parent file.\n */\n$submenu_file = apply_filters( 'submenu_file', $submenu_file, $parent_file );\n\nget_admin_page_parent();\n\n/**\n * Display menu.\n *\n * @access private\n * @since 2.7.0\n *\n * @global string $self\n * @global string $parent_file\n * @global string $submenu_file\n * @global string $plugin_page\n * @global string $typenow\n *\n * @param array $menu\n * @param array $submenu\n * @param bool  $submenu_as_parent\n */\nfunction _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {\n\tglobal $self, $parent_file, $submenu_file, $plugin_page, $typenow;\n\n\t$first = true;\n\t// 0 = menu_title, 1 = capability, 2 = menu_slug, 3 = page_title, 4 = classes, 5 = hookname, 6 = icon_url.\n\tforeach ( $menu as $key => $item ) {\n\t\t$admin_is_parent = false;\n\t\t$class           = array();\n\t\t$aria_attributes = '';\n\t\t$aria_hidden     = '';\n\t\t$is_separator    = false;\n\n\t\tif ( $first ) {\n\t\t\t$class[] = 'wp-first-item';\n\t\t\t$first   = false;\n\t\t}\n\n\t\t$submenu_items = array();\n\t\tif ( ! empty( $submenu[ $item[2] ] ) ) {\n\t\t\t$class[]       = 'wp-has-submenu';\n\t\t\t$submenu_items = $submenu[ $item[2] ];\n\t\t}\n\n\t\tif ( ( $parent_file && $item[2] === $parent_file ) || ( empty( $typenow ) && $self === $item[2] ) ) {\n\t\t\tif ( ! empty( $submenu_items ) ) {\n\t\t\t\t$class[] = 'wp-has-current-submenu wp-menu-open';\n\t\t\t} else {\n\t\t\t\t$class[]          = 'current';\n\t\t\t\t$aria_attributes .= 'aria-current=\"page\"';\n\t\t\t}\n\t\t} else {\n\t\t\t$class[] = 'wp-not-current-submenu';\n\t\t\tif ( ! empty( $submenu_items ) ) {\n\t\t\t\t$aria_attributes .= 'aria-haspopup=\"true\"';\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $item[4] ) ) {\n\t\t\t$class[] = esc_attr( $item[4] );\n\t\t}\n\n\t\t$class     = $class ? ' class=\"' . join( ' ', $class ) . '\"' : '';\n\t\t$id        = ! empty( $item[5] ) ? ' id=\"' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '\"' : '';\n\t\t$img       = '';\n\t\t$img_style = '';\n\t\t$img_class = ' dashicons-before';\n\n\t\tif ( false !== strpos( $class, 'wp-menu-separator' ) ) {\n\t\t\t$is_separator = true;\n\t\t}\n\n\t\t/*\n\t\t * If the string 'none' (previously 'div') is passed instead of a URL, don't output\n\t\t * the default menu image so an icon can be added to div.wp-menu-image as background\n\t\t * with CSS. Dashicons and base64-encoded data:image/svg_xml URIs are also handled\n\t\t * as special cases.\n\t\t */\n\t\tif ( ! empty( $item[6] ) ) {\n\t\t\t$img = '<img src=\"' . $item[6] . '\" alt=\"\" />';\n\n\t\t\tif ( 'none' === $item[6] || 'div' === $item[6] ) {\n\t\t\t\t$img = '<br />';\n\t\t\t} elseif ( 0 === strpos( $item[6], 'data:image/svg+xml;base64,' ) ) {\n\t\t\t\t$img       = '<br />';\n\t\t\t\t$img_style = ' style=\"background-image:url(\\'' . esc_attr( $item[6] ) . '\\')\"';\n\t\t\t\t$img_class = ' svg';\n\t\t\t} elseif ( 0 === strpos( $item[6], 'dashicons-' ) ) {\n\t\t\t\t$img       = '<br />';\n\t\t\t\t$img_class = ' dashicons-before ' . sanitize_html_class( $item[6] );\n\t\t\t}\n\t\t}\n\t\t$arrow = '<div class=\"wp-menu-arrow\"><div></div></div>';\n\n\t\t$title = wptexturize( $item[0] );\n\n\t\t// Hide separators from screen readers.\n\t\tif ( $is_separator ) {\n\t\t\t$aria_hidden = ' aria-hidden=\"true\"';\n\t\t}\n\n\t\techo \"\\n\\t<li$class$id$aria_hidden>\";\n\n\t\tif ( $is_separator ) {\n\t\t\techo '<div class=\"separator\"></div>';\n\t\t} elseif ( $submenu_as_parent && ! empty( $submenu_items ) ) {\n\t\t\t$submenu_items = array_values( $submenu_items );  // Re-index.\n\t\t\t$menu_hook     = get_plugin_page_hook( $submenu_items[0][2], $item[2] );\n\t\t\t$menu_file     = $submenu_items[0][2];\n\t\t\t$pos           = strpos( $menu_file, '?' );\n\n\t\t\tif ( false !== $pos ) {\n\t\t\t\t$menu_file = substr( $menu_file, 0, $pos );\n\t\t\t}\n\n\t\t\tif ( ! empty( $menu_hook )\n\t\t\t\t|| ( ( 'index.php' !== $submenu_items[0][2] )\n\t\t\t\t\t&& file_exists( WP_PLUGIN_DIR . \"/$menu_file\" )\n\t\t\t\t\t&& ! file_exists( ABSPATH . \"/wp-admin/$menu_file\" ) )\n\t\t\t) {\n\t\t\t\t$admin_is_parent = true;\n\t\t\t\techo \"<a href='admin.php?page={$submenu_items[0][2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style>$img</div><div class='wp-menu-name'>$title</div></a>\";\n\t\t\t} else {\n\t\t\t\techo \"\\n\\t<a href='{$submenu_items[0][2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style>$img</div><div class='wp-menu-name'>$title</div></a>\";\n\t\t\t}\n\t\t} elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) {\n\t\t\t$menu_hook = get_plugin_page_hook( $item[2], 'admin.php' );\n\t\t\t$menu_file = $item[2];\n\t\t\t$pos       = strpos( $menu_file, '?' );\n\n\t\t\tif ( false !== $pos ) {\n\t\t\t\t$menu_file = substr( $menu_file, 0, $pos );\n\t\t\t}\n\n\t\t\tif ( ! empty( $menu_hook )\n\t\t\t\t|| ( ( 'index.php' !== $item[2] )\n\t\t\t\t\t&& file_exists( WP_PLUGIN_DIR . \"/$menu_file\" )\n\t\t\t\t\t&& ! file_exists( ABSPATH . \"/wp-admin/$menu_file\" ) )\n\t\t\t) {\n\t\t\t\t$admin_is_parent = true;\n\t\t\t\techo \"\\n\\t<a href='admin.php?page={$item[2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>\";\n\t\t\t} else {\n\t\t\t\techo \"\\n\\t<a href='{$item[2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>\";\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $submenu_items ) ) {\n\t\t\techo \"\\n\\t<ul class='wp-submenu wp-submenu-wrap'>\";\n\t\t\techo \"<li class='wp-submenu-head' aria-hidden='true'>{$item[0]}</li>\";\n\n\t\t\t$first = true;\n\n\t\t\t// 0 = menu_title, 1 = capability, 2 = menu_slug, 3 = page_title, 4 = classes.\n\t\t\tforeach ( $submenu_items as $sub_key => $sub_item ) {\n\t\t\t\tif ( ! current_user_can( $sub_item[1] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$class           = array();\n\t\t\t\t$aria_attributes = '';\n\n\t\t\t\tif ( $first ) {\n\t\t\t\t\t$class[] = 'wp-first-item';\n\t\t\t\t\t$first   = false;\n\t\t\t\t}\n\n\t\t\t\t$menu_file = $item[2];\n\t\t\t\t$pos       = strpos( $menu_file, '?' );\n\n\t\t\t\tif ( false !== $pos ) {\n\t\t\t\t\t$menu_file = substr( $menu_file, 0, $pos );\n\t\t\t\t}\n\n\t\t\t\t// Handle current for post_type=post|page|foo pages, which won't match $self.\n\t\t\t\t$self_type = ! empty( $typenow ) ? $self . '?post_type=' . $typenow : 'nothing';\n\n\t\t\t\tif ( isset( $submenu_file ) ) {\n\t\t\t\t\tif ( $submenu_file === $sub_item[2] ) {\n\t\t\t\t\t\t$class[]          = 'current';\n\t\t\t\t\t\t$aria_attributes .= ' aria-current=\"page\"';\n\t\t\t\t\t}\n\t\t\t\t\t// If plugin_page is set the parent must either match the current page or not physically exist.\n\t\t\t\t\t// This allows plugin pages with the same hook to exist under different parents.\n\t\t\t\t} elseif (\n\t\t\t\t\t( ! isset( $plugin_page ) && $self === $sub_item[2] )\n\t\t\t\t\t|| ( isset( $plugin_page ) && $plugin_page === $sub_item[2]\n\t\t\t\t\t\t&& ( $item[2] === $self_type || $item[2] === $self || file_exists( $menu_file ) === false ) )\n\t\t\t\t) {\n\t\t\t\t\t$class[]          = 'current';\n\t\t\t\t\t$aria_attributes .= ' aria-current=\"page\"';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $sub_item[4] ) ) {\n\t\t\t\t\t$class[] = esc_attr( $sub_item[4] );\n\t\t\t\t}\n\n\t\t\t\t$class = $class ? ' class=\"' . join( ' ', $class ) . '\"' : '';\n\n\t\t\t\t$menu_hook = get_plugin_page_hook( $sub_item[2], $item[2] );\n\t\t\t\t$sub_file  = $sub_item[2];\n\t\t\t\t$pos       = strpos( $sub_file, '?' );\n\t\t\t\tif ( false !== $pos ) {\n\t\t\t\t\t$sub_file = substr( $sub_file, 0, $pos );\n\t\t\t\t}\n\n\t\t\t\t$title = wptexturize( $sub_item[0] );\n\n\t\t\t\tif ( ! empty( $menu_hook )\n\t\t\t\t\t|| ( ( 'index.php' !== $sub_item[2] )\n\t\t\t\t\t\t&& file_exists( WP_PLUGIN_DIR . \"/$sub_file\" )\n\t\t\t\t\t\t&& ! file_exists( ABSPATH . \"/wp-admin/$sub_file\" ) )\n\t\t\t\t) {\n\t\t\t\t\t// If admin.php is the current page or if the parent exists as a file in the plugins or admin directory.\n\t\t\t\t\tif ( ( ! $admin_is_parent && file_exists( WP_PLUGIN_DIR . \"/$menu_file\" ) && ! is_dir( WP_PLUGIN_DIR . \"/{$item[2]}\" ) ) || file_exists( $menu_file ) ) {\n\t\t\t\t\t\t$sub_item_url = add_query_arg( array( 'page' => $sub_item[2] ), $item[2] );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sub_item_url = add_query_arg( array( 'page' => $sub_item[2] ), 'admin.php' );\n\t\t\t\t\t}\n\n\t\t\t\t\t$sub_item_url = esc_url( $sub_item_url );\n\t\t\t\t\techo \"<li$class><a href='$sub_item_url'$class$aria_attributes>$title</a></li>\";\n\t\t\t\t} else {\n\t\t\t\t\techo \"<li$class><a href='{$sub_item[2]}'$class$aria_attributes>$title</a></li>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\techo '</ul>';\n\t\t}\n\t\techo '</li>';\n\t}\n\n\techo '<li id=\"collapse-menu\" class=\"hide-if-no-js\">' .\n\t\t'<button type=\"button\" id=\"collapse-button\" aria-label=\"' . esc_attr__( 'Collapse Main menu' ) . '\" aria-expanded=\"true\">' .\n\t\t'<span class=\"collapse-button-icon\" aria-hidden=\"true\"></span>' .\n\t\t'<span class=\"collapse-button-label\">' . __( 'Collapse menu' ) . '</span>' .\n\t\t'</button></li>';\n}\n\n?>\n\n<div id=\"adminmenumain\" role=\"navigation\" aria-label=\"<?php esc_attr_e( 'Main menu' ); ?>\">\n<a href=\"#wpbody-content\" class=\"screen-reader-shortcut\"><?php _e( 'Skip to main content' ); ?></a>\n<a href=\"#wp-toolbar\" class=\"screen-reader-shortcut\"><?php _e( 'Skip to toolbar' ); ?></a>\n<div id=\"adminmenuback\"></div>\n<div id=\"adminmenuwrap\">\n<ul id=\"adminmenu\">\n\n<?php\n\n_wp_menu_output( $menu, $submenu );\n/**\n * Fires after the admin menu has been output.\n *\n * @since 2.5.0\n */\ndo_action( 'adminmenu' );\n\n?>\n</ul>\n</div>\n</div>\n", "num_lines": 307}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Build Administration Menu.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Constructs the admin menu.\n *\n * The elements in the array are:\n *     0: Menu item name.\n *     1: Minimum level or capability required.\n *     2: The URL of the item's file.\n *     3: Page title.\n *     4: Classes.\n *     5: ID.\n *     6: Icon for top level menu.\n *\n * @global array $menu\n */\n\n$menu[2] = array( __( 'Dashboard' ), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' );\n\n$submenu['index.php'][0] = array( __( 'Home' ), 'read', 'index.php' );\n\nif ( is_multisite() ) {\n\t$submenu['index.php'][5] = array( __( 'My Sites' ), 'read', 'my-sites.php' );\n}\n\nif ( ! is_multisite() || current_user_can( 'update_core' ) ) {\n\t$update_data = wp_get_update_data();\n}\n\nif ( ! is_multisite() ) {\n\tif ( current_user_can( 'update_core' ) ) {\n\t\t$cap = 'update_core';\n\t} elseif ( current_user_can( 'update_plugins' ) ) {\n\t\t$cap = 'update_plugins';\n\t} elseif ( current_user_can( 'update_themes' ) ) {\n\t\t$cap = 'update_themes';\n\t} else {\n\t\t$cap = 'update_languages';\n\t}\n\t$submenu['index.php'][10] = array(\n\t\tsprintf(\n\t\t\t/* translators: %s: Number of pending updates. */\n\t\t\t__( 'Updates %s' ),\n\t\t\tsprintf(\n\t\t\t\t'<span class=\"update-plugins count-%s\"><span class=\"update-count\">%s</span></span>',\n\t\t\t\t$update_data['counts']['total'],\n\t\t\t\tnumber_format_i18n( $update_data['counts']['total'] )\n\t\t\t)\n\t\t),\n\t\t$cap,\n\t\t'update-core.php',\n\t);\n\tunset( $cap );\n}\n\n$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );\n\n// $menu[5] = Posts.\n\n$menu[10]                     = array( __( 'Media' ), 'upload_files', 'upload.php', '', 'menu-top menu-icon-media', 'menu-media', 'dashicons-admin-media' );\n\t$submenu['upload.php'][5] = array( __( 'Library' ), 'upload_files', 'upload.php' );\n\t/* translators: Add new file. */\n\t$submenu['upload.php'][10] = array( _x( 'Add New', 'file' ), 'upload_files', 'media-new.php' );\n\t$i                         = 15;\nforeach ( get_taxonomies_for_attachments( 'objects' ) as $tax ) {\n\tif ( ! $tax->show_ui || ! $tax->show_in_menu ) {\n\t\tcontinue;\n\t}\n\n\t$submenu['upload.php'][ $i++ ] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name . '&amp;post_type=attachment' );\n}\n\tunset( $tax, $i );\n\n$menu[15]                           = array( __( 'Links' ), 'manage_links', 'link-manager.php', '', 'menu-top menu-icon-links', 'menu-links', 'dashicons-admin-links' );\n\t$submenu['link-manager.php'][5] = array( _x( 'All Links', 'admin menu' ), 'manage_links', 'link-manager.php' );\n\t/* translators: Add new links. */\n\t$submenu['link-manager.php'][10] = array( _x( 'Add New', 'link' ), 'manage_links', 'link-add.php' );\n\t$submenu['link-manager.php'][15] = array( __( 'Link Categories' ), 'manage_categories', 'edit-tags.php?taxonomy=link_category' );\n\n// $menu[20] = Pages.\n\n// Avoid the comment count query for users who cannot edit_posts.\nif ( current_user_can( 'edit_posts' ) ) {\n\t$awaiting_mod      = wp_count_comments();\n\t$awaiting_mod      = $awaiting_mod->moderated;\n\t$awaiting_mod_i18n = number_format_i18n( $awaiting_mod );\n\t/* translators: %s: Number of comments. */\n\t$awaiting_mod_text = sprintf( _n( '%s Comment in moderation', '%s Comments in moderation', $awaiting_mod ), $awaiting_mod_i18n );\n\n\t$menu[25] = array(\n\t\t/* translators: %s: Number of comments. */\n\t\tsprintf( __( 'Comments %s' ), '<span class=\"awaiting-mod count-' . absint( $awaiting_mod ) . '\"><span class=\"pending-count\" aria-hidden=\"true\">' . $awaiting_mod_i18n . '</span><span class=\"comments-in-moderation-text screen-reader-text\">' . $awaiting_mod_text . '</span></span>' ),\n\t\t'edit_posts',\n\t\t'edit-comments.php',\n\t\t'',\n\t\t'menu-top menu-icon-comments',\n\t\t'menu-comments',\n\t\t'dashicons-admin-comments',\n\t);\n\tunset( $awaiting_mod );\n}\n\n$submenu['edit-comments.php'][0] = array( __( 'All Comments' ), 'edit_posts', 'edit-comments.php' );\n\n$_wp_last_object_menu = 25; // The index of the last top-level menu in the object menu group.\n\n$types   = (array) get_post_types(\n\tarray(\n\t\t'show_ui'      => true,\n\t\t'_builtin'     => false,\n\t\t'show_in_menu' => true,\n\t)\n);\n$builtin = array( 'post', 'page' );\nforeach ( array_merge( $builtin, $types ) as $ptype ) {\n\t$ptype_obj = get_post_type_object( $ptype );\n\t// Check if it should be a submenu.\n\tif ( true !== $ptype_obj->show_in_menu ) {\n\t\tcontinue;\n\t}\n\t$ptype_menu_position = is_int( $ptype_obj->menu_position ) ? $ptype_obj->menu_position : ++$_wp_last_object_menu; // If we're to use $_wp_last_object_menu, increment it first.\n\t$ptype_for_id        = sanitize_html_class( $ptype );\n\n\t$menu_icon = 'dashicons-admin-post';\n\tif ( is_string( $ptype_obj->menu_icon ) ) {\n\t\t// Special handling for data:image/svg+xml and Dashicons.\n\t\tif ( 0 === strpos( $ptype_obj->menu_icon, 'data:image/svg+xml;base64,' ) || 0 === strpos( $ptype_obj->menu_icon, 'dashicons-' ) ) {\n\t\t\t$menu_icon = $ptype_obj->menu_icon;\n\t\t} else {\n\t\t\t$menu_icon = esc_url( $ptype_obj->menu_icon );\n\t\t}\n\t} elseif ( in_array( $ptype, $builtin, true ) ) {\n\t\t$menu_icon = 'dashicons-admin-' . $ptype;\n\t}\n\n\t$menu_class = 'menu-top menu-icon-' . $ptype_for_id;\n\t// 'post' special case.\n\tif ( 'post' === $ptype ) {\n\t\t$menu_class    .= ' open-if-no-js';\n\t\t$ptype_file     = 'edit.php';\n\t\t$post_new_file  = 'post-new.php';\n\t\t$edit_tags_file = 'edit-tags.php?taxonomy=%s';\n\t} else {\n\t\t$ptype_file     = \"edit.php?post_type=$ptype\";\n\t\t$post_new_file  = \"post-new.php?post_type=$ptype\";\n\t\t$edit_tags_file = \"edit-tags.php?taxonomy=%s&amp;post_type=$ptype\";\n\t}\n\n\tif ( in_array( $ptype, $builtin, true ) ) {\n\t\t$ptype_menu_id = 'menu-' . $ptype_for_id . 's';\n\t} else {\n\t\t$ptype_menu_id = 'menu-posts-' . $ptype_for_id;\n\t}\n\t/*\n\t * If $ptype_menu_position is already populated or will be populated\n\t * by a hard-coded value below, increment the position.\n\t */\n\t$core_menu_positions = array( 59, 60, 65, 70, 75, 80, 85, 99 );\n\twhile ( isset( $menu[ $ptype_menu_position ] ) || in_array( $ptype_menu_position, $core_menu_positions, true ) ) {\n\t\t$ptype_menu_position++;\n\t}\n\n\t$menu[ $ptype_menu_position ] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->edit_posts, $ptype_file, '', $menu_class, $ptype_menu_id, $menu_icon );\n\t$submenu[ $ptype_file ][5]    = array( $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, $ptype_file );\n\t$submenu[ $ptype_file ][10]   = array( $ptype_obj->labels->add_new, $ptype_obj->cap->create_posts, $post_new_file );\n\n\t$i = 15;\n\tforeach ( get_taxonomies( array(), 'objects' ) as $tax ) {\n\t\tif ( ! $tax->show_ui || ! $tax->show_in_menu || ! in_array( $ptype, (array) $tax->object_type, true ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$submenu[ $ptype_file ][ $i++ ] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, sprintf( $edit_tags_file, $tax->name ) );\n\t}\n}\nunset( $ptype, $ptype_obj, $ptype_for_id, $ptype_menu_position, $menu_icon, $i, $tax, $post_new_file );\n\n$menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' );\n\n$appearance_cap = current_user_can( 'switch_themes' ) ? 'switch_themes' : 'edit_theme_options';\n\n$menu[60]                     = array( __( 'Appearance' ), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );\n\t$submenu['themes.php'][5] = array( __( 'Themes' ), $appearance_cap, 'themes.php' );\n\n\t$customize_url            = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' );\n\t$submenu['themes.php'][6] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );\n\nif ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {\n\t$submenu['themes.php'][10] = array( __( 'Menus' ), 'edit_theme_options', 'nav-menus.php' );\n}\n\nif ( current_theme_supports( 'custom-header' ) && current_user_can( 'customize' ) ) {\n\t$customize_header_url      = add_query_arg( array( 'autofocus' => array( 'control' => 'header_image' ) ), $customize_url );\n\t$submenu['themes.php'][15] = array( __( 'Header' ), $appearance_cap, esc_url( $customize_header_url ), '', 'hide-if-no-customize' );\n}\n\nif ( current_theme_supports( 'custom-background' ) && current_user_can( 'customize' ) ) {\n\t$customize_background_url  = add_query_arg( array( 'autofocus' => array( 'control' => 'background_image' ) ), $customize_url );\n\t$submenu['themes.php'][20] = array( __( 'Background' ), $appearance_cap, esc_url( $customize_background_url ), '', 'hide-if-no-customize' );\n}\n\n\tunset( $customize_url );\n\nunset( $appearance_cap );\n\n// Add 'Editor' to the bottom of the Appearance menu.\nif ( ! is_multisite() ) {\n\tadd_action( 'admin_menu', '_add_themes_utility_last', 101 );\n}\n/**\n * Adds the (theme) 'Editor' link to the bottom of the Appearance menu.\n *\n * @access private\n * @since 3.0.0\n */\nfunction _add_themes_utility_last() {\n\t// Must use API on the admin_menu hook, direct modification is only possible on/before the _admin_menu hook.\n\tadd_submenu_page( 'themes.php', __( 'Theme Editor' ), __( 'Theme Editor' ), 'edit_themes', 'theme-editor.php' );\n}\n\n$count = '';\nif ( ! is_multisite() && current_user_can( 'update_plugins' ) ) {\n\tif ( ! isset( $update_data ) ) {\n\t\t$update_data = wp_get_update_data();\n\t}\n\t$count = sprintf(\n\t\t'<span class=\"update-plugins count-%s\"><span class=\"plugin-count\">%s</span></span>',\n\t\t$update_data['counts']['plugins'],\n\t\tnumber_format_i18n( $update_data['counts']['plugins'] )\n\t);\n}\n\n/* translators: %s: Number of pending plugin updates. */\n$menu[65] = array( sprintf( __( 'Plugins %s' ), $count ), 'activate_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );\n\n$submenu['plugins.php'][5] = array( __( 'Installed Plugins' ), 'activate_plugins', 'plugins.php' );\n\nif ( ! is_multisite() ) {\n\t/* translators: Add new plugin. */\n\t$submenu['plugins.php'][10] = array( _x( 'Add New', 'plugin' ), 'install_plugins', 'plugin-install.php' );\n\t$submenu['plugins.php'][15] = array( __( 'Plugin Editor' ), 'edit_plugins', 'plugin-editor.php' );\n}\n\nunset( $update_data );\n\nif ( current_user_can( 'list_users' ) ) {\n\t$menu[70] = array( __( 'Users' ), 'list_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );\n} else {\n\t$menu[70] = array( __( 'Profile' ), 'read', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );\n}\n\nif ( current_user_can( 'list_users' ) ) {\n\t$_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php.\n\t$submenu['users.php'][5]             = array( __( 'All Users' ), 'list_users', 'users.php' );\n\tif ( current_user_can( 'create_users' ) ) {\n\t\t$submenu['users.php'][10] = array( _x( 'Add New', 'user' ), 'create_users', 'user-new.php' );\n\t} elseif ( is_multisite() ) {\n\t\t$submenu['users.php'][10] = array( _x( 'Add New', 'user' ), 'promote_users', 'user-new.php' );\n\t}\n\n\t$submenu['users.php'][15] = array( __( 'Profile' ), 'read', 'profile.php' );\n} else {\n\t$_wp_real_parent_file['users.php'] = 'profile.php';\n\t$submenu['profile.php'][5]         = array( __( 'Profile' ), 'read', 'profile.php' );\n\tif ( current_user_can( 'create_users' ) ) {\n\t\t$submenu['profile.php'][10] = array( __( 'Add New User' ), 'create_users', 'user-new.php' );\n\t} elseif ( is_multisite() ) {\n\t\t$submenu['profile.php'][10] = array( __( 'Add New User' ), 'promote_users', 'user-new.php' );\n\t}\n}\n\n$menu[75]                     = array( __( 'Tools' ), 'edit_posts', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'dashicons-admin-tools' );\n\t$submenu['tools.php'][5]  = array( __( 'Available Tools' ), 'edit_posts', 'tools.php' );\n\t$submenu['tools.php'][10] = array( __( 'Import' ), 'import', 'import.php' );\n\t$submenu['tools.php'][15] = array( __( 'Export' ), 'export', 'export.php' );\n\t$submenu['tools.php'][20] = array( __( 'Site Health' ), 'view_site_health_checks', 'site-health.php' );\n\t$submenu['tools.php'][25] = array( __( 'Export Personal Data' ), 'export_others_personal_data', 'export-personal-data.php' );\n\t$submenu['tools.php'][30] = array( __( 'Erase Personal Data' ), 'erase_others_personal_data', 'erase-personal-data.php' );\nif ( is_multisite() && ! is_main_site() ) {\n\t$submenu['tools.php'][35] = array( __( 'Delete Site' ), 'delete_site', 'ms-delete-site.php' );\n}\nif ( ! is_multisite() && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {\n\t$submenu['tools.php'][50] = array( __( 'Network Setup' ), 'setup_network', 'network.php' );\n}\n\n$menu[80]                               = array( __( 'Settings' ), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' );\n\t$submenu['options-general.php'][10] = array( _x( 'General', 'settings screen' ), 'manage_options', 'options-general.php' );\n\t$submenu['options-general.php'][15] = array( __( 'Writing' ), 'manage_options', 'options-writing.php' );\n\t$submenu['options-general.php'][20] = array( __( 'Reading' ), 'manage_options', 'options-reading.php' );\n\t$submenu['options-general.php'][25] = array( __( 'Discussion' ), 'manage_options', 'options-discussion.php' );\n\t$submenu['options-general.php'][30] = array( __( 'Media' ), 'manage_options', 'options-media.php' );\n\t$submenu['options-general.php'][40] = array( __( 'Permalinks' ), 'manage_options', 'options-permalink.php' );\n\t$submenu['options-general.php'][45] = array( __( 'Privacy' ), 'manage_privacy_options', 'options-privacy.php' );\n\n$_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group.\n\n$menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator' );\n\n// Back-compat for old top-levels.\n$_wp_real_parent_file['post.php']       = 'edit.php';\n$_wp_real_parent_file['post-new.php']   = 'edit.php';\n$_wp_real_parent_file['edit-pages.php'] = 'edit.php?post_type=page';\n$_wp_real_parent_file['page-new.php']   = 'edit.php?post_type=page';\n$_wp_real_parent_file['wpmu-admin.php'] = 'tools.php';\n$_wp_real_parent_file['ms-admin.php']   = 'tools.php';\n\n// Ensure backward compatibility.\n$compat = array(\n\t'index'           => 'dashboard',\n\t'edit'            => 'posts',\n\t'post'            => 'posts',\n\t'upload'          => 'media',\n\t'link-manager'    => 'links',\n\t'edit-pages'      => 'pages',\n\t'page'            => 'pages',\n\t'edit-comments'   => 'comments',\n\t'options-general' => 'settings',\n\t'themes'          => 'appearance',\n);\n\nrequire_once ABSPATH . 'wp-admin/includes/menu.php';\n", "num_lines": 328}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Comment Moderation Administration Screen.\n *\n * Redirects to edit-comments.php?comment_status=moderated.\n *\n * @package WordPress\n * @subpackage Administration\n */\nrequire_once dirname( __DIR__ ) . '/wp-load.php';\nwp_redirect( admin_url( 'edit-comments.php?comment_status=moderated' ) );\nexit;\n", "num_lines": 13}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\nrequire_once __DIR__ . '/admin.php';\n\nwp_redirect( network_admin_url() );\nexit;\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite delete site panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! is_multisite() ) {\n\twp_die( __( 'Multisite support is not enabled.' ) );\n}\n\nif ( ! current_user_can( 'delete_site' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to delete this site.' ) );\n}\n\nif ( isset( $_GET['h'] ) && '' !== $_GET['h'] && false !== get_option( 'delete_blog_hash' ) ) {\n\tif ( hash_equals( get_option( 'delete_blog_hash' ), $_GET['h'] ) ) {\n\t\twpmu_delete_blog( get_current_blog_id() );\n\t\twp_die(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Network title. */\n\t\t\t\t__( 'Thank you for using %s, your site has been deleted. Happy trails to you until we meet again.' ),\n\t\t\t\tget_network()->site_name\n\t\t\t)\n\t\t);\n\t} else {\n\t\twp_die( __( 'Sorry, the link you clicked is stale. Please select another option.' ) );\n\t}\n}\n\n$blog = get_site();\n$user = wp_get_current_user();\n\n$title       = __( 'Delete Site' );\n$parent_file = 'tools.php';\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\necho '<div class=\"wrap\">';\necho '<h1>' . esc_html( $title ) . '</h1>';\n\nif ( isset( $_POST['action'] ) && 'deleteblog' === $_POST['action'] && isset( $_POST['confirmdelete'] ) && '1' === $_POST['confirmdelete'] ) {\n\tcheck_admin_referer( 'delete-blog' );\n\n\t$hash = wp_generate_password( 20, false );\n\tupdate_option( 'delete_blog_hash', $hash );\n\n\t$url_delete = esc_url( admin_url( 'ms-delete-site.php?h=' . $hash ) );\n\n\t$switched_locale = switch_to_locale( get_locale() );\n\n\t/* translators: Do not translate USERNAME, URL_DELETE, SITENAME, SITEURL: those are placeholders. */\n\t$content = __(\n\t\t\"Howdy ###USERNAME###,\n\nYou recently clicked the 'Delete Site' link on your site and filled in a\nform on that page.\n\nIf you really want to delete your site, click the link below. You will not\nbe asked to confirm again so only click this link if you are absolutely certain:\n###URL_DELETE###\n\nIf you delete your site, please consider opening a new site here\nsome time in the future! (But remember your current site and username\nare gone forever.)\n\nThanks for using the site,\nAll at ###SITENAME###\n###SITEURL###\"\n\t);\n\t/**\n\t * Filters the email content sent when a site in a Multisite network is deleted.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $content The email content that will be sent to the user who deleted a site in a Multisite network.\n\t */\n\t$content = apply_filters( 'delete_site_email_content', $content );\n\n\t$content = str_replace( '###USERNAME###', $user->user_login, $content );\n\t$content = str_replace( '###URL_DELETE###', $url_delete, $content );\n\t$content = str_replace( '###SITENAME###', get_network()->site_name, $content );\n\t$content = str_replace( '###SITEURL###', network_home_url(), $content );\n\n\twp_mail(\n\t\tget_option( 'admin_email' ),\n\t\tsprintf(\n\t\t\t/* translators: %s: Site title. */\n\t\t\t__( '[%s] Delete My Site' ),\n\t\t\twp_specialchars_decode( get_option( 'blogname' ) )\n\t\t),\n\t\t$content\n\t);\n\n\tif ( $switched_locale ) {\n\t\trestore_previous_locale();\n\t}\n\t?>\n\n\t<p><?php _e( 'Thank you. Please check your email for a link to confirm your action. Your site will not be deleted until this link is clicked.' ); ?></p>\n\n\t<?php\n} else {\n\t?>\n\t<p>\n\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: Network title. */\n\t\t\t__( 'If you do not want to use your %s site any more, you can delete it using the form below. When you click <strong>Delete My Site Permanently</strong> you will be sent an email with a link in it. Click on this link to delete your site.' ),\n\t\t\tget_network()->site_name\n\t\t);\n\t?>\n\t</p>\n\t<p><?php _e( 'Remember, once deleted your site cannot be restored.' ); ?></p>\n\n\t<form method=\"post\" name=\"deletedirect\">\n\t\t<?php wp_nonce_field( 'delete-blog' ); ?>\n\t\t<input type=\"hidden\" name=\"action\" value=\"deleteblog\" />\n\t\t<p><input id=\"confirmdelete\" type=\"checkbox\" name=\"confirmdelete\" value=\"1\" /> <label for=\"confirmdelete\"><strong>\n\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: Site address. */\n\t\t\t\t__( \"I'm sure I want to permanently delete my site, and I am aware I can never get it back or use %s again.\" ),\n\t\t\t\t$blog->domain . $blog->path\n\t\t\t);\n\t\t?>\n\t\t</strong></label></p>\n\t\t<?php submit_button( __( 'Delete My Site Permanently' ) ); ?>\n\t</form>\n\t<?php\n}\necho '</div>';\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 138}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Action handler for Multisite administration panels.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\nrequire_once __DIR__ . '/admin.php';\n\nwp_redirect( network_admin_url() );\nexit;\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite network settings administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\nrequire_once __DIR__ . '/admin.php';\n\nwp_redirect( network_admin_url( 'settings.php' ) );\n", "num_lines": 13}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite sites administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\nrequire_once __DIR__ . '/admin.php';\n\nwp_redirect( network_admin_url( 'sites.php' ) );\nexit;\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite themes administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\nrequire_once __DIR__ . '/admin.php';\n\nwp_redirect( network_admin_url( 'themes.php' ) );\nexit;\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite upgrade administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\nrequire_once __DIR__ . '/admin.php';\n\nwp_redirect( network_admin_url( 'upgrade.php' ) );\nexit;\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite users administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\nrequire_once __DIR__ . '/admin.php';\n\nwp_redirect( network_admin_url( 'users.php' ) );\nexit;\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * My Sites dashboard.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! is_multisite() ) {\n\twp_die( __( 'Multisite support is not enabled.' ) );\n}\n\nif ( ! current_user_can( 'read' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to access this page.' ) );\n}\n\n$action = isset( $_POST['action'] ) ? $_POST['action'] : 'splash';\n\n$blogs = get_blogs_of_user( $current_user->ID );\n\n$updated = false;\nif ( 'updateblogsettings' === $action && isset( $_POST['primary_blog'] ) ) {\n\tcheck_admin_referer( 'update-my-sites' );\n\n\t$blog = get_site( (int) $_POST['primary_blog'] );\n\tif ( $blog && isset( $blog->domain ) ) {\n\t\tupdate_user_option( $current_user->ID, 'primary_blog', (int) $_POST['primary_blog'], true );\n\t\t$updated = true;\n\t} else {\n\t\twp_die( __( 'The primary site you chose does not exist.' ) );\n\t}\n}\n\n$title       = __( 'My Sites' );\n$parent_file = 'index.php';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t'<p>' . __( 'This screen shows an individual user all of their sites in this network, and also allows that user to set a primary site. They can use the links under each site to visit either the front end or the dashboard for that site.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://codex.wordpress.org/Dashboard_My_Sites_Screen\">Documentation on My Sites</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\nif ( $updated ) { ?>\n\t<div id=\"message\" class=\"updated notice is-dismissible\"><p><strong><?php _e( 'Settings saved.' ); ?></strong></p></div>\n<?php } ?>\n\n<div class=\"wrap\">\n<h1 class=\"wp-heading-inline\">\n<?php\necho esc_html( $title );\n?>\n</h1>\n\n<?php\nif ( in_array( get_site_option( 'registration' ), array( 'all', 'blog' ), true ) ) {\n\t/** This filter is documented in wp-login.php */\n\t$sign_up_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) );\n\tprintf( ' <a href=\"%s\" class=\"page-title-action\">%s</a>', esc_url( $sign_up_url ), esc_html_x( 'Add New', 'site' ) );\n}\n\nif ( empty( $blogs ) ) :\n\techo '<p>';\n\t_e( 'You must be a member of at least one site to use this page.' );\n\techo '</p>';\nelse :\n\t?>\n\n<hr class=\"wp-header-end\">\n\n<form id=\"myblogs\" method=\"post\">\n\t<?php\n\tchoose_primary_blog();\n\t/**\n\t * Fires before the sites list on the My Sites screen.\n\t *\n\t * @since 3.0.0\n\t */\n\tdo_action( 'myblogs_allblogs_options' );\n\t?>\n\t<br clear=\"all\" />\n\t<ul class=\"my-sites striped\">\n\t<?php\n\t/**\n\t * Enable the Global Settings section on the My Sites screen.\n\t *\n\t * By default, the Global Settings section is hidden. Passing a non-empty\n\t * string to this filter will enable the section, and allow new settings\n\t * to be added, either globally or for specific sites.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param string $settings_html The settings HTML markup. Default empty.\n\t * @param string $context       Context of the setting (global or site-specific). Default 'global'.\n\t */\n\t$settings_html = apply_filters( 'myblogs_options', '', 'global' );\n\n\tif ( $settings_html ) {\n\t\techo '<h3>' . __( 'Global Settings' ) . '</h3>';\n\t\techo $settings_html;\n\t}\n\n\treset( $blogs );\n\n\tforeach ( $blogs as $user_blog ) {\n\t\tswitch_to_blog( $user_blog->userblog_id );\n\n\t\techo '<li>';\n\t\techo \"<h3>{$user_blog->blogname}</h3>\";\n\n\t\t$actions = \"<a href='\" . esc_url( home_url() ) . \"'>\" . __( 'Visit' ) . '</a>';\n\n\t\tif ( current_user_can( 'read' ) ) {\n\t\t\t$actions .= \" | <a href='\" . esc_url( admin_url() ) . \"'>\" . __( 'Dashboard' ) . '</a>';\n\t\t}\n\n\t\t/**\n\t\t * Filters the row links displayed for each site on the My Sites screen.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t *\n\t\t * @param string $actions   The HTML site link markup.\n\t\t * @param object $user_blog An object containing the site data.\n\t\t */\n\t\t$actions = apply_filters( 'myblogs_blog_actions', $actions, $user_blog );\n\n\t\techo \"<p class='my-sites-actions'>\" . $actions . '</p>';\n\n\t\t/** This filter is documented in wp-admin/my-sites.php */\n\t\techo apply_filters( 'myblogs_options', '', $user_blog );\n\n\t\techo '</li>';\n\n\t\trestore_current_blog();\n\t}\n\t?>\n\t</ul>\n\t<?php\n\tif ( count( $blogs ) > 1 || has_action( 'myblogs_allblogs_options' ) || has_filter( 'myblogs_options' ) ) {\n\t\t?>\n\t\t<input type=\"hidden\" name=\"action\" value=\"updateblogsettings\" />\n\t\t<?php\n\t\twp_nonce_field( 'update-my-sites' );\n\t\tsubmit_button();\n\t}\n\t?>\n\t</form>\n<?php endif; ?>\n\t</div>\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 165}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Administration for Navigation Menus\n * Interface functions\n *\n * @version 2.0.0\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n// Load all the nav menu interface functions.\nrequire_once ABSPATH . 'wp-admin/includes/nav-menu.php';\n\nif ( ! current_theme_supports( 'menus' ) && ! current_theme_supports( 'widgets' ) ) {\n\twp_die( __( 'Your theme does not support navigation menus or widgets.' ) );\n}\n\n// Permissions check.\nif ( ! current_user_can( 'edit_theme_options' ) ) {\n\twp_die(\n\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t'<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',\n\t\t403\n\t);\n}\n\nwp_enqueue_script( 'nav-menu' );\n\nif ( wp_is_mobile() ) {\n\twp_enqueue_script( 'jquery-touch-punch' );\n}\n\n// Container for any messages displayed to the user.\n$messages = array();\n\n// Container that stores the name of the active menu.\n$nav_menu_selected_title = '';\n\n// The menu id of the current menu being edited.\n$nav_menu_selected_id = isset( $_REQUEST['menu'] ) ? (int) $_REQUEST['menu'] : 0;\n\n// Get existing menu locations assignments.\n$locations      = get_registered_nav_menus();\n$menu_locations = get_nav_menu_locations();\n$num_locations  = count( array_keys( $locations ) );\n\n// Allowed actions: add, update, delete.\n$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'edit';\n\n/*\n * If a JSON blob of navigation menu data is found, expand it and inject it\n * into `$_POST` to avoid PHP `max_input_vars` limitations. See #14134.\n */\n_wp_expand_nav_menu_post_data();\n\nswitch ( $action ) {\n\tcase 'add-menu-item':\n\t\tcheck_admin_referer( 'add-menu_item', 'menu-settings-column-nonce' );\n\n\t\tif ( isset( $_REQUEST['nav-menu-locations'] ) ) {\n\t\t\tset_theme_mod( 'nav_menu_locations', array_map( 'absint', $_REQUEST['menu-locations'] ) );\n\t\t} elseif ( isset( $_REQUEST['menu-item'] ) ) {\n\t\t\twp_save_nav_menu_items( $nav_menu_selected_id, $_REQUEST['menu-item'] );\n\t\t}\n\n\t\tbreak;\n\n\tcase 'move-down-menu-item':\n\t\t// Moving down a menu item is the same as moving up the next in order.\n\t\tcheck_admin_referer( 'move-menu_item' );\n\n\t\t$menu_item_id = isset( $_REQUEST['menu-item'] ) ? (int) $_REQUEST['menu-item'] : 0;\n\n\t\tif ( is_nav_menu_item( $menu_item_id ) ) {\n\t\t\t$menus = isset( $_REQUEST['menu'] ) ? array( (int) $_REQUEST['menu'] ) : wp_get_object_terms( $menu_item_id, 'nav_menu', array( 'fields' => 'ids' ) );\n\n\t\t\tif ( ! is_wp_error( $menus ) && ! empty( $menus[0] ) ) {\n\t\t\t\t$menu_id            = (int) $menus[0];\n\t\t\t\t$ordered_menu_items = wp_get_nav_menu_items( $menu_id );\n\t\t\t\t$menu_item_data     = (array) wp_setup_nav_menu_item( get_post( $menu_item_id ) );\n\n\t\t\t\t// Set up the data we need in one pass through the array of menu items.\n\t\t\t\t$dbids_to_orders = array();\n\t\t\t\t$orders_to_dbids = array();\n\n\t\t\t\tforeach ( (array) $ordered_menu_items as $ordered_menu_item_object ) {\n\t\t\t\t\tif ( isset( $ordered_menu_item_object->ID ) ) {\n\t\t\t\t\t\tif ( isset( $ordered_menu_item_object->menu_order ) ) {\n\t\t\t\t\t\t\t$dbids_to_orders[ $ordered_menu_item_object->ID ]         = $ordered_menu_item_object->menu_order;\n\t\t\t\t\t\t\t$orders_to_dbids[ $ordered_menu_item_object->menu_order ] = $ordered_menu_item_object->ID;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Get next in order.\n\t\t\t\tif ( isset( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] + 1 ] ) ) {\n\t\t\t\t\t$next_item_id   = $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] + 1 ];\n\t\t\t\t\t$next_item_data = (array) wp_setup_nav_menu_item( get_post( $next_item_id ) );\n\n\t\t\t\t\t// If not siblings of same parent, bubble menu item up but keep order.\n\t\t\t\t\tif ( ! empty( $menu_item_data['menu_item_parent'] )\n\t\t\t\t\t\t&& ( empty( $next_item_data['menu_item_parent'] )\n\t\t\t\t\t\t\t|| (int) $next_item_data['menu_item_parent'] !== (int) $menu_item_data['menu_item_parent'] )\n\t\t\t\t\t) {\n\t\t\t\t\t\tif ( in_array( (int) $menu_item_data['menu_item_parent'], $orders_to_dbids, true ) ) {\n\t\t\t\t\t\t\t$parent_db_id = (int) $menu_item_data['menu_item_parent'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$parent_db_id = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$parent_object = wp_setup_nav_menu_item( get_post( $parent_db_id ) );\n\n\t\t\t\t\t\tif ( ! is_wp_error( $parent_object ) ) {\n\t\t\t\t\t\t\t$parent_data                        = (array) $parent_object;\n\t\t\t\t\t\t\t$menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent'];\n\t\t\t\t\t\t\tupdate_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Make menu item a child of its next sibling.\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$next_item_data['menu_order'] = $next_item_data['menu_order'] - 1;\n\t\t\t\t\t\t$menu_item_data['menu_order'] = $menu_item_data['menu_order'] + 1;\n\n\t\t\t\t\t\t$menu_item_data['menu_item_parent'] = $next_item_data['ID'];\n\t\t\t\t\t\tupdate_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );\n\n\t\t\t\t\t\twp_update_post( $menu_item_data );\n\t\t\t\t\t\twp_update_post( $next_item_data );\n\t\t\t\t\t}\n\n\t\t\t\t\t// The item is last but still has a parent, so bubble up.\n\t\t\t\t} elseif ( ! empty( $menu_item_data['menu_item_parent'] )\n\t\t\t\t\t&& in_array( (int) $menu_item_data['menu_item_parent'], $orders_to_dbids, true )\n\t\t\t\t) {\n\t\t\t\t\t$menu_item_data['menu_item_parent'] = (int) get_post_meta( $menu_item_data['menu_item_parent'], '_menu_item_menu_item_parent', true );\n\t\t\t\t\tupdate_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbreak;\n\n\tcase 'move-up-menu-item':\n\t\tcheck_admin_referer( 'move-menu_item' );\n\n\t\t$menu_item_id = isset( $_REQUEST['menu-item'] ) ? (int) $_REQUEST['menu-item'] : 0;\n\n\t\tif ( is_nav_menu_item( $menu_item_id ) ) {\n\t\t\tif ( isset( $_REQUEST['menu'] ) ) {\n\t\t\t\t$menus = array( (int) $_REQUEST['menu'] );\n\t\t\t} else {\n\t\t\t\t$menus = wp_get_object_terms( $menu_item_id, 'nav_menu', array( 'fields' => 'ids' ) );\n\t\t\t}\n\n\t\t\tif ( ! is_wp_error( $menus ) && ! empty( $menus[0] ) ) {\n\t\t\t\t$menu_id            = (int) $menus[0];\n\t\t\t\t$ordered_menu_items = wp_get_nav_menu_items( $menu_id );\n\t\t\t\t$menu_item_data     = (array) wp_setup_nav_menu_item( get_post( $menu_item_id ) );\n\n\t\t\t\t// Set up the data we need in one pass through the array of menu items.\n\t\t\t\t$dbids_to_orders = array();\n\t\t\t\t$orders_to_dbids = array();\n\n\t\t\t\tforeach ( (array) $ordered_menu_items as $ordered_menu_item_object ) {\n\t\t\t\t\tif ( isset( $ordered_menu_item_object->ID ) ) {\n\t\t\t\t\t\tif ( isset( $ordered_menu_item_object->menu_order ) ) {\n\t\t\t\t\t\t\t$dbids_to_orders[ $ordered_menu_item_object->ID ]         = $ordered_menu_item_object->menu_order;\n\t\t\t\t\t\t\t$orders_to_dbids[ $ordered_menu_item_object->menu_order ] = $ordered_menu_item_object->ID;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If this menu item is not first.\n\t\t\t\tif ( ! empty( $dbids_to_orders[ $menu_item_id ] )\n\t\t\t\t\t&& ! empty( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] )\n\t\t\t\t) {\n\n\t\t\t\t\t// If this menu item is a child of the previous.\n\t\t\t\t\tif ( ! empty( $menu_item_data['menu_item_parent'] )\n\t\t\t\t\t\t&& in_array( (int) $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ), true )\n\t\t\t\t\t\t&& isset( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] )\n\t\t\t\t\t\t&& ( (int) $menu_item_data['menu_item_parent'] === $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] )\n\t\t\t\t\t) {\n\t\t\t\t\t\tif ( in_array( (int) $menu_item_data['menu_item_parent'], $orders_to_dbids, true ) ) {\n\t\t\t\t\t\t\t$parent_db_id = (int) $menu_item_data['menu_item_parent'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$parent_db_id = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$parent_object = wp_setup_nav_menu_item( get_post( $parent_db_id ) );\n\n\t\t\t\t\t\tif ( ! is_wp_error( $parent_object ) ) {\n\t\t\t\t\t\t\t$parent_data = (array) $parent_object;\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * If there is something before the parent and parent a child of it,\n\t\t\t\t\t\t\t * make menu item a child also of it.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif ( ! empty( $dbids_to_orders[ $parent_db_id ] )\n\t\t\t\t\t\t\t\t&& ! empty( $orders_to_dbids[ $dbids_to_orders[ $parent_db_id ] - 1 ] )\n\t\t\t\t\t\t\t\t&& ! empty( $parent_data['menu_item_parent'] )\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t$menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent'];\n\n\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t* Else if there is something before parent and parent not a child of it,\n\t\t\t\t\t\t\t\t* make menu item a child of that something's parent\n\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t} elseif ( ! empty( $dbids_to_orders[ $parent_db_id ] )\n\t\t\t\t\t\t\t\t&& ! empty( $orders_to_dbids[ $dbids_to_orders[ $parent_db_id ] - 1 ] )\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t$_possible_parent_id = (int) get_post_meta( $orders_to_dbids[ $dbids_to_orders[ $parent_db_id ] - 1 ], '_menu_item_menu_item_parent', true );\n\n\t\t\t\t\t\t\t\tif ( in_array( $_possible_parent_id, array_keys( $dbids_to_orders ), true ) ) {\n\t\t\t\t\t\t\t\t\t$menu_item_data['menu_item_parent'] = $_possible_parent_id;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$menu_item_data['menu_item_parent'] = 0;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Else there isn't something before the parent.\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$menu_item_data['menu_item_parent'] = 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Set former parent's [menu_order] to that of menu-item's.\n\t\t\t\t\t\t\t$parent_data['menu_order'] = $parent_data['menu_order'] + 1;\n\n\t\t\t\t\t\t\t// Set menu-item's [menu_order] to that of former parent.\n\t\t\t\t\t\t\t$menu_item_data['menu_order'] = $menu_item_data['menu_order'] - 1;\n\n\t\t\t\t\t\t\t// Save changes.\n\t\t\t\t\t\t\tupdate_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );\n\t\t\t\t\t\t\twp_update_post( $menu_item_data );\n\t\t\t\t\t\t\twp_update_post( $parent_data );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Else this menu item is not a child of the previous.\n\t\t\t\t\t} elseif ( empty( $menu_item_data['menu_order'] )\n\t\t\t\t\t\t|| empty( $menu_item_data['menu_item_parent'] )\n\t\t\t\t\t\t|| ! in_array( (int) $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ), true )\n\t\t\t\t\t\t|| empty( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] )\n\t\t\t\t\t\t|| $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] !== (int) $menu_item_data['menu_item_parent']\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Just make it a child of the previous; keep the order.\n\t\t\t\t\t\t$menu_item_data['menu_item_parent'] = (int) $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ];\n\t\t\t\t\t\tupdate_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );\n\t\t\t\t\t\twp_update_post( $menu_item_data );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbreak;\n\n\tcase 'delete-menu-item':\n\t\t$menu_item_id = (int) $_REQUEST['menu-item'];\n\n\t\tcheck_admin_referer( 'delete-menu_item_' . $menu_item_id );\n\n\t\tif ( is_nav_menu_item( $menu_item_id ) && wp_delete_post( $menu_item_id, true ) ) {\n\t\t\t$messages[] = '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . __( 'The menu item has been successfully deleted.' ) . '</p></div>';\n\t\t}\n\n\t\tbreak;\n\n\tcase 'delete':\n\t\tcheck_admin_referer( 'delete-nav_menu-' . $nav_menu_selected_id );\n\n\t\tif ( is_nav_menu( $nav_menu_selected_id ) ) {\n\t\t\t$deletion = wp_delete_nav_menu( $nav_menu_selected_id );\n\t\t} else {\n\t\t\t// Reset the selected menu.\n\t\t\t$nav_menu_selected_id = 0;\n\t\t\tunset( $_REQUEST['menu'] );\n\t\t}\n\n\t\tif ( ! isset( $deletion ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif ( is_wp_error( $deletion ) ) {\n\t\t\t$messages[] = '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . $deletion->get_error_message() . '</p></div>';\n\t\t} else {\n\t\t\t$messages[] = '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . __( 'The menu has been successfully deleted.' ) . '</p></div>';\n\t\t}\n\n\t\tbreak;\n\n\tcase 'delete_menus':\n\t\tcheck_admin_referer( 'nav_menus_bulk_actions' );\n\n\t\tforeach ( $_REQUEST['delete_menus'] as $menu_id_to_delete ) {\n\t\t\tif ( ! is_nav_menu( $menu_id_to_delete ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$deletion = wp_delete_nav_menu( $menu_id_to_delete );\n\n\t\t\tif ( is_wp_error( $deletion ) ) {\n\t\t\t\t$messages[]     = '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . $deletion->get_error_message() . '</p></div>';\n\t\t\t\t$deletion_error = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $deletion_error ) ) {\n\t\t\t$messages[] = '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . __( 'Selected menus have been successfully deleted.' ) . '</p></div>';\n\t\t}\n\n\t\tbreak;\n\n\tcase 'update':\n\t\tcheck_admin_referer( 'update-nav_menu', 'update-nav-menu-nonce' );\n\n\t\t// Merge new and existing menu locations if any new ones are set.\n\t\tif ( isset( $_POST['menu-locations'] ) ) {\n\t\t\t$new_menu_locations = array_map( 'absint', $_POST['menu-locations'] );\n\t\t\t$menu_locations     = array_merge( $menu_locations, $new_menu_locations );\n\t\t}\n\n\t\t// Add Menu.\n\t\tif ( 0 === $nav_menu_selected_id ) {\n\t\t\t$new_menu_title = trim( esc_html( $_POST['menu-name'] ) );\n\n\t\t\tif ( $new_menu_title ) {\n\t\t\t\t$_nav_menu_selected_id = wp_update_nav_menu_object( 0, array( 'menu-name' => $new_menu_title ) );\n\n\t\t\t\tif ( is_wp_error( $_nav_menu_selected_id ) ) {\n\t\t\t\t\t$messages[] = '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . $_nav_menu_selected_id->get_error_message() . '</p></div>';\n\t\t\t\t} else {\n\t\t\t\t\t$_menu_object            = wp_get_nav_menu_object( $_nav_menu_selected_id );\n\t\t\t\t\t$nav_menu_selected_id    = $_nav_menu_selected_id;\n\t\t\t\t\t$nav_menu_selected_title = $_menu_object->name;\n\n\t\t\t\t\tif ( isset( $_REQUEST['menu-item'] ) ) {\n\t\t\t\t\t\twp_save_nav_menu_items( $nav_menu_selected_id, absint( $_REQUEST['menu-item'] ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set the menu_location value correctly for the newly created menu.\n\t\t\t\t\tforeach ( $menu_locations as $location => $id ) {\n\t\t\t\t\t\tif ( 0 === $id ) {\n\t\t\t\t\t\t\t$menu_locations[ $location ] = $nav_menu_selected_id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tset_theme_mod( 'nav_menu_locations', $menu_locations );\n\n\t\t\t\t\tif ( isset( $_REQUEST['zero-menu-state'] ) || ! empty( $_POST['auto-add-pages'] ) ) {\n\t\t\t\t\t\t// If there are menu items, add them.\n\t\t\t\t\t\twp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( isset( $_REQUEST['zero-menu-state'] ) ) {\n\t\t\t\t\t\t// Auto-save nav_menu_locations.\n\t\t\t\t\t\t$locations = get_nav_menu_locations();\n\n\t\t\t\t\t\tforeach ( $locations as $location => $menu_id ) {\n\t\t\t\t\t\t\t\t$locations[ $location ] = $nav_menu_selected_id;\n\t\t\t\t\t\t\t\tbreak; // There should only be 1.\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tset_theme_mod( 'nav_menu_locations', $locations );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( isset( $_REQUEST['use-location'] ) ) {\n\t\t\t\t\t\t$locations      = get_registered_nav_menus();\n\t\t\t\t\t\t$menu_locations = get_nav_menu_locations();\n\n\t\t\t\t\t\tif ( isset( $locations[ $_REQUEST['use-location'] ] ) ) {\n\t\t\t\t\t\t\t$menu_locations[ $_REQUEST['use-location'] ] = $nav_menu_selected_id;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tset_theme_mod( 'nav_menu_locations', $menu_locations );\n\t\t\t\t\t}\n\n\t\t\t\t\twp_redirect( admin_url( 'nav-menus.php?menu=' . $_nav_menu_selected_id ) );\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$messages[] = '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . __( 'Please enter a valid menu name.' ) . '</p></div>';\n\t\t\t}\n\n\t\t\t// Update existing menu.\n\t\t} else {\n\t\t\t// Remove menu locations that have been unchecked.\n\t\t\tforeach ( $locations as $location => $description ) {\n\t\t\t\tif ( ( empty( $_POST['menu-locations'] ) || empty( $_POST['menu-locations'][ $location ] ) )\n\t\t\t\t\t&& isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] === $nav_menu_selected_id\n\t\t\t\t) {\n\t\t\t\t\tunset( $menu_locations[ $location ] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set menu locations.\n\t\t\tset_theme_mod( 'nav_menu_locations', $menu_locations );\n\n\t\t\t$_menu_object = wp_get_nav_menu_object( $nav_menu_selected_id );\n\n\t\t\t$menu_title = trim( esc_html( $_POST['menu-name'] ) );\n\n\t\t\tif ( ! $menu_title ) {\n\t\t\t\t$messages[] = '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . __( 'Please enter a valid menu name.' ) . '</p></div>';\n\t\t\t\t$menu_title = $_menu_object->name;\n\t\t\t}\n\n\t\t\tif ( ! is_wp_error( $_menu_object ) ) {\n\t\t\t\t$_nav_menu_selected_id = wp_update_nav_menu_object( $nav_menu_selected_id, array( 'menu-name' => $menu_title ) );\n\n\t\t\t\tif ( is_wp_error( $_nav_menu_selected_id ) ) {\n\t\t\t\t\t$_menu_object = $_nav_menu_selected_id;\n\t\t\t\t\t$messages[]   = '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . $_nav_menu_selected_id->get_error_message() . '</p></div>';\n\t\t\t\t} else {\n\t\t\t\t\t$_menu_object            = wp_get_nav_menu_object( $_nav_menu_selected_id );\n\t\t\t\t\t$nav_menu_selected_title = $_menu_object->name;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Update menu items.\n\t\t\tif ( ! is_wp_error( $_menu_object ) ) {\n\t\t\t\t$messages = array_merge( $messages, wp_nav_menu_update_menu_items( $_nav_menu_selected_id, $nav_menu_selected_title ) );\n\n\t\t\t\t// If the menu ID changed, redirect to the new URL.\n\t\t\t\tif ( $nav_menu_selected_id !== $_nav_menu_selected_id ) {\n\t\t\t\t\twp_redirect( admin_url( 'nav-menus.php?menu=' . intval( $_nav_menu_selected_id ) ) );\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbreak;\n\n\tcase 'locations':\n\t\tif ( ! $num_locations ) {\n\t\t\twp_redirect( admin_url( 'nav-menus.php' ) );\n\t\t\texit;\n\t\t}\n\n\t\tadd_filter( 'screen_options_show_screen', '__return_false' );\n\n\t\tif ( isset( $_POST['menu-locations'] ) ) {\n\t\t\tcheck_admin_referer( 'save-menu-locations' );\n\n\t\t\t$new_menu_locations = array_map( 'absint', $_POST['menu-locations'] );\n\t\t\t$menu_locations     = array_merge( $menu_locations, $new_menu_locations );\n\t\t\t// Set menu locations.\n\t\t\tset_theme_mod( 'nav_menu_locations', $menu_locations );\n\n\t\t\t$messages[] = '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . __( 'Menu locations updated.' ) . '</p></div>';\n\t\t}\n\n\t\tbreak;\n}\n\n// Get all nav menus.\n$nav_menus  = wp_get_nav_menus();\n$menu_count = count( $nav_menus );\n\n// Are we on the add new screen?\n$add_new_screen = ( isset( $_GET['menu'] ) && 0 === (int) $_GET['menu'] ) ? true : false;\n\n$locations_screen = ( isset( $_GET['action'] ) && 'locations' === $_GET['action'] ) ? true : false;\n\n$page_count = wp_count_posts( 'page' );\n\n/*\n * If we have one theme location, and zero menus, we take them right\n * into editing their first menu.\n */\nif ( 1 === count( get_registered_nav_menus() ) && ! $add_new_screen\n\t&& empty( $nav_menus ) && ! empty( $page_count->publish )\n) {\n\t$one_theme_location_no_menus = true;\n} else {\n\t$one_theme_location_no_menus = false;\n}\n\n$nav_menus_l10n = array(\n\t'oneThemeLocationNoMenus' => $one_theme_location_no_menus,\n\t'moveUp'                  => __( 'Move up one' ),\n\t'moveDown'                => __( 'Move down one' ),\n\t'moveToTop'               => __( 'Move to the top' ),\n\t/* translators: %s: Previous item name. */\n\t'moveUnder'               => __( 'Move under %s' ),\n\t/* translators: %s: Previous item name. */\n\t'moveOutFrom'             => __( 'Move out from under %s' ),\n\t/* translators: %s: Previous item name. */\n\t'under'                   => __( 'Under %s' ),\n\t/* translators: %s: Previous item name. */\n\t'outFrom'                 => __( 'Out from under %s' ),\n\t/* translators: 1: Item name, 2: Item position, 3: Total number of items. */\n\t'menuFocus'               => __( '%1$s. Menu item %2$d of %3$d.' ),\n\t/* translators: 1: Item name, 2: Item position, 3: Parent item name. */\n\t'subMenuFocus'            => __( '%1$s. Sub item number %2$d under %3$s.' ),\n);\nwp_localize_script( 'nav-menu', 'menus', $nav_menus_l10n );\n\n/*\n * Redirect to add screen if there are no menus and this users has either zero,\n * or more than 1 theme locations.\n */\nif ( 0 === $menu_count && ! $add_new_screen && ! $one_theme_location_no_menus ) {\n\twp_redirect( admin_url( 'nav-menus.php?action=edit&menu=0' ) );\n}\n\n// Get recently edited nav menu.\n$recently_edited = absint( get_user_option( 'nav_menu_recently_edited' ) );\nif ( empty( $recently_edited ) && is_nav_menu( $nav_menu_selected_id ) ) {\n\t$recently_edited = $nav_menu_selected_id;\n}\n\n// Use $recently_edited if none are selected.\nif ( empty( $nav_menu_selected_id ) && ! isset( $_GET['menu'] ) && is_nav_menu( $recently_edited ) ) {\n\t$nav_menu_selected_id = $recently_edited;\n}\n\n// On deletion of menu, if another menu exists, show it.\nif ( ! $add_new_screen && $menu_count > 0 && isset( $_GET['action'] ) && 'delete' === $_GET['action'] ) {\n\t$nav_menu_selected_id = $nav_menus[0]->term_id;\n}\n\n// Set $nav_menu_selected_id to 0 if no menus.\nif ( $one_theme_location_no_menus ) {\n\t$nav_menu_selected_id = 0;\n} elseif ( empty( $nav_menu_selected_id ) && ! empty( $nav_menus ) && ! $add_new_screen ) {\n\t// If we have no selection yet, and we have menus, set to the first one in the list.\n\t$nav_menu_selected_id = $nav_menus[0]->term_id;\n}\n\n// Update the user's setting.\nif ( $nav_menu_selected_id !== $recently_edited && is_nav_menu( $nav_menu_selected_id ) ) {\n\tupdate_user_meta( $current_user->ID, 'nav_menu_recently_edited', $nav_menu_selected_id );\n}\n\n// If there's a menu, get its name.\nif ( ! $nav_menu_selected_title && is_nav_menu( $nav_menu_selected_id ) ) {\n\t$_menu_object            = wp_get_nav_menu_object( $nav_menu_selected_id );\n\t$nav_menu_selected_title = ! is_wp_error( $_menu_object ) ? $_menu_object->name : '';\n}\n\n// Generate truncated menu names.\nforeach ( (array) $nav_menus as $key => $_nav_menu ) {\n\t$nav_menus[ $key ]->truncated_name = wp_html_excerpt( $_nav_menu->name, 40, '&hellip;' );\n}\n\n// Retrieve menu locations.\nif ( current_theme_supports( 'menus' ) ) {\n\t$locations      = get_registered_nav_menus();\n\t$menu_locations = get_nav_menu_locations();\n}\n\n/*\n * Ensure the user will be able to scroll horizontally\n * by adding a class for the max menu depth.\n *\n * @global int $_wp_nav_menu_max_depth\n */\nglobal $_wp_nav_menu_max_depth;\n$_wp_nav_menu_max_depth = 0;\n\n// Calling wp_get_nav_menu_to_edit generates $_wp_nav_menu_max_depth.\nif ( is_nav_menu( $nav_menu_selected_id ) ) {\n\t$menu_items  = wp_get_nav_menu_items( $nav_menu_selected_id, array( 'post_status' => 'any' ) );\n\t$edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id );\n}\n\n/**\n * @global int $_wp_nav_menu_max_depth\n *\n * @param string $classes\n * @return string\n */\nfunction wp_nav_menu_max_depth( $classes ) {\n\tglobal $_wp_nav_menu_max_depth;\n\treturn \"$classes menu-max-depth-$_wp_nav_menu_max_depth\";\n}\n\nadd_filter( 'admin_body_class', 'wp_nav_menu_max_depth' );\n\nwp_nav_menu_setup();\nwp_initial_nav_menu_meta_boxes();\n\nif ( ! current_theme_supports( 'menus' ) && ! $num_locations ) {\n\t$messages[] = '<div id=\"message\" class=\"updated\"><p>' . sprintf(\n\t\t/* translators: %s: URL to Widgets screen. */\n\t\t__( 'Your theme does not natively support menus, but you can use them in sidebars by adding a &#8220;Navigation Menu&#8221; widget on the <a href=\"%s\">Widgets</a> screen.' ),\n\t\tadmin_url( 'widgets.php' )\n\t) . '</p></div>';\n}\n\nif ( ! $locations_screen ) : // Main tab.\n\t$overview  = '<p>' . __( 'This screen is used for managing your navigation menus.' ) . '</p>';\n\t$overview .= '<p>' . sprintf(\n\t\t/* translators: 1: URL to Widgets screen, 2 and 3: The names of the default themes. */\n\t\t__( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a &#8220;Navigation Menu&#8221; widget on the <a href=\"%1$s\">Widgets</a> screen. If your theme does not support the navigation menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ),\n\t\tadmin_url( 'widgets.php' ),\n\t\t'Twenty Nineteen',\n\t\t'Twenty Twenty'\n\t) . '</p>';\n\t$overview .= '<p>' . __( 'From this screen you can:' ) . '</p>';\n\t$overview .= '<ul><li>' . __( 'Create, edit, and delete menus' ) . '</li>';\n\t$overview .= '<li>' . __( 'Add, organize, and modify individual menu items' ) . '</li></ul>';\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'overview',\n\t\t\t'title'   => __( 'Overview' ),\n\t\t\t'content' => $overview,\n\t\t)\n\t);\n\n\t$menu_management  = '<p>' . __( 'The menu management box at the top of the screen is used to control which menu is opened in the editor below.' ) . '</p>';\n\t$menu_management .= '<ul><li>' . __( 'To edit an existing menu, <strong>choose a menu from the drop down and click Select</strong>' ) . '</li>';\n\t$menu_management .= '<li>' . __( 'If you haven&#8217;t yet created any menus, <strong>click the &#8217;create a new menu&#8217; link</strong> to get started' ) . '</li></ul>';\n\t$menu_management .= '<p>' . __( 'You can assign theme locations to individual menus by <strong>selecting the desired settings</strong> at the bottom of the menu editor. To assign menus to all theme locations at once, <strong>visit the Manage Locations tab</strong> at the top of the screen.' ) . '</p>';\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'menu-management',\n\t\t\t'title'   => __( 'Menu Management' ),\n\t\t\t'content' => $menu_management,\n\t\t)\n\t);\n\n\t$editing_menus  = '<p>' . __( 'Each navigation menu may contain a mix of links to pages, categories, custom URLs or other content types. Menu links are added by selecting items from the expanding boxes in the left-hand column below.' ) . '</p>';\n\t$editing_menus .= '<p>' . __( '<strong>Clicking the arrow to the right of any menu item</strong> in the editor will reveal a standard group of settings. Additional settings such as link target, CSS classes, link relationships, and link descriptions can be enabled and disabled via the Screen Options tab.' ) . '</p>';\n\t$editing_menus .= '<ul><li>' . __( 'Add one or several items at once by <strong>selecting the checkbox next to each item and clicking Add to Menu</strong>' ) . '</li>';\n\t$editing_menus .= '<li>' . __( 'To add a custom link, <strong>expand the Custom Links section, enter a URL and link text, and click Add to Menu</strong>' ) . '</li>';\n\t$editing_menus .= '<li>' . __( 'To reorganize menu items, <strong>drag and drop items with your mouse or use your keyboard</strong>. Drag or move a menu item a little to the right to make it a submenu' ) . '</li>';\n\t$editing_menus .= '<li>' . __( 'Delete a menu item by <strong>expanding it and clicking the Remove link</strong>' ) . '</li></ul>';\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'editing-menus',\n\t\t\t'title'   => __( 'Editing Menus' ),\n\t\t\t'content' => $editing_menus,\n\t\t)\n\t);\nelse : // Locations tab.\n\t$locations_overview  = '<p>' . __( 'This screen is used for globally assigning menus to locations defined by your theme.' ) . '</p>';\n\t$locations_overview .= '<ul><li>' . __( 'To assign menus to one or more theme locations, <strong>select a menu from each location&#8217;s drop down.</strong> When you&#8217;re finished, <strong>click Save Changes</strong>' ) . '</li>';\n\t$locations_overview .= '<li>' . __( 'To edit a menu currently assigned to a theme location, <strong>click the adjacent &#8217;Edit&#8217; link</strong>' ) . '</li>';\n\t$locations_overview .= '<li>' . __( 'To add a new menu instead of assigning an existing one, <strong>click the &#8217;Use new menu&#8217; link</strong>. Your new menu will be automatically assigned to that theme location' ) . '</li></ul>';\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'locations-overview',\n\t\t\t'title'   => __( 'Overview' ),\n\t\t\t'content' => $locations_overview,\n\t\t)\n\t);\nendif;\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/appearance-menus-screen/\">Documentation on Menus</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\n// Get the admin header.\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n<div class=\"wrap\">\n\t<h1 class=\"wp-heading-inline\"><?php echo esc_html( __( 'Menus' ) ); ?></h1>\n\t<?php\n\tif ( current_user_can( 'customize' ) ) :\n\t\t$focus = $locations_screen ? array( 'section' => 'menu_locations' ) : array( 'panel' => 'nav_menus' );\n\t\tprintf(\n\t\t\t' <a class=\"page-title-action hide-if-no-customize\" href=\"%1$s\">%2$s</a>',\n\t\t\tesc_url(\n\t\t\t\tadd_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\tarray( 'autofocus' => $focus ),\n\t\t\t\t\t\t'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ),\n\t\t\t\t\t),\n\t\t\t\t\tadmin_url( 'customize.php' )\n\t\t\t\t)\n\t\t\t),\n\t\t\t__( 'Manage with Live Preview' )\n\t\t);\n\tendif;\n\n\t$nav_tab_active_class = '';\n\t$nav_aria_current     = '';\n\n\tif ( ! isset( $_GET['action'] ) || isset( $_GET['action'] ) && 'locations' !== $_GET['action'] ) {\n\t\t$nav_tab_active_class = ' nav-tab-active';\n\t\t$nav_aria_current     = ' aria-current=\"page\"';\n\t}\n\t?>\n\n\t<hr class=\"wp-header-end\">\n\n\t<nav class=\"nav-tab-wrapper wp-clearfix\" aria-label=\"<?php esc_attr_e( 'Secondary menu' ); ?>\">\n\t\t<a href=\"<?php echo admin_url( 'nav-menus.php' ); ?>\" class=\"nav-tab<?php echo $nav_tab_active_class; ?>\"<?php echo $nav_aria_current; ?>><?php esc_html_e( 'Edit Menus' ); ?></a>\n\t\t<?php\n\t\tif ( $num_locations && $menu_count ) {\n\t\t\t$active_tab_class = '';\n\t\t\t$aria_current     = '';\n\n\t\t\tif ( $locations_screen ) {\n\t\t\t\t$active_tab_class = ' nav-tab-active';\n\t\t\t\t$aria_current     = ' aria-current=\"page\"';\n\t\t\t}\n\t\t\t?>\n\t\t\t<a href=\"<?php echo esc_url( add_query_arg( array( 'action' => 'locations' ), admin_url( 'nav-menus.php' ) ) ); ?>\" class=\"nav-tab<?php echo $active_tab_class; ?>\"<?php echo $aria_current; ?>><?php esc_html_e( 'Manage Locations' ); ?></a>\n\t\t\t<?php\n\t\t}\n\t\t?>\n\t</nav>\n\t<?php\n\tforeach ( $messages as $message ) :\n\t\techo $message . \"\\n\";\n\tendforeach;\n\t?>\n\t<?php\n\tif ( $locations_screen ) :\n\t\tif ( 1 === $num_locations ) {\n\t\t\techo '<p>' . __( 'Your theme supports one menu. Select which menu you would like to use.' ) . '</p>';\n\t\t} else {\n\t\t\techo '<p>' . sprintf(\n\t\t\t\t/* translators: %s: Number of menus. */\n\t\t\t\t_n(\n\t\t\t\t\t'Your theme supports %s menu. Select which menu appears in each location.',\n\t\t\t\t\t'Your theme supports %s menus. Select which menu appears in each location.',\n\t\t\t\t\t$num_locations\n\t\t\t\t),\n\t\t\t\tnumber_format_i18n( $num_locations )\n\t\t\t) . '</p>';\n\t\t}\n\t\t?>\n\t<div id=\"menu-locations-wrap\">\n\t\t<form method=\"post\" action=\"<?php echo esc_url( add_query_arg( array( 'action' => 'locations' ), admin_url( 'nav-menus.php' ) ) ); ?>\">\n\t\t\t<table class=\"widefat fixed\" id=\"menu-locations-table\">\n\t\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"col\" class=\"manage-column column-locations\"><?php _e( 'Theme Location' ); ?></th>\n\t\t\t\t\t<th scope=\"col\" class=\"manage-column column-menus\"><?php _e( 'Assigned Menu' ); ?></th>\n\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody class=\"menu-locations\">\n\t\t\t\t<?php foreach ( $locations as $_location => $_name ) { ?>\n\t\t\t\t\t<tr class=\"menu-locations-row\">\n\t\t\t\t\t\t<td class=\"menu-location-title\"><label for=\"locations-<?php echo $_location; ?>\"><?php echo $_name; ?></label></td>\n\t\t\t\t\t\t<td class=\"menu-location-menus\">\n\t\t\t\t\t\t\t<select name=\"menu-locations[<?php echo $_location; ?>]\" id=\"locations-<?php echo $_location; ?>\">\n\t\t\t\t\t\t\t\t<option value=\"0\"><?php printf( '&mdash; %s &mdash;', esc_html__( 'Select a Menu' ) ); ?></option>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tforeach ( $nav_menus as $menu ) :\n\t\t\t\t\t\t\t\t\t$data_orig = '';\n\t\t\t\t\t\t\t\t\t$selected  = isset( $menu_locations[ $_location ] ) && $menu_locations[ $_location ] === $menu->term_id;\n\n\t\t\t\t\t\t\t\t\tif ( $selected ) {\n\t\t\t\t\t\t\t\t\t\t$data_orig = 'data-orig=\"true\"';\n\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<option <?php echo $data_orig; ?> <?php selected( $selected ); ?> value=\"<?php echo $menu->term_id; ?>\">\n\t\t\t\t\t\t\t\t\t\t<?php echo wp_html_excerpt( $menu->name, 40, '&hellip;' ); ?>\n\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t<div class=\"locations-row-links\">\n\t\t\t\t\t\t\t\t<?php if ( isset( $menu_locations[ $_location ] ) && 0 !== $menu_locations[ $_location ] ) : ?>\n\t\t\t\t\t\t\t\t<span class=\"locations-edit-menu-link\">\n\t\t\t\t\t\t\t\t\t<a href=\"\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'action' => 'edit',\n\t\t\t\t\t\t\t\t\t\t\t\t'menu'   => $menu_locations[ $_location ],\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tadmin_url( 'nav-menus.php' )\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?>\n\t\t\t\t\t\t\t\t\t\">\n\t\t\t\t\t\t\t\t\t\t<span aria-hidden=\"true\"><?php _ex( 'Edit', 'menu' ); ?></span><span class=\"screen-reader-text\"><?php _e( 'Edit selected menu' ); ?></span>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t<span class=\"locations-add-menu-link\">\n\t\t\t\t\t\t\t\t\t<a href=\"\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'action' => 'edit',\n\t\t\t\t\t\t\t\t\t\t\t\t'menu'   => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'use-location' => $_location,\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tadmin_url( 'nav-menus.php' )\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?>\n\t\t\t\t\t\t\t\t\t\">\n\t\t\t\t\t\t\t\t\t\t<?php _ex( 'Use new menu', 'menu' ); ?>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div><!-- .locations-row-links -->\n\t\t\t\t\t\t</td><!-- .menu-location-menus -->\n\t\t\t\t\t</tr><!-- .menu-locations-row -->\n\t\t\t\t<?php } // End foreach. ?>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<p class=\"button-controls wp-clearfix\"><?php submit_button( __( 'Save Changes' ), 'primary left', 'nav-menu-locations', false ); ?></p>\n\t\t\t<?php wp_nonce_field( 'save-menu-locations' ); ?>\n\t\t\t<input type=\"hidden\" name=\"menu\" id=\"nav-menu-meta-object-id\" value=\"<?php echo esc_attr( $nav_menu_selected_id ); ?>\" />\n\t\t</form>\n\t</div><!-- #menu-locations-wrap -->\n\t\t<?php\n\t\t/**\n\t\t * Fires after the menu locations table is displayed.\n\t\t *\n\t\t * @since 3.6.0\n\t\t */\n\t\tdo_action( 'after_menu_locations_table' );\n\t\t?>\n\t<?php else : ?>\n\t<div class=\"manage-menus\">\n\t\t<?php if ( $menu_count < 1 ) : ?>\n\t\t<span class=\"first-menu-message\">\n\t\t\t<?php _e( 'Create your first menu below.' ); ?>\n\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Fill in the Menu Name and click the Create Menu button to create your first menu.' ); ?></span>\n\t\t</span><!-- /first-menu-message -->\n\t\t<?php elseif ( $menu_count < 2 ) : ?>\n\t\t<span class=\"add-edit-menu-action\">\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: URL to create a new menu. */\n\t\t\t\t__( 'Edit your menu below, or <a href=\"%s\">create a new menu</a>. Don&#8217;t forget to save your changes!' ),\n\t\t\t\tesc_url(\n\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'action' => 'edit',\n\t\t\t\t\t\t\t'menu'   => 0,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tadmin_url( 'nav-menus.php' )\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\t?>\n\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Click the Save Menu button to save your changes.' ); ?></span>\n\t\t</span><!-- /add-edit-menu-action -->\n\t\t<?php else : ?>\n\t\t\t<form method=\"get\" action=\"<?php echo admin_url( 'nav-menus.php' ); ?>\">\n\t\t\t<input type=\"hidden\" name=\"action\" value=\"edit\" />\n\t\t\t<label for=\"select-menu-to-edit\" class=\"selected-menu\"><?php _e( 'Select a menu to edit:' ); ?></label>\n\t\t\t<select name=\"menu\" id=\"select-menu-to-edit\">\n\t\t\t\t<?php if ( $add_new_screen ) : ?>\n\t\t\t\t\t<option value=\"0\" selected=\"selected\"><?php _e( '&mdash; Select &mdash;' ); ?></option>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php foreach ( (array) $nav_menus as $_nav_menu ) : ?>\n\t\t\t\t\t<option value=\"<?php echo esc_attr( $_nav_menu->term_id ); ?>\" <?php selected( $_nav_menu->term_id, $nav_menu_selected_id ); ?>>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\techo esc_html( $_nav_menu->truncated_name );\n\n\t\t\t\t\t\tif ( ! empty( $menu_locations ) && in_array( $_nav_menu->term_id, $menu_locations, true ) ) {\n\t\t\t\t\t\t\t$locations_assigned_to_this_menu = array();\n\n\t\t\t\t\t\t\tforeach ( array_keys( $menu_locations, $_nav_menu->term_id, true ) as $menu_location_key ) {\n\t\t\t\t\t\t\t\tif ( isset( $locations[ $menu_location_key ] ) ) {\n\t\t\t\t\t\t\t\t\t$locations_assigned_to_this_menu[] = $locations[ $menu_location_key ];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Filters the number of locations listed per menu in the drop-down select.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @since 3.6.0\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @param int $locations Number of menu locations to list. Default 3.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t$locations_listed_per_menu = absint( apply_filters( 'wp_nav_locations_listed_per_menu', 3 ) );\n\n\t\t\t\t\t\t\t$assigned_locations = array_slice( $locations_assigned_to_this_menu, 0, $locations_listed_per_menu );\n\n\t\t\t\t\t\t\t// Adds ellipses following the number of locations defined in $assigned_locations.\n\t\t\t\t\t\t\tif ( ! empty( $assigned_locations ) ) {\n\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t' (%1$s%2$s)',\n\t\t\t\t\t\t\t\t\timplode( ', ', $assigned_locations ),\n\t\t\t\t\t\t\t\t\tcount( $locations_assigned_to_this_menu ) > count( $assigned_locations ) ? ' &hellip;' : ''\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\t?>\n\t\t\t\t\t</option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</select>\n\t\t\t<span class=\"submit-btn\"><input type=\"submit\" class=\"button\" value=\"<?php esc_attr_e( 'Select' ); ?>\"></span>\n\t\t\t<span class=\"add-new-menu-action\">\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: URL to create a new menu. */\n\t\t\t\t\t__( 'or <a href=\"%s\">create a new menu</a>. Don&#8217;t forget to save your changes!' ),\n\t\t\t\t\tesc_url(\n\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'action' => 'edit',\n\t\t\t\t\t\t\t\t'menu'   => 0,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tadmin_url( 'nav-menus.php' )\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Click the Save Menu button to save your changes.' ); ?></span>\n\t\t\t</span><!-- /add-new-menu-action -->\n\t\t</form>\n\t\t\t<?php\n\t\tendif;\n\n\t\t$metabox_holder_disabled_class = '';\n\n\t\tif ( isset( $_GET['menu'] ) && 0 === (int) $_GET['menu'] ) {\n\t\t\t$metabox_holder_disabled_class = ' metabox-holder-disabled';\n\t\t}\n\t\t?>\n\t</div><!-- /manage-menus -->\n\t<div id=\"nav-menus-frame\" class=\"wp-clearfix\">\n\t<div id=\"menu-settings-column\" class=\"metabox-holder<?php echo $metabox_holder_disabled_class; ?>\">\n\n\t\t<div class=\"clear\"></div>\n\n\t\t<form id=\"nav-menu-meta\" class=\"nav-menu-meta\" method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t<input type=\"hidden\" name=\"menu\" id=\"nav-menu-meta-object-id\" value=\"<?php echo esc_attr( $nav_menu_selected_id ); ?>\" />\n\t\t\t<input type=\"hidden\" name=\"action\" value=\"add-menu-item\" />\n\t\t\t<?php wp_nonce_field( 'add-menu_item', 'menu-settings-column-nonce' ); ?>\n\t\t\t<h2><?php _e( 'Add menu items' ); ?></h2>\n\t\t\t<?php do_accordion_sections( 'nav-menus', 'side', null ); ?>\n\t\t</form>\n\n\t</div><!-- /#menu-settings-column -->\n\t<div id=\"menu-management-liquid\">\n\t\t<div id=\"menu-management\">\n\t\t\t<form id=\"update-nav-menu\" method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t\t<h2><?php _e( 'Menu structure' ); ?></h2>\n\t\t\t\t<div class=\"menu-edit\">\n\t\t\t\t\t<input type=\"hidden\" name=\"nav-menu-data\">\n\t\t\t\t\t<?php\n\t\t\t\t\twp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );\n\t\t\t\t\twp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );\n\t\t\t\t\twp_nonce_field( 'update-nav_menu', 'update-nav-menu-nonce' );\n\n\t\t\t\t\t$menu_name_aria_desc = $add_new_screen ? ' aria-describedby=\"menu-name-desc\"' : '';\n\n\t\t\t\t\tif ( $one_theme_location_no_menus ) {\n\t\t\t\t\t\t$menu_name_val = 'value=\"' . esc_attr( 'Menu 1' ) . '\"';\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<input type=\"hidden\" name=\"zero-menu-state\" value=\"true\" />\n\t\t\t\t\t\t<?php\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$menu_name_val = 'value=\"' . esc_attr( $nav_menu_selected_title ) . '\"';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"update\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"menu\" id=\"menu\" value=\"<?php echo esc_attr( $nav_menu_selected_id ); ?>\" />\n\t\t\t\t\t<div id=\"nav-menu-header\">\n\t\t\t\t\t\t<div class=\"major-publishing-actions wp-clearfix\">\n\t\t\t\t\t\t\t<label class=\"menu-name-label\" for=\"menu-name\"><?php _e( 'Menu Name' ); ?></label>\n\t\t\t\t\t\t\t<input name=\"menu-name\" id=\"menu-name\" type=\"text\" class=\"menu-name regular-text menu-item-textbox\" <?php echo $menu_name_val . $menu_name_aria_desc; ?> />\n\t\t\t\t\t\t\t<div class=\"publishing-action\">\n\t\t\t\t\t\t\t\t<?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'primary large menu-save', 'save_menu', false, array( 'id' => 'save_menu_header' ) ); ?>\n\t\t\t\t\t\t\t</div><!-- END .publishing-action -->\n\t\t\t\t\t\t</div><!-- END .major-publishing-actions -->\n\t\t\t\t\t</div><!-- END .nav-menu-header -->\n\t\t\t\t\t<div id=\"post-body\">\n\t\t\t\t\t\t<div id=\"post-body-content\" class=\"wp-clearfix\">\n\t\t\t\t\t\t\t<?php if ( ! $add_new_screen ) : ?>\n\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$hide_style = '';\n\n\t\t\t\t\t\t\t\tif ( isset( $menu_items ) && 0 === count( $menu_items ) ) {\n\t\t\t\t\t\t\t\t\t$hide_style = 'style=\"display: none;\"';\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( $one_theme_location_no_menus ) {\n\t\t\t\t\t\t\t\t\t$starter_copy = __( 'Edit your default menu by adding or removing items. Drag the items into the order you prefer. Click Create Menu to save your changes.' );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$starter_copy = __( 'Drag the items into the order you prefer. Click the arrow on the right of the item to reveal additional configuration options.' );\n\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\t<div class=\"drag-instructions post-body-plain\" <?php echo $hide_style; ?>>\n\t\t\t\t\t\t\t\t\t<p><?php echo $starter_copy; ?></p>\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( isset( $edit_markup ) && ! is_wp_error( $edit_markup ) ) {\n\t\t\t\t\t\t\t\t\techo $edit_markup;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<ul class=\"menu\" id=\"menu-to-edit\"></ul>\n\t\t\t\t\t\t\t\t<?php } ?>\n\n\t\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t\t<?php if ( $add_new_screen ) : ?>\n\t\t\t\t\t\t\t\t<p class=\"post-body-plain\" id=\"menu-name-desc\"><?php _e( 'Give your menu a name, then click Create Menu.' ); ?></p>\n\t\t\t\t\t\t\t\t<?php if ( isset( $_GET['use-location'] ) ) : ?>\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"use-location\" value=\"<?php echo esc_attr( $_GET['use-location'] ); ?>\" />\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t$no_menus_style = '';\n\n\t\t\t\t\t\t\tif ( $one_theme_location_no_menus ) {\n\t\t\t\t\t\t\t\t$no_menus_style = 'style=\"display: none;\"';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<div class=\"menu-settings\" <?php echo $no_menus_style; ?>>\n\t\t\t\t\t\t\t\t<h3><?php _e( 'Menu Settings' ); ?></h3>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( ! isset( $auto_add ) ) {\n\t\t\t\t\t\t\t\t\t$auto_add = get_option( 'nav_menu_options' );\n\n\t\t\t\t\t\t\t\t\tif ( ! isset( $auto_add['auto_add'] ) ) {\n\t\t\t\t\t\t\t\t\t\t$auto_add = false;\n\t\t\t\t\t\t\t\t\t} elseif ( false !== array_search( $nav_menu_selected_id, $auto_add['auto_add'], true ) ) {\n\t\t\t\t\t\t\t\t\t\t$auto_add = true;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$auto_add = false;\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\t?>\n\n\t\t\t\t\t\t\t\t<fieldset class=\"menu-settings-group auto-add-pages\">\n\t\t\t\t\t\t\t\t\t<legend class=\"menu-settings-group-name howto\"><?php _e( 'Auto add pages' ); ?></legend>\n\t\t\t\t\t\t\t\t\t<div class=\"menu-settings-input checkbox-input\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\"<?php checked( $auto_add ); ?> name=\"auto-add-pages\" id=\"auto-add-pages\" value=\"1\" /> <label for=\"auto-add-pages\"><?php printf( __( 'Automatically add new top-level pages to this menu' ), esc_url( admin_url( 'edit.php?post_type=page' ) ) ); ?></label>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</fieldset>\n\n\t\t\t\t\t\t\t\t<?php if ( current_theme_supports( 'menus' ) ) : ?>\n\n\t\t\t\t\t\t\t\t\t<fieldset class=\"menu-settings-group menu-theme-locations\">\n\t\t\t\t\t\t\t\t\t\t<legend class=\"menu-settings-group-name howto\"><?php _e( 'Display location' ); ?></legend>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tforeach ( $locations as $location => $description ) :\n\t\t\t\t\t\t\t\t\t\t\t$checked = isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] === $nav_menu_selected_id;\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"menu-settings-input checkbox-input\">\n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\"<?php checked( $checked ); ?> name=\"menu-locations[<?php echo esc_attr( $location ); ?>]\" id=\"locations-<?php echo esc_attr( $location ); ?>\" value=\"<?php echo esc_attr( $nav_menu_selected_id ); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"locations-<?php echo esc_attr( $location ); ?>\"><?php echo $description; ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( ! empty( $menu_locations[ $location ] ) && $menu_locations[ $location ] !== $nav_menu_selected_id ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"theme-location-set\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: Menu name. */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t_x( '(Currently set to: %s)', 'menu location' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twp_get_nav_menu_object( $menu_locations[ $location ] )->name\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\t</fieldset>\n\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div><!-- /#post-body-content -->\n\t\t\t\t\t</div><!-- /#post-body -->\n\t\t\t\t\t<div id=\"nav-menu-footer\">\n\t\t\t\t\t\t<div class=\"major-publishing-actions wp-clearfix\">\n\t\t\t\t\t\t\t<?php if ( $menu_count > 0 ) : ?>\n\n\t\t\t\t\t\t\t\t<?php if ( $add_new_screen ) : ?>\n\t\t\t\t\t\t\t\t<span class=\"cancel-action\">\n\t\t\t\t\t\t\t\t\t<a class=\"submitcancel cancellation menu-cancel\" href=\"<?php echo esc_url( admin_url( 'nav-menus.php' ) ); ?>\"><?php _e( 'Cancel' ); ?></a>\n\t\t\t\t\t\t\t\t</span><!-- END .cancel-action -->\n\t\t\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t\t<span class=\"delete-action\">\n\t\t\t\t\t\t\t\t\t<a class=\"submitdelete deletion menu-delete\" href=\"\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\techo esc_url(\n\t\t\t\t\t\t\t\t\t\twp_nonce_url(\n\t\t\t\t\t\t\t\t\t\t\tadd_query_arg(\n\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'action' => 'delete',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'menu' => $nav_menu_selected_id,\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\tadmin_url( 'nav-menus.php' )\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'delete-nav_menu-' . $nav_menu_selected_id\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?>\n\t\t\t\t\t\t\t\t\t\"><?php _e( 'Delete Menu' ); ?></a>\n\t\t\t\t\t\t\t\t</span><!-- END .delete-action -->\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t<div class=\"publishing-action\">\n\t\t\t\t\t\t\t\t<?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'primary large menu-save', 'save_menu', false, array( 'id' => 'save_menu_footer' ) ); ?>\n\t\t\t\t\t\t\t</div><!-- END .publishing-action -->\n\t\t\t\t\t\t</div><!-- END .major-publishing-actions -->\n\t\t\t\t\t</div><!-- /#nav-menu-footer -->\n\t\t\t\t</div><!-- /.menu-edit -->\n\t\t\t</form><!-- /#update-nav-menu -->\n\t\t</div><!-- /#menu-management -->\n\t</div><!-- /#menu-management-liquid -->\n\t</div><!-- /#nav-menus-frame -->\n\t<?php endif; ?>\n</div><!-- /.wrap-->\n<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 1113}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Network installation administration panel.\n *\n * A multi-step process allowing the user to enable a network of WordPress sites.\n *\n * @since 3.0.0\n *\n * @package WordPress\n * @subpackage Administration\n */\n\ndefine( 'WP_INSTALLING_NETWORK', true );\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'setup_network' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );\n}\n\nif ( is_multisite() ) {\n\tif ( ! is_network_admin() ) {\n\t\twp_redirect( network_admin_url( 'setup.php' ) );\n\t\texit;\n\t}\n\n\tif ( ! defined( 'MULTISITE' ) ) {\n\t\twp_die( __( 'The Network creation panel is not for WordPress MU networks.' ) );\n\t}\n}\n\nrequire_once __DIR__ . '/includes/network.php';\n\n// We need to create references to ms global tables to enable Network.\nforeach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table ) {\n\t$wpdb->$table = $prefixed_table;\n}\n\nif ( ! network_domain_check() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || ! WP_ALLOW_MULTISITE ) ) {\n\twp_die(\n\t\tprintf(\n\t\t\t/* translators: 1: WP_ALLOW_MULTISITE, 2: wp-config.php */\n\t\t\t__( 'You must define the %1$s constant as true in your %2$s file to allow creation of a Network.' ),\n\t\t\t'<code>WP_ALLOW_MULTISITE</code>',\n\t\t\t'<code>wp-config.php</code>'\n\t\t)\n\t);\n}\n\nif ( is_network_admin() ) {\n\t$title       = __( 'Network Setup' );\n\t$parent_file = 'settings.php';\n} else {\n\t$title       = __( 'Create a Network of WordPress Sites' );\n\t$parent_file = 'tools.php';\n}\n\n$network_help = '<p>' . __( 'This screen allows you to configure a network as having subdomains (<code>site1.example.com</code>) or subdirectories (<code>example.com/site1</code>). Subdomains require wildcard subdomains to be enabled in Apache and DNS records, if your host allows it.' ) . '</p>' .\n\t'<p>' . __( 'Choose subdomains or subdirectories; this can only be switched afterwards by reconfiguring your installation. Fill out the network details, and click Install. If this does not work, you may have to add a wildcard DNS record (for subdomains) or change to another setting in Permalinks (for subdirectories).' ) . '</p>' .\n\t'<p>' . __( 'The next screen for Network Setup will give you individually-generated lines of code to add to your wp-config.php and .htaccess files. Make sure the settings of your FTP client make files starting with a dot visible, so that you can find .htaccess; you may have to create this file if it really is not there. Make backup copies of those two files.' ) . '</p>' .\n\t'<p>' . __( 'Add the designated lines of code to wp-config.php (just before <code>/*...stop editing...*/</code>) and <code>.htaccess</code> (replacing the existing WordPress rules).' ) . '</p>' .\n\t'<p>' . __( 'Once you add this code and refresh your browser, multisite should be enabled. This screen, now in the Network Admin navigation menu, will keep an archive of the added code. You can toggle between Network Admin and Site Admin by clicking on the Network Admin or an individual site name under the My Sites dropdown in the Toolbar.' ) . '</p>' .\n\t'<p>' . __( 'The choice of subdirectory sites is disabled if this setup is more than a month old because of permalink problems with &#8220;/blog/&#8221; from the main site. This disabling will be addressed in a future version.' ) . '</p>' .\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/create-a-network/\">Documentation on Creating a Network</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/tools-network-screen/\">Documentation on the Network Screen</a>' ) . '</p>';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'network',\n\t\t'title'   => __( 'Network' ),\n\t\t'content' => $network_help,\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/create-a-network/\">Documentation on Creating a Network</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/tools-network-screen/\">Documentation on the Network Screen</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n<div class=\"wrap\">\n<h1><?php echo esc_html( $title ); ?></h1>\n\n<?php\nif ( $_POST ) {\n\n\tcheck_admin_referer( 'install-network-1' );\n\n\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\t// Create network tables.\n\tinstall_network();\n\t$base              = parse_url( trailingslashit( get_option( 'home' ) ), PHP_URL_PATH );\n\t$subdomain_install = allow_subdomain_install() ? ! empty( $_POST['subdomain_install'] ) : false;\n\tif ( ! network_domain_check() ) {\n\t\t$result = populate_network( 1, get_clean_basedomain(), sanitize_email( $_POST['email'] ), wp_unslash( $_POST['sitename'] ), $base, $subdomain_install );\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\tif ( 1 === count( $result->get_error_codes() ) && 'no_wildcard_dns' === $result->get_error_code() ) {\n\t\t\t\tnetwork_step2( $result );\n\t\t\t} else {\n\t\t\t\tnetwork_step1( $result );\n\t\t\t}\n\t\t} else {\n\t\t\tnetwork_step2();\n\t\t}\n\t} else {\n\t\tnetwork_step2();\n\t}\n} elseif ( is_multisite() || network_domain_check() ) {\n\tnetwork_step2();\n} else {\n\tnetwork_step1();\n}\n?>\n</div>\n\n<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 122}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Discussion settings administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'manage_options' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );\n}\n\n$title       = __( 'Discussion Settings' );\n$parent_file = 'options-general.php';\n\nadd_action( 'admin_print_footer_scripts', 'options_discussion_add_js' );\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' => '<p>' . __( 'This screen provides many options for controlling the management and display of comments and links to your posts/pages. So many, in fact, they won&#8217;t all fit here! :) Use the documentation links to get information on what each discussion setting does.' ) . '</p>' .\n\t\t\t'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/settings-discussion-screen/\">Documentation on Discussion Settings</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n\n<div class=\"wrap\">\n<h1><?php echo esc_html( $title ); ?></h1>\n\n<form method=\"post\" action=\"options.php\">\n<?php settings_fields( 'discussion' ); ?>\n\n<table class=\"form-table\" role=\"presentation\">\n<tr>\n<th scope=\"row\"><?php _e( 'Default post settings' ); ?></th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Default post settings' ); ?></span></legend>\n<label for=\"default_pingback_flag\">\n<input name=\"default_pingback_flag\" type=\"checkbox\" id=\"default_pingback_flag\" value=\"1\" <?php checked( '1', get_option( 'default_pingback_flag' ) ); ?> />\n<?php _e( 'Attempt to notify any blogs linked to from the post' ); ?></label>\n<br />\n<label for=\"default_ping_status\">\n<input name=\"default_ping_status\" type=\"checkbox\" id=\"default_ping_status\" value=\"open\" <?php checked( 'open', get_option( 'default_ping_status' ) ); ?> />\n<?php _e( 'Allow link notifications from other blogs (pingbacks and trackbacks) on new posts' ); ?></label>\n<br />\n<label for=\"default_comment_status\">\n<input name=\"default_comment_status\" type=\"checkbox\" id=\"default_comment_status\" value=\"open\" <?php checked( 'open', get_option( 'default_comment_status' ) ); ?> />\n<?php _e( 'Allow people to submit comments on new posts' ); ?></label>\n<br />\n<p class=\"description\"><?php echo '(' . __( 'These settings may be overridden for individual posts.' ) . ')'; ?></p>\n</fieldset></td>\n</tr>\n<tr>\n<th scope=\"row\"><?php _e( 'Other comment settings' ); ?></th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Other comment settings' ); ?></span></legend>\n<label for=\"require_name_email\"><input type=\"checkbox\" name=\"require_name_email\" id=\"require_name_email\" value=\"1\" <?php checked( '1', get_option( 'require_name_email' ) ); ?> /> <?php _e( 'Comment author must fill out name and email' ); ?></label>\n<br />\n<label for=\"comment_registration\">\n<input name=\"comment_registration\" type=\"checkbox\" id=\"comment_registration\" value=\"1\" <?php checked( '1', get_option( 'comment_registration' ) ); ?> />\n<?php _e( 'Users must be registered and logged in to comment' ); ?>\n<?php\nif ( ! get_option( 'users_can_register' ) && is_multisite() ) {\n\techo ' ' . __( '(Signup has been disabled. Only members of this site can comment.)' );}\n?>\n</label>\n<br />\n\n<label for=\"close_comments_for_old_posts\">\n<input name=\"close_comments_for_old_posts\" type=\"checkbox\" id=\"close_comments_for_old_posts\" value=\"1\" <?php checked( '1', get_option( 'close_comments_for_old_posts' ) ); ?> />\n<?php\nprintf(\n\t/* translators: %s: Number of days. */\n\t__( 'Automatically close comments on posts older than %s days' ),\n\t'</label> <label for=\"close_comments_days_old\"><input name=\"close_comments_days_old\" type=\"number\" min=\"0\" step=\"1\" id=\"close_comments_days_old\" value=\"' . esc_attr( get_option( 'close_comments_days_old' ) ) . '\" class=\"small-text\" />'\n);\n?>\n</label>\n<br />\n\n<label for=\"show_comments_cookies_opt_in\">\n<input name=\"show_comments_cookies_opt_in\" type=\"checkbox\" id=\"show_comments_cookies_opt_in\" value=\"1\" <?php checked( '1', get_option( 'show_comments_cookies_opt_in' ) ); ?> />\n<?php _e( 'Show comments cookies opt-in checkbox, allowing comment author cookies to be set' ); ?>\n</label>\n<br />\n\n<label for=\"thread_comments\">\n<input name=\"thread_comments\" type=\"checkbox\" id=\"thread_comments\" value=\"1\" <?php checked( '1', get_option( 'thread_comments' ) ); ?> />\n<?php\n/**\n * Filters the maximum depth of threaded/nested comments.\n *\n * @since 2.7.0\n *\n * @param int $max_depth The maximum depth of threaded comments. Default 10.\n */\n$maxdeep = (int) apply_filters( 'thread_comments_depth_max', 10 );\n\n$thread_comments_depth = '</label> <label for=\"thread_comments_depth\"><select name=\"thread_comments_depth\" id=\"thread_comments_depth\">';\nfor ( $i = 2; $i <= $maxdeep; $i++ ) {\n\t$thread_comments_depth .= \"<option value='\" . esc_attr( $i ) . \"'\";\n\tif ( get_option( 'thread_comments_depth' ) == $i ) {\n\t\t$thread_comments_depth .= \" selected='selected'\";\n\t}\n\t$thread_comments_depth .= \">$i</option>\";\n}\n$thread_comments_depth .= '</select>';\n\n/* translators: %s: Number of levels. */\nprintf( __( 'Enable threaded (nested) comments %s levels deep' ), $thread_comments_depth );\n\n?>\n</label>\n<br />\n<label for=\"page_comments\">\n<input name=\"page_comments\" type=\"checkbox\" id=\"page_comments\" value=\"1\" <?php checked( '1', get_option( 'page_comments' ) ); ?> />\n<?php\n$default_comments_page = '</label> <label for=\"default_comments_page\"><select name=\"default_comments_page\" id=\"default_comments_page\"><option value=\"newest\"';\nif ( 'newest' === get_option( 'default_comments_page' ) ) {\n\t$default_comments_page .= ' selected=\"selected\"';\n}\n$default_comments_page .= '>' . __( 'last' ) . '</option><option value=\"oldest\"';\nif ( 'oldest' === get_option( 'default_comments_page' ) ) {\n\t$default_comments_page .= ' selected=\"selected\"';\n}\n$default_comments_page .= '>' . __( 'first' ) . '</option></select>';\nprintf(\n\t/* translators: 1: Form field control for number of top level comments per page, 2: Form field control for the 'first' or 'last' page. */\n\t__( 'Break comments into pages with %1$s top level comments per page and the %2$s page displayed by default' ),\n\t'</label> <label for=\"comments_per_page\"><input name=\"comments_per_page\" type=\"number\" step=\"1\" min=\"0\" id=\"comments_per_page\" value=\"' . esc_attr( get_option( 'comments_per_page' ) ) . '\" class=\"small-text\" />',\n\t$default_comments_page\n);\n?>\n</label>\n<br />\n<label for=\"comment_order\">\n<?php\n\n$comment_order = '<select name=\"comment_order\" id=\"comment_order\"><option value=\"asc\"';\nif ( 'asc' === get_option( 'comment_order' ) ) {\n\t$comment_order .= ' selected=\"selected\"';\n}\n$comment_order .= '>' . __( 'older' ) . '</option><option value=\"desc\"';\nif ( 'desc' === get_option( 'comment_order' ) ) {\n\t$comment_order .= ' selected=\"selected\"';\n}\n$comment_order .= '>' . __( 'newer' ) . '</option></select>';\n\n/* translators: %s: Form field control for 'older' or 'newer' comments. */\nprintf( __( 'Comments should be displayed with the %s comments at the top of each page' ), $comment_order );\n\n?>\n</label>\n</fieldset></td>\n</tr>\n<tr>\n<th scope=\"row\"><?php _e( 'Email me whenever' ); ?></th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Email me whenever' ); ?></span></legend>\n<label for=\"comments_notify\">\n<input name=\"comments_notify\" type=\"checkbox\" id=\"comments_notify\" value=\"1\" <?php checked( '1', get_option( 'comments_notify' ) ); ?> />\n<?php _e( 'Anyone posts a comment' ); ?> </label>\n<br />\n<label for=\"moderation_notify\">\n<input name=\"moderation_notify\" type=\"checkbox\" id=\"moderation_notify\" value=\"1\" <?php checked( '1', get_option( 'moderation_notify' ) ); ?> />\n<?php _e( 'A comment is held for moderation' ); ?> </label>\n</fieldset></td>\n</tr>\n<tr>\n<th scope=\"row\"><?php _e( 'Before a comment appears' ); ?></th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Before a comment appears' ); ?></span></legend>\n<label for=\"comment_moderation\">\n<input name=\"comment_moderation\" type=\"checkbox\" id=\"comment_moderation\" value=\"1\" <?php checked( '1', get_option( 'comment_moderation' ) ); ?> />\n<?php _e( 'Comment must be manually approved' ); ?> </label>\n<br />\n<label for=\"comment_previously_approved\"><input type=\"checkbox\" name=\"comment_previously_approved\" id=\"comment_previously_approved\" value=\"1\" <?php checked( '1', get_option( 'comment_previously_approved' ) ); ?> /> <?php _e( 'Comment author must have a previously approved comment' ); ?></label>\n</fieldset></td>\n</tr>\n<tr>\n<th scope=\"row\"><?php _e( 'Comment Moderation' ); ?></th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Comment Moderation' ); ?></span></legend>\n<p><label for=\"comment_max_links\">\n<?php\nprintf(\n\t/* translators: %s: Number of links. */\n\t__( 'Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)' ),\n\t'<input name=\"comment_max_links\" type=\"number\" step=\"1\" min=\"0\" id=\"comment_max_links\" value=\"' . esc_attr( get_option( 'comment_max_links' ) ) . '\" class=\"small-text\" />'\n);\n?>\n</label></p>\n\n<p><label for=\"moderation_keys\"><?php _e( 'When a comment contains any of these words in its content, author name, URL, email, IP address, or browser&#8217;s user agent string, it will be held in the <a href=\"edit-comments.php?comment_status=moderated\">moderation queue</a>. One word or IP address per line. It will match inside words, so &#8220;press&#8221; will match &#8220;WordPress&#8221;.' ); ?></label></p>\n<p>\n<textarea name=\"moderation_keys\" rows=\"10\" cols=\"50\" id=\"moderation_keys\" class=\"large-text code\"><?php echo esc_textarea( get_option( 'moderation_keys' ) ); ?></textarea>\n</p>\n</fieldset></td>\n</tr>\n<tr>\n<th scope=\"row\"><?php _e( 'Disallowed Comment Keys' ); ?></th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Disallowed Comment Keys' ); ?></span></legend>\n<p><label for=\"disallowed_keys\"><?php _e( 'When a comment contains any of these words in its content, author name, URL, email, IP address, or browser&#8217;s user agent string, it will be put in the Trash. One word or IP address per line. It will match inside words, so &#8220;press&#8221; will match &#8220;WordPress&#8221;.' ); ?></label></p>\n<p>\n<textarea name=\"disallowed_keys\" rows=\"10\" cols=\"50\" id=\"disallowed_keys\" class=\"large-text code\"><?php echo esc_textarea( get_option( 'disallowed_keys' ) ); ?></textarea>\n</p>\n</fieldset></td>\n</tr>\n<?php do_settings_fields( 'discussion', 'default' ); ?>\n</table>\n\n<h2 class=\"title\"><?php _e( 'Avatars' ); ?></h2>\n\n<p><?php _e( 'An avatar is an image that follows you from weblog to weblog appearing beside your name when you comment on avatar enabled sites. Here you can enable the display of avatars for people who comment on your site.' ); ?></p>\n\n<?php\n// The above would be a good place to link to the documentation on the Gravatar functions, for putting it in themes. Anything like that?\n\n$show_avatars       = get_option( 'show_avatars' );\n$show_avatars_class = '';\nif ( ! $show_avatars ) {\n\t$show_avatars_class = ' hide-if-js';\n}\n?>\n\n<table class=\"form-table\" role=\"presentation\">\n<tr>\n<th scope=\"row\"><?php _e( 'Avatar Display' ); ?></th>\n<td>\n\t<label for=\"show_avatars\">\n\t\t<input type=\"checkbox\" id=\"show_avatars\" name=\"show_avatars\" value=\"1\" <?php checked( $show_avatars, 1 ); ?> />\n\t\t<?php _e( 'Show Avatars' ); ?>\n\t</label>\n</td>\n</tr>\n<tr class=\"avatar-settings<?php echo $show_avatars_class; ?>\">\n<th scope=\"row\"><?php _e( 'Maximum Rating' ); ?></th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Maximum Rating' ); ?></span></legend>\n\n<?php\n$ratings = array(\n\t/* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */\n\t'G'  => __( 'G &#8212; Suitable for all audiences' ),\n\t/* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */\n\t'PG' => __( 'PG &#8212; Possibly offensive, usually for audiences 13 and above' ),\n\t/* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */\n\t'R'  => __( 'R &#8212; Intended for adult audiences above 17' ),\n\t/* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */\n\t'X'  => __( 'X &#8212; Even more mature than above' ),\n);\nforeach ( $ratings as $key => $rating ) :\n\t$selected = ( get_option( 'avatar_rating' ) == $key ) ? 'checked=\"checked\"' : '';\n\techo \"\\n\\t<label><input type='radio' name='avatar_rating' value='\" . esc_attr( $key ) . \"' $selected/> $rating</label><br />\";\nendforeach;\n?>\n\n</fieldset></td>\n</tr>\n<tr class=\"avatar-settings<?php echo $show_avatars_class; ?>\">\n<th scope=\"row\"><?php _e( 'Default Avatar' ); ?></th>\n<td class=\"defaultavatarpicker\"><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Default Avatar' ); ?></span></legend>\n\n<p>\n<?php _e( 'For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their email address.' ); ?><br />\n</p>\n\n<?php\n$avatar_defaults = array(\n\t'mystery'          => __( 'Mystery Person' ),\n\t'blank'            => __( 'Blank' ),\n\t'gravatar_default' => __( 'Gravatar Logo' ),\n\t'identicon'        => __( 'Identicon (Generated)' ),\n\t'wavatar'          => __( 'Wavatar (Generated)' ),\n\t'monsterid'        => __( 'MonsterID (Generated)' ),\n\t'retro'            => __( 'Retro (Generated)' ),\n);\n/**\n * Filters the default avatars.\n *\n * Avatars are stored in key/value pairs, where the key is option value,\n * and the name is the displayed avatar name.\n *\n * @since 2.6.0\n *\n * @param string[] $avatar_defaults Associative array of default avatars.\n */\n$avatar_defaults = apply_filters( 'avatar_defaults', $avatar_defaults );\n$default         = get_option( 'avatar_default', 'mystery' );\n$avatar_list     = '';\n\n// Force avatars on to display these choices.\nadd_filter( 'pre_option_show_avatars', '__return_true', 100 );\n\nforeach ( $avatar_defaults as $default_key => $default_name ) {\n\t$selected     = ( $default == $default_key ) ? 'checked=\"checked\" ' : '';\n\t$avatar_list .= \"\\n\\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='\" . esc_attr( $default_key ) . \"' {$selected}/> \";\n\t$avatar_list .= get_avatar( $user_email, 32, $default_key, '', array( 'force_default' => true ) );\n\t$avatar_list .= ' ' . $default_name . '</label>';\n\t$avatar_list .= '<br />';\n}\n\nremove_filter( 'pre_option_show_avatars', '__return_true', 100 );\n\n/**\n * Filters the HTML output of the default avatar list.\n *\n * @since 2.6.0\n *\n * @param string $avatar_list HTML markup of the avatar list.\n */\necho apply_filters( 'default_avatar_select', $avatar_list );\n?>\n\n</fieldset></td>\n</tr>\n<?php do_settings_fields( 'discussion', 'avatars' ); ?>\n</table>\n\n<?php do_settings_sections( 'discussion' ); ?>\n\n<?php submit_button(); ?>\n</form>\n</div>\n\n<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 332}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * General settings administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n/** WordPress Translation Installation API */\nrequire_once ABSPATH . 'wp-admin/includes/translation-install.php';\n\nif ( ! current_user_can( 'manage_options' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );\n}\n\n$title       = __( 'General Settings' );\n$parent_file = 'options-general.php';\n/* translators: Date and time format for exact current time, mainly about timezones, see https://www.php.net/date */\n$timezone_format = _x( 'Y-m-d H:i:s', 'timezone date format' );\n\nadd_action( 'admin_head', 'options_general_add_js' );\n\n$options_help = '<p>' . __( 'The fields on this screen determine some of the basics of your site setup.' ) . '</p>' .\n\t'<p>' . __( 'Most themes display the site title at the top of every page, in the title bar of the browser, and as the identifying name for syndicated feeds. The tagline is also displayed by many themes.' ) . '</p>';\n\nif ( ! is_multisite() ) {\n\t$options_help .= '<p>' . __( 'The WordPress URL and the Site URL can be the same (example.com) or different; for example, having the WordPress core files (example.com/wordpress) in a subdirectory instead of the root directory.' ) . '</p>' .\n\t\t'<p>' . __( 'If you want site visitors to be able to register themselves, as opposed to by the site administrator, check the membership box. A default user role can be set for all new users, whether self-registered or registered by the site admin.' ) . '</p>';\n}\n\n$options_help .= '<p>' . __( 'You can set the language, and the translation files will be automatically downloaded and installed (available if your filesystem is writable).' ) . '</p>' .\n\t'<p>' . __( 'UTC means Coordinated Universal Time.' ) . '</p>' .\n\t'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' => $options_help,\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/settings-general-screen/\">Documentation on General Settings</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n\n<div class=\"wrap\">\n<h1><?php echo esc_html( $title ); ?></h1>\n\n<form method=\"post\" action=\"options.php\" novalidate=\"novalidate\">\n<?php settings_fields( 'general' ); ?>\n\n<table class=\"form-table\" role=\"presentation\">\n\n<tr>\n<th scope=\"row\"><label for=\"blogname\"><?php _e( 'Site Title' ); ?></label></th>\n<td><input name=\"blogname\" type=\"text\" id=\"blogname\" value=\"<?php form_option( 'blogname' ); ?>\" class=\"regular-text\" /></td>\n</tr>\n\n<tr>\n<th scope=\"row\"><label for=\"blogdescription\"><?php _e( 'Tagline' ); ?></label></th>\n<td><input name=\"blogdescription\" type=\"text\" id=\"blogdescription\" aria-describedby=\"tagline-description\" value=\"<?php form_option( 'blogdescription' ); ?>\" class=\"regular-text\" />\n<p class=\"description\" id=\"tagline-description\"><?php _e( 'In a few words, explain what this site is about.' ); ?></p></td>\n</tr>\n\n<?php\nif ( ! is_multisite() ) {\n\t$wp_site_url_class = '';\n\t$wp_home_class     = '';\n\tif ( defined( 'WP_SITEURL' ) ) {\n\t\t$wp_site_url_class = ' disabled';\n\t}\n\tif ( defined( 'WP_HOME' ) ) {\n\t\t$wp_home_class = ' disabled';\n\t}\n\t?>\n\n<tr>\n<th scope=\"row\"><label for=\"siteurl\"><?php _e( 'WordPress Address (URL)' ); ?></label></th>\n<td><input name=\"siteurl\" type=\"url\" id=\"siteurl\" value=\"<?php form_option( 'siteurl' ); ?>\"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class=\"regular-text code<?php echo $wp_site_url_class; ?>\" /></td>\n</tr>\n\n<tr>\n<th scope=\"row\"><label for=\"home\"><?php _e( 'Site Address (URL)' ); ?></label></th>\n<td><input name=\"home\" type=\"url\" id=\"home\" aria-describedby=\"home-description\" value=\"<?php form_option( 'home' ); ?>\"<?php disabled( defined( 'WP_HOME' ) ); ?> class=\"regular-text code<?php echo $wp_home_class; ?>\" />\n\t<?php if ( ! defined( 'WP_HOME' ) ) : ?>\n<p class=\"description\" id=\"home-description\">\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: Documentation URL. */\n\t\t\t__( 'Enter the address here if you <a href=\"%s\">want your site home page to be different from your WordPress installation directory</a>.' ),\n\t\t\t__( 'https://wordpress.org/support/article/giving-wordpress-its-own-directory/' )\n\t\t);\n\t\t?>\n</p>\n<?php endif; ?>\n</td>\n</tr>\n\n<?php } ?>\n\n<tr>\n<th scope=\"row\"><label for=\"new_admin_email\"><?php _e( 'Administration Email Address' ); ?></label></th>\n<td><input name=\"new_admin_email\" type=\"email\" id=\"new_admin_email\" aria-describedby=\"new-admin-email-description\" value=\"<?php form_option( 'admin_email' ); ?>\" class=\"regular-text ltr\" />\n<p class=\"description\" id=\"new-admin-email-description\"><?php _e( 'This address is used for admin purposes. If you change this, we will send you an email at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?></p>\n<?php\n$new_admin_email = get_option( 'new_admin_email' );\nif ( $new_admin_email && get_option( 'admin_email' ) !== $new_admin_email ) :\n\t?>\n\t<div class=\"updated inline\">\n\t<p>\n\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: New admin email. */\n\t\t\t__( 'There is a pending change of the admin email to %s.' ),\n\t\t\t'<code>' . esc_html( $new_admin_email ) . '</code>'\n\t\t);\n\t\tprintf(\n\t\t\t' <a href=\"%1$s\">%2$s</a>',\n\t\t\tesc_url( wp_nonce_url( admin_url( 'options.php?dismiss=new_admin_email' ), 'dismiss-' . get_current_blog_id() . '-new_admin_email' ) ),\n\t\t\t__( 'Cancel' )\n\t\t);\n\t?>\n\t</p>\n\t</div>\n<?php endif; ?>\n</td>\n</tr>\n\n<?php if ( ! is_multisite() ) { ?>\n\n<tr>\n<th scope=\"row\"><?php _e( 'Membership' ); ?></th>\n<td> <fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Membership' ); ?></span></legend><label for=\"users_can_register\">\n<input name=\"users_can_register\" type=\"checkbox\" id=\"users_can_register\" value=\"1\" <?php checked( '1', get_option( 'users_can_register' ) ); ?> />\n\t<?php _e( 'Anyone can register' ); ?></label>\n</fieldset></td>\n</tr>\n\n<tr>\n<th scope=\"row\"><label for=\"default_role\"><?php _e( 'New User Default Role' ); ?></label></th>\n<td>\n<select name=\"default_role\" id=\"default_role\"><?php wp_dropdown_roles( get_option( 'default_role' ) ); ?></select>\n</td>\n</tr>\n\n\t<?php\n}\n\n$languages    = get_available_languages();\n$translations = wp_get_available_translations();\nif ( ! is_multisite() && defined( 'WPLANG' ) && '' !== WPLANG && 'en_US' !== WPLANG && ! in_array( WPLANG, $languages, true ) ) {\n\t$languages[] = WPLANG;\n}\nif ( ! empty( $languages ) || ! empty( $translations ) ) {\n\t?>\n\t<tr>\n\t\t<th scope=\"row\"><label for=\"WPLANG\"><?php _e( 'Site Language' ); ?><span class=\"dashicons dashicons-translation\" aria-hidden=\"true\"></span></label></th>\n\t\t<td>\n\t\t\t<?php\n\t\t\t$locale = get_locale();\n\t\t\tif ( ! in_array( $locale, $languages, true ) ) {\n\t\t\t\t$locale = '';\n\t\t\t}\n\n\t\t\twp_dropdown_languages(\n\t\t\t\tarray(\n\t\t\t\t\t'name'                        => 'WPLANG',\n\t\t\t\t\t'id'                          => 'WPLANG',\n\t\t\t\t\t'selected'                    => $locale,\n\t\t\t\t\t'languages'                   => $languages,\n\t\t\t\t\t'translations'                => $translations,\n\t\t\t\t\t'show_available_translations' => current_user_can( 'install_languages' ) && wp_can_install_language_pack(),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Add note about deprecated WPLANG constant.\n\t\t\tif ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && WPLANG !== $locale ) {\n\t\t\t\t_deprecated_argument(\n\t\t\t\t\t'define()',\n\t\t\t\t\t'4.0.0',\n\t\t\t\t\t/* translators: 1: WPLANG, 2: wp-config.php */\n\t\t\t\t\tsprintf( __( 'The %1$s constant in your %2$s file is no longer needed.' ), 'WPLANG', 'wp-config.php' )\n\t\t\t\t);\n\t\t\t}\n\t\t\t?>\n\t\t</td>\n\t</tr>\n\t<?php\n}\n?>\n<tr>\n<?php\n$current_offset = get_option( 'gmt_offset' );\n$tzstring       = get_option( 'timezone_string' );\n\n$check_zone_info = true;\n\n// Remove old Etc mappings. Fallback to gmt_offset.\nif ( false !== strpos( $tzstring, 'Etc/GMT' ) ) {\n\t$tzstring = '';\n}\n\nif ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists.\n\t$check_zone_info = false;\n\tif ( 0 == $current_offset ) {\n\t\t$tzstring = 'UTC+0';\n\t} elseif ( $current_offset < 0 ) {\n\t\t$tzstring = 'UTC' . $current_offset;\n\t} else {\n\t\t$tzstring = 'UTC+' . $current_offset;\n\t}\n}\n\n?>\n<th scope=\"row\"><label for=\"timezone_string\"><?php _e( 'Timezone' ); ?></label></th>\n<td>\n\n<select id=\"timezone_string\" name=\"timezone_string\" aria-describedby=\"timezone-description\">\n\t<?php echo wp_timezone_choice( $tzstring, get_user_locale() ); ?>\n</select>\n\n<p class=\"description\" id=\"timezone-description\">\n<?php\n\tprintf(\n\t\t/* translators: %s: UTC abbreviation */\n\t\t__( 'Choose either a city in the same timezone as you or a %s (Coordinated Universal Time) time offset.' ),\n\t\t'<abbr>UTC</abbr>'\n\t);\n\t?>\n</p>\n\n<p class=\"timezone-info\">\n\t<span id=\"utc-time\">\n\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: UTC time. */\n\t\t\t__( 'Universal time is %s.' ),\n\t\t\t'<code>' . date_i18n( $timezone_format, false, true ) . '</code>'\n\t\t);\n\t\t?>\n\t</span>\n<?php if ( get_option( 'timezone_string' ) || ! empty( $current_offset ) ) : ?>\n\t<span id=\"local-time\">\n\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: Local time. */\n\t\t\t__( 'Local time is %s.' ),\n\t\t\t'<code>' . date_i18n( $timezone_format ) . '</code>'\n\t\t);\n\t?>\n\t</span>\n<?php endif; ?>\n</p>\n\n<?php if ( $check_zone_info && $tzstring ) : ?>\n<p class=\"timezone-info\">\n<span>\n\t<?php\n\t$now = new DateTime( 'now', new DateTimeZone( $tzstring ) );\n\t$dst = (bool) $now->format( 'I' );\n\n\tif ( $dst ) {\n\t\t_e( 'This timezone is currently in daylight saving time.' );\n\t} else {\n\t\t_e( 'This timezone is currently in standard time.' );\n\t}\n\t?>\n\t<br />\n\t<?php\n\tif ( in_array( $tzstring, timezone_identifiers_list(), true ) ) {\n\t\t$transitions = timezone_transitions_get( timezone_open( $tzstring ), time() );\n\n\t\t// 0 index is the state at current time, 1 index is the next transition, if any.\n\t\tif ( ! empty( $transitions[1] ) ) {\n\t\t\techo ' ';\n\t\t\t$message = $transitions[1]['isdst'] ?\n\t\t\t\t/* translators: %s: Date and time. */\n\t\t\t\t__( 'Daylight saving time begins on: %s.' ) :\n\t\t\t\t/* translators: %s: Date and time. */\n\t\t\t\t__( 'Standard time begins on: %s.' );\n\t\t\tprintf(\n\t\t\t\t$message,\n\t\t\t\t'<code>' . wp_date( __( 'F j, Y' ) . ' ' . __( 'g:i a' ), $transitions[1]['ts'] ) . '</code>'\n\t\t\t);\n\t\t} else {\n\t\t\t_e( 'This timezone does not observe daylight saving time.' );\n\t\t}\n\t}\n\t?>\n\t</span>\n</p>\n<?php endif; ?>\n</td>\n\n</tr>\n<tr>\n<th scope=\"row\"><?php _e( 'Date Format' ); ?></th>\n<td>\n\t<fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Date Format' ); ?></span></legend>\n<?php\n\t/**\n\t * Filters the default date formats.\n\t *\n\t * @since 2.7.0\n\t * @since 4.0.0 Added ISO date standard YYYY-MM-DD format.\n\t *\n\t * @param string[] $default_date_formats Array of default date formats.\n\t */\n\t$date_formats = array_unique( apply_filters( 'date_formats', array( __( 'F j, Y' ), 'Y-m-d', 'm/d/Y', 'd/m/Y' ) ) );\n\n\t$custom = true;\n\nforeach ( $date_formats as $format ) {\n\techo \"\\t<label><input type='radio' name='date_format' value='\" . esc_attr( $format ) . \"'\";\n\tif ( get_option( 'date_format' ) === $format ) { // checked() uses \"==\" rather than \"===\".\n\t\techo \" checked='checked'\";\n\t\t$custom = false;\n\t}\n\techo ' /> <span class=\"date-time-text format-i18n\">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . \"</code></label><br />\\n\";\n}\n\n\techo '<label><input type=\"radio\" name=\"date_format\" id=\"date_format_custom_radio\" value=\"\\c\\u\\s\\t\\o\\m\"';\n\tchecked( $custom );\n\techo '/> <span class=\"date-time-text date-time-custom-text\">' . __( 'Custom:' ) . '<span class=\"screen-reader-text\"> ' . __( 'enter a custom date format in the following field' ) . '</span></span></label>' .\n\t\t'<label for=\"date_format_custom\" class=\"screen-reader-text\">' . __( 'Custom date format:' ) . '</label>' .\n\t\t'<input type=\"text\" name=\"date_format_custom\" id=\"date_format_custom\" value=\"' . esc_attr( get_option( 'date_format' ) ) . '\" class=\"small-text\" />' .\n\t\t'<br />' .\n\t\t'<p><strong>' . __( 'Preview:' ) . '</strong> <span class=\"example\">' . date_i18n( get_option( 'date_format' ) ) . '</span>' .\n\t\t\"<span class='spinner'></span>\\n\" . '</p>';\n?>\n\t</fieldset>\n</td>\n</tr>\n<tr>\n<th scope=\"row\"><?php _e( 'Time Format' ); ?></th>\n<td>\n\t<fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Time Format' ); ?></span></legend>\n<?php\n\t/**\n\t * Filters the default time formats.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string[] $default_time_formats Array of default time formats.\n\t */\n\t$time_formats = array_unique( apply_filters( 'time_formats', array( __( 'g:i a' ), 'g:i A', 'H:i' ) ) );\n\n\t$custom = true;\n\nforeach ( $time_formats as $format ) {\n\techo \"\\t<label><input type='radio' name='time_format' value='\" . esc_attr( $format ) . \"'\";\n\tif ( get_option( 'time_format' ) === $format ) { // checked() uses \"==\" rather than \"===\".\n\t\techo \" checked='checked'\";\n\t\t$custom = false;\n\t}\n\techo ' /> <span class=\"date-time-text format-i18n\">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . \"</code></label><br />\\n\";\n}\n\n\techo '<label><input type=\"radio\" name=\"time_format\" id=\"time_format_custom_radio\" value=\"\\c\\u\\s\\t\\o\\m\"';\n\tchecked( $custom );\n\techo '/> <span class=\"date-time-text date-time-custom-text\">' . __( 'Custom:' ) . '<span class=\"screen-reader-text\"> ' . __( 'enter a custom time format in the following field' ) . '</span></span></label>' .\n\t\t'<label for=\"time_format_custom\" class=\"screen-reader-text\">' . __( 'Custom time format:' ) . '</label>' .\n\t\t'<input type=\"text\" name=\"time_format_custom\" id=\"time_format_custom\" value=\"' . esc_attr( get_option( 'time_format' ) ) . '\" class=\"small-text\" />' .\n\t\t'<br />' .\n\t\t'<p><strong>' . __( 'Preview:' ) . '</strong> <span class=\"example\">' . date_i18n( get_option( 'time_format' ) ) . '</span>' .\n\t\t\"<span class='spinner'></span>\\n\" . '</p>';\n\n\techo \"\\t<p class='date-time-doc'>\" . __( '<a href=\"https://wordpress.org/support/article/formatting-date-and-time/\">Documentation on date and time formatting</a>.' ) . \"</p>\\n\";\n?>\n\t</fieldset>\n</td>\n</tr>\n<tr>\n<th scope=\"row\"><label for=\"start_of_week\"><?php _e( 'Week Starts On' ); ?></label></th>\n<td><select name=\"start_of_week\" id=\"start_of_week\">\n<?php\n/**\n * @global WP_Locale $wp_locale WordPress date and time locale object.\n */\nglobal $wp_locale;\n\nfor ( $day_index = 0; $day_index <= 6; $day_index++ ) :\n\t$selected = ( get_option( 'start_of_week' ) == $day_index ) ? 'selected=\"selected\"' : '';\n\techo \"\\n\\t<option value='\" . esc_attr( $day_index ) . \"' $selected>\" . $wp_locale->get_weekday( $day_index ) . '</option>';\nendfor;\n?>\n</select></td>\n</tr>\n<?php do_settings_fields( 'general', 'default' ); ?>\n</table>\n\n<?php do_settings_sections( 'general' ); ?>\n\n<?php submit_button(); ?>\n</form>\n\n</div>\n\n<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 409}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Options Header.\n *\n * Displays updated message, if updated variable is part of the URL query.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\nwp_reset_vars( array( 'action' ) );\n\nif ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) {\n\t// For back-compat with plugins that don't use the Settings API and just set updated=1 in the redirect.\n\tadd_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'success' );\n}\n\nsettings_errors();\n", "num_lines": 19}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Media settings administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'manage_options' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );\n}\n\n$title       = __( 'Media Settings' );\n$parent_file = 'options-general.php';\n\n$media_options_help = '<p>' . __( 'You can set maximum sizes for images inserted into your written content; you can also insert an image as Full Size.' ) . '</p>';\n\nif ( ! is_multisite() && ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) ) {\n\t$media_options_help .= '<p>' . __( 'Uploading Files allows you to choose the folder and path for storing your uploaded files.' ) . '</p>';\n}\n\n$media_options_help .= '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' => $media_options_help,\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/settings-media-screen/\">Documentation on Media Settings</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n?>\n\n<div class=\"wrap\">\n<h1><?php echo esc_html( $title ); ?></h1>\n\n<form action=\"options.php\" method=\"post\">\n<?php settings_fields( 'media' ); ?>\n\n<h2 class=\"title\"><?php _e( 'Image sizes' ); ?></h2>\n<p><?php _e( 'The sizes listed below determine the maximum dimensions in pixels to use when adding an image to the Media Library.' ); ?></p>\n\n<table class=\"form-table\" role=\"presentation\">\n<tr>\n<th scope=\"row\"><?php _e( 'Thumbnail size' ); ?></th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Thumbnail size' ); ?></span></legend>\n<label for=\"thumbnail_size_w\"><?php _e( 'Width' ); ?></label>\n<input name=\"thumbnail_size_w\" type=\"number\" step=\"1\" min=\"0\" id=\"thumbnail_size_w\" value=\"<?php form_option( 'thumbnail_size_w' ); ?>\" class=\"small-text\" />\n<br />\n<label for=\"thumbnail_size_h\"><?php _e( 'Height' ); ?></label>\n<input name=\"thumbnail_size_h\" type=\"number\" step=\"1\" min=\"0\" id=\"thumbnail_size_h\" value=\"<?php form_option( 'thumbnail_size_h' ); ?>\" class=\"small-text\" />\n</fieldset>\n<input name=\"thumbnail_crop\" type=\"checkbox\" id=\"thumbnail_crop\" value=\"1\" <?php checked( '1', get_option( 'thumbnail_crop' ) ); ?>/>\n<label for=\"thumbnail_crop\"><?php _e( 'Crop thumbnail to exact dimensions (normally thumbnails are proportional)' ); ?></label>\n</td>\n</tr>\n\n<tr>\n<th scope=\"row\"><?php _e( 'Medium size' ); ?></th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Medium size' ); ?></span></legend>\n<label for=\"medium_size_w\"><?php _e( 'Max Width' ); ?></label>\n<input name=\"medium_size_w\" type=\"number\" step=\"1\" min=\"0\" id=\"medium_size_w\" value=\"<?php form_option( 'medium_size_w' ); ?>\" class=\"small-text\" />\n<br />\n<label for=\"medium_size_h\"><?php _e( 'Max Height' ); ?></label>\n<input name=\"medium_size_h\" type=\"number\" step=\"1\" min=\"0\" id=\"medium_size_h\" value=\"<?php form_option( 'medium_size_h' ); ?>\" class=\"small-text\" />\n</fieldset></td>\n</tr>\n\n<tr>\n<th scope=\"row\"><?php _e( 'Large size' ); ?></th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Large size' ); ?></span></legend>\n<label for=\"large_size_w\"><?php _e( 'Max Width' ); ?></label>\n<input name=\"large_size_w\" type=\"number\" step=\"1\" min=\"0\" id=\"large_size_w\" value=\"<?php form_option( 'large_size_w' ); ?>\" class=\"small-text\" />\n<br />\n<label for=\"large_size_h\"><?php _e( 'Max Height' ); ?></label>\n<input name=\"large_size_h\" type=\"number\" step=\"1\" min=\"0\" id=\"large_size_h\" value=\"<?php form_option( 'large_size_h' ); ?>\" class=\"small-text\" />\n</fieldset></td>\n</tr>\n\n<?php do_settings_fields( 'media', 'default' ); ?>\n</table>\n\n<?php\n/**\n * @global array $wp_settings\n */\nif ( isset( $GLOBALS['wp_settings']['media']['embeds'] ) ) :\n\t?>\n<h2 class=\"title\"><?php _e( 'Embeds' ); ?></h2>\n<table class=\"form-table\" role=\"presentation\">\n\t<?php do_settings_fields( 'media', 'embeds' ); ?>\n</table>\n<?php endif; ?>\n\n<?php if ( ! is_multisite() ) : ?>\n<h2 class=\"title\"><?php _e( 'Uploading Files' ); ?></h2>\n<table class=\"form-table\" role=\"presentation\">\n\t<?php\n\t/*\n\t * If upload_url_path is not the default (empty),\n\t * or upload_path is not the default ('wp-content/uploads' or empty),\n\t * they can be edited, otherwise they're locked.\n\t */\n\tif ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) :\n\t\t?>\n<tr>\n<th scope=\"row\"><label for=\"upload_path\"><?php _e( 'Store uploads in this folder' ); ?></label></th>\n<td><input name=\"upload_path\" type=\"text\" id=\"upload_path\" value=\"<?php echo esc_attr( get_option( 'upload_path' ) ); ?>\" class=\"regular-text code\" />\n<p class=\"description\">\n\t\t<?php\n\t\t/* translators: %s: wp-content/uploads */\n\t\tprintf( __( 'Default is %s' ), '<code>wp-content/uploads</code>' );\n\t\t?>\n</p>\n</td>\n</tr>\n\n<tr>\n<th scope=\"row\"><label for=\"upload_url_path\"><?php _e( 'Full URL path to files' ); ?></label></th>\n<td><input name=\"upload_url_path\" type=\"text\" id=\"upload_url_path\" value=\"<?php echo esc_attr( get_option( 'upload_url_path' ) ); ?>\" class=\"regular-text code\" />\n<p class=\"description\"><?php _e( 'Configuring this is optional. By default, it should be blank.' ); ?></p>\n</td>\n</tr>\n<tr>\n<td colspan=\"2\" class=\"td-full\">\n<?php else : ?>\n<tr>\n<td class=\"td-full\">\n<?php endif; ?>\n<label for=\"uploads_use_yearmonth_folders\">\n<input name=\"uploads_use_yearmonth_folders\" type=\"checkbox\" id=\"uploads_use_yearmonth_folders\" value=\"1\"<?php checked( '1', get_option( 'uploads_use_yearmonth_folders' ) ); ?> />\n\t<?php _e( 'Organize my uploads into month- and year-based folders' ); ?>\n</label>\n</td>\n</tr>\n\n\t<?php do_settings_fields( 'media', 'uploads' ); ?>\n</table>\n<?php endif; ?>\n\n<?php do_settings_sections( 'media' ); ?>\n\n<?php submit_button(); ?>\n\n</form>\n\n</div>\n\n<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 161}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Permalink Settings Administration Screen.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'manage_options' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );\n}\n\n$title       = __( 'Permalink Settings' );\n$parent_file = 'options-general.php';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' => '<p>' . __( 'Permalinks are the permanent URLs to your individual pages and blog posts, as well as your category and tag archives. A permalink is the web address used to link to your content. The URL to each post should be permanent, and never change &#8212; hence the name permalink.' ) . '</p>' .\n\t\t\t'<p>' . __( 'This screen allows you to choose your permalink structure. You can choose from common settings or create custom URL structures.' ) . '</p>' .\n\t\t\t'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'permalink-settings',\n\t\t'title'   => __( 'Permalink Settings' ),\n\t\t'content' => '<p>' . __( 'Permalinks can contain useful information, such as the post date, title, or other elements. You can choose from any of the suggested permalink formats, or you can craft your own if you select Custom Structure.' ) . '</p>' .\n\t\t\t'<p>' . sprintf(\n\t\t\t\t/* translators: %s: Percent sign (%). */\n\t\t\t\t__( 'If you pick an option other than Plain, your general URL path with structure tags (terms surrounded by %s) will also appear in the custom structure field and your path can be further modified there.' ),\n\t\t\t\t'<code>%</code>'\n\t\t\t) . '</p>' .\n\t\t\t'<p>' . sprintf(\n\t\t\t\t/* translators: 1: %category%, 2: %tag% */\n\t\t\t\t__( 'When you assign multiple categories or tags to a post, only one can show up in the permalink: the lowest numbered category. This applies if your custom structure includes %1$s or %2$s.' ),\n\t\t\t\t'<code>%category%</code>',\n\t\t\t\t'<code>%tag%</code>'\n\t\t\t) . '</p>' .\n\t\t\t'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'custom-structures',\n\t\t'title'   => __( 'Custom Structures' ),\n\t\t'content' => '<p>' . __( 'The Optional fields let you customize the &#8220;category&#8221; and &#8220;tag&#8221; base names that will appear in archive URLs. For example, the page listing all posts in the &#8220;Uncategorized&#8221; category could be <code>/topics/uncategorized</code> instead of <code>/category/uncategorized</code>.' ) . '</p>' .\n\t\t\t'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/settings-permalinks-screen/\">Documentation on Permalinks Settings</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/using-permalinks/\">Documentation on Using Permalinks</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\n$home_path           = get_home_path();\n$iis7_permalinks     = iis7_supports_permalinks();\n$permalink_structure = get_option( 'permalink_structure' );\n\n$prefix      = '';\n$blog_prefix = '';\nif ( ! got_url_rewrite() ) {\n\t$prefix = '/index.php';\n}\n\n/**\n * In a subdirectory configuration of multisite, the `/blog` prefix is used by\n * default on the main site to avoid collisions with other sites created on that\n * network. If the `permalink_structure` option has been changed to remove this\n * base prefix, WordPress core can no longer account for the possible collision.\n */\nif ( is_multisite() && ! is_subdomain_install() && is_main_site() && 0 === strpos( $permalink_structure, '/blog/' ) ) {\n\t$blog_prefix = '/blog';\n}\n\n$category_base   = get_option( 'category_base' );\n$tag_base        = get_option( 'tag_base' );\n$update_required = false;\n\nif ( $iis7_permalinks ) {\n\tif ( ( ! file_exists( $home_path . 'web.config' ) && win_is_writable( $home_path ) ) || win_is_writable( $home_path . 'web.config' ) ) {\n\t\t$writable = true;\n\t} else {\n\t\t$writable = false;\n\t}\n} elseif ( $is_nginx ) {\n\t$writable = false;\n} else {\n\tif ( ( ! file_exists( $home_path . '.htaccess' ) && is_writable( $home_path ) ) || is_writable( $home_path . '.htaccess' ) ) {\n\t\t$writable = true;\n\t} else {\n\t\t$writable        = false;\n\t\t$existing_rules  = array_filter( extract_from_markers( $home_path . '.htaccess', 'WordPress' ) );\n\t\t$new_rules       = array_filter( explode( \"\\n\", $wp_rewrite->mod_rewrite_rules() ) );\n\t\t$update_required = ( $new_rules !== $existing_rules );\n\t}\n}\n\n$using_index_permalinks = $wp_rewrite->using_index_permalinks();\n\nif ( isset( $_POST['permalink_structure'] ) || isset( $_POST['category_base'] ) ) {\n\tcheck_admin_referer( 'update-permalink' );\n\n\tif ( isset( $_POST['permalink_structure'] ) ) {\n\t\tif ( isset( $_POST['selection'] ) && 'custom' != $_POST['selection'] ) {\n\t\t\t$permalink_structure = $_POST['selection'];\n\t\t} else {\n\t\t\t$permalink_structure = $_POST['permalink_structure'];\n\t\t}\n\n\t\tif ( ! empty( $permalink_structure ) ) {\n\t\t\t$permalink_structure = preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $permalink_structure ) );\n\t\t\tif ( $prefix && $blog_prefix ) {\n\t\t\t\t$permalink_structure = $prefix . preg_replace( '#^/?index\\.php#', '', $permalink_structure );\n\t\t\t} else {\n\t\t\t\t$permalink_structure = $blog_prefix . $permalink_structure;\n\t\t\t}\n\t\t}\n\n\t\t$permalink_structure = sanitize_option( 'permalink_structure', $permalink_structure );\n\n\t\t$wp_rewrite->set_permalink_structure( $permalink_structure );\n\t}\n\n\tif ( isset( $_POST['category_base'] ) ) {\n\t\t$category_base = $_POST['category_base'];\n\t\tif ( ! empty( $category_base ) ) {\n\t\t\t$category_base = $blog_prefix . preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $category_base ) );\n\t\t}\n\t\t$wp_rewrite->set_category_base( $category_base );\n\t}\n\n\tif ( isset( $_POST['tag_base'] ) ) {\n\t\t$tag_base = $_POST['tag_base'];\n\t\tif ( ! empty( $tag_base ) ) {\n\t\t\t$tag_base = $blog_prefix . preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $tag_base ) );\n\t\t}\n\t\t$wp_rewrite->set_tag_base( $tag_base );\n\t}\n\n\t$message = __( 'Permalink structure updated.' );\n\n\tif ( $iis7_permalinks ) {\n\t\tif ( $permalink_structure && ! $using_index_permalinks && ! $writable ) {\n\t\t\t$message = sprintf(\n\t\t\t\t/* translators: %s: web.config */\n\t\t\t\t__( 'You should update your %s file now.' ),\n\t\t\t\t'<code>web.config</code>'\n\t\t\t);\n\t\t} elseif ( $permalink_structure && ! $using_index_permalinks && $writable ) {\n\t\t\t$message = sprintf(\n\t\t\t\t/* translators: %s: web.config */\n\t\t\t\t__( 'Permalink structure updated. Remove write access on %s file now!' ),\n\t\t\t\t'<code>web.config</code>'\n\t\t\t);\n\t\t}\n\t} elseif ( ! $is_nginx && $permalink_structure && ! $using_index_permalinks && ! $writable && $update_required ) {\n\t\t$message = sprintf(\n\t\t\t/* translators: %s: .htaccess */\n\t\t\t__( 'You should update your %s file now.' ),\n\t\t\t'<code>.htaccess</code>'\n\t\t);\n\t}\n\n\tif ( ! get_settings_errors() ) {\n\t\tadd_settings_error( 'general', 'settings_updated', $message, 'success' );\n\t}\n\n\tset_transient( 'settings_errors', get_settings_errors(), 30 );\n\n\twp_redirect( admin_url( 'options-permalink.php?settings-updated=true' ) );\n\texit;\n}\n\nflush_rewrite_rules();\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n<div class=\"wrap\">\n<h1><?php echo esc_html( $title ); ?></h1>\n\n<form name=\"form\" action=\"options-permalink.php\" method=\"post\">\n<?php wp_nonce_field( 'update-permalink' ); ?>\n\n\t<p>\n\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: Documentation URL. */\n\t\t\t__( 'WordPress offers you the ability to create a custom URL structure for your permalinks and archives. Custom URL structures can improve the aesthetics, usability, and forward-compatibility of your links. A <a href=\"%s\">number of tags are available</a>, and here are some examples to get you started.' ),\n\t\t\t__( 'https://wordpress.org/support/article/using-permalinks/' )\n\t\t);\n\t\t?>\n\t</p>\n\n<?php\nif ( is_multisite() && ! is_subdomain_install() && is_main_site() && 0 === strpos( $permalink_structure, '/blog/' ) ) {\n\t$permalink_structure = preg_replace( '|^/?blog|', '', $permalink_structure );\n\t$category_base       = preg_replace( '|^/?blog|', '', $category_base );\n\t$tag_base            = preg_replace( '|^/?blog|', '', $tag_base );\n}\n\n$structures = array(\n\t0 => '',\n\t1 => $prefix . '/%year%/%monthnum%/%day%/%postname%/',\n\t2 => $prefix . '/%year%/%monthnum%/%postname%/',\n\t3 => $prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/%post_id%',\n\t4 => $prefix . '/%postname%/',\n);\n?>\n<h2 class=\"title\"><?php _e( 'Common Settings' ); ?></h2>\n<table class=\"form-table permalink-structure\">\n\t<tr>\n\t\t<th scope=\"row\"><label><input name=\"selection\" type=\"radio\" value=\"\" <?php checked( '', $permalink_structure ); ?> /> <?php _e( 'Plain' ); ?></label></th>\n\t\t<td><code><?php echo get_option( 'home' ); ?>/?p=123</code></td>\n\t</tr>\n\t<tr>\n\t\t<th scope=\"row\"><label><input name=\"selection\" type=\"radio\" value=\"<?php echo esc_attr( $structures[1] ); ?>\" <?php checked( $structures[1], $permalink_structure ); ?> /> <?php _e( 'Day and name' ); ?></label></th>\n\t\t<td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . gmdate( 'Y' ) . '/' . gmdate( 'm' ) . '/' . gmdate( 'd' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>\n\t</tr>\n\t<tr>\n\t\t<th scope=\"row\"><label><input name=\"selection\" type=\"radio\" value=\"<?php echo esc_attr( $structures[2] ); ?>\" <?php checked( $structures[2], $permalink_structure ); ?> /> <?php _e( 'Month and name' ); ?></label></th>\n\t\t<td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . gmdate( 'Y' ) . '/' . gmdate( 'm' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>\n\t</tr>\n\t<tr>\n\t\t<th scope=\"row\"><label><input name=\"selection\" type=\"radio\" value=\"<?php echo esc_attr( $structures[3] ); ?>\" <?php checked( $structures[3], $permalink_structure ); ?> /> <?php _e( 'Numeric' ); ?></label></th>\n\t\t<td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/123'; ?></code></td>\n\t</tr>\n\t<tr>\n\t\t<th scope=\"row\"><label><input name=\"selection\" type=\"radio\" value=\"<?php echo esc_attr( $structures[4] ); ?>\" <?php checked( $structures[4], $permalink_structure ); ?> /> <?php _e( 'Post name' ); ?></label></th>\n\t\t<td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>\n\t</tr>\n\t<tr>\n\t\t<th scope=\"row\">\n\t\t\t<label><input name=\"selection\" id=\"custom_selection\" type=\"radio\" value=\"custom\" <?php checked( ! in_array( $permalink_structure, $structures, true ) ); ?> />\n\t\t\t<?php _e( 'Custom Structure' ); ?>\n\t\t\t</label>\n\t\t</th>\n\t\t<td>\n\t\t\t<code><?php echo get_option( 'home' ) . $blog_prefix; ?></code>\n\t\t\t<input name=\"permalink_structure\" id=\"permalink_structure\" type=\"text\" value=\"<?php echo esc_attr( $permalink_structure ); ?>\" class=\"regular-text code\" />\n\t\t\t<div class=\"available-structure-tags hide-if-no-js\">\n\t\t\t\t<div id=\"custom_selection_updated\" aria-live=\"assertive\" class=\"screen-reader-text\"></div>\n\t\t\t\t<?php\n\t\t\t\t$available_tags = array(\n\t\t\t\t\t/* translators: %s: Permalink structure tag. */\n\t\t\t\t\t'year'     => __( '%s (The year of the post, four digits, for example 2004.)' ),\n\t\t\t\t\t/* translators: %s: Permalink structure tag. */\n\t\t\t\t\t'monthnum' => __( '%s (Month of the year, for example 05.)' ),\n\t\t\t\t\t/* translators: %s: Permalink structure tag. */\n\t\t\t\t\t'day'      => __( '%s (Day of the month, for example 28.)' ),\n\t\t\t\t\t/* translators: %s: Permalink structure tag. */\n\t\t\t\t\t'hour'     => __( '%s (Hour of the day, for example 15.)' ),\n\t\t\t\t\t/* translators: %s: Permalink structure tag. */\n\t\t\t\t\t'minute'   => __( '%s (Minute of the hour, for example 43.)' ),\n\t\t\t\t\t/* translators: %s: Permalink structure tag. */\n\t\t\t\t\t'second'   => __( '%s (Second of the minute, for example 33.)' ),\n\t\t\t\t\t/* translators: %s: Permalink structure tag. */\n\t\t\t\t\t'post_id'  => __( '%s (The unique ID of the post, for example 423.)' ),\n\t\t\t\t\t/* translators: %s: Permalink structure tag. */\n\t\t\t\t\t'postname' => __( '%s (The sanitized post title (slug).)' ),\n\t\t\t\t\t/* translators: %s: Permalink structure tag. */\n\t\t\t\t\t'category' => __( '%s (Category slug. Nested sub-categories appear as nested directories in the URL.)' ),\n\t\t\t\t\t/* translators: %s: Permalink structure tag. */\n\t\t\t\t\t'author'   => __( '%s (A sanitized version of the author name.)' ),\n\t\t\t\t);\n\n\t\t\t\t/**\n\t\t\t\t * Filters the list of available permalink structure tags on the Permalinks settings page.\n\t\t\t\t *\n\t\t\t\t * @since 4.9.0\n\t\t\t\t *\n\t\t\t\t * @param string[] $available_tags An array of key => value pairs of available permalink structure tags.\n\t\t\t\t */\n\t\t\t\t$available_tags = apply_filters( 'available_permalink_structure_tags', $available_tags );\n\n\t\t\t\t/* translators: %s: Permalink structure tag. */\n\t\t\t\t$structure_tag_added = __( '%s added to permalink structure' );\n\n\t\t\t\t/* translators: %s: Permalink structure tag. */\n\t\t\t\t$structure_tag_already_used = __( '%s (already used in permalink structure)' );\n\n\t\t\t\tif ( ! empty( $available_tags ) ) :\n\t\t\t\t\t?>\n\t\t\t\t\t<p><?php _e( 'Available tags:' ); ?></p>\n\t\t\t\t\t<ul role=\"list\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tforeach ( $available_tags as $tag => $explanation ) {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<button type=\"button\"\n\t\t\t\t\t\t\t\t\t\tclass=\"button button-secondary\"\n\t\t\t\t\t\t\t\t\t\taria-label=\"<?php echo esc_attr( sprintf( $explanation, $tag ) ); ?>\"\n\t\t\t\t\t\t\t\t\t\tdata-added=\"<?php echo esc_attr( sprintf( $structure_tag_added, $tag ) ); ?>\"\n\t\t\t\t\t\t\t\t\t\tdata-used=\"<?php echo esc_attr( sprintf( $structure_tag_already_used, $tag ) ); ?>\">\n\t\t\t\t\t\t\t\t\t<?php echo '%' . $tag . '%'; ?>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t</ul>\n\t\t\t\t<?php endif; ?>\n\t\t\t</div>\n\t\t</td>\n\t</tr>\n</table>\n\n<h2 class=\"title\"><?php _e( 'Optional' ); ?></h2>\n<p>\n<?php\n/* translators: %s: Placeholder that must come at the start of the URL. */\nprintf( __( 'If you like, you may enter custom structures for your category and tag URLs here. For example, using <code>topics</code> as your category base would make your category links like <code>%s/topics/uncategorized/</code>. If you leave these blank the defaults will be used.' ), get_option( 'home' ) . $blog_prefix . $prefix );\n?>\n</p>\n\n<table class=\"form-table\" role=\"presentation\">\n\t<tr>\n\t\t<th><label for=\"category_base\"><?php /* translators: Prefix for category permalinks. */ _e( 'Category base' ); ?></label></th>\n\t\t<td><?php echo $blog_prefix; ?> <input name=\"category_base\" id=\"category_base\" type=\"text\" value=\"<?php echo esc_attr( $category_base ); ?>\" class=\"regular-text code\" /></td>\n\t</tr>\n\t<tr>\n\t\t<th><label for=\"tag_base\"><?php _e( 'Tag base' ); ?></label></th>\n\t\t<td><?php echo $blog_prefix; ?> <input name=\"tag_base\" id=\"tag_base\" type=\"text\" value=\"<?php echo esc_attr( $tag_base ); ?>\" class=\"regular-text code\" /></td>\n\t</tr>\n\t<?php do_settings_fields( 'permalink', 'optional' ); ?>\n</table>\n\n<?php do_settings_sections( 'permalink' ); ?>\n\n<?php submit_button(); ?>\n</form>\n<?php if ( ! is_multisite() ) { ?>\n\t<?php\n\tif ( $iis7_permalinks ) :\n\t\tif ( isset( $_POST['submit'] ) && $permalink_structure && ! $using_index_permalinks && ! $writable ) :\n\t\t\tif ( file_exists( $home_path . 'web.config' ) ) :\n\t\t\t\t?>\n<p>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: web.config, 2: Documentation URL, 3: CTRL + a, 4: Element code. */\n\t\t\t\t\t__( 'If your %1$s file was <a href=\"%2$s\">writable</a>, we could do this automatically, but it isn&#8217;t so this is the url rewrite rule you should have in your %1$s file. Click in the field and press %3$s to select all. Then insert this rule inside of the %4$s element in %1$s file.' ),\n\t\t\t\t\t'<code>web.config</code>',\n\t\t\t\t\t__( 'https://wordpress.org/support/article/changing-file-permissions/' ),\n\t\t\t\t\t'<kbd>CTRL + a</kbd>',\n\t\t\t\t\t'<code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code>'\n\t\t\t\t);\n\t\t\t\t?>\n</p>\n<form action=\"options-permalink.php\" method=\"post\">\n\t\t\t\t<?php wp_nonce_field( 'update-permalink' ); ?>\n\t<p><textarea rows=\"9\" class=\"large-text readonly\" name=\"rules\" id=\"rules\" readonly=\"readonly\"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules() ); ?></textarea></p>\n</form>\n<p>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: web.config */\n\t\t\t\t\t__( 'If you temporarily make your %s file writable for us to generate rewrite rules automatically, do not forget to revert the permissions after rule has been saved.' ),\n\t\t\t\t\t'<code>web.config</code>'\n\t\t\t\t);\n\t\t\t\t?>\n</p>\n\t\t<?php else : ?>\n<p>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: 1: Documentation URL, 2: web.config, 3: CTRL + a */\n\t\t\t\t__( 'If the root directory of your site was <a href=\"%1$s\">writable</a>, we could do this automatically, but it isn&#8217;t so this is the url rewrite rule you should have in your %2$s file. Create a new file, called %2$s in the root directory of your site. Click in the field and press %3$s to select all. Then insert this code into the %2$s file.' ),\n\t\t\t\t__( 'https://wordpress.org/support/article/changing-file-permissions/' ),\n\t\t\t\t'<code>web.config</code>',\n\t\t\t\t'<kbd>CTRL + a</kbd>'\n\t\t\t);\n\t\t\t?>\n</p>\n<form action=\"options-permalink.php\" method=\"post\">\n\t\t\t<?php wp_nonce_field( 'update-permalink' ); ?>\n\t<p><textarea rows=\"18\" class=\"large-text readonly\" name=\"rules\" id=\"rules\" readonly=\"readonly\"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules( true ) ); ?></textarea></p>\n</form>\n<p>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: web.config */\n\t\t\t\t__( 'If you temporarily make your site&#8217;s root directory writable for us to generate the %s file automatically, do not forget to revert the permissions after the file has been created.' ),\n\t\t\t\t'<code>web.config</code>'\n\t\t\t);\n\t\t\t?>\n</p>\n\t\t<?php endif; ?>\n\t<?php endif; ?>\n<?php elseif ( $is_nginx ) : ?>\n\t<p><?php _e( '<a href=\"https://wordpress.org/support/article/nginx/\">Documentation on Nginx configuration</a>.' ); ?></p>\n\t<?php\nelse :\n\tif ( $permalink_structure && ! $using_index_permalinks && ! $writable && $update_required ) :\n\t\t?>\n<p>\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: 1: .htaccess, 2: Documentation URL, 3: CTRL + a */\n\t\t\t__( 'If your %1$s file was <a href=\"%2$s\">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your %1$s file. Click in the field and press %3$s to select all.' ),\n\t\t\t'<code>.htaccess</code>',\n\t\t\t__( 'https://wordpress.org/support/article/changing-file-permissions/' ),\n\t\t\t'<kbd>CTRL + a</kbd>'\n\t\t);\n\t\t?>\n</p>\n<form action=\"options-permalink.php\" method=\"post\">\n\t\t<?php wp_nonce_field( 'update-permalink' ); ?>\n\t<p><textarea rows=\"6\" class=\"large-text readonly\" name=\"rules\" id=\"rules\" readonly=\"readonly\"><?php echo esc_textarea( $wp_rewrite->mod_rewrite_rules() ); ?></textarea></p>\n</form>\n\t<?php endif; ?>\n<?php endif; ?>\n<?php } // End if ! is_multisite(). ?>\n\n</div>\n\n<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 427}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Privacy Settings Screen.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'manage_privacy_options' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) );\n}\n\n$action = isset( $_POST['action'] ) ? $_POST['action'] : '';\n\nif ( ! empty( $action ) ) {\n\tcheck_admin_referer( $action );\n\n\tif ( 'set-privacy-page' === $action ) {\n\t\t$privacy_policy_page_id = isset( $_POST['page_for_privacy_policy'] ) ? (int) $_POST['page_for_privacy_policy'] : 0;\n\t\tupdate_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id );\n\n\t\t$privacy_page_updated_message = __( 'Privacy Policy page updated successfully.' );\n\n\t\tif ( $privacy_policy_page_id ) {\n\t\t\t/*\n\t\t\t * Don't always link to the menu customizer:\n\t\t\t *\n\t\t\t * - Unpublished pages can't be selected by default.\n\t\t\t * - `WP_Customize_Nav_Menus::__construct()` checks the user's capabilities.\n\t\t\t * - Themes might not \"officially\" support menus.\n\t\t\t */\n\t\t\tif (\n\t\t\t\t'publish' === get_post_status( $privacy_policy_page_id )\n\t\t\t\t&& current_user_can( 'edit_theme_options' )\n\t\t\t\t&& current_theme_supports( 'menus' )\n\t\t\t) {\n\t\t\t\t$privacy_page_updated_message = sprintf(\n\t\t\t\t\t/* translators: %s: URL to Customizer -> Menus. */\n\t\t\t\t\t__( 'Privacy Policy page setting updated successfully. Remember to <a href=\"%s\">update your menus</a>!' ),\n\t\t\t\t\tesc_url( add_query_arg( 'autofocus[panel]', 'nav_menus', admin_url( 'customize.php' ) ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tadd_settings_error( 'page_for_privacy_policy', 'page_for_privacy_policy', $privacy_page_updated_message, 'success' );\n\t} elseif ( 'create-privacy-page' === $action ) {\n\n\t\tif ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php';\n\t\t}\n\n\t\t$privacy_policy_page_content = WP_Privacy_Policy_Content::get_default_content();\n\t\t$privacy_policy_page_id      = wp_insert_post(\n\t\t\tarray(\n\t\t\t\t'post_title'   => __( 'Privacy Policy' ),\n\t\t\t\t'post_status'  => 'draft',\n\t\t\t\t'post_type'    => 'page',\n\t\t\t\t'post_content' => $privacy_policy_page_content,\n\t\t\t),\n\t\t\ttrue\n\t\t);\n\n\t\tif ( is_wp_error( $privacy_policy_page_id ) ) {\n\t\t\tadd_settings_error(\n\t\t\t\t'page_for_privacy_policy',\n\t\t\t\t'page_for_privacy_policy',\n\t\t\t\t__( 'Unable to create a Privacy Policy page.' ),\n\t\t\t\t'error'\n\t\t\t);\n\t\t} else {\n\t\t\tupdate_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id );\n\n\t\t\twp_redirect( admin_url( 'post.php?post=' . $privacy_policy_page_id . '&action=edit' ) );\n\t\t\texit;\n\t\t}\n\t}\n}\n\n// If a Privacy Policy page ID is available, make sure the page actually exists. If not, display an error.\n$privacy_policy_page_exists = false;\n$privacy_policy_page_id     = (int) get_option( 'wp_page_for_privacy_policy' );\n\nif ( ! empty( $privacy_policy_page_id ) ) {\n\n\t$privacy_policy_page = get_post( $privacy_policy_page_id );\n\n\tif ( ! $privacy_policy_page instanceof WP_Post ) {\n\t\tadd_settings_error(\n\t\t\t'page_for_privacy_policy',\n\t\t\t'page_for_privacy_policy',\n\t\t\t__( 'The currently selected Privacy Policy page does not exist. Please create or select a new page.' ),\n\t\t\t'error'\n\t\t);\n\t} else {\n\t\tif ( 'trash' === $privacy_policy_page->post_status ) {\n\t\t\tadd_settings_error(\n\t\t\t\t'page_for_privacy_policy',\n\t\t\t\t'page_for_privacy_policy',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: URL to Pages Trash. */\n\t\t\t\t\t__( 'The currently selected Privacy Policy page is in the Trash. Please create or select a new Privacy Policy page or <a href=\"%s\">restore the current page</a>.' ),\n\t\t\t\t\t'edit.php?post_status=trash&post_type=page'\n\t\t\t\t),\n\t\t\t\t'error'\n\t\t\t);\n\t\t} else {\n\t\t\t$privacy_policy_page_exists = true;\n\t\t}\n\t}\n}\n\n$title       = __( 'Privacy Settings' );\n$parent_file = 'options-general.php';\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n?>\n<div class=\"wrap\">\n\t<h1><?php echo $title; ?></h1>\n\t<h2><?php _e( 'Privacy Policy Page' ); ?></h2>\n\t<p>\n\t\t<?php _e( 'As a website owner, you may need to follow national or international privacy laws. For example, you may need to create and display a Privacy Policy.' ); ?>\n\t\t<?php _e( 'If you already have a Privacy Policy page, please select it below. If not, please create one.' ); ?>\n\t</p>\n\t<p>\n\t\t<?php _e( 'The new page will include help and suggestions for your Privacy Policy.' ); ?>\n\t\t<?php _e( 'However, it is your responsibility to use those resources correctly, to provide the information that your Privacy Policy requires, and to keep that information current and accurate.' ); ?>\n\t</p>\n\t<p>\n\t\t<?php _e( 'After your Privacy Policy page is set, we suggest that you edit it.' ); ?>\n\t\t<?php _e( 'We would also suggest reviewing your Privacy Policy from time to time, especially after installing or updating any themes or plugins. There may be changes or new suggested information for you to consider adding to your policy.' ); ?>\n\t</p>\n\t<?php\n\n\tif ( $privacy_policy_page_exists ) {\n\t\t$edit_href = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'post'   => $privacy_policy_page_id,\n\t\t\t\t'action' => 'edit',\n\t\t\t),\n\t\t\tadmin_url( 'post.php' )\n\t\t);\n\n\t\t$view_href = get_permalink( $privacy_policy_page_id );\n\t\t?>\n\t\t<p class=\"tools-privacy-edit\"><strong>\n\t\t\t<?php\n\t\t\tif ( 'publish' === get_post_status( $privacy_policy_page_id ) ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: URL to edit Privacy Policy page, 2: URL to view Privacy Policy page. */\n\t\t\t\t\t__( '<a href=\"%1$s\">Edit</a> or <a href=\"%2$s\">view</a> your Privacy Policy page content.' ),\n\t\t\t\t\tesc_url( $edit_href ),\n\t\t\t\t\tesc_url( $view_href )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: URL to edit Privacy Policy page, 2: URL to preview Privacy Policy page. */\n\t\t\t\t\t__( '<a href=\"%1$s\">Edit</a> or <a href=\"%2$s\">preview</a> your Privacy Policy page content.' ),\n\t\t\t\t\tesc_url( $edit_href ),\n\t\t\t\t\tesc_url( $view_href )\n\t\t\t\t);\n\t\t\t}\n\t\t\t?>\n\t\t</strong></p>\n\t\t<?php\n\t}\n\t?>\n\t<p>\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: 1: Privacy Policy guide URL, 2: Additional link attributes, 3: Accessibility text. */\n\t\t\t__( 'Need help putting together your new Privacy Policy page? <a href=\"%1$s\" %2$s>Check out our guide%3$s</a> for recommendations on what content to include, along with policies suggested by your plugins and theme.' ),\n\t\t\tesc_url( admin_url( 'privacy-policy-guide.php' ) ),\n\t\t\t'',\n\t\t\t''\n\t\t);\n\t\t?>\n\t</p>\n\n\t<hr>\n\t<table class=\"form-table tools-privacy-policy-page\" role=\"presentation\">\n\t\t<tr>\n\t\t\t<th scope=\"row\">\n\t\t\t\t<label for=\"page_for_privacy_policy\">\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( $privacy_policy_page_exists ) {\n\t\t\t\t\t\t_e( 'Change your Privacy Policy page' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_e( 'Select a Privacy Policy page' );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</th>\n\t\t\t<td>\n\t\t\t\t<?php\n\t\t\t\t$has_pages = (bool) get_posts(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_type'      => 'page',\n\t\t\t\t\t\t'posts_per_page' => 1,\n\t\t\t\t\t\t'post_status'    => array(\n\t\t\t\t\t\t\t'publish',\n\t\t\t\t\t\t\t'draft',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tif ( $has_pages ) :\n\t\t\t\t\t?>\n\t\t\t\t\t<form method=\"post\" action=\"\">\n\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"set-privacy-page\" />\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\twp_dropdown_pages(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'name'              => 'page_for_privacy_policy',\n\t\t\t\t\t\t\t\t'show_option_none'  => __( '&mdash; Select &mdash;' ),\n\t\t\t\t\t\t\t\t'option_none_value' => '0',\n\t\t\t\t\t\t\t\t'selected'          => $privacy_policy_page_id,\n\t\t\t\t\t\t\t\t'post_status'       => array( 'draft', 'publish' ),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\twp_nonce_field( 'set-privacy-page' );\n\n\t\t\t\t\t\tsubmit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) );\n\t\t\t\t\t\t?>\n\t\t\t\t\t</form>\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\t<form class=\"wp-create-privacy-page\" method=\"post\" action=\"\">\n\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"create-privacy-page\" />\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( $has_pages ) {\n\t\t\t\t\t\t\t_e( 'Or:' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t_e( 'There are no pages.' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t</span>\n\t\t\t\t\t<?php\n\t\t\t\t\twp_nonce_field( 'create-privacy-page' );\n\n\t\t\t\t\tsubmit_button( __( 'Create New Page' ), 'primary', 'submit', false, array( 'id' => 'create-page' ) );\n\t\t\t\t\t?>\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n</div>\n<?php\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 256}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Reading settings administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'manage_options' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );\n}\n\n$title       = __( 'Reading Settings' );\n$parent_file = 'options-general.php';\n\nadd_action( 'admin_head', 'options_reading_add_js' );\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' => '<p>' . __( 'This screen contains the settings that affect the display of your content.' ) . '</p>' .\n\t\t\t'<p>' . sprintf(\n\t\t\t\t/* translators: %s: URL to create a new page. */\n\t\t\t\t__( 'You can choose what&#8217;s displayed on the homepage of your site. It can be posts in reverse chronological order (classic blog), or a fixed/static page. To set a static homepage, you first need to create two <a href=\"%s\">Pages</a>. One will become the homepage, and the other will be where your posts are displayed.' ),\n\t\t\t\t'post-new.php?post_type=page'\n\t\t\t) . '</p>' .\n\t\t\t'<p>' . sprintf(\n\t\t\t\t/* translators: %s: Documentation URL. */\n\t\t\t\t__( 'You can also control the display of your content in RSS feeds, including the maximum number of posts to display and whether to show full text or a summary. <a href=\"%s\">Learn more about feeds</a>.' ),\n\t\t\t\t__( 'https://wordpress.org/support/article/wordpress-feeds/' )\n\t\t\t) . '</p>' .\n\t\t\t'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'site-visibility',\n\t\t'title'   => has_action( 'blog_privacy_selector' ) ? __( 'Site visibility' ) : __( 'Search engine visibility' ),\n\t\t'content' => '<p>' . __( 'You can choose whether or not your site will be crawled by robots, ping services, and spiders. If you want those services to ignore your site, click the checkbox next to &#8220;Discourage search engines from indexing this site&#8221; and click the Save Changes button at the bottom of the screen. Note that your privacy is not complete; your site is still visible on the web.' ) . '</p>' .\n\t\t\t'<p>' . __( 'When this setting is in effect, a reminder is shown in the At a Glance box of the Dashboard that says, &#8220;Search engines discouraged,&#8221; to remind you that your site is not being crawled.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/settings-reading-screen/\">Documentation on Reading Settings</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n\n<div class=\"wrap\">\n<h1><?php echo esc_html( $title ); ?></h1>\n\n<form method=\"post\" action=\"options.php\">\n<?php\nsettings_fields( 'reading' );\n\nif ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ), true ) ) {\n\tadd_settings_field( 'blog_charset', __( 'Encoding for pages and feeds' ), 'options_reading_blog_charset', 'reading', 'default', array( 'label_for' => 'blog_charset' ) );\n}\n?>\n\n<?php if ( ! get_pages() ) : ?>\n<input name=\"show_on_front\" type=\"hidden\" value=\"posts\" />\n<table class=\"form-table\" role=\"presentation\">\n\t<?php\n\tif ( 'posts' != get_option( 'show_on_front' ) ) :\n\t\tupdate_option( 'show_on_front', 'posts' );\n\tendif;\n\nelse :\n\tif ( 'page' === get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) ) {\n\t\tupdate_option( 'show_on_front', 'posts' );\n\t}\n\t?>\n<table class=\"form-table\" role=\"presentation\">\n<tr>\n<th scope=\"row\"><?php _e( 'Your homepage displays' ); ?></th>\n<td id=\"front-static-pages\"><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Your homepage displays' ); ?></span></legend>\n\t<p><label>\n\t\t<input name=\"show_on_front\" type=\"radio\" value=\"posts\" class=\"tog\" <?php checked( 'posts', get_option( 'show_on_front' ) ); ?> />\n\t\t<?php _e( 'Your latest posts' ); ?>\n\t</label>\n\t</p>\n\t<p><label>\n\t\t<input name=\"show_on_front\" type=\"radio\" value=\"page\" class=\"tog\" <?php checked( 'page', get_option( 'show_on_front' ) ); ?> />\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: URL to Pages screen. */\n\t\t\t__( 'A <a href=\"%s\">static page</a> (select below)' ),\n\t\t\t'edit.php?post_type=page'\n\t\t);\n\t\t?>\n\t</label>\n\t</p>\n<ul>\n\t<li><label for=\"page_on_front\">\n\t<?php\n\tprintf(\n\t\t/* translators: %s: Select field to choose the front page. */\n\t\t__( 'Homepage: %s' ),\n\t\twp_dropdown_pages(\n\t\t\tarray(\n\t\t\t\t'name'              => 'page_on_front',\n\t\t\t\t'echo'              => 0,\n\t\t\t\t'show_option_none'  => __( '&mdash; Select &mdash;' ),\n\t\t\t\t'option_none_value' => '0',\n\t\t\t\t'selected'          => get_option( 'page_on_front' ),\n\t\t\t)\n\t\t)\n\t);\n\t?>\n</label></li>\n\t<li><label for=\"page_for_posts\">\n\t<?php\n\tprintf(\n\t\t/* translators: %s: Select field to choose the page for posts. */\n\t\t__( 'Posts page: %s' ),\n\t\twp_dropdown_pages(\n\t\t\tarray(\n\t\t\t\t'name'              => 'page_for_posts',\n\t\t\t\t'echo'              => 0,\n\t\t\t\t'show_option_none'  => __( '&mdash; Select &mdash;' ),\n\t\t\t\t'option_none_value' => '0',\n\t\t\t\t'selected'          => get_option( 'page_for_posts' ),\n\t\t\t)\n\t\t)\n\t);\n\t?>\n</label></li>\n</ul>\n\t<?php if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) === get_option( 'page_on_front' ) ) : ?>\n\t<div id=\"front-page-warning\" class=\"error inline\"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same!' ); ?></p></div>\n\t<?php endif; ?>\n\t<?php if ( get_option( 'wp_page_for_privacy_policy' ) === get_option( 'page_for_posts' ) || get_option( 'wp_page_for_privacy_policy' ) === get_option( 'page_on_front' ) ) : ?>\n\t<div id=\"privacy-policy-page-warning\" class=\"error inline\"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same as your Privacy Policy page!' ); ?></p></div>\n\t<?php endif; ?>\n</fieldset></td>\n</tr>\n<?php endif; ?>\n<tr>\n<th scope=\"row\"><label for=\"posts_per_page\"><?php _e( 'Blog pages show at most' ); ?></label></th>\n<td>\n<input name=\"posts_per_page\" type=\"number\" step=\"1\" min=\"1\" id=\"posts_per_page\" value=\"<?php form_option( 'posts_per_page' ); ?>\" class=\"small-text\" /> <?php _e( 'posts' ); ?>\n</td>\n</tr>\n<tr>\n<th scope=\"row\"><label for=\"posts_per_rss\"><?php _e( 'Syndication feeds show the most recent' ); ?></label></th>\n<td><input name=\"posts_per_rss\" type=\"number\" step=\"1\" min=\"1\" id=\"posts_per_rss\" value=\"<?php form_option( 'posts_per_rss' ); ?>\" class=\"small-text\" /> <?php _e( 'items' ); ?></td>\n</tr>\n<tr>\n<th scope=\"row\"><?php _e( 'For each post in a feed, include' ); ?> </th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'For each post in a feed, include' ); ?> </span></legend>\n\t<p>\n\t\t<label><input name=\"rss_use_excerpt\" type=\"radio\" value=\"0\" <?php checked( 0, get_option( 'rss_use_excerpt' ) ); ?>\t/> <?php _e( 'Full text' ); ?></label><br />\n\t\t<label><input name=\"rss_use_excerpt\" type=\"radio\" value=\"1\" <?php checked( 1, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Summary' ); ?></label>\n\t</p>\n\t<p class=\"description\">\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: Documentation URL. */\n\t\t\t__( 'Your theme determines how content is displayed in browsers. <a href=\"%s\">Learn more about feeds</a>.' ),\n\t\t\t__( 'https://wordpress.org/support/article/wordpress-feeds/' )\n\t\t);\n\t\t?>\n\t</p>\n</fieldset></td>\n</tr>\n\n<tr class=\"option-site-visibility\">\n<th scope=\"row\"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site visibility' ) : _e( 'Search engine visibility' ); ?> </th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site visibility' ) : _e( 'Search engine visibility' ); ?> </span></legend>\n<?php if ( has_action( 'blog_privacy_selector' ) ) : ?>\n\t<input id=\"blog-public\" type=\"radio\" name=\"blog_public\" value=\"1\" <?php checked( '1', get_option( 'blog_public' ) ); ?> />\n\t<label for=\"blog-public\"><?php _e( 'Allow search engines to index this site' ); ?></label><br/>\n\t<input id=\"blog-norobots\" type=\"radio\" name=\"blog_public\" value=\"0\" <?php checked( '0', get_option( 'blog_public' ) ); ?> />\n\t<label for=\"blog-norobots\"><?php _e( 'Discourage search engines from indexing this site' ); ?></label>\n\t<p class=\"description\"><?php _e( 'Note: Neither of these options blocks access to your site &mdash; it is up to search engines to honor your request.' ); ?></p>\n\t<?php\n\t/**\n\t * Enable the legacy 'Site visibility' privacy options.\n\t *\n\t * By default the privacy options form displays a single checkbox to 'discourage' search\n\t * engines from indexing the site. Hooking to this action serves a dual purpose:\n\t * 1. Disable the single checkbox in favor of a multiple-choice list of radio buttons.\n\t * 2. Open the door to adding additional radio button choices to the list.\n\t *\n\t * Hooking to this action also converts the 'Search engine visibility' heading to the more\n\t * open-ended 'Site visibility' heading.\n\t *\n\t * @since 2.1.0\n\t */\n\tdo_action( 'blog_privacy_selector' );\n\t?>\n<?php else : ?>\n\t<label for=\"blog_public\"><input name=\"blog_public\" type=\"checkbox\" id=\"blog_public\" value=\"0\" <?php checked( '0', get_option( 'blog_public' ) ); ?> />\n\t<?php _e( 'Discourage search engines from indexing this site' ); ?></label>\n\t<p class=\"description\"><?php _e( 'It is up to search engines to honor this request.' ); ?></p>\n<?php endif; ?>\n</fieldset></td>\n</tr>\n\n<?php do_settings_fields( 'reading', 'default' ); ?>\n</table>\n\n<?php do_settings_sections( 'reading' ); ?>\n\n<?php submit_button(); ?>\n</form>\n</div>\n<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 219}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Writing settings administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'manage_options' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );\n}\n\n$title       = __( 'Writing Settings' );\n$parent_file = 'options-general.php';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' => '<p>' . __( 'You can submit content in several different ways; this screen holds the settings for all of them. The top section controls the editor within the dashboard, while the rest control external publishing methods. For more information on any of these methods, use the documentation links.' ) . '</p>' .\n\t\t\t'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',\n\t)\n);\n\n/** This filter is documented in wp-admin/options.php */\nif ( apply_filters( 'enable_post_by_email_configuration', true ) ) {\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'options-postemail',\n\t\t\t'title'   => __( 'Post Via Email' ),\n\t\t\t'content' => '<p>' . __( 'Post via email settings allow you to send your WordPress installation an email with the content of your post. You must set up a secret email account with POP3 access to use this, and any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret.' ) . '</p>',\n\t\t)\n\t);\n}\n\n/** This filter is documented in wp-admin/options-writing.php */\nif ( apply_filters( 'enable_update_services_configuration', true ) ) {\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'options-services',\n\t\t\t'title'   => __( 'Update Services' ),\n\t\t\t'content' => '<p>' . __( 'If desired, WordPress will automatically alert various services of your new posts.' ) . '</p>',\n\t\t)\n\t);\n}\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/settings-writing-screen/\">Documentation on Writing Settings</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n\n<div class=\"wrap\">\n<h1><?php echo esc_html( $title ); ?></h1>\n\n<form method=\"post\" action=\"options.php\">\n<?php settings_fields( 'writing' ); ?>\n\n<table class=\"form-table\" role=\"presentation\">\n<?php if ( get_site_option( 'initial_db_version' ) < 32453 ) : ?>\n<tr>\n<th scope=\"row\"><?php _e( 'Formatting' ); ?></th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Formatting' ); ?></span></legend>\n<label for=\"use_smilies\">\n<input name=\"use_smilies\" type=\"checkbox\" id=\"use_smilies\" value=\"1\" <?php checked( '1', get_option( 'use_smilies' ) ); ?> />\n\t<?php _e( 'Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display' ); ?></label><br />\n<label for=\"use_balanceTags\"><input name=\"use_balanceTags\" type=\"checkbox\" id=\"use_balanceTags\" value=\"1\" <?php checked( '1', get_option( 'use_balanceTags' ) ); ?> /> <?php _e( 'WordPress should correct invalidly nested XHTML automatically' ); ?></label>\n</fieldset></td>\n</tr>\n<?php endif; ?>\n<tr>\n<th scope=\"row\"><label for=\"default_category\"><?php _e( 'Default Post Category' ); ?></label></th>\n<td>\n<?php\nwp_dropdown_categories(\n\tarray(\n\t\t'hide_empty'   => 0,\n\t\t'name'         => 'default_category',\n\t\t'orderby'      => 'name',\n\t\t'selected'     => get_option( 'default_category' ),\n\t\t'hierarchical' => true,\n\t)\n);\n?>\n</td>\n</tr>\n<?php\n$post_formats = get_post_format_strings();\nunset( $post_formats['standard'] );\n?>\n<tr>\n<th scope=\"row\"><label for=\"default_post_format\"><?php _e( 'Default Post Format' ); ?></label></th>\n<td>\n\t<select name=\"default_post_format\" id=\"default_post_format\">\n\t\t<option value=\"0\"><?php echo get_post_format_string( 'standard' ); ?></option>\n<?php foreach ( $post_formats as $format_slug => $format_name ) : ?>\n\t\t<option<?php selected( get_option( 'default_post_format' ), $format_slug ); ?> value=\"<?php echo esc_attr( $format_slug ); ?>\"><?php echo esc_html( $format_name ); ?></option>\n<?php endforeach; ?>\n\t</select>\n</td>\n</tr>\n<?php\nif ( get_option( 'link_manager_enabled' ) ) :\n\t?>\n<tr>\n<th scope=\"row\"><label for=\"default_link_category\"><?php _e( 'Default Link Category' ); ?></label></th>\n<td>\n\t<?php\n\twp_dropdown_categories(\n\t\tarray(\n\t\t\t'hide_empty'   => 0,\n\t\t\t'name'         => 'default_link_category',\n\t\t\t'orderby'      => 'name',\n\t\t\t'selected'     => get_option( 'default_link_category' ),\n\t\t\t'hierarchical' => true,\n\t\t\t'taxonomy'     => 'link_category',\n\t\t)\n\t);\n\t?>\n</td>\n</tr>\n<?php endif; ?>\n\n<?php\ndo_settings_fields( 'writing', 'default' );\ndo_settings_fields( 'writing', 'remote_publishing' ); // A deprecated section.\n?>\n</table>\n\n<?php\n/** This filter is documented in wp-admin/options.php */\nif ( apply_filters( 'enable_post_by_email_configuration', true ) ) {\n\t?>\n<h2 class=\"title\"><?php _e( 'Post via email' ); ?></h2>\n<p>\n\t<?php\n\tprintf(\n\t\t/* translators: 1, 2, 3: Examples of random email addresses. */\n\t\t__( 'To post to WordPress by email, you must set up a secret email account with POP3 access. Any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret. Here are three random strings you could use: %1$s, %2$s, %3$s.' ),\n\t\tsprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),\n\t\tsprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),\n\t\tsprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) )\n\t);\n\t?>\n</p>\n\n<table class=\"form-table\" role=\"presentation\">\n<tr>\n<th scope=\"row\"><label for=\"mailserver_url\"><?php _e( 'Mail Server' ); ?></label></th>\n<td><input name=\"mailserver_url\" type=\"text\" id=\"mailserver_url\" value=\"<?php form_option( 'mailserver_url' ); ?>\" class=\"regular-text code\" />\n<label for=\"mailserver_port\"><?php _e( 'Port' ); ?></label>\n<input name=\"mailserver_port\" type=\"text\" id=\"mailserver_port\" value=\"<?php form_option( 'mailserver_port' ); ?>\" class=\"small-text\" />\n</td>\n</tr>\n<tr>\n<th scope=\"row\"><label for=\"mailserver_login\"><?php _e( 'Login Name' ); ?></label></th>\n<td><input name=\"mailserver_login\" type=\"text\" id=\"mailserver_login\" value=\"<?php form_option( 'mailserver_login' ); ?>\" class=\"regular-text ltr\" /></td>\n</tr>\n<tr>\n<th scope=\"row\"><label for=\"mailserver_pass\"><?php _e( 'Password' ); ?></label></th>\n<td>\n<input name=\"mailserver_pass\" type=\"text\" id=\"mailserver_pass\" value=\"<?php form_option( 'mailserver_pass' ); ?>\" class=\"regular-text ltr\" />\n</td>\n</tr>\n<tr>\n<th scope=\"row\"><label for=\"default_email_category\"><?php _e( 'Default Mail Category' ); ?></label></th>\n<td>\n\t<?php\n\twp_dropdown_categories(\n\t\tarray(\n\t\t\t'hide_empty'   => 0,\n\t\t\t'name'         => 'default_email_category',\n\t\t\t'orderby'      => 'name',\n\t\t\t'selected'     => get_option( 'default_email_category' ),\n\t\t\t'hierarchical' => true,\n\t\t)\n\t);\n\t?>\n</td>\n</tr>\n\t<?php do_settings_fields( 'writing', 'post_via_email' ); ?>\n</table>\n<?php } ?>\n\n<?php\n/**\n * Filters whether to enable the Update Services section in the Writing settings screen.\n *\n * @since 3.0.0\n *\n * @param bool $enable Whether to enable the Update Services settings area. Default true.\n */\nif ( apply_filters( 'enable_update_services_configuration', true ) ) {\n\t?>\n<h2 class=\"title\"><?php _e( 'Update Services' ); ?></h2>\n\n\t<?php if ( 1 == get_option( 'blog_public' ) ) : ?>\n\n\t<p><label for=\"ping_sites\">\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: Codex URL. */\n\t\t\t__( 'When you publish a new post, WordPress automatically notifies the following site update services. For more about this, see <a href=\"%s\">Update Services</a> on the Codex. Separate multiple service URLs with line breaks.' ),\n\t\t\t__( 'https://codex.wordpress.org/Update_Services' )\n\t\t);\n\t\t?>\n\t</label></p>\n\n\t<textarea name=\"ping_sites\" id=\"ping_sites\" class=\"large-text code\" rows=\"3\"><?php echo esc_textarea( get_option( 'ping_sites' ) ); ?></textarea>\n\n\t<?php else : ?>\n\n\t<p>\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: 1: Codex URL, 2: URL to Reading Settings screen. */\n\t\t\t__( 'WordPress is not notifying any <a href=\"%1$s\">Update Services</a> because of your site&#8217;s <a href=\"%2$s\">visibility settings</a>.' ),\n\t\t\t__( 'https://codex.wordpress.org/Update_Services' ),\n\t\t\t'options-reading.php'\n\t\t);\n\t\t?>\n\t</p>\n\n\t<?php endif; ?>\n<?php } // enable_update_services_configuration ?>\n\n<?php do_settings_sections( 'writing' ); ?>\n\n<?php submit_button(); ?>\n</form>\n</div>\n\n<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 240}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Options Management Administration Screen.\n *\n * If accessed directly in a browser this page shows a list of all saved options\n * along with editable fields for their values. Serialized data is not supported\n * and there is no way to remove options via this page. It is not linked to from\n * anywhere else in the admin.\n *\n * This file is also the target of the forms in core and custom options pages\n * that use the Settings API. In this case it saves the new option values\n * and returns the user to their page of origin.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n$title       = __( 'Settings' );\n$this_file   = 'options.php';\n$parent_file = 'options-general.php';\n\nwp_reset_vars( array( 'action', 'option_page' ) );\n\n$capability = 'manage_options';\n\n// This is for back compat and will eventually be removed.\nif ( empty( $option_page ) ) {\n\t$option_page = 'options';\n} else {\n\n\t/**\n\t * Filters the capability required when using the Settings API.\n\t *\n\t * By default, the options groups for all registered settings require the manage_options capability.\n\t * This filter is required to change the capability required for a certain options page.\n\t *\n\t * @since 3.2.0\n\t *\n\t * @param string $capability The capability used for the page, which is manage_options by default.\n\t */\n\t$capability = apply_filters( \"option_page_capability_{$option_page}\", $capability );\n}\n\nif ( ! current_user_can( $capability ) ) {\n\twp_die(\n\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t'<p>' . __( 'Sorry, you are not allowed to manage options for this site.' ) . '</p>',\n\t\t403\n\t);\n}\n\n// Handle admin email change requests.\nif ( ! empty( $_GET['adminhash'] ) ) {\n\t$new_admin_details = get_option( 'adminhash' );\n\t$redirect          = 'options-general.php?updated=false';\n\tif ( is_array( $new_admin_details ) && hash_equals( $new_admin_details['hash'], $_GET['adminhash'] ) && ! empty( $new_admin_details['newemail'] ) ) {\n\t\tupdate_option( 'admin_email', $new_admin_details['newemail'] );\n\t\tdelete_option( 'adminhash' );\n\t\tdelete_option( 'new_admin_email' );\n\t\t$redirect = 'options-general.php?updated=true';\n\t}\n\twp_redirect( admin_url( $redirect ) );\n\texit;\n} elseif ( ! empty( $_GET['dismiss'] ) && 'new_admin_email' === $_GET['dismiss'] ) {\n\tcheck_admin_referer( 'dismiss-' . get_current_blog_id() . '-new_admin_email' );\n\tdelete_option( 'adminhash' );\n\tdelete_option( 'new_admin_email' );\n\twp_redirect( admin_url( 'options-general.php?updated=true' ) );\n\texit;\n}\n\nif ( is_multisite() && ! current_user_can( 'manage_network_options' ) && 'update' != $action ) {\n\twp_die(\n\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t'<p>' . __( 'Sorry, you are not allowed to delete these items.' ) . '</p>',\n\t\t403\n\t);\n}\n\n$allowed_options            = array(\n\t'general'    => array(\n\t\t'blogname',\n\t\t'blogdescription',\n\t\t'gmt_offset',\n\t\t'date_format',\n\t\t'time_format',\n\t\t'start_of_week',\n\t\t'timezone_string',\n\t\t'WPLANG',\n\t\t'new_admin_email',\n\t),\n\t'discussion' => array(\n\t\t'default_pingback_flag',\n\t\t'default_ping_status',\n\t\t'default_comment_status',\n\t\t'comments_notify',\n\t\t'moderation_notify',\n\t\t'comment_moderation',\n\t\t'require_name_email',\n\t\t'comment_previously_approved',\n\t\t'comment_max_links',\n\t\t'moderation_keys',\n\t\t'disallowed_keys',\n\t\t'show_avatars',\n\t\t'avatar_rating',\n\t\t'avatar_default',\n\t\t'close_comments_for_old_posts',\n\t\t'close_comments_days_old',\n\t\t'thread_comments',\n\t\t'thread_comments_depth',\n\t\t'page_comments',\n\t\t'comments_per_page',\n\t\t'default_comments_page',\n\t\t'comment_order',\n\t\t'comment_registration',\n\t\t'show_comments_cookies_opt_in',\n\t),\n\t'media'      => array(\n\t\t'thumbnail_size_w',\n\t\t'thumbnail_size_h',\n\t\t'thumbnail_crop',\n\t\t'medium_size_w',\n\t\t'medium_size_h',\n\t\t'large_size_w',\n\t\t'large_size_h',\n\t\t'image_default_size',\n\t\t'image_default_align',\n\t\t'image_default_link_type',\n\t),\n\t'reading'    => array(\n\t\t'posts_per_page',\n\t\t'posts_per_rss',\n\t\t'rss_use_excerpt',\n\t\t'show_on_front',\n\t\t'page_on_front',\n\t\t'page_for_posts',\n\t\t'blog_public',\n\t),\n\t'writing'    => array(\n\t\t'default_category',\n\t\t'default_email_category',\n\t\t'default_link_category',\n\t\t'default_post_format',\n\t),\n);\n$allowed_options['misc']    = array();\n$allowed_options['options'] = array();\n$allowed_options['privacy'] = array();\n\n$mail_options = array( 'mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass' );\n\nif ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ), true ) ) {\n\t$allowed_options['reading'][] = 'blog_charset';\n}\n\nif ( get_site_option( 'initial_db_version' ) < 32453 ) {\n\t$allowed_options['writing'][] = 'use_smilies';\n\t$allowed_options['writing'][] = 'use_balanceTags';\n}\n\nif ( ! is_multisite() ) {\n\tif ( ! defined( 'WP_SITEURL' ) ) {\n\t\t$allowed_options['general'][] = 'siteurl';\n\t}\n\tif ( ! defined( 'WP_HOME' ) ) {\n\t\t$allowed_options['general'][] = 'home';\n\t}\n\n\t$allowed_options['general'][] = 'users_can_register';\n\t$allowed_options['general'][] = 'default_role';\n\n\t$allowed_options['writing']   = array_merge( $allowed_options['writing'], $mail_options );\n\t$allowed_options['writing'][] = 'ping_sites';\n\n\t$allowed_options['media'][] = 'uploads_use_yearmonth_folders';\n\n\t/*\n\t * If upload_url_path is not the default (empty),\n\t * or upload_path is not the default ('wp-content/uploads' or empty),\n\t * they can be edited, otherwise they're locked.\n\t */\n\tif ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) {\n\t\t$allowed_options['media'][] = 'upload_path';\n\t\t$allowed_options['media'][] = 'upload_url_path';\n\t}\n} else {\n\t/**\n\t * Filters whether the post-by-email functionality is enabled.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param bool $enabled Whether post-by-email configuration is enabled. Default true.\n\t */\n\tif ( apply_filters( 'enable_post_by_email_configuration', true ) ) {\n\t\t$allowed_options['writing'] = array_merge( $allowed_options['writing'], $mail_options );\n\t}\n}\n\n/**\n * Filters the allowed options list.\n *\n * @since 2.7.0\n * @deprecated 5.5.0 Use {@see 'allowed_options'} instead.\n *\n * @param array $allowed_options The allowed options list.\n */\n$allowed_options = apply_filters_deprecated(\n\t'whitelist_options',\n\tarray( $allowed_options ),\n\t'5.5.0',\n\t'apply_filters_deprecated',\n\t__( 'Please consider writing more inclusive code.' )\n);\n\n/**\n * Filters the allowed options list.\n *\n * @since 5.5.0\n *\n * @param array $allowed_options The allowed options list.\n */\n$allowed_options = apply_filters( 'allowed_options', $allowed_options );\n\nif ( 'update' === $action ) { // We are saving settings sent from a settings page.\n\tif ( 'options' === $option_page && ! isset( $_POST['option_page'] ) ) { // This is for back compat and will eventually be removed.\n\t\t$unregistered = true;\n\t\tcheck_admin_referer( 'update-options' );\n\t} else {\n\t\t$unregistered = false;\n\t\tcheck_admin_referer( $option_page . '-options' );\n\t}\n\n\tif ( ! isset( $allowed_options[ $option_page ] ) ) {\n\t\twp_die(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: The options page name. */\n\t\t\t\t__( '<strong>Error</strong>: Options page %s not found in the allowed options list.' ),\n\t\t\t\t'<code>' . esc_html( $option_page ) . '</code>'\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( 'options' === $option_page ) {\n\t\tif ( is_multisite() && ! current_user_can( 'manage_network_options' ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to modify unregistered settings for this site.' ) );\n\t\t}\n\t\t$options = explode( ',', wp_unslash( $_POST['page_options'] ) );\n\t} else {\n\t\t$options = $allowed_options[ $option_page ];\n\t}\n\n\tif ( 'general' === $option_page ) {\n\t\t// Handle custom date/time formats.\n\t\tif ( ! empty( $_POST['date_format'] ) && isset( $_POST['date_format_custom'] )\n\t\t\t&& '\\c\\u\\s\\t\\o\\m' === wp_unslash( $_POST['date_format'] )\n\t\t) {\n\t\t\t$_POST['date_format'] = $_POST['date_format_custom'];\n\t\t}\n\n\t\tif ( ! empty( $_POST['time_format'] ) && isset( $_POST['time_format_custom'] )\n\t\t\t&& '\\c\\u\\s\\t\\o\\m' === wp_unslash( $_POST['time_format'] )\n\t\t) {\n\t\t\t$_POST['time_format'] = $_POST['time_format_custom'];\n\t\t}\n\n\t\t// Map UTC+- timezones to gmt_offsets and set timezone_string to empty.\n\t\tif ( ! empty( $_POST['timezone_string'] ) && preg_match( '/^UTC[+-]/', $_POST['timezone_string'] ) ) {\n\t\t\t$_POST['gmt_offset']      = $_POST['timezone_string'];\n\t\t\t$_POST['gmt_offset']      = preg_replace( '/UTC\\+?/', '', $_POST['gmt_offset'] );\n\t\t\t$_POST['timezone_string'] = '';\n\t\t}\n\n\t\t// Handle translation installation.\n\t\tif ( ! empty( $_POST['WPLANG'] ) && current_user_can( 'install_languages' ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/translation-install.php';\n\n\t\t\tif ( wp_can_install_language_pack() ) {\n\t\t\t\t$language = wp_download_language_pack( $_POST['WPLANG'] );\n\t\t\t\tif ( $language ) {\n\t\t\t\t\t$_POST['WPLANG'] = $language;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( $options ) {\n\t\t$user_language_old = get_user_locale();\n\n\t\tforeach ( $options as $option ) {\n\t\t\tif ( $unregistered ) {\n\t\t\t\t_deprecated_argument(\n\t\t\t\t\t'options.php',\n\t\t\t\t\t'2.7.0',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: The option/setting. */\n\t\t\t\t\t\t__( 'The %s setting is unregistered. Unregistered settings are deprecated. See https://developer.wordpress.org/plugins/settings/settings-api/' ),\n\t\t\t\t\t\t'<code>' . esc_html( $option ) . '</code>'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$option = trim( $option );\n\t\t\t$value  = null;\n\t\t\tif ( isset( $_POST[ $option ] ) ) {\n\t\t\t\t$value = $_POST[ $option ];\n\t\t\t\tif ( ! is_array( $value ) ) {\n\t\t\t\t\t$value = trim( $value );\n\t\t\t\t}\n\t\t\t\t$value = wp_unslash( $value );\n\t\t\t}\n\t\t\tupdate_option( $option, $value );\n\t\t}\n\n\t\t/*\n\t\t * Switch translation in case WPLANG was changed.\n\t\t * The global $locale is used in get_locale() which is\n\t\t * used as a fallback in get_user_locale().\n\t\t */\n\t\tunset( $GLOBALS['locale'] );\n\t\t$user_language_new = get_user_locale();\n\t\tif ( $user_language_old !== $user_language_new ) {\n\t\t\tload_default_textdomain( $user_language_new );\n\t\t}\n\t}\n\n\t/*\n\t * Handle settings errors and return to options page.\n\t */\n\n\t// If no settings errors were registered add a general 'updated' message.\n\tif ( ! count( get_settings_errors() ) ) {\n\t\tadd_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'success' );\n\t}\n\tset_transient( 'settings_errors', get_settings_errors(), 30 );\n\n\t// Redirect back to the settings page that was submitted.\n\t$goback = add_query_arg( 'settings-updated', 'true', wp_get_referer() );\n\twp_redirect( $goback );\n\texit;\n}\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php'; ?>\n\n<div class=\"wrap\">\n\t<h1><?php esc_html_e( 'All Settings' ); ?></h1>\n\n\t<div class=\"notice notice-warning\">\n\t\t<p><strong><?php _e( 'Warning:' ); ?></strong> <?php _e( 'This page allows direct access to your site settings. You can break things here. Please be cautious!' ); ?></p>\n\t</div>\n\n\t<form name=\"form\" action=\"options.php\" method=\"post\" id=\"all-options\">\n\t\t<?php wp_nonce_field( 'options-options' ); ?>\n\t\t<input type=\"hidden\" name=\"action\" value=\"update\" />\n\t\t<input type=\"hidden\" name=\"option_page\" value=\"options\" />\n\t\t<table class=\"form-table\" role=\"presentation\">\n<?php\n$options = $wpdb->get_results( \"SELECT * FROM $wpdb->options ORDER BY option_name\" );\n\nforeach ( (array) $options as $option ) :\n\t$disabled = false;\n\n\tif ( '' === $option->option_name ) {\n\t\tcontinue;\n\t}\n\n\tif ( is_serialized( $option->option_value ) ) {\n\t\tif ( is_serialized_string( $option->option_value ) ) {\n\t\t\t// This is a serialized string, so we should display it.\n\t\t\t$value               = maybe_unserialize( $option->option_value );\n\t\t\t$options_to_update[] = $option->option_name;\n\t\t\t$class               = 'all-options';\n\t\t} else {\n\t\t\t$value    = 'SERIALIZED DATA';\n\t\t\t$disabled = true;\n\t\t\t$class    = 'all-options disabled';\n\t\t}\n\t} else {\n\t\t$value               = $option->option_value;\n\t\t$options_to_update[] = $option->option_name;\n\t\t$class               = 'all-options';\n\t}\n\n\t$name = esc_attr( $option->option_name );\n\t?>\n<tr>\n\t<th scope=\"row\"><label for=\"<?php echo $name; ?>\"><?php echo esc_html( $option->option_name ); ?></label></th>\n<td>\n\t<?php if ( strpos( $value, \"\\n\" ) !== false ) : ?>\n\t\t<textarea class=\"<?php echo $class; ?>\" name=\"<?php echo $name; ?>\" id=\"<?php echo $name; ?>\" cols=\"30\" rows=\"5\"><?php echo esc_textarea( $value ); ?></textarea>\n\t<?php else : ?>\n\t\t<input class=\"regular-text <?php echo $class; ?>\" type=\"text\" name=\"<?php echo $name; ?>\" id=\"<?php echo $name; ?>\" value=\"<?php echo esc_attr( $value ); ?>\"<?php disabled( $disabled, true ); ?> />\n\t<?php endif ?></td>\n</tr>\n<?php endforeach; ?>\n</table>\n\n<input type=\"hidden\" name=\"page_options\" value=\"<?php echo esc_attr( implode( ',', $options_to_update ) ); ?>\" />\n\n<?php submit_button( __( 'Save Changes' ), 'primary', 'Update' ); ?>\n\n</form>\n</div>\n\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 409}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit plugin editor administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( is_multisite() && ! is_network_admin() ) {\n\twp_redirect( network_admin_url( 'plugin-editor.php' ) );\n\texit;\n}\n\nif ( ! current_user_can( 'edit_plugins' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to edit plugins for this site.' ) );\n}\n\n$title       = __( 'Edit Plugins' );\n$parent_file = 'plugins.php';\n\n$plugins = get_plugins();\n\nif ( empty( $plugins ) ) {\n\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t?>\n\t<div class=\"wrap\">\n\t\t<h1><?php echo esc_html( $title ); ?></h1>\n\t\t<div id=\"message\" class=\"error\"><p><?php _e( 'No plugins are currently available.' ); ?></p></div>\n\t</div>\n\t<?php\n\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\texit;\n}\n\n$file   = '';\n$plugin = '';\nif ( isset( $_REQUEST['file'] ) ) {\n\t$file = wp_unslash( $_REQUEST['file'] );\n}\n\nif ( isset( $_REQUEST['plugin'] ) ) {\n\t$plugin = wp_unslash( $_REQUEST['plugin'] );\n}\n\nif ( empty( $plugin ) ) {\n\tif ( $file ) {\n\n\t\t// Locate the plugin for a given plugin file being edited.\n\t\t$file_dirname = dirname( $file );\n\t\tforeach ( array_keys( $plugins ) as $plugin_candidate ) {\n\t\t\tif ( $plugin_candidate === $file || ( '.' !== $file_dirname && dirname( $plugin_candidate ) === $file_dirname ) ) {\n\t\t\t\t$plugin = $plugin_candidate;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Fallback to the file as the plugin.\n\t\tif ( empty( $plugin ) ) {\n\t\t\t$plugin = $file;\n\t\t}\n\t} else {\n\t\t$plugin = array_keys( $plugins );\n\t\t$plugin = $plugin[0];\n\t}\n}\n\n$plugin_files = get_plugin_files( $plugin );\n\nif ( empty( $file ) ) {\n\t$file = $plugin_files[0];\n}\n\n$file      = validate_file_to_edit( $file, $plugin_files );\n$real_file = WP_PLUGIN_DIR . '/' . $file;\n\n// Handle fallback editing of file when JavaScript is not available.\n$edit_error     = null;\n$posted_content = null;\n\nif ( 'POST' === $_SERVER['REQUEST_METHOD'] ) {\n\t$r = wp_edit_theme_plugin_file( wp_unslash( $_POST ) );\n\tif ( is_wp_error( $r ) ) {\n\t\t$edit_error = $r;\n\t\tif ( check_ajax_referer( 'edit-plugin_' . $file, 'nonce', false ) && isset( $_POST['newcontent'] ) ) {\n\t\t\t$posted_content = wp_unslash( $_POST['newcontent'] );\n\t\t}\n\t} else {\n\t\twp_redirect(\n\t\t\tadd_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'a'      => 1, // This means \"success\" for some reason.\n\t\t\t\t\t'plugin' => $plugin,\n\t\t\t\t\t'file'   => $file,\n\t\t\t\t),\n\t\t\t\tadmin_url( 'plugin-editor.php' )\n\t\t\t)\n\t\t);\n\t\texit;\n\t}\n}\n\n// List of allowable extensions.\n$editable_extensions = wp_get_plugin_file_editable_extensions( $plugin );\n\nif ( ! is_file( $real_file ) ) {\n\twp_die( sprintf( '<p>%s</p>', __( 'File does not exist! Please double check the name and try again.' ) ) );\n} else {\n\t// Get the extension of the file.\n\tif ( preg_match( '/\\.([^.]+)$/', $real_file, $matches ) ) {\n\t\t$ext = strtolower( $matches[1] );\n\t\t// If extension is not in the acceptable list, skip it.\n\t\tif ( ! in_array( $ext, $editable_extensions, true ) ) {\n\t\t\twp_die( sprintf( '<p>%s</p>', __( 'Files of this type are not editable.' ) ) );\n\t\t}\n\t}\n}\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t\t'<p>' . __( 'You can use the plugin editor to make changes to any of your plugins&#8217; individual PHP files. Be aware that if you make changes, plugins updates will overwrite your customizations.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'Choose a plugin to edit from the dropdown menu and click the Select button. Click once on any file name to load it in the editor, and make your changes. Don&#8217;t forget to save your changes (Update File) when you&#8217;re finished.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'The Documentation menu below the editor lists the PHP functions recognized in the plugin file. Clicking Look Up takes you to a web page about that particular function.' ) . '</p>' .\n\t\t\t\t'<p id=\"editor-keyboard-trap-help-1\">' . __( 'When using a keyboard to navigate:' ) . '</p>' .\n\t\t\t\t'<ul>' .\n\t\t\t\t'<li id=\"editor-keyboard-trap-help-2\">' . __( 'In the editing area, the Tab key enters a tab character.' ) . '</li>' .\n\t\t\t\t'<li id=\"editor-keyboard-trap-help-3\">' . __( 'To move away from this area, press the Esc key followed by the Tab key.' ) . '</li>' .\n\t\t\t\t'<li id=\"editor-keyboard-trap-help-4\">' . __( 'Screen reader users: when in forms mode, you may need to press the Esc key twice.' ) . '</li>' .\n\t\t\t\t'</ul>' .\n\t\t\t\t'<p>' . __( 'If you want to make changes but don&#8217;t want them to be overwritten when the plugin is updated, you may be ready to think about writing your own plugin. For information on how to edit plugins, write your own from scratch, or just better understand their anatomy, check out the links below.' ) . '</p>' .\n\t\t\t\t( is_network_admin() ? '<p>' . __( 'Any edits to files from this screen will be reflected on all sites in the network.' ) . '</p>' : '' ),\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/plugins-editor-screen/\">Documentation on Editing Plugins</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://developer.wordpress.org/plugins/\">Documentation on Writing Plugins</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\n$settings = array(\n\t'codeEditor' => wp_enqueue_code_editor( array( 'file' => $real_file ) ),\n);\nwp_enqueue_script( 'wp-theme-plugin-editor' );\nwp_add_inline_script( 'wp-theme-plugin-editor', sprintf( 'jQuery( function( $ ) { wp.themePluginEditor.init( $( \"#template\" ), %s ); } )', wp_json_encode( $settings ) ) );\nwp_add_inline_script( 'wp-theme-plugin-editor', sprintf( 'wp.themePluginEditor.themeOrPlugin = \"plugin\";' ) );\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\nupdate_recently_edited( WP_PLUGIN_DIR . '/' . $file );\n\nif ( ! empty( $posted_content ) ) {\n\t$content = $posted_content;\n} else {\n\t$content = file_get_contents( $real_file );\n}\n\nif ( '.php' === substr( $real_file, strrpos( $real_file, '.' ) ) ) {\n\t$functions = wp_doc_link_parse( $content );\n\n\tif ( ! empty( $functions ) ) {\n\t\t$docs_select  = '<select name=\"docs-list\" id=\"docs-list\">';\n\t\t$docs_select .= '<option value=\"\">' . __( 'Function Name&hellip;' ) . '</option>';\n\t\tforeach ( $functions as $function ) {\n\t\t\t$docs_select .= '<option value=\"' . esc_attr( $function ) . '\">' . esc_html( $function ) . '()</option>';\n\t\t}\n\t\t$docs_select .= '</select>';\n\t}\n}\n\n$content = esc_textarea( $content );\n?>\n<div class=\"wrap\">\n<h1><?php echo esc_html( $title ); ?></h1>\n\n<?php if ( isset( $_GET['a'] ) ) : ?>\n\t<div id=\"message\" class=\"updated notice is-dismissible\">\n\t\t<p><?php _e( 'File edited successfully.' ); ?></p>\n\t</div>\n<?php elseif ( is_wp_error( $edit_error ) ) : ?>\n\t<div id=\"message\" class=\"notice notice-error\">\n\t\t<p><?php _e( 'There was an error while trying to update the file. You may need to fix something and try updating again.' ); ?></p>\n\t\t<pre><?php echo esc_html( $edit_error->get_error_message() ? $edit_error->get_error_message() : $edit_error->get_error_code() ); ?></pre>\n\t</div>\n<?php endif; ?>\n\n<div class=\"fileedit-sub\">\n<div class=\"alignleft\">\n<h2>\n\t<?php\n\tif ( is_plugin_active( $plugin ) ) {\n\t\tif ( is_writeable( $real_file ) ) {\n\t\t\t/* translators: %s: Plugin file name. */\n\t\t\tprintf( __( 'Editing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );\n\t\t} else {\n\t\t\t/* translators: %s: Plugin file name. */\n\t\t\tprintf( __( 'Browsing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );\n\t\t}\n\t} else {\n\t\tif ( is_writeable( $real_file ) ) {\n\t\t\t/* translators: %s: Plugin file name. */\n\t\t\tprintf( __( 'Editing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );\n\t\t} else {\n\t\t\t/* translators: %s: Plugin file name. */\n\t\t\tprintf( __( 'Browsing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );\n\t\t}\n\t}\n\t?>\n</h2>\n</div>\n<div class=\"alignright\">\n\t<form action=\"plugin-editor.php\" method=\"get\">\n\t\t<strong><label for=\"plugin\"><?php _e( 'Select plugin to edit:' ); ?> </label></strong>\n\t\t<select name=\"plugin\" id=\"plugin\">\n\t\t<?php\n\t\tforeach ( $plugins as $plugin_key => $a_plugin ) {\n\t\t\t$plugin_name = $a_plugin['Name'];\n\t\t\tif ( $plugin_key === $plugin ) {\n\t\t\t\t$selected = \" selected='selected'\";\n\t\t\t} else {\n\t\t\t\t$selected = '';\n\t\t\t}\n\t\t\t$plugin_name = esc_attr( $plugin_name );\n\t\t\t$plugin_key  = esc_attr( $plugin_key );\n\t\t\techo \"\\n\\t<option value=\\\"$plugin_key\\\" $selected>$plugin_name</option>\";\n\t\t}\n\t\t?>\n\t\t</select>\n\t\t<?php submit_button( __( 'Select' ), '', 'Submit', false ); ?>\n\t</form>\n</div>\n<br class=\"clear\" />\n</div>\n\n<div id=\"templateside\">\n\t<h2 id=\"plugin-files-label\"><?php _e( 'Plugin Files' ); ?></h2>\n\n\t<?php\n\t$plugin_editable_files = array();\n\tforeach ( $plugin_files as $plugin_file ) {\n\t\tif ( preg_match( '/\\.([^.]+)$/', $plugin_file, $matches ) && in_array( $matches[1], $editable_extensions, true ) ) {\n\t\t\t$plugin_editable_files[] = $plugin_file;\n\t\t}\n\t}\n\t?>\n\t<ul role=\"tree\" aria-labelledby=\"plugin-files-label\">\n\t<li role=\"treeitem\" tabindex=\"-1\" aria-expanded=\"true\" aria-level=\"1\" aria-posinset=\"1\" aria-setsize=\"1\">\n\t\t<ul role=\"group\">\n\t\t\t<?php wp_print_plugin_file_tree( wp_make_plugin_file_tree( $plugin_editable_files ) ); ?>\n\t\t</ul>\n\t</ul>\n</div>\n\n<form name=\"template\" id=\"template\" action=\"plugin-editor.php\" method=\"post\">\n\t<?php wp_nonce_field( 'edit-plugin_' . $file, 'nonce' ); ?>\n\t<div>\n\t\t<label for=\"newcontent\" id=\"theme-plugin-editor-label\"><?php _e( 'Selected file content:' ); ?></label>\n\t\t<textarea cols=\"70\" rows=\"25\" name=\"newcontent\" id=\"newcontent\" aria-describedby=\"editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4\"><?php echo $content; ?></textarea>\n\t\t<input type=\"hidden\" name=\"action\" value=\"update\" />\n\t\t<input type=\"hidden\" name=\"file\" value=\"<?php echo esc_attr( $file ); ?>\" />\n\t\t<input type=\"hidden\" name=\"plugin\" value=\"<?php echo esc_attr( $plugin ); ?>\" />\n\t</div>\n\n\t<?php if ( ! empty( $docs_select ) ) : ?>\n\t\t<div id=\"documentation\" class=\"hide-if-no-js\">\n\t\t\t<label for=\"docs-list\"><?php _e( 'Documentation:' ); ?></label>\n\t\t\t<?php echo $docs_select; ?>\n\t\t\t<input disabled id=\"docs-lookup\" type=\"button\" class=\"button\" value=\"<?php esc_attr_e( 'Look Up' ); ?>\" onclick=\"if ( '' != jQuery('#docs-list').val() ) { window.open( 'https://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_user_locale() ); ?>&amp;version=<?php echo urlencode( get_bloginfo( 'version' ) ); ?>&amp;redirect=true'); }\" />\n\t\t</div>\n\t<?php endif; ?>\n\n\t<?php if ( is_writeable( $real_file ) ) : ?>\n\t\t<div class=\"editor-notices\">\n\t\t<?php if ( in_array( $plugin, (array) get_option( 'active_plugins', array() ), true ) ) { ?>\n\t\t\t<div class=\"notice notice-warning inline active-plugin-edit-warning\">\n\t\t\t\t<p><?php _e( '<strong>Warning:</strong> Making changes to active plugins is not recommended.' ); ?></p>\n\t\t\t</div>\n\t\t<?php } ?>\n\t\t</div>\n\t\t<p class=\"submit\">\n\t\t\t<?php submit_button( __( 'Update File' ), 'primary', 'submit', false ); ?>\n\t\t\t<span class=\"spinner\"></span>\n\t\t</p>\n\t<?php else : ?>\n\t\t<p><em>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: Documentation URL. */\n\t\t\t\t__( 'You need to make this file writable before you can save your changes. See <a href=\"%s\">Changing File Permissions</a> for more information.' ),\n\t\t\t\t__( 'https://wordpress.org/support/article/changing-file-permissions/' )\n\t\t\t);\n\t\t\t?>\n\t\t</em></p>\n\t<?php endif; ?>\n\n\t<?php wp_print_file_editor_templates(); ?>\n</form>\n<br class=\"clear\" />\n</div>\n<?php\n$dismissed_pointers = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );\nif ( ! in_array( 'plugin_editor_notice', $dismissed_pointers, true ) ) :\n\t// Get a back URL.\n\t$referer = wp_get_referer();\n\n\t$excluded_referer_basenames = array( 'plugin-editor.php', 'wp-login.php' );\n\n\tif ( $referer && ! in_array( basename( parse_url( $referer, PHP_URL_PATH ) ), $excluded_referer_basenames, true ) ) {\n\t\t$return_url = $referer;\n\t} else {\n\t\t$return_url = admin_url( '/' );\n\t}\n\t?>\n\t<div id=\"file-editor-warning\" class=\"notification-dialog-wrap file-editor-warning hide-if-no-js hidden\">\n\t\t<div class=\"notification-dialog-background\"></div>\n\t\t<div class=\"notification-dialog\">\n\t\t\t<div class=\"file-editor-warning-content\">\n\t\t\t\t<div class=\"file-editor-warning-message\">\n\t\t\t\t\t<h1><?php _e( 'Heads up!' ); ?></h1>\n\t\t\t\t\t<p><?php _e( 'You appear to be making direct edits to your plugin in the WordPress dashboard. We recommend that you don&#8217;t! Editing plugins directly may introduce incompatibilities that break your site and your changes may be lost in future updates.' ); ?></p>\n\t\t\t\t\t<p><?php _e( 'If you absolutely have to make direct edits to this plugin, use a file manager to create a copy with a new name and hang on to the original. That way, you can re-enable a functional version if something goes wrong.' ); ?></p>\n\t\t\t\t</div>\n\t\t\t\t<p>\n\t\t\t\t\t<a class=\"button file-editor-warning-go-back\" href=\"<?php echo esc_url( $return_url ); ?>\"><?php _e( 'Go back' ); ?></a>\n\t\t\t\t\t<button type=\"button\" class=\"file-editor-warning-dismiss button button-primary\"><?php _e( 'I understand' ); ?></button>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<?php\nendif; // Editor warning notice.\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 340}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Install plugin administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n// TODO: Route this page via a specific iframe handler instead of the do_action below.\nif ( ! defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'plugin-information' === $_GET['tab'] ) ) {\n\tdefine( 'IFRAME_REQUEST', true );\n}\n\n/**\n * WordPress Administration Bootstrap.\n */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'install_plugins' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );\n}\n\nif ( is_multisite() && ! is_network_admin() ) {\n\twp_redirect( network_admin_url( 'plugin-install.php' ) );\n\texit;\n}\n\n$wp_list_table = _get_list_table( 'WP_Plugin_Install_List_Table' );\n$pagenum       = $wp_list_table->get_pagenum();\n\nif ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {\n\t$location = remove_query_arg( '_wp_http_referer', wp_unslash( $_SERVER['REQUEST_URI'] ) );\n\n\tif ( ! empty( $_REQUEST['paged'] ) ) {\n\t\t$location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location );\n\t}\n\n\twp_redirect( $location );\n\texit;\n}\n\n$wp_list_table->prepare_items();\n\n$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );\n\nif ( $pagenum > $total_pages && $total_pages > 0 ) {\n\twp_redirect( add_query_arg( 'paged', $total_pages ) );\n\texit;\n}\n\n$title       = __( 'Add Plugins' );\n$parent_file = 'plugins.php';\n\nwp_enqueue_script( 'plugin-install' );\nif ( 'plugin-information' != $tab ) {\n\tadd_thickbox();\n}\n\n$body_id = $tab;\n\nwp_enqueue_script( 'updates' );\n\n/**\n * Fires before each tab on the Install Plugins screen is loaded.\n *\n * The dynamic portion of the action hook, `$tab`, allows for targeting\n * individual tabs, for instance 'install_plugins_pre_plugin-information'.\n *\n * @since 2.7.0\n */\ndo_action( \"install_plugins_pre_{$tab}\" );\n\n/*\n * Call the pre upload action on every non-upload plugin installation screen\n * because the form is always displayed on these screens.\n */\nif ( 'upload' !== $tab ) {\n\t/** This action is documented in wp-admin/plugin-install.php */\n\tdo_action( 'install_plugins_pre_upload' );\n}\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t\t'<p>' . sprintf(\n\t\t\t\t\t/* translators: %s: https://wordpress.org/plugins/ */\n\t\t\t\t\t__( 'Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from the core WordPress application by thousands of developers all over the world. All plugins in the official <a href=\"%s\">WordPress Plugin Directory</a> are compatible with the license WordPress uses.' ),\n\t\t\t\t\t__( 'https://wordpress.org/plugins/' )\n\t\t\t\t) . '</p>' .\n\t\t\t\t'<p>' . __( 'You can find new plugins to install by searching or browsing the directory right here in your own Plugins section.' ) . ' <span id=\"live-search-desc\" class=\"hide-if-no-js\">' . __( 'The search results will be updated as you type.' ) . '</span></p>',\n\n\t)\n);\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'adding-plugins',\n\t\t'title'   => __( 'Adding Plugins' ),\n\t\t'content' =>\n\t\t\t\t'<p>' . __( 'If you know what you&#8217;re looking for, Search is your best bet. The Search screen has options to search the WordPress Plugin Directory for a particular Term, Author, or Tag. You can also search the directory by selecting popular tags. Tags in larger type mean more plugins have been labeled with that tag.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'If you just want to get an idea of what&#8217;s available, you can browse Featured and Popular plugins by using the links above the plugins list. These sections rotate regularly.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'You can also browse a user&#8217;s favorite plugins, by using the Favorites link above the plugins list and entering their WordPress.org username.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'If you want to install a plugin that you&#8217;ve downloaded elsewhere, click the Upload Plugin button above the plugins list. You will be prompted to upload the .zip package, and once uploaded, you can activate the new plugin.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/plugins-add-new-screen/\">Documentation on Installing Plugins</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nget_current_screen()->set_screen_reader_content(\n\tarray(\n\t\t'heading_views'      => __( 'Filter plugins list' ),\n\t\t'heading_pagination' => __( 'Plugins list navigation' ),\n\t\t'heading_list'       => __( 'Plugins list' ),\n\t)\n);\n\n/**\n * WordPress Administration Template Header.\n */\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n<div class=\"wrap <?php echo esc_attr( \"plugin-install-tab-$tab\" ); ?>\">\n<h1 class=\"wp-heading-inline\">\n<?php\necho esc_html( $title );\n?>\n</h1>\n\n<?php\nif ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_plugins' ) ) {\n\tprintf(\n\t\t' <a href=\"%s\" class=\"upload-view-toggle page-title-action\"><span class=\"upload\">%s</span><span class=\"browse\">%s</span></a>',\n\t\t( 'upload' === $tab ) ? self_admin_url( 'plugin-install.php' ) : self_admin_url( 'plugin-install.php?tab=upload' ),\n\t\t__( 'Upload Plugin' ),\n\t\t__( 'Browse Plugins' )\n\t);\n}\n?>\n\n<hr class=\"wp-header-end\">\n\n<?php\n/*\n * Output the upload plugin form on every non-upload plugin installation screen, so it can be\n * displayed via JavaScript rather then opening up the devoted upload plugin page.\n */\nif ( 'upload' !== $tab ) {\n\t?>\n\t<div class=\"upload-plugin-wrap\">\n\t\t<?php\n\t\t/** This action is documented in wp-admin/plugin-install.php */\n\t\tdo_action( 'install_plugins_upload' );\n\t\t?>\n\t</div>\n\t<?php\n\t$wp_list_table->views();\n}\n\n/**\n * Fires after the plugins list table in each tab of the Install Plugins screen.\n *\n * The dynamic portion of the action hook, `$tab`, allows for targeting\n * individual tabs, for instance 'install_plugins_plugin-information'.\n *\n * @since 2.7.0\n *\n * @param int $paged The current page number of the plugins list table.\n */\ndo_action( \"install_plugins_{$tab}\", $paged );\n?>\n\n\t<span class=\"spinner\"></span>\n</div>\n\n<?php\nwp_print_request_filesystem_credentials_modal();\nwp_print_admin_notice_templates();\n\n/**\n * WordPress Administration Template Footer.\n */\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 187}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Plugins administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'activate_plugins' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to manage plugins for this site.' ) );\n}\n\n$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );\n$pagenum       = $wp_list_table->get_pagenum();\n\n$action = $wp_list_table->current_action();\n\n$plugin = isset( $_REQUEST['plugin'] ) ? wp_unslash( $_REQUEST['plugin'] ) : '';\n$s      = isset( $_REQUEST['s'] ) ? urlencode( wp_unslash( $_REQUEST['s'] ) ) : '';\n\n// Clean up request URI from temporary args for screen options/paging uri's to work as expected.\n$query_args_to_remove = array(\n\t'error',\n\t'deleted',\n\t'activate',\n\t'activate-multi',\n\t'deactivate',\n\t'deactivate-multi',\n\t'enabled-auto-update',\n\t'disabled-auto-update',\n\t'enabled-auto-update-multi',\n\t'disabled-auto-update-multi',\n\t'_error_nonce',\n);\n\n$_SERVER['REQUEST_URI'] = remove_query_arg( $query_args_to_remove, $_SERVER['REQUEST_URI'] );\n\nwp_enqueue_script( 'updates' );\n\nif ( $action ) {\n\n\tswitch ( $action ) {\n\t\tcase 'activate':\n\t\t\tif ( ! current_user_can( 'activate_plugin', $plugin ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to activate this plugin.' ) );\n\t\t\t}\n\n\t\t\tif ( is_multisite() && ! is_network_admin() && is_network_only_plugin( $plugin ) ) {\n\t\t\t\twp_redirect( self_admin_url( \"plugins.php?plugin_status=$status&paged=$page&s=$s\" ) );\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tcheck_admin_referer( 'activate-plugin_' . $plugin );\n\n\t\t\t$result = activate_plugin( $plugin, self_admin_url( 'plugins.php?error=true&plugin=' . urlencode( $plugin ) ), is_network_admin() );\n\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\tif ( 'unexpected_output' === $result->get_error_code() ) {\n\t\t\t\t\t$redirect = self_admin_url( 'plugins.php?error=true&charsout=' . strlen( $result->get_error_data() ) . '&plugin=' . urlencode( $plugin ) . \"&plugin_status=$status&paged=$page&s=$s\" );\n\t\t\t\t\twp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) );\n\t\t\t\t\texit;\n\t\t\t\t} else {\n\t\t\t\t\twp_die( $result );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! is_network_admin() ) {\n\t\t\t\t$recent = (array) get_option( 'recently_activated' );\n\t\t\t\tunset( $recent[ $plugin ] );\n\t\t\t\tupdate_option( 'recently_activated', $recent );\n\t\t\t} else {\n\t\t\t\t$recent = (array) get_site_option( 'recently_activated' );\n\t\t\t\tunset( $recent[ $plugin ] );\n\t\t\t\tupdate_site_option( 'recently_activated', $recent );\n\t\t\t}\n\n\t\t\tif ( isset( $_GET['from'] ) && 'import' === $_GET['from'] ) {\n\t\t\t\t// Overrides the ?error=true one above and redirects to the Imports page, stripping the -importer suffix.\n\t\t\t\twp_redirect( self_admin_url( 'import.php?import=' . str_replace( '-importer', '', dirname( $plugin ) ) ) );\n\t\t\t} elseif ( isset( $_GET['from'] ) && 'press-this' === $_GET['from'] ) {\n\t\t\t\twp_redirect( self_admin_url( 'press-this.php' ) );\n\t\t\t} else {\n\t\t\t\t// Overrides the ?error=true one above.\n\t\t\t\twp_redirect( self_admin_url( \"plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s\" ) );\n\t\t\t}\n\t\t\texit;\n\n\t\tcase 'activate-selected':\n\t\t\tif ( ! current_user_can( 'activate_plugins' ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to activate plugins for this site.' ) );\n\t\t\t}\n\n\t\t\tcheck_admin_referer( 'bulk-plugins' );\n\n\t\t\t$plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array();\n\n\t\t\tif ( is_network_admin() ) {\n\t\t\t\tforeach ( $plugins as $i => $plugin ) {\n\t\t\t\t\t// Only activate plugins which are not already network activated.\n\t\t\t\t\tif ( is_plugin_active_for_network( $plugin ) ) {\n\t\t\t\t\t\tunset( $plugins[ $i ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tforeach ( $plugins as $i => $plugin ) {\n\t\t\t\t\t// Only activate plugins which are not already active and are not network-only when on Multisite.\n\t\t\t\t\tif ( is_plugin_active( $plugin ) || ( is_multisite() && is_network_only_plugin( $plugin ) ) ) {\n\t\t\t\t\t\tunset( $plugins[ $i ] );\n\t\t\t\t\t}\n\t\t\t\t\t// Only activate plugins which the user can activate.\n\t\t\t\t\tif ( ! current_user_can( 'activate_plugin', $plugin ) ) {\n\t\t\t\t\t\tunset( $plugins[ $i ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( empty( $plugins ) ) {\n\t\t\t\twp_redirect( self_admin_url( \"plugins.php?plugin_status=$status&paged=$page&s=$s\" ) );\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tactivate_plugins( $plugins, self_admin_url( 'plugins.php?error=true' ), is_network_admin() );\n\n\t\t\tif ( ! is_network_admin() ) {\n\t\t\t\t$recent = (array) get_option( 'recently_activated' );\n\t\t\t} else {\n\t\t\t\t$recent = (array) get_site_option( 'recently_activated' );\n\t\t\t}\n\n\t\t\tforeach ( $plugins as $plugin ) {\n\t\t\t\tunset( $recent[ $plugin ] );\n\t\t\t}\n\n\t\t\tif ( ! is_network_admin() ) {\n\t\t\t\tupdate_option( 'recently_activated', $recent );\n\t\t\t} else {\n\t\t\t\tupdate_site_option( 'recently_activated', $recent );\n\t\t\t}\n\n\t\t\twp_redirect( self_admin_url( \"plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s\" ) );\n\t\t\texit;\n\n\t\tcase 'update-selected':\n\t\t\tcheck_admin_referer( 'bulk-plugins' );\n\n\t\t\tif ( isset( $_GET['plugins'] ) ) {\n\t\t\t\t$plugins = explode( ',', wp_unslash( $_GET['plugins'] ) );\n\t\t\t} elseif ( isset( $_POST['checked'] ) ) {\n\t\t\t\t$plugins = (array) wp_unslash( $_POST['checked'] );\n\t\t\t} else {\n\t\t\t\t$plugins = array();\n\t\t\t}\n\n\t\t\t$title       = __( 'Update Plugins' );\n\t\t\t$parent_file = 'plugins.php';\n\n\t\t\twp_enqueue_script( 'updates' );\n\t\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n\t\t\techo '<div class=\"wrap\">';\n\t\t\techo '<h1>' . esc_html( $title ) . '</h1>';\n\n\t\t\t$url = self_admin_url( 'update.php?action=update-selected&amp;plugins=' . urlencode( join( ',', $plugins ) ) );\n\t\t\t$url = wp_nonce_url( $url, 'bulk-update-plugins' );\n\n\t\t\techo \"<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>\";\n\t\t\techo '</div>';\n\t\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t\t\texit;\n\n\t\tcase 'error_scrape':\n\t\t\tif ( ! current_user_can( 'activate_plugin', $plugin ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to activate this plugin.' ) );\n\t\t\t}\n\n\t\t\tcheck_admin_referer( 'plugin-activation-error_' . $plugin );\n\n\t\t\t$valid = validate_plugin( $plugin );\n\t\t\tif ( is_wp_error( $valid ) ) {\n\t\t\t\twp_die( $valid );\n\t\t\t}\n\n\t\t\tif ( ! WP_DEBUG ) {\n\t\t\t\terror_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );\n\t\t\t}\n\n\t\t\tini_set( 'display_errors', true ); // Ensure that fatal errors are displayed.\n\t\t\t// Go back to \"sandbox\" scope so we get the same errors as before.\n\t\t\tplugin_sandbox_scrape( $plugin );\n\t\t\t/** This action is documented in wp-admin/includes/plugin.php */\n\t\t\tdo_action( \"activate_{$plugin}\" );\n\t\t\texit;\n\n\t\tcase 'deactivate':\n\t\t\tif ( ! current_user_can( 'deactivate_plugin', $plugin ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to deactivate this plugin.' ) );\n\t\t\t}\n\n\t\t\tcheck_admin_referer( 'deactivate-plugin_' . $plugin );\n\n\t\t\tif ( ! is_network_admin() && is_plugin_active_for_network( $plugin ) ) {\n\t\t\t\twp_redirect( self_admin_url( \"plugins.php?plugin_status=$status&paged=$page&s=$s\" ) );\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tdeactivate_plugins( $plugin, false, is_network_admin() );\n\n\t\t\tif ( ! is_network_admin() ) {\n\t\t\t\tupdate_option( 'recently_activated', array( $plugin => time() ) + (array) get_option( 'recently_activated' ) );\n\t\t\t} else {\n\t\t\t\tupdate_site_option( 'recently_activated', array( $plugin => time() ) + (array) get_site_option( 'recently_activated' ) );\n\t\t\t}\n\n\t\t\tif ( headers_sent() ) {\n\t\t\t\techo \"<meta http-equiv='refresh' content='\" . esc_attr( \"0;url=plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s\" ) . \"' />\";\n\t\t\t} else {\n\t\t\t\twp_redirect( self_admin_url( \"plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s\" ) );\n\t\t\t}\n\t\t\texit;\n\n\t\tcase 'deactivate-selected':\n\t\t\tif ( ! current_user_can( 'deactivate_plugins' ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to deactivate plugins for this site.' ) );\n\t\t\t}\n\n\t\t\tcheck_admin_referer( 'bulk-plugins' );\n\n\t\t\t$plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array();\n\t\t\t// Do not deactivate plugins which are already deactivated.\n\t\t\tif ( is_network_admin() ) {\n\t\t\t\t$plugins = array_filter( $plugins, 'is_plugin_active_for_network' );\n\t\t\t} else {\n\t\t\t\t$plugins = array_filter( $plugins, 'is_plugin_active' );\n\t\t\t\t$plugins = array_diff( $plugins, array_filter( $plugins, 'is_plugin_active_for_network' ) );\n\n\t\t\t\tforeach ( $plugins as $i => $plugin ) {\n\t\t\t\t\t// Only deactivate plugins which the user can deactivate.\n\t\t\t\t\tif ( ! current_user_can( 'deactivate_plugin', $plugin ) ) {\n\t\t\t\t\t\tunset( $plugins[ $i ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( empty( $plugins ) ) {\n\t\t\t\twp_redirect( self_admin_url( \"plugins.php?plugin_status=$status&paged=$page&s=$s\" ) );\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tdeactivate_plugins( $plugins, false, is_network_admin() );\n\n\t\t\t$deactivated = array();\n\t\t\tforeach ( $plugins as $plugin ) {\n\t\t\t\t$deactivated[ $plugin ] = time();\n\t\t\t}\n\n\t\t\tif ( ! is_network_admin() ) {\n\t\t\t\tupdate_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ) );\n\t\t\t} else {\n\t\t\t\tupdate_site_option( 'recently_activated', $deactivated + (array) get_site_option( 'recently_activated' ) );\n\t\t\t}\n\n\t\t\twp_redirect( self_admin_url( \"plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s\" ) );\n\t\t\texit;\n\n\t\tcase 'delete-selected':\n\t\t\tif ( ! current_user_can( 'delete_plugins' ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to delete plugins for this site.' ) );\n\t\t\t}\n\n\t\t\tcheck_admin_referer( 'bulk-plugins' );\n\n\t\t\t// $_POST = from the plugin form; $_GET = from the FTP details screen.\n\t\t\t$plugins = isset( $_REQUEST['checked'] ) ? (array) wp_unslash( $_REQUEST['checked'] ) : array();\n\t\t\tif ( empty( $plugins ) ) {\n\t\t\t\twp_redirect( self_admin_url( \"plugins.php?plugin_status=$status&paged=$page&s=$s\" ) );\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t$plugins = array_filter( $plugins, 'is_plugin_inactive' ); // Do not allow to delete activated plugins.\n\t\t\tif ( empty( $plugins ) ) {\n\t\t\t\twp_redirect( self_admin_url( \"plugins.php?error=true&main=true&plugin_status=$status&paged=$page&s=$s\" ) );\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t// Bail on all if any paths are invalid.\n\t\t\t// validate_file() returns truthy for invalid files.\n\t\t\t$invalid_plugin_files = array_filter( $plugins, 'validate_file' );\n\t\t\tif ( $invalid_plugin_files ) {\n\t\t\t\twp_redirect( self_admin_url( \"plugins.php?plugin_status=$status&paged=$page&s=$s\" ) );\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\trequire ABSPATH . 'wp-admin/update.php';\n\n\t\t\t$parent_file = 'plugins.php';\n\n\t\t\tif ( ! isset( $_REQUEST['verify-delete'] ) ) {\n\t\t\t\twp_enqueue_script( 'jquery' );\n\t\t\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n\t\t\t\t?>\n\t\t\t\t<div class=\"wrap\">\n\t\t\t\t<?php\n\n\t\t\t\t$plugin_info              = array();\n\t\t\t\t$have_non_network_plugins = false;\n\n\t\t\t\tforeach ( (array) $plugins as $plugin ) {\n\t\t\t\t\t$plugin_slug = dirname( $plugin );\n\n\t\t\t\t\tif ( '.' === $plugin_slug ) {\n\t\t\t\t\t\t$data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );\n\t\t\t\t\t\tif ( $data ) {\n\t\t\t\t\t\t\t$plugin_info[ $plugin ]                     = $data;\n\t\t\t\t\t\t\t$plugin_info[ $plugin ]['is_uninstallable'] = is_uninstallable_plugin( $plugin );\n\t\t\t\t\t\t\tif ( ! $plugin_info[ $plugin ]['Network'] ) {\n\t\t\t\t\t\t\t\t$have_non_network_plugins = true;\n\t\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// Get plugins list from that folder.\n\t\t\t\t\t\t$folder_plugins = get_plugins( '/' . $plugin_slug );\n\t\t\t\t\t\tif ( $folder_plugins ) {\n\t\t\t\t\t\t\tforeach ( $folder_plugins as $plugin_file => $data ) {\n\t\t\t\t\t\t\t\t$plugin_info[ $plugin_file ]                     = _get_plugin_data_markup_translate( $plugin_file, $data );\n\t\t\t\t\t\t\t\t$plugin_info[ $plugin_file ]['is_uninstallable'] = is_uninstallable_plugin( $plugin );\n\t\t\t\t\t\t\t\tif ( ! $plugin_info[ $plugin_file ]['Network'] ) {\n\t\t\t\t\t\t\t\t\t$have_non_network_plugins = true;\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$plugins_to_delete = count( $plugin_info );\n\n\t\t\t\t?>\n\t\t\t\t<?php if ( 1 === $plugins_to_delete ) : ?>\n\t\t\t\t\t<h1><?php _e( 'Delete Plugin' ); ?></h1>\n\t\t\t\t\t<?php if ( $have_non_network_plugins && is_network_admin() ) : ?>\n\t\t\t\t\t\t<div class=\"error\"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'This plugin may be active on other sites in the network.' ); ?></p></div>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<p><?php _e( 'You are about to remove the following plugin:' ); ?></p>\n\t\t\t\t<?php else : ?>\n\t\t\t\t\t<h1><?php _e( 'Delete Plugins' ); ?></h1>\n\t\t\t\t\t<?php if ( $have_non_network_plugins && is_network_admin() ) : ?>\n\t\t\t\t\t\t<div class=\"error\"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'These plugins may be active on other sites in the network.' ); ?></p></div>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<p><?php _e( 'You are about to remove the following plugins:' ); ?></p>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<ul class=\"ul-disc\">\n\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t$data_to_delete = false;\n\n\t\t\t\t\t\tforeach ( $plugin_info as $plugin ) {\n\t\t\t\t\t\t\tif ( $plugin['is_uninstallable'] ) {\n\t\t\t\t\t\t\t\t/* translators: 1: Plugin name, 2: Plugin author. */\n\t\t\t\t\t\t\t\techo '<li>', sprintf( __( '%1$s by %2$s (will also <strong>delete its data</strong>)' ), '<strong>' . $plugin['Name'] . '</strong>', '<em>' . $plugin['AuthorName'] . '</em>' ), '</li>';\n\t\t\t\t\t\t\t\t$data_to_delete = true;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t/* translators: 1: Plugin name, 2: Plugin author. */\n\t\t\t\t\t\t\t\techo '<li>', sprintf( _x( '%1$s by %2$s', 'plugin' ), '<strong>' . $plugin['Name'] . '</strong>', '<em>' . $plugin['AuthorName'] ) . '</em>', '</li>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t?>\n\t\t\t\t\t</ul>\n\t\t\t\t<p>\n\t\t\t\t<?php\n\n\t\t\t\tif ( $data_to_delete ) {\n\t\t\t\t\t_e( 'Are you sure you want to delete these files and data?' );\n\t\t\t\t} else {\n\t\t\t\t\t_e( 'Are you sure you want to delete these files?' );\n\t\t\t\t}\n\n\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t\t<form method=\"post\" action=\"<?php echo esc_url( $_SERVER['REQUEST_URI'] ); ?>\" style=\"display:inline;\">\n\t\t\t\t\t<input type=\"hidden\" name=\"verify-delete\" value=\"1\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"delete-selected\" />\n\t\t\t\t\t<?php\n\n\t\t\t\t\tforeach ( (array) $plugins as $plugin ) {\n\t\t\t\t\t\techo '<input type=\"hidden\" name=\"checked[]\" value=\"' . esc_attr( $plugin ) . '\" />';\n\t\t\t\t\t}\n\n\t\t\t\t\t?>\n\t\t\t\t\t<?php wp_nonce_field( 'bulk-plugins' ); ?>\n\t\t\t\t\t<?php submit_button( $data_to_delete ? __( 'Yes, delete these files and data' ) : __( 'Yes, delete these files' ), '', 'submit', false ); ?>\n\t\t\t\t</form>\n\t\t\t\t<?php\n\n\t\t\t\t$referer = wp_get_referer();\n\n\t\t\t\t?>\n\t\t\t\t<form method=\"post\" action=\"<?php echo $referer ? esc_url( $referer ) : ''; ?>\" style=\"display:inline;\">\n\t\t\t\t\t<?php submit_button( __( 'No, return me to the plugin list' ), '', 'submit', false ); ?>\n\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\n\t\t\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t\t\t\texit;\n\t\t\t} else {\n\t\t\t\t$plugins_to_delete = count( $plugins );\n\t\t\t} // End if verify-delete.\n\n\t\t\t$delete_result = delete_plugins( $plugins );\n\n\t\t\t// Store the result in a cache rather than a URL param due to object type & length.\n\t\t\tset_transient( 'plugins_delete_result_' . $user_ID, $delete_result );\n\t\t\twp_redirect( self_admin_url( \"plugins.php?deleted=$plugins_to_delete&plugin_status=$status&paged=$page&s=$s\" ) );\n\t\t\texit;\n\t\tcase 'clear-recent-list':\n\t\t\tif ( ! is_network_admin() ) {\n\t\t\t\tupdate_option( 'recently_activated', array() );\n\t\t\t} else {\n\t\t\t\tupdate_site_option( 'recently_activated', array() );\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase 'resume':\n\t\t\tif ( is_multisite() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! current_user_can( 'resume_plugin', $plugin ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to resume this plugin.' ) );\n\t\t\t}\n\n\t\t\tcheck_admin_referer( 'resume-plugin_' . $plugin );\n\n\t\t\t$result = resume_plugin( $plugin, self_admin_url( \"plugins.php?error=resuming&plugin_status=$status&paged=$page&s=$s\" ) );\n\n\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\twp_die( $result );\n\t\t\t}\n\n\t\t\twp_redirect( self_admin_url( \"plugins.php?resume=true&plugin_status=$status&paged=$page&s=$s\" ) );\n\t\t\texit;\n\t\tcase 'enable-auto-update':\n\t\tcase 'disable-auto-update':\n\t\tcase 'enable-auto-update-selected':\n\t\tcase 'disable-auto-update-selected':\n\t\t\tif ( ! current_user_can( 'update_plugins' ) || ! wp_is_auto_update_enabled_for_type( 'plugin' ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to manage plugins automatic updates.' ) );\n\t\t\t}\n\n\t\t\tif ( is_multisite() && ! is_network_admin() ) {\n\t\t\t\twp_die( __( 'Please connect to your network admin to manage plugins automatic updates.' ) );\n\t\t\t}\n\n\t\t\t$redirect = self_admin_url( \"plugins.php?plugin_status={$status}&paged={$page}&s={$s}\" );\n\n\t\t\tif ( 'enable-auto-update' === $action || 'disable-auto-update' === $action ) {\n\t\t\t\tif ( empty( $plugin ) ) {\n\t\t\t\t\twp_redirect( $redirect );\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t\tcheck_admin_referer( 'updates' );\n\t\t\t} else {\n\t\t\t\tif ( empty( $_POST['checked'] ) ) {\n\t\t\t\t\twp_redirect( $redirect );\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t\tcheck_admin_referer( 'bulk-plugins' );\n\t\t\t}\n\n\t\t\t$auto_updates = (array) get_site_option( 'auto_update_plugins', array() );\n\n\t\t\tif ( 'enable-auto-update' === $action ) {\n\t\t\t\t$auto_updates[] = $plugin;\n\t\t\t\t$auto_updates   = array_unique( $auto_updates );\n\t\t\t\t$redirect       = add_query_arg( array( 'enabled-auto-update' => 'true' ), $redirect );\n\t\t\t} elseif ( 'disable-auto-update' === $action ) {\n\t\t\t\t$auto_updates = array_diff( $auto_updates, array( $plugin ) );\n\t\t\t\t$redirect     = add_query_arg( array( 'disabled-auto-update' => 'true' ), $redirect );\n\t\t\t} else {\n\t\t\t\t$plugins = (array) wp_unslash( $_POST['checked'] );\n\n\t\t\t\tif ( 'enable-auto-update-selected' === $action ) {\n\t\t\t\t\t$new_auto_updates = array_merge( $auto_updates, $plugins );\n\t\t\t\t\t$new_auto_updates = array_unique( $new_auto_updates );\n\t\t\t\t\t$query_args       = array( 'enabled-auto-update-multi' => 'true' );\n\t\t\t\t} else {\n\t\t\t\t\t$new_auto_updates = array_diff( $auto_updates, $plugins );\n\t\t\t\t\t$query_args       = array( 'disabled-auto-update-multi' => 'true' );\n\t\t\t\t}\n\n\t\t\t\t// Return early if all selected plugins already have auto-updates enabled or disabled.\n\t\t\t\t// Must use non-strict comparison, so that array order is not treated as significant.\n\t\t\t\tif ( $new_auto_updates == $auto_updates ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison\n\t\t\t\t\twp_redirect( $redirect );\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t\t$auto_updates = $new_auto_updates;\n\t\t\t\t$redirect     = add_query_arg( $query_args, $redirect );\n\t\t\t}\n\n\t\t\t/** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */\n\t\t\t$all_items = apply_filters( 'all_plugins', get_plugins() );\n\n\t\t\t// Remove plugins that don't exist or have been deleted since the option was last updated.\n\t\t\t$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) );\n\n\t\t\tupdate_site_option( 'auto_update_plugins', $auto_updates );\n\n\t\t\twp_redirect( $redirect );\n\t\t\texit;\n\t\tdefault:\n\t\t\tif ( isset( $_POST['checked'] ) ) {\n\t\t\t\tcheck_admin_referer( 'bulk-plugins' );\n\n\t\t\t\t$screen   = get_current_screen()->id;\n\t\t\t\t$sendback = wp_get_referer();\n\t\t\t\t$plugins  = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array();\n\n\t\t\t\t/** This action is documented in wp-admin/edit.php */\n\t\t\t\t$sendback = apply_filters( \"handle_bulk_actions-{$screen}\", $sendback, $action, $plugins ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t\t\t\twp_safe_redirect( $sendback );\n\t\t\t\texit;\n\t\t\t}\n\t\t\tbreak;\n\t}\n}\n\n$wp_list_table->prepare_items();\n\nwp_enqueue_script( 'plugin-install' );\nadd_thickbox();\n\nadd_screen_option( 'per_page', array( 'default' => 999 ) );\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t\t'<p>' . __( 'Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'The search for installed plugins will search for terms in their name, description, or author.' ) . ' <span id=\"live-search-desc\" class=\"hide-if-no-js\">' . __( 'The search results will be updated as you type.' ) . '</span></p>' .\n\t\t\t\t'<p>' . sprintf(\n\t\t\t\t\t/* translators: %s: WordPress Plugin Directory URL. */\n\t\t\t\t\t__( 'If you would like to see more plugins to choose from, click on the &#8220;Add New&#8221; button and you will be able to browse or search for additional plugins from the <a href=\"%s\">WordPress Plugin Directory</a>. Plugins in the WordPress Plugin Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!' ),\n\t\t\t\t\t__( 'https://wordpress.org/plugins/' )\n\t\t\t\t) . '</p>',\n\t)\n);\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'compatibility-problems',\n\t\t'title'   => __( 'Troubleshooting' ),\n\t\t'content' =>\n\t\t\t\t'<p>' . __( 'Most of the time, plugins play nicely with the core of WordPress and with other plugins. Sometimes, though, a plugin&#8217;s code will get in the way of another plugin, causing compatibility issues. If your site starts doing strange things, this may be the problem. Try deactivating all your plugins and re-activating them in various combinations until you isolate which one(s) caused the issue.' ) . '</p>' .\n\t\t\t\t'<p>' . sprintf(\n\t\t\t\t\t/* translators: %s: WP_PLUGIN_DIR constant value. */\n\t\t\t\t\t__( 'If something goes wrong with a plugin and you can&#8217;t use WordPress, delete or rename that file in the %s directory and it will be automatically deactivated.' ),\n\t\t\t\t\t'<code>' . WP_PLUGIN_DIR . '</code>'\n\t\t\t\t) . '</p>',\n\t)\n);\n\n$help_sidebar_autoupdates = '';\n\nif ( current_user_can( 'update_plugins' ) && wp_is_auto_update_enabled_for_type( 'plugin' ) ) {\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'plugins-themes-auto-updates',\n\t\t\t'title'   => __( 'Auto-updates' ),\n\t\t\t'content' =>\n\t\t\t\t\t'<p>' . __( 'Auto-updates can be enabled or disabled for each individual plugin. Plugins with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates depends on the WP-Cron task scheduling system.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'Auto-updates are only available for plugins recognized by WordPress.org, or that include a compatible update system.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '</p>',\n\t\t)\n\t);\n\n\t$help_sidebar_autoupdates = '<p>' . __( '<a href=\"https://wordpress.org/support/article/plugins-themes-auto-updates/\">Learn more: Auto-updates documentation</a>' ) . '</p>';\n}\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/managing-plugins/\">Documentation on Managing Plugins</a>' ) . '</p>' .\n\t$help_sidebar_autoupdates .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nget_current_screen()->set_screen_reader_content(\n\tarray(\n\t\t'heading_views'      => __( 'Filter plugins list' ),\n\t\t'heading_pagination' => __( 'Plugins list navigation' ),\n\t\t'heading_list'       => __( 'Plugins list' ),\n\t)\n);\n\n$title       = __( 'Plugins' );\n$parent_file = 'plugins.php';\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n$invalid = validate_active_plugins();\nif ( ! empty( $invalid ) ) {\n\tforeach ( $invalid as $plugin_file => $error ) {\n\t\techo '<div id=\"message\" class=\"error\"><p>';\n\t\tprintf(\n\t\t\t/* translators: 1: Plugin file, 2: Error message. */\n\t\t\t__( 'The plugin %1$s has been deactivated due to an error: %2$s' ),\n\t\t\t'<code>' . esc_html( $plugin_file ) . '</code>',\n\t\t\t$error->get_error_message()\n\t\t);\n\t\techo '</p></div>';\n\t}\n}\n\nif ( isset( $_GET['error'] ) ) :\n\n\tif ( isset( $_GET['main'] ) ) {\n\t\t$errmsg = __( 'You cannot delete a plugin while it is active on the main site.' );\n\t} elseif ( isset( $_GET['charsout'] ) ) {\n\t\t$errmsg = sprintf(\n\t\t\t/* translators: %d: Number of characters. */\n\t\t\t_n(\n\t\t\t\t'The plugin generated %d character of <strong>unexpected output</strong> during activation.',\n\t\t\t\t'The plugin generated %d characters of <strong>unexpected output</strong> during activation.',\n\t\t\t\t$_GET['charsout']\n\t\t\t),\n\t\t\t$_GET['charsout']\n\t\t);\n\t\t$errmsg .= ' ' . __( 'If you notice &#8220;headers already sent&#8221; messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.' );\n\t} elseif ( 'resuming' === $_GET['error'] ) {\n\t\t$errmsg = __( 'Plugin could not be resumed because it triggered a <strong>fatal error</strong>.' );\n\t} else {\n\t\t$errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' );\n\t}\n\n\t?>\n\t<div id=\"message\" class=\"error\"><p><?php echo $errmsg; ?></p>\n\t<?php\n\n\tif ( ! isset( $_GET['main'] ) && ! isset( $_GET['charsout'] ) && wp_verify_nonce( $_GET['_error_nonce'], 'plugin-activation-error_' . $plugin ) ) {\n\t\t$iframe_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'action'   => 'error_scrape',\n\t\t\t\t'plugin'   => urlencode( $plugin ),\n\t\t\t\t'_wpnonce' => urlencode( $_GET['_error_nonce'] ),\n\t\t\t),\n\t\t\tadmin_url( 'plugins.php' )\n\t\t);\n\n\t\t?>\n\t\t<iframe style=\"border:0\" width=\"100%\" height=\"70px\" src=\"<?php echo esc_url( $iframe_url ); ?>\"></iframe>\n\t\t<?php\n\t}\n\n\t?>\n\t</div>\n\t<?php\nelseif ( isset( $_GET['deleted'] ) ) :\n\t$delete_result = get_transient( 'plugins_delete_result_' . $user_ID );\n\t// Delete it once we're done.\n\tdelete_transient( 'plugins_delete_result_' . $user_ID );\n\n\tif ( is_wp_error( $delete_result ) ) :\n\t\t?>\n\t\t<div id=\"message\" class=\"error notice is-dismissible\">\n\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: Error message. */\n\t\t\t\t\t__( 'Plugin could not be deleted due to an error: %s' ),\n\t\t\t\t\t$delete_result->get_error_message()\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php else : ?>\n\t\t<div id=\"message\" class=\"updated notice is-dismissible\">\n\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\tif ( 1 === (int) $_GET['deleted'] ) {\n\t\t\t\t\t_e( 'The selected plugin has been deleted.' );\n\t\t\t\t} else {\n\t\t\t\t\t_e( 'The selected plugins have been deleted.' );\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</p>\n\t\t</div>\n\t<?php endif; ?>\n<?php elseif ( isset( $_GET['activate'] ) ) : ?>\n\t<div id=\"message\" class=\"updated notice is-dismissible\"><p><?php _e( 'Plugin activated.' ); ?></p></div>\n<?php elseif ( isset( $_GET['activate-multi'] ) ) : ?>\n\t<div id=\"message\" class=\"updated notice is-dismissible\"><p><?php _e( 'Selected plugins activated.' ); ?></p></div>\n<?php elseif ( isset( $_GET['deactivate'] ) ) : ?>\n\t<div id=\"message\" class=\"updated notice is-dismissible\"><p><?php _e( 'Plugin deactivated.' ); ?></p></div>\n<?php elseif ( isset( $_GET['deactivate-multi'] ) ) : ?>\n\t<div id=\"message\" class=\"updated notice is-dismissible\"><p><?php _e( 'Selected plugins deactivated.' ); ?></p></div>\n<?php elseif ( 'update-selected' === $action ) : ?>\n\t<div id=\"message\" class=\"updated notice is-dismissible\"><p><?php _e( 'All selected plugins are up to date.' ); ?></p></div>\n<?php elseif ( isset( $_GET['resume'] ) ) : ?>\n\t<div id=\"message\" class=\"updated notice is-dismissible\"><p><?php _e( 'Plugin resumed.' ); ?></p></div>\n<?php elseif ( isset( $_GET['enabled-auto-update'] ) ) : ?>\n\t<div id=\"message\" class=\"updated notice is-dismissible\"><p><?php _e( 'Plugin will be auto-updated.' ); ?></p></div>\n<?php elseif ( isset( $_GET['disabled-auto-update'] ) ) : ?>\n\t<div id=\"message\" class=\"updated notice is-dismissible\"><p><?php _e( 'Plugin will no longer be auto-updated.' ); ?></p></div>\n<?php elseif ( isset( $_GET['enabled-auto-update-multi'] ) ) : ?>\n\t<div id=\"message\" class=\"updated notice is-dismissible\"><p><?php _e( 'Selected plugins will be auto-updated.' ); ?></p></div>\n<?php elseif ( isset( $_GET['disabled-auto-update-multi'] ) ) : ?>\n\t<div id=\"message\" class=\"updated notice is-dismissible\"><p><?php _e( 'Selected plugins will no longer be auto-updated.' ); ?></p></div>\n<?php endif; ?>\n\n<div class=\"wrap\">\n<h1 class=\"wp-heading-inline\">\n<?php\necho esc_html( $title );\n?>\n</h1>\n\n<?php\nif ( ( ! is_multisite() || is_network_admin() ) && current_user_can( 'install_plugins' ) ) {\n\t?>\n\t<a href=\"<?php echo self_admin_url( 'plugin-install.php' ); ?>\" class=\"page-title-action\"><?php echo esc_html_x( 'Add New', 'plugin' ); ?></a>\n\t<?php\n}\n\nif ( strlen( $s ) ) {\n\t/* translators: %s: Search query. */\n\tprintf( '<span class=\"subtitle\">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( urldecode( $s ) ) );\n}\n?>\n\n<hr class=\"wp-header-end\">\n\n<?php\n/**\n * Fires before the plugins list table is rendered.\n *\n * This hook also fires before the plugins list table is rendered in the Network Admin.\n *\n * Please note: The 'active' portion of the hook name does not refer to whether the current\n * view is for active plugins, but rather all plugins actively-installed.\n *\n * @since 3.0.0\n *\n * @param array[] $plugins_all An array of arrays containing information on all installed plugins.\n */\ndo_action( 'pre_current_active_plugins', $plugins['all'] );\n?>\n\n<?php $wp_list_table->views(); ?>\n\n<form class=\"search-form search-plugins\" method=\"get\">\n<?php $wp_list_table->search_box( __( 'Search Installed Plugins' ), 'plugin' ); ?>\n</form>\n\n<form method=\"post\" id=\"bulk-action-form\">\n\n<input type=\"hidden\" name=\"plugin_status\" value=\"<?php echo esc_attr( $status ); ?>\" />\n<input type=\"hidden\" name=\"paged\" value=\"<?php echo esc_attr( $page ); ?>\" />\n\n<?php $wp_list_table->display(); ?>\n</form>\n\n\t<span class=\"spinner\"></span>\n</div>\n\n<?php\nwp_print_request_filesystem_credentials_modal();\nwp_print_admin_notice_templates();\nwp_print_update_row_templates();\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 776}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * New Post Administration Screen.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n/**\n * @global string  $post_type\n * @global object  $post_type_object\n * @global WP_Post $post             Global post object.\n */\nglobal $post_type, $post_type_object, $post;\n\nif ( ! isset( $_GET['post_type'] ) ) {\n\t$post_type = 'post';\n} elseif ( in_array( $_GET['post_type'], get_post_types( array( 'show_ui' => true ) ), true ) ) {\n\t$post_type = $_GET['post_type'];\n} else {\n\twp_die( __( 'Invalid post type.' ) );\n}\n$post_type_object = get_post_type_object( $post_type );\n\nif ( 'post' === $post_type ) {\n\t$parent_file  = 'edit.php';\n\t$submenu_file = 'post-new.php';\n} elseif ( 'attachment' === $post_type ) {\n\tif ( wp_redirect( admin_url( 'media-new.php' ) ) ) {\n\t\texit;\n\t}\n} else {\n\t$submenu_file = \"post-new.php?post_type=$post_type\";\n\tif ( isset( $post_type_object ) && $post_type_object->show_in_menu && true !== $post_type_object->show_in_menu ) {\n\t\t$parent_file = $post_type_object->show_in_menu;\n\t\t// What if there isn't a post-new.php item for this post type?\n\t\tif ( ! isset( $_registered_pages[ get_plugin_page_hookname( \"post-new.php?post_type=$post_type\", $post_type_object->show_in_menu ) ] ) ) {\n\t\t\tif ( isset( $_registered_pages[ get_plugin_page_hookname( \"edit.php?post_type=$post_type\", $post_type_object->show_in_menu ) ] ) ) {\n\t\t\t\t// Fall back to edit.php for that post type, if it exists.\n\t\t\t\t$submenu_file = \"edit.php?post_type=$post_type\";\n\t\t\t} else {\n\t\t\t\t// Otherwise, give up and highlight the parent.\n\t\t\t\t$submenu_file = $parent_file;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$parent_file = \"edit.php?post_type=$post_type\";\n\t}\n}\n\n$title = $post_type_object->labels->add_new_item;\n\n$editing = true;\n\nif ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) ) {\n\twp_die(\n\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t'<p>' . __( 'Sorry, you are not allowed to create posts as this user.' ) . '</p>',\n\t\t403\n\t);\n}\n\n$post    = get_default_post_to_edit( $post_type, true );\n$post_ID = $post->ID;\n\n/** This filter is documented in wp-admin/post.php */\nif ( apply_filters( 'replace_editor', false, $post ) !== true ) {\n\tif ( use_block_editor_for_post( $post ) ) {\n\t\trequire ABSPATH . 'wp-admin/edit-form-blocks.php';\n\t} else {\n\t\twp_enqueue_script( 'autosave' );\n\t\trequire ABSPATH . 'wp-admin/edit-form-advanced.php';\n\t}\n} else {\n\t// Flag that we're not loading the block editor.\n\t$current_screen = get_current_screen();\n\t$current_screen->is_block_editor( false );\n}\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 84}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit post administration panel.\n *\n * Manage Post actions: post, edit, delete, etc.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n$parent_file  = 'edit.php';\n$submenu_file = 'edit.php';\n\nwp_reset_vars( array( 'action' ) );\n\nif ( isset( $_GET['post'] ) && isset( $_POST['post_ID'] ) && (int) $_GET['post'] !== (int) $_POST['post_ID'] ) {\n\twp_die( __( 'A post ID mismatch has been detected.' ), __( 'Sorry, you are not allowed to edit this item.' ), 400 );\n} elseif ( isset( $_GET['post'] ) ) {\n\t$post_id = (int) $_GET['post'];\n} elseif ( isset( $_POST['post_ID'] ) ) {\n\t$post_id = (int) $_POST['post_ID'];\n} else {\n\t$post_id = 0;\n}\n$post_ID = $post_id;\n\n/**\n * @global string  $post_type\n * @global object  $post_type_object\n * @global WP_Post $post             Global post object.\n */\nglobal $post_type, $post_type_object, $post;\n\nif ( $post_id ) {\n\t$post = get_post( $post_id );\n}\n\nif ( $post ) {\n\t$post_type        = $post->post_type;\n\t$post_type_object = get_post_type_object( $post_type );\n}\n\nif ( isset( $_POST['post_type'] ) && $post && $post_type !== $_POST['post_type'] ) {\n\twp_die( __( 'A post type mismatch has been detected.' ), __( 'Sorry, you are not allowed to edit this item.' ), 400 );\n}\n\nif ( isset( $_POST['deletepost'] ) ) {\n\t$action = 'delete';\n} elseif ( isset( $_POST['wp-preview'] ) && 'dopreview' === $_POST['wp-preview'] ) {\n\t$action = 'preview';\n}\n\n$sendback = wp_get_referer();\nif ( ! $sendback ||\n\tfalse !== strpos( $sendback, 'post.php' ) ||\n\tfalse !== strpos( $sendback, 'post-new.php' ) ) {\n\tif ( 'attachment' === $post_type ) {\n\t\t$sendback = admin_url( 'upload.php' );\n\t} else {\n\t\t$sendback = admin_url( 'edit.php' );\n\t\tif ( ! empty( $post_type ) ) {\n\t\t\t$sendback = add_query_arg( 'post_type', $post_type, $sendback );\n\t\t}\n\t}\n} else {\n\t$sendback = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'ids' ), $sendback );\n}\n\nswitch ( $action ) {\n\tcase 'post-quickdraft-save':\n\t\t// Check nonce and capabilities.\n\t\t$nonce     = $_REQUEST['_wpnonce'];\n\t\t$error_msg = false;\n\n\t\t// For output of the Quick Draft dashboard widget.\n\t\trequire_once ABSPATH . 'wp-admin/includes/dashboard.php';\n\n\t\tif ( ! wp_verify_nonce( $nonce, 'add-post' ) ) {\n\t\t\t$error_msg = __( 'Unable to submit this form, please refresh and try again.' );\n\t\t}\n\n\t\tif ( ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {\n\t\t\texit;\n\t\t}\n\n\t\tif ( $error_msg ) {\n\t\t\treturn wp_dashboard_quick_press( $error_msg );\n\t\t}\n\n\t\t$post = get_post( $_REQUEST['post_ID'] );\n\t\tcheck_admin_referer( 'add-' . $post->post_type );\n\n\t\t$_POST['comment_status'] = get_default_comment_status( $post->post_type );\n\t\t$_POST['ping_status']    = get_default_comment_status( $post->post_type, 'pingback' );\n\n\t\t// Wrap Quick Draft content in the Paragraph block.\n\t\tif ( false === strpos( $_POST['content'], '<!-- wp:paragraph -->' ) ) {\n\t\t\t$_POST['content'] = sprintf(\n\t\t\t\t'<!-- wp:paragraph -->%s<!-- /wp:paragraph -->',\n\t\t\t\tstr_replace( array( \"\\r\\n\", \"\\r\", \"\\n\" ), '<br />', $_POST['content'] )\n\t\t\t);\n\t\t}\n\n\t\tedit_post();\n\t\twp_dashboard_quick_press();\n\t\texit;\n\n\tcase 'postajaxpost':\n\tcase 'post':\n\t\tcheck_admin_referer( 'add-' . $post_type );\n\t\t$post_id = 'postajaxpost' === $action ? edit_post() : write_post();\n\t\tredirect_post( $post_id );\n\t\texit;\n\n\tcase 'edit':\n\t\t$editing = true;\n\n\t\tif ( empty( $post_id ) ) {\n\t\t\twp_redirect( admin_url( 'post.php' ) );\n\t\t\texit;\n\t\t}\n\n\t\tif ( ! $post ) {\n\t\t\twp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );\n\t\t}\n\n\t\tif ( ! $post_type_object ) {\n\t\t\twp_die( __( 'Invalid post type.' ) );\n\t\t}\n\n\t\tif ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ), true ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to edit this item.' ) );\n\t\t}\n\n\t\tif ( 'trash' === $post->post_status ) {\n\t\t\twp_die( __( 'You can&#8217;t edit this item because it is in the Trash. Please restore it and try again.' ) );\n\t\t}\n\n\t\tif ( ! empty( $_GET['get-post-lock'] ) ) {\n\t\t\tcheck_admin_referer( 'lock-post_' . $post_id );\n\t\t\twp_set_post_lock( $post_id );\n\t\t\twp_redirect( get_edit_post_link( $post_id, 'url' ) );\n\t\t\texit;\n\t\t}\n\n\t\t$post_type = $post->post_type;\n\t\tif ( 'post' === $post_type ) {\n\t\t\t$parent_file   = 'edit.php';\n\t\t\t$submenu_file  = 'edit.php';\n\t\t\t$post_new_file = 'post-new.php';\n\t\t} elseif ( 'attachment' === $post_type ) {\n\t\t\t$parent_file   = 'upload.php';\n\t\t\t$submenu_file  = 'upload.php';\n\t\t\t$post_new_file = 'media-new.php';\n\t\t} else {\n\t\t\tif ( isset( $post_type_object ) && $post_type_object->show_in_menu && true !== $post_type_object->show_in_menu ) {\n\t\t\t\t$parent_file = $post_type_object->show_in_menu;\n\t\t\t} else {\n\t\t\t\t$parent_file = \"edit.php?post_type=$post_type\";\n\t\t\t}\n\t\t\t$submenu_file  = \"edit.php?post_type=$post_type\";\n\t\t\t$post_new_file = \"post-new.php?post_type=$post_type\";\n\t\t}\n\n\t\t$title = $post_type_object->labels->edit_item;\n\n\t\t/**\n\t\t * Allows replacement of the editor.\n\t\t *\n\t\t * @since 4.9.0\n\t\t *\n\t\t * @param bool    $replace Whether to replace the editor. Default false.\n\t\t * @param WP_Post $post    Post object.\n\t\t */\n\t\tif ( true === apply_filters( 'replace_editor', false, $post ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif ( use_block_editor_for_post( $post ) ) {\n\t\t\trequire ABSPATH . 'wp-admin/edit-form-blocks.php';\n\t\t\tbreak;\n\t\t}\n\n\t\tif ( ! wp_check_post_lock( $post->ID ) ) {\n\t\t\t$active_post_lock = wp_set_post_lock( $post->ID );\n\n\t\t\tif ( 'attachment' !== $post_type ) {\n\t\t\t\twp_enqueue_script( 'autosave' );\n\t\t\t}\n\t\t}\n\n\t\t$post = get_post( $post_id, OBJECT, 'edit' );\n\n\t\tif ( post_type_supports( $post_type, 'comments' ) ) {\n\t\t\twp_enqueue_script( 'admin-comments' );\n\t\t\tenqueue_comment_hotkeys_js();\n\t\t}\n\n\t\trequire ABSPATH . 'wp-admin/edit-form-advanced.php';\n\n\t\tbreak;\n\n\tcase 'editattachment':\n\t\tcheck_admin_referer( 'update-post_' . $post_id );\n\n\t\t// Don't let these be changed.\n\t\tunset( $_POST['guid'] );\n\t\t$_POST['post_type'] = 'attachment';\n\n\t\t// Update the thumbnail filename.\n\t\t$newmeta          = wp_get_attachment_metadata( $post_id, true );\n\t\t$newmeta['thumb'] = wp_basename( $_POST['thumb'] );\n\n\t\twp_update_attachment_metadata( $post_id, $newmeta );\n\n\t\t// Intentional fall-through to trigger the edit_post() call.\n\tcase 'editpost':\n\t\tcheck_admin_referer( 'update-post_' . $post_id );\n\n\t\t$post_id = edit_post();\n\n\t\t// Session cookie flag that the post was saved.\n\t\tif ( isset( $_COOKIE['wp-saving-post'] ) && $_COOKIE['wp-saving-post'] === $post_id . '-check' ) {\n\t\t\tsetcookie( 'wp-saving-post', $post_id . '-saved', time() + DAY_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, is_ssl() );\n\t\t}\n\n\t\tredirect_post( $post_id ); // Send user on their way while we keep working.\n\n\t\texit;\n\n\tcase 'trash':\n\t\tcheck_admin_referer( 'trash-post_' . $post_id );\n\n\t\tif ( ! $post ) {\n\t\t\twp_die( __( 'The item you are trying to move to the Trash no longer exists.' ) );\n\t\t}\n\n\t\tif ( ! $post_type_object ) {\n\t\t\twp_die( __( 'Invalid post type.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'delete_post', $post_id ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) );\n\t\t}\n\n\t\t$user_id = wp_check_post_lock( $post_id );\n\t\tif ( $user_id ) {\n\t\t\t$user = get_userdata( $user_id );\n\t\t\t/* translators: %s: User's display name. */\n\t\t\twp_die( sprintf( __( 'You cannot move this item to the Trash. %s is currently editing.' ), $user->display_name ) );\n\t\t}\n\n\t\tif ( ! wp_trash_post( $post_id ) ) {\n\t\t\twp_die( __( 'Error in moving the item to Trash.' ) );\n\t\t}\n\n\t\twp_redirect(\n\t\t\tadd_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'trashed' => 1,\n\t\t\t\t\t'ids'     => $post_id,\n\t\t\t\t),\n\t\t\t\t$sendback\n\t\t\t)\n\t\t);\n\t\texit;\n\n\tcase 'untrash':\n\t\tcheck_admin_referer( 'untrash-post_' . $post_id );\n\n\t\tif ( ! $post ) {\n\t\t\twp_die( __( 'The item you are trying to restore from the Trash no longer exists.' ) );\n\t\t}\n\n\t\tif ( ! $post_type_object ) {\n\t\t\twp_die( __( 'Invalid post type.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'delete_post', $post_id ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to restore this item from the Trash.' ) );\n\t\t}\n\n\t\tif ( ! wp_untrash_post( $post_id ) ) {\n\t\t\twp_die( __( 'Error in restoring the item from Trash.' ) );\n\t\t}\n\n\t\twp_redirect( add_query_arg( 'untrashed', 1, $sendback ) );\n\t\texit;\n\n\tcase 'delete':\n\t\tcheck_admin_referer( 'delete-post_' . $post_id );\n\n\t\tif ( ! $post ) {\n\t\t\twp_die( __( 'This item has already been deleted.' ) );\n\t\t}\n\n\t\tif ( ! $post_type_object ) {\n\t\t\twp_die( __( 'Invalid post type.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'delete_post', $post_id ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to delete this item.' ) );\n\t\t}\n\n\t\tif ( 'attachment' === $post->post_type ) {\n\t\t\t$force = ( ! MEDIA_TRASH );\n\t\t\tif ( ! wp_delete_attachment( $post_id, $force ) ) {\n\t\t\t\twp_die( __( 'Error in deleting the attachment.' ) );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( ! wp_delete_post( $post_id, true ) ) {\n\t\t\t\twp_die( __( 'Error in deleting the item.' ) );\n\t\t\t}\n\t\t}\n\n\t\twp_redirect( add_query_arg( 'deleted', 1, $sendback ) );\n\t\texit;\n\n\tcase 'preview':\n\t\tcheck_admin_referer( 'update-post_' . $post_id );\n\n\t\t$url = post_preview();\n\n\t\twp_redirect( $url );\n\t\texit;\n\n\tcase 'toggle-custom-fields':\n\t\tcheck_admin_referer( 'toggle-custom-fields' );\n\n\t\t$current_user_id = get_current_user_id();\n\t\tif ( $current_user_id ) {\n\t\t\t$enable_custom_fields = (bool) get_user_meta( $current_user_id, 'enable_custom_fields', true );\n\t\t\tupdate_user_meta( $current_user_id, 'enable_custom_fields', ! $enable_custom_fields );\n\t\t}\n\n\t\twp_safe_redirect( wp_get_referer() );\n\t\texit;\n\n\tdefault:\n\t\t/**\n\t\t * Fires for a given custom post action request.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$action`, refers to the custom post action.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param int $post_id Post ID sent with the request.\n\t\t */\n\t\tdo_action( \"post_action_{$action}\", $post_id );\n\n\t\twp_redirect( admin_url( 'edit.php' ) );\n\t\texit;\n} // End switch.\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 363}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Press This Display and Handler.\n *\n * @package WordPress\n * @subpackage Press_This\n */\n\ndefine( 'IFRAME_REQUEST', true );\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nfunction wp_load_press_this() {\n\t$plugin_slug = 'press-this';\n\t$plugin_file = 'press-this/press-this-plugin.php';\n\n\tif ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {\n\t\twp_die(\n\t\t\t__( 'Sorry, you are not allowed to create posts as this user.' ),\n\t\t\t__( 'You need a higher level of permission.' ),\n\t\t\t403\n\t\t);\n\t} elseif ( is_plugin_active( $plugin_file ) ) {\n\t\tinclude WP_PLUGIN_DIR . '/press-this/class-wp-press-this-plugin.php';\n\t\t$wp_press_this = new WP_Press_This_Plugin();\n\t\t$wp_press_this->html();\n\t} elseif ( current_user_can( 'activate_plugins' ) ) {\n\t\tif ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_file ) ) {\n\t\t\t$url    = wp_nonce_url(\n\t\t\t\tadd_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'action' => 'activate',\n\t\t\t\t\t\t'plugin' => $plugin_file,\n\t\t\t\t\t\t'from'   => 'press-this',\n\t\t\t\t\t),\n\t\t\t\t\tadmin_url( 'plugins.php' )\n\t\t\t\t),\n\t\t\t\t'activate-plugin_' . $plugin_file\n\t\t\t);\n\t\t\t$action = sprintf(\n\t\t\t\t'<a href=\"%1$s\" aria-label=\"%2$s\">%2$s</a>',\n\t\t\t\tesc_url( $url ),\n\t\t\t\t__( 'Activate Press This' )\n\t\t\t);\n\t\t} else {\n\t\t\tif ( is_main_site() ) {\n\t\t\t\t$url    = wp_nonce_url(\n\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'action' => 'install-plugin',\n\t\t\t\t\t\t\t'plugin' => $plugin_slug,\n\t\t\t\t\t\t\t'from'   => 'press-this',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tself_admin_url( 'update.php' )\n\t\t\t\t\t),\n\t\t\t\t\t'install-plugin_' . $plugin_slug\n\t\t\t\t);\n\t\t\t\t$action = sprintf(\n\t\t\t\t\t'<a href=\"%1$s\" class=\"install-now\" data-slug=\"%2$s\" data-name=\"%2$s\" aria-label=\"%3$s\">%3$s</a>',\n\t\t\t\t\tesc_url( $url ),\n\t\t\t\t\tesc_attr( $plugin_slug ),\n\t\t\t\t\t__( 'Install Now' )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$action = sprintf(\n\t\t\t\t\t/* translators: %s: URL to Press This bookmarklet on the main site. */\n\t\t\t\t\t__( 'Press This is not installed. Please install Press This from <a href=\"%s\">the main site</a>.' ),\n\t\t\t\t\tget_admin_url( get_current_network_id(), 'press-this.php' )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\twp_die(\n\t\t\t__( 'The Press This plugin is required.' ) . '<br />' . $action,\n\t\t\t__( 'Installation Required' ),\n\t\t\t200\n\t\t);\n\t} else {\n\t\twp_die(\n\t\t\t__( 'Press This is not available. Please contact your site administrator.' ),\n\t\t\t__( 'Installation Required' ),\n\t\t\t200\n\t\t);\n\t}\n}\n\nwp_load_press_this();\n", "num_lines": 88}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Privacy Policy Guide Screen.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'manage_privacy_options' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) );\n}\n\nif ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {\n\tinclude_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php';\n}\n\n$title = __( 'Privacy Policy Guide' );\n\nwp_enqueue_script( 'privacy-tools' );\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n?>\n<div class=\"wrap\">\n\t<h1><?php echo esc_html( $title ); ?></h1>\n\n\t<div class=\"wp-privacy-policy-guide\">\n\t\t<?php WP_Privacy_Policy_Content::privacy_policy_guide(); ?>\n\t</div>\n</div>\n<?php\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 37}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Privacy administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n$title = __( 'Privacy' );\n\nlist( $display_version ) = explode( '-', get_bloginfo( 'version' ) );\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n<div class=\"wrap about__container\">\n\n\t<div class=\"about__header\">\n\t\t<div class=\"about__header-text\">\n\t\t\t<?php _e( 'Speed. Search. Security.' ); ?>\n\t\t</div>\n\n\t\t<div class=\"about__header-title\">\n\t\t\t<p>\n\t\t\t\t<?php _e( 'WordPress' ); ?>\n\t\t\t\t<span><?php echo $display_version; ?></span>\n\t\t\t</p>\n\t\t</div>\n\n\t\t<nav class=\"about__header-navigation nav-tab-wrapper wp-clearfix\" aria-label=\"<?php esc_attr_e( 'Secondary menu' ); ?>\">\n\t\t\t<a href=\"about.php\" class=\"nav-tab\"><?php _e( 'What&#8217;s New' ); ?></a>\n\t\t\t<a href=\"credits.php\" class=\"nav-tab\"><?php _e( 'Credits' ); ?></a>\n\t\t\t<a href=\"freedoms.php\" class=\"nav-tab\"><?php _e( 'Freedoms' ); ?></a>\n\t\t\t<a href=\"privacy.php\" class=\"nav-tab nav-tab-active\" aria-current=\"page\"><?php _e( 'Privacy' ); ?></a>\n\t\t</nav>\n\t</div>\n\n\t<div class=\"about__section\">\n\t\t<div class=\"column\">\n\t\t\t<h1><?php _e( 'Privacy' ); ?></h1>\n\n\t\t\t<p><?php _e( 'From time to time, your WordPress site may send data to WordPress.org &#8212; including, but not limited to &#8212; the version of WordPress you are using, and a list of installed plugins and themes.' ); ?></p>\n\n\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: https://wordpress.org/about/stats/ */\n\t\t\t\t\t__( 'This data is used to provide general enhancements to WordPress, which includes helping to protect your site by finding and automatically installing new updates. It is also used to calculate statistics, such as those shown on the <a href=\"%s\">WordPress.org stats page</a>.' ),\n\t\t\t\t\t__( 'https://wordpress.org/about/stats/' )\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</p>\n\n\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: https://wordpress.org/about/privacy/ */\n\t\t\t\t\t__( 'We take privacy and transparency very seriously. To learn more about what data we collect, and how we use it, please visit <a href=\"%s\">WordPress.org/about/privacy</a>.' ),\n\t\t\t\t\t__( 'https://wordpress.org/about/privacy/' )\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</p>\n\t\t</div>\n\t</div>\n\n</div>\n<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 70}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * User Profile Administration Screen.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * This is a profile page.\n *\n * @since 2.5.0\n * @var bool\n */\ndefine( 'IS_PROFILE_PAGE', true );\n\n/** Load User Editing Page */\nrequire_once __DIR__ . '/user-edit.php';\n", "num_lines": 19}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Revisions administration panel\n *\n * Requires wp-admin/includes/revision.php.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 2.6.0\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/includes/revision.php';\n\n/**\n * @global int    $revision Optional. The revision ID.\n * @global string $action   The action to take.\n *                          Accepts 'restore', 'view' or 'edit'.\n * @global int    $from     The revision to compare from.\n * @global int    $to       Optional, required if revision missing. The revision to compare to.\n */\nwp_reset_vars( array( 'revision', 'action', 'from', 'to' ) );\n\n$revision_id = absint( $revision );\n\n$from = is_numeric( $from ) ? absint( $from ) : null;\nif ( ! $revision_id ) {\n\t$revision_id = absint( $to );\n}\n$redirect = 'edit.php';\n\nswitch ( $action ) {\n\tcase 'restore':\n\t\t$revision = wp_get_post_revision( $revision_id );\n\t\tif ( ! $revision ) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $revision->post_parent ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\t$post = get_post( $revision->post_parent );\n\t\tif ( ! $post ) {\n\t\t\tbreak;\n\t\t}\n\n\t\t// Don't restore if revisions are disabled and this is not an autosave.\n\t\tif ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) {\n\t\t\t$redirect = 'edit.php?post_type=' . $post->post_type;\n\t\t\tbreak;\n\t\t}\n\n\t\t// Don't restore if the post is locked.\n\t\tif ( wp_check_post_lock( $post->ID ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\tcheck_admin_referer( \"restore-post_{$revision->ID}\" );\n\n\t\t/*\n\t\t * Ensure the global $post remains the same after revision is restored.\n\t\t * Because wp_insert_post() and wp_transition_post_status() are called\n\t\t * during the process, plugins can unexpectedly modify $post.\n\t\t */\n\t\t$backup_global_post = clone $post;\n\n\t\twp_restore_post_revision( $revision->ID );\n\n\t\t// Restore the global $post as it was before.\n\t\t$post = $backup_global_post;\n\n\t\t$redirect = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'message'  => 5,\n\t\t\t\t'revision' => $revision->ID,\n\t\t\t),\n\t\t\tget_edit_post_link( $post->ID, 'url' )\n\t\t);\n\t\tbreak;\n\tcase 'view':\n\tcase 'edit':\n\tdefault:\n\t\t$revision = wp_get_post_revision( $revision_id );\n\t\tif ( ! $revision ) {\n\t\t\tbreak;\n\t\t}\n\n\t\t$post = get_post( $revision->post_parent );\n\t\tif ( ! $post ) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif ( ! current_user_can( 'read_post', $revision->ID ) || ! current_user_can( 'edit_post', $revision->post_parent ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\t// Bail if revisions are disabled and this is not an autosave.\n\t\tif ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) {\n\t\t\t$redirect = 'edit.php?post_type=' . $post->post_type;\n\t\t\tbreak;\n\t\t}\n\n\t\t$post_edit_link = get_edit_post_link();\n\t\t$post_title     = '<a href=\"' . $post_edit_link . '\">' . _draft_or_post_title() . '</a>';\n\t\t/* translators: %s: Post title. */\n\t\t$h1             = sprintf( __( 'Compare Revisions of &#8220;%s&#8221;' ), $post_title );\n\t\t$return_to_post = '<a href=\"' . $post_edit_link . '\">' . __( '&larr; Return to editor' ) . '</a>';\n\t\t$title          = __( 'Revisions' );\n\n\t\t$redirect = false;\n\t\tbreak;\n}\n\n// Empty post_type means either malformed object found, or no valid parent was found.\nif ( ! $redirect && empty( $post->post_type ) ) {\n\t$redirect = 'edit.php';\n}\n\nif ( ! empty( $redirect ) ) {\n\twp_redirect( $redirect );\n\texit;\n}\n\n// This is so that the correct \"Edit\" menu item is selected.\nif ( ! empty( $post->post_type ) && 'post' != $post->post_type ) {\n\t$parent_file = 'edit.php?post_type=' . $post->post_type;\n} else {\n\t$parent_file = 'edit.php';\n}\n$submenu_file = $parent_file;\n\nwp_enqueue_script( 'revisions' );\nwp_localize_script( 'revisions', '_wpRevisionsSettings', wp_prepare_revisions_for_js( $post, $revision_id, $from ) );\n\n/* Revisions Help Tab */\n\n$revisions_overview  = '<p>' . __( 'This screen is used for managing your content revisions.' ) . '</p>';\n$revisions_overview .= '<p>' . __( 'Revisions are saved copies of your post or page, which are periodically created as you update your content. The red text on the left shows the content that was removed. The green text on the right shows the content that was added.' ) . '</p>';\n$revisions_overview .= '<p>' . __( 'From this screen you can review, compare, and restore revisions:' ) . '</p>';\n$revisions_overview .= '<ul><li>' . __( 'To navigate between revisions, <strong>drag the slider handle left or right</strong> or <strong>use the Previous or Next buttons</strong>.' ) . '</li>';\n$revisions_overview .= '<li>' . __( 'Compare two different revisions by <strong>selecting the &#8220;Compare any two revisions&#8221; box</strong> to the side.' ) . '</li>';\n$revisions_overview .= '<li>' . __( 'To restore a revision, <strong>click Restore This Revision</strong>.' ) . '</li></ul>';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'revisions-overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' => $revisions_overview,\n\t)\n);\n\n$revisions_sidebar  = '<p><strong>' . __( 'For more information:' ) . '</strong></p>';\n$revisions_sidebar .= '<p>' . __( '<a href=\"https://wordpress.org/support/article/revisions/\">Revisions Management</a>' ) . '</p>';\n$revisions_sidebar .= '<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>';\n\nget_current_screen()->set_help_sidebar( $revisions_sidebar );\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n?>\n\n<div class=\"wrap\">\n\t<h1 class=\"long-header\"><?php echo $h1; ?></h1>\n\t<?php echo $return_to_post; ?>\n</div>\n<?php\nwp_print_revision_templates();\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 173}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Retrieves and creates the wp-config.php file.\n *\n * The permissions for the base directory must allow for writing files in order\n * for the wp-config.php to be created using this page.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * We are installing.\n */\ndefine( 'WP_INSTALLING', true );\n\n/**\n * We are blissfully unaware of anything.\n */\ndefine( 'WP_SETUP_CONFIG', true );\n\n/**\n * Disable error reporting\n *\n * Set this to error_reporting( -1 ) for debugging\n */\nerror_reporting( 0 );\n\nif ( ! defined( 'ABSPATH' ) ) {\n\tdefine( 'ABSPATH', dirname( __DIR__ ) . '/' );\n}\n\nrequire ABSPATH . 'wp-settings.php';\n\n/** Load WordPress Administration Upgrade API */\nrequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\n/** Load WordPress Translation Installation API */\nrequire_once ABSPATH . 'wp-admin/includes/translation-install.php';\n\nnocache_headers();\n\n// Support wp-config-sample.php one level up, for the develop repo.\nif ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) {\n\t$config_file = file( ABSPATH . 'wp-config-sample.php' );\n} elseif ( file_exists( dirname( ABSPATH ) . '/wp-config-sample.php' ) ) {\n\t$config_file = file( dirname( ABSPATH ) . '/wp-config-sample.php' );\n} else {\n\twp_die(\n\t\tsprintf(\n\t\t\t/* translators: %s: wp-config-sample.php */\n\t\t\t__( 'Sorry, I need a %s file to work from. Please re-upload this file to your WordPress installation.' ),\n\t\t\t'<code>wp-config-sample.php</code>'\n\t\t)\n\t);\n}\n\n// Check if wp-config.php has been created.\nif ( file_exists( ABSPATH . 'wp-config.php' ) ) {\n\twp_die(\n\t\t'<p>' . sprintf(\n\t\t\t/* translators: 1: wp-config.php, 2: install.php */\n\t\t\t__( 'The file %1$s already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href=\"%2$s\">installing now</a>.' ),\n\t\t\t'<code>wp-config.php</code>',\n\t\t\t'install.php'\n\t\t) . '</p>',\n\t\t409\n\t);\n}\n\n// Check if wp-config.php exists above the root directory but is not part of another installation.\nif ( @file_exists( ABSPATH . '../wp-config.php' ) && ! @file_exists( ABSPATH . '../wp-settings.php' ) ) {\n\twp_die(\n\t\t'<p>' . sprintf(\n\t\t\t/* translators: 1: wp-config.php, 2: install.php */\n\t\t\t__( 'The file %1$s already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href=\"%2$s\">installing now</a>.' ),\n\t\t\t'<code>wp-config.php</code>',\n\t\t\t'install.php'\n\t\t) . '</p>',\n\t\t409\n\t);\n}\n\n$step = isset( $_GET['step'] ) ? (int) $_GET['step'] : -1;\n\n/**\n * Display setup wp-config.php file header.\n *\n * @ignore\n * @since 2.3.0\n *\n * @global string    $wp_local_package Locale code of the package.\n * @global WP_Locale $wp_locale        WordPress date and time locale object.\n *\n * @param string|array $body_classes\n */\nfunction setup_config_display_header( $body_classes = array() ) {\n\t$body_classes   = (array) $body_classes;\n\t$body_classes[] = 'wp-core-ui';\n\t$dir_attr       = '';\n\tif ( is_rtl() ) {\n\t\t$body_classes[] = 'rtl';\n\t\t$dir_attr       = ' dir=\"rtl\"';\n\t}\n\n\theader( 'Content-Type: text/html; charset=utf-8' );\n\t?>\n<!DOCTYPE html>\n<html<?php echo $dir_attr; ?>>\n<head>\n\t<meta name=\"viewport\" content=\"width=device-width\" />\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\t<meta name=\"robots\" content=\"noindex,nofollow\" />\n\t<title><?php _e( 'WordPress &rsaquo; Setup Configuration File' ); ?></title>\n\t<?php wp_admin_css( 'install', true ); ?>\n</head>\n<body class=\"<?php echo implode( ' ', $body_classes ); ?>\">\n<p id=\"logo\"><?php _e( 'WordPress' ); ?></p>\n\t<?php\n} // End function setup_config_display_header();\n\n$language = '';\nif ( ! empty( $_REQUEST['language'] ) ) {\n\t$language = preg_replace( '/[^a-zA-Z0-9_]/', '', $_REQUEST['language'] );\n} elseif ( isset( $GLOBALS['wp_local_package'] ) ) {\n\t$language = $GLOBALS['wp_local_package'];\n}\n\nswitch ( $step ) {\n\tcase -1:\n\t\tif ( wp_can_install_language_pack() && empty( $language ) ) {\n\t\t\t$languages = wp_get_available_translations();\n\t\t\tif ( $languages ) {\n\t\t\t\tsetup_config_display_header( 'language-chooser' );\n\t\t\t\techo '<h1 class=\"screen-reader-text\">Select a default language</h1>';\n\t\t\t\techo '<form id=\"setup\" method=\"post\" action=\"?step=0\">';\n\t\t\t\twp_install_language_form( $languages );\n\t\t\t\techo '</form>';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Deliberately fall through if we can't reach the translations API.\n\n\tcase 0:\n\t\tif ( ! empty( $language ) ) {\n\t\t\t$loaded_language = wp_download_language_pack( $language );\n\t\t\tif ( $loaded_language ) {\n\t\t\t\tload_default_textdomain( $loaded_language );\n\t\t\t\t$GLOBALS['wp_locale'] = new WP_Locale();\n\t\t\t}\n\t\t}\n\n\t\tsetup_config_display_header();\n\t\t$step_1 = 'setup-config.php?step=1';\n\t\tif ( isset( $_REQUEST['noapi'] ) ) {\n\t\t\t$step_1 .= '&amp;noapi';\n\t\t}\n\t\tif ( ! empty( $loaded_language ) ) {\n\t\t\t$step_1 .= '&amp;language=' . $loaded_language;\n\t\t}\n\t\t?>\n<h1 class=\"screen-reader-text\"><?php _e( 'Before getting started' ); ?></h1>\n<p><?php _e( 'Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.' ); ?></p>\n<ol>\n\t<li><?php _e( 'Database name' ); ?></li>\n\t<li><?php _e( 'Database username' ); ?></li>\n\t<li><?php _e( 'Database password' ); ?></li>\n\t<li><?php _e( 'Database host' ); ?></li>\n\t<li><?php _e( 'Table prefix (if you want to run more than one WordPress in a single database)' ); ?></li>\n</ol>\n<p>\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: wp-config.php */\n\t\t\t__( 'We&#8217;re going to use this information to create a %s file.' ),\n\t\t\t'<code>wp-config.php</code>'\n\t\t);\n\t\t?>\n\t<strong>\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: 1: wp-config-sample.php, 2: wp-config.php */\n\t\t\t__( 'If for any reason this automatic file creation doesn&#8217;t work, don&#8217;t worry. All this does is fill in the database information to a configuration file. You may also simply open %1$s in a text editor, fill in your information, and save it as %2$s.' ),\n\t\t\t'<code>wp-config-sample.php</code>',\n\t\t\t'<code>wp-config.php</code>'\n\t\t);\n\t\t?>\n\t</strong>\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: Documentation URL. */\n\t\t\t__( 'Need more help? <a href=\"%s\">We got it</a>.' ),\n\t\t\t__( 'https://wordpress.org/support/article/editing-wp-config-php/' )\n\t\t);\n\t\t?>\n</p>\n<p><?php _e( 'In all likelihood, these items were supplied to you by your Web Host. If you don&#8217;t have this information, then you will need to contact them before you can continue. If you&#8217;re all ready&hellip;' ); ?></p>\n\n<p class=\"step\"><a href=\"<?php echo $step_1; ?>\" class=\"button button-large\"><?php _e( 'Let&#8217;s go!' ); ?></a></p>\n\t\t<?php\n\t\tbreak;\n\n\tcase 1:\n\t\tload_default_textdomain( $language );\n\t\t$GLOBALS['wp_locale'] = new WP_Locale();\n\n\t\tsetup_config_display_header();\n\n\t\t$autofocus = wp_is_mobile() ? '' : ' autofocus';\n\t\t?>\n<h1 class=\"screen-reader-text\"><?php _e( 'Set up your database connection' ); ?></h1>\n<form method=\"post\" action=\"setup-config.php?step=2\">\n\t<p><?php _e( 'Below you should enter your database connection details. If you&#8217;re not sure about these, contact your host.' ); ?></p>\n\t<table class=\"form-table\" role=\"presentation\">\n\t\t<tr>\n\t\t\t<th scope=\"row\"><label for=\"dbname\"><?php _e( 'Database Name' ); ?></label></th>\n\t\t\t<td><input name=\"dbname\" id=\"dbname\" type=\"text\" aria-describedby=\"dbname-desc\" size=\"25\" value=\"wordpress\"<?php echo $autofocus; ?>/></td>\n\t\t\t<td id=\"dbname-desc\"><?php _e( 'The name of the database you want to use with WordPress.' ); ?></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th scope=\"row\"><label for=\"uname\"><?php _e( 'Username' ); ?></label></th>\n\t\t\t<td><input name=\"uname\" id=\"uname\" type=\"text\" aria-describedby=\"uname-desc\" size=\"25\" value=\"<?php echo htmlspecialchars( _x( 'username', 'example username' ), ENT_QUOTES ); ?>\" /></td>\n\t\t\t<td id=\"uname-desc\"><?php _e( 'Your database username.' ); ?></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th scope=\"row\"><label for=\"pwd\"><?php _e( 'Password' ); ?></label></th>\n\t\t\t<td><input name=\"pwd\" id=\"pwd\" type=\"text\" aria-describedby=\"pwd-desc\" size=\"25\" value=\"<?php echo htmlspecialchars( _x( 'password', 'example password' ), ENT_QUOTES ); ?>\" autocomplete=\"off\" /></td>\n\t\t\t<td id=\"pwd-desc\"><?php _e( 'Your database password.' ); ?></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th scope=\"row\"><label for=\"dbhost\"><?php _e( 'Database Host' ); ?></label></th>\n\t\t\t<td><input name=\"dbhost\" id=\"dbhost\" type=\"text\" aria-describedby=\"dbhost-desc\" size=\"25\" value=\"localhost\" /></td>\n\t\t\t<td id=\"dbhost-desc\">\n\t\t\t<?php\n\t\t\t\t/* translators: %s: localhost */\n\t\t\t\tprintf( __( 'You should be able to get this info from your web host, if %s doesn&#8217;t work.' ), '<code>localhost</code>' );\n\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th scope=\"row\"><label for=\"prefix\"><?php _e( 'Table Prefix' ); ?></label></th>\n\t\t\t<td><input name=\"prefix\" id=\"prefix\" type=\"text\" aria-describedby=\"prefix-desc\" value=\"wp_\" size=\"25\" /></td>\n\t\t\t<td id=\"prefix-desc\"><?php _e( 'If you want to run multiple WordPress installations in a single database, change this.' ); ?></td>\n\t\t</tr>\n\t</table>\n\t\t<?php\n\t\tif ( isset( $_GET['noapi'] ) ) {\n\t\t\t?>\n<input name=\"noapi\" type=\"hidden\" value=\"1\" /><?php } ?>\n\t<input type=\"hidden\" name=\"language\" value=\"<?php echo esc_attr( $language ); ?>\" />\n\t<p class=\"step\"><input name=\"submit\" type=\"submit\" value=\"<?php echo htmlspecialchars( __( 'Submit' ), ENT_QUOTES ); ?>\" class=\"button button-large\" /></p>\n</form>\n\t\t<?php\n\t\tbreak;\n\n\tcase 2:\n\t\tload_default_textdomain( $language );\n\t\t$GLOBALS['wp_locale'] = new WP_Locale();\n\n\t\t$dbname = trim( wp_unslash( $_POST['dbname'] ) );\n\t\t$uname  = trim( wp_unslash( $_POST['uname'] ) );\n\t\t$pwd    = trim( wp_unslash( $_POST['pwd'] ) );\n\t\t$dbhost = trim( wp_unslash( $_POST['dbhost'] ) );\n\t\t$prefix = trim( wp_unslash( $_POST['prefix'] ) );\n\n\t\t$step_1  = 'setup-config.php?step=1';\n\t\t$install = 'install.php';\n\t\tif ( isset( $_REQUEST['noapi'] ) ) {\n\t\t\t$step_1 .= '&amp;noapi';\n\t\t}\n\n\t\tif ( ! empty( $language ) ) {\n\t\t\t$step_1  .= '&amp;language=' . $language;\n\t\t\t$install .= '?language=' . $language;\n\t\t} else {\n\t\t\t$install .= '?language=en_US';\n\t\t}\n\n\t\t$tryagain_link = '</p><p class=\"step\"><a href=\"' . $step_1 . '\" onclick=\"javascript:history.go(-1);return false;\" class=\"button button-large\">' . __( 'Try Again' ) . '</a>';\n\n\t\tif ( empty( $prefix ) ) {\n\t\t\twp_die( __( '<strong>Error</strong>: \"Table Prefix\" must not be empty.' ) . $tryagain_link );\n\t\t}\n\n\t\t// Validate $prefix: it can only contain letters, numbers and underscores.\n\t\tif ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) {\n\t\t\twp_die( __( '<strong>Error</strong>: \"Table Prefix\" can only contain numbers, letters, and underscores.' ) . $tryagain_link );\n\t\t}\n\n\t\t// Test the DB connection.\n\t\t/**#@+\n\t\t *\n\t\t * @ignore\n\t\t */\n\t\tdefine( 'DB_NAME', $dbname );\n\t\tdefine( 'DB_USER', $uname );\n\t\tdefine( 'DB_PASSWORD', $pwd );\n\t\tdefine( 'DB_HOST', $dbhost );\n\t\t/**#@-*/\n\n\t\t// Re-construct $wpdb with these new values.\n\t\tunset( $wpdb );\n\t\trequire_wp_db();\n\n\t\t/*\n\t\t* The wpdb constructor bails when WP_SETUP_CONFIG is set, so we must\n\t\t* fire this manually. We'll fail here if the values are no good.\n\t\t*/\n\t\t$wpdb->db_connect();\n\n\t\tif ( ! empty( $wpdb->error ) ) {\n\t\t\twp_die( $wpdb->error->get_error_message() . $tryagain_link );\n\t\t}\n\n\t\t$errors = $wpdb->hide_errors();\n\t\t$wpdb->query( \"SELECT $prefix\" );\n\t\t$wpdb->show_errors( $errors );\n\t\tif ( ! $wpdb->last_error ) {\n\t\t\t// MySQL was able to parse the prefix as a value, which we don't want. Bail.\n\t\t\twp_die( __( '<strong>Error</strong>: \"Table Prefix\" is invalid.' ) );\n\t\t}\n\n\t\t// Generate keys and salts using secure CSPRNG; fallback to API if enabled; further fallback to original wp_generate_password().\n\t\ttry {\n\t\t\t$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_ []{}<>~`+=,.;:/?|';\n\t\t\t$max   = strlen( $chars ) - 1;\n\t\t\tfor ( $i = 0; $i < 8; $i++ ) {\n\t\t\t\t$key = '';\n\t\t\t\tfor ( $j = 0; $j < 64; $j++ ) {\n\t\t\t\t\t$key .= substr( $chars, random_int( 0, $max ), 1 );\n\t\t\t\t}\n\t\t\t\t$secret_keys[] = $key;\n\t\t\t}\n\t\t} catch ( Exception $ex ) {\n\t\t\t$no_api = isset( $_POST['noapi'] );\n\n\t\t\tif ( ! $no_api ) {\n\t\t\t\t$secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );\n\t\t\t}\n\n\t\t\tif ( $no_api || is_wp_error( $secret_keys ) ) {\n\t\t\t\t$secret_keys = array();\n\t\t\t\tfor ( $i = 0; $i < 8; $i++ ) {\n\t\t\t\t\t$secret_keys[] = wp_generate_password( 64, true, true );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$secret_keys = explode( \"\\n\", wp_remote_retrieve_body( $secret_keys ) );\n\t\t\t\tforeach ( $secret_keys as $k => $v ) {\n\t\t\t\t\t$secret_keys[ $k ] = substr( $v, 28, 64 );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$key = 0;\n\t\tforeach ( $config_file as $line_num => $line ) {\n\t\t\tif ( '$table_prefix =' === substr( $line, 0, 15 ) ) {\n\t\t\t\t$config_file[ $line_num ] = '$table_prefix = \\'' . addcslashes( $prefix, \"\\\\'\" ) . \"';\\r\\n\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! preg_match( '/^define\\(\\s*\\'([A-Z_]+)\\',([ ]+)/', $line, $match ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$constant = $match[1];\n\t\t\t$padding  = $match[2];\n\n\t\t\tswitch ( $constant ) {\n\t\t\t\tcase 'DB_NAME':\n\t\t\t\tcase 'DB_USER':\n\t\t\t\tcase 'DB_PASSWORD':\n\t\t\t\tcase 'DB_HOST':\n\t\t\t\t\t$config_file[ $line_num ] = \"define( '\" . $constant . \"',\" . $padding . \"'\" . addcslashes( constant( $constant ), \"\\\\'\" ) . \"' );\\r\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'DB_CHARSET':\n\t\t\t\t\tif ( 'utf8mb4' === $wpdb->charset || ( ! $wpdb->charset && $wpdb->has_cap( 'utf8mb4' ) ) ) {\n\t\t\t\t\t\t$config_file[ $line_num ] = \"define( '\" . $constant . \"',\" . $padding . \"'utf8mb4' );\\r\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'AUTH_KEY':\n\t\t\t\tcase 'SECURE_AUTH_KEY':\n\t\t\t\tcase 'LOGGED_IN_KEY':\n\t\t\t\tcase 'NONCE_KEY':\n\t\t\t\tcase 'AUTH_SALT':\n\t\t\t\tcase 'SECURE_AUTH_SALT':\n\t\t\t\tcase 'LOGGED_IN_SALT':\n\t\t\t\tcase 'NONCE_SALT':\n\t\t\t\t\t$config_file[ $line_num ] = \"define( '\" . $constant . \"',\" . $padding . \"'\" . $secret_keys[ $key++ ] . \"' );\\r\\n\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tunset( $line );\n\n\t\tif ( ! is_writable( ABSPATH ) ) :\n\t\t\tsetup_config_display_header();\n\t\t\t?>\n\t<p>\n\t\t\t<?php\n\t\t\t/* translators: %s: wp-config.php */\n\t\t\tprintf( __( 'Unable to write to %s file.' ), '<code>wp-config.php</code>' );\n\t\t\t?>\n</p>\n<p>\n\t\t\t<?php\n\t\t\t/* translators: %s: wp-config.php */\n\t\t\tprintf( __( 'You can create the %s file manually and paste the following text into it.' ), '<code>wp-config.php</code>' );\n\n\t\t\t$config_text = '';\n\n\t\t\tforeach ( $config_file as $line ) {\n\t\t\t\t$config_text .= htmlentities( $line, ENT_COMPAT, 'UTF-8' );\n\t\t\t}\n\t\t\t?>\n</p>\n<textarea id=\"wp-config\" cols=\"98\" rows=\"15\" class=\"code\" readonly=\"readonly\"><?php echo $config_text; ?></textarea>\n<p><?php _e( 'After you&#8217;ve done that, click &#8220;Run the installation&#8221;.' ); ?></p>\n<p class=\"step\"><a href=\"<?php echo $install; ?>\" class=\"button button-large\"><?php _e( 'Run the installation' ); ?></a></p>\n<script>\n(function(){\nif ( ! /iPad|iPod|iPhone/.test( navigator.userAgent ) ) {\n\tvar el = document.getElementById('wp-config');\n\tel.focus();\n\tel.select();\n}\n})();\n</script>\n\t\t\t<?php\n\telse :\n\t\t/*\n\t\t * If this file doesn't exist, then we are using the wp-config-sample.php\n\t\t * file one level up, which is for the develop repo.\n\t\t */\n\t\tif ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) {\n\t\t\t$path_to_wp_config = ABSPATH . 'wp-config.php';\n\t\t} else {\n\t\t\t$path_to_wp_config = dirname( ABSPATH ) . '/wp-config.php';\n\t\t}\n\n\t\t$handle = fopen( $path_to_wp_config, 'w' );\n\t\tforeach ( $config_file as $line ) {\n\t\t\tfwrite( $handle, $line );\n\t\t}\n\t\tfclose( $handle );\n\t\tchmod( $path_to_wp_config, 0666 );\n\t\tsetup_config_display_header();\n\t\t?>\n<h1 class=\"screen-reader-text\"><?php _e( 'Successful database connection' ); ?></h1>\n<p><?php _e( 'All right, sparky! You&#8217;ve made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to&hellip;' ); ?></p>\n\n<p class=\"step\"><a href=\"<?php echo $install; ?>\" class=\"button button-large\"><?php _e( 'Run the installation' ); ?></a></p>\n\t\t<?php\n\tendif;\n\t\tbreak;\n}\n?>\n<?php wp_print_scripts( 'language-chooser' ); ?>\n</body>\n</html>\n", "num_lines": 460}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Tools Administration Screen.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n$title = __( 'Site Health Info' );\n\nif ( ! current_user_can( 'view_site_health_checks' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to access the debug data.' ), '', 403 );\n}\n\nwp_enqueue_style( 'site-health' );\nwp_enqueue_script( 'site-health' );\n\nif ( ! class_exists( 'WP_Debug_Data' ) ) {\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-debug-data.php';\n}\nif ( ! class_exists( 'WP_Site_Health' ) ) {\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';\n}\n\n$health_check_site_status = WP_Site_Health::get_instance();\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n<div class=\"health-check-header\">\n\t<div class=\"health-check-title-section\">\n\t\t<h1>\n\t\t\t<?php _e( 'Site Health' ); ?>\n\t\t</h1>\n\t</div>\n\n\t<div class=\"health-check-title-section site-health-progress-wrapper loading hide-if-no-js\">\n\t\t<div class=\"site-health-progress\">\n\t\t\t<svg role=\"img\" aria-hidden=\"true\" focusable=\"false\" width=\"100%\" height=\"100%\" viewBox=\"0 0 200 200\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t<circle r=\"90\" cx=\"100\" cy=\"100\" fill=\"transparent\" stroke-dasharray=\"565.48\" stroke-dashoffset=\"0\"></circle>\n\t\t\t\t<circle id=\"bar\" r=\"90\" cx=\"100\" cy=\"100\" fill=\"transparent\" stroke-dasharray=\"565.48\" stroke-dashoffset=\"0\"></circle>\n\t\t\t</svg>\n\t\t</div>\n\t\t<div class=\"site-health-progress-label\">\n\t\t\t<?php _e( 'Results are still loading&hellip;' ); ?>\n\t\t</div>\n\t</div>\n\n\t<nav class=\"health-check-tabs-wrapper hide-if-no-js\" aria-label=\"<?php esc_attr_e( 'Secondary menu' ); ?>\">\n\t\t<a href=\"<?php echo esc_url( admin_url( 'site-health.php' ) ); ?>\" class=\"health-check-tab\">\n\t\t\t<?php\n\t\t\t/* translators: Tab heading for Site Health Status page. */\n\t\t\t_ex( 'Status', 'Site Health' );\n\t\t\t?>\n\t\t</a>\n\n\t\t<a href=\"<?php echo esc_url( admin_url( 'site-health.php?tab=debug' ) ); ?>\" class=\"health-check-tab active\" aria-current=\"true\">\n\t\t\t<?php\n\t\t\t/* translators: Tab heading for Site Health Info page. */\n\t\t\t_ex( 'Info', 'Site Health' );\n\t\t\t?>\n\t\t</a>\n\t</nav>\n</div>\n\n<hr class=\"wp-header-end\">\n\n<div class=\"notice notice-error hide-if-js\">\n\t<p><?php _e( 'The Site Health check requires JavaScript.' ); ?></p>\n</div>\n\n<div class=\"health-check-body health-check-debug-tab hide-if-no-js\">\n\t<?php\n\n\tWP_Debug_Data::check_for_updates();\n\n\t$info = WP_Debug_Data::debug_data();\n\n\t?>\n\n\t<h2>\n\t\t<?php _e( 'Site Health Info' ); ?>\n\t</h2>\n\n\t<p>\n\t\t<?php\n\t\t\t/* translators: %s: URL to Site Health Status page. */\n\t\t\tprintf( __( 'This page can show you every detail about the configuration of your WordPress website. For any improvements that could be made, see the <a href=\"%s\">Site Health Status</a> page.' ), esc_url( admin_url( 'site-health.php' ) ) );\n\t\t?>\n\t</p>\n\t<p>\n\t\t<?php _e( 'If you want to export a handy list of all the information on this page, you can use the button below to copy it to the clipboard. You can then paste it in a text file and save it to your device, or paste it in an email exchange with a support engineer or theme/plugin developer for example.' ); ?>\n\t</p>\n\n\t<div class=\"site-health-copy-buttons\">\n\t\t<div class=\"copy-button-wrapper\">\n\t\t\t<button type=\"button\" class=\"button copy-button\" data-clipboard-text=\"<?php echo esc_attr( WP_Debug_Data::format( $info, 'debug' ) ); ?>\">\n\t\t\t\t<?php _e( 'Copy site info to clipboard' ); ?>\n\t\t\t</button>\n\t\t\t<span class=\"success hidden\" aria-hidden=\"true\"><?php _e( 'Copied!' ); ?></span>\n\t\t</div>\n\t</div>\n\n\t<div id=\"health-check-debug\" class=\"health-check-accordion\">\n\n\t\t<?php\n\n\t\t$sizes_fields = array( 'uploads_size', 'themes_size', 'plugins_size', 'wordpress_size', 'database_size', 'total_size' );\n\n\t\tforeach ( $info as $section => $details ) {\n\t\t\tif ( ! isset( $details['fields'] ) || empty( $details['fields'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t?>\n\t\t\t<h3 class=\"health-check-accordion-heading\">\n\t\t\t\t<button aria-expanded=\"false\" class=\"health-check-accordion-trigger\" aria-controls=\"health-check-accordion-block-<?php echo esc_attr( $section ); ?>\" type=\"button\">\n\t\t\t\t\t<span class=\"title\">\n\t\t\t\t\t\t<?php echo esc_html( $details['label'] ); ?>\n\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\tif ( isset( $details['show_count'] ) && $details['show_count'] ) {\n\t\t\t\t\t\t\tprintf( '(%d)', count( $details['fields'] ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t?>\n\t\t\t\t\t</span>\n\t\t\t\t\t<?php\n\n\t\t\t\t\tif ( 'wp-paths-sizes' === $section ) {\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<span class=\"health-check-wp-paths-sizes spinner\"></span>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\n\t\t\t\t\t?>\n\t\t\t\t\t<span class=\"icon\"></span>\n\t\t\t\t</button>\n\t\t\t</h3>\n\n\t\t\t<div id=\"health-check-accordion-block-<?php echo esc_attr( $section ); ?>\" class=\"health-check-accordion-panel\" hidden=\"hidden\">\n\t\t\t\t<?php\n\n\t\t\t\tif ( isset( $details['description'] ) && ! empty( $details['description'] ) ) {\n\t\t\t\t\tprintf( '<p>%s</p>', $details['description'] );\n\t\t\t\t}\n\n\t\t\t\t?>\n\t\t\t\t<table class=\"widefat striped health-check-table\" role=\"presentation\">\n\t\t\t\t\t<tbody>\n\t\t\t\t\t<?php\n\n\t\t\t\t\tforeach ( $details['fields'] as $field_name => $field ) {\n\t\t\t\t\t\tif ( is_array( $field['value'] ) ) {\n\t\t\t\t\t\t\t$values = '<ul>';\n\n\t\t\t\t\t\t\tforeach ( $field['value'] as $name => $value ) {\n\t\t\t\t\t\t\t\t$values .= sprintf( '<li>%s: %s</li>', esc_html( $name ), esc_html( $value ) );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$values .= '</ul>';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$values = esc_html( $field['value'] );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( in_array( $field_name, $sizes_fields, true ) ) {\n\t\t\t\t\t\t\tprintf( '<tr><td>%s</td><td class=\"%s\">%s</td></tr>', esc_html( $field['label'] ), esc_attr( $field_name ), $values );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tprintf( '<tr><td>%s</td><td>%s</td></tr>', esc_html( $field['label'] ), $values );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t?>\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t<?php } ?>\n\t</div>\n</div>\n\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 185}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Tools Administration Screen.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\nif ( isset( $_GET['tab'] ) && 'debug' === $_GET['tab'] ) {\n\trequire_once __DIR__ . '/site-health-info.php';\n\treturn;\n}\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n$title = __( 'Site Health Status' );\n\nif ( ! current_user_can( 'view_site_health_checks' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to access site health information.' ), '', 403 );\n}\n\nwp_enqueue_style( 'site-health' );\nwp_enqueue_script( 'site-health' );\n\nif ( ! class_exists( 'WP_Site_Health' ) ) {\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';\n}\n\n$health_check_site_status = WP_Site_Health::get_instance();\n\n// Start by checking if this is a special request checking for the existence of certain filters.\n$health_check_site_status->check_wp_version_check_exists();\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n<div class=\"health-check-header\">\n\t<div class=\"health-check-title-section\">\n\t\t<h1>\n\t\t\t<?php _e( 'Site Health' ); ?>\n\t\t</h1>\n\t</div>\n\n\t<div class=\"health-check-title-section site-health-progress-wrapper loading hide-if-no-js\">\n\t\t<div class=\"site-health-progress\">\n\t\t\t<svg role=\"img\" aria-hidden=\"true\" focusable=\"false\" width=\"100%\" height=\"100%\" viewBox=\"0 0 200 200\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t<circle r=\"90\" cx=\"100\" cy=\"100\" fill=\"transparent\" stroke-dasharray=\"565.48\" stroke-dashoffset=\"0\"></circle>\n\t\t\t\t<circle id=\"bar\" r=\"90\" cx=\"100\" cy=\"100\" fill=\"transparent\" stroke-dasharray=\"565.48\" stroke-dashoffset=\"0\"></circle>\n\t\t\t</svg>\n\t\t</div>\n\t\t<div class=\"site-health-progress-label\">\n\t\t\t<?php _e( 'Results are still loading&hellip;' ); ?>\n\t\t</div>\n\t</div>\n\n\t<nav class=\"health-check-tabs-wrapper hide-if-no-js\" aria-label=\"<?php esc_attr_e( 'Secondary menu' ); ?>\">\n\t\t<a href=\"<?php echo esc_url( admin_url( 'site-health.php' ) ); ?>\" class=\"health-check-tab active\" aria-current=\"true\">\n\t\t\t<?php\n\t\t\t/* translators: Tab heading for Site Health Status page. */\n\t\t\t_ex( 'Status', 'Site Health' );\n\t\t\t?>\n\t\t</a>\n\n\t\t<a href=\"<?php echo esc_url( admin_url( 'site-health.php?tab=debug' ) ); ?>\" class=\"health-check-tab\">\n\t\t\t<?php\n\t\t\t/* translators: Tab heading for Site Health Info page. */\n\t\t\t_ex( 'Info', 'Site Health' );\n\t\t\t?>\n\t\t</a>\n\t</nav>\n</div>\n\n<hr class=\"wp-header-end\">\n\n<div class=\"notice notice-error hide-if-js\">\n\t<p><?php _e( 'The Site Health check requires JavaScript.' ); ?></p>\n</div>\n\n<div class=\"health-check-body hide-if-no-js\">\n\t<div class=\"site-status-all-clear hide\">\n\t\t<p class=\"icon\">\n\t\t\t<span class=\"dashicons dashicons-yes\"></span>\n\t\t</p>\n\n\t\t<p class=\"encouragement\">\n\t\t\t<?php _e( 'Great job!' ); ?>\n\t\t</p>\n\n\t\t<p>\n\t\t\t<?php _e( 'Everything is running smoothly here.' ); ?>\n\t\t</p>\n\t</div>\n\n\t<div class=\"site-status-has-issues\">\n\t\t<h2>\n\t\t\t<?php _e( 'Site Health Status' ); ?>\n\t\t</h2>\n\n\t\t<p><?php _e( 'The site health check shows critical information about your WordPress configuration and items that require your attention.' ); ?></p>\n\n\t\t<div class=\"site-health-issues-wrapper\" id=\"health-check-issues-critical\">\n\t\t\t<h3 class=\"site-health-issue-count-title\">\n\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Number of critical issues found. */\n\t\t\t\t\tprintf( _n( '%s critical issue', '%s critical issues', 0 ), '<span class=\"issue-count\">0</span>' );\n\t\t\t\t?>\n\t\t\t</h3>\n\n\t\t\t<div id=\"health-check-site-status-critical\" class=\"health-check-accordion issues\"></div>\n\t\t</div>\n\n\t\t<div class=\"site-health-issues-wrapper\" id=\"health-check-issues-recommended\">\n\t\t\t<h3 class=\"site-health-issue-count-title\">\n\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Number of recommended improvements. */\n\t\t\t\t\tprintf( _n( '%s recommended improvement', '%s recommended improvements', 0 ), '<span class=\"issue-count\">0</span>' );\n\t\t\t\t?>\n\t\t\t</h3>\n\n\t\t\t<div id=\"health-check-site-status-recommended\" class=\"health-check-accordion issues\"></div>\n\t\t</div>\n\t</div>\n\n\t<div class=\"site-health-view-more\">\n\t\t<button type=\"button\" class=\"button site-health-view-passed\" aria-expanded=\"false\" aria-controls=\"health-check-issues-good\">\n\t\t\t<?php _e( 'Passed tests' ); ?>\n\t\t\t<span class=\"icon\"></span>\n\t\t</button>\n\t</div>\n\n\t<div class=\"site-health-issues-wrapper hidden\" id=\"health-check-issues-good\">\n\t\t<h3 class=\"site-health-issue-count-title\">\n\t\t\t<?php\n\t\t\t\t/* translators: %s: Number of items with no issues. */\n\t\t\t\tprintf( _n( '%s item with no issues detected', '%s items with no issues detected', 0 ), '<span class=\"issue-count\">0</span>' );\n\t\t\t?>\n\t\t</h3>\n\n\t\t<div id=\"health-check-site-status-good\" class=\"health-check-accordion issues\"></div>\n\t</div>\n</div>\n\n<script id=\"tmpl-health-check-issue\" type=\"text/template\">\n\t<h4 class=\"health-check-accordion-heading\">\n\t\t<button aria-expanded=\"false\" class=\"health-check-accordion-trigger\" aria-controls=\"health-check-accordion-block-{{ data.test }}\" type=\"button\">\n\t\t\t<span class=\"title\">{{ data.label }}</span>\n\t\t\t<span class=\"badge {{ data.badge.color }}\">{{ data.badge.label }}</span>\n\t\t\t<span class=\"icon\"></span>\n\t\t</button>\n\t</h4>\n\t<div id=\"health-check-accordion-block-{{ data.test }}\" class=\"health-check-accordion-panel\" hidden=\"hidden\">\n\t\t{{{ data.description }}}\n\t\t<# if ( data.actions ) { #>\n\t\t\t<div class=\"actions\">\n\t\t\t\t{{{ data.actions }}}\n\t\t\t</div>\n\t\t<# } #>\n\t</div>\n</script>\n\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 163}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit Term Administration Screen.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.5.0\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( empty( $_REQUEST['tag_ID'] ) ) {\n\t$sendback = admin_url( 'edit-tags.php' );\n\tif ( ! empty( $taxnow ) ) {\n\t\t$sendback = add_query_arg( array( 'taxonomy' => $taxnow ), $sendback );\n\t}\n\n\tif ( 'post' !== get_current_screen()->post_type ) {\n\t\t$sendback = add_query_arg( 'post_type', get_current_screen()->post_type, $sendback );\n\t}\n\n\twp_redirect( esc_url_raw( $sendback ) );\n\texit;\n}\n\n$tag_ID = absint( $_REQUEST['tag_ID'] );\n$tag    = get_term( $tag_ID, $taxnow, OBJECT, 'edit' );\n\nif ( ! $tag instanceof WP_Term ) {\n\twp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );\n}\n\n$tax      = get_taxonomy( $tag->taxonomy );\n$taxonomy = $tax->name;\n$title    = $tax->labels->edit_item;\n\nif ( ! in_array( $taxonomy, get_taxonomies( array( 'show_ui' => true ) ), true )\n\t|| ! current_user_can( 'edit_term', $tag->term_id )\n) {\n\twp_die(\n\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t'<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',\n\t\t403\n\t);\n}\n\n$post_type = get_current_screen()->post_type;\n\n// Default to the first object_type associated with the taxonomy if no post type was passed.\nif ( empty( $post_type ) ) {\n\t$post_type = reset( $tax->object_type );\n}\n\nif ( 'post' !== $post_type ) {\n\t$parent_file  = ( 'attachment' === $post_type ) ? 'upload.php' : \"edit.php?post_type=$post_type\";\n\t$submenu_file = \"edit-tags.php?taxonomy=$taxonomy&amp;post_type=$post_type\";\n} elseif ( 'link_category' === $taxonomy ) {\n\t$parent_file  = 'link-manager.php';\n\t$submenu_file = 'edit-tags.php?taxonomy=link_category';\n} else {\n\t$parent_file  = 'edit.php';\n\t$submenu_file = \"edit-tags.php?taxonomy=$taxonomy\";\n}\n\nget_current_screen()->set_screen_reader_content(\n\tarray(\n\t\t'heading_pagination' => $tax->labels->items_list_navigation,\n\t\t'heading_list'       => $tax->labels->items_list,\n\t)\n);\nwp_enqueue_script( 'admin-tags' );\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\nrequire ABSPATH . 'wp-admin/edit-tag-form.php';\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 76}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Theme editor administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( is_multisite() && ! is_network_admin() ) {\n\twp_redirect( network_admin_url( 'theme-editor.php' ) );\n\texit;\n}\n\nif ( ! current_user_can( 'edit_themes' ) ) {\n\twp_die( '<p>' . __( 'Sorry, you are not allowed to edit templates for this site.' ) . '</p>' );\n}\n\n$title       = __( 'Edit Themes' );\n$parent_file = 'themes.php';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t\t'<p>' . __( 'You can use the theme editor to edit the individual CSS and PHP files which make up your theme.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'Begin by choosing a theme to edit from the dropdown menu and clicking the Select button. A list then appears of the theme&#8217;s template files. Clicking once on any file name causes the file to appear in the large Editor box.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'For PHP files, you can use the Documentation dropdown to select from functions recognized in that file. Look Up takes you to a web page with reference material about that particular function.' ) . '</p>' .\n\t\t\t\t'<p id=\"editor-keyboard-trap-help-1\">' . __( 'When using a keyboard to navigate:' ) . '</p>' .\n\t\t\t\t'<ul>' .\n\t\t\t\t'<li id=\"editor-keyboard-trap-help-2\">' . __( 'In the editing area, the Tab key enters a tab character.' ) . '</li>' .\n\t\t\t\t'<li id=\"editor-keyboard-trap-help-3\">' . __( 'To move away from this area, press the Esc key followed by the Tab key.' ) . '</li>' .\n\t\t\t\t'<li id=\"editor-keyboard-trap-help-4\">' . __( 'Screen reader users: when in forms mode, you may need to press the Esc key twice.' ) . '</li>' .\n\t\t\t\t'</ul>' .\n\t\t\t\t'<p>' . __( 'After typing in your edits, click Update File.' ) . '</p>' .\n\t\t\t\t'<p>' . __( '<strong>Advice:</strong> Think very carefully about your site crashing if you are live-editing the theme currently in use.' ) . '</p>' .\n\t\t\t\t'<p>' . sprintf(\n\t\t\t\t\t/* translators: %s: Link to documentation on child themes. */\n\t\t\t\t\t__( 'Upgrading to a newer version of the same theme will override changes made here. To avoid this, consider creating a <a href=\"%s\">child theme</a> instead.' ),\n\t\t\t\t\t__( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' )\n\t\t\t\t) . '</p>' .\n\t\t\t\t( is_network_admin() ? '<p>' . __( 'Any edits to files from this screen will be reflected on all sites in the network.' ) . '</p>' : '' ),\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://developer.wordpress.org/themes/\">Documentation on Theme Development</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/using-themes/\">Documentation on Using Themes</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/editing-files/\">Documentation on Editing Files</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://developer.wordpress.org/themes/basics/template-tags/\">Documentation on Template Tags</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nwp_reset_vars( array( 'action', 'error', 'file', 'theme' ) );\n\nif ( $theme ) {\n\t$stylesheet = $theme;\n} else {\n\t$stylesheet = get_stylesheet();\n}\n\n$theme = wp_get_theme( $stylesheet );\n\nif ( ! $theme->exists() ) {\n\twp_die( __( 'The requested theme does not exist.' ) );\n}\n\nif ( $theme->errors() && 'theme_no_stylesheet' === $theme->errors()->get_error_code() ) {\n\twp_die( __( 'The requested theme does not exist.' ) . ' ' . $theme->errors()->get_error_message() );\n}\n\n$allowed_files = array();\n$style_files   = array();\n\n$file_types = wp_get_theme_file_editable_extensions( $theme );\n\nforeach ( $file_types as $type ) {\n\tswitch ( $type ) {\n\t\tcase 'php':\n\t\t\t$allowed_files += $theme->get_files( 'php', -1 );\n\t\t\tbreak;\n\t\tcase 'css':\n\t\t\t$style_files                = $theme->get_files( 'css', -1 );\n\t\t\t$allowed_files['style.css'] = $style_files['style.css'];\n\t\t\t$allowed_files             += $style_files;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$allowed_files += $theme->get_files( $type, -1 );\n\t\t\tbreak;\n\t}\n}\n\n// Move functions.php and style.css to the top.\nif ( isset( $allowed_files['functions.php'] ) ) {\n\t$allowed_files = array( 'functions.php' => $allowed_files['functions.php'] ) + $allowed_files;\n}\nif ( isset( $allowed_files['style.css'] ) ) {\n\t$allowed_files = array( 'style.css' => $allowed_files['style.css'] ) + $allowed_files;\n}\n\nif ( empty( $file ) ) {\n\t$relative_file = 'style.css';\n\t$file          = $allowed_files['style.css'];\n} else {\n\t$relative_file = wp_unslash( $file );\n\t$file          = $theme->get_stylesheet_directory() . '/' . $relative_file;\n}\n\nvalidate_file_to_edit( $file, $allowed_files );\n\n// Handle fallback editing of file when JavaScript is not available.\n$edit_error     = null;\n$posted_content = null;\n\nif ( 'POST' === $_SERVER['REQUEST_METHOD'] ) {\n\t$r = wp_edit_theme_plugin_file( wp_unslash( $_POST ) );\n\tif ( is_wp_error( $r ) ) {\n\t\t$edit_error = $r;\n\t\tif ( check_ajax_referer( 'edit-theme_' . $stylesheet . '_' . $relative_file, 'nonce', false ) && isset( $_POST['newcontent'] ) ) {\n\t\t\t$posted_content = wp_unslash( $_POST['newcontent'] );\n\t\t}\n\t} else {\n\t\twp_redirect(\n\t\t\tadd_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'a'     => 1, // This means \"success\" for some reason.\n\t\t\t\t\t'theme' => $stylesheet,\n\t\t\t\t\t'file'  => $relative_file,\n\t\t\t\t),\n\t\t\t\tadmin_url( 'theme-editor.php' )\n\t\t\t)\n\t\t);\n\t\texit;\n\t}\n}\n\n$settings = array(\n\t'codeEditor' => wp_enqueue_code_editor( compact( 'file' ) ),\n);\nwp_enqueue_script( 'wp-theme-plugin-editor' );\nwp_add_inline_script( 'wp-theme-plugin-editor', sprintf( 'jQuery( function( $ ) { wp.themePluginEditor.init( $( \"#template\" ), %s ); } )', wp_json_encode( $settings ) ) );\nwp_add_inline_script( 'wp-theme-plugin-editor', 'wp.themePluginEditor.themeOrPlugin = \"theme\";' );\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\nupdate_recently_edited( $file );\n\nif ( ! is_file( $file ) ) {\n\t$error = true;\n}\n\n$content = '';\nif ( ! empty( $posted_content ) ) {\n\t$content = $posted_content;\n} elseif ( ! $error && filesize( $file ) > 0 ) {\n\t$f       = fopen( $file, 'r' );\n\t$content = fread( $f, filesize( $file ) );\n\n\tif ( '.php' === substr( $file, strrpos( $file, '.' ) ) ) {\n\t\t$functions = wp_doc_link_parse( $content );\n\n\t\t$docs_select  = '<select name=\"docs-list\" id=\"docs-list\">';\n\t\t$docs_select .= '<option value=\"\">' . esc_attr__( 'Function Name&hellip;' ) . '</option>';\n\t\tforeach ( $functions as $function ) {\n\t\t\t$docs_select .= '<option value=\"' . esc_attr( urlencode( $function ) ) . '\">' . htmlspecialchars( $function ) . '()</option>';\n\t\t}\n\t\t$docs_select .= '</select>';\n\t}\n\n\t$content = esc_textarea( $content );\n}\n\n$file_description = get_file_description( $relative_file );\n$file_show        = array_search( $file, array_filter( $allowed_files ), true );\n$description      = esc_html( $file_description );\nif ( $file_description !== $file_show ) {\n\t$description .= ' <span>(' . esc_html( $file_show ) . ')</span>';\n}\n?>\n<div class=\"wrap\">\n<h1><?php echo esc_html( $title ); ?></h1>\n\n<?php if ( isset( $_GET['a'] ) ) : ?>\n\t<div id=\"message\" class=\"updated notice is-dismissible\">\n\t\t<p><?php _e( 'File edited successfully.' ); ?></p>\n\t</div>\n<?php elseif ( is_wp_error( $edit_error ) ) : ?>\n\t<div id=\"message\" class=\"notice notice-error\">\n\t\t<p><?php _e( 'There was an error while trying to update the file. You may need to fix something and try updating again.' ); ?></p>\n\t\t<pre><?php echo esc_html( $edit_error->get_error_message() ? $edit_error->get_error_message() : $edit_error->get_error_code() ); ?></pre>\n\t</div>\n<?php endif; ?>\n\n<?php if ( preg_match( '/\\.css$/', $file ) ) : ?>\n\t<div id=\"message\" class=\"notice-info notice\">\n\t\t<p><strong><?php _e( 'Did you know?' ); ?></strong></p>\n\t\t<p>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: Link to Custom CSS section in the Customizer. */\n\t\t\t\t__( 'There&#8217;s no need to change your CSS here &mdash; you can edit and live preview CSS changes in the <a href=\"%s\">built-in CSS editor</a>.' ),\n\t\t\t\tesc_url( add_query_arg( 'autofocus[section]', 'custom_css', admin_url( 'customize.php' ) ) )\n\t\t\t);\n\t\t\t?>\n\t\t</p>\n\t</div>\n<?php endif; ?>\n\n<div class=\"fileedit-sub\">\n<div class=\"alignleft\">\n<h2>\n\t<?php\n\techo $theme->display( 'Name' );\n\tif ( $description ) {\n\t\techo ': ' . $description;}\n\t?>\n</h2>\n</div>\n<div class=\"alignright\">\n\t<form action=\"theme-editor.php\" method=\"get\">\n\t\t<strong><label for=\"theme\"><?php _e( 'Select theme to edit:' ); ?> </label></strong>\n\t\t<select name=\"theme\" id=\"theme\">\n\t\t<?php\n\t\tforeach ( wp_get_themes( array( 'errors' => null ) ) as $a_stylesheet => $a_theme ) {\n\t\t\tif ( $a_theme->errors() && 'theme_no_stylesheet' === $a_theme->errors()->get_error_code() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$selected = ( $a_stylesheet === $stylesheet ) ? ' selected=\"selected\"' : '';\n\t\t\techo \"\\n\\t\" . '<option value=\"' . esc_attr( $a_stylesheet ) . '\"' . $selected . '>' . $a_theme->display( 'Name' ) . '</option>';\n\t\t}\n\t\t?>\n\t\t</select>\n\t\t<?php submit_button( __( 'Select' ), '', 'Submit', false ); ?>\n\t</form>\n</div>\n<br class=\"clear\" />\n</div>\n\n<?php\nif ( $theme->errors() ) {\n\techo '<div class=\"error\"><p><strong>' . __( 'This theme is broken.' ) . '</strong> ' . $theme->errors()->get_error_message() . '</p></div>';\n}\n?>\n\n<div id=\"templateside\">\n\t<h2 id=\"theme-files-label\"><?php _e( 'Theme Files' ); ?></h2>\n\t<ul role=\"tree\" aria-labelledby=\"theme-files-label\">\n\t\t<?php if ( $theme->parent() ) : ?>\n\t\t\t<li class=\"howto\">\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: Link to edit parent theme. */\n\t\t\t\t\t__( 'This child theme inherits templates from a parent theme, %s.' ),\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t'<a href=\"%s\">%s</a>',\n\t\t\t\t\t\tself_admin_url( 'theme-editor.php?theme=' . urlencode( $theme->get_template() ) ),\n\t\t\t\t\t\t$theme->parent()->display( 'Name' )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</li>\n\t\t<?php endif; ?>\n\t\t<li role=\"treeitem\" tabindex=\"-1\" aria-expanded=\"true\" aria-level=\"1\" aria-posinset=\"1\" aria-setsize=\"1\">\n\t\t\t<ul role=\"group\">\n\t\t\t\t<?php wp_print_theme_file_tree( wp_make_theme_file_tree( $allowed_files ) ); ?>\n\t\t\t</ul>\n\t\t</li>\n\t</ul>\n</div>\n\n<?php\nif ( $error ) :\n\techo '<div class=\"error\"><p>' . __( 'File does not exist! Please double check the name and try again.' ) . '</p></div>';\nelse :\n\t?>\n\t<form name=\"template\" id=\"template\" action=\"theme-editor.php\" method=\"post\">\n\t\t<?php wp_nonce_field( 'edit-theme_' . $stylesheet . '_' . $relative_file, 'nonce' ); ?>\n\t\t<div>\n\t\t\t<label for=\"newcontent\" id=\"theme-plugin-editor-label\"><?php _e( 'Selected file content:' ); ?></label>\n\t\t\t<textarea cols=\"70\" rows=\"30\" name=\"newcontent\" id=\"newcontent\" aria-describedby=\"editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4\"><?php echo $content; ?></textarea>\n\t\t\t<input type=\"hidden\" name=\"action\" value=\"update\" />\n\t\t\t<input type=\"hidden\" name=\"file\" value=\"<?php echo esc_attr( $relative_file ); ?>\" />\n\t\t\t<input type=\"hidden\" name=\"theme\" value=\"<?php echo esc_attr( $theme->get_stylesheet() ); ?>\" />\n\t\t</div>\n\n\t\t<?php if ( ! empty( $functions ) ) : ?>\n\t\t\t<div id=\"documentation\" class=\"hide-if-no-js\">\n\t\t\t\t<label for=\"docs-list\"><?php _e( 'Documentation:' ); ?></label>\n\t\t\t\t<?php echo $docs_select; ?>\n\t\t\t\t<input disabled id=\"docs-lookup\" type=\"button\" class=\"button\" value=\"<?php esc_attr_e( 'Look Up' ); ?>\" onclick=\"if ( '' != jQuery('#docs-list').val() ) { window.open( 'https://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_user_locale() ); ?>&amp;version=<?php echo urlencode( get_bloginfo( 'version' ) ); ?>&amp;redirect=true'); }\" />\n\t\t\t</div>\n\t\t<?php endif; ?>\n\n\t\t<div>\n\t\t\t<div class=\"editor-notices\">\n\t\t\t\t<?php if ( is_child_theme() && $theme->get_stylesheet() === get_template() ) : ?>\n\t\t\t\t\t<div class=\"notice notice-warning inline\">\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<?php if ( is_writeable( $file ) ) : ?>\n\t\t\t\t\t\t\t\t<strong><?php _e( 'Caution:' ); ?></strong>\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t<?php _e( 'This is a file in your current parent theme.' ); ?>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t<?php endif; ?>\n\t\t\t</div>\n\t\t\t<?php if ( is_writeable( $file ) ) : ?>\n\t\t\t\t<p class=\"submit\">\n\t\t\t\t\t<?php submit_button( __( 'Update File' ), 'primary', 'submit', false ); ?>\n\t\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t\t</p>\n\t\t\t<?php else : ?>\n\t\t\t\t<p><em>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Documentation URL. */\n\t\t\t\t\t\t__( 'You need to make this file writable before you can save your changes. See <a href=\"%s\">Changing File Permissions</a> for more information.' ),\n\t\t\t\t\t\t__( 'https://wordpress.org/support/article/changing-file-permissions/' )\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</em></p>\n\t\t\t<?php endif; ?>\n\t\t</div>\n\n\t\t<?php wp_print_file_editor_templates(); ?>\n\t</form>\n\t<?php\nendif; // End if $error.\n?>\n<br class=\"clear\" />\n</div>\n<?php\n$dismissed_pointers = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );\nif ( ! in_array( 'theme_editor_notice', $dismissed_pointers, true ) ) :\n\t// Get a back URL.\n\t$referer = wp_get_referer();\n\n\t$excluded_referer_basenames = array( 'theme-editor.php', 'wp-login.php' );\n\n\tif ( $referer && ! in_array( basename( parse_url( $referer, PHP_URL_PATH ) ), $excluded_referer_basenames, true ) ) {\n\t\t$return_url = $referer;\n\t} else {\n\t\t$return_url = admin_url( '/' );\n\t}\n\t?>\n\t<div id=\"file-editor-warning\" class=\"notification-dialog-wrap file-editor-warning hide-if-no-js hidden\">\n\t\t<div class=\"notification-dialog-background\"></div>\n\t\t<div class=\"notification-dialog\">\n\t\t\t<div class=\"file-editor-warning-content\">\n\t\t\t\t<div class=\"file-editor-warning-message\">\n\t\t\t\t\t<h1><?php _e( 'Heads up!' ); ?></h1>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t_e( 'You appear to be making direct edits to your theme in the WordPress dashboard. We recommend that you don&#8217;t! Editing your theme directly could break your site and your changes may be lost in future updates.' );\n\t\t\t\t\t\t?>\n\t\t\t\t\t</p>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( ! $theme->parent() ) {\n\t\t\t\t\t\t\techo '<p>';\n\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: Link to documentation on child themes. */\n\t\t\t\t\t\t\t\t__( 'If you need to tweak more than your theme&#8217;s CSS, you might want to try <a href=\"%s\">making a child theme</a>.' ),\n\t\t\t\t\t\t\t\tesc_url( __( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ) )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\techo '</p>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t<p><?php _e( 'If you decide to go ahead with direct edits anyway, use a file manager to create a copy with a new name and hang on to the original. That way, you can re-enable a functional version if something goes wrong.' ); ?></p>\n\t\t\t\t</div>\n\t\t\t\t<p>\n\t\t\t\t\t<a class=\"button file-editor-warning-go-back\" href=\"<?php echo esc_url( $return_url ); ?>\"><?php _e( 'Go back' ); ?></a>\n\t\t\t\t\t<button type=\"button\" class=\"file-editor-warning-dismiss button button-primary\"><?php _e( 'I understand' ); ?></button>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<?php\nendif; // Editor warning notice.\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 386}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Install theme administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\nrequire ABSPATH . 'wp-admin/includes/theme-install.php';\n\nwp_reset_vars( array( 'tab' ) );\n\nif ( ! current_user_can( 'install_themes' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );\n}\n\nif ( is_multisite() && ! is_network_admin() ) {\n\twp_redirect( network_admin_url( 'theme-install.php' ) );\n\texit;\n}\n\n$title       = __( 'Add Themes' );\n$parent_file = 'themes.php';\n\nif ( ! is_network_admin() ) {\n\t$submenu_file = 'themes.php';\n}\n\n$installed_themes = search_theme_directories();\n\nif ( false === $installed_themes ) {\n\t$installed_themes = array();\n}\n\nforeach ( $installed_themes as $k => $v ) {\n\tif ( false !== strpos( $k, '/' ) ) {\n\t\tunset( $installed_themes[ $k ] );\n\t}\n}\n\nwp_localize_script(\n\t'theme',\n\t'_wpThemeSettings',\n\tarray(\n\t\t'themes'          => false,\n\t\t'settings'        => array(\n\t\t\t'isInstall'  => true,\n\t\t\t'canInstall' => current_user_can( 'install_themes' ),\n\t\t\t'installURI' => current_user_can( 'install_themes' ) ? self_admin_url( 'theme-install.php' ) : null,\n\t\t\t'adminUrl'   => parse_url( self_admin_url(), PHP_URL_PATH ),\n\t\t),\n\t\t'l10n'            => array(\n\t\t\t'addNew'              => __( 'Add New Theme' ),\n\t\t\t'search'              => __( 'Search Themes' ),\n\t\t\t'searchPlaceholder'   => __( 'Search themes...' ), // Placeholder (no ellipsis).\n\t\t\t'upload'              => __( 'Upload Theme' ),\n\t\t\t'back'                => __( 'Back' ),\n\t\t\t'error'               => sprintf(\n\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=\"%s\">support forums</a>.' ),\n\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t),\n\t\t\t'tryAgain'            => __( 'Try Again' ),\n\t\t\t/* translators: %d: Number of themes. */\n\t\t\t'themesFound'         => __( 'Number of Themes found: %d' ),\n\t\t\t'noThemesFound'       => __( 'No themes found. Try a different search.' ),\n\t\t\t'collapseSidebar'     => __( 'Collapse Sidebar' ),\n\t\t\t'expandSidebar'       => __( 'Expand Sidebar' ),\n\t\t\t/* translators: Accessibility text. */\n\t\t\t'selectFeatureFilter' => __( 'Select one or more Theme features to filter by' ),\n\t\t),\n\t\t'installedThemes' => array_keys( $installed_themes ),\n\t\t'activeTheme'     => get_stylesheet(),\n\t)\n);\n\nwp_enqueue_script( 'theme' );\nwp_enqueue_script( 'updates' );\n\nif ( $tab ) {\n\t/**\n\t * Fires before each of the tabs are rendered on the Install Themes page.\n\t *\n\t * The dynamic portion of the hook name, `$tab`, refers to the current\n\t * theme installation tab. Possible values are 'dashboard', 'search', 'upload',\n\t * 'featured', 'new', or 'updated'.\n\t *\n\t * @since 2.8.0\n\t */\n\tdo_action( \"install_themes_pre_{$tab}\" );\n}\n\n$help_overview =\n\t'<p>' . sprintf(\n\t\t/* translators: %s: Theme Directory URL. */\n\t\t__( 'You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the <a href=\"%s\">WordPress Theme Directory</a>. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.' ),\n\t\t__( 'https://wordpress.org/themes/' )\n\t) . '</p>' .\n\t'<p>' . __( 'You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter.' ) . ' <span id=\"live-search-desc\">' . __( 'The search results will be updated as you type.' ) . '</span></p>' .\n\t'<p>' . __( 'Alternately, you can browse the themes that are Featured, Popular, or Latest. When you find a theme you like, you can preview it or install it.' ) . '</p>' .\n\t'<p>' . sprintf(\n\t\t/* translators: %s: /wp-content/themes */\n\t\t__( 'You can Upload a theme manually if you have already downloaded its ZIP archive onto your computer (make sure it is from a trusted and original source). You can also do it the old-fashioned way and copy a downloaded theme&#8217;s folder via FTP into your %s directory.' ),\n\t\t'<code>/wp-content/themes</code>'\n\t) . '</p>';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' => $help_overview,\n\t)\n);\n\n$help_installing =\n\t'<p>' . __( 'Once you have generated a list of themes, you can preview and install any of them. Click on the thumbnail of the theme you&#8217;re interested in previewing. It will open up in a full-screen Preview page to give you a better idea of how that theme will look.' ) . '</p>' .\n\t'<p>' . __( 'To install the theme so you can preview it with your site&#8217;s content and customize its theme options, click the \"Install\" button at the top of the left-hand pane. The theme files will be downloaded to your website automatically. When this is complete, the theme is now available for activation, which you can do by clicking the \"Activate\" link, or by navigating to your Manage Themes screen and clicking the \"Live Preview\" link under any installed theme&#8217;s thumbnail image.' ) . '</p>';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'installing',\n\t\t'title'   => __( 'Previewing and Installing' ),\n\t\t'content' => $help_installing,\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/using-themes/#adding-new-themes\">Documentation on Adding New Themes</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n?>\n<div class=\"wrap\">\n\t<h1 class=\"wp-heading-inline\"><?php echo esc_html( $title ); ?></h1>\n\n\t<?php\n\n\t/**\n\t * Filters the tabs shown on the Add Themes screen.\n\t *\n\t * This filter is for backward compatibility only, for the suppression of the upload tab.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string[] $tabs Associative array of the tabs shown on the Add Themes screen. Default is 'upload'.\n\t */\n\t$tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) );\n\tif ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_themes' ) ) {\n\t\techo ' <button type=\"button\" class=\"upload-view-toggle page-title-action hide-if-no-js\" aria-expanded=\"false\">' . __( 'Upload Theme' ) . '</button>';\n\t}\n\t?>\n\n\t<hr class=\"wp-header-end\">\n\n\t<div class=\"error hide-if-js\">\n\t\t<p><?php _e( 'The Theme Installer screen requires JavaScript.' ); ?></p>\n\t</div>\n\n\t<div class=\"upload-theme\">\n\t<?php install_themes_upload(); ?>\n\t</div>\n\n\t<h2 class=\"screen-reader-text hide-if-no-js\"><?php _e( 'Filter themes list' ); ?></h2>\n\n\t<div class=\"wp-filter hide-if-no-js\">\n\t\t<div class=\"filter-count\">\n\t\t\t<span class=\"count theme-count\"></span>\n\t\t</div>\n\n\t\t<ul class=\"filter-links\">\n\t\t\t<li><a href=\"#\" data-sort=\"featured\"><?php _ex( 'Featured', 'themes' ); ?></a></li>\n\t\t\t<li><a href=\"#\" data-sort=\"popular\"><?php _ex( 'Popular', 'themes' ); ?></a></li>\n\t\t\t<li><a href=\"#\" data-sort=\"new\"><?php _ex( 'Latest', 'themes' ); ?></a></li>\n\t\t\t<li><a href=\"#\" data-sort=\"favorites\"><?php _ex( 'Favorites', 'themes' ); ?></a></li>\n\t\t</ul>\n\n\t\t<button type=\"button\" class=\"button drawer-toggle\" aria-expanded=\"false\"><?php _e( 'Feature Filter' ); ?></button>\n\n\t\t<form class=\"search-form\"></form>\n\n\t\t<div class=\"favorites-form\">\n\t\t\t<?php\n\t\t\t$action = 'save_wporg_username_' . get_current_user_id();\n\t\t\tif ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) {\n\t\t\t\t$user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' );\n\t\t\t\tupdate_user_meta( get_current_user_id(), 'wporg_favorites', $user );\n\t\t\t} else {\n\t\t\t\t$user = get_user_option( 'wporg_favorites' );\n\t\t\t}\n\t\t\t?>\n\t\t\t<p class=\"install-help\"><?php _e( 'If you have marked themes as favorites on WordPress.org, you can browse them here.' ); ?></p>\n\n\t\t\t<p>\n\t\t\t\t<label for=\"wporg-username-input\"><?php _e( 'Your WordPress.org username:' ); ?></label>\n\t\t\t\t<input type=\"hidden\" id=\"wporg-username-nonce\" name=\"_wpnonce\" value=\"<?php echo esc_attr( wp_create_nonce( $action ) ); ?>\" />\n\t\t\t\t<input type=\"search\" id=\"wporg-username-input\" value=\"<?php echo esc_attr( $user ); ?>\" />\n\t\t\t\t<input type=\"button\" class=\"button favorites-form-submit\" value=\"<?php esc_attr_e( 'Get Favorites' ); ?>\" />\n\t\t\t</p>\n\t\t</div>\n\n\t\t<div class=\"filter-drawer\">\n\t\t\t<div class=\"buttons\">\n\t\t\t\t<button type=\"button\" class=\"apply-filters button\"><?php _e( 'Apply Filters' ); ?><span></span></button>\n\t\t\t\t<button type=\"button\" class=\"clear-filters button\" aria-label=\"<?php esc_attr_e( 'Clear current filters' ); ?>\"><?php _e( 'Clear' ); ?></button>\n\t\t\t</div>\n\t\t<?php\n\t\t// Use the core list, rather than the .org API, due to inconsistencies\n\t\t// and to ensure tags are translated.\n\t\t$feature_list = get_theme_feature_list( false );\n\n\t\tforeach ( $feature_list as $feature_name => $features ) {\n\t\t\techo '<fieldset class=\"filter-group\">';\n\t\t\t$feature_name = esc_html( $feature_name );\n\t\t\techo '<legend>' . $feature_name . '</legend>';\n\t\t\techo '<div class=\"filter-group-feature\">';\n\t\t\tforeach ( $features as $feature => $feature_name ) {\n\t\t\t\t$feature = esc_attr( $feature );\n\t\t\t\techo '<input type=\"checkbox\" id=\"filter-id-' . $feature . '\" value=\"' . $feature . '\" /> ';\n\t\t\t\techo '<label for=\"filter-id-' . $feature . '\">' . $feature_name . '</label>';\n\t\t\t}\n\t\t\techo '</div>';\n\t\t\techo '</fieldset>';\n\t\t}\n\t\t?>\n\t\t\t<div class=\"buttons\">\n\t\t\t\t<button type=\"button\" class=\"apply-filters button\"><?php _e( 'Apply Filters' ); ?><span></span></button>\n\t\t\t\t<button type=\"button\" class=\"clear-filters button\" aria-label=\"<?php esc_attr_e( 'Clear current filters' ); ?>\"><?php _e( 'Clear' ); ?></button>\n\t\t\t</div>\n\t\t\t<div class=\"filtered-by\">\n\t\t\t\t<span><?php _e( 'Filtering by:' ); ?></span>\n\t\t\t\t<div class=\"tags\"></div>\n\t\t\t\t<button type=\"button\" class=\"button-link edit-filters\"><?php _e( 'Edit Filters' ); ?></button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<h2 class=\"screen-reader-text hide-if-no-js\"><?php _e( 'Themes list' ); ?></h2>\n\t<div class=\"theme-browser content-filterable\"></div>\n\t<div class=\"theme-install-overlay wp-full-overlay expanded\"></div>\n\n\t<p class=\"no-themes\"><?php _e( 'No themes found. Try a different search.' ); ?></p>\n\t<span class=\"spinner\"></span>\n\n<?php\nif ( $tab ) {\n\t/**\n\t * Fires at the top of each of the tabs on the Install Themes page.\n\t *\n\t * The dynamic portion of the hook name, `$tab`, refers to the current\n\t * theme installation tab. Possible values are 'dashboard', 'search', 'upload',\n\t * 'featured', 'new', or 'updated'.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param int $paged Number of the current page of results being viewed.\n\t */\n\tdo_action( \"install_themes_{$tab}\", $paged );\n}\n?>\n</div>\n\n<script id=\"tmpl-theme\" type=\"text/template\">\n\t<# if ( data.screenshot_url ) { #>\n\t\t<div class=\"theme-screenshot\">\n\t\t\t<img src=\"{{ data.screenshot_url }}\" alt=\"\" />\n\t\t</div>\n\t<# } else { #>\n\t\t<div class=\"theme-screenshot blank\"></div>\n\t<# } #>\n\n\t<# if ( data.installed ) { #>\n\t\t<div class=\"notice notice-success notice-alt\"><p><?php _ex( 'Installed', 'theme' ); ?></p></div>\n\t<# } #>\n\n\t<# if ( ! data.compatible_wp || ! data.compatible_php ) { #>\n\t\t<div class=\"notice notice-error notice-alt\"><p>\n\t\t\t<# if ( ! data.compatible_wp && ! data.compatible_php ) { #>\n\t\t\t\t<?php\n\t\t\t\t_e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );\n\t\t\t\tif ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */\n\t\t\t\t\t\t' ' . __( '<a href=\"%1$s\">Please update WordPress</a>, and then <a href=\"%2$s\">learn more about updating PHP</a>.' ),\n\t\t\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t);\n\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t} elseif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t);\n\t\t\t\t} elseif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t);\n\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t<# } else if ( ! data.compatible_wp ) { #>\n\t\t\t\t<?php\n\t\t\t\t_e( 'This theme doesn&#8217;t work with your version of WordPress.' );\n\t\t\t\tif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t<# } else if ( ! data.compatible_php ) { #>\n\t\t\t\t<?php\n\t\t\t\t_e( 'This theme doesn&#8217;t work with your version of PHP.' );\n\t\t\t\tif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t);\n\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t<# } #>\n\t\t</p></div>\n\t<# } #>\n\n\t<span class=\"more-details\"><?php _ex( 'Details &amp; Preview', 'theme' ); ?></span>\n\t<div class=\"theme-author\">\n\t\t<?php\n\t\t/* translators: %s: Theme author name. */\n\t\tprintf( __( 'By %s' ), '{{ data.author }}' );\n\t\t?>\n\t</div>\n\n\t<div class=\"theme-id-container\">\n\t\t<h3 class=\"theme-name\">{{ data.name }}</h3>\n\n\t\t<div class=\"theme-actions\">\n\t\t\t<# if ( data.installed ) { #>\n\t\t\t\t<# if ( data.compatible_wp && data.compatible_php ) { #>\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );\n\t\t\t\t\t?>\n\t\t\t\t\t<# if ( data.activate_url ) { #>\n\t\t\t\t\t\t<# if ( ! data.active ) { #>\n\t\t\t\t\t\t\t<a class=\"button button-primary activate\" href=\"{{ data.activate_url }}\" aria-label=\"<?php echo esc_attr( $aria_label ); ?>\"><?php _e( 'Activate' ); ?></a>\n\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t<button class=\"button button-primary disabled\"><?php _ex( 'Activated', 'theme' ); ?></button>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t<# } #>\n\t\t\t\t\t<# if ( data.customize_url ) { #>\n\t\t\t\t\t\t<# if ( ! data.active ) { #>\n\t\t\t\t\t\t\t<a class=\"button load-customize\" href=\"{{ data.customize_url }}\"><?php _e( 'Live Preview' ); ?></a>\n\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t<a class=\"button load-customize\" href=\"{{ data.customize_url }}\"><?php _e( 'Customize' ); ?></a>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t<button class=\"button preview install-theme-preview\"><?php _e( 'Preview' ); ?></button>\n\t\t\t\t\t<# } #>\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );\n\t\t\t\t\t?>\n\t\t\t\t\t<# if ( data.activate_url ) { #>\n\t\t\t\t\t\t<a class=\"button button-primary disabled\" aria-label=\"<?php echo esc_attr( $aria_label ); ?>\"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>\n\t\t\t\t\t<# } #>\n\t\t\t\t\t<# if ( data.customize_url ) { #>\n\t\t\t\t\t\t<a class=\"button disabled\"><?php _e( 'Live Preview' ); ?></a>\n\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t<button class=\"button disabled\"><?php _e( 'Preview' ); ?></button>\n\t\t\t\t\t<# } #>\n\t\t\t\t<# } #>\n\t\t\t<# } else { #>\n\t\t\t\t<# if ( data.compatible_wp && data.compatible_php ) { #>\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t$aria_label = sprintf( _x( 'Install %s', 'theme' ), '{{ data.name }}' );\n\t\t\t\t\t?>\n\t\t\t\t\t<a class=\"button button-primary theme-install\" data-name=\"{{ data.name }}\" data-slug=\"{{ data.id }}\" href=\"{{ data.install_url }}\" aria-label=\"<?php echo esc_attr( $aria_label ); ?>\"><?php _e( 'Install' ); ?></a>\n\t\t\t\t\t<button class=\"button preview install-theme-preview\"><?php _e( 'Preview' ); ?></button>\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t$aria_label = sprintf( _x( 'Cannot Install %s', 'theme' ), '{{ data.name }}' );\n\t\t\t\t\t?>\n\t\t\t\t\t<a class=\"button button-primary disabled\" data-name=\"{{ data.name }}\" aria-label=\"<?php echo esc_attr( $aria_label ); ?>\"><?php _ex( 'Cannot Install', 'theme' ); ?></a>\n\t\t\t\t\t<button class=\"button disabled\"><?php _e( 'Preview' ); ?></button>\n\t\t\t\t<# } #>\n\t\t\t<# } #>\n\t\t</div>\n\t</div>\n</script>\n\n<script id=\"tmpl-theme-preview\" type=\"text/template\">\n\t<div class=\"wp-full-overlay-sidebar\">\n\t\t<div class=\"wp-full-overlay-header\">\n\t\t\t<button class=\"close-full-overlay\"><span class=\"screen-reader-text\"><?php _e( 'Close' ); ?></span></button>\n\t\t\t<button class=\"previous-theme\"><span class=\"screen-reader-text\"><?php _e( 'Previous theme' ); ?></span></button>\n\t\t\t<button class=\"next-theme\"><span class=\"screen-reader-text\"><?php _e( 'Next theme' ); ?></span></button>\n\t\t\t<# if ( data.installed ) { #>\n\t\t\t\t<# if ( data.compatible_wp && data.compatible_php ) { #>\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );\n\t\t\t\t\t?>\n\t\t\t\t\t<# if ( ! data.active ) { #>\n\t\t\t\t\t\t<a class=\"button button-primary activate\" href=\"{{ data.activate_url }}\" aria-label=\"<?php echo esc_attr( $aria_label ); ?>\"><?php _e( 'Activate' ); ?></a>\n\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t<button class=\"button button-primary disabled\"><?php _ex( 'Activated', 'theme' ); ?></button>\n\t\t\t\t\t<# } #>\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<a class=\"button button-primary disabled\" ><?php _ex( 'Cannot Activate', 'theme' ); ?></a>\n\t\t\t\t<# } #>\n\t\t\t<# } else { #>\n\t\t\t\t<# if ( data.compatible_wp && data.compatible_php ) { #>\n\t\t\t\t\t<a href=\"{{ data.install_url }}\" class=\"button button-primary theme-install\" data-name=\"{{ data.name }}\" data-slug=\"{{ data.id }}\"><?php _e( 'Install' ); ?></a>\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<a class=\"button button-primary disabled\" ><?php _ex( 'Cannot Install', 'theme' ); ?></a>\n\t\t\t\t<# } #>\n\t\t\t<# } #>\n\t\t</div>\n\t\t<div class=\"wp-full-overlay-sidebar-content\">\n\t\t\t<div class=\"install-theme-info\">\n\t\t\t\t<h3 class=\"theme-name\">{{ data.name }}</h3>\n\t\t\t\t\t<span class=\"theme-by\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t/* translators: %s: Theme author name. */\n\t\t\t\t\t\tprintf( __( 'By %s' ), '{{ data.author }}' );\n\t\t\t\t\t\t?>\n\t\t\t\t\t</span>\n\n\t\t\t\t\t<img class=\"theme-screenshot\" src=\"{{ data.screenshot_url }}\" alt=\"\" />\n\n\t\t\t\t\t<div class=\"theme-details\">\n\t\t\t\t\t\t<# if ( data.rating ) { #>\n\t\t\t\t\t\t\t<div class=\"theme-rating\">\n\t\t\t\t\t\t\t\t{{{ data.stars }}}\n\t\t\t\t\t\t\t\t<a class=\"num-ratings\" href=\"{{ data.reviews_url }}\">\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t/* translators: %s: Number of ratings. */\n\t\t\t\t\t\t\t\t\tprintf( __( '(%s ratings)' ), '{{ data.num_ratings }}' );\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t<span class=\"no-rating\"><?php _e( 'This theme has not been rated yet.' ); ?></span>\n\t\t\t\t\t\t<# } #>\n\n\t\t\t\t\t\t<div class=\"theme-version\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/* translators: %s: Theme version. */\n\t\t\t\t\t\t\tprintf( __( 'Version: %s' ), '{{ data.version }}' );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<# if ( ! data.compatible_wp || ! data.compatible_php ) { #>\n\t\t\t\t\t\t\t<div class=\"notice notice-error notice-alt notice-large\"><p>\n\t\t\t\t\t\t\t\t<# if ( ! data.compatible_wp && ! data.compatible_php ) { #>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t_e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );\n\t\t\t\t\t\t\t\t\tif ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%1$s\">Please update WordPress</a>, and then <a href=\"%2$s\">learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t\t\t\t\t} elseif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} elseif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\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<# } else if ( ! data.compatible_wp ) { #>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t_e( 'This theme doesn&#8217;t work with your version of WordPress.' );\n\t\t\t\t\t\t\t\t\tif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\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?>\n\t\t\t\t\t\t\t\t<# } else if ( ! data.compatible_php ) { #>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t_e( 'This theme doesn&#8217;t work with your version of PHP.' );\n\t\t\t\t\t\t\t\t\tif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\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<# } #>\n\t\t\t\t\t\t\t</p></div>\n\t\t\t\t\t\t<# } #>\n\n\t\t\t\t\t\t<div class=\"theme-description\">{{{ data.description }}}</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"wp-full-overlay-footer\">\n\t\t\t\t<button type=\"button\" class=\"collapse-sidebar button\" aria-expanded=\"true\" aria-label=\"<?php esc_attr_e( 'Collapse Sidebar' ); ?>\">\n\t\t\t\t\t<span class=\"collapse-sidebar-arrow\"></span>\n\t\t\t\t\t<span class=\"collapse-sidebar-label\"><?php _e( 'Collapse' ); ?></span>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"wp-full-overlay-main\">\n\t\t<iframe src=\"{{ data.preview_url }}\" title=\"<?php esc_attr_e( 'Preview' ); ?>\"></iframe>\n\t</div>\n</script>\n\n<?php\nwp_print_request_filesystem_credentials_modal();\nwp_print_admin_notice_templates();\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 541}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Themes administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) {\n\twp_die(\n\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t'<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',\n\t\t403\n\t);\n}\n\nif ( current_user_can( 'switch_themes' ) && isset( $_GET['action'] ) ) {\n\tif ( 'activate' === $_GET['action'] ) {\n\t\tcheck_admin_referer( 'switch-theme_' . $_GET['stylesheet'] );\n\t\t$theme = wp_get_theme( $_GET['stylesheet'] );\n\n\t\tif ( ! $theme->exists() || ! $theme->is_allowed() ) {\n\t\t\twp_die(\n\t\t\t\t'<h1>' . __( 'Something went wrong.' ) . '</h1>' .\n\t\t\t\t'<p>' . __( 'The requested theme does not exist.' ) . '</p>',\n\t\t\t\t403\n\t\t\t);\n\t\t}\n\n\t\tswitch_theme( $theme->get_stylesheet() );\n\t\twp_redirect( admin_url( 'themes.php?activated=true' ) );\n\t\texit;\n\t} elseif ( 'resume' === $_GET['action'] ) {\n\t\tcheck_admin_referer( 'resume-theme_' . $_GET['stylesheet'] );\n\t\t$theme = wp_get_theme( $_GET['stylesheet'] );\n\n\t\tif ( ! current_user_can( 'resume_theme', $_GET['stylesheet'] ) ) {\n\t\t\twp_die(\n\t\t\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t\t\t'<p>' . __( 'Sorry, you are not allowed to resume this theme.' ) . '</p>',\n\t\t\t\t403\n\t\t\t);\n\t\t}\n\n\t\t$result = resume_theme( $theme->get_stylesheet(), self_admin_url( 'themes.php?error=resuming' ) );\n\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\twp_die( $result );\n\t\t}\n\n\t\twp_redirect( admin_url( 'themes.php?resumed=true' ) );\n\t\texit;\n\t} elseif ( 'delete' === $_GET['action'] ) {\n\t\tcheck_admin_referer( 'delete-theme_' . $_GET['stylesheet'] );\n\t\t$theme = wp_get_theme( $_GET['stylesheet'] );\n\n\t\tif ( ! current_user_can( 'delete_themes' ) ) {\n\t\t\twp_die(\n\t\t\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t\t\t'<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>',\n\t\t\t\t403\n\t\t\t);\n\t\t}\n\n\t\tif ( ! $theme->exists() ) {\n\t\t\twp_die(\n\t\t\t\t'<h1>' . __( 'Something went wrong.' ) . '</h1>' .\n\t\t\t\t'<p>' . __( 'The requested theme does not exist.' ) . '</p>',\n\t\t\t\t403\n\t\t\t);\n\t\t}\n\n\t\t$active = wp_get_theme();\n\t\tif ( $active->get( 'Template' ) == $_GET['stylesheet'] ) {\n\t\t\twp_redirect( admin_url( 'themes.php?delete-active-child=true' ) );\n\t\t} else {\n\t\t\tdelete_theme( $_GET['stylesheet'] );\n\t\t\twp_redirect( admin_url( 'themes.php?deleted=true' ) );\n\t\t}\n\t\texit;\n\t} elseif ( 'enable-auto-update' === $_GET['action'] ) {\n\t\tif ( ! ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to enable themes automatic updates.' ) );\n\t\t}\n\n\t\tcheck_admin_referer( 'updates' );\n\n\t\t$all_items    = wp_get_themes();\n\t\t$auto_updates = (array) get_site_option( 'auto_update_themes', array() );\n\n\t\t$auto_updates[] = $_GET['stylesheet'];\n\t\t$auto_updates   = array_unique( $auto_updates );\n\t\t// Remove themes that have been deleted since the site option was last updated.\n\t\t$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) );\n\n\t\tupdate_site_option( 'auto_update_themes', $auto_updates );\n\n\t\twp_redirect( admin_url( 'themes.php?enabled-auto-update=true' ) );\n\n\t\texit;\n\t} elseif ( 'disable-auto-update' === $_GET['action'] ) {\n\t\tif ( ! ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to disable themes automatic updates.' ) );\n\t\t}\n\n\t\tcheck_admin_referer( 'updates' );\n\n\t\t$all_items    = wp_get_themes();\n\t\t$auto_updates = (array) get_site_option( 'auto_update_themes', array() );\n\n\t\t$auto_updates = array_diff( $auto_updates, array( $_GET['stylesheet'] ) );\n\t\t// Remove themes that have been deleted since the site option was last updated.\n\t\t$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) );\n\n\t\tupdate_site_option( 'auto_update_themes', $auto_updates );\n\n\t\twp_redirect( admin_url( 'themes.php?disabled-auto-update=true' ) );\n\n\t\texit;\n\t}\n}\n\n$title       = __( 'Manage Themes' );\n$parent_file = 'themes.php';\n\n// Help tab: Overview.\nif ( current_user_can( 'switch_themes' ) ) {\n\t$help_overview = '<p>' . __( 'This screen is used for managing your installed themes. Aside from the default theme(s) included with your WordPress installation, themes are designed and developed by third parties.' ) . '</p>' .\n\t\t'<p>' . __( 'From this screen you can:' ) . '</p>' .\n\t\t'<ul><li>' . __( 'Hover or tap to see Activate and Live Preview buttons' ) . '</li>' .\n\t\t'<li>' . __( 'Click on the theme to see the theme name, version, author, description, tags, and the Delete link' ) . '</li>' .\n\t\t'<li>' . __( 'Click Customize for the current theme or Live Preview for any other theme to see a live preview' ) . '</li></ul>' .\n\t\t'<p>' . __( 'The current theme is displayed highlighted as the first theme.' ) . '</p>' .\n\t\t'<p>' . __( 'The search for installed themes will search for terms in their name, description, author, or tag.' ) . ' <span id=\"live-search-desc\">' . __( 'The search results will be updated as you type.' ) . '</span></p>';\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'overview',\n\t\t\t'title'   => __( 'Overview' ),\n\t\t\t'content' => $help_overview,\n\t\t)\n\t);\n} // End if 'switch_themes'.\n\n// Help tab: Adding Themes.\nif ( current_user_can( 'install_themes' ) ) {\n\tif ( is_multisite() ) {\n\t\t$help_install = '<p>' . __( 'Installing themes on Multisite can only be done from the Network Admin section.' ) . '</p>';\n\t} else {\n\t\t$help_install = '<p>' . sprintf(\n\t\t\t/* translators: %s: https://wordpress.org/themes/ */\n\t\t\t__( 'If you would like to see more themes to choose from, click on the &#8220;Add New&#8221; button and you will be able to browse or search for additional themes from the <a href=\"%s\">WordPress Theme Directory</a>. Themes in the WordPress Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!' ),\n\t\t\t__( 'https://wordpress.org/themes/' )\n\t\t) . '</p>';\n\t}\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'adding-themes',\n\t\t\t'title'   => __( 'Adding Themes' ),\n\t\t\t'content' => $help_install,\n\t\t)\n\t);\n} // End if 'install_themes'.\n\n// Help tab: Previewing and Customizing.\nif ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {\n\t$help_customize =\n\t\t'<p>' . __( 'Tap or hover on any theme then click the Live Preview button to see a live preview of that theme and change theme options in a separate, full-screen view. You can also find a Live Preview button at the bottom of the theme details screen. Any installed theme can be previewed and customized in this way.' ) . '</p>' .\n\t\t'<p>' . __( 'The theme being previewed is fully interactive &mdash; navigate to different pages to see how the theme handles posts, archives, and other page templates. The settings may differ depending on what theme features the theme being previewed supports. To accept the new settings and activate the theme all in one step, click the Publish &amp; Activate button above the menu.' ) . '</p>' .\n\t\t'<p>' . __( 'When previewing on smaller monitors, you can use the collapse icon at the bottom of the left-hand pane. This will hide the pane, giving you more room to preview your site in the new theme. To bring the pane back, click on the collapse icon again.' ) . '</p>';\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'customize-preview-themes',\n\t\t\t'title'   => __( 'Previewing and Customizing' ),\n\t\t\t'content' => $help_customize,\n\t\t)\n\t);\n} // End if 'edit_theme_options' && 'customize'.\n\n$help_sidebar_autoupdates = '';\n\n// Help tab: Auto-updates.\nif ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) {\n\t$help_tab_autoupdates =\n\t\t'<p>' . __( 'Auto-updates can be enabled or disabled for each individual theme. Themes with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates depends on the WP-Cron task scheduling system.' ) . '</p>' .\n\t\t'<p>' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '</p>';\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'plugins-themes-auto-updates',\n\t\t\t'title'   => __( 'Auto-updates' ),\n\t\t\t'content' => $help_tab_autoupdates,\n\t\t)\n\t);\n\n\t$help_sidebar_autoupdates = '<p>' . __( '<a href=\"https://wordpress.org/support/article/plugins-themes-auto-updates/\">Learn more: Auto-updates documentation</a>' ) . '</p>';\n} // End if 'update_themes' && 'wp_is_auto_update_enabled_for_type'.\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/using-themes/\">Documentation on Using Themes</a>' ) . '</p>' .\n\t$help_sidebar_autoupdates .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nif ( current_user_can( 'switch_themes' ) ) {\n\t$themes = wp_prepare_themes_for_js();\n} else {\n\t$themes = wp_prepare_themes_for_js( array( wp_get_theme() ) );\n}\nwp_reset_vars( array( 'theme', 'search' ) );\n\nwp_localize_script(\n\t'theme',\n\t'_wpThemeSettings',\n\tarray(\n\t\t'themes'   => $themes,\n\t\t'settings' => array(\n\t\t\t'canInstall'    => ( ! is_multisite() && current_user_can( 'install_themes' ) ),\n\t\t\t'installURI'    => ( ! is_multisite() && current_user_can( 'install_themes' ) ) ? admin_url( 'theme-install.php' ) : null,\n\t\t\t'confirmDelete' => __( \"Are you sure you want to delete this theme?\\n\\nClick 'Cancel' to go back, 'OK' to confirm the delete.\" ),\n\t\t\t'adminUrl'      => parse_url( admin_url(), PHP_URL_PATH ),\n\t\t),\n\t\t'l10n'     => array(\n\t\t\t'addNew'            => __( 'Add New Theme' ),\n\t\t\t'search'            => __( 'Search Installed Themes' ),\n\t\t\t'searchPlaceholder' => __( 'Search installed themes...' ), // Placeholder (no ellipsis).\n\t\t\t/* translators: %d: Number of themes. */\n\t\t\t'themesFound'       => __( 'Number of Themes found: %d' ),\n\t\t\t'noThemesFound'     => __( 'No themes found. Try a different search.' ),\n\t\t),\n\t)\n);\n\nadd_thickbox();\nwp_enqueue_script( 'theme' );\nwp_enqueue_script( 'updates' );\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n\n<div class=\"wrap\">\n\t<h1 class=\"wp-heading-inline\"><?php esc_html_e( 'Themes' ); ?>\n\t\t<span class=\"title-count theme-count\"><?php echo ! empty( $_GET['search'] ) ? __( '&hellip;' ) : count( $themes ); ?></span>\n\t</h1>\n\n\t<?php if ( ! is_multisite() && current_user_can( 'install_themes' ) ) : ?>\n\t\t<a href=\"<?php echo admin_url( 'theme-install.php' ); ?>\" class=\"hide-if-no-js page-title-action\"><?php echo esc_html_x( 'Add New', 'theme' ); ?></a>\n\t<?php endif; ?>\n\n\t<form class=\"search-form\"></form>\n\n\t<hr class=\"wp-header-end\">\n<?php\nif ( ! validate_current_theme() || isset( $_GET['broken'] ) ) {\n\t?>\n\t<div id=\"message1\" class=\"updated notice is-dismissible\"><p><?php _e( 'The active theme is broken. Reverting to the default theme.' ); ?></p></div>\n\t<?php\n} elseif ( isset( $_GET['activated'] ) ) {\n\tif ( isset( $_GET['previewed'] ) ) {\n\t\t?>\n\t\t<div id=\"message2\" class=\"updated notice is-dismissible\"><p><?php _e( 'Settings saved and theme activated.' ); ?> <a href=\"<?php echo home_url( '/' ); ?>\"><?php _e( 'Visit site' ); ?></a></p></div>\n\t\t<?php\n\t} else {\n\t\t?>\n\t\t<div id=\"message2\" class=\"updated notice is-dismissible\"><p><?php _e( 'New theme activated.' ); ?> <a href=\"<?php echo home_url( '/' ); ?>\"><?php _e( 'Visit site' ); ?></a></p></div>\n\t\t<?php\n\t}\n} elseif ( isset( $_GET['deleted'] ) ) {\n\t?>\n\t<div id=\"message3\" class=\"updated notice is-dismissible\"><p><?php _e( 'Theme deleted.' ); ?></p></div>\n\t<?php\n} elseif ( isset( $_GET['delete-active-child'] ) ) {\n\t?>\n\t<div id=\"message4\" class=\"error\"><p><?php _e( 'You cannot delete a theme while it has an active child theme.' ); ?></p></div>\n\t<?php\n} elseif ( isset( $_GET['resumed'] ) ) {\n\t?>\n\t<div id=\"message5\" class=\"updated notice is-dismissible\"><p><?php _e( 'Theme resumed.' ); ?></p></div>\n\t<?php\n} elseif ( isset( $_GET['error'] ) && 'resuming' === $_GET['error'] ) {\n\t?>\n\t<div id=\"message6\" class=\"error\"><p><?php _e( 'Theme could not be resumed because it triggered a <strong>fatal error</strong>.' ); ?></p></div>\n\t<?php\n} elseif ( isset( $_GET['enabled-auto-update'] ) ) {\n\t?>\n\t<div id=\"message7\" class=\"updated notice is-dismissible\"><p><?php _e( 'Theme will be auto-updated.' ); ?></p></div>\n\t<?php\n} elseif ( isset( $_GET['disabled-auto-update'] ) ) {\n\t?>\n\t<div id=\"message8\" class=\"updated notice is-dismissible\"><p><?php _e( 'Theme will no longer be auto-updated.' ); ?></p></div>\n\t<?php\n}\n\n$ct = wp_get_theme();\n\nif ( $ct->errors() && ( ! is_multisite() || current_user_can( 'manage_network_themes' ) ) ) {\n\techo '<div class=\"error\"><p>' . __( 'Error:' ) . ' ' . $ct->errors()->get_error_message() . '</p></div>';\n}\n\n/*\n// Certain error codes are less fatal than others. We can still display theme information in most cases.\nif ( ! $ct->errors() || ( 1 === count( $ct->errors()->get_error_codes() )\n\t&& in_array( $ct->errors()->get_error_code(), array( 'theme_no_parent', 'theme_parent_invalid', 'theme_no_index' ) ) ) ) : ?>\n*/\n\n\t// Pretend you didn't see this.\n\t$current_theme_actions = array();\nif ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) {\n\tforeach ( (array) $submenu['themes.php'] as $item ) {\n\t\t$class = '';\n\t\tif ( 'themes.php' === $item[2] || 'theme-editor.php' === $item[2] || 0 === strpos( $item[2], 'customize.php' ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\t// 0 = name, 1 = capability, 2 = file.\n\t\tif ( ( strcmp( $self, $item[2] ) == 0 && empty( $parent_file ) ) || ( $parent_file && ( $item[2] == $parent_file ) ) ) {\n\t\t\t$class = ' current';\n\t\t}\n\t\tif ( ! empty( $submenu[ $item[2] ] ) ) {\n\t\t\t$submenu[ $item[2] ] = array_values( $submenu[ $item[2] ] ); // Re-index.\n\t\t\t$menu_hook           = get_plugin_page_hook( $submenu[ $item[2] ][0][2], $item[2] );\n\t\t\tif ( file_exists( WP_PLUGIN_DIR . \"/{$submenu[$item[2]][0][2]}\" ) || ! empty( $menu_hook ) ) {\n\t\t\t\t$current_theme_actions[] = \"<a class='button$class' href='admin.php?page={$submenu[$item[2]][0][2]}'>{$item[0]}</a>\";\n\t\t\t} else {\n\t\t\t\t$current_theme_actions[] = \"<a class='button$class' href='{$submenu[$item[2]][0][2]}'>{$item[0]}</a>\";\n\t\t\t}\n\t\t} elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) {\n\t\t\t$menu_file = $item[2];\n\n\t\t\tif ( current_user_can( 'customize' ) ) {\n\t\t\t\tif ( 'custom-header' === $menu_file ) {\n\t\t\t\t\t$current_theme_actions[] = \"<a class='button hide-if-no-customize$class' href='customize.php?autofocus[control]=header_image'>{$item[0]}</a>\";\n\t\t\t\t} elseif ( 'custom-background' === $menu_file ) {\n\t\t\t\t\t$current_theme_actions[] = \"<a class='button hide-if-no-customize$class' href='customize.php?autofocus[control]=background_image'>{$item[0]}</a>\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$pos = strpos( $menu_file, '?' );\n\t\t\tif ( false !== $pos ) {\n\t\t\t\t$menu_file = substr( $menu_file, 0, $pos );\n\t\t\t}\n\n\t\t\tif ( file_exists( ABSPATH . \"wp-admin/$menu_file\" ) ) {\n\t\t\t\t$current_theme_actions[] = \"<a class='button$class' href='{$item[2]}'>{$item[0]}</a>\";\n\t\t\t} else {\n\t\t\t\t$current_theme_actions[] = \"<a class='button$class' href='themes.php?page={$item[2]}'>{$item[0]}</a>\";\n\t\t\t}\n\t\t}\n\t}\n}\n\n?>\n\n<?php\n$class_name = 'theme-browser';\nif ( ! empty( $_GET['search'] ) ) {\n\t$class_name .= ' search-loading';\n}\n?>\n<div class=\"<?php echo esc_attr( $class_name ); ?>\">\n\t<div class=\"themes wp-clearfix\">\n\n<?php\n/*\n * This PHP is synchronized with the tmpl-theme template below!\n */\n\nforeach ( $themes as $theme ) :\n\t$aria_action = esc_attr( $theme['id'] . '-action' );\n\t$aria_name   = esc_attr( $theme['id'] . '-name' );\n\n\t$active_class = '';\n\tif ( $theme['active'] ) {\n\t\t$active_class = ' active';\n\t}\n\t?>\n<div class=\"theme<?php echo $active_class; ?>\" tabindex=\"0\" aria-describedby=\"<?php echo $aria_action . ' ' . $aria_name; ?>\">\n\t<?php if ( ! empty( $theme['screenshot'][0] ) ) { ?>\n\t\t<div class=\"theme-screenshot\">\n\t\t\t<img src=\"<?php echo $theme['screenshot'][0]; ?>\" alt=\"\" />\n\t\t</div>\n\t<?php } else { ?>\n\t\t<div class=\"theme-screenshot blank\"></div>\n\t<?php } ?>\n\n\t<?php if ( $theme['hasUpdate'] ) : ?>\n\t\t<?php if ( $theme['updateResponse']['compatibleWP'] && $theme['updateResponse']['compatiblePHP'] ) : ?>\n\t\t\t<div class=\"update-message notice inline notice-warning notice-alt\"><p>\n\t\t\t\t<?php if ( $theme['hasPackage'] ) : ?>\n\t\t\t\t\t<?php _e( 'New version available. <button class=\"button-link\" type=\"button\">Update now</button>' ); ?>\n\t\t\t\t<?php else : ?>\n\t\t\t\t\t<?php _e( 'New version available.' ); ?>\n\t\t\t\t<?php endif; ?>\n\t\t\t</p></div>\n\t\t<?php else : ?>\n\t\t\t<div class=\"update-message notice inline notice-error notice-alt\"><p>\n\t\t\t\t<?php\n\t\t\t\tif ( ! $theme['updateResponse']['compatibleWP'] && ! $theme['updateResponse']['compatiblePHP'] ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),\n\t\t\t\t\t\t$theme['name']\n\t\t\t\t\t);\n\t\t\t\t\tif ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */\n\t\t\t\t\t\t\t' ' . __( '<a href=\"%1$s\">Please update WordPress</a>, and then <a href=\"%2$s\">learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t);\n\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t} elseif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t\t);\n\t\t\t\t\t} elseif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t);\n\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t}\n\t\t\t\t} elseif ( ! $theme['updateResponse']['compatibleWP'] ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),\n\t\t\t\t\t\t$theme['name']\n\t\t\t\t\t);\n\t\t\t\t\tif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} elseif ( ! $theme['updateResponse']['compatiblePHP'] ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),\n\t\t\t\t\t\t$theme['name']\n\t\t\t\t\t);\n\t\t\t\t\tif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t);\n\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</p></div>\n\t\t<?php endif; ?>\n\t<?php endif; ?>\n\n\t<?php\n\tif ( ! $theme['compatibleWP'] || ! $theme['compatiblePHP'] ) {\n\t\techo '<div class=\"notice inline notice-error notice-alt\"><p>';\n\t\tif ( ! $theme['compatibleWP'] && ! $theme['compatiblePHP'] ) {\n\t\t\t_e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );\n\t\t\tif ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */\n\t\t\t\t\t' ' . __( '<a href=\"%1$s\">Please update WordPress</a>, and then <a href=\"%2$s\">learn more about updating PHP</a>.' ),\n\t\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t);\n\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t} elseif ( current_user_can( 'update_core' ) ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t);\n\t\t\t} elseif ( current_user_can( 'update_php' ) ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t);\n\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t}\n\t\t} elseif ( ! $theme['compatibleWP'] ) {\n\t\t\t_e( 'This theme doesn&#8217;t work with your version of WordPress.' );\n\t\t\tif ( current_user_can( 'update_core' ) ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t);\n\t\t\t}\n\t\t} elseif ( ! $theme['compatiblePHP'] ) {\n\t\t\t_e( 'This theme doesn&#8217;t work with your version of PHP.' );\n\t\t\tif ( current_user_can( 'update_php' ) ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t);\n\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t}\n\t\t}\n\t\techo '</p></div>';\n\t}\n\t?>\n\n\t<span class=\"more-details\" id=\"<?php echo $aria_action; ?>\"><?php _e( 'Theme Details' ); ?></span>\n\t<div class=\"theme-author\">\n\t\t<?php\n\t\t/* translators: %s: Theme author name. */\n\t\tprintf( __( 'By %s' ), $theme['author'] );\n\t\t?>\n\t</div>\n\n\t<div class=\"theme-id-container\">\n\t\t<?php if ( $theme['active'] ) { ?>\n\t\t\t<h2 class=\"theme-name\" id=\"<?php echo $aria_name; ?>\">\n\t\t\t\t<span><?php _ex( 'Active:', 'theme' ); ?></span> <?php echo $theme['name']; ?>\n\t\t\t</h2>\n\t\t<?php } else { ?>\n\t\t\t<h2 class=\"theme-name\" id=\"<?php echo $aria_name; ?>\"><?php echo $theme['name']; ?></h2>\n\t\t<?php } ?>\n\n\t\t<div class=\"theme-actions\">\n\t\t<?php if ( $theme['active'] ) { ?>\n\t\t\t<?php if ( $theme['actions']['customize'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>\n\t\t\t\t<a class=\"button button-primary customize load-customize hide-if-no-customize\" href=\"<?php echo $theme['actions']['customize']; ?>\"><?php _e( 'Customize' ); ?></a>\n\t\t\t<?php } ?>\n\t\t<?php } elseif ( $theme['compatibleWP'] && $theme['compatiblePHP'] ) { ?>\n\t\t\t<?php\n\t\t\t/* translators: %s: Theme name. */\n\t\t\t$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );\n\t\t\t?>\n\t\t\t<a class=\"button activate\" href=\"<?php echo $theme['actions']['activate']; ?>\" aria-label=\"<?php echo esc_attr( $aria_label ); ?>\"><?php _e( 'Activate' ); ?></a>\n\t\t\t<?php if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>\n\t\t\t\t<a class=\"button button-primary load-customize hide-if-no-customize\" href=\"<?php echo $theme['actions']['customize']; ?>\"><?php _e( 'Live Preview' ); ?></a>\n\t\t\t<?php } ?>\n\t\t<?php } else { ?>\n\t\t\t<?php\n\t\t\t/* translators: %s: Theme name. */\n\t\t\t$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );\n\t\t\t?>\n\t\t\t<a class=\"button disabled\" aria-label=\"<?php echo esc_attr( $aria_label ); ?>\"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>\n\t\t\t<?php if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>\n\t\t\t\t<a class=\"button button-primary hide-if-no-customize disabled\"><?php _e( 'Live Preview' ); ?></a>\n\t\t\t<?php } ?>\n\t\t<?php } ?>\n\n\t\t</div>\n\t</div>\n</div>\n<?php endforeach; ?>\n\t</div>\n</div>\n<div class=\"theme-overlay\" tabindex=\"0\" role=\"dialog\" aria-label=\"<?php esc_attr_e( 'Theme Details' ); ?>\"></div>\n\n<p class=\"no-themes\"><?php _e( 'No themes found. Try a different search.' ); ?></p>\n\n<?php\n// List broken themes, if any.\n$broken_themes = wp_get_themes( array( 'errors' => true ) );\nif ( ! is_multisite() && $broken_themes ) {\n\t?>\n\n<div class=\"broken-themes\">\n<h3><?php _e( 'Broken Themes' ); ?></h3>\n<p><?php _e( 'The following themes are installed but incomplete.' ); ?></p>\n\n\t<?php\n\t$can_resume  = current_user_can( 'resume_themes' );\n\t$can_delete  = current_user_can( 'delete_themes' );\n\t$can_install = current_user_can( 'install_themes' );\n\t?>\n<table>\n\t<tr>\n\t\t<th><?php _ex( 'Name', 'theme name' ); ?></th>\n\t\t<th><?php _e( 'Description' ); ?></th>\n\t\t<?php if ( $can_resume ) { ?>\n\t\t\t<td></td>\n\t\t<?php } ?>\n\t\t<?php if ( $can_delete ) { ?>\n\t\t\t<td></td>\n\t\t<?php } ?>\n\t\t<?php if ( $can_install ) { ?>\n\t\t\t<td></td>\n\t\t<?php } ?>\n\t</tr>\n\t<?php foreach ( $broken_themes as $broken_theme ) : ?>\n\t\t<tr>\n\t\t\t<td><?php echo $broken_theme->get( 'Name' ) ? $broken_theme->display( 'Name' ) : esc_html( $broken_theme->get_stylesheet() ); ?></td>\n\t\t\t<td><?php echo $broken_theme->errors()->get_error_message(); ?></td>\n\t\t\t<?php\n\t\t\tif ( $can_resume ) {\n\t\t\t\tif ( 'theme_paused' === $broken_theme->errors()->get_error_code() ) {\n\t\t\t\t\t$stylesheet = $broken_theme->get_stylesheet();\n\t\t\t\t\t$resume_url = add_query_arg(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'action'     => 'resume',\n\t\t\t\t\t\t\t'stylesheet' => urlencode( $stylesheet ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tadmin_url( 'themes.php' )\n\t\t\t\t\t);\n\t\t\t\t\t$resume_url = wp_nonce_url( $resume_url, 'resume-theme_' . $stylesheet );\n\t\t\t\t\t?>\n\t\t\t\t\t<td><a href=\"<?php echo esc_url( $resume_url ); ?>\" class=\"button resume-theme\"><?php _e( 'Resume' ); ?></a></td>\n\t\t\t\t\t<?php\n\t\t\t\t} else {\n\t\t\t\t\t?>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $can_delete ) {\n\t\t\t\t$stylesheet = $broken_theme->get_stylesheet();\n\t\t\t\t$delete_url = add_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'action'     => 'delete',\n\t\t\t\t\t\t'stylesheet' => urlencode( $stylesheet ),\n\t\t\t\t\t),\n\t\t\t\t\tadmin_url( 'themes.php' )\n\t\t\t\t);\n\t\t\t\t$delete_url = wp_nonce_url( $delete_url, 'delete-theme_' . $stylesheet );\n\t\t\t\t?>\n\t\t\t\t<td><a href=\"<?php echo esc_url( $delete_url ); ?>\" class=\"button delete-theme\"><?php _e( 'Delete' ); ?></a></td>\n\t\t\t\t<?php\n\t\t\t}\n\n\t\t\tif ( $can_install && 'theme_no_parent' === $broken_theme->errors()->get_error_code() ) {\n\t\t\t\t$parent_theme_name = $broken_theme->get( 'Template' );\n\t\t\t\t$parent_theme      = themes_api( 'theme_information', array( 'slug' => urlencode( $parent_theme_name ) ) );\n\n\t\t\t\tif ( ! is_wp_error( $parent_theme ) ) {\n\t\t\t\t\t$install_url = add_query_arg(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'action' => 'install-theme',\n\t\t\t\t\t\t\t'theme'  => urlencode( $parent_theme_name ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tadmin_url( 'update.php' )\n\t\t\t\t\t);\n\t\t\t\t\t$install_url = wp_nonce_url( $install_url, 'install-theme_' . $parent_theme_name );\n\t\t\t\t\t?>\n\t\t\t\t\t<td><a href=\"<?php echo esc_url( $install_url ); ?>\" class=\"button install-theme\"><?php _e( 'Install Parent Theme' ); ?></a></td>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t\t?>\n\t\t</tr>\n\t<?php endforeach; ?>\n</table>\n</div>\n\n\t<?php\n}\n?>\n</div><!-- .wrap -->\n\n<?php\n\n/**\n * Returns the JavaScript template used to display the auto-update setting for a theme.\n *\n * @since 5.5.0\n *\n * @return string The template for displaying the auto-update setting link.\n */\nfunction wp_theme_auto_update_setting_template() {\n\t$template = '\n\t\t<div class=\"theme-autoupdate\">\n\t\t\t<# if ( data.autoupdate.supported ) { #>\n\t\t\t\t<# if ( data.autoupdate.forced === false ) { #>\n\t\t\t\t\t' . __( 'Auto-updates disabled' ) . '\n\t\t\t\t<# } else if ( data.autoupdate.forced ) { #>\n\t\t\t\t\t' . __( 'Auto-updates enabled' ) . '\n\t\t\t\t<# } else if ( data.autoupdate.enabled ) { #>\n\t\t\t\t\t<button type=\"button\" class=\"toggle-auto-update button-link\" data-slug=\"{{ data.id }}\" data-wp-action=\"disable\">\n\t\t\t\t\t\t<span class=\"dashicons dashicons-update spin hidden\" aria-hidden=\"true\"></span><span class=\"label\">' . __( 'Disable auto-updates' ) . '</span>\n\t\t\t\t\t</button>\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<button type=\"button\" class=\"toggle-auto-update button-link\" data-slug=\"{{ data.id }}\" data-wp-action=\"enable\">\n\t\t\t\t\t\t<span class=\"dashicons dashicons-update spin hidden\" aria-hidden=\"true\"></span><span class=\"label\">' . __( 'Enable auto-updates' ) . '</span>\n\t\t\t\t\t</button>\n\t\t\t\t<# } #>\n\t\t\t<# } #>\n\t\t\t<# if ( data.hasUpdate ) { #>\n\t\t\t\t<# if ( data.autoupdate.supported && data.autoupdate.enabled ) { #>\n\t\t\t\t\t<span class=\"auto-update-time\">\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<span class=\"auto-update-time hidden\">\n\t\t\t\t<# } #>\n\t\t\t\t<br />' . wp_get_auto_update_message() . '</span>\n\t\t\t<# } #>\n\t\t\t<div class=\"notice notice-error notice-alt inline hidden\"><p></p></div>\n\t\t</div>\n\t';\n\n\t/**\n\t * Filters the JavaScript template used to display the auto-update setting for a theme (in the overlay).\n\t *\n\t * See {@see wp_prepare_themes_for_js()} for the properties of the `data` object.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $template The template for displaying the auto-update setting link.\n\t */\n\treturn apply_filters( 'theme_auto_update_setting_template', $template );\n}\n\n/*\n * The tmpl-theme template is synchronized with PHP above!\n */\n?>\n<script id=\"tmpl-theme\" type=\"text/template\">\n\t<# if ( data.screenshot[0] ) { #>\n\t\t<div class=\"theme-screenshot\">\n\t\t\t<img src=\"{{ data.screenshot[0] }}\" alt=\"\" />\n\t\t</div>\n\t<# } else { #>\n\t\t<div class=\"theme-screenshot blank\"></div>\n\t<# } #>\n\n\t<# if ( data.hasUpdate ) { #>\n\t\t<# if ( data.updateResponse.compatibleWP && data.updateResponse.compatiblePHP ) { #>\n\t\t\t<div class=\"update-message notice inline notice-warning notice-alt\"><p>\n\t\t\t\t<# if ( data.hasPackage ) { #>\n\t\t\t\t\t<?php _e( 'New version available. <button class=\"button-link\" type=\"button\">Update now</button>' ); ?>\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<?php _e( 'New version available.' ); ?>\n\t\t\t\t<# } #>\n\t\t\t</p></div>\n\t\t<# } else { #>\n\t\t\t<div class=\"update-message notice inline notice-error notice-alt\"><p>\n\t\t\t\t<# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),\n\t\t\t\t\t\t'{{{ data.name }}}'\n\t\t\t\t\t);\n\t\t\t\t\tif ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */\n\t\t\t\t\t\t\t' ' . __( '<a href=\"%1$s\">Please update WordPress</a>, and then <a href=\"%2$s\">learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t);\n\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t} elseif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t\t);\n\t\t\t\t\t} elseif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t);\n\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t<# } else if ( ! data.updateResponse.compatibleWP ) { #>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),\n\t\t\t\t\t\t'{{{ data.name }}}'\n\t\t\t\t\t);\n\t\t\t\t\tif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t<# } else if ( ! data.updateResponse.compatiblePHP ) { #>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),\n\t\t\t\t\t\t'{{{ data.name }}}'\n\t\t\t\t\t);\n\t\t\t\t\tif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t);\n\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t<# } #>\n\t\t\t</p></div>\n\t\t<# } #>\n\t<# } #>\n\n\t<# if ( ! data.compatibleWP || ! data.compatiblePHP ) { #>\n\t\t<div class=\"notice notice-error notice-alt\"><p>\n\t\t\t<# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #>\n\t\t\t\t<?php\n\t\t\t\t_e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );\n\t\t\t\tif ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */\n\t\t\t\t\t\t' ' . __( '<a href=\"%1$s\">Please update WordPress</a>, and then <a href=\"%2$s\">learn more about updating PHP</a>.' ),\n\t\t\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t);\n\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t} elseif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t);\n\t\t\t\t} elseif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t);\n\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t<# } else if ( ! data.compatibleWP ) { #>\n\t\t\t\t<?php\n\t\t\t\t_e( 'This theme doesn&#8217;t work with your version of WordPress.' );\n\t\t\t\tif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t<# } else if ( ! data.compatiblePHP ) { #>\n\t\t\t\t<?php\n\t\t\t\t_e( 'This theme doesn&#8217;t work with your version of PHP.' );\n\t\t\t\tif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t);\n\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t<# } #>\n\t\t</p></div>\n\t<# } #>\n\n\t<span class=\"more-details\" id=\"{{ data.id }}-action\"><?php _e( 'Theme Details' ); ?></span>\n\t<div class=\"theme-author\">\n\t\t<?php\n\t\t/* translators: %s: Theme author name. */\n\t\tprintf( __( 'By %s' ), '{{{ data.author }}}' );\n\t\t?>\n\t</div>\n\n\t<div class=\"theme-id-container\">\n\t\t<# if ( data.active ) { #>\n\t\t\t<h2 class=\"theme-name\" id=\"{{ data.id }}-name\">\n\t\t\t\t<span><?php _ex( 'Active:', 'theme' ); ?></span> {{{ data.name }}}\n\t\t\t</h2>\n\t\t<# } else { #>\n\t\t\t<h2 class=\"theme-name\" id=\"{{ data.id }}-name\">{{{ data.name }}}</h2>\n\t\t<# } #>\n\n\t\t<div class=\"theme-actions\">\n\t\t\t<# if ( data.active ) { #>\n\t\t\t\t<# if ( data.actions.customize ) { #>\n\t\t\t\t\t<a class=\"button button-primary customize load-customize hide-if-no-customize\" href=\"{{{ data.actions.customize }}}\"><?php _e( 'Customize' ); ?></a>\n\t\t\t\t<# } #>\n\t\t\t<# } else { #>\n\t\t\t\t<# if ( data.compatibleWP && data.compatiblePHP ) { #>\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );\n\t\t\t\t\t?>\n\t\t\t\t\t<a class=\"button activate\" href=\"{{{ data.actions.activate }}}\" aria-label=\"<?php echo $aria_label; ?>\"><?php _e( 'Activate' ); ?></a>\n\t\t\t\t\t<a class=\"button button-primary load-customize hide-if-no-customize\" href=\"{{{ data.actions.customize }}}\"><?php _e( 'Live Preview' ); ?></a>\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );\n\t\t\t\t\t?>\n\t\t\t\t\t<a class=\"button disabled\" aria-label=\"<?php echo esc_attr( $aria_label ); ?>\"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>\n\t\t\t\t\t<a class=\"button button-primary hide-if-no-customize disabled\"><?php _e( 'Live Preview' ); ?></a>\n\t\t\t\t<# } #>\n\t\t\t<# } #>\n\t\t</div>\n\t</div>\n</script>\n\n<script id=\"tmpl-theme-single\" type=\"text/template\">\n\t<div class=\"theme-backdrop\"></div>\n\t<div class=\"theme-wrap wp-clearfix\" role=\"document\">\n\t\t<div class=\"theme-header\">\n\t\t\t<button class=\"left dashicons dashicons-no\"><span class=\"screen-reader-text\"><?php _e( 'Show previous theme' ); ?></span></button>\n\t\t\t<button class=\"right dashicons dashicons-no\"><span class=\"screen-reader-text\"><?php _e( 'Show next theme' ); ?></span></button>\n\t\t\t<button class=\"close dashicons dashicons-no\"><span class=\"screen-reader-text\"><?php _e( 'Close details dialog' ); ?></span></button>\n\t\t</div>\n\t\t<div class=\"theme-about wp-clearfix\">\n\t\t\t<div class=\"theme-screenshots\">\n\t\t\t<# if ( data.screenshot[0] ) { #>\n\t\t\t\t<div class=\"screenshot\"><img src=\"{{ data.screenshot[0] }}\" alt=\"\" /></div>\n\t\t\t<# } else { #>\n\t\t\t\t<div class=\"screenshot blank\"></div>\n\t\t\t<# } #>\n\t\t\t</div>\n\n\t\t\t<div class=\"theme-info\">\n\t\t\t\t<# if ( data.active ) { #>\n\t\t\t\t\t<span class=\"current-label\"><?php _e( 'Current Theme' ); ?></span>\n\t\t\t\t<# } #>\n\t\t\t\t<h2 class=\"theme-name\">{{{ data.name }}}<span class=\"theme-version\">\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Theme version. */\n\t\t\t\t\tprintf( __( 'Version: %s' ), '{{ data.version }}' );\n\t\t\t\t\t?>\n\t\t\t\t</span></h2>\n\t\t\t\t<p class=\"theme-author\">\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Theme author link. */\n\t\t\t\t\tprintf( __( 'By %s' ), '{{{ data.authorAndUri }}}' );\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\n\t\t\t\t<# if ( ! data.compatibleWP || ! data.compatiblePHP ) { #>\n\t\t\t\t\t<div class=\"notice notice-error notice-alt notice-large\"><p>\n\t\t\t\t\t\t<# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t_e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );\n\t\t\t\t\t\t\tif ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%1$s\">Please update WordPress</a>, and then <a href=\"%2$s\">learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t\t\t} elseif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} elseif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t<# } else if ( ! data.compatibleWP ) { #>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t_e( 'This theme doesn&#8217;t work with your version of WordPress.' );\n\t\t\t\t\t\t\tif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.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\t?>\n\t\t\t\t\t\t<# } else if ( ! data.compatiblePHP ) { #>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t_e( 'This theme doesn&#8217;t work with your version of PHP.' );\n\t\t\t\t\t\t\tif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\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</p></div>\n\t\t\t\t<# } #>\n\n\t\t\t\t<# if ( data.hasUpdate ) { #>\n\t\t\t\t\t<# if ( data.updateResponse.compatibleWP && data.updateResponse.compatiblePHP ) { #>\n\t\t\t\t\t\t<div class=\"notice notice-warning notice-alt notice-large\">\n\t\t\t\t\t\t\t<h3 class=\"notice-title\"><?php _e( 'Update Available' ); ?></h3>\n\t\t\t\t\t\t\t{{{ data.update }}}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t<div class=\"notice notice-error notice-alt notice-large\">\n\t\t\t\t\t\t\t<h3 class=\"notice-title\"><?php _e( 'Update Incompatible' ); ?></h3>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),\n\t\t\t\t\t\t\t\t\t\t'{{{ data.name }}}'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tif ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%1$s\">Please update WordPress</a>, and then <a href=\"%2$s\">learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t\t\t\t\t} elseif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} elseif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\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<# } else if ( ! data.updateResponse.compatibleWP ) { #>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),\n\t\t\t\t\t\t\t\t\t\t'{{{ data.name }}}'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\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?>\n\t\t\t\t\t\t\t\t<# } else if ( ! data.updateResponse.compatiblePHP ) { #>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),\n\t\t\t\t\t\t\t\t\t\t'{{{ data.name }}}'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\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<# } #>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<# } #>\n\t\t\t\t<# } #>\n\n\t\t\t\t<# if ( data.actions.autoupdate ) { #>\n\t\t\t\t\t<?php echo wp_theme_auto_update_setting_template(); ?>\n\t\t\t\t<# } #>\n\n\t\t\t\t<p class=\"theme-description\">{{{ data.description }}}</p>\n\n\t\t\t\t<# if ( data.parent ) { #>\n\t\t\t\t\t<p class=\"parent-theme\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\tprintf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' );\n\t\t\t\t\t\t?>\n\t\t\t\t\t</p>\n\t\t\t\t<# } #>\n\n\t\t\t\t<# if ( data.tags ) { #>\n\t\t\t\t\t<p class=\"theme-tags\"><span><?php _e( 'Tags:' ); ?></span> {{{ data.tags }}}</p>\n\t\t\t\t<# } #>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"theme-actions\">\n\t\t\t<div class=\"active-theme\">\n\t\t\t\t<a href=\"{{{ data.actions.customize }}}\" class=\"button button-primary customize load-customize hide-if-no-customize\"><?php _e( 'Customize' ); ?></a>\n\t\t\t\t<?php echo implode( ' ', $current_theme_actions ); ?>\n\t\t\t</div>\n\t\t\t<div class=\"inactive-theme\">\n\t\t\t\t<# if ( data.compatibleWP && data.compatiblePHP ) { #>\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );\n\t\t\t\t\t?>\n\t\t\t\t\t<# if ( data.actions.activate ) { #>\n\t\t\t\t\t\t<a href=\"{{{ data.actions.activate }}}\" class=\"button activate\" aria-label=\"<?php echo $aria_label; ?>\"><?php _e( 'Activate' ); ?></a>\n\t\t\t\t\t<# } #>\n\t\t\t\t\t<a href=\"{{{ data.actions.customize }}}\" class=\"button button-primary load-customize hide-if-no-customize\"><?php _e( 'Live Preview' ); ?></a>\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );\n\t\t\t\t\t?>\n\t\t\t\t\t<# if ( data.actions.activate ) { #>\n\t\t\t\t\t\t<a class=\"button disabled\" aria-label=\"<?php echo $aria_label; ?>\"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>\n\t\t\t\t\t<# } #>\n\t\t\t\t\t<a class=\"button button-primary hide-if-no-customize disabled\"><?php _e( 'Live Preview' ); ?></a>\n\t\t\t\t<# } #>\n\t\t\t</div>\n\n\t\t\t<# if ( ! data.active && data.actions['delete'] ) { #>\n\t\t\t\t<a href=\"{{{ data.actions['delete'] }}}\" class=\"button delete-theme\"><?php _e( 'Delete' ); ?></a>\n\t\t\t<# } #>\n\t\t</div>\n\t</div>\n</script>\n\n<?php\nwp_print_request_filesystem_credentials_modal();\nwp_print_admin_notice_templates();\nwp_print_update_row_templates();\n\nwp_localize_script(\n\t'updates',\n\t'_wpUpdatesItemCounts',\n\tarray(\n\t\t'totals' => wp_get_update_data(),\n\t)\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 1140}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Tools Administration Screen.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\nif ( isset( $_GET['page'] ) && ! empty( $_POST ) ) {\n\t// Ensure POST-ing to `tools.php?page=export_personal_data` and `tools.php?page=remove_personal_data`\n\t// continues to work after creating the new files for exporting and erasing of personal data.\n\tif ( 'export_personal_data' === $_GET['page'] ) {\n\t\trequire_once ABSPATH . 'wp-admin/export-personal-data.php';\n\t\treturn;\n\t} elseif ( 'remove_personal_data' === $_GET['page'] ) {\n\t\trequire_once ABSPATH . 'wp-admin/erase-personal-data.php';\n\t\treturn;\n\t}\n}\n\n// The privacy policy guide used to be outputted from here. Since WP 5.3 it is in wp-admin/privacy-policy-guide.php.\nif ( isset( $_GET['wp-privacy-policy-guide'] ) ) {\n\trequire_once dirname( __DIR__ ) . '/wp-load.php';\n\twp_redirect( admin_url( 'privacy-policy-guide.php' ), 301 );\n\texit;\n} elseif ( isset( $_GET['page'] ) ) {\n\t// These were also moved to files in WP 5.3.\n\tif ( 'export_personal_data' === $_GET['page'] ) {\n\t\trequire_once dirname( __DIR__ ) . '/wp-load.php';\n\t\twp_redirect( admin_url( 'export-personal-data.php' ), 301 );\n\t\texit;\n\t} elseif ( 'remove_personal_data' === $_GET['page'] ) {\n\t\trequire_once dirname( __DIR__ ) . '/wp-load.php';\n\t\twp_redirect( admin_url( 'erase-personal-data.php' ), 301 );\n\t\texit;\n\t}\n}\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n$title = __( 'Tools' );\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'converter',\n\t\t'title'   => __( 'Categories and Tags Converter' ),\n\t\t'content' => '<p>' . __( 'Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' .\n\t\t'<p>' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin &amp; Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/tools-screen/\">Documentation on Tools</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n?>\n<div class=\"wrap\">\n<h1><?php echo esc_html( $title ); ?></h1>\n<?php\n\nif ( current_user_can( 'import' ) ) :\n\t$cats = get_taxonomy( 'category' );\n\t$tags = get_taxonomy( 'post_tag' );\n\tif ( current_user_can( $cats->cap->manage_terms ) || current_user_can( $tags->cap->manage_terms ) ) :\n\t\t?>\n\t\t<div class=\"card\">\n\t\t\t<h2 class=\"title\"><?php _e( 'Categories and Tags Converter' ); ?></h2>\n\t\t\t<p>\n\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: URL to Import screen. */\n\t\t\t\t\t__( 'If you want to convert your categories to tags (or vice versa), use the <a href=\"%s\">Categories and Tags Converter</a> available from the Import screen.' ),\n\t\t\t\t\t'import.php'\n\t\t\t\t);\n\t\t\t?>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\tendif;\nendif;\n\n/**\n * Fires at the end of the Tools Administration screen.\n *\n * @since 2.8.0\n */\ndo_action( 'tool_box' );\n\n?>\n</div>\n<?php\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 99}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Update Core administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nwp_enqueue_style( 'plugin-install' );\nwp_enqueue_script( 'plugin-install' );\nwp_enqueue_script( 'updates' );\nadd_thickbox();\n\nif ( is_multisite() && ! is_network_admin() ) {\n\twp_redirect( network_admin_url( 'update-core.php' ) );\n\texit;\n}\n\nif ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_themes' ) && ! current_user_can( 'update_plugins' ) && ! current_user_can( 'update_languages' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to update this site.' ) );\n}\n\n/**\n * Lists available core updates.\n *\n * @since 2.7.0\n *\n * @global string $wp_local_package Locale code of the package.\n * @global wpdb   $wpdb             WordPress database abstraction object.\n *\n * @param object $update\n */\nfunction list_core_update( $update ) {\n\tglobal $wp_local_package, $wpdb;\n\tstatic $first_pass = true;\n\n\t$wp_version     = get_bloginfo( 'version' );\n\t$version_string = sprintf( '%s&ndash;<strong>%s</strong>', $update->current, $update->locale );\n\n\tif ( 'en_US' === $update->locale && 'en_US' === get_locale() ) {\n\t\t$version_string = $update->current;\n\t} elseif ( 'en_US' === $update->locale && $update->packages->partial && $wp_version == $update->partial_version ) {\n\t\t$updates = get_core_updates();\n\t\tif ( $updates && 1 === count( $updates ) ) {\n\t\t\t// If the only available update is a partial builds, it doesn't need a language-specific version string.\n\t\t\t$version_string = $update->current;\n\t\t}\n\t}\n\n\t$current = false;\n\tif ( ! isset( $update->response ) || 'latest' === $update->response ) {\n\t\t$current = true;\n\t}\n\t$submit        = __( 'Update Now' );\n\t$form_action   = 'update-core.php?action=do-core-upgrade';\n\t$php_version   = phpversion();\n\t$mysql_version = $wpdb->db_version();\n\t$show_buttons  = true;\n\tif ( 'development' === $update->response ) {\n\t\t$message = __( 'You are using a development version of WordPress. You can update to the latest nightly build automatically:' );\n\t} else {\n\t\tif ( $current ) {\n\t\t\t/* translators: %s: WordPress version. */\n\t\t\t$message     = sprintf( __( 'If you need to re-install version %s, you can do so here:' ), $version_string );\n\t\t\t$submit      = __( 'Re-install Now' );\n\t\t\t$form_action = 'update-core.php?action=do-core-reinstall';\n\t\t} else {\n\t\t\t$php_compat = version_compare( $php_version, $update->php_version, '>=' );\n\t\t\tif ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) {\n\t\t\t\t$mysql_compat = true;\n\t\t\t} else {\n\t\t\t\t$mysql_compat = version_compare( $mysql_version, $update->mysql_version, '>=' );\n\t\t\t}\n\n\t\t\t$version_url = sprintf(\n\t\t\t\t/* translators: %s: WordPress version. */\n\t\t\t\tesc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),\n\t\t\t\tsanitize_title( $update->current )\n\t\t\t);\n\n\t\t\t$php_update_message = '</p><p>' . sprintf(\n\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t__( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t);\n\n\t\t\t$annotation = wp_get_update_php_annotation();\n\n\t\t\tif ( $annotation ) {\n\t\t\t\t$php_update_message .= '</p><p><em>' . $annotation . '</em>';\n\t\t\t}\n\n\t\t\tif ( ! $mysql_compat && ! $php_compat ) {\n\t\t\t\t$message = sprintf(\n\t\t\t\t\t/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number. */\n\t\t\t\t\t__( 'You cannot update because <a href=\"%1$s\">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ),\n\t\t\t\t\t$version_url,\n\t\t\t\t\t$update->current,\n\t\t\t\t\t$update->php_version,\n\t\t\t\t\t$update->mysql_version,\n\t\t\t\t\t$php_version,\n\t\t\t\t\t$mysql_version\n\t\t\t\t) . $php_update_message;\n\t\t\t} elseif ( ! $php_compat ) {\n\t\t\t\t$message = sprintf(\n\t\t\t\t\t/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number. */\n\t\t\t\t\t__( 'You cannot update because <a href=\"%1$s\">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ),\n\t\t\t\t\t$version_url,\n\t\t\t\t\t$update->current,\n\t\t\t\t\t$update->php_version,\n\t\t\t\t\t$php_version\n\t\t\t\t) . $php_update_message;\n\t\t\t} elseif ( ! $mysql_compat ) {\n\t\t\t\t$message = sprintf(\n\t\t\t\t\t/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number. */\n\t\t\t\t\t__( 'You cannot update because <a href=\"%1$s\">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ),\n\t\t\t\t\t$version_url,\n\t\t\t\t\t$update->current,\n\t\t\t\t\t$update->mysql_version,\n\t\t\t\t\t$mysql_version\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$message = sprintf(\n\t\t\t\t\t/* translators: 1: URL to WordPress release notes, 2: WordPress version number including locale if necessary. */\n\t\t\t\t\t__( 'You can update to <a href=\"%1$s\">WordPress %2$s</a> automatically:' ),\n\t\t\t\t\t$version_url,\n\t\t\t\t\t$version_string\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ( ! $mysql_compat || ! $php_compat ) {\n\t\t\t\t$show_buttons = false;\n\t\t\t}\n\t\t}\n\t}\n\n\techo '<p>';\n\techo $message;\n\techo '</p>';\n\techo '<form method=\"post\" action=\"' . $form_action . '\" name=\"upgrade\" class=\"upgrade\">';\n\twp_nonce_field( 'upgrade-core' );\n\techo '<p>';\n\techo '<input name=\"version\" value=\"' . esc_attr( $update->current ) . '\" type=\"hidden\"/>';\n\techo '<input name=\"locale\" value=\"' . esc_attr( $update->locale ) . '\" type=\"hidden\"/>';\n\tif ( $show_buttons ) {\n\t\tif ( $first_pass ) {\n\t\t\tsubmit_button( $submit, $current ? '' : 'primary regular', 'upgrade', false );\n\t\t\t$first_pass = false;\n\t\t} else {\n\t\t\tsubmit_button( $submit, '', 'upgrade', false );\n\t\t}\n\t}\n\tif ( 'en_US' !== $update->locale ) {\n\t\tif ( ! isset( $update->dismissed ) || ! $update->dismissed ) {\n\t\t\tsubmit_button( __( 'Hide this update' ), '', 'dismiss', false );\n\t\t} else {\n\t\t\tsubmit_button( __( 'Bring back this update' ), '', 'undismiss', false );\n\t\t}\n\t}\n\techo '</p>';\n\tif ( 'en_US' !== $update->locale && ( ! isset( $wp_local_package ) || $wp_local_package != $update->locale ) ) {\n\t\techo '<p class=\"hint\">' . __( 'This localized version contains both the translation and various other localization fixes.' ) . '</p>';\n\t} elseif ( 'en_US' === $update->locale && 'en_US' !== get_locale() && ( ! $update->packages->partial && $wp_version == $update->partial_version ) ) {\n\t\t// Partial builds don't need language-specific warnings.\n\t\techo '<p class=\"hint\">' . sprintf(\n\t\t\t/* translators: %s: WordPress version. */\n\t\t\t__( 'You are about to install WordPress %s <strong>in English (US).</strong> There is a chance this update will break your translation. You may prefer to wait for the localized version to be released.' ),\n\t\t\t'development' !== $update->response ? $update->current : ''\n\t\t) . '</p>';\n\t}\n\techo '</form>';\n\n}\n\n/**\n * Display dismissed updates.\n *\n * @since 2.7.0\n */\nfunction dismissed_updates() {\n\t$dismissed = get_core_updates(\n\t\tarray(\n\t\t\t'dismissed' => true,\n\t\t\t'available' => false,\n\t\t)\n\t);\n\tif ( $dismissed ) {\n\n\t\t$show_text = esc_js( __( 'Show hidden updates' ) );\n\t\t$hide_text = esc_js( __( 'Hide hidden updates' ) );\n\t\t?>\n\t<script type=\"text/javascript\">\n\t\tjQuery(function( $ ) {\n\t\t\t$( 'dismissed-updates' ).show();\n\t\t\t$( '#show-dismissed' ).toggle( function() { $( this ).text( '<?php echo $hide_text; ?>' ).attr( 'aria-expanded', 'true' ); }, function() { $( this ).text( '<?php echo $show_text; ?>' ).attr( 'aria-expanded', 'false' ); } );\n\t\t\t$( '#show-dismissed' ).click( function() { $( '#dismissed-updates' ).toggle( 'fast' ); } );\n\t\t});\n\t</script>\n\t\t<?php\n\t\techo '<p class=\"hide-if-no-js\"><button type=\"button\" class=\"button\" id=\"show-dismissed\" aria-expanded=\"false\">' . __( 'Show hidden updates' ) . '</button></p>';\n\t\techo '<ul id=\"dismissed-updates\" class=\"core-updates dismissed\">';\n\t\tforeach ( (array) $dismissed as $update ) {\n\t\t\techo '<li>';\n\t\t\tlist_core_update( $update );\n\t\t\techo '</li>';\n\t\t}\n\t\techo '</ul>';\n\t}\n}\n\n/**\n * Display upgrade WordPress for downloading latest or upgrading automatically form.\n *\n * @since 2.7.0\n *\n * @global string $required_php_version   The required PHP version string.\n * @global string $required_mysql_version The required MySQL version string.\n */\nfunction core_upgrade_preamble() {\n\tglobal $required_php_version, $required_mysql_version;\n\n\t$wp_version = get_bloginfo( 'version' );\n\t$updates    = get_core_updates();\n\n\tif ( ! isset( $updates[0]->response ) || 'latest' === $updates[0]->response ) {\n\t\techo '<h2>';\n\t\t_e( 'You have the latest version of WordPress.' );\n\n\t\tif ( wp_http_supports( array( 'ssl' ) ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\t\t\t$upgrader            = new WP_Automatic_Updater;\n\t\t\t$future_minor_update = (object) array(\n\t\t\t\t'current'       => $wp_version . '.1.next.minor',\n\t\t\t\t'version'       => $wp_version . '.1.next.minor',\n\t\t\t\t'php_version'   => $required_php_version,\n\t\t\t\t'mysql_version' => $required_mysql_version,\n\t\t\t);\n\t\t\t$should_auto_update  = $upgrader->should_update( 'core', $future_minor_update, ABSPATH );\n\t\t\tif ( $should_auto_update ) {\n\t\t\t\techo ' ' . __( 'Future security updates will be applied automatically.' );\n\t\t\t}\n\t\t}\n\t\techo '</h2>';\n\t}\n\n\tif ( isset( $updates[0]->version ) && version_compare( $updates[0]->version, $wp_version, '>' ) ) {\n\t\techo '<div class=\"notice notice-warning\"><p>';\n\t\tprintf(\n\t\t\t/* translators: 1: Documentation on WordPress backups, 2: Documentation on updating WordPress. */\n\t\t\t__( '<strong>Important:</strong> Before updating, please <a href=\"%1$s\">back up your database and files</a>. For help with updates, visit the <a href=\"%2$s\">Updating WordPress</a> documentation page.' ),\n\t\t\t__( 'https://wordpress.org/support/article/wordpress-backups/' ),\n\t\t\t__( 'https://wordpress.org/support/article/updating-wordpress/' )\n\t\t);\n\t\techo '</p></div>';\n\n\t\techo '<h2 class=\"response\">';\n\t\t_e( 'An updated version of WordPress is available.' );\n\t\techo '</h2>';\n\t}\n\n\tif ( isset( $updates[0] ) && 'development' === $updates[0]->response ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\t\t$upgrader = new WP_Automatic_Updater;\n\t\tif ( wp_http_supports( 'ssl' ) && $upgrader->should_update( 'core', $updates[0], ABSPATH ) ) {\n\t\t\techo '<div class=\"updated inline\"><p>';\n\t\t\techo '<strong>' . __( 'BETA TESTERS:' ) . '</strong> ' . __( 'This site is set up to install updates of future beta versions automatically.' );\n\t\t\techo '</p></div>';\n\t\t}\n\t}\n\n\techo '<ul class=\"core-updates\">';\n\tforeach ( (array) $updates as $update ) {\n\t\techo '<li>';\n\t\tlist_core_update( $update );\n\t\techo '</li>';\n\t}\n\techo '</ul>';\n\t// Don't show the maintenance mode notice when we are only showing a single re-install option.\n\tif ( $updates && ( count( $updates ) > 1 || 'latest' !== $updates[0]->response ) ) {\n\t\techo '<p>' . __( 'While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, this mode will be deactivated.' ) . '</p>';\n\t} elseif ( ! $updates ) {\n\t\tlist( $normalized_version ) = explode( '-', $wp_version );\n\t\techo '<p>' . sprintf(\n\t\t\t/* translators: 1: URL to About screen, 2: WordPress version. */\n\t\t\t__( '<a href=\"%1$s\">Learn more about WordPress %2$s</a>.' ),\n\t\t\tesc_url( self_admin_url( 'about.php' ) ),\n\t\t\t$normalized_version\n\t\t) . '</p>';\n\t}\n\tdismissed_updates();\n}\n\n/**\n * Display the upgrade plugins form.\n *\n * @since 2.9.0\n */\nfunction list_plugin_updates() {\n\t$wp_version     = get_bloginfo( 'version' );\n\t$cur_wp_version = preg_replace( '/-.*$/', '', $wp_version );\n\n\trequire_once ABSPATH . 'wp-admin/includes/plugin-install.php';\n\t$plugins = get_plugin_updates();\n\tif ( empty( $plugins ) ) {\n\t\techo '<h2>' . __( 'Plugins' ) . '</h2>';\n\t\techo '<p>' . __( 'Your plugins are all up to date.' ) . '</p>';\n\t\treturn;\n\t}\n\t$form_action = 'update-core.php?action=do-plugin-upgrade';\n\n\t$core_updates = get_core_updates();\n\tif ( ! isset( $core_updates[0]->response ) || 'latest' === $core_updates[0]->response || 'development' === $core_updates[0]->response || version_compare( $core_updates[0]->current, $cur_wp_version, '=' ) ) {\n\t\t$core_update_version = false;\n\t} else {\n\t\t$core_update_version = $core_updates[0]->current;\n\t}\n\t?>\n<h2><?php _e( 'Plugins' ); ?></h2>\n<p><?php _e( 'The following plugins have new versions available. Check the ones you want to update and then click &#8220;Update Plugins&#8221;.' ); ?></p>\n<form method=\"post\" action=\"<?php echo esc_url( $form_action ); ?>\" name=\"upgrade-plugins\" class=\"upgrade\">\n\t<?php wp_nonce_field( 'upgrade-core' ); ?>\n<p><input id=\"upgrade-plugins\" class=\"button\" type=\"submit\" value=\"<?php esc_attr_e( 'Update Plugins' ); ?>\" name=\"upgrade\" /></p>\n<table class=\"widefat updates-table\" id=\"update-plugins-table\">\n\t<thead>\n\t<tr>\n\t\t<td class=\"manage-column check-column\"><input type=\"checkbox\" id=\"plugins-select-all\" /></td>\n\t\t<td class=\"manage-column\"><label for=\"plugins-select-all\"><?php _e( 'Select All' ); ?></label></td>\n\t</tr>\n\t</thead>\n\n\t<tbody class=\"plugins\">\n\t<?php\n\n\t$auto_updates = array();\n\tif ( wp_is_auto_update_enabled_for_type( 'plugin' ) ) {\n\t\t$auto_updates       = (array) get_site_option( 'auto_update_plugins', array() );\n\t\t$auto_update_notice = ' | ' . wp_get_auto_update_message();\n\t}\n\n\tforeach ( (array) $plugins as $plugin_file => $plugin_data ) {\n\t\t$plugin_data = (object) _get_plugin_data_markup_translate( $plugin_file, (array) $plugin_data, false, true );\n\n\t\t$icon            = '<span class=\"dashicons dashicons-admin-plugins\"></span>';\n\t\t$preferred_icons = array( 'svg', '2x', '1x', 'default' );\n\t\tforeach ( $preferred_icons as $preferred_icon ) {\n\t\t\tif ( ! empty( $plugin_data->update->icons[ $preferred_icon ] ) ) {\n\t\t\t\t$icon = '<img src=\"' . esc_url( $plugin_data->update->icons[ $preferred_icon ] ) . '\" alt=\"\" />';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Get plugin compat for running version of WordPress.\n\t\tif ( isset( $plugin_data->update->tested ) && version_compare( $plugin_data->update->tested, $cur_wp_version, '>=' ) ) {\n\t\t\t/* translators: %s: WordPress version. */\n\t\t\t$compat = '<br />' . sprintf( __( 'Compatibility with WordPress %s: 100%% (according to its author)' ), $cur_wp_version );\n\t\t} else {\n\t\t\t/* translators: %s: WordPress version. */\n\t\t\t$compat = '<br />' . sprintf( __( 'Compatibility with WordPress %s: Unknown' ), $cur_wp_version );\n\t\t}\n\t\t// Get plugin compat for updated version of WordPress.\n\t\tif ( $core_update_version ) {\n\t\t\tif ( isset( $plugin_data->update->tested ) && version_compare( $plugin_data->update->tested, $core_update_version, '>=' ) ) {\n\t\t\t\t/* translators: %s: WordPress version. */\n\t\t\t\t$compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %s: 100%% (according to its author)' ), $core_update_version );\n\t\t\t} else {\n\t\t\t\t/* translators: %s: WordPress version. */\n\t\t\t\t$compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %s: Unknown' ), $core_update_version );\n\t\t\t}\n\t\t}\n\n\t\t$requires_php   = isset( $plugin_data->update->requires_php ) ? $plugin_data->update->requires_php : null;\n\t\t$compatible_php = is_php_version_compatible( $requires_php );\n\n\t\tif ( ! $compatible_php && current_user_can( 'update_php' ) ) {\n\t\t\t$compat .= '<br>' . __( 'This update doesn&#8217;t work with your version of PHP.' ) . '&nbsp;';\n\t\t\t$compat .= sprintf(\n\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t__( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t);\n\n\t\t\t$annotation = wp_get_update_php_annotation();\n\n\t\t\tif ( $annotation ) {\n\t\t\t\t$compat .= '</p><p><em>' . $annotation . '</em>';\n\t\t\t}\n\t\t}\n\n\t\t// Get the upgrade notice for the new plugin version.\n\t\tif ( isset( $plugin_data->update->upgrade_notice ) ) {\n\t\t\t$upgrade_notice = '<br />' . strip_tags( $plugin_data->update->upgrade_notice );\n\t\t} else {\n\t\t\t$upgrade_notice = '';\n\t\t}\n\n\t\t$details_url = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data->update->slug . '&section=changelog&TB_iframe=true&width=640&height=662' );\n\t\t$details     = sprintf(\n\t\t\t'<a href=\"%1$s\" class=\"thickbox open-plugin-details-modal\" aria-label=\"%2$s\">%3$s</a>',\n\t\t\tesc_url( $details_url ),\n\t\t\t/* translators: 1: Plugin name, 2: Version number. */\n\t\t\tesc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_data->Name, $plugin_data->update->new_version ) ),\n\t\t\t/* translators: %s: Plugin version. */\n\t\t\tsprintf( __( 'View version %s details.' ), $plugin_data->update->new_version )\n\t\t);\n\n\t\t$checkbox_id = 'checkbox_' . md5( $plugin_data->Name );\n\t\t?>\n\t<tr>\n\t\t<td class=\"check-column\">\n\t\t\t<?php if ( $compatible_php ) : ?>\n\t\t\t\t<input type=\"checkbox\" name=\"checked[]\" id=\"<?php echo $checkbox_id; ?>\" value=\"<?php echo esc_attr( $plugin_file ); ?>\" />\n\t\t\t\t<label for=\"<?php echo $checkbox_id; ?>\" class=\"screen-reader-text\">\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Plugin name. */\n\t\t\t\t\tprintf( __( 'Select %s' ), $plugin_data->Name );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t<?php endif; ?>\n\t\t</td>\n\t\t<td class=\"plugin-title\"><p>\n\t\t\t<?php echo $icon; ?>\n\t\t\t<strong><?php echo $plugin_data->Name; ?></strong>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: 1: Plugin version, 2: New version. */\n\t\t\t\t__( 'You have version %1$s installed. Update to %2$s.' ),\n\t\t\t\t$plugin_data->Version,\n\t\t\t\t$plugin_data->update->new_version\n\t\t\t);\n\n\t\t\techo ' ' . $details . $compat . $upgrade_notice;\n\n\t\t\tif ( in_array( $plugin_file, $auto_updates, true ) ) {\n\t\t\t\techo $auto_update_notice;\n\t\t\t}\n\t\t\t?>\n\t\t</p></td>\n\t</tr>\n\t\t\t<?php\n\t}\n\t?>\n\t</tbody>\n\n\t<tfoot>\n\t<tr>\n\t\t<td class=\"manage-column check-column\"><input type=\"checkbox\" id=\"plugins-select-all-2\" /></td>\n\t\t<td class=\"manage-column\"><label for=\"plugins-select-all-2\"><?php _e( 'Select All' ); ?></label></td>\n\t</tr>\n\t</tfoot>\n</table>\n<p><input id=\"upgrade-plugins-2\" class=\"button\" type=\"submit\" value=\"<?php esc_attr_e( 'Update Plugins' ); ?>\" name=\"upgrade\" /></p>\n</form>\n\t<?php\n}\n\n/**\n * Display the upgrade themes form.\n *\n * @since 2.9.0\n */\nfunction list_theme_updates() {\n\t$themes = get_theme_updates();\n\tif ( empty( $themes ) ) {\n\t\techo '<h2>' . __( 'Themes' ) . '</h2>';\n\t\techo '<p>' . __( 'Your themes are all up to date.' ) . '</p>';\n\t\treturn;\n\t}\n\n\t$form_action = 'update-core.php?action=do-theme-upgrade';\n\t?>\n<h2><?php _e( 'Themes' ); ?></h2>\n<p><?php _e( 'The following themes have new versions available. Check the ones you want to update and then click &#8220;Update Themes&#8221;.' ); ?></p>\n<p>\n\t<?php\n\tprintf(\n\t\t/* translators: %s: Link to documentation on child themes. */\n\t\t__( '<strong>Please Note:</strong> Any customizations you have made to theme files will be lost. Please consider using <a href=\"%s\">child themes</a> for modifications.' ),\n\t\t__( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' )\n\t);\n\t?>\n</p>\n<form method=\"post\" action=\"<?php echo esc_url( $form_action ); ?>\" name=\"upgrade-themes\" class=\"upgrade\">\n\t<?php wp_nonce_field( 'upgrade-core' ); ?>\n<p><input id=\"upgrade-themes\" class=\"button\" type=\"submit\" value=\"<?php esc_attr_e( 'Update Themes' ); ?>\" name=\"upgrade\" /></p>\n<table class=\"widefat updates-table\" id=\"update-themes-table\">\n\t<thead>\n\t<tr>\n\t\t<td class=\"manage-column check-column\"><input type=\"checkbox\" id=\"themes-select-all\" /></td>\n\t\t<td class=\"manage-column\"><label for=\"themes-select-all\"><?php _e( 'Select All' ); ?></label></td>\n\t</tr>\n\t</thead>\n\n\t<tbody class=\"plugins\">\n\t<?php\n\t$auto_updates = array();\n\tif ( wp_is_auto_update_enabled_for_type( 'theme' ) ) {\n\t\t$auto_updates       = (array) get_site_option( 'auto_update_themes', array() );\n\t\t$auto_update_notice = ' | ' . wp_get_auto_update_message();\n\t}\n\n\tforeach ( $themes as $stylesheet => $theme ) {\n\t\t$requires_wp  = isset( $theme->update['requires'] ) ? $theme->update['requires'] : null;\n\t\t$requires_php = isset( $theme->update['requires_php'] ) ? $theme->update['requires_php'] : null;\n\n\t\t$compatible_wp  = is_wp_version_compatible( $requires_wp );\n\t\t$compatible_php = is_php_version_compatible( $requires_php );\n\n\t\t$compat = '';\n\n\t\tif ( ! $compatible_wp && ! $compatible_php ) {\n\t\t\t$compat .= '<br>' . __( 'This update doesn&#8217;t work with your versions of WordPress and PHP.' ) . '&nbsp;';\n\t\t\tif ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {\n\t\t\t\t$compat .= sprintf(\n\t\t\t\t\t/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */\n\t\t\t\t\t__( '<a href=\"%1$s\">Please update WordPress</a>, and then <a href=\"%2$s\">learn more about updating PHP</a>.' ),\n\t\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t);\n\n\t\t\t\t$annotation = wp_get_update_php_annotation();\n\n\t\t\t\tif ( $annotation ) {\n\t\t\t\t\t$compat .= '</p><p><em>' . $annotation . '</em>';\n\t\t\t\t}\n\t\t\t} elseif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t$compat .= sprintf(\n\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t__( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t);\n\t\t\t} elseif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t$compat .= sprintf(\n\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t__( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t);\n\n\t\t\t\t$annotation = wp_get_update_php_annotation();\n\n\t\t\t\tif ( $annotation ) {\n\t\t\t\t\t$compat .= '</p><p><em>' . $annotation . '</em>';\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( ! $compatible_wp ) {\n\t\t\t$compat .= '<br>' . __( 'This update doesn&#8217;t work with your version of WordPress.' ) . '&nbsp;';\n\t\t\tif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t$compat .= sprintf(\n\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t__( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t);\n\t\t\t}\n\t\t} elseif ( ! $compatible_php ) {\n\t\t\t$compat .= '<br>' . __( 'This update doesn&#8217;t work with your version of PHP.' ) . '&nbsp;';\n\t\t\tif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t$compat .= sprintf(\n\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t__( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t);\n\n\t\t\t\t$annotation = wp_get_update_php_annotation();\n\n\t\t\t\tif ( $annotation ) {\n\t\t\t\t\t$compat .= '</p><p><em>' . $annotation . '</em>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$checkbox_id = 'checkbox_' . md5( $theme->get( 'Name' ) );\n\t\t?>\n\t<tr>\n\t\t<td class=\"check-column\">\n\t\t\t<?php if ( $compatible_wp && $compatible_php ) : ?>\n\t\t\t\t<input type=\"checkbox\" name=\"checked[]\" id=\"<?php echo $checkbox_id; ?>\" value=\"<?php echo esc_attr( $stylesheet ); ?>\" />\n\t\t\t\t<label for=\"<?php echo $checkbox_id; ?>\" class=\"screen-reader-text\">\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\tprintf( __( 'Select %s' ), $theme->display( 'Name' ) );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t<?php endif; ?>\n\t\t</td>\n\t\t<td class=\"plugin-title\"><p>\n\t\t\t<img src=\"<?php echo esc_url( $theme->get_screenshot() ); ?>\" width=\"85\" height=\"64\" class=\"updates-table-screenshot\" alt=\"\" />\n\t\t\t<strong><?php echo $theme->display( 'Name' ); ?></strong>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: 1: Theme version, 2: New version. */\n\t\t\t\t__( 'You have version %1$s installed. Update to %2$s.' ),\n\t\t\t\t$theme->display( 'Version' ),\n\t\t\t\t$theme->update['new_version']\n\t\t\t);\n\n\t\t\techo ' ' . $compat;\n\n\t\t\tif ( in_array( $stylesheet, $auto_updates, true ) ) {\n\t\t\t\techo $auto_update_notice;\n\t\t\t}\n\t\t\t?>\n\t\t</p></td>\n\t</tr>\n\t\t\t<?php\n\t}\n\t?>\n\t</tbody>\n\n\t<tfoot>\n\t<tr>\n\t\t<td class=\"manage-column check-column\"><input type=\"checkbox\" id=\"themes-select-all-2\" /></td>\n\t\t<td class=\"manage-column\"><label for=\"themes-select-all-2\"><?php _e( 'Select All' ); ?></label></td>\n\t</tr>\n\t</tfoot>\n</table>\n<p><input id=\"upgrade-themes-2\" class=\"button\" type=\"submit\" value=\"<?php esc_attr_e( 'Update Themes' ); ?>\" name=\"upgrade\" /></p>\n</form>\n\t<?php\n}\n\n/**\n * Display the update translations form.\n *\n * @since 3.7.0\n */\nfunction list_translation_updates() {\n\t$updates = wp_get_translation_updates();\n\tif ( ! $updates ) {\n\t\tif ( 'en_US' !== get_locale() ) {\n\t\t\techo '<h2>' . __( 'Translations' ) . '</h2>';\n\t\t\techo '<p>' . __( 'Your translations are all up to date.' ) . '</p>';\n\t\t}\n\t\treturn;\n\t}\n\n\t$form_action = 'update-core.php?action=do-translation-upgrade';\n\t?>\n\t<h2><?php _e( 'Translations' ); ?></h2>\n\t<form method=\"post\" action=\"<?php echo esc_url( $form_action ); ?>\" name=\"upgrade-translations\" class=\"upgrade\">\n\t\t<p><?php _e( 'New translations are available.' ); ?></p>\n\t\t<?php wp_nonce_field( 'upgrade-translations' ); ?>\n\t\t<p><input class=\"button\" type=\"submit\" value=\"<?php esc_attr_e( 'Update Translations' ); ?>\" name=\"upgrade\" /></p>\n\t</form>\n\t<?php\n}\n\n/**\n * Upgrade WordPress core display.\n *\n * @since 2.7.0\n *\n * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n *\n * @param bool $reinstall\n */\nfunction do_core_upgrade( $reinstall = false ) {\n\tglobal $wp_filesystem;\n\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\n\tif ( $reinstall ) {\n\t\t$url = 'update-core.php?action=do-core-reinstall';\n\t} else {\n\t\t$url = 'update-core.php?action=do-core-upgrade';\n\t}\n\t$url = wp_nonce_url( $url, 'upgrade-core' );\n\n\t$version = isset( $_POST['version'] ) ? $_POST['version'] : false;\n\t$locale  = isset( $_POST['locale'] ) ? $_POST['locale'] : 'en_US';\n\t$update  = find_core_update( $version, $locale );\n\tif ( ! $update ) {\n\t\treturn;\n\t}\n\n\t// Allow relaxed file ownership writes for User-initiated upgrades when the API specifies\n\t// that it's safe to do so. This only happens when there are no new files to create.\n\t$allow_relaxed_file_ownership = ! $reinstall && isset( $update->new_files ) && ! $update->new_files;\n\n\t?>\n\t<div class=\"wrap\">\n\t<h1><?php _e( 'Update WordPress' ); ?></h1>\n\t<?php\n\n\t$credentials = request_filesystem_credentials( $url, '', false, ABSPATH, array( 'version', 'locale' ), $allow_relaxed_file_ownership );\n\tif ( false === $credentials ) {\n\t\techo '</div>';\n\t\treturn;\n\t}\n\n\tif ( ! WP_Filesystem( $credentials, ABSPATH, $allow_relaxed_file_ownership ) ) {\n\t\t// Failed to connect. Error and request again.\n\t\trequest_filesystem_credentials( $url, '', true, ABSPATH, array( 'version', 'locale' ), $allow_relaxed_file_ownership );\n\t\techo '</div>';\n\t\treturn;\n\t}\n\n\tif ( $wp_filesystem->errors->has_errors() ) {\n\t\tforeach ( $wp_filesystem->errors->get_error_messages() as $message ) {\n\t\t\tshow_message( $message );\n\t\t}\n\t\techo '</div>';\n\t\treturn;\n\t}\n\n\tif ( $reinstall ) {\n\t\t$update->response = 'reinstall';\n\t}\n\n\tadd_filter( 'update_feedback', 'show_message' );\n\n\t$upgrader = new Core_Upgrader();\n\t$result   = $upgrader->upgrade(\n\t\t$update,\n\t\tarray(\n\t\t\t'allow_relaxed_file_ownership' => $allow_relaxed_file_ownership,\n\t\t)\n\t);\n\n\tif ( is_wp_error( $result ) ) {\n\t\tshow_message( $result );\n\t\tif ( 'up_to_date' != $result->get_error_code() && 'locked' != $result->get_error_code() ) {\n\t\t\tshow_message( __( 'Installation failed.' ) );\n\t\t}\n\t\techo '</div>';\n\t\treturn;\n\t}\n\n\tshow_message( __( 'WordPress updated successfully.' ) );\n\tshow_message(\n\t\t'<span class=\"hide-if-no-js\">' . sprintf(\n\t\t\t/* translators: 1: WordPress version, 2: URL to About screen. */\n\t\t\t__( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href=\"%2$s\">here</a>.' ),\n\t\t\t$result,\n\t\t\tesc_url( self_admin_url( 'about.php?updated' ) )\n\t\t) . '</span>'\n\t);\n\tshow_message(\n\t\t'<span class=\"hide-if-js\">' . sprintf(\n\t\t\t/* translators: 1: WordPress version, 2: URL to About screen. */\n\t\t\t__( 'Welcome to WordPress %1$s. <a href=\"%2$s\">Learn more</a>.' ),\n\t\t\t$result,\n\t\t\tesc_url( self_admin_url( 'about.php?updated' ) )\n\t\t) . '</span>'\n\t);\n\t?>\n\t</div>\n\t<script type=\"text/javascript\">\n\twindow.location = '<?php echo self_admin_url( 'about.php?updated' ); ?>';\n\t</script>\n\t<?php\n}\n\n/**\n * Dismiss a core update.\n *\n * @since 2.7.0\n */\nfunction do_dismiss_core_update() {\n\t$version = isset( $_POST['version'] ) ? $_POST['version'] : false;\n\t$locale  = isset( $_POST['locale'] ) ? $_POST['locale'] : 'en_US';\n\t$update  = find_core_update( $version, $locale );\n\tif ( ! $update ) {\n\t\treturn;\n\t}\n\tdismiss_core_update( $update );\n\twp_redirect( wp_nonce_url( 'update-core.php?action=upgrade-core', 'upgrade-core' ) );\n\texit;\n}\n\n/**\n * Undismiss a core update.\n *\n * @since 2.7.0\n */\nfunction do_undismiss_core_update() {\n\t$version = isset( $_POST['version'] ) ? $_POST['version'] : false;\n\t$locale  = isset( $_POST['locale'] ) ? $_POST['locale'] : 'en_US';\n\t$update  = find_core_update( $version, $locale );\n\tif ( ! $update ) {\n\t\treturn;\n\t}\n\tundismiss_core_update( $version, $locale );\n\twp_redirect( wp_nonce_url( 'update-core.php?action=upgrade-core', 'upgrade-core' ) );\n\texit;\n}\n\n$action = isset( $_GET['action'] ) ? $_GET['action'] : 'upgrade-core';\n\n$upgrade_error = false;\nif ( ( 'do-theme-upgrade' === $action || ( 'do-plugin-upgrade' === $action && ! isset( $_GET['plugins'] ) ) )\n\t&& ! isset( $_POST['checked'] ) ) {\n\t$upgrade_error = ( 'do-theme-upgrade' === $action ) ? 'themes' : 'plugins';\n\t$action        = 'upgrade-core';\n}\n\n$title       = __( 'WordPress Updates' );\n$parent_file = 'index.php';\n\n$updates_overview  = '<p>' . __( 'On this screen, you can update to the latest version of WordPress, as well as update your themes, plugins, and translations from the WordPress.org repositories.' ) . '</p>';\n$updates_overview .= '<p>' . __( 'If an update is available, you&#8127;ll see a notification appear in the Toolbar and navigation menu.' ) . ' ' . __( 'Keeping your site updated is important for security. It also makes the internet a safer place for you and your readers.' ) . '</p>';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' => $updates_overview,\n\t)\n);\n\n$updates_howto  = '<p>' . __( '<strong>WordPress</strong> &mdash; Updating your WordPress installation is a simple one-click procedure: just <strong>click on the &#8220;Update Now&#8221; button</strong> when you are notified that a new version is available.' ) . ' ' . __( 'In most cases, WordPress will automatically apply maintenance and security updates in the background for you.' ) . '</p>';\n$updates_howto .= '<p>' . __( '<strong>Themes and Plugins</strong> &mdash; To update individual themes or plugins from this screen, use the checkboxes to make your selection, then <strong>click on the appropriate &#8220;Update&#8221; button</strong>. To update all of your themes or plugins at once, you can check the box at the top of the section to select all before clicking the update button.' ) . '</p>';\n\nif ( 'en_US' !== get_locale() ) {\n\t$updates_howto .= '<p>' . __( '<strong>Translations</strong> &mdash; The files translating WordPress into your language are updated for you whenever any other updates occur. But if these files are out of date, you can <strong>click the &#8220;Update Translations&#8221;</strong> button.' ) . '</p>';\n}\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'how-to-update',\n\t\t'title'   => __( 'How to Update' ),\n\t\t'content' => $updates_howto,\n\t)\n);\n\n$help_sidebar_autoupdates = '';\n\nif ( ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) || ( current_user_can( 'update_plugins' ) && wp_is_auto_update_enabled_for_type( 'plugin' ) ) ) {\n\t$help_tab_autoupdates  = '<p>' . __( 'Auto-updates can be enabled or disabled for each individual theme or plugin. Themes or plugins with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates depends on the WP-Cron task scheduling system.' ) . '</p>';\n\t$help_tab_autoupdates .= '<p>' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '</p>';\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'plugins-themes-auto-updates',\n\t\t\t'title'   => __( 'Auto-updates' ),\n\t\t\t'content' => $help_tab_autoupdates,\n\t\t)\n\t);\n\n\t$help_sidebar_autoupdates = '<p>' . __( '<a href=\"https://wordpress.org/support/article/plugins-themes-auto-updates/\">Learn more: Auto-updates documentation</a>' ) . '</p>';\n}\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/dashboard-updates-screen/\">Documentation on Updating WordPress</a>' ) . '</p>' .\n\t$help_sidebar_autoupdates .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nif ( 'upgrade-core' === $action ) {\n\t// Force a update check when requested.\n\t$force_check = ! empty( $_GET['force-check'] );\n\twp_version_check( array(), $force_check );\n\n\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t?>\n\t<div class=\"wrap\">\n\t<h1><?php _e( 'WordPress Updates' ); ?></h1>\n\t<?php\n\tif ( $upgrade_error ) {\n\t\techo '<div class=\"error\"><p>';\n\t\tif ( 'themes' === $upgrade_error ) {\n\t\t\t_e( 'Please select one or more themes to update.' );\n\t\t} else {\n\t\t\t_e( 'Please select one or more plugins to update.' );\n\t\t}\n\t\techo '</p></div>';\n\t}\n\n\t$last_update_check = false;\n\t$current           = get_site_transient( 'update_core' );\n\n\tif ( $current && isset( $current->last_checked ) ) {\n\t\t$last_update_check = $current->last_checked + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;\n\t}\n\n\techo '<p>';\n\t/* translators: 1: Date, 2: Time. */\n\tprintf( __( 'Last checked on %1$s at %2$s.' ), date_i18n( __( 'F j, Y' ), $last_update_check ), date_i18n( __( 'g:i a' ), $last_update_check ) );\n\techo ' &nbsp; <a class=\"button\" href=\"' . esc_url( self_admin_url( 'update-core.php?force-check=1' ) ) . '\">' . __( 'Check Again' ) . '</a>';\n\techo '</p>';\n\n\tif ( current_user_can( 'update_core' ) ) {\n\t\tcore_upgrade_preamble();\n\t}\n\tif ( current_user_can( 'update_plugins' ) ) {\n\t\tlist_plugin_updates();\n\t}\n\tif ( current_user_can( 'update_themes' ) ) {\n\t\tlist_theme_updates();\n\t}\n\tif ( current_user_can( 'update_languages' ) ) {\n\t\tlist_translation_updates();\n\t}\n\n\t/**\n\t * Fires after the core, plugin, and theme update tables.\n\t *\n\t * @since 2.9.0\n\t */\n\tdo_action( 'core_upgrade_preamble' );\n\techo '</div>';\n\n\twp_localize_script(\n\t\t'updates',\n\t\t'_wpUpdatesItemCounts',\n\t\tarray(\n\t\t\t'totals' => wp_get_update_data(),\n\t\t)\n\t);\n\n\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\n} elseif ( 'do-core-upgrade' === $action || 'do-core-reinstall' === $action ) {\n\n\tif ( ! current_user_can( 'update_core' ) ) {\n\t\twp_die( __( 'Sorry, you are not allowed to update this site.' ) );\n\t}\n\n\tcheck_admin_referer( 'upgrade-core' );\n\n\t// Do the (un)dismiss actions before headers, so that they can redirect.\n\tif ( isset( $_POST['dismiss'] ) ) {\n\t\tdo_dismiss_core_update();\n\t} elseif ( isset( $_POST['undismiss'] ) ) {\n\t\tdo_undismiss_core_update();\n\t}\n\n\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\tif ( 'do-core-reinstall' === $action ) {\n\t\t$reinstall = true;\n\t} else {\n\t\t$reinstall = false;\n\t}\n\n\tif ( isset( $_POST['upgrade'] ) ) {\n\t\tdo_core_upgrade( $reinstall );\n\t}\n\n\twp_localize_script(\n\t\t'updates',\n\t\t'_wpUpdatesItemCounts',\n\t\tarray(\n\t\t\t'totals' => wp_get_update_data(),\n\t\t)\n\t);\n\n\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\n} elseif ( 'do-plugin-upgrade' === $action ) {\n\n\tif ( ! current_user_can( 'update_plugins' ) ) {\n\t\twp_die( __( 'Sorry, you are not allowed to update this site.' ) );\n\t}\n\n\tcheck_admin_referer( 'upgrade-core' );\n\n\tif ( isset( $_GET['plugins'] ) ) {\n\t\t$plugins = explode( ',', $_GET['plugins'] );\n\t} elseif ( isset( $_POST['checked'] ) ) {\n\t\t$plugins = (array) $_POST['checked'];\n\t} else {\n\t\twp_redirect( admin_url( 'update-core.php' ) );\n\t\texit;\n\t}\n\n\t$url = 'update.php?action=update-selected&plugins=' . urlencode( implode( ',', $plugins ) );\n\t$url = wp_nonce_url( $url, 'bulk-update-plugins' );\n\n\t$title = __( 'Update Plugins' );\n\n\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\techo '<div class=\"wrap\">';\n\techo '<h1>' . __( 'Update Plugins' ) . '</h1>';\n\techo '<iframe src=\"', $url, '\" style=\"width: 100%; height: 100%; min-height: 750px;\" frameborder=\"0\" title=\"' . esc_attr__( 'Update progress' ) . '\"></iframe>';\n\techo '</div>';\n\n\twp_localize_script(\n\t\t'updates',\n\t\t'_wpUpdatesItemCounts',\n\t\tarray(\n\t\t\t'totals' => wp_get_update_data(),\n\t\t)\n\t);\n\n\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\n} elseif ( 'do-theme-upgrade' === $action ) {\n\n\tif ( ! current_user_can( 'update_themes' ) ) {\n\t\twp_die( __( 'Sorry, you are not allowed to update this site.' ) );\n\t}\n\n\tcheck_admin_referer( 'upgrade-core' );\n\n\tif ( isset( $_GET['themes'] ) ) {\n\t\t$themes = explode( ',', $_GET['themes'] );\n\t} elseif ( isset( $_POST['checked'] ) ) {\n\t\t$themes = (array) $_POST['checked'];\n\t} else {\n\t\twp_redirect( admin_url( 'update-core.php' ) );\n\t\texit;\n\t}\n\n\t$url = 'update.php?action=update-selected-themes&themes=' . urlencode( implode( ',', $themes ) );\n\t$url = wp_nonce_url( $url, 'bulk-update-themes' );\n\n\t$title = __( 'Update Themes' );\n\n\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t?>\n\t<div class=\"wrap\">\n\t\t<h1><?php _e( 'Update Themes' ); ?></h1>\n\t\t<iframe src=\"<?php echo $url; ?>\" style=\"width: 100%; height: 100%; min-height: 750px;\" frameborder=\"0\" title=\"<?php esc_attr_e( 'Update progress' ); ?>\"></iframe>\n\t</div>\n\t<?php\n\n\twp_localize_script(\n\t\t'updates',\n\t\t'_wpUpdatesItemCounts',\n\t\tarray(\n\t\t\t'totals' => wp_get_update_data(),\n\t\t)\n\t);\n\n\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\n} elseif ( 'do-translation-upgrade' === $action ) {\n\n\tif ( ! current_user_can( 'update_languages' ) ) {\n\t\twp_die( __( 'Sorry, you are not allowed to update this site.' ) );\n\t}\n\n\tcheck_admin_referer( 'upgrade-translations' );\n\n\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\n\t$url     = 'update-core.php?action=do-translation-upgrade';\n\t$nonce   = 'upgrade-translations';\n\t$title   = __( 'Update Translations' );\n\t$context = WP_LANG_DIR;\n\n\t$upgrader = new Language_Pack_Upgrader( new Language_Pack_Upgrader_Skin( compact( 'url', 'nonce', 'title', 'context' ) ) );\n\t$result   = $upgrader->bulk_upgrade();\n\n\twp_localize_script(\n\t\t'updates',\n\t\t'_wpUpdatesItemCounts',\n\t\tarray(\n\t\t\t'totals' => wp_get_update_data(),\n\t\t)\n\t);\n\n\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\n} else {\n\t/**\n\t * Fires for each custom update action on the WordPress Updates screen.\n\t *\n\t * The dynamic portion of the hook name, `$action`, refers to the\n\t * passed update action. The hook fires in lieu of all available\n\t * default update actions.\n\t *\n\t * @since 3.2.0\n\t */\n\tdo_action( \"update-core-custom_{$action}\" );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n}\n", "num_lines": 1069}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Update/Install Plugin/Theme administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\nif ( ! defined( 'IFRAME_REQUEST' )\n\t&& isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'update-selected', 'activate-plugin', 'update-selected-themes' ), true )\n) {\n\tdefine( 'IFRAME_REQUEST', true );\n}\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\nwp_enqueue_script( 'wp-a11y' );\n\nif ( isset( $_GET['action'] ) ) {\n\t$plugin = isset( $_REQUEST['plugin'] ) ? trim( $_REQUEST['plugin'] ) : '';\n\t$theme  = isset( $_REQUEST['theme'] ) ? urldecode( $_REQUEST['theme'] ) : '';\n\t$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';\n\n\tif ( 'update-selected' === $action ) {\n\t\tif ( ! current_user_can( 'update_plugins' ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) );\n\t\t}\n\n\t\tcheck_admin_referer( 'bulk-update-plugins' );\n\n\t\tif ( isset( $_GET['plugins'] ) ) {\n\t\t\t$plugins = explode( ',', stripslashes( $_GET['plugins'] ) );\n\t\t} elseif ( isset( $_POST['checked'] ) ) {\n\t\t\t$plugins = (array) $_POST['checked'];\n\t\t} else {\n\t\t\t$plugins = array();\n\t\t}\n\n\t\t$plugins = array_map( 'urldecode', $plugins );\n\n\t\t$url   = 'update.php?action=update-selected&amp;plugins=' . urlencode( implode( ',', $plugins ) );\n\t\t$nonce = 'bulk-update-plugins';\n\n\t\twp_enqueue_script( 'updates' );\n\t\tiframe_header();\n\n\t\t$upgrader = new Plugin_Upgrader( new Bulk_Plugin_Upgrader_Skin( compact( 'nonce', 'url' ) ) );\n\t\t$upgrader->bulk_upgrade( $plugins );\n\n\t\tiframe_footer();\n\n\t} elseif ( 'upgrade-plugin' === $action ) {\n\t\tif ( ! current_user_can( 'update_plugins' ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) );\n\t\t}\n\n\t\tcheck_admin_referer( 'upgrade-plugin_' . $plugin );\n\n\t\t$title        = __( 'Update Plugin' );\n\t\t$parent_file  = 'plugins.php';\n\t\t$submenu_file = 'plugins.php';\n\n\t\twp_enqueue_script( 'updates' );\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n\t\t$nonce = 'upgrade-plugin_' . $plugin;\n\t\t$url   = 'update.php?action=upgrade-plugin&plugin=' . urlencode( $plugin );\n\n\t\t$upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'plugin' ) ) );\n\t\t$upgrader->upgrade( $plugin );\n\n\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\n\t} elseif ( 'activate-plugin' === $action ) {\n\t\tif ( ! current_user_can( 'update_plugins' ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) );\n\t\t}\n\n\t\tcheck_admin_referer( 'activate-plugin_' . $plugin );\n\t\tif ( ! isset( $_GET['failure'] ) && ! isset( $_GET['success'] ) ) {\n\t\t\twp_redirect( admin_url( 'update.php?action=activate-plugin&failure=true&plugin=' . urlencode( $plugin ) . '&_wpnonce=' . $_GET['_wpnonce'] ) );\n\t\t\tactivate_plugin( $plugin, '', ! empty( $_GET['networkwide'] ), true );\n\t\t\twp_redirect( admin_url( 'update.php?action=activate-plugin&success=true&plugin=' . urlencode( $plugin ) . '&_wpnonce=' . $_GET['_wpnonce'] ) );\n\t\t\tdie();\n\t\t}\n\t\tiframe_header( __( 'Plugin Reactivation' ), true );\n\t\tif ( isset( $_GET['success'] ) ) {\n\t\t\techo '<p>' . __( 'Plugin reactivated successfully.' ) . '</p>';\n\t\t}\n\n\t\tif ( isset( $_GET['failure'] ) ) {\n\t\t\techo '<p>' . __( 'Plugin failed to reactivate due to a fatal error.' ) . '</p>';\n\n\t\t\terror_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );\n\t\t\tini_set( 'display_errors', true ); // Ensure that fatal errors are displayed.\n\t\t\twp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );\n\t\t\tinclude WP_PLUGIN_DIR . '/' . $plugin;\n\t\t}\n\t\tiframe_footer();\n\t} elseif ( 'install-plugin' === $action ) {\n\n\t\tif ( ! current_user_can( 'install_plugins' ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );\n\t\t}\n\n\t\tinclude_once ABSPATH . 'wp-admin/includes/plugin-install.php'; // For plugins_api().\n\n\t\tcheck_admin_referer( 'install-plugin_' . $plugin );\n\t\t$api = plugins_api(\n\t\t\t'plugin_information',\n\t\t\tarray(\n\t\t\t\t'slug'   => $plugin,\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'sections' => false,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\tif ( is_wp_error( $api ) ) {\n\t\t\twp_die( $api );\n\t\t}\n\n\t\t$title        = __( 'Plugin Installation' );\n\t\t$parent_file  = 'plugins.php';\n\t\t$submenu_file = 'plugin-install.php';\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n\t\t/* translators: %s: Plugin name and version. */\n\t\t$title = sprintf( __( 'Installing Plugin: %s' ), $api->name . ' ' . $api->version );\n\t\t$nonce = 'install-plugin_' . $plugin;\n\t\t$url   = 'update.php?action=install-plugin&plugin=' . urlencode( $plugin );\n\t\tif ( isset( $_GET['from'] ) ) {\n\t\t\t$url .= '&from=' . urlencode( stripslashes( $_GET['from'] ) );\n\t\t}\n\n\t\t$type = 'web'; // Install plugin type, From Web or an Upload.\n\n\t\t$upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact( 'title', 'url', 'nonce', 'plugin', 'api' ) ) );\n\t\t$upgrader->install( $api->download_link );\n\n\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\n\t} elseif ( 'upload-plugin' === $action ) {\n\n\t\tif ( ! current_user_can( 'upload_plugins' ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );\n\t\t}\n\n\t\tcheck_admin_referer( 'plugin-upload' );\n\n\t\t$file_upload = new File_Upload_Upgrader( 'pluginzip', 'package' );\n\n\t\t$title        = __( 'Upload Plugin' );\n\t\t$parent_file  = 'plugins.php';\n\t\t$submenu_file = 'plugin-install.php';\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n\t\t/* translators: %s: File name. */\n\t\t$title = sprintf( __( 'Installing plugin from uploaded file: %s' ), esc_html( basename( $file_upload->filename ) ) );\n\t\t$nonce = 'plugin-upload';\n\t\t$url   = add_query_arg( array( 'package' => $file_upload->id ), 'update.php?action=upload-plugin' );\n\t\t$type  = 'upload'; // Install plugin type, From Web or an Upload.\n\n\t\t$overwrite = isset( $_GET['overwrite'] ) ? sanitize_text_field( $_GET['overwrite'] ) : '';\n\t\t$overwrite = in_array( $overwrite, array( 'update-plugin', 'downgrade-plugin' ), true ) ? $overwrite : '';\n\n\t\t$upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact( 'type', 'title', 'nonce', 'url', 'overwrite' ) ) );\n\t\t$result   = $upgrader->install( $file_upload->package, array( 'overwrite_package' => $overwrite ) );\n\n\t\tif ( $result || is_wp_error( $result ) ) {\n\t\t\t$file_upload->cleanup();\n\t\t}\n\n\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\n\t} elseif ( 'upload-plugin-cancel-overwrite' === $action ) {\n\t\tif ( ! current_user_can( 'upload_plugins' ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );\n\t\t}\n\n\t\tcheck_admin_referer( 'plugin-upload-cancel-overwrite' );\n\n\t\t// Make sure the attachment still exists, or File_Upload_Upgrader will call wp_die()\n\t\t// that shows a generic \"Please select a file\" error.\n\t\tif ( ! empty( $_GET['package'] ) ) {\n\t\t\t$attachment_id = (int) $_GET['package'];\n\n\t\t\tif ( get_post( $attachment_id ) ) {\n\t\t\t\t$file_upload = new File_Upload_Upgrader( 'pluginzip', 'package' );\n\t\t\t\t$file_upload->cleanup();\n\t\t\t}\n\t\t}\n\n\t\twp_redirect( self_admin_url( 'plugin-install.php' ) );\n\t\texit;\n\t} elseif ( 'upgrade-theme' === $action ) {\n\n\t\tif ( ! current_user_can( 'update_themes' ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to update themes for this site.' ) );\n\t\t}\n\n\t\tcheck_admin_referer( 'upgrade-theme_' . $theme );\n\n\t\twp_enqueue_script( 'updates' );\n\n\t\t$title        = __( 'Update Theme' );\n\t\t$parent_file  = 'themes.php';\n\t\t$submenu_file = 'themes.php';\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n\t\t$nonce = 'upgrade-theme_' . $theme;\n\t\t$url   = 'update.php?action=upgrade-theme&theme=' . urlencode( $theme );\n\n\t\t$upgrader = new Theme_Upgrader( new Theme_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'theme' ) ) );\n\t\t$upgrader->upgrade( $theme );\n\n\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t} elseif ( 'update-selected-themes' === $action ) {\n\t\tif ( ! current_user_can( 'update_themes' ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to update themes for this site.' ) );\n\t\t}\n\n\t\tcheck_admin_referer( 'bulk-update-themes' );\n\n\t\tif ( isset( $_GET['themes'] ) ) {\n\t\t\t$themes = explode( ',', stripslashes( $_GET['themes'] ) );\n\t\t} elseif ( isset( $_POST['checked'] ) ) {\n\t\t\t$themes = (array) $_POST['checked'];\n\t\t} else {\n\t\t\t$themes = array();\n\t\t}\n\n\t\t$themes = array_map( 'urldecode', $themes );\n\n\t\t$url   = 'update.php?action=update-selected-themes&amp;themes=' . urlencode( implode( ',', $themes ) );\n\t\t$nonce = 'bulk-update-themes';\n\n\t\twp_enqueue_script( 'updates' );\n\t\tiframe_header();\n\n\t\t$upgrader = new Theme_Upgrader( new Bulk_Theme_Upgrader_Skin( compact( 'nonce', 'url' ) ) );\n\t\t$upgrader->bulk_upgrade( $themes );\n\n\t\tiframe_footer();\n\t} elseif ( 'install-theme' === $action ) {\n\n\t\tif ( ! current_user_can( 'install_themes' ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );\n\t\t}\n\n\t\tinclude_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; // For themes_api().\n\n\t\tcheck_admin_referer( 'install-theme_' . $theme );\n\t\t$api = themes_api(\n\t\t\t'theme_information',\n\t\t\tarray(\n\t\t\t\t'slug'   => $theme,\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'sections' => false,\n\t\t\t\t\t'tags'     => false,\n\t\t\t\t),\n\t\t\t)\n\t\t); // Save on a bit of bandwidth.\n\n\t\tif ( is_wp_error( $api ) ) {\n\t\t\twp_die( $api );\n\t\t}\n\n\t\t$title        = __( 'Install Themes' );\n\t\t$parent_file  = 'themes.php';\n\t\t$submenu_file = 'themes.php';\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n\t\t/* translators: %s: Theme name and version. */\n\t\t$title = sprintf( __( 'Installing Theme: %s' ), $api->name . ' ' . $api->version );\n\t\t$nonce = 'install-theme_' . $theme;\n\t\t$url   = 'update.php?action=install-theme&theme=' . urlencode( $theme );\n\t\t$type  = 'web'; // Install theme type, From Web or an Upload.\n\n\t\t$upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact( 'title', 'url', 'nonce', 'plugin', 'api' ) ) );\n\t\t$upgrader->install( $api->download_link );\n\n\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\n\t} elseif ( 'upload-theme' === $action ) {\n\n\t\tif ( ! current_user_can( 'upload_themes' ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );\n\t\t}\n\n\t\tcheck_admin_referer( 'theme-upload' );\n\n\t\t$file_upload = new File_Upload_Upgrader( 'themezip', 'package' );\n\n\t\t$title        = __( 'Upload Theme' );\n\t\t$parent_file  = 'themes.php';\n\t\t$submenu_file = 'theme-install.php';\n\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n\t\t/* translators: %s: File name. */\n\t\t$title = sprintf( __( 'Installing theme from uploaded file: %s' ), esc_html( basename( $file_upload->filename ) ) );\n\t\t$nonce = 'theme-upload';\n\t\t$url   = add_query_arg( array( 'package' => $file_upload->id ), 'update.php?action=upload-theme' );\n\t\t$type  = 'upload'; // Install theme type, From Web or an Upload.\n\n\t\t$overwrite = isset( $_GET['overwrite'] ) ? sanitize_text_field( $_GET['overwrite'] ) : '';\n\t\t$overwrite = in_array( $overwrite, array( 'update-theme', 'downgrade-theme' ), true ) ? $overwrite : '';\n\n\t\t$upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact( 'type', 'title', 'nonce', 'url', 'overwrite' ) ) );\n\t\t$result   = $upgrader->install( $file_upload->package, array( 'overwrite_package' => $overwrite ) );\n\n\t\tif ( $result || is_wp_error( $result ) ) {\n\t\t\t$file_upload->cleanup();\n\t\t}\n\n\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\n\t} elseif ( 'upload-theme-cancel-overwrite' === $action ) {\n\t\tif ( ! current_user_can( 'upload_themes' ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );\n\t\t}\n\n\t\tcheck_admin_referer( 'theme-upload-cancel-overwrite' );\n\n\t\t// Make sure the attachment still exists, or File_Upload_Upgrader will call wp_die()\n\t\t// that shows a generic \"Please select a file\" error.\n\t\tif ( ! empty( $_GET['package'] ) ) {\n\t\t\t$attachment_id = (int) $_GET['package'];\n\n\t\t\tif ( get_post( $attachment_id ) ) {\n\t\t\t\t$file_upload = new File_Upload_Upgrader( 'themezip', 'package' );\n\t\t\t\t$file_upload->cleanup();\n\t\t\t}\n\t\t}\n\n\t\twp_redirect( self_admin_url( 'theme-install.php' ) );\n\t\texit;\n\t} else {\n\t\t/**\n\t\t * Fires when a custom plugin or theme update request is received.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$action`, refers to the action\n\t\t * provided in the request for wp-admin/update.php. Can be used to\n\t\t * provide custom update functionality for themes and plugins.\n\t\t *\n\t\t * @since 2.8.0\n\t\t */\n\t\tdo_action( \"update-custom_{$action}\" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t}\n}\n", "num_lines": 355}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Upgrade Functions. Old file, must not be used. Include\n * wp-admin/includes/upgrade.php instead.\n *\n * @deprecated 2.5.0\n * @package WordPress\n * @subpackage Administration\n */\n\n_deprecated_file( basename( __FILE__ ), '2.5.0', 'wp-admin/includes/upgrade.php' );\nrequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n", "num_lines": 13}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrade WordPress Page.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * We are upgrading WordPress.\n *\n * @since 1.5.1\n * @var bool\n */\ndefine( 'WP_INSTALLING', true );\n\n/** Load WordPress Bootstrap */\nrequire dirname( __DIR__ ) . '/wp-load.php';\n\nnocache_headers();\n\nrequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\ndelete_site_transient( 'update_core' );\n\nif ( isset( $_GET['step'] ) ) {\n\t$step = $_GET['step'];\n} else {\n\t$step = 0;\n}\n\n// Do it. No output.\nif ( 'upgrade_db' === $step ) {\n\twp_upgrade();\n\tdie( '0' );\n}\n\n/**\n * @global string $wp_version             The WordPress version string.\n * @global string $required_php_version   The required PHP version string.\n * @global string $required_mysql_version The required MySQL version string.\n */\nglobal $wp_version, $required_php_version, $required_mysql_version;\n\n$step = (int) $step;\n\n$php_version   = phpversion();\n$mysql_version = $wpdb->db_version();\n$php_compat    = version_compare( $php_version, $required_php_version, '>=' );\nif ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) {\n\t$mysql_compat = true;\n} else {\n\t$mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' );\n}\n\nheader( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );\n?>\n<!DOCTYPE html>\n<html <?php language_attributes(); ?>>\n<head>\n\t<meta name=\"viewport\" content=\"width=device-width\" />\n\t<meta http-equiv=\"Content-Type\" content=\"<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>\" />\n\t<meta name=\"robots\" content=\"noindex,nofollow\" />\n\t<title><?php _e( 'WordPress &rsaquo; Update' ); ?></title>\n\t<?php wp_admin_css( 'install', true ); ?>\n</head>\n<body class=\"wp-core-ui\">\n<p id=\"logo\"><a href=\"<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>\"><?php _e( 'WordPress' ); ?></a></p>\n\n<?php if ( (int) get_option( 'db_version' ) === $wp_db_version || ! is_blog_installed() ) : ?>\n\n<h1><?php _e( 'No Update Required' ); ?></h1>\n<p><?php _e( 'Your WordPress database is already up to date!' ); ?></p>\n<p class=\"step\"><a class=\"button button-large\" href=\"<?php echo get_option( 'home' ); ?>/\"><?php _e( 'Continue' ); ?></a></p>\n\n\t<?php\nelseif ( ! $php_compat || ! $mysql_compat ) :\n\t$version_url = sprintf(\n\t\t/* translators: %s: WordPress version. */\n\t\tesc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),\n\t\tsanitize_title( $wp_version )\n\t);\n\n\t/* translators: %s: URL to Update PHP page. */\n\t$php_update_message = '</p><p>' . sprintf(\n\t\t__( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\tesc_url( wp_get_update_php_url() )\n\t);\n\n\t$annotation = wp_get_update_php_annotation();\n\n\tif ( $annotation ) {\n\t\t$php_update_message .= '</p><p><em>' . $annotation . '</em>';\n\t}\n\n\tif ( ! $mysql_compat && ! $php_compat ) {\n\t\t$message = sprintf(\n\t\t\t/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number. */\n\t\t\t__( 'You cannot update because <a href=\"%1$s\">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ),\n\t\t\t$version_url,\n\t\t\t$wp_version,\n\t\t\t$required_php_version,\n\t\t\t$required_mysql_version,\n\t\t\t$php_version,\n\t\t\t$mysql_version\n\t\t) . $php_update_message;\n\t} elseif ( ! $php_compat ) {\n\t\t$message = sprintf(\n\t\t\t/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number. */\n\t\t\t__( 'You cannot update because <a href=\"%1$s\">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ),\n\t\t\t$version_url,\n\t\t\t$wp_version,\n\t\t\t$required_php_version,\n\t\t\t$php_version\n\t\t) . $php_update_message;\n\t} elseif ( ! $mysql_compat ) {\n\t\t$message = sprintf(\n\t\t\t/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number. */\n\t\t\t__( 'You cannot update because <a href=\"%1$s\">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ),\n\t\t\t$version_url,\n\t\t\t$wp_version,\n\t\t\t$required_mysql_version,\n\t\t\t$mysql_version\n\t\t);\n\t}\n\n\techo '<p>' . $message . '</p>';\n\t?>\n\t<?php\nelse :\n\tswitch ( $step ) :\n\t\tcase 0:\n\t\t\t$goback = wp_get_referer();\n\t\t\tif ( $goback ) {\n\t\t\t\t$goback = esc_url_raw( $goback );\n\t\t\t\t$goback = urlencode( $goback );\n\t\t\t}\n\t\t\t?>\n\t<h1><?php _e( 'Database Update Required' ); ?></h1>\n<p><?php _e( 'WordPress has been updated! Before we send you on your way, we have to update your database to the newest version.' ); ?></p>\n<p><?php _e( 'The database update process may take a little while, so please be patient.' ); ?></p>\n<p class=\"step\"><a class=\"button button-large button-primary\" href=\"upgrade.php?step=1&amp;backto=<?php echo $goback; ?>\"><?php _e( 'Update WordPress Database' ); ?></a></p>\n\t\t\t<?php\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\twp_upgrade();\n\n\t\t\t$backto = ! empty( $_GET['backto'] ) ? wp_unslash( urldecode( $_GET['backto'] ) ) : __get_option( 'home' ) . '/';\n\t\t\t$backto = esc_url( $backto );\n\t\t\t$backto = wp_validate_redirect( $backto, __get_option( 'home' ) . '/' );\n\t\t\t?>\n\t<h1><?php _e( 'Update Complete' ); ?></h1>\n\t<p><?php _e( 'Your WordPress database has been successfully updated!' ); ?></p>\n\t<p class=\"step\"><a class=\"button button-large\" href=\"<?php echo $backto; ?>\"><?php _e( 'Continue' ); ?></a></p>\n\t\t\t<?php\n\t\t\tbreak;\nendswitch;\nendif;\n?>\n</body>\n</html>\n", "num_lines": 162}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Media Library administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'upload_files' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to upload files.' ) );\n}\n\n$mode  = get_user_option( 'media_library_mode', get_current_user_id() ) ? get_user_option( 'media_library_mode', get_current_user_id() ) : 'grid';\n$modes = array( 'grid', 'list' );\n\nif ( isset( $_GET['mode'] ) && in_array( $_GET['mode'], $modes, true ) ) {\n\t$mode = $_GET['mode'];\n\tupdate_user_option( get_current_user_id(), 'media_library_mode', $mode );\n}\n\nif ( 'grid' === $mode ) {\n\twp_enqueue_media();\n\twp_enqueue_script( 'media-grid' );\n\twp_enqueue_script( 'media' );\n\n\tremove_action( 'admin_head', 'wp_admin_canonical_url' );\n\n\t$q = $_GET;\n\t// Let JS handle this.\n\tunset( $q['s'] );\n\t$vars   = wp_edit_attachments_query_vars( $q );\n\t$ignore = array( 'mode', 'post_type', 'post_status', 'posts_per_page' );\n\tforeach ( $vars as $key => $value ) {\n\t\tif ( ! $value || in_array( $key, $ignore, true ) ) {\n\t\t\tunset( $vars[ $key ] );\n\t\t}\n\t}\n\n\twp_localize_script(\n\t\t'media-grid',\n\t\t'_wpMediaGridSettings',\n\t\tarray(\n\t\t\t'adminUrl'  => parse_url( self_admin_url(), PHP_URL_PATH ),\n\t\t\t'queryVars' => (object) $vars,\n\t\t)\n\t);\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'overview',\n\t\t\t'title'   => __( 'Overview' ),\n\t\t\t'content' =>\n\t\t\t\t'<p>' . __( 'All the files you&#8217;ve uploaded are listed in the Media Library, with the most recent uploads listed first.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'You can view your media in a simple visual grid or a list with columns. Switch between these views using the icons to the left above the media.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'To delete media items, click the Bulk Select button at the top of the screen. Select any items you wish to delete, then click the Delete Selected button. Clicking the Cancel Selection button takes you back to viewing your media.' ) . '</p>',\n\t\t)\n\t);\n\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'attachment-details',\n\t\t\t'title'   => __( 'Attachment Details' ),\n\t\t\t'content' =>\n\t\t\t\t'<p>' . __( 'Clicking an item will display an Attachment Details dialog, which allows you to preview media and make quick edits. Any changes you make to the attachment details will be automatically saved.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'Use the arrow buttons at the top of the dialog, or the left and right arrow keys on your keyboard, to navigate between media items quickly.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'You can also delete individual items and access the extended edit screen from the details dialog.' ) . '</p>',\n\t\t)\n\t);\n\n\tget_current_screen()->set_help_sidebar(\n\t\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/media-library-screen/\">Documentation on Media Library</a>' ) . '</p>' .\n\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n\t);\n\n\t$title       = __( 'Media Library' );\n\t$parent_file = 'upload.php';\n\n\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t?>\n\t<div class=\"wrap\" id=\"wp-media-grid\" data-search=\"<?php _admin_search_query(); ?>\">\n\t\t<h1 class=\"wp-heading-inline\"><?php echo esc_html( $title ); ?></h1>\n\n\t\t<?php\n\t\tif ( current_user_can( 'upload_files' ) ) {\n\t\t\t?>\n\t\t\t<a href=\"<?php echo admin_url( 'media-new.php' ); ?>\" class=\"page-title-action aria-button-if-js\"><?php echo esc_html_x( 'Add New', 'file' ); ?></a>\n\t\t\t\t\t\t\t\t<?php\n\t\t}\n\t\t?>\n\n\t\t<hr class=\"wp-header-end\">\n\n\t\t<div class=\"error hide-if-js\">\n\t\t\t<p>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: List view URL. */\n\t\t\t\t__( 'The grid view for the Media Library requires JavaScript. <a href=\"%s\">Switch to the list view</a>.' ),\n\t\t\t\t'upload.php?mode=list'\n\t\t\t);\n\t\t\t?>\n\t\t\t</p>\n\t\t</div>\n\t</div>\n\t<?php\n\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\texit;\n}\n\n$wp_list_table = _get_list_table( 'WP_Media_List_Table' );\n$pagenum       = $wp_list_table->get_pagenum();\n\n// Handle bulk actions.\n$doaction = $wp_list_table->current_action();\n\nif ( $doaction ) {\n\tcheck_admin_referer( 'bulk-media' );\n\n\tif ( 'delete_all' === $doaction ) {\n\t\t$post_ids = $wpdb->get_col( \"SELECT ID FROM $wpdb->posts WHERE post_type='attachment' AND post_status = 'trash'\" );\n\t\t$doaction = 'delete';\n\t} elseif ( isset( $_REQUEST['media'] ) ) {\n\t\t$post_ids = $_REQUEST['media'];\n\t} elseif ( isset( $_REQUEST['ids'] ) ) {\n\t\t$post_ids = explode( ',', $_REQUEST['ids'] );\n\t}\n\n\t$location = 'upload.php';\n\t$referer  = wp_get_referer();\n\tif ( $referer ) {\n\t\tif ( false !== strpos( $referer, 'upload.php' ) ) {\n\t\t\t$location = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'message', 'ids', 'posted' ), $referer );\n\t\t}\n\t}\n\n\tswitch ( $doaction ) {\n\t\tcase 'detach':\n\t\t\twp_media_attach_action( $_REQUEST['parent_post_id'], 'detach' );\n\t\t\tbreak;\n\n\t\tcase 'attach':\n\t\t\twp_media_attach_action( $_REQUEST['found_post_id'] );\n\t\t\tbreak;\n\n\t\tcase 'trash':\n\t\t\tif ( ! isset( $post_ids ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tforeach ( (array) $post_ids as $post_id ) {\n\t\t\t\tif ( ! current_user_can( 'delete_post', $post_id ) ) {\n\t\t\t\t\twp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) );\n\t\t\t\t}\n\n\t\t\t\tif ( ! wp_trash_post( $post_id ) ) {\n\t\t\t\t\twp_die( __( 'Error in moving the item to Trash.' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$location = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'trashed' => count( $post_ids ),\n\t\t\t\t\t'ids'     => join( ',', $post_ids ),\n\t\t\t\t),\n\t\t\t\t$location\n\t\t\t);\n\t\t\tbreak;\n\t\tcase 'untrash':\n\t\t\tif ( ! isset( $post_ids ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tforeach ( (array) $post_ids as $post_id ) {\n\t\t\t\tif ( ! current_user_can( 'delete_post', $post_id ) ) {\n\t\t\t\t\twp_die( __( 'Sorry, you are not allowed to restore this item from the Trash.' ) );\n\t\t\t\t}\n\n\t\t\t\tif ( ! wp_untrash_post( $post_id ) ) {\n\t\t\t\t\twp_die( __( 'Error in restoring the item from Trash.' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$location = add_query_arg( 'untrashed', count( $post_ids ), $location );\n\t\t\tbreak;\n\t\tcase 'delete':\n\t\t\tif ( ! isset( $post_ids ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tforeach ( (array) $post_ids as $post_id_del ) {\n\t\t\t\tif ( ! current_user_can( 'delete_post', $post_id_del ) ) {\n\t\t\t\t\twp_die( __( 'Sorry, you are not allowed to delete this item.' ) );\n\t\t\t\t}\n\n\t\t\t\tif ( ! wp_delete_attachment( $post_id_del ) ) {\n\t\t\t\t\twp_die( __( 'Error in deleting the attachment.' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$location = add_query_arg( 'deleted', count( $post_ids ), $location );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$screen = get_current_screen()->id;\n\n\t\t\t/** This action is documented in wp-admin/edit.php */\n\t\t\t$location = apply_filters( \"handle_bulk_actions-{$screen}\", $location, $doaction, $post_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t}\n\n\twp_redirect( $location );\n\texit;\n} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {\n\twp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );\n\texit;\n}\n\n$wp_list_table->prepare_items();\n\n$title       = __( 'Media Library' );\n$parent_file = 'upload.php';\n\nwp_enqueue_script( 'media' );\n\nadd_screen_option( 'per_page' );\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t\t'<p>' . __( 'All the files you&#8217;ve uploaded are listed in the Media Library, with the most recent uploads listed first. You can use the Screen Options tab to customize the display of this screen.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'You can narrow the list by file type/status or by date using the dropdown menus above the media table.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'You can view your media in a simple visual grid or a list with columns. Switch between these views using the icons to the left above the media.' ) . '</p>',\n\t)\n);\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'actions-links',\n\t\t'title'   => __( 'Available Actions' ),\n\t\t'content' =>\n\t\t\t\t'<p>' . __( 'Hovering over a row reveals action links: Edit, Delete Permanently, and View. Clicking Edit or on the media file&#8217;s name displays a simple screen to edit that individual file&#8217;s metadata. Clicking Delete Permanently will delete the file from the media library (as well as from any posts to which it is currently attached). View will take you to the display page for that file.' ) . '</p>',\n\t)\n);\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'attaching-files',\n\t\t'title'   => __( 'Attaching Files' ),\n\t\t'content' =>\n\t\t\t\t'<p>' . __( 'If a media file has not been attached to any content, you will see that in the Uploaded To column, and can click on Attach to launch a small popup that will allow you to search for existing content and attach the file.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/media-library-screen/\">Documentation on Media Library</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nget_current_screen()->set_screen_reader_content(\n\tarray(\n\t\t'heading_views'      => __( 'Filter media items list' ),\n\t\t'heading_pagination' => __( 'Media items list navigation' ),\n\t\t'heading_list'       => __( 'Media items list' ),\n\t)\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n\n<div class=\"wrap\">\n<h1 class=\"wp-heading-inline\"><?php echo esc_html( $title ); ?></h1>\n\n<?php\nif ( current_user_can( 'upload_files' ) ) {\n\t?>\n\t<a href=\"<?php echo admin_url( 'media-new.php' ); ?>\" class=\"page-title-action\"><?php echo esc_html_x( 'Add New', 'file' ); ?></a>\n\t\t\t\t\t\t<?php\n}\n\nif ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {\n\t/* translators: %s: Search query. */\n\tprintf( '<span class=\"subtitle\">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', get_search_query() );\n}\n?>\n\n<hr class=\"wp-header-end\">\n\n<?php\n$message = '';\nif ( ! empty( $_GET['posted'] ) ) {\n\t$message                = __( 'Media file updated.' );\n\t$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'posted' ), $_SERVER['REQUEST_URI'] );\n}\n\nif ( ! empty( $_GET['attached'] ) && absint( $_GET['attached'] ) ) {\n\t$attached = absint( $_GET['attached'] );\n\tif ( 1 == $attached ) {\n\t\t$message = __( 'Media file attached.' );\n\t} else {\n\t\t/* translators: %s: Number of media files. */\n\t\t$message = _n( '%s media file attached.', '%s media files attached.', $attached );\n\t}\n\t$message                = sprintf( $message, number_format_i18n( $attached ) );\n\t$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'detach', 'attached' ), $_SERVER['REQUEST_URI'] );\n}\n\nif ( ! empty( $_GET['detach'] ) && absint( $_GET['detach'] ) ) {\n\t$detached = absint( $_GET['detach'] );\n\tif ( 1 == $detached ) {\n\t\t$message = __( 'Media file detached.' );\n\t} else {\n\t\t/* translators: %s: Number of media files. */\n\t\t$message = _n( '%s media file detached.', '%s media files detached.', $detached );\n\t}\n\t$message                = sprintf( $message, number_format_i18n( $detached ) );\n\t$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'detach', 'attached' ), $_SERVER['REQUEST_URI'] );\n}\n\nif ( ! empty( $_GET['deleted'] ) && absint( $_GET['deleted'] ) ) {\n\t$deleted = absint( $_GET['deleted'] );\n\tif ( 1 == $deleted ) {\n\t\t$message = __( 'Media file permanently deleted.' );\n\t} else {\n\t\t/* translators: %s: Number of media files. */\n\t\t$message = _n( '%s media file permanently deleted.', '%s media files permanently deleted.', $deleted );\n\t}\n\t$message                = sprintf( $message, number_format_i18n( $deleted ) );\n\t$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'deleted' ), $_SERVER['REQUEST_URI'] );\n}\n\nif ( ! empty( $_GET['trashed'] ) && absint( $_GET['trashed'] ) ) {\n\t$trashed = absint( $_GET['trashed'] );\n\tif ( 1 == $trashed ) {\n\t\t$message = __( 'Media file moved to the Trash.' );\n\t} else {\n\t\t/* translators: %s: Number of media files. */\n\t\t$message = _n( '%s media file moved to the Trash.', '%s media files moved to the Trash.', $trashed );\n\t}\n\t$message                = sprintf( $message, number_format_i18n( $trashed ) );\n\t$message               .= ' <a href=\"' . esc_url( wp_nonce_url( 'upload.php?doaction=undo&action=untrash&ids=' . ( isset( $_GET['ids'] ) ? $_GET['ids'] : '' ), 'bulk-media' ) ) . '\">' . __( 'Undo' ) . '</a>';\n\t$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'trashed' ), $_SERVER['REQUEST_URI'] );\n}\n\nif ( ! empty( $_GET['untrashed'] ) && absint( $_GET['untrashed'] ) ) {\n\t$untrashed = absint( $_GET['untrashed'] );\n\tif ( 1 == $untrashed ) {\n\t\t$message = __( 'Media file restored from the Trash.' );\n\t} else {\n\t\t/* translators: %s: Number of media files. */\n\t\t$message = _n( '%s media file restored from the Trash.', '%s media files restored from the Trash.', $untrashed );\n\t}\n\t$message                = sprintf( $message, number_format_i18n( $untrashed ) );\n\t$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'untrashed' ), $_SERVER['REQUEST_URI'] );\n}\n\n$messages[1] = __( 'Media file updated.' );\n$messages[2] = __( 'Media file permanently deleted.' );\n$messages[3] = __( 'Error saving media file.' );\n$messages[4] = __( 'Media file moved to the Trash.' ) . ' <a href=\"' . esc_url( wp_nonce_url( 'upload.php?doaction=undo&action=untrash&ids=' . ( isset( $_GET['ids'] ) ? $_GET['ids'] : '' ), 'bulk-media' ) ) . '\">' . __( 'Undo' ) . '</a>';\n$messages[5] = __( 'Media file restored from the Trash.' );\n\nif ( ! empty( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) {\n\t$message                = $messages[ $_GET['message'] ];\n\t$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'message' ), $_SERVER['REQUEST_URI'] );\n}\n\nif ( ! empty( $message ) ) {\n\t?>\n<div id=\"message\" class=\"updated notice is-dismissible\"><p><?php echo $message; ?></p></div>\n<?php } ?>\n\n<form id=\"posts-filter\" method=\"get\">\n\n<?php $wp_list_table->views(); ?>\n\n<?php $wp_list_table->display(); ?>\n\n<div id=\"ajax-response\"></div>\n<?php find_posts_div(); ?>\n</form>\n</div>\n\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 382}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit user administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nwp_reset_vars( array( 'action', 'user_id', 'wp_http_referer' ) );\n\n$user_id      = (int) $user_id;\n$current_user = wp_get_current_user();\nif ( ! defined( 'IS_PROFILE_PAGE' ) ) {\n\tdefine( 'IS_PROFILE_PAGE', ( $user_id == $current_user->ID ) );\n}\n\nif ( ! $user_id && IS_PROFILE_PAGE ) {\n\t$user_id = $current_user->ID;\n} elseif ( ! $user_id && ! IS_PROFILE_PAGE ) {\n\twp_die( __( 'Invalid user ID.' ) );\n} elseif ( ! get_userdata( $user_id ) ) {\n\twp_die( __( 'Invalid user ID.' ) );\n}\n\nwp_enqueue_script( 'user-profile' );\n\nif ( IS_PROFILE_PAGE ) {\n\t$title = __( 'Profile' );\n} else {\n\t/* translators: %s: User's display name. */\n\t$title = __( 'Edit User %s' );\n}\n\nif ( current_user_can( 'edit_users' ) && ! IS_PROFILE_PAGE ) {\n\t$submenu_file = 'users.php';\n} else {\n\t$submenu_file = 'profile.php';\n}\n\nif ( current_user_can( 'edit_users' ) && ! is_user_admin() ) {\n\t$parent_file = 'users.php';\n} else {\n\t$parent_file = 'profile.php';\n}\n\n$profile_help = '<p>' . __( 'Your profile contains information about you (your &#8220;account&#8221;) as well as some personal options related to using WordPress.' ) . '</p>' .\n\t'<p>' . __( 'You can change your password, turn on keyboard shortcuts, change the color scheme of your WordPress administration screens, and turn off the WYSIWYG (Visual) editor, among other things. You can hide the Toolbar (formerly called the Admin Bar) from the front end of your site, however it cannot be disabled on the admin screens.' ) . '</p>' .\n\t'<p>' . __( 'You can select the language you wish to use while using the WordPress administration screen without affecting the language site visitors see.' ) . '</p>' .\n\t'<p>' . __( 'Your username cannot be changed, but you can use other fields to enter your real name or a nickname, and change which name to display on your posts.' ) . '</p>' .\n\t'<p>' . __( 'You can log out of other devices, such as your phone or a public computer, by clicking the Log Out Everywhere Else button.' ) . '</p>' .\n\t'<p>' . __( 'Required fields are indicated; the rest are optional. Profile information will only be displayed if your theme is set up to do so.' ) . '</p>' .\n\t'<p>' . __( 'Remember to click the Update Profile button when you are finished.' ) . '</p>';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' => $profile_help,\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/users-your-profile-screen/\">Documentation on User Profiles</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\n$wp_http_referer = remove_query_arg( array( 'update', 'delete_count', 'user_id' ), $wp_http_referer );\n\n$user_can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' );\n\n/**\n * Filters whether to allow administrators on Multisite to edit every user.\n *\n * Enabling the user editing form via this filter also hinges on the user holding\n * the 'manage_network_users' cap, and the logged-in user not matching the user\n * profile open for editing.\n *\n * The filter was introduced to replace the EDIT_ANY_USER constant.\n *\n * @since 3.0.0\n *\n * @param bool $allow Whether to allow editing of any user. Default true.\n */\nif ( is_multisite()\n\t&& ! current_user_can( 'manage_network_users' )\n\t&& $user_id != $current_user->ID\n\t&& ! apply_filters( 'enable_edit_any_user_configuration', true )\n) {\n\twp_die( __( 'Sorry, you are not allowed to edit this user.' ) );\n}\n\n// Execute confirmed email change. See send_confirmation_on_profile_email().\nif ( IS_PROFILE_PAGE && isset( $_GET['newuseremail'] ) && $current_user->ID ) {\n\t$new_email = get_user_meta( $current_user->ID, '_new_email', true );\n\tif ( $new_email && hash_equals( $new_email['hash'], $_GET['newuseremail'] ) ) {\n\t\t$user             = new stdClass;\n\t\t$user->ID         = $current_user->ID;\n\t\t$user->user_email = esc_html( trim( $new_email['newemail'] ) );\n\t\tif ( is_multisite() && $wpdb->get_var( $wpdb->prepare( \"SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s\", $current_user->user_login ) ) ) {\n\t\t\t$wpdb->query( $wpdb->prepare( \"UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s\", $user->user_email, $current_user->user_login ) );\n\t\t}\n\t\twp_update_user( $user );\n\t\tdelete_user_meta( $current_user->ID, '_new_email' );\n\t\twp_redirect( add_query_arg( array( 'updated' => 'true' ), self_admin_url( 'profile.php' ) ) );\n\t\tdie();\n\t} else {\n\t\twp_redirect( add_query_arg( array( 'error' => 'new-email' ), self_admin_url( 'profile.php' ) ) );\n\t}\n} elseif ( IS_PROFILE_PAGE && ! empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' === $_GET['dismiss'] ) {\n\tcheck_admin_referer( 'dismiss-' . $current_user->ID . '_new_email' );\n\tdelete_user_meta( $current_user->ID, '_new_email' );\n\twp_redirect( add_query_arg( array( 'updated' => 'true' ), self_admin_url( 'profile.php' ) ) );\n\tdie();\n}\n\nswitch ( $action ) {\n\tcase 'update':\n\t\tcheck_admin_referer( 'update-user_' . $user_id );\n\n\t\tif ( ! current_user_can( 'edit_user', $user_id ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to edit this user.' ) );\n\t\t}\n\n\t\tif ( IS_PROFILE_PAGE ) {\n\t\t\t/**\n\t\t\t * Fires before the page loads on the 'Profile' editing screen.\n\t\t\t *\n\t\t\t * The action only fires if the current user is editing their own profile.\n\t\t\t *\n\t\t\t * @since 2.0.0\n\t\t\t *\n\t\t\t * @param int $user_id The user ID.\n\t\t\t */\n\t\t\tdo_action( 'personal_options_update', $user_id );\n\t\t} else {\n\t\t\t/**\n\t\t\t * Fires before the page loads on the 'Edit User' screen.\n\t\t\t *\n\t\t\t * @since 2.7.0\n\t\t\t *\n\t\t\t * @param int $user_id The user ID.\n\t\t\t */\n\t\t\tdo_action( 'edit_user_profile_update', $user_id );\n\t\t}\n\n\t\t// Update the email address in signups, if present.\n\t\tif ( is_multisite() ) {\n\t\t\t$user = get_userdata( $user_id );\n\n\t\t\tif ( $user->user_login && isset( $_POST['email'] ) && is_email( $_POST['email'] ) && $wpdb->get_var( $wpdb->prepare( \"SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s\", $user->user_login ) ) ) {\n\t\t\t\t$wpdb->query( $wpdb->prepare( \"UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s\", $_POST['email'], $user_login ) );\n\t\t\t}\n\t\t}\n\n\t\t// Update the user.\n\t\t$errors = edit_user( $user_id );\n\n\t\t// Grant or revoke super admin status if requested.\n\t\tif ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && ! isset( $super_admins ) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) ) {\n\t\t\tempty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id );\n\t\t}\n\n\t\tif ( ! is_wp_error( $errors ) ) {\n\t\t\t$redirect = add_query_arg( 'updated', true, get_edit_user_link( $user_id ) );\n\t\t\tif ( $wp_http_referer ) {\n\t\t\t\t$redirect = add_query_arg( 'wp_http_referer', urlencode( $wp_http_referer ), $redirect );\n\t\t\t}\n\t\t\twp_redirect( $redirect );\n\t\t\texit;\n\t\t}\n\n\t\t// Intentional fall-through to display $errors.\n\tdefault:\n\t\t$profileuser = get_user_to_edit( $user_id );\n\n\t\tif ( ! current_user_can( 'edit_user', $user_id ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to edit this user.' ) );\n\t\t}\n\n\t\t$title    = sprintf( $title, $profileuser->display_name );\n\t\t$sessions = WP_Session_Tokens::get_instance( $profileuser->ID );\n\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t\t?>\n\n\t\t<?php if ( ! IS_PROFILE_PAGE && is_super_admin( $profileuser->ID ) && current_user_can( 'manage_network_options' ) ) { ?>\n\t<div class=\"notice notice-info\"><p><strong><?php _e( 'Important:' ); ?></strong> <?php _e( 'This user has super admin privileges.' ); ?></p></div>\n<?php } ?>\n\t\t<?php if ( isset( $_GET['updated'] ) ) : ?>\n<div id=\"message\" class=\"updated notice is-dismissible\">\n\t\t\t<?php if ( IS_PROFILE_PAGE ) : ?>\n\t<p><strong><?php _e( 'Profile updated.' ); ?></strong></p>\n\t<?php else : ?>\n\t<p><strong><?php _e( 'User updated.' ); ?></strong></p>\n\t<?php endif; ?>\n\t\t\t<?php if ( $wp_http_referer && false === strpos( $wp_http_referer, 'user-new.php' ) && ! IS_PROFILE_PAGE ) : ?>\n\t<p><a href=\"<?php echo esc_url( wp_validate_redirect( esc_url_raw( $wp_http_referer ), self_admin_url( 'users.php' ) ) ); ?>\"><?php _e( '&larr; Back to Users' ); ?></a></p>\n\t<?php endif; ?>\n</div>\n\t\t<?php endif; ?>\n\t\t<?php if ( isset( $_GET['error'] ) ) : ?>\n<div class=\"notice notice-error\">\n\t\t\t<?php if ( 'new-email' === $_GET['error'] ) : ?>\n\t<p><?php _e( 'Error while saving the new email address. Please try again.' ); ?></p>\n\t<?php endif; ?>\n</div>\n\t\t<?php endif; ?>\n\t\t<?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?>\n<div class=\"error\"><p><?php echo implode( \"</p>\\n<p>\", $errors->get_error_messages() ); ?></p></div>\n\t\t<?php endif; ?>\n\n<div class=\"wrap\" id=\"profile-page\">\n<h1 class=\"wp-heading-inline\">\n\t\t<?php\n\t\techo esc_html( $title );\n\t\t?>\n</h1>\n\n\t\t<?php\n\t\tif ( ! IS_PROFILE_PAGE ) {\n\t\t\tif ( current_user_can( 'create_users' ) ) {\n\t\t\t\t?>\n\t\t<a href=\"user-new.php\" class=\"page-title-action\"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>\n\t<?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>\n\t\t<a href=\"user-new.php\" class=\"page-title-action\"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>\n\t\t\t\t<?php\n\t}\n\t\t}\n\t\t?>\n\n<hr class=\"wp-header-end\">\n\n<form id=\"your-profile\" action=\"<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>\" method=\"post\" novalidate=\"novalidate\"\n\t\t<?php\n\t\t/**\n\t\t * Fires inside the your-profile form tag on the user editing screen.\n\t\t *\n\t\t * @since 3.0.0\n\t\t */\n\t\tdo_action( 'user_edit_form_tag' );\n\t\t?>\n\t>\n\t\t<?php wp_nonce_field( 'update-user_' . $user_id ); ?>\n\t\t<?php if ( $wp_http_referer ) : ?>\n\t<input type=\"hidden\" name=\"wp_http_referer\" value=\"<?php echo esc_url( $wp_http_referer ); ?>\" />\n\t\t<?php endif; ?>\n<p>\n<input type=\"hidden\" name=\"from\" value=\"profile\" />\n<input type=\"hidden\" name=\"checkuser_id\" value=\"<?php echo get_current_user_id(); ?>\" />\n</p>\n\n<h2><?php _e( 'Personal Options' ); ?></h2>\n\n<table class=\"form-table\" role=\"presentation\">\n\t\t<?php if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) : ?>\n\t<tr class=\"user-rich-editing-wrap\">\n\t\t<th scope=\"row\"><?php _e( 'Visual Editor' ); ?></th>\n\t\t<td>\n\t\t\t<label for=\"rich_editing\"><input name=\"rich_editing\" type=\"checkbox\" id=\"rich_editing\" value=\"false\" <?php checked( 'false', $profileuser->rich_editing ); ?> />\n\t\t\t\t<?php _e( 'Disable the visual editor when writing' ); ?>\n\t\t\t</label>\n\t\t</td>\n\t</tr>\n\t\t<?php endif; ?>\n\t\t<?php\n\t\t$show_syntax_highlighting_preference = (\n\t\t// For Custom HTML widget and Additional CSS in Customizer.\n\t\tuser_can( $profileuser, 'edit_theme_options' )\n\t\t||\n\t\t// Edit plugins.\n\t\tuser_can( $profileuser, 'edit_plugins' )\n\t\t||\n\t\t// Edit themes.\n\t\tuser_can( $profileuser, 'edit_themes' )\n\t\t);\n\t\t?>\n\n\t\t<?php if ( $show_syntax_highlighting_preference ) : ?>\n\t<tr class=\"user-syntax-highlighting-wrap\">\n\t\t<th scope=\"row\"><?php _e( 'Syntax Highlighting' ); ?></th>\n\t\t<td>\n\t\t\t<label for=\"syntax_highlighting\"><input name=\"syntax_highlighting\" type=\"checkbox\" id=\"syntax_highlighting\" value=\"false\" <?php checked( 'false', $profileuser->syntax_highlighting ); ?> />\n\t\t\t\t<?php _e( 'Disable syntax highlighting when editing code' ); ?>\n\t\t\t</label>\n\t\t</td>\n\t</tr>\n\t\t<?php endif; ?>\n\n\t\t<?php if ( count( $_wp_admin_css_colors ) > 1 && has_action( 'admin_color_scheme_picker' ) ) : ?>\n\t<tr class=\"user-admin-color-wrap\">\n\t\t<th scope=\"row\"><?php _e( 'Admin Color Scheme' ); ?></th>\n\t\t<td>\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * Fires in the 'Admin Color Scheme' section of the user editing screen.\n\t\t\t *\n\t\t\t * The section is only enabled if a callback is hooked to the action,\n\t\t\t * and if there is more than one defined color scheme for the admin.\n\t\t\t *\n\t\t\t * @since 3.0.0\n\t\t\t * @since 3.8.1 Added `$user_id` parameter.\n\t\t\t *\n\t\t\t * @param int $user_id The user ID.\n\t\t\t */\n\t\t\tdo_action( 'admin_color_scheme_picker', $user_id );\n\t\t\t?>\n\t\t</td>\n\t</tr>\n\t\t<?php endif; // End if count ( $_wp_admin_css_colors ) > 1 ?>\n\n\t\t<?php if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) : ?>\n\t<tr class=\"user-comment-shortcuts-wrap\">\n\t\t<th scope=\"row\"><?php _e( 'Keyboard Shortcuts' ); ?></th>\n\t\t<td>\n\t\t\t<label for=\"comment_shortcuts\">\n\t\t\t\t<input type=\"checkbox\" name=\"comment_shortcuts\" id=\"comment_shortcuts\" value=\"true\" <?php checked( 'true', $profileuser->comment_shortcuts ); ?> />\n\t\t\t\t<?php _e( 'Enable keyboard shortcuts for comment moderation.' ); ?>\n\t\t\t</label>\n\t\t\t<?php _e( '<a href=\"https://wordpress.org/support/article/keyboard-shortcuts/\" target=\"_blank\">More information</a>' ); ?>\n\t\t</td>\n\t</tr>\n\t\t<?php endif; ?>\n\n\t<tr class=\"show-admin-bar user-admin-bar-front-wrap\">\n\t\t<th scope=\"row\"><?php _e( 'Toolbar' ); ?></th>\n\t\t<td>\n\t\t\t<label for=\"admin_bar_front\">\n\t\t\t\t<input name=\"admin_bar_front\" type=\"checkbox\" id=\"admin_bar_front\" value=\"1\"<?php checked( _get_admin_bar_pref( 'front', $profileuser->ID ) ); ?> />\n\t\t\t\t<?php _e( 'Show Toolbar when viewing site' ); ?>\n\t\t\t</label><br />\n\t\t</td>\n\t</tr>\n\n\t\t<?php\n\t\t$languages = get_available_languages();\n\t\tif ( $languages ) :\n\t\t\t?>\n\t<tr class=\"user-language-wrap\">\n\t\t<th scope=\"row\">\n\t\t\t<?php /* translators: The user language selection field label. */ ?>\n\t\t\t<label for=\"locale\"><?php _e( 'Language' ); ?><span class=\"dashicons dashicons-translation\" aria-hidden=\"true\"></span></label>\n\t\t</th>\n\t\t<td>\n\t\t\t<?php\n\t\t\t\t$user_locale = $profileuser->locale;\n\n\t\t\tif ( 'en_US' === $user_locale ) {\n\t\t\t\t$user_locale = '';\n\t\t\t} elseif ( '' === $user_locale || ! in_array( $user_locale, $languages, true ) ) {\n\t\t\t\t$user_locale = 'site-default';\n\t\t\t}\n\n\t\t\twp_dropdown_languages(\n\t\t\t\tarray(\n\t\t\t\t\t'name'                        => 'locale',\n\t\t\t\t\t'id'                          => 'locale',\n\t\t\t\t\t'selected'                    => $user_locale,\n\t\t\t\t\t'languages'                   => $languages,\n\t\t\t\t\t'show_available_translations' => false,\n\t\t\t\t\t'show_option_site_default'    => true,\n\t\t\t\t)\n\t\t\t);\n\t\t\t?>\n\t\t</td>\n\t</tr>\n\t\t\t<?php\nendif;\n\t\t?>\n\n\t\t<?php\n\t\t/**\n\t\t * Fires at the end of the 'Personal Options' settings table on the user editing screen.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param WP_User $profileuser The current WP_User object.\n\t\t */\n\t\tdo_action( 'personal_options', $profileuser );\n\t\t?>\n\n</table>\n\t\t<?php\n\t\tif ( IS_PROFILE_PAGE ) {\n\t\t\t/**\n\t\t\t * Fires after the 'Personal Options' settings table on the 'Profile' editing screen.\n\t\t\t *\n\t\t\t * The action only fires if the current user is editing their own profile.\n\t\t\t *\n\t\t\t * @since 2.0.0\n\t\t\t *\n\t\t\t * @param WP_User $profileuser The current WP_User object.\n\t\t\t */\n\t\t\tdo_action( 'profile_personal_options', $profileuser );\n\t\t}\n\t\t?>\n\n<h2><?php _e( 'Name' ); ?></h2>\n\n<table class=\"form-table\" role=\"presentation\">\n\t<tr class=\"user-user-login-wrap\">\n\t\t<th><label for=\"user_login\"><?php _e( 'Username' ); ?></label></th>\n\t\t<td><input type=\"text\" name=\"user_login\" id=\"user_login\" value=\"<?php echo esc_attr( $profileuser->user_login ); ?>\" disabled=\"disabled\" class=\"regular-text\" /> <span class=\"description\"><?php _e( 'Usernames cannot be changed.' ); ?></span></td>\n\t</tr>\n\n\t\t<?php if ( ! IS_PROFILE_PAGE && ! is_network_admin() && current_user_can( 'promote_user', $profileuser->ID ) ) : ?>\n<tr class=\"user-role-wrap\"><th><label for=\"role\"><?php _e( 'Role' ); ?></label></th>\n<td><select name=\"role\" id=\"role\">\n\t\t\t<?php\n\t\t\t// Compare user role against currently editable roles.\n\t\t\t$user_roles = array_intersect( array_values( $profileuser->roles ), array_keys( get_editable_roles() ) );\n\t\t\t$user_role  = reset( $user_roles );\n\n\t\t\t// Print the full list of roles with the primary one selected.\n\t\t\twp_dropdown_roles( $user_role );\n\n\t\t\t// Print the 'no role' option. Make it selected if the user has no role yet.\n\t\t\tif ( $user_role ) {\n\t\t\t\techo '<option value=\"\">' . __( '&mdash; No role for this site &mdash;' ) . '</option>';\n\t\t\t} else {\n\t\t\t\techo '<option value=\"\" selected=\"selected\">' . __( '&mdash; No role for this site &mdash;' ) . '</option>';\n\t\t\t}\n\t\t\t?>\n</select></td></tr>\n\t\t\t<?php\n\t\tendif; // End if ! IS_PROFILE_PAGE.\n\n\t\tif ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && ! isset( $super_admins ) ) {\n\t\t\t?>\n<tr class=\"user-super-admin-wrap\"><th><?php _e( 'Super Admin' ); ?></th>\n<td>\n\t\t\t<?php if ( 0 !== strcasecmp( $profileuser->user_email, get_site_option( 'admin_email' ) ) || ! is_super_admin( $profileuser->ID ) ) : ?>\n<p><label><input type=\"checkbox\" id=\"super_admin\" name=\"super_admin\"<?php checked( is_super_admin( $profileuser->ID ) ); ?> /> <?php _e( 'Grant this user super admin privileges for the Network.' ); ?></label></p>\n<?php else : ?>\n<p><?php _e( 'Super admin privileges cannot be removed because this user has the network admin email.' ); ?></p>\n<?php endif; ?>\n</td></tr>\n\t\t<?php } ?>\n\n<tr class=\"user-first-name-wrap\">\n\t<th><label for=\"first_name\"><?php _e( 'First Name' ); ?></label></th>\n\t<td><input type=\"text\" name=\"first_name\" id=\"first_name\" value=\"<?php echo esc_attr( $profileuser->first_name ); ?>\" class=\"regular-text\" /></td>\n</tr>\n\n<tr class=\"user-last-name-wrap\">\n\t<th><label for=\"last_name\"><?php _e( 'Last Name' ); ?></label></th>\n\t<td><input type=\"text\" name=\"last_name\" id=\"last_name\" value=\"<?php echo esc_attr( $profileuser->last_name ); ?>\" class=\"regular-text\" /></td>\n</tr>\n\n<tr class=\"user-nickname-wrap\">\n\t<th><label for=\"nickname\"><?php _e( 'Nickname' ); ?> <span class=\"description\"><?php _e( '(required)' ); ?></span></label></th>\n\t<td><input type=\"text\" name=\"nickname\" id=\"nickname\" value=\"<?php echo esc_attr( $profileuser->nickname ); ?>\" class=\"regular-text\" /></td>\n</tr>\n\n<tr class=\"user-display-name-wrap\">\n\t<th><label for=\"display_name\"><?php _e( 'Display name publicly as' ); ?></label></th>\n\t<td>\n\t\t<select name=\"display_name\" id=\"display_name\">\n\t\t<?php\n\t\t\t$public_display                     = array();\n\t\t\t$public_display['display_nickname'] = $profileuser->nickname;\n\t\t\t$public_display['display_username'] = $profileuser->user_login;\n\n\t\tif ( ! empty( $profileuser->first_name ) ) {\n\t\t\t$public_display['display_firstname'] = $profileuser->first_name;\n\t\t}\n\n\t\tif ( ! empty( $profileuser->last_name ) ) {\n\t\t\t$public_display['display_lastname'] = $profileuser->last_name;\n\t\t}\n\n\t\tif ( ! empty( $profileuser->first_name ) && ! empty( $profileuser->last_name ) ) {\n\t\t\t$public_display['display_firstlast'] = $profileuser->first_name . ' ' . $profileuser->last_name;\n\t\t\t$public_display['display_lastfirst'] = $profileuser->last_name . ' ' . $profileuser->first_name;\n\t\t}\n\n\t\tif ( ! in_array( $profileuser->display_name, $public_display, true ) ) { // Only add this if it isn't duplicated elsewhere.\n\t\t\t$public_display = array( 'display_displayname' => $profileuser->display_name ) + $public_display;\n\t\t}\n\n\t\t\t$public_display = array_map( 'trim', $public_display );\n\t\t\t$public_display = array_unique( $public_display );\n\n\t\tforeach ( $public_display as $id => $item ) {\n\t\t\t?>\n\t\t<option <?php selected( $profileuser->display_name, $item ); ?>><?php echo $item; ?></option>\n\t\t\t<?php\n\t\t}\n\t\t?>\n\t\t</select>\n\t\t</td>\n\t</tr>\n\t</table>\n\n\t<h2><?php _e( 'Contact Info' ); ?></h2>\n\n\t<table class=\"form-table\" role=\"presentation\">\n\t<tr class=\"user-email-wrap\">\n\t\t<th><label for=\"email\"><?php _e( 'Email' ); ?> <span class=\"description\"><?php _e( '(required)' ); ?></span></label></th>\n\t\t<td><input type=\"email\" name=\"email\" id=\"email\" aria-describedby=\"email-description\" value=\"<?php echo esc_attr( $profileuser->user_email ); ?>\" class=\"regular-text ltr\" />\n\t\t<?php\n\t\tif ( $profileuser->ID == $current_user->ID ) :\n\t\t\t?>\n\t\t<p class=\"description\" id=\"email-description\">\n\t\t\t<?php _e( 'If you change this, we will send you an email at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?>\n\t\t</p>\n\t\t\t<?php\n\t\tendif;\n\n\t\t$new_email = get_user_meta( $current_user->ID, '_new_email', true );\n\t\tif ( $new_email && $new_email['newemail'] != $current_user->user_email && $profileuser->ID == $current_user->ID ) :\n\t\t\t?>\n\t\t<div class=\"updated inline\">\n\t\t<p>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: New email. */\n\t\t\t\t__( 'There is a pending change of your email to %s.' ),\n\t\t\t\t'<code>' . esc_html( $new_email['newemail'] ) . '</code>'\n\t\t\t);\n\t\t\tprintf(\n\t\t\t\t' <a href=\"%1$s\">%2$s</a>',\n\t\t\t\tesc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ),\n\t\t\t\t__( 'Cancel' )\n\t\t\t);\n\t\t\t?>\n\t\t</p>\n\t\t</div>\n\t\t<?php endif; ?>\n\t</td>\n\t</tr>\n\n\t<tr class=\"user-url-wrap\">\n\t<th><label for=\"url\"><?php _e( 'Website' ); ?></label></th>\n\t<td><input type=\"url\" name=\"url\" id=\"url\" value=\"<?php echo esc_attr( $profileuser->user_url ); ?>\" class=\"regular-text code\" /></td>\n\t</tr>\n\n\t\t<?php\n\t\tforeach ( wp_get_user_contact_methods( $profileuser ) as $name => $desc ) {\n\t\t\t?>\n\t<tr class=\"user-<?php echo $name; ?>-wrap\">\n<th><label for=\"<?php echo $name; ?>\">\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * Filters a user contactmethod label.\n\t\t\t *\n\t\t\t * The dynamic portion of the filter hook, `$name`, refers to\n\t\t\t * each of the keys in the contactmethods array.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t *\n\t\t\t * @param string $desc The translatable label for the contactmethod.\n\t\t\t */\n\t\t\techo apply_filters( \"user_{$name}_label\", $desc );\n\t\t\t?>\n\t</label></th>\n\t<td><input type=\"text\" name=\"<?php echo $name; ?>\" id=\"<?php echo $name; ?>\" value=\"<?php echo esc_attr( $profileuser->$name ); ?>\" class=\"regular-text\" /></td>\n\t</tr>\n\t\t\t<?php\n\t\t}\n\t\t?>\n\t</table>\n\n\t<h2><?php IS_PROFILE_PAGE ? _e( 'About Yourself' ) : _e( 'About the user' ); ?></h2>\n\n<table class=\"form-table\" role=\"presentation\">\n<tr class=\"user-description-wrap\">\n\t<th><label for=\"description\"><?php _e( 'Biographical Info' ); ?></label></th>\n\t<td><textarea name=\"description\" id=\"description\" rows=\"5\" cols=\"30\"><?php echo $profileuser->description; // textarea_escaped ?></textarea>\n\t<p class=\"description\"><?php _e( 'Share a little biographical information to fill out your profile. This may be shown publicly.' ); ?></p></td>\n</tr>\n\n\t\t<?php if ( get_option( 'show_avatars' ) ) : ?>\n<tr class=\"user-profile-picture\">\n\t<th><?php _e( 'Profile Picture' ); ?></th>\n\t<td>\n\t\t\t<?php echo get_avatar( $user_id ); ?>\n\t\t<p class=\"description\">\n\t\t\t<?php\n\t\t\tif ( IS_PROFILE_PAGE ) {\n\t\t\t\t$description = sprintf(\n\t\t\t\t\t/* translators: %s: Gravatar URL. */\n\t\t\t\t\t__( '<a href=\"%s\">You can change your profile picture on Gravatar</a>.' ),\n\t\t\t\t\t__( 'https://en.gravatar.com/' )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$description = '';\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the user profile picture description displayed under the Gravatar.\n\t\t\t *\n\t\t\t * @since 4.4.0\n\t\t\t * @since 4.7.0 Added the `$profileuser` parameter.\n\t\t\t *\n\t\t\t * @param string  $description The description that will be printed.\n\t\t\t * @param WP_User $profileuser The current WP_User object.\n\t\t\t */\n\t\t\techo apply_filters( 'user_profile_picture_description', $description, $profileuser );\n\t\t\t?>\n\t\t</p>\n\t</td>\n</tr>\n<?php endif; ?>\n\n\t\t<?php\n\t\t/**\n\t\t * Filters the display of the password fields.\n\t\t *\n\t\t * @since 1.5.1\n\t\t * @since 2.8.0 Added the `$profileuser` parameter.\n\t\t * @since 4.4.0 Now evaluated only in user-edit.php.\n\t\t *\n\t\t * @param bool    $show        Whether to show the password fields. Default true.\n\t\t * @param WP_User $profileuser User object for the current user to edit.\n\t\t */\n\t\t$show_password_fields = apply_filters( 'show_password_fields', true, $profileuser );\n\t\tif ( $show_password_fields ) :\n\t\t\t?>\n\t</table>\n\n\t<h2><?php _e( 'Account Management' ); ?></h2>\n<table class=\"form-table\" role=\"presentation\">\n<tr id=\"password\" class=\"user-pass1-wrap\">\n\t<th><label for=\"pass1\"><?php _e( 'New Password' ); ?></label></th>\n\t<td>\n\t\t<input class=\"hidden\" value=\" \" /><!-- #24364 workaround -->\n\t\t<button type=\"button\" class=\"button wp-generate-pw hide-if-no-js\"><?php _e( 'Generate Password' ); ?></button>\n\t\t<div class=\"wp-pwd hide-if-js\">\n\t\t\t<span class=\"password-input-wrapper\">\n\t\t\t\t<input type=\"password\" name=\"pass1\" id=\"pass1\" class=\"regular-text\" value=\"\" autocomplete=\"off\" data-pw=\"<?php echo esc_attr( wp_generate_password( 24 ) ); ?>\" aria-describedby=\"pass-strength-result\" />\n\t\t\t</span>\n\t\t\t<button type=\"button\" class=\"button wp-hide-pw hide-if-no-js\" data-toggle=\"0\" aria-label=\"<?php esc_attr_e( 'Hide password' ); ?>\">\n\t\t\t\t<span class=\"dashicons dashicons-hidden\" aria-hidden=\"true\"></span>\n\t\t\t\t<span class=\"text\"><?php _e( 'Hide' ); ?></span>\n\t\t\t</button>\n\t\t\t<button type=\"button\" class=\"button wp-cancel-pw hide-if-no-js\" data-toggle=\"0\" aria-label=\"<?php esc_attr_e( 'Cancel password change' ); ?>\">\n\t\t\t\t<span class=\"dashicons dashicons-no\" aria-hidden=\"true\"></span>\n\t\t\t\t<span class=\"text\"><?php _e( 'Cancel' ); ?></span>\n\t\t\t</button>\n\t\t\t<div style=\"display:none\" id=\"pass-strength-result\" aria-live=\"polite\"></div>\n\t\t</div>\n\t</td>\n</tr>\n<tr class=\"user-pass2-wrap hide-if-js\">\n\t<th scope=\"row\"><label for=\"pass2\"><?php _e( 'Repeat New Password' ); ?></label></th>\n\t<td>\n\t<input name=\"pass2\" type=\"password\" id=\"pass2\" class=\"regular-text\" value=\"\" autocomplete=\"off\" />\n\t<p class=\"description\"><?php _e( 'Type your new password again.' ); ?></p>\n\t</td>\n</tr>\n<tr class=\"pw-weak\">\n\t<th><?php _e( 'Confirm Password' ); ?></th>\n\t<td>\n\t\t<label>\n\t\t\t<input type=\"checkbox\" name=\"pw_weak\" class=\"pw-checkbox\" />\n\t\t\t<span id=\"pw-weak-text-label\"><?php _e( 'Confirm use of potentially weak password' ); ?></span>\n\t\t</label>\n\t</td>\n</tr>\n\t<?php endif; ?>\n\n\t\t<?php\n\t\tif ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) :\n\t\t\t?>\n\t<tr class=\"user-sessions-wrap hide-if-no-js\">\n\t\t<th><?php _e( 'Sessions' ); ?></th>\n\t\t<td aria-live=\"assertive\">\n\t\t\t<div class=\"destroy-sessions\"><button type=\"button\" disabled class=\"button\"><?php _e( 'Log Out Everywhere Else' ); ?></button></div>\n\t\t\t<p class=\"description\">\n\t\t\t\t<?php _e( 'You are only logged in at this location.' ); ?>\n\t\t\t</p>\n\t\t</td>\n\t</tr>\n<?php elseif ( IS_PROFILE_PAGE && count( $sessions->get_all() ) > 1 ) : ?>\n\t<tr class=\"user-sessions-wrap hide-if-no-js\">\n\t\t<th><?php _e( 'Sessions' ); ?></th>\n\t\t<td aria-live=\"assertive\">\n\t\t\t<div class=\"destroy-sessions\"><button type=\"button\" class=\"button\" id=\"destroy-sessions\"><?php _e( 'Log Out Everywhere Else' ); ?></button></div>\n\t\t\t<p class=\"description\">\n\t\t\t\t<?php _e( 'Did you lose your phone or leave your account logged in at a public computer? You can log out everywhere else, and stay logged in here.' ); ?>\n\t\t\t</p>\n\t\t</td>\n\t</tr>\n<?php elseif ( ! IS_PROFILE_PAGE && $sessions->get_all() ) : ?>\n\t<tr class=\"user-sessions-wrap hide-if-no-js\">\n\t\t<th><?php _e( 'Sessions' ); ?></th>\n\t\t<td>\n\t\t\t<p><button type=\"button\" class=\"button\" id=\"destroy-sessions\"><?php _e( 'Log Out Everywhere' ); ?></button></p>\n\t\t\t<p class=\"description\">\n\t\t\t\t<?php\n\t\t\t\t/* translators: %s: User's display name. */\n\t\t\t\tprintf( __( 'Log %s out of all locations.' ), $profileuser->display_name );\n\t\t\t\t?>\n\t\t\t</p>\n\t\t</td>\n\t</tr>\n<?php endif; ?>\n\n\t</table>\n\n\t\t<?php\n\t\tif ( IS_PROFILE_PAGE ) {\n\t\t\t/**\n\t\t\t * Fires after the 'About Yourself' settings table on the 'Profile' editing screen.\n\t\t\t *\n\t\t\t * The action only fires if the current user is editing their own profile.\n\t\t\t *\n\t\t\t * @since 2.0.0\n\t\t\t *\n\t\t\t * @param WP_User $profileuser The current WP_User object.\n\t\t\t */\n\t\t\tdo_action( 'show_user_profile', $profileuser );\n\t\t} else {\n\t\t\t/**\n\t\t\t * Fires after the 'About the User' settings table on the 'Edit User' screen.\n\t\t\t *\n\t\t\t * @since 2.0.0\n\t\t\t *\n\t\t\t * @param WP_User $profileuser The current WP_User object.\n\t\t\t */\n\t\t\tdo_action( 'edit_user_profile', $profileuser );\n\t\t}\n\t\t?>\n\n\t\t<?php\n\t\t/**\n\t\t * Filters whether to display additional capabilities for the user.\n\t\t *\n\t\t * The 'Additional Capabilities' section will only be enabled if\n\t\t * the number of the user's capabilities exceeds their number of\n\t\t * roles.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param bool    $enable      Whether to display the capabilities. Default true.\n\t\t * @param WP_User $profileuser The current WP_User object.\n\t\t */\n\t\tif ( count( $profileuser->caps ) > count( $profileuser->roles )\n\t\t&& apply_filters( 'additional_capabilities_display', true, $profileuser )\n\t\t) :\n\t\t\t?>\n\t<h2><?php _e( 'Additional Capabilities' ); ?></h2>\n<table class=\"form-table\" role=\"presentation\">\n<tr class=\"user-capabilities-wrap\">\n\t<th scope=\"row\"><?php _e( 'Capabilities' ); ?></th>\n\t<td>\n\t\t\t<?php\n\t\t\t$output = '';\n\t\t\tforeach ( $profileuser->caps as $cap => $value ) {\n\t\t\t\tif ( ! $wp_roles->is_role( $cap ) ) {\n\t\t\t\t\tif ( '' != $output ) {\n\t\t\t\t\t\t$output .= ', ';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $value ) {\n\t\t\t\t\t\t$output .= $cap;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* translators: %s: Capability name. */\n\t\t\t\t\t\t$output .= sprintf( __( 'Denied: %s' ), $cap );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\techo $output;\n\t\t\t?>\n\t</td>\n</tr>\n</table>\n\t<?php endif; ?>\n\n<input type=\"hidden\" name=\"action\" value=\"update\" />\n<input type=\"hidden\" name=\"user_id\" id=\"user_id\" value=\"<?php echo esc_attr( $user_id ); ?>\" />\n\n\t\t<?php submit_button( IS_PROFILE_PAGE ? __( 'Update Profile' ) : __( 'Update User' ) ); ?>\n\n</form>\n</div>\n\t\t<?php\n\t\tbreak;\n}\n?>\n<script type=\"text/javascript\">\n\tif (window.location.hash == '#password') {\n\t\tdocument.getElementById('pass1').focus();\n\t}\n</script>\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 792}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * New User Administration Screen.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( is_multisite() ) {\n\tif ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) ) {\n\t\twp_die(\n\t\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t\t'<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>',\n\t\t\t403\n\t\t);\n\t}\n} elseif ( ! current_user_can( 'create_users' ) ) {\n\twp_die(\n\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t'<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>',\n\t\t403\n\t);\n}\n\nif ( is_multisite() ) {\n\tadd_filter( 'wpmu_signup_user_notification_email', 'admin_created_user_email' );\n}\n\nif ( isset( $_REQUEST['action'] ) && 'adduser' === $_REQUEST['action'] ) {\n\tcheck_admin_referer( 'add-user', '_wpnonce_add-user' );\n\n\t$user_details = null;\n\t$user_email   = wp_unslash( $_REQUEST['email'] );\n\tif ( false !== strpos( $user_email, '@' ) ) {\n\t\t$user_details = get_user_by( 'email', $user_email );\n\t} else {\n\t\tif ( current_user_can( 'manage_network_users' ) ) {\n\t\t\t$user_details = get_user_by( 'login', $user_email );\n\t\t} else {\n\t\t\twp_redirect( add_query_arg( array( 'update' => 'enter_email' ), 'user-new.php' ) );\n\t\t\tdie();\n\t\t}\n\t}\n\n\tif ( ! $user_details ) {\n\t\twp_redirect( add_query_arg( array( 'update' => 'does_not_exist' ), 'user-new.php' ) );\n\t\tdie();\n\t}\n\n\tif ( ! current_user_can( 'promote_user', $user_details->ID ) ) {\n\t\twp_die(\n\t\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t\t'<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>',\n\t\t\t403\n\t\t);\n\t}\n\n\t// Adding an existing user to this blog.\n\t$new_user_email = $user_details->user_email;\n\t$redirect       = 'user-new.php';\n\t$username       = $user_details->user_login;\n\t$user_id        = $user_details->ID;\n\tif ( null != $username && array_key_exists( $blog_id, get_blogs_of_user( $user_id ) ) ) {\n\t\t$redirect = add_query_arg( array( 'update' => 'addexisting' ), 'user-new.php' );\n\t} else {\n\t\tif ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) {\n\t\t\t$result = add_existing_user_to_blog(\n\t\t\t\tarray(\n\t\t\t\t\t'user_id' => $user_id,\n\t\t\t\t\t'role'    => $_REQUEST['role'],\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( ! is_wp_error( $result ) ) {\n\t\t\t\t$redirect = add_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'update'  => 'addnoconfirmation',\n\t\t\t\t\t\t'user_id' => $user_id,\n\t\t\t\t\t),\n\t\t\t\t\t'user-new.php'\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$redirect = add_query_arg( array( 'update' => 'could_not_add' ), 'user-new.php' );\n\t\t\t}\n\t\t} else {\n\t\t\t$newuser_key = wp_generate_password( 20, false );\n\t\t\tadd_option(\n\t\t\t\t'new_user_' . $newuser_key,\n\t\t\t\tarray(\n\t\t\t\t\t'user_id' => $user_id,\n\t\t\t\t\t'email'   => $user_details->user_email,\n\t\t\t\t\t'role'    => $_REQUEST['role'],\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$roles = get_editable_roles();\n\t\t\t$role  = $roles[ $_REQUEST['role'] ];\n\n\t\t\t/**\n\t\t\t * Fires immediately after a user is invited to join a site, but before the notification is sent.\n\t\t\t *\n\t\t\t * @since 4.4.0\n\t\t\t *\n\t\t\t * @param int    $user_id     The invited user's ID.\n\t\t\t * @param array  $role        Array containing role information for the invited user.\n\t\t\t * @param string $newuser_key The key of the invitation.\n\t\t\t */\n\t\t\tdo_action( 'invite_user', $user_id, $role, $newuser_key );\n\n\t\t\t$switched_locale = switch_to_locale( get_user_locale( $user_details ) );\n\n\t\t\t/* translators: 1: Site title, 2: Site URL, 3: User role, 4: Activation URL. */\n\t\t\t$message = __(\n\t\t\t\t'Hi,\n\nYou\\'ve been invited to join \\'%1$s\\' at\n%2$s with the role of %3$s.\n\nPlease click the following link to confirm the invite:\n%4$s'\n\t\t\t);\n\n\t\t\twp_mail(\n\t\t\t\t$new_user_email,\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: Joining confirmation notification email subject. %s: Site title. */\n\t\t\t\t\t__( '[%s] Joining Confirmation' ),\n\t\t\t\t\twp_specialchars_decode( get_option( 'blogname' ) )\n\t\t\t\t),\n\t\t\t\tsprintf(\n\t\t\t\t\t$message,\n\t\t\t\t\tget_option( 'blogname' ),\n\t\t\t\t\thome_url(),\n\t\t\t\t\twp_specialchars_decode( translate_user_role( $role['name'] ) ),\n\t\t\t\t\thome_url( \"/newbloguser/$newuser_key/\" )\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( $switched_locale ) {\n\t\t\t\trestore_previous_locale();\n\t\t\t}\n\n\t\t\t$redirect = add_query_arg( array( 'update' => 'add' ), 'user-new.php' );\n\t\t}\n\t}\n\twp_redirect( $redirect );\n\tdie();\n} elseif ( isset( $_REQUEST['action'] ) && 'createuser' === $_REQUEST['action'] ) {\n\tcheck_admin_referer( 'create-user', '_wpnonce_create-user' );\n\n\tif ( ! current_user_can( 'create_users' ) ) {\n\t\twp_die(\n\t\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t\t'<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>',\n\t\t\t403\n\t\t);\n\t}\n\n\tif ( ! is_multisite() ) {\n\t\t$user_id = edit_user();\n\n\t\tif ( is_wp_error( $user_id ) ) {\n\t\t\t$add_user_errors = $user_id;\n\t\t} else {\n\t\t\tif ( current_user_can( 'list_users' ) ) {\n\t\t\t\t$redirect = 'users.php?update=add&id=' . $user_id;\n\t\t\t} else {\n\t\t\t\t$redirect = add_query_arg( 'update', 'add', 'user-new.php' );\n\t\t\t}\n\t\t\twp_redirect( $redirect );\n\t\t\tdie();\n\t\t}\n\t} else {\n\t\t// Adding a new user to this site.\n\t\t$new_user_email = wp_unslash( $_REQUEST['email'] );\n\t\t$user_details   = wpmu_validate_user_signup( $_REQUEST['user_login'], $new_user_email );\n\t\tif ( is_wp_error( $user_details['errors'] ) && $user_details['errors']->has_errors() ) {\n\t\t\t$add_user_errors = $user_details['errors'];\n\t\t} else {\n\t\t\t/** This filter is documented in wp-includes/user.php */\n\t\t\t$new_user_login = apply_filters( 'pre_user_login', sanitize_user( wp_unslash( $_REQUEST['user_login'] ), true ) );\n\t\t\tif ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) {\n\t\t\t\tadd_filter( 'wpmu_signup_user_notification', '__return_false' );  // Disable confirmation email.\n\t\t\t\tadd_filter( 'wpmu_welcome_user_notification', '__return_false' ); // Disable welcome email.\n\t\t\t}\n\t\t\twpmu_signup_user(\n\t\t\t\t$new_user_login,\n\t\t\t\t$new_user_email,\n\t\t\t\tarray(\n\t\t\t\t\t'add_to_blog' => get_current_blog_id(),\n\t\t\t\t\t'new_role'    => $_REQUEST['role'],\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) {\n\t\t\t\t$key      = $wpdb->get_var( $wpdb->prepare( \"SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s\", $new_user_login, $new_user_email ) );\n\t\t\t\t$new_user = wpmu_activate_signup( $key );\n\t\t\t\tif ( is_wp_error( $new_user ) ) {\n\t\t\t\t\t$redirect = add_query_arg( array( 'update' => 'addnoconfirmation' ), 'user-new.php' );\n\t\t\t\t} elseif ( ! is_user_member_of_blog( $new_user['user_id'] ) ) {\n\t\t\t\t\t$redirect = add_query_arg( array( 'update' => 'created_could_not_add' ), 'user-new.php' );\n\t\t\t\t} else {\n\t\t\t\t\t$redirect = add_query_arg(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'update'  => 'addnoconfirmation',\n\t\t\t\t\t\t\t'user_id' => $new_user['user_id'],\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'user-new.php'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$redirect = add_query_arg( array( 'update' => 'newuserconfirmation' ), 'user-new.php' );\n\t\t\t}\n\t\t\twp_redirect( $redirect );\n\t\t\tdie();\n\t\t}\n\t}\n}\n\n$title       = __( 'Add New User' );\n$parent_file = 'users.php';\n\n$do_both = false;\nif ( is_multisite() && current_user_can( 'promote_users' ) && current_user_can( 'create_users' ) ) {\n\t$do_both = true;\n}\n\n$help = '<p>' . __( 'To add a new user to your site, fill in the form on this screen and click the Add New User button at the bottom.' ) . '</p>';\n\nif ( is_multisite() ) {\n\t$help .= '<p>' . __( 'Because this is a multisite installation, you may add accounts that already exist on the Network by specifying a username or email, and defining a role. For more options, such as specifying a password, you have to be a Network Administrator and use the hover link under an existing user&#8217;s name to Edit the user profile under Network Admin > All Users.' ) . '</p>' .\n\t'<p>' . __( 'New users will receive an email letting them know they&#8217;ve been added as a user for your site. This email will also contain their password. Check the box if you don&#8217;t want the user to receive a welcome email.' ) . '</p>';\n} else {\n\t$help .= '<p>' . __( 'New users are automatically assigned a password, which they can change after logging in. You can view or edit the assigned password by clicking the Show Password button. The username cannot be changed once the user has been added.' ) . '</p>' .\n\n\t'<p>' . __( 'By default, new users will receive an email letting them know they&#8217;ve been added as a user for your site. This email will also contain a password reset link. Uncheck the box if you don&#8217;t want to send the new user a welcome email.' ) . '</p>';\n}\n\n$help .= '<p>' . __( 'Remember to click the Add New User button at the bottom of this screen when you are finished.' ) . '</p>';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' => $help,\n\t)\n);\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'user-roles',\n\t\t'title'   => __( 'User Roles' ),\n\t\t'content' => '<p>' . __( 'Here is a basic overview of the different user roles and the permissions associated with each one:' ) . '</p>' .\n\t\t\t\t\t\t\t'<ul>' .\n\t\t\t\t\t\t\t'<li>' . __( 'Subscribers can read comments/comment/receive newsletters, etc. but cannot create regular site content.' ) . '</li>' .\n\t\t\t\t\t\t\t'<li>' . __( 'Contributors can write and manage their posts but not publish posts or upload media files.' ) . '</li>' .\n\t\t\t\t\t\t\t'<li>' . __( 'Authors can publish and manage their own posts, and are able to upload files.' ) . '</li>' .\n\t\t\t\t\t\t\t'<li>' . __( 'Editors can publish posts, manage posts as well as manage other people&#8217;s posts, etc.' ) . '</li>' .\n\t\t\t\t\t\t\t'<li>' . __( 'Administrators have access to all the administration features.' ) . '</li>' .\n\t\t\t\t\t\t\t'</ul>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/users-add-new-screen/\">Documentation on Adding New Users</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nwp_enqueue_script( 'wp-ajax-response' );\nwp_enqueue_script( 'user-profile' );\n\n/**\n * Filters whether to enable user auto-complete for non-super admins in Multisite.\n *\n * @since 3.4.0\n *\n * @param bool $enable Whether to enable auto-complete for non-super admins. Default false.\n */\nif ( is_multisite() && current_user_can( 'promote_users' ) && ! wp_is_large_network( 'users' )\n\t&& ( current_user_can( 'manage_network_users' ) || apply_filters( 'autocomplete_users_for_site_admins', false ) )\n) {\n\twp_enqueue_script( 'user-suggest' );\n}\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\nif ( isset( $_GET['update'] ) ) {\n\t$messages = array();\n\tif ( is_multisite() ) {\n\t\t$edit_link = '';\n\t\tif ( ( isset( $_GET['user_id'] ) ) ) {\n\t\t\t$user_id_new = absint( $_GET['user_id'] );\n\t\t\tif ( $user_id_new ) {\n\t\t\t\t$edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user_id_new ) ) );\n\t\t\t}\n\t\t}\n\n\t\tswitch ( $_GET['update'] ) {\n\t\t\tcase 'newuserconfirmation':\n\t\t\t\t$messages[] = __( 'Invitation email sent to new user. A confirmation link must be clicked before their account is created.' );\n\t\t\t\tbreak;\n\t\t\tcase 'add':\n\t\t\t\t$messages[] = __( 'Invitation email sent to user. A confirmation link must be clicked for them to be added to your site.' );\n\t\t\t\tbreak;\n\t\t\tcase 'addnoconfirmation':\n\t\t\t\t$message = __( 'User has been added to your site.' );\n\n\t\t\t\tif ( $edit_link ) {\n\t\t\t\t\t$message .= sprintf( ' <a href=\"%s\">%s</a>', $edit_link, __( 'Edit user' ) );\n\t\t\t\t}\n\n\t\t\t\t$messages[] = $message;\n\t\t\t\tbreak;\n\t\t\tcase 'addexisting':\n\t\t\t\t$messages[] = __( 'That user is already a member of this site.' );\n\t\t\t\tbreak;\n\t\t\tcase 'could_not_add':\n\t\t\t\t$add_user_errors = new WP_Error( 'could_not_add', __( 'That user could not be added to this site.' ) );\n\t\t\t\tbreak;\n\t\t\tcase 'created_could_not_add':\n\t\t\t\t$add_user_errors = new WP_Error( 'created_could_not_add', __( 'User has been created, but could not be added to this site.' ) );\n\t\t\t\tbreak;\n\t\t\tcase 'does_not_exist':\n\t\t\t\t$add_user_errors = new WP_Error( 'does_not_exist', __( 'The requested user does not exist.' ) );\n\t\t\t\tbreak;\n\t\t\tcase 'enter_email':\n\t\t\t\t$add_user_errors = new WP_Error( 'enter_email', __( 'Please enter a valid email address.' ) );\n\t\t\t\tbreak;\n\t\t}\n\t} else {\n\t\tif ( 'add' === $_GET['update'] ) {\n\t\t\t$messages[] = __( 'User added.' );\n\t\t}\n\t}\n}\n?>\n<div class=\"wrap\">\n<h1 id=\"add-new-user\">\n<?php\nif ( current_user_can( 'create_users' ) ) {\n\t_e( 'Add New User' );\n} elseif ( current_user_can( 'promote_users' ) ) {\n\t_e( 'Add Existing User' );\n}\n?>\n</h1>\n\n<?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?>\n\t<div class=\"error\">\n\t\t<ul>\n\t\t<?php\n\t\tforeach ( $errors->get_error_messages() as $err ) {\n\t\t\techo \"<li>$err</li>\\n\";\n\t\t}\n\t\t?>\n\t\t</ul>\n\t</div>\n\t<?php\nendif;\n\nif ( ! empty( $messages ) ) {\n\tforeach ( $messages as $msg ) {\n\t\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . $msg . '</p></div>';\n\t}\n}\n?>\n\n<?php if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) : ?>\n\t<div class=\"error\">\n\t\t<?php\n\t\tforeach ( $add_user_errors->get_error_messages() as $message ) {\n\t\t\techo \"<p>$message</p>\";\n\t\t}\n\t\t?>\n\t</div>\n<?php endif; ?>\n<div id=\"ajax-response\"></div>\n\n<?php\nif ( is_multisite() && current_user_can( 'promote_users' ) ) {\n\tif ( $do_both ) {\n\t\techo '<h2 id=\"add-existing-user\">' . __( 'Add Existing User' ) . '</h2>';\n\t}\n\tif ( ! current_user_can( 'manage_network_users' ) ) {\n\t\techo '<p>' . __( 'Enter the email address of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' ) . '</p>';\n\t\t$label = __( 'Email' );\n\t\t$type  = 'email';\n\t} else {\n\t\techo '<p>' . __( 'Enter the email address or username of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' ) . '</p>';\n\t\t$label = __( 'Email or Username' );\n\t\t$type  = 'text';\n\t}\n\t?>\n<form method=\"post\" name=\"adduser\" id=\"adduser\" class=\"validate\" novalidate=\"novalidate\"\n\t<?php\n\t/**\n\t * Fires inside the adduser form tag.\n\t *\n\t * @since 3.0.0\n\t */\n\tdo_action( 'user_new_form_tag' );\n\t?>\n>\n<input name=\"action\" type=\"hidden\" value=\"adduser\" />\n\t<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ); ?>\n\n<table class=\"form-table\" role=\"presentation\">\n\t<tr class=\"form-field form-required\">\n\t\t<th scope=\"row\"><label for=\"adduser-email\"><?php echo $label; ?></label></th>\n\t\t<td><input name=\"email\" type=\"<?php echo $type; ?>\" id=\"adduser-email\" class=\"wp-suggest-user\" value=\"\" /></td>\n\t</tr>\n\t<tr class=\"form-field\">\n\t\t<th scope=\"row\"><label for=\"adduser-role\"><?php _e( 'Role' ); ?></label></th>\n\t\t<td><select name=\"role\" id=\"adduser-role\">\n\t\t\t<?php wp_dropdown_roles( get_option( 'default_role' ) ); ?>\n\t\t\t</select>\n\t\t</td>\n\t</tr>\n\t<?php if ( current_user_can( 'manage_network_users' ) ) { ?>\n\t<tr>\n\t\t<th scope=\"row\"><?php _e( 'Skip Confirmation Email' ); ?></th>\n\t\t<td>\n\t\t\t<input type=\"checkbox\" name=\"noconfirmation\" id=\"adduser-noconfirmation\" value=\"1\" />\n\t\t\t<label for=\"adduser-noconfirmation\"><?php _e( 'Add the user without sending an email that requires their confirmation.' ); ?></label>\n\t\t</td>\n\t</tr>\n\t<?php } ?>\n</table>\n\t<?php\n\t/**\n\t * Fires at the end of the new user form.\n\t *\n\t * Passes a contextual string to make both types of new user forms\n\t * uniquely targetable. Contexts are 'add-existing-user' (Multisite),\n\t * and 'add-new-user' (single site and network admin).\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param string $type A contextual string specifying which type of new user form the hook follows.\n\t */\n\tdo_action( 'user_new_form', 'add-existing-user' );\n\t?>\n\t<?php submit_button( __( 'Add Existing User' ), 'primary', 'adduser', true, array( 'id' => 'addusersub' ) ); ?>\n</form>\n\t<?php\n} // End if is_multisite().\n\nif ( current_user_can( 'create_users' ) ) {\n\tif ( $do_both ) {\n\t\techo '<h2 id=\"create-new-user\">' . __( 'Add New User' ) . '</h2>';\n\t}\n\t?>\n<p><?php _e( 'Create a brand new user and add them to this site.' ); ?></p>\n<form method=\"post\" name=\"createuser\" id=\"createuser\" class=\"validate\" novalidate=\"novalidate\"\n\t<?php\n\t/** This action is documented in wp-admin/user-new.php */\n\tdo_action( 'user_new_form_tag' );\n\t?>\n>\n<input name=\"action\" type=\"hidden\" value=\"createuser\" />\n\t<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?>\n\t<?php\n\t// Load up the passed data, else set to a default.\n\t$creating = isset( $_POST['createuser'] );\n\n\t$new_user_login             = $creating && isset( $_POST['user_login'] ) ? wp_unslash( $_POST['user_login'] ) : '';\n\t$new_user_firstname         = $creating && isset( $_POST['first_name'] ) ? wp_unslash( $_POST['first_name'] ) : '';\n\t$new_user_lastname          = $creating && isset( $_POST['last_name'] ) ? wp_unslash( $_POST['last_name'] ) : '';\n\t$new_user_email             = $creating && isset( $_POST['email'] ) ? wp_unslash( $_POST['email'] ) : '';\n\t$new_user_uri               = $creating && isset( $_POST['url'] ) ? wp_unslash( $_POST['url'] ) : '';\n\t$new_user_role              = $creating && isset( $_POST['role'] ) ? wp_unslash( $_POST['role'] ) : '';\n\t$new_user_send_notification = $creating && ! isset( $_POST['send_user_notification'] ) ? false : true;\n\t$new_user_ignore_pass       = $creating && isset( $_POST['noconfirmation'] ) ? wp_unslash( $_POST['noconfirmation'] ) : '';\n\n\t?>\n<table class=\"form-table\" role=\"presentation\">\n\t<tr class=\"form-field form-required\">\n\t\t<th scope=\"row\"><label for=\"user_login\"><?php _e( 'Username' ); ?> <span class=\"description\"><?php _e( '(required)' ); ?></span></label></th>\n\t\t<td><input name=\"user_login\" type=\"text\" id=\"user_login\" value=\"<?php echo esc_attr( $new_user_login ); ?>\" aria-required=\"true\" autocapitalize=\"none\" autocorrect=\"off\" maxlength=\"60\" /></td>\n\t</tr>\n\t<tr class=\"form-field form-required\">\n\t\t<th scope=\"row\"><label for=\"email\"><?php _e( 'Email' ); ?> <span class=\"description\"><?php _e( '(required)' ); ?></span></label></th>\n\t\t<td><input name=\"email\" type=\"email\" id=\"email\" value=\"<?php echo esc_attr( $new_user_email ); ?>\" /></td>\n\t</tr>\n\t<?php if ( ! is_multisite() ) { ?>\n\t<tr class=\"form-field\">\n\t\t<th scope=\"row\"><label for=\"first_name\"><?php _e( 'First Name' ); ?> </label></th>\n\t\t<td><input name=\"first_name\" type=\"text\" id=\"first_name\" value=\"<?php echo esc_attr( $new_user_firstname ); ?>\" /></td>\n\t</tr>\n\t<tr class=\"form-field\">\n\t\t<th scope=\"row\"><label for=\"last_name\"><?php _e( 'Last Name' ); ?> </label></th>\n\t\t<td><input name=\"last_name\" type=\"text\" id=\"last_name\" value=\"<?php echo esc_attr( $new_user_lastname ); ?>\" /></td>\n\t</tr>\n\t<tr class=\"form-field\">\n\t\t<th scope=\"row\"><label for=\"url\"><?php _e( 'Website' ); ?></label></th>\n\t\t<td><input name=\"url\" type=\"url\" id=\"url\" class=\"code\" value=\"<?php echo esc_attr( $new_user_uri ); ?>\" /></td>\n\t</tr>\n\t\t<?php\n\t\t$languages = get_available_languages();\n\t\tif ( $languages ) :\n\t\t\t?>\n\t\t<tr class=\"form-field user-language-wrap\">\n\t\t\t<th scope=\"row\">\n\t\t\t\t<label for=\"locale\">\n\t\t\t\t\t<?php /* translators: The user language selection field label. */ ?>\n\t\t\t\t\t<?php _e( 'Language' ); ?><span class=\"dashicons dashicons-translation\" aria-hidden=\"true\"></span>\n\t\t\t\t</label>\n\t\t\t</th>\n\t\t\t<td>\n\t\t\t\t<?php\n\t\t\t\twp_dropdown_languages(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name'                        => 'locale',\n\t\t\t\t\t\t'id'                          => 'locale',\n\t\t\t\t\t\t'selected'                    => 'site-default',\n\t\t\t\t\t\t'languages'                   => $languages,\n\t\t\t\t\t\t'show_available_translations' => false,\n\t\t\t\t\t\t'show_option_site_default'    => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<?php endif; ?>\n\t<tr class=\"form-field form-required user-pass1-wrap\">\n\t\t<th scope=\"row\">\n\t\t\t<label for=\"pass1\">\n\t\t\t\t<?php _e( 'Password' ); ?>\n\t\t\t\t<span class=\"description hide-if-js\"><?php _e( '(required)' ); ?></span>\n\t\t\t</label>\n\t\t</th>\n\t\t<td>\n\t\t\t<input class=\"hidden\" value=\" \" /><!-- #24364 workaround -->\n\t\t\t<button type=\"button\" class=\"button wp-generate-pw hide-if-no-js\"><?php _e( 'Show password' ); ?></button>\n\t\t\t<div class=\"wp-pwd hide-if-js\">\n\t\t\t\t<?php $initial_password = wp_generate_password( 24 ); ?>\n\t\t\t\t<span class=\"password-input-wrapper\">\n\t\t\t\t\t<input type=\"password\" name=\"pass1\" id=\"pass1\" class=\"regular-text\" autocomplete=\"off\" data-reveal=\"1\" data-pw=\"<?php echo esc_attr( $initial_password ); ?>\" aria-describedby=\"pass-strength-result\" />\n\t\t\t\t</span>\n\t\t\t\t<button type=\"button\" class=\"button wp-hide-pw hide-if-no-js\" data-toggle=\"0\" aria-label=\"<?php esc_attr_e( 'Hide password' ); ?>\">\n\t\t\t\t\t<span class=\"dashicons dashicons-hidden\" aria-hidden=\"true\"></span>\n\t\t\t\t\t<span class=\"text\"><?php _e( 'Hide' ); ?></span>\n\t\t\t\t</button>\n\t\t\t\t<button type=\"button\" class=\"button wp-cancel-pw hide-if-no-js\" data-toggle=\"0\" aria-label=\"<?php esc_attr_e( 'Cancel password change' ); ?>\">\n\t\t\t\t\t<span class=\"dashicons dashicons-no\" aria-hidden=\"true\"></span>\n\t\t\t\t\t<span class=\"text\"><?php _e( 'Cancel' ); ?></span>\n\t\t\t\t</button>\n\t\t\t\t<div style=\"display:none\" id=\"pass-strength-result\" aria-live=\"polite\"></div>\n\t\t\t</div>\n\t\t</td>\n\t</tr>\n\t<tr class=\"form-field form-required user-pass2-wrap hide-if-js\">\n\t\t<th scope=\"row\"><label for=\"pass2\"><?php _e( 'Repeat Password' ); ?> <span class=\"description\"><?php _e( '(required)' ); ?></span></label></th>\n\t\t<td>\n\t\t<input name=\"pass2\" type=\"password\" id=\"pass2\" autocomplete=\"off\" />\n\t\t</td>\n\t</tr>\n\t<tr class=\"pw-weak\">\n\t\t<th><?php _e( 'Confirm Password' ); ?></th>\n\t\t<td>\n\t\t\t<label>\n\t\t\t\t<input type=\"checkbox\" name=\"pw_weak\" class=\"pw-checkbox\" />\n\t\t\t\t<?php _e( 'Confirm use of weak password' ); ?>\n\t\t\t</label>\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<th scope=\"row\"><?php _e( 'Send User Notification' ); ?></th>\n\t\t<td>\n\t\t\t<input type=\"checkbox\" name=\"send_user_notification\" id=\"send_user_notification\" value=\"1\" <?php checked( $new_user_send_notification ); ?> />\n\t\t\t<label for=\"send_user_notification\"><?php _e( 'Send the new user an email about their account.' ); ?></label>\n\t\t</td>\n\t</tr>\n\t<?php } // End if ! is_multisite(). ?>\n\t<?php if ( current_user_can( 'promote_users' ) ) { ?>\n\t<tr class=\"form-field\">\n\t\t<th scope=\"row\"><label for=\"role\"><?php _e( 'Role' ); ?></label></th>\n\t\t<td><select name=\"role\" id=\"role\">\n\t\t\t<?php\n\t\t\tif ( ! $new_user_role ) {\n\t\t\t\t$new_user_role = ! empty( $current_role ) ? $current_role : get_option( 'default_role' );\n\t\t\t}\n\t\t\twp_dropdown_roles( $new_user_role );\n\t\t\t?>\n\t\t\t</select>\n\t\t</td>\n\t</tr>\n\t<?php } ?>\n\t<?php if ( is_multisite() && current_user_can( 'manage_network_users' ) ) { ?>\n\t<tr>\n\t\t<th scope=\"row\"><?php _e( 'Skip Confirmation Email' ); ?></th>\n\t\t<td>\n\t\t\t<input type=\"checkbox\" name=\"noconfirmation\" id=\"noconfirmation\" value=\"1\" <?php checked( $new_user_ignore_pass ); ?> />\n\t\t\t<label for=\"noconfirmation\"><?php _e( 'Add the user without sending an email that requires their confirmation.' ); ?></label>\n\t\t</td>\n\t</tr>\n\t<?php } ?>\n</table>\n\n\t<?php\n\t/** This action is documented in wp-admin/user-new.php */\n\tdo_action( 'user_new_form', 'add-new-user' );\n\t?>\n\n\t<?php submit_button( __( 'Add New User' ), 'primary', 'createuser', true, array( 'id' => 'createusersub' ) ); ?>\n\n</form>\n<?php } // End if current_user_can( 'create_users' ). ?>\n</div>\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 615}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * User administration panel\n *\n * @package WordPress\n * @subpackage Administration\n * @since 1.0.0\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'list_users' ) ) {\n\twp_die(\n\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t'<p>' . __( 'Sorry, you are not allowed to list users.' ) . '</p>',\n\t\t403\n\t);\n}\n\n$wp_list_table = _get_list_table( 'WP_Users_List_Table' );\n$pagenum       = $wp_list_table->get_pagenum();\n$title         = __( 'Users' );\n$parent_file   = 'users.php';\n\nadd_screen_option( 'per_page' );\n\n// Contextual help - choose Help on the top right of admin panel to preview this.\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' => '<p>' . __( 'This screen lists all the existing users for your site. Each user has one of five defined roles as set by the site admin: Site Administrator, Editor, Author, Contributor, or Subscriber. Users with roles other than Administrator will see fewer options in the dashboard navigation when they are logged in, based on their role.' ) . '</p>' .\n\t\t\t\t\t\t'<p>' . __( 'To add a new user for your site, click the Add New button at the top of the screen or Add New in the Users menu section.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'screen-content',\n\t\t'title'   => __( 'Screen Content' ),\n\t\t'content' => '<p>' . __( 'You can customize the display of this screen in a number of ways:' ) . '</p>' .\n\t\t\t\t\t\t'<ul>' .\n\t\t\t\t\t\t'<li>' . __( 'You can hide/display columns based on your needs and decide how many users to list per screen using the Screen Options tab.' ) . '</li>' .\n\t\t\t\t\t\t'<li>' . __( 'You can filter the list of users by User Role using the text links above the users list to show All, Administrator, Editor, Author, Contributor, or Subscriber. The default view is to show all users. Unused User Roles are not listed.' ) . '</li>' .\n\t\t\t\t\t\t'<li>' . __( 'You can view all posts made by a user by clicking on the number under the Posts column.' ) . '</li>' .\n\t\t\t\t\t\t'</ul>',\n\t)\n);\n\n$help = '<p>' . __( 'Hovering over a row in the users list will display action links that allow you to manage users. You can perform the following actions:' ) . '</p>' .\n\t'<ul>' .\n\t'<li>' . __( '<strong>Edit</strong> takes you to the editable profile screen for that user. You can also reach that screen by clicking on the username.' ) . '</li>';\n\nif ( is_multisite() ) {\n\t$help .= '<li>' . __( '<strong>Remove</strong> allows you to remove a user from your site. It does not delete their content. You can also remove multiple users at once by using bulk actions.' ) . '</li>';\n} else {\n\t$help .= '<li>' . __( '<strong>Delete</strong> brings you to the Delete Users screen for confirmation, where you can permanently remove a user from your site and delete their content. You can also delete multiple users at once by using bulk actions.' ) . '</li>';\n}\n\n$help .= '</ul>';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'action-links',\n\t\t'title'   => __( 'Available Actions' ),\n\t\t'content' => $help,\n\t)\n);\nunset( $help );\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/users-screen/\">Documentation on Managing Users</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/roles-and-capabilities/\">Descriptions of Roles and Capabilities</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nget_current_screen()->set_screen_reader_content(\n\tarray(\n\t\t'heading_views'      => __( 'Filter users list' ),\n\t\t'heading_pagination' => __( 'Users list navigation' ),\n\t\t'heading_list'       => __( 'Users list' ),\n\t)\n);\n\nif ( empty( $_REQUEST ) ) {\n\t$referer = '<input type=\"hidden\" name=\"wp_http_referer\" value=\"' . esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '\" />';\n} elseif ( isset( $_REQUEST['wp_http_referer'] ) ) {\n\t$redirect = remove_query_arg( array( 'wp_http_referer', 'updated', 'delete_count' ), wp_unslash( $_REQUEST['wp_http_referer'] ) );\n\t$referer  = '<input type=\"hidden\" name=\"wp_http_referer\" value=\"' . esc_attr( $redirect ) . '\" />';\n} else {\n\t$redirect = 'users.php';\n\t$referer  = '';\n}\n\n$update = '';\n\nswitch ( $wp_list_table->current_action() ) {\n\n\t/* Bulk Dropdown menu Role changes */\n\tcase 'promote':\n\t\tcheck_admin_referer( 'bulk-users' );\n\n\t\tif ( ! current_user_can( 'promote_users' ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to edit this user.' ), 403 );\n\t\t}\n\n\t\tif ( empty( $_REQUEST['users'] ) ) {\n\t\t\twp_redirect( $redirect );\n\t\t\texit;\n\t\t}\n\n\t\t$editable_roles = get_editable_roles();\n\t\t$role           = false;\n\t\tif ( ! empty( $_REQUEST['new_role2'] ) ) {\n\t\t\t$role = $_REQUEST['new_role2'];\n\t\t} elseif ( ! empty( $_REQUEST['new_role'] ) ) {\n\t\t\t$role = $_REQUEST['new_role'];\n\t\t}\n\n\t\tif ( ! $role || empty( $editable_roles[ $role ] ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 );\n\t\t}\n\n\t\t$userids = $_REQUEST['users'];\n\t\t$update  = 'promote';\n\t\tforeach ( $userids as $id ) {\n\t\t\t$id = (int) $id;\n\n\t\t\tif ( ! current_user_can( 'promote_user', $id ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to edit this user.' ), 403 );\n\t\t\t}\n\n\t\t\t// The new role of the current user must also have the promote_users cap or be a multisite super admin.\n\t\t\tif ( $id == $current_user->ID && ! $wp_roles->role_objects[ $role ]->has_cap( 'promote_users' )\n\t\t\t&& ! ( is_multisite() && current_user_can( 'manage_network_users' ) ) ) {\n\t\t\t\t\t$update = 'err_admin_role';\n\t\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If the user doesn't already belong to the blog, bail.\n\t\t\tif ( is_multisite() && ! is_user_member_of_blog( $id ) ) {\n\t\t\t\twp_die(\n\t\t\t\t\t'<h1>' . __( 'Something went wrong.' ) . '</h1>' .\n\t\t\t\t\t'<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>',\n\t\t\t\t\t403\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$user = get_userdata( $id );\n\t\t\t$user->set_role( $role );\n\t\t}\n\n\t\twp_redirect( add_query_arg( 'update', $update, $redirect ) );\n\t\texit;\n\n\tcase 'dodelete':\n\t\tif ( is_multisite() ) {\n\t\t\twp_die( __( 'User deletion is not allowed from this screen.' ), 400 );\n\t\t}\n\n\t\tcheck_admin_referer( 'delete-users' );\n\n\t\tif ( empty( $_REQUEST['users'] ) ) {\n\t\t\twp_redirect( $redirect );\n\t\t\texit;\n\t\t}\n\n\t\t$userids = array_map( 'intval', (array) $_REQUEST['users'] );\n\n\t\tif ( empty( $_REQUEST['delete_option'] ) ) {\n\t\t\t$url = self_admin_url( 'users.php?action=delete&users[]=' . implode( '&users[]=', $userids ) . '&error=true' );\n\t\t\t$url = str_replace( '&amp;', '&', wp_nonce_url( $url, 'bulk-users' ) );\n\t\t\twp_redirect( $url );\n\t\t\texit;\n\t\t}\n\n\t\tif ( ! current_user_can( 'delete_users' ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to delete users.' ), 403 );\n\t\t}\n\n\t\t$update       = 'del';\n\t\t$delete_count = 0;\n\n\t\tforeach ( $userids as $id ) {\n\t\t\tif ( ! current_user_can( 'delete_user', $id ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to delete that user.' ), 403 );\n\t\t\t}\n\n\t\t\tif ( $id == $current_user->ID ) {\n\t\t\t\t$update = 'err_admin_del';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tswitch ( $_REQUEST['delete_option'] ) {\n\t\t\t\tcase 'delete':\n\t\t\t\t\twp_delete_user( $id );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'reassign':\n\t\t\t\t\twp_delete_user( $id, $_REQUEST['reassign_user'] );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t++$delete_count;\n\t\t}\n\n\t\t$redirect = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'delete_count' => $delete_count,\n\t\t\t\t'update'       => $update,\n\t\t\t),\n\t\t\t$redirect\n\t\t);\n\t\twp_redirect( $redirect );\n\t\texit;\n\n\tcase 'delete':\n\t\tif ( is_multisite() ) {\n\t\t\twp_die( __( 'User deletion is not allowed from this screen.' ), 400 );\n\t\t}\n\n\t\tcheck_admin_referer( 'bulk-users' );\n\n\t\tif ( empty( $_REQUEST['users'] ) && empty( $_REQUEST['user'] ) ) {\n\t\t\twp_redirect( $redirect );\n\t\t\texit;\n\t\t}\n\n\t\tif ( ! current_user_can( 'delete_users' ) ) {\n\t\t\t$errors = new WP_Error( 'edit_users', __( 'Sorry, you are not allowed to delete users.' ) );\n\t\t}\n\n\t\tif ( empty( $_REQUEST['users'] ) ) {\n\t\t\t$userids = array( intval( $_REQUEST['user'] ) );\n\t\t} else {\n\t\t\t$userids = array_map( 'intval', (array) $_REQUEST['users'] );\n\t\t}\n\n\t\t$all_userids = $userids;\n\n\t\tif ( in_array( $current_user->ID, $userids, true ) ) {\n\t\t\t$userids = array_diff( $userids, array( $current_user->ID ) );\n\t\t}\n\n\t\t/**\n\t\t * Filters whether the users being deleted have additional content\n\t\t * associated with them outside of the `post_author` and `link_owner` relationships.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param bool  $users_have_additional_content Whether the users have additional content. Default false.\n\t\t * @param int[] $userids                       Array of IDs for users being deleted.\n\t\t */\n\t\t$users_have_content = (bool) apply_filters( 'users_have_additional_content', false, $userids );\n\n\t\tif ( $userids && ! $users_have_content ) {\n\t\t\tif ( $wpdb->get_var( \"SELECT ID FROM {$wpdb->posts} WHERE post_author IN( \" . implode( ',', $userids ) . ' ) LIMIT 1' ) ) {\n\t\t\t\t$users_have_content = true;\n\t\t\t} elseif ( $wpdb->get_var( \"SELECT link_id FROM {$wpdb->links} WHERE link_owner IN( \" . implode( ',', $userids ) . ' ) LIMIT 1' ) ) {\n\t\t\t\t$users_have_content = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( $users_have_content ) {\n\t\t\tadd_action( 'admin_head', 'delete_users_add_js' );\n\t\t}\n\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t\t?>\n\t<form method=\"post\" name=\"updateusers\" id=\"updateusers\">\n\t\t<?php wp_nonce_field( 'delete-users' ); ?>\n\t\t<?php echo $referer; ?>\n\n<div class=\"wrap\">\n<h1><?php _e( 'Delete Users' ); ?></h1>\n\t\t<?php if ( isset( $_REQUEST['error'] ) ) : ?>\n\t<div class=\"error\">\n\t\t<p><strong><?php _e( 'Error:' ); ?></strong> <?php _e( 'Please select an option.' ); ?></p>\n\t</div>\n\t\t<?php endif; ?>\n\n\t\t<?php if ( 1 === count( $all_userids ) ) : ?>\n\t<p><?php _e( 'You have specified this user for deletion:' ); ?></p>\n\t\t<?php else : ?>\n\t<p><?php _e( 'You have specified these users for deletion:' ); ?></p>\n\t\t<?php endif; ?>\n\n<ul>\n\t\t<?php\n\t\t$go_delete = 0;\n\t\tforeach ( $all_userids as $id ) {\n\t\t\t$user = get_userdata( $id );\n\t\t\tif ( $id == $current_user->ID ) {\n\t\t\t\t/* translators: 1: User ID, 2: User login. */\n\t\t\t\techo '<li>' . sprintf( __( 'ID #%1$s: %2$s <strong>The current user will not be deleted.</strong>' ), $id, $user->user_login ) . \"</li>\\n\";\n\t\t\t} else {\n\t\t\t\t/* translators: 1: User ID, 2: User login. */\n\t\t\t\techo '<li><input type=\"hidden\" name=\"users[]\" value=\"' . esc_attr( $id ) . '\" />' . sprintf( __( 'ID #%1$s: %2$s' ), $id, $user->user_login ) . \"</li>\\n\";\n\t\t\t\t$go_delete++;\n\t\t\t}\n\t\t}\n\t\t?>\n\t</ul>\n\t\t<?php\n\t\tif ( $go_delete ) :\n\n\t\t\tif ( ! $users_have_content ) :\n\t\t\t\t?>\n\t\t\t<input type=\"hidden\" name=\"delete_option\" value=\"delete\" />\n\t\t\t<?php else : ?>\n\t\t\t\t<?php if ( 1 == $go_delete ) : ?>\n\t\t\t<fieldset><p><legend><?php _e( 'What should be done with content owned by this user?' ); ?></legend></p>\n\t\t<?php else : ?>\n\t\t\t<fieldset><p><legend><?php _e( 'What should be done with content owned by these users?' ); ?></legend></p>\n\t\t<?php endif; ?>\n\t\t<ul style=\"list-style:none;\">\n\t\t\t<li><label><input type=\"radio\" id=\"delete_option0\" name=\"delete_option\" value=\"delete\" />\n\t\t\t\t<?php _e( 'Delete all content.' ); ?></label></li>\n\t\t\t<li><input type=\"radio\" id=\"delete_option1\" name=\"delete_option\" value=\"reassign\" />\n\t\t\t\t<?php\n\t\t\t\techo '<label for=\"delete_option1\">' . __( 'Attribute all content to:' ) . '</label> ';\n\t\t\t\twp_dropdown_users(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name'    => 'reassign_user',\n\t\t\t\t\t\t'exclude' => $userids,\n\t\t\t\t\t\t'show'    => 'display_name_with_login',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</li>\n\t\t</ul></fieldset>\n\t\t\t\t<?php\n\tendif;\n\t\t\t/**\n\t\t\t * Fires at the end of the delete users form prior to the confirm button.\n\t\t\t *\n\t\t\t * @since 4.0.0\n\t\t\t * @since 4.5.0 The `$userids` parameter was added.\n\t\t\t *\n\t\t\t * @param WP_User $current_user WP_User object for the current user.\n\t\t\t * @param int[]   $userids      Array of IDs for users being deleted.\n\t\t\t */\n\t\t\tdo_action( 'delete_user_form', $current_user, $userids );\n\t\t\t?>\n\t<input type=\"hidden\" name=\"action\" value=\"dodelete\" />\n\t\t\t<?php submit_button( __( 'Confirm Deletion' ), 'primary' ); ?>\n\t<?php else : ?>\n\t<p><?php _e( 'There are no valid users selected for deletion.' ); ?></p>\n\t<?php endif; ?>\n\t</div>\n\t</form>\n\t\t<?php\n\n\t\tbreak;\n\n\tcase 'doremove':\n\t\tcheck_admin_referer( 'remove-users' );\n\n\t\tif ( ! is_multisite() ) {\n\t\t\twp_die( __( 'You can&#8217;t remove users.' ), 400 );\n\t\t}\n\n\t\tif ( empty( $_REQUEST['users'] ) ) {\n\t\t\twp_redirect( $redirect );\n\t\t\texit;\n\t\t}\n\n\t\tif ( ! current_user_can( 'remove_users' ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to remove users.' ), 403 );\n\t\t}\n\n\t\t$userids = $_REQUEST['users'];\n\n\t\t$update = 'remove';\n\t\tforeach ( $userids as $id ) {\n\t\t\t$id = (int) $id;\n\t\t\tif ( ! current_user_can( 'remove_user', $id ) ) {\n\t\t\t\t$update = 'err_admin_remove';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tremove_user_from_blog( $id, $blog_id );\n\t\t}\n\n\t\t$redirect = add_query_arg( array( 'update' => $update ), $redirect );\n\t\twp_redirect( $redirect );\n\t\texit;\n\n\tcase 'remove':\n\t\tcheck_admin_referer( 'bulk-users' );\n\n\t\tif ( ! is_multisite() ) {\n\t\t\twp_die( __( 'You can&#8217;t remove users.' ), 400 );\n\t\t}\n\n\t\tif ( empty( $_REQUEST['users'] ) && empty( $_REQUEST['user'] ) ) {\n\t\t\twp_redirect( $redirect );\n\t\t\texit;\n\t\t}\n\n\t\tif ( ! current_user_can( 'remove_users' ) ) {\n\t\t\t$error = new WP_Error( 'edit_users', __( 'Sorry, you are not allowed to remove users.' ) );\n\t\t}\n\n\t\tif ( empty( $_REQUEST['users'] ) ) {\n\t\t\t$userids = array( intval( $_REQUEST['user'] ) );\n\t\t} else {\n\t\t\t$userids = $_REQUEST['users'];\n\t\t}\n\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t\t?>\n\t<form method=\"post\" name=\"updateusers\" id=\"updateusers\">\n\t\t<?php wp_nonce_field( 'remove-users' ); ?>\n\t\t<?php echo $referer; ?>\n\n<div class=\"wrap\">\n<h1><?php _e( 'Remove Users from Site' ); ?></h1>\n\n\t\t<?php if ( 1 === count( $userids ) ) : ?>\n\t<p><?php _e( 'You have specified this user for removal:' ); ?></p>\n\t\t<?php else : ?>\n\t<p><?php _e( 'You have specified these users for removal:' ); ?></p>\n\t\t<?php endif; ?>\n\n<ul>\n\t\t<?php\n\t\t$go_remove = false;\n\t\tforeach ( $userids as $id ) {\n\t\t\t$id   = (int) $id;\n\t\t\t$user = get_userdata( $id );\n\t\t\tif ( ! current_user_can( 'remove_user', $id ) ) {\n\t\t\t\t/* translators: 1: User ID, 2: User login. */\n\t\t\t\techo '<li>' . sprintf( __( 'ID #%1$s: %2$s <strong>Sorry, you are not allowed to remove this user.</strong>' ), $id, $user->user_login ) . \"</li>\\n\";\n\t\t\t} else {\n\t\t\t\t/* translators: 1: User ID, 2: User login. */\n\t\t\t\techo \"<li><input type=\\\"hidden\\\" name=\\\"users[]\\\" value=\\\"{$id}\\\" />\" . sprintf( __( 'ID #%1$s: %2$s' ), $id, $user->user_login ) . \"</li>\\n\";\n\t\t\t\t$go_remove = true;\n\t\t\t}\n\t\t}\n\t\t?>\n\t</ul>\n\t\t<?php if ( $go_remove ) : ?>\n\t\t<input type=\"hidden\" name=\"action\" value=\"doremove\" />\n\t\t\t<?php submit_button( __( 'Confirm Removal' ), 'primary' ); ?>\n\t<?php else : ?>\n\t<p><?php _e( 'There are no valid users selected for removal.' ); ?></p>\n\t<?php endif; ?>\n\t</div>\n\t</form>\n\t\t<?php\n\n\t\tbreak;\n\n\tdefault:\n\t\tif ( ! empty( $_GET['_wp_http_referer'] ) ) {\n\t\t\twp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );\n\t\t\texit;\n\t\t}\n\n\t\tif ( $wp_list_table->current_action() && ! empty( $_REQUEST['users'] ) ) {\n\t\t\t$screen   = get_current_screen()->id;\n\t\t\t$sendback = wp_get_referer();\n\t\t\t$userids  = $_REQUEST['users'];\n\n\t\t\t/** This action is documented in wp-admin/edit.php */\n\t\t\t$sendback = apply_filters( \"handle_bulk_actions-{$screen}\", $sendback, $wp_list_table->current_action(), $userids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\t\twp_safe_redirect( $sendback );\n\t\t\texit;\n\t\t}\n\n\t\t$wp_list_table->prepare_items();\n\t\t$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );\n\t\tif ( $pagenum > $total_pages && $total_pages > 0 ) {\n\t\t\twp_redirect( add_query_arg( 'paged', $total_pages ) );\n\t\t\texit;\n\t\t}\n\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n\t\t$messages = array();\n\t\tif ( isset( $_GET['update'] ) ) :\n\t\t\tswitch ( $_GET['update'] ) {\n\t\t\t\tcase 'del':\n\t\t\t\tcase 'del_many':\n\t\t\t\t\t$delete_count = isset( $_GET['delete_count'] ) ? (int) $_GET['delete_count'] : 0;\n\t\t\t\t\tif ( 1 == $delete_count ) {\n\t\t\t\t\t\t$message = __( 'User deleted.' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* translators: %s: Number of users. */\n\t\t\t\t\t\t$message = _n( '%s user deleted.', '%s users deleted.', $delete_count );\n\t\t\t\t\t}\n\t\t\t\t\t$messages[] = '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . sprintf( $message, number_format_i18n( $delete_count ) ) . '</p></div>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'add':\n\t\t\t\t\t$message = __( 'New user created.' );\n\n\t\t\t\t\t$user_id = isset( $_GET['id'] ) ? $_GET['id'] : false;\n\t\t\t\t\tif ( $user_id && current_user_can( 'edit_user', $user_id ) ) {\n\t\t\t\t\t\t$message .= sprintf(\n\t\t\t\t\t\t\t' <a href=\"%s\">%s</a>',\n\t\t\t\t\t\t\tesc_url(\n\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t'wp_http_referer',\n\t\t\t\t\t\t\t\t\turlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ),\n\t\t\t\t\t\t\t\t\tself_admin_url( 'user-edit.php?user_id=' . $user_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__( 'Edit user' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$messages[] = '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . $message . '</p></div>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'promote':\n\t\t\t\t\t$messages[] = '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . __( 'Changed roles.' ) . '</p></div>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'err_admin_role':\n\t\t\t\t\t$messages[] = '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . __( 'The current user&#8217;s role must have user editing capabilities.' ) . '</p></div>';\n\t\t\t\t\t$messages[] = '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . __( 'Other user roles have been changed.' ) . '</p></div>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'err_admin_del':\n\t\t\t\t\t$messages[] = '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . __( 'You can&#8217;t delete the current user.' ) . '</p></div>';\n\t\t\t\t\t$messages[] = '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . __( 'Other users have been deleted.' ) . '</p></div>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'remove':\n\t\t\t\t\t$messages[] = '<div id=\"message\" class=\"updated notice is-dismissible fade\"><p>' . __( 'User removed from this site.' ) . '</p></div>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'err_admin_remove':\n\t\t\t\t\t$messages[] = '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . __( \"You can't remove the current user.\" ) . '</p></div>';\n\t\t\t\t\t$messages[] = '<div id=\"message\" class=\"updated notice is-dismissible fade\"><p>' . __( 'Other users have been removed.' ) . '</p></div>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\tendif;\n\t\t?>\n\n\t\t<?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?>\n\t\t<div class=\"error\">\n\t\t\t<ul>\n\t\t\t<?php\n\t\t\tforeach ( $errors->get_error_messages() as $err ) {\n\t\t\t\techo \"<li>$err</li>\\n\";\n\t\t\t}\n\t\t\t?>\n\t\t\t</ul>\n\t\t</div>\n\t\t\t<?php\n\tendif;\n\n\t\tif ( ! empty( $messages ) ) {\n\t\t\tforeach ( $messages as $msg ) {\n\t\t\t\techo $msg;\n\t\t\t}\n\t\t}\n\t\t?>\n\n\t<div class=\"wrap\">\n\t<h1 class=\"wp-heading-inline\">\n\t\t<?php\n\t\techo esc_html( $title );\n\t\t?>\n</h1>\n\n\t\t<?php\n\t\tif ( current_user_can( 'create_users' ) ) {\n\t\t\t?>\n\t<a href=\"<?php echo admin_url( 'user-new.php' ); ?>\" class=\"page-title-action\"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>\n<?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>\n\t<a href=\"<?php echo admin_url( 'user-new.php' ); ?>\" class=\"page-title-action\"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>\n\t\t\t<?php\n}\n\nif ( strlen( $usersearch ) ) {\n\t/* translators: %s: Search query. */\n\tprintf( '<span class=\"subtitle\">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) );\n}\n?>\n\n<hr class=\"wp-header-end\">\n\n\t\t<?php $wp_list_table->views(); ?>\n\n<form method=\"get\">\n\n\t\t<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>\n\n\t\t<?php if ( ! empty( $_REQUEST['role'] ) ) { ?>\n<input type=\"hidden\" name=\"role\" value=\"<?php echo esc_attr( $_REQUEST['role'] ); ?>\" />\n<?php } ?>\n\n\t\t<?php $wp_list_table->display(); ?>\n</form>\n\n<br class=\"clear\" />\n</div>\n\t\t<?php\n\t\tbreak;\n\n} // End of the $doaction switch.\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 601}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget administration panel\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n/** WordPress Administration Widgets API */\nrequire_once ABSPATH . 'wp-admin/includes/widgets.php';\n\nif ( ! current_user_can( 'edit_theme_options' ) ) {\n\twp_die(\n\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t'<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',\n\t\t403\n\t);\n}\n\n$widgets_access = get_user_setting( 'widgets_access' );\nif ( isset( $_GET['widgets-access'] ) ) {\n\tcheck_admin_referer( 'widgets-access' );\n\n\t$widgets_access = 'on' === $_GET['widgets-access'] ? 'on' : 'off';\n\tset_user_setting( 'widgets_access', $widgets_access );\n}\n\nif ( 'on' === $widgets_access ) {\n\tadd_filter( 'admin_body_class', 'wp_widgets_access_body_class' );\n} else {\n\twp_enqueue_script( 'admin-widgets' );\n\n\tif ( wp_is_mobile() ) {\n\t\twp_enqueue_script( 'jquery-touch-punch' );\n\t}\n}\n\n/**\n * Fires early before the Widgets administration screen loads,\n * after scripts are enqueued.\n *\n * @since 2.2.0\n */\ndo_action( 'sidebar_admin_setup' );\n\n$title       = __( 'Widgets' );\n$parent_file = 'themes.php';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t\t'<p>' . __( 'Widgets are independent sections of content that can be placed into any widgetized area provided by your theme (commonly called sidebars). To populate your sidebars/widget areas with individual widgets, drag and drop the title bars into the desired area. By default, only the first widget area is expanded. To populate additional widget areas, click on their title bars to expand them.' ) . '</p>\n\t<p>' . __( 'The Available Widgets section contains all the widgets you can choose from. Once you drag a widget into a sidebar, it will open to allow you to configure its settings. When you are happy with the widget settings, click the Save button and the widget will go live on your site. If you click Delete, it will remove the widget.' ) . '</p>',\n\t)\n);\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'removing-reusing',\n\t\t'title'   => __( 'Removing and Reusing' ),\n\t\t'content' =>\n\t\t\t\t'<p>' . __( 'If you want to remove the widget but save its setting for possible future use, just drag it into the Inactive Widgets area. You can add them back anytime from there. This is especially helpful when you switch to a theme with fewer or different widget areas.' ) . '</p>\n\t<p>' . __( 'Widgets may be used multiple times. You can give each widget a title, to display on your site, but it&#8217;s not required.' ) . '</p>\n\t<p>' . __( 'Enabling Accessibility Mode, via Screen Options, allows you to use Add and Edit buttons instead of using drag and drop.' ) . '</p>',\n\t)\n);\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'missing-widgets',\n\t\t'title'   => __( 'Missing Widgets' ),\n\t\t'content' =>\n\t\t\t\t'<p>' . __( 'Many themes show some sidebar widgets by default until you edit your sidebars, but they are not automatically displayed in your sidebar management tool. After you make your first widget change, you can re-add the default widgets by adding them from the Available Widgets area.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'When changing themes, there is often some variation in the number and setup of widget areas/sidebars and sometimes these conflicts make the transition a bit less smooth. If you changed themes and seem to be missing widgets, scroll down on this screen to the Inactive Widgets area, where all of your widgets and their settings will have been saved.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/appearance-widgets-screen/\">Documentation on Widgets</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nif ( ! current_theme_supports( 'widgets' ) ) {\n\twp_die( __( 'The theme you are currently using isn&#8217;t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please <a href=\"https://developer.wordpress.org/themes/functionality/widgets/\">follow these instructions</a>.' ) );\n}\n\n// These are the widgets grouped by sidebar.\n$sidebars_widgets = wp_get_sidebars_widgets();\n\nif ( empty( $sidebars_widgets ) ) {\n\t$sidebars_widgets = wp_get_widget_defaults();\n}\n\nforeach ( $sidebars_widgets as $sidebar_id => $widgets ) {\n\tif ( 'wp_inactive_widgets' === $sidebar_id ) {\n\t\tcontinue;\n\t}\n\n\tif ( ! is_registered_sidebar( $sidebar_id ) ) {\n\t\tif ( ! empty( $widgets ) ) { // Register the inactive_widgets area as sidebar.\n\t\t\tregister_sidebar(\n\t\t\t\tarray(\n\t\t\t\t\t'name'          => __( 'Inactive Sidebar (not used)' ),\n\t\t\t\t\t'id'            => $sidebar_id,\n\t\t\t\t\t'class'         => 'inactive-sidebar orphan-sidebar',\n\t\t\t\t\t'description'   => __( 'This sidebar is no longer available and does not show anywhere on your site. Remove each of the widgets below to fully remove this inactive sidebar.' ),\n\t\t\t\t\t'before_widget' => '',\n\t\t\t\t\t'after_widget'  => '',\n\t\t\t\t\t'before_title'  => '',\n\t\t\t\t\t'after_title'   => '',\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\tunset( $sidebars_widgets[ $sidebar_id ] );\n\t\t}\n\t}\n}\n\n// Register the inactive_widgets area as sidebar.\nregister_sidebar(\n\tarray(\n\t\t'name'          => __( 'Inactive Widgets' ),\n\t\t'id'            => 'wp_inactive_widgets',\n\t\t'class'         => 'inactive-sidebar',\n\t\t'description'   => __( 'Drag widgets here to remove them from the sidebar but keep their settings.' ),\n\t\t'before_widget' => '',\n\t\t'after_widget'  => '',\n\t\t'before_title'  => '',\n\t\t'after_title'   => '',\n\t)\n);\n\nretrieve_widgets();\n\n// We're saving a widget without JS.\nif ( isset( $_POST['savewidget'] ) || isset( $_POST['removewidget'] ) ) {\n\t$widget_id = $_POST['widget-id'];\n\tcheck_admin_referer( \"save-delete-widget-$widget_id\" );\n\n\t$number = isset( $_POST['multi_number'] ) ? (int) $_POST['multi_number'] : '';\n\tif ( $number ) {\n\t\tforeach ( $_POST as $key => $val ) {\n\t\t\tif ( is_array( $val ) && preg_match( '/__i__|%i%/', key( $val ) ) ) {\n\t\t\t\t$_POST[ $key ] = array( $number => array_shift( $val ) );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t$sidebar_id = $_POST['sidebar'];\n\t$position   = isset( $_POST[ $sidebar_id . '_position' ] ) ? (int) $_POST[ $sidebar_id . '_position' ] - 1 : 0;\n\n\t$id_base = $_POST['id_base'];\n\t$sidebar = isset( $sidebars_widgets[ $sidebar_id ] ) ? $sidebars_widgets[ $sidebar_id ] : array();\n\n\t// Delete.\n\tif ( isset( $_POST['removewidget'] ) && $_POST['removewidget'] ) {\n\n\t\tif ( ! in_array( $widget_id, $sidebar, true ) ) {\n\t\t\twp_redirect( admin_url( 'widgets.php?error=0' ) );\n\t\t\texit;\n\t\t}\n\n\t\t$sidebar = array_diff( $sidebar, array( $widget_id ) );\n\t\t$_POST   = array(\n\t\t\t'sidebar'            => $sidebar_id,\n\t\t\t'widget-' . $id_base => array(),\n\t\t\t'the-widget-id'      => $widget_id,\n\t\t\t'delete_widget'      => '1',\n\t\t);\n\n\t\t/**\n\t\t * Fires immediately after a widget has been marked for deletion.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string $widget_id  ID of the widget marked for deletion.\n\t\t * @param string $sidebar_id ID of the sidebar the widget was deleted from.\n\t\t * @param string $id_base    ID base for the widget.\n\t\t */\n\t\tdo_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );\n\t}\n\n\t$_POST['widget-id'] = $sidebar;\n\n\tforeach ( (array) $wp_registered_widget_updates as $name => $control ) {\n\t\tif ( $name !== $id_base || ! is_callable( $control['callback'] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tob_start();\n\t\t\tcall_user_func_array( $control['callback'], $control['params'] );\n\t\tob_end_clean();\n\n\t\tbreak;\n\t}\n\n\t$sidebars_widgets[ $sidebar_id ] = $sidebar;\n\n\t// Remove old position.\n\tif ( ! isset( $_POST['delete_widget'] ) ) {\n\t\tforeach ( $sidebars_widgets as $key => $sb ) {\n\t\t\tif ( is_array( $sb ) ) {\n\t\t\t\t$sidebars_widgets[ $key ] = array_diff( $sb, array( $widget_id ) );\n\t\t\t}\n\t\t}\n\t\tarray_splice( $sidebars_widgets[ $sidebar_id ], $position, 0, $widget_id );\n\t}\n\n\twp_set_sidebars_widgets( $sidebars_widgets );\n\twp_redirect( admin_url( 'widgets.php?message=0' ) );\n\texit;\n}\n\n// Remove inactive widgets without JS.\nif ( isset( $_POST['removeinactivewidgets'] ) ) {\n\tcheck_admin_referer( 'remove-inactive-widgets', '_wpnonce_remove_inactive_widgets' );\n\n\tif ( $_POST['removeinactivewidgets'] ) {\n\t\tforeach ( $sidebars_widgets['wp_inactive_widgets'] as $key => $widget_id ) {\n\t\t\t$pieces       = explode( '-', $widget_id );\n\t\t\t$multi_number = array_pop( $pieces );\n\t\t\t$id_base      = implode( '-', $pieces );\n\t\t\t$widget       = get_option( 'widget_' . $id_base );\n\t\t\tunset( $widget[ $multi_number ] );\n\t\t\tupdate_option( 'widget_' . $id_base, $widget );\n\t\t\tunset( $sidebars_widgets['wp_inactive_widgets'][ $key ] );\n\t\t}\n\n\t\twp_set_sidebars_widgets( $sidebars_widgets );\n\t}\n\n\twp_redirect( admin_url( 'widgets.php?message=0' ) );\n\texit;\n}\n\n// Output the widget form without JS.\nif ( isset( $_GET['editwidget'] ) && $_GET['editwidget'] ) {\n\t$widget_id = $_GET['editwidget'];\n\n\tif ( isset( $_GET['addnew'] ) ) {\n\t\t// Default to the first sidebar.\n\t\t$keys    = array_keys( $wp_registered_sidebars );\n\t\t$sidebar = reset( $keys );\n\n\t\tif ( isset( $_GET['base'] ) && isset( $_GET['num'] ) ) { // Multi-widget.\n\t\t\t// Copy minimal info from an existing instance of this widget to a new instance.\n\t\t\tforeach ( $wp_registered_widget_controls as $control ) {\n\t\t\t\tif ( $_GET['base'] === $control['id_base'] ) {\n\t\t\t\t\t$control_callback                                = $control['callback'];\n\t\t\t\t\t$multi_number                                    = (int) $_GET['num'];\n\t\t\t\t\t$control['params'][0]['number']                  = -1;\n\t\t\t\t\t$control['id']                                   = $control['id_base'] . '-' . $multi_number;\n\t\t\t\t\t$widget_id                                       = $control['id'];\n\t\t\t\t\t$wp_registered_widget_controls[ $control['id'] ] = $control;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( isset( $wp_registered_widget_controls[ $widget_id ] ) && ! isset( $control ) ) {\n\t\t$control          = $wp_registered_widget_controls[ $widget_id ];\n\t\t$control_callback = $control['callback'];\n\t} elseif ( ! isset( $wp_registered_widget_controls[ $widget_id ] ) && isset( $wp_registered_widgets[ $widget_id ] ) ) {\n\t\t$name = esc_html( strip_tags( $wp_registered_widgets[ $widget_id ]['name'] ) );\n\t}\n\n\tif ( ! isset( $name ) ) {\n\t\t$name = esc_html( strip_tags( $control['name'] ) );\n\t}\n\n\tif ( ! isset( $sidebar ) ) {\n\t\t$sidebar = isset( $_GET['sidebar'] ) ? $_GET['sidebar'] : 'wp_inactive_widgets';\n\t}\n\n\tif ( ! isset( $multi_number ) ) {\n\t\t$multi_number = isset( $control['params'][0]['number'] ) ? $control['params'][0]['number'] : '';\n\t}\n\n\t$id_base = isset( $control['id_base'] ) ? $control['id_base'] : $control['id'];\n\n\t// Show the widget form.\n\t$width = ' style=\"width:' . max( $control['width'], 350 ) . 'px\"';\n\t$key   = isset( $_GET['key'] ) ? (int) $_GET['key'] : 0;\n\n\trequire_once ABSPATH . 'wp-admin/admin-header.php'; ?>\n\t<div class=\"wrap\">\n\t<h1><?php echo esc_html( $title ); ?></h1>\n\t<div class=\"editwidget\"<?php echo $width; ?>>\n\t<h2>\n\t<?php\n\t/* translators: %s: Widget name. */\n\tprintf( __( 'Widget %s' ), $name );\n\t?>\n\t</h2>\n\n\t<form action=\"widgets.php\" method=\"post\">\n\t<div class=\"widget-inside\">\n\t<?php\n\tif ( is_callable( $control_callback ) ) {\n\t\tcall_user_func_array( $control_callback, $control['params'] );\n\t} else {\n\t\techo '<p>' . __( 'There are no options for this widget.' ) . \"</p>\\n\";\n\t}\n\t?>\n\t</div>\n\n\t<p class=\"describe\"><?php _e( 'Select both the sidebar for this widget and the position of the widget in that sidebar.' ); ?></p>\n\t<div class=\"widget-position\">\n\t<table class=\"widefat\"><thead><tr><th><?php _e( 'Sidebar' ); ?></th><th><?php _e( 'Position' ); ?></th></tr></thead><tbody>\n\t<?php\n\tforeach ( $wp_registered_sidebars as $sbname => $sbvalue ) {\n\t\techo \"\\t\\t<tr><td><label><input type='radio' name='sidebar' value='\" . esc_attr( $sbname ) . \"'\" . checked( $sbname, $sidebar, false ) . \" /> $sbvalue[name]</label></td><td>\";\n\t\tif ( 'wp_inactive_widgets' === $sbname || 'orphaned_widgets' === substr( $sbname, 0, 16 ) ) {\n\t\t\techo '&nbsp;';\n\t\t} else {\n\t\t\tif ( ! isset( $sidebars_widgets[ $sbname ] ) || ! is_array( $sidebars_widgets[ $sbname ] ) ) {\n\t\t\t\t$j                           = 1;\n\t\t\t\t$sidebars_widgets[ $sbname ] = array();\n\t\t\t} else {\n\t\t\t\t$j = count( $sidebars_widgets[ $sbname ] );\n\t\t\t\tif ( isset( $_GET['addnew'] ) || ! in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) {\n\t\t\t\t\t$j++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$selected = '';\n\t\t\techo \"\\t\\t<select name='{$sbname}_position'>\\n\";\n\t\t\techo \"\\t\\t<option value=''>\" . __( '&mdash; Select &mdash;' ) . \"</option>\\n\";\n\t\t\tfor ( $i = 1; $i <= $j; $i++ ) {\n\t\t\t\tif ( in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) {\n\t\t\t\t\t$selected = selected( $i, $key + 1, false );\n\t\t\t\t}\n\t\t\t\techo \"\\t\\t<option value='$i'$selected> $i </option>\\n\";\n\t\t\t}\n\t\t\techo \"\\t\\t</select>\\n\";\n\t\t}\n\t\techo \"</td></tr>\\n\";\n\t}\n\t?>\n\t</tbody></table>\n\t</div>\n\n\t<div class=\"widget-control-actions\">\n\t<?php\n\tif ( isset( $_GET['addnew'] ) ) {\n\t\t?>\n\t<a href=\"widgets.php\" class=\"button alignleft\"><?php _e( 'Cancel' ); ?></a>\n\t\t<?php\n\t} else {\n\t\tsubmit_button( __( 'Delete' ), 'alignleft', 'removewidget', false );\n\t}\n\tsubmit_button( __( 'Save Widget' ), 'primary alignright', 'savewidget', false );\n\t?>\n\t<input type=\"hidden\" name=\"widget-id\" class=\"widget-id\" value=\"<?php echo esc_attr( $widget_id ); ?>\" />\n\t<input type=\"hidden\" name=\"id_base\" class=\"id_base\" value=\"<?php echo esc_attr( $id_base ); ?>\" />\n\t<input type=\"hidden\" name=\"multi_number\" class=\"multi_number\" value=\"<?php echo esc_attr( $multi_number ); ?>\" />\n\t<?php\twp_nonce_field( \"save-delete-widget-$widget_id\" ); ?>\n\t<br class=\"clear\" />\n\t</div>\n\t</form>\n\t</div>\n\t</div>\n\t<?php\n\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\texit;\n}\n\n$messages = array(\n\t__( 'Changes saved.' ),\n);\n\n$errors = array(\n\t__( 'Error while saving.' ),\n\t__( 'Error in displaying the widget settings form.' ),\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n\n<div class=\"wrap\">\n<h1 class=\"wp-heading-inline\">\n<?php\necho esc_html( $title );\n?>\n</h1>\n\n<?php\nif ( current_user_can( 'customize' ) ) {\n\tprintf(\n\t\t' <a class=\"page-title-action hide-if-no-customize\" href=\"%1$s\">%2$s</a>',\n\t\tesc_url(\n\t\t\tadd_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\tarray( 'autofocus' => array( 'panel' => 'widgets' ) ),\n\t\t\t\t\t'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ),\n\t\t\t\t),\n\t\t\t\tadmin_url( 'customize.php' )\n\t\t\t)\n\t\t),\n\t\t__( 'Manage with Live Preview' )\n\t);\n}\n\n$nonce = wp_create_nonce( 'widgets-access' );\n?>\n<div class=\"widget-access-link\">\n\t<a id=\"access-on\" href=\"widgets.php?widgets-access=on&_wpnonce=<?php echo urlencode( $nonce ); ?>\"><?php _e( 'Enable accessibility mode' ); ?></a><a id=\"access-off\" href=\"widgets.php?widgets-access=off&_wpnonce=<?php echo urlencode( $nonce ); ?>\"><?php _e( 'Disable accessibility mode' ); ?></a>\n</div>\n\n<hr class=\"wp-header-end\">\n\n<?php if ( isset( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) { ?>\n<div id=\"message\" class=\"updated notice is-dismissible\"><p><?php echo $messages[ $_GET['message'] ]; ?></p></div>\n<?php } ?>\n<?php if ( isset( $_GET['error'] ) && isset( $errors[ $_GET['error'] ] ) ) { ?>\n<div id=\"message\" class=\"error\"><p><?php echo $errors[ $_GET['error'] ]; ?></p></div>\n<?php } ?>\n\n<?php\n/**\n * Fires before the Widgets administration page content loads.\n *\n * @since 3.0.0\n */\ndo_action( 'widgets_admin_page' );\n?>\n\n<div class=\"widget-liquid-left\">\n<div id=\"widgets-left\">\n\t<div id=\"available-widgets\" class=\"widgets-holder-wrap\">\n\t\t<div class=\"sidebar-name\">\n\t\t\t<button type=\"button\" class=\"handlediv hide-if-no-js\" aria-expanded=\"true\">\n\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Available Widgets' ); ?></span>\n\t\t\t\t<span class=\"toggle-indicator\" aria-hidden=\"true\"></span>\n\t\t\t</button>\n\t\t\t<h2><?php _e( 'Available Widgets' ); ?> <span id=\"removing-widget\"><?php _ex( 'Deactivate', 'removing-widget' ); ?> <span></span></span></h2>\n\t\t</div>\n\t\t<div class=\"widget-holder\">\n\t\t\t<div class=\"sidebar-description\">\n\t\t\t\t<p class=\"description\"><?php _e( 'To activate a widget drag it to a sidebar or click on it. To deactivate a widget and delete its settings, drag it back.' ); ?></p>\n\t\t\t</div>\n\t\t\t<div id=\"widget-list\">\n\t\t\t\t<?php wp_list_widgets(); ?>\n\t\t\t</div>\n\t\t\t<br class='clear' />\n\t\t</div>\n\t\t<br class=\"clear\" />\n\t</div>\n\n<?php\n\n$theme_sidebars = array();\nforeach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {\n\tif ( false !== strpos( $registered_sidebar['class'], 'inactive-sidebar' ) || 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) {\n\t\t$wrap_class = 'widgets-holder-wrap';\n\t\tif ( ! empty( $registered_sidebar['class'] ) ) {\n\t\t\t$wrap_class .= ' ' . $registered_sidebar['class'];\n\t\t}\n\n\t\t$is_inactive_widgets = 'wp_inactive_widgets' === $registered_sidebar['id'];\n\t\t?>\n\t\t<div class=\"<?php echo esc_attr( $wrap_class ); ?>\">\n\t\t\t<div class=\"widget-holder inactive\">\n\t\t\t\t<?php wp_list_widget_controls( $registered_sidebar['id'], $registered_sidebar['name'] ); ?>\n\n\t\t\t\t<?php if ( $is_inactive_widgets ) { ?>\n\t\t\t\t<div class=\"remove-inactive-widgets\">\n\t\t\t\t\t<form action=\"\" method=\"post\">\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$attributes = array( 'id' => 'inactive-widgets-control-remove' );\n\n\t\t\t\t\t\t\tif ( empty( $sidebars_widgets['wp_inactive_widgets'] ) ) {\n\t\t\t\t\t\t\t\t$attributes['disabled'] = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsubmit_button( __( 'Clear Inactive Widgets' ), 'delete', 'removeinactivewidgets', false, $attributes );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<?php wp_nonce_field( 'remove-inactive-widgets', '_wpnonce_remove_inactive_widgets' ); ?>\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t\t<?php } ?>\n\t\t\t</div>\n\t\t\t<?php if ( $is_inactive_widgets ) { ?>\n\t\t\t<p class=\"description\"><?php _e( 'This will clear all items from the inactive widgets list. You will not be able to restore any customizations.' ); ?></p>\n\t\t\t<?php } ?>\n\t\t</div>\n\t\t<?php\n\n\t} else {\n\t\t$theme_sidebars[ $sidebar ] = $registered_sidebar;\n\t}\n}\n\n?>\n</div>\n</div>\n<?php\n\n$i                    = 0;\n$split                = 0;\n$single_sidebar_class = '';\n$sidebars_count       = count( $theme_sidebars );\n\nif ( $sidebars_count > 1 ) {\n\t$split = (int) ceil( $sidebars_count / 2 );\n} else {\n\t$single_sidebar_class = ' single-sidebar';\n}\n\n?>\n<div class=\"widget-liquid-right\">\n<div id=\"widgets-right\" class=\"wp-clearfix<?php echo $single_sidebar_class; ?>\">\n<div class=\"sidebars-column-1\">\n<?php\n\nforeach ( $theme_sidebars as $sidebar => $registered_sidebar ) {\n\t$wrap_class = 'widgets-holder-wrap';\n\tif ( ! empty( $registered_sidebar['class'] ) ) {\n\t\t$wrap_class .= ' sidebar-' . $registered_sidebar['class'];\n\t}\n\n\tif ( $i > 0 ) {\n\t\t$wrap_class .= ' closed';\n\t}\n\n\tif ( $split && $i === $split ) {\n\t\t?>\n\t\t</div><div class=\"sidebars-column-2\">\n\t\t<?php\n\t}\n\n\t?>\n\t<div class=\"<?php echo esc_attr( $wrap_class ); ?>\">\n\t\t<?php\n\t\t// Show the control forms for each of the widgets in this sidebar.\n\t\twp_list_widget_controls( $sidebar, $registered_sidebar['name'] );\n\t\t?>\n\t</div>\n\t<?php\n\n\t$i++;\n}\n\n?>\n</div>\n</div>\n</div>\n<form method=\"post\">\n<?php wp_nonce_field( 'save-sidebar-widgets', '_wpnonce_widgets', false ); ?>\n</form>\n<br class=\"clear\" />\n</div>\n\n<div class=\"widgets-chooser\">\n\t<ul class=\"widgets-chooser-sidebars\"></ul>\n\t<div class=\"widgets-chooser-actions\">\n\t\t<button class=\"button widgets-chooser-cancel\"><?php _e( 'Cancel' ); ?></button>\n\t\t<button class=\"button button-primary widgets-chooser-add\"><?php _e( 'Add Widget' ); ?></button>\n\t</div>\n</div>\n\n<?php\n\n/**\n * Fires after the available widgets and sidebars have loaded, before the admin footer.\n *\n * @since 2.2.0\n */\ndo_action( 'sidebar_admin_page' );\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 579}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Administration API: Default admin hooks\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.3.0\n */\n\n// Bookmark hooks.\nadd_action( 'admin_page_access_denied', 'wp_link_manager_disabled_message' );\n\n// Dashboard hooks.\nadd_action( 'activity_box_end', 'wp_dashboard_quota' );\n\n// Media hooks.\nadd_action( 'attachment_submitbox_misc_actions', 'attachment_submitbox_metadata' );\nadd_filter( 'plupload_init', 'wp_show_heic_upload_error' );\n\nadd_action( 'media_upload_image', 'wp_media_upload_handler' );\nadd_action( 'media_upload_audio', 'wp_media_upload_handler' );\nadd_action( 'media_upload_video', 'wp_media_upload_handler' );\nadd_action( 'media_upload_file', 'wp_media_upload_handler' );\n\nadd_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' );\n\nadd_action( 'post-html-upload-ui', 'media_upload_html_bypass' );\n\nadd_filter( 'async_upload_image', 'get_media_item', 10, 2 );\nadd_filter( 'async_upload_audio', 'get_media_item', 10, 2 );\nadd_filter( 'async_upload_video', 'get_media_item', 10, 2 );\nadd_filter( 'async_upload_file', 'get_media_item', 10, 2 );\n\nadd_filter( 'attachment_fields_to_save', 'image_attachment_fields_to_save', 10, 2 );\n\nadd_filter( 'media_upload_gallery', 'media_upload_gallery' );\nadd_filter( 'media_upload_library', 'media_upload_library' );\n\nadd_filter( 'media_upload_tabs', 'update_gallery_tab' );\n\n// Misc hooks.\nadd_action( 'admin_init', 'wp_admin_headers' );\nadd_action( 'login_init', 'wp_admin_headers' );\nadd_action( 'admin_head', 'wp_admin_canonical_url' );\nadd_action( 'admin_head', 'wp_color_scheme_settings' );\nadd_action( 'admin_head', 'wp_site_icon' );\nadd_action( 'admin_head', 'wp_admin_viewport_meta' );\nadd_action( 'customize_controls_head', 'wp_admin_viewport_meta' );\n\n// Prerendering.\nif ( ! is_customize_preview() ) {\n\tadd_filter( 'admin_print_styles', 'wp_resource_hints', 1 );\n}\n\nadd_action( 'admin_print_scripts-post.php', 'wp_page_reload_on_back_button_js' );\nadd_action( 'admin_print_scripts-post-new.php', 'wp_page_reload_on_back_button_js' );\n\nadd_action( 'update_option_home', 'update_home_siteurl', 10, 2 );\nadd_action( 'update_option_siteurl', 'update_home_siteurl', 10, 2 );\nadd_action( 'update_option_page_on_front', 'update_home_siteurl', 10, 2 );\nadd_action( 'update_option_admin_email', 'wp_site_admin_email_change_notification', 10, 3 );\n\nadd_action( 'add_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );\nadd_action( 'update_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );\n\nadd_filter( 'heartbeat_received', 'wp_check_locked_posts', 10, 3 );\nadd_filter( 'heartbeat_received', 'wp_refresh_post_lock', 10, 3 );\nadd_filter( 'heartbeat_received', 'heartbeat_autosave', 500, 2 );\n\nadd_filter( 'wp_refresh_nonces', 'wp_refresh_post_nonces', 10, 3 );\nadd_filter( 'wp_refresh_nonces', 'wp_refresh_heartbeat_nonces' );\n\nadd_filter( 'heartbeat_settings', 'wp_heartbeat_set_suspension' );\n\n// Nav Menu hooks.\nadd_action( 'admin_head-nav-menus.php', '_wp_delete_orphaned_draft_menu_items' );\n\n// Plugin hooks.\nadd_filter( 'allowed_options', 'option_update_filter' );\n\n// Plugin Install hooks.\nadd_action( 'install_plugins_featured', 'install_dashboard' );\nadd_action( 'install_plugins_upload', 'install_plugins_upload' );\nadd_action( 'install_plugins_search', 'display_plugins_table' );\nadd_action( 'install_plugins_popular', 'display_plugins_table' );\nadd_action( 'install_plugins_recommended', 'display_plugins_table' );\nadd_action( 'install_plugins_new', 'display_plugins_table' );\nadd_action( 'install_plugins_beta', 'display_plugins_table' );\nadd_action( 'install_plugins_favorites', 'display_plugins_table' );\nadd_action( 'install_plugins_pre_plugin-information', 'install_plugin_information' );\n\n// Template hooks.\nadd_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts' ) );\nadd_action( 'user_register', array( 'WP_Internal_Pointers', 'dismiss_pointers_for_new_users' ) );\n\n// Theme hooks.\nadd_action( 'customize_controls_print_footer_scripts', 'customize_themes_print_templates' );\n\n// Theme Install hooks.\nadd_action( 'install_themes_pre_theme-information', 'install_theme_information' );\n\n// User hooks.\nadd_action( 'admin_init', 'default_password_nag_handler' );\n\nadd_action( 'admin_notices', 'default_password_nag' );\nadd_action( 'admin_notices', 'new_user_email_admin_notice' );\n\nadd_action( 'profile_update', 'default_password_nag_edit_user', 10, 2 );\n\nadd_action( 'personal_options_update', 'send_confirmation_on_profile_email' );\n\n// Update hooks.\nadd_action( 'load-plugins.php', 'wp_plugin_update_rows', 20 ); // After wp_update_plugins() is called.\nadd_action( 'load-themes.php', 'wp_theme_update_rows', 20 ); // After wp_update_themes() is called.\n\nadd_action( 'admin_notices', 'update_nag', 3 );\nadd_action( 'admin_notices', 'paused_plugins_notice', 5 );\nadd_action( 'admin_notices', 'paused_themes_notice', 5 );\nadd_action( 'admin_notices', 'maintenance_nag', 10 );\nadd_action( 'admin_notices', 'wp_recovery_mode_nag', 1 );\n\nadd_filter( 'update_footer', 'core_update_footer' );\n\n// Update Core hooks.\nadd_action( '_core_updated_successfully', '_redirect_to_about_wordpress' );\n\n// Upgrade hooks.\nadd_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );\nadd_action( 'upgrader_process_complete', 'wp_version_check', 10, 0 );\nadd_action( 'upgrader_process_complete', 'wp_update_plugins', 10, 0 );\nadd_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 );\n\n// Privacy hooks.\nadd_filter( 'wp_privacy_personal_data_erasure_page', 'wp_privacy_process_personal_data_erasure_page', 10, 5 );\nadd_filter( 'wp_privacy_personal_data_export_page', 'wp_privacy_process_personal_data_export_page', 10, 7 );\nadd_action( 'wp_privacy_personal_data_export_file', 'wp_privacy_generate_personal_data_export_file', 10 );\nadd_action( 'wp_privacy_personal_data_erased', '_wp_privacy_send_erasure_fulfillment_notification', 10 );\n\n// Privacy policy text changes check.\nadd_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'text_change_check' ), 100 );\n\n// Show a \"postbox\" with the text suggestions for a privacy policy.\nadd_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'notice' ) );\n\n// Add the suggested policy text from WordPress.\nadd_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'add_suggested_content' ), 1 );\n\n// Update the cached policy info when the policy page is updated.\nadd_action( 'post_updated', array( 'WP_Privacy_Policy_Content', '_policy_page_updated' ) );\n\n// Append '(Draft)' to draft page titles in the privacy page dropdown.\nadd_filter( 'list_pages', '_wp_privacy_settings_filter_draft_page_titles', 10, 2 );\n", "num_lines": 153}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Core Administration API\n *\n * @package WordPress\n * @subpackage Administration\n * @since 2.3.0\n */\n\nif ( ! defined( 'WP_ADMIN' ) ) {\n\t/*\n\t * This file is being included from a file other than wp-admin/admin.php, so\n\t * some setup was skipped. Make sure the admin message catalog is loaded since\n\t * load_default_textdomain() will not have done so in this context.\n\t */\n\tload_textdomain( 'default', WP_LANG_DIR . '/admin-' . get_locale() . '.mo' );\n}\n\n/** WordPress Administration Hooks */\nrequire_once ABSPATH . 'wp-admin/includes/admin-filters.php';\n\n/** WordPress Bookmark Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/bookmark.php';\n\n/** WordPress Comment Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/comment.php';\n\n/** WordPress Administration File API */\nrequire_once ABSPATH . 'wp-admin/includes/file.php';\n\n/** WordPress Image Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/image.php';\n\n/** WordPress Media Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/media.php';\n\n/** WordPress Import Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/import.php';\n\n/** WordPress Misc Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/misc.php';\n\n/** WordPress Misc Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php';\n\n/** WordPress Options Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/options.php';\n\n/** WordPress Plugin Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\n/** WordPress Post Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/post.php';\n\n/** WordPress Administration Screen API */\nrequire_once ABSPATH . 'wp-admin/includes/class-wp-screen.php';\nrequire_once ABSPATH . 'wp-admin/includes/screen.php';\n\n/** WordPress Taxonomy Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/taxonomy.php';\n\n/** WordPress Template Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/template.php';\n\n/** WordPress List Table Administration API and base class */\nrequire_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';\nrequire_once ABSPATH . 'wp-admin/includes/class-wp-list-table-compat.php';\nrequire_once ABSPATH . 'wp-admin/includes/list-table.php';\n\n/** WordPress Theme Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/theme.php';\n\n/** WordPress Privacy Functions */\nrequire_once ABSPATH . 'wp-admin/includes/privacy-tools.php';\n\n/** WordPress Privacy List Table classes. */\n// Previously in wp-admin/includes/user.php. Need to be loaded for backward compatibility.\nrequire_once ABSPATH . 'wp-admin/includes/class-wp-privacy-requests-table.php';\nrequire_once ABSPATH . 'wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php';\nrequire_once ABSPATH . 'wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php';\n\n/** WordPress User Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/user.php';\n\n/** WordPress Site Icon API */\nrequire_once ABSPATH . 'wp-admin/includes/class-wp-site-icon.php';\n\n/** WordPress Update Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/update.php';\n\n/** WordPress Deprecated Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/deprecated.php';\n\n/** WordPress Multisite support API */\nif ( is_multisite() ) {\n\trequire_once ABSPATH . 'wp-admin/includes/ms-admin-filters.php';\n\trequire_once ABSPATH . 'wp-admin/includes/ms.php';\n\trequire_once ABSPATH . 'wp-admin/includes/ms-deprecated.php';\n}\n", "num_lines": 100}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Administration API: Core Ajax handlers\n *\n * @package WordPress\n * @subpackage Administration\n * @since 2.1.0\n */\n\n//\n// No-privilege Ajax handlers.\n//\n\n/**\n * Ajax handler for the Heartbeat API in\n * the no-privilege context.\n *\n * Runs when the user is not logged in.\n *\n * @since 3.6.0\n */\nfunction wp_ajax_nopriv_heartbeat() {\n\t$response = array();\n\n\t// 'screen_id' is the same as $current_screen->id and the JS global 'pagenow'.\n\tif ( ! empty( $_POST['screen_id'] ) ) {\n\t\t$screen_id = sanitize_key( $_POST['screen_id'] );\n\t} else {\n\t\t$screen_id = 'front';\n\t}\n\n\tif ( ! empty( $_POST['data'] ) ) {\n\t\t$data = wp_unslash( (array) $_POST['data'] );\n\n\t\t/**\n\t\t * Filters Heartbeat Ajax response in no-privilege environments.\n\t\t *\n\t\t * @since 3.6.0\n\t\t *\n\t\t * @param array  $response  The no-priv Heartbeat response.\n\t\t * @param array  $data      The $_POST data sent.\n\t\t * @param string $screen_id The screen ID.\n\t\t */\n\t\t$response = apply_filters( 'heartbeat_nopriv_received', $response, $data, $screen_id );\n\t}\n\n\t/**\n\t * Filters Heartbeat Ajax response in no-privilege environments when no data is passed.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param array  $response  The no-priv Heartbeat response.\n\t * @param string $screen_id The screen ID.\n\t */\n\t$response = apply_filters( 'heartbeat_nopriv_send', $response, $screen_id );\n\n\t/**\n\t * Fires when Heartbeat ticks in no-privilege environments.\n\t *\n\t * Allows the transport to be easily replaced with long-polling.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param array  $response  The no-priv Heartbeat response.\n\t * @param string $screen_id The screen ID.\n\t */\n\tdo_action( 'heartbeat_nopriv_tick', $response, $screen_id );\n\n\t// Send the current time according to the server.\n\t$response['server_time'] = time();\n\n\twp_send_json( $response );\n}\n\n//\n// GET-based Ajax handlers.\n//\n\n/**\n * Ajax handler for fetching a list table.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_fetch_list() {\n\t$list_class = $_GET['list_args']['class'];\n\tcheck_ajax_referer( \"fetch-list-$list_class\", '_ajax_fetch_list_nonce' );\n\n\t$wp_list_table = _get_list_table( $list_class, array( 'screen' => $_GET['list_args']['screen']['id'] ) );\n\tif ( ! $wp_list_table ) {\n\t\twp_die( 0 );\n\t}\n\n\tif ( ! $wp_list_table->ajax_user_can() ) {\n\t\twp_die( -1 );\n\t}\n\n\t$wp_list_table->ajax_response();\n\n\twp_die( 0 );\n}\n\n/**\n * Ajax handler for tag search.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_ajax_tag_search() {\n\tif ( ! isset( $_GET['tax'] ) ) {\n\t\twp_die( 0 );\n\t}\n\n\t$taxonomy = sanitize_key( $_GET['tax'] );\n\t$tax      = get_taxonomy( $taxonomy );\n\n\tif ( ! $tax ) {\n\t\twp_die( 0 );\n\t}\n\n\tif ( ! current_user_can( $tax->cap->assign_terms ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t$s = wp_unslash( $_GET['q'] );\n\n\t$comma = _x( ',', 'tag delimiter' );\n\tif ( ',' !== $comma ) {\n\t\t$s = str_replace( $comma, ',', $s );\n\t}\n\n\tif ( false !== strpos( $s, ',' ) ) {\n\t\t$s = explode( ',', $s );\n\t\t$s = $s[ count( $s ) - 1 ];\n\t}\n\n\t$s = trim( $s );\n\n\t/**\n\t * Filters the minimum number of characters required to fire a tag search via Ajax.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param int         $characters The minimum number of characters required. Default 2.\n\t * @param WP_Taxonomy $tax        The taxonomy object.\n\t * @param string      $s          The search term.\n\t */\n\t$term_search_min_chars = (int) apply_filters( 'term_search_min_chars', 2, $tax, $s );\n\n\t/*\n\t * Require $term_search_min_chars chars for matching (default: 2)\n\t * ensure it's a non-negative, non-zero integer.\n\t */\n\tif ( ( 0 == $term_search_min_chars ) || ( strlen( $s ) < $term_search_min_chars ) ) {\n\t\twp_die();\n\t}\n\n\t$results = get_terms(\n\t\tarray(\n\t\t\t'taxonomy'   => $taxonomy,\n\t\t\t'name__like' => $s,\n\t\t\t'fields'     => 'names',\n\t\t\t'hide_empty' => false,\n\t\t)\n\t);\n\n\techo join( \"\\n\", $results );\n\twp_die();\n}\n\n/**\n * Ajax handler for compression testing.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_wp_compression_test() {\n\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\twp_die( -1 );\n\t}\n\n\tif ( ini_get( 'zlib.output_compression' ) || 'ob_gzhandler' === ini_get( 'output_handler' ) ) {\n\t\tupdate_site_option( 'can_compress_scripts', 0 );\n\t\twp_die( 0 );\n\t}\n\n\tif ( isset( $_GET['test'] ) ) {\n\t\theader( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );\n\t\theader( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );\n\t\theader( 'Cache-Control: no-cache, must-revalidate, max-age=0' );\n\t\theader( 'Content-Type: application/javascript; charset=UTF-8' );\n\t\t$force_gzip = ( defined( 'ENFORCE_GZIP' ) && ENFORCE_GZIP );\n\t\t$test_str   = '\"wpCompressionTest Lorem ipsum dolor sit amet consectetuer mollis sapien urna ut a. Eu nonummy condimentum fringilla tempor pretium platea vel nibh netus Maecenas. Hac molestie amet justo quis pellentesque est ultrices interdum nibh Morbi. Cras mattis pretium Phasellus ante ipsum ipsum ut sociis Suspendisse Lorem. Ante et non molestie. Porta urna Vestibulum egestas id congue nibh eu risus gravida sit. Ac augue auctor Ut et non a elit massa id sodales. Elit eu Nulla at nibh adipiscing mattis lacus mauris at tempus. Netus nibh quis suscipit nec feugiat eget sed lorem et urna. Pellentesque lacus at ut massa consectetuer ligula ut auctor semper Pellentesque. Ut metus massa nibh quam Curabitur molestie nec mauris congue. Volutpat molestie elit justo facilisis neque ac risus Ut nascetur tristique. Vitae sit lorem tellus et quis Phasellus lacus tincidunt nunc Fusce. Pharetra wisi Suspendisse mus sagittis libero lacinia Integer consequat ac Phasellus. Et urna ac cursus tortor aliquam Aliquam amet tellus volutpat Vestibulum. Justo interdum condimentum In augue congue tellus sollicitudin Quisque quis nibh.\"';\n\n\t\tif ( 1 == $_GET['test'] ) {\n\t\t\techo $test_str;\n\t\t\twp_die();\n\t\t} elseif ( 2 == $_GET['test'] ) {\n\t\t\tif ( ! isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) {\n\t\t\t\twp_die( -1 );\n\t\t\t}\n\n\t\t\tif ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate' ) && function_exists( 'gzdeflate' ) && ! $force_gzip ) {\n\t\t\t\theader( 'Content-Encoding: deflate' );\n\t\t\t\t$out = gzdeflate( $test_str, 1 );\n\t\t\t} elseif ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && function_exists( 'gzencode' ) ) {\n\t\t\t\theader( 'Content-Encoding: gzip' );\n\t\t\t\t$out = gzencode( $test_str, 1 );\n\t\t\t} else {\n\t\t\t\twp_die( -1 );\n\t\t\t}\n\n\t\t\techo $out;\n\t\t\twp_die();\n\t\t} elseif ( 'no' === $_GET['test'] ) {\n\t\t\tcheck_ajax_referer( 'update_can_compress_scripts' );\n\t\t\tupdate_site_option( 'can_compress_scripts', 0 );\n\t\t} elseif ( 'yes' === $_GET['test'] ) {\n\t\t\tcheck_ajax_referer( 'update_can_compress_scripts' );\n\t\t\tupdate_site_option( 'can_compress_scripts', 1 );\n\t\t}\n\t}\n\n\twp_die( 0 );\n}\n\n/**\n * Ajax handler for image editor previews.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_imgedit_preview() {\n\t$post_id = intval( $_GET['postid'] );\n\tif ( empty( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) {\n\t\twp_die( -1 );\n\t}\n\n\tcheck_ajax_referer( \"image_editor-$post_id\" );\n\n\tinclude_once ABSPATH . 'wp-admin/includes/image-edit.php';\n\n\tif ( ! stream_preview_image( $post_id ) ) {\n\t\twp_die( -1 );\n\t}\n\n\twp_die();\n}\n\n/**\n * Ajax handler for oEmbed caching.\n *\n * @since 3.1.0\n *\n * @global WP_Embed $wp_embed\n */\nfunction wp_ajax_oembed_cache() {\n\t$GLOBALS['wp_embed']->cache_oembed( $_GET['post'] );\n\twp_die( 0 );\n}\n\n/**\n * Ajax handler for user autocomplete.\n *\n * @since 3.4.0\n */\nfunction wp_ajax_autocomplete_user() {\n\tif ( ! is_multisite() || ! current_user_can( 'promote_users' ) || wp_is_large_network( 'users' ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t/** This filter is documented in wp-admin/user-new.php */\n\tif ( ! current_user_can( 'manage_network_users' ) && ! apply_filters( 'autocomplete_users_for_site_admins', false ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t$return = array();\n\n\t// Check the type of request.\n\t// Current allowed values are `add` and `search`.\n\tif ( isset( $_REQUEST['autocomplete_type'] ) && 'search' === $_REQUEST['autocomplete_type'] ) {\n\t\t$type = $_REQUEST['autocomplete_type'];\n\t} else {\n\t\t$type = 'add';\n\t}\n\n\t// Check the desired field for value.\n\t// Current allowed values are `user_email` and `user_login`.\n\tif ( isset( $_REQUEST['autocomplete_field'] ) && 'user_email' === $_REQUEST['autocomplete_field'] ) {\n\t\t$field = $_REQUEST['autocomplete_field'];\n\t} else {\n\t\t$field = 'user_login';\n\t}\n\n\t// Exclude current users of this blog.\n\tif ( isset( $_REQUEST['site_id'] ) ) {\n\t\t$id = absint( $_REQUEST['site_id'] );\n\t} else {\n\t\t$id = get_current_blog_id();\n\t}\n\n\t$include_blog_users = ( 'search' === $type ? get_users(\n\t\tarray(\n\t\t\t'blog_id' => $id,\n\t\t\t'fields'  => 'ID',\n\t\t)\n\t) : array() );\n\n\t$exclude_blog_users = ( 'add' === $type ? get_users(\n\t\tarray(\n\t\t\t'blog_id' => $id,\n\t\t\t'fields'  => 'ID',\n\t\t)\n\t) : array() );\n\n\t$users = get_users(\n\t\tarray(\n\t\t\t'blog_id'        => false,\n\t\t\t'search'         => '*' . $_REQUEST['term'] . '*',\n\t\t\t'include'        => $include_blog_users,\n\t\t\t'exclude'        => $exclude_blog_users,\n\t\t\t'search_columns' => array( 'user_login', 'user_nicename', 'user_email' ),\n\t\t)\n\t);\n\n\tforeach ( $users as $user ) {\n\t\t$return[] = array(\n\t\t\t/* translators: 1: User login, 2: User email address. */\n\t\t\t'label' => sprintf( _x( '%1$s (%2$s)', 'user autocomplete result' ), $user->user_login, $user->user_email ),\n\t\t\t'value' => $user->$field,\n\t\t);\n\t}\n\n\twp_die( wp_json_encode( $return ) );\n}\n\n/**\n * Handles Ajax requests for community events\n *\n * @since 4.8.0\n */\nfunction wp_ajax_get_community_events() {\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-community-events.php';\n\n\tcheck_ajax_referer( 'community_events' );\n\n\t$search         = isset( $_POST['location'] ) ? wp_unslash( $_POST['location'] ) : '';\n\t$timezone       = isset( $_POST['timezone'] ) ? wp_unslash( $_POST['timezone'] ) : '';\n\t$user_id        = get_current_user_id();\n\t$saved_location = get_user_option( 'community-events-location', $user_id );\n\t$events_client  = new WP_Community_Events( $user_id, $saved_location );\n\t$events         = $events_client->get_events( $search, $timezone );\n\t$ip_changed     = false;\n\n\tif ( is_wp_error( $events ) ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'error' => $events->get_error_message(),\n\t\t\t)\n\t\t);\n\t} else {\n\t\tif ( empty( $saved_location['ip'] ) && ! empty( $events['location']['ip'] ) ) {\n\t\t\t$ip_changed = true;\n\t\t} elseif ( isset( $saved_location['ip'] ) && ! empty( $events['location']['ip'] ) && $saved_location['ip'] !== $events['location']['ip'] ) {\n\t\t\t$ip_changed = true;\n\t\t}\n\n\t\t/*\n\t\t * The location should only be updated when it changes. The API doesn't always return\n\t\t * a full location; sometimes it's missing the description or country. The location\n\t\t * that was saved during the initial request is known to be good and complete, though.\n\t\t * It should be left intact until the user explicitly changes it (either by manually\n\t\t * searching for a new location, or by changing their IP address).\n\t\t *\n\t\t * If the location was updated with an incomplete response from the API, then it could\n\t\t * break assumptions that the UI makes (e.g., that there will always be a description\n\t\t * that corresponds to a latitude/longitude location).\n\t\t *\n\t\t * The location is stored network-wide, so that the user doesn't have to set it on each site.\n\t\t */\n\t\tif ( $ip_changed || $search ) {\n\t\t\tupdate_user_option( $user_id, 'community-events-location', $events['location'], true );\n\t\t}\n\n\t\twp_send_json_success( $events );\n\t}\n}\n\n/**\n * Ajax handler for dashboard widgets.\n *\n * @since 3.4.0\n */\nfunction wp_ajax_dashboard_widgets() {\n\trequire_once ABSPATH . 'wp-admin/includes/dashboard.php';\n\n\t$pagenow = $_GET['pagenow'];\n\tif ( 'dashboard-user' === $pagenow || 'dashboard-network' === $pagenow || 'dashboard' === $pagenow ) {\n\t\tset_current_screen( $pagenow );\n\t}\n\n\tswitch ( $_GET['widget'] ) {\n\t\tcase 'dashboard_primary':\n\t\t\twp_dashboard_primary();\n\t\t\tbreak;\n\t}\n\twp_die();\n}\n\n/**\n * Ajax handler for Customizer preview logged-in status.\n *\n * @since 3.4.0\n */\nfunction wp_ajax_logged_in() {\n\twp_die( 1 );\n}\n\n//\n// Ajax helpers.\n//\n\n/**\n * Sends back current comment total and new page links if they need to be updated.\n *\n * Contrary to normal success Ajax response (\"1\"), die with time() on success.\n *\n * @since 2.7.0\n * @access private\n *\n * @param int $comment_id\n * @param int $delta\n */\nfunction _wp_ajax_delete_comment_response( $comment_id, $delta = -1 ) {\n\t$total    = isset( $_POST['_total'] ) ? (int) $_POST['_total'] : 0;\n\t$per_page = isset( $_POST['_per_page'] ) ? (int) $_POST['_per_page'] : 0;\n\t$page     = isset( $_POST['_page'] ) ? (int) $_POST['_page'] : 0;\n\t$url      = isset( $_POST['_url'] ) ? esc_url_raw( $_POST['_url'] ) : '';\n\n\t// JS didn't send us everything we need to know. Just die with success message.\n\tif ( ! $total || ! $per_page || ! $page || ! $url ) {\n\t\t$time           = time();\n\t\t$comment        = get_comment( $comment_id );\n\t\t$comment_status = '';\n\t\t$comment_link   = '';\n\n\t\tif ( $comment ) {\n\t\t\t$comment_status = $comment->comment_approved;\n\t\t}\n\n\t\tif ( 1 === (int) $comment_status ) {\n\t\t\t$comment_link = get_comment_link( $comment );\n\t\t}\n\n\t\t$counts = wp_count_comments();\n\n\t\t$x = new WP_Ajax_Response(\n\t\t\tarray(\n\t\t\t\t'what'         => 'comment',\n\t\t\t\t// Here for completeness - not used.\n\t\t\t\t'id'           => $comment_id,\n\t\t\t\t'supplemental' => array(\n\t\t\t\t\t'status'               => $comment_status,\n\t\t\t\t\t'postId'               => $comment ? $comment->comment_post_ID : '',\n\t\t\t\t\t'time'                 => $time,\n\t\t\t\t\t'in_moderation'        => $counts->moderated,\n\t\t\t\t\t'i18n_comments_text'   => sprintf(\n\t\t\t\t\t\t/* translators: %s: Number of comments. */\n\t\t\t\t\t\t_n( '%s Comment', '%s Comments', $counts->approved ),\n\t\t\t\t\t\tnumber_format_i18n( $counts->approved )\n\t\t\t\t\t),\n\t\t\t\t\t'i18n_moderation_text' => sprintf(\n\t\t\t\t\t\t/* translators: %s: Number of comments. */\n\t\t\t\t\t\t_n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),\n\t\t\t\t\t\tnumber_format_i18n( $counts->moderated )\n\t\t\t\t\t),\n\t\t\t\t\t'comment_link'         => $comment_link,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t\t$x->send();\n\t}\n\n\t$total += $delta;\n\tif ( $total < 0 ) {\n\t\t$total = 0;\n\t}\n\n\t// Only do the expensive stuff on a page-break, and about 1 other time per page.\n\tif ( 0 == $total % $per_page || 1 == mt_rand( 1, $per_page ) ) {\n\t\t$post_id = 0;\n\t\t// What type of comment count are we looking for?\n\t\t$status = 'all';\n\t\t$parsed = parse_url( $url );\n\n\t\tif ( isset( $parsed['query'] ) ) {\n\t\t\tparse_str( $parsed['query'], $query_vars );\n\n\t\t\tif ( ! empty( $query_vars['comment_status'] ) ) {\n\t\t\t\t$status = $query_vars['comment_status'];\n\t\t\t}\n\n\t\t\tif ( ! empty( $query_vars['p'] ) ) {\n\t\t\t\t$post_id = (int) $query_vars['p'];\n\t\t\t}\n\n\t\t\tif ( ! empty( $query_vars['comment_type'] ) ) {\n\t\t\t\t$type = $query_vars['comment_type'];\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $type ) ) {\n\t\t\t// Only use the comment count if not filtering by a comment_type.\n\t\t\t$comment_count = wp_count_comments( $post_id );\n\n\t\t\t// We're looking for a known type of comment count.\n\t\t\tif ( isset( $comment_count->$status ) ) {\n\t\t\t\t$total = $comment_count->$status;\n\t\t\t}\n\t\t}\n\t\t// Else use the decremented value from above.\n\t}\n\n\t// The time since the last comment count.\n\t$time    = time();\n\t$comment = get_comment( $comment_id );\n\t$counts  = wp_count_comments();\n\n\t$x = new WP_Ajax_Response(\n\t\tarray(\n\t\t\t'what'         => 'comment',\n\t\t\t'id'           => $comment_id,\n\t\t\t'supplemental' => array(\n\t\t\t\t'status'               => $comment ? $comment->comment_approved : '',\n\t\t\t\t'postId'               => $comment ? $comment->comment_post_ID : '',\n\t\t\t\t/* translators: %s: Number of comments. */\n\t\t\t\t'total_items_i18n'     => sprintf( _n( '%s item', '%s items', $total ), number_format_i18n( $total ) ),\n\t\t\t\t'total_pages'          => ceil( $total / $per_page ),\n\t\t\t\t'total_pages_i18n'     => number_format_i18n( ceil( $total / $per_page ) ),\n\t\t\t\t'total'                => $total,\n\t\t\t\t'time'                 => $time,\n\t\t\t\t'in_moderation'        => $counts->moderated,\n\t\t\t\t'i18n_moderation_text' => sprintf(\n\t\t\t\t\t/* translators: %s: Number of comments. */\n\t\t\t\t\t_n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),\n\t\t\t\t\tnumber_format_i18n( $counts->moderated )\n\t\t\t\t),\n\t\t\t),\n\t\t)\n\t);\n\t$x->send();\n}\n\n//\n// POST-based Ajax handlers.\n//\n\n/**\n * Ajax handler for adding a hierarchical term.\n *\n * @since 3.1.0\n * @access private\n */\nfunction _wp_ajax_add_hierarchical_term() {\n\t$action   = $_POST['action'];\n\t$taxonomy = get_taxonomy( substr( $action, 4 ) );\n\tcheck_ajax_referer( $action, '_ajax_nonce-add-' . $taxonomy->name );\n\n\tif ( ! current_user_can( $taxonomy->cap->edit_terms ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t$names  = explode( ',', $_POST[ 'new' . $taxonomy->name ] );\n\t$parent = isset( $_POST[ 'new' . $taxonomy->name . '_parent' ] ) ? (int) $_POST[ 'new' . $taxonomy->name . '_parent' ] : 0;\n\n\tif ( 0 > $parent ) {\n\t\t$parent = 0;\n\t}\n\n\tif ( 'category' === $taxonomy->name ) {\n\t\t$post_category = isset( $_POST['post_category'] ) ? (array) $_POST['post_category'] : array();\n\t} else {\n\t\t$post_category = ( isset( $_POST['tax_input'] ) && isset( $_POST['tax_input'][ $taxonomy->name ] ) ) ? (array) $_POST['tax_input'][ $taxonomy->name ] : array();\n\t}\n\n\t$checked_categories = array_map( 'absint', (array) $post_category );\n\t$popular_ids        = wp_popular_terms_checklist( $taxonomy->name, 0, 10, false );\n\n\tforeach ( $names as $cat_name ) {\n\t\t$cat_name          = trim( $cat_name );\n\t\t$category_nicename = sanitize_title( $cat_name );\n\n\t\tif ( '' === $category_nicename ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$cat_id = wp_insert_term( $cat_name, $taxonomy->name, array( 'parent' => $parent ) );\n\n\t\tif ( ! $cat_id || is_wp_error( $cat_id ) ) {\n\t\t\tcontinue;\n\t\t} else {\n\t\t\t$cat_id = $cat_id['term_id'];\n\t\t}\n\n\t\t$checked_categories[] = $cat_id;\n\n\t\tif ( $parent ) { // Do these all at once in a second.\n\t\t\tcontinue;\n\t\t}\n\n\t\tob_start();\n\n\t\twp_terms_checklist(\n\t\t\t0,\n\t\t\tarray(\n\t\t\t\t'taxonomy'             => $taxonomy->name,\n\t\t\t\t'descendants_and_self' => $cat_id,\n\t\t\t\t'selected_cats'        => $checked_categories,\n\t\t\t\t'popular_cats'         => $popular_ids,\n\t\t\t)\n\t\t);\n\n\t\t$data = ob_get_clean();\n\n\t\t$add = array(\n\t\t\t'what'     => $taxonomy->name,\n\t\t\t'id'       => $cat_id,\n\t\t\t'data'     => str_replace( array( \"\\n\", \"\\t\" ), '', $data ),\n\t\t\t'position' => -1,\n\t\t);\n\t}\n\n\tif ( $parent ) { // Foncy - replace the parent and all its children.\n\t\t$parent  = get_term( $parent, $taxonomy->name );\n\t\t$term_id = $parent->term_id;\n\n\t\twhile ( $parent->parent ) { // Get the top parent.\n\t\t\t$parent = get_term( $parent->parent, $taxonomy->name );\n\t\t\tif ( is_wp_error( $parent ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$term_id = $parent->term_id;\n\t\t}\n\n\t\tob_start();\n\n\t\twp_terms_checklist(\n\t\t\t0,\n\t\t\tarray(\n\t\t\t\t'taxonomy'             => $taxonomy->name,\n\t\t\t\t'descendants_and_self' => $term_id,\n\t\t\t\t'selected_cats'        => $checked_categories,\n\t\t\t\t'popular_cats'         => $popular_ids,\n\t\t\t)\n\t\t);\n\n\t\t$data = ob_get_clean();\n\n\t\t$add = array(\n\t\t\t'what'     => $taxonomy->name,\n\t\t\t'id'       => $term_id,\n\t\t\t'data'     => str_replace( array( \"\\n\", \"\\t\" ), '', $data ),\n\t\t\t'position' => -1,\n\t\t);\n\t}\n\n\tob_start();\n\n\twp_dropdown_categories(\n\t\tarray(\n\t\t\t'taxonomy'         => $taxonomy->name,\n\t\t\t'hide_empty'       => 0,\n\t\t\t'name'             => 'new' . $taxonomy->name . '_parent',\n\t\t\t'orderby'          => 'name',\n\t\t\t'hierarchical'     => 1,\n\t\t\t'show_option_none' => '&mdash; ' . $taxonomy->labels->parent_item . ' &mdash;',\n\t\t)\n\t);\n\n\t$sup = ob_get_clean();\n\n\t$add['supplemental'] = array( 'newcat_parent' => $sup );\n\n\t$x = new WP_Ajax_Response( $add );\n\t$x->send();\n}\n\n/**\n * Ajax handler for deleting a comment.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_delete_comment() {\n\t$id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;\n\n\t$comment = get_comment( $id );\n\n\tif ( ! $comment ) {\n\t\twp_die( time() );\n\t}\n\n\tif ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {\n\t\twp_die( -1 );\n\t}\n\n\tcheck_ajax_referer( \"delete-comment_$id\" );\n\t$status = wp_get_comment_status( $comment );\n\t$delta  = -1;\n\n\tif ( isset( $_POST['trash'] ) && 1 == $_POST['trash'] ) {\n\t\tif ( 'trash' === $status ) {\n\t\t\twp_die( time() );\n\t\t}\n\n\t\t$r = wp_trash_comment( $comment );\n\t} elseif ( isset( $_POST['untrash'] ) && 1 == $_POST['untrash'] ) {\n\t\tif ( 'trash' !== $status ) {\n\t\t\twp_die( time() );\n\t\t}\n\n\t\t$r = wp_untrash_comment( $comment );\n\n\t\t// Undo trash, not in Trash.\n\t\tif ( ! isset( $_POST['comment_status'] ) || 'trash' !== $_POST['comment_status'] ) {\n\t\t\t$delta = 1;\n\t\t}\n\t} elseif ( isset( $_POST['spam'] ) && 1 == $_POST['spam'] ) {\n\t\tif ( 'spam' === $status ) {\n\t\t\twp_die( time() );\n\t\t}\n\n\t\t$r = wp_spam_comment( $comment );\n\t} elseif ( isset( $_POST['unspam'] ) && 1 == $_POST['unspam'] ) {\n\t\tif ( 'spam' !== $status ) {\n\t\t\twp_die( time() );\n\t\t}\n\n\t\t$r = wp_unspam_comment( $comment );\n\n\t\t// Undo spam, not in spam.\n\t\tif ( ! isset( $_POST['comment_status'] ) || 'spam' !== $_POST['comment_status'] ) {\n\t\t\t$delta = 1;\n\t\t}\n\t} elseif ( isset( $_POST['delete'] ) && 1 == $_POST['delete'] ) {\n\t\t$r = wp_delete_comment( $comment );\n\t} else {\n\t\twp_die( -1 );\n\t}\n\n\tif ( $r ) {\n\t\t// Decide if we need to send back '1' or a more complicated response including page links and comment counts.\n\t\t_wp_ajax_delete_comment_response( $comment->comment_ID, $delta );\n\t}\n\n\twp_die( 0 );\n}\n\n/**\n * Ajax handler for deleting a tag.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_delete_tag() {\n\t$tag_id = (int) $_POST['tag_ID'];\n\tcheck_ajax_referer( \"delete-tag_$tag_id\" );\n\n\tif ( ! current_user_can( 'delete_term', $tag_id ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t$taxonomy = ! empty( $_POST['taxonomy'] ) ? $_POST['taxonomy'] : 'post_tag';\n\t$tag      = get_term( $tag_id, $taxonomy );\n\n\tif ( ! $tag || is_wp_error( $tag ) ) {\n\t\twp_die( 1 );\n\t}\n\n\tif ( wp_delete_term( $tag_id, $taxonomy ) ) {\n\t\twp_die( 1 );\n\t} else {\n\t\twp_die( 0 );\n\t}\n}\n\n/**\n * Ajax handler for deleting a link.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_delete_link() {\n\t$id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;\n\n\tcheck_ajax_referer( \"delete-bookmark_$id\" );\n\n\tif ( ! current_user_can( 'manage_links' ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t$link = get_bookmark( $id );\n\tif ( ! $link || is_wp_error( $link ) ) {\n\t\twp_die( 1 );\n\t}\n\n\tif ( wp_delete_link( $id ) ) {\n\t\twp_die( 1 );\n\t} else {\n\t\twp_die( 0 );\n\t}\n}\n\n/**\n * Ajax handler for deleting meta.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_delete_meta() {\n\t$id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;\n\n\tcheck_ajax_referer( \"delete-meta_$id\" );\n\t$meta = get_metadata_by_mid( 'post', $id );\n\n\tif ( ! $meta ) {\n\t\twp_die( 1 );\n\t}\n\n\tif ( is_protected_meta( $meta->meta_key, 'post' ) || ! current_user_can( 'delete_post_meta', $meta->post_id, $meta->meta_key ) ) {\n\t\twp_die( -1 );\n\t}\n\n\tif ( delete_meta( $meta->meta_id ) ) {\n\t\twp_die( 1 );\n\t}\n\n\twp_die( 0 );\n}\n\n/**\n * Ajax handler for deleting a post.\n *\n * @since 3.1.0\n *\n * @param string $action Action to perform.\n */\nfunction wp_ajax_delete_post( $action ) {\n\tif ( empty( $action ) ) {\n\t\t$action = 'delete-post';\n\t}\n\n\t$id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;\n\tcheck_ajax_referer( \"{$action}_$id\" );\n\n\tif ( ! current_user_can( 'delete_post', $id ) ) {\n\t\twp_die( -1 );\n\t}\n\n\tif ( ! get_post( $id ) ) {\n\t\twp_die( 1 );\n\t}\n\n\tif ( wp_delete_post( $id ) ) {\n\t\twp_die( 1 );\n\t} else {\n\t\twp_die( 0 );\n\t}\n}\n\n/**\n * Ajax handler for sending a post to the Trash.\n *\n * @since 3.1.0\n *\n * @param string $action Action to perform.\n */\nfunction wp_ajax_trash_post( $action ) {\n\tif ( empty( $action ) ) {\n\t\t$action = 'trash-post';\n\t}\n\n\t$id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;\n\tcheck_ajax_referer( \"{$action}_$id\" );\n\n\tif ( ! current_user_can( 'delete_post', $id ) ) {\n\t\twp_die( -1 );\n\t}\n\n\tif ( ! get_post( $id ) ) {\n\t\twp_die( 1 );\n\t}\n\n\tif ( 'trash-post' === $action ) {\n\t\t$done = wp_trash_post( $id );\n\t} else {\n\t\t$done = wp_untrash_post( $id );\n\t}\n\n\tif ( $done ) {\n\t\twp_die( 1 );\n\t}\n\n\twp_die( 0 );\n}\n\n/**\n * Ajax handler to restore a post from the Trash.\n *\n * @since 3.1.0\n *\n * @param string $action Action to perform.\n */\nfunction wp_ajax_untrash_post( $action ) {\n\tif ( empty( $action ) ) {\n\t\t$action = 'untrash-post';\n\t}\n\n\twp_ajax_trash_post( $action );\n}\n\n/**\n * Ajax handler to delete a page.\n *\n * @since 3.1.0\n *\n * @param string $action Action to perform.\n */\nfunction wp_ajax_delete_page( $action ) {\n\tif ( empty( $action ) ) {\n\t\t$action = 'delete-page';\n\t}\n\n\t$id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;\n\tcheck_ajax_referer( \"{$action}_$id\" );\n\n\tif ( ! current_user_can( 'delete_page', $id ) ) {\n\t\twp_die( -1 );\n\t}\n\n\tif ( ! get_post( $id ) ) {\n\t\twp_die( 1 );\n\t}\n\n\tif ( wp_delete_post( $id ) ) {\n\t\twp_die( 1 );\n\t} else {\n\t\twp_die( 0 );\n\t}\n}\n\n/**\n * Ajax handler to dim a comment.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_dim_comment() {\n\t$id      = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;\n\t$comment = get_comment( $id );\n\n\tif ( ! $comment ) {\n\t\t$x = new WP_Ajax_Response(\n\t\t\tarray(\n\t\t\t\t'what' => 'comment',\n\t\t\t\t'id'   => new WP_Error(\n\t\t\t\t\t'invalid_comment',\n\t\t\t\t\t/* translators: %d: Comment ID. */\n\t\t\t\t\tsprintf( __( 'Comment %d does not exist' ), $id )\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t\t$x->send();\n\t}\n\n\tif ( ! current_user_can( 'edit_comment', $comment->comment_ID ) && ! current_user_can( 'moderate_comments' ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t$current = wp_get_comment_status( $comment );\n\n\tif ( isset( $_POST['new'] ) && $_POST['new'] == $current ) {\n\t\twp_die( time() );\n\t}\n\n\tcheck_ajax_referer( \"approve-comment_$id\" );\n\n\tif ( in_array( $current, array( 'unapproved', 'spam' ), true ) ) {\n\t\t$result = wp_set_comment_status( $comment, 'approve', true );\n\t} else {\n\t\t$result = wp_set_comment_status( $comment, 'hold', true );\n\t}\n\n\tif ( is_wp_error( $result ) ) {\n\t\t$x = new WP_Ajax_Response(\n\t\t\tarray(\n\t\t\t\t'what' => 'comment',\n\t\t\t\t'id'   => $result,\n\t\t\t)\n\t\t);\n\t\t$x->send();\n\t}\n\n\t// Decide if we need to send back '1' or a more complicated response including page links and comment counts.\n\t_wp_ajax_delete_comment_response( $comment->comment_ID );\n\twp_die( 0 );\n}\n\n/**\n * Ajax handler for adding a link category.\n *\n * @since 3.1.0\n *\n * @param string $action Action to perform.\n */\nfunction wp_ajax_add_link_category( $action ) {\n\tif ( empty( $action ) ) {\n\t\t$action = 'add-link-category';\n\t}\n\n\tcheck_ajax_referer( $action );\n\t$tax = get_taxonomy( 'link_category' );\n\n\tif ( ! current_user_can( $tax->cap->manage_terms ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t$names = explode( ',', wp_unslash( $_POST['newcat'] ) );\n\t$x     = new WP_Ajax_Response();\n\n\tforeach ( $names as $cat_name ) {\n\t\t$cat_name = trim( $cat_name );\n\t\t$slug     = sanitize_title( $cat_name );\n\n\t\tif ( '' === $slug ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$cat_id = wp_insert_term( $cat_name, 'link_category' );\n\n\t\tif ( ! $cat_id || is_wp_error( $cat_id ) ) {\n\t\t\tcontinue;\n\t\t} else {\n\t\t\t$cat_id = $cat_id['term_id'];\n\t\t}\n\n\t\t$cat_name = esc_html( $cat_name );\n\n\t\t$x->add(\n\t\t\tarray(\n\t\t\t\t'what'     => 'link-category',\n\t\t\t\t'id'       => $cat_id,\n\t\t\t\t'data'     => \"<li id='link-category-$cat_id'><label for='in-link-category-$cat_id' class='selectit'><input value='\" . esc_attr( $cat_id ) . \"' type='checkbox' checked='checked' name='link_category[]' id='in-link-category-$cat_id'/> $cat_name</label></li>\",\n\t\t\t\t'position' => -1,\n\t\t\t)\n\t\t);\n\t}\n\t$x->send();\n}\n\n/**\n * Ajax handler to add a tag.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_add_tag() {\n\tcheck_ajax_referer( 'add-tag', '_wpnonce_add-tag' );\n\t$taxonomy = ! empty( $_POST['taxonomy'] ) ? $_POST['taxonomy'] : 'post_tag';\n\t$tax      = get_taxonomy( $taxonomy );\n\n\tif ( ! current_user_can( $tax->cap->edit_terms ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t$x = new WP_Ajax_Response();\n\n\t$tag = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );\n\n\tif ( $tag && ! is_wp_error( $tag ) ) {\n\t\t$tag = get_term( $tag['term_id'], $taxonomy );\n\t}\n\n\tif ( ! $tag || is_wp_error( $tag ) ) {\n\t\t$message = __( 'An error has occurred. Please reload the page and try again.' );\n\n\t\tif ( is_wp_error( $tag ) && $tag->get_error_message() ) {\n\t\t\t$message = $tag->get_error_message();\n\t\t}\n\n\t\t$x->add(\n\t\t\tarray(\n\t\t\t\t'what' => 'taxonomy',\n\t\t\t\t'data' => new WP_Error( 'error', $message ),\n\t\t\t)\n\t\t);\n\t\t$x->send();\n\t}\n\n\t$wp_list_table = _get_list_table( 'WP_Terms_List_Table', array( 'screen' => $_POST['screen'] ) );\n\n\t$level     = 0;\n\t$noparents = '';\n\n\tif ( is_taxonomy_hierarchical( $taxonomy ) ) {\n\t\t$level = count( get_ancestors( $tag->term_id, $taxonomy, 'taxonomy' ) );\n\t\tob_start();\n\t\t$wp_list_table->single_row( $tag, $level );\n\t\t$noparents = ob_get_clean();\n\t}\n\n\tob_start();\n\t$wp_list_table->single_row( $tag );\n\t$parents = ob_get_clean();\n\n\t$x->add(\n\t\tarray(\n\t\t\t'what'         => 'taxonomy',\n\t\t\t'supplemental' => compact( 'parents', 'noparents' ),\n\t\t)\n\t);\n\n\t$x->add(\n\t\tarray(\n\t\t\t'what'         => 'term',\n\t\t\t'position'     => $level,\n\t\t\t'supplemental' => (array) $tag,\n\t\t)\n\t);\n\n\t$x->send();\n}\n\n/**\n * Ajax handler for getting a tagcloud.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_get_tagcloud() {\n\tif ( ! isset( $_POST['tax'] ) ) {\n\t\twp_die( 0 );\n\t}\n\n\t$taxonomy = sanitize_key( $_POST['tax'] );\n\t$tax      = get_taxonomy( $taxonomy );\n\n\tif ( ! $tax ) {\n\t\twp_die( 0 );\n\t}\n\n\tif ( ! current_user_can( $tax->cap->assign_terms ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t$tags = get_terms(\n\t\tarray(\n\t\t\t'taxonomy' => $taxonomy,\n\t\t\t'number'   => 45,\n\t\t\t'orderby'  => 'count',\n\t\t\t'order'    => 'DESC',\n\t\t)\n\t);\n\n\tif ( empty( $tags ) ) {\n\t\twp_die( $tax->labels->not_found );\n\t}\n\n\tif ( is_wp_error( $tags ) ) {\n\t\twp_die( $tags->get_error_message() );\n\t}\n\n\tforeach ( $tags as $key => $tag ) {\n\t\t$tags[ $key ]->link = '#';\n\t\t$tags[ $key ]->id   = $tag->term_id;\n\t}\n\n\t// We need raw tag names here, so don't filter the output.\n\t$return = wp_generate_tag_cloud(\n\t\t$tags,\n\t\tarray(\n\t\t\t'filter' => 0,\n\t\t\t'format' => 'list',\n\t\t)\n\t);\n\n\tif ( empty( $return ) ) {\n\t\twp_die( 0 );\n\t}\n\n\techo $return;\n\twp_die();\n}\n\n/**\n * Ajax handler for getting comments.\n *\n * @since 3.1.0\n *\n * @global int $post_id\n *\n * @param string $action Action to perform.\n */\nfunction wp_ajax_get_comments( $action ) {\n\tglobal $post_id;\n\n\tif ( empty( $action ) ) {\n\t\t$action = 'get-comments';\n\t}\n\n\tcheck_ajax_referer( $action );\n\n\tif ( empty( $post_id ) && ! empty( $_REQUEST['p'] ) ) {\n\t\t$id = absint( $_REQUEST['p'] );\n\t\tif ( ! empty( $id ) ) {\n\t\t\t$post_id = $id;\n\t\t}\n\t}\n\n\tif ( empty( $post_id ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t$wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) );\n\n\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t$wp_list_table->prepare_items();\n\n\tif ( ! $wp_list_table->has_items() ) {\n\t\twp_die( 1 );\n\t}\n\n\t$x = new WP_Ajax_Response();\n\n\tob_start();\n\tforeach ( $wp_list_table->items as $comment ) {\n\t\tif ( ! current_user_can( 'edit_comment', $comment->comment_ID ) && 0 === $comment->comment_approved ) {\n\t\t\tcontinue;\n\t\t}\n\t\tget_comment( $comment );\n\t\t$wp_list_table->single_row( $comment );\n\t}\n\t$comment_list_item = ob_get_clean();\n\n\t$x->add(\n\t\tarray(\n\t\t\t'what' => 'comments',\n\t\t\t'data' => $comment_list_item,\n\t\t)\n\t);\n\n\t$x->send();\n}\n\n/**\n * Ajax handler for replying to a comment.\n *\n * @since 3.1.0\n *\n * @param string $action Action to perform.\n */\nfunction wp_ajax_replyto_comment( $action ) {\n\tif ( empty( $action ) ) {\n\t\t$action = 'replyto-comment';\n\t}\n\n\tcheck_ajax_referer( $action, '_ajax_nonce-replyto-comment' );\n\n\t$comment_post_ID = (int) $_POST['comment_post_ID'];\n\t$post            = get_post( $comment_post_ID );\n\n\tif ( ! $post ) {\n\t\twp_die( -1 );\n\t}\n\n\tif ( ! current_user_can( 'edit_post', $comment_post_ID ) ) {\n\t\twp_die( -1 );\n\t}\n\n\tif ( empty( $post->post_status ) ) {\n\t\twp_die( 1 );\n\t} elseif ( in_array( $post->post_status, array( 'draft', 'pending', 'trash' ), true ) ) {\n\t\twp_die( __( 'Error: You can&#8217;t reply to a comment on a draft post.' ) );\n\t}\n\n\t$user = wp_get_current_user();\n\n\tif ( $user->exists() ) {\n\t\t$user_ID              = $user->ID;\n\t\t$comment_author       = wp_slash( $user->display_name );\n\t\t$comment_author_email = wp_slash( $user->user_email );\n\t\t$comment_author_url   = wp_slash( $user->user_url );\n\t\t$comment_content      = trim( $_POST['content'] );\n\t\t$comment_type         = isset( $_POST['comment_type'] ) ? trim( $_POST['comment_type'] ) : 'comment';\n\n\t\tif ( current_user_can( 'unfiltered_html' ) ) {\n\t\t\tif ( ! isset( $_POST['_wp_unfiltered_html_comment'] ) ) {\n\t\t\t\t$_POST['_wp_unfiltered_html_comment'] = '';\n\t\t\t}\n\n\t\t\tif ( wp_create_nonce( 'unfiltered-html-comment' ) != $_POST['_wp_unfiltered_html_comment'] ) {\n\t\t\t\tkses_remove_filters(); // Start with a clean slate.\n\t\t\t\tkses_init_filters();   // Set up the filters.\n\t\t\t\tremove_filter( 'pre_comment_content', 'wp_filter_post_kses' );\n\t\t\t\tadd_filter( 'pre_comment_content', 'wp_filter_kses' );\n\t\t\t}\n\t\t}\n\t} else {\n\t\twp_die( __( 'Sorry, you must be logged in to reply to a comment.' ) );\n\t}\n\n\tif ( '' === $comment_content ) {\n\t\twp_die( __( 'Error: Please type your comment text.' ) );\n\t}\n\n\t$comment_parent = 0;\n\n\tif ( isset( $_POST['comment_ID'] ) ) {\n\t\t$comment_parent = absint( $_POST['comment_ID'] );\n\t}\n\n\t$comment_auto_approved = false;\n\t$commentdata           = compact( 'comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID' );\n\n\t// Automatically approve parent comment.\n\tif ( ! empty( $_POST['approve_parent'] ) ) {\n\t\t$parent = get_comment( $comment_parent );\n\n\t\tif ( $parent && '0' === $parent->comment_approved && $parent->comment_post_ID == $comment_post_ID ) {\n\t\t\tif ( ! current_user_can( 'edit_comment', $parent->comment_ID ) ) {\n\t\t\t\twp_die( -1 );\n\t\t\t}\n\n\t\t\tif ( wp_set_comment_status( $parent, 'approve' ) ) {\n\t\t\t\t$comment_auto_approved = true;\n\t\t\t}\n\t\t}\n\t}\n\n\t$comment_id = wp_new_comment( $commentdata );\n\n\tif ( is_wp_error( $comment_id ) ) {\n\t\twp_die( $comment_id->get_error_message() );\n\t}\n\n\t$comment = get_comment( $comment_id );\n\n\tif ( ! $comment ) {\n\t\twp_die( 1 );\n\t}\n\n\t$position = ( isset( $_POST['position'] ) && (int) $_POST['position'] ) ? (int) $_POST['position'] : '-1';\n\n\tob_start();\n\tif ( isset( $_REQUEST['mode'] ) && 'dashboard' === $_REQUEST['mode'] ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/dashboard.php';\n\t\t_wp_dashboard_recent_comments_row( $comment );\n\t} else {\n\t\tif ( isset( $_REQUEST['mode'] ) && 'single' === $_REQUEST['mode'] ) {\n\t\t\t$wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) );\n\t\t} else {\n\t\t\t$wp_list_table = _get_list_table( 'WP_Comments_List_Table', array( 'screen' => 'edit-comments' ) );\n\t\t}\n\t\t$wp_list_table->single_row( $comment );\n\t}\n\t$comment_list_item = ob_get_clean();\n\n\t$response = array(\n\t\t'what'     => 'comment',\n\t\t'id'       => $comment->comment_ID,\n\t\t'data'     => $comment_list_item,\n\t\t'position' => $position,\n\t);\n\n\t$counts                   = wp_count_comments();\n\t$response['supplemental'] = array(\n\t\t'in_moderation'        => $counts->moderated,\n\t\t'i18n_comments_text'   => sprintf(\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t_n( '%s Comment', '%s Comments', $counts->approved ),\n\t\t\tnumber_format_i18n( $counts->approved )\n\t\t),\n\t\t'i18n_moderation_text' => sprintf(\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t_n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),\n\t\t\tnumber_format_i18n( $counts->moderated )\n\t\t),\n\t);\n\n\tif ( $comment_auto_approved ) {\n\t\t$response['supplemental']['parent_approved'] = $parent->comment_ID;\n\t\t$response['supplemental']['parent_post_id']  = $parent->comment_post_ID;\n\t}\n\n\t$x = new WP_Ajax_Response();\n\t$x->add( $response );\n\t$x->send();\n}\n\n/**\n * Ajax handler for editing a comment.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_edit_comment() {\n\tcheck_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' );\n\n\t$comment_id = (int) $_POST['comment_ID'];\n\n\tif ( ! current_user_can( 'edit_comment', $comment_id ) ) {\n\t\twp_die( -1 );\n\t}\n\n\tif ( '' === $_POST['content'] ) {\n\t\twp_die( __( 'Error: Please type your comment text.' ) );\n\t}\n\n\tif ( isset( $_POST['status'] ) ) {\n\t\t$_POST['comment_status'] = $_POST['status'];\n\t}\n\n\t$updated = edit_comment();\n\tif ( is_wp_error( $updated ) ) {\n\t\twp_die( $updated->get_error_message() );\n\t}\n\n\t$position      = ( isset( $_POST['position'] ) && (int) $_POST['position'] ) ? (int) $_POST['position'] : '-1';\n\t$checkbox      = ( isset( $_POST['checkbox'] ) && true == $_POST['checkbox'] ) ? 1 : 0;\n\t$wp_list_table = _get_list_table( $checkbox ? 'WP_Comments_List_Table' : 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) );\n\n\t$comment = get_comment( $comment_id );\n\n\tif ( empty( $comment->comment_ID ) ) {\n\t\twp_die( -1 );\n\t}\n\n\tob_start();\n\t$wp_list_table->single_row( $comment );\n\t$comment_list_item = ob_get_clean();\n\n\t$x = new WP_Ajax_Response();\n\n\t$x->add(\n\t\tarray(\n\t\t\t'what'     => 'edit_comment',\n\t\t\t'id'       => $comment->comment_ID,\n\t\t\t'data'     => $comment_list_item,\n\t\t\t'position' => $position,\n\t\t)\n\t);\n\n\t$x->send();\n}\n\n/**\n * Ajax handler for adding a menu item.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_add_menu_item() {\n\tcheck_ajax_referer( 'add-menu_item', 'menu-settings-column-nonce' );\n\n\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\twp_die( -1 );\n\t}\n\n\trequire_once ABSPATH . 'wp-admin/includes/nav-menu.php';\n\n\t// For performance reasons, we omit some object properties from the checklist.\n\t// The following is a hacky way to restore them when adding non-custom items.\n\t$menu_items_data = array();\n\n\tforeach ( (array) $_POST['menu-item'] as $menu_item_data ) {\n\t\tif (\n\t\t\t! empty( $menu_item_data['menu-item-type'] ) &&\n\t\t\t'custom' !== $menu_item_data['menu-item-type'] &&\n\t\t\t! empty( $menu_item_data['menu-item-object-id'] )\n\t\t) {\n\t\t\tswitch ( $menu_item_data['menu-item-type'] ) {\n\t\t\t\tcase 'post_type':\n\t\t\t\t\t$_object = get_post( $menu_item_data['menu-item-object-id'] );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'post_type_archive':\n\t\t\t\t\t$_object = get_post_type_object( $menu_item_data['menu-item-object'] );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'taxonomy':\n\t\t\t\t\t$_object = get_term( $menu_item_data['menu-item-object-id'], $menu_item_data['menu-item-object'] );\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$_menu_items = array_map( 'wp_setup_nav_menu_item', array( $_object ) );\n\t\t\t$_menu_item  = reset( $_menu_items );\n\n\t\t\t// Restore the missing menu item properties.\n\t\t\t$menu_item_data['menu-item-description'] = $_menu_item->description;\n\t\t}\n\n\t\t$menu_items_data[] = $menu_item_data;\n\t}\n\n\t$item_ids = wp_save_nav_menu_items( 0, $menu_items_data );\n\tif ( is_wp_error( $item_ids ) ) {\n\t\twp_die( 0 );\n\t}\n\n\t$menu_items = array();\n\n\tforeach ( (array) $item_ids as $menu_item_id ) {\n\t\t$menu_obj = get_post( $menu_item_id );\n\n\t\tif ( ! empty( $menu_obj->ID ) ) {\n\t\t\t$menu_obj        = wp_setup_nav_menu_item( $menu_obj );\n\t\t\t$menu_obj->title = empty( $menu_obj->title ) ? __( 'Menu Item' ) : $menu_obj->title;\n\t\t\t$menu_obj->label = $menu_obj->title; // Don't show \"(pending)\" in ajax-added items.\n\t\t\t$menu_items[]    = $menu_obj;\n\t\t}\n\t}\n\n\t/** This filter is documented in wp-admin/includes/nav-menu.php */\n\t$walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $_POST['menu'] );\n\n\tif ( ! class_exists( $walker_class_name ) ) {\n\t\twp_die( 0 );\n\t}\n\n\tif ( ! empty( $menu_items ) ) {\n\t\t$args = array(\n\t\t\t'after'       => '',\n\t\t\t'before'      => '',\n\t\t\t'link_after'  => '',\n\t\t\t'link_before' => '',\n\t\t\t'walker'      => new $walker_class_name,\n\t\t);\n\n\t\techo walk_nav_menu_tree( $menu_items, 0, (object) $args );\n\t}\n\n\twp_die();\n}\n\n/**\n * Ajax handler for adding meta.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_add_meta() {\n\tcheck_ajax_referer( 'add-meta', '_ajax_nonce-add-meta' );\n\t$c    = 0;\n\t$pid  = (int) $_POST['post_id'];\n\t$post = get_post( $pid );\n\n\tif ( isset( $_POST['metakeyselect'] ) || isset( $_POST['metakeyinput'] ) ) {\n\t\tif ( ! current_user_can( 'edit_post', $pid ) ) {\n\t\t\twp_die( -1 );\n\t\t}\n\n\t\tif ( isset( $_POST['metakeyselect'] ) && '#NONE#' === $_POST['metakeyselect'] && empty( $_POST['metakeyinput'] ) ) {\n\t\t\twp_die( 1 );\n\t\t}\n\n\t\t// If the post is an autodraft, save the post as a draft and then attempt to save the meta.\n\t\tif ( 'auto-draft' === $post->post_status ) {\n\t\t\t$post_data                = array();\n\t\t\t$post_data['action']      = 'draft'; // Warning fix.\n\t\t\t$post_data['post_ID']     = $pid;\n\t\t\t$post_data['post_type']   = $post->post_type;\n\t\t\t$post_data['post_status'] = 'draft';\n\t\t\t$now                      = time();\n\t\t\t/* translators: 1: Post creation date, 2: Post creation time. */\n\t\t\t$post_data['post_title'] = sprintf( __( 'Draft created on %1$s at %2$s' ), gmdate( __( 'F j, Y' ), $now ), gmdate( __( 'g:i a' ), $now ) );\n\n\t\t\t$pid = edit_post( $post_data );\n\n\t\t\tif ( $pid ) {\n\t\t\t\tif ( is_wp_error( $pid ) ) {\n\t\t\t\t\t$x = new WP_Ajax_Response(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'what' => 'meta',\n\t\t\t\t\t\t\t'data' => $pid,\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t$x->send();\n\t\t\t\t}\n\n\t\t\t\t$mid = add_meta( $pid );\n\t\t\t\tif ( ! $mid ) {\n\t\t\t\t\twp_die( __( 'Please provide a custom field value.' ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twp_die( 0 );\n\t\t\t}\n\t\t} else {\n\t\t\t$mid = add_meta( $pid );\n\t\t\tif ( ! $mid ) {\n\t\t\t\twp_die( __( 'Please provide a custom field value.' ) );\n\t\t\t}\n\t\t}\n\n\t\t$meta = get_metadata_by_mid( 'post', $mid );\n\t\t$pid  = (int) $meta->post_id;\n\t\t$meta = get_object_vars( $meta );\n\n\t\t$x = new WP_Ajax_Response(\n\t\t\tarray(\n\t\t\t\t'what'         => 'meta',\n\t\t\t\t'id'           => $mid,\n\t\t\t\t'data'         => _list_meta_row( $meta, $c ),\n\t\t\t\t'position'     => 1,\n\t\t\t\t'supplemental' => array( 'postid' => $pid ),\n\t\t\t)\n\t\t);\n\t} else { // Update?\n\t\t$mid   = (int) key( $_POST['meta'] );\n\t\t$key   = wp_unslash( $_POST['meta'][ $mid ]['key'] );\n\t\t$value = wp_unslash( $_POST['meta'][ $mid ]['value'] );\n\n\t\tif ( '' === trim( $key ) ) {\n\t\t\twp_die( __( 'Please provide a custom field name.' ) );\n\t\t}\n\n\t\t$meta = get_metadata_by_mid( 'post', $mid );\n\n\t\tif ( ! $meta ) {\n\t\t\twp_die( 0 ); // If meta doesn't exist.\n\t\t}\n\n\t\tif (\n\t\t\tis_protected_meta( $meta->meta_key, 'post' ) || is_protected_meta( $key, 'post' ) ||\n\t\t\t! current_user_can( 'edit_post_meta', $meta->post_id, $meta->meta_key ) ||\n\t\t\t! current_user_can( 'edit_post_meta', $meta->post_id, $key )\n\t\t) {\n\t\t\twp_die( -1 );\n\t\t}\n\n\t\tif ( $meta->meta_value != $value || $meta->meta_key != $key ) {\n\t\t\t$u = update_metadata_by_mid( 'post', $mid, $value, $key );\n\t\t\tif ( ! $u ) {\n\t\t\t\twp_die( 0 ); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems).\n\t\t\t}\n\t\t}\n\n\t\t$x = new WP_Ajax_Response(\n\t\t\tarray(\n\t\t\t\t'what'         => 'meta',\n\t\t\t\t'id'           => $mid,\n\t\t\t\t'old_id'       => $mid,\n\t\t\t\t'data'         => _list_meta_row(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'meta_key'   => $key,\n\t\t\t\t\t\t'meta_value' => $value,\n\t\t\t\t\t\t'meta_id'    => $mid,\n\t\t\t\t\t),\n\t\t\t\t\t$c\n\t\t\t\t),\n\t\t\t\t'position'     => 0,\n\t\t\t\t'supplemental' => array( 'postid' => $meta->post_id ),\n\t\t\t)\n\t\t);\n\t}\n\t$x->send();\n}\n\n/**\n * Ajax handler for adding a user.\n *\n * @since 3.1.0\n *\n * @param string $action Action to perform.\n */\nfunction wp_ajax_add_user( $action ) {\n\tif ( empty( $action ) ) {\n\t\t$action = 'add-user';\n\t}\n\n\tcheck_ajax_referer( $action );\n\n\tif ( ! current_user_can( 'create_users' ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t$user_id = edit_user();\n\n\tif ( ! $user_id ) {\n\t\twp_die( 0 );\n\t} elseif ( is_wp_error( $user_id ) ) {\n\t\t$x = new WP_Ajax_Response(\n\t\t\tarray(\n\t\t\t\t'what' => 'user',\n\t\t\t\t'id'   => $user_id,\n\t\t\t)\n\t\t);\n\t\t$x->send();\n\t}\n\n\t$user_object   = get_userdata( $user_id );\n\t$wp_list_table = _get_list_table( 'WP_Users_List_Table' );\n\n\t$role = current( $user_object->roles );\n\n\t$x = new WP_Ajax_Response(\n\t\tarray(\n\t\t\t'what'         => 'user',\n\t\t\t'id'           => $user_id,\n\t\t\t'data'         => $wp_list_table->single_row( $user_object, '', $role ),\n\t\t\t'supplemental' => array(\n\t\t\t\t'show-link' => sprintf(\n\t\t\t\t\t/* translators: %s: The new user. */\n\t\t\t\t\t__( 'User %s added' ),\n\t\t\t\t\t'<a href=\"#user-' . $user_id . '\">' . $user_object->user_login . '</a>'\n\t\t\t\t),\n\t\t\t\t'role'      => $role,\n\t\t\t),\n\t\t)\n\t);\n\t$x->send();\n}\n\n/**\n * Ajax handler for closed post boxes.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_closed_postboxes() {\n\tcheck_ajax_referer( 'closedpostboxes', 'closedpostboxesnonce' );\n\t$closed = isset( $_POST['closed'] ) ? explode( ',', $_POST['closed'] ) : array();\n\t$closed = array_filter( $closed );\n\n\t$hidden = isset( $_POST['hidden'] ) ? explode( ',', $_POST['hidden'] ) : array();\n\t$hidden = array_filter( $hidden );\n\n\t$page = isset( $_POST['page'] ) ? $_POST['page'] : '';\n\n\tif ( sanitize_key( $page ) != $page ) {\n\t\twp_die( 0 );\n\t}\n\n\t$user = wp_get_current_user();\n\tif ( ! $user ) {\n\t\twp_die( -1 );\n\t}\n\n\tif ( is_array( $closed ) ) {\n\t\tupdate_user_option( $user->ID, \"closedpostboxes_$page\", $closed, true );\n\t}\n\n\tif ( is_array( $hidden ) ) {\n\t\t// Postboxes that are always shown.\n\t\t$hidden = array_diff( $hidden, array( 'submitdiv', 'linksubmitdiv', 'manage-menu', 'create-menu' ) );\n\t\tupdate_user_option( $user->ID, \"metaboxhidden_$page\", $hidden, true );\n\t}\n\n\twp_die( 1 );\n}\n\n/**\n * Ajax handler for hidden columns.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_hidden_columns() {\n\tcheck_ajax_referer( 'screen-options-nonce', 'screenoptionnonce' );\n\t$page = isset( $_POST['page'] ) ? $_POST['page'] : '';\n\n\tif ( sanitize_key( $page ) != $page ) {\n\t\twp_die( 0 );\n\t}\n\n\t$user = wp_get_current_user();\n\tif ( ! $user ) {\n\t\twp_die( -1 );\n\t}\n\n\t$hidden = ! empty( $_POST['hidden'] ) ? explode( ',', $_POST['hidden'] ) : array();\n\tupdate_user_option( $user->ID, \"manage{$page}columnshidden\", $hidden, true );\n\n\twp_die( 1 );\n}\n\n/**\n * Ajax handler for updating whether to display the welcome panel.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_update_welcome_panel() {\n\tcheck_ajax_referer( 'welcome-panel-nonce', 'welcomepanelnonce' );\n\n\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\twp_die( -1 );\n\t}\n\n\tupdate_user_meta( get_current_user_id(), 'show_welcome_panel', empty( $_POST['visible'] ) ? 0 : 1 );\n\n\twp_die( 1 );\n}\n\n/**\n * Ajax handler for retrieving menu meta boxes.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_menu_get_metabox() {\n\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\twp_die( -1 );\n\t}\n\n\trequire_once ABSPATH . 'wp-admin/includes/nav-menu.php';\n\n\tif ( isset( $_POST['item-type'] ) && 'post_type' === $_POST['item-type'] ) {\n\t\t$type     = 'posttype';\n\t\t$callback = 'wp_nav_menu_item_post_type_meta_box';\n\t\t$items    = (array) get_post_types( array( 'show_in_nav_menus' => true ), 'object' );\n\t} elseif ( isset( $_POST['item-type'] ) && 'taxonomy' === $_POST['item-type'] ) {\n\t\t$type     = 'taxonomy';\n\t\t$callback = 'wp_nav_menu_item_taxonomy_meta_box';\n\t\t$items    = (array) get_taxonomies( array( 'show_ui' => true ), 'object' );\n\t}\n\n\tif ( ! empty( $_POST['item-object'] ) && isset( $items[ $_POST['item-object'] ] ) ) {\n\t\t$menus_meta_box_object = $items[ $_POST['item-object'] ];\n\n\t\t/** This filter is documented in wp-admin/includes/nav-menu.php */\n\t\t$item = apply_filters( 'nav_menu_meta_box_object', $menus_meta_box_object );\n\n\t\t$box_args = array(\n\t\t\t'id'       => 'add-' . $item->name,\n\t\t\t'title'    => $item->labels->name,\n\t\t\t'callback' => $callback,\n\t\t\t'args'     => $item,\n\t\t);\n\n\t\tob_start();\n\t\t$callback( null, $box_args );\n\n\t\t$markup = ob_get_clean();\n\n\t\techo wp_json_encode(\n\t\t\tarray(\n\t\t\t\t'replace-id' => $type . '-' . $item->name,\n\t\t\t\t'markup'     => $markup,\n\t\t\t)\n\t\t);\n\t}\n\n\twp_die();\n}\n\n/**\n * Ajax handler for internal linking.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_wp_link_ajax() {\n\tcheck_ajax_referer( 'internal-linking', '_ajax_linking_nonce' );\n\n\t$args = array();\n\n\tif ( isset( $_POST['search'] ) ) {\n\t\t$args['s'] = wp_unslash( $_POST['search'] );\n\t}\n\n\tif ( isset( $_POST['term'] ) ) {\n\t\t$args['s'] = wp_unslash( $_POST['term'] );\n\t}\n\n\t$args['pagenum'] = ! empty( $_POST['page'] ) ? absint( $_POST['page'] ) : 1;\n\n\tif ( ! class_exists( '_WP_Editors', false ) ) {\n\t\trequire ABSPATH . WPINC . '/class-wp-editor.php';\n\t}\n\n\t$results = _WP_Editors::wp_link_query( $args );\n\n\tif ( ! isset( $results ) ) {\n\t\twp_die( 0 );\n\t}\n\n\techo wp_json_encode( $results );\n\techo \"\\n\";\n\n\twp_die();\n}\n\n/**\n * Ajax handler for menu locations save.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_menu_locations_save() {\n\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\twp_die( -1 );\n\t}\n\n\tcheck_ajax_referer( 'add-menu_item', 'menu-settings-column-nonce' );\n\n\tif ( ! isset( $_POST['menu-locations'] ) ) {\n\t\twp_die( 0 );\n\t}\n\n\tset_theme_mod( 'nav_menu_locations', array_map( 'absint', $_POST['menu-locations'] ) );\n\twp_die( 1 );\n}\n\n/**\n * Ajax handler for saving the meta box order.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_meta_box_order() {\n\tcheck_ajax_referer( 'meta-box-order' );\n\t$order        = isset( $_POST['order'] ) ? (array) $_POST['order'] : false;\n\t$page_columns = isset( $_POST['page_columns'] ) ? $_POST['page_columns'] : 'auto';\n\n\tif ( 'auto' !== $page_columns ) {\n\t\t$page_columns = (int) $page_columns;\n\t}\n\n\t$page = isset( $_POST['page'] ) ? $_POST['page'] : '';\n\n\tif ( sanitize_key( $page ) != $page ) {\n\t\twp_die( 0 );\n\t}\n\n\t$user = wp_get_current_user();\n\tif ( ! $user ) {\n\t\twp_die( -1 );\n\t}\n\n\tif ( $order ) {\n\t\tupdate_user_option( $user->ID, \"meta-box-order_$page\", $order, true );\n\t}\n\n\tif ( $page_columns ) {\n\t\tupdate_user_option( $user->ID, \"screen_layout_$page\", $page_columns, true );\n\t}\n\n\twp_send_json_success();\n}\n\n/**\n * Ajax handler for menu quick searching.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_menu_quick_search() {\n\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\twp_die( -1 );\n\t}\n\n\trequire_once ABSPATH . 'wp-admin/includes/nav-menu.php';\n\n\t_wp_ajax_menu_quick_search( $_POST );\n\n\twp_die();\n}\n\n/**\n * Ajax handler to retrieve a permalink.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_get_permalink() {\n\tcheck_ajax_referer( 'getpermalink', 'getpermalinknonce' );\n\t$post_id = isset( $_POST['post_id'] ) ? intval( $_POST['post_id'] ) : 0;\n\twp_die( get_preview_post_link( $post_id ) );\n}\n\n/**\n * Ajax handler to retrieve a sample permalink.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_sample_permalink() {\n\tcheck_ajax_referer( 'samplepermalink', 'samplepermalinknonce' );\n\t$post_id = isset( $_POST['post_id'] ) ? intval( $_POST['post_id'] ) : 0;\n\t$title   = isset( $_POST['new_title'] ) ? $_POST['new_title'] : '';\n\t$slug    = isset( $_POST['new_slug'] ) ? $_POST['new_slug'] : null;\n\twp_die( get_sample_permalink_html( $post_id, $title, $slug ) );\n}\n\n/**\n * Ajax handler for Quick Edit saving a post from a list table.\n *\n * @since 3.1.0\n *\n * @global string $mode List table view mode.\n */\nfunction wp_ajax_inline_save() {\n\tglobal $mode;\n\n\tcheck_ajax_referer( 'inlineeditnonce', '_inline_edit' );\n\n\tif ( ! isset( $_POST['post_ID'] ) || ! (int) $_POST['post_ID'] ) {\n\t\twp_die();\n\t}\n\n\t$post_ID = (int) $_POST['post_ID'];\n\n\tif ( 'page' === $_POST['post_type'] ) {\n\t\tif ( ! current_user_can( 'edit_page', $post_ID ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to edit this page.' ) );\n\t\t}\n\t} else {\n\t\tif ( ! current_user_can( 'edit_post', $post_ID ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to edit this post.' ) );\n\t\t}\n\t}\n\n\t$last = wp_check_post_lock( $post_ID );\n\tif ( $last ) {\n\t\t$last_user      = get_userdata( $last );\n\t\t$last_user_name = $last_user ? $last_user->display_name : __( 'Someone' );\n\n\t\t/* translators: %s: User's display name. */\n\t\t$msg_template = __( 'Saving is disabled: %s is currently editing this post.' );\n\n\t\tif ( 'page' === $_POST['post_type'] ) {\n\t\t\t/* translators: %s: User's display name. */\n\t\t\t$msg_template = __( 'Saving is disabled: %s is currently editing this page.' );\n\t\t}\n\n\t\tprintf( $msg_template, esc_html( $last_user_name ) );\n\t\twp_die();\n\t}\n\n\t$data = &$_POST;\n\n\t$post = get_post( $post_ID, ARRAY_A );\n\n\t// Since it's coming from the database.\n\t$post = wp_slash( $post );\n\n\t$data['content'] = $post['post_content'];\n\t$data['excerpt'] = $post['post_excerpt'];\n\n\t// Rename.\n\t$data['user_ID'] = get_current_user_id();\n\n\tif ( isset( $data['post_parent'] ) ) {\n\t\t$data['parent_id'] = $data['post_parent'];\n\t}\n\n\t// Status.\n\tif ( isset( $data['keep_private'] ) && 'private' === $data['keep_private'] ) {\n\t\t$data['visibility']  = 'private';\n\t\t$data['post_status'] = 'private';\n\t} else {\n\t\t$data['post_status'] = $data['_status'];\n\t}\n\n\tif ( empty( $data['comment_status'] ) ) {\n\t\t$data['comment_status'] = 'closed';\n\t}\n\n\tif ( empty( $data['ping_status'] ) ) {\n\t\t$data['ping_status'] = 'closed';\n\t}\n\n\t// Exclude terms from taxonomies that are not supposed to appear in Quick Edit.\n\tif ( ! empty( $data['tax_input'] ) ) {\n\t\tforeach ( $data['tax_input'] as $taxonomy => $terms ) {\n\t\t\t$tax_object = get_taxonomy( $taxonomy );\n\t\t\t/** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */\n\t\t\tif ( ! apply_filters( 'quick_edit_show_taxonomy', $tax_object->show_in_quick_edit, $taxonomy, $post['post_type'] ) ) {\n\t\t\t\tunset( $data['tax_input'][ $taxonomy ] );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Hack: wp_unique_post_slug() doesn't work for drafts, so we will fake that our post is published.\n\tif ( ! empty( $data['post_name'] ) && in_array( $post['post_status'], array( 'draft', 'pending' ), true ) ) {\n\t\t$post['post_status'] = 'publish';\n\t\t$data['post_name']   = wp_unique_post_slug( $data['post_name'], $post['ID'], $post['post_status'], $post['post_type'], $post['post_parent'] );\n\t}\n\n\t// Update the post.\n\tedit_post();\n\n\t$wp_list_table = _get_list_table( 'WP_Posts_List_Table', array( 'screen' => $_POST['screen'] ) );\n\n\t$mode = 'excerpt' === $_POST['post_view'] ? 'excerpt' : 'list';\n\n\t$level = 0;\n\tif ( is_post_type_hierarchical( $wp_list_table->screen->post_type ) ) {\n\t\t$request_post = array( get_post( $_POST['post_ID'] ) );\n\t\t$parent       = $request_post[0]->post_parent;\n\n\t\twhile ( $parent > 0 ) {\n\t\t\t$parent_post = get_post( $parent );\n\t\t\t$parent      = $parent_post->post_parent;\n\t\t\t$level++;\n\t\t}\n\t}\n\n\t$wp_list_table->display_rows( array( get_post( $_POST['post_ID'] ) ), $level );\n\n\twp_die();\n}\n\n/**\n * Ajax handler for quick edit saving for a term.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_inline_save_tax() {\n\tcheck_ajax_referer( 'taxinlineeditnonce', '_inline_edit' );\n\n\t$taxonomy = sanitize_key( $_POST['taxonomy'] );\n\t$tax      = get_taxonomy( $taxonomy );\n\n\tif ( ! $tax ) {\n\t\twp_die( 0 );\n\t}\n\n\tif ( ! isset( $_POST['tax_ID'] ) || ! (int) $_POST['tax_ID'] ) {\n\t\twp_die( -1 );\n\t}\n\n\t$id = (int) $_POST['tax_ID'];\n\n\tif ( ! current_user_can( 'edit_term', $id ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t$wp_list_table = _get_list_table( 'WP_Terms_List_Table', array( 'screen' => 'edit-' . $taxonomy ) );\n\n\t$tag                  = get_term( $id, $taxonomy );\n\t$_POST['description'] = $tag->description;\n\n\t$updated = wp_update_term( $id, $taxonomy, $_POST );\n\n\tif ( $updated && ! is_wp_error( $updated ) ) {\n\t\t$tag = get_term( $updated['term_id'], $taxonomy );\n\t\tif ( ! $tag || is_wp_error( $tag ) ) {\n\t\t\tif ( is_wp_error( $tag ) && $tag->get_error_message() ) {\n\t\t\t\twp_die( $tag->get_error_message() );\n\t\t\t}\n\t\t\twp_die( __( 'Item not updated.' ) );\n\t\t}\n\t} else {\n\t\tif ( is_wp_error( $updated ) && $updated->get_error_message() ) {\n\t\t\twp_die( $updated->get_error_message() );\n\t\t}\n\t\twp_die( __( 'Item not updated.' ) );\n\t}\n\n\t$level  = 0;\n\t$parent = $tag->parent;\n\n\twhile ( $parent > 0 ) {\n\t\t$parent_tag = get_term( $parent, $taxonomy );\n\t\t$parent     = $parent_tag->parent;\n\t\t$level++;\n\t}\n\n\t$wp_list_table->single_row( $tag, $level );\n\twp_die();\n}\n\n/**\n * Ajax handler for querying posts for the Find Posts modal.\n *\n * @see window.findPosts\n *\n * @since 3.1.0\n */\nfunction wp_ajax_find_posts() {\n\tcheck_ajax_referer( 'find-posts' );\n\n\t$post_types = get_post_types( array( 'public' => true ), 'objects' );\n\tunset( $post_types['attachment'] );\n\n\t$s    = wp_unslash( $_POST['ps'] );\n\t$args = array(\n\t\t'post_type'      => array_keys( $post_types ),\n\t\t'post_status'    => 'any',\n\t\t'posts_per_page' => 50,\n\t);\n\n\tif ( '' !== $s ) {\n\t\t$args['s'] = $s;\n\t}\n\n\t$posts = get_posts( $args );\n\n\tif ( ! $posts ) {\n\t\twp_send_json_error( __( 'No items found.' ) );\n\t}\n\n\t$html = '<table class=\"widefat\"><thead><tr><th class=\"found-radio\"><br /></th><th>' . __( 'Title' ) . '</th><th class=\"no-break\">' . __( 'Type' ) . '</th><th class=\"no-break\">' . __( 'Date' ) . '</th><th class=\"no-break\">' . __( 'Status' ) . '</th></tr></thead><tbody>';\n\t$alt  = '';\n\tforeach ( $posts as $post ) {\n\t\t$title = trim( $post->post_title ) ? $post->post_title : __( '(no title)' );\n\t\t$alt   = ( 'alternate' === $alt ) ? '' : 'alternate';\n\n\t\tswitch ( $post->post_status ) {\n\t\t\tcase 'publish':\n\t\t\tcase 'private':\n\t\t\t\t$stat = __( 'Published' );\n\t\t\t\tbreak;\n\t\t\tcase 'future':\n\t\t\t\t$stat = __( 'Scheduled' );\n\t\t\t\tbreak;\n\t\t\tcase 'pending':\n\t\t\t\t$stat = __( 'Pending Review' );\n\t\t\t\tbreak;\n\t\t\tcase 'draft':\n\t\t\t\t$stat = __( 'Draft' );\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( '0000-00-00 00:00:00' === $post->post_date ) {\n\t\t\t$time = '';\n\t\t} else {\n\t\t\t/* translators: Date format in table columns, see https://www.php.net/date */\n\t\t\t$time = mysql2date( __( 'Y/m/d' ), $post->post_date );\n\t\t}\n\n\t\t$html .= '<tr class=\"' . trim( 'found-posts ' . $alt ) . '\"><td class=\"found-radio\"><input type=\"radio\" id=\"found-' . $post->ID . '\" name=\"found_post_id\" value=\"' . esc_attr( $post->ID ) . '\"></td>';\n\t\t$html .= '<td><label for=\"found-' . $post->ID . '\">' . esc_html( $title ) . '</label></td><td class=\"no-break\">' . esc_html( $post_types[ $post->post_type ]->labels->singular_name ) . '</td><td class=\"no-break\">' . esc_html( $time ) . '</td><td class=\"no-break\">' . esc_html( $stat ) . ' </td></tr>' . \"\\n\\n\";\n\t}\n\n\t$html .= '</tbody></table>';\n\n\twp_send_json_success( $html );\n}\n\n/**\n * Ajax handler for saving the widgets order.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_widgets_order() {\n\tcheck_ajax_referer( 'save-sidebar-widgets', 'savewidgets' );\n\n\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\twp_die( -1 );\n\t}\n\n\tunset( $_POST['savewidgets'], $_POST['action'] );\n\n\t// Save widgets order for all sidebars.\n\tif ( is_array( $_POST['sidebars'] ) ) {\n\t\t$sidebars = array();\n\n\t\tforeach ( wp_unslash( $_POST['sidebars'] ) as $key => $val ) {\n\t\t\t$sb = array();\n\n\t\t\tif ( ! empty( $val ) ) {\n\t\t\t\t$val = explode( ',', $val );\n\n\t\t\t\tforeach ( $val as $k => $v ) {\n\t\t\t\t\tif ( strpos( $v, 'widget-' ) === false ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$sb[ $k ] = substr( $v, strpos( $v, '_' ) + 1 );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sidebars[ $key ] = $sb;\n\t\t}\n\n\t\twp_set_sidebars_widgets( $sidebars );\n\t\twp_die( 1 );\n\t}\n\n\twp_die( -1 );\n}\n\n/**\n * Ajax handler for saving a widget.\n *\n * @since 3.1.0\n *\n * @global array $wp_registered_widgets\n * @global array $wp_registered_widget_controls\n * @global array $wp_registered_widget_updates\n */\nfunction wp_ajax_save_widget() {\n\tglobal $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates;\n\n\tcheck_ajax_referer( 'save-sidebar-widgets', 'savewidgets' );\n\n\tif ( ! current_user_can( 'edit_theme_options' ) || ! isset( $_POST['id_base'] ) ) {\n\t\twp_die( -1 );\n\t}\n\n\tunset( $_POST['savewidgets'], $_POST['action'] );\n\n\t/**\n\t * Fires early when editing the widgets displayed in sidebars.\n\t *\n\t * @since 2.8.0\n\t */\n\tdo_action( 'load-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t/**\n\t * Fires early when editing the widgets displayed in sidebars.\n\t *\n\t * @since 2.8.0\n\t */\n\tdo_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t/** This action is documented in wp-admin/widgets.php */\n\tdo_action( 'sidebar_admin_setup' );\n\n\t$id_base      = wp_unslash( $_POST['id_base'] );\n\t$widget_id    = wp_unslash( $_POST['widget-id'] );\n\t$sidebar_id   = $_POST['sidebar'];\n\t$multi_number = ! empty( $_POST['multi_number'] ) ? (int) $_POST['multi_number'] : 0;\n\t$settings     = isset( $_POST[ 'widget-' . $id_base ] ) && is_array( $_POST[ 'widget-' . $id_base ] ) ? $_POST[ 'widget-' . $id_base ] : false;\n\t$error        = '<p>' . __( 'An error has occurred. Please reload the page and try again.' ) . '</p>';\n\n\t$sidebars = wp_get_sidebars_widgets();\n\t$sidebar  = isset( $sidebars[ $sidebar_id ] ) ? $sidebars[ $sidebar_id ] : array();\n\n\t// Delete.\n\tif ( isset( $_POST['delete_widget'] ) && $_POST['delete_widget'] ) {\n\n\t\tif ( ! isset( $wp_registered_widgets[ $widget_id ] ) ) {\n\t\t\twp_die( $error );\n\t\t}\n\n\t\t$sidebar = array_diff( $sidebar, array( $widget_id ) );\n\t\t$_POST   = array(\n\t\t\t'sidebar'            => $sidebar_id,\n\t\t\t'widget-' . $id_base => array(),\n\t\t\t'the-widget-id'      => $widget_id,\n\t\t\t'delete_widget'      => '1',\n\t\t);\n\n\t\t/** This action is documented in wp-admin/widgets.php */\n\t\tdo_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );\n\n\t} elseif ( $settings && preg_match( '/__i__|%i%/', key( $settings ) ) ) {\n\t\tif ( ! $multi_number ) {\n\t\t\twp_die( $error );\n\t\t}\n\n\t\t$_POST[ 'widget-' . $id_base ] = array( $multi_number => reset( $settings ) );\n\t\t$widget_id                     = $id_base . '-' . $multi_number;\n\t\t$sidebar[]                     = $widget_id;\n\t}\n\t$_POST['widget-id'] = $sidebar;\n\n\tforeach ( (array) $wp_registered_widget_updates as $name => $control ) {\n\n\t\tif ( $name == $id_base ) {\n\t\t\tif ( ! is_callable( $control['callback'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tob_start();\n\t\t\t\tcall_user_func_array( $control['callback'], $control['params'] );\n\t\t\tob_end_clean();\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ( isset( $_POST['delete_widget'] ) && $_POST['delete_widget'] ) {\n\t\t$sidebars[ $sidebar_id ] = $sidebar;\n\t\twp_set_sidebars_widgets( $sidebars );\n\t\techo \"deleted:$widget_id\";\n\t\twp_die();\n\t}\n\n\tif ( ! empty( $_POST['add_new'] ) ) {\n\t\twp_die();\n\t}\n\n\t$form = $wp_registered_widget_controls[ $widget_id ];\n\tif ( $form ) {\n\t\tcall_user_func_array( $form['callback'], $form['params'] );\n\t}\n\n\twp_die();\n}\n\n/**\n * Ajax handler for saving a widget.\n *\n * @since 3.9.0\n *\n * @global WP_Customize_Manager $wp_customize\n */\nfunction wp_ajax_update_widget() {\n\tglobal $wp_customize;\n\t$wp_customize->widgets->wp_ajax_update_widget();\n}\n\n/**\n * Ajax handler for removing inactive widgets.\n *\n * @since 4.4.0\n */\nfunction wp_ajax_delete_inactive_widgets() {\n\tcheck_ajax_referer( 'remove-inactive-widgets', 'removeinactivewidgets' );\n\n\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\twp_die( -1 );\n\t}\n\n\tunset( $_POST['removeinactivewidgets'], $_POST['action'] );\n\t/** This action is documented in wp-admin/includes/ajax-actions.php */\n\tdo_action( 'load-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t/** This action is documented in wp-admin/includes/ajax-actions.php */\n\tdo_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t/** This action is documented in wp-admin/widgets.php */\n\tdo_action( 'sidebar_admin_setup' );\n\n\t$sidebars_widgets = wp_get_sidebars_widgets();\n\n\tforeach ( $sidebars_widgets['wp_inactive_widgets'] as $key => $widget_id ) {\n\t\t$pieces       = explode( '-', $widget_id );\n\t\t$multi_number = array_pop( $pieces );\n\t\t$id_base      = implode( '-', $pieces );\n\t\t$widget       = get_option( 'widget_' . $id_base );\n\t\tunset( $widget[ $multi_number ] );\n\t\tupdate_option( 'widget_' . $id_base, $widget );\n\t\tunset( $sidebars_widgets['wp_inactive_widgets'][ $key ] );\n\t}\n\n\twp_set_sidebars_widgets( $sidebars_widgets );\n\n\twp_die();\n}\n\n/**\n * Ajax handler for creating missing image sub-sizes for just uploaded images.\n *\n * @since 5.3.0\n */\nfunction wp_ajax_media_create_image_subsizes() {\n\tcheck_ajax_referer( 'media-form' );\n\n\tif ( ! current_user_can( 'upload_files' ) ) {\n\t\twp_send_json_error( array( 'message' => __( 'Sorry, you are not allowed to upload files.' ) ) );\n\t}\n\n\tif ( empty( $_POST['attachment_id'] ) ) {\n\t\twp_send_json_error( array( 'message' => __( 'Upload failed. Please reload and try again.' ) ) );\n\t}\n\n\t$attachment_id = (int) $_POST['attachment_id'];\n\n\tif ( ! empty( $_POST['_wp_upload_failed_cleanup'] ) ) {\n\t\t// Upload failed. Cleanup.\n\t\tif ( wp_attachment_is_image( $attachment_id ) && current_user_can( 'delete_post', $attachment_id ) ) {\n\t\t\t$attachment = get_post( $attachment_id );\n\n\t\t\t// Created at most 10 min ago.\n\t\t\tif ( $attachment && ( time() - strtotime( $attachment->post_date_gmt ) < 600 ) ) {\n\t\t\t\twp_delete_attachment( $attachment_id, true );\n\t\t\t\twp_send_json_success();\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set a custom header with the attachment_id.\n\t// Used by the browser/client to resume creating image sub-sizes after a PHP fatal error.\n\tif ( ! headers_sent() ) {\n\t\theader( 'X-WP-Upload-Attachment-ID: ' . $attachment_id );\n\t}\n\n\t// This can still be pretty slow and cause timeout or out of memory errors.\n\t// The js that handles the response would need to also handle HTTP 500 errors.\n\twp_update_image_subsizes( $attachment_id );\n\n\tif ( ! empty( $_POST['_legacy_support'] ) ) {\n\t\t// The old (inline) uploader. Only needs the attachment_id.\n\t\t$response = array( 'id' => $attachment_id );\n\t} else {\n\t\t// Media modal and Media Library grid view.\n\t\t$response = wp_prepare_attachment_for_js( $attachment_id );\n\n\t\tif ( ! $response ) {\n\t\t\twp_send_json_error( array( 'message' => __( 'Upload failed.' ) ) );\n\t\t}\n\t}\n\n\t// At this point the image has been uploaded successfully.\n\twp_send_json_success( $response );\n}\n\n/**\n * Ajax handler for uploading attachments\n *\n * @since 3.3.0\n */\nfunction wp_ajax_upload_attachment() {\n\tcheck_ajax_referer( 'media-form' );\n\t/*\n\t * This function does not use wp_send_json_success() / wp_send_json_error()\n\t * as the html4 Plupload handler requires a text/html content-type for older IE.\n\t * See https://core.trac.wordpress.org/ticket/31037\n\t */\n\n\tif ( ! current_user_can( 'upload_files' ) ) {\n\t\techo wp_json_encode(\n\t\t\tarray(\n\t\t\t\t'success' => false,\n\t\t\t\t'data'    => array(\n\t\t\t\t\t'message'  => __( 'Sorry, you are not allowed to upload files.' ),\n\t\t\t\t\t'filename' => esc_html( $_FILES['async-upload']['name'] ),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\twp_die();\n\t}\n\n\tif ( isset( $_REQUEST['post_id'] ) ) {\n\t\t$post_id = $_REQUEST['post_id'];\n\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\techo wp_json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'data'    => array(\n\t\t\t\t\t\t'message'  => __( 'Sorry, you are not allowed to attach files to this post.' ),\n\t\t\t\t\t\t'filename' => esc_html( $_FILES['async-upload']['name'] ),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\twp_die();\n\t\t}\n\t} else {\n\t\t$post_id = null;\n\t}\n\n\t$post_data = ! empty( $_REQUEST['post_data'] ) ? _wp_get_allowed_postdata( _wp_translate_postdata( false, (array) $_REQUEST['post_data'] ) ) : array();\n\n\tif ( is_wp_error( $post_data ) ) {\n\t\twp_die( $post_data->get_error_message() );\n\t}\n\n\t// If the context is custom header or background, make sure the uploaded file is an image.\n\tif ( isset( $post_data['context'] ) && in_array( $post_data['context'], array( 'custom-header', 'custom-background' ), true ) ) {\n\t\t$wp_filetype = wp_check_filetype_and_ext( $_FILES['async-upload']['tmp_name'], $_FILES['async-upload']['name'] );\n\n\t\tif ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) {\n\t\t\techo wp_json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'data'    => array(\n\t\t\t\t\t\t'message'  => __( 'The uploaded file is not a valid image. Please try again.' ),\n\t\t\t\t\t\t'filename' => esc_html( $_FILES['async-upload']['name'] ),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\twp_die();\n\t\t}\n\t}\n\n\t$attachment_id = media_handle_upload( 'async-upload', $post_id, $post_data );\n\n\tif ( is_wp_error( $attachment_id ) ) {\n\t\techo wp_json_encode(\n\t\t\tarray(\n\t\t\t\t'success' => false,\n\t\t\t\t'data'    => array(\n\t\t\t\t\t'message'  => $attachment_id->get_error_message(),\n\t\t\t\t\t'filename' => esc_html( $_FILES['async-upload']['name'] ),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\twp_die();\n\t}\n\n\tif ( isset( $post_data['context'] ) && isset( $post_data['theme'] ) ) {\n\t\tif ( 'custom-background' === $post_data['context'] ) {\n\t\t\tupdate_post_meta( $attachment_id, '_wp_attachment_is_custom_background', $post_data['theme'] );\n\t\t}\n\n\t\tif ( 'custom-header' === $post_data['context'] ) {\n\t\t\tupdate_post_meta( $attachment_id, '_wp_attachment_is_custom_header', $post_data['theme'] );\n\t\t}\n\t}\n\n\t$attachment = wp_prepare_attachment_for_js( $attachment_id );\n\tif ( ! $attachment ) {\n\t\twp_die();\n\t}\n\n\techo wp_json_encode(\n\t\tarray(\n\t\t\t'success' => true,\n\t\t\t'data'    => $attachment,\n\t\t)\n\t);\n\n\twp_die();\n}\n\n/**\n * Ajax handler for image editing.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_image_editor() {\n\t$attachment_id = intval( $_POST['postid'] );\n\n\tif ( empty( $attachment_id ) || ! current_user_can( 'edit_post', $attachment_id ) ) {\n\t\twp_die( -1 );\n\t}\n\n\tcheck_ajax_referer( \"image_editor-$attachment_id\" );\n\tinclude_once ABSPATH . 'wp-admin/includes/image-edit.php';\n\n\t$msg = false;\n\n\tswitch ( $_POST['do'] ) {\n\t\tcase 'save':\n\t\t\t$msg = wp_save_image( $attachment_id );\n\t\t\tif ( ! empty( $msg->error ) ) {\n\t\t\t\twp_send_json_error( $msg );\n\t\t\t}\n\n\t\t\twp_send_json_success( $msg );\n\t\t\tbreak;\n\t\tcase 'scale':\n\t\t\t$msg = wp_save_image( $attachment_id );\n\t\t\tbreak;\n\t\tcase 'restore':\n\t\t\t$msg = wp_restore_image( $attachment_id );\n\t\t\tbreak;\n\t}\n\n\tob_start();\n\twp_image_editor( $attachment_id, $msg );\n\t$html = ob_get_clean();\n\n\tif ( ! empty( $msg->error ) ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => $msg,\n\t\t\t\t'html'    => $html,\n\t\t\t)\n\t\t);\n\t}\n\n\twp_send_json_success(\n\t\tarray(\n\t\t\t'message' => $msg,\n\t\t\t'html'    => $html,\n\t\t)\n\t);\n}\n\n/**\n * Ajax handler for setting the featured image.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_set_post_thumbnail() {\n\t$json = ! empty( $_REQUEST['json'] ); // New-style request.\n\n\t$post_ID = intval( $_POST['post_id'] );\n\tif ( ! current_user_can( 'edit_post', $post_ID ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t$thumbnail_id = intval( $_POST['thumbnail_id'] );\n\n\tif ( $json ) {\n\t\tcheck_ajax_referer( \"update-post_$post_ID\" );\n\t} else {\n\t\tcheck_ajax_referer( \"set_post_thumbnail-$post_ID\" );\n\t}\n\n\tif ( '-1' == $thumbnail_id ) {\n\t\tif ( delete_post_thumbnail( $post_ID ) ) {\n\t\t\t$return = _wp_post_thumbnail_html( null, $post_ID );\n\t\t\t$json ? wp_send_json_success( $return ) : wp_die( $return );\n\t\t} else {\n\t\t\twp_die( 0 );\n\t\t}\n\t}\n\n\tif ( set_post_thumbnail( $post_ID, $thumbnail_id ) ) {\n\t\t$return = _wp_post_thumbnail_html( $thumbnail_id, $post_ID );\n\t\t$json ? wp_send_json_success( $return ) : wp_die( $return );\n\t}\n\n\twp_die( 0 );\n}\n\n/**\n * Ajax handler for retrieving HTML for the featured image.\n *\n * @since 4.6.0\n */\nfunction wp_ajax_get_post_thumbnail_html() {\n\t$post_ID = intval( $_POST['post_id'] );\n\n\tcheck_ajax_referer( \"update-post_$post_ID\" );\n\n\tif ( ! current_user_can( 'edit_post', $post_ID ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t$thumbnail_id = intval( $_POST['thumbnail_id'] );\n\n\t// For backward compatibility, -1 refers to no featured image.\n\tif ( -1 === $thumbnail_id ) {\n\t\t$thumbnail_id = null;\n\t}\n\n\t$return = _wp_post_thumbnail_html( $thumbnail_id, $post_ID );\n\twp_send_json_success( $return );\n}\n\n/**\n * Ajax handler for setting the featured image for an attachment.\n *\n * @since 4.0.0\n *\n * @see set_post_thumbnail()\n */\nfunction wp_ajax_set_attachment_thumbnail() {\n\tif ( empty( $_POST['urls'] ) || ! is_array( $_POST['urls'] ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$thumbnail_id = (int) $_POST['thumbnail_id'];\n\tif ( empty( $thumbnail_id ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$post_ids = array();\n\t// For each URL, try to find its corresponding post ID.\n\tforeach ( $_POST['urls'] as $url ) {\n\t\t$post_id = attachment_url_to_postid( $url );\n\t\tif ( ! empty( $post_id ) ) {\n\t\t\t$post_ids[] = $post_id;\n\t\t}\n\t}\n\n\tif ( empty( $post_ids ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$success = 0;\n\t// For each found attachment, set its thumbnail.\n\tforeach ( $post_ids as $post_id ) {\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( set_post_thumbnail( $post_id, $thumbnail_id ) ) {\n\t\t\t$success++;\n\t\t}\n\t}\n\n\tif ( 0 === $success ) {\n\t\twp_send_json_error();\n\t} else {\n\t\twp_send_json_success();\n\t}\n\n\twp_send_json_error();\n}\n\n/**\n * Ajax handler for date formatting.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_date_format() {\n\twp_die( date_i18n( sanitize_option( 'date_format', wp_unslash( $_POST['date'] ) ) ) );\n}\n\n/**\n * Ajax handler for time formatting.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_time_format() {\n\twp_die( date_i18n( sanitize_option( 'time_format', wp_unslash( $_POST['date'] ) ) ) );\n}\n\n/**\n * Ajax handler for saving posts from the fullscreen editor.\n *\n * @since 3.1.0\n * @deprecated 4.3.0\n */\nfunction wp_ajax_wp_fullscreen_save_post() {\n\t$post_id = isset( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : 0;\n\n\t$post = null;\n\n\tif ( $post_id ) {\n\t\t$post = get_post( $post_id );\n\t}\n\n\tcheck_ajax_referer( 'update-post_' . $post_id, '_wpnonce' );\n\n\t$post_id = edit_post();\n\n\tif ( is_wp_error( $post_id ) ) {\n\t\twp_send_json_error();\n\t}\n\n\tif ( $post ) {\n\t\t$last_date = mysql2date( __( 'F j, Y' ), $post->post_modified );\n\t\t$last_time = mysql2date( __( 'g:i a' ), $post->post_modified );\n\t} else {\n\t\t$last_date = date_i18n( __( 'F j, Y' ) );\n\t\t$last_time = date_i18n( __( 'g:i a' ) );\n\t}\n\n\t$last_id = get_post_meta( $post_id, '_edit_last', true );\n\tif ( $last_id ) {\n\t\t$last_user = get_userdata( $last_id );\n\t\t/* translators: 1: User's display name, 2: Date of last edit, 3: Time of last edit. */\n\t\t$last_edited = sprintf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), $last_date, $last_time );\n\t} else {\n\t\t/* translators: 1: Date of last edit, 2: Time of last edit. */\n\t\t$last_edited = sprintf( __( 'Last edited on %1$s at %2$s' ), $last_date, $last_time );\n\t}\n\n\twp_send_json_success( array( 'last_edited' => $last_edited ) );\n}\n\n/**\n * Ajax handler for removing a post lock.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_wp_remove_post_lock() {\n\tif ( empty( $_POST['post_ID'] ) || empty( $_POST['active_post_lock'] ) ) {\n\t\twp_die( 0 );\n\t}\n\n\t$post_id = (int) $_POST['post_ID'];\n\t$post    = get_post( $post_id );\n\n\tif ( ! $post ) {\n\t\twp_die( 0 );\n\t}\n\n\tcheck_ajax_referer( 'update-post_' . $post_id );\n\n\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\twp_die( -1 );\n\t}\n\n\t$active_lock = array_map( 'absint', explode( ':', $_POST['active_post_lock'] ) );\n\n\tif ( get_current_user_id() != $active_lock[1] ) {\n\t\twp_die( 0 );\n\t}\n\n\t/**\n\t * Filters the post lock window duration.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param int $interval The interval in seconds the post lock duration\n\t *                      should last, plus 5 seconds. Default 150.\n\t */\n\t$new_lock = ( time() - apply_filters( 'wp_check_post_lock_window', 150 ) + 5 ) . ':' . $active_lock[1];\n\tupdate_post_meta( $post_id, '_edit_lock', $new_lock, implode( ':', $active_lock ) );\n\twp_die( 1 );\n}\n\n/**\n * Ajax handler for dismissing a WordPress pointer.\n *\n * @since 3.1.0\n */\nfunction wp_ajax_dismiss_wp_pointer() {\n\t$pointer = $_POST['pointer'];\n\n\tif ( sanitize_key( $pointer ) != $pointer ) {\n\t\twp_die( 0 );\n\t}\n\n\t//  check_ajax_referer( 'dismiss-pointer_' . $pointer );\n\n\t$dismissed = array_filter( explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ) );\n\n\tif ( in_array( $pointer, $dismissed, true ) ) {\n\t\twp_die( 0 );\n\t}\n\n\t$dismissed[] = $pointer;\n\t$dismissed   = implode( ',', $dismissed );\n\n\tupdate_user_meta( get_current_user_id(), 'dismissed_wp_pointers', $dismissed );\n\twp_die( 1 );\n}\n\n/**\n * Ajax handler for getting an attachment.\n *\n * @since 3.5.0\n */\nfunction wp_ajax_get_attachment() {\n\tif ( ! isset( $_REQUEST['id'] ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$id = absint( $_REQUEST['id'] );\n\tif ( ! $id ) {\n\t\twp_send_json_error();\n\t}\n\n\t$post = get_post( $id );\n\tif ( ! $post ) {\n\t\twp_send_json_error();\n\t}\n\n\tif ( 'attachment' !== $post->post_type ) {\n\t\twp_send_json_error();\n\t}\n\n\tif ( ! current_user_can( 'upload_files' ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$attachment = wp_prepare_attachment_for_js( $id );\n\tif ( ! $attachment ) {\n\t\twp_send_json_error();\n\t}\n\n\twp_send_json_success( $attachment );\n}\n\n/**\n * Ajax handler for querying attachments.\n *\n * @since 3.5.0\n */\nfunction wp_ajax_query_attachments() {\n\tif ( ! current_user_can( 'upload_files' ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$query = isset( $_REQUEST['query'] ) ? (array) $_REQUEST['query'] : array();\n\t$keys  = array(\n\t\t's',\n\t\t'order',\n\t\t'orderby',\n\t\t'posts_per_page',\n\t\t'paged',\n\t\t'post_mime_type',\n\t\t'post_parent',\n\t\t'author',\n\t\t'post__in',\n\t\t'post__not_in',\n\t\t'year',\n\t\t'monthnum',\n\t);\n\n\tforeach ( get_taxonomies_for_attachments( 'objects' ) as $t ) {\n\t\tif ( $t->query_var && isset( $query[ $t->query_var ] ) ) {\n\t\t\t$keys[] = $t->query_var;\n\t\t}\n\t}\n\n\t$query              = array_intersect_key( $query, array_flip( $keys ) );\n\t$query['post_type'] = 'attachment';\n\n\tif (\n\t\tMEDIA_TRASH &&\n\t\t! empty( $_REQUEST['query']['post_status'] ) &&\n\t\t'trash' === $_REQUEST['query']['post_status']\n\t) {\n\t\t$query['post_status'] = 'trash';\n\t} else {\n\t\t$query['post_status'] = 'inherit';\n\t}\n\n\tif ( current_user_can( get_post_type_object( 'attachment' )->cap->read_private_posts ) ) {\n\t\t$query['post_status'] .= ',private';\n\t}\n\n\t// Filter query clauses to include filenames.\n\tif ( isset( $query['s'] ) ) {\n\t\tadd_filter( 'posts_clauses', '_filter_query_attachment_filenames' );\n\t}\n\n\t/**\n\t * Filters the arguments passed to WP_Query during an Ajax\n\t * call for querying attachments.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @see WP_Query::parse_query()\n\t *\n\t * @param array $query An array of query variables.\n\t */\n\t$query = apply_filters( 'ajax_query_attachments_args', $query );\n\t$query = new WP_Query( $query );\n\n\t$posts = array_map( 'wp_prepare_attachment_for_js', $query->posts );\n\t$posts = array_filter( $posts );\n\n\twp_send_json_success( $posts );\n}\n\n/**\n * Ajax handler for updating attachment attributes.\n *\n * @since 3.5.0\n */\nfunction wp_ajax_save_attachment() {\n\tif ( ! isset( $_REQUEST['id'] ) || ! isset( $_REQUEST['changes'] ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$id = absint( $_REQUEST['id'] );\n\tif ( ! $id ) {\n\t\twp_send_json_error();\n\t}\n\n\tcheck_ajax_referer( 'update-post_' . $id, 'nonce' );\n\n\tif ( ! current_user_can( 'edit_post', $id ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$changes = $_REQUEST['changes'];\n\t$post    = get_post( $id, ARRAY_A );\n\n\tif ( 'attachment' !== $post['post_type'] ) {\n\t\twp_send_json_error();\n\t}\n\n\tif ( isset( $changes['parent'] ) ) {\n\t\t$post['post_parent'] = $changes['parent'];\n\t}\n\n\tif ( isset( $changes['title'] ) ) {\n\t\t$post['post_title'] = $changes['title'];\n\t}\n\n\tif ( isset( $changes['caption'] ) ) {\n\t\t$post['post_excerpt'] = $changes['caption'];\n\t}\n\n\tif ( isset( $changes['description'] ) ) {\n\t\t$post['post_content'] = $changes['description'];\n\t}\n\n\tif ( MEDIA_TRASH && isset( $changes['status'] ) ) {\n\t\t$post['post_status'] = $changes['status'];\n\t}\n\n\tif ( isset( $changes['alt'] ) ) {\n\t\t$alt = wp_unslash( $changes['alt'] );\n\t\tif ( get_post_meta( $id, '_wp_attachment_image_alt', true ) !== $alt ) {\n\t\t\t$alt = wp_strip_all_tags( $alt, true );\n\t\t\tupdate_post_meta( $id, '_wp_attachment_image_alt', wp_slash( $alt ) );\n\t\t}\n\t}\n\n\tif ( wp_attachment_is( 'audio', $post['ID'] ) ) {\n\t\t$changed = false;\n\t\t$id3data = wp_get_attachment_metadata( $post['ID'] );\n\n\t\tif ( ! is_array( $id3data ) ) {\n\t\t\t$changed = true;\n\t\t\t$id3data = array();\n\t\t}\n\n\t\tforeach ( wp_get_attachment_id3_keys( (object) $post, 'edit' ) as $key => $label ) {\n\t\t\tif ( isset( $changes[ $key ] ) ) {\n\t\t\t\t$changed         = true;\n\t\t\t\t$id3data[ $key ] = sanitize_text_field( wp_unslash( $changes[ $key ] ) );\n\t\t\t}\n\t\t}\n\n\t\tif ( $changed ) {\n\t\t\twp_update_attachment_metadata( $id, $id3data );\n\t\t}\n\t}\n\n\tif ( MEDIA_TRASH && isset( $changes['status'] ) && 'trash' === $changes['status'] ) {\n\t\twp_delete_post( $id );\n\t} else {\n\t\twp_update_post( $post );\n\t}\n\n\twp_send_json_success();\n}\n\n/**\n * Ajax handler for saving backward compatible attachment attributes.\n *\n * @since 3.5.0\n */\nfunction wp_ajax_save_attachment_compat() {\n\tif ( ! isset( $_REQUEST['id'] ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$id = absint( $_REQUEST['id'] );\n\tif ( ! $id ) {\n\t\twp_send_json_error();\n\t}\n\n\tif ( empty( $_REQUEST['attachments'] ) || empty( $_REQUEST['attachments'][ $id ] ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$attachment_data = $_REQUEST['attachments'][ $id ];\n\n\tcheck_ajax_referer( 'update-post_' . $id, 'nonce' );\n\n\tif ( ! current_user_can( 'edit_post', $id ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$post = get_post( $id, ARRAY_A );\n\n\tif ( 'attachment' !== $post['post_type'] ) {\n\t\twp_send_json_error();\n\t}\n\n\t/** This filter is documented in wp-admin/includes/media.php */\n\t$post = apply_filters( 'attachment_fields_to_save', $post, $attachment_data );\n\n\tif ( isset( $post['errors'] ) ) {\n\t\t$errors = $post['errors']; // @todo return me and display me!\n\t\tunset( $post['errors'] );\n\t}\n\n\twp_update_post( $post );\n\n\tforeach ( get_attachment_taxonomies( $post ) as $taxonomy ) {\n\t\tif ( isset( $attachment_data[ $taxonomy ] ) ) {\n\t\t\twp_set_object_terms( $id, array_map( 'trim', preg_split( '/,+/', $attachment_data[ $taxonomy ] ) ), $taxonomy, false );\n\t\t}\n\t}\n\n\t$attachment = wp_prepare_attachment_for_js( $id );\n\n\tif ( ! $attachment ) {\n\t\twp_send_json_error();\n\t}\n\n\twp_send_json_success( $attachment );\n}\n\n/**\n * Ajax handler for saving the attachment order.\n *\n * @since 3.5.0\n */\nfunction wp_ajax_save_attachment_order() {\n\tif ( ! isset( $_REQUEST['post_id'] ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$post_id = absint( $_REQUEST['post_id'] );\n\tif ( ! $post_id ) {\n\t\twp_send_json_error();\n\t}\n\n\tif ( empty( $_REQUEST['attachments'] ) ) {\n\t\twp_send_json_error();\n\t}\n\n\tcheck_ajax_referer( 'update-post_' . $post_id, 'nonce' );\n\n\t$attachments = $_REQUEST['attachments'];\n\n\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\twp_send_json_error();\n\t}\n\n\tforeach ( $attachments as $attachment_id => $menu_order ) {\n\t\tif ( ! current_user_can( 'edit_post', $attachment_id ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$attachment = get_post( $attachment_id );\n\n\t\tif ( ! $attachment ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( 'attachment' !== $attachment->post_type ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\twp_update_post(\n\t\t\tarray(\n\t\t\t\t'ID'         => $attachment_id,\n\t\t\t\t'menu_order' => $menu_order,\n\t\t\t)\n\t\t);\n\t}\n\n\twp_send_json_success();\n}\n\n/**\n * Ajax handler for sending an attachment to the editor.\n *\n * Generates the HTML to send an attachment to the editor.\n * Backward compatible with the {@see 'media_send_to_editor'} filter\n * and the chain of filters that follow.\n *\n * @since 3.5.0\n */\nfunction wp_ajax_send_attachment_to_editor() {\n\tcheck_ajax_referer( 'media-send-to-editor', 'nonce' );\n\n\t$attachment = wp_unslash( $_POST['attachment'] );\n\n\t$id = intval( $attachment['id'] );\n\n\t$post = get_post( $id );\n\tif ( ! $post ) {\n\t\twp_send_json_error();\n\t}\n\n\tif ( 'attachment' !== $post->post_type ) {\n\t\twp_send_json_error();\n\t}\n\n\tif ( current_user_can( 'edit_post', $id ) ) {\n\t\t// If this attachment is unattached, attach it. Primarily a back compat thing.\n\t\t$insert_into_post_id = intval( $_POST['post_id'] );\n\n\t\tif ( 0 == $post->post_parent && $insert_into_post_id ) {\n\t\t\twp_update_post(\n\t\t\t\tarray(\n\t\t\t\t\t'ID'          => $id,\n\t\t\t\t\t'post_parent' => $insert_into_post_id,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\t$url = empty( $attachment['url'] ) ? '' : $attachment['url'];\n\t$rel = ( strpos( $url, 'attachment_id' ) || get_attachment_link( $id ) == $url );\n\n\tremove_filter( 'media_send_to_editor', 'image_media_send_to_editor' );\n\n\tif ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) {\n\t\t$align = isset( $attachment['align'] ) ? $attachment['align'] : 'none';\n\t\t$size  = isset( $attachment['image-size'] ) ? $attachment['image-size'] : 'medium';\n\t\t$alt   = isset( $attachment['image_alt'] ) ? $attachment['image_alt'] : '';\n\n\t\t// No whitespace-only captions.\n\t\t$caption = isset( $attachment['post_excerpt'] ) ? $attachment['post_excerpt'] : '';\n\t\tif ( '' === trim( $caption ) ) {\n\t\t\t$caption = '';\n\t\t}\n\n\t\t$title = ''; // We no longer insert title tags into <img> tags, as they are redundant.\n\t\t$html  = get_image_send_to_editor( $id, $caption, $title, $align, $url, $rel, $size, $alt );\n\t} elseif ( wp_attachment_is( 'video', $post ) || wp_attachment_is( 'audio', $post ) ) {\n\t\t$html = stripslashes_deep( $_POST['html'] );\n\t} else {\n\t\t$html = isset( $attachment['post_title'] ) ? $attachment['post_title'] : '';\n\t\t$rel  = $rel ? ' rel=\"attachment wp-att-' . $id . '\"' : ''; // Hard-coded string, $id is already sanitized.\n\n\t\tif ( ! empty( $url ) ) {\n\t\t\t$html = '<a href=\"' . esc_url( $url ) . '\"' . $rel . '>' . $html . '</a>';\n\t\t}\n\t}\n\n\t/** This filter is documented in wp-admin/includes/media.php */\n\t$html = apply_filters( 'media_send_to_editor', $html, $id, $attachment );\n\n\twp_send_json_success( $html );\n}\n\n/**\n * Ajax handler for sending a link to the editor.\n *\n * Generates the HTML to send a non-image embed link to the editor.\n *\n * Backward compatible with the following filters:\n * - file_send_to_editor_url\n * - audio_send_to_editor_url\n * - video_send_to_editor_url\n *\n * @since 3.5.0\n *\n * @global WP_Post  $post     Global post object.\n * @global WP_Embed $wp_embed\n */\nfunction wp_ajax_send_link_to_editor() {\n\tglobal $post, $wp_embed;\n\n\tcheck_ajax_referer( 'media-send-to-editor', 'nonce' );\n\n\t$src = wp_unslash( $_POST['src'] );\n\tif ( ! $src ) {\n\t\twp_send_json_error();\n\t}\n\n\tif ( ! strpos( $src, '://' ) ) {\n\t\t$src = 'http://' . $src;\n\t}\n\n\t$src = esc_url_raw( $src );\n\tif ( ! $src ) {\n\t\twp_send_json_error();\n\t}\n\n\t$link_text = trim( wp_unslash( $_POST['link_text'] ) );\n\tif ( ! $link_text ) {\n\t\t$link_text = wp_basename( $src );\n\t}\n\n\t$post = get_post( isset( $_POST['post_id'] ) ? $_POST['post_id'] : 0 );\n\n\t// Ping WordPress for an embed.\n\t$check_embed = $wp_embed->run_shortcode( '[embed]' . $src . '[/embed]' );\n\n\t// Fallback that WordPress creates when no oEmbed was found.\n\t$fallback = $wp_embed->maybe_make_link( $src );\n\n\tif ( $check_embed !== $fallback ) {\n\t\t// TinyMCE view for [embed] will parse this.\n\t\t$html = '[embed]' . $src . '[/embed]';\n\t} elseif ( $link_text ) {\n\t\t$html = '<a href=\"' . esc_url( $src ) . '\">' . $link_text . '</a>';\n\t} else {\n\t\t$html = '';\n\t}\n\n\t// Figure out what filter to run:\n\t$type = 'file';\n\t$ext  = preg_replace( '/^.+?\\.([^.]+)$/', '$1', $src );\n\tif ( $ext ) {\n\t\t$ext_type = wp_ext2type( $ext );\n\t\tif ( 'audio' === $ext_type || 'video' === $ext_type ) {\n\t\t\t$type = $ext_type;\n\t\t}\n\t}\n\n\t/** This filter is documented in wp-admin/includes/media.php */\n\t$html = apply_filters( \"{$type}_send_to_editor_url\", $html, $src, $link_text );\n\n\twp_send_json_success( $html );\n}\n\n/**\n * Ajax handler for the Heartbeat API.\n *\n * Runs when the user is logged in.\n *\n * @since 3.6.0\n */\nfunction wp_ajax_heartbeat() {\n\tif ( empty( $_POST['_nonce'] ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$response    = array();\n\t$data        = array();\n\t$nonce_state = wp_verify_nonce( $_POST['_nonce'], 'heartbeat-nonce' );\n\n\t// 'screen_id' is the same as $current_screen->id and the JS global 'pagenow'.\n\tif ( ! empty( $_POST['screen_id'] ) ) {\n\t\t$screen_id = sanitize_key( $_POST['screen_id'] );\n\t} else {\n\t\t$screen_id = 'front';\n\t}\n\n\tif ( ! empty( $_POST['data'] ) ) {\n\t\t$data = wp_unslash( (array) $_POST['data'] );\n\t}\n\n\tif ( 1 !== $nonce_state ) {\n\t\t/**\n\t\t * Filters the nonces to send to the New/Edit Post screen.\n\t\t *\n\t\t * @since 4.3.0\n\t\t *\n\t\t * @param array  $response  The Heartbeat response.\n\t\t * @param array  $data      The $_POST data sent.\n\t\t * @param string $screen_id The screen ID.\n\t\t */\n\t\t$response = apply_filters( 'wp_refresh_nonces', $response, $data, $screen_id );\n\n\t\tif ( false === $nonce_state ) {\n\t\t\t// User is logged in but nonces have expired.\n\t\t\t$response['nonces_expired'] = true;\n\t\t\twp_send_json( $response );\n\t\t}\n\t}\n\n\tif ( ! empty( $data ) ) {\n\t\t/**\n\t\t * Filters the Heartbeat response received.\n\t\t *\n\t\t * @since 3.6.0\n\t\t *\n\t\t * @param array  $response  The Heartbeat response.\n\t\t * @param array  $data      The $_POST data sent.\n\t\t * @param string $screen_id The screen ID.\n\t\t */\n\t\t$response = apply_filters( 'heartbeat_received', $response, $data, $screen_id );\n\t}\n\n\t/**\n\t * Filters the Heartbeat response sent.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param array  $response  The Heartbeat response.\n\t * @param string $screen_id The screen ID.\n\t */\n\t$response = apply_filters( 'heartbeat_send', $response, $screen_id );\n\n\t/**\n\t * Fires when Heartbeat ticks in logged-in environments.\n\t *\n\t * Allows the transport to be easily replaced with long-polling.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param array  $response  The Heartbeat response.\n\t * @param string $screen_id The screen ID.\n\t */\n\tdo_action( 'heartbeat_tick', $response, $screen_id );\n\n\t// Send the current time according to the server.\n\t$response['server_time'] = time();\n\n\twp_send_json( $response );\n}\n\n/**\n * Ajax handler for getting revision diffs.\n *\n * @since 3.6.0\n */\nfunction wp_ajax_get_revision_diffs() {\n\trequire ABSPATH . 'wp-admin/includes/revision.php';\n\n\t$post = get_post( (int) $_REQUEST['post_id'] );\n\tif ( ! $post ) {\n\t\twp_send_json_error();\n\t}\n\n\tif ( ! current_user_can( 'edit_post', $post->ID ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t// Really just pre-loading the cache here.\n\t$revisions = wp_get_post_revisions( $post->ID, array( 'check_enabled' => false ) );\n\tif ( ! $revisions ) {\n\t\twp_send_json_error();\n\t}\n\n\t$return = array();\n\tset_time_limit( 0 );\n\n\tforeach ( $_REQUEST['compare'] as $compare_key ) {\n\t\tlist( $compare_from, $compare_to ) = explode( ':', $compare_key ); // from:to\n\n\t\t$return[] = array(\n\t\t\t'id'     => $compare_key,\n\t\t\t'fields' => wp_get_revision_ui_diff( $post, $compare_from, $compare_to ),\n\t\t);\n\t}\n\twp_send_json_success( $return );\n}\n\n/**\n * Ajax handler for auto-saving the selected color scheme for\n * a user's own profile.\n *\n * @since 3.8.0\n *\n * @global array $_wp_admin_css_colors\n */\nfunction wp_ajax_save_user_color_scheme() {\n\tglobal $_wp_admin_css_colors;\n\n\tcheck_ajax_referer( 'save-color-scheme', 'nonce' );\n\n\t$color_scheme = sanitize_key( $_POST['color_scheme'] );\n\n\tif ( ! isset( $_wp_admin_css_colors[ $color_scheme ] ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$previous_color_scheme = get_user_meta( get_current_user_id(), 'admin_color', true );\n\tupdate_user_meta( get_current_user_id(), 'admin_color', $color_scheme );\n\n\twp_send_json_success(\n\t\tarray(\n\t\t\t'previousScheme' => 'admin-color-' . $previous_color_scheme,\n\t\t\t'currentScheme'  => 'admin-color-' . $color_scheme,\n\t\t)\n\t);\n}\n\n/**\n * Ajax handler for getting themes from themes_api().\n *\n * @since 3.9.0\n *\n * @global array $themes_allowedtags\n * @global array $theme_field_defaults\n */\nfunction wp_ajax_query_themes() {\n\tglobal $themes_allowedtags, $theme_field_defaults;\n\n\tif ( ! current_user_can( 'install_themes' ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$args = wp_parse_args(\n\t\twp_unslash( $_REQUEST['request'] ),\n\t\tarray(\n\t\t\t'per_page' => 20,\n\t\t\t'fields'   => array_merge(\n\t\t\t\t(array) $theme_field_defaults,\n\t\t\t\tarray(\n\t\t\t\t\t'reviews_url' => true, // Explicitly request the reviews URL to be linked from the Add Themes screen.\n\t\t\t\t)\n\t\t\t),\n\t\t)\n\t);\n\n\tif ( isset( $args['browse'] ) && 'favorites' === $args['browse'] && ! isset( $args['user'] ) ) {\n\t\t$user = get_user_option( 'wporg_favorites' );\n\t\tif ( $user ) {\n\t\t\t$args['user'] = $user;\n\t\t}\n\t}\n\n\t$old_filter = isset( $args['browse'] ) ? $args['browse'] : 'search';\n\n\t/** This filter is documented in wp-admin/includes/class-wp-theme-install-list-table.php */\n\t$args = apply_filters( 'install_themes_table_api_args_' . $old_filter, $args );\n\n\t$api = themes_api( 'query_themes', $args );\n\n\tif ( is_wp_error( $api ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$update_php = network_admin_url( 'update.php?action=install-theme' );\n\n\tforeach ( $api->themes as &$theme ) {\n\t\t$theme->install_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'theme'    => $theme->slug,\n\t\t\t\t'_wpnonce' => wp_create_nonce( 'install-theme_' . $theme->slug ),\n\t\t\t),\n\t\t\t$update_php\n\t\t);\n\n\t\tif ( current_user_can( 'switch_themes' ) ) {\n\t\t\tif ( is_multisite() ) {\n\t\t\t\t$theme->activate_url = add_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'action'   => 'enable',\n\t\t\t\t\t\t'_wpnonce' => wp_create_nonce( 'enable-theme_' . $theme->slug ),\n\t\t\t\t\t\t'theme'    => $theme->slug,\n\t\t\t\t\t),\n\t\t\t\t\tnetwork_admin_url( 'themes.php' )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$theme->activate_url = add_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'action'     => 'activate',\n\t\t\t\t\t\t'_wpnonce'   => wp_create_nonce( 'switch-theme_' . $theme->slug ),\n\t\t\t\t\t\t'stylesheet' => $theme->slug,\n\t\t\t\t\t),\n\t\t\t\t\tadmin_url( 'themes.php' )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( ! is_multisite() && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {\n\t\t\t$theme->customize_url = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'return' => urlencode( network_admin_url( 'theme-install.php', 'relative' ) ),\n\t\t\t\t),\n\t\t\t\twp_customize_url( $theme->slug )\n\t\t\t);\n\t\t}\n\n\t\t$theme->name        = wp_kses( $theme->name, $themes_allowedtags );\n\t\t$theme->author      = wp_kses( $theme->author['display_name'], $themes_allowedtags );\n\t\t$theme->version     = wp_kses( $theme->version, $themes_allowedtags );\n\t\t$theme->description = wp_kses( $theme->description, $themes_allowedtags );\n\n\t\t$theme->stars = wp_star_rating(\n\t\t\tarray(\n\t\t\t\t'rating' => $theme->rating,\n\t\t\t\t'type'   => 'percent',\n\t\t\t\t'number' => $theme->num_ratings,\n\t\t\t\t'echo'   => false,\n\t\t\t)\n\t\t);\n\n\t\t$theme->num_ratings    = number_format_i18n( $theme->num_ratings );\n\t\t$theme->preview_url    = set_url_scheme( $theme->preview_url );\n\t\t$theme->compatible_wp  = is_wp_version_compatible( $theme->requires );\n\t\t$theme->compatible_php = is_php_version_compatible( $theme->requires_php );\n\t}\n\n\twp_send_json_success( $api );\n}\n\n/**\n * Apply [embed] Ajax handlers to a string.\n *\n * @since 4.0.0\n *\n * @global WP_Post    $post       Global post object.\n * @global WP_Embed   $wp_embed   Embed API instance.\n * @global WP_Scripts $wp_scripts\n * @global int        $content_width\n */\nfunction wp_ajax_parse_embed() {\n\tglobal $post, $wp_embed, $content_width;\n\n\tif ( empty( $_POST['shortcode'] ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$post_id = isset( $_POST['post_ID'] ) ? intval( $_POST['post_ID'] ) : 0;\n\n\tif ( $post_id > 0 ) {\n\t\t$post = get_post( $post_id );\n\n\t\tif ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) {\n\t\t\twp_send_json_error();\n\t\t}\n\t\tsetup_postdata( $post );\n\t} elseif ( ! current_user_can( 'edit_posts' ) ) { // See WP_oEmbed_Controller::get_proxy_item_permissions_check().\n\t\twp_send_json_error();\n\t}\n\n\t$shortcode = wp_unslash( $_POST['shortcode'] );\n\n\tpreg_match( '/' . get_shortcode_regex() . '/s', $shortcode, $matches );\n\t$atts = shortcode_parse_atts( $matches[3] );\n\n\tif ( ! empty( $matches[5] ) ) {\n\t\t$url = $matches[5];\n\t} elseif ( ! empty( $atts['src'] ) ) {\n\t\t$url = $atts['src'];\n\t} else {\n\t\t$url = '';\n\t}\n\n\t$parsed                         = false;\n\t$wp_embed->return_false_on_fail = true;\n\n\tif ( 0 === $post_id ) {\n\t\t/*\n\t\t * Refresh oEmbeds cached outside of posts that are past their TTL.\n\t\t * Posts are excluded because they have separate logic for refreshing\n\t\t * their post meta caches. See WP_Embed::cache_oembed().\n\t\t */\n\t\t$wp_embed->usecache = false;\n\t}\n\n\tif ( is_ssl() && 0 === strpos( $url, 'http://' ) ) {\n\t\t// Admin is ssl and the user pasted non-ssl URL.\n\t\t// Check if the provider supports ssl embeds and use that for the preview.\n\t\t$ssl_shortcode = preg_replace( '%^(\\\\[embed[^\\\\]]*\\\\])http://%i', '$1https://', $shortcode );\n\t\t$parsed        = $wp_embed->run_shortcode( $ssl_shortcode );\n\n\t\tif ( ! $parsed ) {\n\t\t\t$no_ssl_support = true;\n\t\t}\n\t}\n\n\t// Set $content_width so any embeds fit in the destination iframe.\n\tif ( isset( $_POST['maxwidth'] ) && is_numeric( $_POST['maxwidth'] ) && $_POST['maxwidth'] > 0 ) {\n\t\tif ( ! isset( $content_width ) ) {\n\t\t\t$content_width = intval( $_POST['maxwidth'] );\n\t\t} else {\n\t\t\t$content_width = min( $content_width, intval( $_POST['maxwidth'] ) );\n\t\t}\n\t}\n\n\tif ( $url && ! $parsed ) {\n\t\t$parsed = $wp_embed->run_shortcode( $shortcode );\n\t}\n\n\tif ( ! $parsed ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'type'    => 'not-embeddable',\n\t\t\t\t/* translators: %s: URL that could not be embedded. */\n\t\t\t\t'message' => sprintf( __( '%s failed to embed.' ), '<code>' . esc_html( $url ) . '</code>' ),\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( has_shortcode( $parsed, 'audio' ) || has_shortcode( $parsed, 'video' ) ) {\n\t\t$styles     = '';\n\t\t$mce_styles = wpview_media_sandbox_styles();\n\n\t\tforeach ( $mce_styles as $style ) {\n\t\t\t$styles .= sprintf( '<link rel=\"stylesheet\" href=\"%s\"/>', $style );\n\t\t}\n\n\t\t$html = do_shortcode( $parsed );\n\n\t\tglobal $wp_scripts;\n\n\t\tif ( ! empty( $wp_scripts ) ) {\n\t\t\t$wp_scripts->done = array();\n\t\t}\n\n\t\tob_start();\n\t\twp_print_scripts( array( 'mediaelement-vimeo', 'wp-mediaelement' ) );\n\t\t$scripts = ob_get_clean();\n\n\t\t$parsed = $styles . $html . $scripts;\n\t}\n\n\tif ( ! empty( $no_ssl_support ) || ( is_ssl() && ( preg_match( '%<(iframe|script|embed) [^>]*src=\"http://%', $parsed ) ||\n\t\tpreg_match( '%<link [^>]*href=\"http://%', $parsed ) ) ) ) {\n\t\t// Admin is ssl and the embed is not. Iframes, scripts, and other \"active content\" will be blocked.\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'type'    => 'not-ssl',\n\t\t\t\t'message' => __( 'This preview is unavailable in the editor.' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t$return = array(\n\t\t'body' => $parsed,\n\t\t'attr' => $wp_embed->last_attr,\n\t);\n\n\tif ( strpos( $parsed, 'class=\"wp-embedded-content' ) ) {\n\t\tif ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {\n\t\t\t$script_src = includes_url( 'js/wp-embed.js' );\n\t\t} else {\n\t\t\t$script_src = includes_url( 'js/wp-embed.min.js' );\n\t\t}\n\n\t\t$return['head']    = '<script src=\"' . $script_src . '\"></script>';\n\t\t$return['sandbox'] = true;\n\t}\n\n\twp_send_json_success( $return );\n}\n\n/**\n * @since 4.0.0\n *\n * @global WP_Post    $post       Global post object.\n * @global WP_Scripts $wp_scripts\n */\nfunction wp_ajax_parse_media_shortcode() {\n\tglobal $post, $wp_scripts;\n\n\tif ( empty( $_POST['shortcode'] ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$shortcode = wp_unslash( $_POST['shortcode'] );\n\n\tif ( ! empty( $_POST['post_ID'] ) ) {\n\t\t$post = get_post( (int) $_POST['post_ID'] );\n\t}\n\n\t// The embed shortcode requires a post.\n\tif ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) {\n\t\tif ( 'embed' === $shortcode ) {\n\t\t\twp_send_json_error();\n\t\t}\n\t} else {\n\t\tsetup_postdata( $post );\n\t}\n\n\t$parsed = do_shortcode( $shortcode );\n\n\tif ( empty( $parsed ) ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'type'    => 'no-items',\n\t\t\t\t'message' => __( 'No items found.' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t$head   = '';\n\t$styles = wpview_media_sandbox_styles();\n\n\tforeach ( $styles as $style ) {\n\t\t$head .= '<link type=\"text/css\" rel=\"stylesheet\" href=\"' . $style . '\">';\n\t}\n\n\tif ( ! empty( $wp_scripts ) ) {\n\t\t$wp_scripts->done = array();\n\t}\n\n\tob_start();\n\n\techo $parsed;\n\n\tif ( 'playlist' === $_REQUEST['type'] ) {\n\t\twp_underscore_playlist_templates();\n\n\t\twp_print_scripts( 'wp-playlist' );\n\t} else {\n\t\twp_print_scripts( array( 'mediaelement-vimeo', 'wp-mediaelement' ) );\n\t}\n\n\twp_send_json_success(\n\t\tarray(\n\t\t\t'head' => $head,\n\t\t\t'body' => ob_get_clean(),\n\t\t)\n\t);\n}\n\n/**\n * Ajax handler for destroying multiple open sessions for a user.\n *\n * @since 4.1.0\n */\nfunction wp_ajax_destroy_sessions() {\n\t$user = get_userdata( (int) $_POST['user_id'] );\n\n\tif ( $user ) {\n\t\tif ( ! current_user_can( 'edit_user', $user->ID ) ) {\n\t\t\t$user = false;\n\t\t} elseif ( ! wp_verify_nonce( $_POST['nonce'], 'update-user_' . $user->ID ) ) {\n\t\t\t$user = false;\n\t\t}\n\t}\n\n\tif ( ! $user ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Could not log out user sessions. Please try again.' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t$sessions = WP_Session_Tokens::get_instance( $user->ID );\n\n\tif ( get_current_user_id() === $user->ID ) {\n\t\t$sessions->destroy_others( wp_get_session_token() );\n\t\t$message = __( 'You are now logged out everywhere else.' );\n\t} else {\n\t\t$sessions->destroy_all();\n\t\t/* translators: %s: User's display name. */\n\t\t$message = sprintf( __( '%s has been logged out.' ), $user->display_name );\n\t}\n\n\twp_send_json_success( array( 'message' => $message ) );\n}\n\n/**\n * Ajax handler for cropping an image.\n *\n * @since 4.3.0\n */\nfunction wp_ajax_crop_image() {\n\t$attachment_id = absint( $_POST['id'] );\n\n\tcheck_ajax_referer( 'image_editor-' . $attachment_id, 'nonce' );\n\n\tif ( empty( $attachment_id ) || ! current_user_can( 'edit_post', $attachment_id ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$context = str_replace( '_', '-', $_POST['context'] );\n\t$data    = array_map( 'absint', $_POST['cropDetails'] );\n\t$cropped = wp_crop_image( $attachment_id, $data['x1'], $data['y1'], $data['width'], $data['height'], $data['dst_width'], $data['dst_height'] );\n\n\tif ( ! $cropped || is_wp_error( $cropped ) ) {\n\t\twp_send_json_error( array( 'message' => __( 'Image could not be processed.' ) ) );\n\t}\n\n\tswitch ( $context ) {\n\t\tcase 'site-icon':\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-site-icon.php';\n\t\t\t$wp_site_icon = new WP_Site_Icon();\n\n\t\t\t// Skip creating a new attachment if the attachment is a Site Icon.\n\t\t\tif ( get_post_meta( $attachment_id, '_wp_attachment_context', true ) == $context ) {\n\n\t\t\t\t// Delete the temporary cropped file, we don't need it.\n\t\t\t\twp_delete_file( $cropped );\n\n\t\t\t\t// Additional sizes in wp_prepare_attachment_for_js().\n\t\t\t\tadd_filter( 'image_size_names_choose', array( $wp_site_icon, 'additional_sizes' ) );\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/** This filter is documented in wp-admin/includes/class-custom-image-header.php */\n\t\t\t$cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.\n\t\t\t$object  = $wp_site_icon->create_attachment_object( $cropped, $attachment_id );\n\t\t\tunset( $object['ID'] );\n\n\t\t\t// Update the attachment.\n\t\t\tadd_filter( 'intermediate_image_sizes_advanced', array( $wp_site_icon, 'additional_sizes' ) );\n\t\t\t$attachment_id = $wp_site_icon->insert_attachment( $object, $cropped );\n\t\t\tremove_filter( 'intermediate_image_sizes_advanced', array( $wp_site_icon, 'additional_sizes' ) );\n\n\t\t\t// Additional sizes in wp_prepare_attachment_for_js().\n\t\t\tadd_filter( 'image_size_names_choose', array( $wp_site_icon, 'additional_sizes' ) );\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\t/**\n\t\t\t * Fires before a cropped image is saved.\n\t\t\t *\n\t\t\t * Allows to add filters to modify the way a cropped image is saved.\n\t\t\t *\n\t\t\t * @since 4.3.0\n\t\t\t *\n\t\t\t * @param string $context       The Customizer control requesting the cropped image.\n\t\t\t * @param int    $attachment_id The attachment ID of the original image.\n\t\t\t * @param string $cropped       Path to the cropped image file.\n\t\t\t */\n\t\t\tdo_action( 'wp_ajax_crop_image_pre_save', $context, $attachment_id, $cropped );\n\n\t\t\t/** This filter is documented in wp-admin/includes/class-custom-image-header.php */\n\t\t\t$cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.\n\n\t\t\t$parent_url = wp_get_attachment_url( $attachment_id );\n\t\t\t$url        = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url );\n\n\t\t\t$size       = @getimagesize( $cropped );\n\t\t\t$image_type = ( $size ) ? $size['mime'] : 'image/jpeg';\n\n\t\t\t$object = array(\n\t\t\t\t'post_title'     => wp_basename( $cropped ),\n\t\t\t\t'post_content'   => $url,\n\t\t\t\t'post_mime_type' => $image_type,\n\t\t\t\t'guid'           => $url,\n\t\t\t\t'context'        => $context,\n\t\t\t);\n\n\t\t\t$attachment_id = wp_insert_attachment( $object, $cropped );\n\t\t\t$metadata      = wp_generate_attachment_metadata( $attachment_id, $cropped );\n\n\t\t\t/**\n\t\t\t * Filters the cropped image attachment metadata.\n\t\t\t *\n\t\t\t * @since 4.3.0\n\t\t\t *\n\t\t\t * @see wp_generate_attachment_metadata()\n\t\t\t *\n\t\t\t * @param array $metadata Attachment metadata.\n\t\t\t */\n\t\t\t$metadata = apply_filters( 'wp_ajax_cropped_attachment_metadata', $metadata );\n\t\t\twp_update_attachment_metadata( $attachment_id, $metadata );\n\n\t\t\t/**\n\t\t\t * Filters the attachment ID for a cropped image.\n\t\t\t *\n\t\t\t * @since 4.3.0\n\t\t\t *\n\t\t\t * @param int    $attachment_id The attachment ID of the cropped image.\n\t\t\t * @param string $context       The Customizer control requesting the cropped image.\n\t\t\t */\n\t\t\t$attachment_id = apply_filters( 'wp_ajax_cropped_attachment_id', $attachment_id, $context );\n\t}\n\n\twp_send_json_success( wp_prepare_attachment_for_js( $attachment_id ) );\n}\n\n/**\n * Ajax handler for generating a password.\n *\n * @since 4.4.0\n */\nfunction wp_ajax_generate_password() {\n\twp_send_json_success( wp_generate_password( 24 ) );\n}\n\n/**\n * Ajax handler for saving the user's WordPress.org username.\n *\n * @since 4.4.0\n */\nfunction wp_ajax_save_wporg_username() {\n\tif ( ! current_user_can( 'install_themes' ) && ! current_user_can( 'install_plugins' ) ) {\n\t\twp_send_json_error();\n\t}\n\n\tcheck_ajax_referer( 'save_wporg_username_' . get_current_user_id() );\n\n\t$username = isset( $_REQUEST['username'] ) ? wp_unslash( $_REQUEST['username'] ) : false;\n\n\tif ( ! $username ) {\n\t\twp_send_json_error();\n\t}\n\n\twp_send_json_success( update_user_meta( get_current_user_id(), 'wporg_favorites', $username ) );\n}\n\n/**\n * Ajax handler for installing a theme.\n *\n * @since 4.6.0\n *\n * @see Theme_Upgrader\n *\n * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n */\nfunction wp_ajax_install_theme() {\n\tcheck_ajax_referer( 'updates' );\n\n\tif ( empty( $_POST['slug'] ) ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'slug'         => '',\n\t\t\t\t'errorCode'    => 'no_theme_specified',\n\t\t\t\t'errorMessage' => __( 'No theme specified.' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t$slug = sanitize_key( wp_unslash( $_POST['slug'] ) );\n\n\t$status = array(\n\t\t'install' => 'theme',\n\t\t'slug'    => $slug,\n\t);\n\n\tif ( ! current_user_can( 'install_themes' ) ) {\n\t\t$status['errorMessage'] = __( 'Sorry, you are not allowed to install themes on this site.' );\n\t\twp_send_json_error( $status );\n\t}\n\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\tinclude_once ABSPATH . 'wp-admin/includes/theme.php';\n\n\t$api = themes_api(\n\t\t'theme_information',\n\t\tarray(\n\t\t\t'slug'   => $slug,\n\t\t\t'fields' => array( 'sections' => false ),\n\t\t)\n\t);\n\n\tif ( is_wp_error( $api ) ) {\n\t\t$status['errorMessage'] = $api->get_error_message();\n\t\twp_send_json_error( $status );\n\t}\n\n\t$skin     = new WP_Ajax_Upgrader_Skin();\n\t$upgrader = new Theme_Upgrader( $skin );\n\t$result   = $upgrader->install( $api->download_link );\n\n\tif ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {\n\t\t$status['debug'] = $skin->get_upgrade_messages();\n\t}\n\n\tif ( is_wp_error( $result ) ) {\n\t\t$status['errorCode']    = $result->get_error_code();\n\t\t$status['errorMessage'] = $result->get_error_message();\n\t\twp_send_json_error( $status );\n\t} elseif ( is_wp_error( $skin->result ) ) {\n\t\t$status['errorCode']    = $skin->result->get_error_code();\n\t\t$status['errorMessage'] = $skin->result->get_error_message();\n\t\twp_send_json_error( $status );\n\t} elseif ( $skin->get_errors()->has_errors() ) {\n\t\t$status['errorMessage'] = $skin->get_error_messages();\n\t\twp_send_json_error( $status );\n\t} elseif ( is_null( $result ) ) {\n\t\tglobal $wp_filesystem;\n\n\t\t$status['errorCode']    = 'unable_to_connect_to_filesystem';\n\t\t$status['errorMessage'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );\n\n\t\t// Pass through the error from WP_Filesystem if one was raised.\n\t\tif ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {\n\t\t\t$status['errorMessage'] = esc_html( $wp_filesystem->errors->get_error_message() );\n\t\t}\n\n\t\twp_send_json_error( $status );\n\t}\n\n\t$status['themeName'] = wp_get_theme( $slug )->get( 'Name' );\n\n\tif ( current_user_can( 'switch_themes' ) ) {\n\t\tif ( is_multisite() ) {\n\t\t\t$status['activateUrl'] = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'action'   => 'enable',\n\t\t\t\t\t'_wpnonce' => wp_create_nonce( 'enable-theme_' . $slug ),\n\t\t\t\t\t'theme'    => $slug,\n\t\t\t\t),\n\t\t\t\tnetwork_admin_url( 'themes.php' )\n\t\t\t);\n\t\t} else {\n\t\t\t$status['activateUrl'] = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'action'     => 'activate',\n\t\t\t\t\t'_wpnonce'   => wp_create_nonce( 'switch-theme_' . $slug ),\n\t\t\t\t\t'stylesheet' => $slug,\n\t\t\t\t),\n\t\t\t\tadmin_url( 'themes.php' )\n\t\t\t);\n\t\t}\n\t}\n\n\tif ( ! is_multisite() && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {\n\t\t$status['customizeUrl'] = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'return' => urlencode( network_admin_url( 'theme-install.php', 'relative' ) ),\n\t\t\t),\n\t\t\twp_customize_url( $slug )\n\t\t);\n\t}\n\n\t/*\n\t * See WP_Theme_Install_List_Table::_get_theme_status() if we wanted to check\n\t * on post-installation status.\n\t */\n\twp_send_json_success( $status );\n}\n\n/**\n * Ajax handler for updating a theme.\n *\n * @since 4.6.0\n *\n * @see Theme_Upgrader\n *\n * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n */\nfunction wp_ajax_update_theme() {\n\tcheck_ajax_referer( 'updates' );\n\n\tif ( empty( $_POST['slug'] ) ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'slug'         => '',\n\t\t\t\t'errorCode'    => 'no_theme_specified',\n\t\t\t\t'errorMessage' => __( 'No theme specified.' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t$stylesheet = preg_replace( '/[^A-z0-9_\\-]/', '', wp_unslash( $_POST['slug'] ) );\n\t$status     = array(\n\t\t'update'     => 'theme',\n\t\t'slug'       => $stylesheet,\n\t\t'oldVersion' => '',\n\t\t'newVersion' => '',\n\t);\n\n\tif ( ! current_user_can( 'update_themes' ) ) {\n\t\t$status['errorMessage'] = __( 'Sorry, you are not allowed to update themes for this site.' );\n\t\twp_send_json_error( $status );\n\t}\n\n\t$theme = wp_get_theme( $stylesheet );\n\tif ( $theme->exists() ) {\n\t\t$status['oldVersion'] = $theme->get( 'Version' );\n\t}\n\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\n\t$current = get_site_transient( 'update_themes' );\n\tif ( empty( $current ) ) {\n\t\twp_update_themes();\n\t}\n\n\t$skin     = new WP_Ajax_Upgrader_Skin();\n\t$upgrader = new Theme_Upgrader( $skin );\n\t$result   = $upgrader->bulk_upgrade( array( $stylesheet ) );\n\n\tif ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {\n\t\t$status['debug'] = $skin->get_upgrade_messages();\n\t}\n\n\tif ( is_wp_error( $skin->result ) ) {\n\t\t$status['errorCode']    = $skin->result->get_error_code();\n\t\t$status['errorMessage'] = $skin->result->get_error_message();\n\t\twp_send_json_error( $status );\n\t} elseif ( $skin->get_errors()->has_errors() ) {\n\t\t$status['errorMessage'] = $skin->get_error_messages();\n\t\twp_send_json_error( $status );\n\t} elseif ( is_array( $result ) && ! empty( $result[ $stylesheet ] ) ) {\n\n\t\t// Theme is already at the latest version.\n\t\tif ( true === $result[ $stylesheet ] ) {\n\t\t\t$status['errorMessage'] = $upgrader->strings['up_to_date'];\n\t\t\twp_send_json_error( $status );\n\t\t}\n\n\t\t$theme = wp_get_theme( $stylesheet );\n\t\tif ( $theme->exists() ) {\n\t\t\t$status['newVersion'] = $theme->get( 'Version' );\n\t\t}\n\n\t\twp_send_json_success( $status );\n\t} elseif ( false === $result ) {\n\t\tglobal $wp_filesystem;\n\n\t\t$status['errorCode']    = 'unable_to_connect_to_filesystem';\n\t\t$status['errorMessage'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );\n\n\t\t// Pass through the error from WP_Filesystem if one was raised.\n\t\tif ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {\n\t\t\t$status['errorMessage'] = esc_html( $wp_filesystem->errors->get_error_message() );\n\t\t}\n\n\t\twp_send_json_error( $status );\n\t}\n\n\t// An unhandled error occurred.\n\t$status['errorMessage'] = __( 'Theme update failed.' );\n\twp_send_json_error( $status );\n}\n\n/**\n * Ajax handler for deleting a theme.\n *\n * @since 4.6.0\n *\n * @see delete_theme()\n *\n * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n */\nfunction wp_ajax_delete_theme() {\n\tcheck_ajax_referer( 'updates' );\n\n\tif ( empty( $_POST['slug'] ) ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'slug'         => '',\n\t\t\t\t'errorCode'    => 'no_theme_specified',\n\t\t\t\t'errorMessage' => __( 'No theme specified.' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t$stylesheet = preg_replace( '/[^A-z0-9_\\-]/', '', wp_unslash( $_POST['slug'] ) );\n\t$status     = array(\n\t\t'delete' => 'theme',\n\t\t'slug'   => $stylesheet,\n\t);\n\n\tif ( ! current_user_can( 'delete_themes' ) ) {\n\t\t$status['errorMessage'] = __( 'Sorry, you are not allowed to delete themes on this site.' );\n\t\twp_send_json_error( $status );\n\t}\n\n\tif ( ! wp_get_theme( $stylesheet )->exists() ) {\n\t\t$status['errorMessage'] = __( 'The requested theme does not exist.' );\n\t\twp_send_json_error( $status );\n\t}\n\n\t// Check filesystem credentials. `delete_theme()` will bail otherwise.\n\t$url = wp_nonce_url( 'themes.php?action=delete&stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet );\n\n\tob_start();\n\t$credentials = request_filesystem_credentials( $url );\n\tob_end_clean();\n\n\tif ( false === $credentials || ! WP_Filesystem( $credentials ) ) {\n\t\tglobal $wp_filesystem;\n\n\t\t$status['errorCode']    = 'unable_to_connect_to_filesystem';\n\t\t$status['errorMessage'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );\n\n\t\t// Pass through the error from WP_Filesystem if one was raised.\n\t\tif ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {\n\t\t\t$status['errorMessage'] = esc_html( $wp_filesystem->errors->get_error_message() );\n\t\t}\n\n\t\twp_send_json_error( $status );\n\t}\n\n\tinclude_once ABSPATH . 'wp-admin/includes/theme.php';\n\n\t$result = delete_theme( $stylesheet );\n\n\tif ( is_wp_error( $result ) ) {\n\t\t$status['errorMessage'] = $result->get_error_message();\n\t\twp_send_json_error( $status );\n\t} elseif ( false === $result ) {\n\t\t$status['errorMessage'] = __( 'Theme could not be deleted.' );\n\t\twp_send_json_error( $status );\n\t}\n\n\twp_send_json_success( $status );\n}\n\n/**\n * Ajax handler for installing a plugin.\n *\n * @since 4.6.0\n *\n * @see Plugin_Upgrader\n *\n * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n */\nfunction wp_ajax_install_plugin() {\n\tcheck_ajax_referer( 'updates' );\n\n\tif ( empty( $_POST['slug'] ) ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'slug'         => '',\n\t\t\t\t'errorCode'    => 'no_plugin_specified',\n\t\t\t\t'errorMessage' => __( 'No plugin specified.' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t$status = array(\n\t\t'install' => 'plugin',\n\t\t'slug'    => sanitize_key( wp_unslash( $_POST['slug'] ) ),\n\t);\n\n\tif ( ! current_user_can( 'install_plugins' ) ) {\n\t\t$status['errorMessage'] = __( 'Sorry, you are not allowed to install plugins on this site.' );\n\t\twp_send_json_error( $status );\n\t}\n\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\tinclude_once ABSPATH . 'wp-admin/includes/plugin-install.php';\n\n\t$api = plugins_api(\n\t\t'plugin_information',\n\t\tarray(\n\t\t\t'slug'   => sanitize_key( wp_unslash( $_POST['slug'] ) ),\n\t\t\t'fields' => array(\n\t\t\t\t'sections' => false,\n\t\t\t),\n\t\t)\n\t);\n\n\tif ( is_wp_error( $api ) ) {\n\t\t$status['errorMessage'] = $api->get_error_message();\n\t\twp_send_json_error( $status );\n\t}\n\n\t$status['pluginName'] = $api->name;\n\n\t$skin     = new WP_Ajax_Upgrader_Skin();\n\t$upgrader = new Plugin_Upgrader( $skin );\n\t$result   = $upgrader->install( $api->download_link );\n\n\tif ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {\n\t\t$status['debug'] = $skin->get_upgrade_messages();\n\t}\n\n\tif ( is_wp_error( $result ) ) {\n\t\t$status['errorCode']    = $result->get_error_code();\n\t\t$status['errorMessage'] = $result->get_error_message();\n\t\twp_send_json_error( $status );\n\t} elseif ( is_wp_error( $skin->result ) ) {\n\t\t$status['errorCode']    = $skin->result->get_error_code();\n\t\t$status['errorMessage'] = $skin->result->get_error_message();\n\t\twp_send_json_error( $status );\n\t} elseif ( $skin->get_errors()->has_errors() ) {\n\t\t$status['errorMessage'] = $skin->get_error_messages();\n\t\twp_send_json_error( $status );\n\t} elseif ( is_null( $result ) ) {\n\t\tglobal $wp_filesystem;\n\n\t\t$status['errorCode']    = 'unable_to_connect_to_filesystem';\n\t\t$status['errorMessage'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );\n\n\t\t// Pass through the error from WP_Filesystem if one was raised.\n\t\tif ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {\n\t\t\t$status['errorMessage'] = esc_html( $wp_filesystem->errors->get_error_message() );\n\t\t}\n\n\t\twp_send_json_error( $status );\n\t}\n\n\t$install_status = install_plugin_install_status( $api );\n\t$pagenow        = isset( $_POST['pagenow'] ) ? sanitize_key( $_POST['pagenow'] ) : '';\n\n\t// If installation request is coming from import page, do not return network activation link.\n\t$plugins_url = ( 'import' === $pagenow ) ? admin_url( 'plugins.php' ) : network_admin_url( 'plugins.php' );\n\n\tif ( current_user_can( 'activate_plugin', $install_status['file'] ) && is_plugin_inactive( $install_status['file'] ) ) {\n\t\t$status['activateUrl'] = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $install_status['file'] ),\n\t\t\t\t'action'   => 'activate',\n\t\t\t\t'plugin'   => $install_status['file'],\n\t\t\t),\n\t\t\t$plugins_url\n\t\t);\n\t}\n\n\tif ( is_multisite() && current_user_can( 'manage_network_plugins' ) && 'import' !== $pagenow ) {\n\t\t$status['activateUrl'] = add_query_arg( array( 'networkwide' => 1 ), $status['activateUrl'] );\n\t}\n\n\twp_send_json_success( $status );\n}\n\n/**\n * Ajax handler for updating a plugin.\n *\n * @since 4.2.0\n *\n * @see Plugin_Upgrader\n *\n * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n */\nfunction wp_ajax_update_plugin() {\n\tcheck_ajax_referer( 'updates' );\n\n\tif ( empty( $_POST['plugin'] ) || empty( $_POST['slug'] ) ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'slug'         => '',\n\t\t\t\t'errorCode'    => 'no_plugin_specified',\n\t\t\t\t'errorMessage' => __( 'No plugin specified.' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t$plugin = plugin_basename( sanitize_text_field( wp_unslash( $_POST['plugin'] ) ) );\n\n\t$status = array(\n\t\t'update'     => 'plugin',\n\t\t'slug'       => sanitize_key( wp_unslash( $_POST['slug'] ) ),\n\t\t'oldVersion' => '',\n\t\t'newVersion' => '',\n\t);\n\n\tif ( ! current_user_can( 'update_plugins' ) || 0 !== validate_file( $plugin ) ) {\n\t\t$status['errorMessage'] = __( 'Sorry, you are not allowed to update plugins for this site.' );\n\t\twp_send_json_error( $status );\n\t}\n\n\t$plugin_data          = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );\n\t$status['plugin']     = $plugin;\n\t$status['pluginName'] = $plugin_data['Name'];\n\n\tif ( $plugin_data['Version'] ) {\n\t\t/* translators: %s: Plugin version. */\n\t\t$status['oldVersion'] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );\n\t}\n\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\n\twp_update_plugins();\n\n\t$skin     = new WP_Ajax_Upgrader_Skin();\n\t$upgrader = new Plugin_Upgrader( $skin );\n\t$result   = $upgrader->bulk_upgrade( array( $plugin ) );\n\n\tif ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {\n\t\t$status['debug'] = $skin->get_upgrade_messages();\n\t}\n\n\tif ( is_wp_error( $skin->result ) ) {\n\t\t$status['errorCode']    = $skin->result->get_error_code();\n\t\t$status['errorMessage'] = $skin->result->get_error_message();\n\t\twp_send_json_error( $status );\n\t} elseif ( $skin->get_errors()->has_errors() ) {\n\t\t$status['errorMessage'] = $skin->get_error_messages();\n\t\twp_send_json_error( $status );\n\t} elseif ( is_array( $result ) && ! empty( $result[ $plugin ] ) ) {\n\n\t\t/*\n\t\t * Plugin is already at the latest version.\n\t\t *\n\t\t * This may also be the return value if the `update_plugins` site transient is empty,\n\t\t * e.g. when you update two plugins in quick succession before the transient repopulates.\n\t\t *\n\t\t * Preferably something can be done to ensure `update_plugins` isn't empty.\n\t\t * For now, surface some sort of error here.\n\t\t */\n\t\tif ( true === $result[ $plugin ] ) {\n\t\t\t$status['errorMessage'] = $upgrader->strings['up_to_date'];\n\t\t\twp_send_json_error( $status );\n\t\t}\n\n\t\t$plugin_data = get_plugins( '/' . $result[ $plugin ]['destination_name'] );\n\t\t$plugin_data = reset( $plugin_data );\n\n\t\tif ( $plugin_data['Version'] ) {\n\t\t\t/* translators: %s: Plugin version. */\n\t\t\t$status['newVersion'] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );\n\t\t}\n\n\t\twp_send_json_success( $status );\n\t} elseif ( false === $result ) {\n\t\tglobal $wp_filesystem;\n\n\t\t$status['errorCode']    = 'unable_to_connect_to_filesystem';\n\t\t$status['errorMessage'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );\n\n\t\t// Pass through the error from WP_Filesystem if one was raised.\n\t\tif ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {\n\t\t\t$status['errorMessage'] = esc_html( $wp_filesystem->errors->get_error_message() );\n\t\t}\n\n\t\twp_send_json_error( $status );\n\t}\n\n\t// An unhandled error occurred.\n\t$status['errorMessage'] = __( 'Plugin update failed.' );\n\twp_send_json_error( $status );\n}\n\n/**\n * Ajax handler for deleting a plugin.\n *\n * @since 4.6.0\n *\n * @see delete_plugins()\n *\n * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n */\nfunction wp_ajax_delete_plugin() {\n\tcheck_ajax_referer( 'updates' );\n\n\tif ( empty( $_POST['slug'] ) || empty( $_POST['plugin'] ) ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'slug'         => '',\n\t\t\t\t'errorCode'    => 'no_plugin_specified',\n\t\t\t\t'errorMessage' => __( 'No plugin specified.' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t$plugin = plugin_basename( sanitize_text_field( wp_unslash( $_POST['plugin'] ) ) );\n\n\t$status = array(\n\t\t'delete' => 'plugin',\n\t\t'slug'   => sanitize_key( wp_unslash( $_POST['slug'] ) ),\n\t);\n\n\tif ( ! current_user_can( 'delete_plugins' ) || 0 !== validate_file( $plugin ) ) {\n\t\t$status['errorMessage'] = __( 'Sorry, you are not allowed to delete plugins for this site.' );\n\t\twp_send_json_error( $status );\n\t}\n\n\t$plugin_data          = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );\n\t$status['plugin']     = $plugin;\n\t$status['pluginName'] = $plugin_data['Name'];\n\n\tif ( is_plugin_active( $plugin ) ) {\n\t\t$status['errorMessage'] = __( 'You cannot delete a plugin while it is active on the main site.' );\n\t\twp_send_json_error( $status );\n\t}\n\n\t// Check filesystem credentials. `delete_plugins()` will bail otherwise.\n\t$url = wp_nonce_url( 'plugins.php?action=delete-selected&verify-delete=1&checked[]=' . $plugin, 'bulk-plugins' );\n\n\tob_start();\n\t$credentials = request_filesystem_credentials( $url );\n\tob_end_clean();\n\n\tif ( false === $credentials || ! WP_Filesystem( $credentials ) ) {\n\t\tglobal $wp_filesystem;\n\n\t\t$status['errorCode']    = 'unable_to_connect_to_filesystem';\n\t\t$status['errorMessage'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );\n\n\t\t// Pass through the error from WP_Filesystem if one was raised.\n\t\tif ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {\n\t\t\t$status['errorMessage'] = esc_html( $wp_filesystem->errors->get_error_message() );\n\t\t}\n\n\t\twp_send_json_error( $status );\n\t}\n\n\t$result = delete_plugins( array( $plugin ) );\n\n\tif ( is_wp_error( $result ) ) {\n\t\t$status['errorMessage'] = $result->get_error_message();\n\t\twp_send_json_error( $status );\n\t} elseif ( false === $result ) {\n\t\t$status['errorMessage'] = __( 'Plugin could not be deleted.' );\n\t\twp_send_json_error( $status );\n\t}\n\n\twp_send_json_success( $status );\n}\n\n/**\n * Ajax handler for searching plugins.\n *\n * @since 4.6.0\n *\n * @global string $s Search term.\n */\nfunction wp_ajax_search_plugins() {\n\tcheck_ajax_referer( 'updates' );\n\n\t// Ensure after_plugin_row_{$plugin_file} gets hooked.\n\twp_plugin_update_rows();\n\n\t$pagenow = isset( $_POST['pagenow'] ) ? sanitize_key( $_POST['pagenow'] ) : '';\n\tif ( 'plugins-network' === $pagenow || 'plugins' === $pagenow ) {\n\t\tset_current_screen( $pagenow );\n\t}\n\n\t/** @var WP_Plugins_List_Table $wp_list_table */\n\t$wp_list_table = _get_list_table(\n\t\t'WP_Plugins_List_Table',\n\t\tarray(\n\t\t\t'screen' => get_current_screen(),\n\t\t)\n\t);\n\n\t$status = array();\n\n\tif ( ! $wp_list_table->ajax_user_can() ) {\n\t\t$status['errorMessage'] = __( 'Sorry, you are not allowed to manage plugins for this site.' );\n\t\twp_send_json_error( $status );\n\t}\n\n\t// Set the correct requester, so pagination works.\n\t$_SERVER['REQUEST_URI'] = add_query_arg(\n\t\tarray_diff_key(\n\t\t\t$_POST,\n\t\t\tarray(\n\t\t\t\t'_ajax_nonce' => null,\n\t\t\t\t'action'      => null,\n\t\t\t)\n\t\t),\n\t\tnetwork_admin_url( 'plugins.php', 'relative' )\n\t);\n\n\t$GLOBALS['s'] = wp_unslash( $_POST['s'] );\n\n\t$wp_list_table->prepare_items();\n\n\tob_start();\n\t$wp_list_table->display();\n\t$status['count'] = count( $wp_list_table->items );\n\t$status['items'] = ob_get_clean();\n\n\twp_send_json_success( $status );\n}\n\n/**\n * Ajax handler for searching plugins to install.\n *\n * @since 4.6.0\n */\nfunction wp_ajax_search_install_plugins() {\n\tcheck_ajax_referer( 'updates' );\n\n\t$pagenow = isset( $_POST['pagenow'] ) ? sanitize_key( $_POST['pagenow'] ) : '';\n\tif ( 'plugin-install-network' === $pagenow || 'plugin-install' === $pagenow ) {\n\t\tset_current_screen( $pagenow );\n\t}\n\n\t/** @var WP_Plugin_Install_List_Table $wp_list_table */\n\t$wp_list_table = _get_list_table(\n\t\t'WP_Plugin_Install_List_Table',\n\t\tarray(\n\t\t\t'screen' => get_current_screen(),\n\t\t)\n\t);\n\n\t$status = array();\n\n\tif ( ! $wp_list_table->ajax_user_can() ) {\n\t\t$status['errorMessage'] = __( 'Sorry, you are not allowed to manage plugins for this site.' );\n\t\twp_send_json_error( $status );\n\t}\n\n\t// Set the correct requester, so pagination works.\n\t$_SERVER['REQUEST_URI'] = add_query_arg(\n\t\tarray_diff_key(\n\t\t\t$_POST,\n\t\t\tarray(\n\t\t\t\t'_ajax_nonce' => null,\n\t\t\t\t'action'      => null,\n\t\t\t)\n\t\t),\n\t\tnetwork_admin_url( 'plugin-install.php', 'relative' )\n\t);\n\n\t$wp_list_table->prepare_items();\n\n\tob_start();\n\t$wp_list_table->display();\n\t$status['count'] = (int) $wp_list_table->get_pagination_arg( 'total_items' );\n\t$status['items'] = ob_get_clean();\n\n\twp_send_json_success( $status );\n}\n\n/**\n * Ajax handler for editing a theme or plugin file.\n *\n * @since 4.9.0\n *\n * @see wp_edit_theme_plugin_file()\n */\nfunction wp_ajax_edit_theme_plugin_file() {\n\t$r = wp_edit_theme_plugin_file( wp_unslash( $_POST ) ); // Validation of args is done in wp_edit_theme_plugin_file().\n\n\tif ( is_wp_error( $r ) ) {\n\t\twp_send_json_error(\n\t\t\tarray_merge(\n\t\t\t\tarray(\n\t\t\t\t\t'code'    => $r->get_error_code(),\n\t\t\t\t\t'message' => $r->get_error_message(),\n\t\t\t\t),\n\t\t\t\t(array) $r->get_error_data()\n\t\t\t)\n\t\t);\n\t} else {\n\t\twp_send_json_success(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'File edited successfully.' ),\n\t\t\t)\n\t\t);\n\t}\n}\n\n/**\n * Ajax handler for exporting a user's personal data.\n *\n * @since 4.9.6\n */\nfunction wp_ajax_wp_privacy_export_personal_data() {\n\n\tif ( empty( $_POST['id'] ) ) {\n\t\twp_send_json_error( __( 'Missing request ID.' ) );\n\t}\n\n\t$request_id = (int) $_POST['id'];\n\n\tif ( $request_id < 1 ) {\n\t\twp_send_json_error( __( 'Invalid request ID.' ) );\n\t}\n\n\tif ( ! current_user_can( 'export_others_personal_data' ) ) {\n\t\twp_send_json_error( __( 'Sorry, you are not allowed to perform this action.' ) );\n\t}\n\n\tcheck_ajax_referer( 'wp-privacy-export-personal-data-' . $request_id, 'security' );\n\n\t// Get the request.\n\t$request = wp_get_user_request( $request_id );\n\n\tif ( ! $request || 'export_personal_data' !== $request->action_name ) {\n\t\twp_send_json_error( __( 'Invalid request type.' ) );\n\t}\n\n\t$email_address = $request->email;\n\tif ( ! is_email( $email_address ) ) {\n\t\twp_send_json_error( __( 'A valid email address must be given.' ) );\n\t}\n\n\tif ( ! isset( $_POST['exporter'] ) ) {\n\t\twp_send_json_error( __( 'Missing exporter index.' ) );\n\t}\n\n\t$exporter_index = (int) $_POST['exporter'];\n\n\tif ( ! isset( $_POST['page'] ) ) {\n\t\twp_send_json_error( __( 'Missing page index.' ) );\n\t}\n\n\t$page = (int) $_POST['page'];\n\n\t$send_as_email = isset( $_POST['sendAsEmail'] ) ? ( 'true' === $_POST['sendAsEmail'] ) : false;\n\n\t/**\n\t * Filters the array of exporter callbacks.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param array $args {\n\t *     An array of callable exporters of personal data. Default empty array.\n\t *\n\t *     @type array ...$0 {\n\t *         Array of personal data exporters.\n\t *\n\t *         @type callable $callback               Callable exporter function that accepts an\n\t *                                                email address and a page and returns an array\n\t *                                                of name => value pairs of personal data.\n\t *         @type string   $exporter_friendly_name Translated user facing friendly name for the\n\t *                                                exporter.\n\t *     }\n\t * }\n\t */\n\t$exporters = apply_filters( 'wp_privacy_personal_data_exporters', array() );\n\n\tif ( ! is_array( $exporters ) ) {\n\t\twp_send_json_error( __( 'An exporter has improperly used the registration filter.' ) );\n\t}\n\n\t// Do we have any registered exporters?\n\tif ( 0 < count( $exporters ) ) {\n\t\tif ( $exporter_index < 1 ) {\n\t\t\twp_send_json_error( __( 'Exporter index cannot be negative.' ) );\n\t\t}\n\n\t\tif ( $exporter_index > count( $exporters ) ) {\n\t\t\twp_send_json_error( __( 'Exporter index is out of range.' ) );\n\t\t}\n\n\t\tif ( $page < 1 ) {\n\t\t\twp_send_json_error( __( 'Page index cannot be less than one.' ) );\n\t\t}\n\n\t\t$exporter_keys = array_keys( $exporters );\n\t\t$exporter_key  = $exporter_keys[ $exporter_index - 1 ];\n\t\t$exporter      = $exporters[ $exporter_key ];\n\n\t\tif ( ! is_array( $exporter ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\t/* translators: %s: Exporter array index. */\n\t\t\t\tsprintf( __( 'Expected an array describing the exporter at index %s.' ), $exporter_key )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! array_key_exists( 'exporter_friendly_name', $exporter ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\t/* translators: %s: Exporter array index. */\n\t\t\t\tsprintf( __( 'Exporter array at index %s does not include a friendly name.' ), $exporter_key )\n\t\t\t);\n\t\t}\n\n\t\t$exporter_friendly_name = $exporter['exporter_friendly_name'];\n\n\t\tif ( ! array_key_exists( 'callback', $exporter ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\t/* translators: %s: Exporter friendly name. */\n\t\t\t\tsprintf( __( 'Exporter does not include a callback: %s.' ), esc_html( $exporter_friendly_name ) )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! is_callable( $exporter['callback'] ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\t/* translators: %s: Exporter friendly name. */\n\t\t\t\tsprintf( __( 'Exporter callback is not a valid callback: %s.' ), esc_html( $exporter_friendly_name ) )\n\t\t\t);\n\t\t}\n\n\t\t$callback = $exporter['callback'];\n\t\t$response = call_user_func( $callback, $email_address, $page );\n\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\twp_send_json_error( $response );\n\t\t}\n\n\t\tif ( ! is_array( $response ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\t/* translators: %s: Exporter friendly name. */\n\t\t\t\tsprintf( __( 'Expected response as an array from exporter: %s.' ), esc_html( $exporter_friendly_name ) )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! array_key_exists( 'data', $response ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\t/* translators: %s: Exporter friendly name. */\n\t\t\t\tsprintf( __( 'Expected data in response array from exporter: %s.' ), esc_html( $exporter_friendly_name ) )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! is_array( $response['data'] ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\t/* translators: %s: Exporter friendly name. */\n\t\t\t\tsprintf( __( 'Expected data array in response array from exporter: %s.' ), esc_html( $exporter_friendly_name ) )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! array_key_exists( 'done', $response ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\t/* translators: %s: Exporter friendly name. */\n\t\t\t\tsprintf( __( 'Expected done (boolean) in response array from exporter: %s.' ), esc_html( $exporter_friendly_name ) )\n\t\t\t);\n\t\t}\n\t} else {\n\t\t// No exporters, so we're done.\n\t\t$exporter_key = '';\n\n\t\t$response = array(\n\t\t\t'data' => array(),\n\t\t\t'done' => true,\n\t\t);\n\t}\n\n\t/**\n\t * Filters a page of personal data exporter data. Used to build the export report.\n\t *\n\t * Allows the export response to be consumed by destinations in addition to Ajax.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param array  $response        The personal data for the given exporter and page.\n\t * @param int    $exporter_index  The index of the exporter that provided this data.\n\t * @param string $email_address   The email address associated with this personal data.\n\t * @param int    $page            The page for this response.\n\t * @param int    $request_id      The privacy request post ID associated with this request.\n\t * @param bool   $send_as_email   Whether the final results of the export should be emailed to the user.\n\t * @param string $exporter_key    The key (slug) of the exporter that provided this data.\n\t */\n\t$response = apply_filters( 'wp_privacy_personal_data_export_page', $response, $exporter_index, $email_address, $page, $request_id, $send_as_email, $exporter_key );\n\n\tif ( is_wp_error( $response ) ) {\n\t\twp_send_json_error( $response );\n\t}\n\n\twp_send_json_success( $response );\n}\n\n/**\n * Ajax handler for erasing personal data.\n *\n * @since 4.9.6\n */\nfunction wp_ajax_wp_privacy_erase_personal_data() {\n\n\tif ( empty( $_POST['id'] ) ) {\n\t\twp_send_json_error( __( 'Missing request ID.' ) );\n\t}\n\n\t$request_id = (int) $_POST['id'];\n\n\tif ( $request_id < 1 ) {\n\t\twp_send_json_error( __( 'Invalid request ID.' ) );\n\t}\n\n\t// Both capabilities are required to avoid confusion, see `_wp_personal_data_removal_page()`.\n\tif ( ! current_user_can( 'erase_others_personal_data' ) || ! current_user_can( 'delete_users' ) ) {\n\t\twp_send_json_error( __( 'Sorry, you are not allowed to perform this action.' ) );\n\t}\n\n\tcheck_ajax_referer( 'wp-privacy-erase-personal-data-' . $request_id, 'security' );\n\n\t// Get the request.\n\t$request = wp_get_user_request( $request_id );\n\n\tif ( ! $request || 'remove_personal_data' !== $request->action_name ) {\n\t\twp_send_json_error( __( 'Invalid request type.' ) );\n\t}\n\n\t$email_address = $request->email;\n\n\tif ( ! is_email( $email_address ) ) {\n\t\twp_send_json_error( __( 'Invalid email address in request.' ) );\n\t}\n\n\tif ( ! isset( $_POST['eraser'] ) ) {\n\t\twp_send_json_error( __( 'Missing eraser index.' ) );\n\t}\n\n\t$eraser_index = (int) $_POST['eraser'];\n\n\tif ( ! isset( $_POST['page'] ) ) {\n\t\twp_send_json_error( __( 'Missing page index.' ) );\n\t}\n\n\t$page = (int) $_POST['page'];\n\n\t/**\n\t * Filters the array of personal data eraser callbacks.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param array $args {\n\t *     An array of callable erasers of personal data. Default empty array.\n\t *\n\t *     @type array ...$0 {\n\t *         Array of personal data exporters.\n\t *\n\t *         @type callable $callback               Callable eraser that accepts an email address and\n\t *                                                a page and returns an array with boolean values for\n\t *                                                whether items were removed or retained and any messages\n\t *                                                from the eraser, as well as if additional pages are\n\t *                                                available.\n\t *         @type string   $exporter_friendly_name Translated user facing friendly name for the eraser.\n\t *     }\n\t * }\n\t */\n\t$erasers = apply_filters( 'wp_privacy_personal_data_erasers', array() );\n\n\t// Do we have any registered erasers?\n\tif ( 0 < count( $erasers ) ) {\n\n\t\tif ( $eraser_index < 1 ) {\n\t\t\twp_send_json_error( __( 'Eraser index cannot be less than one.' ) );\n\t\t}\n\n\t\tif ( $eraser_index > count( $erasers ) ) {\n\t\t\twp_send_json_error( __( 'Eraser index is out of range.' ) );\n\t\t}\n\n\t\tif ( $page < 1 ) {\n\t\t\twp_send_json_error( __( 'Page index cannot be less than one.' ) );\n\t\t}\n\n\t\t$eraser_keys = array_keys( $erasers );\n\t\t$eraser_key  = $eraser_keys[ $eraser_index - 1 ];\n\t\t$eraser      = $erasers[ $eraser_key ];\n\n\t\tif ( ! is_array( $eraser ) ) {\n\t\t\t/* translators: %d: Eraser array index. */\n\t\t\twp_send_json_error( sprintf( __( 'Expected an array describing the eraser at index %d.' ), $eraser_index ) );\n\t\t}\n\n\t\tif ( ! array_key_exists( 'eraser_friendly_name', $eraser ) ) {\n\t\t\t/* translators: %d: Eraser array index. */\n\t\t\twp_send_json_error( sprintf( __( 'Eraser array at index %d does not include a friendly name.' ), $eraser_index ) );\n\t\t}\n\n\t\t$eraser_friendly_name = $eraser['eraser_friendly_name'];\n\n\t\tif ( ! array_key_exists( 'callback', $eraser ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Eraser friendly name. */\n\t\t\t\t\t__( 'Eraser does not include a callback: %s.' ),\n\t\t\t\t\tesc_html( $eraser_friendly_name )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( ! is_callable( $eraser['callback'] ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Eraser friendly name. */\n\t\t\t\t\t__( 'Eraser callback is not valid: %s.' ),\n\t\t\t\t\tesc_html( $eraser_friendly_name )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$callback = $eraser['callback'];\n\t\t$response = call_user_func( $callback, $email_address, $page );\n\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\twp_send_json_error( $response );\n\t\t}\n\n\t\tif ( ! is_array( $response ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: Eraser friendly name, 2: Eraser array index. */\n\t\t\t\t\t__( 'Did not receive array from %1$s eraser (index %2$d).' ),\n\t\t\t\t\tesc_html( $eraser_friendly_name ),\n\t\t\t\t\t$eraser_index\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( ! array_key_exists( 'items_removed', $response ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: Eraser friendly name, 2: Eraser array index. */\n\t\t\t\t\t__( 'Expected items_removed key in response array from %1$s eraser (index %2$d).' ),\n\t\t\t\t\tesc_html( $eraser_friendly_name ),\n\t\t\t\t\t$eraser_index\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( ! array_key_exists( 'items_retained', $response ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: Eraser friendly name, 2: Eraser array index. */\n\t\t\t\t\t__( 'Expected items_retained key in response array from %1$s eraser (index %2$d).' ),\n\t\t\t\t\tesc_html( $eraser_friendly_name ),\n\t\t\t\t\t$eraser_index\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( ! array_key_exists( 'messages', $response ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: Eraser friendly name, 2: Eraser array index. */\n\t\t\t\t\t__( 'Expected messages key in response array from %1$s eraser (index %2$d).' ),\n\t\t\t\t\tesc_html( $eraser_friendly_name ),\n\t\t\t\t\t$eraser_index\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( ! is_array( $response['messages'] ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: Eraser friendly name, 2: Eraser array index. */\n\t\t\t\t\t__( 'Expected messages key to reference an array in response array from %1$s eraser (index %2$d).' ),\n\t\t\t\t\tesc_html( $eraser_friendly_name ),\n\t\t\t\t\t$eraser_index\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( ! array_key_exists( 'done', $response ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: Eraser friendly name, 2: Eraser array index. */\n\t\t\t\t\t__( 'Expected done flag in response array from %1$s eraser (index %2$d).' ),\n\t\t\t\t\tesc_html( $eraser_friendly_name ),\n\t\t\t\t\t$eraser_index\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t} else {\n\t\t// No erasers, so we're done.\n\t\t$eraser_key = '';\n\n\t\t$response = array(\n\t\t\t'items_removed'  => false,\n\t\t\t'items_retained' => false,\n\t\t\t'messages'       => array(),\n\t\t\t'done'           => true,\n\t\t);\n\t}\n\n\t/**\n\t * Filters a page of personal data eraser data.\n\t *\n\t * Allows the erasure response to be consumed by destinations in addition to Ajax.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param array  $response        The personal data for the given exporter and page.\n\t * @param int    $eraser_index    The index of the eraser that provided this data.\n\t * @param string $email_address   The email address associated with this personal data.\n\t * @param int    $page            The page for this response.\n\t * @param int    $request_id      The privacy request post ID associated with this request.\n\t * @param string $eraser_key      The key (slug) of the eraser that provided this data.\n\t */\n\t$response = apply_filters( 'wp_privacy_personal_data_erasure_page', $response, $eraser_index, $email_address, $page, $request_id, $eraser_key );\n\n\tif ( is_wp_error( $response ) ) {\n\t\twp_send_json_error( $response );\n\t}\n\n\twp_send_json_success( $response );\n}\n\n/**\n * Ajax handler for site health checks on server communication.\n *\n * @since 5.2.0\n */\nfunction wp_ajax_health_check_dotorg_communication() {\n\tcheck_ajax_referer( 'health-check-site-status' );\n\n\tif ( ! current_user_can( 'view_site_health_checks' ) ) {\n\t\twp_send_json_error();\n\t}\n\n\tif ( ! class_exists( 'WP_Site_Health' ) ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';\n\t}\n\n\t$site_health = WP_Site_Health::get_instance();\n\twp_send_json_success( $site_health->get_test_dotorg_communication() );\n}\n\n/**\n * Ajax handler for site health checks on debug mode.\n *\n * @since 5.2.0\n */\nfunction wp_ajax_health_check_is_in_debug_mode() {\n\twp_verify_nonce( 'health-check-site-status' );\n\n\tif ( ! current_user_can( 'view_site_health_checks' ) ) {\n\t\twp_send_json_error();\n\t}\n\n\tif ( ! class_exists( 'WP_Site_Health' ) ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';\n\t}\n\n\t$site_health = WP_Site_Health::get_instance();\n\twp_send_json_success( $site_health->get_test_is_in_debug_mode() );\n}\n\n/**\n * Ajax handler for site health checks on background updates.\n *\n * @since 5.2.0\n */\nfunction wp_ajax_health_check_background_updates() {\n\tcheck_ajax_referer( 'health-check-site-status' );\n\n\tif ( ! current_user_can( 'view_site_health_checks' ) ) {\n\t\twp_send_json_error();\n\t}\n\n\tif ( ! class_exists( 'WP_Site_Health' ) ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';\n\t}\n\n\t$site_health = WP_Site_Health::get_instance();\n\twp_send_json_success( $site_health->get_test_background_updates() );\n}\n\n/**\n * Ajax handler for site health checks on loopback requests.\n *\n * @since 5.2.0\n */\nfunction wp_ajax_health_check_loopback_requests() {\n\tcheck_ajax_referer( 'health-check-site-status' );\n\n\tif ( ! current_user_can( 'view_site_health_checks' ) ) {\n\t\twp_send_json_error();\n\t}\n\n\tif ( ! class_exists( 'WP_Site_Health' ) ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';\n\t}\n\n\t$site_health = WP_Site_Health::get_instance();\n\twp_send_json_success( $site_health->get_test_loopback_requests() );\n}\n\n/**\n * Ajax handler for site health check to update the result status.\n *\n * @since 5.2.0\n */\nfunction wp_ajax_health_check_site_status_result() {\n\tcheck_ajax_referer( 'health-check-site-status-result' );\n\n\tif ( ! current_user_can( 'view_site_health_checks' ) ) {\n\t\twp_send_json_error();\n\t}\n\n\tset_transient( 'health-check-site-status-result', wp_json_encode( $_POST['counts'] ) );\n\n\twp_send_json_success();\n}\n\n/**\n * Ajax handler for site health check to get directories and database sizes.\n *\n * @since 5.2.0\n */\nfunction wp_ajax_health_check_get_sizes() {\n\tcheck_ajax_referer( 'health-check-site-status-result' );\n\n\tif ( ! current_user_can( 'view_site_health_checks' ) || is_multisite() ) {\n\t\twp_send_json_error();\n\t}\n\n\tif ( ! class_exists( 'WP_Debug_Data' ) ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-debug-data.php';\n\t}\n\n\t$sizes_data = WP_Debug_Data::get_sizes();\n\t$all_sizes  = array( 'raw' => 0 );\n\n\tforeach ( $sizes_data as $name => $value ) {\n\t\t$name = sanitize_text_field( $name );\n\t\t$data = array();\n\n\t\tif ( isset( $value['size'] ) ) {\n\t\t\tif ( is_string( $value['size'] ) ) {\n\t\t\t\t$data['size'] = sanitize_text_field( $value['size'] );\n\t\t\t} else {\n\t\t\t\t$data['size'] = (int) $value['size'];\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $value['debug'] ) ) {\n\t\t\tif ( is_string( $value['debug'] ) ) {\n\t\t\t\t$data['debug'] = sanitize_text_field( $value['debug'] );\n\t\t\t} else {\n\t\t\t\t$data['debug'] = (int) $value['debug'];\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $value['raw'] ) ) {\n\t\t\t$data['raw'] = (int) $value['raw'];\n\t\t}\n\n\t\t$all_sizes[ $name ] = $data;\n\t}\n\n\tif ( isset( $all_sizes['total_size']['debug'] ) && 'not available' === $all_sizes['total_size']['debug'] ) {\n\t\twp_send_json_error( $all_sizes );\n\t}\n\n\twp_send_json_success( $all_sizes );\n}\n\n/**\n * Ajax handler to renew the REST API nonce.\n *\n * @since 5.3.0\n */\nfunction wp_ajax_rest_nonce() {\n\texit( wp_create_nonce( 'wp_rest' ) );\n}\n\n/**\n * Ajax handler to enable or disable plugin and theme auto-updates.\n *\n * @since 5.5.0\n */\nfunction wp_ajax_toggle_auto_updates() {\n\tcheck_ajax_referer( 'updates' );\n\n\tif ( empty( $_POST['type'] ) || empty( $_POST['asset'] ) || empty( $_POST['state'] ) ) {\n\t\twp_send_json_error( array( 'error' => __( 'Invalid data. No selected item.' ) ) );\n\t}\n\n\t$asset = sanitize_text_field( urldecode( $_POST['asset'] ) );\n\n\tif ( 'enable' !== $_POST['state'] && 'disable' !== $_POST['state'] ) {\n\t\twp_send_json_error( array( 'error' => __( 'Invalid data. Unknown state.' ) ) );\n\t}\n\t$state = $_POST['state'];\n\n\tif ( 'plugin' !== $_POST['type'] && 'theme' !== $_POST['type'] ) {\n\t\twp_send_json_error( array( 'error' => __( 'Invalid data. Unknown type.' ) ) );\n\t}\n\t$type = $_POST['type'];\n\n\tswitch ( $type ) {\n\t\tcase 'plugin':\n\t\t\tif ( ! current_user_can( 'update_plugins' ) ) {\n\t\t\t\t$error_message = __( 'Sorry, you are not allowed to modify plugins.' );\n\t\t\t\twp_send_json_error( array( 'error' => $error_message ) );\n\t\t\t}\n\n\t\t\t$option = 'auto_update_plugins';\n\t\t\t/** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */\n\t\t\t$all_items = apply_filters( 'all_plugins', get_plugins() );\n\t\t\tbreak;\n\t\tcase 'theme':\n\t\t\tif ( ! current_user_can( 'update_themes' ) ) {\n\t\t\t\t$error_message = __( 'Sorry, you are not allowed to modify themes.' );\n\t\t\t\twp_send_json_error( array( 'error' => $error_message ) );\n\t\t\t}\n\n\t\t\t$option    = 'auto_update_themes';\n\t\t\t$all_items = wp_get_themes();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\twp_send_json_error( array( 'error' => __( 'Invalid data. Unknown type.' ) ) );\n\t}\n\n\tif ( ! array_key_exists( $asset, $all_items ) ) {\n\t\t$error_message = __( 'Invalid data. The item does not exist.' );\n\t\twp_send_json_error( array( 'error' => $error_message ) );\n\t}\n\n\t$auto_updates = (array) get_site_option( $option, array() );\n\n\tif ( 'disable' === $state ) {\n\t\t$auto_updates = array_diff( $auto_updates, array( $asset ) );\n\t} else {\n\t\t$auto_updates[] = $asset;\n\t\t$auto_updates   = array_unique( $auto_updates );\n\t}\n\n\t// Remove items that have been deleted since the site option was last updated.\n\t$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) );\n\n\tupdate_site_option( $option, $auto_updates );\n\n\twp_send_json_success();\n}\n", "num_lines": 5369}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Bookmark Administration API\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Add a link to using values provided in $_POST.\n *\n * @since 2.0.0\n *\n * @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success.\n */\nfunction add_link() {\n\treturn edit_link();\n}\n\n/**\n * Updates or inserts a link using values provided in $_POST.\n *\n * @since 2.0.0\n *\n * @param int $link_id Optional. ID of the link to edit. Default 0.\n * @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success.\n */\nfunction edit_link( $link_id = 0 ) {\n\tif ( ! current_user_can( 'manage_links' ) ) {\n\t\twp_die(\n\t\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t\t'<p>' . __( 'Sorry, you are not allowed to edit the links for this site.' ) . '</p>',\n\t\t\t403\n\t\t);\n\t}\n\n\t$_POST['link_url']   = esc_html( $_POST['link_url'] );\n\t$_POST['link_url']   = esc_url( $_POST['link_url'] );\n\t$_POST['link_name']  = esc_html( $_POST['link_name'] );\n\t$_POST['link_image'] = esc_html( $_POST['link_image'] );\n\t$_POST['link_rss']   = esc_url( $_POST['link_rss'] );\n\tif ( ! isset( $_POST['link_visible'] ) || 'N' !== $_POST['link_visible'] ) {\n\t\t$_POST['link_visible'] = 'Y';\n\t}\n\n\tif ( ! empty( $link_id ) ) {\n\t\t$_POST['link_id'] = $link_id;\n\t\treturn wp_update_link( $_POST );\n\t} else {\n\t\treturn wp_insert_link( $_POST );\n\t}\n}\n\n/**\n * Retrieves the default link for editing.\n *\n * @since 2.0.0\n *\n * @return stdClass Default link object.\n */\nfunction get_default_link_to_edit() {\n\t$link = new stdClass;\n\tif ( isset( $_GET['linkurl'] ) ) {\n\t\t$link->link_url = esc_url( wp_unslash( $_GET['linkurl'] ) );\n\t} else {\n\t\t$link->link_url = '';\n\t}\n\n\tif ( isset( $_GET['name'] ) ) {\n\t\t$link->link_name = esc_attr( wp_unslash( $_GET['name'] ) );\n\t} else {\n\t\t$link->link_name = '';\n\t}\n\n\t$link->link_visible = 'Y';\n\n\treturn $link;\n}\n\n/**\n * Deletes a specified link from the database.\n *\n * @since 2.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int $link_id ID of the link to delete\n * @return true Always true.\n */\nfunction wp_delete_link( $link_id ) {\n\tglobal $wpdb;\n\t/**\n\t * Fires before a link is deleted.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param int $link_id ID of the link to delete.\n\t */\n\tdo_action( 'delete_link', $link_id );\n\n\twp_delete_object_term_relationships( $link_id, 'link_category' );\n\n\t$wpdb->delete( $wpdb->links, array( 'link_id' => $link_id ) );\n\n\t/**\n\t * Fires after a link has been deleted.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @param int $link_id ID of the deleted link.\n\t */\n\tdo_action( 'deleted_link', $link_id );\n\n\tclean_bookmark_cache( $link_id );\n\n\treturn true;\n}\n\n/**\n * Retrieves the link category IDs associated with the link specified.\n *\n * @since 2.1.0\n *\n * @param int $link_id Link ID to look up.\n * @return int[] The IDs of the requested link's categories.\n */\nfunction wp_get_link_cats( $link_id = 0 ) {\n\t$cats = wp_get_object_terms( $link_id, 'link_category', array( 'fields' => 'ids' ) );\n\treturn array_unique( $cats );\n}\n\n/**\n * Retrieves link data based on its ID.\n *\n * @since 2.0.0\n *\n * @param int|stdClass $link Link ID or object to retrieve.\n * @return object Link object for editing.\n */\nfunction get_link_to_edit( $link ) {\n\treturn get_bookmark( $link, OBJECT, 'edit' );\n}\n\n/**\n * Inserts/updates links into/in the database.\n *\n * @since 2.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param array $linkdata Elements that make up the link to insert.\n * @param bool  $wp_error Optional. Whether to return a WP_Error object on failure. Default false.\n * @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success.\n */\nfunction wp_insert_link( $linkdata, $wp_error = false ) {\n\tglobal $wpdb;\n\n\t$defaults = array(\n\t\t'link_id'     => 0,\n\t\t'link_name'   => '',\n\t\t'link_url'    => '',\n\t\t'link_rating' => 0,\n\t);\n\n\t$parsed_args = wp_parse_args( $linkdata, $defaults );\n\t$parsed_args = wp_unslash( sanitize_bookmark( $parsed_args, 'db' ) );\n\n\t$link_id   = $parsed_args['link_id'];\n\t$link_name = $parsed_args['link_name'];\n\t$link_url  = $parsed_args['link_url'];\n\n\t$update = false;\n\tif ( ! empty( $link_id ) ) {\n\t\t$update = true;\n\t}\n\n\tif ( '' === trim( $link_name ) ) {\n\t\tif ( '' !== trim( $link_url ) ) {\n\t\t\t$link_name = $link_url;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\tif ( '' === trim( $link_url ) ) {\n\t\treturn 0;\n\t}\n\n\t$link_rating      = ( ! empty( $parsed_args['link_rating'] ) ) ? $parsed_args['link_rating'] : 0;\n\t$link_image       = ( ! empty( $parsed_args['link_image'] ) ) ? $parsed_args['link_image'] : '';\n\t$link_target      = ( ! empty( $parsed_args['link_target'] ) ) ? $parsed_args['link_target'] : '';\n\t$link_visible     = ( ! empty( $parsed_args['link_visible'] ) ) ? $parsed_args['link_visible'] : 'Y';\n\t$link_owner       = ( ! empty( $parsed_args['link_owner'] ) ) ? $parsed_args['link_owner'] : get_current_user_id();\n\t$link_notes       = ( ! empty( $parsed_args['link_notes'] ) ) ? $parsed_args['link_notes'] : '';\n\t$link_description = ( ! empty( $parsed_args['link_description'] ) ) ? $parsed_args['link_description'] : '';\n\t$link_rss         = ( ! empty( $parsed_args['link_rss'] ) ) ? $parsed_args['link_rss'] : '';\n\t$link_rel         = ( ! empty( $parsed_args['link_rel'] ) ) ? $parsed_args['link_rel'] : '';\n\t$link_category    = ( ! empty( $parsed_args['link_category'] ) ) ? $parsed_args['link_category'] : array();\n\n\t// Make sure we set a valid category.\n\tif ( ! is_array( $link_category ) || 0 === count( $link_category ) ) {\n\t\t$link_category = array( get_option( 'default_link_category' ) );\n\t}\n\n\tif ( $update ) {\n\t\tif ( false === $wpdb->update( $wpdb->links, compact( 'link_url', 'link_name', 'link_image', 'link_target', 'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_rel', 'link_notes', 'link_rss' ), compact( 'link_id' ) ) ) {\n\t\t\tif ( $wp_error ) {\n\t\t\t\treturn new WP_Error( 'db_update_error', __( 'Could not update link in the database.' ), $wpdb->last_error );\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ( false === $wpdb->insert( $wpdb->links, compact( 'link_url', 'link_name', 'link_image', 'link_target', 'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_rel', 'link_notes', 'link_rss' ) ) ) {\n\t\t\tif ( $wp_error ) {\n\t\t\t\treturn new WP_Error( 'db_insert_error', __( 'Could not insert link into the database.' ), $wpdb->last_error );\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t$link_id = (int) $wpdb->insert_id;\n\t}\n\n\twp_set_link_cats( $link_id, $link_category );\n\n\tif ( $update ) {\n\t\t/**\n\t\t * Fires after a link was updated in the database.\n\t\t *\n\t\t * @since 2.0.0\n\t\t *\n\t\t * @param int $link_id ID of the link that was updated.\n\t\t */\n\t\tdo_action( 'edit_link', $link_id );\n\t} else {\n\t\t/**\n\t\t * Fires after a link was added to the database.\n\t\t *\n\t\t * @since 2.0.0\n\t\t *\n\t\t * @param int $link_id ID of the link that was added.\n\t\t */\n\t\tdo_action( 'add_link', $link_id );\n\t}\n\tclean_bookmark_cache( $link_id );\n\n\treturn $link_id;\n}\n\n/**\n * Update link with the specified link categories.\n *\n * @since 2.1.0\n *\n * @param int   $link_id         ID of the link to update.\n * @param int[] $link_categories Array of link category IDs to add the link to.\n */\nfunction wp_set_link_cats( $link_id = 0, $link_categories = array() ) {\n\t// If $link_categories isn't already an array, make it one:\n\tif ( ! is_array( $link_categories ) || 0 === count( $link_categories ) ) {\n\t\t$link_categories = array( get_option( 'default_link_category' ) );\n\t}\n\n\t$link_categories = array_map( 'intval', $link_categories );\n\t$link_categories = array_unique( $link_categories );\n\n\twp_set_object_terms( $link_id, $link_categories, 'link_category' );\n\n\tclean_bookmark_cache( $link_id );\n}\n\n/**\n * Updates a link in the database.\n *\n * @since 2.0.0\n *\n * @param array $linkdata Link data to update.\n * @return int|WP_Error Value 0 or WP_Error on failure. The updated link ID on success.\n */\nfunction wp_update_link( $linkdata ) {\n\t$link_id = (int) $linkdata['link_id'];\n\n\t$link = get_bookmark( $link_id, ARRAY_A );\n\n\t// Escape data pulled from DB.\n\t$link = wp_slash( $link );\n\n\t// Passed link category list overwrites existing category list if not empty.\n\tif ( isset( $linkdata['link_category'] ) && is_array( $linkdata['link_category'] )\n\t\t&& count( $linkdata['link_category'] ) > 0\n\t) {\n\t\t$link_cats = $linkdata['link_category'];\n\t} else {\n\t\t$link_cats = $link['link_category'];\n\t}\n\n\t// Merge old and new fields with new fields overwriting old ones.\n\t$linkdata                  = array_merge( $link, $linkdata );\n\t$linkdata['link_category'] = $link_cats;\n\n\treturn wp_insert_link( $linkdata );\n}\n\n/**\n * Outputs the 'disabled' message for the WordPress Link Manager.\n *\n * @since 3.5.0\n * @access private\n *\n * @global string $pagenow\n */\nfunction wp_link_manager_disabled_message() {\n\tglobal $pagenow;\n\n\tif ( ! in_array( $pagenow, array( 'link-manager.php', 'link-add.php', 'link.php' ), true ) ) {\n\t\treturn;\n\t}\n\n\tadd_filter( 'pre_option_link_manager_enabled', '__return_true', 100 );\n\t$really_can_manage_links = current_user_can( 'manage_links' );\n\tremove_filter( 'pre_option_link_manager_enabled', '__return_true', 100 );\n\n\tif ( $really_can_manage_links && current_user_can( 'install_plugins' ) ) {\n\t\t$link = network_admin_url( 'plugin-install.php?tab=search&amp;s=Link+Manager' );\n\t\t/* translators: %s: URL to install the Link Manager plugin. */\n\t\twp_die( sprintf( __( 'If you are looking to use the link manager, please install the <a href=\"%s\">Link Manager</a> plugin.' ), $link ) );\n\t}\n\n\twp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) );\n}\n", "num_lines": 331}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrader API: Automatic_Upgrader_Skin class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Upgrader Skin for Automatic WordPress Upgrades\n *\n * This skin is designed to be used when no output is intended, all output\n * is captured and stored for the caller to process and log/email/discard.\n *\n * @since 3.7.0\n * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.\n *\n * @see Bulk_Upgrader_Skin\n */\nclass Automatic_Upgrader_Skin extends WP_Upgrader_Skin {\n\tprotected $messages = array();\n\n\t/**\n\t * Determines whether the upgrader needs FTP/SSH details in order to connect\n\t * to the filesystem.\n\t *\n\t * @since 3.7.0\n\t * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.\n\t *\n\t * @see request_filesystem_credentials()\n\t *\n\t * @param bool|WP_Error $error                        Optional. Whether the current request has failed to connect,\n\t *                                                    or an error object. Default false.\n\t * @param string        $context                      Optional. Full path to the directory that is tested\n\t *                                                    for being writable. Default empty.\n\t * @param bool          $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) {\n\t\tif ( $context ) {\n\t\t\t$this->options['context'] = $context;\n\t\t}\n\t\t/*\n\t\t * TODO: Fix up request_filesystem_credentials(), or split it, to allow us to request a no-output version.\n\t\t * This will output a credentials form in event of failure. We don't want that, so just hide with a buffer.\n\t\t */\n\t\tob_start();\n\t\t$result = parent::request_filesystem_credentials( $error, $context, $allow_relaxed_file_ownership );\n\t\tob_end_clean();\n\t\treturn $result;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic function get_upgrade_messages() {\n\t\treturn $this->messages;\n\t}\n\n\t/**\n\t * @param string|array|WP_Error $data\n\t * @param mixed                 ...$args Optional text replacements.\n\t */\n\tpublic function feedback( $data, ...$args ) {\n\t\tif ( is_wp_error( $data ) ) {\n\t\t\t$string = $data->get_error_message();\n\t\t} elseif ( is_array( $data ) ) {\n\t\t\treturn;\n\t\t} else {\n\t\t\t$string = $data;\n\t\t}\n\t\tif ( ! empty( $this->upgrader->strings[ $string ] ) ) {\n\t\t\t$string = $this->upgrader->strings[ $string ];\n\t\t}\n\n\t\tif ( strpos( $string, '%' ) !== false ) {\n\t\t\tif ( ! empty( $args ) ) {\n\t\t\t\t$string = vsprintf( $string, $args );\n\t\t\t}\n\t\t}\n\n\t\t$string = trim( $string );\n\n\t\t// Only allow basic HTML in the messages, as it'll be used in emails/logs rather than direct browser output.\n\t\t$string = wp_kses(\n\t\t\t$string,\n\t\t\tarray(\n\t\t\t\t'a'      => array(\n\t\t\t\t\t'href' => true,\n\t\t\t\t),\n\t\t\t\t'br'     => true,\n\t\t\t\t'em'     => true,\n\t\t\t\t'strong' => true,\n\t\t\t)\n\t\t);\n\n\t\tif ( empty( $string ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->messages[] = $string;\n\t}\n\n\t/**\n\t */\n\tpublic function header() {\n\t\tob_start();\n\t}\n\n\t/**\n\t */\n\tpublic function footer() {\n\t\t$output = ob_get_clean();\n\t\tif ( ! empty( $output ) ) {\n\t\t\t$this->feedback( $output );\n\t\t}\n\t}\n}\n", "num_lines": 120}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrader API: Bulk_Plugin_Upgrader_Skin class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Bulk Plugin Upgrader Skin for WordPress Plugin Upgrades.\n *\n * @since 3.0.0\n * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.\n *\n * @see Bulk_Upgrader_Skin\n */\nclass Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {\n\tpublic $plugin_info = array(); // Plugin_Upgrader::bulk_upgrade() will fill this in.\n\n\tpublic function add_strings() {\n\t\tparent::add_strings();\n\t\t/* translators: 1: Plugin name, 2: Number of the plugin, 3: Total number of plugins being updated. */\n\t\t$this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)' );\n\t}\n\n\t/**\n\t * @param string $title\n\t */\n\tpublic function before( $title = '' ) {\n\t\tparent::before( $this->plugin_info['Title'] );\n\t}\n\n\t/**\n\t * @param string $title\n\t */\n\tpublic function after( $title = '' ) {\n\t\tparent::after( $this->plugin_info['Title'] );\n\t\t$this->decrement_update_count( 'plugin' );\n\t}\n\n\t/**\n\t */\n\tpublic function bulk_footer() {\n\t\tparent::bulk_footer();\n\n\t\t$update_actions = array(\n\t\t\t'plugins_page' => sprintf(\n\t\t\t\t'<a href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\tself_admin_url( 'plugins.php' ),\n\t\t\t\t__( 'Return to Plugins page' )\n\t\t\t),\n\t\t\t'updates_page' => sprintf(\n\t\t\t\t'<a href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t__( 'Return to WordPress Updates page' )\n\t\t\t),\n\t\t);\n\n\t\tif ( ! current_user_can( 'activate_plugins' ) ) {\n\t\t\tunset( $update_actions['plugins_page'] );\n\t\t}\n\n\t\t/**\n\t\t * Filters the list of action links available following bulk plugin updates.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string[] $update_actions Array of plugin action links.\n\t\t * @param array    $plugin_info    Array of information for the last-updated plugin.\n\t\t */\n\t\t$update_actions = apply_filters( 'update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info );\n\n\t\tif ( ! empty( $update_actions ) ) {\n\t\t\t$this->feedback( implode( ' | ', (array) $update_actions ) );\n\t\t}\n\t}\n}\n", "num_lines": 79}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrader API: Bulk_Plugin_Upgrader_Skin class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Bulk Theme Upgrader Skin for WordPress Theme Upgrades.\n *\n * @since 3.0.0\n * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.\n *\n * @see Bulk_Upgrader_Skin\n */\nclass Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {\n\tpublic $theme_info = array(); // Theme_Upgrader::bulk_upgrade() will fill this in.\n\n\tpublic function add_strings() {\n\t\tparent::add_strings();\n\t\t/* translators: 1: Theme name, 2: Number of the theme, 3: Total number of themes being updated. */\n\t\t$this->upgrader->strings['skin_before_update_header'] = __( 'Updating Theme %1$s (%2$d/%3$d)' );\n\t}\n\n\t/**\n\t * @param string $title\n\t */\n\tpublic function before( $title = '' ) {\n\t\tparent::before( $this->theme_info->display( 'Name' ) );\n\t}\n\n\t/**\n\t * @param string $title\n\t */\n\tpublic function after( $title = '' ) {\n\t\tparent::after( $this->theme_info->display( 'Name' ) );\n\t\t$this->decrement_update_count( 'theme' );\n\t}\n\n\t/**\n\t */\n\tpublic function bulk_footer() {\n\t\tparent::bulk_footer();\n\n\t\t$update_actions = array(\n\t\t\t'themes_page'  => sprintf(\n\t\t\t\t'<a href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\tself_admin_url( 'themes.php' ),\n\t\t\t\t__( 'Return to Themes page' )\n\t\t\t),\n\t\t\t'updates_page' => sprintf(\n\t\t\t\t'<a href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t__( 'Return to WordPress Updates page' )\n\t\t\t),\n\t\t);\n\n\t\tif ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) {\n\t\t\tunset( $update_actions['themes_page'] );\n\t\t}\n\n\t\t/**\n\t\t * Filters the list of action links available following bulk theme updates.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string[] $update_actions Array of theme action links.\n\t\t * @param WP_Theme $theme_info     Theme object for the last-updated theme.\n\t\t */\n\t\t$update_actions = apply_filters( 'update_bulk_theme_complete_actions', $update_actions, $this->theme_info );\n\n\t\tif ( ! empty( $update_actions ) ) {\n\t\t\t$this->feedback( implode( ' | ', (array) $update_actions ) );\n\t\t}\n\t}\n}\n", "num_lines": 79}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrader API: Bulk_Upgrader_Skin class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Generic Bulk Upgrader Skin for WordPress Upgrades.\n *\n * @since 3.0.0\n * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.\n *\n * @see WP_Upgrader_Skin\n */\nclass Bulk_Upgrader_Skin extends WP_Upgrader_Skin {\n\tpublic $in_loop = false;\n\t/**\n\t * @var string|false\n\t */\n\tpublic $error = false;\n\n\t/**\n\t * @param array $args\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\t$defaults = array(\n\t\t\t'url'   => '',\n\t\t\t'nonce' => '',\n\t\t);\n\t\t$args     = wp_parse_args( $args, $defaults );\n\n\t\tparent::__construct( $args );\n\t}\n\n\t/**\n\t */\n\tpublic function add_strings() {\n\t\t$this->upgrader->strings['skin_upgrade_start'] = __( 'The update process is starting. This process may take a while on some hosts, so please be patient.' );\n\t\t/* translators: 1: Title of an update, 2: Error message. */\n\t\t$this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while updating %1$s: %2$s' );\n\t\t/* translators: %s: Title of an update. */\n\t\t$this->upgrader->strings['skin_update_failed'] = __( 'The update of %s failed.' );\n\t\t/* translators: %s: Title of an update. */\n\t\t$this->upgrader->strings['skin_update_successful'] = __( '%s updated successfully.' );\n\t\t$this->upgrader->strings['skin_upgrade_end']       = __( 'All updates have been completed.' );\n\t}\n\n\t/**\n\t * @param string $string\n\t * @param mixed  ...$args Optional text replacements.\n\t */\n\tpublic function feedback( $string, ...$args ) {\n\t\tif ( isset( $this->upgrader->strings[ $string ] ) ) {\n\t\t\t$string = $this->upgrader->strings[ $string ];\n\t\t}\n\n\t\tif ( strpos( $string, '%' ) !== false ) {\n\t\t\tif ( $args ) {\n\t\t\t\t$args   = array_map( 'strip_tags', $args );\n\t\t\t\t$args   = array_map( 'esc_html', $args );\n\t\t\t\t$string = vsprintf( $string, $args );\n\t\t\t}\n\t\t}\n\t\tif ( empty( $string ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( $this->in_loop ) {\n\t\t\techo \"$string<br />\\n\";\n\t\t} else {\n\t\t\techo \"<p>$string</p>\\n\";\n\t\t}\n\t}\n\n\t/**\n\t */\n\tpublic function header() {\n\t\t// Nothing, This will be displayed within a iframe.\n\t}\n\n\t/**\n\t */\n\tpublic function footer() {\n\t\t// Nothing, This will be displayed within a iframe.\n\t}\n\n\t/**\n\t * @param string|WP_Error $error\n\t */\n\tpublic function error( $error ) {\n\t\tif ( is_string( $error ) && isset( $this->upgrader->strings[ $error ] ) ) {\n\t\t\t$this->error = $this->upgrader->strings[ $error ];\n\t\t}\n\n\t\tif ( is_wp_error( $error ) ) {\n\t\t\t$messages = array();\n\t\t\tforeach ( $error->get_error_messages() as $emessage ) {\n\t\t\t\tif ( $error->get_error_data() && is_string( $error->get_error_data() ) ) {\n\t\t\t\t\t$messages[] = $emessage . ' ' . esc_html( strip_tags( $error->get_error_data() ) );\n\t\t\t\t} else {\n\t\t\t\t\t$messages[] = $emessage;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->error = implode( ', ', $messages );\n\t\t}\n\t\techo '<script type=\"text/javascript\">jQuery(\\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\\').hide();</script>';\n\t}\n\n\t/**\n\t */\n\tpublic function bulk_header() {\n\t\t$this->feedback( 'skin_upgrade_start' );\n\t}\n\n\t/**\n\t */\n\tpublic function bulk_footer() {\n\t\t$this->feedback( 'skin_upgrade_end' );\n\t}\n\n\t/**\n\t * @param string $title\n\t */\n\tpublic function before( $title = '' ) {\n\t\t$this->in_loop = true;\n\t\tprintf( '<h2>' . $this->upgrader->strings['skin_before_update_header'] . ' <span class=\"spinner waiting-' . $this->upgrader->update_current . '\"></span></h2>', $title, $this->upgrader->update_current, $this->upgrader->update_count );\n\t\techo '<script type=\"text/javascript\">jQuery(\\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\\').css(\"display\", \"inline-block\");</script>';\n\t\t// This progress messages div gets moved via JavaScript when clicking on \"Show details.\".\n\t\techo '<div class=\"update-messages hide-if-js\" id=\"progress-' . esc_attr( $this->upgrader->update_current ) . '\"><p>';\n\t\t$this->flush_output();\n\t}\n\n\t/**\n\t * @param string $title\n\t */\n\tpublic function after( $title = '' ) {\n\t\techo '</p></div>';\n\t\tif ( $this->error || ! $this->result ) {\n\t\t\tif ( $this->error ) {\n\t\t\t\techo '<div class=\"error\"><p>' . sprintf( $this->upgrader->strings['skin_update_failed_error'], $title, '<strong>' . $this->error . '</strong>' ) . '</p></div>';\n\t\t\t} else {\n\t\t\t\techo '<div class=\"error\"><p>' . sprintf( $this->upgrader->strings['skin_update_failed'], $title ) . '</p></div>';\n\t\t\t}\n\n\t\t\techo '<script type=\"text/javascript\">jQuery(\\'#progress-' . esc_js( $this->upgrader->update_current ) . '\\').show();</script>';\n\t\t}\n\t\tif ( $this->result && ! is_wp_error( $this->result ) ) {\n\t\t\tif ( ! $this->error ) {\n\t\t\t\techo '<div class=\"updated js-update-details\" data-update-details=\"progress-' . esc_attr( $this->upgrader->update_current ) . '\">' .\n\t\t\t\t\t'<p>' . sprintf( $this->upgrader->strings['skin_update_successful'], $title ) .\n\t\t\t\t\t' <button type=\"button\" class=\"hide-if-no-js button-link js-update-details-toggle\" aria-expanded=\"false\">' . __( 'Show details.' ) . '</button>' .\n\t\t\t\t\t'</p></div>';\n\t\t\t}\n\n\t\t\techo '<script type=\"text/javascript\">jQuery(\\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\\').hide();</script>';\n\t\t}\n\n\t\t$this->reset();\n\t\t$this->flush_output();\n\t}\n\n\t/**\n\t */\n\tpublic function reset() {\n\t\t$this->in_loop = false;\n\t\t$this->error   = false;\n\t}\n\n\t/**\n\t */\n\tpublic function flush_output() {\n\t\twp_ob_end_flush_all();\n\t\tflush();\n\t}\n}\n", "num_lines": 178}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrade API: Core_Upgrader class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Core class used for updating core.\n *\n * It allows for WordPress to upgrade itself in combination with\n * the wp-admin/includes/update-core.php file.\n *\n * @since 2.8.0\n * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php.\n *\n * @see WP_Upgrader\n */\nclass Core_Upgrader extends WP_Upgrader {\n\n\t/**\n\t * Initialize the upgrade strings.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function upgrade_strings() {\n\t\t$this->strings['up_to_date'] = __( 'WordPress is at the latest version.' );\n\t\t$this->strings['locked']     = __( 'Another update is currently in progress.' );\n\t\t$this->strings['no_package'] = __( 'Update package not available.' );\n\t\t/* translators: %s: Package URL. */\n\t\t$this->strings['downloading_package']   = sprintf( __( 'Downloading update from %s&#8230;' ), '<span class=\"code\">%s</span>' );\n\t\t$this->strings['unpack_package']        = __( 'Unpacking the update&#8230;' );\n\t\t$this->strings['copy_failed']           = __( 'Could not copy files.' );\n\t\t$this->strings['copy_failed_space']     = __( 'Could not copy files. You may have run out of disk space.' );\n\t\t$this->strings['start_rollback']        = __( 'Attempting to roll back to previous version.' );\n\t\t$this->strings['rollback_was_required'] = __( 'Due to an error during updating, WordPress has rolled back to your previous version.' );\n\t}\n\n\t/**\n\t * Upgrade WordPress core.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @global WP_Filesystem_Base $wp_filesystem                WordPress filesystem subclass.\n\t * @global callable           $_wp_filesystem_direct_method\n\t *\n\t * @param object $current Response object for whether WordPress is current.\n\t * @param array  $args {\n\t *        Optional. Arguments for upgrading WordPress core. Default empty array.\n\t *\n\t *        @type bool $pre_check_md5    Whether to check the file checksums before\n\t *                                     attempting the upgrade. Default true.\n\t *        @type bool $attempt_rollback Whether to attempt to rollback the chances if\n\t *                                     there is a problem. Default false.\n\t *        @type bool $do_rollback      Whether to perform this \"upgrade\" as a rollback.\n\t *                                     Default false.\n\t * }\n\t * @return string|false|WP_Error New WordPress version on success, false or WP_Error on failure.\n\t */\n\tpublic function upgrade( $current, $args = array() ) {\n\t\tglobal $wp_filesystem;\n\n\t\trequire ABSPATH . WPINC . '/version.php'; // $wp_version;\n\n\t\t$start_time = time();\n\n\t\t$defaults    = array(\n\t\t\t'pre_check_md5'                => true,\n\t\t\t'attempt_rollback'             => false,\n\t\t\t'do_rollback'                  => false,\n\t\t\t'allow_relaxed_file_ownership' => false,\n\t\t);\n\t\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t\t$this->init();\n\t\t$this->upgrade_strings();\n\n\t\t// Is an update available?\n\t\tif ( ! isset( $current->response ) || 'latest' === $current->response ) {\n\t\t\treturn new WP_Error( 'up_to_date', $this->strings['up_to_date'] );\n\t\t}\n\n\t\t$res = $this->fs_connect( array( ABSPATH, WP_CONTENT_DIR ), $parsed_args['allow_relaxed_file_ownership'] );\n\t\tif ( ! $res || is_wp_error( $res ) ) {\n\t\t\treturn $res;\n\t\t}\n\n\t\t$wp_dir = trailingslashit( $wp_filesystem->abspath() );\n\n\t\t$partial = true;\n\t\tif ( $parsed_args['do_rollback'] ) {\n\t\t\t$partial = false;\n\t\t} elseif ( $parsed_args['pre_check_md5'] && ! $this->check_files() ) {\n\t\t\t$partial = false;\n\t\t}\n\n\t\t/*\n\t\t * If partial update is returned from the API, use that, unless we're doing\n\t\t * a reinstallation. If we cross the new_bundled version number, then use\n\t\t * the new_bundled zip. Don't though if the constant is set to skip bundled items.\n\t\t * If the API returns a no_content zip, go with it. Finally, default to the full zip.\n\t\t */\n\t\tif ( $parsed_args['do_rollback'] && $current->packages->rollback ) {\n\t\t\t$to_download = 'rollback';\n\t\t} elseif ( $current->packages->partial && 'reinstall' !== $current->response && $wp_version == $current->partial_version && $partial ) {\n\t\t\t$to_download = 'partial';\n\t\t} elseif ( $current->packages->new_bundled && version_compare( $wp_version, $current->new_bundled, '<' )\n\t\t\t&& ( ! defined( 'CORE_UPGRADE_SKIP_NEW_BUNDLED' ) || ! CORE_UPGRADE_SKIP_NEW_BUNDLED ) ) {\n\t\t\t$to_download = 'new_bundled';\n\t\t} elseif ( $current->packages->no_content ) {\n\t\t\t$to_download = 'no_content';\n\t\t} else {\n\t\t\t$to_download = 'full';\n\t\t}\n\n\t\t// Lock to prevent multiple Core Updates occurring.\n\t\t$lock = WP_Upgrader::create_lock( 'core_updater', 15 * MINUTE_IN_SECONDS );\n\t\tif ( ! $lock ) {\n\t\t\treturn new WP_Error( 'locked', $this->strings['locked'] );\n\t\t}\n\n\t\t$download = $this->download_package( $current->packages->$to_download, true );\n\n\t\t// Allow for signature soft-fail.\n\t\t// WARNING: This may be removed in the future.\n\t\tif ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) {\n\t\t\t// Outout the failure error as a normal feedback, and not as an error:\n\t\t\t/** This filter is documented in wp-admin/includes/update-core.php */\n\t\t\tapply_filters( 'update_feedback', $download->get_error_message() );\n\n\t\t\t// Report this failure back to WordPress.org for debugging purposes.\n\t\t\twp_version_check(\n\t\t\t\tarray(\n\t\t\t\t\t'signature_failure_code' => $download->get_error_code(),\n\t\t\t\t\t'signature_failure_data' => $download->get_error_data(),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Pretend this error didn't happen.\n\t\t\t$download = $download->get_error_data( 'softfail-filename' );\n\t\t}\n\n\t\tif ( is_wp_error( $download ) ) {\n\t\t\tWP_Upgrader::release_lock( 'core_updater' );\n\t\t\treturn $download;\n\t\t}\n\n\t\t$working_dir = $this->unpack_package( $download );\n\t\tif ( is_wp_error( $working_dir ) ) {\n\t\t\tWP_Upgrader::release_lock( 'core_updater' );\n\t\t\treturn $working_dir;\n\t\t}\n\n\t\t// Copy update-core.php from the new version into place.\n\t\tif ( ! $wp_filesystem->copy( $working_dir . '/wordpress/wp-admin/includes/update-core.php', $wp_dir . 'wp-admin/includes/update-core.php', true ) ) {\n\t\t\t$wp_filesystem->delete( $working_dir, true );\n\t\t\tWP_Upgrader::release_lock( 'core_updater' );\n\t\t\treturn new WP_Error( 'copy_failed_for_update_core_file', __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' ), 'wp-admin/includes/update-core.php' );\n\t\t}\n\t\t$wp_filesystem->chmod( $wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE );\n\n\t\twp_opcache_invalidate( ABSPATH . 'wp-admin/includes/update-core.php' );\n\t\trequire_once ABSPATH . 'wp-admin/includes/update-core.php';\n\n\t\tif ( ! function_exists( 'update_core' ) ) {\n\t\t\tWP_Upgrader::release_lock( 'core_updater' );\n\t\t\treturn new WP_Error( 'copy_failed_space', $this->strings['copy_failed_space'] );\n\t\t}\n\n\t\t$result = update_core( $working_dir, $wp_dir );\n\n\t\t// In the event of an issue, we may be able to roll back.\n\t\tif ( $parsed_args['attempt_rollback'] && $current->packages->rollback && ! $parsed_args['do_rollback'] ) {\n\t\t\t$try_rollback = false;\n\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\t$error_code = $result->get_error_code();\n\t\t\t\t/*\n\t\t\t\t * Not all errors are equal. These codes are critical: copy_failed__copy_dir,\n\t\t\t\t * mkdir_failed__copy_dir, copy_failed__copy_dir_retry, and disk_full.\n\t\t\t\t * do_rollback allows for update_core() to trigger a rollback if needed.\n\t\t\t\t */\n\t\t\t\tif ( false !== strpos( $error_code, 'do_rollback' ) ) {\n\t\t\t\t\t$try_rollback = true;\n\t\t\t\t} elseif ( false !== strpos( $error_code, '__copy_dir' ) ) {\n\t\t\t\t\t$try_rollback = true;\n\t\t\t\t} elseif ( 'disk_full' === $error_code ) {\n\t\t\t\t\t$try_rollback = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $try_rollback ) {\n\t\t\t\t/** This filter is documented in wp-admin/includes/update-core.php */\n\t\t\t\tapply_filters( 'update_feedback', $result );\n\n\t\t\t\t/** This filter is documented in wp-admin/includes/update-core.php */\n\t\t\t\tapply_filters( 'update_feedback', $this->strings['start_rollback'] );\n\n\t\t\t\t$rollback_result = $this->upgrade( $current, array_merge( $parsed_args, array( 'do_rollback' => true ) ) );\n\n\t\t\t\t$original_result = $result;\n\t\t\t\t$result          = new WP_Error(\n\t\t\t\t\t'rollback_was_required',\n\t\t\t\t\t$this->strings['rollback_was_required'],\n\t\t\t\t\t(object) array(\n\t\t\t\t\t\t'update'   => $original_result,\n\t\t\t\t\t\t'rollback' => $rollback_result,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/** This action is documented in wp-admin/includes/class-wp-upgrader.php */\n\t\tdo_action(\n\t\t\t'upgrader_process_complete',\n\t\t\t$this,\n\t\t\tarray(\n\t\t\t\t'action' => 'update',\n\t\t\t\t'type'   => 'core',\n\t\t\t)\n\t\t);\n\n\t\t// Clear the current updates.\n\t\tdelete_site_transient( 'update_core' );\n\n\t\tif ( ! $parsed_args['do_rollback'] ) {\n\t\t\t$stats = array(\n\t\t\t\t'update_type'      => $current->response,\n\t\t\t\t'success'          => true,\n\t\t\t\t'fs_method'        => $wp_filesystem->method,\n\t\t\t\t'fs_method_forced' => defined( 'FS_METHOD' ) || has_filter( 'filesystem_method' ),\n\t\t\t\t'fs_method_direct' => ! empty( $GLOBALS['_wp_filesystem_direct_method'] ) ? $GLOBALS['_wp_filesystem_direct_method'] : '',\n\t\t\t\t'time_taken'       => time() - $start_time,\n\t\t\t\t'reported'         => $wp_version,\n\t\t\t\t'attempted'        => $current->version,\n\t\t\t);\n\n\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\t$stats['success'] = false;\n\t\t\t\t// Did a rollback occur?\n\t\t\t\tif ( ! empty( $try_rollback ) ) {\n\t\t\t\t\t$stats['error_code'] = $original_result->get_error_code();\n\t\t\t\t\t$stats['error_data'] = $original_result->get_error_data();\n\t\t\t\t\t// Was the rollback successful? If not, collect its error too.\n\t\t\t\t\t$stats['rollback'] = ! is_wp_error( $rollback_result );\n\t\t\t\t\tif ( is_wp_error( $rollback_result ) ) {\n\t\t\t\t\t\t$stats['rollback_code'] = $rollback_result->get_error_code();\n\t\t\t\t\t\t$stats['rollback_data'] = $rollback_result->get_error_data();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$stats['error_code'] = $result->get_error_code();\n\t\t\t\t\t$stats['error_data'] = $result->get_error_data();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twp_version_check( $stats );\n\t\t}\n\n\t\tWP_Upgrader::release_lock( 'core_updater' );\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Determines if this WordPress Core version should update to an offered version or not.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param string $offered_ver The offered version, of the format x.y.z.\n\t * @return bool True if we should update to the offered version, otherwise false.\n\t */\n\tpublic static function should_update_to_version( $offered_ver ) {\n\t\trequire ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z\n\n\t\t$current_branch = implode( '.', array_slice( preg_split( '/[.-]/', $wp_version ), 0, 2 ) ); // x.y\n\t\t$new_branch     = implode( '.', array_slice( preg_split( '/[.-]/', $offered_ver ), 0, 2 ) ); // x.y\n\n\t\t$current_is_development_version = (bool) strpos( $wp_version, '-' );\n\n\t\t// Defaults:\n\t\t$upgrade_dev   = true;\n\t\t$upgrade_minor = true;\n\t\t$upgrade_major = false;\n\n\t\t// WP_AUTO_UPDATE_CORE = true (all), 'minor', false.\n\t\tif ( defined( 'WP_AUTO_UPDATE_CORE' ) ) {\n\t\t\tif ( false === WP_AUTO_UPDATE_CORE ) {\n\t\t\t\t// Defaults to turned off, unless a filter allows it.\n\t\t\t\t$upgrade_dev   = false;\n\t\t\t\t$upgrade_minor = false;\n\t\t\t\t$upgrade_major = false;\n\t\t\t} elseif ( true === WP_AUTO_UPDATE_CORE ) {\n\t\t\t\t// ALL updates for core.\n\t\t\t\t$upgrade_dev   = true;\n\t\t\t\t$upgrade_minor = true;\n\t\t\t\t$upgrade_major = true;\n\t\t\t} elseif ( 'minor' === WP_AUTO_UPDATE_CORE ) {\n\t\t\t\t// Only minor updates for core.\n\t\t\t\t$upgrade_dev   = false;\n\t\t\t\t$upgrade_minor = true;\n\t\t\t\t$upgrade_major = false;\n\t\t\t}\n\t\t}\n\n\t\t// 1: If we're already on that version, not much point in updating?\n\t\tif ( $offered_ver == $wp_version ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// 2: If we're running a newer version, that's a nope.\n\t\tif ( version_compare( $wp_version, $offered_ver, '>' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$failure_data = get_site_option( 'auto_core_update_failed' );\n\t\tif ( $failure_data ) {\n\t\t\t// If this was a critical update failure, cannot update.\n\t\t\tif ( ! empty( $failure_data['critical'] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Don't claim we can update on update-core.php if we have a non-critical failure logged.\n\t\t\tif ( $wp_version == $failure_data['current'] && false !== strpos( $offered_ver, '.1.next.minor' ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Cannot update if we're retrying the same A to B update that caused a non-critical failure.\n\t\t\t * Some non-critical failures do allow retries, like download_failed.\n\t\t\t * 3.7.1 => 3.7.2 resulted in files_not_writable, if we are still on 3.7.1 and still trying to update to 3.7.2.\n\t\t\t */\n\t\t\tif ( empty( $failure_data['retry'] ) && $wp_version == $failure_data['current'] && $offered_ver == $failure_data['attempted'] ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// 3: 3.7-alpha-25000 -> 3.7-alpha-25678 -> 3.7-beta1 -> 3.7-beta2.\n\t\tif ( $current_is_development_version ) {\n\n\t\t\t/**\n\t\t\t * Filters whether to enable automatic core updates for development versions.\n\t\t\t *\n\t\t\t * @since 3.7.0\n\t\t\t *\n\t\t\t * @param bool $upgrade_dev Whether to enable automatic updates for\n\t\t\t *                          development versions.\n\t\t\t */\n\t\t\tif ( ! apply_filters( 'allow_dev_auto_core_updates', $upgrade_dev ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// Else fall through to minor + major branches below.\n\t\t}\n\n\t\t// 4: Minor in-branch updates (3.7.0 -> 3.7.1 -> 3.7.2 -> 3.7.4).\n\t\tif ( $current_branch == $new_branch ) {\n\n\t\t\t/**\n\t\t\t * Filters whether to enable minor automatic core updates.\n\t\t\t *\n\t\t\t * @since 3.7.0\n\t\t\t *\n\t\t\t * @param bool $upgrade_minor Whether to enable minor automatic core updates.\n\t\t\t */\n\t\t\treturn apply_filters( 'allow_minor_auto_core_updates', $upgrade_minor );\n\t\t}\n\n\t\t// 5: Major version updates (3.7.0 -> 3.8.0 -> 3.9.1).\n\t\tif ( version_compare( $new_branch, $current_branch, '>' ) ) {\n\n\t\t\t/**\n\t\t\t * Filters whether to enable major automatic core updates.\n\t\t\t *\n\t\t\t * @since 3.7.0\n\t\t\t *\n\t\t\t * @param bool $upgrade_major Whether to enable major automatic core updates.\n\t\t\t */\n\t\t\treturn apply_filters( 'allow_major_auto_core_updates', $upgrade_major );\n\t\t}\n\n\t\t// If we're not sure, we don't want it.\n\t\treturn false;\n\t}\n\n\t/**\n\t * Compare the disk file checksums against the expected checksums.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @global string $wp_version       The WordPress version string.\n\t * @global string $wp_local_package Locale code of the package.\n\t *\n\t * @return bool True if the checksums match, otherwise false.\n\t */\n\tpublic function check_files() {\n\t\tglobal $wp_version, $wp_local_package;\n\n\t\t$checksums = get_core_checksums( $wp_version, isset( $wp_local_package ) ? $wp_local_package : 'en_US' );\n\n\t\tif ( ! is_array( $checksums ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ( $checksums as $file => $checksum ) {\n\t\t\t// Skip files which get updated.\n\t\t\tif ( 'wp-content' === substr( $file, 0, 10 ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( ! file_exists( ABSPATH . $file ) || md5_file( ABSPATH . $file ) !== $checksum ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n}\n", "num_lines": 417}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The custom background script.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * The custom background class.\n *\n * @since 3.0.0\n */\nclass Custom_Background {\n\n\t/**\n\t * Callback for administration header.\n\t *\n\t * @var callable\n\t * @since 3.0.0\n\t */\n\tpublic $admin_header_callback;\n\n\t/**\n\t * Callback for header div.\n\t *\n\t * @var callable\n\t * @since 3.0.0\n\t */\n\tpublic $admin_image_div_callback;\n\n\t/**\n\t * Used to trigger a success message when settings updated and set to true.\n\t *\n\t * @since 3.0.0\n\t * @var bool\n\t */\n\tprivate $updated;\n\n\t/**\n\t * Constructor - Register administration header callback.\n\t *\n\t * @since 3.0.0\n\t * @param callable $admin_header_callback\n\t * @param callable $admin_image_div_callback Optional custom image div output callback.\n\t */\n\tpublic function __construct( $admin_header_callback = '', $admin_image_div_callback = '' ) {\n\t\t$this->admin_header_callback    = $admin_header_callback;\n\t\t$this->admin_image_div_callback = $admin_image_div_callback;\n\n\t\tadd_action( 'admin_menu', array( $this, 'init' ) );\n\n\t\tadd_action( 'wp_ajax_custom-background-add', array( $this, 'ajax_background_add' ) );\n\n\t\t// Unused since 3.5.0.\n\t\tadd_action( 'wp_ajax_set-background-image', array( $this, 'wp_set_background_image' ) );\n\t}\n\n\t/**\n\t * Set up the hooks for the Custom Background admin page.\n\t *\n\t * @since 3.0.0\n\t */\n\tpublic function init() {\n\t\t$page = add_theme_page( __( 'Background' ), __( 'Background' ), 'edit_theme_options', 'custom-background', array( $this, 'admin_page' ) );\n\t\tif ( ! $page ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_action( \"load-{$page}\", array( $this, 'admin_load' ) );\n\t\tadd_action( \"load-{$page}\", array( $this, 'take_action' ), 49 );\n\t\tadd_action( \"load-{$page}\", array( $this, 'handle_upload' ), 49 );\n\n\t\tif ( $this->admin_header_callback ) {\n\t\t\tadd_action( \"admin_head-{$page}\", $this->admin_header_callback, 51 );\n\t\t}\n\t}\n\n\t/**\n\t * Set up the enqueue for the CSS & JavaScript files.\n\t *\n\t * @since 3.0.0\n\t */\n\tpublic function admin_load() {\n\t\tget_current_screen()->add_help_tab(\n\t\t\tarray(\n\t\t\t\t'id'      => 'overview',\n\t\t\t\t'title'   => __( 'Overview' ),\n\t\t\t\t'content' =>\n\t\t\t\t\t'<p>' . __( 'You can customize the look of your site without touching any of your theme&#8217;s code by using a custom background. Your background can be an image or a color.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'To use a background image, simply upload it or choose an image that has already been uploaded to your Media Library by clicking the &#8220;Choose Image&#8221; button. You can display a single instance of your image, or tile it to fill the screen. You can have your background fixed in place, so your site content moves on top of it, or you can have it scroll with your site.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'You can also choose a background color by clicking the Select Color button and either typing in a legitimate HTML hex value, e.g. &#8220;#ff0000&#8221; for red, or by choosing a color using the color picker.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'Don&#8217;t forget to click on the Save Changes button when you are finished.' ) . '</p>',\n\t\t\t)\n\t\t);\n\n\t\tget_current_screen()->set_help_sidebar(\n\t\t\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t\t\t'<p>' . __( '<a href=\"https://codex.wordpress.org/Appearance_Background_Screen\">Documentation on Custom Background</a>' ) . '</p>' .\n\t\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n\t\t);\n\n\t\twp_enqueue_media();\n\t\twp_enqueue_script( 'custom-background' );\n\t\twp_enqueue_style( 'wp-color-picker' );\n\t}\n\n\t/**\n\t * Execute custom background modification.\n\t *\n\t * @since 3.0.0\n\t */\n\tpublic function take_action() {\n\t\tif ( empty( $_POST ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( $_POST['reset-background'] ) ) {\n\t\t\tcheck_admin_referer( 'custom-background-reset', '_wpnonce-custom-background-reset' );\n\t\t\tremove_theme_mod( 'background_image' );\n\t\t\tremove_theme_mod( 'background_image_thumb' );\n\t\t\t$this->updated = true;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( $_POST['remove-background'] ) ) {\n\t\t\t// @todo Uploaded files are not removed here.\n\t\t\tcheck_admin_referer( 'custom-background-remove', '_wpnonce-custom-background-remove' );\n\t\t\tset_theme_mod( 'background_image', '' );\n\t\t\tset_theme_mod( 'background_image_thumb', '' );\n\t\t\t$this->updated = true;\n\t\t\twp_safe_redirect( $_POST['_wp_http_referer'] );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( $_POST['background-preset'] ) ) {\n\t\t\tcheck_admin_referer( 'custom-background' );\n\n\t\t\tif ( in_array( $_POST['background-preset'], array( 'default', 'fill', 'fit', 'repeat', 'custom' ), true ) ) {\n\t\t\t\t$preset = $_POST['background-preset'];\n\t\t\t} else {\n\t\t\t\t$preset = 'default';\n\t\t\t}\n\n\t\t\tset_theme_mod( 'background_preset', $preset );\n\t\t}\n\n\t\tif ( isset( $_POST['background-position'] ) ) {\n\t\t\tcheck_admin_referer( 'custom-background' );\n\n\t\t\t$position = explode( ' ', $_POST['background-position'] );\n\n\t\t\tif ( in_array( $position[0], array( 'left', 'center', 'right' ), true ) ) {\n\t\t\t\t$position_x = $position[0];\n\t\t\t} else {\n\t\t\t\t$position_x = 'left';\n\t\t\t}\n\n\t\t\tif ( in_array( $position[1], array( 'top', 'center', 'bottom' ), true ) ) {\n\t\t\t\t$position_y = $position[1];\n\t\t\t} else {\n\t\t\t\t$position_y = 'top';\n\t\t\t}\n\n\t\t\tset_theme_mod( 'background_position_x', $position_x );\n\t\t\tset_theme_mod( 'background_position_y', $position_y );\n\t\t}\n\n\t\tif ( isset( $_POST['background-size'] ) ) {\n\t\t\tcheck_admin_referer( 'custom-background' );\n\n\t\t\tif ( in_array( $_POST['background-size'], array( 'auto', 'contain', 'cover' ), true ) ) {\n\t\t\t\t$size = $_POST['background-size'];\n\t\t\t} else {\n\t\t\t\t$size = 'auto';\n\t\t\t}\n\n\t\t\tset_theme_mod( 'background_size', $size );\n\t\t}\n\n\t\tif ( isset( $_POST['background-repeat'] ) ) {\n\t\t\tcheck_admin_referer( 'custom-background' );\n\n\t\t\t$repeat = $_POST['background-repeat'];\n\n\t\t\tif ( 'no-repeat' !== $repeat ) {\n\t\t\t\t$repeat = 'repeat';\n\t\t\t}\n\n\t\t\tset_theme_mod( 'background_repeat', $repeat );\n\t\t}\n\n\t\tif ( isset( $_POST['background-attachment'] ) ) {\n\t\t\tcheck_admin_referer( 'custom-background' );\n\n\t\t\t$attachment = $_POST['background-attachment'];\n\n\t\t\tif ( 'fixed' !== $attachment ) {\n\t\t\t\t$attachment = 'scroll';\n\t\t\t}\n\n\t\t\tset_theme_mod( 'background_attachment', $attachment );\n\t\t}\n\n\t\tif ( isset( $_POST['background-color'] ) ) {\n\t\t\tcheck_admin_referer( 'custom-background' );\n\t\t\t$color = preg_replace( '/[^0-9a-fA-F]/', '', $_POST['background-color'] );\n\t\t\tif ( strlen( $color ) == 6 || strlen( $color ) == 3 ) {\n\t\t\t\tset_theme_mod( 'background_color', $color );\n\t\t\t} else {\n\t\t\t\tset_theme_mod( 'background_color', '' );\n\t\t\t}\n\t\t}\n\n\t\t$this->updated = true;\n\t}\n\n\t/**\n\t * Display the custom background page.\n\t *\n\t * @since 3.0.0\n\t */\n\tpublic function admin_page() {\n\t\t?>\n<div class=\"wrap\" id=\"custom-background\">\n<h1><?php _e( 'Custom Background' ); ?></h1>\n\n\t\t<?php if ( current_user_can( 'customize' ) ) { ?>\n<div class=\"notice notice-info hide-if-no-customize\">\n\t<p>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: URL to background image configuration in Customizer. */\n\t\t\t\t__( 'You can now manage and live-preview Custom Backgrounds in the <a href=\"%s\">Customizer</a>.' ),\n\t\t\t\tadmin_url( 'customize.php?autofocus[control]=background_image' )\n\t\t\t);\n\t\t\t?>\n\t</p>\n</div>\n\t\t<?php } ?>\n\n\t\t<?php if ( ! empty( $this->updated ) ) { ?>\n<div id=\"message\" class=\"updated\">\n\t<p>\n\t\t\t<?php\n\t\t\t/* translators: %s: Home URL. */\n\t\t\tprintf( __( 'Background updated. <a href=\"%s\">Visit your site</a> to see how it looks.' ), home_url( '/' ) );\n\t\t\t?>\n\t</p>\n</div>\n\t\t<?php } ?>\n\n<h2><?php _e( 'Background Image' ); ?></h2>\n\n<table class=\"form-table\" role=\"presentation\">\n<tbody>\n<tr>\n<th scope=\"row\"><?php _e( 'Preview' ); ?></th>\n<td>\n\t\t<?php\n\t\tif ( $this->admin_image_div_callback ) {\n\t\t\tcall_user_func( $this->admin_image_div_callback );\n\t\t} else {\n\t\t\t$background_styles = '';\n\t\t\t$bgcolor           = get_background_color();\n\t\t\tif ( $bgcolor ) {\n\t\t\t\t$background_styles .= 'background-color: #' . $bgcolor . ';';\n\t\t\t}\n\n\t\t\t$background_image_thumb = get_background_image();\n\t\t\tif ( $background_image_thumb ) {\n\t\t\t\t$background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', $background_image_thumb ) ) ) );\n\t\t\t\t$background_position_x  = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) );\n\t\t\t\t$background_position_y  = get_theme_mod( 'background_position_y', get_theme_support( 'custom-background', 'default-position-y' ) );\n\t\t\t\t$background_size        = get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) );\n\t\t\t\t$background_repeat      = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) );\n\t\t\t\t$background_attachment  = get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) );\n\n\t\t\t\t// Background-image URL must be single quote, see below.\n\t\t\t\t$background_styles .= \" background-image: url('$background_image_thumb');\"\n\t\t\t\t. \" background-size: $background_size;\"\n\t\t\t\t. \" background-position: $background_position_x $background_position_y;\"\n\t\t\t\t. \" background-repeat: $background_repeat;\"\n\t\t\t\t. \" background-attachment: $background_attachment;\";\n\t\t\t}\n\t\t\t?>\n\t<div id=\"custom-background-image\" style=\"<?php echo $background_styles; ?>\"><?php // Must be double quote, see above. ?>\n\t\t\t<?php if ( $background_image_thumb ) { ?>\n\t\t<img class=\"custom-background-image\" src=\"<?php echo $background_image_thumb; ?>\" style=\"visibility:hidden;\" alt=\"\" /><br />\n\t\t<img class=\"custom-background-image\" src=\"<?php echo $background_image_thumb; ?>\" style=\"visibility:hidden;\" alt=\"\" />\n\t\t<?php } ?>\n\t</div>\n\t<?php } ?>\n</td>\n</tr>\n\n\t\t<?php if ( get_background_image() ) : ?>\n<tr>\n<th scope=\"row\"><?php _e( 'Remove Image' ); ?></th>\n<td>\n<form method=\"post\">\n\t\t\t<?php wp_nonce_field( 'custom-background-remove', '_wpnonce-custom-background-remove' ); ?>\n\t\t\t<?php submit_button( __( 'Remove Background Image' ), '', 'remove-background', false ); ?><br/>\n\t\t\t<?php _e( 'This will remove the background image. You will not be able to restore any customizations.' ); ?>\n</form>\n</td>\n</tr>\n\t\t<?php endif; ?>\n\n\t\t<?php $default_image = get_theme_support( 'custom-background', 'default-image' ); ?>\n\t\t<?php if ( $default_image && get_background_image() != $default_image ) : ?>\n<tr>\n<th scope=\"row\"><?php _e( 'Restore Original Image' ); ?></th>\n<td>\n<form method=\"post\">\n\t\t\t<?php wp_nonce_field( 'custom-background-reset', '_wpnonce-custom-background-reset' ); ?>\n\t\t\t<?php submit_button( __( 'Restore Original Image' ), '', 'reset-background', false ); ?><br/>\n\t\t\t<?php _e( 'This will restore the original background image. You will not be able to restore any customizations.' ); ?>\n</form>\n</td>\n</tr>\n\t\t<?php endif; ?>\n\n\t\t<?php if ( current_user_can( 'upload_files' ) ) : ?>\n<tr>\n<th scope=\"row\"><?php _e( 'Select Image' ); ?></th>\n<td><form enctype=\"multipart/form-data\" id=\"upload-form\" class=\"wp-upload-form\" method=\"post\">\n\t<p>\n\t\t<label for=\"upload\"><?php _e( 'Choose an image from your computer:' ); ?></label><br />\n\t\t<input type=\"file\" id=\"upload\" name=\"import\" />\n\t\t<input type=\"hidden\" name=\"action\" value=\"save\" />\n\t\t\t<?php wp_nonce_field( 'custom-background-upload', '_wpnonce-custom-background-upload' ); ?>\n\t\t\t<?php submit_button( __( 'Upload' ), '', 'submit', false ); ?>\n\t</p>\n\t<p>\n\t\t<label for=\"choose-from-library-link\"><?php _e( 'Or choose an image from your media library:' ); ?></label><br />\n\t\t<button id=\"choose-from-library-link\" class=\"button\"\n\t\t\tdata-choose=\"<?php esc_attr_e( 'Choose a Background Image' ); ?>\"\n\t\t\tdata-update=\"<?php esc_attr_e( 'Set as background' ); ?>\"><?php _e( 'Choose Image' ); ?></button>\n\t</p>\n\t</form>\n</td>\n</tr>\n\t\t<?php endif; ?>\n</tbody>\n</table>\n\n<h2><?php _e( 'Display Options' ); ?></h2>\n<form method=\"post\">\n<table class=\"form-table\" role=\"presentation\">\n<tbody>\n\t\t<?php if ( get_background_image() ) : ?>\n<input name=\"background-preset\" type=\"hidden\" value=\"custom\">\n\n\t\t\t<?php\n\t\t\t$background_position = sprintf(\n\t\t\t\t'%s %s',\n\t\t\t\tget_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ),\n\t\t\t\tget_theme_mod( 'background_position_y', get_theme_support( 'custom-background', 'default-position-y' ) )\n\t\t\t);\n\n\t\t\t$background_position_options = array(\n\t\t\t\tarray(\n\t\t\t\t\t'left top'   => array(\n\t\t\t\t\t\t'label' => __( 'Top Left' ),\n\t\t\t\t\t\t'icon'  => 'dashicons dashicons-arrow-left-alt',\n\t\t\t\t\t),\n\t\t\t\t\t'center top' => array(\n\t\t\t\t\t\t'label' => __( 'Top' ),\n\t\t\t\t\t\t'icon'  => 'dashicons dashicons-arrow-up-alt',\n\t\t\t\t\t),\n\t\t\t\t\t'right top'  => array(\n\t\t\t\t\t\t'label' => __( 'Top Right' ),\n\t\t\t\t\t\t'icon'  => 'dashicons dashicons-arrow-right-alt',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'left center'   => array(\n\t\t\t\t\t\t'label' => __( 'Left' ),\n\t\t\t\t\t\t'icon'  => 'dashicons dashicons-arrow-left-alt',\n\t\t\t\t\t),\n\t\t\t\t\t'center center' => array(\n\t\t\t\t\t\t'label' => __( 'Center' ),\n\t\t\t\t\t\t'icon'  => 'background-position-center-icon',\n\t\t\t\t\t),\n\t\t\t\t\t'right center'  => array(\n\t\t\t\t\t\t'label' => __( 'Right' ),\n\t\t\t\t\t\t'icon'  => 'dashicons dashicons-arrow-right-alt',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'left bottom'   => array(\n\t\t\t\t\t\t'label' => __( 'Bottom Left' ),\n\t\t\t\t\t\t'icon'  => 'dashicons dashicons-arrow-left-alt',\n\t\t\t\t\t),\n\t\t\t\t\t'center bottom' => array(\n\t\t\t\t\t\t'label' => __( 'Bottom' ),\n\t\t\t\t\t\t'icon'  => 'dashicons dashicons-arrow-down-alt',\n\t\t\t\t\t),\n\t\t\t\t\t'right bottom'  => array(\n\t\t\t\t\t\t'label' => __( 'Bottom Right' ),\n\t\t\t\t\t\t'icon'  => 'dashicons dashicons-arrow-right-alt',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t\t?>\n<tr>\n<th scope=\"row\"><?php _e( 'Image Position' ); ?></th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Image Position' ); ?></span></legend>\n<div class=\"background-position-control\">\n\t\t\t<?php foreach ( $background_position_options as $group ) : ?>\n\t<div class=\"button-group\">\n\t\t\t\t<?php foreach ( $group as $value => $input ) : ?>\n\t\t<label>\n\t\t\t<input class=\"screen-reader-text\" name=\"background-position\" type=\"radio\" value=\"<?php echo esc_attr( $value ); ?>\"<?php checked( $value, $background_position ); ?>>\n\t\t\t<span class=\"button display-options position\"><span class=\"<?php echo esc_attr( $input['icon'] ); ?>\" aria-hidden=\"true\"></span></span>\n\t\t\t<span class=\"screen-reader-text\"><?php echo $input['label']; ?></span>\n\t\t</label>\n\t<?php endforeach; ?>\n\t</div>\n<?php endforeach; ?>\n</div>\n</fieldset></td>\n</tr>\n\n<tr>\n<th scope=\"row\"><label for=\"background-size\"><?php _e( 'Image Size' ); ?></label></th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Image Size' ); ?></span></legend>\n<select id=\"background-size\" name=\"background-size\">\n<option value=\"auto\"<?php selected( 'auto', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _ex( 'Original', 'Original Size' ); ?></option>\n<option value=\"contain\"<?php selected( 'contain', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _e( 'Fit to Screen' ); ?></option>\n<option value=\"cover\"<?php selected( 'cover', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _e( 'Fill Screen' ); ?></option>\n</select>\n</fieldset></td>\n</tr>\n\n<tr>\n<th scope=\"row\"><?php _ex( 'Repeat', 'Background Repeat' ); ?></th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _ex( 'Repeat', 'Background Repeat' ); ?></span></legend>\n<input name=\"background-repeat\" type=\"hidden\" value=\"no-repeat\">\n<label><input type=\"checkbox\" name=\"background-repeat\" value=\"repeat\"<?php checked( 'repeat', get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) ); ?>> <?php _e( 'Repeat Background Image' ); ?></label>\n</fieldset></td>\n</tr>\n\n<tr>\n<th scope=\"row\"><?php _ex( 'Scroll', 'Background Scroll' ); ?></th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _ex( 'Scroll', 'Background Scroll' ); ?></span></legend>\n<input name=\"background-attachment\" type=\"hidden\" value=\"fixed\">\n<label><input name=\"background-attachment\" type=\"checkbox\" value=\"scroll\" <?php checked( 'scroll', get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) ) ); ?>> <?php _e( 'Scroll with Page' ); ?></label>\n</fieldset></td>\n</tr>\n<?php endif; // get_background_image() ?>\n<tr>\n<th scope=\"row\"><?php _e( 'Background Color' ); ?></th>\n<td><fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Background Color' ); ?></span></legend>\n\t\t<?php\n\t\t$default_color = '';\n\t\tif ( current_theme_supports( 'custom-background', 'default-color' ) ) {\n\t\t\t$default_color = ' data-default-color=\"#' . esc_attr( get_theme_support( 'custom-background', 'default-color' ) ) . '\"';\n\t\t}\n\t\t?>\n<input type=\"text\" name=\"background-color\" id=\"background-color\" value=\"#<?php echo esc_attr( get_background_color() ); ?>\"<?php echo $default_color; ?>>\n</fieldset></td>\n</tr>\n</tbody>\n</table>\n\n\t\t<?php wp_nonce_field( 'custom-background' ); ?>\n\t\t<?php submit_button( null, 'primary', 'save-background-options' ); ?>\n</form>\n\n</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Handle an Image upload for the background image.\n\t *\n\t * @since 3.0.0\n\t */\n\tpublic function handle_upload() {\n\t\tif ( empty( $_FILES ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcheck_admin_referer( 'custom-background-upload', '_wpnonce-custom-background-upload' );\n\t\t$overrides = array( 'test_form' => false );\n\n\t\t$uploaded_file = $_FILES['import'];\n\t\t$wp_filetype   = wp_check_filetype_and_ext( $uploaded_file['tmp_name'], $uploaded_file['name'] );\n\t\tif ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) {\n\t\t\twp_die( __( 'The uploaded file is not a valid image. Please try again.' ) );\n\t\t}\n\n\t\t$file = wp_handle_upload( $uploaded_file, $overrides );\n\n\t\tif ( isset( $file['error'] ) ) {\n\t\t\twp_die( $file['error'] );\n\t\t}\n\n\t\t$url      = $file['url'];\n\t\t$type     = $file['type'];\n\t\t$file     = $file['file'];\n\t\t$filename = wp_basename( $file );\n\n\t\t// Construct the object array.\n\t\t$object = array(\n\t\t\t'post_title'     => $filename,\n\t\t\t'post_content'   => $url,\n\t\t\t'post_mime_type' => $type,\n\t\t\t'guid'           => $url,\n\t\t\t'context'        => 'custom-background',\n\t\t);\n\n\t\t// Save the data.\n\t\t$id = wp_insert_attachment( $object, $file );\n\n\t\t// Add the metadata.\n\t\twp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );\n\t\tupdate_post_meta( $id, '_wp_attachment_is_custom_background', get_option( 'stylesheet' ) );\n\n\t\tset_theme_mod( 'background_image', esc_url_raw( $url ) );\n\n\t\t$thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' );\n\t\tset_theme_mod( 'background_image_thumb', esc_url_raw( $thumbnail[0] ) );\n\n\t\t/** This action is documented in wp-admin/includes/class-custom-image-header.php */\n\t\tdo_action( 'wp_create_file_in_uploads', $file, $id ); // For replication.\n\t\t$this->updated = true;\n\t}\n\n\t/**\n\t * Ajax handler for adding custom background context to an attachment.\n\t *\n\t * Triggers when the user adds a new background image from the\n\t * Media Manager.\n\t *\n\t * @since 4.1.0\n\t */\n\tpublic function ajax_background_add() {\n\t\tcheck_ajax_referer( 'background-add', 'nonce' );\n\n\t\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t\t$attachment_id = absint( $_POST['attachment_id'] );\n\t\tif ( $attachment_id < 1 ) {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t\tupdate_post_meta( $attachment_id, '_wp_attachment_is_custom_background', get_stylesheet() );\n\n\t\twp_send_json_success();\n\t}\n\n\t/**\n\t * @since 3.4.0\n\t * @deprecated 3.5.0\n\t *\n\t * @param array $form_fields\n\t * @return array $form_fields\n\t */\n\tpublic function attachment_fields_to_edit( $form_fields ) {\n\t\treturn $form_fields;\n\t}\n\n\t/**\n\t * @since 3.4.0\n\t * @deprecated 3.5.0\n\t *\n\t * @param array $tabs\n\t * @return array $tabs\n\t */\n\tpublic function filter_upload_tabs( $tabs ) {\n\t\treturn $tabs;\n\t}\n\n\t/**\n\t * @since 3.4.0\n\t * @deprecated 3.5.0\n\t */\n\tpublic function wp_set_background_image() {\n\t\tcheck_ajax_referer( 'custom-background' );\n\n\t\tif ( ! current_user_can( 'edit_theme_options' ) || ! isset( $_POST['attachment_id'] ) ) {\n\t\t\texit;\n\t\t}\n\n\t\t$attachment_id = absint( $_POST['attachment_id'] );\n\n\t\t$sizes = array_keys(\n\t\t\t/** This filter is documented in wp-admin/includes/media.php */\n\t\t\tapply_filters(\n\t\t\t\t'image_size_names_choose',\n\t\t\t\tarray(\n\t\t\t\t\t'thumbnail' => __( 'Thumbnail' ),\n\t\t\t\t\t'medium'    => __( 'Medium' ),\n\t\t\t\t\t'large'     => __( 'Large' ),\n\t\t\t\t\t'full'      => __( 'Full Size' ),\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$size = 'thumbnail';\n\t\tif ( in_array( $_POST['size'], $sizes, true ) ) {\n\t\t\t$size = esc_attr( $_POST['size'] );\n\t\t}\n\n\t\tupdate_post_meta( $attachment_id, '_wp_attachment_is_custom_background', get_option( 'stylesheet' ) );\n\n\t\t$url       = wp_get_attachment_image_src( $attachment_id, $size );\n\t\t$thumbnail = wp_get_attachment_image_src( $attachment_id, 'thumbnail' );\n\t\tset_theme_mod( 'background_image', esc_url_raw( $url[0] ) );\n\t\tset_theme_mod( 'background_image_thumb', esc_url_raw( $thumbnail[0] ) );\n\t\texit;\n\t}\n}\n", "num_lines": 619}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The custom header image script.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * The custom header image class.\n *\n * @since 2.1.0\n */\nclass Custom_Image_Header {\n\n\t/**\n\t * Callback for administration header.\n\t *\n\t * @var callable\n\t * @since 2.1.0\n\t */\n\tpublic $admin_header_callback;\n\n\t/**\n\t * Callback for header div.\n\t *\n\t * @var callable\n\t * @since 3.0.0\n\t */\n\tpublic $admin_image_div_callback;\n\n\t/**\n\t * Holds default headers.\n\t *\n\t * @var array\n\t * @since 3.0.0\n\t */\n\tpublic $default_headers = array();\n\n\t/**\n\t * Used to trigger a success message when settings updated and set to true.\n\t *\n\t * @since 3.0.0\n\t * @var bool\n\t */\n\tprivate $updated;\n\n\t/**\n\t * Constructor - Register administration header callback.\n\t *\n\t * @since 2.1.0\n\t * @param callable $admin_header_callback\n\t * @param callable $admin_image_div_callback Optional custom image div output callback.\n\t */\n\tpublic function __construct( $admin_header_callback, $admin_image_div_callback = '' ) {\n\t\t$this->admin_header_callback    = $admin_header_callback;\n\t\t$this->admin_image_div_callback = $admin_image_div_callback;\n\n\t\tadd_action( 'admin_menu', array( $this, 'init' ) );\n\n\t\tadd_action( 'customize_save_after', array( $this, 'customize_set_last_used' ) );\n\t\tadd_action( 'wp_ajax_custom-header-crop', array( $this, 'ajax_header_crop' ) );\n\t\tadd_action( 'wp_ajax_custom-header-add', array( $this, 'ajax_header_add' ) );\n\t\tadd_action( 'wp_ajax_custom-header-remove', array( $this, 'ajax_header_remove' ) );\n\t}\n\n\t/**\n\t * Set up the hooks for the Custom Header admin page.\n\t *\n\t * @since 2.1.0\n\t */\n\tpublic function init() {\n\t\t$page = add_theme_page( __( 'Header' ), __( 'Header' ), 'edit_theme_options', 'custom-header', array( $this, 'admin_page' ) );\n\t\tif ( ! $page ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_action( \"admin_print_scripts-{$page}\", array( $this, 'js_includes' ) );\n\t\tadd_action( \"admin_print_styles-{$page}\", array( $this, 'css_includes' ) );\n\t\tadd_action( \"admin_head-{$page}\", array( $this, 'help' ) );\n\t\tadd_action( \"admin_head-{$page}\", array( $this, 'take_action' ), 50 );\n\t\tadd_action( \"admin_head-{$page}\", array( $this, 'js' ), 50 );\n\t\tif ( $this->admin_header_callback ) {\n\t\t\tadd_action( \"admin_head-{$page}\", $this->admin_header_callback, 51 );\n\t\t}\n\t}\n\n\t/**\n\t * Adds contextual help.\n\t *\n\t * @since 3.0.0\n\t */\n\tpublic function help() {\n\t\tget_current_screen()->add_help_tab(\n\t\t\tarray(\n\t\t\t\t'id'      => 'overview',\n\t\t\t\t'title'   => __( 'Overview' ),\n\t\t\t\t'content' =>\n\t\t\t\t\t'<p>' . __( 'This screen is used to customize the header section of your theme.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'You can choose from the theme&#8217;s default header images, or use one of your own. You can also customize how your Site Title and Tagline are displayed.' ) . '<p>',\n\t\t\t)\n\t\t);\n\n\t\tget_current_screen()->add_help_tab(\n\t\t\tarray(\n\t\t\t\t'id'      => 'set-header-image',\n\t\t\t\t'title'   => __( 'Header Image' ),\n\t\t\t\t'content' =>\n\t\t\t\t\t'<p>' . __( 'You can set a custom image header for your site. Simply upload the image and crop it, and the new header will go live immediately. Alternatively, you can use an image that has already been uploaded to your Media Library by clicking the &#8220;Choose Image&#8221; button.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'Some themes come with additional header images bundled. If you see multiple images displayed, select the one you&#8217;d like and click the &#8220;Save Changes&#8221; button.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'If your theme has more than one default header image, or you have uploaded more than one custom header image, you have the option of having WordPress display a randomly different image on each page of your site. Click the &#8220;Random&#8221; radio button next to the Uploaded Images or Default Images section to enable this feature.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'If you don&#8217;t want a header image to be displayed on your site at all, click the &#8220;Remove Header Image&#8221; button at the bottom of the Header Image section of this page. If you want to re-enable the header image later, you just have to select one of the other image options and click &#8220;Save Changes&#8221;.' ) . '</p>',\n\t\t\t)\n\t\t);\n\n\t\tget_current_screen()->add_help_tab(\n\t\t\tarray(\n\t\t\t\t'id'      => 'set-header-text',\n\t\t\t\t'title'   => __( 'Header Text' ),\n\t\t\t\t'content' =>\n\t\t\t\t\t'<p>' . sprintf(\n\t\t\t\t\t\t/* translators: %s: URL to General Settings screen. */\n\t\t\t\t\t\t__( 'For most themes, the header text is your Site Title and Tagline, as defined in the <a href=\"%s\">General Settings</a> section.' ),\n\t\t\t\t\t\tadmin_url( 'options-general.php' )\n\t\t\t\t\t) .\n\t\t\t\t\t'</p>' .\n\t\t\t\t\t'<p>' . __( 'In the Header Text section of this page, you can choose whether to display this text or hide it. You can also choose a color for the text by clicking the Select Color button and either typing in a legitimate HTML hex value, e.g. &#8220;#ff0000&#8221; for red, or by choosing a color using the color picker.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'Don&#8217;t forget to click &#8220;Save Changes&#8221; when you&#8217;re done!' ) . '</p>',\n\t\t\t)\n\t\t);\n\n\t\tget_current_screen()->set_help_sidebar(\n\t\t\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t\t\t'<p>' . __( '<a href=\"https://codex.wordpress.org/Appearance_Header_Screen\">Documentation on Custom Header</a>' ) . '</p>' .\n\t\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n\t\t);\n\t}\n\n\t/**\n\t * Get the current step.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @return int Current step\n\t */\n\tpublic function step() {\n\t\tif ( ! isset( $_GET['step'] ) ) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t$step = (int) $_GET['step'];\n\t\tif ( $step < 1 || 3 < $step ||\n\t\t\t( 2 == $step && ! wp_verify_nonce( $_REQUEST['_wpnonce-custom-header-upload'], 'custom-header-upload' ) ) ||\n\t\t\t( 3 == $step && ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'custom-header-crop-image' ) )\n\t\t) {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn $step;\n\t}\n\n\t/**\n\t * Set up the enqueue for the JavaScript files.\n\t *\n\t * @since 2.1.0\n\t */\n\tpublic function js_includes() {\n\t\t$step = $this->step();\n\n\t\tif ( ( 1 == $step || 3 == $step ) ) {\n\t\t\twp_enqueue_media();\n\t\t\twp_enqueue_script( 'custom-header' );\n\t\t\tif ( current_theme_supports( 'custom-header', 'header-text' ) ) {\n\t\t\t\twp_enqueue_script( 'wp-color-picker' );\n\t\t\t}\n\t\t} elseif ( 2 == $step ) {\n\t\t\twp_enqueue_script( 'imgareaselect' );\n\t\t}\n\t}\n\n\t/**\n\t * Set up the enqueue for the CSS files\n\t *\n\t * @since 2.7.0\n\t */\n\tpublic function css_includes() {\n\t\t$step = $this->step();\n\n\t\tif ( ( 1 == $step || 3 == $step ) && current_theme_supports( 'custom-header', 'header-text' ) ) {\n\t\t\twp_enqueue_style( 'wp-color-picker' );\n\t\t} elseif ( 2 == $step ) {\n\t\t\twp_enqueue_style( 'imgareaselect' );\n\t\t}\n\t}\n\n\t/**\n\t * Execute custom header modification.\n\t *\n\t * @since 2.6.0\n\t */\n\tpublic function take_action() {\n\t\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( empty( $_POST ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->updated = true;\n\n\t\tif ( isset( $_POST['resetheader'] ) ) {\n\t\t\tcheck_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );\n\t\t\t$this->reset_header_image();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( $_POST['removeheader'] ) ) {\n\t\t\tcheck_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );\n\t\t\t$this->remove_header_image();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( $_POST['text-color'] ) && ! isset( $_POST['display-header-text'] ) ) {\n\t\t\tcheck_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );\n\t\t\tset_theme_mod( 'header_textcolor', 'blank' );\n\t\t} elseif ( isset( $_POST['text-color'] ) ) {\n\t\t\tcheck_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );\n\t\t\t$_POST['text-color'] = str_replace( '#', '', $_POST['text-color'] );\n\t\t\t$color               = preg_replace( '/[^0-9a-fA-F]/', '', $_POST['text-color'] );\n\t\t\tif ( strlen( $color ) == 6 || strlen( $color ) == 3 ) {\n\t\t\t\tset_theme_mod( 'header_textcolor', $color );\n\t\t\t} elseif ( ! $color ) {\n\t\t\t\tset_theme_mod( 'header_textcolor', 'blank' );\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $_POST['default-header'] ) ) {\n\t\t\tcheck_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );\n\t\t\t$this->set_header_image( $_POST['default-header'] );\n\t\t\treturn;\n\t\t}\n\t}\n\n\t/**\n\t * Process the default headers\n\t *\n\t * @since 3.0.0\n\t *\n\t * @global array $_wp_default_headers\n\t */\n\tpublic function process_default_headers() {\n\t\tglobal $_wp_default_headers;\n\n\t\tif ( ! isset( $_wp_default_headers ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! empty( $this->default_headers ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->default_headers    = $_wp_default_headers;\n\t\t$template_directory_uri   = get_template_directory_uri();\n\t\t$stylesheet_directory_uri = get_stylesheet_directory_uri();\n\t\tforeach ( array_keys( $this->default_headers ) as $header ) {\n\t\t\t$this->default_headers[ $header ]['url']           = sprintf( $this->default_headers[ $header ]['url'], $template_directory_uri, $stylesheet_directory_uri );\n\t\t\t$this->default_headers[ $header ]['thumbnail_url'] = sprintf( $this->default_headers[ $header ]['thumbnail_url'], $template_directory_uri, $stylesheet_directory_uri );\n\t\t}\n\t}\n\n\t/**\n\t * Display UI for selecting one of several default headers.\n\t *\n\t * Show the random image option if this theme has multiple header images.\n\t * Random image option is on by default if no header has been set.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $type The header type. One of 'default' (for the Uploaded Images control)\n\t *                     or 'uploaded' (for the Uploaded Images control).\n\t */\n\tpublic function show_header_selector( $type = 'default' ) {\n\t\tif ( 'default' === $type ) {\n\t\t\t$headers = $this->default_headers;\n\t\t} else {\n\t\t\t$headers = get_uploaded_header_images();\n\t\t\t$type    = 'uploaded';\n\t\t}\n\n\t\tif ( 1 < count( $headers ) ) {\n\t\t\techo '<div class=\"random-header\">';\n\t\t\techo '<label><input name=\"default-header\" type=\"radio\" value=\"random-' . $type . '-image\"' . checked( is_random_header_image( $type ), true, false ) . ' />';\n\t\t\t_e( '<strong>Random:</strong> Show a different image on each page.' );\n\t\t\techo '</label>';\n\t\t\techo '</div>';\n\t\t}\n\n\t\techo '<div class=\"available-headers\">';\n\t\tforeach ( $headers as $header_key => $header ) {\n\t\t\t$header_thumbnail = $header['thumbnail_url'];\n\t\t\t$header_url       = $header['url'];\n\t\t\t$header_alt_text  = empty( $header['alt_text'] ) ? '' : $header['alt_text'];\n\t\t\techo '<div class=\"default-header\">';\n\t\t\techo '<label><input name=\"default-header\" type=\"radio\" value=\"' . esc_attr( $header_key ) . '\" ' . checked( $header_url, get_theme_mod( 'header_image' ), false ) . ' />';\n\t\t\t$width = '';\n\t\t\tif ( ! empty( $header['attachment_id'] ) ) {\n\t\t\t\t$width = ' width=\"230\"';\n\t\t\t}\n\t\t\techo '<img src=\"' . set_url_scheme( $header_thumbnail ) . '\" alt=\"' . esc_attr( $header_alt_text ) . '\"' . $width . ' /></label>';\n\t\t\techo '</div>';\n\t\t}\n\t\techo '<div class=\"clear\"></div></div>';\n\t}\n\n\t/**\n\t * Execute JavaScript depending on step.\n\t *\n\t * @since 2.1.0\n\t */\n\tpublic function js() {\n\t\t$step = $this->step();\n\t\tif ( ( 1 == $step || 3 == $step ) && current_theme_supports( 'custom-header', 'header-text' ) ) {\n\t\t\t$this->js_1();\n\t\t} elseif ( 2 == $step ) {\n\t\t\t$this->js_2();\n\t\t}\n\t}\n\n\t/**\n\t * Display JavaScript based on Step 1 and 3.\n\t *\n\t * @since 2.6.0\n\t */\n\tpublic function js_1() {\n\t\t$default_color = '';\n\t\tif ( current_theme_supports( 'custom-header', 'default-text-color' ) ) {\n\t\t\t$default_color = get_theme_support( 'custom-header', 'default-text-color' );\n\t\t\tif ( $default_color && false === strpos( $default_color, '#' ) ) {\n\t\t\t\t$default_color = '#' . $default_color;\n\t\t\t}\n\t\t}\n\t\t?>\n<script type=\"text/javascript\">\n(function($){\n\tvar default_color = '<?php echo esc_js( $default_color ); ?>',\n\t\theader_text_fields;\n\n\tfunction pickColor(color) {\n\t\t$('#name').css('color', color);\n\t\t$('#desc').css('color', color);\n\t\t$('#text-color').val(color);\n\t}\n\n\tfunction toggle_text() {\n\t\tvar checked = $('#display-header-text').prop('checked'),\n\t\t\ttext_color;\n\t\theader_text_fields.toggle( checked );\n\t\tif ( ! checked )\n\t\t\treturn;\n\t\ttext_color = $('#text-color');\n\t\tif ( '' === text_color.val().replace('#', '') ) {\n\t\t\ttext_color.val( default_color );\n\t\t\tpickColor( default_color );\n\t\t} else {\n\t\t\tpickColor( text_color.val() );\n\t\t}\n\t}\n\n\t$(document).ready(function() {\n\t\tvar text_color = $('#text-color');\n\t\theader_text_fields = $('.displaying-header-text');\n\t\ttext_color.wpColorPicker({\n\t\t\tchange: function( event, ui ) {\n\t\t\t\tpickColor( text_color.wpColorPicker('color') );\n\t\t\t},\n\t\t\tclear: function() {\n\t\t\t\tpickColor( '' );\n\t\t\t}\n\t\t});\n\t\t$('#display-header-text').click( toggle_text );\n\t\t<?php if ( ! display_header_text() ) : ?>\n\t\ttoggle_text();\n\t\t<?php endif; ?>\n\t});\n})(jQuery);\n</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * Display JavaScript based on Step 2.\n\t *\n\t * @since 2.6.0\n\t */\n\tpublic function js_2() {\n\n\t\t?>\n<script type=\"text/javascript\">\n\tfunction onEndCrop( coords ) {\n\t\tjQuery( '#x1' ).val(coords.x);\n\t\tjQuery( '#y1' ).val(coords.y);\n\t\tjQuery( '#width' ).val(coords.w);\n\t\tjQuery( '#height' ).val(coords.h);\n\t}\n\n\tjQuery(document).ready(function() {\n\t\tvar xinit = <?php echo absint( get_theme_support( 'custom-header', 'width' ) ); ?>;\n\t\tvar yinit = <?php echo absint( get_theme_support( 'custom-header', 'height' ) ); ?>;\n\t\tvar ratio = xinit / yinit;\n\t\tvar ximg = jQuery('img#upload').width();\n\t\tvar yimg = jQuery('img#upload').height();\n\n\t\tif ( yimg < yinit || ximg < xinit ) {\n\t\t\tif ( ximg / yimg > ratio ) {\n\t\t\t\tyinit = yimg;\n\t\t\t\txinit = yinit * ratio;\n\t\t\t} else {\n\t\t\t\txinit = ximg;\n\t\t\t\tyinit = xinit / ratio;\n\t\t\t}\n\t\t}\n\n\t\tjQuery('img#upload').imgAreaSelect({\n\t\t\thandles: true,\n\t\t\tkeys: true,\n\t\t\tshow: true,\n\t\t\tx1: 0,\n\t\t\ty1: 0,\n\t\t\tx2: xinit,\n\t\t\ty2: yinit,\n\t\t\t<?php\n\t\t\tif ( ! current_theme_supports( 'custom-header', 'flex-height' ) && ! current_theme_supports( 'custom-header', 'flex-width' ) ) {\n\t\t\t\t?>\n\t\t\taspectRatio: xinit + ':' + yinit,\n\t\t\t\t<?php\n\t\t\t}\n\t\t\tif ( ! current_theme_supports( 'custom-header', 'flex-height' ) ) {\n\t\t\t\t?>\n\t\t\tmaxHeight: <?php echo get_theme_support( 'custom-header', 'height' ); ?>,\n\t\t\t\t<?php\n\t\t\t}\n\t\t\tif ( ! current_theme_supports( 'custom-header', 'flex-width' ) ) {\n\t\t\t\t?>\n\t\t\tmaxWidth: <?php echo get_theme_support( 'custom-header', 'width' ); ?>,\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t\tonInit: function () {\n\t\t\t\tjQuery('#width').val(xinit);\n\t\t\t\tjQuery('#height').val(yinit);\n\t\t\t},\n\t\t\tonSelectChange: function(img, c) {\n\t\t\t\tjQuery('#x1').val(c.x1);\n\t\t\t\tjQuery('#y1').val(c.y1);\n\t\t\t\tjQuery('#width').val(c.width);\n\t\t\t\tjQuery('#height').val(c.height);\n\t\t\t}\n\t\t});\n\t});\n</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * Display first step of custom header image page.\n\t *\n\t * @since 2.1.0\n\t */\n\tpublic function step_1() {\n\t\t$this->process_default_headers();\n\t\t?>\n\n<div class=\"wrap\">\n<h1><?php _e( 'Custom Header' ); ?></h1>\n\n\t\t<?php if ( current_user_can( 'customize' ) ) { ?>\n<div class=\"notice notice-info hide-if-no-customize\">\n\t<p>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: URL to header image configuration in Customizer. */\n\t\t\t\t__( 'You can now manage and live-preview Custom Header in the <a href=\"%s\">Customizer</a>.' ),\n\t\t\t\tadmin_url( 'customize.php?autofocus[control]=header_image' )\n\t\t\t);\n\t\t\t?>\n\t</p>\n</div>\n\t\t<?php } ?>\n\n\t\t<?php if ( ! empty( $this->updated ) ) { ?>\n<div id=\"message\" class=\"updated\">\n\t<p>\n\t\t\t<?php\n\t\t\t/* translators: %s: Home URL. */\n\t\t\tprintf( __( 'Header updated. <a href=\"%s\">Visit your site</a> to see how it looks.' ), home_url( '/' ) );\n\t\t\t?>\n\t</p>\n</div>\n\t\t<?php } ?>\n\n<h2><?php _e( 'Header Image' ); ?></h2>\n\n<table class=\"form-table\" role=\"presentation\">\n<tbody>\n\n\t\t<?php if ( get_custom_header() || display_header_text() ) : ?>\n<tr>\n<th scope=\"row\"><?php _e( 'Preview' ); ?></th>\n<td>\n\t\t\t<?php\n\t\t\tif ( $this->admin_image_div_callback ) {\n\t\t\t\tcall_user_func( $this->admin_image_div_callback );\n\t\t\t} else {\n\t\t\t\t$custom_header = get_custom_header();\n\t\t\t\t$header_image  = get_header_image();\n\n\t\t\t\tif ( $header_image ) {\n\t\t\t\t\t$header_image_style = 'background-image:url(' . esc_url( $header_image ) . ');';\n\t\t\t\t} else {\n\t\t\t\t\t$header_image_style = '';\n\t\t\t\t}\n\n\t\t\t\tif ( $custom_header->width ) {\n\t\t\t\t\t$header_image_style .= 'max-width:' . $custom_header->width . 'px;';\n\t\t\t\t}\n\t\t\t\tif ( $custom_header->height ) {\n\t\t\t\t\t$header_image_style .= 'height:' . $custom_header->height . 'px;';\n\t\t\t\t}\n\t\t\t\t?>\n\t<div id=\"headimg\" style=\"<?php echo $header_image_style; ?>\">\n\t\t\t\t<?php\n\t\t\t\tif ( display_header_text() ) {\n\t\t\t\t\t$style = ' style=\"color:#' . get_header_textcolor() . ';\"';\n\t\t\t\t} else {\n\t\t\t\t\t$style = ' style=\"display:none;\"';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t<h1><a id=\"name\" class=\"displaying-header-text\" <?php echo $style; ?> onclick=\"return false;\" href=\"<?php bloginfo( 'url' ); ?>\" tabindex=\"-1\"><?php bloginfo( 'name' ); ?></a></h1>\n\t\t<div id=\"desc\" class=\"displaying-header-text\" <?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>\n\t</div>\n\t\t\t<?php } ?>\n</td>\n</tr>\n\t\t<?php endif; ?>\n\n\t\t<?php if ( current_user_can( 'upload_files' ) && current_theme_supports( 'custom-header', 'uploads' ) ) : ?>\n<tr>\n<th scope=\"row\"><?php _e( 'Select Image' ); ?></th>\n<td>\n\t<p><?php _e( 'You can select an image to be shown at the top of your site by uploading from your computer or choosing from your media library. After selecting an image you will be able to crop it.' ); ?><br />\n\t\t\t<?php\n\t\t\tif ( ! current_theme_supports( 'custom-header', 'flex-height' ) && ! current_theme_supports( 'custom-header', 'flex-width' ) ) {\n\t\t\t\t/* translators: 1: Image width in pixels, 2: Image height in pixels. */\n\t\t\t\tprintf( __( 'Images of exactly <strong>%1$d &times; %2$d pixels</strong> will be used as-is.' ) . '<br />', get_theme_support( 'custom-header', 'width' ), get_theme_support( 'custom-header', 'height' ) );\n\t\t\t} elseif ( current_theme_supports( 'custom-header', 'flex-height' ) ) {\n\t\t\t\tif ( ! current_theme_supports( 'custom-header', 'flex-width' ) ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Size in pixels. */\n\t\t\t\t\t\t__( 'Images should be at least %s wide.' ) . ' ',\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: Custom header width. */\n\t\t\t\t\t\t\t'<strong>' . __( '%d pixels' ) . '</strong>',\n\t\t\t\t\t\t\tget_theme_support( 'custom-header', 'width' )\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} elseif ( current_theme_supports( 'custom-header', 'flex-width' ) ) {\n\t\t\t\tif ( ! current_theme_supports( 'custom-header', 'flex-height' ) ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Size in pixels. */\n\t\t\t\t\t\t__( 'Images should be at least %s tall.' ) . ' ',\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: Custom header height. */\n\t\t\t\t\t\t\t'<strong>' . __( '%d pixels' ) . '</strong>',\n\t\t\t\t\t\t\tget_theme_support( 'custom-header', 'height' )\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) {\n\t\t\t\tif ( current_theme_supports( 'custom-header', 'width' ) ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Size in pixels. */\n\t\t\t\t\t\t__( 'Suggested width is %s.' ) . ' ',\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: Custom header width. */\n\t\t\t\t\t\t\t'<strong>' . __( '%d pixels' ) . '</strong>',\n\t\t\t\t\t\t\tget_theme_support( 'custom-header', 'width' )\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif ( current_theme_supports( 'custom-header', 'height' ) ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Size in pixels. */\n\t\t\t\t\t\t__( 'Suggested height is %s.' ) . ' ',\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: Custom header height. */\n\t\t\t\t\t\t\t'<strong>' . __( '%d pixels' ) . '</strong>',\n\t\t\t\t\t\t\tget_theme_support( 'custom-header', 'height' )\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t?>\n\t</p>\n\t<form enctype=\"multipart/form-data\" id=\"upload-form\" class=\"wp-upload-form\" method=\"post\" action=\"<?php echo esc_url( add_query_arg( 'step', 2 ) ); ?>\">\n\t<p>\n\t\t<label for=\"upload\"><?php _e( 'Choose an image from your computer:' ); ?></label><br />\n\t\t<input type=\"file\" id=\"upload\" name=\"import\" />\n\t\t<input type=\"hidden\" name=\"action\" value=\"save\" />\n\t\t\t<?php wp_nonce_field( 'custom-header-upload', '_wpnonce-custom-header-upload' ); ?>\n\t\t\t<?php submit_button( __( 'Upload' ), '', 'submit', false ); ?>\n\t</p>\n\t\t\t<?php\n\t\t\t\t$modal_update_href = esc_url(\n\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'page' => 'custom-header',\n\t\t\t\t\t\t\t'step' => 2,\n\t\t\t\t\t\t\t'_wpnonce-custom-header-upload' => wp_create_nonce( 'custom-header-upload' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tadmin_url( 'themes.php' )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t?>\n\t<p>\n\t\t<label for=\"choose-from-library-link\"><?php _e( 'Or choose an image from your media library:' ); ?></label><br />\n\t\t<button id=\"choose-from-library-link\" class=\"button\"\n\t\t\tdata-update-link=\"<?php echo esc_attr( $modal_update_href ); ?>\"\n\t\t\tdata-choose=\"<?php esc_attr_e( 'Choose a Custom Header' ); ?>\"\n\t\t\tdata-update=\"<?php esc_attr_e( 'Set as header' ); ?>\"><?php _e( 'Choose Image' ); ?></button>\n\t</p>\n\t</form>\n</td>\n</tr>\n\t\t<?php endif; ?>\n</tbody>\n</table>\n\n<form method=\"post\" action=\"<?php echo esc_url( add_query_arg( 'step', 1 ) ); ?>\">\n\t\t<?php submit_button( null, 'screen-reader-text', 'save-header-options', false ); ?>\n<table class=\"form-table\" role=\"presentation\">\n<tbody>\n\t\t<?php if ( get_uploaded_header_images() ) : ?>\n<tr>\n<th scope=\"row\"><?php _e( 'Uploaded Images' ); ?></th>\n<td>\n\t<p><?php _e( 'You can choose one of your previously uploaded headers, or show a random one.' ); ?></p>\n\t\t\t<?php\n\t\t\t$this->show_header_selector( 'uploaded' );\n\t\t\t?>\n</td>\n</tr>\n\t\t\t<?php\n\tendif;\n\t\tif ( ! empty( $this->default_headers ) ) :\n\t\t\t?>\n<tr>\n<th scope=\"row\"><?php _e( 'Default Images' ); ?></th>\n<td>\n\t\t\t<?php if ( current_theme_supports( 'custom-header', 'uploads' ) ) : ?>\n\t<p><?php _e( 'If you don&lsquo;t want to upload your own image, you can use one of these cool headers, or show a random one.' ); ?></p>\n\t<?php else : ?>\n\t<p><?php _e( 'You can use one of these cool headers or show a random one on each page.' ); ?></p>\n\t<?php endif; ?>\n\t\t\t<?php\n\t\t\t$this->show_header_selector( 'default' );\n\t\t\t?>\n</td>\n</tr>\n\t\t\t<?php\n\tendif;\n\t\tif ( get_header_image() ) :\n\t\t\t?>\n<tr>\n<th scope=\"row\"><?php _e( 'Remove Image' ); ?></th>\n<td>\n\t<p><?php _e( 'This will remove the header image. You will not be able to restore any customizations.' ); ?></p>\n\t\t\t<?php submit_button( __( 'Remove Header Image' ), '', 'removeheader', false ); ?>\n</td>\n</tr>\n\t\t\t<?php\n\tendif;\n\n\t\t$default_image = sprintf( get_theme_support( 'custom-header', 'default-image' ), get_template_directory_uri(), get_stylesheet_directory_uri() );\n\t\tif ( $default_image && get_header_image() != $default_image ) :\n\t\t\t?>\n<tr>\n<th scope=\"row\"><?php _e( 'Reset Image' ); ?></th>\n<td>\n\t<p><?php _e( 'This will restore the original header image. You will not be able to restore any customizations.' ); ?></p>\n\t\t\t<?php submit_button( __( 'Restore Original Header Image' ), '', 'resetheader', false ); ?>\n</td>\n</tr>\n\t<?php endif; ?>\n</tbody>\n</table>\n\n\t\t<?php if ( current_theme_supports( 'custom-header', 'header-text' ) ) : ?>\n\n<h2><?php _e( 'Header Text' ); ?></h2>\n\n<table class=\"form-table\" role=\"presentation\">\n<tbody>\n<tr>\n<th scope=\"row\"><?php _e( 'Header Text' ); ?></th>\n<td>\n\t<p>\n\t<label><input type=\"checkbox\" name=\"display-header-text\" id=\"display-header-text\"<?php checked( display_header_text() ); ?> /> <?php _e( 'Show header text with your image.' ); ?></label>\n\t</p>\n</td>\n</tr>\n\n<tr class=\"displaying-header-text\">\n<th scope=\"row\"><?php _e( 'Text Color' ); ?></th>\n<td>\n\t<p>\n\t\t\t<?php\n\t\t\t$default_color = '';\n\t\t\tif ( current_theme_supports( 'custom-header', 'default-text-color' ) ) {\n\t\t\t\t$default_color = get_theme_support( 'custom-header', 'default-text-color' );\n\t\t\t\tif ( $default_color && false === strpos( $default_color, '#' ) ) {\n\t\t\t\t\t$default_color = '#' . $default_color;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$default_color_attr = $default_color ? ' data-default-color=\"' . esc_attr( $default_color ) . '\"' : '';\n\n\t\t\t$header_textcolor = display_header_text() ? get_header_textcolor() : get_theme_support( 'custom-header', 'default-text-color' );\n\t\t\tif ( $header_textcolor && false === strpos( $header_textcolor, '#' ) ) {\n\t\t\t\t$header_textcolor = '#' . $header_textcolor;\n\t\t\t}\n\n\t\t\techo '<input type=\"text\" name=\"text-color\" id=\"text-color\" value=\"' . esc_attr( $header_textcolor ) . '\"' . $default_color_attr . ' />';\n\t\t\tif ( $default_color ) {\n\t\t\t\t/* translators: %s: Default text color. */\n\t\t\t\techo ' <span class=\"description hide-if-js\">' . sprintf( _x( 'Default: %s', 'color' ), esc_html( $default_color ) ) . '</span>';\n\t\t\t}\n\t\t\t?>\n\t</p>\n</td>\n</tr>\n</tbody>\n</table>\n\t\t\t<?php\nendif;\n\n\t\t/**\n\t\t * Fires just before the submit button in the custom header options form.\n\t\t *\n\t\t * @since 3.1.0\n\t\t */\n\t\tdo_action( 'custom_header_options' );\n\n\t\twp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' );\n\t\t?>\n\n\t\t<?php submit_button( null, 'primary', 'save-header-options' ); ?>\n</form>\n</div>\n\n\t\t<?php\n\t}\n\n\t/**\n\t * Display second step of custom header image page.\n\t *\n\t * @since 2.1.0\n\t */\n\tpublic function step_2() {\n\t\tcheck_admin_referer( 'custom-header-upload', '_wpnonce-custom-header-upload' );\n\t\tif ( ! current_theme_supports( 'custom-header', 'uploads' ) ) {\n\t\t\twp_die(\n\t\t\t\t'<h1>' . __( 'Something went wrong.' ) . '</h1>' .\n\t\t\t\t'<p>' . __( 'The current theme does not support uploading a custom header image.' ) . '</p>',\n\t\t\t\t403\n\t\t\t);\n\t\t}\n\n\t\tif ( empty( $_POST ) && isset( $_GET['file'] ) ) {\n\t\t\t$attachment_id = absint( $_GET['file'] );\n\t\t\t$file          = get_attached_file( $attachment_id, true );\n\t\t\t$url           = wp_get_attachment_image_src( $attachment_id, 'full' );\n\t\t\t$url           = $url[0];\n\t\t} elseif ( isset( $_POST ) ) {\n\t\t\t$data          = $this->step_2_manage_upload();\n\t\t\t$attachment_id = $data['attachment_id'];\n\t\t\t$file          = $data['file'];\n\t\t\t$url           = $data['url'];\n\t\t}\n\n\t\tif ( file_exists( $file ) ) {\n\t\t\tlist( $width, $height, $type, $attr ) = @getimagesize( $file );\n\t\t} else {\n\t\t\t$data   = wp_get_attachment_metadata( $attachment_id );\n\t\t\t$height = isset( $data['height'] ) ? $data['height'] : 0;\n\t\t\t$width  = isset( $data['width'] ) ? $data['width'] : 0;\n\t\t\tunset( $data );\n\t\t}\n\n\t\t$max_width = 0;\n\t\t// For flex, limit size of image displayed to 1500px unless theme says otherwise.\n\t\tif ( current_theme_supports( 'custom-header', 'flex-width' ) ) {\n\t\t\t$max_width = 1500;\n\t\t}\n\n\t\tif ( current_theme_supports( 'custom-header', 'max-width' ) ) {\n\t\t\t$max_width = max( $max_width, get_theme_support( 'custom-header', 'max-width' ) );\n\t\t}\n\t\t$max_width = max( $max_width, get_theme_support( 'custom-header', 'width' ) );\n\n\t\t// If flexible height isn't supported and the image is the exact right size.\n\t\tif ( ! current_theme_supports( 'custom-header', 'flex-height' ) && ! current_theme_supports( 'custom-header', 'flex-width' )\n\t\t\t&& get_theme_support( 'custom-header', 'width' ) == $width && get_theme_support( 'custom-header', 'height' ) == $height ) {\n\t\t\t// Add the metadata.\n\t\t\tif ( file_exists( $file ) ) {\n\t\t\t\twp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) );\n\t\t\t}\n\n\t\t\t$this->set_header_image( compact( 'url', 'attachment_id', 'width', 'height' ) );\n\n\t\t\t/**\n\t\t\t * Fires after the header image is set or an error is returned.\n\t\t\t *\n\t\t\t * @since 2.1.0\n\t\t\t *\n\t\t\t * @param string $file          Path to the file.\n\t\t\t * @param int    $attachment_id Attachment ID.\n\t\t\t */\n\t\t\tdo_action( 'wp_create_file_in_uploads', $file, $attachment_id ); // For replication.\n\n\t\t\treturn $this->finished();\n\t\t} elseif ( $width > $max_width ) {\n\t\t\t$oitar = $width / $max_width;\n\t\t\t$image = wp_crop_image( $attachment_id, 0, 0, $width, $height, $max_width, $height / $oitar, false, str_replace( wp_basename( $file ), 'midsize-' . wp_basename( $file ), $file ) );\n\t\t\tif ( ! $image || is_wp_error( $image ) ) {\n\t\t\t\twp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );\n\t\t\t}\n\n\t\t\t/** This filter is documented in wp-admin/includes/class-custom-image-header.php */\n\t\t\t$image = apply_filters( 'wp_create_file_in_uploads', $image, $attachment_id ); // For replication.\n\n\t\t\t$url    = str_replace( wp_basename( $url ), wp_basename( $image ), $url );\n\t\t\t$width  = $width / $oitar;\n\t\t\t$height = $height / $oitar;\n\t\t} else {\n\t\t\t$oitar = 1;\n\t\t}\n\t\t?>\n\n<div class=\"wrap\">\n<h1><?php _e( 'Crop Header Image' ); ?></h1>\n\n<form method=\"post\" action=\"<?php echo esc_url( add_query_arg( 'step', 3 ) ); ?>\">\n\t<p class=\"hide-if-no-js\"><?php _e( 'Choose the part of the image you want to use as your header.' ); ?></p>\n\t<p class=\"hide-if-js\"><strong><?php _e( 'You need JavaScript to choose a part of the image.' ); ?></strong></p>\n\n\t<div id=\"crop_image\" style=\"position: relative\">\n\t\t<img src=\"<?php echo esc_url( $url ); ?>\" id=\"upload\" width=\"<?php echo $width; ?>\" height=\"<?php echo $height; ?>\" alt=\"\" />\n\t</div>\n\n\t<input type=\"hidden\" name=\"x1\" id=\"x1\" value=\"0\"/>\n\t<input type=\"hidden\" name=\"y1\" id=\"y1\" value=\"0\"/>\n\t<input type=\"hidden\" name=\"width\" id=\"width\" value=\"<?php echo esc_attr( $width ); ?>\"/>\n\t<input type=\"hidden\" name=\"height\" id=\"height\" value=\"<?php echo esc_attr( $height ); ?>\"/>\n\t<input type=\"hidden\" name=\"attachment_id\" id=\"attachment_id\" value=\"<?php echo esc_attr( $attachment_id ); ?>\" />\n\t<input type=\"hidden\" name=\"oitar\" id=\"oitar\" value=\"<?php echo esc_attr( $oitar ); ?>\" />\n\t\t<?php if ( empty( $_POST ) && isset( $_GET['file'] ) ) { ?>\n\t<input type=\"hidden\" name=\"create-new-attachment\" value=\"true\" />\n\t<?php } ?>\n\t\t<?php wp_nonce_field( 'custom-header-crop-image' ); ?>\n\n\t<p class=\"submit\">\n\t\t<?php submit_button( __( 'Crop and Publish' ), 'primary', 'submit', false ); ?>\n\t\t<?php\n\t\tif ( isset( $oitar ) && 1 == $oitar && ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) ) {\n\t\t\tsubmit_button( __( 'Skip Cropping, Publish Image as Is' ), '', 'skip-cropping', false );\n\t\t}\n\t\t?>\n\t</p>\n</form>\n</div>\n\t\t<?php\n\t}\n\n\n\t/**\n\t * Upload the file to be cropped in the second step.\n\t *\n\t * @since 3.4.0\n\t */\n\tpublic function step_2_manage_upload() {\n\t\t$overrides = array( 'test_form' => false );\n\n\t\t$uploaded_file = $_FILES['import'];\n\t\t$wp_filetype   = wp_check_filetype_and_ext( $uploaded_file['tmp_name'], $uploaded_file['name'] );\n\t\tif ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) {\n\t\t\twp_die( __( 'The uploaded file is not a valid image. Please try again.' ) );\n\t\t}\n\n\t\t$file = wp_handle_upload( $uploaded_file, $overrides );\n\n\t\tif ( isset( $file['error'] ) ) {\n\t\t\twp_die( $file['error'], __( 'Image Upload Error' ) );\n\t\t}\n\n\t\t$url      = $file['url'];\n\t\t$type     = $file['type'];\n\t\t$file     = $file['file'];\n\t\t$filename = wp_basename( $file );\n\n\t\t// Construct the object array.\n\t\t$object = array(\n\t\t\t'post_title'     => $filename,\n\t\t\t'post_content'   => $url,\n\t\t\t'post_mime_type' => $type,\n\t\t\t'guid'           => $url,\n\t\t\t'context'        => 'custom-header',\n\t\t);\n\n\t\t// Save the data.\n\t\t$attachment_id = wp_insert_attachment( $object, $file );\n\t\treturn compact( 'attachment_id', 'file', 'filename', 'url', 'type' );\n\t}\n\n\t/**\n\t * Display third step of custom header image page.\n\t *\n\t * @since 2.1.0\n\t * @since 4.4.0 Switched to using wp_get_attachment_url() instead of the guid\n\t *              for retrieving the header image URL.\n\t */\n\tpublic function step_3() {\n\t\tcheck_admin_referer( 'custom-header-crop-image' );\n\n\t\tif ( ! current_theme_supports( 'custom-header', 'uploads' ) ) {\n\t\t\twp_die(\n\t\t\t\t'<h1>' . __( 'Something went wrong.' ) . '</h1>' .\n\t\t\t\t'<p>' . __( 'The current theme does not support uploading a custom header image.' ) . '</p>',\n\t\t\t\t403\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $_POST['skip-cropping'] ) && ! ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) ) {\n\t\t\twp_die(\n\t\t\t\t'<h1>' . __( 'Something went wrong.' ) . '</h1>' .\n\t\t\t\t'<p>' . __( 'The current theme does not support a flexible sized header image.' ) . '</p>',\n\t\t\t\t403\n\t\t\t);\n\t\t}\n\n\t\tif ( $_POST['oitar'] > 1 ) {\n\t\t\t$_POST['x1']     = $_POST['x1'] * $_POST['oitar'];\n\t\t\t$_POST['y1']     = $_POST['y1'] * $_POST['oitar'];\n\t\t\t$_POST['width']  = $_POST['width'] * $_POST['oitar'];\n\t\t\t$_POST['height'] = $_POST['height'] * $_POST['oitar'];\n\t\t}\n\n\t\t$attachment_id = absint( $_POST['attachment_id'] );\n\t\t$original      = get_attached_file( $attachment_id );\n\n\t\t$dimensions = $this->get_header_dimensions(\n\t\t\tarray(\n\t\t\t\t'height' => $_POST['height'],\n\t\t\t\t'width'  => $_POST['width'],\n\t\t\t)\n\t\t);\n\t\t$height     = $dimensions['dst_height'];\n\t\t$width      = $dimensions['dst_width'];\n\n\t\tif ( empty( $_POST['skip-cropping'] ) ) {\n\t\t\t$cropped = wp_crop_image( $attachment_id, (int) $_POST['x1'], (int) $_POST['y1'], (int) $_POST['width'], (int) $_POST['height'], $width, $height );\n\t\t} elseif ( ! empty( $_POST['create-new-attachment'] ) ) {\n\t\t\t$cropped = _copy_image_file( $attachment_id );\n\t\t} else {\n\t\t\t$cropped = get_attached_file( $attachment_id );\n\t\t}\n\n\t\tif ( ! $cropped || is_wp_error( $cropped ) ) {\n\t\t\twp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );\n\t\t}\n\n\t\t/** This filter is documented in wp-admin/includes/class-custom-image-header.php */\n\t\t$cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.\n\n\t\t$object = $this->create_attachment_object( $cropped, $attachment_id );\n\n\t\tif ( ! empty( $_POST['create-new-attachment'] ) ) {\n\t\t\tunset( $object['ID'] );\n\t\t}\n\n\t\t// Update the attachment.\n\t\t$attachment_id = $this->insert_attachment( $object, $cropped );\n\n\t\t$url = wp_get_attachment_url( $attachment_id );\n\t\t$this->set_header_image( compact( 'url', 'attachment_id', 'width', 'height' ) );\n\n\t\t// Cleanup.\n\t\t$medium = str_replace( wp_basename( $original ), 'midsize-' . wp_basename( $original ), $original );\n\t\tif ( file_exists( $medium ) ) {\n\t\t\twp_delete_file( $medium );\n\t\t}\n\n\t\tif ( empty( $_POST['create-new-attachment'] ) && empty( $_POST['skip-cropping'] ) ) {\n\t\t\twp_delete_file( $original );\n\t\t}\n\n\t\treturn $this->finished();\n\t}\n\n\t/**\n\t * Display last step of custom header image page.\n\t *\n\t * @since 2.1.0\n\t */\n\tpublic function finished() {\n\t\t$this->updated = true;\n\t\t$this->step_1();\n\t}\n\n\t/**\n\t * Display the page based on the current step.\n\t *\n\t * @since 2.1.0\n\t */\n\tpublic function admin_page() {\n\t\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to customize headers.' ) );\n\t\t}\n\t\t$step = $this->step();\n\t\tif ( 2 == $step ) {\n\t\t\t$this->step_2();\n\t\t} elseif ( 3 == $step ) {\n\t\t\t$this->step_3();\n\t\t} else {\n\t\t\t$this->step_1();\n\t\t}\n\t}\n\n\t/**\n\t * Unused since 3.5.0.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param array $form_fields\n\t * @return array $form_fields\n\t */\n\tpublic function attachment_fields_to_edit( $form_fields ) {\n\t\treturn $form_fields;\n\t}\n\n\t/**\n\t * Unused since 3.5.0.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param array $tabs\n\t * @return array $tabs\n\t */\n\tpublic function filter_upload_tabs( $tabs ) {\n\t\treturn $tabs;\n\t}\n\n\t/**\n\t * Choose a header image, selected from existing uploaded and default headers,\n\t * or provide an array of uploaded header data (either new, or from media library).\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param mixed $choice Which header image to select. Allows for values of 'random-default-image',\n\t *  for randomly cycling among the default images; 'random-uploaded-image', for randomly cycling\n\t *  among the uploaded images; the key of a default image registered for that theme; and\n\t *  the key of an image uploaded for that theme (the attachment ID of the image).\n\t *  Or an array of arguments: attachment_id, url, width, height. All are required.\n\t */\n\tfinal public function set_header_image( $choice ) {\n\t\tif ( is_array( $choice ) || is_object( $choice ) ) {\n\t\t\t$choice = (array) $choice;\n\t\t\tif ( ! isset( $choice['attachment_id'] ) || ! isset( $choice['url'] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$choice['url'] = esc_url_raw( $choice['url'] );\n\n\t\t\t$header_image_data = (object) array(\n\t\t\t\t'attachment_id' => $choice['attachment_id'],\n\t\t\t\t'url'           => $choice['url'],\n\t\t\t\t'thumbnail_url' => $choice['url'],\n\t\t\t\t'height'        => $choice['height'],\n\t\t\t\t'width'         => $choice['width'],\n\t\t\t);\n\n\t\t\tupdate_post_meta( $choice['attachment_id'], '_wp_attachment_is_custom_header', get_stylesheet() );\n\t\t\tset_theme_mod( 'header_image', $choice['url'] );\n\t\t\tset_theme_mod( 'header_image_data', $header_image_data );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( in_array( $choice, array( 'remove-header', 'random-default-image', 'random-uploaded-image' ), true ) ) {\n\t\t\tset_theme_mod( 'header_image', $choice );\n\t\t\tremove_theme_mod( 'header_image_data' );\n\t\t\treturn;\n\t\t}\n\n\t\t$uploaded = get_uploaded_header_images();\n\t\tif ( $uploaded && isset( $uploaded[ $choice ] ) ) {\n\t\t\t$header_image_data = $uploaded[ $choice ];\n\n\t\t} else {\n\t\t\t$this->process_default_headers();\n\t\t\tif ( isset( $this->default_headers[ $choice ] ) ) {\n\t\t\t\t$header_image_data = $this->default_headers[ $choice ];\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tset_theme_mod( 'header_image', esc_url_raw( $header_image_data['url'] ) );\n\t\tset_theme_mod( 'header_image_data', $header_image_data );\n\t}\n\n\t/**\n\t * Remove a header image.\n\t *\n\t * @since 3.4.0\n\t */\n\tfinal public function remove_header_image() {\n\t\t$this->set_header_image( 'remove-header' );\n\t}\n\n\t/**\n\t * Reset a header image to the default image for the theme.\n\t *\n\t * This method does not do anything if the theme does not have a default header image.\n\t *\n\t * @since 3.4.0\n\t */\n\tfinal public function reset_header_image() {\n\t\t$this->process_default_headers();\n\t\t$default = get_theme_support( 'custom-header', 'default-image' );\n\n\t\tif ( ! $default ) {\n\t\t\t$this->remove_header_image();\n\t\t\treturn;\n\t\t}\n\t\t$default = sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() );\n\n\t\t$default_data = array();\n\t\tforeach ( $this->default_headers as $header => $details ) {\n\t\t\tif ( $details['url'] == $default ) {\n\t\t\t\t$default_data = $details;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tset_theme_mod( 'header_image', $default );\n\t\tset_theme_mod( 'header_image_data', (object) $default_data );\n\t}\n\n\t/**\n\t * Calculate width and height based on what the currently selected theme supports.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param array $dimensions\n\t * @return array dst_height and dst_width of header image.\n\t */\n\tfinal public function get_header_dimensions( $dimensions ) {\n\t\t$max_width       = 0;\n\t\t$width           = absint( $dimensions['width'] );\n\t\t$height          = absint( $dimensions['height'] );\n\t\t$theme_height    = get_theme_support( 'custom-header', 'height' );\n\t\t$theme_width     = get_theme_support( 'custom-header', 'width' );\n\t\t$has_flex_width  = current_theme_supports( 'custom-header', 'flex-width' );\n\t\t$has_flex_height = current_theme_supports( 'custom-header', 'flex-height' );\n\t\t$has_max_width   = current_theme_supports( 'custom-header', 'max-width' );\n\t\t$dst             = array(\n\t\t\t'dst_height' => null,\n\t\t\t'dst_width'  => null,\n\t\t);\n\n\t\t// For flex, limit size of image displayed to 1500px unless theme says otherwise.\n\t\tif ( $has_flex_width ) {\n\t\t\t$max_width = 1500;\n\t\t}\n\n\t\tif ( $has_max_width ) {\n\t\t\t$max_width = max( $max_width, get_theme_support( 'custom-header', 'max-width' ) );\n\t\t}\n\t\t$max_width = max( $max_width, $theme_width );\n\n\t\tif ( $has_flex_height && ( ! $has_flex_width || $width > $max_width ) ) {\n\t\t\t$dst['dst_height'] = absint( $height * ( $max_width / $width ) );\n\t\t} elseif ( $has_flex_height && $has_flex_width ) {\n\t\t\t$dst['dst_height'] = $height;\n\t\t} else {\n\t\t\t$dst['dst_height'] = $theme_height;\n\t\t}\n\n\t\tif ( $has_flex_width && ( ! $has_flex_height || $width > $max_width ) ) {\n\t\t\t$dst['dst_width'] = absint( $width * ( $max_width / $width ) );\n\t\t} elseif ( $has_flex_width && $has_flex_height ) {\n\t\t\t$dst['dst_width'] = $width;\n\t\t} else {\n\t\t\t$dst['dst_width'] = $theme_width;\n\t\t}\n\n\t\treturn $dst;\n\t}\n\n\t/**\n\t * Create an attachment 'object'.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param string $cropped              Cropped image URL.\n\t * @param int    $parent_attachment_id Attachment ID of parent image.\n\t * @return array Attachment object.\n\t */\n\tfinal public function create_attachment_object( $cropped, $parent_attachment_id ) {\n\t\t$parent     = get_post( $parent_attachment_id );\n\t\t$parent_url = wp_get_attachment_url( $parent->ID );\n\t\t$url        = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url );\n\n\t\t$size       = @getimagesize( $cropped );\n\t\t$image_type = ( $size ) ? $size['mime'] : 'image/jpeg';\n\n\t\t$object = array(\n\t\t\t'ID'             => $parent_attachment_id,\n\t\t\t'post_title'     => wp_basename( $cropped ),\n\t\t\t'post_mime_type' => $image_type,\n\t\t\t'guid'           => $url,\n\t\t\t'context'        => 'custom-header',\n\t\t\t'post_parent'    => $parent_attachment_id,\n\t\t);\n\n\t\treturn $object;\n\t}\n\n\t/**\n\t * Insert an attachment and its metadata.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param array  $object  Attachment object.\n\t * @param string $cropped File path to cropped image.\n\t * @return int Attachment ID.\n\t */\n\tfinal public function insert_attachment( $object, $cropped ) {\n\t\t$parent_id = isset( $object['post_parent'] ) ? $object['post_parent'] : null;\n\t\tunset( $object['post_parent'] );\n\n\t\t$attachment_id = wp_insert_attachment( $object, $cropped );\n\t\t$metadata      = wp_generate_attachment_metadata( $attachment_id, $cropped );\n\n\t\t// If this is a crop, save the original attachment ID as metadata.\n\t\tif ( $parent_id ) {\n\t\t\t$metadata['attachment_parent'] = $parent_id;\n\t\t}\n\n\t\t/**\n\t\t * Filters the header image attachment metadata.\n\t\t *\n\t\t * @since 3.9.0\n\t\t *\n\t\t * @see wp_generate_attachment_metadata()\n\t\t *\n\t\t * @param array $metadata Attachment metadata.\n\t\t */\n\t\t$metadata = apply_filters( 'wp_header_image_attachment_metadata', $metadata );\n\n\t\twp_update_attachment_metadata( $attachment_id, $metadata );\n\n\t\treturn $attachment_id;\n\t}\n\n\t/**\n\t * Gets attachment uploaded by Media Manager, crops it, then saves it as a\n\t * new object. Returns JSON-encoded object details.\n\t *\n\t * @since 3.9.0\n\t */\n\tpublic function ajax_header_crop() {\n\t\tcheck_ajax_referer( 'image_editor-' . $_POST['id'], 'nonce' );\n\n\t\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t\tif ( ! current_theme_supports( 'custom-header', 'uploads' ) ) {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t\t$crop_details = $_POST['cropDetails'];\n\n\t\t$dimensions = $this->get_header_dimensions(\n\t\t\tarray(\n\t\t\t\t'height' => $crop_details['height'],\n\t\t\t\t'width'  => $crop_details['width'],\n\t\t\t)\n\t\t);\n\n\t\t$attachment_id = absint( $_POST['id'] );\n\n\t\t$cropped = wp_crop_image(\n\t\t\t$attachment_id,\n\t\t\t(int) $crop_details['x1'],\n\t\t\t(int) $crop_details['y1'],\n\t\t\t(int) $crop_details['width'],\n\t\t\t(int) $crop_details['height'],\n\t\t\t(int) $dimensions['dst_width'],\n\t\t\t(int) $dimensions['dst_height']\n\t\t);\n\n\t\tif ( ! $cropped || is_wp_error( $cropped ) ) {\n\t\t\twp_send_json_error( array( 'message' => __( 'Image could not be processed. Please go back and try again.' ) ) );\n\t\t}\n\n\t\t/** This filter is documented in wp-admin/includes/class-custom-image-header.php */\n\t\t$cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.\n\n\t\t$object = $this->create_attachment_object( $cropped, $attachment_id );\n\n\t\t$previous = $this->get_previous_crop( $object );\n\n\t\tif ( $previous ) {\n\t\t\t$object['ID'] = $previous;\n\t\t} else {\n\t\t\tunset( $object['ID'] );\n\t\t}\n\n\t\t$new_attachment_id = $this->insert_attachment( $object, $cropped );\n\n\t\t$object['attachment_id'] = $new_attachment_id;\n\t\t$object['url']           = wp_get_attachment_url( $new_attachment_id );\n\n\t\t$object['width']  = $dimensions['dst_width'];\n\t\t$object['height'] = $dimensions['dst_height'];\n\n\t\twp_send_json_success( $object );\n\t}\n\n\t/**\n\t * Given an attachment ID for a header image, updates its \"last used\"\n\t * timestamp to now.\n\t *\n\t * Triggered when the user tries adds a new header image from the\n\t * Media Manager, even if s/he doesn't save that change.\n\t *\n\t * @since 3.9.0\n\t */\n\tpublic function ajax_header_add() {\n\t\tcheck_ajax_referer( 'header-add', 'nonce' );\n\n\t\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t\t$attachment_id = absint( $_POST['attachment_id'] );\n\t\tif ( $attachment_id < 1 ) {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t\t$key = '_wp_attachment_custom_header_last_used_' . get_stylesheet();\n\t\tupdate_post_meta( $attachment_id, $key, time() );\n\t\tupdate_post_meta( $attachment_id, '_wp_attachment_is_custom_header', get_stylesheet() );\n\n\t\twp_send_json_success();\n\t}\n\n\t/**\n\t * Given an attachment ID for a header image, unsets it as a user-uploaded\n\t * header image for the current theme.\n\t *\n\t * Triggered when the user clicks the overlay \"X\" button next to each image\n\t * choice in the Customizer's Header tool.\n\t *\n\t * @since 3.9.0\n\t */\n\tpublic function ajax_header_remove() {\n\t\tcheck_ajax_referer( 'header-remove', 'nonce' );\n\n\t\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t\t$attachment_id = absint( $_POST['attachment_id'] );\n\t\tif ( $attachment_id < 1 ) {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t\t$key = '_wp_attachment_custom_header_last_used_' . get_stylesheet();\n\t\tdelete_post_meta( $attachment_id, $key );\n\t\tdelete_post_meta( $attachment_id, '_wp_attachment_is_custom_header', get_stylesheet() );\n\n\t\twp_send_json_success();\n\t}\n\n\t/**\n\t * Updates the last-used postmeta on a header image attachment after saving a new header image via the Customizer.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param WP_Customize_Manager $wp_customize Customize manager.\n\t */\n\tpublic function customize_set_last_used( $wp_customize ) {\n\n\t\t$header_image_data_setting = $wp_customize->get_setting( 'header_image_data' );\n\t\tif ( ! $header_image_data_setting ) {\n\t\t\treturn;\n\t\t}\n\t\t$data = $header_image_data_setting->post_value();\n\n\t\tif ( ! isset( $data['attachment_id'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$attachment_id = $data['attachment_id'];\n\t\t$key           = '_wp_attachment_custom_header_last_used_' . get_stylesheet();\n\t\tupdate_post_meta( $attachment_id, $key, time() );\n\t}\n\n\t/**\n\t * Gets the details of default header images if defined.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @return array Default header images.\n\t */\n\tpublic function get_default_header_images() {\n\t\t$this->process_default_headers();\n\n\t\t// Get the default image if there is one.\n\t\t$default = get_theme_support( 'custom-header', 'default-image' );\n\n\t\tif ( ! $default ) { // If not, easy peasy.\n\t\t\treturn $this->default_headers;\n\t\t}\n\n\t\t$default             = sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() );\n\t\t$already_has_default = false;\n\n\t\tforeach ( $this->default_headers as $k => $h ) {\n\t\t\tif ( $h['url'] === $default ) {\n\t\t\t\t$already_has_default = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( $already_has_default ) {\n\t\t\treturn $this->default_headers;\n\t\t}\n\n\t\t// If the one true image isn't included in the default set, prepend it.\n\t\t$header_images            = array();\n\t\t$header_images['default'] = array(\n\t\t\t'url'           => $default,\n\t\t\t'thumbnail_url' => $default,\n\t\t\t'description'   => 'Default',\n\t\t);\n\n\t\t// The rest of the set comes after.\n\t\treturn array_merge( $header_images, $this->default_headers );\n\t}\n\n\t/**\n\t * Gets the previously uploaded header images.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @return array Uploaded header images.\n\t */\n\tpublic function get_uploaded_header_images() {\n\t\t$header_images = get_uploaded_header_images();\n\t\t$timestamp_key = '_wp_attachment_custom_header_last_used_' . get_stylesheet();\n\t\t$alt_text_key  = '_wp_attachment_image_alt';\n\n\t\tforeach ( $header_images as &$header_image ) {\n\t\t\t$header_meta               = get_post_meta( $header_image['attachment_id'] );\n\t\t\t$header_image['timestamp'] = isset( $header_meta[ $timestamp_key ] ) ? $header_meta[ $timestamp_key ] : '';\n\t\t\t$header_image['alt_text']  = isset( $header_meta[ $alt_text_key ] ) ? $header_meta[ $alt_text_key ] : '';\n\t\t}\n\n\t\treturn $header_images;\n\t}\n\n\t/**\n\t * Get the ID of a previous crop from the same base image.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param array $object A crop attachment object.\n\t * @return int|false An attachment ID if one exists. False if none.\n\t */\n\tpublic function get_previous_crop( $object ) {\n\t\t$header_images = $this->get_uploaded_header_images();\n\n\t\t// Bail early if there are no header images.\n\t\tif ( empty( $header_images ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$previous = false;\n\n\t\tforeach ( $header_images as $image ) {\n\t\t\tif ( $image['attachment_parent'] === $object['post_parent'] ) {\n\t\t\t\t$previous = $image['attachment_id'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $previous;\n\t}\n}\n", "num_lines": 1516}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrade API: File_Upload_Upgrader class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Core class used for handling file uploads.\n *\n * This class handles the upload process and passes it as if it's a local file\n * to the Upgrade/Installer functions.\n *\n * @since 2.8.0\n * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php.\n */\nclass File_Upload_Upgrader {\n\n\t/**\n\t * The full path to the file package.\n\t *\n\t * @since 2.8.0\n\t * @var string $package\n\t */\n\tpublic $package;\n\n\t/**\n\t * The name of the file.\n\t *\n\t * @since 2.8.0\n\t * @var string $filename\n\t */\n\tpublic $filename;\n\n\t/**\n\t * The ID of the attachment post for this file.\n\t *\n\t * @since 3.3.0\n\t * @var int $id\n\t */\n\tpublic $id = 0;\n\n\t/**\n\t * Construct the upgrader for a form.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $form      The name of the form the file was uploaded from.\n\t * @param string $urlholder The name of the `GET` parameter that holds the filename.\n\t */\n\tpublic function __construct( $form, $urlholder ) {\n\n\t\tif ( empty( $_FILES[ $form ]['name'] ) && empty( $_GET[ $urlholder ] ) ) {\n\t\t\twp_die( __( 'Please select a file' ) );\n\t\t}\n\n\t\t// Handle a newly uploaded file. Else, assume it's already been uploaded.\n\t\tif ( ! empty( $_FILES ) ) {\n\t\t\t$overrides = array(\n\t\t\t\t'test_form' => false,\n\t\t\t\t'test_type' => false,\n\t\t\t);\n\t\t\t$file      = wp_handle_upload( $_FILES[ $form ], $overrides );\n\n\t\t\tif ( isset( $file['error'] ) ) {\n\t\t\t\twp_die( $file['error'] );\n\t\t\t}\n\n\t\t\t$this->filename = $_FILES[ $form ]['name'];\n\t\t\t$this->package  = $file['file'];\n\n\t\t\t// Construct the object array.\n\t\t\t$object = array(\n\t\t\t\t'post_title'     => $this->filename,\n\t\t\t\t'post_content'   => $file['url'],\n\t\t\t\t'post_mime_type' => $file['type'],\n\t\t\t\t'guid'           => $file['url'],\n\t\t\t\t'context'        => 'upgrader',\n\t\t\t\t'post_status'    => 'private',\n\t\t\t);\n\n\t\t\t// Save the data.\n\t\t\t$this->id = wp_insert_attachment( $object, $file['file'] );\n\n\t\t\t// Schedule a cleanup for 2 hours from now in case of failed installation.\n\t\t\twp_schedule_single_event( time() + 2 * HOUR_IN_SECONDS, 'upgrader_scheduled_cleanup', array( $this->id ) );\n\n\t\t} elseif ( is_numeric( $_GET[ $urlholder ] ) ) {\n\t\t\t// Numeric Package = previously uploaded file, see above.\n\t\t\t$this->id   = (int) $_GET[ $urlholder ];\n\t\t\t$attachment = get_post( $this->id );\n\t\t\tif ( empty( $attachment ) ) {\n\t\t\t\twp_die( __( 'Please select a file' ) );\n\t\t\t}\n\n\t\t\t$this->filename = $attachment->post_title;\n\t\t\t$this->package  = get_attached_file( $attachment->ID );\n\t\t} else {\n\t\t\t// Else, It's set to something, Back compat for plugins using the old (pre-3.3) File_Uploader handler.\n\t\t\t$uploads = wp_upload_dir();\n\t\t\tif ( ! ( $uploads && false === $uploads['error'] ) ) {\n\t\t\t\twp_die( $uploads['error'] );\n\t\t\t}\n\n\t\t\t$this->filename = sanitize_file_name( $_GET[ $urlholder ] );\n\t\t\t$this->package  = $uploads['basedir'] . '/' . $this->filename;\n\n\t\t\tif ( 0 !== strpos( realpath( $this->package ), realpath( $uploads['basedir'] ) ) ) {\n\t\t\t\twp_die( __( 'Please select a file' ) );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Delete the attachment/uploaded file.\n\t *\n\t * @since 3.2.2\n\t *\n\t * @return bool Whether the cleanup was successful.\n\t */\n\tpublic function cleanup() {\n\t\tif ( $this->id ) {\n\t\t\twp_delete_attachment( $this->id );\n\n\t\t} elseif ( file_exists( $this->package ) ) {\n\t\t\treturn @unlink( $this->package );\n\t\t}\n\n\t\treturn true;\n\t}\n}\n", "num_lines": 134}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * PemFTP - An Ftp implementation in pure PHP\n *\n * @package PemFTP\n * @since 2.5.0\n *\n * @version 1.0\n * @copyright Alexey Dotsenko\n * @author Alexey Dotsenko\n * @link https://www.phpclasses.org/package/1743-PHP-FTP-client-in-pure-PHP.html\n * @license LGPL https://opensource.org/licenses/lgpl-license.html\n */\n\n/**\n * FTP implementation using fsockopen to connect.\n *\n * @package PemFTP\n * @subpackage Pure\n * @since 2.5.0\n *\n * @version 1.0\n * @copyright Alexey Dotsenko\n * @author Alexey Dotsenko\n * @link https://www.phpclasses.org/package/1743-PHP-FTP-client-in-pure-PHP.html\n * @license LGPL https://opensource.org/licenses/lgpl-license.html\n */\nclass ftp_pure extends ftp_base {\n\n\tfunction __construct($verb=FALSE, $le=FALSE) {\n\t\tparent::__construct(false, $verb, $le);\n\t}\n\n// <!-- --------------------------------------------------------------------------------------- -->\n// <!--       Private functions                                                                 -->\n// <!-- --------------------------------------------------------------------------------------- -->\n\n\tfunction _settimeout($sock) {\n\t\tif(!@stream_set_timeout($sock, $this->_timeout)) {\n\t\t\t$this->PushError('_settimeout','socket set send timeout');\n\t\t\t$this->_quit();\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}\n\n\tfunction _connect($host, $port) {\n\t\t$this->SendMSG(\"Creating socket\");\n\t\t$sock = @fsockopen($host, $port, $errno, $errstr, $this->_timeout);\n\t\tif (!$sock) {\n\t\t\t$this->PushError('_connect','socket connect failed', $errstr.\" (\".$errno.\")\");\n\t\t\treturn FALSE;\n\t\t}\n\t\t$this->_connected=true;\n\t\treturn $sock;\n\t}\n\n\tfunction _readmsg($fnction=\"_readmsg\"){\n\t\tif(!$this->_connected) {\n\t\t\t$this->PushError($fnction, 'Connect first');\n\t\t\treturn FALSE;\n\t\t}\n\t\t$result=true;\n\t\t$this->_message=\"\";\n\t\t$this->_code=0;\n\t\t$go=true;\n\t\tdo {\n\t\t\t$tmp=@fgets($this->_ftp_control_sock, 512);\n\t\t\tif($tmp===false) {\n\t\t\t\t$go=$result=false;\n\t\t\t\t$this->PushError($fnction,'Read failed');\n\t\t\t} else {\n\t\t\t\t$this->_message.=$tmp;\n\t\t\t\tif(preg_match(\"/^([0-9]{3})(-(.*[\".CRLF.\"]{1,2})+\\\\1)? [^\".CRLF.\"]+[\".CRLF.\"]{1,2}$/\", $this->_message, $regs)) $go=false;\n\t\t\t}\n\t\t} while($go);\n\t\tif($this->LocalEcho) echo \"GET < \".rtrim($this->_message, CRLF).CRLF;\n\t\t$this->_code=(int)$regs[1];\n\t\treturn $result;\n\t}\n\n\tfunction _exec($cmd, $fnction=\"_exec\") {\n\t\tif(!$this->_ready) {\n\t\t\t$this->PushError($fnction,'Connect first');\n\t\t\treturn FALSE;\n\t\t}\n\t\tif($this->LocalEcho) echo \"PUT > \",$cmd,CRLF;\n\t\t$status=@fputs($this->_ftp_control_sock, $cmd.CRLF);\n\t\tif($status===false) {\n\t\t\t$this->PushError($fnction,'socket write failed');\n\t\t\treturn FALSE;\n\t\t}\n\t\t$this->_lastaction=time();\n\t\tif(!$this->_readmsg($fnction)) return FALSE;\n\t\treturn TRUE;\n\t}\n\n\tfunction _data_prepare($mode=FTP_ASCII) {\n\t\tif(!$this->_settype($mode)) return FALSE;\n\t\tif($this->_passive) {\n\t\t\tif(!$this->_exec(\"PASV\", \"pasv\")) {\n\t\t\t\t$this->_data_close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tif(!$this->_checkCode()) {\n\t\t\t\t$this->_data_close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t$ip_port = explode(\",\", preg_replace(\"/^.+ \\\\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\\\)?.*$/s\", \"\\\\1\", $this->_message));\n\t\t\t$this->_datahost=$ip_port[0].\".\".$ip_port[1].\".\".$ip_port[2].\".\".$ip_port[3];\n            $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]);\n\t\t\t$this->SendMSG(\"Connecting to \".$this->_datahost.\":\".$this->_dataport);\n\t\t\t$this->_ftp_data_sock=@fsockopen($this->_datahost, $this->_dataport, $errno, $errstr, $this->_timeout);\n\t\t\tif(!$this->_ftp_data_sock) {\n\t\t\t\t$this->PushError(\"_data_prepare\",\"fsockopen fails\", $errstr.\" (\".$errno.\")\");\n\t\t\t\t$this->_data_close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse $this->_ftp_data_sock;\n\t\t} else {\n\t\t\t$this->SendMSG(\"Only passive connections available!\");\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}\n\n\tfunction _data_read($mode=FTP_ASCII, $fp=NULL) {\n\t\tif(is_resource($fp)) $out=0;\n\t\telse $out=\"\";\n\t\tif(!$this->_passive) {\n\t\t\t$this->SendMSG(\"Only passive connections available!\");\n\t\t\treturn FALSE;\n\t\t}\n\t\twhile (!feof($this->_ftp_data_sock)) {\n\t\t\t$block=fread($this->_ftp_data_sock, $this->_ftp_buff_size);\n\t\t\tif($mode!=FTP_BINARY) $block=preg_replace(\"/\\r\\n|\\r|\\n/\", $this->_eol_code[$this->OS_local], $block);\n\t\t\tif(is_resource($fp)) $out+=fwrite($fp, $block, strlen($block));\n\t\t\telse $out.=$block;\n\t\t}\n\t\treturn $out;\n\t}\n\n\tfunction _data_write($mode=FTP_ASCII, $fp=NULL) {\n\t\tif(is_resource($fp)) $out=0;\n\t\telse $out=\"\";\n\t\tif(!$this->_passive) {\n\t\t\t$this->SendMSG(\"Only passive connections available!\");\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(is_resource($fp)) {\n\t\t\twhile(!feof($fp)) {\n\t\t\t\t$block=fread($fp, $this->_ftp_buff_size);\n\t\t\t\tif(!$this->_data_write_block($mode, $block)) return false;\n\t\t\t}\n\t\t} elseif(!$this->_data_write_block($mode, $fp)) return false;\n\t\treturn TRUE;\n\t}\n\n\tfunction _data_write_block($mode, $block) {\n\t\tif($mode!=FTP_BINARY) $block=preg_replace(\"/\\r\\n|\\r|\\n/\", $this->_eol_code[$this->OS_remote], $block);\n\t\tdo {\n\t\t\tif(($t=@fwrite($this->_ftp_data_sock, $block))===FALSE) {\n\t\t\t\t$this->PushError(\"_data_write\",\"Can't write to socket\");\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t$block=substr($block, $t);\n\t\t} while(!empty($block));\n\t\treturn true;\n\t}\n\n\tfunction _data_close() {\n\t\t@fclose($this->_ftp_data_sock);\n\t\t$this->SendMSG(\"Disconnected data from remote host\");\n\t\treturn TRUE;\n\t}\n\n\tfunction _quit($force=FALSE) {\n\t\tif($this->_connected or $force) {\n\t\t\t@fclose($this->_ftp_control_sock);\n\t\t\t$this->_connected=false;\n\t\t\t$this->SendMSG(\"Socket closed\");\n\t\t}\n\t}\n}\n\n?>\n", "num_lines": 187}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * PemFTP - An Ftp implementation in pure PHP\n *\n * @package PemFTP\n * @since 2.5.0\n *\n * @version 1.0\n * @copyright Alexey Dotsenko\n * @author Alexey Dotsenko\n * @link https://www.phpclasses.org/package/1743-PHP-FTP-client-in-pure-PHP.html\n * @license LGPL https://opensource.org/licenses/lgpl-license.html\n */\n\n/**\n * Socket Based FTP implementation\n *\n * @package PemFTP\n * @subpackage Socket\n * @since 2.5.0\n *\n * @version 1.0\n * @copyright Alexey Dotsenko\n * @author Alexey Dotsenko\n * @link https://www.phpclasses.org/package/1743-PHP-FTP-client-in-pure-PHP.html\n * @license LGPL https://opensource.org/licenses/lgpl-license.html\n */\nclass ftp_sockets extends ftp_base {\n\n\tfunction __construct($verb=FALSE, $le=FALSE) {\n\t\tparent::__construct(true, $verb, $le);\n\t}\n\n// <!-- --------------------------------------------------------------------------------------- -->\n// <!--       Private functions                                                                 -->\n// <!-- --------------------------------------------------------------------------------------- -->\n\n\tfunction _settimeout($sock) {\n\t\tif(!@socket_set_option($sock, SOL_SOCKET, SO_RCVTIMEO, array(\"sec\"=>$this->_timeout, \"usec\"=>0))) {\n\t\t\t$this->PushError('_connect','socket set receive timeout',socket_strerror(socket_last_error($sock)));\n\t\t\t@socket_close($sock);\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(!@socket_set_option($sock, SOL_SOCKET , SO_SNDTIMEO, array(\"sec\"=>$this->_timeout, \"usec\"=>0))) {\n\t\t\t$this->PushError('_connect','socket set send timeout',socket_strerror(socket_last_error($sock)));\n\t\t\t@socket_close($sock);\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn true;\n\t}\n\n\tfunction _connect($host, $port) {\n\t\t$this->SendMSG(\"Creating socket\");\n\t\tif(!($sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) {\n\t\t\t$this->PushError('_connect','socket create failed',socket_strerror(socket_last_error($sock)));\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(!$this->_settimeout($sock)) return FALSE;\n\t\t$this->SendMSG(\"Connecting to \\\"\".$host.\":\".$port.\"\\\"\");\n\t\tif (!($res = @socket_connect($sock, $host, $port))) {\n\t\t\t$this->PushError('_connect','socket connect failed',socket_strerror(socket_last_error($sock)));\n\t\t\t@socket_close($sock);\n\t\t\treturn FALSE;\n\t\t}\n\t\t$this->_connected=true;\n\t\treturn $sock;\n\t}\n\n\tfunction _readmsg($fnction=\"_readmsg\"){\n\t\tif(!$this->_connected) {\n\t\t\t$this->PushError($fnction,'Connect first');\n\t\t\treturn FALSE;\n\t\t}\n\t\t$result=true;\n\t\t$this->_message=\"\";\n\t\t$this->_code=0;\n\t\t$go=true;\n\t\tdo {\n\t\t\t$tmp=@socket_read($this->_ftp_control_sock, 4096, PHP_BINARY_READ);\n\t\t\tif($tmp===false) {\n\t\t\t\t$go=$result=false;\n\t\t\t\t$this->PushError($fnction,'Read failed', socket_strerror(socket_last_error($this->_ftp_control_sock)));\n\t\t\t} else {\n\t\t\t\t$this->_message.=$tmp;\n\t\t\t\t$go = !preg_match(\"/^([0-9]{3})(-.+\\\\1)? [^\".CRLF.\"]+\".CRLF.\"$/Us\", $this->_message, $regs);\n\t\t\t}\n\t\t} while($go);\n\t\tif($this->LocalEcho) echo \"GET < \".rtrim($this->_message, CRLF).CRLF;\n\t\t$this->_code=(int)$regs[1];\n\t\treturn $result;\n\t}\n\n\tfunction _exec($cmd, $fnction=\"_exec\") {\n\t\tif(!$this->_ready) {\n\t\t\t$this->PushError($fnction,'Connect first');\n\t\t\treturn FALSE;\n\t\t}\n\t\tif($this->LocalEcho) echo \"PUT > \",$cmd,CRLF;\n\t\t$status=@socket_write($this->_ftp_control_sock, $cmd.CRLF);\n\t\tif($status===false) {\n\t\t\t$this->PushError($fnction,'socket write failed', socket_strerror(socket_last_error($this->stream)));\n\t\t\treturn FALSE;\n\t\t}\n\t\t$this->_lastaction=time();\n\t\tif(!$this->_readmsg($fnction)) return FALSE;\n\t\treturn TRUE;\n\t}\n\n\tfunction _data_prepare($mode=FTP_ASCII) {\n\t\tif(!$this->_settype($mode)) return FALSE;\n\t\t$this->SendMSG(\"Creating data socket\");\n\t\t$this->_ftp_data_sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n\t\tif ($this->_ftp_data_sock < 0) {\n\t\t\t$this->PushError('_data_prepare','socket create failed',socket_strerror(socket_last_error($this->_ftp_data_sock)));\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(!$this->_settimeout($this->_ftp_data_sock)) {\n\t\t\t$this->_data_close();\n\t\t\treturn FALSE;\n\t\t}\n\t\tif($this->_passive) {\n\t\t\tif(!$this->_exec(\"PASV\", \"pasv\")) {\n\t\t\t\t$this->_data_close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tif(!$this->_checkCode()) {\n\t\t\t\t$this->_data_close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t$ip_port = explode(\",\", preg_replace(\"/^.+ \\\\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\\\)?.*$/s\", \"\\\\1\", $this->_message));\n\t\t\t$this->_datahost=$ip_port[0].\".\".$ip_port[1].\".\".$ip_port[2].\".\".$ip_port[3];\n\t\t\t$this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]);\n\t\t\t$this->SendMSG(\"Connecting to \".$this->_datahost.\":\".$this->_dataport);\n\t\t\tif(!@socket_connect($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) {\n\t\t\t\t$this->PushError(\"_data_prepare\",\"socket_connect\", socket_strerror(socket_last_error($this->_ftp_data_sock)));\n\t\t\t\t$this->_data_close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse $this->_ftp_temp_sock=$this->_ftp_data_sock;\n\t\t} else {\n\t\t\tif(!@socket_getsockname($this->_ftp_control_sock, $addr, $port)) {\n\t\t\t\t$this->PushError(\"_data_prepare\",\"can't get control socket information\", socket_strerror(socket_last_error($this->_ftp_control_sock)));\n\t\t\t\t$this->_data_close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tif(!@socket_bind($this->_ftp_data_sock,$addr)){\n\t\t\t\t$this->PushError(\"_data_prepare\",\"can't bind data socket\", socket_strerror(socket_last_error($this->_ftp_data_sock)));\n\t\t\t\t$this->_data_close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tif(!@socket_listen($this->_ftp_data_sock)) {\n\t\t\t\t$this->PushError(\"_data_prepare\",\"can't listen data socket\", socket_strerror(socket_last_error($this->_ftp_data_sock)));\n\t\t\t\t$this->_data_close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tif(!@socket_getsockname($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) {\n\t\t\t\t$this->PushError(\"_data_prepare\",\"can't get data socket information\", socket_strerror(socket_last_error($this->_ftp_data_sock)));\n\t\t\t\t$this->_data_close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tif(!$this->_exec('PORT '.str_replace('.',',',$this->_datahost.'.'.($this->_dataport>>8).'.'.($this->_dataport&0x00FF)), \"_port\")) {\n\t\t\t\t$this->_data_close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tif(!$this->_checkCode()) {\n\t\t\t\t$this->_data_close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}\n\n\tfunction _data_read($mode=FTP_ASCII, $fp=NULL) {\n\t\t$NewLine=$this->_eol_code[$this->OS_local];\n\t\tif(is_resource($fp)) $out=0;\n\t\telse $out=\"\";\n\t\tif(!$this->_passive) {\n\t\t\t$this->SendMSG(\"Connecting to \".$this->_datahost.\":\".$this->_dataport);\n\t\t\t$this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock);\n\t\t\tif($this->_ftp_temp_sock===FALSE) {\n\t\t\t\t$this->PushError(\"_data_read\",\"socket_accept\", socket_strerror(socket_last_error($this->_ftp_temp_sock)));\n\t\t\t\t$this->_data_close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\twhile(($block=@socket_read($this->_ftp_temp_sock, $this->_ftp_buff_size, PHP_BINARY_READ))!==false) {\n\t\t\tif($block===\"\") break;\n\t\t\tif($mode!=FTP_BINARY) $block=preg_replace(\"/\\r\\n|\\r|\\n/\", $this->_eol_code[$this->OS_local], $block);\n\t\t\tif(is_resource($fp)) $out+=fwrite($fp, $block, strlen($block));\n\t\t\telse $out.=$block;\n\t\t}\n\t\treturn $out;\n\t}\n\n\tfunction _data_write($mode=FTP_ASCII, $fp=NULL) {\n\t\t$NewLine=$this->_eol_code[$this->OS_local];\n\t\tif(is_resource($fp)) $out=0;\n\t\telse $out=\"\";\n\t\tif(!$this->_passive) {\n\t\t\t$this->SendMSG(\"Connecting to \".$this->_datahost.\":\".$this->_dataport);\n\t\t\t$this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock);\n\t\t\tif($this->_ftp_temp_sock===FALSE) {\n\t\t\t\t$this->PushError(\"_data_write\",\"socket_accept\", socket_strerror(socket_last_error($this->_ftp_temp_sock)));\n\t\t\t\t$this->_data_close();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif(is_resource($fp)) {\n\t\t\twhile(!feof($fp)) {\n\t\t\t\t$block=fread($fp, $this->_ftp_buff_size);\n\t\t\t\tif(!$this->_data_write_block($mode, $block)) return false;\n\t\t\t}\n\t\t} elseif(!$this->_data_write_block($mode, $fp)) return false;\n\t\treturn true;\n\t}\n\n\tfunction _data_write_block($mode, $block) {\n\t\tif($mode!=FTP_BINARY) $block=preg_replace(\"/\\r\\n|\\r|\\n/\", $this->_eol_code[$this->OS_remote], $block);\n\t\tdo {\n\t\t\tif(($t=@socket_write($this->_ftp_temp_sock, $block))===FALSE) {\n\t\t\t\t$this->PushError(\"_data_write\",\"socket_write\", socket_strerror(socket_last_error($this->_ftp_temp_sock)));\n\t\t\t\t$this->_data_close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t$block=substr($block, $t);\n\t\t} while(!empty($block));\n\t\treturn true;\n\t}\n\n\tfunction _data_close() {\n\t\t@socket_close($this->_ftp_temp_sock);\n\t\t@socket_close($this->_ftp_data_sock);\n\t\t$this->SendMSG(\"Disconnected data from remote host\");\n\t\treturn TRUE;\n\t}\n\n\tfunction _quit() {\n\t\tif($this->_connected) {\n\t\t\t@socket_close($this->_ftp_control_sock);\n\t\t\t$this->_connected=false;\n\t\t\t$this->SendMSG(\"Socket closed\");\n\t\t}\n\t}\n}\n?>\n", "num_lines": 247}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * PemFTP - An Ftp implementation in pure PHP\n *\n * @package PemFTP\n * @since 2.5.0\n *\n * @version 1.0\n * @copyright Alexey Dotsenko\n * @author Alexey Dotsenko\n * @link https://www.phpclasses.org/package/1743-PHP-FTP-client-in-pure-PHP.html\n * @license LGPL https://opensource.org/licenses/lgpl-license.html\n */\n\n/**\n * Defines the newline characters, if not defined already.\n *\n * This can be redefined.\n *\n * @since 2.5.0\n * @var string\n */\nif(!defined('CRLF')) define('CRLF',\"\\r\\n\");\n\n/**\n * Sets whatever to autodetect ASCII mode.\n *\n * This can be redefined.\n *\n * @since 2.5.0\n * @var int\n */\nif(!defined(\"FTP_AUTOASCII\")) define(\"FTP_AUTOASCII\", -1);\n\n/**\n *\n * This can be redefined.\n * @since 2.5.0\n * @var int\n */\nif(!defined(\"FTP_BINARY\")) define(\"FTP_BINARY\", 1);\n\n/**\n *\n * This can be redefined.\n * @since 2.5.0\n * @var int\n */\nif(!defined(\"FTP_ASCII\")) define(\"FTP_ASCII\", 0);\n\n/**\n * Whether to force FTP.\n *\n * This can be redefined.\n *\n * @since 2.5.0\n * @var bool\n */\nif(!defined('FTP_FORCE')) define('FTP_FORCE', true);\n\n/**\n * @since 2.5.0\n * @var string\n */\ndefine('FTP_OS_Unix','u');\n\n/**\n * @since 2.5.0\n * @var string\n */\ndefine('FTP_OS_Windows','w');\n\n/**\n * @since 2.5.0\n * @var string\n */\ndefine('FTP_OS_Mac','m');\n\n/**\n * PemFTP base class\n *\n */\nclass ftp_base {\n\t/* Public variables */\n\tvar $LocalEcho;\n\tvar $Verbose;\n\tvar $OS_local;\n\tvar $OS_remote;\n\n\t/* Private variables */\n\tvar $_lastaction;\n\tvar $_errors;\n\tvar $_type;\n\tvar $_umask;\n\tvar $_timeout;\n\tvar $_passive;\n\tvar $_host;\n\tvar $_fullhost;\n\tvar $_port;\n\tvar $_datahost;\n\tvar $_dataport;\n\tvar $_ftp_control_sock;\n\tvar $_ftp_data_sock;\n\tvar $_ftp_temp_sock;\n\tvar $_ftp_buff_size;\n\tvar $_login;\n\tvar $_password;\n\tvar $_connected;\n\tvar $_ready;\n\tvar $_code;\n\tvar $_message;\n\tvar $_can_restore;\n\tvar $_port_available;\n\tvar $_curtype;\n\tvar $_features;\n\n\tvar $_error_array;\n\tvar $AuthorizedTransferMode;\n\tvar $OS_FullName;\n\tvar $_eol_code;\n\tvar $AutoAsciiExt;\n\n\t/* Constructor */\n\tfunction __construct($port_mode=FALSE, $verb=FALSE, $le=FALSE) {\n\t\t$this->LocalEcho=$le;\n\t\t$this->Verbose=$verb;\n\t\t$this->_lastaction=NULL;\n\t\t$this->_error_array=array();\n\t\t$this->_eol_code=array(FTP_OS_Unix=>\"\\n\", FTP_OS_Mac=>\"\\r\", FTP_OS_Windows=>\"\\r\\n\");\n\t\t$this->AuthorizedTransferMode=array(FTP_AUTOASCII, FTP_ASCII, FTP_BINARY);\n\t\t$this->OS_FullName=array(FTP_OS_Unix => 'UNIX', FTP_OS_Windows => 'WINDOWS', FTP_OS_Mac => 'MACOS');\n\t\t$this->AutoAsciiExt=array(\"ASP\",\"BAT\",\"C\",\"CPP\",\"CSS\",\"CSV\",\"JS\",\"H\",\"HTM\",\"HTML\",\"SHTML\",\"INI\",\"LOG\",\"PHP3\",\"PHTML\",\"PL\",\"PERL\",\"SH\",\"SQL\",\"TXT\");\n\t\t$this->_port_available=($port_mode==TRUE);\n\t\t$this->SendMSG(\"Staring FTP client class\".($this->_port_available?\"\":\" without PORT mode support\"));\n\t\t$this->_connected=FALSE;\n\t\t$this->_ready=FALSE;\n\t\t$this->_can_restore=FALSE;\n\t\t$this->_code=0;\n\t\t$this->_message=\"\";\n\t\t$this->_ftp_buff_size=4096;\n\t\t$this->_curtype=NULL;\n\t\t$this->SetUmask(0022);\n\t\t$this->SetType(FTP_AUTOASCII);\n\t\t$this->SetTimeout(30);\n\t\t$this->Passive(!$this->_port_available);\n\t\t$this->_login=\"anonymous\";\n\t\t$this->_password=\"anon@ftp.com\";\n\t\t$this->_features=array();\n\t    $this->OS_local=FTP_OS_Unix;\n\t\t$this->OS_remote=FTP_OS_Unix;\n\t\t$this->features=array();\n\t\tif(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') $this->OS_local=FTP_OS_Windows;\n\t\telseif(strtoupper(substr(PHP_OS, 0, 3)) === 'MAC') $this->OS_local=FTP_OS_Mac;\n\t}\n\n\tfunction ftp_base($port_mode=FALSE) {\n\t\t$this->__construct($port_mode);\n\t}\n\n// <!-- --------------------------------------------------------------------------------------- -->\n// <!--       Public functions                                                                  -->\n// <!-- --------------------------------------------------------------------------------------- -->\n\n\tfunction parselisting($line) {\n\t\t$is_windows = ($this->OS_remote == FTP_OS_Windows);\n\t\tif ($is_windows && preg_match(\"/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/\",$line,$lucifer)) {\n\t\t\t$b = array();\n\t\t\tif ($lucifer[3]<70) { $lucifer[3]+=2000; } else { $lucifer[3]+=1900; } // 4digit year fix\n\t\t\t$b['isdir'] = ($lucifer[7]==\"<DIR>\");\n\t\t\tif ( $b['isdir'] )\n\t\t\t\t$b['type'] = 'd';\n\t\t\telse\n\t\t\t\t$b['type'] = 'f';\n\t\t\t$b['size'] = $lucifer[7];\n\t\t\t$b['month'] = $lucifer[1];\n\t\t\t$b['day'] = $lucifer[2];\n\t\t\t$b['year'] = $lucifer[3];\n\t\t\t$b['hour'] = $lucifer[4];\n\t\t\t$b['minute'] = $lucifer[5];\n\t\t\t$b['time'] = @mktime($lucifer[4]+(strcasecmp($lucifer[6],\"PM\")==0?12:0),$lucifer[5],0,$lucifer[1],$lucifer[2],$lucifer[3]);\n\t\t\t$b['am/pm'] = $lucifer[6];\n\t\t\t$b['name'] = $lucifer[8];\n\t\t} else if (!$is_windows && $lucifer=preg_split(\"/[ ]/\",$line,9,PREG_SPLIT_NO_EMPTY)) {\n\t\t\t//echo $line.\"\\n\";\n\t\t\t$lcount=count($lucifer);\n\t\t\tif ($lcount<8) return '';\n\t\t\t$b = array();\n\t\t\t$b['isdir'] = $lucifer[0][0] === \"d\";\n\t\t\t$b['islink'] = $lucifer[0][0] === \"l\";\n\t\t\tif ( $b['isdir'] )\n\t\t\t\t$b['type'] = 'd';\n\t\t\telseif ( $b['islink'] )\n\t\t\t\t$b['type'] = 'l';\n\t\t\telse\n\t\t\t\t$b['type'] = 'f';\n\t\t\t$b['perms'] = $lucifer[0];\n\t\t\t$b['number'] = $lucifer[1];\n\t\t\t$b['owner'] = $lucifer[2];\n\t\t\t$b['group'] = $lucifer[3];\n\t\t\t$b['size'] = $lucifer[4];\n\t\t\tif ($lcount==8) {\n\t\t\t\tsscanf($lucifer[5],\"%d-%d-%d\",$b['year'],$b['month'],$b['day']);\n\t\t\t\tsscanf($lucifer[6],\"%d:%d\",$b['hour'],$b['minute']);\n\t\t\t\t$b['time'] = @mktime($b['hour'],$b['minute'],0,$b['month'],$b['day'],$b['year']);\n\t\t\t\t$b['name'] = $lucifer[7];\n\t\t\t} else {\n\t\t\t\t$b['month'] = $lucifer[5];\n\t\t\t\t$b['day'] = $lucifer[6];\n\t\t\t\tif (preg_match(\"/([0-9]{2}):([0-9]{2})/\",$lucifer[7],$l2)) {\n\t\t\t\t\t$b['year'] = gmdate(\"Y\");\n\t\t\t\t\t$b['hour'] = $l2[1];\n\t\t\t\t\t$b['minute'] = $l2[2];\n\t\t\t\t} else {\n\t\t\t\t\t$b['year'] = $lucifer[7];\n\t\t\t\t\t$b['hour'] = 0;\n\t\t\t\t\t$b['minute'] = 0;\n\t\t\t\t}\n\t\t\t\t$b['time'] = strtotime(sprintf(\"%d %s %d %02d:%02d\",$b['day'],$b['month'],$b['year'],$b['hour'],$b['minute']));\n\t\t\t\t$b['name'] = $lucifer[8];\n\t\t\t}\n\t\t}\n\n\t\treturn $b;\n\t}\n\n\tfunction SendMSG($message = \"\", $crlf=true) {\n\t\tif ($this->Verbose) {\n\t\t\techo $message.($crlf?CRLF:\"\");\n\t\t\tflush();\n\t\t}\n\t\treturn TRUE;\n\t}\n\n\tfunction SetType($mode=FTP_AUTOASCII) {\n\t\tif(!in_array($mode, $this->AuthorizedTransferMode)) {\n\t\t\t$this->SendMSG(\"Wrong type\");\n\t\t\treturn FALSE;\n\t\t}\n\t\t$this->_type=$mode;\n\t\t$this->SendMSG(\"Transfer type: \".($this->_type==FTP_BINARY?\"binary\":($this->_type==FTP_ASCII?\"ASCII\":\"auto ASCII\") ) );\n\t\treturn TRUE;\n\t}\n\n\tfunction _settype($mode=FTP_ASCII) {\n\t\tif($this->_ready) {\n\t\t\tif($mode==FTP_BINARY) {\n\t\t\t\tif($this->_curtype!=FTP_BINARY) {\n\t\t\t\t\tif(!$this->_exec(\"TYPE I\", \"SetType\")) return FALSE;\n\t\t\t\t\t$this->_curtype=FTP_BINARY;\n\t\t\t\t}\n\t\t\t} elseif($this->_curtype!=FTP_ASCII) {\n\t\t\t\tif(!$this->_exec(\"TYPE A\", \"SetType\")) return FALSE;\n\t\t\t\t$this->_curtype=FTP_ASCII;\n\t\t\t}\n\t\t} else return FALSE;\n\t\treturn TRUE;\n\t}\n\n\tfunction Passive($pasv=NULL) {\n\t\tif(is_null($pasv)) $this->_passive=!$this->_passive;\n\t\telse $this->_passive=$pasv;\n\t\tif(!$this->_port_available and !$this->_passive) {\n\t\t\t$this->SendMSG(\"Only passive connections available!\");\n\t\t\t$this->_passive=TRUE;\n\t\t\treturn FALSE;\n\t\t}\n\t\t$this->SendMSG(\"Passive mode \".($this->_passive?\"on\":\"off\"));\n\t\treturn TRUE;\n\t}\n\n\tfunction SetServer($host, $port=21, $reconnect=true) {\n\t\tif(!is_long($port)) {\n\t        $this->verbose=true;\n    \t    $this->SendMSG(\"Incorrect port syntax\");\n\t\t\treturn FALSE;\n\t\t} else {\n\t\t\t$ip=@gethostbyname($host);\n\t        $dns=@gethostbyaddr($host);\n\t        if(!$ip) $ip=$host;\n\t        if(!$dns) $dns=$host;\n\t        // Validate the IPAddress PHP4 returns -1 for invalid, PHP5 false\n\t        // -1 === \"255.255.255.255\" which is the broadcast address which is also going to be invalid\n\t        $ipaslong = ip2long($ip);\n\t\t\tif ( ($ipaslong == false) || ($ipaslong === -1) ) {\n\t\t\t\t$this->SendMSG(\"Wrong host name/address \\\"\".$host.\"\\\"\");\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t        $this->_host=$ip;\n\t        $this->_fullhost=$dns;\n\t        $this->_port=$port;\n\t        $this->_dataport=$port-1;\n\t\t}\n\t\t$this->SendMSG(\"Host \\\"\".$this->_fullhost.\"(\".$this->_host.\"):\".$this->_port.\"\\\"\");\n\t\tif($reconnect){\n\t\t\tif($this->_connected) {\n\t\t\t\t$this->SendMSG(\"Reconnecting\");\n\t\t\t\tif(!$this->quit(FTP_FORCE)) return FALSE;\n\t\t\t\tif(!$this->connect()) return FALSE;\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}\n\n\tfunction SetUmask($umask=0022) {\n\t\t$this->_umask=$umask;\n\t\tumask($this->_umask);\n\t\t$this->SendMSG(\"UMASK 0\".decoct($this->_umask));\n\t\treturn TRUE;\n\t}\n\n\tfunction SetTimeout($timeout=30) {\n\t\t$this->_timeout=$timeout;\n\t\t$this->SendMSG(\"Timeout \".$this->_timeout);\n\t\tif($this->_connected)\n\t\t\tif(!$this->_settimeout($this->_ftp_control_sock)) return FALSE;\n\t\treturn TRUE;\n\t}\n\n\tfunction connect($server=NULL) {\n\t\tif(!empty($server)) {\n\t\t\tif(!$this->SetServer($server)) return false;\n\t\t}\n\t\tif($this->_ready) return true;\n\t    $this->SendMsg('Local OS : '.$this->OS_FullName[$this->OS_local]);\n\t\tif(!($this->_ftp_control_sock = $this->_connect($this->_host, $this->_port))) {\n\t\t\t$this->SendMSG(\"Error : Cannot connect to remote host \\\"\".$this->_fullhost.\" :\".$this->_port.\"\\\"\");\n\t\t\treturn FALSE;\n\t\t}\n\t\t$this->SendMSG(\"Connected to remote host \\\"\".$this->_fullhost.\":\".$this->_port.\"\\\". Waiting for greeting.\");\n\t\tdo {\n\t\t\tif(!$this->_readmsg()) return FALSE;\n\t\t\tif(!$this->_checkCode()) return FALSE;\n\t\t\t$this->_lastaction=time();\n\t\t} while($this->_code<200);\n\t\t$this->_ready=true;\n\t\t$syst=$this->systype();\n\t\tif(!$syst) $this->SendMSG(\"Can't detect remote OS\");\n\t\telse {\n\t\t\tif(preg_match(\"/win|dos|novell/i\", $syst[0])) $this->OS_remote=FTP_OS_Windows;\n\t\t\telseif(preg_match(\"/os/i\", $syst[0])) $this->OS_remote=FTP_OS_Mac;\n\t\t\telseif(preg_match(\"/(li|u)nix/i\", $syst[0])) $this->OS_remote=FTP_OS_Unix;\n\t\t\telse $this->OS_remote=FTP_OS_Mac;\n\t\t\t$this->SendMSG(\"Remote OS: \".$this->OS_FullName[$this->OS_remote]);\n\t\t}\n\t\tif(!$this->features()) $this->SendMSG(\"Can't get features list. All supported - disabled\");\n\t\telse $this->SendMSG(\"Supported features: \".implode(\", \", array_keys($this->_features)));\n\t\treturn TRUE;\n\t}\n\n\tfunction quit($force=false) {\n\t\tif($this->_ready) {\n\t\t\tif(!$this->_exec(\"QUIT\") and !$force) return FALSE;\n\t\t\tif(!$this->_checkCode() and !$force) return FALSE;\n\t\t\t$this->_ready=false;\n\t\t\t$this->SendMSG(\"Session finished\");\n\t\t}\n\t\t$this->_quit();\n\t\treturn TRUE;\n\t}\n\n\tfunction login($user=NULL, $pass=NULL) {\n\t\tif(!is_null($user)) $this->_login=$user;\n\t\telse $this->_login=\"anonymous\";\n\t\tif(!is_null($pass)) $this->_password=$pass;\n\t\telse $this->_password=\"anon@anon.com\";\n\t\tif(!$this->_exec(\"USER \".$this->_login, \"login\")) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\tif($this->_code!=230) {\n\t\t\tif(!$this->_exec((($this->_code==331)?\"PASS \":\"ACCT \").$this->_password, \"login\")) return FALSE;\n\t\t\tif(!$this->_checkCode()) return FALSE;\n\t\t}\n\t\t$this->SendMSG(\"Authentication succeeded\");\n\t\tif(empty($this->_features)) {\n\t\t\tif(!$this->features()) $this->SendMSG(\"Can't get features list. All supported - disabled\");\n\t\t\telse $this->SendMSG(\"Supported features: \".implode(\", \", array_keys($this->_features)));\n\t\t}\n\t\treturn TRUE;\n\t}\n\n\tfunction pwd() {\n\t\tif(!$this->_exec(\"PWD\", \"pwd\")) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\treturn preg_replace(\"/^[0-9]{3} \\\"(.+)\\\".*$/s\", \"\\\\1\", $this->_message);\n\t}\n\n\tfunction cdup() {\n\t\tif(!$this->_exec(\"CDUP\", \"cdup\")) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\treturn true;\n\t}\n\n\tfunction chdir($pathname) {\n\t\tif(!$this->_exec(\"CWD \".$pathname, \"chdir\")) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\treturn TRUE;\n\t}\n\n\tfunction rmdir($pathname) {\n\t\tif(!$this->_exec(\"RMD \".$pathname, \"rmdir\")) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\treturn TRUE;\n\t}\n\n\tfunction mkdir($pathname) {\n\t\tif(!$this->_exec(\"MKD \".$pathname, \"mkdir\")) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\treturn TRUE;\n\t}\n\n\tfunction rename($from, $to) {\n\t\tif(!$this->_exec(\"RNFR \".$from, \"rename\")) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\tif($this->_code==350) {\n\t\t\tif(!$this->_exec(\"RNTO \".$to, \"rename\")) return FALSE;\n\t\t\tif(!$this->_checkCode()) return FALSE;\n\t\t} else return FALSE;\n\t\treturn TRUE;\n\t}\n\n\tfunction filesize($pathname) {\n\t\tif(!isset($this->_features[\"SIZE\"])) {\n\t\t\t$this->PushError(\"filesize\", \"not supported by server\");\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(!$this->_exec(\"SIZE \".$pathname, \"filesize\")) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\treturn preg_replace(\"/^[0-9]{3} ([0-9]+).*$/s\", \"\\\\1\", $this->_message);\n\t}\n\n\tfunction abort() {\n\t\tif(!$this->_exec(\"ABOR\", \"abort\")) return FALSE;\n\t\tif(!$this->_checkCode()) {\n\t\t\tif($this->_code!=426) return FALSE;\n\t\t\tif(!$this->_readmsg(\"abort\")) return FALSE;\n\t\t\tif(!$this->_checkCode()) return FALSE;\n\t\t}\n\t\treturn true;\n\t}\n\n\tfunction mdtm($pathname) {\n\t\tif(!isset($this->_features[\"MDTM\"])) {\n\t\t\t$this->PushError(\"mdtm\", \"not supported by server\");\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(!$this->_exec(\"MDTM \".$pathname, \"mdtm\")) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\t$mdtm = preg_replace(\"/^[0-9]{3} ([0-9]+).*$/s\", \"\\\\1\", $this->_message);\n\t\t$date = sscanf($mdtm, \"%4d%2d%2d%2d%2d%2d\");\n\t\t$timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]);\n\t\treturn $timestamp;\n\t}\n\n\tfunction systype() {\n\t\tif(!$this->_exec(\"SYST\", \"systype\")) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\t$DATA = explode(\" \", $this->_message);\n\t\treturn array($DATA[1], $DATA[3]);\n\t}\n\n\tfunction delete($pathname) {\n\t\tif(!$this->_exec(\"DELE \".$pathname, \"delete\")) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\treturn TRUE;\n\t}\n\n\tfunction site($command, $fnction=\"site\") {\n\t\tif(!$this->_exec(\"SITE \".$command, $fnction)) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\treturn TRUE;\n\t}\n\n\tfunction chmod($pathname, $mode) {\n\t\tif(!$this->site( sprintf('CHMOD %o %s', $mode, $pathname), \"chmod\")) return FALSE;\n\t\treturn TRUE;\n\t}\n\n\tfunction restore($from) {\n\t\tif(!isset($this->_features[\"REST\"])) {\n\t\t\t$this->PushError(\"restore\", \"not supported by server\");\n\t\t\treturn FALSE;\n\t\t}\n\t\tif($this->_curtype!=FTP_BINARY) {\n\t\t\t$this->PushError(\"restore\", \"can't restore in ASCII mode\");\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(!$this->_exec(\"REST \".$from, \"resore\")) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\treturn TRUE;\n\t}\n\n\tfunction features() {\n\t\tif(!$this->_exec(\"FEAT\", \"features\")) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\t$f=preg_split(\"/[\".CRLF.\"]+/\", preg_replace(\"/[0-9]{3}[ -].*[\".CRLF.\"]+/\", \"\", $this->_message), -1, PREG_SPLIT_NO_EMPTY);\n\t\t$this->_features=array();\n\t\tforeach($f as $k=>$v) {\n\t\t\t$v=explode(\" \", trim($v));\n\t\t\t$this->_features[array_shift($v)]=$v;\n\t\t}\n\t\treturn true;\n\t}\n\n\tfunction rawlist($pathname=\"\", $arg=\"\") {\n\t\treturn $this->_list(($arg?\" \".$arg:\"\").($pathname?\" \".$pathname:\"\"), \"LIST\", \"rawlist\");\n\t}\n\n\tfunction nlist($pathname=\"\", $arg=\"\") {\n\t\treturn $this->_list(($arg?\" \".$arg:\"\").($pathname?\" \".$pathname:\"\"), \"NLST\", \"nlist\");\n\t}\n\n\tfunction is_exists($pathname) {\n\t\treturn $this->file_exists($pathname);\n\t}\n\n\tfunction file_exists($pathname) {\n\t\t$exists=true;\n\t\tif(!$this->_exec(\"RNFR \".$pathname, \"rename\")) $exists=FALSE;\n\t\telse {\n\t\t\tif(!$this->_checkCode()) $exists=FALSE;\n\t\t\t$this->abort();\n\t\t}\n\t\tif($exists) $this->SendMSG(\"Remote file \".$pathname.\" exists\");\n\t\telse $this->SendMSG(\"Remote file \".$pathname.\" does not exist\");\n\t\treturn $exists;\n\t}\n\n\tfunction fget($fp, $remotefile, $rest=0) {\n\t\tif($this->_can_restore and $rest!=0) fseek($fp, $rest);\n\t\t$pi=pathinfo($remotefile);\n\t\tif($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi[\"extension\"]), $this->AutoAsciiExt))) $mode=FTP_ASCII;\n\t\telse $mode=FTP_BINARY;\n\t\tif(!$this->_data_prepare($mode)) {\n\t\t\treturn FALSE;\n\t\t}\n\t\tif($this->_can_restore and $rest!=0) $this->restore($rest);\n\t\tif(!$this->_exec(\"RETR \".$remotefile, \"get\")) {\n\t\t\t$this->_data_close();\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(!$this->_checkCode()) {\n\t\t\t$this->_data_close();\n\t\t\treturn FALSE;\n\t\t}\n\t\t$out=$this->_data_read($mode, $fp);\n\t\t$this->_data_close();\n\t\tif(!$this->_readmsg()) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\treturn $out;\n\t}\n\n\tfunction get($remotefile, $localfile=NULL, $rest=0) {\n\t\tif(is_null($localfile)) $localfile=$remotefile;\n\t\tif (@file_exists($localfile)) $this->SendMSG(\"Warning : local file will be overwritten\");\n\t\t$fp = @fopen($localfile, \"w\");\n\t\tif (!$fp) {\n\t\t\t$this->PushError(\"get\",\"can't open local file\", \"Cannot create \\\"\".$localfile.\"\\\"\");\n\t\t\treturn FALSE;\n\t\t}\n\t\tif($this->_can_restore and $rest!=0) fseek($fp, $rest);\n\t\t$pi=pathinfo($remotefile);\n\t\tif($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi[\"extension\"]), $this->AutoAsciiExt))) $mode=FTP_ASCII;\n\t\telse $mode=FTP_BINARY;\n\t\tif(!$this->_data_prepare($mode)) {\n\t\t\tfclose($fp);\n\t\t\treturn FALSE;\n\t\t}\n\t\tif($this->_can_restore and $rest!=0) $this->restore($rest);\n\t\tif(!$this->_exec(\"RETR \".$remotefile, \"get\")) {\n\t\t\t$this->_data_close();\n\t\t\tfclose($fp);\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(!$this->_checkCode()) {\n\t\t\t$this->_data_close();\n\t\t\tfclose($fp);\n\t\t\treturn FALSE;\n\t\t}\n\t\t$out=$this->_data_read($mode, $fp);\n\t\tfclose($fp);\n\t\t$this->_data_close();\n\t\tif(!$this->_readmsg()) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\treturn $out;\n\t}\n\n\tfunction fput($remotefile, $fp, $rest=0) {\n\t\tif($this->_can_restore and $rest!=0) fseek($fp, $rest);\n\t\t$pi=pathinfo($remotefile);\n\t\tif($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi[\"extension\"]), $this->AutoAsciiExt))) $mode=FTP_ASCII;\n\t\telse $mode=FTP_BINARY;\n\t\tif(!$this->_data_prepare($mode)) {\n\t\t\treturn FALSE;\n\t\t}\n\t\tif($this->_can_restore and $rest!=0) $this->restore($rest);\n\t\tif(!$this->_exec(\"STOR \".$remotefile, \"put\")) {\n\t\t\t$this->_data_close();\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(!$this->_checkCode()) {\n\t\t\t$this->_data_close();\n\t\t\treturn FALSE;\n\t\t}\n\t\t$ret=$this->_data_write($mode, $fp);\n\t\t$this->_data_close();\n\t\tif(!$this->_readmsg()) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\treturn $ret;\n\t}\n\n\tfunction put($localfile, $remotefile=NULL, $rest=0) {\n\t\tif(is_null($remotefile)) $remotefile=$localfile;\n\t\tif (!file_exists($localfile)) {\n\t\t\t$this->PushError(\"put\",\"can't open local file\", \"No such file or directory \\\"\".$localfile.\"\\\"\");\n\t\t\treturn FALSE;\n\t\t}\n\t\t$fp = @fopen($localfile, \"r\");\n\n\t\tif (!$fp) {\n\t\t\t$this->PushError(\"put\",\"can't open local file\", \"Cannot read file \\\"\".$localfile.\"\\\"\");\n\t\t\treturn FALSE;\n\t\t}\n\t\tif($this->_can_restore and $rest!=0) fseek($fp, $rest);\n\t\t$pi=pathinfo($localfile);\n\t\tif($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi[\"extension\"]), $this->AutoAsciiExt))) $mode=FTP_ASCII;\n\t\telse $mode=FTP_BINARY;\n\t\tif(!$this->_data_prepare($mode)) {\n\t\t\tfclose($fp);\n\t\t\treturn FALSE;\n\t\t}\n\t\tif($this->_can_restore and $rest!=0) $this->restore($rest);\n\t\tif(!$this->_exec(\"STOR \".$remotefile, \"put\")) {\n\t\t\t$this->_data_close();\n\t\t\tfclose($fp);\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(!$this->_checkCode()) {\n\t\t\t$this->_data_close();\n\t\t\tfclose($fp);\n\t\t\treturn FALSE;\n\t\t}\n\t\t$ret=$this->_data_write($mode, $fp);\n\t\tfclose($fp);\n\t\t$this->_data_close();\n\t\tif(!$this->_readmsg()) return FALSE;\n\t\tif(!$this->_checkCode()) return FALSE;\n\t\treturn $ret;\n\t}\n\n\tfunction mput($local=\".\", $remote=NULL, $continious=false) {\n\t\t$local=realpath($local);\n\t\tif(!@file_exists($local)) {\n\t\t\t$this->PushError(\"mput\",\"can't open local folder\", \"Cannot stat folder \\\"\".$local.\"\\\"\");\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(!is_dir($local)) return $this->put($local, $remote);\n\t\tif(empty($remote)) $remote=\".\";\n\t\telseif(!$this->file_exists($remote) and !$this->mkdir($remote)) return FALSE;\n\t\tif($handle = opendir($local)) {\n\t\t\t$list=array();\n\t\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\t\tif ($file != \".\" && $file != \"..\") $list[]=$file;\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t} else {\n\t\t\t$this->PushError(\"mput\",\"can't open local folder\", \"Cannot read folder \\\"\".$local.\"\\\"\");\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(empty($list)) return TRUE;\n\t\t$ret=true;\n\t\tforeach($list as $el) {\n\t\t\tif(is_dir($local.\"/\".$el)) $t=$this->mput($local.\"/\".$el, $remote.\"/\".$el);\n\t\t\telse $t=$this->put($local.\"/\".$el, $remote.\"/\".$el);\n\t\t\tif(!$t) {\n\t\t\t\t$ret=FALSE;\n\t\t\t\tif(!$continious) break;\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\n\t}\n\n\tfunction mget($remote, $local=\".\", $continious=false) {\n\t\t$list=$this->rawlist($remote, \"-lA\");\n\t\tif($list===false) {\n\t\t\t$this->PushError(\"mget\",\"can't read remote folder list\", \"Can't read remote folder \\\"\".$remote.\"\\\" contents\");\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(empty($list)) return true;\n\t\tif(!@file_exists($local)) {\n\t\t\tif(!@mkdir($local)) {\n\t\t\t\t$this->PushError(\"mget\",\"can't create local folder\", \"Cannot create folder \\\"\".$local.\"\\\"\");\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\tforeach($list as $k=>$v) {\n\t\t\t$list[$k]=$this->parselisting($v);\n\t\t\tif( ! $list[$k] or $list[$k][\"name\"]==\".\" or $list[$k][\"name\"]==\"..\") unset($list[$k]);\n\t\t}\n\t\t$ret=true;\n\t\tforeach($list as $el) {\n\t\t\tif($el[\"type\"]==\"d\") {\n\t\t\t\tif(!$this->mget($remote.\"/\".$el[\"name\"], $local.\"/\".$el[\"name\"], $continious)) {\n\t\t\t\t\t$this->PushError(\"mget\", \"can't copy folder\", \"Can't copy remote folder \\\"\".$remote.\"/\".$el[\"name\"].\"\\\" to local \\\"\".$local.\"/\".$el[\"name\"].\"\\\"\");\n\t\t\t\t\t$ret=false;\n\t\t\t\t\tif(!$continious) break;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(!$this->get($remote.\"/\".$el[\"name\"], $local.\"/\".$el[\"name\"])) {\n\t\t\t\t\t$this->PushError(\"mget\", \"can't copy file\", \"Can't copy remote file \\\"\".$remote.\"/\".$el[\"name\"].\"\\\" to local \\\"\".$local.\"/\".$el[\"name\"].\"\\\"\");\n\t\t\t\t\t$ret=false;\n\t\t\t\t\tif(!$continious) break;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@chmod($local.\"/\".$el[\"name\"], $el[\"perms\"]);\n\t\t\t$t=strtotime($el[\"date\"]);\n\t\t\tif($t!==-1 and $t!==false) @touch($local.\"/\".$el[\"name\"], $t);\n\t\t}\n\t\treturn $ret;\n\t}\n\n\tfunction mdel($remote, $continious=false) {\n\t\t$list=$this->rawlist($remote, \"-la\");\n\t\tif($list===false) {\n\t\t\t$this->PushError(\"mdel\",\"can't read remote folder list\", \"Can't read remote folder \\\"\".$remote.\"\\\" contents\");\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach($list as $k=>$v) {\n\t\t\t$list[$k]=$this->parselisting($v);\n\t\t\tif( ! $list[$k] or $list[$k][\"name\"]==\".\" or $list[$k][\"name\"]==\"..\") unset($list[$k]);\n\t\t}\n\t\t$ret=true;\n\n\t\tforeach($list as $el) {\n\t\t\tif ( empty($el) )\n\t\t\t\tcontinue;\n\n\t\t\tif($el[\"type\"]==\"d\") {\n\t\t\t\tif(!$this->mdel($remote.\"/\".$el[\"name\"], $continious)) {\n\t\t\t\t\t$ret=false;\n\t\t\t\t\tif(!$continious) break;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!$this->delete($remote.\"/\".$el[\"name\"])) {\n\t\t\t\t\t$this->PushError(\"mdel\", \"can't delete file\", \"Can't delete remote file \\\"\".$remote.\"/\".$el[\"name\"].\"\\\"\");\n\t\t\t\t\t$ret=false;\n\t\t\t\t\tif(!$continious) break;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(!$this->rmdir($remote)) {\n\t\t\t$this->PushError(\"mdel\", \"can't delete folder\", \"Can't delete remote folder \\\"\".$remote.\"/\".$el[\"name\"].\"\\\"\");\n\t\t\t$ret=false;\n\t\t}\n\t\treturn $ret;\n\t}\n\n\tfunction mmkdir($dir, $mode = 0777) {\n\t\tif(empty($dir)) return FALSE;\n\t\tif($this->is_exists($dir) or $dir == \"/\" ) return TRUE;\n\t\tif(!$this->mmkdir(dirname($dir), $mode)) return false;\n\t\t$r=$this->mkdir($dir, $mode);\n\t\t$this->chmod($dir,$mode);\n\t\treturn $r;\n\t}\n\n\tfunction glob($pattern, $handle=NULL) {\n\t\t$path=$output=null;\n\t\tif(PHP_OS=='WIN32') $slash='\\\\';\n\t\telse $slash='/';\n\t\t$lastpos=strrpos($pattern,$slash);\n\t\tif(!($lastpos===false)) {\n\t\t\t$path=substr($pattern,0,-$lastpos-1);\n\t\t\t$pattern=substr($pattern,$lastpos);\n\t\t} else $path=getcwd();\n\t\tif(is_array($handle) and !empty($handle)) {\n\t\t\tforeach($handle as $dir) {\n\t\t\t\tif($this->glob_pattern_match($pattern,$dir))\n\t\t\t\t$output[]=$dir;\n\t\t\t}\n\t\t} else {\n\t\t\t$handle=@opendir($path);\n\t\t\tif($handle===false) return false;\n\t\t\twhile($dir=readdir($handle)) {\n\t\t\t\tif($this->glob_pattern_match($pattern,$dir))\n\t\t\t\t$output[]=$dir;\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t\tif(is_array($output)) return $output;\n\t\treturn false;\n\t}\n\n\tfunction glob_pattern_match($pattern,$string) {\n\t\t$out=null;\n\t\t$chunks=explode(';',$pattern);\n\t\tforeach($chunks as $pattern) {\n\t\t\t$escape=array('$','^','.','{','}','(',')','[',']','|');\n\t\t\twhile(strpos($pattern,'**')!==false)\n\t\t\t\t$pattern=str_replace('**','*',$pattern);\n\t\t\tforeach($escape as $probe)\n\t\t\t\t$pattern=str_replace($probe,\"\\\\$probe\",$pattern);\n\t\t\t$pattern=str_replace('?*','*',\n\t\t\t\tstr_replace('*?','*',\n\t\t\t\t\tstr_replace('*',\".*\",\n\t\t\t\t\t\tstr_replace('?','.{1,1}',$pattern))));\n\t\t\t$out[]=$pattern;\n\t\t}\n\t\tif(count($out)==1) return($this->glob_regexp(\"^$out[0]$\",$string));\n\t\telse {\n\t\t\tforeach($out as $tester)\n\t\t\t\tif($this->my_regexp(\"^$tester$\",$string)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction glob_regexp($pattern,$probe) {\n\t\t$sensitive=(PHP_OS!='WIN32');\n\t\treturn ($sensitive?\n\t\t\tpreg_match( '/' . preg_quote( $pattern, '/' ) . '/', $probe ) :\n\t\t\tpreg_match( '/' . preg_quote( $pattern, '/' ) . '/i', $probe )\n\t\t);\n\t}\n\n\tfunction dirlist($remote) {\n\t\t$list=$this->rawlist($remote, \"-la\");\n\t\tif($list===false) {\n\t\t\t$this->PushError(\"dirlist\",\"can't read remote folder list\", \"Can't read remote folder \\\"\".$remote.\"\\\" contents\");\n\t\t\treturn false;\n\t\t}\n\n\t\t$dirlist = array();\n\t\tforeach($list as $k=>$v) {\n\t\t\t$entry=$this->parselisting($v);\n\t\t\tif ( empty($entry) )\n\t\t\t\tcontinue;\n\n\t\t\tif($entry[\"name\"]==\".\" or $entry[\"name\"]==\"..\")\n\t\t\t\tcontinue;\n\n\t\t\t$dirlist[$entry['name']] = $entry;\n\t\t}\n\n\t\treturn $dirlist;\n\t}\n// <!-- --------------------------------------------------------------------------------------- -->\n// <!--       Private functions                                                                 -->\n// <!-- --------------------------------------------------------------------------------------- -->\n\tfunction _checkCode() {\n\t\treturn ($this->_code<400 and $this->_code>0);\n\t}\n\n\tfunction _list($arg=\"\", $cmd=\"LIST\", $fnction=\"_list\") {\n\t\tif(!$this->_data_prepare()) return false;\n\t\tif(!$this->_exec($cmd.$arg, $fnction)) {\n\t\t\t$this->_data_close();\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(!$this->_checkCode()) {\n\t\t\t$this->_data_close();\n\t\t\treturn FALSE;\n\t\t}\n\t\t$out=\"\";\n\t\tif($this->_code<200) {\n\t\t\t$out=$this->_data_read();\n\t\t\t$this->_data_close();\n\t\t\tif(!$this->_readmsg()) return FALSE;\n\t\t\tif(!$this->_checkCode()) return FALSE;\n\t\t\tif($out === FALSE ) return FALSE;\n\t\t\t$out=preg_split(\"/[\".CRLF.\"]+/\", $out, -1, PREG_SPLIT_NO_EMPTY);\n//\t\t\t$this->SendMSG(implode($this->_eol_code[$this->OS_local], $out));\n\t\t}\n\t\treturn $out;\n\t}\n\n// <!-- --------------------------------------------------------------------------------------- -->\n// <!-- Partie : gestion des erreurs                                                            -->\n// <!-- --------------------------------------------------------------------------------------- -->\n// Gnre une erreur pour traitement externe  la classe\n\tfunction PushError($fctname,$msg,$desc=false){\n\t\t$error=array();\n\t\t$error['time']=time();\n\t\t$error['fctname']=$fctname;\n\t\t$error['msg']=$msg;\n\t\t$error['desc']=$desc;\n\t\tif($desc) $tmp=' ('.$desc.')'; else $tmp='';\n\t\t$this->SendMSG($fctname.': '.$msg.$tmp);\n\t\treturn(array_push($this->_error_array,$error));\n\t}\n\n// Rcupre une erreur externe\n\tfunction PopError(){\n\t\tif(count($this->_error_array)) return(array_pop($this->_error_array));\n\t\t\telse return(false);\n\t}\n}\n\n$mod_sockets = extension_loaded( 'sockets' );\nif ( ! $mod_sockets && function_exists( 'dl' ) && is_callable( 'dl' ) ) {\n\t$prefix = ( PHP_SHLIB_SUFFIX == 'dll' ) ? 'php_' : '';\n\t@dl( $prefix . 'sockets.' . PHP_SHLIB_SUFFIX ); // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.dlDeprecated\n\t$mod_sockets = extension_loaded( 'sockets' );\n}\n\nrequire_once __DIR__ . \"/class-ftp-\" . ( $mod_sockets ? \"sockets\" : \"pure\" ) . \".php\";\n\nif ( $mod_sockets ) {\n\tclass ftp extends ftp_sockets {}\n} else {\n\tclass ftp extends ftp_pure {}\n}\n", "num_lines": 913}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrader API: Language_Pack_Upgrader_Skin class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Translation Upgrader Skin for WordPress Translation Upgrades.\n *\n * @since 3.7.0\n * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.\n *\n * @see WP_Upgrader_Skin\n */\nclass Language_Pack_Upgrader_Skin extends WP_Upgrader_Skin {\n\tpublic $language_update        = null;\n\tpublic $done_header            = false;\n\tpublic $done_footer            = false;\n\tpublic $display_footer_actions = true;\n\n\t/**\n\t * @param array $args\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\t$defaults = array(\n\t\t\t'url'                => '',\n\t\t\t'nonce'              => '',\n\t\t\t'title'              => __( 'Update Translations' ),\n\t\t\t'skip_header_footer' => false,\n\t\t);\n\t\t$args     = wp_parse_args( $args, $defaults );\n\t\tif ( $args['skip_header_footer'] ) {\n\t\t\t$this->done_header            = true;\n\t\t\t$this->done_footer            = true;\n\t\t\t$this->display_footer_actions = false;\n\t\t}\n\t\tparent::__construct( $args );\n\t}\n\n\t/**\n\t */\n\tpublic function before() {\n\t\t$name = $this->upgrader->get_name_for_update( $this->language_update );\n\n\t\techo '<div class=\"update-messages lp-show-latest\">';\n\n\t\t/* translators: 1: Project name (plugin, theme, or WordPress), 2: Language. */\n\t\tprintf( '<h2>' . __( 'Updating translations for %1$s (%2$s)&#8230;' ) . '</h2>', $name, $this->language_update->language );\n\t}\n\n\t/**\n\t * @param string|WP_Error $error\n\t */\n\tpublic function error( $error ) {\n\t\techo '<div class=\"lp-error\">';\n\t\tparent::error( $error );\n\t\techo '</div>';\n\t}\n\n\t/**\n\t */\n\tpublic function after() {\n\t\techo '</div>';\n\t}\n\n\t/**\n\t */\n\tpublic function bulk_footer() {\n\t\t$this->decrement_update_count( 'translation' );\n\n\t\t$update_actions = array(\n\t\t\t'updates_page' => sprintf(\n\t\t\t\t'<a href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t__( 'Return to WordPress Updates page' )\n\t\t\t),\n\t\t);\n\n\t\t/**\n\t\t * Filters the list of action links available following a translations update.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param string[] $update_actions Array of translations update links.\n\t\t */\n\t\t$update_actions = apply_filters( 'update_translations_complete_actions', $update_actions );\n\n\t\tif ( $update_actions && $this->display_footer_actions ) {\n\t\t\t$this->feedback( implode( ' | ', $update_actions ) );\n\t\t}\n\t}\n}\n", "num_lines": 96}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrade API: Language_Pack_Upgrader class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Core class used for updating/installing language packs (translations)\n * for plugins, themes, and core.\n *\n * @since 3.7.0\n * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php.\n *\n * @see WP_Upgrader\n */\nclass Language_Pack_Upgrader extends WP_Upgrader {\n\n\t/**\n\t * Result of the language pack upgrade.\n\t *\n\t * @since 3.7.0\n\t * @var array|WP_Error $result\n\t * @see WP_Upgrader::$result\n\t */\n\tpublic $result;\n\n\t/**\n\t * Whether a bulk upgrade/installation is being performed.\n\t *\n\t * @since 3.7.0\n\t * @var bool $bulk\n\t */\n\tpublic $bulk = true;\n\n\t/**\n\t * Asynchronously upgrades language packs after other upgrades have been made.\n\t *\n\t * Hooked to the {@see 'upgrader_process_complete'} action by default.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param false|WP_Upgrader $upgrader Optional. WP_Upgrader instance or false. If `$upgrader` is\n\t *                                    a Language_Pack_Upgrader instance, the method will bail to\n\t *                                    avoid recursion. Otherwise unused. Default false.\n\t */\n\tpublic static function async_upgrade( $upgrader = false ) {\n\t\t// Avoid recursion.\n\t\tif ( $upgrader && $upgrader instanceof Language_Pack_Upgrader ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Nothing to do?\n\t\t$language_updates = wp_get_translation_updates();\n\t\tif ( ! $language_updates ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Avoid messing with VCS installations, at least for now.\n\t\t * Noted: this is not the ideal way to accomplish this.\n\t\t */\n\t\t$check_vcs = new WP_Automatic_Updater;\n\t\tif ( $check_vcs->is_vcs_checkout( WP_CONTENT_DIR ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $language_updates as $key => $language_update ) {\n\t\t\t$update = ! empty( $language_update->autoupdate );\n\n\t\t\t/**\n\t\t\t * Filters whether to asynchronously update translation for core, a plugin, or a theme.\n\t\t\t *\n\t\t\t * @since 4.0.0\n\t\t\t *\n\t\t\t * @param bool   $update          Whether to update.\n\t\t\t * @param object $language_update The update offer.\n\t\t\t */\n\t\t\t$update = apply_filters( 'async_update_translation', $update, $language_update );\n\n\t\t\tif ( ! $update ) {\n\t\t\t\tunset( $language_updates[ $key ] );\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $language_updates ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Re-use the automatic upgrader skin if the parent upgrader is using it.\n\t\tif ( $upgrader && $upgrader->skin instanceof Automatic_Upgrader_Skin ) {\n\t\t\t$skin = $upgrader->skin;\n\t\t} else {\n\t\t\t$skin = new Language_Pack_Upgrader_Skin(\n\t\t\t\tarray(\n\t\t\t\t\t'skip_header_footer' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$lp_upgrader = new Language_Pack_Upgrader( $skin );\n\t\t$lp_upgrader->bulk_upgrade( $language_updates );\n\t}\n\n\t/**\n\t * Initialize the upgrade strings.\n\t *\n\t * @since 3.7.0\n\t */\n\tpublic function upgrade_strings() {\n\t\t$this->strings['starting_upgrade'] = __( 'Some of your translations need updating. Sit tight for a few more seconds while we update them as well.' );\n\t\t$this->strings['up_to_date']       = __( 'Your translations are all up to date.' );\n\t\t$this->strings['no_package']       = __( 'Update package not available.' );\n\t\t/* translators: %s: Package URL. */\n\t\t$this->strings['downloading_package'] = sprintf( __( 'Downloading translation from %s&#8230;' ), '<span class=\"code\">%s</span>' );\n\t\t$this->strings['unpack_package']      = __( 'Unpacking the update&#8230;' );\n\t\t$this->strings['process_failed']      = __( 'Translation update failed.' );\n\t\t$this->strings['process_success']     = __( 'Translation updated successfully.' );\n\t\t$this->strings['remove_old']          = __( 'Removing the old version of the translation&#8230;' );\n\t\t$this->strings['remove_old_failed']   = __( 'Could not remove the old translation.' );\n\t}\n\n\t/**\n\t * Upgrade a language pack.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param string|false $update Optional. Whether an update offer is available. Default false.\n\t * @param array        $args   Optional. Other optional arguments, see\n\t *                             Language_Pack_Upgrader::bulk_upgrade(). Default empty array.\n\t * @return array|bool|WP_Error The result of the upgrade, or a WP_Error object instead.\n\t */\n\tpublic function upgrade( $update = false, $args = array() ) {\n\t\tif ( $update ) {\n\t\t\t$update = array( $update );\n\t\t}\n\n\t\t$results = $this->bulk_upgrade( $update, $args );\n\n\t\tif ( ! is_array( $results ) ) {\n\t\t\treturn $results;\n\t\t}\n\n\t\treturn $results[0];\n\t}\n\n\t/**\n\t * Bulk upgrade language packs.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n\t *\n\t * @param object[] $language_updates Optional. Array of language packs to update. @see wp_get_translation_updates().\n\t *                                   Default empty array.\n\t * @param array    $args {\n\t *     Other arguments for upgrading multiple language packs. Default empty array.\n\t *\n\t *     @type bool $clear_update_cache Whether to clear the update cache when done.\n\t *                                    Default true.\n\t * }\n\t * @return array|bool|WP_Error Will return an array of results, or true if there are no updates,\n\t *                             false or WP_Error for initial errors.\n\t */\n\tpublic function bulk_upgrade( $language_updates = array(), $args = array() ) {\n\t\tglobal $wp_filesystem;\n\n\t\t$defaults    = array(\n\t\t\t'clear_update_cache' => true,\n\t\t);\n\t\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t\t$this->init();\n\t\t$this->upgrade_strings();\n\n\t\tif ( ! $language_updates ) {\n\t\t\t$language_updates = wp_get_translation_updates();\n\t\t}\n\n\t\tif ( empty( $language_updates ) ) {\n\t\t\t$this->skin->header();\n\t\t\t$this->skin->set_result( true );\n\t\t\t$this->skin->feedback( 'up_to_date' );\n\t\t\t$this->skin->bulk_footer();\n\t\t\t$this->skin->footer();\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( 'upgrader_process_complete' === current_filter() ) {\n\t\t\t$this->skin->feedback( 'starting_upgrade' );\n\t\t}\n\n\t\t// Remove any existing upgrade filters from the plugin/theme upgraders #WP29425 & #WP29230.\n\t\tremove_all_filters( 'upgrader_pre_install' );\n\t\tremove_all_filters( 'upgrader_clear_destination' );\n\t\tremove_all_filters( 'upgrader_post_install' );\n\t\tremove_all_filters( 'upgrader_source_selection' );\n\n\t\tadd_filter( 'upgrader_source_selection', array( $this, 'check_package' ), 10, 2 );\n\n\t\t$this->skin->header();\n\n\t\t// Connect to the filesystem first.\n\t\t$res = $this->fs_connect( array( WP_CONTENT_DIR, WP_LANG_DIR ) );\n\t\tif ( ! $res ) {\n\t\t\t$this->skin->footer();\n\t\t\treturn false;\n\t\t}\n\n\t\t$results = array();\n\n\t\t$this->update_count   = count( $language_updates );\n\t\t$this->update_current = 0;\n\n\t\t/*\n\t\t * The filesystem's mkdir() is not recursive. Make sure WP_LANG_DIR exists,\n\t\t * as we then may need to create a /plugins or /themes directory inside of it.\n\t\t */\n\t\t$remote_destination = $wp_filesystem->find_folder( WP_LANG_DIR );\n\t\tif ( ! $wp_filesystem->exists( $remote_destination ) ) {\n\t\t\tif ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) ) {\n\t\t\t\treturn new WP_Error( 'mkdir_failed_lang_dir', $this->strings['mkdir_failed'], $remote_destination );\n\t\t\t}\n\t\t}\n\n\t\t$language_updates_results = array();\n\n\t\tforeach ( $language_updates as $language_update ) {\n\n\t\t\t$this->skin->language_update = $language_update;\n\n\t\t\t$destination = WP_LANG_DIR;\n\t\t\tif ( 'plugin' === $language_update->type ) {\n\t\t\t\t$destination .= '/plugins';\n\t\t\t} elseif ( 'theme' === $language_update->type ) {\n\t\t\t\t$destination .= '/themes';\n\t\t\t}\n\n\t\t\t$this->update_current++;\n\n\t\t\t$options = array(\n\t\t\t\t'package'                     => $language_update->package,\n\t\t\t\t'destination'                 => $destination,\n\t\t\t\t'clear_destination'           => true,\n\t\t\t\t'abort_if_destination_exists' => false, // We expect the destination to exist.\n\t\t\t\t'clear_working'               => true,\n\t\t\t\t'is_multi'                    => true,\n\t\t\t\t'hook_extra'                  => array(\n\t\t\t\t\t'language_update_type' => $language_update->type,\n\t\t\t\t\t'language_update'      => $language_update,\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t$result = $this->run( $options );\n\n\t\t\t$results[] = $this->result;\n\n\t\t\t// Prevent credentials auth screen from displaying multiple times.\n\t\t\tif ( false === $result ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$language_updates_results[] = array(\n\t\t\t\t'language' => $language_update->language,\n\t\t\t\t'type'     => $language_update->type,\n\t\t\t\t'slug'     => isset( $language_update->slug ) ? $language_update->slug : 'default',\n\t\t\t\t'version'  => $language_update->version,\n\t\t\t);\n\t\t}\n\n\t\t// Remove upgrade hooks which are not required for translation updates.\n\t\tremove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );\n\t\tremove_action( 'upgrader_process_complete', 'wp_version_check' );\n\t\tremove_action( 'upgrader_process_complete', 'wp_update_plugins' );\n\t\tremove_action( 'upgrader_process_complete', 'wp_update_themes' );\n\n\t\t/** This action is documented in wp-admin/includes/class-wp-upgrader.php */\n\t\tdo_action(\n\t\t\t'upgrader_process_complete',\n\t\t\t$this,\n\t\t\tarray(\n\t\t\t\t'action'       => 'update',\n\t\t\t\t'type'         => 'translation',\n\t\t\t\t'bulk'         => true,\n\t\t\t\t'translations' => $language_updates_results,\n\t\t\t)\n\t\t);\n\n\t\t// Re-add upgrade hooks.\n\t\tadd_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );\n\t\tadd_action( 'upgrader_process_complete', 'wp_version_check', 10, 0 );\n\t\tadd_action( 'upgrader_process_complete', 'wp_update_plugins', 10, 0 );\n\t\tadd_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 );\n\n\t\t$this->skin->bulk_footer();\n\n\t\t$this->skin->footer();\n\n\t\t// Clean up our hooks, in case something else does an upgrade on this connection.\n\t\tremove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );\n\n\t\tif ( $parsed_args['clear_update_cache'] ) {\n\t\t\twp_clean_update_cache();\n\t\t}\n\n\t\treturn $results;\n\t}\n\n\t/**\n\t * Check the package source to make sure there are .mo and .po files.\n\t *\n\t * Hooked to the {@see 'upgrader_source_selection'} filter by\n\t * Language_Pack_Upgrader::bulk_upgrade().\n\t *\n\t * @since 3.7.0\n\t *\n\t * @global WP_Filesystem_Base $wp_filesystem Subclass\n\t *\n\t * @param string|WP_Error $source\n\t * @param string          $remote_source\n\t */\n\tpublic function check_package( $source, $remote_source ) {\n\t\tglobal $wp_filesystem;\n\n\t\tif ( is_wp_error( $source ) ) {\n\t\t\treturn $source;\n\t\t}\n\n\t\t// Check that the folder contains a valid language.\n\t\t$files = $wp_filesystem->dirlist( $remote_source );\n\n\t\t// Check to see if a .po and .mo exist in the folder.\n\t\t$po = false;\n\t\t$mo = false;\n\t\tforeach ( (array) $files as $file => $filedata ) {\n\t\t\tif ( '.po' === substr( $file, -3 ) ) {\n\t\t\t\t$po = true;\n\t\t\t} elseif ( '.mo' === substr( $file, -3 ) ) {\n\t\t\t\t$mo = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $mo || ! $po ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'incompatible_archive_pomo',\n\t\t\t\t$this->strings['incompatible_archive'],\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: .po, 2: .mo */\n\t\t\t\t\t__( 'The language pack is missing either the %1$s or %2$s files.' ),\n\t\t\t\t\t'<code>.po</code>',\n\t\t\t\t\t'<code>.mo</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn $source;\n\t}\n\n\t/**\n\t * Get the name of an item being updated.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param object $update The data for an update.\n\t * @return string The name of the item being updated.\n\t */\n\tpublic function get_name_for_update( $update ) {\n\t\tswitch ( $update->type ) {\n\t\t\tcase 'core':\n\t\t\t\treturn 'WordPress'; // Not translated.\n\n\t\t\tcase 'theme':\n\t\t\t\t$theme = wp_get_theme( $update->slug );\n\t\t\t\tif ( $theme->exists() ) {\n\t\t\t\t\treturn $theme->Get( 'Name' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'plugin':\n\t\t\t\t$plugin_data = get_plugins( '/' . $update->slug );\n\t\t\t\t$plugin_data = reset( $plugin_data );\n\t\t\t\tif ( $plugin_data ) {\n\t\t\t\t\treturn $plugin_data['Name'];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\treturn '';\n\t}\n\n\t/**\n\t * Clears existing translations where this item is going to be installed into.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n\t *\n\t * @param string $remote_destination The location on the remote filesystem to be cleared.\n\t * @return bool|WP_Error True upon success, WP_Error on failure.\n\t */\n\tpublic function clear_destination( $remote_destination ) {\n\t\tglobal $wp_filesystem;\n\n\t\t$language_update    = $this->skin->language_update;\n\t\t$language_directory = WP_LANG_DIR . '/'; // Local path for use with glob().\n\n\t\tif ( 'core' === $language_update->type ) {\n\t\t\t$files = array(\n\t\t\t\t$remote_destination . $language_update->language . '.po',\n\t\t\t\t$remote_destination . $language_update->language . '.mo',\n\t\t\t\t$remote_destination . 'admin-' . $language_update->language . '.po',\n\t\t\t\t$remote_destination . 'admin-' . $language_update->language . '.mo',\n\t\t\t\t$remote_destination . 'admin-network-' . $language_update->language . '.po',\n\t\t\t\t$remote_destination . 'admin-network-' . $language_update->language . '.mo',\n\t\t\t\t$remote_destination . 'continents-cities-' . $language_update->language . '.po',\n\t\t\t\t$remote_destination . 'continents-cities-' . $language_update->language . '.mo',\n\t\t\t);\n\n\t\t\t$json_translation_files = glob( $language_directory . $language_update->language . '-*.json' );\n\t\t\tif ( $json_translation_files ) {\n\t\t\t\tforeach ( $json_translation_files as $json_translation_file ) {\n\t\t\t\t\t$files[] = str_replace( $language_directory, $remote_destination, $json_translation_file );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$files = array(\n\t\t\t\t$remote_destination . $language_update->slug . '-' . $language_update->language . '.po',\n\t\t\t\t$remote_destination . $language_update->slug . '-' . $language_update->language . '.mo',\n\t\t\t);\n\n\t\t\t$language_directory     = $language_directory . $language_update->type . 's/';\n\t\t\t$json_translation_files = glob( $language_directory . $language_update->slug . '-' . $language_update->language . '-*.json' );\n\t\t\tif ( $json_translation_files ) {\n\t\t\t\tforeach ( $json_translation_files as $json_translation_file ) {\n\t\t\t\t\t$files[] = str_replace( $language_directory, $remote_destination, $json_translation_file );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$files = array_filter( $files, array( $wp_filesystem, 'exists' ) );\n\n\t\t// No files to delete.\n\t\tif ( ! $files ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Check all files are writable before attempting to clear the destination.\n\t\t$unwritable_files = array();\n\n\t\t// Check writability.\n\t\tforeach ( $files as $file ) {\n\t\t\tif ( ! $wp_filesystem->is_writable( $file ) ) {\n\t\t\t\t// Attempt to alter permissions to allow writes and try again.\n\t\t\t\t$wp_filesystem->chmod( $file, FS_CHMOD_FILE );\n\t\t\t\tif ( ! $wp_filesystem->is_writable( $file ) ) {\n\t\t\t\t\t$unwritable_files[] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $unwritable_files ) ) {\n\t\t\treturn new WP_Error( 'files_not_writable', $this->strings['files_not_writable'], implode( ', ', $unwritable_files ) );\n\t\t}\n\n\t\tforeach ( $files as $file ) {\n\t\t\tif ( ! $wp_filesystem->delete( $file ) ) {\n\t\t\t\treturn new WP_Error( 'remove_old_failed', $this->strings['remove_old_failed'] );\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n}\n", "num_lines": 474}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n// --------------------------------------------------------------------------------\n// PhpConcept Library - Zip Module 2.8.2\n// --------------------------------------------------------------------------------\n// License GNU/LGPL - Vincent Blavet - August 2009\n// http://www.phpconcept.net\n// --------------------------------------------------------------------------------\n//\n// Presentation :\n//   PclZip is a PHP library that manage ZIP archives.\n//   So far tests show that archives generated by PclZip are readable by\n//   WinZip application and other tools.\n//\n// Description :\n//   See readme.txt and http://www.phpconcept.net\n//\n// Warning :\n//   This library and the associated files are non commercial, non professional\n//   work.\n//   It should not have unexpected results. However if any damage is caused by\n//   this software the author can not be responsible.\n//   The use of this software is at the risk of the user.\n//\n// --------------------------------------------------------------------------------\n// $Id: pclzip.lib.php,v 1.60 2009/09/30 21:01:04 vblavet Exp $\n// --------------------------------------------------------------------------------\n\n  // ----- Constants\n  if (!defined('PCLZIP_READ_BLOCK_SIZE')) {\n    define( 'PCLZIP_READ_BLOCK_SIZE', 2048 );\n  }\n\n  // ----- File list separator\n  // In version 1.x of PclZip, the separator for file list is a space\n  // (which is not a very smart choice, specifically for windows paths !).\n  // A better separator should be a comma (,). This constant gives you the\n  // ability to change that.\n  // However notice that changing this value, may have impact on existing\n  // scripts, using space separated filenames.\n  // Recommended values for compatibility with older versions :\n  //define( 'PCLZIP_SEPARATOR', ' ' );\n  // Recommended values for smart separation of filenames.\n  if (!defined('PCLZIP_SEPARATOR')) {\n    define( 'PCLZIP_SEPARATOR', ',' );\n  }\n\n  // ----- Error configuration\n  // 0 : PclZip Class integrated error handling\n  // 1 : PclError external library error handling. By enabling this\n  //     you must ensure that you have included PclError library.\n  // [2,...] : reserved for futur use\n  if (!defined('PCLZIP_ERROR_EXTERNAL')) {\n    define( 'PCLZIP_ERROR_EXTERNAL', 0 );\n  }\n\n  // ----- Optional static temporary directory\n  //       By default temporary files are generated in the script current\n  //       path.\n  //       If defined :\n  //       - MUST BE terminated by a '/'.\n  //       - MUST be a valid, already created directory\n  //       Samples :\n  // define( 'PCLZIP_TEMPORARY_DIR', '/temp/' );\n  // define( 'PCLZIP_TEMPORARY_DIR', 'C:/Temp/' );\n  if (!defined('PCLZIP_TEMPORARY_DIR')) {\n    define( 'PCLZIP_TEMPORARY_DIR', '' );\n  }\n\n  // ----- Optional threshold ratio for use of temporary files\n  //       Pclzip sense the size of the file to add/extract and decide to\n  //       use or not temporary file. The algorithm is looking for\n  //       memory_limit of PHP and apply a ratio.\n  //       threshold = memory_limit * ratio.\n  //       Recommended values are under 0.5. Default 0.47.\n  //       Samples :\n  // define( 'PCLZIP_TEMPORARY_FILE_RATIO', 0.5 );\n  if (!defined('PCLZIP_TEMPORARY_FILE_RATIO')) {\n    define( 'PCLZIP_TEMPORARY_FILE_RATIO', 0.47 );\n  }\n\n// --------------------------------------------------------------------------------\n// ***** UNDER THIS LINE NOTHING NEEDS TO BE MODIFIED *****\n// --------------------------------------------------------------------------------\n\n  // ----- Global variables\n  $g_pclzip_version = \"2.8.2\";\n\n  // ----- Error codes\n  //   -1 : Unable to open file in binary write mode\n  //   -2 : Unable to open file in binary read mode\n  //   -3 : Invalid parameters\n  //   -4 : File does not exist\n  //   -5 : Filename is too long (max. 255)\n  //   -6 : Not a valid zip file\n  //   -7 : Invalid extracted file size\n  //   -8 : Unable to create directory\n  //   -9 : Invalid archive extension\n  //  -10 : Invalid archive format\n  //  -11 : Unable to delete file (unlink)\n  //  -12 : Unable to rename file (rename)\n  //  -13 : Invalid header checksum\n  //  -14 : Invalid archive size\n  define( 'PCLZIP_ERR_USER_ABORTED', 2 );\n  define( 'PCLZIP_ERR_NO_ERROR', 0 );\n  define( 'PCLZIP_ERR_WRITE_OPEN_FAIL', -1 );\n  define( 'PCLZIP_ERR_READ_OPEN_FAIL', -2 );\n  define( 'PCLZIP_ERR_INVALID_PARAMETER', -3 );\n  define( 'PCLZIP_ERR_MISSING_FILE', -4 );\n  define( 'PCLZIP_ERR_FILENAME_TOO_LONG', -5 );\n  define( 'PCLZIP_ERR_INVALID_ZIP', -6 );\n  define( 'PCLZIP_ERR_BAD_EXTRACTED_FILE', -7 );\n  define( 'PCLZIP_ERR_DIR_CREATE_FAIL', -8 );\n  define( 'PCLZIP_ERR_BAD_EXTENSION', -9 );\n  define( 'PCLZIP_ERR_BAD_FORMAT', -10 );\n  define( 'PCLZIP_ERR_DELETE_FILE_FAIL', -11 );\n  define( 'PCLZIP_ERR_RENAME_FILE_FAIL', -12 );\n  define( 'PCLZIP_ERR_BAD_CHECKSUM', -13 );\n  define( 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', -14 );\n  define( 'PCLZIP_ERR_MISSING_OPTION_VALUE', -15 );\n  define( 'PCLZIP_ERR_INVALID_OPTION_VALUE', -16 );\n  define( 'PCLZIP_ERR_ALREADY_A_DIRECTORY', -17 );\n  define( 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', -18 );\n  define( 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION', -19 );\n  define( 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE', -20 );\n  define( 'PCLZIP_ERR_DIRECTORY_RESTRICTION', -21 );\n\n  // ----- Options values\n  define( 'PCLZIP_OPT_PATH', 77001 );\n  define( 'PCLZIP_OPT_ADD_PATH', 77002 );\n  define( 'PCLZIP_OPT_REMOVE_PATH', 77003 );\n  define( 'PCLZIP_OPT_REMOVE_ALL_PATH', 77004 );\n  define( 'PCLZIP_OPT_SET_CHMOD', 77005 );\n  define( 'PCLZIP_OPT_EXTRACT_AS_STRING', 77006 );\n  define( 'PCLZIP_OPT_NO_COMPRESSION', 77007 );\n  define( 'PCLZIP_OPT_BY_NAME', 77008 );\n  define( 'PCLZIP_OPT_BY_INDEX', 77009 );\n  define( 'PCLZIP_OPT_BY_EREG', 77010 );\n  define( 'PCLZIP_OPT_BY_PREG', 77011 );\n  define( 'PCLZIP_OPT_COMMENT', 77012 );\n  define( 'PCLZIP_OPT_ADD_COMMENT', 77013 );\n  define( 'PCLZIP_OPT_PREPEND_COMMENT', 77014 );\n  define( 'PCLZIP_OPT_EXTRACT_IN_OUTPUT', 77015 );\n  define( 'PCLZIP_OPT_REPLACE_NEWER', 77016 );\n  define( 'PCLZIP_OPT_STOP_ON_ERROR', 77017 );\n  // Having big trouble with crypt. Need to multiply 2 long int\n  // which is not correctly supported by PHP ...\n  //define( 'PCLZIP_OPT_CRYPT', 77018 );\n  define( 'PCLZIP_OPT_EXTRACT_DIR_RESTRICTION', 77019 );\n  define( 'PCLZIP_OPT_TEMP_FILE_THRESHOLD', 77020 );\n  define( 'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD', 77020 ); // alias\n  define( 'PCLZIP_OPT_TEMP_FILE_ON', 77021 );\n  define( 'PCLZIP_OPT_ADD_TEMP_FILE_ON', 77021 ); // alias\n  define( 'PCLZIP_OPT_TEMP_FILE_OFF', 77022 );\n  define( 'PCLZIP_OPT_ADD_TEMP_FILE_OFF', 77022 ); // alias\n\n  // ----- File description attributes\n  define( 'PCLZIP_ATT_FILE_NAME', 79001 );\n  define( 'PCLZIP_ATT_FILE_NEW_SHORT_NAME', 79002 );\n  define( 'PCLZIP_ATT_FILE_NEW_FULL_NAME', 79003 );\n  define( 'PCLZIP_ATT_FILE_MTIME', 79004 );\n  define( 'PCLZIP_ATT_FILE_CONTENT', 79005 );\n  define( 'PCLZIP_ATT_FILE_COMMENT', 79006 );\n\n  // ----- Call backs values\n  define( 'PCLZIP_CB_PRE_EXTRACT', 78001 );\n  define( 'PCLZIP_CB_POST_EXTRACT', 78002 );\n  define( 'PCLZIP_CB_PRE_ADD', 78003 );\n  define( 'PCLZIP_CB_POST_ADD', 78004 );\n  /* For futur use\n  define( 'PCLZIP_CB_PRE_LIST', 78005 );\n  define( 'PCLZIP_CB_POST_LIST', 78006 );\n  define( 'PCLZIP_CB_PRE_DELETE', 78007 );\n  define( 'PCLZIP_CB_POST_DELETE', 78008 );\n  */\n\n  // --------------------------------------------------------------------------------\n  // Class : PclZip\n  // Description :\n  //   PclZip is the class that represent a Zip archive.\n  //   The public methods allow the manipulation of the archive.\n  // Attributes :\n  //   Attributes must not be accessed directly.\n  // Methods :\n  //   PclZip() : Object creator\n  //   create() : Creates the Zip archive\n  //   listContent() : List the content of the Zip archive\n  //   extract() : Extract the content of the archive\n  //   properties() : List the properties of the archive\n  // --------------------------------------------------------------------------------\n  class PclZip\n  {\n    // ----- Filename of the zip file\n    var $zipname = '';\n\n    // ----- File descriptor of the zip file\n    var $zip_fd = 0;\n\n    // ----- Internal error handling\n    var $error_code = 1;\n    var $error_string = '';\n\n    // ----- Current status of the magic_quotes_runtime\n    // This value store the php configuration for magic_quotes\n    // The class can then disable the magic_quotes and reset it after\n    var $magic_quotes_status;\n\n  // --------------------------------------------------------------------------------\n  // Function : PclZip()\n  // Description :\n  //   Creates a PclZip object and set the name of the associated Zip archive\n  //   filename.\n  //   Note that no real action is taken, if the archive does not exist it is not\n  //   created. Use create() for that.\n  // --------------------------------------------------------------------------------\n  function __construct($p_zipname)\n  {\n\n    // ----- Tests the zlib\n    if (!function_exists('gzopen'))\n    {\n      die('Abort '.basename(__FILE__).' : Missing zlib extensions');\n    }\n\n    // ----- Set the attributes\n    $this->zipname = $p_zipname;\n    $this->zip_fd = 0;\n    $this->magic_quotes_status = -1;\n\n    // ----- Return\n    return;\n  }\n\n  public function PclZip($p_zipname) {\n    self::__construct($p_zipname);\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function :\n  //   create($p_filelist, $p_add_dir=\"\", $p_remove_dir=\"\")\n  //   create($p_filelist, $p_option, $p_option_value, ...)\n  // Description :\n  //   This method supports two different synopsis. The first one is historical.\n  //   This method creates a Zip Archive. The Zip file is created in the\n  //   filesystem. The files and directories indicated in $p_filelist\n  //   are added in the archive. See the parameters description for the\n  //   supported format of $p_filelist.\n  //   When a directory is in the list, the directory and its content is added\n  //   in the archive.\n  //   In this synopsis, the function takes an optional variable list of\n  //   options. See below the supported options.\n  // Parameters :\n  //   $p_filelist : An array containing file or directory names, or\n  //                 a string containing one filename or one directory name, or\n  //                 a string containing a list of filenames and/or directory\n  //                 names separated by spaces.\n  //   $p_add_dir : A path to add before the real path of the archived file,\n  //                in order to have it memorized in the archive.\n  //   $p_remove_dir : A path to remove from the real path of the file to archive,\n  //                   in order to have a shorter path memorized in the archive.\n  //                   When $p_add_dir and $p_remove_dir are set, $p_remove_dir\n  //                   is removed first, before $p_add_dir is added.\n  // Options :\n  //   PCLZIP_OPT_ADD_PATH :\n  //   PCLZIP_OPT_REMOVE_PATH :\n  //   PCLZIP_OPT_REMOVE_ALL_PATH :\n  //   PCLZIP_OPT_COMMENT :\n  //   PCLZIP_CB_PRE_ADD :\n  //   PCLZIP_CB_POST_ADD :\n  // Return Values :\n  //   0 on failure,\n  //   The list of the added files, with a status of the add action.\n  //   (see PclZip::listContent() for list entry format)\n  // --------------------------------------------------------------------------------\n  function create($p_filelist)\n  {\n    $v_result=1;\n\n    // ----- Reset the error handler\n    $this->privErrorReset();\n\n    // ----- Set default values\n    $v_options = array();\n    $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE;\n\n    // ----- Look for variable options arguments\n    $v_size = func_num_args();\n\n    // ----- Look for arguments\n    if ($v_size > 1) {\n      // ----- Get the arguments\n      $v_arg_list = func_get_args();\n\n      // ----- Remove from the options list the first argument\n      array_shift($v_arg_list);\n      $v_size--;\n\n      // ----- Look for first arg\n      if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {\n\n        // ----- Parse the options\n        $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,\n                                            array (PCLZIP_OPT_REMOVE_PATH => 'optional',\n                                                   PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',\n                                                   PCLZIP_OPT_ADD_PATH => 'optional',\n                                                   PCLZIP_CB_PRE_ADD => 'optional',\n                                                   PCLZIP_CB_POST_ADD => 'optional',\n                                                   PCLZIP_OPT_NO_COMPRESSION => 'optional',\n                                                   PCLZIP_OPT_COMMENT => 'optional',\n                                                   PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',\n                                                   PCLZIP_OPT_TEMP_FILE_ON => 'optional',\n                                                   PCLZIP_OPT_TEMP_FILE_OFF => 'optional'\n                                                   //, PCLZIP_OPT_CRYPT => 'optional'\n                                             ));\n        if ($v_result != 1) {\n          return 0;\n        }\n      }\n\n      // ----- Look for 2 args\n      // Here we need to support the first historic synopsis of the\n      // method.\n      else {\n\n        // ----- Get the first argument\n        $v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0];\n\n        // ----- Look for the optional second argument\n        if ($v_size == 2) {\n          $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];\n        }\n        else if ($v_size > 2) {\n          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER,\n\t\t                       \"Invalid number / type of arguments\");\n          return 0;\n        }\n      }\n    }\n\n    // ----- Look for default option values\n    $this->privOptionDefaultThreshold($v_options);\n\n    // ----- Init\n    $v_string_list = array();\n    $v_att_list = array();\n    $v_filedescr_list = array();\n    $p_result_list = array();\n\n    // ----- Look if the $p_filelist is really an array\n    if (is_array($p_filelist)) {\n\n      // ----- Look if the first element is also an array\n      //       This will mean that this is a file description entry\n      if (isset($p_filelist[0]) && is_array($p_filelist[0])) {\n        $v_att_list = $p_filelist;\n      }\n\n      // ----- The list is a list of string names\n      else {\n        $v_string_list = $p_filelist;\n      }\n    }\n\n    // ----- Look if the $p_filelist is a string\n    else if (is_string($p_filelist)) {\n      // ----- Create a list from the string\n      $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist);\n    }\n\n    // ----- Invalid variable type for $p_filelist\n    else {\n      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid variable type p_filelist\");\n      return 0;\n    }\n\n    // ----- Reformat the string list\n    if (sizeof($v_string_list) != 0) {\n      foreach ($v_string_list as $v_string) {\n        if ($v_string != '') {\n          $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;\n        }\n        else {\n        }\n      }\n    }\n\n    // ----- For each file in the list check the attributes\n    $v_supported_attributes\n    = array ( PCLZIP_ATT_FILE_NAME => 'mandatory'\n             ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional'\n             ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional'\n             ,PCLZIP_ATT_FILE_MTIME => 'optional'\n             ,PCLZIP_ATT_FILE_CONTENT => 'optional'\n             ,PCLZIP_ATT_FILE_COMMENT => 'optional'\n\t\t\t\t\t\t);\n    foreach ($v_att_list as $v_entry) {\n      $v_result = $this->privFileDescrParseAtt($v_entry,\n                                               $v_filedescr_list[],\n                                               $v_options,\n                                               $v_supported_attributes);\n      if ($v_result != 1) {\n        return 0;\n      }\n    }\n\n    // ----- Expand the filelist (expand directories)\n    $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options);\n    if ($v_result != 1) {\n      return 0;\n    }\n\n    // ----- Call the create fct\n    $v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options);\n    if ($v_result != 1) {\n      return 0;\n    }\n\n    // ----- Return\n    return $p_result_list;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function :\n  //   add($p_filelist, $p_add_dir=\"\", $p_remove_dir=\"\")\n  //   add($p_filelist, $p_option, $p_option_value, ...)\n  // Description :\n  //   This method supports two synopsis. The first one is historical.\n  //   This methods add the list of files in an existing archive.\n  //   If a file with the same name already exists, it is added at the end of the\n  //   archive, the first one is still present.\n  //   If the archive does not exist, it is created.\n  // Parameters :\n  //   $p_filelist : An array containing file or directory names, or\n  //                 a string containing one filename or one directory name, or\n  //                 a string containing a list of filenames and/or directory\n  //                 names separated by spaces.\n  //   $p_add_dir : A path to add before the real path of the archived file,\n  //                in order to have it memorized in the archive.\n  //   $p_remove_dir : A path to remove from the real path of the file to archive,\n  //                   in order to have a shorter path memorized in the archive.\n  //                   When $p_add_dir and $p_remove_dir are set, $p_remove_dir\n  //                   is removed first, before $p_add_dir is added.\n  // Options :\n  //   PCLZIP_OPT_ADD_PATH :\n  //   PCLZIP_OPT_REMOVE_PATH :\n  //   PCLZIP_OPT_REMOVE_ALL_PATH :\n  //   PCLZIP_OPT_COMMENT :\n  //   PCLZIP_OPT_ADD_COMMENT :\n  //   PCLZIP_OPT_PREPEND_COMMENT :\n  //   PCLZIP_CB_PRE_ADD :\n  //   PCLZIP_CB_POST_ADD :\n  // Return Values :\n  //   0 on failure,\n  //   The list of the added files, with a status of the add action.\n  //   (see PclZip::listContent() for list entry format)\n  // --------------------------------------------------------------------------------\n  function add($p_filelist)\n  {\n    $v_result=1;\n\n    // ----- Reset the error handler\n    $this->privErrorReset();\n\n    // ----- Set default values\n    $v_options = array();\n    $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE;\n\n    // ----- Look for variable options arguments\n    $v_size = func_num_args();\n\n    // ----- Look for arguments\n    if ($v_size > 1) {\n      // ----- Get the arguments\n      $v_arg_list = func_get_args();\n\n      // ----- Remove form the options list the first argument\n      array_shift($v_arg_list);\n      $v_size--;\n\n      // ----- Look for first arg\n      if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {\n\n        // ----- Parse the options\n        $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,\n                                            array (PCLZIP_OPT_REMOVE_PATH => 'optional',\n                                                   PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',\n                                                   PCLZIP_OPT_ADD_PATH => 'optional',\n                                                   PCLZIP_CB_PRE_ADD => 'optional',\n                                                   PCLZIP_CB_POST_ADD => 'optional',\n                                                   PCLZIP_OPT_NO_COMPRESSION => 'optional',\n                                                   PCLZIP_OPT_COMMENT => 'optional',\n                                                   PCLZIP_OPT_ADD_COMMENT => 'optional',\n                                                   PCLZIP_OPT_PREPEND_COMMENT => 'optional',\n                                                   PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',\n                                                   PCLZIP_OPT_TEMP_FILE_ON => 'optional',\n                                                   PCLZIP_OPT_TEMP_FILE_OFF => 'optional'\n                                                   //, PCLZIP_OPT_CRYPT => 'optional'\n\t\t\t\t\t\t\t\t\t\t\t\t   ));\n        if ($v_result != 1) {\n          return 0;\n        }\n      }\n\n      // ----- Look for 2 args\n      // Here we need to support the first historic synopsis of the\n      // method.\n      else {\n\n        // ----- Get the first argument\n        $v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0];\n\n        // ----- Look for the optional second argument\n        if ($v_size == 2) {\n          $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];\n        }\n        else if ($v_size > 2) {\n          // ----- Error log\n          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid number / type of arguments\");\n\n          // ----- Return\n          return 0;\n        }\n      }\n    }\n\n    // ----- Look for default option values\n    $this->privOptionDefaultThreshold($v_options);\n\n    // ----- Init\n    $v_string_list = array();\n    $v_att_list = array();\n    $v_filedescr_list = array();\n    $p_result_list = array();\n\n    // ----- Look if the $p_filelist is really an array\n    if (is_array($p_filelist)) {\n\n      // ----- Look if the first element is also an array\n      //       This will mean that this is a file description entry\n      if (isset($p_filelist[0]) && is_array($p_filelist[0])) {\n        $v_att_list = $p_filelist;\n      }\n\n      // ----- The list is a list of string names\n      else {\n        $v_string_list = $p_filelist;\n      }\n    }\n\n    // ----- Look if the $p_filelist is a string\n    else if (is_string($p_filelist)) {\n      // ----- Create a list from the string\n      $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist);\n    }\n\n    // ----- Invalid variable type for $p_filelist\n    else {\n      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid variable type '\".gettype($p_filelist).\"' for p_filelist\");\n      return 0;\n    }\n\n    // ----- Reformat the string list\n    if (sizeof($v_string_list) != 0) {\n      foreach ($v_string_list as $v_string) {\n        $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;\n      }\n    }\n\n    // ----- For each file in the list check the attributes\n    $v_supported_attributes\n    = array ( PCLZIP_ATT_FILE_NAME => 'mandatory'\n             ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional'\n             ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional'\n             ,PCLZIP_ATT_FILE_MTIME => 'optional'\n             ,PCLZIP_ATT_FILE_CONTENT => 'optional'\n             ,PCLZIP_ATT_FILE_COMMENT => 'optional'\n\t\t\t\t\t\t);\n    foreach ($v_att_list as $v_entry) {\n      $v_result = $this->privFileDescrParseAtt($v_entry,\n                                               $v_filedescr_list[],\n                                               $v_options,\n                                               $v_supported_attributes);\n      if ($v_result != 1) {\n        return 0;\n      }\n    }\n\n    // ----- Expand the filelist (expand directories)\n    $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options);\n    if ($v_result != 1) {\n      return 0;\n    }\n\n    // ----- Call the create fct\n    $v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options);\n    if ($v_result != 1) {\n      return 0;\n    }\n\n    // ----- Return\n    return $p_result_list;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : listContent()\n  // Description :\n  //   This public method, gives the list of the files and directories, with their\n  //   properties.\n  //   The properties of each entries in the list are (used also in other functions) :\n  //     filename : Name of the file. For a create or add action it is the filename\n  //                given by the user. For an extract function it is the filename\n  //                of the extracted file.\n  //     stored_filename : Name of the file / directory stored in the archive.\n  //     size : Size of the stored file.\n  //     compressed_size : Size of the file's data compressed in the archive\n  //                       (without the headers overhead)\n  //     mtime : Last known modification date of the file (UNIX timestamp)\n  //     comment : Comment associated with the file\n  //     folder : true | false\n  //     index : index of the file in the archive\n  //     status : status of the action (depending of the action) :\n  //              Values are :\n  //                ok : OK !\n  //                filtered : the file / dir is not extracted (filtered by user)\n  //                already_a_directory : the file can not be extracted because a\n  //                                      directory with the same name already exists\n  //                write_protected : the file can not be extracted because a file\n  //                                  with the same name already exists and is\n  //                                  write protected\n  //                newer_exist : the file was not extracted because a newer file exists\n  //                path_creation_fail : the file is not extracted because the folder\n  //                                     does not exist and can not be created\n  //                write_error : the file was not extracted because there was a\n  //                              error while writing the file\n  //                read_error : the file was not extracted because there was a error\n  //                             while reading the file\n  //                invalid_header : the file was not extracted because of an archive\n  //                                 format error (bad file header)\n  //   Note that each time a method can continue operating when there\n  //   is an action error on a file, the error is only logged in the file status.\n  // Return Values :\n  //   0 on an unrecoverable failure,\n  //   The list of the files in the archive.\n  // --------------------------------------------------------------------------------\n  function listContent()\n  {\n    $v_result=1;\n\n    // ----- Reset the error handler\n    $this->privErrorReset();\n\n    // ----- Check archive\n    if (!$this->privCheckFormat()) {\n      return(0);\n    }\n\n    // ----- Call the extracting fct\n    $p_list = array();\n    if (($v_result = $this->privList($p_list)) != 1)\n    {\n      unset($p_list);\n      return(0);\n    }\n\n    // ----- Return\n    return $p_list;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function :\n  //   extract($p_path=\"./\", $p_remove_path=\"\")\n  //   extract([$p_option, $p_option_value, ...])\n  // Description :\n  //   This method supports two synopsis. The first one is historical.\n  //   This method extract all the files / directories from the archive to the\n  //   folder indicated in $p_path.\n  //   If you want to ignore the 'root' part of path of the memorized files\n  //   you can indicate this in the optional $p_remove_path parameter.\n  //   By default, if a newer file with the same name already exists, the\n  //   file is not extracted.\n  //\n  //   If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH options\n  //   are used, the path indicated in PCLZIP_OPT_ADD_PATH is append\n  //   at the end of the path value of PCLZIP_OPT_PATH.\n  // Parameters :\n  //   $p_path : Path where the files and directories are to be extracted\n  //   $p_remove_path : First part ('root' part) of the memorized path\n  //                    (if any similar) to remove while extracting.\n  // Options :\n  //   PCLZIP_OPT_PATH :\n  //   PCLZIP_OPT_ADD_PATH :\n  //   PCLZIP_OPT_REMOVE_PATH :\n  //   PCLZIP_OPT_REMOVE_ALL_PATH :\n  //   PCLZIP_CB_PRE_EXTRACT :\n  //   PCLZIP_CB_POST_EXTRACT :\n  // Return Values :\n  //   0 or a negative value on failure,\n  //   The list of the extracted files, with a status of the action.\n  //   (see PclZip::listContent() for list entry format)\n  // --------------------------------------------------------------------------------\n  function extract()\n  {\n    $v_result=1;\n\n    // ----- Reset the error handler\n    $this->privErrorReset();\n\n    // ----- Check archive\n    if (!$this->privCheckFormat()) {\n      return(0);\n    }\n\n    // ----- Set default values\n    $v_options = array();\n//    $v_path = \"./\";\n    $v_path = '';\n    $v_remove_path = \"\";\n    $v_remove_all_path = false;\n\n    // ----- Look for variable options arguments\n    $v_size = func_num_args();\n\n    // ----- Default values for option\n    $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;\n\n    // ----- Look for arguments\n    if ($v_size > 0) {\n      // ----- Get the arguments\n      $v_arg_list = func_get_args();\n\n      // ----- Look for first arg\n      if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {\n\n        // ----- Parse the options\n        $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,\n                                            array (PCLZIP_OPT_PATH => 'optional',\n                                                   PCLZIP_OPT_REMOVE_PATH => 'optional',\n                                                   PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',\n                                                   PCLZIP_OPT_ADD_PATH => 'optional',\n                                                   PCLZIP_CB_PRE_EXTRACT => 'optional',\n                                                   PCLZIP_CB_POST_EXTRACT => 'optional',\n                                                   PCLZIP_OPT_SET_CHMOD => 'optional',\n                                                   PCLZIP_OPT_BY_NAME => 'optional',\n                                                   PCLZIP_OPT_BY_EREG => 'optional',\n                                                   PCLZIP_OPT_BY_PREG => 'optional',\n                                                   PCLZIP_OPT_BY_INDEX => 'optional',\n                                                   PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',\n                                                   PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional',\n                                                   PCLZIP_OPT_REPLACE_NEWER => 'optional'\n                                                   ,PCLZIP_OPT_STOP_ON_ERROR => 'optional'\n                                                   ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional',\n                                                   PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',\n                                                   PCLZIP_OPT_TEMP_FILE_ON => 'optional',\n                                                   PCLZIP_OPT_TEMP_FILE_OFF => 'optional'\n\t\t\t\t\t\t\t\t\t\t\t\t    ));\n        if ($v_result != 1) {\n          return 0;\n        }\n\n        // ----- Set the arguments\n        if (isset($v_options[PCLZIP_OPT_PATH])) {\n          $v_path = $v_options[PCLZIP_OPT_PATH];\n        }\n        if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {\n          $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];\n        }\n        if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {\n          $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];\n        }\n        if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {\n          // ----- Check for '/' in last path char\n          if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {\n            $v_path .= '/';\n          }\n          $v_path .= $v_options[PCLZIP_OPT_ADD_PATH];\n        }\n      }\n\n      // ----- Look for 2 args\n      // Here we need to support the first historic synopsis of the\n      // method.\n      else {\n\n        // ----- Get the first argument\n        $v_path = $v_arg_list[0];\n\n        // ----- Look for the optional second argument\n        if ($v_size == 2) {\n          $v_remove_path = $v_arg_list[1];\n        }\n        else if ($v_size > 2) {\n          // ----- Error log\n          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid number / type of arguments\");\n\n          // ----- Return\n          return 0;\n        }\n      }\n    }\n\n    // ----- Look for default option values\n    $this->privOptionDefaultThreshold($v_options);\n\n    // ----- Trace\n\n    // ----- Call the extracting fct\n    $p_list = array();\n    $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path,\n\t                                     $v_remove_all_path, $v_options);\n    if ($v_result < 1) {\n      unset($p_list);\n      return(0);\n    }\n\n    // ----- Return\n    return $p_list;\n  }\n  // --------------------------------------------------------------------------------\n\n\n  // --------------------------------------------------------------------------------\n  // Function :\n  //   extractByIndex($p_index, $p_path=\"./\", $p_remove_path=\"\")\n  //   extractByIndex($p_index, [$p_option, $p_option_value, ...])\n  // Description :\n  //   This method supports two synopsis. The first one is historical.\n  //   This method is doing a partial extract of the archive.\n  //   The extracted files or folders are identified by their index in the\n  //   archive (from 0 to n).\n  //   Note that if the index identify a folder, only the folder entry is\n  //   extracted, not all the files included in the archive.\n  // Parameters :\n  //   $p_index : A single index (integer) or a string of indexes of files to\n  //              extract. The form of the string is \"0,4-6,8-12\" with only numbers\n  //              and '-' for range or ',' to separate ranges. No spaces or ';'\n  //              are allowed.\n  //   $p_path : Path where the files and directories are to be extracted\n  //   $p_remove_path : First part ('root' part) of the memorized path\n  //                    (if any similar) to remove while extracting.\n  // Options :\n  //   PCLZIP_OPT_PATH :\n  //   PCLZIP_OPT_ADD_PATH :\n  //   PCLZIP_OPT_REMOVE_PATH :\n  //   PCLZIP_OPT_REMOVE_ALL_PATH :\n  //   PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and\n  //     not as files.\n  //     The resulting content is in a new field 'content' in the file\n  //     structure.\n  //     This option must be used alone (any other options are ignored).\n  //   PCLZIP_CB_PRE_EXTRACT :\n  //   PCLZIP_CB_POST_EXTRACT :\n  // Return Values :\n  //   0 on failure,\n  //   The list of the extracted files, with a status of the action.\n  //   (see PclZip::listContent() for list entry format)\n  // --------------------------------------------------------------------------------\n  //function extractByIndex($p_index, options...)\n  function extractByIndex($p_index)\n  {\n    $v_result=1;\n\n    // ----- Reset the error handler\n    $this->privErrorReset();\n\n    // ----- Check archive\n    if (!$this->privCheckFormat()) {\n      return(0);\n    }\n\n    // ----- Set default values\n    $v_options = array();\n//    $v_path = \"./\";\n    $v_path = '';\n    $v_remove_path = \"\";\n    $v_remove_all_path = false;\n\n    // ----- Look for variable options arguments\n    $v_size = func_num_args();\n\n    // ----- Default values for option\n    $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;\n\n    // ----- Look for arguments\n    if ($v_size > 1) {\n      // ----- Get the arguments\n      $v_arg_list = func_get_args();\n\n      // ----- Remove form the options list the first argument\n      array_shift($v_arg_list);\n      $v_size--;\n\n      // ----- Look for first arg\n      if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {\n\n        // ----- Parse the options\n        $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,\n                                            array (PCLZIP_OPT_PATH => 'optional',\n                                                   PCLZIP_OPT_REMOVE_PATH => 'optional',\n                                                   PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',\n                                                   PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',\n                                                   PCLZIP_OPT_ADD_PATH => 'optional',\n                                                   PCLZIP_CB_PRE_EXTRACT => 'optional',\n                                                   PCLZIP_CB_POST_EXTRACT => 'optional',\n                                                   PCLZIP_OPT_SET_CHMOD => 'optional',\n                                                   PCLZIP_OPT_REPLACE_NEWER => 'optional'\n                                                   ,PCLZIP_OPT_STOP_ON_ERROR => 'optional'\n                                                   ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional',\n                                                   PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',\n                                                   PCLZIP_OPT_TEMP_FILE_ON => 'optional',\n                                                   PCLZIP_OPT_TEMP_FILE_OFF => 'optional'\n\t\t\t\t\t\t\t\t\t\t\t\t   ));\n        if ($v_result != 1) {\n          return 0;\n        }\n\n        // ----- Set the arguments\n        if (isset($v_options[PCLZIP_OPT_PATH])) {\n          $v_path = $v_options[PCLZIP_OPT_PATH];\n        }\n        if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {\n          $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];\n        }\n        if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {\n          $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];\n        }\n        if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {\n          // ----- Check for '/' in last path char\n          if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {\n            $v_path .= '/';\n          }\n          $v_path .= $v_options[PCLZIP_OPT_ADD_PATH];\n        }\n        if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) {\n          $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;\n        }\n        else {\n        }\n      }\n\n      // ----- Look for 2 args\n      // Here we need to support the first historic synopsis of the\n      // method.\n      else {\n\n        // ----- Get the first argument\n        $v_path = $v_arg_list[0];\n\n        // ----- Look for the optional second argument\n        if ($v_size == 2) {\n          $v_remove_path = $v_arg_list[1];\n        }\n        else if ($v_size > 2) {\n          // ----- Error log\n          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid number / type of arguments\");\n\n          // ----- Return\n          return 0;\n        }\n      }\n    }\n\n    // ----- Trace\n\n    // ----- Trick\n    // Here I want to reuse extractByRule(), so I need to parse the $p_index\n    // with privParseOptions()\n    $v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index);\n    $v_options_trick = array();\n    $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick,\n                                        array (PCLZIP_OPT_BY_INDEX => 'optional' ));\n    if ($v_result != 1) {\n        return 0;\n    }\n    $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX];\n\n    // ----- Look for default option values\n    $this->privOptionDefaultThreshold($v_options);\n\n    // ----- Call the extracting fct\n    if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) {\n        return(0);\n    }\n\n    // ----- Return\n    return $p_list;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function :\n  //   delete([$p_option, $p_option_value, ...])\n  // Description :\n  //   This method removes files from the archive.\n  //   If no parameters are given, then all the archive is emptied.\n  // Parameters :\n  //   None or optional arguments.\n  // Options :\n  //   PCLZIP_OPT_BY_INDEX :\n  //   PCLZIP_OPT_BY_NAME :\n  //   PCLZIP_OPT_BY_EREG :\n  //   PCLZIP_OPT_BY_PREG :\n  // Return Values :\n  //   0 on failure,\n  //   The list of the files which are still present in the archive.\n  //   (see PclZip::listContent() for list entry format)\n  // --------------------------------------------------------------------------------\n  function delete()\n  {\n    $v_result=1;\n\n    // ----- Reset the error handler\n    $this->privErrorReset();\n\n    // ----- Check archive\n    if (!$this->privCheckFormat()) {\n      return(0);\n    }\n\n    // ----- Set default values\n    $v_options = array();\n\n    // ----- Look for variable options arguments\n    $v_size = func_num_args();\n\n    // ----- Look for arguments\n    if ($v_size > 0) {\n      // ----- Get the arguments\n      $v_arg_list = func_get_args();\n\n      // ----- Parse the options\n      $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,\n                                        array (PCLZIP_OPT_BY_NAME => 'optional',\n                                               PCLZIP_OPT_BY_EREG => 'optional',\n                                               PCLZIP_OPT_BY_PREG => 'optional',\n                                               PCLZIP_OPT_BY_INDEX => 'optional' ));\n      if ($v_result != 1) {\n          return 0;\n      }\n    }\n\n    // ----- Magic quotes trick\n    $this->privDisableMagicQuotes();\n\n    // ----- Call the delete fct\n    $v_list = array();\n    if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) {\n      $this->privSwapBackMagicQuotes();\n      unset($v_list);\n      return(0);\n    }\n\n    // ----- Magic quotes trick\n    $this->privSwapBackMagicQuotes();\n\n    // ----- Return\n    return $v_list;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : deleteByIndex()\n  // Description :\n  //   ***** Deprecated *****\n  //   delete(PCLZIP_OPT_BY_INDEX, $p_index) should be preferred.\n  // --------------------------------------------------------------------------------\n  function deleteByIndex($p_index)\n  {\n\n    $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index);\n\n    // ----- Return\n    return $p_list;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : properties()\n  // Description :\n  //   This method gives the properties of the archive.\n  //   The properties are :\n  //     nb : Number of files in the archive\n  //     comment : Comment associated with the archive file\n  //     status : not_exist, ok\n  // Parameters :\n  //   None\n  // Return Values :\n  //   0 on failure,\n  //   An array with the archive properties.\n  // --------------------------------------------------------------------------------\n  function properties()\n  {\n\n    // ----- Reset the error handler\n    $this->privErrorReset();\n\n    // ----- Magic quotes trick\n    $this->privDisableMagicQuotes();\n\n    // ----- Check archive\n    if (!$this->privCheckFormat()) {\n      $this->privSwapBackMagicQuotes();\n      return(0);\n    }\n\n    // ----- Default properties\n    $v_prop = array();\n    $v_prop['comment'] = '';\n    $v_prop['nb'] = 0;\n    $v_prop['status'] = 'not_exist';\n\n    // ----- Look if file exists\n    if (@is_file($this->zipname))\n    {\n      // ----- Open the zip file\n      if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0)\n      {\n        $this->privSwapBackMagicQuotes();\n\n        // ----- Error log\n        PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \\''.$this->zipname.'\\' in binary read mode');\n\n        // ----- Return\n        return 0;\n      }\n\n      // ----- Read the central directory information\n      $v_central_dir = array();\n      if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)\n      {\n        $this->privSwapBackMagicQuotes();\n        return 0;\n      }\n\n      // ----- Close the zip file\n      $this->privCloseFd();\n\n      // ----- Set the user attributes\n      $v_prop['comment'] = $v_central_dir['comment'];\n      $v_prop['nb'] = $v_central_dir['entries'];\n      $v_prop['status'] = 'ok';\n    }\n\n    // ----- Magic quotes trick\n    $this->privSwapBackMagicQuotes();\n\n    // ----- Return\n    return $v_prop;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : duplicate()\n  // Description :\n  //   This method creates an archive by copying the content of an other one. If\n  //   the archive already exist, it is replaced by the new one without any warning.\n  // Parameters :\n  //   $p_archive : The filename of a valid archive, or\n  //                a valid PclZip object.\n  // Return Values :\n  //   1 on success.\n  //   0 or a negative value on error (error code).\n  // --------------------------------------------------------------------------------\n  function duplicate($p_archive)\n  {\n    $v_result = 1;\n\n    // ----- Reset the error handler\n    $this->privErrorReset();\n\n    // ----- Look if the $p_archive is a PclZip object\n    if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip'))\n    {\n\n      // ----- Duplicate the archive\n      $v_result = $this->privDuplicate($p_archive->zipname);\n    }\n\n    // ----- Look if the $p_archive is a string (so a filename)\n    else if (is_string($p_archive))\n    {\n\n      // ----- Check that $p_archive is a valid zip file\n      // TBC : Should also check the archive format\n      if (!is_file($p_archive)) {\n        // ----- Error log\n        PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, \"No file with filename '\".$p_archive.\"'\");\n        $v_result = PCLZIP_ERR_MISSING_FILE;\n      }\n      else {\n        // ----- Duplicate the archive\n        $v_result = $this->privDuplicate($p_archive);\n      }\n    }\n\n    // ----- Invalid variable\n    else\n    {\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid variable type p_archive_to_add\");\n      $v_result = PCLZIP_ERR_INVALID_PARAMETER;\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : merge()\n  // Description :\n  //   This method merge the $p_archive_to_add archive at the end of the current\n  //   one ($this).\n  //   If the archive ($this) does not exist, the merge becomes a duplicate.\n  //   If the $p_archive_to_add archive does not exist, the merge is a success.\n  // Parameters :\n  //   $p_archive_to_add : It can be directly the filename of a valid zip archive,\n  //                       or a PclZip object archive.\n  // Return Values :\n  //   1 on success,\n  //   0 or negative values on error (see below).\n  // --------------------------------------------------------------------------------\n  function merge($p_archive_to_add)\n  {\n    $v_result = 1;\n\n    // ----- Reset the error handler\n    $this->privErrorReset();\n\n    // ----- Check archive\n    if (!$this->privCheckFormat()) {\n      return(0);\n    }\n\n    // ----- Look if the $p_archive_to_add is a PclZip object\n    if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip'))\n    {\n\n      // ----- Merge the archive\n      $v_result = $this->privMerge($p_archive_to_add);\n    }\n\n    // ----- Look if the $p_archive_to_add is a string (so a filename)\n    else if (is_string($p_archive_to_add))\n    {\n\n      // ----- Create a temporary archive\n      $v_object_archive = new PclZip($p_archive_to_add);\n\n      // ----- Merge the archive\n      $v_result = $this->privMerge($v_object_archive);\n    }\n\n    // ----- Invalid variable\n    else\n    {\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid variable type p_archive_to_add\");\n      $v_result = PCLZIP_ERR_INVALID_PARAMETER;\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n\n\n  // --------------------------------------------------------------------------------\n  // Function : errorCode()\n  // Description :\n  // Parameters :\n  // --------------------------------------------------------------------------------\n  function errorCode()\n  {\n    if (PCLZIP_ERROR_EXTERNAL == 1) {\n      return(PclErrorCode());\n    }\n    else {\n      return($this->error_code);\n    }\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : errorName()\n  // Description :\n  // Parameters :\n  // --------------------------------------------------------------------------------\n  function errorName($p_with_code=false)\n  {\n    $v_name = array ( PCLZIP_ERR_NO_ERROR => 'PCLZIP_ERR_NO_ERROR',\n                      PCLZIP_ERR_WRITE_OPEN_FAIL => 'PCLZIP_ERR_WRITE_OPEN_FAIL',\n                      PCLZIP_ERR_READ_OPEN_FAIL => 'PCLZIP_ERR_READ_OPEN_FAIL',\n                      PCLZIP_ERR_INVALID_PARAMETER => 'PCLZIP_ERR_INVALID_PARAMETER',\n                      PCLZIP_ERR_MISSING_FILE => 'PCLZIP_ERR_MISSING_FILE',\n                      PCLZIP_ERR_FILENAME_TOO_LONG => 'PCLZIP_ERR_FILENAME_TOO_LONG',\n                      PCLZIP_ERR_INVALID_ZIP => 'PCLZIP_ERR_INVALID_ZIP',\n                      PCLZIP_ERR_BAD_EXTRACTED_FILE => 'PCLZIP_ERR_BAD_EXTRACTED_FILE',\n                      PCLZIP_ERR_DIR_CREATE_FAIL => 'PCLZIP_ERR_DIR_CREATE_FAIL',\n                      PCLZIP_ERR_BAD_EXTENSION => 'PCLZIP_ERR_BAD_EXTENSION',\n                      PCLZIP_ERR_BAD_FORMAT => 'PCLZIP_ERR_BAD_FORMAT',\n                      PCLZIP_ERR_DELETE_FILE_FAIL => 'PCLZIP_ERR_DELETE_FILE_FAIL',\n                      PCLZIP_ERR_RENAME_FILE_FAIL => 'PCLZIP_ERR_RENAME_FILE_FAIL',\n                      PCLZIP_ERR_BAD_CHECKSUM => 'PCLZIP_ERR_BAD_CHECKSUM',\n                      PCLZIP_ERR_INVALID_ARCHIVE_ZIP => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP',\n                      PCLZIP_ERR_MISSING_OPTION_VALUE => 'PCLZIP_ERR_MISSING_OPTION_VALUE',\n                      PCLZIP_ERR_INVALID_OPTION_VALUE => 'PCLZIP_ERR_INVALID_OPTION_VALUE',\n                      PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION',\n                      PCLZIP_ERR_UNSUPPORTED_ENCRYPTION => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION'\n                      ,PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE => 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE'\n                      ,PCLZIP_ERR_DIRECTORY_RESTRICTION => 'PCLZIP_ERR_DIRECTORY_RESTRICTION'\n                    );\n\n    if (isset($v_name[$this->error_code])) {\n      $v_value = $v_name[$this->error_code];\n    }\n    else {\n      $v_value = 'NoName';\n    }\n\n    if ($p_with_code) {\n      return($v_value.' ('.$this->error_code.')');\n    }\n    else {\n      return($v_value);\n    }\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : errorInfo()\n  // Description :\n  // Parameters :\n  // --------------------------------------------------------------------------------\n  function errorInfo($p_full=false)\n  {\n    if (PCLZIP_ERROR_EXTERNAL == 1) {\n      return(PclErrorString());\n    }\n    else {\n      if ($p_full) {\n        return($this->errorName(true).\" : \".$this->error_string);\n      }\n      else {\n        return($this->error_string.\" [code \".$this->error_code.\"]\");\n      }\n    }\n  }\n  // --------------------------------------------------------------------------------\n\n\n// --------------------------------------------------------------------------------\n// ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS *****\n// *****                                                        *****\n// *****       THESES FUNCTIONS MUST NOT BE USED DIRECTLY       *****\n// --------------------------------------------------------------------------------\n\n\n\n  // --------------------------------------------------------------------------------\n  // Function : privCheckFormat()\n  // Description :\n  //   This method check that the archive exists and is a valid zip archive.\n  //   Several level of check exists. (futur)\n  // Parameters :\n  //   $p_level : Level of check. Default 0.\n  //              0 : Check the first bytes (magic codes) (default value))\n  //              1 : 0 + Check the central directory (futur)\n  //              2 : 1 + Check each file header (futur)\n  // Return Values :\n  //   true on success,\n  //   false on error, the error code is set.\n  // --------------------------------------------------------------------------------\n  function privCheckFormat($p_level=0)\n  {\n    $v_result = true;\n\n\t// ----- Reset the file system cache\n    clearstatcache();\n\n    // ----- Reset the error handler\n    $this->privErrorReset();\n\n    // ----- Look if the file exits\n    if (!is_file($this->zipname)) {\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, \"Missing archive file '\".$this->zipname.\"'\");\n      return(false);\n    }\n\n    // ----- Check that the file is readable\n    if (!is_readable($this->zipname)) {\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, \"Unable to read archive '\".$this->zipname.\"'\");\n      return(false);\n    }\n\n    // ----- Check the magic code\n    // TBC\n\n    // ----- Check the central header\n    // TBC\n\n    // ----- Check each file header\n    // TBC\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privParseOptions()\n  // Description :\n  //   This internal methods reads the variable list of arguments ($p_options_list,\n  //   $p_size) and generate an array with the options and values ($v_result_list).\n  //   $v_requested_options contains the options that can be present and those that\n  //   must be present.\n  //   $v_requested_options is an array, with the option value as key, and 'optional',\n  //   or 'mandatory' as value.\n  // Parameters :\n  //   See above.\n  // Return Values :\n  //   1 on success.\n  //   0 on failure.\n  // --------------------------------------------------------------------------------\n  function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options=false)\n  {\n    $v_result=1;\n\n    // ----- Read the options\n    $i=0;\n    while ($i<$p_size) {\n\n      // ----- Check if the option is supported\n      if (!isset($v_requested_options[$p_options_list[$i]])) {\n        // ----- Error log\n        PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid optional parameter '\".$p_options_list[$i].\"' for this method\");\n\n        // ----- Return\n        return PclZip::errorCode();\n      }\n\n      // ----- Look for next option\n      switch ($p_options_list[$i]) {\n        // ----- Look for options that request a path value\n        case PCLZIP_OPT_PATH :\n        case PCLZIP_OPT_REMOVE_PATH :\n        case PCLZIP_OPT_ADD_PATH :\n          // ----- Check the number of parameters\n          if (($i+1) >= $p_size) {\n            // ----- Error log\n            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, \"Missing parameter value for option '\".PclZipUtilOptionText($p_options_list[$i]).\"'\");\n\n            // ----- Return\n            return PclZip::errorCode();\n          }\n\n          // ----- Get the value\n          $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE);\n          $i++;\n        break;\n\n        case PCLZIP_OPT_TEMP_FILE_THRESHOLD :\n          // ----- Check the number of parameters\n          if (($i+1) >= $p_size) {\n            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, \"Missing parameter value for option '\".PclZipUtilOptionText($p_options_list[$i]).\"'\");\n            return PclZip::errorCode();\n          }\n\n          // ----- Check for incompatible options\n          if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) {\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Option '\".PclZipUtilOptionText($p_options_list[$i]).\"' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'\");\n            return PclZip::errorCode();\n          }\n\n          // ----- Check the value\n          $v_value = $p_options_list[$i+1];\n          if ((!is_integer($v_value)) || ($v_value<0)) {\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, \"Integer expected for option '\".PclZipUtilOptionText($p_options_list[$i]).\"'\");\n            return PclZip::errorCode();\n          }\n\n          // ----- Get the value (and convert it in bytes)\n          $v_result_list[$p_options_list[$i]] = $v_value*1048576;\n          $i++;\n        break;\n\n        case PCLZIP_OPT_TEMP_FILE_ON :\n          // ----- Check for incompatible options\n          if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) {\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Option '\".PclZipUtilOptionText($p_options_list[$i]).\"' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'\");\n            return PclZip::errorCode();\n          }\n\n          $v_result_list[$p_options_list[$i]] = true;\n        break;\n\n        case PCLZIP_OPT_TEMP_FILE_OFF :\n          // ----- Check for incompatible options\n          if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_ON])) {\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Option '\".PclZipUtilOptionText($p_options_list[$i]).\"' can not be used with option 'PCLZIP_OPT_TEMP_FILE_ON'\");\n            return PclZip::errorCode();\n          }\n          // ----- Check for incompatible options\n          if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) {\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Option '\".PclZipUtilOptionText($p_options_list[$i]).\"' can not be used with option 'PCLZIP_OPT_TEMP_FILE_THRESHOLD'\");\n            return PclZip::errorCode();\n          }\n\n          $v_result_list[$p_options_list[$i]] = true;\n        break;\n\n        case PCLZIP_OPT_EXTRACT_DIR_RESTRICTION :\n          // ----- Check the number of parameters\n          if (($i+1) >= $p_size) {\n            // ----- Error log\n            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, \"Missing parameter value for option '\".PclZipUtilOptionText($p_options_list[$i]).\"'\");\n\n            // ----- Return\n            return PclZip::errorCode();\n          }\n\n          // ----- Get the value\n          if (   is_string($p_options_list[$i+1])\n              && ($p_options_list[$i+1] != '')) {\n            $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE);\n            $i++;\n          }\n          else {\n          }\n        break;\n\n        // ----- Look for options that request an array of string for value\n        case PCLZIP_OPT_BY_NAME :\n          // ----- Check the number of parameters\n          if (($i+1) >= $p_size) {\n            // ----- Error log\n            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, \"Missing parameter value for option '\".PclZipUtilOptionText($p_options_list[$i]).\"'\");\n\n            // ----- Return\n            return PclZip::errorCode();\n          }\n\n          // ----- Get the value\n          if (is_string($p_options_list[$i+1])) {\n              $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1];\n          }\n          else if (is_array($p_options_list[$i+1])) {\n              $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];\n          }\n          else {\n            // ----- Error log\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, \"Wrong parameter value for option '\".PclZipUtilOptionText($p_options_list[$i]).\"'\");\n\n            // ----- Return\n            return PclZip::errorCode();\n          }\n          $i++;\n        break;\n\n        // ----- Look for options that request an EREG or PREG expression\n        case PCLZIP_OPT_BY_EREG :\n          // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG\n          // to PCLZIP_OPT_BY_PREG\n          $p_options_list[$i] = PCLZIP_OPT_BY_PREG;\n        case PCLZIP_OPT_BY_PREG :\n        //case PCLZIP_OPT_CRYPT :\n          // ----- Check the number of parameters\n          if (($i+1) >= $p_size) {\n            // ----- Error log\n            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, \"Missing parameter value for option '\".PclZipUtilOptionText($p_options_list[$i]).\"'\");\n\n            // ----- Return\n            return PclZip::errorCode();\n          }\n\n          // ----- Get the value\n          if (is_string($p_options_list[$i+1])) {\n              $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];\n          }\n          else {\n            // ----- Error log\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, \"Wrong parameter value for option '\".PclZipUtilOptionText($p_options_list[$i]).\"'\");\n\n            // ----- Return\n            return PclZip::errorCode();\n          }\n          $i++;\n        break;\n\n        // ----- Look for options that takes a string\n        case PCLZIP_OPT_COMMENT :\n        case PCLZIP_OPT_ADD_COMMENT :\n        case PCLZIP_OPT_PREPEND_COMMENT :\n          // ----- Check the number of parameters\n          if (($i+1) >= $p_size) {\n            // ----- Error log\n            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE,\n\t\t\t                     \"Missing parameter value for option '\"\n\t\t\t\t\t\t\t\t .PclZipUtilOptionText($p_options_list[$i])\n\t\t\t\t\t\t\t\t .\"'\");\n\n            // ----- Return\n            return PclZip::errorCode();\n          }\n\n          // ----- Get the value\n          if (is_string($p_options_list[$i+1])) {\n              $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];\n          }\n          else {\n            // ----- Error log\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE,\n\t\t\t                     \"Wrong parameter value for option '\"\n\t\t\t\t\t\t\t\t .PclZipUtilOptionText($p_options_list[$i])\n\t\t\t\t\t\t\t\t .\"'\");\n\n            // ----- Return\n            return PclZip::errorCode();\n          }\n          $i++;\n        break;\n\n        // ----- Look for options that request an array of index\n        case PCLZIP_OPT_BY_INDEX :\n          // ----- Check the number of parameters\n          if (($i+1) >= $p_size) {\n            // ----- Error log\n            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, \"Missing parameter value for option '\".PclZipUtilOptionText($p_options_list[$i]).\"'\");\n\n            // ----- Return\n            return PclZip::errorCode();\n          }\n\n          // ----- Get the value\n          $v_work_list = array();\n          if (is_string($p_options_list[$i+1])) {\n\n              // ----- Remove spaces\n              $p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', '');\n\n              // ----- Parse items\n              $v_work_list = explode(\",\", $p_options_list[$i+1]);\n          }\n          else if (is_integer($p_options_list[$i+1])) {\n              $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1];\n          }\n          else if (is_array($p_options_list[$i+1])) {\n              $v_work_list = $p_options_list[$i+1];\n          }\n          else {\n            // ----- Error log\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, \"Value must be integer, string or array for option '\".PclZipUtilOptionText($p_options_list[$i]).\"'\");\n\n            // ----- Return\n            return PclZip::errorCode();\n          }\n\n          // ----- Reduce the index list\n          // each index item in the list must be a couple with a start and\n          // an end value : [0,3], [5-5], [8-10], ...\n          // ----- Check the format of each item\n          $v_sort_flag=false;\n          $v_sort_value=0;\n          for ($j=0; $j<sizeof($v_work_list); $j++) {\n              // ----- Explode the item\n              $v_item_list = explode(\"-\", $v_work_list[$j]);\n              $v_size_item_list = sizeof($v_item_list);\n\n              // ----- TBC : Here we might check that each item is a\n              // real integer ...\n\n              // ----- Look for single value\n              if ($v_size_item_list == 1) {\n                  // ----- Set the option value\n                  $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0];\n                  $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[0];\n              }\n              elseif ($v_size_item_list == 2) {\n                  // ----- Set the option value\n                  $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0];\n                  $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[1];\n              }\n              else {\n                  // ----- Error log\n                  PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, \"Too many values in index range for option '\".PclZipUtilOptionText($p_options_list[$i]).\"'\");\n\n                  // ----- Return\n                  return PclZip::errorCode();\n              }\n\n\n              // ----- Look for list sort\n              if ($v_result_list[$p_options_list[$i]][$j]['start'] < $v_sort_value) {\n                  $v_sort_flag=true;\n\n                  // ----- TBC : An automatic sort should be written ...\n                  // ----- Error log\n                  PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, \"Invalid order of index range for option '\".PclZipUtilOptionText($p_options_list[$i]).\"'\");\n\n                  // ----- Return\n                  return PclZip::errorCode();\n              }\n              $v_sort_value = $v_result_list[$p_options_list[$i]][$j]['start'];\n          }\n\n          // ----- Sort the items\n          if ($v_sort_flag) {\n              // TBC : To Be Completed\n          }\n\n          // ----- Next option\n          $i++;\n        break;\n\n        // ----- Look for options that request no value\n        case PCLZIP_OPT_REMOVE_ALL_PATH :\n        case PCLZIP_OPT_EXTRACT_AS_STRING :\n        case PCLZIP_OPT_NO_COMPRESSION :\n        case PCLZIP_OPT_EXTRACT_IN_OUTPUT :\n        case PCLZIP_OPT_REPLACE_NEWER :\n        case PCLZIP_OPT_STOP_ON_ERROR :\n          $v_result_list[$p_options_list[$i]] = true;\n        break;\n\n        // ----- Look for options that request an octal value\n        case PCLZIP_OPT_SET_CHMOD :\n          // ----- Check the number of parameters\n          if (($i+1) >= $p_size) {\n            // ----- Error log\n            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, \"Missing parameter value for option '\".PclZipUtilOptionText($p_options_list[$i]).\"'\");\n\n            // ----- Return\n            return PclZip::errorCode();\n          }\n\n          // ----- Get the value\n          $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];\n          $i++;\n        break;\n\n        // ----- Look for options that request a call-back\n        case PCLZIP_CB_PRE_EXTRACT :\n        case PCLZIP_CB_POST_EXTRACT :\n        case PCLZIP_CB_PRE_ADD :\n        case PCLZIP_CB_POST_ADD :\n        /* for futur use\n        case PCLZIP_CB_PRE_DELETE :\n        case PCLZIP_CB_POST_DELETE :\n        case PCLZIP_CB_PRE_LIST :\n        case PCLZIP_CB_POST_LIST :\n        */\n          // ----- Check the number of parameters\n          if (($i+1) >= $p_size) {\n            // ----- Error log\n            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, \"Missing parameter value for option '\".PclZipUtilOptionText($p_options_list[$i]).\"'\");\n\n            // ----- Return\n            return PclZip::errorCode();\n          }\n\n          // ----- Get the value\n          $v_function_name = $p_options_list[$i+1];\n\n          // ----- Check that the value is a valid existing function\n          if (!function_exists($v_function_name)) {\n            // ----- Error log\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, \"Function '\".$v_function_name.\"()' is not an existing function for option '\".PclZipUtilOptionText($p_options_list[$i]).\"'\");\n\n            // ----- Return\n            return PclZip::errorCode();\n          }\n\n          // ----- Set the attribute\n          $v_result_list[$p_options_list[$i]] = $v_function_name;\n          $i++;\n        break;\n\n        default :\n          // ----- Error log\n          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER,\n\t\t                       \"Unknown parameter '\"\n\t\t\t\t\t\t\t   .$p_options_list[$i].\"'\");\n\n          // ----- Return\n          return PclZip::errorCode();\n      }\n\n      // ----- Next options\n      $i++;\n    }\n\n    // ----- Look for mandatory options\n    if ($v_requested_options !== false) {\n      for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) {\n        // ----- Look for mandatory option\n        if ($v_requested_options[$key] == 'mandatory') {\n          // ----- Look if present\n          if (!isset($v_result_list[$key])) {\n            // ----- Error log\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Missing mandatory parameter \".PclZipUtilOptionText($key).\"(\".$key.\")\");\n\n            // ----- Return\n            return PclZip::errorCode();\n          }\n        }\n      }\n    }\n\n    // ----- Look for default values\n    if (!isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) {\n\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privOptionDefaultThreshold()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privOptionDefaultThreshold(&$p_options)\n  {\n    $v_result=1;\n\n    if (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])\n        || isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) {\n      return $v_result;\n    }\n\n    // ----- Get 'memory_limit' configuration value\n    $v_memory_limit = ini_get('memory_limit');\n    $v_memory_limit = trim($v_memory_limit);\n    $v_memory_limit_int = (int) $v_memory_limit;\n    $last = strtolower(substr($v_memory_limit, -1));\n\n    if($last == 'g')\n        //$v_memory_limit_int = $v_memory_limit_int*1024*1024*1024;\n        $v_memory_limit_int = $v_memory_limit_int*1073741824;\n    if($last == 'm')\n        //$v_memory_limit_int = $v_memory_limit_int*1024*1024;\n        $v_memory_limit_int = $v_memory_limit_int*1048576;\n    if($last == 'k')\n        $v_memory_limit_int = $v_memory_limit_int*1024;\n\n    $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit_int*PCLZIP_TEMPORARY_FILE_RATIO);\n\n\n    // ----- Sanity check : No threshold if value lower than 1M\n    if ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] < 1048576) {\n      unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]);\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privFileDescrParseAtt()\n  // Description :\n  // Parameters :\n  // Return Values :\n  //   1 on success.\n  //   0 on failure.\n  // --------------------------------------------------------------------------------\n  function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options=false)\n  {\n    $v_result=1;\n\n    // ----- For each file in the list check the attributes\n    foreach ($p_file_list as $v_key => $v_value) {\n\n      // ----- Check if the option is supported\n      if (!isset($v_requested_options[$v_key])) {\n        // ----- Error log\n        PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid file attribute '\".$v_key.\"' for this file\");\n\n        // ----- Return\n        return PclZip::errorCode();\n      }\n\n      // ----- Look for attribute\n      switch ($v_key) {\n        case PCLZIP_ATT_FILE_NAME :\n          if (!is_string($v_value)) {\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, \"Invalid type \".gettype($v_value).\". String expected for attribute '\".PclZipUtilOptionText($v_key).\"'\");\n            return PclZip::errorCode();\n          }\n\n          $p_filedescr['filename'] = PclZipUtilPathReduction($v_value);\n\n          if ($p_filedescr['filename'] == '') {\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, \"Invalid empty filename for attribute '\".PclZipUtilOptionText($v_key).\"'\");\n            return PclZip::errorCode();\n          }\n\n        break;\n\n        case PCLZIP_ATT_FILE_NEW_SHORT_NAME :\n          if (!is_string($v_value)) {\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, \"Invalid type \".gettype($v_value).\". String expected for attribute '\".PclZipUtilOptionText($v_key).\"'\");\n            return PclZip::errorCode();\n          }\n\n          $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value);\n\n          if ($p_filedescr['new_short_name'] == '') {\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, \"Invalid empty short filename for attribute '\".PclZipUtilOptionText($v_key).\"'\");\n            return PclZip::errorCode();\n          }\n        break;\n\n        case PCLZIP_ATT_FILE_NEW_FULL_NAME :\n          if (!is_string($v_value)) {\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, \"Invalid type \".gettype($v_value).\". String expected for attribute '\".PclZipUtilOptionText($v_key).\"'\");\n            return PclZip::errorCode();\n          }\n\n          $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value);\n\n          if ($p_filedescr['new_full_name'] == '') {\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, \"Invalid empty full filename for attribute '\".PclZipUtilOptionText($v_key).\"'\");\n            return PclZip::errorCode();\n          }\n        break;\n\n        // ----- Look for options that takes a string\n        case PCLZIP_ATT_FILE_COMMENT :\n          if (!is_string($v_value)) {\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, \"Invalid type \".gettype($v_value).\". String expected for attribute '\".PclZipUtilOptionText($v_key).\"'\");\n            return PclZip::errorCode();\n          }\n\n          $p_filedescr['comment'] = $v_value;\n        break;\n\n        case PCLZIP_ATT_FILE_MTIME :\n          if (!is_integer($v_value)) {\n            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, \"Invalid type \".gettype($v_value).\". Integer expected for attribute '\".PclZipUtilOptionText($v_key).\"'\");\n            return PclZip::errorCode();\n          }\n\n          $p_filedescr['mtime'] = $v_value;\n        break;\n\n        case PCLZIP_ATT_FILE_CONTENT :\n          $p_filedescr['content'] = $v_value;\n        break;\n\n        default :\n          // ----- Error log\n          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER,\n\t\t                           \"Unknown parameter '\".$v_key.\"'\");\n\n          // ----- Return\n          return PclZip::errorCode();\n      }\n\n      // ----- Look for mandatory options\n      if ($v_requested_options !== false) {\n        for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) {\n          // ----- Look for mandatory option\n          if ($v_requested_options[$key] == 'mandatory') {\n            // ----- Look if present\n            if (!isset($p_file_list[$key])) {\n              PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Missing mandatory parameter \".PclZipUtilOptionText($key).\"(\".$key.\")\");\n              return PclZip::errorCode();\n            }\n          }\n        }\n      }\n\n    // end foreach\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privFileDescrExpand()\n  // Description :\n  //   This method look for each item of the list to see if its a file, a folder\n  //   or a string to be added as file. For any other type of files (link, other)\n  //   just ignore the item.\n  //   Then prepare the information that will be stored for that file.\n  //   When its a folder, expand the folder with all the files that are in that\n  //   folder (recursively).\n  // Parameters :\n  // Return Values :\n  //   1 on success.\n  //   0 on failure.\n  // --------------------------------------------------------------------------------\n  function privFileDescrExpand(&$p_filedescr_list, &$p_options)\n  {\n    $v_result=1;\n\n    // ----- Create a result list\n    $v_result_list = array();\n\n    // ----- Look each entry\n    for ($i=0; $i<sizeof($p_filedescr_list); $i++) {\n\n      // ----- Get filedescr\n      $v_descr = $p_filedescr_list[$i];\n\n      // ----- Reduce the filename\n      $v_descr['filename'] = PclZipUtilTranslateWinPath($v_descr['filename'], false);\n      $v_descr['filename'] = PclZipUtilPathReduction($v_descr['filename']);\n\n      // ----- Look for real file or folder\n      if (file_exists($v_descr['filename'])) {\n        if (@is_file($v_descr['filename'])) {\n          $v_descr['type'] = 'file';\n        }\n        else if (@is_dir($v_descr['filename'])) {\n          $v_descr['type'] = 'folder';\n        }\n        else if (@is_link($v_descr['filename'])) {\n          // skip\n          continue;\n        }\n        else {\n          // skip\n          continue;\n        }\n      }\n\n      // ----- Look for string added as file\n      else if (isset($v_descr['content'])) {\n        $v_descr['type'] = 'virtual_file';\n      }\n\n      // ----- Missing file\n      else {\n        // ----- Error log\n        PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, \"File '\".$v_descr['filename'].\"' does not exist\");\n\n        // ----- Return\n        return PclZip::errorCode();\n      }\n\n      // ----- Calculate the stored filename\n      $this->privCalculateStoredFilename($v_descr, $p_options);\n\n      // ----- Add the descriptor in result list\n      $v_result_list[sizeof($v_result_list)] = $v_descr;\n\n      // ----- Look for folder\n      if ($v_descr['type'] == 'folder') {\n        // ----- List of items in folder\n        $v_dirlist_descr = array();\n        $v_dirlist_nb = 0;\n        if ($v_folder_handler = @opendir($v_descr['filename'])) {\n          while (($v_item_handler = @readdir($v_folder_handler)) !== false) {\n\n            // ----- Skip '.' and '..'\n            if (($v_item_handler == '.') || ($v_item_handler == '..')) {\n                continue;\n            }\n\n            // ----- Compose the full filename\n            $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler;\n\n            // ----- Look for different stored filename\n            // Because the name of the folder was changed, the name of the\n            // files/sub-folders also change\n            if (($v_descr['stored_filename'] != $v_descr['filename'])\n                 && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) {\n              if ($v_descr['stored_filename'] != '') {\n                $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler;\n              }\n              else {\n                $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_item_handler;\n              }\n            }\n\n            $v_dirlist_nb++;\n          }\n\n          @closedir($v_folder_handler);\n        }\n        else {\n          // TBC : unable to open folder in read mode\n        }\n\n        // ----- Expand each element of the list\n        if ($v_dirlist_nb != 0) {\n          // ----- Expand\n          if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) {\n            return $v_result;\n          }\n\n          // ----- Concat the resulting list\n          $v_result_list = array_merge($v_result_list, $v_dirlist_descr);\n        }\n        else {\n        }\n\n        // ----- Free local array\n        unset($v_dirlist_descr);\n      }\n    }\n\n    // ----- Get the result list\n    $p_filedescr_list = $v_result_list;\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privCreate()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privCreate($p_filedescr_list, &$p_result_list, &$p_options)\n  {\n    $v_result=1;\n    $v_list_detail = array();\n\n    // ----- Magic quotes trick\n    $this->privDisableMagicQuotes();\n\n    // ----- Open the file in write mode\n    if (($v_result = $this->privOpenFd('wb')) != 1)\n    {\n      // ----- Return\n      return $v_result;\n    }\n\n    // ----- Add the list of files\n    $v_result = $this->privAddList($p_filedescr_list, $p_result_list, $p_options);\n\n    // ----- Close\n    $this->privCloseFd();\n\n    // ----- Magic quotes trick\n    $this->privSwapBackMagicQuotes();\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privAdd()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privAdd($p_filedescr_list, &$p_result_list, &$p_options)\n  {\n    $v_result=1;\n    $v_list_detail = array();\n\n    // ----- Look if the archive exists or is empty\n    if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0))\n    {\n\n      // ----- Do a create\n      $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options);\n\n      // ----- Return\n      return $v_result;\n    }\n    // ----- Magic quotes trick\n    $this->privDisableMagicQuotes();\n\n    // ----- Open the zip file\n    if (($v_result=$this->privOpenFd('rb')) != 1)\n    {\n      // ----- Magic quotes trick\n      $this->privSwapBackMagicQuotes();\n\n      // ----- Return\n      return $v_result;\n    }\n\n    // ----- Read the central directory information\n    $v_central_dir = array();\n    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)\n    {\n      $this->privCloseFd();\n      $this->privSwapBackMagicQuotes();\n      return $v_result;\n    }\n\n    // ----- Go to beginning of File\n    @rewind($this->zip_fd);\n\n    // ----- Creates a temporary file\n    $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';\n\n    // ----- Open the temporary file in write mode\n    if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0)\n    {\n      $this->privCloseFd();\n      $this->privSwapBackMagicQuotes();\n\n      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \\''.$v_zip_temp_name.'\\' in binary write mode');\n\n      // ----- Return\n      return PclZip::errorCode();\n    }\n\n    // ----- Copy the files from the archive to the temporary file\n    // TBC : Here I should better append the file and go back to erase the central dir\n    $v_size = $v_central_dir['offset'];\n    while ($v_size != 0)\n    {\n      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n      $v_buffer = fread($this->zip_fd, $v_read_size);\n      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);\n      $v_size -= $v_read_size;\n    }\n\n    // ----- Swap the file descriptor\n    // Here is a trick : I swap the temporary fd with the zip fd, in order to use\n    // the following methods on the temporary fil and not the real archive\n    $v_swap = $this->zip_fd;\n    $this->zip_fd = $v_zip_temp_fd;\n    $v_zip_temp_fd = $v_swap;\n\n    // ----- Add the files\n    $v_header_list = array();\n    if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1)\n    {\n      fclose($v_zip_temp_fd);\n      $this->privCloseFd();\n      @unlink($v_zip_temp_name);\n      $this->privSwapBackMagicQuotes();\n\n      // ----- Return\n      return $v_result;\n    }\n\n    // ----- Store the offset of the central dir\n    $v_offset = @ftell($this->zip_fd);\n\n    // ----- Copy the block of file headers from the old archive\n    $v_size = $v_central_dir['size'];\n    while ($v_size != 0)\n    {\n      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n      $v_buffer = @fread($v_zip_temp_fd, $v_read_size);\n      @fwrite($this->zip_fd, $v_buffer, $v_read_size);\n      $v_size -= $v_read_size;\n    }\n\n    // ----- Create the Central Dir files header\n    for ($i=0, $v_count=0; $i<sizeof($v_header_list); $i++)\n    {\n      // ----- Create the file header\n      if ($v_header_list[$i]['status'] == 'ok') {\n        if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) {\n          fclose($v_zip_temp_fd);\n          $this->privCloseFd();\n          @unlink($v_zip_temp_name);\n          $this->privSwapBackMagicQuotes();\n\n          // ----- Return\n          return $v_result;\n        }\n        $v_count++;\n      }\n\n      // ----- Transform the header to a 'usable' info\n      $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);\n    }\n\n    // ----- Zip file comment\n    $v_comment = $v_central_dir['comment'];\n    if (isset($p_options[PCLZIP_OPT_COMMENT])) {\n      $v_comment = $p_options[PCLZIP_OPT_COMMENT];\n    }\n    if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) {\n      $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT];\n    }\n    if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) {\n      $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment;\n    }\n\n    // ----- Calculate the size of the central header\n    $v_size = @ftell($this->zip_fd)-$v_offset;\n\n    // ----- Create the central dir footer\n    if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1)\n    {\n      // ----- Reset the file list\n      unset($v_header_list);\n      $this->privSwapBackMagicQuotes();\n\n      // ----- Return\n      return $v_result;\n    }\n\n    // ----- Swap back the file descriptor\n    $v_swap = $this->zip_fd;\n    $this->zip_fd = $v_zip_temp_fd;\n    $v_zip_temp_fd = $v_swap;\n\n    // ----- Close\n    $this->privCloseFd();\n\n    // ----- Close the temporary file\n    @fclose($v_zip_temp_fd);\n\n    // ----- Magic quotes trick\n    $this->privSwapBackMagicQuotes();\n\n    // ----- Delete the zip file\n    // TBC : I should test the result ...\n    @unlink($this->zipname);\n\n    // ----- Rename the temporary file\n    // TBC : I should test the result ...\n    //@rename($v_zip_temp_name, $this->zipname);\n    PclZipUtilRename($v_zip_temp_name, $this->zipname);\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privOpenFd()\n  // Description :\n  // Parameters :\n  // --------------------------------------------------------------------------------\n  function privOpenFd($p_mode)\n  {\n    $v_result=1;\n\n    // ----- Look if already open\n    if ($this->zip_fd != 0)\n    {\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \\''.$this->zipname.'\\' already open');\n\n      // ----- Return\n      return PclZip::errorCode();\n    }\n\n    // ----- Open the zip file\n    if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0)\n    {\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \\''.$this->zipname.'\\' in '.$p_mode.' mode');\n\n      // ----- Return\n      return PclZip::errorCode();\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privCloseFd()\n  // Description :\n  // Parameters :\n  // --------------------------------------------------------------------------------\n  function privCloseFd()\n  {\n    $v_result=1;\n\n    if ($this->zip_fd != 0)\n      @fclose($this->zip_fd);\n    $this->zip_fd = 0;\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privAddList()\n  // Description :\n  //   $p_add_dir and $p_remove_dir will give the ability to memorize a path which is\n  //   different from the real path of the file. This is useful if you want to have PclTar\n  //   running in any directory, and memorize relative path from an other directory.\n  // Parameters :\n  //   $p_list : An array containing the file or directory names to add in the tar\n  //   $p_result_list : list of added files with their properties (specially the status field)\n  //   $p_add_dir : Path to add in the filename path archived\n  //   $p_remove_dir : Path to remove in the filename path archived\n  // Return Values :\n  // --------------------------------------------------------------------------------\n//  function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options)\n  function privAddList($p_filedescr_list, &$p_result_list, &$p_options)\n  {\n    $v_result=1;\n\n    // ----- Add the files\n    $v_header_list = array();\n    if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1)\n    {\n      // ----- Return\n      return $v_result;\n    }\n\n    // ----- Store the offset of the central dir\n    $v_offset = @ftell($this->zip_fd);\n\n    // ----- Create the Central Dir files header\n    for ($i=0,$v_count=0; $i<sizeof($v_header_list); $i++)\n    {\n      // ----- Create the file header\n      if ($v_header_list[$i]['status'] == 'ok') {\n        if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) {\n          // ----- Return\n          return $v_result;\n        }\n        $v_count++;\n      }\n\n      // ----- Transform the header to a 'usable' info\n      $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);\n    }\n\n    // ----- Zip file comment\n    $v_comment = '';\n    if (isset($p_options[PCLZIP_OPT_COMMENT])) {\n      $v_comment = $p_options[PCLZIP_OPT_COMMENT];\n    }\n\n    // ----- Calculate the size of the central header\n    $v_size = @ftell($this->zip_fd)-$v_offset;\n\n    // ----- Create the central dir footer\n    if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1)\n    {\n      // ----- Reset the file list\n      unset($v_header_list);\n\n      // ----- Return\n      return $v_result;\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privAddFileList()\n  // Description :\n  // Parameters :\n  //   $p_filedescr_list : An array containing the file description\n  //                      or directory names to add in the zip\n  //   $p_result_list : list of added files with their properties (specially the status field)\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options)\n  {\n    $v_result=1;\n    $v_header = array();\n\n    // ----- Recuperate the current number of elt in list\n    $v_nb = sizeof($p_result_list);\n\n    // ----- Loop on the files\n    for ($j=0; ($j<sizeof($p_filedescr_list)) && ($v_result==1); $j++) {\n      // ----- Format the filename\n      $p_filedescr_list[$j]['filename']\n      = PclZipUtilTranslateWinPath($p_filedescr_list[$j]['filename'], false);\n\n\n      // ----- Skip empty file names\n      // TBC : Can this be possible ? not checked in DescrParseAtt ?\n      if ($p_filedescr_list[$j]['filename'] == \"\") {\n        continue;\n      }\n\n      // ----- Check the filename\n      if (   ($p_filedescr_list[$j]['type'] != 'virtual_file')\n          && (!file_exists($p_filedescr_list[$j]['filename']))) {\n        PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, \"File '\".$p_filedescr_list[$j]['filename'].\"' does not exist\");\n        return PclZip::errorCode();\n      }\n\n      // ----- Look if it is a file or a dir with no all path remove option\n      // or a dir with all its path removed\n//      if (   (is_file($p_filedescr_list[$j]['filename']))\n//          || (   is_dir($p_filedescr_list[$j]['filename'])\n      if (   ($p_filedescr_list[$j]['type'] == 'file')\n          || ($p_filedescr_list[$j]['type'] == 'virtual_file')\n          || (   ($p_filedescr_list[$j]['type'] == 'folder')\n              && (   !isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])\n                  || !$p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))\n          ) {\n\n        // ----- Add the file\n        $v_result = $this->privAddFile($p_filedescr_list[$j], $v_header,\n                                       $p_options);\n        if ($v_result != 1) {\n          return $v_result;\n        }\n\n        // ----- Store the file infos\n        $p_result_list[$v_nb++] = $v_header;\n      }\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privAddFile()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privAddFile($p_filedescr, &$p_header, &$p_options)\n  {\n    $v_result=1;\n\n    // ----- Working variable\n    $p_filename = $p_filedescr['filename'];\n\n    // TBC : Already done in the fileAtt check ... ?\n    if ($p_filename == \"\") {\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid file list parameter (invalid or empty list)\");\n\n      // ----- Return\n      return PclZip::errorCode();\n    }\n\n    // ----- Look for a stored different filename\n    /* TBC : Removed\n    if (isset($p_filedescr['stored_filename'])) {\n      $v_stored_filename = $p_filedescr['stored_filename'];\n    }\n    else {\n      $v_stored_filename = $p_filedescr['stored_filename'];\n    }\n    */\n\n    // ----- Set the file properties\n    clearstatcache();\n    $p_header['version'] = 20;\n    $p_header['version_extracted'] = 10;\n    $p_header['flag'] = 0;\n    $p_header['compression'] = 0;\n    $p_header['crc'] = 0;\n    $p_header['compressed_size'] = 0;\n    $p_header['filename_len'] = strlen($p_filename);\n    $p_header['extra_len'] = 0;\n    $p_header['disk'] = 0;\n    $p_header['internal'] = 0;\n    $p_header['offset'] = 0;\n    $p_header['filename'] = $p_filename;\n// TBC : Removed    $p_header['stored_filename'] = $v_stored_filename;\n    $p_header['stored_filename'] = $p_filedescr['stored_filename'];\n    $p_header['extra'] = '';\n    $p_header['status'] = 'ok';\n    $p_header['index'] = -1;\n\n    // ----- Look for regular file\n    if ($p_filedescr['type']=='file') {\n      $p_header['external'] = 0x00000000;\n      $p_header['size'] = filesize($p_filename);\n    }\n\n    // ----- Look for regular folder\n    else if ($p_filedescr['type']=='folder') {\n      $p_header['external'] = 0x00000010;\n      $p_header['mtime'] = filemtime($p_filename);\n      $p_header['size'] = filesize($p_filename);\n    }\n\n    // ----- Look for virtual file\n    else if ($p_filedescr['type'] == 'virtual_file') {\n      $p_header['external'] = 0x00000000;\n      $p_header['size'] = strlen($p_filedescr['content']);\n    }\n\n\n    // ----- Look for filetime\n    if (isset($p_filedescr['mtime'])) {\n      $p_header['mtime'] = $p_filedescr['mtime'];\n    }\n    else if ($p_filedescr['type'] == 'virtual_file') {\n      $p_header['mtime'] = time();\n    }\n    else {\n      $p_header['mtime'] = filemtime($p_filename);\n    }\n\n    // ------ Look for file comment\n    if (isset($p_filedescr['comment'])) {\n      $p_header['comment_len'] = strlen($p_filedescr['comment']);\n      $p_header['comment'] = $p_filedescr['comment'];\n    }\n    else {\n      $p_header['comment_len'] = 0;\n      $p_header['comment'] = '';\n    }\n\n    // ----- Look for pre-add callback\n    if (isset($p_options[PCLZIP_CB_PRE_ADD])) {\n\n      // ----- Generate a local information\n      $v_local_header = array();\n      $this->privConvertHeader2FileInfo($p_header, $v_local_header);\n\n      // ----- Call the callback\n      // Here I do not use call_user_func() because I need to send a reference to the\n      // header.\n      $v_result = $p_options[PCLZIP_CB_PRE_ADD](PCLZIP_CB_PRE_ADD, $v_local_header);\n      if ($v_result == 0) {\n        // ----- Change the file status\n        $p_header['status'] = \"skipped\";\n        $v_result = 1;\n      }\n\n      // ----- Update the information\n      // Only some fields can be modified\n      if ($p_header['stored_filename'] != $v_local_header['stored_filename']) {\n        $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']);\n      }\n    }\n\n    // ----- Look for empty stored filename\n    if ($p_header['stored_filename'] == \"\") {\n      $p_header['status'] = \"filtered\";\n    }\n\n    // ----- Check the path length\n    if (strlen($p_header['stored_filename']) > 0xFF) {\n      $p_header['status'] = 'filename_too_long';\n    }\n\n    // ----- Look if no error, or file not skipped\n    if ($p_header['status'] == 'ok') {\n\n      // ----- Look for a file\n      if ($p_filedescr['type'] == 'file') {\n        // ----- Look for using temporary file to zip\n        if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF]))\n            && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON])\n                || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])\n                    && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_header['size'])) ) ) {\n          $v_result = $this->privAddFileUsingTempFile($p_filedescr, $p_header, $p_options);\n          if ($v_result < PCLZIP_ERR_NO_ERROR) {\n            return $v_result;\n          }\n        }\n\n        // ----- Use \"in memory\" zip algo\n        else {\n\n        // ----- Open the source file\n        if (($v_file = @fopen($p_filename, \"rb\")) == 0) {\n          PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, \"Unable to open file '$p_filename' in binary read mode\");\n          return PclZip::errorCode();\n        }\n\n        // ----- Read the file content\n        $v_content = @fread($v_file, $p_header['size']);\n\n        // ----- Close the file\n        @fclose($v_file);\n\n        // ----- Calculate the CRC\n        $p_header['crc'] = @crc32($v_content);\n\n        // ----- Look for no compression\n        if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {\n          // ----- Set header parameters\n          $p_header['compressed_size'] = $p_header['size'];\n          $p_header['compression'] = 0;\n        }\n\n        // ----- Look for normal compression\n        else {\n          // ----- Compress the content\n          $v_content = @gzdeflate($v_content);\n\n          // ----- Set header parameters\n          $p_header['compressed_size'] = strlen($v_content);\n          $p_header['compression'] = 8;\n        }\n\n        // ----- Call the header generation\n        if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {\n          @fclose($v_file);\n          return $v_result;\n        }\n\n        // ----- Write the compressed (or not) content\n        @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']);\n\n        }\n\n      }\n\n      // ----- Look for a virtual file (a file from string)\n      else if ($p_filedescr['type'] == 'virtual_file') {\n\n        $v_content = $p_filedescr['content'];\n\n        // ----- Calculate the CRC\n        $p_header['crc'] = @crc32($v_content);\n\n        // ----- Look for no compression\n        if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {\n          // ----- Set header parameters\n          $p_header['compressed_size'] = $p_header['size'];\n          $p_header['compression'] = 0;\n        }\n\n        // ----- Look for normal compression\n        else {\n          // ----- Compress the content\n          $v_content = @gzdeflate($v_content);\n\n          // ----- Set header parameters\n          $p_header['compressed_size'] = strlen($v_content);\n          $p_header['compression'] = 8;\n        }\n\n        // ----- Call the header generation\n        if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {\n          @fclose($v_file);\n          return $v_result;\n        }\n\n        // ----- Write the compressed (or not) content\n        @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']);\n      }\n\n      // ----- Look for a directory\n      else if ($p_filedescr['type'] == 'folder') {\n        // ----- Look for directory last '/'\n        if (@substr($p_header['stored_filename'], -1) != '/') {\n          $p_header['stored_filename'] .= '/';\n        }\n\n        // ----- Set the file properties\n        $p_header['size'] = 0;\n        //$p_header['external'] = 0x41FF0010;   // Value for a folder : to be checked\n        $p_header['external'] = 0x00000010;   // Value for a folder : to be checked\n\n        // ----- Call the header generation\n        if (($v_result = $this->privWriteFileHeader($p_header)) != 1)\n        {\n          return $v_result;\n        }\n      }\n    }\n\n    // ----- Look for post-add callback\n    if (isset($p_options[PCLZIP_CB_POST_ADD])) {\n\n      // ----- Generate a local information\n      $v_local_header = array();\n      $this->privConvertHeader2FileInfo($p_header, $v_local_header);\n\n      // ----- Call the callback\n      // Here I do not use call_user_func() because I need to send a reference to the\n      // header.\n      $v_result = $p_options[PCLZIP_CB_POST_ADD](PCLZIP_CB_POST_ADD, $v_local_header);\n      if ($v_result == 0) {\n        // ----- Ignored\n        $v_result = 1;\n      }\n\n      // ----- Update the information\n      // Nothing can be modified\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privAddFileUsingTempFile()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privAddFileUsingTempFile($p_filedescr, &$p_header, &$p_options)\n  {\n    $v_result=PCLZIP_ERR_NO_ERROR;\n\n    // ----- Working variable\n    $p_filename = $p_filedescr['filename'];\n\n\n    // ----- Open the source file\n    if (($v_file = @fopen($p_filename, \"rb\")) == 0) {\n      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, \"Unable to open file '$p_filename' in binary read mode\");\n      return PclZip::errorCode();\n    }\n\n    // ----- Creates a compressed temporary file\n    $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz';\n    if (($v_file_compressed = @gzopen($v_gzip_temp_name, \"wb\")) == 0) {\n      fclose($v_file);\n      PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \\''.$v_gzip_temp_name.'\\' in binary write mode');\n      return PclZip::errorCode();\n    }\n\n    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks\n    $v_size = filesize($p_filename);\n    while ($v_size != 0) {\n      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n      $v_buffer = @fread($v_file, $v_read_size);\n      //$v_binary_data = pack('a'.$v_read_size, $v_buffer);\n      @gzputs($v_file_compressed, $v_buffer, $v_read_size);\n      $v_size -= $v_read_size;\n    }\n\n    // ----- Close the file\n    @fclose($v_file);\n    @gzclose($v_file_compressed);\n\n    // ----- Check the minimum file size\n    if (filesize($v_gzip_temp_name) < 18) {\n      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'gzip temporary file \\''.$v_gzip_temp_name.'\\' has invalid filesize - should be minimum 18 bytes');\n      return PclZip::errorCode();\n    }\n\n    // ----- Extract the compressed attributes\n    if (($v_file_compressed = @fopen($v_gzip_temp_name, \"rb\")) == 0) {\n      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \\''.$v_gzip_temp_name.'\\' in binary read mode');\n      return PclZip::errorCode();\n    }\n\n    // ----- Read the gzip file header\n    $v_binary_data = @fread($v_file_compressed, 10);\n    $v_data_header = unpack('a1id1/a1id2/a1cm/a1flag/Vmtime/a1xfl/a1os', $v_binary_data);\n\n    // ----- Check some parameters\n    $v_data_header['os'] = bin2hex($v_data_header['os']);\n\n    // ----- Read the gzip file footer\n    @fseek($v_file_compressed, filesize($v_gzip_temp_name)-8);\n    $v_binary_data = @fread($v_file_compressed, 8);\n    $v_data_footer = unpack('Vcrc/Vcompressed_size', $v_binary_data);\n\n    // ----- Set the attributes\n    $p_header['compression'] = ord($v_data_header['cm']);\n    //$p_header['mtime'] = $v_data_header['mtime'];\n    $p_header['crc'] = $v_data_footer['crc'];\n    $p_header['compressed_size'] = filesize($v_gzip_temp_name)-18;\n\n    // ----- Close the file\n    @fclose($v_file_compressed);\n\n    // ----- Call the header generation\n    if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {\n      return $v_result;\n    }\n\n    // ----- Add the compressed data\n    if (($v_file_compressed = @fopen($v_gzip_temp_name, \"rb\")) == 0)\n    {\n      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \\''.$v_gzip_temp_name.'\\' in binary read mode');\n      return PclZip::errorCode();\n    }\n\n    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks\n    fseek($v_file_compressed, 10);\n    $v_size = $p_header['compressed_size'];\n    while ($v_size != 0)\n    {\n      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n      $v_buffer = @fread($v_file_compressed, $v_read_size);\n      //$v_binary_data = pack('a'.$v_read_size, $v_buffer);\n      @fwrite($this->zip_fd, $v_buffer, $v_read_size);\n      $v_size -= $v_read_size;\n    }\n\n    // ----- Close the file\n    @fclose($v_file_compressed);\n\n    // ----- Unlink the temporary file\n    @unlink($v_gzip_temp_name);\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privCalculateStoredFilename()\n  // Description :\n  //   Based on file descriptor properties and global options, this method\n  //   calculate the filename that will be stored in the archive.\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privCalculateStoredFilename(&$p_filedescr, &$p_options)\n  {\n    $v_result=1;\n\n    // ----- Working variables\n    $p_filename = $p_filedescr['filename'];\n    if (isset($p_options[PCLZIP_OPT_ADD_PATH])) {\n      $p_add_dir = $p_options[PCLZIP_OPT_ADD_PATH];\n    }\n    else {\n      $p_add_dir = '';\n    }\n    if (isset($p_options[PCLZIP_OPT_REMOVE_PATH])) {\n      $p_remove_dir = $p_options[PCLZIP_OPT_REMOVE_PATH];\n    }\n    else {\n      $p_remove_dir = '';\n    }\n    if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {\n      $p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH];\n    }\n    else {\n      $p_remove_all_dir = 0;\n    }\n\n\n    // ----- Look for full name change\n    if (isset($p_filedescr['new_full_name'])) {\n      // ----- Remove drive letter if any\n      $v_stored_filename = PclZipUtilTranslateWinPath($p_filedescr['new_full_name']);\n    }\n\n    // ----- Look for path and/or short name change\n    else {\n\n      // ----- Look for short name change\n      // Its when we change just the filename but not the path\n      if (isset($p_filedescr['new_short_name'])) {\n        $v_path_info = pathinfo($p_filename);\n        $v_dir = '';\n        if ($v_path_info['dirname'] != '') {\n          $v_dir = $v_path_info['dirname'].'/';\n        }\n        $v_stored_filename = $v_dir.$p_filedescr['new_short_name'];\n      }\n      else {\n        // ----- Calculate the stored filename\n        $v_stored_filename = $p_filename;\n      }\n\n      // ----- Look for all path to remove\n      if ($p_remove_all_dir) {\n        $v_stored_filename = basename($p_filename);\n      }\n      // ----- Look for partial path remove\n      else if ($p_remove_dir != \"\") {\n        if (substr($p_remove_dir, -1) != '/')\n          $p_remove_dir .= \"/\";\n\n        if (   (substr($p_filename, 0, 2) == \"./\")\n            || (substr($p_remove_dir, 0, 2) == \"./\")) {\n\n          if (   (substr($p_filename, 0, 2) == \"./\")\n              && (substr($p_remove_dir, 0, 2) != \"./\")) {\n            $p_remove_dir = \"./\".$p_remove_dir;\n          }\n          if (   (substr($p_filename, 0, 2) != \"./\")\n              && (substr($p_remove_dir, 0, 2) == \"./\")) {\n            $p_remove_dir = substr($p_remove_dir, 2);\n          }\n        }\n\n        $v_compare = PclZipUtilPathInclusion($p_remove_dir,\n                                             $v_stored_filename);\n        if ($v_compare > 0) {\n          if ($v_compare == 2) {\n            $v_stored_filename = \"\";\n          }\n          else {\n            $v_stored_filename = substr($v_stored_filename,\n                                        strlen($p_remove_dir));\n          }\n        }\n      }\n\n      // ----- Remove drive letter if any\n      $v_stored_filename = PclZipUtilTranslateWinPath($v_stored_filename);\n\n      // ----- Look for path to add\n      if ($p_add_dir != \"\") {\n        if (substr($p_add_dir, -1) == \"/\")\n          $v_stored_filename = $p_add_dir.$v_stored_filename;\n        else\n          $v_stored_filename = $p_add_dir.\"/\".$v_stored_filename;\n      }\n    }\n\n    // ----- Filename (reduce the path of stored name)\n    $v_stored_filename = PclZipUtilPathReduction($v_stored_filename);\n    $p_filedescr['stored_filename'] = $v_stored_filename;\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privWriteFileHeader()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privWriteFileHeader(&$p_header)\n  {\n    $v_result=1;\n\n    // ----- Store the offset position of the file\n    $p_header['offset'] = ftell($this->zip_fd);\n\n    // ----- Transform UNIX mtime to DOS format mdate/mtime\n    $v_date = getdate($p_header['mtime']);\n    $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;\n    $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];\n\n    // ----- Packed data\n    $v_binary_data = pack(\"VvvvvvVVVvv\", 0x04034b50,\n\t                      $p_header['version_extracted'], $p_header['flag'],\n                          $p_header['compression'], $v_mtime, $v_mdate,\n                          $p_header['crc'], $p_header['compressed_size'],\n\t\t\t\t\t\t  $p_header['size'],\n                          strlen($p_header['stored_filename']),\n\t\t\t\t\t\t  $p_header['extra_len']);\n\n    // ----- Write the first 148 bytes of the header in the archive\n    fputs($this->zip_fd, $v_binary_data, 30);\n\n    // ----- Write the variable fields\n    if (strlen($p_header['stored_filename']) != 0)\n    {\n      fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));\n    }\n    if ($p_header['extra_len'] != 0)\n    {\n      fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privWriteCentralFileHeader()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privWriteCentralFileHeader(&$p_header)\n  {\n    $v_result=1;\n\n    // TBC\n    //for(reset($p_header); $key = key($p_header); next($p_header)) {\n    //}\n\n    // ----- Transform UNIX mtime to DOS format mdate/mtime\n    $v_date = getdate($p_header['mtime']);\n    $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;\n    $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];\n\n\n    // ----- Packed data\n    $v_binary_data = pack(\"VvvvvvvVVVvvvvvVV\", 0x02014b50,\n\t                      $p_header['version'], $p_header['version_extracted'],\n                          $p_header['flag'], $p_header['compression'],\n\t\t\t\t\t\t  $v_mtime, $v_mdate, $p_header['crc'],\n                          $p_header['compressed_size'], $p_header['size'],\n                          strlen($p_header['stored_filename']),\n\t\t\t\t\t\t  $p_header['extra_len'], $p_header['comment_len'],\n                          $p_header['disk'], $p_header['internal'],\n\t\t\t\t\t\t  $p_header['external'], $p_header['offset']);\n\n    // ----- Write the 42 bytes of the header in the zip file\n    fputs($this->zip_fd, $v_binary_data, 46);\n\n    // ----- Write the variable fields\n    if (strlen($p_header['stored_filename']) != 0)\n    {\n      fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));\n    }\n    if ($p_header['extra_len'] != 0)\n    {\n      fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);\n    }\n    if ($p_header['comment_len'] != 0)\n    {\n      fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']);\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privWriteCentralHeader()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment)\n  {\n    $v_result=1;\n\n    // ----- Packed data\n    $v_binary_data = pack(\"VvvvvVVv\", 0x06054b50, 0, 0, $p_nb_entries,\n\t                      $p_nb_entries, $p_size,\n\t\t\t\t\t\t  $p_offset, strlen($p_comment));\n\n    // ----- Write the 22 bytes of the header in the zip file\n    fputs($this->zip_fd, $v_binary_data, 22);\n\n    // ----- Write the variable fields\n    if (strlen($p_comment) != 0)\n    {\n      fputs($this->zip_fd, $p_comment, strlen($p_comment));\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privList()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privList(&$p_list)\n  {\n    $v_result=1;\n\n    // ----- Magic quotes trick\n    $this->privDisableMagicQuotes();\n\n    // ----- Open the zip file\n    if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0)\n    {\n      // ----- Magic quotes trick\n      $this->privSwapBackMagicQuotes();\n\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \\''.$this->zipname.'\\' in binary read mode');\n\n      // ----- Return\n      return PclZip::errorCode();\n    }\n\n    // ----- Read the central directory information\n    $v_central_dir = array();\n    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)\n    {\n      $this->privSwapBackMagicQuotes();\n      return $v_result;\n    }\n\n    // ----- Go to beginning of Central Dir\n    @rewind($this->zip_fd);\n    if (@fseek($this->zip_fd, $v_central_dir['offset']))\n    {\n      $this->privSwapBackMagicQuotes();\n\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');\n\n      // ----- Return\n      return PclZip::errorCode();\n    }\n\n    // ----- Read each entry\n    for ($i=0; $i<$v_central_dir['entries']; $i++)\n    {\n      // ----- Read the file header\n      if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1)\n      {\n        $this->privSwapBackMagicQuotes();\n        return $v_result;\n      }\n      $v_header['index'] = $i;\n\n      // ----- Get the only interesting attributes\n      $this->privConvertHeader2FileInfo($v_header, $p_list[$i]);\n      unset($v_header);\n    }\n\n    // ----- Close the zip file\n    $this->privCloseFd();\n\n    // ----- Magic quotes trick\n    $this->privSwapBackMagicQuotes();\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privConvertHeader2FileInfo()\n  // Description :\n  //   This function takes the file information from the central directory\n  //   entries and extract the interesting parameters that will be given back.\n  //   The resulting file infos are set in the array $p_info\n  //     $p_info['filename'] : Filename with full path. Given by user (add),\n  //                           extracted in the filesystem (extract).\n  //     $p_info['stored_filename'] : Stored filename in the archive.\n  //     $p_info['size'] = Size of the file.\n  //     $p_info['compressed_size'] = Compressed size of the file.\n  //     $p_info['mtime'] = Last modification date of the file.\n  //     $p_info['comment'] = Comment associated with the file.\n  //     $p_info['folder'] = true/false : indicates if the entry is a folder or not.\n  //     $p_info['status'] = status of the action on the file.\n  //     $p_info['crc'] = CRC of the file content.\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privConvertHeader2FileInfo($p_header, &$p_info)\n  {\n    $v_result=1;\n\n    // ----- Get the interesting attributes\n    $v_temp_path = PclZipUtilPathReduction($p_header['filename']);\n    $p_info['filename'] = $v_temp_path;\n    $v_temp_path = PclZipUtilPathReduction($p_header['stored_filename']);\n    $p_info['stored_filename'] = $v_temp_path;\n    $p_info['size'] = $p_header['size'];\n    $p_info['compressed_size'] = $p_header['compressed_size'];\n    $p_info['mtime'] = $p_header['mtime'];\n    $p_info['comment'] = $p_header['comment'];\n    $p_info['folder'] = (($p_header['external']&0x00000010)==0x00000010);\n    $p_info['index'] = $p_header['index'];\n    $p_info['status'] = $p_header['status'];\n    $p_info['crc'] = $p_header['crc'];\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privExtractByRule()\n  // Description :\n  //   Extract a file or directory depending of rules (by index, by name, ...)\n  // Parameters :\n  //   $p_file_list : An array where will be placed the properties of each\n  //                  extracted file\n  //   $p_path : Path to add while writing the extracted files\n  //   $p_remove_path : Path to remove (from the file memorized path) while writing the\n  //                    extracted files. If the path does not match the file path,\n  //                    the file is extracted with its memorized path.\n  //                    $p_remove_path does not apply to 'list' mode.\n  //                    $p_path and $p_remove_path are commulative.\n  // Return Values :\n  //   1 on success,0 or less on error (see error code list)\n  // --------------------------------------------------------------------------------\n  function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)\n  {\n    $v_result=1;\n\n    // ----- Magic quotes trick\n    $this->privDisableMagicQuotes();\n\n    // ----- Check the path\n    if (   ($p_path == \"\")\n\t    || (   (substr($p_path, 0, 1) != \"/\")\n\t\t    && (substr($p_path, 0, 3) != \"../\")\n\t\t\t&& (substr($p_path,1,2)!=\":/\")))\n      $p_path = \"./\".$p_path;\n\n    // ----- Reduce the path last (and duplicated) '/'\n    if (($p_path != \"./\") && ($p_path != \"/\"))\n    {\n      // ----- Look for the path end '/'\n      while (substr($p_path, -1) == \"/\")\n      {\n        $p_path = substr($p_path, 0, strlen($p_path)-1);\n      }\n    }\n\n    // ----- Look for path to remove format (should end by /)\n    if (($p_remove_path != \"\") && (substr($p_remove_path, -1) != '/'))\n    {\n      $p_remove_path .= '/';\n    }\n    $p_remove_path_size = strlen($p_remove_path);\n\n    // ----- Open the zip file\n    if (($v_result = $this->privOpenFd('rb')) != 1)\n    {\n      $this->privSwapBackMagicQuotes();\n      return $v_result;\n    }\n\n    // ----- Read the central directory information\n    $v_central_dir = array();\n    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)\n    {\n      // ----- Close the zip file\n      $this->privCloseFd();\n      $this->privSwapBackMagicQuotes();\n\n      return $v_result;\n    }\n\n    // ----- Start at beginning of Central Dir\n    $v_pos_entry = $v_central_dir['offset'];\n\n    // ----- Read each entry\n    $j_start = 0;\n    for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++)\n    {\n\n      // ----- Read next Central dir entry\n      @rewind($this->zip_fd);\n      if (@fseek($this->zip_fd, $v_pos_entry))\n      {\n        // ----- Close the zip file\n        $this->privCloseFd();\n        $this->privSwapBackMagicQuotes();\n\n        // ----- Error log\n        PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');\n\n        // ----- Return\n        return PclZip::errorCode();\n      }\n\n      // ----- Read the file header\n      $v_header = array();\n      if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1)\n      {\n        // ----- Close the zip file\n        $this->privCloseFd();\n        $this->privSwapBackMagicQuotes();\n\n        return $v_result;\n      }\n\n      // ----- Store the index\n      $v_header['index'] = $i;\n\n      // ----- Store the file position\n      $v_pos_entry = ftell($this->zip_fd);\n\n      // ----- Look for the specific extract rules\n      $v_extract = false;\n\n      // ----- Look for extract by name rule\n      if (   (isset($p_options[PCLZIP_OPT_BY_NAME]))\n          && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) {\n\n          // ----- Look if the filename is in the list\n          for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_extract); $j++) {\n\n              // ----- Look for a directory\n              if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == \"/\") {\n\n                  // ----- Look if the directory is in the filename path\n                  if (   (strlen($v_header['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j]))\n                      && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) {\n                      $v_extract = true;\n                  }\n              }\n              // ----- Look for a filename\n              elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {\n                  $v_extract = true;\n              }\n          }\n      }\n\n      // ----- Look for extract by ereg rule\n      // ereg() is deprecated with PHP 5.3\n      /*\n      else if (   (isset($p_options[PCLZIP_OPT_BY_EREG]))\n               && ($p_options[PCLZIP_OPT_BY_EREG] != \"\")) {\n\n          if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header['stored_filename'])) {\n              $v_extract = true;\n          }\n      }\n      */\n\n      // ----- Look for extract by preg rule\n      else if (   (isset($p_options[PCLZIP_OPT_BY_PREG]))\n               && ($p_options[PCLZIP_OPT_BY_PREG] != \"\")) {\n\n          if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) {\n              $v_extract = true;\n          }\n      }\n\n      // ----- Look for extract by index rule\n      else if (   (isset($p_options[PCLZIP_OPT_BY_INDEX]))\n               && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {\n\n          // ----- Look if the index is in the list\n          for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_extract); $j++) {\n\n              if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) {\n                  $v_extract = true;\n              }\n              if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {\n                  $j_start = $j+1;\n              }\n\n              if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {\n                  break;\n              }\n          }\n      }\n\n      // ----- Look for no rule, which means extract all the archive\n      else {\n          $v_extract = true;\n      }\n\n\t  // ----- Check compression method\n\t  if (   ($v_extract)\n\t      && (   ($v_header['compression'] != 8)\n\t\t      && ($v_header['compression'] != 0))) {\n          $v_header['status'] = 'unsupported_compression';\n\n          // ----- Look for PCLZIP_OPT_STOP_ON_ERROR\n          if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))\n\t\t      && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {\n\n              $this->privSwapBackMagicQuotes();\n\n              PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION,\n\t\t\t                       \"Filename '\".$v_header['stored_filename'].\"' is \"\n\t\t\t\t  \t    \t  \t   .\"compressed by an unsupported compression \"\n\t\t\t\t  \t    \t  \t   .\"method (\".$v_header['compression'].\") \");\n\n              return PclZip::errorCode();\n\t\t  }\n\t  }\n\n\t  // ----- Check encrypted files\n\t  if (($v_extract) && (($v_header['flag'] & 1) == 1)) {\n          $v_header['status'] = 'unsupported_encryption';\n\n          // ----- Look for PCLZIP_OPT_STOP_ON_ERROR\n          if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))\n\t\t      && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {\n\n              $this->privSwapBackMagicQuotes();\n\n              PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION,\n\t\t\t                       \"Unsupported encryption for \"\n\t\t\t\t  \t    \t  \t   .\" filename '\".$v_header['stored_filename']\n\t\t\t\t\t\t\t\t   .\"'\");\n\n              return PclZip::errorCode();\n\t\t  }\n    }\n\n      // ----- Look for real extraction\n      if (($v_extract) && ($v_header['status'] != 'ok')) {\n          $v_result = $this->privConvertHeader2FileInfo($v_header,\n\t\t                                        $p_file_list[$v_nb_extracted++]);\n          if ($v_result != 1) {\n              $this->privCloseFd();\n              $this->privSwapBackMagicQuotes();\n              return $v_result;\n          }\n\n          $v_extract = false;\n      }\n\n      // ----- Look for real extraction\n      if ($v_extract)\n      {\n\n        // ----- Go to the file position\n        @rewind($this->zip_fd);\n        if (@fseek($this->zip_fd, $v_header['offset']))\n        {\n          // ----- Close the zip file\n          $this->privCloseFd();\n\n          $this->privSwapBackMagicQuotes();\n\n          // ----- Error log\n          PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');\n\n          // ----- Return\n          return PclZip::errorCode();\n        }\n\n        // ----- Look for extraction as string\n        if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) {\n\n          $v_string = '';\n\n          // ----- Extracting the file\n          $v_result1 = $this->privExtractFileAsString($v_header, $v_string, $p_options);\n          if ($v_result1 < 1) {\n            $this->privCloseFd();\n            $this->privSwapBackMagicQuotes();\n            return $v_result1;\n          }\n\n          // ----- Get the only interesting attributes\n          if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted])) != 1)\n          {\n            // ----- Close the zip file\n            $this->privCloseFd();\n            $this->privSwapBackMagicQuotes();\n\n            return $v_result;\n          }\n\n          // ----- Set the file content\n          $p_file_list[$v_nb_extracted]['content'] = $v_string;\n\n          // ----- Next extracted file\n          $v_nb_extracted++;\n\n          // ----- Look for user callback abort\n          if ($v_result1 == 2) {\n          \tbreak;\n          }\n        }\n        // ----- Look for extraction in standard output\n        elseif (   (isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT]))\n\t\t        && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) {\n          // ----- Extracting the file in standard output\n          $v_result1 = $this->privExtractFileInOutput($v_header, $p_options);\n          if ($v_result1 < 1) {\n            $this->privCloseFd();\n            $this->privSwapBackMagicQuotes();\n            return $v_result1;\n          }\n\n          // ----- Get the only interesting attributes\n          if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) {\n            $this->privCloseFd();\n            $this->privSwapBackMagicQuotes();\n            return $v_result;\n          }\n\n          // ----- Look for user callback abort\n          if ($v_result1 == 2) {\n          \tbreak;\n          }\n        }\n        // ----- Look for normal extraction\n        else {\n          // ----- Extracting the file\n          $v_result1 = $this->privExtractFile($v_header,\n\t\t                                      $p_path, $p_remove_path,\n\t\t\t\t\t\t\t\t\t\t\t  $p_remove_all_path,\n\t\t\t\t\t\t\t\t\t\t\t  $p_options);\n          if ($v_result1 < 1) {\n            $this->privCloseFd();\n            $this->privSwapBackMagicQuotes();\n            return $v_result1;\n          }\n\n          // ----- Get the only interesting attributes\n          if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1)\n          {\n            // ----- Close the zip file\n            $this->privCloseFd();\n            $this->privSwapBackMagicQuotes();\n\n            return $v_result;\n          }\n\n          // ----- Look for user callback abort\n          if ($v_result1 == 2) {\n          \tbreak;\n          }\n        }\n      }\n    }\n\n    // ----- Close the zip file\n    $this->privCloseFd();\n    $this->privSwapBackMagicQuotes();\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privExtractFile()\n  // Description :\n  // Parameters :\n  // Return Values :\n  //\n  // 1 : ... ?\n  // PCLZIP_ERR_USER_ABORTED(2) : User ask for extraction stop in callback\n  // --------------------------------------------------------------------------------\n  function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)\n  {\n    $v_result=1;\n\n    // ----- Read the file header\n    if (($v_result = $this->privReadFileHeader($v_header)) != 1)\n    {\n      // ----- Return\n      return $v_result;\n    }\n\n\n    // ----- Check that the file header is coherent with $p_entry info\n    if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {\n        // TBC\n    }\n\n    // ----- Look for all path to remove\n    if ($p_remove_all_path == true) {\n        // ----- Look for folder entry that not need to be extracted\n        if (($p_entry['external']&0x00000010)==0x00000010) {\n\n            $p_entry['status'] = \"filtered\";\n\n            return $v_result;\n        }\n\n        // ----- Get the basename of the path\n        $p_entry['filename'] = basename($p_entry['filename']);\n    }\n\n    // ----- Look for path to remove\n    else if ($p_remove_path != \"\")\n    {\n      if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2)\n      {\n\n        // ----- Change the file status\n        $p_entry['status'] = \"filtered\";\n\n        // ----- Return\n        return $v_result;\n      }\n\n      $p_remove_path_size = strlen($p_remove_path);\n      if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path)\n      {\n\n        // ----- Remove the path\n        $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size);\n\n      }\n    }\n\n    // ----- Add the path\n    if ($p_path != '') {\n      $p_entry['filename'] = $p_path.\"/\".$p_entry['filename'];\n    }\n\n    // ----- Check a base_dir_restriction\n    if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) {\n      $v_inclusion\n      = PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION],\n                                $p_entry['filename']);\n      if ($v_inclusion == 0) {\n\n        PclZip::privErrorLog(PCLZIP_ERR_DIRECTORY_RESTRICTION,\n\t\t\t                     \"Filename '\".$p_entry['filename'].\"' is \"\n\t\t\t\t\t\t\t\t .\"outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION\");\n\n        return PclZip::errorCode();\n      }\n    }\n\n    // ----- Look for pre-extract callback\n    if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {\n\n      // ----- Generate a local information\n      $v_local_header = array();\n      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);\n\n      // ----- Call the callback\n      // Here I do not use call_user_func() because I need to send a reference to the\n      // header.\n      $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);\n      if ($v_result == 0) {\n        // ----- Change the file status\n        $p_entry['status'] = \"skipped\";\n        $v_result = 1;\n      }\n\n      // ----- Look for abort result\n      if ($v_result == 2) {\n        // ----- This status is internal and will be changed in 'skipped'\n        $p_entry['status'] = \"aborted\";\n      \t$v_result = PCLZIP_ERR_USER_ABORTED;\n      }\n\n      // ----- Update the information\n      // Only some fields can be modified\n      $p_entry['filename'] = $v_local_header['filename'];\n    }\n\n\n    // ----- Look if extraction should be done\n    if ($p_entry['status'] == 'ok') {\n\n    // ----- Look for specific actions while the file exist\n    if (file_exists($p_entry['filename']))\n    {\n\n      // ----- Look if file is a directory\n      if (is_dir($p_entry['filename']))\n      {\n\n        // ----- Change the file status\n        $p_entry['status'] = \"already_a_directory\";\n\n        // ----- Look for PCLZIP_OPT_STOP_ON_ERROR\n        // For historical reason first PclZip implementation does not stop\n        // when this kind of error occurs.\n        if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))\n\t\t    && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {\n\n            PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY,\n\t\t\t                     \"Filename '\".$p_entry['filename'].\"' is \"\n\t\t\t\t\t\t\t\t .\"already used by an existing directory\");\n\n            return PclZip::errorCode();\n\t\t    }\n      }\n      // ----- Look if file is write protected\n      else if (!is_writeable($p_entry['filename']))\n      {\n\n        // ----- Change the file status\n        $p_entry['status'] = \"write_protected\";\n\n        // ----- Look for PCLZIP_OPT_STOP_ON_ERROR\n        // For historical reason first PclZip implementation does not stop\n        // when this kind of error occurs.\n        if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))\n\t\t    && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {\n\n            PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL,\n\t\t\t                     \"Filename '\".$p_entry['filename'].\"' exists \"\n\t\t\t\t\t\t\t\t .\"and is write protected\");\n\n            return PclZip::errorCode();\n\t\t    }\n      }\n\n      // ----- Look if the extracted file is older\n      else if (filemtime($p_entry['filename']) > $p_entry['mtime'])\n      {\n        // ----- Change the file status\n        if (   (isset($p_options[PCLZIP_OPT_REPLACE_NEWER]))\n\t\t    && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) {\n\t  \t  }\n\t\t    else {\n            $p_entry['status'] = \"newer_exist\";\n\n            // ----- Look for PCLZIP_OPT_STOP_ON_ERROR\n            // For historical reason first PclZip implementation does not stop\n            // when this kind of error occurs.\n            if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))\n\t\t        && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {\n\n                PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL,\n\t\t\t             \"Newer version of '\".$p_entry['filename'].\"' exists \"\n\t\t\t\t\t    .\"and option PCLZIP_OPT_REPLACE_NEWER is not selected\");\n\n                return PclZip::errorCode();\n\t\t      }\n\t\t    }\n      }\n      else {\n      }\n    }\n\n    // ----- Check the directory availability and create it if necessary\n    else {\n      if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/'))\n        $v_dir_to_check = $p_entry['filename'];\n      else if (!strstr($p_entry['filename'], \"/\"))\n        $v_dir_to_check = \"\";\n      else\n        $v_dir_to_check = dirname($p_entry['filename']);\n\n        if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) {\n\n          // ----- Change the file status\n          $p_entry['status'] = \"path_creation_fail\";\n\n          // ----- Return\n          //return $v_result;\n          $v_result = 1;\n        }\n      }\n    }\n\n    // ----- Look if extraction should be done\n    if ($p_entry['status'] == 'ok') {\n\n      // ----- Do the extraction (if not a folder)\n      if (!(($p_entry['external']&0x00000010)==0x00000010))\n      {\n        // ----- Look for not compressed file\n        if ($p_entry['compression'] == 0) {\n\n    \t\t  // ----- Opening destination file\n          if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0)\n          {\n\n            // ----- Change the file status\n            $p_entry['status'] = \"write_error\";\n\n            // ----- Return\n            return $v_result;\n          }\n\n\n          // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks\n          $v_size = $p_entry['compressed_size'];\n          while ($v_size != 0)\n          {\n            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n            $v_buffer = @fread($this->zip_fd, $v_read_size);\n            /* Try to speed up the code\n            $v_binary_data = pack('a'.$v_read_size, $v_buffer);\n            @fwrite($v_dest_file, $v_binary_data, $v_read_size);\n            */\n            @fwrite($v_dest_file, $v_buffer, $v_read_size);\n            $v_size -= $v_read_size;\n          }\n\n          // ----- Closing the destination file\n          fclose($v_dest_file);\n\n          // ----- Change the file mtime\n          touch($p_entry['filename'], $p_entry['mtime']);\n\n\n        }\n        else {\n          // ----- TBC\n          // Need to be finished\n          if (($p_entry['flag'] & 1) == 1) {\n            PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, 'File \\''.$p_entry['filename'].'\\' is encrypted. Encrypted files are not supported.');\n            return PclZip::errorCode();\n          }\n\n\n          // ----- Look for using temporary file to unzip\n          if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF]))\n              && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON])\n                  || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])\n                      && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_entry['size'])) ) ) {\n            $v_result = $this->privExtractFileUsingTempFile($p_entry, $p_options);\n            if ($v_result < PCLZIP_ERR_NO_ERROR) {\n              return $v_result;\n            }\n          }\n\n          // ----- Look for extract in memory\n          else {\n\n\n            // ----- Read the compressed file in a buffer (one shot)\n            $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);\n\n            // ----- Decompress the file\n            $v_file_content = @gzinflate($v_buffer);\n            unset($v_buffer);\n            if ($v_file_content === FALSE) {\n\n              // ----- Change the file status\n              // TBC\n              $p_entry['status'] = \"error\";\n\n              return $v_result;\n            }\n\n            // ----- Opening destination file\n            if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {\n\n              // ----- Change the file status\n              $p_entry['status'] = \"write_error\";\n\n              return $v_result;\n            }\n\n            // ----- Write the uncompressed data\n            @fwrite($v_dest_file, $v_file_content, $p_entry['size']);\n            unset($v_file_content);\n\n            // ----- Closing the destination file\n            @fclose($v_dest_file);\n\n          }\n\n          // ----- Change the file mtime\n          @touch($p_entry['filename'], $p_entry['mtime']);\n        }\n\n        // ----- Look for chmod option\n        if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) {\n\n          // ----- Change the mode of the file\n          @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]);\n        }\n\n      }\n    }\n\n  \t// ----- Change abort status\n  \tif ($p_entry['status'] == \"aborted\") {\n        $p_entry['status'] = \"skipped\";\n  \t}\n\n    // ----- Look for post-extract callback\n    elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {\n\n      // ----- Generate a local information\n      $v_local_header = array();\n      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);\n\n      // ----- Call the callback\n      // Here I do not use call_user_func() because I need to send a reference to the\n      // header.\n      $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);\n\n      // ----- Look for abort result\n      if ($v_result == 2) {\n      \t$v_result = PCLZIP_ERR_USER_ABORTED;\n      }\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privExtractFileUsingTempFile()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privExtractFileUsingTempFile(&$p_entry, &$p_options)\n  {\n    $v_result=1;\n\n    // ----- Creates a temporary file\n    $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz';\n    if (($v_dest_file = @fopen($v_gzip_temp_name, \"wb\")) == 0) {\n      fclose($v_file);\n      PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \\''.$v_gzip_temp_name.'\\' in binary write mode');\n      return PclZip::errorCode();\n    }\n\n\n    // ----- Write gz file format header\n    $v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x00), time(), Chr(0x00), Chr(3));\n    @fwrite($v_dest_file, $v_binary_data, 10);\n\n    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks\n    $v_size = $p_entry['compressed_size'];\n    while ($v_size != 0)\n    {\n      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n      $v_buffer = @fread($this->zip_fd, $v_read_size);\n      //$v_binary_data = pack('a'.$v_read_size, $v_buffer);\n      @fwrite($v_dest_file, $v_buffer, $v_read_size);\n      $v_size -= $v_read_size;\n    }\n\n    // ----- Write gz file format footer\n    $v_binary_data = pack('VV', $p_entry['crc'], $p_entry['size']);\n    @fwrite($v_dest_file, $v_binary_data, 8);\n\n    // ----- Close the temporary file\n    @fclose($v_dest_file);\n\n    // ----- Opening destination file\n    if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {\n      $p_entry['status'] = \"write_error\";\n      return $v_result;\n    }\n\n    // ----- Open the temporary gz file\n    if (($v_src_file = @gzopen($v_gzip_temp_name, 'rb')) == 0) {\n      @fclose($v_dest_file);\n      $p_entry['status'] = \"read_error\";\n      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \\''.$v_gzip_temp_name.'\\' in binary read mode');\n      return PclZip::errorCode();\n    }\n\n\n    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks\n    $v_size = $p_entry['size'];\n    while ($v_size != 0) {\n      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n      $v_buffer = @gzread($v_src_file, $v_read_size);\n      //$v_binary_data = pack('a'.$v_read_size, $v_buffer);\n      @fwrite($v_dest_file, $v_buffer, $v_read_size);\n      $v_size -= $v_read_size;\n    }\n    @fclose($v_dest_file);\n    @gzclose($v_src_file);\n\n    // ----- Delete the temporary file\n    @unlink($v_gzip_temp_name);\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privExtractFileInOutput()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privExtractFileInOutput(&$p_entry, &$p_options)\n  {\n    $v_result=1;\n\n    // ----- Read the file header\n    if (($v_result = $this->privReadFileHeader($v_header)) != 1) {\n      return $v_result;\n    }\n\n\n    // ----- Check that the file header is coherent with $p_entry info\n    if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {\n        // TBC\n    }\n\n    // ----- Look for pre-extract callback\n    if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {\n\n      // ----- Generate a local information\n      $v_local_header = array();\n      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);\n\n      // ----- Call the callback\n      // Here I do not use call_user_func() because I need to send a reference to the\n      // header.\n//      eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');\n      $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);\n      if ($v_result == 0) {\n        // ----- Change the file status\n        $p_entry['status'] = \"skipped\";\n        $v_result = 1;\n      }\n\n      // ----- Look for abort result\n      if ($v_result == 2) {\n        // ----- This status is internal and will be changed in 'skipped'\n        $p_entry['status'] = \"aborted\";\n      \t$v_result = PCLZIP_ERR_USER_ABORTED;\n      }\n\n      // ----- Update the information\n      // Only some fields can be modified\n      $p_entry['filename'] = $v_local_header['filename'];\n    }\n\n    // ----- Trace\n\n    // ----- Look if extraction should be done\n    if ($p_entry['status'] == 'ok') {\n\n      // ----- Do the extraction (if not a folder)\n      if (!(($p_entry['external']&0x00000010)==0x00000010)) {\n        // ----- Look for not compressed file\n        if ($p_entry['compressed_size'] == $p_entry['size']) {\n\n          // ----- Read the file in a buffer (one shot)\n          $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);\n\n          // ----- Send the file to the output\n          echo $v_buffer;\n          unset($v_buffer);\n        }\n        else {\n\n          // ----- Read the compressed file in a buffer (one shot)\n          $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);\n\n          // ----- Decompress the file\n          $v_file_content = gzinflate($v_buffer);\n          unset($v_buffer);\n\n          // ----- Send the file to the output\n          echo $v_file_content;\n          unset($v_file_content);\n        }\n      }\n    }\n\n\t// ----- Change abort status\n\tif ($p_entry['status'] == \"aborted\") {\n      $p_entry['status'] = \"skipped\";\n\t}\n\n    // ----- Look for post-extract callback\n    elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {\n\n      // ----- Generate a local information\n      $v_local_header = array();\n      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);\n\n      // ----- Call the callback\n      // Here I do not use call_user_func() because I need to send a reference to the\n      // header.\n      $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);\n\n      // ----- Look for abort result\n      if ($v_result == 2) {\n      \t$v_result = PCLZIP_ERR_USER_ABORTED;\n      }\n    }\n\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privExtractFileAsString()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privExtractFileAsString(&$p_entry, &$p_string, &$p_options)\n  {\n    $v_result=1;\n\n    // ----- Read the file header\n    $v_header = array();\n    if (($v_result = $this->privReadFileHeader($v_header)) != 1)\n    {\n      // ----- Return\n      return $v_result;\n    }\n\n\n    // ----- Check that the file header is coherent with $p_entry info\n    if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {\n        // TBC\n    }\n\n    // ----- Look for pre-extract callback\n    if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {\n\n      // ----- Generate a local information\n      $v_local_header = array();\n      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);\n\n      // ----- Call the callback\n      // Here I do not use call_user_func() because I need to send a reference to the\n      // header.\n      $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);\n      if ($v_result == 0) {\n        // ----- Change the file status\n        $p_entry['status'] = \"skipped\";\n        $v_result = 1;\n      }\n\n      // ----- Look for abort result\n      if ($v_result == 2) {\n        // ----- This status is internal and will be changed in 'skipped'\n        $p_entry['status'] = \"aborted\";\n      \t$v_result = PCLZIP_ERR_USER_ABORTED;\n      }\n\n      // ----- Update the information\n      // Only some fields can be modified\n      $p_entry['filename'] = $v_local_header['filename'];\n    }\n\n\n    // ----- Look if extraction should be done\n    if ($p_entry['status'] == 'ok') {\n\n      // ----- Do the extraction (if not a folder)\n      if (!(($p_entry['external']&0x00000010)==0x00000010)) {\n        // ----- Look for not compressed file\n  //      if ($p_entry['compressed_size'] == $p_entry['size'])\n        if ($p_entry['compression'] == 0) {\n\n          // ----- Reading the file\n          $p_string = @fread($this->zip_fd, $p_entry['compressed_size']);\n        }\n        else {\n\n          // ----- Reading the file\n          $v_data = @fread($this->zip_fd, $p_entry['compressed_size']);\n\n          // ----- Decompress the file\n          if (($p_string = @gzinflate($v_data)) === FALSE) {\n              // TBC\n          }\n        }\n\n        // ----- Trace\n      }\n      else {\n          // TBC : error : can not extract a folder in a string\n      }\n\n    }\n\n  \t// ----- Change abort status\n  \tif ($p_entry['status'] == \"aborted\") {\n        $p_entry['status'] = \"skipped\";\n  \t}\n\n    // ----- Look for post-extract callback\n    elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {\n\n      // ----- Generate a local information\n      $v_local_header = array();\n      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);\n\n      // ----- Swap the content to header\n      $v_local_header['content'] = $p_string;\n      $p_string = '';\n\n      // ----- Call the callback\n      // Here I do not use call_user_func() because I need to send a reference to the\n      // header.\n      $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);\n\n      // ----- Swap back the content to header\n      $p_string = $v_local_header['content'];\n      unset($v_local_header['content']);\n\n      // ----- Look for abort result\n      if ($v_result == 2) {\n      \t$v_result = PCLZIP_ERR_USER_ABORTED;\n      }\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privReadFileHeader()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privReadFileHeader(&$p_header)\n  {\n    $v_result=1;\n\n    // ----- Read the 4 bytes signature\n    $v_binary_data = @fread($this->zip_fd, 4);\n    $v_data = unpack('Vid', $v_binary_data);\n\n    // ----- Check signature\n    if ($v_data['id'] != 0x04034b50)\n    {\n\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure');\n\n      // ----- Return\n      return PclZip::errorCode();\n    }\n\n    // ----- Read the first 42 bytes of the header\n    $v_binary_data = fread($this->zip_fd, 26);\n\n    // ----- Look for invalid block size\n    if (strlen($v_binary_data) != 26)\n    {\n      $p_header['filename'] = \"\";\n      $p_header['status'] = \"invalid_header\";\n\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, \"Invalid block size : \".strlen($v_binary_data));\n\n      // ----- Return\n      return PclZip::errorCode();\n    }\n\n    // ----- Extract the values\n    $v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data);\n\n    // ----- Get filename\n    $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']);\n\n    // ----- Get extra_fields\n    if ($v_data['extra_len'] != 0) {\n      $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']);\n    }\n    else {\n      $p_header['extra'] = '';\n    }\n\n    // ----- Extract properties\n    $p_header['version_extracted'] = $v_data['version'];\n    $p_header['compression'] = $v_data['compression'];\n    $p_header['size'] = $v_data['size'];\n    $p_header['compressed_size'] = $v_data['compressed_size'];\n    $p_header['crc'] = $v_data['crc'];\n    $p_header['flag'] = $v_data['flag'];\n    $p_header['filename_len'] = $v_data['filename_len'];\n\n    // ----- Recuperate date in UNIX format\n    $p_header['mdate'] = $v_data['mdate'];\n    $p_header['mtime'] = $v_data['mtime'];\n    if ($p_header['mdate'] && $p_header['mtime'])\n    {\n      // ----- Extract time\n      $v_hour = ($p_header['mtime'] & 0xF800) >> 11;\n      $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;\n      $v_seconde = ($p_header['mtime'] & 0x001F)*2;\n\n      // ----- Extract date\n      $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;\n      $v_month = ($p_header['mdate'] & 0x01E0) >> 5;\n      $v_day = $p_header['mdate'] & 0x001F;\n\n      // ----- Get UNIX date format\n      $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);\n\n    }\n    else\n    {\n      $p_header['mtime'] = time();\n    }\n\n    // TBC\n    //for(reset($v_data); $key = key($v_data); next($v_data)) {\n    //}\n\n    // ----- Set the stored filename\n    $p_header['stored_filename'] = $p_header['filename'];\n\n    // ----- Set the status field\n    $p_header['status'] = \"ok\";\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privReadCentralFileHeader()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privReadCentralFileHeader(&$p_header)\n  {\n    $v_result=1;\n\n    // ----- Read the 4 bytes signature\n    $v_binary_data = @fread($this->zip_fd, 4);\n    $v_data = unpack('Vid', $v_binary_data);\n\n    // ----- Check signature\n    if ($v_data['id'] != 0x02014b50)\n    {\n\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure');\n\n      // ----- Return\n      return PclZip::errorCode();\n    }\n\n    // ----- Read the first 42 bytes of the header\n    $v_binary_data = fread($this->zip_fd, 42);\n\n    // ----- Look for invalid block size\n    if (strlen($v_binary_data) != 42)\n    {\n      $p_header['filename'] = \"\";\n      $p_header['status'] = \"invalid_header\";\n\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, \"Invalid block size : \".strlen($v_binary_data));\n\n      // ----- Return\n      return PclZip::errorCode();\n    }\n\n    // ----- Extract the values\n    $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data);\n\n    // ----- Get filename\n    if ($p_header['filename_len'] != 0)\n      $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']);\n    else\n      $p_header['filename'] = '';\n\n    // ----- Get extra\n    if ($p_header['extra_len'] != 0)\n      $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']);\n    else\n      $p_header['extra'] = '';\n\n    // ----- Get comment\n    if ($p_header['comment_len'] != 0)\n      $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']);\n    else\n      $p_header['comment'] = '';\n\n    // ----- Extract properties\n\n    // ----- Recuperate date in UNIX format\n    //if ($p_header['mdate'] && $p_header['mtime'])\n    // TBC : bug : this was ignoring time with 0/0/0\n    if (1)\n    {\n      // ----- Extract time\n      $v_hour = ($p_header['mtime'] & 0xF800) >> 11;\n      $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;\n      $v_seconde = ($p_header['mtime'] & 0x001F)*2;\n\n      // ----- Extract date\n      $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;\n      $v_month = ($p_header['mdate'] & 0x01E0) >> 5;\n      $v_day = $p_header['mdate'] & 0x001F;\n\n      // ----- Get UNIX date format\n      $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);\n\n    }\n    else\n    {\n      $p_header['mtime'] = time();\n    }\n\n    // ----- Set the stored filename\n    $p_header['stored_filename'] = $p_header['filename'];\n\n    // ----- Set default status to ok\n    $p_header['status'] = 'ok';\n\n    // ----- Look if it is a directory\n    if (substr($p_header['filename'], -1) == '/') {\n      //$p_header['external'] = 0x41FF0010;\n      $p_header['external'] = 0x00000010;\n    }\n\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privCheckFileHeaders()\n  // Description :\n  // Parameters :\n  // Return Values :\n  //   1 on success,\n  //   0 on error;\n  // --------------------------------------------------------------------------------\n  function privCheckFileHeaders(&$p_local_header, &$p_central_header)\n  {\n    $v_result=1;\n\n  \t// ----- Check the static values\n  \t// TBC\n  \tif ($p_local_header['filename'] != $p_central_header['filename']) {\n  \t}\n  \tif ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) {\n  \t}\n  \tif ($p_local_header['flag'] != $p_central_header['flag']) {\n  \t}\n  \tif ($p_local_header['compression'] != $p_central_header['compression']) {\n  \t}\n  \tif ($p_local_header['mtime'] != $p_central_header['mtime']) {\n  \t}\n  \tif ($p_local_header['filename_len'] != $p_central_header['filename_len']) {\n  \t}\n\n  \t// ----- Look for flag bit 3\n  \tif (($p_local_header['flag'] & 8) == 8) {\n          $p_local_header['size'] = $p_central_header['size'];\n          $p_local_header['compressed_size'] = $p_central_header['compressed_size'];\n          $p_local_header['crc'] = $p_central_header['crc'];\n  \t}\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privReadEndCentralDir()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privReadEndCentralDir(&$p_central_dir)\n  {\n    $v_result=1;\n\n    // ----- Go to the end of the zip file\n    $v_size = filesize($this->zipname);\n    @fseek($this->zip_fd, $v_size);\n    if (@ftell($this->zip_fd) != $v_size)\n    {\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \\''.$this->zipname.'\\'');\n\n      // ----- Return\n      return PclZip::errorCode();\n    }\n\n    // ----- First try : look if this is an archive with no commentaries (most of the time)\n    // in this case the end of central dir is at 22 bytes of the file end\n    $v_found = 0;\n    if ($v_size > 26) {\n      @fseek($this->zip_fd, $v_size-22);\n      if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22))\n      {\n        // ----- Error log\n        PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \\''.$this->zipname.'\\'');\n\n        // ----- Return\n        return PclZip::errorCode();\n      }\n\n      // ----- Read for bytes\n      $v_binary_data = @fread($this->zip_fd, 4);\n      $v_data = @unpack('Vid', $v_binary_data);\n\n      // ----- Check signature\n      if ($v_data['id'] == 0x06054b50) {\n        $v_found = 1;\n      }\n\n      $v_pos = ftell($this->zip_fd);\n    }\n\n    // ----- Go back to the maximum possible size of the Central Dir End Record\n    if (!$v_found) {\n      $v_maximum_size = 65557; // 0xFFFF + 22;\n      if ($v_maximum_size > $v_size)\n        $v_maximum_size = $v_size;\n      @fseek($this->zip_fd, $v_size-$v_maximum_size);\n      if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size))\n      {\n        // ----- Error log\n        PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \\''.$this->zipname.'\\'');\n\n        // ----- Return\n        return PclZip::errorCode();\n      }\n\n      // ----- Read byte per byte in order to find the signature\n      $v_pos = ftell($this->zip_fd);\n      $v_bytes = 0x00000000;\n      while ($v_pos < $v_size)\n      {\n        // ----- Read a byte\n        $v_byte = @fread($this->zip_fd, 1);\n\n        // -----  Add the byte\n        //$v_bytes = ($v_bytes << 8) | Ord($v_byte);\n        // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number\n        // Otherwise on systems where we have 64bit integers the check below for the magic number will fail.\n        $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);\n\n        // ----- Compare the bytes\n        if ($v_bytes == 0x504b0506)\n        {\n          $v_pos++;\n          break;\n        }\n\n        $v_pos++;\n      }\n\n      // ----- Look if not found end of central dir\n      if ($v_pos == $v_size)\n      {\n\n        // ----- Error log\n        PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, \"Unable to find End of Central Dir Record signature\");\n\n        // ----- Return\n        return PclZip::errorCode();\n      }\n    }\n\n    // ----- Read the first 18 bytes of the header\n    $v_binary_data = fread($this->zip_fd, 18);\n\n    // ----- Look for invalid block size\n    if (strlen($v_binary_data) != 18)\n    {\n\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, \"Invalid End of Central Dir Record size : \".strlen($v_binary_data));\n\n      // ----- Return\n      return PclZip::errorCode();\n    }\n\n    // ----- Extract the values\n    $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data);\n\n    // ----- Check the global size\n    if (($v_pos + $v_data['comment_size'] + 18) != $v_size) {\n\n\t  // ----- Removed in release 2.2 see readme file\n\t  // The check of the file size is a little too strict.\n\t  // Some bugs where found when a zip is encrypted/decrypted with 'crypt'.\n\t  // While decrypted, zip has training 0 bytes\n\t  if (0) {\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT,\n\t                       'The central dir is not at the end of the archive.'\n\t\t\t\t\t\t   .' Some trailing bytes exists after the archive.');\n\n      // ----- Return\n      return PclZip::errorCode();\n\t  }\n    }\n\n    // ----- Get comment\n    if ($v_data['comment_size'] != 0) {\n      $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']);\n    }\n    else\n      $p_central_dir['comment'] = '';\n\n    $p_central_dir['entries'] = $v_data['entries'];\n    $p_central_dir['disk_entries'] = $v_data['disk_entries'];\n    $p_central_dir['offset'] = $v_data['offset'];\n    $p_central_dir['size'] = $v_data['size'];\n    $p_central_dir['disk'] = $v_data['disk'];\n    $p_central_dir['disk_start'] = $v_data['disk_start'];\n\n    // TBC\n    //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) {\n    //}\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privDeleteByRule()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privDeleteByRule(&$p_result_list, &$p_options)\n  {\n    $v_result=1;\n    $v_list_detail = array();\n\n    // ----- Open the zip file\n    if (($v_result=$this->privOpenFd('rb')) != 1)\n    {\n      // ----- Return\n      return $v_result;\n    }\n\n    // ----- Read the central directory information\n    $v_central_dir = array();\n    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)\n    {\n      $this->privCloseFd();\n      return $v_result;\n    }\n\n    // ----- Go to beginning of File\n    @rewind($this->zip_fd);\n\n    // ----- Scan all the files\n    // ----- Start at beginning of Central Dir\n    $v_pos_entry = $v_central_dir['offset'];\n    @rewind($this->zip_fd);\n    if (@fseek($this->zip_fd, $v_pos_entry))\n    {\n      // ----- Close the zip file\n      $this->privCloseFd();\n\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');\n\n      // ----- Return\n      return PclZip::errorCode();\n    }\n\n    // ----- Read each entry\n    $v_header_list = array();\n    $j_start = 0;\n    for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++)\n    {\n\n      // ----- Read the file header\n      $v_header_list[$v_nb_extracted] = array();\n      if (($v_result = $this->privReadCentralFileHeader($v_header_list[$v_nb_extracted])) != 1)\n      {\n        // ----- Close the zip file\n        $this->privCloseFd();\n\n        return $v_result;\n      }\n\n\n      // ----- Store the index\n      $v_header_list[$v_nb_extracted]['index'] = $i;\n\n      // ----- Look for the specific extract rules\n      $v_found = false;\n\n      // ----- Look for extract by name rule\n      if (   (isset($p_options[PCLZIP_OPT_BY_NAME]))\n          && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) {\n\n          // ----- Look if the filename is in the list\n          for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_found); $j++) {\n\n              // ----- Look for a directory\n              if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == \"/\") {\n\n                  // ----- Look if the directory is in the filename path\n                  if (   (strlen($v_header_list[$v_nb_extracted]['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j]))\n                      && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) {\n                      $v_found = true;\n                  }\n                  elseif (   (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */\n                          && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) {\n                      $v_found = true;\n                  }\n              }\n              // ----- Look for a filename\n              elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {\n                  $v_found = true;\n              }\n          }\n      }\n\n      // ----- Look for extract by ereg rule\n      // ereg() is deprecated with PHP 5.3\n      /*\n      else if (   (isset($p_options[PCLZIP_OPT_BY_EREG]))\n               && ($p_options[PCLZIP_OPT_BY_EREG] != \"\")) {\n\n          if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {\n              $v_found = true;\n          }\n      }\n      */\n\n      // ----- Look for extract by preg rule\n      else if (   (isset($p_options[PCLZIP_OPT_BY_PREG]))\n               && ($p_options[PCLZIP_OPT_BY_PREG] != \"\")) {\n\n          if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {\n              $v_found = true;\n          }\n      }\n\n      // ----- Look for extract by index rule\n      else if (   (isset($p_options[PCLZIP_OPT_BY_INDEX]))\n               && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {\n\n          // ----- Look if the index is in the list\n          for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_found); $j++) {\n\n              if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) {\n                  $v_found = true;\n              }\n              if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {\n                  $j_start = $j+1;\n              }\n\n              if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {\n                  break;\n              }\n          }\n      }\n      else {\n      \t$v_found = true;\n      }\n\n      // ----- Look for deletion\n      if ($v_found)\n      {\n        unset($v_header_list[$v_nb_extracted]);\n      }\n      else\n      {\n        $v_nb_extracted++;\n      }\n    }\n\n    // ----- Look if something need to be deleted\n    if ($v_nb_extracted > 0) {\n\n        // ----- Creates a temporary file\n        $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';\n\n        // ----- Creates a temporary zip archive\n        $v_temp_zip = new PclZip($v_zip_temp_name);\n\n        // ----- Open the temporary zip file in write mode\n        if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) {\n            $this->privCloseFd();\n\n            // ----- Return\n            return $v_result;\n        }\n\n        // ----- Look which file need to be kept\n        for ($i=0; $i<sizeof($v_header_list); $i++) {\n\n            // ----- Calculate the position of the header\n            @rewind($this->zip_fd);\n            if (@fseek($this->zip_fd,  $v_header_list[$i]['offset'])) {\n                // ----- Close the zip file\n                $this->privCloseFd();\n                $v_temp_zip->privCloseFd();\n                @unlink($v_zip_temp_name);\n\n                // ----- Error log\n                PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');\n\n                // ----- Return\n                return PclZip::errorCode();\n            }\n\n            // ----- Read the file header\n            $v_local_header = array();\n            if (($v_result = $this->privReadFileHeader($v_local_header)) != 1) {\n                // ----- Close the zip file\n                $this->privCloseFd();\n                $v_temp_zip->privCloseFd();\n                @unlink($v_zip_temp_name);\n\n                // ----- Return\n                return $v_result;\n            }\n\n            // ----- Check that local file header is same as central file header\n            if ($this->privCheckFileHeaders($v_local_header,\n\t\t\t                                $v_header_list[$i]) != 1) {\n                // TBC\n            }\n            unset($v_local_header);\n\n            // ----- Write the file header\n            if (($v_result = $v_temp_zip->privWriteFileHeader($v_header_list[$i])) != 1) {\n                // ----- Close the zip file\n                $this->privCloseFd();\n                $v_temp_zip->privCloseFd();\n                @unlink($v_zip_temp_name);\n\n                // ----- Return\n                return $v_result;\n            }\n\n            // ----- Read/write the data block\n            if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) {\n                // ----- Close the zip file\n                $this->privCloseFd();\n                $v_temp_zip->privCloseFd();\n                @unlink($v_zip_temp_name);\n\n                // ----- Return\n                return $v_result;\n            }\n        }\n\n        // ----- Store the offset of the central dir\n        $v_offset = @ftell($v_temp_zip->zip_fd);\n\n        // ----- Re-Create the Central Dir files header\n        for ($i=0; $i<sizeof($v_header_list); $i++) {\n            // ----- Create the file header\n            if (($v_result = $v_temp_zip->privWriteCentralFileHeader($v_header_list[$i])) != 1) {\n                $v_temp_zip->privCloseFd();\n                $this->privCloseFd();\n                @unlink($v_zip_temp_name);\n\n                // ----- Return\n                return $v_result;\n            }\n\n            // ----- Transform the header to a 'usable' info\n            $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);\n        }\n\n\n        // ----- Zip file comment\n        $v_comment = '';\n        if (isset($p_options[PCLZIP_OPT_COMMENT])) {\n          $v_comment = $p_options[PCLZIP_OPT_COMMENT];\n        }\n\n        // ----- Calculate the size of the central header\n        $v_size = @ftell($v_temp_zip->zip_fd)-$v_offset;\n\n        // ----- Create the central dir footer\n        if (($v_result = $v_temp_zip->privWriteCentralHeader(sizeof($v_header_list), $v_size, $v_offset, $v_comment)) != 1) {\n            // ----- Reset the file list\n            unset($v_header_list);\n            $v_temp_zip->privCloseFd();\n            $this->privCloseFd();\n            @unlink($v_zip_temp_name);\n\n            // ----- Return\n            return $v_result;\n        }\n\n        // ----- Close\n        $v_temp_zip->privCloseFd();\n        $this->privCloseFd();\n\n        // ----- Delete the zip file\n        // TBC : I should test the result ...\n        @unlink($this->zipname);\n\n        // ----- Rename the temporary file\n        // TBC : I should test the result ...\n        //@rename($v_zip_temp_name, $this->zipname);\n        PclZipUtilRename($v_zip_temp_name, $this->zipname);\n\n        // ----- Destroy the temporary archive\n        unset($v_temp_zip);\n    }\n\n    // ----- Remove every files : reset the file\n    else if ($v_central_dir['entries'] != 0) {\n        $this->privCloseFd();\n\n        if (($v_result = $this->privOpenFd('wb')) != 1) {\n          return $v_result;\n        }\n\n        if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) {\n          return $v_result;\n        }\n\n        $this->privCloseFd();\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privDirCheck()\n  // Description :\n  //   Check if a directory exists, if not it creates it and all the parents directory\n  //   which may be useful.\n  // Parameters :\n  //   $p_dir : Directory path to check.\n  // Return Values :\n  //    1 : OK\n  //   -1 : Unable to create directory\n  // --------------------------------------------------------------------------------\n  function privDirCheck($p_dir, $p_is_dir=false)\n  {\n    $v_result = 1;\n\n\n    // ----- Remove the final '/'\n    if (($p_is_dir) && (substr($p_dir, -1)=='/'))\n    {\n      $p_dir = substr($p_dir, 0, strlen($p_dir)-1);\n    }\n\n    // ----- Check the directory availability\n    if ((is_dir($p_dir)) || ($p_dir == \"\"))\n    {\n      return 1;\n    }\n\n    // ----- Extract parent directory\n    $p_parent_dir = dirname($p_dir);\n\n    // ----- Just a check\n    if ($p_parent_dir != $p_dir)\n    {\n      // ----- Look for parent directory\n      if ($p_parent_dir != \"\")\n      {\n        if (($v_result = $this->privDirCheck($p_parent_dir)) != 1)\n        {\n          return $v_result;\n        }\n      }\n    }\n\n    // ----- Create the directory\n    if (!@mkdir($p_dir, 0777))\n    {\n      // ----- Error log\n      PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, \"Unable to create directory '$p_dir'\");\n\n      // ----- Return\n      return PclZip::errorCode();\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privMerge()\n  // Description :\n  //   If $p_archive_to_add does not exist, the function exit with a success result.\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privMerge(&$p_archive_to_add)\n  {\n    $v_result=1;\n\n    // ----- Look if the archive_to_add exists\n    if (!is_file($p_archive_to_add->zipname))\n    {\n\n      // ----- Nothing to merge, so merge is a success\n      $v_result = 1;\n\n      // ----- Return\n      return $v_result;\n    }\n\n    // ----- Look if the archive exists\n    if (!is_file($this->zipname))\n    {\n\n      // ----- Do a duplicate\n      $v_result = $this->privDuplicate($p_archive_to_add->zipname);\n\n      // ----- Return\n      return $v_result;\n    }\n\n    // ----- Open the zip file\n    if (($v_result=$this->privOpenFd('rb')) != 1)\n    {\n      // ----- Return\n      return $v_result;\n    }\n\n    // ----- Read the central directory information\n    $v_central_dir = array();\n    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)\n    {\n      $this->privCloseFd();\n      return $v_result;\n    }\n\n    // ----- Go to beginning of File\n    @rewind($this->zip_fd);\n\n    // ----- Open the archive_to_add file\n    if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1)\n    {\n      $this->privCloseFd();\n\n      // ----- Return\n      return $v_result;\n    }\n\n    // ----- Read the central directory information\n    $v_central_dir_to_add = array();\n    if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1)\n    {\n      $this->privCloseFd();\n      $p_archive_to_add->privCloseFd();\n\n      return $v_result;\n    }\n\n    // ----- Go to beginning of File\n    @rewind($p_archive_to_add->zip_fd);\n\n    // ----- Creates a temporary file\n    $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';\n\n    // ----- Open the temporary file in write mode\n    if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0)\n    {\n      $this->privCloseFd();\n      $p_archive_to_add->privCloseFd();\n\n      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \\''.$v_zip_temp_name.'\\' in binary write mode');\n\n      // ----- Return\n      return PclZip::errorCode();\n    }\n\n    // ----- Copy the files from the archive to the temporary file\n    // TBC : Here I should better append the file and go back to erase the central dir\n    $v_size = $v_central_dir['offset'];\n    while ($v_size != 0)\n    {\n      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n      $v_buffer = fread($this->zip_fd, $v_read_size);\n      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);\n      $v_size -= $v_read_size;\n    }\n\n    // ----- Copy the files from the archive_to_add into the temporary file\n    $v_size = $v_central_dir_to_add['offset'];\n    while ($v_size != 0)\n    {\n      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n      $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size);\n      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);\n      $v_size -= $v_read_size;\n    }\n\n    // ----- Store the offset of the central dir\n    $v_offset = @ftell($v_zip_temp_fd);\n\n    // ----- Copy the block of file headers from the old archive\n    $v_size = $v_central_dir['size'];\n    while ($v_size != 0)\n    {\n      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n      $v_buffer = @fread($this->zip_fd, $v_read_size);\n      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);\n      $v_size -= $v_read_size;\n    }\n\n    // ----- Copy the block of file headers from the archive_to_add\n    $v_size = $v_central_dir_to_add['size'];\n    while ($v_size != 0)\n    {\n      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n      $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size);\n      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);\n      $v_size -= $v_read_size;\n    }\n\n    // ----- Merge the file comments\n    $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment'];\n\n    // ----- Calculate the size of the (new) central header\n    $v_size = @ftell($v_zip_temp_fd)-$v_offset;\n\n    // ----- Swap the file descriptor\n    // Here is a trick : I swap the temporary fd with the zip fd, in order to use\n    // the following methods on the temporary fil and not the real archive fd\n    $v_swap = $this->zip_fd;\n    $this->zip_fd = $v_zip_temp_fd;\n    $v_zip_temp_fd = $v_swap;\n\n    // ----- Create the central dir footer\n    if (($v_result = $this->privWriteCentralHeader($v_central_dir['entries']+$v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment)) != 1)\n    {\n      $this->privCloseFd();\n      $p_archive_to_add->privCloseFd();\n      @fclose($v_zip_temp_fd);\n      $this->zip_fd = null;\n\n      // ----- Reset the file list\n      unset($v_header_list);\n\n      // ----- Return\n      return $v_result;\n    }\n\n    // ----- Swap back the file descriptor\n    $v_swap = $this->zip_fd;\n    $this->zip_fd = $v_zip_temp_fd;\n    $v_zip_temp_fd = $v_swap;\n\n    // ----- Close\n    $this->privCloseFd();\n    $p_archive_to_add->privCloseFd();\n\n    // ----- Close the temporary file\n    @fclose($v_zip_temp_fd);\n\n    // ----- Delete the zip file\n    // TBC : I should test the result ...\n    @unlink($this->zipname);\n\n    // ----- Rename the temporary file\n    // TBC : I should test the result ...\n    //@rename($v_zip_temp_name, $this->zipname);\n    PclZipUtilRename($v_zip_temp_name, $this->zipname);\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privDuplicate()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privDuplicate($p_archive_filename)\n  {\n    $v_result=1;\n\n    // ----- Look if the $p_archive_filename exists\n    if (!is_file($p_archive_filename))\n    {\n\n      // ----- Nothing to duplicate, so duplicate is a success.\n      $v_result = 1;\n\n      // ----- Return\n      return $v_result;\n    }\n\n    // ----- Open the zip file\n    if (($v_result=$this->privOpenFd('wb')) != 1)\n    {\n      // ----- Return\n      return $v_result;\n    }\n\n    // ----- Open the temporary file in write mode\n    if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0)\n    {\n      $this->privCloseFd();\n\n      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \\''.$p_archive_filename.'\\' in binary write mode');\n\n      // ----- Return\n      return PclZip::errorCode();\n    }\n\n    // ----- Copy the files from the archive to the temporary file\n    // TBC : Here I should better append the file and go back to erase the central dir\n    $v_size = filesize($p_archive_filename);\n    while ($v_size != 0)\n    {\n      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n      $v_buffer = fread($v_zip_temp_fd, $v_read_size);\n      @fwrite($this->zip_fd, $v_buffer, $v_read_size);\n      $v_size -= $v_read_size;\n    }\n\n    // ----- Close\n    $this->privCloseFd();\n\n    // ----- Close the temporary file\n    @fclose($v_zip_temp_fd);\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privErrorLog()\n  // Description :\n  // Parameters :\n  // --------------------------------------------------------------------------------\n  function privErrorLog($p_error_code=0, $p_error_string='')\n  {\n    if (PCLZIP_ERROR_EXTERNAL == 1) {\n      PclError($p_error_code, $p_error_string);\n    }\n    else {\n      $this->error_code = $p_error_code;\n      $this->error_string = $p_error_string;\n    }\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privErrorReset()\n  // Description :\n  // Parameters :\n  // --------------------------------------------------------------------------------\n  function privErrorReset()\n  {\n    if (PCLZIP_ERROR_EXTERNAL == 1) {\n      PclErrorReset();\n    }\n    else {\n      $this->error_code = 0;\n      $this->error_string = '';\n    }\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privDisableMagicQuotes()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privDisableMagicQuotes()\n  {\n    $v_result=1;\n\n\t// EDIT for WordPress 5.3.0\n\t// magic_quote functions are deprecated in PHP 7.4, now assuming it's always off.\n\t/*\n\n    // ----- Look if function exists\n    if (   (!function_exists(\"get_magic_quotes_runtime\"))\n\t    || (!function_exists(\"set_magic_quotes_runtime\"))) {\n      return $v_result;\n\t}\n\n    // ----- Look if already done\n    if ($this->magic_quotes_status != -1) {\n      return $v_result;\n\t}\n\n\t// ----- Get and memorize the magic_quote value\n\t$this->magic_quotes_status = @get_magic_quotes_runtime();\n\n\t// ----- Disable magic_quotes\n\tif ($this->magic_quotes_status == 1) {\n\t  @set_magic_quotes_runtime(0);\n\t}\n\t*/\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : privSwapBackMagicQuotes()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function privSwapBackMagicQuotes()\n  {\n    $v_result=1;\n\n\t// EDIT for WordPress 5.3.0\n\t// magic_quote functions are deprecated in PHP 7.4, now assuming it's always off.\n\t/*\n\n    // ----- Look if function exists\n    if (   (!function_exists(\"get_magic_quotes_runtime\"))\n\t    || (!function_exists(\"set_magic_quotes_runtime\"))) {\n      return $v_result;\n\t}\n\n    // ----- Look if something to do\n    if ($this->magic_quotes_status != -1) {\n      return $v_result;\n\t}\n\n\t// ----- Swap back magic_quotes\n\tif ($this->magic_quotes_status == 1) {\n  \t  @set_magic_quotes_runtime($this->magic_quotes_status);\n\t}\n\n\t*/\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  }\n  // End of class\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : PclZipUtilPathReduction()\n  // Description :\n  // Parameters :\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function PclZipUtilPathReduction($p_dir)\n  {\n    $v_result = \"\";\n\n    // ----- Look for not empty path\n    if ($p_dir != \"\") {\n      // ----- Explode path by directory names\n      $v_list = explode(\"/\", $p_dir);\n\n      // ----- Study directories from last to first\n      $v_skip = 0;\n      for ($i=sizeof($v_list)-1; $i>=0; $i--) {\n        // ----- Look for current path\n        if ($v_list[$i] == \".\") {\n          // ----- Ignore this directory\n          // Should be the first $i=0, but no check is done\n        }\n        else if ($v_list[$i] == \"..\") {\n\t\t  $v_skip++;\n        }\n        else if ($v_list[$i] == \"\") {\n\t\t  // ----- First '/' i.e. root slash\n\t\t  if ($i == 0) {\n            $v_result = \"/\".$v_result;\n\t\t    if ($v_skip > 0) {\n\t\t        // ----- It is an invalid path, so the path is not modified\n\t\t        // TBC\n\t\t        $v_result = $p_dir;\n                $v_skip = 0;\n\t\t    }\n\t\t  }\n\t\t  // ----- Last '/' i.e. indicates a directory\n\t\t  else if ($i == (sizeof($v_list)-1)) {\n            $v_result = $v_list[$i];\n\t\t  }\n\t\t  // ----- Double '/' inside the path\n\t\t  else {\n            // ----- Ignore only the double '//' in path,\n            // but not the first and last '/'\n\t\t  }\n        }\n        else {\n\t\t  // ----- Look for item to skip\n\t\t  if ($v_skip > 0) {\n\t\t    $v_skip--;\n\t\t  }\n\t\t  else {\n            $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?\"/\".$v_result:\"\");\n\t\t  }\n        }\n      }\n\n      // ----- Look for skip\n      if ($v_skip > 0) {\n        while ($v_skip > 0) {\n            $v_result = '../'.$v_result;\n            $v_skip--;\n        }\n      }\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : PclZipUtilPathInclusion()\n  // Description :\n  //   This function indicates if the path $p_path is under the $p_dir tree. Or,\n  //   said in an other way, if the file or sub-dir $p_path is inside the dir\n  //   $p_dir.\n  //   The function indicates also if the path is exactly the same as the dir.\n  //   This function supports path with duplicated '/' like '//', but does not\n  //   support '.' or '..' statements.\n  // Parameters :\n  // Return Values :\n  //   0 if $p_path is not inside directory $p_dir\n  //   1 if $p_path is inside directory $p_dir\n  //   2 if $p_path is exactly the same as $p_dir\n  // --------------------------------------------------------------------------------\n  function PclZipUtilPathInclusion($p_dir, $p_path)\n  {\n    $v_result = 1;\n\n    // ----- Look for path beginning by ./\n    if (   ($p_dir == '.')\n        || ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) {\n      $p_dir = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_dir, 1);\n    }\n    if (   ($p_path == '.')\n        || ((strlen($p_path) >=2) && (substr($p_path, 0, 2) == './'))) {\n      $p_path = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_path, 1);\n    }\n\n    // ----- Explode dir and path by directory separator\n    $v_list_dir = explode(\"/\", $p_dir);\n    $v_list_dir_size = sizeof($v_list_dir);\n    $v_list_path = explode(\"/\", $p_path);\n    $v_list_path_size = sizeof($v_list_path);\n\n    // ----- Study directories paths\n    $i = 0;\n    $j = 0;\n    while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) {\n\n      // ----- Look for empty dir (path reduction)\n      if ($v_list_dir[$i] == '') {\n        $i++;\n        continue;\n      }\n      if ($v_list_path[$j] == '') {\n        $j++;\n        continue;\n      }\n\n      // ----- Compare the items\n      if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ( $v_list_path[$j] != ''))  {\n        $v_result = 0;\n      }\n\n      // ----- Next items\n      $i++;\n      $j++;\n    }\n\n    // ----- Look if everything seems to be the same\n    if ($v_result) {\n      // ----- Skip all the empty items\n      while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++;\n      while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++;\n\n      if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) {\n        // ----- There are exactly the same\n        $v_result = 2;\n      }\n      else if ($i < $v_list_dir_size) {\n        // ----- The path is shorter than the dir\n        $v_result = 0;\n      }\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : PclZipUtilCopyBlock()\n  // Description :\n  // Parameters :\n  //   $p_mode : read/write compression mode\n  //             0 : src & dest normal\n  //             1 : src gzip, dest normal\n  //             2 : src normal, dest gzip\n  //             3 : src & dest gzip\n  // Return Values :\n  // --------------------------------------------------------------------------------\n  function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0)\n  {\n    $v_result = 1;\n\n    if ($p_mode==0)\n    {\n      while ($p_size != 0)\n      {\n        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);\n        $v_buffer = @fread($p_src, $v_read_size);\n        @fwrite($p_dest, $v_buffer, $v_read_size);\n        $p_size -= $v_read_size;\n      }\n    }\n    else if ($p_mode==1)\n    {\n      while ($p_size != 0)\n      {\n        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);\n        $v_buffer = @gzread($p_src, $v_read_size);\n        @fwrite($p_dest, $v_buffer, $v_read_size);\n        $p_size -= $v_read_size;\n      }\n    }\n    else if ($p_mode==2)\n    {\n      while ($p_size != 0)\n      {\n        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);\n        $v_buffer = @fread($p_src, $v_read_size);\n        @gzwrite($p_dest, $v_buffer, $v_read_size);\n        $p_size -= $v_read_size;\n      }\n    }\n    else if ($p_mode==3)\n    {\n      while ($p_size != 0)\n      {\n        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);\n        $v_buffer = @gzread($p_src, $v_read_size);\n        @gzwrite($p_dest, $v_buffer, $v_read_size);\n        $p_size -= $v_read_size;\n      }\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : PclZipUtilRename()\n  // Description :\n  //   This function tries to do a simple rename() function. If it fails, it\n  //   tries to copy the $p_src file in a new $p_dest file and then unlink the\n  //   first one.\n  // Parameters :\n  //   $p_src : Old filename\n  //   $p_dest : New filename\n  // Return Values :\n  //   1 on success, 0 on failure.\n  // --------------------------------------------------------------------------------\n  function PclZipUtilRename($p_src, $p_dest)\n  {\n    $v_result = 1;\n\n    // ----- Try to rename the files\n    if (!@rename($p_src, $p_dest)) {\n\n      // ----- Try to copy & unlink the src\n      if (!@copy($p_src, $p_dest)) {\n        $v_result = 0;\n      }\n      else if (!@unlink($p_src)) {\n        $v_result = 0;\n      }\n    }\n\n    // ----- Return\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : PclZipUtilOptionText()\n  // Description :\n  //   Translate option value in text. Mainly for debug purpose.\n  // Parameters :\n  //   $p_option : the option value.\n  // Return Values :\n  //   The option text value.\n  // --------------------------------------------------------------------------------\n  function PclZipUtilOptionText($p_option)\n  {\n\n    $v_list = get_defined_constants();\n    for (reset($v_list); $v_key = key($v_list); next($v_list)) {\n\t    $v_prefix = substr($v_key, 0, 10);\n\t    if ((   ($v_prefix == 'PCLZIP_OPT')\n           || ($v_prefix == 'PCLZIP_CB_')\n           || ($v_prefix == 'PCLZIP_ATT'))\n\t        && ($v_list[$v_key] == $p_option)) {\n        return $v_key;\n\t    }\n    }\n\n    $v_result = 'Unknown';\n\n    return $v_result;\n  }\n  // --------------------------------------------------------------------------------\n\n  // --------------------------------------------------------------------------------\n  // Function : PclZipUtilTranslateWinPath()\n  // Description :\n  //   Translate windows path by replacing '\\' by '/' and optionally removing\n  //   drive letter.\n  // Parameters :\n  //   $p_path : path to translate.\n  //   $p_remove_disk_letter : true | false\n  // Return Values :\n  //   The path translated.\n  // --------------------------------------------------------------------------------\n  function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true)\n  {\n    if (stristr(php_uname(), 'windows')) {\n      // ----- Look for potential disk letter\n      if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) {\n          $p_path = substr($p_path, $v_position+1);\n      }\n      // ----- Change potential windows directory separator\n      if ((strpos($p_path, '\\\\') > 0) || (substr($p_path, 0,1) == '\\\\')) {\n          $p_path = strtr($p_path, '\\\\', '/');\n      }\n    }\n    return $p_path;\n  }\n  // --------------------------------------------------------------------------------\n\n\n?>\n", "num_lines": 5703}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrader API: Plugin_Installer_Skin class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Plugin Installer Skin for WordPress Plugin Installer.\n *\n * @since 2.8.0\n * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.\n *\n * @see WP_Upgrader_Skin\n */\nclass Plugin_Installer_Skin extends WP_Upgrader_Skin {\n\tpublic $api;\n\tpublic $type;\n\tpublic $url;\n\tpublic $overwrite;\n\n\tprivate $is_downgrading = false;\n\n\t/**\n\t * @param array $args\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\t$defaults = array(\n\t\t\t'type'      => 'web',\n\t\t\t'url'       => '',\n\t\t\t'plugin'    => '',\n\t\t\t'nonce'     => '',\n\t\t\t'title'     => '',\n\t\t\t'overwrite' => '',\n\t\t);\n\t\t$args     = wp_parse_args( $args, $defaults );\n\n\t\t$this->type      = $args['type'];\n\t\t$this->url       = $args['url'];\n\t\t$this->api       = isset( $args['api'] ) ? $args['api'] : array();\n\t\t$this->overwrite = $args['overwrite'];\n\n\t\tparent::__construct( $args );\n\t}\n\n\t/**\n\t * Action to perform before installing a plugin.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function before() {\n\t\tif ( ! empty( $this->api ) ) {\n\t\t\t$this->upgrader->strings['process_success'] = sprintf(\n\t\t\t\t$this->upgrader->strings['process_success_specific'],\n\t\t\t\t$this->api->name,\n\t\t\t\t$this->api->version\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Hides the `process_failed` error when updating a plugin by uploading a zip file.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_Error $wp_error WP_Error.\n\t * @return bool\n\t */\n\tpublic function hide_process_failed( $wp_error ) {\n\t\tif (\n\t\t\t'upload' === $this->type &&\n\t\t\t'' === $this->overwrite &&\n\t\t\t$wp_error->get_error_code() === 'folder_exists'\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Action to perform following a plugin install.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function after() {\n\t\t// Check if the plugin can be overwritten and output the HTML.\n\t\tif ( $this->do_overwrite() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$plugin_file = $this->upgrader->plugin_info();\n\n\t\t$install_actions = array();\n\n\t\t$from = isset( $_GET['from'] ) ? wp_unslash( $_GET['from'] ) : 'plugins';\n\n\t\tif ( 'import' === $from ) {\n\t\t\t$install_actions['activate_plugin'] = sprintf(\n\t\t\t\t'<a class=\"button button-primary\" href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\twp_nonce_url( 'plugins.php?action=activate&amp;from=import&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ),\n\t\t\t\t__( 'Activate Plugin &amp; Run Importer' )\n\t\t\t);\n\t\t} elseif ( 'press-this' === $from ) {\n\t\t\t$install_actions['activate_plugin'] = sprintf(\n\t\t\t\t'<a class=\"button button-primary\" href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\twp_nonce_url( 'plugins.php?action=activate&amp;from=press-this&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ),\n\t\t\t\t__( 'Activate Plugin &amp; Return to Press This' )\n\t\t\t);\n\t\t} else {\n\t\t\t$install_actions['activate_plugin'] = sprintf(\n\t\t\t\t'<a class=\"button button-primary\" href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\twp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ),\n\t\t\t\t__( 'Activate Plugin' )\n\t\t\t);\n\t\t}\n\n\t\tif ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) {\n\t\t\t$install_actions['network_activate'] = sprintf(\n\t\t\t\t'<a class=\"button button-primary\" href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\twp_nonce_url( 'plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ),\n\t\t\t\t__( 'Network Activate' )\n\t\t\t);\n\t\t\tunset( $install_actions['activate_plugin'] );\n\t\t}\n\n\t\tif ( 'import' === $from ) {\n\t\t\t$install_actions['importers_page'] = sprintf(\n\t\t\t\t'<a href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\tadmin_url( 'import.php' ),\n\t\t\t\t__( 'Return to Importers' )\n\t\t\t);\n\t\t} elseif ( 'web' === $this->type ) {\n\t\t\t$install_actions['plugins_page'] = sprintf(\n\t\t\t\t'<a href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\tself_admin_url( 'plugin-install.php' ),\n\t\t\t\t__( 'Return to Plugin Installer' )\n\t\t\t);\n\t\t} elseif ( 'upload' === $this->type && 'plugins' === $from ) {\n\t\t\t$install_actions['plugins_page'] = sprintf(\n\t\t\t\t'<a href=\"%s\">%s</a>',\n\t\t\t\tself_admin_url( 'plugin-install.php' ),\n\t\t\t\t__( 'Return to Plugin Installer' )\n\t\t\t);\n\t\t} else {\n\t\t\t$install_actions['plugins_page'] = sprintf(\n\t\t\t\t'<a href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\tself_admin_url( 'plugins.php' ),\n\t\t\t\t__( 'Return to Plugins page' )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! $this->result || is_wp_error( $this->result ) ) {\n\t\t\tunset( $install_actions['activate_plugin'], $install_actions['network_activate'] );\n\t\t} elseif ( ! current_user_can( 'activate_plugin', $plugin_file ) || is_plugin_active( $plugin_file ) ) {\n\t\t\tunset( $install_actions['activate_plugin'] );\n\t\t}\n\n\t\t/**\n\t\t * Filters the list of action links available following a single plugin installation.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param string[] $install_actions Array of plugin action links.\n\t\t * @param object   $api             Object containing WordPress.org API plugin data. Empty\n\t\t *                                  for non-API installs, such as when a plugin is installed\n\t\t *                                  via upload.\n\t\t * @param string   $plugin_file     Path to the plugin file relative to the plugins directory.\n\t\t */\n\t\t$install_actions = apply_filters( 'install_plugin_complete_actions', $install_actions, $this->api, $plugin_file );\n\n\t\tif ( ! empty( $install_actions ) ) {\n\t\t\t$this->feedback( implode( ' ', (array) $install_actions ) );\n\t\t}\n\t}\n\n\t/**\n\t * Check if the plugin can be overwritten and output the HTML for overwriting a plugin on upload.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return bool Whether the plugin can be overwritten and HTML was outputted.\n\t */\n\tprivate function do_overwrite() {\n\t\tif ( 'upload' !== $this->type || ! is_wp_error( $this->result ) || 'folder_exists' !== $this->result->get_error_code() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$folder = $this->result->get_error_data( 'folder_exists' );\n\t\t$folder = ltrim( substr( $folder, strlen( WP_PLUGIN_DIR ) ), '/' );\n\n\t\t$current_plugin_data = false;\n\t\t$all_plugins         = get_plugins();\n\n\t\tforeach ( $all_plugins as $plugin => $plugin_data ) {\n\t\t\tif ( strrpos( $plugin, $folder ) !== 0 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$current_plugin_data = $plugin_data;\n\t\t}\n\n\t\t$new_plugin_data = $this->upgrader->new_plugin_data;\n\n\t\tif ( ! $current_plugin_data || ! $new_plugin_data ) {\n\t\t\treturn false;\n\t\t}\n\n\t\techo '<h2 class=\"update-from-upload-heading\">' . esc_html( __( 'This plugin is already installed.' ) ) . '</h2>';\n\n\t\t$this->is_downgrading = version_compare( $current_plugin_data['Version'], $new_plugin_data['Version'], '>' );\n\n\t\t$rows = array(\n\t\t\t'Name'        => __( 'Plugin name' ),\n\t\t\t'Version'     => __( 'Version' ),\n\t\t\t'Author'      => __( 'Author' ),\n\t\t\t'RequiresWP'  => __( 'Required WordPress version' ),\n\t\t\t'RequiresPHP' => __( 'Required PHP version' ),\n\t\t);\n\n\t\t$table  = '<table class=\"update-from-upload-comparison\"><tbody>';\n\t\t$table .= '<tr><th></th><th>' . esc_html( __( 'Current' ) ) . '</th>';\n\t\t$table .= '<th>' . esc_html( __( 'Uploaded' ) ) . '</th></tr>';\n\n\t\t$is_same_plugin = true; // Let's consider only these rows.\n\n\t\tforeach ( $rows as $field => $label ) {\n\t\t\t$old_value = ! empty( $current_plugin_data[ $field ] ) ? (string) $current_plugin_data[ $field ] : '-';\n\t\t\t$new_value = ! empty( $new_plugin_data[ $field ] ) ? (string) $new_plugin_data[ $field ] : '-';\n\n\t\t\t$is_same_plugin = $is_same_plugin && ( $old_value === $new_value );\n\n\t\t\t$diff_field   = ( 'Version' !== $field && $new_value !== $old_value );\n\t\t\t$diff_version = ( 'Version' === $field && $this->is_downgrading );\n\n\t\t\t$table .= '<tr><td class=\"name-label\">' . $label . '</td><td>' . wp_strip_all_tags( $old_value ) . '</td>';\n\t\t\t$table .= ( $diff_field || $diff_version ) ? '<td class=\"warning\">' : '<td>';\n\t\t\t$table .= wp_strip_all_tags( $new_value ) . '</td></tr>';\n\t\t}\n\n\t\t$table .= '</tbody></table>';\n\n\t\t/**\n\t\t * Filters the compare table output for overwriting a plugin package on upload.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param string $table               The output table with Name, Version, Author, RequiresWP, and RequiresPHP info.\n\t\t * @param array  $current_plugin_data Array with current plugin data.\n\t\t * @param array  $new_plugin_data     Array with uploaded plugin data.\n\t\t */\n\t\techo apply_filters( 'install_plugin_overwrite_comparison', $table, $current_plugin_data, $new_plugin_data );\n\n\t\t$install_actions = array();\n\t\t$can_update      = true;\n\n\t\t$blocked_message  = '<p>' . esc_html( __( 'The plugin cannot be updated due to the following:' ) ) . '</p>';\n\t\t$blocked_message .= '<ul class=\"ul-disc\">';\n\n\t\t$requires_php = isset( $new_plugin_data['RequiresPHP'] ) ? $new_plugin_data['RequiresPHP'] : null;\n\t\t$requires_wp  = isset( $new_plugin_data['RequiresWP'] ) ? $new_plugin_data['RequiresWP'] : null;\n\n\t\tif ( ! is_php_version_compatible( $requires_php ) ) {\n\t\t\t$error = sprintf(\n\t\t\t\t/* translators: 1: Current PHP version, 2: Version required by the uploaded plugin. */\n\t\t\t\t__( 'The PHP version on your server is %1$s, however the uploaded plugin requires %2$s.' ),\n\t\t\t\tphpversion(),\n\t\t\t\t$requires_php\n\t\t\t);\n\n\t\t\t$blocked_message .= '<li>' . esc_html( $error ) . '</li>';\n\t\t\t$can_update       = false;\n\t\t}\n\n\t\tif ( ! is_wp_version_compatible( $requires_wp ) ) {\n\t\t\t$error = sprintf(\n\t\t\t\t/* translators: 1: Current WordPress version, 2: Version required by the uploaded plugin. */\n\t\t\t\t__( 'Your WordPress version is %1$s, however the uploaded plugin requires %2$s.' ),\n\t\t\t\tget_bloginfo( 'version' ),\n\t\t\t\t$requires_wp\n\t\t\t);\n\n\t\t\t$blocked_message .= '<li>' . esc_html( $error ) . '</li>';\n\t\t\t$can_update       = false;\n\t\t}\n\n\t\t$blocked_message .= '</ul>';\n\n\t\tif ( $can_update ) {\n\t\t\tif ( $this->is_downgrading ) {\n\t\t\t\t$warning = sprintf(\n\t\t\t\t\t/* translators: %s: Documentation URL. */\n\t\t\t\t\t__( 'You are uploading an older version of a current plugin. You can continue to install the older version, but be sure to <a href=\"%s\">back up your database and files</a> first.' ),\n\t\t\t\t\t__( 'https://wordpress.org/support/article/wordpress-backups/' )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$warning = sprintf(\n\t\t\t\t\t/* translators: %s: Documentation URL. */\n\t\t\t\t\t__( 'You are updating a plugin. Be sure to <a href=\"%s\">back up your database and files</a> first.' ),\n\t\t\t\t\t__( 'https://wordpress.org/support/article/wordpress-backups/' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\techo '<p class=\"update-from-upload-notice\">' . $warning . '</p>';\n\n\t\t\t$overwrite = $this->is_downgrading ? 'downgrade-plugin' : 'update-plugin';\n\n\t\t\t$install_actions['overwrite_plugin'] = sprintf(\n\t\t\t\t'<a class=\"button button-primary update-from-upload-overwrite\" href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\twp_nonce_url( add_query_arg( 'overwrite', $overwrite, $this->url ), 'plugin-upload' ),\n\t\t\t\t__( 'Replace current with uploaded' )\n\t\t\t);\n\t\t} else {\n\t\t\techo $blocked_message;\n\t\t}\n\n\t\t$cancel_url = add_query_arg( 'action', 'upload-plugin-cancel-overwrite', $this->url );\n\n\t\t$install_actions['plugins_page'] = sprintf(\n\t\t\t'<a class=\"button\" href=\"%s\">%s</a>',\n\t\t\twp_nonce_url( $cancel_url, 'plugin-upload-cancel-overwrite' ),\n\t\t\t__( 'Cancel and go back' )\n\t\t);\n\n\t\t/**\n\t\t * Filters the list of action links available following a single plugin installation\n\t\t * failure when overwriting is allowed.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param string[] $install_actions Array of plugin action links.\n\t\t * @param object   $api             Object containing WordPress.org API plugin data.\n\t\t * @param array    $new_plugin_data Array with uploaded plugin data.\n\t\t */\n\t\t$install_actions = apply_filters( 'install_plugin_overwrite_actions', $install_actions, $this->api, $new_plugin_data );\n\n\t\tif ( ! empty( $install_actions ) ) {\n\t\t\tprintf(\n\t\t\t\t'<p class=\"update-from-upload-expired hidden\">%s</p>',\n\t\t\t\t__( 'The uploaded file has expired. Please go back and upload it again.' )\n\t\t\t);\n\t\t\techo '<p class=\"update-from-upload-actions\">' . implode( ' ', (array) $install_actions ) . '</p>';\n\t\t}\n\n\t\treturn true;\n\t}\n}\n", "num_lines": 350}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrader API: Plugin_Upgrader_Skin class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Plugin Upgrader Skin for WordPress Plugin Upgrades.\n *\n * @since 2.8.0\n * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.\n *\n * @see WP_Upgrader_Skin\n */\nclass Plugin_Upgrader_Skin extends WP_Upgrader_Skin {\n\n\t/**\n\t * Holds the plugin slug in the Plugin Directory.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @var object\n\t */\n\tpublic $plugin = '';\n\n\t/**\n\t * Whether the plugin is active.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @var bool\n\t */\n\tpublic $plugin_active = false;\n\n\t/**\n\t * Whether the plugin is active for the entire network.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @var bool\n\t */\n\tpublic $plugin_network_active = false;\n\n\t/**\n\t * Constructor.\n\t *\n\t * Sets up the plugin upgrader skin.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $args Optional. The plugin upgrader skin arguments to\n\t *                    override default options. Default empty array.\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\t$defaults = array(\n\t\t\t'url'    => '',\n\t\t\t'plugin' => '',\n\t\t\t'nonce'  => '',\n\t\t\t'title'  => __( 'Update Plugin' ),\n\t\t);\n\t\t$args     = wp_parse_args( $args, $defaults );\n\n\t\t$this->plugin = $args['plugin'];\n\n\t\t$this->plugin_active         = is_plugin_active( $this->plugin );\n\t\t$this->plugin_network_active = is_plugin_active_for_network( $this->plugin );\n\n\t\tparent::__construct( $args );\n\t}\n\n\t/**\n\t * Action to perform following a single plugin update.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function after() {\n\t\t$this->plugin = $this->upgrader->plugin_info();\n\t\tif ( ! empty( $this->plugin ) && ! is_wp_error( $this->result ) && $this->plugin_active ) {\n\t\t\t// Currently used only when JS is off for a single plugin update?\n\t\t\tprintf(\n\t\t\t\t'<iframe title=\"%s\" style=\"border:0;overflow:hidden\" width=\"100%%\" height=\"170\" src=\"%s\"></iframe>',\n\t\t\t\tesc_attr__( 'Update progress' ),\n\t\t\t\twp_nonce_url( 'update.php?action=activate-plugin&networkwide=' . $this->plugin_network_active . '&plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin )\n\t\t\t);\n\t\t}\n\n\t\t$this->decrement_update_count( 'plugin' );\n\n\t\t$update_actions = array(\n\t\t\t'activate_plugin' => sprintf(\n\t\t\t\t'<a href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\twp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin ),\n\t\t\t\t__( 'Activate Plugin' )\n\t\t\t),\n\t\t\t'plugins_page'    => sprintf(\n\t\t\t\t'<a href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\tself_admin_url( 'plugins.php' ),\n\t\t\t\t__( 'Return to Plugins page' )\n\t\t\t),\n\t\t);\n\n\t\tif ( $this->plugin_active || ! $this->result || is_wp_error( $this->result ) || ! current_user_can( 'activate_plugin', $this->plugin ) ) {\n\t\t\tunset( $update_actions['activate_plugin'] );\n\t\t}\n\n\t\t/**\n\t\t * Filters the list of action links available following a single plugin update.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param string[] $update_actions Array of plugin action links.\n\t\t * @param string   $plugin         Path to the plugin file relative to the plugins directory.\n\t\t */\n\t\t$update_actions = apply_filters( 'update_plugin_complete_actions', $update_actions, $this->plugin );\n\n\t\tif ( ! empty( $update_actions ) ) {\n\t\t\t$this->feedback( implode( ' | ', (array) $update_actions ) );\n\t\t}\n\t}\n}\n", "num_lines": 124}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrade API: Plugin_Upgrader class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Core class used for upgrading/installing plugins.\n *\n * It is designed to upgrade/install plugins from a local zip, remote zip URL,\n * or uploaded zip file.\n *\n * @since 2.8.0\n * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php.\n *\n * @see WP_Upgrader\n */\nclass Plugin_Upgrader extends WP_Upgrader {\n\n\t/**\n\t * Plugin upgrade result.\n\t *\n\t * @since 2.8.0\n\t * @var array|WP_Error $result\n\t *\n\t * @see WP_Upgrader::$result\n\t */\n\tpublic $result;\n\n\t/**\n\t * Whether a bulk upgrade/installation is being performed.\n\t *\n\t * @since 2.9.0\n\t * @var bool $bulk\n\t */\n\tpublic $bulk = false;\n\n\t/**\n\t * New plugin info.\n\t *\n\t * @since 5.5.0\n\t * @var array $new_plugin_data\n\t *\n\t * @see check_package()\n\t */\n\tpublic $new_plugin_data = array();\n\n\t/**\n\t * Initialize the upgrade strings.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function upgrade_strings() {\n\t\t$this->strings['up_to_date'] = __( 'The plugin is at the latest version.' );\n\t\t$this->strings['no_package'] = __( 'Update package not available.' );\n\t\t/* translators: %s: Package URL. */\n\t\t$this->strings['downloading_package']  = sprintf( __( 'Downloading update from %s&#8230;' ), '<span class=\"code\">%s</span>' );\n\t\t$this->strings['unpack_package']       = __( 'Unpacking the update&#8230;' );\n\t\t$this->strings['remove_old']           = __( 'Removing the old version of the plugin&#8230;' );\n\t\t$this->strings['remove_old_failed']    = __( 'Could not remove the old plugin.' );\n\t\t$this->strings['process_failed']       = __( 'Plugin update failed.' );\n\t\t$this->strings['process_success']      = __( 'Plugin updated successfully.' );\n\t\t$this->strings['process_bulk_success'] = __( 'Plugins updated successfully.' );\n\t}\n\n\t/**\n\t * Initialize the installation strings.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function install_strings() {\n\t\t$this->strings['no_package'] = __( 'Installation package not available.' );\n\t\t/* translators: %s: Package URL. */\n\t\t$this->strings['downloading_package'] = sprintf( __( 'Downloading installation package from %s&#8230;' ), '<span class=\"code\">%s</span>' );\n\t\t$this->strings['unpack_package']      = __( 'Unpacking the package&#8230;' );\n\t\t$this->strings['installing_package']  = __( 'Installing the plugin&#8230;' );\n\t\t$this->strings['remove_old']          = __( 'Removing the current plugin&#8230;' );\n\t\t$this->strings['remove_old_failed']   = __( 'Could not remove the current plugin.' );\n\t\t$this->strings['no_files']            = __( 'The plugin contains no files.' );\n\t\t$this->strings['process_failed']      = __( 'Plugin installation failed.' );\n\t\t$this->strings['process_success']     = __( 'Plugin installed successfully.' );\n\t\t/* translators: 1: Plugin name, 2: Plugin version. */\n\t\t$this->strings['process_success_specific'] = __( 'Successfully installed the plugin <strong>%1$s %2$s</strong>.' );\n\n\t\tif ( ! empty( $this->skin->overwrite ) ) {\n\t\t\tif ( 'update-plugin' === $this->skin->overwrite ) {\n\t\t\t\t$this->strings['installing_package'] = __( 'Updating the plugin&#8230;' );\n\t\t\t\t$this->strings['process_failed']     = __( 'Plugin update failed.' );\n\t\t\t\t$this->strings['process_success']    = __( 'Plugin updated successfully.' );\n\t\t\t}\n\n\t\t\tif ( 'downgrade-plugin' === $this->skin->overwrite ) {\n\t\t\t\t$this->strings['installing_package'] = __( 'Downgrading the plugin&#8230;' );\n\t\t\t\t$this->strings['process_failed']     = __( 'Plugin downgrade failed.' );\n\t\t\t\t$this->strings['process_success']    = __( 'Plugin downgraded successfully.' );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Install a plugin package.\n\t *\n\t * @since 2.8.0\n\t * @since 3.7.0 The `$args` parameter was added, making clearing the plugin update cache optional.\n\t *\n\t * @param string $package The full local path or URI of the package.\n\t * @param array  $args {\n\t *     Optional. Other arguments for installing a plugin package. Default empty array.\n\t *\n\t *     @type bool $clear_update_cache Whether to clear the plugin updates cache if successful.\n\t *                                    Default true.\n\t * }\n\t * @return bool|WP_Error True if the installation was successful, false or a WP_Error otherwise.\n\t */\n\tpublic function install( $package, $args = array() ) {\n\t\t$defaults    = array(\n\t\t\t'clear_update_cache' => true,\n\t\t\t'overwrite_package'  => false, // Do not overwrite files.\n\t\t);\n\t\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t\t$this->init();\n\t\t$this->install_strings();\n\n\t\tadd_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );\n\n\t\tif ( $parsed_args['clear_update_cache'] ) {\n\t\t\t// Clear cache so wp_update_plugins() knows about the new plugin.\n\t\t\tadd_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 );\n\t\t}\n\n\t\t$this->run(\n\t\t\tarray(\n\t\t\t\t'package'           => $package,\n\t\t\t\t'destination'       => WP_PLUGIN_DIR,\n\t\t\t\t'clear_destination' => $parsed_args['overwrite_package'],\n\t\t\t\t'clear_working'     => true,\n\t\t\t\t'hook_extra'        => array(\n\t\t\t\t\t'type'   => 'plugin',\n\t\t\t\t\t'action' => 'install',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\tremove_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9 );\n\t\tremove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );\n\n\t\tif ( ! $this->result || is_wp_error( $this->result ) ) {\n\t\t\treturn $this->result;\n\t\t}\n\n\t\t// Force refresh of plugin update information.\n\t\twp_clean_plugins_cache( $parsed_args['clear_update_cache'] );\n\n\t\tif ( $parsed_args['overwrite_package'] ) {\n\t\t\t/**\n\t\t\t * Fires when the upgrader has successfully overwritten a currently installed\n\t\t\t * plugin or theme with an uploaded zip package.\n\t\t\t *\n\t\t\t * @since 5.5.0\n\t\t\t *\n\t\t\t * @param string  $package          The package file.\n\t\t\t * @param array   $new_plugin_data  The new plugin data.\n\t\t\t * @param string  $package_type     The package type (plugin or theme).\n\t\t\t */\n\t\t\tdo_action( 'upgrader_overwrote_package', $package, $this->new_plugin_data, 'plugin' );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Upgrade a plugin.\n\t *\n\t * @since 2.8.0\n\t * @since 3.7.0 The `$args` parameter was added, making clearing the plugin update cache optional.\n\t *\n\t * @param string $plugin Path to the plugin file relative to the plugins directory.\n\t * @param array  $args {\n\t *     Optional. Other arguments for upgrading a plugin package. Default empty array.\n\t *\n\t *     @type bool $clear_update_cache Whether to clear the plugin updates cache if successful.\n\t *                                    Default true.\n\t * }\n\t * @return bool|WP_Error True if the upgrade was successful, false or a WP_Error object otherwise.\n\t */\n\tpublic function upgrade( $plugin, $args = array() ) {\n\t\t$defaults    = array(\n\t\t\t'clear_update_cache' => true,\n\t\t);\n\t\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t\t$this->init();\n\t\t$this->upgrade_strings();\n\n\t\t$current = get_site_transient( 'update_plugins' );\n\t\tif ( ! isset( $current->response[ $plugin ] ) ) {\n\t\t\t$this->skin->before();\n\t\t\t$this->skin->set_result( false );\n\t\t\t$this->skin->error( 'up_to_date' );\n\t\t\t$this->skin->after();\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get the URL to the zip file.\n\t\t$r = $current->response[ $plugin ];\n\n\t\tadd_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ), 10, 2 );\n\t\tadd_filter( 'upgrader_pre_install', array( $this, 'active_before' ), 10, 2 );\n\t\tadd_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ), 10, 4 );\n\t\tadd_filter( 'upgrader_post_install', array( $this, 'active_after' ), 10, 2 );\n\t\t// There's a Trac ticket to move up the directory for zips which are made a bit differently, useful for non-.org plugins.\n\t\t// 'source_selection' => array( $this, 'source_selection' ),\n\t\tif ( $parsed_args['clear_update_cache'] ) {\n\t\t\t// Clear cache so wp_update_plugins() knows about the new plugin.\n\t\t\tadd_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 );\n\t\t}\n\n\t\t$this->run(\n\t\t\tarray(\n\t\t\t\t'package'           => $r->package,\n\t\t\t\t'destination'       => WP_PLUGIN_DIR,\n\t\t\t\t'clear_destination' => true,\n\t\t\t\t'clear_working'     => true,\n\t\t\t\t'hook_extra'        => array(\n\t\t\t\t\t'plugin' => $plugin,\n\t\t\t\t\t'type'   => 'plugin',\n\t\t\t\t\t'action' => 'update',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t// Cleanup our hooks, in case something else does a upgrade on this connection.\n\t\tremove_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9 );\n\t\tremove_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ) );\n\t\tremove_filter( 'upgrader_pre_install', array( $this, 'active_before' ) );\n\t\tremove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ) );\n\t\tremove_filter( 'upgrader_post_install', array( $this, 'active_after' ) );\n\n\t\tif ( ! $this->result || is_wp_error( $this->result ) ) {\n\t\t\treturn $this->result;\n\t\t}\n\n\t\t// Force refresh of plugin update information.\n\t\twp_clean_plugins_cache( $parsed_args['clear_update_cache'] );\n\n\t\t// Ensure any future auto-update failures trigger a failure email by removing\n\t\t// the last failure notification from the list when plugins update successfully.\n\t\t$past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() );\n\n\t\tif ( isset( $past_failure_emails[ $plugin ] ) ) {\n\t\t\tunset( $past_failure_emails[ $plugin ] );\n\t\t\tupdate_option( 'auto_plugin_theme_update_emails', $past_failure_emails );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Bulk upgrade several plugins at once.\n\t *\n\t * @since 2.8.0\n\t * @since 3.7.0 The `$args` parameter was added, making clearing the plugin update cache optional.\n\t *\n\t * @param string[] $plugins Array of paths to plugin files relative to the plugins directory.\n\t * @param array    $args {\n\t *     Optional. Other arguments for upgrading several plugins at once.\n\t *\n\t *     @type bool $clear_update_cache Whether to clear the plugin updates cache if successful. Default true.\n\t * }\n\t * @return array|false An array of results indexed by plugin file, or false if unable to connect to the filesystem.\n\t */\n\tpublic function bulk_upgrade( $plugins, $args = array() ) {\n\t\t$defaults    = array(\n\t\t\t'clear_update_cache' => true,\n\t\t);\n\t\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t\t$this->init();\n\t\t$this->bulk = true;\n\t\t$this->upgrade_strings();\n\n\t\t$current = get_site_transient( 'update_plugins' );\n\n\t\tadd_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ), 10, 4 );\n\n\t\t$this->skin->header();\n\n\t\t// Connect to the filesystem first.\n\t\t$res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) );\n\t\tif ( ! $res ) {\n\t\t\t$this->skin->footer();\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->skin->bulk_header();\n\n\t\t/*\n\t\t * Only start maintenance mode if:\n\t\t * - running Multisite and there are one or more plugins specified, OR\n\t\t * - a plugin with an update available is currently active.\n\t\t * @todo For multisite, maintenance mode should only kick in for individual sites if at all possible.\n\t\t */\n\t\t$maintenance = ( is_multisite() && ! empty( $plugins ) );\n\t\tforeach ( $plugins as $plugin ) {\n\t\t\t$maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin ] ) );\n\t\t}\n\t\tif ( $maintenance ) {\n\t\t\t$this->maintenance_mode( true );\n\t\t}\n\n\t\t$results = array();\n\n\t\t$this->update_count   = count( $plugins );\n\t\t$this->update_current = 0;\n\t\tforeach ( $plugins as $plugin ) {\n\t\t\t$this->update_current++;\n\t\t\t$this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true );\n\n\t\t\tif ( ! isset( $current->response[ $plugin ] ) ) {\n\t\t\t\t$this->skin->set_result( 'up_to_date' );\n\t\t\t\t$this->skin->before();\n\t\t\t\t$this->skin->feedback( 'up_to_date' );\n\t\t\t\t$this->skin->after();\n\t\t\t\t$results[ $plugin ] = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Get the URL to the zip file.\n\t\t\t$r = $current->response[ $plugin ];\n\n\t\t\t$this->skin->plugin_active = is_plugin_active( $plugin );\n\n\t\t\t$result = $this->run(\n\t\t\t\tarray(\n\t\t\t\t\t'package'           => $r->package,\n\t\t\t\t\t'destination'       => WP_PLUGIN_DIR,\n\t\t\t\t\t'clear_destination' => true,\n\t\t\t\t\t'clear_working'     => true,\n\t\t\t\t\t'is_multi'          => true,\n\t\t\t\t\t'hook_extra'        => array(\n\t\t\t\t\t\t'plugin' => $plugin,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$results[ $plugin ] = $this->result;\n\n\t\t\t// Prevent credentials auth screen from displaying multiple times.\n\t\t\tif ( false === $result ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} // End foreach $plugins.\n\n\t\t$this->maintenance_mode( false );\n\n\t\t// Force refresh of plugin update information.\n\t\twp_clean_plugins_cache( $parsed_args['clear_update_cache'] );\n\n\t\t/** This action is documented in wp-admin/includes/class-wp-upgrader.php */\n\t\tdo_action(\n\t\t\t'upgrader_process_complete',\n\t\t\t$this,\n\t\t\tarray(\n\t\t\t\t'action'  => 'update',\n\t\t\t\t'type'    => 'plugin',\n\t\t\t\t'bulk'    => true,\n\t\t\t\t'plugins' => $plugins,\n\t\t\t)\n\t\t);\n\n\t\t$this->skin->bulk_footer();\n\n\t\t$this->skin->footer();\n\n\t\t// Cleanup our hooks, in case something else does a upgrade on this connection.\n\t\tremove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ) );\n\n\t\t// Ensure any future auto-update failures trigger a failure email by removing\n\t\t// the last failure notification from the list when plugins update successfully.\n\t\t$past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() );\n\n\t\tforeach ( $results as $plugin => $result ) {\n\t\t\t// Maintain last failure notification when plugins failed to update manually.\n\t\t\tif ( ! $result || is_wp_error( $result ) || ! isset( $past_failure_emails[ $plugin ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tunset( $past_failure_emails[ $plugin ] );\n\t\t}\n\n\t\tupdate_option( 'auto_plugin_theme_update_emails', $past_failure_emails );\n\n\t\treturn $results;\n\t}\n\n\t/**\n\t * Check a source package to be sure it contains a plugin.\n\t *\n\t * This function is added to the {@see 'upgrader_source_selection'} filter by\n\t * Plugin_Upgrader::install().\n\t *\n\t * @since 3.3.0\n\t *\n\t * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n\t *\n\t * @param string $source The path to the downloaded package source.\n\t * @return string|WP_Error The source as passed, or a WP_Error object\n\t *                         if no plugins were found.\n\t */\n\tpublic function check_package( $source ) {\n\t\tglobal $wp_filesystem;\n\n\t\t$this->new_plugin_data = array();\n\n\t\tif ( is_wp_error( $source ) ) {\n\t\t\treturn $source;\n\t\t}\n\n\t\t$working_directory = str_replace( $wp_filesystem->wp_content_dir(), trailingslashit( WP_CONTENT_DIR ), $source );\n\t\tif ( ! is_dir( $working_directory ) ) { // Sanity check, if the above fails, let's not prevent installation.\n\t\t\treturn $source;\n\t\t}\n\n\t\t// Check that the folder contains at least 1 valid plugin.\n\t\t$files = glob( $working_directory . '*.php' );\n\t\tif ( $files ) {\n\t\t\tforeach ( $files as $file ) {\n\t\t\t\t$info = get_plugin_data( $file, false, false );\n\t\t\t\tif ( ! empty( $info['Name'] ) ) {\n\t\t\t\t\t$this->new_plugin_data = $info;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $this->new_plugin_data ) ) {\n\t\t\treturn new WP_Error( 'incompatible_archive_no_plugins', $this->strings['incompatible_archive'], __( 'No valid plugins were found.' ) );\n\t\t}\n\n\t\t$requires_php = isset( $info['RequiresPHP'] ) ? $info['RequiresPHP'] : null;\n\t\t$requires_wp  = isset( $info['RequiresWP'] ) ? $info['RequiresWP'] : null;\n\n\t\tif ( ! is_php_version_compatible( $requires_php ) ) {\n\t\t\t$error = sprintf(\n\t\t\t\t/* translators: 1: Current PHP version, 2: Version required by the uploaded plugin. */\n\t\t\t\t__( 'The PHP version on your server is %1$s, however the uploaded plugin requires %2$s.' ),\n\t\t\t\tphpversion(),\n\t\t\t\t$requires_php\n\t\t\t);\n\n\t\t\treturn new WP_Error( 'incompatible_php_required_version', $this->strings['incompatible_archive'], $error );\n\t\t}\n\n\t\tif ( ! is_wp_version_compatible( $requires_wp ) ) {\n\t\t\t$error = sprintf(\n\t\t\t\t/* translators: 1: Current WordPress version, 2: Version required by the uploaded plugin. */\n\t\t\t\t__( 'Your WordPress version is %1$s, however the uploaded plugin requires %2$s.' ),\n\t\t\t\t$GLOBALS['wp_version'],\n\t\t\t\t$requires_wp\n\t\t\t);\n\n\t\t\treturn new WP_Error( 'incompatible_wp_required_version', $this->strings['incompatible_archive'], $error );\n\t\t}\n\n\t\treturn $source;\n\t}\n\n\t/**\n\t * Retrieve the path to the file that contains the plugin info.\n\t *\n\t * This isn't used internally in the class, but is called by the skins.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return string|false The full path to the main plugin file, or false.\n\t */\n\tpublic function plugin_info() {\n\t\tif ( ! is_array( $this->result ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( empty( $this->result['destination_name'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Ensure to pass with leading slash.\n\t\t$plugin = get_plugins( '/' . $this->result['destination_name'] );\n\t\tif ( empty( $plugin ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Assume the requested plugin is the first in the list.\n\t\t$pluginfiles = array_keys( $plugin );\n\n\t\treturn $this->result['destination_name'] . '/' . $pluginfiles[0];\n\t}\n\n\t/**\n\t * Deactivates a plugin before it is upgraded.\n\t *\n\t * Hooked to the {@see 'upgrader_pre_install'} filter by Plugin_Upgrader::upgrade().\n\t *\n\t * @since 2.8.0\n\t * @since 4.1.0 Added a return value.\n\t *\n\t * @param bool|WP_Error $return Upgrade offer return.\n\t * @param array         $plugin Plugin package arguments.\n\t * @return bool|WP_Error The passed in $return param or WP_Error.\n\t */\n\tpublic function deactivate_plugin_before_upgrade( $return, $plugin ) {\n\n\t\tif ( is_wp_error( $return ) ) { // Bypass.\n\t\t\treturn $return;\n\t\t}\n\n\t\t// When in cron (background updates) don't deactivate the plugin, as we require a browser to reactivate it.\n\t\tif ( wp_doing_cron() ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t$plugin = isset( $plugin['plugin'] ) ? $plugin['plugin'] : '';\n\t\tif ( empty( $plugin ) ) {\n\t\t\treturn new WP_Error( 'bad_request', $this->strings['bad_request'] );\n\t\t}\n\n\t\tif ( is_plugin_active( $plugin ) ) {\n\t\t\t// Deactivate the plugin silently, Prevent deactivation hooks from running.\n\t\t\tdeactivate_plugins( $plugin, true );\n\t\t}\n\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Turns on maintenance mode before attempting to background update an active plugin.\n\t *\n\t * Hooked to the {@see 'upgrader_pre_install'} filter by Plugin_Upgrader::upgrade().\n\t *\n\t * @since 5.4.0\n\t *\n\t * @param bool|WP_Error $return Upgrade offer return.\n\t * @param array         $plugin Plugin package arguments.\n\t * @return bool|WP_Error The passed in $return param or WP_Error.\n\t */\n\tpublic function active_before( $return, $plugin ) {\n\t\tif ( is_wp_error( $return ) ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t// Only enable maintenance mode when in cron (background update).\n\t\tif ( ! wp_doing_cron() ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t$plugin = isset( $plugin['plugin'] ) ? $plugin['plugin'] : '';\n\n\t\t// Only run if plugin is active.\n\t\tif ( ! is_plugin_active( $plugin ) ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t// Change to maintenance mode. Bulk edit handles this separately.\n\t\tif ( ! $this->bulk ) {\n\t\t\t$this->maintenance_mode( true );\n\t\t}\n\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Turns off maintenance mode after upgrading an active plugin.\n\t *\n\t * Hooked to the {@see 'upgrader_post_install'} filter by Plugin_Upgrader::upgrade().\n\t *\n\t * @since 5.4.0\n\t *\n\t * @param bool|WP_Error $return Upgrade offer return.\n\t * @param array         $plugin Plugin package arguments.\n\t * @return bool|WP_Error The passed in $return param or WP_Error.\n\t */\n\tpublic function active_after( $return, $plugin ) {\n\t\tif ( is_wp_error( $return ) ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t// Only disable maintenance mode when in cron (background update).\n\t\tif ( ! wp_doing_cron() ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t$plugin = isset( $plugin['plugin'] ) ? $plugin['plugin'] : '';\n\n\t\t// Only run if plugin is active\n\t\tif ( ! is_plugin_active( $plugin ) ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t// Time to remove maintenance mode. Bulk edit handles this separately.\n\t\tif ( ! $this->bulk ) {\n\t\t\t$this->maintenance_mode( false );\n\t\t}\n\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Deletes the old plugin during an upgrade.\n\t *\n\t * Hooked to the {@see 'upgrader_clear_destination'} filter by\n\t * Plugin_Upgrader::upgrade() and Plugin_Upgrader::bulk_upgrade().\n\t *\n\t * @since 2.8.0\n\t *\n\t * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n\t *\n\t * @param bool|WP_Error $removed            Whether the destination was cleared.\n\t *                                          True on success, WP_Error on failure.\n\t * @param string        $local_destination  The local package destination.\n\t * @param string        $remote_destination The remote package destination.\n\t * @param array         $plugin             Extra arguments passed to hooked filters.\n\t * @return bool|WP_Error\n\t */\n\tpublic function delete_old_plugin( $removed, $local_destination, $remote_destination, $plugin ) {\n\t\tglobal $wp_filesystem;\n\n\t\tif ( is_wp_error( $removed ) ) {\n\t\t\treturn $removed; // Pass errors through.\n\t\t}\n\n\t\t$plugin = isset( $plugin['plugin'] ) ? $plugin['plugin'] : '';\n\t\tif ( empty( $plugin ) ) {\n\t\t\treturn new WP_Error( 'bad_request', $this->strings['bad_request'] );\n\t\t}\n\n\t\t$plugins_dir     = $wp_filesystem->wp_plugins_dir();\n\t\t$this_plugin_dir = trailingslashit( dirname( $plugins_dir . $plugin ) );\n\n\t\tif ( ! $wp_filesystem->exists( $this_plugin_dir ) ) { // If it's already vanished.\n\t\t\treturn $removed;\n\t\t}\n\n\t\t// If plugin is in its own directory, recursively delete the directory.\n\t\t// Base check on if plugin includes directory separator AND that it's not the root plugin folder.\n\t\tif ( strpos( $plugin, '/' ) && $this_plugin_dir !== $plugins_dir ) {\n\t\t\t$deleted = $wp_filesystem->delete( $this_plugin_dir, true );\n\t\t} else {\n\t\t\t$deleted = $wp_filesystem->delete( $plugins_dir . $plugin );\n\t\t}\n\n\t\tif ( ! $deleted ) {\n\t\t\treturn new WP_Error( 'remove_old_failed', $this->strings['remove_old_failed'] );\n\t\t}\n\n\t\treturn true;\n\t}\n}\n", "num_lines": 660}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrader API: Theme_Installer_Skin class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Theme Installer Skin for the WordPress Theme Installer.\n *\n * @since 2.8.0\n * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.\n *\n * @see WP_Upgrader_Skin\n */\nclass Theme_Installer_Skin extends WP_Upgrader_Skin {\n\tpublic $api;\n\tpublic $type;\n\tpublic $url;\n\tpublic $overwrite;\n\n\tprivate $is_downgrading = false;\n\n\t/**\n\t * @param array $args\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\t$defaults = array(\n\t\t\t'type'      => 'web',\n\t\t\t'url'       => '',\n\t\t\t'theme'     => '',\n\t\t\t'nonce'     => '',\n\t\t\t'title'     => '',\n\t\t\t'overwrite' => '',\n\t\t);\n\t\t$args     = wp_parse_args( $args, $defaults );\n\n\t\t$this->type      = $args['type'];\n\t\t$this->url       = $args['url'];\n\t\t$this->api       = isset( $args['api'] ) ? $args['api'] : array();\n\t\t$this->overwrite = $args['overwrite'];\n\n\t\tparent::__construct( $args );\n\t}\n\n\t/**\n\t * Action to perform before installing a theme.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function before() {\n\t\tif ( ! empty( $this->api ) ) {\n\t\t\t$this->upgrader->strings['process_success'] = sprintf(\n\t\t\t\t$this->upgrader->strings['process_success_specific'],\n\t\t\t\t$this->api->name,\n\t\t\t\t$this->api->version\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Hides the `process_failed` error when updating a theme by uploading a zip file.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_Error $wp_error WP_Error.\n\t * @return bool\n\t */\n\tpublic function hide_process_failed( $wp_error ) {\n\t\tif (\n\t\t\t'upload' === $this->type &&\n\t\t\t'' === $this->overwrite &&\n\t\t\t$wp_error->get_error_code() === 'folder_exists'\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Action to perform following a single theme install.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function after() {\n\t\tif ( $this->do_overwrite() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( empty( $this->upgrader->result['destination_name'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$theme_info = $this->upgrader->theme_info();\n\t\tif ( empty( $theme_info ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$name       = $theme_info->display( 'Name' );\n\t\t$stylesheet = $this->upgrader->result['destination_name'];\n\t\t$template   = $theme_info->get_template();\n\n\t\t$activate_link = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'action'     => 'activate',\n\t\t\t\t'template'   => urlencode( $template ),\n\t\t\t\t'stylesheet' => urlencode( $stylesheet ),\n\t\t\t),\n\t\t\tadmin_url( 'themes.php' )\n\t\t);\n\t\t$activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet );\n\n\t\t$install_actions = array();\n\n\t\tif ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {\n\t\t\t$customize_url = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'theme'  => urlencode( $stylesheet ),\n\t\t\t\t\t'return' => urlencode( admin_url( 'web' === $this->type ? 'theme-install.php' : 'themes.php' ) ),\n\t\t\t\t),\n\t\t\t\tadmin_url( 'customize.php' )\n\t\t\t);\n\n\t\t\t$install_actions['preview'] = sprintf(\n\t\t\t\t'<a href=\"%s\" class=\"hide-if-no-customize load-customize\">' .\n\t\t\t\t'<span aria-hidden=\"true\">%s</span><span class=\"screen-reader-text\">%s</span></a>',\n\t\t\t\tesc_url( $customize_url ),\n\t\t\t\t__( 'Live Preview' ),\n\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\tsprintf( __( 'Live Preview &#8220;%s&#8221;' ), $name )\n\t\t\t);\n\t\t}\n\n\t\t$install_actions['activate'] = sprintf(\n\t\t\t'<a href=\"%s\" class=\"activatelink\">' .\n\t\t\t'<span aria-hidden=\"true\">%s</span><span class=\"screen-reader-text\">%s</span></a>',\n\t\t\tesc_url( $activate_link ),\n\t\t\t__( 'Activate' ),\n\t\t\t/* translators: %s: Theme name. */\n\t\t\tsprintf( _x( 'Activate &#8220;%s&#8221;', 'theme' ), $name )\n\t\t);\n\n\t\tif ( is_network_admin() && current_user_can( 'manage_network_themes' ) ) {\n\t\t\t$install_actions['network_enable'] = sprintf(\n\t\t\t\t'<a href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\tesc_url( wp_nonce_url( 'themes.php?action=enable&amp;theme=' . urlencode( $stylesheet ), 'enable-theme_' . $stylesheet ) ),\n\t\t\t\t__( 'Network Enable' )\n\t\t\t);\n\t\t}\n\n\t\tif ( 'web' === $this->type ) {\n\t\t\t$install_actions['themes_page'] = sprintf(\n\t\t\t\t'<a href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\tself_admin_url( 'theme-install.php' ),\n\t\t\t\t__( 'Return to Theme Installer' )\n\t\t\t);\n\t\t} elseif ( current_user_can( 'switch_themes' ) || current_user_can( 'edit_theme_options' ) ) {\n\t\t\t$install_actions['themes_page'] = sprintf(\n\t\t\t\t'<a href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\tself_admin_url( 'themes.php' ),\n\t\t\t\t__( 'Return to Themes page' )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! $this->result || is_wp_error( $this->result ) || is_network_admin() || ! current_user_can( 'switch_themes' ) ) {\n\t\t\tunset( $install_actions['activate'], $install_actions['preview'] );\n\t\t} elseif ( get_option( 'template' ) === $stylesheet ) {\n\t\t\tunset( $install_actions['activate'] );\n\t\t}\n\n\t\t/**\n\t\t * Filters the list of action links available following a single theme installation.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string[] $install_actions Array of theme action links.\n\t\t * @param object   $api             Object containing WordPress.org API theme data.\n\t\t * @param string   $stylesheet      Theme directory name.\n\t\t * @param WP_Theme $theme_info      Theme object.\n\t\t */\n\t\t$install_actions = apply_filters( 'install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info );\n\t\tif ( ! empty( $install_actions ) ) {\n\t\t\t$this->feedback( implode( ' | ', (array) $install_actions ) );\n\t\t}\n\t}\n\n\t/**\n\t * Check if the theme can be overwritten and output the HTML for overwriting a theme on upload.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return bool Whether the theme can be overwritten and HTML was outputted.\n\t */\n\tprivate function do_overwrite() {\n\t\tif ( 'upload' !== $this->type || ! is_wp_error( $this->result ) || 'folder_exists' !== $this->result->get_error_code() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$folder = $this->result->get_error_data( 'folder_exists' );\n\t\t$folder = rtrim( $folder, '/' );\n\n\t\t$current_theme_data = false;\n\t\t$all_themes         = wp_get_themes( array( 'errors' => null ) );\n\n\t\tforeach ( $all_themes as $theme ) {\n\t\t\t$stylesheet_dir = wp_normalize_path( $theme->get_stylesheet_directory() );\n\n\t\t\tif ( rtrim( $stylesheet_dir, '/' ) !== $folder ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$current_theme_data = $theme;\n\t\t}\n\n\t\t$new_theme_data = $this->upgrader->new_theme_data;\n\n\t\tif ( ! $current_theme_data || ! $new_theme_data ) {\n\t\t\treturn false;\n\t\t}\n\n\t\techo '<h2 class=\"update-from-upload-heading\">' . esc_html( __( 'This theme is already installed.' ) ) . '</h2>';\n\n\t\t// Check errors for current theme.\n\t\tif ( is_wp_error( $current_theme_data->errors() ) ) {\n\t\t\t$this->feedback( 'current_theme_has_errors', $current_theme_data->errors()->get_error_message() );\n\t\t}\n\n\t\t$this->is_downgrading = version_compare( $current_theme_data['Version'], $new_theme_data['Version'], '>' );\n\n\t\t$is_invalid_parent = false;\n\t\tif ( ! empty( $new_theme_data['Template'] ) ) {\n\t\t\t$is_invalid_parent = ! in_array( $new_theme_data['Template'], array_keys( $all_themes ), true );\n\t\t}\n\n\t\t$rows = array(\n\t\t\t'Name'        => __( 'Theme name' ),\n\t\t\t'Version'     => __( 'Version' ),\n\t\t\t'Author'      => __( 'Author' ),\n\t\t\t'RequiresWP'  => __( 'Required WordPress version' ),\n\t\t\t'RequiresPHP' => __( 'Required PHP version' ),\n\t\t\t'Template'    => __( 'Parent theme' ),\n\t\t);\n\n\t\t$table  = '<table class=\"update-from-upload-comparison\"><tbody>';\n\t\t$table .= '<tr><th></th><th>' . esc_html( __( 'Current' ) ) . '</th><th>' . esc_html( __( 'Uploaded' ) ) . '</th></tr>';\n\n\t\t$is_same_theme = true; // Let's consider only these rows.\n\n\t\tforeach ( $rows as $field => $label ) {\n\t\t\t$old_value = $current_theme_data->display( $field, false );\n\t\t\t$old_value = $old_value ? (string) $old_value : '-';\n\n\t\t\t$new_value = ! empty( $new_theme_data[ $field ] ) ? (string) $new_theme_data[ $field ] : '-';\n\n\t\t\tif ( $old_value === $new_value && '-' === $new_value && 'Template' === $field ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$is_same_theme = $is_same_theme && ( $old_value === $new_value );\n\n\t\t\t$diff_field     = ( 'Version' !== $field && $new_value !== $old_value );\n\t\t\t$diff_version   = ( 'Version' === $field && $this->is_downgrading );\n\t\t\t$invalid_parent = false;\n\n\t\t\tif ( 'Template' === $field && $is_invalid_parent ) {\n\t\t\t\t$invalid_parent = true;\n\t\t\t\t$new_value     .= ' ' . __( '(not found)' );\n\t\t\t}\n\n\t\t\t$table .= '<tr><td class=\"name-label\">' . $label . '</td><td>' . wp_strip_all_tags( $old_value ) . '</td>';\n\t\t\t$table .= ( $diff_field || $diff_version || $invalid_parent ) ? '<td class=\"warning\">' : '<td>';\n\t\t\t$table .= wp_strip_all_tags( $new_value ) . '</td></tr>';\n\t\t}\n\n\t\t$table .= '</tbody></table>';\n\n\t\t/**\n\t\t * Filters the compare table output for overwriting a theme package on upload.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param string $table              The output table with Name, Version, Author, RequiresWP, and RequiresPHP info.\n\t\t * @param array  $current_theme_data Array with current theme data.\n\t\t * @param array  $new_theme_data     Array with uploaded theme data.\n\t\t */\n\t\techo apply_filters( 'install_theme_overwrite_comparison', $table, $current_theme_data, $new_theme_data );\n\n\t\t$install_actions = array();\n\t\t$can_update      = true;\n\n\t\t$blocked_message  = '<p>' . esc_html( __( 'The theme cannot be updated due to the following:' ) ) . '</p>';\n\t\t$blocked_message .= '<ul class=\"ul-disc\">';\n\n\t\t$requires_php = isset( $new_theme_data['RequiresPHP'] ) ? $new_theme_data['RequiresPHP'] : null;\n\t\t$requires_wp  = isset( $new_theme_data['RequiresWP'] ) ? $new_theme_data['RequiresWP'] : null;\n\n\t\tif ( ! is_php_version_compatible( $requires_php ) ) {\n\t\t\t$error = sprintf(\n\t\t\t\t/* translators: 1: Current PHP version, 2: Version required by the uploaded theme. */\n\t\t\t\t__( 'The PHP version on your server is %1$s, however the uploaded theme requires %2$s.' ),\n\t\t\t\tphpversion(),\n\t\t\t\t$requires_php\n\t\t\t);\n\n\t\t\t$blocked_message .= '<li>' . esc_html( $error ) . '</li>';\n\t\t\t$can_update       = false;\n\t\t}\n\n\t\tif ( ! is_wp_version_compatible( $requires_wp ) ) {\n\t\t\t$error = sprintf(\n\t\t\t\t/* translators: 1: Current WordPress version, 2: Version required by the uploaded theme. */\n\t\t\t\t__( 'Your WordPress version is %1$s, however the uploaded theme requires %2$s.' ),\n\t\t\t\tget_bloginfo( 'version' ),\n\t\t\t\t$requires_wp\n\t\t\t);\n\n\t\t\t$blocked_message .= '<li>' . esc_html( $error ) . '</li>';\n\t\t\t$can_update       = false;\n\t\t}\n\n\t\t$blocked_message .= '</ul>';\n\n\t\tif ( $can_update ) {\n\t\t\tif ( $this->is_downgrading ) {\n\t\t\t\t$warning = sprintf(\n\t\t\t\t\t/* translators: %s: Documentation URL. */\n\t\t\t\t\t__( 'You are uploading an older version of a current theme. You can continue to install the older version, but be sure to <a href=\"%s\">back up your database and files</a> first.' ),\n\t\t\t\t\t__( 'https://wordpress.org/support/article/wordpress-backups/' )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$warning = sprintf(\n\t\t\t\t\t/* translators: %s: Documentation URL. */\n\t\t\t\t\t__( 'You are updating a theme. Be sure to <a href=\"%s\">back up your database and files</a> first.' ),\n\t\t\t\t\t__( 'https://wordpress.org/support/article/wordpress-backups/' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\techo '<p class=\"update-from-upload-notice\">' . $warning . '</p>';\n\n\t\t\t$overwrite = $this->is_downgrading ? 'downgrade-theme' : 'update-theme';\n\n\t\t\t$install_actions['overwrite_theme'] = sprintf(\n\t\t\t\t'<a class=\"button button-primary update-from-upload-overwrite\" href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\t\twp_nonce_url( add_query_arg( 'overwrite', $overwrite, $this->url ), 'theme-upload' ),\n\t\t\t\t__( 'Replace current with uploaded' )\n\t\t\t);\n\t\t} else {\n\t\t\techo $blocked_message;\n\t\t}\n\n\t\t$cancel_url = add_query_arg( 'action', 'upload-theme-cancel-overwrite', $this->url );\n\n\t\t$install_actions['themes_page'] = sprintf(\n\t\t\t'<a class=\"button\" href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\twp_nonce_url( $cancel_url, 'theme-upload-cancel-overwrite' ),\n\t\t\t__( 'Cancel and go back' )\n\t\t);\n\n\t\t/**\n\t\t * Filters the list of action links available following a single theme installation\n\t\t * failure when overwriting is allowed.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param string[] $install_actions Array of theme action links.\n\t\t * @param object   $api             Object containing WordPress.org API theme data.\n\t\t * @param array    $new_theme_data  Array with uploaded theme data.\n\t\t */\n\t\t$install_actions = apply_filters( 'install_theme_overwrite_actions', $install_actions, $this->api, $new_theme_data );\n\n\t\tif ( ! empty( $install_actions ) ) {\n\t\t\tprintf(\n\t\t\t\t'<p class=\"update-from-upload-expired hidden\">%s</p>',\n\t\t\t\t__( 'The uploaded file has expired. Please go back and upload it again.' )\n\t\t\t);\n\t\t\techo '<p class=\"update-from-upload-actions\">' . implode( ' ', (array) $install_actions ) . '</p>';\n\t\t}\n\n\t\treturn true;\n\t}\n}\n", "num_lines": 385}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrader API: Theme_Upgrader_Skin class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Theme Upgrader Skin for WordPress Theme Upgrades.\n *\n * @since 2.8.0\n * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.\n *\n * @see WP_Upgrader_Skin\n */\nclass Theme_Upgrader_Skin extends WP_Upgrader_Skin {\n\n\t/**\n\t * Holds the theme slug in the Theme Directory.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @var object\n\t */\n\tpublic $theme = '';\n\n\t/**\n\t * Constructor.\n\t *\n\t * Sets up the theme upgrader skin.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $args Optional. The theme upgrader skin arguments to\n\t *                    override default options. Default empty array.\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\t$defaults = array(\n\t\t\t'url'   => '',\n\t\t\t'theme' => '',\n\t\t\t'nonce' => '',\n\t\t\t'title' => __( 'Update Theme' ),\n\t\t);\n\t\t$args     = wp_parse_args( $args, $defaults );\n\n\t\t$this->theme = $args['theme'];\n\n\t\tparent::__construct( $args );\n\t}\n\n\t/**\n\t * Action to perform following a single theme update.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function after() {\n\t\t$this->decrement_update_count( 'theme' );\n\n\t\t$update_actions = array();\n\t\t$theme_info     = $this->upgrader->theme_info();\n\t\tif ( $theme_info ) {\n\t\t\t$name       = $theme_info->display( 'Name' );\n\t\t\t$stylesheet = $this->upgrader->result['destination_name'];\n\t\t\t$template   = $theme_info->get_template();\n\n\t\t\t$activate_link = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'action'     => 'activate',\n\t\t\t\t\t'template'   => urlencode( $template ),\n\t\t\t\t\t'stylesheet' => urlencode( $stylesheet ),\n\t\t\t\t),\n\t\t\t\tadmin_url( 'themes.php' )\n\t\t\t);\n\t\t\t$activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet );\n\n\t\t\t$customize_url = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'theme'  => urlencode( $stylesheet ),\n\t\t\t\t\t'return' => urlencode( admin_url( 'themes.php' ) ),\n\t\t\t\t),\n\t\t\t\tadmin_url( 'customize.php' )\n\t\t\t);\n\n\t\t\tif ( get_stylesheet() === $stylesheet ) {\n\t\t\t\tif ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {\n\t\t\t\t\t$update_actions['preview'] = sprintf(\n\t\t\t\t\t\t'<a href=\"%s\" class=\"hide-if-no-customize load-customize\">' .\n\t\t\t\t\t\t'<span aria-hidden=\"true\">%s</span><span class=\"screen-reader-text\">%s</span></a>',\n\t\t\t\t\t\tesc_url( $customize_url ),\n\t\t\t\t\t\t__( 'Customize' ),\n\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\tsprintf( __( 'Customize &#8220;%s&#8221;' ), $name )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} elseif ( current_user_can( 'switch_themes' ) ) {\n\t\t\t\tif ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {\n\t\t\t\t\t$update_actions['preview'] = sprintf(\n\t\t\t\t\t\t'<a href=\"%s\" class=\"hide-if-no-customize load-customize\">' .\n\t\t\t\t\t\t'<span aria-hidden=\"true\">%s</span><span class=\"screen-reader-text\">%s</span></a>',\n\t\t\t\t\t\tesc_url( $customize_url ),\n\t\t\t\t\t\t__( 'Live Preview' ),\n\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\tsprintf( __( 'Live Preview &#8220;%s&#8221;' ), $name )\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$update_actions['activate'] = sprintf(\n\t\t\t\t\t'<a href=\"%s\" class=\"activatelink\">' .\n\t\t\t\t\t'<span aria-hidden=\"true\">%s</span><span class=\"screen-reader-text\">%s</span></a>',\n\t\t\t\t\tesc_url( $activate_link ),\n\t\t\t\t\t__( 'Activate' ),\n\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\tsprintf( _x( 'Activate &#8220;%s&#8221;', 'theme' ), $name )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( ! $this->result || is_wp_error( $this->result ) || is_network_admin() ) {\n\t\t\t\tunset( $update_actions['preview'], $update_actions['activate'] );\n\t\t\t}\n\t\t}\n\n\t\t$update_actions['themes_page'] = sprintf(\n\t\t\t'<a href=\"%s\" target=\"_parent\">%s</a>',\n\t\t\tself_admin_url( 'themes.php' ),\n\t\t\t__( 'Return to Themes page' )\n\t\t);\n\n\t\t/**\n\t\t * Filters the list of action links available following a single theme update.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string[] $update_actions Array of theme action links.\n\t\t * @param string   $theme          Theme directory name.\n\t\t */\n\t\t$update_actions = apply_filters( 'update_theme_complete_actions', $update_actions, $this->theme );\n\n\t\tif ( ! empty( $update_actions ) ) {\n\t\t\t$this->feedback( implode( ' | ', (array) $update_actions ) );\n\t\t}\n\t}\n}\n", "num_lines": 145}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrade API: Theme_Upgrader class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Core class used for upgrading/installing themes.\n *\n * It is designed to upgrade/install themes from a local zip, remote zip URL,\n * or uploaded zip file.\n *\n * @since 2.8.0\n * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php.\n *\n * @see WP_Upgrader\n */\nclass Theme_Upgrader extends WP_Upgrader {\n\n\t/**\n\t * Result of the theme upgrade offer.\n\t *\n\t * @since 2.8.0\n\t * @var array|WP_Error $result\n\t * @see WP_Upgrader::$result\n\t */\n\tpublic $result;\n\n\t/**\n\t * Whether multiple themes are being upgraded/installed in bulk.\n\t *\n\t * @since 2.9.0\n\t * @var bool $bulk\n\t */\n\tpublic $bulk = false;\n\n\t/**\n\t * New theme info.\n\t *\n\t * @since 5.5.0\n\t * @var array $new_theme_data\n\t *\n\t * @see check_package()\n\t */\n\tpublic $new_theme_data = array();\n\n\t/**\n\t * Initialize the upgrade strings.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function upgrade_strings() {\n\t\t$this->strings['up_to_date'] = __( 'The theme is at the latest version.' );\n\t\t$this->strings['no_package'] = __( 'Update package not available.' );\n\t\t/* translators: %s: Package URL. */\n\t\t$this->strings['downloading_package'] = sprintf( __( 'Downloading update from %s&#8230;' ), '<span class=\"code\">%s</span>' );\n\t\t$this->strings['unpack_package']      = __( 'Unpacking the update&#8230;' );\n\t\t$this->strings['remove_old']          = __( 'Removing the old version of the theme&#8230;' );\n\t\t$this->strings['remove_old_failed']   = __( 'Could not remove the old theme.' );\n\t\t$this->strings['process_failed']      = __( 'Theme update failed.' );\n\t\t$this->strings['process_success']     = __( 'Theme updated successfully.' );\n\t}\n\n\t/**\n\t * Initialize the installation strings.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function install_strings() {\n\t\t$this->strings['no_package'] = __( 'Installation package not available.' );\n\t\t/* translators: %s: Package URL. */\n\t\t$this->strings['downloading_package'] = sprintf( __( 'Downloading installation package from %s&#8230;' ), '<span class=\"code\">%s</span>' );\n\t\t$this->strings['unpack_package']      = __( 'Unpacking the package&#8230;' );\n\t\t$this->strings['installing_package']  = __( 'Installing the theme&#8230;' );\n\t\t$this->strings['remove_old']          = __( 'Removing the old version of the theme&#8230;' );\n\t\t$this->strings['remove_old_failed']   = __( 'Could not remove the old theme.' );\n\t\t$this->strings['no_files']            = __( 'The theme contains no files.' );\n\t\t$this->strings['process_failed']      = __( 'Theme installation failed.' );\n\t\t$this->strings['process_success']     = __( 'Theme installed successfully.' );\n\t\t/* translators: 1: Theme name, 2: Theme version. */\n\t\t$this->strings['process_success_specific'] = __( 'Successfully installed the theme <strong>%1$s %2$s</strong>.' );\n\t\t$this->strings['parent_theme_search']      = __( 'This theme requires a parent theme. Checking if it is installed&#8230;' );\n\t\t/* translators: 1: Theme name, 2: Theme version. */\n\t\t$this->strings['parent_theme_prepare_install'] = __( 'Preparing to install <strong>%1$s %2$s</strong>&#8230;' );\n\t\t/* translators: 1: Theme name, 2: Theme version. */\n\t\t$this->strings['parent_theme_currently_installed'] = __( 'The parent theme, <strong>%1$s %2$s</strong>, is currently installed.' );\n\t\t/* translators: 1: Theme name, 2: Theme version. */\n\t\t$this->strings['parent_theme_install_success'] = __( 'Successfully installed the parent theme, <strong>%1$s %2$s</strong>.' );\n\t\t/* translators: %s: Theme name. */\n\t\t$this->strings['parent_theme_not_found'] = sprintf( __( '<strong>The parent theme could not be found.</strong> You will need to install the parent theme, %s, before you can use this child theme.' ), '<strong>%s</strong>' );\n\t\t/* translators: %s: Theme error. */\n\t\t$this->strings['current_theme_has_errors'] = __( 'The current theme has the following error: \"%s\".' );\n\n\t\tif ( ! empty( $this->skin->overwrite ) ) {\n\t\t\tif ( 'update-theme' === $this->skin->overwrite ) {\n\t\t\t\t$this->strings['installing_package'] = __( 'Updating the theme&#8230;' );\n\t\t\t\t$this->strings['process_failed']     = __( 'Theme update failed.' );\n\t\t\t\t$this->strings['process_success']    = __( 'Theme updated successfully.' );\n\t\t\t}\n\n\t\t\tif ( 'downgrade-theme' === $this->skin->overwrite ) {\n\t\t\t\t$this->strings['installing_package'] = __( 'Downgrading the theme&#8230;' );\n\t\t\t\t$this->strings['process_failed']     = __( 'Theme downgrade failed.' );\n\t\t\t\t$this->strings['process_success']    = __( 'Theme downgraded successfully.' );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Check if a child theme is being installed and we need to install its parent.\n\t *\n\t * Hooked to the {@see 'upgrader_post_install'} filter by Theme_Upgrader::install().\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param bool  $install_result\n\t * @param array $hook_extra\n\t * @param array $child_result\n\t * @return bool\n\t */\n\tpublic function check_parent_theme_filter( $install_result, $hook_extra, $child_result ) {\n\t\t// Check to see if we need to install a parent theme.\n\t\t$theme_info = $this->theme_info();\n\n\t\tif ( ! $theme_info->parent() ) {\n\t\t\treturn $install_result;\n\t\t}\n\n\t\t$this->skin->feedback( 'parent_theme_search' );\n\n\t\tif ( ! $theme_info->parent()->errors() ) {\n\t\t\t$this->skin->feedback( 'parent_theme_currently_installed', $theme_info->parent()->display( 'Name' ), $theme_info->parent()->display( 'Version' ) );\n\t\t\t// We already have the theme, fall through.\n\t\t\treturn $install_result;\n\t\t}\n\n\t\t// We don't have the parent theme, let's install it.\n\t\t$api = themes_api(\n\t\t\t'theme_information',\n\t\t\tarray(\n\t\t\t\t'slug'   => $theme_info->get( 'Template' ),\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'sections' => false,\n\t\t\t\t\t'tags'     => false,\n\t\t\t\t),\n\t\t\t)\n\t\t); // Save on a bit of bandwidth.\n\n\t\tif ( ! $api || is_wp_error( $api ) ) {\n\t\t\t$this->skin->feedback( 'parent_theme_not_found', $theme_info->get( 'Template' ) );\n\t\t\t// Don't show activate or preview actions after installation.\n\t\t\tadd_filter( 'install_theme_complete_actions', array( $this, 'hide_activate_preview_actions' ) );\n\t\t\treturn $install_result;\n\t\t}\n\n\t\t// Backup required data we're going to override:\n\t\t$child_api             = $this->skin->api;\n\t\t$child_success_message = $this->strings['process_success'];\n\n\t\t// Override them.\n\t\t$this->skin->api = $api;\n\n\t\t$this->strings['process_success_specific'] = $this->strings['parent_theme_install_success'];\n\n\t\t$this->skin->feedback( 'parent_theme_prepare_install', $api->name, $api->version );\n\n\t\tadd_filter( 'install_theme_complete_actions', '__return_false', 999 ); // Don't show any actions after installing the theme.\n\n\t\t// Install the parent theme.\n\t\t$parent_result = $this->run(\n\t\t\tarray(\n\t\t\t\t'package'           => $api->download_link,\n\t\t\t\t'destination'       => get_theme_root(),\n\t\t\t\t'clear_destination' => false, // Do not overwrite files.\n\t\t\t\t'clear_working'     => true,\n\t\t\t)\n\t\t);\n\n\t\tif ( is_wp_error( $parent_result ) ) {\n\t\t\tadd_filter( 'install_theme_complete_actions', array( $this, 'hide_activate_preview_actions' ) );\n\t\t}\n\n\t\t// Start cleaning up after the parent's installation.\n\t\tremove_filter( 'install_theme_complete_actions', '__return_false', 999 );\n\n\t\t// Reset child's result and data.\n\t\t$this->result                     = $child_result;\n\t\t$this->skin->api                  = $child_api;\n\t\t$this->strings['process_success'] = $child_success_message;\n\n\t\treturn $install_result;\n\t}\n\n\t/**\n\t * Don't display the activate and preview actions to the user.\n\t *\n\t * Hooked to the {@see 'install_theme_complete_actions'} filter by\n\t * Theme_Upgrader::check_parent_theme_filter() when installing\n\t * a child theme and installing the parent theme fails.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param array $actions Preview actions.\n\t * @return array\n\t */\n\tpublic function hide_activate_preview_actions( $actions ) {\n\t\tunset( $actions['activate'], $actions['preview'] );\n\t\treturn $actions;\n\t}\n\n\t/**\n\t * Install a theme package.\n\t *\n\t * @since 2.8.0\n\t * @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional.\n\t *\n\t * @param string $package The full local path or URI of the package.\n\t * @param array  $args {\n\t *     Optional. Other arguments for installing a theme package. Default empty array.\n\t *\n\t *     @type bool $clear_update_cache Whether to clear the updates cache if successful.\n\t *                                    Default true.\n\t * }\n\t *\n\t * @return bool|WP_Error True if the installation was successful, false or a WP_Error object otherwise.\n\t */\n\tpublic function install( $package, $args = array() ) {\n\t\t$defaults    = array(\n\t\t\t'clear_update_cache' => true,\n\t\t\t'overwrite_package'  => false, // Do not overwrite files.\n\t\t);\n\t\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t\t$this->init();\n\t\t$this->install_strings();\n\n\t\tadd_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );\n\t\tadd_filter( 'upgrader_post_install', array( $this, 'check_parent_theme_filter' ), 10, 3 );\n\n\t\tif ( $parsed_args['clear_update_cache'] ) {\n\t\t\t// Clear cache so wp_update_themes() knows about the new theme.\n\t\t\tadd_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 );\n\t\t}\n\n\t\t$this->run(\n\t\t\tarray(\n\t\t\t\t'package'           => $package,\n\t\t\t\t'destination'       => get_theme_root(),\n\t\t\t\t'clear_destination' => $parsed_args['overwrite_package'],\n\t\t\t\t'clear_working'     => true,\n\t\t\t\t'hook_extra'        => array(\n\t\t\t\t\t'type'   => 'theme',\n\t\t\t\t\t'action' => 'install',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\tremove_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9 );\n\t\tremove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );\n\t\tremove_filter( 'upgrader_post_install', array( $this, 'check_parent_theme_filter' ) );\n\n\t\tif ( ! $this->result || is_wp_error( $this->result ) ) {\n\t\t\treturn $this->result;\n\t\t}\n\n\t\t// Refresh the Theme Update information.\n\t\twp_clean_themes_cache( $parsed_args['clear_update_cache'] );\n\n\t\tif ( $parsed_args['overwrite_package'] ) {\n\t\t\t/**\n\t\t\t * Fires when the upgrader has successfully overwritten a currently installed\n\t\t\t * plugin or theme with an uploaded zip package.\n\t\t\t *\n\t\t\t * @since 5.5.0\n\t\t\t *\n\t\t\t * @param string  $package        The package file.\n\t\t\t * @param array   $new_theme_data The new theme data.\n\t\t\t * @param string  $package_type   The package type (plugin or theme).\n\t\t\t */\n\t\t\tdo_action( 'upgrader_overwrote_package', $package, $this->new_theme_data, 'theme' );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Upgrade a theme.\n\t *\n\t * @since 2.8.0\n\t * @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional.\n\t *\n\t * @param string $theme The theme slug.\n\t * @param array  $args {\n\t *     Optional. Other arguments for upgrading a theme. Default empty array.\n\t *\n\t *     @type bool $clear_update_cache Whether to clear the update cache if successful.\n\t *                                    Default true.\n\t * }\n\t * @return bool|WP_Error True if the upgrade was successful, false or a WP_Error object otherwise.\n\t */\n\tpublic function upgrade( $theme, $args = array() ) {\n\t\t$defaults    = array(\n\t\t\t'clear_update_cache' => true,\n\t\t);\n\t\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t\t$this->init();\n\t\t$this->upgrade_strings();\n\n\t\t// Is an update available?\n\t\t$current = get_site_transient( 'update_themes' );\n\t\tif ( ! isset( $current->response[ $theme ] ) ) {\n\t\t\t$this->skin->before();\n\t\t\t$this->skin->set_result( false );\n\t\t\t$this->skin->error( 'up_to_date' );\n\t\t\t$this->skin->after();\n\t\t\treturn false;\n\t\t}\n\n\t\t$r = $current->response[ $theme ];\n\n\t\tadd_filter( 'upgrader_pre_install', array( $this, 'current_before' ), 10, 2 );\n\t\tadd_filter( 'upgrader_post_install', array( $this, 'current_after' ), 10, 2 );\n\t\tadd_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ), 10, 4 );\n\t\tif ( $parsed_args['clear_update_cache'] ) {\n\t\t\t// Clear cache so wp_update_themes() knows about the new theme.\n\t\t\tadd_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 );\n\t\t}\n\n\t\t$this->run(\n\t\t\tarray(\n\t\t\t\t'package'           => $r['package'],\n\t\t\t\t'destination'       => get_theme_root( $theme ),\n\t\t\t\t'clear_destination' => true,\n\t\t\t\t'clear_working'     => true,\n\t\t\t\t'hook_extra'        => array(\n\t\t\t\t\t'theme'  => $theme,\n\t\t\t\t\t'type'   => 'theme',\n\t\t\t\t\t'action' => 'update',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\tremove_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9 );\n\t\tremove_filter( 'upgrader_pre_install', array( $this, 'current_before' ) );\n\t\tremove_filter( 'upgrader_post_install', array( $this, 'current_after' ) );\n\t\tremove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ) );\n\n\t\tif ( ! $this->result || is_wp_error( $this->result ) ) {\n\t\t\treturn $this->result;\n\t\t}\n\n\t\twp_clean_themes_cache( $parsed_args['clear_update_cache'] );\n\n\t\t// Ensure any future auto-update failures trigger a failure email by removing\n\t\t// the last failure notification from the list when themes update successfully.\n\t\t$past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() );\n\n\t\tif ( isset( $past_failure_emails[ $theme ] ) ) {\n\t\t\tunset( $past_failure_emails[ $theme ] );\n\t\t\tupdate_option( 'auto_plugin_theme_update_emails', $past_failure_emails );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Upgrade several themes at once.\n\t *\n\t * @since 3.0.0\n\t * @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional.\n\t *\n\t * @param string[] $themes Array of the theme slugs.\n\t * @param array    $args {\n\t *     Optional. Other arguments for upgrading several themes at once. Default empty array.\n\t *\n\t *     @type bool $clear_update_cache Whether to clear the update cache if successful.\n\t *                                    Default true.\n\t * }\n\t * @return array[]|false An array of results, or false if unable to connect to the filesystem.\n\t */\n\tpublic function bulk_upgrade( $themes, $args = array() ) {\n\t\t$defaults    = array(\n\t\t\t'clear_update_cache' => true,\n\t\t);\n\t\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t\t$this->init();\n\t\t$this->bulk = true;\n\t\t$this->upgrade_strings();\n\n\t\t$current = get_site_transient( 'update_themes' );\n\n\t\tadd_filter( 'upgrader_pre_install', array( $this, 'current_before' ), 10, 2 );\n\t\tadd_filter( 'upgrader_post_install', array( $this, 'current_after' ), 10, 2 );\n\t\tadd_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ), 10, 4 );\n\n\t\t$this->skin->header();\n\n\t\t// Connect to the filesystem first.\n\t\t$res = $this->fs_connect( array( WP_CONTENT_DIR ) );\n\t\tif ( ! $res ) {\n\t\t\t$this->skin->footer();\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->skin->bulk_header();\n\n\t\t/*\n\t\t * Only start maintenance mode if:\n\t\t * - running Multisite and there are one or more themes specified, OR\n\t\t * - a theme with an update available is currently in use.\n\t\t * @todo For multisite, maintenance mode should only kick in for individual sites if at all possible.\n\t\t */\n\t\t$maintenance = ( is_multisite() && ! empty( $themes ) );\n\t\tforeach ( $themes as $theme ) {\n\t\t\t$maintenance = $maintenance || get_stylesheet() === $theme || get_template() === $theme;\n\t\t}\n\t\tif ( $maintenance ) {\n\t\t\t$this->maintenance_mode( true );\n\t\t}\n\n\t\t$results = array();\n\n\t\t$this->update_count   = count( $themes );\n\t\t$this->update_current = 0;\n\t\tforeach ( $themes as $theme ) {\n\t\t\t$this->update_current++;\n\n\t\t\t$this->skin->theme_info = $this->theme_info( $theme );\n\n\t\t\tif ( ! isset( $current->response[ $theme ] ) ) {\n\t\t\t\t$this->skin->set_result( true );\n\t\t\t\t$this->skin->before();\n\t\t\t\t$this->skin->feedback( 'up_to_date' );\n\t\t\t\t$this->skin->after();\n\t\t\t\t$results[ $theme ] = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Get the URL to the zip file.\n\t\t\t$r = $current->response[ $theme ];\n\n\t\t\t$result = $this->run(\n\t\t\t\tarray(\n\t\t\t\t\t'package'           => $r['package'],\n\t\t\t\t\t'destination'       => get_theme_root( $theme ),\n\t\t\t\t\t'clear_destination' => true,\n\t\t\t\t\t'clear_working'     => true,\n\t\t\t\t\t'is_multi'          => true,\n\t\t\t\t\t'hook_extra'        => array(\n\t\t\t\t\t\t'theme' => $theme,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$results[ $theme ] = $this->result;\n\n\t\t\t// Prevent credentials auth screen from displaying multiple times.\n\t\t\tif ( false === $result ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} // End foreach $themes.\n\n\t\t$this->maintenance_mode( false );\n\n\t\t// Refresh the Theme Update information.\n\t\twp_clean_themes_cache( $parsed_args['clear_update_cache'] );\n\n\t\t/** This action is documented in wp-admin/includes/class-wp-upgrader.php */\n\t\tdo_action(\n\t\t\t'upgrader_process_complete',\n\t\t\t$this,\n\t\t\tarray(\n\t\t\t\t'action' => 'update',\n\t\t\t\t'type'   => 'theme',\n\t\t\t\t'bulk'   => true,\n\t\t\t\t'themes' => $themes,\n\t\t\t)\n\t\t);\n\n\t\t$this->skin->bulk_footer();\n\n\t\t$this->skin->footer();\n\n\t\t// Cleanup our hooks, in case something else does a upgrade on this connection.\n\t\tremove_filter( 'upgrader_pre_install', array( $this, 'current_before' ) );\n\t\tremove_filter( 'upgrader_post_install', array( $this, 'current_after' ) );\n\t\tremove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ) );\n\n\t\t// Ensure any future auto-update failures trigger a failure email by removing\n\t\t// the last failure notification from the list when themes update successfully.\n\t\t$past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() );\n\n\t\tforeach ( $results as $theme => $result ) {\n\t\t\t// Maintain last failure notification when themes failed to update manually.\n\t\t\tif ( ! $result || is_wp_error( $result ) || ! isset( $past_failure_emails[ $theme ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tunset( $past_failure_emails[ $theme ] );\n\t\t}\n\n\t\tupdate_option( 'auto_plugin_theme_update_emails', $past_failure_emails );\n\n\t\treturn $results;\n\t}\n\n\t/**\n\t * Check that the package source contains a valid theme.\n\t *\n\t * Hooked to the {@see 'upgrader_source_selection'} filter by Theme_Upgrader::install().\n\t * It will return an error if the theme doesn't have style.css or index.php\n\t * files.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n\t *\n\t * @param string $source The full path to the package source.\n\t * @return string|WP_Error The source or a WP_Error.\n\t */\n\tpublic function check_package( $source ) {\n\t\tglobal $wp_filesystem;\n\n\t\t$this->new_theme_data = array();\n\n\t\tif ( is_wp_error( $source ) ) {\n\t\t\treturn $source;\n\t\t}\n\n\t\t// Check that the folder contains a valid theme.\n\t\t$working_directory = str_replace( $wp_filesystem->wp_content_dir(), trailingslashit( WP_CONTENT_DIR ), $source );\n\t\tif ( ! is_dir( $working_directory ) ) { // Sanity check, if the above fails, let's not prevent installation.\n\t\t\treturn $source;\n\t\t}\n\n\t\t// A proper archive should have a style.css file in the single subdirectory.\n\t\tif ( ! file_exists( $working_directory . 'style.css' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'incompatible_archive_theme_no_style',\n\t\t\t\t$this->strings['incompatible_archive'],\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: style.css */\n\t\t\t\t\t__( 'The theme is missing the %s stylesheet.' ),\n\t\t\t\t\t'<code>style.css</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// All these headers are needed on Theme_Installer_Skin::do_overwrite().\n\t\t$info = get_file_data(\n\t\t\t$working_directory . 'style.css',\n\t\t\tarray(\n\t\t\t\t'Name'        => 'Theme Name',\n\t\t\t\t'Version'     => 'Version',\n\t\t\t\t'Author'      => 'Author',\n\t\t\t\t'Template'    => 'Template',\n\t\t\t\t'RequiresWP'  => 'Requires at least',\n\t\t\t\t'RequiresPHP' => 'Requires PHP',\n\t\t\t)\n\t\t);\n\n\t\tif ( empty( $info['Name'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'incompatible_archive_theme_no_name',\n\t\t\t\t$this->strings['incompatible_archive'],\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: style.css */\n\t\t\t\t\t__( 'The %s stylesheet doesn&#8217;t contain a valid theme header.' ),\n\t\t\t\t\t'<code>style.css</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// If it's not a child theme, it must have at least an index.php to be legit.\n\t\tif ( empty( $info['Template'] ) && ! file_exists( $working_directory . 'index.php' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'incompatible_archive_theme_no_index',\n\t\t\t\t$this->strings['incompatible_archive'],\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: index.php */\n\t\t\t\t\t__( 'The theme is missing the %s file.' ),\n\t\t\t\t\t'<code>index.php</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$requires_php = isset( $info['RequiresPHP'] ) ? $info['RequiresPHP'] : null;\n\t\t$requires_wp  = isset( $info['RequiresWP'] ) ? $info['RequiresWP'] : null;\n\n\t\tif ( ! is_php_version_compatible( $requires_php ) ) {\n\t\t\t$error = sprintf(\n\t\t\t\t/* translators: 1: Current PHP version, 2: Version required by the uploaded theme. */\n\t\t\t\t__( 'The PHP version on your server is %1$s, however the uploaded theme requires %2$s.' ),\n\t\t\t\tphpversion(),\n\t\t\t\t$requires_php\n\t\t\t);\n\n\t\t\treturn new WP_Error( 'incompatible_php_required_version', $this->strings['incompatible_archive'], $error );\n\t\t}\n\t\tif ( ! is_wp_version_compatible( $requires_wp ) ) {\n\t\t\t$error = sprintf(\n\t\t\t\t/* translators: 1: Current WordPress version, 2: Version required by the uploaded theme. */\n\t\t\t\t__( 'Your WordPress version is %1$s, however the uploaded theme requires %2$s.' ),\n\t\t\t\t$GLOBALS['wp_version'],\n\t\t\t\t$requires_wp\n\t\t\t);\n\n\t\t\treturn new WP_Error( 'incompatible_wp_required_version', $this->strings['incompatible_archive'], $error );\n\t\t}\n\n\t\t$this->new_theme_data = $info;\n\n\t\treturn $source;\n\t}\n\n\t/**\n\t * Turn on maintenance mode before attempting to upgrade the current theme.\n\t *\n\t * Hooked to the {@see 'upgrader_pre_install'} filter by Theme_Upgrader::upgrade() and\n\t * Theme_Upgrader::bulk_upgrade().\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param bool|WP_Error $return Upgrade offer return.\n\t * @param array         $theme  Theme arguments.\n\t * @return bool|WP_Error The passed in $return param or WP_Error.\n\t */\n\tpublic function current_before( $return, $theme ) {\n\t\tif ( is_wp_error( $return ) ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t$theme = isset( $theme['theme'] ) ? $theme['theme'] : '';\n\n\t\t// Only run if current theme\n\t\tif ( get_stylesheet() !== $theme ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t// Change to maintenance mode. Bulk edit handles this separately.\n\t\tif ( ! $this->bulk ) {\n\t\t\t$this->maintenance_mode( true );\n\t\t}\n\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Turn off maintenance mode after upgrading the current theme.\n\t *\n\t * Hooked to the {@see 'upgrader_post_install'} filter by Theme_Upgrader::upgrade()\n\t * and Theme_Upgrader::bulk_upgrade().\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param bool|WP_Error $return Upgrade offer return.\n\t * @param array         $theme  Theme arguments.\n\t * @return bool|WP_Error The passed in $return param or WP_Error.\n\t */\n\tpublic function current_after( $return, $theme ) {\n\t\tif ( is_wp_error( $return ) ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t$theme = isset( $theme['theme'] ) ? $theme['theme'] : '';\n\n\t\t// Only run if current theme.\n\t\tif ( get_stylesheet() !== $theme ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t// Ensure stylesheet name hasn't changed after the upgrade:\n\t\tif ( get_stylesheet() === $theme && $theme !== $this->result['destination_name'] ) {\n\t\t\twp_clean_themes_cache();\n\t\t\t$stylesheet = $this->result['destination_name'];\n\t\t\tswitch_theme( $stylesheet );\n\t\t}\n\n\t\t// Time to remove maintenance mode. Bulk edit handles this separately.\n\t\tif ( ! $this->bulk ) {\n\t\t\t$this->maintenance_mode( false );\n\t\t}\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Delete the old theme during an upgrade.\n\t *\n\t * Hooked to the {@see 'upgrader_clear_destination'} filter by Theme_Upgrader::upgrade()\n\t * and Theme_Upgrader::bulk_upgrade().\n\t *\n\t * @since 2.8.0\n\t *\n\t * @global WP_Filesystem_Base $wp_filesystem Subclass\n\t *\n\t * @param bool   $removed\n\t * @param string $local_destination\n\t * @param string $remote_destination\n\t * @param array  $theme\n\t * @return bool\n\t */\n\tpublic function delete_old_theme( $removed, $local_destination, $remote_destination, $theme ) {\n\t\tglobal $wp_filesystem;\n\n\t\tif ( is_wp_error( $removed ) ) {\n\t\t\treturn $removed; // Pass errors through.\n\t\t}\n\n\t\tif ( ! isset( $theme['theme'] ) ) {\n\t\t\treturn $removed;\n\t\t}\n\n\t\t$theme      = $theme['theme'];\n\t\t$themes_dir = trailingslashit( $wp_filesystem->wp_themes_dir( $theme ) );\n\t\tif ( $wp_filesystem->exists( $themes_dir . $theme ) ) {\n\t\t\tif ( ! $wp_filesystem->delete( $themes_dir . $theme, true ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Get the WP_Theme object for a theme.\n\t *\n\t * @since 2.8.0\n\t * @since 3.0.0 The `$theme` argument was added.\n\t *\n\t * @param string $theme The directory name of the theme. This is optional, and if not supplied,\n\t *                      the directory name from the last result will be used.\n\t * @return WP_Theme|false The theme's info object, or false `$theme` is not supplied\n\t *                        and the last result isn't set.\n\t */\n\tpublic function theme_info( $theme = null ) {\n\t\tif ( empty( $theme ) ) {\n\t\t\tif ( ! empty( $this->result['destination_name'] ) ) {\n\t\t\t\t$theme = $this->result['destination_name'];\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$theme = wp_get_theme( $theme );\n\t\t$theme->cache_delete();\n\n\t\treturn $theme;\n\t}\n\n}\n", "num_lines": 756}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Taxonomy API: Walker_Category_Checklist class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.4.0\n */\n\n/**\n * Core walker class to output an unordered list of category checkbox input elements.\n *\n * @since 2.5.1\n *\n * @see Walker\n * @see wp_category_checklist()\n * @see wp_terms_checklist()\n */\nclass Walker_Category_Checklist extends Walker {\n\tpublic $tree_type = 'category';\n\tpublic $db_fields = array(\n\t\t'parent' => 'parent',\n\t\t'id'     => 'term_id',\n\t); // TODO: Decouple this.\n\n\t/**\n\t * Starts the list before the elements are added.\n\t *\n\t * @see Walker:start_lvl()\n\t *\n\t * @since 2.5.1\n\t *\n\t * @param string $output Used to append additional content (passed by reference).\n\t * @param int    $depth  Depth of category. Used for tab indentation.\n\t * @param array  $args   An array of arguments. @see wp_terms_checklist()\n\t */\n\tpublic function start_lvl( &$output, $depth = 0, $args = array() ) {\n\t\t$indent  = str_repeat( \"\\t\", $depth );\n\t\t$output .= \"$indent<ul class='children'>\\n\";\n\t}\n\n\t/**\n\t * Ends the list of after the elements are added.\n\t *\n\t * @see Walker::end_lvl()\n\t *\n\t * @since 2.5.1\n\t *\n\t * @param string $output Used to append additional content (passed by reference).\n\t * @param int    $depth  Depth of category. Used for tab indentation.\n\t * @param array  $args   An array of arguments. @see wp_terms_checklist()\n\t */\n\tpublic function end_lvl( &$output, $depth = 0, $args = array() ) {\n\t\t$indent  = str_repeat( \"\\t\", $depth );\n\t\t$output .= \"$indent</ul>\\n\";\n\t}\n\n\t/**\n\t * Start the element output.\n\t *\n\t * @see Walker::start_el()\n\t *\n\t * @since 2.5.1\n\t *\n\t * @param string $output   Used to append additional content (passed by reference).\n\t * @param object $category The current term object.\n\t * @param int    $depth    Depth of the term in reference to parents. Default 0.\n\t * @param array  $args     An array of arguments. @see wp_terms_checklist()\n\t * @param int    $id       ID of the current term.\n\t */\n\tpublic function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {\n\t\tif ( empty( $args['taxonomy'] ) ) {\n\t\t\t$taxonomy = 'category';\n\t\t} else {\n\t\t\t$taxonomy = $args['taxonomy'];\n\t\t}\n\n\t\tif ( 'category' === $taxonomy ) {\n\t\t\t$name = 'post_category';\n\t\t} else {\n\t\t\t$name = 'tax_input[' . $taxonomy . ']';\n\t\t}\n\n\t\t$args['popular_cats'] = ! empty( $args['popular_cats'] ) ? array_map( 'intval', $args['popular_cats'] ) : array();\n\n\t\t$class = in_array( $category->term_id, $args['popular_cats'], true ) ? ' class=\"popular-category\"' : '';\n\n\t\t$args['selected_cats'] = ! empty( $args['selected_cats'] ) ? array_map( 'intval', $args['selected_cats'] ) : array();\n\n\t\tif ( ! empty( $args['list_only'] ) ) {\n\t\t\t$aria_checked = 'false';\n\t\t\t$inner_class  = 'category';\n\n\t\t\tif ( in_array( $category->term_id, $args['selected_cats'], true ) ) {\n\t\t\t\t$inner_class .= ' selected';\n\t\t\t\t$aria_checked = 'true';\n\t\t\t}\n\n\t\t\t$output .= \"\\n\" . '<li' . $class . '>' .\n\t\t\t\t'<div class=\"' . $inner_class . '\" data-term-id=' . $category->term_id .\n\t\t\t\t' tabindex=\"0\" role=\"checkbox\" aria-checked=\"' . $aria_checked . '\">' .\n\t\t\t\t/** This filter is documented in wp-includes/category-template.php */\n\t\t\t\tesc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</div>';\n\t\t} else {\n\t\t\t$is_selected = in_array( $category->term_id, $args['selected_cats'], true );\n\t\t\t$is_disabled = ! empty( $args['disabled'] );\n\n\t\t\t$output .= \"\\n<li id='{$taxonomy}-{$category->term_id}'$class>\" .\n\t\t\t\t'<label class=\"selectit\"><input value=\"' . $category->term_id . '\" type=\"checkbox\" name=\"' . $name . '[]\" id=\"in-' . $taxonomy . '-' . $category->term_id . '\"' .\n\t\t\t\tchecked( $is_selected, true, false ) .\n\t\t\t\tdisabled( $is_disabled, true, false ) . ' /> ' .\n\t\t\t\t/** This filter is documented in wp-includes/category-template.php */\n\t\t\t\tesc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</label>';\n\t\t}\n\t}\n\n\t/**\n\t * Ends the element output, if needed.\n\t *\n\t * @see Walker::end_el()\n\t *\n\t * @since 2.5.1\n\t *\n\t * @param string $output   Used to append additional content (passed by reference).\n\t * @param object $category The current term object.\n\t * @param int    $depth    Depth of the term in reference to parents. Default 0.\n\t * @param array  $args     An array of arguments. @see wp_terms_checklist()\n\t */\n\tpublic function end_el( &$output, $category, $depth = 0, $args = array() ) {\n\t\t$output .= \"</li>\\n\";\n\t}\n}\n", "num_lines": 133}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Navigation Menu API: Walker_Nav_Menu_Checklist class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.4.0\n */\n\n/**\n * Create HTML list of nav menu input items.\n *\n * @since 3.0.0\n * @uses Walker_Nav_Menu\n */\nclass Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {\n\t/**\n\t * @param array $fields\n\t */\n\tpublic function __construct( $fields = false ) {\n\t\tif ( $fields ) {\n\t\t\t$this->db_fields = $fields;\n\t\t}\n\t}\n\n\t/**\n\t * Starts the list before the elements are added.\n\t *\n\t * @see Walker_Nav_Menu::start_lvl()\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string   $output Used to append additional content (passed by reference).\n\t * @param int      $depth  Depth of page. Used for padding.\n\t * @param stdClass $args   Not used.\n\t */\n\tpublic function start_lvl( &$output, $depth = 0, $args = null ) {\n\t\t$indent  = str_repeat( \"\\t\", $depth );\n\t\t$output .= \"\\n$indent<ul class='children'>\\n\";\n\t}\n\n\t/**\n\t * Ends the list of after the elements are added.\n\t *\n\t * @see Walker_Nav_Menu::end_lvl()\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string   $output Used to append additional content (passed by reference).\n\t * @param int      $depth  Depth of page. Used for padding.\n\t * @param stdClass $args   Not used.\n\t */\n\tpublic function end_lvl( &$output, $depth = 0, $args = null ) {\n\t\t$indent  = str_repeat( \"\\t\", $depth );\n\t\t$output .= \"\\n$indent</ul>\";\n\t}\n\n\t/**\n\t * Start the element output.\n\t *\n\t * @see Walker_Nav_Menu::start_el()\n\t *\n\t * @since 3.0.0\n\t *\n\t * @global int        $_nav_menu_placeholder\n\t * @global int|string $nav_menu_selected_id\n\t *\n\t * @param string   $output Used to append additional content (passed by reference).\n\t * @param WP_Post  $item   Menu item data object.\n\t * @param int      $depth  Depth of menu item. Used for padding.\n\t * @param stdClass $args   Not used.\n\t * @param int      $id     Not used.\n\t */\n\tpublic function start_el( &$output, $item, $depth = 0, $args = null, $id = 0 ) {\n\t\tglobal $_nav_menu_placeholder, $nav_menu_selected_id;\n\n\t\t$_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval( $_nav_menu_placeholder ) - 1 : -1;\n\t\t$possible_object_id    = isset( $item->post_type ) && 'nav_menu_item' === $item->post_type ? $item->object_id : $_nav_menu_placeholder;\n\t\t$possible_db_id        = ( ! empty( $item->ID ) ) && ( 0 < $possible_object_id ) ? (int) $item->ID : 0;\n\n\t\t$indent = ( $depth ) ? str_repeat( \"\\t\", $depth ) : '';\n\n\t\t$output .= $indent . '<li>';\n\t\t$output .= '<label class=\"menu-item-title\">';\n\t\t$output .= '<input type=\"checkbox\"' . wp_nav_menu_disabled_check( $nav_menu_selected_id, false ) . ' class=\"menu-item-checkbox';\n\n\t\tif ( ! empty( $item->front_or_home ) ) {\n\t\t\t$output .= ' add-to-top';\n\t\t}\n\n\t\t$output .= '\" name=\"menu-item[' . $possible_object_id . '][menu-item-object-id]\" value=\"' . esc_attr( $item->object_id ) . '\" /> ';\n\n\t\tif ( ! empty( $item->label ) ) {\n\t\t\t$title = $item->label;\n\t\t} elseif ( isset( $item->post_type ) ) {\n\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t$title = apply_filters( 'the_title', $item->post_title, $item->ID );\n\t\t}\n\n\t\t$output .= isset( $title ) ? esc_html( $title ) : esc_html( $item->title );\n\n\t\tif ( empty( $item->label ) && isset( $item->post_type ) && 'page' === $item->post_type ) {\n\t\t\t// Append post states.\n\t\t\t$output .= _post_states( $item, false );\n\t\t}\n\n\t\t$output .= '</label>';\n\n\t\t// Menu item hidden fields.\n\t\t$output .= '<input type=\"hidden\" class=\"menu-item-db-id\" name=\"menu-item[' . $possible_object_id . '][menu-item-db-id]\" value=\"' . $possible_db_id . '\" />';\n\t\t$output .= '<input type=\"hidden\" class=\"menu-item-object\" name=\"menu-item[' . $possible_object_id . '][menu-item-object]\" value=\"' . esc_attr( $item->object ) . '\" />';\n\t\t$output .= '<input type=\"hidden\" class=\"menu-item-parent-id\" name=\"menu-item[' . $possible_object_id . '][menu-item-parent-id]\" value=\"' . esc_attr( $item->menu_item_parent ) . '\" />';\n\t\t$output .= '<input type=\"hidden\" class=\"menu-item-type\" name=\"menu-item[' . $possible_object_id . '][menu-item-type]\" value=\"' . esc_attr( $item->type ) . '\" />';\n\t\t$output .= '<input type=\"hidden\" class=\"menu-item-title\" name=\"menu-item[' . $possible_object_id . '][menu-item-title]\" value=\"' . esc_attr( $item->title ) . '\" />';\n\t\t$output .= '<input type=\"hidden\" class=\"menu-item-url\" name=\"menu-item[' . $possible_object_id . '][menu-item-url]\" value=\"' . esc_attr( $item->url ) . '\" />';\n\t\t$output .= '<input type=\"hidden\" class=\"menu-item-target\" name=\"menu-item[' . $possible_object_id . '][menu-item-target]\" value=\"' . esc_attr( $item->target ) . '\" />';\n\t\t$output .= '<input type=\"hidden\" class=\"menu-item-attr-title\" name=\"menu-item[' . $possible_object_id . '][menu-item-attr-title]\" value=\"' . esc_attr( $item->attr_title ) . '\" />';\n\t\t$output .= '<input type=\"hidden\" class=\"menu-item-classes\" name=\"menu-item[' . $possible_object_id . '][menu-item-classes]\" value=\"' . esc_attr( implode( ' ', $item->classes ) ) . '\" />';\n\t\t$output .= '<input type=\"hidden\" class=\"menu-item-xfn\" name=\"menu-item[' . $possible_object_id . '][menu-item-xfn]\" value=\"' . esc_attr( $item->xfn ) . '\" />';\n\t}\n\n}\n", "num_lines": 123}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Navigation Menu API: Walker_Nav_Menu_Edit class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.4.0\n */\n\n/**\n * Create HTML list of nav menu input items.\n *\n * @since 3.0.0\n *\n * @see Walker_Nav_Menu\n */\nclass Walker_Nav_Menu_Edit extends Walker_Nav_Menu {\n\t/**\n\t * Starts the list before the elements are added.\n\t *\n\t * @see Walker_Nav_Menu::start_lvl()\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string   $output Passed by reference.\n\t * @param int      $depth  Depth of menu item. Used for padding.\n\t * @param stdClass $args   Not used.\n\t */\n\tpublic function start_lvl( &$output, $depth = 0, $args = null ) {}\n\n\t/**\n\t * Ends the list of after the elements are added.\n\t *\n\t * @see Walker_Nav_Menu::end_lvl()\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string   $output Passed by reference.\n\t * @param int      $depth  Depth of menu item. Used for padding.\n\t * @param stdClass $args   Not used.\n\t */\n\tpublic function end_lvl( &$output, $depth = 0, $args = null ) {}\n\n\t/**\n\t * Start the element output.\n\t *\n\t * @see Walker_Nav_Menu::start_el()\n\t * @since 3.0.0\n\t *\n\t * @global int $_wp_nav_menu_max_depth\n\t *\n\t * @param string   $output Used to append additional content (passed by reference).\n\t * @param WP_Post  $item   Menu item data object.\n\t * @param int      $depth  Depth of menu item. Used for padding.\n\t * @param stdClass $args   Not used.\n\t * @param int      $id     Not used.\n\t */\n\tpublic function start_el( &$output, $item, $depth = 0, $args = null, $id = 0 ) {\n\t\tglobal $_wp_nav_menu_max_depth;\n\t\t$_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth;\n\n\t\tob_start();\n\t\t$item_id      = esc_attr( $item->ID );\n\t\t$removed_args = array(\n\t\t\t'action',\n\t\t\t'customlink-tab',\n\t\t\t'edit-menu-item',\n\t\t\t'menu-item',\n\t\t\t'page-tab',\n\t\t\t'_wpnonce',\n\t\t);\n\n\t\t$original_title = false;\n\n\t\tif ( 'taxonomy' === $item->type ) {\n\t\t\t$original_object = get_term( (int) $item->object_id, $item->object );\n\t\t\tif ( $original_object && ! is_wp_error( $original_object ) ) {\n\t\t\t\t$original_title = $original_object->name;\n\t\t\t}\n\t\t} elseif ( 'post_type' === $item->type ) {\n\t\t\t$original_object = get_post( $item->object_id );\n\t\t\tif ( $original_object ) {\n\t\t\t\t$original_title = get_the_title( $original_object->ID );\n\t\t\t}\n\t\t} elseif ( 'post_type_archive' === $item->type ) {\n\t\t\t$original_object = get_post_type_object( $item->object );\n\t\t\tif ( $original_object ) {\n\t\t\t\t$original_title = $original_object->labels->archives;\n\t\t\t}\n\t\t}\n\n\t\t$classes = array(\n\t\t\t'menu-item menu-item-depth-' . $depth,\n\t\t\t'menu-item-' . esc_attr( $item->object ),\n\t\t\t'menu-item-edit-' . ( ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? 'active' : 'inactive' ),\n\t\t);\n\n\t\t$title = $item->title;\n\n\t\tif ( ! empty( $item->_invalid ) ) {\n\t\t\t$classes[] = 'menu-item-invalid';\n\t\t\t/* translators: %s: Title of an invalid menu item. */\n\t\t\t$title = sprintf( __( '%s (Invalid)' ), $item->title );\n\t\t} elseif ( isset( $item->post_status ) && 'draft' === $item->post_status ) {\n\t\t\t$classes[] = 'pending';\n\t\t\t/* translators: %s: Title of a menu item in draft status. */\n\t\t\t$title = sprintf( __( '%s (Pending)' ), $item->title );\n\t\t}\n\n\t\t$title = ( ! isset( $item->label ) || '' === $item->label ) ? $title : $item->label;\n\n\t\t$submenu_text = '';\n\t\tif ( 0 == $depth ) {\n\t\t\t$submenu_text = 'style=\"display: none;\"';\n\t\t}\n\n\t\t?>\n\t\t<li id=\"menu-item-<?php echo $item_id; ?>\" class=\"<?php echo implode( ' ', $classes ); ?>\">\n\t\t\t<div class=\"menu-item-bar\">\n\t\t\t\t<div class=\"menu-item-handle\">\n\t\t\t\t\t<span class=\"item-title\"><span class=\"menu-item-title\"><?php echo esc_html( $title ); ?></span> <span class=\"is-submenu\" <?php echo $submenu_text; ?>><?php _e( 'sub item' ); ?></span></span>\n\t\t\t\t\t<span class=\"item-controls\">\n\t\t\t\t\t\t<span class=\"item-type\"><?php echo esc_html( $item->type_label ); ?></span>\n\t\t\t\t\t\t<span class=\"item-order hide-if-js\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t'<a href=\"%s\" class=\"item-move-up\" aria-label=\"%s\">&#8593;</a>',\n\t\t\t\t\t\t\t\twp_nonce_url(\n\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'action'    => 'move-up-menu-item',\n\t\t\t\t\t\t\t\t\t\t\t'menu-item' => $item_id,\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tremove_query_arg( $removed_args, admin_url( 'nav-menus.php' ) )\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'move-menu_item'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tesc_attr__( 'Move up' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t|\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t'<a href=\"%s\" class=\"item-move-down\" aria-label=\"%s\">&#8595;</a>',\n\t\t\t\t\t\t\t\twp_nonce_url(\n\t\t\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'action'    => 'move-down-menu-item',\n\t\t\t\t\t\t\t\t\t\t\t'menu-item' => $item_id,\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tremove_query_arg( $removed_args, admin_url( 'nav-menus.php' ) )\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'move-menu_item'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tesc_attr__( 'Move down' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) {\n\t\t\t\t\t\t\t$edit_url = admin_url( 'nav-menus.php' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$edit_url = add_query_arg(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'edit-menu-item' => $item_id,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tremove_query_arg( $removed_args, admin_url( 'nav-menus.php#menu-item-settings-' . $item_id ) )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t'<a class=\"item-edit\" id=\"edit-%s\" href=\"%s\" aria-label=\"%s\"><span class=\"screen-reader-text\">%s</span></a>',\n\t\t\t\t\t\t\t$item_id,\n\t\t\t\t\t\t\t$edit_url,\n\t\t\t\t\t\t\tesc_attr__( 'Edit menu item' ),\n\t\t\t\t\t\t\t__( 'Edit' )\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class=\"menu-item-settings wp-clearfix\" id=\"menu-item-settings-<?php echo $item_id; ?>\">\n\t\t\t\t<?php if ( 'custom' === $item->type ) : ?>\n\t\t\t\t\t<p class=\"field-url description description-wide\">\n\t\t\t\t\t\t<label for=\"edit-menu-item-url-<?php echo $item_id; ?>\">\n\t\t\t\t\t\t\t<?php _e( 'URL' ); ?><br />\n\t\t\t\t\t\t\t<input type=\"text\" id=\"edit-menu-item-url-<?php echo $item_id; ?>\" class=\"widefat code edit-menu-item-url\" name=\"menu-item-url[<?php echo $item_id; ?>]\" value=\"<?php echo esc_attr( $item->url ); ?>\" />\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</p>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<p class=\"description description-wide\">\n\t\t\t\t\t<label for=\"edit-menu-item-title-<?php echo $item_id; ?>\">\n\t\t\t\t\t\t<?php _e( 'Navigation Label' ); ?><br />\n\t\t\t\t\t\t<input type=\"text\" id=\"edit-menu-item-title-<?php echo $item_id; ?>\" class=\"widefat edit-menu-item-title\" name=\"menu-item-title[<?php echo $item_id; ?>]\" value=\"<?php echo esc_attr( $item->title ); ?>\" />\n\t\t\t\t\t</label>\n\t\t\t\t</p>\n\t\t\t\t<p class=\"field-title-attribute field-attr-title description description-wide\">\n\t\t\t\t\t<label for=\"edit-menu-item-attr-title-<?php echo $item_id; ?>\">\n\t\t\t\t\t\t<?php _e( 'Title Attribute' ); ?><br />\n\t\t\t\t\t\t<input type=\"text\" id=\"edit-menu-item-attr-title-<?php echo $item_id; ?>\" class=\"widefat edit-menu-item-attr-title\" name=\"menu-item-attr-title[<?php echo $item_id; ?>]\" value=\"<?php echo esc_attr( $item->post_excerpt ); ?>\" />\n\t\t\t\t\t</label>\n\t\t\t\t</p>\n\t\t\t\t<p class=\"field-link-target description\">\n\t\t\t\t\t<label for=\"edit-menu-item-target-<?php echo $item_id; ?>\">\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"edit-menu-item-target-<?php echo $item_id; ?>\" value=\"_blank\" name=\"menu-item-target[<?php echo $item_id; ?>]\"<?php checked( $item->target, '_blank' ); ?> />\n\t\t\t\t\t\t<?php _e( 'Open link in a new tab' ); ?>\n\t\t\t\t\t</label>\n\t\t\t\t</p>\n\t\t\t\t<p class=\"field-css-classes description description-thin\">\n\t\t\t\t\t<label for=\"edit-menu-item-classes-<?php echo $item_id; ?>\">\n\t\t\t\t\t\t<?php _e( 'CSS Classes (optional)' ); ?><br />\n\t\t\t\t\t\t<input type=\"text\" id=\"edit-menu-item-classes-<?php echo $item_id; ?>\" class=\"widefat code edit-menu-item-classes\" name=\"menu-item-classes[<?php echo $item_id; ?>]\" value=\"<?php echo esc_attr( implode( ' ', $item->classes ) ); ?>\" />\n\t\t\t\t\t</label>\n\t\t\t\t</p>\n\t\t\t\t<p class=\"field-xfn description description-thin\">\n\t\t\t\t\t<label for=\"edit-menu-item-xfn-<?php echo $item_id; ?>\">\n\t\t\t\t\t\t<?php _e( 'Link Relationship (XFN)' ); ?><br />\n\t\t\t\t\t\t<input type=\"text\" id=\"edit-menu-item-xfn-<?php echo $item_id; ?>\" class=\"widefat code edit-menu-item-xfn\" name=\"menu-item-xfn[<?php echo $item_id; ?>]\" value=\"<?php echo esc_attr( $item->xfn ); ?>\" />\n\t\t\t\t\t</label>\n\t\t\t\t</p>\n\t\t\t\t<p class=\"field-description description description-wide\">\n\t\t\t\t\t<label for=\"edit-menu-item-description-<?php echo $item_id; ?>\">\n\t\t\t\t\t\t<?php _e( 'Description' ); ?><br />\n\t\t\t\t\t\t<textarea id=\"edit-menu-item-description-<?php echo $item_id; ?>\" class=\"widefat edit-menu-item-description\" rows=\"3\" cols=\"20\" name=\"menu-item-description[<?php echo $item_id; ?>]\"><?php echo esc_html( $item->description ); // textarea_escaped ?></textarea>\n\t\t\t\t\t\t<span class=\"description\"><?php _e( 'The description will be displayed in the menu if the current theme supports it.' ); ?></span>\n\t\t\t\t\t</label>\n\t\t\t\t</p>\n\n\t\t\t\t<?php\n\t\t\t\t/**\n\t\t\t\t * Fires just before the move buttons of a nav menu item in the menu editor.\n\t\t\t\t *\n\t\t\t\t * @since 5.4.0\n\t\t\t\t *\n\t\t\t\t * @param int      $item_id Menu item ID.\n\t\t\t\t * @param WP_Post  $item    Menu item data object.\n\t\t\t\t * @param int      $depth   Depth of menu item. Used for padding.\n\t\t\t\t * @param stdClass $args    An object of menu item arguments.\n\t\t\t\t * @param int      $id      Nav menu ID.\n\t\t\t\t */\n\t\t\t\tdo_action( 'wp_nav_menu_item_custom_fields', $item_id, $item, $depth, $args, $id );\n\t\t\t\t?>\n\n\t\t\t\t<fieldset class=\"field-move hide-if-no-js description description-wide\">\n\t\t\t\t\t<span class=\"field-move-visual-label\" aria-hidden=\"true\"><?php _e( 'Move' ); ?></span>\n\t\t\t\t\t<button type=\"button\" class=\"button-link menus-move menus-move-up\" data-dir=\"up\"><?php _e( 'Up one' ); ?></button>\n\t\t\t\t\t<button type=\"button\" class=\"button-link menus-move menus-move-down\" data-dir=\"down\"><?php _e( 'Down one' ); ?></button>\n\t\t\t\t\t<button type=\"button\" class=\"button-link menus-move menus-move-left\" data-dir=\"left\"></button>\n\t\t\t\t\t<button type=\"button\" class=\"button-link menus-move menus-move-right\" data-dir=\"right\"></button>\n\t\t\t\t\t<button type=\"button\" class=\"button-link menus-move menus-move-top\" data-dir=\"top\"><?php _e( 'To the top' ); ?></button>\n\t\t\t\t</fieldset>\n\n\t\t\t\t<div class=\"menu-item-actions description-wide submitbox\">\n\t\t\t\t\t<?php if ( 'custom' !== $item->type && false !== $original_title ) : ?>\n\t\t\t\t\t\t<p class=\"link-to-original\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/* translators: %s: Link to menu item's original object. */\n\t\t\t\t\t\t\tprintf( __( 'Original: %s' ), '<a href=\"' . esc_attr( $item->url ) . '\">' . esc_html( $original_title ) . '</a>' );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t'<a class=\"item-delete submitdelete deletion\" id=\"delete-%s\" href=\"%s\">%s</a>',\n\t\t\t\t\t\t$item_id,\n\t\t\t\t\t\twp_nonce_url(\n\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'action'    => 'delete-menu-item',\n\t\t\t\t\t\t\t\t\t'menu-item' => $item_id,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tadmin_url( 'nav-menus.php' )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'delete-menu_item_' . $item_id\n\t\t\t\t\t\t),\n\t\t\t\t\t\t__( 'Remove' )\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t\t<span class=\"meta-sep hide-if-no-js\"> | </span>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t'<a class=\"item-cancel submitcancel hide-if-no-js\" id=\"cancel-%s\" href=\"%s#menu-item-settings-%s\">%s</a>',\n\t\t\t\t\t\t$item_id,\n\t\t\t\t\t\tesc_url(\n\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'edit-menu-item' => $item_id,\n\t\t\t\t\t\t\t\t\t'cancel'         => time(),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tadmin_url( 'nav-menus.php' )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t$item_id,\n\t\t\t\t\t\t__( 'Cancel' )\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\n\t\t\t\t<input class=\"menu-item-data-db-id\" type=\"hidden\" name=\"menu-item-db-id[<?php echo $item_id; ?>]\" value=\"<?php echo $item_id; ?>\" />\n\t\t\t\t<input class=\"menu-item-data-object-id\" type=\"hidden\" name=\"menu-item-object-id[<?php echo $item_id; ?>]\" value=\"<?php echo esc_attr( $item->object_id ); ?>\" />\n\t\t\t\t<input class=\"menu-item-data-object\" type=\"hidden\" name=\"menu-item-object[<?php echo $item_id; ?>]\" value=\"<?php echo esc_attr( $item->object ); ?>\" />\n\t\t\t\t<input class=\"menu-item-data-parent-id\" type=\"hidden\" name=\"menu-item-parent-id[<?php echo $item_id; ?>]\" value=\"<?php echo esc_attr( $item->menu_item_parent ); ?>\" />\n\t\t\t\t<input class=\"menu-item-data-position\" type=\"hidden\" name=\"menu-item-position[<?php echo $item_id; ?>]\" value=\"<?php echo esc_attr( $item->menu_order ); ?>\" />\n\t\t\t\t<input class=\"menu-item-data-type\" type=\"hidden\" name=\"menu-item-type[<?php echo $item_id; ?>]\" value=\"<?php echo esc_attr( $item->type ); ?>\" />\n\t\t\t</div><!-- .menu-item-settings-->\n\t\t\t<ul class=\"menu-item-transport\"></ul>\n\t\t<?php\n\t\t$output .= ob_get_clean();\n\t}\n\n}\n", "num_lines": 314}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrader API: WP_Ajax_Upgrader_Skin class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Upgrader Skin for Ajax WordPress upgrades.\n *\n * This skin is designed to be used for Ajax updates.\n *\n * @since 4.6.0\n *\n * @see Automatic_Upgrader_Skin\n */\nclass WP_Ajax_Upgrader_Skin extends Automatic_Upgrader_Skin {\n\n\t/**\n\t * Holds the WP_Error object.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @var null|WP_Error\n\t */\n\tprotected $errors = null;\n\n\t/**\n\t * Constructor.\n\t *\n\t * Sets up the WordPress Ajax upgrader skin.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @see WP_Upgrader_Skin::__construct()\n\t *\n\t * @param array $args Optional. The WordPress Ajax upgrader skin arguments to\n\t *                    override default options. See WP_Upgrader_Skin::__construct().\n\t *                    Default empty array.\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\tparent::__construct( $args );\n\n\t\t$this->errors = new WP_Error();\n\t}\n\n\t/**\n\t * Retrieves the list of errors.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @return WP_Error Errors during an upgrade.\n\t */\n\tpublic function get_errors() {\n\t\treturn $this->errors;\n\t}\n\n\t/**\n\t * Retrieves a string for error messages.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @return string Error messages during an upgrade.\n\t */\n\tpublic function get_error_messages() {\n\t\t$messages = array();\n\n\t\tforeach ( $this->errors->get_error_codes() as $error_code ) {\n\t\t\t$error_data = $this->errors->get_error_data( $error_code );\n\n\t\t\tif ( $error_data && is_string( $error_data ) ) {\n\t\t\t\t$messages[] = $this->errors->get_error_message( $error_code ) . ' ' . esc_html( strip_tags( $error_data ) );\n\t\t\t} else {\n\t\t\t\t$messages[] = $this->errors->get_error_message( $error_code );\n\t\t\t}\n\t\t}\n\n\t\treturn implode( ', ', $messages );\n\t}\n\n\t/**\n\t * Stores a log entry for an error.\n\t *\n\t * @since 4.6.0\n\t * @since 5.3.0 Formalized the existing `...$args` parameter by adding it\n\t *              to the function signature.\n\t *\n\t * @param string|WP_Error $errors  Errors.\n\t * @param mixed           ...$args Optional text replacements.\n\t */\n\tpublic function error( $errors, ...$args ) {\n\t\tif ( is_string( $errors ) ) {\n\t\t\t$string = $errors;\n\t\t\tif ( ! empty( $this->upgrader->strings[ $string ] ) ) {\n\t\t\t\t$string = $this->upgrader->strings[ $string ];\n\t\t\t}\n\n\t\t\tif ( false !== strpos( $string, '%' ) ) {\n\t\t\t\tif ( ! empty( $args ) ) {\n\t\t\t\t\t$string = vsprintf( $string, $args );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Count existing errors to generate a unique error code.\n\t\t\t$errors_count = count( $this->errors->get_error_codes() );\n\t\t\t$this->errors->add( 'unknown_upgrade_error_' . ( $errors_count + 1 ), $string );\n\t\t} elseif ( is_wp_error( $errors ) ) {\n\t\t\tforeach ( $errors->get_error_codes() as $error_code ) {\n\t\t\t\t$this->errors->add( $error_code, $errors->get_error_message( $error_code ), $errors->get_error_data( $error_code ) );\n\t\t\t}\n\t\t}\n\n\t\tparent::error( $errors, ...$args );\n\t}\n\n\t/**\n\t * Stores a log entry.\n\t *\n\t * @since 4.6.0\n\t * @since 5.3.0 Formalized the existing `...$args` parameter by adding it\n\t *              to the function signature.\n\t *\n\t * @param string|array|WP_Error $data    Log entry data.\n\t * @param mixed                 ...$args Optional text replacements.\n\t */\n\tpublic function feedback( $data, ...$args ) {\n\t\tif ( is_wp_error( $data ) ) {\n\t\t\tforeach ( $data->get_error_codes() as $error_code ) {\n\t\t\t\t$this->errors->add( $error_code, $data->get_error_message( $error_code ), $data->get_error_data( $error_code ) );\n\t\t\t}\n\t\t}\n\n\t\tparent::feedback( $data, ...$args );\n\t}\n}\n", "num_lines": 138}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrade API: WP_Automatic_Updater class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Core class used for handling automatic background updates.\n *\n * @since 3.7.0\n * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php.\n */\nclass WP_Automatic_Updater {\n\n\t/**\n\t * Tracks update results during processing.\n\t *\n\t * @var array\n\t */\n\tprotected $update_results = array();\n\n\t/**\n\t * Whether the entire automatic updater is disabled.\n\t *\n\t * @since 3.7.0\n\t */\n\tpublic function is_disabled() {\n\t\t// Background updates are disabled if you don't want file changes.\n\t\tif ( ! wp_is_file_mod_allowed( 'automatic_updater' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( wp_installing() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// More fine grained control can be done through the WP_AUTO_UPDATE_CORE constant and filters.\n\t\t$disabled = defined( 'AUTOMATIC_UPDATER_DISABLED' ) && AUTOMATIC_UPDATER_DISABLED;\n\n\t\t/**\n\t\t * Filters whether to entirely disable background updates.\n\t\t *\n\t\t * There are more fine-grained filters and controls for selective disabling.\n\t\t * This filter parallels the AUTOMATIC_UPDATER_DISABLED constant in name.\n\t\t *\n\t\t * This also disables update notification emails. That may change in the future.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param bool $disabled Whether the updater should be disabled.\n\t\t */\n\t\treturn apply_filters( 'automatic_updater_disabled', $disabled );\n\t}\n\n\t/**\n\t * Check for version control checkouts.\n\t *\n\t * Checks for Subversion, Git, Mercurial, and Bazaar. It recursively looks up the\n\t * filesystem to the top of the drive, erring on the side of detecting a VCS\n\t * checkout somewhere.\n\t *\n\t * ABSPATH is always checked in addition to whatever $context is (which may be the\n\t * wp-content directory, for example). The underlying assumption is that if you are\n\t * using version control *anywhere*, then you should be making decisions for\n\t * how things get updated.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param string $context The filesystem path to check, in addition to ABSPATH.\n\t */\n\tpublic function is_vcs_checkout( $context ) {\n\t\t$context_dirs = array( untrailingslashit( $context ) );\n\t\tif ( ABSPATH !== $context ) {\n\t\t\t$context_dirs[] = untrailingslashit( ABSPATH );\n\t\t}\n\n\t\t$vcs_dirs   = array( '.svn', '.git', '.hg', '.bzr' );\n\t\t$check_dirs = array();\n\n\t\tforeach ( $context_dirs as $context_dir ) {\n\t\t\t// Walk up from $context_dir to the root.\n\t\t\tdo {\n\t\t\t\t$check_dirs[] = $context_dir;\n\n\t\t\t\t// Once we've hit '/' or 'C:\\', we need to stop. dirname will keep returning the input here.\n\t\t\t\tif ( dirname( $context_dir ) === $context_dir ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Continue one level at a time.\n\t\t\t} while ( $context_dir = dirname( $context_dir ) );\n\t\t}\n\n\t\t$check_dirs = array_unique( $check_dirs );\n\n\t\t// Search all directories we've found for evidence of version control.\n\t\tforeach ( $vcs_dirs as $vcs_dir ) {\n\t\t\tforeach ( $check_dirs as $check_dir ) {\n\t\t\t\t$checkout = @is_dir( rtrim( $check_dir, '\\\\/' ) . \"/$vcs_dir\" );\n\t\t\t\tif ( $checkout ) {\n\t\t\t\t\tbreak 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters whether the automatic updater should consider a filesystem\n\t\t * location to be potentially managed by a version control system.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param bool $checkout  Whether a VCS checkout was discovered at $context\n\t\t *                        or ABSPATH, or anywhere higher.\n\t\t * @param string $context The filesystem context (a path) against which\n\t\t *                        filesystem status should be checked.\n\t\t */\n\t\treturn apply_filters( 'automatic_updates_is_vcs_checkout', $checkout, $context );\n\t}\n\n\t/**\n\t * Tests to see if we can and should update a specific item.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $type    The type of update being checked: 'core', 'theme',\n\t *                        'plugin', 'translation'.\n\t * @param object $item    The update offer.\n\t * @param string $context The filesystem context (a path) against which filesystem\n\t *                        access and status should be checked.\n\t */\n\tpublic function should_update( $type, $item, $context ) {\n\t\t// Used to see if WP_Filesystem is set up to allow unattended updates.\n\t\t$skin = new Automatic_Upgrader_Skin;\n\n\t\tif ( $this->is_disabled() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only relax the filesystem checks when the update doesn't include new files.\n\t\t$allow_relaxed_file_ownership = false;\n\t\tif ( 'core' === $type && isset( $item->new_files ) && ! $item->new_files ) {\n\t\t\t$allow_relaxed_file_ownership = true;\n\t\t}\n\n\t\t// If we can't do an auto core update, we may still be able to email the user.\n\t\tif ( ! $skin->request_filesystem_credentials( false, $context, $allow_relaxed_file_ownership ) || $this->is_vcs_checkout( $context ) ) {\n\t\t\tif ( 'core' === $type ) {\n\t\t\t\t$this->send_core_update_notification_email( $item );\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t// Next up, is this an item we can update?\n\t\tif ( 'core' === $type ) {\n\t\t\t$update = Core_Upgrader::should_update_to_version( $item->current );\n\t\t} elseif ( 'plugin' === $type || 'theme' === $type ) {\n\t\t\t$update = ! empty( $item->autoupdate );\n\n\t\t\tif ( ! $update && wp_is_auto_update_enabled_for_type( $type ) ) {\n\t\t\t\t// Check if the site admin has enabled auto-updates by default for the specific item.\n\t\t\t\t$auto_updates = (array) get_site_option( \"auto_update_{$type}s\", array() );\n\t\t\t\t$update       = in_array( $item->{$type}, $auto_updates, true );\n\t\t\t}\n\t\t} else {\n\t\t\t$update = ! empty( $item->autoupdate );\n\t\t}\n\n\t\t// If the `disable_autoupdate` flag is set, override any user-choice, but allow filters.\n\t\tif ( ! empty( $item->disable_autoupdate ) ) {\n\t\t\t$update = $item->disable_autoupdate;\n\t\t}\n\n\t\t/**\n\t\t * Filters whether to automatically update core, a plugin, a theme, or a language.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$type`, refers to the type of update\n\t\t * being checked. Potential hook names include:\n\t\t *\n\t\t *  - `auto_update_core`\n\t\t *  - `auto_update_plugin`\n\t\t *  - `auto_update_theme`\n\t\t *  - `auto_update_translation`\n\t\t *\n\t\t * Generally speaking, plugins, themes, and major core versions are not updated\n\t\t * by default, while translations and minor and development versions for core\n\t\t * are updated by default.\n\t\t *\n\t\t * See the {@see 'allow_dev_auto_core_updates'}, {@see 'allow_minor_auto_core_updates'},\n\t\t * and {@see 'allow_major_auto_core_updates'} filters for a more straightforward way to\n\t\t * adjust core updates.\n\t\t *\n\t\t * @since 3.7.0\n\t\t * @since 5.5.0 The `$update` parameter accepts the value of null.\n\t\t *\n\t\t * @param bool|null $update Whether to update. The value of null is internally used\n\t\t *                          to detect whether nothing has hooked into this filter.\n\t\t * @param object    $item   The update offer.\n\t\t */\n\t\t$update = apply_filters( \"auto_update_{$type}\", $update, $item );\n\n\t\tif ( ! $update ) {\n\t\t\tif ( 'core' === $type ) {\n\t\t\t\t$this->send_core_update_notification_email( $item );\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t// If it's a core update, are we actually compatible with its requirements?\n\t\tif ( 'core' === $type ) {\n\t\t\tglobal $wpdb;\n\n\t\t\t$php_compat = version_compare( phpversion(), $item->php_version, '>=' );\n\t\t\tif ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) {\n\t\t\t\t$mysql_compat = true;\n\t\t\t} else {\n\t\t\t\t$mysql_compat = version_compare( $wpdb->db_version(), $item->mysql_version, '>=' );\n\t\t\t}\n\n\t\t\tif ( ! $php_compat || ! $mysql_compat ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// If updating a plugin or theme, ensure the minimum PHP version requirements are satisfied.\n\t\tif ( in_array( $type, array( 'plugin', 'theme' ), true ) ) {\n\t\t\tif ( ! empty( $item->requires_php ) && version_compare( phpversion(), $item->requires_php, '<' ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Notifies an administrator of a core update.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param object $item The update offer.\n\t */\n\tprotected function send_core_update_notification_email( $item ) {\n\t\t$notified = get_site_option( 'auto_core_update_notified' );\n\n\t\t// Don't notify if we've already notified the same email address of the same version.\n\t\tif ( $notified && get_site_option( 'admin_email' ) === $notified['email'] && $notified['version'] == $item->current ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// See if we need to notify users of a core update.\n\t\t$notify = ! empty( $item->notify_email );\n\n\t\t/**\n\t\t * Filters whether to notify the site administrator of a new core update.\n\t\t *\n\t\t * By default, administrators are notified when the update offer received\n\t\t * from WordPress.org sets a particular flag. This allows some discretion\n\t\t * in if and when to notify.\n\t\t *\n\t\t * This filter is only evaluated once per release. If the same email address\n\t\t * was already notified of the same new version, WordPress won't repeatedly\n\t\t * email the administrator.\n\t\t *\n\t\t * This filter is also used on about.php to check if a plugin has disabled\n\t\t * these notifications.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param bool   $notify Whether the site administrator is notified.\n\t\t * @param object $item   The update offer.\n\t\t */\n\t\tif ( ! apply_filters( 'send_core_update_notification_email', $notify, $item ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->send_email( 'manual', $item );\n\t\treturn true;\n\t}\n\n\t/**\n\t * Update an item, if appropriate.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param string $type The type of update being checked: 'core', 'theme', 'plugin', 'translation'.\n\t * @param object $item The update offer.\n\t * @return null|WP_Error\n\t */\n\tpublic function update( $type, $item ) {\n\t\t$skin = new Automatic_Upgrader_Skin;\n\n\t\tswitch ( $type ) {\n\t\t\tcase 'core':\n\t\t\t\t// The Core upgrader doesn't use the Upgrader's skin during the actual main part of the upgrade, instead, firing a filter.\n\t\t\t\tadd_filter( 'update_feedback', array( $skin, 'feedback' ) );\n\t\t\t\t$upgrader = new Core_Upgrader( $skin );\n\t\t\t\t$context  = ABSPATH;\n\t\t\t\tbreak;\n\t\t\tcase 'plugin':\n\t\t\t\t$upgrader = new Plugin_Upgrader( $skin );\n\t\t\t\t$context  = WP_PLUGIN_DIR; // We don't support custom Plugin directories, or updates for WPMU_PLUGIN_DIR.\n\t\t\t\tbreak;\n\t\t\tcase 'theme':\n\t\t\t\t$upgrader = new Theme_Upgrader( $skin );\n\t\t\t\t$context  = get_theme_root( $item->theme );\n\t\t\t\tbreak;\n\t\t\tcase 'translation':\n\t\t\t\t$upgrader = new Language_Pack_Upgrader( $skin );\n\t\t\t\t$context  = WP_CONTENT_DIR; // WP_LANG_DIR;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Determine whether we can and should perform this update.\n\t\tif ( ! $this->should_update( $type, $item, $context ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * Fires immediately prior to an auto-update.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string $type    The type of update being checked: 'core', 'theme', 'plugin', or 'translation'.\n\t\t * @param object $item    The update offer.\n\t\t * @param string $context The filesystem context (a path) against which filesystem access and status\n\t\t *                        should be checked.\n\t\t */\n\t\tdo_action( 'pre_auto_update', $type, $item, $context );\n\n\t\t$upgrader_item = $item;\n\t\tswitch ( $type ) {\n\t\t\tcase 'core':\n\t\t\t\t/* translators: %s: WordPress version. */\n\t\t\t\t$skin->feedback( __( 'Updating to WordPress %s' ), $item->version );\n\t\t\t\t/* translators: %s: WordPress version. */\n\t\t\t\t$item_name = sprintf( __( 'WordPress %s' ), $item->version );\n\t\t\t\tbreak;\n\t\t\tcase 'theme':\n\t\t\t\t$upgrader_item = $item->theme;\n\t\t\t\t$theme         = wp_get_theme( $upgrader_item );\n\t\t\t\t$item_name     = $theme->Get( 'Name' );\n\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t$skin->feedback( __( 'Updating theme: %s' ), $item_name );\n\t\t\t\tbreak;\n\t\t\tcase 'plugin':\n\t\t\t\t$upgrader_item = $item->plugin;\n\t\t\t\t$plugin_data   = get_plugin_data( $context . '/' . $upgrader_item );\n\t\t\t\t$item_name     = $plugin_data['Name'];\n\t\t\t\t/* translators: %s: Plugin name. */\n\t\t\t\t$skin->feedback( __( 'Updating plugin: %s' ), $item_name );\n\t\t\t\tbreak;\n\t\t\tcase 'translation':\n\t\t\t\t$language_item_name = $upgrader->get_name_for_update( $item );\n\t\t\t\t/* translators: %s: Project name (plugin, theme, or WordPress). */\n\t\t\t\t$item_name = sprintf( __( 'Translations for %s' ), $language_item_name );\n\t\t\t\t/* translators: 1: Project name (plugin, theme, or WordPress), 2: Language. */\n\t\t\t\t$skin->feedback( sprintf( __( 'Updating translations for %1$s (%2$s)&#8230;' ), $language_item_name, $item->language ) );\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$allow_relaxed_file_ownership = false;\n\t\tif ( 'core' === $type && isset( $item->new_files ) && ! $item->new_files ) {\n\t\t\t$allow_relaxed_file_ownership = true;\n\t\t}\n\n\t\t// Boom, this site's about to get a whole new splash of paint!\n\t\t$upgrade_result = $upgrader->upgrade(\n\t\t\t$upgrader_item,\n\t\t\tarray(\n\t\t\t\t'clear_update_cache'           => false,\n\t\t\t\t// Always use partial builds if possible for core updates.\n\t\t\t\t'pre_check_md5'                => false,\n\t\t\t\t// Only available for core updates.\n\t\t\t\t'attempt_rollback'             => true,\n\t\t\t\t// Allow relaxed file ownership in some scenarios.\n\t\t\t\t'allow_relaxed_file_ownership' => $allow_relaxed_file_ownership,\n\t\t\t)\n\t\t);\n\n\t\t// If the filesystem is unavailable, false is returned.\n\t\tif ( false === $upgrade_result ) {\n\t\t\t$upgrade_result = new WP_Error( 'fs_unavailable', __( 'Could not access filesystem.' ) );\n\t\t}\n\n\t\tif ( 'core' === $type ) {\n\t\t\tif ( is_wp_error( $upgrade_result )\n\t\t\t\t&& ( 'up_to_date' === $upgrade_result->get_error_code()\n\t\t\t\t\t|| 'locked' === $upgrade_result->get_error_code() )\n\t\t\t) {\n\t\t\t\t// These aren't actual errors, treat it as a skipped-update instead\n\t\t\t\t// to avoid triggering the post-core update failure routines.\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Core doesn't output this, so let's append it so we don't get confused.\n\t\t\tif ( is_wp_error( $upgrade_result ) ) {\n\t\t\t\t$skin->error( __( 'Installation failed.' ), $upgrade_result );\n\t\t\t} else {\n\t\t\t\t$skin->feedback( __( 'WordPress updated successfully.' ) );\n\t\t\t}\n\t\t}\n\n\t\t$this->update_results[ $type ][] = (object) array(\n\t\t\t'item'     => $item,\n\t\t\t'result'   => $upgrade_result,\n\t\t\t'name'     => $item_name,\n\t\t\t'messages' => $skin->get_upgrade_messages(),\n\t\t);\n\n\t\treturn $upgrade_result;\n\t}\n\n\t/**\n\t * Kicks off the background update process, looping through all pending updates.\n\t *\n\t * @since 3.7.0\n\t */\n\tpublic function run() {\n\t\tif ( $this->is_disabled() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! is_main_network() || ! is_main_site() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! WP_Upgrader::create_lock( 'auto_updater' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Don't automatically run these things, as we'll handle it ourselves.\n\t\tremove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );\n\t\tremove_action( 'upgrader_process_complete', 'wp_version_check' );\n\t\tremove_action( 'upgrader_process_complete', 'wp_update_plugins' );\n\t\tremove_action( 'upgrader_process_complete', 'wp_update_themes' );\n\n\t\t// Next, plugins.\n\t\twp_update_plugins(); // Check for plugin updates.\n\t\t$plugin_updates = get_site_transient( 'update_plugins' );\n\t\tif ( $plugin_updates && ! empty( $plugin_updates->response ) ) {\n\t\t\tforeach ( $plugin_updates->response as $plugin ) {\n\t\t\t\t$this->update( 'plugin', $plugin );\n\t\t\t}\n\t\t\t// Force refresh of plugin update information.\n\t\t\twp_clean_plugins_cache();\n\t\t}\n\n\t\t// Next, those themes we all love.\n\t\twp_update_themes();  // Check for theme updates.\n\t\t$theme_updates = get_site_transient( 'update_themes' );\n\t\tif ( $theme_updates && ! empty( $theme_updates->response ) ) {\n\t\t\tforeach ( $theme_updates->response as $theme ) {\n\t\t\t\t$this->update( 'theme', (object) $theme );\n\t\t\t}\n\t\t\t// Force refresh of theme update information.\n\t\t\twp_clean_themes_cache();\n\t\t}\n\n\t\t// Next, process any core update.\n\t\twp_version_check(); // Check for core updates.\n\t\t$core_update = find_core_auto_update();\n\n\t\tif ( $core_update ) {\n\t\t\t$this->update( 'core', $core_update );\n\t\t}\n\n\t\t// Clean up, and check for any pending translations.\n\t\t// (Core_Upgrader checks for core updates.)\n\t\t$theme_stats = array();\n\t\tif ( isset( $this->update_results['theme'] ) ) {\n\t\t\tforeach ( $this->update_results['theme'] as $upgrade ) {\n\t\t\t\t$theme_stats[ $upgrade->item->theme ] = ( true === $upgrade->result );\n\t\t\t}\n\t\t}\n\t\twp_update_themes( $theme_stats ); // Check for theme updates.\n\n\t\t$plugin_stats = array();\n\t\tif ( isset( $this->update_results['plugin'] ) ) {\n\t\t\tforeach ( $this->update_results['plugin'] as $upgrade ) {\n\t\t\t\t$plugin_stats[ $upgrade->item->plugin ] = ( true === $upgrade->result );\n\t\t\t}\n\t\t}\n\t\twp_update_plugins( $plugin_stats ); // Check for plugin updates.\n\n\t\t// Finally, process any new translations.\n\t\t$language_updates = wp_get_translation_updates();\n\t\tif ( $language_updates ) {\n\t\t\tforeach ( $language_updates as $update ) {\n\t\t\t\t$this->update( 'translation', $update );\n\t\t\t}\n\n\t\t\t// Clear existing caches.\n\t\t\twp_clean_update_cache();\n\n\t\t\twp_version_check();  // Check for core updates.\n\t\t\twp_update_themes();  // Check for theme updates.\n\t\t\twp_update_plugins(); // Check for plugin updates.\n\t\t}\n\n\t\t// Send debugging email to admin for all development installations.\n\t\tif ( ! empty( $this->update_results ) ) {\n\t\t\t$development_version = false !== strpos( get_bloginfo( 'version' ), '-' );\n\n\t\t\t/**\n\t\t\t * Filters whether to send a debugging email for each automatic background update.\n\t\t\t *\n\t\t\t * @since 3.7.0\n\t\t\t *\n\t\t\t * @param bool $development_version By default, emails are sent if the\n\t\t\t *                                  install is a development version.\n\t\t\t *                                  Return false to avoid the email.\n\t\t\t */\n\t\t\tif ( apply_filters( 'automatic_updates_send_debug_email', $development_version ) ) {\n\t\t\t\t$this->send_debug_email();\n\t\t\t}\n\n\t\t\tif ( ! empty( $this->update_results['core'] ) ) {\n\t\t\t\t$this->after_core_update( $this->update_results['core'][0] );\n\t\t\t} elseif ( ! empty( $this->update_results['plugin'] ) || ! empty( $this->update_results['theme'] ) ) {\n\t\t\t\t$this->after_plugin_theme_update( $this->update_results );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Fires after all automatic updates have run.\n\t\t\t *\n\t\t\t * @since 3.8.0\n\t\t\t *\n\t\t\t * @param array $update_results The results of all attempted updates.\n\t\t\t */\n\t\t\tdo_action( 'automatic_updates_complete', $this->update_results );\n\t\t}\n\n\t\tWP_Upgrader::release_lock( 'auto_updater' );\n\t}\n\n\t/**\n\t * If we tried to perform a core update, check if we should send an email,\n\t * and if we need to avoid processing future updates.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param object $update_result The result of the core update. Includes the update offer and result.\n\t */\n\tprotected function after_core_update( $update_result ) {\n\t\t$wp_version = get_bloginfo( 'version' );\n\n\t\t$core_update = $update_result->item;\n\t\t$result      = $update_result->result;\n\n\t\tif ( ! is_wp_error( $result ) ) {\n\t\t\t$this->send_email( 'success', $core_update );\n\t\t\treturn;\n\t\t}\n\n\t\t$error_code = $result->get_error_code();\n\n\t\t// Any of these WP_Error codes are critical failures, as in they occurred after we started to copy core files.\n\t\t// We should not try to perform a background update again until there is a successful one-click update performed by the user.\n\t\t$critical = false;\n\t\tif ( 'disk_full' === $error_code || false !== strpos( $error_code, '__copy_dir' ) ) {\n\t\t\t$critical = true;\n\t\t} elseif ( 'rollback_was_required' === $error_code && is_wp_error( $result->get_error_data()->rollback ) ) {\n\t\t\t// A rollback is only critical if it failed too.\n\t\t\t$critical        = true;\n\t\t\t$rollback_result = $result->get_error_data()->rollback;\n\t\t} elseif ( false !== strpos( $error_code, 'do_rollback' ) ) {\n\t\t\t$critical = true;\n\t\t}\n\n\t\tif ( $critical ) {\n\t\t\t$critical_data = array(\n\t\t\t\t'attempted'  => $core_update->current,\n\t\t\t\t'current'    => $wp_version,\n\t\t\t\t'error_code' => $error_code,\n\t\t\t\t'error_data' => $result->get_error_data(),\n\t\t\t\t'timestamp'  => time(),\n\t\t\t\t'critical'   => true,\n\t\t\t);\n\t\t\tif ( isset( $rollback_result ) ) {\n\t\t\t\t$critical_data['rollback_code'] = $rollback_result->get_error_code();\n\t\t\t\t$critical_data['rollback_data'] = $rollback_result->get_error_data();\n\t\t\t}\n\t\t\tupdate_site_option( 'auto_core_update_failed', $critical_data );\n\t\t\t$this->send_email( 'critical', $core_update, $result );\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Any other WP_Error code (like download_failed or files_not_writable) occurs before\n\t\t * we tried to copy over core files. Thus, the failures are early and graceful.\n\t\t *\n\t\t * We should avoid trying to perform a background update again for the same version.\n\t\t * But we can try again if another version is released.\n\t\t *\n\t\t * For certain 'transient' failures, like download_failed, we should allow retries.\n\t\t * In fact, let's schedule a special update for an hour from now. (It's possible\n\t\t * the issue could actually be on WordPress.org's side.) If that one fails, then email.\n\t\t */\n\t\t$send               = true;\n\t\t$transient_failures = array( 'incompatible_archive', 'download_failed', 'insane_distro', 'locked' );\n\t\tif ( in_array( $error_code, $transient_failures, true ) && ! get_site_option( 'auto_core_update_failed' ) ) {\n\t\t\twp_schedule_single_event( time() + HOUR_IN_SECONDS, 'wp_maybe_auto_update' );\n\t\t\t$send = false;\n\t\t}\n\n\t\t$n = get_site_option( 'auto_core_update_notified' );\n\t\t// Don't notify if we've already notified the same email address of the same version of the same notification type.\n\t\tif ( $n && 'fail' === $n['type'] && get_site_option( 'admin_email' ) === $n['email'] && $n['version'] == $core_update->current ) {\n\t\t\t$send = false;\n\t\t}\n\n\t\tupdate_site_option(\n\t\t\t'auto_core_update_failed',\n\t\t\tarray(\n\t\t\t\t'attempted'  => $core_update->current,\n\t\t\t\t'current'    => $wp_version,\n\t\t\t\t'error_code' => $error_code,\n\t\t\t\t'error_data' => $result->get_error_data(),\n\t\t\t\t'timestamp'  => time(),\n\t\t\t\t'retry'      => in_array( $error_code, $transient_failures, true ),\n\t\t\t)\n\t\t);\n\n\t\tif ( $send ) {\n\t\t\t$this->send_email( 'fail', $core_update, $result );\n\t\t}\n\t}\n\n\t/**\n\t * Sends an email upon the completion or failure of a background core update.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param string $type        The type of email to send. Can be one of 'success', 'fail', 'manual', 'critical'.\n\t * @param object $core_update The update offer that was attempted.\n\t * @param mixed  $result      Optional. The result for the core update. Can be WP_Error.\n\t */\n\tprotected function send_email( $type, $core_update, $result = null ) {\n\t\tupdate_site_option(\n\t\t\t'auto_core_update_notified',\n\t\t\tarray(\n\t\t\t\t'type'      => $type,\n\t\t\t\t'email'     => get_site_option( 'admin_email' ),\n\t\t\t\t'version'   => $core_update->current,\n\t\t\t\t'timestamp' => time(),\n\t\t\t)\n\t\t);\n\n\t\t$next_user_core_update = get_preferred_from_update_core();\n\n\t\t// If the update transient is empty, use the update we just performed.\n\t\tif ( ! $next_user_core_update ) {\n\t\t\t$next_user_core_update = $core_update;\n\t\t}\n\n\t\t$newer_version_available = ( 'upgrade' === $next_user_core_update->response && version_compare( $next_user_core_update->version, $core_update->version, '>' ) );\n\n\t\t/**\n\t\t * Filters whether to send an email following an automatic background core update.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param bool   $send        Whether to send the email. Default true.\n\t\t * @param string $type        The type of email to send. Can be one of\n\t\t *                            'success', 'fail', 'critical'.\n\t\t * @param object $core_update The update offer that was attempted.\n\t\t * @param mixed  $result      The result for the core update. Can be WP_Error.\n\t\t */\n\t\tif ( 'manual' !== $type && ! apply_filters( 'auto_core_update_send_email', true, $type, $core_update, $result ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ( $type ) {\n\t\t\tcase 'success': // We updated.\n\t\t\t\t/* translators: Site updated notification email subject. 1: Site title, 2: WordPress version. */\n\t\t\t\t$subject = __( '[%1$s] Your site has updated to WordPress %2$s' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'fail':   // We tried to update but couldn't.\n\t\t\tcase 'manual': // We can't update (and made no attempt).\n\t\t\t\t/* translators: Update available notification email subject. 1: Site title, 2: WordPress version. */\n\t\t\t\t$subject = __( '[%1$s] WordPress %2$s is available. Please update!' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'critical': // We tried to update, started to copy files, then things went wrong.\n\t\t\t\t/* translators: Site down notification email subject. 1: Site title. */\n\t\t\t\t$subject = __( '[%1$s] URGENT: Your site may be down due to a failed update' );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\t// If the auto-update is not to the latest version, say that the current version of WP is available instead.\n\t\t$version = 'success' === $type ? $core_update->current : $next_user_core_update->current;\n\t\t$subject = sprintf( $subject, wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), $version );\n\n\t\t$body = '';\n\n\t\tswitch ( $type ) {\n\t\t\tcase 'success':\n\t\t\t\t$body .= sprintf(\n\t\t\t\t\t/* translators: 1: Home URL, 2: WordPress version. */\n\t\t\t\t\t__( 'Howdy! Your site at %1$s has been updated automatically to WordPress %2$s.' ),\n\t\t\t\t\thome_url(),\n\t\t\t\t\t$core_update->current\n\t\t\t\t);\n\t\t\t\t$body .= \"\\n\\n\";\n\t\t\t\tif ( ! $newer_version_available ) {\n\t\t\t\t\t$body .= __( 'No further action is needed on your part.' ) . ' ';\n\t\t\t\t}\n\n\t\t\t\t// Can only reference the About screen if their update was successful.\n\t\t\t\tlist( $about_version ) = explode( '-', $core_update->current, 2 );\n\t\t\t\t/* translators: %s: WordPress version. */\n\t\t\t\t$body .= sprintf( __( 'For more on version %s, see the About WordPress screen:' ), $about_version );\n\t\t\t\t$body .= \"\\n\" . admin_url( 'about.php' );\n\n\t\t\t\tif ( $newer_version_available ) {\n\t\t\t\t\t/* translators: %s: WordPress latest version. */\n\t\t\t\t\t$body .= \"\\n\\n\" . sprintf( __( 'WordPress %s is also now available.' ), $next_user_core_update->current ) . ' ';\n\t\t\t\t\t$body .= __( 'Updating is easy and only takes a few moments:' );\n\t\t\t\t\t$body .= \"\\n\" . network_admin_url( 'update-core.php' );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'fail':\n\t\t\tcase 'manual':\n\t\t\t\t$body .= sprintf(\n\t\t\t\t\t/* translators: 1: Home URL, 2: WordPress version. */\n\t\t\t\t\t__( 'Please update your site at %1$s to WordPress %2$s.' ),\n\t\t\t\t\thome_url(),\n\t\t\t\t\t$next_user_core_update->current\n\t\t\t\t);\n\n\t\t\t\t$body .= \"\\n\\n\";\n\n\t\t\t\t// Don't show this message if there is a newer version available.\n\t\t\t\t// Potential for confusion, and also not useful for them to know at this point.\n\t\t\t\tif ( 'fail' === $type && ! $newer_version_available ) {\n\t\t\t\t\t$body .= __( 'We tried but were unable to update your site automatically.' ) . ' ';\n\t\t\t\t}\n\n\t\t\t\t$body .= __( 'Updating is easy and only takes a few moments:' );\n\t\t\t\t$body .= \"\\n\" . network_admin_url( 'update-core.php' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'critical':\n\t\t\t\tif ( $newer_version_available ) {\n\t\t\t\t\t$body .= sprintf(\n\t\t\t\t\t\t/* translators: 1: Home URL, 2: WordPress version. */\n\t\t\t\t\t\t__( 'Your site at %1$s experienced a critical failure while trying to update WordPress to version %2$s.' ),\n\t\t\t\t\t\thome_url(),\n\t\t\t\t\t\t$core_update->current\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$body .= sprintf(\n\t\t\t\t\t\t/* translators: 1: Home URL, 2: WordPress latest version. */\n\t\t\t\t\t\t__( 'Your site at %1$s experienced a critical failure while trying to update to the latest version of WordPress, %2$s.' ),\n\t\t\t\t\t\thome_url(),\n\t\t\t\t\t\t$core_update->current\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$body .= \"\\n\\n\" . __( \"This means your site may be offline or broken. Don't panic; this can be fixed.\" );\n\n\t\t\t\t$body .= \"\\n\\n\" . __( \"Please check out your site now. It's possible that everything is working. If it says you need to update, you should do so:\" );\n\t\t\t\t$body .= \"\\n\" . network_admin_url( 'update-core.php' );\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$critical_support = 'critical' === $type && ! empty( $core_update->support_email );\n\t\tif ( $critical_support ) {\n\t\t\t// Support offer if available.\n\t\t\t$body .= \"\\n\\n\" . sprintf(\n\t\t\t\t/* translators: %s: Support email address. */\n\t\t\t\t__( 'The WordPress team is willing to help you. Forward this email to %s and the team will work with you to make sure your site is working.' ),\n\t\t\t\t$core_update->support_email\n\t\t\t);\n\t\t} else {\n\t\t\t// Add a note about the support forums.\n\t\t\t$body .= \"\\n\\n\" . __( 'If you experience any issues or need support, the volunteers in the WordPress.org support forums may be able to help.' );\n\t\t\t$body .= \"\\n\" . __( 'https://wordpress.org/support/forums/' );\n\t\t}\n\n\t\t// Updates are important!\n\t\tif ( 'success' !== $type || $newer_version_available ) {\n\t\t\t$body .= \"\\n\\n\" . __( 'Keeping your site updated is important for security. It also makes the internet a safer place for you and your readers.' );\n\t\t}\n\n\t\tif ( $critical_support ) {\n\t\t\t$body .= ' ' . __( \"If you reach out to us, we'll also ensure you'll never have this problem again.\" );\n\t\t}\n\n\t\t// If things are successful and we're now on the latest, mention plugins and themes if any are out of date.\n\t\tif ( 'success' === $type && ! $newer_version_available && ( get_plugin_updates() || get_theme_updates() ) ) {\n\t\t\t$body .= \"\\n\\n\" . __( 'You also have some plugins or themes with updates available. Update them now:' );\n\t\t\t$body .= \"\\n\" . network_admin_url();\n\t\t}\n\n\t\t$body .= \"\\n\\n\" . __( 'The WordPress Team' ) . \"\\n\";\n\n\t\tif ( 'critical' === $type && is_wp_error( $result ) ) {\n\t\t\t$body .= \"\\n***\\n\\n\";\n\t\t\t/* translators: %s: WordPress version. */\n\t\t\t$body .= sprintf( __( 'Your site was running version %s.' ), get_bloginfo( 'version' ) );\n\t\t\t$body .= ' ' . __( 'We have some data that describes the error your site encountered.' );\n\t\t\t$body .= ' ' . __( 'Your hosting company, support forum volunteers, or a friendly developer may be able to use this information to help you:' );\n\n\t\t\t// If we had a rollback and we're still critical, then the rollback failed too.\n\t\t\t// Loop through all errors (the main WP_Error, the update result, the rollback result) for code, data, etc.\n\t\t\tif ( 'rollback_was_required' === $result->get_error_code() ) {\n\t\t\t\t$errors = array( $result, $result->get_error_data()->update, $result->get_error_data()->rollback );\n\t\t\t} else {\n\t\t\t\t$errors = array( $result );\n\t\t\t}\n\n\t\t\tforeach ( $errors as $error ) {\n\t\t\t\tif ( ! is_wp_error( $error ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$error_code = $error->get_error_code();\n\t\t\t\t/* translators: %s: Error code. */\n\t\t\t\t$body .= \"\\n\\n\" . sprintf( __( 'Error code: %s' ), $error_code );\n\n\t\t\t\tif ( 'rollback_was_required' === $error_code ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( $error->get_error_message() ) {\n\t\t\t\t\t$body .= \"\\n\" . $error->get_error_message();\n\t\t\t\t}\n\n\t\t\t\t$error_data = $error->get_error_data();\n\t\t\t\tif ( $error_data ) {\n\t\t\t\t\t$body .= \"\\n\" . implode( ', ', (array) $error_data );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$body .= \"\\n\";\n\t\t}\n\n\t\t$to      = get_site_option( 'admin_email' );\n\t\t$headers = '';\n\n\t\t$email = compact( 'to', 'subject', 'body', 'headers' );\n\n\t\t/**\n\t\t * Filters the email sent following an automatic background core update.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param array $email {\n\t\t *     Array of email arguments that will be passed to wp_mail().\n\t\t *\n\t\t *     @type string $to      The email recipient. An array of emails\n\t\t *                            can be returned, as handled by wp_mail().\n\t\t *     @type string $subject The email's subject.\n\t\t *     @type string $body    The email message body.\n\t\t *     @type string $headers Any email headers, defaults to no headers.\n\t\t * }\n\t\t * @param string $type        The type of email being sent. Can be one of\n\t\t *                            'success', 'fail', 'manual', 'critical'.\n\t\t * @param object $core_update The update offer that was attempted.\n\t\t * @param mixed  $result      The result for the core update. Can be WP_Error.\n\t\t */\n\t\t$email = apply_filters( 'auto_core_update_email', $email, $type, $core_update, $result );\n\n\t\twp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] );\n\t}\n\n\n\t/**\n\t * If we tried to perform plugin or theme updates, check if we should send an email.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param array $update_results The results of update tasks.\n\t */\n\tprotected function after_plugin_theme_update( $update_results ) {\n\t\t$successful_updates = array();\n\t\t$failed_updates     = array();\n\n\t\tif ( ! empty( $update_results['plugin'] ) ) {\n\t\t\t/**\n\t\t\t * Filters whether to send an email following an automatic background plugin update.\n\t\t\t *\n\t\t\t * @since 5.5.0\n\t\t\t * @since 5.5.1 Added the `$update_results` parameter.\n\t\t\t *\n\t\t\t * @param bool  $enabled        True if plugin update notifications are enabled, false otherwise.\n\t\t\t * @param array $update_results The results of plugins update tasks.\n\t\t\t */\n\t\t\t$notifications_enabled = apply_filters( 'auto_plugin_update_send_email', true, $update_results['plugin'] );\n\n\t\t\tif ( $notifications_enabled ) {\n\t\t\t\tforeach ( $update_results['plugin'] as $update_result ) {\n\t\t\t\t\tif ( true === $update_result->result ) {\n\t\t\t\t\t\t$successful_updates['plugin'][] = $update_result;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$failed_updates['plugin'][] = $update_result;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $update_results['theme'] ) ) {\n\t\t\t/**\n\t\t\t * Filters whether to send an email following an automatic background theme update.\n\t\t\t *\n\t\t\t * @since 5.5.0\n\t\t\t * @since 5.5.1 Added the `$update_results` parameter.\n\t\t\t *\n\t\t\t * @param bool  $enabled        True if theme update notifications are enabled, false otherwise.\n\t\t\t * @param array $update_results The results of theme update tasks.\n\t\t\t */\n\t\t\t$notifications_enabled = apply_filters( 'auto_theme_update_send_email', true, $update_results['theme'] );\n\n\t\t\tif ( $notifications_enabled ) {\n\t\t\t\tforeach ( $update_results['theme'] as $update_result ) {\n\t\t\t\t\tif ( true === $update_result->result ) {\n\t\t\t\t\t\t$successful_updates['theme'][] = $update_result;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$failed_updates['theme'][] = $update_result;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $successful_updates ) && empty( $failed_updates ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( empty( $failed_updates ) ) {\n\t\t\t$this->send_plugin_theme_email( 'success', $successful_updates, $failed_updates );\n\t\t} elseif ( empty( $successful_updates ) ) {\n\t\t\t$this->send_plugin_theme_email( 'fail', $successful_updates, $failed_updates );\n\t\t} else {\n\t\t\t$this->send_plugin_theme_email( 'mixed', $successful_updates, $failed_updates );\n\t\t}\n\t}\n\n\t/**\n\t * Sends an email upon the completion or failure of a plugin or theme background update.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $type               The type of email to send. Can be one of 'success', 'fail', 'mixed'.\n\t * @param array  $successful_updates A list of updates that succeeded.\n\t * @param array  $failed_updates     A list of updates that failed.\n\t */\n\tprotected function send_plugin_theme_email( $type, $successful_updates, $failed_updates ) {\n\t\t// No updates were attempted.\n\t\tif ( empty( $successful_updates ) && empty( $failed_updates ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$unique_failures     = false;\n\t\t$past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() );\n\n\t\t/*\n\t\t * When only failures have occurred, an email should only be sent if there are unique failures.\n\t\t * A failure is considered unique if an email has not been sent for an update attempt failure\n\t\t * to a plugin or theme with the same new_version.\n\t\t */\n\t\tif ( 'fail' === $type ) {\n\t\t\tforeach ( $failed_updates as $update_type => $failures ) {\n\t\t\t\tforeach ( $failures as $failed_update ) {\n\t\t\t\t\tif ( ! isset( $past_failure_emails[ $failed_update->item->{$update_type} ] ) ) {\n\t\t\t\t\t\t$unique_failures = true;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check that the failure represents a new failure based on the new_version.\n\t\t\t\t\tif ( version_compare( $past_failure_emails[ $failed_update->item->{$update_type} ], $failed_update->item->new_version, '<' ) ) {\n\t\t\t\t\t\t$unique_failures = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! $unique_failures ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$body               = array();\n\t\t$successful_plugins = ( ! empty( $successful_updates['plugin'] ) );\n\t\t$successful_themes  = ( ! empty( $successful_updates['theme'] ) );\n\t\t$failed_plugins     = ( ! empty( $failed_updates['plugin'] ) );\n\t\t$failed_themes      = ( ! empty( $failed_updates['theme'] ) );\n\n\t\tswitch ( $type ) {\n\t\t\tcase 'success':\n\t\t\t\tif ( $successful_plugins && $successful_themes ) {\n\t\t\t\t\t/* translators: %s: Site title. */\n\t\t\t\t\t$subject = __( '[%s] Some plugins and themes have automatically updated' );\n\t\t\t\t\t$body[]  = sprintf(\n\t\t\t\t\t\t/* translators: %s: Home URL. */\n\t\t\t\t\t\t__( 'Howdy! Some plugins and themes have automatically updated to their latest versions on your site at %s. No further action is needed on your part.' ),\n\t\t\t\t\t\thome_url()\n\t\t\t\t\t);\n\t\t\t\t} elseif ( $successful_plugins ) {\n\t\t\t\t\t/* translators: %s: Site title. */\n\t\t\t\t\t$subject = __( '[%s] Some plugins were automatically updated' );\n\t\t\t\t\t$body[]  = sprintf(\n\t\t\t\t\t\t/* translators: %s: Home URL. */\n\t\t\t\t\t\t__( 'Howdy! Some plugins have automatically updated to their latest versions on your site at %s. No further action is needed on your part.' ),\n\t\t\t\t\t\thome_url()\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t/* translators: %s: Site title. */\n\t\t\t\t\t$subject = __( '[%s] Some themes were automatically updated' );\n\t\t\t\t\t$body[]  = sprintf(\n\t\t\t\t\t\t/* translators: %s: Home URL. */\n\t\t\t\t\t\t__( 'Howdy! Some themes have automatically updated to their latest versions on your site at %s. No further action is needed on your part.' ),\n\t\t\t\t\t\thome_url()\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 'fail':\n\t\t\tcase 'mixed':\n\t\t\t\tif ( $failed_plugins && $failed_themes ) {\n\t\t\t\t\t/* translators: %s: Site title. */\n\t\t\t\t\t$subject = __( '[%s] Some plugins and themes have failed to update' );\n\t\t\t\t\t$body[]  = sprintf(\n\t\t\t\t\t\t/* translators: %s: Home URL. */\n\t\t\t\t\t\t__( 'Howdy! Plugins and themes failed to update on your site at %s.' ),\n\t\t\t\t\t\thome_url()\n\t\t\t\t\t);\n\t\t\t\t} elseif ( $failed_plugins ) {\n\t\t\t\t\t/* translators: %s: Site title. */\n\t\t\t\t\t$subject = __( '[%s] Some plugins have failed to update' );\n\t\t\t\t\t$body[]  = sprintf(\n\t\t\t\t\t\t/* translators: %s: Home URL. */\n\t\t\t\t\t\t__( 'Howdy! Plugins failed to update on your site at %s.' ),\n\t\t\t\t\t\thome_url()\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t/* translators: %s: Site title. */\n\t\t\t\t\t$subject = __( '[%s] Some themes have failed to update' );\n\t\t\t\t\t$body[]  = sprintf(\n\t\t\t\t\t\t/* translators: %s: Home URL. */\n\t\t\t\t\t\t__( 'Howdy! Themes failed to update on your site at %s.' ),\n\t\t\t\t\t\thome_url()\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( in_array( $type, array( 'fail', 'mixed' ), true ) ) {\n\t\t\t$body[] = \"\\n\";\n\t\t\t$body[] = __( 'Please check your site now. It\u00e2\u20ac\u2122s possible that everything is working. If there are updates available, you should update.' );\n\t\t\t$body[] = \"\\n\";\n\n\t\t\t// List failed plugin updates.\n\t\t\tif ( ! empty( $failed_updates['plugin'] ) ) {\n\t\t\t\t$body[] = __( 'These plugins failed to update:' );\n\n\t\t\t\tforeach ( $failed_updates['plugin'] as $item ) {\n\t\t\t\t\t$body[] = sprintf(\n\t\t\t\t\t\t/* translators: 1: Plugin name, 2: Version number. */\n\t\t\t\t\t\t__( '- %1$s version %2$s' ),\n\t\t\t\t\t\t$item->name,\n\t\t\t\t\t\t$item->item->new_version\n\t\t\t\t\t);\n\n\t\t\t\t\t$past_failure_emails[ $item->item->plugin ] = $item->item->new_version;\n\t\t\t\t}\n\n\t\t\t\t$body[] = \"\\n\";\n\t\t\t}\n\n\t\t\t// List failed theme updates.\n\t\t\tif ( ! empty( $failed_updates['theme'] ) ) {\n\t\t\t\t$body[] = __( 'These themes failed to update:' );\n\n\t\t\t\tforeach ( $failed_updates['theme'] as $item ) {\n\t\t\t\t\t$body[] = sprintf(\n\t\t\t\t\t\t/* translators: 1: Theme name, 2: Version number. */\n\t\t\t\t\t\t__( '- %1$s version %2$s' ),\n\t\t\t\t\t\t$item->name,\n\t\t\t\t\t\t$item->item->new_version\n\t\t\t\t\t);\n\n\t\t\t\t\t$past_failure_emails[ $item->item->theme ] = $item->item->new_version;\n\t\t\t\t}\n\n\t\t\t\t$body[] = \"\\n\";\n\t\t\t}\n\t\t}\n\n\t\t// List successful updates.\n\t\tif ( in_array( $type, array( 'success', 'mixed' ), true ) ) {\n\t\t\t$body[] = \"\\n\";\n\n\t\t\t// List successful plugin updates.\n\t\t\tif ( ! empty( $successful_updates['plugin'] ) ) {\n\t\t\t\t$body[] = __( 'These plugins are now up to date:' );\n\n\t\t\t\tforeach ( $successful_updates['plugin'] as $item ) {\n\t\t\t\t\t$body[] = sprintf(\n\t\t\t\t\t\t/* translators: 1: Plugin name, 2: Version number. */\n\t\t\t\t\t\t__( '- %1$s version %2$s' ),\n\t\t\t\t\t\t$item->name,\n\t\t\t\t\t\t$item->item->new_version\n\t\t\t\t\t);\n\n\t\t\t\t\tunset( $past_failure_emails[ $item->item->plugin ] );\n\t\t\t\t}\n\n\t\t\t\t$body[] = \"\\n\";\n\t\t\t}\n\n\t\t\t// List successful theme updates.\n\t\t\tif ( ! empty( $successful_updates['theme'] ) ) {\n\t\t\t\t$body[] = __( 'These themes are now up to date:' );\n\n\t\t\t\tforeach ( $successful_updates['theme'] as $item ) {\n\t\t\t\t\t$body[] = sprintf(\n\t\t\t\t\t\t/* translators: 1: Theme name, 2: Version number. */\n\t\t\t\t\t\t__( '- %1$s version %2$s' ),\n\t\t\t\t\t\t$item->name,\n\t\t\t\t\t\t$item->item->new_version\n\t\t\t\t\t);\n\n\t\t\t\t\tunset( $past_failure_emails[ $item->item->theme ] );\n\t\t\t\t}\n\n\t\t\t\t$body[] = \"\\n\";\n\t\t\t}\n\t\t}\n\n\t\tif ( $failed_plugins ) {\n\t\t\t$body[] = sprintf(\n\t\t\t\t/* translators: %s: Plugins screen URL. */\n\t\t\t\t__( 'To manage plugins on your site, visit the Plugins page: %s' ),\n\t\t\t\tadmin_url( 'plugins.php' )\n\t\t\t);\n\t\t\t$body[] = \"\\n\";\n\t\t}\n\n\t\tif ( $failed_themes ) {\n\t\t\t$body[] = sprintf(\n\t\t\t\t/* translators: %s: Themes screen URL. */\n\t\t\t\t__( 'To manage themes on your site, visit the Themes page: %s' ),\n\t\t\t\tadmin_url( 'themes.php' )\n\t\t\t);\n\t\t\t$body[] = \"\\n\";\n\t\t}\n\n\t\t// Add a note about the support forums.\n\t\t$body[] = __( 'If you experience any issues or need support, the volunteers in the WordPress.org support forums may be able to help.' );\n\t\t$body[] = __( 'https://wordpress.org/support/forums/' );\n\t\t$body[] = \"\\n\" . __( 'The WordPress Team' );\n\n\t\t$body    = implode( \"\\n\", $body );\n\t\t$to      = get_site_option( 'admin_email' );\n\t\t$subject = sprintf( $subject, wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) );\n\t\t$headers = '';\n\n\t\t$email = compact( 'to', 'subject', 'body', 'headers' );\n\n\t\t/**\n\t\t * Filters the email sent following an automatic background update for plugins and themes.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param array  $email {\n\t\t *     Array of email arguments that will be passed to wp_mail().\n\t\t *\n\t\t *     @type string $to      The email recipient. An array of emails\n\t\t *                           can be returned, as handled by wp_mail().\n\t\t *     @type string $subject The email's subject.\n\t\t *     @type string $body    The email message body.\n\t\t *     @type string $headers Any email headers, defaults to no headers.\n\t\t * }\n\t\t * @param string $type               The type of email being sent. Can be one of 'success', 'fail', 'mixed'.\n\t\t * @param array  $successful_updates A list of updates that succeeded.\n\t\t * @param array  $failed_updates     A list of updates that failed.\n\t\t */\n\t\t$email = apply_filters( 'auto_plugin_theme_update_email', $email, $type, $successful_updates, $failed_updates );\n\n\t\t$result = wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] );\n\n\t\tif ( $result ) {\n\t\t\tupdate_option( 'auto_plugin_theme_update_emails', $past_failure_emails );\n\t\t}\n\t}\n\n\t/**\n\t * Prepares and sends an email of a full log of background update results, useful for debugging and geekery.\n\t *\n\t * @since 3.7.0\n\t */\n\tprotected function send_debug_email() {\n\t\t$update_count = 0;\n\t\tforeach ( $this->update_results as $type => $updates ) {\n\t\t\t$update_count += count( $updates );\n\t\t}\n\n\t\t$body     = array();\n\t\t$failures = 0;\n\n\t\t/* translators: %s: Network home URL. */\n\t\t$body[] = sprintf( __( 'WordPress site: %s' ), network_home_url( '/' ) );\n\n\t\t// Core.\n\t\tif ( isset( $this->update_results['core'] ) ) {\n\t\t\t$result = $this->update_results['core'][0];\n\t\t\tif ( $result->result && ! is_wp_error( $result->result ) ) {\n\t\t\t\t/* translators: %s: WordPress version. */\n\t\t\t\t$body[] = sprintf( __( 'SUCCESS: WordPress was successfully updated to %s' ), $result->name );\n\t\t\t} else {\n\t\t\t\t/* translators: %s: WordPress version. */\n\t\t\t\t$body[] = sprintf( __( 'FAILED: WordPress failed to update to %s' ), $result->name );\n\t\t\t\t$failures++;\n\t\t\t}\n\t\t\t$body[] = '';\n\t\t}\n\n\t\t// Plugins, Themes, Translations.\n\t\tforeach ( array( 'plugin', 'theme', 'translation' ) as $type ) {\n\t\t\tif ( ! isset( $this->update_results[ $type ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$success_items = wp_list_filter( $this->update_results[ $type ], array( 'result' => true ) );\n\t\t\tif ( $success_items ) {\n\t\t\t\t$messages = array(\n\t\t\t\t\t'plugin'      => __( 'The following plugins were successfully updated:' ),\n\t\t\t\t\t'theme'       => __( 'The following themes were successfully updated:' ),\n\t\t\t\t\t'translation' => __( 'The following translations were successfully updated:' ),\n\t\t\t\t);\n\n\t\t\t\t$body[] = $messages[ $type ];\n\t\t\t\tforeach ( wp_list_pluck( $success_items, 'name' ) as $name ) {\n\t\t\t\t\t/* translators: %s: Name of plugin / theme / translation. */\n\t\t\t\t\t$body[] = ' * ' . sprintf( __( 'SUCCESS: %s' ), $name );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( $success_items != $this->update_results[ $type ] ) {\n\t\t\t\t// Failed updates.\n\t\t\t\t$messages = array(\n\t\t\t\t\t'plugin'      => __( 'The following plugins failed to update:' ),\n\t\t\t\t\t'theme'       => __( 'The following themes failed to update:' ),\n\t\t\t\t\t'translation' => __( 'The following translations failed to update:' ),\n\t\t\t\t);\n\n\t\t\t\t$body[] = $messages[ $type ];\n\t\t\t\tforeach ( $this->update_results[ $type ] as $item ) {\n\t\t\t\t\tif ( ! $item->result || is_wp_error( $item->result ) ) {\n\t\t\t\t\t\t/* translators: %s: Name of plugin / theme / translation. */\n\t\t\t\t\t\t$body[] = ' * ' . sprintf( __( 'FAILED: %s' ), $item->name );\n\t\t\t\t\t\t$failures++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$body[] = '';\n\t\t}\n\n\t\t$site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );\n\t\tif ( $failures ) {\n\t\t\t$body[] = trim(\n\t\t\t\t__(\n\t\t\t\t\t\"BETA TESTING?\n=============\n\nThis debugging email is sent when you are using a development version of WordPress.\n\nIf you think these failures might be due to a bug in WordPress, could you report it?\n * Open a thread in the support forums: https://wordpress.org/support/forum/alphabeta\n * Or, if you're comfortable writing a bug report: https://core.trac.wordpress.org/\n\nThanks! -- The WordPress Team\"\n\t\t\t\t)\n\t\t\t);\n\t\t\t$body[] = '';\n\n\t\t\t/* translators: Background update failed notification email subject. %s: Site title. */\n\t\t\t$subject = sprintf( __( '[%s] Background Update Failed' ), $site_title );\n\t\t} else {\n\t\t\t/* translators: Background update finished notification email subject. %s: Site title. */\n\t\t\t$subject = sprintf( __( '[%s] Background Update Finished' ), $site_title );\n\t\t}\n\n\t\t$body[] = trim(\n\t\t\t__(\n\t\t\t\t'UPDATE LOG\n=========='\n\t\t\t)\n\t\t);\n\t\t$body[] = '';\n\n\t\tforeach ( array( 'core', 'plugin', 'theme', 'translation' ) as $type ) {\n\t\t\tif ( ! isset( $this->update_results[ $type ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tforeach ( $this->update_results[ $type ] as $update ) {\n\t\t\t\t$body[] = $update->name;\n\t\t\t\t$body[] = str_repeat( '-', strlen( $update->name ) );\n\t\t\t\tforeach ( $update->messages as $message ) {\n\t\t\t\t\t$body[] = '  ' . html_entity_decode( str_replace( '&#8230;', '...', $message ) );\n\t\t\t\t}\n\t\t\t\tif ( is_wp_error( $update->result ) ) {\n\t\t\t\t\t$results = array( 'update' => $update->result );\n\t\t\t\t\t// If we rolled back, we want to know an error that occurred then too.\n\t\t\t\t\tif ( 'rollback_was_required' === $update->result->get_error_code() ) {\n\t\t\t\t\t\t$results = (array) $update->result->get_error_data();\n\t\t\t\t\t}\n\t\t\t\t\tforeach ( $results as $result_type => $result ) {\n\t\t\t\t\t\tif ( ! is_wp_error( $result ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( 'rollback' === $result_type ) {\n\t\t\t\t\t\t\t/* translators: 1: Error code, 2: Error message. */\n\t\t\t\t\t\t\t$body[] = '  ' . sprintf( __( 'Rollback Error: [%1$s] %2$s' ), $result->get_error_code(), $result->get_error_message() );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t/* translators: 1: Error code, 2: Error message. */\n\t\t\t\t\t\t\t$body[] = '  ' . sprintf( __( 'Error: [%1$s] %2$s' ), $result->get_error_code(), $result->get_error_message() );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( $result->get_error_data() ) {\n\t\t\t\t\t\t\t$body[] = '         ' . implode( ', ', (array) $result->get_error_data() );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$body[] = '';\n\t\t\t}\n\t\t}\n\n\t\t$email = array(\n\t\t\t'to'      => get_site_option( 'admin_email' ),\n\t\t\t'subject' => $subject,\n\t\t\t'body'    => implode( \"\\n\", $body ),\n\t\t\t'headers' => '',\n\t\t);\n\n\t\t/**\n\t\t * Filters the debug email that can be sent following an automatic\n\t\t * background core update.\n\t\t *\n\t\t * @since 3.8.0\n\t\t *\n\t\t * @param array $email {\n\t\t *     Array of email arguments that will be passed to wp_mail().\n\t\t *\n\t\t *     @type string $to      The email recipient. An array of emails\n\t\t *                           can be returned, as handled by wp_mail().\n\t\t *     @type string $subject Email subject.\n\t\t *     @type string $body    Email message body.\n\t\t *     @type string $headers Any email headers. Default empty.\n\t\t * }\n\t\t * @param int   $failures The number of failures encountered while upgrading.\n\t\t * @param mixed $results  The results of all attempted updates.\n\t\t */\n\t\t$email = apply_filters( 'automatic_updates_debug_email', $email, $failures, $this->update_results );\n\n\t\twp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] );\n\t}\n}\n", "num_lines": 1369}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_Comments_List_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n/**\n * Core class used to implement displaying comments in a list table.\n *\n * @since 3.1.0\n * @access private\n *\n * @see WP_List_Table\n */\nclass WP_Comments_List_Table extends WP_List_Table {\n\n\tpublic $checkbox = true;\n\n\tpublic $pending_count = array();\n\n\tpublic $extra_items;\n\n\tprivate $user_can;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @see WP_List_Table::__construct() for more information on default arguments.\n\t *\n\t * @global int $post_id\n\t *\n\t * @param array $args An associative array of arguments.\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\tglobal $post_id;\n\n\t\t$post_id = isset( $_REQUEST['p'] ) ? absint( $_REQUEST['p'] ) : 0;\n\n\t\tif ( get_option( 'show_avatars' ) ) {\n\t\t\tadd_filter( 'comment_author', array( $this, 'floated_admin_avatar' ), 10, 2 );\n\t\t}\n\n\t\tparent::__construct(\n\t\t\tarray(\n\t\t\t\t'plural'   => 'comments',\n\t\t\t\t'singular' => 'comment',\n\t\t\t\t'ajax'     => true,\n\t\t\t\t'screen'   => isset( $args['screen'] ) ? $args['screen'] : null,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Adds avatars to comment author names.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $name       Comment author name.\n\t * @param int    $comment_ID Comment ID.\n\t * @return string Avatar with the user name.\n\t */\n\tpublic function floated_admin_avatar( $name, $comment_ID ) {\n\t\t$comment = get_comment( $comment_ID );\n\t\t$avatar  = get_avatar( $comment, 32, 'mystery' );\n\t\treturn \"$avatar $name\";\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function ajax_user_can() {\n\t\treturn current_user_can( 'edit_posts' );\n\t}\n\n\t/**\n\t * @global string $mode           List table view mode.\n\t * @global int    $post_id\n\t * @global string $comment_status\n\t * @global string $comment_type\n\t * @global string $search\n\t */\n\tpublic function prepare_items() {\n\t\tglobal $mode, $post_id, $comment_status, $comment_type, $search;\n\n\t\tif ( ! empty( $_REQUEST['mode'] ) ) {\n\t\t\t$mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list';\n\t\t\tset_user_setting( 'posts_list_mode', $mode );\n\t\t} else {\n\t\t\t$mode = get_user_setting( 'posts_list_mode', 'list' );\n\t\t}\n\n\t\t$comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';\n\t\tif ( ! in_array( $comment_status, array( 'all', 'mine', 'moderated', 'approved', 'spam', 'trash' ), true ) ) {\n\t\t\t$comment_status = 'all';\n\t\t}\n\n\t\t$comment_type = ! empty( $_REQUEST['comment_type'] ) ? $_REQUEST['comment_type'] : '';\n\n\t\t$search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : '';\n\n\t\t$post_type = ( isset( $_REQUEST['post_type'] ) ) ? sanitize_key( $_REQUEST['post_type'] ) : '';\n\n\t\t$user_id = ( isset( $_REQUEST['user_id'] ) ) ? $_REQUEST['user_id'] : '';\n\n\t\t$orderby = ( isset( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : '';\n\t\t$order   = ( isset( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : '';\n\n\t\t$comments_per_page = $this->get_per_page( $comment_status );\n\n\t\t$doing_ajax = wp_doing_ajax();\n\n\t\tif ( isset( $_REQUEST['number'] ) ) {\n\t\t\t$number = (int) $_REQUEST['number'];\n\t\t} else {\n\t\t\t$number = $comments_per_page + min( 8, $comments_per_page ); // Grab a few extra.\n\t\t}\n\n\t\t$page = $this->get_pagenum();\n\n\t\tif ( isset( $_REQUEST['start'] ) ) {\n\t\t\t$start = $_REQUEST['start'];\n\t\t} else {\n\t\t\t$start = ( $page - 1 ) * $comments_per_page;\n\t\t}\n\n\t\tif ( $doing_ajax && isset( $_REQUEST['offset'] ) ) {\n\t\t\t$start += $_REQUEST['offset'];\n\t\t}\n\n\t\t$status_map = array(\n\t\t\t'mine'      => '',\n\t\t\t'moderated' => 'hold',\n\t\t\t'approved'  => 'approve',\n\t\t\t'all'       => '',\n\t\t);\n\n\t\t$args = array(\n\t\t\t'status'    => isset( $status_map[ $comment_status ] ) ? $status_map[ $comment_status ] : $comment_status,\n\t\t\t'search'    => $search,\n\t\t\t'user_id'   => $user_id,\n\t\t\t'offset'    => $start,\n\t\t\t'number'    => $number,\n\t\t\t'post_id'   => $post_id,\n\t\t\t'type'      => $comment_type,\n\t\t\t'orderby'   => $orderby,\n\t\t\t'order'     => $order,\n\t\t\t'post_type' => $post_type,\n\t\t);\n\n\t\t/**\n\t\t * Filters the arguments for the comment query in the comments list table.\n\t\t *\n\t\t * @since 5.1.0\n\t\t *\n\t\t * @param array $args An array of get_comments() arguments.\n\t\t */\n\t\t$args = apply_filters( 'comments_list_table_query_args', $args );\n\n\t\t$_comments = get_comments( $args );\n\t\tif ( is_array( $_comments ) ) {\n\t\t\tupdate_comment_cache( $_comments );\n\n\t\t\t$this->items       = array_slice( $_comments, 0, $comments_per_page );\n\t\t\t$this->extra_items = array_slice( $_comments, $comments_per_page );\n\n\t\t\t$_comment_post_ids = array_unique( wp_list_pluck( $_comments, 'comment_post_ID' ) );\n\n\t\t\t$this->pending_count = get_pending_comments_num( $_comment_post_ids );\n\t\t}\n\n\t\t$total_comments = get_comments(\n\t\t\tarray_merge(\n\t\t\t\t$args,\n\t\t\t\tarray(\n\t\t\t\t\t'count'  => true,\n\t\t\t\t\t'offset' => 0,\n\t\t\t\t\t'number' => 0,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items' => $total_comments,\n\t\t\t\t'per_page'    => $comments_per_page,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * @param string $comment_status\n\t * @return int\n\t */\n\tpublic function get_per_page( $comment_status = 'all' ) {\n\t\t$comments_per_page = $this->get_items_per_page( 'edit_comments_per_page' );\n\t\t/**\n\t\t * Filters the number of comments listed per page in the comments list table.\n\t\t *\n\t\t * @since 2.6.0\n\t\t *\n\t\t * @param int    $comments_per_page The number of comments to list per page.\n\t\t * @param string $comment_status    The comment status name. Default 'All'.\n\t\t */\n\t\treturn apply_filters( 'comments_per_page', $comments_per_page, $comment_status );\n\t}\n\n\t/**\n\t * @global string $comment_status\n\t */\n\tpublic function no_items() {\n\t\tglobal $comment_status;\n\n\t\tif ( 'moderated' === $comment_status ) {\n\t\t\t_e( 'No comments awaiting moderation.' );\n\t\t} elseif ( 'trash' === $comment_status ) {\n\t\t\t_e( 'No comments found in Trash.' );\n\t\t} else {\n\t\t\t_e( 'No comments found.' );\n\t\t}\n\t}\n\n\t/**\n\t * @global int $post_id\n\t * @global string $comment_status\n\t * @global string $comment_type\n\t */\n\tprotected function get_views() {\n\t\tglobal $post_id, $comment_status, $comment_type;\n\n\t\t$status_links = array();\n\t\t$num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments();\n\n\t\t$stati = array(\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t'all'       => _nx_noop(\n\t\t\t\t'All <span class=\"count\">(%s)</span>',\n\t\t\t\t'All <span class=\"count\">(%s)</span>',\n\t\t\t\t'comments'\n\t\t\t), // Singular not used.\n\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t'mine'      => _nx_noop(\n\t\t\t\t'Mine <span class=\"count\">(%s)</span>',\n\t\t\t\t'Mine <span class=\"count\">(%s)</span>',\n\t\t\t\t'comments'\n\t\t\t),\n\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t'moderated' => _nx_noop(\n\t\t\t\t'Pending <span class=\"count\">(%s)</span>',\n\t\t\t\t'Pending <span class=\"count\">(%s)</span>',\n\t\t\t\t'comments'\n\t\t\t),\n\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t'approved'  => _nx_noop(\n\t\t\t\t'Approved <span class=\"count\">(%s)</span>',\n\t\t\t\t'Approved <span class=\"count\">(%s)</span>',\n\t\t\t\t'comments'\n\t\t\t),\n\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t'spam'      => _nx_noop(\n\t\t\t\t'Spam <span class=\"count\">(%s)</span>',\n\t\t\t\t'Spam <span class=\"count\">(%s)</span>',\n\t\t\t\t'comments'\n\t\t\t),\n\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t'trash'     => _nx_noop(\n\t\t\t\t'Trash <span class=\"count\">(%s)</span>',\n\t\t\t\t'Trash <span class=\"count\">(%s)</span>',\n\t\t\t\t'comments'\n\t\t\t),\n\t\t);\n\n\t\tif ( ! EMPTY_TRASH_DAYS ) {\n\t\t\tunset( $stati['trash'] );\n\t\t}\n\n\t\t$link = admin_url( 'edit-comments.php' );\n\t\tif ( ! empty( $comment_type ) && 'all' !== $comment_type ) {\n\t\t\t$link = add_query_arg( 'comment_type', $comment_type, $link );\n\t\t}\n\n\t\tforeach ( $stati as $status => $label ) {\n\t\t\t$current_link_attributes = '';\n\n\t\t\tif ( $status === $comment_status ) {\n\t\t\t\t$current_link_attributes = ' class=\"current\" aria-current=\"page\"';\n\t\t\t}\n\n\t\t\tif ( 'mine' === $status ) {\n\t\t\t\t$current_user_id    = get_current_user_id();\n\t\t\t\t$num_comments->mine = get_comments(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_id' => $post_id ? $post_id : 0,\n\t\t\t\t\t\t'user_id' => $current_user_id,\n\t\t\t\t\t\t'count'   => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$link               = add_query_arg( 'user_id', $current_user_id, $link );\n\t\t\t} else {\n\t\t\t\t$link = remove_query_arg( 'user_id', $link );\n\t\t\t}\n\n\t\t\tif ( ! isset( $num_comments->$status ) ) {\n\t\t\t\t$num_comments->$status = 10;\n\t\t\t}\n\t\t\t$link = add_query_arg( 'comment_status', $status, $link );\n\t\t\tif ( $post_id ) {\n\t\t\t\t$link = add_query_arg( 'p', absint( $post_id ), $link );\n\t\t\t}\n\t\t\t/*\n\t\t\t// I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark\n\t\t\tif ( !empty( $_REQUEST['s'] ) )\n\t\t\t\t$link = add_query_arg( 's', esc_attr( wp_unslash( $_REQUEST['s'] ) ), $link );\n\t\t\t*/\n\t\t\t$status_links[ $status ] = \"<a href='$link'$current_link_attributes>\" . sprintf(\n\t\t\t\ttranslate_nooped_plural( $label, $num_comments->$status ),\n\t\t\t\tsprintf(\n\t\t\t\t\t'<span class=\"%s-count\">%s</span>',\n\t\t\t\t\t( 'moderated' === $status ) ? 'pending' : $status,\n\t\t\t\t\tnumber_format_i18n( $num_comments->$status )\n\t\t\t\t)\n\t\t\t) . '</a>';\n\t\t}\n\n\t\t/**\n\t\t * Filters the comment status links.\n\t\t *\n\t\t * @since 2.5.0\n\t\t * @since 5.1.0 The 'Mine' link was added.\n\t\t *\n\t\t * @param string[] $status_links An associative array of fully-formed comment status links. Includes 'All', 'Mine',\n\t\t *                              'Pending', 'Approved', 'Spam', and 'Trash'.\n\t\t */\n\t\treturn apply_filters( 'comment_status_links', $status_links );\n\t}\n\n\t/**\n\t * @global string $comment_status\n\t *\n\t * @return array\n\t */\n\tprotected function get_bulk_actions() {\n\t\tglobal $comment_status;\n\n\t\t$actions = array();\n\t\tif ( in_array( $comment_status, array( 'all', 'approved' ), true ) ) {\n\t\t\t$actions['unapprove'] = __( 'Unapprove' );\n\t\t}\n\t\tif ( in_array( $comment_status, array( 'all', 'moderated' ), true ) ) {\n\t\t\t$actions['approve'] = __( 'Approve' );\n\t\t}\n\t\tif ( in_array( $comment_status, array( 'all', 'moderated', 'approved', 'trash' ), true ) ) {\n\t\t\t$actions['spam'] = _x( 'Mark as spam', 'comment' );\n\t\t}\n\n\t\tif ( 'trash' === $comment_status ) {\n\t\t\t$actions['untrash'] = __( 'Restore' );\n\t\t} elseif ( 'spam' === $comment_status ) {\n\t\t\t$actions['unspam'] = _x( 'Not spam', 'comment' );\n\t\t}\n\n\t\tif ( in_array( $comment_status, array( 'trash', 'spam' ), true ) || ! EMPTY_TRASH_DAYS ) {\n\t\t\t$actions['delete'] = __( 'Delete permanently' );\n\t\t} else {\n\t\t\t$actions['trash'] = __( 'Move to Trash' );\n\t\t}\n\n\t\treturn $actions;\n\t}\n\n\t/**\n\t * @global string $comment_status\n\t * @global string $comment_type\n\t *\n\t * @param string $which\n\t */\n\tprotected function extra_tablenav( $which ) {\n\t\tglobal $comment_status, $comment_type;\n\t\tstatic $has_items;\n\n\t\tif ( ! isset( $has_items ) ) {\n\t\t\t$has_items = $this->has_items();\n\t\t}\n\t\techo '<div class=\"alignleft actions\">';\n\t\tif ( 'top' === $which ) {\n\t\t\tob_start();\n\n\t\t\t$this->comment_status_dropdown( $comment_type );\n\t\t\t/**\n\t\t\t * Fires just before the Filter submit button for comment types.\n\t\t\t *\n\t\t\t * @since 3.5.0\n\t\t\t */\n\t\t\tdo_action( 'restrict_manage_comments' );\n\n\t\t\t$output = ob_get_clean();\n\n\t\t\tif ( ! empty( $output ) && $this->has_items() ) {\n\t\t\t\techo $output;\n\t\t\t\tsubmit_button( esc_html__( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );\n\t\t\t}\n\t\t}\n\n\t\tif ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $has_items ) {\n\t\t\twp_nonce_field( 'bulk-destroy', '_destroy_nonce' );\n\t\t\t$title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );\n\t\t\tsubmit_button( $title, 'apply', 'delete_all', false );\n\t\t}\n\t\t/**\n\t\t * Fires after the Filter submit button for comment types.\n\t\t *\n\t\t * @since 2.5.0\n\t\t *\n\t\t * @param string $comment_status The comment status name. Default 'All'.\n\t\t */\n\t\tdo_action( 'manage_comments_nav', $comment_status );\n\t\techo '</div>';\n\t}\n\n\t/**\n\t * @return string|false\n\t */\n\tpublic function current_action() {\n\t\tif ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) {\n\t\t\treturn 'delete_all';\n\t\t}\n\n\t\treturn parent::current_action();\n\t}\n\n\t/**\n\t * @global int $post_id\n\t *\n\t * @return array\n\t */\n\tpublic function get_columns() {\n\t\tglobal $post_id;\n\n\t\t$columns = array();\n\n\t\tif ( $this->checkbox ) {\n\t\t\t$columns['cb'] = '<input type=\"checkbox\" />';\n\t\t}\n\n\t\t$columns['author']  = __( 'Author' );\n\t\t$columns['comment'] = _x( 'Comment', 'column name' );\n\n\t\tif ( ! $post_id ) {\n\t\t\t/* translators: Column name or table row header. */\n\t\t\t$columns['response'] = __( 'In response to' );\n\t\t}\n\n\t\t$columns['date'] = _x( 'Submitted on', 'column name' );\n\n\t\treturn $columns;\n\t}\n\n\t/**\n\t * Displays a comment status drop-down for filtering on the Comments list table.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $comment_type The current comment type slug.\n\t */\n\tprotected function comment_status_dropdown( $comment_type ) {\n\t\t/**\n\t\t * Filters the comment types dropdown menu.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param array $comment_types An array of comment types. Accepts 'Comments', 'Pings'.\n\t\t */\n\t\t$comment_types = apply_filters(\n\t\t\t'admin_comment_types_dropdown',\n\t\t\tarray(\n\t\t\t\t'comment' => esc_html__( 'Comments' ),\n\t\t\t\t'pings'   => esc_html__( 'Pings' ),\n\t\t\t)\n\t\t);\n\n\t\tif ( $comment_types && is_array( $comment_types ) ) {\n\t\t\tprintf( '<label class=\"screen-reader-text\" for=\"filter-by-comment-type\">%s</label>', esc_html__( 'Filter by comment type' ) );\n\n\t\t\techo '<select id=\"filter-by-comment-type\" name=\"comment_type\">';\n\n\t\t\tprintf( \"\\t<option value=''>%s</option>\", esc_html__( 'All comment types' ) );\n\n\t\t\tforeach ( $comment_types as $type => $label ) {\n\t\t\t\tif ( get_comments(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'number' => 1,\n\t\t\t\t\t\t'type'   => $type,\n\t\t\t\t\t)\n\t\t\t\t) ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t\"\\t<option value='%s'%s>%s</option>\\n\",\n\t\t\t\t\t\tesc_attr( $type ),\n\t\t\t\t\t\tselected( $comment_type, $type, false ),\n\t\t\t\t\t\tesc_html( $label )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\techo '</select>';\n\t\t}\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_sortable_columns() {\n\t\treturn array(\n\t\t\t'author'   => 'comment_author',\n\t\t\t'response' => 'comment_post_ID',\n\t\t\t'date'     => 'comment_date',\n\t\t);\n\t}\n\n\t/**\n\t * Get the name of the default primary column.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @return string Name of the default primary column, in this case, 'comment'.\n\t */\n\tprotected function get_default_primary_column_name() {\n\t\treturn 'comment';\n\t}\n\n\t/**\n\t * Displays the comments table.\n\t *\n\t * Overrides the parent display() method to render extra comments.\n\t *\n\t * @since 3.1.0\n\t */\n\tpublic function display() {\n\t\twp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );\n\t\tstatic $has_items;\n\n\t\tif ( ! isset( $has_items ) ) {\n\t\t\t$has_items = $this->has_items();\n\t\t\tif ( $has_items ) {\n\t\t\t\t$this->display_tablenav( 'top' );\n\t\t\t}\n\t\t}\n\n\t\t$this->screen->render_screen_reader_content( 'heading_list' );\n\n\t\t?>\n<table class=\"wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>\">\n\t<thead>\n\t<tr>\n\t\t<?php $this->print_column_headers(); ?>\n\t</tr>\n\t</thead>\n\n\t<tbody id=\"the-comment-list\" data-wp-lists=\"list:comment\">\n\t\t<?php $this->display_rows_or_placeholder(); ?>\n\t</tbody>\n\n\t<tbody id=\"the-extra-comment-list\" data-wp-lists=\"list:comment\" style=\"display: none;\">\n\t\t<?php\n\t\t\t/*\n\t\t\t * Back up the items to restore after printing the extra items markup.\n\t\t\t * The extra items may be empty, which will prevent the table nav from displaying later.\n\t\t\t */\n\t\t\t$items       = $this->items;\n\t\t\t$this->items = $this->extra_items;\n\t\t\t$this->display_rows_or_placeholder();\n\t\t\t$this->items = $items;\n\t\t?>\n\t</tbody>\n\n\t<tfoot>\n\t<tr>\n\t\t<?php $this->print_column_headers( false ); ?>\n\t</tr>\n\t</tfoot>\n\n</table>\n\t\t<?php\n\n\t\t$this->display_tablenav( 'bottom' );\n\t}\n\n\t/**\n\t * @global WP_Post    $post    Global post object.\n\t * @global WP_Comment $comment Global comment object.\n\t *\n\t * @param WP_Comment $item\n\t */\n\tpublic function single_row( $item ) {\n\t\tglobal $post, $comment;\n\n\t\t$comment = $item;\n\n\t\t$the_comment_class = wp_get_comment_status( $comment );\n\t\tif ( ! $the_comment_class ) {\n\t\t\t$the_comment_class = '';\n\t\t}\n\t\t$the_comment_class = join( ' ', get_comment_class( $the_comment_class, $comment, $comment->comment_post_ID ) );\n\n\t\tif ( $comment->comment_post_ID > 0 ) {\n\t\t\t$post = get_post( $comment->comment_post_ID );\n\t\t}\n\t\t$this->user_can = current_user_can( 'edit_comment', $comment->comment_ID );\n\n\t\techo \"<tr id='comment-$comment->comment_ID' class='$the_comment_class'>\";\n\t\t$this->single_row_columns( $comment );\n\t\techo \"</tr>\\n\";\n\n\t\tunset( $GLOBALS['post'], $GLOBALS['comment'] );\n\t}\n\n\t/**\n\t * Generate and display row actions links.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @global string $comment_status Status for the current listed comments.\n\t *\n\t * @param WP_Comment $comment     The comment object.\n\t * @param string     $column_name Current column name.\n\t * @param string     $primary     Primary column name.\n\t * @return string Row actions output for comments. An empty string\n\t *                if the current column is not the primary column,\n\t *                or if the current user cannot edit the comment.\n\t */\n\tprotected function handle_row_actions( $comment, $column_name, $primary ) {\n\t\tglobal $comment_status;\n\n\t\tif ( $primary !== $column_name ) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif ( ! $this->user_can ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$the_comment_status = wp_get_comment_status( $comment );\n\n\t\t$out = '';\n\n\t\t$del_nonce     = esc_html( '_wpnonce=' . wp_create_nonce( \"delete-comment_$comment->comment_ID\" ) );\n\t\t$approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( \"approve-comment_$comment->comment_ID\" ) );\n\n\t\t$url = \"comment.php?c=$comment->comment_ID\";\n\n\t\t$approve_url   = esc_url( $url . \"&action=approvecomment&$approve_nonce\" );\n\t\t$unapprove_url = esc_url( $url . \"&action=unapprovecomment&$approve_nonce\" );\n\t\t$spam_url      = esc_url( $url . \"&action=spamcomment&$del_nonce\" );\n\t\t$unspam_url    = esc_url( $url . \"&action=unspamcomment&$del_nonce\" );\n\t\t$trash_url     = esc_url( $url . \"&action=trashcomment&$del_nonce\" );\n\t\t$untrash_url   = esc_url( $url . \"&action=untrashcomment&$del_nonce\" );\n\t\t$delete_url    = esc_url( $url . \"&action=deletecomment&$del_nonce\" );\n\n\t\t// Preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash.\n\t\t$actions = array(\n\t\t\t'approve'   => '',\n\t\t\t'unapprove' => '',\n\t\t\t'reply'     => '',\n\t\t\t'quickedit' => '',\n\t\t\t'edit'      => '',\n\t\t\t'spam'      => '',\n\t\t\t'unspam'    => '',\n\t\t\t'trash'     => '',\n\t\t\t'untrash'   => '',\n\t\t\t'delete'    => '',\n\t\t);\n\n\t\t// Not looking at all comments.\n\t\tif ( $comment_status && 'all' !== $comment_status ) {\n\t\t\tif ( 'approved' === $the_comment_status ) {\n\t\t\t\t$actions['unapprove'] = sprintf(\n\t\t\t\t\t'<a href=\"%s\" data-wp-lists=\"%s\" class=\"vim-u vim-destructive aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t$unapprove_url,\n\t\t\t\t\t\"delete:the-comment-list:comment-{$comment->comment_ID}:e7e7d3:action=dim-comment&amp;new=unapproved\",\n\t\t\t\t\tesc_attr__( 'Unapprove this comment' ),\n\t\t\t\t\t__( 'Unapprove' )\n\t\t\t\t);\n\t\t\t} elseif ( 'unapproved' === $the_comment_status ) {\n\t\t\t\t$actions['approve'] = sprintf(\n\t\t\t\t\t'<a href=\"%s\" data-wp-lists=\"%s\" class=\"vim-a vim-destructive aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t$approve_url,\n\t\t\t\t\t\"delete:the-comment-list:comment-{$comment->comment_ID}:e7e7d3:action=dim-comment&amp;new=approved\",\n\t\t\t\t\tesc_attr__( 'Approve this comment' ),\n\t\t\t\t\t__( 'Approve' )\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\t$actions['approve'] = sprintf(\n\t\t\t\t'<a href=\"%s\" data-wp-lists=\"%s\" class=\"vim-a aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\t$approve_url,\n\t\t\t\t\"dim:the-comment-list:comment-{$comment->comment_ID}:unapproved:e7e7d3:e7e7d3:new=approved\",\n\t\t\t\tesc_attr__( 'Approve this comment' ),\n\t\t\t\t__( 'Approve' )\n\t\t\t);\n\n\t\t\t$actions['unapprove'] = sprintf(\n\t\t\t\t'<a href=\"%s\" data-wp-lists=\"%s\" class=\"vim-u aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\t$unapprove_url,\n\t\t\t\t\"dim:the-comment-list:comment-{$comment->comment_ID}:unapproved:e7e7d3:e7e7d3:new=unapproved\",\n\t\t\t\tesc_attr__( 'Unapprove this comment' ),\n\t\t\t\t__( 'Unapprove' )\n\t\t\t);\n\t\t}\n\n\t\tif ( 'spam' !== $the_comment_status ) {\n\t\t\t$actions['spam'] = sprintf(\n\t\t\t\t'<a href=\"%s\" data-wp-lists=\"%s\" class=\"vim-s vim-destructive aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\t$spam_url,\n\t\t\t\t\"delete:the-comment-list:comment-{$comment->comment_ID}::spam=1\",\n\t\t\t\tesc_attr__( 'Mark this comment as spam' ),\n\t\t\t\t/* translators: \"Mark as spam\" link. */\n\t\t\t\t_x( 'Spam', 'verb' )\n\t\t\t);\n\t\t} elseif ( 'spam' === $the_comment_status ) {\n\t\t\t$actions['unspam'] = sprintf(\n\t\t\t\t'<a href=\"%s\" data-wp-lists=\"%s\" class=\"vim-z vim-destructive aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\t$unspam_url,\n\t\t\t\t\"delete:the-comment-list:comment-{$comment->comment_ID}:66cc66:unspam=1\",\n\t\t\t\tesc_attr__( 'Restore this comment from the spam' ),\n\t\t\t\t_x( 'Not Spam', 'comment' )\n\t\t\t);\n\t\t}\n\n\t\tif ( 'trash' === $the_comment_status ) {\n\t\t\t$actions['untrash'] = sprintf(\n\t\t\t\t'<a href=\"%s\" data-wp-lists=\"%s\" class=\"vim-z vim-destructive aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\t$untrash_url,\n\t\t\t\t\"delete:the-comment-list:comment-{$comment->comment_ID}:66cc66:untrash=1\",\n\t\t\t\tesc_attr__( 'Restore this comment from the Trash' ),\n\t\t\t\t__( 'Restore' )\n\t\t\t);\n\t\t}\n\n\t\tif ( 'spam' === $the_comment_status || 'trash' === $the_comment_status || ! EMPTY_TRASH_DAYS ) {\n\t\t\t$actions['delete'] = sprintf(\n\t\t\t\t'<a href=\"%s\" data-wp-lists=\"%s\" class=\"delete vim-d vim-destructive aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\t$delete_url,\n\t\t\t\t\"delete:the-comment-list:comment-{$comment->comment_ID}::delete=1\",\n\t\t\t\tesc_attr__( 'Delete this comment permanently' ),\n\t\t\t\t__( 'Delete Permanently' )\n\t\t\t);\n\t\t} else {\n\t\t\t$actions['trash'] = sprintf(\n\t\t\t\t'<a href=\"%s\" data-wp-lists=\"%s\" class=\"delete vim-d vim-destructive aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\t$trash_url,\n\t\t\t\t\"delete:the-comment-list:comment-{$comment->comment_ID}::trash=1\",\n\t\t\t\tesc_attr__( 'Move this comment to the Trash' ),\n\t\t\t\t_x( 'Trash', 'verb' )\n\t\t\t);\n\t\t}\n\n\t\tif ( 'spam' !== $the_comment_status && 'trash' !== $the_comment_status ) {\n\t\t\t$actions['edit'] = sprintf(\n\t\t\t\t'<a href=\"%s\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\"comment.php?action=editcomment&amp;c={$comment->comment_ID}\",\n\t\t\t\tesc_attr__( 'Edit this comment' ),\n\t\t\t\t__( 'Edit' )\n\t\t\t);\n\n\t\t\t$format = '<button type=\"button\" data-comment-id=\"%d\" data-post-id=\"%d\" data-action=\"%s\" class=\"%s button-link\" aria-expanded=\"false\" aria-label=\"%s\">%s</button>';\n\n\t\t\t$actions['quickedit'] = sprintf(\n\t\t\t\t$format,\n\t\t\t\t$comment->comment_ID,\n\t\t\t\t$comment->comment_post_ID,\n\t\t\t\t'edit',\n\t\t\t\t'vim-q comment-inline',\n\t\t\t\tesc_attr__( 'Quick edit this comment inline' ),\n\t\t\t\t__( 'Quick&nbsp;Edit' )\n\t\t\t);\n\n\t\t\t$actions['reply'] = sprintf(\n\t\t\t\t$format,\n\t\t\t\t$comment->comment_ID,\n\t\t\t\t$comment->comment_post_ID,\n\t\t\t\t'replyto',\n\t\t\t\t'vim-r comment-inline',\n\t\t\t\tesc_attr__( 'Reply to this comment' ),\n\t\t\t\t__( 'Reply' )\n\t\t\t);\n\t\t}\n\n\t\t/** This filter is documented in wp-admin/includes/dashboard.php */\n\t\t$actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );\n\n\t\t$always_visible = false;\n\n\t\t$mode = get_user_setting( 'posts_list_mode', 'list' );\n\n\t\tif ( 'excerpt' === $mode ) {\n\t\t\t$always_visible = true;\n\t\t}\n\n\t\t$out .= '<div class=\"' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '\">';\n\n\t\t$i = 0;\n\n\t\tforeach ( $actions as $action => $link ) {\n\t\t\t++$i;\n\n\t\t\tif ( ( ( 'approve' === $action || 'unapprove' === $action ) && 2 === $i )\n\t\t\t\t|| 1 === $i\n\t\t\t) {\n\t\t\t\t$sep = '';\n\t\t\t} else {\n\t\t\t\t$sep = ' | ';\n\t\t\t}\n\n\t\t\t// Reply and quickedit need a hide-if-no-js span when not added with Ajax.\n\t\t\tif ( ( 'reply' === $action || 'quickedit' === $action ) && ! wp_doing_ajax() ) {\n\t\t\t\t$action .= ' hide-if-no-js';\n\t\t\t} elseif ( ( 'untrash' === $action && 'trash' === $the_comment_status )\n\t\t\t\t|| ( 'unspam' === $action && 'spam' === $the_comment_status )\n\t\t\t) {\n\t\t\t\tif ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) ) {\n\t\t\t\t\t$action .= ' approve';\n\t\t\t\t} else {\n\t\t\t\t\t$action .= ' unapprove';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$out .= \"<span class='$action'>$sep$link</span>\";\n\t\t}\n\n\t\t$out .= '</div>';\n\n\t\t$out .= '<button type=\"button\" class=\"toggle-row\"><span class=\"screen-reader-text\">' . __( 'Show more details' ) . '</span></button>';\n\n\t\treturn $out;\n\t}\n\n\t/**\n\t * @param WP_Comment $comment The comment object.\n\t */\n\tpublic function column_cb( $comment ) {\n\t\tif ( $this->user_can ) {\n\t\t\t?>\n\t\t<label class=\"screen-reader-text\" for=\"cb-select-<?php echo $comment->comment_ID; ?>\"><?php _e( 'Select comment' ); ?></label>\n\t\t<input id=\"cb-select-<?php echo $comment->comment_ID; ?>\" type=\"checkbox\" name=\"delete_comments[]\" value=\"<?php echo $comment->comment_ID; ?>\" />\n\t\t\t<?php\n\t\t}\n\t}\n\n\t/**\n\t * @param WP_Comment $comment The comment object.\n\t */\n\tpublic function column_comment( $comment ) {\n\t\techo '<div class=\"comment-author\">';\n\t\t\t$this->column_author( $comment );\n\t\techo '</div>';\n\n\t\tif ( $comment->comment_parent ) {\n\t\t\t$parent = get_comment( $comment->comment_parent );\n\t\t\tif ( $parent ) {\n\t\t\t\t$parent_link = esc_url( get_comment_link( $parent ) );\n\t\t\t\t$name        = get_comment_author( $parent );\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: Comment link. */\n\t\t\t\t\t__( 'In reply to %s.' ),\n\t\t\t\t\t'<a href=\"' . $parent_link . '\">' . $name . '</a>'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tcomment_text( $comment );\n\n\t\tif ( $this->user_can ) {\n\t\t\t/** This filter is documented in wp-admin/includes/comment.php */\n\t\t\t$comment_content = apply_filters( 'comment_edit_pre', $comment->comment_content );\n\t\t\t?>\n\t\t<div id=\"inline-<?php echo $comment->comment_ID; ?>\" class=\"hidden\">\n\t\t\t<textarea class=\"comment\" rows=\"1\" cols=\"1\"><?php echo esc_textarea( $comment_content ); ?></textarea>\n\t\t\t<div class=\"author-email\"><?php echo esc_attr( $comment->comment_author_email ); ?></div>\n\t\t\t<div class=\"author\"><?php echo esc_attr( $comment->comment_author ); ?></div>\n\t\t\t<div class=\"author-url\"><?php echo esc_attr( $comment->comment_author_url ); ?></div>\n\t\t\t<div class=\"comment_status\"><?php echo $comment->comment_approved; ?></div>\n\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}\n\n\t/**\n\t * @global string $comment_status\n\t *\n\t * @param WP_Comment $comment The comment object.\n\t */\n\tpublic function column_author( $comment ) {\n\t\tglobal $comment_status;\n\n\t\t$author_url = get_comment_author_url( $comment );\n\n\t\t$author_url_display = untrailingslashit( preg_replace( '|^http(s)?://(www\\.)?|i', '', $author_url ) );\n\t\tif ( strlen( $author_url_display ) > 50 ) {\n\t\t\t$author_url_display = wp_html_excerpt( $author_url_display, 49, '&hellip;' );\n\t\t}\n\n\t\techo '<strong>';\n\t\tcomment_author( $comment );\n\t\techo '</strong><br />';\n\t\tif ( ! empty( $author_url_display ) ) {\n\t\t\tprintf( '<a href=\"%s\">%s</a><br />', esc_url( $author_url ), esc_html( $author_url_display ) );\n\t\t}\n\n\t\tif ( $this->user_can ) {\n\t\t\tif ( ! empty( $comment->comment_author_email ) ) {\n\t\t\t\t/** This filter is documented in wp-includes/comment-template.php */\n\t\t\t\t$email = apply_filters( 'comment_email', $comment->comment_author_email, $comment );\n\n\t\t\t\tif ( ! empty( $email ) && '@' !== $email ) {\n\t\t\t\t\tprintf( '<a href=\"%1$s\">%2$s</a><br />', esc_url( 'mailto:' . $email ), esc_html( $email ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$author_ip = get_comment_author_IP( $comment );\n\t\t\tif ( $author_ip ) {\n\t\t\t\t$author_ip_url = add_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t's'    => $author_ip,\n\t\t\t\t\t\t'mode' => 'detail',\n\t\t\t\t\t),\n\t\t\t\t\tadmin_url( 'edit-comments.php' )\n\t\t\t\t);\n\t\t\t\tif ( 'spam' === $comment_status ) {\n\t\t\t\t\t$author_ip_url = add_query_arg( 'comment_status', 'spam', $author_ip_url );\n\t\t\t\t}\n\t\t\t\tprintf( '<a href=\"%1$s\">%2$s</a>', esc_url( $author_ip_url ), esc_html( $author_ip ) );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param WP_Comment $comment The comment object.\n\t */\n\tpublic function column_date( $comment ) {\n\t\t$submitted = sprintf(\n\t\t\t/* translators: 1: Comment date, 2: Comment time. */\n\t\t\t__( '%1$s at %2$s' ),\n\t\t\t/* translators: Comment date format. See https://www.php.net/date */\n\t\t\tget_comment_date( __( 'Y/m/d' ), $comment ),\n\t\t\t/* translators: Comment time format. See https://www.php.net/date */\n\t\t\tget_comment_date( __( 'g:i a' ), $comment )\n\t\t);\n\n\t\techo '<div class=\"submitted-on\">';\n\t\tif ( 'approved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) {\n\t\t\tprintf(\n\t\t\t\t'<a href=\"%s\">%s</a>',\n\t\t\t\tesc_url( get_comment_link( $comment ) ),\n\t\t\t\t$submitted\n\t\t\t);\n\t\t} else {\n\t\t\techo $submitted;\n\t\t}\n\t\techo '</div>';\n\t}\n\n\t/**\n\t * @param WP_Comment $comment The comment object.\n\t */\n\tpublic function column_response( $comment ) {\n\t\t$post = get_post();\n\n\t\tif ( ! $post ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( $this->pending_count[ $post->ID ] ) ) {\n\t\t\t$pending_comments = $this->pending_count[ $post->ID ];\n\t\t} else {\n\t\t\t$_pending_count_temp              = get_pending_comments_num( array( $post->ID ) );\n\t\t\t$pending_comments                 = $_pending_count_temp[ $post->ID ];\n\t\t\t$this->pending_count[ $post->ID ] = $pending_comments;\n\t\t}\n\n\t\tif ( current_user_can( 'edit_post', $post->ID ) ) {\n\t\t\t$post_link  = \"<a href='\" . get_edit_post_link( $post->ID ) . \"' class='comments-edit-item-link'>\";\n\t\t\t$post_link .= esc_html( get_the_title( $post->ID ) ) . '</a>';\n\t\t} else {\n\t\t\t$post_link = esc_html( get_the_title( $post->ID ) );\n\t\t}\n\n\t\techo '<div class=\"response-links\">';\n\t\tif ( 'attachment' === $post->post_type ) {\n\t\t\t$thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true );\n\t\t\tif ( $thumb ) {\n\t\t\t\techo $thumb;\n\t\t\t}\n\t\t}\n\t\techo $post_link;\n\t\t$post_type_object = get_post_type_object( $post->post_type );\n\t\techo \"<a href='\" . get_permalink( $post->ID ) . \"' class='comments-view-item-link'>\" . $post_type_object->labels->view_item . '</a>';\n\t\techo '<span class=\"post-com-count-wrapper post-com-count-', $post->ID, '\">';\n\t\t$this->comments_bubble( $post->ID, $pending_comments );\n\t\techo '</span> ';\n\t\techo '</div>';\n\t}\n\n\t/**\n\t * @param WP_Comment $comment     The comment object.\n\t * @param string     $column_name The custom column's name.\n\t */\n\tpublic function column_default( $comment, $column_name ) {\n\t\t/**\n\t\t * Fires when the default column output is displayed for a single row.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string $column_name The custom column's name.\n\t\t * @param int    $comment_ID  The custom column's unique ID number.\n\t\t */\n\t\tdo_action( 'manage_comments_custom_column', $column_name, $comment->comment_ID );\n\t}\n}\n", "num_lines": 1026}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Administration: Community Events class.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.8.0\n */\n\n/**\n * Class WP_Community_Events.\n *\n * A client for api.wordpress.org/events.\n *\n * @since 4.8.0\n */\nclass WP_Community_Events {\n\t/**\n\t * ID for a WordPress user account.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @var int\n\t */\n\tprotected $user_id = 0;\n\n\t/**\n\t * Stores location data for the user.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @var bool|array\n\t */\n\tprotected $user_location = false;\n\n\t/**\n\t * Constructor for WP_Community_Events.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param int        $user_id       WP user ID.\n\t * @param bool|array $user_location Stored location data for the user.\n\t *                                  false to pass no location;\n\t *                                  array to pass a location {\n\t *     @type string $description The name of the location\n\t *     @type string $latitude    The latitude in decimal degrees notation, without the degree\n\t *                               symbol. e.g.: 47.615200.\n\t *     @type string $longitude   The longitude in decimal degrees notation, without the degree\n\t *                               symbol. e.g.: -122.341100.\n\t *     @type string $country     The ISO 3166-1 alpha-2 country code. e.g.: BR\n\t * }\n\t */\n\tpublic function __construct( $user_id, $user_location = false ) {\n\t\t$this->user_id       = absint( $user_id );\n\t\t$this->user_location = $user_location;\n\t}\n\n\t/**\n\t * Gets data about events near a particular location.\n\t *\n\t * Cached events will be immediately returned if the `user_location` property\n\t * is set for the current user, and cached events exist for that location.\n\t *\n\t * Otherwise, this method sends a request to the w.org Events API with location\n\t * data. The API will send back a recognized location based on the data, along\n\t * with nearby events.\n\t *\n\t * The browser's request for events is proxied with this method, rather\n\t * than having the browser make the request directly to api.wordpress.org,\n\t * because it allows results to be cached server-side and shared with other\n\t * users and sites in the network. This makes the process more efficient,\n\t * since increasing the number of visits that get cached data means users\n\t * don't have to wait as often; if the user's browser made the request\n\t * directly, it would also need to make a second request to WP in order to\n\t * pass the data for caching. Having WP make the request also introduces\n\t * the opportunity to anonymize the IP before sending it to w.org, which\n\t * mitigates possible privacy concerns.\n\t *\n\t * @since 4.8.0\n\t * @since 5.5.2 Response no longer contains formatted date field. They're added\n\t *              in `wp.communityEvents.populateDynamicEventFields()` now.\n\t *\n\t * @param string $location_search Optional. City name to help determine the location.\n\t *                                e.g., \"Seattle\". Default empty string.\n\t * @param string $timezone        Optional. Timezone to help determine the location.\n\t *                                Default empty string.\n\t * @return array|WP_Error A WP_Error on failure; an array with location and events on\n\t *                        success.\n\t */\n\tpublic function get_events( $location_search = '', $timezone = '' ) {\n\t\t$cached_events = $this->get_cached_events();\n\n\t\tif ( ! $location_search && $cached_events ) {\n\t\t\treturn $cached_events;\n\t\t}\n\n\t\t// Include an unmodified $wp_version.\n\t\trequire ABSPATH . WPINC . '/version.php';\n\n\t\t$api_url                    = 'http://api.wordpress.org/events/1.0/';\n\t\t$request_args               = $this->get_request_args( $location_search, $timezone );\n\t\t$request_args['user-agent'] = 'WordPress/' . $wp_version . '; ' . home_url( '/' );\n\n\t\tif ( wp_http_supports( array( 'ssl' ) ) ) {\n\t\t\t$api_url = set_url_scheme( $api_url, 'https' );\n\t\t}\n\n\t\t$response       = wp_remote_get( $api_url, $request_args );\n\t\t$response_code  = wp_remote_retrieve_response_code( $response );\n\t\t$response_body  = json_decode( wp_remote_retrieve_body( $response ), true );\n\t\t$response_error = null;\n\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\t$response_error = $response;\n\t\t} elseif ( 200 !== $response_code ) {\n\t\t\t$response_error = new WP_Error(\n\t\t\t\t'api-error',\n\t\t\t\t/* translators: %d: Numeric HTTP status code, e.g. 400, 403, 500, 504, etc. */\n\t\t\t\tsprintf( __( 'Invalid API response code (%d).' ), $response_code )\n\t\t\t);\n\t\t} elseif ( ! isset( $response_body['location'], $response_body['events'] ) ) {\n\t\t\t$response_error = new WP_Error(\n\t\t\t\t'api-invalid-response',\n\t\t\t\tisset( $response_body['error'] ) ? $response_body['error'] : __( 'Unknown API error.' )\n\t\t\t);\n\t\t}\n\n\t\tif ( is_wp_error( $response_error ) ) {\n\t\t\treturn $response_error;\n\t\t} else {\n\t\t\t$expiration = false;\n\n\t\t\tif ( isset( $response_body['ttl'] ) ) {\n\t\t\t\t$expiration = $response_body['ttl'];\n\t\t\t\tunset( $response_body['ttl'] );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * The IP in the response is usually the same as the one that was sent\n\t\t\t * in the request, but in some cases it is different. In those cases,\n\t\t\t * it's important to reset it back to the IP from the request.\n\t\t\t *\n\t\t\t * For example, if the IP sent in the request is private (e.g., 192.168.1.100),\n\t\t\t * then the API will ignore that and use the corresponding public IP instead,\n\t\t\t * and the public IP will get returned. If the public IP were saved, though,\n\t\t\t * then get_cached_events() would always return `false`, because the transient\n\t\t\t * would be generated based on the public IP when saving the cache, but generated\n\t\t\t * based on the private IP when retrieving the cache.\n\t\t\t */\n\t\t\tif ( ! empty( $response_body['location']['ip'] ) ) {\n\t\t\t\t$response_body['location']['ip'] = $request_args['body']['ip'];\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * The API doesn't return a description for latitude/longitude requests,\n\t\t\t * but the description is already saved in the user location, so that\n\t\t\t * one can be used instead.\n\t\t\t */\n\t\t\tif ( $this->coordinates_match( $request_args['body'], $response_body['location'] ) && empty( $response_body['location']['description'] ) ) {\n\t\t\t\t$response_body['location']['description'] = $this->user_location['description'];\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Store the raw response, because events will expire before the cache does.\n\t\t\t * The response will need to be processed every page load.\n\t\t\t */\n\t\t\t$this->cache_events( $response_body, $expiration );\n\n\t\t\t$response_body['events'] = $this->trim_events( $response_body['events'] );\n\n\t\t\treturn $response_body;\n\t\t}\n\t}\n\n\t/**\n\t * Builds an array of args to use in an HTTP request to the w.org Events API.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param string $search   Optional. City search string. Default empty string.\n\t * @param string $timezone Optional. Timezone string. Default empty string.\n\t * @return array The request args.\n\t */\n\tprotected function get_request_args( $search = '', $timezone = '' ) {\n\t\t$args = array(\n\t\t\t'number' => 5, // Get more than three in case some get trimmed out.\n\t\t\t'ip'     => self::get_unsafe_client_ip(),\n\t\t);\n\n\t\t/*\n\t\t * Include the minimal set of necessary arguments, in order to increase the\n\t\t * chances of a cache-hit on the API side.\n\t\t */\n\t\tif ( empty( $search ) && isset( $this->user_location['latitude'], $this->user_location['longitude'] ) ) {\n\t\t\t$args['latitude']  = $this->user_location['latitude'];\n\t\t\t$args['longitude'] = $this->user_location['longitude'];\n\t\t} else {\n\t\t\t$args['locale'] = get_user_locale( $this->user_id );\n\n\t\t\tif ( $timezone ) {\n\t\t\t\t$args['timezone'] = $timezone;\n\t\t\t}\n\n\t\t\tif ( $search ) {\n\t\t\t\t$args['location'] = $search;\n\t\t\t}\n\t\t}\n\n\t\t// Wrap the args in an array compatible with the second parameter of `wp_remote_get()`.\n\t\treturn array(\n\t\t\t'body' => $args,\n\t\t);\n\t}\n\n\t/**\n\t * Determines the user's actual IP address and attempts to partially\n\t * anonymize an IP address by converting it to a network ID.\n\t *\n\t * Geolocating the network ID usually returns a similar location as the\n\t * actual IP, but provides some privacy for the user.\n\t *\n\t * $_SERVER['REMOTE_ADDR'] cannot be used in all cases, such as when the user\n\t * is making their request through a proxy, or when the web server is behind\n\t * a proxy. In those cases, $_SERVER['REMOTE_ADDR'] is set to the proxy address rather\n\t * than the user's actual address.\n\t *\n\t * Modified from https://stackoverflow.com/a/2031935/450127, MIT license.\n\t * Modified from https://github.com/geertw/php-ip-anonymizer, MIT license.\n\t *\n\t * SECURITY WARNING: This function is _NOT_ intended to be used in\n\t * circumstances where the authenticity of the IP address matters. This does\n\t * _NOT_ guarantee that the returned address is valid or accurate, and it can\n\t * be easily spoofed.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @return string|false The anonymized address on success; the given address\n\t *                      or false on failure.\n\t */\n\tpublic static function get_unsafe_client_ip() {\n\t\t$client_ip = false;\n\n\t\t// In order of preference, with the best ones for this purpose first.\n\t\t$address_headers = array(\n\t\t\t'HTTP_CLIENT_IP',\n\t\t\t'HTTP_X_FORWARDED_FOR',\n\t\t\t'HTTP_X_FORWARDED',\n\t\t\t'HTTP_X_CLUSTER_CLIENT_IP',\n\t\t\t'HTTP_FORWARDED_FOR',\n\t\t\t'HTTP_FORWARDED',\n\t\t\t'REMOTE_ADDR',\n\t\t);\n\n\t\tforeach ( $address_headers as $header ) {\n\t\t\tif ( array_key_exists( $header, $_SERVER ) ) {\n\t\t\t\t/*\n\t\t\t\t * HTTP_X_FORWARDED_FOR can contain a chain of comma-separated\n\t\t\t\t * addresses. The first one is the original client. It can't be\n\t\t\t\t * trusted for authenticity, but we don't need to for this purpose.\n\t\t\t\t */\n\t\t\t\t$address_chain = explode( ',', $_SERVER[ $header ] );\n\t\t\t\t$client_ip     = trim( $address_chain[0] );\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $client_ip ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$anon_ip = wp_privacy_anonymize_ip( $client_ip, true );\n\n\t\tif ( '0.0.0.0' === $anon_ip || '::' === $anon_ip ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $anon_ip;\n\t}\n\n\t/**\n\t * Test if two pairs of latitude/longitude coordinates match each other.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param array $a The first pair, with indexes 'latitude' and 'longitude'.\n\t * @param array $b The second pair, with indexes 'latitude' and 'longitude'.\n\t * @return bool True if they match, false if they don't.\n\t */\n\tprotected function coordinates_match( $a, $b ) {\n\t\tif ( ! isset( $a['latitude'], $a['longitude'], $b['latitude'], $b['longitude'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $a['latitude'] === $b['latitude'] && $a['longitude'] === $b['longitude'];\n\t}\n\n\t/**\n\t * Generates a transient key based on user location.\n\t *\n\t * This could be reduced to a one-liner in the calling functions, but it's\n\t * intentionally a separate function because it's called from multiple\n\t * functions, and having it abstracted keeps the logic consistent and DRY,\n\t * which is less prone to errors.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param array $location Should contain 'latitude' and 'longitude' indexes.\n\t * @return bool|string false on failure, or a string on success.\n\t */\n\tprotected function get_events_transient_key( $location ) {\n\t\t$key = false;\n\n\t\tif ( isset( $location['ip'] ) ) {\n\t\t\t$key = 'community-events-' . md5( $location['ip'] );\n\t\t} elseif ( isset( $location['latitude'], $location['longitude'] ) ) {\n\t\t\t$key = 'community-events-' . md5( $location['latitude'] . $location['longitude'] );\n\t\t}\n\n\t\treturn $key;\n\t}\n\n\t/**\n\t * Caches an array of events data from the Events API.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param array    $events     Response body from the API request.\n\t * @param int|bool $expiration Optional. Amount of time to cache the events. Defaults to false.\n\t * @return bool true if events were cached; false if not.\n\t */\n\tprotected function cache_events( $events, $expiration = false ) {\n\t\t$set              = false;\n\t\t$transient_key    = $this->get_events_transient_key( $events['location'] );\n\t\t$cache_expiration = $expiration ? absint( $expiration ) : HOUR_IN_SECONDS * 12;\n\n\t\tif ( $transient_key ) {\n\t\t\t$set = set_site_transient( $transient_key, $events, $cache_expiration );\n\t\t}\n\n\t\treturn $set;\n\t}\n\n\t/**\n\t * Gets cached events.\n\t *\n\t * @since 4.8.0\n\t * @since 5.5.2 Response no longer contains formatted date field. They're added\n\t *              in `wp.communityEvents.populateDynamicEventFields()` now.\n\t *\n\t * @return array|false An array containing `location` and `events` items\n\t *                     on success, false on failure.\n\t */\n\tpublic function get_cached_events() {\n\t\t$cached_response = get_site_transient( $this->get_events_transient_key( $this->user_location ) );\n\n\t\tif ( isset( $cached_response['events'] ) ) {\n\t\t\t$cached_response['events'] = $this->trim_events( $cached_response['events'] );\n\t\t}\n\n\t\treturn $cached_response;\n\t}\n\n\t/**\n\t * Adds formatted date and time items for each event in an API response.\n\t *\n\t * This has to be called after the data is pulled from the cache, because\n\t * the cached events are shared by all users. If it was called before storing\n\t * the cache, then all users would see the events in the localized data/time\n\t * of the user who triggered the cache refresh, rather than their own.\n\t *\n\t * @since 4.8.0\n\t * @deprecated 5.6.0 No longer used in core.\n\t *\n\t * @param array $response_body The response which contains the events.\n\t * @return array The response with dates and times formatted.\n\t */\n\tprotected function format_event_data_time( $response_body ) {\n\t\t_deprecated_function(\n\t\t\t__METHOD__,\n\t\t\t'5.5.2',\n\t\t\t'This is no longer used by core, and only kept for backward compatibility.'\n\t\t);\n\n\t\tif ( isset( $response_body['events'] ) ) {\n\t\t\tforeach ( $response_body['events'] as $key => $event ) {\n\t\t\t\t$timestamp = strtotime( $event['date'] );\n\n\t\t\t\t/*\n\t\t\t\t * The `date_format` option is not used because it's important\n\t\t\t\t * in this context to keep the day of the week in the formatted date,\n\t\t\t\t * so that users can tell at a glance if the event is on a day they\n\t\t\t\t * are available, without having to open the link.\n\t\t\t\t */\n\t\t\t\t/* translators: Date format for upcoming events on the dashboard. Include the day of the week. See https://www.php.net/date */\n\t\t\t\t$formatted_date = date_i18n( __( 'l, M j, Y' ), $timestamp );\n\t\t\t\t$formatted_time = date_i18n( get_option( 'time_format' ), $timestamp );\n\n\t\t\t\tif ( isset( $event['end_date'] ) ) {\n\t\t\t\t\t$end_timestamp      = strtotime( $event['end_date'] );\n\t\t\t\t\t$formatted_end_date = date_i18n( __( 'l, M j, Y' ), $end_timestamp );\n\n\t\t\t\t\tif ( 'meetup' !== $event['type'] && $formatted_end_date !== $formatted_date ) {\n\t\t\t\t\t\t/* translators: Upcoming events month format. See https://www.php.net/date */\n\t\t\t\t\t\t$start_month = date_i18n( _x( 'F', 'upcoming events month format' ), $timestamp );\n\t\t\t\t\t\t$end_month   = date_i18n( _x( 'F', 'upcoming events month format' ), $end_timestamp );\n\n\t\t\t\t\t\tif ( $start_month === $end_month ) {\n\t\t\t\t\t\t\t$formatted_date = sprintf(\n\t\t\t\t\t\t\t\t/* translators: Date string for upcoming events. 1: Month, 2: Starting day, 3: Ending day, 4: Year. */\n\t\t\t\t\t\t\t\t__( '%1$s %2$d\u00e2\u20ac\u201c%3$d, %4$d' ),\n\t\t\t\t\t\t\t\t$start_month,\n\t\t\t\t\t\t\t\t/* translators: Upcoming events day format. See https://www.php.net/date */\n\t\t\t\t\t\t\t\tdate_i18n( _x( 'j', 'upcoming events day format' ), $timestamp ),\n\t\t\t\t\t\t\t\tdate_i18n( _x( 'j', 'upcoming events day format' ), $end_timestamp ),\n\t\t\t\t\t\t\t\t/* translators: Upcoming events year format. See https://www.php.net/date */\n\t\t\t\t\t\t\t\tdate_i18n( _x( 'Y', 'upcoming events year format' ), $timestamp )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$formatted_date = sprintf(\n\t\t\t\t\t\t\t\t/* translators: Date string for upcoming events. 1: Starting month, 2: Starting day, 3: Ending month, 4: Ending day, 5: Year. */\n\t\t\t\t\t\t\t\t__( '%1$s %2$d \u00e2\u20ac\u201c %3$s %4$d, %5$d' ),\n\t\t\t\t\t\t\t\t$start_month,\n\t\t\t\t\t\t\t\tdate_i18n( _x( 'j', 'upcoming events day format' ), $timestamp ),\n\t\t\t\t\t\t\t\t$end_month,\n\t\t\t\t\t\t\t\tdate_i18n( _x( 'j', 'upcoming events day format' ), $end_timestamp ),\n\t\t\t\t\t\t\t\tdate_i18n( _x( 'Y', 'upcoming events year format' ), $timestamp )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$formatted_date = wp_maybe_decline_date( $formatted_date, 'F j, Y' );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$response_body['events'][ $key ]['formatted_date'] = $formatted_date;\n\t\t\t\t$response_body['events'][ $key ]['formatted_time'] = $formatted_time;\n\t\t\t}\n\t\t}\n\n\t\treturn $response_body;\n\t}\n\n\t/**\n\t * Prepares the event list for presentation.\n\t *\n\t * Discards expired events, and makes WordCamps \"sticky.\" Attendees need more\n\t * advanced notice about WordCamps than they do for meetups, so camps should\n\t * appear in the list sooner. If a WordCamp is coming up, the API will \"stick\"\n\t * it in the response, even if it wouldn't otherwise appear. When that happens,\n\t * the event will be at the end of the list, and will need to be moved into a\n\t * higher position, so that it doesn't get trimmed off.\n\t *\n\t * @since 4.8.0\n\t * @since 4.9.7 Stick a WordCamp to the final list.\n\t * @since 5.5.2 Accepts and returns only the events, rather than an entire HTTP response.\n\t *\n\t * @param array $events The events that will be prepared.\n\t * @return array The response body with events trimmed.\n\t */\n\tprotected function trim_events( array $events ) {\n\t\t$future_events = array();\n\n\t\tforeach ( $events as $event ) {\n\t\t\t/*\n\t\t\t * The API's `date` and `end_date` fields are in the _event's_ local timezone, but UTC is needed so\n\t\t\t * it can be converted to the _user's_ local time.\n\t\t\t */\n\t\t\t$end_time = (int) $event['end_unix_timestamp'];\n\n\t\t\tif ( time() < $end_time ) {\n\t\t\t\tarray_push( $future_events, $event );\n\t\t\t}\n\t\t}\n\n\t\t$future_wordcamps = array_filter(\n\t\t\t$future_events,\n\t\t\tfunction( $wordcamp ) {\n\t\t\t\treturn 'wordcamp' === $wordcamp['type'];\n\t\t\t}\n\t\t);\n\n\t\t$future_wordcamps    = array_values( $future_wordcamps ); // Remove gaps in indices.\n\t\t$trimmed_events      = array_slice( $future_events, 0, 3 );\n\t\t$trimmed_event_types = wp_list_pluck( $trimmed_events, 'type' );\n\n\t\t// Make sure the soonest upcoming WordCamp is pinned in the list.\n\t\tif ( $future_wordcamps && ! in_array( 'wordcamp', $trimmed_event_types, true ) ) {\n\t\t\tarray_pop( $trimmed_events );\n\t\t\tarray_push( $trimmed_events, $future_wordcamps[0] );\n\t\t}\n\n\t\treturn $trimmed_events;\n\t}\n\n\t/**\n\t * Logs responses to Events API requests.\n\t *\n\t * @since 4.8.0\n\t * @deprecated 4.9.0 Use a plugin instead. See #41217 for an example.\n\t *\n\t * @param string $message A description of what occurred.\n\t * @param array  $details Details that provide more context for the\n\t *                        log entry.\n\t */\n\tprotected function maybe_log_events_response( $message, $details ) {\n\t\t_deprecated_function( __METHOD__, '4.9.0' );\n\n\t\tif ( ! WP_DEBUG_LOG ) {\n\t\t\treturn;\n\t\t}\n\n\t\terror_log(\n\t\t\tsprintf(\n\t\t\t\t'%s: %s. Details: %s',\n\t\t\t\t__METHOD__,\n\t\t\t\ttrim( $message, '.' ),\n\t\t\t\twp_json_encode( $details )\n\t\t\t)\n\t\t);\n\t}\n}\n", "num_lines": 522}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Class for providing debug data based on a users WordPress environment.\n *\n * @package WordPress\n * @subpackage Site_Health\n * @since 5.2.0\n */\n\nclass WP_Debug_Data {\n\t/**\n\t * Calls all core functions to check for updates.\n\t *\n\t * @since 5.2.0\n\t */\n\tstatic function check_for_updates() {\n\t\twp_version_check();\n\t\twp_update_plugins();\n\t\twp_update_themes();\n\t}\n\n\t/**\n\t * Static function for generating site debug data when required.\n\t *\n\t * @since 5.2.0\n\t * @since 5.3.0 Added database charset, database collation,\n\t *              and timezone information.\n\t * @since 5.5.0 Added pretty permalinks support information.\n\t *\n\t * @throws ImagickException\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @return array The debug data for the site.\n\t */\n\tstatic function debug_data() {\n\t\tglobal $wpdb;\n\n\t\t// Save few function calls.\n\t\t$upload_dir             = wp_upload_dir();\n\t\t$permalink_structure    = get_option( 'permalink_structure' );\n\t\t$is_ssl                 = is_ssl();\n\t\t$is_multisite           = is_multisite();\n\t\t$users_can_register     = get_option( 'users_can_register' );\n\t\t$blog_public            = get_option( 'blog_public' );\n\t\t$default_comment_status = get_option( 'default_comment_status' );\n\t\t$environment_type       = wp_get_environment_type();\n\t\t$core_version           = get_bloginfo( 'version' );\n\t\t$core_updates           = get_core_updates();\n\t\t$core_update_needed     = '';\n\n\t\tforeach ( $core_updates as $core => $update ) {\n\t\t\tif ( 'upgrade' === $update->response ) {\n\t\t\t\t/* translators: %s: Latest WordPress version number. */\n\t\t\t\t$core_update_needed = ' ' . sprintf( __( '(Latest version: %s)' ), $update->version );\n\t\t\t} else {\n\t\t\t\t$core_update_needed = '';\n\t\t\t}\n\t\t}\n\n\t\t// Set up the array that holds all debug information.\n\t\t$info = array();\n\n\t\t$info['wp-core'] = array(\n\t\t\t'label'  => __( 'WordPress' ),\n\t\t\t'fields' => array(\n\t\t\t\t'version'                => array(\n\t\t\t\t\t'label' => __( 'Version' ),\n\t\t\t\t\t'value' => $core_version . $core_update_needed,\n\t\t\t\t\t'debug' => $core_version,\n\t\t\t\t),\n\t\t\t\t'site_language'          => array(\n\t\t\t\t\t'label' => __( 'Site Language' ),\n\t\t\t\t\t'value' => get_locale(),\n\t\t\t\t),\n\t\t\t\t'user_language'          => array(\n\t\t\t\t\t'label' => __( 'User Language' ),\n\t\t\t\t\t'value' => get_user_locale(),\n\t\t\t\t),\n\t\t\t\t'timezone'               => array(\n\t\t\t\t\t'label' => __( 'Timezone' ),\n\t\t\t\t\t'value' => wp_timezone_string(),\n\t\t\t\t),\n\t\t\t\t'home_url'               => array(\n\t\t\t\t\t'label'   => __( 'Home URL' ),\n\t\t\t\t\t'value'   => get_bloginfo( 'url' ),\n\t\t\t\t\t'private' => true,\n\t\t\t\t),\n\t\t\t\t'site_url'               => array(\n\t\t\t\t\t'label'   => __( 'Site URL' ),\n\t\t\t\t\t'value'   => get_bloginfo( 'wpurl' ),\n\t\t\t\t\t'private' => true,\n\t\t\t\t),\n\t\t\t\t'permalink'              => array(\n\t\t\t\t\t'label' => __( 'Permalink structure' ),\n\t\t\t\t\t'value' => $permalink_structure ? $permalink_structure : __( 'No permalink structure set' ),\n\t\t\t\t\t'debug' => $permalink_structure,\n\t\t\t\t),\n\t\t\t\t'https_status'           => array(\n\t\t\t\t\t'label' => __( 'Is this site using HTTPS?' ),\n\t\t\t\t\t'value' => $is_ssl ? __( 'Yes' ) : __( 'No' ),\n\t\t\t\t\t'debug' => $is_ssl,\n\t\t\t\t),\n\t\t\t\t'multisite'              => array(\n\t\t\t\t\t'label' => __( 'Is this a multisite?' ),\n\t\t\t\t\t'value' => $is_multisite ? __( 'Yes' ) : __( 'No' ),\n\t\t\t\t\t'debug' => $is_multisite,\n\t\t\t\t),\n\t\t\t\t'user_registration'      => array(\n\t\t\t\t\t'label' => __( 'Can anyone register on this site?' ),\n\t\t\t\t\t'value' => $users_can_register ? __( 'Yes' ) : __( 'No' ),\n\t\t\t\t\t'debug' => $users_can_register,\n\t\t\t\t),\n\t\t\t\t'blog_public'            => array(\n\t\t\t\t\t'label' => __( 'Is this site discouraging search engines?' ),\n\t\t\t\t\t'value' => $blog_public ? __( 'No' ) : __( 'Yes' ),\n\t\t\t\t\t'debug' => $blog_public,\n\t\t\t\t),\n\t\t\t\t'default_comment_status' => array(\n\t\t\t\t\t'label' => __( 'Default comment status' ),\n\t\t\t\t\t'value' => 'open' === $default_comment_status ? _x( 'Open', 'comment status' ) : _x( 'Closed', 'comment status' ),\n\t\t\t\t\t'debug' => $default_comment_status,\n\t\t\t\t),\n\t\t\t\t'environment_type'       => array(\n\t\t\t\t\t'label' => __( 'Environment type' ),\n\t\t\t\t\t'value' => $environment_type,\n\t\t\t\t\t'debug' => $environment_type,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\tif ( ! $is_multisite ) {\n\t\t\t$info['wp-paths-sizes'] = array(\n\t\t\t\t'label'  => __( 'Directories and Sizes' ),\n\t\t\t\t'fields' => array(),\n\t\t\t);\n\t\t}\n\n\t\t$info['wp-dropins'] = array(\n\t\t\t'label'       => __( 'Drop-ins' ),\n\t\t\t'show_count'  => true,\n\t\t\t'description' => sprintf(\n\t\t\t\t/* translators: %s: wp-content directory name. */\n\t\t\t\t__( 'Drop-ins are single files, found in the %s directory, that replace or enhance WordPress features in ways that are not possible for traditional plugins.' ),\n\t\t\t\t'<code>' . str_replace( ABSPATH, '', WP_CONTENT_DIR ) . '</code>'\n\t\t\t),\n\t\t\t'fields'      => array(),\n\t\t);\n\n\t\t$info['wp-active-theme'] = array(\n\t\t\t'label'  => __( 'Active Theme' ),\n\t\t\t'fields' => array(),\n\t\t);\n\n\t\t$info['wp-parent-theme'] = array(\n\t\t\t'label'  => __( 'Parent Theme' ),\n\t\t\t'fields' => array(),\n\t\t);\n\n\t\t$info['wp-themes-inactive'] = array(\n\t\t\t'label'      => __( 'Inactive Themes' ),\n\t\t\t'show_count' => true,\n\t\t\t'fields'     => array(),\n\t\t);\n\n\t\t$info['wp-mu-plugins'] = array(\n\t\t\t'label'      => __( 'Must Use Plugins' ),\n\t\t\t'show_count' => true,\n\t\t\t'fields'     => array(),\n\t\t);\n\n\t\t$info['wp-plugins-active'] = array(\n\t\t\t'label'      => __( 'Active Plugins' ),\n\t\t\t'show_count' => true,\n\t\t\t'fields'     => array(),\n\t\t);\n\n\t\t$info['wp-plugins-inactive'] = array(\n\t\t\t'label'      => __( 'Inactive Plugins' ),\n\t\t\t'show_count' => true,\n\t\t\t'fields'     => array(),\n\t\t);\n\n\t\t$info['wp-media'] = array(\n\t\t\t'label'  => __( 'Media Handling' ),\n\t\t\t'fields' => array(),\n\t\t);\n\n\t\t$info['wp-server'] = array(\n\t\t\t'label'       => __( 'Server' ),\n\t\t\t'description' => __( 'The options shown below relate to your server setup. If changes are required, you may need your web host&#8217;s assistance.' ),\n\t\t\t'fields'      => array(),\n\t\t);\n\n\t\t$info['wp-database'] = array(\n\t\t\t'label'  => __( 'Database' ),\n\t\t\t'fields' => array(),\n\t\t);\n\n\t\t// Check if WP_DEBUG_LOG is set.\n\t\t$wp_debug_log_value = __( 'Disabled' );\n\n\t\tif ( is_string( WP_DEBUG_LOG ) ) {\n\t\t\t$wp_debug_log_value = WP_DEBUG_LOG;\n\t\t} elseif ( WP_DEBUG_LOG ) {\n\t\t\t$wp_debug_log_value = __( 'Enabled' );\n\t\t}\n\n\t\t// Check CONCATENATE_SCRIPTS.\n\t\tif ( defined( 'CONCATENATE_SCRIPTS' ) ) {\n\t\t\t$concatenate_scripts       = CONCATENATE_SCRIPTS ? __( 'Enabled' ) : __( 'Disabled' );\n\t\t\t$concatenate_scripts_debug = CONCATENATE_SCRIPTS ? 'true' : 'false';\n\t\t} else {\n\t\t\t$concatenate_scripts       = __( 'Undefined' );\n\t\t\t$concatenate_scripts_debug = 'undefined';\n\t\t}\n\n\t\t// Check COMPRESS_SCRIPTS.\n\t\tif ( defined( 'COMPRESS_SCRIPTS' ) ) {\n\t\t\t$compress_scripts       = COMPRESS_SCRIPTS ? __( 'Enabled' ) : __( 'Disabled' );\n\t\t\t$compress_scripts_debug = COMPRESS_SCRIPTS ? 'true' : 'false';\n\t\t} else {\n\t\t\t$compress_scripts       = __( 'Undefined' );\n\t\t\t$compress_scripts_debug = 'undefined';\n\t\t}\n\n\t\t// Check COMPRESS_CSS.\n\t\tif ( defined( 'COMPRESS_CSS' ) ) {\n\t\t\t$compress_css       = COMPRESS_CSS ? __( 'Enabled' ) : __( 'Disabled' );\n\t\t\t$compress_css_debug = COMPRESS_CSS ? 'true' : 'false';\n\t\t} else {\n\t\t\t$compress_css       = __( 'Undefined' );\n\t\t\t$compress_css_debug = 'undefined';\n\t\t}\n\n\t\t// Check WP_LOCAL_DEV.\n\t\tif ( defined( 'WP_LOCAL_DEV' ) ) {\n\t\t\t$wp_local_dev       = WP_LOCAL_DEV ? __( 'Enabled' ) : __( 'Disabled' );\n\t\t\t$wp_local_dev_debug = WP_LOCAL_DEV ? 'true' : 'false';\n\t\t} else {\n\t\t\t$wp_local_dev       = __( 'Undefined' );\n\t\t\t$wp_local_dev_debug = 'undefined';\n\t\t}\n\n\t\t$info['wp-constants'] = array(\n\t\t\t'label'       => __( 'WordPress Constants' ),\n\t\t\t'description' => __( 'These settings alter where and how parts of WordPress are loaded.' ),\n\t\t\t'fields'      => array(\n\t\t\t\t'ABSPATH'             => array(\n\t\t\t\t\t'label'   => 'ABSPATH',\n\t\t\t\t\t'value'   => ABSPATH,\n\t\t\t\t\t'private' => true,\n\t\t\t\t),\n\t\t\t\t'WP_HOME'             => array(\n\t\t\t\t\t'label' => 'WP_HOME',\n\t\t\t\t\t'value' => ( defined( 'WP_HOME' ) ? WP_HOME : __( 'Undefined' ) ),\n\t\t\t\t\t'debug' => ( defined( 'WP_HOME' ) ? WP_HOME : 'undefined' ),\n\t\t\t\t),\n\t\t\t\t'WP_SITEURL'          => array(\n\t\t\t\t\t'label' => 'WP_SITEURL',\n\t\t\t\t\t'value' => ( defined( 'WP_SITEURL' ) ? WP_SITEURL : __( 'Undefined' ) ),\n\t\t\t\t\t'debug' => ( defined( 'WP_SITEURL' ) ? WP_SITEURL : 'undefined' ),\n\t\t\t\t),\n\t\t\t\t'WP_CONTENT_DIR'      => array(\n\t\t\t\t\t'label' => 'WP_CONTENT_DIR',\n\t\t\t\t\t'value' => WP_CONTENT_DIR,\n\t\t\t\t),\n\t\t\t\t'WP_PLUGIN_DIR'       => array(\n\t\t\t\t\t'label' => 'WP_PLUGIN_DIR',\n\t\t\t\t\t'value' => WP_PLUGIN_DIR,\n\t\t\t\t),\n\t\t\t\t'WP_MAX_MEMORY_LIMIT' => array(\n\t\t\t\t\t'label' => 'WP_MAX_MEMORY_LIMIT',\n\t\t\t\t\t'value' => WP_MAX_MEMORY_LIMIT,\n\t\t\t\t),\n\t\t\t\t'WP_DEBUG'            => array(\n\t\t\t\t\t'label' => 'WP_DEBUG',\n\t\t\t\t\t'value' => WP_DEBUG ? __( 'Enabled' ) : __( 'Disabled' ),\n\t\t\t\t\t'debug' => WP_DEBUG,\n\t\t\t\t),\n\t\t\t\t'WP_DEBUG_DISPLAY'    => array(\n\t\t\t\t\t'label' => 'WP_DEBUG_DISPLAY',\n\t\t\t\t\t'value' => WP_DEBUG_DISPLAY ? __( 'Enabled' ) : __( 'Disabled' ),\n\t\t\t\t\t'debug' => WP_DEBUG_DISPLAY,\n\t\t\t\t),\n\t\t\t\t'WP_DEBUG_LOG'        => array(\n\t\t\t\t\t'label' => 'WP_DEBUG_LOG',\n\t\t\t\t\t'value' => $wp_debug_log_value,\n\t\t\t\t\t'debug' => WP_DEBUG_LOG,\n\t\t\t\t),\n\t\t\t\t'SCRIPT_DEBUG'        => array(\n\t\t\t\t\t'label' => 'SCRIPT_DEBUG',\n\t\t\t\t\t'value' => SCRIPT_DEBUG ? __( 'Enabled' ) : __( 'Disabled' ),\n\t\t\t\t\t'debug' => SCRIPT_DEBUG,\n\t\t\t\t),\n\t\t\t\t'WP_CACHE'            => array(\n\t\t\t\t\t'label' => 'WP_CACHE',\n\t\t\t\t\t'value' => WP_CACHE ? __( 'Enabled' ) : __( 'Disabled' ),\n\t\t\t\t\t'debug' => WP_CACHE,\n\t\t\t\t),\n\t\t\t\t'CONCATENATE_SCRIPTS' => array(\n\t\t\t\t\t'label' => 'CONCATENATE_SCRIPTS',\n\t\t\t\t\t'value' => $concatenate_scripts,\n\t\t\t\t\t'debug' => $concatenate_scripts_debug,\n\t\t\t\t),\n\t\t\t\t'COMPRESS_SCRIPTS'    => array(\n\t\t\t\t\t'label' => 'COMPRESS_SCRIPTS',\n\t\t\t\t\t'value' => $compress_scripts,\n\t\t\t\t\t'debug' => $compress_scripts_debug,\n\t\t\t\t),\n\t\t\t\t'COMPRESS_CSS'        => array(\n\t\t\t\t\t'label' => 'COMPRESS_CSS',\n\t\t\t\t\t'value' => $compress_css,\n\t\t\t\t\t'debug' => $compress_css_debug,\n\t\t\t\t),\n\t\t\t\t'WP_LOCAL_DEV'        => array(\n\t\t\t\t\t'label' => 'WP_LOCAL_DEV',\n\t\t\t\t\t'value' => $wp_local_dev,\n\t\t\t\t\t'debug' => $wp_local_dev_debug,\n\t\t\t\t),\n\t\t\t\t'DB_CHARSET'          => array(\n\t\t\t\t\t'label' => 'DB_CHARSET',\n\t\t\t\t\t'value' => ( defined( 'DB_CHARSET' ) ? DB_CHARSET : __( 'Undefined' ) ),\n\t\t\t\t\t'debug' => ( defined( 'DB_CHARSET' ) ? DB_CHARSET : 'undefined' ),\n\t\t\t\t),\n\t\t\t\t'DB_COLLATE'          => array(\n\t\t\t\t\t'label' => 'DB_COLLATE',\n\t\t\t\t\t'value' => ( defined( 'DB_COLLATE' ) ? DB_COLLATE : __( 'Undefined' ) ),\n\t\t\t\t\t'debug' => ( defined( 'DB_COLLATE' ) ? DB_COLLATE : 'undefined' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$is_writable_abspath            = wp_is_writable( ABSPATH );\n\t\t$is_writable_wp_content_dir     = wp_is_writable( WP_CONTENT_DIR );\n\t\t$is_writable_upload_dir         = wp_is_writable( $upload_dir['basedir'] );\n\t\t$is_writable_wp_plugin_dir      = wp_is_writable( WP_PLUGIN_DIR );\n\t\t$is_writable_template_directory = wp_is_writable( get_theme_root( get_template() ) );\n\n\t\t$info['wp-filesystem'] = array(\n\t\t\t'label'       => __( 'Filesystem Permissions' ),\n\t\t\t'description' => __( 'Shows whether WordPress is able to write to the directories it needs access to.' ),\n\t\t\t'fields'      => array(\n\t\t\t\t'wordpress'  => array(\n\t\t\t\t\t'label' => __( 'The main WordPress directory' ),\n\t\t\t\t\t'value' => ( $is_writable_abspath ? __( 'Writable' ) : __( 'Not writable' ) ),\n\t\t\t\t\t'debug' => ( $is_writable_abspath ? 'writable' : 'not writable' ),\n\t\t\t\t),\n\t\t\t\t'wp-content' => array(\n\t\t\t\t\t'label' => __( 'The wp-content directory' ),\n\t\t\t\t\t'value' => ( $is_writable_wp_content_dir ? __( 'Writable' ) : __( 'Not writable' ) ),\n\t\t\t\t\t'debug' => ( $is_writable_wp_content_dir ? 'writable' : 'not writable' ),\n\t\t\t\t),\n\t\t\t\t'uploads'    => array(\n\t\t\t\t\t'label' => __( 'The uploads directory' ),\n\t\t\t\t\t'value' => ( $is_writable_upload_dir ? __( 'Writable' ) : __( 'Not writable' ) ),\n\t\t\t\t\t'debug' => ( $is_writable_upload_dir ? 'writable' : 'not writable' ),\n\t\t\t\t),\n\t\t\t\t'plugins'    => array(\n\t\t\t\t\t'label' => __( 'The plugins directory' ),\n\t\t\t\t\t'value' => ( $is_writable_wp_plugin_dir ? __( 'Writable' ) : __( 'Not writable' ) ),\n\t\t\t\t\t'debug' => ( $is_writable_wp_plugin_dir ? 'writable' : 'not writable' ),\n\t\t\t\t),\n\t\t\t\t'themes'     => array(\n\t\t\t\t\t'label' => __( 'The themes directory' ),\n\t\t\t\t\t'value' => ( $is_writable_template_directory ? __( 'Writable' ) : __( 'Not writable' ) ),\n\t\t\t\t\t'debug' => ( $is_writable_template_directory ? 'writable' : 'not writable' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t// Conditionally add debug information for multisite setups.\n\t\tif ( is_multisite() ) {\n\t\t\t$network_query = new WP_Network_Query();\n\t\t\t$network_ids   = $network_query->query(\n\t\t\t\tarray(\n\t\t\t\t\t'fields'        => 'ids',\n\t\t\t\t\t'number'        => 100,\n\t\t\t\t\t'no_found_rows' => false,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$site_count = 0;\n\t\t\tforeach ( $network_ids as $network_id ) {\n\t\t\t\t$site_count += get_blog_count( $network_id );\n\t\t\t}\n\n\t\t\t$info['wp-core']['fields']['user_count'] = array(\n\t\t\t\t'label' => __( 'User count' ),\n\t\t\t\t'value' => get_user_count(),\n\t\t\t);\n\n\t\t\t$info['wp-core']['fields']['site_count'] = array(\n\t\t\t\t'label' => __( 'Site count' ),\n\t\t\t\t'value' => $site_count,\n\t\t\t);\n\n\t\t\t$info['wp-core']['fields']['network_count'] = array(\n\t\t\t\t'label' => __( 'Network count' ),\n\t\t\t\t'value' => $network_query->found_networks,\n\t\t\t);\n\t\t} else {\n\t\t\t$user_count = count_users();\n\n\t\t\t$info['wp-core']['fields']['user_count'] = array(\n\t\t\t\t'label' => __( 'User count' ),\n\t\t\t\t'value' => $user_count['total_users'],\n\t\t\t);\n\t\t}\n\n\t\t// WordPress features requiring processing.\n\t\t$wp_dotorg = wp_remote_get( 'https://wordpress.org', array( 'timeout' => 10 ) );\n\n\t\tif ( ! is_wp_error( $wp_dotorg ) ) {\n\t\t\t$info['wp-core']['fields']['dotorg_communication'] = array(\n\t\t\t\t'label' => __( 'Communication with WordPress.org' ),\n\t\t\t\t'value' => __( 'WordPress.org is reachable' ),\n\t\t\t\t'debug' => 'true',\n\t\t\t);\n\t\t} else {\n\t\t\t$info['wp-core']['fields']['dotorg_communication'] = array(\n\t\t\t\t'label' => __( 'Communication with WordPress.org' ),\n\t\t\t\t'value' => sprintf(\n\t\t\t\t\t/* translators: 1: The IP address WordPress.org resolves to. 2: The error returned by the lookup. */\n\t\t\t\t\t__( 'Unable to reach WordPress.org at %1$s: %2$s' ),\n\t\t\t\t\tgethostbyname( 'wordpress.org' ),\n\t\t\t\t\t$wp_dotorg->get_error_message()\n\t\t\t\t),\n\t\t\t\t'debug' => $wp_dotorg->get_error_message(),\n\t\t\t);\n\t\t}\n\n\t\t// Remove accordion for Directories and Sizes if in Multisite.\n\t\tif ( ! $is_multisite ) {\n\t\t\t$loading = __( 'Loading&hellip;' );\n\n\t\t\t$info['wp-paths-sizes']['fields'] = array(\n\t\t\t\t'wordpress_path' => array(\n\t\t\t\t\t'label' => __( 'WordPress directory location' ),\n\t\t\t\t\t'value' => untrailingslashit( ABSPATH ),\n\t\t\t\t),\n\t\t\t\t'wordpress_size' => array(\n\t\t\t\t\t'label' => __( 'WordPress directory size' ),\n\t\t\t\t\t'value' => $loading,\n\t\t\t\t\t'debug' => 'loading...',\n\t\t\t\t),\n\t\t\t\t'uploads_path'   => array(\n\t\t\t\t\t'label' => __( 'Uploads directory location' ),\n\t\t\t\t\t'value' => $upload_dir['basedir'],\n\t\t\t\t),\n\t\t\t\t'uploads_size'   => array(\n\t\t\t\t\t'label' => __( 'Uploads directory size' ),\n\t\t\t\t\t'value' => $loading,\n\t\t\t\t\t'debug' => 'loading...',\n\t\t\t\t),\n\t\t\t\t'themes_path'    => array(\n\t\t\t\t\t'label' => __( 'Themes directory location' ),\n\t\t\t\t\t'value' => get_theme_root(),\n\t\t\t\t),\n\t\t\t\t'themes_size'    => array(\n\t\t\t\t\t'label' => __( 'Themes directory size' ),\n\t\t\t\t\t'value' => $loading,\n\t\t\t\t\t'debug' => 'loading...',\n\t\t\t\t),\n\t\t\t\t'plugins_path'   => array(\n\t\t\t\t\t'label' => __( 'Plugins directory location' ),\n\t\t\t\t\t'value' => WP_PLUGIN_DIR,\n\t\t\t\t),\n\t\t\t\t'plugins_size'   => array(\n\t\t\t\t\t'label' => __( 'Plugins directory size' ),\n\t\t\t\t\t'value' => $loading,\n\t\t\t\t\t'debug' => 'loading...',\n\t\t\t\t),\n\t\t\t\t'database_size'  => array(\n\t\t\t\t\t'label' => __( 'Database size' ),\n\t\t\t\t\t'value' => $loading,\n\t\t\t\t\t'debug' => 'loading...',\n\t\t\t\t),\n\t\t\t\t'total_size'     => array(\n\t\t\t\t\t'label' => __( 'Total installation size' ),\n\t\t\t\t\t'value' => $loading,\n\t\t\t\t\t'debug' => 'loading...',\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\t// Get a list of all drop-in replacements.\n\t\t$dropins = get_dropins();\n\n\t\t// Get dropins descriptions.\n\t\t$dropin_descriptions = _get_dropins();\n\n\t\t// Spare few function calls.\n\t\t$not_available = __( 'Not available' );\n\n\t\tforeach ( $dropins as $dropin_key => $dropin ) {\n\t\t\t$info['wp-dropins']['fields'][ sanitize_text_field( $dropin_key ) ] = array(\n\t\t\t\t'label' => $dropin_key,\n\t\t\t\t'value' => $dropin_descriptions[ $dropin_key ][0],\n\t\t\t\t'debug' => 'true',\n\t\t\t);\n\t\t}\n\n\t\t// Populate the media fields.\n\t\t$info['wp-media']['fields']['image_editor'] = array(\n\t\t\t'label' => __( 'Active editor' ),\n\t\t\t'value' => _wp_image_editor_choose(),\n\t\t);\n\n\t\t// Get ImageMagic information, if available.\n\t\tif ( class_exists( 'Imagick' ) ) {\n\t\t\t// Save the Imagick instance for later use.\n\t\t\t$imagick         = new Imagick();\n\t\t\t$imagick_version = $imagick->getVersion();\n\t\t} else {\n\t\t\t$imagick_version = __( 'Not available' );\n\t\t}\n\n\t\t$info['wp-media']['fields']['imagick_module_version'] = array(\n\t\t\t'label' => __( 'ImageMagick version number' ),\n\t\t\t'value' => ( is_array( $imagick_version ) ? $imagick_version['versionNumber'] : $imagick_version ),\n\t\t);\n\n\t\t$info['wp-media']['fields']['imagemagick_version'] = array(\n\t\t\t'label' => __( 'ImageMagick version string' ),\n\t\t\t'value' => ( is_array( $imagick_version ) ? $imagick_version['versionString'] : $imagick_version ),\n\t\t);\n\n\t\tif ( ! function_exists( 'ini_get' ) ) {\n\t\t\t$info['wp-media']['fields']['ini_get'] = array(\n\t\t\t\t'label' => __( 'File upload settings' ),\n\t\t\t\t'value' => sprintf(\n\t\t\t\t\t/* translators: %s: ini_get() */\n\t\t\t\t\t__( 'Unable to determine some settings, as the %s function has been disabled.' ),\n\t\t\t\t\t'ini_get()'\n\t\t\t\t),\n\t\t\t\t'debug' => 'ini_get() is disabled',\n\t\t\t);\n\t\t} else {\n\t\t\t// Get the PHP ini directive values.\n\t\t\t$post_max_size       = ini_get( 'post_max_size' );\n\t\t\t$upload_max_filesize = ini_get( 'upload_max_filesize' );\n\t\t\t$max_file_uploads    = ini_get( 'max_file_uploads' );\n\t\t\t$effective           = min( wp_convert_hr_to_bytes( $post_max_size ), wp_convert_hr_to_bytes( $upload_max_filesize ) );\n\n\t\t\t// Add info in Media section.\n\t\t\t$info['wp-media']['fields']['file_uploads']        = array(\n\t\t\t\t'label' => __( 'File uploads' ),\n\t\t\t\t'value' => empty( ini_get( 'file_uploads' ) ) ? __( 'Disabled' ) : __( 'Enabled' ),\n\t\t\t\t'debug' => 'File uploads is turned off',\n\t\t\t);\n\t\t\t$info['wp-media']['fields']['post_max_size']       = array(\n\t\t\t\t'label' => __( 'Max size of post data allowed' ),\n\t\t\t\t'value' => $post_max_size,\n\t\t\t);\n\t\t\t$info['wp-media']['fields']['upload_max_filesize'] = array(\n\t\t\t\t'label' => __( 'Max size of an uploaded file' ),\n\t\t\t\t'value' => $upload_max_filesize,\n\t\t\t);\n\t\t\t$info['wp-media']['fields']['max_effective_size']  = array(\n\t\t\t\t'label' => __( 'Max effective file size' ),\n\t\t\t\t'value' => size_format( $effective ),\n\t\t\t);\n\t\t\t$info['wp-media']['fields']['max_file_uploads']    = array(\n\t\t\t\t'label' => __( 'Max number of files allowed' ),\n\t\t\t\t'value' => number_format( $max_file_uploads ),\n\t\t\t);\n\t\t}\n\n\t\t// If Imagick is used as our editor, provide some more information about its limitations.\n\t\tif ( 'WP_Image_Editor_Imagick' === _wp_image_editor_choose() && isset( $imagick ) && $imagick instanceof Imagick ) {\n\t\t\t$limits = array(\n\t\t\t\t'area'   => ( defined( 'imagick::RESOURCETYPE_AREA' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_AREA ) ) : $not_available ),\n\t\t\t\t'disk'   => ( defined( 'imagick::RESOURCETYPE_DISK' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_DISK ) : $not_available ),\n\t\t\t\t'file'   => ( defined( 'imagick::RESOURCETYPE_FILE' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_FILE ) : $not_available ),\n\t\t\t\t'map'    => ( defined( 'imagick::RESOURCETYPE_MAP' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MAP ) ) : $not_available ),\n\t\t\t\t'memory' => ( defined( 'imagick::RESOURCETYPE_MEMORY' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MEMORY ) ) : $not_available ),\n\t\t\t\t'thread' => ( defined( 'imagick::RESOURCETYPE_THREAD' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_THREAD ) : $not_available ),\n\t\t\t);\n\n\t\t\t$limits_debug = array(\n\t\t\t\t'imagick::RESOURCETYPE_AREA'   => ( defined( 'imagick::RESOURCETYPE_AREA' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_AREA ) ) : 'not available' ),\n\t\t\t\t'imagick::RESOURCETYPE_DISK'   => ( defined( 'imagick::RESOURCETYPE_DISK' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_DISK ) : 'not available' ),\n\t\t\t\t'imagick::RESOURCETYPE_FILE'   => ( defined( 'imagick::RESOURCETYPE_FILE' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_FILE ) : 'not available' ),\n\t\t\t\t'imagick::RESOURCETYPE_MAP'    => ( defined( 'imagick::RESOURCETYPE_MAP' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MAP ) ) : 'not available' ),\n\t\t\t\t'imagick::RESOURCETYPE_MEMORY' => ( defined( 'imagick::RESOURCETYPE_MEMORY' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MEMORY ) ) : 'not available' ),\n\t\t\t\t'imagick::RESOURCETYPE_THREAD' => ( defined( 'imagick::RESOURCETYPE_THREAD' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_THREAD ) : 'not available' ),\n\t\t\t);\n\n\t\t\t$info['wp-media']['fields']['imagick_limits'] = array(\n\t\t\t\t'label' => __( 'Imagick Resource Limits' ),\n\t\t\t\t'value' => $limits,\n\t\t\t\t'debug' => $limits_debug,\n\t\t\t);\n\t\t}\n\n\t\t// Get GD information, if available.\n\t\tif ( function_exists( 'gd_info' ) ) {\n\t\t\t$gd = gd_info();\n\t\t} else {\n\t\t\t$gd = false;\n\t\t}\n\n\t\t$info['wp-media']['fields']['gd_version'] = array(\n\t\t\t'label' => __( 'GD version' ),\n\t\t\t'value' => ( is_array( $gd ) ? $gd['GD Version'] : $not_available ),\n\t\t\t'debug' => ( is_array( $gd ) ? $gd['GD Version'] : 'not available' ),\n\t\t);\n\n\t\t// Get Ghostscript information, if available.\n\t\tif ( function_exists( 'exec' ) ) {\n\t\t\t$gs = exec( 'gs --version' );\n\n\t\t\tif ( empty( $gs ) ) {\n\t\t\t\t$gs       = $not_available;\n\t\t\t\t$gs_debug = 'not available';\n\t\t\t} else {\n\t\t\t\t$gs_debug = $gs;\n\t\t\t}\n\t\t} else {\n\t\t\t$gs       = __( 'Unable to determine if Ghostscript is installed' );\n\t\t\t$gs_debug = 'unknown';\n\t\t}\n\n\t\t$info['wp-media']['fields']['ghostscript_version'] = array(\n\t\t\t'label' => __( 'Ghostscript version' ),\n\t\t\t'value' => $gs,\n\t\t\t'debug' => $gs_debug,\n\t\t);\n\n\t\t// Populate the server debug fields.\n\t\tif ( function_exists( 'php_uname' ) ) {\n\t\t\t$server_architecture = sprintf( '%s %s %s', php_uname( 's' ), php_uname( 'r' ), php_uname( 'm' ) );\n\t\t} else {\n\t\t\t$server_architecture = 'unknown';\n\t\t}\n\n\t\tif ( function_exists( 'phpversion' ) ) {\n\t\t\t$php_version_debug = phpversion();\n\t\t\t// Whether PHP supports 64-bit.\n\t\t\t$php64bit = ( PHP_INT_SIZE * 8 === 64 );\n\n\t\t\t$php_version = sprintf(\n\t\t\t\t'%s %s',\n\t\t\t\t$php_version_debug,\n\t\t\t\t( $php64bit ? __( '(Supports 64bit values)' ) : __( '(Does not support 64bit values)' ) )\n\t\t\t);\n\n\t\t\tif ( $php64bit ) {\n\t\t\t\t$php_version_debug .= ' 64bit';\n\t\t\t}\n\t\t} else {\n\t\t\t$php_version       = __( 'Unable to determine PHP version' );\n\t\t\t$php_version_debug = 'unknown';\n\t\t}\n\n\t\tif ( function_exists( 'php_sapi_name' ) ) {\n\t\t\t$php_sapi = php_sapi_name();\n\t\t} else {\n\t\t\t$php_sapi = 'unknown';\n\t\t}\n\n\t\t$info['wp-server']['fields']['server_architecture'] = array(\n\t\t\t'label' => __( 'Server architecture' ),\n\t\t\t'value' => ( 'unknown' !== $server_architecture ? $server_architecture : __( 'Unable to determine server architecture' ) ),\n\t\t\t'debug' => $server_architecture,\n\t\t);\n\t\t$info['wp-server']['fields']['httpd_software']      = array(\n\t\t\t'label' => __( 'Web server' ),\n\t\t\t'value' => ( isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : __( 'Unable to determine what web server software is used' ) ),\n\t\t\t'debug' => ( isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : 'unknown' ),\n\t\t);\n\t\t$info['wp-server']['fields']['php_version']         = array(\n\t\t\t'label' => __( 'PHP version' ),\n\t\t\t'value' => $php_version,\n\t\t\t'debug' => $php_version_debug,\n\t\t);\n\t\t$info['wp-server']['fields']['php_sapi']            = array(\n\t\t\t'label' => __( 'PHP SAPI' ),\n\t\t\t'value' => ( 'unknown' !== $php_sapi ? $php_sapi : __( 'Unable to determine PHP SAPI' ) ),\n\t\t\t'debug' => $php_sapi,\n\t\t);\n\n\t\t// Some servers disable `ini_set()` and `ini_get()`, we check this before trying to get configuration values.\n\t\tif ( ! function_exists( 'ini_get' ) ) {\n\t\t\t$info['wp-server']['fields']['ini_get'] = array(\n\t\t\t\t'label' => __( 'Server settings' ),\n\t\t\t\t'value' => sprintf(\n\t\t\t\t\t/* translators: %s: ini_get() */\n\t\t\t\t\t__( 'Unable to determine some settings, as the %s function has been disabled.' ),\n\t\t\t\t\t'ini_get()'\n\t\t\t\t),\n\t\t\t\t'debug' => 'ini_get() is disabled',\n\t\t\t);\n\t\t} else {\n\t\t\t$info['wp-server']['fields']['max_input_variables'] = array(\n\t\t\t\t'label' => __( 'PHP max input variables' ),\n\t\t\t\t'value' => ini_get( 'max_input_vars' ),\n\t\t\t);\n\t\t\t$info['wp-server']['fields']['time_limit']          = array(\n\t\t\t\t'label' => __( 'PHP time limit' ),\n\t\t\t\t'value' => ini_get( 'max_execution_time' ),\n\t\t\t);\n\n\t\t\tif ( WP_Site_Health::get_instance()->php_memory_limit !== ini_get( 'memory_limit' ) ) {\n\t\t\t\t$info['wp-server']['fields']['memory_limit']       = array(\n\t\t\t\t\t'label' => __( 'PHP memory limit' ),\n\t\t\t\t\t'value' => WP_Site_Health::get_instance()->php_memory_limit,\n\t\t\t\t);\n\t\t\t\t$info['wp-server']['fields']['admin_memory_limit'] = array(\n\t\t\t\t\t'label' => __( 'PHP memory limit (only for admin screens)' ),\n\t\t\t\t\t'value' => ini_get( 'memory_limit' ),\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$info['wp-server']['fields']['memory_limit'] = array(\n\t\t\t\t\t'label' => __( 'PHP memory limit' ),\n\t\t\t\t\t'value' => ini_get( 'memory_limit' ),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$info['wp-server']['fields']['max_input_time']      = array(\n\t\t\t\t'label' => __( 'Max input time' ),\n\t\t\t\t'value' => ini_get( 'max_input_time' ),\n\t\t\t);\n\t\t\t$info['wp-server']['fields']['upload_max_filesize'] = array(\n\t\t\t\t'label' => __( 'Upload max filesize' ),\n\t\t\t\t'value' => ini_get( 'upload_max_filesize' ),\n\t\t\t);\n\t\t\t$info['wp-server']['fields']['php_post_max_size']   = array(\n\t\t\t\t'label' => __( 'PHP post max size' ),\n\t\t\t\t'value' => ini_get( 'post_max_size' ),\n\t\t\t);\n\t\t}\n\n\t\tif ( function_exists( 'curl_version' ) ) {\n\t\t\t$curl = curl_version();\n\n\t\t\t$info['wp-server']['fields']['curl_version'] = array(\n\t\t\t\t'label' => __( 'cURL version' ),\n\t\t\t\t'value' => sprintf( '%s %s', $curl['version'], $curl['ssl_version'] ),\n\t\t\t);\n\t\t} else {\n\t\t\t$info['wp-server']['fields']['curl_version'] = array(\n\t\t\t\t'label' => __( 'cURL version' ),\n\t\t\t\t'value' => $not_available,\n\t\t\t\t'debug' => 'not available',\n\t\t\t);\n\t\t}\n\n\t\t// SUHOSIN.\n\t\t$suhosin_loaded = ( extension_loaded( 'suhosin' ) || ( defined( 'SUHOSIN_PATCH' ) && constant( 'SUHOSIN_PATCH' ) ) );\n\n\t\t$info['wp-server']['fields']['suhosin'] = array(\n\t\t\t'label' => __( 'Is SUHOSIN installed?' ),\n\t\t\t'value' => ( $suhosin_loaded ? __( 'Yes' ) : __( 'No' ) ),\n\t\t\t'debug' => $suhosin_loaded,\n\t\t);\n\n\t\t// Imagick.\n\t\t$imagick_loaded = extension_loaded( 'imagick' );\n\n\t\t$info['wp-server']['fields']['imagick_availability'] = array(\n\t\t\t'label' => __( 'Is the Imagick library available?' ),\n\t\t\t'value' => ( $imagick_loaded ? __( 'Yes' ) : __( 'No' ) ),\n\t\t\t'debug' => $imagick_loaded,\n\t\t);\n\n\t\t// Pretty permalinks.\n\t\t$pretty_permalinks_supported = got_url_rewrite();\n\n\t\t$info['wp-server']['fields']['pretty_permalinks'] = array(\n\t\t\t'label' => __( 'Are pretty permalinks supported?' ),\n\t\t\t'value' => ( $pretty_permalinks_supported ? __( 'Yes' ) : __( 'No' ) ),\n\t\t\t'debug' => $pretty_permalinks_supported,\n\t\t);\n\n\t\t// Check if a .htaccess file exists.\n\t\tif ( is_file( ABSPATH . '.htaccess' ) ) {\n\t\t\t// If the file exists, grab the content of it.\n\t\t\t$htaccess_content = file_get_contents( ABSPATH . '.htaccess' );\n\n\t\t\t// Filter away the core WordPress rules.\n\t\t\t$filtered_htaccess_content = trim( preg_replace( '/\\# BEGIN WordPress[\\s\\S]+?# END WordPress/si', '', $htaccess_content ) );\n\t\t\t$filtered_htaccess_content = ! empty( $filtered_htaccess_content );\n\n\t\t\tif ( $filtered_htaccess_content ) {\n\t\t\t\t/* translators: %s: .htaccess */\n\t\t\t\t$htaccess_rules_string = sprintf( __( 'Custom rules have been added to your %s file.' ), '.htaccess' );\n\t\t\t} else {\n\t\t\t\t/* translators: %s: .htaccess */\n\t\t\t\t$htaccess_rules_string = sprintf( __( 'Your %s file contains only core WordPress features.' ), '.htaccess' );\n\t\t\t}\n\n\t\t\t$info['wp-server']['fields']['htaccess_extra_rules'] = array(\n\t\t\t\t'label' => __( '.htaccess rules' ),\n\t\t\t\t'value' => $htaccess_rules_string,\n\t\t\t\t'debug' => $filtered_htaccess_content,\n\t\t\t);\n\t\t}\n\n\t\t// Populate the database debug fields.\n\t\tif ( is_resource( $wpdb->dbh ) ) {\n\t\t\t// Old mysql extension.\n\t\t\t$extension = 'mysql';\n\t\t} elseif ( is_object( $wpdb->dbh ) ) {\n\t\t\t// mysqli or PDO.\n\t\t\t$extension = get_class( $wpdb->dbh );\n\t\t} else {\n\t\t\t// Unknown sql extension.\n\t\t\t$extension = null;\n\t\t}\n\n\t\t$server = $wpdb->get_var( 'SELECT VERSION()' );\n\n\t\tif ( isset( $wpdb->use_mysqli ) && $wpdb->use_mysqli ) {\n\t\t\t$client_version = $wpdb->dbh->client_info;\n\t\t} else {\n\t\t\t// phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysql_get_client_info,PHPCompatibility.Extensions.RemovedExtensions.mysql_DeprecatedRemoved\n\t\t\tif ( preg_match( '|[0-9]{1,2}\\.[0-9]{1,2}\\.[0-9]{1,2}|', mysql_get_client_info(), $matches ) ) {\n\t\t\t\t$client_version = $matches[0];\n\t\t\t} else {\n\t\t\t\t$client_version = null;\n\t\t\t}\n\t\t}\n\n\t\t$info['wp-database']['fields']['extension'] = array(\n\t\t\t'label' => __( 'Extension' ),\n\t\t\t'value' => $extension,\n\t\t);\n\n\t\t$info['wp-database']['fields']['server_version'] = array(\n\t\t\t'label' => __( 'Server version' ),\n\t\t\t'value' => $server,\n\t\t);\n\n\t\t$info['wp-database']['fields']['client_version'] = array(\n\t\t\t'label' => __( 'Client version' ),\n\t\t\t'value' => $client_version,\n\t\t);\n\n\t\t$info['wp-database']['fields']['database_user'] = array(\n\t\t\t'label'   => __( 'Database username' ),\n\t\t\t'value'   => $wpdb->dbuser,\n\t\t\t'private' => true,\n\t\t);\n\n\t\t$info['wp-database']['fields']['database_host'] = array(\n\t\t\t'label'   => __( 'Database host' ),\n\t\t\t'value'   => $wpdb->dbhost,\n\t\t\t'private' => true,\n\t\t);\n\n\t\t$info['wp-database']['fields']['database_name'] = array(\n\t\t\t'label'   => __( 'Database name' ),\n\t\t\t'value'   => $wpdb->dbname,\n\t\t\t'private' => true,\n\t\t);\n\n\t\t$info['wp-database']['fields']['database_prefix'] = array(\n\t\t\t'label'   => __( 'Table prefix' ),\n\t\t\t'value'   => $wpdb->prefix,\n\t\t\t'private' => true,\n\t\t);\n\n\t\t$info['wp-database']['fields']['database_charset'] = array(\n\t\t\t'label'   => __( 'Database charset' ),\n\t\t\t'value'   => $wpdb->charset,\n\t\t\t'private' => true,\n\t\t);\n\n\t\t$info['wp-database']['fields']['database_collate'] = array(\n\t\t\t'label'   => __( 'Database collation' ),\n\t\t\t'value'   => $wpdb->collate,\n\t\t\t'private' => true,\n\t\t);\n\n\t\t// List must use plugins if there are any.\n\t\t$mu_plugins = get_mu_plugins();\n\n\t\tforeach ( $mu_plugins as $plugin_path => $plugin ) {\n\t\t\t$plugin_version = $plugin['Version'];\n\t\t\t$plugin_author  = $plugin['Author'];\n\n\t\t\t$plugin_version_string       = __( 'No version or author information is available.' );\n\t\t\t$plugin_version_string_debug = 'author: (undefined), version: (undefined)';\n\n\t\t\tif ( ! empty( $plugin_version ) && ! empty( $plugin_author ) ) {\n\t\t\t\t/* translators: 1: Plugin version number. 2: Plugin author name. */\n\t\t\t\t$plugin_version_string       = sprintf( __( 'Version %1$s by %2$s' ), $plugin_version, $plugin_author );\n\t\t\t\t$plugin_version_string_debug = sprintf( 'version: %s, author: %s', $plugin_version, $plugin_author );\n\t\t\t} else {\n\t\t\t\tif ( ! empty( $plugin_author ) ) {\n\t\t\t\t\t/* translators: %s: Plugin author name. */\n\t\t\t\t\t$plugin_version_string       = sprintf( __( 'By %s' ), $plugin_author );\n\t\t\t\t\t$plugin_version_string_debug = sprintf( 'author: %s, version: (undefined)', $plugin_author );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $plugin_version ) ) {\n\t\t\t\t\t/* translators: %s: Plugin version number. */\n\t\t\t\t\t$plugin_version_string       = sprintf( __( 'Version %s' ), $plugin_version );\n\t\t\t\t\t$plugin_version_string_debug = sprintf( 'author: (undefined), version: %s', $plugin_version );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$info['wp-mu-plugins']['fields'][ sanitize_text_field( $plugin['Name'] ) ] = array(\n\t\t\t\t'label' => $plugin['Name'],\n\t\t\t\t'value' => $plugin_version_string,\n\t\t\t\t'debug' => $plugin_version_string_debug,\n\t\t\t);\n\t\t}\n\n\t\t// List all available plugins.\n\t\t$plugins        = get_plugins();\n\t\t$plugin_updates = get_plugin_updates();\n\t\t$transient      = get_site_transient( 'update_plugins' );\n\n\t\t$auto_updates = array();\n\n\t\t$auto_updates_enabled = wp_is_auto_update_enabled_for_type( 'plugin' );\n\n\t\tif ( $auto_updates_enabled ) {\n\t\t\t$auto_updates = (array) get_site_option( 'auto_update_plugins', array() );\n\t\t}\n\n\t\tforeach ( $plugins as $plugin_path => $plugin ) {\n\t\t\t$plugin_part = ( is_plugin_active( $plugin_path ) ) ? 'wp-plugins-active' : 'wp-plugins-inactive';\n\n\t\t\t$plugin_version = $plugin['Version'];\n\t\t\t$plugin_author  = $plugin['Author'];\n\n\t\t\t$plugin_version_string       = __( 'No version or author information is available.' );\n\t\t\t$plugin_version_string_debug = 'author: (undefined), version: (undefined)';\n\n\t\t\tif ( ! empty( $plugin_version ) && ! empty( $plugin_author ) ) {\n\t\t\t\t/* translators: 1: Plugin version number. 2: Plugin author name. */\n\t\t\t\t$plugin_version_string       = sprintf( __( 'Version %1$s by %2$s' ), $plugin_version, $plugin_author );\n\t\t\t\t$plugin_version_string_debug = sprintf( 'version: %s, author: %s', $plugin_version, $plugin_author );\n\t\t\t} else {\n\t\t\t\tif ( ! empty( $plugin_author ) ) {\n\t\t\t\t\t/* translators: %s: Plugin author name. */\n\t\t\t\t\t$plugin_version_string       = sprintf( __( 'By %s' ), $plugin_author );\n\t\t\t\t\t$plugin_version_string_debug = sprintf( 'author: %s, version: (undefined)', $plugin_author );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $plugin_version ) ) {\n\t\t\t\t\t/* translators: %s: Plugin version number. */\n\t\t\t\t\t$plugin_version_string       = sprintf( __( 'Version %s' ), $plugin_version );\n\t\t\t\t\t$plugin_version_string_debug = sprintf( 'author: (undefined), version: %s', $plugin_version );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( array_key_exists( $plugin_path, $plugin_updates ) ) {\n\t\t\t\t/* translators: %s: Latest plugin version number. */\n\t\t\t\t$plugin_version_string       .= ' ' . sprintf( __( '(Latest version: %s)' ), $plugin_updates[ $plugin_path ]->update->new_version );\n\t\t\t\t$plugin_version_string_debug .= sprintf( ' (latest version: %s)', $plugin_updates[ $plugin_path ]->update->new_version );\n\t\t\t}\n\n\t\t\tif ( $auto_updates_enabled ) {\n\t\t\t\tif ( isset( $transient->response[ $plugin_path ] ) ) {\n\t\t\t\t\t$item = $transient->response[ $plugin_path ];\n\t\t\t\t} elseif ( isset( $transient->no_update[ $plugin_path ] ) ) {\n\t\t\t\t\t$item = $transient->no_update[ $plugin_path ];\n\t\t\t\t} else {\n\t\t\t\t\t$item = array(\n\t\t\t\t\t\t'id'            => $plugin_path,\n\t\t\t\t\t\t'slug'          => '',\n\t\t\t\t\t\t'plugin'        => $plugin_path,\n\t\t\t\t\t\t'new_version'   => '',\n\t\t\t\t\t\t'url'           => '',\n\t\t\t\t\t\t'package'       => '',\n\t\t\t\t\t\t'icons'         => array(),\n\t\t\t\t\t\t'banners'       => array(),\n\t\t\t\t\t\t'banners_rtl'   => array(),\n\t\t\t\t\t\t'tested'        => '',\n\t\t\t\t\t\t'requires_php'  => '',\n\t\t\t\t\t\t'compatibility' => new stdClass(),\n\t\t\t\t\t);\n\t\t\t\t\t$item = array_merge( $item, array_intersect_key( $plugin, $item ) );\n\t\t\t\t}\n\n\t\t\t\t$type = 'plugin';\n\t\t\t\t/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */\n\t\t\t\t$auto_update_forced = apply_filters( \"auto_update_{$type}\", null, (object) $item );\n\n\t\t\t\tif ( ! is_null( $auto_update_forced ) ) {\n\t\t\t\t\t$enabled = $auto_update_forced;\n\t\t\t\t} else {\n\t\t\t\t\t$enabled = in_array( $plugin_path, $auto_updates, true );\n\t\t\t\t}\n\n\t\t\t\tif ( $enabled ) {\n\t\t\t\t\t$auto_updates_string = __( 'Auto-updates enabled' );\n\t\t\t\t} else {\n\t\t\t\t\t$auto_updates_string = __( 'Auto-updates disabled' );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Filters the text string of the auto-updates setting for each plugin in the Site Health debug data.\n\t\t\t\t *\n\t\t\t\t * @since 5.5.0\n\t\t\t\t *\n\t\t\t\t * @param string $auto_updates_string The string output for the auto-updates column.\n\t\t\t\t * @param string $plugin_path         The path to the plugin file.\n\t\t\t\t * @param array  $plugin              An array of plugin data.\n\t\t\t\t * @param bool   $enabled             Whether auto-updates are enabled for this item.\n\t\t\t\t */\n\t\t\t\t$auto_updates_string = apply_filters( 'plugin_auto_update_debug_string', $auto_updates_string, $plugin_path, $plugin, $enabled );\n\n\t\t\t\t$plugin_version_string       .= ' | ' . $auto_updates_string;\n\t\t\t\t$plugin_version_string_debug .= ', ' . $auto_updates_string;\n\t\t\t}\n\n\t\t\t$info[ $plugin_part ]['fields'][ sanitize_text_field( $plugin['Name'] ) ] = array(\n\t\t\t\t'label' => $plugin['Name'],\n\t\t\t\t'value' => $plugin_version_string,\n\t\t\t\t'debug' => $plugin_version_string_debug,\n\t\t\t);\n\t\t}\n\n\t\t// Populate the section for the currently active theme.\n\t\tglobal $_wp_theme_features;\n\t\t$theme_features = array();\n\n\t\tif ( ! empty( $_wp_theme_features ) ) {\n\t\t\tforeach ( $_wp_theme_features as $feature => $options ) {\n\t\t\t\t$theme_features[] = $feature;\n\t\t\t}\n\t\t}\n\n\t\t$active_theme  = wp_get_theme();\n\t\t$theme_updates = get_theme_updates();\n\t\t$transient     = get_site_transient( 'update_themes' );\n\n\t\t$active_theme_version       = $active_theme->version;\n\t\t$active_theme_version_debug = $active_theme_version;\n\n\t\t$auto_updates         = array();\n\t\t$auto_updates_enabled = wp_is_auto_update_enabled_for_type( 'theme' );\n\t\tif ( $auto_updates_enabled ) {\n\t\t\t$auto_updates = (array) get_site_option( 'auto_update_themes', array() );\n\t\t}\n\n\t\tif ( array_key_exists( $active_theme->stylesheet, $theme_updates ) ) {\n\t\t\t$theme_update_new_version = $theme_updates[ $active_theme->stylesheet ]->update['new_version'];\n\n\t\t\t/* translators: %s: Latest theme version number. */\n\t\t\t$active_theme_version       .= ' ' . sprintf( __( '(Latest version: %s)' ), $theme_update_new_version );\n\t\t\t$active_theme_version_debug .= sprintf( ' (latest version: %s)', $theme_update_new_version );\n\t\t}\n\n\t\t$active_theme_author_uri = $active_theme->display( 'AuthorURI' );\n\n\t\tif ( $active_theme->parent_theme ) {\n\t\t\t$active_theme_parent_theme = sprintf(\n\t\t\t\t/* translators: 1: Theme name. 2: Theme slug. */\n\t\t\t\t__( '%1$s (%2$s)' ),\n\t\t\t\t$active_theme->parent_theme,\n\t\t\t\t$active_theme->template\n\t\t\t);\n\t\t\t$active_theme_parent_theme_debug = sprintf(\n\t\t\t\t'%s (%s)',\n\t\t\t\t$active_theme->parent_theme,\n\t\t\t\t$active_theme->template\n\t\t\t);\n\t\t} else {\n\t\t\t$active_theme_parent_theme       = __( 'None' );\n\t\t\t$active_theme_parent_theme_debug = 'none';\n\t\t}\n\n\t\t$info['wp-active-theme']['fields'] = array(\n\t\t\t'name'           => array(\n\t\t\t\t'label' => __( 'Name' ),\n\t\t\t\t'value' => sprintf(\n\t\t\t\t\t/* translators: 1: Theme name. 2: Theme slug. */\n\t\t\t\t\t__( '%1$s (%2$s)' ),\n\t\t\t\t\t$active_theme->name,\n\t\t\t\t\t$active_theme->stylesheet\n\t\t\t\t),\n\t\t\t),\n\t\t\t'version'        => array(\n\t\t\t\t'label' => __( 'Version' ),\n\t\t\t\t'value' => $active_theme_version,\n\t\t\t\t'debug' => $active_theme_version_debug,\n\t\t\t),\n\t\t\t'author'         => array(\n\t\t\t\t'label' => __( 'Author' ),\n\t\t\t\t'value' => wp_kses( $active_theme->author, array() ),\n\t\t\t),\n\t\t\t'author_website' => array(\n\t\t\t\t'label' => __( 'Author website' ),\n\t\t\t\t'value' => ( $active_theme_author_uri ? $active_theme_author_uri : __( 'Undefined' ) ),\n\t\t\t\t'debug' => ( $active_theme_author_uri ? $active_theme_author_uri : '(undefined)' ),\n\t\t\t),\n\t\t\t'parent_theme'   => array(\n\t\t\t\t'label' => __( 'Parent theme' ),\n\t\t\t\t'value' => $active_theme_parent_theme,\n\t\t\t\t'debug' => $active_theme_parent_theme_debug,\n\t\t\t),\n\t\t\t'theme_features' => array(\n\t\t\t\t'label' => __( 'Theme features' ),\n\t\t\t\t'value' => implode( ', ', $theme_features ),\n\t\t\t),\n\t\t\t'theme_path'     => array(\n\t\t\t\t'label' => __( 'Theme directory location' ),\n\t\t\t\t'value' => get_stylesheet_directory(),\n\t\t\t),\n\t\t);\n\n\t\tif ( $auto_updates_enabled ) {\n\t\t\tif ( isset( $transient->response[ $active_theme->stylesheet ] ) ) {\n\t\t\t\t$item = $transient->response[ $active_theme->stylesheet ];\n\t\t\t} elseif ( isset( $transient->no_update[ $active_theme->stylesheet ] ) ) {\n\t\t\t\t$item = $transient->no_update[ $active_theme->stylesheet ];\n\t\t\t} else {\n\t\t\t\t$item = array(\n\t\t\t\t\t'theme'        => $active_theme->stylesheet,\n\t\t\t\t\t'new_version'  => $active_theme->version,\n\t\t\t\t\t'url'          => '',\n\t\t\t\t\t'package'      => '',\n\t\t\t\t\t'requires'     => '',\n\t\t\t\t\t'requires_php' => '',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$type = 'theme';\n\t\t\t/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */\n\t\t\t$auto_update_forced = apply_filters( \"auto_update_{$type}\", null, (object) $item );\n\n\t\t\tif ( ! is_null( $auto_update_forced ) ) {\n\t\t\t\t$enabled = $auto_update_forced;\n\t\t\t} else {\n\t\t\t\t$enabled = in_array( $active_theme->stylesheet, $auto_updates, true );\n\t\t\t}\n\n\t\t\tif ( $enabled ) {\n\t\t\t\t$auto_updates_string = __( 'Enabled' );\n\t\t\t} else {\n\t\t\t\t$auto_updates_string = __( 'Disabled' );\n\t\t\t}\n\n\t\t\t/** This filter is documented in wp-admin/includes/class-wp-debug-data.php */\n\t\t\t$auto_updates_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $active_theme, $enabled );\n\n\t\t\t$info['wp-active-theme']['fields']['auto_update'] = array(\n\t\t\t\t'label' => __( 'Auto-updates' ),\n\t\t\t\t'value' => $auto_updates_string,\n\t\t\t\t'debug' => $auto_updates_string,\n\t\t\t);\n\t\t}\n\n\t\t$parent_theme = $active_theme->parent();\n\n\t\tif ( $parent_theme ) {\n\t\t\t$parent_theme_version       = $parent_theme->version;\n\t\t\t$parent_theme_version_debug = $parent_theme_version;\n\n\t\t\tif ( array_key_exists( $parent_theme->stylesheet, $theme_updates ) ) {\n\t\t\t\t$parent_theme_update_new_version = $theme_updates[ $parent_theme->stylesheet ]->update['new_version'];\n\n\t\t\t\t/* translators: %s: Latest theme version number. */\n\t\t\t\t$parent_theme_version       .= ' ' . sprintf( __( '(Latest version: %s)' ), $parent_theme_update_new_version );\n\t\t\t\t$parent_theme_version_debug .= sprintf( ' (latest version: %s)', $parent_theme_update_new_version );\n\t\t\t}\n\n\t\t\t$parent_theme_author_uri = $parent_theme->display( 'AuthorURI' );\n\n\t\t\t$info['wp-parent-theme']['fields'] = array(\n\t\t\t\t'name'           => array(\n\t\t\t\t\t'label' => __( 'Name' ),\n\t\t\t\t\t'value' => sprintf(\n\t\t\t\t\t\t/* translators: 1: Theme name. 2: Theme slug. */\n\t\t\t\t\t\t__( '%1$s (%2$s)' ),\n\t\t\t\t\t\t$parent_theme->name,\n\t\t\t\t\t\t$parent_theme->stylesheet\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'version'        => array(\n\t\t\t\t\t'label' => __( 'Version' ),\n\t\t\t\t\t'value' => $parent_theme_version,\n\t\t\t\t\t'debug' => $parent_theme_version_debug,\n\t\t\t\t),\n\t\t\t\t'author'         => array(\n\t\t\t\t\t'label' => __( 'Author' ),\n\t\t\t\t\t'value' => wp_kses( $parent_theme->author, array() ),\n\t\t\t\t),\n\t\t\t\t'author_website' => array(\n\t\t\t\t\t'label' => __( 'Author website' ),\n\t\t\t\t\t'value' => ( $parent_theme_author_uri ? $parent_theme_author_uri : __( 'Undefined' ) ),\n\t\t\t\t\t'debug' => ( $parent_theme_author_uri ? $parent_theme_author_uri : '(undefined)' ),\n\t\t\t\t),\n\t\t\t\t'theme_path'     => array(\n\t\t\t\t\t'label' => __( 'Theme directory location' ),\n\t\t\t\t\t'value' => get_template_directory(),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\tif ( $auto_updates_enabled ) {\n\t\t\t\tif ( isset( $transient->response[ $parent_theme->stylesheet ] ) ) {\n\t\t\t\t\t$item = $transient->response[ $parent_theme->stylesheet ];\n\t\t\t\t} elseif ( isset( $transient->no_update[ $parent_theme->stylesheet ] ) ) {\n\t\t\t\t\t$item = $transient->no_update[ $parent_theme->stylesheet ];\n\t\t\t\t} else {\n\t\t\t\t\t$item = array(\n\t\t\t\t\t\t'theme'        => $parent_theme->stylesheet,\n\t\t\t\t\t\t'new_version'  => $parent_theme->version,\n\t\t\t\t\t\t'url'          => '',\n\t\t\t\t\t\t'package'      => '',\n\t\t\t\t\t\t'requires'     => '',\n\t\t\t\t\t\t'requires_php' => '',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$type = 'theme';\n\t\t\t\t/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */\n\t\t\t\t$auto_update_forced = apply_filters( \"auto_update_{$type}\", null, (object) $item );\n\n\t\t\t\tif ( ! is_null( $auto_update_forced ) ) {\n\t\t\t\t\t$enabled = $auto_update_forced;\n\t\t\t\t} else {\n\t\t\t\t\t$enabled = in_array( $parent_theme->stylesheet, $auto_updates, true );\n\t\t\t\t}\n\n\t\t\t\tif ( $enabled ) {\n\t\t\t\t\t$parent_theme_auto_update_string = __( 'Enabled' );\n\t\t\t\t} else {\n\t\t\t\t\t$parent_theme_auto_update_string = __( 'Disabled' );\n\t\t\t\t}\n\n\t\t\t\t/** This filter is documented in wp-admin/includes/class-wp-debug-data.php */\n\t\t\t\t$parent_theme_auto_update_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $parent_theme, $enabled );\n\n\t\t\t\t$info['wp-parent-theme']['fields']['auto_update'] = array(\n\t\t\t\t\t'label' => __( 'Auto-update' ),\n\t\t\t\t\t'value' => $parent_theme_auto_update_string,\n\t\t\t\t\t'debug' => $parent_theme_auto_update_string,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Populate a list of all themes available in the install.\n\t\t$all_themes = wp_get_themes();\n\n\t\tforeach ( $all_themes as $theme_slug => $theme ) {\n\t\t\t// Exclude the currently active theme from the list of all themes.\n\t\t\tif ( $active_theme->stylesheet === $theme_slug ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Exclude the currently active parent theme from the list of all themes.\n\t\t\tif ( ! empty( $parent_theme ) && $parent_theme->stylesheet === $theme_slug ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$theme_version = $theme->version;\n\t\t\t$theme_author  = $theme->author;\n\n\t\t\t// Sanitize.\n\t\t\t$theme_author = wp_kses( $theme_author, array() );\n\n\t\t\t$theme_version_string       = __( 'No version or author information is available.' );\n\t\t\t$theme_version_string_debug = 'undefined';\n\n\t\t\tif ( ! empty( $theme_version ) && ! empty( $theme_author ) ) {\n\t\t\t\t/* translators: 1: Theme version number. 2: Theme author name. */\n\t\t\t\t$theme_version_string       = sprintf( __( 'Version %1$s by %2$s' ), $theme_version, $theme_author );\n\t\t\t\t$theme_version_string_debug = sprintf( 'version: %s, author: %s', $theme_version, $theme_author );\n\t\t\t} else {\n\t\t\t\tif ( ! empty( $theme_author ) ) {\n\t\t\t\t\t/* translators: %s: Theme author name. */\n\t\t\t\t\t$theme_version_string       = sprintf( __( 'By %s' ), $theme_author );\n\t\t\t\t\t$theme_version_string_debug = sprintf( 'author: %s, version: (undefined)', $theme_author );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $theme_version ) ) {\n\t\t\t\t\t/* translators: %s: Theme version number. */\n\t\t\t\t\t$theme_version_string       = sprintf( __( 'Version %s' ), $theme_version );\n\t\t\t\t\t$theme_version_string_debug = sprintf( 'author: (undefined), version: %s', $theme_version );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( array_key_exists( $theme_slug, $theme_updates ) ) {\n\t\t\t\t/* translators: %s: Latest theme version number. */\n\t\t\t\t$theme_version_string       .= ' ' . sprintf( __( '(Latest version: %s)' ), $theme_updates[ $theme_slug ]->update['new_version'] );\n\t\t\t\t$theme_version_string_debug .= sprintf( ' (latest version: %s)', $theme_updates[ $theme_slug ]->update['new_version'] );\n\t\t\t}\n\n\t\t\tif ( $auto_updates_enabled ) {\n\t\t\t\tif ( isset( $transient->response[ $theme_slug ] ) ) {\n\t\t\t\t\t$item = $transient->response[ $theme_slug ];\n\t\t\t\t} elseif ( isset( $transient->no_update[ $theme_slug ] ) ) {\n\t\t\t\t\t$item = $transient->no_update[ $theme_slug ];\n\t\t\t\t} else {\n\t\t\t\t\t$item = array(\n\t\t\t\t\t\t'theme'        => $theme_slug,\n\t\t\t\t\t\t'new_version'  => $theme->version,\n\t\t\t\t\t\t'url'          => '',\n\t\t\t\t\t\t'package'      => '',\n\t\t\t\t\t\t'requires'     => '',\n\t\t\t\t\t\t'requires_php' => '',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$type = 'theme';\n\t\t\t\t/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */\n\t\t\t\t$auto_update_forced = apply_filters( \"auto_update_{$type}\", null, (object) $item );\n\n\t\t\t\tif ( ! is_null( $auto_update_forced ) ) {\n\t\t\t\t\t$enabled = $auto_update_forced;\n\t\t\t\t} else {\n\t\t\t\t\t$enabled = in_array( $theme_slug, $auto_updates, true );\n\t\t\t\t}\n\n\t\t\t\tif ( $enabled ) {\n\t\t\t\t\t$auto_updates_string = __( 'Auto-updates enabled' );\n\t\t\t\t} else {\n\t\t\t\t\t$auto_updates_string = __( 'Auto-updates disabled' );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Filters the text string of the auto-updates setting for each theme in the Site Health debug data.\n\t\t\t\t *\n\t\t\t\t * @since 5.5.0\n\t\t\t\t *\n\t\t\t\t * @param string   $auto_updates_string The string output for the auto-updates column.\n\t\t\t\t * @param WP_Theme $theme               An object of theme data.\n\t\t\t\t * @param bool     $enabled             Whether auto-updates are enabled for this item.\n\t\t\t\t */\n\t\t\t\t$auto_updates_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $theme, $enabled );\n\n\t\t\t\t$theme_version_string       .= ' | ' . $auto_updates_string;\n\t\t\t\t$theme_version_string_debug .= ',' . $auto_updates_string;\n\t\t\t}\n\n\t\t\t$info['wp-themes-inactive']['fields'][ sanitize_text_field( $theme->name ) ] = array(\n\t\t\t\t'label' => sprintf(\n\t\t\t\t\t/* translators: 1: Theme name. 2: Theme slug. */\n\t\t\t\t\t__( '%1$s (%2$s)' ),\n\t\t\t\t\t$theme->name,\n\t\t\t\t\t$theme_slug\n\t\t\t\t),\n\t\t\t\t'value' => $theme_version_string,\n\t\t\t\t'debug' => $theme_version_string_debug,\n\t\t\t);\n\t\t}\n\n\t\t// Add more filesystem checks.\n\t\tif ( defined( 'WPMU_PLUGIN_DIR' ) && is_dir( WPMU_PLUGIN_DIR ) ) {\n\t\t\t$is_writable_wpmu_plugin_dir = wp_is_writable( WPMU_PLUGIN_DIR );\n\n\t\t\t$info['wp-filesystem']['fields']['mu-plugins'] = array(\n\t\t\t\t'label' => __( 'The must use plugins directory' ),\n\t\t\t\t'value' => ( $is_writable_wpmu_plugin_dir ? __( 'Writable' ) : __( 'Not writable' ) ),\n\t\t\t\t'debug' => ( $is_writable_wpmu_plugin_dir ? 'writable' : 'not writable' ),\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Add or modify the debug information.\n\t\t *\n\t\t * Plugin or themes may wish to introduce their own debug information without creating additional admin pages\n\t\t * they can utilize this filter to introduce their own sections or add more data to existing sections.\n\t\t *\n\t\t * Array keys for sections added by core are all prefixed with `wp-`, plugins and themes should use their own slug as\n\t\t * a prefix, both for consistency as well as avoiding key collisions. Note that the array keys are used as labels\n\t\t * for the copied data.\n\t\t *\n\t\t * All strings are expected to be plain text except $description that can contain inline HTML tags (see below).\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param array $args {\n\t\t *     The debug information to be added to the core information page.\n\t\t *\n\t\t *     This is an associative multi-dimensional array, up to three levels deep. The topmost array holds the sections.\n\t\t *     Each section has a `$fields` associative array (see below), and each `$value` in `$fields` can be\n\t\t *     another associative array of name/value pairs when there is more structured data to display.\n\t\t *\n\t\t *     @type string  $label        The title for this section of the debug output.\n\t\t *     @type string  $description  Optional. A description for your information section which may contain basic HTML\n\t\t *                                 markup, inline tags only as it is outputted in a paragraph.\n\t\t *     @type boolean $show_count   Optional. If set to `true` the amount of fields will be included in the title for\n\t\t *                                 this section.\n\t\t *     @type boolean $private      Optional. If set to `true` the section and all associated fields will be excluded\n\t\t *                                 from the copied data.\n\t\t *     @type array   $fields {\n\t\t *         An associative array containing the data to be displayed.\n\t\t *\n\t\t *         @type string  $label    The label for this piece of information.\n\t\t *         @type string  $value    The output that is displayed for this field. Text should be translated. Can be\n\t\t *                                 an associative array that is displayed as name/value pairs.\n\t\t *         @type string  $debug    Optional. The output that is used for this field when the user copies the data.\n\t\t *                                 It should be more concise and not translated. If not set, the content of `$value` is used.\n\t\t *                                 Note that the array keys are used as labels for the copied data.\n\t\t *         @type boolean $private  Optional. If set to `true` the field will not be included in the copied data\n\t\t *                                 allowing you to show, for example, API keys here.\n\t\t *     }\n\t\t * }\n\t\t */\n\t\t$info = apply_filters( 'debug_information', $info );\n\n\t\treturn $info;\n\t}\n\n\t/**\n\t * Format the information gathered for debugging, in a manner suitable for copying to a forum or support ticket.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param array  $info_array Information gathered from the `WP_Debug_Data::debug_data` function.\n\t * @param string $type       The data type to return, either 'info' or 'debug'.\n\t * @return string The formatted data.\n\t */\n\tpublic static function format( $info_array, $type ) {\n\t\t$return = \"`\\n\";\n\n\t\tforeach ( $info_array as $section => $details ) {\n\t\t\t// Skip this section if there are no fields, or the section has been declared as private.\n\t\t\tif ( empty( $details['fields'] ) || ( isset( $details['private'] ) && $details['private'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$section_label = 'debug' === $type ? $section : $details['label'];\n\n\t\t\t$return .= sprintf(\n\t\t\t\t\"### %s%s ###\\n\\n\",\n\t\t\t\t$section_label,\n\t\t\t\t( isset( $details['show_count'] ) && $details['show_count'] ? sprintf( ' (%d)', count( $details['fields'] ) ) : '' )\n\t\t\t);\n\n\t\t\tforeach ( $details['fields'] as $field_name => $field ) {\n\t\t\t\tif ( isset( $field['private'] ) && true === $field['private'] ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( 'debug' === $type && isset( $field['debug'] ) ) {\n\t\t\t\t\t$debug_data = $field['debug'];\n\t\t\t\t} else {\n\t\t\t\t\t$debug_data = $field['value'];\n\t\t\t\t}\n\n\t\t\t\t// Can be array, one level deep only.\n\t\t\t\tif ( is_array( $debug_data ) ) {\n\t\t\t\t\t$value = '';\n\n\t\t\t\t\tforeach ( $debug_data as $sub_field_name => $sub_field_value ) {\n\t\t\t\t\t\t$value .= sprintf( \"\\n\\t%s: %s\", $sub_field_name, $sub_field_value );\n\t\t\t\t\t}\n\t\t\t\t} elseif ( is_bool( $debug_data ) ) {\n\t\t\t\t\t$value = $debug_data ? 'true' : 'false';\n\t\t\t\t} elseif ( empty( $debug_data ) && '0' !== $debug_data ) {\n\t\t\t\t\t$value = 'undefined';\n\t\t\t\t} else {\n\t\t\t\t\t$value = $debug_data;\n\t\t\t\t}\n\n\t\t\t\tif ( 'debug' === $type ) {\n\t\t\t\t\t$label = $field_name;\n\t\t\t\t} else {\n\t\t\t\t\t$label = $field['label'];\n\t\t\t\t}\n\n\t\t\t\t$return .= sprintf( \"%s: %s\\n\", $label, $value );\n\t\t\t}\n\n\t\t\t$return .= \"\\n\";\n\t\t}\n\n\t\t$return .= '`';\n\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Fetch the total size of all the database tables for the active database user.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return int The size of the database, in bytes.\n\t */\n\tpublic static function get_database_size() {\n\t\tglobal $wpdb;\n\t\t$size = 0;\n\t\t$rows = $wpdb->get_results( 'SHOW TABLE STATUS', ARRAY_A );\n\n\t\tif ( $wpdb->num_rows > 0 ) {\n\t\t\tforeach ( $rows as $row ) {\n\t\t\t\t$size += $row['Data_length'] + $row['Index_length'];\n\t\t\t}\n\t\t}\n\n\t\treturn (int) $size;\n\t}\n\n\t/**\n\t * Fetch the sizes of the WordPress directories: `wordpress` (ABSPATH), `plugins`, `themes`, and `uploads`.\n\t * Intended to supplement the array returned by `WP_Debug_Data::debug_data()`.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The sizes of the directories, also the database size and total installation size.\n\t */\n\tpublic static function get_sizes() {\n\t\t$size_db    = self::get_database_size();\n\t\t$upload_dir = wp_get_upload_dir();\n\n\t\t/*\n\t\t * We will be using the PHP max execution time to prevent the size calculations\n\t\t * from causing a timeout. The default value is 30 seconds, and some\n\t\t * hosts do not allow you to read configuration values.\n\t\t */\n\t\tif ( function_exists( 'ini_get' ) ) {\n\t\t\t$max_execution_time = ini_get( 'max_execution_time' );\n\t\t}\n\n\t\t// The max_execution_time defaults to 0 when PHP runs from cli.\n\t\t// We still want to limit it below.\n\t\tif ( empty( $max_execution_time ) ) {\n\t\t\t$max_execution_time = 30;\n\t\t}\n\n\t\tif ( $max_execution_time > 20 ) {\n\t\t\t// If the max_execution_time is set to lower than 20 seconds, reduce it a bit to prevent\n\t\t\t// edge-case timeouts that may happen after the size loop has finished running.\n\t\t\t$max_execution_time -= 2;\n\t\t}\n\n\t\t// Go through the various installation directories and calculate their sizes.\n\t\t// No trailing slashes.\n\t\t$paths = array(\n\t\t\t'wordpress_size' => untrailingslashit( ABSPATH ),\n\t\t\t'themes_size'    => get_theme_root(),\n\t\t\t'plugins_size'   => WP_PLUGIN_DIR,\n\t\t\t'uploads_size'   => $upload_dir['basedir'],\n\t\t);\n\n\t\t$exclude = $paths;\n\t\tunset( $exclude['wordpress_size'] );\n\t\t$exclude = array_values( $exclude );\n\n\t\t$size_total = 0;\n\t\t$all_sizes  = array();\n\n\t\t// Loop over all the directories we want to gather the sizes for.\n\t\tforeach ( $paths as $name => $path ) {\n\t\t\t$dir_size = null; // Default to timeout.\n\t\t\t$results  = array(\n\t\t\t\t'path' => $path,\n\t\t\t\t'raw'  => 0,\n\t\t\t);\n\n\t\t\tif ( microtime( true ) - WP_START_TIMESTAMP < $max_execution_time ) {\n\t\t\t\tif ( 'wordpress_size' === $name ) {\n\t\t\t\t\t$dir_size = recurse_dirsize( $path, $exclude, $max_execution_time );\n\t\t\t\t} else {\n\t\t\t\t\t$dir_size = recurse_dirsize( $path, null, $max_execution_time );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( false === $dir_size ) {\n\t\t\t\t// Error reading.\n\t\t\t\t$results['size']  = __( 'The size cannot be calculated. The directory is not accessible. Usually caused by invalid permissions.' );\n\t\t\t\t$results['debug'] = 'not accessible';\n\n\t\t\t\t// Stop total size calculation.\n\t\t\t\t$size_total = null;\n\t\t\t} elseif ( null === $dir_size ) {\n\t\t\t\t// Timeout.\n\t\t\t\t$results['size']  = __( 'The directory size calculation has timed out. Usually caused by a very large number of sub-directories and files.' );\n\t\t\t\t$results['debug'] = 'timeout while calculating size';\n\n\t\t\t\t// Stop total size calculation.\n\t\t\t\t$size_total = null;\n\t\t\t} else {\n\t\t\t\tif ( null !== $size_total ) {\n\t\t\t\t\t$size_total += $dir_size;\n\t\t\t\t}\n\n\t\t\t\t$results['raw']   = $dir_size;\n\t\t\t\t$results['size']  = size_format( $dir_size, 2 );\n\t\t\t\t$results['debug'] = $results['size'] . \" ({$dir_size} bytes)\";\n\t\t\t}\n\n\t\t\t$all_sizes[ $name ] = $results;\n\t\t}\n\n\t\tif ( $size_db > 0 ) {\n\t\t\t$database_size = size_format( $size_db, 2 );\n\n\t\t\t$all_sizes['database_size'] = array(\n\t\t\t\t'raw'   => $size_db,\n\t\t\t\t'size'  => $database_size,\n\t\t\t\t'debug' => $database_size . \" ({$size_db} bytes)\",\n\t\t\t);\n\t\t} else {\n\t\t\t$all_sizes['database_size'] = array(\n\t\t\t\t'size'  => __( 'Not available' ),\n\t\t\t\t'debug' => 'not available',\n\t\t\t);\n\t\t}\n\n\t\tif ( null !== $size_total && $size_db > 0 ) {\n\t\t\t$total_size    = $size_total + $size_db;\n\t\t\t$total_size_mb = size_format( $total_size, 2 );\n\n\t\t\t$all_sizes['total_size'] = array(\n\t\t\t\t'raw'   => $total_size,\n\t\t\t\t'size'  => $total_size_mb,\n\t\t\t\t'debug' => $total_size_mb . \" ({$total_size} bytes)\",\n\t\t\t);\n\t\t} else {\n\t\t\t$all_sizes['total_size'] = array(\n\t\t\t\t'size'  => __( 'Total size is not available. Some errors were encountered when determining the size of your installation.' ),\n\t\t\t\t'debug' => 'not available',\n\t\t\t);\n\t\t}\n\n\t\treturn $all_sizes;\n\t}\n}\n", "num_lines": 1619}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Base WordPress Filesystem\n *\n * @package WordPress\n * @subpackage Filesystem\n */\n\n/**\n * Base WordPress Filesystem class which Filesystem implementations extend.\n *\n * @since 2.5.0\n */\nclass WP_Filesystem_Base {\n\n\t/**\n\t * Whether to display debug data for the connection.\n\t *\n\t * @since 2.5.0\n\t * @var bool\n\t */\n\tpublic $verbose = false;\n\n\t/**\n\t * Cached list of local filepaths to mapped remote filepaths.\n\t *\n\t * @since 2.7.0\n\t * @var array\n\t */\n\tpublic $cache = array();\n\n\t/**\n\t * The Access method of the current connection, Set automatically.\n\t *\n\t * @since 2.5.0\n\t * @var string\n\t */\n\tpublic $method = '';\n\n\t/**\n\t * @var WP_Error\n\t */\n\tpublic $errors = null;\n\n\t/**\n\t */\n\tpublic $options = array();\n\n\t/**\n\t * Returns the path on the remote filesystem of ABSPATH.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @return string The location of the remote path.\n\t */\n\tpublic function abspath() {\n\t\t$folder = $this->find_folder( ABSPATH );\n\n\t\t// Perhaps the FTP folder is rooted at the WordPress install.\n\t\t// Check for wp-includes folder in root. Could have some false positives, but rare.\n\t\tif ( ! $folder && $this->is_dir( '/' . WPINC ) ) {\n\t\t\t$folder = '/';\n\t\t}\n\n\t\treturn $folder;\n\t}\n\n\t/**\n\t * Returns the path on the remote filesystem of WP_CONTENT_DIR.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @return string The location of the remote path.\n\t */\n\tpublic function wp_content_dir() {\n\t\treturn $this->find_folder( WP_CONTENT_DIR );\n\t}\n\n\t/**\n\t * Returns the path on the remote filesystem of WP_PLUGIN_DIR.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @return string The location of the remote path.\n\t */\n\tpublic function wp_plugins_dir() {\n\t\treturn $this->find_folder( WP_PLUGIN_DIR );\n\t}\n\n\t/**\n\t * Returns the path on the remote filesystem of the Themes Directory.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string|false $theme Optional. The theme stylesheet or template for the directory.\n\t *                            Default false.\n\t * @return string The location of the remote path.\n\t */\n\tpublic function wp_themes_dir( $theme = false ) {\n\t\t$theme_root = get_theme_root( $theme );\n\n\t\t// Account for relative theme roots.\n\t\tif ( '/themes' === $theme_root || ! is_dir( $theme_root ) ) {\n\t\t\t$theme_root = WP_CONTENT_DIR . $theme_root;\n\t\t}\n\n\t\treturn $this->find_folder( $theme_root );\n\t}\n\n\t/**\n\t * Returns the path on the remote filesystem of WP_LANG_DIR.\n\t *\n\t * @since 3.2.0\n\t *\n\t * @return string The location of the remote path.\n\t */\n\tpublic function wp_lang_dir() {\n\t\treturn $this->find_folder( WP_LANG_DIR );\n\t}\n\n\t/**\n\t * Locates a folder on the remote filesystem.\n\t *\n\t * @since 2.5.0\n\t * @deprecated 2.7.0 use WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir() instead.\n\t * @see WP_Filesystem::abspath()\n\t * @see WP_Filesystem::wp_content_dir()\n\t * @see WP_Filesystem::wp_plugins_dir()\n\t * @see WP_Filesystem::wp_themes_dir()\n\t * @see WP_Filesystem::wp_lang_dir()\n\t *\n\t * @param string $base The folder to start searching from.\n\t * @param bool   $echo True to display debug information.\n\t *                     Default false.\n\t * @return string The location of the remote path.\n\t */\n\tpublic function find_base_dir( $base = '.', $echo = false ) {\n\t\t_deprecated_function( __FUNCTION__, '2.7.0', 'WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir()' );\n\t\t$this->verbose = $echo;\n\t\treturn $this->abspath();\n\t}\n\n\t/**\n\t * Locates a folder on the remote filesystem.\n\t *\n\t * @since 2.5.0\n\t * @deprecated 2.7.0 use WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir() methods instead.\n\t * @see WP_Filesystem::abspath()\n\t * @see WP_Filesystem::wp_content_dir()\n\t * @see WP_Filesystem::wp_plugins_dir()\n\t * @see WP_Filesystem::wp_themes_dir()\n\t * @see WP_Filesystem::wp_lang_dir()\n\t *\n\t * @param string $base The folder to start searching from.\n\t * @param bool   $echo True to display debug information.\n\t * @return string The location of the remote path.\n\t */\n\tpublic function get_base_dir( $base = '.', $echo = false ) {\n\t\t_deprecated_function( __FUNCTION__, '2.7.0', 'WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir()' );\n\t\t$this->verbose = $echo;\n\t\treturn $this->abspath();\n\t}\n\n\t/**\n\t * Locates a folder on the remote filesystem.\n\t *\n\t * Assumes that on Windows systems, Stripping off the Drive\n\t * letter is OK Sanitizes \\\\ to / in Windows filepaths.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $folder the folder to locate.\n\t * @return string|false The location of the remote path, false on failure.\n\t */\n\tpublic function find_folder( $folder ) {\n\t\tif ( isset( $this->cache[ $folder ] ) ) {\n\t\t\treturn $this->cache[ $folder ];\n\t\t}\n\n\t\tif ( stripos( $this->method, 'ftp' ) !== false ) {\n\t\t\t$constant_overrides = array(\n\t\t\t\t'FTP_BASE'        => ABSPATH,\n\t\t\t\t'FTP_CONTENT_DIR' => WP_CONTENT_DIR,\n\t\t\t\t'FTP_PLUGIN_DIR'  => WP_PLUGIN_DIR,\n\t\t\t\t'FTP_LANG_DIR'    => WP_LANG_DIR,\n\t\t\t);\n\n\t\t\t// Direct matches ( folder = CONSTANT/ ).\n\t\t\tforeach ( $constant_overrides as $constant => $dir ) {\n\t\t\t\tif ( ! defined( $constant ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( $folder === $dir ) {\n\t\t\t\t\treturn trailingslashit( constant( $constant ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Prefix matches ( folder = CONSTANT/subdir ),\n\t\t\tforeach ( $constant_overrides as $constant => $dir ) {\n\t\t\t\tif ( ! defined( $constant ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( 0 === stripos( $folder, $dir ) ) { // $folder starts with $dir.\n\t\t\t\t\t$potential_folder = preg_replace( '#^' . preg_quote( $dir, '#' ) . '/#i', trailingslashit( constant( $constant ) ), $folder );\n\t\t\t\t\t$potential_folder = trailingslashit( $potential_folder );\n\n\t\t\t\t\tif ( $this->is_dir( $potential_folder ) ) {\n\t\t\t\t\t\t$this->cache[ $folder ] = $potential_folder;\n\n\t\t\t\t\t\treturn $potential_folder;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( 'direct' === $this->method ) {\n\t\t\t$folder = str_replace( '\\\\', '/', $folder ); // Windows path sanitisation.\n\n\t\t\treturn trailingslashit( $folder );\n\t\t}\n\n\t\t$folder = preg_replace( '|^([a-z]{1}):|i', '', $folder ); // Strip out Windows drive letter if it's there.\n\t\t$folder = str_replace( '\\\\', '/', $folder ); // Windows path sanitisation.\n\n\t\tif ( isset( $this->cache[ $folder ] ) ) {\n\t\t\treturn $this->cache[ $folder ];\n\t\t}\n\n\t\tif ( $this->exists( $folder ) ) { // Folder exists at that absolute path.\n\t\t\t$folder                 = trailingslashit( $folder );\n\t\t\t$this->cache[ $folder ] = $folder;\n\n\t\t\treturn $folder;\n\t\t}\n\n\t\t$return = $this->search_for_folder( $folder );\n\n\t\tif ( $return ) {\n\t\t\t$this->cache[ $folder ] = $return;\n\t\t}\n\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Locates a folder on the remote filesystem.\n\t *\n\t * Expects Windows sanitized path.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $folder The folder to locate.\n\t * @param string $base   The folder to start searching from.\n\t * @param bool   $loop   If the function has recursed. Internal use only.\n\t * @return string|false The location of the remote path, false to cease looping.\n\t */\n\tpublic function search_for_folder( $folder, $base = '.', $loop = false ) {\n\t\tif ( empty( $base ) || '.' === $base ) {\n\t\t\t$base = trailingslashit( $this->cwd() );\n\t\t}\n\n\t\t$folder = untrailingslashit( $folder );\n\n\t\tif ( $this->verbose ) {\n\t\t\t/* translators: 1: Folder to locate, 2: Folder to start searching from. */\n\t\t\tprintf( \"\\n\" . __( 'Looking for %1$s in %2$s' ) . \"<br/>\\n\", $folder, $base );\n\t\t}\n\n\t\t$folder_parts     = explode( '/', $folder );\n\t\t$folder_part_keys = array_keys( $folder_parts );\n\t\t$last_index       = array_pop( $folder_part_keys );\n\t\t$last_path        = $folder_parts[ $last_index ];\n\n\t\t$files = $this->dirlist( $base );\n\n\t\tforeach ( $folder_parts as $index => $key ) {\n\t\t\tif ( $index == $last_index ) {\n\t\t\t\tcontinue; // We want this to be caught by the next code block.\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Working from /home/ to /user/ to /wordpress/ see if that file exists within\n\t\t\t * the current folder, If it's found, change into it and follow through looking\n\t\t\t * for it. If it can't find WordPress down that route, it'll continue onto the next\n\t\t\t * folder level, and see if that matches, and so on. If it reaches the end, and still\n\t\t\t * can't find it, it'll return false for the entire function.\n\t\t\t */\n\t\t\tif ( isset( $files[ $key ] ) ) {\n\n\t\t\t\t// Let's try that folder:\n\t\t\t\t$newdir = trailingslashit( path_join( $base, $key ) );\n\n\t\t\t\tif ( $this->verbose ) {\n\t\t\t\t\t/* translators: %s: Directory name. */\n\t\t\t\t\tprintf( \"\\n\" . __( 'Changing to %s' ) . \"<br/>\\n\", $newdir );\n\t\t\t\t}\n\n\t\t\t\t// Only search for the remaining path tokens in the directory, not the full path again.\n\t\t\t\t$newfolder = implode( '/', array_slice( $folder_parts, $index + 1 ) );\n\t\t\t\t$ret       = $this->search_for_folder( $newfolder, $newdir, $loop );\n\n\t\t\t\tif ( $ret ) {\n\t\t\t\t\treturn $ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Only check this as a last resort, to prevent locating the incorrect install.\n\t\t// All above procedures will fail quickly if this is the right branch to take.\n\t\tif ( isset( $files[ $last_path ] ) ) {\n\t\t\tif ( $this->verbose ) {\n\t\t\t\t/* translators: %s: Directory name. */\n\t\t\t\tprintf( \"\\n\" . __( 'Found %s' ) . \"<br/>\\n\", $base . $last_path );\n\t\t\t}\n\n\t\t\treturn trailingslashit( $base . $last_path );\n\t\t}\n\n\t\t// Prevent this function from looping again.\n\t\t// No need to proceed if we've just searched in `/`.\n\t\tif ( $loop || '/' === $base ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// As an extra last resort, Change back to / if the folder wasn't found.\n\t\t// This comes into effect when the CWD is /home/user/ but WP is at /var/www/....\n\t\treturn $this->search_for_folder( $folder, '/', true );\n\n\t}\n\n\t/**\n\t * Returns the *nix-style file permissions for a file.\n\t *\n\t * From the PHP documentation page for fileperms().\n\t *\n\t * @link https://www.php.net/manual/en/function.fileperms.php\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file String filename.\n\t * @return string The *nix-style representation of permissions.\n\t */\n\tpublic function gethchmod( $file ) {\n\t\t$perms = intval( $this->getchmod( $file ), 8 );\n\n\t\tif ( ( $perms & 0xC000 ) == 0xC000 ) { // Socket.\n\t\t\t$info = 's';\n\t\t} elseif ( ( $perms & 0xA000 ) == 0xA000 ) { // Symbolic Link.\n\t\t\t$info = 'l';\n\t\t} elseif ( ( $perms & 0x8000 ) == 0x8000 ) { // Regular.\n\t\t\t$info = '-';\n\t\t} elseif ( ( $perms & 0x6000 ) == 0x6000 ) { // Block special.\n\t\t\t$info = 'b';\n\t\t} elseif ( ( $perms & 0x4000 ) == 0x4000 ) { // Directory.\n\t\t\t$info = 'd';\n\t\t} elseif ( ( $perms & 0x2000 ) == 0x2000 ) { // Character special.\n\t\t\t$info = 'c';\n\t\t} elseif ( ( $perms & 0x1000 ) == 0x1000 ) { // FIFO pipe.\n\t\t\t$info = 'p';\n\t\t} else { // Unknown.\n\t\t\t$info = 'u';\n\t\t}\n\n\t\t// Owner.\n\t\t$info .= ( ( $perms & 0x0100 ) ? 'r' : '-' );\n\t\t$info .= ( ( $perms & 0x0080 ) ? 'w' : '-' );\n\t\t$info .= ( ( $perms & 0x0040 ) ?\n\t\t\t\t\t( ( $perms & 0x0800 ) ? 's' : 'x' ) :\n\t\t\t\t\t( ( $perms & 0x0800 ) ? 'S' : '-' ) );\n\n\t\t// Group.\n\t\t$info .= ( ( $perms & 0x0020 ) ? 'r' : '-' );\n\t\t$info .= ( ( $perms & 0x0010 ) ? 'w' : '-' );\n\t\t$info .= ( ( $perms & 0x0008 ) ?\n\t\t\t\t\t( ( $perms & 0x0400 ) ? 's' : 'x' ) :\n\t\t\t\t\t( ( $perms & 0x0400 ) ? 'S' : '-' ) );\n\n\t\t// World.\n\t\t$info .= ( ( $perms & 0x0004 ) ? 'r' : '-' );\n\t\t$info .= ( ( $perms & 0x0002 ) ? 'w' : '-' );\n\t\t$info .= ( ( $perms & 0x0001 ) ?\n\t\t\t\t\t( ( $perms & 0x0200 ) ? 't' : 'x' ) :\n\t\t\t\t\t( ( $perms & 0x0200 ) ? 'T' : '-' ) );\n\n\t\treturn $info;\n\t}\n\n\t/**\n\t * Gets the permissions of the specified file or filepath in their octal format.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return string Mode of the file (the last 3 digits).\n\t */\n\tpublic function getchmod( $file ) {\n\t\treturn '777';\n\t}\n\n\t/**\n\t * Converts *nix-style file permissions to a octal number.\n\t *\n\t * Converts '-rw-r--r--' to 0644\n\t * From \"info at rvgate dot nl\"'s comment on the PHP documentation for chmod()\n\t *\n\t * @link https://www.php.net/manual/en/function.chmod.php#49614\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $mode string The *nix-style file permission.\n\t * @return int octal representation\n\t */\n\tpublic function getnumchmodfromh( $mode ) {\n\t\t$realmode = '';\n\t\t$legal    = array( '', 'w', 'r', 'x', '-' );\n\t\t$attarray = preg_split( '//', $mode );\n\n\t\tfor ( $i = 0, $c = count( $attarray ); $i < $c; $i++ ) {\n\t\t\t$key = array_search( $attarray[ $i ], $legal, true );\n\n\t\t\tif ( $key ) {\n\t\t\t\t$realmode .= $legal[ $key ];\n\t\t\t}\n\t\t}\n\n\t\t$mode  = str_pad( $realmode, 10, '-', STR_PAD_LEFT );\n\t\t$trans = array(\n\t\t\t'-' => '0',\n\t\t\t'r' => '4',\n\t\t\t'w' => '2',\n\t\t\t'x' => '1',\n\t\t);\n\t\t$mode  = strtr( $mode, $trans );\n\n\t\t$newmode  = $mode[0];\n\t\t$newmode .= $mode[1] + $mode[2] + $mode[3];\n\t\t$newmode .= $mode[4] + $mode[5] + $mode[6];\n\t\t$newmode .= $mode[7] + $mode[8] + $mode[9];\n\n\t\treturn $newmode;\n\t}\n\n\t/**\n\t * Determines if the string provided contains binary characters.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $text String to test against.\n\t * @return bool True if string is binary, false otherwise.\n\t */\n\tpublic function is_binary( $text ) {\n\t\treturn (bool) preg_match( '|[^\\x20-\\x7E]|', $text ); // chr(32)..chr(127)\n\t}\n\n\t/**\n\t * Changes the owner of a file or directory.\n\t *\n\t * Default behavior is to do nothing, override this in your subclass, if desired.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string     $file      Path to the file or directory.\n\t * @param string|int $owner     A user name or number.\n\t * @param bool       $recursive Optional. If set to true, changes file owner recursively.\n\t *                              Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function chown( $file, $owner, $recursive = false ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Connects filesystem.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @return bool True on success, false on failure (always true for WP_Filesystem_Direct).\n\t */\n\tpublic function connect() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Reads entire file into a string.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $file Name of the file to read.\n\t * @return string|false Read data on success, false on failure.\n\t */\n\tpublic function get_contents( $file ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Reads entire file into an array.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $file Path to the file.\n\t * @return array|false File contents in an array on success, false on failure.\n\t */\n\tpublic function get_contents_array( $file ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Writes a string to a file.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string    $file     Remote path to the file where to write the data.\n\t * @param string    $contents The data to write.\n\t * @param int|false $mode     Optional. The file permissions as octal number, usually 0644.\n\t *                            Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function put_contents( $file, $contents, $mode = false ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Gets the current working directory.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @return string|false The current working directory on success, false on failure.\n\t */\n\tpublic function cwd() {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Changes current directory.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $dir The new current directory.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function chdir( $dir ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Changes the file group.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string     $file      Path to the file.\n\t * @param string|int $group     A group name or number.\n\t * @param bool       $recursive Optional. If set to true, changes file group recursively.\n\t *                              Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function chgrp( $file, $group, $recursive = false ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Changes filesystem permissions.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string    $file      Path to the file.\n\t * @param int|false $mode      Optional. The permissions as octal number, usually 0644 for files,\n\t *                             0755 for directories. Default false.\n\t * @param bool      $recursive Optional. If set to true, changes file permissions recursively.\n\t *                             Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function chmod( $file, $mode = false, $recursive = false ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Gets the file owner.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $file Path to the file.\n\t * @return string|false Username of the owner on success, false on failure.\n\t */\n\tpublic function owner( $file ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Gets the file's group.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $file Path to the file.\n\t * @return string|false The group on success, false on failure.\n\t */\n\tpublic function group( $file ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Copies a file.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string    $source      Path to the source file.\n\t * @param string    $destination Path to the destination file.\n\t * @param bool      $overwrite   Optional. Whether to overwrite the destination file if it exists.\n\t *                               Default false.\n\t * @param int|false $mode        Optional. The permissions as octal number, usually 0644 for files,\n\t *                               0755 for dirs. Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function copy( $source, $destination, $overwrite = false, $mode = false ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Moves a file.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $source      Path to the source file.\n\t * @param string $destination Path to the destination file.\n\t * @param bool   $overwrite   Optional. Whether to overwrite the destination file if it exists.\n\t *                            Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function move( $source, $destination, $overwrite = false ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Deletes a file or directory.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string       $file      Path to the file or directory.\n\t * @param bool         $recursive Optional. If set to true, deletes files and folders recursively.\n\t *                                Default false.\n\t * @param string|false $type      Type of resource. 'f' for file, 'd' for directory.\n\t *                                Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function delete( $file, $recursive = false, $type = false ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks if a file or directory exists.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $file Path to file or directory.\n\t * @return bool Whether $file exists or not.\n\t */\n\tpublic function exists( $file ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks if resource is a file.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $file File path.\n\t * @return bool Whether $file is a file.\n\t */\n\tpublic function is_file( $file ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks if resource is a directory.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $path Directory path.\n\t * @return bool Whether $path is a directory.\n\t */\n\tpublic function is_dir( $path ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks if a file is readable.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $file Path to file.\n\t * @return bool Whether $file is readable.\n\t */\n\tpublic function is_readable( $file ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks if a file or directory is writable.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $file Path to file or directory.\n\t * @return bool Whether $file is writable.\n\t */\n\tpublic function is_writable( $file ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Gets the file's last access time.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $file Path to file.\n\t * @return int|false Unix timestamp representing last access time, false on failure.\n\t */\n\tpublic function atime( $file ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Gets the file modification time.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $file Path to file.\n\t * @return int|false Unix timestamp representing modification time, false on failure.\n\t */\n\tpublic function mtime( $file ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Gets the file size (in bytes).\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $file Path to file.\n\t * @return int|false Size of the file in bytes on success, false on failure.\n\t */\n\tpublic function size( $file ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Sets the access and modification times of a file.\n\t *\n\t * Note: If $file doesn't exist, it will be created.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $file  Path to file.\n\t * @param int    $time  Optional. Modified time to set for file.\n\t *                      Default 0.\n\t * @param int    $atime Optional. Access time to set for file.\n\t *                      Default 0.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function touch( $file, $time = 0, $atime = 0 ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Creates a directory.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string     $path  Path for new directory.\n\t * @param int|false  $chmod Optional. The permissions as octal number (or false to skip chmod).\n\t *                          Default false.\n\t * @param string|int $chown Optional. A user name or number (or false to skip chown).\n\t *                          Default false.\n\t * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp).\n\t *                          Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Deletes a directory.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $path      Path to directory.\n\t * @param bool   $recursive Optional. Whether to recursively remove files/directories.\n\t *                          Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function rmdir( $path, $recursive = false ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Gets details for files in a directory or a specific file.\n\t *\n\t * @since 2.5.0\n\t * @abstract\n\t *\n\t * @param string $path           Path to directory or file.\n\t * @param bool   $include_hidden Optional. Whether to include details of hidden (\".\" prefixed) files.\n\t *                               Default true.\n\t * @param bool   $recursive      Optional. Whether to recursively include file details in nested directories.\n\t *                               Default false.\n\t * @return array|false {\n\t *     Array of files. False if unable to list directory contents.\n\t *\n\t *     @type string $name        Name of the file or directory.\n\t *     @type string $perms       *nix representation of permissions.\n\t *     @type int    $permsn      Octal representation of permissions.\n\t *     @type string $owner       Owner name or ID.\n\t *     @type int    $size        Size of file in bytes.\n\t *     @type int    $lastmodunix Last modified unix timestamp.\n\t *     @type mixed  $lastmod     Last modified month (3 letter) and day (without leading 0).\n\t *     @type int    $time        Last modified time.\n\t *     @type string $type        Type of resource. 'f' for file, 'd' for directory.\n\t *     @type mixed  $files       If a directory and $recursive is true, contains another array of files.\n\t * }\n\t */\n\tpublic function dirlist( $path, $include_hidden = true, $recursive = false ) {\n\t\treturn false;\n\t}\n\n}\n", "num_lines": 849}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Direct Filesystem.\n *\n * @package WordPress\n * @subpackage Filesystem\n */\n\n/**\n * WordPress Filesystem Class for direct PHP file and folder manipulation.\n *\n * @since 2.5.0\n *\n * @see WP_Filesystem_Base\n */\nclass WP_Filesystem_Direct extends WP_Filesystem_Base {\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param mixed $arg Not used.\n\t */\n\tpublic function __construct( $arg ) {\n\t\t$this->method = 'direct';\n\t\t$this->errors = new WP_Error();\n\t}\n\n\t/**\n\t * Reads entire file into a string.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Name of the file to read.\n\t * @return string|false Read data on success, false on failure.\n\t */\n\tpublic function get_contents( $file ) {\n\t\treturn @file_get_contents( $file );\n\t}\n\n\t/**\n\t * Reads entire file into an array.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return array|false File contents in an array on success, false on failure.\n\t */\n\tpublic function get_contents_array( $file ) {\n\t\treturn @file( $file );\n\t}\n\n\t/**\n\t * Writes a string to a file.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string    $file     Remote path to the file where to write the data.\n\t * @param string    $contents The data to write.\n\t * @param int|false $mode     Optional. The file permissions as octal number, usually 0644.\n\t *                            Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function put_contents( $file, $contents, $mode = false ) {\n\t\t$fp = @fopen( $file, 'wb' );\n\n\t\tif ( ! $fp ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tmbstring_binary_safe_encoding();\n\n\t\t$data_length = strlen( $contents );\n\n\t\t$bytes_written = fwrite( $fp, $contents );\n\n\t\treset_mbstring_encoding();\n\n\t\tfclose( $fp );\n\n\t\tif ( $data_length !== $bytes_written ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->chmod( $file, $mode );\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Gets the current working directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @return string|false The current working directory on success, false on failure.\n\t */\n\tpublic function cwd() {\n\t\treturn getcwd();\n\t}\n\n\t/**\n\t * Changes current directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $dir The new current directory.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function chdir( $dir ) {\n\t\treturn @chdir( $dir );\n\t}\n\n\t/**\n\t * Changes the file group.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string     $file      Path to the file.\n\t * @param string|int $group     A group name or number.\n\t * @param bool       $recursive Optional. If set to true, changes file group recursively.\n\t *                              Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function chgrp( $file, $group, $recursive = false ) {\n\t\tif ( ! $this->exists( $file ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $recursive ) {\n\t\t\treturn chgrp( $file, $group );\n\t\t}\n\n\t\tif ( ! $this->is_dir( $file ) ) {\n\t\t\treturn chgrp( $file, $group );\n\t\t}\n\n\t\t// Is a directory, and we want recursive.\n\t\t$file     = trailingslashit( $file );\n\t\t$filelist = $this->dirlist( $file );\n\n\t\tforeach ( $filelist as $filename ) {\n\t\t\t$this->chgrp( $file . $filename, $group, $recursive );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Changes filesystem permissions.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string    $file      Path to the file.\n\t * @param int|false $mode      Optional. The permissions as octal number, usually 0644 for files,\n\t *                             0755 for directories. Default false.\n\t * @param bool      $recursive Optional. If set to true, changes file permissions recursively.\n\t *                             Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function chmod( $file, $mode = false, $recursive = false ) {\n\t\tif ( ! $mode ) {\n\t\t\tif ( $this->is_file( $file ) ) {\n\t\t\t\t$mode = FS_CHMOD_FILE;\n\t\t\t} elseif ( $this->is_dir( $file ) ) {\n\t\t\t\t$mode = FS_CHMOD_DIR;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $recursive || ! $this->is_dir( $file ) ) {\n\t\t\treturn chmod( $file, $mode );\n\t\t}\n\n\t\t// Is a directory, and we want recursive.\n\t\t$file     = trailingslashit( $file );\n\t\t$filelist = $this->dirlist( $file );\n\n\t\tforeach ( (array) $filelist as $filename => $filemeta ) {\n\t\t\t$this->chmod( $file . $filename, $mode, $recursive );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Changes the owner of a file or directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string     $file      Path to the file or directory.\n\t * @param string|int $owner     A user name or number.\n\t * @param bool       $recursive Optional. If set to true, changes file owner recursively.\n\t *                              Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function chown( $file, $owner, $recursive = false ) {\n\t\tif ( ! $this->exists( $file ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $recursive ) {\n\t\t\treturn chown( $file, $owner );\n\t\t}\n\n\t\tif ( ! $this->is_dir( $file ) ) {\n\t\t\treturn chown( $file, $owner );\n\t\t}\n\n\t\t// Is a directory, and we want recursive.\n\t\t$filelist = $this->dirlist( $file );\n\n\t\tforeach ( $filelist as $filename ) {\n\t\t\t$this->chown( $file . '/' . $filename, $owner, $recursive );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Gets the file owner.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return string|false Username of the owner on success, false on failure.\n\t */\n\tpublic function owner( $file ) {\n\t\t$owneruid = @fileowner( $file );\n\n\t\tif ( ! $owneruid ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! function_exists( 'posix_getpwuid' ) ) {\n\t\t\treturn $owneruid;\n\t\t}\n\n\t\t$ownerarray = posix_getpwuid( $owneruid );\n\n\t\tif ( ! $ownerarray ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $ownerarray['name'];\n\t}\n\n\t/**\n\t * Gets the permissions of the specified file or filepath in their octal format.\n\t *\n\t * FIXME does not handle errors in fileperms()\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return string Mode of the file (the last 3 digits).\n\t */\n\tpublic function getchmod( $file ) {\n\t\treturn substr( decoct( @fileperms( $file ) ), -3 );\n\t}\n\n\t/**\n\t * Gets the file's group.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return string|false The group on success, false on failure.\n\t */\n\tpublic function group( $file ) {\n\t\t$gid = @filegroup( $file );\n\n\t\tif ( ! $gid ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! function_exists( 'posix_getgrgid' ) ) {\n\t\t\treturn $gid;\n\t\t}\n\n\t\t$grouparray = posix_getgrgid( $gid );\n\n\t\tif ( ! $grouparray ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $grouparray['name'];\n\t}\n\n\t/**\n\t * Copies a file.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string    $source      Path to the source file.\n\t * @param string    $destination Path to the destination file.\n\t * @param bool      $overwrite   Optional. Whether to overwrite the destination file if it exists.\n\t *                               Default false.\n\t * @param int|false $mode        Optional. The permissions as octal number, usually 0644 for files,\n\t *                               0755 for dirs. Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function copy( $source, $destination, $overwrite = false, $mode = false ) {\n\t\tif ( ! $overwrite && $this->exists( $destination ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$rtval = copy( $source, $destination );\n\n\t\tif ( $mode ) {\n\t\t\t$this->chmod( $destination, $mode );\n\t\t}\n\n\t\treturn $rtval;\n\t}\n\n\t/**\n\t * Moves a file.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $source      Path to the source file.\n\t * @param string $destination Path to the destination file.\n\t * @param bool   $overwrite   Optional. Whether to overwrite the destination file if it exists.\n\t *                            Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function move( $source, $destination, $overwrite = false ) {\n\t\tif ( ! $overwrite && $this->exists( $destination ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Try using rename first. if that fails (for example, source is read only) try copy.\n\t\tif ( @rename( $source, $destination ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( $this->copy( $source, $destination, $overwrite ) && $this->exists( $destination ) ) {\n\t\t\t$this->delete( $source );\n\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Deletes a file or directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string       $file      Path to the file or directory.\n\t * @param bool         $recursive Optional. If set to true, deletes files and folders recursively.\n\t *                                Default false.\n\t * @param string|false $type      Type of resource. 'f' for file, 'd' for directory.\n\t *                                Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function delete( $file, $recursive = false, $type = false ) {\n\t\tif ( empty( $file ) ) {\n\t\t\t// Some filesystems report this as /, which can cause non-expected recursive deletion of all files in the filesystem.\n\t\t\treturn false;\n\t\t}\n\n\t\t$file = str_replace( '\\\\', '/', $file ); // For Win32, occasional problems deleting files otherwise.\n\n\t\tif ( 'f' === $type || $this->is_file( $file ) ) {\n\t\t\treturn @unlink( $file );\n\t\t}\n\n\t\tif ( ! $recursive && $this->is_dir( $file ) ) {\n\t\t\treturn @rmdir( $file );\n\t\t}\n\n\t\t// At this point it's a folder, and we're in recursive mode.\n\t\t$file     = trailingslashit( $file );\n\t\t$filelist = $this->dirlist( $file, true );\n\n\t\t$retval = true;\n\n\t\tif ( is_array( $filelist ) ) {\n\t\t\tforeach ( $filelist as $filename => $fileinfo ) {\n\t\t\t\tif ( ! $this->delete( $file . $filename, $recursive, $fileinfo['type'] ) ) {\n\t\t\t\t\t$retval = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( file_exists( $file ) && ! @rmdir( $file ) ) {\n\t\t\t$retval = false;\n\t\t}\n\n\t\treturn $retval;\n\t}\n\n\t/**\n\t * Checks if a file or directory exists.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file or directory.\n\t * @return bool Whether $file exists or not.\n\t */\n\tpublic function exists( $file ) {\n\t\treturn @file_exists( $file );\n\t}\n\n\t/**\n\t * Checks if resource is a file.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file File path.\n\t * @return bool Whether $file is a file.\n\t */\n\tpublic function is_file( $file ) {\n\t\treturn @is_file( $file );\n\t}\n\n\t/**\n\t * Checks if resource is a directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $path Directory path.\n\t * @return bool Whether $path is a directory.\n\t */\n\tpublic function is_dir( $path ) {\n\t\treturn @is_dir( $path );\n\t}\n\n\t/**\n\t * Checks if a file is readable.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file.\n\t * @return bool Whether $file is readable.\n\t */\n\tpublic function is_readable( $file ) {\n\t\treturn @is_readable( $file );\n\t}\n\n\t/**\n\t * Checks if a file or directory is writable.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file or directory.\n\t * @return bool Whether $file is writable.\n\t */\n\tpublic function is_writable( $file ) {\n\t\treturn @is_writable( $file );\n\t}\n\n\t/**\n\t * Gets the file's last access time.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file.\n\t * @return int|false Unix timestamp representing last access time, false on failure.\n\t */\n\tpublic function atime( $file ) {\n\t\treturn @fileatime( $file );\n\t}\n\n\t/**\n\t * Gets the file modification time.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file.\n\t * @return int|false Unix timestamp representing modification time, false on failure.\n\t */\n\tpublic function mtime( $file ) {\n\t\treturn @filemtime( $file );\n\t}\n\n\t/**\n\t * Gets the file size (in bytes).\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file.\n\t * @return int|false Size of the file in bytes on success, false on failure.\n\t */\n\tpublic function size( $file ) {\n\t\treturn @filesize( $file );\n\t}\n\n\t/**\n\t * Sets the access and modification times of a file.\n\t *\n\t * Note: If $file doesn't exist, it will be created.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file  Path to file.\n\t * @param int    $time  Optional. Modified time to set for file.\n\t *                      Default 0.\n\t * @param int    $atime Optional. Access time to set for file.\n\t *                      Default 0.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function touch( $file, $time = 0, $atime = 0 ) {\n\t\tif ( 0 == $time ) {\n\t\t\t$time = time();\n\t\t}\n\n\t\tif ( 0 == $atime ) {\n\t\t\t$atime = time();\n\t\t}\n\n\t\treturn touch( $file, $time, $atime );\n\t}\n\n\t/**\n\t * Creates a directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string     $path  Path for new directory.\n\t * @param int|false  $chmod Optional. The permissions as octal number (or false to skip chmod).\n\t *                          Default false.\n\t * @param string|int $chown Optional. A user name or number (or false to skip chown).\n\t *                          Default false.\n\t * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp).\n\t *                          Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {\n\t\t// Safe mode fails with a trailing slash under certain PHP versions.\n\t\t$path = untrailingslashit( $path );\n\n\t\tif ( empty( $path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $chmod ) {\n\t\t\t$chmod = FS_CHMOD_DIR;\n\t\t}\n\n\t\tif ( ! @mkdir( $path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->chmod( $path, $chmod );\n\n\t\tif ( $chown ) {\n\t\t\t$this->chown( $path, $chown );\n\t\t}\n\n\t\tif ( $chgrp ) {\n\t\t\t$this->chgrp( $path, $chgrp );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Deletes a directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $path      Path to directory.\n\t * @param bool   $recursive Optional. Whether to recursively remove files/directories.\n\t *                          Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function rmdir( $path, $recursive = false ) {\n\t\treturn $this->delete( $path, $recursive );\n\t}\n\n\t/**\n\t * Gets details for files in a directory or a specific file.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $path           Path to directory or file.\n\t * @param bool   $include_hidden Optional. Whether to include details of hidden (\".\" prefixed) files.\n\t *                               Default true.\n\t * @param bool   $recursive      Optional. Whether to recursively include file details in nested directories.\n\t *                               Default false.\n\t * @return array|false {\n\t *     Array of files. False if unable to list directory contents.\n\t *\n\t *     @type string $name        Name of the file or directory.\n\t *     @type string $perms       *nix representation of permissions.\n\t *     @type int    $permsn      Octal representation of permissions.\n\t *     @type string $owner       Owner name or ID.\n\t *     @type int    $size        Size of file in bytes.\n\t *     @type int    $lastmodunix Last modified unix timestamp.\n\t *     @type mixed  $lastmod     Last modified month (3 letter) and day (without leading 0).\n\t *     @type int    $time        Last modified time.\n\t *     @type string $type        Type of resource. 'f' for file, 'd' for directory.\n\t *     @type mixed  $files       If a directory and $recursive is true, contains another array of files.\n\t * }\n\t */\n\tpublic function dirlist( $path, $include_hidden = true, $recursive = false ) {\n\t\tif ( $this->is_file( $path ) ) {\n\t\t\t$limit_file = basename( $path );\n\t\t\t$path       = dirname( $path );\n\t\t} else {\n\t\t\t$limit_file = false;\n\t\t}\n\n\t\tif ( ! $this->is_dir( $path ) || ! $this->is_readable( $path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$dir = dir( $path );\n\n\t\tif ( ! $dir ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$ret = array();\n\n\t\twhile ( false !== ( $entry = $dir->read() ) ) {\n\t\t\t$struc         = array();\n\t\t\t$struc['name'] = $entry;\n\n\t\t\tif ( '.' === $struc['name'] || '..' === $struc['name'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! $include_hidden && '.' === $struc['name'][0] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $limit_file && $struc['name'] != $limit_file ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$struc['perms']       = $this->gethchmod( $path . '/' . $entry );\n\t\t\t$struc['permsn']      = $this->getnumchmodfromh( $struc['perms'] );\n\t\t\t$struc['number']      = false;\n\t\t\t$struc['owner']       = $this->owner( $path . '/' . $entry );\n\t\t\t$struc['group']       = $this->group( $path . '/' . $entry );\n\t\t\t$struc['size']        = $this->size( $path . '/' . $entry );\n\t\t\t$struc['lastmodunix'] = $this->mtime( $path . '/' . $entry );\n\t\t\t$struc['lastmod']     = gmdate( 'M j', $struc['lastmodunix'] );\n\t\t\t$struc['time']        = gmdate( 'h:i:s', $struc['lastmodunix'] );\n\t\t\t$struc['type']        = $this->is_dir( $path . '/' . $entry ) ? 'd' : 'f';\n\n\t\t\tif ( 'd' === $struc['type'] ) {\n\t\t\t\tif ( $recursive ) {\n\t\t\t\t\t$struc['files'] = $this->dirlist( $path . '/' . $struc['name'], $include_hidden, $recursive );\n\t\t\t\t} else {\n\t\t\t\t\t$struc['files'] = array();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$ret[ $struc['name'] ] = $struc;\n\t\t}\n\n\t\t$dir->close();\n\t\tunset( $dir );\n\n\t\treturn $ret;\n\t}\n}\n", "num_lines": 665}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress FTP Filesystem.\n *\n * @package WordPress\n * @subpackage Filesystem\n */\n\n/**\n * WordPress Filesystem Class for implementing FTP.\n *\n * @since 2.5.0\n *\n * @see WP_Filesystem_Base\n */\nclass WP_Filesystem_FTPext extends WP_Filesystem_Base {\n\n\t/**\n\t * @since 2.5.0\n\t * @var resource\n\t */\n\tpublic $link;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param array $opt\n\t */\n\tpublic function __construct( $opt = '' ) {\n\t\t$this->method = 'ftpext';\n\t\t$this->errors = new WP_Error();\n\n\t\t// Check if possible to use ftp functions.\n\t\tif ( ! extension_loaded( 'ftp' ) ) {\n\t\t\t$this->errors->add( 'no_ftp_ext', __( 'The ftp PHP extension is not available' ) );\n\t\t\treturn;\n\t\t}\n\n\t\t// This class uses the timeout on a per-connection basis, others use it on a per-action basis.\n\t\tif ( ! defined( 'FS_TIMEOUT' ) ) {\n\t\t\tdefine( 'FS_TIMEOUT', 240 );\n\t\t}\n\n\t\tif ( empty( $opt['port'] ) ) {\n\t\t\t$this->options['port'] = 21;\n\t\t} else {\n\t\t\t$this->options['port'] = $opt['port'];\n\t\t}\n\n\t\tif ( empty( $opt['hostname'] ) ) {\n\t\t\t$this->errors->add( 'empty_hostname', __( 'FTP hostname is required' ) );\n\t\t} else {\n\t\t\t$this->options['hostname'] = $opt['hostname'];\n\t\t}\n\n\t\t// Check if the options provided are OK.\n\t\tif ( empty( $opt['username'] ) ) {\n\t\t\t$this->errors->add( 'empty_username', __( 'FTP username is required' ) );\n\t\t} else {\n\t\t\t$this->options['username'] = $opt['username'];\n\t\t}\n\n\t\tif ( empty( $opt['password'] ) ) {\n\t\t\t$this->errors->add( 'empty_password', __( 'FTP password is required' ) );\n\t\t} else {\n\t\t\t$this->options['password'] = $opt['password'];\n\t\t}\n\n\t\t$this->options['ssl'] = false;\n\n\t\tif ( isset( $opt['connection_type'] ) && 'ftps' === $opt['connection_type'] ) {\n\t\t\t$this->options['ssl'] = true;\n\t\t}\n\t}\n\n\t/**\n\t * Connects filesystem.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function connect() {\n\t\tif ( isset( $this->options['ssl'] ) && $this->options['ssl'] && function_exists( 'ftp_ssl_connect' ) ) {\n\t\t\t$this->link = @ftp_ssl_connect( $this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT );\n\t\t} else {\n\t\t\t$this->link = @ftp_connect( $this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT );\n\t\t}\n\n\t\tif ( ! $this->link ) {\n\t\t\t$this->errors->add(\n\t\t\t\t'connect',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: hostname:port */\n\t\t\t\t\t__( 'Failed to connect to FTP Server %s' ),\n\t\t\t\t\t$this->options['hostname'] . ':' . $this->options['port']\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! @ftp_login( $this->link, $this->options['username'], $this->options['password'] ) ) {\n\t\t\t$this->errors->add(\n\t\t\t\t'auth',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Username. */\n\t\t\t\t\t__( 'Username/Password incorrect for %s' ),\n\t\t\t\t\t$this->options['username']\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Set the connection to use Passive FTP.\n\t\tftp_pasv( $this->link, true );\n\n\t\tif ( @ftp_get_option( $this->link, FTP_TIMEOUT_SEC ) < FS_TIMEOUT ) {\n\t\t\t@ftp_set_option( $this->link, FTP_TIMEOUT_SEC, FS_TIMEOUT );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Reads entire file into a string.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Name of the file to read.\n\t * @return string|false Read data on success, false if no temporary file could be opened,\n\t *                      or if the file couldn't be retrieved.\n\t */\n\tpublic function get_contents( $file ) {\n\t\t$tempfile   = wp_tempnam( $file );\n\t\t$temphandle = fopen( $tempfile, 'w+' );\n\n\t\tif ( ! $temphandle ) {\n\t\t\tunlink( $tempfile );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! ftp_fget( $this->link, $temphandle, $file, FTP_BINARY ) ) {\n\t\t\tfclose( $temphandle );\n\t\t\tunlink( $tempfile );\n\t\t\treturn false;\n\t\t}\n\n\t\tfseek( $temphandle, 0 ); // Skip back to the start of the file being written to.\n\t\t$contents = '';\n\n\t\twhile ( ! feof( $temphandle ) ) {\n\t\t\t$contents .= fread( $temphandle, 8 * KB_IN_BYTES );\n\t\t}\n\n\t\tfclose( $temphandle );\n\t\tunlink( $tempfile );\n\n\t\treturn $contents;\n\t}\n\n\t/**\n\t * Reads entire file into an array.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return array|false File contents in an array on success, false on failure.\n\t */\n\tpublic function get_contents_array( $file ) {\n\t\treturn explode( \"\\n\", $this->get_contents( $file ) );\n\t}\n\n\t/**\n\t * Writes a string to a file.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string    $file     Remote path to the file where to write the data.\n\t * @param string    $contents The data to write.\n\t * @param int|false $mode     Optional. The file permissions as octal number, usually 0644.\n\t *                            Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function put_contents( $file, $contents, $mode = false ) {\n\t\t$tempfile   = wp_tempnam( $file );\n\t\t$temphandle = fopen( $tempfile, 'wb+' );\n\n\t\tif ( ! $temphandle ) {\n\t\t\tunlink( $tempfile );\n\t\t\treturn false;\n\t\t}\n\n\t\tmbstring_binary_safe_encoding();\n\n\t\t$data_length   = strlen( $contents );\n\t\t$bytes_written = fwrite( $temphandle, $contents );\n\n\t\treset_mbstring_encoding();\n\n\t\tif ( $data_length !== $bytes_written ) {\n\t\t\tfclose( $temphandle );\n\t\t\tunlink( $tempfile );\n\t\t\treturn false;\n\t\t}\n\n\t\tfseek( $temphandle, 0 ); // Skip back to the start of the file being written to.\n\n\t\t$ret = ftp_fput( $this->link, $file, $temphandle, FTP_BINARY );\n\n\t\tfclose( $temphandle );\n\t\tunlink( $tempfile );\n\n\t\t$this->chmod( $file, $mode );\n\n\t\treturn $ret;\n\t}\n\n\t/**\n\t * Gets the current working directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @return string|false The current working directory on success, false on failure.\n\t */\n\tpublic function cwd() {\n\t\t$cwd = ftp_pwd( $this->link );\n\n\t\tif ( $cwd ) {\n\t\t\t$cwd = trailingslashit( $cwd );\n\t\t}\n\n\t\treturn $cwd;\n\t}\n\n\t/**\n\t * Changes current directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $dir The new current directory.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function chdir( $dir ) {\n\t\treturn @ftp_chdir( $this->link, $dir );\n\t}\n\n\t/**\n\t * Changes filesystem permissions.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string    $file      Path to the file.\n\t * @param int|false $mode      Optional. The permissions as octal number, usually 0644 for files,\n\t *                             0755 for directories. Default false.\n\t * @param bool      $recursive Optional. If set to true, changes file permissions recursively.\n\t *                             Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function chmod( $file, $mode = false, $recursive = false ) {\n\t\tif ( ! $mode ) {\n\t\t\tif ( $this->is_file( $file ) ) {\n\t\t\t\t$mode = FS_CHMOD_FILE;\n\t\t\t} elseif ( $this->is_dir( $file ) ) {\n\t\t\t\t$mode = FS_CHMOD_DIR;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// chmod any sub-objects if recursive.\n\t\tif ( $recursive && $this->is_dir( $file ) ) {\n\t\t\t$filelist = $this->dirlist( $file );\n\n\t\t\tforeach ( (array) $filelist as $filename => $filemeta ) {\n\t\t\t\t$this->chmod( $file . '/' . $filename, $mode, $recursive );\n\t\t\t}\n\t\t}\n\n\t\t// chmod the file or directory.\n\t\tif ( ! function_exists( 'ftp_chmod' ) ) {\n\t\t\treturn (bool) ftp_site( $this->link, sprintf( 'CHMOD %o %s', $mode, $file ) );\n\t\t}\n\n\t\treturn (bool) ftp_chmod( $this->link, $mode, $file );\n\t}\n\n\t/**\n\t * Gets the file owner.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return string|false Username of the owner on success, false on failure.\n\t */\n\tpublic function owner( $file ) {\n\t\t$dir = $this->dirlist( $file );\n\n\t\treturn $dir[ $file ]['owner'];\n\t}\n\n\t/**\n\t * Gets the permissions of the specified file or filepath in their octal format.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return string Mode of the file (the last 3 digits).\n\t */\n\tpublic function getchmod( $file ) {\n\t\t$dir = $this->dirlist( $file );\n\n\t\treturn $dir[ $file ]['permsn'];\n\t}\n\n\t/**\n\t * Gets the file's group.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return string|false The group on success, false on failure.\n\t */\n\tpublic function group( $file ) {\n\t\t$dir = $this->dirlist( $file );\n\n\t\treturn $dir[ $file ]['group'];\n\t}\n\n\t/**\n\t * Copies a file.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string    $source      Path to the source file.\n\t * @param string    $destination Path to the destination file.\n\t * @param bool      $overwrite   Optional. Whether to overwrite the destination file if it exists.\n\t *                               Default false.\n\t * @param int|false $mode        Optional. The permissions as octal number, usually 0644 for files,\n\t *                               0755 for dirs. Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function copy( $source, $destination, $overwrite = false, $mode = false ) {\n\t\tif ( ! $overwrite && $this->exists( $destination ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$content = $this->get_contents( $source );\n\n\t\tif ( false === $content ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->put_contents( $destination, $content, $mode );\n\t}\n\n\t/**\n\t * Moves a file.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $source      Path to the source file.\n\t * @param string $destination Path to the destination file.\n\t * @param bool   $overwrite   Optional. Whether to overwrite the destination file if it exists.\n\t *                            Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function move( $source, $destination, $overwrite = false ) {\n\t\treturn ftp_rename( $this->link, $source, $destination );\n\t}\n\n\t/**\n\t * Deletes a file or directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string       $file      Path to the file or directory.\n\t * @param bool         $recursive Optional. If set to true, deletes files and folders recursively.\n\t *                                Default false.\n\t * @param string|false $type      Type of resource. 'f' for file, 'd' for directory.\n\t *                                Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function delete( $file, $recursive = false, $type = false ) {\n\t\tif ( empty( $file ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( 'f' === $type || $this->is_file( $file ) ) {\n\t\t\treturn ftp_delete( $this->link, $file );\n\t\t}\n\n\t\tif ( ! $recursive ) {\n\t\t\treturn ftp_rmdir( $this->link, $file );\n\t\t}\n\n\t\t$filelist = $this->dirlist( trailingslashit( $file ) );\n\n\t\tif ( ! empty( $filelist ) ) {\n\t\t\tforeach ( $filelist as $delete_file ) {\n\t\t\t\t$this->delete( trailingslashit( $file ) . $delete_file['name'], $recursive, $delete_file['type'] );\n\t\t\t}\n\t\t}\n\n\t\treturn ftp_rmdir( $this->link, $file );\n\t}\n\n\t/**\n\t * Checks if a file or directory exists.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file or directory.\n\t * @return bool Whether $file exists or not.\n\t */\n\tpublic function exists( $file ) {\n\t\t$list = ftp_nlist( $this->link, $file );\n\n\t\tif ( empty( $list ) && $this->is_dir( $file ) ) {\n\t\t\treturn true; // File is an empty directory.\n\t\t}\n\n\t\treturn ! empty( $list ); // Empty list = no file, so invert.\n\t}\n\n\t/**\n\t * Checks if resource is a file.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file File path.\n\t * @return bool Whether $file is a file.\n\t */\n\tpublic function is_file( $file ) {\n\t\treturn $this->exists( $file ) && ! $this->is_dir( $file );\n\t}\n\n\t/**\n\t * Checks if resource is a directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $path Directory path.\n\t * @return bool Whether $path is a directory.\n\t */\n\tpublic function is_dir( $path ) {\n\t\t$cwd    = $this->cwd();\n\t\t$result = @ftp_chdir( $this->link, trailingslashit( $path ) );\n\n\t\tif ( $result && $path == $this->cwd() || $this->cwd() != $cwd ) {\n\t\t\t@ftp_chdir( $this->link, $cwd );\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks if a file is readable.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file.\n\t * @return bool Whether $file is readable.\n\t */\n\tpublic function is_readable( $file ) {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks if a file or directory is writable.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file or directory.\n\t * @return bool Whether $file is writable.\n\t */\n\tpublic function is_writable( $file ) {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Gets the file's last access time.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file.\n\t * @return int|false Unix timestamp representing last access time, false on failure.\n\t */\n\tpublic function atime( $file ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Gets the file modification time.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file.\n\t * @return int|false Unix timestamp representing modification time, false on failure.\n\t */\n\tpublic function mtime( $file ) {\n\t\treturn ftp_mdtm( $this->link, $file );\n\t}\n\n\t/**\n\t * Gets the file size (in bytes).\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file.\n\t * @return int|false Size of the file in bytes on success, false on failure.\n\t */\n\tpublic function size( $file ) {\n\t\treturn ftp_size( $this->link, $file );\n\t}\n\n\t/**\n\t * Sets the access and modification times of a file.\n\t *\n\t * Note: If $file doesn't exist, it will be created.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file  Path to file.\n\t * @param int    $time  Optional. Modified time to set for file.\n\t *                      Default 0.\n\t * @param int    $atime Optional. Access time to set for file.\n\t *                      Default 0.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function touch( $file, $time = 0, $atime = 0 ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Creates a directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string     $path  Path for new directory.\n\t * @param int|false  $chmod Optional. The permissions as octal number (or false to skip chmod).\n\t *                          Default false.\n\t * @param string|int $chown Optional. A user name or number (or false to skip chown).\n\t *                          Default false.\n\t * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp).\n\t *                          Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {\n\t\t$path = untrailingslashit( $path );\n\n\t\tif ( empty( $path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! ftp_mkdir( $this->link, $path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->chmod( $path, $chmod );\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Deletes a directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $path      Path to directory.\n\t * @param bool   $recursive Optional. Whether to recursively remove files/directories.\n\t *                          Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function rmdir( $path, $recursive = false ) {\n\t\treturn $this->delete( $path, $recursive );\n\t}\n\n\t/**\n\t * @param string $line\n\t * @return array\n\t */\n\tpublic function parselisting( $line ) {\n\t\tstatic $is_windows = null;\n\n\t\tif ( is_null( $is_windows ) ) {\n\t\t\t$is_windows = stripos( ftp_systype( $this->link ), 'win' ) !== false;\n\t\t}\n\n\t\tif ( $is_windows && preg_match( '/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/', $line, $lucifer ) ) {\n\t\t\t$b = array();\n\n\t\t\tif ( $lucifer[3] < 70 ) {\n\t\t\t\t$lucifer[3] += 2000;\n\t\t\t} else {\n\t\t\t\t$lucifer[3] += 1900; // 4-digit year fix.\n\t\t\t}\n\n\t\t\t$b['isdir'] = ( '<DIR>' === $lucifer[7] );\n\n\t\t\tif ( $b['isdir'] ) {\n\t\t\t\t$b['type'] = 'd';\n\t\t\t} else {\n\t\t\t\t$b['type'] = 'f';\n\t\t\t}\n\n\t\t\t$b['size']   = $lucifer[7];\n\t\t\t$b['month']  = $lucifer[1];\n\t\t\t$b['day']    = $lucifer[2];\n\t\t\t$b['year']   = $lucifer[3];\n\t\t\t$b['hour']   = $lucifer[4];\n\t\t\t$b['minute'] = $lucifer[5];\n\t\t\t$b['time']   = mktime( $lucifer[4] + ( strcasecmp( $lucifer[6], 'PM' ) == 0 ? 12 : 0 ), $lucifer[5], 0, $lucifer[1], $lucifer[2], $lucifer[3] );\n\t\t\t$b['am/pm']  = $lucifer[6];\n\t\t\t$b['name']   = $lucifer[8];\n\t\t} elseif ( ! $is_windows ) {\n\t\t\t$lucifer = preg_split( '/[ ]/', $line, 9, PREG_SPLIT_NO_EMPTY );\n\n\t\t\tif ( $lucifer ) {\n\t\t\t\t// echo $line.\"\\n\";\n\t\t\t\t$lcount = count( $lucifer );\n\n\t\t\t\tif ( $lcount < 8 ) {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\n\t\t\t\t$b           = array();\n\t\t\t\t$b['isdir']  = 'd' === $lucifer[0][0];\n\t\t\t\t$b['islink'] = 'l' === $lucifer[0][0];\n\n\t\t\t\tif ( $b['isdir'] ) {\n\t\t\t\t\t$b['type'] = 'd';\n\t\t\t\t} elseif ( $b['islink'] ) {\n\t\t\t\t\t$b['type'] = 'l';\n\t\t\t\t} else {\n\t\t\t\t\t$b['type'] = 'f';\n\t\t\t\t}\n\n\t\t\t\t$b['perms']  = $lucifer[0];\n\t\t\t\t$b['permsn'] = $this->getnumchmodfromh( $b['perms'] );\n\t\t\t\t$b['number'] = $lucifer[1];\n\t\t\t\t$b['owner']  = $lucifer[2];\n\t\t\t\t$b['group']  = $lucifer[3];\n\t\t\t\t$b['size']   = $lucifer[4];\n\n\t\t\t\tif ( 8 == $lcount ) {\n\t\t\t\t\tsscanf( $lucifer[5], '%d-%d-%d', $b['year'], $b['month'], $b['day'] );\n\t\t\t\t\tsscanf( $lucifer[6], '%d:%d', $b['hour'], $b['minute'] );\n\n\t\t\t\t\t$b['time'] = mktime( $b['hour'], $b['minute'], 0, $b['month'], $b['day'], $b['year'] );\n\t\t\t\t\t$b['name'] = $lucifer[7];\n\t\t\t\t} else {\n\t\t\t\t\t$b['month'] = $lucifer[5];\n\t\t\t\t\t$b['day']   = $lucifer[6];\n\n\t\t\t\t\tif ( preg_match( '/([0-9]{2}):([0-9]{2})/', $lucifer[7], $l2 ) ) {\n\t\t\t\t\t\t$b['year']   = gmdate( 'Y' );\n\t\t\t\t\t\t$b['hour']   = $l2[1];\n\t\t\t\t\t\t$b['minute'] = $l2[2];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$b['year']   = $lucifer[7];\n\t\t\t\t\t\t$b['hour']   = 0;\n\t\t\t\t\t\t$b['minute'] = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t$b['time'] = strtotime( sprintf( '%d %s %d %02d:%02d', $b['day'], $b['month'], $b['year'], $b['hour'], $b['minute'] ) );\n\t\t\t\t\t$b['name'] = $lucifer[8];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Replace symlinks formatted as \"source -> target\" with just the source name.\n\t\tif ( isset( $b['islink'] ) && $b['islink'] ) {\n\t\t\t$b['name'] = preg_replace( '/(\\s*->\\s*.*)$/', '', $b['name'] );\n\t\t}\n\n\t\treturn $b;\n\t}\n\n\t/**\n\t * Gets details for files in a directory or a specific file.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $path           Path to directory or file.\n\t * @param bool   $include_hidden Optional. Whether to include details of hidden (\".\" prefixed) files.\n\t *                               Default true.\n\t * @param bool   $recursive      Optional. Whether to recursively include file details in nested directories.\n\t *                               Default false.\n\t * @return array|false {\n\t *     Array of files. False if unable to list directory contents.\n\t *\n\t *     @type string $name        Name of the file or directory.\n\t *     @type string $perms       *nix representation of permissions.\n\t *     @type int    $permsn      Octal representation of permissions.\n\t *     @type string $owner       Owner name or ID.\n\t *     @type int    $size        Size of file in bytes.\n\t *     @type int    $lastmodunix Last modified unix timestamp.\n\t *     @type mixed  $lastmod     Last modified month (3 letter) and day (without leading 0).\n\t *     @type int    $time        Last modified time.\n\t *     @type string $type        Type of resource. 'f' for file, 'd' for directory.\n\t *     @type mixed  $files       If a directory and $recursive is true, contains another array of files.\n\t * }\n\t */\n\tpublic function dirlist( $path = '.', $include_hidden = true, $recursive = false ) {\n\t\tif ( $this->is_file( $path ) ) {\n\t\t\t$limit_file = basename( $path );\n\t\t\t$path       = dirname( $path ) . '/';\n\t\t} else {\n\t\t\t$limit_file = false;\n\t\t}\n\n\t\t$pwd = ftp_pwd( $this->link );\n\n\t\tif ( ! @ftp_chdir( $this->link, $path ) ) { // Can't change to folder = folder doesn't exist.\n\t\t\treturn false;\n\t\t}\n\n\t\t$list = ftp_rawlist( $this->link, '-a', false );\n\n\t\t@ftp_chdir( $this->link, $pwd );\n\n\t\tif ( empty( $list ) ) { // Empty array = non-existent folder (real folder will show . at least).\n\t\t\treturn false;\n\t\t}\n\n\t\t$dirlist = array();\n\n\t\tforeach ( $list as $k => $v ) {\n\t\t\t$entry = $this->parselisting( $v );\n\n\t\t\tif ( empty( $entry ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( '.' === $entry['name'] || '..' === $entry['name'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! $include_hidden && '.' === $entry['name'][0] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $limit_file && $entry['name'] != $limit_file ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$dirlist[ $entry['name'] ] = $entry;\n\t\t}\n\n\t\t$ret = array();\n\n\t\tforeach ( (array) $dirlist as $struc ) {\n\t\t\tif ( 'd' === $struc['type'] ) {\n\t\t\t\tif ( $recursive ) {\n\t\t\t\t\t$struc['files'] = $this->dirlist( $path . '/' . $struc['name'], $include_hidden, $recursive );\n\t\t\t\t} else {\n\t\t\t\t\t$struc['files'] = array();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$ret[ $struc['name'] ] = $struc;\n\t\t}\n\n\t\treturn $ret;\n\t}\n\n\t/**\n\t * Destructor.\n\t *\n\t * @since 2.5.0\n\t */\n\tpublic function __destruct() {\n\t\tif ( $this->link ) {\n\t\t\tftp_close( $this->link );\n\t\t}\n\t}\n}\n", "num_lines": 783}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress FTP Sockets Filesystem.\n *\n * @package WordPress\n * @subpackage Filesystem\n */\n\n/**\n * WordPress Filesystem Class for implementing FTP Sockets.\n *\n * @since 2.5.0\n *\n * @see WP_Filesystem_Base\n */\nclass WP_Filesystem_ftpsockets extends WP_Filesystem_Base {\n\n\t/**\n\t * @since 2.5.0\n\t * @var ftp\n\t */\n\tpublic $ftp;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param array $opt\n\t */\n\tpublic function __construct( $opt = '' ) {\n\t\t$this->method = 'ftpsockets';\n\t\t$this->errors = new WP_Error();\n\n\t\t// Check if possible to use ftp functions.\n\t\tif ( ! include_once ABSPATH . 'wp-admin/includes/class-ftp.php' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->ftp = new ftp();\n\n\t\tif ( empty( $opt['port'] ) ) {\n\t\t\t$this->options['port'] = 21;\n\t\t} else {\n\t\t\t$this->options['port'] = (int) $opt['port'];\n\t\t}\n\n\t\tif ( empty( $opt['hostname'] ) ) {\n\t\t\t$this->errors->add( 'empty_hostname', __( 'FTP hostname is required' ) );\n\t\t} else {\n\t\t\t$this->options['hostname'] = $opt['hostname'];\n\t\t}\n\n\t\t// Check if the options provided are OK.\n\t\tif ( empty( $opt['username'] ) ) {\n\t\t\t$this->errors->add( 'empty_username', __( 'FTP username is required' ) );\n\t\t} else {\n\t\t\t$this->options['username'] = $opt['username'];\n\t\t}\n\n\t\tif ( empty( $opt['password'] ) ) {\n\t\t\t$this->errors->add( 'empty_password', __( 'FTP password is required' ) );\n\t\t} else {\n\t\t\t$this->options['password'] = $opt['password'];\n\t\t}\n\t}\n\n\t/**\n\t * Connects filesystem.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function connect() {\n\t\tif ( ! $this->ftp ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->ftp->setTimeout( FS_CONNECT_TIMEOUT );\n\n\t\tif ( ! $this->ftp->SetServer( $this->options['hostname'], $this->options['port'] ) ) {\n\t\t\t$this->errors->add(\n\t\t\t\t'connect',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: hostname:port */\n\t\t\t\t\t__( 'Failed to connect to FTP Server %s' ),\n\t\t\t\t\t$this->options['hostname'] . ':' . $this->options['port']\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $this->ftp->connect() ) {\n\t\t\t$this->errors->add(\n\t\t\t\t'connect',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: hostname:port */\n\t\t\t\t\t__( 'Failed to connect to FTP Server %s' ),\n\t\t\t\t\t$this->options['hostname'] . ':' . $this->options['port']\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $this->ftp->login( $this->options['username'], $this->options['password'] ) ) {\n\t\t\t$this->errors->add(\n\t\t\t\t'auth',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Username. */\n\t\t\t\t\t__( 'Username/Password incorrect for %s' ),\n\t\t\t\t\t$this->options['username']\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->ftp->SetType( FTP_BINARY );\n\t\t$this->ftp->Passive( true );\n\t\t$this->ftp->setTimeout( FS_TIMEOUT );\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Reads entire file into a string.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Name of the file to read.\n\t * @return string|false Read data on success, false if no temporary file could be opened,\n\t *                      or if the file couldn't be retrieved.\n\t */\n\tpublic function get_contents( $file ) {\n\t\tif ( ! $this->exists( $file ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$tempfile   = wp_tempnam( $file );\n\t\t$temphandle = fopen( $tempfile, 'w+' );\n\n\t\tif ( ! $temphandle ) {\n\t\t\tunlink( $tempfile );\n\t\t\treturn false;\n\t\t}\n\n\t\tmbstring_binary_safe_encoding();\n\n\t\tif ( ! $this->ftp->fget( $temphandle, $file ) ) {\n\t\t\tfclose( $temphandle );\n\t\t\tunlink( $tempfile );\n\n\t\t\treset_mbstring_encoding();\n\n\t\t\treturn ''; // Blank document. File does exist, it's just blank.\n\t\t}\n\n\t\treset_mbstring_encoding();\n\n\t\tfseek( $temphandle, 0 ); // Skip back to the start of the file being written to.\n\t\t$contents = '';\n\n\t\twhile ( ! feof( $temphandle ) ) {\n\t\t\t$contents .= fread( $temphandle, 8 * KB_IN_BYTES );\n\t\t}\n\n\t\tfclose( $temphandle );\n\t\tunlink( $tempfile );\n\n\t\treturn $contents;\n\t}\n\n\t/**\n\t * Reads entire file into an array.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return array|false File contents in an array on success, false on failure.\n\t */\n\tpublic function get_contents_array( $file ) {\n\t\treturn explode( \"\\n\", $this->get_contents( $file ) );\n\t}\n\n\t/**\n\t * Writes a string to a file.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string    $file     Remote path to the file where to write the data.\n\t * @param string    $contents The data to write.\n\t * @param int|false $mode     Optional. The file permissions as octal number, usually 0644.\n\t *                            Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function put_contents( $file, $contents, $mode = false ) {\n\t\t$tempfile   = wp_tempnam( $file );\n\t\t$temphandle = @fopen( $tempfile, 'w+' );\n\n\t\tif ( ! $temphandle ) {\n\t\t\tunlink( $tempfile );\n\t\t\treturn false;\n\t\t}\n\n\t\t// The FTP class uses string functions internally during file download/upload.\n\t\tmbstring_binary_safe_encoding();\n\n\t\t$bytes_written = fwrite( $temphandle, $contents );\n\n\t\tif ( false === $bytes_written || strlen( $contents ) != $bytes_written ) {\n\t\t\tfclose( $temphandle );\n\t\t\tunlink( $tempfile );\n\n\t\t\treset_mbstring_encoding();\n\n\t\t\treturn false;\n\t\t}\n\n\t\tfseek( $temphandle, 0 ); // Skip back to the start of the file being written to.\n\n\t\t$ret = $this->ftp->fput( $file, $temphandle );\n\n\t\treset_mbstring_encoding();\n\n\t\tfclose( $temphandle );\n\t\tunlink( $tempfile );\n\n\t\t$this->chmod( $file, $mode );\n\n\t\treturn $ret;\n\t}\n\n\t/**\n\t * Gets the current working directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @return string|false The current working directory on success, false on failure.\n\t */\n\tpublic function cwd() {\n\t\t$cwd = $this->ftp->pwd();\n\n\t\tif ( $cwd ) {\n\t\t\t$cwd = trailingslashit( $cwd );\n\t\t}\n\n\t\treturn $cwd;\n\t}\n\n\t/**\n\t * Changes current directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $dir The new current directory.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function chdir( $dir ) {\n\t\treturn $this->ftp->chdir( $dir );\n\t}\n\n\t/**\n\t * Changes filesystem permissions.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string    $file      Path to the file.\n\t * @param int|false $mode      Optional. The permissions as octal number, usually 0644 for files,\n\t *                             0755 for directories. Default false.\n\t * @param bool      $recursive Optional. If set to true, changes file permissions recursively.\n\t *                             Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function chmod( $file, $mode = false, $recursive = false ) {\n\t\tif ( ! $mode ) {\n\t\t\tif ( $this->is_file( $file ) ) {\n\t\t\t\t$mode = FS_CHMOD_FILE;\n\t\t\t} elseif ( $this->is_dir( $file ) ) {\n\t\t\t\t$mode = FS_CHMOD_DIR;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// chmod any sub-objects if recursive.\n\t\tif ( $recursive && $this->is_dir( $file ) ) {\n\t\t\t$filelist = $this->dirlist( $file );\n\n\t\t\tforeach ( (array) $filelist as $filename => $filemeta ) {\n\t\t\t\t$this->chmod( $file . '/' . $filename, $mode, $recursive );\n\t\t\t}\n\t\t}\n\n\t\t// chmod the file or directory.\n\t\treturn $this->ftp->chmod( $file, $mode );\n\t}\n\n\t/**\n\t * Gets the file owner.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return string|false Username of the owner on success, false on failure.\n\t */\n\tpublic function owner( $file ) {\n\t\t$dir = $this->dirlist( $file );\n\n\t\treturn $dir[ $file ]['owner'];\n\t}\n\n\t/**\n\t * Gets the permissions of the specified file or filepath in their octal format.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return string Mode of the file (the last 3 digits).\n\t */\n\tpublic function getchmod( $file ) {\n\t\t$dir = $this->dirlist( $file );\n\n\t\treturn $dir[ $file ]['permsn'];\n\t}\n\n\t/**\n\t * Gets the file's group.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return string|false The group on success, false on failure.\n\t */\n\tpublic function group( $file ) {\n\t\t$dir = $this->dirlist( $file );\n\n\t\treturn $dir[ $file ]['group'];\n\t}\n\n\t/**\n\t * Copies a file.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string    $source      Path to the source file.\n\t * @param string    $destination Path to the destination file.\n\t * @param bool      $overwrite   Optional. Whether to overwrite the destination file if it exists.\n\t *                               Default false.\n\t * @param int|false $mode        Optional. The permissions as octal number, usually 0644 for files,\n\t *                               0755 for dirs. Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function copy( $source, $destination, $overwrite = false, $mode = false ) {\n\t\tif ( ! $overwrite && $this->exists( $destination ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$content = $this->get_contents( $source );\n\n\t\tif ( false === $content ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->put_contents( $destination, $content, $mode );\n\t}\n\n\t/**\n\t * Moves a file.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $source      Path to the source file.\n\t * @param string $destination Path to the destination file.\n\t * @param bool   $overwrite   Optional. Whether to overwrite the destination file if it exists.\n\t *                            Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function move( $source, $destination, $overwrite = false ) {\n\t\treturn $this->ftp->rename( $source, $destination );\n\t}\n\n\t/**\n\t * Deletes a file or directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string       $file      Path to the file or directory.\n\t * @param bool         $recursive Optional. If set to true, deletes files and folders recursively.\n\t *                                Default false.\n\t * @param string|false $type      Type of resource. 'f' for file, 'd' for directory.\n\t *                                Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function delete( $file, $recursive = false, $type = false ) {\n\t\tif ( empty( $file ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( 'f' === $type || $this->is_file( $file ) ) {\n\t\t\treturn $this->ftp->delete( $file );\n\t\t}\n\n\t\tif ( ! $recursive ) {\n\t\t\treturn $this->ftp->rmdir( $file );\n\t\t}\n\n\t\treturn $this->ftp->mdel( $file );\n\t}\n\n\t/**\n\t * Checks if a file or directory exists.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file or directory.\n\t * @return bool Whether $file exists or not.\n\t */\n\tpublic function exists( $file ) {\n\t\t$list = $this->ftp->nlist( $file );\n\n\t\tif ( empty( $list ) && $this->is_dir( $file ) ) {\n\t\t\treturn true; // File is an empty directory.\n\t\t}\n\n\t\treturn ! empty( $list ); // Empty list = no file, so invert.\n\t\t// Return $this->ftp->is_exists($file); has issues with ABOR+426 responses on the ncFTPd server.\n\t}\n\n\t/**\n\t * Checks if resource is a file.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file File path.\n\t * @return bool Whether $file is a file.\n\t */\n\tpublic function is_file( $file ) {\n\t\tif ( $this->is_dir( $file ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $this->exists( $file ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks if resource is a directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $path Directory path.\n\t * @return bool Whether $path is a directory.\n\t */\n\tpublic function is_dir( $path ) {\n\t\t$cwd = $this->cwd();\n\n\t\tif ( $this->chdir( $path ) ) {\n\t\t\t$this->chdir( $cwd );\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks if a file is readable.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file.\n\t * @return bool Whether $file is readable.\n\t */\n\tpublic function is_readable( $file ) {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks if a file or directory is writable.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file or directory.\n\t * @return bool Whether $file is writable.\n\t */\n\tpublic function is_writable( $file ) {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Gets the file's last access time.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file.\n\t * @return int|false Unix timestamp representing last access time, false on failure.\n\t */\n\tpublic function atime( $file ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Gets the file modification time.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file.\n\t * @return int|false Unix timestamp representing modification time, false on failure.\n\t */\n\tpublic function mtime( $file ) {\n\t\treturn $this->ftp->mdtm( $file );\n\t}\n\n\t/**\n\t * Gets the file size (in bytes).\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file Path to file.\n\t * @return int|false Size of the file in bytes on success, false on failure.\n\t */\n\tpublic function size( $file ) {\n\t\treturn $this->ftp->filesize( $file );\n\t}\n\n\t/**\n\t * Sets the access and modification times of a file.\n\t *\n\t * Note: If $file doesn't exist, it will be created.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $file  Path to file.\n\t * @param int    $time  Optional. Modified time to set for file.\n\t *                      Default 0.\n\t * @param int    $atime Optional. Access time to set for file.\n\t *                      Default 0.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function touch( $file, $time = 0, $atime = 0 ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Creates a directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string     $path  Path for new directory.\n\t * @param int|false  $chmod Optional. The permissions as octal number (or false to skip chmod).\n\t *                          Default false.\n\t * @param string|int $chown Optional. A user name or number (or false to skip chown).\n\t *                          Default false.\n\t * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp).\n\t *                          Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {\n\t\t$path = untrailingslashit( $path );\n\n\t\tif ( empty( $path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $this->ftp->mkdir( $path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $chmod ) {\n\t\t\t$chmod = FS_CHMOD_DIR;\n\t\t}\n\n\t\t$this->chmod( $path, $chmod );\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Deletes a directory.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $path      Path to directory.\n\t * @param bool   $recursive Optional. Whether to recursively remove files/directories.\n\t *                          Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function rmdir( $path, $recursive = false ) {\n\t\treturn $this->delete( $path, $recursive );\n\t}\n\n\t/**\n\t * Gets details for files in a directory or a specific file.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $path           Path to directory or file.\n\t * @param bool   $include_hidden Optional. Whether to include details of hidden (\".\" prefixed) files.\n\t *                               Default true.\n\t * @param bool   $recursive      Optional. Whether to recursively include file details in nested directories.\n\t *                               Default false.\n\t * @return array|false {\n\t *     Array of files. False if unable to list directory contents.\n\t *\n\t *     @type string $name        Name of the file or directory.\n\t *     @type string $perms       *nix representation of permissions.\n\t *     @type int    $permsn      Octal representation of permissions.\n\t *     @type string $owner       Owner name or ID.\n\t *     @type int    $size        Size of file in bytes.\n\t *     @type int    $lastmodunix Last modified unix timestamp.\n\t *     @type mixed  $lastmod     Last modified month (3 letter) and day (without leading 0).\n\t *     @type int    $time        Last modified time.\n\t *     @type string $type        Type of resource. 'f' for file, 'd' for directory.\n\t *     @type mixed  $files       If a directory and $recursive is true, contains another array of files.\n\t * }\n\t */\n\tpublic function dirlist( $path = '.', $include_hidden = true, $recursive = false ) {\n\t\tif ( $this->is_file( $path ) ) {\n\t\t\t$limit_file = basename( $path );\n\t\t\t$path       = dirname( $path ) . '/';\n\t\t} else {\n\t\t\t$limit_file = false;\n\t\t}\n\n\t\tmbstring_binary_safe_encoding();\n\n\t\t$list = $this->ftp->dirlist( $path );\n\n\t\tif ( empty( $list ) && ! $this->exists( $path ) ) {\n\n\t\t\treset_mbstring_encoding();\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$ret = array();\n\n\t\tforeach ( $list as $struc ) {\n\n\t\t\tif ( '.' === $struc['name'] || '..' === $struc['name'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! $include_hidden && '.' === $struc['name'][0] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $limit_file && $struc['name'] != $limit_file ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( 'd' === $struc['type'] ) {\n\t\t\t\tif ( $recursive ) {\n\t\t\t\t\t$struc['files'] = $this->dirlist( $path . '/' . $struc['name'], $include_hidden, $recursive );\n\t\t\t\t} else {\n\t\t\t\t\t$struc['files'] = array();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Replace symlinks formatted as \"source -> target\" with just the source name.\n\t\t\tif ( $struc['islink'] ) {\n\t\t\t\t$struc['name'] = preg_replace( '/(\\s*->\\s*.*)$/', '', $struc['name'] );\n\t\t\t}\n\n\t\t\t// Add the octal representation of the file permissions.\n\t\t\t$struc['permsn'] = $this->getnumchmodfromh( $struc['perms'] );\n\n\t\t\t$ret[ $struc['name'] ] = $struc;\n\t\t}\n\n\t\treset_mbstring_encoding();\n\n\t\treturn $ret;\n\t}\n\n\t/**\n\t * Destructor.\n\t *\n\t * @since 2.5.0\n\t */\n\tpublic function __destruct() {\n\t\t$this->ftp->quit();\n\t}\n}\n", "num_lines": 690}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Filesystem Class for implementing SSH2\n *\n * To use this class you must follow these steps for PHP 5.2.6+\n *\n * @contrib http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/ - Installation Notes\n *\n * Compile libssh2 (Note: Only 0.14 is officaly working with PHP 5.2.6+ right now, But many users have found the latest versions work)\n *\n * cd /usr/src\n * wget https://www.libssh2.org/download/libssh2-0.14.tar.gz\n * tar -zxvf libssh2-0.14.tar.gz\n * cd libssh2-0.14/\n * ./configure\n * make all install\n *\n * Note: Do not leave the directory yet!\n *\n * Enter: pecl install -f ssh2\n *\n * Copy the ssh.so file it creates to your PHP Module Directory.\n * Open up your PHP.INI file and look for where extensions are placed.\n * Add in your PHP.ini file: extension=ssh2.so\n *\n * Restart Apache!\n * Check phpinfo() streams to confirm that: ssh2.shell, ssh2.exec, ssh2.tunnel, ssh2.scp, ssh2.sftp  exist.\n *\n * Note: As of WordPress 2.8, this utilises the PHP5+ function `stream_get_contents()`.\n *\n * @since 2.7.0\n *\n * @package WordPress\n * @subpackage Filesystem\n */\nclass WP_Filesystem_SSH2 extends WP_Filesystem_Base {\n\n\t/**\n\t * @since 2.7.0\n\t * @var resource\n\t */\n\tpublic $link = false;\n\n\t/**\n\t * @since 2.7.0\n\t * @var resource\n\t */\n\tpublic $sftp_link;\n\n\t/**\n\t * @since 2.7.0\n\t * @var bool\n\t */\n\tpublic $keys = false;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param array $opt\n\t */\n\tpublic function __construct( $opt = '' ) {\n\t\t$this->method = 'ssh2';\n\t\t$this->errors = new WP_Error();\n\n\t\t// Check if possible to use ssh2 functions.\n\t\tif ( ! extension_loaded( 'ssh2' ) ) {\n\t\t\t$this->errors->add( 'no_ssh2_ext', __( 'The ssh2 PHP extension is not available' ) );\n\t\t\treturn;\n\t\t}\n\n\t\t// Set defaults:\n\t\tif ( empty( $opt['port'] ) ) {\n\t\t\t$this->options['port'] = 22;\n\t\t} else {\n\t\t\t$this->options['port'] = $opt['port'];\n\t\t}\n\n\t\tif ( empty( $opt['hostname'] ) ) {\n\t\t\t$this->errors->add( 'empty_hostname', __( 'SSH2 hostname is required' ) );\n\t\t} else {\n\t\t\t$this->options['hostname'] = $opt['hostname'];\n\t\t}\n\n\t\t// Check if the options provided are OK.\n\t\tif ( ! empty( $opt['public_key'] ) && ! empty( $opt['private_key'] ) ) {\n\t\t\t$this->options['public_key']  = $opt['public_key'];\n\t\t\t$this->options['private_key'] = $opt['private_key'];\n\n\t\t\t$this->options['hostkey'] = array( 'hostkey' => 'ssh-rsa' );\n\n\t\t\t$this->keys = true;\n\t\t} elseif ( empty( $opt['username'] ) ) {\n\t\t\t$this->errors->add( 'empty_username', __( 'SSH2 username is required' ) );\n\t\t}\n\n\t\tif ( ! empty( $opt['username'] ) ) {\n\t\t\t$this->options['username'] = $opt['username'];\n\t\t}\n\n\t\tif ( empty( $opt['password'] ) ) {\n\t\t\t// Password can be blank if we are using keys.\n\t\t\tif ( ! $this->keys ) {\n\t\t\t\t$this->errors->add( 'empty_password', __( 'SSH2 password is required' ) );\n\t\t\t}\n\t\t} else {\n\t\t\t$this->options['password'] = $opt['password'];\n\t\t}\n\t}\n\n\t/**\n\t * Connects filesystem.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function connect() {\n\t\tif ( ! $this->keys ) {\n\t\t\t$this->link = @ssh2_connect( $this->options['hostname'], $this->options['port'] );\n\t\t} else {\n\t\t\t$this->link = @ssh2_connect( $this->options['hostname'], $this->options['port'], $this->options['hostkey'] );\n\t\t}\n\n\t\tif ( ! $this->link ) {\n\t\t\t$this->errors->add(\n\t\t\t\t'connect',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: hostname:port */\n\t\t\t\t\t__( 'Failed to connect to SSH2 Server %s' ),\n\t\t\t\t\t$this->options['hostname'] . ':' . $this->options['port']\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $this->keys ) {\n\t\t\tif ( ! @ssh2_auth_password( $this->link, $this->options['username'], $this->options['password'] ) ) {\n\t\t\t\t$this->errors->add(\n\t\t\t\t\t'auth',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: Username. */\n\t\t\t\t\t\t__( 'Username/Password incorrect for %s' ),\n\t\t\t\t\t\t$this->options['username']\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tif ( ! @ssh2_auth_pubkey_file( $this->link, $this->options['username'], $this->options['public_key'], $this->options['private_key'], $this->options['password'] ) ) {\n\t\t\t\t$this->errors->add(\n\t\t\t\t\t'auth',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: Username. */\n\t\t\t\t\t\t__( 'Public and Private keys incorrect for %s' ),\n\t\t\t\t\t\t$this->options['username']\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$this->sftp_link = ssh2_sftp( $this->link );\n\n\t\tif ( ! $this->sftp_link ) {\n\t\t\t$this->errors->add(\n\t\t\t\t'connect',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: hostname:port */\n\t\t\t\t\t__( 'Failed to initialize a SFTP subsystem session with the SSH2 Server %s' ),\n\t\t\t\t\t$this->options['hostname'] . ':' . $this->options['port']\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Gets the ssh2.sftp PHP stream wrapper path to open for the given file.\n\t *\n\t * This method also works around a PHP bug where the root directory (/) cannot\n\t * be opened by PHP functions, causing a false failure. In order to work around\n\t * this, the path is converted to /./ which is semantically the same as /\n\t * See https://bugs.php.net/bug.php?id=64169 for more details.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $path The File/Directory path on the remote server to return\n\t * @return string The ssh2.sftp:// wrapped path to use.\n\t */\n\tpublic function sftp_path( $path ) {\n\t\tif ( '/' === $path ) {\n\t\t\t$path = '/./';\n\t\t}\n\n\t\treturn 'ssh2.sftp://' . $this->sftp_link . '/' . ltrim( $path, '/' );\n\t}\n\n\t/**\n\t * @since 2.7.0\n\t *\n\t * @param string $command\n\t * @param bool   $returnbool\n\t * @return bool|string True on success, false on failure. String if the command was executed, `$returnbool`\n\t *                     is false (default), and data from the resulting stream was retrieved.\n\t */\n\tpublic function run_command( $command, $returnbool = false ) {\n\t\tif ( ! $this->link ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$stream = ssh2_exec( $this->link, $command );\n\n\t\tif ( ! $stream ) {\n\t\t\t$this->errors->add(\n\t\t\t\t'command',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Command. */\n\t\t\t\t\t__( 'Unable to perform command: %s' ),\n\t\t\t\t\t$command\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\tstream_set_blocking( $stream, true );\n\t\t\tstream_set_timeout( $stream, FS_TIMEOUT );\n\t\t\t$data = stream_get_contents( $stream );\n\t\t\tfclose( $stream );\n\n\t\t\tif ( $returnbool ) {\n\t\t\t\treturn ( false === $data ) ? false : '' !== trim( $data );\n\t\t\t} else {\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Reads entire file into a string.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $file Name of the file to read.\n\t * @return string|false Read data on success, false if no temporary file could be opened,\n\t *                      or if the file couldn't be retrieved.\n\t */\n\tpublic function get_contents( $file ) {\n\t\treturn file_get_contents( $this->sftp_path( $file ) );\n\t}\n\n\t/**\n\t * Reads entire file into an array.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return array|false File contents in an array on success, false on failure.\n\t */\n\tpublic function get_contents_array( $file ) {\n\t\treturn file( $this->sftp_path( $file ) );\n\t}\n\n\t/**\n\t * Writes a string to a file.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string    $file     Remote path to the file where to write the data.\n\t * @param string    $contents The data to write.\n\t * @param int|false $mode     Optional. The file permissions as octal number, usually 0644.\n\t *                            Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function put_contents( $file, $contents, $mode = false ) {\n\t\t$ret = file_put_contents( $this->sftp_path( $file ), $contents );\n\n\t\tif ( strlen( $contents ) !== $ret ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->chmod( $file, $mode );\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Gets the current working directory.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @return string|false The current working directory on success, false on failure.\n\t */\n\tpublic function cwd() {\n\t\t$cwd = ssh2_sftp_realpath( $this->sftp_link, '.' );\n\n\t\tif ( $cwd ) {\n\t\t\t$cwd = trailingslashit( trim( $cwd ) );\n\t\t}\n\n\t\treturn $cwd;\n\t}\n\n\t/**\n\t * Changes current directory.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $dir The new current directory.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function chdir( $dir ) {\n\t\treturn $this->run_command( 'cd ' . $dir, true );\n\t}\n\n\t/**\n\t * Changes the file group.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string     $file      Path to the file.\n\t * @param string|int $group     A group name or number.\n\t * @param bool       $recursive Optional. If set to true, changes file group recursively.\n\t *                              Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function chgrp( $file, $group, $recursive = false ) {\n\t\tif ( ! $this->exists( $file ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $recursive || ! $this->is_dir( $file ) ) {\n\t\t\treturn $this->run_command( sprintf( 'chgrp %s %s', escapeshellarg( $group ), escapeshellarg( $file ) ), true );\n\t\t}\n\n\t\treturn $this->run_command( sprintf( 'chgrp -R %s %s', escapeshellarg( $group ), escapeshellarg( $file ) ), true );\n\t}\n\n\t/**\n\t * Changes filesystem permissions.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string    $file      Path to the file.\n\t * @param int|false $mode      Optional. The permissions as octal number, usually 0644 for files,\n\t *                             0755 for directories. Default false.\n\t * @param bool      $recursive Optional. If set to true, changes file permissions recursively.\n\t *                             Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function chmod( $file, $mode = false, $recursive = false ) {\n\t\tif ( ! $this->exists( $file ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $mode ) {\n\t\t\tif ( $this->is_file( $file ) ) {\n\t\t\t\t$mode = FS_CHMOD_FILE;\n\t\t\t} elseif ( $this->is_dir( $file ) ) {\n\t\t\t\t$mode = FS_CHMOD_DIR;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $recursive || ! $this->is_dir( $file ) ) {\n\t\t\treturn $this->run_command( sprintf( 'chmod %o %s', $mode, escapeshellarg( $file ) ), true );\n\t\t}\n\n\t\treturn $this->run_command( sprintf( 'chmod -R %o %s', $mode, escapeshellarg( $file ) ), true );\n\t}\n\n\t/**\n\t * Changes the owner of a file or directory.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string     $file      Path to the file or directory.\n\t * @param string|int $owner     A user name or number.\n\t * @param bool       $recursive Optional. If set to true, changes file owner recursively.\n\t *                              Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function chown( $file, $owner, $recursive = false ) {\n\t\tif ( ! $this->exists( $file ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $recursive || ! $this->is_dir( $file ) ) {\n\t\t\treturn $this->run_command( sprintf( 'chown %s %s', escapeshellarg( $owner ), escapeshellarg( $file ) ), true );\n\t\t}\n\n\t\treturn $this->run_command( sprintf( 'chown -R %s %s', escapeshellarg( $owner ), escapeshellarg( $file ) ), true );\n\t}\n\n\t/**\n\t * Gets the file owner.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return string|false Username of the owner on success, false on failure.\n\t */\n\tpublic function owner( $file ) {\n\t\t$owneruid = @fileowner( $this->sftp_path( $file ) );\n\n\t\tif ( ! $owneruid ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! function_exists( 'posix_getpwuid' ) ) {\n\t\t\treturn $owneruid;\n\t\t}\n\n\t\t$ownerarray = posix_getpwuid( $owneruid );\n\n\t\tif ( ! $ownerarray ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $ownerarray['name'];\n\t}\n\n\t/**\n\t * Gets the permissions of the specified file or filepath in their octal format.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return string Mode of the file (the last 3 digits).\n\t */\n\tpublic function getchmod( $file ) {\n\t\treturn substr( decoct( @fileperms( $this->sftp_path( $file ) ) ), -3 );\n\t}\n\n\t/**\n\t * Gets the file's group.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $file Path to the file.\n\t * @return string|false The group on success, false on failure.\n\t */\n\tpublic function group( $file ) {\n\t\t$gid = @filegroup( $this->sftp_path( $file ) );\n\n\t\tif ( ! $gid ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! function_exists( 'posix_getgrgid' ) ) {\n\t\t\treturn $gid;\n\t\t}\n\n\t\t$grouparray = posix_getgrgid( $gid );\n\n\t\tif ( ! $grouparray ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $grouparray['name'];\n\t}\n\n\t/**\n\t * Copies a file.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string    $source      Path to the source file.\n\t * @param string    $destination Path to the destination file.\n\t * @param bool      $overwrite   Optional. Whether to overwrite the destination file if it exists.\n\t *                               Default false.\n\t * @param int|false $mode        Optional. The permissions as octal number, usually 0644 for files,\n\t *                               0755 for dirs. Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function copy( $source, $destination, $overwrite = false, $mode = false ) {\n\t\tif ( ! $overwrite && $this->exists( $destination ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$content = $this->get_contents( $source );\n\n\t\tif ( false === $content ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->put_contents( $destination, $content, $mode );\n\t}\n\n\t/**\n\t * Moves a file.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $source      Path to the source file.\n\t * @param string $destination Path to the destination file.\n\t * @param bool   $overwrite   Optional. Whether to overwrite the destination file if it exists.\n\t *                            Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function move( $source, $destination, $overwrite = false ) {\n\t\tif ( $this->exists( $destination ) ) {\n\t\t\tif ( $overwrite ) {\n\t\t\t\t// We need to remove the destination file before we can rename the source.\n\t\t\t\t$this->delete( $destination, false, 'f' );\n\t\t\t} else {\n\t\t\t\t// If we're not overwriting, the rename will fail, so return early.\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn ssh2_sftp_rename( $this->sftp_link, $source, $destination );\n\t}\n\n\t/**\n\t * Deletes a file or directory.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string       $file      Path to the file or directory.\n\t * @param bool         $recursive Optional. If set to true, deletes files and folders recursively.\n\t *                                Default false.\n\t * @param string|false $type      Type of resource. 'f' for file, 'd' for directory.\n\t *                                Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function delete( $file, $recursive = false, $type = false ) {\n\t\tif ( 'f' === $type || $this->is_file( $file ) ) {\n\t\t\treturn ssh2_sftp_unlink( $this->sftp_link, $file );\n\t\t}\n\n\t\tif ( ! $recursive ) {\n\t\t\treturn ssh2_sftp_rmdir( $this->sftp_link, $file );\n\t\t}\n\n\t\t$filelist = $this->dirlist( $file );\n\n\t\tif ( is_array( $filelist ) ) {\n\t\t\tforeach ( $filelist as $filename => $fileinfo ) {\n\t\t\t\t$this->delete( $file . '/' . $filename, $recursive, $fileinfo['type'] );\n\t\t\t}\n\t\t}\n\n\t\treturn ssh2_sftp_rmdir( $this->sftp_link, $file );\n\t}\n\n\t/**\n\t * Checks if a file or directory exists.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $file Path to file or directory.\n\t * @return bool Whether $file exists or not.\n\t */\n\tpublic function exists( $file ) {\n\t\treturn file_exists( $this->sftp_path( $file ) );\n\t}\n\n\t/**\n\t * Checks if resource is a file.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $file File path.\n\t * @return bool Whether $file is a file.\n\t */\n\tpublic function is_file( $file ) {\n\t\treturn is_file( $this->sftp_path( $file ) );\n\t}\n\n\t/**\n\t * Checks if resource is a directory.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $path Directory path.\n\t * @return bool Whether $path is a directory.\n\t */\n\tpublic function is_dir( $path ) {\n\t\treturn is_dir( $this->sftp_path( $path ) );\n\t}\n\n\t/**\n\t * Checks if a file is readable.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $file Path to file.\n\t * @return bool Whether $file is readable.\n\t */\n\tpublic function is_readable( $file ) {\n\t\treturn is_readable( $this->sftp_path( $file ) );\n\t}\n\n\t/**\n\t * Checks if a file or directory is writable.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $file Path to file or directory.\n\t * @return bool Whether $file is writable.\n\t */\n\tpublic function is_writable( $file ) {\n\t\t// PHP will base its writable checks on system_user === file_owner, not ssh_user === file_owner.\n\t\treturn true;\n\t}\n\n\t/**\n\t * Gets the file's last access time.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $file Path to file.\n\t * @return int|false Unix timestamp representing last access time, false on failure.\n\t */\n\tpublic function atime( $file ) {\n\t\treturn fileatime( $this->sftp_path( $file ) );\n\t}\n\n\t/**\n\t * Gets the file modification time.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $file Path to file.\n\t * @return int|false Unix timestamp representing modification time, false on failure.\n\t */\n\tpublic function mtime( $file ) {\n\t\treturn filemtime( $this->sftp_path( $file ) );\n\t}\n\n\t/**\n\t * Gets the file size (in bytes).\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $file Path to file.\n\t * @return int|false Size of the file in bytes on success, false on failure.\n\t */\n\tpublic function size( $file ) {\n\t\treturn filesize( $this->sftp_path( $file ) );\n\t}\n\n\t/**\n\t * Sets the access and modification times of a file.\n\t *\n\t * Note: Not implemented.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $file  Path to file.\n\t * @param int    $time  Optional. Modified time to set for file.\n\t *                      Default 0.\n\t * @param int    $atime Optional. Access time to set for file.\n\t *                      Default 0.\n\t */\n\tpublic function touch( $file, $time = 0, $atime = 0 ) {\n\t\t// Not implemented.\n\t}\n\n\t/**\n\t * Creates a directory.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string     $path  Path for new directory.\n\t * @param int|false  $chmod Optional. The permissions as octal number (or false to skip chmod).\n\t *                          Default false.\n\t * @param string|int $chown Optional. A user name or number (or false to skip chown).\n\t *                          Default false.\n\t * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp).\n\t *                          Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {\n\t\t$path = untrailingslashit( $path );\n\n\t\tif ( empty( $path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $chmod ) {\n\t\t\t$chmod = FS_CHMOD_DIR;\n\t\t}\n\n\t\tif ( ! ssh2_sftp_mkdir( $this->sftp_link, $path, $chmod, true ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Set directory permissions.\n\t\tssh2_sftp_chmod( $this->sftp_link, $path, $chmod );\n\n\t\tif ( $chown ) {\n\t\t\t$this->chown( $path, $chown );\n\t\t}\n\n\t\tif ( $chgrp ) {\n\t\t\t$this->chgrp( $path, $chgrp );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Deletes a directory.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $path      Path to directory.\n\t * @param bool   $recursive Optional. Whether to recursively remove files/directories.\n\t *                          Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function rmdir( $path, $recursive = false ) {\n\t\treturn $this->delete( $path, $recursive );\n\t}\n\n\t/**\n\t * Gets details for files in a directory or a specific file.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $path           Path to directory or file.\n\t * @param bool   $include_hidden Optional. Whether to include details of hidden (\".\" prefixed) files.\n\t *                               Default true.\n\t * @param bool   $recursive      Optional. Whether to recursively include file details in nested directories.\n\t *                               Default false.\n\t * @return array|false {\n\t *     Array of files. False if unable to list directory contents.\n\t *\n\t *     @type string $name        Name of the file or directory.\n\t *     @type string $perms       *nix representation of permissions.\n\t *     @type int    $permsn      Octal representation of permissions.\n\t *     @type string $owner       Owner name or ID.\n\t *     @type int    $size        Size of file in bytes.\n\t *     @type int    $lastmodunix Last modified unix timestamp.\n\t *     @type mixed  $lastmod     Last modified month (3 letter) and day (without leading 0).\n\t *     @type int    $time        Last modified time.\n\t *     @type string $type        Type of resource. 'f' for file, 'd' for directory.\n\t *     @type mixed  $files       If a directory and $recursive is true, contains another array of files.\n\t * }\n\t */\n\tpublic function dirlist( $path, $include_hidden = true, $recursive = false ) {\n\t\tif ( $this->is_file( $path ) ) {\n\t\t\t$limit_file = basename( $path );\n\t\t\t$path       = dirname( $path );\n\t\t} else {\n\t\t\t$limit_file = false;\n\t\t}\n\n\t\tif ( ! $this->is_dir( $path ) || ! $this->is_readable( $path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$ret = array();\n\t\t$dir = dir( $this->sftp_path( $path ) );\n\n\t\tif ( ! $dir ) {\n\t\t\treturn false;\n\t\t}\n\n\t\twhile ( false !== ( $entry = $dir->read() ) ) {\n\t\t\t$struc         = array();\n\t\t\t$struc['name'] = $entry;\n\n\t\t\tif ( '.' === $struc['name'] || '..' === $struc['name'] ) {\n\t\t\t\tcontinue; // Do not care about these folders.\n\t\t\t}\n\n\t\t\tif ( ! $include_hidden && '.' === $struc['name'][0] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $limit_file && $struc['name'] != $limit_file ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$struc['perms']       = $this->gethchmod( $path . '/' . $entry );\n\t\t\t$struc['permsn']      = $this->getnumchmodfromh( $struc['perms'] );\n\t\t\t$struc['number']      = false;\n\t\t\t$struc['owner']       = $this->owner( $path . '/' . $entry );\n\t\t\t$struc['group']       = $this->group( $path . '/' . $entry );\n\t\t\t$struc['size']        = $this->size( $path . '/' . $entry );\n\t\t\t$struc['lastmodunix'] = $this->mtime( $path . '/' . $entry );\n\t\t\t$struc['lastmod']     = gmdate( 'M j', $struc['lastmodunix'] );\n\t\t\t$struc['time']        = gmdate( 'h:i:s', $struc['lastmodunix'] );\n\t\t\t$struc['type']        = $this->is_dir( $path . '/' . $entry ) ? 'd' : 'f';\n\n\t\t\tif ( 'd' === $struc['type'] ) {\n\t\t\t\tif ( $recursive ) {\n\t\t\t\t\t$struc['files'] = $this->dirlist( $path . '/' . $struc['name'], $include_hidden, $recursive );\n\t\t\t\t} else {\n\t\t\t\t\t$struc['files'] = array();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$ret[ $struc['name'] ] = $struc;\n\t\t}\n\n\t\t$dir->close();\n\t\tunset( $dir );\n\n\t\treturn $ret;\n\t}\n}\n", "num_lines": 814}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WP_Importer base class\n */\nclass WP_Importer {\n\t/**\n\t * Class Constructor\n\t */\n\tpublic function __construct() {}\n\n\t/**\n\t * Returns array with imported permalinks from WordPress database\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $importer_name\n\t * @param string $bid\n\t * @return array\n\t */\n\tpublic function get_imported_posts( $importer_name, $bid ) {\n\t\tglobal $wpdb;\n\n\t\t$hashtable = array();\n\n\t\t$limit  = 100;\n\t\t$offset = 0;\n\n\t\t// Grab all posts in chunks.\n\t\tdo {\n\t\t\t$meta_key = $importer_name . '_' . $bid . '_permalink';\n\t\t\t$sql      = $wpdb->prepare( \"SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = %s LIMIT %d,%d\", $meta_key, $offset, $limit );\n\t\t\t$results  = $wpdb->get_results( $sql );\n\n\t\t\t// Increment offset.\n\t\t\t$offset = ( $limit + $offset );\n\n\t\t\tif ( ! empty( $results ) ) {\n\t\t\t\tforeach ( $results as $r ) {\n\t\t\t\t\t// Set permalinks into array.\n\t\t\t\t\t$hashtable[ $r->meta_value ] = intval( $r->post_id );\n\t\t\t\t}\n\t\t\t}\n\t\t} while ( count( $results ) == $limit );\n\n\t\t// Unset to save memory.\n\t\tunset( $results, $r );\n\n\t\treturn $hashtable;\n\t}\n\n\t/**\n\t * Return count of imported permalinks from WordPress database\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $importer_name\n\t * @param string $bid\n\t * @return int\n\t */\n\tpublic function count_imported_posts( $importer_name, $bid ) {\n\t\tglobal $wpdb;\n\n\t\t$count = 0;\n\n\t\t// Get count of permalinks.\n\t\t$meta_key = $importer_name . '_' . $bid . '_permalink';\n\t\t$sql      = $wpdb->prepare( \"SELECT COUNT( post_id ) AS cnt FROM $wpdb->postmeta WHERE meta_key = %s\", $meta_key );\n\n\t\t$result = $wpdb->get_results( $sql );\n\n\t\tif ( ! empty( $result ) ) {\n\t\t\t$count = intval( $result[0]->cnt );\n\t\t}\n\n\t\t// Unset to save memory.\n\t\tunset( $results );\n\n\t\treturn $count;\n\t}\n\n\t/**\n\t * Set array with imported comments from WordPress database\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $bid\n\t * @return array\n\t */\n\tpublic function get_imported_comments( $bid ) {\n\t\tglobal $wpdb;\n\n\t\t$hashtable = array();\n\n\t\t$limit  = 100;\n\t\t$offset = 0;\n\n\t\t// Grab all comments in chunks.\n\t\tdo {\n\t\t\t$sql     = $wpdb->prepare( \"SELECT comment_ID, comment_agent FROM $wpdb->comments LIMIT %d,%d\", $offset, $limit );\n\t\t\t$results = $wpdb->get_results( $sql );\n\n\t\t\t// Increment offset.\n\t\t\t$offset = ( $limit + $offset );\n\n\t\t\tif ( ! empty( $results ) ) {\n\t\t\t\tforeach ( $results as $r ) {\n\t\t\t\t\t// Explode comment_agent key.\n\t\t\t\t\tlist ( $ca_bid, $source_comment_id ) = explode( '-', $r->comment_agent );\n\t\t\t\t\t$source_comment_id                   = intval( $source_comment_id );\n\n\t\t\t\t\t// Check if this comment came from this blog.\n\t\t\t\t\tif ( $bid == $ca_bid ) {\n\t\t\t\t\t\t$hashtable[ $source_comment_id ] = intval( $r->comment_ID );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} while ( count( $results ) == $limit );\n\n\t\t// Unset to save memory.\n\t\tunset( $results, $r );\n\n\t\treturn $hashtable;\n\t}\n\n\t/**\n\t * @param int $blog_id\n\t * @return int|void\n\t */\n\tpublic function set_blog( $blog_id ) {\n\t\tif ( is_numeric( $blog_id ) ) {\n\t\t\t$blog_id = (int) $blog_id;\n\t\t} else {\n\t\t\t$blog   = 'http://' . preg_replace( '#^https?://#', '', $blog_id );\n\t\t\t$parsed = parse_url( $blog );\n\t\t\tif ( ! $parsed || empty( $parsed['host'] ) ) {\n\t\t\t\tfwrite( STDERR, \"Error: can not determine blog_id from $blog_id\\n\" );\n\t\t\t\texit;\n\t\t\t}\n\t\t\tif ( empty( $parsed['path'] ) ) {\n\t\t\t\t$parsed['path'] = '/';\n\t\t\t}\n\t\t\t$blogs = get_sites(\n\t\t\t\tarray(\n\t\t\t\t\t'domain' => $parsed['host'],\n\t\t\t\t\t'number' => 1,\n\t\t\t\t\t'path'   => $parsed['path'],\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ( ! $blogs ) {\n\t\t\t\tfwrite( STDERR, \"Error: Could not find blog\\n\" );\n\t\t\t\texit;\n\t\t\t}\n\t\t\t$blog    = array_shift( $blogs );\n\t\t\t$blog_id = (int) $blog->blog_id;\n\t\t}\n\n\t\tif ( function_exists( 'is_multisite' ) ) {\n\t\t\tif ( is_multisite() ) {\n\t\t\t\tswitch_to_blog( $blog_id );\n\t\t\t}\n\t\t}\n\n\t\treturn $blog_id;\n\t}\n\n\t/**\n\t * @param int $user_id\n\t * @return int|void\n\t */\n\tpublic function set_user( $user_id ) {\n\t\tif ( is_numeric( $user_id ) ) {\n\t\t\t$user_id = (int) $user_id;\n\t\t} else {\n\t\t\t$user_id = (int) username_exists( $user_id );\n\t\t}\n\n\t\tif ( ! $user_id || ! wp_set_current_user( $user_id ) ) {\n\t\t\tfwrite( STDERR, \"Error: can not find user\\n\" );\n\t\t\texit;\n\t\t}\n\n\t\treturn $user_id;\n\t}\n\n\t/**\n\t * Sort by strlen, longest string first\n\t *\n\t * @param string $a\n\t * @param string $b\n\t * @return int\n\t */\n\tpublic function cmpr_strlen( $a, $b ) {\n\t\treturn strlen( $b ) - strlen( $a );\n\t}\n\n\t/**\n\t * GET URL\n\t *\n\t * @param string $url\n\t * @param string $username\n\t * @param string $password\n\t * @param bool   $head\n\t * @return array\n\t */\n\tpublic function get_page( $url, $username = '', $password = '', $head = false ) {\n\t\t// Increase the timeout.\n\t\tadd_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) );\n\n\t\t$headers = array();\n\t\t$args    = array();\n\t\tif ( true === $head ) {\n\t\t\t$args['method'] = 'HEAD';\n\t\t}\n\t\tif ( ! empty( $username ) && ! empty( $password ) ) {\n\t\t\t$headers['Authorization'] = 'Basic ' . base64_encode( \"$username:$password\" );\n\t\t}\n\n\t\t$args['headers'] = $headers;\n\n\t\treturn wp_safe_remote_request( $url, $args );\n\t}\n\n\t/**\n\t * Bump up the request timeout for http requests\n\t *\n\t * @param int $val\n\t * @return int\n\t */\n\tpublic function bump_request_timeout( $val ) {\n\t\treturn 60;\n\t}\n\n\t/**\n\t * Check if user has exceeded disk quota\n\t *\n\t * @return bool\n\t */\n\tpublic function is_user_over_quota() {\n\t\tif ( function_exists( 'upload_is_user_over_quota' ) ) {\n\t\t\tif ( upload_is_user_over_quota() ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Replace newlines, tabs, and multiple spaces with a single space\n\t *\n\t * @param string $string\n\t * @return string\n\t */\n\tpublic function min_whitespace( $string ) {\n\t\treturn preg_replace( '|[\\r\\n\\t ]+|', ' ', $string );\n\t}\n\n\t/**\n\t * Resets global variables that grow out of control during imports.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @global wpdb  $wpdb       WordPress database abstraction object.\n\t * @global array $wp_actions\n\t */\n\tpublic function stop_the_insanity() {\n\t\tglobal $wpdb, $wp_actions;\n\t\t// Or define( 'WP_IMPORTING', true );\n\t\t$wpdb->queries = array();\n\t\t// Reset $wp_actions to keep it from growing out of control.\n\t\t$wp_actions = array();\n\t}\n}\n\n/**\n * Returns value of command line params.\n * Exits when a required param is not set.\n *\n * @param string $param\n * @param bool   $required\n * @return mixed\n */\nfunction get_cli_args( $param, $required = false ) {\n\t$args = $_SERVER['argv'];\n\tif ( ! is_array( $args ) ) {\n\t\t$args = array();\n\t}\n\n\t$out = array();\n\n\t$last_arg = null;\n\t$return   = null;\n\n\t$il = sizeof( $args );\n\n\tfor ( $i = 1, $il; $i < $il; $i++ ) {\n\t\tif ( (bool) preg_match( '/^--(.+)/', $args[ $i ], $match ) ) {\n\t\t\t$parts = explode( '=', $match[1] );\n\t\t\t$key   = preg_replace( '/[^a-z0-9]+/', '', $parts[0] );\n\n\t\t\tif ( isset( $parts[1] ) ) {\n\t\t\t\t$out[ $key ] = $parts[1];\n\t\t\t} else {\n\t\t\t\t$out[ $key ] = true;\n\t\t\t}\n\n\t\t\t$last_arg = $key;\n\t\t} elseif ( (bool) preg_match( '/^-([a-zA-Z0-9]+)/', $args[ $i ], $match ) ) {\n\t\t\tfor ( $j = 0, $jl = strlen( $match[1] ); $j < $jl; $j++ ) {\n\t\t\t\t$key         = $match[1][ $j ];\n\t\t\t\t$out[ $key ] = true;\n\t\t\t}\n\n\t\t\t$last_arg = $key;\n\t\t} elseif ( null !== $last_arg ) {\n\t\t\t$out[ $last_arg ] = $args[ $i ];\n\t\t}\n\t}\n\n\t// Check array for specified param.\n\tif ( isset( $out[ $param ] ) ) {\n\t\t// Set return value.\n\t\t$return = $out[ $param ];\n\t}\n\n\t// Check for missing required param.\n\tif ( ! isset( $out[ $param ] ) && $required ) {\n\t\t// Display message and exit.\n\t\techo \"\\\"$param\\\" parameter is required but was not specified\\n\";\n\t\texit;\n\t}\n\n\treturn $return;\n}\n", "num_lines": 335}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Administration API: WP_Internal_Pointers class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement an internal admin pointers API.\n *\n * @since 3.3.0\n */\nfinal class WP_Internal_Pointers {\n\t/**\n\t * Initializes the new feature pointers.\n\t *\n\t * @since 3.3.0\n\t *\n\t * All pointers can be disabled using the following:\n\t *     remove_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts' ) );\n\t *\n\t * Individual pointers (e.g. wp390_widgets) can be disabled using the following:\n\t *\n\t *    function yourprefix_remove_pointers() {\n\t *        remove_action(\n\t *            'admin_print_footer_scripts',\n\t *            array( 'WP_Internal_Pointers', 'pointer_wp390_widgets' )\n\t *        );\n\t *    }\n\t *    add_action( 'admin_enqueue_scripts', 'yourprefix_remove_pointers', 11 );\n\t *\n\t * @param string $hook_suffix The current admin page.\n\t */\n\tpublic static function enqueue_scripts( $hook_suffix ) {\n\t\t/*\n\t\t * Register feature pointers\n\t\t *\n\t\t * Format:\n\t\t *     array(\n\t\t *         hook_suffix => pointer callback\n\t\t *     )\n\t\t *\n\t\t * Example:\n\t\t *     array(\n\t\t *         'themes.php' => 'wp390_widgets'\n\t\t *     )\n\t\t */\n\t\t$registered_pointers = array(\n\t\t\t// None currently.\n\t\t);\n\n\t\t// Check if screen related pointer is registered.\n\t\tif ( empty( $registered_pointers[ $hook_suffix ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$pointers = (array) $registered_pointers[ $hook_suffix ];\n\n\t\t/*\n\t\t * Specify required capabilities for feature pointers\n\t\t *\n\t\t * Format:\n\t\t *     array(\n\t\t *         pointer callback => Array of required capabilities\n\t\t *     )\n\t\t *\n\t\t * Example:\n\t\t *     array(\n\t\t *         'wp390_widgets' => array( 'edit_theme_options' )\n\t\t *     )\n\t\t */\n\t\t$caps_required = array(\n\t\t\t// None currently.\n\t\t);\n\n\t\t// Get dismissed pointers.\n\t\t$dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );\n\n\t\t$got_pointers = false;\n\t\tforeach ( array_diff( $pointers, $dismissed ) as $pointer ) {\n\t\t\tif ( isset( $caps_required[ $pointer ] ) ) {\n\t\t\t\tforeach ( $caps_required[ $pointer ] as $cap ) {\n\t\t\t\t\tif ( ! current_user_can( $cap ) ) {\n\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Bind pointer print function.\n\t\t\tadd_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_' . $pointer ) );\n\t\t\t$got_pointers = true;\n\t\t}\n\n\t\tif ( ! $got_pointers ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add pointers script and style to queue.\n\t\twp_enqueue_style( 'wp-pointer' );\n\t\twp_enqueue_script( 'wp-pointer' );\n\t}\n\n\t/**\n\t * Print the pointer JavaScript data.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $pointer_id The pointer ID.\n\t * @param string $selector The HTML elements, on which the pointer should be attached.\n\t * @param array  $args Arguments to be passed to the pointer JS (see wp-pointer.js).\n\t */\n\tprivate static function print_js( $pointer_id, $selector, $args ) {\n\t\tif ( empty( $pointer_id ) || empty( $selector ) || empty( $args ) || empty( $args['content'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t(function($){\n\t\t\tvar options = <?php echo wp_json_encode( $args ); ?>, setup;\n\n\t\t\tif ( ! options )\n\t\t\t\treturn;\n\n\t\t\toptions = $.extend( options, {\n\t\t\t\tclose: function() {\n\t\t\t\t\t$.post( ajaxurl, {\n\t\t\t\t\t\tpointer: '<?php echo $pointer_id; ?>',\n\t\t\t\t\t\taction: 'dismiss-wp-pointer'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tsetup = function() {\n\t\t\t\t$('<?php echo $selector; ?>').first().pointer( options ).pointer('open');\n\t\t\t};\n\n\t\t\tif ( options.position && options.position.defer_loading )\n\t\t\t\t$(window).bind( 'load.wp-pointers', setup );\n\t\t\telse\n\t\t\t\t$(document).ready( setup );\n\n\t\t})( jQuery );\n\t\t</script>\n\t\t<?php\n\t}\n\n\tpublic static function pointer_wp330_toolbar() {}\n\tpublic static function pointer_wp330_media_uploader() {}\n\tpublic static function pointer_wp330_saving_widgets() {}\n\tpublic static function pointer_wp340_customize_current_theme_link() {}\n\tpublic static function pointer_wp340_choose_image_from_library() {}\n\tpublic static function pointer_wp350_media() {}\n\tpublic static function pointer_wp360_revisions() {}\n\tpublic static function pointer_wp360_locks() {}\n\tpublic static function pointer_wp390_widgets() {}\n\tpublic static function pointer_wp410_dfw() {}\n\tpublic static function pointer_wp496_privacy() {}\n\n\t/**\n\t * Prevents new users from seeing existing 'new feature' pointers.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param int $user_id User ID.\n\t */\n\tpublic static function dismiss_pointers_for_new_users( $user_id ) {\n\t\tadd_user_meta( $user_id, 'dismissed_wp_pointers', '' );\n\t}\n}\n", "num_lines": 173}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_Links_List_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n/**\n * Core class used to implement displaying links in a list table.\n *\n * @since 3.1.0\n * @access private\n *\n * @see WP_List_Tsble\n */\nclass WP_Links_List_Table extends WP_List_Table {\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @see WP_List_Table::__construct() for more information on default arguments.\n\t *\n\t * @param array $args An associative array of arguments.\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\tparent::__construct(\n\t\t\tarray(\n\t\t\t\t'plural' => 'bookmarks',\n\t\t\t\t'screen' => isset( $args['screen'] ) ? $args['screen'] : null,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function ajax_user_can() {\n\t\treturn current_user_can( 'manage_links' );\n\t}\n\n\t/**\n\t * @global int    $cat_id\n\t * @global string $s\n\t * @global string $orderby\n\t * @global string $order\n\t */\n\tpublic function prepare_items() {\n\t\tglobal $cat_id, $s, $orderby, $order;\n\n\t\twp_reset_vars( array( 'action', 'cat_id', 'link_id', 'orderby', 'order', 's' ) );\n\n\t\t$args = array(\n\t\t\t'hide_invisible' => 0,\n\t\t\t'hide_empty'     => 0,\n\t\t);\n\n\t\tif ( 'all' !== $cat_id ) {\n\t\t\t$args['category'] = $cat_id;\n\t\t}\n\t\tif ( ! empty( $s ) ) {\n\t\t\t$args['search'] = $s;\n\t\t}\n\t\tif ( ! empty( $orderby ) ) {\n\t\t\t$args['orderby'] = $orderby;\n\t\t}\n\t\tif ( ! empty( $order ) ) {\n\t\t\t$args['order'] = $order;\n\t\t}\n\n\t\t$this->items = get_bookmarks( $args );\n\t}\n\n\t/**\n\t */\n\tpublic function no_items() {\n\t\t_e( 'No links found.' );\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_bulk_actions() {\n\t\t$actions           = array();\n\t\t$actions['delete'] = __( 'Delete' );\n\n\t\treturn $actions;\n\t}\n\n\t/**\n\t * @global int $cat_id\n\t * @param string $which\n\t */\n\tprotected function extra_tablenav( $which ) {\n\t\tglobal $cat_id;\n\n\t\tif ( 'top' !== $which ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<div class=\"alignleft actions\">\n\t\t\t<?php\n\t\t\t$dropdown_options = array(\n\t\t\t\t'selected'        => $cat_id,\n\t\t\t\t'name'            => 'cat_id',\n\t\t\t\t'taxonomy'        => 'link_category',\n\t\t\t\t'show_option_all' => get_taxonomy( 'link_category' )->labels->all_items,\n\t\t\t\t'hide_empty'      => true,\n\t\t\t\t'hierarchical'    => 1,\n\t\t\t\t'show_count'      => 0,\n\t\t\t\t'orderby'         => 'name',\n\t\t\t);\n\n\t\t\techo '<label class=\"screen-reader-text\" for=\"cat_id\">' . __( 'Filter by category' ) . '</label>';\n\t\t\twp_dropdown_categories( $dropdown_options );\n\t\t\tsubmit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic function get_columns() {\n\t\treturn array(\n\t\t\t'cb'         => '<input type=\"checkbox\" />',\n\t\t\t'name'       => _x( 'Name', 'link name' ),\n\t\t\t'url'        => __( 'URL' ),\n\t\t\t'categories' => __( 'Categories' ),\n\t\t\t'rel'        => __( 'Relationship' ),\n\t\t\t'visible'    => __( 'Visible' ),\n\t\t\t'rating'     => __( 'Rating' ),\n\t\t);\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_sortable_columns() {\n\t\treturn array(\n\t\t\t'name'    => 'name',\n\t\t\t'url'     => 'url',\n\t\t\t'visible' => 'visible',\n\t\t\t'rating'  => 'rating',\n\t\t);\n\t}\n\n\t/**\n\t * Get the name of the default primary column.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @return string Name of the default primary column, in this case, 'name'.\n\t */\n\tprotected function get_default_primary_column_name() {\n\t\treturn 'name';\n\t}\n\n\t/**\n\t * Handles the checkbox column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param object $link The current link object.\n\t */\n\tpublic function column_cb( $link ) {\n\t\t?>\n\t\t<label class=\"screen-reader-text\" for=\"cb-select-<?php echo $link->link_id; ?>\">\n\t\t\t<?php\n\t\t\t/* translators: %s: Link name. */\n\t\t\tprintf( __( 'Select %s' ), $link->link_name );\n\t\t\t?>\n\t\t</label>\n\t\t<input type=\"checkbox\" name=\"linkcheck[]\" id=\"cb-select-<?php echo $link->link_id; ?>\" value=\"<?php echo esc_attr( $link->link_id ); ?>\" />\n\t\t<?php\n\t}\n\n\t/**\n\t * Handles the link name column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param object $link The current link object.\n\t */\n\tpublic function column_name( $link ) {\n\t\t$edit_link = get_edit_bookmark_link( $link );\n\t\tprintf(\n\t\t\t'<strong><a class=\"row-title\" href=\"%s\" aria-label=\"%s\">%s</a></strong>',\n\t\t\t$edit_link,\n\t\t\t/* translators: %s: Link name. */\n\t\t\tesc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $link->link_name ) ),\n\t\t\t$link->link_name\n\t\t);\n\t}\n\n\t/**\n\t * Handles the link URL column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param object $link The current link object.\n\t */\n\tpublic function column_url( $link ) {\n\t\t$short_url = url_shorten( $link->link_url );\n\t\techo \"<a href='$link->link_url'>$short_url</a>\";\n\t}\n\n\t/**\n\t * Handles the link categories column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @global int $cat_id\n\t *\n\t * @param object $link The current link object.\n\t */\n\tpublic function column_categories( $link ) {\n\t\tglobal $cat_id;\n\n\t\t$cat_names = array();\n\t\tforeach ( $link->link_category as $category ) {\n\t\t\t$cat = get_term( $category, 'link_category', OBJECT, 'display' );\n\t\t\tif ( is_wp_error( $cat ) ) {\n\t\t\t\techo $cat->get_error_message();\n\t\t\t}\n\t\t\t$cat_name = $cat->name;\n\t\t\tif ( (int) $cat_id !== $category ) {\n\t\t\t\t$cat_name = \"<a href='link-manager.php?cat_id=$category'>$cat_name</a>\";\n\t\t\t}\n\t\t\t$cat_names[] = $cat_name;\n\t\t}\n\t\techo implode( ', ', $cat_names );\n\t}\n\n\t/**\n\t * Handles the link relation column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param object $link The current link object.\n\t */\n\tpublic function column_rel( $link ) {\n\t\techo empty( $link->link_rel ) ? '<br />' : $link->link_rel;\n\t}\n\n\t/**\n\t * Handles the link visibility column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param object $link The current link object.\n\t */\n\tpublic function column_visible( $link ) {\n\t\tif ( 'Y' === $link->link_visible ) {\n\t\t\t_e( 'Yes' );\n\t\t} else {\n\t\t\t_e( 'No' );\n\t\t}\n\t}\n\n\t/**\n\t * Handles the link rating column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param object $link The current link object.\n\t */\n\tpublic function column_rating( $link ) {\n\t\techo $link->link_rating;\n\t}\n\n\t/**\n\t * Handles the default column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param object $link        Link object.\n\t * @param string $column_name Current column name.\n\t */\n\tpublic function column_default( $link, $column_name ) {\n\t\t/**\n\t\t * Fires for each registered custom link column.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param string $column_name Name of the custom column.\n\t\t * @param int    $link_id     Link ID.\n\t\t */\n\t\tdo_action( 'manage_link_custom_column', $column_name, $link->link_id );\n\t}\n\n\tpublic function display_rows() {\n\t\tforeach ( $this->items as $link ) {\n\t\t\t$link                = sanitize_bookmark( $link );\n\t\t\t$link->link_name     = esc_attr( $link->link_name );\n\t\t\t$link->link_category = wp_get_link_cats( $link->link_id );\n\t\t\t?>\n\t\t<tr id=\"link-<?php echo $link->link_id; ?>\">\n\t\t\t<?php $this->single_row_columns( $link ); ?>\n\t\t</tr>\n\t\t\t<?php\n\t\t}\n\t}\n\n\t/**\n\t * Generates and displays row action links.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param object $link        Link being acted upon.\n\t * @param string $column_name Current column name.\n\t * @param string $primary     Primary column name.\n\t * @return string Row actions output for links, or an empty string\n\t *                if the current column is not the primary column.\n\t */\n\tprotected function handle_row_actions( $link, $column_name, $primary ) {\n\t\tif ( $primary !== $column_name ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$edit_link = get_edit_bookmark_link( $link );\n\n\t\t$actions           = array();\n\t\t$actions['edit']   = '<a href=\"' . $edit_link . '\">' . __( 'Edit' ) . '</a>';\n\t\t$actions['delete'] = sprintf(\n\t\t\t'<a class=\"submitdelete\" href=\"%s\" onclick=\"return confirm( \\'%s\\' );\">%s</a>',\n\t\t\twp_nonce_url( \"link.php?action=delete&amp;link_id=$link->link_id\", 'delete-bookmark_' . $link->link_id ),\n\t\t\t/* translators: %s: Link name. */\n\t\t\tesc_js( sprintf( __( \"You are about to delete this link '%s'\\n  'Cancel' to stop, 'OK' to delete.\" ), $link->link_name ) ),\n\t\t\t__( 'Delete' )\n\t\t);\n\n\t\treturn $this->row_actions( $actions );\n\t}\n}\n", "num_lines": 340}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Helper functions for displaying a list of items in an ajaxified HTML table.\n *\n * @package WordPress\n * @subpackage List_Table\n * @since 4.7.0\n */\n\n/**\n * Helper class to be used only by back compat functions\n *\n * @since 3.1.0\n */\nclass _WP_List_Table_Compat extends WP_List_Table {\n\tpublic $_screen;\n\tpublic $_columns;\n\n\tpublic function __construct( $screen, $columns = array() ) {\n\t\tif ( is_string( $screen ) ) {\n\t\t\t$screen = convert_to_screen( $screen );\n\t\t}\n\n\t\t$this->_screen = $screen;\n\n\t\tif ( ! empty( $columns ) ) {\n\t\t\t$this->_columns = $columns;\n\t\t\tadd_filter( 'manage_' . $screen->id . '_columns', array( $this, 'get_columns' ), 0 );\n\t\t}\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_column_info() {\n\t\t$columns  = get_column_headers( $this->_screen );\n\t\t$hidden   = get_hidden_columns( $this->_screen );\n\t\t$sortable = array();\n\t\t$primary  = $this->get_default_primary_column_name();\n\n\t\treturn array( $columns, $hidden, $sortable, $primary );\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic function get_columns() {\n\t\treturn $this->_columns;\n\t}\n}\n", "num_lines": 51}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Administration API: WP_List_Table class\n *\n * @package WordPress\n * @subpackage List_Table\n * @since 3.1.0\n */\n\n/**\n * Base class for displaying a list of items in an ajaxified HTML table.\n *\n * @since 3.1.0\n * @access private\n */\nclass WP_List_Table {\n\n\t/**\n\t * The current list of items.\n\t *\n\t * @since 3.1.0\n\t * @var array\n\t */\n\tpublic $items;\n\n\t/**\n\t * Various information about the current table.\n\t *\n\t * @since 3.1.0\n\t * @var array\n\t */\n\tprotected $_args;\n\n\t/**\n\t * Various information needed for displaying the pagination.\n\t *\n\t * @since 3.1.0\n\t * @var array\n\t */\n\tprotected $_pagination_args = array();\n\n\t/**\n\t * The current screen.\n\t *\n\t * @since 3.1.0\n\t * @var object\n\t */\n\tprotected $screen;\n\n\t/**\n\t * Cached bulk actions.\n\t *\n\t * @since 3.1.0\n\t * @var array\n\t */\n\tprivate $_actions;\n\n\t/**\n\t * Cached pagination output.\n\t *\n\t * @since 3.1.0\n\t * @var string\n\t */\n\tprivate $_pagination;\n\n\t/**\n\t * The view switcher modes.\n\t *\n\t * @since 4.1.0\n\t * @var array\n\t */\n\tprotected $modes = array();\n\n\t/**\n\t * Stores the value returned by ->get_column_info().\n\t *\n\t * @since 4.1.0\n\t * @var array\n\t */\n\tprotected $_column_headers;\n\n\t/**\n\t * {@internal Missing Summary}\n\t *\n\t * @var array\n\t */\n\tprotected $compat_fields = array( '_args', '_pagination_args', 'screen', '_actions', '_pagination' );\n\n\t/**\n\t * {@internal Missing Summary}\n\t *\n\t * @var array\n\t */\n\tprotected $compat_methods = array(\n\t\t'set_pagination_args',\n\t\t'get_views',\n\t\t'get_bulk_actions',\n\t\t'bulk_actions',\n\t\t'row_actions',\n\t\t'months_dropdown',\n\t\t'view_switcher',\n\t\t'comments_bubble',\n\t\t'get_items_per_page',\n\t\t'pagination',\n\t\t'get_sortable_columns',\n\t\t'get_column_info',\n\t\t'get_table_classes',\n\t\t'display_tablenav',\n\t\t'extra_tablenav',\n\t\t'single_row_columns',\n\t);\n\n\t/**\n\t * Constructor.\n\t *\n\t * The child class should call this constructor from its own constructor to override\n\t * the default $args.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param array|string $args {\n\t *     Array or string of arguments.\n\t *\n\t *     @type string $plural   Plural value used for labels and the objects being listed.\n\t *                            This affects things such as CSS class-names and nonces used\n\t *                            in the list table, e.g. 'posts'. Default empty.\n\t *     @type string $singular Singular label for an object being listed, e.g. 'post'.\n\t *                            Default empty\n\t *     @type bool   $ajax     Whether the list table supports Ajax. This includes loading\n\t *                            and sorting data, for example. If true, the class will call\n\t *                            the _js_vars() method in the footer to provide variables\n\t *                            to any scripts handling Ajax events. Default false.\n\t *     @type string $screen   String containing the hook name used to determine the current\n\t *                            screen. If left null, the current screen will be automatically set.\n\t *                            Default null.\n\t * }\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\t$args = wp_parse_args(\n\t\t\t$args,\n\t\t\tarray(\n\t\t\t\t'plural'   => '',\n\t\t\t\t'singular' => '',\n\t\t\t\t'ajax'     => false,\n\t\t\t\t'screen'   => null,\n\t\t\t)\n\t\t);\n\n\t\t$this->screen = convert_to_screen( $args['screen'] );\n\n\t\tadd_filter( \"manage_{$this->screen->id}_columns\", array( $this, 'get_columns' ), 0 );\n\n\t\tif ( ! $args['plural'] ) {\n\t\t\t$args['plural'] = $this->screen->base;\n\t\t}\n\n\t\t$args['plural']   = sanitize_key( $args['plural'] );\n\t\t$args['singular'] = sanitize_key( $args['singular'] );\n\n\t\t$this->_args = $args;\n\n\t\tif ( $args['ajax'] ) {\n\t\t\t// wp_enqueue_script( 'list-table' );\n\t\t\tadd_action( 'admin_footer', array( $this, '_js_vars' ) );\n\t\t}\n\n\t\tif ( empty( $this->modes ) ) {\n\t\t\t$this->modes = array(\n\t\t\t\t'list'    => __( 'Compact view' ),\n\t\t\t\t'excerpt' => __( 'Extended view' ),\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Make private properties readable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name Property to get.\n\t * @return mixed Property.\n\t */\n\tpublic function __get( $name ) {\n\t\tif ( in_array( $name, $this->compat_fields, true ) ) {\n\t\t\treturn $this->$name;\n\t\t}\n\t}\n\n\t/**\n\t * Make private properties settable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name  Property to check if set.\n\t * @param mixed  $value Property value.\n\t * @return mixed Newly-set property.\n\t */\n\tpublic function __set( $name, $value ) {\n\t\tif ( in_array( $name, $this->compat_fields, true ) ) {\n\t\t\treturn $this->$name = $value;\n\t\t}\n\t}\n\n\t/**\n\t * Make private properties checkable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name Property to check if set.\n\t * @return bool Whether the property is set.\n\t */\n\tpublic function __isset( $name ) {\n\t\tif ( in_array( $name, $this->compat_fields, true ) ) {\n\t\t\treturn isset( $this->$name );\n\t\t}\n\t}\n\n\t/**\n\t * Make private properties un-settable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name Property to unset.\n\t */\n\tpublic function __unset( $name ) {\n\t\tif ( in_array( $name, $this->compat_fields, true ) ) {\n\t\t\tunset( $this->$name );\n\t\t}\n\t}\n\n\t/**\n\t * Make private/protected methods readable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name      Method to call.\n\t * @param array  $arguments Arguments to pass when calling.\n\t * @return mixed|bool Return value of the callback, false otherwise.\n\t */\n\tpublic function __call( $name, $arguments ) {\n\t\tif ( in_array( $name, $this->compat_methods, true ) ) {\n\t\t\treturn $this->$name( ...$arguments );\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks the current user's permissions\n\t *\n\t * @since 3.1.0\n\t * @abstract\n\t */\n\tpublic function ajax_user_can() {\n\t\tdie( 'function WP_List_Table::ajax_user_can() must be overridden in a subclass.' );\n\t}\n\n\t/**\n\t * Prepares the list of items for displaying.\n\t *\n\t * @uses WP_List_Table::set_pagination_args()\n\t *\n\t * @since 3.1.0\n\t * @abstract\n\t */\n\tpublic function prepare_items() {\n\t\tdie( 'function WP_List_Table::prepare_items() must be overridden in a subclass.' );\n\t}\n\n\t/**\n\t * An internal method that sets all the necessary pagination arguments\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param array|string $args Array or string of arguments with information about the pagination.\n\t */\n\tprotected function set_pagination_args( $args ) {\n\t\t$args = wp_parse_args(\n\t\t\t$args,\n\t\t\tarray(\n\t\t\t\t'total_items' => 0,\n\t\t\t\t'total_pages' => 0,\n\t\t\t\t'per_page'    => 0,\n\t\t\t)\n\t\t);\n\n\t\tif ( ! $args['total_pages'] && $args['per_page'] > 0 ) {\n\t\t\t$args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );\n\t\t}\n\n\t\t// Redirect if page number is invalid and headers are not already sent.\n\t\tif ( ! headers_sent() && ! wp_doing_ajax() && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) {\n\t\t\twp_redirect( add_query_arg( 'paged', $args['total_pages'] ) );\n\t\t\texit;\n\t\t}\n\n\t\t$this->_pagination_args = $args;\n\t}\n\n\t/**\n\t * Access the pagination args.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $key Pagination argument to retrieve. Common values include 'total_items',\n\t *                    'total_pages', 'per_page', or 'infinite_scroll'.\n\t * @return int Number of items that correspond to the given pagination argument.\n\t */\n\tpublic function get_pagination_arg( $key ) {\n\t\tif ( 'page' === $key ) {\n\t\t\treturn $this->get_pagenum();\n\t\t}\n\n\t\tif ( isset( $this->_pagination_args[ $key ] ) ) {\n\t\t\treturn $this->_pagination_args[ $key ];\n\t\t}\n\t}\n\n\t/**\n\t * Whether the table has items to display or not\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool\n\t */\n\tpublic function has_items() {\n\t\treturn ! empty( $this->items );\n\t}\n\n\t/**\n\t * Message to be displayed when there are no items\n\t *\n\t * @since 3.1.0\n\t */\n\tpublic function no_items() {\n\t\t_e( 'No items found.' );\n\t}\n\n\t/**\n\t * Displays the search box.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $text     The 'submit' button label.\n\t * @param string $input_id ID attribute value for the search input field.\n\t */\n\tpublic function search_box( $text, $input_id ) {\n\t\tif ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$input_id = $input_id . '-search-input';\n\n\t\tif ( ! empty( $_REQUEST['orderby'] ) ) {\n\t\t\techo '<input type=\"hidden\" name=\"orderby\" value=\"' . esc_attr( $_REQUEST['orderby'] ) . '\" />';\n\t\t}\n\t\tif ( ! empty( $_REQUEST['order'] ) ) {\n\t\t\techo '<input type=\"hidden\" name=\"order\" value=\"' . esc_attr( $_REQUEST['order'] ) . '\" />';\n\t\t}\n\t\tif ( ! empty( $_REQUEST['post_mime_type'] ) ) {\n\t\t\techo '<input type=\"hidden\" name=\"post_mime_type\" value=\"' . esc_attr( $_REQUEST['post_mime_type'] ) . '\" />';\n\t\t}\n\t\tif ( ! empty( $_REQUEST['detached'] ) ) {\n\t\t\techo '<input type=\"hidden\" name=\"detached\" value=\"' . esc_attr( $_REQUEST['detached'] ) . '\" />';\n\t\t}\n\t\t?>\n<p class=\"search-box\">\n\t<label class=\"screen-reader-text\" for=\"<?php echo esc_attr( $input_id ); ?>\"><?php echo $text; ?>:</label>\n\t<input type=\"search\" id=\"<?php echo esc_attr( $input_id ); ?>\" name=\"s\" value=\"<?php _admin_search_query(); ?>\" />\n\t\t<?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?>\n</p>\n\t\t<?php\n\t}\n\n\t/**\n\t * Gets the list of views available on this table.\n\t *\n\t * The format is an associative array:\n\t * - `'id' => 'link'`\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return array\n\t */\n\tprotected function get_views() {\n\t\treturn array();\n\t}\n\n\t/**\n\t * Displays the list of views available on this table.\n\t *\n\t * @since 3.1.0\n\t */\n\tpublic function views() {\n\t\t$views = $this->get_views();\n\t\t/**\n\t\t * Filters the list of available list table views.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->screen->id`, refers\n\t\t * to the ID of the current screen, usually a string.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string[] $views An array of available list table views.\n\t\t */\n\t\t$views = apply_filters( \"views_{$this->screen->id}\", $views );\n\n\t\tif ( empty( $views ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->screen->render_screen_reader_content( 'heading_views' );\n\n\t\techo \"<ul class='subsubsub'>\\n\";\n\t\tforeach ( $views as $class => $view ) {\n\t\t\t$views[ $class ] = \"\\t<li class='$class'>$view\";\n\t\t}\n\t\techo implode( \" |</li>\\n\", $views ) . \"</li>\\n\";\n\t\techo '</ul>';\n\t}\n\n\t/**\n\t * Gets the list of bulk actions available on this table.\n\t *\n\t * The format is an associative array:\n\t * - `'option_name' => 'option_title'`\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return array\n\t */\n\tprotected function get_bulk_actions() {\n\t\treturn array();\n\t}\n\n\t/**\n\t * Displays the bulk actions dropdown.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $which The location of the bulk actions: 'top' or 'bottom'.\n\t *                      This is designated as optional for backward compatibility.\n\t */\n\tprotected function bulk_actions( $which = '' ) {\n\t\tif ( is_null( $this->_actions ) ) {\n\t\t\t$this->_actions = $this->get_bulk_actions();\n\n\t\t\t/**\n\t\t\t * Filters the list table bulk actions drop-down.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$this->screen->id`, refers\n\t\t\t * to the ID of the current screen, usually a string.\n\t\t\t *\n\t\t\t * @since 3.1.0\n\t\t\t *\n\t\t\t * @param string[] $actions An array of the available bulk actions.\n\t\t\t */\n\t\t\t$this->_actions = apply_filters( \"bulk_actions-{$this->screen->id}\", $this->_actions ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\t\t$two = '';\n\t\t} else {\n\t\t\t$two = '2';\n\t\t}\n\n\t\tif ( empty( $this->_actions ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo '<label for=\"bulk-action-selector-' . esc_attr( $which ) . '\" class=\"screen-reader-text\">' . __( 'Select bulk action' ) . '</label>';\n\t\techo '<select name=\"action' . $two . '\" id=\"bulk-action-selector-' . esc_attr( $which ) . \"\\\">\\n\";\n\t\techo '<option value=\"-1\">' . __( 'Bulk actions' ) . \"</option>\\n\";\n\n\t\tforeach ( $this->_actions as $name => $title ) {\n\t\t\t$class = 'edit' === $name ? ' class=\"hide-if-no-js\"' : '';\n\n\t\t\techo \"\\t\" . '<option value=\"' . $name . '\"' . $class . '>' . $title . \"</option>\\n\";\n\t\t}\n\n\t\techo \"</select>\\n\";\n\n\t\tsubmit_button( __( 'Apply' ), 'action', '', false, array( 'id' => \"doaction$two\" ) );\n\t\techo \"\\n\";\n\t}\n\n\t/**\n\t * Gets the current action selected from the bulk actions dropdown.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return string|false The action name. False if no action was selected.\n\t */\n\tpublic function current_action() {\n\t\tif ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) {\n\t\t\treturn $_REQUEST['action'];\n\t\t}\n\n\t\tif ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] ) {\n\t\t\treturn $_REQUEST['action2'];\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Generates the required HTML for a list of row action links.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string[] $actions        An array of action links.\n\t * @param bool     $always_visible Whether the actions should be always visible.\n\t * @return string The HTML for the row actions.\n\t */\n\tprotected function row_actions( $actions, $always_visible = false ) {\n\t\t$action_count = count( $actions );\n\n\t\tif ( ! $action_count ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$mode = get_user_setting( 'posts_list_mode', 'list' );\n\n\t\tif ( 'excerpt' === $mode ) {\n\t\t\t$always_visible = true;\n\t\t}\n\n\t\t$out = '<div class=\"' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '\">';\n\n\t\t$i = 0;\n\n\t\tforeach ( $actions as $action => $link ) {\n\t\t\t++$i;\n\n\t\t\t$sep = ( $i < $action_count ) ? ' | ' : '';\n\n\t\t\t$out .= \"<span class='$action'>$link$sep</span>\";\n\t\t}\n\n\t\t$out .= '</div>';\n\n\t\t$out .= '<button type=\"button\" class=\"toggle-row\"><span class=\"screen-reader-text\">' . __( 'Show more details' ) . '</span></button>';\n\n\t\treturn $out;\n\t}\n\n\t/**\n\t * Displays a dropdown for filtering items in the list table by month.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @global wpdb      $wpdb      WordPress database abstraction object.\n\t * @global WP_Locale $wp_locale WordPress date and time locale object.\n\t *\n\t * @param string $post_type The post type.\n\t */\n\tprotected function months_dropdown( $post_type ) {\n\t\tglobal $wpdb, $wp_locale;\n\n\t\t/**\n\t\t * Filters whether to remove the 'Months' drop-down from the post list table.\n\t\t *\n\t\t * @since 4.2.0\n\t\t *\n\t\t * @param bool   $disable   Whether to disable the drop-down. Default false.\n\t\t * @param string $post_type The post type.\n\t\t */\n\t\tif ( apply_filters( 'disable_months_dropdown', false, $post_type ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$extra_checks = \"AND post_status != 'auto-draft'\";\n\t\tif ( ! isset( $_GET['post_status'] ) || 'trash' !== $_GET['post_status'] ) {\n\t\t\t$extra_checks .= \" AND post_status != 'trash'\";\n\t\t} elseif ( isset( $_GET['post_status'] ) ) {\n\t\t\t$extra_checks = $wpdb->prepare( ' AND post_status = %s', $_GET['post_status'] );\n\t\t}\n\n\t\t$months = $wpdb->get_results(\n\t\t\t$wpdb->prepare(\n\t\t\t\t\"\n\t\t\tSELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month\n\t\t\tFROM $wpdb->posts\n\t\t\tWHERE post_type = %s\n\t\t\t$extra_checks\n\t\t\tORDER BY post_date DESC\n\t\t\",\n\t\t\t\t$post_type\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Filters the 'Months' drop-down results.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param object[] $months    Array of the months drop-down query results.\n\t\t * @param string   $post_type The post type.\n\t\t */\n\t\t$months = apply_filters( 'months_dropdown_results', $months, $post_type );\n\n\t\t$month_count = count( $months );\n\n\t\tif ( ! $month_count || ( 1 == $month_count && 0 == $months[0]->month ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;\n\t\t?>\n\t\t<label for=\"filter-by-date\" class=\"screen-reader-text\"><?php _e( 'Filter by date' ); ?></label>\n\t\t<select name=\"m\" id=\"filter-by-date\">\n\t\t\t<option<?php selected( $m, 0 ); ?> value=\"0\"><?php _e( 'All dates' ); ?></option>\n\t\t<?php\n\t\tforeach ( $months as $arc_row ) {\n\t\t\tif ( 0 == $arc_row->year ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$month = zeroise( $arc_row->month, 2 );\n\t\t\t$year  = $arc_row->year;\n\n\t\t\tprintf(\n\t\t\t\t\"<option %s value='%s'>%s</option>\\n\",\n\t\t\t\tselected( $m, $year . $month, false ),\n\t\t\t\tesc_attr( $arc_row->year . $month ),\n\t\t\t\t/* translators: 1: Month name, 2: 4-digit year. */\n\t\t\t\tsprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )\n\t\t\t);\n\t\t}\n\t\t?>\n\t\t</select>\n\t\t<?php\n\t}\n\n\t/**\n\t * Displays a view switcher.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $current_mode\n\t */\n\tprotected function view_switcher( $current_mode ) {\n\t\t?>\n\t\t<input type=\"hidden\" name=\"mode\" value=\"<?php echo esc_attr( $current_mode ); ?>\" />\n\t\t<div class=\"view-switch\">\n\t\t<?php\n\t\tforeach ( $this->modes as $mode => $title ) {\n\t\t\t$classes      = array( 'view-' . $mode );\n\t\t\t$aria_current = '';\n\n\t\t\tif ( $current_mode === $mode ) {\n\t\t\t\t$classes[]    = 'current';\n\t\t\t\t$aria_current = ' aria-current=\"page\"';\n\t\t\t}\n\n\t\t\tprintf(\n\t\t\t\t\"<a href='%s' class='%s' id='view-switch-$mode'$aria_current><span class='screen-reader-text'>%s</span></a>\\n\",\n\t\t\t\tesc_url( remove_query_arg( 'attachment-filter', add_query_arg( 'mode', $mode ) ) ),\n\t\t\t\timplode( ' ', $classes ),\n\t\t\t\t$title\n\t\t\t);\n\t\t}\n\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Displays a comment count bubble.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param int $post_id          The post ID.\n\t * @param int $pending_comments Number of pending comments.\n\t */\n\tprotected function comments_bubble( $post_id, $pending_comments ) {\n\t\t$approved_comments = get_comments_number();\n\n\t\t$approved_comments_number = number_format_i18n( $approved_comments );\n\t\t$pending_comments_number  = number_format_i18n( $pending_comments );\n\n\t\t$approved_only_phrase = sprintf(\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t_n( '%s comment', '%s comments', $approved_comments ),\n\t\t\t$approved_comments_number\n\t\t);\n\n\t\t$approved_phrase = sprintf(\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t_n( '%s approved comment', '%s approved comments', $approved_comments ),\n\t\t\t$approved_comments_number\n\t\t);\n\n\t\t$pending_phrase = sprintf(\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t_n( '%s pending comment', '%s pending comments', $pending_comments ),\n\t\t\t$pending_comments_number\n\t\t);\n\n\t\tif ( ! $approved_comments && ! $pending_comments ) {\n\t\t\t// No comments at all.\n\t\t\tprintf(\n\t\t\t\t'<span aria-hidden=\"true\">&#8212;</span><span class=\"screen-reader-text\">%s</span>',\n\t\t\t\t__( 'No comments' )\n\t\t\t);\n\t\t} elseif ( $approved_comments && 'trash' === get_post_status( $post_id ) ) {\n\t\t\t// Don't link the comment bubble for a trashed post.\n\t\t\tprintf(\n\t\t\t\t'<span class=\"post-com-count post-com-count-approved\"><span class=\"comment-count-approved\" aria-hidden=\"true\">%s</span><span class=\"screen-reader-text\">%s</span></span>',\n\t\t\t\t$approved_comments_number,\n\t\t\t\t$pending_comments ? $approved_phrase : $approved_only_phrase\n\t\t\t);\n\t\t} elseif ( $approved_comments ) {\n\t\t\t// Link the comment bubble to approved comments.\n\t\t\tprintf(\n\t\t\t\t'<a href=\"%s\" class=\"post-com-count post-com-count-approved\"><span class=\"comment-count-approved\" aria-hidden=\"true\">%s</span><span class=\"screen-reader-text\">%s</span></a>',\n\t\t\t\tesc_url(\n\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'p'              => $post_id,\n\t\t\t\t\t\t\t'comment_status' => 'approved',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tadmin_url( 'edit-comments.php' )\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t$approved_comments_number,\n\t\t\t\t$pending_comments ? $approved_phrase : $approved_only_phrase\n\t\t\t);\n\t\t} else {\n\t\t\t// Don't link the comment bubble when there are no approved comments.\n\t\t\tprintf(\n\t\t\t\t'<span class=\"post-com-count post-com-count-no-comments\"><span class=\"comment-count comment-count-no-comments\" aria-hidden=\"true\">%s</span><span class=\"screen-reader-text\">%s</span></span>',\n\t\t\t\t$approved_comments_number,\n\t\t\t\t$pending_comments ? __( 'No approved comments' ) : __( 'No comments' )\n\t\t\t);\n\t\t}\n\n\t\tif ( $pending_comments ) {\n\t\t\tprintf(\n\t\t\t\t'<a href=\"%s\" class=\"post-com-count post-com-count-pending\"><span class=\"comment-count-pending\" aria-hidden=\"true\">%s</span><span class=\"screen-reader-text\">%s</span></a>',\n\t\t\t\tesc_url(\n\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'p'              => $post_id,\n\t\t\t\t\t\t\t'comment_status' => 'moderated',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tadmin_url( 'edit-comments.php' )\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t$pending_comments_number,\n\t\t\t\t$pending_phrase\n\t\t\t);\n\t\t} else {\n\t\t\tprintf(\n\t\t\t\t'<span class=\"post-com-count post-com-count-pending post-com-count-no-pending\"><span class=\"comment-count comment-count-no-pending\" aria-hidden=\"true\">%s</span><span class=\"screen-reader-text\">%s</span></span>',\n\t\t\t\t$pending_comments_number,\n\t\t\t\t$approved_comments ? __( 'No pending comments' ) : __( 'No comments' )\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Gets the current page number.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return int\n\t */\n\tpublic function get_pagenum() {\n\t\t$pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;\n\n\t\tif ( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] ) {\n\t\t\t$pagenum = $this->_pagination_args['total_pages'];\n\t\t}\n\n\t\treturn max( 1, $pagenum );\n\t}\n\n\t/**\n\t * Gets the number of items to display on a single page.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $option\n\t * @param int    $default\n\t * @return int\n\t */\n\tprotected function get_items_per_page( $option, $default = 20 ) {\n\t\t$per_page = (int) get_user_option( $option );\n\t\tif ( empty( $per_page ) || $per_page < 1 ) {\n\t\t\t$per_page = $default;\n\t\t}\n\n\t\t/**\n\t\t * Filters the number of items to be displayed on each page of the list table.\n\t\t *\n\t\t * The dynamic hook name, `$option`, refers to the `per_page` option depending\n\t\t * on the type of list table in use. Possible filter names include:\n\t\t *\n\t\t *  - `edit_comments_per_page`\n\t\t *  - `sites_network_per_page`\n\t\t *  - `site_themes_network_per_page`\n\t\t *  - `themes_network_per_page'`\n\t\t *  - `users_network_per_page`\n\t\t *  - `edit_post_per_page`\n\t\t *  - `edit_page_per_page'`\n\t\t *  - `edit_{$post_type}_per_page`\n\t\t *  - `edit_post_tag_per_page`\n\t\t *  - `edit_category_per_page`\n\t\t *  - `edit_{$taxonomy}_per_page`\n\t\t *  - `site_users_network_per_page`\n\t\t *  - `users_per_page`\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param int $per_page Number of items to be displayed. Default 20.\n\t\t */\n\t\treturn (int) apply_filters( \"{$option}\", $per_page );\n\t}\n\n\t/**\n\t * Displays the pagination.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $which\n\t */\n\tprotected function pagination( $which ) {\n\t\tif ( empty( $this->_pagination_args ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$total_items     = $this->_pagination_args['total_items'];\n\t\t$total_pages     = $this->_pagination_args['total_pages'];\n\t\t$infinite_scroll = false;\n\t\tif ( isset( $this->_pagination_args['infinite_scroll'] ) ) {\n\t\t\t$infinite_scroll = $this->_pagination_args['infinite_scroll'];\n\t\t}\n\n\t\tif ( 'top' === $which && $total_pages > 1 ) {\n\t\t\t$this->screen->render_screen_reader_content( 'heading_pagination' );\n\t\t}\n\n\t\t$output = '<span class=\"displaying-num\">' . sprintf(\n\t\t\t/* translators: %s: Number of items. */\n\t\t\t_n( '%s item', '%s items', $total_items ),\n\t\t\tnumber_format_i18n( $total_items )\n\t\t) . '</span>';\n\n\t\t$current              = $this->get_pagenum();\n\t\t$removable_query_args = wp_removable_query_args();\n\n\t\t$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );\n\n\t\t$current_url = remove_query_arg( $removable_query_args, $current_url );\n\n\t\t$page_links = array();\n\n\t\t$total_pages_before = '<span class=\"paging-input\">';\n\t\t$total_pages_after  = '</span></span>';\n\n\t\t$disable_first = false;\n\t\t$disable_last  = false;\n\t\t$disable_prev  = false;\n\t\t$disable_next  = false;\n\n\t\tif ( 1 == $current ) {\n\t\t\t$disable_first = true;\n\t\t\t$disable_prev  = true;\n\t\t}\n\t\tif ( 2 == $current ) {\n\t\t\t$disable_first = true;\n\t\t}\n\t\tif ( $total_pages == $current ) {\n\t\t\t$disable_last = true;\n\t\t\t$disable_next = true;\n\t\t}\n\t\tif ( $total_pages - 1 == $current ) {\n\t\t\t$disable_last = true;\n\t\t}\n\n\t\tif ( $disable_first ) {\n\t\t\t$page_links[] = '<span class=\"tablenav-pages-navspan button disabled\" aria-hidden=\"true\">&laquo;</span>';\n\t\t} else {\n\t\t\t$page_links[] = sprintf(\n\t\t\t\t\"<a class='first-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>\",\n\t\t\t\tesc_url( remove_query_arg( 'paged', $current_url ) ),\n\t\t\t\t__( 'First page' ),\n\t\t\t\t'&laquo;'\n\t\t\t);\n\t\t}\n\n\t\tif ( $disable_prev ) {\n\t\t\t$page_links[] = '<span class=\"tablenav-pages-navspan button disabled\" aria-hidden=\"true\">&lsaquo;</span>';\n\t\t} else {\n\t\t\t$page_links[] = sprintf(\n\t\t\t\t\"<a class='prev-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>\",\n\t\t\t\tesc_url( add_query_arg( 'paged', max( 1, $current - 1 ), $current_url ) ),\n\t\t\t\t__( 'Previous page' ),\n\t\t\t\t'&lsaquo;'\n\t\t\t);\n\t\t}\n\n\t\tif ( 'bottom' === $which ) {\n\t\t\t$html_current_page  = $current;\n\t\t\t$total_pages_before = '<span class=\"screen-reader-text\">' . __( 'Current Page' ) . '</span><span id=\"table-paging\" class=\"paging-input\"><span class=\"tablenav-paging-text\">';\n\t\t} else {\n\t\t\t$html_current_page = sprintf(\n\t\t\t\t\"%s<input class='current-page' id='current-page-selector' type='text' name='paged' value='%s' size='%d' aria-describedby='table-paging' /><span class='tablenav-paging-text'>\",\n\t\t\t\t'<label for=\"current-page-selector\" class=\"screen-reader-text\">' . __( 'Current Page' ) . '</label>',\n\t\t\t\t$current,\n\t\t\t\tstrlen( $total_pages )\n\t\t\t);\n\t\t}\n\t\t$html_total_pages = sprintf( \"<span class='total-pages'>%s</span>\", number_format_i18n( $total_pages ) );\n\t\t$page_links[]     = $total_pages_before . sprintf(\n\t\t\t/* translators: 1: Current page, 2: Total pages. */\n\t\t\t_x( '%1$s of %2$s', 'paging' ),\n\t\t\t$html_current_page,\n\t\t\t$html_total_pages\n\t\t) . $total_pages_after;\n\n\t\tif ( $disable_next ) {\n\t\t\t$page_links[] = '<span class=\"tablenav-pages-navspan button disabled\" aria-hidden=\"true\">&rsaquo;</span>';\n\t\t} else {\n\t\t\t$page_links[] = sprintf(\n\t\t\t\t\"<a class='next-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>\",\n\t\t\t\tesc_url( add_query_arg( 'paged', min( $total_pages, $current + 1 ), $current_url ) ),\n\t\t\t\t__( 'Next page' ),\n\t\t\t\t'&rsaquo;'\n\t\t\t);\n\t\t}\n\n\t\tif ( $disable_last ) {\n\t\t\t$page_links[] = '<span class=\"tablenav-pages-navspan button disabled\" aria-hidden=\"true\">&raquo;</span>';\n\t\t} else {\n\t\t\t$page_links[] = sprintf(\n\t\t\t\t\"<a class='last-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>\",\n\t\t\t\tesc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),\n\t\t\t\t__( 'Last page' ),\n\t\t\t\t'&raquo;'\n\t\t\t);\n\t\t}\n\n\t\t$pagination_links_class = 'pagination-links';\n\t\tif ( ! empty( $infinite_scroll ) ) {\n\t\t\t$pagination_links_class .= ' hide-if-js';\n\t\t}\n\t\t$output .= \"\\n<span class='$pagination_links_class'>\" . join( \"\\n\", $page_links ) . '</span>';\n\n\t\tif ( $total_pages ) {\n\t\t\t$page_class = $total_pages < 2 ? ' one-page' : '';\n\t\t} else {\n\t\t\t$page_class = ' no-pages';\n\t\t}\n\t\t$this->_pagination = \"<div class='tablenav-pages{$page_class}'>$output</div>\";\n\n\t\techo $this->_pagination;\n\t}\n\n\t/**\n\t * Gets a list of columns.\n\t *\n\t * The format is:\n\t * - `'internal-name' => 'Title'`\n\t *\n\t * @since 3.1.0\n\t * @abstract\n\t *\n\t * @return array\n\t */\n\tpublic function get_columns() {\n\t\tdie( 'function WP_List_Table::get_columns() must be overridden in a subclass.' );\n\t}\n\n\t/**\n\t * Gets a list of sortable columns.\n\t *\n\t * The format is:\n\t * - `'internal-name' => 'orderby'`\n\t * - `'internal-name' => array( 'orderby', 'asc' )` - The second element sets the initial sorting order.\n\t * - `'internal-name' => array( 'orderby', true )`  - The second element makes the initial order descending.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return array\n\t */\n\tprotected function get_sortable_columns() {\n\t\treturn array();\n\t}\n\n\t/**\n\t * Gets the name of the default primary column.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @return string Name of the default primary column, in this case, an empty string.\n\t */\n\tprotected function get_default_primary_column_name() {\n\t\t$columns = $this->get_columns();\n\t\t$column  = '';\n\n\t\tif ( empty( $columns ) ) {\n\t\t\treturn $column;\n\t\t}\n\n\t\t// We need a primary defined so responsive views show something,\n\t\t// so let's fall back to the first non-checkbox column.\n\t\tforeach ( $columns as $col => $column_name ) {\n\t\t\tif ( 'cb' === $col ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$column = $col;\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $column;\n\t}\n\n\t/**\n\t * Public wrapper for WP_List_Table::get_default_primary_column_name().\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return string Name of the default primary column.\n\t */\n\tpublic function get_primary_column() {\n\t\treturn $this->get_primary_column_name();\n\t}\n\n\t/**\n\t * Gets the name of the primary column.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @return string The name of the primary column.\n\t */\n\tprotected function get_primary_column_name() {\n\t\t$columns = get_column_headers( $this->screen );\n\t\t$default = $this->get_default_primary_column_name();\n\n\t\t// If the primary column doesn't exist,\n\t\t// fall back to the first non-checkbox column.\n\t\tif ( ! isset( $columns[ $default ] ) ) {\n\t\t\t$default = WP_List_Table::get_default_primary_column_name();\n\t\t}\n\n\t\t/**\n\t\t * Filters the name of the primary column for the current list table.\n\t\t *\n\t\t * @since 4.3.0\n\t\t *\n\t\t * @param string $default Column name default for the specific list table, e.g. 'name'.\n\t\t * @param string $context Screen ID for specific list table, e.g. 'plugins'.\n\t\t */\n\t\t$column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );\n\n\t\tif ( empty( $column ) || ! isset( $columns[ $column ] ) ) {\n\t\t\t$column = $default;\n\t\t}\n\n\t\treturn $column;\n\t}\n\n\t/**\n\t * Gets a list of all, hidden and sortable columns, with filter applied.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return array\n\t */\n\tprotected function get_column_info() {\n\t\t// $_column_headers is already set / cached.\n\t\tif ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) ) {\n\t\t\t// Back-compat for list tables that have been manually setting $_column_headers for horse reasons.\n\t\t\t// In 4.3, we added a fourth argument for primary column.\n\t\t\t$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );\n\t\t\tforeach ( $this->_column_headers as $key => $value ) {\n\t\t\t\t$column_headers[ $key ] = $value;\n\t\t\t}\n\n\t\t\treturn $column_headers;\n\t\t}\n\n\t\t$columns = get_column_headers( $this->screen );\n\t\t$hidden  = get_hidden_columns( $this->screen );\n\n\t\t$sortable_columns = $this->get_sortable_columns();\n\t\t/**\n\t\t * Filters the list table sortable columns for a specific screen.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->screen->id`, refers\n\t\t * to the ID of the current screen, usually a string.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param array $sortable_columns An array of sortable columns.\n\t\t */\n\t\t$_sortable = apply_filters( \"manage_{$this->screen->id}_sortable_columns\", $sortable_columns );\n\n\t\t$sortable = array();\n\t\tforeach ( $_sortable as $id => $data ) {\n\t\t\tif ( empty( $data ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$data = (array) $data;\n\t\t\tif ( ! isset( $data[1] ) ) {\n\t\t\t\t$data[1] = false;\n\t\t\t}\n\n\t\t\t$sortable[ $id ] = $data;\n\t\t}\n\n\t\t$primary               = $this->get_primary_column_name();\n\t\t$this->_column_headers = array( $columns, $hidden, $sortable, $primary );\n\n\t\treturn $this->_column_headers;\n\t}\n\n\t/**\n\t * Returns the number of visible columns.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return int\n\t */\n\tpublic function get_column_count() {\n\t\tlist ( $columns, $hidden ) = $this->get_column_info();\n\t\t$hidden                    = array_intersect( array_keys( $columns ), array_filter( $hidden ) );\n\t\treturn count( $columns ) - count( $hidden );\n\t}\n\n\t/**\n\t * Prints column headers, accounting for hidden and sortable columns.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param bool $with_id Whether to set the ID attribute or not\n\t */\n\tpublic function print_column_headers( $with_id = true ) {\n\t\tlist( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();\n\n\t\t$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );\n\t\t$current_url = remove_query_arg( 'paged', $current_url );\n\n\t\tif ( isset( $_GET['orderby'] ) ) {\n\t\t\t$current_orderby = $_GET['orderby'];\n\t\t} else {\n\t\t\t$current_orderby = '';\n\t\t}\n\n\t\tif ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) {\n\t\t\t$current_order = 'desc';\n\t\t} else {\n\t\t\t$current_order = 'asc';\n\t\t}\n\n\t\tif ( ! empty( $columns['cb'] ) ) {\n\t\t\tstatic $cb_counter = 1;\n\t\t\t$columns['cb']     = '<label class=\"screen-reader-text\" for=\"cb-select-all-' . $cb_counter . '\">' . __( 'Select All' ) . '</label>'\n\t\t\t\t. '<input id=\"cb-select-all-' . $cb_counter . '\" type=\"checkbox\" />';\n\t\t\t$cb_counter++;\n\t\t}\n\n\t\tforeach ( $columns as $column_key => $column_display_name ) {\n\t\t\t$class = array( 'manage-column', \"column-$column_key\" );\n\n\t\t\tif ( in_array( $column_key, $hidden, true ) ) {\n\t\t\t\t$class[] = 'hidden';\n\t\t\t}\n\n\t\t\tif ( 'cb' === $column_key ) {\n\t\t\t\t$class[] = 'check-column';\n\t\t\t} elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ), true ) ) {\n\t\t\t\t$class[] = 'num';\n\t\t\t}\n\n\t\t\tif ( $column_key === $primary ) {\n\t\t\t\t$class[] = 'column-primary';\n\t\t\t}\n\n\t\t\tif ( isset( $sortable[ $column_key ] ) ) {\n\t\t\t\tlist( $orderby, $desc_first ) = $sortable[ $column_key ];\n\n\t\t\t\tif ( $current_orderby === $orderby ) {\n\t\t\t\t\t$order = 'asc' === $current_order ? 'desc' : 'asc';\n\n\t\t\t\t\t$class[] = 'sorted';\n\t\t\t\t\t$class[] = $current_order;\n\t\t\t\t} else {\n\t\t\t\t\t$order = strtolower( $desc_first );\n\n\t\t\t\t\tif ( ! in_array( $order, array( 'desc', 'asc' ), true ) ) {\n\t\t\t\t\t\t$order = $desc_first ? 'desc' : 'asc';\n\t\t\t\t\t}\n\n\t\t\t\t\t$class[] = 'sortable';\n\t\t\t\t\t$class[] = 'desc' === $order ? 'asc' : 'desc';\n\t\t\t\t}\n\n\t\t\t\t$column_display_name = sprintf(\n\t\t\t\t\t'<a href=\"%s\"><span>%s</span><span class=\"sorting-indicator\"></span></a>',\n\t\t\t\t\tesc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ),\n\t\t\t\t\t$column_display_name\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$tag   = ( 'cb' === $column_key ) ? 'td' : 'th';\n\t\t\t$scope = ( 'th' === $tag ) ? 'scope=\"col\"' : '';\n\t\t\t$id    = $with_id ? \"id='$column_key'\" : '';\n\n\t\t\tif ( ! empty( $class ) ) {\n\t\t\t\t$class = \"class='\" . join( ' ', $class ) . \"'\";\n\t\t\t}\n\n\t\t\techo \"<$tag $scope $id $class>$column_display_name</$tag>\";\n\t\t}\n\t}\n\n\t/**\n\t * Displays the table.\n\t *\n\t * @since 3.1.0\n\t */\n\tpublic function display() {\n\t\t$singular = $this->_args['singular'];\n\n\t\t$this->display_tablenav( 'top' );\n\n\t\t$this->screen->render_screen_reader_content( 'heading_list' );\n\t\t?>\n<table class=\"wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>\">\n\t<thead>\n\t<tr>\n\t\t<?php $this->print_column_headers(); ?>\n\t</tr>\n\t</thead>\n\n\t<tbody id=\"the-list\"\n\t\t<?php\n\t\tif ( $singular ) {\n\t\t\techo \" data-wp-lists='list:$singular'\";\n\t\t}\n\t\t?>\n\t\t>\n\t\t<?php $this->display_rows_or_placeholder(); ?>\n\t</tbody>\n\n\t<tfoot>\n\t<tr>\n\t\t<?php $this->print_column_headers( false ); ?>\n\t</tr>\n\t</tfoot>\n\n</table>\n\t\t<?php\n\t\t$this->display_tablenav( 'bottom' );\n\t}\n\n\t/**\n\t * Gets a list of CSS classes for the WP_List_Table table tag.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return string[] Array of CSS classes for the table tag.\n\t */\n\tprotected function get_table_classes() {\n\t\t$mode = get_user_setting( 'posts_list_mode', 'list' );\n\n\t\t$mode_class = esc_attr( 'table-view-' . $mode );\n\n\t\treturn array( 'widefat', 'fixed', 'striped', $mode_class, $this->_args['plural'] );\n\t}\n\n\t/**\n\t * Generates the table navigation above or below the table\n\t *\n\t * @since 3.1.0\n\t * @param string $which\n\t */\n\tprotected function display_tablenav( $which ) {\n\t\tif ( 'top' === $which ) {\n\t\t\twp_nonce_field( 'bulk-' . $this->_args['plural'] );\n\t\t}\n\t\t?>\n\t<div class=\"tablenav <?php echo esc_attr( $which ); ?>\">\n\n\t\t<?php if ( $this->has_items() ) : ?>\n\t\t<div class=\"alignleft actions bulkactions\">\n\t\t\t<?php $this->bulk_actions( $which ); ?>\n\t\t</div>\n\t\t\t<?php\n\t\tendif;\n\t\t$this->extra_tablenav( $which );\n\t\t$this->pagination( $which );\n\t\t?>\n\n\t\t<br class=\"clear\" />\n\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Extra controls to be displayed between bulk actions and pagination.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $which\n\t */\n\tprotected function extra_tablenav( $which ) {}\n\n\t/**\n\t * Generates the tbody element for the list table.\n\t *\n\t * @since 3.1.0\n\t */\n\tpublic function display_rows_or_placeholder() {\n\t\tif ( $this->has_items() ) {\n\t\t\t$this->display_rows();\n\t\t} else {\n\t\t\techo '<tr class=\"no-items\"><td class=\"colspanchange\" colspan=\"' . $this->get_column_count() . '\">';\n\t\t\t$this->no_items();\n\t\t\techo '</td></tr>';\n\t\t}\n\t}\n\n\t/**\n\t * Generates the table rows.\n\t *\n\t * @since 3.1.0\n\t */\n\tpublic function display_rows() {\n\t\tforeach ( $this->items as $item ) {\n\t\t\t$this->single_row( $item );\n\t\t}\n\t}\n\n\t/**\n\t * Generates content for a single row of the table.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param object $item The current item\n\t */\n\tpublic function single_row( $item ) {\n\t\techo '<tr>';\n\t\t$this->single_row_columns( $item );\n\t\techo '</tr>';\n\t}\n\n\t/**\n\t * @param object $item\n\t * @param string $column_name\n\t */\n\tprotected function column_default( $item, $column_name ) {}\n\n\t/**\n\t * @param object $item\n\t */\n\tprotected function column_cb( $item ) {}\n\n\t/**\n\t * Generates the columns for a single row of the table.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param object $item The current item.\n\t */\n\tprotected function single_row_columns( $item ) {\n\t\tlist( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();\n\n\t\tforeach ( $columns as $column_name => $column_display_name ) {\n\t\t\t$classes = \"$column_name column-$column_name\";\n\t\t\tif ( $primary === $column_name ) {\n\t\t\t\t$classes .= ' has-row-actions column-primary';\n\t\t\t}\n\n\t\t\tif ( in_array( $column_name, $hidden, true ) ) {\n\t\t\t\t$classes .= ' hidden';\n\t\t\t}\n\n\t\t\t// Comments column uses HTML in the display name with screen reader text.\n\t\t\t// Instead of using esc_attr(), we strip tags to get closer to a user-friendly string.\n\t\t\t$data = 'data-colname=\"' . wp_strip_all_tags( $column_display_name ) . '\"';\n\n\t\t\t$attributes = \"class='$classes' $data\";\n\n\t\t\tif ( 'cb' === $column_name ) {\n\t\t\t\techo '<th scope=\"row\" class=\"check-column\">';\n\t\t\t\techo $this->column_cb( $item );\n\t\t\t\techo '</th>';\n\t\t\t} elseif ( method_exists( $this, '_column_' . $column_name ) ) {\n\t\t\t\techo call_user_func(\n\t\t\t\t\tarray( $this, '_column_' . $column_name ),\n\t\t\t\t\t$item,\n\t\t\t\t\t$classes,\n\t\t\t\t\t$data,\n\t\t\t\t\t$primary\n\t\t\t\t);\n\t\t\t} elseif ( method_exists( $this, 'column_' . $column_name ) ) {\n\t\t\t\techo \"<td $attributes>\";\n\t\t\t\techo call_user_func( array( $this, 'column_' . $column_name ), $item );\n\t\t\t\techo $this->handle_row_actions( $item, $column_name, $primary );\n\t\t\t\techo '</td>';\n\t\t\t} else {\n\t\t\t\techo \"<td $attributes>\";\n\t\t\t\techo $this->column_default( $item, $column_name );\n\t\t\t\techo $this->handle_row_actions( $item, $column_name, $primary );\n\t\t\t\techo '</td>';\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Generates and display row actions links for the list table.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param object $item        The item being acted upon.\n\t * @param string $column_name Current column name.\n\t * @param string $primary     Primary column name.\n\t * @return string The row actions HTML, or an empty string\n\t *                if the current column is not the primary column.\n\t */\n\tprotected function handle_row_actions( $item, $column_name, $primary ) {\n\t\treturn $column_name === $primary ? '<button type=\"button\" class=\"toggle-row\"><span class=\"screen-reader-text\">' . __( 'Show more details' ) . '</span></button>' : '';\n\t}\n\n\t/**\n\t * Handles an incoming ajax request (called from admin-ajax.php)\n\t *\n\t * @since 3.1.0\n\t */\n\tpublic function ajax_response() {\n\t\t$this->prepare_items();\n\n\t\tob_start();\n\t\tif ( ! empty( $_REQUEST['no_placeholder'] ) ) {\n\t\t\t$this->display_rows();\n\t\t} else {\n\t\t\t$this->display_rows_or_placeholder();\n\t\t}\n\n\t\t$rows = ob_get_clean();\n\n\t\t$response = array( 'rows' => $rows );\n\n\t\tif ( isset( $this->_pagination_args['total_items'] ) ) {\n\t\t\t$response['total_items_i18n'] = sprintf(\n\t\t\t\t/* translators: Number of items. */\n\t\t\t\t_n( '%s item', '%s items', $this->_pagination_args['total_items'] ),\n\t\t\t\tnumber_format_i18n( $this->_pagination_args['total_items'] )\n\t\t\t);\n\t\t}\n\t\tif ( isset( $this->_pagination_args['total_pages'] ) ) {\n\t\t\t$response['total_pages']      = $this->_pagination_args['total_pages'];\n\t\t\t$response['total_pages_i18n'] = number_format_i18n( $this->_pagination_args['total_pages'] );\n\t\t}\n\n\t\tdie( wp_json_encode( $response ) );\n\t}\n\n\t/**\n\t * Sends required variables to JavaScript land.\n\t *\n\t * @since 3.1.0\n\t */\n\tpublic function _js_vars() {\n\t\t$args = array(\n\t\t\t'class'  => get_class( $this ),\n\t\t\t'screen' => array(\n\t\t\t\t'id'   => $this->screen->id,\n\t\t\t\t'base' => $this->screen->base,\n\t\t\t),\n\t\t);\n\n\t\tprintf( \"<script type='text/javascript'>list_args = %s;</script>\\n\", wp_json_encode( $args ) );\n\t}\n}\n", "num_lines": 1483}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_Media_List_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n/**\n * Core class used to implement displaying media items in a list table.\n *\n * @since 3.1.0\n * @access private\n *\n * @see WP_List_Table\n */\nclass WP_Media_List_Table extends WP_List_Table {\n\t/**\n\t * Holds the number of pending comments for each post.\n\t *\n\t * @since 4.4.0\n\t * @var array\n\t */\n\tprotected $comment_pending_count = array();\n\n\tprivate $detached;\n\n\tprivate $is_trash;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @see WP_List_Table::__construct() for more information on default arguments.\n\t *\n\t * @param array $args An associative array of arguments.\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\t$this->detached = ( isset( $_REQUEST['attachment-filter'] ) && 'detached' === $_REQUEST['attachment-filter'] );\n\n\t\t$this->modes = array(\n\t\t\t'list' => __( 'List view' ),\n\t\t\t'grid' => __( 'Grid view' ),\n\t\t);\n\n\t\tparent::__construct(\n\t\t\tarray(\n\t\t\t\t'plural' => 'media',\n\t\t\t\t'screen' => isset( $args['screen'] ) ? $args['screen'] : null,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function ajax_user_can() {\n\t\treturn current_user_can( 'upload_files' );\n\t}\n\n\t/**\n\t * @global string   $mode                  List table view mode.\n\t * @global WP_Query $wp_query              WordPress Query object.\n\t * @global array    $post_mime_types\n\t * @global array    $avail_post_mime_types\n\t */\n\tpublic function prepare_items() {\n\t\tglobal $mode, $wp_query, $post_mime_types, $avail_post_mime_types;\n\n\t\t$mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];\n\n\t\t// Exclude attachments scheduled for deletion in the next two hours\n\t\t// if they are for zip packages for interrupted or failed updates.\n\t\t// See File_Upload_Upgrader class.\n\t\t$not_in = array();\n\n\t\tforeach ( _get_cron_array() as $cron ) {\n\t\t\tif ( isset( $cron['upgrader_scheduled_cleanup'] ) ) {\n\t\t\t\t$details = reset( $cron['upgrader_scheduled_cleanup'] );\n\n\t\t\t\tif ( ! empty( $details['args'][0] ) ) {\n\t\t\t\t\t$not_in[] = (int) $details['args'][0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $_REQUEST['post__not_in'] ) && is_array( $_REQUEST['post__not_in'] ) ) {\n\t\t\t$not_in = array_merge( array_values( $_REQUEST['post__not_in'] ), $not_in );\n\t\t}\n\n\t\tif ( ! empty( $not_in ) ) {\n\t\t\t$_REQUEST['post__not_in'] = $not_in;\n\t\t}\n\n\t\tlist( $post_mime_types, $avail_post_mime_types ) = wp_edit_attachments_query( $_REQUEST );\n\n\t\t$this->is_trash = isset( $_REQUEST['attachment-filter'] ) && 'trash' === $_REQUEST['attachment-filter'];\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items' => $wp_query->found_posts,\n\t\t\t\t'total_pages' => $wp_query->max_num_pages,\n\t\t\t\t'per_page'    => $wp_query->query_vars['posts_per_page'],\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * @global array $post_mime_types\n\t * @global array $avail_post_mime_types\n\t * @return array\n\t */\n\tprotected function get_views() {\n\t\tglobal $post_mime_types, $avail_post_mime_types;\n\n\t\t$type_links = array();\n\n\t\t$filter = empty( $_GET['attachment-filter'] ) ? '' : $_GET['attachment-filter'];\n\n\t\t$type_links['all'] = sprintf(\n\t\t\t'<option value=\"\"%s>%s</option>',\n\t\t\tselected( $filter, true, false ),\n\t\t\t__( 'All media items' )\n\t\t);\n\n\t\tforeach ( $post_mime_types as $mime_type => $label ) {\n\t\t\tif ( ! wp_match_mime_types( $mime_type, $avail_post_mime_types ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$selected = selected(\n\t\t\t\t$filter && 0 === strpos( $filter, 'post_mime_type:' ) &&\n\t\t\t\t\twp_match_mime_types( $mime_type, str_replace( 'post_mime_type:', '', $filter ) ),\n\t\t\t\ttrue,\n\t\t\t\tfalse\n\t\t\t);\n\n\t\t\t$type_links[ $mime_type ] = sprintf(\n\t\t\t\t'<option value=\"post_mime_type:%s\"%s>%s</option>',\n\t\t\t\tesc_attr( $mime_type ),\n\t\t\t\t$selected,\n\t\t\t\t$label[0]\n\t\t\t);\n\t\t}\n\n\t\t$type_links['detached'] = '<option value=\"detached\"' . ( $this->detached ? ' selected=\"selected\"' : '' ) . '>' . __( 'Unattached' ) . '</option>';\n\n\t\t$type_links['mine'] = sprintf(\n\t\t\t'<option value=\"mine\"%s>%s</option>',\n\t\t\tselected( 'mine' === $filter, true, false ),\n\t\t\t_x( 'Mine', 'media items' )\n\t\t);\n\n\t\tif ( $this->is_trash || ( defined( 'MEDIA_TRASH' ) && MEDIA_TRASH ) ) {\n\t\t\t$type_links['trash'] = sprintf(\n\t\t\t\t'<option value=\"trash\"%s>%s</option>',\n\t\t\t\tselected( 'trash' === $filter, true, false ),\n\t\t\t\t_x( 'Trash', 'attachment filter' )\n\t\t\t);\n\t\t}\n\n\t\treturn $type_links;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_bulk_actions() {\n\t\t$actions = array();\n\t\tif ( MEDIA_TRASH ) {\n\t\t\tif ( $this->is_trash ) {\n\t\t\t\t$actions['untrash'] = __( 'Restore' );\n\t\t\t\t$actions['delete']  = __( 'Delete permanently' );\n\t\t\t} else {\n\t\t\t\t$actions['trash'] = __( 'Move to Trash' );\n\t\t\t}\n\t\t} else {\n\t\t\t$actions['delete'] = __( 'Delete permanently' );\n\t\t}\n\n\t\tif ( $this->detached ) {\n\t\t\t$actions['attach'] = __( 'Attach' );\n\t\t}\n\n\t\treturn $actions;\n\t}\n\n\t/**\n\t * @param string $which\n\t */\n\tprotected function extra_tablenav( $which ) {\n\t\tif ( 'bar' !== $which ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<div class=\"actions\">\n\t\t<?php\n\t\tif ( ! $this->is_trash ) {\n\t\t\t$this->months_dropdown( 'attachment' );\n\t\t}\n\n\t\t/** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */\n\t\tdo_action( 'restrict_manage_posts', $this->screen->post_type, $which );\n\n\t\tsubmit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );\n\n\t\tif ( $this->is_trash && current_user_can( 'edit_others_posts' ) && $this->has_items() ) {\n\t\t\tsubmit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );\n\t\t}\n\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * @return string\n\t */\n\tpublic function current_action() {\n\t\tif ( isset( $_REQUEST['found_post_id'] ) && isset( $_REQUEST['media'] ) ) {\n\t\t\treturn 'attach';\n\t\t}\n\n\t\tif ( isset( $_REQUEST['parent_post_id'] ) && isset( $_REQUEST['media'] ) ) {\n\t\t\treturn 'detach';\n\t\t}\n\n\t\tif ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) {\n\t\t\treturn 'delete_all';\n\t\t}\n\n\t\treturn parent::current_action();\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function has_items() {\n\t\treturn have_posts();\n\t}\n\n\t/**\n\t */\n\tpublic function no_items() {\n\t\tif ( $this->is_trash ) {\n\t\t\t_e( 'No media files found in Trash.' );\n\t\t} else {\n\t\t\t_e( 'No media files found.' );\n\t\t}\n\t}\n\n\t/**\n\t * Override parent views so we can use the filter bar display.\n\t *\n\t * @global string $mode List table view mode.\n\t */\n\tpublic function views() {\n\t\tglobal $mode;\n\n\t\t$views = $this->get_views();\n\n\t\t$this->screen->render_screen_reader_content( 'heading_views' );\n\t\t?>\n<div class=\"wp-filter\">\n\t<div class=\"filter-items\">\n\t\t<?php $this->view_switcher( $mode ); ?>\n\n\t\t<label for=\"attachment-filter\" class=\"screen-reader-text\"><?php _e( 'Filter by type' ); ?></label>\n\t\t<select class=\"attachment-filters\" name=\"attachment-filter\" id=\"attachment-filter\">\n\t\t\t<?php\n\t\t\tif ( ! empty( $views ) ) {\n\t\t\t\tforeach ( $views as $class => $view ) {\n\t\t\t\t\techo \"\\t$view\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t?>\n\t\t</select>\n\n\t\t<?php\n\t\t$this->extra_tablenav( 'bar' );\n\n\t\t/** This filter is documented in wp-admin/inclues/class-wp-list-table.php */\n\t\t$views = apply_filters( \"views_{$this->screen->id}\", array() );\n\n\t\t// Back compat for pre-4.0 view links.\n\t\tif ( ! empty( $views ) ) {\n\t\t\techo '<ul class=\"filter-links\">';\n\t\t\tforeach ( $views as $class => $view ) {\n\t\t\t\techo \"<li class='$class'>$view</li>\";\n\t\t\t}\n\t\t\techo '</ul>';\n\t\t}\n\t\t?>\n\t</div>\n\n\t<div class=\"search-form\">\n\t\t<label for=\"media-search-input\" class=\"media-search-input-label\"><?php esc_html_e( 'Search' ); ?></label>\n\t\t<input type=\"search\" id=\"media-search-input\" class=\"search\" name=\"s\" value=\"<?php _admin_search_query(); ?>\"></div>\n\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic function get_columns() {\n\t\t$posts_columns       = array();\n\t\t$posts_columns['cb'] = '<input type=\"checkbox\" />';\n\t\t/* translators: Column name. */\n\t\t$posts_columns['title']  = _x( 'File', 'column name' );\n\t\t$posts_columns['author'] = __( 'Author' );\n\n\t\t$taxonomies = get_taxonomies_for_attachments( 'objects' );\n\t\t$taxonomies = wp_filter_object_list( $taxonomies, array( 'show_admin_column' => true ), 'and', 'name' );\n\n\t\t/**\n\t\t * Filters the taxonomy columns for attachments in the Media list table.\n\t\t *\n\t\t * @since 3.5.0\n\t\t *\n\t\t * @param string[] $taxonomies An array of registered taxonomy names to show for attachments.\n\t\t * @param string   $post_type  The post type. Default 'attachment'.\n\t\t */\n\t\t$taxonomies = apply_filters( 'manage_taxonomies_for_attachment_columns', $taxonomies, 'attachment' );\n\t\t$taxonomies = array_filter( $taxonomies, 'taxonomy_exists' );\n\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\tif ( 'category' === $taxonomy ) {\n\t\t\t\t$column_key = 'categories';\n\t\t\t} elseif ( 'post_tag' === $taxonomy ) {\n\t\t\t\t$column_key = 'tags';\n\t\t\t} else {\n\t\t\t\t$column_key = 'taxonomy-' . $taxonomy;\n\t\t\t}\n\t\t\t$posts_columns[ $column_key ] = get_taxonomy( $taxonomy )->labels->name;\n\t\t}\n\n\t\t/* translators: Column name. */\n\t\tif ( ! $this->detached ) {\n\t\t\t$posts_columns['parent'] = _x( 'Uploaded to', 'column name' );\n\t\t\tif ( post_type_supports( 'attachment', 'comments' ) ) {\n\t\t\t\t$posts_columns['comments'] = '<span class=\"vers comment-grey-bubble\" title=\"' . esc_attr__( 'Comments' ) . '\"><span class=\"screen-reader-text\">' . __( 'Comments' ) . '</span></span>';\n\t\t\t}\n\t\t}\n\t\t/* translators: Column name. */\n\t\t$posts_columns['date'] = _x( 'Date', 'column name' );\n\t\t/**\n\t\t * Filters the Media list table columns.\n\t\t *\n\t\t * @since 2.5.0\n\t\t *\n\t\t * @param string[] $posts_columns An array of columns displayed in the Media list table.\n\t\t * @param bool     $detached      Whether the list table contains media not attached\n\t\t *                                to any posts. Default true.\n\t\t */\n\t\treturn apply_filters( 'manage_media_columns', $posts_columns, $this->detached );\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_sortable_columns() {\n\t\treturn array(\n\t\t\t'title'    => 'title',\n\t\t\t'author'   => 'author',\n\t\t\t'parent'   => 'parent',\n\t\t\t'comments' => 'comment_count',\n\t\t\t'date'     => array( 'date', true ),\n\t\t);\n\t}\n\n\t/**\n\t * Handles the checkbox column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Post $post The current WP_Post object.\n\t */\n\tpublic function column_cb( $post ) {\n\t\tif ( current_user_can( 'edit_post', $post->ID ) ) {\n\t\t\t?>\n\t\t\t<label class=\"screen-reader-text\" for=\"cb-select-<?php echo $post->ID; ?>\">\n\t\t\t\t<?php\n\t\t\t\t/* translators: %s: Attachment title. */\n\t\t\t\tprintf( __( 'Select %s' ), _draft_or_post_title() );\n\t\t\t\t?>\n\t\t\t</label>\n\t\t\t<input type=\"checkbox\" name=\"media[]\" id=\"cb-select-<?php echo $post->ID; ?>\" value=\"<?php echo $post->ID; ?>\" />\n\t\t\t<?php\n\t\t}\n\t}\n\n\t/**\n\t * Handles the title column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Post $post The current WP_Post object.\n\t */\n\tpublic function column_title( $post ) {\n\t\tlist( $mime ) = explode( '/', $post->post_mime_type );\n\n\t\t$title      = _draft_or_post_title();\n\t\t$thumb      = wp_get_attachment_image( $post->ID, array( 60, 60 ), true, array( 'alt' => '' ) );\n\t\t$link_start = '';\n\t\t$link_end   = '';\n\n\t\tif ( current_user_can( 'edit_post', $post->ID ) && ! $this->is_trash ) {\n\t\t\t$link_start = sprintf(\n\t\t\t\t'<a href=\"%s\" aria-label=\"%s\">',\n\t\t\t\tget_edit_post_link( $post->ID ),\n\t\t\t\t/* translators: %s: Attachment title. */\n\t\t\t\tesc_attr( sprintf( __( '&#8220;%s&#8221; (Edit)' ), $title ) )\n\t\t\t);\n\t\t\t$link_end = '</a>';\n\t\t}\n\n\t\t$class = $thumb ? ' class=\"has-media-icon\"' : '';\n\t\t?>\n\t\t<strong<?php echo $class; ?>>\n\t\t\t<?php\n\t\t\techo $link_start;\n\t\t\tif ( $thumb ) :\n\t\t\t\t?>\n\t\t\t\t<span class=\"media-icon <?php echo sanitize_html_class( $mime . '-icon' ); ?>\"><?php echo $thumb; ?></span>\n\t\t\t\t<?php\n\t\t\tendif;\n\t\t\techo $title . $link_end;\n\t\t\t_media_states( $post );\n\t\t\t?>\n\t\t</strong>\n\t\t<p class=\"filename\">\n\t\t\t<span class=\"screen-reader-text\"><?php _e( 'File name:' ); ?> </span>\n\t\t\t<?php\n\t\t\t$file = get_attached_file( $post->ID );\n\t\t\techo esc_html( wp_basename( $file ) );\n\t\t\t?>\n\t\t</p>\n\t\t<?php\n\t}\n\n\t/**\n\t * Handles the author column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Post $post The current WP_Post object.\n\t */\n\tpublic function column_author( $post ) {\n\t\tprintf(\n\t\t\t'<a href=\"%s\">%s</a>',\n\t\t\tesc_url( add_query_arg( array( 'author' => get_the_author_meta( 'ID' ) ), 'upload.php' ) ),\n\t\t\tget_the_author()\n\t\t);\n\t}\n\n\t/**\n\t * Handles the description column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Post $post The current WP_Post object.\n\t */\n\tpublic function column_desc( $post ) {\n\t\techo has_excerpt() ? $post->post_excerpt : '';\n\t}\n\n\t/**\n\t * Handles the date column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Post $post The current WP_Post object.\n\t */\n\tpublic function column_date( $post ) {\n\t\tif ( '0000-00-00 00:00:00' === $post->post_date ) {\n\t\t\t$h_time = __( 'Unpublished' );\n\t\t} else {\n\t\t\t$time      = get_post_timestamp( $post );\n\t\t\t$time_diff = time() - $time;\n\n\t\t\tif ( $time && $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) {\n\t\t\t\t/* translators: %s: Human-readable time difference. */\n\t\t\t\t$h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );\n\t\t\t} else {\n\t\t\t\t$h_time = get_the_time( __( 'Y/m/d' ), $post );\n\t\t\t}\n\t\t}\n\n\t\techo $h_time;\n\t}\n\n\t/**\n\t * Handles the parent column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Post $post The current WP_Post object.\n\t */\n\tpublic function column_parent( $post ) {\n\t\t$user_can_edit = current_user_can( 'edit_post', $post->ID );\n\n\t\tif ( $post->post_parent > 0 ) {\n\t\t\t$parent = get_post( $post->post_parent );\n\t\t} else {\n\t\t\t$parent = false;\n\t\t}\n\n\t\tif ( $parent ) {\n\t\t\t$title       = _draft_or_post_title( $post->post_parent );\n\t\t\t$parent_type = get_post_type_object( $parent->post_type );\n\n\t\t\tif ( $parent_type && $parent_type->show_ui && current_user_can( 'edit_post', $post->post_parent ) ) {\n\t\t\t\t?>\n\t\t\t\t<strong><a href=\"<?php echo get_edit_post_link( $post->post_parent ); ?>\">\n\t\t\t\t\t<?php echo $title; ?></a></strong>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t} elseif ( $parent_type && current_user_can( 'read_post', $post->post_parent ) ) {\n\t\t\t\t?>\n\t\t\t\t<strong><?php echo $title; ?></strong>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t} else {\n\t\t\t\t_e( '(Private post)' );\n\t\t\t}\n\n\t\t\tif ( $user_can_edit ) :\n\t\t\t\t$detach_url = add_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'parent_post_id' => $post->post_parent,\n\t\t\t\t\t\t'media[]'        => $post->ID,\n\t\t\t\t\t\t'_wpnonce'       => wp_create_nonce( 'bulk-' . $this->_args['plural'] ),\n\t\t\t\t\t),\n\t\t\t\t\t'upload.php'\n\t\t\t\t);\n\t\t\t\tprintf(\n\t\t\t\t\t'<br /><a href=\"%s\" class=\"hide-if-no-js detach-from-parent\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t$detach_url,\n\t\t\t\t\t/* translators: %s: Title of the post the attachment is attached to. */\n\t\t\t\t\tesc_attr( sprintf( __( 'Detach from &#8220;%s&#8221;' ), $title ) ),\n\t\t\t\t\t__( 'Detach' )\n\t\t\t\t);\n\t\t\tendif;\n\t\t} else {\n\t\t\t_e( '(Unattached)' );\n\t\t\t?>\n\t\t\t<?php\n\t\t\tif ( $user_can_edit ) {\n\t\t\t\t$title = _draft_or_post_title( $post->post_parent );\n\t\t\t\tprintf(\n\t\t\t\t\t'<br /><a href=\"#the-list\" onclick=\"findPosts.open( \\'media[]\\', \\'%s\\' ); return false;\" class=\"hide-if-no-js aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t$post->ID,\n\t\t\t\t\t/* translators: %s: Attachment title. */\n\t\t\t\t\tesc_attr( sprintf( __( 'Attach &#8220;%s&#8221; to existing content' ), $title ) ),\n\t\t\t\t\t__( 'Attach' )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Handles the comments column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Post $post The current WP_Post object.\n\t */\n\tpublic function column_comments( $post ) {\n\t\techo '<div class=\"post-com-count-wrapper\">';\n\n\t\tif ( isset( $this->comment_pending_count[ $post->ID ] ) ) {\n\t\t\t$pending_comments = $this->comment_pending_count[ $post->ID ];\n\t\t} else {\n\t\t\t$pending_comments = get_pending_comments_num( $post->ID );\n\t\t}\n\n\t\t$this->comments_bubble( $post->ID, $pending_comments );\n\n\t\techo '</div>';\n\t}\n\n\t/**\n\t * Handles output for the default column.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Post $post        The current WP_Post object.\n\t * @param string  $column_name Current column name.\n\t */\n\tpublic function column_default( $post, $column_name ) {\n\t\tif ( 'categories' === $column_name ) {\n\t\t\t$taxonomy = 'category';\n\t\t} elseif ( 'tags' === $column_name ) {\n\t\t\t$taxonomy = 'post_tag';\n\t\t} elseif ( 0 === strpos( $column_name, 'taxonomy-' ) ) {\n\t\t\t$taxonomy = substr( $column_name, 9 );\n\t\t} else {\n\t\t\t$taxonomy = false;\n\t\t}\n\n\t\tif ( $taxonomy ) {\n\t\t\t$terms = get_the_terms( $post->ID, $taxonomy );\n\t\t\tif ( is_array( $terms ) ) {\n\t\t\t\t$out = array();\n\t\t\t\tforeach ( $terms as $t ) {\n\t\t\t\t\t$posts_in_term_qv             = array();\n\t\t\t\t\t$posts_in_term_qv['taxonomy'] = $taxonomy;\n\t\t\t\t\t$posts_in_term_qv['term']     = $t->slug;\n\n\t\t\t\t\t$out[] = sprintf(\n\t\t\t\t\t\t'<a href=\"%s\">%s</a>',\n\t\t\t\t\t\tesc_url( add_query_arg( $posts_in_term_qv, 'upload.php' ) ),\n\t\t\t\t\t\tesc_html( sanitize_term_field( 'name', $t->name, $t->term_id, $taxonomy, 'display' ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t/* translators: Used between list items, there is a space after the comma. */\n\t\t\t\techo join( __( ', ' ), $out );\n\t\t\t} else {\n\t\t\t\techo '<span aria-hidden=\"true\">&#8212;</span><span class=\"screen-reader-text\">' . get_taxonomy( $taxonomy )->labels->no_terms . '</span>';\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Fires for each custom column in the Media list table.\n\t\t *\n\t\t * Custom columns are registered using the {@see 'manage_media_columns'} filter.\n\t\t *\n\t\t * @since 2.5.0\n\t\t *\n\t\t * @param string $column_name Name of the custom column.\n\t\t * @param int    $post_id     Attachment ID.\n\t\t */\n\t\tdo_action( 'manage_media_custom_column', $column_name, $post->ID );\n\t}\n\n\t/**\n\t * @global WP_Post $post Global post object.\n\t */\n\tpublic function display_rows() {\n\t\tglobal $post, $wp_query;\n\n\t\t$post_ids = wp_list_pluck( $wp_query->posts, 'ID' );\n\t\treset( $wp_query->posts );\n\n\t\t$this->comment_pending_count = get_pending_comments_num( $post_ids );\n\n\t\tadd_filter( 'the_title', 'esc_html' );\n\n\t\twhile ( have_posts() ) :\n\t\t\tthe_post();\n\t\t\tif (\n\t\t\t\t( $this->is_trash && 'trash' !== $post->post_status )\n\t\t\t\t|| ( ! $this->is_trash && 'trash' === $post->post_status )\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$post_owner = ( get_current_user_id() == $post->post_author ) ? 'self' : 'other';\n\t\t\t?>\n\t\t\t<tr id=\"post-<?php echo $post->ID; ?>\" class=\"<?php echo trim( ' author-' . $post_owner . ' status-' . $post->post_status ); ?>\">\n\t\t\t\t<?php $this->single_row_columns( $post ); ?>\n\t\t\t</tr>\n\t\t\t<?php\n\t\tendwhile;\n\t}\n\n\t/**\n\t * Gets the name of the default primary column.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @return string Name of the default primary column, in this case, 'title'.\n\t */\n\tprotected function get_default_primary_column_name() {\n\t\treturn 'title';\n\t}\n\n\t/**\n\t * @param WP_Post $post\n\t * @param string  $att_title\n\t * @return array\n\t */\n\tprivate function _get_row_actions( $post, $att_title ) {\n\t\t$actions = array();\n\n\t\tif ( $this->detached ) {\n\t\t\tif ( current_user_can( 'edit_post', $post->ID ) ) {\n\t\t\t\t$actions['edit'] = sprintf(\n\t\t\t\t\t'<a href=\"%s\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\tget_edit_post_link( $post->ID ),\n\t\t\t\t\t/* translators: %s: Attachment title. */\n\t\t\t\t\tesc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $att_title ) ),\n\t\t\t\t\t__( 'Edit' )\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ( current_user_can( 'delete_post', $post->ID ) ) {\n\t\t\t\tif ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {\n\t\t\t\t\t$actions['trash'] = sprintf(\n\t\t\t\t\t\t'<a href=\"%s\" class=\"submitdelete aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t\twp_nonce_url( \"post.php?action=trash&amp;post=$post->ID\", 'trash-post_' . $post->ID ),\n\t\t\t\t\t\t/* translators: %s: Attachment title. */\n\t\t\t\t\t\tesc_attr( sprintf( __( 'Move &#8220;%s&#8221; to the Trash' ), $att_title ) ),\n\t\t\t\t\t\t_x( 'Trash', 'verb' )\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$delete_ays        = ! MEDIA_TRASH ? \" onclick='return showNotice.warn();'\" : '';\n\t\t\t\t\t$actions['delete'] = sprintf(\n\t\t\t\t\t\t'<a href=\"%s\" class=\"submitdelete aria-button-if-js\"%s aria-label=\"%s\">%s</a>',\n\t\t\t\t\t\twp_nonce_url( \"post.php?action=delete&amp;post=$post->ID\", 'delete-post_' . $post->ID ),\n\t\t\t\t\t\t$delete_ays,\n\t\t\t\t\t\t/* translators: %s: Attachment title. */\n\t\t\t\t\t\tesc_attr( sprintf( __( 'Delete &#8220;%s&#8221; permanently' ), $att_title ) ),\n\t\t\t\t\t\t__( 'Delete Permanently' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$actions['view'] = sprintf(\n\t\t\t\t'<a href=\"%s\" aria-label=\"%s\" rel=\"bookmark\">%s</a>',\n\t\t\t\tget_permalink( $post->ID ),\n\t\t\t\t/* translators: %s: Attachment title. */\n\t\t\t\tesc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $att_title ) ),\n\t\t\t\t__( 'View' )\n\t\t\t);\n\n\t\t\tif ( current_user_can( 'edit_post', $post->ID ) ) {\n\t\t\t\t$actions['attach'] = sprintf(\n\t\t\t\t\t'<a href=\"#the-list\" onclick=\"findPosts.open( \\'media[]\\', \\'%s\\' ); return false;\" class=\"hide-if-no-js aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t$post->ID,\n\t\t\t\t\t/* translators: %s: Attachment title. */\n\t\t\t\t\tesc_attr( sprintf( __( 'Attach &#8220;%s&#8221; to existing content' ), $att_title ) ),\n\t\t\t\t\t__( 'Attach' )\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tif ( current_user_can( 'edit_post', $post->ID ) && ! $this->is_trash ) {\n\t\t\t\t$actions['edit'] = sprintf(\n\t\t\t\t\t'<a href=\"%s\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\tget_edit_post_link( $post->ID ),\n\t\t\t\t\t/* translators: %s: Attachment title. */\n\t\t\t\t\tesc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $att_title ) ),\n\t\t\t\t\t__( 'Edit' )\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ( current_user_can( 'delete_post', $post->ID ) ) {\n\t\t\t\tif ( $this->is_trash ) {\n\t\t\t\t\t$actions['untrash'] = sprintf(\n\t\t\t\t\t\t'<a href=\"%s\" class=\"submitdelete aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t\twp_nonce_url( \"post.php?action=untrash&amp;post=$post->ID\", 'untrash-post_' . $post->ID ),\n\t\t\t\t\t\t/* translators: %s: Attachment title. */\n\t\t\t\t\t\tesc_attr( sprintf( __( 'Restore &#8220;%s&#8221; from the Trash' ), $att_title ) ),\n\t\t\t\t\t\t__( 'Restore' )\n\t\t\t\t\t);\n\t\t\t\t} elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {\n\t\t\t\t\t$actions['trash'] = sprintf(\n\t\t\t\t\t\t'<a href=\"%s\" class=\"submitdelete aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t\twp_nonce_url( \"post.php?action=trash&amp;post=$post->ID\", 'trash-post_' . $post->ID ),\n\t\t\t\t\t\t/* translators: %s: Attachment title. */\n\t\t\t\t\t\tesc_attr( sprintf( __( 'Move &#8220;%s&#8221; to the Trash' ), $att_title ) ),\n\t\t\t\t\t\t_x( 'Trash', 'verb' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif ( $this->is_trash || ! EMPTY_TRASH_DAYS || ! MEDIA_TRASH ) {\n\t\t\t\t\t$delete_ays        = ( ! $this->is_trash && ! MEDIA_TRASH ) ? \" onclick='return showNotice.warn();'\" : '';\n\t\t\t\t\t$actions['delete'] = sprintf(\n\t\t\t\t\t\t'<a href=\"%s\" class=\"submitdelete aria-button-if-js\"%s aria-label=\"%s\">%s</a>',\n\t\t\t\t\t\twp_nonce_url( \"post.php?action=delete&amp;post=$post->ID\", 'delete-post_' . $post->ID ),\n\t\t\t\t\t\t$delete_ays,\n\t\t\t\t\t\t/* translators: %s: Attachment title. */\n\t\t\t\t\t\tesc_attr( sprintf( __( 'Delete &#8220;%s&#8221; permanently' ), $att_title ) ),\n\t\t\t\t\t\t__( 'Delete Permanently' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! $this->is_trash ) {\n\t\t\t\t$actions['view'] = sprintf(\n\t\t\t\t\t'<a href=\"%s\" aria-label=\"%s\" rel=\"bookmark\">%s</a>',\n\t\t\t\t\tget_permalink( $post->ID ),\n\t\t\t\t\t/* translators: %s: Attachment title. */\n\t\t\t\t\tesc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $att_title ) ),\n\t\t\t\t\t__( 'View' )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the action links for each attachment in the Media list table.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string[] $actions  An array of action links for each attachment.\n\t\t *                           Default 'Edit', 'Delete Permanently', 'View'.\n\t\t * @param WP_Post  $post     WP_Post object for the current attachment.\n\t\t * @param bool     $detached Whether the list table contains media not attached\n\t\t *                           to any posts. Default true.\n\t\t */\n\t\treturn apply_filters( 'media_row_actions', $actions, $post, $this->detached );\n\t}\n\n\t/**\n\t * Generates and displays row action links.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param object $post        Attachment being acted upon.\n\t * @param string $column_name Current column name.\n\t * @param string $primary     Primary column name.\n\t * @return string Row actions output for media attachments, or an empty string\n\t *                if the current column is not the primary column.\n\t */\n\tprotected function handle_row_actions( $post, $column_name, $primary ) {\n\t\tif ( $primary !== $column_name ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$att_title = _draft_or_post_title();\n\n\t\treturn $this->row_actions( $this->_get_row_actions( $post, $att_title ) );\n\t}\n}\n", "num_lines": 821}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_MS_Sites_List_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n/**\n * Core class used to implement displaying sites in a list table for the network admin.\n *\n * @since 3.1.0\n * @access private\n *\n * @see WP_List_Table\n */\nclass WP_MS_Sites_List_Table extends WP_List_Table {\n\n\t/**\n\t * Site status list.\n\t *\n\t * @since 4.3.0\n\t * @var array\n\t */\n\tpublic $status_list;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @see WP_List_Table::__construct() for more information on default arguments.\n\t *\n\t * @param array $args An associative array of arguments.\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\t$this->status_list = array(\n\t\t\t'archived' => array( 'site-archived', __( 'Archived' ) ),\n\t\t\t'spam'     => array( 'site-spammed', _x( 'Spam', 'site' ) ),\n\t\t\t'deleted'  => array( 'site-deleted', __( 'Deleted' ) ),\n\t\t\t'mature'   => array( 'site-mature', __( 'Mature' ) ),\n\t\t);\n\n\t\tparent::__construct(\n\t\t\tarray(\n\t\t\t\t'plural' => 'sites',\n\t\t\t\t'screen' => isset( $args['screen'] ) ? $args['screen'] : null,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function ajax_user_can() {\n\t\treturn current_user_can( 'manage_sites' );\n\t}\n\n\t/**\n\t * Prepares the list of sites for display.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @global string $mode List table view mode.\n\t * @global string $s\n\t * @global wpdb   $wpdb WordPress database abstraction object.\n\t */\n\tpublic function prepare_items() {\n\t\tglobal $mode, $s, $wpdb;\n\n\t\tif ( ! empty( $_REQUEST['mode'] ) ) {\n\t\t\t$mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list';\n\t\t\tset_user_setting( 'sites_list_mode', $mode );\n\t\t} else {\n\t\t\t$mode = get_user_setting( 'sites_list_mode', 'list' );\n\t\t}\n\n\t\t$per_page = $this->get_items_per_page( 'sites_network_per_page' );\n\n\t\t$pagenum = $this->get_pagenum();\n\n\t\t$s    = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : '';\n\t\t$wild = '';\n\t\tif ( false !== strpos( $s, '*' ) ) {\n\t\t\t$wild = '*';\n\t\t\t$s    = trim( $s, '*' );\n\t\t}\n\n\t\t/*\n\t\t * If the network is large and a search is not being performed, show only\n\t\t * the latest sites with no paging in order to avoid expensive count queries.\n\t\t */\n\t\tif ( ! $s && wp_is_large_network() ) {\n\t\t\tif ( ! isset( $_REQUEST['orderby'] ) ) {\n\t\t\t\t$_GET['orderby']     = '';\n\t\t\t\t$_REQUEST['orderby'] = '';\n\t\t\t}\n\t\t\tif ( ! isset( $_REQUEST['order'] ) ) {\n\t\t\t\t$_GET['order']     = 'DESC';\n\t\t\t\t$_REQUEST['order'] = 'DESC';\n\t\t\t}\n\t\t}\n\n\t\t$args = array(\n\t\t\t'number'     => intval( $per_page ),\n\t\t\t'offset'     => intval( ( $pagenum - 1 ) * $per_page ),\n\t\t\t'network_id' => get_current_network_id(),\n\t\t);\n\n\t\tif ( empty( $s ) ) {\n\t\t\t// Nothing to do.\n\t\t} elseif ( preg_match( '/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$/', $s ) ||\n\t\t\t\t\tpreg_match( '/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.?$/', $s ) ||\n\t\t\t\t\tpreg_match( '/^[0-9]{1,3}\\.[0-9]{1,3}\\.?$/', $s ) ||\n\t\t\t\t\tpreg_match( '/^[0-9]{1,3}\\.$/', $s ) ) {\n\t\t\t// IPv4 address.\n\t\t\t$sql          = $wpdb->prepare( \"SELECT blog_id FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.IP LIKE %s\", $wpdb->esc_like( $s ) . ( ! empty( $wild ) ? '%' : '' ) );\n\t\t\t$reg_blog_ids = $wpdb->get_col( $sql );\n\n\t\t\tif ( $reg_blog_ids ) {\n\t\t\t\t$args['site__in'] = $reg_blog_ids;\n\t\t\t}\n\t\t} elseif ( is_numeric( $s ) && empty( $wild ) ) {\n\t\t\t$args['ID'] = $s;\n\t\t} else {\n\t\t\t$args['search'] = $s;\n\n\t\t\tif ( ! is_subdomain_install() ) {\n\t\t\t\t$args['search_columns'] = array( 'path' );\n\t\t\t}\n\t\t}\n\n\t\t$order_by = isset( $_REQUEST['orderby'] ) ? $_REQUEST['orderby'] : '';\n\t\tif ( 'registered' === $order_by ) {\n\t\t\t// 'registered' is a valid field name.\n\t\t} elseif ( 'lastupdated' === $order_by ) {\n\t\t\t$order_by = 'last_updated';\n\t\t} elseif ( 'blogname' === $order_by ) {\n\t\t\tif ( is_subdomain_install() ) {\n\t\t\t\t$order_by = 'domain';\n\t\t\t} else {\n\t\t\t\t$order_by = 'path';\n\t\t\t}\n\t\t} elseif ( 'blog_id' === $order_by ) {\n\t\t\t$order_by = 'id';\n\t\t} elseif ( ! $order_by ) {\n\t\t\t$order_by = false;\n\t\t}\n\n\t\t$args['orderby'] = $order_by;\n\n\t\tif ( $order_by ) {\n\t\t\t$args['order'] = ( isset( $_REQUEST['order'] ) && 'DESC' === strtoupper( $_REQUEST['order'] ) ) ? 'DESC' : 'ASC';\n\t\t}\n\n\t\tif ( wp_is_large_network() ) {\n\t\t\t$args['no_found_rows'] = true;\n\t\t} else {\n\t\t\t$args['no_found_rows'] = false;\n\t\t}\n\n\t\t// Take into account the role the user has selected.\n\t\t$status = isset( $_REQUEST['status'] ) ? wp_unslash( trim( $_REQUEST['status'] ) ) : '';\n\t\tif ( in_array( $status, array( 'public', 'archived', 'mature', 'spam', 'deleted' ), true ) ) {\n\t\t\t$args[ $status ] = 1;\n\t\t}\n\n\t\t/**\n\t\t * Filters the arguments for the site query in the sites list table.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param array $args An array of get_sites() arguments.\n\t\t */\n\t\t$args = apply_filters( 'ms_sites_list_table_query_args', $args );\n\n\t\t$_sites = get_sites( $args );\n\t\tif ( is_array( $_sites ) ) {\n\t\t\tupdate_site_cache( $_sites );\n\n\t\t\t$this->items = array_slice( $_sites, 0, $per_page );\n\t\t}\n\n\t\t$total_sites = get_sites(\n\t\t\tarray_merge(\n\t\t\t\t$args,\n\t\t\t\tarray(\n\t\t\t\t\t'count'  => true,\n\t\t\t\t\t'offset' => 0,\n\t\t\t\t\t'number' => 0,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items' => $total_sites,\n\t\t\t\t'per_page'    => $per_page,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t */\n\tpublic function no_items() {\n\t\t_e( 'No sites found.' );\n\t}\n\n\t/**\n\t * Gets links to filter sites by status.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @return array\n\t */\n\tprotected function get_views() {\n\t\t$counts = wp_count_sites();\n\n\t\t$statuses = array(\n\t\t\t/* translators: %s: Number of sites. */\n\t\t\t'all'      => _nx_noop(\n\t\t\t\t'All <span class=\"count\">(%s)</span>',\n\t\t\t\t'All <span class=\"count\">(%s)</span>',\n\t\t\t\t'sites'\n\t\t\t),\n\n\t\t\t/* translators: %s: Number of sites. */\n\t\t\t'public'   => _n_noop(\n\t\t\t\t'Public <span class=\"count\">(%s)</span>',\n\t\t\t\t'Public <span class=\"count\">(%s)</span>'\n\t\t\t),\n\n\t\t\t/* translators: %s: Number of sites. */\n\t\t\t'archived' => _n_noop(\n\t\t\t\t'Archived <span class=\"count\">(%s)</span>',\n\t\t\t\t'Archived <span class=\"count\">(%s)</span>'\n\t\t\t),\n\n\t\t\t/* translators: %s: Number of sites. */\n\t\t\t'mature'   => _n_noop(\n\t\t\t\t'Mature <span class=\"count\">(%s)</span>',\n\t\t\t\t'Mature <span class=\"count\">(%s)</span>'\n\t\t\t),\n\n\t\t\t/* translators: %s: Number of sites. */\n\t\t\t'spam'     => _nx_noop(\n\t\t\t\t'Spam <span class=\"count\">(%s)</span>',\n\t\t\t\t'Spam <span class=\"count\">(%s)</span>',\n\t\t\t\t'sites'\n\t\t\t),\n\n\t\t\t/* translators: %s: Number of sites. */\n\t\t\t'deleted'  => _n_noop(\n\t\t\t\t'Deleted <span class=\"count\">(%s)</span>',\n\t\t\t\t'Deleted <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t);\n\n\t\t$view_links       = array();\n\t\t$requested_status = isset( $_REQUEST['status'] ) ? wp_unslash( trim( $_REQUEST['status'] ) ) : '';\n\t\t$url              = 'sites.php';\n\n\t\tforeach ( $statuses as $status => $label_count ) {\n\t\t\t$current_link_attributes = $requested_status === $status || ( '' === $requested_status && 'all' === $status )\n\t\t\t\t? ' class=\"current\" aria-current=\"page\"'\n\t\t\t\t: '';\n\t\t\tif ( (int) $counts[ $status ] > 0 ) {\n\t\t\t\t$label    = sprintf( translate_nooped_plural( $label_count, $counts[ $status ] ), number_format_i18n( $counts[ $status ] ) );\n\t\t\t\t$full_url = 'all' === $status ? $url : add_query_arg( 'status', $status, $url );\n\n\t\t\t\t$view_links[ $status ] = sprintf(\n\t\t\t\t\t'<a href=\"%1$s\"%2$s>%3$s</a>',\n\t\t\t\t\tesc_url( $full_url ),\n\t\t\t\t\t$current_link_attributes,\n\t\t\t\t\t$label\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $view_links;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_bulk_actions() {\n\t\t$actions = array();\n\t\tif ( current_user_can( 'delete_sites' ) ) {\n\t\t\t$actions['delete'] = __( 'Delete' );\n\t\t}\n\t\t$actions['spam']    = _x( 'Mark as spam', 'site' );\n\t\t$actions['notspam'] = _x( 'Not spam', 'site' );\n\n\t\treturn $actions;\n\t}\n\n\t/**\n\t * @global string $mode List table view mode.\n\t *\n\t * @param string $which The location of the pagination nav markup: 'top' or 'bottom'.\n\t */\n\tprotected function pagination( $which ) {\n\t\tglobal $mode;\n\n\t\tparent::pagination( $which );\n\n\t\tif ( 'top' === $which ) {\n\t\t\t$this->view_switcher( $mode );\n\t\t}\n\t}\n\n\t/**\n\t * Extra controls to be displayed between bulk actions and pagination.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param string $which The location of the extra table nav markup: 'top' or 'bottom'.\n\t */\n\tprotected function extra_tablenav( $which ) {\n\t\t?>\n\t\t<div class=\"alignleft actions\">\n\t\t<?php\n\t\tif ( 'top' === $which ) {\n\t\t\tob_start();\n\n\t\t\t/**\n\t\t\t * Fires before the Filter button on the MS sites list table.\n\t\t\t *\n\t\t\t * @since 5.3.0\n\t\t\t *\n\t\t\t * @param string $which The location of the extra table nav markup: 'top' or 'bottom'.\n\t\t\t */\n\t\t\tdo_action( 'restrict_manage_sites', $which );\n\t\t\t$output = ob_get_clean();\n\t\t\tif ( ! empty( $output ) ) {\n\t\t\t\techo $output;\n\t\t\t\tsubmit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'site-query-submit' ) );\n\t\t\t}\n\t\t}\n\t\t?>\n\t\t</div>\n\t\t<?php\n\t\t/**\n\t\t * Fires immediately following the closing \"actions\" div in the tablenav for the\n\t\t * MS sites list table.\n\t\t *\n\t\t * @since 5.3.0\n\t\t *\n\t\t * @param string $which The location of the extra table nav markup: 'top' or 'bottom'.\n\t\t */\n\t\tdo_action( 'manage_sites_extra_tablenav', $which );\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic function get_columns() {\n\t\t$sites_columns = array(\n\t\t\t'cb'          => '<input type=\"checkbox\" />',\n\t\t\t'blogname'    => __( 'URL' ),\n\t\t\t'lastupdated' => __( 'Last Updated' ),\n\t\t\t'registered'  => _x( 'Registered', 'site' ),\n\t\t\t'users'       => __( 'Users' ),\n\t\t);\n\n\t\tif ( has_filter( 'wpmublogsaction' ) ) {\n\t\t\t$sites_columns['plugins'] = __( 'Actions' );\n\t\t}\n\n\t\t/**\n\t\t * Filters the displayed site columns in Sites list table.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t *\n\t\t * @param string[] $sites_columns An array of displayed site columns. Default 'cb',\n\t\t *                               'blogname', 'lastupdated', 'registered', 'users'.\n\t\t */\n\t\treturn apply_filters( 'wpmu_blogs_columns', $sites_columns );\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_sortable_columns() {\n\t\treturn array(\n\t\t\t'blogname'    => 'blogname',\n\t\t\t'lastupdated' => 'lastupdated',\n\t\t\t'registered'  => 'blog_id',\n\t\t);\n\t}\n\n\t/**\n\t * Handles the checkbox column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param array $blog Current site.\n\t */\n\tpublic function column_cb( $blog ) {\n\t\tif ( ! is_main_site( $blog['blog_id'] ) ) :\n\t\t\t$blogname = untrailingslashit( $blog['domain'] . $blog['path'] );\n\t\t\t?>\n\t\t\t<label class=\"screen-reader-text\" for=\"blog_<?php echo $blog['blog_id']; ?>\">\n\t\t\t\t<?php\n\t\t\t\t/* translators: %s: Site URL. */\n\t\t\t\tprintf( __( 'Select %s' ), $blogname );\n\t\t\t\t?>\n\t\t\t</label>\n\t\t\t<input type=\"checkbox\" id=\"blog_<?php echo $blog['blog_id']; ?>\" name=\"allblogs[]\" value=\"<?php echo esc_attr( $blog['blog_id'] ); ?>\" />\n\t\t\t<?php\n\t\tendif;\n\t}\n\n\t/**\n\t * Handles the ID column output.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $blog Current site.\n\t */\n\tpublic function column_id( $blog ) {\n\t\techo $blog['blog_id'];\n\t}\n\n\t/**\n\t * Handles the site name column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @global string $mode List table view mode.\n\t *\n\t * @param array $blog Current site.\n\t */\n\tpublic function column_blogname( $blog ) {\n\t\tglobal $mode;\n\n\t\t$blogname = untrailingslashit( $blog['domain'] . $blog['path'] );\n\n\t\t?>\n\t\t<strong>\n\t\t\t<a href=\"<?php echo esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ); ?>\" class=\"edit\"><?php echo $blogname; ?></a>\n\t\t\t<?php $this->site_states( $blog ); ?>\n\t\t</strong>\n\t\t<?php\n\t\tif ( 'list' !== $mode ) {\n\t\t\tswitch_to_blog( $blog['blog_id'] );\n\t\t\techo '<p>';\n\t\t\tprintf(\n\t\t\t\t/* translators: 1: Site title, 2: Site tagline. */\n\t\t\t\t__( '%1$s &#8211; %2$s' ),\n\t\t\t\tget_option( 'blogname' ),\n\t\t\t\t'<em>' . get_option( 'blogdescription' ) . '</em>'\n\t\t\t);\n\t\t\techo '</p>';\n\t\t\trestore_current_blog();\n\t\t}\n\t}\n\n\t/**\n\t * Handles the lastupdated column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @global string $mode List table view mode.\n\t *\n\t * @param array $blog Current site.\n\t */\n\tpublic function column_lastupdated( $blog ) {\n\t\tglobal $mode;\n\n\t\tif ( 'list' === $mode ) {\n\t\t\t$date = __( 'Y/m/d' );\n\t\t} else {\n\t\t\t$date = __( 'Y/m/d g:i:s a' );\n\t\t}\n\n\t\techo ( '0000-00-00 00:00:00' === $blog['last_updated'] ) ? __( 'Never' ) : mysql2date( $date, $blog['last_updated'] );\n\t}\n\n\t/**\n\t * Handles the registered column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @global string $mode List table view mode.\n\t *\n\t * @param array $blog Current site.\n\t */\n\tpublic function column_registered( $blog ) {\n\t\tglobal $mode;\n\n\t\tif ( 'list' === $mode ) {\n\t\t\t$date = __( 'Y/m/d' );\n\t\t} else {\n\t\t\t$date = __( 'Y/m/d g:i:s a' );\n\t\t}\n\n\t\tif ( '0000-00-00 00:00:00' === $blog['registered'] ) {\n\t\t\techo '&#x2014;';\n\t\t} else {\n\t\t\techo mysql2date( $date, $blog['registered'] );\n\t\t}\n\t}\n\n\t/**\n\t * Handles the users column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param array $blog Current site.\n\t */\n\tpublic function column_users( $blog ) {\n\t\t$user_count = wp_cache_get( $blog['blog_id'] . '_user_count', 'blog-details' );\n\t\tif ( ! $user_count ) {\n\t\t\t$blog_users = new WP_User_Query(\n\t\t\t\tarray(\n\t\t\t\t\t'blog_id'     => $blog['blog_id'],\n\t\t\t\t\t'fields'      => 'ID',\n\t\t\t\t\t'number'      => 1,\n\t\t\t\t\t'count_total' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$user_count = $blog_users->get_total();\n\t\t\twp_cache_set( $blog['blog_id'] . '_user_count', $user_count, 'blog-details', 12 * HOUR_IN_SECONDS );\n\t\t}\n\n\t\tprintf(\n\t\t\t'<a href=\"%s\">%s</a>',\n\t\t\tesc_url( network_admin_url( 'site-users.php?id=' . $blog['blog_id'] ) ),\n\t\t\tnumber_format_i18n( $user_count )\n\t\t);\n\t}\n\n\t/**\n\t * Handles the plugins column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param array $blog Current site.\n\t */\n\tpublic function column_plugins( $blog ) {\n\t\tif ( has_filter( 'wpmublogsaction' ) ) {\n\t\t\t/**\n\t\t\t * Fires inside the auxiliary 'Actions' column of the Sites list table.\n\t\t\t *\n\t\t\t * By default this column is hidden unless something is hooked to the action.\n\t\t\t *\n\t\t\t * @since MU (3.0.0)\n\t\t\t *\n\t\t\t * @param int $blog_id The site ID.\n\t\t\t */\n\t\t\tdo_action( 'wpmublogsaction', $blog['blog_id'] );\n\t\t}\n\t}\n\n\t/**\n\t * Handles output for the default column.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param array  $blog        Current site.\n\t * @param string $column_name Current column name.\n\t */\n\tpublic function column_default( $blog, $column_name ) {\n\t\t/**\n\t\t * Fires for each registered custom column in the Sites list table.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string $column_name The name of the column to display.\n\t\t * @param int    $blog_id     The site ID.\n\t\t */\n\t\tdo_action( 'manage_sites_custom_column', $column_name, $blog['blog_id'] );\n\t}\n\n\t/**\n\t * @global string $mode List table view mode.\n\t */\n\tpublic function display_rows() {\n\t\tforeach ( $this->items as $blog ) {\n\t\t\t$blog  = $blog->to_array();\n\t\t\t$class = '';\n\t\t\treset( $this->status_list );\n\n\t\t\tforeach ( $this->status_list as $status => $col ) {\n\t\t\t\tif ( 1 == $blog[ $status ] ) {\n\t\t\t\t\t$class = \" class='{$col[0]}'\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\techo \"<tr{$class}>\";\n\n\t\t\t$this->single_row_columns( $blog );\n\n\t\t\techo '</tr>';\n\t\t}\n\t}\n\n\t/**\n\t * Maybe output comma-separated site states.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param array $site\n\t */\n\tprotected function site_states( $site ) {\n\t\t$site_states = array();\n\n\t\t// $site is still an array, so get the object.\n\t\t$_site = WP_Site::get_instance( $site['blog_id'] );\n\n\t\tif ( is_main_site( $_site->id ) ) {\n\t\t\t$site_states['main'] = __( 'Main' );\n\t\t}\n\n\t\treset( $this->status_list );\n\n\t\t$site_status = isset( $_REQUEST['status'] ) ? wp_unslash( trim( $_REQUEST['status'] ) ) : '';\n\t\tforeach ( $this->status_list as $status => $col ) {\n\t\t\tif ( ( 1 === intval( $_site->{$status} ) ) && ( $site_status !== $status ) ) {\n\t\t\t\t$site_states[ $col[0] ] = $col[1];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filter the default site display states for items in the Sites list table.\n\t\t *\n\t\t * @since 5.3.0\n\t\t *\n\t\t * @param array $site_states An array of site states. Default 'Main',\n\t\t *                           'Archived', 'Mature', 'Spam', 'Deleted'.\n\t\t * @param WP_Site $site The current site object.\n\t\t */\n\t\t$site_states = apply_filters( 'display_site_states', $site_states, $_site );\n\n\t\tif ( ! empty( $site_states ) ) {\n\t\t\t$state_count = count( $site_states );\n\t\t\t$i           = 0;\n\t\t\techo ' &mdash; ';\n\t\t\tforeach ( $site_states as $state ) {\n\t\t\t\t++$i;\n\t\t\t\t( $i == $state_count ) ? $sep = '' : $sep = ', ';\n\t\t\t\techo \"<span class='post-state'>{$state}{$sep}</span>\";\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Gets the name of the default primary column.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @return string Name of the default primary column, in this case, 'blogname'.\n\t */\n\tprotected function get_default_primary_column_name() {\n\t\treturn 'blogname';\n\t}\n\n\t/**\n\t * Generates and displays row action links.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param object $blog        Site being acted upon.\n\t * @param string $column_name Current column name.\n\t * @param string $primary     Primary column name.\n\t * @return string Row actions output for sites in Multisite, or an empty string\n\t *                if the current column is not the primary column.\n\t */\n\tprotected function handle_row_actions( $blog, $column_name, $primary ) {\n\t\tif ( $primary !== $column_name ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$blogname = untrailingslashit( $blog['domain'] . $blog['path'] );\n\n\t\t// Preordered.\n\t\t$actions = array(\n\t\t\t'edit'       => '',\n\t\t\t'backend'    => '',\n\t\t\t'activate'   => '',\n\t\t\t'deactivate' => '',\n\t\t\t'archive'    => '',\n\t\t\t'unarchive'  => '',\n\t\t\t'spam'       => '',\n\t\t\t'unspam'     => '',\n\t\t\t'delete'     => '',\n\t\t\t'visit'      => '',\n\t\t);\n\n\t\t$actions['edit']    = '<a href=\"' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '\">' . __( 'Edit' ) . '</a>';\n\t\t$actions['backend'] = \"<a href='\" . esc_url( get_admin_url( $blog['blog_id'] ) ) . \"' class='edit'>\" . __( 'Dashboard' ) . '</a>';\n\t\tif ( get_network()->site_id != $blog['blog_id'] ) {\n\t\t\tif ( '1' == $blog['deleted'] ) {\n\t\t\t\t$actions['activate'] = '<a href=\"' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=activateblog&amp;id=' . $blog['blog_id'] ), 'activateblog_' . $blog['blog_id'] ) ) . '\">' . __( 'Activate' ) . '</a>';\n\t\t\t} else {\n\t\t\t\t$actions['deactivate'] = '<a href=\"' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=deactivateblog&amp;id=' . $blog['blog_id'] ), 'deactivateblog_' . $blog['blog_id'] ) ) . '\">' . __( 'Deactivate' ) . '</a>';\n\t\t\t}\n\n\t\t\tif ( '1' == $blog['archived'] ) {\n\t\t\t\t$actions['unarchive'] = '<a href=\"' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=unarchiveblog&amp;id=' . $blog['blog_id'] ), 'unarchiveblog_' . $blog['blog_id'] ) ) . '\">' . __( 'Unarchive' ) . '</a>';\n\t\t\t} else {\n\t\t\t\t$actions['archive'] = '<a href=\"' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=archiveblog&amp;id=' . $blog['blog_id'] ), 'archiveblog_' . $blog['blog_id'] ) ) . '\">' . _x( 'Archive', 'verb; site' ) . '</a>';\n\t\t\t}\n\n\t\t\tif ( '1' == $blog['spam'] ) {\n\t\t\t\t$actions['unspam'] = '<a href=\"' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=unspamblog&amp;id=' . $blog['blog_id'] ), 'unspamblog_' . $blog['blog_id'] ) ) . '\">' . _x( 'Not Spam', 'site' ) . '</a>';\n\t\t\t} else {\n\t\t\t\t$actions['spam'] = '<a href=\"' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=spamblog&amp;id=' . $blog['blog_id'] ), 'spamblog_' . $blog['blog_id'] ) ) . '\">' . _x( 'Spam', 'site' ) . '</a>';\n\t\t\t}\n\n\t\t\tif ( current_user_can( 'delete_site', $blog['blog_id'] ) ) {\n\t\t\t\t$actions['delete'] = '<a href=\"' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=deleteblog&amp;id=' . $blog['blog_id'] ), 'deleteblog_' . $blog['blog_id'] ) ) . '\">' . __( 'Delete' ) . '</a>';\n\t\t\t}\n\t\t}\n\n\t\t$actions['visit'] = \"<a href='\" . esc_url( get_home_url( $blog['blog_id'], '/' ) ) . \"' rel='bookmark'>\" . __( 'Visit' ) . '</a>';\n\n\t\t/**\n\t\t * Filters the action links displayed for each site in the Sites list table.\n\t\t *\n\t\t * The 'Edit', 'Dashboard', 'Delete', and 'Visit' links are displayed by\n\t\t * default for each site. The site's status determines whether to show the\n\t\t * 'Activate' or 'Deactivate' link, 'Unarchive' or 'Archive' links, and\n\t\t * 'Not Spam' or 'Spam' link for each site.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string[] $actions  An array of action links to be displayed.\n\t\t * @param int      $blog_id  The site ID.\n\t\t * @param string   $blogname Site path, formatted depending on whether it is a sub-domain\n\t\t *                           or subdirectory multisite installation.\n\t\t */\n\t\t$actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname );\n\n\t\treturn $this->row_actions( $actions );\n\t}\n}\n", "num_lines": 740}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_MS_Themes_List_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n/**\n * Core class used to implement displaying themes in a list table for the network admin.\n *\n * @since 3.1.0\n * @access private\n *\n * @see WP_List_Table\n */\nclass WP_MS_Themes_List_Table extends WP_List_Table {\n\n\tpublic $site_id;\n\tpublic $is_site_themes;\n\n\tprivate $has_items;\n\n\t/**\n\t * Whether to show the auto-updates UI.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @var bool True if auto-updates UI is to be shown, false otherwise.\n\t */\n\tprotected $show_autoupdates = true;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @see WP_List_Table::__construct() for more information on default arguments.\n\t *\n\t * @global string $status\n\t * @global int    $page\n\t *\n\t * @param array $args An associative array of arguments.\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\tglobal $status, $page;\n\n\t\tparent::__construct(\n\t\t\tarray(\n\t\t\t\t'plural' => 'themes',\n\t\t\t\t'screen' => isset( $args['screen'] ) ? $args['screen'] : null,\n\t\t\t)\n\t\t);\n\n\t\t$status = isset( $_REQUEST['theme_status'] ) ? $_REQUEST['theme_status'] : 'all';\n\t\tif ( ! in_array( $status, array( 'all', 'enabled', 'disabled', 'upgrade', 'search', 'broken', 'auto-update-enabled', 'auto-update-disabled' ), true ) ) {\n\t\t\t$status = 'all';\n\t\t}\n\n\t\t$page = $this->get_pagenum();\n\n\t\t$this->is_site_themes = ( 'site-themes-network' === $this->screen->id ) ? true : false;\n\n\t\tif ( $this->is_site_themes ) {\n\t\t\t$this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;\n\t\t}\n\n\t\t$this->show_autoupdates = wp_is_auto_update_enabled_for_type( 'theme' ) &&\n\t\t\t! $this->is_site_themes && current_user_can( 'update_themes' );\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_table_classes() {\n\t\t// @todo Remove and add CSS for .themes.\n\t\treturn array( 'widefat', 'plugins' );\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function ajax_user_can() {\n\t\tif ( $this->is_site_themes ) {\n\t\t\treturn current_user_can( 'manage_sites' );\n\t\t} else {\n\t\t\treturn current_user_can( 'manage_network_themes' );\n\t\t}\n\t}\n\n\t/**\n\t * @global string $status\n\t * @global array $totals\n\t * @global int $page\n\t * @global string $orderby\n\t * @global string $order\n\t * @global string $s\n\t */\n\tpublic function prepare_items() {\n\t\tglobal $status, $totals, $page, $orderby, $order, $s;\n\n\t\twp_reset_vars( array( 'orderby', 'order', 's' ) );\n\n\t\t$themes = array(\n\t\t\t/**\n\t\t\t * Filters the full array of WP_Theme objects to list in the Multisite\n\t\t\t * themes list table.\n\t\t\t *\n\t\t\t * @since 3.1.0\n\t\t\t *\n\t\t\t * @param WP_Theme[] $all Array of WP_Theme objects to display in the list table.\n\t\t\t */\n\t\t\t'all'      => apply_filters( 'all_themes', wp_get_themes() ),\n\t\t\t'search'   => array(),\n\t\t\t'enabled'  => array(),\n\t\t\t'disabled' => array(),\n\t\t\t'upgrade'  => array(),\n\t\t\t'broken'   => $this->is_site_themes ? array() : wp_get_themes( array( 'errors' => true ) ),\n\t\t);\n\n\t\tif ( $this->show_autoupdates ) {\n\t\t\t$auto_updates = (array) get_site_option( 'auto_update_themes', array() );\n\n\t\t\t$themes['auto-update-enabled']  = array();\n\t\t\t$themes['auto-update-disabled'] = array();\n\t\t}\n\n\t\tif ( $this->is_site_themes ) {\n\t\t\t$themes_per_page = $this->get_items_per_page( 'site_themes_network_per_page' );\n\t\t\t$allowed_where   = 'site';\n\t\t} else {\n\t\t\t$themes_per_page = $this->get_items_per_page( 'themes_network_per_page' );\n\t\t\t$allowed_where   = 'network';\n\t\t}\n\n\t\t$current      = get_site_transient( 'update_themes' );\n\t\t$maybe_update = current_user_can( 'update_themes' ) && ! $this->is_site_themes && $current;\n\n\t\tforeach ( (array) $themes['all'] as $key => $theme ) {\n\t\t\tif ( $this->is_site_themes && $theme->is_allowed( 'network' ) ) {\n\t\t\t\tunset( $themes['all'][ $key ] );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $maybe_update && isset( $current->response[ $key ] ) ) {\n\t\t\t\t$themes['all'][ $key ]->update = true;\n\t\t\t\t$themes['upgrade'][ $key ]     = $themes['all'][ $key ];\n\t\t\t}\n\n\t\t\t$filter                    = $theme->is_allowed( $allowed_where, $this->site_id ) ? 'enabled' : 'disabled';\n\t\t\t$themes[ $filter ][ $key ] = $themes['all'][ $key ];\n\n\t\t\t$theme_data = array(\n\t\t\t\t'update_supported' => isset( $theme->update_supported ) ? $theme->update_supported : true,\n\t\t\t);\n\n\t\t\t// Extra info if known. array_merge() ensures $theme_data has precedence if keys collide.\n\t\t\tif ( isset( $current->response[ $key ] ) ) {\n\t\t\t\t$theme_data = array_merge( (array) $current->response[ $key ], $theme_data );\n\t\t\t} elseif ( isset( $current->no_update[ $key ] ) ) {\n\t\t\t\t$theme_data = array_merge( (array) $current->no_update[ $key ], $theme_data );\n\t\t\t} else {\n\t\t\t\t$theme_data['update_supported'] = false;\n\t\t\t}\n\n\t\t\t$theme->update_supported = $theme_data['update_supported'];\n\n\t\t\t/*\n\t\t\t * Create the expected payload for the auto_update_theme filter, this is the same data\n\t\t\t * as contained within $updates or $no_updates but used when the Theme is not known.\n\t\t\t */\n\t\t\t$filter_payload = array(\n\t\t\t\t'theme'        => $key,\n\t\t\t\t'new_version'  => '',\n\t\t\t\t'url'          => '',\n\t\t\t\t'package'      => '',\n\t\t\t\t'requires'     => '',\n\t\t\t\t'requires_php' => '',\n\t\t\t);\n\n\t\t\t$filter_payload = array_merge( $filter_payload, array_intersect_key( $theme_data, $filter_payload ) );\n\n\t\t\t$type = 'theme';\n\t\t\t/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */\n\t\t\t$auto_update_forced = apply_filters( \"auto_update_{$type}\", null, (object) $filter_payload );\n\n\t\t\tif ( ! is_null( $auto_update_forced ) ) {\n\t\t\t\t$theme->auto_update_forced = $auto_update_forced;\n\t\t\t}\n\n\t\t\tif ( $this->show_autoupdates ) {\n\t\t\t\t$enabled = in_array( $key, $auto_updates, true ) && $theme->update_supported;\n\t\t\t\tif ( isset( $theme->auto_update_forced ) ) {\n\t\t\t\t\t$enabled = (bool) $theme->auto_update_forced;\n\t\t\t\t}\n\n\t\t\t\tif ( $enabled ) {\n\t\t\t\t\t$themes['auto-update-enabled'][ $key ] = $theme;\n\t\t\t\t} else {\n\t\t\t\t\t$themes['auto-update-disabled'][ $key ] = $theme;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( $s ) {\n\t\t\t$status           = 'search';\n\t\t\t$themes['search'] = array_filter( array_merge( $themes['all'], $themes['broken'] ), array( $this, '_search_callback' ) );\n\t\t}\n\n\t\t$totals = array();\n\t\tforeach ( $themes as $type => $list ) {\n\t\t\t$totals[ $type ] = count( $list );\n\t\t}\n\n\t\tif ( empty( $themes[ $status ] ) && ! in_array( $status, array( 'all', 'search' ), true ) ) {\n\t\t\t$status = 'all';\n\t\t}\n\n\t\t$this->items = $themes[ $status ];\n\t\tWP_Theme::sort_by_name( $this->items );\n\n\t\t$this->has_items = ! empty( $themes['all'] );\n\t\t$total_this_page = $totals[ $status ];\n\n\t\twp_localize_script(\n\t\t\t'updates',\n\t\t\t'_wpUpdatesItemCounts',\n\t\t\tarray(\n\t\t\t\t'themes' => $totals,\n\t\t\t\t'totals' => wp_get_update_data(),\n\t\t\t)\n\t\t);\n\n\t\tif ( $orderby ) {\n\t\t\t$orderby = ucfirst( $orderby );\n\t\t\t$order   = strtoupper( $order );\n\n\t\t\tif ( 'Name' === $orderby ) {\n\t\t\t\tif ( 'ASC' === $order ) {\n\t\t\t\t\t$this->items = array_reverse( $this->items );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tuasort( $this->items, array( $this, '_order_callback' ) );\n\t\t\t}\n\t\t}\n\n\t\t$start = ( $page - 1 ) * $themes_per_page;\n\n\t\tif ( $total_this_page > $themes_per_page ) {\n\t\t\t$this->items = array_slice( $this->items, $start, $themes_per_page, true );\n\t\t}\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items' => $total_this_page,\n\t\t\t\t'per_page'    => $themes_per_page,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * @param WP_Theme $theme\n\t * @return bool\n\t */\n\tpublic function _search_callback( $theme ) {\n\t\tstatic $term = null;\n\t\tif ( is_null( $term ) ) {\n\t\t\t$term = wp_unslash( $_REQUEST['s'] );\n\t\t}\n\n\t\tforeach ( array( 'Name', 'Description', 'Author', 'Author', 'AuthorURI' ) as $field ) {\n\t\t\t// Don't mark up; Do translate.\n\t\t\tif ( false !== stripos( $theme->display( $field, false, true ), $term ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ( false !== stripos( $theme->get_stylesheet(), $term ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( false !== stripos( $theme->get_template(), $term ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t// Not used by any core columns.\n\t/**\n\t * @global string $orderby\n\t * @global string $order\n\t * @param array $theme_a\n\t * @param array $theme_b\n\t * @return int\n\t */\n\tpublic function _order_callback( $theme_a, $theme_b ) {\n\t\tglobal $orderby, $order;\n\n\t\t$a = $theme_a[ $orderby ];\n\t\t$b = $theme_b[ $orderby ];\n\n\t\tif ( $a == $b ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif ( 'DESC' === $order ) {\n\t\t\treturn ( $a < $b ) ? 1 : -1;\n\t\t} else {\n\t\t\treturn ( $a < $b ) ? -1 : 1;\n\t\t}\n\t}\n\n\t/**\n\t */\n\tpublic function no_items() {\n\t\tif ( $this->has_items ) {\n\t\t\t_e( 'No themes found.' );\n\t\t} else {\n\t\t\t_e( 'No themes are currently available.' );\n\t\t}\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic function get_columns() {\n\t\t$columns = array(\n\t\t\t'cb'          => '<input type=\"checkbox\" />',\n\t\t\t'name'        => __( 'Theme' ),\n\t\t\t'description' => __( 'Description' ),\n\t\t);\n\n\t\tif ( $this->show_autoupdates ) {\n\t\t\t$columns['auto-updates'] = __( 'Automatic Updates' );\n\t\t}\n\n\t\treturn $columns;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_sortable_columns() {\n\t\treturn array(\n\t\t\t'name' => 'name',\n\t\t);\n\t}\n\n\t/**\n\t * Gets the name of the primary column.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @return string Unalterable name of the primary column name, in this case, 'name'.\n\t */\n\tprotected function get_primary_column_name() {\n\t\treturn 'name';\n\t}\n\n\t/**\n\t * @global array $totals\n\t * @global string $status\n\t * @return array\n\t */\n\tprotected function get_views() {\n\t\tglobal $totals, $status;\n\n\t\t$status_links = array();\n\t\tforeach ( $totals as $type => $count ) {\n\t\t\tif ( ! $count ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase 'all':\n\t\t\t\t\t/* translators: %s: Number of themes. */\n\t\t\t\t\t$text = _nx(\n\t\t\t\t\t\t'All <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'All <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count,\n\t\t\t\t\t\t'themes'\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'enabled':\n\t\t\t\t\t/* translators: %s: Number of themes. */\n\t\t\t\t\t$text = _nx(\n\t\t\t\t\t\t'Enabled <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'Enabled <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count,\n\t\t\t\t\t\t'themes'\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'disabled':\n\t\t\t\t\t/* translators: %s: Number of themes. */\n\t\t\t\t\t$text = _nx(\n\t\t\t\t\t\t'Disabled <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'Disabled <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count,\n\t\t\t\t\t\t'themes'\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'upgrade':\n\t\t\t\t\t/* translators: %s: Number of themes. */\n\t\t\t\t\t$text = _nx(\n\t\t\t\t\t\t'Update Available <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'Update Available <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count,\n\t\t\t\t\t\t'themes'\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'broken':\n\t\t\t\t\t/* translators: %s: Number of themes. */\n\t\t\t\t\t$text = _nx(\n\t\t\t\t\t\t'Broken <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'Broken <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count,\n\t\t\t\t\t\t'themes'\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'auto-update-enabled':\n\t\t\t\t\t/* translators: %s: Number of themes. */\n\t\t\t\t\t$text = _n(\n\t\t\t\t\t\t'Auto-updates Enabled <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'Auto-updates Enabled <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'auto-update-disabled':\n\t\t\t\t\t/* translators: %s: Number of themes. */\n\t\t\t\t\t$text = _n(\n\t\t\t\t\t\t'Auto-updates Disabled <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'Auto-updates Disabled <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( $this->is_site_themes ) {\n\t\t\t\t$url = 'site-themes.php?id=' . $this->site_id;\n\t\t\t} else {\n\t\t\t\t$url = 'themes.php';\n\t\t\t}\n\n\t\t\tif ( 'search' !== $type ) {\n\t\t\t\t$status_links[ $type ] = sprintf(\n\t\t\t\t\t\"<a href='%s'%s>%s</a>\",\n\t\t\t\t\tesc_url( add_query_arg( 'theme_status', $type, $url ) ),\n\t\t\t\t\t( $type === $status ) ? ' class=\"current\" aria-current=\"page\"' : '',\n\t\t\t\t\tsprintf( $text, number_format_i18n( $count ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $status_links;\n\t}\n\n\t/**\n\t * @global string $status\n\t *\n\t * @return array\n\t */\n\tprotected function get_bulk_actions() {\n\t\tglobal $status;\n\n\t\t$actions = array();\n\t\tif ( 'enabled' !== $status ) {\n\t\t\t$actions['enable-selected'] = $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' );\n\t\t}\n\t\tif ( 'disabled' !== $status ) {\n\t\t\t$actions['disable-selected'] = $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' );\n\t\t}\n\t\tif ( ! $this->is_site_themes ) {\n\t\t\tif ( current_user_can( 'update_themes' ) ) {\n\t\t\t\t$actions['update-selected'] = __( 'Update' );\n\t\t\t}\n\t\t\tif ( current_user_can( 'delete_themes' ) ) {\n\t\t\t\t$actions['delete-selected'] = __( 'Delete' );\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->show_autoupdates ) {\n\t\t\tif ( 'auto-update-enabled' !== $status ) {\n\t\t\t\t$actions['enable-auto-update-selected'] = __( 'Enable Auto-updates' );\n\t\t\t}\n\n\t\t\tif ( 'auto-update-disabled' !== $status ) {\n\t\t\t\t$actions['disable-auto-update-selected'] = __( 'Disable Auto-updates' );\n\t\t\t}\n\t\t}\n\n\t\treturn $actions;\n\t}\n\n\t/**\n\t */\n\tpublic function display_rows() {\n\t\tforeach ( $this->items as $theme ) {\n\t\t\t$this->single_row( $theme );\n\t\t}\n\t}\n\n\t/**\n\t * Handles the checkbox column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Theme $theme The current WP_Theme object.\n\t */\n\tpublic function column_cb( $theme ) {\n\t\t$checkbox_id = 'checkbox_' . md5( $theme->get( 'Name' ) );\n\t\t?>\n\t\t<input type=\"checkbox\" name=\"checked[]\" value=\"<?php echo esc_attr( $theme->get_stylesheet() ); ?>\" id=\"<?php echo $checkbox_id; ?>\" />\n\t\t<label class=\"screen-reader-text\" for=\"<?php echo $checkbox_id; ?>\" ><?php _e( 'Select' ); ?>  <?php echo $theme->display( 'Name' ); ?></label>\n\t\t<?php\n\t}\n\n\t/**\n\t * Handles the name column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @global string $status\n\t * @global int    $page\n\t * @global string $s\n\t *\n\t * @param WP_Theme $theme The current WP_Theme object.\n\t */\n\tpublic function column_name( $theme ) {\n\t\tglobal $status, $page, $s;\n\n\t\t$context = $status;\n\n\t\tif ( $this->is_site_themes ) {\n\t\t\t$url     = \"site-themes.php?id={$this->site_id}&amp;\";\n\t\t\t$allowed = $theme->is_allowed( 'site', $this->site_id );\n\t\t} else {\n\t\t\t$url     = 'themes.php?';\n\t\t\t$allowed = $theme->is_allowed( 'network' );\n\t\t}\n\n\t\t// Pre-order.\n\t\t$actions = array(\n\t\t\t'enable'  => '',\n\t\t\t'disable' => '',\n\t\t\t'delete'  => '',\n\t\t);\n\n\t\t$stylesheet = $theme->get_stylesheet();\n\t\t$theme_key  = urlencode( $stylesheet );\n\n\t\tif ( ! $allowed ) {\n\t\t\tif ( ! $theme->errors() ) {\n\t\t\t\t$url = add_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'action' => 'enable',\n\t\t\t\t\t\t'theme'  => $theme_key,\n\t\t\t\t\t\t'paged'  => $page,\n\t\t\t\t\t\t's'      => $s,\n\t\t\t\t\t),\n\t\t\t\t\t$url\n\t\t\t\t);\n\n\t\t\t\tif ( $this->is_site_themes ) {\n\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t$aria_label = sprintf( __( 'Enable %s' ), $theme->display( 'Name' ) );\n\t\t\t\t} else {\n\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t$aria_label = sprintf( __( 'Network Enable %s' ), $theme->display( 'Name' ) );\n\t\t\t\t}\n\n\t\t\t\t$actions['enable'] = sprintf(\n\t\t\t\t\t'<a href=\"%s\" class=\"edit\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\tesc_url( wp_nonce_url( $url, 'enable-theme_' . $stylesheet ) ),\n\t\t\t\t\tesc_attr( $aria_label ),\n\t\t\t\t\t( $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' ) )\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\t$url = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'action' => 'disable',\n\t\t\t\t\t'theme'  => $theme_key,\n\t\t\t\t\t'paged'  => $page,\n\t\t\t\t\t's'      => $s,\n\t\t\t\t),\n\t\t\t\t$url\n\t\t\t);\n\n\t\t\tif ( $this->is_site_themes ) {\n\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t$aria_label = sprintf( __( 'Disable %s' ), $theme->display( 'Name' ) );\n\t\t\t} else {\n\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t$aria_label = sprintf( __( 'Network Disable %s' ), $theme->display( 'Name' ) );\n\t\t\t}\n\n\t\t\t$actions['disable'] = sprintf(\n\t\t\t\t'<a href=\"%s\" aria-label=\"%s\">%s</a>',\n\t\t\t\tesc_url( wp_nonce_url( $url, 'disable-theme_' . $stylesheet ) ),\n\t\t\t\tesc_attr( $aria_label ),\n\t\t\t\t( $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' ) )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! $allowed && ! $this->is_site_themes\n\t\t\t&& current_user_can( 'delete_themes' )\n\t\t\t&& get_option( 'stylesheet' ) !== $stylesheet\n\t\t\t&& get_option( 'template' ) !== $stylesheet\n\t\t) {\n\t\t\t$url = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'action'       => 'delete-selected',\n\t\t\t\t\t'checked[]'    => $theme_key,\n\t\t\t\t\t'theme_status' => $context,\n\t\t\t\t\t'paged'        => $page,\n\t\t\t\t\t's'            => $s,\n\t\t\t\t),\n\t\t\t\t'themes.php'\n\t\t\t);\n\n\t\t\t/* translators: %s: Theme name. */\n\t\t\t$aria_label = sprintf( _x( 'Delete %s', 'theme' ), $theme->display( 'Name' ) );\n\n\t\t\t$actions['delete'] = sprintf(\n\t\t\t\t'<a href=\"%s\" class=\"delete\" aria-label=\"%s\">%s</a>',\n\t\t\t\tesc_url( wp_nonce_url( $url, 'bulk-themes' ) ),\n\t\t\t\tesc_attr( $aria_label ),\n\t\t\t\t__( 'Delete' )\n\t\t\t);\n\t\t}\n\t\t/**\n\t\t * Filters the action links displayed for each theme in the Multisite\n\t\t * themes list table.\n\t\t *\n\t\t * The action links displayed are determined by the theme's status, and\n\t\t * which Multisite themes list table is being displayed - the Network\n\t\t * themes list table (themes.php), which displays all installed themes,\n\t\t * or the Site themes list table (site-themes.php), which displays the\n\t\t * non-network enabled themes when editing a site in the Network admin.\n\t\t *\n\t\t * The default action links for the Network themes list table include\n\t\t * 'Network Enable', 'Network Disable', and 'Delete'.\n\t\t *\n\t\t * The default action links for the Site themes list table include\n\t\t * 'Enable', and 'Disable'.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string[] $actions An array of action links.\n\t\t * @param WP_Theme $theme   The current WP_Theme object.\n\t\t * @param string   $context Status of the theme, one of 'all', 'enabled', or 'disabled'.\n\t\t */\n\t\t$actions = apply_filters( 'theme_action_links', array_filter( $actions ), $theme, $context );\n\n\t\t/**\n\t\t * Filters the action links of a specific theme in the Multisite themes\n\t\t * list table.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$stylesheet`, refers to the\n\t\t * directory name of the theme, which in most cases is synonymous\n\t\t * with the template name.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string[] $actions An array of action links.\n\t\t * @param WP_Theme $theme   The current WP_Theme object.\n\t\t * @param string   $context Status of the theme, one of 'all', 'enabled', or 'disabled'.\n\t\t */\n\t\t$actions = apply_filters( \"theme_action_links_{$stylesheet}\", $actions, $theme, $context );\n\n\t\techo $this->row_actions( $actions, true );\n\t}\n\n\t/**\n\t * Handles the description column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @global string $status\n\t * @global array  $totals\n\t *\n\t * @param WP_Theme $theme The current WP_Theme object.\n\t */\n\tpublic function column_description( $theme ) {\n\t\tglobal $status, $totals;\n\n\t\tif ( $theme->errors() ) {\n\t\t\t$pre = 'broken' === $status ? __( 'Broken Theme:' ) . ' ' : '';\n\t\t\techo '<p><strong class=\"error-message\">' . $pre . $theme->errors()->get_error_message() . '</strong></p>';\n\t\t}\n\n\t\tif ( $this->is_site_themes ) {\n\t\t\t$allowed = $theme->is_allowed( 'site', $this->site_id );\n\t\t} else {\n\t\t\t$allowed = $theme->is_allowed( 'network' );\n\t\t}\n\n\t\t$class = ! $allowed ? 'inactive' : 'active';\n\t\tif ( ! empty( $totals['upgrade'] ) && ! empty( $theme->update ) ) {\n\t\t\t$class .= ' update';\n\t\t}\n\n\t\techo \"<div class='theme-description'><p>\" . $theme->display( 'Description' ) . \"</p></div>\n\t\t\t<div class='$class second theme-version-author-uri'>\";\n\n\t\t$stylesheet = $theme->get_stylesheet();\n\t\t$theme_meta = array();\n\n\t\tif ( $theme->get( 'Version' ) ) {\n\t\t\t/* translators: %s: Theme version. */\n\t\t\t$theme_meta[] = sprintf( __( 'Version %s' ), $theme->display( 'Version' ) );\n\t\t}\n\n\t\t/* translators: %s: Theme author. */\n\t\t$theme_meta[] = sprintf( __( 'By %s' ), $theme->display( 'Author' ) );\n\n\t\tif ( $theme->get( 'ThemeURI' ) ) {\n\t\t\t/* translators: %s: Theme name. */\n\t\t\t$aria_label = sprintf( __( 'Visit %s homepage' ), $theme->display( 'Name' ) );\n\n\t\t\t$theme_meta[] = sprintf(\n\t\t\t\t'<a href=\"%s\" aria-label=\"%s\">%s</a>',\n\t\t\t\t$theme->display( 'ThemeURI' ),\n\t\t\t\tesc_attr( $aria_label ),\n\t\t\t\t__( 'Visit Theme Site' )\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Filters the array of row meta for each theme in the Multisite themes\n\t\t * list table.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string[] $theme_meta An array of the theme's metadata, including\n\t\t *                             the version, author, and theme URI.\n\t\t * @param string   $stylesheet Directory name of the theme.\n\t\t * @param WP_Theme $theme      WP_Theme object.\n\t\t * @param string   $status     Status of the theme.\n\t\t */\n\t\t$theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $stylesheet, $theme, $status );\n\n\t\techo implode( ' | ', $theme_meta );\n\n\t\techo '</div>';\n\t}\n\n\t/**\n\t * Handles the auto-updates column output.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @global string $status\n\t * @global int  $page\n\t *\n\t * @param WP_Theme $theme The current WP_Theme object.\n\t */\n\tpublic function column_autoupdates( $theme ) {\n\t\tglobal $status, $page;\n\n\t\tstatic $auto_updates, $available_updates;\n\n\t\tif ( ! $auto_updates ) {\n\t\t\t$auto_updates = (array) get_site_option( 'auto_update_themes', array() );\n\t\t}\n\t\tif ( ! $available_updates ) {\n\t\t\t$available_updates = get_site_transient( 'update_themes' );\n\t\t}\n\n\t\t$stylesheet = $theme->get_stylesheet();\n\n\t\tif ( isset( $theme->auto_update_forced ) ) {\n\t\t\tif ( $theme->auto_update_forced ) {\n\t\t\t\t// Forced on.\n\t\t\t\t$text = __( 'Auto-updates enabled' );\n\t\t\t} else {\n\t\t\t\t$text = __( 'Auto-updates disabled' );\n\t\t\t}\n\t\t\t$action     = 'unavailable';\n\t\t\t$time_class = ' hidden';\n\t\t} elseif ( empty( $theme->update_supported ) ) {\n\t\t\t$text       = '';\n\t\t\t$action     = 'unavailable';\n\t\t\t$time_class = ' hidden';\n\t\t} elseif ( in_array( $stylesheet, $auto_updates, true ) ) {\n\t\t\t$text       = __( 'Disable auto-updates' );\n\t\t\t$action     = 'disable';\n\t\t\t$time_class = '';\n\t\t} else {\n\t\t\t$text       = __( 'Enable auto-updates' );\n\t\t\t$action     = 'enable';\n\t\t\t$time_class = ' hidden';\n\t\t}\n\n\t\t$query_args = array(\n\t\t\t'action'       => \"{$action}-auto-update\",\n\t\t\t'theme'        => $stylesheet,\n\t\t\t'paged'        => $page,\n\t\t\t'theme_status' => $status,\n\t\t);\n\n\t\t$url = add_query_arg( $query_args, 'themes.php' );\n\n\t\tif ( 'unavailable' === $action ) {\n\t\t\t$html[] = '<span class=\"label\">' . $text . '</span>';\n\t\t} else {\n\t\t\t$html[] = sprintf(\n\t\t\t\t'<a href=\"%s\" class=\"toggle-auto-update aria-button-if-js\" data-wp-action=\"%s\">',\n\t\t\t\twp_nonce_url( $url, 'updates' ),\n\t\t\t\t$action\n\t\t\t);\n\n\t\t\t$html[] = '<span class=\"dashicons dashicons-update spin hidden\" aria-hidden=\"true\"></span>';\n\t\t\t$html[] = '<span class=\"label\">' . $text . '</span>';\n\t\t\t$html[] = '</a>';\n\n\t\t}\n\n\t\tif ( isset( $available_updates->response[ $stylesheet ] ) ) {\n\t\t\t$html[] = sprintf(\n\t\t\t\t'<div class=\"auto-update-time%s\">%s</div>',\n\t\t\t\t$time_class,\n\t\t\t\twp_get_auto_update_message()\n\t\t\t);\n\t\t}\n\n\t\t$html = implode( '', $html );\n\n\t\t/**\n\t\t * Filters the HTML of the auto-updates setting for each theme in the Themes list table.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param string   $html       The HTML for theme's auto-update setting, including\n\t\t *                             toggle auto-update action link and time to next update.\n\t\t * @param string   $stylesheet Directory name of the theme.\n\t\t * @param WP_Theme $theme      WP_Theme object.\n\t\t */\n\t\techo apply_filters( 'theme_auto_update_setting_html', $html, $stylesheet, $theme );\n\n\t\techo '<div class=\"notice notice-error notice-alt inline hidden\"><p></p></div>';\n\t}\n\n\t/**\n\t * Handles default column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Theme $theme       The current WP_Theme object.\n\t * @param string   $column_name The current column name.\n\t */\n\tpublic function column_default( $theme, $column_name ) {\n\t\t$stylesheet = $theme->get_stylesheet();\n\n\t\t/**\n\t\t * Fires inside each custom column of the Multisite themes list table.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string   $column_name Name of the column.\n\t\t * @param string   $stylesheet  Directory name of the theme.\n\t\t * @param WP_Theme $theme       Current WP_Theme object.\n\t\t */\n\t\tdo_action( 'manage_themes_custom_column', $column_name, $stylesheet, $theme );\n\t}\n\n\t/**\n\t * Handles the output for a single table row.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Theme $item The current WP_Theme object.\n\t */\n\tpublic function single_row_columns( $item ) {\n\t\tlist( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();\n\n\t\tforeach ( $columns as $column_name => $column_display_name ) {\n\t\t\t$extra_classes = '';\n\t\t\tif ( in_array( $column_name, $hidden, true ) ) {\n\t\t\t\t$extra_classes .= ' hidden';\n\t\t\t}\n\n\t\t\tswitch ( $column_name ) {\n\t\t\t\tcase 'cb':\n\t\t\t\t\techo '<th scope=\"row\" class=\"check-column\">';\n\n\t\t\t\t\t$this->column_cb( $item );\n\n\t\t\t\t\techo '</th>';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'name':\n\t\t\t\t\t$active_theme_label = '';\n\n\t\t\t\t\t/* The presence of the site_id property means that this is a subsite view and a label for the active theme needs to be added */\n\t\t\t\t\tif ( ! empty( $this->site_id ) ) {\n\t\t\t\t\t\t$stylesheet = get_blog_option( $this->site_id, 'stylesheet' );\n\t\t\t\t\t\t$template   = get_blog_option( $this->site_id, 'template' );\n\n\t\t\t\t\t\t/* Add a label for the active template */\n\t\t\t\t\t\tif ( $item->get_template() === $template ) {\n\t\t\t\t\t\t\t$active_theme_label = ' &mdash; ' . __( 'Active Theme' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* In case this is a child theme, label it properly */\n\t\t\t\t\t\tif ( $stylesheet !== $template && $item->get_stylesheet() === $stylesheet ) {\n\t\t\t\t\t\t\t$active_theme_label = ' &mdash; ' . __( 'Active Child Theme' );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\techo \"<td class='theme-title column-primary{$extra_classes}'><strong>\" . $item->display( 'Name' ) . $active_theme_label . '</strong>';\n\n\t\t\t\t\t$this->column_name( $item );\n\n\t\t\t\t\techo '</td>';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'description':\n\t\t\t\t\techo \"<td class='column-description desc{$extra_classes}'>\";\n\n\t\t\t\t\t$this->column_description( $item );\n\n\t\t\t\t\techo '</td>';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'auto-updates':\n\t\t\t\t\techo \"<td class='column-auto-updates{$extra_classes}'>\";\n\n\t\t\t\t\t$this->column_autoupdates( $item );\n\n\t\t\t\t\techo '</td>';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"<td class='$column_name column-$column_name{$extra_classes}'>\";\n\n\t\t\t\t\t$this->column_default( $item, $column_name );\n\n\t\t\t\t\techo '</td>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @global string $status\n\t * @global array  $totals\n\t *\n\t * @param WP_Theme $theme\n\t */\n\tpublic function single_row( $theme ) {\n\t\tglobal $status, $totals;\n\n\t\tif ( $this->is_site_themes ) {\n\t\t\t$allowed = $theme->is_allowed( 'site', $this->site_id );\n\t\t} else {\n\t\t\t$allowed = $theme->is_allowed( 'network' );\n\t\t}\n\n\t\t$stylesheet = $theme->get_stylesheet();\n\n\t\t$class = ! $allowed ? 'inactive' : 'active';\n\t\tif ( ! empty( $totals['upgrade'] ) && ! empty( $theme->update ) ) {\n\t\t\t$class .= ' update';\n\t\t}\n\n\t\tprintf(\n\t\t\t'<tr class=\"%s\" data-slug=\"%s\">',\n\t\t\tesc_attr( $class ),\n\t\t\tesc_attr( $stylesheet )\n\t\t);\n\n\t\t$this->single_row_columns( $theme );\n\n\t\techo '</tr>';\n\n\t\tif ( $this->is_site_themes ) {\n\t\t\tremove_action( \"after_theme_row_$stylesheet\", 'wp_theme_update_row' );\n\t\t}\n\n\t\t/**\n\t\t * Fires after each row in the Multisite themes list table.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string   $stylesheet Directory name of the theme.\n\t\t * @param WP_Theme $theme      Current WP_Theme object.\n\t\t * @param string   $status     Status of the theme.\n\t\t */\n\t\tdo_action( 'after_theme_row', $stylesheet, $theme, $status );\n\n\t\t/**\n\t\t * Fires after each specific row in the Multisite themes list table.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$stylesheet`, refers to the\n\t\t * directory name of the theme, most often synonymous with the template\n\t\t * name of the theme.\n\t\t *\n\t\t * @since 3.5.0\n\t\t *\n\t\t * @param string   $stylesheet Directory name of the theme.\n\t\t * @param WP_Theme $theme      Current WP_Theme object.\n\t\t * @param string   $status     Status of the theme.\n\t\t */\n\t\tdo_action( \"after_theme_row_{$stylesheet}\", $stylesheet, $theme, $status );\n\t}\n}\n", "num_lines": 1009}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_MS_Users_List_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n/**\n * Core class used to implement displaying users in a list table for the network admin.\n *\n * @since 3.1.0\n * @access private\n *\n * @see WP_List_Table\n */\nclass WP_MS_Users_List_Table extends WP_List_Table {\n\t/**\n\t * @return bool\n\t */\n\tpublic function ajax_user_can() {\n\t\treturn current_user_can( 'manage_network_users' );\n\t}\n\n\t/**\n\t * @global string $mode       List table view mode.\n\t * @global string $usersearch\n\t * @global string $role\n\t */\n\tpublic function prepare_items() {\n\t\tglobal $mode, $usersearch, $role;\n\n\t\tif ( ! empty( $_REQUEST['mode'] ) ) {\n\t\t\t$mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list';\n\t\t\tset_user_setting( 'network_users_list_mode', $mode );\n\t\t} else {\n\t\t\t$mode = get_user_setting( 'network_users_list_mode', 'list' );\n\t\t}\n\n\t\t$usersearch = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : '';\n\n\t\t$users_per_page = $this->get_items_per_page( 'users_network_per_page' );\n\n\t\t$role = isset( $_REQUEST['role'] ) ? $_REQUEST['role'] : '';\n\n\t\t$paged = $this->get_pagenum();\n\n\t\t$args = array(\n\t\t\t'number'  => $users_per_page,\n\t\t\t'offset'  => ( $paged - 1 ) * $users_per_page,\n\t\t\t'search'  => $usersearch,\n\t\t\t'blog_id' => 0,\n\t\t\t'fields'  => 'all_with_meta',\n\t\t);\n\n\t\tif ( wp_is_large_network( 'users' ) ) {\n\t\t\t$args['search'] = ltrim( $args['search'], '*' );\n\t\t} elseif ( '' !== $args['search'] ) {\n\t\t\t$args['search'] = trim( $args['search'], '*' );\n\t\t\t$args['search'] = '*' . $args['search'] . '*';\n\t\t}\n\n\t\tif ( 'super' === $role ) {\n\t\t\t$args['login__in'] = get_super_admins();\n\t\t}\n\n\t\t/*\n\t\t * If the network is large and a search is not being performed,\n\t\t * show only the latest users with no paging in order to avoid\n\t\t * expensive count queries.\n\t\t */\n\t\tif ( ! $usersearch && wp_is_large_network( 'users' ) ) {\n\t\t\tif ( ! isset( $_REQUEST['orderby'] ) ) {\n\t\t\t\t$_GET['orderby']     = 'id';\n\t\t\t\t$_REQUEST['orderby'] = 'id';\n\t\t\t}\n\t\t\tif ( ! isset( $_REQUEST['order'] ) ) {\n\t\t\t\t$_GET['order']     = 'DESC';\n\t\t\t\t$_REQUEST['order'] = 'DESC';\n\t\t\t}\n\t\t\t$args['count_total'] = false;\n\t\t}\n\n\t\tif ( isset( $_REQUEST['orderby'] ) ) {\n\t\t\t$args['orderby'] = $_REQUEST['orderby'];\n\t\t}\n\n\t\tif ( isset( $_REQUEST['order'] ) ) {\n\t\t\t$args['order'] = $_REQUEST['order'];\n\t\t}\n\n\t\t/** This filter is documented in wp-admin/includes/class-wp-users-list-table.php */\n\t\t$args = apply_filters( 'users_list_table_query_args', $args );\n\n\t\t// Query the user IDs for this page.\n\t\t$wp_user_search = new WP_User_Query( $args );\n\n\t\t$this->items = $wp_user_search->get_results();\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items' => $wp_user_search->get_total(),\n\t\t\t\t'per_page'    => $users_per_page,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_bulk_actions() {\n\t\t$actions = array();\n\t\tif ( current_user_can( 'delete_users' ) ) {\n\t\t\t$actions['delete'] = __( 'Delete' );\n\t\t}\n\t\t$actions['spam']    = _x( 'Mark as spam', 'user' );\n\t\t$actions['notspam'] = _x( 'Not spam', 'user' );\n\n\t\treturn $actions;\n\t}\n\n\t/**\n\t */\n\tpublic function no_items() {\n\t\t_e( 'No users found.' );\n\t}\n\n\t/**\n\t * @global string $role\n\t * @return array\n\t */\n\tprotected function get_views() {\n\t\tglobal $role;\n\n\t\t$total_users  = get_user_count();\n\t\t$super_admins = get_super_admins();\n\t\t$total_admins = count( $super_admins );\n\n\t\t$current_link_attributes = 'super' !== $role ? ' class=\"current\" aria-current=\"page\"' : '';\n\t\t$role_links              = array();\n\t\t$role_links['all']       = sprintf(\n\t\t\t'<a href=\"%s\"%s>%s</a>',\n\t\t\tnetwork_admin_url( 'users.php' ),\n\t\t\t$current_link_attributes,\n\t\t\tsprintf(\n\t\t\t\t/* translators: Number of users. */\n\t\t\t\t_nx(\n\t\t\t\t\t'All <span class=\"count\">(%s)</span>',\n\t\t\t\t\t'All <span class=\"count\">(%s)</span>',\n\t\t\t\t\t$total_users,\n\t\t\t\t\t'users'\n\t\t\t\t),\n\t\t\t\tnumber_format_i18n( $total_users )\n\t\t\t)\n\t\t);\n\t\t$current_link_attributes = 'super' === $role ? ' class=\"current\" aria-current=\"page\"' : '';\n\t\t$role_links['super']     = sprintf(\n\t\t\t'<a href=\"%s\"%s>%s</a>',\n\t\t\tnetwork_admin_url( 'users.php?role=super' ),\n\t\t\t$current_link_attributes,\n\t\t\tsprintf(\n\t\t\t\t/* translators: Number of users. */\n\t\t\t\t_n(\n\t\t\t\t\t'Super Admin <span class=\"count\">(%s)</span>',\n\t\t\t\t\t'Super Admins <span class=\"count\">(%s)</span>',\n\t\t\t\t\t$total_admins\n\t\t\t\t),\n\t\t\t\tnumber_format_i18n( $total_admins )\n\t\t\t)\n\t\t);\n\n\t\treturn $role_links;\n\t}\n\n\t/**\n\t * @global string $mode List table view mode.\n\t *\n\t * @param string $which\n\t */\n\tprotected function pagination( $which ) {\n\t\tglobal $mode;\n\n\t\tparent::pagination( $which );\n\n\t\tif ( 'top' === $which ) {\n\t\t\t$this->view_switcher( $mode );\n\t\t}\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic function get_columns() {\n\t\t$users_columns = array(\n\t\t\t'cb'         => '<input type=\"checkbox\" />',\n\t\t\t'username'   => __( 'Username' ),\n\t\t\t'name'       => __( 'Name' ),\n\t\t\t'email'      => __( 'Email' ),\n\t\t\t'registered' => _x( 'Registered', 'user' ),\n\t\t\t'blogs'      => __( 'Sites' ),\n\t\t);\n\t\t/**\n\t\t * Filters the columns displayed in the Network Admin Users list table.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t *\n\t\t * @param string[] $users_columns An array of user columns. Default 'cb', 'username',\n\t\t *                                'name', 'email', 'registered', 'blogs'.\n\t\t */\n\t\treturn apply_filters( 'wpmu_users_columns', $users_columns );\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_sortable_columns() {\n\t\treturn array(\n\t\t\t'username'   => 'login',\n\t\t\t'name'       => 'name',\n\t\t\t'email'      => 'email',\n\t\t\t'registered' => 'id',\n\t\t);\n\t}\n\n\t/**\n\t * Handles the checkbox column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_User $user The current WP_User object.\n\t */\n\tpublic function column_cb( $user ) {\n\t\tif ( is_super_admin( $user->ID ) ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<label class=\"screen-reader-text\" for=\"blog_<?php echo $user->ID; ?>\">\n\t\t\t<?php\n\t\t\t/* translators: %s: User login. */\n\t\t\tprintf( __( 'Select %s' ), $user->user_login );\n\t\t\t?>\n\t\t</label>\n\t\t<input type=\"checkbox\" id=\"blog_<?php echo $user->ID; ?>\" name=\"allusers[]\" value=\"<?php echo esc_attr( $user->ID ); ?>\" />\n\t\t<?php\n\t}\n\n\t/**\n\t * Handles the ID column output.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param WP_User $user The current WP_User object.\n\t */\n\tpublic function column_id( $user ) {\n\t\techo $user->ID;\n\t}\n\n\t/**\n\t * Handles the username column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_User $user The current WP_User object.\n\t */\n\tpublic function column_username( $user ) {\n\t\t$super_admins = get_super_admins();\n\t\t$avatar       = get_avatar( $user->user_email, 32 );\n\n\t\techo $avatar;\n\n\t\tif ( current_user_can( 'edit_user', $user->ID ) ) {\n\t\t\t$edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );\n\t\t\t$edit      = \"<a href=\\\"{$edit_link}\\\">{$user->user_login}</a>\";\n\t\t} else {\n\t\t\t$edit = $user->user_login;\n\t\t}\n\n\t\t?>\n\t\t<strong>\n\t\t\t<?php\n\t\t\techo $edit;\n\n\t\t\tif ( in_array( $user->user_login, $super_admins, true ) ) {\n\t\t\t\techo ' &mdash; ' . __( 'Super Admin' );\n\t\t\t}\n\t\t\t?>\n\t\t</strong>\n\t\t<?php\n\t}\n\n\t/**\n\t * Handles the name column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_User $user The current WP_User object.\n\t */\n\tpublic function column_name( $user ) {\n\t\tif ( $user->first_name && $user->last_name ) {\n\t\t\techo \"$user->first_name $user->last_name\";\n\t\t} elseif ( $user->first_name ) {\n\t\t\techo $user->first_name;\n\t\t} elseif ( $user->last_name ) {\n\t\t\techo $user->last_name;\n\t\t} else {\n\t\t\techo '<span aria-hidden=\"true\">&#8212;</span><span class=\"screen-reader-text\">' . _x( 'Unknown', 'name' ) . '</span>';\n\t\t}\n\t}\n\n\t/**\n\t * Handles the email column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_User $user The current WP_User object.\n\t */\n\tpublic function column_email( $user ) {\n\t\techo \"<a href='\" . esc_url( \"mailto:$user->user_email\" ) . \"'>$user->user_email</a>\";\n\t}\n\n\t/**\n\t * Handles the registered date column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @global string $mode List table view mode.\n\t *\n\t * @param WP_User $user The current WP_User object.\n\t */\n\tpublic function column_registered( $user ) {\n\t\tglobal $mode;\n\t\tif ( 'list' === $mode ) {\n\t\t\t$date = __( 'Y/m/d' );\n\t\t} else {\n\t\t\t$date = __( 'Y/m/d g:i:s a' );\n\t\t}\n\t\techo mysql2date( $date, $user->user_registered );\n\t}\n\n\t/**\n\t * @since 4.3.0\n\t *\n\t * @param WP_User $user\n\t * @param string  $classes\n\t * @param string  $data\n\t * @param string  $primary\n\t */\n\tprotected function _column_blogs( $user, $classes, $data, $primary ) {\n\t\techo '<td class=\"', $classes, ' has-row-actions\" ', $data, '>';\n\t\techo $this->column_blogs( $user );\n\t\techo $this->handle_row_actions( $user, 'blogs', $primary );\n\t\techo '</td>';\n\t}\n\n\t/**\n\t * Handles the sites column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_User $user The current WP_User object.\n\t */\n\tpublic function column_blogs( $user ) {\n\t\t$blogs = get_blogs_of_user( $user->ID, true );\n\t\tif ( ! is_array( $blogs ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $blogs as $val ) {\n\t\t\tif ( ! can_edit_network( $val->site_id ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$path         = ( '/' === $val->path ) ? '' : $val->path;\n\t\t\t$site_classes = array( 'site-' . $val->site_id );\n\t\t\t/**\n\t\t\t * Filters the span class for a site listing on the mulisite user list table.\n\t\t\t *\n\t\t\t * @since 5.2.0\n\t\t\t *\n\t\t\t * @param string[] $site_classes Array of class names used within the span tag. Default \"site-#\" with the site's network ID.\n\t\t\t * @param int      $site_id      Site ID.\n\t\t\t * @param int      $network_id   Network ID.\n\t\t\t * @param WP_User  $user         WP_User object.\n\t\t\t */\n\t\t\t$site_classes = apply_filters( 'ms_user_list_site_class', $site_classes, $val->userblog_id, $val->site_id, $user );\n\t\t\tif ( is_array( $site_classes ) && ! empty( $site_classes ) ) {\n\t\t\t\t$site_classes = array_map( 'sanitize_html_class', array_unique( $site_classes ) );\n\t\t\t\techo '<span class=\"' . esc_attr( implode( ' ', $site_classes ) ) . '\">';\n\t\t\t} else {\n\t\t\t\techo '<span>';\n\t\t\t}\n\t\t\techo '<a href=\"' . esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) . '\">' . str_replace( '.' . get_network()->domain, '', $val->domain . $path ) . '</a>';\n\t\t\techo ' <small class=\"row-actions\">';\n\t\t\t$actions         = array();\n\t\t\t$actions['edit'] = '<a href=\"' . esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) . '\">' . __( 'Edit' ) . '</a>';\n\n\t\t\t$class = '';\n\t\t\tif ( 1 == $val->spam ) {\n\t\t\t\t$class .= 'site-spammed ';\n\t\t\t}\n\t\t\tif ( 1 == $val->mature ) {\n\t\t\t\t$class .= 'site-mature ';\n\t\t\t}\n\t\t\tif ( 1 == $val->deleted ) {\n\t\t\t\t$class .= 'site-deleted ';\n\t\t\t}\n\t\t\tif ( 1 == $val->archived ) {\n\t\t\t\t$class .= 'site-archived ';\n\t\t\t}\n\n\t\t\t$actions['view'] = '<a class=\"' . $class . '\" href=\"' . esc_url( get_home_url( $val->userblog_id ) ) . '\">' . __( 'View' ) . '</a>';\n\n\t\t\t/**\n\t\t\t * Filters the action links displayed next the sites a user belongs to\n\t\t\t * in the Network Admin Users list table.\n\t\t\t *\n\t\t\t * @since 3.1.0\n\t\t\t *\n\t\t\t * @param string[] $actions     An array of action links to be displayed. Default 'Edit', 'View'.\n\t\t\t * @param int      $userblog_id The site ID.\n\t\t\t */\n\t\t\t$actions = apply_filters( 'ms_user_list_site_actions', $actions, $val->userblog_id );\n\n\t\t\t$action_count = count( $actions );\n\n\t\t\t$i = 0;\n\n\t\t\tforeach ( $actions as $action => $link ) {\n\t\t\t\t++$i;\n\n\t\t\t\t$sep = ( $i < $action_count ) ? ' | ' : '';\n\n\t\t\t\techo \"<span class='$action'>$link$sep</span>\";\n\t\t\t}\n\n\t\t\techo '</small></span><br/>';\n\t\t}\n\t}\n\n\t/**\n\t * Handles the default column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_User $user        The current WP_User object.\n\t * @param string  $column_name The current column name.\n\t */\n\tpublic function column_default( $user, $column_name ) {\n\t\t/** This filter is documented in wp-admin/includes/class-wp-users-list-table.php */\n\t\techo apply_filters( 'manage_users_custom_column', '', $column_name, $user->ID );\n\t}\n\n\tpublic function display_rows() {\n\t\tforeach ( $this->items as $user ) {\n\t\t\t$class = '';\n\n\t\t\t$status_list = array(\n\t\t\t\t'spam'    => 'site-spammed',\n\t\t\t\t'deleted' => 'site-deleted',\n\t\t\t);\n\n\t\t\tforeach ( $status_list as $status => $col ) {\n\t\t\t\tif ( $user->$status ) {\n\t\t\t\t\t$class .= \" $col\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t?>\n\t\t\t<tr class=\"<?php echo trim( $class ); ?>\">\n\t\t\t\t<?php $this->single_row_columns( $user ); ?>\n\t\t\t</tr>\n\t\t\t<?php\n\t\t}\n\t}\n\n\t/**\n\t * Gets the name of the default primary column.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @return string Name of the default primary column, in this case, 'username'.\n\t */\n\tprotected function get_default_primary_column_name() {\n\t\treturn 'username';\n\t}\n\n\t/**\n\t * Generates and displays row action links.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param object $user        User being acted upon.\n\t * @param string $column_name Current column name.\n\t * @param string $primary     Primary column name.\n\t * @return string Row actions output for users in Multisite, or an empty string\n\t *                if the current column is not the primary column.\n\t */\n\tprotected function handle_row_actions( $user, $column_name, $primary ) {\n\t\tif ( $primary !== $column_name ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$super_admins = get_super_admins();\n\n\t\t$actions = array();\n\n\t\tif ( current_user_can( 'edit_user', $user->ID ) ) {\n\t\t\t$edit_link       = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );\n\t\t\t$actions['edit'] = '<a href=\"' . $edit_link . '\">' . __( 'Edit' ) . '</a>';\n\t\t}\n\n\t\tif ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins, true ) ) {\n\t\t\t$actions['delete'] = '<a href=\"' . esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'users.php', 'deleteuser' ) . '&amp;action=deleteuser&amp;id=' . $user->ID ) ) ) . '\" class=\"delete\">' . __( 'Delete' ) . '</a>';\n\t\t}\n\n\t\t/**\n\t\t * Filters the action links displayed under each user in the Network Admin Users list table.\n\t\t *\n\t\t * @since 3.2.0\n\t\t *\n\t\t * @param string[] $actions An array of action links to be displayed. Default 'Edit', 'Delete'.\n\t\t * @param WP_User  $user    WP_User object.\n\t\t */\n\t\t$actions = apply_filters( 'ms_user_row_actions', $actions, $user );\n\n\t\treturn $this->row_actions( $actions );\n\t}\n}\n", "num_lines": 530}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_Plugin_Install_List_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n/**\n * Core class used to implement displaying plugins to install in a list table.\n *\n * @since 3.1.0\n * @access private\n *\n * @see WP_List_Table\n */\nclass WP_Plugin_Install_List_Table extends WP_List_Table {\n\n\tpublic $order   = 'ASC';\n\tpublic $orderby = null;\n\tpublic $groups  = array();\n\n\tprivate $error;\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function ajax_user_can() {\n\t\treturn current_user_can( 'install_plugins' );\n\t}\n\n\t/**\n\t * Return the list of known plugins.\n\t *\n\t * Uses the transient data from the updates API to determine the known\n\t * installed plugins.\n\t *\n\t * @since 4.9.0\n\t * @access protected\n\t *\n\t * @return array\n\t */\n\tprotected function get_installed_plugins() {\n\t\t$plugins = array();\n\n\t\t$plugin_info = get_site_transient( 'update_plugins' );\n\t\tif ( isset( $plugin_info->no_update ) ) {\n\t\t\tforeach ( $plugin_info->no_update as $plugin ) {\n\t\t\t\t$plugin->upgrade          = false;\n\t\t\t\t$plugins[ $plugin->slug ] = $plugin;\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $plugin_info->response ) ) {\n\t\t\tforeach ( $plugin_info->response as $plugin ) {\n\t\t\t\t$plugin->upgrade          = true;\n\t\t\t\t$plugins[ $plugin->slug ] = $plugin;\n\t\t\t}\n\t\t}\n\n\t\treturn $plugins;\n\t}\n\n\t/**\n\t * Return a list of slugs of installed plugins, if known.\n\t *\n\t * Uses the transient data from the updates API to determine the slugs of\n\t * known installed plugins. This might be better elsewhere, perhaps even\n\t * within get_plugins().\n\t *\n\t * @since 4.0.0\n\t *\n\t * @return array\n\t */\n\tprotected function get_installed_plugin_slugs() {\n\t\treturn array_keys( $this->get_installed_plugins() );\n\t}\n\n\t/**\n\t * @global array  $tabs\n\t * @global string $tab\n\t * @global int    $paged\n\t * @global string $type\n\t * @global string $term\n\t */\n\tpublic function prepare_items() {\n\t\tinclude_once ABSPATH . 'wp-admin/includes/plugin-install.php';\n\n\t\tglobal $tabs, $tab, $paged, $type, $term;\n\n\t\twp_reset_vars( array( 'tab' ) );\n\n\t\t$paged = $this->get_pagenum();\n\n\t\t$per_page = 36;\n\n\t\t// These are the tabs which are shown on the page.\n\t\t$tabs = array();\n\n\t\tif ( 'search' === $tab ) {\n\t\t\t$tabs['search'] = __( 'Search Results' );\n\t\t}\n\t\tif ( 'beta' === $tab || false !== strpos( get_bloginfo( 'version' ), '-' ) ) {\n\t\t\t$tabs['beta'] = _x( 'Beta Testing', 'Plugin Installer' );\n\t\t}\n\t\t$tabs['featured']    = _x( 'Featured', 'Plugin Installer' );\n\t\t$tabs['popular']     = _x( 'Popular', 'Plugin Installer' );\n\t\t$tabs['recommended'] = _x( 'Recommended', 'Plugin Installer' );\n\t\t$tabs['favorites']   = _x( 'Favorites', 'Plugin Installer' );\n\t\tif ( current_user_can( 'upload_plugins' ) ) {\n\t\t\t// No longer a real tab. Here for filter compatibility.\n\t\t\t// Gets skipped in get_views().\n\t\t\t$tabs['upload'] = __( 'Upload Plugin' );\n\t\t}\n\n\t\t$nonmenu_tabs = array( 'plugin-information' ); // Valid actions to perform which do not have a Menu item.\n\n\t\t/**\n\t\t * Filters the tabs shown on the Add Plugins screen.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param string[] $tabs The tabs shown on the Add Plugins screen. Defaults include\n\t\t *                       'featured', 'popular', 'recommended', 'favorites', and 'upload'.\n\t\t */\n\t\t$tabs = apply_filters( 'install_plugins_tabs', $tabs );\n\n\t\t/**\n\t\t * Filters tabs not associated with a menu item on the Add Plugins screen.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param string[] $nonmenu_tabs The tabs that don't have a menu item on the Add Plugins screen.\n\t\t */\n\t\t$nonmenu_tabs = apply_filters( 'install_plugins_nonmenu_tabs', $nonmenu_tabs );\n\n\t\t// If a non-valid menu tab has been selected, And it's not a non-menu action.\n\t\tif ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs, true ) ) ) {\n\t\t\t$tab = key( $tabs );\n\t\t}\n\n\t\t$installed_plugins = $this->get_installed_plugins();\n\n\t\t$args = array(\n\t\t\t'page'     => $paged,\n\t\t\t'per_page' => $per_page,\n\t\t\t// Send the locale to the API so it can provide context-sensitive results.\n\t\t\t'locale'   => get_user_locale(),\n\t\t);\n\n\t\tswitch ( $tab ) {\n\t\t\tcase 'search':\n\t\t\t\t$type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';\n\t\t\t\t$term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '';\n\n\t\t\t\tswitch ( $type ) {\n\t\t\t\t\tcase 'tag':\n\t\t\t\t\t\t$args['tag'] = sanitize_title_with_dashes( $term );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'term':\n\t\t\t\t\t\t$args['search'] = $term;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'author':\n\t\t\t\t\t\t$args['author'] = $term;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'featured':\n\t\t\tcase 'popular':\n\t\t\tcase 'new':\n\t\t\tcase 'beta':\n\t\t\t\t$args['browse'] = $tab;\n\t\t\t\tbreak;\n\t\t\tcase 'recommended':\n\t\t\t\t$args['browse'] = $tab;\n\t\t\t\t// Include the list of installed plugins so we can get relevant results.\n\t\t\t\t$args['installed_plugins'] = array_keys( $installed_plugins );\n\t\t\t\tbreak;\n\n\t\t\tcase 'favorites':\n\t\t\t\t$action = 'save_wporg_username_' . get_current_user_id();\n\t\t\t\tif ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) {\n\t\t\t\t\t$user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' );\n\n\t\t\t\t\t// If the save url parameter is passed with a falsey value, don't save the favorite user.\n\t\t\t\t\tif ( ! isset( $_GET['save'] ) || $_GET['save'] ) {\n\t\t\t\t\t\tupdate_user_meta( get_current_user_id(), 'wporg_favorites', $user );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$user = get_user_option( 'wporg_favorites' );\n\t\t\t\t}\n\t\t\t\tif ( $user ) {\n\t\t\t\t\t$args['user'] = $user;\n\t\t\t\t} else {\n\t\t\t\t\t$args = false;\n\t\t\t\t}\n\n\t\t\t\tadd_action( 'install_plugins_favorites', 'install_plugins_favorites_form', 9, 0 );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$args = false;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t/**\n\t\t * Filters API request arguments for each Add Plugins screen tab.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$tab`, refers to the plugin install tabs.\n\t\t * Default tabs include 'featured', 'popular', 'recommended', 'favorites', and 'upload'.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param array|false $args Plugin install API arguments.\n\t\t */\n\t\t$args = apply_filters( \"install_plugins_table_api_args_{$tab}\", $args );\n\n\t\tif ( ! $args ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$api = plugins_api( 'query_plugins', $args );\n\n\t\tif ( is_wp_error( $api ) ) {\n\t\t\t$this->error = $api;\n\t\t\treturn;\n\t\t}\n\n\t\t$this->items = $api->plugins;\n\n\t\tif ( $this->orderby ) {\n\t\t\tuasort( $this->items, array( $this, 'order_callback' ) );\n\t\t}\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items' => $api->info['results'],\n\t\t\t\t'per_page'    => $args['per_page'],\n\t\t\t)\n\t\t);\n\n\t\tif ( isset( $api->info['groups'] ) ) {\n\t\t\t$this->groups = $api->info['groups'];\n\t\t}\n\n\t\tif ( $installed_plugins ) {\n\t\t\t$js_plugins = array_fill_keys(\n\t\t\t\tarray( 'all', 'search', 'active', 'inactive', 'recently_activated', 'mustuse', 'dropins' ),\n\t\t\t\tarray()\n\t\t\t);\n\n\t\t\t$js_plugins['all'] = array_values( wp_list_pluck( $installed_plugins, 'plugin' ) );\n\t\t\t$upgrade_plugins   = wp_filter_object_list( $installed_plugins, array( 'upgrade' => true ), 'and', 'plugin' );\n\n\t\t\tif ( $upgrade_plugins ) {\n\t\t\t\t$js_plugins['upgrade'] = array_values( $upgrade_plugins );\n\t\t\t}\n\n\t\t\twp_localize_script(\n\t\t\t\t'updates',\n\t\t\t\t'_wpUpdatesItemCounts',\n\t\t\t\tarray(\n\t\t\t\t\t'plugins' => $js_plugins,\n\t\t\t\t\t'totals'  => wp_get_update_data(),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t */\n\tpublic function no_items() {\n\t\tif ( isset( $this->error ) ) { ?>\n\t\t\t<div class=\"inline error\"><p><?php echo $this->error->get_error_message(); ?></p>\n\t\t\t\t<p class=\"hide-if-no-js\"><button class=\"button try-again\"><?php _e( 'Try Again' ); ?></button></p>\n\t\t\t</div>\n\t\t<?php } else { ?>\n\t\t\t<div class=\"no-plugin-results\"><?php _e( 'No plugins found. Try a different search.' ); ?></div>\n\t\t\t<?php\n\t\t}\n\t}\n\n\t/**\n\t * @global array $tabs\n\t * @global string $tab\n\t *\n\t * @return array\n\t */\n\tprotected function get_views() {\n\t\tglobal $tabs, $tab;\n\n\t\t$display_tabs = array();\n\t\tforeach ( (array) $tabs as $action => $text ) {\n\t\t\t$current_link_attributes                     = ( $action === $tab ) ? ' class=\"current\" aria-current=\"page\"' : '';\n\t\t\t$href                                        = self_admin_url( 'plugin-install.php?tab=' . $action );\n\t\t\t$display_tabs[ 'plugin-install-' . $action ] = \"<a href='$href'$current_link_attributes>$text</a>\";\n\t\t}\n\t\t// No longer a real tab.\n\t\tunset( $display_tabs['plugin-install-upload'] );\n\n\t\treturn $display_tabs;\n\t}\n\n\t/**\n\t * Override parent views so we can use the filter bar display.\n\t */\n\tpublic function views() {\n\t\t$views = $this->get_views();\n\n\t\t/** This filter is documented in wp-admin/inclues/class-wp-list-table.php */\n\t\t$views = apply_filters( \"views_{$this->screen->id}\", $views );\n\n\t\t$this->screen->render_screen_reader_content( 'heading_views' );\n\t\t?>\n<div class=\"wp-filter\">\n\t<ul class=\"filter-links\">\n\t\t<?php\n\t\tif ( ! empty( $views ) ) {\n\t\t\tforeach ( $views as $class => $view ) {\n\t\t\t\t$views[ $class ] = \"\\t<li class='$class'>$view\";\n\t\t\t}\n\t\t\techo implode( \" </li>\\n\", $views ) . \"</li>\\n\";\n\t\t}\n\t\t?>\n\t</ul>\n\n\t\t<?php install_search_form(); ?>\n</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Displays the plugin install table.\n\t *\n\t * Overrides the parent display() method to provide a different container.\n\t *\n\t * @since 4.0.0\n\t */\n\tpublic function display() {\n\t\t$singular = $this->_args['singular'];\n\n\t\t$data_attr = '';\n\n\t\tif ( $singular ) {\n\t\t\t$data_attr = \" data-wp-lists='list:$singular'\";\n\t\t}\n\n\t\t$this->display_tablenav( 'top' );\n\n\t\t?>\n<div class=\"wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>\">\n\t\t<?php\n\t\t$this->screen->render_screen_reader_content( 'heading_list' );\n\t\t?>\n\t<div id=\"the-list\"<?php echo $data_attr; ?>>\n\t\t<?php $this->display_rows_or_placeholder(); ?>\n\t</div>\n</div>\n\t\t<?php\n\t\t$this->display_tablenav( 'bottom' );\n\t}\n\n\t/**\n\t * @global string $tab\n\t *\n\t * @param string $which\n\t */\n\tprotected function display_tablenav( $which ) {\n\t\tif ( 'featured' === $GLOBALS['tab'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'top' === $which ) {\n\t\t\twp_referer_field();\n\t\t\t?>\n\t\t\t<div class=\"tablenav top\">\n\t\t\t\t<div class=\"alignleft actions\">\n\t\t\t\t\t<?php\n\t\t\t\t\t/**\n\t\t\t\t\t * Fires before the Plugin Install table header pagination is displayed.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 2.7.0\n\t\t\t\t\t */\n\t\t\t\t\tdo_action( 'install_plugins_table_header' );\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t\t<?php $this->pagination( $which ); ?>\n\t\t\t\t<br class=\"clear\" />\n\t\t\t</div>\n\t\t<?php } else { ?>\n\t\t\t<div class=\"tablenav bottom\">\n\t\t\t\t<?php $this->pagination( $which ); ?>\n\t\t\t\t<br class=\"clear\" />\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_table_classes() {\n\t\treturn array( 'widefat', $this->_args['plural'] );\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic function get_columns() {\n\t\treturn array();\n\t}\n\n\t/**\n\t * @param object $plugin_a\n\t * @param object $plugin_b\n\t * @return int\n\t */\n\tprivate function order_callback( $plugin_a, $plugin_b ) {\n\t\t$orderby = $this->orderby;\n\t\tif ( ! isset( $plugin_a->$orderby, $plugin_b->$orderby ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$a = $plugin_a->$orderby;\n\t\t$b = $plugin_b->$orderby;\n\n\t\tif ( $a == $b ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif ( 'DESC' === $this->order ) {\n\t\t\treturn ( $a < $b ) ? 1 : -1;\n\t\t} else {\n\t\t\treturn ( $a < $b ) ? -1 : 1;\n\t\t}\n\t}\n\n\tpublic function display_rows() {\n\t\t$plugins_allowedtags = array(\n\t\t\t'a'       => array(\n\t\t\t\t'href'   => array(),\n\t\t\t\t'title'  => array(),\n\t\t\t\t'target' => array(),\n\t\t\t),\n\t\t\t'abbr'    => array( 'title' => array() ),\n\t\t\t'acronym' => array( 'title' => array() ),\n\t\t\t'code'    => array(),\n\t\t\t'pre'     => array(),\n\t\t\t'em'      => array(),\n\t\t\t'strong'  => array(),\n\t\t\t'ul'      => array(),\n\t\t\t'ol'      => array(),\n\t\t\t'li'      => array(),\n\t\t\t'p'       => array(),\n\t\t\t'br'      => array(),\n\t\t);\n\n\t\t$plugins_group_titles = array(\n\t\t\t'Performance' => _x( 'Performance', 'Plugin installer group title' ),\n\t\t\t'Social'      => _x( 'Social', 'Plugin installer group title' ),\n\t\t\t'Tools'       => _x( 'Tools', 'Plugin installer group title' ),\n\t\t);\n\n\t\t$group = null;\n\n\t\tforeach ( (array) $this->items as $plugin ) {\n\t\t\tif ( is_object( $plugin ) ) {\n\t\t\t\t$plugin = (array) $plugin;\n\t\t\t}\n\n\t\t\t// Display the group heading if there is one.\n\t\t\tif ( isset( $plugin['group'] ) && $plugin['group'] != $group ) {\n\t\t\t\tif ( isset( $this->groups[ $plugin['group'] ] ) ) {\n\t\t\t\t\t$group_name = $this->groups[ $plugin['group'] ];\n\t\t\t\t\tif ( isset( $plugins_group_titles[ $group_name ] ) ) {\n\t\t\t\t\t\t$group_name = $plugins_group_titles[ $group_name ];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$group_name = $plugin['group'];\n\t\t\t\t}\n\n\t\t\t\t// Starting a new group, close off the divs of the last one.\n\t\t\t\tif ( ! empty( $group ) ) {\n\t\t\t\t\techo '</div></div>';\n\t\t\t\t}\n\n\t\t\t\techo '<div class=\"plugin-group\"><h3>' . esc_html( $group_name ) . '</h3>';\n\t\t\t\t// Needs an extra wrapping div for nth-child selectors to work.\n\t\t\t\techo '<div class=\"plugin-items\">';\n\n\t\t\t\t$group = $plugin['group'];\n\t\t\t}\n\t\t\t$title = wp_kses( $plugin['name'], $plugins_allowedtags );\n\n\t\t\t// Remove any HTML from the description.\n\t\t\t$description = strip_tags( $plugin['short_description'] );\n\t\t\t$version     = wp_kses( $plugin['version'], $plugins_allowedtags );\n\n\t\t\t$name = strip_tags( $title . ' ' . $version );\n\n\t\t\t$author = wp_kses( $plugin['author'], $plugins_allowedtags );\n\t\t\tif ( ! empty( $author ) ) {\n\t\t\t\t/* translators: %s: Plugin author. */\n\t\t\t\t$author = ' <cite>' . sprintf( __( 'By %s' ), $author ) . '</cite>';\n\t\t\t}\n\n\t\t\t$requires_php = isset( $plugin['requires_php'] ) ? $plugin['requires_php'] : null;\n\t\t\t$requires_wp  = isset( $plugin['requires'] ) ? $plugin['requires'] : null;\n\n\t\t\t$compatible_php = is_php_version_compatible( $requires_php );\n\t\t\t$compatible_wp  = is_wp_version_compatible( $requires_wp );\n\t\t\t$tested_wp      = ( empty( $plugin['tested'] ) || version_compare( get_bloginfo( 'version' ), $plugin['tested'], '<=' ) );\n\n\t\t\t$action_links = array();\n\n\t\t\tif ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) {\n\t\t\t\t$status = install_plugin_install_status( $plugin );\n\n\t\t\t\tswitch ( $status['status'] ) {\n\t\t\t\t\tcase 'install':\n\t\t\t\t\t\tif ( $status['url'] ) {\n\t\t\t\t\t\t\tif ( $compatible_php && $compatible_wp ) {\n\t\t\t\t\t\t\t\t$action_links[] = sprintf(\n\t\t\t\t\t\t\t\t\t'<a class=\"install-now button\" data-slug=\"%s\" href=\"%s\" aria-label=\"%s\" data-name=\"%s\">%s</a>',\n\t\t\t\t\t\t\t\t\tesc_attr( $plugin['slug'] ),\n\t\t\t\t\t\t\t\t\tesc_url( $status['url'] ),\n\t\t\t\t\t\t\t\t\t/* translators: %s: Plugin name and version. */\n\t\t\t\t\t\t\t\t\tesc_attr( sprintf( _x( 'Install %s now', 'plugin' ), $name ) ),\n\t\t\t\t\t\t\t\t\tesc_attr( $name ),\n\t\t\t\t\t\t\t\t\t__( 'Install Now' )\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$action_links[] = sprintf(\n\t\t\t\t\t\t\t\t\t'<button type=\"button\" class=\"button button-disabled\" disabled=\"disabled\">%s</button>',\n\t\t\t\t\t\t\t\t\t_x( 'Cannot Install', 'plugin' )\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\tbreak;\n\n\t\t\t\t\tcase 'update_available':\n\t\t\t\t\t\tif ( $status['url'] ) {\n\t\t\t\t\t\t\tif ( $compatible_php && $compatible_wp ) {\n\t\t\t\t\t\t\t\t$action_links[] = sprintf(\n\t\t\t\t\t\t\t\t\t'<a class=\"update-now button aria-button-if-js\" data-plugin=\"%s\" data-slug=\"%s\" href=\"%s\" aria-label=\"%s\" data-name=\"%s\">%s</a>',\n\t\t\t\t\t\t\t\t\tesc_attr( $status['file'] ),\n\t\t\t\t\t\t\t\t\tesc_attr( $plugin['slug'] ),\n\t\t\t\t\t\t\t\t\tesc_url( $status['url'] ),\n\t\t\t\t\t\t\t\t\t/* translators: %s: Plugin name and version. */\n\t\t\t\t\t\t\t\t\tesc_attr( sprintf( _x( 'Update %s now', 'plugin' ), $name ) ),\n\t\t\t\t\t\t\t\t\tesc_attr( $name ),\n\t\t\t\t\t\t\t\t\t__( 'Update Now' )\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$action_links[] = sprintf(\n\t\t\t\t\t\t\t\t\t'<button type=\"button\" class=\"button button-disabled\" disabled=\"disabled\">%s</button>',\n\t\t\t\t\t\t\t\t\t_x( 'Cannot Update', 'plugin' )\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\tbreak;\n\n\t\t\t\t\tcase 'latest_installed':\n\t\t\t\t\tcase 'newer_installed':\n\t\t\t\t\t\tif ( is_plugin_active( $status['file'] ) ) {\n\t\t\t\t\t\t\t$action_links[] = sprintf(\n\t\t\t\t\t\t\t\t'<button type=\"button\" class=\"button button-disabled\" disabled=\"disabled\">%s</button>',\n\t\t\t\t\t\t\t\t_x( 'Active', 'plugin' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} elseif ( current_user_can( 'activate_plugin', $status['file'] ) ) {\n\t\t\t\t\t\t\t$button_text = __( 'Activate' );\n\t\t\t\t\t\t\t/* translators: %s: Plugin name. */\n\t\t\t\t\t\t\t$button_label = _x( 'Activate %s', 'plugin' );\n\t\t\t\t\t\t\t$activate_url = add_query_arg(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $status['file'] ),\n\t\t\t\t\t\t\t\t\t'action'   => 'activate',\n\t\t\t\t\t\t\t\t\t'plugin'   => $status['file'],\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tnetwork_admin_url( 'plugins.php' )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( is_network_admin() ) {\n\t\t\t\t\t\t\t\t$button_text = __( 'Network Activate' );\n\t\t\t\t\t\t\t\t/* translators: %s: Plugin name. */\n\t\t\t\t\t\t\t\t$button_label = _x( 'Network Activate %s', 'plugin' );\n\t\t\t\t\t\t\t\t$activate_url = add_query_arg( array( 'networkwide' => 1 ), $activate_url );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$action_links[] = sprintf(\n\t\t\t\t\t\t\t\t'<a href=\"%1$s\" class=\"button activate-now\" aria-label=\"%2$s\">%3$s</a>',\n\t\t\t\t\t\t\t\tesc_url( $activate_url ),\n\t\t\t\t\t\t\t\tesc_attr( sprintf( $button_label, $plugin['name'] ) ),\n\t\t\t\t\t\t\t\t$button_text\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$action_links[] = sprintf(\n\t\t\t\t\t\t\t\t'<button type=\"button\" class=\"button button-disabled\" disabled=\"disabled\">%s</button>',\n\t\t\t\t\t\t\t\t_x( 'Installed', 'plugin' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$details_link = self_admin_url(\n\t\t\t\t'plugin-install.php?tab=plugin-information&amp;plugin=' . $plugin['slug'] .\n\t\t\t\t'&amp;TB_iframe=true&amp;width=600&amp;height=550'\n\t\t\t);\n\n\t\t\t$action_links[] = sprintf(\n\t\t\t\t'<a href=\"%s\" class=\"thickbox open-plugin-details-modal\" aria-label=\"%s\" data-title=\"%s\">%s</a>',\n\t\t\t\tesc_url( $details_link ),\n\t\t\t\t/* translators: %s: Plugin name and version. */\n\t\t\t\tesc_attr( sprintf( __( 'More information about %s' ), $name ) ),\n\t\t\t\tesc_attr( $name ),\n\t\t\t\t__( 'More Details' )\n\t\t\t);\n\n\t\t\tif ( ! empty( $plugin['icons']['svg'] ) ) {\n\t\t\t\t$plugin_icon_url = $plugin['icons']['svg'];\n\t\t\t} elseif ( ! empty( $plugin['icons']['2x'] ) ) {\n\t\t\t\t$plugin_icon_url = $plugin['icons']['2x'];\n\t\t\t} elseif ( ! empty( $plugin['icons']['1x'] ) ) {\n\t\t\t\t$plugin_icon_url = $plugin['icons']['1x'];\n\t\t\t} else {\n\t\t\t\t$plugin_icon_url = $plugin['icons']['default'];\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the install action links for a plugin.\n\t\t\t *\n\t\t\t * @since 2.7.0\n\t\t\t *\n\t\t\t * @param string[] $action_links An array of plugin action links. Defaults are links to Details and Install Now.\n\t\t\t * @param array    $plugin       The plugin currently being listed.\n\t\t\t */\n\t\t\t$action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );\n\n\t\t\t$last_updated_timestamp = strtotime( $plugin['last_updated'] );\n\t\t\t?>\n\t\t<div class=\"plugin-card plugin-card-<?php echo sanitize_html_class( $plugin['slug'] ); ?>\">\n\t\t\t<?php\n\t\t\tif ( ! $compatible_php || ! $compatible_wp ) {\n\t\t\t\techo '<div class=\"notice inline notice-error notice-alt\"><p>';\n\t\t\t\tif ( ! $compatible_php && ! $compatible_wp ) {\n\t\t\t\t\t_e( 'This plugin doesn&#8217;t work with your versions of WordPress and PHP.' );\n\t\t\t\t\tif ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */\n\t\t\t\t\t\t\t' ' . __( '<a href=\"%1$s\">Please update WordPress</a>, and then <a href=\"%2$s\">learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t);\n\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t} elseif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t\t);\n\t\t\t\t\t} elseif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t);\n\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t}\n\t\t\t\t} elseif ( ! $compatible_wp ) {\n\t\t\t\t\t_e( 'This plugin doesn&#8217;t work with your version of WordPress.' );\n\t\t\t\t\tif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} elseif ( ! $compatible_php ) {\n\t\t\t\t\t_e( 'This plugin doesn&#8217;t work with your version of PHP.' );\n\t\t\t\t\tif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t);\n\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\techo '</p></div>';\n\t\t\t}\n\t\t\t?>\n\t\t\t<div class=\"plugin-card-top\">\n\t\t\t\t<div class=\"name column-name\">\n\t\t\t\t\t<h3>\n\t\t\t\t\t\t<a href=\"<?php echo esc_url( $details_link ); ?>\" class=\"thickbox open-plugin-details-modal\">\n\t\t\t\t\t\t<?php echo $title; ?>\n\t\t\t\t\t\t<img src=\"<?php echo esc_attr( $plugin_icon_url ); ?>\" class=\"plugin-icon\" alt=\"\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</h3>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"action-links\">\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( $action_links ) {\n\t\t\t\t\t\techo '<ul class=\"plugin-action-buttons\"><li>' . implode( '</li><li>', $action_links ) . '</li></ul>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"desc column-description\">\n\t\t\t\t\t<p><?php echo $description; ?></p>\n\t\t\t\t\t<p class=\"authors\"><?php echo $author; ?></p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"plugin-card-bottom\">\n\t\t\t\t<div class=\"vers column-rating\">\n\t\t\t\t\t<?php\n\t\t\t\t\twp_star_rating(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'rating' => $plugin['rating'],\n\t\t\t\t\t\t\t'type'   => 'percent',\n\t\t\t\t\t\t\t'number' => $plugin['num_ratings'],\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t\t<span class=\"num-ratings\" aria-hidden=\"true\">(<?php echo number_format_i18n( $plugin['num_ratings'] ); ?>)</span>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"column-updated\">\n\t\t\t\t\t<strong><?php _e( 'Last Updated:' ); ?></strong>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t/* translators: %s: Human-readable time difference. */\n\t\t\t\t\t\tprintf( __( '%s ago' ), human_time_diff( $last_updated_timestamp ) );\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"column-downloaded\">\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( $plugin['active_installs'] >= 1000000 ) {\n\t\t\t\t\t\t$active_installs_millions = floor( $plugin['active_installs'] / 1000000 );\n\t\t\t\t\t\t$active_installs_text     = sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Number of millions. */\n\t\t\t\t\t\t\t_nx( '%s+ Million', '%s+ Million', $active_installs_millions, 'Active plugin installations' ),\n\t\t\t\t\t\t\tnumber_format_i18n( $active_installs_millions )\n\t\t\t\t\t\t);\n\t\t\t\t\t} elseif ( 0 == $plugin['active_installs'] ) {\n\t\t\t\t\t\t$active_installs_text = _x( 'Less Than 10', 'Active plugin installations' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$active_installs_text = number_format_i18n( $plugin['active_installs'] ) . '+';\n\t\t\t\t\t}\n\t\t\t\t\t/* translators: %s: Number of installations. */\n\t\t\t\t\tprintf( __( '%s Active Installations' ), $active_installs_text );\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"column-compatibility\">\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( ! $tested_wp ) {\n\t\t\t\t\t\techo '<span class=\"compatibility-untested\">' . __( 'Untested with your version of WordPress' ) . '</span>';\n\t\t\t\t\t} elseif ( ! $compatible_wp ) {\n\t\t\t\t\t\techo '<span class=\"compatibility-incompatible\">' . __( '<strong>Incompatible</strong> with your version of WordPress' ) . '</span>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo '<span class=\"compatibility-compatible\">' . __( '<strong>Compatible</strong> with your version of WordPress' ) . '</span>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t\t<?php\n\t\t}\n\n\t\t// Close off the group divs of the last one.\n\t\tif ( ! empty( $group ) ) {\n\t\t\techo '</div></div>';\n\t\t}\n\t}\n}\n", "num_lines": 777}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_Plugins_List_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n/**\n * Core class used to implement displaying installed plugins in a list table.\n *\n * @since 3.1.0\n * @access private\n *\n * @see WP_List_Table\n */\nclass WP_Plugins_List_Table extends WP_List_Table {\n\t/**\n\t * Whether to show the auto-updates UI.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @var bool True if auto-updates UI is to be shown, false otherwise.\n\t */\n\tprotected $show_autoupdates = true;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @see WP_List_Table::__construct() for more information on default arguments.\n\t *\n\t * @global string $status\n\t * @global int    $page\n\t *\n\t * @param array $args An associative array of arguments.\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\tglobal $status, $page;\n\n\t\tparent::__construct(\n\t\t\tarray(\n\t\t\t\t'plural' => 'plugins',\n\t\t\t\t'screen' => isset( $args['screen'] ) ? $args['screen'] : null,\n\t\t\t)\n\t\t);\n\n\t\t$allowed_statuses = array( 'active', 'inactive', 'recently_activated', 'upgrade', 'mustuse', 'dropins', 'search', 'paused', 'auto-update-enabled', 'auto-update-disabled' );\n\n\t\t$status = 'all';\n\t\tif ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], $allowed_statuses, true ) ) {\n\t\t\t$status = $_REQUEST['plugin_status'];\n\t\t}\n\n\t\tif ( isset( $_REQUEST['s'] ) ) {\n\t\t\t$_SERVER['REQUEST_URI'] = add_query_arg( 's', wp_unslash( $_REQUEST['s'] ) );\n\t\t}\n\n\t\t$page = $this->get_pagenum();\n\n\t\t$this->show_autoupdates = wp_is_auto_update_enabled_for_type( 'plugin' )\n\t\t\t&& current_user_can( 'update_plugins' )\n\t\t\t&& ( ! is_multisite() || $this->screen->in_admin( 'network' ) )\n\t\t\t&& ! in_array( $status, array( 'mustuse', 'dropins' ), true );\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_table_classes() {\n\t\treturn array( 'widefat', $this->_args['plural'] );\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function ajax_user_can() {\n\t\treturn current_user_can( 'activate_plugins' );\n\t}\n\n\t/**\n\t * @global string $status\n\t * @global array  $plugins\n\t * @global array  $totals\n\t * @global int    $page\n\t * @global string $orderby\n\t * @global string $order\n\t * @global string $s\n\t */\n\tpublic function prepare_items() {\n\t\tglobal $status, $plugins, $totals, $page, $orderby, $order, $s;\n\n\t\twp_reset_vars( array( 'orderby', 'order' ) );\n\n\t\t/**\n\t\t * Filters the full array of plugins to list in the Plugins list table.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @see get_plugins()\n\t\t *\n\t\t * @param array $all_plugins An array of plugins to display in the list table.\n\t\t */\n\t\t$all_plugins = apply_filters( 'all_plugins', get_plugins() );\n\n\t\t$plugins = array(\n\t\t\t'all'                => $all_plugins,\n\t\t\t'search'             => array(),\n\t\t\t'active'             => array(),\n\t\t\t'inactive'           => array(),\n\t\t\t'recently_activated' => array(),\n\t\t\t'upgrade'            => array(),\n\t\t\t'mustuse'            => array(),\n\t\t\t'dropins'            => array(),\n\t\t\t'paused'             => array(),\n\t\t);\n\t\tif ( $this->show_autoupdates ) {\n\t\t\t$auto_updates = (array) get_site_option( 'auto_update_plugins', array() );\n\n\t\t\t$plugins['auto-update-enabled']  = array();\n\t\t\t$plugins['auto-update-disabled'] = array();\n\t\t}\n\n\t\t$screen = $this->screen;\n\n\t\tif ( ! is_multisite() || ( $screen->in_admin( 'network' ) && current_user_can( 'manage_network_plugins' ) ) ) {\n\n\t\t\t/**\n\t\t\t * Filters whether to display the advanced plugins list table.\n\t\t\t *\n\t\t\t * There are two types of advanced plugins - must-use and drop-ins -\n\t\t\t * which can be used in a single site or Multisite network.\n\t\t\t *\n\t\t\t * The $type parameter allows you to differentiate between the type of advanced\n\t\t\t * plugins to filter the display of. Contexts include 'mustuse' and 'dropins'.\n\t\t\t *\n\t\t\t * @since 3.0.0\n\t\t\t *\n\t\t\t * @param bool   $show Whether to show the advanced plugins for the specified\n\t\t\t *                     plugin type. Default true.\n\t\t\t * @param string $type The plugin type. Accepts 'mustuse', 'dropins'.\n\t\t\t */\n\t\t\tif ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) {\n\t\t\t\t$plugins['mustuse'] = get_mu_plugins();\n\t\t\t}\n\n\t\t\t/** This action is documented in wp-admin/includes/class-wp-plugins-list-table.php */\n\t\t\tif ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) ) {\n\t\t\t\t$plugins['dropins'] = get_dropins();\n\t\t\t}\n\n\t\t\tif ( current_user_can( 'update_plugins' ) ) {\n\t\t\t\t$current = get_site_transient( 'update_plugins' );\n\t\t\t\tforeach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {\n\t\t\t\t\tif ( isset( $current->response[ $plugin_file ] ) ) {\n\t\t\t\t\t\t$plugins['all'][ $plugin_file ]['update'] = true;\n\t\t\t\t\t\t$plugins['upgrade'][ $plugin_file ]       = $plugins['all'][ $plugin_file ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $screen->in_admin( 'network' ) ) {\n\t\t\t$show = current_user_can( 'manage_network_plugins' );\n\t\t\t/**\n\t\t\t * Filters whether to display network-active plugins alongside plugins active for the current site.\n\t\t\t *\n\t\t\t * This also controls the display of inactive network-only plugins (plugins with\n\t\t\t * \"Network: true\" in the plugin header).\n\t\t\t *\n\t\t\t * Plugins cannot be network-activated or network-deactivated from this screen.\n\t\t\t *\n\t\t\t * @since 4.4.0\n\t\t\t *\n\t\t\t * @param bool $show Whether to show network-active plugins. Default is whether the current\n\t\t\t *                   user can manage network plugins (ie. a Super Admin).\n\t\t\t */\n\t\t\t$show_network_active = apply_filters( 'show_network_active_plugins', $show );\n\t\t}\n\n\t\tif ( $screen->in_admin( 'network' ) ) {\n\t\t\t$recently_activated = get_site_option( 'recently_activated', array() );\n\t\t} else {\n\t\t\t$recently_activated = get_option( 'recently_activated', array() );\n\t\t}\n\n\t\tforeach ( $recently_activated as $key => $time ) {\n\t\t\tif ( $time + WEEK_IN_SECONDS < time() ) {\n\t\t\t\tunset( $recently_activated[ $key ] );\n\t\t\t}\n\t\t}\n\n\t\tif ( $screen->in_admin( 'network' ) ) {\n\t\t\tupdate_site_option( 'recently_activated', $recently_activated );\n\t\t} else {\n\t\t\tupdate_option( 'recently_activated', $recently_activated );\n\t\t}\n\n\t\t$plugin_info = get_site_transient( 'update_plugins' );\n\n\t\tforeach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {\n\t\t\t// Extra info if known. array_merge() ensures $plugin_data has precedence if keys collide.\n\t\t\tif ( isset( $plugin_info->response[ $plugin_file ] ) ) {\n\t\t\t\t$plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], array( 'update-supported' => true ), $plugin_data );\n\t\t\t} elseif ( isset( $plugin_info->no_update[ $plugin_file ] ) ) {\n\t\t\t\t$plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], array( 'update-supported' => true ), $plugin_data );\n\t\t\t} elseif ( empty( $plugin_data['update-supported'] ) ) {\n\t\t\t\t$plugin_data['update-supported'] = false;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Create the payload that's used for the auto_update_plugin filter.\n\t\t\t * This is the same data contained within $plugin_info->(response|no_update) however\n\t\t\t * not all plugins will be contained in those keys, this avoids unexpected warnings.\n\t\t\t */\n\t\t\t$filter_payload = array(\n\t\t\t\t'id'            => $plugin_file,\n\t\t\t\t'slug'          => '',\n\t\t\t\t'plugin'        => $plugin_file,\n\t\t\t\t'new_version'   => '',\n\t\t\t\t'url'           => '',\n\t\t\t\t'package'       => '',\n\t\t\t\t'icons'         => array(),\n\t\t\t\t'banners'       => array(),\n\t\t\t\t'banners_rtl'   => array(),\n\t\t\t\t'tested'        => '',\n\t\t\t\t'requires_php'  => '',\n\t\t\t\t'compatibility' => new stdClass(),\n\t\t\t);\n\t\t\t$filter_payload = (object) array_merge( $filter_payload, array_intersect_key( $plugin_data, $filter_payload ) );\n\n\t\t\t$type = 'plugin';\n\t\t\t/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */\n\t\t\t$auto_update_forced = apply_filters( \"auto_update_{$type}\", null, $filter_payload );\n\n\t\t\tif ( ! is_null( $auto_update_forced ) ) {\n\t\t\t\t$plugin_data['auto-update-forced'] = $auto_update_forced;\n\t\t\t}\n\n\t\t\t$plugins['all'][ $plugin_file ] = $plugin_data;\n\t\t\t// Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade.\n\t\t\tif ( isset( $plugins['upgrade'][ $plugin_file ] ) ) {\n\t\t\t\t$plugins['upgrade'][ $plugin_file ] = $plugin_data;\n\t\t\t}\n\n\t\t\t// Filter into individual sections.\n\t\t\tif ( is_multisite() && ! $screen->in_admin( 'network' ) && is_network_only_plugin( $plugin_file ) && ! is_plugin_active( $plugin_file ) ) {\n\t\t\t\tif ( $show_network_active ) {\n\t\t\t\t\t// On the non-network screen, show inactive network-only plugins if allowed.\n\t\t\t\t\t$plugins['inactive'][ $plugin_file ] = $plugin_data;\n\t\t\t\t} else {\n\t\t\t\t\t// On the non-network screen, filter out network-only plugins as long as they're not individually active.\n\t\t\t\t\tunset( $plugins['all'][ $plugin_file ] );\n\t\t\t\t}\n\t\t\t} elseif ( ! $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) {\n\t\t\t\tif ( $show_network_active ) {\n\t\t\t\t\t// On the non-network screen, show network-active plugins if allowed.\n\t\t\t\t\t$plugins['active'][ $plugin_file ] = $plugin_data;\n\t\t\t\t} else {\n\t\t\t\t\t// On the non-network screen, filter out network-active plugins.\n\t\t\t\t\tunset( $plugins['all'][ $plugin_file ] );\n\t\t\t\t}\n\t\t\t} elseif ( ( ! $screen->in_admin( 'network' ) && is_plugin_active( $plugin_file ) )\n\t\t\t\t|| ( $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) ) {\n\t\t\t\t// On the non-network screen, populate the active list with plugins that are individually activated.\n\t\t\t\t// On the network admin screen, populate the active list with plugins that are network-activated.\n\t\t\t\t$plugins['active'][ $plugin_file ] = $plugin_data;\n\n\t\t\t\tif ( ! $screen->in_admin( 'network' ) && is_plugin_paused( $plugin_file ) ) {\n\t\t\t\t\t$plugins['paused'][ $plugin_file ] = $plugin_data;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isset( $recently_activated[ $plugin_file ] ) ) {\n\t\t\t\t\t// Populate the recently activated list with plugins that have been recently activated.\n\t\t\t\t\t$plugins['recently_activated'][ $plugin_file ] = $plugin_data;\n\t\t\t\t}\n\t\t\t\t// Populate the inactive list with plugins that aren't activated.\n\t\t\t\t$plugins['inactive'][ $plugin_file ] = $plugin_data;\n\t\t\t}\n\n\t\t\tif ( $this->show_autoupdates ) {\n\t\t\t\t$enabled = in_array( $plugin_file, $auto_updates, true ) && $plugin_data['update-supported'];\n\t\t\t\tif ( isset( $plugin_data['auto-update-forced'] ) ) {\n\t\t\t\t\t$enabled = (bool) $plugin_data['auto-update-forced'];\n\t\t\t\t}\n\n\t\t\t\tif ( $enabled ) {\n\t\t\t\t\t$plugins['auto-update-enabled'][ $plugin_file ] = $plugin_data;\n\t\t\t\t} else {\n\t\t\t\t\t$plugins['auto-update-disabled'][ $plugin_file ] = $plugin_data;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( strlen( $s ) ) {\n\t\t\t$status            = 'search';\n\t\t\t$plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) );\n\t\t}\n\n\t\t$totals = array();\n\t\tforeach ( $plugins as $type => $list ) {\n\t\t\t$totals[ $type ] = count( $list );\n\t\t}\n\n\t\tif ( empty( $plugins[ $status ] ) && ! in_array( $status, array( 'all', 'search' ), true ) ) {\n\t\t\t$status = 'all';\n\t\t}\n\n\t\t$this->items = array();\n\t\tforeach ( $plugins[ $status ] as $plugin_file => $plugin_data ) {\n\t\t\t// Translate, don't apply markup, sanitize HTML.\n\t\t\t$this->items[ $plugin_file ] = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, false, true );\n\t\t}\n\n\t\t$total_this_page = $totals[ $status ];\n\n\t\t$js_plugins = array();\n\t\tforeach ( $plugins as $key => $list ) {\n\t\t\t$js_plugins[ $key ] = array_keys( (array) $list );\n\t\t}\n\n\t\twp_localize_script(\n\t\t\t'updates',\n\t\t\t'_wpUpdatesItemCounts',\n\t\t\tarray(\n\t\t\t\t'plugins' => $js_plugins,\n\t\t\t\t'totals'  => wp_get_update_data(),\n\t\t\t)\n\t\t);\n\n\t\tif ( ! $orderby ) {\n\t\t\t$orderby = 'Name';\n\t\t} else {\n\t\t\t$orderby = ucfirst( $orderby );\n\t\t}\n\n\t\t$order = strtoupper( $order );\n\n\t\tuasort( $this->items, array( $this, '_order_callback' ) );\n\n\t\t$plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', $screen->id . '_per_page' ), 999 );\n\n\t\t$start = ( $page - 1 ) * $plugins_per_page;\n\n\t\tif ( $total_this_page > $plugins_per_page ) {\n\t\t\t$this->items = array_slice( $this->items, $start, $plugins_per_page );\n\t\t}\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items' => $total_this_page,\n\t\t\t\t'per_page'    => $plugins_per_page,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * @global string $s URL encoded search term.\n\t *\n\t * @param array $plugin\n\t * @return bool\n\t */\n\tpublic function _search_callback( $plugin ) {\n\t\tglobal $s;\n\n\t\tforeach ( $plugin as $value ) {\n\t\t\tif ( is_string( $value ) && false !== stripos( strip_tags( $value ), urldecode( $s ) ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * @global string $orderby\n\t * @global string $order\n\t * @param array $plugin_a\n\t * @param array $plugin_b\n\t * @return int\n\t */\n\tpublic function _order_callback( $plugin_a, $plugin_b ) {\n\t\tglobal $orderby, $order;\n\n\t\t$a = $plugin_a[ $orderby ];\n\t\t$b = $plugin_b[ $orderby ];\n\n\t\tif ( $a == $b ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif ( 'DESC' === $order ) {\n\t\t\treturn strcasecmp( $b, $a );\n\t\t} else {\n\t\t\treturn strcasecmp( $a, $b );\n\t\t}\n\t}\n\n\t/**\n\t * @global array $plugins\n\t */\n\tpublic function no_items() {\n\t\tglobal $plugins;\n\n\t\tif ( ! empty( $_REQUEST['s'] ) ) {\n\t\t\t$s = esc_html( wp_unslash( $_REQUEST['s'] ) );\n\n\t\t\t/* translators: %s: Plugin search term. */\n\t\t\tprintf( __( 'No plugins found for &#8220;%s&#8221;.' ), $s );\n\n\t\t\t// We assume that somebody who can install plugins in multisite is experienced enough to not need this helper link.\n\t\t\tif ( ! is_multisite() && current_user_can( 'install_plugins' ) ) {\n\t\t\t\techo ' <a href=\"' . esc_url( admin_url( 'plugin-install.php?tab=search&s=' . urlencode( $s ) ) ) . '\">' . __( 'Search for plugins in the WordPress Plugin Directory.' ) . '</a>';\n\t\t\t}\n\t\t} elseif ( ! empty( $plugins['all'] ) ) {\n\t\t\t_e( 'No plugins found.' );\n\t\t} else {\n\t\t\t_e( 'No plugins are currently available.' );\n\t\t}\n\t}\n\n\t/**\n\t * Displays the search box.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string $text     The 'submit' button label.\n\t * @param string $input_id ID attribute value for the search input field.\n\t */\n\tpublic function search_box( $text, $input_id ) {\n\t\tif ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$input_id = $input_id . '-search-input';\n\n\t\tif ( ! empty( $_REQUEST['orderby'] ) ) {\n\t\t\techo '<input type=\"hidden\" name=\"orderby\" value=\"' . esc_attr( $_REQUEST['orderby'] ) . '\" />';\n\t\t}\n\t\tif ( ! empty( $_REQUEST['order'] ) ) {\n\t\t\techo '<input type=\"hidden\" name=\"order\" value=\"' . esc_attr( $_REQUEST['order'] ) . '\" />';\n\t\t}\n\t\t?>\n\t\t<p class=\"search-box\">\n\t\t\t<label class=\"screen-reader-text\" for=\"<?php echo esc_attr( $input_id ); ?>\"><?php echo $text; ?>:</label>\n\t\t\t<input type=\"search\" id=\"<?php echo esc_attr( $input_id ); ?>\" class=\"wp-filter-search\" name=\"s\" value=\"<?php _admin_search_query(); ?>\" placeholder=\"<?php esc_attr_e( 'Search installed plugins...' ); ?>\"/>\n\t\t\t<?php submit_button( $text, 'hide-if-js', '', false, array( 'id' => 'search-submit' ) ); ?>\n\t\t</p>\n\t\t<?php\n\t}\n\n\t/**\n\t * @global string $status\n\t * @return array\n\t */\n\tpublic function get_columns() {\n\t\tglobal $status;\n\n\t\t$columns = array(\n\t\t\t'cb'          => ! in_array( $status, array( 'mustuse', 'dropins' ), true ) ? '<input type=\"checkbox\" />' : '',\n\t\t\t'name'        => __( 'Plugin' ),\n\t\t\t'description' => __( 'Description' ),\n\t\t);\n\n\t\tif ( $this->show_autoupdates ) {\n\t\t\t$columns['auto-updates'] = __( 'Automatic Updates' );\n\t\t}\n\n\t\treturn $columns;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_sortable_columns() {\n\t\treturn array();\n\t}\n\n\t/**\n\t * @global array $totals\n\t * @global string $status\n\t * @return array\n\t */\n\tprotected function get_views() {\n\t\tglobal $totals, $status;\n\n\t\t$status_links = array();\n\t\tforeach ( $totals as $type => $count ) {\n\t\t\tif ( ! $count ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase 'all':\n\t\t\t\t\t/* translators: %s: Number of plugins. */\n\t\t\t\t\t$text = _nx(\n\t\t\t\t\t\t'All <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'All <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count,\n\t\t\t\t\t\t'plugins'\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'active':\n\t\t\t\t\t/* translators: %s: Number of plugins. */\n\t\t\t\t\t$text = _n(\n\t\t\t\t\t\t'Active <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'Active <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'recently_activated':\n\t\t\t\t\t/* translators: %s: Number of plugins. */\n\t\t\t\t\t$text = _n(\n\t\t\t\t\t\t'Recently Active <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'Recently Active <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'inactive':\n\t\t\t\t\t/* translators: %s: Number of plugins. */\n\t\t\t\t\t$text = _n(\n\t\t\t\t\t\t'Inactive <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'Inactive <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'mustuse':\n\t\t\t\t\t/* translators: %s: Number of plugins. */\n\t\t\t\t\t$text = _n(\n\t\t\t\t\t\t'Must-Use <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'Must-Use <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'dropins':\n\t\t\t\t\t/* translators: %s: Number of plugins. */\n\t\t\t\t\t$text = _n(\n\t\t\t\t\t\t'Drop-in <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'Drop-ins <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'paused':\n\t\t\t\t\t/* translators: %s: Number of plugins. */\n\t\t\t\t\t$text = _n(\n\t\t\t\t\t\t'Paused <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'Paused <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'upgrade':\n\t\t\t\t\t/* translators: %s: Number of plugins. */\n\t\t\t\t\t$text = _n(\n\t\t\t\t\t\t'Update Available <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'Update Available <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'auto-update-enabled':\n\t\t\t\t\t/* translators: %s: Number of plugins. */\n\t\t\t\t\t$text = _n(\n\t\t\t\t\t\t'Auto-updates Enabled <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'Auto-updates Enabled <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'auto-update-disabled':\n\t\t\t\t\t/* translators: %s: Number of plugins. */\n\t\t\t\t\t$text = _n(\n\t\t\t\t\t\t'Auto-updates Disabled <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t'Auto-updates Disabled <span class=\"count\">(%s)</span>',\n\t\t\t\t\t\t$count\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( 'search' !== $type ) {\n\t\t\t\t$status_links[ $type ] = sprintf(\n\t\t\t\t\t\"<a href='%s'%s>%s</a>\",\n\t\t\t\t\tadd_query_arg( 'plugin_status', $type, 'plugins.php' ),\n\t\t\t\t\t( $type === $status ) ? ' class=\"current\" aria-current=\"page\"' : '',\n\t\t\t\t\tsprintf( $text, number_format_i18n( $count ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $status_links;\n\t}\n\n\t/**\n\t * @global string $status\n\t * @return array\n\t */\n\tprotected function get_bulk_actions() {\n\t\tglobal $status;\n\n\t\t$actions = array();\n\n\t\tif ( 'active' !== $status ) {\n\t\t\t$actions['activate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Activate' ) : __( 'Activate' );\n\t\t}\n\n\t\tif ( 'inactive' !== $status && 'recent' !== $status ) {\n\t\t\t$actions['deactivate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Deactivate' ) : __( 'Deactivate' );\n\t\t}\n\n\t\tif ( ! is_multisite() || $this->screen->in_admin( 'network' ) ) {\n\t\t\tif ( current_user_can( 'update_plugins' ) ) {\n\t\t\t\t$actions['update-selected'] = __( 'Update' );\n\t\t\t}\n\n\t\t\tif ( current_user_can( 'delete_plugins' ) && ( 'active' !== $status ) ) {\n\t\t\t\t$actions['delete-selected'] = __( 'Delete' );\n\t\t\t}\n\n\t\t\tif ( $this->show_autoupdates ) {\n\t\t\t\tif ( 'auto-update-enabled' !== $status ) {\n\t\t\t\t\t$actions['enable-auto-update-selected'] = __( 'Enable Auto-updates' );\n\t\t\t\t}\n\t\t\t\tif ( 'auto-update-disabled' !== $status ) {\n\t\t\t\t\t$actions['disable-auto-update-selected'] = __( 'Disable Auto-updates' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $actions;\n\t}\n\n\t/**\n\t * @global string $status\n\t * @param string $which\n\t */\n\tpublic function bulk_actions( $which = '' ) {\n\t\tglobal $status;\n\n\t\tif ( in_array( $status, array( 'mustuse', 'dropins' ), true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tparent::bulk_actions( $which );\n\t}\n\n\t/**\n\t * @global string $status\n\t * @param string $which\n\t */\n\tprotected function extra_tablenav( $which ) {\n\t\tglobal $status;\n\n\t\tif ( ! in_array( $status, array( 'recently_activated', 'mustuse', 'dropins' ), true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo '<div class=\"alignleft actions\">';\n\n\t\tif ( 'recently_activated' === $status ) {\n\t\t\tsubmit_button( __( 'Clear List' ), '', 'clear-recent-list', false );\n\t\t} elseif ( 'top' === $which && 'mustuse' === $status ) {\n\t\t\techo '<p>' . sprintf(\n\t\t\t\t/* translators: %s: mu-plugins directory name. */\n\t\t\t\t__( 'Files in the %s directory are executed automatically.' ),\n\t\t\t\t'<code>' . str_replace( ABSPATH, '/', WPMU_PLUGIN_DIR ) . '</code>'\n\t\t\t) . '</p>';\n\t\t} elseif ( 'top' === $which && 'dropins' === $status ) {\n\t\t\techo '<p>' . sprintf(\n\t\t\t\t/* translators: %s: wp-content directory name. */\n\t\t\t\t__( 'Drop-ins are single files, found in the %s directory, that replace or enhance WordPress features in ways that are not possible for traditional plugins.' ),\n\t\t\t\t'<code>' . str_replace( ABSPATH, '', WP_CONTENT_DIR ) . '</code>'\n\t\t\t) . '</p>';\n\t\t}\n\t\techo '</div>';\n\t}\n\n\t/**\n\t * @return string\n\t */\n\tpublic function current_action() {\n\t\tif ( isset( $_POST['clear-recent-list'] ) ) {\n\t\t\treturn 'clear-recent-list';\n\t\t}\n\n\t\treturn parent::current_action();\n\t}\n\n\t/**\n\t * @global string $status\n\t */\n\tpublic function display_rows() {\n\t\tglobal $status;\n\n\t\tif ( is_multisite() && ! $this->screen->in_admin( 'network' ) && in_array( $status, array( 'mustuse', 'dropins' ), true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $this->items as $plugin_file => $plugin_data ) {\n\t\t\t$this->single_row( array( $plugin_file, $plugin_data ) );\n\t\t}\n\t}\n\n\t/**\n\t * @global string $status\n\t * @global int $page\n\t * @global string $s\n\t * @global array $totals\n\t *\n\t * @param array $item\n\t */\n\tpublic function single_row( $item ) {\n\t\tglobal $status, $page, $s, $totals;\n\t\tstatic $plugin_id_attrs = array();\n\n\t\tlist( $plugin_file, $plugin_data ) = $item;\n\n\t\t$plugin_slug    = isset( $plugin_data['slug'] ) ? $plugin_data['slug'] : sanitize_title( $plugin_data['Name'] );\n\t\t$plugin_id_attr = $plugin_slug;\n\n\t\t// Ensure the ID attribute is unique.\n\t\t$suffix = 2;\n\t\twhile ( in_array( $plugin_id_attr, $plugin_id_attrs, true ) ) {\n\t\t\t$plugin_id_attr = \"$plugin_slug-$suffix\";\n\t\t\t$suffix++;\n\t\t}\n\n\t\t$plugin_id_attrs[] = $plugin_id_attr;\n\n\t\t$context = $status;\n\t\t$screen  = $this->screen;\n\n\t\t// Pre-order.\n\t\t$actions = array(\n\t\t\t'deactivate' => '',\n\t\t\t'activate'   => '',\n\t\t\t'details'    => '',\n\t\t\t'delete'     => '',\n\t\t);\n\n\t\t// Do not restrict by default.\n\t\t$restrict_network_active = false;\n\t\t$restrict_network_only   = false;\n\n\t\tif ( 'mustuse' === $context ) {\n\t\t\t$is_active = true;\n\t\t} elseif ( 'dropins' === $context ) {\n\t\t\t$dropins     = _get_dropins();\n\t\t\t$plugin_name = $plugin_file;\n\t\t\tif ( $plugin_file != $plugin_data['Name'] ) {\n\t\t\t\t$plugin_name .= '<br/>' . $plugin_data['Name'];\n\t\t\t}\n\t\t\tif ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant.\n\t\t\t\t$is_active   = true;\n\t\t\t\t$description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';\n\t\t\t} elseif ( defined( $dropins[ $plugin_file ][1] ) && constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true.\n\t\t\t\t$is_active   = true;\n\t\t\t\t$description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';\n\t\t\t} else {\n\t\t\t\t$is_active   = false;\n\t\t\t\t$description = '<p><strong>' . $dropins[ $plugin_file ][0] . ' <span class=\"error-message\">' . __( 'Inactive:' ) . '</span></strong> ' .\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1: Drop-in constant name, 2: wp-config.php */\n\t\t\t\t\t\t__( 'Requires %1$s in %2$s file.' ),\n\t\t\t\t\t\t\"<code>define('\" . $dropins[ $plugin_file ][1] . \"', true);</code>\",\n\t\t\t\t\t\t'<code>wp-config.php</code>'\n\t\t\t\t\t) . '</p>';\n\t\t\t}\n\t\t\tif ( $plugin_data['Description'] ) {\n\t\t\t\t$description .= '<p>' . $plugin_data['Description'] . '</p>';\n\t\t\t}\n\t\t} else {\n\t\t\tif ( $screen->in_admin( 'network' ) ) {\n\t\t\t\t$is_active = is_plugin_active_for_network( $plugin_file );\n\t\t\t} else {\n\t\t\t\t$is_active               = is_plugin_active( $plugin_file );\n\t\t\t\t$restrict_network_active = ( is_multisite() && is_plugin_active_for_network( $plugin_file ) );\n\t\t\t\t$restrict_network_only   = ( is_multisite() && is_network_only_plugin( $plugin_file ) && ! $is_active );\n\t\t\t}\n\n\t\t\tif ( $screen->in_admin( 'network' ) ) {\n\t\t\t\tif ( $is_active ) {\n\t\t\t\t\tif ( current_user_can( 'manage_network_plugins' ) ) {\n\t\t\t\t\t\t$actions['deactivate'] = sprintf(\n\t\t\t\t\t\t\t'<a href=\"%s\" id=\"deactivate-%s\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t\t\twp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file ),\n\t\t\t\t\t\t\tesc_attr( $plugin_id_attr ),\n\t\t\t\t\t\t\t/* translators: %s: Plugin name. */\n\t\t\t\t\t\t\tesc_attr( sprintf( _x( 'Network Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ),\n\t\t\t\t\t\t\t__( 'Network Deactivate' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( current_user_can( 'manage_network_plugins' ) ) {\n\t\t\t\t\t\t$actions['activate'] = sprintf(\n\t\t\t\t\t\t\t'<a href=\"%s\" id=\"activate-%s\" class=\"edit\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t\t\twp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file ),\n\t\t\t\t\t\t\tesc_attr( $plugin_id_attr ),\n\t\t\t\t\t\t\t/* translators: %s: Plugin name. */\n\t\t\t\t\t\t\tesc_attr( sprintf( _x( 'Network Activate %s', 'plugin' ), $plugin_data['Name'] ) ),\n\t\t\t\t\t\t\t__( 'Network Activate' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) ) {\n\t\t\t\t\t\t$actions['delete'] = sprintf(\n\t\t\t\t\t\t\t'<a href=\"%s\" id=\"delete-%s\" class=\"delete\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t\t\twp_nonce_url( 'plugins.php?action=delete-selected&amp;checked[]=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins' ),\n\t\t\t\t\t\t\tesc_attr( $plugin_id_attr ),\n\t\t\t\t\t\t\t/* translators: %s: Plugin name. */\n\t\t\t\t\t\t\tesc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ),\n\t\t\t\t\t\t\t__( 'Delete' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( $restrict_network_active ) {\n\t\t\t\t\t$actions = array(\n\t\t\t\t\t\t'network_active' => __( 'Network Active' ),\n\t\t\t\t\t);\n\t\t\t\t} elseif ( $restrict_network_only ) {\n\t\t\t\t\t$actions = array(\n\t\t\t\t\t\t'network_only' => __( 'Network Only' ),\n\t\t\t\t\t);\n\t\t\t\t} elseif ( $is_active ) {\n\t\t\t\t\tif ( current_user_can( 'deactivate_plugin', $plugin_file ) ) {\n\t\t\t\t\t\t$actions['deactivate'] = sprintf(\n\t\t\t\t\t\t\t'<a href=\"%s\" id=\"deactivate-%s\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t\t\twp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file ),\n\t\t\t\t\t\t\tesc_attr( $plugin_id_attr ),\n\t\t\t\t\t\t\t/* translators: %s: Plugin name. */\n\t\t\t\t\t\t\tesc_attr( sprintf( _x( 'Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ),\n\t\t\t\t\t\t\t__( 'Deactivate' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( current_user_can( 'resume_plugin', $plugin_file ) && is_plugin_paused( $plugin_file ) ) {\n\t\t\t\t\t\t$actions['resume'] = sprintf(\n\t\t\t\t\t\t\t'<a href=\"%s\" id=\"resume-%s\" class=\"resume-link\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t\t\twp_nonce_url( 'plugins.php?action=resume&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'resume-plugin_' . $plugin_file ),\n\t\t\t\t\t\t\tesc_attr( $plugin_id_attr ),\n\t\t\t\t\t\t\t/* translators: %s: Plugin name. */\n\t\t\t\t\t\t\tesc_attr( sprintf( _x( 'Resume %s', 'plugin' ), $plugin_data['Name'] ) ),\n\t\t\t\t\t\t\t__( 'Resume' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( current_user_can( 'activate_plugin', $plugin_file ) ) {\n\t\t\t\t\t\t$actions['activate'] = sprintf(\n\t\t\t\t\t\t\t'<a href=\"%s\" id=\"activate-%s\" class=\"edit\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t\t\twp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file ),\n\t\t\t\t\t\t\tesc_attr( $plugin_id_attr ),\n\t\t\t\t\t\t\t/* translators: %s: Plugin name. */\n\t\t\t\t\t\t\tesc_attr( sprintf( _x( 'Activate %s', 'plugin' ), $plugin_data['Name'] ) ),\n\t\t\t\t\t\t\t__( 'Activate' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! is_multisite() && current_user_can( 'delete_plugins' ) ) {\n\t\t\t\t\t\t$actions['delete'] = sprintf(\n\t\t\t\t\t\t\t'<a href=\"%s\" id=\"delete-%s\" class=\"delete\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t\t\twp_nonce_url( 'plugins.php?action=delete-selected&amp;checked[]=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins' ),\n\t\t\t\t\t\t\tesc_attr( $plugin_id_attr ),\n\t\t\t\t\t\t\t/* translators: %s: Plugin name. */\n\t\t\t\t\t\t\tesc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ),\n\t\t\t\t\t\t\t__( 'Delete' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} // End if $is_active.\n\t\t\t} // End if $screen->in_admin( 'network' ).\n\t\t} // End if $context.\n\n\t\t$actions = array_filter( $actions );\n\n\t\tif ( $screen->in_admin( 'network' ) ) {\n\n\t\t\t/**\n\t\t\t * Filters the action links displayed for each plugin in the Network Admin Plugins list table.\n\t\t\t *\n\t\t\t * @since 3.1.0\n\t\t\t *\n\t\t\t * @param string[] $actions     An array of plugin action links. By default this can include 'activate',\n\t\t\t *                              'deactivate', and 'delete'.\n\t\t\t * @param string   $plugin_file Path to the plugin file relative to the plugins directory.\n\t\t\t * @param array    $plugin_data An array of plugin data. See `get_plugin_data()`.\n\t\t\t * @param string   $context     The plugin context. By default this can include 'all', 'active', 'inactive',\n\t\t\t *                              'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.\n\t\t\t */\n\t\t\t$actions = apply_filters( 'network_admin_plugin_action_links', $actions, $plugin_file, $plugin_data, $context );\n\n\t\t\t/**\n\t\t\t * Filters the list of action links displayed for a specific plugin in the Network Admin Plugins list table.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$plugin_file`, refers to the path\n\t\t\t * to the plugin file, relative to the plugins directory.\n\t\t\t *\n\t\t\t * @since 3.1.0\n\t\t\t *\n\t\t\t * @param string[] $actions     An array of plugin action links. By default this can include 'activate',\n\t\t\t *                              'deactivate', and 'delete'.\n\t\t\t * @param string   $plugin_file Path to the plugin file relative to the plugins directory.\n\t\t\t * @param array    $plugin_data An array of plugin data. See `get_plugin_data()`.\n\t\t\t * @param string   $context     The plugin context. By default this can include 'all', 'active', 'inactive',\n\t\t\t *                              'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.\n\t\t\t */\n\t\t\t$actions = apply_filters( \"network_admin_plugin_action_links_{$plugin_file}\", $actions, $plugin_file, $plugin_data, $context );\n\n\t\t} else {\n\n\t\t\t/**\n\t\t\t * Filters the action links displayed for each plugin in the Plugins list table.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t * @since 2.6.0 The `$context` parameter was added.\n\t\t\t * @since 4.9.0 The 'Edit' link was removed from the list of action links.\n\t\t\t *\n\t\t\t * @param string[] $actions     An array of plugin action links. By default this can include 'activate',\n\t\t\t *                              'deactivate', and 'delete'. With Multisite active this can also include\n\t\t\t *                              'network_active' and 'network_only' items.\n\t\t\t * @param string   $plugin_file Path to the plugin file relative to the plugins directory.\n\t\t\t * @param array    $plugin_data An array of plugin data. See `get_plugin_data()`.\n\t\t\t * @param string   $context     The plugin context. By default this can include 'all', 'active', 'inactive',\n\t\t\t *                              'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.\n\t\t\t */\n\t\t\t$actions = apply_filters( 'plugin_action_links', $actions, $plugin_file, $plugin_data, $context );\n\n\t\t\t/**\n\t\t\t * Filters the list of action links displayed for a specific plugin in the Plugins list table.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$plugin_file`, refers to the path\n\t\t\t * to the plugin file, relative to the plugins directory.\n\t\t\t *\n\t\t\t * @since 2.7.0\n\t\t\t * @since 4.9.0 The 'Edit' link was removed from the list of action links.\n\t\t\t *\n\t\t\t * @param string[] $actions     An array of plugin action links. By default this can include 'activate',\n\t\t\t *                              'deactivate', and 'delete'. With Multisite active this can also include\n\t\t\t *                              'network_active' and 'network_only' items.\n\t\t\t * @param string   $plugin_file Path to the plugin file relative to the plugins directory.\n\t\t\t * @param array    $plugin_data An array of plugin data. See `get_plugin_data()`.\n\t\t\t * @param string   $context     The plugin context. By default this can include 'all', 'active', 'inactive',\n\t\t\t *                              'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.\n\t\t\t */\n\t\t\t$actions = apply_filters( \"plugin_action_links_{$plugin_file}\", $actions, $plugin_file, $plugin_data, $context );\n\n\t\t}\n\n\t\t$requires_php   = isset( $plugin_data['requires_php'] ) ? $plugin_data['requires_php'] : null;\n\t\t$compatible_php = is_php_version_compatible( $requires_php );\n\t\t$class          = $is_active ? 'active' : 'inactive';\n\t\t$checkbox_id    = 'checkbox_' . md5( $plugin_data['Name'] );\n\t\tif ( $restrict_network_active || $restrict_network_only || in_array( $status, array( 'mustuse', 'dropins' ), true ) || ! $compatible_php ) {\n\t\t\t$checkbox = '';\n\t\t} else {\n\t\t\t$checkbox = sprintf(\n\t\t\t\t'<label class=\"screen-reader-text\" for=\"%1$s\">%2$s</label>' .\n\t\t\t\t'<input type=\"checkbox\" name=\"checked[]\" value=\"%3$s\" id=\"%1$s\" />',\n\t\t\t\t$checkbox_id,\n\t\t\t\t/* translators: %s: Plugin name. */\n\t\t\t\tsprintf( __( 'Select %s' ), $plugin_data['Name'] ),\n\t\t\t\tesc_attr( $plugin_file )\n\t\t\t);\n\t\t}\n\t\tif ( 'dropins' !== $context ) {\n\t\t\t$description = '<p>' . ( $plugin_data['Description'] ? $plugin_data['Description'] : '&nbsp;' ) . '</p>';\n\t\t\t$plugin_name = $plugin_data['Name'];\n\t\t}\n\n\t\tif ( ! empty( $totals['upgrade'] ) && ! empty( $plugin_data['update'] ) ) {\n\t\t\t$class .= ' update';\n\t\t}\n\n\t\t$paused = ! $screen->in_admin( 'network' ) && is_plugin_paused( $plugin_file );\n\n\t\tif ( $paused ) {\n\t\t\t$class .= ' paused';\n\t\t}\n\n\t\tif ( is_uninstallable_plugin( $plugin_file ) ) {\n\t\t\t$class .= ' is-uninstallable';\n\t\t}\n\n\t\tprintf(\n\t\t\t'<tr class=\"%s\" data-slug=\"%s\" data-plugin=\"%s\">',\n\t\t\tesc_attr( $class ),\n\t\t\tesc_attr( $plugin_slug ),\n\t\t\tesc_attr( $plugin_file )\n\t\t);\n\n\t\tlist( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();\n\n\t\t$auto_updates      = (array) get_site_option( 'auto_update_plugins', array() );\n\t\t$available_updates = get_site_transient( 'update_plugins' );\n\n\t\tforeach ( $columns as $column_name => $column_display_name ) {\n\t\t\t$extra_classes = '';\n\t\t\tif ( in_array( $column_name, $hidden, true ) ) {\n\t\t\t\t$extra_classes = ' hidden';\n\t\t\t}\n\n\t\t\tswitch ( $column_name ) {\n\t\t\t\tcase 'cb':\n\t\t\t\t\techo \"<th scope='row' class='check-column'>$checkbox</th>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'name':\n\t\t\t\t\techo \"<td class='plugin-title column-primary'><strong>$plugin_name</strong>\";\n\t\t\t\t\techo $this->row_actions( $actions, true );\n\t\t\t\t\techo '</td>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'description':\n\t\t\t\t\t$classes = 'column-description desc';\n\n\t\t\t\t\techo \"<td class='$classes{$extra_classes}'>\n\t\t\t\t\t\t<div class='plugin-description'>$description</div>\n\t\t\t\t\t\t<div class='$class second plugin-version-author-uri'>\";\n\n\t\t\t\t\t$plugin_meta = array();\n\t\t\t\t\tif ( ! empty( $plugin_data['Version'] ) ) {\n\t\t\t\t\t\t/* translators: %s: Plugin version number. */\n\t\t\t\t\t\t$plugin_meta[] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! empty( $plugin_data['Author'] ) ) {\n\t\t\t\t\t\t$author = $plugin_data['Author'];\n\t\t\t\t\t\tif ( ! empty( $plugin_data['AuthorURI'] ) ) {\n\t\t\t\t\t\t\t$author = '<a href=\"' . $plugin_data['AuthorURI'] . '\">' . $plugin_data['Author'] . '</a>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/* translators: %s: Plugin author name. */\n\t\t\t\t\t\t$plugin_meta[] = sprintf( __( 'By %s' ), $author );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Details link using API info, if available.\n\t\t\t\t\tif ( isset( $plugin_data['slug'] ) && current_user_can( 'install_plugins' ) ) {\n\t\t\t\t\t\t$plugin_meta[] = sprintf(\n\t\t\t\t\t\t\t'<a href=\"%s\" class=\"thickbox open-plugin-details-modal\" aria-label=\"%s\" data-title=\"%s\">%s</a>',\n\t\t\t\t\t\t\tesc_url(\n\t\t\t\t\t\t\t\tnetwork_admin_url(\n\t\t\t\t\t\t\t\t\t'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data['slug'] .\n\t\t\t\t\t\t\t\t\t'&TB_iframe=true&width=600&height=550'\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/* translators: %s: Plugin name. */\n\t\t\t\t\t\t\tesc_attr( sprintf( __( 'More information about %s' ), $plugin_name ) ),\n\t\t\t\t\t\t\tesc_attr( $plugin_name ),\n\t\t\t\t\t\t\t__( 'View details' )\n\t\t\t\t\t\t);\n\t\t\t\t\t} elseif ( ! empty( $plugin_data['PluginURI'] ) ) {\n\t\t\t\t\t\t$plugin_meta[] = sprintf(\n\t\t\t\t\t\t\t'<a href=\"%s\">%s</a>',\n\t\t\t\t\t\t\tesc_url( $plugin_data['PluginURI'] ),\n\t\t\t\t\t\t\t__( 'Visit plugin site' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters the array of row meta for each plugin in the Plugins list table.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 2.8.0\n\t\t\t\t\t *\n\t\t\t\t\t * @param string[] $plugin_meta An array of the plugin's metadata, including\n\t\t\t\t\t *                              the version, author, author URI, and plugin URI.\n\t\t\t\t\t * @param string   $plugin_file Path to the plugin file relative to the plugins directory.\n\t\t\t\t\t * @param array    $plugin_data An array of plugin data.\n\t\t\t\t\t * @param string   $status      Status filter currently applied to the plugin list. Possible\n\t\t\t\t\t *                              values are: 'all', 'active', 'inactive', 'recently_activated',\n\t\t\t\t\t *                              'upgrade', 'mustuse', 'dropins', 'search', 'paused',\n\t\t\t\t\t *                              'auto-update-enabled', 'auto-update-disabled'.\n\t\t\t\t\t */\n\t\t\t\t\t$plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $status );\n\n\t\t\t\t\techo implode( ' | ', $plugin_meta );\n\n\t\t\t\t\techo '</div>';\n\n\t\t\t\t\tif ( $paused ) {\n\t\t\t\t\t\t$notice_text = __( 'This plugin failed to load properly and is paused during recovery mode.' );\n\n\t\t\t\t\t\tprintf( '<p><span class=\"dashicons dashicons-warning\"></span> <strong>%s</strong></p>', $notice_text );\n\n\t\t\t\t\t\t$error = wp_get_plugin_error( $plugin_file );\n\n\t\t\t\t\t\tif ( false !== $error ) {\n\t\t\t\t\t\t\tprintf( '<div class=\"error-display\"><p>%s</p></div>', wp_get_extension_error_description( $error ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\techo '</td>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'auto-updates':\n\t\t\t\t\tif ( ! $this->show_autoupdates ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\techo \"<td class='column-auto-updates{$extra_classes}'>\";\n\n\t\t\t\t\t$html = array();\n\n\t\t\t\t\tif ( isset( $plugin_data['auto-update-forced'] ) ) {\n\t\t\t\t\t\tif ( $plugin_data['auto-update-forced'] ) {\n\t\t\t\t\t\t\t// Forced on.\n\t\t\t\t\t\t\t$text = __( 'Auto-updates enabled' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$text = __( 'Auto-updates disabled' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$action     = 'unavailable';\n\t\t\t\t\t\t$time_class = ' hidden';\n\t\t\t\t\t} elseif ( empty( $plugin_data['update-supported'] ) ) {\n\t\t\t\t\t\t$text       = '';\n\t\t\t\t\t\t$action     = 'unavailable';\n\t\t\t\t\t\t$time_class = ' hidden';\n\t\t\t\t\t} elseif ( in_array( $plugin_file, $auto_updates, true ) ) {\n\t\t\t\t\t\t$text       = __( 'Disable auto-updates' );\n\t\t\t\t\t\t$action     = 'disable';\n\t\t\t\t\t\t$time_class = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$text       = __( 'Enable auto-updates' );\n\t\t\t\t\t\t$action     = 'enable';\n\t\t\t\t\t\t$time_class = ' hidden';\n\t\t\t\t\t}\n\n\t\t\t\t\t$query_args = array(\n\t\t\t\t\t\t'action'        => \"{$action}-auto-update\",\n\t\t\t\t\t\t'plugin'        => $plugin_file,\n\t\t\t\t\t\t'paged'         => $page,\n\t\t\t\t\t\t'plugin_status' => $status,\n\t\t\t\t\t);\n\n\t\t\t\t\t$url = add_query_arg( $query_args, 'plugins.php' );\n\n\t\t\t\t\tif ( 'unavailable' == $action ) {\n\t\t\t\t\t\t$html[] = '<span class=\"label\">' . $text . '</span>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$html[] = sprintf(\n\t\t\t\t\t\t\t'<a href=\"%s\" class=\"toggle-auto-update aria-button-if-js\" data-wp-action=\"%s\">',\n\t\t\t\t\t\t\twp_nonce_url( $url, 'updates' ),\n\t\t\t\t\t\t\t$action\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$html[] = '<span class=\"dashicons dashicons-update spin hidden\" aria-hidden=\"true\"></span>';\n\t\t\t\t\t\t$html[] = '<span class=\"label\">' . $text . '</span>';\n\t\t\t\t\t\t$html[] = '</a>';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $plugin_data['update'] ) ) {\n\t\t\t\t\t\t$html[] = sprintf(\n\t\t\t\t\t\t\t'<div class=\"auto-update-time%s\">%s</div>',\n\t\t\t\t\t\t\t$time_class,\n\t\t\t\t\t\t\twp_get_auto_update_message()\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$html = implode( '', $html );\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters the HTML of the auto-updates setting for each plugin in the Plugins list table.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 5.5.0\n\t\t\t\t\t *\n\t\t\t\t\t * @param string $html        The HTML of the plugin's auto-update column content, including\n\t\t\t\t\t *                            toggle auto-update action links and time to next update.\n\t\t\t\t\t * @param string $plugin_file Path to the plugin file relative to the plugins directory.\n\t\t\t\t\t * @param array  $plugin_data An array of plugin data.\n\t\t\t\t\t */\n\t\t\t\t\techo apply_filters( 'plugin_auto_update_setting_html', $html, $plugin_file, $plugin_data );\n\n\t\t\t\t\techo '<div class=\"notice notice-error notice-alt inline hidden\"><p></p></div>';\n\t\t\t\t\techo '</td>';\n\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$classes = \"$column_name column-$column_name $class\";\n\n\t\t\t\t\techo \"<td class='$classes{$extra_classes}'>\";\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Fires inside each custom column of the Plugins list table.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 3.1.0\n\t\t\t\t\t *\n\t\t\t\t\t * @param string $column_name Name of the column.\n\t\t\t\t\t * @param string $plugin_file Path to the plugin file relative to the plugins directory.\n\t\t\t\t\t * @param array  $plugin_data An array of plugin data.\n\t\t\t\t\t */\n\t\t\t\t\tdo_action( 'manage_plugins_custom_column', $column_name, $plugin_file, $plugin_data );\n\n\t\t\t\t\techo '</td>';\n\t\t\t}\n\t\t}\n\n\t\techo '</tr>';\n\n\t\t/**\n\t\t * Fires after each row in the Plugins list table.\n\t\t *\n\t\t * @since 2.3.0\n\t\t * @since 5.5.0 Added 'auto-update-enabled' and 'auto-update-disabled' to possible values for `$status`.\n\t\t *\n\t\t * @param string $plugin_file Path to the plugin file relative to the plugins directory.\n\t\t * @param array  $plugin_data An array of plugin data.\n\t\t * @param string $status      Status filter currently applied to the plugin list. Possible\n\t\t *                            values are: 'all', 'active', 'inactive', 'recently_activated',\n\t\t *                            'upgrade', 'mustuse', 'dropins', 'search', 'paused',\n\t\t *                            'auto-update-enabled', 'auto-update-disabled'.\n\t\t */\n\t\tdo_action( 'after_plugin_row', $plugin_file, $plugin_data, $status );\n\n\t\t/**\n\t\t * Fires after each specific row in the Plugins list table.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$plugin_file`, refers to the path\n\t\t * to the plugin file, relative to the plugins directory.\n\t\t *\n\t\t * @since 2.7.0\n\t\t * @since 5.5.0 Added 'auto-update-enabled' and 'auto-update-disabled' to possible values for `$status`.\n\t\t *\n\t\t * @param string $plugin_file Path to the plugin file relative to the plugins directory.\n\t\t * @param array  $plugin_data An array of plugin data.\n\t\t * @param string $status      Status filter currently applied to the plugin list. Possible\n\t\t *                            values are: 'all', 'active', 'inactive', 'recently_activated',\n\t\t *                            'upgrade', 'mustuse', 'dropins', 'search', 'paused',\n\t\t *                            'auto-update-enabled', 'auto-update-disabled'.\n\t\t */\n\t\tdo_action( \"after_plugin_row_{$plugin_file}\", $plugin_file, $plugin_data, $status );\n\t}\n\n\t/**\n\t * Gets the name of the primary column for this specific list table.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @return string Unalterable name for the primary column, in this case, 'name'.\n\t */\n\tprotected function get_primary_column_name() {\n\t\treturn 'name';\n\t}\n}\n", "num_lines": 1234}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_Post_Comments_List_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement displaying post comments in a list table.\n *\n * @since 3.1.0\n * @access private\n *\n * @see WP_Comments_List_Table\n */\nclass WP_Post_Comments_List_Table extends WP_Comments_List_Table {\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_column_info() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'author'  => __( 'Author' ),\n\t\t\t\t'comment' => _x( 'Comment', 'column name' ),\n\t\t\t),\n\t\t\tarray(),\n\t\t\tarray(),\n\t\t\t'comment',\n\t\t);\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_table_classes() {\n\t\t$classes   = parent::get_table_classes();\n\t\t$classes[] = 'wp-list-table';\n\t\t$classes[] = 'comments-box';\n\t\treturn $classes;\n\t}\n\n\t/**\n\t * @param bool $output_empty\n\t */\n\tpublic function display( $output_empty = false ) {\n\t\t$singular = $this->_args['singular'];\n\n\t\twp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );\n\t\t?>\n<table class=\"<?php echo implode( ' ', $this->get_table_classes() ); ?>\" style=\"display:none;\">\n\t<tbody id=\"the-comment-list\"\n\t\t<?php\n\t\tif ( $singular ) {\n\t\t\techo \" data-wp-lists='list:$singular'\";\n\t\t}\n\t\t?>\n\t\t>\n\t\t<?php\n\t\tif ( ! $output_empty ) {\n\t\t\t$this->display_rows_or_placeholder();\n\t\t}\n\t\t?>\n\t</tbody>\n</table>\n\t\t<?php\n\t}\n\n\t/**\n\t * @param bool $comment_status\n\t * @return int\n\t */\n\tpublic function get_per_page( $comment_status = false ) {\n\t\treturn 10;\n\t}\n}\n", "num_lines": 79}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_Posts_List_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n/**\n * Core class used to implement displaying posts in a list table.\n *\n * @since 3.1.0\n * @access private\n *\n * @see WP_List_Table\n */\nclass WP_Posts_List_Table extends WP_List_Table {\n\n\t/**\n\t * Whether the items should be displayed hierarchically or linearly.\n\t *\n\t * @since 3.1.0\n\t * @var bool\n\t */\n\tprotected $hierarchical_display;\n\n\t/**\n\t * Holds the number of pending comments for each post.\n\t *\n\t * @since 3.1.0\n\t * @var array\n\t */\n\tprotected $comment_pending_count;\n\n\t/**\n\t * Holds the number of posts for this user.\n\t *\n\t * @since 3.1.0\n\t * @var int\n\t */\n\tprivate $user_posts_count;\n\n\t/**\n\t * Holds the number of posts which are sticky.\n\t *\n\t * @since 3.1.0\n\t * @var int\n\t */\n\tprivate $sticky_posts_count = 0;\n\n\tprivate $is_trash;\n\n\t/**\n\t * Current level for output.\n\t *\n\t * @since 4.3.0\n\t * @var int\n\t */\n\tprotected $current_level = 0;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @see WP_List_Table::__construct() for more information on default arguments.\n\t *\n\t * @global WP_Post_Type $post_type_object\n\t * @global wpdb         $wpdb             WordPress database abstraction object.\n\t *\n\t * @param array $args An associative array of arguments.\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\tglobal $post_type_object, $wpdb;\n\n\t\tparent::__construct(\n\t\t\tarray(\n\t\t\t\t'plural' => 'posts',\n\t\t\t\t'screen' => isset( $args['screen'] ) ? $args['screen'] : null,\n\t\t\t)\n\t\t);\n\n\t\t$post_type        = $this->screen->post_type;\n\t\t$post_type_object = get_post_type_object( $post_type );\n\n\t\t$exclude_states         = get_post_stati(\n\t\t\tarray(\n\t\t\t\t'show_in_admin_all_list' => false,\n\t\t\t)\n\t\t);\n\t\t$this->user_posts_count = intval(\n\t\t\t$wpdb->get_var(\n\t\t\t\t$wpdb->prepare(\n\t\t\t\t\t\"\n\t\t\tSELECT COUNT( 1 )\n\t\t\tFROM $wpdb->posts\n\t\t\tWHERE post_type = %s\n\t\t\tAND post_status NOT IN ( '\" . implode( \"','\", $exclude_states ) . \"' )\n\t\t\tAND post_author = %d\n\t\t\",\n\t\t\t\t\t$post_type,\n\t\t\t\t\tget_current_user_id()\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\tif ( $this->user_posts_count && ! current_user_can( $post_type_object->cap->edit_others_posts ) && empty( $_REQUEST['post_status'] ) && empty( $_REQUEST['all_posts'] ) && empty( $_REQUEST['author'] ) && empty( $_REQUEST['show_sticky'] ) ) {\n\t\t\t$_GET['author'] = get_current_user_id();\n\t\t}\n\n\t\t$sticky_posts = get_option( 'sticky_posts' );\n\t\tif ( 'post' === $post_type && $sticky_posts ) {\n\t\t\t$sticky_posts             = implode( ', ', array_map( 'absint', (array) $sticky_posts ) );\n\t\t\t$this->sticky_posts_count = $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND post_status NOT IN ('trash', 'auto-draft') AND ID IN ($sticky_posts)\", $post_type ) );\n\t\t}\n\t}\n\n\t/**\n\t * Sets whether the table layout should be hierarchical or not.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param bool $display Whether the table layout should be hierarchical.\n\t */\n\tpublic function set_hierarchical_display( $display ) {\n\t\t$this->hierarchical_display = $display;\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function ajax_user_can() {\n\t\treturn current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_posts );\n\t}\n\n\t/**\n\t * @global string   $mode             List table view mode.\n\t * @global array    $avail_post_stati\n\t * @global WP_Query $wp_query         WordPress Query object.\n\t * @global int      $per_page\n\t */\n\tpublic function prepare_items() {\n\t\tglobal $mode, $avail_post_stati, $wp_query, $per_page;\n\n\t\tif ( ! empty( $_REQUEST['mode'] ) ) {\n\t\t\t$mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list';\n\t\t\tset_user_setting( 'posts_list_mode', $mode );\n\t\t} else {\n\t\t\t$mode = get_user_setting( 'posts_list_mode', 'list' );\n\t\t}\n\n\t\t// Is going to call wp().\n\t\t$avail_post_stati = wp_edit_posts_query();\n\n\t\t$this->set_hierarchical_display( is_post_type_hierarchical( $this->screen->post_type ) && 'menu_order title' === $wp_query->query['orderby'] );\n\n\t\t$post_type = $this->screen->post_type;\n\t\t$per_page  = $this->get_items_per_page( 'edit_' . $post_type . '_per_page' );\n\n\t\t/** This filter is documented in wp-admin/includes/post.php */\n\t\t$per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type );\n\n\t\tif ( $this->hierarchical_display ) {\n\t\t\t$total_items = $wp_query->post_count;\n\t\t} elseif ( $wp_query->found_posts || $this->get_pagenum() === 1 ) {\n\t\t\t$total_items = $wp_query->found_posts;\n\t\t} else {\n\t\t\t$post_counts = (array) wp_count_posts( $post_type, 'readable' );\n\n\t\t\tif ( isset( $_REQUEST['post_status'] ) && in_array( $_REQUEST['post_status'], $avail_post_stati, true ) ) {\n\t\t\t\t$total_items = $post_counts[ $_REQUEST['post_status'] ];\n\t\t\t} elseif ( isset( $_REQUEST['show_sticky'] ) && $_REQUEST['show_sticky'] ) {\n\t\t\t\t$total_items = $this->sticky_posts_count;\n\t\t\t} elseif ( isset( $_GET['author'] ) && get_current_user_id() == $_GET['author'] ) {\n\t\t\t\t$total_items = $this->user_posts_count;\n\t\t\t} else {\n\t\t\t\t$total_items = array_sum( $post_counts );\n\n\t\t\t\t// Subtract post types that are not included in the admin all list.\n\t\t\t\tforeach ( get_post_stati( array( 'show_in_admin_all_list' => false ) ) as $state ) {\n\t\t\t\t\t$total_items -= $post_counts[ $state ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->is_trash = isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'];\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items' => $total_items,\n\t\t\t\t'per_page'    => $per_page,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function has_items() {\n\t\treturn have_posts();\n\t}\n\n\t/**\n\t */\n\tpublic function no_items() {\n\t\tif ( isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) {\n\t\t\techo get_post_type_object( $this->screen->post_type )->labels->not_found_in_trash;\n\t\t} else {\n\t\t\techo get_post_type_object( $this->screen->post_type )->labels->not_found;\n\t\t}\n\t}\n\n\t/**\n\t * Determine if the current view is the \"All\" view.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @return bool Whether the current view is the \"All\" view.\n\t */\n\tprotected function is_base_request() {\n\t\t$vars = $_GET;\n\t\tunset( $vars['paged'] );\n\n\t\tif ( empty( $vars ) ) {\n\t\t\treturn true;\n\t\t} elseif ( 1 === count( $vars ) && ! empty( $vars['post_type'] ) ) {\n\t\t\treturn $this->screen->post_type === $vars['post_type'];\n\t\t}\n\n\t\treturn 1 === count( $vars ) && ! empty( $vars['mode'] );\n\t}\n\n\t/**\n\t * Helper to create links to edit.php with params.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string[] $args  Associative array of URL parameters for the link.\n\t * @param string   $label Link text.\n\t * @param string   $class Optional. Class attribute. Default empty string.\n\t * @return string The formatted link string.\n\t */\n\tprotected function get_edit_link( $args, $label, $class = '' ) {\n\t\t$url = add_query_arg( $args, 'edit.php' );\n\n\t\t$class_html   = '';\n\t\t$aria_current = '';\n\t\tif ( ! empty( $class ) ) {\n\t\t\t$class_html = sprintf(\n\t\t\t\t' class=\"%s\"',\n\t\t\t\tesc_attr( $class )\n\t\t\t);\n\n\t\t\tif ( 'current' === $class ) {\n\t\t\t\t$aria_current = ' aria-current=\"page\"';\n\t\t\t}\n\t\t}\n\n\t\treturn sprintf(\n\t\t\t'<a href=\"%s\"%s%s>%s</a>',\n\t\t\tesc_url( $url ),\n\t\t\t$class_html,\n\t\t\t$aria_current,\n\t\t\t$label\n\t\t);\n\t}\n\n\t/**\n\t * @global array $locked_post_status This seems to be deprecated.\n\t * @global array $avail_post_stati\n\t * @return array\n\t */\n\tprotected function get_views() {\n\t\tglobal $locked_post_status, $avail_post_stati;\n\n\t\t$post_type = $this->screen->post_type;\n\n\t\tif ( ! empty( $locked_post_status ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$status_links = array();\n\t\t$num_posts    = wp_count_posts( $post_type, 'readable' );\n\t\t$total_posts  = array_sum( (array) $num_posts );\n\t\t$class        = '';\n\n\t\t$current_user_id = get_current_user_id();\n\t\t$all_args        = array( 'post_type' => $post_type );\n\t\t$mine            = '';\n\n\t\t// Subtract post types that are not included in the admin all list.\n\t\tforeach ( get_post_stati( array( 'show_in_admin_all_list' => false ) ) as $state ) {\n\t\t\t$total_posts -= $num_posts->$state;\n\t\t}\n\n\t\tif ( $this->user_posts_count && $this->user_posts_count !== $total_posts ) {\n\t\t\tif ( isset( $_GET['author'] ) && ( $_GET['author'] == $current_user_id ) ) {\n\t\t\t\t$class = 'current';\n\t\t\t}\n\n\t\t\t$mine_args = array(\n\t\t\t\t'post_type' => $post_type,\n\t\t\t\t'author'    => $current_user_id,\n\t\t\t);\n\n\t\t\t$mine_inner_html = sprintf(\n\t\t\t\t/* translators: %s: Number of posts. */\n\t\t\t\t_nx(\n\t\t\t\t\t'Mine <span class=\"count\">(%s)</span>',\n\t\t\t\t\t'Mine <span class=\"count\">(%s)</span>',\n\t\t\t\t\t$this->user_posts_count,\n\t\t\t\t\t'posts'\n\t\t\t\t),\n\t\t\t\tnumber_format_i18n( $this->user_posts_count )\n\t\t\t);\n\n\t\t\t$mine = $this->get_edit_link( $mine_args, $mine_inner_html, $class );\n\n\t\t\t$all_args['all_posts'] = 1;\n\t\t\t$class                 = '';\n\t\t}\n\n\t\tif ( empty( $class ) && ( $this->is_base_request() || isset( $_REQUEST['all_posts'] ) ) ) {\n\t\t\t$class = 'current';\n\t\t}\n\n\t\t$all_inner_html = sprintf(\n\t\t\t/* translators: %s: Number of posts. */\n\t\t\t_nx(\n\t\t\t\t'All <span class=\"count\">(%s)</span>',\n\t\t\t\t'All <span class=\"count\">(%s)</span>',\n\t\t\t\t$total_posts,\n\t\t\t\t'posts'\n\t\t\t),\n\t\t\tnumber_format_i18n( $total_posts )\n\t\t);\n\n\t\t$status_links['all'] = $this->get_edit_link( $all_args, $all_inner_html, $class );\n\t\tif ( $mine ) {\n\t\t\t$status_links['mine'] = $mine;\n\t\t}\n\n\t\tforeach ( get_post_stati( array( 'show_in_admin_status_list' => true ), 'objects' ) as $status ) {\n\t\t\t$class = '';\n\n\t\t\t$status_name = $status->name;\n\n\t\t\tif ( ! in_array( $status_name, $avail_post_stati, true ) || empty( $num_posts->$status_name ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( isset( $_REQUEST['post_status'] ) && $status_name === $_REQUEST['post_status'] ) {\n\t\t\t\t$class = 'current';\n\t\t\t}\n\n\t\t\t$status_args = array(\n\t\t\t\t'post_status' => $status_name,\n\t\t\t\t'post_type'   => $post_type,\n\t\t\t);\n\n\t\t\t$status_label = sprintf(\n\t\t\t\ttranslate_nooped_plural( $status->label_count, $num_posts->$status_name ),\n\t\t\t\tnumber_format_i18n( $num_posts->$status_name )\n\t\t\t);\n\n\t\t\t$status_links[ $status_name ] = $this->get_edit_link( $status_args, $status_label, $class );\n\t\t}\n\n\t\tif ( ! empty( $this->sticky_posts_count ) ) {\n\t\t\t$class = ! empty( $_REQUEST['show_sticky'] ) ? 'current' : '';\n\n\t\t\t$sticky_args = array(\n\t\t\t\t'post_type'   => $post_type,\n\t\t\t\t'show_sticky' => 1,\n\t\t\t);\n\n\t\t\t$sticky_inner_html = sprintf(\n\t\t\t\t/* translators: %s: Number of posts. */\n\t\t\t\t_nx(\n\t\t\t\t\t'Sticky <span class=\"count\">(%s)</span>',\n\t\t\t\t\t'Sticky <span class=\"count\">(%s)</span>',\n\t\t\t\t\t$this->sticky_posts_count,\n\t\t\t\t\t'posts'\n\t\t\t\t),\n\t\t\t\tnumber_format_i18n( $this->sticky_posts_count )\n\t\t\t);\n\n\t\t\t$sticky_link = array(\n\t\t\t\t'sticky' => $this->get_edit_link( $sticky_args, $sticky_inner_html, $class ),\n\t\t\t);\n\n\t\t\t// Sticky comes after Publish, or if not listed, after All.\n\t\t\t$split        = 1 + array_search( ( isset( $status_links['publish'] ) ? 'publish' : 'all' ), array_keys( $status_links ), true );\n\t\t\t$status_links = array_merge( array_slice( $status_links, 0, $split ), $sticky_link, array_slice( $status_links, $split ) );\n\t\t}\n\n\t\treturn $status_links;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_bulk_actions() {\n\t\t$actions       = array();\n\t\t$post_type_obj = get_post_type_object( $this->screen->post_type );\n\n\t\tif ( current_user_can( $post_type_obj->cap->edit_posts ) ) {\n\t\t\tif ( $this->is_trash ) {\n\t\t\t\t$actions['untrash'] = __( 'Restore' );\n\t\t\t} else {\n\t\t\t\t$actions['edit'] = __( 'Edit' );\n\t\t\t}\n\t\t}\n\n\t\tif ( current_user_can( $post_type_obj->cap->delete_posts ) ) {\n\t\t\tif ( $this->is_trash || ! EMPTY_TRASH_DAYS ) {\n\t\t\t\t$actions['delete'] = __( 'Delete permanently' );\n\t\t\t} else {\n\t\t\t\t$actions['trash'] = __( 'Move to Trash' );\n\t\t\t}\n\t\t}\n\n\t\treturn $actions;\n\t}\n\n\t/**\n\t * Displays a categories drop-down for filtering on the Posts list table.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global int $cat Currently selected category.\n\t *\n\t * @param string $post_type Post type slug.\n\t */\n\tprotected function categories_dropdown( $post_type ) {\n\t\tglobal $cat;\n\n\t\t/**\n\t\t * Filters whether to remove the 'Categories' drop-down from the post list table.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param bool   $disable   Whether to disable the categories drop-down. Default false.\n\t\t * @param string $post_type Post type slug.\n\t\t */\n\t\tif ( false !== apply_filters( 'disable_categories_dropdown', false, $post_type ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( is_object_in_taxonomy( $post_type, 'category' ) ) {\n\t\t\t$dropdown_options = array(\n\t\t\t\t'show_option_all' => get_taxonomy( 'category' )->labels->all_items,\n\t\t\t\t'hide_empty'      => 0,\n\t\t\t\t'hierarchical'    => 1,\n\t\t\t\t'show_count'      => 0,\n\t\t\t\t'orderby'         => 'name',\n\t\t\t\t'selected'        => $cat,\n\t\t\t);\n\n\t\t\techo '<label class=\"screen-reader-text\" for=\"cat\">' . __( 'Filter by category' ) . '</label>';\n\t\t\twp_dropdown_categories( $dropdown_options );\n\t\t}\n\t}\n\n\t/**\n\t * Displays a formats drop-down for filtering items.\n\t *\n\t * @since 5.2.0\n\t * @access protected\n\t *\n\t * @param string $post_type Post type slug.\n\t */\n\tprotected function formats_dropdown( $post_type ) {\n\t\t/**\n\t\t * Filters whether to remove the 'Formats' drop-down from the post list table.\n\t\t *\n\t\t * @since 5.2.0\n\t\t * @since 5.5.0 The `$post_type` parameter was added.\n\t\t *\n\t\t * @param bool   $disable   Whether to disable the drop-down. Default false.\n\t\t * @param string $post_type Post type slug.\n\t\t */\n\t\tif ( apply_filters( 'disable_formats_dropdown', false, $post_type ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Return if the post type doesn't have post formats or if we're in the Trash.\n\t\tif ( ! is_object_in_taxonomy( $post_type, 'post_format' ) || $this->is_trash ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure the dropdown shows only formats with a post count greater than 0.\n\t\t$used_post_formats = get_terms(\n\t\t\tarray(\n\t\t\t\t'taxonomy'   => 'post_format',\n\t\t\t\t'hide_empty' => true,\n\t\t\t)\n\t\t);\n\n\t\t// Return if there are no posts using formats.\n\t\tif ( ! $used_post_formats ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$displayed_post_format = isset( $_GET['post_format'] ) ? $_GET['post_format'] : '';\n\t\t?>\n\t\t<label for=\"filter-by-format\" class=\"screen-reader-text\"><?php _e( 'Filter by post format' ); ?></label>\n\t\t<select name=\"post_format\" id=\"filter-by-format\">\n\t\t\t<option<?php selected( $displayed_post_format, '' ); ?> value=\"\"><?php _e( 'All formats' ); ?></option>\n\t\t\t<?php\n\t\t\tforeach ( $used_post_formats as $used_post_format ) {\n\t\t\t\t// Post format slug.\n\t\t\t\t$slug = str_replace( 'post-format-', '', $used_post_format->slug );\n\t\t\t\t// Pretty, translated version of the post format slug.\n\t\t\t\t$pretty_name = get_post_format_string( $slug );\n\t\t\t\t// Skip the standard post format.\n\t\t\t\tif ( 'standard' === $slug ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<option<?php selected( $displayed_post_format, $slug ); ?> value=\"<?php echo esc_attr( $slug ); ?>\"><?php echo esc_html( $pretty_name ); ?></option>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t</select>\n\t\t<?php\n\t}\n\n\t/**\n\t * @param string $which\n\t */\n\tprotected function extra_tablenav( $which ) {\n\t\t?>\n\t\t<div class=\"alignleft actions\">\n\t\t<?php\n\t\tif ( 'top' === $which ) {\n\t\t\tob_start();\n\n\t\t\t$this->months_dropdown( $this->screen->post_type );\n\t\t\t$this->categories_dropdown( $this->screen->post_type );\n\t\t\t$this->formats_dropdown( $this->screen->post_type );\n\n\t\t\t/**\n\t\t\t * Fires before the Filter button on the Posts and Pages list tables.\n\t\t\t *\n\t\t\t * The Filter button allows sorting by date and/or category on the\n\t\t\t * Posts list table, and sorting by date on the Pages list table.\n\t\t\t *\n\t\t\t * @since 2.1.0\n\t\t\t * @since 4.4.0 The `$post_type` parameter was added.\n\t\t\t * @since 4.6.0 The `$which` parameter was added.\n\t\t\t *\n\t\t\t * @param string $post_type The post type slug.\n\t\t\t * @param string $which     The location of the extra table nav markup:\n\t\t\t *                          'top' or 'bottom' for WP_Posts_List_Table,\n\t\t\t *                          'bar' for WP_Media_List_Table.\n\t\t\t */\n\t\t\tdo_action( 'restrict_manage_posts', $this->screen->post_type, $which );\n\n\t\t\t$output = ob_get_clean();\n\n\t\t\tif ( ! empty( $output ) ) {\n\t\t\t\techo $output;\n\t\t\t\tsubmit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) && $this->has_items() ) {\n\t\t\tsubmit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );\n\t\t}\n\t\t?>\n\t\t</div>\n\t\t<?php\n\t\t/**\n\t\t * Fires immediately following the closing \"actions\" div in the tablenav for the posts\n\t\t * list table.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string $which The location of the extra table nav markup: 'top' or 'bottom'.\n\t\t */\n\t\tdo_action( 'manage_posts_extra_tablenav', $which );\n\t}\n\n\t/**\n\t * @return string\n\t */\n\tpublic function current_action() {\n\t\tif ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) {\n\t\t\treturn 'delete_all';\n\t\t}\n\n\t\treturn parent::current_action();\n\t}\n\n\t/**\n\t * @global string $mode List table view mode.\n\t *\n\t * @return array\n\t */\n\tprotected function get_table_classes() {\n\t\tglobal $mode;\n\n\t\t$mode_class = esc_attr( 'table-view-' . $mode );\n\n\t\treturn array( 'widefat', 'fixed', 'striped', $mode_class, is_post_type_hierarchical( $this->screen->post_type ) ? 'pages' : 'posts' );\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic function get_columns() {\n\t\t$post_type = $this->screen->post_type;\n\n\t\t$posts_columns = array();\n\n\t\t$posts_columns['cb'] = '<input type=\"checkbox\" />';\n\n\t\t/* translators: Posts screen column name. */\n\t\t$posts_columns['title'] = _x( 'Title', 'column name' );\n\n\t\tif ( post_type_supports( $post_type, 'author' ) ) {\n\t\t\t$posts_columns['author'] = __( 'Author' );\n\t\t}\n\n\t\t$taxonomies = get_object_taxonomies( $post_type, 'objects' );\n\t\t$taxonomies = wp_filter_object_list( $taxonomies, array( 'show_admin_column' => true ), 'and', 'name' );\n\n\t\t/**\n\t\t * Filters the taxonomy columns in the Posts list table.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$post_type`, refers to the post\n\t\t * type slug.\n\t\t *\n\t\t * @since 3.5.0\n\t\t *\n\t\t * @param string[] $taxonomies Array of taxonomy names to show columns for.\n\t\t * @param string   $post_type  The post type.\n\t\t */\n\t\t$taxonomies = apply_filters( \"manage_taxonomies_for_{$post_type}_columns\", $taxonomies, $post_type );\n\t\t$taxonomies = array_filter( $taxonomies, 'taxonomy_exists' );\n\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\tif ( 'category' === $taxonomy ) {\n\t\t\t\t$column_key = 'categories';\n\t\t\t} elseif ( 'post_tag' === $taxonomy ) {\n\t\t\t\t$column_key = 'tags';\n\t\t\t} else {\n\t\t\t\t$column_key = 'taxonomy-' . $taxonomy;\n\t\t\t}\n\n\t\t\t$posts_columns[ $column_key ] = get_taxonomy( $taxonomy )->labels->name;\n\t\t}\n\n\t\t$post_status = ! empty( $_REQUEST['post_status'] ) ? $_REQUEST['post_status'] : 'all';\n\t\tif ( post_type_supports( $post_type, 'comments' ) && ! in_array( $post_status, array( 'pending', 'draft', 'future' ), true ) ) {\n\t\t\t$posts_columns['comments'] = '<span class=\"vers comment-grey-bubble\" title=\"' . esc_attr__( 'Comments' ) . '\"><span class=\"screen-reader-text\">' . __( 'Comments' ) . '</span></span>';\n\t\t}\n\n\t\t$posts_columns['date'] = __( 'Date' );\n\n\t\tif ( 'page' === $post_type ) {\n\n\t\t\t/**\n\t\t\t * Filters the columns displayed in the Pages list table.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t *\n\t\t\t * @param string[] $post_columns An associative array of column headings.\n\t\t\t */\n\t\t\t$posts_columns = apply_filters( 'manage_pages_columns', $posts_columns );\n\t\t} else {\n\n\t\t\t/**\n\t\t\t * Filters the columns displayed in the Posts list table.\n\t\t\t *\n\t\t\t * @since 1.5.0\n\t\t\t *\n\t\t\t * @param string[] $post_columns An associative array of column headings.\n\t\t\t * @param string   $post_type    The post type slug.\n\t\t\t */\n\t\t\t$posts_columns = apply_filters( 'manage_posts_columns', $posts_columns, $post_type );\n\t\t}\n\n\t\t/**\n\t\t * Filters the columns displayed in the Posts list table for a specific post type.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$post_type`, refers to the post type slug.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string[] $post_columns An associative array of column headings.\n\t\t */\n\t\treturn apply_filters( \"manage_{$post_type}_posts_columns\", $posts_columns );\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_sortable_columns() {\n\t\treturn array(\n\t\t\t'title'    => 'title',\n\t\t\t'parent'   => 'parent',\n\t\t\t'comments' => 'comment_count',\n\t\t\t'date'     => array( 'date', true ),\n\t\t);\n\t}\n\n\t/**\n\t * @global WP_Query $wp_query WordPress Query object.\n\t * @global int $per_page\n\t * @param array $posts\n\t * @param int   $level\n\t */\n\tpublic function display_rows( $posts = array(), $level = 0 ) {\n\t\tglobal $wp_query, $per_page;\n\n\t\tif ( empty( $posts ) ) {\n\t\t\t$posts = $wp_query->posts;\n\t\t}\n\n\t\tadd_filter( 'the_title', 'esc_html' );\n\n\t\tif ( $this->hierarchical_display ) {\n\t\t\t$this->_display_rows_hierarchical( $posts, $this->get_pagenum(), $per_page );\n\t\t} else {\n\t\t\t$this->_display_rows( $posts, $level );\n\t\t}\n\t}\n\n\t/**\n\t * @param array $posts\n\t * @param int   $level\n\t */\n\tprivate function _display_rows( $posts, $level = 0 ) {\n\t\t$post_type = $this->screen->post_type;\n\n\t\t// Create array of post IDs.\n\t\t$post_ids = array();\n\n\t\tforeach ( $posts as $a_post ) {\n\t\t\t$post_ids[] = $a_post->ID;\n\t\t}\n\n\t\tif ( post_type_supports( $post_type, 'comments' ) ) {\n\t\t\t$this->comment_pending_count = get_pending_comments_num( $post_ids );\n\t\t}\n\n\t\tforeach ( $posts as $post ) {\n\t\t\t$this->single_row( $post, $level );\n\t\t}\n\t}\n\n\t/**\n\t * @global wpdb    $wpdb WordPress database abstraction object.\n\t * @global WP_Post $post Global post object.\n\t * @param array $pages\n\t * @param int   $pagenum\n\t * @param int   $per_page\n\t */\n\tprivate function _display_rows_hierarchical( $pages, $pagenum = 1, $per_page = 20 ) {\n\t\tglobal $wpdb;\n\n\t\t$level = 0;\n\n\t\tif ( ! $pages ) {\n\t\t\t$pages = get_pages( array( 'sort_column' => 'menu_order' ) );\n\n\t\t\tif ( ! $pages ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Arrange pages into two parts: top level pages and children_pages\n\t\t * children_pages is two dimensional array, eg.\n\t\t * children_pages[10][] contains all sub-pages whose parent is 10.\n\t\t * It only takes O( N ) to arrange this and it takes O( 1 ) for subsequent lookup operations\n\t\t * If searching, ignore hierarchy and treat everything as top level\n\t\t */\n\t\tif ( empty( $_REQUEST['s'] ) ) {\n\n\t\t\t$top_level_pages = array();\n\t\t\t$children_pages  = array();\n\n\t\t\tforeach ( $pages as $page ) {\n\n\t\t\t\t// Catch and repair bad pages.\n\t\t\t\tif ( $page->post_parent == $page->ID ) {\n\t\t\t\t\t$page->post_parent = 0;\n\t\t\t\t\t$wpdb->update( $wpdb->posts, array( 'post_parent' => 0 ), array( 'ID' => $page->ID ) );\n\t\t\t\t\tclean_post_cache( $page );\n\t\t\t\t}\n\n\t\t\t\tif ( 0 == $page->post_parent ) {\n\t\t\t\t\t$top_level_pages[] = $page;\n\t\t\t\t} else {\n\t\t\t\t\t$children_pages[ $page->post_parent ][] = $page;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$pages = &$top_level_pages;\n\t\t}\n\n\t\t$count      = 0;\n\t\t$start      = ( $pagenum - 1 ) * $per_page;\n\t\t$end        = $start + $per_page;\n\t\t$to_display = array();\n\n\t\tforeach ( $pages as $page ) {\n\t\t\tif ( $count >= $end ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( $count >= $start ) {\n\t\t\t\t$to_display[ $page->ID ] = $level;\n\t\t\t}\n\n\t\t\t$count++;\n\n\t\t\tif ( isset( $children_pages ) ) {\n\t\t\t\t$this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display );\n\t\t\t}\n\t\t}\n\n\t\t// If it is the last pagenum and there are orphaned pages, display them with paging as well.\n\t\tif ( isset( $children_pages ) && $count < $end ) {\n\t\t\tforeach ( $children_pages as $orphans ) {\n\t\t\t\tforeach ( $orphans as $op ) {\n\t\t\t\t\tif ( $count >= $end ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $count >= $start ) {\n\t\t\t\t\t\t$to_display[ $op->ID ] = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$ids = array_keys( $to_display );\n\t\t_prime_post_caches( $ids );\n\n\t\tif ( ! isset( $GLOBALS['post'] ) ) {\n\t\t\t$GLOBALS['post'] = reset( $ids );\n\t\t}\n\n\t\tforeach ( $to_display as $page_id => $level ) {\n\t\t\techo \"\\t\";\n\t\t\t$this->single_row( $page_id, $level );\n\t\t}\n\t}\n\n\t/**\n\t * Given a top level page ID, display the nested hierarchy of sub-pages\n\t * together with paging support\n\t *\n\t * @since 3.1.0 (Standalone function exists since 2.6.0)\n\t * @since 4.2.0 Added the `$to_display` parameter.\n\t *\n\t * @param array $children_pages\n\t * @param int   $count\n\t * @param int   $parent\n\t * @param int   $level\n\t * @param int   $pagenum\n\t * @param int   $per_page\n\t * @param array $to_display List of pages to be displayed. Passed by reference.\n\t */\n\tprivate function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page, &$to_display ) {\n\t\tif ( ! isset( $children_pages[ $parent ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$start = ( $pagenum - 1 ) * $per_page;\n\t\t$end   = $start + $per_page;\n\n\t\tforeach ( $children_pages[ $parent ] as $page ) {\n\t\t\tif ( $count >= $end ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// If the page starts in a subtree, print the parents.\n\t\t\tif ( $count == $start && $page->post_parent > 0 ) {\n\t\t\t\t$my_parents = array();\n\t\t\t\t$my_parent  = $page->post_parent;\n\t\t\t\twhile ( $my_parent ) {\n\t\t\t\t\t// Get the ID from the list or the attribute if my_parent is an object.\n\t\t\t\t\t$parent_id = $my_parent;\n\t\t\t\t\tif ( is_object( $my_parent ) ) {\n\t\t\t\t\t\t$parent_id = $my_parent->ID;\n\t\t\t\t\t}\n\n\t\t\t\t\t$my_parent    = get_post( $parent_id );\n\t\t\t\t\t$my_parents[] = $my_parent;\n\t\t\t\t\tif ( ! $my_parent->post_parent ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$my_parent = $my_parent->post_parent;\n\t\t\t\t}\n\t\t\t\t$num_parents = count( $my_parents );\n\t\t\t\twhile ( $my_parent = array_pop( $my_parents ) ) {\n\t\t\t\t\t$to_display[ $my_parent->ID ] = $level - $num_parents;\n\t\t\t\t\t$num_parents--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $count >= $start ) {\n\t\t\t\t$to_display[ $page->ID ] = $level;\n\t\t\t}\n\n\t\t\t$count++;\n\n\t\t\t$this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display );\n\t\t}\n\n\t\tunset( $children_pages[ $parent ] ); // Required in order to keep track of orphans.\n\t}\n\n\t/**\n\t * Handles the checkbox column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Post $post The current WP_Post object.\n\t */\n\tpublic function column_cb( $post ) {\n\t\tif ( current_user_can( 'edit_post', $post->ID ) ) :\n\t\t\t?>\n\t\t\t<label class=\"screen-reader-text\" for=\"cb-select-<?php the_ID(); ?>\">\n\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\tprintf( __( 'Select %s' ), _draft_or_post_title() );\n\t\t\t\t?>\n\t\t\t</label>\n\t\t\t<input id=\"cb-select-<?php the_ID(); ?>\" type=\"checkbox\" name=\"post[]\" value=\"<?php the_ID(); ?>\" />\n\t\t\t<div class=\"locked-indicator\">\n\t\t\t\t<span class=\"locked-indicator-icon\" aria-hidden=\"true\"></span>\n\t\t\t\t<span class=\"screen-reader-text\">\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\t__( '&#8220;%s&#8221; is locked' ),\n\t\t\t\t\t_draft_or_post_title()\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<?php\n\t\tendif;\n\t}\n\n\t/**\n\t * @since 4.3.0\n\t *\n\t * @param WP_Post $post\n\t * @param string  $classes\n\t * @param string  $data\n\t * @param string  $primary\n\t */\n\tprotected function _column_title( $post, $classes, $data, $primary ) {\n\t\techo '<td class=\"' . $classes . ' page-title\" ', $data, '>';\n\t\techo $this->column_title( $post );\n\t\techo $this->handle_row_actions( $post, 'title', $primary );\n\t\techo '</td>';\n\t}\n\n\t/**\n\t * Handles the title column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @global string $mode List table view mode.\n\t *\n\t * @param WP_Post $post The current WP_Post object.\n\t */\n\tpublic function column_title( $post ) {\n\t\tglobal $mode;\n\n\t\tif ( $this->hierarchical_display ) {\n\t\t\tif ( 0 === $this->current_level && (int) $post->post_parent > 0 ) {\n\t\t\t\t// Sent level 0 by accident, by default, or because we don't know the actual level.\n\t\t\t\t$find_main_page = (int) $post->post_parent;\n\t\t\t\twhile ( $find_main_page > 0 ) {\n\t\t\t\t\t$parent = get_post( $find_main_page );\n\n\t\t\t\t\tif ( is_null( $parent ) ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->current_level++;\n\t\t\t\t\t$find_main_page = (int) $parent->post_parent;\n\n\t\t\t\t\tif ( ! isset( $parent_name ) ) {\n\t\t\t\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t\t\t\t$parent_name = apply_filters( 'the_title', $parent->post_title, $parent->ID );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$can_edit_post = current_user_can( 'edit_post', $post->ID );\n\n\t\tif ( $can_edit_post && 'trash' !== $post->post_status ) {\n\t\t\t$lock_holder = wp_check_post_lock( $post->ID );\n\n\t\t\tif ( $lock_holder ) {\n\t\t\t\t$lock_holder   = get_userdata( $lock_holder );\n\t\t\t\t$locked_avatar = get_avatar( $lock_holder->ID, 18 );\n\t\t\t\t/* translators: %s: User's display name. */\n\t\t\t\t$locked_text = esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) );\n\t\t\t} else {\n\t\t\t\t$locked_avatar = '';\n\t\t\t\t$locked_text   = '';\n\t\t\t}\n\n\t\t\techo '<div class=\"locked-info\"><span class=\"locked-avatar\">' . $locked_avatar . '</span> <span class=\"locked-text\">' . $locked_text . \"</span></div>\\n\";\n\t\t}\n\n\t\t$pad = str_repeat( '&#8212; ', $this->current_level );\n\t\techo '<strong>';\n\n\t\t$title = _draft_or_post_title();\n\n\t\tif ( $can_edit_post && 'trash' !== $post->post_status ) {\n\t\t\tprintf(\n\t\t\t\t'<a class=\"row-title\" href=\"%s\" aria-label=\"%s\">%s%s</a>',\n\t\t\t\tget_edit_post_link( $post->ID ),\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\tesc_attr( sprintf( __( '&#8220;%s&#8221; (Edit)' ), $title ) ),\n\t\t\t\t$pad,\n\t\t\t\t$title\n\t\t\t);\n\t\t} else {\n\t\t\tprintf(\n\t\t\t\t'<span>%s%s</span>',\n\t\t\t\t$pad,\n\t\t\t\t$title\n\t\t\t);\n\t\t}\n\t\t_post_states( $post );\n\n\t\tif ( isset( $parent_name ) ) {\n\t\t\t$post_type_object = get_post_type_object( $post->post_type );\n\t\t\techo ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name );\n\t\t}\n\t\techo \"</strong>\\n\";\n\n\t\tif ( 'excerpt' === $mode\n\t\t\t&& ! is_post_type_hierarchical( $this->screen->post_type )\n\t\t\t&& current_user_can( 'read_post', $post->ID )\n\t\t) {\n\t\t\tif ( post_password_required( $post ) ) {\n\t\t\t\techo '<span class=\"protected-post-excerpt\">' . esc_html( get_the_excerpt() ) . '</span>';\n\t\t\t} else {\n\t\t\t\techo esc_html( get_the_excerpt() );\n\t\t\t}\n\t\t}\n\n\t\tget_inline_data( $post );\n\t}\n\n\t/**\n\t * Handles the post date column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @global string $mode List table view mode.\n\t *\n\t * @param WP_Post $post The current WP_Post object.\n\t */\n\tpublic function column_date( $post ) {\n\t\tglobal $mode;\n\n\t\tif ( '0000-00-00 00:00:00' === $post->post_date ) {\n\t\t\t$t_time    = __( 'Unpublished' );\n\t\t\t$time_diff = 0;\n\t\t} else {\n\t\t\t$t_time = sprintf(\n\t\t\t\t/* translators: 1: Post date, 2: Post time. */\n\t\t\t\t__( '%1$s at %2$s' ),\n\t\t\t\t/* translators: Post date format. See https://www.php.net/date */\n\t\t\t\tget_the_time( __( 'Y/m/d' ), $post ),\n\t\t\t\t/* translators: Post time format. See https://www.php.net/date */\n\t\t\t\tget_the_time( __( 'g:i a' ), $post )\n\t\t\t);\n\n\t\t\t$time      = get_post_timestamp( $post );\n\t\t\t$time_diff = time() - $time;\n\t\t}\n\n\t\tif ( 'publish' === $post->post_status ) {\n\t\t\t$status = __( 'Published' );\n\t\t} elseif ( 'future' === $post->post_status ) {\n\t\t\tif ( $time_diff > 0 ) {\n\t\t\t\t$status = '<strong class=\"error-message\">' . __( 'Missed schedule' ) . '</strong>';\n\t\t\t} else {\n\t\t\t\t$status = __( 'Scheduled' );\n\t\t\t}\n\t\t} else {\n\t\t\t$status = __( 'Last Modified' );\n\t\t}\n\n\t\t/**\n\t\t * Filters the status text of the post.\n\t\t *\n\t\t * @since 4.8.0\n\t\t *\n\t\t * @param string  $status      The status text.\n\t\t * @param WP_Post $post        Post object.\n\t\t * @param string  $column_name The column name.\n\t\t * @param string  $mode        The list display mode ('excerpt' or 'list').\n\t\t */\n\t\t$status = apply_filters( 'post_date_column_status', $status, $post, 'date', $mode );\n\n\t\tif ( $status ) {\n\t\t\techo $status . '<br />';\n\t\t}\n\n\t\t/**\n\t\t * Filters the published time of the post.\n\t\t *\n\t\t * @since 2.5.1\n\t\t * @since 5.5.0 Removed the difference between 'excerpt' and 'list' modes.\n\t\t *              The published time and date are both displayed now,\n\t\t *              which is equivalent to the previous 'excerpt' mode.\n\t\t *\n\t\t * @param string  $t_time      The published time.\n\t\t * @param WP_Post $post        Post object.\n\t\t * @param string  $column_name The column name.\n\t\t * @param string  $mode        The list display mode ('excerpt' or 'list').\n\t\t */\n\t\techo apply_filters( 'post_date_column_time', $t_time, $post, 'date', $mode );\n\t}\n\n\t/**\n\t * Handles the comments column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Post $post The current WP_Post object.\n\t */\n\tpublic function column_comments( $post ) {\n\t\t?>\n\t\t<div class=\"post-com-count-wrapper\">\n\t\t<?php\n\t\t\t$pending_comments = isset( $this->comment_pending_count[ $post->ID ] ) ? $this->comment_pending_count[ $post->ID ] : 0;\n\n\t\t\t$this->comments_bubble( $post->ID, $pending_comments );\n\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Handles the post author column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Post $post The current WP_Post object.\n\t */\n\tpublic function column_author( $post ) {\n\t\t$args = array(\n\t\t\t'post_type' => $post->post_type,\n\t\t\t'author'    => get_the_author_meta( 'ID' ),\n\t\t);\n\t\techo $this->get_edit_link( $args, get_the_author() );\n\t}\n\n\t/**\n\t * Handles the default column output.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Post $post        The current WP_Post object.\n\t * @param string  $column_name The current column name.\n\t */\n\tpublic function column_default( $post, $column_name ) {\n\t\tif ( 'categories' === $column_name ) {\n\t\t\t$taxonomy = 'category';\n\t\t} elseif ( 'tags' === $column_name ) {\n\t\t\t$taxonomy = 'post_tag';\n\t\t} elseif ( 0 === strpos( $column_name, 'taxonomy-' ) ) {\n\t\t\t$taxonomy = substr( $column_name, 9 );\n\t\t} else {\n\t\t\t$taxonomy = false;\n\t\t}\n\t\tif ( $taxonomy ) {\n\t\t\t$taxonomy_object = get_taxonomy( $taxonomy );\n\t\t\t$terms           = get_the_terms( $post->ID, $taxonomy );\n\t\t\tif ( is_array( $terms ) ) {\n\t\t\t\t$term_links = array();\n\t\t\t\tforeach ( $terms as $t ) {\n\t\t\t\t\t$posts_in_term_qv = array();\n\t\t\t\t\tif ( 'post' !== $post->post_type ) {\n\t\t\t\t\t\t$posts_in_term_qv['post_type'] = $post->post_type;\n\t\t\t\t\t}\n\t\t\t\t\tif ( $taxonomy_object->query_var ) {\n\t\t\t\t\t\t$posts_in_term_qv[ $taxonomy_object->query_var ] = $t->slug;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$posts_in_term_qv['taxonomy'] = $taxonomy;\n\t\t\t\t\t\t$posts_in_term_qv['term']     = $t->slug;\n\t\t\t\t\t}\n\n\t\t\t\t\t$label = esc_html( sanitize_term_field( 'name', $t->name, $t->term_id, $taxonomy, 'display' ) );\n\n\t\t\t\t\t$term_links[] = $this->get_edit_link( $posts_in_term_qv, $label );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Filters the links in `$taxonomy` column of edit.php.\n\t\t\t\t *\n\t\t\t\t * @since 5.2.0\n\t\t\t\t *\n\t\t\t\t * @param string[]  $term_links Array of term editing links.\n\t\t\t\t * @param string    $taxonomy   Taxonomy name.\n\t\t\t\t * @param WP_Term[] $terms      Array of term objects appearing in the post row.\n\t\t\t\t */\n\t\t\t\t$term_links = apply_filters( 'post_column_taxonomy_links', $term_links, $taxonomy, $terms );\n\n\t\t\t\t/* translators: Used between list items, there is a space after the comma. */\n\t\t\t\techo join( __( ', ' ), $term_links );\n\t\t\t} else {\n\t\t\t\techo '<span aria-hidden=\"true\">&#8212;</span><span class=\"screen-reader-text\">' . $taxonomy_object->labels->no_terms . '</span>';\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif ( is_post_type_hierarchical( $post->post_type ) ) {\n\n\t\t\t/**\n\t\t\t * Fires in each custom column on the Posts list table.\n\t\t\t *\n\t\t\t * This hook only fires if the current post type is hierarchical,\n\t\t\t * such as pages.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t *\n\t\t\t * @param string $column_name The name of the column to display.\n\t\t\t * @param int    $post_id     The current post ID.\n\t\t\t */\n\t\t\tdo_action( 'manage_pages_custom_column', $column_name, $post->ID );\n\t\t} else {\n\n\t\t\t/**\n\t\t\t * Fires in each custom column in the Posts list table.\n\t\t\t *\n\t\t\t * This hook only fires if the current post type is non-hierarchical,\n\t\t\t * such as posts.\n\t\t\t *\n\t\t\t * @since 1.5.0\n\t\t\t *\n\t\t\t * @param string $column_name The name of the column to display.\n\t\t\t * @param int    $post_id     The current post ID.\n\t\t\t */\n\t\t\tdo_action( 'manage_posts_custom_column', $column_name, $post->ID );\n\t\t}\n\n\t\t/**\n\t\t * Fires for each custom column of a specific post type in the Posts list table.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$post->post_type`, refers to the post type.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string $column_name The name of the column to display.\n\t\t * @param int    $post_id     The current post ID.\n\t\t */\n\t\tdo_action( \"manage_{$post->post_type}_posts_custom_column\", $column_name, $post->ID );\n\t}\n\n\t/**\n\t * @global WP_Post $post Global post object.\n\t *\n\t * @param int|WP_Post $post\n\t * @param int         $level\n\t */\n\tpublic function single_row( $post, $level = 0 ) {\n\t\t$global_post = get_post();\n\n\t\t$post                = get_post( $post );\n\t\t$this->current_level = $level;\n\n\t\t$GLOBALS['post'] = $post;\n\t\tsetup_postdata( $post );\n\n\t\t$classes = 'iedit author-' . ( get_current_user_id() == $post->post_author ? 'self' : 'other' );\n\n\t\t$lock_holder = wp_check_post_lock( $post->ID );\n\t\tif ( $lock_holder ) {\n\t\t\t$classes .= ' wp-locked';\n\t\t}\n\n\t\tif ( $post->post_parent ) {\n\t\t\t$count    = count( get_post_ancestors( $post->ID ) );\n\t\t\t$classes .= ' level-' . $count;\n\t\t} else {\n\t\t\t$classes .= ' level-0';\n\t\t}\n\t\t?>\n\t\t<tr id=\"post-<?php echo $post->ID; ?>\" class=\"<?php echo implode( ' ', get_post_class( $classes, $post->ID ) ); ?>\">\n\t\t\t<?php $this->single_row_columns( $post ); ?>\n\t\t</tr>\n\t\t<?php\n\t\t$GLOBALS['post'] = $global_post;\n\t}\n\n\t/**\n\t * Gets the name of the default primary column.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @return string Name of the default primary column, in this case, 'title'.\n\t */\n\tprotected function get_default_primary_column_name() {\n\t\treturn 'title';\n\t}\n\n\t/**\n\t * Generates and displays row action links.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param object $post        Post being acted upon.\n\t * @param string $column_name Current column name.\n\t * @param string $primary     Primary column name.\n\t * @return string Row actions output for posts, or an empty string\n\t *                if the current column is not the primary column.\n\t */\n\tprotected function handle_row_actions( $post, $column_name, $primary ) {\n\t\tif ( $primary !== $column_name ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$post_type_object = get_post_type_object( $post->post_type );\n\t\t$can_edit_post    = current_user_can( 'edit_post', $post->ID );\n\t\t$actions          = array();\n\t\t$title            = _draft_or_post_title();\n\n\t\tif ( $can_edit_post && 'trash' !== $post->post_status ) {\n\t\t\t$actions['edit'] = sprintf(\n\t\t\t\t'<a href=\"%s\" aria-label=\"%s\">%s</a>',\n\t\t\t\tget_edit_post_link( $post->ID ),\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\tesc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ),\n\t\t\t\t__( 'Edit' )\n\t\t\t);\n\n\t\t\tif ( 'wp_block' !== $post->post_type ) {\n\t\t\t\t$actions['inline hide-if-no-js'] = sprintf(\n\t\t\t\t\t'<button type=\"button\" class=\"button-link editinline\" aria-label=\"%s\" aria-expanded=\"false\">%s</button>',\n\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\tesc_attr( sprintf( __( 'Quick edit &#8220;%s&#8221; inline' ), $title ) ),\n\t\t\t\t\t__( 'Quick&nbsp;Edit' )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( current_user_can( 'delete_post', $post->ID ) ) {\n\t\t\tif ( 'trash' === $post->post_status ) {\n\t\t\t\t$actions['untrash'] = sprintf(\n\t\t\t\t\t'<a href=\"%s\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\twp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ),\n\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\tesc_attr( sprintf( __( 'Restore &#8220;%s&#8221; from the Trash' ), $title ) ),\n\t\t\t\t\t__( 'Restore' )\n\t\t\t\t);\n\t\t\t} elseif ( EMPTY_TRASH_DAYS ) {\n\t\t\t\t$actions['trash'] = sprintf(\n\t\t\t\t\t'<a href=\"%s\" class=\"submitdelete\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\tget_delete_post_link( $post->ID ),\n\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\tesc_attr( sprintf( __( 'Move &#8220;%s&#8221; to the Trash' ), $title ) ),\n\t\t\t\t\t_x( 'Trash', 'verb' )\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ( 'trash' === $post->post_status || ! EMPTY_TRASH_DAYS ) {\n\t\t\t\t$actions['delete'] = sprintf(\n\t\t\t\t\t'<a href=\"%s\" class=\"submitdelete\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\tget_delete_post_link( $post->ID, '', true ),\n\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\tesc_attr( sprintf( __( 'Delete &#8220;%s&#8221; permanently' ), $title ) ),\n\t\t\t\t\t__( 'Delete Permanently' )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( is_post_type_viewable( $post_type_object ) ) {\n\t\t\tif ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ), true ) ) {\n\t\t\t\tif ( $can_edit_post ) {\n\t\t\t\t\t$preview_link    = get_preview_post_link( $post );\n\t\t\t\t\t$actions['view'] = sprintf(\n\t\t\t\t\t\t'<a href=\"%s\" rel=\"bookmark\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t\tesc_url( $preview_link ),\n\t\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\t\tesc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ),\n\t\t\t\t\t\t__( 'Preview' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} elseif ( 'trash' !== $post->post_status ) {\n\t\t\t\t$actions['view'] = sprintf(\n\t\t\t\t\t'<a href=\"%s\" rel=\"bookmark\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\tget_permalink( $post->ID ),\n\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\tesc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $title ) ),\n\t\t\t\t\t__( 'View' )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( 'wp_block' === $post->post_type ) {\n\t\t\t$actions['export'] = sprintf(\n\t\t\t\t'<button type=\"button\" class=\"wp-list-reusable-blocks__export button-link\" data-id=\"%s\" aria-label=\"%s\">%s</button>',\n\t\t\t\t$post->ID,\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\tesc_attr( sprintf( __( 'Export &#8220;%s&#8221; as JSON' ), $title ) ),\n\t\t\t\t__( 'Export as JSON' )\n\t\t\t);\n\t\t}\n\n\t\tif ( is_post_type_hierarchical( $post->post_type ) ) {\n\n\t\t\t/**\n\t\t\t * Filters the array of row action links on the Pages list table.\n\t\t\t *\n\t\t\t * The filter is evaluated only for hierarchical post types.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t *\n\t\t\t * @param string[] $actions An array of row action links. Defaults are\n\t\t\t *                          'Edit', 'Quick Edit', 'Restore', 'Trash',\n\t\t\t *                          'Delete Permanently', 'Preview', and 'View'.\n\t\t\t * @param WP_Post  $post    The post object.\n\t\t\t */\n\t\t\t$actions = apply_filters( 'page_row_actions', $actions, $post );\n\t\t} else {\n\n\t\t\t/**\n\t\t\t * Filters the array of row action links on the Posts list table.\n\t\t\t *\n\t\t\t * The filter is evaluated only for non-hierarchical post types.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t *\n\t\t\t * @param string[] $actions An array of row action links. Defaults are\n\t\t\t *                          'Edit', 'Quick Edit', 'Restore', 'Trash',\n\t\t\t *                          'Delete Permanently', 'Preview', and 'View'.\n\t\t\t * @param WP_Post  $post    The post object.\n\t\t\t */\n\t\t\t$actions = apply_filters( 'post_row_actions', $actions, $post );\n\t\t}\n\n\t\treturn $this->row_actions( $actions );\n\t}\n\n\t/**\n\t * Outputs the hidden row displayed when inline editing\n\t *\n\t * @since 3.1.0\n\t *\n\t * @global string $mode List table view mode.\n\t */\n\tpublic function inline_edit() {\n\t\tglobal $mode;\n\n\t\t$screen = $this->screen;\n\n\t\t$post             = get_default_post_to_edit( $screen->post_type );\n\t\t$post_type_object = get_post_type_object( $screen->post_type );\n\n\t\t$taxonomy_names          = get_object_taxonomies( $screen->post_type );\n\t\t$hierarchical_taxonomies = array();\n\t\t$flat_taxonomies         = array();\n\n\t\tforeach ( $taxonomy_names as $taxonomy_name ) {\n\n\t\t\t$taxonomy = get_taxonomy( $taxonomy_name );\n\n\t\t\t$show_in_quick_edit = $taxonomy->show_in_quick_edit;\n\n\t\t\t/**\n\t\t\t * Filters whether the current taxonomy should be shown in the Quick Edit panel.\n\t\t\t *\n\t\t\t * @since 4.2.0\n\t\t\t *\n\t\t\t * @param bool   $show_in_quick_edit Whether to show the current taxonomy in Quick Edit.\n\t\t\t * @param string $taxonomy_name      Taxonomy name.\n\t\t\t * @param string $post_type          Post type of current Quick Edit post.\n\t\t\t */\n\t\t\tif ( ! apply_filters( 'quick_edit_show_taxonomy', $show_in_quick_edit, $taxonomy_name, $screen->post_type ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $taxonomy->hierarchical ) {\n\t\t\t\t$hierarchical_taxonomies[] = $taxonomy;\n\t\t\t} else {\n\t\t\t\t$flat_taxonomies[] = $taxonomy;\n\t\t\t}\n\t\t}\n\n\t\t$m            = ( isset( $mode ) && 'excerpt' === $mode ) ? 'excerpt' : 'list';\n\t\t$can_publish  = current_user_can( $post_type_object->cap->publish_posts );\n\t\t$core_columns = array(\n\t\t\t'cb'         => true,\n\t\t\t'date'       => true,\n\t\t\t'title'      => true,\n\t\t\t'categories' => true,\n\t\t\t'tags'       => true,\n\t\t\t'comments'   => true,\n\t\t\t'author'     => true,\n\t\t);\n\n\t\t?>\n\n\t\t<form method=\"get\">\n\t\t<table style=\"display: none\"><tbody id=\"inlineedit\">\n\t\t<?php\n\t\t$hclass              = count( $hierarchical_taxonomies ) ? 'post' : 'page';\n\t\t$inline_edit_classes = \"inline-edit-row inline-edit-row-$hclass\";\n\t\t$bulk_edit_classes   = \"bulk-edit-row bulk-edit-row-$hclass bulk-edit-{$screen->post_type}\";\n\t\t$quick_edit_classes  = \"quick-edit-row quick-edit-row-$hclass inline-edit-{$screen->post_type}\";\n\n\t\t$bulk = 0;\n\t\twhile ( $bulk < 2 ) :\n\t\t\t$classes  = $inline_edit_classes . ' ';\n\t\t\t$classes .= $bulk ? $bulk_edit_classes : $quick_edit_classes;\n\t\t\t?>\n\t\t\t<tr id=\"<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>\" class=\"<?php echo $classes; ?>\" style=\"display: none\">\n\t\t\t<td colspan=\"<?php echo $this->get_column_count(); ?>\" class=\"colspanchange\">\n\n\t\t\t<fieldset class=\"inline-edit-col-left\">\n\t\t\t\t<legend class=\"inline-edit-legend\"><?php echo $bulk ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?></legend>\n\t\t\t\t<div class=\"inline-edit-col\">\n\n\t\t\t\t<?php if ( post_type_supports( $screen->post_type, 'title' ) ) : ?>\n\n\t\t\t\t\t<?php if ( $bulk ) : ?>\n\n\t\t\t\t\t\t<div id=\"bulk-title-div\">\n\t\t\t\t\t\t\t<div id=\"bulk-titles\"></div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t<?php else : // $bulk ?>\n\n\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t<span class=\"title\"><?php _e( 'Title' ); ?></span>\n\t\t\t\t\t\t\t<span class=\"input-text-wrap\"><input type=\"text\" name=\"post_title\" class=\"ptitle\" value=\"\" /></span>\n\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t<?php if ( is_post_type_viewable( $screen->post_type ) ) : ?>\n\n\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t<span class=\"title\"><?php _e( 'Slug' ); ?></span>\n\t\t\t\t\t\t\t\t<span class=\"input-text-wrap\"><input type=\"text\" name=\"post_name\" value=\"\" /></span>\n\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t<?php endif; // is_post_type_viewable() ?>\n\n\t\t\t\t\t<?php endif; // $bulk ?>\n\n\t\t\t\t<?php endif; // post_type_supports( ... 'title' ) ?>\n\n\t\t\t\t<?php if ( ! $bulk ) : ?>\n\t\t\t\t\t<fieldset class=\"inline-edit-date\">\n\t\t\t\t\t\t<legend><span class=\"title\"><?php _e( 'Date' ); ?></span></legend>\n\t\t\t\t\t\t<?php touch_time( 1, 1, 0, 1 ); ?>\n\t\t\t\t\t</fieldset>\n\t\t\t\t\t<br class=\"clear\" />\n\t\t\t\t<?php endif; // $bulk ?>\n\n\t\t\t\t<?php\n\t\t\t\tif ( post_type_supports( $screen->post_type, 'author' ) ) :\n\t\t\t\t\t$authors_dropdown = '';\n\n\t\t\t\t\tif ( current_user_can( $post_type_object->cap->edit_others_posts ) ) :\n\t\t\t\t\t\t$users_opt = array(\n\t\t\t\t\t\t\t'hide_if_only_one_author' => false,\n\t\t\t\t\t\t\t'who'                     => 'authors',\n\t\t\t\t\t\t\t'name'                    => 'post_author',\n\t\t\t\t\t\t\t'class'                   => 'authors',\n\t\t\t\t\t\t\t'multi'                   => 1,\n\t\t\t\t\t\t\t'echo'                    => 0,\n\t\t\t\t\t\t\t'show'                    => 'display_name_with_login',\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( $bulk ) {\n\t\t\t\t\t\t\t$users_opt['show_option_none'] = __( '&mdash; No Change &mdash;' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$authors = wp_dropdown_users( $users_opt );\n\t\t\t\t\t\tif ( $authors ) :\n\t\t\t\t\t\t\t$authors_dropdown  = '<label class=\"inline-edit-author\">';\n\t\t\t\t\t\t\t$authors_dropdown .= '<span class=\"title\">' . __( 'Author' ) . '</span>';\n\t\t\t\t\t\t\t$authors_dropdown .= $authors;\n\t\t\t\t\t\t\t$authors_dropdown .= '</label>';\n\t\t\t\t\t\tendif;\n\t\t\t\t\tendif; // current_user_can( 'edit_others_posts' )\n\t\t\t\t\t?>\n\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( ! $bulk ) {\n\t\t\t\t\t\techo $authors_dropdown;\n\t\t\t\t\t}\n\t\t\t\tendif; // post_type_supports( ... 'author' )\n\t\t\t\t?>\n\n\t\t\t\t<?php if ( ! $bulk && $can_publish ) : ?>\n\n\t\t\t\t\t<div class=\"inline-edit-group wp-clearfix\">\n\t\t\t\t\t\t<label class=\"alignleft\">\n\t\t\t\t\t\t\t<span class=\"title\"><?php _e( 'Password' ); ?></span>\n\t\t\t\t\t\t\t<span class=\"input-text-wrap\"><input type=\"text\" name=\"post_password\" class=\"inline-edit-password-input\" value=\"\" /></span>\n\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t<span class=\"alignleft inline-edit-or\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/* translators: Between password field and private checkbox on post quick edit interface. */\n\t\t\t\t\t\t\t_e( '&ndash;OR&ndash;' );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<label class=\"alignleft inline-edit-private\">\n\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"keep_private\" value=\"private\" />\n\t\t\t\t\t\t\t<span class=\"checkbox-title\"><?php _e( 'Private' ); ?></span>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\n\t\t\t<?php if ( count( $hierarchical_taxonomies ) && ! $bulk ) : ?>\n\n\t\t\t\t<fieldset class=\"inline-edit-col-center inline-edit-categories\">\n\t\t\t\t\t<div class=\"inline-edit-col\">\n\n\t\t\t\t\t<?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?>\n\n\t\t\t\t\t\t<span class=\"title inline-edit-categories-label\"><?php echo esc_html( $taxonomy->labels->name ); ?></span>\n\t\t\t\t\t\t<input type=\"hidden\" name=\"<?php echo ( 'category' === $taxonomy->name ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>\" value=\"0\" />\n\t\t\t\t\t\t<ul class=\"cat-checklist <?php echo esc_attr( $taxonomy->name ); ?>-checklist\">\n\t\t\t\t\t\t\t<?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ); ?>\n\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t<?php endforeach; // $hierarchical_taxonomies as $taxonomy ?>\n\n\t\t\t\t\t</div>\n\t\t\t\t</fieldset>\n\n\t\t\t<?php endif; // count( $hierarchical_taxonomies ) && ! $bulk ?>\n\n\t\t\t<fieldset class=\"inline-edit-col-right\">\n\t\t\t\t<div class=\"inline-edit-col\">\n\n\t\t\t\t<?php\n\t\t\t\tif ( post_type_supports( $screen->post_type, 'author' ) && $bulk ) {\n\t\t\t\t\techo $authors_dropdown;\n\t\t\t\t}\n\t\t\t\t?>\n\n\t\t\t\t<?php if ( post_type_supports( $screen->post_type, 'page-attributes' ) ) : ?>\n\n\t\t\t\t\t<?php if ( $post_type_object->hierarchical ) : ?>\n\n\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t<span class=\"title\"><?php _e( 'Parent' ); ?></span>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$dropdown_args = array(\n\t\t\t\t\t\t\t\t'post_type'         => $post_type_object->name,\n\t\t\t\t\t\t\t\t'selected'          => $post->post_parent,\n\t\t\t\t\t\t\t\t'name'              => 'post_parent',\n\t\t\t\t\t\t\t\t'show_option_none'  => __( 'Main Page (no parent)' ),\n\t\t\t\t\t\t\t\t'option_none_value' => 0,\n\t\t\t\t\t\t\t\t'sort_column'       => 'menu_order, post_title',\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( $bulk ) {\n\t\t\t\t\t\t\t\t$dropdown_args['show_option_no_change'] = __( '&mdash; No Change &mdash;' );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Filters the arguments used to generate the Quick Edit page-parent drop-down.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @since 2.7.0\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @see wp_dropdown_pages()\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @param array $dropdown_args An array of arguments.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t$dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args );\n\n\t\t\t\t\t\t\twp_dropdown_pages( $dropdown_args );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</label>\n\n\t\t\t\t\t<?php endif; // hierarchical ?>\n\n\t\t\t\t\t<?php if ( ! $bulk ) : ?>\n\n\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t<span class=\"title\"><?php _e( 'Order' ); ?></span>\n\t\t\t\t\t\t\t<span class=\"input-text-wrap\"><input type=\"text\" name=\"menu_order\" class=\"inline-edit-menu-order-input\" value=\"<?php echo $post->menu_order; ?>\" /></span>\n\t\t\t\t\t\t</label>\n\n\t\t\t\t\t<?php endif; // ! $bulk ?>\n\n\t\t\t\t<?php endif; // post_type_supports( ... 'page-attributes' ) ?>\n\n\t\t\t\t<?php if ( 0 < count( get_page_templates( null, $screen->post_type ) ) ) : ?>\n\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<span class=\"title\"><?php _e( 'Template' ); ?></span>\n\t\t\t\t\t\t<select name=\"page_template\">\n\t\t\t\t\t\t\t<?php if ( $bulk ) : ?>\n\t\t\t\t\t\t\t<option value=\"-1\"><?php _e( '&mdash; No Change &mdash;' ); ?></option>\n\t\t\t\t\t\t\t<?php endif; // $bulk ?>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/** This filter is documented in wp-admin/includes/meta-boxes.php */\n\t\t\t\t\t\t\t$default_title = apply_filters( 'default_page_template_title', __( 'Default template' ), 'quick-edit' );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<option value=\"default\"><?php echo esc_html( $default_title ); ?></option>\n\t\t\t\t\t\t\t<?php page_template_dropdown( '', $screen->post_type ); ?>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</label>\n\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\t<?php if ( count( $flat_taxonomies ) && ! $bulk ) : ?>\n\n\t\t\t\t\t<?php foreach ( $flat_taxonomies as $taxonomy ) : ?>\n\n\t\t\t\t\t\t<?php if ( current_user_can( $taxonomy->cap->assign_terms ) ) : ?>\n\t\t\t\t\t\t\t<?php $taxonomy_name = esc_attr( $taxonomy->name ); ?>\n\n\t\t\t\t\t\t\t<label class=\"inline-edit-tags\">\n\t\t\t\t\t\t\t\t<span class=\"title\"><?php echo esc_html( $taxonomy->labels->name ); ?></span>\n\t\t\t\t\t\t\t\t<textarea data-wp-taxonomy=\"<?php echo $taxonomy_name; ?>\" cols=\"22\" rows=\"1\" name=\"tax_input[<?php echo $taxonomy_name; ?>]\" class=\"tax_input_<?php echo $taxonomy_name; ?>\"></textarea>\n\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t<?php endif; // current_user_can( 'assign_terms' ) ?>\n\n\t\t\t\t\t<?php endforeach; // $flat_taxonomies as $taxonomy ?>\n\n\t\t\t\t<?php endif; // count( $flat_taxonomies ) && ! $bulk ?>\n\n\t\t\t\t<?php if ( post_type_supports( $screen->post_type, 'comments' ) || post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>\n\n\t\t\t\t\t<?php if ( $bulk ) : ?>\n\n\t\t\t\t\t\t<div class=\"inline-edit-group wp-clearfix\">\n\n\t\t\t\t\t\t<?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>\n\n\t\t\t\t\t\t\t<label class=\"alignleft\">\n\t\t\t\t\t\t\t\t<span class=\"title\"><?php _e( 'Comments' ); ?></span>\n\t\t\t\t\t\t\t\t<select name=\"comment_status\">\n\t\t\t\t\t\t\t\t\t<option value=\"\"><?php _e( '&mdash; No Change &mdash;' ); ?></option>\n\t\t\t\t\t\t\t\t\t<option value=\"open\"><?php _e( 'Allow' ); ?></option>\n\t\t\t\t\t\t\t\t\t<option value=\"closed\"><?php _e( 'Do not allow' ); ?></option>\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t<?php if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>\n\n\t\t\t\t\t\t\t<label class=\"alignright\">\n\t\t\t\t\t\t\t\t<span class=\"title\"><?php _e( 'Pings' ); ?></span>\n\t\t\t\t\t\t\t\t<select name=\"ping_status\">\n\t\t\t\t\t\t\t\t\t<option value=\"\"><?php _e( '&mdash; No Change &mdash;' ); ?></option>\n\t\t\t\t\t\t\t\t\t<option value=\"open\"><?php _e( 'Allow' ); ?></option>\n\t\t\t\t\t\t\t\t\t<option value=\"closed\"><?php _e( 'Do not allow' ); ?></option>\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t<?php else : // $bulk ?>\n\n\t\t\t\t\t\t<div class=\"inline-edit-group wp-clearfix\">\n\n\t\t\t\t\t\t<?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>\n\n\t\t\t\t\t\t\t<label class=\"alignleft\">\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"comment_status\" value=\"open\" />\n\t\t\t\t\t\t\t\t<span class=\"checkbox-title\"><?php _e( 'Allow Comments' ); ?></span>\n\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t<?php if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>\n\n\t\t\t\t\t\t\t<label class=\"alignleft\">\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"ping_status\" value=\"open\" />\n\t\t\t\t\t\t\t\t<span class=\"checkbox-title\"><?php _e( 'Allow Pings' ); ?></span>\n\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t<?php endif; // $bulk ?>\n\n\t\t\t\t<?php endif; // post_type_supports( ... comments or pings ) ?>\n\n\t\t\t\t\t<div class=\"inline-edit-group wp-clearfix\">\n\n\t\t\t\t\t\t<label class=\"inline-edit-status alignleft\">\n\t\t\t\t\t\t\t<span class=\"title\"><?php _e( 'Status' ); ?></span>\n\t\t\t\t\t\t\t<select name=\"_status\">\n\t\t\t\t\t\t\t\t<?php if ( $bulk ) : ?>\n\t\t\t\t\t\t\t\t\t<option value=\"-1\"><?php _e( '&mdash; No Change &mdash;' ); ?></option>\n\t\t\t\t\t\t\t\t<?php endif; // $bulk ?>\n\n\t\t\t\t\t\t\t\t<?php if ( $can_publish ) : // Contributors only get \"Unpublished\" and \"Pending Review\". ?>\n\t\t\t\t\t\t\t\t\t<option value=\"publish\"><?php _e( 'Published' ); ?></option>\n\t\t\t\t\t\t\t\t\t<option value=\"future\"><?php _e( 'Scheduled' ); ?></option>\n\t\t\t\t\t\t\t\t\t<?php if ( $bulk ) : ?>\n\t\t\t\t\t\t\t\t\t\t<option value=\"private\"><?php _e( 'Private' ); ?></option>\n\t\t\t\t\t\t\t\t\t<?php endif; // $bulk ?>\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t\t\t<option value=\"pending\"><?php _e( 'Pending Review' ); ?></option>\n\t\t\t\t\t\t\t\t<option value=\"draft\"><?php _e( 'Draft' ); ?></option>\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t<?php if ( 'post' === $screen->post_type && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?>\n\n\t\t\t\t\t\t\t<?php if ( $bulk ) : ?>\n\n\t\t\t\t\t\t\t\t<label class=\"alignright\">\n\t\t\t\t\t\t\t\t\t<span class=\"title\"><?php _e( 'Sticky' ); ?></span>\n\t\t\t\t\t\t\t\t\t<select name=\"sticky\">\n\t\t\t\t\t\t\t\t\t\t<option value=\"-1\"><?php _e( '&mdash; No Change &mdash;' ); ?></option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"sticky\"><?php _e( 'Sticky' ); ?></option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"unsticky\"><?php _e( 'Not Sticky' ); ?></option>\n\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t\t<?php else : // $bulk ?>\n\n\t\t\t\t\t\t\t\t<label class=\"alignleft\">\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"sticky\" value=\"sticky\" />\n\t\t\t\t\t\t\t\t\t<span class=\"checkbox-title\"><?php _e( 'Make this post sticky' ); ?></span>\n\t\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t\t<?php endif; // $bulk ?>\n\n\t\t\t\t\t\t<?php endif; // 'post' && $can_publish && current_user_can( 'edit_others_posts' ) ?>\n\n\t\t\t\t\t</div>\n\n\t\t\t\t<?php if ( $bulk && current_theme_supports( 'post-formats' ) && post_type_supports( $screen->post_type, 'post-formats' ) ) : ?>\n\t\t\t\t\t<?php $post_formats = get_theme_support( 'post-formats' ); ?>\n\n\t\t\t\t\t<label class=\"alignleft\">\n\t\t\t\t\t\t<span class=\"title\"><?php _ex( 'Format', 'post format' ); ?></span>\n\t\t\t\t\t\t<select name=\"post_format\">\n\t\t\t\t\t\t\t<option value=\"-1\"><?php _e( '&mdash; No Change &mdash;' ); ?></option>\n\t\t\t\t\t\t\t<option value=\"0\"><?php echo get_post_format_string( 'standard' ); ?></option>\n\t\t\t\t\t\t\t<?php if ( is_array( $post_formats[0] ) ) : ?>\n\t\t\t\t\t\t\t\t<?php foreach ( $post_formats[0] as $format ) : ?>\n\t\t\t\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $format ); ?>\"><?php echo esc_html( get_post_format_string( $format ) ); ?></option>\n\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</label>\n\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\n\t\t\t<?php\n\t\t\tlist( $columns ) = $this->get_column_info();\n\n\t\t\tforeach ( $columns as $column_name => $column_display_name ) {\n\t\t\t\tif ( isset( $core_columns[ $column_name ] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( $bulk ) {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Fires once for each column in Bulk Edit mode.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 2.7.0\n\t\t\t\t\t *\n\t\t\t\t\t * @param string $column_name Name of the column to edit.\n\t\t\t\t\t * @param string $post_type   The post type slug.\n\t\t\t\t\t */\n\t\t\t\t\tdo_action( 'bulk_edit_custom_box', $column_name, $screen->post_type );\n\t\t\t\t} else {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Fires once for each column in Quick Edit mode.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 2.7.0\n\t\t\t\t\t *\n\t\t\t\t\t * @param string $column_name Name of the column to edit.\n\t\t\t\t\t * @param string $post_type   The post type slug, or current screen name if this is a taxonomy list table.\n\t\t\t\t\t * @param string $taxonomy    The taxonomy name, if any.\n\t\t\t\t\t */\n\t\t\t\t\tdo_action( 'quick_edit_custom_box', $column_name, $screen->post_type, '' );\n\t\t\t\t}\n\t\t\t}\n\t\t\t?>\n\n\t\t\t<div class=\"submit inline-edit-save\">\n\t\t\t\t<button type=\"button\" class=\"button cancel alignleft\"><?php _e( 'Cancel' ); ?></button>\n\n\t\t\t\t<?php if ( ! $bulk ) : ?>\n\t\t\t\t\t<?php wp_nonce_field( 'inlineeditnonce', '_inline_edit', false ); ?>\n\t\t\t\t\t<button type=\"button\" class=\"button button-primary save alignright\"><?php _e( 'Update' ); ?></button>\n\t\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t\t<?php else : ?>\n\t\t\t\t\t<?php submit_button( __( 'Update' ), 'primary alignright', 'bulk_edit', false ); ?>\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\t<input type=\"hidden\" name=\"post_view\" value=\"<?php echo esc_attr( $m ); ?>\" />\n\t\t\t\t<input type=\"hidden\" name=\"screen\" value=\"<?php echo esc_attr( $screen->id ); ?>\" />\n\t\t\t\t<?php if ( ! $bulk && ! post_type_supports( $screen->post_type, 'author' ) ) : ?>\n\t\t\t\t\t<input type=\"hidden\" name=\"post_author\" value=\"<?php echo esc_attr( $post->post_author ); ?>\" />\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<br class=\"clear\" />\n\n\t\t\t\t<div class=\"notice notice-error notice-alt inline hidden\">\n\t\t\t\t\t<p class=\"error\"></p>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t</td></tr>\n\n\t\t\t<?php\n\t\t\t$bulk++;\n\t\tendwhile;\n\t\t?>\n\t\t</tbody></table>\n\t\t</form>\n\t\t<?php\n\t}\n}\n", "num_lines": 1948}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_Privacy_Data_Export_Requests_List_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.9.6\n */\n\nif ( ! class_exists( 'WP_Privacy_Requests_Table' ) ) {\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-privacy-requests-table.php';\n}\n\n/**\n * WP_Privacy_Data_Export_Requests_Table class.\n *\n * @since 4.9.6\n */\nclass WP_Privacy_Data_Export_Requests_List_Table extends WP_Privacy_Requests_Table {\n\t/**\n\t * Action name for the requests this table will work with.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @var string $request_type Name of action.\n\t */\n\tprotected $request_type = 'export_personal_data';\n\n\t/**\n\t * Post type for the requests.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @var string $post_type The post type.\n\t */\n\tprotected $post_type = 'user_request';\n\n\t/**\n\t * Actions column.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param WP_User_Request $item Item being shown.\n\t * @return string Email column markup.\n\t */\n\tpublic function column_email( $item ) {\n\t\t/** This filter is documented in wp-admin/includes/ajax-actions.php */\n\t\t$exporters       = apply_filters( 'wp_privacy_personal_data_exporters', array() );\n\t\t$exporters_count = count( $exporters );\n\t\t$request_id      = $item->ID;\n\t\t$nonce           = wp_create_nonce( 'wp-privacy-export-personal-data-' . $request_id );\n\n\t\t$download_data_markup = '<div class=\"export-personal-data\" ' .\n\t\t\t'data-exporters-count=\"' . esc_attr( $exporters_count ) . '\" ' .\n\t\t\t'data-request-id=\"' . esc_attr( $request_id ) . '\" ' .\n\t\t\t'data-nonce=\"' . esc_attr( $nonce ) .\n\t\t\t'\">';\n\n\t\t$download_data_markup .= '<span class=\"export-personal-data-idle\"><button type=\"button\" class=\"button-link export-personal-data-handle\">' . __( 'Download Personal Data' ) . '</button></span>' .\n\t\t\t'<span class=\"export-personal-data-processing hidden\">' . __( 'Downloading Data...' ) . ' <span class=\"export-progress\"></span></span>' .\n\t\t\t'<span class=\"export-personal-data-success hidden\"><button type=\"button\" class=\"button-link export-personal-data-handle\">' . __( 'Download Personal Data Again' ) . '</button></span>' .\n\t\t\t'<span class=\"export-personal-data-failed hidden\">' . __( 'Download failed.' ) . ' <button type=\"button\" class=\"button-link\">' . __( 'Retry' ) . '</button></span>';\n\n\t\t$download_data_markup .= '</div>';\n\n\t\t$row_actions = array(\n\t\t\t'download-data' => $download_data_markup,\n\t\t);\n\n\t\treturn sprintf( '<a href=\"%1$s\">%2$s</a> %3$s', esc_url( 'mailto:' . $item->email ), $item->email, $this->row_actions( $row_actions ) );\n\t}\n\n\t/**\n\t * Displays the next steps column.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param WP_User_Request $item Item being shown.\n\t */\n\tpublic function column_next_steps( $item ) {\n\t\t$status = $item->status;\n\n\t\tswitch ( $status ) {\n\t\t\tcase 'request-pending':\n\t\t\t\tesc_html_e( 'Waiting for confirmation' );\n\t\t\t\tbreak;\n\t\t\tcase 'request-confirmed':\n\t\t\t\t/** This filter is documented in wp-admin/includes/ajax-actions.php */\n\t\t\t\t$exporters       = apply_filters( 'wp_privacy_personal_data_exporters', array() );\n\t\t\t\t$exporters_count = count( $exporters );\n\t\t\t\t$request_id      = $item->ID;\n\t\t\t\t$nonce           = wp_create_nonce( 'wp-privacy-export-personal-data-' . $request_id );\n\n\t\t\t\techo '<div class=\"export-personal-data\" ' .\n\t\t\t\t\t'data-send-as-email=\"1\" ' .\n\t\t\t\t\t'data-exporters-count=\"' . esc_attr( $exporters_count ) . '\" ' .\n\t\t\t\t\t'data-request-id=\"' . esc_attr( $request_id ) . '\" ' .\n\t\t\t\t\t'data-nonce=\"' . esc_attr( $nonce ) .\n\t\t\t\t\t'\">';\n\n\t\t\t\t?>\n\t\t\t\t<span class=\"export-personal-data-idle\"><button type=\"button\" class=\"button-link export-personal-data-handle\"><?php _e( 'Send Export Link' ); ?></button></span>\n\t\t\t\t<span class=\"export-personal-data-processing hidden\"><?php _e( 'Sending Email...' ); ?> <span class=\"export-progress\"></span></span>\n\t\t\t\t<span class=\"export-personal-data-success success-message hidden\"><?php _e( 'Email sent.' ); ?></span>\n\t\t\t\t<span class=\"export-personal-data-failed hidden\"><?php _e( 'Email could not be sent.' ); ?> <button type=\"button\" class=\"button-link export-personal-data-handle\"><?php _e( 'Retry' ); ?></button></span>\n\t\t\t\t<?php\n\n\t\t\t\techo '</div>';\n\t\t\t\tbreak;\n\t\t\tcase 'request-failed':\n\t\t\t\techo '<button type=\"submit\" class=\"button-link\" name=\"privacy_action_email_retry[' . $item->ID . ']\" id=\"privacy_action_email_retry[' . $item->ID . ']\">' . __( 'Retry' ) . '</button>';\n\t\t\t\tbreak;\n\t\t\tcase 'request-completed':\n\t\t\t\techo '<a href=\"' . esc_url(\n\t\t\t\t\twp_nonce_url(\n\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'action'     => 'delete',\n\t\t\t\t\t\t\t\t'request_id' => array( $item->ID ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tadmin_url( 'export-personal-data.php' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'bulk-privacy_requests'\n\t\t\t\t\t)\n\t\t\t\t) . '\">' . esc_html__( 'Remove request' ) . '</a>';\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n", "num_lines": 130}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_Privacy_Data_Removal_Requests_List_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.9.6\n */\n\nif ( ! class_exists( 'WP_Privacy_Requests_Table' ) ) {\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-privacy-requests-table.php';\n}\n\n/**\n * WP_Privacy_Data_Removal_Requests_List_Table class.\n *\n * @since 4.9.6\n */\nclass WP_Privacy_Data_Removal_Requests_List_Table extends WP_Privacy_Requests_Table {\n\t/**\n\t * Action name for the requests this table will work with.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @var string $request_type Name of action.\n\t */\n\tprotected $request_type = 'remove_personal_data';\n\n\t/**\n\t * Post type for the requests.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @var string $post_type The post type.\n\t */\n\tprotected $post_type = 'user_request';\n\n\t/**\n\t * Actions column.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param WP_User_Request $item Item being shown.\n\t * @return string Email column markup.\n\t */\n\tpublic function column_email( $item ) {\n\t\t$row_actions = array();\n\n\t\t// Allow the administrator to \"force remove\" the personal data even if confirmation has not yet been received.\n\t\t$status = $item->status;\n\t\tif ( 'request-confirmed' !== $status ) {\n\t\t\t/** This filter is documented in wp-admin/includes/ajax-actions.php */\n\t\t\t$erasers       = apply_filters( 'wp_privacy_personal_data_erasers', array() );\n\t\t\t$erasers_count = count( $erasers );\n\t\t\t$request_id    = $item->ID;\n\t\t\t$nonce         = wp_create_nonce( 'wp-privacy-erase-personal-data-' . $request_id );\n\n\t\t\t$remove_data_markup = '<div class=\"remove-personal-data force-remove-personal-data\" ' .\n\t\t\t\t'data-erasers-count=\"' . esc_attr( $erasers_count ) . '\" ' .\n\t\t\t\t'data-request-id=\"' . esc_attr( $request_id ) . '\" ' .\n\t\t\t\t'data-nonce=\"' . esc_attr( $nonce ) .\n\t\t\t\t'\">';\n\n\t\t\t$remove_data_markup .= '<span class=\"remove-personal-data-idle\"><button type=\"button\" class=\"button-link remove-personal-data-handle\">' . __( 'Force Erase Personal Data' ) . '</button></span>' .\n\t\t\t\t'<span class=\"remove-personal-data-processing hidden\">' . __( 'Erasing Data...' ) . ' <span class=\"erasure-progress\"></span></span>' .\n\t\t\t\t'<span class=\"remove-personal-data-success hidden\">' . __( 'Erasure completed.' ) . '</span>' .\n\t\t\t\t'<span class=\"remove-personal-data-failed hidden\">' . __( 'Force Erasure has failed.' ) . ' <button type=\"button\" class=\"button-link remove-personal-data-handle\">' . __( 'Retry' ) . '</button></span>';\n\n\t\t\t$remove_data_markup .= '</div>';\n\n\t\t\t$row_actions = array(\n\t\t\t\t'remove-data' => $remove_data_markup,\n\t\t\t);\n\t\t}\n\n\t\treturn sprintf( '<a href=\"%1$s\">%2$s</a> %3$s', esc_url( 'mailto:' . $item->email ), $item->email, $this->row_actions( $row_actions ) );\n\t}\n\n\t/**\n\t * Next steps column.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param WP_User_Request $item Item being shown.\n\t */\n\tpublic function column_next_steps( $item ) {\n\t\t$status = $item->status;\n\n\t\tswitch ( $status ) {\n\t\t\tcase 'request-pending':\n\t\t\t\tesc_html_e( 'Waiting for confirmation' );\n\t\t\t\tbreak;\n\t\t\tcase 'request-confirmed':\n\t\t\t\t/** This filter is documented in wp-admin/includes/ajax-actions.php */\n\t\t\t\t$erasers       = apply_filters( 'wp_privacy_personal_data_erasers', array() );\n\t\t\t\t$erasers_count = count( $erasers );\n\t\t\t\t$request_id    = $item->ID;\n\t\t\t\t$nonce         = wp_create_nonce( 'wp-privacy-erase-personal-data-' . $request_id );\n\n\t\t\t\techo '<div class=\"remove-personal-data\" ' .\n\t\t\t\t\t'data-force-erase=\"1\" ' .\n\t\t\t\t\t'data-erasers-count=\"' . esc_attr( $erasers_count ) . '\" ' .\n\t\t\t\t\t'data-request-id=\"' . esc_attr( $request_id ) . '\" ' .\n\t\t\t\t\t'data-nonce=\"' . esc_attr( $nonce ) .\n\t\t\t\t\t'\">';\n\n\t\t\t\t?>\n\t\t\t\t<span class=\"remove-personal-data-idle\"><button type=\"button\" class=\"button-link remove-personal-data-handle\"><?php _e( 'Erase Personal Data' ); ?></button></span>\n\t\t\t\t<span class=\"remove-personal-data-processing hidden\"><?php _e( 'Erasing Data...' ); ?> <span class=\"erasure-progress\"></span></span>\n\t\t\t\t<span class=\"remove-personal-data-success success-message hidden\" ><?php _e( 'Erasure completed.' ); ?></span>\n\t\t\t\t<span class=\"remove-personal-data-failed hidden\"><?php _e( 'Data Erasure has failed.' ); ?> <button type=\"button\" class=\"button-link remove-personal-data-handle\"><?php _e( 'Retry' ); ?></button></span>\n\t\t\t\t<?php\n\n\t\t\t\techo '</div>';\n\n\t\t\t\tbreak;\n\t\t\tcase 'request-failed':\n\t\t\t\techo '<button type=\"submit\" class=\"button-link\" name=\"privacy_action_email_retry[' . $item->ID . ']\" id=\"privacy_action_email_retry[' . $item->ID . ']\">' . __( 'Retry' ) . '</button>';\n\t\t\t\tbreak;\n\t\t\tcase 'request-completed':\n\t\t\t\techo '<a href=\"' . esc_url(\n\t\t\t\t\twp_nonce_url(\n\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'action'     => 'delete',\n\t\t\t\t\t\t\t\t'request_id' => array( $item->ID ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tadmin_url( 'erase-personal-data.php' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'bulk-privacy_requests'\n\t\t\t\t\t)\n\t\t\t\t) . '\">' . esc_html__( 'Remove request' ) . '</a>';\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n}\n", "num_lines": 138}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WP_Privacy_Policy_Content class.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.9.6\n */\n\nfinal class WP_Privacy_Policy_Content {\n\n\tprivate static $policy_content = array();\n\n\t/**\n\t * Constructor\n\t *\n\t * @since 4.9.6\n\t */\n\tprivate function __construct() {}\n\n\t/**\n\t * Add content to the postbox shown when editing the privacy policy.\n\t *\n\t * Plugins and themes should suggest text for inclusion in the site's privacy policy.\n\t * The suggested text should contain information about any functionality that affects user privacy,\n\t * and will be shown in the Suggested Privacy Policy Content postbox.\n\t *\n\t * Intended for use from `wp_add_privacy_policy_content()`.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param string $plugin_name The name of the plugin or theme that is suggesting content for the site's privacy policy.\n\t * @param string $policy_text The suggested content for inclusion in the policy.\n\t */\n\tpublic static function add( $plugin_name, $policy_text ) {\n\t\tif ( empty( $plugin_name ) || empty( $policy_text ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$data = array(\n\t\t\t'plugin_name' => $plugin_name,\n\t\t\t'policy_text' => $policy_text,\n\t\t);\n\n\t\tif ( ! in_array( $data, self::$policy_content, true ) ) {\n\t\t\tself::$policy_content[] = $data;\n\t\t}\n\t}\n\n\t/**\n\t * Quick check if any privacy info has changed.\n\t *\n\t * @since 4.9.6\n\t */\n\tpublic static function text_change_check() {\n\n\t\t$policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );\n\n\t\t// The site doesn't have a privacy policy.\n\t\tif ( empty( $policy_page_id ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $policy_page_id ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );\n\n\t\t// Updates are not relevant if the user has not reviewed any suggestions yet.\n\t\tif ( empty( $old ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$cached = get_option( '_wp_suggested_policy_text_has_changed' );\n\n\t\t/*\n\t\t * When this function is called before `admin_init`, `self::$policy_content`\n\t\t * has not been populated yet, so use the cached result from the last\n\t\t * execution instead.\n\t\t */\n\t\tif ( ! did_action( 'admin_init' ) ) {\n\t\t\treturn 'changed' === $cached;\n\t\t}\n\n\t\t$new = self::$policy_content;\n\n\t\t// Remove the extra values added to the meta.\n\t\tforeach ( $old as $key => $data ) {\n\t\t\tif ( ! empty( $data['removed'] ) ) {\n\t\t\t\tunset( $old[ $key ] );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$old[ $key ] = array(\n\t\t\t\t'plugin_name' => $data['plugin_name'],\n\t\t\t\t'policy_text' => $data['policy_text'],\n\t\t\t);\n\t\t}\n\n\t\t// Normalize the order of texts, to facilitate comparison.\n\t\tsort( $old );\n\t\tsort( $new );\n\n\t\t// The == operator (equal, not identical) was used intentionally.\n\t\t// See http://php.net/manual/en/language.operators.array.php\n\t\tif ( $new != $old ) {\n\t\t\t// A plugin was activated or deactivated, or some policy text has changed.\n\t\t\t// Show a notice on the relevant screens to inform the admin.\n\t\t\tadd_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'policy_text_changed_notice' ) );\n\t\t\t$state = 'changed';\n\t\t} else {\n\t\t\t$state = 'not-changed';\n\t\t}\n\n\t\t// Cache the result for use before `admin_init` (see above).\n\t\tif ( $cached !== $state ) {\n\t\t\tupdate_option( '_wp_suggested_policy_text_has_changed', $state );\n\t\t}\n\n\t\treturn 'changed' === $state;\n\t}\n\n\t/**\n\t * Output a warning when some privacy info has changed.\n\t *\n\t * @since 4.9.6\n\t */\n\tpublic static function policy_text_changed_notice() {\n\t\tglobal $post;\n\n\t\t$screen = get_current_screen()->id;\n\n\t\tif ( 'privacy' !== $screen ) {\n\t\t\treturn;\n\t\t}\n\n\t\t?>\n\t\t<div class=\"policy-text-updated notice notice-warning is-dismissible\">\n\t\t\t<p>\n\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: Privacy Policy Guide URL. */\n\t\t\t\t\t__( 'The suggested privacy policy text has changed. Please <a href=\"%s\">review the guide</a> and update your privacy policy.' ),\n\t\t\t\t\tesc_url( admin_url( 'privacy-policy-guide.php' ) )\n\t\t\t\t);\n\t\t\t?>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Update the cached policy info when the policy page is updated.\n\t *\n\t * @since 4.9.6\n\t * @access private\n\t *\n\t * @param int $post_id The ID of the updated post.\n\t */\n\tpublic static function _policy_page_updated( $post_id ) {\n\t\t$policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );\n\n\t\tif ( ! $policy_page_id || $policy_page_id !== (int) $post_id ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove updated|removed status.\n\t\t$old          = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );\n\t\t$done         = array();\n\t\t$update_cache = false;\n\n\t\tforeach ( $old as $old_key => $old_data ) {\n\t\t\tif ( ! empty( $old_data['removed'] ) ) {\n\t\t\t\t// Remove the old policy text.\n\t\t\t\t$update_cache = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! empty( $old_data['updated'] ) ) {\n\t\t\t\t// 'updated' is now 'added'.\n\t\t\t\t$done[]       = array(\n\t\t\t\t\t'plugin_name' => $old_data['plugin_name'],\n\t\t\t\t\t'policy_text' => $old_data['policy_text'],\n\t\t\t\t\t'added'       => $old_data['updated'],\n\t\t\t\t);\n\t\t\t\t$update_cache = true;\n\t\t\t} else {\n\t\t\t\t$done[] = $old_data;\n\t\t\t}\n\t\t}\n\n\t\tif ( $update_cache ) {\n\t\t\tdelete_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );\n\t\t\t// Update the cache.\n\t\t\tforeach ( $done as $data ) {\n\t\t\t\tadd_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content', $data );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Check for updated, added or removed privacy policy information from plugins.\n\t *\n\t * Caches the current info in post_meta of the policy page.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @return array The privacy policy text/information added by core and plugins.\n\t */\n\tpublic static function get_suggested_policy_text() {\n\t\t$policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );\n\t\t$checked        = array();\n\t\t$time           = time();\n\t\t$update_cache   = false;\n\t\t$new            = self::$policy_content;\n\t\t$old            = array();\n\n\t\tif ( $policy_page_id ) {\n\t\t\t$old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );\n\t\t}\n\n\t\t// Check for no-changes and updates.\n\t\tforeach ( $new as $new_key => $new_data ) {\n\t\t\tforeach ( $old as $old_key => $old_data ) {\n\t\t\t\t$found = false;\n\n\t\t\t\tif ( $new_data['policy_text'] === $old_data['policy_text'] ) {\n\t\t\t\t\t// Use the new plugin name in case it was changed, translated, etc.\n\t\t\t\t\tif ( $old_data['plugin_name'] !== $new_data['plugin_name'] ) {\n\t\t\t\t\t\t$old_data['plugin_name'] = $new_data['plugin_name'];\n\t\t\t\t\t\t$update_cache            = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// A plugin was re-activated.\n\t\t\t\t\tif ( ! empty( $old_data['removed'] ) ) {\n\t\t\t\t\t\tunset( $old_data['removed'] );\n\t\t\t\t\t\t$old_data['added'] = $time;\n\t\t\t\t\t\t$update_cache      = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t$checked[] = $old_data;\n\t\t\t\t\t$found     = true;\n\t\t\t\t} elseif ( $new_data['plugin_name'] === $old_data['plugin_name'] ) {\n\t\t\t\t\t// The info for the policy was updated.\n\t\t\t\t\t$checked[]    = array(\n\t\t\t\t\t\t'plugin_name' => $new_data['plugin_name'],\n\t\t\t\t\t\t'policy_text' => $new_data['policy_text'],\n\t\t\t\t\t\t'updated'     => $time,\n\t\t\t\t\t);\n\t\t\t\t\t$found        = true;\n\t\t\t\t\t$update_cache = true;\n\t\t\t\t}\n\n\t\t\t\tif ( $found ) {\n\t\t\t\t\tunset( $new[ $new_key ], $old[ $old_key ] );\n\t\t\t\t\tcontinue 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $new ) ) {\n\t\t\t// A plugin was activated.\n\t\t\tforeach ( $new as $new_data ) {\n\t\t\t\tif ( ! empty( $new_data['plugin_name'] ) && ! empty( $new_data['policy_text'] ) ) {\n\t\t\t\t\t$new_data['added'] = $time;\n\t\t\t\t\t$checked[]         = $new_data;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$update_cache = true;\n\t\t}\n\n\t\tif ( ! empty( $old ) ) {\n\t\t\t// A plugin was deactivated.\n\t\t\tforeach ( $old as $old_data ) {\n\t\t\t\tif ( ! empty( $old_data['plugin_name'] ) && ! empty( $old_data['policy_text'] ) ) {\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'plugin_name' => $old_data['plugin_name'],\n\t\t\t\t\t\t'policy_text' => $old_data['policy_text'],\n\t\t\t\t\t\t'removed'     => $time,\n\t\t\t\t\t);\n\n\t\t\t\t\t$checked[] = $data;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$update_cache = true;\n\t\t}\n\n\t\tif ( $update_cache && $policy_page_id ) {\n\t\t\tdelete_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );\n\t\t\t// Update the cache.\n\t\t\tforeach ( $checked as $data ) {\n\t\t\t\tadd_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content', $data );\n\t\t\t}\n\t\t}\n\n\t\treturn $checked;\n\t}\n\n\t/**\n\t * Add a notice with a link to the guide when editing the privacy policy page.\n\t *\n\t * @since 4.9.6\n\t * @since 5.0.0 The `$post` parameter was made optional.\n\t *\n\t * @param WP_Post|null $post The currently edited post. Default null.\n\t */\n\tpublic static function notice( $post = null ) {\n\t\tif ( is_null( $post ) ) {\n\t\t\tglobal $post;\n\t\t} else {\n\t\t\t$post = get_post( $post );\n\t\t}\n\n\t\tif ( ! ( $post instanceof WP_Post ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! current_user_can( 'manage_privacy_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$current_screen = get_current_screen();\n\t\t$policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );\n\n\t\tif ( 'post' !== $current_screen->base || $policy_page_id !== $post->ID ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$message = __( 'Need help putting together your new Privacy Policy page? Check out our guide for recommendations on what content to include, along with policies suggested by your plugins and theme.' );\n\t\t$url     = esc_url( admin_url( 'privacy-policy-guide.php' ) );\n\t\t$label   = __( 'View Privacy Policy Guide.' );\n\n\t\tif ( get_current_screen()->is_block_editor() ) {\n\t\t\twp_enqueue_script( 'wp-notices' );\n\t\t\t$action = array(\n\t\t\t\t'url'   => $url,\n\t\t\t\t'label' => $label,\n\t\t\t);\n\t\t\twp_add_inline_script(\n\t\t\t\t'wp-notices',\n\t\t\t\tsprintf(\n\t\t\t\t\t'wp.data.dispatch( \"core/notices\" ).createWarningNotice( \"%s\", { actions: [ %s ], isDismissible: false } )',\n\t\t\t\t\t$message,\n\t\t\t\t\twp_json_encode( $action )\n\t\t\t\t),\n\t\t\t\t'after'\n\t\t\t);\n\t\t} else {\n\t\t\t?>\n\t\t\t<div class=\"notice notice-warning inline wp-pp-notice\">\n\t\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\techo $message;\n\t\t\t\tprintf(\n\t\t\t\t\t' <a href=\"%s\" target=\"_blank\">%s <span class=\"screen-reader-text\">%s</span></a>',\n\t\t\t\t\t$url,\n\t\t\t\t\t$label,\n\t\t\t\t\t/* translators: Accessibility text. */\n\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}\n\n\t/**\n\t * Output the privacy policy guide together with content from the theme and plugins.\n\t *\n\t * @since 4.9.6\n\t */\n\tpublic static function privacy_policy_guide() {\n\n\t\t$content_array = self::get_suggested_policy_text();\n\t\t$content       = '';\n\t\t$toc           = array( '<li><a href=\"#wp-privacy-policy-guide-introduction\">' . __( 'Introduction' ) . '</a></li>' );\n\t\t$date_format   = __( 'F j, Y' );\n\n\t\tforeach ( $content_array as $section ) {\n\t\t\t$class   = '';\n\t\t\t$meta    = '';\n\t\t\t$removed = '';\n\n\t\t\tif ( ! empty( $section['removed'] ) ) {\n\t\t\t\t$class = 'text-removed';\n\t\t\t\t$date  = date_i18n( $date_format, $section['removed'] );\n\t\t\t\t/* translators: %s: Date of plugin deactivation. */\n\t\t\t\t$meta = sprintf( __( 'Removed %s.' ), $date );\n\n\t\t\t\t/* translators: %s: Date of plugin deactivation. */\n\t\t\t\t$removed = __( 'You deactivated this plugin on %s and may no longer need this policy.' );\n\t\t\t\t$removed = '<div class=\"notice notice-info inline\"><p>' . sprintf( $removed, $date ) . '</p></div>';\n\t\t\t} elseif ( ! empty( $section['updated'] ) ) {\n\t\t\t\t$class = 'text-updated';\n\t\t\t\t$date  = date_i18n( $date_format, $section['updated'] );\n\t\t\t\t/* translators: %s: Date of privacy policy text update. */\n\t\t\t\t$meta = sprintf( __( 'Updated %s.' ), $date );\n\t\t\t}\n\n\t\t\tif ( $meta ) {\n\t\t\t\t$meta = '<br><span class=\"privacy-text-meta\">' . $meta . '</span>';\n\t\t\t}\n\n\t\t\t$plugin_name = esc_html( $section['plugin_name'] );\n\t\t\t$toc_id      = 'wp-privacy-policy-guide-' . sanitize_title( $plugin_name );\n\t\t\t$toc[]       = sprintf( '<li><a href=\"#%1$s\">%2$s</a>' . $meta . '</li>', $toc_id, $plugin_name );\n\n\t\t\t$content .= '<div class=\"privacy-text-section ' . $class . '\">';\n\t\t\t$content .= '<a id=\"' . $toc_id . '\">&nbsp;</a>';\n\t\t\t/* translators: %s: Plugin name. */\n\t\t\t$content .= '<h2>' . sprintf( __( 'Source: %s' ), $plugin_name ) . '</h2>';\n\t\t\t$content .= $removed;\n\n\t\t\t$content .= '<div class=\"policy-text\">' . $section['policy_text'] . '</div>';\n\n\t\t\tif ( empty( $section['removed'] ) ) {\n\t\t\t\t$content .= '<div class=\"privacy-text-actions\">';\n\t\t\t\t$content .= '<button type=\"button\" class=\"privacy-text-copy button\">';\n\t\t\t\t$content .= __( 'Copy this section to clipboard' );\n\t\t\t\t$content .= '</button>';\n\t\t\t\t$content .= '<span class=\"success\" aria-hidden=\"true\">' . __( 'Copied!' ) . '</span>';\n\t\t\t\t$content .= '</div>';\n\t\t\t}\n\n\t\t\t$content .= '<a href=\"#wpbody\" class=\"return-to-top\"><span aria-hidden=\"true\">&uarr; </span> ' . __( 'Return to top' ) . '</a>';\n\n\t\t\t$content .= '</div>'; // End of .privacy-text-section.\n\t\t}\n\n\t\tif ( count( $toc ) > 2 ) {\n\t\t\t?>\n\t\t\t<div class=\"privacy-text-box-toc\">\n\t\t\t\t<p><?php _e( 'Table of Contents' ); ?></p>\n\t\t\t\t<ol>\n\t\t\t\t\t<?php echo implode( $toc ); ?>\n\t\t\t\t</ol>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\n\t\t?>\n\t\t<div class=\"privacy-text-box\">\n\t\t\t<div class=\"privacy-text-box-head\">\n\t\t\t\t<a id=\"wp-privacy-policy-guide-introduction\">&nbsp;</a>\n\t\t\t\t<h2><?php _e( 'Introduction' ); ?></h2>\n\t\t\t\t<p><?php _e( 'Hello,' ); ?></p>\n\t\t\t\t<p><?php _e( 'This text template will help you to create your web site&#8217;s privacy policy.' ); ?></p>\n\t\t\t\t<p><?php _e( 'We have suggested the sections you will need. Under each section heading you will find a short summary of what information you should provide, which will help you to get started. Some sections include suggested policy content, others will have to be completed with information from your theme and plugins.' ); ?></p>\n\t\t\t\t<p><?php _e( 'Please edit your privacy policy content, making sure to delete the summaries, and adding any information from your theme and plugins. Once you publish your policy page, remember to add it to your navigation menu.' ); ?></p>\n\t\t\t\t<p><?php _e( 'It is your responsibility to write a comprehensive privacy policy, to make sure it reflects all national and international legal requirements on privacy, and to keep your policy current and accurate.' ); ?></p>\n\t\t\t</div>\n\n\t\t\t<div class=\"privacy-text-box-body\">\n\t\t\t\t<?php echo $content; ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Return the default suggested privacy policy content.\n\t *\n\t * @since 4.9.6\n\t * @since 5.0.0 Added the `$blocks` parameter.\n\t *\n\t * @param bool $description Whether to include the descriptions under the section headings. Default false.\n\t * @param bool $blocks      Whether to format the content for the block editor. Default true.\n\t * @return string The default policy content.\n\t */\n\tpublic static function get_default_content( $description = false, $blocks = true ) {\n\t\t$suggested_text = $description ? '<strong class=\"privacy-policy-tutorial\">' . __( 'Suggested text:' ) . ' </strong>' : '';\n\t\t$content        = '';\n\t\t$strings        = array();\n\n\t\t// Start of the suggested privacy policy text.\n\t\tif ( $description ) {\n\t\t\t$strings[] = '<div class=\"wp-suggested-text\">';\n\t\t}\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h2>' . __( 'Who we are' ) . '</h2>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'In this section you should note your site URL, as well as the name of the company, organization, or individual behind it, and some accurate contact information.' ) . '</p>';\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'The amount of information you may be required to show will vary depending on your local or national business regulations. You may, for example, be required to display a physical address, a registered address, or your company registration number.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy text. %s: Site URL. */\n\t\t$strings[] = '<p>' . $suggested_text . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>';\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'In this section you should note what personal data you collect from users and site visitors. This may include personal data, such as name, email address, personal account preferences; transactional data, such as purchase information; and technical data, such as information about cookies.' ) . '</p>';\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'You should also note any collection and retention of sensitive personal data, such as data concerning health.' ) . '</p>';\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'In addition to listing what personal data you collect, you need to note why you collect it. These explanations must note either the legal basis for your data collection and retention or the active consent the user has given.' ) . '</p>';\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'Personal data is not just created by a user&#8217;s interactions with your site. Personal data is also generated from technical processes such as contact forms, comments, cookies, analytics, and third party embeds.' ) . '</p>';\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'By default WordPress does not collect any personal data about visitors, and only collects the data shown on the User Profile screen from registered users. However some of your plugins may collect personal data. You should add the relevant information below.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h3>' . __( 'Comments' ) . '</h3>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'In this subsection you should note what information is captured through comments. We have noted the data which WordPress collects by default.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy text. */\n\t\t$strings[] = '<p>' . $suggested_text . __( 'When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor&#8217;s IP address and browser user agent string to help spam detection.' ) . '</p>';\n\t\t/* translators: Default privacy policy text. */\n\t\t$strings[] = '<p>' . __( 'An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.' ) . '</p>';\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h3>' . __( 'Media' ) . '</h3>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'In this subsection you should note what information may be disclosed by users who can upload media files. All uploaded files are usually publicly accessible.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy text. */\n\t\t$strings[] = '<p>' . $suggested_text . __( 'If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.' ) . '</p>';\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h3>' . __( 'Contact forms' ) . '</h3>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'By default, WordPress does not include a contact form. If you use a contact form plugin, use this subsection to note what personal data is captured when someone submits a contact form, and how long you keep it. For example, you may note that you keep contact form submissions for a certain period for customer service purposes, but you do not use the information submitted through them for marketing purposes.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h3>' . __( 'Cookies' ) . '</h3>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'In this subsection you should list the cookies your web site uses, including those set by your plugins, social media, and analytics. We have provided the cookies which WordPress installs by default.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy text. */\n\t\t$strings[] = '<p>' . $suggested_text . __( 'If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year.' ) . '</p>';\n\t\t/* translators: Default privacy policy text. */\n\t\t$strings[] = '<p>' . __( 'If you visit our login page, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser.' ) . '</p>';\n\t\t/* translators: Default privacy policy text. */\n\t\t$strings[] = '<p>' . __( 'When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select &quot;Remember Me&quot;, your login will persist for two weeks. If you log out of your account, the login cookies will be removed.' ) . '</p>';\n\t\t/* translators: Default privacy policy text. */\n\t\t$strings[] = '<p>' . __( 'If you edit or publish an article, an additional cookie will be saved in your browser. This cookie includes no personal data and simply indicates the post ID of the article you just edited. It expires after 1 day.' ) . '</p>';\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h3>' . __( 'Embedded content from other websites' ) . '</h3>';\n\t\t/* translators: Default privacy policy text. */\n\t\t$strings[] = '<p>' . $suggested_text . __( 'Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website.' ) . '</p>';\n\t\t/* translators: Default privacy policy text. */\n\t\t$strings[] = '<p>' . __( 'These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.' ) . '</p>';\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h3>' . __( 'Analytics' ) . '</h3>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'In this subsection you should note what analytics package you use, how users can opt out of analytics tracking, and a link to your analytics provider&#8217;s privacy policy, if any.' ) . '</p>';\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'By default WordPress does not collect any analytics data. However, many web hosting accounts collect some anonymous analytics data. You may also have installed a WordPress plugin that provides analytics services. In that case, add information from that plugin here.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h2>' . __( 'Who we share your data with' ) . '</h2>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'In this section you should name and list all third party providers with whom you share site data, including partners, cloud-based services, payment processors, and third party service providers, and note what data you share with them and why. Link to their own privacy policies if possible.' ) . '</p>';\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'By default WordPress does not share any personal data with anyone.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h2>' . __( 'How long we retain your data' ) . '</h2>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'In this section you should explain how long you retain personal data collected or processed by the web site. While it is your responsibility to come up with the schedule of how long you keep each dataset for and why you keep it, that information does need to be listed here. For example, you may want to say that you keep contact form entries for six months, analytics records for a year, and customer purchase records for ten years.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy text. */\n\t\t$strings[] = '<p>' . $suggested_text . __( 'If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue.' ) . '</p>';\n\t\t/* translators: Default privacy policy text. */\n\t\t$strings[] = '<p>' . __( 'For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.' ) . '</p>';\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h2>' . __( 'What rights you have over your data' ) . '</h2>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'In this section you should explain what rights your users have over their data and how they can invoke those rights.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy text. */\n\t\t$strings[] = '<p>' . $suggested_text . __( 'If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.' ) . '</p>';\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h2>' . __( 'Where we send your data' ) . '</h2>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'In this section you should list all transfers of your site data outside the European Union and describe the means by which that data is safeguarded to European data protection standards. This could include your web hosting, cloud storage, or other third party services.' ) . '</p>';\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'European data protection law requires data about European residents which is transferred outside the European Union to be safeguarded to the same standards as if the data was in Europe. So in addition to listing where data goes, you should describe how you ensure that these standards are met either by yourself or by your third party providers, whether that is through an agreement such as Privacy Shield, model clauses in your contracts, or binding corporate rules.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy text. */\n\t\t$strings[] = '<p>' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>';\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h2>' . __( 'Your contact information' ) . '</h2>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'In this section you should provide a contact method for privacy-specific concerns. If you are required to have a Data Protection Officer, list their name and full contact details here as well.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h2>' . __( 'Additional information' ) . '</h2>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'If you use your site for commercial purposes and you engage in more complex collection or processing of personal data, you should note the following information in your privacy policy in addition to the information we have already discussed.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h3>' . __( 'How we protect your data' ) . '</h3>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'In this section you should explain what measures you have taken to protect your users&#8217; data. This could include technical measures such as encryption; security measures such as two factor authentication; and measures such as staff training in data protection. If you have carried out a Privacy Impact Assessment, you can mention it here too.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'In this section you should explain what procedures you have in place to deal with data breaches, either potential or real, such as internal reporting systems, contact mechanisms, or bug bounties.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h3>' . __( 'What third parties we receive data from' ) . '</h3>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'If your web site receives data about users from third parties, including advertisers, this information must be included within the section of your privacy policy dealing with third party data.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'If your web site provides a service which includes automated decision making - for example, allowing customers to apply for credit, or aggregating their data into an advertising profile - you must note that this is taking place, and include information about how that information is used, what decisions are made with that aggregated data, and what rights users have over decisions made without human intervention.' ) . '</p>';\n\t\t}\n\n\t\t/* translators: Default privacy policy heading. */\n\t\t$strings[] = '<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>';\n\n\t\tif ( $description ) {\n\t\t\t/* translators: Privacy policy tutorial. */\n\t\t\t$strings[] = '<p class=\"privacy-policy-tutorial\">' . __( 'If you are a member of a regulated industry, or if you are subject to additional privacy laws, you may be required to disclose that information here.' ) . '</p>';\n\t\t\t$strings[] = '</div>';\n\t\t}\n\n\t\tif ( $blocks ) {\n\t\t\tforeach ( $strings as $key => $string ) {\n\t\t\t\tif ( 0 === strpos( $string, '<p>' ) ) {\n\t\t\t\t\t$strings[ $key ] = '<!-- wp:paragraph -->' . $string . '<!-- /wp:paragraph -->';\n\t\t\t\t}\n\n\t\t\t\tif ( 0 === strpos( $string, '<h2>' ) ) {\n\t\t\t\t\t$strings[ $key ] = '<!-- wp:heading -->' . $string . '<!-- /wp:heading -->';\n\t\t\t\t}\n\n\t\t\t\tif ( 0 === strpos( $string, '<h3>' ) ) {\n\t\t\t\t\t$strings[ $key ] = '<!-- wp:heading {\"level\":3} -->' . $string . '<!-- /wp:heading -->';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$content = implode( '', $strings );\n\t\t// End of the suggested privacy policy text.\n\n\t\t/**\n\t\t * Filters the default content suggested for inclusion in a privacy policy.\n\t\t *\n\t\t * @since 4.9.6\n\t\t * @since 5.0.0 Added the `$strings`, `$description`, and `$blocks` parameters.\n\t\t *\n\t\t * @param string   $content     The default policy content.\n\t\t * @param string[] $strings     An array of privacy policy content strings.\n\t\t * @param bool     $description Whether policy descriptions should be included.\n\t\t * @param bool     $blocks      Whether the content should be formatted for the block editor.\n\t\t */\n\t\treturn apply_filters( 'wp_get_default_privacy_policy_content', $content, $strings, $description, $blocks );\n\t}\n\n\t/**\n\t * Add the suggested privacy policy text to the policy postbox.\n\t *\n\t * @since 4.9.6\n\t */\n\tpublic static function add_suggested_content() {\n\t\t$content = self::get_default_content( true, false );\n\t\twp_add_privacy_policy_content( __( 'WordPress' ), $content );\n\t}\n}\n", "num_lines": 724}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_Privacy_Requests_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.9.6\n */\n\nabstract class WP_Privacy_Requests_Table extends WP_List_Table {\n\n\t/**\n\t * Action name for the requests this table will work with. Classes\n\t * which inherit from WP_Privacy_Requests_Table should define this.\n\t *\n\t * Example: 'export_personal_data'.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @var string $request_type Name of action.\n\t */\n\tprotected $request_type = 'INVALID';\n\n\t/**\n\t * Post type to be used.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @var string $post_type The post type.\n\t */\n\tprotected $post_type = 'INVALID';\n\n\t/**\n\t * Get columns to show in the list table.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @return string[] Array of column titles keyed by their column name.\n\t */\n\tpublic function get_columns() {\n\t\t$columns = array(\n\t\t\t'cb'                => '<input type=\"checkbox\" />',\n\t\t\t'email'             => __( 'Requester' ),\n\t\t\t'status'            => __( 'Status' ),\n\t\t\t'created_timestamp' => __( 'Requested' ),\n\t\t\t'next_steps'        => __( 'Next Steps' ),\n\t\t);\n\t\treturn $columns;\n\t}\n\n\t/**\n\t * Normalize the admin URL to the current page (by request_type).\n\t *\n\t * @since 5.3.0\n\t *\n\t * @return string URL to the current admin page.\n\t */\n\tprotected function get_admin_url() {\n\t\t$pagenow = str_replace( '_', '-', $this->request_type );\n\n\t\tif ( 'remove-personal-data' === $pagenow ) {\n\t\t\t$pagenow = 'erase-personal-data';\n\t\t}\n\n\t\treturn admin_url( $pagenow . '.php' );\n\t}\n\n\t/**\n\t * Get a list of sortable columns.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @return array Default sortable columns.\n\t */\n\tprotected function get_sortable_columns() {\n\t\t/*\n\t\t * The initial sorting is by 'Requested' (post_date) and descending.\n\t\t * With initial sorting, the first click on 'Requested' should be ascending.\n\t\t * With 'Requester' sorting active, the next click on 'Requested' should be descending.\n\t\t */\n\t\t$desc_first = isset( $_GET['orderby'] );\n\n\t\treturn array(\n\t\t\t'email'             => 'requester',\n\t\t\t'created_timestamp' => array( 'requested', $desc_first ),\n\t\t);\n\t}\n\n\t/**\n\t * Default primary column.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @return string Default primary column name.\n\t */\n\tprotected function get_default_primary_column_name() {\n\t\treturn 'email';\n\t}\n\n\t/**\n\t * Count number of requests for each status.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @return object Number of posts for each status.\n\t */\n\tprotected function get_request_counts() {\n\t\tglobal $wpdb;\n\n\t\t$cache_key = $this->post_type . '-' . $this->request_type;\n\t\t$counts    = wp_cache_get( $cache_key, 'counts' );\n\n\t\tif ( false !== $counts ) {\n\t\t\treturn $counts;\n\t\t}\n\n\t\t$query = \"\n\t\t\tSELECT post_status, COUNT( * ) AS num_posts\n\t\t\tFROM {$wpdb->posts}\n\t\t\tWHERE post_type = %s\n\t\t\tAND post_name = %s\n\t\t\tGROUP BY post_status\";\n\n\t\t$results = (array) $wpdb->get_results( $wpdb->prepare( $query, $this->post_type, $this->request_type ), ARRAY_A );\n\t\t$counts  = array_fill_keys( get_post_stati(), 0 );\n\n\t\tforeach ( $results as $row ) {\n\t\t\t$counts[ $row['post_status'] ] = $row['num_posts'];\n\t\t}\n\n\t\t$counts = (object) $counts;\n\t\twp_cache_set( $cache_key, $counts, 'counts' );\n\n\t\treturn $counts;\n\t}\n\n\t/**\n\t * Get an associative array ( id => link ) with the list of views available on this table.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @return string[] An array of HTML links keyed by their view.\n\t */\n\tprotected function get_views() {\n\t\t$current_status = isset( $_REQUEST['filter-status'] ) ? sanitize_text_field( $_REQUEST['filter-status'] ) : '';\n\t\t$statuses       = _wp_privacy_statuses();\n\t\t$views          = array();\n\t\t$counts         = $this->get_request_counts();\n\t\t$total_requests = absint( array_sum( (array) $counts ) );\n\n\t\t// Normalized admin URL.\n\t\t$admin_url = $this->get_admin_url();\n\n\t\t$current_link_attributes = empty( $current_status ) ? ' class=\"current\" aria-current=\"page\"' : '';\n\t\t$status_label            = sprintf(\n\t\t\t/* translators: %s: Number of requests. */\n\t\t\t_nx(\n\t\t\t\t'All <span class=\"count\">(%s)</span>',\n\t\t\t\t'All <span class=\"count\">(%s)</span>',\n\t\t\t\t$total_requests,\n\t\t\t\t'requests'\n\t\t\t),\n\t\t\tnumber_format_i18n( $total_requests )\n\t\t);\n\n\t\t$views['all'] = sprintf(\n\t\t\t'<a href=\"%s\"%s>%s</a>',\n\t\t\tesc_url( $admin_url ),\n\t\t\t$current_link_attributes,\n\t\t\t$status_label\n\t\t);\n\n\t\tforeach ( $statuses as $status => $label ) {\n\t\t\t$post_status = get_post_status_object( $status );\n\t\t\tif ( ! $post_status ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$current_link_attributes = $status === $current_status ? ' class=\"current\" aria-current=\"page\"' : '';\n\t\t\t$total_status_requests   = absint( $counts->{$status} );\n\n\t\t\tif ( ! $total_status_requests ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$status_label = sprintf(\n\t\t\t\ttranslate_nooped_plural( $post_status->label_count, $total_status_requests ),\n\t\t\t\tnumber_format_i18n( $total_status_requests )\n\t\t\t);\n\n\t\t\t$status_link = add_query_arg( 'filter-status', $status, $admin_url );\n\n\t\t\t$views[ $status ] = sprintf(\n\t\t\t\t'<a href=\"%s\"%s>%s</a>',\n\t\t\t\tesc_url( $status_link ),\n\t\t\t\t$current_link_attributes,\n\t\t\t\t$status_label\n\t\t\t);\n\t\t}\n\n\t\treturn $views;\n\t}\n\n\t/**\n\t * Get bulk actions.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @return string[] Array of bulk action labels keyed by their action.\n\t */\n\tprotected function get_bulk_actions() {\n\t\treturn array(\n\t\t\t'delete' => __( 'Delete Requests' ),\n\t\t\t'resend' => __( 'Resend Confirmation Requests' ),\n\t\t);\n\t}\n\n\t/**\n\t * Process bulk actions.\n\t *\n\t * @since 4.9.6\n\t */\n\tpublic function process_bulk_action() {\n\t\t$action      = $this->current_action();\n\t\t$request_ids = isset( $_REQUEST['request_id'] ) ? wp_parse_id_list( wp_unslash( $_REQUEST['request_id'] ) ) : array();\n\n\t\t$count = 0;\n\n\t\tif ( $request_ids ) {\n\t\t\tcheck_admin_referer( 'bulk-privacy_requests' );\n\t\t}\n\n\t\tswitch ( $action ) {\n\t\t\tcase 'delete':\n\t\t\t\tforeach ( $request_ids as $request_id ) {\n\t\t\t\t\tif ( wp_delete_post( $request_id, true ) ) {\n\t\t\t\t\t\t$count ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tadd_settings_error(\n\t\t\t\t\t'bulk_action',\n\t\t\t\t\t'bulk_action',\n\t\t\t\t\t/* translators: %d: Number of requests. */\n\t\t\t\t\tsprintf( _n( 'Deleted %d request', 'Deleted %d requests', $count ), $count ),\n\t\t\t\t\t'success'\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'resend':\n\t\t\t\tforeach ( $request_ids as $request_id ) {\n\t\t\t\t\t$resend = _wp_privacy_resend_request( $request_id );\n\n\t\t\t\t\tif ( $resend && ! is_wp_error( $resend ) ) {\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tadd_settings_error(\n\t\t\t\t\t'bulk_action',\n\t\t\t\t\t'bulk_action',\n\t\t\t\t\t/* translators: %d: Number of requests. */\n\t\t\t\t\tsprintf( _n( 'Re-sent %d request', 'Re-sent %d requests', $count ), $count ),\n\t\t\t\t\t'success'\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Prepare items to output.\n\t *\n\t * @since 4.9.6\n\t * @since 5.1.0 Added support for column sorting.\n\t */\n\tpublic function prepare_items() {\n\t\t$this->items    = array();\n\t\t$posts_per_page = $this->get_items_per_page( $this->request_type . '_requests_per_page' );\n\t\t$args           = array(\n\t\t\t'post_type'      => $this->post_type,\n\t\t\t'post_name__in'  => array( $this->request_type ),\n\t\t\t'posts_per_page' => $posts_per_page,\n\t\t\t'offset'         => isset( $_REQUEST['paged'] ) ? max( 0, absint( $_REQUEST['paged'] ) - 1 ) * $posts_per_page : 0,\n\t\t\t'post_status'    => 'any',\n\t\t\t's'              => isset( $_REQUEST['s'] ) ? sanitize_text_field( $_REQUEST['s'] ) : '',\n\t\t);\n\n\t\t$orderby_mapping = array(\n\t\t\t'requester' => 'post_title',\n\t\t\t'requested' => 'post_date',\n\t\t);\n\n\t\tif ( isset( $_REQUEST['orderby'] ) && isset( $orderby_mapping[ $_REQUEST['orderby'] ] ) ) {\n\t\t\t$args['orderby'] = $orderby_mapping[ $_REQUEST['orderby'] ];\n\t\t}\n\n\t\tif ( isset( $_REQUEST['order'] ) && in_array( strtoupper( $_REQUEST['order'] ), array( 'ASC', 'DESC' ), true ) ) {\n\t\t\t$args['order'] = strtoupper( $_REQUEST['order'] );\n\t\t}\n\n\t\tif ( ! empty( $_REQUEST['filter-status'] ) ) {\n\t\t\t$filter_status       = isset( $_REQUEST['filter-status'] ) ? sanitize_text_field( $_REQUEST['filter-status'] ) : '';\n\t\t\t$args['post_status'] = $filter_status;\n\t\t}\n\n\t\t$requests_query = new WP_Query( $args );\n\t\t$requests       = $requests_query->posts;\n\n\t\tforeach ( $requests as $request ) {\n\t\t\t$this->items[] = wp_get_user_request( $request->ID );\n\t\t}\n\n\t\t$this->items = array_filter( $this->items );\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items' => $requests_query->found_posts,\n\t\t\t\t'per_page'    => $posts_per_page,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Checkbox column.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param WP_User_Request $item Item being shown.\n\t * @return string Checkbox column markup.\n\t */\n\tpublic function column_cb( $item ) {\n\t\treturn sprintf( '<input type=\"checkbox\" name=\"request_id[]\" value=\"%1$s\" /><span class=\"spinner\"></span>', esc_attr( $item->ID ) );\n\t}\n\n\t/**\n\t * Status column.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param WP_User_Request $item Item being shown.\n\t * @return string Status column markup.\n\t */\n\tpublic function column_status( $item ) {\n\t\t$status        = get_post_status( $item->ID );\n\t\t$status_object = get_post_status_object( $status );\n\n\t\tif ( ! $status_object || empty( $status_object->label ) ) {\n\t\t\treturn '-';\n\t\t}\n\n\t\t$timestamp = false;\n\n\t\tswitch ( $status ) {\n\t\t\tcase 'request-confirmed':\n\t\t\t\t$timestamp = $item->confirmed_timestamp;\n\t\t\t\tbreak;\n\t\t\tcase 'request-completed':\n\t\t\t\t$timestamp = $item->completed_timestamp;\n\t\t\t\tbreak;\n\t\t}\n\n\t\techo '<span class=\"status-label status-' . esc_attr( $status ) . '\">';\n\t\techo esc_html( $status_object->label );\n\n\t\tif ( $timestamp ) {\n\t\t\techo ' (' . $this->get_timestamp_as_date( $timestamp ) . ')';\n\t\t}\n\n\t\techo '</span>';\n\t}\n\n\t/**\n\t * Convert timestamp for display.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param int $timestamp Event timestamp.\n\t * @return string Human readable date.\n\t */\n\tprotected function get_timestamp_as_date( $timestamp ) {\n\t\tif ( empty( $timestamp ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$time_diff = time() - $timestamp;\n\n\t\tif ( $time_diff >= 0 && $time_diff < DAY_IN_SECONDS ) {\n\t\t\t/* translators: %s: Human-readable time difference. */\n\t\t\treturn sprintf( __( '%s ago' ), human_time_diff( $timestamp ) );\n\t\t}\n\n\t\treturn date_i18n( get_option( 'date_format' ), $timestamp );\n\t}\n\n\t/**\n\t * Default column handler.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param WP_User_Request $item        Item being shown.\n\t * @param string          $column_name Name of column being shown.\n\t * @return string Default column output.\n\t */\n\tpublic function column_default( $item, $column_name ) {\n\t\t$cell_value = $item->$column_name;\n\n\t\tif ( in_array( $column_name, array( 'created_timestamp' ), true ) ) {\n\t\t\treturn $this->get_timestamp_as_date( $cell_value );\n\t\t}\n\n\t\treturn $cell_value;\n\t}\n\n\t/**\n\t * Actions column. Overridden by children.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param WP_User_Request $item Item being shown.\n\t * @return string Email column markup.\n\t */\n\tpublic function column_email( $item ) {\n\t\treturn sprintf( '<a href=\"%1$s\">%2$s</a> %3$s', esc_url( 'mailto:' . $item->email ), $item->email, $this->row_actions( array() ) );\n\t}\n\n\t/**\n\t * Next steps column. Overridden by children.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param WP_User_Request $item Item being shown.\n\t */\n\tpublic function column_next_steps( $item ) {}\n\n\t/**\n\t * Generates content for a single row of the table,\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param WP_User_Request $item The current item.\n\t */\n\tpublic function single_row( $item ) {\n\t\t$status = $item->status;\n\n\t\techo '<tr id=\"request-' . esc_attr( $item->ID ) . '\" class=\"status-' . esc_attr( $status ) . '\">';\n\t\t$this->single_row_columns( $item );\n\t\techo '</tr>';\n\t}\n\n\t/**\n\t * Embed scripts used to perform actions. Overridden by children.\n\t *\n\t * @since 4.9.6\n\t */\n\tpublic function embed_scripts() {}\n}\n", "num_lines": 456}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Screen API: WP_Screen class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement an admin screen API.\n *\n * @since 3.3.0\n */\nfinal class WP_Screen {\n\t/**\n\t * Any action associated with the screen.\n\t *\n\t * 'add' for *-add.php and *-new.php screens. Empty otherwise.\n\t *\n\t * @since 3.3.0\n\t * @var string\n\t */\n\tpublic $action;\n\n\t/**\n\t * The base type of the screen.\n\t *\n\t * This is typically the same as `$id` but with any post types and taxonomies stripped.\n\t * For example, for an `$id` of 'edit-post' the base is 'edit'.\n\t *\n\t * @since 3.3.0\n\t * @var string\n\t */\n\tpublic $base;\n\n\t/**\n\t * The number of columns to display. Access with get_columns().\n\t *\n\t * @since 3.4.0\n\t * @var int\n\t */\n\tprivate $columns = 0;\n\n\t/**\n\t * The unique ID of the screen.\n\t *\n\t * @since 3.3.0\n\t * @var string\n\t */\n\tpublic $id;\n\n\t/**\n\t * Which admin the screen is in. network | user | site | false\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tprotected $in_admin;\n\n\t/**\n\t * Whether the screen is in the network admin.\n\t *\n\t * Deprecated. Use in_admin() instead.\n\t *\n\t * @since 3.3.0\n\t * @deprecated 3.5.0\n\t * @var bool\n\t */\n\tpublic $is_network;\n\n\t/**\n\t * Whether the screen is in the user admin.\n\t *\n\t * Deprecated. Use in_admin() instead.\n\t *\n\t * @since 3.3.0\n\t * @deprecated 3.5.0\n\t * @var bool\n\t */\n\tpublic $is_user;\n\n\t/**\n\t * The base menu parent.\n\t *\n\t * This is derived from `$parent_file` by removing the query string and any .php extension.\n\t * `$parent_file` values of 'edit.php?post_type=page' and 'edit.php?post_type=post'\n\t * have a `$parent_base` of 'edit'.\n\t *\n\t * @since 3.3.0\n\t * @var string\n\t */\n\tpublic $parent_base;\n\n\t/**\n\t * The parent_file for the screen per the admin menu system.\n\t *\n\t * Some `$parent_file` values are 'edit.php?post_type=page', 'edit.php', and 'options-general.php'.\n\t *\n\t * @since 3.3.0\n\t * @var string\n\t */\n\tpublic $parent_file;\n\n\t/**\n\t * The post type associated with the screen, if any.\n\t *\n\t * The 'edit.php?post_type=page' screen has a post type of 'page'.\n\t * The 'edit-tags.php?taxonomy=$taxonomy&post_type=page' screen has a post type of 'page'.\n\t *\n\t * @since 3.3.0\n\t * @var string\n\t */\n\tpublic $post_type;\n\n\t/**\n\t * The taxonomy associated with the screen, if any.\n\t *\n\t * The 'edit-tags.php?taxonomy=category' screen has a taxonomy of 'category'.\n\t *\n\t * @since 3.3.0\n\t * @var string\n\t */\n\tpublic $taxonomy;\n\n\t/**\n\t * The help tab data associated with the screen, if any.\n\t *\n\t * @since 3.3.0\n\t * @var array\n\t */\n\tprivate $_help_tabs = array();\n\n\t/**\n\t * The help sidebar data associated with screen, if any.\n\t *\n\t * @since 3.3.0\n\t * @var string\n\t */\n\tprivate $_help_sidebar = '';\n\n\t/**\n\t * The accessible hidden headings and text associated with the screen, if any.\n\t *\n\t * @since 4.4.0\n\t * @var array\n\t */\n\tprivate $_screen_reader_content = array();\n\n\t/**\n\t * Stores old string-based help.\n\t *\n\t * @var array\n\t */\n\tprivate static $_old_compat_help = array();\n\n\t/**\n\t * The screen options associated with screen, if any.\n\t *\n\t * @since 3.3.0\n\t * @var array\n\t */\n\tprivate $_options = array();\n\n\t/**\n\t * The screen object registry.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @var array\n\t */\n\tprivate static $_registry = array();\n\n\t/**\n\t * Stores the result of the public show_screen_options function.\n\t *\n\t * @since 3.3.0\n\t * @var bool\n\t */\n\tprivate $_show_screen_options;\n\n\t/**\n\t * Stores the 'screen_settings' section of screen options.\n\t *\n\t * @since 3.3.0\n\t * @var string\n\t */\n\tprivate $_screen_settings;\n\n\t/**\n\t * Whether the screen is using the block editor.\n\t *\n\t * @since 5.0.0\n\t * @var bool\n\t */\n\tpublic $is_block_editor = false;\n\n\t/**\n\t * Fetches a screen object.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @global string $hook_suffix\n\t *\n\t * @param string|WP_Screen $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen.\n\t *                                    Defaults to the current $hook_suffix global.\n\t * @return WP_Screen Screen object.\n\t */\n\tpublic static function get( $hook_name = '' ) {\n\t\tif ( $hook_name instanceof WP_Screen ) {\n\t\t\treturn $hook_name;\n\t\t}\n\n\t\t$post_type       = null;\n\t\t$taxonomy        = null;\n\t\t$in_admin        = false;\n\t\t$action          = '';\n\t\t$is_block_editor = false;\n\n\t\tif ( $hook_name ) {\n\t\t\t$id = $hook_name;\n\t\t} else {\n\t\t\t$id = $GLOBALS['hook_suffix'];\n\t\t}\n\n\t\t// For those pesky meta boxes.\n\t\tif ( $hook_name && post_type_exists( $hook_name ) ) {\n\t\t\t$post_type = $id;\n\t\t\t$id        = 'post'; // Changes later. Ends up being $base.\n\t\t} else {\n\t\t\tif ( '.php' === substr( $id, -4 ) ) {\n\t\t\t\t$id = substr( $id, 0, -4 );\n\t\t\t}\n\n\t\t\tif ( in_array( $id, array( 'post-new', 'link-add', 'media-new', 'user-new' ), true ) ) {\n\t\t\t\t$id     = substr( $id, 0, -4 );\n\t\t\t\t$action = 'add';\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $post_type && $hook_name ) {\n\t\t\tif ( '-network' === substr( $id, -8 ) ) {\n\t\t\t\t$id       = substr( $id, 0, -8 );\n\t\t\t\t$in_admin = 'network';\n\t\t\t} elseif ( '-user' === substr( $id, -5 ) ) {\n\t\t\t\t$id       = substr( $id, 0, -5 );\n\t\t\t\t$in_admin = 'user';\n\t\t\t}\n\n\t\t\t$id = sanitize_key( $id );\n\t\t\tif ( 'edit-comments' !== $id && 'edit-tags' !== $id && 'edit-' === substr( $id, 0, 5 ) ) {\n\t\t\t\t$maybe = substr( $id, 5 );\n\t\t\t\tif ( taxonomy_exists( $maybe ) ) {\n\t\t\t\t\t$id       = 'edit-tags';\n\t\t\t\t\t$taxonomy = $maybe;\n\t\t\t\t} elseif ( post_type_exists( $maybe ) ) {\n\t\t\t\t\t$id        = 'edit';\n\t\t\t\t\t$post_type = $maybe;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! $in_admin ) {\n\t\t\t\t$in_admin = 'site';\n\t\t\t}\n\t\t} else {\n\t\t\tif ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN ) {\n\t\t\t\t$in_admin = 'network';\n\t\t\t} elseif ( defined( 'WP_USER_ADMIN' ) && WP_USER_ADMIN ) {\n\t\t\t\t$in_admin = 'user';\n\t\t\t} else {\n\t\t\t\t$in_admin = 'site';\n\t\t\t}\n\t\t}\n\n\t\tif ( 'index' === $id ) {\n\t\t\t$id = 'dashboard';\n\t\t} elseif ( 'front' === $id ) {\n\t\t\t$in_admin = false;\n\t\t}\n\n\t\t$base = $id;\n\n\t\t// If this is the current screen, see if we can be more accurate for post types and taxonomies.\n\t\tif ( ! $hook_name ) {\n\t\t\tif ( isset( $_REQUEST['post_type'] ) ) {\n\t\t\t\t$post_type = post_type_exists( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : false;\n\t\t\t}\n\t\t\tif ( isset( $_REQUEST['taxonomy'] ) ) {\n\t\t\t\t$taxonomy = taxonomy_exists( $_REQUEST['taxonomy'] ) ? $_REQUEST['taxonomy'] : false;\n\t\t\t}\n\n\t\t\tswitch ( $base ) {\n\t\t\t\tcase 'post':\n\t\t\t\t\tif ( isset( $_GET['post'] ) && isset( $_POST['post_ID'] ) && (int) $_GET['post'] !== (int) $_POST['post_ID'] ) {\n\t\t\t\t\t\twp_die( __( 'A post ID mismatch has been detected.' ), __( 'Sorry, you are not allowed to edit this item.' ), 400 );\n\t\t\t\t\t} elseif ( isset( $_GET['post'] ) ) {\n\t\t\t\t\t\t$post_id = (int) $_GET['post'];\n\t\t\t\t\t} elseif ( isset( $_POST['post_ID'] ) ) {\n\t\t\t\t\t\t$post_id = (int) $_POST['post_ID'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post_id = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $post_id ) {\n\t\t\t\t\t\t$post = get_post( $post_id );\n\t\t\t\t\t\tif ( $post ) {\n\t\t\t\t\t\t\t$post_type = $post->post_type;\n\n\t\t\t\t\t\t\t/** This filter is documented in wp-admin/post.php */\n\t\t\t\t\t\t\t$replace_editor = apply_filters( 'replace_editor', false, $post );\n\n\t\t\t\t\t\t\tif ( ! $replace_editor ) {\n\t\t\t\t\t\t\t\t$is_block_editor = use_block_editor_for_post( $post );\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\tbreak;\n\t\t\t\tcase 'edit-tags':\n\t\t\t\tcase 'term':\n\t\t\t\t\tif ( null === $post_type && is_object_in_taxonomy( 'post', $taxonomy ? $taxonomy : 'post_tag' ) ) {\n\t\t\t\t\t\t$post_type = 'post';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'upload':\n\t\t\t\t\t$post_type = 'attachment';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tswitch ( $base ) {\n\t\t\tcase 'post':\n\t\t\t\tif ( null === $post_type ) {\n\t\t\t\t\t$post_type = 'post';\n\t\t\t\t}\n\n\t\t\t\t// When creating a new post, use the default block editor support value for the post type.\n\t\t\t\tif ( empty( $post_id ) ) {\n\t\t\t\t\t$is_block_editor = use_block_editor_for_post_type( $post_type );\n\t\t\t\t}\n\n\t\t\t\t$id = $post_type;\n\t\t\t\tbreak;\n\t\t\tcase 'edit':\n\t\t\t\tif ( null === $post_type ) {\n\t\t\t\t\t$post_type = 'post';\n\t\t\t\t}\n\t\t\t\t$id .= '-' . $post_type;\n\t\t\t\tbreak;\n\t\t\tcase 'edit-tags':\n\t\t\tcase 'term':\n\t\t\t\tif ( null === $taxonomy ) {\n\t\t\t\t\t$taxonomy = 'post_tag';\n\t\t\t\t}\n\t\t\t\t// The edit-tags ID does not contain the post type. Look for it in the request.\n\t\t\t\tif ( null === $post_type ) {\n\t\t\t\t\t$post_type = 'post';\n\t\t\t\t\tif ( isset( $_REQUEST['post_type'] ) && post_type_exists( $_REQUEST['post_type'] ) ) {\n\t\t\t\t\t\t$post_type = $_REQUEST['post_type'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$id = 'edit-' . $taxonomy;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( 'network' === $in_admin ) {\n\t\t\t$id   .= '-network';\n\t\t\t$base .= '-network';\n\t\t} elseif ( 'user' === $in_admin ) {\n\t\t\t$id   .= '-user';\n\t\t\t$base .= '-user';\n\t\t}\n\n\t\tif ( isset( self::$_registry[ $id ] ) ) {\n\t\t\t$screen = self::$_registry[ $id ];\n\t\t\tif ( get_current_screen() === $screen ) {\n\t\t\t\treturn $screen;\n\t\t\t}\n\t\t} else {\n\t\t\t$screen     = new WP_Screen();\n\t\t\t$screen->id = $id;\n\t\t}\n\n\t\t$screen->base            = $base;\n\t\t$screen->action          = $action;\n\t\t$screen->post_type       = (string) $post_type;\n\t\t$screen->taxonomy        = (string) $taxonomy;\n\t\t$screen->is_user         = ( 'user' === $in_admin );\n\t\t$screen->is_network      = ( 'network' === $in_admin );\n\t\t$screen->in_admin        = $in_admin;\n\t\t$screen->is_block_editor = $is_block_editor;\n\n\t\tself::$_registry[ $id ] = $screen;\n\n\t\treturn $screen;\n\t}\n\n\t/**\n\t * Makes the screen object the current screen.\n\t *\n\t * @see set_current_screen()\n\t * @since 3.3.0\n\t *\n\t * @global WP_Screen $current_screen WordPress current screen object.\n\t * @global string    $taxnow\n\t * @global string    $typenow\n\t */\n\tpublic function set_current_screen() {\n\t\tglobal $current_screen, $taxnow, $typenow;\n\t\t$current_screen = $this;\n\t\t$taxnow         = $this->taxonomy;\n\t\t$typenow        = $this->post_type;\n\n\t\t/**\n\t\t * Fires after the current screen has been set.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param WP_Screen $current_screen Current WP_Screen object.\n\t\t */\n\t\tdo_action( 'current_screen', $current_screen );\n\t}\n\n\t/**\n\t * Constructor\n\t *\n\t * @since 3.3.0\n\t */\n\tprivate function __construct() {}\n\n\t/**\n\t * Indicates whether the screen is in a particular admin\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $admin The admin to check against (network | user | site).\n\t *                      If empty any of the three admins will result in true.\n\t * @return bool True if the screen is in the indicated admin, false otherwise.\n\t */\n\tpublic function in_admin( $admin = null ) {\n\t\tif ( empty( $admin ) ) {\n\t\t\treturn (bool) $this->in_admin;\n\t\t}\n\n\t\treturn ( $admin === $this->in_admin );\n\t}\n\n\t/**\n\t * Sets or returns whether the block editor is loading on the current screen.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param bool $set Optional. Sets whether the block editor is loading on the current screen or not.\n\t * @return bool True if the block editor is being loaded, false otherwise.\n\t */\n\tpublic function is_block_editor( $set = null ) {\n\t\tif ( null !== $set ) {\n\t\t\t$this->is_block_editor = (bool) $set;\n\t\t}\n\n\t\treturn $this->is_block_editor;\n\t}\n\n\t/**\n\t * Sets the old string-based contextual help for the screen for backward compatibility.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param WP_Screen $screen A screen object.\n\t * @param string    $help   Help text.\n\t */\n\tpublic static function add_old_compat_help( $screen, $help ) {\n\t\tself::$_old_compat_help[ $screen->id ] = $help;\n\t}\n\n\t/**\n\t * Set the parent information for the screen.\n\t *\n\t * This is called in admin-header.php after the menu parent for the screen has been determined.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $parent_file The parent file of the screen. Typically the $parent_file global.\n\t */\n\tpublic function set_parentage( $parent_file ) {\n\t\t$this->parent_file         = $parent_file;\n\t\tlist( $this->parent_base ) = explode( '?', $parent_file );\n\t\t$this->parent_base         = str_replace( '.php', '', $this->parent_base );\n\t}\n\n\t/**\n\t * Adds an option for the screen.\n\t *\n\t * Call this in template files after admin.php is loaded and before admin-header.php is loaded\n\t * to add screen options.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $option Option ID.\n\t * @param mixed  $args   Option-dependent arguments.\n\t */\n\tpublic function add_option( $option, $args = array() ) {\n\t\t$this->_options[ $option ] = $args;\n\t}\n\n\t/**\n\t * Remove an option from the screen.\n\t *\n\t * @since 3.8.0\n\t *\n\t * @param string $option Option ID.\n\t */\n\tpublic function remove_option( $option ) {\n\t\tunset( $this->_options[ $option ] );\n\t}\n\n\t/**\n\t * Remove all options from the screen.\n\t *\n\t * @since 3.8.0\n\t */\n\tpublic function remove_options() {\n\t\t$this->_options = array();\n\t}\n\n\t/**\n\t * Get the options registered for the screen.\n\t *\n\t * @since 3.8.0\n\t *\n\t * @return array Options with arguments.\n\t */\n\tpublic function get_options() {\n\t\treturn $this->_options;\n\t}\n\n\t/**\n\t * Gets the arguments for an option for the screen.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $option Option name.\n\t * @param string $key    Optional. Specific array key for when the option is an array.\n\t *                       Default false.\n\t * @return string The option value if set, null otherwise.\n\t */\n\tpublic function get_option( $option, $key = false ) {\n\t\tif ( ! isset( $this->_options[ $option ] ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tif ( $key ) {\n\t\t\tif ( isset( $this->_options[ $option ][ $key ] ) ) {\n\t\t\t\treturn $this->_options[ $option ][ $key ];\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\treturn $this->_options[ $option ];\n\t}\n\n\t/**\n\t * Gets the help tabs registered for the screen.\n\t *\n\t * @since 3.4.0\n\t * @since 4.4.0 Help tabs are ordered by their priority.\n\t *\n\t * @return array Help tabs with arguments.\n\t */\n\tpublic function get_help_tabs() {\n\t\t$help_tabs = $this->_help_tabs;\n\n\t\t$priorities = array();\n\t\tforeach ( $help_tabs as $help_tab ) {\n\t\t\tif ( isset( $priorities[ $help_tab['priority'] ] ) ) {\n\t\t\t\t$priorities[ $help_tab['priority'] ][] = $help_tab;\n\t\t\t} else {\n\t\t\t\t$priorities[ $help_tab['priority'] ] = array( $help_tab );\n\t\t\t}\n\t\t}\n\n\t\tksort( $priorities );\n\n\t\t$sorted = array();\n\t\tforeach ( $priorities as $list ) {\n\t\t\tforeach ( $list as $tab ) {\n\t\t\t\t$sorted[ $tab['id'] ] = $tab;\n\t\t\t}\n\t\t}\n\n\t\treturn $sorted;\n\t}\n\n\t/**\n\t * Gets the arguments for a help tab.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $id Help Tab ID.\n\t * @return array Help tab arguments.\n\t */\n\tpublic function get_help_tab( $id ) {\n\t\tif ( ! isset( $this->_help_tabs[ $id ] ) ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $this->_help_tabs[ $id ];\n\t}\n\n\t/**\n\t * Add a help tab to the contextual help for the screen.\n\t *\n\t * Call this on the `load-$pagenow` hook for the relevant screen,\n\t * or fetch the `$current_screen` object, or use get_current_screen()\n\t * and then call the method from the object.\n\t *\n\t * You may need to filter `$current_screen` using an if or switch statement\n\t * to prevent new help tabs from being added to ALL admin screens.\n\t *\n\t * @since 3.3.0\n\t * @since 4.4.0 The `$priority` argument was added.\n\t *\n\t * @param array $args {\n\t *     Array of arguments used to display the help tab.\n\t *\n\t *     @type string   $title    Title for the tab. Default false.\n\t *     @type string   $id       Tab ID. Must be HTML-safe and should be unique for this menu.\n\t *                              It is NOT allowed to contain any empty spaces. Default false.\n\t *     @type string   $content  Optional. Help tab content in plain text or HTML. Default empty string.\n\t *     @type callable $callback Optional. A callback to generate the tab content. Default false.\n\t *     @type int      $priority Optional. The priority of the tab, used for ordering. Default 10.\n\t * }\n\t */\n\tpublic function add_help_tab( $args ) {\n\t\t$defaults = array(\n\t\t\t'title'    => false,\n\t\t\t'id'       => false,\n\t\t\t'content'  => '',\n\t\t\t'callback' => false,\n\t\t\t'priority' => 10,\n\t\t);\n\t\t$args     = wp_parse_args( $args, $defaults );\n\n\t\t$args['id'] = sanitize_html_class( $args['id'] );\n\n\t\t// Ensure we have an ID and title.\n\t\tif ( ! $args['id'] || ! $args['title'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Allows for overriding an existing tab with that ID.\n\t\t$this->_help_tabs[ $args['id'] ] = $args;\n\t}\n\n\t/**\n\t * Removes a help tab from the contextual help for the screen.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $id The help tab ID.\n\t */\n\tpublic function remove_help_tab( $id ) {\n\t\tunset( $this->_help_tabs[ $id ] );\n\t}\n\n\t/**\n\t * Removes all help tabs from the contextual help for the screen.\n\t *\n\t * @since 3.3.0\n\t */\n\tpublic function remove_help_tabs() {\n\t\t$this->_help_tabs = array();\n\t}\n\n\t/**\n\t * Gets the content from a contextual help sidebar.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return string Contents of the help sidebar.\n\t */\n\tpublic function get_help_sidebar() {\n\t\treturn $this->_help_sidebar;\n\t}\n\n\t/**\n\t * Add a sidebar to the contextual help for the screen.\n\t *\n\t * Call this in template files after admin.php is loaded and before admin-header.php is loaded\n\t * to add a sidebar to the contextual help.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $content Sidebar content in plain text or HTML.\n\t */\n\tpublic function set_help_sidebar( $content ) {\n\t\t$this->_help_sidebar = $content;\n\t}\n\n\t/**\n\t * Gets the number of layout columns the user has selected.\n\t *\n\t * The layout_columns option controls the max number and default number of\n\t * columns. This method returns the number of columns within that range selected\n\t * by the user via Screen Options. If no selection has been made, the default\n\t * provisioned in layout_columns is returned. If the screen does not support\n\t * selecting the number of layout columns, 0 is returned.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return int Number of columns to display.\n\t */\n\tpublic function get_columns() {\n\t\treturn $this->columns;\n\t}\n\n\t/**\n\t * Get the accessible hidden headings and text used in the screen.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @see set_screen_reader_content() For more information on the array format.\n\t *\n\t * @return array An associative array of screen reader text strings.\n\t */\n\tpublic function get_screen_reader_content() {\n\t\treturn $this->_screen_reader_content;\n\t}\n\n\t/**\n\t * Get a screen reader text string.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $key Screen reader text array named key.\n\t * @return string Screen reader text string.\n\t */\n\tpublic function get_screen_reader_text( $key ) {\n\t\tif ( ! isset( $this->_screen_reader_content[ $key ] ) ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $this->_screen_reader_content[ $key ];\n\t}\n\n\t/**\n\t * Add accessible hidden headings and text for the screen.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $content {\n\t *     An associative array of screen reader text strings.\n\t *\n\t *     @type string $heading_views      Screen reader text for the filter links heading.\n\t *                                      Default 'Filter items list'.\n\t *     @type string $heading_pagination Screen reader text for the pagination heading.\n\t *                                      Default 'Items list navigation'.\n\t *     @type string $heading_list       Screen reader text for the items list heading.\n\t *                                      Default 'Items list'.\n\t * }\n\t */\n\tpublic function set_screen_reader_content( $content = array() ) {\n\t\t$defaults = array(\n\t\t\t'heading_views'      => __( 'Filter items list' ),\n\t\t\t'heading_pagination' => __( 'Items list navigation' ),\n\t\t\t'heading_list'       => __( 'Items list' ),\n\t\t);\n\t\t$content  = wp_parse_args( $content, $defaults );\n\n\t\t$this->_screen_reader_content = $content;\n\t}\n\n\t/**\n\t * Remove all the accessible hidden headings and text for the screen.\n\t *\n\t * @since 4.4.0\n\t */\n\tpublic function remove_screen_reader_content() {\n\t\t$this->_screen_reader_content = array();\n\t}\n\n\t/**\n\t * Render the screen's help section.\n\t *\n\t * This will trigger the deprecated filters for backward compatibility.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @global string $screen_layout_columns\n\t */\n\tpublic function render_screen_meta() {\n\n\t\t/**\n\t\t * Filters the legacy contextual help list.\n\t\t *\n\t\t * @since 2.7.0\n\t\t * @deprecated 3.3.0 Use {@see get_current_screen()->add_help_tab()} or\n\t\t *                   {@see get_current_screen()->remove_help_tab()} instead.\n\t\t *\n\t\t * @param array     $old_compat_help Old contextual help.\n\t\t * @param WP_Screen $this            Current WP_Screen instance.\n\t\t */\n\t\tself::$_old_compat_help = apply_filters_deprecated(\n\t\t\t'contextual_help_list',\n\t\t\tarray( self::$_old_compat_help, $this ),\n\t\t\t'3.3.0',\n\t\t\t'get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab()'\n\t\t);\n\n\t\t$old_help = isset( self::$_old_compat_help[ $this->id ] ) ? self::$_old_compat_help[ $this->id ] : '';\n\n\t\t/**\n\t\t * Filters the legacy contextual help text.\n\t\t *\n\t\t * @since 2.7.0\n\t\t * @deprecated 3.3.0 Use {@see get_current_screen()->add_help_tab()} or\n\t\t *                   {@see get_current_screen()->remove_help_tab()} instead.\n\t\t *\n\t\t * @param string    $old_help  Help text that appears on the screen.\n\t\t * @param string    $screen_id Screen ID.\n\t\t * @param WP_Screen $this      Current WP_Screen instance.\n\t\t */\n\t\t$old_help = apply_filters_deprecated(\n\t\t\t'contextual_help',\n\t\t\tarray( $old_help, $this->id, $this ),\n\t\t\t'3.3.0',\n\t\t\t'get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab()'\n\t\t);\n\n\t\t// Default help only if there is no old-style block of text and no new-style help tabs.\n\t\tif ( empty( $old_help ) && ! $this->get_help_tabs() ) {\n\n\t\t\t/**\n\t\t\t * Filters the default legacy contextual help text.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t * @deprecated 3.3.0 Use {@see get_current_screen()->add_help_tab()} or\n\t\t\t *                   {@see get_current_screen()->remove_help_tab()} instead.\n\t\t\t *\n\t\t\t * @param string $old_help_default Default contextual help text.\n\t\t\t */\n\t\t\t$default_help = apply_filters_deprecated(\n\t\t\t\t'default_contextual_help',\n\t\t\t\tarray( '' ),\n\t\t\t\t'3.3.0',\n\t\t\t\t'get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab()'\n\t\t\t);\n\t\t\tif ( $default_help ) {\n\t\t\t\t$old_help = '<p>' . $default_help . '</p>';\n\t\t\t}\n\t\t}\n\n\t\tif ( $old_help ) {\n\t\t\t$this->add_help_tab(\n\t\t\t\tarray(\n\t\t\t\t\t'id'      => 'old-contextual-help',\n\t\t\t\t\t'title'   => __( 'Overview' ),\n\t\t\t\t\t'content' => $old_help,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$help_sidebar = $this->get_help_sidebar();\n\n\t\t$help_class = 'hidden';\n\t\tif ( ! $help_sidebar ) {\n\t\t\t$help_class .= ' no-sidebar';\n\t\t}\n\n\t\t// Time to render!\n\t\t?>\n\t\t<div id=\"screen-meta\" class=\"metabox-prefs\">\n\n\t\t\t<div id=\"contextual-help-wrap\" class=\"<?php echo esc_attr( $help_class ); ?>\" tabindex=\"-1\" aria-label=\"<?php esc_attr_e( 'Contextual Help Tab' ); ?>\">\n\t\t\t\t<div id=\"contextual-help-back\"></div>\n\t\t\t\t<div id=\"contextual-help-columns\">\n\t\t\t\t\t<div class=\"contextual-help-tabs\">\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$class = ' class=\"active\"';\n\t\t\t\t\t\tforeach ( $this->get_help_tabs() as $tab ) :\n\t\t\t\t\t\t\t$link_id  = \"tab-link-{$tab['id']}\";\n\t\t\t\t\t\t\t$panel_id = \"tab-panel-{$tab['id']}\";\n\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t<li id=\"<?php echo esc_attr( $link_id ); ?>\"<?php echo $class; ?>>\n\t\t\t\t\t\t\t\t<a href=\"<?php echo esc_url( \"#$panel_id\" ); ?>\" aria-controls=\"<?php echo esc_attr( $panel_id ); ?>\">\n\t\t\t\t\t\t\t\t\t<?php echo esc_html( $tab['title'] ); ?>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$class = '';\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<?php if ( $help_sidebar ) : ?>\n\t\t\t\t\t<div class=\"contextual-help-sidebar\">\n\t\t\t\t\t\t<?php echo $help_sidebar; ?>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t<div class=\"contextual-help-tabs-wrap\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$classes = 'help-tab-content active';\n\t\t\t\t\t\tforeach ( $this->get_help_tabs() as $tab ) :\n\t\t\t\t\t\t\t$panel_id = \"tab-panel-{$tab['id']}\";\n\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t<div id=\"<?php echo esc_attr( $panel_id ); ?>\" class=\"<?php echo $classes; ?>\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t// Print tab content.\n\t\t\t\t\t\t\t\techo $tab['content'];\n\n\t\t\t\t\t\t\t\t// If it exists, fire tab callback.\n\t\t\t\t\t\t\t\tif ( ! empty( $tab['callback'] ) ) {\n\t\t\t\t\t\t\t\t\tcall_user_func_array( $tab['callback'], array( $this, $tab ) );\n\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\t<?php\n\t\t\t\t\t\t\t$classes = 'help-tab-content';\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t?>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<?php\n\t\t// Setup layout columns.\n\n\t\t/**\n\t\t * Filters the array of screen layout columns.\n\t\t *\n\t\t * This hook provides back-compat for plugins using the back-compat\n\t\t * Filters instead of add_screen_option().\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param array     $empty_columns Empty array.\n\t\t * @param string    $screen_id     Screen ID.\n\t\t * @param WP_Screen $this          Current WP_Screen instance.\n\t\t */\n\t\t$columns = apply_filters( 'screen_layout_columns', array(), $this->id, $this );\n\n\t\tif ( ! empty( $columns ) && isset( $columns[ $this->id ] ) ) {\n\t\t\t$this->add_option( 'layout_columns', array( 'max' => $columns[ $this->id ] ) );\n\t\t}\n\n\t\tif ( $this->get_option( 'layout_columns' ) ) {\n\t\t\t$this->columns = (int) get_user_option( \"screen_layout_$this->id\" );\n\n\t\t\tif ( ! $this->columns && $this->get_option( 'layout_columns', 'default' ) ) {\n\t\t\t\t$this->columns = $this->get_option( 'layout_columns', 'default' );\n\t\t\t}\n\t\t}\n\t\t$GLOBALS['screen_layout_columns'] = $this->columns; // Set the global for back-compat.\n\n\t\t// Add screen options.\n\t\tif ( $this->show_screen_options() ) {\n\t\t\t$this->render_screen_options();\n\t\t}\n\t\t?>\n\t\t</div>\n\t\t<?php\n\t\tif ( ! $this->get_help_tabs() && ! $this->show_screen_options() ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<div id=\"screen-meta-links\">\n\t\t<?php if ( $this->show_screen_options() ) : ?>\n\t\t\t<div id=\"screen-options-link-wrap\" class=\"hide-if-no-js screen-meta-toggle\">\n\t\t\t<button type=\"button\" id=\"show-settings-link\" class=\"button show-settings\" aria-controls=\"screen-options-wrap\" aria-expanded=\"false\"><?php _e( 'Screen Options' ); ?></button>\n\t\t\t</div>\n\t\t\t<?php\n\t\tendif;\n\t\tif ( $this->get_help_tabs() ) :\n\t\t\t?>\n\t\t\t<div id=\"contextual-help-link-wrap\" class=\"hide-if-no-js screen-meta-toggle\">\n\t\t\t<button type=\"button\" id=\"contextual-help-link\" class=\"button show-settings\" aria-controls=\"contextual-help-wrap\" aria-expanded=\"false\"><?php _e( 'Help' ); ?></button>\n\t\t\t</div>\n\t\t<?php endif; ?>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * @global array $wp_meta_boxes\n\t *\n\t * @return bool\n\t */\n\tpublic function show_screen_options() {\n\t\tglobal $wp_meta_boxes;\n\n\t\tif ( is_bool( $this->_show_screen_options ) ) {\n\t\t\treturn $this->_show_screen_options;\n\t\t}\n\n\t\t$columns = get_column_headers( $this );\n\n\t\t$show_screen = ! empty( $wp_meta_boxes[ $this->id ] ) || $columns || $this->get_option( 'per_page' );\n\n\t\t$this->_screen_settings = '';\n\n\t\tif ( 'post' === $this->base ) {\n\t\t\t$expand                 = '<fieldset class=\"editor-expand hidden\"><legend>' . __( 'Additional settings' ) . '</legend><label for=\"editor-expand-toggle\">';\n\t\t\t$expand                .= '<input type=\"checkbox\" id=\"editor-expand-toggle\"' . checked( get_user_setting( 'editor_expand', 'on' ), 'on', false ) . ' />';\n\t\t\t$expand                .= __( 'Enable full-height editor and distraction-free functionality.' ) . '</label></fieldset>';\n\t\t\t$this->_screen_settings = $expand;\n\t\t}\n\n\t\t/**\n\t\t * Filters the screen settings text displayed in the Screen Options tab.\n\t\t *\n\t\t * This filter is currently only used on the Widgets screen to enable\n\t\t * accessibility mode.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string    $screen_settings Screen settings.\n\t\t * @param WP_Screen $this            WP_Screen object.\n\t\t */\n\t\t$this->_screen_settings = apply_filters( 'screen_settings', $this->_screen_settings, $this );\n\n\t\tif ( $this->_screen_settings || $this->_options ) {\n\t\t\t$show_screen = true;\n\t\t}\n\n\t\t/**\n\t\t * Filters whether to show the Screen Options tab.\n\t\t *\n\t\t * @since 3.2.0\n\t\t *\n\t\t * @param bool      $show_screen Whether to show Screen Options tab.\n\t\t *                               Default true.\n\t\t * @param WP_Screen $this        Current WP_Screen instance.\n\t\t */\n\t\t$this->_show_screen_options = apply_filters( 'screen_options_show_screen', $show_screen, $this );\n\t\treturn $this->_show_screen_options;\n\t}\n\n\t/**\n\t * Render the screen options tab.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param array $options {\n\t *     Options for the tab.\n\t *\n\t *     @type bool $wrap Whether the screen-options-wrap div will be included. Defaults to true.\n\t * }\n\t */\n\tpublic function render_screen_options( $options = array() ) {\n\t\t$options = wp_parse_args(\n\t\t\t$options,\n\t\t\tarray(\n\t\t\t\t'wrap' => true,\n\t\t\t)\n\t\t);\n\n\t\t$wrapper_start = '';\n\t\t$wrapper_end   = '';\n\t\t$form_start    = '';\n\t\t$form_end      = '';\n\n\t\t// Output optional wrapper.\n\t\tif ( $options['wrap'] ) {\n\t\t\t$wrapper_start = '<div id=\"screen-options-wrap\" class=\"hidden\" tabindex=\"-1\" aria-label=\"' . esc_attr__( 'Screen Options Tab' ) . '\">';\n\t\t\t$wrapper_end   = '</div>';\n\t\t}\n\n\t\t// Don't output the form and nonce for the widgets accessibility mode links.\n\t\tif ( 'widgets' !== $this->base ) {\n\t\t\t$form_start = \"\\n<form id='adv-settings' method='post'>\\n\";\n\t\t\t$form_end   = \"\\n\" . wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false, false ) . \"\\n</form>\\n\";\n\t\t}\n\n\t\techo $wrapper_start . $form_start;\n\n\t\t$this->render_meta_boxes_preferences();\n\t\t$this->render_list_table_columns_preferences();\n\t\t$this->render_screen_layout();\n\t\t$this->render_per_page_options();\n\t\t$this->render_view_mode();\n\t\techo $this->_screen_settings;\n\n\t\t/**\n\t\t * Filters whether to show the Screen Options submit button.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param bool      $show_button Whether to show Screen Options submit button.\n\t\t *                               Default false.\n\t\t * @param WP_Screen $this        Current WP_Screen instance.\n\t\t */\n\t\t$show_button = apply_filters( 'screen_options_show_submit', false, $this );\n\n\t\tif ( $show_button ) {\n\t\t\tsubmit_button( __( 'Apply' ), 'primary', 'screen-options-apply', true );\n\t\t}\n\n\t\techo $form_end . $wrapper_end;\n\t}\n\n\t/**\n\t * Render the meta boxes preferences.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @global array $wp_meta_boxes\n\t */\n\tpublic function render_meta_boxes_preferences() {\n\t\tglobal $wp_meta_boxes;\n\n\t\tif ( ! isset( $wp_meta_boxes[ $this->id ] ) ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<fieldset class=\"metabox-prefs\">\n\t\t<legend><?php _e( 'Boxes' ); ?></legend>\n\t\t<?php\n\t\t\tmeta_box_prefs( $this );\n\n\t\tif ( 'dashboard' === $this->id && has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) {\n\t\t\tif ( isset( $_GET['welcome'] ) ) {\n\t\t\t\t$welcome_checked = empty( $_GET['welcome'] ) ? 0 : 1;\n\t\t\t\tupdate_user_meta( get_current_user_id(), 'show_welcome_panel', $welcome_checked );\n\t\t\t} else {\n\t\t\t\t$welcome_checked = (int) get_user_meta( get_current_user_id(), 'show_welcome_panel', true );\n\t\t\t\tif ( 2 === $welcome_checked && wp_get_current_user()->user_email !== get_option( 'admin_email' ) ) {\n\t\t\t\t\t$welcome_checked = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\techo '<label for=\"wp_welcome_panel-hide\">';\n\t\t\techo '<input type=\"checkbox\" id=\"wp_welcome_panel-hide\"' . checked( (bool) $welcome_checked, true, false ) . ' />';\n\t\t\techo _x( 'Welcome', 'Welcome panel' ) . \"</label>\\n\";\n\t\t}\n\t\t?>\n\t\t</fieldset>\n\t\t<?php\n\t}\n\n\t/**\n\t * Render the list table columns preferences.\n\t *\n\t * @since 4.4.0\n\t */\n\tpublic function render_list_table_columns_preferences() {\n\n\t\t$columns = get_column_headers( $this );\n\t\t$hidden  = get_hidden_columns( $this );\n\n\t\tif ( ! $columns ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$legend = ! empty( $columns['_title'] ) ? $columns['_title'] : __( 'Columns' );\n\t\t?>\n\t\t<fieldset class=\"metabox-prefs\">\n\t\t<legend><?php echo $legend; ?></legend>\n\t\t<?php\n\t\t$special = array( '_title', 'cb', 'comment', 'media', 'name', 'title', 'username', 'blogname' );\n\n\t\tforeach ( $columns as $column => $title ) {\n\t\t\t// Can't hide these for they are special.\n\t\t\tif ( in_array( $column, $special, true ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( empty( $title ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * The Comments column uses HTML in the display name with some screen\n\t\t\t * reader text. Make sure to strip tags from the Comments column\n\t\t\t * title and any other custom column title plugins might add.\n\t\t\t */\n\t\t\t$title = wp_strip_all_tags( $title );\n\n\t\t\t$id = \"$column-hide\";\n\t\t\techo '<label>';\n\t\t\techo '<input class=\"hide-column-tog\" name=\"' . $id . '\" type=\"checkbox\" id=\"' . $id . '\" value=\"' . $column . '\"' . checked( ! in_array( $column, $hidden, true ), true, false ) . ' />';\n\t\t\techo \"$title</label>\\n\";\n\t\t}\n\t\t?>\n\t\t</fieldset>\n\t\t<?php\n\t}\n\n\t/**\n\t * Render the option for number of columns on the page\n\t *\n\t * @since 3.3.0\n\t */\n\tpublic function render_screen_layout() {\n\t\tif ( ! $this->get_option( 'layout_columns' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$screen_layout_columns = $this->get_columns();\n\t\t$num                   = $this->get_option( 'layout_columns', 'max' );\n\n\t\t?>\n\t\t<fieldset class='columns-prefs'>\n\t\t<legend class=\"screen-layout\"><?php _e( 'Layout' ); ?></legend>\n\t\t<?php for ( $i = 1; $i <= $num; ++$i ) : ?>\n\t\t\t<label class=\"columns-prefs-<?php echo $i; ?>\">\n\t\t\t<input type='radio' name='screen_columns' value='<?php echo esc_attr( $i ); ?>' <?php checked( $screen_layout_columns, $i ); ?> />\n\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: Number of columns on the page. */\n\t\t\t\t\t_n( '%s column', '%s columns', $i ),\n\t\t\t\t\tnumber_format_i18n( $i )\n\t\t\t\t);\n\t\t\t?>\n\t\t\t</label>\n\t\t<?php endfor; ?>\n\t\t</fieldset>\n\t\t<?php\n\t}\n\n\t/**\n\t * Render the items per page option\n\t *\n\t * @since 3.3.0\n\t */\n\tpublic function render_per_page_options() {\n\t\tif ( null === $this->get_option( 'per_page' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$per_page_label = $this->get_option( 'per_page', 'label' );\n\t\tif ( null === $per_page_label ) {\n\t\t\t$per_page_label = __( 'Number of items per page:' );\n\t\t}\n\n\t\t$option = $this->get_option( 'per_page', 'option' );\n\t\tif ( ! $option ) {\n\t\t\t$option = str_replace( '-', '_', \"{$this->id}_per_page\" );\n\t\t}\n\n\t\t$per_page = (int) get_user_option( $option );\n\t\tif ( empty( $per_page ) || $per_page < 1 ) {\n\t\t\t$per_page = $this->get_option( 'per_page', 'default' );\n\t\t\tif ( ! $per_page ) {\n\t\t\t\t$per_page = 20;\n\t\t\t}\n\t\t}\n\n\t\tif ( 'edit_comments_per_page' === $option ) {\n\t\t\t$comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';\n\n\t\t\t/** This filter is documented in wp-admin/includes/class-wp-comments-list-table.php */\n\t\t\t$per_page = apply_filters( 'comments_per_page', $per_page, $comment_status );\n\t\t} elseif ( 'categories_per_page' === $option ) {\n\t\t\t/** This filter is documented in wp-admin/includes/class-wp-terms-list-table.php */\n\t\t\t$per_page = apply_filters( 'edit_categories_per_page', $per_page );\n\t\t} else {\n\t\t\t/** This filter is documented in wp-admin/includes/class-wp-list-table.php */\n\t\t\t$per_page = apply_filters( \"{$option}\", $per_page );\n\t\t}\n\n\t\t// Back compat.\n\t\tif ( isset( $this->post_type ) ) {\n\t\t\t/** This filter is documented in wp-admin/includes/post.php */\n\t\t\t$per_page = apply_filters( 'edit_posts_per_page', $per_page, $this->post_type );\n\t\t}\n\n\t\t// This needs a submit button.\n\t\tadd_filter( 'screen_options_show_submit', '__return_true' );\n\n\t\t?>\n\t\t<fieldset class=\"screen-options\">\n\t\t<legend><?php _e( 'Pagination' ); ?></legend>\n\t\t\t<?php if ( $per_page_label ) : ?>\n\t\t\t\t<label for=\"<?php echo esc_attr( $option ); ?>\"><?php echo $per_page_label; ?></label>\n\t\t\t\t<input type=\"number\" step=\"1\" min=\"1\" max=\"999\" class=\"screen-per-page\" name=\"wp_screen_options[value]\"\n\t\t\t\t\tid=\"<?php echo esc_attr( $option ); ?>\" maxlength=\"3\"\n\t\t\t\t\tvalue=\"<?php echo esc_attr( $per_page ); ?>\" />\n\t\t\t<?php endif; ?>\n\t\t\t\t<input type=\"hidden\" name=\"wp_screen_options[option]\" value=\"<?php echo esc_attr( $option ); ?>\" />\n\t\t</fieldset>\n\t\t<?php\n\t}\n\n\t/**\n\t * Render the list table view mode preferences.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @global string $mode List table view mode.\n\t */\n\tpublic function render_view_mode() {\n\t\tglobal $mode;\n\n\t\t$screen = get_current_screen();\n\n\t\t// Currently only enabled for posts and comments lists.\n\t\tif ( 'edit' !== $screen->base && 'edit-comments' !== $screen->base ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$view_mode_post_types = get_post_types( array( 'show_ui' => true ) );\n\n\t\t/**\n\t\t * Filters the post types that have different view mode options.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string[] $view_mode_post_types Array of post types that can change view modes.\n\t\t *                                       Default post types with show_ui on.\n\t\t */\n\t\t$view_mode_post_types = apply_filters( 'view_mode_post_types', $view_mode_post_types );\n\n\t\tif ( 'edit' === $screen->base && ! in_array( $this->post_type, $view_mode_post_types, true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! isset( $mode ) ) {\n\t\t\t$mode = get_user_setting( 'posts_list_mode', 'list' );\n\t\t}\n\n\t\t// This needs a submit button.\n\t\tadd_filter( 'screen_options_show_submit', '__return_true' );\n\t\t?>\n\t\t<fieldset class=\"metabox-prefs view-mode\">\n\t\t\t<legend><?php _e( 'View mode' ); ?></legend>\n\t\t\t<label for=\"list-view-mode\">\n\t\t\t\t<input id=\"list-view-mode\" type=\"radio\" name=\"mode\" value=\"list\" <?php checked( 'list', $mode ); ?> />\n\t\t\t\t<?php _e( 'Compact view' ); ?>\n\t\t\t</label>\n\t\t\t<label for=\"excerpt-view-mode\">\n\t\t\t\t<input id=\"excerpt-view-mode\" type=\"radio\" name=\"mode\" value=\"excerpt\" <?php checked( 'excerpt', $mode ); ?> />\n\t\t\t\t<?php _e( 'Extended view' ); ?>\n\t\t\t</label>\n\t\t</fieldset>\n\t\t<?php\n\t}\n\n\t/**\n\t * Render screen reader text.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $key The screen reader text array named key.\n\t * @param string $tag Optional. The HTML tag to wrap the screen reader text. Default h2.\n\t */\n\tpublic function render_screen_reader_content( $key = '', $tag = 'h2' ) {\n\n\t\tif ( ! isset( $this->_screen_reader_content[ $key ] ) ) {\n\t\t\treturn;\n\t\t}\n\t\techo \"<$tag class='screen-reader-text'>\" . $this->_screen_reader_content[ $key ] . \"</$tag>\";\n\t}\n}\n", "num_lines": 1353}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Class for testing automatic updates in the WordPress code.\n *\n * @package WordPress\n * @subpackage Site_Health\n * @since 5.2.0\n */\n\nclass WP_Site_Health_Auto_Updates {\n\t/**\n\t * WP_Site_Health_Auto_Updates constructor.\n\t *\n\t * @since 5.2.0\n\t */\n\tpublic function __construct() {\n\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\t}\n\n\n\t/**\n\t * Run tests to determine if auto-updates can run.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function run_tests() {\n\t\t$tests = array(\n\t\t\t$this->test_constants( 'WP_AUTO_UPDATE_CORE', array( true, 'minor' ) ),\n\t\t\t$this->test_wp_version_check_attached(),\n\t\t\t$this->test_filters_automatic_updater_disabled(),\n\t\t\t$this->test_wp_automatic_updates_disabled(),\n\t\t\t$this->test_if_failed_update(),\n\t\t\t$this->test_vcs_abspath(),\n\t\t\t$this->test_check_wp_filesystem_method(),\n\t\t\t$this->test_all_files_writable(),\n\t\t\t$this->test_accepts_dev_updates(),\n\t\t\t$this->test_accepts_minor_updates(),\n\t\t);\n\n\t\t$tests = array_filter( $tests );\n\t\t$tests = array_map(\n\t\t\tfunction( $test ) {\n\t\t\t\t$test = (object) $test;\n\n\t\t\t\tif ( empty( $test->severity ) ) {\n\t\t\t\t\t$test->severity = 'warning';\n\t\t\t\t}\n\n\t\t\t\treturn $test;\n\t\t\t},\n\t\t\t$tests\n\t\t);\n\n\t\treturn $tests;\n\t}\n\n\t/**\n\t * Test if auto-updates related constants are set correctly.\n\t *\n\t * @since 5.2.0\n\t * @since 5.5.1 The `$value` parameter can accept an array.\n\t *\n\t * @param string $constant         The name of the constant to check.\n\t * @param bool|string|array $value The value that the constant should be, if set,\n\t *                                 or an array of acceptable values.\n\t * @return array The test results.\n\t */\n\tpublic function test_constants( $constant, $value ) {\n\t\t$acceptable_values = (array) $value;\n\n\t\tif ( defined( $constant ) && ! in_array( constant( $constant ), $acceptable_values, true ) ) {\n\t\t\treturn array(\n\t\t\t\t'description' => sprintf(\n\t\t\t\t\t/* translators: %s: Name of the constant used. */\n\t\t\t\t\t__( 'The %s constant is defined and enabled.' ),\n\t\t\t\t\t\"<code>$constant</code>\"\n\t\t\t\t),\n\t\t\t\t'severity'    => 'fail',\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Check if updates are intercepted by a filter.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function test_wp_version_check_attached() {\n\t\tif ( ! is_main_site() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$cookies = wp_unslash( $_COOKIE );\n\t\t$timeout = 10;\n\t\t$headers = array(\n\t\t\t'Cache-Control' => 'no-cache',\n\t\t);\n\t\t/** This filter is documented in wp-includes/class-wp-http-streams.php */\n\t\t$sslverify = apply_filters( 'https_local_ssl_verify', false );\n\n\t\t// Include Basic auth in loopback requests.\n\t\tif ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {\n\t\t\t$headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) );\n\t\t}\n\n\t\t$url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'health-check-test-wp_version_check' => true,\n\t\t\t),\n\t\t\tadmin_url( 'site-health.php' )\n\t\t);\n\n\t\t$test = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) );\n\n\t\tif ( is_wp_error( $test ) ) {\n\t\t\treturn array(\n\t\t\t\t'description' => sprintf(\n\t\t\t\t\t/* translators: %s: Name of the filter used. */\n\t\t\t\t\t__( 'Could not confirm that the %s filter is available.' ),\n\t\t\t\t\t'<code>wp_version_check()</code>'\n\t\t\t\t),\n\t\t\t\t'severity'    => 'warning',\n\t\t\t);\n\t\t}\n\n\t\t$response = wp_remote_retrieve_body( $test );\n\n\t\tif ( 'yes' !== $response ) {\n\t\t\treturn array(\n\t\t\t\t'description' => sprintf(\n\t\t\t\t\t/* translators: %s: Name of the filter used. */\n\t\t\t\t\t__( 'A plugin has prevented updates by disabling %s.' ),\n\t\t\t\t\t'<code>wp_version_check()</code>'\n\t\t\t\t),\n\t\t\t\t'severity'    => 'fail',\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Check if automatic updates are disabled by a filter.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function test_filters_automatic_updater_disabled() {\n\t\t/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */\n\t\tif ( apply_filters( 'automatic_updater_disabled', false ) ) {\n\t\t\treturn array(\n\t\t\t\t'description' => sprintf(\n\t\t\t\t\t/* translators: %s: Name of the filter used. */\n\t\t\t\t\t__( 'The %s filter is enabled.' ),\n\t\t\t\t\t'<code>automatic_updater_disabled</code>'\n\t\t\t\t),\n\t\t\t\t'severity'    => 'fail',\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Check if automatic updates are disabled.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @return array|bool The test results. False if auto-updates are enabled.\n\t */\n\tpublic function test_wp_automatic_updates_disabled() {\n\t\tif ( ! class_exists( 'WP_Automatic_Updater' ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-automatic-updater.php';\n\t\t}\n\n\t\t$auto_updates = new WP_Automatic_Updater();\n\n\t\tif ( ! $auto_updates->is_disabled() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn array(\n\t\t\t'description' => __( 'All automatic updates are disabled.' ),\n\t\t\t'severity'    => 'fail',\n\t\t);\n\t}\n\n\t/**\n\t * Check if automatic updates have tried to run, but failed, previously.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array|bool The test results. False if the auto-updates failed.\n\t */\n\tfunction test_if_failed_update() {\n\t\t$failed = get_site_option( 'auto_core_update_failed' );\n\n\t\tif ( ! $failed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! empty( $failed['critical'] ) ) {\n\t\t\t$description  = __( 'A previous automatic background update ended with a critical failure, so updates are now disabled.' );\n\t\t\t$description .= ' ' . __( 'You would have received an email because of this.' );\n\t\t\t$description .= ' ' . __( \"When you've been able to update using the \\\"Update Now\\\" button on Dashboard > Updates, we'll clear this error for future update attempts.\" );\n\t\t\t$description .= ' ' . sprintf(\n\t\t\t\t/* translators: %s: Code of error shown. */\n\t\t\t\t__( 'The error code was %s.' ),\n\t\t\t\t'<code>' . $failed['error_code'] . '</code>'\n\t\t\t);\n\t\t\treturn array(\n\t\t\t\t'description' => $description,\n\t\t\t\t'severity'    => 'warning',\n\t\t\t);\n\t\t}\n\n\t\t$description = __( 'A previous automatic background update could not occur.' );\n\t\tif ( empty( $failed['retry'] ) ) {\n\t\t\t$description .= ' ' . __( 'You would have received an email because of this.' );\n\t\t}\n\n\t\t$description .= ' ' . __( \"We'll try again with the next release.\" );\n\t\t$description .= ' ' . sprintf(\n\t\t\t/* translators: %s: Code of error shown. */\n\t\t\t__( 'The error code was %s.' ),\n\t\t\t'<code>' . $failed['error_code'] . '</code>'\n\t\t);\n\t\treturn array(\n\t\t\t'description' => $description,\n\t\t\t'severity'    => 'warning',\n\t\t);\n\t}\n\n\t/**\n\t * Check if WordPress is controlled by a VCS (Git, Subversion etc).\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function test_vcs_abspath() {\n\t\t$context_dirs = array( ABSPATH );\n\t\t$vcs_dirs     = array( '.svn', '.git', '.hg', '.bzr' );\n\t\t$check_dirs   = array();\n\n\t\tforeach ( $context_dirs as $context_dir ) {\n\t\t\t// Walk up from $context_dir to the root.\n\t\t\tdo {\n\t\t\t\t$check_dirs[] = $context_dir;\n\n\t\t\t\t// Once we've hit '/' or 'C:\\', we need to stop. dirname will keep returning the input here.\n\t\t\t\tif ( dirname( $context_dir ) === $context_dir ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Continue one level at a time.\n\t\t\t} while ( $context_dir = dirname( $context_dir ) );\n\t\t}\n\n\t\t$check_dirs = array_unique( $check_dirs );\n\n\t\t// Search all directories we've found for evidence of version control.\n\t\tforeach ( $vcs_dirs as $vcs_dir ) {\n\t\t\tforeach ( $check_dirs as $check_dir ) {\n\t\t\t\t// phpcs:ignore\n\t\t\t\tif ( $checkout = @is_dir( rtrim( $check_dir, '\\\\/' ) . \"/$vcs_dir\" ) ) {\n\t\t\t\t\tbreak 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */\n\t\tif ( $checkout && ! apply_filters( 'automatic_updates_is_vcs_checkout', true, ABSPATH ) ) {\n\t\t\treturn array(\n\t\t\t\t'description' => sprintf(\n\t\t\t\t\t/* translators: 1: Folder name. 2: Version control directory. 3: Filter name. */\n\t\t\t\t\t__( 'The folder %1$s was detected as being under version control (%2$s), but the %3$s filter is allowing updates.' ),\n\t\t\t\t\t'<code>' . $check_dir . '</code>',\n\t\t\t\t\t\"<code>$vcs_dir</code>\",\n\t\t\t\t\t'<code>automatic_updates_is_vcs_checkout</code>'\n\t\t\t\t),\n\t\t\t\t'severity'    => 'info',\n\t\t\t);\n\t\t}\n\n\t\tif ( $checkout ) {\n\t\t\treturn array(\n\t\t\t\t'description' => sprintf(\n\t\t\t\t\t/* translators: 1: Folder name. 2: Version control directory. */\n\t\t\t\t\t__( 'The folder %1$s was detected as being under version control (%2$s).' ),\n\t\t\t\t\t'<code>' . $check_dir . '</code>',\n\t\t\t\t\t\"<code>$vcs_dir</code>\"\n\t\t\t\t),\n\t\t\t\t'severity'    => 'warning',\n\t\t\t);\n\t\t}\n\n\t\treturn array(\n\t\t\t'description' => __( 'No version control systems were detected.' ),\n\t\t\t'severity'    => 'pass',\n\t\t);\n\t}\n\n\t/**\n\t * Check if we can access files without providing credentials.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tfunction test_check_wp_filesystem_method() {\n\t\t$skin    = new Automatic_Upgrader_Skin;\n\t\t$success = $skin->request_filesystem_credentials( false, ABSPATH );\n\n\t\tif ( ! $success ) {\n\t\t\t$description  = __( 'Your installation of WordPress prompts for FTP credentials to perform updates.' );\n\t\t\t$description .= ' ' . __( '(Your site is performing updates over FTP due to file ownership. Talk to your hosting company.)' );\n\n\t\t\treturn array(\n\t\t\t\t'description' => $description,\n\t\t\t\t'severity'    => 'fail',\n\t\t\t);\n\t\t}\n\n\t\treturn array(\n\t\t\t'description' => __( \"Your installation of WordPress doesn't require FTP credentials to perform updates.\" ),\n\t\t\t'severity'    => 'pass',\n\t\t);\n\t}\n\n\t/**\n\t * Check if core files are writable by the web user/group.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n\t *\n\t * @return array|bool The test results. False if they're not writeable.\n\t */\n\tfunction test_all_files_writable() {\n\t\tglobal $wp_filesystem;\n\n\t\trequire ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z\n\n\t\t$skin    = new Automatic_Upgrader_Skin;\n\t\t$success = $skin->request_filesystem_credentials( false, ABSPATH );\n\n\t\tif ( ! $success ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tWP_Filesystem();\n\n\t\tif ( 'direct' !== $wp_filesystem->method ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$checksums = get_core_checksums( $wp_version, 'en_US' );\n\t\t$dev       = ( false !== strpos( $wp_version, '-' ) );\n\t\t// Get the last stable version's files and test against that.\n\t\tif ( ! $checksums && $dev ) {\n\t\t\t$checksums = get_core_checksums( (float) $wp_version - 0.1, 'en_US' );\n\t\t}\n\n\t\t// There aren't always checksums for development releases, so just skip the test if we still can't find any.\n\t\tif ( ! $checksums && $dev ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $checksums ) {\n\t\t\t$description = sprintf(\n\t\t\t\t/* translators: %s: WordPress version. */\n\t\t\t\t__( \"Couldn't retrieve a list of the checksums for WordPress %s.\" ),\n\t\t\t\t$wp_version\n\t\t\t);\n\t\t\t$description .= ' ' . __( 'This could mean that connections are failing to WordPress.org.' );\n\t\t\treturn array(\n\t\t\t\t'description' => $description,\n\t\t\t\t'severity'    => 'warning',\n\t\t\t);\n\t\t}\n\n\t\t$unwritable_files = array();\n\t\tforeach ( array_keys( $checksums ) as $file ) {\n\t\t\tif ( 'wp-content' === substr( $file, 0, 10 ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( ! file_exists( ABSPATH . $file ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( ! is_writable( ABSPATH . $file ) ) {\n\t\t\t\t$unwritable_files[] = $file;\n\t\t\t}\n\t\t}\n\n\t\tif ( $unwritable_files ) {\n\t\t\tif ( count( $unwritable_files ) > 20 ) {\n\t\t\t\t$unwritable_files   = array_slice( $unwritable_files, 0, 20 );\n\t\t\t\t$unwritable_files[] = '...';\n\t\t\t}\n\t\t\treturn array(\n\t\t\t\t'description' => __( 'Some files are not writable by WordPress:' ) . ' <ul><li>' . implode( '</li><li>', $unwritable_files ) . '</li></ul>',\n\t\t\t\t'severity'    => 'fail',\n\t\t\t);\n\t\t} else {\n\t\t\treturn array(\n\t\t\t\t'description' => __( 'All of your WordPress files are writable.' ),\n\t\t\t\t'severity'    => 'pass',\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Check if the install is using a development branch and can use nightly packages.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array|bool The test results. False if it isn't a development version.\n\t */\n\tfunction test_accepts_dev_updates() {\n\t\trequire ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z\n\t\t// Only for dev versions.\n\t\tif ( false === strpos( $wp_version, '-' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( defined( 'WP_AUTO_UPDATE_CORE' ) && ( 'minor' === WP_AUTO_UPDATE_CORE || false === WP_AUTO_UPDATE_CORE ) ) {\n\t\t\treturn array(\n\t\t\t\t'description' => sprintf(\n\t\t\t\t\t/* translators: %s: Name of the constant used. */\n\t\t\t\t\t__( 'WordPress development updates are blocked by the %s constant.' ),\n\t\t\t\t\t'<code>WP_AUTO_UPDATE_CORE</code>'\n\t\t\t\t),\n\t\t\t\t'severity'    => 'fail',\n\t\t\t);\n\t\t}\n\n\t\t/** This filter is documented in wp-admin/includes/class-core-upgrader.php */\n\t\tif ( ! apply_filters( 'allow_dev_auto_core_updates', $wp_version ) ) {\n\t\t\treturn array(\n\t\t\t\t'description' => sprintf(\n\t\t\t\t\t/* translators: %s: Name of the filter used. */\n\t\t\t\t\t__( 'WordPress development updates are blocked by the %s filter.' ),\n\t\t\t\t\t'<code>allow_dev_auto_core_updates</code>'\n\t\t\t\t),\n\t\t\t\t'severity'    => 'fail',\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Check if the site supports automatic minor updates.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tfunction test_accepts_minor_updates() {\n\t\tif ( defined( 'WP_AUTO_UPDATE_CORE' ) && false === WP_AUTO_UPDATE_CORE ) {\n\t\t\treturn array(\n\t\t\t\t'description' => sprintf(\n\t\t\t\t\t/* translators: %s: Name of the constant used. */\n\t\t\t\t\t__( 'WordPress security and maintenance releases are blocked by %s.' ),\n\t\t\t\t\t\"<code>define( 'WP_AUTO_UPDATE_CORE', false );</code>\"\n\t\t\t\t),\n\t\t\t\t'severity'    => 'fail',\n\t\t\t);\n\t\t}\n\n\t\t/** This filter is documented in wp-admin/includes/class-core-upgrader.php */\n\t\tif ( ! apply_filters( 'allow_minor_auto_core_updates', true ) ) {\n\t\t\treturn array(\n\t\t\t\t'description' => sprintf(\n\t\t\t\t\t/* translators: %s: Name of the filter used. */\n\t\t\t\t\t__( 'WordPress security and maintenance releases are blocked by the %s filter.' ),\n\t\t\t\t\t'<code>allow_minor_auto_core_updates</code>'\n\t\t\t\t),\n\t\t\t\t'severity'    => 'fail',\n\t\t\t);\n\t\t}\n\t}\n}\n", "num_lines": 484}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Class for looking up a site's health based on a user's WordPress environment.\n *\n * @package WordPress\n * @subpackage Site_Health\n * @since 5.2.0\n */\n\nclass WP_Site_Health {\n\tprivate static $instance = null;\n\n\tprivate $mysql_min_version_check;\n\tprivate $mysql_rec_version_check;\n\n\tpublic $is_mariadb                           = false;\n\tprivate $mysql_server_version                = '';\n\tprivate $health_check_mysql_required_version = '5.5';\n\tprivate $health_check_mysql_rec_version      = '';\n\n\tpublic $php_memory_limit;\n\n\tpublic $schedules;\n\tpublic $crons;\n\tpublic $last_missed_cron     = null;\n\tpublic $last_late_cron       = null;\n\tprivate $timeout_missed_cron = null;\n\tprivate $timeout_late_cron   = null;\n\n\t/**\n\t * WP_Site_Health constructor.\n\t *\n\t * @since 5.2.0\n\t */\n\tpublic function __construct() {\n\t\t$this->maybe_create_scheduled_event();\n\n\t\t// Save memory limit before it's affected by wp_raise_memory_limit( 'admin' ).\n\t\t$this->php_memory_limit = ini_get( 'memory_limit' );\n\n\t\t$this->timeout_late_cron   = 0;\n\t\t$this->timeout_missed_cron = - 5 * MINUTE_IN_SECONDS;\n\n\t\tif ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) {\n\t\t\t$this->timeout_late_cron   = - 15 * MINUTE_IN_SECONDS;\n\t\t\t$this->timeout_missed_cron = - 1 * HOUR_IN_SECONDS;\n\t\t}\n\n\t\tadd_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );\n\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );\n\t\tadd_action( 'wp_site_health_scheduled_check', array( $this, 'wp_cron_scheduled_check' ) );\n\t}\n\n\t/**\n\t * Return an instance of the WP_Site_Health class, or create one if none exist yet.\n\t *\n\t * @since 5.4.0\n\t *\n\t * @return WP_Site_Health|null\n\t */\n\tpublic static function get_instance() {\n\t\tif ( null === self::$instance ) {\n\t\t\tself::$instance = new WP_Site_Health();\n\t\t}\n\n\t\treturn self::$instance;\n\t}\n\n\t/**\n\t * Enqueues the site health scripts.\n\t *\n\t * @since 5.2.0\n\t */\n\tpublic function enqueue_scripts() {\n\t\t$screen = get_current_screen();\n\t\tif ( 'site-health' !== $screen->id && 'dashboard' !== $screen->id ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$health_check_js_variables = array(\n\t\t\t'screen'      => $screen->id,\n\t\t\t'nonce'       => array(\n\t\t\t\t'site_status'        => wp_create_nonce( 'health-check-site-status' ),\n\t\t\t\t'site_status_result' => wp_create_nonce( 'health-check-site-status-result' ),\n\t\t\t),\n\t\t\t'site_status' => array(\n\t\t\t\t'direct' => array(),\n\t\t\t\t'async'  => array(),\n\t\t\t\t'issues' => array(\n\t\t\t\t\t'good'        => 0,\n\t\t\t\t\t'recommended' => 0,\n\t\t\t\t\t'critical'    => 0,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$issue_counts = get_transient( 'health-check-site-status-result' );\n\n\t\tif ( false !== $issue_counts ) {\n\t\t\t$issue_counts = json_decode( $issue_counts );\n\n\t\t\t$health_check_js_variables['site_status']['issues'] = $issue_counts;\n\t\t}\n\n\t\tif ( 'site-health' === $screen->id && ! isset( $_GET['tab'] ) ) {\n\t\t\t$tests = WP_Site_Health::get_tests();\n\n\t\t\t// Don't run https test on localhost.\n\t\t\tif ( 'localhost' === preg_replace( '|https?://|', '', get_site_url() ) ) {\n\t\t\t\tunset( $tests['direct']['https_status'] );\n\t\t\t}\n\n\t\t\tforeach ( $tests['direct'] as $test ) {\n\t\t\t\tif ( is_string( $test['test'] ) ) {\n\t\t\t\t\t$test_function = sprintf(\n\t\t\t\t\t\t'get_test_%s',\n\t\t\t\t\t\t$test['test']\n\t\t\t\t\t);\n\n\t\t\t\t\tif ( method_exists( $this, $test_function ) && is_callable( array( $this, $test_function ) ) ) {\n\t\t\t\t\t\t$health_check_js_variables['site_status']['direct'][] = $this->perform_test( array( $this, $test_function ) );\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( is_callable( $test['test'] ) ) {\n\t\t\t\t\t$health_check_js_variables['site_status']['direct'][] = $this->perform_test( $test['test'] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ( $tests['async'] as $test ) {\n\t\t\t\tif ( is_string( $test['test'] ) ) {\n\t\t\t\t\t$health_check_js_variables['site_status']['async'][] = array(\n\t\t\t\t\t\t'test'      => $test['test'],\n\t\t\t\t\t\t'completed' => false,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twp_localize_script( 'site-health', 'SiteHealth', $health_check_js_variables );\n\t}\n\n\t/**\n\t * Run a Site Health test directly.\n\t *\n\t * @since 5.4.0\n\t *\n\t * @param callable $callback\n\t * @return mixed|void\n\t */\n\tprivate function perform_test( $callback ) {\n\t\t/**\n\t\t * Filter the output of a finished Site Health test.\n\t\t *\n\t\t * @since 5.3.0\n\t\t *\n\t\t * @param array $test_result {\n\t\t *     An associative array of test result data.\n\t\t *\n\t\t *     @type string $label       A label describing the test, and is used as a header in the output.\n\t\t *     @type string $status      The status of the test, which can be a value of `good`, `recommended` or `critical`.\n\t\t *     @type array  $badge {\n\t\t *         Tests are put into categories which have an associated badge shown, these can be modified and assigned here.\n\t\t *\n\t\t *         @type string $label The test label, for example `Performance`.\n\t\t *         @type string $color Default `blue`. A string representing a color to use for the label.\n\t\t *     }\n\t\t *     @type string $description A more descriptive explanation of what the test looks for, and why it is important for the end user.\n\t\t *     @type string $actions     An action to direct the user to where they can resolve the issue, if one exists.\n\t\t *     @type string $test        The name of the test being ran, used as a reference point.\n\t\t * }\n\t\t */\n\t\treturn apply_filters( 'site_status_test_result', call_user_func( $callback ) );\n\t}\n\n\t/**\n\t * Run the SQL version checks.\n\t *\n\t * These values are used in later tests, but the part of preparing them is more easily managed\n\t * early in the class for ease of access and discovery.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t */\n\tprivate function prepare_sql_data() {\n\t\tglobal $wpdb;\n\n\t\tif ( $wpdb->use_mysqli ) {\n\t\t\t// phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysqli_get_server_info\n\t\t\t$mysql_server_type = mysqli_get_server_info( $wpdb->dbh );\n\t\t} else {\n\t\t\t// phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysql_get_server_info,PHPCompatibility.Extensions.RemovedExtensions.mysql_DeprecatedRemoved\n\t\t\t$mysql_server_type = mysql_get_server_info( $wpdb->dbh );\n\t\t}\n\n\t\t$this->mysql_server_version = $wpdb->get_var( 'SELECT VERSION()' );\n\n\t\t$this->health_check_mysql_rec_version = '5.6';\n\n\t\tif ( stristr( $mysql_server_type, 'mariadb' ) ) {\n\t\t\t$this->is_mariadb                     = true;\n\t\t\t$this->health_check_mysql_rec_version = '10.0';\n\t\t}\n\n\t\t$this->mysql_min_version_check = version_compare( '5.5', $this->mysql_server_version, '<=' );\n\t\t$this->mysql_rec_version_check = version_compare( $this->health_check_mysql_rec_version, $this->mysql_server_version, '<=' );\n\t}\n\n\t/**\n\t * Test if `wp_version_check` is blocked.\n\t *\n\t * It's possible to block updates with the `wp_version_check` filter, but this can't be checked\n\t * during an Ajax call, as the filter is never introduced then.\n\t *\n\t * This filter overrides a standard page request if it's made by an admin through the Ajax call\n\t * with the right query argument to check for this.\n\t *\n\t * @since 5.2.0\n\t */\n\tpublic function check_wp_version_check_exists() {\n\t\tif ( ! is_admin() || ! is_user_logged_in() || ! current_user_can( 'update_core' ) || ! isset( $_GET['health-check-test-wp_version_check'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo ( has_filter( 'wp_version_check', 'wp_version_check' ) ? 'yes' : 'no' );\n\n\t\tdie();\n\t}\n\n\t/**\n\t * Tests for WordPress version and outputs it.\n\t *\n\t * Gives various results depending on what kind of updates are available, if any, to encourage\n\t * the user to install security updates as a priority.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test result.\n\t */\n\tpublic function get_test_wordpress_version() {\n\t\t$result = array(\n\t\t\t'label'       => '',\n\t\t\t'status'      => '',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Performance' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => '',\n\t\t\t'actions'     => '',\n\t\t\t'test'        => 'wordpress_version',\n\t\t);\n\n\t\t$core_current_version = get_bloginfo( 'version' );\n\t\t$core_updates         = get_core_updates();\n\n\t\tif ( ! is_array( $core_updates ) ) {\n\t\t\t$result['status'] = 'recommended';\n\n\t\t\t$result['label'] = sprintf(\n\t\t\t\t/* translators: %s: Your current version of WordPress. */\n\t\t\t\t__( 'WordPress version %s' ),\n\t\t\t\t$core_current_version\n\t\t\t);\n\n\t\t\t$result['description'] = sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'We were unable to check if any new versions of WordPress are available.' )\n\t\t\t);\n\n\t\t\t$result['actions'] = sprintf(\n\t\t\t\t'<a href=\"%s\">%s</a>',\n\t\t\t\tesc_url( admin_url( 'update-core.php?force-check=1' ) ),\n\t\t\t\t__( 'Check for updates manually' )\n\t\t\t);\n\t\t} else {\n\t\t\tforeach ( $core_updates as $core => $update ) {\n\t\t\t\tif ( 'upgrade' === $update->response ) {\n\t\t\t\t\t$current_version = explode( '.', $core_current_version );\n\t\t\t\t\t$new_version     = explode( '.', $update->version );\n\n\t\t\t\t\t$current_major = $current_version[0] . '.' . $current_version[1];\n\t\t\t\t\t$new_major     = $new_version[0] . '.' . $new_version[1];\n\n\t\t\t\t\t$result['label'] = sprintf(\n\t\t\t\t\t\t/* translators: %s: The latest version of WordPress available. */\n\t\t\t\t\t\t__( 'WordPress update available (%s)' ),\n\t\t\t\t\t\t$update->version\n\t\t\t\t\t);\n\n\t\t\t\t\t$result['actions'] = sprintf(\n\t\t\t\t\t\t'<a href=\"%s\">%s</a>',\n\t\t\t\t\t\tesc_url( admin_url( 'update-core.php' ) ),\n\t\t\t\t\t\t__( 'Install the latest version of WordPress' )\n\t\t\t\t\t);\n\n\t\t\t\t\tif ( $current_major !== $new_major ) {\n\t\t\t\t\t\t// This is a major version mismatch.\n\t\t\t\t\t\t$result['status']      = 'recommended';\n\t\t\t\t\t\t$result['description'] = sprintf(\n\t\t\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\t\t\t__( 'A new version of WordPress is available.' )\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// This is a minor version, sometimes considered more critical.\n\t\t\t\t\t\t$result['status']         = 'critical';\n\t\t\t\t\t\t$result['badge']['label'] = __( 'Security' );\n\t\t\t\t\t\t$result['description']    = sprintf(\n\t\t\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\t\t\t__( 'A new minor update is available for your site. Because minor updates often address security, it&#8217;s important to install them.' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$result['status'] = 'good';\n\t\t\t\t\t$result['label']  = sprintf(\n\t\t\t\t\t\t/* translators: %s: The current version of WordPress installed on this site. */\n\t\t\t\t\t\t__( 'Your version of WordPress (%s) is up to date' ),\n\t\t\t\t\t\t$core_current_version\n\t\t\t\t\t);\n\n\t\t\t\t\t$result['description'] = sprintf(\n\t\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\t\t__( 'You are currently running the latest version of WordPress available, keep it up!' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if plugins are outdated, or unnecessary.\n\t *\n\t * The tests checks if your plugins are up to date, and encourages you to remove any\n\t * that are not in use.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test result.\n\t */\n\tpublic function get_test_plugin_version() {\n\t\t$result = array(\n\t\t\t'label'       => __( 'Your plugins are all up to date' ),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Security' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'Plugins extend your site&#8217;s functionality with things like contact forms, ecommerce and much more. That means they have deep access to your site, so it&#8217;s vital to keep them up to date.' )\n\t\t\t),\n\t\t\t'actions'     => sprintf(\n\t\t\t\t'<p><a href=\"%s\">%s</a></p>',\n\t\t\t\tesc_url( admin_url( 'plugins.php' ) ),\n\t\t\t\t__( 'Manage your plugins' )\n\t\t\t),\n\t\t\t'test'        => 'plugin_version',\n\t\t);\n\n\t\t$plugins        = get_plugins();\n\t\t$plugin_updates = get_plugin_updates();\n\n\t\t$plugins_have_updates = false;\n\t\t$plugins_active       = 0;\n\t\t$plugins_total        = 0;\n\t\t$plugins_need_update  = 0;\n\n\t\t// Loop over the available plugins and check their versions and active state.\n\t\tforeach ( $plugins as $plugin_path => $plugin ) {\n\t\t\t$plugins_total++;\n\n\t\t\tif ( is_plugin_active( $plugin_path ) ) {\n\t\t\t\t$plugins_active++;\n\t\t\t}\n\n\t\t\t$plugin_version = $plugin['Version'];\n\n\t\t\tif ( array_key_exists( $plugin_path, $plugin_updates ) ) {\n\t\t\t\t$plugins_need_update++;\n\t\t\t\t$plugins_have_updates = true;\n\t\t\t}\n\t\t}\n\n\t\t// Add a notice if there are outdated plugins.\n\t\tif ( $plugins_need_update > 0 ) {\n\t\t\t$result['status'] = 'critical';\n\n\t\t\t$result['label'] = __( 'You have plugins waiting to be updated' );\n\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %d: The number of outdated plugins. */\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'Your site has %d plugin waiting to be updated.',\n\t\t\t\t\t\t'Your site has %d plugins waiting to be updated.',\n\t\t\t\t\t\t$plugins_need_update\n\t\t\t\t\t),\n\t\t\t\t\t$plugins_need_update\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$result['actions'] .= sprintf(\n\t\t\t\t'<p><a href=\"%s\">%s</a></p>',\n\t\t\t\tesc_url( network_admin_url( 'plugins.php?plugin_status=upgrade' ) ),\n\t\t\t\t__( 'Update your plugins' )\n\t\t\t);\n\t\t} else {\n\t\t\tif ( 1 === $plugins_active ) {\n\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\t__( 'Your site has 1 active plugin, and it is up to date.' )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %d: The number of active plugins. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'Your site has %d active plugin, and it is up to date.',\n\t\t\t\t\t\t\t'Your site has %d active plugins, and they are all up to date.',\n\t\t\t\t\t\t\t$plugins_active\n\t\t\t\t\t\t),\n\t\t\t\t\t\t$plugins_active\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Check if there are inactive plugins.\n\t\tif ( $plugins_total > $plugins_active && ! is_multisite() ) {\n\t\t\t$unused_plugins = $plugins_total - $plugins_active;\n\n\t\t\t$result['status'] = 'recommended';\n\n\t\t\t$result['label'] = __( 'You should remove inactive plugins' );\n\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t'<p>%s %s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %d: The number of inactive plugins. */\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'Your site has %d inactive plugin.',\n\t\t\t\t\t\t'Your site has %d inactive plugins.',\n\t\t\t\t\t\t$unused_plugins\n\t\t\t\t\t),\n\t\t\t\t\t$unused_plugins\n\t\t\t\t),\n\t\t\t\t__( 'Inactive plugins are tempting targets for attackers. If you&#8217;re not going to use a plugin, we recommend you remove it.' )\n\t\t\t);\n\n\t\t\t$result['actions'] .= sprintf(\n\t\t\t\t'<p><a href=\"%s\">%s</a></p>',\n\t\t\t\tesc_url( admin_url( 'plugins.php?plugin_status=inactive' ) ),\n\t\t\t\t__( 'Manage inactive plugins' )\n\t\t\t);\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if themes are outdated, or unnecessary.\n\t *\n\t * \u00d0\u00a1hecks if your site has a default theme (to fall back on if there is a need),\n\t * if your themes are up to date and, finally, encourages you to remove any themes\n\t * that are not needed.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_theme_version() {\n\t\t$result = array(\n\t\t\t'label'       => __( 'Your themes are all up to date' ),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Security' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'Themes add your site&#8217;s look and feel. It&#8217;s important to keep them up to date, to stay consistent with your brand and keep your site secure.' )\n\t\t\t),\n\t\t\t'actions'     => sprintf(\n\t\t\t\t'<p><a href=\"%s\">%s</a></p>',\n\t\t\t\tesc_url( admin_url( 'themes.php' ) ),\n\t\t\t\t__( 'Manage your themes' )\n\t\t\t),\n\t\t\t'test'        => 'theme_version',\n\t\t);\n\n\t\t$theme_updates = get_theme_updates();\n\n\t\t$themes_total        = 0;\n\t\t$themes_need_updates = 0;\n\t\t$themes_inactive     = 0;\n\n\t\t// This value is changed during processing to determine how many themes are considered a reasonable amount.\n\t\t$allowed_theme_count = 1;\n\n\t\t$has_default_theme   = false;\n\t\t$has_unused_themes   = false;\n\t\t$show_unused_themes  = true;\n\t\t$using_default_theme = false;\n\n\t\t// Populate a list of all themes available in the install.\n\t\t$all_themes   = wp_get_themes();\n\t\t$active_theme = wp_get_theme();\n\n\t\t// If WP_DEFAULT_THEME doesn't exist, fall back to the latest core default theme.\n\t\t$default_theme = wp_get_theme( WP_DEFAULT_THEME );\n\t\tif ( ! $default_theme->exists() ) {\n\t\t\t$default_theme = WP_Theme::get_core_default_theme();\n\t\t}\n\n\t\tif ( $default_theme ) {\n\t\t\t$has_default_theme = true;\n\n\t\t\tif (\n\t\t\t\t$active_theme->get_stylesheet() === $default_theme->get_stylesheet()\n\t\t\t||\n\t\t\t\tis_child_theme() && $active_theme->get_template() === $default_theme->get_template()\n\t\t\t) {\n\t\t\t\t$using_default_theme = true;\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $all_themes as $theme_slug => $theme ) {\n\t\t\t$themes_total++;\n\n\t\t\tif ( array_key_exists( $theme_slug, $theme_updates ) ) {\n\t\t\t\t$themes_need_updates++;\n\t\t\t}\n\t\t}\n\n\t\t// If this is a child theme, increase the allowed theme count by one, to account for the parent.\n\t\tif ( is_child_theme() ) {\n\t\t\t$allowed_theme_count++;\n\t\t}\n\n\t\t// If there's a default theme installed and not in use, we count that as allowed as well.\n\t\tif ( $has_default_theme && ! $using_default_theme ) {\n\t\t\t$allowed_theme_count++;\n\t\t}\n\n\t\tif ( $themes_total > $allowed_theme_count ) {\n\t\t\t$has_unused_themes = true;\n\t\t\t$themes_inactive   = ( $themes_total - $allowed_theme_count );\n\t\t}\n\n\t\t// Check if any themes need to be updated.\n\t\tif ( $themes_need_updates > 0 ) {\n\t\t\t$result['status'] = 'critical';\n\n\t\t\t$result['label'] = __( 'You have themes waiting to be updated' );\n\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %d: The number of outdated themes. */\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'Your site has %d theme waiting to be updated.',\n\t\t\t\t\t\t'Your site has %d themes waiting to be updated.',\n\t\t\t\t\t\t$themes_need_updates\n\t\t\t\t\t),\n\t\t\t\t\t$themes_need_updates\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t// Give positive feedback about the site being good about keeping things up to date.\n\t\t\tif ( 1 === $themes_total ) {\n\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\t__( 'Your site has 1 installed theme, and it is up to date.' )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %d: The number of themes. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'Your site has %d installed theme, and it is up to date.',\n\t\t\t\t\t\t\t'Your site has %d installed themes, and they are all up to date.',\n\t\t\t\t\t\t\t$themes_total\n\t\t\t\t\t\t),\n\t\t\t\t\t\t$themes_total\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( $has_unused_themes && $show_unused_themes && ! is_multisite() ) {\n\n\t\t\t// This is a child theme, so we want to be a bit more explicit in our messages.\n\t\t\tif ( $active_theme->parent() ) {\n\t\t\t\t// Recommend removing inactive themes, except a default theme, your current one, and the parent theme.\n\t\t\t\t$result['status'] = 'recommended';\n\n\t\t\t\t$result['label'] = __( 'You should remove inactive themes' );\n\n\t\t\t\tif ( $using_default_theme ) {\n\t\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t\t'<p>%s %s</p>',\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: The number of inactive themes. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'Your site has %d inactive theme.',\n\t\t\t\t\t\t\t\t'Your site has %d inactive themes.',\n\t\t\t\t\t\t\t\t$themes_inactive\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t$themes_inactive\n\t\t\t\t\t\t),\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: 1: The currently active theme. 2: The active theme's parent theme. */\n\t\t\t\t\t\t\t__( 'To enhance your site&#8217;s security, we recommend you remove any themes you&#8217;re not using. You should keep your current theme, %1$s, and %2$s, its parent theme.' ),\n\t\t\t\t\t\t\t$active_theme->name,\n\t\t\t\t\t\t\t$active_theme->parent()->name\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t\t'<p>%s %s</p>',\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: The number of inactive themes. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'Your site has %d inactive theme.',\n\t\t\t\t\t\t\t\t'Your site has %d inactive themes.',\n\t\t\t\t\t\t\t\t$themes_inactive\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t$themes_inactive\n\t\t\t\t\t\t),\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: 1: The default theme for WordPress. 2: The currently active theme. 3: The active theme's parent theme. */\n\t\t\t\t\t\t\t__( 'To enhance your site&#8217;s security, we recommend you remove any themes you&#8217;re not using. You should keep %1$s, the default WordPress theme, %2$s, your current theme, and %3$s, its parent theme.' ),\n\t\t\t\t\t\t\t$default_theme ? $default_theme->name : WP_DEFAULT_THEME,\n\t\t\t\t\t\t\t$active_theme->name,\n\t\t\t\t\t\t\t$active_theme->parent()->name\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Recommend removing all inactive themes.\n\t\t\t\t$result['status'] = 'recommended';\n\n\t\t\t\t$result['label'] = __( 'You should remove inactive themes' );\n\n\t\t\t\tif ( $using_default_theme ) {\n\t\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t\t'<p>%s %s</p>',\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: 1: The amount of inactive themes. 2: The currently active theme. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'Your site has %1$d inactive theme, other than %2$s, your active theme.',\n\t\t\t\t\t\t\t\t'Your site has %1$d inactive themes, other than %2$s, your active theme.',\n\t\t\t\t\t\t\t\t$themes_inactive\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t$themes_inactive,\n\t\t\t\t\t\t\t$active_theme->name\n\t\t\t\t\t\t),\n\t\t\t\t\t\t__( 'We recommend removing any unused themes to enhance your site&#8217;s security.' )\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t\t'<p>%s %s</p>',\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: 1: The amount of inactive themes. 2: The default theme for WordPress. 3: The currently active theme. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'Your site has %1$d inactive theme, other than %2$s, the default WordPress theme, and %3$s, your active theme.',\n\t\t\t\t\t\t\t\t'Your site has %1$d inactive themes, other than %2$s, the default WordPress theme, and %3$s, your active theme.',\n\t\t\t\t\t\t\t\t$themes_inactive\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t$themes_inactive,\n\t\t\t\t\t\t\t$default_theme ? $default_theme->name : WP_DEFAULT_THEME,\n\t\t\t\t\t\t\t$active_theme->name\n\t\t\t\t\t\t),\n\t\t\t\t\t\t__( 'We recommend removing any unused themes to enhance your site&#8217;s security.' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If no default Twenty* theme exists.\n\t\tif ( ! $has_default_theme ) {\n\t\t\t$result['status'] = 'recommended';\n\n\t\t\t$result['label'] = __( 'Have a default theme available' );\n\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'Your site does not have any default theme. Default themes are used by WordPress automatically if anything is wrong with your chosen theme.' )\n\t\t\t);\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if the supplied PHP version is supported.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_php_version() {\n\t\t$response = wp_check_php_version();\n\n\t\t$result = array(\n\t\t\t'label'       => sprintf(\n\t\t\t\t/* translators: %s: The current PHP version. */\n\t\t\t\t__( 'Your site is running the current version of PHP (%s)' ),\n\t\t\t\tPHP_VERSION\n\t\t\t),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Performance' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: The minimum recommended PHP version. */\n\t\t\t\t\t__( 'PHP is the programming language used to build and maintain WordPress. Newer versions of PHP are faster and more secure, so staying up to date will help your site&#8217;s overall performance and security. The minimum recommended version of PHP is %s.' ),\n\t\t\t\t\t$response ? $response['recommended_version'] : ''\n\t\t\t\t)\n\t\t\t),\n\t\t\t'actions'     => sprintf(\n\t\t\t\t'<p><a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">%s <span class=\"screen-reader-text\">%s</span><span aria-hidden=\"true\" class=\"dashicons dashicons-external\"></span></a></p>',\n\t\t\t\tesc_url( wp_get_update_php_url() ),\n\t\t\t\t__( 'Learn more about updating PHP' ),\n\t\t\t\t/* translators: Accessibility text. */\n\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t),\n\t\t\t'test'        => 'php_version',\n\t\t);\n\n\t\t// PHP is up to date.\n\t\tif ( ! $response || version_compare( PHP_VERSION, $response['recommended_version'], '>=' ) ) {\n\t\t\treturn $result;\n\t\t}\n\n\t\t// The PHP version is older than the recommended version, but still receiving active support.\n\t\tif ( $response['is_supported'] ) {\n\t\t\t$result['label'] = sprintf(\n\t\t\t\t/* translators: %s: The server PHP version. */\n\t\t\t\t__( 'Your site is running an older version of PHP (%s)' ),\n\t\t\t\tPHP_VERSION\n\t\t\t);\n\t\t\t$result['status'] = 'recommended';\n\n\t\t\treturn $result;\n\t\t}\n\n\t\t// The PHP version is only receiving security fixes.\n\t\tif ( $response['is_secure'] ) {\n\t\t\t$result['label'] = sprintf(\n\t\t\t\t/* translators: %s: The server PHP version. */\n\t\t\t\t__( 'Your site is running an older version of PHP (%s), which should be updated' ),\n\t\t\t\tPHP_VERSION\n\t\t\t);\n\t\t\t$result['status'] = 'recommended';\n\n\t\t\treturn $result;\n\t\t}\n\n\t\t// Anything no longer secure must be updated.\n\t\t$result['label'] = sprintf(\n\t\t\t/* translators: %s: The server PHP version. */\n\t\t\t__( 'Your site is running an outdated version of PHP (%s), which requires an update' ),\n\t\t\tPHP_VERSION\n\t\t);\n\t\t$result['status']         = 'critical';\n\t\t$result['badge']['label'] = __( 'Security' );\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Check if the passed extension or function are available.\n\t *\n\t * Make the check for available PHP modules into a simple boolean operator for a cleaner test runner.\n\t *\n\t * @since 5.2.0\n\t * @since 5.3.0 The `$constant` and `$class` parameters were added.\n\t *\n\t * @param string $extension Optional. The extension name to test. Default null.\n\t * @param string $function  Optional. The function name to test. Default null.\n\t * @param string $constant  Optional. The constant name to test for. Default null.\n\t * @param string $class     Optional. The class name to test for. Default null.\n\t * @return bool Whether or not the extension and function are available.\n\t */\n\tprivate function test_php_extension_availability( $extension = null, $function = null, $constant = null, $class = null ) {\n\t\t// If no extension or function is passed, claim to fail testing, as we have nothing to test against.\n\t\tif ( ! $extension && ! $function && ! $constant && ! $class ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $extension && ! extension_loaded( $extension ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( $function && ! function_exists( $function ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( $constant && ! defined( $constant ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( $class && ! class_exists( $class ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Test if required PHP modules are installed on the host.\n\t *\n\t * This test builds on the recommendations made by the WordPress Hosting Team\n\t * as seen at https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array\n\t */\n\tpublic function get_test_php_extensions() {\n\t\t$result = array(\n\t\t\t'label'       => __( 'Required and recommended modules are installed' ),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Performance' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p><p>%s</p>',\n\t\t\t\t__( 'PHP modules perform most of the tasks on the server that make your site run. Any changes to these must be made by your server administrator.' ),\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: Link to the hosting group page about recommended PHP modules. 2: Additional link attributes. 3: Accessibility text. */\n\t\t\t\t\t__( 'The WordPress Hosting Team maintains a list of those modules, both recommended and required, in <a href=\"%1$s\" %2$s>the team handbook%3$s</a>.' ),\n\t\t\t\t\t/* translators: Localized team handbook, if one exists. */\n\t\t\t\t\tesc_url( __( 'https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions' ) ),\n\t\t\t\t\t'target=\"_blank\" rel=\"noopener noreferrer\"',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t' <span class=\"screen-reader-text\">%s</span><span aria-hidden=\"true\" class=\"dashicons dashicons-external\"></span>',\n\t\t\t\t\t\t/* translators: Accessibility text. */\n\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'actions'     => '',\n\t\t\t'test'        => 'php_extensions',\n\t\t);\n\n\t\t$modules = array(\n\t\t\t'curl'      => array(\n\t\t\t\t'function' => 'curl_version',\n\t\t\t\t'required' => false,\n\t\t\t),\n\t\t\t'dom'       => array(\n\t\t\t\t'class'    => 'DOMNode',\n\t\t\t\t'required' => false,\n\t\t\t),\n\t\t\t'exif'      => array(\n\t\t\t\t'function' => 'exif_read_data',\n\t\t\t\t'required' => false,\n\t\t\t),\n\t\t\t'fileinfo'  => array(\n\t\t\t\t'function' => 'finfo_file',\n\t\t\t\t'required' => false,\n\t\t\t),\n\t\t\t'hash'      => array(\n\t\t\t\t'function' => 'hash',\n\t\t\t\t'required' => false,\n\t\t\t),\n\t\t\t'json'      => array(\n\t\t\t\t'function' => 'json_last_error',\n\t\t\t\t'required' => true,\n\t\t\t),\n\t\t\t'mbstring'  => array(\n\t\t\t\t'function' => 'mb_check_encoding',\n\t\t\t\t'required' => false,\n\t\t\t),\n\t\t\t'mysqli'    => array(\n\t\t\t\t'function' => 'mysqli_connect',\n\t\t\t\t'required' => false,\n\t\t\t),\n\t\t\t'libsodium' => array(\n\t\t\t\t'constant'            => 'SODIUM_LIBRARY_VERSION',\n\t\t\t\t'required'            => false,\n\t\t\t\t'php_bundled_version' => '7.2.0',\n\t\t\t),\n\t\t\t'openssl'   => array(\n\t\t\t\t'function' => 'openssl_encrypt',\n\t\t\t\t'required' => false,\n\t\t\t),\n\t\t\t'pcre'      => array(\n\t\t\t\t'function' => 'preg_match',\n\t\t\t\t'required' => false,\n\t\t\t),\n\t\t\t'imagick'   => array(\n\t\t\t\t'extension' => 'imagick',\n\t\t\t\t'required'  => false,\n\t\t\t),\n\t\t\t'mod_xml'   => array(\n\t\t\t\t'extension' => 'libxml',\n\t\t\t\t'required'  => false,\n\t\t\t),\n\t\t\t'zip'       => array(\n\t\t\t\t'class'    => 'ZipArchive',\n\t\t\t\t'required' => false,\n\t\t\t),\n\t\t\t'filter'    => array(\n\t\t\t\t'function' => 'filter_list',\n\t\t\t\t'required' => false,\n\t\t\t),\n\t\t\t'gd'        => array(\n\t\t\t\t'extension'    => 'gd',\n\t\t\t\t'required'     => false,\n\t\t\t\t'fallback_for' => 'imagick',\n\t\t\t),\n\t\t\t'iconv'     => array(\n\t\t\t\t'function' => 'iconv',\n\t\t\t\t'required' => false,\n\t\t\t),\n\t\t\t'mcrypt'    => array(\n\t\t\t\t'extension'    => 'mcrypt',\n\t\t\t\t'required'     => false,\n\t\t\t\t'fallback_for' => 'libsodium',\n\t\t\t),\n\t\t\t'simplexml' => array(\n\t\t\t\t'extension'    => 'simplexml',\n\t\t\t\t'required'     => false,\n\t\t\t\t'fallback_for' => 'mod_xml',\n\t\t\t),\n\t\t\t'xmlreader' => array(\n\t\t\t\t'extension'    => 'xmlreader',\n\t\t\t\t'required'     => false,\n\t\t\t\t'fallback_for' => 'mod_xml',\n\t\t\t),\n\t\t\t'zlib'      => array(\n\t\t\t\t'extension'    => 'zlib',\n\t\t\t\t'required'     => false,\n\t\t\t\t'fallback_for' => 'zip',\n\t\t\t),\n\t\t);\n\n\t\t/**\n\t\t * An array representing all the modules we wish to test for.\n\t\t *\n\t\t * @since 5.2.0\n\t\t * @since 5.3.0 The `$constant` and `$class` parameters were added.\n\t\t *\n\t\t * @param array $modules {\n\t\t *     An associative array of modules to test for.\n\t\t *\n\t\t *     @type array ...$0 {\n\t\t *         An associative array of module properties used during testing.\n\t\t *         One of either `$function` or `$extension` must be provided, or they will fail by default.\n\t\t *\n\t\t *         @type string $function     Optional. A function name to test for the existence of.\n\t\t *         @type string $extension    Optional. An extension to check if is loaded in PHP.\n\t\t *         @type string $constant     Optional. A constant name to check for to verify an extension exists.\n\t\t *         @type string $class        Optional. A class name to check for to verify an extension exists.\n\t\t *         @type bool   $required     Is this a required feature or not.\n\t\t *         @type string $fallback_for Optional. The module this module replaces as a fallback.\n\t\t *     }\n\t\t * }\n\t\t */\n\t\t$modules = apply_filters( 'site_status_test_php_modules', $modules );\n\n\t\t$failures = array();\n\n\t\tforeach ( $modules as $library => $module ) {\n\t\t\t$extension  = ( isset( $module['extension'] ) ? $module['extension'] : null );\n\t\t\t$function   = ( isset( $module['function'] ) ? $module['function'] : null );\n\t\t\t$constant   = ( isset( $module['constant'] ) ? $module['constant'] : null );\n\t\t\t$class_name = ( isset( $module['class'] ) ? $module['class'] : null );\n\n\t\t\t// If this module is a fallback for another function, check if that other function passed.\n\t\t\tif ( isset( $module['fallback_for'] ) ) {\n\t\t\t\t/*\n\t\t\t\t * If that other function has a failure, mark this module as required for usual operations.\n\t\t\t\t * If that other function hasn't failed, skip this test as it's only a fallback.\n\t\t\t\t */\n\t\t\t\tif ( isset( $failures[ $module['fallback_for'] ] ) ) {\n\t\t\t\t\t$module['required'] = true;\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! $this->test_php_extension_availability( $extension, $function, $constant, $class_name ) && ( ! isset( $module['php_bundled_version'] ) || version_compare( PHP_VERSION, $module['php_bundled_version'], '<' ) ) ) {\n\t\t\t\tif ( $module['required'] ) {\n\t\t\t\t\t$result['status'] = 'critical';\n\n\t\t\t\t\t$class         = 'error';\n\t\t\t\t\t$screen_reader = __( 'Error' );\n\t\t\t\t\t$message       = sprintf(\n\t\t\t\t\t\t/* translators: %s: The module name. */\n\t\t\t\t\t\t__( 'The required module, %s, is not installed, or has been disabled.' ),\n\t\t\t\t\t\t$library\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$class         = 'warning';\n\t\t\t\t\t$screen_reader = __( 'Warning' );\n\t\t\t\t\t$message       = sprintf(\n\t\t\t\t\t\t/* translators: %s: The module name. */\n\t\t\t\t\t\t__( 'The optional module, %s, is not installed, or has been disabled.' ),\n\t\t\t\t\t\t$library\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( ! $module['required'] && 'good' === $result['status'] ) {\n\t\t\t\t\t$result['status'] = 'recommended';\n\t\t\t\t}\n\n\t\t\t\t$failures[ $library ] = \"<span class='dashicons $class'><span class='screen-reader-text'>$screen_reader</span></span> $message\";\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $failures ) ) {\n\t\t\t$output = '<ul>';\n\n\t\t\tforeach ( $failures as $failure ) {\n\t\t\t\t$output .= sprintf(\n\t\t\t\t\t'<li>%s</li>',\n\t\t\t\t\t$failure\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$output .= '</ul>';\n\t\t}\n\n\t\tif ( 'good' !== $result['status'] ) {\n\t\t\tif ( 'recommended' === $result['status'] ) {\n\t\t\t\t$result['label'] = __( 'One or more recommended modules are missing' );\n\t\t\t}\n\t\t\tif ( 'critical' === $result['status'] ) {\n\t\t\t\t$result['label'] = __( 'One or more required modules are missing' );\n\t\t\t}\n\n\t\t\t$result['description'] .= $output;\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if the PHP default timezone is set to UTC.\n\t *\n\t * @since 5.3.1\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_php_default_timezone() {\n\t\t$result = array(\n\t\t\t'label'       => __( 'PHP default timezone is valid' ),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Performance' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'PHP default timezone was configured by WordPress on loading. This is necessary for correct calculations of dates and times.' )\n\t\t\t),\n\t\t\t'actions'     => '',\n\t\t\t'test'        => 'php_default_timezone',\n\t\t);\n\n\t\tif ( 'UTC' !== date_default_timezone_get() ) {\n\t\t\t$result['status'] = 'critical';\n\n\t\t\t$result['label'] = __( 'PHP default timezone is invalid' );\n\n\t\t\t$result['description'] = sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: date_default_timezone_set() */\n\t\t\t\t\t__( 'PHP default timezone was changed after WordPress loading by a %s function call. This interferes with correct calculations of dates and times.' ),\n\t\t\t\t\t'<code>date_default_timezone_set()</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if there's an active PHP session that can affect loopback requests.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_php_sessions() {\n\t\t$result = array(\n\t\t\t'label'       => __( 'No PHP sessions detected' ),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Performance' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: session_start(), 2: session_write_close() */\n\t\t\t\t\t__( 'PHP sessions created by a %1$s function call may interfere with REST API and loopback requests. An active session should be closed by %2$s before making any HTTP requests.' ),\n\t\t\t\t\t'<code>session_start()</code>',\n\t\t\t\t\t'<code>session_write_close()</code>'\n\t\t\t\t)\n\t\t\t),\n\t\t\t'test'        => 'php_sessions',\n\t\t);\n\n\t\tif ( function_exists( 'session_status' ) && PHP_SESSION_ACTIVE === session_status() ) {\n\t\t\t$result['status'] = 'critical';\n\n\t\t\t$result['label'] = __( 'An active PHP session was detected' );\n\n\t\t\t$result['description'] = sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: session_start(), 2: session_write_close() */\n\t\t\t\t\t__( 'A PHP session was created by a %1$s function call. This interferes with REST API and loopback requests. The session should be closed by %2$s before making any HTTP requests.' ),\n\t\t\t\t\t'<code>session_start()</code>',\n\t\t\t\t\t'<code>session_write_close()</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if the SQL server is up to date.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_sql_server() {\n\t\tif ( ! $this->mysql_server_version ) {\n\t\t\t$this->prepare_sql_data();\n\t\t}\n\n\t\t$result = array(\n\t\t\t'label'       => __( 'SQL server is up to date' ),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Performance' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'The SQL server is a required piece of software for the database WordPress uses to store all your site&#8217;s content and settings.' )\n\t\t\t),\n\t\t\t'actions'     => sprintf(\n\t\t\t\t'<p><a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">%s <span class=\"screen-reader-text\">%s</span><span aria-hidden=\"true\" class=\"dashicons dashicons-external\"></span></a></p>',\n\t\t\t\t/* translators: Localized version of WordPress requirements if one exists. */\n\t\t\t\tesc_url( __( 'https://wordpress.org/about/requirements/' ) ),\n\t\t\t\t__( 'Learn more about what WordPress requires to run.' ),\n\t\t\t\t/* translators: Accessibility text. */\n\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t),\n\t\t\t'test'        => 'sql_server',\n\t\t);\n\n\t\t$db_dropin = file_exists( WP_CONTENT_DIR . '/db.php' );\n\n\t\tif ( ! $this->mysql_rec_version_check ) {\n\t\t\t$result['status'] = 'recommended';\n\n\t\t\t$result['label'] = __( 'Outdated SQL server' );\n\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: The database engine in use (MySQL or MariaDB). 2: Database server recommended version number. */\n\t\t\t\t\t__( 'For optimal performance and security reasons, we recommend running %1$s version %2$s or higher. Contact your web hosting company to correct this.' ),\n\t\t\t\t\t( $this->is_mariadb ? 'MariaDB' : 'MySQL' ),\n\t\t\t\t\t$this->health_check_mysql_rec_version\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( ! $this->mysql_min_version_check ) {\n\t\t\t$result['status'] = 'critical';\n\n\t\t\t$result['label']          = __( 'Severely outdated SQL server' );\n\t\t\t$result['badge']['label'] = __( 'Security' );\n\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: The database engine in use (MySQL or MariaDB). 2: Database server minimum version number. */\n\t\t\t\t\t__( 'WordPress requires %1$s version %2$s or higher. Contact your web hosting company to correct this.' ),\n\t\t\t\t\t( $this->is_mariadb ? 'MariaDB' : 'MySQL' ),\n\t\t\t\t\t$this->health_check_mysql_required_version\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( $db_dropin ) {\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\twp_kses(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1: The name of the drop-in. 2: The name of the database engine. */\n\t\t\t\t\t\t__( 'You are using a %1$s drop-in which might mean that a %2$s database is not being used.' ),\n\t\t\t\t\t\t'<code>wp-content/db.php</code>',\n\t\t\t\t\t\t( $this->is_mariadb ? 'MariaDB' : 'MySQL' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'code' => true,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if the database server is capable of using utf8mb4.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_utf8mb4_support() {\n\t\tglobal $wpdb;\n\n\t\tif ( ! $this->mysql_server_version ) {\n\t\t\t$this->prepare_sql_data();\n\t\t}\n\n\t\t$result = array(\n\t\t\t'label'       => __( 'UTF8MB4 is supported' ),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Performance' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'UTF8MB4 is the character set WordPress prefers for database storage because it safely supports the widest set of characters and encodings, including Emoji, enabling better support for non-English languages.' )\n\t\t\t),\n\t\t\t'actions'     => '',\n\t\t\t'test'        => 'utf8mb4_support',\n\t\t);\n\n\t\tif ( ! $this->is_mariadb ) {\n\t\t\tif ( version_compare( $this->mysql_server_version, '5.5.3', '<' ) ) {\n\t\t\t\t$result['status'] = 'recommended';\n\n\t\t\t\t$result['label'] = __( 'utf8mb4 requires a MySQL update' );\n\n\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: Version number. */\n\t\t\t\t\t\t__( 'WordPress&#8217; utf8mb4 support requires MySQL version %s or greater. Please contact your server administrator.' ),\n\t\t\t\t\t\t'5.5.3'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\t__( 'Your MySQL version supports utf8mb4.' )\n\t\t\t\t);\n\t\t\t}\n\t\t} else { // MariaDB introduced utf8mb4 support in 5.5.0.\n\t\t\tif ( version_compare( $this->mysql_server_version, '5.5.0', '<' ) ) {\n\t\t\t\t$result['status'] = 'recommended';\n\n\t\t\t\t$result['label'] = __( 'utf8mb4 requires a MariaDB update' );\n\n\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: Version number. */\n\t\t\t\t\t\t__( 'WordPress&#8217; utf8mb4 support requires MariaDB version %s or greater. Please contact your server administrator.' ),\n\t\t\t\t\t\t'5.5.0'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\t__( 'Your MariaDB version supports utf8mb4.' )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( $wpdb->use_mysqli ) {\n\t\t\t// phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysqli_get_client_info\n\t\t\t$mysql_client_version = mysqli_get_client_info();\n\t\t} else {\n\t\t\t// phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysql_get_client_info,PHPCompatibility.Extensions.RemovedExtensions.mysql_DeprecatedRemoved\n\t\t\t$mysql_client_version = mysql_get_client_info();\n\t\t}\n\n\t\t/*\n\t\t * libmysql has supported utf8mb4 since 5.5.3, same as the MySQL server.\n\t\t * mysqlnd has supported utf8mb4 since 5.0.9.\n\t\t */\n\t\tif ( false !== strpos( $mysql_client_version, 'mysqlnd' ) ) {\n\t\t\t$mysql_client_version = preg_replace( '/^\\D+([\\d.]+).*/', '$1', $mysql_client_version );\n\t\t\tif ( version_compare( $mysql_client_version, '5.0.9', '<' ) ) {\n\t\t\t\t$result['status'] = 'recommended';\n\n\t\t\t\t$result['label'] = __( 'utf8mb4 requires a newer client library' );\n\n\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1: Name of the library, 2: Number of version. */\n\t\t\t\t\t\t__( 'WordPress&#8217; utf8mb4 support requires MySQL client library (%1$s) version %2$s or newer. Please contact your server administrator.' ),\n\t\t\t\t\t\t'mysqlnd',\n\t\t\t\t\t\t'5.0.9'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tif ( version_compare( $mysql_client_version, '5.5.3', '<' ) ) {\n\t\t\t\t$result['status'] = 'recommended';\n\n\t\t\t\t$result['label'] = __( 'utf8mb4 requires a newer client library' );\n\n\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1: Name of the library, 2: Number of version. */\n\t\t\t\t\t\t__( 'WordPress&#8217; utf8mb4 support requires MySQL client library (%1$s) version %2$s or newer. Please contact your server administrator.' ),\n\t\t\t\t\t\t'libmysql',\n\t\t\t\t\t\t'5.5.3'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if the site can communicate with WordPress.org.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_dotorg_communication() {\n\t\t$result = array(\n\t\t\t'label'       => __( 'Can communicate with WordPress.org' ),\n\t\t\t'status'      => '',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Security' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'Communicating with the WordPress servers is used to check for new versions, and to both install and update WordPress core, themes or plugins.' )\n\t\t\t),\n\t\t\t'actions'     => '',\n\t\t\t'test'        => 'dotorg_communication',\n\t\t);\n\n\t\t$wp_dotorg = wp_remote_get(\n\t\t\t'https://api.wordpress.org',\n\t\t\tarray(\n\t\t\t\t'timeout' => 10,\n\t\t\t)\n\t\t);\n\t\tif ( ! is_wp_error( $wp_dotorg ) ) {\n\t\t\t$result['status'] = 'good';\n\t\t} else {\n\t\t\t$result['status'] = 'critical';\n\n\t\t\t$result['label'] = __( 'Could not reach WordPress.org' );\n\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t'<span class=\"error\"><span class=\"screen-reader-text\">%s</span></span> %s',\n\t\t\t\t\t__( 'Error' ),\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1: The IP address WordPress.org resolves to. 2: The error returned by the lookup. */\n\t\t\t\t\t\t__( 'Your site is unable to reach WordPress.org at %1$s, and returned the error: %2$s' ),\n\t\t\t\t\t\tgethostbyname( 'api.wordpress.org' ),\n\t\t\t\t\t\t$wp_dotorg->get_error_message()\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$result['actions'] = sprintf(\n\t\t\t\t'<p><a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">%s <span class=\"screen-reader-text\">%s</span><span aria-hidden=\"true\" class=\"dashicons dashicons-external\"></span></a></p>',\n\t\t\t\t/* translators: Localized Support reference. */\n\t\t\t\tesc_url( __( 'https://wordpress.org/support' ) ),\n\t\t\t\t__( 'Get help resolving this issue.' ),\n\t\t\t\t/* translators: Accessibility text. */\n\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t);\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if debug information is enabled.\n\t *\n\t * When WP_DEBUG is enabled, errors and information may be disclosed to site visitors,\n\t * or logged to a publicly accessible file.\n\t *\n\t * Debugging is also frequently left enabled after looking for errors on a site,\n\t * as site owners do not understand the implications of this.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_is_in_debug_mode() {\n\t\t$result = array(\n\t\t\t'label'       => __( 'Your site is not set to output debug information' ),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Security' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'Debug mode is often enabled to gather more details about an error or site failure, but may contain sensitive information which should not be available on a publicly available website.' )\n\t\t\t),\n\t\t\t'actions'     => sprintf(\n\t\t\t\t'<p><a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">%s <span class=\"screen-reader-text\">%s</span><span aria-hidden=\"true\" class=\"dashicons dashicons-external\"></span></a></p>',\n\t\t\t\t/* translators: Documentation explaining debugging in WordPress. */\n\t\t\t\tesc_url( __( 'https://wordpress.org/support/article/debugging-in-wordpress/' ) ),\n\t\t\t\t__( 'Learn more about debugging in WordPress.' ),\n\t\t\t\t/* translators: Accessibility text. */\n\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t),\n\t\t\t'test'        => 'is_in_debug_mode',\n\t\t);\n\n\t\tif ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {\n\t\t\tif ( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) {\n\t\t\t\t$result['label'] = __( 'Your site is set to log errors to a potentially public file.' );\n\n\t\t\t\t$result['status'] = ( 0 === strpos( ini_get( 'error_log' ), ABSPATH ) ) ? 'critical' : 'recommended';\n\n\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: WP_DEBUG_LOG */\n\t\t\t\t\t\t__( 'The value, %s, has been added to this website&#8217;s configuration file. This means any errors on the site will be written to a file which is potentially available to all users.' ),\n\t\t\t\t\t\t'<code>WP_DEBUG_LOG</code>'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY ) {\n\t\t\t\t$result['label'] = __( 'Your site is set to display errors to site visitors' );\n\n\t\t\t\t$result['status'] = 'critical';\n\n\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1: WP_DEBUG_DISPLAY, 2: WP_DEBUG */\n\t\t\t\t\t\t__( 'The value, %1$s, has either been enabled by %2$s or added to your configuration file. This will make errors display on the front end of your site.' ),\n\t\t\t\t\t\t'<code>WP_DEBUG_DISPLAY</code>',\n\t\t\t\t\t\t'<code>WP_DEBUG</code>'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if your site is serving content over HTTPS.\n\t *\n\t * Many sites have varying degrees of HTTPS support, the most common of which is sites that have it\n\t * enabled, but only if you visit the right site address.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_https_status() {\n\t\t$result = array(\n\t\t\t'label'       => __( 'Your website is using an active HTTPS connection.' ),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Security' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'An HTTPS connection is a more secure way of browsing the web. Many services now have HTTPS as a requirement. HTTPS allows you to take advantage of new features that can increase site speed, improve search rankings, and gain the trust of your visitors by helping to protect their online privacy.' )\n\t\t\t),\n\t\t\t'actions'     => sprintf(\n\t\t\t\t'<p><a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">%s <span class=\"screen-reader-text\">%s</span><span aria-hidden=\"true\" class=\"dashicons dashicons-external\"></span></a></p>',\n\t\t\t\t/* translators: Documentation explaining HTTPS and why it should be used. */\n\t\t\t\tesc_url( __( 'https://wordpress.org/support/article/why-should-i-use-https/' ) ),\n\t\t\t\t__( 'Learn more about why you should use HTTPS' ),\n\t\t\t\t/* translators: Accessibility text. */\n\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t),\n\t\t\t'test'        => 'https_status',\n\t\t);\n\n\t\tif ( is_ssl() ) {\n\t\t\t$wp_url   = get_bloginfo( 'wpurl' );\n\t\t\t$site_url = get_bloginfo( 'url' );\n\n\t\t\tif ( 'https' !== substr( $wp_url, 0, 5 ) || 'https' !== substr( $site_url, 0, 5 ) ) {\n\t\t\t\t$result['status'] = 'recommended';\n\n\t\t\t\t$result['label'] = __( 'Only parts of your site are using HTTPS' );\n\n\t\t\t\t$result['description'] = sprintf(\n\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: URL to General Settings screen. */\n\t\t\t\t\t\t__( 'You are accessing this website using HTTPS, but your <a href=\"%s\">WordPress Address</a> is not set up to use HTTPS by default.' ),\n\t\t\t\t\t\tesc_url( admin_url( 'options-general.php' ) )\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t$result['actions'] .= sprintf(\n\t\t\t\t\t'<p><a href=\"%s\">%s</a></p>',\n\t\t\t\t\tesc_url( admin_url( 'options-general.php' ) ),\n\t\t\t\t\t__( 'Update your site addresses' )\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\t$result['status'] = 'recommended';\n\n\t\t\t$result['label'] = __( 'Your site does not use HTTPS' );\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Check if the HTTP API can handle SSL/TLS requests.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_ssl_support() {\n\t\t$result = array(\n\t\t\t'label'       => '',\n\t\t\t'status'      => '',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Security' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'Securely communicating between servers are needed for transactions such as fetching files, conducting sales on store sites, and much more.' )\n\t\t\t),\n\t\t\t'actions'     => '',\n\t\t\t'test'        => 'ssl_support',\n\t\t);\n\n\t\t$supports_https = wp_http_supports( array( 'ssl' ) );\n\n\t\tif ( $supports_https ) {\n\t\t\t$result['status'] = 'good';\n\n\t\t\t$result['label'] = __( 'Your site can communicate securely with other services' );\n\t\t} else {\n\t\t\t$result['status'] = 'critical';\n\n\t\t\t$result['label'] = __( 'Your site is unable to communicate securely with other services' );\n\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'Talk to your web host about OpenSSL support for PHP.' )\n\t\t\t);\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if scheduled events run as intended.\n\t *\n\t * If scheduled events are not running, this may indicate something with WP_Cron is not working\n\t * as intended, or that there are orphaned events hanging around from older code.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_scheduled_events() {\n\t\t$result = array(\n\t\t\t'label'       => __( 'Scheduled events are running' ),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Performance' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'Scheduled events are what periodically looks for updates to plugins, themes and WordPress itself. It is also what makes sure scheduled posts are published on time. It may also be used by various plugins to make sure that planned actions are executed.' )\n\t\t\t),\n\t\t\t'actions'     => '',\n\t\t\t'test'        => 'scheduled_events',\n\t\t);\n\n\t\t$this->wp_schedule_test_init();\n\n\t\tif ( is_wp_error( $this->has_missed_cron() ) ) {\n\t\t\t$result['status'] = 'critical';\n\n\t\t\t$result['label'] = __( 'It was not possible to check your scheduled events' );\n\n\t\t\t$result['description'] = sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: The error message returned while from the cron scheduler. */\n\t\t\t\t\t__( 'While trying to test your site&#8217;s scheduled events, the following error was returned: %s' ),\n\t\t\t\t\t$this->has_missed_cron()->get_error_message()\n\t\t\t\t)\n\t\t\t);\n\t\t} elseif ( $this->has_missed_cron() ) {\n\t\t\t$result['status'] = 'recommended';\n\n\t\t\t$result['label'] = __( 'A scheduled event has failed' );\n\n\t\t\t$result['description'] = sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: The name of the failed cron event. */\n\t\t\t\t\t__( 'The scheduled event, %s, failed to run. Your site still works, but this may indicate that scheduling posts or automated updates may not work as intended.' ),\n\t\t\t\t\t$this->last_missed_cron\n\t\t\t\t)\n\t\t\t);\n\t\t} elseif ( $this->has_late_cron() ) {\n\t\t\t$result['status'] = 'recommended';\n\n\t\t\t$result['label'] = __( 'A scheduled event is late' );\n\n\t\t\t$result['description'] = sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: The name of the late cron event. */\n\t\t\t\t\t__( 'The scheduled event, %s, is late to run. Your site still works, but this may indicate that scheduling posts or automated updates may not work as intended.' ),\n\t\t\t\t\t$this->last_late_cron\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if WordPress can run automated background updates.\n\t *\n\t * Background updates in WordPress are primarily used for minor releases and security updates.\n\t * It's important to either have these working, or be aware that they are intentionally disabled\n\t * for whatever reason.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_background_updates() {\n\t\t$result = array(\n\t\t\t'label'       => __( 'Background updates are working' ),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Security' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'Background updates ensure that WordPress can auto-update if a security update is released for the version you are currently using.' )\n\t\t\t),\n\t\t\t'actions'     => '',\n\t\t\t'test'        => 'background_updates',\n\t\t);\n\n\t\tif ( ! class_exists( 'WP_Site_Health_Auto_Updates' ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-site-health-auto-updates.php';\n\t\t}\n\n\t\t// Run the auto-update tests in a separate class,\n\t\t// as there are many considerations to be made.\n\t\t$automatic_updates = new WP_Site_Health_Auto_Updates();\n\t\t$tests             = $automatic_updates->run_tests();\n\n\t\t$output = '<ul>';\n\n\t\tforeach ( $tests as $test ) {\n\t\t\t$severity_string = __( 'Passed' );\n\n\t\t\tif ( 'fail' === $test->severity ) {\n\t\t\t\t$result['label'] = __( 'Background updates are not working as expected' );\n\n\t\t\t\t$result['status'] = 'critical';\n\n\t\t\t\t$severity_string = __( 'Error' );\n\t\t\t}\n\n\t\t\tif ( 'warning' === $test->severity && 'good' === $result['status'] ) {\n\t\t\t\t$result['label'] = __( 'Background updates may not be working properly' );\n\n\t\t\t\t$result['status'] = 'recommended';\n\n\t\t\t\t$severity_string = __( 'Warning' );\n\t\t\t}\n\n\t\t\t$output .= sprintf(\n\t\t\t\t'<li><span class=\"dashicons %s\"><span class=\"screen-reader-text\">%s</span></span> %s</li>',\n\t\t\t\tesc_attr( $test->severity ),\n\t\t\t\t$severity_string,\n\t\t\t\t$test->description\n\t\t\t);\n\t\t}\n\n\t\t$output .= '</ul>';\n\n\t\tif ( 'good' !== $result['status'] ) {\n\t\t\t$result['description'] .= $output;\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if plugin and theme auto-updates appear to be configured correctly.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_plugin_theme_auto_updates() {\n\t\t$result = array(\n\t\t\t'label'       => __( 'Plugin and theme auto-updates appear to be configured correctly' ),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Security' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'Plugin and theme auto-updates ensure that the latest versions are always installed.' )\n\t\t\t),\n\t\t\t'actions'     => '',\n\t\t\t'test'        => 'plugin_theme_auto_updates',\n\t\t);\n\n\t\t$check_plugin_theme_updates = $this->detect_plugin_theme_auto_update_issues();\n\n\t\t$result['status'] = $check_plugin_theme_updates->status;\n\n\t\tif ( 'good' !== $result['status'] ) {\n\t\t\t$result['label'] = __( 'Your site may have problems auto-updating plugins and themes' );\n\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t$check_plugin_theme_updates->message\n\t\t\t);\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if loopbacks work as expected.\n\t *\n\t * A loopback is when WordPress queries itself, for example to start a new WP_Cron instance,\n\t * or when editing a plugin or theme. This has shown itself to be a recurring issue,\n\t * as code can very easily break this interaction.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_loopback_requests() {\n\t\t$result = array(\n\t\t\t'label'       => __( 'Your site can perform loopback requests' ),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Performance' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'Loopback requests are used to run scheduled events, and are also used by the built-in editors for themes and plugins to verify code stability.' )\n\t\t\t),\n\t\t\t'actions'     => '',\n\t\t\t'test'        => 'loopback_requests',\n\t\t);\n\n\t\t$check_loopback = $this->can_perform_loopback();\n\n\t\t$result['status'] = $check_loopback->status;\n\n\t\tif ( 'good' !== $result['status'] ) {\n\t\t\t$result['label'] = __( 'Your site could not complete a loopback request' );\n\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t$check_loopback->message\n\t\t\t);\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if HTTP requests are blocked.\n\t *\n\t * It's possible to block all outgoing communication (with the possibility of allowing certain\n\t * hosts) via the HTTP API. This may create problems for users as many features are running as\n\t * services these days.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_http_requests() {\n\t\t$result = array(\n\t\t\t'label'       => __( 'HTTP requests seem to be working as expected' ),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Performance' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'It is possible for site maintainers to block all, or some, communication to other sites and services. If set up incorrectly, this may prevent plugins and themes from working as intended.' )\n\t\t\t),\n\t\t\t'actions'     => '',\n\t\t\t'test'        => 'http_requests',\n\t\t);\n\n\t\t$blocked = false;\n\t\t$hosts   = array();\n\n\t\tif ( defined( 'WP_HTTP_BLOCK_EXTERNAL' ) && WP_HTTP_BLOCK_EXTERNAL ) {\n\t\t\t$blocked = true;\n\t\t}\n\n\t\tif ( defined( 'WP_ACCESSIBLE_HOSTS' ) ) {\n\t\t\t$hosts = explode( ',', WP_ACCESSIBLE_HOSTS );\n\t\t}\n\n\t\tif ( $blocked && 0 === sizeof( $hosts ) ) {\n\t\t\t$result['status'] = 'critical';\n\n\t\t\t$result['label'] = __( 'HTTP requests are blocked' );\n\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Name of the constant used. */\n\t\t\t\t\t__( 'HTTP requests have been blocked by the %s constant, with no allowed hosts.' ),\n\t\t\t\t\t'<code>WP_HTTP_BLOCK_EXTERNAL</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( $blocked && 0 < sizeof( $hosts ) ) {\n\t\t\t$result['status'] = 'recommended';\n\n\t\t\t$result['label'] = __( 'HTTP requests are partially blocked' );\n\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: Name of the constant used. 2: List of allowed hostnames. */\n\t\t\t\t\t__( 'HTTP requests have been blocked by the %1$s constant, with some allowed hosts: %2$s.' ),\n\t\t\t\t\t'<code>WP_HTTP_BLOCK_EXTERNAL</code>',\n\t\t\t\t\timplode( ',', $hosts )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if the REST API is accessible.\n\t *\n\t * Various security measures may block the REST API from working, or it may have been disabled in general.\n\t * This is required for the new block editor to work, so we explicitly test for this.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_rest_availability() {\n\t\t$result = array(\n\t\t\t'label'       => __( 'The REST API is available' ),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Performance' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\t__( 'The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages.' )\n\t\t\t),\n\t\t\t'actions'     => '',\n\t\t\t'test'        => 'rest_availability',\n\t\t);\n\n\t\t$cookies = wp_unslash( $_COOKIE );\n\t\t$timeout = 10;\n\t\t$headers = array(\n\t\t\t'Cache-Control' => 'no-cache',\n\t\t\t'X-WP-Nonce'    => wp_create_nonce( 'wp_rest' ),\n\t\t);\n\t\t/** This filter is documented in wp-includes/class-wp-http-streams.php */\n\t\t$sslverify = apply_filters( 'https_local_ssl_verify', false );\n\n\t\t// Include Basic auth in loopback requests.\n\t\tif ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {\n\t\t\t$headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) );\n\t\t}\n\n\t\t$url = rest_url( 'wp/v2/types/post' );\n\n\t\t// The context for this is editing with the new block editor.\n\t\t$url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'context' => 'edit',\n\t\t\t),\n\t\t\t$url\n\t\t);\n\n\t\t$r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) );\n\n\t\tif ( is_wp_error( $r ) ) {\n\t\t\t$result['status'] = 'critical';\n\n\t\t\t$result['label'] = __( 'The REST API encountered an error' );\n\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t'%s<br>%s',\n\t\t\t\t\t__( 'The REST API request failed due to an error.' ),\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1: The WordPress error message. 2: The WordPress error code. */\n\t\t\t\t\t\t__( 'Error: %1$s (%2$s)' ),\n\t\t\t\t\t\t$r->get_error_message(),\n\t\t\t\t\t\t$r->get_error_code()\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t} elseif ( 200 !== wp_remote_retrieve_response_code( $r ) ) {\n\t\t\t$result['status'] = 'recommended';\n\n\t\t\t$result['label'] = __( 'The REST API encountered an unexpected result' );\n\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: The HTTP error code. 2: The HTTP error message. */\n\t\t\t\t\t__( 'The REST API call gave the following unexpected result: (%1$d) %2$s.' ),\n\t\t\t\t\twp_remote_retrieve_response_code( $r ),\n\t\t\t\t\tesc_html( wp_remote_retrieve_body( $r ) )\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t$json = json_decode( wp_remote_retrieve_body( $r ), true );\n\n\t\t\tif ( false !== $json && ! isset( $json['capabilities'] ) ) {\n\t\t\t\t$result['status'] = 'recommended';\n\n\t\t\t\t$result['label'] = __( 'The REST API did not behave correctly' );\n\n\t\t\t\t$result['description'] .= sprintf(\n\t\t\t\t\t'<p>%s</p>',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: The name of the query parameter being tested. */\n\t\t\t\t\t\t__( 'The REST API did not process the %s query parameter correctly.' ),\n\t\t\t\t\t\t'<code>context</code>'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Test if 'file_uploads' directive in PHP.ini is turned off.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array The test results.\n\t */\n\tpublic function get_test_file_uploads() {\n\t\t$result = array(\n\t\t\t'label'       => __( 'Files can be uploaded.' ),\n\t\t\t'status'      => 'good',\n\t\t\t'badge'       => array(\n\t\t\t\t'label' => __( 'Performance' ),\n\t\t\t\t'color' => 'blue',\n\t\t\t),\n\t\t\t'description' => sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: file_uploads, 2: php.ini */\n\t\t\t\t\t__( 'The %1$s directive in %2$s determines if uploading files is allowed on your site.' ),\n\t\t\t\t\t'<code>file_uploads</code>',\n\t\t\t\t\t'<code>php.ini</code>'\n\t\t\t\t)\n\t\t\t),\n\t\t\t'actions'     => '',\n\t\t\t'test'        => 'file_uploads',\n\t\t);\n\n\t\tif ( ! function_exists( 'ini_get' ) ) {\n\t\t\t$result['status']       = 'critical';\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t/* translators: %s: ini_get() */\n\t\t\t\t__( 'The %s function has been disabled, some media settings are unavailable because of this.' ),\n\t\t\t\t'<code>ini_get()</code>'\n\t\t\t);\n\t\t\treturn $result;\n\t\t}\n\n\t\tif ( empty( ini_get( 'file_uploads' ) ) ) {\n\t\t\t$result['status']       = 'critical';\n\t\t\t$result['description'] .= sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: file_uploads, 2: 0 */\n\t\t\t\t\t__( '%1$s is set to %2$s. You won\\'t be able to upload files on your site.' ),\n\t\t\t\t\t'<code>file_uploads</code>',\n\t\t\t\t\t'<code>0</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn $result;\n\t\t}\n\n\t\t$post_max_size       = ini_get( 'post_max_size' );\n\t\t$upload_max_filesize = ini_get( 'upload_max_filesize' );\n\n\t\tif ( wp_convert_hr_to_bytes( $post_max_size ) < wp_convert_hr_to_bytes( $upload_max_filesize ) ) {\n\t\t\t$result['label'] = sprintf(\n\t\t\t\t/* translators: 1: post_max_size, 2: upload_max_filesize */\n\t\t\t\t__( 'The \"%1$s\" value is smaller than \"%2$s\".' ),\n\t\t\t\t'post_max_size',\n\t\t\t\t'upload_max_filesize'\n\t\t\t);\n\t\t\t$result['status']      = 'recommended';\n\t\t\t$result['description'] = sprintf(\n\t\t\t\t'<p>%s</p>',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: post_max_size, 2: upload_max_filesize */\n\t\t\t\t\t__( 'The setting for %1$s is smaller than %2$s, this could cause some problems when trying to upload files.' ),\n\t\t\t\t\t'<code>post_max_size</code>',\n\t\t\t\t\t'<code>upload_max_filesize</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn $result;\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Return a set of tests that belong to the site status page.\n\t *\n\t * Each site status test is defined here, they may be `direct` tests, that run on page load, or `async` tests\n\t * which will run later down the line via JavaScript calls to improve page performance and hopefully also user\n\t * experiences.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array The list of tests to run.\n\t */\n\tpublic static function get_tests() {\n\t\t$tests = array(\n\t\t\t'direct' => array(\n\t\t\t\t'wordpress_version'         => array(\n\t\t\t\t\t'label' => __( 'WordPress Version' ),\n\t\t\t\t\t'test'  => 'wordpress_version',\n\t\t\t\t),\n\t\t\t\t'plugin_version'            => array(\n\t\t\t\t\t'label' => __( 'Plugin Versions' ),\n\t\t\t\t\t'test'  => 'plugin_version',\n\t\t\t\t),\n\t\t\t\t'theme_version'             => array(\n\t\t\t\t\t'label' => __( 'Theme Versions' ),\n\t\t\t\t\t'test'  => 'theme_version',\n\t\t\t\t),\n\t\t\t\t'php_version'               => array(\n\t\t\t\t\t'label' => __( 'PHP Version' ),\n\t\t\t\t\t'test'  => 'php_version',\n\t\t\t\t),\n\t\t\t\t'php_extensions'            => array(\n\t\t\t\t\t'label' => __( 'PHP Extensions' ),\n\t\t\t\t\t'test'  => 'php_extensions',\n\t\t\t\t),\n\t\t\t\t'php_default_timezone'      => array(\n\t\t\t\t\t'label' => __( 'PHP Default Timezone' ),\n\t\t\t\t\t'test'  => 'php_default_timezone',\n\t\t\t\t),\n\t\t\t\t'php_sessions'              => array(\n\t\t\t\t\t'label' => __( 'PHP Sessions' ),\n\t\t\t\t\t'test'  => 'php_sessions',\n\t\t\t\t),\n\t\t\t\t'sql_server'                => array(\n\t\t\t\t\t'label' => __( 'Database Server version' ),\n\t\t\t\t\t'test'  => 'sql_server',\n\t\t\t\t),\n\t\t\t\t'utf8mb4_support'           => array(\n\t\t\t\t\t'label' => __( 'MySQL utf8mb4 support' ),\n\t\t\t\t\t'test'  => 'utf8mb4_support',\n\t\t\t\t),\n\t\t\t\t'https_status'              => array(\n\t\t\t\t\t'label' => __( 'HTTPS status' ),\n\t\t\t\t\t'test'  => 'https_status',\n\t\t\t\t),\n\t\t\t\t'ssl_support'               => array(\n\t\t\t\t\t'label' => __( 'Secure communication' ),\n\t\t\t\t\t'test'  => 'ssl_support',\n\t\t\t\t),\n\t\t\t\t'scheduled_events'          => array(\n\t\t\t\t\t'label' => __( 'Scheduled events' ),\n\t\t\t\t\t'test'  => 'scheduled_events',\n\t\t\t\t),\n\t\t\t\t'http_requests'             => array(\n\t\t\t\t\t'label' => __( 'HTTP Requests' ),\n\t\t\t\t\t'test'  => 'http_requests',\n\t\t\t\t),\n\t\t\t\t'debug_enabled'             => array(\n\t\t\t\t\t'label' => __( 'Debugging enabled' ),\n\t\t\t\t\t'test'  => 'is_in_debug_mode',\n\t\t\t\t),\n\t\t\t\t'file_uploads'              => array(\n\t\t\t\t\t'label' => __( 'File uploads' ),\n\t\t\t\t\t'test'  => 'file_uploads',\n\t\t\t\t),\n\t\t\t\t'plugin_theme_auto_updates' => array(\n\t\t\t\t\t'label' => __( 'Plugin and theme auto-updates' ),\n\t\t\t\t\t'test'  => 'plugin_theme_auto_updates',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'async'  => array(\n\t\t\t\t'dotorg_communication' => array(\n\t\t\t\t\t'label' => __( 'Communication with WordPress.org' ),\n\t\t\t\t\t'test'  => 'dotorg_communication',\n\t\t\t\t),\n\t\t\t\t'background_updates'   => array(\n\t\t\t\t\t'label' => __( 'Background updates' ),\n\t\t\t\t\t'test'  => 'background_updates',\n\t\t\t\t),\n\t\t\t\t'loopback_requests'    => array(\n\t\t\t\t\t'label' => __( 'Loopback request' ),\n\t\t\t\t\t'test'  => 'loopback_requests',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t// Conditionally include REST rules if the function for it exists.\n\t\tif ( function_exists( 'rest_url' ) ) {\n\t\t\t$tests['direct']['rest_availability'] = array(\n\t\t\t\t'label' => __( 'REST API availability' ),\n\t\t\t\t'test'  => 'rest_availability',\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Add or modify which site status tests are run on a site.\n\t\t *\n\t\t * The site health is determined by a set of tests based on best practices from\n\t\t * both the WordPress Hosting Team, but also web standards in general.\n\t\t *\n\t\t * Some sites may not have the same requirements, for example the automatic update\n\t\t * checks may be handled by a host, and are therefore disabled in core.\n\t\t * Or maybe you want to introduce a new test, is caching enabled/disabled/stale for example.\n\t\t *\n\t\t * Tests may be added either as direct, or asynchronous ones. Any test that may require some time\n\t\t * to complete should run asynchronously, to avoid extended loading periods within wp-admin.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param array $test_type {\n\t\t *     An associative array, where the `$test_type` is either `direct` or\n\t\t *     `async`, to declare if the test should run via Ajax calls after page load.\n\t\t *\n\t\t *     @type array $identifier {\n\t\t *         `$identifier` should be a unique identifier for the test that should run.\n\t\t *         Plugins and themes are encouraged to prefix test identifiers with their slug\n\t\t *         to avoid any collisions between tests.\n\t\t *\n\t\t *         @type string $label A friendly label for your test to identify it by.\n\t\t *         @type mixed  $test  A callable to perform a direct test, or a string Ajax action to be called\n\t\t *                             to perform an async test.\n\t\t *     }\n\t\t * }\n\t\t */\n\t\t$tests = apply_filters( 'site_status_tests', $tests );\n\n\t\t// Ensure that the filtered tests contain the required array keys.\n\t\t$tests = array_merge(\n\t\t\tarray(\n\t\t\t\t'direct' => array(),\n\t\t\t\t'async'  => array(),\n\t\t\t),\n\t\t\t$tests\n\t\t);\n\n\t\treturn $tests;\n\t}\n\n\t/**\n\t * Add a class to the body HTML tag.\n\t *\n\t * Filters the body class string for admin pages and adds our own class for easier styling.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string $body_class The body class string.\n\t * @return string The modified body class string.\n\t */\n\tpublic function admin_body_class( $body_class ) {\n\t\t$screen = get_current_screen();\n\t\tif ( 'site-health' !== $screen->id ) {\n\t\t\treturn $body_class;\n\t\t}\n\n\t\t$body_class .= ' site-health';\n\n\t\treturn $body_class;\n\t}\n\n\t/**\n\t * Initiate the WP_Cron schedule test cases.\n\t *\n\t * @since 5.2.0\n\t */\n\tprivate function wp_schedule_test_init() {\n\t\t$this->schedules = wp_get_schedules();\n\t\t$this->get_cron_tasks();\n\t}\n\n\t/**\n\t * Populate our list of cron events and store them to a class-wide variable.\n\t *\n\t * @since 5.2.0\n\t */\n\tprivate function get_cron_tasks() {\n\t\t$cron_tasks = _get_cron_array();\n\n\t\tif ( empty( $cron_tasks ) ) {\n\t\t\t$this->crons = new WP_Error( 'no_tasks', __( 'No scheduled events exist on this site.' ) );\n\t\t\treturn;\n\t\t}\n\n\t\t$this->crons = array();\n\n\t\tforeach ( $cron_tasks as $time => $cron ) {\n\t\t\tforeach ( $cron as $hook => $dings ) {\n\t\t\t\tforeach ( $dings as $sig => $data ) {\n\n\t\t\t\t\t$this->crons[ \"$hook-$sig-$time\" ] = (object) array(\n\t\t\t\t\t\t'hook'     => $hook,\n\t\t\t\t\t\t'time'     => $time,\n\t\t\t\t\t\t'sig'      => $sig,\n\t\t\t\t\t\t'args'     => $data['args'],\n\t\t\t\t\t\t'schedule' => $data['schedule'],\n\t\t\t\t\t\t'interval' => isset( $data['interval'] ) ? $data['interval'] : null,\n\t\t\t\t\t);\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Check if any scheduled tasks have been missed.\n\t *\n\t * Returns a boolean value of `true` if a scheduled task has been missed and ends processing.\n\t *\n\t * If the list of crons is an instance of WP_Error, returns the instance instead of a boolean value.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return bool|WP_Error True if a cron was missed, false if not. WP_Error if the cron is set to that.\n\t */\n\tpublic function has_missed_cron() {\n\t\tif ( is_wp_error( $this->crons ) ) {\n\t\t\treturn $this->crons;\n\t\t}\n\n\t\tforeach ( $this->crons as $id => $cron ) {\n\t\t\tif ( ( $cron->time - time() ) < $this->timeout_missed_cron ) {\n\t\t\t\t$this->last_missed_cron = $cron->hook;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Check if any scheduled tasks are late.\n\t *\n\t * Returns a boolean value of `true` if a scheduled task is late and ends processing.\n\t *\n\t * If the list of crons is an instance of WP_Error, returns the instance instead of a boolean value.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @return bool|WP_Error True if a cron is late, false if not. WP_Error if the cron is set to that.\n\t */\n\tpublic function has_late_cron() {\n\t\tif ( is_wp_error( $this->crons ) ) {\n\t\t\treturn $this->crons;\n\t\t}\n\n\t\tforeach ( $this->crons as $id => $cron ) {\n\t\t\t$cron_offset = $cron->time - time();\n\t\t\tif (\n\t\t\t\t$cron_offset >= $this->timeout_missed_cron &&\n\t\t\t\t$cron_offset < $this->timeout_late_cron\n\t\t\t) {\n\t\t\t\t$this->last_late_cron = $cron->hook;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Check for potential issues with plugin and theme auto-updates.\n\t *\n\t * Though there is no way to 100% determine if plugin and theme auto-updates are configured\n\t * correctly, a few educated guesses could be made to flag any conditions that would\n\t * potentially cause unexpected behaviors.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return object The test results.\n\t */\n\tfunction detect_plugin_theme_auto_update_issues() {\n\t\t$mock_plugin = (object) array(\n\t\t\t'id'            => 'w.org/plugins/a-fake-plugin',\n\t\t\t'slug'          => 'a-fake-plugin',\n\t\t\t'plugin'        => 'a-fake-plugin/a-fake-plugin.php',\n\t\t\t'new_version'   => '9.9',\n\t\t\t'url'           => 'https://wordpress.org/plugins/a-fake-plugin/',\n\t\t\t'package'       => 'https://downloads.wordpress.org/plugin/a-fake-plugin.9.9.zip',\n\t\t\t'icons'         => array(\n\t\t\t\t'2x' => 'https://ps.w.org/a-fake-plugin/assets/icon-256x256.png',\n\t\t\t\t'1x' => 'https://ps.w.org/a-fake-plugin/assets/icon-128x128.png',\n\t\t\t),\n\t\t\t'banners'       => array(\n\t\t\t\t'2x' => 'https://ps.w.org/a-fake-plugin/assets/banner-1544x500.png',\n\t\t\t\t'1x' => 'https://ps.w.org/a-fake-plugin/assets/banner-772x250.png',\n\t\t\t),\n\t\t\t'banners_rtl'   => array(),\n\t\t\t'tested'        => '5.5.0',\n\t\t\t'requires_php'  => '5.6.20',\n\t\t\t'compatibility' => new stdClass(),\n\t\t);\n\n\t\t$mock_theme = (object) array(\n\t\t\t'theme'        => 'a-fake-theme',\n\t\t\t'new_version'  => '9.9',\n\t\t\t'url'          => 'https://wordpress.org/themes/a-fake-theme/',\n\t\t\t'package'      => 'https://downloads.wordpress.org/theme/a-fake-theme.9.9.zip',\n\t\t\t'requires'     => '5.0.0',\n\t\t\t'requires_php' => '5.6.20',\n\t\t);\n\n\t\t$type = 'plugin';\n\t\t/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */\n\t\t$test_plugins_enabled = apply_filters( \"auto_update_{$type}\", true, $mock_plugin );\n\n\t\t$type = 'theme';\n\t\t/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */\n\t\t$test_themes_enabled = apply_filters( \"auto_update_{$type}\", true, $mock_theme );\n\n\t\t$ui_enabled_for_plugins = wp_is_auto_update_enabled_for_type( 'plugin' );\n\t\t$ui_enabled_for_themes  = wp_is_auto_update_enabled_for_type( 'theme' );\n\t\t$plugin_filter_present  = has_filter( 'auto_update_plugin' );\n\t\t$theme_filter_present   = has_filter( 'auto_update_theme' );\n\n\t\tif ( ( ! $test_plugins_enabled && $ui_enabled_for_plugins )\n\t\t\t|| ( ! $test_themes_enabled && $ui_enabled_for_themes )\n\t\t) {\n\t\t\treturn (object) array(\n\t\t\t\t'status'  => 'critical',\n\t\t\t\t'message' => __( 'Auto-updates for plugins and/or themes appear to be disabled, but settings are still set to be displayed. This could cause auto-updates to not work as expected.' ),\n\t\t\t);\n\t\t}\n\n\t\tif ( ( ! $test_plugins_enabled && $plugin_filter_present )\n\t\t\t&& ( ! $test_themes_enabled && $theme_filter_present )\n\t\t) {\n\t\t\treturn (object) array(\n\t\t\t\t'status'  => 'recommended',\n\t\t\t\t'message' => __( 'Auto-updates for plugins and themes appear to be disabled. This will prevent your site from receiving new versions automatically when available.' ),\n\t\t\t);\n\t\t} elseif ( ! $test_plugins_enabled && $plugin_filter_present ) {\n\t\t\treturn (object) array(\n\t\t\t\t'status'  => 'recommended',\n\t\t\t\t'message' => __( 'Auto-updates for plugins appear to be disabled. This will prevent your site from receiving new versions automatically when available.' ),\n\t\t\t);\n\t\t} elseif ( ! $test_themes_enabled && $theme_filter_present ) {\n\t\t\treturn (object) array(\n\t\t\t\t'status'  => 'recommended',\n\t\t\t\t'message' => __( 'Auto-updates for themes appear to be disabled. This will prevent your site from receiving new versions automatically when available.' ),\n\t\t\t);\n\t\t}\n\n\t\treturn (object) array(\n\t\t\t'status'  => 'good',\n\t\t\t'message' => __( 'There appear to be no issues with plugin and theme auto-updates.' ),\n\t\t);\n\t}\n\n\t/**\n\t * Run a loopback test on our site.\n\t *\n\t * Loopbacks are what WordPress uses to communicate with itself to start up WP_Cron, scheduled posts,\n\t * make sure plugin or theme edits don't cause site failures and similar.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return object The test results.\n\t */\n\tfunction can_perform_loopback() {\n\t\t$cookies = wp_unslash( $_COOKIE );\n\t\t$timeout = 10;\n\t\t$headers = array(\n\t\t\t'Cache-Control' => 'no-cache',\n\t\t);\n\t\t/** This filter is documented in wp-includes/class-wp-http-streams.php */\n\t\t$sslverify = apply_filters( 'https_local_ssl_verify', false );\n\n\t\t// Include Basic auth in loopback requests.\n\t\tif ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {\n\t\t\t$headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) );\n\t\t}\n\n\t\t$url = admin_url();\n\n\t\t$r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) );\n\n\t\tif ( is_wp_error( $r ) ) {\n\t\t\treturn (object) array(\n\t\t\t\t'status'  => 'critical',\n\t\t\t\t'message' => sprintf(\n\t\t\t\t\t'%s<br>%s',\n\t\t\t\t\t__( 'The loopback request to your site failed, this means features relying on them are not currently working as expected.' ),\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1: The WordPress error message. 2: The WordPress error code. */\n\t\t\t\t\t\t__( 'Error: %1$s (%2$s)' ),\n\t\t\t\t\t\t$r->get_error_message(),\n\t\t\t\t\t\t$r->get_error_code()\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\tif ( 200 !== wp_remote_retrieve_response_code( $r ) ) {\n\t\t\treturn (object) array(\n\t\t\t\t'status'  => 'recommended',\n\t\t\t\t'message' => sprintf(\n\t\t\t\t\t/* translators: %d: The HTTP response code returned. */\n\t\t\t\t\t__( 'The loopback request returned an unexpected http status code, %d, it was not possible to determine if this will prevent features from working as expected.' ),\n\t\t\t\t\twp_remote_retrieve_response_code( $r )\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn (object) array(\n\t\t\t'status'  => 'good',\n\t\t\t'message' => __( 'The loopback request to your site completed successfully.' ),\n\t\t);\n\t}\n\n\t/**\n\t * Create a weekly cron event, if one does not already exist.\n\t *\n\t * @since 5.4.0\n\t */\n\tpublic function maybe_create_scheduled_event() {\n\t\tif ( ! wp_next_scheduled( 'wp_site_health_scheduled_check' ) && ! wp_installing() ) {\n\t\t\twp_schedule_event( time() + DAY_IN_SECONDS, 'weekly', 'wp_site_health_scheduled_check' );\n\t\t}\n\t}\n\n\t/**\n\t * Run our scheduled event to check and update the latest site health status for the website.\n\t *\n\t * @since 5.4.0\n\t */\n\tpublic function wp_cron_scheduled_check() {\n\t\t// Bootstrap wp-admin, as WP_Cron doesn't do this for us.\n\t\trequire_once trailingslashit( ABSPATH ) . 'wp-admin/includes/admin.php';\n\n\t\t$tests = WP_Site_Health::get_tests();\n\n\t\t$results = array();\n\n\t\t$site_status = array(\n\t\t\t'good'        => 0,\n\t\t\t'recommended' => 0,\n\t\t\t'critical'    => 0,\n\t\t);\n\n\t\t// Don't run https test on localhost.\n\t\tif ( 'localhost' === preg_replace( '|https?://|', '', get_site_url() ) ) {\n\t\t\tunset( $tests['direct']['https_status'] );\n\t\t}\n\n\t\tforeach ( $tests['direct'] as $test ) {\n\n\t\t\tif ( is_string( $test['test'] ) ) {\n\t\t\t\t$test_function = sprintf(\n\t\t\t\t\t'get_test_%s',\n\t\t\t\t\t$test['test']\n\t\t\t\t);\n\n\t\t\t\tif ( method_exists( $this, $test_function ) && is_callable( array( $this, $test_function ) ) ) {\n\t\t\t\t\t$results[] = $this->perform_test( array( $this, $test_function ) );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( is_callable( $test['test'] ) ) {\n\t\t\t\t$results[] = $this->perform_test( $test['test'] );\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $tests['async'] as $test ) {\n\t\t\tif ( is_string( $test['test'] ) ) {\n\t\t\t\tif ( isset( $test['has_rest'] ) && $test['has_rest'] ) {\n\t\t\t\t\t$result_fetch = wp_remote_post(\n\t\t\t\t\t\trest_url( $test['test'] ),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'body' => array(\n\t\t\t\t\t\t\t\t'_wpnonce' => wp_create_nonce( 'wp_rest' ),\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} else {\n\t\t\t\t\t$result_fetch = wp_remote_post(\n\t\t\t\t\t\tadmin_url( 'admin-ajax.php' ),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'body' => array(\n\t\t\t\t\t\t\t\t'action'   => $test['test'],\n\t\t\t\t\t\t\t\t'_wpnonce' => wp_create_nonce( 'health-check-site-status' ),\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\tif ( ! is_wp_error( $result_fetch ) ) {\n\t\t\t\t\t$result = json_decode( wp_remote_retrieve_body( $result_fetch ), true );\n\t\t\t\t} else {\n\t\t\t\t\t$result = false;\n\t\t\t\t}\n\n\t\t\t\tif ( is_array( $result ) ) {\n\t\t\t\t\t$results[] = $result;\n\t\t\t\t} else {\n\t\t\t\t\t$results[] = array(\n\t\t\t\t\t\t'status' => 'recommended',\n\t\t\t\t\t\t'label'  => __( 'A test is unavailable' ),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $results as $result ) {\n\t\t\tif ( 'critical' === $result['status'] ) {\n\t\t\t\t$site_status['critical']++;\n\t\t\t} elseif ( 'recommended' === $result['status'] ) {\n\t\t\t\t$site_status['recommended']++;\n\t\t\t} else {\n\t\t\t\t$site_status['good']++;\n\t\t\t}\n\t\t}\n\n\t\tset_transient( 'health-check-site-status-result', wp_json_encode( $site_status ) );\n\t}\n}\n", "num_lines": 2599}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Administration API: WP_Site_Icon class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.3.0\n */\n\n/**\n * Core class used to implement site icon functionality.\n *\n * @since 4.3.0\n */\nclass WP_Site_Icon {\n\n\t/**\n\t * The minimum size of the site icon.\n\t *\n\t * @since 4.3.0\n\t * @var int\n\t */\n\tpublic $min_size = 512;\n\n\t/**\n\t * The size to which to crop the image so that we can display it in the UI nicely.\n\t *\n\t * @since 4.3.0\n\t * @var int\n\t */\n\tpublic $page_crop = 512;\n\n\t/**\n\t * List of site icon sizes.\n\t *\n\t * @since 4.3.0\n\t * @var int[]\n\t */\n\tpublic $site_icon_sizes = array(\n\t\t/*\n\t\t * Square, medium sized tiles for IE11+.\n\t\t *\n\t\t * See https://msdn.microsoft.com/library/dn455106(v=vs.85).aspx\n\t\t */\n\t\t270,\n\n\t\t/*\n\t\t * App icon for Android/Chrome.\n\t\t *\n\t\t * @link https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android\n\t\t * @link https://developer.chrome.com/multidevice/android/installtohomescreen\n\t\t */\n\t\t192,\n\n\t\t/*\n\t\t * App icons up to iPhone 6 Plus.\n\t\t *\n\t\t * See https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html\n\t\t */\n\t\t180,\n\n\t\t// Our regular Favicon.\n\t\t32,\n\t);\n\n\t/**\n\t * Registers actions and filters.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function __construct() {\n\t\tadd_action( 'delete_attachment', array( $this, 'delete_attachment_data' ) );\n\t\tadd_filter( 'get_post_metadata', array( $this, 'get_post_metadata' ), 10, 4 );\n\t}\n\n\t/**\n\t * Creates an attachment 'object'.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param string $cropped              Cropped image URL.\n\t * @param int    $parent_attachment_id Attachment ID of parent image.\n\t * @return array Attachment object.\n\t */\n\tpublic function create_attachment_object( $cropped, $parent_attachment_id ) {\n\t\t$parent     = get_post( $parent_attachment_id );\n\t\t$parent_url = wp_get_attachment_url( $parent->ID );\n\t\t$url        = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url );\n\n\t\t$size       = @getimagesize( $cropped );\n\t\t$image_type = ( $size ) ? $size['mime'] : 'image/jpeg';\n\n\t\t$object = array(\n\t\t\t'ID'             => $parent_attachment_id,\n\t\t\t'post_title'     => wp_basename( $cropped ),\n\t\t\t'post_content'   => $url,\n\t\t\t'post_mime_type' => $image_type,\n\t\t\t'guid'           => $url,\n\t\t\t'context'        => 'site-icon',\n\t\t);\n\n\t\treturn $object;\n\t}\n\n\t/**\n\t * Inserts an attachment.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param array  $object Attachment object.\n\t * @param string $file   File path of the attached image.\n\t * @return int           Attachment ID\n\t */\n\tpublic function insert_attachment( $object, $file ) {\n\t\t$attachment_id = wp_insert_attachment( $object, $file );\n\t\t$metadata      = wp_generate_attachment_metadata( $attachment_id, $file );\n\n\t\t/**\n\t\t * Filters the site icon attachment metadata.\n\t\t *\n\t\t * @since 4.3.0\n\t\t *\n\t\t * @see wp_generate_attachment_metadata()\n\t\t *\n\t\t * @param array $metadata Attachment metadata.\n\t\t */\n\t\t$metadata = apply_filters( 'site_icon_attachment_metadata', $metadata );\n\t\twp_update_attachment_metadata( $attachment_id, $metadata );\n\n\t\treturn $attachment_id;\n\t}\n\n\t/**\n\t * Adds additional sizes to be made when creating the site icon images.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param array[] $sizes Array of arrays containing information for additional sizes.\n\t * @return array[] Array of arrays containing additional image sizes.\n\t */\n\tpublic function additional_sizes( $sizes = array() ) {\n\t\t$only_crop_sizes = array();\n\n\t\t/**\n\t\t * Filters the different dimensions that a site icon is saved in.\n\t\t *\n\t\t * @since 4.3.0\n\t\t *\n\t\t * @param int[] $site_icon_sizes Array of sizes available for the Site Icon.\n\t\t */\n\t\t$this->site_icon_sizes = apply_filters( 'site_icon_image_sizes', $this->site_icon_sizes );\n\n\t\t// Use a natural sort of numbers.\n\t\tnatsort( $this->site_icon_sizes );\n\t\t$this->site_icon_sizes = array_reverse( $this->site_icon_sizes );\n\n\t\t// Ensure that we only resize the image into sizes that allow cropping.\n\t\tforeach ( $sizes as $name => $size_array ) {\n\t\t\tif ( isset( $size_array['crop'] ) ) {\n\t\t\t\t$only_crop_sizes[ $name ] = $size_array;\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $this->site_icon_sizes as $size ) {\n\t\t\tif ( $size < $this->min_size ) {\n\t\t\t\t$only_crop_sizes[ 'site_icon-' . $size ] = array(\n\t\t\t\t\t'width ' => $size,\n\t\t\t\t\t'height' => $size,\n\t\t\t\t\t'crop'   => true,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $only_crop_sizes;\n\t}\n\n\t/**\n\t * Adds Site Icon sizes to the array of image sizes on demand.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param string[] $sizes Array of image size names.\n\t * @return string[] Array of image size names.\n\t */\n\tpublic function intermediate_image_sizes( $sizes = array() ) {\n\t\t/** This filter is documented in wp-admin/includes/class-wp-site-icon.php */\n\t\t$this->site_icon_sizes = apply_filters( 'site_icon_image_sizes', $this->site_icon_sizes );\n\t\tforeach ( $this->site_icon_sizes as $size ) {\n\t\t\t$sizes[] = 'site_icon-' . $size;\n\t\t}\n\n\t\treturn $sizes;\n\t}\n\n\t/**\n\t * Deletes the Site Icon when the image file is deleted.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param int $post_id Attachment ID.\n\t */\n\tpublic function delete_attachment_data( $post_id ) {\n\t\t$site_icon_id = get_option( 'site_icon' );\n\n\t\tif ( $site_icon_id && $post_id == $site_icon_id ) {\n\t\t\tdelete_option( 'site_icon' );\n\t\t}\n\t}\n\n\t/**\n\t * Adds custom image sizes when meta data for an image is requested, that happens to be used as Site Icon.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param null|array|string $value    The value get_metadata() should return a single metadata value, or an\n\t *                                    array of values.\n\t * @param int               $post_id  Post ID.\n\t * @param string            $meta_key Meta key.\n\t * @param string|array      $single   Meta value, or an array of values.\n\t * @return array|null|string The attachment metadata value, array of values, or null.\n\t */\n\tpublic function get_post_metadata( $value, $post_id, $meta_key, $single ) {\n\t\tif ( $single && '_wp_attachment_backup_sizes' === $meta_key ) {\n\t\t\t$site_icon_id = get_option( 'site_icon' );\n\n\t\t\tif ( $post_id == $site_icon_id ) {\n\t\t\t\tadd_filter( 'intermediate_image_sizes', array( $this, 'intermediate_image_sizes' ) );\n\t\t\t}\n\t\t}\n\n\t\treturn $value;\n\t}\n}\n", "num_lines": 234}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_Terms_List_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n/**\n * Core class used to implement displaying terms in a list table.\n *\n * @since 3.1.0\n * @access private\n *\n * @see WP_List_Table\n */\nclass WP_Terms_List_Table extends WP_List_Table {\n\n\tpublic $callback_args;\n\n\tprivate $level;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @see WP_List_Table::__construct() for more information on default arguments.\n\t *\n\t * @global string $post_type\n\t * @global string $taxonomy\n\t * @global string $action\n\t * @global object $tax\n\t *\n\t * @param array $args An associative array of arguments.\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\tglobal $post_type, $taxonomy, $action, $tax;\n\n\t\tparent::__construct(\n\t\t\tarray(\n\t\t\t\t'plural'   => 'tags',\n\t\t\t\t'singular' => 'tag',\n\t\t\t\t'screen'   => isset( $args['screen'] ) ? $args['screen'] : null,\n\t\t\t)\n\t\t);\n\n\t\t$action    = $this->screen->action;\n\t\t$post_type = $this->screen->post_type;\n\t\t$taxonomy  = $this->screen->taxonomy;\n\n\t\tif ( empty( $taxonomy ) ) {\n\t\t\t$taxonomy = 'post_tag';\n\t\t}\n\n\t\tif ( ! taxonomy_exists( $taxonomy ) ) {\n\t\t\twp_die( __( 'Invalid taxonomy.' ) );\n\t\t}\n\n\t\t$tax = get_taxonomy( $taxonomy );\n\n\t\t// @todo Still needed? Maybe just the show_ui part.\n\t\tif ( empty( $post_type ) || ! in_array( $post_type, get_post_types( array( 'show_ui' => true ) ), true ) ) {\n\t\t\t$post_type = 'post';\n\t\t}\n\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function ajax_user_can() {\n\t\treturn current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->manage_terms );\n\t}\n\n\t/**\n\t */\n\tpublic function prepare_items() {\n\t\t$tags_per_page = $this->get_items_per_page( 'edit_' . $this->screen->taxonomy . '_per_page' );\n\n\t\tif ( 'post_tag' === $this->screen->taxonomy ) {\n\t\t\t/**\n\t\t\t * Filters the number of terms displayed per page for the Tags list table.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t *\n\t\t\t * @param int $tags_per_page Number of tags to be displayed. Default 20.\n\t\t\t */\n\t\t\t$tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );\n\n\t\t\t/**\n\t\t\t * Filters the number of terms displayed per page for the Tags list table.\n\t\t\t *\n\t\t\t * @since 2.7.0\n\t\t\t * @deprecated 2.8.0 Use {@see 'edit_tags_per_page'} instead.\n\t\t\t *\n\t\t\t * @param int $tags_per_page Number of tags to be displayed. Default 20.\n\t\t\t */\n\t\t\t$tags_per_page = apply_filters_deprecated( 'tagsperpage', array( $tags_per_page ), '2.8.0', 'edit_tags_per_page' );\n\t\t} elseif ( 'category' === $this->screen->taxonomy ) {\n\t\t\t/**\n\t\t\t * Filters the number of terms displayed per page for the Categories list table.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t *\n\t\t\t * @param int $tags_per_page Number of categories to be displayed. Default 20.\n\t\t\t */\n\t\t\t$tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page );\n\t\t}\n\n\t\t$search = ! empty( $_REQUEST['s'] ) ? trim( wp_unslash( $_REQUEST['s'] ) ) : '';\n\n\t\t$args = array(\n\t\t\t'search' => $search,\n\t\t\t'page'   => $this->get_pagenum(),\n\t\t\t'number' => $tags_per_page,\n\t\t);\n\n\t\tif ( ! empty( $_REQUEST['orderby'] ) ) {\n\t\t\t$args['orderby'] = trim( wp_unslash( $_REQUEST['orderby'] ) );\n\t\t}\n\n\t\tif ( ! empty( $_REQUEST['order'] ) ) {\n\t\t\t$args['order'] = trim( wp_unslash( $_REQUEST['order'] ) );\n\t\t}\n\n\t\t$this->callback_args = $args;\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items' => wp_count_terms( $this->screen->taxonomy, compact( 'search' ) ),\n\t\t\t\t'per_page'    => $tags_per_page,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function has_items() {\n\t\t// @todo Populate $this->items in prepare_items().\n\t\treturn true;\n\t}\n\n\t/**\n\t */\n\tpublic function no_items() {\n\t\techo get_taxonomy( $this->screen->taxonomy )->labels->not_found;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_bulk_actions() {\n\t\t$actions = array();\n\n\t\tif ( current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->delete_terms ) ) {\n\t\t\t$actions['delete'] = __( 'Delete' );\n\t\t}\n\n\t\treturn $actions;\n\t}\n\n\t/**\n\t * @return string\n\t */\n\tpublic function current_action() {\n\t\tif ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && ( 'delete' === $_REQUEST['action'] || 'delete' === $_REQUEST['action2'] ) ) {\n\t\t\treturn 'bulk-delete';\n\t\t}\n\n\t\treturn parent::current_action();\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic function get_columns() {\n\t\t$columns = array(\n\t\t\t'cb'          => '<input type=\"checkbox\" />',\n\t\t\t'name'        => _x( 'Name', 'term name' ),\n\t\t\t'description' => __( 'Description' ),\n\t\t\t'slug'        => __( 'Slug' ),\n\t\t);\n\n\t\tif ( 'link_category' === $this->screen->taxonomy ) {\n\t\t\t$columns['links'] = __( 'Links' );\n\t\t} else {\n\t\t\t$columns['posts'] = _x( 'Count', 'Number/count of items' );\n\t\t}\n\n\t\treturn $columns;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tprotected function get_sortable_columns() {\n\t\treturn array(\n\t\t\t'name'        => 'name',\n\t\t\t'description' => 'description',\n\t\t\t'slug'        => 'slug',\n\t\t\t'posts'       => 'count',\n\t\t\t'links'       => 'count',\n\t\t);\n\t}\n\n\t/**\n\t */\n\tpublic function display_rows_or_placeholder() {\n\t\t$taxonomy = $this->screen->taxonomy;\n\n\t\t$args = wp_parse_args(\n\t\t\t$this->callback_args,\n\t\t\tarray(\n\t\t\t\t'taxonomy'   => $taxonomy,\n\t\t\t\t'page'       => 1,\n\t\t\t\t'number'     => 20,\n\t\t\t\t'search'     => '',\n\t\t\t\t'hide_empty' => 0,\n\t\t\t)\n\t\t);\n\n\t\t$page = $args['page'];\n\n\t\t// Set variable because $args['number'] can be subsequently overridden.\n\t\t$number = $args['number'];\n\n\t\t$offset         = ( $page - 1 ) * $number;\n\t\t$args['offset'] = $offset;\n\n\t\t// Convert it to table rows.\n\t\t$count = 0;\n\n\t\tif ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $args['orderby'] ) ) {\n\t\t\t// We'll need the full set of terms then.\n\t\t\t$args['number'] = 0;\n\t\t\t$args['offset'] = $args['number'];\n\t\t}\n\n\t\t$terms = get_terms( $args );\n\n\t\tif ( empty( $terms ) || ! is_array( $terms ) ) {\n\t\t\techo '<tr class=\"no-items\"><td class=\"colspanchange\" colspan=\"' . $this->get_column_count() . '\">';\n\t\t\t$this->no_items();\n\t\t\techo '</td></tr>';\n\t\t\treturn;\n\t\t}\n\n\t\tif ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $args['orderby'] ) ) {\n\t\t\tif ( ! empty( $args['search'] ) ) {// Ignore children on searches.\n\t\t\t\t$children = array();\n\t\t\t} else {\n\t\t\t\t$children = _get_term_hierarchy( $taxonomy );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Some funky recursion to get the job done (paging & parents mainly) is contained within.\n\t\t\t * Skip it for non-hierarchical taxonomies for performance sake.\n\t\t\t */\n\t\t\t$this->_rows( $taxonomy, $terms, $children, $offset, $number, $count );\n\t\t} else {\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$this->single_row( $term );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param string $taxonomy\n\t * @param array  $terms\n\t * @param array  $children\n\t * @param int    $start\n\t * @param int    $per_page\n\t * @param int    $count\n\t * @param int    $parent\n\t * @param int    $level\n\t */\n\tprivate function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) {\n\n\t\t$end = $start + $per_page;\n\n\t\tforeach ( $terms as $key => $term ) {\n\n\t\t\tif ( $count >= $end ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( $term->parent != $parent && empty( $_REQUEST['s'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If the page starts in a subtree, print the parents.\n\t\t\tif ( $count == $start && $term->parent > 0 && empty( $_REQUEST['s'] ) ) {\n\t\t\t\t$my_parents = array();\n\t\t\t\t$parent_ids = array();\n\t\t\t\t$p          = $term->parent;\n\t\t\t\twhile ( $p ) {\n\t\t\t\t\t$my_parent    = get_term( $p, $taxonomy );\n\t\t\t\t\t$my_parents[] = $my_parent;\n\t\t\t\t\t$p            = $my_parent->parent;\n\t\t\t\t\tif ( in_array( $p, $parent_ids, true ) ) { // Prevent parent loops.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$parent_ids[] = $p;\n\t\t\t\t}\n\t\t\t\tunset( $parent_ids );\n\n\t\t\t\t$num_parents = count( $my_parents );\n\t\t\t\twhile ( $my_parent = array_pop( $my_parents ) ) {\n\t\t\t\t\techo \"\\t\";\n\t\t\t\t\t$this->single_row( $my_parent, $level - $num_parents );\n\t\t\t\t\t$num_parents--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $count >= $start ) {\n\t\t\t\techo \"\\t\";\n\t\t\t\t$this->single_row( $term, $level );\n\t\t\t}\n\n\t\t\t++$count;\n\n\t\t\tunset( $terms[ $key ] );\n\n\t\t\tif ( isset( $children[ $term->term_id ] ) && empty( $_REQUEST['s'] ) ) {\n\t\t\t\t$this->_rows( $taxonomy, $terms, $children, $start, $per_page, $count, $term->term_id, $level + 1 );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @global string $taxonomy\n\t * @param WP_Term $tag   Term object.\n\t * @param int     $level\n\t */\n\tpublic function single_row( $tag, $level = 0 ) {\n\t\tglobal $taxonomy;\n\t\t$tag = sanitize_term( $tag, $taxonomy );\n\n\t\t$this->level = $level;\n\n\t\tif ( $tag->parent ) {\n\t\t\t$count = count( get_ancestors( $tag->term_id, $taxonomy, 'taxonomy' ) );\n\t\t\t$level = 'level-' . $count;\n\t\t} else {\n\t\t\t$level = 'level-0';\n\t\t}\n\n\t\techo '<tr id=\"tag-' . $tag->term_id . '\" class=\"' . $level . '\">';\n\t\t$this->single_row_columns( $tag );\n\t\techo '</tr>';\n\t}\n\n\t/**\n\t * @param WP_Term $tag Term object.\n\t * @return string\n\t */\n\tpublic function column_cb( $tag ) {\n\t\tif ( current_user_can( 'delete_term', $tag->term_id ) ) {\n\t\t\treturn sprintf(\n\t\t\t\t'<label class=\"screen-reader-text\" for=\"cb-select-%1$s\">%2$s</label>' .\n\t\t\t\t'<input type=\"checkbox\" name=\"delete_tags[]\" value=\"%1$s\" id=\"cb-select-%1$s\" />',\n\t\t\t\t$tag->term_id,\n\t\t\t\t/* translators: %s: Taxonomy term name. */\n\t\t\t\tsprintf( __( 'Select %s' ), $tag->name )\n\t\t\t);\n\t\t}\n\n\t\treturn '&nbsp;';\n\t}\n\n\t/**\n\t * @param WP_Term $tag Term object.\n\t * @return string\n\t */\n\tpublic function column_name( $tag ) {\n\t\t$taxonomy = $this->screen->taxonomy;\n\n\t\t$pad = str_repeat( '&#8212; ', max( 0, $this->level ) );\n\n\t\t/**\n\t\t * Filters display of the term name in the terms list table.\n\t\t *\n\t\t * The default output may include padding due to the term's\n\t\t * current level in the term hierarchy.\n\t\t *\n\t\t * @since 2.5.0\n\t\t *\n\t\t * @see WP_Terms_List_Table::column_name()\n\t\t *\n\t\t * @param string $pad_tag_name The term name, padded if not top-level.\n\t\t * @param WP_Term $tag         Term object.\n\t\t */\n\t\t$name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );\n\n\t\t$qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' );\n\n\t\t$uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI'];\n\n\t\t$edit_link = get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type );\n\n\t\tif ( $edit_link ) {\n\t\t\t$edit_link = add_query_arg(\n\t\t\t\t'wp_http_referer',\n\t\t\t\turlencode( wp_unslash( $uri ) ),\n\t\t\t\t$edit_link\n\t\t\t);\n\t\t\t$name      = sprintf(\n\t\t\t\t'<a class=\"row-title\" href=\"%s\" aria-label=\"%s\">%s</a>',\n\t\t\t\tesc_url( $edit_link ),\n\t\t\t\t/* translators: %s: Taxonomy term name. */\n\t\t\t\tesc_attr( sprintf( __( '&#8220;%s&#8221; (Edit)' ), $tag->name ) ),\n\t\t\t\t$name\n\t\t\t);\n\t\t}\n\n\t\t$out = sprintf(\n\t\t\t'<strong>%s</strong><br />',\n\t\t\t$name\n\t\t);\n\n\t\t$out .= '<div class=\"hidden\" id=\"inline_' . $qe_data->term_id . '\">';\n\t\t$out .= '<div class=\"name\">' . $qe_data->name . '</div>';\n\n\t\t/** This filter is documented in wp-admin/edit-tag-form.php */\n\t\t$out .= '<div class=\"slug\">' . apply_filters( 'editable_slug', $qe_data->slug, $qe_data ) . '</div>';\n\t\t$out .= '<div class=\"parent\">' . $qe_data->parent . '</div></div>';\n\n\t\treturn $out;\n\t}\n\n\t/**\n\t * Gets the name of the default primary column.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @return string Name of the default primary column, in this case, 'name'.\n\t */\n\tprotected function get_default_primary_column_name() {\n\t\treturn 'name';\n\t}\n\n\t/**\n\t * Generates and displays row action links.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Term $tag         Tag being acted upon.\n\t * @param string  $column_name Current column name.\n\t * @param string  $primary     Primary column name.\n\t * @return string Row actions output for terms, or an empty string\n\t *                if the current column is not the primary column.\n\t */\n\tprotected function handle_row_actions( $tag, $column_name, $primary ) {\n\t\tif ( $primary !== $column_name ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$taxonomy = $this->screen->taxonomy;\n\t\t$tax      = get_taxonomy( $taxonomy );\n\t\t$uri      = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI'];\n\n\t\t$edit_link = add_query_arg(\n\t\t\t'wp_http_referer',\n\t\t\turlencode( wp_unslash( $uri ) ),\n\t\t\tget_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type )\n\t\t);\n\n\t\t$actions = array();\n\t\tif ( current_user_can( 'edit_term', $tag->term_id ) ) {\n\t\t\t$actions['edit'] = sprintf(\n\t\t\t\t'<a href=\"%s\" aria-label=\"%s\">%s</a>',\n\t\t\t\tesc_url( $edit_link ),\n\t\t\t\t/* translators: %s: Taxonomy term name. */\n\t\t\t\tesc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $tag->name ) ),\n\t\t\t\t__( 'Edit' )\n\t\t\t);\n\t\t\t$actions['inline hide-if-no-js'] = sprintf(\n\t\t\t\t'<button type=\"button\" class=\"button-link editinline\" aria-label=\"%s\" aria-expanded=\"false\">%s</button>',\n\t\t\t\t/* translators: %s: Taxonomy term name. */\n\t\t\t\tesc_attr( sprintf( __( 'Quick edit &#8220;%s&#8221; inline' ), $tag->name ) ),\n\t\t\t\t__( 'Quick&nbsp;Edit' )\n\t\t\t);\n\t\t}\n\t\tif ( current_user_can( 'delete_term', $tag->term_id ) ) {\n\t\t\t$actions['delete'] = sprintf(\n\t\t\t\t'<a href=\"%s\" class=\"delete-tag aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\twp_nonce_url( \"edit-tags.php?action=delete&amp;taxonomy=$taxonomy&amp;tag_ID=$tag->term_id\", 'delete-tag_' . $tag->term_id ),\n\t\t\t\t/* translators: %s: Taxonomy term name. */\n\t\t\t\tesc_attr( sprintf( __( 'Delete &#8220;%s&#8221;' ), $tag->name ) ),\n\t\t\t\t__( 'Delete' )\n\t\t\t);\n\t\t}\n\t\tif ( is_taxonomy_viewable( $tax ) ) {\n\t\t\t$actions['view'] = sprintf(\n\t\t\t\t'<a href=\"%s\" aria-label=\"%s\">%s</a>',\n\t\t\t\tget_term_link( $tag ),\n\t\t\t\t/* translators: %s: Taxonomy term name. */\n\t\t\t\tesc_attr( sprintf( __( 'View &#8220;%s&#8221; archive' ), $tag->name ) ),\n\t\t\t\t__( 'View' )\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Filters the action links displayed for each term in the Tags list table.\n\t\t *\n\t\t * @since 2.8.0\n\t\t * @since 3.0.0 Deprecated in favor of {@see '{$taxonomy}_row_actions'} filter.\n\t\t * @since 5.4.2 Restored (un-deprecated).\n\t\t *\n\t\t * @param string[] $actions An array of action links to be displayed. Default\n\t\t *                          'Edit', 'Quick Edit', 'Delete', and 'View'.\n\t\t * @param WP_Term  $tag     Term object.\n\t\t */\n\t\t$actions = apply_filters( 'tag_row_actions', $actions, $tag );\n\n\t\t/**\n\t\t * Filters the action links displayed for each term in the terms list table.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string[] $actions An array of action links to be displayed. Default\n\t\t *                          'Edit', 'Quick Edit', 'Delete', and 'View'.\n\t\t * @param WP_Term  $tag     Term object.\n\t\t */\n\t\t$actions = apply_filters( \"{$taxonomy}_row_actions\", $actions, $tag );\n\n\t\treturn $this->row_actions( $actions );\n\t}\n\n\t/**\n\t * @param WP_Term $tag Term object.\n\t * @return string\n\t */\n\tpublic function column_description( $tag ) {\n\t\tif ( $tag->description ) {\n\t\t\treturn $tag->description;\n\t\t} else {\n\t\t\treturn '<span aria-hidden=\"true\">&#8212;</span><span class=\"screen-reader-text\">' . __( 'No description' ) . '</span>';\n\t\t}\n\t}\n\n\t/**\n\t * @param WP_Term $tag Term object.\n\t * @return string\n\t */\n\tpublic function column_slug( $tag ) {\n\t\t/** This filter is documented in wp-admin/edit-tag-form.php */\n\t\treturn apply_filters( 'editable_slug', $tag->slug, $tag );\n\t}\n\n\t/**\n\t * @param WP_Term $tag Term object.\n\t * @return string\n\t */\n\tpublic function column_posts( $tag ) {\n\t\t$count = number_format_i18n( $tag->count );\n\n\t\t$tax = get_taxonomy( $this->screen->taxonomy );\n\n\t\t$ptype_object = get_post_type_object( $this->screen->post_type );\n\t\tif ( ! $ptype_object->show_ui ) {\n\t\t\treturn $count;\n\t\t}\n\n\t\tif ( $tax->query_var ) {\n\t\t\t$args = array( $tax->query_var => $tag->slug );\n\t\t} else {\n\t\t\t$args = array(\n\t\t\t\t'taxonomy' => $tax->name,\n\t\t\t\t'term'     => $tag->slug,\n\t\t\t);\n\t\t}\n\n\t\tif ( 'post' !== $this->screen->post_type ) {\n\t\t\t$args['post_type'] = $this->screen->post_type;\n\t\t}\n\n\t\tif ( 'attachment' === $this->screen->post_type ) {\n\t\t\treturn \"<a href='\" . esc_url( add_query_arg( $args, 'upload.php' ) ) . \"'>$count</a>\";\n\t\t}\n\n\t\treturn \"<a href='\" . esc_url( add_query_arg( $args, 'edit.php' ) ) . \"'>$count</a>\";\n\t}\n\n\t/**\n\t * @param WP_Term $tag Term object.\n\t * @return string\n\t */\n\tpublic function column_links( $tag ) {\n\t\t$count = number_format_i18n( $tag->count );\n\t\tif ( $count ) {\n\t\t\t$count = \"<a href='link-manager.php?cat_id=$tag->term_id'>$count</a>\";\n\t\t}\n\t\treturn $count;\n\t}\n\n\t/**\n\t * @param WP_Term $tag         Term object.\n\t * @param string  $column_name Name of the column.\n\t * @return string\n\t */\n\tpublic function column_default( $tag, $column_name ) {\n\t\t/**\n\t\t * Filters the displayed columns in the terms list table.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->screen->taxonomy`,\n\t\t * refers to the slug of the current taxonomy.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string $string      Blank string.\n\t\t * @param string $column_name Name of the column.\n\t\t * @param int    $term_id     Term ID.\n\t\t */\n\t\treturn apply_filters( \"manage_{$this->screen->taxonomy}_custom_column\", '', $column_name, $tag->term_id );\n\t}\n\n\t/**\n\t * Outputs the hidden row displayed when inline editing\n\t *\n\t * @since 3.1.0\n\t */\n\tpublic function inline_edit() {\n\t\t$tax = get_taxonomy( $this->screen->taxonomy );\n\n\t\tif ( ! current_user_can( $tax->cap->edit_terms ) ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\n\t\t<form method=\"get\">\n\t\t<table style=\"display: none\"><tbody id=\"inlineedit\">\n\n\t\t\t<tr id=\"inline-edit\" class=\"inline-edit-row\" style=\"display: none\">\n\t\t\t<td colspan=\"<?php echo $this->get_column_count(); ?>\" class=\"colspanchange\">\n\n\t\t\t<fieldset>\n\t\t\t\t<legend class=\"inline-edit-legend\"><?php _e( 'Quick Edit' ); ?></legend>\n\t\t\t\t<div class=\"inline-edit-col\">\n\t\t\t\t<label>\n\t\t\t\t\t<span class=\"title\"><?php _ex( 'Name', 'term name' ); ?></span>\n\t\t\t\t\t<span class=\"input-text-wrap\"><input type=\"text\" name=\"name\" class=\"ptitle\" value=\"\" /></span>\n\t\t\t\t</label>\n\n\t\t\t\t<?php if ( ! global_terms_enabled() ) : ?>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<span class=\"title\"><?php _e( 'Slug' ); ?></span>\n\t\t\t\t\t\t<span class=\"input-text-wrap\"><input type=\"text\" name=\"slug\" class=\"ptitle\" value=\"\" /></span>\n\t\t\t\t\t</label>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\n\t\t\t<?php\n\t\t\t$core_columns = array(\n\t\t\t\t'cb'          => true,\n\t\t\t\t'description' => true,\n\t\t\t\t'name'        => true,\n\t\t\t\t'slug'        => true,\n\t\t\t\t'posts'       => true,\n\t\t\t);\n\n\t\t\tlist( $columns ) = $this->get_column_info();\n\n\t\t\tforeach ( $columns as $column_name => $column_display_name ) {\n\t\t\t\tif ( isset( $core_columns[ $column_name ] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t/** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */\n\t\t\t\tdo_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $this->screen->taxonomy );\n\t\t\t}\n\t\t\t?>\n\n\t\t\t<div class=\"inline-edit-save submit\">\n\t\t\t\t<button type=\"button\" class=\"cancel button alignleft\"><?php _e( 'Cancel' ); ?></button>\n\t\t\t\t<button type=\"button\" class=\"save button button-primary alignright\"><?php echo $tax->labels->update_item; ?></button>\n\t\t\t\t<span class=\"spinner\"></span>\n\n\t\t\t\t<?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?>\n\t\t\t\t<input type=\"hidden\" name=\"taxonomy\" value=\"<?php echo esc_attr( $this->screen->taxonomy ); ?>\" />\n\t\t\t\t<input type=\"hidden\" name=\"post_type\" value=\"<?php echo esc_attr( $this->screen->post_type ); ?>\" />\n\t\t\t\t<br class=\"clear\" />\n\n\t\t\t\t<div class=\"notice notice-error notice-alt inline hidden\">\n\t\t\t\t\t<p class=\"error\"></p>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t</td></tr>\n\n\t\t</tbody></table>\n\t\t</form>\n\t\t<?php\n\t}\n}\n", "num_lines": 702}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_Theme_Install_List_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n/**\n * Core class used to implement displaying themes to install in a list table.\n *\n * @since 3.1.0\n * @access private\n *\n * @see WP_Themes_List_Table\n */\nclass WP_Theme_Install_List_Table extends WP_Themes_List_Table {\n\n\tpublic $features = array();\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function ajax_user_can() {\n\t\treturn current_user_can( 'install_themes' );\n\t}\n\n\t/**\n\t * @global array  $tabs\n\t * @global string $tab\n\t * @global int    $paged\n\t * @global string $type\n\t * @global array  $theme_field_defaults\n\t */\n\tpublic function prepare_items() {\n\t\trequire ABSPATH . 'wp-admin/includes/theme-install.php';\n\n\t\tglobal $tabs, $tab, $paged, $type, $theme_field_defaults;\n\t\twp_reset_vars( array( 'tab' ) );\n\n\t\t$search_terms  = array();\n\t\t$search_string = '';\n\t\tif ( ! empty( $_REQUEST['s'] ) ) {\n\t\t\t$search_string = strtolower( wp_unslash( $_REQUEST['s'] ) );\n\t\t\t$search_terms  = array_unique( array_filter( array_map( 'trim', explode( ',', $search_string ) ) ) );\n\t\t}\n\n\t\tif ( ! empty( $_REQUEST['features'] ) ) {\n\t\t\t$this->features = $_REQUEST['features'];\n\t\t}\n\n\t\t$paged = $this->get_pagenum();\n\n\t\t$per_page = 36;\n\n\t\t// These are the tabs which are shown on the page,\n\t\t$tabs              = array();\n\t\t$tabs['dashboard'] = __( 'Search' );\n\t\tif ( 'search' === $tab ) {\n\t\t\t$tabs['search'] = __( 'Search Results' );\n\t\t}\n\t\t$tabs['upload']   = __( 'Upload' );\n\t\t$tabs['featured'] = _x( 'Featured', 'themes' );\n\t\t//$tabs['popular']  = _x( 'Popular', 'themes' );\n\t\t$tabs['new']     = _x( 'Latest', 'themes' );\n\t\t$tabs['updated'] = _x( 'Recently Updated', 'themes' );\n\n\t\t$nonmenu_tabs = array( 'theme-information' ); // Valid actions to perform which do not have a Menu item.\n\n\t\t/** This filter is documented in wp-admin/theme-install.php */\n\t\t$tabs = apply_filters( 'install_themes_tabs', $tabs );\n\n\t\t/**\n\t\t * Filters tabs not associated with a menu item on the Install Themes screen.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string[] $nonmenu_tabs The tabs that don't have a menu item on\n\t\t *                               the Install Themes screen.\n\t\t */\n\t\t$nonmenu_tabs = apply_filters( 'install_themes_nonmenu_tabs', $nonmenu_tabs );\n\n\t\t// If a non-valid menu tab has been selected, And it's not a non-menu action.\n\t\tif ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs, true ) ) ) {\n\t\t\t$tab = key( $tabs );\n\t\t}\n\n\t\t$args = array(\n\t\t\t'page'     => $paged,\n\t\t\t'per_page' => $per_page,\n\t\t\t'fields'   => $theme_field_defaults,\n\t\t);\n\n\t\tswitch ( $tab ) {\n\t\t\tcase 'search':\n\t\t\t\t$type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';\n\t\t\t\tswitch ( $type ) {\n\t\t\t\t\tcase 'tag':\n\t\t\t\t\t\t$args['tag'] = array_map( 'sanitize_key', $search_terms );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'term':\n\t\t\t\t\t\t$args['search'] = $search_string;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'author':\n\t\t\t\t\t\t$args['author'] = $search_string;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $this->features ) ) {\n\t\t\t\t\t$args['tag']      = $this->features;\n\t\t\t\t\t$_REQUEST['s']    = implode( ',', $this->features );\n\t\t\t\t\t$_REQUEST['type'] = 'tag';\n\t\t\t\t}\n\n\t\t\t\tadd_action( 'install_themes_table_header', 'install_theme_search_form', 10, 0 );\n\t\t\t\tbreak;\n\n\t\t\tcase 'featured':\n\t\t\t\t// case 'popular':\n\t\t\tcase 'new':\n\t\t\tcase 'updated':\n\t\t\t\t$args['browse'] = $tab;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$args = false;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t/**\n\t\t * Filters API request arguments for each Install Themes screen tab.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$tab`, refers to the theme install\n\t\t * tabs. Default tabs are 'dashboard', 'search', 'upload', 'featured',\n\t\t * 'new', and 'updated'.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param array|false $args Theme install API arguments.\n\t\t */\n\t\t$args = apply_filters( \"install_themes_table_api_args_{$tab}\", $args );\n\n\t\tif ( ! $args ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$api = themes_api( 'query_themes', $args );\n\n\t\tif ( is_wp_error( $api ) ) {\n\t\t\twp_die( $api->get_error_message() . '</p> <p><a href=\"#\" onclick=\"document.location.reload(); return false;\">' . __( 'Try Again' ) . '</a>' );\n\t\t}\n\n\t\t$this->items = $api->themes;\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items'     => $api->info['results'],\n\t\t\t\t'per_page'        => $args['per_page'],\n\t\t\t\t'infinite_scroll' => true,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t */\n\tpublic function no_items() {\n\t\t_e( 'No themes match your request.' );\n\t}\n\n\t/**\n\t * @global array $tabs\n\t * @global string $tab\n\t * @return array\n\t */\n\tprotected function get_views() {\n\t\tglobal $tabs, $tab;\n\n\t\t$display_tabs = array();\n\t\tforeach ( (array) $tabs as $action => $text ) {\n\t\t\t$current_link_attributes                    = ( $action === $tab ) ? ' class=\"current\" aria-current=\"page\"' : '';\n\t\t\t$href                                       = self_admin_url( 'theme-install.php?tab=' . $action );\n\t\t\t$display_tabs[ 'theme-install-' . $action ] = \"<a href='$href'$current_link_attributes>$text</a>\";\n\t\t}\n\n\t\treturn $display_tabs;\n\t}\n\n\t/**\n\t * Displays the theme install table.\n\t *\n\t * Overrides the parent display() method to provide a different container.\n\t *\n\t * @since 3.1.0\n\t */\n\tpublic function display() {\n\t\twp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );\n\t\t?>\n\t\t<div class=\"tablenav top themes\">\n\t\t\t<div class=\"alignleft actions\">\n\t\t\t\t<?php\n\t\t\t\t/**\n\t\t\t\t * Fires in the Install Themes list table header.\n\t\t\t\t *\n\t\t\t\t * @since 2.8.0\n\t\t\t\t */\n\t\t\t\tdo_action( 'install_themes_table_header' );\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<?php $this->pagination( 'top' ); ?>\n\t\t\t<br class=\"clear\" />\n\t\t</div>\n\n\t\t<div id=\"availablethemes\">\n\t\t\t<?php $this->display_rows_or_placeholder(); ?>\n\t\t</div>\n\n\t\t<?php\n\t\t$this->tablenav( 'bottom' );\n\t}\n\n\t/**\n\t */\n\tpublic function display_rows() {\n\t\t$themes = $this->items;\n\t\tforeach ( $themes as $theme ) {\n\t\t\t?>\n\t\t\t\t<div class=\"available-theme installable-theme\">\n\t\t\t\t<?php\n\t\t\t\t\t$this->single_row( $theme );\n\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t} // End foreach $theme_names.\n\n\t\t$this->theme_installer();\n\t}\n\n\t/**\n\t * Prints a theme from the WordPress.org API.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @global array $themes_allowedtags\n\t *\n\t * @param object $theme {\n\t *     An object that contains theme data returned by the WordPress.org API.\n\t *\n\t *     @type string $name           Theme name, e.g. 'Twenty Twenty'.\n\t *     @type string $slug           Theme slug, e.g. 'twentytwenty'.\n\t *     @type string $version        Theme version, e.g. '1.1'.\n\t *     @type string $author         Theme author username, e.g. 'melchoyce'.\n\t *     @type string $preview_url    Preview URL, e.g. 'https://2020.wordpress.net/'.\n\t *     @type string $screenshot_url Screenshot URL, e.g. 'https://wordpress.org/themes/twentytwenty/'.\n\t *     @type float  $rating         Rating score.\n\t *     @type int    $num_ratings    The number of ratings.\n\t *     @type string $homepage       Theme homepage, e.g. 'https://wordpress.org/themes/twentytwenty/'.\n\t *     @type string $description    Theme description.\n\t *     @type string $download_link  Theme ZIP download URL.\n\t * }\n\t */\n\tpublic function single_row( $theme ) {\n\t\tglobal $themes_allowedtags;\n\n\t\tif ( empty( $theme ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$name   = wp_kses( $theme->name, $themes_allowedtags );\n\t\t$author = wp_kses( $theme->author, $themes_allowedtags );\n\n\t\t/* translators: %s: Theme name. */\n\t\t$preview_title = sprintf( __( 'Preview &#8220;%s&#8221;' ), $name );\n\t\t$preview_url   = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'tab'   => 'theme-information',\n\t\t\t\t'theme' => $theme->slug,\n\t\t\t),\n\t\t\tself_admin_url( 'theme-install.php' )\n\t\t);\n\n\t\t$actions = array();\n\n\t\t$install_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'action' => 'install-theme',\n\t\t\t\t'theme'  => $theme->slug,\n\t\t\t),\n\t\t\tself_admin_url( 'update.php' )\n\t\t);\n\n\t\t$update_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'action' => 'upgrade-theme',\n\t\t\t\t'theme'  => $theme->slug,\n\t\t\t),\n\t\t\tself_admin_url( 'update.php' )\n\t\t);\n\n\t\t$status = $this->_get_theme_status( $theme );\n\n\t\tswitch ( $status ) {\n\t\t\tcase 'update_available':\n\t\t\t\t$actions[] = sprintf(\n\t\t\t\t\t'<a class=\"install-now\" href=\"%s\" title=\"%s\">%s</a>',\n\t\t\t\t\tesc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ),\n\t\t\t\t\t/* translators: %s: Theme version. */\n\t\t\t\t\tesc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ),\n\t\t\t\t\t__( 'Update' )\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'newer_installed':\n\t\t\tcase 'latest_installed':\n\t\t\t\t$actions[] = sprintf(\n\t\t\t\t\t'<span class=\"install-now\" title=\"%s\">%s</span>',\n\t\t\t\t\tesc_attr__( 'This theme is already installed and is up to date' ),\n\t\t\t\t\t_x( 'Installed', 'theme' )\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'install':\n\t\t\tdefault:\n\t\t\t\t$actions[] = sprintf(\n\t\t\t\t\t'<a class=\"install-now\" href=\"%s\" title=\"%s\">%s</a>',\n\t\t\t\t\tesc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ),\n\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\tesc_attr( sprintf( _x( 'Install %s', 'theme' ), $name ) ),\n\t\t\t\t\t__( 'Install Now' )\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$actions[] = sprintf(\n\t\t\t'<a class=\"install-theme-preview\" href=\"%s\" title=\"%s\">%s</a>',\n\t\t\tesc_url( $preview_url ),\n\t\t\t/* translators: %s: Theme name. */\n\t\t\tesc_attr( sprintf( __( 'Preview %s' ), $name ) ),\n\t\t\t__( 'Preview' )\n\t\t);\n\n\t\t/**\n\t\t * Filters the install action links for a theme in the Install Themes list table.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param string[] $actions An array of theme action links. Defaults are\n\t\t *                          links to Install Now, Preview, and Details.\n\t\t * @param WP_Theme $theme   Theme object.\n\t\t */\n\t\t$actions = apply_filters( 'theme_install_actions', $actions, $theme );\n\n\t\t?>\n\t\t<a class=\"screenshot install-theme-preview\" href=\"<?php echo esc_url( $preview_url ); ?>\" title=\"<?php echo esc_attr( $preview_title ); ?>\">\n\t\t\t<img src=\"<?php echo esc_url( $theme->screenshot_url ); ?>\" width=\"150\" alt=\"\" />\n\t\t</a>\n\n\t\t<h3><?php echo $name; ?></h3>\n\t\t<div class=\"theme-author\">\n\t\t<?php\n\t\t\t/* translators: %s: Theme author. */\n\t\t\tprintf( __( 'By %s' ), $author );\n\t\t?>\n\t\t</div>\n\n\t\t<div class=\"action-links\">\n\t\t\t<ul>\n\t\t\t\t<?php foreach ( $actions as $action ) : ?>\n\t\t\t\t\t<li><?php echo $action; ?></li>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t\t<li class=\"hide-if-no-js\"><a href=\"#\" class=\"theme-detail\"><?php _e( 'Details' ); ?></a></li>\n\t\t\t</ul>\n\t\t</div>\n\n\t\t<?php\n\t\t$this->install_theme_info( $theme );\n\t}\n\n\t/**\n\t * Prints the wrapper for the theme installer.\n\t */\n\tpublic function theme_installer() {\n\t\t?>\n\t\t<div id=\"theme-installer\" class=\"wp-full-overlay expanded\">\n\t\t\t<div class=\"wp-full-overlay-sidebar\">\n\t\t\t\t<div class=\"wp-full-overlay-header\">\n\t\t\t\t\t<a href=\"#\" class=\"close-full-overlay button\"><?php _e( 'Close' ); ?></a>\n\t\t\t\t\t<span class=\"theme-install\"></span>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"wp-full-overlay-sidebar-content\">\n\t\t\t\t\t<div class=\"install-theme-info\"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"wp-full-overlay-footer\">\n\t\t\t\t\t<button type=\"button\" class=\"collapse-sidebar button\" aria-expanded=\"true\" aria-label=\"<?php esc_attr_e( 'Collapse Sidebar' ); ?>\">\n\t\t\t\t\t\t<span class=\"collapse-sidebar-arrow\"></span>\n\t\t\t\t\t\t<span class=\"collapse-sidebar-label\"><?php _e( 'Collapse' ); ?></span>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"wp-full-overlay-main\"></div>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Prints the wrapper for the theme installer with a provided theme's data.\n\t * Used to make the theme installer work for no-js.\n\t *\n\t * @param object $theme - A WordPress.org Theme API object.\n\t */\n\tpublic function theme_installer_single( $theme ) {\n\t\t?>\n\t\t<div id=\"theme-installer\" class=\"wp-full-overlay single-theme\">\n\t\t\t<div class=\"wp-full-overlay-sidebar\">\n\t\t\t\t<?php $this->install_theme_info( $theme ); ?>\n\t\t\t</div>\n\t\t\t<div class=\"wp-full-overlay-main\">\n\t\t\t\t<iframe src=\"<?php echo esc_url( $theme->preview_url ); ?>\"></iframe>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Prints the info for a theme (to be used in the theme installer modal).\n\t *\n\t * @global array $themes_allowedtags\n\t *\n\t * @param object $theme - A WordPress.org Theme API object.\n\t */\n\tpublic function install_theme_info( $theme ) {\n\t\tglobal $themes_allowedtags;\n\n\t\tif ( empty( $theme ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$name   = wp_kses( $theme->name, $themes_allowedtags );\n\t\t$author = wp_kses( $theme->author, $themes_allowedtags );\n\n\t\t$install_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'action' => 'install-theme',\n\t\t\t\t'theme'  => $theme->slug,\n\t\t\t),\n\t\t\tself_admin_url( 'update.php' )\n\t\t);\n\n\t\t$update_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'action' => 'upgrade-theme',\n\t\t\t\t'theme'  => $theme->slug,\n\t\t\t),\n\t\t\tself_admin_url( 'update.php' )\n\t\t);\n\n\t\t$status = $this->_get_theme_status( $theme );\n\n\t\t?>\n\t\t<div class=\"install-theme-info\">\n\t\t<?php\n\t\tswitch ( $status ) {\n\t\t\tcase 'update_available':\n\t\t\t\tprintf(\n\t\t\t\t\t'<a class=\"theme-install button button-primary\" href=\"%s\" title=\"%s\">%s</a>',\n\t\t\t\t\tesc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ),\n\t\t\t\t\t/* translators: %s: Theme version. */\n\t\t\t\t\tesc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ),\n\t\t\t\t\t__( 'Update' )\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'newer_installed':\n\t\t\tcase 'latest_installed':\n\t\t\t\tprintf(\n\t\t\t\t\t'<span class=\"theme-install\" title=\"%s\">%s</span>',\n\t\t\t\t\tesc_attr__( 'This theme is already installed and is up to date' ),\n\t\t\t\t\t_x( 'Installed', 'theme' )\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'install':\n\t\t\tdefault:\n\t\t\t\tprintf(\n\t\t\t\t\t'<a class=\"theme-install button button-primary\" href=\"%s\">%s</a>',\n\t\t\t\t\tesc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ),\n\t\t\t\t\t__( 'Install' )\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\t\t?>\n\t\t\t<h3 class=\"theme-name\"><?php echo $name; ?></h3>\n\t\t\t<span class=\"theme-by\">\n\t\t\t<?php\n\t\t\t\t/* translators: %s: Theme author. */\n\t\t\t\tprintf( __( 'By %s' ), $author );\n\t\t\t?>\n\t\t\t</span>\n\t\t\t<?php if ( isset( $theme->screenshot_url ) ) : ?>\n\t\t\t\t<img class=\"theme-screenshot\" src=\"<?php echo esc_url( $theme->screenshot_url ); ?>\" alt=\"\" />\n\t\t\t<?php endif; ?>\n\t\t\t<div class=\"theme-details\">\n\t\t\t\t<?php\n\t\t\t\twp_star_rating(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'rating' => $theme->rating,\n\t\t\t\t\t\t'type'   => 'percent',\n\t\t\t\t\t\t'number' => $theme->num_ratings,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t<div class=\"theme-version\">\n\t\t\t\t\t<strong><?php _e( 'Version:' ); ?> </strong>\n\t\t\t\t\t<?php echo wp_kses( $theme->version, $themes_allowedtags ); ?>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"theme-description\">\n\t\t\t\t\t<?php echo wp_kses( $theme->description, $themes_allowedtags ); ?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<input class=\"theme-preview-url\" type=\"hidden\" value=\"<?php echo esc_url( $theme->preview_url ); ?>\" />\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Send required variables to JavaScript land\n\t *\n\t * @since 3.4.0\n\t *\n\t * @global string $tab  Current tab within Themes->Install screen\n\t * @global string $type Type of search.\n\t *\n\t * @param array $extra_args Unused.\n\t */\n\tpublic function _js_vars( $extra_args = array() ) {\n\t\tglobal $tab, $type;\n\t\tparent::_js_vars( compact( 'tab', 'type' ) );\n\t}\n\n\t/**\n\t * Check to see if the theme is already installed.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param object $theme - A WordPress.org Theme API object.\n\t * @return string Theme status.\n\t */\n\tprivate function _get_theme_status( $theme ) {\n\t\t$status = 'install';\n\n\t\t$installed_theme = wp_get_theme( $theme->slug );\n\t\tif ( $installed_theme->exists() ) {\n\t\t\tif ( version_compare( $installed_theme->get( 'Version' ), $theme->version, '=' ) ) {\n\t\t\t\t$status = 'latest_installed';\n\t\t\t} elseif ( version_compare( $installed_theme->get( 'Version' ), $theme->version, '>' ) ) {\n\t\t\t\t$status = 'newer_installed';\n\t\t\t} else {\n\t\t\t\t$status = 'update_available';\n\t\t\t}\n\t\t}\n\n\t\treturn $status;\n\t}\n}\n", "num_lines": 561}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_Themes_List_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n/**\n * Core class used to implement displaying installed themes in a list table.\n *\n * @since 3.1.0\n * @access private\n *\n * @see WP_List_Table\n */\nclass WP_Themes_List_Table extends WP_List_Table {\n\n\tprotected $search_terms = array();\n\tpublic $features        = array();\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @see WP_List_Table::__construct() for more information on default arguments.\n\t *\n\t * @param array $args An associative array of arguments.\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\tparent::__construct(\n\t\t\tarray(\n\t\t\t\t'ajax'   => true,\n\t\t\t\t'screen' => isset( $args['screen'] ) ? $args['screen'] : null,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function ajax_user_can() {\n\t\t// Do not check edit_theme_options here. Ajax calls for available themes require switch_themes.\n\t\treturn current_user_can( 'switch_themes' );\n\t}\n\n\t/**\n\t */\n\tpublic function prepare_items() {\n\t\t$themes = wp_get_themes( array( 'allowed' => true ) );\n\n\t\tif ( ! empty( $_REQUEST['s'] ) ) {\n\t\t\t$this->search_terms = array_unique( array_filter( array_map( 'trim', explode( ',', strtolower( wp_unslash( $_REQUEST['s'] ) ) ) ) ) );\n\t\t}\n\n\t\tif ( ! empty( $_REQUEST['features'] ) ) {\n\t\t\t$this->features = $_REQUEST['features'];\n\t\t}\n\n\t\tif ( $this->search_terms || $this->features ) {\n\t\t\tforeach ( $themes as $key => $theme ) {\n\t\t\t\tif ( ! $this->search_theme( $theme ) ) {\n\t\t\t\t\tunset( $themes[ $key ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tunset( $themes[ get_option( 'stylesheet' ) ] );\n\t\tWP_Theme::sort_by_name( $themes );\n\n\t\t$per_page = 36;\n\t\t$page     = $this->get_pagenum();\n\n\t\t$start = ( $page - 1 ) * $per_page;\n\n\t\t$this->items = array_slice( $themes, $start, $per_page, true );\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items'     => count( $themes ),\n\t\t\t\t'per_page'        => $per_page,\n\t\t\t\t'infinite_scroll' => true,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t */\n\tpublic function no_items() {\n\t\tif ( $this->search_terms || $this->features ) {\n\t\t\t_e( 'No items found.' );\n\t\t\treturn;\n\t\t}\n\n\t\t$blog_id = get_current_blog_id();\n\t\tif ( is_multisite() ) {\n\t\t\tif ( current_user_can( 'install_themes' ) && current_user_can( 'manage_network_themes' ) ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: URL to Themes tab on Edit Site screen, 2: URL to Add Themes screen. */\n\t\t\t\t\t__( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href=\"%1$s\">enable</a> or <a href=\"%2$s\">install</a> more themes.' ),\n\t\t\t\t\tnetwork_admin_url( 'site-themes.php?id=' . $blog_id ),\n\t\t\t\t\tnetwork_admin_url( 'theme-install.php' )\n\t\t\t\t);\n\n\t\t\t\treturn;\n\t\t\t} elseif ( current_user_can( 'manage_network_themes' ) ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: URL to Themes tab on Edit Site screen. */\n\t\t\t\t\t__( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href=\"%s\">enable</a> more themes.' ),\n\t\t\t\t\tnetwork_admin_url( 'site-themes.php?id=' . $blog_id )\n\t\t\t\t);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Else, fallthrough. install_themes doesn't help if you can't enable it.\n\t\t} else {\n\t\t\tif ( current_user_can( 'install_themes' ) ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: URL to Add Themes screen. */\n\t\t\t\t\t__( 'You only have one theme installed right now. Live a little! You can choose from over 1,000 free themes in the WordPress Theme Directory at any time: just click on the <a href=\"%s\">Install Themes</a> tab above.' ),\n\t\t\t\t\tadmin_url( 'theme-install.php' )\n\t\t\t\t);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// Fallthrough.\n\t\tprintf(\n\t\t\t/* translators: %s: Network title. */\n\t\t\t__( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ),\n\t\t\tget_site_option( 'site_name' )\n\t\t);\n\t}\n\n\t/**\n\t * @param string $which\n\t */\n\tpublic function tablenav( $which = 'top' ) {\n\t\tif ( $this->get_pagination_arg( 'total_pages' ) <= 1 ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<div class=\"tablenav themes <?php echo $which; ?>\">\n\t\t\t<?php $this->pagination( $which ); ?>\n\t\t\t<span class=\"spinner\"></span>\n\t\t\t<br class=\"clear\" />\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Displays the themes table.\n\t *\n\t * Overrides the parent display() method to provide a different container.\n\t *\n\t * @since 3.1.0\n\t */\n\tpublic function display() {\n\t\twp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );\n\t\t?>\n\t\t<?php $this->tablenav( 'top' ); ?>\n\n\t\t<div id=\"availablethemes\">\n\t\t\t<?php $this->display_rows_or_placeholder(); ?>\n\t\t</div>\n\n\t\t<?php $this->tablenav( 'bottom' ); ?>\n\t\t<?php\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic function get_columns() {\n\t\treturn array();\n\t}\n\n\t/**\n\t */\n\tpublic function display_rows_or_placeholder() {\n\t\tif ( $this->has_items() ) {\n\t\t\t$this->display_rows();\n\t\t} else {\n\t\t\techo '<div class=\"no-items\">';\n\t\t\t$this->no_items();\n\t\t\techo '</div>';\n\t\t}\n\t}\n\n\t/**\n\t */\n\tpublic function display_rows() {\n\t\t$themes = $this->items;\n\n\t\tforeach ( $themes as $theme ) :\n\t\t\t?>\n\t\t\t<div class=\"available-theme\">\n\t\t\t<?php\n\n\t\t\t$template   = $theme->get_template();\n\t\t\t$stylesheet = $theme->get_stylesheet();\n\t\t\t$title      = $theme->display( 'Name' );\n\t\t\t$version    = $theme->display( 'Version' );\n\t\t\t$author     = $theme->display( 'Author' );\n\n\t\t\t$activate_link = wp_nonce_url( 'themes.php?action=activate&amp;template=' . urlencode( $template ) . '&amp;stylesheet=' . urlencode( $stylesheet ), 'switch-theme_' . $stylesheet );\n\n\t\t\t$actions             = array();\n\t\t\t$actions['activate'] = sprintf(\n\t\t\t\t'<a href=\"%s\" class=\"activatelink\" title=\"%s\">%s</a>',\n\t\t\t\t$activate_link,\n\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\tesc_attr( sprintf( _x( 'Activate &#8220;%s&#8221;', 'theme' ), $title ) ),\n\t\t\t\t__( 'Activate' )\n\t\t\t);\n\n\t\t\tif ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {\n\t\t\t\t$actions['preview'] .= sprintf(\n\t\t\t\t\t'<a href=\"%s\" class=\"load-customize hide-if-no-customize\">%s</a>',\n\t\t\t\t\twp_customize_url( $stylesheet ),\n\t\t\t\t\t__( 'Live Preview' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( ! is_multisite() && current_user_can( 'delete_themes' ) ) {\n\t\t\t\t$actions['delete'] = sprintf(\n\t\t\t\t\t'<a class=\"submitdelete deletion\" href=\"%s\" onclick=\"return confirm( \\'%s\\' );\">%s</a>',\n\t\t\t\t\twp_nonce_url( 'themes.php?action=delete&amp;stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet ),\n\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\tesc_js( sprintf( __( \"You are about to delete this theme '%s'\\n  'Cancel' to stop, 'OK' to delete.\" ), $title ) ),\n\t\t\t\t\t__( 'Delete' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */\n\t\t\t$actions = apply_filters( 'theme_action_links', $actions, $theme, 'all' );\n\n\t\t\t/** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */\n\t\t\t$actions       = apply_filters( \"theme_action_links_{$stylesheet}\", $actions, $theme, 'all' );\n\t\t\t$delete_action = isset( $actions['delete'] ) ? '<div class=\"delete-theme\">' . $actions['delete'] . '</div>' : '';\n\t\t\tunset( $actions['delete'] );\n\n\t\t\t$screenshot = $theme->get_screenshot();\n\t\t\t?>\n\n\t\t\t<span class=\"screenshot hide-if-customize\">\n\t\t\t\t<?php if ( $screenshot ) : ?>\n\t\t\t\t\t<img src=\"<?php echo esc_url( $screenshot ); ?>\" alt=\"\" />\n\t\t\t\t<?php endif; ?>\n\t\t\t</span>\n\t\t\t<a href=\"<?php echo wp_customize_url( $stylesheet ); ?>\" class=\"screenshot load-customize hide-if-no-customize\">\n\t\t\t\t<?php if ( $screenshot ) : ?>\n\t\t\t\t\t<img src=\"<?php echo esc_url( $screenshot ); ?>\" alt=\"\" />\n\t\t\t\t<?php endif; ?>\n\t\t\t</a>\n\n\t\t\t<h3><?php echo $title; ?></h3>\n\t\t\t<div class=\"theme-author\">\n\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Theme author. */\n\t\t\t\t\tprintf( __( 'By %s' ), $author );\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<div class=\"action-links\">\n\t\t\t\t<ul>\n\t\t\t\t\t<?php foreach ( $actions as $action ) : ?>\n\t\t\t\t\t\t<li><?php echo $action; ?></li>\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t<li class=\"hide-if-no-js\"><a href=\"#\" class=\"theme-detail\"><?php _e( 'Details' ); ?></a></li>\n\t\t\t\t</ul>\n\t\t\t\t<?php echo $delete_action; ?>\n\n\t\t\t\t<?php theme_update_available( $theme ); ?>\n\t\t\t</div>\n\n\t\t\t<div class=\"themedetaildiv hide-if-js\">\n\t\t\t\t<p><strong><?php _e( 'Version:' ); ?></strong> <?php echo $version; ?></p>\n\t\t\t\t<p><?php echo $theme->display( 'Description' ); ?></p>\n\t\t\t\t<?php\n\t\t\t\tif ( $theme->parent() ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: Link to documentation on child themes, 2: Name of parent theme. */\n\t\t\t\t\t\t' <p class=\"howto\">' . __( 'This <a href=\"%1$s\">child theme</a> requires its parent theme, %2$s.' ) . '</p>',\n\t\t\t\t\t\t__( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ),\n\t\t\t\t\t\t$theme->parent()->display( 'Name' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</div>\n\n\t\t\t</div>\n\t\t\t<?php\n\t\tendforeach;\n\t}\n\n\t/**\n\t * @param WP_Theme $theme\n\t * @return bool\n\t */\n\tpublic function search_theme( $theme ) {\n\t\t// Search the features.\n\t\tforeach ( $this->features as $word ) {\n\t\t\tif ( ! in_array( $word, $theme->get( 'Tags' ), true ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Match all phrases.\n\t\tforeach ( $this->search_terms as $word ) {\n\t\t\tif ( in_array( $word, $theme->get( 'Tags' ), true ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ( array( 'Name', 'Description', 'Author', 'AuthorURI' ) as $header ) {\n\t\t\t\t// Don't mark up; Do translate.\n\t\t\t\tif ( false !== stripos( strip_tags( $theme->display( $header, false, true ) ), $word ) ) {\n\t\t\t\t\tcontinue 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( false !== stripos( $theme->get_stylesheet(), $word ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( false !== stripos( $theme->get_template(), $word ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Send required variables to JavaScript land\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param array $extra_args\n\t */\n\tpublic function _js_vars( $extra_args = array() ) {\n\t\t$search_string = isset( $_REQUEST['s'] ) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : '';\n\n\t\t$args = array(\n\t\t\t'search'      => $search_string,\n\t\t\t'features'    => $this->features,\n\t\t\t'paged'       => $this->get_pagenum(),\n\t\t\t'total_pages' => ! empty( $this->_pagination_args['total_pages'] ) ? $this->_pagination_args['total_pages'] : 1,\n\t\t);\n\n\t\tif ( is_array( $extra_args ) ) {\n\t\t\t$args = array_merge( $args, $extra_args );\n\t\t}\n\n\t\tprintf( \"<script type='text/javascript'>var theme_list_args = %s;</script>\\n\", wp_json_encode( $args ) );\n\t\tparent::_js_vars();\n\t}\n}\n", "num_lines": 362}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrader API: WP_Upgrader_Skin class\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 4.6.0\n */\n\n/**\n * Generic Skin for the WordPress Upgrader classes. This skin is designed to be extended for specific purposes.\n *\n * @since 2.8.0\n * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.\n */\nclass WP_Upgrader_Skin {\n\n\t/**\n\t * Holds the upgrader data.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @var object\n\t */\n\tpublic $upgrader;\n\n\t/**\n\t * Whether header is done.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @var bool\n\t */\n\tpublic $done_header = false;\n\n\t/**\n\t * Whether footer is done.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @var bool\n\t */\n\tpublic $done_footer = false;\n\n\t/**\n\t * Holds the result of an upgrade.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @var string|bool|WP_Error\n\t */\n\tpublic $result = false;\n\n\t/**\n\t * Holds the options of an upgrade.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @var array\n\t */\n\tpublic $options = array();\n\n\t/**\n\t * Constructor.\n\t *\n\t * Sets up the generic skin for the WordPress Upgrader classes.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $args Optional. The WordPress upgrader skin arguments to\n\t *                    override default options. Default empty array.\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\t$defaults      = array(\n\t\t\t'url'     => '',\n\t\t\t'nonce'   => '',\n\t\t\t'title'   => '',\n\t\t\t'context' => false,\n\t\t);\n\t\t$this->options = wp_parse_args( $args, $defaults );\n\t}\n\n\t/**\n\t * @param WP_Upgrader $upgrader\n\t */\n\tpublic function set_upgrader( &$upgrader ) {\n\t\tif ( is_object( $upgrader ) ) {\n\t\t\t$this->upgrader =& $upgrader;\n\t\t}\n\t\t$this->add_strings();\n\t}\n\n\t/**\n\t */\n\tpublic function add_strings() {\n\t}\n\n\t/**\n\t * Sets the result of an upgrade.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string|bool|WP_Error $result The result of an upgrade.\n\t */\n\tpublic function set_result( $result ) {\n\t\t$this->result = $result;\n\t}\n\n\t/**\n\t * Displays a form to the user to request for their FTP/SSH details in order\n\t * to connect to the filesystem.\n\t *\n\t * @since 2.8.0\n\t * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.\n\t *\n\t * @see request_filesystem_credentials()\n\t *\n\t * @param bool|WP_Error $error                        Optional. Whether the current request has failed to connect,\n\t *                                                    or an error object. Default false.\n\t * @param string        $context                      Optional. Full path to the directory that is tested\n\t *                                                    for being writable. Default empty.\n\t * @param bool          $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) {\n\t\t$url = $this->options['url'];\n\t\tif ( ! $context ) {\n\t\t\t$context = $this->options['context'];\n\t\t}\n\t\tif ( ! empty( $this->options['nonce'] ) ) {\n\t\t\t$url = wp_nonce_url( $url, $this->options['nonce'] );\n\t\t}\n\n\t\t$extra_fields = array();\n\n\t\treturn request_filesystem_credentials( $url, '', $error, $context, $extra_fields, $allow_relaxed_file_ownership );\n\t}\n\n\t/**\n\t */\n\tpublic function header() {\n\t\tif ( $this->done_header ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->done_header = true;\n\t\techo '<div class=\"wrap\">';\n\t\techo '<h1>' . $this->options['title'] . '</h1>';\n\t}\n\n\t/**\n\t */\n\tpublic function footer() {\n\t\tif ( $this->done_footer ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->done_footer = true;\n\t\techo '</div>';\n\t}\n\n\t/**\n\t * @param string|WP_Error $errors\n\t */\n\tpublic function error( $errors ) {\n\t\tif ( ! $this->done_header ) {\n\t\t\t$this->header();\n\t\t}\n\t\tif ( is_string( $errors ) ) {\n\t\t\t$this->feedback( $errors );\n\t\t} elseif ( is_wp_error( $errors ) && $errors->has_errors() ) {\n\t\t\tforeach ( $errors->get_error_messages() as $message ) {\n\t\t\t\tif ( $errors->get_error_data() && is_string( $errors->get_error_data() ) ) {\n\t\t\t\t\t$this->feedback( $message . ' ' . esc_html( strip_tags( $errors->get_error_data() ) ) );\n\t\t\t\t} else {\n\t\t\t\t\t$this->feedback( $message );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param string $string\n\t * @param mixed  ...$args Optional text replacements.\n\t */\n\tpublic function feedback( $string, ...$args ) {\n\t\tif ( isset( $this->upgrader->strings[ $string ] ) ) {\n\t\t\t$string = $this->upgrader->strings[ $string ];\n\t\t}\n\n\t\tif ( strpos( $string, '%' ) !== false ) {\n\t\t\tif ( $args ) {\n\t\t\t\t$args   = array_map( 'strip_tags', $args );\n\t\t\t\t$args   = array_map( 'esc_html', $args );\n\t\t\t\t$string = vsprintf( $string, $args );\n\t\t\t}\n\t\t}\n\t\tif ( empty( $string ) ) {\n\t\t\treturn;\n\t\t}\n\t\tshow_message( $string );\n\t}\n\n\t/**\n\t * Action to perform before an update.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function before() {}\n\n\t/**\n\t * Action to perform following an update.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function after() {}\n\n\t/**\n\t * Output JavaScript that calls function to decrement the update counts.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param string $type Type of update count to decrement. Likely values include 'plugin',\n\t *                     'theme', 'translation', etc.\n\t */\n\tprotected function decrement_update_count( $type ) {\n\t\tif ( ! $this->result || is_wp_error( $this->result ) || 'up_to_date' === $this->result ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( defined( 'IFRAME_REQUEST' ) ) {\n\t\t\techo '<script type=\"text/javascript\">\n\t\t\t\t\tif ( window.postMessage && JSON ) {\n\t\t\t\t\t\twindow.parent.postMessage( JSON.stringify( { action: \"decrementUpdateCount\", upgradeType: \"' . $type . '\" } ), window.location.protocol + \"//\" + window.location.hostname );\n\t\t\t\t\t}\n\t\t\t\t</script>';\n\t\t} else {\n\t\t\techo '<script type=\"text/javascript\">\n\t\t\t\t\t(function( wp ) {\n\t\t\t\t\t\tif ( wp && wp.updates && wp.updates.decrementCount ) {\n\t\t\t\t\t\t\twp.updates.decrementCount( \"' . $type . '\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t})( window.wp );\n\t\t\t\t</script>';\n\t\t}\n\t}\n\n\t/**\n\t */\n\tpublic function bulk_header() {}\n\n\t/**\n\t */\n\tpublic function bulk_footer() {}\n\n\t/**\n\t * Hides the `process_failed` error message when updating by uploading a zip file.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_Error $wp_error WP_Error\n\t * @return bool\n\t */\n\tpublic function hide_process_failed( $wp_error ) {\n\t\treturn false;\n\t}\n}\n", "num_lines": 266}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The User Interface \"Skins\" for the WordPress File Upgrader\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 2.8.0\n * @deprecated 4.7.0\n */\n\n_deprecated_file( basename( __FILE__ ), '4.7.0', 'class-wp-upgrader.php' );\n\n/** WP_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader-skin.php';\n\n/** Plugin_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader-skin.php';\n\n/** Theme_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-theme-upgrader-skin.php';\n\n/** Bulk_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-bulk-upgrader-skin.php';\n\n/** Bulk_Plugin_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-bulk-plugin-upgrader-skin.php';\n\n/** Bulk_Theme_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-bulk-theme-upgrader-skin.php';\n\n/** Plugin_Installer_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-plugin-installer-skin.php';\n\n/** Theme_Installer_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-theme-installer-skin.php';\n\n/** Language_Pack_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-language-pack-upgrader-skin.php';\n\n/** Automatic_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-automatic-upgrader-skin.php';\n\n/** WP_Ajax_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-wp-ajax-upgrader-skin.php';\n", "num_lines": 45}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Upgrade API: WP_Upgrader class\n *\n * Requires skin classes and WP_Upgrader subclasses for backward compatibility.\n *\n * @package WordPress\n * @subpackage Upgrader\n * @since 2.8.0\n */\n\n/** WP_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader-skin.php';\n\n/** Plugin_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader-skin.php';\n\n/** Theme_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-theme-upgrader-skin.php';\n\n/** Bulk_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-bulk-upgrader-skin.php';\n\n/** Bulk_Plugin_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-bulk-plugin-upgrader-skin.php';\n\n/** Bulk_Theme_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-bulk-theme-upgrader-skin.php';\n\n/** Plugin_Installer_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-plugin-installer-skin.php';\n\n/** Theme_Installer_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-theme-installer-skin.php';\n\n/** Language_Pack_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-language-pack-upgrader-skin.php';\n\n/** Automatic_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-automatic-upgrader-skin.php';\n\n/** WP_Ajax_Upgrader_Skin class */\nrequire_once ABSPATH . 'wp-admin/includes/class-wp-ajax-upgrader-skin.php';\n\n/**\n * Core class used for upgrading/installing a local set of files via\n * the Filesystem Abstraction classes from a Zip file.\n *\n * @since 2.8.0\n */\nclass WP_Upgrader {\n\n\t/**\n\t * The error/notification strings used to update the user on the progress.\n\t *\n\t * @since 2.8.0\n\t * @var array $strings\n\t */\n\tpublic $strings = array();\n\n\t/**\n\t * The upgrader skin being used.\n\t *\n\t * @since 2.8.0\n\t * @var Automatic_Upgrader_Skin|WP_Upgrader_Skin $skin\n\t */\n\tpublic $skin = null;\n\n\t/**\n\t * The result of the installation.\n\t *\n\t * This is set by WP_Upgrader::install_package(), only when the package is installed\n\t * successfully. It will then be an array, unless a WP_Error is returned by the\n\t * {@see 'upgrader_post_install'} filter. In that case, the WP_Error will be assigned to\n\t * it.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @var array|WP_Error $result {\n\t *     @type string $source             The full path to the source the files were installed from.\n\t *     @type string $source_files       List of all the files in the source directory.\n\t *     @type string $destination        The full path to the installation destination folder.\n\t *     @type string $destination_name   The name of the destination folder, or empty if `$destination`\n\t *                                      and `$local_destination` are the same.\n\t *     @type string $local_destination  The full local path to the destination folder. This is usually\n\t *                                      the same as `$destination`.\n\t *     @type string $remote_destination The full remote path to the destination folder\n\t *                                      (i.e., from `$wp_filesystem`).\n\t *     @type bool   $clear_destination  Whether the destination folder was cleared.\n\t * }\n\t */\n\tpublic $result = array();\n\n\t/**\n\t * The total number of updates being performed.\n\t *\n\t * Set by the bulk update methods.\n\t *\n\t * @since 3.0.0\n\t * @var int $update_count\n\t */\n\tpublic $update_count = 0;\n\n\t/**\n\t * The current update if multiple updates are being performed.\n\t *\n\t * Used by the bulk update methods, and incremented for each update.\n\t *\n\t * @since 3.0.0\n\t * @var int\n\t */\n\tpublic $update_current = 0;\n\n\t/**\n\t * Construct the upgrader with a skin.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param WP_Upgrader_Skin $skin The upgrader skin to use. Default is a WP_Upgrader_Skin\n\t *                               instance.\n\t */\n\tpublic function __construct( $skin = null ) {\n\t\tif ( null == $skin ) {\n\t\t\t$this->skin = new WP_Upgrader_Skin();\n\t\t} else {\n\t\t\t$this->skin = $skin;\n\t\t}\n\t}\n\n\t/**\n\t * Initialize the upgrader.\n\t *\n\t * This will set the relationship between the skin being used and this upgrader,\n\t * and also add the generic strings to `WP_Upgrader::$strings`.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function init() {\n\t\t$this->skin->set_upgrader( $this );\n\t\t$this->generic_strings();\n\t}\n\n\t/**\n\t * Add the generic strings to WP_Upgrader::$strings.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function generic_strings() {\n\t\t$this->strings['bad_request']       = __( 'Invalid data provided.' );\n\t\t$this->strings['fs_unavailable']    = __( 'Could not access filesystem.' );\n\t\t$this->strings['fs_error']          = __( 'Filesystem error.' );\n\t\t$this->strings['fs_no_root_dir']    = __( 'Unable to locate WordPress root directory.' );\n\t\t$this->strings['fs_no_content_dir'] = __( 'Unable to locate WordPress content directory (wp-content).' );\n\t\t$this->strings['fs_no_plugins_dir'] = __( 'Unable to locate WordPress plugin directory.' );\n\t\t$this->strings['fs_no_themes_dir']  = __( 'Unable to locate WordPress theme directory.' );\n\t\t/* translators: %s: Directory name. */\n\t\t$this->strings['fs_no_folder'] = __( 'Unable to locate needed folder (%s).' );\n\n\t\t$this->strings['download_failed']      = __( 'Download failed.' );\n\t\t$this->strings['installing_package']   = __( 'Installing the latest version&#8230;' );\n\t\t$this->strings['no_files']             = __( 'The package contains no files.' );\n\t\t$this->strings['folder_exists']        = __( 'Destination folder already exists.' );\n\t\t$this->strings['mkdir_failed']         = __( 'Could not create directory.' );\n\t\t$this->strings['incompatible_archive'] = __( 'The package could not be installed.' );\n\t\t$this->strings['files_not_writable']   = __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' );\n\n\t\t$this->strings['maintenance_start'] = __( 'Enabling Maintenance mode&#8230;' );\n\t\t$this->strings['maintenance_end']   = __( 'Disabling Maintenance mode&#8230;' );\n\t}\n\n\t/**\n\t * Connect to the filesystem.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n\t *\n\t * @param string[] $directories                  Optional. Array of directories. If any of these do\n\t *                                               not exist, a WP_Error object will be returned.\n\t *                                               Default empty array.\n\t * @param bool     $allow_relaxed_file_ownership Whether to allow relaxed file ownership.\n\t *                                               Default false.\n\t * @return bool|WP_Error True if able to connect, false or a WP_Error otherwise.\n\t */\n\tpublic function fs_connect( $directories = array(), $allow_relaxed_file_ownership = false ) {\n\t\tglobal $wp_filesystem;\n\n\t\t$credentials = $this->skin->request_filesystem_credentials( false, $directories[0], $allow_relaxed_file_ownership );\n\t\tif ( false === $credentials ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! WP_Filesystem( $credentials, $directories[0], $allow_relaxed_file_ownership ) ) {\n\t\t\t$error = true;\n\t\t\tif ( is_object( $wp_filesystem ) && $wp_filesystem->errors->has_errors() ) {\n\t\t\t\t$error = $wp_filesystem->errors;\n\t\t\t}\n\t\t\t// Failed to connect. Error and request again.\n\t\t\t$this->skin->request_filesystem_credentials( $error, $directories[0], $allow_relaxed_file_ownership );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! is_object( $wp_filesystem ) ) {\n\t\t\treturn new WP_Error( 'fs_unavailable', $this->strings['fs_unavailable'] );\n\t\t}\n\n\t\tif ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {\n\t\t\treturn new WP_Error( 'fs_error', $this->strings['fs_error'], $wp_filesystem->errors );\n\t\t}\n\n\t\tforeach ( (array) $directories as $dir ) {\n\t\t\tswitch ( $dir ) {\n\t\t\t\tcase ABSPATH:\n\t\t\t\t\tif ( ! $wp_filesystem->abspath() ) {\n\t\t\t\t\t\treturn new WP_Error( 'fs_no_root_dir', $this->strings['fs_no_root_dir'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase WP_CONTENT_DIR:\n\t\t\t\t\tif ( ! $wp_filesystem->wp_content_dir() ) {\n\t\t\t\t\t\treturn new WP_Error( 'fs_no_content_dir', $this->strings['fs_no_content_dir'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase WP_PLUGIN_DIR:\n\t\t\t\t\tif ( ! $wp_filesystem->wp_plugins_dir() ) {\n\t\t\t\t\t\treturn new WP_Error( 'fs_no_plugins_dir', $this->strings['fs_no_plugins_dir'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase get_theme_root():\n\t\t\t\t\tif ( ! $wp_filesystem->wp_themes_dir() ) {\n\t\t\t\t\t\treturn new WP_Error( 'fs_no_themes_dir', $this->strings['fs_no_themes_dir'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif ( ! $wp_filesystem->find_folder( $dir ) ) {\n\t\t\t\t\t\treturn new WP_Error( 'fs_no_folder', sprintf( $this->strings['fs_no_folder'], esc_html( basename( $dir ) ) ) );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Download a package.\n\t *\n\t * @since 2.8.0\n\t * @since 5.5.0 Added the `$hook_extra` parameter.\n\t *\n\t * @param string $package          The URI of the package. If this is the full path to an\n\t *                                 existing local file, it will be returned untouched.\n\t * @param bool   $check_signatures Whether to validate file signatures. Default false.\n\t * @param array  $hook_extra       Extra arguments to pass to the filter hooks. Default empty array.\n\t * @return string|WP_Error The full path to the downloaded package file, or a WP_Error object.\n\t */\n\tpublic function download_package( $package, $check_signatures = false, $hook_extra = array() ) {\n\t\t/**\n\t\t * Filters whether to return the package.\n\t\t *\n\t\t * @since 3.7.0\n\t\t * @since 5.5.0 Added the `$hook_extra` parameter.\n\t\t *\n\t\t * @param bool        $reply      Whether to bail without returning the package.\n\t\t *                                Default false.\n\t\t * @param string      $package    The package file name.\n\t\t * @param WP_Upgrader $this       The WP_Upgrader instance.\n\t\t * @param array       $hook_extra Extra arguments passed to hooked filters.\n\t\t */\n\t\t$reply = apply_filters( 'upgrader_pre_download', false, $package, $this, $hook_extra );\n\t\tif ( false !== $reply ) {\n\t\t\treturn $reply;\n\t\t}\n\n\t\tif ( ! preg_match( '!^(http|https|ftp)://!i', $package ) && file_exists( $package ) ) { // Local file or remote?\n\t\t\treturn $package; // Must be a local file.\n\t\t}\n\n\t\tif ( empty( $package ) ) {\n\t\t\treturn new WP_Error( 'no_package', $this->strings['no_package'] );\n\t\t}\n\n\t\t$this->skin->feedback( 'downloading_package', $package );\n\n\t\t$download_file = download_url( $package, 300, $check_signatures );\n\n\t\tif ( is_wp_error( $download_file ) && ! $download_file->get_error_data( 'softfail-filename' ) ) {\n\t\t\treturn new WP_Error( 'download_failed', $this->strings['download_failed'], $download_file->get_error_message() );\n\t\t}\n\n\t\treturn $download_file;\n\t}\n\n\t/**\n\t * Unpack a compressed package file.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n\t *\n\t * @param string $package        Full path to the package file.\n\t * @param bool   $delete_package Optional. Whether to delete the package file after attempting\n\t *                               to unpack it. Default true.\n\t * @return string|WP_Error The path to the unpacked contents, or a WP_Error on failure.\n\t */\n\tpublic function unpack_package( $package, $delete_package = true ) {\n\t\tglobal $wp_filesystem;\n\n\t\t$this->skin->feedback( 'unpack_package' );\n\n\t\t$upgrade_folder = $wp_filesystem->wp_content_dir() . 'upgrade/';\n\n\t\t// Clean up contents of upgrade directory beforehand.\n\t\t$upgrade_files = $wp_filesystem->dirlist( $upgrade_folder );\n\t\tif ( ! empty( $upgrade_files ) ) {\n\t\t\tforeach ( $upgrade_files as $file ) {\n\t\t\t\t$wp_filesystem->delete( $upgrade_folder . $file['name'], true );\n\t\t\t}\n\t\t}\n\n\t\t// We need a working directory - strip off any .tmp or .zip suffixes.\n\t\t$working_dir = $upgrade_folder . basename( basename( $package, '.tmp' ), '.zip' );\n\n\t\t// Clean up working directory.\n\t\tif ( $wp_filesystem->is_dir( $working_dir ) ) {\n\t\t\t$wp_filesystem->delete( $working_dir, true );\n\t\t}\n\n\t\t// Unzip package to working directory.\n\t\t$result = unzip_file( $package, $working_dir );\n\n\t\t// Once extracted, delete the package if required.\n\t\tif ( $delete_package ) {\n\t\t\tunlink( $package );\n\t\t}\n\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\t$wp_filesystem->delete( $working_dir, true );\n\t\t\tif ( 'incompatible_archive' === $result->get_error_code() ) {\n\t\t\t\treturn new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], $result->get_error_data() );\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\n\t\treturn $working_dir;\n\t}\n\n\t/**\n\t * Flatten the results of WP_Filesystem::dirlist() for iterating over.\n\t *\n\t * @since 4.9.0\n\t * @access protected\n\t *\n\t * @param array  $nested_files Array of files as returned by WP_Filesystem::dirlist().\n\t * @param string $path         Relative path to prepend to child nodes. Optional.\n\t * @return array A flattened array of the $nested_files specified.\n\t */\n\tprotected function flatten_dirlist( $nested_files, $path = '' ) {\n\t\t$files = array();\n\n\t\tforeach ( $nested_files as $name => $details ) {\n\t\t\t$files[ $path . $name ] = $details;\n\n\t\t\t// Append children recursively.\n\t\t\tif ( ! empty( $details['files'] ) ) {\n\t\t\t\t$children = $this->flatten_dirlist( $details['files'], $path . $name . '/' );\n\n\t\t\t\t// Merge keeping possible numeric keys, which array_merge() will reindex from 0..n.\n\t\t\t\t$files = $files + $children;\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}\n\n\t/**\n\t * Clears the directory where this item is going to be installed into.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n\t *\n\t * @param string $remote_destination The location on the remote filesystem to be cleared\n\t * @return bool|WP_Error True upon success, WP_Error on failure.\n\t */\n\tpublic function clear_destination( $remote_destination ) {\n\t\tglobal $wp_filesystem;\n\n\t\t$files = $wp_filesystem->dirlist( $remote_destination, true, true );\n\n\t\t// False indicates that the $remote_destination doesn't exist.\n\t\tif ( false === $files ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Flatten the file list to iterate over.\n\t\t$files = $this->flatten_dirlist( $files );\n\n\t\t// Check all files are writable before attempting to clear the destination.\n\t\t$unwritable_files = array();\n\n\t\t// Check writability.\n\t\tforeach ( $files as $filename => $file_details ) {\n\t\t\tif ( ! $wp_filesystem->is_writable( $remote_destination . $filename ) ) {\n\t\t\t\t// Attempt to alter permissions to allow writes and try again.\n\t\t\t\t$wp_filesystem->chmod( $remote_destination . $filename, ( 'd' === $file_details['type'] ? FS_CHMOD_DIR : FS_CHMOD_FILE ) );\n\t\t\t\tif ( ! $wp_filesystem->is_writable( $remote_destination . $filename ) ) {\n\t\t\t\t\t$unwritable_files[] = $filename;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $unwritable_files ) ) {\n\t\t\treturn new WP_Error( 'files_not_writable', $this->strings['files_not_writable'], implode( ', ', $unwritable_files ) );\n\t\t}\n\n\t\tif ( ! $wp_filesystem->delete( $remote_destination, true ) ) {\n\t\t\treturn new WP_Error( 'remove_old_failed', $this->strings['remove_old_failed'] );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Install a package.\n\t *\n\t * Copies the contents of a package form a source directory, and installs them in\n\t * a destination directory. Optionally removes the source. It can also optionally\n\t * clear out the destination folder if it already exists.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @global WP_Filesystem_Base $wp_filesystem        WordPress filesystem subclass.\n\t * @global array              $wp_theme_directories\n\t *\n\t * @param array|string $args {\n\t *     Optional. Array or string of arguments for installing a package. Default empty array.\n\t *\n\t *     @type string $source                      Required path to the package source. Default empty.\n\t *     @type string $destination                 Required path to a folder to install the package in.\n\t *                                               Default empty.\n\t *     @type bool   $clear_destination           Whether to delete any files already in the destination\n\t *                                               folder. Default false.\n\t *     @type bool   $clear_working               Whether to delete the files form the working directory\n\t *                                               after copying to the destination. Default false.\n\t *     @type bool   $abort_if_destination_exists Whether to abort the installation if\n\t *                                               the destination folder already exists. Default true.\n\t *     @type array  $hook_extra                  Extra arguments to pass to the filter hooks called by\n\t *                                               WP_Upgrader::install_package(). Default empty array.\n\t * }\n\t *\n\t * @return array|WP_Error The result (also stored in `WP_Upgrader::$result`), or a WP_Error on failure.\n\t */\n\tpublic function install_package( $args = array() ) {\n\t\tglobal $wp_filesystem, $wp_theme_directories;\n\n\t\t$defaults = array(\n\t\t\t'source'                      => '', // Please always pass this.\n\t\t\t'destination'                 => '', // ...and this.\n\t\t\t'clear_destination'           => false,\n\t\t\t'clear_working'               => false,\n\t\t\t'abort_if_destination_exists' => true,\n\t\t\t'hook_extra'                  => array(),\n\t\t);\n\n\t\t$args = wp_parse_args( $args, $defaults );\n\n\t\t// These were previously extract()'d.\n\t\t$source            = $args['source'];\n\t\t$destination       = $args['destination'];\n\t\t$clear_destination = $args['clear_destination'];\n\n\t\tset_time_limit( 300 );\n\n\t\tif ( empty( $source ) || empty( $destination ) ) {\n\t\t\treturn new WP_Error( 'bad_request', $this->strings['bad_request'] );\n\t\t}\n\t\t$this->skin->feedback( 'installing_package' );\n\n\t\t/**\n\t\t * Filters the install response before the installation has started.\n\t\t *\n\t\t * Returning a truthy value, or one that could be evaluated as a WP_Error\n\t\t * will effectively short-circuit the installation, returning that value\n\t\t * instead.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param bool|WP_Error $response   Response.\n\t\t * @param array         $hook_extra Extra arguments passed to hooked filters.\n\t\t */\n\t\t$res = apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] );\n\n\t\tif ( is_wp_error( $res ) ) {\n\t\t\treturn $res;\n\t\t}\n\n\t\t// Retain the original source and destinations.\n\t\t$remote_source     = $args['source'];\n\t\t$local_destination = $destination;\n\n\t\t$source_files       = array_keys( $wp_filesystem->dirlist( $remote_source ) );\n\t\t$remote_destination = $wp_filesystem->find_folder( $local_destination );\n\n\t\t// Locate which directory to copy to the new folder. This is based on the actual folder holding the files.\n\t\tif ( 1 === count( $source_files ) && $wp_filesystem->is_dir( trailingslashit( $args['source'] ) . $source_files[0] . '/' ) ) {\n\t\t\t// Only one folder? Then we want its contents.\n\t\t\t$source = trailingslashit( $args['source'] ) . trailingslashit( $source_files[0] );\n\t\t} elseif ( count( $source_files ) == 0 ) {\n\t\t\t// There are no files?\n\t\t\treturn new WP_Error( 'incompatible_archive_empty', $this->strings['incompatible_archive'], $this->strings['no_files'] );\n\t\t} else {\n\t\t\t// It's only a single file, the upgrader will use the folder name of this file as the destination folder.\n\t\t\t// Folder name is based on zip filename.\n\t\t\t$source = trailingslashit( $args['source'] );\n\t\t}\n\n\t\t/**\n\t\t * Filters the source file location for the upgrade package.\n\t\t *\n\t\t * @since 2.8.0\n\t\t * @since 4.4.0 The $hook_extra parameter became available.\n\t\t *\n\t\t * @param string      $source        File source location.\n\t\t * @param string      $remote_source Remote file source location.\n\t\t * @param WP_Upgrader $this          WP_Upgrader instance.\n\t\t * @param array       $hook_extra    Extra arguments passed to hooked filters.\n\t\t */\n\t\t$source = apply_filters( 'upgrader_source_selection', $source, $remote_source, $this, $args['hook_extra'] );\n\n\t\tif ( is_wp_error( $source ) ) {\n\t\t\treturn $source;\n\t\t}\n\n\t\t// Has the source location changed? If so, we need a new source_files list.\n\t\tif ( $source !== $remote_source ) {\n\t\t\t$source_files = array_keys( $wp_filesystem->dirlist( $source ) );\n\t\t}\n\n\t\t/*\n\t\t * Protection against deleting files in any important base directories.\n\t\t * Theme_Upgrader & Plugin_Upgrader also trigger this, as they pass the\n\t\t * destination directory (WP_PLUGIN_DIR / wp-content/themes) intending\n\t\t * to copy the directory into the directory, whilst they pass the source\n\t\t * as the actual files to copy.\n\t\t */\n\t\t$protected_directories = array( ABSPATH, WP_CONTENT_DIR, WP_PLUGIN_DIR, WP_CONTENT_DIR . '/themes' );\n\n\t\tif ( is_array( $wp_theme_directories ) ) {\n\t\t\t$protected_directories = array_merge( $protected_directories, $wp_theme_directories );\n\t\t}\n\n\t\tif ( in_array( $destination, $protected_directories, true ) ) {\n\t\t\t$remote_destination = trailingslashit( $remote_destination ) . trailingslashit( basename( $source ) );\n\t\t\t$destination        = trailingslashit( $destination ) . trailingslashit( basename( $source ) );\n\t\t}\n\n\t\tif ( $clear_destination ) {\n\t\t\t// We're going to clear the destination if there's something there.\n\t\t\t$this->skin->feedback( 'remove_old' );\n\n\t\t\t$removed = $this->clear_destination( $remote_destination );\n\n\t\t\t/**\n\t\t\t * Filters whether the upgrader cleared the destination.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t *\n\t\t\t * @param true|WP_Error $removed            Whether the destination was cleared. true upon success, WP_Error on failure.\n\t\t\t * @param string        $local_destination  The local package destination.\n\t\t\t * @param string        $remote_destination The remote package destination.\n\t\t\t * @param array         $hook_extra         Extra arguments passed to hooked filters.\n\t\t\t */\n\t\t\t$removed = apply_filters( 'upgrader_clear_destination', $removed, $local_destination, $remote_destination, $args['hook_extra'] );\n\n\t\t\tif ( is_wp_error( $removed ) ) {\n\t\t\t\treturn $removed;\n\t\t\t}\n\t\t} elseif ( $args['abort_if_destination_exists'] && $wp_filesystem->exists( $remote_destination ) ) {\n\t\t\t// If we're not clearing the destination folder and something exists there already, bail.\n\t\t\t// But first check to see if there are actually any files in the folder.\n\t\t\t$_files = $wp_filesystem->dirlist( $remote_destination );\n\t\t\tif ( ! empty( $_files ) ) {\n\t\t\t\t$wp_filesystem->delete( $remote_source, true ); // Clear out the source files.\n\t\t\t\treturn new WP_Error( 'folder_exists', $this->strings['folder_exists'], $remote_destination );\n\t\t\t}\n\t\t}\n\n\t\t// Create destination if needed.\n\t\tif ( ! $wp_filesystem->exists( $remote_destination ) ) {\n\t\t\tif ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) ) {\n\t\t\t\treturn new WP_Error( 'mkdir_failed_destination', $this->strings['mkdir_failed'], $remote_destination );\n\t\t\t}\n\t\t}\n\n\t\t// Copy new version of item into place.\n\t\t$result = copy_dir( $source, $remote_destination );\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\tif ( $args['clear_working'] ) {\n\t\t\t\t$wp_filesystem->delete( $remote_source, true );\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\n\t\t// Clear the working folder?\n\t\tif ( $args['clear_working'] ) {\n\t\t\t$wp_filesystem->delete( $remote_source, true );\n\t\t}\n\n\t\t$destination_name = basename( str_replace( $local_destination, '', $destination ) );\n\t\tif ( '.' === $destination_name ) {\n\t\t\t$destination_name = '';\n\t\t}\n\n\t\t$this->result = compact( 'source', 'source_files', 'destination', 'destination_name', 'local_destination', 'remote_destination', 'clear_destination' );\n\n\t\t/**\n\t\t * Filters the installation response after the installation has finished.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param bool  $response   Installation response.\n\t\t * @param array $hook_extra Extra arguments passed to hooked filters.\n\t\t * @param array $result     Installation result data.\n\t\t */\n\t\t$res = apply_filters( 'upgrader_post_install', true, $args['hook_extra'], $this->result );\n\n\t\tif ( is_wp_error( $res ) ) {\n\t\t\t$this->result = $res;\n\t\t\treturn $res;\n\t\t}\n\n\t\t// Bombard the calling function will all the info which we've just used.\n\t\treturn $this->result;\n\t}\n\n\t/**\n\t * Run an upgrade/installation.\n\t *\n\t * Attempts to download the package (if it is not a local file), unpack it, and\n\t * install it in the destination folder.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $options {\n\t *     Array or string of arguments for upgrading/installing a package.\n\t *\n\t *     @type string $package                     The full path or URI of the package to install.\n\t *                                               Default empty.\n\t *     @type string $destination                 The full path to the destination folder.\n\t *                                               Default empty.\n\t *     @type bool   $clear_destination           Whether to delete any files already in the\n\t *                                               destination folder. Default false.\n\t *     @type bool   $clear_working               Whether to delete the files form the working\n\t *                                               directory after copying to the destination.\n\t *                                               Default false.\n\t *     @type bool   $abort_if_destination_exists Whether to abort the installation if the destination\n\t *                                               folder already exists. When true, `$clear_destination`\n\t *                                               should be false. Default true.\n\t *     @type bool   $is_multi                    Whether this run is one of multiple upgrade/installation\n\t *                                               actions being performed in bulk. When true, the skin\n\t *                                               WP_Upgrader::header() and WP_Upgrader::footer()\n\t *                                               aren't called. Default false.\n\t *     @type array  $hook_extra                  Extra arguments to pass to the filter hooks called by\n\t *                                               WP_Upgrader::run().\n\t * }\n\t * @return array|false|WP_Error The result from self::install_package() on success, otherwise a WP_Error,\n\t *                              or false if unable to connect to the filesystem.\n\t */\n\tpublic function run( $options ) {\n\n\t\t$defaults = array(\n\t\t\t'package'                     => '', // Please always pass this.\n\t\t\t'destination'                 => '', // ...and this.\n\t\t\t'clear_destination'           => false,\n\t\t\t'abort_if_destination_exists' => true, // Abort if the destination directory exists. Pass clear_destination as false please.\n\t\t\t'clear_working'               => true,\n\t\t\t'is_multi'                    => false,\n\t\t\t'hook_extra'                  => array(), // Pass any extra $hook_extra args here, this will be passed to any hooked filters.\n\t\t);\n\n\t\t$options = wp_parse_args( $options, $defaults );\n\n\t\t/**\n\t\t * Filters the package options before running an update.\n\t\t *\n\t\t * See also {@see 'upgrader_process_complete'}.\n\t\t *\n\t\t * @since 4.3.0\n\t\t *\n\t\t * @param array $options {\n\t\t *     Options used by the upgrader.\n\t\t *\n\t\t *     @type string $package                     Package for update.\n\t\t *     @type string $destination                 Update location.\n\t\t *     @type bool   $clear_destination           Clear the destination resource.\n\t\t *     @type bool   $clear_working               Clear the working resource.\n\t\t *     @type bool   $abort_if_destination_exists Abort if the Destination directory exists.\n\t\t *     @type bool   $is_multi                    Whether the upgrader is running multiple times.\n\t\t *     @type array  $hook_extra {\n\t\t *         Extra hook arguments.\n\t\t *\n\t\t *         @type string $action               Type of action. Default 'update'.\n\t\t *         @type string $type                 Type of update process. Accepts 'plugin', 'theme', or 'core'.\n\t\t *         @type bool   $bulk                 Whether the update process is a bulk update. Default true.\n\t\t *         @type string $plugin               Path to the plugin file relative to the plugins directory.\n\t\t *         @type string $theme                The stylesheet or template name of the theme.\n\t\t *         @type string $language_update_type The language pack update type. Accepts 'plugin', 'theme',\n\t\t *                                            or 'core'.\n\t\t *         @type object $language_update      The language pack update offer.\n\t\t *     }\n\t\t * }\n\t\t */\n\t\t$options = apply_filters( 'upgrader_package_options', $options );\n\n\t\tif ( ! $options['is_multi'] ) { // Call $this->header separately if running multiple times.\n\t\t\t$this->skin->header();\n\t\t}\n\n\t\t// Connect to the filesystem first.\n\t\t$res = $this->fs_connect( array( WP_CONTENT_DIR, $options['destination'] ) );\n\t\t// Mainly for non-connected filesystem.\n\t\tif ( ! $res ) {\n\t\t\tif ( ! $options['is_multi'] ) {\n\t\t\t\t$this->skin->footer();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->skin->before();\n\n\t\tif ( is_wp_error( $res ) ) {\n\t\t\t$this->skin->error( $res );\n\t\t\t$this->skin->after();\n\t\t\tif ( ! $options['is_multi'] ) {\n\t\t\t\t$this->skin->footer();\n\t\t\t}\n\t\t\treturn $res;\n\t\t}\n\n\t\t/*\n\t\t * Download the package (Note, This just returns the filename\n\t\t * of the file if the package is a local file)\n\t\t */\n\t\t$download = $this->download_package( $options['package'], true, $options['hook_extra'] );\n\n\t\t// Allow for signature soft-fail.\n\t\t// WARNING: This may be removed in the future.\n\t\tif ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) {\n\n\t\t\t// Don't output the 'no signature could be found' failure message for now.\n\t\t\tif ( 'signature_verification_no_signature' !== $download->get_error_code() || WP_DEBUG ) {\n\t\t\t\t// Output the failure error as a normal feedback, and not as an error.\n\t\t\t\t$this->skin->feedback( $download->get_error_message() );\n\n\t\t\t\t// Report this failure back to WordPress.org for debugging purposes.\n\t\t\t\twp_version_check(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'signature_failure_code' => $download->get_error_code(),\n\t\t\t\t\t\t'signature_failure_data' => $download->get_error_data(),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Pretend this error didn't happen.\n\t\t\t$download = $download->get_error_data( 'softfail-filename' );\n\t\t}\n\n\t\tif ( is_wp_error( $download ) ) {\n\t\t\t$this->skin->error( $download );\n\t\t\t$this->skin->after();\n\t\t\tif ( ! $options['is_multi'] ) {\n\t\t\t\t$this->skin->footer();\n\t\t\t}\n\t\t\treturn $download;\n\t\t}\n\n\t\t$delete_package = ( $download != $options['package'] ); // Do not delete a \"local\" file.\n\n\t\t// Unzips the file into a temporary directory.\n\t\t$working_dir = $this->unpack_package( $download, $delete_package );\n\t\tif ( is_wp_error( $working_dir ) ) {\n\t\t\t$this->skin->error( $working_dir );\n\t\t\t$this->skin->after();\n\t\t\tif ( ! $options['is_multi'] ) {\n\t\t\t\t$this->skin->footer();\n\t\t\t}\n\t\t\treturn $working_dir;\n\t\t}\n\n\t\t// With the given options, this installs it to the destination directory.\n\t\t$result = $this->install_package(\n\t\t\tarray(\n\t\t\t\t'source'                      => $working_dir,\n\t\t\t\t'destination'                 => $options['destination'],\n\t\t\t\t'clear_destination'           => $options['clear_destination'],\n\t\t\t\t'abort_if_destination_exists' => $options['abort_if_destination_exists'],\n\t\t\t\t'clear_working'               => $options['clear_working'],\n\t\t\t\t'hook_extra'                  => $options['hook_extra'],\n\t\t\t)\n\t\t);\n\n\t\t$this->skin->set_result( $result );\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\t$this->skin->error( $result );\n\n\t\t\tif ( ! method_exists( $this->skin, 'hide_process_failed' ) || ! $this->skin->hide_process_failed( $result ) ) {\n\t\t\t\t$this->skin->feedback( 'process_failed' );\n\t\t\t}\n\t\t} else {\n\t\t\t// Installation succeeded.\n\t\t\t$this->skin->feedback( 'process_success' );\n\t\t}\n\n\t\t$this->skin->after();\n\n\t\tif ( ! $options['is_multi'] ) {\n\n\t\t\t/**\n\t\t\t * Fires when the upgrader process is complete.\n\t\t\t *\n\t\t\t * See also {@see 'upgrader_package_options'}.\n\t\t\t *\n\t\t\t * @since 3.6.0\n\t\t\t * @since 3.7.0 Added to WP_Upgrader::run().\n\t\t\t * @since 4.6.0 `$translations` was added as a possible argument to `$hook_extra`.\n\t\t\t *\n\t\t\t * @param WP_Upgrader $this WP_Upgrader instance. In other contexts, $this, might be a\n\t\t\t *                          Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance.\n\t\t\t * @param array       $hook_extra {\n\t\t\t *     Array of bulk item update data.\n\t\t\t *\n\t\t\t *     @type string $action       Type of action. Default 'update'.\n\t\t\t *     @type string $type         Type of update process. Accepts 'plugin', 'theme', 'translation', or 'core'.\n\t\t\t *     @type bool   $bulk         Whether the update process is a bulk update. Default true.\n\t\t\t *     @type array  $plugins      Array of the basename paths of the plugins' main files.\n\t\t\t *     @type array  $themes       The theme slugs.\n\t\t\t *     @type array  $translations {\n\t\t\t *         Array of translations update data.\n\t\t\t *\n\t\t\t *         @type string $language The locale the translation is for.\n\t\t\t *         @type string $type     Type of translation. Accepts 'plugin', 'theme', or 'core'.\n\t\t\t *         @type string $slug     Text domain the translation is for. The slug of a theme/plugin or\n\t\t\t *                                'default' for core translations.\n\t\t\t *         @type string $version  The version of a theme, plugin, or core.\n\t\t\t *     }\n\t\t\t * }\n\t\t\t */\n\t\t\tdo_action( 'upgrader_process_complete', $this, $options['hook_extra'] );\n\n\t\t\t$this->skin->footer();\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Toggle maintenance mode for the site.\n\t *\n\t * Creates/deletes the maintenance file to enable/disable maintenance mode.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @global WP_Filesystem_Base $wp_filesystem Subclass\n\t *\n\t * @param bool $enable True to enable maintenance mode, false to disable.\n\t */\n\tpublic function maintenance_mode( $enable = false ) {\n\t\tglobal $wp_filesystem;\n\t\t$file = $wp_filesystem->abspath() . '.maintenance';\n\t\tif ( $enable ) {\n\t\t\t$this->skin->feedback( 'maintenance_start' );\n\t\t\t// Create maintenance file to signal that we are upgrading.\n\t\t\t$maintenance_string = '<?php $upgrading = ' . time() . '; ?>';\n\t\t\t$wp_filesystem->delete( $file );\n\t\t\t$wp_filesystem->put_contents( $file, $maintenance_string, FS_CHMOD_FILE );\n\t\t} elseif ( ! $enable && $wp_filesystem->exists( $file ) ) {\n\t\t\t$this->skin->feedback( 'maintenance_end' );\n\t\t\t$wp_filesystem->delete( $file );\n\t\t}\n\t}\n\n\t/**\n\t * Creates a lock using WordPress options.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param string $lock_name       The name of this unique lock.\n\t * @param int    $release_timeout Optional. The duration in seconds to respect an existing lock.\n\t *                                Default: 1 hour.\n\t * @return bool False if a lock couldn't be created or if the lock is still valid. True otherwise.\n\t */\n\tpublic static function create_lock( $lock_name, $release_timeout = null ) {\n\t\tglobal $wpdb;\n\t\tif ( ! $release_timeout ) {\n\t\t\t$release_timeout = HOUR_IN_SECONDS;\n\t\t}\n\t\t$lock_option = $lock_name . '.lock';\n\n\t\t// Try to lock.\n\t\t$lock_result = $wpdb->query( $wpdb->prepare( \"INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'no') /* LOCK */\", $lock_option, time() ) );\n\n\t\tif ( ! $lock_result ) {\n\t\t\t$lock_result = get_option( $lock_option );\n\n\t\t\t// If a lock couldn't be created, and there isn't a lock, bail.\n\t\t\tif ( ! $lock_result ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Check to see if the lock is still valid. If it is, bail.\n\t\t\tif ( $lock_result > ( time() - $release_timeout ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// There must exist an expired lock, clear it and re-gain it.\n\t\t\tWP_Upgrader::release_lock( $lock_name );\n\n\t\t\treturn WP_Upgrader::create_lock( $lock_name, $release_timeout );\n\t\t}\n\n\t\t// Update the lock, as by this point we've definitely got a lock, just need to fire the actions.\n\t\tupdate_option( $lock_option, time() );\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Releases an upgrader lock.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @see WP_Upgrader::create_lock()\n\t *\n\t * @param string $lock_name The name of this unique lock.\n\t * @return bool True if the lock was successfully released. False on failure.\n\t */\n\tpublic static function release_lock( $lock_name ) {\n\t\treturn delete_option( $lock_name . '.lock' );\n\t}\n\n}\n\n/** Plugin_Upgrader class */\nrequire_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader.php';\n\n/** Theme_Upgrader class */\nrequire_once ABSPATH . 'wp-admin/includes/class-theme-upgrader.php';\n\n/** Language_Pack_Upgrader class */\nrequire_once ABSPATH . 'wp-admin/includes/class-language-pack-upgrader.php';\n\n/** Core_Upgrader class */\nrequire_once ABSPATH . 'wp-admin/includes/class-core-upgrader.php';\n\n/** File_Upload_Upgrader class */\nrequire_once ABSPATH . 'wp-admin/includes/class-file-upload-upgrader.php';\n\n/** WP_Automatic_Updater class */\nrequire_once ABSPATH . 'wp-admin/includes/class-wp-automatic-updater.php';\n", "num_lines": 959}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * List Table API: WP_Users_List_Table class\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n/**\n * Core class used to implement displaying users in a list table.\n *\n * @since 3.1.0\n * @access private\n *\n * @see WP_List_Table\n */\nclass WP_Users_List_Table extends WP_List_Table {\n\n\t/**\n\t * Site ID to generate the Users list table for.\n\t *\n\t * @since 3.1.0\n\t * @var int\n\t */\n\tpublic $site_id;\n\n\t/**\n\t * Whether or not the current Users list table is for Multisite.\n\t *\n\t * @since 3.1.0\n\t * @var bool\n\t */\n\tpublic $is_site_users;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @see WP_List_Table::__construct() for more information on default arguments.\n\t *\n\t * @param array $args An associative array of arguments.\n\t */\n\tpublic function __construct( $args = array() ) {\n\t\tparent::__construct(\n\t\t\tarray(\n\t\t\t\t'singular' => 'user',\n\t\t\t\t'plural'   => 'users',\n\t\t\t\t'screen'   => isset( $args['screen'] ) ? $args['screen'] : null,\n\t\t\t)\n\t\t);\n\n\t\t$this->is_site_users = 'site-users-network' === $this->screen->id;\n\n\t\tif ( $this->is_site_users ) {\n\t\t\t$this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;\n\t\t}\n\t}\n\n\t/**\n\t * Check the current user's permissions.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool\n\t */\n\tpublic function ajax_user_can() {\n\t\tif ( $this->is_site_users ) {\n\t\t\treturn current_user_can( 'manage_sites' );\n\t\t} else {\n\t\t\treturn current_user_can( 'list_users' );\n\t\t}\n\t}\n\n\t/**\n\t * Prepare the users list for display.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @global string $role\n\t * @global string $usersearch\n\t */\n\tpublic function prepare_items() {\n\t\tglobal $role, $usersearch;\n\n\t\t$usersearch = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : '';\n\n\t\t$role = isset( $_REQUEST['role'] ) ? $_REQUEST['role'] : '';\n\n\t\t$per_page       = ( $this->is_site_users ) ? 'site_users_network_per_page' : 'users_per_page';\n\t\t$users_per_page = $this->get_items_per_page( $per_page );\n\n\t\t$paged = $this->get_pagenum();\n\n\t\tif ( 'none' === $role ) {\n\t\t\t$args = array(\n\t\t\t\t'number'  => $users_per_page,\n\t\t\t\t'offset'  => ( $paged - 1 ) * $users_per_page,\n\t\t\t\t'include' => wp_get_users_with_no_role( $this->site_id ),\n\t\t\t\t'search'  => $usersearch,\n\t\t\t\t'fields'  => 'all_with_meta',\n\t\t\t);\n\t\t} else {\n\t\t\t$args = array(\n\t\t\t\t'number' => $users_per_page,\n\t\t\t\t'offset' => ( $paged - 1 ) * $users_per_page,\n\t\t\t\t'role'   => $role,\n\t\t\t\t'search' => $usersearch,\n\t\t\t\t'fields' => 'all_with_meta',\n\t\t\t);\n\t\t}\n\n\t\tif ( '' !== $args['search'] ) {\n\t\t\t$args['search'] = '*' . $args['search'] . '*';\n\t\t}\n\n\t\tif ( $this->is_site_users ) {\n\t\t\t$args['blog_id'] = $this->site_id;\n\t\t}\n\n\t\tif ( isset( $_REQUEST['orderby'] ) ) {\n\t\t\t$args['orderby'] = $_REQUEST['orderby'];\n\t\t}\n\n\t\tif ( isset( $_REQUEST['order'] ) ) {\n\t\t\t$args['order'] = $_REQUEST['order'];\n\t\t}\n\n\t\t/**\n\t\t * Filters the query arguments used to retrieve users for the current users list table.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param array $args Arguments passed to WP_User_Query to retrieve items for the current\n\t\t *                    users list table.\n\t\t */\n\t\t$args = apply_filters( 'users_list_table_query_args', $args );\n\n\t\t// Query the user IDs for this page.\n\t\t$wp_user_search = new WP_User_Query( $args );\n\n\t\t$this->items = $wp_user_search->get_results();\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items' => $wp_user_search->get_total(),\n\t\t\t\t'per_page'    => $users_per_page,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Output 'no users' message.\n\t *\n\t * @since 3.1.0\n\t */\n\tpublic function no_items() {\n\t\t_e( 'No users found.' );\n\t}\n\n\t/**\n\t * Return an associative array listing all the views that can be used\n\t * with this table.\n\t *\n\t * Provides a list of roles and user count for that role for easy\n\t * Filtersing of the user table.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @global string $role\n\t *\n\t * @return string[] An array of HTML links keyed by their view.\n\t */\n\tprotected function get_views() {\n\t\tglobal $role;\n\n\t\t$wp_roles = wp_roles();\n\n\t\tif ( $this->is_site_users ) {\n\t\t\t$url = 'site-users.php?id=' . $this->site_id;\n\t\t\tswitch_to_blog( $this->site_id );\n\t\t\t$users_of_blog = count_users( 'time', $this->site_id );\n\t\t\trestore_current_blog();\n\t\t} else {\n\t\t\t$url           = 'users.php';\n\t\t\t$users_of_blog = count_users();\n\t\t}\n\n\t\t$total_users = $users_of_blog['total_users'];\n\t\t$avail_roles =& $users_of_blog['avail_roles'];\n\t\tunset( $users_of_blog );\n\n\t\t$current_link_attributes = empty( $role ) ? ' class=\"current\" aria-current=\"page\"' : '';\n\n\t\t$role_links        = array();\n\t\t$role_links['all'] = sprintf(\n\t\t\t'<a href=\"%s\"%s>%s</a>',\n\t\t\t$url,\n\t\t\t$current_link_attributes,\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Number of users. */\n\t\t\t\t_nx(\n\t\t\t\t\t'All <span class=\"count\">(%s)</span>',\n\t\t\t\t\t'All <span class=\"count\">(%s)</span>',\n\t\t\t\t\t$total_users,\n\t\t\t\t\t'users'\n\t\t\t\t),\n\t\t\t\tnumber_format_i18n( $total_users )\n\t\t\t)\n\t\t);\n\n\t\tforeach ( $wp_roles->get_names() as $this_role => $name ) {\n\t\t\tif ( ! isset( $avail_roles[ $this_role ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$current_link_attributes = '';\n\n\t\t\tif ( $this_role === $role ) {\n\t\t\t\t$current_link_attributes = ' class=\"current\" aria-current=\"page\"';\n\t\t\t}\n\n\t\t\t$name = translate_user_role( $name );\n\t\t\t$name = sprintf(\n\t\t\t\t/* translators: 1: User role name, 2: Number of users. */\n\t\t\t\t__( '%1$s <span class=\"count\">(%2$s)</span>' ),\n\t\t\t\t$name,\n\t\t\t\tnumber_format_i18n( $avail_roles[ $this_role ] )\n\t\t\t);\n\n\t\t\t$role_links[ $this_role ] = \"<a href='\" . esc_url( add_query_arg( 'role', $this_role, $url ) ) . \"'$current_link_attributes>$name</a>\";\n\t\t}\n\n\t\tif ( ! empty( $avail_roles['none'] ) ) {\n\n\t\t\t$current_link_attributes = '';\n\n\t\t\tif ( 'none' === $role ) {\n\t\t\t\t$current_link_attributes = ' class=\"current\" aria-current=\"page\"';\n\t\t\t}\n\n\t\t\t$name = __( 'No role' );\n\t\t\t$name = sprintf(\n\t\t\t\t/* translators: 1: User role name, 2: Number of users. */\n\t\t\t\t__( '%1$s <span class=\"count\">(%2$s)</span>' ),\n\t\t\t\t$name,\n\t\t\t\tnumber_format_i18n( $avail_roles['none'] )\n\t\t\t);\n\n\t\t\t$role_links['none'] = \"<a href='\" . esc_url( add_query_arg( 'role', 'none', $url ) ) . \"'$current_link_attributes>$name</a>\";\n\t\t}\n\n\t\treturn $role_links;\n\t}\n\n\t/**\n\t * Retrieve an associative array of bulk actions available on this table.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return string[] Array of bulk action labels keyed by their action.\n\t */\n\tprotected function get_bulk_actions() {\n\t\t$actions = array();\n\n\t\tif ( is_multisite() ) {\n\t\t\tif ( current_user_can( 'remove_users' ) ) {\n\t\t\t\t$actions['remove'] = __( 'Remove' );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( current_user_can( 'delete_users' ) ) {\n\t\t\t\t$actions['delete'] = __( 'Delete' );\n\t\t\t}\n\t\t}\n\n\t\treturn $actions;\n\t}\n\n\t/**\n\t * Output the controls to allow user roles to be changed in bulk.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $which Whether this is being invoked above (\"top\")\n\t *                      or below the table (\"bottom\").\n\t */\n\tprotected function extra_tablenav( $which ) {\n\t\t$id        = 'bottom' === $which ? 'new_role2' : 'new_role';\n\t\t$button_id = 'bottom' === $which ? 'changeit2' : 'changeit';\n\t\t?>\n\t<div class=\"alignleft actions\">\n\t\t<?php if ( current_user_can( 'promote_users' ) && $this->has_items() ) : ?>\n\t\t<label class=\"screen-reader-text\" for=\"<?php echo $id; ?>\"><?php _e( 'Change role to&hellip;' ); ?></label>\n\t\t<select name=\"<?php echo $id; ?>\" id=\"<?php echo $id; ?>\">\n\t\t\t<option value=\"\"><?php _e( 'Change role to&hellip;' ); ?></option>\n\t\t\t<?php wp_dropdown_roles(); ?>\n\t\t</select>\n\t\t\t<?php\n\t\t\tsubmit_button( __( 'Change' ), '', $button_id, false );\n\t\tendif;\n\n\t\t/**\n\t\t * Fires just before the closing div containing the bulk role-change controls\n\t\t * in the Users list table.\n\t\t *\n\t\t * @since 3.5.0\n\t\t * @since 4.6.0 The `$which` parameter was added.\n\t\t *\n\t\t * @param string $which The location of the extra table nav markup: 'top' or 'bottom'.\n\t\t */\n\t\tdo_action( 'restrict_manage_users', $which );\n\t\t?>\n\t\t</div>\n\t\t<?php\n\t\t/**\n\t\t * Fires immediately following the closing \"actions\" div in the tablenav for the users\n\t\t * list table.\n\t\t *\n\t\t * @since 4.9.0\n\t\t *\n\t\t * @param string $which The location of the extra table nav markup: 'top' or 'bottom'.\n\t\t */\n\t\tdo_action( 'manage_users_extra_tablenav', $which );\n\t}\n\n\t/**\n\t * Capture the bulk action required, and return it.\n\t *\n\t * Overridden from the base class implementation to capture\n\t * the role change drop-down.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return string The bulk action required.\n\t */\n\tpublic function current_action() {\n\t\tif ( ( isset( $_REQUEST['changeit'] ) || isset( $_REQUEST['changeit2'] ) ) &&\n\t\t\t( ! empty( $_REQUEST['new_role'] ) || ! empty( $_REQUEST['new_role2'] ) ) ) {\n\t\t\treturn 'promote';\n\t\t}\n\n\t\treturn parent::current_action();\n\t}\n\n\t/**\n\t * Get a list of columns for the list table.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return string[] Array of column titles keyed by their column name.\n\t */\n\tpublic function get_columns() {\n\t\t$c = array(\n\t\t\t'cb'       => '<input type=\"checkbox\" />',\n\t\t\t'username' => __( 'Username' ),\n\t\t\t'name'     => __( 'Name' ),\n\t\t\t'email'    => __( 'Email' ),\n\t\t\t'role'     => __( 'Role' ),\n\t\t\t'posts'    => __( 'Posts' ),\n\t\t);\n\n\t\tif ( $this->is_site_users ) {\n\t\t\tunset( $c['posts'] );\n\t\t}\n\n\t\treturn $c;\n\t}\n\n\t/**\n\t * Get a list of sortable columns for the list table.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return array Array of sortable columns.\n\t */\n\tprotected function get_sortable_columns() {\n\t\t$c = array(\n\t\t\t'username' => 'login',\n\t\t\t'email'    => 'email',\n\t\t);\n\n\t\treturn $c;\n\t}\n\n\t/**\n\t * Generate the list table rows.\n\t *\n\t * @since 3.1.0\n\t */\n\tpublic function display_rows() {\n\t\t// Query the post counts for this page.\n\t\tif ( ! $this->is_site_users ) {\n\t\t\t$post_counts = count_many_users_posts( array_keys( $this->items ) );\n\t\t}\n\n\t\tforeach ( $this->items as $userid => $user_object ) {\n\t\t\techo \"\\n\\t\" . $this->single_row( $user_object, '', '', isset( $post_counts ) ? $post_counts[ $userid ] : 0 );\n\t\t}\n\t}\n\n\t/**\n\t * Generate HTML for a single row on the users.php admin panel.\n\t *\n\t * @since 3.1.0\n\t * @since 4.2.0 The `$style` parameter was deprecated.\n\t * @since 4.4.0 The `$role` parameter was deprecated.\n\t *\n\t * @param WP_User $user_object The current user object.\n\t * @param string  $style       Deprecated. Not used.\n\t * @param string  $role        Deprecated. Not used.\n\t * @param int     $numposts    Optional. Post count to display for this user. Defaults\n\t *                             to zero, as in, a new user has made zero posts.\n\t * @return string Output for a single row.\n\t */\n\tpublic function single_row( $user_object, $style = '', $role = '', $numposts = 0 ) {\n\t\tif ( ! ( $user_object instanceof WP_User ) ) {\n\t\t\t$user_object = get_userdata( (int) $user_object );\n\t\t}\n\t\t$user_object->filter = 'display';\n\t\t$email               = $user_object->user_email;\n\n\t\tif ( $this->is_site_users ) {\n\t\t\t$url = \"site-users.php?id={$this->site_id}&amp;\";\n\t\t} else {\n\t\t\t$url = 'users.php?';\n\t\t}\n\n\t\t$user_roles = $this->get_role_list( $user_object );\n\n\t\t// Set up the hover actions for this user.\n\t\t$actions     = array();\n\t\t$checkbox    = '';\n\t\t$super_admin = '';\n\n\t\tif ( is_multisite() && current_user_can( 'manage_network_users' ) ) {\n\t\t\tif ( in_array( $user_object->user_login, get_super_admins(), true ) ) {\n\t\t\t\t$super_admin = ' &mdash; ' . __( 'Super Admin' );\n\t\t\t}\n\t\t}\n\n\t\t// Check if the user for this row is editable.\n\t\tif ( current_user_can( 'list_users' ) ) {\n\t\t\t// Set up the user editing link.\n\t\t\t$edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user_object->ID ) ) );\n\n\t\t\tif ( current_user_can( 'edit_user', $user_object->ID ) ) {\n\t\t\t\t$edit            = \"<strong><a href=\\\"{$edit_link}\\\">{$user_object->user_login}</a>{$super_admin}</strong><br />\";\n\t\t\t\t$actions['edit'] = '<a href=\"' . $edit_link . '\">' . __( 'Edit' ) . '</a>';\n\t\t\t} else {\n\t\t\t\t$edit = \"<strong>{$user_object->user_login}{$super_admin}</strong><br />\";\n\t\t\t}\n\n\t\t\tif ( ! is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'delete_user', $user_object->ID ) ) {\n\t\t\t\t$actions['delete'] = \"<a class='submitdelete' href='\" . wp_nonce_url( \"users.php?action=delete&amp;user=$user_object->ID\", 'bulk-users' ) . \"'>\" . __( 'Delete' ) . '</a>';\n\t\t\t}\n\t\t\tif ( is_multisite() && current_user_can( 'remove_user', $user_object->ID ) ) {\n\t\t\t\t$actions['remove'] = \"<a class='submitdelete' href='\" . wp_nonce_url( $url . \"action=remove&amp;user=$user_object->ID\", 'bulk-users' ) . \"'>\" . __( 'Remove' ) . '</a>';\n\t\t\t}\n\n\t\t\t// Add a link to the user's author archive, if not empty.\n\t\t\t$author_posts_url = get_author_posts_url( $user_object->ID );\n\t\t\tif ( $author_posts_url ) {\n\t\t\t\t$actions['view'] = sprintf(\n\t\t\t\t\t'<a href=\"%s\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\tesc_url( $author_posts_url ),\n\t\t\t\t\t/* translators: %s: Author's display name. */\n\t\t\t\t\tesc_attr( sprintf( __( 'View posts by %s' ), $user_object->display_name ) ),\n\t\t\t\t\t__( 'View' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the action links displayed under each user in the Users list table.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t *\n\t\t\t * @param string[] $actions     An array of action links to be displayed.\n\t\t\t *                              Default 'Edit', 'Delete' for single site, and\n\t\t\t *                              'Edit', 'Remove' for Multisite.\n\t\t\t * @param WP_User  $user_object WP_User object for the currently listed user.\n\t\t\t */\n\t\t\t$actions = apply_filters( 'user_row_actions', $actions, $user_object );\n\n\t\t\t// Role classes.\n\t\t\t$role_classes = esc_attr( implode( ' ', array_keys( $user_roles ) ) );\n\n\t\t\t// Set up the checkbox (because the user is editable, otherwise it's empty).\n\t\t\t$checkbox = sprintf(\n\t\t\t\t'<label class=\"screen-reader-text\" for=\"user_%1$s\">%2$s</label>' .\n\t\t\t\t'<input type=\"checkbox\" name=\"users[]\" id=\"user_%1$s\" class=\"%3$s\" value=\"%1$s\" />',\n\t\t\t\t$user_object->ID,\n\t\t\t\t/* translators: %s: User login. */\n\t\t\t\tsprintf( __( 'Select %s' ), $user_object->user_login ),\n\t\t\t\t$role_classes\n\t\t\t);\n\n\t\t} else {\n\t\t\t$edit = \"<strong>{$user_object->user_login}{$super_admin}</strong>\";\n\t\t}\n\n\t\t$avatar = get_avatar( $user_object->ID, 32 );\n\n\t\t// Comma-separated list of user roles.\n\t\t$roles_list = implode( ', ', $user_roles );\n\n\t\t$r = \"<tr id='user-$user_object->ID'>\";\n\n\t\tlist( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();\n\n\t\tforeach ( $columns as $column_name => $column_display_name ) {\n\t\t\t$classes = \"$column_name column-$column_name\";\n\t\t\tif ( $primary === $column_name ) {\n\t\t\t\t$classes .= ' has-row-actions column-primary';\n\t\t\t}\n\t\t\tif ( 'posts' === $column_name ) {\n\t\t\t\t$classes .= ' num'; // Special case for that column.\n\t\t\t}\n\n\t\t\tif ( in_array( $column_name, $hidden, true ) ) {\n\t\t\t\t$classes .= ' hidden';\n\t\t\t}\n\n\t\t\t$data = 'data-colname=\"' . wp_strip_all_tags( $column_display_name ) . '\"';\n\n\t\t\t$attributes = \"class='$classes' $data\";\n\n\t\t\tif ( 'cb' === $column_name ) {\n\t\t\t\t$r .= \"<th scope='row' class='check-column'>$checkbox</th>\";\n\t\t\t} else {\n\t\t\t\t$r .= \"<td $attributes>\";\n\t\t\t\tswitch ( $column_name ) {\n\t\t\t\t\tcase 'username':\n\t\t\t\t\t\t$r .= \"$avatar $edit\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'name':\n\t\t\t\t\t\tif ( $user_object->first_name && $user_object->last_name ) {\n\t\t\t\t\t\t\t$r .= \"$user_object->first_name $user_object->last_name\";\n\t\t\t\t\t\t} elseif ( $user_object->first_name ) {\n\t\t\t\t\t\t\t$r .= $user_object->first_name;\n\t\t\t\t\t\t} elseif ( $user_object->last_name ) {\n\t\t\t\t\t\t\t$r .= $user_object->last_name;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$r .= sprintf(\n\t\t\t\t\t\t\t\t'<span aria-hidden=\"true\">&#8212;</span><span class=\"screen-reader-text\">%s</span>',\n\t\t\t\t\t\t\t\t_x( 'Unknown', 'name' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'email':\n\t\t\t\t\t\t$r .= \"<a href='\" . esc_url( \"mailto:$email\" ) . \"'>$email</a>\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'role':\n\t\t\t\t\t\t$r .= esc_html( $roles_list );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'posts':\n\t\t\t\t\t\tif ( $numposts > 0 ) {\n\t\t\t\t\t\t\t$r .= sprintf(\n\t\t\t\t\t\t\t\t'<a href=\"%s\" class=\"edit\"><span aria-hidden=\"true\">%s</span><span class=\"screen-reader-text\">%s</span></a>',\n\t\t\t\t\t\t\t\t\"edit.php?author={$user_object->ID}\",\n\t\t\t\t\t\t\t\t$numposts,\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: Number of posts. */\n\t\t\t\t\t\t\t\t\t_n( '%s post by this author', '%s posts by this author', $numposts ),\n\t\t\t\t\t\t\t\t\tnumber_format_i18n( $numposts )\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$r .= 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Filters the display output of custom columns in the Users list table.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @since 2.8.0\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @param string $output      Custom column output. Default empty.\n\t\t\t\t\t\t * @param string $column_name Column name.\n\t\t\t\t\t\t * @param int    $user_id     ID of the currently-listed user.\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$r .= apply_filters( 'manage_users_custom_column', '', $column_name, $user_object->ID );\n\t\t\t\t}\n\n\t\t\t\tif ( $primary === $column_name ) {\n\t\t\t\t\t$r .= $this->row_actions( $actions );\n\t\t\t\t}\n\t\t\t\t$r .= '</td>';\n\t\t\t}\n\t\t}\n\t\t$r .= '</tr>';\n\n\t\treturn $r;\n\t}\n\n\t/**\n\t * Gets the name of the default primary column.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @return string Name of the default primary column, in this case, 'username'.\n\t */\n\tprotected function get_default_primary_column_name() {\n\t\treturn 'username';\n\t}\n\n\t/**\n\t * Returns an array of user roles for a given user object.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param WP_User $user_object The WP_User object.\n\t * @return string[] An array of user roles.\n\t */\n\tprotected function get_role_list( $user_object ) {\n\t\t$wp_roles = wp_roles();\n\n\t\t$role_list = array();\n\n\t\tforeach ( $user_object->roles as $role ) {\n\t\t\tif ( isset( $wp_roles->role_names[ $role ] ) ) {\n\t\t\t\t$role_list[ $role ] = translate_user_role( $wp_roles->role_names[ $role ] );\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $role_list ) ) {\n\t\t\t$role_list['none'] = _x( 'None', 'no user roles' );\n\t\t}\n\n\t\t/**\n\t\t * Filters the returned array of roles for a user.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string[] $role_list   An array of user roles.\n\t\t * @param WP_User  $user_object A WP_User object.\n\t\t */\n\t\treturn apply_filters( 'get_role_list', $role_list, $user_object );\n\t}\n\n}\n", "num_lines": 642}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Comment Administration API.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 2.3.0\n */\n\n/**\n * Determine if a comment exists based on author and date.\n *\n * For best performance, use `$timezone = 'gmt'`, which queries a field that is properly indexed. The default value\n * for `$timezone` is 'blog' for legacy reasons.\n *\n * @since 2.0.0\n * @since 4.4.0 Added the `$timezone` parameter.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $comment_author Author of the comment.\n * @param string $comment_date   Date of the comment.\n * @param string $timezone       Timezone. Accepts 'blog' or 'gmt'. Default 'blog'.\n * @return string|null Comment post ID on success.\n */\nfunction comment_exists( $comment_author, $comment_date, $timezone = 'blog' ) {\n\tglobal $wpdb;\n\n\t$date_field = 'comment_date';\n\tif ( 'gmt' === $timezone ) {\n\t\t$date_field = 'comment_date_gmt';\n\t}\n\n\treturn $wpdb->get_var(\n\t\t$wpdb->prepare(\n\t\t\t\"SELECT comment_post_ID FROM $wpdb->comments\n\t\t\tWHERE comment_author = %s AND $date_field = %s\",\n\t\t\tstripslashes( $comment_author ),\n\t\t\tstripslashes( $comment_date )\n\t\t)\n\t);\n}\n\n/**\n * Update a comment with values provided in $_POST.\n *\n * @since 2.0.0\n * @since 5.5.0 A return value was added.\n *\n * @return int|WP_Error The value 1 if the comment was updated, 0 if not updated.\n *                      A WP_Error object on failure.\n */\nfunction edit_comment() {\n\tif ( ! current_user_can( 'edit_comment', (int) $_POST['comment_ID'] ) ) {\n\t\twp_die( __( 'Sorry, you are not allowed to edit comments on this post.' ) );\n\t}\n\n\tif ( isset( $_POST['newcomment_author'] ) ) {\n\t\t$_POST['comment_author'] = $_POST['newcomment_author'];\n\t}\n\tif ( isset( $_POST['newcomment_author_email'] ) ) {\n\t\t$_POST['comment_author_email'] = $_POST['newcomment_author_email'];\n\t}\n\tif ( isset( $_POST['newcomment_author_url'] ) ) {\n\t\t$_POST['comment_author_url'] = $_POST['newcomment_author_url'];\n\t}\n\tif ( isset( $_POST['comment_status'] ) ) {\n\t\t$_POST['comment_approved'] = $_POST['comment_status'];\n\t}\n\tif ( isset( $_POST['content'] ) ) {\n\t\t$_POST['comment_content'] = $_POST['content'];\n\t}\n\tif ( isset( $_POST['comment_ID'] ) ) {\n\t\t$_POST['comment_ID'] = (int) $_POST['comment_ID'];\n\t}\n\n\tforeach ( array( 'aa', 'mm', 'jj', 'hh', 'mn' ) as $timeunit ) {\n\t\tif ( ! empty( $_POST[ 'hidden_' . $timeunit ] ) && $_POST[ 'hidden_' . $timeunit ] != $_POST[ $timeunit ] ) {\n\t\t\t$_POST['edit_date'] = '1';\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ( ! empty( $_POST['edit_date'] ) ) {\n\t\t$aa = $_POST['aa'];\n\t\t$mm = $_POST['mm'];\n\t\t$jj = $_POST['jj'];\n\t\t$hh = $_POST['hh'];\n\t\t$mn = $_POST['mn'];\n\t\t$ss = $_POST['ss'];\n\t\t$jj = ( $jj > 31 ) ? 31 : $jj;\n\t\t$hh = ( $hh > 23 ) ? $hh - 24 : $hh;\n\t\t$mn = ( $mn > 59 ) ? $mn - 60 : $mn;\n\t\t$ss = ( $ss > 59 ) ? $ss - 60 : $ss;\n\n\t\t$_POST['comment_date'] = \"$aa-$mm-$jj $hh:$mn:$ss\";\n\t}\n\n\treturn wp_update_comment( $_POST, true );\n}\n\n/**\n * Returns a WP_Comment object based on comment ID.\n *\n * @since 2.0.0\n *\n * @param int $id ID of comment to retrieve.\n * @return WP_Comment|false Comment if found. False on failure.\n */\nfunction get_comment_to_edit( $id ) {\n\t$comment = get_comment( $id );\n\tif ( ! $comment ) {\n\t\treturn false;\n\t}\n\n\t$comment->comment_ID      = (int) $comment->comment_ID;\n\t$comment->comment_post_ID = (int) $comment->comment_post_ID;\n\n\t$comment->comment_content = format_to_edit( $comment->comment_content );\n\t/**\n\t * Filters the comment content before editing.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $comment_content Comment content.\n\t */\n\t$comment->comment_content = apply_filters( 'comment_edit_pre', $comment->comment_content );\n\n\t$comment->comment_author       = format_to_edit( $comment->comment_author );\n\t$comment->comment_author_email = format_to_edit( $comment->comment_author_email );\n\t$comment->comment_author_url   = format_to_edit( $comment->comment_author_url );\n\t$comment->comment_author_url   = esc_url( $comment->comment_author_url );\n\n\treturn $comment;\n}\n\n/**\n * Get the number of pending comments on a post or posts\n *\n * @since 2.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int|array $post_id Either a single Post ID or an array of Post IDs\n * @return int|array Either a single Posts pending comments as an int or an array of ints keyed on the Post IDs\n */\nfunction get_pending_comments_num( $post_id ) {\n\tglobal $wpdb;\n\n\t$single = false;\n\tif ( ! is_array( $post_id ) ) {\n\t\t$post_id_array = (array) $post_id;\n\t\t$single        = true;\n\t} else {\n\t\t$post_id_array = $post_id;\n\t}\n\t$post_id_array = array_map( 'intval', $post_id_array );\n\t$post_id_in    = \"'\" . implode( \"', '\", $post_id_array ) . \"'\";\n\n\t$pending = $wpdb->get_results( \"SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id_in ) AND comment_approved = '0' GROUP BY comment_post_ID\", ARRAY_A );\n\n\tif ( $single ) {\n\t\tif ( empty( $pending ) ) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn absint( $pending[0]['num_comments'] );\n\t\t}\n\t}\n\n\t$pending_keyed = array();\n\n\t// Default to zero pending for all posts in request.\n\tforeach ( $post_id_array as $id ) {\n\t\t$pending_keyed[ $id ] = 0;\n\t}\n\n\tif ( ! empty( $pending ) ) {\n\t\tforeach ( $pending as $pend ) {\n\t\t\t$pending_keyed[ $pend['comment_post_ID'] ] = absint( $pend['num_comments'] );\n\t\t}\n\t}\n\n\treturn $pending_keyed;\n}\n\n/**\n * Adds avatars to relevant places in admin.\n *\n * @since 2.5.0\n *\n * @param string $name User name.\n * @return string Avatar with the user name.\n */\nfunction floated_admin_avatar( $name ) {\n\t$avatar = get_avatar( get_comment(), 32, 'mystery' );\n\treturn \"$avatar $name\";\n}\n\n/**\n * @since 2.7.0\n */\nfunction enqueue_comment_hotkeys_js() {\n\tif ( 'true' === get_user_option( 'comment_shortcuts' ) ) {\n\t\twp_enqueue_script( 'jquery-table-hotkeys' );\n\t}\n}\n\n/**\n * Display error message at bottom of comments.\n *\n * @param string $msg Error Message. Assumed to contain HTML and be sanitized.\n */\nfunction comment_footer_die( $msg ) {\n\techo \"<div class='wrap'><p>$msg</p></div>\";\n\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\tdie;\n}\n", "num_lines": 218}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Translation API: Continent and city translations for timezone selection\n *\n * This file is not included anywhere. It exists solely for use by xgettext.\n *\n * @package WordPress\n * @subpackage i18n\n * @since 2.8.0\n */\n\n__( 'Africa', 'continents-cities' );\n__( 'Abidjan', 'continents-cities' );\n__( 'Accra', 'continents-cities' );\n__( 'Addis Ababa', 'continents-cities' );\n__( 'Algiers', 'continents-cities' );\n__( 'Asmara', 'continents-cities' );\n__( 'Asmera', 'continents-cities' );\n__( 'Bamako', 'continents-cities' );\n__( 'Bangui', 'continents-cities' );\n__( 'Banjul', 'continents-cities' );\n__( 'Bissau', 'continents-cities' );\n__( 'Blantyre', 'continents-cities' );\n__( 'Brazzaville', 'continents-cities' );\n__( 'Bujumbura', 'continents-cities' );\n__( 'Cairo', 'continents-cities' );\n__( 'Casablanca', 'continents-cities' );\n__( 'Ceuta', 'continents-cities' );\n__( 'Conakry', 'continents-cities' );\n__( 'Dakar', 'continents-cities' );\n__( 'Dar es Salaam', 'continents-cities' );\n__( 'Djibouti', 'continents-cities' );\n__( 'Douala', 'continents-cities' );\n__( 'El Aaiun', 'continents-cities' );\n__( 'Freetown', 'continents-cities' );\n__( 'Gaborone', 'continents-cities' );\n__( 'Harare', 'continents-cities' );\n__( 'Johannesburg', 'continents-cities' );\n__( 'Juba', 'continents-cities' );\n__( 'Kampala', 'continents-cities' );\n__( 'Khartoum', 'continents-cities' );\n__( 'Kigali', 'continents-cities' );\n__( 'Kinshasa', 'continents-cities' );\n__( 'Lagos', 'continents-cities' );\n__( 'Libreville', 'continents-cities' );\n__( 'Lome', 'continents-cities' );\n__( 'Luanda', 'continents-cities' );\n__( 'Lubumbashi', 'continents-cities' );\n__( 'Lusaka', 'continents-cities' );\n__( 'Malabo', 'continents-cities' );\n__( 'Maputo', 'continents-cities' );\n__( 'Maseru', 'continents-cities' );\n__( 'Mbabane', 'continents-cities' );\n__( 'Mogadishu', 'continents-cities' );\n__( 'Monrovia', 'continents-cities' );\n__( 'Nairobi', 'continents-cities' );\n__( 'Ndjamena', 'continents-cities' );\n__( 'Niamey', 'continents-cities' );\n__( 'Nouakchott', 'continents-cities' );\n__( 'Ouagadougou', 'continents-cities' );\n__( 'Porto-Novo', 'continents-cities' );\n__( 'Sao Tome', 'continents-cities' );\n__( 'Timbuktu', 'continents-cities' );\n__( 'Tripoli', 'continents-cities' );\n__( 'Tunis', 'continents-cities' );\n__( 'Windhoek', 'continents-cities' );\n\n__( 'America', 'continents-cities' );\n__( 'Adak', 'continents-cities' );\n__( 'Anchorage', 'continents-cities' );\n__( 'Anguilla', 'continents-cities' );\n__( 'Antigua', 'continents-cities' );\n__( 'Araguaina', 'continents-cities' );\n__( 'Argentina', 'continents-cities' );\n__( 'Buenos Aires', 'continents-cities' );\n__( 'Catamarca', 'continents-cities' );\n__( 'ComodRivadavia', 'continents-cities' );\n__( 'Cordoba', 'continents-cities' );\n__( 'Jujuy', 'continents-cities' );\n__( 'La Rioja', 'continents-cities' );\n__( 'Mendoza', 'continents-cities' );\n__( 'Rio Gallegos', 'continents-cities' );\n__( 'Salta', 'continents-cities' );\n__( 'San Juan', 'continents-cities' );\n__( 'San Luis', 'continents-cities' );\n__( 'Tucuman', 'continents-cities' );\n__( 'Ushuaia', 'continents-cities' );\n__( 'Aruba', 'continents-cities' );\n__( 'Asuncion', 'continents-cities' );\n__( 'Atikokan', 'continents-cities' );\n__( 'Atka', 'continents-cities' );\n__( 'Bahia', 'continents-cities' );\n__( 'Bahia Banderas', 'continents-cities' );\n__( 'Barbados', 'continents-cities' );\n__( 'Belem', 'continents-cities' );\n__( 'Belize', 'continents-cities' );\n__( 'Blanc-Sablon', 'continents-cities' );\n__( 'Boa Vista', 'continents-cities' );\n__( 'Bogota', 'continents-cities' );\n__( 'Boise', 'continents-cities' );\n__( 'Buenos Aires', 'continents-cities' );\n__( 'Cambridge Bay', 'continents-cities' );\n__( 'Campo Grande', 'continents-cities' );\n__( 'Cancun', 'continents-cities' );\n__( 'Caracas', 'continents-cities' );\n__( 'Catamarca', 'continents-cities' );\n__( 'Cayenne', 'continents-cities' );\n__( 'Cayman', 'continents-cities' );\n__( 'Chicago', 'continents-cities' );\n__( 'Chihuahua', 'continents-cities' );\n__( 'Coral Harbour', 'continents-cities' );\n__( 'Cordoba', 'continents-cities' );\n__( 'Costa Rica', 'continents-cities' );\n__( 'Creston', 'continents-cities' );\n__( 'Cuiaba', 'continents-cities' );\n__( 'Curacao', 'continents-cities' );\n__( 'Danmarkshavn', 'continents-cities' );\n__( 'Dawson', 'continents-cities' );\n__( 'Dawson Creek', 'continents-cities' );\n__( 'Denver', 'continents-cities' );\n__( 'Detroit', 'continents-cities' );\n__( 'Dominica', 'continents-cities' );\n__( 'Edmonton', 'continents-cities' );\n__( 'Eirunepe', 'continents-cities' );\n__( 'El Salvador', 'continents-cities' );\n__( 'Ensenada', 'continents-cities' );\n__( 'Fort Nelson', 'continents-cities' );\n__( 'Fort Wayne', 'continents-cities' );\n__( 'Fortaleza', 'continents-cities' );\n__( 'Glace Bay', 'continents-cities' );\n__( 'Godthab', 'continents-cities' );\n__( 'Goose Bay', 'continents-cities' );\n__( 'Grand Turk', 'continents-cities' );\n__( 'Grenada', 'continents-cities' );\n__( 'Guadeloupe', 'continents-cities' );\n__( 'Guatemala', 'continents-cities' );\n__( 'Guayaquil', 'continents-cities' );\n__( 'Guyana', 'continents-cities' );\n__( 'Halifax', 'continents-cities' );\n__( 'Havana', 'continents-cities' );\n__( 'Hermosillo', 'continents-cities' );\n__( 'Indiana', 'continents-cities' );\n__( 'Indianapolis', 'continents-cities' );\n__( 'Knox', 'continents-cities' );\n__( 'Marengo', 'continents-cities' );\n__( 'Petersburg', 'continents-cities' );\n__( 'Tell City', 'continents-cities' );\n__( 'Vevay', 'continents-cities' );\n__( 'Vincennes', 'continents-cities' );\n__( 'Winamac', 'continents-cities' );\n__( 'Indianapolis', 'continents-cities' );\n__( 'Inuvik', 'continents-cities' );\n__( 'Iqaluit', 'continents-cities' );\n__( 'Jamaica', 'continents-cities' );\n__( 'Jujuy', 'continents-cities' );\n__( 'Juneau', 'continents-cities' );\n__( 'Kentucky', 'continents-cities' );\n__( 'Louisville', 'continents-cities' );\n__( 'Monticello', 'continents-cities' );\n__( 'Knox IN', 'continents-cities' );\n__( 'Kralendijk', 'continents-cities' );\n__( 'La Paz', 'continents-cities' );\n__( 'Lima', 'continents-cities' );\n__( 'Los Angeles', 'continents-cities' );\n__( 'Louisville', 'continents-cities' );\n__( 'Lower Princes', 'continents-cities' );\n__( 'Maceio', 'continents-cities' );\n__( 'Managua', 'continents-cities' );\n__( 'Manaus', 'continents-cities' );\n__( 'Marigot', 'continents-cities' );\n__( 'Martinique', 'continents-cities' );\n__( 'Matamoros', 'continents-cities' );\n__( 'Mazatlan', 'continents-cities' );\n__( 'Mendoza', 'continents-cities' );\n__( 'Menominee', 'continents-cities' );\n__( 'Merida', 'continents-cities' );\n__( 'Metlakatla', 'continents-cities' );\n__( 'Mexico City', 'continents-cities' );\n__( 'Miquelon', 'continents-cities' );\n__( 'Moncton', 'continents-cities' );\n__( 'Monterrey', 'continents-cities' );\n__( 'Montevideo', 'continents-cities' );\n__( 'Montreal', 'continents-cities' );\n__( 'Montserrat', 'continents-cities' );\n__( 'Nassau', 'continents-cities' );\n__( 'New York', 'continents-cities' );\n__( 'Nipigon', 'continents-cities' );\n__( 'Nome', 'continents-cities' );\n__( 'Noronha', 'continents-cities' );\n__( 'North Dakota', 'continents-cities' );\n__( 'Beulah', 'continents-cities' );\n__( 'Center', 'continents-cities' );\n__( 'New Salem', 'continents-cities' );\n__( 'Ojinaga', 'continents-cities' );\n__( 'Panama', 'continents-cities' );\n__( 'Pangnirtung', 'continents-cities' );\n__( 'Paramaribo', 'continents-cities' );\n__( 'Phoenix', 'continents-cities' );\n__( 'Port of Spain', 'continents-cities' );\n__( 'Port-au-Prince', 'continents-cities' );\n__( 'Porto Acre', 'continents-cities' );\n__( 'Porto Velho', 'continents-cities' );\n__( 'Puerto Rico', 'continents-cities' );\n__( 'Punta Arenas', 'continents-cities' );\n__( 'Rainy River', 'continents-cities' );\n__( 'Rankin Inlet', 'continents-cities' );\n__( 'Recife', 'continents-cities' );\n__( 'Regina', 'continents-cities' );\n__( 'Resolute', 'continents-cities' );\n__( 'Rio Branco', 'continents-cities' );\n__( 'Rosario', 'continents-cities' );\n__( 'Santa Isabel', 'continents-cities' );\n__( 'Santarem', 'continents-cities' );\n__( 'Santiago', 'continents-cities' );\n__( 'Santo Domingo', 'continents-cities' );\n__( 'Sao Paulo', 'continents-cities' );\n__( 'Scoresbysund', 'continents-cities' );\n__( 'Shiprock', 'continents-cities' );\n__( 'Sitka', 'continents-cities' );\n__( 'St Barthelemy', 'continents-cities' );\n__( 'St Johns', 'continents-cities' );\n__( 'St Kitts', 'continents-cities' );\n__( 'St Lucia', 'continents-cities' );\n__( 'St Thomas', 'continents-cities' );\n__( 'St Vincent', 'continents-cities' );\n__( 'Swift Current', 'continents-cities' );\n__( 'Tegucigalpa', 'continents-cities' );\n__( 'Thule', 'continents-cities' );\n__( 'Thunder Bay', 'continents-cities' );\n__( 'Tijuana', 'continents-cities' );\n__( 'Toronto', 'continents-cities' );\n__( 'Tortola', 'continents-cities' );\n__( 'Vancouver', 'continents-cities' );\n__( 'Virgin', 'continents-cities' );\n__( 'Whitehorse', 'continents-cities' );\n__( 'Winnipeg', 'continents-cities' );\n__( 'Yakutat', 'continents-cities' );\n__( 'Yellowknife', 'continents-cities' );\n\n__( 'Antarctica', 'continents-cities' );\n__( 'Casey', 'continents-cities' );\n__( 'Davis', 'continents-cities' );\n__( 'DumontDUrville', 'continents-cities' );\n__( 'Macquarie', 'continents-cities' );\n__( 'Mawson', 'continents-cities' );\n__( 'McMurdo', 'continents-cities' );\n__( 'Palmer', 'continents-cities' );\n__( 'Rothera', 'continents-cities' );\n__( 'South Pole', 'continents-cities' );\n__( 'Syowa', 'continents-cities' );\n__( 'Troll', 'continents-cities' );\n__( 'Vostok', 'continents-cities' );\n\n__( 'Arctic', 'continents-cities' );\n__( 'Longyearbyen', 'continents-cities' );\n\n__( 'Asia', 'continents-cities' );\n__( 'Aden', 'continents-cities' );\n__( 'Almaty', 'continents-cities' );\n__( 'Amman', 'continents-cities' );\n__( 'Anadyr', 'continents-cities' );\n__( 'Aqtau', 'continents-cities' );\n__( 'Aqtobe', 'continents-cities' );\n__( 'Ashgabat', 'continents-cities' );\n__( 'Ashkhabad', 'continents-cities' );\n__( 'Atyrau', 'continents-cities' );\n__( 'Baghdad', 'continents-cities' );\n__( 'Bahrain', 'continents-cities' );\n__( 'Baku', 'continents-cities' );\n__( 'Bangkok', 'continents-cities' );\n__( 'Barnaul', 'continents-cities' );\n__( 'Beirut', 'continents-cities' );\n__( 'Bishkek', 'continents-cities' );\n__( 'Brunei', 'continents-cities' );\n__( 'Calcutta', 'continents-cities' );\n__( 'Chita', 'continents-cities' );\n__( 'Choibalsan', 'continents-cities' );\n__( 'Chongqing', 'continents-cities' );\n__( 'Chungking', 'continents-cities' );\n__( 'Colombo', 'continents-cities' );\n__( 'Dacca', 'continents-cities' );\n__( 'Damascus', 'continents-cities' );\n__( 'Dhaka', 'continents-cities' );\n__( 'Dili', 'continents-cities' );\n__( 'Dubai', 'continents-cities' );\n__( 'Dushanbe', 'continents-cities' );\n__( 'Famagusta', 'continents-cities' );\n__( 'Gaza', 'continents-cities' );\n__( 'Harbin', 'continents-cities' );\n__( 'Hebron', 'continents-cities' );\n__( 'Ho Chi Minh', 'continents-cities' );\n__( 'Hong Kong', 'continents-cities' );\n__( 'Hovd', 'continents-cities' );\n__( 'Irkutsk', 'continents-cities' );\n__( 'Istanbul', 'continents-cities' );\n__( 'Jakarta', 'continents-cities' );\n__( 'Jayapura', 'continents-cities' );\n__( 'Jerusalem', 'continents-cities' );\n__( 'Kabul', 'continents-cities' );\n__( 'Kamchatka', 'continents-cities' );\n__( 'Karachi', 'continents-cities' );\n__( 'Kashgar', 'continents-cities' );\n__( 'Kathmandu', 'continents-cities' );\n__( 'Katmandu', 'continents-cities' );\n__( 'Khandyga', 'continents-cities' );\n__( 'Kolkata', 'continents-cities' );\n__( 'Krasnoyarsk', 'continents-cities' );\n__( 'Kuala Lumpur', 'continents-cities' );\n__( 'Kuching', 'continents-cities' );\n__( 'Kuwait', 'continents-cities' );\n__( 'Macao', 'continents-cities' );\n__( 'Macau', 'continents-cities' );\n__( 'Magadan', 'continents-cities' );\n__( 'Makassar', 'continents-cities' );\n__( 'Manila', 'continents-cities' );\n__( 'Muscat', 'continents-cities' );\n__( 'Nicosia', 'continents-cities' );\n__( 'Novokuznetsk', 'continents-cities' );\n__( 'Novosibirsk', 'continents-cities' );\n__( 'Omsk', 'continents-cities' );\n__( 'Oral', 'continents-cities' );\n__( 'Phnom Penh', 'continents-cities' );\n__( 'Pontianak', 'continents-cities' );\n__( 'Pyongyang', 'continents-cities' );\n__( 'Qatar', 'continents-cities' );\n__( 'Qyzylorda', 'continents-cities' );\n__( 'Rangoon', 'continents-cities' );\n__( 'Riyadh', 'continents-cities' );\n__( 'Saigon', 'continents-cities' );\n__( 'Sakhalin', 'continents-cities' );\n__( 'Samarkand', 'continents-cities' );\n__( 'Seoul', 'continents-cities' );\n__( 'Shanghai', 'continents-cities' );\n__( 'Singapore', 'continents-cities' );\n__( 'Srednekolymsk', 'continents-cities' );\n__( 'Taipei', 'continents-cities' );\n__( 'Tashkent', 'continents-cities' );\n__( 'Tbilisi', 'continents-cities' );\n__( 'Tehran', 'continents-cities' );\n__( 'Tel Aviv', 'continents-cities' );\n__( 'Thimbu', 'continents-cities' );\n__( 'Thimphu', 'continents-cities' );\n__( 'Tokyo', 'continents-cities' );\n__( 'Tomsk', 'continents-cities' );\n__( 'Ujung Pandang', 'continents-cities' );\n__( 'Ulaanbaatar', 'continents-cities' );\n__( 'Ulan Bator', 'continents-cities' );\n__( 'Urumqi', 'continents-cities' );\n__( 'Ust-Nera', 'continents-cities' );\n__( 'Vientiane', 'continents-cities' );\n__( 'Vladivostok', 'continents-cities' );\n__( 'Yakutsk', 'continents-cities' );\n__( 'Yangon', 'continents-cities' );\n__( 'Yekaterinburg', 'continents-cities' );\n__( 'Yerevan', 'continents-cities' );\n\n__( 'Atlantic', 'continents-cities' );\n__( 'Azores', 'continents-cities' );\n__( 'Bermuda', 'continents-cities' );\n__( 'Canary', 'continents-cities' );\n__( 'Cape Verde', 'continents-cities' );\n__( 'Faeroe', 'continents-cities' );\n__( 'Faroe', 'continents-cities' );\n__( 'Jan Mayen', 'continents-cities' );\n__( 'Madeira', 'continents-cities' );\n__( 'Reykjavik', 'continents-cities' );\n__( 'South Georgia', 'continents-cities' );\n__( 'St Helena', 'continents-cities' );\n__( 'Stanley', 'continents-cities' );\n\n__( 'Australia', 'continents-cities' );\n__( 'ACT', 'continents-cities' );\n__( 'Adelaide', 'continents-cities' );\n__( 'Brisbane', 'continents-cities' );\n__( 'Broken Hill', 'continents-cities' );\n__( 'Canberra', 'continents-cities' );\n__( 'Currie', 'continents-cities' );\n__( 'Darwin', 'continents-cities' );\n__( 'Eucla', 'continents-cities' );\n__( 'Hobart', 'continents-cities' );\n__( 'LHI', 'continents-cities' );\n__( 'Lindeman', 'continents-cities' );\n__( 'Lord Howe', 'continents-cities' );\n__( 'Melbourne', 'continents-cities' );\n__( 'NSW', 'continents-cities' );\n__( 'North', 'continents-cities' );\n__( 'Perth', 'continents-cities' );\n__( 'Queensland', 'continents-cities' );\n__( 'South', 'continents-cities' );\n__( 'Sydney', 'continents-cities' );\n__( 'Tasmania', 'continents-cities' );\n__( 'Victoria', 'continents-cities' );\n__( 'West', 'continents-cities' );\n__( 'Yancowinna', 'continents-cities' );\n\n__( 'Etc', 'continents-cities' );\n__( 'GMT', 'continents-cities' );\n__( 'GMT+0', 'continents-cities' );\n__( 'GMT+1', 'continents-cities' );\n__( 'GMT+10', 'continents-cities' );\n__( 'GMT+11', 'continents-cities' );\n__( 'GMT+12', 'continents-cities' );\n__( 'GMT+2', 'continents-cities' );\n__( 'GMT+3', 'continents-cities' );\n__( 'GMT+4', 'continents-cities' );\n__( 'GMT+5', 'continents-cities' );\n__( 'GMT+6', 'continents-cities' );\n__( 'GMT+7', 'continents-cities' );\n__( 'GMT+8', 'continents-cities' );\n__( 'GMT+9', 'continents-cities' );\n__( 'GMT-0', 'continents-cities' );\n__( 'GMT-1', 'continents-cities' );\n__( 'GMT-10', 'continents-cities' );\n__( 'GMT-11', 'continents-cities' );\n__( 'GMT-12', 'continents-cities' );\n__( 'GMT-13', 'continents-cities' );\n__( 'GMT-14', 'continents-cities' );\n__( 'GMT-2', 'continents-cities' );\n__( 'GMT-3', 'continents-cities' );\n__( 'GMT-4', 'continents-cities' );\n__( 'GMT-5', 'continents-cities' );\n__( 'GMT-6', 'continents-cities' );\n__( 'GMT-7', 'continents-cities' );\n__( 'GMT-8', 'continents-cities' );\n__( 'GMT-9', 'continents-cities' );\n__( 'GMT0', 'continents-cities' );\n__( 'Greenwich', 'continents-cities' );\n__( 'UCT', 'continents-cities' );\n__( 'UTC', 'continents-cities' );\n__( 'Universal', 'continents-cities' );\n__( 'Zulu', 'continents-cities' );\n\n__( 'Europe', 'continents-cities' );\n__( 'Amsterdam', 'continents-cities' );\n__( 'Andorra', 'continents-cities' );\n__( 'Astrakhan', 'continents-cities' );\n__( 'Athens', 'continents-cities' );\n__( 'Belfast', 'continents-cities' );\n__( 'Belgrade', 'continents-cities' );\n__( 'Berlin', 'continents-cities' );\n__( 'Bratislava', 'continents-cities' );\n__( 'Brussels', 'continents-cities' );\n__( 'Bucharest', 'continents-cities' );\n__( 'Budapest', 'continents-cities' );\n__( 'Busingen', 'continents-cities' );\n__( 'Chisinau', 'continents-cities' );\n__( 'Copenhagen', 'continents-cities' );\n__( 'Dublin', 'continents-cities' );\n__( 'Gibraltar', 'continents-cities' );\n__( 'Guernsey', 'continents-cities' );\n__( 'Helsinki', 'continents-cities' );\n__( 'Isle of Man', 'continents-cities' );\n__( 'Istanbul', 'continents-cities' );\n__( 'Jersey', 'continents-cities' );\n__( 'Kaliningrad', 'continents-cities' );\n__( 'Kiev', 'continents-cities' );\n__( 'Kirov', 'continents-cities' );\n__( 'Lisbon', 'continents-cities' );\n__( 'Ljubljana', 'continents-cities' );\n__( 'London', 'continents-cities' );\n__( 'Luxembourg', 'continents-cities' );\n__( 'Madrid', 'continents-cities' );\n__( 'Malta', 'continents-cities' );\n__( 'Mariehamn', 'continents-cities' );\n__( 'Minsk', 'continents-cities' );\n__( 'Monaco', 'continents-cities' );\n__( 'Moscow', 'continents-cities' );\n__( 'Nicosia', 'continents-cities' );\n__( 'Oslo', 'continents-cities' );\n__( 'Paris', 'continents-cities' );\n__( 'Podgorica', 'continents-cities' );\n__( 'Prague', 'continents-cities' );\n__( 'Riga', 'continents-cities' );\n__( 'Rome', 'continents-cities' );\n__( 'Samara', 'continents-cities' );\n__( 'San Marino', 'continents-cities' );\n__( 'Sarajevo', 'continents-cities' );\n__( 'Saratov', 'continents-cities' );\n__( 'Simferopol', 'continents-cities' );\n__( 'Skopje', 'continents-cities' );\n__( 'Sofia', 'continents-cities' );\n__( 'Stockholm', 'continents-cities' );\n__( 'Tallinn', 'continents-cities' );\n__( 'Tirane', 'continents-cities' );\n__( 'Tiraspol', 'continents-cities' );\n__( 'Ulyanovsk', 'continents-cities' );\n__( 'Uzhgorod', 'continents-cities' );\n__( 'Vaduz', 'continents-cities' );\n__( 'Vatican', 'continents-cities' );\n__( 'Vienna', 'continents-cities' );\n__( 'Vilnius', 'continents-cities' );\n__( 'Volgograd', 'continents-cities' );\n__( 'Warsaw', 'continents-cities' );\n__( 'Zagreb', 'continents-cities' );\n__( 'Zaporozhye', 'continents-cities' );\n__( 'Zurich', 'continents-cities' );\n\n__( 'Indian', 'continents-cities' );\n__( 'Antananarivo', 'continents-cities' );\n__( 'Chagos', 'continents-cities' );\n__( 'Christmas', 'continents-cities' );\n__( 'Cocos', 'continents-cities' );\n__( 'Comoro', 'continents-cities' );\n__( 'Kerguelen', 'continents-cities' );\n__( 'Mahe', 'continents-cities' );\n__( 'Maldives', 'continents-cities' );\n__( 'Mauritius', 'continents-cities' );\n__( 'Mayotte', 'continents-cities' );\n__( 'Reunion', 'continents-cities' );\n\n__( 'Pacific', 'continents-cities' );\n__( 'Apia', 'continents-cities' );\n__( 'Auckland', 'continents-cities' );\n__( 'Bougainville', 'continents-cities' );\n__( 'Chatham', 'continents-cities' );\n__( 'Chuuk', 'continents-cities' );\n__( 'Easter', 'continents-cities' );\n__( 'Efate', 'continents-cities' );\n__( 'Enderbury', 'continents-cities' );\n__( 'Fakaofo', 'continents-cities' );\n__( 'Fiji', 'continents-cities' );\n__( 'Funafuti', 'continents-cities' );\n__( 'Galapagos', 'continents-cities' );\n__( 'Gambier', 'continents-cities' );\n__( 'Guadalcanal', 'continents-cities' );\n__( 'Guam', 'continents-cities' );\n__( 'Honolulu', 'continents-cities' );\n__( 'Johnston', 'continents-cities' );\n__( 'Kiritimati', 'continents-cities' );\n__( 'Kosrae', 'continents-cities' );\n__( 'Kwajalein', 'continents-cities' );\n__( 'Majuro', 'continents-cities' );\n__( 'Marquesas', 'continents-cities' );\n__( 'Midway', 'continents-cities' );\n__( 'Nauru', 'continents-cities' );\n__( 'Niue', 'continents-cities' );\n__( 'Norfolk', 'continents-cities' );\n__( 'Noumea', 'continents-cities' );\n__( 'Pago Pago', 'continents-cities' );\n__( 'Palau', 'continents-cities' );\n__( 'Pitcairn', 'continents-cities' );\n__( 'Pohnpei', 'continents-cities' );\n__( 'Ponape', 'continents-cities' );\n__( 'Port Moresby', 'continents-cities' );\n__( 'Rarotonga', 'continents-cities' );\n__( 'Saipan', 'continents-cities' );\n__( 'Samoa', 'continents-cities' );\n__( 'Tahiti', 'continents-cities' );\n__( 'Tarawa', 'continents-cities' );\n__( 'Tongatapu', 'continents-cities' );\n__( 'Truk', 'continents-cities' );\n__( 'Wake', 'continents-cities' );\n__( 'Wallis', 'continents-cities' );\n__( 'Yap', 'continents-cities' );\n", "num_lines": 555}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Credits Administration API.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.4.0\n */\n\n/**\n * Retrieve the contributor credits.\n *\n * @since 3.2.0\n *\n * @return array|false A list of all of the contributors, or false on error.\n */\nfunction wp_credits() {\n\t// Include an unmodified $wp_version.\n\trequire ABSPATH . WPINC . '/version.php';\n\n\t$locale = get_user_locale();\n\n\t$results = get_site_transient( 'wordpress_credits_' . $locale );\n\n\tif ( ! is_array( $results )\n\t\t|| false !== strpos( $wp_version, '-' )\n\t\t|| ( isset( $results['data']['version'] ) && strpos( $wp_version, $results['data']['version'] ) !== 0 )\n\t) {\n\t\t$url     = \"http://api.wordpress.org/core/credits/1.1/?version={$wp_version}&locale={$locale}\";\n\t\t$options = array( 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ) );\n\n\t\tif ( wp_http_supports( array( 'ssl' ) ) ) {\n\t\t\t$url = set_url_scheme( $url, 'https' );\n\t\t}\n\n\t\t$response = wp_remote_get( $url, $options );\n\n\t\tif ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$results = json_decode( wp_remote_retrieve_body( $response ), true );\n\n\t\tif ( ! is_array( $results ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tset_site_transient( 'wordpress_credits_' . $locale, $results, DAY_IN_SECONDS );\n\t}\n\n\treturn $results;\n}\n\n/**\n * Retrieve the link to a contributor's WordPress.org profile page.\n *\n * @access private\n * @since 3.2.0\n *\n * @param string $display_name  The contributor's display name (passed by reference).\n * @param string $username      The contributor's username.\n * @param string $profiles      URL to the contributor's WordPress.org profile page.\n */\nfunction _wp_credits_add_profile_link( &$display_name, $username, $profiles ) {\n\t$display_name = '<a href=\"' . esc_url( sprintf( $profiles, $username ) ) . '\">' . esc_html( $display_name ) . '</a>';\n}\n\n/**\n * Retrieve the link to an external library used in WordPress.\n *\n * @access private\n * @since 3.2.0\n *\n * @param string $data External library data (passed by reference).\n */\nfunction _wp_credits_build_object_link( &$data ) {\n\t$data = '<a href=\"' . esc_url( $data[1] ) . '\">' . esc_html( $data[0] ) . '</a>';\n}\n\n/**\n * Displays the title for a given group of contributors.\n *\n * @since 5.3.0\n *\n * @param array $group_data The current contributor group.\n */\nfunction wp_credits_section_title( $group_data = array() ) {\n\tif ( ! count( $group_data ) ) {\n\t\treturn;\n\t}\n\n\tif ( $group_data['name'] ) {\n\t\tif ( 'Translators' === $group_data['name'] ) {\n\t\t\t// Considered a special slug in the API response. (Also, will never be returned for en_US.)\n\t\t\t$title = _x( 'Translators', 'Translate this to be the equivalent of English Translators in your language for the credits page Translators section' );\n\t\t} elseif ( isset( $group_data['placeholders'] ) ) {\n\t\t\t// phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText\n\t\t\t$title = vsprintf( translate( $group_data['name'] ), $group_data['placeholders'] );\n\t\t} else {\n\t\t\t// phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText\n\t\t\t$title = translate( $group_data['name'] );\n\t\t}\n\n\t\techo '<h2 class=\"wp-people-group-title\">' . esc_html( $title ) . \"</h2>\\n\";\n\t}\n}\n\n/**\n * Displays a list of contributors for a given group.\n *\n * @since 5.3.0\n *\n * @param array  $credits The credits groups returned from the API.\n * @param string $slug    The current group to display.\n */\nfunction wp_credits_section_list( $credits = array(), $slug = '' ) {\n\t$group_data   = isset( $credits['groups'][ $slug ] ) ? $credits['groups'][ $slug ] : array();\n\t$credits_data = $credits['data'];\n\tif ( ! count( $group_data ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! empty( $group_data['shuffle'] ) ) {\n\t\tshuffle( $group_data['data'] ); // We were going to sort by ability to pronounce \"hierarchical,\" but that wouldn't be fair to Matt.\n\t}\n\n\tswitch ( $group_data['type'] ) {\n\t\tcase 'list':\n\t\t\tarray_walk( $group_data['data'], '_wp_credits_add_profile_link', $credits_data['profiles'] );\n\t\t\techo '<p class=\"wp-credits-list\">' . wp_sprintf( '%l.', $group_data['data'] ) . \"</p>\\n\\n\";\n\t\t\tbreak;\n\t\tcase 'libraries':\n\t\t\tarray_walk( $group_data['data'], '_wp_credits_build_object_link' );\n\t\t\techo '<p class=\"wp-credits-list\">' . wp_sprintf( '%l.', $group_data['data'] ) . \"</p>\\n\\n\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$compact = 'compact' === $group_data['type'];\n\t\t\t$classes = 'wp-people-group ' . ( $compact ? 'compact' : '' );\n\t\t\techo '<ul class=\"' . $classes . '\" id=\"wp-people-group-' . $slug . '\">' . \"\\n\";\n\t\t\tforeach ( $group_data['data'] as $person_data ) {\n\t\t\t\techo '<li class=\"wp-person\" id=\"wp-person-' . esc_attr( $person_data[2] ) . '\">' . \"\\n\\t\";\n\t\t\t\techo '<a href=\"' . esc_url( sprintf( $credits_data['profiles'], $person_data[2] ) ) . '\" class=\"web\">';\n\t\t\t\t$size   = $compact ? 40 : 80;\n\t\t\t\t$data   = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );\n\t\t\t\t$data2x = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size * 2 ) );\n\t\t\t\techo '<img src=\"' . esc_url( $data['url'] ) . '\" srcset=\"' . esc_url( $data2x['url'] ) . ' 2x\" class=\"gravatar\" alt=\"\" />' . \"\\n\";\n\t\t\t\techo esc_html( $person_data[0] ) . \"</a>\\n\\t\";\n\t\t\t\tif ( ! $compact ) {\n\t\t\t\t\t// phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText\n\t\t\t\t\techo '<span class=\"title\">' . translate( $person_data[3] ) . \"</span>\\n\";\n\t\t\t\t}\n\t\t\t\techo \"</li>\\n\";\n\t\t\t}\n\t\t\techo \"</ul>\\n\";\n\t\t\tbreak;\n\t}\n}\n", "num_lines": 158}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Dashboard Widget Administration Screen API\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Registers dashboard widgets.\n *\n * Handles POST data, sets up filters.\n *\n * @since 2.5.0\n *\n * @global array $wp_registered_widgets\n * @global array $wp_registered_widget_controls\n * @global array $wp_dashboard_control_callbacks\n */\nfunction wp_dashboard_setup() {\n\tglobal $wp_registered_widgets, $wp_registered_widget_controls, $wp_dashboard_control_callbacks;\n\t$wp_dashboard_control_callbacks = array();\n\t$screen                         = get_current_screen();\n\n\t/* Register Widgets and Controls */\n\n\t$response = wp_check_browser_version();\n\n\tif ( $response && $response['upgrade'] ) {\n\t\tadd_filter( 'postbox_classes_dashboard_dashboard_browser_nag', 'dashboard_browser_nag_class' );\n\t\tif ( $response['insecure'] ) {\n\t\t\twp_add_dashboard_widget( 'dashboard_browser_nag', __( 'You are using an insecure browser!' ), 'wp_dashboard_browser_nag' );\n\t\t} else {\n\t\t\twp_add_dashboard_widget( 'dashboard_browser_nag', __( 'Your browser is out of date!' ), 'wp_dashboard_browser_nag' );\n\t\t}\n\t}\n\n\t// PHP Version.\n\t$response = wp_check_php_version();\n\tif ( $response && isset( $response['is_acceptable'] ) && ! $response['is_acceptable'] && current_user_can( 'update_php' ) ) {\n\t\tadd_filter( 'postbox_classes_dashboard_dashboard_php_nag', 'dashboard_php_nag_class' );\n\t\twp_add_dashboard_widget( 'dashboard_php_nag', __( 'PHP Update Required' ), 'wp_dashboard_php_nag' );\n\t}\n\n\t// Site Health.\n\tif ( current_user_can( 'view_site_health_checks' ) && ! is_network_admin() ) {\n\t\tif ( ! class_exists( 'WP_Site_Health' ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';\n\t\t}\n\n\t\tWP_Site_Health::get_instance();\n\n\t\twp_enqueue_style( 'site-health' );\n\t\twp_enqueue_script( 'site-health' );\n\n\t\twp_add_dashboard_widget( 'dashboard_site_health', __( 'Site Health Status' ), 'wp_dashboard_site_health' );\n\t}\n\n\t// Right Now.\n\tif ( is_blog_admin() && current_user_can( 'edit_posts' ) ) {\n\t\twp_add_dashboard_widget( 'dashboard_right_now', __( 'At a Glance' ), 'wp_dashboard_right_now' );\n\t}\n\n\tif ( is_network_admin() ) {\n\t\twp_add_dashboard_widget( 'network_dashboard_right_now', __( 'Right Now' ), 'wp_network_dashboard_right_now' );\n\t}\n\n\t// Activity Widget.\n\tif ( is_blog_admin() ) {\n\t\twp_add_dashboard_widget( 'dashboard_activity', __( 'Activity' ), 'wp_dashboard_site_activity' );\n\t}\n\n\t// QuickPress Widget.\n\tif ( is_blog_admin() && current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {\n\t\t$quick_draft_title = sprintf( '<span class=\"hide-if-no-js\">%1$s</span> <span class=\"hide-if-js\">%2$s</span>', __( 'Quick Draft' ), __( 'Your Recent Drafts' ) );\n\t\twp_add_dashboard_widget( 'dashboard_quick_press', $quick_draft_title, 'wp_dashboard_quick_press' );\n\t}\n\n\t// WordPress Events and News.\n\twp_add_dashboard_widget( 'dashboard_primary', __( 'WordPress Events and News' ), 'wp_dashboard_events_news' );\n\n\tif ( is_network_admin() ) {\n\n\t\t/**\n\t\t * Fires after core widgets for the Network Admin dashboard have been registered.\n\t\t *\n\t\t * @since 3.1.0\n\t\t */\n\t\tdo_action( 'wp_network_dashboard_setup' );\n\n\t\t/**\n\t\t * Filters the list of widgets to load for the Network Admin dashboard.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string[] $dashboard_widgets An array of dashboard widget IDs.\n\t\t */\n\t\t$dashboard_widgets = apply_filters( 'wp_network_dashboard_widgets', array() );\n\t} elseif ( is_user_admin() ) {\n\n\t\t/**\n\t\t * Fires after core widgets for the User Admin dashboard have been registered.\n\t\t *\n\t\t * @since 3.1.0\n\t\t */\n\t\tdo_action( 'wp_user_dashboard_setup' );\n\n\t\t/**\n\t\t * Filters the list of widgets to load for the User Admin dashboard.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string[] $dashboard_widgets An array of dashboard widget IDs.\n\t\t */\n\t\t$dashboard_widgets = apply_filters( 'wp_user_dashboard_widgets', array() );\n\t} else {\n\n\t\t/**\n\t\t * Fires after core widgets for the admin dashboard have been registered.\n\t\t *\n\t\t * @since 2.5.0\n\t\t */\n\t\tdo_action( 'wp_dashboard_setup' );\n\n\t\t/**\n\t\t * Filters the list of widgets to load for the admin dashboard.\n\t\t *\n\t\t * @since 2.5.0\n\t\t *\n\t\t * @param string[] $dashboard_widgets An array of dashboard widget IDs.\n\t\t */\n\t\t$dashboard_widgets = apply_filters( 'wp_dashboard_widgets', array() );\n\t}\n\n\tforeach ( $dashboard_widgets as $widget_id ) {\n\t\t$name = empty( $wp_registered_widgets[ $widget_id ]['all_link'] ) ? $wp_registered_widgets[ $widget_id ]['name'] : $wp_registered_widgets[ $widget_id ]['name'] . \" <a href='{$wp_registered_widgets[$widget_id]['all_link']}' class='edit-box open-box'>\" . __( 'View all' ) . '</a>';\n\t\twp_add_dashboard_widget( $widget_id, $name, $wp_registered_widgets[ $widget_id ]['callback'], $wp_registered_widget_controls[ $widget_id ]['callback'] );\n\t}\n\n\tif ( 'POST' === $_SERVER['REQUEST_METHOD'] && isset( $_POST['widget_id'] ) ) {\n\t\tcheck_admin_referer( 'edit-dashboard-widget_' . $_POST['widget_id'], 'dashboard-widget-nonce' );\n\t\tob_start(); // Hack - but the same hack wp-admin/widgets.php uses.\n\t\twp_dashboard_trigger_widget_control( $_POST['widget_id'] );\n\t\tob_end_clean();\n\t\twp_redirect( remove_query_arg( 'edit' ) );\n\t\texit;\n\t}\n\n\t/** This action is documented in wp-admin/includes/meta-boxes.php */\n\tdo_action( 'do_meta_boxes', $screen->id, 'normal', '' );\n\n\t/** This action is documented in wp-admin/includes/meta-boxes.php */\n\tdo_action( 'do_meta_boxes', $screen->id, 'side', '' );\n}\n\n/**\n * Adds a new dashboard widget.\n *\n * @since 2.7.0\n *\n * @global array $wp_dashboard_control_callbacks\n *\n * @param string   $widget_id        Widget ID  (used in the 'id' attribute for the widget).\n * @param string   $widget_name      Title of the widget.\n * @param callable $callback         Function that fills the widget with the desired content.\n *                                   The function should echo its output.\n * @param callable $control_callback Optional. Function that outputs controls for the widget. Default null.\n * @param array    $callback_args    Optional. Data that should be set as the $args property of the widget array\n *                                   (which is the second parameter passed to your callback). Default null.\n */\nfunction wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null, $callback_args = null ) {\n\t$screen = get_current_screen();\n\tglobal $wp_dashboard_control_callbacks;\n\n\t$private_callback_args = array( '__widget_basename' => $widget_name );\n\n\tif ( is_null( $callback_args ) ) {\n\t\t$callback_args = $private_callback_args;\n\t} elseif ( is_array( $callback_args ) ) {\n\t\t$callback_args = array_merge( $callback_args, $private_callback_args );\n\t}\n\n\tif ( $control_callback && current_user_can( 'edit_dashboard' ) && is_callable( $control_callback ) ) {\n\t\t$wp_dashboard_control_callbacks[ $widget_id ] = $control_callback;\n\t\tif ( isset( $_GET['edit'] ) && $widget_id == $_GET['edit'] ) {\n\t\t\tlist($url)    = explode( '#', add_query_arg( 'edit', false ), 2 );\n\t\t\t$widget_name .= ' <span class=\"postbox-title-action\"><a href=\"' . esc_url( $url ) . '\">' . __( 'Cancel' ) . '</a></span>';\n\t\t\t$callback     = '_wp_dashboard_control_callback';\n\t\t} else {\n\t\t\tlist($url)    = explode( '#', add_query_arg( 'edit', $widget_id ), 2 );\n\t\t\t$widget_name .= ' <span class=\"postbox-title-action\"><a href=\"' . esc_url( \"$url#$widget_id\" ) . '\" class=\"edit-box open-box\">' . __( 'Configure' ) . '</a></span>';\n\t\t}\n\t}\n\n\t$side_widgets = array( 'dashboard_quick_press', 'dashboard_primary' );\n\n\t$location = 'normal';\n\tif ( in_array( $widget_id, $side_widgets, true ) ) {\n\t\t$location = 'side';\n\t}\n\n\t$high_priority_widgets = array( 'dashboard_browser_nag', 'dashboard_php_nag' );\n\n\t$priority = 'core';\n\tif ( in_array( $widget_id, $high_priority_widgets, true ) ) {\n\t\t$priority = 'high';\n\t}\n\n\tadd_meta_box( $widget_id, $widget_name, $callback, $screen, $location, $priority, $callback_args );\n}\n\n/**\n * Outputs controls for the current dashboard widget.\n *\n * @access private\n * @since 2.7.0\n *\n * @param mixed $dashboard\n * @param array $meta_box\n */\nfunction _wp_dashboard_control_callback( $dashboard, $meta_box ) {\n\techo '<form method=\"post\" class=\"dashboard-widget-control-form wp-clearfix\">';\n\twp_dashboard_trigger_widget_control( $meta_box['id'] );\n\twp_nonce_field( 'edit-dashboard-widget_' . $meta_box['id'], 'dashboard-widget-nonce' );\n\techo '<input type=\"hidden\" name=\"widget_id\" value=\"' . esc_attr( $meta_box['id'] ) . '\" />';\n\tsubmit_button( __( 'Submit' ) );\n\techo '</form>';\n}\n\n/**\n * Displays the dashboard.\n *\n * @since 2.5.0\n */\nfunction wp_dashboard() {\n\t$screen      = get_current_screen();\n\t$columns     = absint( $screen->get_columns() );\n\t$columns_css = '';\n\tif ( $columns ) {\n\t\t$columns_css = \" columns-$columns\";\n\t}\n\n\t?>\n<div id=\"dashboard-widgets\" class=\"metabox-holder<?php echo $columns_css; ?>\">\n\t<div id=\"postbox-container-1\" class=\"postbox-container\">\n\t<?php do_meta_boxes( $screen->id, 'normal', '' ); ?>\n\t</div>\n\t<div id=\"postbox-container-2\" class=\"postbox-container\">\n\t<?php do_meta_boxes( $screen->id, 'side', '' ); ?>\n\t</div>\n\t<div id=\"postbox-container-3\" class=\"postbox-container\">\n\t<?php do_meta_boxes( $screen->id, 'column3', '' ); ?>\n\t</div>\n\t<div id=\"postbox-container-4\" class=\"postbox-container\">\n\t<?php do_meta_boxes( $screen->id, 'column4', '' ); ?>\n\t</div>\n</div>\n\n\t<?php\n\twp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );\n\twp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );\n\n}\n\n//\n// Dashboard Widgets.\n//\n\n/**\n * Dashboard widget that displays some basic stats about the site.\n *\n * Formerly 'Right Now'. A streamlined 'At a Glance' as of 3.8.\n *\n * @since 2.7.0\n */\nfunction wp_dashboard_right_now() {\n\t?>\n\t<div class=\"main\">\n\t<ul>\n\t<?php\n\t// Posts and Pages.\n\tforeach ( array( 'post', 'page' ) as $post_type ) {\n\t\t$num_posts = wp_count_posts( $post_type );\n\t\tif ( $num_posts && $num_posts->publish ) {\n\t\t\tif ( 'post' === $post_type ) {\n\t\t\t\t/* translators: %s: Number of posts. */\n\t\t\t\t$text = _n( '%s Post', '%s Posts', $num_posts->publish );\n\t\t\t} else {\n\t\t\t\t/* translators: %s: Number of pages. */\n\t\t\t\t$text = _n( '%s Page', '%s Pages', $num_posts->publish );\n\t\t\t}\n\t\t\t$text             = sprintf( $text, number_format_i18n( $num_posts->publish ) );\n\t\t\t$post_type_object = get_post_type_object( $post_type );\n\t\t\tif ( $post_type_object && current_user_can( $post_type_object->cap->edit_posts ) ) {\n\t\t\t\tprintf( '<li class=\"%1$s-count\"><a href=\"edit.php?post_type=%1$s\">%2$s</a></li>', $post_type, $text );\n\t\t\t} else {\n\t\t\t\tprintf( '<li class=\"%1$s-count\"><span>%2$s</span></li>', $post_type, $text );\n\t\t\t}\n\t\t}\n\t}\n\t// Comments.\n\t$num_comm = wp_count_comments();\n\tif ( $num_comm && ( $num_comm->approved || $num_comm->moderated ) ) {\n\t\t/* translators: %s: Number of comments. */\n\t\t$text = sprintf( _n( '%s Comment', '%s Comments', $num_comm->approved ), number_format_i18n( $num_comm->approved ) );\n\t\t?>\n\t\t<li class=\"comment-count\"><a href=\"edit-comments.php\"><?php echo $text; ?></a></li>\n\t\t<?php\n\t\t$moderated_comments_count_i18n = number_format_i18n( $num_comm->moderated );\n\t\t/* translators: %s: Number of comments. */\n\t\t$text = sprintf( _n( '%s Comment in moderation', '%s Comments in moderation', $num_comm->moderated ), $moderated_comments_count_i18n );\n\t\t?>\n\t\t<li class=\"comment-mod-count\n\t\t<?php\n\t\tif ( ! $num_comm->moderated ) {\n\t\t\techo ' hidden';\n\t\t}\n\t\t?>\n\t\t\"><a href=\"edit-comments.php?comment_status=moderated\" class=\"comments-in-moderation-text\"><?php echo $text; ?></a></li>\n\t\t<?php\n\t}\n\n\t/**\n\t * Filters the array of extra elements to list in the 'At a Glance'\n\t * dashboard widget.\n\t *\n\t * Prior to 3.8.0, the widget was named 'Right Now'. Each element\n\t * is wrapped in list-item tags on output.\n\t *\n\t * @since 3.8.0\n\t *\n\t * @param string[] $items Array of extra 'At a Glance' widget items.\n\t */\n\t$elements = apply_filters( 'dashboard_glance_items', array() );\n\n\tif ( $elements ) {\n\t\techo '<li>' . implode( \"</li>\\n<li>\", $elements ) . \"</li>\\n\";\n\t}\n\n\t?>\n\t</ul>\n\t<?php\n\tupdate_right_now_message();\n\n\t// Check if search engines are asked not to index this site.\n\tif ( ! is_network_admin() && ! is_user_admin() && current_user_can( 'manage_options' ) && '0' == get_option( 'blog_public' ) ) {\n\n\t\t/**\n\t\t * Filters the link title attribute for the 'Search engines discouraged'\n\t\t * message displayed in the 'At a Glance' dashboard widget.\n\t\t *\n\t\t * Prior to 3.8.0, the widget was named 'Right Now'.\n\t\t *\n\t\t * @since 3.0.0\n\t\t * @since 4.5.0 The default for `$title` was updated to an empty string.\n\t\t *\n\t\t * @param string $title Default attribute text.\n\t\t */\n\t\t$title = apply_filters( 'privacy_on_link_title', '' );\n\n\t\t/**\n\t\t * Filters the link label for the 'Search engines discouraged' message\n\t\t * displayed in the 'At a Glance' dashboard widget.\n\t\t *\n\t\t * Prior to 3.8.0, the widget was named 'Right Now'.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string $content Default text.\n\t\t */\n\t\t$content    = apply_filters( 'privacy_on_link_text', __( 'Search engines discouraged' ) );\n\t\t$title_attr = '' === $title ? '' : \" title='$title'\";\n\n\t\techo \"<p class='search-engines-info'><a href='options-reading.php'$title_attr>$content</a></p>\";\n\t}\n\t?>\n\t</div>\n\t<?php\n\t/*\n\t * activity_box_end has a core action, but only prints content when multisite.\n\t * Using an output buffer is the only way to really check if anything's displayed here.\n\t */\n\tob_start();\n\n\t/**\n\t * Fires at the end of the 'At a Glance' dashboard widget.\n\t *\n\t * Prior to 3.8.0, the widget was named 'Right Now'.\n\t *\n\t * @since 2.5.0\n\t */\n\tdo_action( 'rightnow_end' );\n\n\t/**\n\t * Fires at the end of the 'At a Glance' dashboard widget.\n\t *\n\t * Prior to 3.8.0, the widget was named 'Right Now'.\n\t *\n\t * @since 2.0.0\n\t */\n\tdo_action( 'activity_box_end' );\n\n\t$actions = ob_get_clean();\n\n\tif ( ! empty( $actions ) ) :\n\t\t?>\n\t<div class=\"sub\">\n\t\t<?php echo $actions; ?>\n\t</div>\n\t\t<?php\n\tendif;\n}\n\n/**\n * @since 3.1.0\n */\nfunction wp_network_dashboard_right_now() {\n\t$actions = array();\n\tif ( current_user_can( 'create_sites' ) ) {\n\t\t$actions['create-site'] = '<a href=\"' . network_admin_url( 'site-new.php' ) . '\">' . __( 'Create a New Site' ) . '</a>';\n\t}\n\tif ( current_user_can( 'create_users' ) ) {\n\t\t$actions['create-user'] = '<a href=\"' . network_admin_url( 'user-new.php' ) . '\">' . __( 'Create a New User' ) . '</a>';\n\t}\n\n\t$c_users = get_user_count();\n\t$c_blogs = get_blog_count();\n\n\t/* translators: %s: Number of users on the network. */\n\t$user_text = sprintf( _n( '%s user', '%s users', $c_users ), number_format_i18n( $c_users ) );\n\t/* translators: %s: Number of sites on the network. */\n\t$blog_text = sprintf( _n( '%s site', '%s sites', $c_blogs ), number_format_i18n( $c_blogs ) );\n\n\t/* translators: 1: Text indicating the number of sites on the network, 2: Text indicating the number of users on the network. */\n\t$sentence = sprintf( __( 'You have %1$s and %2$s.' ), $blog_text, $user_text );\n\n\tif ( $actions ) {\n\t\techo '<ul class=\"subsubsub\">';\n\t\tforeach ( $actions as $class => $action ) {\n\t\t\t$actions[ $class ] = \"\\t<li class='$class'>$action\";\n\t\t}\n\t\techo implode( \" |</li>\\n\", $actions ) . \"</li>\\n\";\n\t\techo '</ul>';\n\t}\n\t?>\n\t<br class=\"clear\" />\n\n\t<p class=\"youhave\"><?php echo $sentence; ?></p>\n\n\n\t<?php\n\t\t/**\n\t\t * Fires in the Network Admin 'Right Now' dashboard widget\n\t\t * just before the user and site search form fields.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t */\n\t\tdo_action( 'wpmuadminresult' );\n\t?>\n\n\t<form action=\"<?php echo network_admin_url( 'users.php' ); ?>\" method=\"get\">\n\t\t<p>\n\t\t\t<label class=\"screen-reader-text\" for=\"search-users\"><?php _e( 'Search Users' ); ?></label>\n\t\t\t<input type=\"search\" name=\"s\" value=\"\" size=\"30\" autocomplete=\"off\" id=\"search-users\"/>\n\t\t\t<?php submit_button( __( 'Search Users' ), '', false, false, array( 'id' => 'submit_users' ) ); ?>\n\t\t</p>\n\t</form>\n\n\t<form action=\"<?php echo network_admin_url( 'sites.php' ); ?>\" method=\"get\">\n\t\t<p>\n\t\t\t<label class=\"screen-reader-text\" for=\"search-sites\"><?php _e( 'Search Sites' ); ?></label>\n\t\t\t<input type=\"search\" name=\"s\" value=\"\" size=\"30\" autocomplete=\"off\" id=\"search-sites\"/>\n\t\t\t<?php submit_button( __( 'Search Sites' ), '', false, false, array( 'id' => 'submit_sites' ) ); ?>\n\t\t</p>\n\t</form>\n\t<?php\n\t/**\n\t * Fires at the end of the 'Right Now' widget in the Network Admin dashboard.\n\t *\n\t * @since MU (3.0.0)\n\t */\n\tdo_action( 'mu_rightnow_end' );\n\n\t/**\n\t * Fires at the end of the 'Right Now' widget in the Network Admin dashboard.\n\t *\n\t * @since MU (3.0.0)\n\t */\n\tdo_action( 'mu_activity_box_end' );\n}\n\n/**\n * The Quick Draft widget display and creation of drafts.\n *\n * @since 3.8.0\n *\n * @global int $post_ID\n *\n * @param string $error_msg Optional. Error message. Default false.\n */\nfunction wp_dashboard_quick_press( $error_msg = false ) {\n\tglobal $post_ID;\n\n\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\treturn;\n\t}\n\n\t/* Check if a new auto-draft (= no new post_ID) is needed or if the old can be used */\n\t$last_post_id = (int) get_user_option( 'dashboard_quick_press_last_post_id' ); // Get the last post_ID.\n\tif ( $last_post_id ) {\n\t\t$post = get_post( $last_post_id );\n\t\tif ( empty( $post ) || 'auto-draft' !== $post->post_status ) { // auto-draft doesn't exist anymore.\n\t\t\t$post = get_default_post_to_edit( 'post', true );\n\t\t\tupdate_user_option( get_current_user_id(), 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID.\n\t\t} else {\n\t\t\t$post->post_title = ''; // Remove the auto draft title.\n\t\t}\n\t} else {\n\t\t$post    = get_default_post_to_edit( 'post', true );\n\t\t$user_id = get_current_user_id();\n\t\t// Don't create an option if this is a super admin who does not belong to this site.\n\t\tif ( in_array( get_current_blog_id(), array_keys( get_blogs_of_user( $user_id ) ), true ) ) {\n\t\t\tupdate_user_option( $user_id, 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID.\n\t\t}\n\t}\n\n\t$post_ID = (int) $post->ID;\n\t?>\n\n\t<form name=\"post\" action=\"<?php echo esc_url( admin_url( 'post.php' ) ); ?>\" method=\"post\" id=\"quick-press\" class=\"initial-form hide-if-no-js\">\n\n\t\t<?php if ( $error_msg ) : ?>\n\t\t<div class=\"error\"><?php echo $error_msg; ?></div>\n\t\t<?php endif; ?>\n\n\t\t<div class=\"input-text-wrap\" id=\"title-wrap\">\n\t\t\t<label for=\"title\">\n\t\t\t\t<?php\n\t\t\t\t/** This filter is documented in wp-admin/edit-form-advanced.php */\n\t\t\t\techo apply_filters( 'enter_title_here', __( 'Title' ), $post );\n\t\t\t\t?>\n\t\t\t</label>\n\t\t\t<input type=\"text\" name=\"post_title\" id=\"title\" autocomplete=\"off\" />\n\t\t</div>\n\n\t\t<div class=\"textarea-wrap\" id=\"description-wrap\">\n\t\t\t<label for=\"content\"><?php _e( 'Content' ); ?></label>\n\t\t\t<textarea name=\"content\" id=\"content\" placeholder=\"<?php esc_attr_e( 'What&#8217;s on your mind?' ); ?>\" class=\"mceEditor\" rows=\"3\" cols=\"15\" autocomplete=\"off\"></textarea>\n\t\t</div>\n\n\t\t<p class=\"submit\">\n\t\t\t<input type=\"hidden\" name=\"action\" id=\"quickpost-action\" value=\"post-quickdraft-save\" />\n\t\t\t<input type=\"hidden\" name=\"post_ID\" value=\"<?php echo $post_ID; ?>\" />\n\t\t\t<input type=\"hidden\" name=\"post_type\" value=\"post\" />\n\t\t\t<?php wp_nonce_field( 'add-post' ); ?>\n\t\t\t<?php submit_button( __( 'Save Draft' ), 'primary', 'save', false, array( 'id' => 'save-post' ) ); ?>\n\t\t\t<br class=\"clear\" />\n\t\t</p>\n\n\t</form>\n\t<?php\n\twp_dashboard_recent_drafts();\n}\n\n/**\n * Show recent drafts of the user on the dashboard.\n *\n * @since 2.7.0\n *\n * @param WP_Post[] $drafts Optional. Array of posts to display. Default false.\n */\nfunction wp_dashboard_recent_drafts( $drafts = false ) {\n\tif ( ! $drafts ) {\n\t\t$query_args = array(\n\t\t\t'post_type'      => 'post',\n\t\t\t'post_status'    => 'draft',\n\t\t\t'author'         => get_current_user_id(),\n\t\t\t'posts_per_page' => 4,\n\t\t\t'orderby'        => 'modified',\n\t\t\t'order'          => 'DESC',\n\t\t);\n\n\t\t/**\n\t\t * Filters the post query arguments for the 'Recent Drafts' dashboard widget.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param array $query_args The query arguments for the 'Recent Drafts' dashboard widget.\n\t\t */\n\t\t$query_args = apply_filters( 'dashboard_recent_drafts_query_args', $query_args );\n\n\t\t$drafts = get_posts( $query_args );\n\t\tif ( ! $drafts ) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\techo '<div class=\"drafts\">';\n\tif ( count( $drafts ) > 3 ) {\n\t\tprintf(\n\t\t\t'<p class=\"view-all\"><a href=\"%s\">%s</a></p>' . \"\\n\",\n\t\t\tesc_url( admin_url( 'edit.php?post_status=draft' ) ),\n\t\t\t__( 'View all drafts' )\n\t\t);\n\t}\n\techo '<h2 class=\"hide-if-no-js\">' . __( 'Your Recent Drafts' ) . \"</h2>\\n<ul>\";\n\n\t/* translators: Maximum number of words used in a preview of a draft on the dashboard. */\n\t$draft_length = intval( _x( '10', 'draft_length' ) );\n\n\t$drafts = array_slice( $drafts, 0, 3 );\n\tforeach ( $drafts as $draft ) {\n\t\t$url   = get_edit_post_link( $draft->ID );\n\t\t$title = _draft_or_post_title( $draft->ID );\n\t\techo \"<li>\\n\";\n\t\tprintf(\n\t\t\t'<div class=\"draft-title\"><a href=\"%s\" aria-label=\"%s\">%s</a><time datetime=\"%s\">%s</time></div>',\n\t\t\tesc_url( $url ),\n\t\t\t/* translators: %s: Post title. */\n\t\t\tesc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ),\n\t\t\tesc_html( $title ),\n\t\t\tget_the_time( 'c', $draft ),\n\t\t\tget_the_time( __( 'F j, Y' ), $draft )\n\t\t);\n\t\t$the_content = wp_trim_words( $draft->post_content, $draft_length );\n\t\tif ( $the_content ) {\n\t\t\techo '<p>' . $the_content . '</p>';\n\t\t}\n\t\techo \"</li>\\n\";\n\t}\n\techo \"</ul>\\n</div>\";\n}\n\n/**\n * Outputs a row for the Recent Comments widget.\n *\n * @access private\n * @since 2.7.0\n *\n * @global WP_Comment $comment Global comment object.\n *\n * @param WP_Comment $comment   The current comment.\n * @param bool       $show_date Optional. Whether to display the date.\n */\nfunction _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {\n\t$GLOBALS['comment'] = clone $comment;\n\n\tif ( $comment->comment_post_ID > 0 ) {\n\n\t\t$comment_post_title = _draft_or_post_title( $comment->comment_post_ID );\n\t\t$comment_post_url   = get_the_permalink( $comment->comment_post_ID );\n\t\t$comment_post_link  = \"<a href='$comment_post_url'>$comment_post_title</a>\";\n\t} else {\n\t\t$comment_post_link = '';\n\t}\n\n\t$actions_string = '';\n\tif ( current_user_can( 'edit_comment', $comment->comment_ID ) ) {\n\t\t// Pre-order it: Approve | Reply | Edit | Spam | Trash.\n\t\t$actions = array(\n\t\t\t'approve'   => '',\n\t\t\t'unapprove' => '',\n\t\t\t'reply'     => '',\n\t\t\t'edit'      => '',\n\t\t\t'spam'      => '',\n\t\t\t'trash'     => '',\n\t\t\t'delete'    => '',\n\t\t\t'view'      => '',\n\t\t);\n\n\t\t$del_nonce     = esc_html( '_wpnonce=' . wp_create_nonce( \"delete-comment_$comment->comment_ID\" ) );\n\t\t$approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( \"approve-comment_$comment->comment_ID\" ) );\n\n\t\t$approve_url   = esc_url( \"comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce\" );\n\t\t$unapprove_url = esc_url( \"comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce\" );\n\t\t$spam_url      = esc_url( \"comment.php?action=spamcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce\" );\n\t\t$trash_url     = esc_url( \"comment.php?action=trashcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce\" );\n\t\t$delete_url    = esc_url( \"comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce\" );\n\n\t\t$actions['approve'] = sprintf(\n\t\t\t'<a href=\"%s\" data-wp-lists=\"%s\" class=\"vim-a aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t$approve_url,\n\t\t\t\"dim:the-comment-list:comment-{$comment->comment_ID}:unapproved:e7e7d3:e7e7d3:new=approved\",\n\t\t\tesc_attr__( 'Approve this comment' ),\n\t\t\t__( 'Approve' )\n\t\t);\n\n\t\t$actions['unapprove'] = sprintf(\n\t\t\t'<a href=\"%s\" data-wp-lists=\"%s\" class=\"vim-u aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t$unapprove_url,\n\t\t\t\"dim:the-comment-list:comment-{$comment->comment_ID}:unapproved:e7e7d3:e7e7d3:new=unapproved\",\n\t\t\tesc_attr__( 'Unapprove this comment' ),\n\t\t\t__( 'Unapprove' )\n\t\t);\n\n\t\t$actions['edit'] = sprintf(\n\t\t\t'<a href=\"%s\" aria-label=\"%s\">%s</a>',\n\t\t\t\"comment.php?action=editcomment&amp;c={$comment->comment_ID}\",\n\t\t\tesc_attr__( 'Edit this comment' ),\n\t\t\t__( 'Edit' )\n\t\t);\n\n\t\t$actions['reply'] = sprintf(\n\t\t\t'<button type=\"button\" onclick=\"window.commentReply && commentReply.open(\\'%s\\',\\'%s\\');\" class=\"vim-r button-link hide-if-no-js\" aria-label=\"%s\">%s</button>',\n\t\t\t$comment->comment_ID,\n\t\t\t$comment->comment_post_ID,\n\t\t\tesc_attr__( 'Reply to this comment' ),\n\t\t\t__( 'Reply' )\n\t\t);\n\n\t\t$actions['spam'] = sprintf(\n\t\t\t'<a href=\"%s\" data-wp-lists=\"%s\" class=\"vim-s vim-destructive aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t$spam_url,\n\t\t\t\"delete:the-comment-list:comment-{$comment->comment_ID}::spam=1\",\n\t\t\tesc_attr__( 'Mark this comment as spam' ),\n\t\t\t/* translators: \"Mark as spam\" link. */\n\t\t\t_x( 'Spam', 'verb' )\n\t\t);\n\n\t\tif ( ! EMPTY_TRASH_DAYS ) {\n\t\t\t$actions['delete'] = sprintf(\n\t\t\t\t'<a href=\"%s\" data-wp-lists=\"%s\" class=\"delete vim-d vim-destructive aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\t$delete_url,\n\t\t\t\t\"delete:the-comment-list:comment-{$comment->comment_ID}::trash=1\",\n\t\t\t\tesc_attr__( 'Delete this comment permanently' ),\n\t\t\t\t__( 'Delete Permanently' )\n\t\t\t);\n\t\t} else {\n\t\t\t$actions['trash'] = sprintf(\n\t\t\t\t'<a href=\"%s\" data-wp-lists=\"%s\" class=\"delete vim-d vim-destructive aria-button-if-js\" aria-label=\"%s\">%s</a>',\n\t\t\t\t$trash_url,\n\t\t\t\t\"delete:the-comment-list:comment-{$comment->comment_ID}::trash=1\",\n\t\t\t\tesc_attr__( 'Move this comment to the Trash' ),\n\t\t\t\t_x( 'Trash', 'verb' )\n\t\t\t);\n\t\t}\n\n\t\t$actions['view'] = sprintf(\n\t\t\t'<a class=\"comment-link\" href=\"%s\" aria-label=\"%s\">%s</a>',\n\t\t\tesc_url( get_comment_link( $comment ) ),\n\t\t\tesc_attr__( 'View this comment' ),\n\t\t\t__( 'View' )\n\t\t);\n\n\t\t/**\n\t\t * Filters the action links displayed for each comment in the 'Recent Comments'\n\t\t * dashboard widget.\n\t\t *\n\t\t * @since 2.6.0\n\t\t *\n\t\t * @param string[]   $actions An array of comment actions. Default actions include:\n\t\t *                            'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam',\n\t\t *                            'Delete', and 'Trash'.\n\t\t * @param WP_Comment $comment The comment object.\n\t\t */\n\t\t$actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );\n\n\t\t$i = 0;\n\n\t\tforeach ( $actions as $action => $link ) {\n\t\t\t++$i;\n\n\t\t\tif ( ( ( 'approve' === $action || 'unapprove' === $action ) && 2 === $i )\n\t\t\t\t|| 1 === $i\n\t\t\t) {\n\t\t\t\t$sep = '';\n\t\t\t} else {\n\t\t\t\t$sep = ' | ';\n\t\t\t}\n\n\t\t\t// Reply and quickedit need a hide-if-no-js span.\n\t\t\tif ( 'reply' === $action || 'quickedit' === $action ) {\n\t\t\t\t$action .= ' hide-if-no-js';\n\t\t\t}\n\n\t\t\tif ( 'view' === $action && '1' !== $comment->comment_approved ) {\n\t\t\t\t$action .= ' hidden';\n\t\t\t}\n\n\t\t\t$actions_string .= \"<span class='$action'>$sep$link</span>\";\n\t\t}\n\t}\n\t?>\n\n\t\t<li id=\"comment-<?php echo $comment->comment_ID; ?>\" <?php comment_class( array( 'comment-item', wp_get_comment_status( $comment ) ), $comment ); ?>>\n\n\t\t\t<?php\n\t\t\t$comment_row_class = '';\n\n\t\t\tif ( get_option( 'show_avatars' ) ) {\n\t\t\t\techo get_avatar( $comment, 50, 'mystery' );\n\t\t\t\t$comment_row_class .= ' has-avatar';\n\t\t\t}\n\t\t\t?>\n\n\t\t\t<?php if ( ! $comment->comment_type || 'comment' === $comment->comment_type ) : ?>\n\n\t\t\t<div class=\"dashboard-comment-wrap has-row-actions <?php echo $comment_row_class; ?>\">\n\t\t\t<p class=\"comment-meta\">\n\t\t\t\t<?php\n\t\t\t\t// Comments might not have a post they relate to, e.g. programmatically created ones.\n\t\t\t\tif ( $comment_post_link ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: Comment author, 2: Post link, 3: Notification if the comment is pending. */\n\t\t\t\t\t\t__( 'From %1$s on %2$s %3$s' ),\n\t\t\t\t\t\t'<cite class=\"comment-author\">' . get_comment_author_link( $comment ) . '</cite>',\n\t\t\t\t\t\t$comment_post_link,\n\t\t\t\t\t\t'<span class=\"approve\">' . __( '[Pending]' ) . '</span>'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: Comment author, 2: Notification if the comment is pending. */\n\t\t\t\t\t\t__( 'From %1$s %2$s' ),\n\t\t\t\t\t\t'<cite class=\"comment-author\">' . get_comment_author_link( $comment ) . '</cite>',\n\t\t\t\t\t\t'<span class=\"approve\">' . __( '[Pending]' ) . '</span>'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</p>\n\n\t\t\t\t<?php\n\t\t\telse :\n\t\t\t\tswitch ( $comment->comment_type ) {\n\t\t\t\t\tcase 'pingback':\n\t\t\t\t\t\t$type = __( 'Pingback' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'trackback':\n\t\t\t\t\t\t$type = __( 'Trackback' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$type = ucwords( $comment->comment_type );\n\t\t\t\t}\n\t\t\t\t$type = esc_html( $type );\n\t\t\t\t?>\n\t\t\t<div class=\"dashboard-comment-wrap has-row-actions\">\n\t\t\t<p class=\"comment-meta\">\n\t\t\t\t<?php\n\t\t\t\t// Pingbacks, Trackbacks or custom comment types might not have a post they relate to, e.g. programmatically created ones.\n\t\t\t\tif ( $comment_post_link ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: Type of comment, 2: Post link, 3: Notification if the comment is pending. */\n\t\t\t\t\t\t_x( '%1$s on %2$s %3$s', 'dashboard' ),\n\t\t\t\t\t\t\"<strong>$type</strong>\",\n\t\t\t\t\t\t$comment_post_link,\n\t\t\t\t\t\t'<span class=\"approve\">' . __( '[Pending]' ) . '</span>'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: Type of comment, 2: Notification if the comment is pending. */\n\t\t\t\t\t\t_x( '%1$s %2$s', 'dashboard' ),\n\t\t\t\t\t\t\"<strong>$type</strong>\",\n\t\t\t\t\t\t'<span class=\"approve\">' . __( '[Pending]' ) . '</span>'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</p>\n\t\t\t<p class=\"comment-author\"><?php comment_author_link( $comment ); ?></p>\n\n\t\t\t<?php endif; // comment_type ?>\n\t\t\t<blockquote><p><?php comment_excerpt( $comment ); ?></p></blockquote>\n\t\t\t<?php if ( $actions_string ) : ?>\n\t\t\t<p class=\"row-actions\"><?php echo $actions_string; ?></p>\n\t\t\t<?php endif; ?>\n\t\t\t</div>\n\t\t</li>\n\t<?php\n\t$GLOBALS['comment'] = null;\n}\n\n/**\n * Callback function for Activity widget.\n *\n * @since 3.8.0\n */\nfunction wp_dashboard_site_activity() {\n\n\techo '<div id=\"activity-widget\">';\n\n\t$future_posts = wp_dashboard_recent_posts(\n\t\tarray(\n\t\t\t'max'    => 5,\n\t\t\t'status' => 'future',\n\t\t\t'order'  => 'ASC',\n\t\t\t'title'  => __( 'Publishing Soon' ),\n\t\t\t'id'     => 'future-posts',\n\t\t)\n\t);\n\t$recent_posts = wp_dashboard_recent_posts(\n\t\tarray(\n\t\t\t'max'    => 5,\n\t\t\t'status' => 'publish',\n\t\t\t'order'  => 'DESC',\n\t\t\t'title'  => __( 'Recently Published' ),\n\t\t\t'id'     => 'published-posts',\n\t\t)\n\t);\n\n\t$recent_comments = wp_dashboard_recent_comments();\n\n\tif ( ! $future_posts && ! $recent_posts && ! $recent_comments ) {\n\t\techo '<div class=\"no-activity\">';\n\t\techo '<p>' . __( 'No activity yet!' ) . '</p>';\n\t\techo '</div>';\n\t}\n\n\techo '</div>';\n}\n\n/**\n * Generates Publishing Soon and Recently Published sections.\n *\n * @since 3.8.0\n *\n * @param array $args {\n *     An array of query and display arguments.\n *\n *     @type int    $max     Number of posts to display.\n *     @type string $status  Post status.\n *     @type string $order   Designates ascending ('ASC') or descending ('DESC') order.\n *     @type string $title   Section title.\n *     @type string $id      The container id.\n * }\n * @return bool False if no posts were found. True otherwise.\n */\nfunction wp_dashboard_recent_posts( $args ) {\n\t$query_args = array(\n\t\t'post_type'      => 'post',\n\t\t'post_status'    => $args['status'],\n\t\t'orderby'        => 'date',\n\t\t'order'          => $args['order'],\n\t\t'posts_per_page' => intval( $args['max'] ),\n\t\t'no_found_rows'  => true,\n\t\t'cache_results'  => false,\n\t\t'perm'           => ( 'future' === $args['status'] ) ? 'editable' : 'readable',\n\t);\n\n\t/**\n\t * Filters the query arguments used for the Recent Posts widget.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param array $query_args The arguments passed to WP_Query to produce the list of posts.\n\t */\n\t$query_args = apply_filters( 'dashboard_recent_posts_query_args', $query_args );\n\t$posts      = new WP_Query( $query_args );\n\n\tif ( $posts->have_posts() ) {\n\n\t\techo '<div id=\"' . $args['id'] . '\" class=\"activity-block\">';\n\n\t\techo '<h3>' . $args['title'] . '</h3>';\n\n\t\techo '<ul>';\n\n\t\t$today    = current_time( 'Y-m-d' );\n\t\t$tomorrow = current_datetime()->modify( '+1 day' )->format( 'Y-m-d' );\n\t\t$year     = current_time( 'Y' );\n\n\t\twhile ( $posts->have_posts() ) {\n\t\t\t$posts->the_post();\n\n\t\t\t$time = get_the_time( 'U' );\n\t\t\tif ( gmdate( 'Y-m-d', $time ) == $today ) {\n\t\t\t\t$relative = __( 'Today' );\n\t\t\t} elseif ( gmdate( 'Y-m-d', $time ) == $tomorrow ) {\n\t\t\t\t$relative = __( 'Tomorrow' );\n\t\t\t} elseif ( gmdate( 'Y', $time ) !== $year ) {\n\t\t\t\t/* translators: Date and time format for recent posts on the dashboard, from a different calendar year, see https://www.php.net/date */\n\t\t\t\t$relative = date_i18n( __( 'M jS Y' ), $time );\n\t\t\t} else {\n\t\t\t\t/* translators: Date and time format for recent posts on the dashboard, see https://www.php.net/date */\n\t\t\t\t$relative = date_i18n( __( 'M jS' ), $time );\n\t\t\t}\n\n\t\t\t// Use the post edit link for those who can edit, the permalink otherwise.\n\t\t\t$recent_post_link = current_user_can( 'edit_post', get_the_ID() ) ? get_edit_post_link() : get_permalink();\n\n\t\t\t$draft_or_post_title = _draft_or_post_title();\n\t\t\tprintf(\n\t\t\t\t'<li><span>%1$s</span> <a href=\"%2$s\" aria-label=\"%3$s\">%4$s</a></li>',\n\t\t\t\t/* translators: 1: Relative date, 2: Time. */\n\t\t\t\tsprintf( _x( '%1$s, %2$s', 'dashboard' ), $relative, get_the_time() ),\n\t\t\t\t$recent_post_link,\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\tesc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $draft_or_post_title ) ),\n\t\t\t\t$draft_or_post_title\n\t\t\t);\n\t\t}\n\n\t\techo '</ul>';\n\t\techo '</div>';\n\n\t} else {\n\t\treturn false;\n\t}\n\n\twp_reset_postdata();\n\n\treturn true;\n}\n\n/**\n * Show Comments section.\n *\n * @since 3.8.0\n *\n * @param int $total_items Optional. Number of comments to query. Default 5.\n * @return bool False if no comments were found. True otherwise.\n */\nfunction wp_dashboard_recent_comments( $total_items = 5 ) {\n\t// Select all comment types and filter out spam later for better query performance.\n\t$comments = array();\n\n\t$comments_query = array(\n\t\t'number' => $total_items * 5,\n\t\t'offset' => 0,\n\t);\n\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t$comments_query['status'] = 'approve';\n\t}\n\n\twhile ( count( $comments ) < $total_items && $possible = get_comments( $comments_query ) ) {\n\t\tif ( ! is_array( $possible ) ) {\n\t\t\tbreak;\n\t\t}\n\t\tforeach ( $possible as $comment ) {\n\t\t\tif ( ! current_user_can( 'read_post', $comment->comment_post_ID ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$comments[] = $comment;\n\t\t\tif ( count( $comments ) == $total_items ) {\n\t\t\t\tbreak 2;\n\t\t\t}\n\t\t}\n\t\t$comments_query['offset'] += $comments_query['number'];\n\t\t$comments_query['number']  = $total_items * 10;\n\t}\n\n\tif ( $comments ) {\n\t\techo '<div id=\"latest-comments\" class=\"activity-block\">';\n\t\techo '<h3>' . __( 'Recent Comments' ) . '</h3>';\n\n\t\techo '<ul id=\"the-comment-list\" data-wp-lists=\"list:comment\">';\n\t\tforeach ( $comments as $comment ) {\n\t\t\t_wp_dashboard_recent_comments_row( $comment );\n\t\t}\n\t\techo '</ul>';\n\n\t\tif ( current_user_can( 'edit_posts' ) ) {\n\t\t\techo '<h3 class=\"screen-reader-text\">' . __( 'View more comments' ) . '</h3>';\n\t\t\t_get_list_table( 'WP_Comments_List_Table' )->views();\n\t\t}\n\n\t\twp_comment_reply( -1, false, 'dashboard', false );\n\t\twp_comment_trashnotice();\n\n\t\techo '</div>';\n\t} else {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\n/**\n * Display generic dashboard RSS widget feed.\n *\n * @since 2.5.0\n *\n * @param string $widget_id\n */\nfunction wp_dashboard_rss_output( $widget_id ) {\n\t$widgets = get_option( 'dashboard_widget_options' );\n\techo '<div class=\"rss-widget\">';\n\twp_widget_rss_output( $widgets[ $widget_id ] );\n\techo '</div>';\n}\n\n/**\n * Checks to see if all of the feed url in $check_urls are cached.\n *\n * If $check_urls is empty, look for the rss feed url found in the dashboard\n * widget options of $widget_id. If cached, call $callback, a function that\n * echoes out output for this widget. If not cache, echo a \"Loading...\" stub\n * which is later replaced by Ajax call (see top of /wp-admin/index.php)\n *\n * @since 2.5.0\n * @since 5.3.0 Formalized the existing and already documented `...$args` parameter\n *              by adding it to the function signature.\n *\n * @param string   $widget_id  The widget ID.\n * @param callable $callback   The callback function used to display each feed.\n * @param array    $check_urls RSS feeds.\n * @param mixed    ...$args    Optional additional parameters to pass to the callback function.\n * @return bool True on success, false on failure.\n */\nfunction wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = array(), ...$args ) {\n\t$loading    = '<p class=\"widget-loading hide-if-no-js\">' . __( 'Loading&hellip;' ) . '</p><div class=\"hide-if-js notice notice-error inline\"><p>' . __( 'This widget requires JavaScript.' ) . '</p></div>';\n\t$doing_ajax = wp_doing_ajax();\n\n\tif ( empty( $check_urls ) ) {\n\t\t$widgets = get_option( 'dashboard_widget_options' );\n\t\tif ( empty( $widgets[ $widget_id ]['url'] ) && ! $doing_ajax ) {\n\t\t\techo $loading;\n\t\t\treturn false;\n\t\t}\n\t\t$check_urls = array( $widgets[ $widget_id ]['url'] );\n\t}\n\n\t$locale    = get_user_locale();\n\t$cache_key = 'dash_v2_' . md5( $widget_id . '_' . $locale );\n\t$output    = get_transient( $cache_key );\n\tif ( false !== $output ) {\n\t\techo $output;\n\t\treturn true;\n\t}\n\n\tif ( ! $doing_ajax ) {\n\t\techo $loading;\n\t\treturn false;\n\t}\n\n\tif ( $callback && is_callable( $callback ) ) {\n\t\tarray_unshift( $args, $widget_id, $check_urls );\n\t\tob_start();\n\t\tcall_user_func_array( $callback, $args );\n\t\t// Default lifetime in cache of 12 hours (same as the feeds).\n\t\tset_transient( $cache_key, ob_get_flush(), 12 * HOUR_IN_SECONDS );\n\t}\n\n\treturn true;\n}\n\n//\n// Dashboard Widgets Controls.\n//\n\n/**\n * Calls widget control callback.\n *\n * @since 2.5.0\n *\n * @global array $wp_dashboard_control_callbacks\n *\n * @param int $widget_control_id Registered Widget ID.\n */\nfunction wp_dashboard_trigger_widget_control( $widget_control_id = false ) {\n\tglobal $wp_dashboard_control_callbacks;\n\n\tif ( is_scalar( $widget_control_id ) && $widget_control_id && isset( $wp_dashboard_control_callbacks[ $widget_control_id ] ) && is_callable( $wp_dashboard_control_callbacks[ $widget_control_id ] ) ) {\n\t\tcall_user_func(\n\t\t\t$wp_dashboard_control_callbacks[ $widget_control_id ],\n\t\t\t'',\n\t\t\tarray(\n\t\t\t\t'id'       => $widget_control_id,\n\t\t\t\t'callback' => $wp_dashboard_control_callbacks[ $widget_control_id ],\n\t\t\t)\n\t\t);\n\t}\n}\n\n/**\n * The RSS dashboard widget control.\n *\n * Sets up $args to be used as input to wp_widget_rss_form(). Handles POST data\n * from RSS-type widgets.\n *\n * @since 2.5.0\n *\n * @param string $widget_id\n * @param array  $form_inputs\n */\nfunction wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) {\n\t$widget_options = get_option( 'dashboard_widget_options' );\n\tif ( ! $widget_options ) {\n\t\t$widget_options = array();\n\t}\n\n\tif ( ! isset( $widget_options[ $widget_id ] ) ) {\n\t\t$widget_options[ $widget_id ] = array();\n\t}\n\n\t$number = 1; // Hack to use wp_widget_rss_form().\n\n\t$widget_options[ $widget_id ]['number'] = $number;\n\n\tif ( 'POST' === $_SERVER['REQUEST_METHOD'] && isset( $_POST['widget-rss'][ $number ] ) ) {\n\t\t$_POST['widget-rss'][ $number ]         = wp_unslash( $_POST['widget-rss'][ $number ] );\n\t\t$widget_options[ $widget_id ]           = wp_widget_rss_process( $_POST['widget-rss'][ $number ] );\n\t\t$widget_options[ $widget_id ]['number'] = $number;\n\n\t\t// Title is optional. If black, fill it if possible.\n\t\tif ( ! $widget_options[ $widget_id ]['title'] && isset( $_POST['widget-rss'][ $number ]['title'] ) ) {\n\t\t\t$rss = fetch_feed( $widget_options[ $widget_id ]['url'] );\n\t\t\tif ( is_wp_error( $rss ) ) {\n\t\t\t\t$widget_options[ $widget_id ]['title'] = htmlentities( __( 'Unknown Feed' ) );\n\t\t\t} else {\n\t\t\t\t$widget_options[ $widget_id ]['title'] = htmlentities( strip_tags( $rss->get_title() ) );\n\t\t\t\t$rss->__destruct();\n\t\t\t\tunset( $rss );\n\t\t\t}\n\t\t}\n\t\tupdate_option( 'dashboard_widget_options', $widget_options );\n\t\t$locale    = get_user_locale();\n\t\t$cache_key = 'dash_v2_' . md5( $widget_id . '_' . $locale );\n\t\tdelete_transient( $cache_key );\n\t}\n\n\twp_widget_rss_form( $widget_options[ $widget_id ], $form_inputs );\n}\n\n\n/**\n * Renders the Events and News dashboard widget.\n *\n * @since 4.8.0\n */\nfunction wp_dashboard_events_news() {\n\twp_print_community_events_markup();\n\n\t?>\n\n\t<div class=\"wordpress-news hide-if-no-js\">\n\t\t<?php wp_dashboard_primary(); ?>\n\t</div>\n\n\t<p class=\"community-events-footer\">\n\t\t<?php\n\t\t\tprintf(\n\t\t\t\t'<a href=\"%1$s\" target=\"_blank\">%2$s <span class=\"screen-reader-text\">%3$s</span><span aria-hidden=\"true\" class=\"dashicons dashicons-external\"></span></a>',\n\t\t\t\t'https://make.wordpress.org/community/meetups-landing-page',\n\t\t\t\t__( 'Meetups' ),\n\t\t\t\t/* translators: Accessibility text. */\n\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t);\n\t\t?>\n\n\t\t|\n\n\t\t<?php\n\t\t\tprintf(\n\t\t\t\t'<a href=\"%1$s\" target=\"_blank\">%2$s <span class=\"screen-reader-text\">%3$s</span><span aria-hidden=\"true\" class=\"dashicons dashicons-external\"></span></a>',\n\t\t\t\t'https://central.wordcamp.org/schedule/',\n\t\t\t\t__( 'WordCamps' ),\n\t\t\t\t/* translators: Accessibility text. */\n\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t);\n\t\t?>\n\n\t\t|\n\n\t\t<?php\n\t\t\tprintf(\n\t\t\t\t'<a href=\"%1$s\" target=\"_blank\">%2$s <span class=\"screen-reader-text\">%3$s</span><span aria-hidden=\"true\" class=\"dashicons dashicons-external\"></span></a>',\n\t\t\t\t/* translators: If a Rosetta site exists (e.g. https://es.wordpress.org/news/), then use that. Otherwise, leave untranslated. */\n\t\t\t\tesc_url( _x( 'https://wordpress.org/news/', 'Events and News dashboard widget' ) ),\n\t\t\t\t__( 'News' ),\n\t\t\t\t/* translators: Accessibility text. */\n\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t);\n\t\t?>\n\t</p>\n\n\t<?php\n}\n\n/**\n * Prints the markup for the Community Events section of the Events and News Dashboard widget.\n *\n * @since 4.8.0\n */\nfunction wp_print_community_events_markup() {\n\t?>\n\n\t<div class=\"community-events-errors notice notice-error inline hide-if-js\">\n\t\t<p class=\"hide-if-js\">\n\t\t\t<?php _e( 'This widget requires JavaScript.' ); ?>\n\t\t</p>\n\n\t\t<p class=\"community-events-error-occurred\" aria-hidden=\"true\">\n\t\t\t<?php _e( 'An error occurred. Please try again.' ); ?>\n\t\t</p>\n\n\t\t<p class=\"community-events-could-not-locate\" aria-hidden=\"true\"></p>\n\t</div>\n\n\t<div class=\"community-events-loading hide-if-no-js\">\n\t\t<?php _e( 'Loading&hellip;' ); ?>\n\t</div>\n\n\t<?php\n\t/*\n\t * Hide the main element when the page first loads, because the content\n\t * won't be ready until wp.communityEvents.renderEventsTemplate() has run.\n\t */\n\t?>\n\t<div id=\"community-events\" class=\"community-events\" aria-hidden=\"true\">\n\t\t<div class=\"activity-block\">\n\t\t\t<p>\n\t\t\t\t<span id=\"community-events-location-message\"></span>\n\n\t\t\t\t<button class=\"button-link community-events-toggle-location\" aria-label=\"<?php esc_attr_e( 'Edit city' ); ?>\" aria-expanded=\"false\">\n\t\t\t\t\t<span class=\"dashicons dashicons-edit\"></span>\n\t\t\t\t</button>\n\t\t\t</p>\n\n\t\t\t<form class=\"community-events-form\" aria-hidden=\"true\" action=\"<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>\" method=\"post\">\n\t\t\t\t<label for=\"community-events-location\">\n\t\t\t\t\t<?php _e( 'City:' ); ?>\n\t\t\t\t</label>\n\t\t\t\t<?php\n\t\t\t\t/* translators: Replace with a city related to your locale.\n\t\t\t\t * Test that it matches the expected location and has upcoming\n\t\t\t\t * events before including it. If no cities related to your\n\t\t\t\t * locale have events, then use a city related to your locale\n\t\t\t\t * that would be recognizable to most users. Use only the city\n\t\t\t\t * name itself, without any region or country. Use the endonym\n\t\t\t\t * (native locale name) instead of the English name if possible.\n\t\t\t\t */\n\t\t\t\t?>\n\t\t\t\t<input id=\"community-events-location\" class=\"regular-text\" type=\"text\" name=\"community-events-location\" placeholder=\"<?php esc_attr_e( 'Cincinnati' ); ?>\" />\n\n\t\t\t\t<?php submit_button( __( 'Submit' ), 'secondary', 'community-events-submit', false ); ?>\n\n\t\t\t\t<button class=\"community-events-cancel button-link\" type=\"button\" aria-expanded=\"false\">\n\t\t\t\t\t<?php _e( 'Cancel' ); ?>\n\t\t\t\t</button>\n\n\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t</form>\n\t\t</div>\n\n\t\t<ul class=\"community-events-results activity-block last\"></ul>\n\t</div>\n\n\t<?php\n}\n\n/**\n * Renders the events templates for the Event and News widget.\n *\n * @since 4.8.0\n */\nfunction wp_print_community_events_templates() {\n\t?>\n\n\t<script id=\"tmpl-community-events-attend-event-near\" type=\"text/template\">\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: The name of a city. */\n\t\t\t__( 'Attend an upcoming event near %s.' ),\n\t\t\t'<strong>{{ data.location.description }}</strong>'\n\t\t);\n\t\t?>\n\t</script>\n\n\t<script id=\"tmpl-community-events-could-not-locate\" type=\"text/template\">\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s is the name of the city we couldn't locate.\n\t\t\t * Replace the examples with cities in your locale, but test\n\t\t\t * that they match the expected location before including them.\n\t\t\t * Use endonyms (native locale names) whenever possible.\n\t\t\t */\n\t\t\t__( 'We couldn&#8217;t locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland.' ),\n\t\t\t'<em>{{data.unknownCity}}</em>'\n\t\t);\n\t\t?>\n\t</script>\n\n\t<script id=\"tmpl-community-events-event-list\" type=\"text/template\">\n\t\t<# _.each( data.events, function( event ) { #>\n\t\t\t<li class=\"event event-{{ event.type }} wp-clearfix\">\n\t\t\t\t<div class=\"event-info\">\n\t\t\t\t\t<div class=\"dashicons event-icon\" aria-hidden=\"true\"></div>\n\t\t\t\t\t<div class=\"event-info-inner\">\n\t\t\t\t\t\t<a class=\"event-title\" href=\"{{ event.url }}\">{{ event.title }}</a>\n\t\t\t\t\t\t<span class=\"event-city\">{{ event.location.location }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"event-date-time\">\n\t\t\t\t\t<span class=\"event-date\">{{ event.user_formatted_date }}</span>\n\t\t\t\t\t<# if ( 'meetup' === event.type ) { #>\n\t\t\t\t\t\t<span class=\"event-time\">\n\t\t\t\t\t\t\t{{ event.user_formatted_time }} {{ event.timeZoneAbbreviation }}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t<# } #>\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t<# } ) #>\n\t</script>\n\n\t<script id=\"tmpl-community-events-no-upcoming-events\" type=\"text/template\">\n\t\t<li class=\"event-none\">\n\t\t\t<# if ( data.location.description ) { #>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: The city the user searched for, 2: Meetup organization documentation URL. */\n\t\t\t\t\t__( 'There aren&#8217;t any events scheduled near %1$s at the moment. Would you like to <a href=\"%2$s\">organize a WordPress event</a>?' ),\n\t\t\t\t\t'{{ data.location.description }}',\n\t\t\t\t\t__( 'https://make.wordpress.org/community/handbook/meetup-organizer/welcome/' )\n\t\t\t\t);\n\t\t\t\t?>\n\n\t\t\t<# } else { #>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: Meetup organization documentation URL. */\n\t\t\t\t\t__( 'There aren&#8217;t any events scheduled near you at the moment. Would you like to <a href=\"%s\">organize a WordPress event</a>?' ),\n\t\t\t\t\t__( 'https://make.wordpress.org/community/handbook/meetup-organizer/welcome/' )\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t<# } #>\n\t\t</li>\n\t</script>\n\t<?php\n}\n\n/**\n * 'WordPress Events and News' dashboard widget.\n *\n * @since 2.7.0\n * @since 4.8.0 Removed popular plugins feed.\n */\nfunction wp_dashboard_primary() {\n\t$feeds = array(\n\t\t'news'   => array(\n\n\t\t\t/**\n\t\t\t * Filters the primary link URL for the 'WordPress Events and News' dashboard widget.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t *\n\t\t\t * @param string $link The widget's primary link URL.\n\t\t\t */\n\t\t\t'link'         => apply_filters( 'dashboard_primary_link', __( 'https://wordpress.org/news/' ) ),\n\n\t\t\t/**\n\t\t\t * Filters the primary feed URL for the 'WordPress Events and News' dashboard widget.\n\t\t\t *\n\t\t\t * @since 2.3.0\n\t\t\t *\n\t\t\t * @param string $url The widget's primary feed URL.\n\t\t\t */\n\t\t\t'url'          => apply_filters( 'dashboard_primary_feed', __( 'https://wordpress.org/news/feed/' ) ),\n\n\t\t\t/**\n\t\t\t * Filters the primary link title for the 'WordPress Events and News' dashboard widget.\n\t\t\t *\n\t\t\t * @since 2.3.0\n\t\t\t *\n\t\t\t * @param string $title Title attribute for the widget's primary link.\n\t\t\t */\n\t\t\t'title'        => apply_filters( 'dashboard_primary_title', __( 'WordPress Blog' ) ),\n\t\t\t'items'        => 1,\n\t\t\t'show_summary' => 0,\n\t\t\t'show_author'  => 0,\n\t\t\t'show_date'    => 0,\n\t\t),\n\t\t'planet' => array(\n\n\t\t\t/**\n\t\t\t * Filters the secondary link URL for the 'WordPress Events and News' dashboard widget.\n\t\t\t *\n\t\t\t * @since 2.3.0\n\t\t\t *\n\t\t\t * @param string $link The widget's secondary link URL.\n\t\t\t */\n\t\t\t'link'         => apply_filters( 'dashboard_secondary_link', __( 'https://planet.wordpress.org/' ) ),\n\n\t\t\t/**\n\t\t\t * Filters the secondary feed URL for the 'WordPress Events and News' dashboard widget.\n\t\t\t *\n\t\t\t * @since 2.3.0\n\t\t\t *\n\t\t\t * @param string $url The widget's secondary feed URL.\n\t\t\t */\n\t\t\t'url'          => apply_filters( 'dashboard_secondary_feed', __( 'https://planet.wordpress.org/feed/' ) ),\n\n\t\t\t/**\n\t\t\t * Filters the secondary link title for the 'WordPress Events and News' dashboard widget.\n\t\t\t *\n\t\t\t * @since 2.3.0\n\t\t\t *\n\t\t\t * @param string $title Title attribute for the widget's secondary link.\n\t\t\t */\n\t\t\t'title'        => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ),\n\n\t\t\t/**\n\t\t\t * Filters the number of secondary link items for the 'WordPress Events and News' dashboard widget.\n\t\t\t *\n\t\t\t * @since 4.4.0\n\t\t\t *\n\t\t\t * @param string $items How many items to show in the secondary feed.\n\t\t\t */\n\t\t\t'items'        => apply_filters( 'dashboard_secondary_items', 3 ),\n\t\t\t'show_summary' => 0,\n\t\t\t'show_author'  => 0,\n\t\t\t'show_date'    => 0,\n\t\t),\n\t);\n\n\twp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_primary_output', $feeds );\n}\n\n/**\n * Displays the WordPress events and news feeds.\n *\n * @since 3.8.0\n * @since 4.8.0 Removed popular plugins feed.\n *\n * @param string $widget_id Widget ID.\n * @param array  $feeds     Array of RSS feeds.\n */\nfunction wp_dashboard_primary_output( $widget_id, $feeds ) {\n\tforeach ( $feeds as $type => $args ) {\n\t\t$args['type'] = $type;\n\t\techo '<div class=\"rss-widget\">';\n\t\t\twp_widget_rss_output( $args['url'], $args );\n\t\techo '</div>';\n\t}\n}\n\n/**\n * Displays file upload quota on dashboard.\n *\n * Runs on the {@see 'activity_box_end'} hook in wp_dashboard_right_now().\n *\n * @since 3.0.0\n *\n * @return bool|null True if not multisite, user can't upload files, or the space check option is disabled.\n */\nfunction wp_dashboard_quota() {\n\tif ( ! is_multisite() || ! current_user_can( 'upload_files' ) || get_site_option( 'upload_space_check_disabled' ) ) {\n\t\treturn true;\n\t}\n\n\t$quota = get_space_allowed();\n\t$used  = get_space_used();\n\n\tif ( $used > $quota ) {\n\t\t$percentused = '100';\n\t} else {\n\t\t$percentused = ( $used / $quota ) * 100;\n\t}\n\t$used_class  = ( $percentused >= 70 ) ? ' warning' : '';\n\t$used        = round( $used, 2 );\n\t$percentused = number_format( $percentused );\n\n\t?>\n\t<h3 class=\"mu-storage\"><?php _e( 'Storage Space' ); ?></h3>\n\t<div class=\"mu-storage\">\n\t<ul>\n\t\t<li class=\"storage-count\">\n\t\t\t<?php\n\t\t\t$text = sprintf(\n\t\t\t\t/* translators: %s: Number of megabytes. */\n\t\t\t\t__( '%s MB Space Allowed' ),\n\t\t\t\tnumber_format_i18n( $quota )\n\t\t\t);\n\t\t\tprintf(\n\t\t\t\t'<a href=\"%1$s\">%2$s <span class=\"screen-reader-text\">(%3$s)</span></a>',\n\t\t\t\tesc_url( admin_url( 'upload.php' ) ),\n\t\t\t\t$text,\n\t\t\t\t__( 'Manage Uploads' )\n\t\t\t);\n\t\t\t?>\n\t\t</li><li class=\"storage-count <?php echo $used_class; ?>\">\n\t\t\t<?php\n\t\t\t$text = sprintf(\n\t\t\t\t/* translators: 1: Number of megabytes, 2: Percentage. */\n\t\t\t\t__( '%1$s MB (%2$s%%) Space Used' ),\n\t\t\t\tnumber_format_i18n( $used, 2 ),\n\t\t\t\t$percentused\n\t\t\t);\n\t\t\tprintf(\n\t\t\t\t'<a href=\"%1$s\" class=\"musublink\">%2$s <span class=\"screen-reader-text\">(%3$s)</span></a>',\n\t\t\t\tesc_url( admin_url( 'upload.php' ) ),\n\t\t\t\t$text,\n\t\t\t\t__( 'Manage Uploads' )\n\t\t\t);\n\t\t\t?>\n\t\t</li>\n\t</ul>\n\t</div>\n\t<?php\n}\n\n/**\n * Displays the browser update nag.\n *\n * @since 3.2.0\n */\nfunction wp_dashboard_browser_nag() {\n\t$notice   = '';\n\t$response = wp_check_browser_version();\n\n\tif ( $response ) {\n\t\tif ( $response['insecure'] ) {\n\t\t\t$msg = sprintf(\n\t\t\t\t/* translators: %s: Browser name and link. */\n\t\t\t\t__( \"It looks like you're using an insecure version of %s. Using an outdated browser makes your computer unsafe. For the best WordPress experience, please update your browser.\" ),\n\t\t\t\tsprintf( '<a href=\"%s\">%s</a>', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )\n\t\t\t);\n\t\t} else {\n\t\t\t$msg = sprintf(\n\t\t\t\t/* translators: %s: Browser name and link. */\n\t\t\t\t__( \"It looks like you're using an old version of %s. For the best WordPress experience, please update your browser.\" ),\n\t\t\t\tsprintf( '<a href=\"%s\">%s</a>', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )\n\t\t\t);\n\t\t}\n\n\t\t$browser_nag_class = '';\n\t\tif ( ! empty( $response['img_src'] ) ) {\n\t\t\t$img_src = ( is_ssl() && ! empty( $response['img_src_ssl'] ) ) ? $response['img_src_ssl'] : $response['img_src'];\n\n\t\t\t$notice           .= '<div class=\"alignright browser-icon\"><a href=\"' . esc_attr( $response['update_url'] ) . '\"><img src=\"' . esc_attr( $img_src ) . '\" alt=\"\" /></a></div>';\n\t\t\t$browser_nag_class = ' has-browser-icon';\n\t\t}\n\t\t$notice .= \"<p class='browser-update-nag{$browser_nag_class}'>{$msg}</p>\";\n\n\t\t$browsehappy = 'https://browsehappy.com/';\n\t\t$locale      = get_user_locale();\n\t\tif ( 'en_US' !== $locale ) {\n\t\t\t$browsehappy = add_query_arg( 'locale', $locale, $browsehappy );\n\t\t}\n\n\t\t$notice .= '<p>' . sprintf(\n\t\t\t/* translators: 1: Browser update URL, 2: Browser name, 3: Browse Happy URL. */\n\t\t\t__( '<a href=\"%1$s\" class=\"update-browser-link\">Update %2$s</a> or learn how to <a href=\"%3$s\" class=\"browse-happy-link\">browse happy</a>' ),\n\t\t\tesc_attr( $response['update_url'] ),\n\t\t\tesc_html( $response['name'] ),\n\t\t\tesc_url( $browsehappy )\n\t\t) . '</p>';\n\t\t$notice .= '<p class=\"hide-if-no-js\"><a href=\"\" class=\"dismiss\" aria-label=\"' . esc_attr__( 'Dismiss the browser warning panel' ) . '\">' . __( 'Dismiss' ) . '</a></p>';\n\t\t$notice .= '<div class=\"clear\"></div>';\n\t}\n\n\t/**\n\t * Filters the notice output for the 'Browse Happy' nag meta box.\n\t *\n\t * @since 3.2.0\n\t *\n\t * @param string $notice   The notice content.\n\t * @param array  $response An array containing web browser information. See `wp_check_browser_version()`.\n\t */\n\techo apply_filters( 'browse-happy-notice', $notice, $response ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n}\n\n/**\n * Adds an additional class to the browser nag if the current version is insecure.\n *\n * @since 3.2.0\n *\n * @param string[] $classes Array of meta box classes.\n * @return string[] Modified array of meta box classes.\n */\nfunction dashboard_browser_nag_class( $classes ) {\n\t$response = wp_check_browser_version();\n\n\tif ( $response && $response['insecure'] ) {\n\t\t$classes[] = 'browser-insecure';\n\t}\n\n\treturn $classes;\n}\n\n/**\n * Checks if the user needs a browser update.\n *\n * @since 3.2.0\n *\n * @return array|bool Array of browser data on success, false on failure.\n */\nfunction wp_check_browser_version() {\n\tif ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {\n\t\treturn false;\n\t}\n\n\t$key = md5( $_SERVER['HTTP_USER_AGENT'] );\n\n\t$response = get_site_transient( 'browser_' . $key );\n\tif ( false === $response ) {\n\t\t// Include an unmodified $wp_version.\n\t\trequire ABSPATH . WPINC . '/version.php';\n\n\t\t$url     = 'http://api.wordpress.org/core/browse-happy/1.1/';\n\t\t$options = array(\n\t\t\t'body'       => array( 'useragent' => $_SERVER['HTTP_USER_AGENT'] ),\n\t\t\t'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),\n\t\t);\n\n\t\tif ( wp_http_supports( array( 'ssl' ) ) ) {\n\t\t\t$url = set_url_scheme( $url, 'https' );\n\t\t}\n\n\t\t$response = wp_remote_post( $url, $options );\n\n\t\tif ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * Response should be an array with:\n\t\t *  'platform' - string - A user-friendly platform name, if it can be determined\n\t\t *  'name' - string - A user-friendly browser name\n\t\t *  'version' - string - The version of the browser the user is using\n\t\t *  'current_version' - string - The most recent version of the browser\n\t\t *  'upgrade' - boolean - Whether the browser needs an upgrade\n\t\t *  'insecure' - boolean - Whether the browser is deemed insecure\n\t\t *  'update_url' - string - The url to visit to upgrade\n\t\t *  'img_src' - string - An image representing the browser\n\t\t *  'img_src_ssl' - string - An image (over SSL) representing the browser\n\t\t */\n\t\t$response = json_decode( wp_remote_retrieve_body( $response ), true );\n\n\t\tif ( ! is_array( $response ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tset_site_transient( 'browser_' . $key, $response, WEEK_IN_SECONDS );\n\t}\n\n\treturn $response;\n}\n\n/**\n * Displays the PHP update nag.\n *\n * @since 5.1.0\n */\nfunction wp_dashboard_php_nag() {\n\t$response = wp_check_php_version();\n\n\tif ( ! $response ) {\n\t\treturn;\n\t}\n\n\tif ( isset( $response['is_secure'] ) && ! $response['is_secure'] ) {\n\t\t$msg = __( 'WordPress has detected that your site is running on an insecure version of PHP.' );\n\t} else {\n\t\t$msg = __( 'WordPress has detected that your site is running on an outdated version of PHP.' );\n\t}\n\n\t?>\n\t<p><?php echo $msg; ?></p>\n\n\t<h3><?php _e( 'What is PHP and how does it affect my site?' ); ?></h3>\n\t<p><?php _e( 'PHP is the programming language we use to build and maintain WordPress. Newer versions of PHP are both faster and more secure, so updating will have a positive effect on your site&#8217;s performance.' ); ?></p>\n\n\t<p class=\"button-container\">\n\t\t<?php\n\t\tprintf(\n\t\t\t'<a class=\"button button-primary\" href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">%2$s <span class=\"screen-reader-text\">%3$s</span><span aria-hidden=\"true\" class=\"dashicons dashicons-external\"></span></a>',\n\t\t\tesc_url( wp_get_update_php_url() ),\n\t\t\t__( 'Learn more about updating PHP' ),\n\t\t\t/* translators: Accessibility text. */\n\t\t\t__( '(opens in a new tab)' )\n\t\t);\n\t\t?>\n\t</p>\n\t<?php\n\n\twp_update_php_annotation();\n\twp_direct_php_update_button();\n}\n\n/**\n * Adds an additional class to the PHP nag if the current version is insecure.\n *\n * @since 5.1.0\n *\n * @param string[] $classes Array of meta box classes.\n * @return string[] Modified array of meta box classes.\n */\nfunction dashboard_php_nag_class( $classes ) {\n\t$response = wp_check_php_version();\n\n\tif ( $response && isset( $response['is_secure'] ) && ! $response['is_secure'] ) {\n\t\t$classes[] = 'php-insecure';\n\t}\n\n\treturn $classes;\n}\n\n/**\n * Displays the Site Health Status widget.\n *\n * @since 5.4.0\n */\nfunction wp_dashboard_site_health() {\n\t$get_issues = get_transient( 'health-check-site-status-result' );\n\n\t$issue_counts = array();\n\n\tif ( false !== $get_issues ) {\n\t\t$issue_counts = json_decode( $get_issues, true );\n\t}\n\n\tif ( ! is_array( $issue_counts ) || ! $issue_counts ) {\n\t\t$issue_counts = array(\n\t\t\t'good'        => 0,\n\t\t\t'recommended' => 0,\n\t\t\t'critical'    => 0,\n\t\t);\n\t}\n\n\t$issues_total = $issue_counts['recommended'] + $issue_counts['critical'];\n\t?>\n\t<div class=\"health-check-title-section site-health-progress-wrapper loading hide-if-no-js\">\n\t\t<div class=\"site-health-progress\">\n\t\t\t<svg role=\"img\" aria-hidden=\"true\" focusable=\"false\" width=\"100%\" height=\"100%\" viewBox=\"0 0 200 200\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t<circle r=\"90\" cx=\"100\" cy=\"100\" fill=\"transparent\" stroke-dasharray=\"565.48\" stroke-dashoffset=\"0\"></circle>\n\t\t\t\t<circle id=\"bar\" r=\"90\" cx=\"100\" cy=\"100\" fill=\"transparent\" stroke-dasharray=\"565.48\" stroke-dashoffset=\"0\"></circle>\n\t\t\t</svg>\n\t\t</div>\n\t\t<div class=\"site-health-progress-label\">\n\t\t\t<?php if ( false === $get_issues ) : ?>\n\t\t\t\t<?php _e( 'No information yet&hellip;' ); ?>\n\t\t\t<?php else : ?>\n\t\t\t\t<?php _e( 'Results are still loading&hellip;' ); ?>\n\t\t\t<?php endif; ?>\n\t\t</div>\n\t</div>\n\n\t<?php if ( false === $get_issues ) : ?>\n\t\t<p>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: URL to Site Health screen. */\n\t\t\t\t__( 'Site health checks will automatically run periodically to gather information about your site. You can also <a href=\"%s\">visit the Site Health screen</a> to gather information about your site now.' ),\n\t\t\t\tesc_url( admin_url( 'site-health.php' ) )\n\t\t\t);\n\t\t\t?>\n\t\t</p>\n\t<?php else : ?>\n\t\t<p>\n\t\t\t<?php if ( $issue_counts['critical'] > 0 ) : ?>\n\t\t\t\t<?php _e( 'Your site has critical issues that should be addressed as soon as possible to improve its performance and security.' ); ?>\n\t\t\t<?php elseif ( $issues_total <= 0 ) : ?>\n\t\t\t\t<?php _e( 'Great job! Your site currently passes all site health checks.' ); ?>\n\t\t\t<?php else : ?>\n\t\t\t\t<?php _e( 'Your site&#8217;s health is looking good, but there are still some things you can do to improve its performance and security.' ); ?>\n\t\t\t<?php endif; ?>\n\t\t</p>\n\t<?php endif; ?>\n\n\t<?php if ( $issues_total > 0 && false !== $get_issues ) : ?>\n\t\t<p>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: 1: Number of issues. 2: URL to Site Health screen. */\n\t\t\t\t_n(\n\t\t\t\t\t'Take a look at the <strong>%1$d item</strong> on the <a href=\"%2$s\">Site Health screen</a>.',\n\t\t\t\t\t'Take a look at the <strong>%1$d items</strong> on the <a href=\"%2$s\">Site Health screen</a>.',\n\t\t\t\t\t$issues_total\n\t\t\t\t),\n\t\t\t\t$issues_total,\n\t\t\t\tesc_url( admin_url( 'site-health.php' ) )\n\t\t\t);\n\t\t\t?>\n\t\t</p>\n\t<?php endif; ?>\n\n\t<?php\n}\n\n/**\n * Empty function usable by plugins to output empty dashboard widget (to be populated later by JS).\n *\n * @since 2.5.0\n */\nfunction wp_dashboard_empty() {}\n\n/**\n * Displays a welcome panel to introduce users to WordPress.\n *\n * @since 3.3.0\n */\nfunction wp_welcome_panel() {\n\t?>\n\t<div class=\"welcome-panel-content\">\n\t<h2><?php _e( 'Welcome to WordPress!' ); ?></h2>\n\t<p class=\"about-description\"><?php _e( 'We&#8217;ve assembled some links to get you started:' ); ?></p>\n\t<div class=\"welcome-panel-column-container\">\n\t<div class=\"welcome-panel-column\">\n\t\t<?php if ( current_user_can( 'customize' ) ) : ?>\n\t\t\t<h3><?php _e( 'Get Started' ); ?></h3>\n\t\t\t<a class=\"button button-primary button-hero load-customize hide-if-no-customize\" href=\"<?php echo wp_customize_url(); ?>\"><?php _e( 'Customize Your Site' ); ?></a>\n\t\t<?php endif; ?>\n\t\t<a class=\"button button-primary button-hero hide-if-customize\" href=\"<?php echo admin_url( 'themes.php' ); ?>\"><?php _e( 'Customize Your Site' ); ?></a>\n\t\t<?php if ( current_user_can( 'install_themes' ) || ( current_user_can( 'switch_themes' ) && count( wp_get_themes( array( 'allowed' => true ) ) ) > 1 ) ) : ?>\n\t\t\t<?php $themes_link = current_user_can( 'customize' ) ? add_query_arg( 'autofocus[panel]', 'themes', admin_url( 'customize.php' ) ) : admin_url( 'themes.php' ); ?>\n\t\t\t<p class=\"hide-if-no-customize\">\n\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: URL to Themes panel in Customizer or Themes screen. */\n\t\t\t\t\tprintf( __( 'or, <a href=\"%s\">change your theme completely</a>' ), $themes_link );\n\t\t\t\t?>\n\t\t\t</p>\n\t\t<?php endif; ?>\n\t</div>\n\t<div class=\"welcome-panel-column\">\n\t\t<h3><?php _e( 'Next Steps' ); ?></h3>\n\t\t<ul>\n\t\t<?php if ( 'page' === get_option( 'show_on_front' ) && ! get_option( 'page_for_posts' ) ) : ?>\n\t\t\t<li><?php printf( '<a href=\"%s\" class=\"welcome-icon welcome-edit-page\">' . __( 'Edit your front page' ) . '</a>', get_edit_post_link( get_option( 'page_on_front' ) ) ); ?></li>\n\t\t\t<li><?php printf( '<a href=\"%s\" class=\"welcome-icon welcome-add-page\">' . __( 'Add additional pages' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>\n\t\t<?php elseif ( 'page' === get_option( 'show_on_front' ) ) : ?>\n\t\t\t<li><?php printf( '<a href=\"%s\" class=\"welcome-icon welcome-edit-page\">' . __( 'Edit your front page' ) . '</a>', get_edit_post_link( get_option( 'page_on_front' ) ) ); ?></li>\n\t\t\t<li><?php printf( '<a href=\"%s\" class=\"welcome-icon welcome-add-page\">' . __( 'Add additional pages' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>\n\t\t\t<li><?php printf( '<a href=\"%s\" class=\"welcome-icon welcome-write-blog\">' . __( 'Add a blog post' ) . '</a>', admin_url( 'post-new.php' ) ); ?></li>\n\t\t<?php else : ?>\n\t\t\t<li><?php printf( '<a href=\"%s\" class=\"welcome-icon welcome-write-blog\">' . __( 'Write your first blog post' ) . '</a>', admin_url( 'post-new.php' ) ); ?></li>\n\t\t\t<li><?php printf( '<a href=\"%s\" class=\"welcome-icon welcome-add-page\">' . __( 'Add an About page' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>\n\t\t\t<li><?php printf( '<a href=\"%s\" class=\"welcome-icon welcome-setup-home\">' . __( 'Set up your homepage' ) . '</a>', current_user_can( 'customize' ) ? add_query_arg( 'autofocus[section]', 'static_front_page', admin_url( 'customize.php' ) ) : admin_url( 'options-reading.php' ) ); ?></li>\n\t\t<?php endif; ?>\n\t\t\t<li><?php printf( '<a href=\"%s\" class=\"welcome-icon welcome-view-site\">' . __( 'View your site' ) . '</a>', home_url( '/' ) ); ?></li>\n\t\t</ul>\n\t</div>\n\t<div class=\"welcome-panel-column welcome-panel-last\">\n\t\t<h3><?php _e( 'More Actions' ); ?></h3>\n\t\t<ul>\n\t\t<?php if ( current_theme_supports( 'widgets' ) ) : ?>\n\t\t\t<li><?php printf( '<a href=\"%s\" class=\"welcome-icon welcome-widgets\">' . __( 'Manage widgets' ) . '</a>', admin_url( 'widgets.php' ) ); ?></li>\n\t\t<?php endif; ?>\n\t\t<?php if ( current_theme_supports( 'menus' ) ) : ?>\n\t\t\t<li><?php printf( '<a href=\"%s\" class=\"welcome-icon welcome-menus\">' . __( 'Manage menus' ) . '</a>', admin_url( 'nav-menus.php' ) ); ?></li>\n\t\t<?php endif; ?>\n\t\t<?php if ( current_user_can( 'manage_options' ) ) : ?>\n\t\t\t<li><?php printf( '<a href=\"%s\" class=\"welcome-icon welcome-comments\">' . __( 'Turn comments on or off' ) . '</a>', admin_url( 'options-discussion.php' ) ); ?></li>\n\t\t<?php endif; ?>\n\t\t\t<li><?php printf( '<a href=\"%s\" class=\"welcome-icon welcome-learn-more\">' . __( 'Learn more about getting started' ) . '</a>', __( 'https://wordpress.org/support/article/first-steps-with-wordpress/' ) ); ?></li>\n\t\t</ul>\n\t</div>\n\t</div>\n\t</div>\n\t<?php\n}\n", "num_lines": 1939}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Deprecated admin functions from past WordPress versions. You shouldn't use these\n * functions and look for the alternatives instead. The functions will be removed\n * in a later version.\n *\n * @package WordPress\n * @subpackage Deprecated\n */\n\n/*\n * Deprecated functions come here to die.\n */\n\n/**\n * @since 2.1.0\n * @deprecated 2.1.0 Use wp_editor()\n * @see wp_editor()\n */\nfunction tinymce_include() {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'wp_editor()' );\n\n\twp_tiny_mce();\n}\n\n/**\n * Unused Admin function.\n *\n * @since 2.0.0\n * @deprecated 2.5.0\n *\n */\nfunction documentation_link() {\n\t_deprecated_function( __FUNCTION__, '2.5.0' );\n}\n\n/**\n * Calculates the new dimensions for a downsampled image.\n *\n * @since 2.0.0\n * @deprecated 3.0.0 Use wp_constrain_dimensions()\n * @see wp_constrain_dimensions()\n *\n * @param int $width Current width of the image\n * @param int $height Current height of the image\n * @param int $wmax Maximum wanted width\n * @param int $hmax Maximum wanted height\n * @return array Shrunk dimensions (width, height).\n */\nfunction wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'wp_constrain_dimensions()' );\n\treturn wp_constrain_dimensions( $width, $height, $wmax, $hmax );\n}\n\n/**\n * Calculated the new dimensions for a downsampled image.\n *\n * @since 2.0.0\n * @deprecated 3.5.0 Use wp_constrain_dimensions()\n * @see wp_constrain_dimensions()\n *\n * @param int $width Current width of the image\n * @param int $height Current height of the image\n * @return array Shrunk dimensions (width, height).\n */\nfunction get_udims( $width, $height ) {\n\t_deprecated_function( __FUNCTION__, '3.5.0', 'wp_constrain_dimensions()' );\n\treturn wp_constrain_dimensions( $width, $height, 128, 96 );\n}\n\n/**\n * Legacy function used to generate the categories checklist control.\n *\n * @since 0.71\n * @deprecated 2.6.0 Use wp_category_checklist()\n * @see wp_category_checklist()\n *\n * @param int $default       Unused.\n * @param int $parent        Unused.\n * @param array $popular_ids Unused.\n */\nfunction dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) {\n\t_deprecated_function( __FUNCTION__, '2.6.0', 'wp_category_checklist()' );\n\tglobal $post_ID;\n\twp_category_checklist( $post_ID );\n}\n\n/**\n * Legacy function used to generate a link categories checklist control.\n *\n * @since 2.1.0\n * @deprecated 2.6.0 Use wp_link_category_checklist()\n * @see wp_link_category_checklist()\n *\n * @param int $default Unused.\n */\nfunction dropdown_link_categories( $default = 0 ) {\n\t_deprecated_function( __FUNCTION__, '2.6.0', 'wp_link_category_checklist()' );\n\tglobal $link_id;\n\twp_link_category_checklist( $link_id );\n}\n\n/**\n * Get the real filesystem path to a file to edit within the admin.\n *\n * @since 1.5.0\n * @deprecated 2.9.0\n * @uses WP_CONTENT_DIR Full filesystem path to the wp-content directory.\n *\n * @param string $file Filesystem path relative to the wp-content directory.\n * @return string Full filesystem path to edit.\n */\nfunction get_real_file_to_edit( $file ) {\n\t_deprecated_function( __FUNCTION__, '2.9.0' );\n\n\treturn WP_CONTENT_DIR . $file;\n}\n\n/**\n * Legacy function used for generating a categories drop-down control.\n *\n * @since 1.2.0\n * @deprecated 3.0.0 Use wp_dropdown_categories()\n * @see wp_dropdown_categories()\n *\n * @param int $currentcat    Optional. ID of the current category. Default 0.\n * @param int $currentparent Optional. Current parent category ID. Default 0.\n * @param int $parent        Optional. Parent ID to retrieve categories for. Default 0.\n * @param int $level         Optional. Number of levels deep to display. Default 0.\n * @param array $categories  Optional. Categories to include in the control. Default 0.\n * @return bool|null False if no categories were found.\n */\nfunction wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'wp_dropdown_categories()' );\n\tif (!$categories )\n\t\t$categories = get_categories( array('hide_empty' => 0) );\n\n\tif ( $categories ) {\n\t\tforeach ( $categories as $category ) {\n\t\t\tif ( $currentcat != $category->term_id && $parent == $category->parent) {\n\t\t\t\t$pad = str_repeat( '&#8211; ', $level );\n\t\t\t\t$category->name = esc_html( $category->name );\n\t\t\t\techo \"\\n\\t<option value='$category->term_id'\";\n\t\t\t\tif ( $currentparent == $category->term_id )\n\t\t\t\t\techo \" selected='selected'\";\n\t\t\t\techo \">$pad$category->name</option>\";\n\t\t\t\twp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories );\n\t\t\t}\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\n}\n\n/**\n * Register a setting and its sanitization callback\n *\n * @since 2.7.0\n * @deprecated 3.0.0 Use register_setting()\n * @see register_setting()\n *\n * @param string $option_group A settings group name. Should correspond to an allowed option key name.\n *                             Default allowed option key names include 'general', 'discussion', 'media',\n *                             'reading', 'writing', 'misc', 'options', and 'privacy'.\n * @param string $option_name The name of an option to sanitize and save.\n * @param callable $sanitize_callback A callback function that sanitizes the option's value.\n */\nfunction add_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'register_setting()' );\n\tregister_setting( $option_group, $option_name, $sanitize_callback );\n}\n\n/**\n * Unregister a setting\n *\n * @since 2.7.0\n * @deprecated 3.0.0 Use unregister_setting()\n * @see unregister_setting()\n *\n * @param string $option_group\n * @param string $option_name\n * @param callable $sanitize_callback\n */\nfunction remove_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'unregister_setting()' );\n\tunregister_setting( $option_group, $option_name, $sanitize_callback );\n}\n\n/**\n * Determines the language to use for CodePress syntax highlighting.\n *\n * @since 2.8.0\n * @deprecated 3.0.0\n *\n * @param string $filename\n**/\nfunction codepress_get_lang( $filename ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0' );\n}\n\n/**\n * Adds JavaScript required to make CodePress work on the theme/plugin editors.\n *\n * @since 2.8.0\n * @deprecated 3.0.0\n**/\nfunction codepress_footer_js() {\n\t_deprecated_function( __FUNCTION__, '3.0.0' );\n}\n\n/**\n * Determine whether to use CodePress.\n *\n * @since 2.8.0\n * @deprecated 3.0.0\n**/\nfunction use_codepress() {\n\t_deprecated_function( __FUNCTION__, '3.0.0' );\n}\n\n/**\n * Get all user IDs.\n *\n * @deprecated 3.1.0 Use get_users()\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @return array List of user IDs.\n */\nfunction get_author_user_ids() {\n\t_deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );\n\n\tglobal $wpdb;\n\tif ( !is_multisite() )\n\t\t$level_key = $wpdb->get_blog_prefix() . 'user_level';\n\telse\n\t\t$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // WPMU site admins don't have user_levels.\n\n\treturn $wpdb->get_col( $wpdb->prepare(\"SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'\", $level_key) );\n}\n\n/**\n * Gets author users who can edit posts.\n *\n * @deprecated 3.1.0 Use get_users()\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int $user_id User ID.\n * @return array|bool List of editable authors. False if no editable users.\n */\nfunction get_editable_authors( $user_id ) {\n\t_deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );\n\n\tglobal $wpdb;\n\n\t$editable = get_editable_user_ids( $user_id );\n\n\tif ( !$editable ) {\n\t\treturn false;\n\t} else {\n\t\t$editable = join(',', $editable);\n\t\t$authors = $wpdb->get_results( \"SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY display_name\" );\n\t}\n\n\treturn apply_filters('get_editable_authors', $authors);\n}\n\n/**\n * Gets the IDs of any users who can edit posts.\n *\n * @deprecated 3.1.0 Use get_users()\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int  $user_id       User ID.\n * @param bool $exclude_zeros Optional. Whether to exclude zeroes. Default true.\n * @return array Array of editable user IDs, empty array otherwise.\n */\nfunction get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'post' ) {\n\t_deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );\n\n\tglobal $wpdb;\n\n\tif ( ! $user = get_userdata( $user_id ) )\n\t\treturn array();\n\t$post_type_obj = get_post_type_object($post_type);\n\n\tif ( ! $user->has_cap($post_type_obj->cap->edit_others_posts) ) {\n\t\tif ( $user->has_cap($post_type_obj->cap->edit_posts) || ! $exclude_zeros )\n\t\t\treturn array($user->ID);\n\t\telse\n\t\t\treturn array();\n\t}\n\n\tif ( !is_multisite() )\n\t\t$level_key = $wpdb->get_blog_prefix() . 'user_level';\n\telse\n\t\t$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // WPMU site admins don't have user_levels.\n\n\t$query = $wpdb->prepare(\"SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s\", $level_key);\n\tif ( $exclude_zeros )\n\t\t$query .= \" AND meta_value != '0'\";\n\n\treturn $wpdb->get_col( $query );\n}\n\n/**\n * Gets all users who are not authors.\n *\n * @deprecated 3.1.0 Use get_users()\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction get_nonauthor_user_ids() {\n\t_deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );\n\n\tglobal $wpdb;\n\n\tif ( !is_multisite() )\n\t\t$level_key = $wpdb->get_blog_prefix() . 'user_level';\n\telse\n\t\t$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // WPMU site admins don't have user_levels.\n\n\treturn $wpdb->get_col( $wpdb->prepare(\"SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'\", $level_key) );\n}\n\nif ( ! class_exists( 'WP_User_Search', false ) ) :\n/**\n * WordPress User Search class.\n *\n * @since 2.1.0\n * @deprecated 3.1.0 Use WP_User_Query\n */\nclass WP_User_Search {\n\n\t/**\n\t * {@internal Missing Description}}\n\t *\n\t * @since 2.1.0\n\t * @access private\n\t * @var mixed\n\t */\n\tvar $results;\n\n\t/**\n\t * {@internal Missing Description}}\n\t *\n\t * @since 2.1.0\n\t * @access private\n\t * @var string\n\t */\n\tvar $search_term;\n\n\t/**\n\t * Page number.\n\t *\n\t * @since 2.1.0\n\t * @access private\n\t * @var int\n\t */\n\tvar $page;\n\n\t/**\n\t * Role name that users have.\n\t *\n\t * @since 2.5.0\n\t * @access private\n\t * @var string\n\t */\n\tvar $role;\n\n\t/**\n\t * Raw page number.\n\t *\n\t * @since 2.1.0\n\t * @access private\n\t * @var int|bool\n\t */\n\tvar $raw_page;\n\n\t/**\n\t * Amount of users to display per page.\n\t *\n\t * @since 2.1.0\n\t * @access public\n\t * @var int\n\t */\n\tvar $users_per_page = 50;\n\n\t/**\n\t * {@internal Missing Description}}\n\t *\n\t * @since 2.1.0\n\t * @access private\n\t * @var int\n\t */\n\tvar $first_user;\n\n\t/**\n\t * {@internal Missing Description}}\n\t *\n\t * @since 2.1.0\n\t * @access private\n\t * @var int\n\t */\n\tvar $last_user;\n\n\t/**\n\t * {@internal Missing Description}}\n\t *\n\t * @since 2.1.0\n\t * @access private\n\t * @var string\n\t */\n\tvar $query_limit;\n\n\t/**\n\t * {@internal Missing Description}}\n\t *\n\t * @since 3.0.0\n\t * @access private\n\t * @var string\n\t */\n\tvar $query_orderby;\n\n\t/**\n\t * {@internal Missing Description}}\n\t *\n\t * @since 3.0.0\n\t * @access private\n\t * @var string\n\t */\n\tvar $query_from;\n\n\t/**\n\t * {@internal Missing Description}}\n\t *\n\t * @since 3.0.0\n\t * @access private\n\t * @var string\n\t */\n\tvar $query_where;\n\n\t/**\n\t * {@internal Missing Description}}\n\t *\n\t * @since 2.1.0\n\t * @access private\n\t * @var int\n\t */\n\tvar $total_users_for_query = 0;\n\n\t/**\n\t * {@internal Missing Description}}\n\t *\n\t * @since 2.1.0\n\t * @access private\n\t * @var bool\n\t */\n\tvar $too_many_total_users = false;\n\n\t/**\n\t * {@internal Missing Description}}\n\t *\n\t * @since 2.1.0\n\t * @access private\n\t * @var WP_Error\n\t */\n\tvar $search_errors;\n\n\t/**\n\t * {@internal Missing Description}}\n\t *\n\t * @since 2.7.0\n\t * @access private\n\t * @var string\n\t */\n\tvar $paging_text;\n\n\t/**\n\t * PHP5 Constructor - Sets up the object properties.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $search_term Search terms string.\n\t * @param int $page Optional. Page ID.\n\t * @param string $role Role name.\n\t * @return WP_User_Search\n\t */\n\tfunction __construct( $search_term = '', $page = '', $role = '' ) {\n\t\t_deprecated_function( __FUNCTION__, '3.1.0', 'WP_User_Query' );\n\n\t\t$this->search_term = wp_unslash( $search_term );\n\t\t$this->raw_page = ( '' == $page ) ? false : (int) $page;\n\t\t$this->page = (int) ( '' == $page ) ? 1 : $page;\n\t\t$this->role = $role;\n\n\t\t$this->prepare_query();\n\t\t$this->query();\n\t\t$this->do_paging();\n\t}\n\n\t/**\n\t * PHP4 Constructor - Sets up the object properties.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $search_term Search terms string.\n\t * @param int $page Optional. Page ID.\n\t * @param string $role Role name.\n\t * @return WP_User_Search\n\t */\n\tpublic function WP_User_Search( $search_term = '', $page = '', $role = '' ) {\n\t\tself::__construct( $search_term, $page, $role );\n\t}\n\n\t/**\n\t * Prepares the user search query (legacy).\n\t *\n\t * @since 2.1.0\n\t * @access public\n\t */\n\tpublic function prepare_query() {\n\t\tglobal $wpdb;\n\t\t$this->first_user = ($this->page - 1) * $this->users_per_page;\n\n\t\t$this->query_limit = $wpdb->prepare(\" LIMIT %d, %d\", $this->first_user, $this->users_per_page);\n\t\t$this->query_orderby = ' ORDER BY user_login';\n\n\t\t$search_sql = '';\n\t\tif ( $this->search_term ) {\n\t\t\t$searches = array();\n\t\t\t$search_sql = 'AND (';\n\t\t\tforeach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col )\n\t\t\t\t$searches[] = $wpdb->prepare( $col . ' LIKE %s', '%' . like_escape($this->search_term) . '%' );\n\t\t\t$search_sql .= implode(' OR ', $searches);\n\t\t\t$search_sql .= ')';\n\t\t}\n\n\t\t$this->query_from = \" FROM $wpdb->users\";\n\t\t$this->query_where = \" WHERE 1=1 $search_sql\";\n\n\t\tif ( $this->role ) {\n\t\t\t$this->query_from .= \" INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id\";\n\t\t\t$this->query_where .= $wpdb->prepare(\" AND $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s\", '%' . $this->role . '%');\n\t\t} elseif ( is_multisite() ) {\n\t\t\t$level_key = $wpdb->prefix . 'capabilities'; // WPMU site admins don't have user_levels.\n\t\t\t$this->query_from .= \", $wpdb->usermeta\";\n\t\t\t$this->query_where .= \" AND $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'\";\n\t\t}\n\n\t\tdo_action_ref_array( 'pre_user_search', array( &$this ) );\n\t}\n\n\t/**\n\t * Executes the user search query.\n\t *\n\t * @since 2.1.0\n\t * @access public\n\t */\n\tpublic function query() {\n\t\tglobal $wpdb;\n\n\t\t$this->results = $wpdb->get_col(\"SELECT DISTINCT($wpdb->users.ID)\" . $this->query_from . $this->query_where . $this->query_orderby . $this->query_limit);\n\n\t\tif ( $this->results )\n\t\t\t$this->total_users_for_query = $wpdb->get_var(\"SELECT COUNT(DISTINCT($wpdb->users.ID))\" . $this->query_from . $this->query_where); // No limit.\n\t\telse\n\t\t\t$this->search_errors = new WP_Error('no_matching_users_found', __('No users found.'));\n\t}\n\n\t/**\n\t * Prepares variables for use in templates.\n\t *\n\t * @since 2.1.0\n\t * @access public\n\t */\n\tfunction prepare_vars_for_template_usage() {}\n\n\t/**\n\t * Handles paging for the user search query.\n\t *\n\t * @since 2.1.0\n\t * @access public\n\t */\n\tpublic function do_paging() {\n\t\tif ( $this->total_users_for_query > $this->users_per_page ) { // Have to page the results.\n\t\t\t$args = array();\n\t\t\tif ( ! empty($this->search_term) )\n\t\t\t\t$args['usersearch'] = urlencode($this->search_term);\n\t\t\tif ( ! empty($this->role) )\n\t\t\t\t$args['role'] = urlencode($this->role);\n\n\t\t\t$this->paging_text = paginate_links( array(\n\t\t\t\t'total' => ceil($this->total_users_for_query / $this->users_per_page),\n\t\t\t\t'current' => $this->page,\n\t\t\t\t'base' => 'users.php?%_%',\n\t\t\t\t'format' => 'userspage=%#%',\n\t\t\t\t'add_args' => $args\n\t\t\t) );\n\t\t\tif ( $this->paging_text ) {\n\t\t\t\t$this->paging_text = sprintf(\n\t\t\t\t\t/* translators: 1: Starting number of users on the current page, 2: Ending number of users, 3: Total number of users. */\n\t\t\t\t\t'<span class=\"displaying-num\">' . __( 'Displaying %1$s&#8211;%2$s of %3$s' ) . '</span>%s',\n\t\t\t\t\tnumber_format_i18n( ( $this->page - 1 ) * $this->users_per_page + 1 ),\n\t\t\t\t\tnumber_format_i18n( min( $this->page * $this->users_per_page, $this->total_users_for_query ) ),\n\t\t\t\t\tnumber_format_i18n( $this->total_users_for_query ),\n\t\t\t\t\t$this->paging_text\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the user search query results.\n\t *\n\t * @since 2.1.0\n\t * @access public\n\t *\n\t * @return array\n\t */\n\tpublic function get_results() {\n\t\treturn (array) $this->results;\n\t}\n\n\t/**\n\t * Displaying paging text.\n\t *\n\t * @see do_paging() Builds paging text.\n\t *\n\t * @since 2.1.0\n\t * @access public\n\t */\n\tfunction page_links() {\n\t\techo $this->paging_text;\n\t}\n\n\t/**\n\t * Whether paging is enabled.\n\t *\n\t * @see do_paging() Builds paging text.\n\t *\n\t * @since 2.1.0\n\t * @access public\n\t *\n\t * @return bool\n\t */\n\tfunction results_are_paged() {\n\t\tif ( $this->paging_text )\n\t\t\treturn true;\n\t\treturn false;\n\t}\n\n\t/**\n\t * Whether there are search terms.\n\t *\n\t * @since 2.1.0\n\t * @access public\n\t *\n\t * @return bool\n\t */\n\tfunction is_search() {\n\t\tif ( $this->search_term )\n\t\t\treturn true;\n\t\treturn false;\n\t}\n}\nendif;\n\n/**\n * Retrieves editable posts from other users.\n *\n * @since 2.3.0\n * @deprecated 3.1.0 Use get_posts()\n * @see get_posts()\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int    $user_id User ID to not retrieve posts from.\n * @param string $type    Optional. Post type to retrieve. Accepts 'draft', 'pending' or 'any' (all).\n *                        Default 'any'.\n * @return array List of posts from others.\n */\nfunction get_others_unpublished_posts( $user_id, $type = 'any' ) {\n\t_deprecated_function( __FUNCTION__, '3.1.0' );\n\n\tglobal $wpdb;\n\n\t$editable = get_editable_user_ids( $user_id );\n\n\tif ( in_array($type, array('draft', 'pending')) )\n\t\t$type_sql = \" post_status = '$type' \";\n\telse\n\t\t$type_sql = \" ( post_status = 'draft' OR post_status = 'pending' ) \";\n\n\t$dir = ( 'pending' == $type ) ? 'ASC' : 'DESC';\n\n\tif ( !$editable ) {\n\t\t$other_unpubs = '';\n\t} else {\n\t\t$editable = join(',', $editable);\n\t\t$other_unpubs = $wpdb->get_results( $wpdb->prepare(\"SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != %d ORDER BY post_modified $dir\", $user_id) );\n\t}\n\n\treturn apply_filters('get_others_drafts', $other_unpubs);\n}\n\n/**\n * Retrieve drafts from other users.\n *\n * @deprecated 3.1.0 Use get_posts()\n * @see get_posts()\n *\n * @param int $user_id User ID.\n * @return array List of drafts from other users.\n */\nfunction get_others_drafts($user_id) {\n\t_deprecated_function( __FUNCTION__, '3.1.0' );\n\n\treturn get_others_unpublished_posts($user_id, 'draft');\n}\n\n/**\n * Retrieve pending review posts from other users.\n *\n * @deprecated 3.1.0 Use get_posts()\n * @see get_posts()\n *\n * @param int $user_id User ID.\n * @return array List of posts with pending review post type from other users.\n */\nfunction get_others_pending($user_id) {\n\t_deprecated_function( __FUNCTION__, '3.1.0' );\n\n\treturn get_others_unpublished_posts($user_id, 'pending');\n}\n\n/**\n * Output the QuickPress dashboard widget.\n *\n * @since 3.0.0\n * @deprecated 3.2.0 Use wp_dashboard_quick_press()\n * @see wp_dashboard_quick_press()\n */\nfunction wp_dashboard_quick_press_output() {\n\t_deprecated_function( __FUNCTION__, '3.2.0', 'wp_dashboard_quick_press()' );\n\twp_dashboard_quick_press();\n}\n\n/**\n * Outputs the TinyMCE editor.\n *\n * @since 2.7.0\n * @deprecated 3.3.0 Use wp_editor()\n * @see wp_editor()\n */\nfunction wp_tiny_mce( $teeny = false, $settings = false ) {\n\t_deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );\n\n\tstatic $num = 1;\n\n\tif ( ! class_exists( '_WP_Editors', false ) )\n\t\trequire_once ABSPATH . WPINC . '/class-wp-editor.php';\n\n\t$editor_id = 'content' . $num++;\n\n\t$set = array(\n\t\t'teeny' => $teeny,\n\t\t'tinymce' => $settings ? $settings : true,\n\t\t'quicktags' => false\n\t);\n\n\t$set = _WP_Editors::parse_settings($editor_id, $set);\n\t_WP_Editors::editor_settings($editor_id, $set);\n}\n\n/**\n * Preloads TinyMCE dialogs.\n *\n * @deprecated 3.3.0 Use wp_editor()\n * @see wp_editor()\n */\nfunction wp_preload_dialogs() {\n\t_deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );\n}\n\n/**\n * Prints TinyMCE editor JS.\n *\n * @deprecated 3.3.0 Use wp_editor()\n * @see wp_editor()\n */\nfunction wp_print_editor_js() {\n\t_deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );\n}\n\n/**\n * Handles quicktags.\n *\n * @deprecated 3.3.0 Use wp_editor()\n * @see wp_editor()\n */\nfunction wp_quicktags() {\n\t_deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );\n}\n\n/**\n * Returns the screen layout options.\n *\n * @since 2.8.0\n * @deprecated 3.3.0 WP_Screen::render_screen_layout()\n * @see WP_Screen::render_screen_layout()\n */\nfunction screen_layout( $screen ) {\n\t_deprecated_function( __FUNCTION__, '3.3.0', '$current_screen->render_screen_layout()' );\n\n\t$current_screen = get_current_screen();\n\n\tif ( ! $current_screen )\n\t\treturn '';\n\n\tob_start();\n\t$current_screen->render_screen_layout();\n\treturn ob_get_clean();\n}\n\n/**\n * Returns the screen's per-page options.\n *\n * @since 2.8.0\n * @deprecated 3.3.0 Use WP_Screen::render_per_page_options()\n * @see WP_Screen::render_per_page_options()\n */\nfunction screen_options( $screen ) {\n\t_deprecated_function( __FUNCTION__, '3.3.0', '$current_screen->render_per_page_options()' );\n\n\t$current_screen = get_current_screen();\n\n\tif ( ! $current_screen )\n\t\treturn '';\n\n\tob_start();\n\t$current_screen->render_per_page_options();\n\treturn ob_get_clean();\n}\n\n/**\n * Renders the screen's help.\n *\n * @since 2.7.0\n * @deprecated 3.3.0 Use WP_Screen::render_screen_meta()\n * @see WP_Screen::render_screen_meta()\n */\nfunction screen_meta( $screen ) {\n\t$current_screen = get_current_screen();\n\t$current_screen->render_screen_meta();\n}\n\n/**\n * Favorite actions were deprecated in version 3.2. Use the admin bar instead.\n *\n * @since 2.7.0\n * @deprecated 3.2.0 Use WP_Admin_Bar\n * @see WP_Admin_Bar\n */\nfunction favorite_actions() {\n\t_deprecated_function( __FUNCTION__, '3.2.0', 'WP_Admin_Bar' );\n}\n\n/**\n * Handles uploading an image.\n *\n * @deprecated 3.3.0 Use wp_media_upload_handler()\n * @see wp_media_upload_handler()\n *\n * @return null|string\n */\nfunction media_upload_image() {\n\t_deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );\n\treturn wp_media_upload_handler();\n}\n\n/**\n * Handles uploading an audio file.\n *\n * @deprecated 3.3.0 Use wp_media_upload_handler()\n * @see wp_media_upload_handler()\n *\n * @return null|string\n */\nfunction media_upload_audio() {\n\t_deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );\n\treturn wp_media_upload_handler();\n}\n\n/**\n * Handles uploading a video file.\n *\n * @deprecated 3.3.0 Use wp_media_upload_handler()\n * @see wp_media_upload_handler()\n *\n * @return null|string\n */\nfunction media_upload_video() {\n\t_deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );\n\treturn wp_media_upload_handler();\n}\n\n/**\n * Handles uploading a generic file.\n *\n * @deprecated 3.3.0 Use wp_media_upload_handler()\n * @see wp_media_upload_handler()\n *\n * @return null|string\n */\nfunction media_upload_file() {\n\t_deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );\n\treturn wp_media_upload_handler();\n}\n\n/**\n * Handles retrieving the insert-from-URL form for an image.\n *\n * @deprecated 3.3.0 Use wp_media_insert_url_form()\n * @see wp_media_insert_url_form()\n *\n * @return string\n */\nfunction type_url_form_image() {\n\t_deprecated_function( __FUNCTION__, '3.3.0', \"wp_media_insert_url_form('image')\" );\n\treturn wp_media_insert_url_form( 'image' );\n}\n\n/**\n * Handles retrieving the insert-from-URL form for an audio file.\n *\n * @deprecated 3.3.0 Use wp_media_insert_url_form()\n * @see wp_media_insert_url_form()\n *\n * @return string\n */\nfunction type_url_form_audio() {\n\t_deprecated_function( __FUNCTION__, '3.3.0', \"wp_media_insert_url_form('audio')\" );\n\treturn wp_media_insert_url_form( 'audio' );\n}\n\n/**\n * Handles retrieving the insert-from-URL form for a video file.\n *\n * @deprecated 3.3.0 Use wp_media_insert_url_form()\n * @see wp_media_insert_url_form()\n *\n * @return string\n */\nfunction type_url_form_video() {\n\t_deprecated_function( __FUNCTION__, '3.3.0', \"wp_media_insert_url_form('video')\" );\n\treturn wp_media_insert_url_form( 'video' );\n}\n\n/**\n * Handles retrieving the insert-from-URL form for a generic file.\n *\n * @deprecated 3.3.0 Use wp_media_insert_url_form()\n * @see wp_media_insert_url_form()\n *\n * @return string\n */\nfunction type_url_form_file() {\n\t_deprecated_function( __FUNCTION__, '3.3.0', \"wp_media_insert_url_form('file')\" );\n\treturn wp_media_insert_url_form( 'file' );\n}\n\n/**\n * Add contextual help text for a page.\n *\n * Creates an 'Overview' help tab.\n *\n * @since 2.7.0\n * @deprecated 3.3.0 Use WP_Screen::add_help_tab()\n * @see WP_Screen::add_help_tab()\n *\n * @param string    $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.\n * @param string    $help   The content of an 'Overview' help tab.\n */\nfunction add_contextual_help( $screen, $help ) {\n\t_deprecated_function( __FUNCTION__, '3.3.0', 'get_current_screen()->add_help_tab()' );\n\n\tif ( is_string( $screen ) )\n\t\t$screen = convert_to_screen( $screen );\n\n\tWP_Screen::add_old_compat_help( $screen, $help );\n}\n\n/**\n * Get the allowed themes for the current site.\n *\n * @since 3.0.0\n * @deprecated 3.4.0 Use wp_get_themes()\n * @see wp_get_themes()\n *\n * @return WP_Theme[] Array of WP_Theme objects keyed by their name.\n */\nfunction get_allowed_themes() {\n\t_deprecated_function( __FUNCTION__, '3.4.0', \"wp_get_themes( array( 'allowed' => true ) )\" );\n\n\t$themes = wp_get_themes( array( 'allowed' => true ) );\n\n\t$wp_themes = array();\n\tforeach ( $themes as $theme ) {\n\t\t$wp_themes[ $theme->get('Name') ] = $theme;\n\t}\n\n\treturn $wp_themes;\n}\n\n/**\n * Retrieves a list of broken themes.\n *\n * @since 1.5.0\n * @deprecated 3.4.0 Use wp_get_themes()\n * @see wp_get_themes()\n *\n * @return array\n */\nfunction get_broken_themes() {\n\t_deprecated_function( __FUNCTION__, '3.4.0', \"wp_get_themes( array( 'errors' => true )\" );\n\n\t$themes = wp_get_themes( array( 'errors' => true ) );\n\t$broken = array();\n\tforeach ( $themes as $theme ) {\n\t\t$name = $theme->get('Name');\n\t\t$broken[ $name ] = array(\n\t\t\t'Name' => $name,\n\t\t\t'Title' => $name,\n\t\t\t'Description' => $theme->errors()->get_error_message(),\n\t\t);\n\t}\n\treturn $broken;\n}\n\n/**\n * Retrieves information on the current active theme.\n *\n * @since 2.0.0\n * @deprecated 3.4.0 Use wp_get_theme()\n * @see wp_get_theme()\n *\n * @return WP_Theme\n */\nfunction current_theme_info() {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme()' );\n\n\treturn wp_get_theme();\n}\n\n/**\n * This was once used to display an 'Insert into Post' button.\n *\n * Now it is deprecated and stubbed.\n *\n * @deprecated 3.5.0\n */\nfunction _insert_into_post_button( $type ) {\n\t_deprecated_function( __FUNCTION__, '3.5.0' );\n}\n\n/**\n * This was once used to display a media button.\n *\n * Now it is deprecated and stubbed.\n *\n * @deprecated 3.5.0\n */\nfunction _media_button($title, $icon, $type, $id) {\n\t_deprecated_function( __FUNCTION__, '3.5.0' );\n}\n\n/**\n * Gets an existing post and format it for editing.\n *\n * @since 2.0.0\n * @deprecated 3.5.0 Use get_post()\n * @see get_post()\n *\n * @param int $id\n * @return object\n */\nfunction get_post_to_edit( $id ) {\n\t_deprecated_function( __FUNCTION__, '3.5.0', 'get_post()' );\n\n\treturn get_post( $id, OBJECT, 'edit' );\n}\n\n/**\n * Gets the default page information to use.\n *\n * @since 2.5.0\n * @deprecated 3.5.0 Use get_default_post_to_edit()\n * @see get_default_post_to_edit()\n *\n * @return WP_Post Post object containing all the default post data as attributes\n */\nfunction get_default_page_to_edit() {\n\t_deprecated_function( __FUNCTION__, '3.5.0', \"get_default_post_to_edit( 'page' )\" );\n\n\t$page = get_default_post_to_edit();\n\t$page->post_type = 'page';\n\treturn $page;\n}\n\n/**\n * This was once used to create a thumbnail from an Image given a maximum side size.\n *\n * @since 1.2.0\n * @deprecated 3.5.0 Use image_resize()\n * @see image_resize()\n *\n * @param mixed $file Filename of the original image, Or attachment ID.\n * @param int $max_side Maximum length of a single side for the thumbnail.\n * @param mixed $deprecated Never used.\n * @return string Thumbnail path on success, Error string on failure.\n */\nfunction wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {\n\t_deprecated_function( __FUNCTION__, '3.5.0', 'image_resize()' );\n\treturn apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) );\n}\n\n/**\n * This was once used to display a meta box for the nav menu theme locations.\n *\n * Deprecated in favor of a 'Manage Locations' tab added to nav menus management screen.\n *\n * @since 3.0.0\n * @deprecated 3.6.0\n */\nfunction wp_nav_menu_locations_meta_box() {\n\t_deprecated_function( __FUNCTION__, '3.6.0' );\n}\n\n/**\n * This was once used to kick-off the Core Updater.\n *\n * Deprecated in favor of instantating a Core_Upgrader instance directly,\n * and calling the 'upgrade' method.\n *\n * @since 2.7.0\n * @deprecated 3.7.0 Use Core_Upgrader\n * @see Core_Upgrader\n */\nfunction wp_update_core($current, $feedback = '') {\n\t_deprecated_function( __FUNCTION__, '3.7.0', 'new Core_Upgrader();' );\n\n\tif ( !empty($feedback) )\n\t\tadd_filter('update_feedback', $feedback);\n\n\trequire ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\t$upgrader = new Core_Upgrader();\n\treturn $upgrader->upgrade($current);\n\n}\n\n/**\n * This was once used to kick-off the Plugin Updater.\n *\n * Deprecated in favor of instantating a Plugin_Upgrader instance directly,\n * and calling the 'upgrade' method.\n * Unused since 2.8.0.\n *\n * @since 2.5.0\n * @deprecated 3.7.0 Use Plugin_Upgrader\n * @see Plugin_Upgrader\n */\nfunction wp_update_plugin($plugin, $feedback = '') {\n\t_deprecated_function( __FUNCTION__, '3.7.0', 'new Plugin_Upgrader();' );\n\n\tif ( !empty($feedback) )\n\t\tadd_filter('update_feedback', $feedback);\n\n\trequire ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\t$upgrader = new Plugin_Upgrader();\n\treturn $upgrader->upgrade($plugin);\n}\n\n/**\n * This was once used to kick-off the Theme Updater.\n *\n * Deprecated in favor of instantiating a Theme_Upgrader instance directly,\n * and calling the 'upgrade' method.\n * Unused since 2.8.0.\n *\n * @since 2.7.0\n * @deprecated 3.7.0 Use Theme_Upgrader\n * @see Theme_Upgrader\n */\nfunction wp_update_theme($theme, $feedback = '') {\n\t_deprecated_function( __FUNCTION__, '3.7.0', 'new Theme_Upgrader();' );\n\n\tif ( !empty($feedback) )\n\t\tadd_filter('update_feedback', $feedback);\n\n\trequire ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\t$upgrader = new Theme_Upgrader();\n\treturn $upgrader->upgrade($theme);\n}\n\n/**\n * This was once used to display attachment links. Now it is deprecated and stubbed.\n *\n * @since 2.0.0\n * @deprecated 3.7.0\n *\n * @param int|bool $id\n */\nfunction the_attachment_links( $id = false ) {\n\t_deprecated_function( __FUNCTION__, '3.7.0' );\n}\n\n/**\n * Displays a screen icon.\n *\n * @since 2.7.0\n * @deprecated 3.8.0\n */\nfunction screen_icon() {\n\t_deprecated_function( __FUNCTION__, '3.8.0' );\n\techo get_screen_icon();\n}\n\n/**\n * Retrieves the screen icon (no longer used in 3.8+).\n *\n * @since 3.2.0\n * @deprecated 3.8.0\n *\n * @return string An HTML comment explaining that icons are no longer used.\n */\nfunction get_screen_icon() {\n\t_deprecated_function( __FUNCTION__, '3.8.0' );\n\treturn '<!-- Screen icons are no longer used as of WordPress 3.8. -->';\n}\n\n/**\n * Deprecated dashboard widget controls.\n *\n * @since 2.5.0\n * @deprecated 3.8.0\n */\nfunction wp_dashboard_incoming_links_output() {}\n\n/**\n * Deprecated dashboard secondary output.\n *\n * @deprecated 3.8.0\n */\nfunction wp_dashboard_secondary_output() {}\n\n/**\n * Deprecated dashboard widget controls.\n *\n * @since 2.7.0\n * @deprecated 3.8.0\n */\nfunction wp_dashboard_incoming_links() {}\n\n/**\n * Deprecated dashboard incoming links control.\n *\n * @deprecated 3.8.0\n */\nfunction wp_dashboard_incoming_links_control() {}\n\n/**\n * Deprecated dashboard plugins control.\n *\n * @deprecated 3.8.0\n */\nfunction wp_dashboard_plugins() {}\n\n/**\n * Deprecated dashboard primary control.\n *\n * @deprecated 3.8.0\n */\nfunction wp_dashboard_primary_control() {}\n\n/**\n * Deprecated dashboard recent comments control.\n *\n * @deprecated 3.8.0\n */\nfunction wp_dashboard_recent_comments_control() {}\n\n/**\n * Deprecated dashboard secondary section.\n *\n * @deprecated 3.8.0\n */\nfunction wp_dashboard_secondary() {}\n\n/**\n * Deprecated dashboard secondary control.\n *\n * @deprecated 3.8.0\n */\nfunction wp_dashboard_secondary_control() {}\n\n/**\n * Display plugins text for the WordPress news widget.\n *\n * @since 2.5.0\n * @deprecated 4.8.0\n *\n * @param string $rss  The RSS feed URL.\n * @param array  $args Array of arguments for this RSS feed.\n */\nfunction wp_dashboard_plugins_output( $rss, $args = array() ) {\n\t_deprecated_function( __FUNCTION__, '4.8.0' );\n\n\t// Plugin feeds plus link to install them.\n\t$popular = fetch_feed( $args['url']['popular'] );\n\n\tif ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {\n\t\t$plugin_slugs = array_keys( get_plugins() );\n\t\tset_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS );\n\t}\n\n\techo '<ul>';\n\n\tforeach ( array( $popular ) as $feed ) {\n\t\tif ( is_wp_error( $feed ) || ! $feed->get_item_quantity() )\n\t\t\tcontinue;\n\n\t\t$items = $feed->get_items(0, 5);\n\n\t\t// Pick a random, non-installed plugin.\n\t\twhile ( true ) {\n\t\t\t// Abort this foreach loop iteration if there's no plugins left of this type.\n\t\t\tif ( 0 === count($items) )\n\t\t\t\tcontinue 2;\n\n\t\t\t$item_key = array_rand($items);\n\t\t\t$item = $items[$item_key];\n\n\t\t\tlist($link, $frag) = explode( '#', $item->get_link() );\n\n\t\t\t$link = esc_url($link);\n\t\t\tif ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) )\n\t\t\t\t$slug = $matches[1];\n\t\t\telse {\n\t\t\t\tunset( $items[$item_key] );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Is this random plugin's slug already installed? If so, try again.\n\t\t\treset( $plugin_slugs );\n\t\t\tforeach ( $plugin_slugs as $plugin_slug ) {\n\t\t\t\tif ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) {\n\t\t\t\t\tunset( $items[$item_key] );\n\t\t\t\t\tcontinue 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we get to this point, then the random plugin isn't installed and we can stop the while().\n\t\t\tbreak;\n\t\t}\n\n\t\t// Eliminate some common badly formed plugin descriptions.\n\t\twhile ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) )\n\t\t\tunset($items[$item_key]);\n\n\t\tif ( !isset($items[$item_key]) )\n\t\t\tcontinue;\n\n\t\t$raw_title = $item->get_title();\n\n\t\t$ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . '&amp;TB_iframe=true&amp;width=600&amp;height=800';\n\t\techo '<li class=\"dashboard-news-plugin\"><span>' . __( 'Popular Plugin' ) . ':</span> ' . esc_html( $raw_title ) .\n\t\t\t'&nbsp;<a href=\"' . $ilink . '\" class=\"thickbox open-plugin-details-modal\" aria-label=\"' .\n\t\t\t/* translators: %s: Plugin name. */\n\t\t\tesc_attr( sprintf( _x( 'Install %s', 'plugin' ), $raw_title ) ) . '\">(' . __( 'Install' ) . ')</a></li>';\n\n\t\t$feed->__destruct();\n\t\tunset( $feed );\n\t}\n\n\techo '</ul>';\n}\n\n/**\n * This was once used to move child posts to a new parent.\n *\n * @since 2.3.0\n * @deprecated 3.9.0\n * @access private\n *\n * @param int $old_ID\n * @param int $new_ID\n */\nfunction _relocate_children( $old_ID, $new_ID ) {\n\t_deprecated_function( __FUNCTION__, '3.9.0' );\n}\n\n/**\n * Add a top-level menu page in the 'objects' section.\n *\n * This function takes a capability which will be used to determine whether\n * or not a page is included in the menu.\n *\n * The function which is hooked in to handle the output of the page must check\n * that the user has the required capability as well.\n *\n * @since 2.7.0\n *\n * @deprecated 4.5.0 Use add_menu_page()\n * @see add_menu_page()\n * @global int $_wp_last_object_menu\n *\n * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.\n * @param string   $menu_title The text to be used for the menu.\n * @param string   $capability The capability required for this menu to be displayed to the user.\n * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).\n * @param callable $function   The function to be called to output the content for this page.\n * @param string   $icon_url   The url to the icon to be used for this menu.\n * @return string The resulting page's hook_suffix.\n */\nfunction add_object_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {\n\t_deprecated_function( __FUNCTION__, '4.5.0', 'add_menu_page()' );\n\n\tglobal $_wp_last_object_menu;\n\n\t$_wp_last_object_menu++;\n\n\treturn add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_object_menu);\n}\n\n/**\n * Add a top-level menu page in the 'utility' section.\n *\n * This function takes a capability which will be used to determine whether\n * or not a page is included in the menu.\n *\n * The function which is hooked in to handle the output of the page must check\n * that the user has the required capability as well.\n *\n * @since 2.7.0\n *\n * @deprecated 4.5.0 Use add_menu_page()\n * @see add_menu_page()\n * @global int $_wp_last_utility_menu\n *\n * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.\n * @param string   $menu_title The text to be used for the menu.\n * @param string   $capability The capability required for this menu to be displayed to the user.\n * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).\n * @param callable $function   The function to be called to output the content for this page.\n * @param string   $icon_url   The url to the icon to be used for this menu.\n * @return string The resulting page's hook_suffix.\n */\nfunction add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {\n\t_deprecated_function( __FUNCTION__, '4.5.0', 'add_menu_page()' );\n\n\tglobal $_wp_last_utility_menu;\n\n\t$_wp_last_utility_menu++;\n\n\treturn add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_utility_menu);\n}\n\n/**\n * Disables autocomplete on the 'post' form (Add/Edit Post screens) for WebKit browsers,\n * as they disregard the autocomplete setting on the editor textarea. That can break the editor\n * when the user navigates to it with the browser's Back button. See #28037\n *\n * Replaced with wp_page_reload_on_back_button_js() that also fixes this problem.\n *\n * @since 4.0.0\n * @deprecated 4.6.0\n *\n * @link https://core.trac.wordpress.org/ticket/35852\n *\n * @global bool $is_safari\n * @global bool $is_chrome\n */\nfunction post_form_autocomplete_off() {\n\tglobal $is_safari, $is_chrome;\n\n\t_deprecated_function( __FUNCTION__, '4.6.0' );\n\n\tif ( $is_safari || $is_chrome ) {\n\t\techo ' autocomplete=\"off\"';\n\t}\n}\n\n/**\n * Display JavaScript on the page.\n *\n * @since 3.5.0\n * @deprecated 4.9.0\n */\nfunction options_permalink_add_js() {\n\t?>\n\t<script type=\"text/javascript\">\n\t\tjQuery(document).ready(function() {\n\t\t\tjQuery('.permalink-structure input:radio').change(function() {\n\t\t\t\tif ( 'custom' == this.value )\n\t\t\t\t\treturn;\n\t\t\t\tjQuery('#permalink_structure').val( this.value );\n\t\t\t});\n\t\t\tjQuery( '#permalink_structure' ).on( 'click input', function() {\n\t\t\t\tjQuery( '#custom_selection' ).prop( 'checked', true );\n\t\t\t});\n\t\t});\n\t</script>\n\t<?php\n}\n\n/**\n * Previous class for list table for privacy data export requests.\n *\n * @since 4.9.6\n * @deprecated 5.3.0\n */\nclass WP_Privacy_Data_Export_Requests_Table extends WP_Privacy_Data_Export_Requests_List_Table {\n\tfunction __construct( $args ) {\n\t\t_deprecated_function( __CLASS__, '5.3.0', 'WP_Privacy_Data_Export_Requests_List_Table' );\n\n\t\tif ( ! isset( $args['screen'] ) || $args['screen'] === 'export_personal_data' ) {\n\t\t\t$args['screen'] = 'export-personal-data';\n\t\t}\n\n\t\tparent::__construct( $args );\n\t}\n}\n\n/**\n * Previous class for list table for privacy data erasure requests.\n *\n * @since 4.9.6\n * @deprecated 5.3.0\n */\nclass WP_Privacy_Data_Removal_Requests_Table extends WP_Privacy_Data_Removal_Requests_List_Table {\n\tfunction __construct( $args ) {\n\t\t_deprecated_function( __CLASS__, '5.3.0', 'WP_Privacy_Data_Removal_Requests_List_Table' );\n\n\t\tif ( ! isset( $args['screen'] ) || $args['screen'] === 'remove_personal_data' ) {\n\t\t\t$args['screen'] = 'erase-personal-data';\n\t\t}\n\n\t\tparent::__construct( $args );\n\t}\n}\n\n/**\n * Was used to add options for the privacy requests screens before they were separate files.\n *\n * @since 4.9.8\n * @access private\n * @deprecated 5.3.0\n */\nfunction _wp_privacy_requests_screen_options() {\n\t_deprecated_function( __FUNCTION__, '5.3.0' );\n}\n", "num_lines": 1565}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit Tags Administration: Messages\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.4.0\n */\n\n$messages = array();\n// 0 = unused. Messages start at index 1.\n$messages['_item'] = array(\n\t0 => '',\n\t1 => __( 'Item added.' ),\n\t2 => __( 'Item deleted.' ),\n\t3 => __( 'Item updated.' ),\n\t4 => __( 'Item not added.' ),\n\t5 => __( 'Item not updated.' ),\n\t6 => __( 'Items deleted.' ),\n);\n\n$messages['category'] = array(\n\t0 => '',\n\t1 => __( 'Category added.' ),\n\t2 => __( 'Category deleted.' ),\n\t3 => __( 'Category updated.' ),\n\t4 => __( 'Category not added.' ),\n\t5 => __( 'Category not updated.' ),\n\t6 => __( 'Categories deleted.' ),\n);\n\n$messages['post_tag'] = array(\n\t0 => '',\n\t1 => __( 'Tag added.' ),\n\t2 => __( 'Tag deleted.' ),\n\t3 => __( 'Tag updated.' ),\n\t4 => __( 'Tag not added.' ),\n\t5 => __( 'Tag not updated.' ),\n\t6 => __( 'Tags deleted.' ),\n);\n\n/**\n * Filters the messages displayed when a tag is updated.\n *\n * @since 3.7.0\n *\n * @param array $messages The messages to be displayed.\n */\n$messages = apply_filters( 'term_updated_messages', $messages );\n\n$message = false;\nif ( isset( $_REQUEST['message'] ) && (int) $_REQUEST['message'] ) {\n\t$msg = (int) $_REQUEST['message'];\n\tif ( isset( $messages[ $taxonomy ][ $msg ] ) ) {\n\t\t$message = $messages[ $taxonomy ][ $msg ];\n\t} elseif ( ! isset( $messages[ $taxonomy ] ) && isset( $messages['_item'][ $msg ] ) ) {\n\t\t$message = $messages['_item'][ $msg ];\n\t}\n}\n", "num_lines": 60}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Export Administration API\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Version number for the export format.\n *\n * Bump this when something changes that might affect compatibility.\n *\n * @since 2.5.0\n */\ndefine( 'WXR_VERSION', '1.2' );\n\n/**\n * Generates the WXR export file for download.\n *\n * Default behavior is to export all content, however, note that post content will only\n * be exported for post types with the `can_export` argument enabled. Any posts with the\n * 'auto-draft' status will be skipped.\n *\n * @since 2.1.0\n *\n * @global wpdb    $wpdb WordPress database abstraction object.\n * @global WP_Post $post Global post object.\n *\n * @param array $args {\n *     Optional. Arguments for generating the WXR export file for download. Default empty array.\n *\n *     @type string $content        Type of content to export. If set, only the post content of this post type\n *                                  will be exported. Accepts 'all', 'post', 'page', 'attachment', or a defined\n *                                  custom post. If an invalid custom post type is supplied, every post type for\n *                                  which `can_export` is enabled will be exported instead. If a valid custom post\n *                                  type is supplied but `can_export` is disabled, then 'posts' will be exported\n *                                  instead. When 'all' is supplied, only post types with `can_export` enabled will\n *                                  be exported. Default 'all'.\n *     @type string $author         Author to export content for. Only used when `$content` is 'post', 'page', or\n *                                  'attachment'. Accepts false (all) or a specific author ID. Default false (all).\n *     @type string $category       Category (slug) to export content for. Used only when `$content` is 'post'. If\n *                                  set, only post content assigned to `$category` will be exported. Accepts false\n *                                  or a specific category slug. Default is false (all categories).\n *     @type string $start_date     Start date to export content from. Expected date format is 'Y-m-d'. Used only\n *                                  when `$content` is 'post', 'page' or 'attachment'. Default false (since the\n *                                  beginning of time).\n *     @type string $end_date       End date to export content to. Expected date format is 'Y-m-d'. Used only when\n *                                  `$content` is 'post', 'page' or 'attachment'. Default false (latest publish date).\n *     @type string $status         Post status to export posts for. Used only when `$content` is 'post' or 'page'.\n *                                  Accepts false (all statuses except 'auto-draft'), or a specific status, i.e.\n *                                  'publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit', or\n *                                  'trash'. Default false (all statuses except 'auto-draft').\n * }\n */\nfunction export_wp( $args = array() ) {\n\tglobal $wpdb, $post;\n\n\t$defaults = array(\n\t\t'content'    => 'all',\n\t\t'author'     => false,\n\t\t'category'   => false,\n\t\t'start_date' => false,\n\t\t'end_date'   => false,\n\t\t'status'     => false,\n\t);\n\t$args     = wp_parse_args( $args, $defaults );\n\n\t/**\n\t * Fires at the beginning of an export, before any headers are sent.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param array $args An array of export arguments.\n\t */\n\tdo_action( 'export_wp', $args );\n\n\t$sitename = sanitize_key( get_bloginfo( 'name' ) );\n\tif ( ! empty( $sitename ) ) {\n\t\t$sitename .= '.';\n\t}\n\t$date        = gmdate( 'Y-m-d' );\n\t$wp_filename = $sitename . 'WordPress.' . $date . '.xml';\n\t/**\n\t * Filters the export filename.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $wp_filename The name of the file for download.\n\t * @param string $sitename    The site name.\n\t * @param string $date        Today's date, formatted.\n\t */\n\t$filename = apply_filters( 'export_wp_filename', $wp_filename, $sitename, $date );\n\n\theader( 'Content-Description: File Transfer' );\n\theader( 'Content-Disposition: attachment; filename=' . $filename );\n\theader( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );\n\n\tif ( 'all' !== $args['content'] && post_type_exists( $args['content'] ) ) {\n\t\t$ptype = get_post_type_object( $args['content'] );\n\t\tif ( ! $ptype->can_export ) {\n\t\t\t$args['content'] = 'post';\n\t\t}\n\n\t\t$where = $wpdb->prepare( \"{$wpdb->posts}.post_type = %s\", $args['content'] );\n\t} else {\n\t\t$post_types = get_post_types( array( 'can_export' => true ) );\n\t\t$esses      = array_fill( 0, count( $post_types ), '%s' );\n\n\t\t// phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare\n\t\t$where = $wpdb->prepare( \"{$wpdb->posts}.post_type IN (\" . implode( ',', $esses ) . ')', $post_types );\n\t}\n\n\tif ( $args['status'] && ( 'post' === $args['content'] || 'page' === $args['content'] ) ) {\n\t\t$where .= $wpdb->prepare( \" AND {$wpdb->posts}.post_status = %s\", $args['status'] );\n\t} else {\n\t\t$where .= \" AND {$wpdb->posts}.post_status != 'auto-draft'\";\n\t}\n\n\t$join = '';\n\tif ( $args['category'] && 'post' === $args['content'] ) {\n\t\t$term = term_exists( $args['category'], 'category' );\n\t\tif ( $term ) {\n\t\t\t$join   = \"INNER JOIN {$wpdb->term_relationships} ON ({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id)\";\n\t\t\t$where .= $wpdb->prepare( \" AND {$wpdb->term_relationships}.term_taxonomy_id = %d\", $term['term_taxonomy_id'] );\n\t\t}\n\t}\n\n\tif ( in_array( $args['content'], array( 'post', 'page', 'attachment' ), true ) ) {\n\t\tif ( $args['author'] ) {\n\t\t\t$where .= $wpdb->prepare( \" AND {$wpdb->posts}.post_author = %d\", $args['author'] );\n\t\t}\n\n\t\tif ( $args['start_date'] ) {\n\t\t\t$where .= $wpdb->prepare( \" AND {$wpdb->posts}.post_date >= %s\", gmdate( 'Y-m-d', strtotime( $args['start_date'] ) ) );\n\t\t}\n\n\t\tif ( $args['end_date'] ) {\n\t\t\t$where .= $wpdb->prepare( \" AND {$wpdb->posts}.post_date < %s\", gmdate( 'Y-m-d', strtotime( '+1 month', strtotime( $args['end_date'] ) ) ) );\n\t\t}\n\t}\n\n\t// Grab a snapshot of post IDs, just in case it changes during the export.\n\t$post_ids = $wpdb->get_col( \"SELECT ID FROM {$wpdb->posts} $join WHERE $where\" );\n\n\t/*\n\t * Get the requested terms ready, empty unless posts filtered by category\n\t * or all content.\n\t */\n\t$cats  = array();\n\t$tags  = array();\n\t$terms = array();\n\tif ( isset( $term ) && $term ) {\n\t\t$cat  = get_term( $term['term_id'], 'category' );\n\t\t$cats = array( $cat->term_id => $cat );\n\t\tunset( $term, $cat );\n\t} elseif ( 'all' === $args['content'] ) {\n\t\t$categories = (array) get_categories( array( 'get' => 'all' ) );\n\t\t$tags       = (array) get_tags( array( 'get' => 'all' ) );\n\n\t\t$custom_taxonomies = get_taxonomies( array( '_builtin' => false ) );\n\t\t$custom_terms      = (array) get_terms(\n\t\t\tarray(\n\t\t\t\t'taxonomy' => $custom_taxonomies,\n\t\t\t\t'get'      => 'all',\n\t\t\t)\n\t\t);\n\n\t\t// Put categories in order with no child going before its parent.\n\t\twhile ( $cat = array_shift( $categories ) ) {\n\t\t\tif ( 0 == $cat->parent || isset( $cats[ $cat->parent ] ) ) {\n\t\t\t\t$cats[ $cat->term_id ] = $cat;\n\t\t\t} else {\n\t\t\t\t$categories[] = $cat;\n\t\t\t}\n\t\t}\n\n\t\t// Put terms in order with no child going before its parent.\n\t\twhile ( $t = array_shift( $custom_terms ) ) {\n\t\t\tif ( 0 == $t->parent || isset( $terms[ $t->parent ] ) ) {\n\t\t\t\t$terms[ $t->term_id ] = $t;\n\t\t\t} else {\n\t\t\t\t$custom_terms[] = $t;\n\t\t\t}\n\t\t}\n\n\t\tunset( $categories, $custom_taxonomies, $custom_terms );\n\t}\n\n\t/**\n\t * Wrap given string in XML CDATA tag.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $str String to wrap in XML CDATA tag.\n\t * @return string\n\t */\n\tfunction wxr_cdata( $str ) {\n\t\tif ( ! seems_utf8( $str ) ) {\n\t\t\t$str = utf8_encode( $str );\n\t\t}\n\t\t// $str = ent2ncr(esc_html($str));\n\t\t$str = '<![CDATA[' . str_replace( ']]>', ']]]]><![CDATA[>', $str ) . ']]>';\n\n\t\treturn $str;\n\t}\n\n\t/**\n\t * Return the URL of the site\n\t *\n\t * @since 2.5.0\n\t *\n\t * @return string Site URL.\n\t */\n\tfunction wxr_site_url() {\n\t\tif ( is_multisite() ) {\n\t\t\t// Multisite: the base URL.\n\t\t\treturn network_home_url();\n\t\t} else {\n\t\t\t// WordPress (single site): the blog URL.\n\t\t\treturn get_bloginfo_rss( 'url' );\n\t\t}\n\t}\n\n\t/**\n\t * Output a cat_name XML tag from a given category object\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param object $category Category Object\n\t */\n\tfunction wxr_cat_name( $category ) {\n\t\tif ( empty( $category->name ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo '<wp:cat_name>' . wxr_cdata( $category->name ) . \"</wp:cat_name>\\n\";\n\t}\n\n\t/**\n\t * Output a category_description XML tag from a given category object\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param object $category Category Object\n\t */\n\tfunction wxr_category_description( $category ) {\n\t\tif ( empty( $category->description ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo '<wp:category_description>' . wxr_cdata( $category->description ) . \"</wp:category_description>\\n\";\n\t}\n\n\t/**\n\t * Output a tag_name XML tag from a given tag object\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param object $tag Tag Object\n\t */\n\tfunction wxr_tag_name( $tag ) {\n\t\tif ( empty( $tag->name ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo '<wp:tag_name>' . wxr_cdata( $tag->name ) . \"</wp:tag_name>\\n\";\n\t}\n\n\t/**\n\t * Output a tag_description XML tag from a given tag object\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param object $tag Tag Object\n\t */\n\tfunction wxr_tag_description( $tag ) {\n\t\tif ( empty( $tag->description ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo '<wp:tag_description>' . wxr_cdata( $tag->description ) . \"</wp:tag_description>\\n\";\n\t}\n\n\t/**\n\t * Output a term_name XML tag from a given term object\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param object $term Term Object\n\t */\n\tfunction wxr_term_name( $term ) {\n\t\tif ( empty( $term->name ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo '<wp:term_name>' . wxr_cdata( $term->name ) . \"</wp:term_name>\\n\";\n\t}\n\n\t/**\n\t * Output a term_description XML tag from a given term object\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param object $term Term Object\n\t */\n\tfunction wxr_term_description( $term ) {\n\t\tif ( empty( $term->description ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo \"\\t\\t<wp:term_description>\" . wxr_cdata( $term->description ) . \"</wp:term_description>\\n\";\n\t}\n\n\t/**\n\t * Output term meta XML tags for a given term object.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param WP_Term $term Term object.\n\t */\n\tfunction wxr_term_meta( $term ) {\n\t\tglobal $wpdb;\n\n\t\t$termmeta = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM $wpdb->termmeta WHERE term_id = %d\", $term->term_id ) );\n\n\t\tforeach ( $termmeta as $meta ) {\n\t\t\t/**\n\t\t\t * Filters whether to selectively skip term meta used for WXR exports.\n\t\t\t *\n\t\t\t * Returning a truthy value from the filter will skip the current meta\n\t\t\t * object from being exported.\n\t\t\t *\n\t\t\t * @since 4.6.0\n\t\t\t *\n\t\t\t * @param bool   $skip     Whether to skip the current piece of term meta. Default false.\n\t\t\t * @param string $meta_key Current meta key.\n\t\t\t * @param object $meta     Current meta object.\n\t\t\t */\n\t\t\tif ( ! apply_filters( 'wxr_export_skip_termmeta', false, $meta->meta_key, $meta ) ) {\n\t\t\t\tprintf( \"\\t\\t<wp:termmeta>\\n\\t\\t\\t<wp:meta_key>%s</wp:meta_key>\\n\\t\\t\\t<wp:meta_value>%s</wp:meta_value>\\n\\t\\t</wp:termmeta>\\n\", wxr_cdata( $meta->meta_key ), wxr_cdata( $meta->meta_value ) );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Output list of authors with posts\n\t *\n\t * @since 3.1.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param int[] $post_ids Optional. Array of post IDs to filter the query by.\n\t */\n\tfunction wxr_authors_list( array $post_ids = null ) {\n\t\tglobal $wpdb;\n\n\t\tif ( ! empty( $post_ids ) ) {\n\t\t\t$post_ids = array_map( 'absint', $post_ids );\n\t\t\t$and      = 'AND ID IN ( ' . implode( ', ', $post_ids ) . ')';\n\t\t} else {\n\t\t\t$and = '';\n\t\t}\n\n\t\t$authors = array();\n\t\t$results = $wpdb->get_results( \"SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status != 'auto-draft' $and\" );\n\t\tforeach ( (array) $results as $result ) {\n\t\t\t$authors[] = get_userdata( $result->post_author );\n\t\t}\n\n\t\t$authors = array_filter( $authors );\n\n\t\tforeach ( $authors as $author ) {\n\t\t\techo \"\\t<wp:author>\";\n\t\t\techo '<wp:author_id>' . intval( $author->ID ) . '</wp:author_id>';\n\t\t\techo '<wp:author_login>' . wxr_cdata( $author->user_login ) . '</wp:author_login>';\n\t\t\techo '<wp:author_email>' . wxr_cdata( $author->user_email ) . '</wp:author_email>';\n\t\t\techo '<wp:author_display_name>' . wxr_cdata( $author->display_name ) . '</wp:author_display_name>';\n\t\t\techo '<wp:author_first_name>' . wxr_cdata( $author->first_name ) . '</wp:author_first_name>';\n\t\t\techo '<wp:author_last_name>' . wxr_cdata( $author->last_name ) . '</wp:author_last_name>';\n\t\t\techo \"</wp:author>\\n\";\n\t\t}\n\t}\n\n\t/**\n\t * Output all navigation menu terms\n\t *\n\t * @since 3.1.0\n\t */\n\tfunction wxr_nav_menu_terms() {\n\t\t$nav_menus = wp_get_nav_menus();\n\t\tif ( empty( $nav_menus ) || ! is_array( $nav_menus ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $nav_menus as $menu ) {\n\t\t\techo \"\\t<wp:term>\";\n\t\t\techo '<wp:term_id>' . intval( $menu->term_id ) . '</wp:term_id>';\n\t\t\techo '<wp:term_taxonomy>nav_menu</wp:term_taxonomy>';\n\t\t\techo '<wp:term_slug>' . wxr_cdata( $menu->slug ) . '</wp:term_slug>';\n\t\t\twxr_term_name( $menu );\n\t\t\techo \"</wp:term>\\n\";\n\t\t}\n\t}\n\n\t/**\n\t * Output list of taxonomy terms, in XML tag format, associated with a post\n\t *\n\t * @since 2.3.0\n\t */\n\tfunction wxr_post_taxonomy() {\n\t\t$post = get_post();\n\n\t\t$taxonomies = get_object_taxonomies( $post->post_type );\n\t\tif ( empty( $taxonomies ) ) {\n\t\t\treturn;\n\t\t}\n\t\t$terms = wp_get_object_terms( $post->ID, $taxonomies );\n\n\t\tforeach ( (array) $terms as $term ) {\n\t\t\techo \"\\t\\t<category domain=\\\"{$term->taxonomy}\\\" nicename=\\\"{$term->slug}\\\">\" . wxr_cdata( $term->name ) . \"</category>\\n\";\n\t\t}\n\t}\n\n\t/**\n\t * @param bool   $return_me\n\t * @param string $meta_key\n\t * @return bool\n\t */\n\tfunction wxr_filter_postmeta( $return_me, $meta_key ) {\n\t\tif ( '_edit_lock' === $meta_key ) {\n\t\t\t$return_me = true;\n\t\t}\n\t\treturn $return_me;\n\t}\n\tadd_filter( 'wxr_export_skip_postmeta', 'wxr_filter_postmeta', 10, 2 );\n\n\techo '<?xml version=\"1.0\" encoding=\"' . get_bloginfo( 'charset' ) . \"\\\" ?>\\n\";\n\n\t?>\n<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->\n<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->\n<!-- You may use this file to transfer that content from one site to another. -->\n<!-- This file is not intended to serve as a complete backup of your site. -->\n\n<!-- To import this information into a WordPress site follow these steps: -->\n<!-- 1. Log in to that site as an administrator. -->\n<!-- 2. Go to Tools: Import in the WordPress admin panel. -->\n<!-- 3. Install the \"WordPress\" importer from the list. -->\n<!-- 4. Activate & Run Importer. -->\n<!-- 5. Upload this file using the form provided on that page. -->\n<!-- 6. You will first be asked to map the authors in this export file to users -->\n<!--    on the site. For each author, you may choose to map to an -->\n<!--    existing user on the site or to create a new user. -->\n<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->\n<!--    contained in this file into your site. -->\n\n\t<?php the_generator( 'export' ); ?>\n<rss version=\"2.0\"\n\txmlns:excerpt=\"http://wordpress.org/export/<?php echo WXR_VERSION; ?>/excerpt/\"\n\txmlns:content=\"http://purl.org/rss/1.0/modules/content/\"\n\txmlns:wfw=\"http://wellformedweb.org/CommentAPI/\"\n\txmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n\txmlns:wp=\"http://wordpress.org/export/<?php echo WXR_VERSION; ?>/\"\n>\n\n<channel>\n\t<title><?php bloginfo_rss( 'name' ); ?></title>\n\t<link><?php bloginfo_rss( 'url' ); ?></link>\n\t<description><?php bloginfo_rss( 'description' ); ?></description>\n\t<pubDate><?php echo gmdate( 'D, d M Y H:i:s +0000' ); ?></pubDate>\n\t<language><?php bloginfo_rss( 'language' ); ?></language>\n\t<wp:wxr_version><?php echo WXR_VERSION; ?></wp:wxr_version>\n\t<wp:base_site_url><?php echo wxr_site_url(); ?></wp:base_site_url>\n\t<wp:base_blog_url><?php bloginfo_rss( 'url' ); ?></wp:base_blog_url>\n\n\t<?php wxr_authors_list( $post_ids ); ?>\n\n\t<?php foreach ( $cats as $c ) : ?>\n\t<wp:category>\n\t\t<wp:term_id><?php echo intval( $c->term_id ); ?></wp:term_id>\n\t\t<wp:category_nicename><?php echo wxr_cdata( $c->slug ); ?></wp:category_nicename>\n\t\t<wp:category_parent><?php echo wxr_cdata( $c->parent ? $cats[ $c->parent ]->slug : '' ); ?></wp:category_parent>\n\t\t<?php\n\t\twxr_cat_name( $c );\n\t\twxr_category_description( $c );\n\t\twxr_term_meta( $c );\n\t\t?>\n\t</wp:category>\n\t<?php endforeach; ?>\n\t<?php foreach ( $tags as $t ) : ?>\n\t<wp:tag>\n\t\t<wp:term_id><?php echo intval( $t->term_id ); ?></wp:term_id>\n\t\t<wp:tag_slug><?php echo wxr_cdata( $t->slug ); ?></wp:tag_slug>\n\t\t<?php\n\t\twxr_tag_name( $t );\n\t\twxr_tag_description( $t );\n\t\twxr_term_meta( $t );\n\t\t?>\n\t</wp:tag>\n\t<?php endforeach; ?>\n\t<?php foreach ( $terms as $t ) : ?>\n\t<wp:term>\n\t\t<wp:term_id><?php echo intval( $t->term_id ); ?></wp:term_id>\n\t\t<wp:term_taxonomy><?php echo wxr_cdata( $t->taxonomy ); ?></wp:term_taxonomy>\n\t\t<wp:term_slug><?php echo wxr_cdata( $t->slug ); ?></wp:term_slug>\n\t\t<wp:term_parent><?php echo wxr_cdata( $t->parent ? $terms[ $t->parent ]->slug : '' ); ?></wp:term_parent>\n\t\t<?php\n\t\twxr_term_name( $t );\n\t\twxr_term_description( $t );\n\t\twxr_term_meta( $t );\n\t\t?>\n\t</wp:term>\n\t<?php endforeach; ?>\n\t<?php\n\tif ( 'all' === $args['content'] ) {\n\t\twxr_nav_menu_terms();}\n\t?>\n\n\t<?php\n\t/** This action is documented in wp-includes/feed-rss2.php */\n\tdo_action( 'rss2_head' );\n\t?>\n\n\t<?php\n\tif ( $post_ids ) {\n\t\t/**\n\t\t * @global WP_Query $wp_query WordPress Query object.\n\t\t */\n\t\tglobal $wp_query;\n\n\t\t// Fake being in the loop.\n\t\t$wp_query->in_the_loop = true;\n\n\t\t// Fetch 20 posts at a time rather than loading the entire table into memory.\n\t\twhile ( $next_posts = array_splice( $post_ids, 0, 20 ) ) {\n\t\t\t$where = 'WHERE ID IN (' . join( ',', $next_posts ) . ')';\n\t\t\t$posts = $wpdb->get_results( \"SELECT * FROM {$wpdb->posts} $where\" );\n\n\t\t\t// Begin Loop.\n\t\t\tforeach ( $posts as $post ) {\n\t\t\t\tsetup_postdata( $post );\n\n\t\t\t\t/** This filter is documented in wp-includes/feed.php */\n\t\t\t\t$title = apply_filters( 'the_title_rss', $post->post_title );\n\n\t\t\t\t/**\n\t\t\t\t * Filters the post content used for WXR exports.\n\t\t\t\t *\n\t\t\t\t * @since 2.5.0\n\t\t\t\t *\n\t\t\t\t * @param string $post_content Content of the current post.\n\t\t\t\t */\n\t\t\t\t$content = wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) );\n\n\t\t\t\t/**\n\t\t\t\t * Filters the post excerpt used for WXR exports.\n\t\t\t\t *\n\t\t\t\t * @since 2.6.0\n\t\t\t\t *\n\t\t\t\t * @param string $post_excerpt Excerpt for the current post.\n\t\t\t\t */\n\t\t\t\t$excerpt = wxr_cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) );\n\n\t\t\t\t$is_sticky = is_sticky( $post->ID ) ? 1 : 0;\n\t\t\t\t?>\n\t<item>\n\t\t<title><?php echo $title; ?></title>\n\t\t<link><?php the_permalink_rss(); ?></link>\n\t\t<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>\n\t\t<dc:creator><?php echo wxr_cdata( get_the_author_meta( 'login' ) ); ?></dc:creator>\n\t\t<guid isPermaLink=\"false\"><?php the_guid(); ?></guid>\n\t\t<description></description>\n\t\t<content:encoded><?php echo $content; ?></content:encoded>\n\t\t<excerpt:encoded><?php echo $excerpt; ?></excerpt:encoded>\n\t\t<wp:post_id><?php echo intval( $post->ID ); ?></wp:post_id>\n\t\t<wp:post_date><?php echo wxr_cdata( $post->post_date ); ?></wp:post_date>\n\t\t<wp:post_date_gmt><?php echo wxr_cdata( $post->post_date_gmt ); ?></wp:post_date_gmt>\n\t\t<wp:comment_status><?php echo wxr_cdata( $post->comment_status ); ?></wp:comment_status>\n\t\t<wp:ping_status><?php echo wxr_cdata( $post->ping_status ); ?></wp:ping_status>\n\t\t<wp:post_name><?php echo wxr_cdata( $post->post_name ); ?></wp:post_name>\n\t\t<wp:status><?php echo wxr_cdata( $post->post_status ); ?></wp:status>\n\t\t<wp:post_parent><?php echo intval( $post->post_parent ); ?></wp:post_parent>\n\t\t<wp:menu_order><?php echo intval( $post->menu_order ); ?></wp:menu_order>\n\t\t<wp:post_type><?php echo wxr_cdata( $post->post_type ); ?></wp:post_type>\n\t\t<wp:post_password><?php echo wxr_cdata( $post->post_password ); ?></wp:post_password>\n\t\t<wp:is_sticky><?php echo intval( $is_sticky ); ?></wp:is_sticky>\n\t\t\t\t<?php\tif ( 'attachment' === $post->post_type ) : ?>\n\t\t<wp:attachment_url><?php echo wxr_cdata( wp_get_attachment_url( $post->ID ) ); ?></wp:attachment_url>\n\t<?php endif; ?>\n\t\t\t\t<?php wxr_post_taxonomy(); ?>\n\t\t\t\t<?php\n\t\t\t\t$postmeta = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM $wpdb->postmeta WHERE post_id = %d\", $post->ID ) );\n\t\t\t\tforeach ( $postmeta as $meta ) :\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters whether to selectively skip post meta used for WXR exports.\n\t\t\t\t\t *\n\t\t\t\t\t * Returning a truthy value from the filter will skip the current meta\n\t\t\t\t\t * object from being exported.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 3.3.0\n\t\t\t\t\t *\n\t\t\t\t\t * @param bool   $skip     Whether to skip the current post meta. Default false.\n\t\t\t\t\t * @param string $meta_key Current meta key.\n\t\t\t\t\t * @param object $meta     Current meta object.\n\t\t\t\t\t */\n\t\t\t\t\tif ( apply_filters( 'wxr_export_skip_postmeta', false, $meta->meta_key, $meta ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t<wp:postmeta>\n\t\t<wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>\n\t\t<wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>\n\t\t</wp:postmeta>\n\t\t\t\t\t<?php\n\tendforeach;\n\n\t\t\t\t$_comments = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'\", $post->ID ) );\n\t\t\t\t$comments  = array_map( 'get_comment', $_comments );\n\t\t\t\tforeach ( $comments as $c ) :\n\t\t\t\t\t?>\n\t\t<wp:comment>\n\t\t\t<wp:comment_id><?php echo intval( $c->comment_ID ); ?></wp:comment_id>\n\t\t\t<wp:comment_author><?php echo wxr_cdata( $c->comment_author ); ?></wp:comment_author>\n\t\t\t<wp:comment_author_email><?php echo wxr_cdata( $c->comment_author_email ); ?></wp:comment_author_email>\n\t\t\t<wp:comment_author_url><?php echo esc_url_raw( $c->comment_author_url ); ?></wp:comment_author_url>\n\t\t\t<wp:comment_author_IP><?php echo wxr_cdata( $c->comment_author_IP ); ?></wp:comment_author_IP>\n\t\t\t<wp:comment_date><?php echo wxr_cdata( $c->comment_date ); ?></wp:comment_date>\n\t\t\t<wp:comment_date_gmt><?php echo wxr_cdata( $c->comment_date_gmt ); ?></wp:comment_date_gmt>\n\t\t\t<wp:comment_content><?php echo wxr_cdata( $c->comment_content ); ?></wp:comment_content>\n\t\t\t<wp:comment_approved><?php echo wxr_cdata( $c->comment_approved ); ?></wp:comment_approved>\n\t\t\t<wp:comment_type><?php echo wxr_cdata( $c->comment_type ); ?></wp:comment_type>\n\t\t\t<wp:comment_parent><?php echo intval( $c->comment_parent ); ?></wp:comment_parent>\n\t\t\t<wp:comment_user_id><?php echo intval( $c->user_id ); ?></wp:comment_user_id>\n\t\t\t\t\t<?php\n\t\t\t\t\t$c_meta = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d\", $c->comment_ID ) );\n\t\t\t\t\tforeach ( $c_meta as $meta ) :\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Filters whether to selectively skip comment meta used for WXR exports.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * Returning a truthy value from the filter will skip the current meta\n\t\t\t\t\t\t * object from being exported.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @since 4.0.0\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @param bool   $skip     Whether to skip the current comment meta. Default false.\n\t\t\t\t\t\t * @param string $meta_key Current meta key.\n\t\t\t\t\t\t * @param object $meta     Current meta object.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif ( apply_filters( 'wxr_export_skip_commentmeta', false, $meta->meta_key, $meta ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t<wp:commentmeta>\n\t<wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>\n\t\t\t<wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>\n\t\t\t</wp:commentmeta>\n\t\t\t\t\t<?php\tendforeach; ?>\n\t\t</wp:comment>\n\t\t\t<?php\tendforeach; ?>\n\t\t</item>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}\n\t}\n\t?>\n</channel>\n</rss>\n\t<?php\n}\n", "num_lines": 671}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Filesystem API: Top-level functionality\n *\n * Functions for reading, writing, modifying, and deleting files on the file system.\n * Includes functionality for theme-specific files as well as operations for uploading,\n * archiving, and rendering output when necessary.\n *\n * @package WordPress\n * @subpackage Filesystem\n * @since 2.3.0\n */\n\n/** The descriptions for theme files. */\n$wp_file_descriptions = array(\n\t'functions.php'         => __( 'Theme Functions' ),\n\t'header.php'            => __( 'Theme Header' ),\n\t'footer.php'            => __( 'Theme Footer' ),\n\t'sidebar.php'           => __( 'Sidebar' ),\n\t'comments.php'          => __( 'Comments' ),\n\t'searchform.php'        => __( 'Search Form' ),\n\t'404.php'               => __( '404 Template' ),\n\t'link.php'              => __( 'Links Template' ),\n\t// Archives.\n\t'index.php'             => __( 'Main Index Template' ),\n\t'archive.php'           => __( 'Archives' ),\n\t'author.php'            => __( 'Author Template' ),\n\t'taxonomy.php'          => __( 'Taxonomy Template' ),\n\t'category.php'          => __( 'Category Template' ),\n\t'tag.php'               => __( 'Tag Template' ),\n\t'home.php'              => __( 'Posts Page' ),\n\t'search.php'            => __( 'Search Results' ),\n\t'date.php'              => __( 'Date Template' ),\n\t// Content.\n\t'singular.php'          => __( 'Singular Template' ),\n\t'single.php'            => __( 'Single Post' ),\n\t'page.php'              => __( 'Single Page' ),\n\t'front-page.php'        => __( 'Homepage' ),\n\t'privacy-policy.php'    => __( 'Privacy Policy Page' ),\n\t// Attachments.\n\t'attachment.php'        => __( 'Attachment Template' ),\n\t'image.php'             => __( 'Image Attachment Template' ),\n\t'video.php'             => __( 'Video Attachment Template' ),\n\t'audio.php'             => __( 'Audio Attachment Template' ),\n\t'application.php'       => __( 'Application Attachment Template' ),\n\t// Embeds.\n\t'embed.php'             => __( 'Embed Template' ),\n\t'embed-404.php'         => __( 'Embed 404 Template' ),\n\t'embed-content.php'     => __( 'Embed Content Template' ),\n\t'header-embed.php'      => __( 'Embed Header Template' ),\n\t'footer-embed.php'      => __( 'Embed Footer Template' ),\n\t// Stylesheets.\n\t'style.css'             => __( 'Stylesheet' ),\n\t'editor-style.css'      => __( 'Visual Editor Stylesheet' ),\n\t'editor-style-rtl.css'  => __( 'Visual Editor RTL Stylesheet' ),\n\t'rtl.css'               => __( 'RTL Stylesheet' ),\n\t// Other.\n\t'my-hacks.php'          => __( 'my-hacks.php (legacy hacks support)' ),\n\t'.htaccess'             => __( '.htaccess (for rewrite rules )' ),\n\t// Deprecated files.\n\t'wp-layout.css'         => __( 'Stylesheet' ),\n\t'wp-comments.php'       => __( 'Comments Template' ),\n\t'wp-comments-popup.php' => __( 'Popup Comments Template' ),\n\t'comments-popup.php'    => __( 'Popup Comments' ),\n);\n\n/**\n * Gets the description for standard WordPress theme files.\n *\n * @since 1.5.0\n *\n * @global array $wp_file_descriptions Theme file descriptions.\n * @global array $allowed_files        List of allowed files.\n *\n * @param string $file Filesystem path or filename.\n * @return string Description of file from $wp_file_descriptions or basename of $file if description doesn't exist.\n *                Appends 'Page Template' to basename of $file if the file is a page template.\n */\nfunction get_file_description( $file ) {\n\tglobal $wp_file_descriptions, $allowed_files;\n\n\t$dirname   = pathinfo( $file, PATHINFO_DIRNAME );\n\t$file_path = $allowed_files[ $file ];\n\n\tif ( isset( $wp_file_descriptions[ basename( $file ) ] ) && '.' === $dirname ) {\n\t\treturn $wp_file_descriptions[ basename( $file ) ];\n\t} elseif ( file_exists( $file_path ) && is_file( $file_path ) ) {\n\t\t$template_data = implode( '', file( $file_path ) );\n\n\t\tif ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ) ) {\n\t\t\t/* translators: %s: Template name. */\n\t\t\treturn sprintf( __( '%s Page Template' ), _cleanup_header_comment( $name[1] ) );\n\t\t}\n\t}\n\n\treturn trim( basename( $file ) );\n}\n\n/**\n * Gets the absolute filesystem path to the root of the WordPress installation.\n *\n * @since 1.5.0\n *\n * @return string Full filesystem path to the root of the WordPress installation.\n */\nfunction get_home_path() {\n\t$home    = set_url_scheme( get_option( 'home' ), 'http' );\n\t$siteurl = set_url_scheme( get_option( 'siteurl' ), 'http' );\n\n\tif ( ! empty( $home ) && 0 !== strcasecmp( $home, $siteurl ) ) {\n\t\t$wp_path_rel_to_home = str_ireplace( $home, '', $siteurl ); /* $siteurl - $home */\n\t\t$pos                 = strripos( str_replace( '\\\\', '/', $_SERVER['SCRIPT_FILENAME'] ), trailingslashit( $wp_path_rel_to_home ) );\n\t\t$home_path           = substr( $_SERVER['SCRIPT_FILENAME'], 0, $pos );\n\t\t$home_path           = trailingslashit( $home_path );\n\t} else {\n\t\t$home_path = ABSPATH;\n\t}\n\n\treturn str_replace( '\\\\', '/', $home_path );\n}\n\n/**\n * Returns a listing of all files in the specified folder and all subdirectories up to 100 levels deep.\n *\n * The depth of the recursiveness can be controlled by the $levels param.\n *\n * @since 2.6.0\n * @since 4.9.0 Added the `$exclusions` parameter.\n *\n * @param string   $folder     Optional. Full path to folder. Default empty.\n * @param int      $levels     Optional. Levels of folders to follow, Default 100 (PHP Loop limit).\n * @param string[] $exclusions Optional. List of folders and files to skip.\n * @return bool|string[] False on failure, else array of files.\n */\nfunction list_files( $folder = '', $levels = 100, $exclusions = array() ) {\n\tif ( empty( $folder ) ) {\n\t\treturn false;\n\t}\n\n\t$folder = trailingslashit( $folder );\n\n\tif ( ! $levels ) {\n\t\treturn false;\n\t}\n\n\t$files = array();\n\n\t$dir = @opendir( $folder );\n\tif ( $dir ) {\n\t\twhile ( ( $file = readdir( $dir ) ) !== false ) {\n\t\t\t// Skip current and parent folder links.\n\t\t\tif ( in_array( $file, array( '.', '..' ), true ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip hidden and excluded files.\n\t\t\tif ( '.' === $file[0] || in_array( $file, $exclusions, true ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( is_dir( $folder . $file ) ) {\n\t\t\t\t$files2 = list_files( $folder . $file, $levels - 1 );\n\t\t\t\tif ( $files2 ) {\n\t\t\t\t\t$files = array_merge( $files, $files2 );\n\t\t\t\t} else {\n\t\t\t\t\t$files[] = $folder . $file . '/';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$files[] = $folder . $file;\n\t\t\t}\n\t\t}\n\n\t\tclosedir( $dir );\n\t}\n\n\treturn $files;\n}\n\n/**\n * Gets the list of file extensions that are editable in plugins.\n *\n * @since 4.9.0\n *\n * @param string $plugin Path to the plugin file relative to the plugins directory.\n * @return string[] Array of editable file extensions.\n */\nfunction wp_get_plugin_file_editable_extensions( $plugin ) {\n\n\t$default_types = array(\n\t\t'bash',\n\t\t'conf',\n\t\t'css',\n\t\t'diff',\n\t\t'htm',\n\t\t'html',\n\t\t'http',\n\t\t'inc',\n\t\t'include',\n\t\t'js',\n\t\t'json',\n\t\t'jsx',\n\t\t'less',\n\t\t'md',\n\t\t'patch',\n\t\t'php',\n\t\t'php3',\n\t\t'php4',\n\t\t'php5',\n\t\t'php7',\n\t\t'phps',\n\t\t'phtml',\n\t\t'sass',\n\t\t'scss',\n\t\t'sh',\n\t\t'sql',\n\t\t'svg',\n\t\t'text',\n\t\t'txt',\n\t\t'xml',\n\t\t'yaml',\n\t\t'yml',\n\t);\n\n\t/**\n\t * Filters the list of file types allowed for editing in the plugin editor.\n\t *\n\t * @since 2.8.0\n\t * @since 4.9.0 Added the `$plugin` parameter.\n\t *\n\t * @param string[] $default_types An array of editable plugin file extensions.\n\t * @param string   $plugin        Path to the plugin file relative to the plugins directory.\n\t */\n\t$file_types = (array) apply_filters( 'editable_extensions', $default_types, $plugin );\n\n\treturn $file_types;\n}\n\n/**\n * Gets the list of file extensions that are editable for a given theme.\n *\n * @since 4.9.0\n *\n * @param WP_Theme $theme Theme object.\n * @return string[] Array of editable file extensions.\n */\nfunction wp_get_theme_file_editable_extensions( $theme ) {\n\n\t$default_types = array(\n\t\t'bash',\n\t\t'conf',\n\t\t'css',\n\t\t'diff',\n\t\t'htm',\n\t\t'html',\n\t\t'http',\n\t\t'inc',\n\t\t'include',\n\t\t'js',\n\t\t'json',\n\t\t'jsx',\n\t\t'less',\n\t\t'md',\n\t\t'patch',\n\t\t'php',\n\t\t'php3',\n\t\t'php4',\n\t\t'php5',\n\t\t'php7',\n\t\t'phps',\n\t\t'phtml',\n\t\t'sass',\n\t\t'scss',\n\t\t'sh',\n\t\t'sql',\n\t\t'svg',\n\t\t'text',\n\t\t'txt',\n\t\t'xml',\n\t\t'yaml',\n\t\t'yml',\n\t);\n\n\t/**\n\t * Filters the list of file types allowed for editing in the theme editor.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string[] $default_types An array of editable theme file extensions.\n\t * @param WP_Theme $theme         The current theme object.\n\t */\n\t$file_types = apply_filters( 'wp_theme_editor_filetypes', $default_types, $theme );\n\n\t// Ensure that default types are still there.\n\treturn array_unique( array_merge( $file_types, $default_types ) );\n}\n\n/**\n * Prints file editor templates (for plugins and themes).\n *\n * @since 4.9.0\n */\nfunction wp_print_file_editor_templates() {\n\t?>\n\t<script type=\"text/html\" id=\"tmpl-wp-file-editor-notice\">\n\t\t<div class=\"notice inline notice-{{ data.type || 'info' }} {{ data.alt ? 'notice-alt' : '' }} {{ data.dismissible ? 'is-dismissible' : '' }} {{ data.classes || '' }}\">\n\t\t\t<# if ( 'php_error' === data.code ) { #>\n\t\t\t\t<p>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: Line number, 2: File path. */\n\t\t\t\t\t\t__( 'Your PHP code changes were rolled back due to an error on line %1$s of file %2$s. Please fix and try saving again.' ),\n\t\t\t\t\t\t'{{ data.line }}',\n\t\t\t\t\t\t'{{ data.file }}'\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t\t<pre>{{ data.message }}</pre>\n\t\t\t<# } else if ( 'file_not_writable' === data.code ) { #>\n\t\t\t\t<p>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Documentation URL. */\n\t\t\t\t\t\t__( 'You need to make this file writable before you can save your changes. See <a href=\"%s\">Changing File Permissions</a> for more information.' ),\n\t\t\t\t\t\t__( 'https://wordpress.org/support/article/changing-file-permissions/' )\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t<# } else { #>\n\t\t\t\t<p>{{ data.message || data.code }}</p>\n\n\t\t\t\t<# if ( 'lint_errors' === data.code ) { #>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<# var elementId = 'el-' + String( Math.random() ); #>\n\t\t\t\t\t\t<input id=\"{{ elementId }}\"  type=\"checkbox\">\n\t\t\t\t\t\t<label for=\"{{ elementId }}\"><?php _e( 'Update anyway, even though it might break your site?' ); ?></label>\n\t\t\t\t\t</p>\n\t\t\t\t<# } #>\n\t\t\t<# } #>\n\t\t\t<# if ( data.dismissible ) { #>\n\t\t\t\t<button type=\"button\" class=\"notice-dismiss\"><span class=\"screen-reader-text\"><?php _e( 'Dismiss' ); ?></span></button>\n\t\t\t<# } #>\n\t\t</div>\n\t</script>\n\t<?php\n}\n\n/**\n * Attempts to edit a file for a theme or plugin.\n *\n * When editing a PHP file, loopback requests will be made to the admin and the homepage\n * to attempt to see if there is a fatal error introduced. If so, the PHP change will be\n * reverted.\n *\n * @since 4.9.0\n *\n * @param string[] $args {\n *     Args. Note that all of the arg values are already unslashed. They are, however,\n *     coming straight from `$_POST` and are not validated or sanitized in any way.\n *\n *     @type string $file       Relative path to file.\n *     @type string $plugin     Path to the plugin file relative to the plugins directory.\n *     @type string $theme      Theme being edited.\n *     @type string $newcontent New content for the file.\n *     @type string $nonce      Nonce.\n * }\n * @return true|WP_Error True on success or `WP_Error` on failure.\n */\nfunction wp_edit_theme_plugin_file( $args ) {\n\tif ( empty( $args['file'] ) ) {\n\t\treturn new WP_Error( 'missing_file' );\n\t}\n\t$file = $args['file'];\n\tif ( 0 !== validate_file( $file ) ) {\n\t\treturn new WP_Error( 'bad_file' );\n\t}\n\n\tif ( ! isset( $args['newcontent'] ) ) {\n\t\treturn new WP_Error( 'missing_content' );\n\t}\n\t$content = $args['newcontent'];\n\n\tif ( ! isset( $args['nonce'] ) ) {\n\t\treturn new WP_Error( 'missing_nonce' );\n\t}\n\n\t$plugin    = null;\n\t$theme     = null;\n\t$real_file = null;\n\tif ( ! empty( $args['plugin'] ) ) {\n\t\t$plugin = $args['plugin'];\n\n\t\tif ( ! current_user_can( 'edit_plugins' ) ) {\n\t\t\treturn new WP_Error( 'unauthorized', __( 'Sorry, you are not allowed to edit plugins for this site.' ) );\n\t\t}\n\n\t\tif ( ! wp_verify_nonce( $args['nonce'], 'edit-plugin_' . $file ) ) {\n\t\t\treturn new WP_Error( 'nonce_failure' );\n\t\t}\n\n\t\tif ( ! array_key_exists( $plugin, get_plugins() ) ) {\n\t\t\treturn new WP_Error( 'invalid_plugin' );\n\t\t}\n\n\t\tif ( 0 !== validate_file( $file, get_plugin_files( $plugin ) ) ) {\n\t\t\treturn new WP_Error( 'bad_plugin_file_path', __( 'Sorry, that file cannot be edited.' ) );\n\t\t}\n\n\t\t$editable_extensions = wp_get_plugin_file_editable_extensions( $plugin );\n\n\t\t$real_file = WP_PLUGIN_DIR . '/' . $file;\n\n\t\t$is_active = in_array(\n\t\t\t$plugin,\n\t\t\t(array) get_option( 'active_plugins', array() ),\n\t\t\ttrue\n\t\t);\n\n\t} elseif ( ! empty( $args['theme'] ) ) {\n\t\t$stylesheet = $args['theme'];\n\t\tif ( 0 !== validate_file( $stylesheet ) ) {\n\t\t\treturn new WP_Error( 'bad_theme_path' );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_themes' ) ) {\n\t\t\treturn new WP_Error( 'unauthorized', __( 'Sorry, you are not allowed to edit templates for this site.' ) );\n\t\t}\n\n\t\t$theme = wp_get_theme( $stylesheet );\n\t\tif ( ! $theme->exists() ) {\n\t\t\treturn new WP_Error( 'non_existent_theme', __( 'The requested theme does not exist.' ) );\n\t\t}\n\n\t\tif ( ! wp_verify_nonce( $args['nonce'], 'edit-theme_' . $stylesheet . '_' . $file ) ) {\n\t\t\treturn new WP_Error( 'nonce_failure' );\n\t\t}\n\n\t\tif ( $theme->errors() && 'theme_no_stylesheet' === $theme->errors()->get_error_code() ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'theme_no_stylesheet',\n\t\t\t\t__( 'The requested theme does not exist.' ) . ' ' . $theme->errors()->get_error_message()\n\t\t\t);\n\t\t}\n\n\t\t$editable_extensions = wp_get_theme_file_editable_extensions( $theme );\n\n\t\t$allowed_files = array();\n\t\tforeach ( $editable_extensions as $type ) {\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase 'php':\n\t\t\t\t\t$allowed_files = array_merge( $allowed_files, $theme->get_files( 'php', -1 ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'css':\n\t\t\t\t\t$style_files                = $theme->get_files( 'css', -1 );\n\t\t\t\t\t$allowed_files['style.css'] = $style_files['style.css'];\n\t\t\t\t\t$allowed_files              = array_merge( $allowed_files, $style_files );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$allowed_files = array_merge( $allowed_files, $theme->get_files( $type, -1 ) );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Compare based on relative paths.\n\t\tif ( 0 !== validate_file( $file, array_keys( $allowed_files ) ) ) {\n\t\t\treturn new WP_Error( 'disallowed_theme_file', __( 'Sorry, that file cannot be edited.' ) );\n\t\t}\n\n\t\t$real_file = $theme->get_stylesheet_directory() . '/' . $file;\n\n\t\t$is_active = ( get_stylesheet() === $stylesheet || get_template() === $stylesheet );\n\n\t} else {\n\t\treturn new WP_Error( 'missing_theme_or_plugin' );\n\t}\n\n\t// Ensure file is real.\n\tif ( ! is_file( $real_file ) ) {\n\t\treturn new WP_Error( 'file_does_not_exist', __( 'File does not exist! Please double check the name and try again.' ) );\n\t}\n\n\t// Ensure file extension is allowed.\n\t$extension = null;\n\tif ( preg_match( '/\\.([^.]+)$/', $real_file, $matches ) ) {\n\t\t$extension = strtolower( $matches[1] );\n\t\tif ( ! in_array( $extension, $editable_extensions, true ) ) {\n\t\t\treturn new WP_Error( 'illegal_file_type', __( 'Files of this type are not editable.' ) );\n\t\t}\n\t}\n\n\t$previous_content = file_get_contents( $real_file );\n\n\tif ( ! is_writeable( $real_file ) ) {\n\t\treturn new WP_Error( 'file_not_writable' );\n\t}\n\n\t$f = fopen( $real_file, 'w+' );\n\tif ( false === $f ) {\n\t\treturn new WP_Error( 'file_not_writable' );\n\t}\n\n\t$written = fwrite( $f, $content );\n\tfclose( $f );\n\tif ( false === $written ) {\n\t\treturn new WP_Error( 'unable_to_write', __( 'Unable to write to file.' ) );\n\t}\n\n\twp_opcache_invalidate( $real_file, true );\n\n\tif ( $is_active && 'php' === $extension ) {\n\n\t\t$scrape_key   = md5( rand() );\n\t\t$transient    = 'scrape_key_' . $scrape_key;\n\t\t$scrape_nonce = strval( rand() );\n\t\t// It shouldn't take more than 60 seconds to make the two loopback requests.\n\t\tset_transient( $transient, $scrape_nonce, 60 );\n\n\t\t$cookies       = wp_unslash( $_COOKIE );\n\t\t$scrape_params = array(\n\t\t\t'wp_scrape_key'   => $scrape_key,\n\t\t\t'wp_scrape_nonce' => $scrape_nonce,\n\t\t);\n\t\t$headers       = array(\n\t\t\t'Cache-Control' => 'no-cache',\n\t\t);\n\n\t\t/** This filter is documented in wp-includes/class-wp-http-streams.php */\n\t\t$sslverify = apply_filters( 'https_local_ssl_verify', false );\n\n\t\t// Include Basic auth in loopback requests.\n\t\tif ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {\n\t\t\t$headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) );\n\t\t}\n\n\t\t// Make sure PHP process doesn't die before loopback requests complete.\n\t\tset_time_limit( 300 );\n\n\t\t// Time to wait for loopback requests to finish.\n\t\t$timeout = 100;\n\n\t\t$needle_start = \"###### wp_scraping_result_start:$scrape_key ######\";\n\t\t$needle_end   = \"###### wp_scraping_result_end:$scrape_key ######\";\n\n\t\t// Attempt loopback request to editor to see if user just whitescreened themselves.\n\t\tif ( $plugin ) {\n\t\t\t$url = add_query_arg( compact( 'plugin', 'file' ), admin_url( 'plugin-editor.php' ) );\n\t\t} elseif ( isset( $stylesheet ) ) {\n\t\t\t$url = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'theme' => $stylesheet,\n\t\t\t\t\t'file'  => $file,\n\t\t\t\t),\n\t\t\t\tadmin_url( 'theme-editor.php' )\n\t\t\t);\n\t\t} else {\n\t\t\t$url = admin_url();\n\t\t}\n\n\t\tif ( function_exists( 'session_status' ) && PHP_SESSION_ACTIVE === session_status() ) {\n\t\t\t// Close any active session to prevent HTTP requests from timing out\n\t\t\t// when attempting to connect back to the site.\n\t\t\tsession_write_close();\n\t\t}\n\n\t\t$url                    = add_query_arg( $scrape_params, $url );\n\t\t$r                      = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) );\n\t\t$body                   = wp_remote_retrieve_body( $r );\n\t\t$scrape_result_position = strpos( $body, $needle_start );\n\n\t\t$loopback_request_failure = array(\n\t\t\t'code'    => 'loopback_request_failed',\n\t\t\t'message' => __( 'Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.' ),\n\t\t);\n\t\t$json_parse_failure       = array(\n\t\t\t'code' => 'json_parse_error',\n\t\t);\n\n\t\t$result = null;\n\t\tif ( false === $scrape_result_position ) {\n\t\t\t$result = $loopback_request_failure;\n\t\t} else {\n\t\t\t$error_output = substr( $body, $scrape_result_position + strlen( $needle_start ) );\n\t\t\t$error_output = substr( $error_output, 0, strpos( $error_output, $needle_end ) );\n\t\t\t$result       = json_decode( trim( $error_output ), true );\n\t\t\tif ( empty( $result ) ) {\n\t\t\t\t$result = $json_parse_failure;\n\t\t\t}\n\t\t}\n\n\t\t// Try making request to homepage as well to see if visitors have been whitescreened.\n\t\tif ( true === $result ) {\n\t\t\t$url                    = home_url( '/' );\n\t\t\t$url                    = add_query_arg( $scrape_params, $url );\n\t\t\t$r                      = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) );\n\t\t\t$body                   = wp_remote_retrieve_body( $r );\n\t\t\t$scrape_result_position = strpos( $body, $needle_start );\n\n\t\t\tif ( false === $scrape_result_position ) {\n\t\t\t\t$result = $loopback_request_failure;\n\t\t\t} else {\n\t\t\t\t$error_output = substr( $body, $scrape_result_position + strlen( $needle_start ) );\n\t\t\t\t$error_output = substr( $error_output, 0, strpos( $error_output, $needle_end ) );\n\t\t\t\t$result       = json_decode( trim( $error_output ), true );\n\t\t\t\tif ( empty( $result ) ) {\n\t\t\t\t\t$result = $json_parse_failure;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdelete_transient( $transient );\n\n\t\tif ( true !== $result ) {\n\n\t\t\t// Roll-back file change.\n\t\t\tfile_put_contents( $real_file, $previous_content );\n\t\t\twp_opcache_invalidate( $real_file, true );\n\n\t\t\tif ( ! isset( $result['message'] ) ) {\n\t\t\t\t$message = __( 'Something went wrong.' );\n\t\t\t} else {\n\t\t\t\t$message = $result['message'];\n\t\t\t\tunset( $result['message'] );\n\t\t\t}\n\t\t\treturn new WP_Error( 'php_error', $message, $result );\n\t\t}\n\t}\n\n\tif ( $theme instanceof WP_Theme ) {\n\t\t$theme->cache_delete();\n\t}\n\n\treturn true;\n}\n\n\n/**\n * Returns a filename of a temporary unique file.\n *\n * Please note that the calling function must unlink() this itself.\n *\n * The filename is based off the passed parameter or defaults to the current unix timestamp,\n * while the directory can either be passed as well, or by leaving it blank, default to a writable\n * temporary directory.\n *\n * @since 2.6.0\n *\n * @param string $filename Optional. Filename to base the Unique file off. Default empty.\n * @param string $dir      Optional. Directory to store the file in. Default empty.\n * @return string A writable filename.\n */\nfunction wp_tempnam( $filename = '', $dir = '' ) {\n\tif ( empty( $dir ) ) {\n\t\t$dir = get_temp_dir();\n\t}\n\n\tif ( empty( $filename ) || in_array( $filename, array( '.', '/', '\\\\' ), true ) ) {\n\t\t$filename = uniqid();\n\t}\n\n\t// Use the basename of the given file without the extension as the name for the temporary directory.\n\t$temp_filename = basename( $filename );\n\t$temp_filename = preg_replace( '|\\.[^.]*$|', '', $temp_filename );\n\n\t// If the folder is falsey, use its parent directory name instead.\n\tif ( ! $temp_filename ) {\n\t\treturn wp_tempnam( dirname( $filename ), $dir );\n\t}\n\n\t// Suffix some random data to avoid filename conflicts.\n\t$temp_filename .= '-' . wp_generate_password( 6, false );\n\t$temp_filename .= '.tmp';\n\t$temp_filename  = $dir . wp_unique_filename( $dir, $temp_filename );\n\n\t$fp = @fopen( $temp_filename, 'x' );\n\tif ( ! $fp && is_writable( $dir ) && file_exists( $temp_filename ) ) {\n\t\treturn wp_tempnam( $filename, $dir );\n\t}\n\tif ( $fp ) {\n\t\tfclose( $fp );\n\t}\n\n\treturn $temp_filename;\n}\n\n/**\n * Makes sure that the file that was requested to be edited is allowed to be edited.\n *\n * Function will die if you are not allowed to edit the file.\n *\n * @since 1.5.0\n *\n * @param string   $file          File the user is attempting to edit.\n * @param string[] $allowed_files Optional. Array of allowed files to edit.\n *                                `$file` must match an entry exactly.\n * @return string|void Returns the file name on success, dies on failure.\n */\nfunction validate_file_to_edit( $file, $allowed_files = array() ) {\n\t$code = validate_file( $file, $allowed_files );\n\n\tif ( ! $code ) {\n\t\treturn $file;\n\t}\n\n\tswitch ( $code ) {\n\t\tcase 1:\n\t\t\twp_die( __( 'Sorry, that file cannot be edited.' ) );\n\n\t\t\t// case 2 :\n\t\t\t// wp_die( __('Sorry, can&#8217;t call files with their real path.' ));\n\n\t\tcase 3:\n\t\t\twp_die( __( 'Sorry, that file cannot be edited.' ) );\n\t}\n}\n\n/**\n * Handles PHP uploads in WordPress.\n *\n * Sanitizes file names, checks extensions for mime type, and moves the file\n * to the appropriate directory within the uploads directory.\n *\n * @access private\n * @since 4.0.0\n *\n * @see wp_handle_upload_error\n *\n * @param string[]       $file      Reference to a single element of `$_FILES`.\n *                                  Call the function once for each uploaded file.\n * @param string[]|false $overrides An associative array of names => values\n *                                  to override default variables. Default false.\n * @param string         $time      Time formatted in 'yyyy/mm'.\n * @param string         $action    Expected value for `$_POST['action']`.\n * @return string[] On success, returns an associative array of file attributes.\n *                  On failure, returns `$overrides['upload_error_handler']( &$file, $message )`\n *                  or `array( 'error' => $message )`.\n */\nfunction _wp_handle_upload( &$file, $overrides, $time, $action ) {\n\t// The default error handler.\n\tif ( ! function_exists( 'wp_handle_upload_error' ) ) {\n\t\tfunction wp_handle_upload_error( &$file, $message ) {\n\t\t\treturn array( 'error' => $message );\n\t\t}\n\t}\n\n\t/**\n\t * Filters the data for a file before it is uploaded to WordPress.\n\t *\n\t * The dynamic portion of the hook name, `$action`, refers to the post action.\n\t *\n\t * @since 2.9.0 as 'wp_handle_upload_prefilter'.\n\t * @since 4.0.0 Converted to a dynamic hook with `$action`.\n\t *\n\t * @param string[] $file An array of data for a single file.\n\t */\n\t$file = apply_filters( \"{$action}_prefilter\", $file );\n\n\t// You may define your own function and pass the name in $overrides['upload_error_handler'].\n\t$upload_error_handler = 'wp_handle_upload_error';\n\tif ( isset( $overrides['upload_error_handler'] ) ) {\n\t\t$upload_error_handler = $overrides['upload_error_handler'];\n\t}\n\n\t// You may have had one or more 'wp_handle_upload_prefilter' functions error out the file. Handle that gracefully.\n\tif ( isset( $file['error'] ) && ! is_numeric( $file['error'] ) && $file['error'] ) {\n\t\treturn call_user_func_array( $upload_error_handler, array( &$file, $file['error'] ) );\n\t}\n\n\t// Install user overrides. Did we mention that this voids your warranty?\n\n\t// You may define your own function and pass the name in $overrides['unique_filename_callback'].\n\t$unique_filename_callback = null;\n\tif ( isset( $overrides['unique_filename_callback'] ) ) {\n\t\t$unique_filename_callback = $overrides['unique_filename_callback'];\n\t}\n\n\t/*\n\t * This may not have originally been intended to be overridable,\n\t * but historically has been.\n\t */\n\tif ( isset( $overrides['upload_error_strings'] ) ) {\n\t\t$upload_error_strings = $overrides['upload_error_strings'];\n\t} else {\n\t\t// Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error'].\n\t\t$upload_error_strings = array(\n\t\t\tfalse,\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: upload_max_filesize, 2: php.ini */\n\t\t\t\t__( 'The uploaded file exceeds the %1$s directive in %2$s.' ),\n\t\t\t\t'upload_max_filesize',\n\t\t\t\t'php.ini'\n\t\t\t),\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: MAX_FILE_SIZE */\n\t\t\t\t__( 'The uploaded file exceeds the %s directive that was specified in the HTML form.' ),\n\t\t\t\t'MAX_FILE_SIZE'\n\t\t\t),\n\t\t\t__( 'The uploaded file was only partially uploaded.' ),\n\t\t\t__( 'No file was uploaded.' ),\n\t\t\t'',\n\t\t\t__( 'Missing a temporary folder.' ),\n\t\t\t__( 'Failed to write file to disk.' ),\n\t\t\t__( 'File upload stopped by extension.' ),\n\t\t);\n\t}\n\n\t// All tests are on by default. Most can be turned off by $overrides[{test_name}] = false;\n\t$test_form = isset( $overrides['test_form'] ) ? $overrides['test_form'] : true;\n\t$test_size = isset( $overrides['test_size'] ) ? $overrides['test_size'] : true;\n\n\t// If you override this, you must provide $ext and $type!!\n\t$test_type = isset( $overrides['test_type'] ) ? $overrides['test_type'] : true;\n\t$mimes     = isset( $overrides['mimes'] ) ? $overrides['mimes'] : false;\n\n\t// A correct form post will pass this test.\n\tif ( $test_form && ( ! isset( $_POST['action'] ) || ( $_POST['action'] != $action ) ) ) {\n\t\treturn call_user_func_array( $upload_error_handler, array( &$file, __( 'Invalid form submission.' ) ) );\n\t}\n\t// A successful upload will pass this test. It makes no sense to override this one.\n\tif ( isset( $file['error'] ) && $file['error'] > 0 ) {\n\t\treturn call_user_func_array( $upload_error_handler, array( &$file, $upload_error_strings[ $file['error'] ] ) );\n\t}\n\n\t// A properly uploaded file will pass this test. There should be no reason to override this one.\n\t$test_uploaded_file = 'wp_handle_upload' === $action ? is_uploaded_file( $file['tmp_name'] ) : @is_readable( $file['tmp_name'] );\n\tif ( ! $test_uploaded_file ) {\n\t\treturn call_user_func_array( $upload_error_handler, array( &$file, __( 'Specified file failed upload test.' ) ) );\n\t}\n\n\t$test_file_size = 'wp_handle_upload' === $action ? $file['size'] : filesize( $file['tmp_name'] );\n\t// A non-empty file will pass this test.\n\tif ( $test_size && ! ( $test_file_size > 0 ) ) {\n\t\tif ( is_multisite() ) {\n\t\t\t$error_msg = __( 'File is empty. Please upload something more substantial.' );\n\t\t} else {\n\t\t\t$error_msg = sprintf(\n\t\t\t\t/* translators: 1: php.ini, 2: post_max_size, 3: upload_max_filesize */\n\t\t\t\t__( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your %1$s file or by %2$s being defined as smaller than %3$s in %1$s.' ),\n\t\t\t\t'php.ini',\n\t\t\t\t'post_max_size',\n\t\t\t\t'upload_max_filesize'\n\t\t\t);\n\t\t}\n\t\treturn call_user_func_array( $upload_error_handler, array( &$file, $error_msg ) );\n\t}\n\n\t// A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter.\n\tif ( $test_type ) {\n\t\t$wp_filetype     = wp_check_filetype_and_ext( $file['tmp_name'], $file['name'], $mimes );\n\t\t$ext             = empty( $wp_filetype['ext'] ) ? '' : $wp_filetype['ext'];\n\t\t$type            = empty( $wp_filetype['type'] ) ? '' : $wp_filetype['type'];\n\t\t$proper_filename = empty( $wp_filetype['proper_filename'] ) ? '' : $wp_filetype['proper_filename'];\n\n\t\t// Check to see if wp_check_filetype_and_ext() determined the filename was incorrect.\n\t\tif ( $proper_filename ) {\n\t\t\t$file['name'] = $proper_filename;\n\t\t}\n\t\tif ( ( ! $type || ! $ext ) && ! current_user_can( 'unfiltered_upload' ) ) {\n\t\t\treturn call_user_func_array( $upload_error_handler, array( &$file, __( 'Sorry, this file type is not permitted for security reasons.' ) ) );\n\t\t}\n\t\tif ( ! $type ) {\n\t\t\t$type = $file['type'];\n\t\t}\n\t} else {\n\t\t$type = '';\n\t}\n\n\t/*\n\t * A writable uploads dir will pass this test. Again, there's no point\n\t * overriding this one.\n\t */\n\t$uploads = wp_upload_dir( $time );\n\tif ( ! ( $uploads && false === $uploads['error'] ) ) {\n\t\treturn call_user_func_array( $upload_error_handler, array( &$file, $uploads['error'] ) );\n\t}\n\n\t$filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback );\n\n\t// Move the file to the uploads dir.\n\t$new_file = $uploads['path'] . \"/$filename\";\n\n\t/**\n\t * Filters whether to short-circuit moving the uploaded file after passing all checks.\n\t *\n\t * If a non-null value is returned from the filter, moving the file and any related\n\t * error reporting will be completely skipped.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param mixed    $move_new_file If null (default) move the file after the upload.\n\t * @param string[] $file          An array of data for a single file.\n\t * @param string   $new_file      Filename of the newly-uploaded file.\n\t * @param string   $type          Mime type of the newly-uploaded file.\n\t */\n\t$move_new_file = apply_filters( 'pre_move_uploaded_file', null, $file, $new_file, $type );\n\n\tif ( null === $move_new_file ) {\n\t\tif ( 'wp_handle_upload' === $action ) {\n\t\t\t$move_new_file = @move_uploaded_file( $file['tmp_name'], $new_file );\n\t\t} else {\n\t\t\t// Use copy and unlink because rename breaks streams.\n\t\t\t// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged\n\t\t\t$move_new_file = @copy( $file['tmp_name'], $new_file );\n\t\t\tunlink( $file['tmp_name'] );\n\t\t}\n\n\t\tif ( false === $move_new_file ) {\n\t\t\tif ( 0 === strpos( $uploads['basedir'], ABSPATH ) ) {\n\t\t\t\t$error_path = str_replace( ABSPATH, '', $uploads['basedir'] ) . $uploads['subdir'];\n\t\t\t} else {\n\t\t\t\t$error_path = basename( $uploads['basedir'] ) . $uploads['subdir'];\n\t\t\t}\n\t\t\treturn $upload_error_handler(\n\t\t\t\t$file,\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Destination file path. */\n\t\t\t\t\t__( 'The uploaded file could not be moved to %s.' ),\n\t\t\t\t\t$error_path\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\t// Set correct file permissions.\n\t$stat  = stat( dirname( $new_file ) );\n\t$perms = $stat['mode'] & 0000666;\n\tchmod( $new_file, $perms );\n\n\t// Compute the URL.\n\t$url = $uploads['url'] . \"/$filename\";\n\n\tif ( is_multisite() ) {\n\t\tdelete_transient( 'dirsize_cache' );\n\t}\n\n\t/**\n\t * Filters the data array for the uploaded file.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param array  $upload {\n\t *     Array of upload data.\n\t *\n\t *     @type string $file Filename of the newly-uploaded file.\n\t *     @type string $url  URL of the newly-uploaded file.\n\t *     @type string $type Mime type of the newly-uploaded file.\n\t * }\n\t * @param string $context The type of upload action. Values include 'upload' or 'sideload'.\n\t */\n\treturn apply_filters(\n\t\t'wp_handle_upload',\n\t\tarray(\n\t\t\t'file' => $new_file,\n\t\t\t'url'  => $url,\n\t\t\t'type' => $type,\n\t\t),\n\t\t'wp_handle_sideload' === $action ? 'sideload' : 'upload'\n\t);\n}\n\n/**\n * Wrapper for _wp_handle_upload().\n *\n * Passes the {@see 'wp_handle_upload'} action.\n *\n * @since 2.0.0\n *\n * @see _wp_handle_upload()\n *\n * @param array      $file      Reference to a single element of `$_FILES`.\n *                              Call the function once for each uploaded file.\n * @param array|bool $overrides Optional. An associative array of names => values\n *                              to override default variables. Default false.\n * @param string     $time      Optional. Time formatted in 'yyyy/mm'. Default null.\n * @return array On success, returns an associative array of file attributes.\n *               On failure, returns `$overrides['upload_error_handler']( &$file, $message )`\n *               or `array( 'error' => $message )`.\n */\nfunction wp_handle_upload( &$file, $overrides = false, $time = null ) {\n\t/*\n\t *  $_POST['action'] must be set and its value must equal $overrides['action']\n\t *  or this:\n\t */\n\t$action = 'wp_handle_upload';\n\tif ( isset( $overrides['action'] ) ) {\n\t\t$action = $overrides['action'];\n\t}\n\n\treturn _wp_handle_upload( $file, $overrides, $time, $action );\n}\n\n/**\n * Wrapper for _wp_handle_upload().\n *\n * Passes the {@see 'wp_handle_sideload'} action.\n *\n * @since 2.6.0\n *\n * @see _wp_handle_upload()\n *\n * @param array      $file      Reference to a single element of `$_FILES`.\n *                              Call the function once for each uploaded file.\n * @param array|bool $overrides Optional. An associative array of names => values\n *                              to override default variables. Default false.\n * @param string     $time      Optional. Time formatted in 'yyyy/mm'. Default null.\n * @return array On success, returns an associative array of file attributes.\n *               On failure, returns `$overrides['upload_error_handler']( &$file, $message )`\n *               or `array( 'error' => $message )`.\n */\nfunction wp_handle_sideload( &$file, $overrides = false, $time = null ) {\n\t/*\n\t *  $_POST['action'] must be set and its value must equal $overrides['action']\n\t *  or this:\n\t */\n\t$action = 'wp_handle_sideload';\n\tif ( isset( $overrides['action'] ) ) {\n\t\t$action = $overrides['action'];\n\t}\n\n\treturn _wp_handle_upload( $file, $overrides, $time, $action );\n}\n\n/**\n * Downloads a URL to a local temporary file using the WordPress HTTP API.\n *\n * Please note that the calling function must unlink() the file.\n *\n * @since 2.5.0\n * @since 5.2.0 Signature Verification with SoftFail was added.\n *\n * @param string $url                    The URL of the file to download.\n * @param int    $timeout                The timeout for the request to download the file.\n *                                       Default 300 seconds.\n * @param bool   $signature_verification Whether to perform Signature Verification.\n *                                       Default false.\n * @return string|WP_Error Filename on success, WP_Error on failure.\n */\nfunction download_url( $url, $timeout = 300, $signature_verification = false ) {\n\t// WARNING: The file is not automatically deleted, the script must unlink() the file.\n\tif ( ! $url ) {\n\t\treturn new WP_Error( 'http_no_url', __( 'Invalid URL Provided.' ) );\n\t}\n\n\t$url_filename = basename( parse_url( $url, PHP_URL_PATH ) );\n\n\t$tmpfname = wp_tempnam( $url_filename );\n\tif ( ! $tmpfname ) {\n\t\treturn new WP_Error( 'http_no_file', __( 'Could not create Temporary file.' ) );\n\t}\n\n\t$response = wp_safe_remote_get(\n\t\t$url,\n\t\tarray(\n\t\t\t'timeout'  => $timeout,\n\t\t\t'stream'   => true,\n\t\t\t'filename' => $tmpfname,\n\t\t)\n\t);\n\n\tif ( is_wp_error( $response ) ) {\n\t\tunlink( $tmpfname );\n\t\treturn $response;\n\t}\n\n\t$response_code = wp_remote_retrieve_response_code( $response );\n\n\tif ( 200 != $response_code ) {\n\t\t$data = array(\n\t\t\t'code' => $response_code,\n\t\t);\n\n\t\t// Retrieve a sample of the response body for debugging purposes.\n\t\t$tmpf = fopen( $tmpfname, 'rb' );\n\t\tif ( $tmpf ) {\n\t\t\t/**\n\t\t\t * Filters the maximum error response body size in `download_url()`.\n\t\t\t *\n\t\t\t * @since 5.1.0\n\t\t\t *\n\t\t\t * @see download_url()\n\t\t\t *\n\t\t\t * @param int $size The maximum error response body size. Default 1 KB.\n\t\t\t */\n\t\t\t$response_size = apply_filters( 'download_url_error_max_body_size', KB_IN_BYTES );\n\t\t\t$data['body']  = fread( $tmpf, $response_size );\n\t\t\tfclose( $tmpf );\n\t\t}\n\n\t\tunlink( $tmpfname );\n\t\treturn new WP_Error( 'http_404', trim( wp_remote_retrieve_response_message( $response ) ), $data );\n\t}\n\n\t$content_md5 = wp_remote_retrieve_header( $response, 'content-md5' );\n\tif ( $content_md5 ) {\n\t\t$md5_check = verify_file_md5( $tmpfname, $content_md5 );\n\t\tif ( is_wp_error( $md5_check ) ) {\n\t\t\tunlink( $tmpfname );\n\t\t\treturn $md5_check;\n\t\t}\n\t}\n\n\t// If the caller expects signature verification to occur, check to see if this URL supports it.\n\tif ( $signature_verification ) {\n\t\t/**\n\t\t * Filters the list of hosts which should have Signature Verification attempted on.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param string[] $hostnames List of hostnames.\n\t\t */\n\t\t$signed_hostnames       = apply_filters( 'wp_signature_hosts', array( 'wordpress.org', 'downloads.wordpress.org', 's.w.org' ) );\n\t\t$signature_verification = in_array( parse_url( $url, PHP_URL_HOST ), $signed_hostnames, true );\n\t}\n\n\t// Perform signature valiation if supported.\n\tif ( $signature_verification ) {\n\t\t$signature = wp_remote_retrieve_header( $response, 'x-content-signature' );\n\t\tif ( ! $signature ) {\n\t\t\t// Retrieve signatures from a file if the header wasn't included.\n\t\t\t// WordPress.org stores signatures at $package_url.sig.\n\n\t\t\t$signature_url = false;\n\t\t\t$url_path      = parse_url( $url, PHP_URL_PATH );\n\n\t\t\tif ( '.zip' === substr( $url_path, -4 ) || '.tar.gz' === substr( $url_path, -7 ) ) {\n\t\t\t\t$signature_url = str_replace( $url_path, $url_path . '.sig', $url );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filter the URL where the signature for a file is located.\n\t\t\t *\n\t\t\t * @since 5.2.0\n\t\t\t *\n\t\t\t * @param false|string $signature_url The URL where signatures can be found for a file, or false if none are known.\n\t\t\t * @param string $url                 The URL being verified.\n\t\t\t */\n\t\t\t$signature_url = apply_filters( 'wp_signature_url', $signature_url, $url );\n\n\t\t\tif ( $signature_url ) {\n\t\t\t\t$signature_request = wp_safe_remote_get(\n\t\t\t\t\t$signature_url,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'limit_response_size' => 10 * KB_IN_BYTES, // 10KB should be large enough for quite a few signatures.\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tif ( ! is_wp_error( $signature_request ) && 200 === wp_remote_retrieve_response_code( $signature_request ) ) {\n\t\t\t\t\t$signature = explode( \"\\n\", wp_remote_retrieve_body( $signature_request ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Perform the checks.\n\t\t$signature_verification = verify_file_signature( $tmpfname, $signature, basename( parse_url( $url, PHP_URL_PATH ) ) );\n\t}\n\n\tif ( is_wp_error( $signature_verification ) ) {\n\t\tif (\n\t\t\t/**\n\t\t\t * Filters whether Signature Verification failures should be allowed to soft fail.\n\t\t\t *\n\t\t\t * WARNING: This may be removed from a future release.\n\t\t\t *\n\t\t\t * @since 5.2.0\n\t\t\t *\n\t\t\t * @param bool   $signature_softfail If a softfail is allowed.\n\t\t\t * @param string $url                The url being accessed.\n\t\t\t */\n\t\t\tapply_filters( 'wp_signature_softfail', true, $url )\n\t\t) {\n\t\t\t$signature_verification->add_data( $tmpfname, 'softfail-filename' );\n\t\t} else {\n\t\t\t// Hard-fail.\n\t\t\tunlink( $tmpfname );\n\t\t}\n\n\t\treturn $signature_verification;\n\t}\n\n\treturn $tmpfname;\n}\n\n/**\n * Calculates and compares the MD5 of a file to its expected value.\n *\n * @since 3.7.0\n *\n * @param string $filename     The filename to check the MD5 of.\n * @param string $expected_md5 The expected MD5 of the file, either a base64-encoded raw md5,\n *                             or a hex-encoded md5.\n * @return bool|WP_Error True on success, false when the MD5 format is unknown/unexpected,\n *                       WP_Error on failure.\n */\nfunction verify_file_md5( $filename, $expected_md5 ) {\n\tif ( 32 == strlen( $expected_md5 ) ) {\n\t\t$expected_raw_md5 = pack( 'H*', $expected_md5 );\n\t} elseif ( 24 == strlen( $expected_md5 ) ) {\n\t\t$expected_raw_md5 = base64_decode( $expected_md5 );\n\t} else {\n\t\treturn false; // Unknown format.\n\t}\n\n\t$file_md5 = md5_file( $filename, true );\n\n\tif ( $file_md5 === $expected_raw_md5 ) {\n\t\treturn true;\n\t}\n\n\treturn new WP_Error(\n\t\t'md5_mismatch',\n\t\tsprintf(\n\t\t\t/* translators: 1: File checksum, 2: Expected checksum value. */\n\t\t\t__( 'The checksum of the file (%1$s) does not match the expected checksum value (%2$s).' ),\n\t\t\tbin2hex( $file_md5 ),\n\t\t\tbin2hex( $expected_raw_md5 )\n\t\t)\n\t);\n}\n\n/**\n * Verifies the contents of a file against its ED25519 signature.\n *\n * @since 5.2.0\n *\n * @param string       $filename            The file to validate.\n * @param string|array $signatures          A Signature provided for the file.\n * @param string       $filename_for_errors A friendly filename for errors. Optional.\n * @return bool|WP_Error True on success, false if verification not attempted,\n *                       or WP_Error describing an error condition.\n */\nfunction verify_file_signature( $filename, $signatures, $filename_for_errors = false ) {\n\tif ( ! $filename_for_errors ) {\n\t\t$filename_for_errors = wp_basename( $filename );\n\t}\n\n\t// Check we can process signatures.\n\tif ( ! function_exists( 'sodium_crypto_sign_verify_detached' ) || ! in_array( 'sha384', array_map( 'strtolower', hash_algos() ), true ) ) {\n\t\treturn new WP_Error(\n\t\t\t'signature_verification_unsupported',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: The filename of the package. */\n\t\t\t\t__( 'The authenticity of %s could not be verified as signature verification is unavailable on this system.' ),\n\t\t\t\t'<span class=\"code\">' . esc_html( $filename_for_errors ) . '</span>'\n\t\t\t),\n\t\t\t( ! function_exists( 'sodium_crypto_sign_verify_detached' ) ? 'sodium_crypto_sign_verify_detached' : 'sha384' )\n\t\t);\n\t}\n\n\t// Check for a edge-case affecting PHP Maths abilities.\n\tif (\n\t\t! extension_loaded( 'sodium' ) &&\n\t\tin_array( PHP_VERSION_ID, array( 70200, 70201, 70202 ), true ) &&\n\t\textension_loaded( 'opcache' )\n\t) {\n\t\t// Sodium_Compat isn't compatible with PHP 7.2.0~7.2.2 due to a bug in the PHP Opcache extension, bail early as it'll fail.\n\t\t// https://bugs.php.net/bug.php?id=75938\n\n\t\treturn new WP_Error(\n\t\t\t'signature_verification_unsupported',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: The filename of the package. */\n\t\t\t\t__( 'The authenticity of %s could not be verified as signature verification is unavailable on this system.' ),\n\t\t\t\t'<span class=\"code\">' . esc_html( $filename_for_errors ) . '</span>'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'php'    => phpversion(),\n\t\t\t\t// phpcs:ignore PHPCompatibility.Constants.NewConstants.sodium_library_versionFound\n\t\t\t\t'sodium' => defined( 'SODIUM_LIBRARY_VERSION' ) ? SODIUM_LIBRARY_VERSION : ( defined( 'ParagonIE_Sodium_Compat::VERSION_STRING' ) ? ParagonIE_Sodium_Compat::VERSION_STRING : false ),\n\t\t\t)\n\t\t);\n\n\t}\n\n\t// Verify runtime speed of Sodium_Compat is acceptable.\n\tif ( ! extension_loaded( 'sodium' ) && ! ParagonIE_Sodium_Compat::polyfill_is_fast() ) {\n\t\t$sodium_compat_is_fast = false;\n\n\t\t// Allow for an old version of Sodium_Compat being loaded before the bundled WordPress one.\n\t\tif ( method_exists( 'ParagonIE_Sodium_Compat', 'runtime_speed_test' ) ) {\n\t\t\t// Run `ParagonIE_Sodium_Compat::runtime_speed_test()` in optimized integer mode, as that's what WordPress utilises during signing verifications.\n\t\t\t// phpcs:disable WordPress.NamingConventions.ValidVariableName\n\t\t\t$old_fastMult                      = ParagonIE_Sodium_Compat::$fastMult;\n\t\t\tParagonIE_Sodium_Compat::$fastMult = true;\n\t\t\t$sodium_compat_is_fast             = ParagonIE_Sodium_Compat::runtime_speed_test( 100, 10 );\n\t\t\tParagonIE_Sodium_Compat::$fastMult = $old_fastMult;\n\t\t\t// phpcs:enable\n\t\t}\n\n\t\t// This cannot be performed in a reasonable amount of time.\n\t\t// https://github.com/paragonie/sodium_compat#help-sodium_compat-is-slow-how-can-i-make-it-fast\n\t\tif ( ! $sodium_compat_is_fast ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'signature_verification_unsupported',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: The filename of the package. */\n\t\t\t\t\t__( 'The authenticity of %s could not be verified as signature verification is unavailable on this system.' ),\n\t\t\t\t\t'<span class=\"code\">' . esc_html( $filename_for_errors ) . '</span>'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'php'                => phpversion(),\n\t\t\t\t\t// phpcs:ignore PHPCompatibility.Constants.NewConstants.sodium_library_versionFound\n\t\t\t\t\t'sodium'             => defined( 'SODIUM_LIBRARY_VERSION' ) ? SODIUM_LIBRARY_VERSION : ( defined( 'ParagonIE_Sodium_Compat::VERSION_STRING' ) ? ParagonIE_Sodium_Compat::VERSION_STRING : false ),\n\t\t\t\t\t'polyfill_is_fast'   => false,\n\t\t\t\t\t'max_execution_time' => ini_get( 'max_execution_time' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\tif ( ! $signatures ) {\n\t\treturn new WP_Error(\n\t\t\t'signature_verification_no_signature',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: The filename of the package. */\n\t\t\t\t__( 'The authenticity of %s could not be verified as no signature was found.' ),\n\t\t\t\t'<span class=\"code\">' . esc_html( $filename_for_errors ) . '</span>'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'filename' => $filename_for_errors,\n\t\t\t)\n\t\t);\n\t}\n\n\t$trusted_keys = wp_trusted_keys();\n\t$file_hash    = hash_file( 'sha384', $filename, true );\n\n\tmbstring_binary_safe_encoding();\n\n\t$skipped_key       = 0;\n\t$skipped_signature = 0;\n\n\tforeach ( (array) $signatures as $signature ) {\n\t\t$signature_raw = base64_decode( $signature );\n\n\t\t// Ensure only valid-length signatures are considered.\n\t\tif ( SODIUM_CRYPTO_SIGN_BYTES !== strlen( $signature_raw ) ) {\n\t\t\t$skipped_signature++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tforeach ( (array) $trusted_keys as $key ) {\n\t\t\t$key_raw = base64_decode( $key );\n\n\t\t\t// Only pass valid public keys through.\n\t\t\tif ( SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES !== strlen( $key_raw ) ) {\n\t\t\t\t$skipped_key++;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( sodium_crypto_sign_verify_detached( $signature_raw, $file_hash, $key_raw ) ) {\n\t\t\t\treset_mbstring_encoding();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\treset_mbstring_encoding();\n\n\treturn new WP_Error(\n\t\t'signature_verification_failed',\n\t\tsprintf(\n\t\t\t/* translators: %s: The filename of the package. */\n\t\t\t__( 'The authenticity of %s could not be verified.' ),\n\t\t\t'<span class=\"code\">' . esc_html( $filename_for_errors ) . '</span>'\n\t\t),\n\t\t// Error data helpful for debugging:\n\t\tarray(\n\t\t\t'filename'    => $filename_for_errors,\n\t\t\t'keys'        => $trusted_keys,\n\t\t\t'signatures'  => $signatures,\n\t\t\t'hash'        => bin2hex( $file_hash ),\n\t\t\t'skipped_key' => $skipped_key,\n\t\t\t'skipped_sig' => $skipped_signature,\n\t\t\t'php'         => phpversion(),\n\t\t\t// phpcs:ignore PHPCompatibility.Constants.NewConstants.sodium_library_versionFound\n\t\t\t'sodium'      => defined( 'SODIUM_LIBRARY_VERSION' ) ? SODIUM_LIBRARY_VERSION : ( defined( 'ParagonIE_Sodium_Compat::VERSION_STRING' ) ? ParagonIE_Sodium_Compat::VERSION_STRING : false ),\n\t\t)\n\t);\n}\n\n/**\n * Retrieves the list of signing keys trusted by WordPress.\n *\n * @since 5.2.0\n *\n * @return string[] Array of base64-encoded signing keys.\n */\nfunction wp_trusted_keys() {\n\t$trusted_keys = array();\n\n\tif ( time() < 1617235200 ) {\n\t\t// WordPress.org Key #1 - This key is only valid before April 1st, 2021.\n\t\t$trusted_keys[] = 'fRPyrxb/MvVLbdsYi+OOEv4xc+Eqpsj+kkAS6gNOkI0=';\n\t}\n\n\t// TODO: Add key #2 with longer expiration.\n\n\t/**\n\t * Filter the valid signing keys used to verify the contents of files.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string[] $trusted_keys The trusted keys that may sign packages.\n\t */\n\treturn apply_filters( 'wp_trusted_keys', $trusted_keys );\n}\n\n/**\n * Unzips a specified ZIP file to a location on the filesystem via the WordPress\n * Filesystem Abstraction.\n *\n * Assumes that WP_Filesystem() has already been called and set up. Does not extract\n * a root-level __MACOSX directory, if present.\n *\n * Attempts to increase the PHP memory limit to 256M before uncompressing. However,\n * the most memory required shouldn't be much larger than the archive itself.\n *\n * @since 2.5.0\n *\n * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n *\n * @param string $file Full path and filename of ZIP archive.\n * @param string $to   Full path on the filesystem to extract archive to.\n * @return true|WP_Error True on success, WP_Error on failure.\n */\nfunction unzip_file( $file, $to ) {\n\tglobal $wp_filesystem;\n\n\tif ( ! $wp_filesystem || ! is_object( $wp_filesystem ) ) {\n\t\treturn new WP_Error( 'fs_unavailable', __( 'Could not access filesystem.' ) );\n\t}\n\n\t// Unzip can use a lot of memory, but not this much hopefully.\n\twp_raise_memory_limit( 'admin' );\n\n\t$needed_dirs = array();\n\t$to          = trailingslashit( $to );\n\n\t// Determine any parent directories needed (of the upgrade directory).\n\tif ( ! $wp_filesystem->is_dir( $to ) ) { // Only do parents if no children exist.\n\t\t$path = preg_split( '![/\\\\\\]!', untrailingslashit( $to ) );\n\t\tfor ( $i = count( $path ); $i >= 0; $i-- ) {\n\t\t\tif ( empty( $path[ $i ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$dir = implode( '/', array_slice( $path, 0, $i + 1 ) );\n\t\t\tif ( preg_match( '!^[a-z]:$!i', $dir ) ) { // Skip it if it looks like a Windows Drive letter.\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! $wp_filesystem->is_dir( $dir ) ) {\n\t\t\t\t$needed_dirs[] = $dir;\n\t\t\t} else {\n\t\t\t\tbreak; // A folder exists, therefore we don't need to check the levels below this.\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filters whether to use ZipArchive to unzip archives.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param bool $ziparchive Whether to use ZipArchive. Default true.\n\t */\n\tif ( class_exists( 'ZipArchive', false ) && apply_filters( 'unzip_file_use_ziparchive', true ) ) {\n\t\t$result = _unzip_file_ziparchive( $file, $to, $needed_dirs );\n\t\tif ( true === $result ) {\n\t\t\treturn $result;\n\t\t} elseif ( is_wp_error( $result ) ) {\n\t\t\tif ( 'incompatible_archive' !== $result->get_error_code() ) {\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t}\n\t// Fall through to PclZip if ZipArchive is not available, or encountered an error opening the file.\n\treturn _unzip_file_pclzip( $file, $to, $needed_dirs );\n}\n\n/**\n * Attempts to unzip an archive using the ZipArchive class.\n *\n * This function should not be called directly, use `unzip_file()` instead.\n *\n * Assumes that WP_Filesystem() has already been called and set up.\n *\n * @since 3.0.0\n * @access private\n *\n * @see unzip_file()\n *\n * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n *\n * @param string   $file        Full path and filename of ZIP archive.\n * @param string   $to          Full path on the filesystem to extract archive to.\n * @param string[] $needed_dirs A partial list of required folders needed to be created.\n * @return true|WP_Error True on success, WP_Error on failure.\n */\nfunction _unzip_file_ziparchive( $file, $to, $needed_dirs = array() ) {\n\tglobal $wp_filesystem;\n\n\t$z = new ZipArchive();\n\n\t$zopen = $z->open( $file, ZIPARCHIVE::CHECKCONS );\n\tif ( true !== $zopen ) {\n\t\treturn new WP_Error( 'incompatible_archive', __( 'Incompatible Archive.' ), array( 'ziparchive_error' => $zopen ) );\n\t}\n\n\t$uncompressed_size = 0;\n\n\tfor ( $i = 0; $i < $z->numFiles; $i++ ) {\n\t\t$info = $z->statIndex( $i );\n\t\tif ( ! $info ) {\n\t\t\treturn new WP_Error( 'stat_failed_ziparchive', __( 'Could not retrieve file from archive.' ) );\n\t\t}\n\n\t\tif ( '__MACOSX/' === substr( $info['name'], 0, 9 ) ) { // Skip the OS X-created __MACOSX directory.\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Don't extract invalid files:\n\t\tif ( 0 !== validate_file( $info['name'] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$uncompressed_size += $info['size'];\n\n\t\t$dirname = dirname( $info['name'] );\n\n\t\tif ( '/' === substr( $info['name'], -1 ) ) {\n\t\t\t// Directory.\n\t\t\t$needed_dirs[] = $to . untrailingslashit( $info['name'] );\n\t\t} elseif ( '.' !== $dirname ) {\n\t\t\t// Path to a file.\n\t\t\t$needed_dirs[] = $to . untrailingslashit( $dirname );\n\t\t}\n\t}\n\n\t/*\n\t * disk_free_space() could return false. Assume that any falsey value is an error.\n\t * A disk that has zero free bytes has bigger problems.\n\t * Require we have enough space to unzip the file and copy its contents, with a 10% buffer.\n\t */\n\tif ( wp_doing_cron() ) {\n\t\t$available_space = @disk_free_space( WP_CONTENT_DIR );\n\t\tif ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space ) {\n\t\t\treturn new WP_Error( 'disk_full_unzip_file', __( 'Could not copy files. You may have run out of disk space.' ), compact( 'uncompressed_size', 'available_space' ) );\n\t\t}\n\t}\n\n\t$needed_dirs = array_unique( $needed_dirs );\n\tforeach ( $needed_dirs as $dir ) {\n\t\t// Check the parent folders of the folders all exist within the creation array.\n\t\tif ( untrailingslashit( $to ) == $dir ) { // Skip over the working directory, we know this exists (or will exist).\n\t\t\tcontinue;\n\t\t}\n\t\tif ( strpos( $dir, $to ) === false ) { // If the directory is not within the working directory, skip it.\n\t\t\tcontinue;\n\t\t}\n\n\t\t$parent_folder = dirname( $dir );\n\t\twhile ( ! empty( $parent_folder ) && untrailingslashit( $to ) != $parent_folder && ! in_array( $parent_folder, $needed_dirs, true ) ) {\n\t\t\t$needed_dirs[] = $parent_folder;\n\t\t\t$parent_folder = dirname( $parent_folder );\n\t\t}\n\t}\n\tasort( $needed_dirs );\n\n\t// Create those directories if need be:\n\tforeach ( $needed_dirs as $_dir ) {\n\t\t// Only check to see if the Dir exists upon creation failure. Less I/O this way.\n\t\tif ( ! $wp_filesystem->mkdir( $_dir, FS_CHMOD_DIR ) && ! $wp_filesystem->is_dir( $_dir ) ) {\n\t\t\treturn new WP_Error( 'mkdir_failed_ziparchive', __( 'Could not create directory.' ), substr( $_dir, strlen( $to ) ) );\n\t\t}\n\t}\n\tunset( $needed_dirs );\n\n\tfor ( $i = 0; $i < $z->numFiles; $i++ ) {\n\t\t$info = $z->statIndex( $i );\n\t\tif ( ! $info ) {\n\t\t\treturn new WP_Error( 'stat_failed_ziparchive', __( 'Could not retrieve file from archive.' ) );\n\t\t}\n\n\t\tif ( '/' === substr( $info['name'], -1 ) ) { // Directory.\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( '__MACOSX/' === substr( $info['name'], 0, 9 ) ) { // Don't extract the OS X-created __MACOSX directory files.\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Don't extract invalid files:\n\t\tif ( 0 !== validate_file( $info['name'] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$contents = $z->getFromIndex( $i );\n\t\tif ( false === $contents ) {\n\t\t\treturn new WP_Error( 'extract_failed_ziparchive', __( 'Could not extract file from archive.' ), $info['name'] );\n\t\t}\n\n\t\tif ( ! $wp_filesystem->put_contents( $to . $info['name'], $contents, FS_CHMOD_FILE ) ) {\n\t\t\treturn new WP_Error( 'copy_failed_ziparchive', __( 'Could not copy file.' ), $info['name'] );\n\t\t}\n\t}\n\n\t$z->close();\n\n\treturn true;\n}\n\n/**\n * Attempts to unzip an archive using the PclZip library.\n *\n * This function should not be called directly, use `unzip_file()` instead.\n *\n * Assumes that WP_Filesystem() has already been called and set up.\n *\n * @since 3.0.0\n * @access private\n *\n * @see unzip_file()\n *\n * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n *\n * @param string   $file        Full path and filename of ZIP archive.\n * @param string   $to          Full path on the filesystem to extract archive to.\n * @param string[] $needed_dirs A partial list of required folders needed to be created.\n * @return true|WP_Error True on success, WP_Error on failure.\n */\nfunction _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) {\n\tglobal $wp_filesystem;\n\n\tmbstring_binary_safe_encoding();\n\n\trequire_once ABSPATH . 'wp-admin/includes/class-pclzip.php';\n\n\t$archive = new PclZip( $file );\n\n\t$archive_files = $archive->extract( PCLZIP_OPT_EXTRACT_AS_STRING );\n\n\treset_mbstring_encoding();\n\n\t// Is the archive valid?\n\tif ( ! is_array( $archive_files ) ) {\n\t\treturn new WP_Error( 'incompatible_archive', __( 'Incompatible Archive.' ), $archive->errorInfo( true ) );\n\t}\n\n\tif ( 0 === count( $archive_files ) ) {\n\t\treturn new WP_Error( 'empty_archive_pclzip', __( 'Empty archive.' ) );\n\t}\n\n\t$uncompressed_size = 0;\n\n\t// Determine any children directories needed (From within the archive).\n\tforeach ( $archive_files as $file ) {\n\t\tif ( '__MACOSX/' === substr( $file['filename'], 0, 9 ) ) { // Skip the OS X-created __MACOSX directory.\n\t\t\tcontinue;\n\t\t}\n\n\t\t$uncompressed_size += $file['size'];\n\n\t\t$needed_dirs[] = $to . untrailingslashit( $file['folder'] ? $file['filename'] : dirname( $file['filename'] ) );\n\t}\n\n\t/*\n\t * disk_free_space() could return false. Assume that any falsey value is an error.\n\t * A disk that has zero free bytes has bigger problems.\n\t * Require we have enough space to unzip the file and copy its contents, with a 10% buffer.\n\t */\n\tif ( wp_doing_cron() ) {\n\t\t$available_space = @disk_free_space( WP_CONTENT_DIR );\n\t\tif ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space ) {\n\t\t\treturn new WP_Error( 'disk_full_unzip_file', __( 'Could not copy files. You may have run out of disk space.' ), compact( 'uncompressed_size', 'available_space' ) );\n\t\t}\n\t}\n\n\t$needed_dirs = array_unique( $needed_dirs );\n\tforeach ( $needed_dirs as $dir ) {\n\t\t// Check the parent folders of the folders all exist within the creation array.\n\t\tif ( untrailingslashit( $to ) == $dir ) { // Skip over the working directory, we know this exists (or will exist).\n\t\t\tcontinue;\n\t\t}\n\t\tif ( strpos( $dir, $to ) === false ) { // If the directory is not within the working directory, skip it.\n\t\t\tcontinue;\n\t\t}\n\n\t\t$parent_folder = dirname( $dir );\n\t\twhile ( ! empty( $parent_folder ) && untrailingslashit( $to ) != $parent_folder && ! in_array( $parent_folder, $needed_dirs, true ) ) {\n\t\t\t$needed_dirs[] = $parent_folder;\n\t\t\t$parent_folder = dirname( $parent_folder );\n\t\t}\n\t}\n\tasort( $needed_dirs );\n\n\t// Create those directories if need be:\n\tforeach ( $needed_dirs as $_dir ) {\n\t\t// Only check to see if the dir exists upon creation failure. Less I/O this way.\n\t\tif ( ! $wp_filesystem->mkdir( $_dir, FS_CHMOD_DIR ) && ! $wp_filesystem->is_dir( $_dir ) ) {\n\t\t\treturn new WP_Error( 'mkdir_failed_pclzip', __( 'Could not create directory.' ), substr( $_dir, strlen( $to ) ) );\n\t\t}\n\t}\n\tunset( $needed_dirs );\n\n\t// Extract the files from the zip.\n\tforeach ( $archive_files as $file ) {\n\t\tif ( $file['folder'] ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( '__MACOSX/' === substr( $file['filename'], 0, 9 ) ) { // Don't extract the OS X-created __MACOSX directory files.\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Don't extract invalid files:\n\t\tif ( 0 !== validate_file( $file['filename'] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( ! $wp_filesystem->put_contents( $to . $file['filename'], $file['content'], FS_CHMOD_FILE ) ) {\n\t\t\treturn new WP_Error( 'copy_failed_pclzip', __( 'Could not copy file.' ), $file['filename'] );\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * Copies a directory from one location to another via the WordPress Filesystem\n * Abstraction.\n *\n * Assumes that WP_Filesystem() has already been called and setup.\n *\n * @since 2.5.0\n *\n * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n *\n * @param string   $from      Source directory.\n * @param string   $to        Destination directory.\n * @param string[] $skip_list An array of files/folders to skip copying.\n * @return true|WP_Error True on success, WP_Error on failure.\n */\nfunction copy_dir( $from, $to, $skip_list = array() ) {\n\tglobal $wp_filesystem;\n\n\t$dirlist = $wp_filesystem->dirlist( $from );\n\n\t$from = trailingslashit( $from );\n\t$to   = trailingslashit( $to );\n\n\tforeach ( (array) $dirlist as $filename => $fileinfo ) {\n\t\tif ( in_array( $filename, $skip_list, true ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( 'f' === $fileinfo['type'] ) {\n\t\t\tif ( ! $wp_filesystem->copy( $from . $filename, $to . $filename, true, FS_CHMOD_FILE ) ) {\n\t\t\t\t// If copy failed, chmod file to 0644 and try again.\n\t\t\t\t$wp_filesystem->chmod( $to . $filename, FS_CHMOD_FILE );\n\t\t\t\tif ( ! $wp_filesystem->copy( $from . $filename, $to . $filename, true, FS_CHMOD_FILE ) ) {\n\t\t\t\t\treturn new WP_Error( 'copy_failed_copy_dir', __( 'Could not copy file.' ), $to . $filename );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twp_opcache_invalidate( $to . $filename );\n\t\t} elseif ( 'd' === $fileinfo['type'] ) {\n\t\t\tif ( ! $wp_filesystem->is_dir( $to . $filename ) ) {\n\t\t\t\tif ( ! $wp_filesystem->mkdir( $to . $filename, FS_CHMOD_DIR ) ) {\n\t\t\t\t\treturn new WP_Error( 'mkdir_failed_copy_dir', __( 'Could not create directory.' ), $to . $filename );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Generate the $sub_skip_list for the subdirectory as a sub-set of the existing $skip_list.\n\t\t\t$sub_skip_list = array();\n\t\t\tforeach ( $skip_list as $skip_item ) {\n\t\t\t\tif ( 0 === strpos( $skip_item, $filename . '/' ) ) {\n\t\t\t\t\t$sub_skip_list[] = preg_replace( '!^' . preg_quote( $filename, '!' ) . '/!i', '', $skip_item );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$result = copy_dir( $from . $filename, $to . $filename, $sub_skip_list );\n\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Initializes and connects the WordPress Filesystem Abstraction classes.\n *\n * This function will include the chosen transport and attempt connecting.\n *\n * Plugins may add extra transports, And force WordPress to use them by returning\n * the filename via the {@see 'filesystem_method_file'} filter.\n *\n * @since 2.5.0\n *\n * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n *\n * @param array|false  $args                         Optional. Connection args, These are passed\n *                                                   directly to the `WP_Filesystem_*()` classes.\n *                                                   Default false.\n * @param string|false $context                      Optional. Context for get_filesystem_method().\n *                                                   Default false.\n * @param bool         $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable.\n *                                                   Default false.\n * @return bool|null True on success, false on failure,\n *                   null if the filesystem method class file does not exist.\n */\nfunction WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_ownership = false ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid\n\tglobal $wp_filesystem;\n\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php';\n\n\t$method = get_filesystem_method( $args, $context, $allow_relaxed_file_ownership );\n\n\tif ( ! $method ) {\n\t\treturn false;\n\t}\n\n\tif ( ! class_exists( \"WP_Filesystem_$method\" ) ) {\n\n\t\t/**\n\t\t * Filters the path for a specific filesystem method class file.\n\t\t *\n\t\t * @since 2.6.0\n\t\t *\n\t\t * @see get_filesystem_method()\n\t\t *\n\t\t * @param string $path   Path to the specific filesystem method class file.\n\t\t * @param string $method The filesystem method to use.\n\t\t */\n\t\t$abstraction_file = apply_filters( 'filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method );\n\n\t\tif ( ! file_exists( $abstraction_file ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\trequire_once $abstraction_file;\n\t}\n\t$method = \"WP_Filesystem_$method\";\n\n\t$wp_filesystem = new $method( $args );\n\n\t/*\n\t * Define the timeouts for the connections. Only available after the constructor is called\n\t * to allow for per-transport overriding of the default.\n\t */\n\tif ( ! defined( 'FS_CONNECT_TIMEOUT' ) ) {\n\t\tdefine( 'FS_CONNECT_TIMEOUT', 30 );\n\t}\n\tif ( ! defined( 'FS_TIMEOUT' ) ) {\n\t\tdefine( 'FS_TIMEOUT', 30 );\n\t}\n\n\tif ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {\n\t\treturn false;\n\t}\n\n\tif ( ! $wp_filesystem->connect() ) {\n\t\treturn false; // There was an error connecting to the server.\n\t}\n\n\t// Set the permission constants if not already set.\n\tif ( ! defined( 'FS_CHMOD_DIR' ) ) {\n\t\tdefine( 'FS_CHMOD_DIR', ( fileperms( ABSPATH ) & 0777 | 0755 ) );\n\t}\n\tif ( ! defined( 'FS_CHMOD_FILE' ) ) {\n\t\tdefine( 'FS_CHMOD_FILE', ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ) );\n\t}\n\n\treturn true;\n}\n\n/**\n * Determines which method to use for reading, writing, modifying, or deleting\n * files on the filesystem.\n *\n * The priority of the transports are: Direct, SSH2, FTP PHP Extension, FTP Sockets\n * (Via Sockets class, or `fsockopen()`). Valid values for these are: 'direct', 'ssh2',\n * 'ftpext' or 'ftpsockets'.\n *\n * The return value can be overridden by defining the `FS_METHOD` constant in `wp-config.php`,\n * or filtering via {@see 'filesystem_method'}.\n *\n * @link https://wordpress.org/support/article/editing-wp-config-php/#wordpress-upgrade-constants\n *\n * Plugins may define a custom transport handler, See WP_Filesystem().\n *\n * @since 2.5.0\n *\n * @global callable $_wp_filesystem_direct_method\n *\n * @param array  $args                         Optional. Connection details. Default empty array.\n * @param string $context                      Optional. Full path to the directory that is tested\n *                                             for being writable. Default empty.\n * @param bool   $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable.\n *                                             Default false.\n * @return string The transport to use, see description for valid return values.\n */\nfunction get_filesystem_method( $args = array(), $context = '', $allow_relaxed_file_ownership = false ) {\n\t// Please ensure that this is either 'direct', 'ssh2', 'ftpext', or 'ftpsockets'.\n\t$method = defined( 'FS_METHOD' ) ? FS_METHOD : false;\n\n\tif ( ! $context ) {\n\t\t$context = WP_CONTENT_DIR;\n\t}\n\n\t// If the directory doesn't exist (wp-content/languages) then use the parent directory as we'll create it.\n\tif ( WP_LANG_DIR == $context && ! is_dir( $context ) ) {\n\t\t$context = dirname( $context );\n\t}\n\n\t$context = trailingslashit( $context );\n\n\tif ( ! $method ) {\n\n\t\t$temp_file_name = $context . 'temp-write-test-' . str_replace( '.', '-', uniqid( '', true ) );\n\t\t$temp_handle    = @fopen( $temp_file_name, 'w' );\n\t\tif ( $temp_handle ) {\n\n\t\t\t// Attempt to determine the file owner of the WordPress files, and that of newly created files.\n\t\t\t$wp_file_owner   = false;\n\t\t\t$temp_file_owner = false;\n\t\t\tif ( function_exists( 'fileowner' ) ) {\n\t\t\t\t$wp_file_owner   = @fileowner( __FILE__ );\n\t\t\t\t$temp_file_owner = @fileowner( $temp_file_name );\n\t\t\t}\n\n\t\t\tif ( false !== $wp_file_owner && $wp_file_owner === $temp_file_owner ) {\n\t\t\t\t/*\n\t\t\t\t * WordPress is creating files as the same owner as the WordPress files,\n\t\t\t\t * this means it's safe to modify & create new files via PHP.\n\t\t\t\t */\n\t\t\t\t$method                                  = 'direct';\n\t\t\t\t$GLOBALS['_wp_filesystem_direct_method'] = 'file_owner';\n\t\t\t} elseif ( $allow_relaxed_file_ownership ) {\n\t\t\t\t/*\n\t\t\t\t * The $context directory is writable, and $allow_relaxed_file_ownership is set,\n\t\t\t\t * this means we can modify files safely in this directory.\n\t\t\t\t * This mode doesn't create new files, only alter existing ones.\n\t\t\t\t */\n\t\t\t\t$method                                  = 'direct';\n\t\t\t\t$GLOBALS['_wp_filesystem_direct_method'] = 'relaxed_ownership';\n\t\t\t}\n\n\t\t\tfclose( $temp_handle );\n\t\t\t@unlink( $temp_file_name );\n\t\t}\n\t}\n\n\tif ( ! $method && isset( $args['connection_type'] ) && 'ssh' === $args['connection_type'] && extension_loaded( 'ssh2' ) ) {\n\t\t$method = 'ssh2';\n\t}\n\tif ( ! $method && extension_loaded( 'ftp' ) ) {\n\t\t$method = 'ftpext';\n\t}\n\tif ( ! $method && ( extension_loaded( 'sockets' ) || function_exists( 'fsockopen' ) ) ) {\n\t\t$method = 'ftpsockets'; // Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread.\n\t}\n\n\t/**\n\t * Filters the filesystem method to use.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param string $method                       Filesystem method to return.\n\t * @param array  $args                         An array of connection details for the method.\n\t * @param string $context                      Full path to the directory that is tested for being writable.\n\t * @param bool   $allow_relaxed_file_ownership Whether to allow Group/World writable.\n\t */\n\treturn apply_filters( 'filesystem_method', $method, $args, $context, $allow_relaxed_file_ownership );\n}\n\n/**\n * Displays a form to the user to request for their FTP/SSH details in order\n * to connect to the filesystem.\n *\n * All chosen/entered details are saved, excluding the password.\n *\n * Hostnames may be in the form of hostname:portnumber (eg: wordpress.org:2467)\n * to specify an alternate FTP/SSH port.\n *\n * Plugins may override this form by returning true|false via the {@see 'request_filesystem_credentials'} filter.\n *\n * @since 2.5.0\n * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.\n *\n * @global string $pagenow\n *\n * @param string        $form_post                    The URL to post the form to.\n * @param string        $type                         Optional. Chosen type of filesystem. Default empty.\n * @param bool|WP_Error $error                        Optional. Whether the current request has failed\n *                                                    to connect, or an error object. Default false.\n * @param string        $context                      Optional. Full path to the directory that is tested\n *                                                    for being writable. Default empty.\n * @param array         $extra_fields                 Optional. Extra `POST` fields to be checked\n *                                                    for inclusion in the post. Default null.\n * @param bool          $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable.\n *                                                    Default false.\n * @return bool|array True if no filesystem credentials are required,\n *                    false if they are required but have not been provided,\n *                    array of credentials if they are required and have been provided.\n */\nfunction request_filesystem_credentials( $form_post, $type = '', $error = false, $context = '', $extra_fields = null, $allow_relaxed_file_ownership = false ) {\n\tglobal $pagenow;\n\n\t/**\n\t * Filters the filesystem credentials.\n\t *\n\t * Returning anything other than an empty string will effectively short-circuit\n\t * output of the filesystem credentials form, returning that value instead.\n\t *\n\t * A filter should return true if no filesystem credentials are required, false if they are required but have not been\n\t * provided, or an array of credentials if they are required and have been provided.\n\t *\n\t * @since 2.5.0\n\t * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.\n\t *\n\t * @param mixed         $credentials                  Credentials to return instead. Default empty string.\n\t * @param string        $form_post                    The URL to post the form to.\n\t * @param string        $type                         Chosen type of filesystem.\n\t * @param bool|WP_Error $error                        Whether the current request has failed to connect,\n\t *                                                    or an error object.\n\t * @param string        $context                      Full path to the directory that is tested for\n\t *                                                    being writable.\n\t * @param array         $extra_fields                 Extra POST fields.\n\t * @param bool          $allow_relaxed_file_ownership Whether to allow Group/World writable.\n\t */\n\t$req_cred = apply_filters( 'request_filesystem_credentials', '', $form_post, $type, $error, $context, $extra_fields, $allow_relaxed_file_ownership );\n\tif ( '' !== $req_cred ) {\n\t\treturn $req_cred;\n\t}\n\n\tif ( empty( $type ) ) {\n\t\t$type = get_filesystem_method( array(), $context, $allow_relaxed_file_ownership );\n\t}\n\n\tif ( 'direct' === $type ) {\n\t\treturn true;\n\t}\n\n\tif ( is_null( $extra_fields ) ) {\n\t\t$extra_fields = array( 'version', 'locale' );\n\t}\n\n\t$credentials = get_option(\n\t\t'ftp_credentials',\n\t\tarray(\n\t\t\t'hostname' => '',\n\t\t\t'username' => '',\n\t\t)\n\t);\n\n\t$submitted_form = wp_unslash( $_POST );\n\n\t// Verify nonce, or unset submitted form field values on failure.\n\tif ( ! isset( $_POST['_fs_nonce'] ) || ! wp_verify_nonce( $_POST['_fs_nonce'], 'filesystem-credentials' ) ) {\n\t\tunset(\n\t\t\t$submitted_form['hostname'],\n\t\t\t$submitted_form['username'],\n\t\t\t$submitted_form['password'],\n\t\t\t$submitted_form['public_key'],\n\t\t\t$submitted_form['private_key'],\n\t\t\t$submitted_form['connection_type']\n\t\t);\n\t}\n\n\t// If defined, set it to that. Else, if POST'd, set it to that. If not, set it to whatever it previously was (saved details in option).\n\t$credentials['hostname'] = defined( 'FTP_HOST' ) ? FTP_HOST : ( ! empty( $submitted_form['hostname'] ) ? $submitted_form['hostname'] : $credentials['hostname'] );\n\t$credentials['username'] = defined( 'FTP_USER' ) ? FTP_USER : ( ! empty( $submitted_form['username'] ) ? $submitted_form['username'] : $credentials['username'] );\n\t$credentials['password'] = defined( 'FTP_PASS' ) ? FTP_PASS : ( ! empty( $submitted_form['password'] ) ? $submitted_form['password'] : '' );\n\n\t// Check to see if we are setting the public/private keys for ssh.\n\t$credentials['public_key']  = defined( 'FTP_PUBKEY' ) ? FTP_PUBKEY : ( ! empty( $submitted_form['public_key'] ) ? $submitted_form['public_key'] : '' );\n\t$credentials['private_key'] = defined( 'FTP_PRIKEY' ) ? FTP_PRIKEY : ( ! empty( $submitted_form['private_key'] ) ? $submitted_form['private_key'] : '' );\n\n\t// Sanitize the hostname, some people might pass in odd data.\n\t$credentials['hostname'] = preg_replace( '|\\w+://|', '', $credentials['hostname'] ); // Strip any schemes off.\n\n\tif ( strpos( $credentials['hostname'], ':' ) ) {\n\t\tlist( $credentials['hostname'], $credentials['port'] ) = explode( ':', $credentials['hostname'], 2 );\n\t\tif ( ! is_numeric( $credentials['port'] ) ) {\n\t\t\tunset( $credentials['port'] );\n\t\t}\n\t} else {\n\t\tunset( $credentials['port'] );\n\t}\n\n\tif ( ( defined( 'FTP_SSH' ) && FTP_SSH ) || ( defined( 'FS_METHOD' ) && 'ssh2' === FS_METHOD ) ) {\n\t\t$credentials['connection_type'] = 'ssh';\n\t} elseif ( ( defined( 'FTP_SSL' ) && FTP_SSL ) && 'ftpext' === $type ) { // Only the FTP Extension understands SSL.\n\t\t$credentials['connection_type'] = 'ftps';\n\t} elseif ( ! empty( $submitted_form['connection_type'] ) ) {\n\t\t$credentials['connection_type'] = $submitted_form['connection_type'];\n\t} elseif ( ! isset( $credentials['connection_type'] ) ) { // All else fails (and it's not defaulted to something else saved), default to FTP.\n\t\t$credentials['connection_type'] = 'ftp';\n\t}\n\tif ( ! $error\n\t\t&& ( ( ! empty( $credentials['password'] ) && ! empty( $credentials['username'] ) && ! empty( $credentials['hostname'] ) )\n\t\t\t|| ( 'ssh' === $credentials['connection_type'] && ! empty( $credentials['public_key'] ) && ! empty( $credentials['private_key'] ) )\n\t\t)\n\t) {\n\t\t$stored_credentials = $credentials;\n\n\t\tif ( ! empty( $stored_credentials['port'] ) ) { // Save port as part of hostname to simplify above code.\n\t\t\t$stored_credentials['hostname'] .= ':' . $stored_credentials['port'];\n\t\t}\n\n\t\tunset( $stored_credentials['password'], $stored_credentials['port'], $stored_credentials['private_key'], $stored_credentials['public_key'] );\n\n\t\tif ( ! wp_installing() ) {\n\t\t\tupdate_option( 'ftp_credentials', $stored_credentials );\n\t\t}\n\n\t\treturn $credentials;\n\t}\n\t$hostname        = isset( $credentials['hostname'] ) ? $credentials['hostname'] : '';\n\t$username        = isset( $credentials['username'] ) ? $credentials['username'] : '';\n\t$public_key      = isset( $credentials['public_key'] ) ? $credentials['public_key'] : '';\n\t$private_key     = isset( $credentials['private_key'] ) ? $credentials['private_key'] : '';\n\t$port            = isset( $credentials['port'] ) ? $credentials['port'] : '';\n\t$connection_type = isset( $credentials['connection_type'] ) ? $credentials['connection_type'] : '';\n\n\tif ( $error ) {\n\t\t$error_string = __( '<strong>Error</strong>: Could not connect to the server. Please verify the settings are correct.' );\n\t\tif ( is_wp_error( $error ) ) {\n\t\t\t$error_string = esc_html( $error->get_error_message() );\n\t\t}\n\t\techo '<div id=\"message\" class=\"error\"><p>' . $error_string . '</p></div>';\n\t}\n\n\t$types = array();\n\tif ( extension_loaded( 'ftp' ) || extension_loaded( 'sockets' ) || function_exists( 'fsockopen' ) ) {\n\t\t$types['ftp'] = __( 'FTP' );\n\t}\n\tif ( extension_loaded( 'ftp' ) ) { // Only this supports FTPS.\n\t\t$types['ftps'] = __( 'FTPS (SSL)' );\n\t}\n\tif ( extension_loaded( 'ssh2' ) ) {\n\t\t$types['ssh'] = __( 'SSH2' );\n\t}\n\n\t/**\n\t * Filters the connection types to output to the filesystem credentials form.\n\t *\n\t * @since 2.9.0\n\t * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.\n\t *\n\t * @param string[]      $types       Types of connections.\n\t * @param array         $credentials Credentials to connect with.\n\t * @param string        $type        Chosen filesystem method.\n\t * @param bool|WP_Error $error       Whether the current request has failed to connect,\n\t *                                   or an error object.\n\t * @param string        $context     Full path to the directory that is tested for being writable.\n\t */\n\t$types = apply_filters( 'fs_ftp_connection_types', $types, $credentials, $type, $error, $context );\n\n\t?>\n<form action=\"<?php echo esc_url( $form_post ); ?>\" method=\"post\">\n<div id=\"request-filesystem-credentials-form\" class=\"request-filesystem-credentials-form\">\n\t<?php\n\t// Print a H1 heading in the FTP credentials modal dialog, default is a H2.\n\t$heading_tag = 'h2';\n\tif ( 'plugins.php' === $pagenow || 'plugin-install.php' === $pagenow ) {\n\t\t$heading_tag = 'h1';\n\t}\n\techo \"<$heading_tag id='request-filesystem-credentials-title'>\" . __( 'Connection Information' ) . \"</$heading_tag>\";\n\t?>\n<p id=\"request-filesystem-credentials-desc\">\n\t<?php\n\t$label_user = __( 'Username' );\n\t$label_pass = __( 'Password' );\n\t_e( 'To perform the requested action, WordPress needs to access your web server.' );\n\techo ' ';\n\tif ( ( isset( $types['ftp'] ) || isset( $types['ftps'] ) ) ) {\n\t\tif ( isset( $types['ssh'] ) ) {\n\t\t\t_e( 'Please enter your FTP or SSH credentials to proceed.' );\n\t\t\t$label_user = __( 'FTP/SSH Username' );\n\t\t\t$label_pass = __( 'FTP/SSH Password' );\n\t\t} else {\n\t\t\t_e( 'Please enter your FTP credentials to proceed.' );\n\t\t\t$label_user = __( 'FTP Username' );\n\t\t\t$label_pass = __( 'FTP Password' );\n\t\t}\n\t\techo ' ';\n\t}\n\t_e( 'If you do not remember your credentials, you should contact your web host.' );\n\n\t$hostname_value = esc_attr( $hostname );\n\tif ( ! empty( $port ) ) {\n\t\t$hostname_value .= \":$port\";\n\t}\n\n\t$password_value = '';\n\tif ( defined( 'FTP_PASS' ) ) {\n\t\t$password_value = '*****';\n\t}\n\t?>\n</p>\n<label for=\"hostname\">\n\t<span class=\"field-title\"><?php _e( 'Hostname' ); ?></span>\n\t<input name=\"hostname\" type=\"text\" id=\"hostname\" aria-describedby=\"request-filesystem-credentials-desc\" class=\"code\" placeholder=\"<?php esc_attr_e( 'example: www.wordpress.org' ); ?>\" value=\"<?php echo $hostname_value; ?>\"<?php disabled( defined( 'FTP_HOST' ) ); ?> />\n</label>\n<div class=\"ftp-username\">\n\t<label for=\"username\">\n\t\t<span class=\"field-title\"><?php echo $label_user; ?></span>\n\t\t<input name=\"username\" type=\"text\" id=\"username\" value=\"<?php echo esc_attr( $username ); ?>\"<?php disabled( defined( 'FTP_USER' ) ); ?> />\n\t</label>\n</div>\n<div class=\"ftp-password\">\n\t<label for=\"password\">\n\t\t<span class=\"field-title\"><?php echo $label_pass; ?></span>\n\t\t<input name=\"password\" type=\"password\" id=\"password\" value=\"<?php echo $password_value; ?>\"<?php disabled( defined( 'FTP_PASS' ) ); ?> />\n\t\t<em>\n\t\t<?php\n\t\tif ( ! defined( 'FTP_PASS' ) ) {\n\t\t\t_e( 'This password will not be stored on the server.' );}\n\t\t?>\n</em>\n\t</label>\n</div>\n<fieldset>\n<legend><?php _e( 'Connection Type' ); ?></legend>\n\t<?php\n\t$disabled = disabled( ( defined( 'FTP_SSL' ) && FTP_SSL ) || ( defined( 'FTP_SSH' ) && FTP_SSH ), true, false );\n\tforeach ( $types as $name => $text ) :\n\t\t?>\n\t<label for=\"<?php echo esc_attr( $name ); ?>\">\n\t\t<input type=\"radio\" name=\"connection_type\" id=\"<?php echo esc_attr( $name ); ?>\" value=\"<?php echo esc_attr( $name ); ?>\" <?php checked( $name, $connection_type ); ?> <?php echo $disabled; ?> />\n\t\t<?php echo $text; ?>\n\t</label>\n\t\t<?php\n\tendforeach;\n\t?>\n</fieldset>\n\t<?php\n\tif ( isset( $types['ssh'] ) ) {\n\t\t$hidden_class = '';\n\t\tif ( 'ssh' !== $connection_type || empty( $connection_type ) ) {\n\t\t\t$hidden_class = ' class=\"hidden\"';\n\t\t}\n\t\t?>\n<fieldset id=\"ssh-keys\"<?php echo $hidden_class; ?>>\n<legend><?php _e( 'Authentication Keys' ); ?></legend>\n<label for=\"public_key\">\n\t<span class=\"field-title\"><?php _e( 'Public Key:' ); ?></span>\n\t<input name=\"public_key\" type=\"text\" id=\"public_key\" aria-describedby=\"auth-keys-desc\" value=\"<?php echo esc_attr( $public_key ); ?>\"<?php disabled( defined( 'FTP_PUBKEY' ) ); ?> />\n</label>\n<label for=\"private_key\">\n\t<span class=\"field-title\"><?php _e( 'Private Key:' ); ?></span>\n\t<input name=\"private_key\" type=\"text\" id=\"private_key\" value=\"<?php echo esc_attr( $private_key ); ?>\"<?php disabled( defined( 'FTP_PRIKEY' ) ); ?> />\n</label>\n<p id=\"auth-keys-desc\"><?php _e( 'Enter the location on the server where the public and private keys are located. If a passphrase is needed, enter that in the password field above.' ); ?></p>\n</fieldset>\n\t\t<?php\n\t}\n\n\tforeach ( (array) $extra_fields as $field ) {\n\t\tif ( isset( $submitted_form[ $field ] ) ) {\n\t\t\techo '<input type=\"hidden\" name=\"' . esc_attr( $field ) . '\" value=\"' . esc_attr( $submitted_form[ $field ] ) . '\" />';\n\t\t}\n\t}\n\t?>\n\t<p class=\"request-filesystem-credentials-action-buttons\">\n\t\t<?php wp_nonce_field( 'filesystem-credentials', '_fs_nonce', false, true ); ?>\n\t\t<button class=\"button cancel-button\" data-js-action=\"close\" type=\"button\"><?php _e( 'Cancel' ); ?></button>\n\t\t<?php submit_button( __( 'Proceed' ), '', 'upgrade', false ); ?>\n\t</p>\n</div>\n</form>\n\t<?php\n\treturn false;\n}\n\n/**\n * Prints the filesystem credentials modal when needed.\n *\n * @since 4.2.0\n */\nfunction wp_print_request_filesystem_credentials_modal() {\n\t$filesystem_method = get_filesystem_method();\n\n\tob_start();\n\t$filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() );\n\tob_end_clean();\n\n\t$request_filesystem_credentials = ( 'direct' !== $filesystem_method && ! $filesystem_credentials_are_stored );\n\tif ( ! $request_filesystem_credentials ) {\n\t\treturn;\n\t}\n\t?>\n\t<div id=\"request-filesystem-credentials-dialog\" class=\"notification-dialog-wrap request-filesystem-credentials-dialog\">\n\t\t<div class=\"notification-dialog-background\"></div>\n\t\t<div class=\"notification-dialog\" role=\"dialog\" aria-labelledby=\"request-filesystem-credentials-title\" tabindex=\"0\">\n\t\t\t<div class=\"request-filesystem-credentials-dialog-content\">\n\t\t\t\t<?php request_filesystem_credentials( site_url() ); ?>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<?php\n}\n\n/**\n * Attempts to clear the opcode cache for an individual PHP file.\n *\n * This function can be called safely without having to check the file extension\n * or availability of the OPcache extension.\n *\n * Whether or not invalidation is possible is cached to improve performance.\n *\n * @since 5.5.0\n *\n * @link https://www.php.net/manual/en/function.opcache-invalidate.php\n *\n * @param string $filepath Path to the file, including extension, for which the opcode cache is to be cleared.\n * @param bool   $force    Invalidate even if the modification time is not newer than the file in cache.\n *                         Default false.\n * @return bool True if opcache was invalidated for `$filepath`, or there was nothing to invalidate.\n *              False if opcache invalidation is not available, or is disabled via filter.\n */\nfunction wp_opcache_invalidate( $filepath, $force = false ) {\n\tstatic $can_invalidate = null;\n\n\t/*\n\t * Check to see if WordPress is able to run `opcache_invalidate()` or not, and cache the value.\n\t *\n\t * First, check to see if the function is available to call, then if the host has restricted\n\t * the ability to run the function to avoid a PHP warning.\n\t *\n\t * `opcache.restrict_api` can specify the path for files allowed to call `opcache_invalidate()`.\n\t *\n\t * If the host has this set, check whether the path in `opcache.restrict_api` matches\n\t * the beginning of the path of the origin file.\n\t *\n\t * `$_SERVER['SCRIPT_FILENAME']` approximates the origin file's path, but `realpath()`\n\t * is necessary because `SCRIPT_FILENAME` can be a relative path when run from CLI.\n\t *\n\t * For more details, see:\n\t * - https://www.php.net/manual/en/opcache.configuration.php\n\t * - https://www.php.net/manual/en/reserved.variables.server.php\n\t * - https://core.trac.wordpress.org/ticket/36455\n\t */\n\tif ( null === $can_invalidate\n\t\t&& function_exists( 'opcache_invalidate' )\n\t\t&& ( ! ini_get( 'opcache.restrict_api' )\n\t\t\t|| stripos( realpath( $_SERVER['SCRIPT_FILENAME'] ), ini_get( 'opcache.restrict_api' ) ) === 0 )\n\t) {\n\t\t$can_invalidate = true;\n\t}\n\n\t// If invalidation is not available, return early.\n\tif ( ! $can_invalidate ) {\n\t\treturn false;\n\t}\n\n\t// Verify that file to be invalidated has a PHP extension.\n\tif ( '.php' !== strtolower( substr( $filepath, -4 ) ) ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Filters whether to invalidate a file from the opcode cache.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param bool   $will_invalidate Whether WordPress will invalidate `$filepath`. Default true.\n\t * @param string $filepath        The path to the PHP file to invalidate.\n\t */\n\tif ( apply_filters( 'wp_opcache_invalidate_file', true, $filepath ) ) {\n\t\treturn opcache_invalidate( $filepath, $force );\n\t}\n\n\treturn false;\n}\n", "num_lines": 2377}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Image Editor\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Loads the WP image-editing interface.\n *\n * @since 2.9.0\n *\n * @param int         $post_id Attachment post ID.\n * @param bool|object $msg     Optional. Message to display for image editor updates or errors.\n *                             Default false.\n */\nfunction wp_image_editor( $post_id, $msg = false ) {\n\t$nonce     = wp_create_nonce( \"image_editor-$post_id\" );\n\t$meta      = wp_get_attachment_metadata( $post_id );\n\t$thumb     = image_get_intermediate_size( $post_id, 'thumbnail' );\n\t$sub_sizes = isset( $meta['sizes'] ) && is_array( $meta['sizes'] );\n\t$note      = '';\n\n\tif ( isset( $meta['width'], $meta['height'] ) ) {\n\t\t$big = max( $meta['width'], $meta['height'] );\n\t} else {\n\t\tdie( __( 'Image data does not exist. Please re-upload the image.' ) );\n\t}\n\n\t$sizer = $big > 400 ? 400 / $big : 1;\n\n\t$backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );\n\t$can_restore  = false;\n\tif ( ! empty( $backup_sizes ) && isset( $backup_sizes['full-orig'], $meta['file'] ) ) {\n\t\t$can_restore = wp_basename( $meta['file'] ) !== $backup_sizes['full-orig']['file'];\n\t}\n\n\tif ( $msg ) {\n\t\tif ( isset( $msg->error ) ) {\n\t\t\t$note = \"<div class='notice notice-error' tabindex='-1' role='alert'><p>$msg->error</p></div>\";\n\t\t} elseif ( isset( $msg->msg ) ) {\n\t\t\t$note = \"<div class='notice notice-success' tabindex='-1' role='alert'><p>$msg->msg</p></div>\";\n\t\t}\n\t}\n\n\t?>\n\t<div class=\"imgedit-wrap wp-clearfix\">\n\t<div id=\"imgedit-panel-<?php echo $post_id; ?>\">\n\n\t<div class=\"imgedit-panel-content wp-clearfix\">\n\t\t<?php echo $note; ?>\n\t\t<div class=\"imgedit-menu wp-clearfix\">\n\t\t\t<button type=\"button\" onclick=\"imageEdit.handleCropToolClick( <?php echo \"$post_id, '$nonce'\"; ?>, this )\" class=\"imgedit-crop button disabled\" disabled><?php esc_html_e( 'Crop' ); ?></button>\n\t\t\t<?php\n\n\t\t\t// On some setups GD library does not provide imagerotate() - Ticket #11536.\n\t\t\tif ( wp_image_editor_supports(\n\t\t\t\tarray(\n\t\t\t\t\t'mime_type' => get_post_mime_type( $post_id ),\n\t\t\t\t\t'methods'   => array( 'rotate' ),\n\t\t\t\t)\n\t\t\t) ) {\n\t\t\t\t$note_no_rotate = '';\n\t\t\t\t?>\n\t\t\t\t<button type=\"button\" class=\"imgedit-rleft button\" onclick=\"imageEdit.rotate( 90, <?php echo \"$post_id, '$nonce'\"; ?>, this)\"><?php esc_html_e( 'Rotate left' ); ?></button>\n\t\t\t\t<button type=\"button\" class=\"imgedit-rright button\" onclick=\"imageEdit.rotate(-90, <?php echo \"$post_id, '$nonce'\"; ?>, this)\"><?php esc_html_e( 'Rotate right' ); ?></button>\n\t\t\t\t<?php\n\t\t\t} else {\n\t\t\t\t$note_no_rotate = '<p class=\"note-no-rotate\"><em>' . __( 'Image rotation is not supported by your web host.' ) . '</em></p>';\n\t\t\t\t?>\n\t\t\t\t<button type=\"button\" class=\"imgedit-rleft button disabled\" disabled></button>\n\t\t\t\t<button type=\"button\" class=\"imgedit-rright button disabled\" disabled></button>\n\t\t\t<?php } ?>\n\n\t\t\t<button type=\"button\" onclick=\"imageEdit.flip(1, <?php echo \"$post_id, '$nonce'\"; ?>, this)\" class=\"imgedit-flipv button\"><?php esc_html_e( 'Flip vertical' ); ?></button>\n\t\t\t<button type=\"button\" onclick=\"imageEdit.flip(2, <?php echo \"$post_id, '$nonce'\"; ?>, this)\" class=\"imgedit-fliph button\"><?php esc_html_e( 'Flip horizontal' ); ?></button>\n\n\t\t\t<br class=\"imgedit-undo-redo-separator\" />\n\t\t\t<button type=\"button\" id=\"image-undo-<?php echo $post_id; ?>\" onclick=\"imageEdit.undo(<?php echo \"$post_id, '$nonce'\"; ?>, this)\" class=\"imgedit-undo button disabled\" disabled><?php esc_html_e( 'Undo' ); ?></button>\n\t\t\t<button type=\"button\" id=\"image-redo-<?php echo $post_id; ?>\" onclick=\"imageEdit.redo(<?php echo \"$post_id, '$nonce'\"; ?>, this)\" class=\"imgedit-redo button disabled\" disabled><?php esc_html_e( 'Redo' ); ?></button>\n\t\t\t<?php echo $note_no_rotate; ?>\n\t\t</div>\n\n\t\t<input type=\"hidden\" id=\"imgedit-sizer-<?php echo $post_id; ?>\" value=\"<?php echo $sizer; ?>\" />\n\t\t<input type=\"hidden\" id=\"imgedit-history-<?php echo $post_id; ?>\" value=\"\" />\n\t\t<input type=\"hidden\" id=\"imgedit-undone-<?php echo $post_id; ?>\" value=\"0\" />\n\t\t<input type=\"hidden\" id=\"imgedit-selection-<?php echo $post_id; ?>\" value=\"\" />\n\t\t<input type=\"hidden\" id=\"imgedit-x-<?php echo $post_id; ?>\" value=\"<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>\" />\n\t\t<input type=\"hidden\" id=\"imgedit-y-<?php echo $post_id; ?>\" value=\"<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>\" />\n\n\t\t<div id=\"imgedit-crop-<?php echo $post_id; ?>\" class=\"imgedit-crop-wrap\">\n\t\t<img id=\"image-preview-<?php echo $post_id; ?>\" onload=\"imageEdit.imgLoaded('<?php echo $post_id; ?>')\" src=\"<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>?action=imgedit-preview&amp;_ajax_nonce=<?php echo $nonce; ?>&amp;postid=<?php echo $post_id; ?>&amp;rand=<?php echo rand( 1, 99999 ); ?>\" alt=\"\" />\n\t\t</div>\n\n\t\t<div class=\"imgedit-submit\">\n\t\t\t<input type=\"button\" onclick=\"imageEdit.close(<?php echo $post_id; ?>, 1)\" class=\"button imgedit-cancel-btn\" value=\"<?php esc_attr_e( 'Cancel' ); ?>\" />\n\t\t\t<input type=\"button\" onclick=\"imageEdit.save(<?php echo \"$post_id, '$nonce'\"; ?>)\" disabled=\"disabled\" class=\"button button-primary imgedit-submit-btn\" value=\"<?php esc_attr_e( 'Save' ); ?>\" />\n\t\t</div>\n\t</div>\n\n\t<div class=\"imgedit-settings\">\n\t<div class=\"imgedit-group\">\n\t<div class=\"imgedit-group-top\">\n\t\t<h2><?php _e( 'Scale Image' ); ?></h2>\n\t\t<button type=\"button\" class=\"dashicons dashicons-editor-help imgedit-help-toggle\" onclick=\"imageEdit.toggleHelp(this);\" aria-expanded=\"false\"><span class=\"screen-reader-text\"><?php esc_html_e( 'Scale Image Help' ); ?></span></button>\n\t\t<div class=\"imgedit-help\">\n\t\t<p><?php _e( 'You can proportionally scale the original image. For best results, scaling should be done before you crop, flip, or rotate. Images can only be scaled down, not up.' ); ?></p>\n\t\t</div>\n\t\t<?php if ( isset( $meta['width'], $meta['height'] ) ) : ?>\n\t\t<p>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: Image width and height in pixels. */\n\t\t\t\t__( 'Original dimensions %s' ),\n\t\t\t\t'<span class=\"imgedit-original-dimensions\">' . $meta['width'] . ' &times; ' . $meta['height'] . '</span>'\n\t\t\t);\n\t\t\t?>\n\t\t</p>\n\t\t<?php endif ?>\n\t\t<div class=\"imgedit-submit\">\n\n\t\t<fieldset class=\"imgedit-scale\">\n\t\t<legend><?php _e( 'New dimensions:' ); ?></legend>\n\t\t<div class=\"nowrap\">\n\t\t<label for=\"imgedit-scale-width-<?php echo $post_id; ?>\" class=\"screen-reader-text\"><?php _e( 'scale width' ); ?></label>\n\t\t<input type=\"text\" id=\"imgedit-scale-width-<?php echo $post_id; ?>\" onkeyup=\"imageEdit.scaleChanged(<?php echo $post_id; ?>, 1, this)\" onblur=\"imageEdit.scaleChanged(<?php echo $post_id; ?>, 1, this)\" value=\"<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>\" />\n\t\t<span class=\"imgedit-separator\" aria-hidden=\"true\">&times;</span>\n\t\t<label for=\"imgedit-scale-height-<?php echo $post_id; ?>\" class=\"screen-reader-text\"><?php _e( 'scale height' ); ?></label>\n\t\t<input type=\"text\" id=\"imgedit-scale-height-<?php echo $post_id; ?>\" onkeyup=\"imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)\" onblur=\"imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)\" value=\"<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>\" />\n\t\t<span class=\"imgedit-scale-warn\" id=\"imgedit-scale-warn-<?php echo $post_id; ?>\">!</span>\n\t\t<div class=\"imgedit-scale-button-wrapper\"><input id=\"imgedit-scale-button\" type=\"button\" onclick=\"imageEdit.action(<?php echo \"$post_id, '$nonce'\"; ?>, 'scale')\" class=\"button button-primary\" value=\"<?php esc_attr_e( 'Scale' ); ?>\" /></div>\n\t\t</div>\n\t\t</fieldset>\n\n\t\t</div>\n\t</div>\n\t</div>\n\n\t<?php if ( $can_restore ) { ?>\n\n\t<div class=\"imgedit-group\">\n\t<div class=\"imgedit-group-top\">\n\t\t<h2><button type=\"button\" onclick=\"imageEdit.toggleHelp(this);\" class=\"button-link\" aria-expanded=\"false\"><?php _e( 'Restore original image' ); ?> <span class=\"dashicons dashicons-arrow-down imgedit-help-toggle\"></span></button></h2>\n\t\t<div class=\"imgedit-help imgedit-restore\">\n\t\t<p>\n\t\t\t<?php\n\t\t\t_e( 'Discard any changes and restore the original image.' );\n\n\t\t\tif ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) {\n\t\t\t\techo ' ' . __( 'Previously edited copies of the image will not be deleted.' );\n\t\t\t}\n\t\t\t?>\n\t\t</p>\n\t\t<div class=\"imgedit-submit\">\n\t\t<input type=\"button\" onclick=\"imageEdit.action(<?php echo \"$post_id, '$nonce'\"; ?>, 'restore')\" class=\"button button-primary\" value=\"<?php esc_attr_e( 'Restore image' ); ?>\" <?php echo $can_restore; ?> />\n\t\t</div>\n\t\t</div>\n\t</div>\n\t</div>\n\n\t<?php } ?>\n\n\t<div class=\"imgedit-group\">\n\t<div class=\"imgedit-group-top\">\n\t\t<h2><?php _e( 'Image Crop' ); ?></h2>\n\t\t<button type=\"button\" class=\"dashicons dashicons-editor-help imgedit-help-toggle\" onclick=\"imageEdit.toggleHelp(this);\" aria-expanded=\"false\"><span class=\"screen-reader-text\"><?php esc_html_e( 'Image Crop Help' ); ?></span></button>\n\n\t\t<div class=\"imgedit-help\">\n\t\t<p><?php _e( 'To crop the image, click on it and drag to make your selection.' ); ?></p>\n\n\t\t<p><strong><?php _e( 'Crop Aspect Ratio' ); ?></strong><br />\n\t\t<?php _e( 'The aspect ratio is the relationship between the width and height. You can preserve the aspect ratio by holding down the shift key while resizing your selection. Use the input box to specify the aspect ratio, e.g. 1:1 (square), 4:3, 16:9, etc.' ); ?></p>\n\n\t\t<p><strong><?php _e( 'Crop Selection' ); ?></strong><br />\n\t\t<?php _e( 'Once you have made your selection, you can adjust it by entering the size in pixels. The minimum selection size is the thumbnail size as set in the Media settings.' ); ?></p>\n\t\t</div>\n\t</div>\n\n\t<fieldset class=\"imgedit-crop-ratio\">\n\t\t<legend><?php _e( 'Aspect ratio:' ); ?></legend>\n\t\t<div class=\"nowrap\">\n\t\t<label for=\"imgedit-crop-width-<?php echo $post_id; ?>\" class=\"screen-reader-text\"><?php _e( 'crop ratio width' ); ?></label>\n\t\t<input type=\"text\" id=\"imgedit-crop-width-<?php echo $post_id; ?>\" onkeyup=\"imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)\" onblur=\"imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)\" />\n\t\t<span class=\"imgedit-separator\" aria-hidden=\"true\">:</span>\n\t\t<label for=\"imgedit-crop-height-<?php echo $post_id; ?>\" class=\"screen-reader-text\"><?php _e( 'crop ratio height' ); ?></label>\n\t\t<input type=\"text\" id=\"imgedit-crop-height-<?php echo $post_id; ?>\" onkeyup=\"imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)\" onblur=\"imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)\" />\n\t\t</div>\n\t</fieldset>\n\n\t<fieldset id=\"imgedit-crop-sel-<?php echo $post_id; ?>\" class=\"imgedit-crop-sel\">\n\t\t<legend><?php _e( 'Selection:' ); ?></legend>\n\t\t<div class=\"nowrap\">\n\t\t<label for=\"imgedit-sel-width-<?php echo $post_id; ?>\" class=\"screen-reader-text\"><?php _e( 'selection width' ); ?></label>\n\t\t<input type=\"text\" id=\"imgedit-sel-width-<?php echo $post_id; ?>\" onkeyup=\"imageEdit.setNumSelection(<?php echo $post_id; ?>, this)\" onblur=\"imageEdit.setNumSelection(<?php echo $post_id; ?>, this)\" />\n\t\t<span class=\"imgedit-separator\" aria-hidden=\"true\">&times;</span>\n\t\t<label for=\"imgedit-sel-height-<?php echo $post_id; ?>\" class=\"screen-reader-text\"><?php _e( 'selection height' ); ?></label>\n\t\t<input type=\"text\" id=\"imgedit-sel-height-<?php echo $post_id; ?>\" onkeyup=\"imageEdit.setNumSelection(<?php echo $post_id; ?>, this)\" onblur=\"imageEdit.setNumSelection(<?php echo $post_id; ?>, this)\" />\n\t\t</div>\n\t</fieldset>\n\n\t</div>\n\n\t<?php\n\tif ( $thumb && $sub_sizes ) {\n\t\t$thumb_img = wp_constrain_dimensions( $thumb['width'], $thumb['height'], 160, 120 );\n\t\t?>\n\n\t<div class=\"imgedit-group imgedit-applyto\">\n\t<div class=\"imgedit-group-top\">\n\t\t<h2><?php _e( 'Thumbnail Settings' ); ?></h2>\n\t\t<button type=\"button\" class=\"dashicons dashicons-editor-help imgedit-help-toggle\" onclick=\"imageEdit.toggleHelp(this);\" aria-expanded=\"false\"><span class=\"screen-reader-text\"><?php esc_html_e( 'Thumbnail Settings Help' ); ?></span></button>\n\t\t<div class=\"imgedit-help\">\n\t\t<p><?php _e( 'You can edit the image while preserving the thumbnail. For example, you may wish to have a square thumbnail that displays just a section of the image.' ); ?></p>\n\t\t</div>\n\t</div>\n\n\t<figure class=\"imgedit-thumbnail-preview\">\n\t\t<img src=\"<?php echo $thumb['url']; ?>\" width=\"<?php echo $thumb_img[0]; ?>\" height=\"<?php echo $thumb_img[1]; ?>\" class=\"imgedit-size-preview\" alt=\"\" draggable=\"false\" />\n\t\t<figcaption class=\"imgedit-thumbnail-preview-caption\"><?php _e( 'Current thumbnail' ); ?></figcaption>\n\t</figure>\n\n\t<div id=\"imgedit-save-target-<?php echo $post_id; ?>\" class=\"imgedit-save-target\">\n\t<fieldset>\n\t\t<legend><?php _e( 'Apply changes to:' ); ?></legend>\n\n\t\t<span class=\"imgedit-label\">\n\t\t\t<input type=\"radio\" id=\"imgedit-target-all\" name=\"imgedit-target-<?php echo $post_id; ?>\" value=\"all\" checked=\"checked\" />\n\t\t\t<label for=\"imgedit-target-all\"><?php _e( 'All image sizes' ); ?></label>\n\t\t</span>\n\n\t\t<span class=\"imgedit-label\">\n\t\t\t<input type=\"radio\" id=\"imgedit-target-thumbnail\" name=\"imgedit-target-<?php echo $post_id; ?>\" value=\"thumbnail\" />\n\t\t\t<label for=\"imgedit-target-thumbnail\"><?php _e( 'Thumbnail' ); ?></label>\n\t\t</span>\n\n\t\t<span class=\"imgedit-label\">\n\t\t\t<input type=\"radio\" id=\"imgedit-target-nothumb\" name=\"imgedit-target-<?php echo $post_id; ?>\" value=\"nothumb\" />\n\t\t\t<label for=\"imgedit-target-nothumb\"><?php _e( 'All sizes except thumbnail' ); ?></label>\n\t\t</span>\n\t</fieldset>\n\t</div>\n\t</div>\n\n\t<?php } ?>\n\n\t</div>\n\n\t</div>\n\t<div class=\"imgedit-wait\" id=\"imgedit-wait-<?php echo $post_id; ?>\"></div>\n\t<div class=\"hidden\" id=\"imgedit-leaving-<?php echo $post_id; ?>\"><?php _e( \"There are unsaved changes that will be lost. 'OK' to continue, 'Cancel' to return to the Image Editor.\" ); ?></div>\n\t</div>\n\t<?php\n}\n\n/**\n * Streams image in WP_Image_Editor to browser.\n *\n * @since 2.9.0\n *\n * @param WP_Image_Editor $image         The image editor instance.\n * @param string          $mime_type     The mime type of the image.\n * @param int             $attachment_id The image's attachment post ID.\n * @return bool True on success, false on failure.\n */\nfunction wp_stream_image( $image, $mime_type, $attachment_id ) {\n\tif ( $image instanceof WP_Image_Editor ) {\n\n\t\t/**\n\t\t * Filters the WP_Image_Editor instance for the image to be streamed to the browser.\n\t\t *\n\t\t * @since 3.5.0\n\t\t *\n\t\t * @param WP_Image_Editor $image         The image editor instance.\n\t\t * @param int             $attachment_id The attachment post ID.\n\t\t */\n\t\t$image = apply_filters( 'image_editor_save_pre', $image, $attachment_id );\n\n\t\tif ( is_wp_error( $image->stream( $mime_type ) ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} else {\n\t\t/* translators: 1: $image, 2: WP_Image_Editor */\n\t\t_deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( '%1$s needs to be a %2$s object.' ), '$image', 'WP_Image_Editor' ) );\n\n\t\t/**\n\t\t * Filters the GD image resource to be streamed to the browser.\n\t\t *\n\t\t * @since 2.9.0\n\t\t * @deprecated 3.5.0 Use {@see 'image_editor_save_pre'} instead.\n\t\t *\n\t\t * @param resource $image         Image resource to be streamed.\n\t\t * @param int      $attachment_id The attachment post ID.\n\t\t */\n\t\t$image = apply_filters_deprecated( 'image_save_pre', array( $image, $attachment_id ), '3.5.0', 'image_editor_save_pre' );\n\n\t\tswitch ( $mime_type ) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\theader( 'Content-Type: image/jpeg' );\n\t\t\t\treturn imagejpeg( $image, null, 90 );\n\t\t\tcase 'image/png':\n\t\t\t\theader( 'Content-Type: image/png' );\n\t\t\t\treturn imagepng( $image );\n\t\t\tcase 'image/gif':\n\t\t\t\theader( 'Content-Type: image/gif' );\n\t\t\t\treturn imagegif( $image );\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n}\n\n/**\n * Saves image to file.\n *\n * @since 2.9.0\n *\n * @param string          $filename  Name of the file to be saved.\n * @param WP_Image_Editor $image     The image editor instance.\n * @param string          $mime_type The mime type of the image.\n * @param int             $post_id   Attachment post ID.\n * @return bool True on success, false on failure.\n */\nfunction wp_save_image_file( $filename, $image, $mime_type, $post_id ) {\n\tif ( $image instanceof WP_Image_Editor ) {\n\n\t\t/** This filter is documented in wp-admin/includes/image-edit.php */\n\t\t$image = apply_filters( 'image_editor_save_pre', $image, $post_id );\n\n\t\t/**\n\t\t * Filters whether to skip saving the image file.\n\t\t *\n\t\t * Returning a non-null value will short-circuit the save method,\n\t\t * returning that value instead.\n\t\t *\n\t\t * @since 3.5.0\n\t\t *\n\t\t * @param bool|null       $override  Value to return instead of saving. Default null.\n\t\t * @param string          $filename  Name of the file to be saved.\n\t\t * @param WP_Image_Editor $image     The image editor instance.\n\t\t * @param string          $mime_type The mime type of the image.\n\t\t * @param int             $post_id   Attachment post ID.\n\t\t */\n\t\t$saved = apply_filters( 'wp_save_image_editor_file', null, $filename, $image, $mime_type, $post_id );\n\n\t\tif ( null !== $saved ) {\n\t\t\treturn $saved;\n\t\t}\n\n\t\treturn $image->save( $filename, $mime_type );\n\t} else {\n\t\t/* translators: 1: $image, 2: WP_Image_Editor */\n\t\t_deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( '%1$s needs to be a %2$s object.' ), '$image', 'WP_Image_Editor' ) );\n\n\t\t/** This filter is documented in wp-admin/includes/image-edit.php */\n\t\t$image = apply_filters_deprecated( 'image_save_pre', array( $image, $post_id ), '3.5.0', 'image_editor_save_pre' );\n\n\t\t/**\n\t\t * Filters whether to skip saving the image file.\n\t\t *\n\t\t * Returning a non-null value will short-circuit the save method,\n\t\t * returning that value instead.\n\t\t *\n\t\t * @since 2.9.0\n\t\t * @deprecated 3.5.0 Use {@see 'wp_save_image_editor_file'} instead.\n\t\t *\n\t\t * @param mixed           $override  Value to return instead of saving. Default null.\n\t\t * @param string          $filename  Name of the file to be saved.\n\t\t * @param WP_Image_Editor $image     The image editor instance.\n\t\t * @param string          $mime_type The mime type of the image.\n\t\t * @param int             $post_id   Attachment post ID.\n\t\t */\n\t\t$saved = apply_filters_deprecated(\n\t\t\t'wp_save_image_file',\n\t\t\tarray( null, $filename, $image, $mime_type, $post_id ),\n\t\t\t'3.5.0',\n\t\t\t'wp_save_image_editor_file'\n\t\t);\n\n\t\tif ( null !== $saved ) {\n\t\t\treturn $saved;\n\t\t}\n\n\t\tswitch ( $mime_type ) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t/** This filter is documented in wp-includes/class-wp-image-editor.php */\n\t\t\t\treturn imagejpeg( $image, $filename, apply_filters( 'jpeg_quality', 90, 'edit_image' ) );\n\t\t\tcase 'image/png':\n\t\t\t\treturn imagepng( $image, $filename );\n\t\t\tcase 'image/gif':\n\t\t\t\treturn imagegif( $image, $filename );\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n}\n\n/**\n * Image preview ratio. Internal use only.\n *\n * @since 2.9.0\n *\n * @ignore\n * @param int $w Image width in pixels.\n * @param int $h Image height in pixels.\n * @return float|int Image preview ratio.\n */\nfunction _image_get_preview_ratio( $w, $h ) {\n\t$max = max( $w, $h );\n\treturn $max > 400 ? ( 400 / $max ) : 1;\n}\n\n/**\n * Returns an image resource. Internal use only.\n *\n * @since 2.9.0\n * @deprecated 3.5.0 Use WP_Image_Editor::rotate()\n * @see WP_Image_Editor::rotate()\n *\n * @ignore\n * @param resource  $img   Image resource.\n * @param float|int $angle Image rotation angle, in degrees.\n * @return resource|false GD image resource, false otherwise.\n */\nfunction _rotate_image_resource( $img, $angle ) {\n\t_deprecated_function( __FUNCTION__, '3.5.0', 'WP_Image_Editor::rotate()' );\n\tif ( function_exists( 'imagerotate' ) ) {\n\t\t$rotated = imagerotate( $img, $angle, 0 );\n\t\tif ( is_resource( $rotated ) ) {\n\t\t\timagedestroy( $img );\n\t\t\t$img = $rotated;\n\t\t}\n\t}\n\treturn $img;\n}\n\n/**\n * Flips an image resource. Internal use only.\n *\n * @since 2.9.0\n * @deprecated 3.5.0 Use WP_Image_Editor::flip()\n * @see WP_Image_Editor::flip()\n *\n * @ignore\n * @param resource $img  Image resource.\n * @param bool     $horz Whether to flip horizontally.\n * @param bool     $vert Whether to flip vertically.\n * @return resource (maybe) flipped image resource.\n */\nfunction _flip_image_resource( $img, $horz, $vert ) {\n\t_deprecated_function( __FUNCTION__, '3.5.0', 'WP_Image_Editor::flip()' );\n\t$w   = imagesx( $img );\n\t$h   = imagesy( $img );\n\t$dst = wp_imagecreatetruecolor( $w, $h );\n\tif ( is_resource( $dst ) ) {\n\t\t$sx = $vert ? ( $w - 1 ) : 0;\n\t\t$sy = $horz ? ( $h - 1 ) : 0;\n\t\t$sw = $vert ? -$w : $w;\n\t\t$sh = $horz ? -$h : $h;\n\n\t\tif ( imagecopyresampled( $dst, $img, 0, 0, $sx, $sy, $w, $h, $sw, $sh ) ) {\n\t\t\timagedestroy( $img );\n\t\t\t$img = $dst;\n\t\t}\n\t}\n\treturn $img;\n}\n\n/**\n * Crops an image resource. Internal use only.\n *\n * @since 2.9.0\n *\n * @ignore\n * @param resource $img Image resource.\n * @param float    $x   Source point x-coordinate.\n * @param float    $y   Source point y-coordinate.\n * @param float    $w   Source width.\n * @param float    $h   Source height.\n * @return resource (maybe) cropped image resource.\n */\nfunction _crop_image_resource( $img, $x, $y, $w, $h ) {\n\t$dst = wp_imagecreatetruecolor( $w, $h );\n\tif ( is_resource( $dst ) ) {\n\t\tif ( imagecopy( $dst, $img, 0, 0, $x, $y, $w, $h ) ) {\n\t\t\timagedestroy( $img );\n\t\t\t$img = $dst;\n\t\t}\n\t}\n\treturn $img;\n}\n\n/**\n * Performs group of changes on Editor specified.\n *\n * @since 2.9.0\n *\n * @param WP_Image_Editor $image   WP_Image_Editor instance.\n * @param array           $changes Array of change operations.\n * @return WP_Image_Editor WP_Image_Editor instance with changes applied.\n */\nfunction image_edit_apply_changes( $image, $changes ) {\n\tif ( is_resource( $image ) ) {\n\t\t/* translators: 1: $image, 2: WP_Image_Editor */\n\t\t_deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( '%1$s needs to be a %2$s object.' ), '$image', 'WP_Image_Editor' ) );\n\t}\n\n\tif ( ! is_array( $changes ) ) {\n\t\treturn $image;\n\t}\n\n\t// Expand change operations.\n\tforeach ( $changes as $key => $obj ) {\n\t\tif ( isset( $obj->r ) ) {\n\t\t\t$obj->type  = 'rotate';\n\t\t\t$obj->angle = $obj->r;\n\t\t\tunset( $obj->r );\n\t\t} elseif ( isset( $obj->f ) ) {\n\t\t\t$obj->type = 'flip';\n\t\t\t$obj->axis = $obj->f;\n\t\t\tunset( $obj->f );\n\t\t} elseif ( isset( $obj->c ) ) {\n\t\t\t$obj->type = 'crop';\n\t\t\t$obj->sel  = $obj->c;\n\t\t\tunset( $obj->c );\n\t\t}\n\t\t$changes[ $key ] = $obj;\n\t}\n\n\t// Combine operations.\n\tif ( count( $changes ) > 1 ) {\n\t\t$filtered = array( $changes[0] );\n\t\tfor ( $i = 0, $j = 1, $c = count( $changes ); $j < $c; $j++ ) {\n\t\t\t$combined = false;\n\t\t\tif ( $filtered[ $i ]->type == $changes[ $j ]->type ) {\n\t\t\t\tswitch ( $filtered[ $i ]->type ) {\n\t\t\t\t\tcase 'rotate':\n\t\t\t\t\t\t$filtered[ $i ]->angle += $changes[ $j ]->angle;\n\t\t\t\t\t\t$combined               = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'flip':\n\t\t\t\t\t\t$filtered[ $i ]->axis ^= $changes[ $j ]->axis;\n\t\t\t\t\t\t$combined              = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! $combined ) {\n\t\t\t\t$filtered[ ++$i ] = $changes[ $j ];\n\t\t\t}\n\t\t}\n\t\t$changes = $filtered;\n\t\tunset( $filtered );\n\t}\n\n\t// Image resource before applying the changes.\n\tif ( $image instanceof WP_Image_Editor ) {\n\n\t\t/**\n\t\t * Filters the WP_Image_Editor instance before applying changes to the image.\n\t\t *\n\t\t * @since 3.5.0\n\t\t *\n\t\t * @param WP_Image_Editor $image   WP_Image_Editor instance.\n\t\t * @param array           $changes Array of change operations.\n\t\t */\n\t\t$image = apply_filters( 'wp_image_editor_before_change', $image, $changes );\n\t} elseif ( is_resource( $image ) ) {\n\n\t\t/**\n\t\t * Filters the GD image resource before applying changes to the image.\n\t\t *\n\t\t * @since 2.9.0\n\t\t * @deprecated 3.5.0 Use {@see 'wp_image_editor_before_change'} instead.\n\t\t *\n\t\t * @param resource $image   GD image resource.\n\t\t * @param array    $changes Array of change operations.\n\t\t */\n\t\t$image = apply_filters_deprecated( 'image_edit_before_change', array( $image, $changes ), '3.5.0', 'wp_image_editor_before_change' );\n\t}\n\n\tforeach ( $changes as $operation ) {\n\t\tswitch ( $operation->type ) {\n\t\t\tcase 'rotate':\n\t\t\t\tif ( 0 != $operation->angle ) {\n\t\t\t\t\tif ( $image instanceof WP_Image_Editor ) {\n\t\t\t\t\t\t$image->rotate( $operation->angle );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$image = _rotate_image_resource( $image, $operation->angle );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'flip':\n\t\t\t\tif ( 0 != $operation->axis ) {\n\t\t\t\t\tif ( $image instanceof WP_Image_Editor ) {\n\t\t\t\t\t\t$image->flip( ( $operation->axis & 1 ) != 0, ( $operation->axis & 2 ) != 0 );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$image = _flip_image_resource( $image, ( $operation->axis & 1 ) != 0, ( $operation->axis & 2 ) != 0 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'crop':\n\t\t\t\t$sel = $operation->sel;\n\n\t\t\t\tif ( $image instanceof WP_Image_Editor ) {\n\t\t\t\t\t$size = $image->get_size();\n\t\t\t\t\t$w    = $size['width'];\n\t\t\t\t\t$h    = $size['height'];\n\n\t\t\t\t\t$scale = 1 / _image_get_preview_ratio( $w, $h ); // Discard preview scaling.\n\t\t\t\t\t$image->crop( $sel->x * $scale, $sel->y * $scale, $sel->w * $scale, $sel->h * $scale );\n\t\t\t\t} else {\n\t\t\t\t\t$scale = 1 / _image_get_preview_ratio( imagesx( $image ), imagesy( $image ) ); // Discard preview scaling.\n\t\t\t\t\t$image = _crop_image_resource( $image, $sel->x * $scale, $sel->y * $scale, $sel->w * $scale, $sel->h * $scale );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn $image;\n}\n\n\n/**\n * Streams image in post to browser, along with enqueued changes\n * in `$_REQUEST['history']`.\n *\n * @since 2.9.0\n *\n * @param int $post_id Attachment post ID.\n * @return bool True on success, false on failure.\n */\nfunction stream_preview_image( $post_id ) {\n\t$post = get_post( $post_id );\n\n\twp_raise_memory_limit( 'admin' );\n\n\t$img = wp_get_image_editor( _load_image_to_edit_path( $post_id ) );\n\n\tif ( is_wp_error( $img ) ) {\n\t\treturn false;\n\t}\n\n\t$changes = ! empty( $_REQUEST['history'] ) ? json_decode( wp_unslash( $_REQUEST['history'] ) ) : null;\n\tif ( $changes ) {\n\t\t$img = image_edit_apply_changes( $img, $changes );\n\t}\n\n\t// Scale the image.\n\t$size = $img->get_size();\n\t$w    = $size['width'];\n\t$h    = $size['height'];\n\n\t$ratio = _image_get_preview_ratio( $w, $h );\n\t$w2    = max( 1, $w * $ratio );\n\t$h2    = max( 1, $h * $ratio );\n\n\tif ( is_wp_error( $img->resize( $w2, $h2 ) ) ) {\n\t\treturn false;\n\t}\n\n\treturn wp_stream_image( $img, $post->post_mime_type, $post_id );\n}\n\n/**\n * Restores the metadata for a given attachment.\n *\n * @since 2.9.0\n *\n * @param int $post_id Attachment post ID.\n * @return stdClass Image restoration message object.\n */\nfunction wp_restore_image( $post_id ) {\n\t$meta             = wp_get_attachment_metadata( $post_id );\n\t$file             = get_attached_file( $post_id );\n\t$backup_sizes     = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );\n\t$old_backup_sizes = $backup_sizes;\n\t$restored         = false;\n\t$msg              = new stdClass;\n\n\tif ( ! is_array( $backup_sizes ) ) {\n\t\t$msg->error = __( 'Cannot load image metadata.' );\n\t\treturn $msg;\n\t}\n\n\t$parts         = pathinfo( $file );\n\t$suffix        = time() . rand( 100, 999 );\n\t$default_sizes = get_intermediate_image_sizes();\n\n\tif ( isset( $backup_sizes['full-orig'] ) && is_array( $backup_sizes['full-orig'] ) ) {\n\t\t$data = $backup_sizes['full-orig'];\n\n\t\tif ( $parts['basename'] != $data['file'] ) {\n\t\t\tif ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE ) {\n\n\t\t\t\t// Delete only if it's an edited image.\n\t\t\t\tif ( preg_match( '/-e[0-9]{13}\\./', $parts['basename'] ) ) {\n\t\t\t\t\twp_delete_file( $file );\n\t\t\t\t}\n\t\t\t} elseif ( isset( $meta['width'], $meta['height'] ) ) {\n\t\t\t\t$backup_sizes[ \"full-$suffix\" ] = array(\n\t\t\t\t\t'width'  => $meta['width'],\n\t\t\t\t\t'height' => $meta['height'],\n\t\t\t\t\t'file'   => $parts['basename'],\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$restored_file = path_join( $parts['dirname'], $data['file'] );\n\t\t$restored      = update_attached_file( $post_id, $restored_file );\n\n\t\t$meta['file']   = _wp_relative_upload_path( $restored_file );\n\t\t$meta['width']  = $data['width'];\n\t\t$meta['height'] = $data['height'];\n\t}\n\n\tforeach ( $default_sizes as $default_size ) {\n\t\tif ( isset( $backup_sizes[ \"$default_size-orig\" ] ) ) {\n\t\t\t$data = $backup_sizes[ \"$default_size-orig\" ];\n\t\t\tif ( isset( $meta['sizes'][ $default_size ] ) && $meta['sizes'][ $default_size ]['file'] != $data['file'] ) {\n\t\t\t\tif ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE ) {\n\n\t\t\t\t\t// Delete only if it's an edited image.\n\t\t\t\t\tif ( preg_match( '/-e[0-9]{13}-/', $meta['sizes'][ $default_size ]['file'] ) ) {\n\t\t\t\t\t\t$delete_file = path_join( $parts['dirname'], $meta['sizes'][ $default_size ]['file'] );\n\t\t\t\t\t\twp_delete_file( $delete_file );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$backup_sizes[ \"$default_size-{$suffix}\" ] = $meta['sizes'][ $default_size ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$meta['sizes'][ $default_size ] = $data;\n\t\t} else {\n\t\t\tunset( $meta['sizes'][ $default_size ] );\n\t\t}\n\t}\n\n\tif ( ! wp_update_attachment_metadata( $post_id, $meta ) ||\n\t\t( $old_backup_sizes !== $backup_sizes && ! update_post_meta( $post_id, '_wp_attachment_backup_sizes', $backup_sizes ) ) ) {\n\n\t\t$msg->error = __( 'Cannot save image metadata.' );\n\t\treturn $msg;\n\t}\n\n\tif ( ! $restored ) {\n\t\t$msg->error = __( 'Image metadata is inconsistent.' );\n\t} else {\n\t\t$msg->msg = __( 'Image restored successfully.' );\n\t}\n\n\treturn $msg;\n}\n\n/**\n * Saves image to post, along with enqueued changes\n * in `$_REQUEST['history']`.\n *\n * @since 2.9.0\n *\n * @param int $post_id Attachment post ID.\n * @return stdClass\n */\nfunction wp_save_image( $post_id ) {\n\t$_wp_additional_image_sizes = wp_get_additional_image_sizes();\n\n\t$return  = new stdClass;\n\t$success = false;\n\t$delete  = false;\n\t$scaled  = false;\n\t$nocrop  = false;\n\t$post    = get_post( $post_id );\n\n\t$img = wp_get_image_editor( _load_image_to_edit_path( $post_id, 'full' ) );\n\tif ( is_wp_error( $img ) ) {\n\t\t$return->error = esc_js( __( 'Unable to create new image.' ) );\n\t\treturn $return;\n\t}\n\n\t$fwidth  = ! empty( $_REQUEST['fwidth'] ) ? intval( $_REQUEST['fwidth'] ) : 0;\n\t$fheight = ! empty( $_REQUEST['fheight'] ) ? intval( $_REQUEST['fheight'] ) : 0;\n\t$target  = ! empty( $_REQUEST['target'] ) ? preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['target'] ) : '';\n\t$scale   = ! empty( $_REQUEST['do'] ) && 'scale' === $_REQUEST['do'];\n\n\tif ( $scale && $fwidth > 0 && $fheight > 0 ) {\n\t\t$size = $img->get_size();\n\t\t$sX   = $size['width'];\n\t\t$sY   = $size['height'];\n\n\t\t// Check if it has roughly the same w / h ratio.\n\t\t$diff = round( $sX / $sY, 2 ) - round( $fwidth / $fheight, 2 );\n\t\tif ( -0.1 < $diff && $diff < 0.1 ) {\n\t\t\t// Scale the full size image.\n\t\t\tif ( $img->resize( $fwidth, $fheight ) ) {\n\t\t\t\t$scaled = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $scaled ) {\n\t\t\t$return->error = esc_js( __( 'Error while saving the scaled image. Please reload the page and try again.' ) );\n\t\t\treturn $return;\n\t\t}\n\t} elseif ( ! empty( $_REQUEST['history'] ) ) {\n\t\t$changes = json_decode( wp_unslash( $_REQUEST['history'] ) );\n\t\tif ( $changes ) {\n\t\t\t$img = image_edit_apply_changes( $img, $changes );\n\t\t}\n\t} else {\n\t\t$return->error = esc_js( __( 'Nothing to save, the image has not changed.' ) );\n\t\treturn $return;\n\t}\n\n\t$meta         = wp_get_attachment_metadata( $post_id );\n\t$backup_sizes = get_post_meta( $post->ID, '_wp_attachment_backup_sizes', true );\n\n\tif ( ! is_array( $meta ) ) {\n\t\t$return->error = esc_js( __( 'Image data does not exist. Please re-upload the image.' ) );\n\t\treturn $return;\n\t}\n\n\tif ( ! is_array( $backup_sizes ) ) {\n\t\t$backup_sizes = array();\n\t}\n\n\t// Generate new filename.\n\t$path = get_attached_file( $post_id );\n\n\t$basename = pathinfo( $path, PATHINFO_BASENAME );\n\t$dirname  = pathinfo( $path, PATHINFO_DIRNAME );\n\t$ext      = pathinfo( $path, PATHINFO_EXTENSION );\n\t$filename = pathinfo( $path, PATHINFO_FILENAME );\n\t$suffix   = time() . rand( 100, 999 );\n\n\tif ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE &&\n\t\tisset( $backup_sizes['full-orig'] ) && $backup_sizes['full-orig']['file'] != $basename ) {\n\n\t\tif ( 'thumbnail' === $target ) {\n\t\t\t$new_path = \"{$dirname}/{$filename}-temp.{$ext}\";\n\t\t} else {\n\t\t\t$new_path = $path;\n\t\t}\n\t} else {\n\t\twhile ( true ) {\n\t\t\t$filename     = preg_replace( '/-e([0-9]+)$/', '', $filename );\n\t\t\t$filename    .= \"-e{$suffix}\";\n\t\t\t$new_filename = \"{$filename}.{$ext}\";\n\t\t\t$new_path     = \"{$dirname}/$new_filename\";\n\t\t\tif ( file_exists( $new_path ) ) {\n\t\t\t\t$suffix++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Save the full-size file, also needed to create sub-sizes.\n\tif ( ! wp_save_image_file( $new_path, $img, $post->post_mime_type, $post_id ) ) {\n\t\t$return->error = esc_js( __( 'Unable to save the image.' ) );\n\t\treturn $return;\n\t}\n\n\tif ( 'nothumb' === $target || 'all' === $target || 'full' === $target || $scaled ) {\n\t\t$tag = false;\n\t\tif ( isset( $backup_sizes['full-orig'] ) ) {\n\t\t\tif ( ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) && $backup_sizes['full-orig']['file'] !== $basename ) {\n\t\t\t\t$tag = \"full-$suffix\";\n\t\t\t}\n\t\t} else {\n\t\t\t$tag = 'full-orig';\n\t\t}\n\n\t\tif ( $tag ) {\n\t\t\t$backup_sizes[ $tag ] = array(\n\t\t\t\t'width'  => $meta['width'],\n\t\t\t\t'height' => $meta['height'],\n\t\t\t\t'file'   => $basename,\n\t\t\t);\n\t\t}\n\t\t$success = ( $path === $new_path ) || update_attached_file( $post_id, $new_path );\n\n\t\t$meta['file'] = _wp_relative_upload_path( $new_path );\n\n\t\t$size           = $img->get_size();\n\t\t$meta['width']  = $size['width'];\n\t\t$meta['height'] = $size['height'];\n\n\t\tif ( $success && ( 'nothumb' === $target || 'all' === $target ) ) {\n\t\t\t$sizes = get_intermediate_image_sizes();\n\t\t\tif ( 'nothumb' === $target ) {\n\t\t\t\t$sizes = array_diff( $sizes, array( 'thumbnail' ) );\n\t\t\t}\n\t\t}\n\n\t\t$return->fw = $meta['width'];\n\t\t$return->fh = $meta['height'];\n\t} elseif ( 'thumbnail' === $target ) {\n\t\t$sizes   = array( 'thumbnail' );\n\t\t$success = true;\n\t\t$delete  = true;\n\t\t$nocrop  = true;\n\t}\n\n\t/*\n\t * We need to remove any existing resized image files because\n\t * a new crop or rotate could generate different sizes (and hence, filenames),\n\t * keeping the new resized images from overwriting the existing image files.\n\t * https://core.trac.wordpress.org/ticket/32171\n\t */\n\tif ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE && ! empty( $meta['sizes'] ) ) {\n\t\tforeach ( $meta['sizes'] as $size ) {\n\t\t\tif ( ! empty( $size['file'] ) && preg_match( '/-e[0-9]{13}-/', $size['file'] ) ) {\n\t\t\t\t$delete_file = path_join( $dirname, $size['file'] );\n\t\t\t\twp_delete_file( $delete_file );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( isset( $sizes ) ) {\n\t\t$_sizes = array();\n\n\t\tforeach ( $sizes as $size ) {\n\t\t\t$tag = false;\n\t\t\tif ( isset( $meta['sizes'][ $size ] ) ) {\n\t\t\t\tif ( isset( $backup_sizes[ \"$size-orig\" ] ) ) {\n\t\t\t\t\tif ( ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) && $backup_sizes[ \"$size-orig\" ]['file'] != $meta['sizes'][ $size ]['file'] ) {\n\t\t\t\t\t\t$tag = \"$size-$suffix\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$tag = \"$size-orig\";\n\t\t\t\t}\n\n\t\t\t\tif ( $tag ) {\n\t\t\t\t\t$backup_sizes[ $tag ] = $meta['sizes'][ $size ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( isset( $_wp_additional_image_sizes[ $size ] ) ) {\n\t\t\t\t$width  = intval( $_wp_additional_image_sizes[ $size ]['width'] );\n\t\t\t\t$height = intval( $_wp_additional_image_sizes[ $size ]['height'] );\n\t\t\t\t$crop   = ( $nocrop ) ? false : $_wp_additional_image_sizes[ $size ]['crop'];\n\t\t\t} else {\n\t\t\t\t$height = get_option( \"{$size}_size_h\" );\n\t\t\t\t$width  = get_option( \"{$size}_size_w\" );\n\t\t\t\t$crop   = ( $nocrop ) ? false : get_option( \"{$size}_crop\" );\n\t\t\t}\n\n\t\t\t$_sizes[ $size ] = array(\n\t\t\t\t'width'  => $width,\n\t\t\t\t'height' => $height,\n\t\t\t\t'crop'   => $crop,\n\t\t\t);\n\t\t}\n\n\t\t$meta['sizes'] = array_merge( $meta['sizes'], $img->multi_resize( $_sizes ) );\n\t}\n\n\tunset( $img );\n\n\tif ( $success ) {\n\t\twp_update_attachment_metadata( $post_id, $meta );\n\t\tupdate_post_meta( $post_id, '_wp_attachment_backup_sizes', $backup_sizes );\n\n\t\tif ( 'thumbnail' === $target || 'all' === $target || 'full' === $target ) {\n\t\t\t// Check if it's an image edit from attachment edit screen.\n\t\t\tif ( ! empty( $_REQUEST['context'] ) && 'edit-attachment' === $_REQUEST['context'] ) {\n\t\t\t\t$thumb_url         = wp_get_attachment_image_src( $post_id, array( 900, 600 ), true );\n\t\t\t\t$return->thumbnail = $thumb_url[0];\n\t\t\t} else {\n\t\t\t\t$file_url = wp_get_attachment_url( $post_id );\n\t\t\t\tif ( ! empty( $meta['sizes']['thumbnail'] ) ) {\n\t\t\t\t\t$thumb             = $meta['sizes']['thumbnail'];\n\t\t\t\t\t$return->thumbnail = path_join( dirname( $file_url ), $thumb['file'] );\n\t\t\t\t} else {\n\t\t\t\t\t$return->thumbnail = \"$file_url?w=128&h=128\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$delete = true;\n\t}\n\n\tif ( $delete ) {\n\t\twp_delete_file( $new_path );\n\t}\n\n\t$return->msg = esc_js( __( 'Image saved' ) );\n\treturn $return;\n}\n", "num_lines": 990}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * File contains all the administration image manipulation functions.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Crops an image to a given size.\n *\n * @since 2.1.0\n *\n * @param string|int $src      The source file or Attachment ID.\n * @param int        $src_x    The start x position to crop from.\n * @param int        $src_y    The start y position to crop from.\n * @param int        $src_w    The width to crop.\n * @param int        $src_h    The height to crop.\n * @param int        $dst_w    The destination width.\n * @param int        $dst_h    The destination height.\n * @param bool       $src_abs  Optional. If the source crop points are absolute.\n * @param string     $dst_file Optional. The destination file to write to.\n * @return string|WP_Error New filepath on success, WP_Error on failure.\n */\nfunction wp_crop_image( $src, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false ) {\n\t$src_file = $src;\n\tif ( is_numeric( $src ) ) { // Handle int as attachment ID.\n\t\t$src_file = get_attached_file( $src );\n\n\t\tif ( ! file_exists( $src_file ) ) {\n\t\t\t// If the file doesn't exist, attempt a URL fopen on the src link.\n\t\t\t// This can occur with certain file replication plugins.\n\t\t\t$src = _load_image_to_edit_path( $src, 'full' );\n\t\t} else {\n\t\t\t$src = $src_file;\n\t\t}\n\t}\n\n\t$editor = wp_get_image_editor( $src );\n\tif ( is_wp_error( $editor ) ) {\n\t\treturn $editor;\n\t}\n\n\t$src = $editor->crop( $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs );\n\tif ( is_wp_error( $src ) ) {\n\t\treturn $src;\n\t}\n\n\tif ( ! $dst_file ) {\n\t\t$dst_file = str_replace( wp_basename( $src_file ), 'cropped-' . wp_basename( $src_file ), $src_file );\n\t}\n\n\t/*\n\t * The directory containing the original file may no longer exist when\n\t * using a replication plugin.\n\t */\n\twp_mkdir_p( dirname( $dst_file ) );\n\n\t$dst_file = dirname( $dst_file ) . '/' . wp_unique_filename( dirname( $dst_file ), wp_basename( $dst_file ) );\n\n\t$result = $editor->save( $dst_file );\n\tif ( is_wp_error( $result ) ) {\n\t\treturn $result;\n\t}\n\n\treturn $dst_file;\n}\n\n/**\n * Compare the existing image sub-sizes (as saved in the attachment meta)\n * to the currently registered image sub-sizes, and return the difference.\n *\n * Registered sub-sizes that are larger than the image are skipped.\n *\n * @since 5.3.0\n *\n * @param int $attachment_id The image attachment post ID.\n * @return array An array of the image sub-sizes that are currently defined but don't exist for this image.\n */\nfunction wp_get_missing_image_subsizes( $attachment_id ) {\n\tif ( ! wp_attachment_is_image( $attachment_id ) ) {\n\t\treturn array();\n\t}\n\n\t$registered_sizes = wp_get_registered_image_subsizes();\n\t$image_meta       = wp_get_attachment_metadata( $attachment_id );\n\n\t// Meta error?\n\tif ( empty( $image_meta ) ) {\n\t\treturn $registered_sizes;\n\t}\n\n\t// Use the originally uploaded image dimensions as full_width and full_height.\n\tif ( ! empty( $image_meta['original_image'] ) ) {\n\t\t$image_file = wp_get_original_image_path( $attachment_id );\n\t\t$imagesize  = @getimagesize( $image_file );\n\t}\n\n\tif ( ! empty( $imagesize ) ) {\n\t\t$full_width  = $imagesize[0];\n\t\t$full_height = $imagesize[1];\n\t} else {\n\t\t$full_width  = (int) $image_meta['width'];\n\t\t$full_height = (int) $image_meta['height'];\n\t}\n\n\t$possible_sizes = array();\n\n\t// Skip registered sizes that are too large for the uploaded image.\n\tforeach ( $registered_sizes as $size_name => $size_data ) {\n\t\tif ( image_resize_dimensions( $full_width, $full_height, $size_data['width'], $size_data['height'], $size_data['crop'] ) ) {\n\t\t\t$possible_sizes[ $size_name ] = $size_data;\n\t\t}\n\t}\n\n\tif ( empty( $image_meta['sizes'] ) ) {\n\t\t$image_meta['sizes'] = array();\n\t}\n\n\t/*\n\t * Remove sizes that already exist. Only checks for matching \"size names\".\n\t * It is possible that the dimensions for a particular size name have changed.\n\t * For example the user has changed the values on the Settings -> Media screen.\n\t * However we keep the old sub-sizes with the previous dimensions\n\t * as the image may have been used in an older post.\n\t */\n\t$missing_sizes = array_diff_key( $possible_sizes, $image_meta['sizes'] );\n\n\t/**\n\t * Filters the array of missing image sub-sizes for an uploaded image.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param array $missing_sizes Array with the missing image sub-sizes.\n\t * @param array $image_meta    The image meta data.\n\t * @param int   $attachment_id The image attachment post ID.\n\t */\n\treturn apply_filters( 'wp_get_missing_image_subsizes', $missing_sizes, $image_meta, $attachment_id );\n}\n\n/**\n * If any of the currently registered image sub-sizes are missing,\n * create them and update the image meta data.\n *\n * @since 5.3.0\n *\n * @param int $attachment_id The image attachment post ID.\n * @return array|WP_Error The updated image meta data array or WP_Error object\n *                        if both the image meta and the attached file are missing.\n */\nfunction wp_update_image_subsizes( $attachment_id ) {\n\t$image_meta = wp_get_attachment_metadata( $attachment_id );\n\t$image_file = wp_get_original_image_path( $attachment_id );\n\n\tif ( empty( $image_meta ) || ! is_array( $image_meta ) ) {\n\t\t// Previously failed upload?\n\t\t// If there is an uploaded file, make all sub-sizes and generate all of the attachment meta.\n\t\tif ( ! empty( $image_file ) ) {\n\t\t\t$image_meta = wp_create_image_subsizes( $image_file, $attachment_id );\n\t\t} else {\n\t\t\treturn new WP_Error( 'invalid_attachment', __( 'The attached file cannot be found.' ) );\n\t\t}\n\t} else {\n\t\t$missing_sizes = wp_get_missing_image_subsizes( $attachment_id );\n\n\t\tif ( empty( $missing_sizes ) ) {\n\t\t\treturn $image_meta;\n\t\t}\n\n\t\t// This also updates the image meta.\n\t\t$image_meta = _wp_make_subsizes( $missing_sizes, $image_file, $image_meta, $attachment_id );\n\t}\n\n\t/** This filter is documented in wp-admin/includes/image.php */\n\t$image_meta = apply_filters( 'wp_generate_attachment_metadata', $image_meta, $attachment_id, 'update' );\n\n\t// Save the updated metadata.\n\twp_update_attachment_metadata( $attachment_id, $image_meta );\n\n\treturn $image_meta;\n}\n\n/**\n * Updates the attached file and image meta data when the original image was edited.\n *\n * @since 5.3.0\n * @access private\n *\n * @param array  $saved_data    The data returned from WP_Image_Editor after successfully saving an image.\n * @param string $original_file Path to the original file.\n * @param array  $image_meta    The image meta data.\n * @param int    $attachment_id The attachment post ID.\n * @return array The updated image meta data.\n */\nfunction _wp_image_meta_replace_original( $saved_data, $original_file, $image_meta, $attachment_id ) {\n\t$new_file = $saved_data['path'];\n\n\t// Update the attached file meta.\n\tupdate_attached_file( $attachment_id, $new_file );\n\n\t// Width and height of the new image.\n\t$image_meta['width']  = $saved_data['width'];\n\t$image_meta['height'] = $saved_data['height'];\n\n\t// Make the file path relative to the upload dir.\n\t$image_meta['file'] = _wp_relative_upload_path( $new_file );\n\n\t// Store the original image file name in image_meta.\n\t$image_meta['original_image'] = wp_basename( $original_file );\n\n\treturn $image_meta;\n}\n\n/**\n * Creates image sub-sizes, adds the new data to the image meta `sizes` array, and updates the image metadata.\n *\n * Intended for use after an image is uploaded. Saves/updates the image metadata after each\n * sub-size is created. If there was an error, it is added to the returned image metadata array.\n *\n * @since 5.3.0\n *\n * @param string $file          Full path to the image file.\n * @param int    $attachment_id Attachment Id to process.\n * @return array The image attachment meta data.\n */\nfunction wp_create_image_subsizes( $file, $attachment_id ) {\n\t$imagesize = @getimagesize( $file );\n\n\tif ( empty( $imagesize ) ) {\n\t\t// File is not an image.\n\t\treturn array();\n\t}\n\n\t// Default image meta.\n\t$image_meta = array(\n\t\t'width'  => $imagesize[0],\n\t\t'height' => $imagesize[1],\n\t\t'file'   => _wp_relative_upload_path( $file ),\n\t\t'sizes'  => array(),\n\t);\n\n\t// Fetch additional metadata from EXIF/IPTC.\n\t$exif_meta = wp_read_image_metadata( $file );\n\n\tif ( $exif_meta ) {\n\t\t$image_meta['image_meta'] = $exif_meta;\n\t}\n\n\t// Do not scale (large) PNG images. May result in sub-sizes that have greater file size than the original. See #48736.\n\tif ( 'image/png' !== $imagesize['mime'] ) {\n\n\t\t/**\n\t\t * Filters the \"BIG image\" threshold value.\n\t\t *\n\t\t * If the original image width or height is above the threshold, it will be scaled down. The threshold is\n\t\t * used as max width and max height. The scaled down image will be used as the largest available size, including\n\t\t * the `_wp_attached_file` post meta value.\n\t\t *\n\t\t * Returning `false` from the filter callback will disable the scaling.\n\t\t *\n\t\t * @since 5.3.0\n\t\t *\n\t\t * @param int    $threshold     The threshold value in pixels. Default 2560.\n\t\t * @param array  $imagesize     {\n\t\t *     Indexed array of the image width and height in pixels.\n\t\t *\n\t\t *     @type int $0 The image width.\n\t\t *     @type int $1 The image height.\n\t\t * }\n\t\t * @param string $file          Full path to the uploaded image file.\n\t\t * @param int    $attachment_id Attachment post ID.\n\t\t */\n\t\t$threshold = (int) apply_filters( 'big_image_size_threshold', 2560, $imagesize, $file, $attachment_id );\n\n\t\t// If the original image's dimensions are over the threshold,\n\t\t// scale the image and use it as the \"full\" size.\n\t\tif ( $threshold && ( $image_meta['width'] > $threshold || $image_meta['height'] > $threshold ) ) {\n\t\t\t$editor = wp_get_image_editor( $file );\n\n\t\t\tif ( is_wp_error( $editor ) ) {\n\t\t\t\t// This image cannot be edited.\n\t\t\t\treturn $image_meta;\n\t\t\t}\n\n\t\t\t// Resize the image.\n\t\t\t$resized = $editor->resize( $threshold, $threshold );\n\t\t\t$rotated = null;\n\n\t\t\t// If there is EXIF data, rotate according to EXIF Orientation.\n\t\t\tif ( ! is_wp_error( $resized ) && is_array( $exif_meta ) ) {\n\t\t\t\t$resized = $editor->maybe_exif_rotate();\n\t\t\t\t$rotated = $resized;\n\t\t\t}\n\n\t\t\tif ( ! is_wp_error( $resized ) ) {\n\t\t\t\t// Append \"-scaled\" to the image file name. It will look like \"my_image-scaled.jpg\".\n\t\t\t\t// This doesn't affect the sub-sizes names as they are generated from the original image (for best quality).\n\t\t\t\t$saved = $editor->save( $editor->generate_filename( 'scaled' ) );\n\n\t\t\t\tif ( ! is_wp_error( $saved ) ) {\n\t\t\t\t\t$image_meta = _wp_image_meta_replace_original( $saved, $file, $image_meta, $attachment_id );\n\n\t\t\t\t\t// If the image was rotated update the stored EXIF data.\n\t\t\t\t\tif ( true === $rotated && ! empty( $image_meta['image_meta']['orientation'] ) ) {\n\t\t\t\t\t\t$image_meta['image_meta']['orientation'] = 1;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// TODO: Log errors.\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// TODO: Log errors.\n\t\t\t}\n\t\t} elseif ( ! empty( $exif_meta['orientation'] ) && 1 !== (int) $exif_meta['orientation'] ) {\n\t\t\t// Rotate the whole original image if there is EXIF data and \"orientation\" is not 1.\n\n\t\t\t$editor = wp_get_image_editor( $file );\n\n\t\t\tif ( is_wp_error( $editor ) ) {\n\t\t\t\t// This image cannot be edited.\n\t\t\t\treturn $image_meta;\n\t\t\t}\n\n\t\t\t// Rotate the image.\n\t\t\t$rotated = $editor->maybe_exif_rotate();\n\n\t\t\tif ( true === $rotated ) {\n\t\t\t\t// Append `-rotated` to the image file name.\n\t\t\t\t$saved = $editor->save( $editor->generate_filename( 'rotated' ) );\n\n\t\t\t\tif ( ! is_wp_error( $saved ) ) {\n\t\t\t\t\t$image_meta = _wp_image_meta_replace_original( $saved, $file, $image_meta, $attachment_id );\n\n\t\t\t\t\t// Update the stored EXIF data.\n\t\t\t\t\tif ( ! empty( $image_meta['image_meta']['orientation'] ) ) {\n\t\t\t\t\t\t$image_meta['image_meta']['orientation'] = 1;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// TODO: Log errors.\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t * Initial save of the new metadata.\n\t * At this point the file was uploaded and moved to the uploads directory\n\t * but the image sub-sizes haven't been created yet and the `sizes` array is empty.\n\t */\n\twp_update_attachment_metadata( $attachment_id, $image_meta );\n\n\t$new_sizes = wp_get_registered_image_subsizes();\n\n\t/**\n\t * Filters the image sizes automatically generated when uploading an image.\n\t *\n\t * @since 2.9.0\n\t * @since 4.4.0 Added the `$image_meta` argument.\n\t * @since 5.3.0 Added the `$attachment_id` argument.\n\t *\n\t * @param array $new_sizes     Associative array of image sizes to be created.\n\t * @param array $image_meta    The image meta data: width, height, file, sizes, etc.\n\t * @param int   $attachment_id The attachment post ID for the image.\n\t */\n\t$new_sizes = apply_filters( 'intermediate_image_sizes_advanced', $new_sizes, $image_meta, $attachment_id );\n\n\treturn _wp_make_subsizes( $new_sizes, $file, $image_meta, $attachment_id );\n}\n\n/**\n * Low-level function to create image sub-sizes.\n *\n * Updates the image meta after each sub-size is created.\n * Errors are stored in the returned image metadata array.\n *\n * @since 5.3.0\n * @access private\n *\n * @param array  $new_sizes     Array defining what sizes to create.\n * @param string $file          Full path to the image file.\n * @param array  $image_meta    The attachment meta data array.\n * @param int    $attachment_id Attachment Id to process.\n * @return array The attachment meta data with updated `sizes` array. Includes an array of errors encountered while resizing.\n */\nfunction _wp_make_subsizes( $new_sizes, $file, $image_meta, $attachment_id ) {\n\tif ( empty( $image_meta ) || ! is_array( $image_meta ) ) {\n\t\t// Not an image attachment.\n\t\treturn array();\n\t}\n\n\t// Check if any of the new sizes already exist.\n\tif ( isset( $image_meta['sizes'] ) && is_array( $image_meta['sizes'] ) ) {\n\t\tforeach ( $image_meta['sizes'] as $size_name => $size_meta ) {\n\t\t\t/*\n\t\t\t * Only checks \"size name\" so we don't override existing images even if the dimensions\n\t\t\t * don't match the currently defined size with the same name.\n\t\t\t * To change the behavior, unset changed/mismatched sizes in the `sizes` array in image meta.\n\t\t\t */\n\t\t\tif ( array_key_exists( $size_name, $new_sizes ) ) {\n\t\t\t\tunset( $new_sizes[ $size_name ] );\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$image_meta['sizes'] = array();\n\t}\n\n\tif ( empty( $new_sizes ) ) {\n\t\t// Nothing to do...\n\t\treturn $image_meta;\n\t}\n\n\t/*\n\t * Sort the image sub-sizes in order of priority when creating them.\n\t * This ensures there is an appropriate sub-size the user can access immediately\n\t * even when there was an error and not all sub-sizes were created.\n\t */\n\t$priority = array(\n\t\t'medium'       => null,\n\t\t'large'        => null,\n\t\t'thumbnail'    => null,\n\t\t'medium_large' => null,\n\t);\n\n\t$new_sizes = array_filter( array_merge( $priority, $new_sizes ) );\n\n\t$editor = wp_get_image_editor( $file );\n\n\tif ( is_wp_error( $editor ) ) {\n\t\t// The image cannot be edited.\n\t\treturn $image_meta;\n\t}\n\n\t// If stored EXIF data exists, rotate the source image before creating sub-sizes.\n\tif ( ! empty( $image_meta['image_meta'] ) ) {\n\t\t$rotated = $editor->maybe_exif_rotate();\n\n\t\tif ( is_wp_error( $rotated ) ) {\n\t\t\t// TODO: Log errors.\n\t\t}\n\t}\n\n\tif ( method_exists( $editor, 'make_subsize' ) ) {\n\t\tforeach ( $new_sizes as $new_size_name => $new_size_data ) {\n\t\t\t$new_size_meta = $editor->make_subsize( $new_size_data );\n\n\t\t\tif ( is_wp_error( $new_size_meta ) ) {\n\t\t\t\t// TODO: Log errors.\n\t\t\t} else {\n\t\t\t\t// Save the size meta value.\n\t\t\t\t$image_meta['sizes'][ $new_size_name ] = $new_size_meta;\n\t\t\t\twp_update_attachment_metadata( $attachment_id, $image_meta );\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Fall back to `$editor->multi_resize()`.\n\t\t$created_sizes = $editor->multi_resize( $new_sizes );\n\n\t\tif ( ! empty( $created_sizes ) ) {\n\t\t\t$image_meta['sizes'] = array_merge( $image_meta['sizes'], $created_sizes );\n\t\t\twp_update_attachment_metadata( $attachment_id, $image_meta );\n\t\t}\n\t}\n\n\treturn $image_meta;\n}\n\n/**\n * Generate attachment meta data and create image sub-sizes for images.\n *\n * @since 2.1.0\n *\n * @param int    $attachment_id Attachment Id to process.\n * @param string $file          Filepath of the Attached image.\n * @return mixed Metadata for attachment.\n */\nfunction wp_generate_attachment_metadata( $attachment_id, $file ) {\n\t$attachment = get_post( $attachment_id );\n\n\t$metadata  = array();\n\t$support   = false;\n\t$mime_type = get_post_mime_type( $attachment );\n\n\tif ( preg_match( '!^image/!', $mime_type ) && file_is_displayable_image( $file ) ) {\n\t\t// Make thumbnails and other intermediate sizes.\n\t\t$metadata = wp_create_image_subsizes( $file, $attachment_id );\n\t} elseif ( wp_attachment_is( 'video', $attachment ) ) {\n\t\t$metadata = wp_read_video_metadata( $file );\n\t\t$support  = current_theme_supports( 'post-thumbnails', 'attachment:video' ) || post_type_supports( 'attachment:video', 'thumbnail' );\n\t} elseif ( wp_attachment_is( 'audio', $attachment ) ) {\n\t\t$metadata = wp_read_audio_metadata( $file );\n\t\t$support  = current_theme_supports( 'post-thumbnails', 'attachment:audio' ) || post_type_supports( 'attachment:audio', 'thumbnail' );\n\t}\n\n\tif ( $support && ! empty( $metadata['image']['data'] ) ) {\n\t\t// Check for existing cover.\n\t\t$hash   = md5( $metadata['image']['data'] );\n\t\t$posts  = get_posts(\n\t\t\tarray(\n\t\t\t\t'fields'         => 'ids',\n\t\t\t\t'post_type'      => 'attachment',\n\t\t\t\t'post_mime_type' => $metadata['image']['mime'],\n\t\t\t\t'post_status'    => 'inherit',\n\t\t\t\t'posts_per_page' => 1,\n\t\t\t\t'meta_key'       => '_cover_hash',\n\t\t\t\t'meta_value'     => $hash,\n\t\t\t)\n\t\t);\n\t\t$exists = reset( $posts );\n\n\t\tif ( ! empty( $exists ) ) {\n\t\t\tupdate_post_meta( $attachment_id, '_thumbnail_id', $exists );\n\t\t} else {\n\t\t\t$ext = '.jpg';\n\t\t\tswitch ( $metadata['image']['mime'] ) {\n\t\t\t\tcase 'image/gif':\n\t\t\t\t\t$ext = '.gif';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/png':\n\t\t\t\t\t$ext = '.png';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$basename = str_replace( '.', '-', wp_basename( $file ) ) . '-image' . $ext;\n\t\t\t$uploaded = wp_upload_bits( $basename, '', $metadata['image']['data'] );\n\t\t\tif ( false === $uploaded['error'] ) {\n\t\t\t\t$image_attachment = array(\n\t\t\t\t\t'post_mime_type' => $metadata['image']['mime'],\n\t\t\t\t\t'post_type'      => 'attachment',\n\t\t\t\t\t'post_content'   => '',\n\t\t\t\t);\n\t\t\t\t/**\n\t\t\t\t * Filters the parameters for the attachment thumbnail creation.\n\t\t\t\t *\n\t\t\t\t * @since 3.9.0\n\t\t\t\t *\n\t\t\t\t * @param array $image_attachment An array of parameters to create the thumbnail.\n\t\t\t\t * @param array $metadata         Current attachment metadata.\n\t\t\t\t * @param array $uploaded         {\n\t\t\t\t *     Information about the newly-uploaded file.\n\t\t\t\t *\n\t\t\t\t *     @type string $file  Filename of the newly-uploaded file.\n\t\t\t\t *     @type string $url   URL of the uploaded file.\n\t\t\t\t *     @type string $type  File type.\n\t\t\t\t * }\n\t\t\t\t */\n\t\t\t\t$image_attachment = apply_filters( 'attachment_thumbnail_args', $image_attachment, $metadata, $uploaded );\n\n\t\t\t\t$sub_attachment_id = wp_insert_attachment( $image_attachment, $uploaded['file'] );\n\t\t\t\tadd_post_meta( $sub_attachment_id, '_cover_hash', $hash );\n\t\t\t\t$attach_data = wp_generate_attachment_metadata( $sub_attachment_id, $uploaded['file'] );\n\t\t\t\twp_update_attachment_metadata( $sub_attachment_id, $attach_data );\n\t\t\t\tupdate_post_meta( $attachment_id, '_thumbnail_id', $sub_attachment_id );\n\t\t\t}\n\t\t}\n\t} elseif ( 'application/pdf' === $mime_type ) {\n\t\t// Try to create image thumbnails for PDFs.\n\n\t\t$fallback_sizes = array(\n\t\t\t'thumbnail',\n\t\t\t'medium',\n\t\t\t'large',\n\t\t);\n\n\t\t/**\n\t\t * Filters the image sizes generated for non-image mime types.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param string[] $fallback_sizes An array of image size names.\n\t\t * @param array    $metadata       Current attachment metadata.\n\t\t */\n\t\t$fallback_sizes = apply_filters( 'fallback_intermediate_image_sizes', $fallback_sizes, $metadata );\n\n\t\t$registered_sizes = wp_get_registered_image_subsizes();\n\t\t$merged_sizes     = array_intersect_key( $registered_sizes, array_flip( $fallback_sizes ) );\n\n\t\t// Force thumbnails to be soft crops.\n\t\tif ( isset( $merged_sizes['thumbnail'] ) && is_array( $merged_sizes['thumbnail'] ) ) {\n\t\t\t$merged_sizes['thumbnail']['crop'] = false;\n\t\t}\n\n\t\t// Only load PDFs in an image editor if we're processing sizes.\n\t\tif ( ! empty( $merged_sizes ) ) {\n\t\t\t$editor = wp_get_image_editor( $file );\n\n\t\t\tif ( ! is_wp_error( $editor ) ) { // No support for this type of file.\n\t\t\t\t/*\n\t\t\t\t * PDFs may have the same file filename as JPEGs.\n\t\t\t\t * Ensure the PDF preview image does not overwrite any JPEG images that already exist.\n\t\t\t\t */\n\t\t\t\t$dirname      = dirname( $file ) . '/';\n\t\t\t\t$ext          = '.' . pathinfo( $file, PATHINFO_EXTENSION );\n\t\t\t\t$preview_file = $dirname . wp_unique_filename( $dirname, wp_basename( $file, $ext ) . '-pdf.jpg' );\n\n\t\t\t\t$uploaded = $editor->save( $preview_file, 'image/jpeg' );\n\t\t\t\tunset( $editor );\n\n\t\t\t\t// Resize based on the full size image, rather than the source.\n\t\t\t\tif ( ! is_wp_error( $uploaded ) ) {\n\t\t\t\t\t$image_file = $uploaded['path'];\n\t\t\t\t\tunset( $uploaded['path'] );\n\n\t\t\t\t\t$metadata['sizes'] = array(\n\t\t\t\t\t\t'full' => $uploaded,\n\t\t\t\t\t);\n\n\t\t\t\t\t// Save the meta data before any image post-processing errors could happen.\n\t\t\t\t\twp_update_attachment_metadata( $attachment_id, $metadata );\n\n\t\t\t\t\t// Create sub-sizes saving the image meta after each.\n\t\t\t\t\t$metadata = _wp_make_subsizes( $merged_sizes, $image_file, $metadata, $attachment_id );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove the blob of binary data from the array.\n\tif ( $metadata ) {\n\t\tunset( $metadata['image']['data'] );\n\t}\n\n\t/**\n\t * Filters the generated attachment meta data.\n\t *\n\t * @since 2.1.0\n\t * @since 5.3.0 The `$context` parameter was added.\n\t *\n\t * @param array  $metadata      An array of attachment meta data.\n\t * @param int    $attachment_id Current attachment ID.\n\t * @param string $context       Additional context. Can be 'create' when metadata was initially created for new attachment\n\t *                              or 'update' when the metadata was updated.\n\t */\n\treturn apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id, 'create' );\n}\n\n/**\n * Convert a fraction string to a decimal.\n *\n * @since 2.5.0\n *\n * @param string $str\n * @return int|float\n */\nfunction wp_exif_frac2dec( $str ) {\n\tif ( false === strpos( $str, '/' ) ) {\n\t\treturn $str;\n\t}\n\n\tlist( $numerator, $denominator ) = explode( '/', $str );\n\tif ( ! empty( $denominator ) ) {\n\t\treturn $numerator / $denominator;\n\t}\n\treturn $str;\n}\n\n/**\n * Convert the exif date format to a unix timestamp.\n *\n * @since 2.5.0\n *\n * @param string $str\n * @return int\n */\nfunction wp_exif_date2ts( $str ) {\n\tlist( $date, $time ) = explode( ' ', trim( $str ) );\n\tlist( $y, $m, $d )   = explode( ':', $date );\n\n\treturn strtotime( \"{$y}-{$m}-{$d} {$time}\" );\n}\n\n/**\n * Get extended image metadata, exif or iptc as available.\n *\n * Retrieves the EXIF metadata aperture, credit, camera, caption, copyright, iso\n * created_timestamp, focal_length, shutter_speed, and title.\n *\n * The IPTC metadata that is retrieved is APP13, credit, byline, created date\n * and time, caption, copyright, and title. Also includes FNumber, Model,\n * DateTimeDigitized, FocalLength, ISOSpeedRatings, and ExposureTime.\n *\n * @todo Try other exif libraries if available.\n * @since 2.5.0\n *\n * @param string $file\n * @return bool|array False on failure. Image metadata array on success.\n */\nfunction wp_read_image_metadata( $file ) {\n\tif ( ! file_exists( $file ) ) {\n\t\treturn false;\n\t}\n\n\tlist( , , $image_type ) = @getimagesize( $file );\n\n\t/*\n\t * EXIF contains a bunch of data we'll probably never need formatted in ways\n\t * that are difficult to use. We'll normalize it and just extract the fields\n\t * that are likely to be useful. Fractions and numbers are converted to\n\t * floats, dates to unix timestamps, and everything else to strings.\n\t */\n\t$meta = array(\n\t\t'aperture'          => 0,\n\t\t'credit'            => '',\n\t\t'camera'            => '',\n\t\t'caption'           => '',\n\t\t'created_timestamp' => 0,\n\t\t'copyright'         => '',\n\t\t'focal_length'      => 0,\n\t\t'iso'               => 0,\n\t\t'shutter_speed'     => 0,\n\t\t'title'             => '',\n\t\t'orientation'       => 0,\n\t\t'keywords'          => array(),\n\t);\n\n\t$iptc = array();\n\t/*\n\t * Read IPTC first, since it might contain data not available in exif such\n\t * as caption, description etc.\n\t */\n\tif ( is_callable( 'iptcparse' ) ) {\n\t\t@getimagesize( $file, $info );\n\n\t\tif ( ! empty( $info['APP13'] ) ) {\n\t\t\t$iptc = @iptcparse( $info['APP13'] );\n\n\t\t\t// Headline, \"A brief synopsis of the caption\".\n\t\t\tif ( ! empty( $iptc['2#105'][0] ) ) {\n\t\t\t\t$meta['title'] = trim( $iptc['2#105'][0] );\n\t\t\t\t/*\n\t\t\t\t* Title, \"Many use the Title field to store the filename of the image,\n\t\t\t\t* though the field may be used in many ways\".\n\t\t\t\t*/\n\t\t\t} elseif ( ! empty( $iptc['2#005'][0] ) ) {\n\t\t\t\t$meta['title'] = trim( $iptc['2#005'][0] );\n\t\t\t}\n\n\t\t\tif ( ! empty( $iptc['2#120'][0] ) ) { // Description / legacy caption.\n\t\t\t\t$caption = trim( $iptc['2#120'][0] );\n\n\t\t\t\tmbstring_binary_safe_encoding();\n\t\t\t\t$caption_length = strlen( $caption );\n\t\t\t\treset_mbstring_encoding();\n\n\t\t\t\tif ( empty( $meta['title'] ) && $caption_length < 80 ) {\n\t\t\t\t\t// Assume the title is stored in 2:120 if it's short.\n\t\t\t\t\t$meta['title'] = $caption;\n\t\t\t\t}\n\n\t\t\t\t$meta['caption'] = $caption;\n\t\t\t}\n\n\t\t\tif ( ! empty( $iptc['2#110'][0] ) ) { // Credit.\n\t\t\t\t$meta['credit'] = trim( $iptc['2#110'][0] );\n\t\t\t} elseif ( ! empty( $iptc['2#080'][0] ) ) { // Creator / legacy byline.\n\t\t\t\t$meta['credit'] = trim( $iptc['2#080'][0] );\n\t\t\t}\n\n\t\t\tif ( ! empty( $iptc['2#055'][0] ) && ! empty( $iptc['2#060'][0] ) ) { // Created date and time.\n\t\t\t\t$meta['created_timestamp'] = strtotime( $iptc['2#055'][0] . ' ' . $iptc['2#060'][0] );\n\t\t\t}\n\n\t\t\tif ( ! empty( $iptc['2#116'][0] ) ) { // Copyright.\n\t\t\t\t$meta['copyright'] = trim( $iptc['2#116'][0] );\n\t\t\t}\n\n\t\t\tif ( ! empty( $iptc['2#025'][0] ) ) { // Keywords array.\n\t\t\t\t$meta['keywords'] = array_values( $iptc['2#025'] );\n\t\t\t}\n\t\t}\n\t}\n\n\t$exif = array();\n\n\t/**\n\t * Filters the image types to check for exif data.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param array $image_types Image types to check for exif data.\n\t */\n\t$exif_image_types = apply_filters( 'wp_read_image_metadata_types', array( IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM ) );\n\n\tif ( is_callable( 'exif_read_data' ) && in_array( $image_type, $exif_image_types, true ) ) {\n\t\t$exif = @exif_read_data( $file );\n\n\t\tif ( ! empty( $exif['ImageDescription'] ) ) {\n\t\t\tmbstring_binary_safe_encoding();\n\t\t\t$description_length = strlen( $exif['ImageDescription'] );\n\t\t\treset_mbstring_encoding();\n\n\t\t\tif ( empty( $meta['title'] ) && $description_length < 80 ) {\n\t\t\t\t// Assume the title is stored in ImageDescription.\n\t\t\t\t$meta['title'] = trim( $exif['ImageDescription'] );\n\t\t\t}\n\n\t\t\tif ( empty( $meta['caption'] ) && ! empty( $exif['COMPUTED']['UserComment'] ) ) {\n\t\t\t\t$meta['caption'] = trim( $exif['COMPUTED']['UserComment'] );\n\t\t\t}\n\n\t\t\tif ( empty( $meta['caption'] ) ) {\n\t\t\t\t$meta['caption'] = trim( $exif['ImageDescription'] );\n\t\t\t}\n\t\t} elseif ( empty( $meta['caption'] ) && ! empty( $exif['Comments'] ) ) {\n\t\t\t$meta['caption'] = trim( $exif['Comments'] );\n\t\t}\n\n\t\tif ( empty( $meta['credit'] ) ) {\n\t\t\tif ( ! empty( $exif['Artist'] ) ) {\n\t\t\t\t$meta['credit'] = trim( $exif['Artist'] );\n\t\t\t} elseif ( ! empty( $exif['Author'] ) ) {\n\t\t\t\t$meta['credit'] = trim( $exif['Author'] );\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $meta['copyright'] ) && ! empty( $exif['Copyright'] ) ) {\n\t\t\t$meta['copyright'] = trim( $exif['Copyright'] );\n\t\t}\n\t\tif ( ! empty( $exif['FNumber'] ) ) {\n\t\t\t$meta['aperture'] = round( wp_exif_frac2dec( $exif['FNumber'] ), 2 );\n\t\t}\n\t\tif ( ! empty( $exif['Model'] ) ) {\n\t\t\t$meta['camera'] = trim( $exif['Model'] );\n\t\t}\n\t\tif ( empty( $meta['created_timestamp'] ) && ! empty( $exif['DateTimeDigitized'] ) ) {\n\t\t\t$meta['created_timestamp'] = wp_exif_date2ts( $exif['DateTimeDigitized'] );\n\t\t}\n\t\tif ( ! empty( $exif['FocalLength'] ) ) {\n\t\t\t$meta['focal_length'] = (string) wp_exif_frac2dec( $exif['FocalLength'] );\n\t\t}\n\t\tif ( ! empty( $exif['ISOSpeedRatings'] ) ) {\n\t\t\t$meta['iso'] = is_array( $exif['ISOSpeedRatings'] ) ? reset( $exif['ISOSpeedRatings'] ) : $exif['ISOSpeedRatings'];\n\t\t\t$meta['iso'] = trim( $meta['iso'] );\n\t\t}\n\t\tif ( ! empty( $exif['ExposureTime'] ) ) {\n\t\t\t$meta['shutter_speed'] = (string) wp_exif_frac2dec( $exif['ExposureTime'] );\n\t\t}\n\t\tif ( ! empty( $exif['Orientation'] ) ) {\n\t\t\t$meta['orientation'] = $exif['Orientation'];\n\t\t}\n\t}\n\n\tforeach ( array( 'title', 'caption', 'credit', 'copyright', 'camera', 'iso' ) as $key ) {\n\t\tif ( $meta[ $key ] && ! seems_utf8( $meta[ $key ] ) ) {\n\t\t\t$meta[ $key ] = utf8_encode( $meta[ $key ] );\n\t\t}\n\t}\n\n\tforeach ( $meta['keywords'] as $key => $keyword ) {\n\t\tif ( ! seems_utf8( $keyword ) ) {\n\t\t\t$meta['keywords'][ $key ] = utf8_encode( $keyword );\n\t\t}\n\t}\n\n\t$meta = wp_kses_post_deep( $meta );\n\n\t/**\n\t * Filters the array of meta data read from an image's exif data.\n\t *\n\t * @since 2.5.0\n\t * @since 4.4.0 The `$iptc` parameter was added.\n\t * @since 5.0.0 The `$exif` parameter was added.\n\t *\n\t * @param array  $meta       Image meta data.\n\t * @param string $file       Path to image file.\n\t * @param int    $image_type Type of image, one of the `IMAGETYPE_XXX` constants.\n\t * @param array  $iptc       IPTC data.\n\t * @param array  $exif       EXIF data.\n\t */\n\treturn apply_filters( 'wp_read_image_metadata', $meta, $file, $image_type, $iptc, $exif );\n\n}\n\n/**\n * Validate that file is an image.\n *\n * @since 2.5.0\n *\n * @param string $path File path to test if valid image.\n * @return bool True if valid image, false if not valid image.\n */\nfunction file_is_valid_image( $path ) {\n\t$size = @getimagesize( $path );\n\treturn ! empty( $size );\n}\n\n/**\n * Validate that file is suitable for displaying within a web page.\n *\n * @since 2.5.0\n *\n * @param string $path File path to test.\n * @return bool True if suitable, false if not suitable.\n */\nfunction file_is_displayable_image( $path ) {\n\t$displayable_image_types = array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_ICO );\n\n\t$info = @getimagesize( $path );\n\tif ( empty( $info ) ) {\n\t\t$result = false;\n\t} elseif ( ! in_array( $info[2], $displayable_image_types, true ) ) {\n\t\t$result = false;\n\t} else {\n\t\t$result = true;\n\t}\n\n\t/**\n\t * Filters whether the current image is displayable in the browser.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param bool   $result Whether the image can be displayed. Default true.\n\t * @param string $path   Path to the image.\n\t */\n\treturn apply_filters( 'file_is_displayable_image', $result, $path );\n}\n\n/**\n * Load an image resource for editing.\n *\n * @since 2.9.0\n *\n * @param string $attachment_id Attachment ID.\n * @param string $mime_type Image mime type.\n * @param string $size Optional. Image size, defaults to 'full'.\n * @return resource|false The resulting image resource on success, false on failure.\n */\nfunction load_image_to_edit( $attachment_id, $mime_type, $size = 'full' ) {\n\t$filepath = _load_image_to_edit_path( $attachment_id, $size );\n\tif ( empty( $filepath ) ) {\n\t\treturn false;\n\t}\n\n\tswitch ( $mime_type ) {\n\t\tcase 'image/jpeg':\n\t\t\t$image = imagecreatefromjpeg( $filepath );\n\t\t\tbreak;\n\t\tcase 'image/png':\n\t\t\t$image = imagecreatefrompng( $filepath );\n\t\t\tbreak;\n\t\tcase 'image/gif':\n\t\t\t$image = imagecreatefromgif( $filepath );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$image = false;\n\t\t\tbreak;\n\t}\n\tif ( is_resource( $image ) ) {\n\t\t/**\n\t\t * Filters the current image being loaded for editing.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param resource $image         Current image.\n\t\t * @param string   $attachment_id Attachment ID.\n\t\t * @param string   $size          Image size.\n\t\t */\n\t\t$image = apply_filters( 'load_image_to_edit', $image, $attachment_id, $size );\n\t\tif ( function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' ) ) {\n\t\t\timagealphablending( $image, false );\n\t\t\timagesavealpha( $image, true );\n\t\t}\n\t}\n\treturn $image;\n}\n\n/**\n * Retrieve the path or url of an attachment's attached file.\n *\n * If the attached file is not present on the local filesystem (usually due to replication plugins),\n * then the url of the file is returned if url fopen is supported.\n *\n * @since 3.4.0\n * @access private\n *\n * @param string $attachment_id Attachment ID.\n * @param string $size Optional. Image size, defaults to 'full'.\n * @return string|false File path or url on success, false on failure.\n */\nfunction _load_image_to_edit_path( $attachment_id, $size = 'full' ) {\n\t$filepath = get_attached_file( $attachment_id );\n\n\tif ( $filepath && file_exists( $filepath ) ) {\n\t\tif ( 'full' !== $size ) {\n\t\t\t$data = image_get_intermediate_size( $attachment_id, $size );\n\n\t\t\tif ( $data ) {\n\t\t\t\t$filepath = path_join( dirname( $filepath ), $data['file'] );\n\n\t\t\t\t/**\n\t\t\t\t * Filters the path to the current image.\n\t\t\t\t *\n\t\t\t\t * The filter is evaluated for all image sizes except 'full'.\n\t\t\t\t *\n\t\t\t\t * @since 3.1.0\n\t\t\t\t *\n\t\t\t\t * @param string $path          Path to the current image.\n\t\t\t\t * @param string $attachment_id Attachment ID.\n\t\t\t\t * @param string $size          Size of the image.\n\t\t\t\t */\n\t\t\t\t$filepath = apply_filters( 'load_image_to_edit_filesystempath', $filepath, $attachment_id, $size );\n\t\t\t}\n\t\t}\n\t} elseif ( function_exists( 'fopen' ) && ini_get( 'allow_url_fopen' ) ) {\n\t\t/**\n\t\t * Filters the image URL if not in the local filesystem.\n\t\t *\n\t\t * The filter is only evaluated if fopen is enabled on the server.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string $image_url     Current image URL.\n\t\t * @param string $attachment_id Attachment ID.\n\t\t * @param string $size          Size of the image.\n\t\t */\n\t\t$filepath = apply_filters( 'load_image_to_edit_attachmenturl', wp_get_attachment_url( $attachment_id ), $attachment_id, $size );\n\t}\n\n\t/**\n\t * Filters the returned path or URL of the current image.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string|bool $filepath      File path or URL to current image, or false.\n\t * @param string      $attachment_id Attachment ID.\n\t * @param string      $size          Size of the image.\n\t */\n\treturn apply_filters( 'load_image_to_edit_path', $filepath, $attachment_id, $size );\n}\n\n/**\n * Copy an existing image file.\n *\n * @since 3.4.0\n * @access private\n *\n * @param string $attachment_id Attachment ID.\n * @return string|false New file path on success, false on failure.\n */\nfunction _copy_image_file( $attachment_id ) {\n\t$dst_file = get_attached_file( $attachment_id );\n\t$src_file = $dst_file;\n\n\tif ( ! file_exists( $src_file ) ) {\n\t\t$src_file = _load_image_to_edit_path( $attachment_id );\n\t}\n\n\tif ( $src_file ) {\n\t\t$dst_file = str_replace( wp_basename( $dst_file ), 'copy-' . wp_basename( $dst_file ), $dst_file );\n\t\t$dst_file = dirname( $dst_file ) . '/' . wp_unique_filename( dirname( $dst_file ), wp_basename( $dst_file ) );\n\n\t\t/*\n\t\t * The directory containing the original file may no longer\n\t\t * exist when using a replication plugin.\n\t\t */\n\t\twp_mkdir_p( dirname( $dst_file ) );\n\n\t\tif ( ! copy( $src_file, $dst_file ) ) {\n\t\t\t$dst_file = false;\n\t\t}\n\t} else {\n\t\t$dst_file = false;\n\t}\n\n\treturn $dst_file;\n}\n", "num_lines": 1064}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Administration Importer API.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Retrieve list of importers.\n *\n * @since 2.0.0\n *\n * @global array $wp_importers\n * @return array\n */\nfunction get_importers() {\n\tglobal $wp_importers;\n\tif ( is_array( $wp_importers ) ) {\n\t\tuasort( $wp_importers, '_usort_by_first_member' );\n\t}\n\treturn $wp_importers;\n}\n\n/**\n * Sorts a multidimensional array by first member of each top level member\n *\n * Used by uasort() as a callback, should not be used directly.\n *\n * @since 2.9.0\n * @access private\n *\n * @param array $a\n * @param array $b\n * @return int\n */\nfunction _usort_by_first_member( $a, $b ) {\n\treturn strnatcasecmp( $a[0], $b[0] );\n}\n\n/**\n * Register importer for WordPress.\n *\n * @since 2.0.0\n *\n * @global array $wp_importers\n *\n * @param string   $id          Importer tag. Used to uniquely identify importer.\n * @param string   $name        Importer name and title.\n * @param string   $description Importer description.\n * @param callable $callback    Callback to run.\n * @return WP_Error Returns WP_Error when $callback is WP_Error.\n */\nfunction register_importer( $id, $name, $description, $callback ) {\n\tglobal $wp_importers;\n\tif ( is_wp_error( $callback ) ) {\n\t\treturn $callback;\n\t}\n\t$wp_importers[ $id ] = array( $name, $description, $callback );\n}\n\n/**\n * Cleanup importer.\n *\n * Removes attachment based on ID.\n *\n * @since 2.0.0\n *\n * @param string $id Importer ID.\n */\nfunction wp_import_cleanup( $id ) {\n\twp_delete_attachment( $id );\n}\n\n/**\n * Handle importer uploading and add attachment.\n *\n * @since 2.0.0\n *\n * @return array Uploaded file's details on success, error message on failure\n */\nfunction wp_import_handle_upload() {\n\tif ( ! isset( $_FILES['import'] ) ) {\n\t\treturn array(\n\t\t\t'error' => sprintf(\n\t\t\t\t/* translators: 1: php.ini, 2: post_max_size, 3: upload_max_filesize */\n\t\t\t\t__( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your %1$s file or by %2$s being defined as smaller than %3$s in %1$s.' ),\n\t\t\t\t'php.ini',\n\t\t\t\t'post_max_size',\n\t\t\t\t'upload_max_filesize'\n\t\t\t),\n\t\t);\n\t}\n\n\t$overrides                 = array(\n\t\t'test_form' => false,\n\t\t'test_type' => false,\n\t);\n\t$_FILES['import']['name'] .= '.txt';\n\t$upload                    = wp_handle_upload( $_FILES['import'], $overrides );\n\n\tif ( isset( $upload['error'] ) ) {\n\t\treturn $upload;\n\t}\n\n\t// Construct the object array.\n\t$object = array(\n\t\t'post_title'     => wp_basename( $upload['file'] ),\n\t\t'post_content'   => $upload['url'],\n\t\t'post_mime_type' => $upload['type'],\n\t\t'guid'           => $upload['url'],\n\t\t'context'        => 'import',\n\t\t'post_status'    => 'private',\n\t);\n\n\t// Save the data.\n\t$id = wp_insert_attachment( $object, $upload['file'] );\n\n\t/*\n\t * Schedule a cleanup for one day from now in case of failed\n\t * import or missing wp_import_cleanup() call.\n\t */\n\twp_schedule_single_event( time() + DAY_IN_SECONDS, 'importer_scheduled_cleanup', array( $id ) );\n\n\treturn array(\n\t\t'file' => $upload['file'],\n\t\t'id'   => $id,\n\t);\n}\n\n/**\n * Returns a list from WordPress.org of popular importer plugins.\n *\n * @since 3.5.0\n *\n * @return array Importers with metadata for each.\n */\nfunction wp_get_popular_importers() {\n\t// Include an unmodified $wp_version.\n\trequire ABSPATH . WPINC . '/version.php';\n\n\t$locale            = get_user_locale();\n\t$cache_key         = 'popular_importers_' . md5( $locale . $wp_version );\n\t$popular_importers = get_site_transient( $cache_key );\n\n\tif ( ! $popular_importers ) {\n\t\t$url     = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'locale'  => $locale,\n\t\t\t\t'version' => $wp_version,\n\t\t\t),\n\t\t\t'http://api.wordpress.org/core/importers/1.1/'\n\t\t);\n\t\t$options = array( 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ) );\n\n\t\tif ( wp_http_supports( array( 'ssl' ) ) ) {\n\t\t\t$url = set_url_scheme( $url, 'https' );\n\t\t}\n\n\t\t$response          = wp_remote_get( $url, $options );\n\t\t$popular_importers = json_decode( wp_remote_retrieve_body( $response ), true );\n\n\t\tif ( is_array( $popular_importers ) ) {\n\t\t\tset_site_transient( $cache_key, $popular_importers, 2 * DAY_IN_SECONDS );\n\t\t} else {\n\t\t\t$popular_importers = false;\n\t\t}\n\t}\n\n\tif ( is_array( $popular_importers ) ) {\n\t\t// If the data was received as translated, return it as-is.\n\t\tif ( $popular_importers['translated'] ) {\n\t\t\treturn $popular_importers['importers'];\n\t\t}\n\n\t\tforeach ( $popular_importers['importers'] as &$importer ) {\n\t\t\t// phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText\n\t\t\t$importer['description'] = translate( $importer['description'] );\n\t\t\tif ( 'WordPress' !== $importer['name'] ) {\n\t\t\t\t// phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText\n\t\t\t\t$importer['name'] = translate( $importer['name'] );\n\t\t\t}\n\t\t}\n\t\treturn $popular_importers['importers'];\n\t}\n\n\treturn array(\n\t\t// slug => name, description, plugin slug, and register_importer() slug.\n\t\t'blogger'     => array(\n\t\t\t'name'        => __( 'Blogger' ),\n\t\t\t'description' => __( 'Import posts, comments, and users from a Blogger blog.' ),\n\t\t\t'plugin-slug' => 'blogger-importer',\n\t\t\t'importer-id' => 'blogger',\n\t\t),\n\t\t'wpcat2tag'   => array(\n\t\t\t'name'        => __( 'Categories and Tags Converter' ),\n\t\t\t'description' => __( 'Convert existing categories to tags or tags to categories, selectively.' ),\n\t\t\t'plugin-slug' => 'wpcat2tag-importer',\n\t\t\t'importer-id' => 'wp-cat2tag',\n\t\t),\n\t\t'livejournal' => array(\n\t\t\t'name'        => __( 'LiveJournal' ),\n\t\t\t'description' => __( 'Import posts from LiveJournal using their API.' ),\n\t\t\t'plugin-slug' => 'livejournal-importer',\n\t\t\t'importer-id' => 'livejournal',\n\t\t),\n\t\t'movabletype' => array(\n\t\t\t'name'        => __( 'Movable Type and TypePad' ),\n\t\t\t'description' => __( 'Import posts and comments from a Movable Type or TypePad blog.' ),\n\t\t\t'plugin-slug' => 'movabletype-importer',\n\t\t\t'importer-id' => 'mt',\n\t\t),\n\t\t'rss'         => array(\n\t\t\t'name'        => __( 'RSS' ),\n\t\t\t'description' => __( 'Import posts from an RSS feed.' ),\n\t\t\t'plugin-slug' => 'rss-importer',\n\t\t\t'importer-id' => 'rss',\n\t\t),\n\t\t'tumblr'      => array(\n\t\t\t'name'        => __( 'Tumblr' ),\n\t\t\t'description' => __( 'Import posts &amp; media from Tumblr using their API.' ),\n\t\t\t'plugin-slug' => 'tumblr-importer',\n\t\t\t'importer-id' => 'tumblr',\n\t\t),\n\t\t'wordpress'   => array(\n\t\t\t'name'        => 'WordPress',\n\t\t\t'description' => __( 'Import posts, pages, comments, custom fields, categories, and tags from a WordPress export file.' ),\n\t\t\t'plugin-slug' => 'wordpress-importer',\n\t\t\t'importer-id' => 'wordpress',\n\t\t),\n\t);\n}\n", "num_lines": 233}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Helper functions for displaying a list of items in an ajaxified HTML table.\n *\n * @package WordPress\n * @subpackage List_Table\n * @since 3.1.0\n */\n\n/**\n * Fetches an instance of a WP_List_Table class.\n *\n * @access private\n * @since 3.1.0\n *\n * @global string $hook_suffix\n *\n * @param string $class The type of the list table, which is the class name.\n * @param array  $args  Optional. Arguments to pass to the class. Accepts 'screen'.\n * @return WP_List_Table|bool List table object on success, false if the class does not exist.\n */\nfunction _get_list_table( $class, $args = array() ) {\n\t$core_classes = array(\n\t\t// Site Admin.\n\t\t'WP_Posts_List_Table'                         => 'posts',\n\t\t'WP_Media_List_Table'                         => 'media',\n\t\t'WP_Terms_List_Table'                         => 'terms',\n\t\t'WP_Users_List_Table'                         => 'users',\n\t\t'WP_Comments_List_Table'                      => 'comments',\n\t\t'WP_Post_Comments_List_Table'                 => array( 'comments', 'post-comments' ),\n\t\t'WP_Links_List_Table'                         => 'links',\n\t\t'WP_Plugin_Install_List_Table'                => 'plugin-install',\n\t\t'WP_Themes_List_Table'                        => 'themes',\n\t\t'WP_Theme_Install_List_Table'                 => array( 'themes', 'theme-install' ),\n\t\t'WP_Plugins_List_Table'                       => 'plugins',\n\n\t\t// Network Admin.\n\t\t'WP_MS_Sites_List_Table'                      => 'ms-sites',\n\t\t'WP_MS_Users_List_Table'                      => 'ms-users',\n\t\t'WP_MS_Themes_List_Table'                     => 'ms-themes',\n\n\t\t// Privacy requests tables.\n\t\t'WP_Privacy_Data_Export_Requests_List_Table'  => 'privacy-data-export-requests',\n\t\t'WP_Privacy_Data_Removal_Requests_List_Table' => 'privacy-data-removal-requests',\n\t);\n\n\tif ( isset( $core_classes[ $class ] ) ) {\n\t\tforeach ( (array) $core_classes[ $class ] as $required ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-' . $required . '-list-table.php';\n\t\t}\n\n\t\tif ( isset( $args['screen'] ) ) {\n\t\t\t$args['screen'] = convert_to_screen( $args['screen'] );\n\t\t} elseif ( isset( $GLOBALS['hook_suffix'] ) ) {\n\t\t\t$args['screen'] = get_current_screen();\n\t\t} else {\n\t\t\t$args['screen'] = null;\n\t\t}\n\n\t\treturn new $class( $args );\n\t}\n\n\treturn false;\n}\n\n/**\n * Register column headers for a particular screen.\n *\n * @see get_column_headers(), print_column_headers(), get_hidden_columns()\n *\n * @since 2.7.0\n *\n * @param string   $screen  The handle for the screen to add help to. This is usually the hook name returned by the\n *                          add_*_page() functions.\n * @param string[] $columns An array of columns with column IDs as the keys and translated column names as the values.\n */\nfunction register_column_headers( $screen, $columns ) {\n\tnew _WP_List_Table_Compat( $screen, $columns );\n}\n\n/**\n * Prints column headers for a particular screen.\n *\n * @since 2.7.0\n *\n * @param string|WP_Screen $screen  The screen hook name or screen object.\n * @param bool             $with_id Whether to set the ID attribute or not.\n */\nfunction print_column_headers( $screen, $with_id = true ) {\n\t$wp_list_table = new _WP_List_Table_Compat( $screen );\n\n\t$wp_list_table->print_column_headers( $with_id );\n}\n", "num_lines": 94}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Administration Media API.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Defines the default media upload tabs\n *\n * @since 2.5.0\n *\n * @return string[] Default tabs.\n */\nfunction media_upload_tabs() {\n\t$_default_tabs = array(\n\t\t'type'     => __( 'From Computer' ), // Handler action suffix => tab text.\n\t\t'type_url' => __( 'From URL' ),\n\t\t'gallery'  => __( 'Gallery' ),\n\t\t'library'  => __( 'Media Library' ),\n\t);\n\n\t/**\n\t * Filters the available tabs in the legacy (pre-3.5.0) media popup.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string[] $_default_tabs An array of media tabs.\n\t */\n\treturn apply_filters( 'media_upload_tabs', $_default_tabs );\n}\n\n/**\n * Adds the gallery tab back to the tabs array if post has image attachments\n *\n * @since 2.5.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param array $tabs\n * @return array $tabs with gallery if post has image attachment\n */\nfunction update_gallery_tab( $tabs ) {\n\tglobal $wpdb;\n\n\tif ( ! isset( $_REQUEST['post_id'] ) ) {\n\t\tunset( $tabs['gallery'] );\n\t\treturn $tabs;\n\t}\n\n\t$post_id = intval( $_REQUEST['post_id'] );\n\n\tif ( $post_id ) {\n\t\t$attachments = intval( $wpdb->get_var( $wpdb->prepare( \"SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent = %d\", $post_id ) ) );\n\t}\n\n\tif ( empty( $attachments ) ) {\n\t\tunset( $tabs['gallery'] );\n\t\treturn $tabs;\n\t}\n\n\t/* translators: %s: Number of attachments. */\n\t$tabs['gallery'] = sprintf( __( 'Gallery (%s)' ), \"<span id='attachments-count'>$attachments</span>\" );\n\n\treturn $tabs;\n}\n\n/**\n * Outputs the legacy media upload tabs UI.\n *\n * @since 2.5.0\n *\n * @global string $redir_tab\n */\nfunction the_media_upload_tabs() {\n\tglobal $redir_tab;\n\t$tabs    = media_upload_tabs();\n\t$default = 'type';\n\n\tif ( ! empty( $tabs ) ) {\n\t\techo \"<ul id='sidemenu'>\\n\";\n\n\t\tif ( isset( $redir_tab ) && array_key_exists( $redir_tab, $tabs ) ) {\n\t\t\t$current = $redir_tab;\n\t\t} elseif ( isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $tabs ) ) {\n\t\t\t$current = $_GET['tab'];\n\t\t} else {\n\t\t\t/** This filter is documented in wp-admin/media-upload.php */\n\t\t\t$current = apply_filters( 'media_upload_default_tab', $default );\n\t\t}\n\n\t\tforeach ( $tabs as $callback => $text ) {\n\t\t\t$class = '';\n\n\t\t\tif ( $current == $callback ) {\n\t\t\t\t$class = \" class='current'\";\n\t\t\t}\n\n\t\t\t$href = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'tab'            => $callback,\n\t\t\t\t\t's'              => false,\n\t\t\t\t\t'paged'          => false,\n\t\t\t\t\t'post_mime_type' => false,\n\t\t\t\t\t'm'              => false,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$link = \"<a href='\" . esc_url( $href ) . \"'$class>$text</a>\";\n\t\t\techo \"\\t<li id='\" . esc_attr( \"tab-$callback\" ) . \"'>$link</li>\\n\";\n\t\t}\n\n\t\techo \"</ul>\\n\";\n\t}\n}\n\n/**\n * Retrieves the image HTML to send to the editor.\n *\n * @since 2.5.0\n *\n * @param int          $id      Image attachment ID.\n * @param string       $caption Image caption.\n * @param string       $title   Image title attribute.\n * @param string       $align   Image CSS alignment property.\n * @param string       $url     Optional. Image src URL. Default empty.\n * @param bool|string  $rel     Optional. Value for rel attribute or whether to add a default value. Default false.\n * @param string|array $size    Optional. Image size. Accepts any valid image size, or an array of width\n *                              and height values in pixels (in that order). Default 'medium'.\n * @param string       $alt     Optional. Image alt attribute. Default empty.\n * @return string The HTML output to insert into the editor.\n */\nfunction get_image_send_to_editor( $id, $caption, $title, $align, $url = '', $rel = false, $size = 'medium', $alt = '' ) {\n\n\t$html = get_image_tag( $id, $alt, '', $align, $size );\n\n\tif ( $rel ) {\n\t\tif ( is_string( $rel ) ) {\n\t\t\t$rel = ' rel=\"' . esc_attr( $rel ) . '\"';\n\t\t} else {\n\t\t\t$rel = ' rel=\"attachment wp-att-' . intval( $id ) . '\"';\n\t\t}\n\t} else {\n\t\t$rel = '';\n\t}\n\n\tif ( $url ) {\n\t\t$html = '<a href=\"' . esc_attr( $url ) . '\"' . $rel . '>' . $html . '</a>';\n\t}\n\n\t/**\n\t * Filters the image HTML markup to send to the editor when inserting an image.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string       $html    The image HTML markup to send.\n\t * @param int          $id      The attachment ID.\n\t * @param string       $caption The image caption.\n\t * @param string       $title   The image title.\n\t * @param string       $align   The image alignment.\n\t * @param string       $url     The image source URL.\n\t * @param string|array $size    Size of image. Image size or array of width and height values\n\t *                              (in that order). Default 'medium'.\n\t * @param string       $alt     The image alternative, or alt, text.\n\t */\n\t$html = apply_filters( 'image_send_to_editor', $html, $id, $caption, $title, $align, $url, $size, $alt );\n\n\treturn $html;\n}\n\n/**\n * Adds image shortcode with caption to editor.\n *\n * @since 2.6.0\n *\n * @param string  $html    The image HTML markup to send.\n * @param integer $id      Image attachment ID.\n * @param string  $caption Image caption.\n * @param string  $title   Image title attribute (not used).\n * @param string  $align   Image CSS alignment property.\n * @param string  $url     Image source URL (not used).\n * @param string  $size    Image size (`thumbnail`, `medium`, `large`, `full`, or added with `add_image_size()`) (not used).\n * @param string  $alt     Image `alt` attribute (not used).\n * @return string The image HTML markup with caption shortcode.\n */\nfunction image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $alt = '' ) {\n\n\t/**\n\t * Filters the caption text.\n\t *\n\t * Note: If the caption text is empty, the caption shortcode will not be appended\n\t * to the image HTML when inserted into the editor.\n\t *\n\t * Passing an empty value also prevents the {@see 'image_add_caption_shortcode'}\n\t * Filters from being evaluated at the end of image_add_caption().\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param string $caption The original caption text.\n\t * @param int    $id      The attachment ID.\n\t */\n\t$caption = apply_filters( 'image_add_caption_text', $caption, $id );\n\n\t/**\n\t * Filters whether to disable captions.\n\t *\n\t * Prevents image captions from being appended to image HTML when inserted into the editor.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param bool $bool Whether to disable appending captions. Returning true from the filter\n\t *                   will disable captions. Default empty string.\n\t */\n\tif ( empty( $caption ) || apply_filters( 'disable_captions', '' ) ) {\n\t\treturn $html;\n\t}\n\n\t$id = ( 0 < (int) $id ) ? 'attachment_' . $id : '';\n\n\tif ( ! preg_match( '/width=[\"\\']([0-9]+)/', $html, $matches ) ) {\n\t\treturn $html;\n\t}\n\n\t$width = $matches[1];\n\n\t$caption = str_replace( array( \"\\r\\n\", \"\\r\" ), \"\\n\", $caption );\n\t$caption = preg_replace_callback( '/<[a-zA-Z0-9]+(?: [^<>]+>)*/', '_cleanup_image_add_caption', $caption );\n\n\t// Convert any remaining line breaks to <br />.\n\t$caption = preg_replace( '/[ \\n\\t]*\\n[ \\t]*/', '<br />', $caption );\n\n\t$html = preg_replace( '/(class=[\"\\'][^\\'\"]*)align(none|left|right|center)\\s?/', '$1', $html );\n\tif ( empty( $align ) ) {\n\t\t$align = 'none';\n\t}\n\n\t$shcode = '[caption id=\"' . $id . '\" align=\"align' . $align . '\" width=\"' . $width . '\"]' . $html . ' ' . $caption . '[/caption]';\n\n\t/**\n\t * Filters the image HTML markup including the caption shortcode.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param string $shcode The image HTML markup with caption shortcode.\n\t * @param string $html   The image HTML markup.\n\t */\n\treturn apply_filters( 'image_add_caption_shortcode', $shcode, $html );\n}\n\n/**\n * Private preg_replace callback used in image_add_caption().\n *\n * @access private\n * @since 3.4.0\n */\nfunction _cleanup_image_add_caption( $matches ) {\n\t// Remove any line breaks from inside the tags.\n\treturn preg_replace( '/[\\r\\n\\t]+/', ' ', $matches[0] );\n}\n\n/**\n * Adds image HTML to editor.\n *\n * @since 2.5.0\n *\n * @param string $html\n */\nfunction media_send_to_editor( $html ) {\n\t?>\n\t<script type=\"text/javascript\">\n\tvar win = window.dialogArguments || opener || parent || top;\n\twin.send_to_editor( <?php echo wp_json_encode( $html ); ?> );\n\t</script>\n\t<?php\n\texit;\n}\n\n/**\n * Saves a file submitted from a POST request and create an attachment post for it.\n *\n * @since 2.5.0\n *\n * @param string $file_id   Index of the `$_FILES` array that the file was sent. Required.\n * @param int    $post_id   The post ID of a post to attach the media item to. Required, but can\n *                          be set to 0, creating a media item that has no relationship to a post.\n * @param array  $post_data Optional. Overwrite some of the attachment.\n * @param array  $overrides Optional. Override the wp_handle_upload() behavior.\n * @return int|WP_Error ID of the attachment or a WP_Error object on failure.\n */\nfunction media_handle_upload( $file_id, $post_id, $post_data = array(), $overrides = array( 'test_form' => false ) ) {\n\t$time = current_time( 'mysql' );\n\t$post = get_post( $post_id );\n\n\tif ( $post ) {\n\t\t// The post date doesn't usually matter for pages, so don't backdate this upload.\n\t\tif ( 'page' !== $post->post_type && substr( $post->post_date, 0, 4 ) > 0 ) {\n\t\t\t$time = $post->post_date;\n\t\t}\n\t}\n\n\t$file = wp_handle_upload( $_FILES[ $file_id ], $overrides, $time );\n\n\tif ( isset( $file['error'] ) ) {\n\t\treturn new WP_Error( 'upload_error', $file['error'] );\n\t}\n\n\t$name = $_FILES[ $file_id ]['name'];\n\t$ext  = pathinfo( $name, PATHINFO_EXTENSION );\n\t$name = wp_basename( $name, \".$ext\" );\n\n\t$url     = $file['url'];\n\t$type    = $file['type'];\n\t$file    = $file['file'];\n\t$title   = sanitize_text_field( $name );\n\t$content = '';\n\t$excerpt = '';\n\n\tif ( preg_match( '#^audio#', $type ) ) {\n\t\t$meta = wp_read_audio_metadata( $file );\n\n\t\tif ( ! empty( $meta['title'] ) ) {\n\t\t\t$title = $meta['title'];\n\t\t}\n\n\t\tif ( ! empty( $title ) ) {\n\n\t\t\tif ( ! empty( $meta['album'] ) && ! empty( $meta['artist'] ) ) {\n\t\t\t\t/* translators: 1: Audio track title, 2: Album title, 3: Artist name. */\n\t\t\t\t$content .= sprintf( __( '\"%1$s\" from %2$s by %3$s.' ), $title, $meta['album'], $meta['artist'] );\n\t\t\t} elseif ( ! empty( $meta['album'] ) ) {\n\t\t\t\t/* translators: 1: Audio track title, 2: Album title. */\n\t\t\t\t$content .= sprintf( __( '\"%1$s\" from %2$s.' ), $title, $meta['album'] );\n\t\t\t} elseif ( ! empty( $meta['artist'] ) ) {\n\t\t\t\t/* translators: 1: Audio track title, 2: Artist name. */\n\t\t\t\t$content .= sprintf( __( '\"%1$s\" by %2$s.' ), $title, $meta['artist'] );\n\t\t\t} else {\n\t\t\t\t/* translators: %s: Audio track title. */\n\t\t\t\t$content .= sprintf( __( '\"%s\".' ), $title );\n\t\t\t}\n\t\t} elseif ( ! empty( $meta['album'] ) ) {\n\n\t\t\tif ( ! empty( $meta['artist'] ) ) {\n\t\t\t\t/* translators: 1: Audio album title, 2: Artist name. */\n\t\t\t\t$content .= sprintf( __( '%1$s by %2$s.' ), $meta['album'], $meta['artist'] );\n\t\t\t} else {\n\t\t\t\t$content .= $meta['album'] . '.';\n\t\t\t}\n\t\t} elseif ( ! empty( $meta['artist'] ) ) {\n\n\t\t\t$content .= $meta['artist'] . '.';\n\n\t\t}\n\n\t\tif ( ! empty( $meta['year'] ) ) {\n\t\t\t/* translators: Audio file track information. %d: Year of audio track release. */\n\t\t\t$content .= ' ' . sprintf( __( 'Released: %d.' ), $meta['year'] );\n\t\t}\n\n\t\tif ( ! empty( $meta['track_number'] ) ) {\n\t\t\t$track_number = explode( '/', $meta['track_number'] );\n\n\t\t\tif ( isset( $track_number[1] ) ) {\n\t\t\t\t/* translators: Audio file track information. 1: Audio track number, 2: Total audio tracks. */\n\t\t\t\t$content .= ' ' . sprintf( __( 'Track %1$s of %2$s.' ), number_format_i18n( $track_number[0] ), number_format_i18n( $track_number[1] ) );\n\t\t\t} else {\n\t\t\t\t/* translators: Audio file track information. %s: Audio track number. */\n\t\t\t\t$content .= ' ' . sprintf( __( 'Track %s.' ), number_format_i18n( $track_number[0] ) );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $meta['genre'] ) ) {\n\t\t\t/* translators: Audio file genre information. %s: Audio genre name. */\n\t\t\t$content .= ' ' . sprintf( __( 'Genre: %s.' ), $meta['genre'] );\n\t\t}\n\n\t\t// Use image exif/iptc data for title and caption defaults if possible.\n\t} elseif ( 0 === strpos( $type, 'image/' ) ) {\n\t\t$image_meta = wp_read_image_metadata( $file );\n\n\t\tif ( $image_meta ) {\n\t\t\tif ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {\n\t\t\t\t$title = $image_meta['title'];\n\t\t\t}\n\n\t\t\tif ( trim( $image_meta['caption'] ) ) {\n\t\t\t\t$excerpt = $image_meta['caption'];\n\t\t\t}\n\t\t}\n\t}\n\n\t// Construct the attachment array.\n\t$attachment = array_merge(\n\t\tarray(\n\t\t\t'post_mime_type' => $type,\n\t\t\t'guid'           => $url,\n\t\t\t'post_parent'    => $post_id,\n\t\t\t'post_title'     => $title,\n\t\t\t'post_content'   => $content,\n\t\t\t'post_excerpt'   => $excerpt,\n\t\t),\n\t\t$post_data\n\t);\n\n\t// This should never be set as it would then overwrite an existing attachment.\n\tunset( $attachment['ID'] );\n\n\t// Save the data.\n\t$attachment_id = wp_insert_attachment( $attachment, $file, $post_id, true );\n\n\tif ( ! is_wp_error( $attachment_id ) ) {\n\t\t// Set a custom header with the attachment_id.\n\t\t// Used by the browser/client to resume creating image sub-sizes after a PHP fatal error.\n\t\tif ( ! headers_sent() ) {\n\t\t\theader( 'X-WP-Upload-Attachment-ID: ' . $attachment_id );\n\t\t}\n\n\t\t// The image sub-sizes are created during wp_generate_attachment_metadata().\n\t\t// This is generally slow and may cause timeouts or out of memory errors.\n\t\twp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) );\n\t}\n\n\treturn $attachment_id;\n}\n\n/**\n * Handles a side-loaded file in the same way as an uploaded file is handled by media_handle_upload().\n *\n * @since 2.6.0\n * @since 5.3.0 The `$post_id` parameter was made optional.\n *\n * @param array  $file_array Array similar to a `$_FILES` upload array.\n * @param int    $post_id    Optional. The post ID the media is associated with.\n * @param string $desc       Optional. Description of the side-loaded file. Default null.\n * @param array  $post_data  Optional. Post data to override. Default empty array.\n * @return int|WP_Error The ID of the attachment or a WP_Error on failure.\n */\nfunction media_handle_sideload( $file_array, $post_id = 0, $desc = null, $post_data = array() ) {\n\t$overrides = array( 'test_form' => false );\n\n\t$time = current_time( 'mysql' );\n\t$post = get_post( $post_id );\n\n\tif ( $post ) {\n\t\tif ( substr( $post->post_date, 0, 4 ) > 0 ) {\n\t\t\t$time = $post->post_date;\n\t\t}\n\t}\n\n\t$file = wp_handle_sideload( $file_array, $overrides, $time );\n\n\tif ( isset( $file['error'] ) ) {\n\t\treturn new WP_Error( 'upload_error', $file['error'] );\n\t}\n\n\t$url     = $file['url'];\n\t$type    = $file['type'];\n\t$file    = $file['file'];\n\t$title   = preg_replace( '/\\.[^.]+$/', '', wp_basename( $file ) );\n\t$content = '';\n\n\t// Use image exif/iptc data for title and caption defaults if possible.\n\t$image_meta = wp_read_image_metadata( $file );\n\n\tif ( $image_meta ) {\n\t\tif ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {\n\t\t\t$title = $image_meta['title'];\n\t\t}\n\n\t\tif ( trim( $image_meta['caption'] ) ) {\n\t\t\t$content = $image_meta['caption'];\n\t\t}\n\t}\n\n\tif ( isset( $desc ) ) {\n\t\t$title = $desc;\n\t}\n\n\t// Construct the attachment array.\n\t$attachment = array_merge(\n\t\tarray(\n\t\t\t'post_mime_type' => $type,\n\t\t\t'guid'           => $url,\n\t\t\t'post_parent'    => $post_id,\n\t\t\t'post_title'     => $title,\n\t\t\t'post_content'   => $content,\n\t\t),\n\t\t$post_data\n\t);\n\n\t// This should never be set as it would then overwrite an existing attachment.\n\tunset( $attachment['ID'] );\n\n\t// Save the attachment metadata.\n\t$attachment_id = wp_insert_attachment( $attachment, $file, $post_id, true );\n\n\tif ( ! is_wp_error( $attachment_id ) ) {\n\t\twp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) );\n\t}\n\n\treturn $attachment_id;\n}\n\n/**\n * Outputs the iframe to display the media upload page.\n *\n * @since 2.5.0\n * @since 5.3.0 Formalized the existing and already documented `...$args` parameter\n *              by adding it to the function signature.\n *\n * @global int $body_id\n *\n * @param callable $content_func Function that outputs the content.\n * @param mixed    ...$args      Optional additional parameters to pass to the callback function when it's called.\n */\nfunction wp_iframe( $content_func, ...$args ) {\n\t_wp_admin_html_begin();\n\t?>\n\t<title><?php bloginfo( 'name' ); ?> &rsaquo; <?php _e( 'Uploads' ); ?> &#8212; <?php _e( 'WordPress' ); ?></title>\n\t<?php\n\n\twp_enqueue_style( 'colors' );\n\t// Check callback name for 'media'.\n\tif (\n\t\t( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( (string) $content_func[1], 'media' ) ) ||\n\t\t( ! is_array( $content_func ) && 0 === strpos( $content_func, 'media' ) )\n\t) {\n\t\twp_enqueue_style( 'deprecated-media' );\n\t}\n\n\t?>\n\t<script type=\"text/javascript\">\n\taddLoadEvent = function(func){if(typeof jQuery!=\"undefined\")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};\n\tvar ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',\n\tisRtl = <?php echo (int) is_rtl(); ?>;\n\t</script>\n\t<?php\n\t/** This action is documented in wp-admin/admin-header.php */\n\tdo_action( 'admin_enqueue_scripts', 'media-upload-popup' );\n\n\t/**\n\t * Fires when admin styles enqueued for the legacy (pre-3.5.0) media upload popup are printed.\n\t *\n\t * @since 2.9.0\n\t */\n\tdo_action( 'admin_print_styles-media-upload-popup' );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t/** This action is documented in wp-admin/admin-header.php */\n\tdo_action( 'admin_print_styles' );\n\n\t/**\n\t * Fires when admin scripts enqueued for the legacy (pre-3.5.0) media upload popup are printed.\n\t *\n\t * @since 2.9.0\n\t */\n\tdo_action( 'admin_print_scripts-media-upload-popup' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t/** This action is documented in wp-admin/admin-header.php */\n\tdo_action( 'admin_print_scripts' );\n\n\t/**\n\t * Fires when scripts enqueued for the admin header for the legacy (pre-3.5.0)\n\t * media upload popup are printed.\n\t *\n\t * @since 2.9.0\n\t */\n\tdo_action( 'admin_head-media-upload-popup' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t/** This action is documented in wp-admin/admin-header.php */\n\tdo_action( 'admin_head' );\n\n\tif ( is_string( $content_func ) ) {\n\t\t/**\n\t\t * Fires in the admin header for each specific form tab in the legacy\n\t\t * (pre-3.5.0) media upload popup.\n\t\t *\n\t\t * The dynamic portion of the hook, `$content_func`, refers to the form\n\t\t * callback for the media upload type. Possible values include\n\t\t * 'media_upload_type_form', 'media_upload_type_url_form', and\n\t\t * 'media_upload_library_form'.\n\t\t *\n\t\t * @since 2.5.0\n\t\t */\n\t\tdo_action( \"admin_head_{$content_func}\" );\n\t}\n\n\t$body_id_attr = '';\n\n\tif ( isset( $GLOBALS['body_id'] ) ) {\n\t\t$body_id_attr = ' id=\"' . $GLOBALS['body_id'] . '\"';\n\t}\n\n\t?>\n\t</head>\n\t<body<?php echo $body_id_attr; ?> class=\"wp-core-ui no-js\">\n\t<script type=\"text/javascript\">\n\tdocument.body.className = document.body.className.replace('no-js', 'js');\n\t</script>\n\t<?php\n\n\tcall_user_func_array( $content_func, $args );\n\n\t/** This action is documented in wp-admin/admin-footer.php */\n\tdo_action( 'admin_print_footer_scripts' );\n\n\t?>\n\t<script type=\"text/javascript\">if(typeof wpOnload=='function')wpOnload();</script>\n\t</body>\n\t</html>\n\t<?php\n}\n\n/**\n * Adds the media button to the editor\n *\n * @since 2.5.0\n *\n * @global int $post_ID\n *\n * @param string $editor_id\n */\nfunction media_buttons( $editor_id = 'content' ) {\n\tstatic $instance = 0;\n\t$instance++;\n\n\t$post = get_post();\n\n\tif ( ! $post && ! empty( $GLOBALS['post_ID'] ) ) {\n\t\t$post = $GLOBALS['post_ID'];\n\t}\n\n\twp_enqueue_media( array( 'post' => $post ) );\n\n\t$img = '<span class=\"wp-media-buttons-icon\"></span> ';\n\n\t$id_attribute = 1 === $instance ? ' id=\"insert-media-button\"' : '';\n\n\tprintf(\n\t\t'<button type=\"button\"%s class=\"button insert-media add_media\" data-editor=\"%s\">%s</button>',\n\t\t$id_attribute,\n\t\tesc_attr( $editor_id ),\n\t\t$img . __( 'Add Media' )\n\t);\n\n\t/**\n\t * Filters the legacy (pre-3.5.0) media buttons.\n\t *\n\t * Use {@see 'media_buttons'} action instead.\n\t *\n\t * @since 2.5.0\n\t * @deprecated 3.5.0 Use {@see 'media_buttons'} action instead.\n\t *\n\t * @param string $string Media buttons context. Default empty.\n\t */\n\t$legacy_filter = apply_filters_deprecated( 'media_buttons_context', array( '' ), '3.5.0', 'media_buttons' );\n\n\tif ( $legacy_filter ) {\n\t\t// #WP22559. Close <a> if a plugin started by closing <a> to open their own <a> tag.\n\t\tif ( 0 === stripos( trim( $legacy_filter ), '</a>' ) ) {\n\t\t\t$legacy_filter .= '</a>';\n\t\t}\n\t\techo $legacy_filter;\n\t}\n}\n\n/**\n * @global int $post_ID\n * @param string $type\n * @param int    $post_id\n * @param string $tab\n * @return string\n */\nfunction get_upload_iframe_src( $type = null, $post_id = null, $tab = null ) {\n\tglobal $post_ID;\n\n\tif ( empty( $post_id ) ) {\n\t\t$post_id = $post_ID;\n\t}\n\n\t$upload_iframe_src = add_query_arg( 'post_id', (int) $post_id, admin_url( 'media-upload.php' ) );\n\n\tif ( $type && 'media' !== $type ) {\n\t\t$upload_iframe_src = add_query_arg( 'type', $type, $upload_iframe_src );\n\t}\n\n\tif ( ! empty( $tab ) ) {\n\t\t$upload_iframe_src = add_query_arg( 'tab', $tab, $upload_iframe_src );\n\t}\n\n\t/**\n\t * Filters the upload iframe source URL for a specific media type.\n\t *\n\t * The dynamic portion of the hook name, `$type`, refers to the type\n\t * of media uploaded.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $upload_iframe_src The upload iframe source URL by type.\n\t */\n\t$upload_iframe_src = apply_filters( \"{$type}_upload_iframe_src\", $upload_iframe_src );\n\n\treturn add_query_arg( 'TB_iframe', true, $upload_iframe_src );\n}\n\n/**\n * Handles form submissions for the legacy media uploader.\n *\n * @since 2.5.0\n *\n * @return mixed void|object WP_Error on failure\n */\nfunction media_upload_form_handler() {\n\tcheck_admin_referer( 'media-form' );\n\n\t$errors = null;\n\n\tif ( isset( $_POST['send'] ) ) {\n\t\t$keys    = array_keys( $_POST['send'] );\n\t\t$send_id = (int) reset( $keys );\n\t}\n\n\tif ( ! empty( $_POST['attachments'] ) ) {\n\t\tforeach ( $_POST['attachments'] as $attachment_id => $attachment ) {\n\t\t\t$post  = get_post( $attachment_id, ARRAY_A );\n\t\t\t$_post = $post;\n\n\t\t\tif ( ! current_user_can( 'edit_post', $attachment_id ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( isset( $attachment['post_content'] ) ) {\n\t\t\t\t$post['post_content'] = $attachment['post_content'];\n\t\t\t}\n\n\t\t\tif ( isset( $attachment['post_title'] ) ) {\n\t\t\t\t$post['post_title'] = $attachment['post_title'];\n\t\t\t}\n\n\t\t\tif ( isset( $attachment['post_excerpt'] ) ) {\n\t\t\t\t$post['post_excerpt'] = $attachment['post_excerpt'];\n\t\t\t}\n\n\t\t\tif ( isset( $attachment['menu_order'] ) ) {\n\t\t\t\t$post['menu_order'] = $attachment['menu_order'];\n\t\t\t}\n\n\t\t\tif ( isset( $send_id ) && $attachment_id == $send_id ) {\n\t\t\t\tif ( isset( $attachment['post_parent'] ) ) {\n\t\t\t\t\t$post['post_parent'] = $attachment['post_parent'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the attachment fields to be saved.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t *\n\t\t\t * @see wp_get_attachment_metadata()\n\t\t\t *\n\t\t\t * @param array $post       An array of post data.\n\t\t\t * @param array $attachment An array of attachment metadata.\n\t\t\t */\n\t\t\t$post = apply_filters( 'attachment_fields_to_save', $post, $attachment );\n\n\t\t\tif ( isset( $attachment['image_alt'] ) ) {\n\t\t\t\t$image_alt = wp_unslash( $attachment['image_alt'] );\n\n\t\t\t\tif ( get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) !== $image_alt ) {\n\t\t\t\t\t$image_alt = wp_strip_all_tags( $image_alt, true );\n\n\t\t\t\t\t// update_post_meta() expects slashed.\n\t\t\t\t\tupdate_post_meta( $attachment_id, '_wp_attachment_image_alt', wp_slash( $image_alt ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( isset( $post['errors'] ) ) {\n\t\t\t\t$errors[ $attachment_id ] = $post['errors'];\n\t\t\t\tunset( $post['errors'] );\n\t\t\t}\n\n\t\t\tif ( $post != $_post ) {\n\t\t\t\twp_update_post( $post );\n\t\t\t}\n\n\t\t\tforeach ( get_attachment_taxonomies( $post ) as $t ) {\n\t\t\t\tif ( isset( $attachment[ $t ] ) ) {\n\t\t\t\t\twp_set_object_terms( $attachment_id, array_map( 'trim', preg_split( '/,+/', $attachment[ $t ] ) ), $t, false );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( isset( $_POST['insert-gallery'] ) || isset( $_POST['update-gallery'] ) ) {\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\tvar win = window.dialogArguments || opener || parent || top;\n\t\twin.tb_remove();\n\t\t</script>\n\t\t<?php\n\n\t\texit;\n\t}\n\n\tif ( isset( $send_id ) ) {\n\t\t$attachment = wp_unslash( $_POST['attachments'][ $send_id ] );\n\t\t$html       = isset( $attachment['post_title'] ) ? $attachment['post_title'] : '';\n\n\t\tif ( ! empty( $attachment['url'] ) ) {\n\t\t\t$rel = '';\n\n\t\t\tif ( strpos( $attachment['url'], 'attachment_id' ) || get_attachment_link( $send_id ) == $attachment['url'] ) {\n\t\t\t\t$rel = \" rel='attachment wp-att-\" . esc_attr( $send_id ) . \"'\";\n\t\t\t}\n\n\t\t\t$html = \"<a href='{$attachment['url']}'$rel>$html</a>\";\n\t\t}\n\n\t\t/**\n\t\t * Filters the HTML markup for a media item sent to the editor.\n\t\t *\n\t\t * @since 2.5.0\n\t\t *\n\t\t * @see wp_get_attachment_metadata()\n\t\t *\n\t\t * @param string $html       HTML markup for a media item sent to the editor.\n\t\t * @param int    $send_id    The first key from the $_POST['send'] data.\n\t\t * @param array  $attachment Array of attachment metadata.\n\t\t */\n\t\t$html = apply_filters( 'media_send_to_editor', $html, $send_id, $attachment );\n\n\t\treturn media_send_to_editor( $html );\n\t}\n\n\treturn $errors;\n}\n\n/**\n * Handles the process of uploading media.\n *\n * @since 2.5.0\n *\n * @return null|string\n */\nfunction wp_media_upload_handler() {\n\t$errors = array();\n\t$id     = 0;\n\n\tif ( isset( $_POST['html-upload'] ) && ! empty( $_FILES ) ) {\n\t\tcheck_admin_referer( 'media-form' );\n\t\t// Upload File button was clicked.\n\t\t$id = media_handle_upload( 'async-upload', $_REQUEST['post_id'] );\n\t\tunset( $_FILES );\n\n\t\tif ( is_wp_error( $id ) ) {\n\t\t\t$errors['upload_error'] = $id;\n\t\t\t$id                     = false;\n\t\t}\n\t}\n\n\tif ( ! empty( $_POST['insertonlybutton'] ) ) {\n\t\t$src = $_POST['src'];\n\n\t\tif ( ! empty( $src ) && ! strpos( $src, '://' ) ) {\n\t\t\t$src = \"http://$src\";\n\t\t}\n\n\t\tif ( isset( $_POST['media_type'] ) && 'image' !== $_POST['media_type'] ) {\n\t\t\t$title = esc_html( wp_unslash( $_POST['title'] ) );\n\t\t\tif ( empty( $title ) ) {\n\t\t\t\t$title = esc_html( wp_basename( $src ) );\n\t\t\t}\n\n\t\t\tif ( $title && $src ) {\n\t\t\t\t$html = \"<a href='\" . esc_url( $src ) . \"'>$title</a>\";\n\t\t\t}\n\n\t\t\t$type = 'file';\n\t\t\t$ext  = preg_replace( '/^.+?\\.([^.]+)$/', '$1', $src );\n\n\t\t\tif ( $ext ) {\n\t\t\t\t$ext_type = wp_ext2type( $ext );\n\t\t\t\tif ( 'audio' === $ext_type || 'video' === $ext_type ) {\n\t\t\t\t\t$type = $ext_type;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the URL sent to the editor for a specific media type.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$type`, refers to the type\n\t\t\t * of media being sent.\n\t\t\t *\n\t\t\t * @since 3.3.0\n\t\t\t *\n\t\t\t * @param string $html  HTML markup sent to the editor.\n\t\t\t * @param string $src   Media source URL.\n\t\t\t * @param string $title Media title.\n\t\t\t */\n\t\t\t$html = apply_filters( \"{$type}_send_to_editor_url\", $html, esc_url_raw( $src ), $title );\n\t\t} else {\n\t\t\t$align = '';\n\t\t\t$alt   = esc_attr( wp_unslash( $_POST['alt'] ) );\n\n\t\t\tif ( isset( $_POST['align'] ) ) {\n\t\t\t\t$align = esc_attr( wp_unslash( $_POST['align'] ) );\n\t\t\t\t$class = \" class='align$align'\";\n\t\t\t}\n\n\t\t\tif ( ! empty( $src ) ) {\n\t\t\t\t$html = \"<img src='\" . esc_url( $src ) . \"' alt='$alt'$class />\";\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the image URL sent to the editor.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t *\n\t\t\t * @param string $html  HTML markup sent to the editor for an image.\n\t\t\t * @param string $src   Image source URL.\n\t\t\t * @param string $alt   Image alternate, or alt, text.\n\t\t\t * @param string $align The image alignment. Default 'alignnone'. Possible values include\n\t\t\t *                      'alignleft', 'aligncenter', 'alignright', 'alignnone'.\n\t\t\t */\n\t\t\t$html = apply_filters( 'image_send_to_editor_url', $html, esc_url_raw( $src ), $alt, $align );\n\t\t}\n\n\t\treturn media_send_to_editor( $html );\n\t}\n\n\tif ( isset( $_POST['save'] ) ) {\n\t\t$errors['upload_notice'] = __( 'Saved.' );\n\t\twp_enqueue_script( 'admin-gallery' );\n\n\t\treturn wp_iframe( 'media_upload_gallery_form', $errors );\n\n\t} elseif ( ! empty( $_POST ) ) {\n\t\t$return = media_upload_form_handler();\n\n\t\tif ( is_string( $return ) ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\tif ( is_array( $return ) ) {\n\t\t\t$errors = $return;\n\t\t}\n\t}\n\n\tif ( isset( $_GET['tab'] ) && 'type_url' === $_GET['tab'] ) {\n\t\t$type = 'image';\n\n\t\tif ( isset( $_GET['type'] ) && in_array( $_GET['type'], array( 'video', 'audio', 'file' ), true ) ) {\n\t\t\t$type = $_GET['type'];\n\t\t}\n\n\t\treturn wp_iframe( 'media_upload_type_url_form', $type, $errors, $id );\n\t}\n\n\treturn wp_iframe( 'media_upload_type_form', 'image', $errors, $id );\n}\n\n/**\n * Downloads an image from the specified URL and attaches it to a post.\n *\n * @since 2.6.0\n * @since 4.2.0 Introduced the `$return` parameter.\n * @since 4.8.0 Introduced the 'id' option within the `$return` parameter.\n * @since 5.3.0 The `$post_id` parameter was made optional.\n * @since 5.4.0 The original URL of the attachment is stored in the `_source_url`\n *              post meta value.\n *\n * @param string $file    The URL of the image to download.\n * @param int    $post_id Optional. The post ID the media is to be associated with.\n * @param string $desc    Optional. Description of the image.\n * @param string $return  Optional. Accepts 'html' (image tag html) or 'src' (URL),\n *                        or 'id' (attachment ID). Default 'html'.\n * @return string|WP_Error Populated HTML img tag on success, WP_Error object otherwise.\n */\nfunction media_sideload_image( $file, $post_id = 0, $desc = null, $return = 'html' ) {\n\tif ( ! empty( $file ) ) {\n\n\t\t// Set variables for storage, fix file filename for query strings.\n\t\tpreg_match( '/[^\\?]+\\.(jpe?g|jpe|gif|png)\\b/i', $file, $matches );\n\n\t\tif ( ! $matches ) {\n\t\t\treturn new WP_Error( 'image_sideload_failed', __( 'Invalid image URL.' ) );\n\t\t}\n\n\t\t$file_array         = array();\n\t\t$file_array['name'] = wp_basename( $matches[0] );\n\n\t\t// Download file to temp location.\n\t\t$file_array['tmp_name'] = download_url( $file );\n\n\t\t// If error storing temporarily, return the error.\n\t\tif ( is_wp_error( $file_array['tmp_name'] ) ) {\n\t\t\treturn $file_array['tmp_name'];\n\t\t}\n\n\t\t// Do the validation and storage stuff.\n\t\t$id = media_handle_sideload( $file_array, $post_id, $desc );\n\n\t\t// If error storing permanently, unlink.\n\t\tif ( is_wp_error( $id ) ) {\n\t\t\t@unlink( $file_array['tmp_name'] );\n\t\t\treturn $id;\n\t\t}\n\n\t\t// Store the original attachment source in meta.\n\t\tadd_post_meta( $id, '_source_url', $file );\n\n\t\t// If attachment ID was requested, return it.\n\t\tif ( 'id' === $return ) {\n\t\t\treturn $id;\n\t\t}\n\n\t\t$src = wp_get_attachment_url( $id );\n\t}\n\n\t// Finally, check to make sure the file has been saved, then return the HTML.\n\tif ( ! empty( $src ) ) {\n\t\tif ( 'src' === $return ) {\n\t\t\treturn $src;\n\t\t}\n\n\t\t$alt  = isset( $desc ) ? esc_attr( $desc ) : '';\n\t\t$html = \"<img src='$src' alt='$alt' />\";\n\n\t\treturn $html;\n\t} else {\n\t\treturn new WP_Error( 'image_sideload_failed' );\n\t}\n}\n\n/**\n * Retrieves the legacy media uploader form in an iframe.\n *\n * @since 2.5.0\n *\n * @return string|null\n */\nfunction media_upload_gallery() {\n\t$errors = array();\n\n\tif ( ! empty( $_POST ) ) {\n\t\t$return = media_upload_form_handler();\n\n\t\tif ( is_string( $return ) ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\tif ( is_array( $return ) ) {\n\t\t\t$errors = $return;\n\t\t}\n\t}\n\n\twp_enqueue_script( 'admin-gallery' );\n\treturn wp_iframe( 'media_upload_gallery_form', $errors );\n}\n\n/**\n * Retrieves the legacy media library form in an iframe.\n *\n * @since 2.5.0\n *\n * @return string|null\n */\nfunction media_upload_library() {\n\t$errors = array();\n\n\tif ( ! empty( $_POST ) ) {\n\t\t$return = media_upload_form_handler();\n\n\t\tif ( is_string( $return ) ) {\n\t\t\treturn $return;\n\t\t}\n\t\tif ( is_array( $return ) ) {\n\t\t\t$errors = $return;\n\t\t}\n\t}\n\n\treturn wp_iframe( 'media_upload_library_form', $errors );\n}\n\n/**\n * Retrieve HTML for the image alignment radio buttons with the specified one checked.\n *\n * @since 2.7.0\n *\n * @param WP_Post $post\n * @param string  $checked\n * @return string\n */\nfunction image_align_input_fields( $post, $checked = '' ) {\n\n\tif ( empty( $checked ) ) {\n\t\t$checked = get_user_setting( 'align', 'none' );\n\t}\n\n\t$alignments = array(\n\t\t'none'   => __( 'None' ),\n\t\t'left'   => __( 'Left' ),\n\t\t'center' => __( 'Center' ),\n\t\t'right'  => __( 'Right' ),\n\t);\n\n\tif ( ! array_key_exists( (string) $checked, $alignments ) ) {\n\t\t$checked = 'none';\n\t}\n\n\t$out = array();\n\n\tforeach ( $alignments as $name => $label ) {\n\t\t$name  = esc_attr( $name );\n\t\t$out[] = \"<input type='radio' name='attachments[{$post->ID}][align]' id='image-align-{$name}-{$post->ID}' value='$name'\" .\n\t\t\t( $checked == $name ? \" checked='checked'\" : '' ) .\n\t\t\t\" /><label for='image-align-{$name}-{$post->ID}' class='align image-align-{$name}-label'>$label</label>\";\n\t}\n\n\treturn join( \"\\n\", $out );\n}\n\n/**\n * Retrieve HTML for the size radio buttons with the specified one checked.\n *\n * @since 2.7.0\n *\n * @param WP_Post     $post\n * @param bool|string $check\n * @return array\n */\nfunction image_size_input_fields( $post, $check = '' ) {\n\t/**\n\t * Filters the names and labels of the default image sizes.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string[] $size_names Array of image size labels keyed by their name. Default values\n\t *                             include 'Thumbnail', 'Medium', 'Large', and 'Full Size'.\n\t */\n\t$size_names = apply_filters(\n\t\t'image_size_names_choose',\n\t\tarray(\n\t\t\t'thumbnail' => __( 'Thumbnail' ),\n\t\t\t'medium'    => __( 'Medium' ),\n\t\t\t'large'     => __( 'Large' ),\n\t\t\t'full'      => __( 'Full Size' ),\n\t\t)\n\t);\n\n\tif ( empty( $check ) ) {\n\t\t$check = get_user_setting( 'imgsize', 'medium' );\n\t}\n\n\t$out = array();\n\n\tforeach ( $size_names as $size => $label ) {\n\t\t$downsize = image_downsize( $post->ID, $size );\n\t\t$checked  = '';\n\n\t\t// Is this size selectable?\n\t\t$enabled = ( $downsize[3] || 'full' === $size );\n\t\t$css_id  = \"image-size-{$size}-{$post->ID}\";\n\n\t\t// If this size is the default but that's not available, don't select it.\n\t\tif ( $size == $check ) {\n\t\t\tif ( $enabled ) {\n\t\t\t\t$checked = \" checked='checked'\";\n\t\t\t} else {\n\t\t\t\t$check = '';\n\t\t\t}\n\t\t} elseif ( ! $check && $enabled && 'thumbnail' !== $size ) {\n\t\t\t/*\n\t\t\t * If $check is not enabled, default to the first available size\n\t\t\t * that's bigger than a thumbnail.\n\t\t\t */\n\t\t\t$check   = $size;\n\t\t\t$checked = \" checked='checked'\";\n\t\t}\n\n\t\t$html = \"<div class='image-size-item'><input type='radio' \" . disabled( $enabled, false, false ) . \"name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}'$checked />\";\n\n\t\t$html .= \"<label for='{$css_id}'>$label</label>\";\n\n\t\t// Only show the dimensions if that choice is available.\n\t\tif ( $enabled ) {\n\t\t\t$html .= \" <label for='{$css_id}' class='help'>\" . sprintf( '(%d&nbsp;&times;&nbsp;%d)', $downsize[1], $downsize[2] ) . '</label>';\n\t\t}\n\t\t$html .= '</div>';\n\n\t\t$out[] = $html;\n\t}\n\n\treturn array(\n\t\t'label' => __( 'Size' ),\n\t\t'input' => 'html',\n\t\t'html'  => join( \"\\n\", $out ),\n\t);\n}\n\n/**\n * Retrieve HTML for the Link URL buttons with the default link type as specified.\n *\n * @since 2.7.0\n *\n * @param WP_Post $post\n * @param string  $url_type\n * @return string\n */\nfunction image_link_input_fields( $post, $url_type = '' ) {\n\n\t$file = wp_get_attachment_url( $post->ID );\n\t$link = get_attachment_link( $post->ID );\n\n\tif ( empty( $url_type ) ) {\n\t\t$url_type = get_user_setting( 'urlbutton', 'post' );\n\t}\n\n\t$url = '';\n\n\tif ( 'file' === $url_type ) {\n\t\t$url = $file;\n\t} elseif ( 'post' === $url_type ) {\n\t\t$url = $link;\n\t}\n\n\treturn \"\n\t<input type='text' class='text urlfield' name='attachments[$post->ID][url]' value='\" . esc_attr( $url ) . \"' /><br />\n\t<button type='button' class='button urlnone' data-link-url=''>\" . __( 'None' ) . \"</button>\n\t<button type='button' class='button urlfile' data-link-url='\" . esc_attr( $file ) . \"'>\" . __( 'File URL' ) . \"</button>\n\t<button type='button' class='button urlpost' data-link-url='\" . esc_attr( $link ) . \"'>\" . __( 'Attachment Post URL' ) . '</button>\n';\n}\n\n/**\n * Output a textarea element for inputting an attachment caption.\n *\n * @since 3.4.0\n *\n * @param WP_Post $edit_post Attachment WP_Post object.\n * @return string HTML markup for the textarea element.\n */\nfunction wp_caption_input_textarea( $edit_post ) {\n\t// Post data is already escaped.\n\t$name = \"attachments[{$edit_post->ID}][post_excerpt]\";\n\n\treturn '<textarea name=\"' . $name . '\" id=\"' . $name . '\">' . $edit_post->post_excerpt . '</textarea>';\n}\n\n/**\n * Retrieves the image attachment fields to edit form fields.\n *\n * @since 2.5.0\n *\n * @param array  $form_fields\n * @param object $post\n * @return array\n */\nfunction image_attachment_fields_to_edit( $form_fields, $post ) {\n\treturn $form_fields;\n}\n\n/**\n * Retrieves the single non-image attachment fields to edit form fields.\n *\n * @since 2.5.0\n *\n * @param array   $form_fields An array of attachment form fields.\n * @param WP_Post $post        The WP_Post attachment object.\n * @return array Filtered attachment form fields.\n */\nfunction media_single_attachment_fields_to_edit( $form_fields, $post ) {\n\tunset( $form_fields['url'], $form_fields['align'], $form_fields['image-size'] );\n\treturn $form_fields;\n}\n\n/**\n * Retrieves the post non-image attachment fields to edit form fields.\n *\n * @since 2.8.0\n *\n * @param array   $form_fields An array of attachment form fields.\n * @param WP_Post $post        The WP_Post attachment object.\n * @return array Filtered attachment form fields.\n */\nfunction media_post_single_attachment_fields_to_edit( $form_fields, $post ) {\n\tunset( $form_fields['image_url'] );\n\treturn $form_fields;\n}\n\n/**\n * Filters input from media_upload_form_handler() and assigns a default\n * post_title from the file name if none supplied.\n *\n * Illustrates the use of the {@see 'attachment_fields_to_save'} filter\n * which can be used to add default values to any field before saving to DB.\n *\n * @since 2.5.0\n *\n * @param array $post       The WP_Post attachment object converted to an array.\n * @param array $attachment An array of attachment metadata.\n * @return array Filtered attachment post object.\n */\nfunction image_attachment_fields_to_save( $post, $attachment ) {\n\tif ( 'image' === substr( $post['post_mime_type'], 0, 5 ) ) {\n\t\tif ( strlen( trim( $post['post_title'] ) ) == 0 ) {\n\t\t\t$attachment_url                           = ( isset( $post['attachment_url'] ) ) ? $post['attachment_url'] : $post['guid'];\n\t\t\t$post['post_title']                       = preg_replace( '/\\.\\w+$/', '', wp_basename( $attachment_url ) );\n\t\t\t$post['errors']['post_title']['errors'][] = __( 'Empty Title filled from filename.' );\n\t\t}\n\t}\n\n\treturn $post;\n}\n\n/**\n * Retrieves the media element HTML to send to the editor.\n *\n * @since 2.5.0\n *\n * @param string  $html\n * @param integer $attachment_id\n * @param array   $attachment\n * @return string\n */\nfunction image_media_send_to_editor( $html, $attachment_id, $attachment ) {\n\t$post = get_post( $attachment_id );\n\n\tif ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) {\n\t\t$url   = $attachment['url'];\n\t\t$align = ! empty( $attachment['align'] ) ? $attachment['align'] : 'none';\n\t\t$size  = ! empty( $attachment['image-size'] ) ? $attachment['image-size'] : 'medium';\n\t\t$alt   = ! empty( $attachment['image_alt'] ) ? $attachment['image_alt'] : '';\n\t\t$rel   = ( strpos( $url, 'attachment_id' ) || get_attachment_link( $attachment_id ) === $url );\n\n\t\treturn get_image_send_to_editor( $attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size, $alt );\n\t}\n\n\treturn $html;\n}\n\n/**\n * Retrieves the attachment fields to edit form fields.\n *\n * @since 2.5.0\n *\n * @param WP_Post $post\n * @param array   $errors\n * @return array\n */\nfunction get_attachment_fields_to_edit( $post, $errors = null ) {\n\tif ( is_int( $post ) ) {\n\t\t$post = get_post( $post );\n\t}\n\n\tif ( is_array( $post ) ) {\n\t\t$post = new WP_Post( (object) $post );\n\t}\n\n\t$image_url = wp_get_attachment_url( $post->ID );\n\n\t$edit_post = sanitize_post( $post, 'edit' );\n\n\t$form_fields = array(\n\t\t'post_title'   => array(\n\t\t\t'label' => __( 'Title' ),\n\t\t\t'value' => $edit_post->post_title,\n\t\t),\n\t\t'image_alt'    => array(),\n\t\t'post_excerpt' => array(\n\t\t\t'label' => __( 'Caption' ),\n\t\t\t'input' => 'html',\n\t\t\t'html'  => wp_caption_input_textarea( $edit_post ),\n\t\t),\n\t\t'post_content' => array(\n\t\t\t'label' => __( 'Description' ),\n\t\t\t'value' => $edit_post->post_content,\n\t\t\t'input' => 'textarea',\n\t\t),\n\t\t'url'          => array(\n\t\t\t'label' => __( 'Link URL' ),\n\t\t\t'input' => 'html',\n\t\t\t'html'  => image_link_input_fields( $post, get_option( 'image_default_link_type' ) ),\n\t\t\t'helps' => __( 'Enter a link URL or click above for presets.' ),\n\t\t),\n\t\t'menu_order'   => array(\n\t\t\t'label' => __( 'Order' ),\n\t\t\t'value' => $edit_post->menu_order,\n\t\t),\n\t\t'image_url'    => array(\n\t\t\t'label' => __( 'File URL' ),\n\t\t\t'input' => 'html',\n\t\t\t'html'  => \"<input type='text' class='text urlfield' readonly='readonly' name='attachments[$post->ID][url]' value='\" . esc_attr( $image_url ) . \"' /><br />\",\n\t\t\t'value' => wp_get_attachment_url( $post->ID ),\n\t\t\t'helps' => __( 'Location of the uploaded file.' ),\n\t\t),\n\t);\n\n\tforeach ( get_attachment_taxonomies( $post ) as $taxonomy ) {\n\t\t$t = (array) get_taxonomy( $taxonomy );\n\n\t\tif ( ! $t['public'] || ! $t['show_ui'] ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( empty( $t['label'] ) ) {\n\t\t\t$t['label'] = $taxonomy;\n\t\t}\n\n\t\tif ( empty( $t['args'] ) ) {\n\t\t\t$t['args'] = array();\n\t\t}\n\n\t\t$terms = get_object_term_cache( $post->ID, $taxonomy );\n\n\t\tif ( false === $terms ) {\n\t\t\t$terms = wp_get_object_terms( $post->ID, $taxonomy, $t['args'] );\n\t\t}\n\n\t\t$values = array();\n\n\t\tforeach ( $terms as $term ) {\n\t\t\t$values[] = $term->slug;\n\t\t}\n\n\t\t$t['value'] = join( ', ', $values );\n\n\t\t$form_fields[ $taxonomy ] = $t;\n\t}\n\n\t/*\n\t * Merge default fields with their errors, so any key passed with the error\n\t * (e.g. 'error', 'helps', 'value') will replace the default.\n\t * The recursive merge is easily traversed with array casting:\n\t * foreach ( (array) $things as $thing )\n\t */\n\t$form_fields = array_merge_recursive( $form_fields, (array) $errors );\n\n\t// This was formerly in image_attachment_fields_to_edit().\n\tif ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) {\n\t\t$alt = get_post_meta( $post->ID, '_wp_attachment_image_alt', true );\n\n\t\tif ( empty( $alt ) ) {\n\t\t\t$alt = '';\n\t\t}\n\n\t\t$form_fields['post_title']['required'] = true;\n\n\t\t$form_fields['image_alt'] = array(\n\t\t\t'value' => $alt,\n\t\t\t'label' => __( 'Alternative Text' ),\n\t\t\t'helps' => __( 'Alt text for the image, e.g. &#8220;The Mona Lisa&#8221;' ),\n\t\t);\n\n\t\t$form_fields['align'] = array(\n\t\t\t'label' => __( 'Alignment' ),\n\t\t\t'input' => 'html',\n\t\t\t'html'  => image_align_input_fields( $post, get_option( 'image_default_align' ) ),\n\t\t);\n\n\t\t$form_fields['image-size'] = image_size_input_fields( $post, get_option( 'image_default_size', 'medium' ) );\n\n\t} else {\n\t\tunset( $form_fields['image_alt'] );\n\t}\n\n\t/**\n\t * Filters the attachment fields to edit.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param array   $form_fields An array of attachment form fields.\n\t * @param WP_Post $post        The WP_Post attachment object.\n\t */\n\t$form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );\n\n\treturn $form_fields;\n}\n\n/**\n * Retrieve HTML for media items of post gallery.\n *\n * The HTML markup retrieved will be created for the progress of SWF Upload\n * component. Will also create link for showing and hiding the form to modify\n * the image attachment.\n *\n * @since 2.5.0\n *\n * @global WP_Query $wp_the_query WordPress Query object.\n *\n * @param int   $post_id Optional. Post ID.\n * @param array $errors  Errors for attachment, if any.\n * @return string\n */\nfunction get_media_items( $post_id, $errors ) {\n\t$attachments = array();\n\n\tif ( $post_id ) {\n\t\t$post = get_post( $post_id );\n\n\t\tif ( $post && 'attachment' === $post->post_type ) {\n\t\t\t$attachments = array( $post->ID => $post );\n\t\t} else {\n\t\t\t$attachments = get_children(\n\t\t\t\tarray(\n\t\t\t\t\t'post_parent' => $post_id,\n\t\t\t\t\t'post_type'   => 'attachment',\n\t\t\t\t\t'orderby'     => 'menu_order ASC, ID',\n\t\t\t\t\t'order'       => 'DESC',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif ( is_array( $GLOBALS['wp_the_query']->posts ) ) {\n\t\t\tforeach ( $GLOBALS['wp_the_query']->posts as $attachment ) {\n\t\t\t\t$attachments[ $attachment->ID ] = $attachment;\n\t\t\t}\n\t\t}\n\t}\n\n\t$output = '';\n\tforeach ( (array) $attachments as $id => $attachment ) {\n\t\tif ( 'trash' === $attachment->post_status ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$item = get_media_item( $id, array( 'errors' => isset( $errors[ $id ] ) ? $errors[ $id ] : null ) );\n\n\t\tif ( $item ) {\n\t\t\t$output .= \"\\n<div id='media-item-$id' class='media-item child-of-$attachment->post_parent preloaded'><div class='progress hidden'><div class='bar'></div></div><div id='media-upload-error-$id' class='hidden'></div><div class='filename hidden'></div>$item\\n</div>\";\n\t\t}\n\t}\n\n\treturn $output;\n}\n\n/**\n * Retrieve HTML form for modifying the image attachment.\n *\n * @since 2.5.0\n *\n * @global string $redir_tab\n *\n * @param int          $attachment_id Attachment ID for modification.\n * @param string|array $args          Optional. Override defaults.\n * @return string HTML form for attachment.\n */\nfunction get_media_item( $attachment_id, $args = null ) {\n\tglobal $redir_tab;\n\n\t$thumb_url     = false;\n\t$attachment_id = intval( $attachment_id );\n\n\tif ( $attachment_id ) {\n\t\t$thumb_url = wp_get_attachment_image_src( $attachment_id, 'thumbnail', true );\n\n\t\tif ( $thumb_url ) {\n\t\t\t$thumb_url = $thumb_url[0];\n\t\t}\n\t}\n\n\t$post            = get_post( $attachment_id );\n\t$current_post_id = ! empty( $_GET['post_id'] ) ? (int) $_GET['post_id'] : 0;\n\n\t$default_args = array(\n\t\t'errors'     => null,\n\t\t'send'       => $current_post_id ? post_type_supports( get_post_type( $current_post_id ), 'editor' ) : true,\n\t\t'delete'     => true,\n\t\t'toggle'     => true,\n\t\t'show_title' => true,\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $default_args );\n\n\t/**\n\t * Filters the arguments used to retrieve an image for the edit image form.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @see get_media_item\n\t *\n\t * @param array $parsed_args An array of arguments.\n\t */\n\t$parsed_args = apply_filters( 'get_media_item_args', $parsed_args );\n\n\t$toggle_on  = __( 'Show' );\n\t$toggle_off = __( 'Hide' );\n\n\t$file     = get_attached_file( $post->ID );\n\t$filename = esc_html( wp_basename( $file ) );\n\t$title    = esc_attr( $post->post_title );\n\n\t$post_mime_types = get_post_mime_types();\n\t$keys            = array_keys( wp_match_mime_types( array_keys( $post_mime_types ), $post->post_mime_type ) );\n\t$type            = reset( $keys );\n\t$type_html       = \"<input type='hidden' id='type-of-$attachment_id' value='\" . esc_attr( $type ) . \"' />\";\n\n\t$form_fields = get_attachment_fields_to_edit( $post, $parsed_args['errors'] );\n\n\tif ( $parsed_args['toggle'] ) {\n\t\t$class        = empty( $parsed_args['errors'] ) ? 'startclosed' : 'startopen';\n\t\t$toggle_links = \"\n\t\t<a class='toggle describe-toggle-on' href='#'>$toggle_on</a>\n\t\t<a class='toggle describe-toggle-off' href='#'>$toggle_off</a>\";\n\t} else {\n\t\t$class        = '';\n\t\t$toggle_links = '';\n\t}\n\n\t$display_title = ( ! empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case.\n\t$display_title = $parsed_args['show_title'] ? \"<div class='filename new'><span class='title'>\" . wp_html_excerpt( $display_title, 60, '&hellip;' ) . '</span></div>' : '';\n\n\t$gallery = ( ( isset( $_REQUEST['tab'] ) && 'gallery' === $_REQUEST['tab'] ) || ( isset( $redir_tab ) && 'gallery' === $redir_tab ) );\n\t$order   = '';\n\n\tforeach ( $form_fields as $key => $val ) {\n\t\tif ( 'menu_order' === $key ) {\n\t\t\tif ( $gallery ) {\n\t\t\t\t$order = \"<div class='menu_order'> <input class='menu_order_input' type='text' id='attachments[$attachment_id][menu_order]' name='attachments[$attachment_id][menu_order]' value='\" . esc_attr( $val['value'] ) . \"' /></div>\";\n\t\t\t} else {\n\t\t\t\t$order = \"<input type='hidden' name='attachments[$attachment_id][menu_order]' value='\" . esc_attr( $val['value'] ) . \"' />\";\n\t\t\t}\n\n\t\t\tunset( $form_fields['menu_order'] );\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$media_dims = '';\n\t$meta       = wp_get_attachment_metadata( $post->ID );\n\n\tif ( isset( $meta['width'], $meta['height'] ) ) {\n\t\t$media_dims .= \"<span id='media-dims-$post->ID'>{$meta['width']}&nbsp;&times;&nbsp;{$meta['height']}</span> \";\n\t}\n\n\t/**\n\t * Filters the media metadata.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string  $media_dims The HTML markup containing the media dimensions.\n\t * @param WP_Post $post       The WP_Post attachment object.\n\t */\n\t$media_dims = apply_filters( 'media_meta', $media_dims, $post );\n\n\t$image_edit_button = '';\n\n\tif ( wp_attachment_is_image( $post->ID ) && wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) {\n\t\t$nonce             = wp_create_nonce( \"image_editor-$post->ID\" );\n\t\t$image_edit_button = \"<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \\\"$nonce\\\" )' class='button' value='\" . esc_attr__( 'Edit Image' ) . \"' /> <span class='spinner'></span>\";\n\t}\n\n\t$attachment_url = get_permalink( $attachment_id );\n\n\t$item = \"\n\t\t$type_html\n\t\t$toggle_links\n\t\t$order\n\t\t$display_title\n\t\t<table class='slidetoggle describe $class'>\n\t\t\t<thead class='media-item-info' id='media-head-$post->ID'>\n\t\t\t<tr>\n\t\t\t<td class='A1B1' id='thumbnail-head-$post->ID'>\n\t\t\t<p><a href='$attachment_url' target='_blank'><img class='thumbnail' src='$thumb_url' alt='' /></a></p>\n\t\t\t<p>$image_edit_button</p>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t<p><strong>\" . __( 'File name:' ) . \"</strong> $filename</p>\n\t\t\t<p><strong>\" . __( 'File type:' ) . \"</strong> $post->post_mime_type</p>\n\t\t\t<p><strong>\" . __( 'Upload date:' ) . '</strong> ' . mysql2date( __( 'F j, Y' ), $post->post_date ) . '</p>';\n\n\tif ( ! empty( $media_dims ) ) {\n\t\t$item .= '<p><strong>' . __( 'Dimensions:' ) . \"</strong> $media_dims</p>\\n\";\n\t}\n\n\t$item .= \"</td></tr>\\n\";\n\n\t$item .= \"\n\t\t</thead>\n\t\t<tbody>\n\t\t<tr><td colspan='2' class='imgedit-response' id='imgedit-response-$post->ID'></td></tr>\\n\n\t\t<tr><td style='display:none' colspan='2' class='image-editor' id='image-editor-$post->ID'></td></tr>\\n\n\t\t<tr><td colspan='2'><p class='media-types media-types-required-info'>\" .\n\t\t\t/* translators: %s: Asterisk symbol (*). */\n\t\t\tsprintf( __( 'Required fields are marked %s' ), '<span class=\"required\">*</span>' ) .\n\t\t\"</p></td></tr>\\n\";\n\n\t$defaults = array(\n\t\t'input'      => 'text',\n\t\t'required'   => false,\n\t\t'value'      => '',\n\t\t'extra_rows' => array(),\n\t);\n\n\tif ( $parsed_args['send'] ) {\n\t\t$parsed_args['send'] = get_submit_button( __( 'Insert into Post' ), '', \"send[$attachment_id]\", false );\n\t}\n\n\t$delete = empty( $parsed_args['delete'] ) ? '' : $parsed_args['delete'];\n\tif ( $delete && current_user_can( 'delete_post', $attachment_id ) ) {\n\t\tif ( ! EMPTY_TRASH_DAYS ) {\n\t\t\t$delete = \"<a href='\" . wp_nonce_url( \"post.php?action=delete&amp;post=$attachment_id\", 'delete-post_' . $attachment_id ) . \"' id='del[$attachment_id]' class='delete-permanently'>\" . __( 'Delete Permanently' ) . '</a>';\n\t\t} elseif ( ! MEDIA_TRASH ) {\n\t\t\t$delete = \"<a href='#' class='del-link' onclick=\\\"document.getElementById('del_attachment_$attachment_id').style.display='block';return false;\\\">\" . __( 'Delete' ) . \"</a>\n\t\t\t\t<div id='del_attachment_$attachment_id' class='del-attachment' style='display:none;'>\" .\n\t\t\t\t/* translators: %s: File name. */\n\t\t\t\t'<p>' . sprintf( __( 'You are about to delete %s.' ), '<strong>' . $filename . '</strong>' ) . \"</p>\n\t\t\t\t<a href='\" . wp_nonce_url( \"post.php?action=delete&amp;post=$attachment_id\", 'delete-post_' . $attachment_id ) . \"' id='del[$attachment_id]' class='button'>\" . __( 'Continue' ) . \"</a>\n\t\t\t\t<a href='#' class='button' onclick=\\\"this.parentNode.style.display='none';return false;\\\">\" . __( 'Cancel' ) . '</a>\n\t\t\t\t</div>';\n\t\t} else {\n\t\t\t$delete = \"<a href='\" . wp_nonce_url( \"post.php?action=trash&amp;post=$attachment_id\", 'trash-post_' . $attachment_id ) . \"' id='del[$attachment_id]' class='delete'>\" . __( 'Move to Trash' ) . \"</a>\n\t\t\t<a href='\" . wp_nonce_url( \"post.php?action=untrash&amp;post=$attachment_id\", 'untrash-post_' . $attachment_id ) . \"' id='undo[$attachment_id]' class='undo hidden'>\" . __( 'Undo' ) . '</a>';\n\t\t}\n\t} else {\n\t\t$delete = '';\n\t}\n\n\t$thumbnail       = '';\n\t$calling_post_id = 0;\n\n\tif ( isset( $_GET['post_id'] ) ) {\n\t\t$calling_post_id = absint( $_GET['post_id'] );\n\t} elseif ( isset( $_POST ) && count( $_POST ) ) {// Like for async-upload where $_GET['post_id'] isn't set.\n\t\t$calling_post_id = $post->post_parent;\n\t}\n\n\tif ( 'image' === $type && $calling_post_id\n\t\t&& current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) )\n\t\t&& post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' )\n\t\t&& get_post_thumbnail_id( $calling_post_id ) != $attachment_id\n\t) {\n\n\t\t$calling_post             = get_post( $calling_post_id );\n\t\t$calling_post_type_object = get_post_type_object( $calling_post->post_type );\n\n\t\t$ajax_nonce = wp_create_nonce( \"set_post_thumbnail-$calling_post_id\" );\n\t\t$thumbnail  = \"<a class='wp-post-thumbnail' id='wp-post-thumbnail-\" . $attachment_id . \"' href='#' onclick='WPSetAsThumbnail(\\\"$attachment_id\\\", \\\"$ajax_nonce\\\");return false;'>\" . esc_html( $calling_post_type_object->labels->use_featured_image ) . '</a>';\n\t}\n\n\tif ( ( $parsed_args['send'] || $thumbnail || $delete ) && ! isset( $form_fields['buttons'] ) ) {\n\t\t$form_fields['buttons'] = array( 'tr' => \"\\t\\t<tr class='submit'><td></td><td class='savesend'>\" . $parsed_args['send'] . \" $thumbnail $delete</td></tr>\\n\" );\n\t}\n\n\t$hidden_fields = array();\n\n\tforeach ( $form_fields as $id => $field ) {\n\t\tif ( '_' === $id[0] ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( ! empty( $field['tr'] ) ) {\n\t\t\t$item .= $field['tr'];\n\t\t\tcontinue;\n\t\t}\n\n\t\t$field = array_merge( $defaults, $field );\n\t\t$name  = \"attachments[$attachment_id][$id]\";\n\n\t\tif ( 'hidden' === $field['input'] ) {\n\t\t\t$hidden_fields[ $name ] = $field['value'];\n\t\t\tcontinue;\n\t\t}\n\n\t\t$required      = $field['required'] ? '<span class=\"required\">*</span>' : '';\n\t\t$required_attr = $field['required'] ? ' required' : '';\n\t\t$class         = $id;\n\t\t$class        .= $field['required'] ? ' form-required' : '';\n\n\t\t$item .= \"\\t\\t<tr class='$class'>\\n\\t\\t\\t<th scope='row' class='label'><label for='$name'><span class='alignleft'>{$field['label']}{$required}</span><br class='clear' /></label></th>\\n\\t\\t\\t<td class='field'>\";\n\n\t\tif ( ! empty( $field[ $field['input'] ] ) ) {\n\t\t\t$item .= $field[ $field['input'] ];\n\t\t} elseif ( 'textarea' === $field['input'] ) {\n\t\t\tif ( 'post_content' === $id && user_can_richedit() ) {\n\t\t\t\t// Sanitize_post() skips the post_content when user_can_richedit.\n\t\t\t\t$field['value'] = htmlspecialchars( $field['value'], ENT_QUOTES );\n\t\t\t}\n\t\t\t// Post_excerpt is already escaped by sanitize_post() in get_attachment_fields_to_edit().\n\t\t\t$item .= \"<textarea id='$name' name='$name'{$required_attr}>\" . $field['value'] . '</textarea>';\n\t\t} else {\n\t\t\t$item .= \"<input type='text' class='text' id='$name' name='$name' value='\" . esc_attr( $field['value'] ) . \"'{$required_attr} />\";\n\t\t}\n\n\t\tif ( ! empty( $field['helps'] ) ) {\n\t\t\t$item .= \"<p class='help'>\" . join( \"</p>\\n<p class='help'>\", array_unique( (array) $field['helps'] ) ) . '</p>';\n\t\t}\n\t\t$item .= \"</td>\\n\\t\\t</tr>\\n\";\n\n\t\t$extra_rows = array();\n\n\t\tif ( ! empty( $field['errors'] ) ) {\n\t\t\tforeach ( array_unique( (array) $field['errors'] ) as $error ) {\n\t\t\t\t$extra_rows['error'][] = $error;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $field['extra_rows'] ) ) {\n\t\t\tforeach ( $field['extra_rows'] as $class => $rows ) {\n\t\t\t\tforeach ( (array) $rows as $html ) {\n\t\t\t\t\t$extra_rows[ $class ][] = $html;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $extra_rows as $class => $rows ) {\n\t\t\tforeach ( $rows as $html ) {\n\t\t\t\t$item .= \"\\t\\t<tr><td></td><td class='$class'>$html</td></tr>\\n\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! empty( $form_fields['_final'] ) ) {\n\t\t$item .= \"\\t\\t<tr class='final'><td colspan='2'>{$form_fields['_final']}</td></tr>\\n\";\n\t}\n\n\t$item .= \"\\t</tbody>\\n\";\n\t$item .= \"\\t</table>\\n\";\n\n\tforeach ( $hidden_fields as $name => $value ) {\n\t\t$item .= \"\\t<input type='hidden' name='$name' id='$name' value='\" . esc_attr( $value ) . \"' />\\n\";\n\t}\n\n\tif ( $post->post_parent < 1 && isset( $_REQUEST['post_id'] ) ) {\n\t\t$parent      = (int) $_REQUEST['post_id'];\n\t\t$parent_name = \"attachments[$attachment_id][post_parent]\";\n\t\t$item       .= \"\\t<input type='hidden' name='$parent_name' id='$parent_name' value='$parent' />\\n\";\n\t}\n\n\treturn $item;\n}\n\n/**\n * @since 3.5.0\n *\n * @param int   $attachment_id\n * @param array $args\n * @return array\n */\nfunction get_compat_media_markup( $attachment_id, $args = null ) {\n\t$post = get_post( $attachment_id );\n\n\t$default_args = array(\n\t\t'errors'   => null,\n\t\t'in_modal' => false,\n\t);\n\n\t$user_can_edit = current_user_can( 'edit_post', $attachment_id );\n\n\t$args = wp_parse_args( $args, $default_args );\n\n\t/** This filter is documented in wp-admin/includes/media.php */\n\t$args = apply_filters( 'get_media_item_args', $args );\n\n\t$form_fields = array();\n\n\tif ( $args['in_modal'] ) {\n\t\tforeach ( get_attachment_taxonomies( $post ) as $taxonomy ) {\n\t\t\t$t = (array) get_taxonomy( $taxonomy );\n\n\t\t\tif ( ! $t['public'] || ! $t['show_ui'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( empty( $t['label'] ) ) {\n\t\t\t\t$t['label'] = $taxonomy;\n\t\t\t}\n\n\t\t\tif ( empty( $t['args'] ) ) {\n\t\t\t\t$t['args'] = array();\n\t\t\t}\n\n\t\t\t$terms = get_object_term_cache( $post->ID, $taxonomy );\n\n\t\t\tif ( false === $terms ) {\n\t\t\t\t$terms = wp_get_object_terms( $post->ID, $taxonomy, $t['args'] );\n\t\t\t}\n\n\t\t\t$values = array();\n\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$values[] = $term->slug;\n\t\t\t}\n\n\t\t\t$t['value']    = join( ', ', $values );\n\t\t\t$t['taxonomy'] = true;\n\n\t\t\t$form_fields[ $taxonomy ] = $t;\n\t\t}\n\t}\n\n\t/*\n\t * Merge default fields with their errors, so any key passed with the error\n\t * (e.g. 'error', 'helps', 'value') will replace the default.\n\t * The recursive merge is easily traversed with array casting:\n\t * foreach ( (array) $things as $thing )\n\t */\n\t$form_fields = array_merge_recursive( $form_fields, (array) $args['errors'] );\n\n\t/** This filter is documented in wp-admin/includes/media.php */\n\t$form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );\n\n\tunset(\n\t\t$form_fields['image-size'],\n\t\t$form_fields['align'],\n\t\t$form_fields['image_alt'],\n\t\t$form_fields['post_title'],\n\t\t$form_fields['post_excerpt'],\n\t\t$form_fields['post_content'],\n\t\t$form_fields['url'],\n\t\t$form_fields['menu_order'],\n\t\t$form_fields['image_url']\n\t);\n\n\t/** This filter is documented in wp-admin/includes/media.php */\n\t$media_meta = apply_filters( 'media_meta', '', $post );\n\n\t$defaults = array(\n\t\t'input'         => 'text',\n\t\t'required'      => false,\n\t\t'value'         => '',\n\t\t'extra_rows'    => array(),\n\t\t'show_in_edit'  => true,\n\t\t'show_in_modal' => true,\n\t);\n\n\t$hidden_fields = array();\n\n\t$item = '';\n\n\tforeach ( $form_fields as $id => $field ) {\n\t\tif ( '_' === $id[0] ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$name    = \"attachments[$attachment_id][$id]\";\n\t\t$id_attr = \"attachments-$attachment_id-$id\";\n\n\t\tif ( ! empty( $field['tr'] ) ) {\n\t\t\t$item .= $field['tr'];\n\t\t\tcontinue;\n\t\t}\n\n\t\t$field = array_merge( $defaults, $field );\n\n\t\tif ( ( ! $field['show_in_edit'] && ! $args['in_modal'] ) || ( ! $field['show_in_modal'] && $args['in_modal'] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( 'hidden' === $field['input'] ) {\n\t\t\t$hidden_fields[ $name ] = $field['value'];\n\t\t\tcontinue;\n\t\t}\n\n\t\t$readonly      = ! $user_can_edit && ! empty( $field['taxonomy'] ) ? \" readonly='readonly' \" : '';\n\t\t$required      = $field['required'] ? '<span class=\"required\">*</span>' : '';\n\t\t$required_attr = $field['required'] ? ' required' : '';\n\t\t$class         = 'compat-field-' . $id;\n\t\t$class        .= $field['required'] ? ' form-required' : '';\n\n\t\t$item .= \"\\t\\t<tr class='$class'>\";\n\t\t$item .= \"\\t\\t\\t<th scope='row' class='label'><label for='$id_attr'><span class='alignleft'>{$field['label']}</span>$required<br class='clear' /></label>\";\n\t\t$item .= \"</th>\\n\\t\\t\\t<td class='field'>\";\n\n\t\tif ( ! empty( $field[ $field['input'] ] ) ) {\n\t\t\t$item .= $field[ $field['input'] ];\n\t\t} elseif ( 'textarea' === $field['input'] ) {\n\t\t\tif ( 'post_content' === $id && user_can_richedit() ) {\n\t\t\t\t// sanitize_post() skips the post_content when user_can_richedit.\n\t\t\t\t$field['value'] = htmlspecialchars( $field['value'], ENT_QUOTES );\n\t\t\t}\n\t\t\t$item .= \"<textarea id='$id_attr' name='$name'{$required_attr}>\" . $field['value'] . '</textarea>';\n\t\t} else {\n\t\t\t$item .= \"<input type='text' class='text' id='$id_attr' name='$name' value='\" . esc_attr( $field['value'] ) . \"' $readonly{$required_attr} />\";\n\t\t}\n\n\t\tif ( ! empty( $field['helps'] ) ) {\n\t\t\t$item .= \"<p class='help'>\" . join( \"</p>\\n<p class='help'>\", array_unique( (array) $field['helps'] ) ) . '</p>';\n\t\t}\n\n\t\t$item .= \"</td>\\n\\t\\t</tr>\\n\";\n\n\t\t$extra_rows = array();\n\n\t\tif ( ! empty( $field['errors'] ) ) {\n\t\t\tforeach ( array_unique( (array) $field['errors'] ) as $error ) {\n\t\t\t\t$extra_rows['error'][] = $error;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $field['extra_rows'] ) ) {\n\t\t\tforeach ( $field['extra_rows'] as $class => $rows ) {\n\t\t\t\tforeach ( (array) $rows as $html ) {\n\t\t\t\t\t$extra_rows[ $class ][] = $html;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $extra_rows as $class => $rows ) {\n\t\t\tforeach ( $rows as $html ) {\n\t\t\t\t$item .= \"\\t\\t<tr><td></td><td class='$class'>$html</td></tr>\\n\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! empty( $form_fields['_final'] ) ) {\n\t\t$item .= \"\\t\\t<tr class='final'><td colspan='2'>{$form_fields['_final']}</td></tr>\\n\";\n\t}\n\n\tif ( $item ) {\n\t\t$item = '<p class=\"media-types media-types-required-info\">' .\n\t\t\t/* translators: %s: Asterisk symbol (*). */\n\t\t\tsprintf( __( 'Required fields are marked %s' ), '<span class=\"required\">*</span>' ) .\n\t\t\t'</p>' .\n\t\t\t'<table class=\"compat-attachment-fields\">' . $item . '</table>';\n\t}\n\n\tforeach ( $hidden_fields as $hidden_field => $value ) {\n\t\t$item .= '<input type=\"hidden\" name=\"' . esc_attr( $hidden_field ) . '\" value=\"' . esc_attr( $value ) . '\" />' . \"\\n\";\n\t}\n\n\tif ( $item ) {\n\t\t$item = '<input type=\"hidden\" name=\"attachments[' . $attachment_id . '][menu_order]\" value=\"' . esc_attr( $post->menu_order ) . '\" />' . $item;\n\t}\n\n\treturn array(\n\t\t'item' => $item,\n\t\t'meta' => $media_meta,\n\t);\n}\n\n/**\n * Outputs the legacy media upload header.\n *\n * @since 2.5.0\n */\nfunction media_upload_header() {\n\t$post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;\n\n\techo '<script type=\"text/javascript\">post_id = ' . $post_id . ';</script>';\n\n\tif ( empty( $_GET['chromeless'] ) ) {\n\t\techo '<div id=\"media-upload-header\">';\n\t\tthe_media_upload_tabs();\n\t\techo '</div>';\n\t}\n}\n\n/**\n * Outputs the legacy media upload form.\n *\n * @since 2.5.0\n *\n * @global string $type\n * @global string $tab\n * @global bool   $is_IE\n * @global bool   $is_opera\n *\n * @param array $errors\n */\nfunction media_upload_form( $errors = null ) {\n\tglobal $type, $tab, $is_IE, $is_opera;\n\n\tif ( ! _device_can_upload() ) {\n\t\techo '<p>' . sprintf(\n\t\t\t/* translators: %s: https://apps.wordpress.org/ */\n\t\t\t__( 'The web browser on your device cannot be used to upload files. You may be able to use the <a href=\"%s\">native app for your device</a> instead.' ),\n\t\t\t'https://apps.wordpress.org/'\n\t\t) . '</p>';\n\t\treturn;\n\t}\n\n\t$upload_action_url = admin_url( 'async-upload.php' );\n\t$post_id           = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;\n\t$_type             = isset( $type ) ? $type : '';\n\t$_tab              = isset( $tab ) ? $tab : '';\n\n\t$max_upload_size = wp_max_upload_size();\n\tif ( ! $max_upload_size ) {\n\t\t$max_upload_size = 0;\n\t}\n\n\t?>\n\t<div id=\"media-upload-notice\">\n\t<?php\n\n\tif ( isset( $errors['upload_notice'] ) ) {\n\t\techo $errors['upload_notice'];\n\t}\n\n\t?>\n\t</div>\n\t<div id=\"media-upload-error\">\n\t<?php\n\n\tif ( isset( $errors['upload_error'] ) && is_wp_error( $errors['upload_error'] ) ) {\n\t\techo $errors['upload_error']->get_error_message();\n\t}\n\n\t?>\n\t</div>\n\t<?php\n\n\tif ( is_multisite() && ! is_upload_space_available() ) {\n\t\t/**\n\t\t * Fires when an upload will exceed the defined upload space quota for a network site.\n\t\t *\n\t\t * @since 3.5.0\n\t\t */\n\t\tdo_action( 'upload_ui_over_quota' );\n\t\treturn;\n\t}\n\n\t/**\n\t * Fires just before the legacy (pre-3.5.0) upload interface is loaded.\n\t *\n\t * @since 2.6.0\n\t */\n\tdo_action( 'pre-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t$post_params = array(\n\t\t'post_id'  => $post_id,\n\t\t'_wpnonce' => wp_create_nonce( 'media-form' ),\n\t\t'type'     => $_type,\n\t\t'tab'      => $_tab,\n\t\t'short'    => '1',\n\t);\n\n\t/**\n\t * Filters the media upload post parameters.\n\t *\n\t * @since 3.1.0 As 'swfupload_post_params'\n\t * @since 3.3.0\n\t *\n\t * @param array $post_params An array of media upload parameters used by Plupload.\n\t */\n\t$post_params = apply_filters( 'upload_post_params', $post_params );\n\n\t/*\n\t* Since 4.9 the `runtimes` setting is hardcoded in our version of Plupload to `html5,html4`,\n\t* and the `flash_swf_url` and `silverlight_xap_url` are not used.\n\t*/\n\t$plupload_init = array(\n\t\t'browse_button'    => 'plupload-browse-button',\n\t\t'container'        => 'plupload-upload-ui',\n\t\t'drop_element'     => 'drag-drop-area',\n\t\t'file_data_name'   => 'async-upload',\n\t\t'url'              => $upload_action_url,\n\t\t'filters'          => array( 'max_file_size' => $max_upload_size . 'b' ),\n\t\t'multipart_params' => $post_params,\n\t);\n\n\t/*\n\t * Currently only iOS Safari supports multiple files uploading,\n\t * but iOS 7.x has a bug that prevents uploading of videos when enabled.\n\t * See #29602.\n\t */\n\tif (\n\t\twp_is_mobile() &&\n\t\tstrpos( $_SERVER['HTTP_USER_AGENT'], 'OS 7_' ) !== false &&\n\t\tstrpos( $_SERVER['HTTP_USER_AGENT'], 'like Mac OS X' ) !== false\n\t) {\n\t\t$plupload_init['multi_selection'] = false;\n\t}\n\n\t/**\n\t * Filters the default Plupload settings.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param array $plupload_init An array of default settings used by Plupload.\n\t */\n\t$plupload_init = apply_filters( 'plupload_init', $plupload_init );\n\n\t?>\n\t<script type=\"text/javascript\">\n\t<?php\n\t// Verify size is an int. If not return default value.\n\t$large_size_h = absint( get_option( 'large_size_h' ) );\n\n\tif ( ! $large_size_h ) {\n\t\t$large_size_h = 1024;\n\t}\n\n\t$large_size_w = absint( get_option( 'large_size_w' ) );\n\n\tif ( ! $large_size_w ) {\n\t\t$large_size_w = 1024;\n\t}\n\n\t?>\n\tvar resize_height = <?php echo $large_size_h; ?>, resize_width = <?php echo $large_size_w; ?>,\n\twpUploaderInit = <?php echo wp_json_encode( $plupload_init ); ?>;\n\t</script>\n\n\t<div id=\"plupload-upload-ui\" class=\"hide-if-no-js\">\n\t<?php\n\t/**\n\t * Fires before the upload interface loads.\n\t *\n\t * @since 2.6.0 As 'pre-flash-upload-ui'\n\t * @since 3.3.0\n\t */\n\tdo_action( 'pre-plupload-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t?>\n\t<div id=\"drag-drop-area\">\n\t\t<div class=\"drag-drop-inside\">\n\t\t<p class=\"drag-drop-info\"><?php _e( 'Drop files to upload' ); ?></p>\n\t\t<p><?php _ex( 'or', 'Uploader: Drop files here - or - Select Files' ); ?></p>\n\t\t<p class=\"drag-drop-buttons\"><input id=\"plupload-browse-button\" type=\"button\" value=\"<?php esc_attr_e( 'Select Files' ); ?>\" class=\"button\" /></p>\n\t\t</div>\n\t</div>\n\t<?php\n\t/**\n\t * Fires after the upload interface loads.\n\t *\n\t * @since 2.6.0 As 'post-flash-upload-ui'\n\t * @since 3.3.0\n\t */\n\tdo_action( 'post-plupload-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t?>\n\t</div>\n\n\t<div id=\"html-upload-ui\" class=\"hide-if-js\">\n\t<?php\n\t/**\n\t * Fires before the upload button in the media upload interface.\n\t *\n\t * @since 2.6.0\n\t */\n\tdo_action( 'pre-html-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t?>\n\t<p id=\"async-upload-wrap\">\n\t\t<label class=\"screen-reader-text\" for=\"async-upload\"><?php _e( 'Upload' ); ?></label>\n\t\t<input type=\"file\" name=\"async-upload\" id=\"async-upload\" />\n\t\t<?php submit_button( __( 'Upload' ), 'primary', 'html-upload', false ); ?>\n\t\t<a href=\"#\" onclick=\"try{top.tb_remove();}catch(e){}; return false;\"><?php _e( 'Cancel' ); ?></a>\n\t</p>\n\t<div class=\"clear\"></div>\n\t<?php\n\t/**\n\t * Fires after the upload button in the media upload interface.\n\t *\n\t * @since 2.6.0\n\t */\n\tdo_action( 'post-html-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t?>\n\t</div>\n\n<p class=\"max-upload-size\">\n\t<?php\n\t/* translators: %s: Maximum allowed file size. */\n\tprintf( __( 'Maximum upload file size: %s.' ), esc_html( size_format( $max_upload_size ) ) );\n\t?>\n</p>\n\t<?php\n\n\t/**\n\t * Fires on the post upload UI screen.\n\t *\n\t * Legacy (pre-3.5.0) media workflow hook.\n\t *\n\t * @since 2.6.0\n\t */\n\tdo_action( 'post-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n}\n\n/**\n * Outputs the legacy media upload form for a given media type.\n *\n * @since 2.5.0\n *\n * @param string  $type\n * @param object  $errors\n * @param integer $id\n */\nfunction media_upload_type_form( $type = 'file', $errors = null, $id = null ) {\n\n\tmedia_upload_header();\n\n\t$post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;\n\n\t$form_action_url = admin_url( \"media-upload.php?type=$type&tab=type&post_id=$post_id\" );\n\n\t/**\n\t * Filters the media upload form action URL.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param string $form_action_url The media upload form action URL.\n\t * @param string $type            The type of media. Default 'file'.\n\t */\n\t$form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );\n\t$form_class      = 'media-upload-form type-form validate';\n\n\tif ( get_user_setting( 'uploader' ) ) {\n\t\t$form_class .= ' html-uploader';\n\t}\n\n\t?>\n\t<form enctype=\"multipart/form-data\" method=\"post\" action=\"<?php echo esc_url( $form_action_url ); ?>\" class=\"<?php echo $form_class; ?>\" id=\"<?php echo $type; ?>-form\">\n\t\t<?php submit_button( '', 'hidden', 'save', false ); ?>\n\t<input type=\"hidden\" name=\"post_id\" id=\"post_id\" value=\"<?php echo (int) $post_id; ?>\" />\n\t\t<?php wp_nonce_field( 'media-form' ); ?>\n\n\t<h3 class=\"media-title\"><?php _e( 'Add media files from your computer' ); ?></h3>\n\n\t<?php media_upload_form( $errors ); ?>\n\n\t<script type=\"text/javascript\">\n\tjQuery(function($){\n\t\tvar preloaded = $(\".media-item.preloaded\");\n\t\tif ( preloaded.length > 0 ) {\n\t\t\tpreloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});\n\t\t}\n\t\tupdateMediaForm();\n\t});\n\t</script>\n\t<div id=\"media-items\">\n\t<?php\n\n\tif ( $id ) {\n\t\tif ( ! is_wp_error( $id ) ) {\n\t\t\tadd_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 );\n\t\t\techo get_media_items( $id, $errors );\n\t\t} else {\n\t\t\techo '<div id=\"media-upload-error\">' . esc_html( $id->get_error_message() ) . '</div></div>';\n\t\t\texit;\n\t\t}\n\t}\n\n\t?>\n\t</div>\n\n\t<p class=\"savebutton ml-submit\">\n\t\t<?php submit_button( __( 'Save all changes' ), '', 'save', false ); ?>\n\t</p>\n\t</form>\n\t<?php\n}\n\n/**\n * Outputs the legacy media upload form for external media.\n *\n * @since 2.7.0\n *\n * @param string  $type\n * @param object  $errors\n * @param integer $id\n */\nfunction media_upload_type_url_form( $type = null, $errors = null, $id = null ) {\n\tif ( null === $type ) {\n\t\t$type = 'image';\n\t}\n\n\tmedia_upload_header();\n\n\t$post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;\n\n\t$form_action_url = admin_url( \"media-upload.php?type=$type&tab=type&post_id=$post_id\" );\n\t/** This filter is documented in wp-admin/includes/media.php */\n\t$form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );\n\t$form_class      = 'media-upload-form type-form validate';\n\n\tif ( get_user_setting( 'uploader' ) ) {\n\t\t$form_class .= ' html-uploader';\n\t}\n\n\t?>\n\t<form enctype=\"multipart/form-data\" method=\"post\" action=\"<?php echo esc_url( $form_action_url ); ?>\" class=\"<?php echo $form_class; ?>\" id=\"<?php echo $type; ?>-form\">\n\t<input type=\"hidden\" name=\"post_id\" id=\"post_id\" value=\"<?php echo (int) $post_id; ?>\" />\n\t\t<?php wp_nonce_field( 'media-form' ); ?>\n\n\t<h3 class=\"media-title\"><?php _e( 'Insert media from another website' ); ?></h3>\n\n\t<script type=\"text/javascript\">\n\tvar addExtImage = {\n\n\twidth : '',\n\theight : '',\n\talign : 'alignnone',\n\n\tinsert : function() {\n\t\tvar t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = '';\n\n\t\tif ( '' === f.src.value || '' === t.width )\n\t\t\treturn false;\n\n\t\tif ( f.alt.value )\n\t\t\talt = f.alt.value.replace(/'/g, '&#039;').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n\n\t\t<?php\n\t\t/** This filter is documented in wp-admin/includes/media.php */\n\t\tif ( ! apply_filters( 'disable_captions', '' ) ) {\n\t\t\t?>\n\t\t\tif ( f.caption.value ) {\n\t\t\t\tcaption = f.caption.value.replace(/\\r\\n|\\r/g, '\\n');\n\t\t\t\tcaption = caption.replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g, function(a){\n\t\t\t\t\treturn a.replace(/[\\r\\n\\t]+/, ' ');\n\t\t\t\t});\n\n\t\t\t\tcaption = caption.replace(/\\s*\\n\\s*/g, '<br />');\n\t\t\t}\n\t\t\t<?php\n\t\t}\n\n\t\t?>\n\t\tcls = caption ? '' : ' class=\"'+t.align+'\"';\n\n\t\thtml = '<img alt=\"'+alt+'\" src=\"'+f.src.value+'\"'+cls+' width=\"'+t.width+'\" height=\"'+t.height+'\" />';\n\n\t\tif ( f.url.value ) {\n\t\t\turl = f.url.value.replace(/'/g, '&#039;').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n\t\t\thtml = '<a href=\"'+url+'\">'+html+'</a>';\n\t\t}\n\n\t\tif ( caption )\n\t\t\thtml = '[caption id=\"\" align=\"'+t.align+'\" width=\"'+t.width+'\"]'+html+caption+'[/caption]';\n\n\t\tvar win = window.dialogArguments || opener || parent || top;\n\t\twin.send_to_editor(html);\n\t\treturn false;\n\t},\n\n\tresetImageData : function() {\n\t\tvar t = addExtImage;\n\n\t\tt.width = t.height = '';\n\t\tdocument.getElementById('go_button').style.color = '#bbb';\n\t\tif ( ! document.forms[0].src.value )\n\t\t\tdocument.getElementById('status_img').innerHTML = '';\n\t\telse document.getElementById('status_img').innerHTML = '<img src=\"<?php echo esc_url( admin_url( 'images/no.png' ) ); ?>\" alt=\"\" />';\n\t},\n\n\tupdateImageData : function() {\n\t\tvar t = addExtImage;\n\n\t\tt.width = t.preloadImg.width;\n\t\tt.height = t.preloadImg.height;\n\t\tdocument.getElementById('go_button').style.color = '#333';\n\t\tdocument.getElementById('status_img').innerHTML = '<img src=\"<?php echo esc_url( admin_url( 'images/yes.png' ) ); ?>\" alt=\"\" />';\n\t},\n\n\tgetImageData : function() {\n\t\tif ( jQuery('table.describe').hasClass('not-image') )\n\t\t\treturn;\n\n\t\tvar t = addExtImage, src = document.forms[0].src.value;\n\n\t\tif ( ! src ) {\n\t\t\tt.resetImageData();\n\t\t\treturn false;\n\t\t}\n\n\t\tdocument.getElementById('status_img').innerHTML = '<img src=\"<?php echo esc_url( admin_url( 'images/spinner-2x.gif' ) ); ?>\" alt=\"\" width=\"16\" height=\"16\" />';\n\t\tt.preloadImg = new Image();\n\t\tt.preloadImg.onload = t.updateImageData;\n\t\tt.preloadImg.onerror = t.resetImageData;\n\t\tt.preloadImg.src = src;\n\t}\n\t};\n\n\tjQuery(document).ready( function($) {\n\t\t$('.media-types input').click( function() {\n\t\t\t$('table.describe').toggleClass('not-image', $('#not-image').prop('checked') );\n\t\t});\n\t});\n\t</script>\n\n\t<div id=\"media-items\">\n\t<div class=\"media-item media-blank\">\n\t<?php\n\t/**\n\t * Filters the insert media from URL form HTML.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $form_html The insert from URL form HTML.\n\t */\n\techo apply_filters( 'type_url_form_media', wp_media_insert_url_form( $type ) );\n\n\t?>\n\t</div>\n\t</div>\n\t</form>\n\t<?php\n}\n\n/**\n * Adds gallery form to upload iframe\n *\n * @since 2.5.0\n *\n * @global string $redir_tab\n * @global string $type\n * @global string $tab\n *\n * @param array $errors\n */\nfunction media_upload_gallery_form( $errors ) {\n\tglobal $redir_tab, $type;\n\n\t$redir_tab = 'gallery';\n\tmedia_upload_header();\n\n\t$post_id         = intval( $_REQUEST['post_id'] );\n\t$form_action_url = admin_url( \"media-upload.php?type=$type&tab=gallery&post_id=$post_id\" );\n\t/** This filter is documented in wp-admin/includes/media.php */\n\t$form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );\n\t$form_class      = 'media-upload-form validate';\n\n\tif ( get_user_setting( 'uploader' ) ) {\n\t\t$form_class .= ' html-uploader';\n\t}\n\n\t?>\n\t<script type=\"text/javascript\">\n\tjQuery(function($){\n\t\tvar preloaded = $(\".media-item.preloaded\");\n\t\tif ( preloaded.length > 0 ) {\n\t\t\tpreloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});\n\t\t\tupdateMediaForm();\n\t\t}\n\t});\n\t</script>\n\t<div id=\"sort-buttons\" class=\"hide-if-no-js\">\n\t<span>\n\t\t<?php _e( 'All Tabs:' ); ?>\n\t<a href=\"#\" id=\"showall\"><?php _e( 'Show' ); ?></a>\n\t<a href=\"#\" id=\"hideall\" style=\"display:none;\"><?php _e( 'Hide' ); ?></a>\n\t</span>\n\t\t<?php _e( 'Sort Order:' ); ?>\n\t<a href=\"#\" id=\"asc\"><?php _e( 'Ascending' ); ?></a> |\n\t<a href=\"#\" id=\"desc\"><?php _e( 'Descending' ); ?></a> |\n\t<a href=\"#\" id=\"clear\"><?php _ex( 'Clear', 'verb' ); ?></a>\n\t</div>\n\t<form enctype=\"multipart/form-data\" method=\"post\" action=\"<?php echo esc_url( $form_action_url ); ?>\" class=\"<?php echo $form_class; ?>\" id=\"gallery-form\">\n\t\t<?php wp_nonce_field( 'media-form' ); ?>\n\t\t<?php // media_upload_form( $errors ); ?>\n\t<table class=\"widefat\">\n\t<thead><tr>\n\t<th><?php _e( 'Media' ); ?></th>\n\t<th class=\"order-head\"><?php _e( 'Order' ); ?></th>\n\t<th class=\"actions-head\"><?php _e( 'Actions' ); ?></th>\n\t</tr></thead>\n\t</table>\n\t<div id=\"media-items\">\n\t\t<?php add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 ); ?>\n\t\t<?php echo get_media_items( $post_id, $errors ); ?>\n\t</div>\n\n\t<p class=\"ml-submit\">\n\t\t<?php\n\t\tsubmit_button(\n\t\t\t__( 'Save all changes' ),\n\t\t\t'savebutton',\n\t\t\t'save',\n\t\t\tfalse,\n\t\t\tarray(\n\t\t\t\t'id'    => 'save-all',\n\t\t\t\t'style' => 'display: none;',\n\t\t\t)\n\t\t);\n\t\t?>\n\t<input type=\"hidden\" name=\"post_id\" id=\"post_id\" value=\"<?php echo (int) $post_id; ?>\" />\n\t<input type=\"hidden\" name=\"type\" value=\"<?php echo esc_attr( $GLOBALS['type'] ); ?>\" />\n\t<input type=\"hidden\" name=\"tab\" value=\"<?php echo esc_attr( $GLOBALS['tab'] ); ?>\" />\n\t</p>\n\n\t<div id=\"gallery-settings\" style=\"display:none;\">\n\t<div class=\"title\"><?php _e( 'Gallery Settings' ); ?></div>\n\t<table id=\"basic\" class=\"describe\"><tbody>\n\t\t<tr>\n\t\t<th scope=\"row\" class=\"label\">\n\t\t\t<label>\n\t\t\t<span class=\"alignleft\"><?php _e( 'Link thumbnails to:' ); ?></span>\n\t\t\t</label>\n\t\t</th>\n\t\t<td class=\"field\">\n\t\t\t<input type=\"radio\" name=\"linkto\" id=\"linkto-file\" value=\"file\" />\n\t\t\t<label for=\"linkto-file\" class=\"radio\"><?php _e( 'Image File' ); ?></label>\n\n\t\t\t<input type=\"radio\" checked=\"checked\" name=\"linkto\" id=\"linkto-post\" value=\"post\" />\n\t\t\t<label for=\"linkto-post\" class=\"radio\"><?php _e( 'Attachment Page' ); ?></label>\n\t\t</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<th scope=\"row\" class=\"label\">\n\t\t\t<label>\n\t\t\t<span class=\"alignleft\"><?php _e( 'Order images by:' ); ?></span>\n\t\t\t</label>\n\t\t</th>\n\t\t<td class=\"field\">\n\t\t\t<select id=\"orderby\" name=\"orderby\">\n\t\t\t\t<option value=\"menu_order\" selected=\"selected\"><?php _e( 'Menu order' ); ?></option>\n\t\t\t\t<option value=\"title\"><?php _e( 'Title' ); ?></option>\n\t\t\t\t<option value=\"post_date\"><?php _e( 'Date/Time' ); ?></option>\n\t\t\t\t<option value=\"rand\"><?php _e( 'Random' ); ?></option>\n\t\t\t</select>\n\t\t</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<th scope=\"row\" class=\"label\">\n\t\t\t<label>\n\t\t\t<span class=\"alignleft\"><?php _e( 'Order:' ); ?></span>\n\t\t\t</label>\n\t\t</th>\n\t\t<td class=\"field\">\n\t\t\t<input type=\"radio\" checked=\"checked\" name=\"order\" id=\"order-asc\" value=\"asc\" />\n\t\t\t<label for=\"order-asc\" class=\"radio\"><?php _e( 'Ascending' ); ?></label>\n\n\t\t\t<input type=\"radio\" name=\"order\" id=\"order-desc\" value=\"desc\" />\n\t\t\t<label for=\"order-desc\" class=\"radio\"><?php _e( 'Descending' ); ?></label>\n\t\t</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<th scope=\"row\" class=\"label\">\n\t\t\t<label>\n\t\t\t<span class=\"alignleft\"><?php _e( 'Gallery columns:' ); ?></span>\n\t\t\t</label>\n\t\t</th>\n\t\t<td class=\"field\">\n\t\t\t<select id=\"columns\" name=\"columns\">\n\t\t\t\t<option value=\"1\">1</option>\n\t\t\t\t<option value=\"2\">2</option>\n\t\t\t\t<option value=\"3\" selected=\"selected\">3</option>\n\t\t\t\t<option value=\"4\">4</option>\n\t\t\t\t<option value=\"5\">5</option>\n\t\t\t\t<option value=\"6\">6</option>\n\t\t\t\t<option value=\"7\">7</option>\n\t\t\t\t<option value=\"8\">8</option>\n\t\t\t\t<option value=\"9\">9</option>\n\t\t\t</select>\n\t\t</td>\n\t\t</tr>\n\t</tbody></table>\n\n\t<p class=\"ml-submit\">\n\t<input type=\"button\" class=\"button\" style=\"display:none;\" onMouseDown=\"wpgallery.update();\" name=\"insert-gallery\" id=\"insert-gallery\" value=\"<?php esc_attr_e( 'Insert gallery' ); ?>\" />\n\t<input type=\"button\" class=\"button\" style=\"display:none;\" onMouseDown=\"wpgallery.update();\" name=\"update-gallery\" id=\"update-gallery\" value=\"<?php esc_attr_e( 'Update gallery settings' ); ?>\" />\n\t</p>\n\t</div>\n\t</form>\n\t<?php\n}\n\n/**\n * Outputs the legacy media upload form for the media library.\n *\n * @since 2.5.0\n *\n * @global wpdb      $wpdb            WordPress database abstraction object.\n * @global WP_Query  $wp_query        WordPress Query object.\n * @global WP_Locale $wp_locale       WordPress date and time locale object.\n * @global string    $type\n * @global string    $tab\n * @global array     $post_mime_types\n *\n * @param array $errors\n */\nfunction media_upload_library_form( $errors ) {\n\tglobal $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types;\n\n\tmedia_upload_header();\n\n\t$post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;\n\n\t$form_action_url = admin_url( \"media-upload.php?type=$type&tab=library&post_id=$post_id\" );\n\t/** This filter is documented in wp-admin/includes/media.php */\n\t$form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );\n\t$form_class      = 'media-upload-form validate';\n\n\tif ( get_user_setting( 'uploader' ) ) {\n\t\t$form_class .= ' html-uploader';\n\t}\n\n\t$q                   = $_GET;\n\t$q['posts_per_page'] = 10;\n\t$q['paged']          = isset( $q['paged'] ) ? intval( $q['paged'] ) : 0;\n\tif ( $q['paged'] < 1 ) {\n\t\t$q['paged'] = 1;\n\t}\n\t$q['offset'] = ( $q['paged'] - 1 ) * 10;\n\tif ( $q['offset'] < 1 ) {\n\t\t$q['offset'] = 0;\n\t}\n\n\tlist($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query( $q );\n\n\t?>\n\t<form id=\"filter\" method=\"get\">\n\t<input type=\"hidden\" name=\"type\" value=\"<?php echo esc_attr( $type ); ?>\" />\n\t<input type=\"hidden\" name=\"tab\" value=\"<?php echo esc_attr( $tab ); ?>\" />\n\t<input type=\"hidden\" name=\"post_id\" value=\"<?php echo (int) $post_id; ?>\" />\n\t<input type=\"hidden\" name=\"post_mime_type\" value=\"<?php echo isset( $_GET['post_mime_type'] ) ? esc_attr( $_GET['post_mime_type'] ) : ''; ?>\" />\n\t<input type=\"hidden\" name=\"context\" value=\"<?php echo isset( $_GET['context'] ) ? esc_attr( $_GET['context'] ) : ''; ?>\" />\n\n\t<p id=\"media-search\" class=\"search-box\">\n\t\t<label class=\"screen-reader-text\" for=\"media-search-input\"><?php _e( 'Search Media' ); ?>:</label>\n\t\t<input type=\"search\" id=\"media-search-input\" name=\"s\" value=\"<?php the_search_query(); ?>\" />\n\t\t<?php submit_button( __( 'Search Media' ), '', '', false ); ?>\n\t</p>\n\n\t<ul class=\"subsubsub\">\n\t\t<?php\n\t\t$type_links = array();\n\t\t$_num_posts = (array) wp_count_attachments();\n\t\t$matches    = wp_match_mime_types( array_keys( $post_mime_types ), array_keys( $_num_posts ) );\n\t\tforeach ( $matches as $_type => $reals ) {\n\t\t\tforeach ( $reals as $real ) {\n\t\t\t\tif ( isset( $num_posts[ $_type ] ) ) {\n\t\t\t\t\t$num_posts[ $_type ] += $_num_posts[ $real ];\n\t\t\t\t} else {\n\t\t\t\t\t$num_posts[ $_type ] = $_num_posts[ $real ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// If available type specified by media button clicked, filter by that type.\n\t\tif ( empty( $_GET['post_mime_type'] ) && ! empty( $num_posts[ $type ] ) ) {\n\t\t\t$_GET['post_mime_type']                        = $type;\n\t\t\tlist($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();\n\t\t}\n\t\tif ( empty( $_GET['post_mime_type'] ) || 'all' === $_GET['post_mime_type'] ) {\n\t\t\t$class = ' class=\"current\"';\n\t\t} else {\n\t\t\t$class = '';\n\t\t}\n\t\t$type_links[] = '<li><a href=\"' . esc_url(\n\t\t\tadd_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'post_mime_type' => 'all',\n\t\t\t\t\t'paged'          => false,\n\t\t\t\t\t'm'              => false,\n\t\t\t\t)\n\t\t\t)\n\t\t) . '\"' . $class . '>' . __( 'All Types' ) . '</a>';\n\t\tforeach ( $post_mime_types as $mime_type => $label ) {\n\t\t\t$class = '';\n\n\t\t\tif ( ! wp_match_mime_types( $mime_type, $avail_post_mime_types ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( isset( $_GET['post_mime_type'] ) && wp_match_mime_types( $mime_type, $_GET['post_mime_type'] ) ) {\n\t\t\t\t$class = ' class=\"current\"';\n\t\t\t}\n\n\t\t\t$type_links[] = '<li><a href=\"' . esc_url(\n\t\t\t\tadd_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_mime_type' => $mime_type,\n\t\t\t\t\t\t'paged'          => false,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t) . '\"' . $class . '>' . sprintf( translate_nooped_plural( $label[2], $num_posts[ $mime_type ] ), '<span id=\"' . $mime_type . '-counter\">' . number_format_i18n( $num_posts[ $mime_type ] ) . '</span>' ) . '</a>';\n\t\t}\n\t\t/**\n\t\t * Filters the media upload mime type list items.\n\t\t *\n\t\t * Returned values should begin with an `<li>` tag.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string[] $type_links An array of list items containing mime type link HTML.\n\t\t */\n\t\techo implode( ' | </li>', apply_filters( 'media_upload_mime_type_links', $type_links ) ) . '</li>';\n\t\tunset( $type_links );\n\t\t?>\n\t</ul>\n\n\t<div class=\"tablenav\">\n\n\t\t<?php\n\t\t$page_links = paginate_links(\n\t\t\tarray(\n\t\t\t\t'base'      => add_query_arg( 'paged', '%#%' ),\n\t\t\t\t'format'    => '',\n\t\t\t\t'prev_text' => __( '&laquo;' ),\n\t\t\t\t'next_text' => __( '&raquo;' ),\n\t\t\t\t'total'     => ceil( $wp_query->found_posts / 10 ),\n\t\t\t\t'current'   => $q['paged'],\n\t\t\t)\n\t\t);\n\n\t\tif ( $page_links ) {\n\t\t\techo \"<div class='tablenav-pages'>$page_links</div>\";\n\t\t}\n\t\t?>\n\n\t<div class=\"alignleft actions\">\n\t\t<?php\n\n\t\t$arc_query = \"SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC\";\n\n\t\t$arc_result = $wpdb->get_results( $arc_query );\n\n\t\t$month_count    = count( $arc_result );\n\t\t$selected_month = isset( $_GET['m'] ) ? $_GET['m'] : 0;\n\n\t\tif ( $month_count && ! ( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) {\n\t\t\t?>\n\t\t\t<select name='m'>\n\t\t\t<option<?php selected( $selected_month, 0 ); ?> value='0'><?php _e( 'All dates' ); ?></option>\n\t\t\t<?php\n\n\t\t\tforeach ( $arc_result as $arc_row ) {\n\t\t\t\tif ( 0 == $arc_row->yyear ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );\n\n\t\t\t\tif ( $arc_row->yyear . $arc_row->mmonth == $selected_month ) {\n\t\t\t\t\t$default = ' selected=\"selected\"';\n\t\t\t\t} else {\n\t\t\t\t\t$default = '';\n\t\t\t\t}\n\n\t\t\t\techo \"<option$default value='\" . esc_attr( $arc_row->yyear . $arc_row->mmonth ) . \"'>\";\n\t\t\t\techo esc_html( $wp_locale->get_month( $arc_row->mmonth ) . \" $arc_row->yyear\" );\n\t\t\t\techo \"</option>\\n\";\n\t\t\t}\n\n\t\t\t?>\n\t\t\t</select>\n\t\t<?php } ?>\n\n\t\t<?php submit_button( __( 'Filter &#187;' ), '', 'post-query-submit', false ); ?>\n\n\t</div>\n\n\t<br class=\"clear\" />\n\t</div>\n\t</form>\n\n\t<form enctype=\"multipart/form-data\" method=\"post\" action=\"<?php echo esc_url( $form_action_url ); ?>\" class=\"<?php echo $form_class; ?>\" id=\"library-form\">\n\t<?php wp_nonce_field( 'media-form' ); ?>\n\t<?php // media_upload_form( $errors ); ?>\n\n\t<script type=\"text/javascript\">\n\tjQuery(function($){\n\t\tvar preloaded = $(\".media-item.preloaded\");\n\t\tif ( preloaded.length > 0 ) {\n\t\t\tpreloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});\n\t\t\tupdateMediaForm();\n\t\t}\n\t});\n\t</script>\n\n\t<div id=\"media-items\">\n\t\t<?php add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 ); ?>\n\t\t<?php echo get_media_items( null, $errors ); ?>\n\t</div>\n\t<p class=\"ml-submit\">\n\t\t<?php submit_button( __( 'Save all changes' ), 'savebutton', 'save', false ); ?>\n\t<input type=\"hidden\" name=\"post_id\" id=\"post_id\" value=\"<?php echo (int) $post_id; ?>\" />\n\t</p>\n\t</form>\n\t<?php\n}\n\n/**\n * Creates the form for external url\n *\n * @since 2.7.0\n *\n * @param string $default_view\n * @return string the form html\n */\nfunction wp_media_insert_url_form( $default_view = 'image' ) {\n\t/** This filter is documented in wp-admin/includes/media.php */\n\tif ( ! apply_filters( 'disable_captions', '' ) ) {\n\t\t$caption = '\n\t\t<tr class=\"image-only\">\n\t\t\t<th scope=\"row\" class=\"label\">\n\t\t\t\t<label for=\"caption\"><span class=\"alignleft\">' . __( 'Image Caption' ) . '</span></label>\n\t\t\t</th>\n\t\t\t<td class=\"field\"><textarea id=\"caption\" name=\"caption\"></textarea></td>\n\t\t</tr>';\n\t} else {\n\t\t$caption = '';\n\t}\n\n\t$default_align = get_option( 'image_default_align' );\n\n\tif ( empty( $default_align ) ) {\n\t\t$default_align = 'none';\n\t}\n\n\tif ( 'image' === $default_view ) {\n\t\t$view        = 'image-only';\n\t\t$table_class = '';\n\t} else {\n\t\t$view        = 'not-image';\n\t\t$table_class = $view;\n\t}\n\n\treturn '\n\t<p class=\"media-types\"><label><input type=\"radio\" name=\"media_type\" value=\"image\" id=\"image-only\"' . checked( 'image-only', $view, false ) . ' /> ' . __( 'Image' ) . '</label> &nbsp; &nbsp; <label><input type=\"radio\" name=\"media_type\" value=\"generic\" id=\"not-image\"' . checked( 'not-image', $view, false ) . ' /> ' . __( 'Audio, Video, or Other File' ) . '</label></p>\n\t<p class=\"media-types media-types-required-info\">' .\n\t\t/* translators: %s: Asterisk symbol (*). */\n\t\tsprintf( __( 'Required fields are marked %s' ), '<span class=\"required\">*</span>' ) .\n\t'</p>\n\t<table class=\"describe ' . $table_class . '\"><tbody>\n\t\t<tr>\n\t\t\t<th scope=\"row\" class=\"label\" style=\"width:130px;\">\n\t\t\t\t<label for=\"src\"><span class=\"alignleft\">' . __( 'URL' ) . '</span> <span class=\"required\">*</span></label>\n\t\t\t\t<span class=\"alignright\" id=\"status_img\"></span>\n\t\t\t</th>\n\t\t\t<td class=\"field\"><input id=\"src\" name=\"src\" value=\"\" type=\"text\" required onblur=\"addExtImage.getImageData()\" /></td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t<th scope=\"row\" class=\"label\">\n\t\t\t\t<label for=\"title\"><span class=\"alignleft\">' . __( 'Title' ) . '</span> <span class=\"required\">*</span></label>\n\t\t\t</th>\n\t\t\t<td class=\"field\"><input id=\"title\" name=\"title\" value=\"\" type=\"text\" required /></td>\n\t\t</tr>\n\n\t\t<tr class=\"not-image\"><td></td><td><p class=\"help\">' . __( 'Link text, e.g. &#8220;Ransom Demands (PDF)&#8221;' ) . '</p></td></tr>\n\n\t\t<tr class=\"image-only\">\n\t\t\t<th scope=\"row\" class=\"label\">\n\t\t\t\t<label for=\"alt\"><span class=\"alignleft\">' . __( 'Alternative Text' ) . '</span></label>\n\t\t\t</th>\n\t\t\t<td class=\"field\"><input id=\"alt\" name=\"alt\" value=\"\" type=\"text\" required />\n\t\t\t<p class=\"help\">' . __( 'Alt text for the image, e.g. &#8220;The Mona Lisa&#8221;' ) . '</p></td>\n\t\t</tr>\n\t\t' . $caption . '\n\t\t<tr class=\"align image-only\">\n\t\t\t<th scope=\"row\" class=\"label\"><p><label for=\"align\">' . __( 'Alignment' ) . '</label></p></th>\n\t\t\t<td class=\"field\">\n\t\t\t\t<input name=\"align\" id=\"align-none\" value=\"none\" onclick=\"addExtImage.align=\\'align\\'+this.value\" type=\"radio\"' . ( 'none' === $default_align ? ' checked=\"checked\"' : '' ) . ' />\n\t\t\t\t<label for=\"align-none\" class=\"align image-align-none-label\">' . __( 'None' ) . '</label>\n\t\t\t\t<input name=\"align\" id=\"align-left\" value=\"left\" onclick=\"addExtImage.align=\\'align\\'+this.value\" type=\"radio\"' . ( 'left' === $default_align ? ' checked=\"checked\"' : '' ) . ' />\n\t\t\t\t<label for=\"align-left\" class=\"align image-align-left-label\">' . __( 'Left' ) . '</label>\n\t\t\t\t<input name=\"align\" id=\"align-center\" value=\"center\" onclick=\"addExtImage.align=\\'align\\'+this.value\" type=\"radio\"' . ( 'center' === $default_align ? ' checked=\"checked\"' : '' ) . ' />\n\t\t\t\t<label for=\"align-center\" class=\"align image-align-center-label\">' . __( 'Center' ) . '</label>\n\t\t\t\t<input name=\"align\" id=\"align-right\" value=\"right\" onclick=\"addExtImage.align=\\'align\\'+this.value\" type=\"radio\"' . ( 'right' === $default_align ? ' checked=\"checked\"' : '' ) . ' />\n\t\t\t\t<label for=\"align-right\" class=\"align image-align-right-label\">' . __( 'Right' ) . '</label>\n\t\t\t</td>\n\t\t</tr>\n\n\t\t<tr class=\"image-only\">\n\t\t\t<th scope=\"row\" class=\"label\">\n\t\t\t\t<label for=\"url\"><span class=\"alignleft\">' . __( 'Link Image To:' ) . '</span></label>\n\t\t\t</th>\n\t\t\t<td class=\"field\"><input id=\"url\" name=\"url\" value=\"\" type=\"text\" /><br />\n\n\t\t\t<button type=\"button\" class=\"button\" value=\"\" onclick=\"document.forms[0].url.value=null\">' . __( 'None' ) . '</button>\n\t\t\t<button type=\"button\" class=\"button\" value=\"\" onclick=\"document.forms[0].url.value=document.forms[0].src.value\">' . __( 'Link to image' ) . '</button>\n\t\t\t<p class=\"help\">' . __( 'Enter a link URL or click above for presets.' ) . '</p></td>\n\t\t</tr>\n\t\t<tr class=\"image-only\">\n\t\t\t<td></td>\n\t\t\t<td>\n\t\t\t\t<input type=\"button\" class=\"button\" id=\"go_button\" style=\"color:#bbb;\" onclick=\"addExtImage.insert()\" value=\"' . esc_attr__( 'Insert into Post' ) . '\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"not-image\">\n\t\t\t<td></td>\n\t\t\t<td>\n\t\t\t\t' . get_submit_button( __( 'Insert into Post' ), '', 'insertonlybutton', false ) . '\n\t\t\t</td>\n\t\t</tr>\n\t</tbody></table>';\n}\n\n/**\n * Displays the multi-file uploader message.\n *\n * @since 2.6.0\n *\n * @global int $post_ID\n */\nfunction media_upload_flash_bypass() {\n\t$browser_uploader = admin_url( 'media-new.php?browser-uploader' );\n\n\t$post = get_post();\n\tif ( $post ) {\n\t\t$browser_uploader .= '&amp;post_id=' . intval( $post->ID );\n\t} elseif ( ! empty( $GLOBALS['post_ID'] ) ) {\n\t\t$browser_uploader .= '&amp;post_id=' . intval( $GLOBALS['post_ID'] );\n\t}\n\n\t?>\n\t<p class=\"upload-flash-bypass\">\n\t<?php\n\t\tprintf(\n\t\t\t/* translators: 1: URL to browser uploader, 2: Additional link attributes. */\n\t\t\t__( 'You are using the multi-file uploader. Problems? Try the <a href=\"%1$s\" %2$s>browser uploader</a> instead.' ),\n\t\t\t$browser_uploader,\n\t\t\t'target=\"_blank\"'\n\t\t);\n\t?>\n\t</p>\n\t<?php\n}\n\n/**\n * Displays the browser's built-in uploader message.\n *\n * @since 2.6.0\n */\nfunction media_upload_html_bypass() {\n\t?>\n\t<p class=\"upload-html-bypass hide-if-no-js\">\n\t\t<?php _e( 'You are using the browser&#8217;s built-in file uploader. The WordPress uploader includes multiple file selection and drag and drop capability. <a href=\"#\">Switch to the multi-file uploader</a>.' ); ?>\n\t</p>\n\t<?php\n}\n\n/**\n * Used to display a \"After a file has been uploaded...\" help message.\n *\n * @since 3.3.0\n */\nfunction media_upload_text_after() {}\n\n/**\n * Displays the checkbox to scale images.\n *\n * @since 3.3.0\n */\nfunction media_upload_max_image_resize() {\n\t$checked = get_user_setting( 'upload_resize' ) ? ' checked=\"true\"' : '';\n\t$a       = '';\n\t$end     = '';\n\n\tif ( current_user_can( 'manage_options' ) ) {\n\t\t$a   = '<a href=\"' . esc_url( admin_url( 'options-media.php' ) ) . '\" target=\"_blank\">';\n\t\t$end = '</a>';\n\t}\n\n\t?>\n\t<p class=\"hide-if-no-js\"><label>\n\t<input name=\"image_resize\" type=\"checkbox\" id=\"image_resize\" value=\"true\"<?php echo $checked; ?> />\n\t<?php\n\t/* translators: 1: Link start tag, 2: Link end tag, 3: Width, 4: Height. */\n\tprintf( __( 'Scale images to match the large size selected in %1$simage options%2$s (%3$d &times; %4$d).' ), $a, $end, (int) get_option( 'large_size_w', '1024' ), (int) get_option( 'large_size_h', '1024' ) );\n\n\t?>\n\t</label></p>\n\t<?php\n}\n\n/**\n * Displays the out of storage quota message in Multisite.\n *\n * @since 3.5.0\n */\nfunction multisite_over_quota_message() {\n\techo '<p>' . sprintf(\n\t\t/* translators: %s: Allowed space allocation. */\n\t\t__( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.' ),\n\t\tsize_format( get_space_allowed() * MB_IN_BYTES )\n\t) . '</p>';\n}\n\n/**\n * Displays the image and editor in the post editor\n *\n * @since 3.5.0\n *\n * @param WP_Post $post A post object.\n */\nfunction edit_form_image_editor( $post ) {\n\t$open = isset( $_GET['image-editor'] );\n\n\tif ( $open ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/image-edit.php';\n\t}\n\n\t$thumb_url     = false;\n\t$attachment_id = intval( $post->ID );\n\n\tif ( $attachment_id ) {\n\t\t$thumb_url = wp_get_attachment_image_src( $attachment_id, array( 900, 450 ), true );\n\t}\n\n\t$alt_text = get_post_meta( $post->ID, '_wp_attachment_image_alt', true );\n\n\t$att_url = wp_get_attachment_url( $post->ID );\n\t?>\n\t<div class=\"wp_attachment_holder wp-clearfix\">\n\t<?php\n\n\tif ( wp_attachment_is_image( $post->ID ) ) :\n\t\t$image_edit_button = '';\n\t\tif ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) {\n\t\t\t$nonce             = wp_create_nonce( \"image_editor-$post->ID\" );\n\t\t\t$image_edit_button = \"<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \\\"$nonce\\\" )' class='button' value='\" . esc_attr__( 'Edit Image' ) . \"' /> <span class='spinner'></span>\";\n\t\t}\n\n\t\t$open_style     = '';\n\t\t$not_open_style = '';\n\n\t\tif ( $open ) {\n\t\t\t$open_style = ' style=\"display:none\"';\n\t\t} else {\n\t\t\t$not_open_style = ' style=\"display:none\"';\n\t\t}\n\n\t\t?>\n\t\t<div class=\"imgedit-response\" id=\"imgedit-response-<?php echo $attachment_id; ?>\"></div>\n\n\t\t<div<?php echo $open_style; ?> class=\"wp_attachment_image wp-clearfix\" id=\"media-head-<?php echo $attachment_id; ?>\">\n\t\t\t<p id=\"thumbnail-head-<?php echo $attachment_id; ?>\"><img class=\"thumbnail\" src=\"<?php echo set_url_scheme( $thumb_url[0] ); ?>\" style=\"max-width:100%\" alt=\"\" /></p>\n\t\t\t<p><?php echo $image_edit_button; ?></p>\n\t\t</div>\n\t\t<div<?php echo $not_open_style; ?> class=\"image-editor\" id=\"image-editor-<?php echo $attachment_id; ?>\">\n\t\t<?php\n\n\t\tif ( $open ) {\n\t\t\twp_image_editor( $attachment_id );\n\t\t}\n\n\t\t?>\n\t\t</div>\n\t\t<?php\n\telseif ( $attachment_id && wp_attachment_is( 'audio', $post ) ) :\n\n\t\twp_maybe_generate_attachment_metadata( $post );\n\n\t\techo wp_audio_shortcode( array( 'src' => $att_url ) );\n\n\telseif ( $attachment_id && wp_attachment_is( 'video', $post ) ) :\n\n\t\twp_maybe_generate_attachment_metadata( $post );\n\n\t\t$meta = wp_get_attachment_metadata( $attachment_id );\n\t\t$w    = ! empty( $meta['width'] ) ? min( $meta['width'], 640 ) : 0;\n\t\t$h    = ! empty( $meta['height'] ) ? $meta['height'] : 0;\n\n\t\tif ( $h && $w < $meta['width'] ) {\n\t\t\t$h = round( ( $meta['height'] * $w ) / $meta['width'] );\n\t\t}\n\n\t\t$attr = array( 'src' => $att_url );\n\n\t\tif ( ! empty( $w ) && ! empty( $h ) ) {\n\t\t\t$attr['width']  = $w;\n\t\t\t$attr['height'] = $h;\n\t\t}\n\n\t\t$thumb_id = get_post_thumbnail_id( $attachment_id );\n\n\t\tif ( ! empty( $thumb_id ) ) {\n\t\t\t$attr['poster'] = wp_get_attachment_url( $thumb_id );\n\t\t}\n\n\t\techo wp_video_shortcode( $attr );\n\n\telseif ( isset( $thumb_url[0] ) ) :\n\t\t?>\n\t\t<div class=\"wp_attachment_image wp-clearfix\" id=\"media-head-<?php echo $attachment_id; ?>\">\n\t\t\t<p id=\"thumbnail-head-<?php echo $attachment_id; ?>\">\n\t\t\t\t<img class=\"thumbnail\" src=\"<?php echo set_url_scheme( $thumb_url[0] ); ?>\" style=\"max-width:100%\" alt=\"\" />\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\n\telse :\n\n\t\t/**\n\t\t * Fires when an attachment type can't be rendered in the edit form.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param WP_Post $post A post object.\n\t\t */\n\t\tdo_action( 'wp_edit_form_attachment_display', $post );\n\n\tendif;\n\n\t?>\n\t</div>\n\t<div class=\"wp_attachment_details edit-form-section\">\n\t<?php if ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) : ?>\n\t\t<p class=\"attachment-alt-text\">\n\t\t\t<label for=\"attachment_alt\"><strong><?php _e( 'Alternative Text' ); ?></strong></label><br />\n\t\t\t<input type=\"text\" class=\"widefat\" name=\"_wp_attachment_image_alt\" id=\"attachment_alt\" aria-describedby=\"alt-text-description\" value=\"<?php echo esc_attr( $alt_text ); ?>\" />\n\t\t</p>\n\t\t<p class=\"attachment-alt-text-description\" id=\"alt-text-description\">\n\t\t<?php\n\n\t\tprintf(\n\t\t\t/* translators: 1: Link to tutorial, 2: Additional link attributes, 3: Accessibility text. */\n\t\t\t__( '<a href=\"%1$s\" %2$s>Describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),\n\t\t\tesc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ),\n\t\t\t'target=\"_blank\" rel=\"noopener noreferrer\"',\n\t\t\tsprintf(\n\t\t\t\t'<span class=\"screen-reader-text\"> %s</span>',\n\t\t\t\t/* translators: Accessibility text. */\n\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t)\n\t\t);\n\n\t\t?>\n\t\t</p>\n\t<?php endif; ?>\n\n\t\t<p>\n\t\t\t<label for=\"attachment_caption\"><strong><?php _e( 'Caption' ); ?></strong></label><br />\n\t\t\t<textarea class=\"widefat\" name=\"excerpt\" id=\"attachment_caption\"><?php echo $post->post_excerpt; ?></textarea>\n\t\t</p>\n\n\t<?php\n\n\t$quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );\n\t$editor_args        = array(\n\t\t'textarea_name' => 'content',\n\t\t'textarea_rows' => 5,\n\t\t'media_buttons' => false,\n\t\t'tinymce'       => false,\n\t\t'quicktags'     => $quicktags_settings,\n\t);\n\n\t?>\n\n\t<label for=\"attachment_content\" class=\"attachment-content-description\"><strong><?php _e( 'Description' ); ?></strong>\n\t<?php\n\n\tif ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) {\n\t\techo ': ' . __( 'Displayed on attachment pages.' );\n\t}\n\n\t?>\n\t</label>\n\t<?php wp_editor( format_to_edit( $post->post_content ), 'attachment_content', $editor_args ); ?>\n\n\t</div>\n\t<?php\n\n\t$extras = get_compat_media_markup( $post->ID );\n\techo $extras['item'];\n\techo '<input type=\"hidden\" id=\"image-edit-context\" value=\"edit-attachment\" />' . \"\\n\";\n}\n\n/**\n * Displays non-editable attachment metadata in the publish meta box.\n *\n * @since 3.5.0\n */\nfunction attachment_submitbox_metadata() {\n\t$post          = get_post();\n\t$attachment_id = $post->ID;\n\n\t$file     = get_attached_file( $attachment_id );\n\t$filename = esc_html( wp_basename( $file ) );\n\n\t$media_dims = '';\n\t$meta       = wp_get_attachment_metadata( $attachment_id );\n\n\tif ( isset( $meta['width'], $meta['height'] ) ) {\n\t\t$media_dims .= \"<span id='media-dims-$attachment_id'>{$meta['width']}&nbsp;&times;&nbsp;{$meta['height']}</span> \";\n\t}\n\t/** This filter is documented in wp-admin/includes/media.php */\n\t$media_dims = apply_filters( 'media_meta', $media_dims, $post );\n\n\t$att_url = wp_get_attachment_url( $attachment_id );\n\n\t?>\n\t<div class=\"misc-pub-section misc-pub-attachment\">\n\t\t<label for=\"attachment_url\"><?php _e( 'File URL:' ); ?></label>\n\t\t<input type=\"text\" class=\"widefat urlfield\" readonly=\"readonly\" name=\"attachment_url\" id=\"attachment_url\" value=\"<?php echo esc_attr( $att_url ); ?>\" />\n\t\t<span class=\"copy-to-clipboard-container\">\n\t\t\t<button type=\"button\" class=\"button copy-attachment-url edit-media\" data-clipboard-target=\"#attachment_url\"><?php _e( 'Copy URL' ); ?></button>\n\t\t\t<span class=\"success hidden\" aria-hidden=\"true\"><?php _e( 'Copied!' ); ?></span>\n\t\t</span>\n\t</div>\n\t<div class=\"misc-pub-section misc-pub-filename\">\n\t\t<?php _e( 'File name:' ); ?> <strong><?php echo $filename; ?></strong>\n\t</div>\n\t<div class=\"misc-pub-section misc-pub-filetype\">\n\t\t<?php _e( 'File type:' ); ?>\n\t\t<strong>\n\t\t<?php\n\n\t\tif ( preg_match( '/^.*?\\.(\\w+)$/', get_attached_file( $post->ID ), $matches ) ) {\n\t\t\techo esc_html( strtoupper( $matches[1] ) );\n\t\t\tlist( $mime_type ) = explode( '/', $post->post_mime_type );\n\t\t\tif ( 'image' !== $mime_type && ! empty( $meta['mime_type'] ) ) {\n\t\t\t\tif ( \"$mime_type/\" . strtolower( $matches[1] ) !== $meta['mime_type'] ) {\n\t\t\t\t\techo ' (' . $meta['mime_type'] . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\techo strtoupper( str_replace( 'image/', '', $post->post_mime_type ) );\n\t\t}\n\n\t\t?>\n\t\t</strong>\n\t</div>\n\n\t<?php\n\n\t$file_size = false;\n\n\tif ( isset( $meta['filesize'] ) ) {\n\t\t$file_size = $meta['filesize'];\n\t} elseif ( file_exists( $file ) ) {\n\t\t$file_size = filesize( $file );\n\t}\n\n\tif ( ! empty( $file_size ) ) {\n\t\t?>\n\t\t<div class=\"misc-pub-section misc-pub-filesize\">\n\t\t\t<?php _e( 'File size:' ); ?> <strong><?php echo size_format( $file_size ); ?></strong>\n\t\t</div>\n\t\t<?php\n\t}\n\n\tif ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) {\n\t\t$fields = array(\n\t\t\t'length_formatted' => __( 'Length:' ),\n\t\t\t'bitrate'          => __( 'Bitrate:' ),\n\t\t);\n\n\t\t/**\n\t\t * Filters the audio and video metadata fields to be shown in the publish meta box.\n\t\t *\n\t\t * The key for each item in the array should correspond to an attachment\n\t\t * metadata key, and the value should be the desired label.\n\t\t *\n\t\t * @since 3.7.0\n\t\t * @since 4.9.0 Added the `$post` parameter.\n\t\t *\n\t\t * @param array   $fields An array of the attachment metadata keys and labels.\n\t\t * @param WP_Post $post   WP_Post object for the current attachment.\n\t\t */\n\t\t$fields = apply_filters( 'media_submitbox_misc_sections', $fields, $post );\n\n\t\tforeach ( $fields as $key => $label ) {\n\t\t\tif ( empty( $meta[ $key ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t?>\n\t\t\t<div class=\"misc-pub-section misc-pub-mime-meta misc-pub-<?php echo sanitize_html_class( $key ); ?>\">\n\t\t\t\t<?php echo $label; ?>\n\t\t\t\t<strong>\n\t\t\t\t<?php\n\n\t\t\t\tswitch ( $key ) {\n\t\t\t\t\tcase 'bitrate':\n\t\t\t\t\t\techo round( $meta['bitrate'] / 1000 ) . 'kb/s';\n\t\t\t\t\t\tif ( ! empty( $meta['bitrate_mode'] ) ) {\n\t\t\t\t\t\t\techo ' ' . strtoupper( esc_html( $meta['bitrate_mode'] ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\techo esc_html( $meta[ $key ] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t?>\n\t\t\t\t</strong>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\n\t\t$fields = array(\n\t\t\t'dataformat' => __( 'Audio Format:' ),\n\t\t\t'codec'      => __( 'Audio Codec:' ),\n\t\t);\n\n\t\t/**\n\t\t * Filters the audio attachment metadata fields to be shown in the publish meta box.\n\t\t *\n\t\t * The key for each item in the array should correspond to an attachment\n\t\t * metadata key, and the value should be the desired label.\n\t\t *\n\t\t * @since 3.7.0\n\t\t * @since 4.9.0 Added the `$post` parameter.\n\t\t *\n\t\t * @param array   $fields An array of the attachment metadata keys and labels.\n\t\t * @param WP_Post $post   WP_Post object for the current attachment.\n\t\t */\n\t\t$audio_fields = apply_filters( 'audio_submitbox_misc_sections', $fields, $post );\n\n\t\tforeach ( $audio_fields as $key => $label ) {\n\t\t\tif ( empty( $meta['audio'][ $key ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t?>\n\t\t\t<div class=\"misc-pub-section misc-pub-audio misc-pub-<?php echo sanitize_html_class( $key ); ?>\">\n\t\t\t\t<?php echo $label; ?> <strong><?php echo esc_html( $meta['audio'][ $key ] ); ?></strong>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}\n\n\tif ( $media_dims ) {\n\t\t?>\n\t\t<div class=\"misc-pub-section misc-pub-dimensions\">\n\t\t\t<?php _e( 'Dimensions:' ); ?> <strong><?php echo $media_dims; ?></strong>\n\t\t</div>\n\t\t<?php\n\t}\n\n\tif ( ! empty( $meta['original_image'] ) ) {\n\t\t?>\n\t\t<div class=\"misc-pub-section misc-pub-original-image\">\n\t\t\t<?php _e( 'Original image:' ); ?>\n\t\t\t<a href=\"<?php echo esc_url( wp_get_original_image_url( $attachment_id ) ); ?>\">\n\t\t\t\t<?php echo esc_html( wp_basename( wp_get_original_image_path( $attachment_id ) ) ); ?>\n\t\t\t</a>\n\t\t</div>\n\t\t<?php\n\t}\n}\n\n/**\n * Parse ID3v2, ID3v1, and getID3 comments to extract usable data\n *\n * @since 3.6.0\n *\n * @param array $metadata An existing array with data\n * @param array $data Data supplied by ID3 tags\n */\nfunction wp_add_id3_tag_data( &$metadata, $data ) {\n\tforeach ( array( 'id3v2', 'id3v1' ) as $version ) {\n\t\tif ( ! empty( $data[ $version ]['comments'] ) ) {\n\t\t\tforeach ( $data[ $version ]['comments'] as $key => $list ) {\n\t\t\t\tif ( 'length' !== $key && ! empty( $list ) ) {\n\t\t\t\t\t$metadata[ $key ] = wp_kses_post( reset( $list ) );\n\t\t\t\t\t// Fix bug in byte stream analysis.\n\t\t\t\t\tif ( 'terms_of_use' === $key && 0 === strpos( $metadata[ $key ], 'yright notice.' ) ) {\n\t\t\t\t\t\t$metadata[ $key ] = 'Cop' . $metadata[ $key ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ( ! empty( $data['id3v2']['APIC'] ) ) {\n\t\t$image = reset( $data['id3v2']['APIC'] );\n\t\tif ( ! empty( $image['data'] ) ) {\n\t\t\t$metadata['image'] = array(\n\t\t\t\t'data'   => $image['data'],\n\t\t\t\t'mime'   => $image['image_mime'],\n\t\t\t\t'width'  => $image['image_width'],\n\t\t\t\t'height' => $image['image_height'],\n\t\t\t);\n\t\t}\n\t} elseif ( ! empty( $data['comments']['picture'] ) ) {\n\t\t$image = reset( $data['comments']['picture'] );\n\t\tif ( ! empty( $image['data'] ) ) {\n\t\t\t$metadata['image'] = array(\n\t\t\t\t'data' => $image['data'],\n\t\t\t\t'mime' => $image['image_mime'],\n\t\t\t);\n\t\t}\n\t}\n}\n\n/**\n * Retrieve metadata from a video file's ID3 tags\n *\n * @since 3.6.0\n *\n * @param string $file Path to file.\n * @return array|bool Returns array of metadata, if found.\n */\nfunction wp_read_video_metadata( $file ) {\n\tif ( ! file_exists( $file ) ) {\n\t\treturn false;\n\t}\n\n\t$metadata = array();\n\n\tif ( ! defined( 'GETID3_TEMP_DIR' ) ) {\n\t\tdefine( 'GETID3_TEMP_DIR', get_temp_dir() );\n\t}\n\n\tif ( ! class_exists( 'getID3', false ) ) {\n\t\trequire ABSPATH . WPINC . '/ID3/getid3.php';\n\t}\n\n\t$id3  = new getID3();\n\t$data = $id3->analyze( $file );\n\n\tif ( isset( $data['video']['lossless'] ) ) {\n\t\t$metadata['lossless'] = $data['video']['lossless'];\n\t}\n\n\tif ( ! empty( $data['video']['bitrate'] ) ) {\n\t\t$metadata['bitrate'] = (int) $data['video']['bitrate'];\n\t}\n\n\tif ( ! empty( $data['video']['bitrate_mode'] ) ) {\n\t\t$metadata['bitrate_mode'] = $data['video']['bitrate_mode'];\n\t}\n\n\tif ( ! empty( $data['filesize'] ) ) {\n\t\t$metadata['filesize'] = (int) $data['filesize'];\n\t}\n\n\tif ( ! empty( $data['mime_type'] ) ) {\n\t\t$metadata['mime_type'] = $data['mime_type'];\n\t}\n\n\tif ( ! empty( $data['playtime_seconds'] ) ) {\n\t\t$metadata['length'] = (int) round( $data['playtime_seconds'] );\n\t}\n\n\tif ( ! empty( $data['playtime_string'] ) ) {\n\t\t$metadata['length_formatted'] = $data['playtime_string'];\n\t}\n\n\tif ( ! empty( $data['video']['resolution_x'] ) ) {\n\t\t$metadata['width'] = (int) $data['video']['resolution_x'];\n\t}\n\n\tif ( ! empty( $data['video']['resolution_y'] ) ) {\n\t\t$metadata['height'] = (int) $data['video']['resolution_y'];\n\t}\n\n\tif ( ! empty( $data['fileformat'] ) ) {\n\t\t$metadata['fileformat'] = $data['fileformat'];\n\t}\n\n\tif ( ! empty( $data['video']['dataformat'] ) ) {\n\t\t$metadata['dataformat'] = $data['video']['dataformat'];\n\t}\n\n\tif ( ! empty( $data['video']['encoder'] ) ) {\n\t\t$metadata['encoder'] = $data['video']['encoder'];\n\t}\n\n\tif ( ! empty( $data['video']['codec'] ) ) {\n\t\t$metadata['codec'] = $data['video']['codec'];\n\t}\n\n\tif ( ! empty( $data['audio'] ) ) {\n\t\tunset( $data['audio']['streams'] );\n\t\t$metadata['audio'] = $data['audio'];\n\t}\n\n\tif ( empty( $metadata['created_timestamp'] ) ) {\n\t\t$created_timestamp = wp_get_media_creation_timestamp( $data );\n\n\t\tif ( false !== $created_timestamp ) {\n\t\t\t$metadata['created_timestamp'] = $created_timestamp;\n\t\t}\n\t}\n\n\twp_add_id3_tag_data( $metadata, $data );\n\n\t$file_format = isset( $metadata['fileformat'] ) ? $metadata['fileformat'] : null;\n\n\t/**\n\t * Filters the array of metadata retrieved from a video.\n\t *\n\t * In core, usually this selection is what is stored.\n\t * More complete data can be parsed from the `$data` parameter.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param array  $metadata       Filtered Video metadata.\n\t * @param string $file           Path to video file.\n\t * @param string $file_format    File format of video, as analyzed by getID3.\n\t * @param string $data           Raw metadata from getID3.\n\t */\n\treturn apply_filters( 'wp_read_video_metadata', $metadata, $file, $file_format, $data );\n}\n\n/**\n * Retrieve metadata from an audio file's ID3 tags.\n *\n * @since 3.6.0\n *\n * @param string $file Path to file.\n * @return array|bool Returns array of metadata, if found.\n */\nfunction wp_read_audio_metadata( $file ) {\n\tif ( ! file_exists( $file ) ) {\n\t\treturn false;\n\t}\n\n\t$metadata = array();\n\n\tif ( ! defined( 'GETID3_TEMP_DIR' ) ) {\n\t\tdefine( 'GETID3_TEMP_DIR', get_temp_dir() );\n\t}\n\n\tif ( ! class_exists( 'getID3', false ) ) {\n\t\trequire ABSPATH . WPINC . '/ID3/getid3.php';\n\t}\n\n\t$id3  = new getID3();\n\t$data = $id3->analyze( $file );\n\n\tif ( ! empty( $data['audio'] ) ) {\n\t\tunset( $data['audio']['streams'] );\n\t\t$metadata = $data['audio'];\n\t}\n\n\tif ( ! empty( $data['fileformat'] ) ) {\n\t\t$metadata['fileformat'] = $data['fileformat'];\n\t}\n\n\tif ( ! empty( $data['filesize'] ) ) {\n\t\t$metadata['filesize'] = (int) $data['filesize'];\n\t}\n\n\tif ( ! empty( $data['mime_type'] ) ) {\n\t\t$metadata['mime_type'] = $data['mime_type'];\n\t}\n\n\tif ( ! empty( $data['playtime_seconds'] ) ) {\n\t\t$metadata['length'] = (int) round( $data['playtime_seconds'] );\n\t}\n\n\tif ( ! empty( $data['playtime_string'] ) ) {\n\t\t$metadata['length_formatted'] = $data['playtime_string'];\n\t}\n\n\tif ( empty( $metadata['created_timestamp'] ) ) {\n\t\t$created_timestamp = wp_get_media_creation_timestamp( $data );\n\n\t\tif ( false !== $created_timestamp ) {\n\t\t\t$metadata['created_timestamp'] = $created_timestamp;\n\t\t}\n\t}\n\n\twp_add_id3_tag_data( $metadata, $data );\n\n\treturn $metadata;\n}\n\n/**\n * Parse creation date from media metadata.\n *\n * The getID3 library doesn't have a standard method for getting creation dates,\n * so the location of this data can vary based on the MIME type.\n *\n * @since 4.9.0\n *\n * @link https://github.com/JamesHeinrich/getID3/blob/master/structure.txt\n *\n * @param array $metadata The metadata returned by getID3::analyze().\n * @return int|bool A UNIX timestamp for the media's creation date if available\n *                  or a boolean FALSE if a timestamp could not be determined.\n */\nfunction wp_get_media_creation_timestamp( $metadata ) {\n\t$creation_date = false;\n\n\tif ( empty( $metadata['fileformat'] ) ) {\n\t\treturn $creation_date;\n\t}\n\n\tswitch ( $metadata['fileformat'] ) {\n\t\tcase 'asf':\n\t\t\tif ( isset( $metadata['asf']['file_properties_object']['creation_date_unix'] ) ) {\n\t\t\t\t$creation_date = (int) $metadata['asf']['file_properties_object']['creation_date_unix'];\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'matroska':\n\t\tcase 'webm':\n\t\t\tif ( isset( $metadata['matroska']['comments']['creation_time']['0'] ) ) {\n\t\t\t\t$creation_date = strtotime( $metadata['matroska']['comments']['creation_time']['0'] );\n\t\t\t} elseif ( isset( $metadata['matroska']['info']['0']['DateUTC_unix'] ) ) {\n\t\t\t\t$creation_date = (int) $metadata['matroska']['info']['0']['DateUTC_unix'];\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'quicktime':\n\t\tcase 'mp4':\n\t\t\tif ( isset( $metadata['quicktime']['moov']['subatoms']['0']['creation_time_unix'] ) ) {\n\t\t\t\t$creation_date = (int) $metadata['quicktime']['moov']['subatoms']['0']['creation_time_unix'];\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\treturn $creation_date;\n}\n\n/**\n * Encapsulates the logic for Attach/Detach actions.\n *\n * @since 4.2.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int    $parent_id Attachment parent ID.\n * @param string $action    Optional. Attach/detach action. Accepts 'attach' or 'detach'.\n *                          Default 'attach'.\n */\nfunction wp_media_attach_action( $parent_id, $action = 'attach' ) {\n\tglobal $wpdb;\n\n\tif ( ! $parent_id ) {\n\t\treturn;\n\t}\n\n\tif ( ! current_user_can( 'edit_post', $parent_id ) ) {\n\t\twp_die( __( 'Sorry, you are not allowed to edit this post.' ) );\n\t}\n\n\t$ids = array();\n\n\tforeach ( (array) $_REQUEST['media'] as $attachment_id ) {\n\t\t$attachment_id = (int) $attachment_id;\n\n\t\tif ( ! current_user_can( 'edit_post', $attachment_id ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$ids[] = $attachment_id;\n\t}\n\n\tif ( ! empty( $ids ) ) {\n\t\t$ids_string = implode( ',', $ids );\n\n\t\tif ( 'attach' === $action ) {\n\t\t\t$result = $wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET post_parent = %d WHERE post_type = 'attachment' AND ID IN ( $ids_string )\", $parent_id ) );\n\t\t} else {\n\t\t\t$result = $wpdb->query( \"UPDATE $wpdb->posts SET post_parent = 0 WHERE post_type = 'attachment' AND ID IN ( $ids_string )\" );\n\t\t}\n\t}\n\n\tif ( isset( $result ) ) {\n\t\tforeach ( $ids as $attachment_id ) {\n\t\t\t/**\n\t\t\t * Fires when media is attached or detached from a post.\n\t\t\t *\n\t\t\t * @since 5.5.0\n\t\t\t *\n\t\t\t * @param string $action        Attach/detach action. Accepts 'attach' or 'detach'.\n\t\t\t * @param int    $attachment_id The attachment ID.\n\t\t\t * @param int    $parent_id     Attachment parent ID.\n\t\t\t */\n\t\t\tdo_action( 'wp_media_attach_action', $action, $attachment_id, $parent_id );\n\n\t\t\tclean_attachment_cache( $attachment_id );\n\t\t}\n\n\t\t$location = 'upload.php';\n\t\t$referer  = wp_get_referer();\n\n\t\tif ( $referer ) {\n\t\t\tif ( false !== strpos( $referer, 'upload.php' ) ) {\n\t\t\t\t$location = remove_query_arg( array( 'attached', 'detach' ), $referer );\n\t\t\t}\n\t\t}\n\n\t\t$key      = 'attach' === $action ? 'attached' : 'detach';\n\t\t$location = add_query_arg( array( $key => $result ), $location );\n\n\t\twp_redirect( $location );\n\t\texit;\n\t}\n}\n", "num_lines": 3763}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Build Administration Menu.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\nif ( is_network_admin() ) {\n\n\t/**\n\t * Fires before the administration menu loads in the Network Admin.\n\t *\n\t * The hook fires before menus and sub-menus are removed based on user privileges.\n\t *\n\t * @private\n\t * @since 3.1.0\n\t */\n\tdo_action( '_network_admin_menu' );\n} elseif ( is_user_admin() ) {\n\n\t/**\n\t * Fires before the administration menu loads in the User Admin.\n\t *\n\t * The hook fires before menus and sub-menus are removed based on user privileges.\n\t *\n\t * @private\n\t * @since 3.1.0\n\t */\n\tdo_action( '_user_admin_menu' );\n} else {\n\n\t/**\n\t * Fires before the administration menu loads in the admin.\n\t *\n\t * The hook fires before menus and sub-menus are removed based on user privileges.\n\t *\n\t * @private\n\t * @since 2.2.0\n\t */\n\tdo_action( '_admin_menu' );\n}\n\n// Create list of page plugin hook names.\nforeach ( $menu as $menu_page ) {\n\t$pos = strpos( $menu_page[2], '?' );\n\tif ( false !== $pos ) {\n\t\t// Handle post_type=post|page|foo pages.\n\t\t$hook_name = substr( $menu_page[2], 0, $pos );\n\t\t$hook_args = substr( $menu_page[2], $pos + 1 );\n\t\twp_parse_str( $hook_args, $hook_args );\n\t\t// Set the hook name to be the post type.\n\t\tif ( isset( $hook_args['post_type'] ) ) {\n\t\t\t$hook_name = $hook_args['post_type'];\n\t\t} else {\n\t\t\t$hook_name = basename( $hook_name, '.php' );\n\t\t}\n\t\tunset( $hook_args );\n\t} else {\n\t\t$hook_name = basename( $menu_page[2], '.php' );\n\t}\n\t$hook_name = sanitize_title( $hook_name );\n\n\tif ( isset( $compat[ $hook_name ] ) ) {\n\t\t$hook_name = $compat[ $hook_name ];\n\t} elseif ( ! $hook_name ) {\n\t\tcontinue;\n\t}\n\n\t$admin_page_hooks[ $menu_page[2] ] = $hook_name;\n}\nunset( $menu_page, $compat );\n\n$_wp_submenu_nopriv = array();\n$_wp_menu_nopriv    = array();\n// Loop over submenus and remove pages for which the user does not have privs.\nforeach ( $submenu as $parent => $sub ) {\n\tforeach ( $sub as $index => $data ) {\n\t\tif ( ! current_user_can( $data[1] ) ) {\n\t\t\tunset( $submenu[ $parent ][ $index ] );\n\t\t\t$_wp_submenu_nopriv[ $parent ][ $data[2] ] = true;\n\t\t}\n\t}\n\tunset( $index, $data );\n\n\tif ( empty( $submenu[ $parent ] ) ) {\n\t\tunset( $submenu[ $parent ] );\n\t}\n}\nunset( $sub, $parent );\n\n/*\n * Loop over the top-level menu.\n * Menus for which the original parent is not accessible due to lack of privileges\n * will have the next submenu in line be assigned as the new menu parent.\n */\nforeach ( $menu as $id => $data ) {\n\tif ( empty( $submenu[ $data[2] ] ) ) {\n\t\tcontinue;\n\t}\n\t$subs       = $submenu[ $data[2] ];\n\t$first_sub  = reset( $subs );\n\t$old_parent = $data[2];\n\t$new_parent = $first_sub[2];\n\t/*\n\t * If the first submenu is not the same as the assigned parent,\n\t * make the first submenu the new parent.\n\t */\n\tif ( $new_parent != $old_parent ) {\n\t\t$_wp_real_parent_file[ $old_parent ] = $new_parent;\n\t\t$menu[ $id ][2]                      = $new_parent;\n\n\t\tforeach ( $submenu[ $old_parent ] as $index => $data ) {\n\t\t\t$submenu[ $new_parent ][ $index ] = $submenu[ $old_parent ][ $index ];\n\t\t\tunset( $submenu[ $old_parent ][ $index ] );\n\t\t}\n\t\tunset( $submenu[ $old_parent ], $index );\n\n\t\tif ( isset( $_wp_submenu_nopriv[ $old_parent ] ) ) {\n\t\t\t$_wp_submenu_nopriv[ $new_parent ] = $_wp_submenu_nopriv[ $old_parent ];\n\t\t}\n\t}\n}\nunset( $id, $data, $subs, $first_sub, $old_parent, $new_parent );\n\nif ( is_network_admin() ) {\n\n\t/**\n\t * Fires before the administration menu loads in the Network Admin.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $context Empty context.\n\t */\n\tdo_action( 'network_admin_menu', '' );\n} elseif ( is_user_admin() ) {\n\n\t/**\n\t * Fires before the administration menu loads in the User Admin.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $context Empty context.\n\t */\n\tdo_action( 'user_admin_menu', '' );\n} else {\n\n\t/**\n\t * Fires before the administration menu loads in the admin.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $context Empty context.\n\t */\n\tdo_action( 'admin_menu', '' );\n}\n\n/*\n * Remove menus that have no accessible submenus and require privileges\n * that the user does not have. Run re-parent loop again.\n */\nforeach ( $menu as $id => $data ) {\n\tif ( ! current_user_can( $data[1] ) ) {\n\t\t$_wp_menu_nopriv[ $data[2] ] = true;\n\t}\n\n\t/*\n\t * If there is only one submenu and it is has same destination as the parent,\n\t * remove the submenu.\n\t */\n\tif ( ! empty( $submenu[ $data[2] ] ) && 1 === count( $submenu[ $data[2] ] ) ) {\n\t\t$subs      = $submenu[ $data[2] ];\n\t\t$first_sub = reset( $subs );\n\t\tif ( $data[2] == $first_sub[2] ) {\n\t\t\tunset( $submenu[ $data[2] ] );\n\t\t}\n\t}\n\n\t// If submenu is empty...\n\tif ( empty( $submenu[ $data[2] ] ) ) {\n\t\t// And user doesn't have privs, remove menu.\n\t\tif ( isset( $_wp_menu_nopriv[ $data[2] ] ) ) {\n\t\t\tunset( $menu[ $id ] );\n\t\t}\n\t}\n}\nunset( $id, $data, $subs, $first_sub );\n\n/**\n * @param string $add\n * @param string $class\n * @return string\n */\nfunction add_cssclass( $add, $class ) {\n\t$class = empty( $class ) ? $add : $class .= ' ' . $add;\n\treturn $class;\n}\n\n/**\n * @param array $menu\n * @return array\n */\nfunction add_menu_classes( $menu ) {\n\t$first     = false;\n\t$lastorder = false;\n\t$i         = 0;\n\t$mc        = count( $menu );\n\tforeach ( $menu as $order => $top ) {\n\t\t$i++;\n\n\t\tif ( 0 == $order ) { // Dashboard is always shown/single.\n\t\t\t$menu[0][4] = add_cssclass( 'menu-top-first', $top[4] );\n\t\t\t$lastorder  = 0;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( 0 === strpos( $top[2], 'separator' ) && false !== $lastorder ) { // If separator.\n\t\t\t$first                 = true;\n\t\t\t$c                     = $menu[ $lastorder ][4];\n\t\t\t$menu[ $lastorder ][4] = add_cssclass( 'menu-top-last', $c );\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( $first ) {\n\t\t\t$c                 = $menu[ $order ][4];\n\t\t\t$menu[ $order ][4] = add_cssclass( 'menu-top-first', $c );\n\t\t\t$first             = false;\n\t\t}\n\n\t\tif ( $mc == $i ) { // Last item.\n\t\t\t$c                 = $menu[ $order ][4];\n\t\t\t$menu[ $order ][4] = add_cssclass( 'menu-top-last', $c );\n\t\t}\n\n\t\t$lastorder = $order;\n\t}\n\n\t/**\n\t * Filters administration menus array with classes added for top-level items.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param array $menu Associative array of administration menu items.\n\t */\n\treturn apply_filters( 'add_menu_classes', $menu );\n}\n\nuksort( $menu, 'strnatcasecmp' ); // Make it all pretty.\n\n/**\n * Filters whether to enable custom ordering of the administration menu.\n *\n * See the {@see 'menu_order'} filter for reordering menu items.\n *\n * @since 2.8.0\n *\n * @param bool $custom Whether custom ordering is enabled. Default false.\n */\nif ( apply_filters( 'custom_menu_order', false ) ) {\n\t$menu_order = array();\n\tforeach ( $menu as $menu_item ) {\n\t\t$menu_order[] = $menu_item[2];\n\t}\n\tunset( $menu_item );\n\t$default_menu_order = $menu_order;\n\n\t/**\n\t * Filters the order of administration menu items.\n\t *\n\t * A truthy value must first be passed to the {@see 'custom_menu_order'} filter\n\t * for this filter to work. Use the following to enable custom menu ordering:\n\t *\n\t *     add_filter( 'custom_menu_order', '__return_true' );\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $menu_order An ordered array of menu items.\n\t */\n\t$menu_order         = apply_filters( 'menu_order', $menu_order );\n\t$menu_order         = array_flip( $menu_order );\n\t$default_menu_order = array_flip( $default_menu_order );\n\n\t/**\n\t * @global array $menu_order\n\t * @global array $default_menu_order\n\t *\n\t * @param array $a\n\t * @param array $b\n\t * @return int\n\t */\n\tfunction sort_menu( $a, $b ) {\n\t\tglobal $menu_order, $default_menu_order;\n\t\t$a = $a[2];\n\t\t$b = $b[2];\n\t\tif ( isset( $menu_order[ $a ] ) && ! isset( $menu_order[ $b ] ) ) {\n\t\t\treturn -1;\n\t\t} elseif ( ! isset( $menu_order[ $a ] ) && isset( $menu_order[ $b ] ) ) {\n\t\t\treturn 1;\n\t\t} elseif ( isset( $menu_order[ $a ] ) && isset( $menu_order[ $b ] ) ) {\n\t\t\tif ( $menu_order[ $a ] == $menu_order[ $b ] ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn ( $menu_order[ $a ] < $menu_order[ $b ] ) ? -1 : 1;\n\t\t} else {\n\t\t\treturn ( $default_menu_order[ $a ] <= $default_menu_order[ $b ] ) ? -1 : 1;\n\t\t}\n\t}\n\n\tusort( $menu, 'sort_menu' );\n\tunset( $menu_order, $default_menu_order );\n}\n\n// Prevent adjacent separators.\n$prev_menu_was_separator = false;\nforeach ( $menu as $id => $data ) {\n\tif ( false === stristr( $data[4], 'wp-menu-separator' ) ) {\n\n\t\t// This item is not a separator, so falsey the toggler and do nothing.\n\t\t$prev_menu_was_separator = false;\n\t} else {\n\n\t\t// The previous item was a separator, so unset this one.\n\t\tif ( true === $prev_menu_was_separator ) {\n\t\t\tunset( $menu[ $id ] );\n\t\t}\n\n\t\t// This item is a separator, so truthy the toggler and move on.\n\t\t$prev_menu_was_separator = true;\n\t}\n}\nunset( $id, $data, $prev_menu_was_separator );\n\n// Remove the last menu item if it is a separator.\n$last_menu_key = array_keys( $menu );\n$last_menu_key = array_pop( $last_menu_key );\nif ( ! empty( $menu ) && 'wp-menu-separator' === $menu[ $last_menu_key ][4] ) {\n\tunset( $menu[ $last_menu_key ] );\n}\nunset( $last_menu_key );\n\nif ( ! user_can_access_admin_page() ) {\n\n\t/**\n\t * Fires when access to an admin page is denied.\n\t *\n\t * @since 2.5.0\n\t */\n\tdo_action( 'admin_page_access_denied' );\n\n\twp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );\n}\n\n$menu = add_menu_classes( $menu );\n", "num_lines": 354}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Administration Meta Boxes API.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n//\n// Post-related Meta Boxes.\n//\n\n/**\n * Displays post submit form fields.\n *\n * @since 2.7.0\n *\n * @global string $action\n *\n * @param WP_Post $post Current post object.\n * @param array   $args {\n *     Array of arguments for building the post submit meta box.\n *\n *     @type string   $id       Meta box 'id' attribute.\n *     @type string   $title    Meta box title.\n *     @type callable $callback Meta box display callback.\n *     @type array    $args     Extra meta box arguments.\n * }\n */\nfunction post_submit_meta_box( $post, $args = array() ) {\n\tglobal $action;\n\n\t$post_id          = (int) $post->ID;\n\t$post_type        = $post->post_type;\n\t$post_type_object = get_post_type_object( $post_type );\n\t$can_publish      = current_user_can( $post_type_object->cap->publish_posts );\n\t?>\n<div class=\"submitbox\" id=\"submitpost\">\n\n<div id=\"minor-publishing\">\n\n\t<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key. ?>\n\t<div style=\"display:none;\">\n\t\t<?php submit_button( __( 'Save' ), '', 'save' ); ?>\n\t</div>\n\n\t<div id=\"minor-publishing-actions\">\n\t\t<div id=\"save-action\">\n\t\t\t<?php\n\t\t\tif ( ! in_array( $post->post_status, array( 'publish', 'future', 'pending' ), true ) ) {\n\t\t\t\t$private_style = '';\n\t\t\t\tif ( 'private' === $post->post_status ) {\n\t\t\t\t\t$private_style = 'style=\"display:none\"';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<input <?php echo $private_style; ?> type=\"submit\" name=\"save\" id=\"save-post\" value=\"<?php esc_attr_e( 'Save Draft' ); ?>\" class=\"button\" />\n\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t<?php } elseif ( 'pending' === $post->post_status && $can_publish ) { ?>\n\t\t\t\t<input type=\"submit\" name=\"save\" id=\"save-post\" value=\"<?php esc_attr_e( 'Save as Pending' ); ?>\" class=\"button\" />\n\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t<?php } ?>\n\t\t</div>\n\n\t\t<?php\n\t\tif ( is_post_type_viewable( $post_type_object ) ) :\n\t\t\t?>\n\t\t\t<div id=\"preview-action\">\n\t\t\t\t<?php\n\t\t\t\t$preview_link = esc_url( get_preview_post_link( $post ) );\n\t\t\t\tif ( 'publish' === $post->post_status ) {\n\t\t\t\t\t$preview_button_text = __( 'Preview Changes' );\n\t\t\t\t} else {\n\t\t\t\t\t$preview_button_text = __( 'Preview' );\n\t\t\t\t}\n\n\t\t\t\t$preview_button = sprintf(\n\t\t\t\t\t'%1$s<span class=\"screen-reader-text\"> %2$s</span>',\n\t\t\t\t\t$preview_button_text,\n\t\t\t\t\t/* translators: Accessibility text. */\n\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t<a class=\"preview button\" href=\"<?php echo $preview_link; ?>\" target=\"wp-preview-<?php echo $post_id; ?>\" id=\"post-preview\"><?php echo $preview_button; ?></a>\n\t\t\t\t<input type=\"hidden\" name=\"wp-preview\" id=\"wp-preview\" value=\"\" />\n\t\t\t</div>\n\t\t\t<?php\n\t\tendif;\n\n\t\t/**\n\t\t * Fires before the post time/date setting in the Publish meta box.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param WP_Post $post WP_Post object for the current post.\n\t\t */\n\t\tdo_action( 'post_submitbox_minor_actions', $post );\n\t\t?>\n\t\t<div class=\"clear\"></div>\n\t</div>\n\n\t<div id=\"misc-publishing-actions\">\n\t\t<div class=\"misc-pub-section misc-pub-post-status\">\n\t\t\t<?php _e( 'Status:' ); ?>\n\t\t\t<span id=\"post-status-display\">\n\t\t\t\t<?php\n\t\t\t\tswitch ( $post->post_status ) {\n\t\t\t\t\tcase 'private':\n\t\t\t\t\t\t_e( 'Privately Published' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'publish':\n\t\t\t\t\t\t_e( 'Published' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'future':\n\t\t\t\t\t\t_e( 'Scheduled' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'pending':\n\t\t\t\t\t\t_e( 'Pending Review' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'draft':\n\t\t\t\t\tcase 'auto-draft':\n\t\t\t\t\t\t_e( 'Draft' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</span>\n\n\t\t\t<?php\n\t\t\tif ( 'publish' === $post->post_status || 'private' === $post->post_status || $can_publish ) {\n\t\t\t\t$private_style = '';\n\t\t\t\tif ( 'private' === $post->post_status ) {\n\t\t\t\t\t$private_style = 'style=\"display:none\"';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<a href=\"#post_status\" <?php echo $private_style; ?> class=\"edit-post-status hide-if-no-js\" role=\"button\"><span aria-hidden=\"true\"><?php _e( 'Edit' ); ?></span> <span class=\"screen-reader-text\"><?php _e( 'Edit status' ); ?></span></a>\n\n\t\t\t\t<div id=\"post-status-select\" class=\"hide-if-js\">\n\t\t\t\t\t<input type=\"hidden\" name=\"hidden_post_status\" id=\"hidden_post_status\" value=\"<?php echo esc_attr( ( 'auto-draft' === $post->post_status ) ? 'draft' : $post->post_status ); ?>\" />\n\t\t\t\t\t<label for=\"post_status\" class=\"screen-reader-text\"><?php _e( 'Set status' ); ?></label>\n\t\t\t\t\t<select name=\"post_status\" id=\"post_status\">\n\t\t\t\t\t\t<?php if ( 'publish' === $post->post_status ) : ?>\n\t\t\t\t\t\t\t<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e( 'Published' ); ?></option>\n\t\t\t\t\t\t<?php elseif ( 'private' === $post->post_status ) : ?>\n\t\t\t\t\t\t\t<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e( 'Privately Published' ); ?></option>\n\t\t\t\t\t\t<?php elseif ( 'future' === $post->post_status ) : ?>\n\t\t\t\t\t\t\t<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e( 'Scheduled' ); ?></option>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e( 'Pending Review' ); ?></option>\n\t\t\t\t\t\t<?php if ( 'auto-draft' === $post->post_status ) : ?>\n\t\t\t\t\t\t\t<option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option>\n\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t</select>\n\t\t\t\t\t<a href=\"#post_status\" class=\"save-post-status hide-if-no-js button\"><?php _e( 'OK' ); ?></a>\n\t\t\t\t\t<a href=\"#post_status\" class=\"cancel-post-status hide-if-no-js button-cancel\"><?php _e( 'Cancel' ); ?></a>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\n\t\t<div class=\"misc-pub-section misc-pub-visibility\" id=\"visibility\">\n\t\t\t<?php _e( 'Visibility:' ); ?>\n\t\t\t<span id=\"post-visibility-display\">\n\t\t\t\t<?php\n\t\t\t\tif ( 'private' === $post->post_status ) {\n\t\t\t\t\t$post->post_password = '';\n\t\t\t\t\t$visibility          = 'private';\n\t\t\t\t\t$visibility_trans    = __( 'Private' );\n\t\t\t\t} elseif ( ! empty( $post->post_password ) ) {\n\t\t\t\t\t$visibility       = 'password';\n\t\t\t\t\t$visibility_trans = __( 'Password protected' );\n\t\t\t\t} elseif ( 'post' === $post_type && is_sticky( $post_id ) ) {\n\t\t\t\t\t$visibility       = 'public';\n\t\t\t\t\t$visibility_trans = __( 'Public, Sticky' );\n\t\t\t\t} else {\n\t\t\t\t\t$visibility       = 'public';\n\t\t\t\t\t$visibility_trans = __( 'Public' );\n\t\t\t\t}\n\n\t\t\t\techo esc_html( $visibility_trans );\n\t\t\t\t?>\n\t\t\t</span>\n\n\t\t\t<?php if ( $can_publish ) { ?>\n\t\t\t\t<a href=\"#visibility\" class=\"edit-visibility hide-if-no-js\" role=\"button\"><span aria-hidden=\"true\"><?php _e( 'Edit' ); ?></span> <span class=\"screen-reader-text\"><?php _e( 'Edit visibility' ); ?></span></a>\n\n\t\t\t\t<div id=\"post-visibility-select\" class=\"hide-if-js\">\n\t\t\t\t\t<input type=\"hidden\" name=\"hidden_post_password\" id=\"hidden-post-password\" value=\"<?php echo esc_attr( $post->post_password ); ?>\" />\n\t\t\t\t\t<?php if ( 'post' === $post_type ) : ?>\n\t\t\t\t\t\t<input type=\"checkbox\" style=\"display:none\" name=\"hidden_post_sticky\" id=\"hidden-post-sticky\" value=\"sticky\" <?php checked( is_sticky( $post_id ) ); ?> />\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t<input type=\"hidden\" name=\"hidden_post_visibility\" id=\"hidden-post-visibility\" value=\"<?php echo esc_attr( $visibility ); ?>\" />\n\t\t\t\t\t<input type=\"radio\" name=\"visibility\" id=\"visibility-radio-public\" value=\"public\" <?php checked( $visibility, 'public' ); ?> /> <label for=\"visibility-radio-public\" class=\"selectit\"><?php _e( 'Public' ); ?></label><br />\n\n\t\t\t\t\t<?php if ( 'post' === $post_type && current_user_can( 'edit_others_posts' ) ) : ?>\n\t\t\t\t\t\t<span id=\"sticky-span\"><input id=\"sticky\" name=\"sticky\" type=\"checkbox\" value=\"sticky\" <?php checked( is_sticky( $post_id ) ); ?> /> <label for=\"sticky\" class=\"selectit\"><?php _e( 'Stick this post to the front page' ); ?></label><br /></span>\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t<input type=\"radio\" name=\"visibility\" id=\"visibility-radio-password\" value=\"password\" <?php checked( $visibility, 'password' ); ?> /> <label for=\"visibility-radio-password\" class=\"selectit\"><?php _e( 'Password protected' ); ?></label><br />\n\t\t\t\t\t<span id=\"password-span\"><label for=\"post_password\"><?php _e( 'Password:' ); ?></label> <input type=\"text\" name=\"post_password\" id=\"post_password\" value=\"<?php echo esc_attr( $post->post_password ); ?>\"  maxlength=\"255\" /><br /></span>\n\n\t\t\t\t\t<input type=\"radio\" name=\"visibility\" id=\"visibility-radio-private\" value=\"private\" <?php checked( $visibility, 'private' ); ?> /> <label for=\"visibility-radio-private\" class=\"selectit\"><?php _e( 'Private' ); ?></label><br />\n\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<a href=\"#visibility\" class=\"save-post-visibility hide-if-no-js button\"><?php _e( 'OK' ); ?></a>\n\t\t\t\t\t\t<a href=\"#visibility\" class=\"cancel-post-visibility hide-if-no-js button-cancel\"><?php _e( 'Cancel' ); ?></a>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t<?php } ?>\n\t\t</div>\n\n\t\t<?php\n\t\t/* translators: Publish box date string. 1: Date, 2: Time. See https://www.php.net/date */\n\t\t$date_string = __( '%1$s at %2$s' );\n\t\t/* translators: Publish box date format, see https://www.php.net/date */\n\t\t$date_format = _x( 'M j, Y', 'publish box date format' );\n\t\t/* translators: Publish box time format, see https://www.php.net/date */\n\t\t$time_format = _x( 'H:i', 'publish box time format' );\n\n\t\tif ( 0 !== $post_id ) {\n\t\t\tif ( 'future' === $post->post_status ) { // Scheduled for publishing at a future date.\n\t\t\t\t/* translators: Post date information. %s: Date on which the post is currently scheduled to be published. */\n\t\t\t\t$stamp = __( 'Scheduled for: %s' );\n\t\t\t} elseif ( 'publish' === $post->post_status || 'private' === $post->post_status ) { // Already published.\n\t\t\t\t/* translators: Post date information. %s: Date on which the post was published. */\n\t\t\t\t$stamp = __( 'Published on: %s' );\n\t\t\t} elseif ( '0000-00-00 00:00:00' === $post->post_date_gmt ) { // Draft, 1 or more saves, no date specified.\n\t\t\t\t$stamp = __( 'Publish <b>immediately</b>' );\n\t\t\t} elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // Draft, 1 or more saves, future date specified.\n\t\t\t\t/* translators: Post date information. %s: Date on which the post is to be published. */\n\t\t\t\t$stamp = __( 'Schedule for: %s' );\n\t\t\t} else { // Draft, 1 or more saves, date specified.\n\t\t\t\t/* translators: Post date information. %s: Date on which the post is to be published. */\n\t\t\t\t$stamp = __( 'Publish on: %s' );\n\t\t\t}\n\t\t\t$date = sprintf(\n\t\t\t\t$date_string,\n\t\t\t\tdate_i18n( $date_format, strtotime( $post->post_date ) ),\n\t\t\t\tdate_i18n( $time_format, strtotime( $post->post_date ) )\n\t\t\t);\n\t\t} else { // Draft (no saves, and thus no date specified).\n\t\t\t$stamp = __( 'Publish <b>immediately</b>' );\n\t\t\t$date  = sprintf(\n\t\t\t\t$date_string,\n\t\t\t\tdate_i18n( $date_format, strtotime( current_time( 'mysql' ) ) ),\n\t\t\t\tdate_i18n( $time_format, strtotime( current_time( 'mysql' ) ) )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $args['args']['revisions_count'] ) ) :\n\t\t\t?>\n\t\t\t<div class=\"misc-pub-section misc-pub-revisions\">\n\t\t\t\t<?php\n\t\t\t\t/* translators: Post revisions heading. %s: The number of available revisions. */\n\t\t\t\tprintf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' );\n\t\t\t\t?>\n\t\t\t\t<a class=\"hide-if-no-js\" href=\"<?php echo esc_url( get_edit_post_link( $args['args']['revision_id'] ) ); ?>\"><span aria-hidden=\"true\"><?php _ex( 'Browse', 'revisions' ); ?></span> <span class=\"screen-reader-text\"><?php _e( 'Browse revisions' ); ?></span></a>\n\t\t\t</div>\n\t\t\t<?php\n\t\tendif;\n\n\t\tif ( $can_publish ) : // Contributors don't get to choose the date of publish.\n\t\t\t?>\n\t\t\t<div class=\"misc-pub-section curtime misc-pub-curtime\">\n\t\t\t\t<span id=\"timestamp\">\n\t\t\t\t\t<?php printf( $stamp, '<b>' . $date . '</b>' ); ?>\n\t\t\t\t</span>\n\t\t\t\t<a href=\"#edit_timestamp\" class=\"edit-timestamp hide-if-no-js\" role=\"button\">\n\t\t\t\t\t<span aria-hidden=\"true\"><?php _e( 'Edit' ); ?></span>\n\t\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Edit date and time' ); ?></span>\n\t\t\t\t</a>\n\t\t\t\t<fieldset id=\"timestampdiv\" class=\"hide-if-js\">\n\t\t\t\t\t<legend class=\"screen-reader-text\"><?php _e( 'Date and time' ); ?></legend>\n\t\t\t\t\t<?php touch_time( ( 'edit' === $action ), 1 ); ?>\n\t\t\t\t</fieldset>\n\t\t\t</div>\n\t\t\t<?php\n\t\tendif;\n\n\t\tif ( 'draft' === $post->post_status && get_post_meta( $post_id, '_customize_changeset_uuid', true ) ) :\n\t\t\t?>\n\t\t\t<div class=\"notice notice-info notice-alt inline\">\n\t\t\t\t<p>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: URL to the Customizer. */\n\t\t\t\t\t\t__( 'This draft comes from your <a href=\"%s\">unpublished customization changes</a>. You can edit, but there&#8217;s no need to publish now. It will be published automatically with those changes.' ),\n\t\t\t\t\t\tesc_url(\n\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\t'changeset_uuid',\n\t\t\t\t\t\t\t\trawurlencode( get_post_meta( $post_id, '_customize_changeset_uuid', true ) ),\n\t\t\t\t\t\t\t\tadmin_url( 'customize.php' )\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?>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<?php\n\t\tendif;\n\n\t\t/**\n\t\t * Fires after the post time/date setting in the Publish meta box.\n\t\t *\n\t\t * @since 2.9.0\n\t\t * @since 4.4.0 Added the `$post` parameter.\n\t\t *\n\t\t * @param WP_Post $post WP_Post object for the current post.\n\t\t */\n\t\tdo_action( 'post_submitbox_misc_actions', $post );\n\t\t?>\n\t</div>\n\t<div class=\"clear\"></div>\n</div>\n\n<div id=\"major-publishing-actions\">\n\t<?php\n\t/**\n\t * Fires at the beginning of the publishing actions section of the Publish meta box.\n\t *\n\t * @since 2.7.0\n\t * @since 4.9.0 Added the `$post` parameter.\n\t *\n\t * @param WP_Post|null $post WP_Post object for the current post on Edit Post screen,\n\t *                           null on Edit Link screen.\n\t */\n\tdo_action( 'post_submitbox_start', $post );\n\t?>\n\t<div id=\"delete-action\">\n\t\t<?php\n\t\tif ( current_user_can( 'delete_post', $post_id ) ) {\n\t\t\tif ( ! EMPTY_TRASH_DAYS ) {\n\t\t\t\t$delete_text = __( 'Delete permanently' );\n\t\t\t} else {\n\t\t\t\t$delete_text = __( 'Move to Trash' );\n\t\t\t}\n\t\t\t?>\n\t\t\t<a class=\"submitdelete deletion\" href=\"<?php echo get_delete_post_link( $post_id ); ?>\"><?php echo $delete_text; ?></a>\n\t\t\t<?php\n\t\t}\n\t\t?>\n\t</div>\n\n\t<div id=\"publishing-action\">\n\t\t<span class=\"spinner\"></span>\n\t\t<?php\n\t\tif ( ! in_array( $post->post_status, array( 'publish', 'future', 'private' ), true ) || 0 === $post_id ) {\n\t\t\tif ( $can_publish ) :\n\t\t\t\tif ( ! empty( $post->post_date_gmt ) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) :\n\t\t\t\t\t?>\n\t\t\t\t\t<input name=\"original_publish\" type=\"hidden\" id=\"original_publish\" value=\"<?php echo esc_attr_x( 'Schedule', 'post action/button label' ); ?>\" />\n\t\t\t\t\t<?php submit_button( _x( 'Schedule', 'post action/button label' ), 'primary large', 'publish', false ); ?>\n\t\t\t\t\t<?php\n\t\t\t\telse :\n\t\t\t\t\t?>\n\t\t\t\t\t<input name=\"original_publish\" type=\"hidden\" id=\"original_publish\" value=\"<?php esc_attr_e( 'Publish' ); ?>\" />\n\t\t\t\t\t<?php submit_button( __( 'Publish' ), 'primary large', 'publish', false ); ?>\n\t\t\t\t\t<?php\n\t\t\t\tendif;\n\t\t\telse :\n\t\t\t\t?>\n\t\t\t\t<input name=\"original_publish\" type=\"hidden\" id=\"original_publish\" value=\"<?php esc_attr_e( 'Submit for Review' ); ?>\" />\n\t\t\t\t<?php submit_button( __( 'Submit for Review' ), 'primary large', 'publish', false ); ?>\n\t\t\t\t<?php\n\t\t\tendif;\n\t\t} else {\n\t\t\t?>\n\t\t\t<input name=\"original_publish\" type=\"hidden\" id=\"original_publish\" value=\"<?php esc_attr_e( 'Update' ); ?>\" />\n\t\t\t<?php submit_button( __( 'Update' ), 'primary large', 'save', false, array( 'id' => 'publish' ) ); ?>\n\t\t\t<?php\n\t\t}\n\t\t?>\n\t</div>\n\t<div class=\"clear\"></div>\n</div>\n\n</div>\n\t<?php\n}\n\n/**\n * Display attachment submit form fields.\n *\n * @since 3.5.0\n *\n * @param object $post\n */\nfunction attachment_submit_meta_box( $post ) {\n\t?>\n<div class=\"submitbox\" id=\"submitpost\">\n\n<div id=\"minor-publishing\">\n\n\t<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key. ?>\n<div style=\"display:none;\">\n\t<?php submit_button( __( 'Save' ), '', 'save' ); ?>\n</div>\n\n\n<div id=\"misc-publishing-actions\">\n\t<div class=\"misc-pub-section curtime misc-pub-curtime\">\n\t\t<span id=\"timestamp\">\n\t\t\t<?php\n\t\t\t$uploaded_on = sprintf(\n\t\t\t\t/* translators: Publish box date string. 1: Date, 2: Time. See https://www.php.net/date */\n\t\t\t\t__( '%1$s at %2$s' ),\n\t\t\t\t/* translators: Publish box date format, see https://www.php.net/date */\n\t\t\t\tdate_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ),\n\t\t\t\t/* translators: Publish box time format, see https://www.php.net/date */\n\t\t\t\tdate_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) )\n\t\t\t);\n\t\t\t/* translators: Attachment information. %s: Date the attachment was uploaded. */\n\t\t\tprintf( __( 'Uploaded on: %s' ), '<b>' . $uploaded_on . '</b>' );\n\t\t\t?>\n\t\t</span>\n\t</div><!-- .misc-pub-section -->\n\n\t<?php\n\t/**\n\t * Fires after the 'Uploaded on' section of the Save meta box\n\t * in the attachment editing screen.\n\t *\n\t * @since 3.5.0\n\t * @since 4.9.0 Added the `$post` parameter.\n\t *\n\t * @param WP_Post $post WP_Post object for the current attachment.\n\t */\n\tdo_action( 'attachment_submitbox_misc_actions', $post );\n\t?>\n</div><!-- #misc-publishing-actions -->\n<div class=\"clear\"></div>\n</div><!-- #minor-publishing -->\n\n<div id=\"major-publishing-actions\">\n\t<div id=\"delete-action\">\n\t<?php\n\tif ( current_user_can( 'delete_post', $post->ID ) ) {\n\t\tif ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {\n\t\t\techo \"<a class='submitdelete deletion' href='\" . get_delete_post_link( $post->ID ) . \"'>\" . __( 'Move to Trash' ) . '</a>';\n\t\t} else {\n\t\t\t$delete_ays = ! MEDIA_TRASH ? \" onclick='return showNotice.warn();'\" : '';\n\t\t\techo \"<a class='submitdelete deletion'$delete_ays href='\" . get_delete_post_link( $post->ID, null, true ) . \"'>\" . __( 'Delete permanently' ) . '</a>';\n\t\t}\n\t}\n\t?>\n\t</div>\n\n\t<div id=\"publishing-action\">\n\t\t<span class=\"spinner\"></span>\n\t\t<input name=\"original_publish\" type=\"hidden\" id=\"original_publish\" value=\"<?php esc_attr_e( 'Update' ); ?>\" />\n\t\t<input name=\"save\" type=\"submit\" class=\"button button-primary button-large\" id=\"publish\" value=\"<?php esc_attr_e( 'Update' ); ?>\" />\n\t</div>\n\t<div class=\"clear\"></div>\n</div><!-- #major-publishing-actions -->\n\n</div>\n\n\t<?php\n}\n\n/**\n * Display post format form elements.\n *\n * @since 3.1.0\n *\n * @param WP_Post $post Post object.\n * @param array   $box {\n *     Post formats meta box arguments.\n *\n *     @type string   $id       Meta box 'id' attribute.\n *     @type string   $title    Meta box title.\n *     @type callable $callback Meta box display callback.\n *     @type array    $args     Extra meta box arguments.\n * }\n */\nfunction post_format_meta_box( $post, $box ) {\n\tif ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) :\n\t\t$post_formats = get_theme_support( 'post-formats' );\n\n\t\tif ( is_array( $post_formats[0] ) ) :\n\t\t\t$post_format = get_post_format( $post->ID );\n\t\t\tif ( ! $post_format ) {\n\t\t\t\t$post_format = '0';\n\t\t\t}\n\t\t\t// Add in the current one if it isn't there yet, in case the current theme doesn't support it.\n\t\t\tif ( $post_format && ! in_array( $post_format, $post_formats[0], true ) ) {\n\t\t\t\t$post_formats[0][] = $post_format;\n\t\t\t}\n\t\t\t?>\n\t\t<div id=\"post-formats-select\">\n\t\t<fieldset>\n\t\t\t<legend class=\"screen-reader-text\"><?php _e( 'Post Formats' ); ?></legend>\n\t\t\t<input type=\"radio\" name=\"post_format\" class=\"post-format\" id=\"post-format-0\" value=\"0\" <?php checked( $post_format, '0' ); ?> /> <label for=\"post-format-0\" class=\"post-format-icon post-format-standard\"><?php echo get_post_format_string( 'standard' ); ?></label>\n\t\t\t<?php foreach ( $post_formats[0] as $format ) : ?>\n\t\t\t<br /><input type=\"radio\" name=\"post_format\" class=\"post-format\" id=\"post-format-<?php echo esc_attr( $format ); ?>\" value=\"<?php echo esc_attr( $format ); ?>\" <?php checked( $post_format, $format ); ?> /> <label for=\"post-format-<?php echo esc_attr( $format ); ?>\" class=\"post-format-icon post-format-<?php echo esc_attr( $format ); ?>\"><?php echo esc_html( get_post_format_string( $format ) ); ?></label>\n\t\t\t<?php endforeach; ?>\n\t\t</fieldset>\n\t</div>\n\t\t\t<?php\n\tendif;\nendif;\n}\n\n/**\n * Display post tags form fields.\n *\n * @since 2.6.0\n *\n * @todo Create taxonomy-agnostic wrapper for this.\n *\n * @param WP_Post $post Post object.\n * @param array   $box {\n *     Tags meta box arguments.\n *\n *     @type string   $id       Meta box 'id' attribute.\n *     @type string   $title    Meta box title.\n *     @type callable $callback Meta box display callback.\n *     @type array    $args {\n *         Extra meta box arguments.\n *\n *         @type string $taxonomy Taxonomy. Default 'post_tag'.\n *     }\n * }\n */\nfunction post_tags_meta_box( $post, $box ) {\n\t$defaults = array( 'taxonomy' => 'post_tag' );\n\tif ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) {\n\t\t$args = array();\n\t} else {\n\t\t$args = $box['args'];\n\t}\n\t$parsed_args           = wp_parse_args( $args, $defaults );\n\t$tax_name              = esc_attr( $parsed_args['taxonomy'] );\n\t$taxonomy              = get_taxonomy( $parsed_args['taxonomy'] );\n\t$user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms );\n\t$comma                 = _x( ',', 'tag delimiter' );\n\t$terms_to_edit         = get_terms_to_edit( $post->ID, $tax_name );\n\tif ( ! is_string( $terms_to_edit ) ) {\n\t\t$terms_to_edit = '';\n\t}\n\t?>\n<div class=\"tagsdiv\" id=\"<?php echo $tax_name; ?>\">\n\t<div class=\"jaxtag\">\n\t<div class=\"nojs-tags hide-if-js\">\n\t\t<label for=\"tax-input-<?php echo $tax_name; ?>\"><?php echo $taxonomy->labels->add_or_remove_items; ?></label>\n\t\t<p><textarea name=\"<?php echo \"tax_input[$tax_name]\"; ?>\" rows=\"3\" cols=\"20\" class=\"the-tags\" id=\"tax-input-<?php echo $tax_name; ?>\" <?php disabled( ! $user_can_assign_terms ); ?> aria-describedby=\"new-tag-<?php echo $tax_name; ?>-desc\"><?php echo str_replace( ',', $comma . ' ', $terms_to_edit ); // textarea_escaped by esc_attr() ?></textarea></p>\n\t</div>\n\t<?php if ( $user_can_assign_terms ) : ?>\n\t<div class=\"ajaxtag hide-if-no-js\">\n\t\t<label class=\"screen-reader-text\" for=\"new-tag-<?php echo $tax_name; ?>\"><?php echo $taxonomy->labels->add_new_item; ?></label>\n\t\t<input data-wp-taxonomy=\"<?php echo $tax_name; ?>\" type=\"text\" id=\"new-tag-<?php echo $tax_name; ?>\" name=\"newtag[<?php echo $tax_name; ?>]\" class=\"newtag form-input-tip\" size=\"16\" autocomplete=\"off\" aria-describedby=\"new-tag-<?php echo $tax_name; ?>-desc\" value=\"\" />\n\t\t<input type=\"button\" class=\"button tagadd\" value=\"<?php esc_attr_e( 'Add' ); ?>\" />\n\t</div>\n\t<p class=\"howto\" id=\"new-tag-<?php echo $tax_name; ?>-desc\"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p>\n\t<?php elseif ( empty( $terms_to_edit ) ) : ?>\n\t\t<p><?php echo $taxonomy->labels->no_terms; ?></p>\n\t<?php endif; ?>\n\t</div>\n\t<ul class=\"tagchecklist\" role=\"list\"></ul>\n</div>\n\t<?php if ( $user_can_assign_terms ) : ?>\n<p class=\"hide-if-no-js\"><button type=\"button\" class=\"button-link tagcloud-link\" id=\"link-<?php echo $tax_name; ?>\" aria-expanded=\"false\"><?php echo $taxonomy->labels->choose_from_most_used; ?></button></p>\n<?php endif; ?>\n\t<?php\n}\n\n/**\n * Display post categories form fields.\n *\n * @since 2.6.0\n *\n * @todo Create taxonomy-agnostic wrapper for this.\n *\n * @param WP_Post $post Post object.\n * @param array   $box {\n *     Categories meta box arguments.\n *\n *     @type string   $id       Meta box 'id' attribute.\n *     @type string   $title    Meta box title.\n *     @type callable $callback Meta box display callback.\n *     @type array    $args {\n *         Extra meta box arguments.\n *\n *         @type string $taxonomy Taxonomy. Default 'category'.\n *     }\n * }\n */\nfunction post_categories_meta_box( $post, $box ) {\n\t$defaults = array( 'taxonomy' => 'category' );\n\tif ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) {\n\t\t$args = array();\n\t} else {\n\t\t$args = $box['args'];\n\t}\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\t$tax_name    = esc_attr( $parsed_args['taxonomy'] );\n\t$taxonomy    = get_taxonomy( $parsed_args['taxonomy'] );\n\t?>\n\t<div id=\"taxonomy-<?php echo $tax_name; ?>\" class=\"categorydiv\">\n\t\t<ul id=\"<?php echo $tax_name; ?>-tabs\" class=\"category-tabs\">\n\t\t\t<li class=\"tabs\"><a href=\"#<?php echo $tax_name; ?>-all\"><?php echo $taxonomy->labels->all_items; ?></a></li>\n\t\t\t<li class=\"hide-if-no-js\"><a href=\"#<?php echo $tax_name; ?>-pop\"><?php echo esc_html( $taxonomy->labels->most_used ); ?></a></li>\n\t\t</ul>\n\n\t\t<div id=\"<?php echo $tax_name; ?>-pop\" class=\"tabs-panel\" style=\"display: none;\">\n\t\t\t<ul id=\"<?php echo $tax_name; ?>checklist-pop\" class=\"categorychecklist form-no-clear\" >\n\t\t\t\t<?php $popular_ids = wp_popular_terms_checklist( $tax_name ); ?>\n\t\t\t</ul>\n\t\t</div>\n\n\t\t<div id=\"<?php echo $tax_name; ?>-all\" class=\"tabs-panel\">\n\t\t\t<?php\n\t\t\t$name = ( 'category' === $tax_name ) ? 'post_category' : 'tax_input[' . $tax_name . ']';\n\t\t\t// Allows for an empty term set to be sent. 0 is an invalid term ID and will be ignored by empty() checks.\n\t\t\techo \"<input type='hidden' name='{$name}[]' value='0' />\";\n\t\t\t?>\n\t\t\t<ul id=\"<?php echo $tax_name; ?>checklist\" data-wp-lists=\"list:<?php echo $tax_name; ?>\" class=\"categorychecklist form-no-clear\">\n\t\t\t\t<?php\n\t\t\t\twp_terms_checklist(\n\t\t\t\t\t$post->ID,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'taxonomy'     => $tax_name,\n\t\t\t\t\t\t'popular_cats' => $popular_ids,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</ul>\n\t\t</div>\n\t<?php if ( current_user_can( $taxonomy->cap->edit_terms ) ) : ?>\n\t\t\t<div id=\"<?php echo $tax_name; ?>-adder\" class=\"wp-hidden-children\">\n\t\t\t\t<a id=\"<?php echo $tax_name; ?>-add-toggle\" href=\"#<?php echo $tax_name; ?>-add\" class=\"hide-if-no-js taxonomy-add-new\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t/* translators: %s: Add New taxonomy label. */\n\t\t\t\t\t\tprintf( __( '+ %s' ), $taxonomy->labels->add_new_item );\n\t\t\t\t\t?>\n\t\t\t\t</a>\n\t\t\t\t<p id=\"<?php echo $tax_name; ?>-add\" class=\"category-add wp-hidden-child\">\n\t\t\t\t\t<label class=\"screen-reader-text\" for=\"new<?php echo $tax_name; ?>\"><?php echo $taxonomy->labels->add_new_item; ?></label>\n\t\t\t\t\t<input type=\"text\" name=\"new<?php echo $tax_name; ?>\" id=\"new<?php echo $tax_name; ?>\" class=\"form-required form-input-tip\" value=\"<?php echo esc_attr( $taxonomy->labels->new_item_name ); ?>\" aria-required=\"true\"/>\n\t\t\t\t\t<label class=\"screen-reader-text\" for=\"new<?php echo $tax_name; ?>_parent\">\n\t\t\t\t\t\t<?php echo $taxonomy->labels->parent_item_colon; ?>\n\t\t\t\t\t</label>\n\t\t\t\t\t<?php\n\t\t\t\t\t$parent_dropdown_args = array(\n\t\t\t\t\t\t'taxonomy'         => $tax_name,\n\t\t\t\t\t\t'hide_empty'       => 0,\n\t\t\t\t\t\t'name'             => 'new' . $tax_name . '_parent',\n\t\t\t\t\t\t'orderby'          => 'name',\n\t\t\t\t\t\t'hierarchical'     => 1,\n\t\t\t\t\t\t'show_option_none' => '&mdash; ' . $taxonomy->labels->parent_item . ' &mdash;',\n\t\t\t\t\t);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters the arguments for the taxonomy parent dropdown on the Post Edit page.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 4.4.0\n\t\t\t\t\t *\n\t\t\t\t\t * @param array $parent_dropdown_args {\n\t\t\t\t\t *     Optional. Array of arguments to generate parent dropdown.\n\t\t\t\t\t *\n\t\t\t\t\t *     @type string   $taxonomy         Name of the taxonomy to retrieve.\n\t\t\t\t\t *     @type bool     $hide_if_empty    True to skip generating markup if no\n\t\t\t\t\t *                                      categories are found. Default 0.\n\t\t\t\t\t *     @type string   $name             Value for the 'name' attribute\n\t\t\t\t\t *                                      of the select element.\n\t\t\t\t\t *                                      Default \"new{$tax_name}_parent\".\n\t\t\t\t\t *     @type string   $orderby          Which column to use for ordering\n\t\t\t\t\t *                                      terms. Default 'name'.\n\t\t\t\t\t *     @type bool|int $hierarchical     Whether to traverse the taxonomy\n\t\t\t\t\t *                                      hierarchy. Default 1.\n\t\t\t\t\t *     @type string   $show_option_none Text to display for the \"none\" option.\n\t\t\t\t\t *                                      Default \"&mdash; {$parent} &mdash;\",\n\t\t\t\t\t *                                      where `$parent` is 'parent_item'\n\t\t\t\t\t *                                      taxonomy label.\n\t\t\t\t\t * }\n\t\t\t\t\t */\n\t\t\t\t\t$parent_dropdown_args = apply_filters( 'post_edit_category_parent_dropdown_args', $parent_dropdown_args );\n\n\t\t\t\t\twp_dropdown_categories( $parent_dropdown_args );\n\t\t\t\t\t?>\n\t\t\t\t\t<input type=\"button\" id=\"<?php echo $tax_name; ?>-add-submit\" data-wp-lists=\"add:<?php echo $tax_name; ?>checklist:<?php echo $tax_name; ?>-add\" class=\"button category-add-submit\" value=\"<?php echo esc_attr( $taxonomy->labels->add_new_item ); ?>\" />\n\t\t\t\t\t<?php wp_nonce_field( 'add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false ); ?>\n\t\t\t\t\t<span id=\"<?php echo $tax_name; ?>-ajax-response\"></span>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t<?php endif; ?>\n\t</div>\n\t<?php\n}\n\n/**\n * Display post excerpt form fields.\n *\n * @since 2.6.0\n *\n * @param object $post\n */\nfunction post_excerpt_meta_box( $post ) {\n\t?>\n<label class=\"screen-reader-text\" for=\"excerpt\"><?php _e( 'Excerpt' ); ?></label><textarea rows=\"1\" cols=\"40\" name=\"excerpt\" id=\"excerpt\"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea>\n<p>\n\t<?php\n\tprintf(\n\t\t/* translators: %s: Documentation URL. */\n\t\t__( 'Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href=\"%s\">Learn more about manual excerpts</a>.' ),\n\t\t__( 'https://wordpress.org/support/article/excerpt/' )\n\t);\n\t?>\n</p>\n\t<?php\n}\n\n/**\n * Display trackback links form fields.\n *\n * @since 2.6.0\n *\n * @param object $post\n */\nfunction post_trackback_meta_box( $post ) {\n\t$form_trackback = '<input type=\"text\" name=\"trackback_url\" id=\"trackback_url\" class=\"code\" value=\"' .\n\t\tesc_attr( str_replace( \"\\n\", ' ', $post->to_ping ) ) . '\" aria-describedby=\"trackback-url-desc\" />';\n\n\tif ( '' !== $post->pinged ) {\n\t\t$pings          = '<p>' . __( 'Already pinged:' ) . '</p><ul>';\n\t\t$already_pinged = explode( \"\\n\", trim( $post->pinged ) );\n\t\tforeach ( $already_pinged as $pinged_url ) {\n\t\t\t$pings .= \"\\n\\t<li>\" . esc_html( $pinged_url ) . '</li>';\n\t\t}\n\t\t$pings .= '</ul>';\n\t}\n\n\t?>\n<p>\n\t<label for=\"trackback_url\"><?php _e( 'Send trackbacks to:' ); ?></label>\n\t<?php echo $form_trackback; ?>\n</p>\n<p id=\"trackback-url-desc\" class=\"howto\"><?php _e( 'Separate multiple URLs with spaces' ); ?></p>\n<p>\n\t<?php\n\tprintf(\n\t\t/* translators: %s: Documentation URL. */\n\t\t__( 'Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. If you link other WordPress sites, they&#8217;ll be notified automatically using <a href=\"%s\">pingbacks</a>, no other action necessary.' ),\n\t\t__( 'https://wordpress.org/support/article/introduction-to-blogging/#comments' )\n\t);\n\t?>\n</p>\n\t<?php\n\tif ( ! empty( $pings ) ) {\n\t\techo $pings;\n\t}\n}\n\n/**\n * Display custom fields form fields.\n *\n * @since 2.6.0\n *\n * @param object $post\n */\nfunction post_custom_meta_box( $post ) {\n\t?>\n<div id=\"postcustomstuff\">\n<div id=\"ajax-response\"></div>\n\t<?php\n\t$metadata = has_meta( $post->ID );\n\tforeach ( $metadata as $key => $value ) {\n\t\tif ( is_protected_meta( $metadata[ $key ]['meta_key'], 'post' ) || ! current_user_can( 'edit_post_meta', $post->ID, $metadata[ $key ]['meta_key'] ) ) {\n\t\t\tunset( $metadata[ $key ] );\n\t\t}\n\t}\n\tlist_meta( $metadata );\n\tmeta_form( $post );\n\t?>\n</div>\n<p>\n\t<?php\n\tprintf(\n\t\t/* translators: %s: Documentation URL. */\n\t\t__( 'Custom fields can be used to add extra metadata to a post that you can <a href=\"%s\">use in your theme</a>.' ),\n\t\t__( 'https://wordpress.org/support/article/custom-fields/' )\n\t);\n\t?>\n</p>\n\t<?php\n}\n\n/**\n * Display comments status form fields.\n *\n * @since 2.6.0\n *\n * @param object $post\n */\nfunction post_comment_status_meta_box( $post ) {\n\t?>\n<input name=\"advanced_view\" type=\"hidden\" value=\"1\" />\n<p class=\"meta-options\">\n\t<label for=\"comment_status\" class=\"selectit\"><input name=\"comment_status\" type=\"checkbox\" id=\"comment_status\" value=\"open\" <?php checked( $post->comment_status, 'open' ); ?> /> <?php _e( 'Allow comments' ); ?></label><br />\n\t<label for=\"ping_status\" class=\"selectit\"><input name=\"ping_status\" type=\"checkbox\" id=\"ping_status\" value=\"open\" <?php checked( $post->ping_status, 'open' ); ?> />\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: Documentation URL. */\n\t\t\t__( 'Allow <a href=\"%s\">trackbacks and pingbacks</a> on this page' ),\n\t\t\t__( 'https://wordpress.org/support/article/introduction-to-blogging/#managing-comments' )\n\t\t);\n\t\t?>\n\t</label>\n\t<?php\n\t/**\n\t * Fires at the end of the Discussion meta box on the post editing screen.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param WP_Post $post WP_Post object of the current post.\n\t */\n\tdo_action( 'post_comment_status_meta_box-options', $post ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t?>\n</p>\n\t<?php\n}\n\n/**\n * Display comments for post table header\n *\n * @since 3.0.0\n *\n * @param array $result table header rows\n * @return array\n */\nfunction post_comment_meta_box_thead( $result ) {\n\tunset( $result['cb'], $result['response'] );\n\treturn $result;\n}\n\n/**\n * Display comments for post.\n *\n * @since 2.8.0\n *\n * @param object $post\n */\nfunction post_comment_meta_box( $post ) {\n\twp_nonce_field( 'get-comments', 'add_comment_nonce', false );\n\t?>\n\t<p class=\"hide-if-no-js\" id=\"add-new-comment\"><button type=\"button\" class=\"button\" onclick=\"window.commentReply && commentReply.addcomment(<?php echo $post->ID; ?>);\"><?php _e( 'Add Comment' ); ?></button></p>\n\t<?php\n\n\t$total         = get_comments(\n\t\tarray(\n\t\t\t'post_id' => $post->ID,\n\t\t\t'number'  => 1,\n\t\t\t'count'   => true,\n\t\t)\n\t);\n\t$wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table' );\n\t$wp_list_table->display( true );\n\n\tif ( 1 > $total ) {\n\t\techo '<p id=\"no-comments\">' . __( 'No comments yet.' ) . '</p>';\n\t} else {\n\t\t$hidden = get_hidden_meta_boxes( get_current_screen() );\n\t\tif ( ! in_array( 'commentsdiv', $hidden, true ) ) {\n\t\t\t?>\n\t\t\t<script type=\"text/javascript\">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>\n\t\t\t<?php\n\t\t}\n\n\t\t?>\n\t\t<p class=\"hide-if-no-js\" id=\"show-comments\"><a href=\"#commentstatusdiv\" onclick=\"commentsBox.load(<?php echo $total; ?>);return false;\"><?php _e( 'Show comments' ); ?></a> <span class=\"spinner\"></span></p>\n\t\t<?php\n\t}\n\n\twp_comment_trashnotice();\n}\n\n/**\n * Display slug form fields.\n *\n * @since 2.6.0\n *\n * @param object $post\n */\nfunction post_slug_meta_box( $post ) {\n\t/** This filter is documented in wp-admin/edit-tag-form.php */\n\t$editable_slug = apply_filters( 'editable_slug', $post->post_name, $post );\n\t?>\n<label class=\"screen-reader-text\" for=\"post_name\"><?php _e( 'Slug' ); ?></label><input name=\"post_name\" type=\"text\" size=\"13\" id=\"post_name\" value=\"<?php echo esc_attr( $editable_slug ); ?>\" />\n\t<?php\n}\n\n/**\n * Display form field with list of authors.\n *\n * @since 2.6.0\n *\n * @global int $user_ID\n *\n * @param object $post\n */\nfunction post_author_meta_box( $post ) {\n\tglobal $user_ID;\n\t?>\n<label class=\"screen-reader-text\" for=\"post_author_override\"><?php _e( 'Author' ); ?></label>\n\t<?php\n\twp_dropdown_users(\n\t\tarray(\n\t\t\t'who'              => 'authors',\n\t\t\t'name'             => 'post_author_override',\n\t\t\t'selected'         => empty( $post->ID ) ? $user_ID : $post->post_author,\n\t\t\t'include_selected' => true,\n\t\t\t'show'             => 'display_name_with_login',\n\t\t)\n\t);\n}\n\n/**\n * Display list of revisions.\n *\n * @since 2.6.0\n *\n * @param object $post\n */\nfunction post_revisions_meta_box( $post ) {\n\twp_list_post_revisions( $post );\n}\n\n//\n// Page-related Meta Boxes.\n//\n\n/**\n * Display page attributes form fields.\n *\n * @since 2.7.0\n *\n * @param object $post\n */\nfunction page_attributes_meta_box( $post ) {\n\tif ( is_post_type_hierarchical( $post->post_type ) ) :\n\t\t$dropdown_args = array(\n\t\t\t'post_type'        => $post->post_type,\n\t\t\t'exclude_tree'     => $post->ID,\n\t\t\t'selected'         => $post->post_parent,\n\t\t\t'name'             => 'parent_id',\n\t\t\t'show_option_none' => __( '(no parent)' ),\n\t\t\t'sort_column'      => 'menu_order, post_title',\n\t\t\t'echo'             => 0,\n\t\t);\n\n\t\t/**\n\t\t * Filters the arguments used to generate a Pages drop-down element.\n\t\t *\n\t\t * @since 3.3.0\n\t\t *\n\t\t * @see wp_dropdown_pages()\n\t\t *\n\t\t * @param array   $dropdown_args Array of arguments used to generate the pages drop-down.\n\t\t * @param WP_Post $post          The current post.\n\t\t */\n\t\t$dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post );\n\t\t$pages         = wp_dropdown_pages( $dropdown_args );\n\t\tif ( ! empty( $pages ) ) :\n\t\t\t?>\n<p class=\"post-attributes-label-wrapper parent-id-label-wrapper\"><label class=\"post-attributes-label\" for=\"parent_id\"><?php _e( 'Parent' ); ?></label></p>\n\t\t\t<?php echo $pages; ?>\n\t\t\t<?php\n\t\tendif; // End empty pages check.\n\tendif;  // End hierarchical check.\n\n\tif ( count( get_page_templates( $post ) ) > 0 && get_option( 'page_for_posts' ) != $post->ID ) :\n\t\t$template = ! empty( $post->page_template ) ? $post->page_template : false;\n\t\t?>\n<p class=\"post-attributes-label-wrapper page-template-label-wrapper\"><label class=\"post-attributes-label\" for=\"page_template\"><?php _e( 'Template' ); ?></label>\n\t\t<?php\n\t\t/**\n\t\t * Fires immediately after the label inside the 'Template' section\n\t\t * of the 'Page Attributes' meta box.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string  $template The template used for the current post.\n\t\t * @param WP_Post $post     The current post.\n\t\t */\n\t\tdo_action( 'page_attributes_meta_box_template', $template, $post );\n\t\t?>\n</p>\n<select name=\"page_template\" id=\"page_template\">\n\t\t<?php\n\t\t/**\n\t\t * Filters the title of the default page template displayed in the drop-down.\n\t\t *\n\t\t * @since 4.1.0\n\t\t *\n\t\t * @param string $label   The display value for the default page template title.\n\t\t * @param string $context Where the option label is displayed. Possible values\n\t\t *                        include 'meta-box' or 'quick-edit'.\n\t\t */\n\t\t$default_title = apply_filters( 'default_page_template_title', __( 'Default template' ), 'meta-box' );\n\t\t?>\n<option value=\"default\"><?php echo esc_html( $default_title ); ?></option>\n\t\t<?php page_template_dropdown( $template, $post->post_type ); ?>\n</select>\n<?php endif; ?>\n\t<?php if ( post_type_supports( $post->post_type, 'page-attributes' ) ) : ?>\n<p class=\"post-attributes-label-wrapper menu-order-label-wrapper\"><label class=\"post-attributes-label\" for=\"menu_order\"><?php _e( 'Order' ); ?></label></p>\n<input name=\"menu_order\" type=\"text\" size=\"4\" id=\"menu_order\" value=\"<?php echo esc_attr( $post->menu_order ); ?>\" />\n\t\t<?php\n\t\t/**\n\t\t * Fires before the help hint text in the 'Page Attributes' meta box.\n\t\t *\n\t\t * @since 4.9.0\n\t\t *\n\t\t * @param WP_Post $post The current post.\n\t\t */\n\t\tdo_action( 'page_attributes_misc_attributes', $post );\n\t\t?>\n\t\t<?php if ( 'page' === $post->post_type && get_current_screen()->get_help_tabs() ) : ?>\n<p class=\"post-attributes-help-text\"><?php _e( 'Need help? Use the Help tab above the screen title.' ); ?></p>\n\t\t\t<?php\n\tendif;\n\tendif;\n}\n\n//\n// Link-related Meta Boxes.\n//\n\n/**\n * Display link create form fields.\n *\n * @since 2.7.0\n *\n * @param object $link\n */\nfunction link_submit_meta_box( $link ) {\n\t?>\n<div class=\"submitbox\" id=\"submitlink\">\n\n<div id=\"minor-publishing\">\n\n\t<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key. ?>\n<div style=\"display:none;\">\n\t<?php submit_button( __( 'Save' ), '', 'save', false ); ?>\n</div>\n\n<div id=\"minor-publishing-actions\">\n<div id=\"preview-action\">\n\t<?php if ( ! empty( $link->link_id ) ) { ?>\n\t<a class=\"preview button\" href=\"<?php echo $link->link_url; ?>\" target=\"_blank\"><?php _e( 'Visit Link' ); ?></a>\n<?php } ?>\n</div>\n<div class=\"clear\"></div>\n</div>\n\n<div id=\"misc-publishing-actions\">\n<div class=\"misc-pub-section misc-pub-private\">\n\t<label for=\"link_private\" class=\"selectit\"><input id=\"link_private\" name=\"link_visible\" type=\"checkbox\" value=\"N\" <?php checked( $link->link_visible, 'N' ); ?> /> <?php _e( 'Keep this link private' ); ?></label>\n</div>\n</div>\n\n</div>\n\n<div id=\"major-publishing-actions\">\n\t<?php\n\t/** This action is documented in wp-admin/includes/meta-boxes.php */\n\tdo_action( 'post_submitbox_start', null );\n\t?>\n<div id=\"delete-action\">\n\t<?php\n\tif ( ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] && current_user_can( 'manage_links' ) ) {\n\t\tprintf(\n\t\t\t'<a class=\"submitdelete deletion\" href=\"%s\" onclick=\"return confirm( \\'%s\\' );\">%s</a>',\n\t\t\twp_nonce_url( \"link.php?action=delete&amp;link_id=$link->link_id\", 'delete-bookmark_' . $link->link_id ),\n\t\t\t/* translators: %s: Link name. */\n\t\t\tesc_js( sprintf( __( \"You are about to delete this link '%s'\\n  'Cancel' to stop, 'OK' to delete.\" ), $link->link_name ) ),\n\t\t\t__( 'Delete' )\n\t\t);\n\t}\n\t?>\n</div>\n\n<div id=\"publishing-action\">\n\t<?php if ( ! empty( $link->link_id ) ) { ?>\n\t<input name=\"save\" type=\"submit\" class=\"button button-primary button-large\" id=\"publish\" value=\"<?php esc_attr_e( 'Update Link' ); ?>\" />\n<?php } else { ?>\n\t<input name=\"save\" type=\"submit\" class=\"button button-primary button-large\" id=\"publish\" value=\"<?php esc_attr_e( 'Add Link' ); ?>\" />\n<?php } ?>\n</div>\n<div class=\"clear\"></div>\n</div>\n\t<?php\n\t/**\n\t * Fires at the end of the Publish box in the Link editing screen.\n\t *\n\t * @since 2.5.0\n\t */\n\tdo_action( 'submitlink_box' );\n\t?>\n<div class=\"clear\"></div>\n</div>\n\t<?php\n}\n\n/**\n * Display link categories form fields.\n *\n * @since 2.6.0\n *\n * @param object $link\n */\nfunction link_categories_meta_box( $link ) {\n\t?>\n<div id=\"taxonomy-linkcategory\" class=\"categorydiv\">\n\t<ul id=\"category-tabs\" class=\"category-tabs\">\n\t\t<li class=\"tabs\"><a href=\"#categories-all\"><?php _e( 'All categories' ); ?></a></li>\n\t\t<li class=\"hide-if-no-js\"><a href=\"#categories-pop\"><?php _ex( 'Most Used', 'categories' ); ?></a></li>\n\t</ul>\n\n\t<div id=\"categories-all\" class=\"tabs-panel\">\n\t\t<ul id=\"categorychecklist\" data-wp-lists=\"list:category\" class=\"categorychecklist form-no-clear\">\n\t\t\t<?php\n\t\t\tif ( isset( $link->link_id ) ) {\n\t\t\t\twp_link_category_checklist( $link->link_id );\n\t\t\t} else {\n\t\t\t\twp_link_category_checklist();\n\t\t\t}\n\t\t\t?>\n\t\t</ul>\n\t</div>\n\n\t<div id=\"categories-pop\" class=\"tabs-panel\" style=\"display: none;\">\n\t\t<ul id=\"categorychecklist-pop\" class=\"categorychecklist form-no-clear\">\n\t\t\t<?php wp_popular_terms_checklist( 'link_category' ); ?>\n\t\t</ul>\n\t</div>\n\n\t<div id=\"category-adder\" class=\"wp-hidden-children\">\n\t\t<a id=\"category-add-toggle\" href=\"#category-add\" class=\"taxonomy-add-new\"><?php _e( '+ Add New Category' ); ?></a>\n\t\t<p id=\"link-category-add\" class=\"wp-hidden-child\">\n\t\t\t<label class=\"screen-reader-text\" for=\"newcat\"><?php _e( '+ Add New Category' ); ?></label>\n\t\t\t<input type=\"text\" name=\"newcat\" id=\"newcat\" class=\"form-required form-input-tip\" value=\"<?php esc_attr_e( 'New category name' ); ?>\" aria-required=\"true\" />\n\t\t\t<input type=\"button\" id=\"link-category-add-submit\" data-wp-lists=\"add:categorychecklist:link-category-add\" class=\"button\" value=\"<?php esc_attr_e( 'Add' ); ?>\" />\n\t\t\t<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>\n\t\t\t<span id=\"category-ajax-response\"></span>\n\t\t</p>\n\t</div>\n</div>\n\t<?php\n}\n\n/**\n * Display form fields for changing link target.\n *\n * @since 2.6.0\n *\n * @param object $link\n */\nfunction link_target_meta_box( $link ) {\n\n\t?>\n<fieldset><legend class=\"screen-reader-text\"><span><?php _e( 'Target' ); ?></span></legend>\n<p><label for=\"link_target_blank\" class=\"selectit\">\n<input id=\"link_target_blank\" type=\"radio\" name=\"link_target\" value=\"_blank\" <?php echo ( isset( $link->link_target ) && ( '_blank' === $link->link_target ) ? 'checked=\"checked\"' : '' ); ?> />\n\t<?php _e( '<code>_blank</code> &mdash; new window or tab.' ); ?></label></p>\n<p><label for=\"link_target_top\" class=\"selectit\">\n<input id=\"link_target_top\" type=\"radio\" name=\"link_target\" value=\"_top\" <?php echo ( isset( $link->link_target ) && ( '_top' === $link->link_target ) ? 'checked=\"checked\"' : '' ); ?> />\n\t<?php _e( '<code>_top</code> &mdash; current window or tab, with no frames.' ); ?></label></p>\n<p><label for=\"link_target_none\" class=\"selectit\">\n<input id=\"link_target_none\" type=\"radio\" name=\"link_target\" value=\"\" <?php echo ( isset( $link->link_target ) && ( '' === $link->link_target ) ? 'checked=\"checked\"' : '' ); ?> />\n\t<?php _e( '<code>_none</code> &mdash; same window or tab.' ); ?></label></p>\n</fieldset>\n<p><?php _e( 'Choose the target frame for your link.' ); ?></p>\n\t<?php\n}\n\n/**\n * Display checked checkboxes attribute for xfn microformat options.\n *\n * @since 1.0.1\n *\n * @global object $link\n *\n * @param string $class\n * @param string $value\n * @param mixed  $deprecated Never used.\n */\nfunction xfn_check( $class, $value = '', $deprecated = '' ) {\n\tglobal $link;\n\n\tif ( ! empty( $deprecated ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '2.5.0' ); // Never implemented.\n\t}\n\n\t$link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';\n\t$rels     = preg_split( '/\\s+/', $link_rel );\n\n\tif ( '' !== $value && in_array( $value, $rels, true ) ) {\n\t\techo ' checked=\"checked\"';\n\t}\n\n\tif ( '' === $value ) {\n\t\tif ( 'family' === $class && strpos( $link_rel, 'child' ) === false && strpos( $link_rel, 'parent' ) === false && strpos( $link_rel, 'sibling' ) === false && strpos( $link_rel, 'spouse' ) === false && strpos( $link_rel, 'kin' ) === false ) {\n\t\t\techo ' checked=\"checked\"';\n\t\t}\n\t\tif ( 'friendship' === $class && strpos( $link_rel, 'friend' ) === false && strpos( $link_rel, 'acquaintance' ) === false && strpos( $link_rel, 'contact' ) === false ) {\n\t\t\techo ' checked=\"checked\"';\n\t\t}\n\t\tif ( 'geographical' === $class && strpos( $link_rel, 'co-resident' ) === false && strpos( $link_rel, 'neighbor' ) === false ) {\n\t\t\techo ' checked=\"checked\"';\n\t\t}\n\t\tif ( 'identity' === $class && in_array( 'me', $rels, true ) ) {\n\t\t\techo ' checked=\"checked\"';\n\t\t}\n\t}\n}\n\n/**\n * Display xfn form fields.\n *\n * @since 2.6.0\n *\n * @param object $link\n */\nfunction link_xfn_meta_box( $link ) {\n\t?>\n<table class=\"links-table\">\n\t<tr>\n\t\t<th scope=\"row\"><label for=\"link_rel\"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'rel:' ); ?></label></th>\n\t\t<td><input type=\"text\" name=\"link_rel\" id=\"link_rel\" value=\"<?php echo ( isset( $link->link_rel ) ? esc_attr( $link->link_rel ) : '' ); ?>\" /></td>\n\t</tr>\n\t<tr>\n\t\t<th scope=\"row\"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'identity' ); ?></th>\n\t\t<td><fieldset><legend class=\"screen-reader-text\"><span><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'identity' ); ?></span></legend>\n\t\t\t<label for=\"me\">\n\t\t\t<input type=\"checkbox\" name=\"identity\" value=\"me\" id=\"me\" <?php xfn_check( 'identity', 'me' ); ?> />\n\t\t\t<?php _e( 'another web address of mine' ); ?></label>\n\t\t</fieldset></td>\n\t</tr>\n\t<tr>\n\t\t<th scope=\"row\"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'friendship' ); ?></th>\n\t\t<td><fieldset><legend class=\"screen-reader-text\"><span><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'friendship' ); ?></span></legend>\n\t\t\t<label for=\"contact\">\n\t\t\t<input class=\"valinp\" type=\"radio\" name=\"friendship\" value=\"contact\" id=\"contact\" <?php xfn_check( 'friendship', 'contact' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'contact' ); ?>\n\t\t\t</label>\n\t\t\t<label for=\"acquaintance\">\n\t\t\t<input class=\"valinp\" type=\"radio\" name=\"friendship\" value=\"acquaintance\" id=\"acquaintance\" <?php xfn_check( 'friendship', 'acquaintance' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'acquaintance' ); ?>\n\t\t\t</label>\n\t\t\t<label for=\"friend\">\n\t\t\t<input class=\"valinp\" type=\"radio\" name=\"friendship\" value=\"friend\" id=\"friend\" <?php xfn_check( 'friendship', 'friend' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'friend' ); ?>\n\t\t\t</label>\n\t\t\t<label for=\"friendship\">\n\t\t\t<input name=\"friendship\" type=\"radio\" class=\"valinp\" value=\"\" id=\"friendship\" <?php xfn_check( 'friendship' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'none' ); ?>\n\t\t\t</label>\n\t\t</fieldset></td>\n\t</tr>\n\t<tr>\n\t\t<th scope=\"row\"> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'physical' ); ?> </th>\n\t\t<td><fieldset><legend class=\"screen-reader-text\"><span><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'physical' ); ?></span></legend>\n\t\t\t<label for=\"met\">\n\t\t\t<input class=\"valinp\" type=\"checkbox\" name=\"physical\" value=\"met\" id=\"met\" <?php xfn_check( 'physical', 'met' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'met' ); ?>\n\t\t\t</label>\n\t\t</fieldset></td>\n\t</tr>\n\t<tr>\n\t\t<th scope=\"row\"> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'professional' ); ?> </th>\n\t\t<td><fieldset><legend class=\"screen-reader-text\"><span><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'professional' ); ?></span></legend>\n\t\t\t<label for=\"co-worker\">\n\t\t\t<input class=\"valinp\" type=\"checkbox\" name=\"professional\" value=\"co-worker\" id=\"co-worker\" <?php xfn_check( 'professional', 'co-worker' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'co-worker' ); ?>\n\t\t\t</label>\n\t\t\t<label for=\"colleague\">\n\t\t\t<input class=\"valinp\" type=\"checkbox\" name=\"professional\" value=\"colleague\" id=\"colleague\" <?php xfn_check( 'professional', 'colleague' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'colleague' ); ?>\n\t\t\t</label>\n\t\t</fieldset></td>\n\t</tr>\n\t<tr>\n\t\t<th scope=\"row\"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'geographical' ); ?></th>\n\t\t<td><fieldset><legend class=\"screen-reader-text\"><span> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'geographical' ); ?> </span></legend>\n\t\t\t<label for=\"co-resident\">\n\t\t\t<input class=\"valinp\" type=\"radio\" name=\"geographical\" value=\"co-resident\" id=\"co-resident\" <?php xfn_check( 'geographical', 'co-resident' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'co-resident' ); ?>\n\t\t\t</label>\n\t\t\t<label for=\"neighbor\">\n\t\t\t<input class=\"valinp\" type=\"radio\" name=\"geographical\" value=\"neighbor\" id=\"neighbor\" <?php xfn_check( 'geographical', 'neighbor' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'neighbor' ); ?>\n\t\t\t</label>\n\t\t\t<label for=\"geographical\">\n\t\t\t<input class=\"valinp\" type=\"radio\" name=\"geographical\" value=\"\" id=\"geographical\" <?php xfn_check( 'geographical' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'none' ); ?>\n\t\t\t</label>\n\t\t</fieldset></td>\n\t</tr>\n\t<tr>\n\t\t<th scope=\"row\"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'family' ); ?></th>\n\t\t<td><fieldset><legend class=\"screen-reader-text\"><span> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'family' ); ?> </span></legend>\n\t\t\t<label for=\"child\">\n\t\t\t<input class=\"valinp\" type=\"radio\" name=\"family\" value=\"child\" id=\"child\" <?php xfn_check( 'family', 'child' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'child' ); ?>\n\t\t\t</label>\n\t\t\t<label for=\"kin\">\n\t\t\t<input class=\"valinp\" type=\"radio\" name=\"family\" value=\"kin\" id=\"kin\" <?php xfn_check( 'family', 'kin' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'kin' ); ?>\n\t\t\t</label>\n\t\t\t<label for=\"parent\">\n\t\t\t<input class=\"valinp\" type=\"radio\" name=\"family\" value=\"parent\" id=\"parent\" <?php xfn_check( 'family', 'parent' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'parent' ); ?>\n\t\t\t</label>\n\t\t\t<label for=\"sibling\">\n\t\t\t<input class=\"valinp\" type=\"radio\" name=\"family\" value=\"sibling\" id=\"sibling\" <?php xfn_check( 'family', 'sibling' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'sibling' ); ?>\n\t\t\t</label>\n\t\t\t<label for=\"spouse\">\n\t\t\t<input class=\"valinp\" type=\"radio\" name=\"family\" value=\"spouse\" id=\"spouse\" <?php xfn_check( 'family', 'spouse' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'spouse' ); ?>\n\t\t\t</label>\n\t\t\t<label for=\"family\">\n\t\t\t<input class=\"valinp\" type=\"radio\" name=\"family\" value=\"\" id=\"family\" <?php xfn_check( 'family' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'none' ); ?>\n\t\t\t</label>\n\t\t</fieldset></td>\n\t</tr>\n\t<tr>\n\t\t<th scope=\"row\"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'romantic' ); ?></th>\n\t\t<td><fieldset><legend class=\"screen-reader-text\"><span> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'romantic' ); ?> </span></legend>\n\t\t\t<label for=\"muse\">\n\t\t\t<input class=\"valinp\" type=\"checkbox\" name=\"romantic\" value=\"muse\" id=\"muse\" <?php xfn_check( 'romantic', 'muse' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'muse' ); ?>\n\t\t\t</label>\n\t\t\t<label for=\"crush\">\n\t\t\t<input class=\"valinp\" type=\"checkbox\" name=\"romantic\" value=\"crush\" id=\"crush\" <?php xfn_check( 'romantic', 'crush' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'crush' ); ?>\n\t\t\t</label>\n\t\t\t<label for=\"date\">\n\t\t\t<input class=\"valinp\" type=\"checkbox\" name=\"romantic\" value=\"date\" id=\"date\" <?php xfn_check( 'romantic', 'date' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'date' ); ?>\n\t\t\t</label>\n\t\t\t<label for=\"romantic\">\n\t\t\t<input class=\"valinp\" type=\"checkbox\" name=\"romantic\" value=\"sweetheart\" id=\"romantic\" <?php xfn_check( 'romantic', 'sweetheart' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'sweetheart' ); ?>\n\t\t\t</label>\n\t\t</fieldset></td>\n\t</tr>\n\n</table>\n<p><?php _e( 'If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href=\"https://gmpg.org/xfn/\">XFN</a>.' ); ?></p>\n\t<?php\n}\n\n/**\n * Display advanced link options form fields.\n *\n * @since 2.6.0\n *\n * @param object $link\n */\nfunction link_advanced_meta_box( $link ) {\n\t?>\n<table class=\"links-table\" cellpadding=\"0\">\n\t<tr>\n\t\t<th scope=\"row\"><label for=\"link_image\"><?php _e( 'Image Address' ); ?></label></th>\n\t\t<td><input type=\"text\" name=\"link_image\" class=\"code\" id=\"link_image\" maxlength=\"255\" value=\"<?php echo ( isset( $link->link_image ) ? esc_attr( $link->link_image ) : '' ); ?>\" /></td>\n\t</tr>\n\t<tr>\n\t\t<th scope=\"row\"><label for=\"rss_uri\"><?php _e( 'RSS Address' ); ?></label></th>\n\t\t<td><input name=\"link_rss\" class=\"code\" type=\"text\" id=\"rss_uri\" maxlength=\"255\" value=\"<?php echo ( isset( $link->link_rss ) ? esc_attr( $link->link_rss ) : '' ); ?>\" /></td>\n\t</tr>\n\t<tr>\n\t\t<th scope=\"row\"><label for=\"link_notes\"><?php _e( 'Notes' ); ?></label></th>\n\t\t<td><textarea name=\"link_notes\" id=\"link_notes\" rows=\"10\"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : '' ); // textarea_escaped ?></textarea></td>\n\t</tr>\n\t<tr>\n\t\t<th scope=\"row\"><label for=\"link_rating\"><?php _e( 'Rating' ); ?></label></th>\n\t\t<td><select name=\"link_rating\" id=\"link_rating\" size=\"1\">\n\t\t<?php\n\t\tfor ( $parsed_args = 0; $parsed_args <= 10; $parsed_args++ ) {\n\t\t\techo '<option value=\"' . $parsed_args . '\"';\n\t\t\tif ( isset( $link->link_rating ) && $link->link_rating == $parsed_args ) {\n\t\t\t\techo ' selected=\"selected\"';\n\t\t\t}\n\t\t\techo( '>' . $parsed_args . '</option>' );\n\t\t}\n\t\t?>\n\t\t</select>&nbsp;<?php _e( '(Leave at 0 for no rating.)' ); ?>\n\t\t</td>\n\t</tr>\n</table>\n\t<?php\n}\n\n/**\n * Display post thumbnail meta box.\n *\n * @since 2.9.0\n *\n * @param WP_Post $post A post object.\n */\nfunction post_thumbnail_meta_box( $post ) {\n\t$thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );\n\techo _wp_post_thumbnail_html( $thumbnail_id, $post->ID );\n}\n\n/**\n * Display fields for ID3 data\n *\n * @since 3.9.0\n *\n * @param WP_Post $post A post object.\n */\nfunction attachment_id3_data_meta_box( $post ) {\n\t$meta = array();\n\tif ( ! empty( $post->ID ) ) {\n\t\t$meta = wp_get_attachment_metadata( $post->ID );\n\t}\n\n\tforeach ( wp_get_attachment_id3_keys( $post, 'edit' ) as $key => $label ) :\n\t\t$value = '';\n\t\tif ( ! empty( $meta[ $key ] ) ) {\n\t\t\t$value = $meta[ $key ];\n\t\t}\n\t\t?>\n\t<p>\n\t\t<label for=\"title\"><?php echo $label; ?></label><br />\n\t\t<input type=\"text\" name=\"id3_<?php echo esc_attr( $key ); ?>\" id=\"id3_<?php echo esc_attr( $key ); ?>\" class=\"large-text\" value=\"<?php echo esc_attr( $value ); ?>\" />\n\t</p>\n\t\t<?php\n\tendforeach;\n}\n\n/**\n * Registers the default post meta boxes, and runs the `do_meta_boxes` actions.\n *\n * @since 5.0.0\n *\n * @param WP_Post $post The post object that these meta boxes are being generated for.\n */\nfunction register_and_do_post_meta_boxes( $post ) {\n\t$post_type        = $post->post_type;\n\t$post_type_object = get_post_type_object( $post_type );\n\n\t$thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );\n\tif ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) {\n\t\tif ( wp_attachment_is( 'audio', $post ) ) {\n\t\t\t$thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );\n\t\t} elseif ( wp_attachment_is( 'video', $post ) ) {\n\t\t\t$thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );\n\t\t}\n\t}\n\n\t$publish_callback_args = array( '__back_compat_meta_box' => true );\n\n\tif ( post_type_supports( $post_type, 'revisions' ) && 'auto-draft' !== $post->post_status ) {\n\t\t$revisions = wp_get_post_revisions( $post->ID, array( 'fields' => 'ids' ) );\n\n\t\t// We should aim to show the revisions meta box only when there are revisions.\n\t\tif ( count( $revisions ) > 1 ) {\n\t\t\t$publish_callback_args = array(\n\t\t\t\t'revisions_count'        => count( $revisions ),\n\t\t\t\t'revision_id'            => reset( $revisions ),\n\t\t\t\t'__back_compat_meta_box' => true,\n\t\t\t);\n\n\t\t\tadd_meta_box( 'revisionsdiv', __( 'Revisions' ), 'post_revisions_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );\n\t\t}\n\t}\n\n\tif ( 'attachment' === $post_type ) {\n\t\twp_enqueue_script( 'image-edit' );\n\t\twp_enqueue_style( 'imgareaselect' );\n\t\tadd_meta_box( 'submitdiv', __( 'Save' ), 'attachment_submit_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) );\n\t\tadd_action( 'edit_form_after_title', 'edit_form_image_editor' );\n\n\t\tif ( wp_attachment_is( 'audio', $post ) ) {\n\t\t\tadd_meta_box( 'attachment-id3', __( 'Metadata' ), 'attachment_id3_data_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );\n\t\t}\n\t} else {\n\t\tadd_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core', $publish_callback_args );\n\t}\n\n\tif ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) ) {\n\t\tadd_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) );\n\t}\n\n\t// All taxonomies.\n\tforeach ( get_object_taxonomies( $post ) as $tax_name ) {\n\t\t$taxonomy = get_taxonomy( $tax_name );\n\t\tif ( ! $taxonomy->show_ui || false === $taxonomy->meta_box_cb ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$label = $taxonomy->labels->name;\n\n\t\tif ( ! is_taxonomy_hierarchical( $tax_name ) ) {\n\t\t\t$tax_meta_box_id = 'tagsdiv-' . $tax_name;\n\t\t} else {\n\t\t\t$tax_meta_box_id = $tax_name . 'div';\n\t\t}\n\n\t\tadd_meta_box(\n\t\t\t$tax_meta_box_id,\n\t\t\t$label,\n\t\t\t$taxonomy->meta_box_cb,\n\t\t\tnull,\n\t\t\t'side',\n\t\t\t'core',\n\t\t\tarray(\n\t\t\t\t'taxonomy'               => $tax_name,\n\t\t\t\t'__back_compat_meta_box' => true,\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( post_type_supports( $post_type, 'page-attributes' ) || count( get_page_templates( $post ) ) > 0 ) {\n\t\tadd_meta_box( 'pageparentdiv', $post_type_object->labels->attributes, 'page_attributes_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) );\n\t}\n\n\tif ( $thumbnail_support && current_user_can( 'upload_files' ) ) {\n\t\tadd_meta_box( 'postimagediv', esc_html( $post_type_object->labels->featured_image ), 'post_thumbnail_meta_box', null, 'side', 'low', array( '__back_compat_meta_box' => true ) );\n\t}\n\n\tif ( post_type_supports( $post_type, 'excerpt' ) ) {\n\t\tadd_meta_box( 'postexcerpt', __( 'Excerpt' ), 'post_excerpt_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );\n\t}\n\n\tif ( post_type_supports( $post_type, 'trackbacks' ) ) {\n\t\tadd_meta_box( 'trackbacksdiv', __( 'Send Trackbacks' ), 'post_trackback_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );\n\t}\n\n\tif ( post_type_supports( $post_type, 'custom-fields' ) ) {\n\t\tadd_meta_box(\n\t\t\t'postcustom',\n\t\t\t__( 'Custom Fields' ),\n\t\t\t'post_custom_meta_box',\n\t\t\tnull,\n\t\t\t'normal',\n\t\t\t'core',\n\t\t\tarray(\n\t\t\t\t'__back_compat_meta_box'             => ! (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ),\n\t\t\t\t'__block_editor_compatible_meta_box' => true,\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Fires in the middle of built-in meta box registration.\n\t *\n\t * @since 2.1.0\n\t * @deprecated 3.7.0 Use {@see 'add_meta_boxes'} instead.\n\t *\n\t * @param WP_Post $post Post object.\n\t */\n\tdo_action_deprecated( 'dbx_post_advanced', array( $post ), '3.7.0', 'add_meta_boxes' );\n\n\t// Allow the Discussion meta box to show up if the post type supports comments,\n\t// or if comments or pings are open.\n\tif ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) {\n\t\tadd_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );\n\t}\n\n\t$stati = get_post_stati( array( 'public' => true ) );\n\tif ( empty( $stati ) ) {\n\t\t$stati = array( 'publish' );\n\t}\n\t$stati[] = 'private';\n\n\tif ( in_array( get_post_status( $post ), $stati, true ) ) {\n\t\t// If the post type support comments, or the post has comments,\n\t\t// allow the Comments meta box.\n\t\tif ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) {\n\t\t\tadd_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );\n\t\t}\n\t}\n\n\tif ( ! ( 'pending' === get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) {\n\t\tadd_meta_box( 'slugdiv', __( 'Slug' ), 'post_slug_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );\n\t}\n\n\tif ( post_type_supports( $post_type, 'author' ) && current_user_can( $post_type_object->cap->edit_others_posts ) ) {\n\t\tadd_meta_box( 'authordiv', __( 'Author' ), 'post_author_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );\n\t}\n\n\t/**\n\t * Fires after all built-in meta boxes have been added.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string  $post_type Post type.\n\t * @param WP_Post $post      Post object.\n\t */\n\tdo_action( 'add_meta_boxes', $post_type, $post );\n\n\t/**\n\t * Fires after all built-in meta boxes have been added, contextually for the given post type.\n\t *\n\t * The dynamic portion of the hook, `$post_type`, refers to the post type of the post.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param WP_Post $post Post object.\n\t */\n\tdo_action( \"add_meta_boxes_{$post_type}\", $post );\n\n\t/**\n\t * Fires after meta boxes have been added.\n\t *\n\t * Fires once for each of the default meta box contexts: normal, advanced, and side.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string                $post_type Post type of the post on Edit Post screen, 'link' on Edit Link screen,\n\t *                                         'dashboard' on Dashboard screen.\n\t * @param string                $context   Meta box context. Possible values include 'normal', 'advanced', 'side'.\n\t * @param WP_Post|object|string $post      Post object on Edit Post screen, link object on Edit Link screen,\n\t *                                         an empty string on Dashboard screen.\n\t */\n\tdo_action( 'do_meta_boxes', $post_type, 'normal', $post );\n\t/** This action is documented in wp-admin/includes/meta-boxes.php */\n\tdo_action( 'do_meta_boxes', $post_type, 'advanced', $post );\n\t/** This action is documented in wp-admin/includes/meta-boxes.php */\n\tdo_action( 'do_meta_boxes', $post_type, 'side', $post );\n}\n", "num_lines": 1610}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Misc WordPress Administration API.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Returns whether the server is running Apache with the mod_rewrite module loaded.\n *\n * @since 2.0.0\n *\n * @return bool Whether the server is running Apache with the mod_rewrite module loaded.\n */\nfunction got_mod_rewrite() {\n\t$got_rewrite = apache_mod_loaded( 'mod_rewrite', true );\n\n\t/**\n\t * Filters whether Apache and mod_rewrite are present.\n\t *\n\t * This filter was previously used to force URL rewriting for other servers,\n\t * like nginx. Use the {@see 'got_url_rewrite'} filter in got_url_rewrite() instead.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @see got_url_rewrite()\n\t *\n\t * @param bool $got_rewrite Whether Apache and mod_rewrite are present.\n\t */\n\treturn apply_filters( 'got_rewrite', $got_rewrite );\n}\n\n/**\n * Returns whether the server supports URL rewriting.\n *\n * Detects Apache's mod_rewrite, IIS 7.0+ permalink support, and nginx.\n *\n * @since 3.7.0\n *\n * @global bool $is_nginx\n *\n * @return bool Whether the server supports URL rewriting.\n */\nfunction got_url_rewrite() {\n\t$got_url_rewrite = ( got_mod_rewrite() || $GLOBALS['is_nginx'] || iis7_supports_permalinks() );\n\n\t/**\n\t * Filters whether URL rewriting is available.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param bool $got_url_rewrite Whether URL rewriting is available.\n\t */\n\treturn apply_filters( 'got_url_rewrite', $got_url_rewrite );\n}\n\n/**\n * Extracts strings from between the BEGIN and END markers in the .htaccess file.\n *\n * @since 1.5.0\n *\n * @param string $filename Filename to extract the strings from.\n * @param string $marker   The marker to extract the strings from.\n * @return string[] An array of strings from a file (.htaccess) from between BEGIN and END markers.\n */\nfunction extract_from_markers( $filename, $marker ) {\n\t$result = array();\n\n\tif ( ! file_exists( $filename ) ) {\n\t\treturn $result;\n\t}\n\n\t$markerdata = explode( \"\\n\", implode( '', file( $filename ) ) );\n\n\t$state = false;\n\tforeach ( $markerdata as $markerline ) {\n\t\tif ( false !== strpos( $markerline, '# END ' . $marker ) ) {\n\t\t\t$state = false;\n\t\t}\n\t\tif ( $state ) {\n\t\t\tif ( '#' === substr( $markerline, 0, 1 ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$result[] = $markerline;\n\t\t}\n\t\tif ( false !== strpos( $markerline, '# BEGIN ' . $marker ) ) {\n\t\t\t$state = true;\n\t\t}\n\t}\n\n\treturn $result;\n}\n\n/**\n * Inserts an array of strings into a file (.htaccess), placing it between\n * BEGIN and END markers.\n *\n * Replaces existing marked info. Retains surrounding\n * data. Creates file if none exists.\n *\n * @since 1.5.0\n *\n * @param string       $filename  Filename to alter.\n * @param string       $marker    The marker to alter.\n * @param array|string $insertion The new content to insert.\n * @return bool True on write success, false on failure.\n */\nfunction insert_with_markers( $filename, $marker, $insertion ) {\n\tif ( ! file_exists( $filename ) ) {\n\t\tif ( ! is_writable( dirname( $filename ) ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! touch( $filename ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Make sure the file is created with a minimum set of permissions.\n\t\t$perms = fileperms( $filename );\n\t\tif ( $perms ) {\n\t\t\tchmod( $filename, $perms | 0644 );\n\t\t}\n\t} elseif ( ! is_writeable( $filename ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! is_array( $insertion ) ) {\n\t\t$insertion = explode( \"\\n\", $insertion );\n\t}\n\n\t$switched_locale = switch_to_locale( get_locale() );\n\n\t$instructions = sprintf(\n\t\t/* translators: 1: Marker. */\n\t\t__(\n\t\t\t'The directives (lines) between \"BEGIN %1$s\" and \"END %1$s\" are\ndynamically generated, and should only be modified via WordPress filters.\nAny changes to the directives between these markers will be overwritten.'\n\t\t),\n\t\t$marker\n\t);\n\n\t$instructions = explode( \"\\n\", $instructions );\n\tforeach ( $instructions as $line => $text ) {\n\t\t$instructions[ $line ] = '# ' . $text;\n\t}\n\n\t/**\n\t * Filters the inline instructions inserted before the dynamically generated content.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param string[] $instructions Array of lines with inline instructions.\n\t * @param string   $marker       The marker being inserted.\n\t */\n\t$instructions = apply_filters( 'insert_with_markers_inline_instructions', $instructions, $marker );\n\n\tif ( $switched_locale ) {\n\t\trestore_previous_locale();\n\t}\n\n\t$insertion = array_merge( $instructions, $insertion );\n\n\t$start_marker = \"# BEGIN {$marker}\";\n\t$end_marker   = \"# END {$marker}\";\n\n\t$fp = fopen( $filename, 'r+' );\n\tif ( ! $fp ) {\n\t\treturn false;\n\t}\n\n\t// Attempt to get a lock. If the filesystem supports locking, this will block until the lock is acquired.\n\tflock( $fp, LOCK_EX );\n\n\t$lines = array();\n\twhile ( ! feof( $fp ) ) {\n\t\t$lines[] = rtrim( fgets( $fp ), \"\\r\\n\" );\n\t}\n\n\t// Split out the existing file into the preceding lines, and those that appear after the marker.\n\t$pre_lines        = array();\n\t$post_lines       = array();\n\t$existing_lines   = array();\n\t$found_marker     = false;\n\t$found_end_marker = false;\n\tforeach ( $lines as $line ) {\n\t\tif ( ! $found_marker && false !== strpos( $line, $start_marker ) ) {\n\t\t\t$found_marker = true;\n\t\t\tcontinue;\n\t\t} elseif ( ! $found_end_marker && false !== strpos( $line, $end_marker ) ) {\n\t\t\t$found_end_marker = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif ( ! $found_marker ) {\n\t\t\t$pre_lines[] = $line;\n\t\t} elseif ( $found_marker && $found_end_marker ) {\n\t\t\t$post_lines[] = $line;\n\t\t} else {\n\t\t\t$existing_lines[] = $line;\n\t\t}\n\t}\n\n\t// Check to see if there was a change.\n\tif ( $existing_lines === $insertion ) {\n\t\tflock( $fp, LOCK_UN );\n\t\tfclose( $fp );\n\n\t\treturn true;\n\t}\n\n\t// Generate the new file data.\n\t$new_file_data = implode(\n\t\t\"\\n\",\n\t\tarray_merge(\n\t\t\t$pre_lines,\n\t\t\tarray( $start_marker ),\n\t\t\t$insertion,\n\t\t\tarray( $end_marker ),\n\t\t\t$post_lines\n\t\t)\n\t);\n\n\t// Write to the start of the file, and truncate it to that length.\n\tfseek( $fp, 0 );\n\t$bytes = fwrite( $fp, $new_file_data );\n\tif ( $bytes ) {\n\t\tftruncate( $fp, ftell( $fp ) );\n\t}\n\tfflush( $fp );\n\tflock( $fp, LOCK_UN );\n\tfclose( $fp );\n\n\treturn (bool) $bytes;\n}\n\n/**\n * Updates the htaccess file with the current rules if it is writable.\n *\n * Always writes to the file if it exists and is writable to ensure that we\n * blank out old rules.\n *\n * @since 1.5.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @return bool|null True on write success, false on failure. Null in multisite.\n */\nfunction save_mod_rewrite_rules() {\n\tif ( is_multisite() ) {\n\t\treturn;\n\t}\n\n\tglobal $wp_rewrite;\n\n\t// Ensure get_home_path() is declared.\n\trequire_once ABSPATH . 'wp-admin/includes/file.php';\n\n\t$home_path     = get_home_path();\n\t$htaccess_file = $home_path . '.htaccess';\n\n\t/*\n\t * If the file doesn't already exist check for write access to the directory\n\t * and whether we have some rules. Else check for write access to the file.\n\t */\n\tif ( ( ! file_exists( $htaccess_file ) && is_writable( $home_path ) && $wp_rewrite->using_mod_rewrite_permalinks() ) || is_writable( $htaccess_file ) ) {\n\t\tif ( got_mod_rewrite() ) {\n\t\t\t$rules = explode( \"\\n\", $wp_rewrite->mod_rewrite_rules() );\n\t\t\treturn insert_with_markers( $htaccess_file, 'WordPress', $rules );\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Updates the IIS web.config file with the current rules if it is writable.\n * If the permalinks do not require rewrite rules then the rules are deleted from the web.config file.\n *\n * @since 2.8.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @return bool|null True on write success, false on failure. Null in multisite.\n */\nfunction iis7_save_url_rewrite_rules() {\n\tif ( is_multisite() ) {\n\t\treturn;\n\t}\n\n\tglobal $wp_rewrite;\n\n\t// Ensure get_home_path() is declared.\n\trequire_once ABSPATH . 'wp-admin/includes/file.php';\n\n\t$home_path       = get_home_path();\n\t$web_config_file = $home_path . 'web.config';\n\n\t// Using win_is_writable() instead of is_writable() because of a bug in Windows PHP.\n\tif ( iis7_supports_permalinks() && ( ( ! file_exists( $web_config_file ) && win_is_writable( $home_path ) && $wp_rewrite->using_mod_rewrite_permalinks() ) || win_is_writable( $web_config_file ) ) ) {\n\t\t$rule = $wp_rewrite->iis7_url_rewrite_rules( false );\n\t\tif ( ! empty( $rule ) ) {\n\t\t\treturn iis7_add_rewrite_rule( $web_config_file, $rule );\n\t\t} else {\n\t\t\treturn iis7_delete_rewrite_rule( $web_config_file );\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Update the \"recently-edited\" file for the plugin or theme editor.\n *\n * @since 1.5.0\n *\n * @param string $file\n */\nfunction update_recently_edited( $file ) {\n\t$oldfiles = (array) get_option( 'recently_edited' );\n\tif ( $oldfiles ) {\n\t\t$oldfiles   = array_reverse( $oldfiles );\n\t\t$oldfiles[] = $file;\n\t\t$oldfiles   = array_reverse( $oldfiles );\n\t\t$oldfiles   = array_unique( $oldfiles );\n\t\tif ( 5 < count( $oldfiles ) ) {\n\t\t\tarray_pop( $oldfiles );\n\t\t}\n\t} else {\n\t\t$oldfiles[] = $file;\n\t}\n\tupdate_option( 'recently_edited', $oldfiles );\n}\n\n/**\n * Makes a tree structure for the theme editor's file list.\n *\n * @since 4.9.0\n * @access private\n *\n * @param array $allowed_files List of theme file paths.\n * @return array Tree structure for listing theme files.\n */\nfunction wp_make_theme_file_tree( $allowed_files ) {\n\t$tree_list = array();\n\tforeach ( $allowed_files as $file_name => $absolute_filename ) {\n\t\t$list     = explode( '/', $file_name );\n\t\t$last_dir = &$tree_list;\n\t\tforeach ( $list as $dir ) {\n\t\t\t$last_dir =& $last_dir[ $dir ];\n\t\t}\n\t\t$last_dir = $file_name;\n\t}\n\treturn $tree_list;\n}\n\n/**\n * Outputs the formatted file list for the theme editor.\n *\n * @since 4.9.0\n * @access private\n *\n * @global string $relative_file Name of the file being edited relative to the\n *                               theme directory.\n * @global string $stylesheet    The stylesheet name of the theme being edited.\n *\n * @param array|string $tree  List of file/folder paths, or filename.\n * @param int          $level The aria-level for the current iteration.\n * @param int          $size  The aria-setsize for the current iteration.\n * @param int          $index The aria-posinset for the current iteration.\n */\nfunction wp_print_theme_file_tree( $tree, $level = 2, $size = 1, $index = 1 ) {\n\tglobal $relative_file, $stylesheet;\n\n\tif ( is_array( $tree ) ) {\n\t\t$index = 0;\n\t\t$size  = count( $tree );\n\t\tforeach ( $tree as $label => $theme_file ) :\n\t\t\t$index++;\n\t\t\tif ( ! is_array( $theme_file ) ) {\n\t\t\t\twp_print_theme_file_tree( $theme_file, $level, $index, $size );\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t?>\n\t\t\t<li role=\"treeitem\" aria-expanded=\"true\" tabindex=\"-1\"\n\t\t\t\taria-level=\"<?php echo esc_attr( $level ); ?>\"\n\t\t\t\taria-setsize=\"<?php echo esc_attr( $size ); ?>\"\n\t\t\t\taria-posinset=\"<?php echo esc_attr( $index ); ?>\">\n\t\t\t\t<span class=\"folder-label\"><?php echo esc_html( $label ); ?> <span class=\"screen-reader-text\"><?php _e( 'folder' ); ?></span><span aria-hidden=\"true\" class=\"icon\"></span></span>\n\t\t\t\t<ul role=\"group\" class=\"tree-folder\"><?php wp_print_theme_file_tree( $theme_file, $level + 1, $index, $size ); ?></ul>\n\t\t\t</li>\n\t\t\t<?php\n\t\tendforeach;\n\t} else {\n\t\t$filename = $tree;\n\t\t$url      = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'file'  => rawurlencode( $tree ),\n\t\t\t\t'theme' => rawurlencode( $stylesheet ),\n\t\t\t),\n\t\t\tself_admin_url( 'theme-editor.php' )\n\t\t);\n\t\t?>\n\t\t<li role=\"none\" class=\"<?php echo esc_attr( $relative_file === $filename ? 'current-file' : '' ); ?>\">\n\t\t\t<a role=\"treeitem\" tabindex=\"<?php echo esc_attr( $relative_file === $filename ? '0' : '-1' ); ?>\"\n\t\t\t\thref=\"<?php echo esc_url( $url ); ?>\"\n\t\t\t\taria-level=\"<?php echo esc_attr( $level ); ?>\"\n\t\t\t\taria-setsize=\"<?php echo esc_attr( $size ); ?>\"\n\t\t\t\taria-posinset=\"<?php echo esc_attr( $index ); ?>\">\n\t\t\t\t<?php\n\t\t\t\t$file_description = esc_html( get_file_description( $filename ) );\n\t\t\t\tif ( $file_description !== $filename && wp_basename( $filename ) !== $file_description ) {\n\t\t\t\t\t$file_description .= '<br /><span class=\"nonessential\">(' . esc_html( $filename ) . ')</span>';\n\t\t\t\t}\n\n\t\t\t\tif ( $relative_file === $filename ) {\n\t\t\t\t\techo '<span class=\"notice notice-info\">' . $file_description . '</span>';\n\t\t\t\t} else {\n\t\t\t\t\techo $file_description;\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</a>\n\t\t</li>\n\t\t<?php\n\t}\n}\n\n/**\n * Makes a tree structure for the plugin editor's file list.\n *\n * @since 4.9.0\n * @access private\n *\n * @param array $plugin_editable_files List of plugin file paths.\n * @return array Tree structure for listing plugin files.\n */\nfunction wp_make_plugin_file_tree( $plugin_editable_files ) {\n\t$tree_list = array();\n\tforeach ( $plugin_editable_files as $plugin_file ) {\n\t\t$list     = explode( '/', preg_replace( '#^.+?/#', '', $plugin_file ) );\n\t\t$last_dir = &$tree_list;\n\t\tforeach ( $list as $dir ) {\n\t\t\t$last_dir =& $last_dir[ $dir ];\n\t\t}\n\t\t$last_dir = $plugin_file;\n\t}\n\treturn $tree_list;\n}\n\n/**\n * Outputs the formatted file list for the plugin editor.\n *\n * @since 4.9.0\n * @access private\n *\n * @param array|string $tree  List of file/folder paths, or filename.\n * @param string       $label Name of file or folder to print.\n * @param int          $level The aria-level for the current iteration.\n * @param int          $size  The aria-setsize for the current iteration.\n * @param int          $index The aria-posinset for the current iteration.\n */\nfunction wp_print_plugin_file_tree( $tree, $label = '', $level = 2, $size = 1, $index = 1 ) {\n\tglobal $file, $plugin;\n\tif ( is_array( $tree ) ) {\n\t\t$index = 0;\n\t\t$size  = count( $tree );\n\t\tforeach ( $tree as $label => $plugin_file ) :\n\t\t\t$index++;\n\t\t\tif ( ! is_array( $plugin_file ) ) {\n\t\t\t\twp_print_plugin_file_tree( $plugin_file, $label, $level, $index, $size );\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t?>\n\t\t\t<li role=\"treeitem\" aria-expanded=\"true\" tabindex=\"-1\"\n\t\t\t\taria-level=\"<?php echo esc_attr( $level ); ?>\"\n\t\t\t\taria-setsize=\"<?php echo esc_attr( $size ); ?>\"\n\t\t\t\taria-posinset=\"<?php echo esc_attr( $index ); ?>\">\n\t\t\t\t<span class=\"folder-label\"><?php echo esc_html( $label ); ?> <span class=\"screen-reader-text\"><?php _e( 'folder' ); ?></span><span aria-hidden=\"true\" class=\"icon\"></span></span>\n\t\t\t\t<ul role=\"group\" class=\"tree-folder\"><?php wp_print_plugin_file_tree( $plugin_file, '', $level + 1, $index, $size ); ?></ul>\n\t\t\t</li>\n\t\t\t<?php\n\t\tendforeach;\n\t} else {\n\t\t$url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'file'   => rawurlencode( $tree ),\n\t\t\t\t'plugin' => rawurlencode( $plugin ),\n\t\t\t),\n\t\t\tself_admin_url( 'plugin-editor.php' )\n\t\t);\n\t\t?>\n\t\t<li role=\"none\" class=\"<?php echo esc_attr( $file === $tree ? 'current-file' : '' ); ?>\">\n\t\t\t<a role=\"treeitem\" tabindex=\"<?php echo esc_attr( $file === $tree ? '0' : '-1' ); ?>\"\n\t\t\t\thref=\"<?php echo esc_url( $url ); ?>\"\n\t\t\t\taria-level=\"<?php echo esc_attr( $level ); ?>\"\n\t\t\t\taria-setsize=\"<?php echo esc_attr( $size ); ?>\"\n\t\t\t\taria-posinset=\"<?php echo esc_attr( $index ); ?>\">\n\t\t\t\t<?php\n\t\t\t\tif ( $file === $tree ) {\n\t\t\t\t\techo '<span class=\"notice notice-info\">' . esc_html( $label ) . '</span>';\n\t\t\t\t} else {\n\t\t\t\t\techo esc_html( $label );\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</a>\n\t\t</li>\n\t\t<?php\n\t}\n}\n\n/**\n * Flushes rewrite rules if siteurl, home or page_on_front changed.\n *\n * @since 2.1.0\n *\n * @param string $old_value\n * @param string $value\n */\nfunction update_home_siteurl( $old_value, $value ) {\n\tif ( wp_installing() ) {\n\t\treturn;\n\t}\n\n\tif ( is_multisite() && ms_is_switched() ) {\n\t\tdelete_option( 'rewrite_rules' );\n\t} else {\n\t\tflush_rewrite_rules();\n\t}\n}\n\n\n/**\n * Resets global variables based on $_GET and $_POST\n *\n * This function resets global variables based on the names passed\n * in the $vars array to the value of $_POST[$var] or $_GET[$var] or ''\n * if neither is defined.\n *\n * @since 2.0.0\n *\n * @param array $vars An array of globals to reset.\n */\nfunction wp_reset_vars( $vars ) {\n\tforeach ( $vars as $var ) {\n\t\tif ( empty( $_POST[ $var ] ) ) {\n\t\t\tif ( empty( $_GET[ $var ] ) ) {\n\t\t\t\t$GLOBALS[ $var ] = '';\n\t\t\t} else {\n\t\t\t\t$GLOBALS[ $var ] = $_GET[ $var ];\n\t\t\t}\n\t\t} else {\n\t\t\t$GLOBALS[ $var ] = $_POST[ $var ];\n\t\t}\n\t}\n}\n\n/**\n * Displays the given administration message.\n *\n * @since 2.1.0\n *\n * @param string|WP_Error $message\n */\nfunction show_message( $message ) {\n\tif ( is_wp_error( $message ) ) {\n\t\tif ( $message->get_error_data() && is_string( $message->get_error_data() ) ) {\n\t\t\t$message = $message->get_error_message() . ': ' . $message->get_error_data();\n\t\t} else {\n\t\t\t$message = $message->get_error_message();\n\t\t}\n\t}\n\techo \"<p>$message</p>\\n\";\n\twp_ob_end_flush_all();\n\tflush();\n}\n\n/**\n * @since 2.8.0\n *\n * @param string $content\n * @return array\n */\nfunction wp_doc_link_parse( $content ) {\n\tif ( ! is_string( $content ) || empty( $content ) ) {\n\t\treturn array();\n\t}\n\n\tif ( ! function_exists( 'token_get_all' ) ) {\n\t\treturn array();\n\t}\n\n\t$tokens           = token_get_all( $content );\n\t$count            = count( $tokens );\n\t$functions        = array();\n\t$ignore_functions = array();\n\tfor ( $t = 0; $t < $count - 2; $t++ ) {\n\t\tif ( ! is_array( $tokens[ $t ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( T_STRING == $tokens[ $t ][0] && ( '(' === $tokens[ $t + 1 ] || '(' === $tokens[ $t + 2 ] ) ) {\n\t\t\t// If it's a function or class defined locally, there's not going to be any docs available.\n\t\t\tif ( ( isset( $tokens[ $t - 2 ][1] ) && in_array( $tokens[ $t - 2 ][1], array( 'function', 'class' ), true ) )\n\t\t\t\t|| ( isset( $tokens[ $t - 2 ][0] ) && T_OBJECT_OPERATOR == $tokens[ $t - 1 ][0] )\n\t\t\t) {\n\t\t\t\t$ignore_functions[] = $tokens[ $t ][1];\n\t\t\t}\n\t\t\t// Add this to our stack of unique references.\n\t\t\t$functions[] = $tokens[ $t ][1];\n\t\t}\n\t}\n\n\t$functions = array_unique( $functions );\n\tsort( $functions );\n\n\t/**\n\t * Filters the list of functions and classes to be ignored from the documentation lookup.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string[] $ignore_functions Array of names of functions and classes to be ignored.\n\t */\n\t$ignore_functions = apply_filters( 'documentation_ignore_functions', $ignore_functions );\n\n\t$ignore_functions = array_unique( $ignore_functions );\n\n\t$out = array();\n\tforeach ( $functions as $function ) {\n\t\tif ( in_array( $function, $ignore_functions, true ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\t$out[] = $function;\n\t}\n\n\treturn $out;\n}\n\n/**\n * Saves option for number of rows when listing posts, pages, comments, etc.\n *\n * @since 2.8.0\n */\nfunction set_screen_options() {\n\n\tif ( isset( $_POST['wp_screen_options'] ) && is_array( $_POST['wp_screen_options'] ) ) {\n\t\tcheck_admin_referer( 'screen-options-nonce', 'screenoptionnonce' );\n\n\t\t$user = wp_get_current_user();\n\t\tif ( ! $user ) {\n\t\t\treturn;\n\t\t}\n\t\t$option = $_POST['wp_screen_options']['option'];\n\t\t$value  = $_POST['wp_screen_options']['value'];\n\n\t\tif ( sanitize_key( $option ) != $option ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$map_option = $option;\n\t\t$type       = str_replace( 'edit_', '', $map_option );\n\t\t$type       = str_replace( '_per_page', '', $type );\n\t\tif ( in_array( $type, get_taxonomies(), true ) ) {\n\t\t\t$map_option = 'edit_tags_per_page';\n\t\t} elseif ( in_array( $type, get_post_types(), true ) ) {\n\t\t\t$map_option = 'edit_per_page';\n\t\t} else {\n\t\t\t$option = str_replace( '-', '_', $option );\n\t\t}\n\n\t\tswitch ( $map_option ) {\n\t\t\tcase 'edit_per_page':\n\t\t\tcase 'users_per_page':\n\t\t\tcase 'edit_comments_per_page':\n\t\t\tcase 'upload_per_page':\n\t\t\tcase 'edit_tags_per_page':\n\t\t\tcase 'plugins_per_page':\n\t\t\tcase 'export_personal_data_requests_per_page':\n\t\t\tcase 'remove_personal_data_requests_per_page':\n\t\t\t\t// Network admin.\n\t\t\tcase 'sites_network_per_page':\n\t\t\tcase 'users_network_per_page':\n\t\t\tcase 'site_users_network_per_page':\n\t\t\tcase 'plugins_network_per_page':\n\t\t\tcase 'themes_network_per_page':\n\t\t\tcase 'site_themes_network_per_page':\n\t\t\t\t$value = (int) $value;\n\t\t\t\tif ( $value < 1 || $value > 999 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$screen_option = false;\n\n\t\t\t\tif ( '_page' === substr( $option, -5 ) || 'layout_columns' === $option ) {\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters a screen option value before it is set.\n\t\t\t\t\t *\n\t\t\t\t\t * The filter can also be used to modify non-standard [items]_per_page\n\t\t\t\t\t * settings. See the parent function for a full list of standard options.\n\t\t\t\t\t *\n\t\t\t\t\t * Returning false from the filter will skip saving the current option.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 2.8.0\n\t\t\t\t\t * @since 5.4.2 Only applied to options ending with '_page',\n\t\t\t\t\t *              or the 'layout_columns' option.\n\t\t\t\t\t *\n\t\t\t\t\t * @see set_screen_options()\n\t\t\t\t\t *\n\t\t\t\t\t * @param mixed  $screen_option The value to save instead of the option value.\n\t\t\t\t\t *                              Default false (to skip saving the current option).\n\t\t\t\t\t * @param string $option        The option name.\n\t\t\t\t\t * @param int    $value         The option value.\n\t\t\t\t\t */\n\t\t\t\t\t$screen_option = apply_filters( 'set-screen-option', $screen_option, $option, $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Filters a screen option value before it is set.\n\t\t\t\t *\n\t\t\t\t * The dynamic portion of the hook, `$option`, refers to the option name.\n\t\t\t\t *\n\t\t\t\t * Returning false from the filter will skip saving the current option.\n\t\t\t\t *\n\t\t\t\t * @since 5.4.2\n\t\t\t\t *\n\t\t\t\t * @see set_screen_options()\n\t\t\t\t *\n\t\t\t\t * @param mixed   $screen_option The value to save instead of the option value.\n\t\t\t\t *                               Default false (to skip saving the current option).\n\t\t\t\t * @param string  $option        The option name.\n\t\t\t\t * @param int     $value         The option value.\n\t\t\t\t */\n\t\t\t\t$value = apply_filters( \"set_screen_option_{$option}\", $screen_option, $option, $value );\n\n\t\t\t\tif ( false === $value ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tupdate_user_meta( $user->ID, $option, $value );\n\n\t\t$url = remove_query_arg( array( 'pagenum', 'apage', 'paged' ), wp_get_referer() );\n\t\tif ( isset( $_POST['mode'] ) ) {\n\t\t\t$url = add_query_arg( array( 'mode' => $_POST['mode'] ), $url );\n\t\t}\n\n\t\twp_safe_redirect( $url );\n\t\texit;\n\t}\n}\n\n/**\n * Check if rewrite rule for WordPress already exists in the IIS 7+ configuration file\n *\n * @since 2.8.0\n *\n * @return bool\n * @param string $filename The file path to the configuration file\n */\nfunction iis7_rewrite_rule_exists( $filename ) {\n\tif ( ! file_exists( $filename ) ) {\n\t\treturn false;\n\t}\n\tif ( ! class_exists( 'DOMDocument', false ) ) {\n\t\treturn false;\n\t}\n\n\t$doc = new DOMDocument();\n\tif ( $doc->load( $filename ) === false ) {\n\t\treturn false;\n\t}\n\t$xpath = new DOMXPath( $doc );\n\t$rules = $xpath->query( '/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\\'wordpress\\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\\'WordPress\\')]' );\n\tif ( 0 == $rules->length ) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}\n\n/**\n * Delete WordPress rewrite rule from web.config file if it exists there\n *\n * @since 2.8.0\n *\n * @param string $filename Name of the configuration file\n * @return bool\n */\nfunction iis7_delete_rewrite_rule( $filename ) {\n\t// If configuration file does not exist then rules also do not exist, so there is nothing to delete.\n\tif ( ! file_exists( $filename ) ) {\n\t\treturn true;\n\t}\n\n\tif ( ! class_exists( 'DOMDocument', false ) ) {\n\t\treturn false;\n\t}\n\n\t$doc                     = new DOMDocument();\n\t$doc->preserveWhiteSpace = false;\n\n\tif ( $doc->load( $filename ) === false ) {\n\t\treturn false;\n\t}\n\t$xpath = new DOMXPath( $doc );\n\t$rules = $xpath->query( '/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\\'wordpress\\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\\'WordPress\\')]' );\n\tif ( $rules->length > 0 ) {\n\t\t$child  = $rules->item( 0 );\n\t\t$parent = $child->parentNode;\n\t\t$parent->removeChild( $child );\n\t\t$doc->formatOutput = true;\n\t\tsaveDomDocument( $doc, $filename );\n\t}\n\treturn true;\n}\n\n/**\n * Add WordPress rewrite rule to the IIS 7+ configuration file.\n *\n * @since 2.8.0\n *\n * @param string $filename The file path to the configuration file\n * @param string $rewrite_rule The XML fragment with URL Rewrite rule\n * @return bool\n */\nfunction iis7_add_rewrite_rule( $filename, $rewrite_rule ) {\n\tif ( ! class_exists( 'DOMDocument', false ) ) {\n\t\treturn false;\n\t}\n\n\t// If configuration file does not exist then we create one.\n\tif ( ! file_exists( $filename ) ) {\n\t\t$fp = fopen( $filename, 'w' );\n\t\tfwrite( $fp, '<configuration/>' );\n\t\tfclose( $fp );\n\t}\n\n\t$doc                     = new DOMDocument();\n\t$doc->preserveWhiteSpace = false;\n\n\tif ( $doc->load( $filename ) === false ) {\n\t\treturn false;\n\t}\n\n\t$xpath = new DOMXPath( $doc );\n\n\t// First check if the rule already exists as in that case there is no need to re-add it.\n\t$wordpress_rules = $xpath->query( '/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\\'wordpress\\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\\'WordPress\\')]' );\n\tif ( $wordpress_rules->length > 0 ) {\n\t\treturn true;\n\t}\n\n\t// Check the XPath to the rewrite rule and create XML nodes if they do not exist.\n\t$xmlnodes = $xpath->query( '/configuration/system.webServer/rewrite/rules' );\n\tif ( $xmlnodes->length > 0 ) {\n\t\t$rules_node = $xmlnodes->item( 0 );\n\t} else {\n\t\t$rules_node = $doc->createElement( 'rules' );\n\n\t\t$xmlnodes = $xpath->query( '/configuration/system.webServer/rewrite' );\n\t\tif ( $xmlnodes->length > 0 ) {\n\t\t\t$rewrite_node = $xmlnodes->item( 0 );\n\t\t\t$rewrite_node->appendChild( $rules_node );\n\t\t} else {\n\t\t\t$rewrite_node = $doc->createElement( 'rewrite' );\n\t\t\t$rewrite_node->appendChild( $rules_node );\n\n\t\t\t$xmlnodes = $xpath->query( '/configuration/system.webServer' );\n\t\t\tif ( $xmlnodes->length > 0 ) {\n\t\t\t\t$system_webServer_node = $xmlnodes->item( 0 );\n\t\t\t\t$system_webServer_node->appendChild( $rewrite_node );\n\t\t\t} else {\n\t\t\t\t$system_webServer_node = $doc->createElement( 'system.webServer' );\n\t\t\t\t$system_webServer_node->appendChild( $rewrite_node );\n\n\t\t\t\t$xmlnodes = $xpath->query( '/configuration' );\n\t\t\t\tif ( $xmlnodes->length > 0 ) {\n\t\t\t\t\t$config_node = $xmlnodes->item( 0 );\n\t\t\t\t\t$config_node->appendChild( $system_webServer_node );\n\t\t\t\t} else {\n\t\t\t\t\t$config_node = $doc->createElement( 'configuration' );\n\t\t\t\t\t$doc->appendChild( $config_node );\n\t\t\t\t\t$config_node->appendChild( $system_webServer_node );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t$rule_fragment = $doc->createDocumentFragment();\n\t$rule_fragment->appendXML( $rewrite_rule );\n\t$rules_node->appendChild( $rule_fragment );\n\n\t$doc->encoding     = 'UTF-8';\n\t$doc->formatOutput = true;\n\tsaveDomDocument( $doc, $filename );\n\n\treturn true;\n}\n\n/**\n * Saves the XML document into a file\n *\n * @since 2.8.0\n *\n * @param DOMDocument $doc\n * @param string      $filename\n */\nfunction saveDomDocument( $doc, $filename ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid\n\t$config = $doc->saveXML();\n\t$config = preg_replace( \"/([^\\r])\\n/\", \"$1\\r\\n\", $config );\n\t$fp     = fopen( $filename, 'w' );\n\tfwrite( $fp, $config );\n\tfclose( $fp );\n}\n\n/**\n * Display the default admin color scheme picker (Used in user-edit.php)\n *\n * @since 3.0.0\n *\n * @global array $_wp_admin_css_colors\n *\n * @param int $user_id User ID.\n */\nfunction admin_color_scheme_picker( $user_id ) {\n\tglobal $_wp_admin_css_colors;\n\n\tksort( $_wp_admin_css_colors );\n\n\tif ( isset( $_wp_admin_css_colors['fresh'] ) ) {\n\t\t// Set Default ('fresh') and Light should go first.\n\t\t$_wp_admin_css_colors = array_filter(\n\t\t\tarray_merge(\n\t\t\t\tarray(\n\t\t\t\t\t'fresh'  => '',\n\t\t\t\t\t'light'  => '',\n\t\t\t\t\t'modern' => '',\n\t\t\t\t),\n\t\t\t\t$_wp_admin_css_colors\n\t\t\t)\n\t\t);\n\t}\n\n\t$current_color = get_user_option( 'admin_color', $user_id );\n\n\tif ( empty( $current_color ) || ! isset( $_wp_admin_css_colors[ $current_color ] ) ) {\n\t\t$current_color = 'fresh';\n\t}\n\n\t?>\n\t<fieldset id=\"color-picker\" class=\"scheme-list\">\n\t\t<legend class=\"screen-reader-text\"><span><?php _e( 'Admin Color Scheme' ); ?></span></legend>\n\t\t<?php\n\t\twp_nonce_field( 'save-color-scheme', 'color-nonce', false );\n\t\tforeach ( $_wp_admin_css_colors as $color => $color_info ) :\n\n\t\t\t?>\n\t\t\t<div class=\"color-option <?php echo ( $color == $current_color ) ? 'selected' : ''; ?>\">\n\t\t\t\t<input name=\"admin_color\" id=\"admin_color_<?php echo esc_attr( $color ); ?>\" type=\"radio\" value=\"<?php echo esc_attr( $color ); ?>\" class=\"tog\" <?php checked( $color, $current_color ); ?> />\n\t\t\t\t<input type=\"hidden\" class=\"css_url\" value=\"<?php echo esc_url( $color_info->url ); ?>\" />\n\t\t\t\t<input type=\"hidden\" class=\"icon_colors\" value=\"<?php echo esc_attr( wp_json_encode( array( 'icons' => $color_info->icon_colors ) ) ); ?>\" />\n\t\t\t\t<label for=\"admin_color_<?php echo esc_attr( $color ); ?>\"><?php echo esc_html( $color_info->name ); ?></label>\n\t\t\t\t<table class=\"color-palette\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t<?php\n\n\t\t\t\t\tforeach ( $color_info->colors as $html_color ) {\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<td style=\"background-color: <?php echo esc_attr( $html_color ); ?>\">&nbsp;</td>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\n\t\t\t\t\t?>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<?php\n\n\t\tendforeach;\n\n\t\t?>\n\t</fieldset>\n\t<?php\n}\n\n/**\n *\n * @global array $_wp_admin_css_colors\n */\nfunction wp_color_scheme_settings() {\n\tglobal $_wp_admin_css_colors;\n\n\t$color_scheme = get_user_option( 'admin_color' );\n\n\t// It's possible to have a color scheme set that is no longer registered.\n\tif ( empty( $_wp_admin_css_colors[ $color_scheme ] ) ) {\n\t\t$color_scheme = 'fresh';\n\t}\n\n\tif ( ! empty( $_wp_admin_css_colors[ $color_scheme ]->icon_colors ) ) {\n\t\t$icon_colors = $_wp_admin_css_colors[ $color_scheme ]->icon_colors;\n\t} elseif ( ! empty( $_wp_admin_css_colors['fresh']->icon_colors ) ) {\n\t\t$icon_colors = $_wp_admin_css_colors['fresh']->icon_colors;\n\t} else {\n\t\t// Fall back to the default set of icon colors if the default scheme is missing.\n\t\t$icon_colors = array(\n\t\t\t'base'    => '#a0a5aa',\n\t\t\t'focus'   => '#00a0d2',\n\t\t\t'current' => '#fff',\n\t\t);\n\t}\n\n\techo '<script type=\"text/javascript\">var _wpColorScheme = ' . wp_json_encode( array( 'icons' => $icon_colors ) ) . \";</script>\\n\";\n}\n\n/**\n * Displays the viewport meta in the admin.\n *\n * @since 5.5.0\n */\nfunction wp_admin_viewport_meta() {\n\t/**\n\t * Filters the viewport meta in the admin.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $viewport_meta The viewport meta.\n\t */\n\t$viewport_meta = apply_filters( 'admin_viewport_meta', 'width=device-width,initial-scale=1.0' );\n\n\tif ( empty( $viewport_meta ) ) {\n\t\treturn;\n\t}\n\n\techo '<meta name=\"viewport\" content=\"' . esc_attr( $viewport_meta ) . '\">';\n}\n\n/**\n * Adds viewport meta for mobile in Customizer.\n *\n * Hooked to the {@see 'admin_viewport_meta'} filter.\n *\n * @since 5.5.0\n *\n * @param string $viewport_meta The viewport meta.\n * @return string Filtered viewport meta.\n */\nfunction _customizer_mobile_viewport_meta( $viewport_meta ) {\n\treturn trim( $viewport_meta, ',' ) . ',minimum-scale=0.5,maximum-scale=1.2';\n}\n\n/**\n * Check lock status for posts displayed on the Posts screen\n *\n * @since 3.6.0\n *\n * @param array  $response  The Heartbeat response.\n * @param array  $data      The $_POST data sent.\n * @param string $screen_id The screen ID.\n * @return array The Heartbeat response.\n */\nfunction wp_check_locked_posts( $response, $data, $screen_id ) {\n\t$checked = array();\n\n\tif ( array_key_exists( 'wp-check-locked-posts', $data ) && is_array( $data['wp-check-locked-posts'] ) ) {\n\t\tforeach ( $data['wp-check-locked-posts'] as $key ) {\n\t\t\t$post_id = absint( substr( $key, 5 ) );\n\t\t\tif ( ! $post_id ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$user_id = wp_check_post_lock( $post_id );\n\t\t\tif ( $user_id ) {\n\t\t\t\t$user = get_userdata( $user_id );\n\t\t\t\tif ( $user && current_user_can( 'edit_post', $post_id ) ) {\n\t\t\t\t\t$send = array(\n\t\t\t\t\t\t/* translators: %s: User's display name. */\n\t\t\t\t\t\t'text' => sprintf( __( '%s is currently editing' ), $user->display_name ),\n\t\t\t\t\t);\n\n\t\t\t\t\tif ( get_option( 'show_avatars' ) ) {\n\t\t\t\t\t\t$send['avatar_src']    = get_avatar_url( $user->ID, array( 'size' => 18 ) );\n\t\t\t\t\t\t$send['avatar_src_2x'] = get_avatar_url( $user->ID, array( 'size' => 36 ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t$checked[ $key ] = $send;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! empty( $checked ) ) {\n\t\t$response['wp-check-locked-posts'] = $checked;\n\t}\n\n\treturn $response;\n}\n\n/**\n * Check lock status on the New/Edit Post screen and refresh the lock\n *\n * @since 3.6.0\n *\n * @param array  $response  The Heartbeat response.\n * @param array  $data      The $_POST data sent.\n * @param string $screen_id The screen ID.\n * @return array The Heartbeat response.\n */\nfunction wp_refresh_post_lock( $response, $data, $screen_id ) {\n\tif ( array_key_exists( 'wp-refresh-post-lock', $data ) ) {\n\t\t$received = $data['wp-refresh-post-lock'];\n\t\t$send     = array();\n\n\t\t$post_id = absint( $received['post_id'] );\n\t\tif ( ! $post_id ) {\n\t\t\treturn $response;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\treturn $response;\n\t\t}\n\n\t\t$user_id = wp_check_post_lock( $post_id );\n\t\t$user    = get_userdata( $user_id );\n\t\tif ( $user ) {\n\t\t\t$error = array(\n\t\t\t\t/* translators: %s: User's display name. */\n\t\t\t\t'text' => sprintf( __( '%s has taken over and is currently editing.' ), $user->display_name ),\n\t\t\t);\n\n\t\t\tif ( get_option( 'show_avatars' ) ) {\n\t\t\t\t$error['avatar_src']    = get_avatar_url( $user->ID, array( 'size' => 64 ) );\n\t\t\t\t$error['avatar_src_2x'] = get_avatar_url( $user->ID, array( 'size' => 128 ) );\n\t\t\t}\n\n\t\t\t$send['lock_error'] = $error;\n\t\t} else {\n\t\t\t$new_lock = wp_set_post_lock( $post_id );\n\t\t\tif ( $new_lock ) {\n\t\t\t\t$send['new_lock'] = implode( ':', $new_lock );\n\t\t\t}\n\t\t}\n\n\t\t$response['wp-refresh-post-lock'] = $send;\n\t}\n\n\treturn $response;\n}\n\n/**\n * Check nonce expiration on the New/Edit Post screen and refresh if needed\n *\n * @since 3.6.0\n *\n * @param array  $response  The Heartbeat response.\n * @param array  $data      The $_POST data sent.\n * @param string $screen_id The screen ID.\n * @return array The Heartbeat response.\n */\nfunction wp_refresh_post_nonces( $response, $data, $screen_id ) {\n\tif ( array_key_exists( 'wp-refresh-post-nonces', $data ) ) {\n\t\t$received                           = $data['wp-refresh-post-nonces'];\n\t\t$response['wp-refresh-post-nonces'] = array( 'check' => 1 );\n\n\t\t$post_id = absint( $received['post_id'] );\n\t\tif ( ! $post_id ) {\n\t\t\treturn $response;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\treturn $response;\n\t\t}\n\n\t\t$response['wp-refresh-post-nonces'] = array(\n\t\t\t'replace' => array(\n\t\t\t\t'getpermalinknonce'    => wp_create_nonce( 'getpermalink' ),\n\t\t\t\t'samplepermalinknonce' => wp_create_nonce( 'samplepermalink' ),\n\t\t\t\t'closedpostboxesnonce' => wp_create_nonce( 'closedpostboxes' ),\n\t\t\t\t'_ajax_linking_nonce'  => wp_create_nonce( 'internal-linking' ),\n\t\t\t\t'_wpnonce'             => wp_create_nonce( 'update-post_' . $post_id ),\n\t\t\t),\n\t\t);\n\t}\n\n\treturn $response;\n}\n\n/**\n * Add the latest Heartbeat and REST-API nonce to the Heartbeat response.\n *\n * @since 5.0.0\n *\n * @param array $response The Heartbeat response.\n * @return array The Heartbeat response.\n */\nfunction wp_refresh_heartbeat_nonces( $response ) {\n\t// Refresh the Rest API nonce.\n\t$response['rest_nonce'] = wp_create_nonce( 'wp_rest' );\n\n\t// Refresh the Heartbeat nonce.\n\t$response['heartbeat_nonce'] = wp_create_nonce( 'heartbeat-nonce' );\n\treturn $response;\n}\n\n/**\n * Disable suspension of Heartbeat on the Add/Edit Post screens.\n *\n * @since 3.8.0\n *\n * @global string $pagenow\n *\n * @param array $settings An array of Heartbeat settings.\n * @return array Filtered Heartbeat settings.\n */\nfunction wp_heartbeat_set_suspension( $settings ) {\n\tglobal $pagenow;\n\n\tif ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) {\n\t\t$settings['suspension'] = 'disable';\n\t}\n\n\treturn $settings;\n}\n\n/**\n * Autosave with heartbeat\n *\n * @since 3.9.0\n *\n * @param array $response The Heartbeat response.\n * @param array $data     The $_POST data sent.\n * @return array The Heartbeat response.\n */\nfunction heartbeat_autosave( $response, $data ) {\n\tif ( ! empty( $data['wp_autosave'] ) ) {\n\t\t$saved = wp_autosave( $data['wp_autosave'] );\n\n\t\tif ( is_wp_error( $saved ) ) {\n\t\t\t$response['wp_autosave'] = array(\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => $saved->get_error_message(),\n\t\t\t);\n\t\t} elseif ( empty( $saved ) ) {\n\t\t\t$response['wp_autosave'] = array(\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => __( 'Error while saving.' ),\n\t\t\t);\n\t\t} else {\n\t\t\t/* translators: Draft saved date format, see https://www.php.net/date */\n\t\t\t$draft_saved_date_format = __( 'g:i:s a' );\n\t\t\t$response['wp_autosave'] = array(\n\t\t\t\t'success' => true,\n\t\t\t\t/* translators: %s: Date and time. */\n\t\t\t\t'message' => sprintf( __( 'Draft saved at %s.' ), date_i18n( $draft_saved_date_format ) ),\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $response;\n}\n\n/**\n * Remove single-use URL parameters and create canonical link based on new URL.\n *\n * Remove specific query string parameters from a URL, create the canonical link,\n * put it in the admin header, and change the current URL to match.\n *\n * @since 4.2.0\n */\nfunction wp_admin_canonical_url() {\n\t$removable_query_args = wp_removable_query_args();\n\n\tif ( empty( $removable_query_args ) ) {\n\t\treturn;\n\t}\n\n\t// Ensure we're using an absolute URL.\n\t$current_url  = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );\n\t$filtered_url = remove_query_arg( $removable_query_args, $current_url );\n\t?>\n\t<link id=\"wp-admin-canonical\" rel=\"canonical\" href=\"<?php echo esc_url( $filtered_url ); ?>\" />\n\t<script>\n\t\tif ( window.history.replaceState ) {\n\t\t\twindow.history.replaceState( null, null, document.getElementById( 'wp-admin-canonical' ).href + window.location.hash );\n\t\t}\n\t</script>\n\t<?php\n}\n\n/**\n * Send a referrer policy header so referrers are not sent externally from administration screens.\n *\n * @since 4.9.0\n */\nfunction wp_admin_headers() {\n\t$policy = 'strict-origin-when-cross-origin';\n\n\t/**\n\t * Filters the admin referrer policy header value.\n\t *\n\t * @since 4.9.0\n\t * @since 4.9.5 The default value was changed to 'strict-origin-when-cross-origin'.\n\t *\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy\n\t *\n\t * @param string $policy The admin referrer policy header value. Default 'strict-origin-when-cross-origin'.\n\t */\n\t$policy = apply_filters( 'admin_referrer_policy', $policy );\n\n\theader( sprintf( 'Referrer-Policy: %s', $policy ) );\n}\n\n/**\n * Outputs JS that reloads the page if the user navigated to it with the Back or Forward button.\n *\n * Used on the Edit Post and Add New Post screens. Needed to ensure the page is not loaded from browser cache,\n * so the post title and editor content are the last saved versions. Ideally this script should run first in the head.\n *\n * @since 4.6.0\n */\nfunction wp_page_reload_on_back_button_js() {\n\t?>\n\t<script>\n\t\tif ( typeof performance !== 'undefined' && performance.navigation && performance.navigation.type === 2 ) {\n\t\t\tdocument.location.reload( true );\n\t\t}\n\t</script>\n\t<?php\n}\n\n/**\n * Send a confirmation request email when a change of site admin email address is attempted.\n *\n * The new site admin address will not become active until confirmed.\n *\n * @since 3.0.0\n * @since 4.9.0 This function was moved from wp-admin/includes/ms.php so it's no longer Multisite specific.\n *\n * @param string $old_value The old site admin email address.\n * @param string $value     The proposed new site admin email address.\n */\nfunction update_option_new_admin_email( $old_value, $value ) {\n\tif ( get_option( 'admin_email' ) === $value || ! is_email( $value ) ) {\n\t\treturn;\n\t}\n\n\t$hash            = md5( $value . time() . wp_rand() );\n\t$new_admin_email = array(\n\t\t'hash'     => $hash,\n\t\t'newemail' => $value,\n\t);\n\tupdate_option( 'adminhash', $new_admin_email );\n\n\t$switched_locale = switch_to_locale( get_user_locale() );\n\n\t/* translators: Do not translate USERNAME, ADMIN_URL, EMAIL, SITENAME, SITEURL: those are placeholders. */\n\t$email_text = __(\n\t\t'Howdy ###USERNAME###,\n\nYou recently requested to have the administration email address on\nyour site changed.\n\nIf this is correct, please click on the following link to change it:\n###ADMIN_URL###\n\nYou can safely ignore and delete this email if you do not want to\ntake this action.\n\nThis email has been sent to ###EMAIL###\n\nRegards,\nAll at ###SITENAME###\n###SITEURL###'\n\t);\n\n\t/**\n\t * Filters the text of the email sent when a change of site admin email address is attempted.\n\t *\n\t * The following strings have a special meaning and will get replaced dynamically:\n\t * ###USERNAME###  The current user's username.\n\t * ###ADMIN_URL### The link to click on to confirm the email change.\n\t * ###EMAIL###     The proposed new site admin email address.\n\t * ###SITENAME###  The name of the site.\n\t * ###SITEURL###   The URL to the site.\n\t *\n\t * @since MU (3.0.0)\n\t * @since 4.9.0 This filter is no longer Multisite specific.\n\t *\n\t * @param string $email_text      Text in the email.\n\t * @param array  $new_admin_email {\n\t *     Data relating to the new site admin email address.\n\t *\n\t *     @type string $hash     The secure hash used in the confirmation link URL.\n\t *     @type string $newemail The proposed new site admin email address.\n\t * }\n\t */\n\t$content = apply_filters( 'new_admin_email_content', $email_text, $new_admin_email );\n\n\t$current_user = wp_get_current_user();\n\t$content      = str_replace( '###USERNAME###', $current_user->user_login, $content );\n\t$content      = str_replace( '###ADMIN_URL###', esc_url( self_admin_url( 'options.php?adminhash=' . $hash ) ), $content );\n\t$content      = str_replace( '###EMAIL###', $value, $content );\n\t$content      = str_replace( '###SITENAME###', wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), $content );\n\t$content      = str_replace( '###SITEURL###', home_url(), $content );\n\n\twp_mail(\n\t\t$value,\n\t\tsprintf(\n\t\t\t/* translators: New admin email address notification email subject. %s: Site title. */\n\t\t\t__( '[%s] New Admin Email Address' ),\n\t\t\twp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )\n\t\t),\n\t\t$content\n\t);\n\n\tif ( $switched_locale ) {\n\t\trestore_previous_locale();\n\t}\n}\n\n/**\n * Appends '(Draft)' to draft page titles in the privacy page dropdown\n * so that unpublished content is obvious.\n *\n * @since 4.9.8\n * @access private\n *\n * @param string  $title Page title.\n * @param WP_Post $page  Page data object.\n * @return string Page title.\n */\nfunction _wp_privacy_settings_filter_draft_page_titles( $title, $page ) {\n\tif ( 'draft' === $page->post_status && 'privacy' === get_current_screen()->id ) {\n\t\t/* translators: %s: Page title. */\n\t\t$title = sprintf( __( '%s (Draft)' ), $title );\n\t}\n\n\treturn $title;\n}\n\n/**\n * Checks if the user needs to update PHP.\n *\n * @since 5.1.0\n * @since 5.1.1 Added the {@see 'wp_is_php_version_acceptable'} filter.\n *\n * @return array|false Array of PHP version data. False on failure.\n */\nfunction wp_check_php_version() {\n\t$version = phpversion();\n\t$key     = md5( $version );\n\n\t$response = get_site_transient( 'php_check_' . $key );\n\tif ( false === $response ) {\n\t\t$url = 'http://api.wordpress.org/core/serve-happy/1.0/';\n\t\tif ( wp_http_supports( array( 'ssl' ) ) ) {\n\t\t\t$url = set_url_scheme( $url, 'https' );\n\t\t}\n\n\t\t$url = add_query_arg( 'php_version', $version, $url );\n\n\t\t$response = wp_remote_get( $url );\n\n\t\tif ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * Response should be an array with:\n\t\t *  'recommended_version' - string - The PHP version recommended by WordPress.\n\t\t *  'is_supported' - boolean - Whether the PHP version is actively supported.\n\t\t *  'is_secure' - boolean - Whether the PHP version receives security updates.\n\t\t *  'is_acceptable' - boolean - Whether the PHP version is still acceptable for WordPress.\n\t\t */\n\t\t$response = json_decode( wp_remote_retrieve_body( $response ), true );\n\n\t\tif ( ! is_array( $response ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tset_site_transient( 'php_check_' . $key, $response, WEEK_IN_SECONDS );\n\t}\n\n\tif ( isset( $response['is_acceptable'] ) && $response['is_acceptable'] ) {\n\t\t/**\n\t\t * Filters whether the active PHP version is considered acceptable by WordPress.\n\t\t *\n\t\t * Returning false will trigger a PHP version warning to show up in the admin dashboard to administrators.\n\t\t *\n\t\t * This filter is only run if the wordpress.org Serve Happy API considers the PHP version acceptable, ensuring\n\t\t * that this filter can only make this check stricter, but not loosen it.\n\t\t *\n\t\t * @since 5.1.1\n\t\t *\n\t\t * @param bool   $is_acceptable Whether the PHP version is considered acceptable. Default true.\n\t\t * @param string $version       PHP version checked.\n\t\t */\n\t\t$response['is_acceptable'] = (bool) apply_filters( 'wp_is_php_version_acceptable', true, $version );\n\t}\n\n\treturn $response;\n}\n", "num_lines": 1503}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite Administration hooks\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.3.0\n */\n\n// Media hooks.\nadd_filter( 'wp_handle_upload_prefilter', 'check_upload_size' );\n\n// User hooks.\nadd_action( 'user_admin_notices', 'new_user_email_admin_notice' );\nadd_action( 'network_admin_notices', 'new_user_email_admin_notice' );\n\nadd_action( 'admin_page_access_denied', '_access_denied_splash', 99 );\n\n// Site hooks.\nadd_action( 'wpmueditblogaction', 'upload_space_setting' );\n\n// Network hooks.\nadd_action( 'update_site_option_admin_email', 'wp_network_admin_email_change_notification', 10, 4 );\n\n// Taxonomy hooks.\nadd_filter( 'get_term', 'sync_category_tag_slugs', 10, 2 );\n\n// Post hooks.\nadd_filter( 'wp_insert_post_data', 'avoid_blog_page_permalink_collision', 10, 2 );\n\n// Tools hooks.\nadd_filter( 'import_allow_create_users', 'check_import_new_users' );\n\n// Notices hooks.\nadd_action( 'admin_notices', 'site_admin_notice' );\nadd_action( 'network_admin_notices', 'site_admin_notice' );\n\n// Update hooks.\nadd_action( 'network_admin_notices', 'update_nag', 3 );\nadd_action( 'network_admin_notices', 'maintenance_nag', 10 );\n\n// Network Admin hooks.\nadd_action( 'add_site_option_new_admin_email', 'update_network_option_new_admin_email', 10, 2 );\nadd_action( 'update_site_option_new_admin_email', 'update_network_option_new_admin_email', 10, 2 );\n", "num_lines": 45}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite: Deprecated admin functions from past versions and WordPress MU\n *\n * These functions should not be used and will be removed in a later version.\n * It is suggested to use for the alternatives instead when available.\n *\n * @package WordPress\n * @subpackage Deprecated\n * @since 3.0.0\n */\n\n/**\n * Outputs the WPMU menu.\n *\n * @deprecated 3.0.0\n */\nfunction wpmu_menu() {\n\t_deprecated_function( __FUNCTION__, '3.0.0' );\n\t// Deprecated. See #11763.\n}\n\n/**\n * Determines if the available space defined by the admin has been exceeded by the user.\n *\n * @deprecated 3.0.0 Use is_upload_space_available()\n * @see is_upload_space_available()\n */\nfunction wpmu_checkAvailableSpace() {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'is_upload_space_available()' );\n\n\tif ( ! is_upload_space_available() ) {\n\t\twp_die( sprintf(\n\t\t\t/* translators: %s: Allowed space allocation. */\n\t\t\t__( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.' ),\n\t\t\tsize_format( get_space_allowed() * MB_IN_BYTES )\n\t\t) );\n\t}\n}\n\n/**\n * WPMU options.\n *\n * @deprecated 3.0.0\n */\nfunction mu_options( $options ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0' );\n\treturn $options;\n}\n\n/**\n * Deprecated functionality for activating a network-only plugin.\n *\n * @deprecated 3.0.0 Use activate_plugin()\n * @see activate_plugin()\n */\nfunction activate_sitewide_plugin() {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'activate_plugin()' );\n\treturn false;\n}\n\n/**\n * Deprecated functionality for deactivating a network-only plugin.\n *\n * @deprecated 3.0.0 Use deactivate_plugin()\n * @see deactivate_plugin()\n */\nfunction deactivate_sitewide_plugin( $plugin = false ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'deactivate_plugin()' );\n}\n\n/**\n * Deprecated functionality for determining if the current plugin is network-only.\n *\n * @deprecated 3.0.0 Use is_network_only_plugin()\n * @see is_network_only_plugin()\n */\nfunction is_wpmu_sitewide_plugin( $file ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'is_network_only_plugin()' );\n\treturn is_network_only_plugin( $file );\n}\n\n/**\n * Deprecated functionality for getting themes network-enabled themes.\n *\n * @deprecated 3.4.0 Use WP_Theme::get_allowed_on_network()\n * @see WP_Theme::get_allowed_on_network()\n */\nfunction get_site_allowed_themes() {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'WP_Theme::get_allowed_on_network()' );\n\treturn array_map( 'intval', WP_Theme::get_allowed_on_network() );\n}\n\n/**\n * Deprecated functionality for getting themes allowed on a specific site.\n *\n * @deprecated 3.4.0 Use WP_Theme::get_allowed_on_site()\n * @see WP_Theme::get_allowed_on_site()\n */\nfunction wpmu_get_blog_allowedthemes( $blog_id = 0 ) {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'WP_Theme::get_allowed_on_site()' );\n\treturn array_map( 'intval', WP_Theme::get_allowed_on_site( $blog_id ) );\n}\n\n/**\n * Deprecated functionality for determining whether a file is deprecated.\n *\n * @deprecated 3.5.0\n */\nfunction ms_deprecated_blogs_file() {}\n", "num_lines": 111}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite administration functions.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\n/**\n * Determine if uploaded file exceeds space quota.\n *\n * @since 3.0.0\n *\n * @param array $file $_FILES array for a given file.\n * @return array $_FILES array with 'error' key set if file exceeds quota. 'error' is empty otherwise.\n */\nfunction check_upload_size( $file ) {\n\tif ( get_site_option( 'upload_space_check_disabled' ) ) {\n\t\treturn $file;\n\t}\n\n\tif ( '0' != $file['error'] ) { // There's already an error.\n\t\treturn $file;\n\t}\n\n\tif ( defined( 'WP_IMPORTING' ) ) {\n\t\treturn $file;\n\t}\n\n\t$space_left = get_upload_space_available();\n\n\t$file_size = filesize( $file['tmp_name'] );\n\tif ( $space_left < $file_size ) {\n\t\t/* translators: %s: Required disk space in kilobytes. */\n\t\t$file['error'] = sprintf( __( 'Not enough space to upload. %s KB needed.' ), number_format( ( $file_size - $space_left ) / KB_IN_BYTES ) );\n\t}\n\n\tif ( $file_size > ( KB_IN_BYTES * get_site_option( 'fileupload_maxk', 1500 ) ) ) {\n\t\t/* translators: %s: Maximum allowed file size in kilobytes. */\n\t\t$file['error'] = sprintf( __( 'This file is too big. Files must be less than %s KB in size.' ), get_site_option( 'fileupload_maxk', 1500 ) );\n\t}\n\n\tif ( upload_is_user_over_quota( false ) ) {\n\t\t$file['error'] = __( 'You have used your space quota. Please delete files before uploading.' );\n\t}\n\n\tif ( '0' != $file['error'] && ! isset( $_POST['html-upload'] ) && ! wp_doing_ajax() ) {\n\t\twp_die( $file['error'] . ' <a href=\"javascript:history.go(-1)\">' . __( 'Back' ) . '</a>' );\n\t}\n\n\treturn $file;\n}\n\n/**\n * Delete a site.\n *\n * @since 3.0.0\n * @since 5.1.0 Use wp_delete_site() internally to delete the site row from the database.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int  $blog_id Site ID.\n * @param bool $drop    True if site's database tables should be dropped. Default false.\n */\nfunction wpmu_delete_blog( $blog_id, $drop = false ) {\n\tglobal $wpdb;\n\n\t$switch = false;\n\tif ( get_current_blog_id() != $blog_id ) {\n\t\t$switch = true;\n\t\tswitch_to_blog( $blog_id );\n\t}\n\n\t$blog = get_site( $blog_id );\n\n\t$current_network = get_network();\n\n\t// If a full blog object is not available, do not destroy anything.\n\tif ( $drop && ! $blog ) {\n\t\t$drop = false;\n\t}\n\n\t// Don't destroy the initial, main, or root blog.\n\tif ( $drop && ( 1 == $blog_id || is_main_site( $blog_id ) || ( $blog->path == $current_network->path && $blog->domain == $current_network->domain ) ) ) {\n\t\t$drop = false;\n\t}\n\n\t$upload_path = trim( get_option( 'upload_path' ) );\n\n\t// If ms_files_rewriting is enabled and upload_path is empty, wp_upload_dir is not reliable.\n\tif ( $drop && get_site_option( 'ms_files_rewriting' ) && empty( $upload_path ) ) {\n\t\t$drop = false;\n\t}\n\n\tif ( $drop ) {\n\t\twp_delete_site( $blog_id );\n\t} else {\n\t\t/** This action is documented in wp-includes/ms-blogs.php */\n\t\tdo_action_deprecated( 'delete_blog', array( $blog_id, false ), '5.1.0' );\n\n\t\t$users = get_users(\n\t\t\tarray(\n\t\t\t\t'blog_id' => $blog_id,\n\t\t\t\t'fields'  => 'ids',\n\t\t\t)\n\t\t);\n\n\t\t// Remove users from this blog.\n\t\tif ( ! empty( $users ) ) {\n\t\t\tforeach ( $users as $user_id ) {\n\t\t\t\tremove_user_from_blog( $user_id, $blog_id );\n\t\t\t}\n\t\t}\n\n\t\tupdate_blog_status( $blog_id, 'deleted', 1 );\n\n\t\t/** This action is documented in wp-includes/ms-blogs.php */\n\t\tdo_action_deprecated( 'deleted_blog', array( $blog_id, false ), '5.1.0' );\n\t}\n\n\tif ( $switch ) {\n\t\trestore_current_blog();\n\t}\n}\n\n/**\n * Delete a user from the network and remove from all sites.\n *\n * @since 3.0.0\n *\n * @todo Merge with wp_delete_user()?\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int $id The user ID.\n * @return bool True if the user was deleted, otherwise false.\n */\nfunction wpmu_delete_user( $id ) {\n\tglobal $wpdb;\n\n\tif ( ! is_numeric( $id ) ) {\n\t\treturn false;\n\t}\n\n\t$id   = (int) $id;\n\t$user = new WP_User( $id );\n\n\tif ( ! $user->exists() ) {\n\t\treturn false;\n\t}\n\n\t// Global super-administrators are protected, and cannot be deleted.\n\t$_super_admins = get_super_admins();\n\tif ( in_array( $user->user_login, $_super_admins, true ) ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Fires before a user is deleted from the network.\n\t *\n\t * @since MU (3.0.0)\n\t * @since 5.5.0 Added the `$user` parameter.\n\t *\n\t * @param int     $id   ID of the user about to be deleted from the network.\n\t * @param WP_User $user WP_User object of the user about to be deleted from the network.\n\t */\n\tdo_action( 'wpmu_delete_user', $id, $user );\n\n\t$blogs = get_blogs_of_user( $id );\n\n\tif ( ! empty( $blogs ) ) {\n\t\tforeach ( $blogs as $blog ) {\n\t\t\tswitch_to_blog( $blog->userblog_id );\n\t\t\tremove_user_from_blog( $id, $blog->userblog_id );\n\n\t\t\t$post_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE post_author = %d\", $id ) );\n\t\t\tforeach ( (array) $post_ids as $post_id ) {\n\t\t\t\twp_delete_post( $post_id );\n\t\t\t}\n\n\t\t\t// Clean links.\n\t\t\t$link_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT link_id FROM $wpdb->links WHERE link_owner = %d\", $id ) );\n\n\t\t\tif ( $link_ids ) {\n\t\t\t\tforeach ( $link_ids as $link_id ) {\n\t\t\t\t\twp_delete_link( $link_id );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trestore_current_blog();\n\t\t}\n\t}\n\n\t$meta = $wpdb->get_col( $wpdb->prepare( \"SELECT umeta_id FROM $wpdb->usermeta WHERE user_id = %d\", $id ) );\n\tforeach ( $meta as $mid ) {\n\t\tdelete_metadata_by_mid( 'user', $mid );\n\t}\n\n\t$wpdb->delete( $wpdb->users, array( 'ID' => $id ) );\n\n\tclean_user_cache( $user );\n\n\t/** This action is documented in wp-admin/includes/user.php */\n\tdo_action( 'deleted_user', $id, null, $user );\n\n\treturn true;\n}\n\n/**\n * Check whether a site has used its allotted upload space.\n *\n * @since MU (3.0.0)\n *\n * @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true.\n * @return bool True if user is over upload space quota, otherwise false.\n */\nfunction upload_is_user_over_quota( $echo = true ) {\n\tif ( get_site_option( 'upload_space_check_disabled' ) ) {\n\t\treturn false;\n\t}\n\n\t$space_allowed = get_space_allowed();\n\tif ( ! is_numeric( $space_allowed ) ) {\n\t\t$space_allowed = 10; // Default space allowed is 10 MB.\n\t}\n\t$space_used = get_space_used();\n\n\tif ( ( $space_allowed - $space_used ) < 0 ) {\n\t\tif ( $echo ) {\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: Allowed space allocation. */\n\t\t\t\t__( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.' ),\n\t\t\t\tsize_format( $space_allowed * MB_IN_BYTES )\n\t\t\t);\n\t\t}\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}\n\n/**\n * Displays the amount of disk space used by the current site. Not used in core.\n *\n * @since MU (3.0.0)\n */\nfunction display_space_usage() {\n\t$space_allowed = get_space_allowed();\n\t$space_used    = get_space_used();\n\n\t$percent_used = ( $space_used / $space_allowed ) * 100;\n\n\t$space = size_format( $space_allowed * MB_IN_BYTES );\n\t?>\n\t<strong>\n\t<?php\n\t\t/* translators: Storage space that's been used. 1: Percentage of used space, 2: Total space allowed in megabytes or gigabytes. */\n\t\tprintf( __( 'Used: %1$s%% of %2$s' ), number_format( $percent_used ), $space );\n\t?>\n\t</strong>\n\t<?php\n}\n\n/**\n * Get the remaining upload space for this site.\n *\n * @since MU (3.0.0)\n *\n * @param int $size Current max size in bytes\n * @return int Max size in bytes\n */\nfunction fix_import_form_size( $size ) {\n\tif ( upload_is_user_over_quota( false ) ) {\n\t\treturn 0;\n\t}\n\t$available = get_upload_space_available();\n\treturn min( $size, $available );\n}\n\n/**\n * Displays the site upload space quota setting form on the Edit Site Settings screen.\n *\n * @since 3.0.0\n *\n * @param int $id The ID of the site to display the setting for.\n */\nfunction upload_space_setting( $id ) {\n\tswitch_to_blog( $id );\n\t$quota = get_option( 'blog_upload_space' );\n\trestore_current_blog();\n\n\tif ( ! $quota ) {\n\t\t$quota = '';\n\t}\n\n\t?>\n\t<tr>\n\t\t<th><label for=\"blog-upload-space-number\"><?php _e( 'Site Upload Space Quota' ); ?></label></th>\n\t\t<td>\n\t\t\t<input type=\"number\" step=\"1\" min=\"0\" style=\"width: 100px\" name=\"option[blog_upload_space]\" id=\"blog-upload-space-number\" aria-describedby=\"blog-upload-space-desc\" value=\"<?php echo $quota; ?>\" />\n\t\t\t<span id=\"blog-upload-space-desc\"><span class=\"screen-reader-text\"><?php _e( 'Size in megabytes' ); ?></span> <?php _e( 'MB (Leave blank for network default)' ); ?></span>\n\t\t</td>\n\t</tr>\n\t<?php\n}\n\n/**\n * Cleans the user cache for a specific user.\n *\n * @since 3.0.0\n *\n * @param int $id The user ID.\n * @return bool|int The ID of the refreshed user or false if the user does not exist.\n */\nfunction refresh_user_details( $id ) {\n\t$id = (int) $id;\n\n\t$user = get_userdata( $id );\n\tif ( ! $user ) {\n\t\treturn false;\n\t}\n\n\tclean_user_cache( $user );\n\n\treturn $id;\n}\n\n/**\n * Returns the language for a language code.\n *\n * @since 3.0.0\n *\n * @param string $code Optional. The two-letter language code. Default empty.\n * @return string The language corresponding to $code if it exists. If it does not exist,\n *                then the first two letters of $code is returned.\n */\nfunction format_code_lang( $code = '' ) {\n\t$code       = strtolower( substr( $code, 0, 2 ) );\n\t$lang_codes = array(\n\t\t'aa' => 'Afar',\n\t\t'ab' => 'Abkhazian',\n\t\t'af' => 'Afrikaans',\n\t\t'ak' => 'Akan',\n\t\t'sq' => 'Albanian',\n\t\t'am' => 'Amharic',\n\t\t'ar' => 'Arabic',\n\t\t'an' => 'Aragonese',\n\t\t'hy' => 'Armenian',\n\t\t'as' => 'Assamese',\n\t\t'av' => 'Avaric',\n\t\t'ae' => 'Avestan',\n\t\t'ay' => 'Aymara',\n\t\t'az' => 'Azerbaijani',\n\t\t'ba' => 'Bashkir',\n\t\t'bm' => 'Bambara',\n\t\t'eu' => 'Basque',\n\t\t'be' => 'Belarusian',\n\t\t'bn' => 'Bengali',\n\t\t'bh' => 'Bihari',\n\t\t'bi' => 'Bislama',\n\t\t'bs' => 'Bosnian',\n\t\t'br' => 'Breton',\n\t\t'bg' => 'Bulgarian',\n\t\t'my' => 'Burmese',\n\t\t'ca' => 'Catalan; Valencian',\n\t\t'ch' => 'Chamorro',\n\t\t'ce' => 'Chechen',\n\t\t'zh' => 'Chinese',\n\t\t'cu' => 'Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic',\n\t\t'cv' => 'Chuvash',\n\t\t'kw' => 'Cornish',\n\t\t'co' => 'Corsican',\n\t\t'cr' => 'Cree',\n\t\t'cs' => 'Czech',\n\t\t'da' => 'Danish',\n\t\t'dv' => 'Divehi; Dhivehi; Maldivian',\n\t\t'nl' => 'Dutch; Flemish',\n\t\t'dz' => 'Dzongkha',\n\t\t'en' => 'English',\n\t\t'eo' => 'Esperanto',\n\t\t'et' => 'Estonian',\n\t\t'ee' => 'Ewe',\n\t\t'fo' => 'Faroese',\n\t\t'fj' => 'Fijjian',\n\t\t'fi' => 'Finnish',\n\t\t'fr' => 'French',\n\t\t'fy' => 'Western Frisian',\n\t\t'ff' => 'Fulah',\n\t\t'ka' => 'Georgian',\n\t\t'de' => 'German',\n\t\t'gd' => 'Gaelic; Scottish Gaelic',\n\t\t'ga' => 'Irish',\n\t\t'gl' => 'Galician',\n\t\t'gv' => 'Manx',\n\t\t'el' => 'Greek, Modern',\n\t\t'gn' => 'Guarani',\n\t\t'gu' => 'Gujarati',\n\t\t'ht' => 'Haitian; Haitian Creole',\n\t\t'ha' => 'Hausa',\n\t\t'he' => 'Hebrew',\n\t\t'hz' => 'Herero',\n\t\t'hi' => 'Hindi',\n\t\t'ho' => 'Hiri Motu',\n\t\t'hu' => 'Hungarian',\n\t\t'ig' => 'Igbo',\n\t\t'is' => 'Icelandic',\n\t\t'io' => 'Ido',\n\t\t'ii' => 'Sichuan Yi',\n\t\t'iu' => 'Inuktitut',\n\t\t'ie' => 'Interlingue',\n\t\t'ia' => 'Interlingua (International Auxiliary Language Association)',\n\t\t'id' => 'Indonesian',\n\t\t'ik' => 'Inupiaq',\n\t\t'it' => 'Italian',\n\t\t'jv' => 'Javanese',\n\t\t'ja' => 'Japanese',\n\t\t'kl' => 'Kalaallisut; Greenlandic',\n\t\t'kn' => 'Kannada',\n\t\t'ks' => 'Kashmiri',\n\t\t'kr' => 'Kanuri',\n\t\t'kk' => 'Kazakh',\n\t\t'km' => 'Central Khmer',\n\t\t'ki' => 'Kikuyu; Gikuyu',\n\t\t'rw' => 'Kinyarwanda',\n\t\t'ky' => 'Kirghiz; Kyrgyz',\n\t\t'kv' => 'Komi',\n\t\t'kg' => 'Kongo',\n\t\t'ko' => 'Korean',\n\t\t'kj' => 'Kuanyama; Kwanyama',\n\t\t'ku' => 'Kurdish',\n\t\t'lo' => 'Lao',\n\t\t'la' => 'Latin',\n\t\t'lv' => 'Latvian',\n\t\t'li' => 'Limburgan; Limburger; Limburgish',\n\t\t'ln' => 'Lingala',\n\t\t'lt' => 'Lithuanian',\n\t\t'lb' => 'Luxembourgish; Letzeburgesch',\n\t\t'lu' => 'Luba-Katanga',\n\t\t'lg' => 'Ganda',\n\t\t'mk' => 'Macedonian',\n\t\t'mh' => 'Marshallese',\n\t\t'ml' => 'Malayalam',\n\t\t'mi' => 'Maori',\n\t\t'mr' => 'Marathi',\n\t\t'ms' => 'Malay',\n\t\t'mg' => 'Malagasy',\n\t\t'mt' => 'Maltese',\n\t\t'mo' => 'Moldavian',\n\t\t'mn' => 'Mongolian',\n\t\t'na' => 'Nauru',\n\t\t'nv' => 'Navajo; Navaho',\n\t\t'nr' => 'Ndebele, South; South Ndebele',\n\t\t'nd' => 'Ndebele, North; North Ndebele',\n\t\t'ng' => 'Ndonga',\n\t\t'ne' => 'Nepali',\n\t\t'nn' => 'Norwegian Nynorsk; Nynorsk, Norwegian',\n\t\t'nb' => 'Bokm\u00c3\u00a5l, Norwegian, Norwegian Bokm\u00c3\u00a5l',\n\t\t'no' => 'Norwegian',\n\t\t'ny' => 'Chichewa; Chewa; Nyanja',\n\t\t'oc' => 'Occitan, Proven\u00c3\u00a7al',\n\t\t'oj' => 'Ojibwa',\n\t\t'or' => 'Oriya',\n\t\t'om' => 'Oromo',\n\t\t'os' => 'Ossetian; Ossetic',\n\t\t'pa' => 'Panjabi; Punjabi',\n\t\t'fa' => 'Persian',\n\t\t'pi' => 'Pali',\n\t\t'pl' => 'Polish',\n\t\t'pt' => 'Portuguese',\n\t\t'ps' => 'Pushto',\n\t\t'qu' => 'Quechua',\n\t\t'rm' => 'Romansh',\n\t\t'ro' => 'Romanian',\n\t\t'rn' => 'Rundi',\n\t\t'ru' => 'Russian',\n\t\t'sg' => 'Sango',\n\t\t'sa' => 'Sanskrit',\n\t\t'sr' => 'Serbian',\n\t\t'hr' => 'Croatian',\n\t\t'si' => 'Sinhala; Sinhalese',\n\t\t'sk' => 'Slovak',\n\t\t'sl' => 'Slovenian',\n\t\t'se' => 'Northern Sami',\n\t\t'sm' => 'Samoan',\n\t\t'sn' => 'Shona',\n\t\t'sd' => 'Sindhi',\n\t\t'so' => 'Somali',\n\t\t'st' => 'Sotho, Southern',\n\t\t'es' => 'Spanish; Castilian',\n\t\t'sc' => 'Sardinian',\n\t\t'ss' => 'Swati',\n\t\t'su' => 'Sundanese',\n\t\t'sw' => 'Swahili',\n\t\t'sv' => 'Swedish',\n\t\t'ty' => 'Tahitian',\n\t\t'ta' => 'Tamil',\n\t\t'tt' => 'Tatar',\n\t\t'te' => 'Telugu',\n\t\t'tg' => 'Tajik',\n\t\t'tl' => 'Tagalog',\n\t\t'th' => 'Thai',\n\t\t'bo' => 'Tibetan',\n\t\t'ti' => 'Tigrinya',\n\t\t'to' => 'Tonga (Tonga Islands)',\n\t\t'tn' => 'Tswana',\n\t\t'ts' => 'Tsonga',\n\t\t'tk' => 'Turkmen',\n\t\t'tr' => 'Turkish',\n\t\t'tw' => 'Twi',\n\t\t'ug' => 'Uighur; Uyghur',\n\t\t'uk' => 'Ukrainian',\n\t\t'ur' => 'Urdu',\n\t\t'uz' => 'Uzbek',\n\t\t've' => 'Venda',\n\t\t'vi' => 'Vietnamese',\n\t\t'vo' => 'Volap\u00c3\u00bck',\n\t\t'cy' => 'Welsh',\n\t\t'wa' => 'Walloon',\n\t\t'wo' => 'Wolof',\n\t\t'xh' => 'Xhosa',\n\t\t'yi' => 'Yiddish',\n\t\t'yo' => 'Yoruba',\n\t\t'za' => 'Zhuang; Chuang',\n\t\t'zu' => 'Zulu',\n\t);\n\n\t/**\n\t * Filters the language codes.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param string[] $lang_codes Array of key/value pairs of language codes where key is the short version.\n\t * @param string   $code       A two-letter designation of the language.\n\t */\n\t$lang_codes = apply_filters( 'lang_codes', $lang_codes, $code );\n\treturn strtr( $code, $lang_codes );\n}\n\n/**\n * Synchronizes category and post tag slugs when global terms are enabled.\n *\n * @since 3.0.0\n *\n * @param WP_Term|array $term     The term.\n * @param string        $taxonomy The taxonomy for `$term`. Should be 'category' or 'post_tag', as these are\n *                                the only taxonomies which are processed by this function; anything else\n *                                will be returned untouched.\n * @return WP_Term|array Returns `$term`, after filtering the 'slug' field with `sanitize_title()`\n *                       if `$taxonomy` is 'category' or 'post_tag'.\n */\nfunction sync_category_tag_slugs( $term, $taxonomy ) {\n\tif ( global_terms_enabled() && ( 'category' === $taxonomy || 'post_tag' === $taxonomy ) ) {\n\t\tif ( is_object( $term ) ) {\n\t\t\t$term->slug = sanitize_title( $term->name );\n\t\t} else {\n\t\t\t$term['slug'] = sanitize_title( $term['name'] );\n\t\t}\n\t}\n\treturn $term;\n}\n\n/**\n * Displays an access denied message when a user tries to view a site's dashboard they\n * do not have access to.\n *\n * @since 3.2.0\n * @access private\n */\nfunction _access_denied_splash() {\n\tif ( ! is_user_logged_in() || is_network_admin() ) {\n\t\treturn;\n\t}\n\n\t$blogs = get_blogs_of_user( get_current_user_id() );\n\n\tif ( wp_list_filter( $blogs, array( 'userblog_id' => get_current_blog_id() ) ) ) {\n\t\treturn;\n\t}\n\n\t$blog_name = get_bloginfo( 'name' );\n\n\tif ( empty( $blogs ) ) {\n\t\twp_die(\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: Site title. */\n\t\t\t\t__( 'You attempted to access the \"%1$s\" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the \"%1$s\" dashboard, please contact your network administrator.' ),\n\t\t\t\t$blog_name\n\t\t\t),\n\t\t\t403\n\t\t);\n\t}\n\n\t$output = '<p>' . sprintf(\n\t\t/* translators: 1: Site title. */\n\t\t__( 'You attempted to access the \"%1$s\" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the \"%1$s\" dashboard, please contact your network administrator.' ),\n\t\t$blog_name\n\t) . '</p>';\n\t$output .= '<p>' . __( 'If you reached this screen by accident and meant to visit one of your own sites, here are some shortcuts to help you find your way.' ) . '</p>';\n\n\t$output .= '<h3>' . __( 'Your Sites' ) . '</h3>';\n\t$output .= '<table>';\n\n\tforeach ( $blogs as $blog ) {\n\t\t$output .= '<tr>';\n\t\t$output .= \"<td>{$blog->blogname}</td>\";\n\t\t$output .= '<td><a href=\"' . esc_url( get_admin_url( $blog->userblog_id ) ) . '\">' . __( 'Visit Dashboard' ) . '</a> | ' .\n\t\t\t'<a href=\"' . esc_url( get_home_url( $blog->userblog_id ) ) . '\">' . __( 'View Site' ) . '</a></td>';\n\t\t$output .= '</tr>';\n\t}\n\n\t$output .= '</table>';\n\n\twp_die( $output, 403 );\n}\n\n/**\n * Checks if the current user has permissions to import new users.\n *\n * @since 3.0.0\n *\n * @param string $permission A permission to be checked. Currently not used.\n * @return bool True if the user has proper permissions, false if they do not.\n */\nfunction check_import_new_users( $permission ) {\n\tif ( ! current_user_can( 'manage_network_users' ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n// See \"import_allow_fetch_attachments\" and \"import_attachment_size_limit\" filters too.\n\n/**\n * Generates and displays a drop-down of available languages.\n *\n * @since 3.0.0\n *\n * @param string[] $lang_files Optional. An array of the language files. Default empty array.\n * @param string   $current    Optional. The current language code. Default empty.\n */\nfunction mu_dropdown_languages( $lang_files = array(), $current = '' ) {\n\t$flag   = false;\n\t$output = array();\n\n\tforeach ( (array) $lang_files as $val ) {\n\t\t$code_lang = basename( $val, '.mo' );\n\n\t\tif ( 'en_US' === $code_lang ) { // American English.\n\t\t\t$flag          = true;\n\t\t\t$ae            = __( 'American English' );\n\t\t\t$output[ $ae ] = '<option value=\"' . esc_attr( $code_lang ) . '\"' . selected( $current, $code_lang, false ) . '> ' . $ae . '</option>';\n\t\t} elseif ( 'en_GB' === $code_lang ) { // British English.\n\t\t\t$flag          = true;\n\t\t\t$be            = __( 'British English' );\n\t\t\t$output[ $be ] = '<option value=\"' . esc_attr( $code_lang ) . '\"' . selected( $current, $code_lang, false ) . '> ' . $be . '</option>';\n\t\t} else {\n\t\t\t$translated            = format_code_lang( $code_lang );\n\t\t\t$output[ $translated ] = '<option value=\"' . esc_attr( $code_lang ) . '\"' . selected( $current, $code_lang, false ) . '> ' . esc_html( $translated ) . '</option>';\n\t\t}\n\t}\n\n\tif ( false === $flag ) { // WordPress English.\n\t\t$output[] = '<option value=\"\"' . selected( $current, '', false ) . '>' . __( 'English' ) . '</option>';\n\t}\n\n\t// Order by name.\n\tuksort( $output, 'strnatcasecmp' );\n\n\t/**\n\t * Filters the languages available in the dropdown.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param string[] $output     Array of HTML output for the dropdown.\n\t * @param string[] $lang_files Array of available language files.\n\t * @param string   $current    The current language code.\n\t */\n\t$output = apply_filters( 'mu_dropdown_languages', $output, $lang_files, $current );\n\n\techo implode( \"\\n\\t\", $output );\n}\n\n/**\n * Displays an admin notice to upgrade all sites after a core upgrade.\n *\n * @since 3.0.0\n *\n * @global int    $wp_db_version WordPress database version.\n * @global string $pagenow\n *\n * @return false False if the current user is not a super admin.\n */\nfunction site_admin_notice() {\n\tglobal $wp_db_version, $pagenow;\n\n\tif ( ! current_user_can( 'upgrade_network' ) ) {\n\t\treturn false;\n\t}\n\n\tif ( 'upgrade.php' === $pagenow ) {\n\t\treturn;\n\t}\n\n\tif ( get_site_option( 'wpmu_upgrade_site' ) != $wp_db_version ) {\n\t\techo \"<div class='update-nag notice notice-warning inline'>\" . sprintf(\n\t\t\t/* translators: %s: URL to Upgrade Network screen. */\n\t\t\t__( 'Thank you for Updating! Please visit the <a href=\"%s\">Upgrade Network</a> page to update all your sites.' ),\n\t\t\tesc_url( network_admin_url( 'upgrade.php' ) )\n\t\t) . '</div>';\n\t}\n}\n\n/**\n * Avoids a collision between a site slug and a permalink slug.\n *\n * In a subdirectory installation this will make sure that a site and a post do not use the\n * same subdirectory by checking for a site with the same name as a new post.\n *\n * @since 3.0.0\n *\n * @param array $data    An array of post data.\n * @param array $postarr An array of posts. Not currently used.\n * @return array The new array of post data after checking for collisions.\n */\nfunction avoid_blog_page_permalink_collision( $data, $postarr ) {\n\tif ( is_subdomain_install() ) {\n\t\treturn $data;\n\t}\n\tif ( 'page' !== $data['post_type'] ) {\n\t\treturn $data;\n\t}\n\tif ( ! isset( $data['post_name'] ) || '' === $data['post_name'] ) {\n\t\treturn $data;\n\t}\n\tif ( ! is_main_site() ) {\n\t\treturn $data;\n\t}\n\n\t$post_name = $data['post_name'];\n\t$c         = 0;\n\twhile ( $c < 10 && get_id_from_blogname( $post_name ) ) {\n\t\t$post_name .= mt_rand( 1, 10 );\n\t\t$c ++;\n\t}\n\tif ( $post_name != $data['post_name'] ) {\n\t\t$data['post_name'] = $post_name;\n\t}\n\treturn $data;\n}\n\n/**\n * Handles the display of choosing a user's primary site.\n *\n * This displays the user's primary site and allows the user to choose\n * which site is primary.\n *\n * @since 3.0.0\n */\nfunction choose_primary_blog() {\n\t?>\n\t<table class=\"form-table\" role=\"presentation\">\n\t<tr>\n\t<?php /* translators: My Sites label. */ ?>\n\t\t<th scope=\"row\"><label for=\"primary_blog\"><?php _e( 'Primary Site' ); ?></label></th>\n\t\t<td>\n\t\t<?php\n\t\t$all_blogs    = get_blogs_of_user( get_current_user_id() );\n\t\t$primary_blog = get_user_meta( get_current_user_id(), 'primary_blog', true );\n\t\tif ( count( $all_blogs ) > 1 ) {\n\t\t\t$found = false;\n\t\t\t?>\n\t\t\t<select name=\"primary_blog\" id=\"primary_blog\">\n\t\t\t\t<?php\n\t\t\t\tforeach ( (array) $all_blogs as $blog ) {\n\t\t\t\t\tif ( $primary_blog == $blog->userblog_id ) {\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t<option value=\"<?php echo $blog->userblog_id; ?>\"<?php selected( $primary_blog, $blog->userblog_id ); ?>><?php echo esc_url( get_home_url( $blog->userblog_id ) ); ?></option>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</select>\n\t\t\t<?php\n\t\t\tif ( ! $found ) {\n\t\t\t\t$blog = reset( $all_blogs );\n\t\t\t\tupdate_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id );\n\t\t\t}\n\t\t} elseif ( count( $all_blogs ) == 1 ) {\n\t\t\t$blog = reset( $all_blogs );\n\t\t\techo esc_url( get_home_url( $blog->userblog_id ) );\n\t\t\tif ( $primary_blog != $blog->userblog_id ) { // Set the primary blog again if it's out of sync with blog list.\n\t\t\t\tupdate_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id );\n\t\t\t}\n\t\t} else {\n\t\t\techo 'N/A';\n\t\t}\n\t\t?>\n\t\t</td>\n\t</tr>\n\t</table>\n\t<?php\n}\n\n/**\n * Whether or not we can edit this network from this page.\n *\n * By default editing of network is restricted to the Network Admin for that `$network_id`.\n * This function allows for this to be overridden.\n *\n * @since 3.1.0\n *\n * @param int $network_id The network ID to check.\n * @return bool True if network can be edited, otherwise false.\n */\nfunction can_edit_network( $network_id ) {\n\tif ( get_current_network_id() == $network_id ) {\n\t\t$result = true;\n\t} else {\n\t\t$result = false;\n\t}\n\n\t/**\n\t * Filters whether this network can be edited from this page.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param bool $result     Whether the network can be edited from this page.\n\t * @param int  $network_id The network ID to check.\n\t */\n\treturn apply_filters( 'can_edit_network', $result, $network_id );\n}\n\n/**\n * Thickbox image paths for Network Admin.\n *\n * @since 3.1.0\n *\n * @access private\n */\nfunction _thickbox_path_admin_subfolder() {\n\t?>\n<script type=\"text/javascript\">\nvar tb_pathToImage = \"<?php echo esc_js( includes_url( 'js/thickbox/loadingAnimation.gif', 'relative' ) ); ?>\";\n</script>\n\t<?php\n}\n\n/**\n * @param array $users\n */\nfunction confirm_delete_users( $users ) {\n\t$current_user = wp_get_current_user();\n\tif ( ! is_array( $users ) || empty( $users ) ) {\n\t\treturn false;\n\t}\n\t?>\n\t<h1><?php esc_html_e( 'Users' ); ?></h1>\n\n\t<?php if ( 1 === count( $users ) ) : ?>\n\t\t<p><?php _e( 'You have chosen to delete the user from all networks and sites.' ); ?></p>\n\t<?php else : ?>\n\t\t<p><?php _e( 'You have chosen to delete the following users from all networks and sites.' ); ?></p>\n\t<?php endif; ?>\n\n\t<form action=\"users.php?action=dodelete\" method=\"post\">\n\t<input type=\"hidden\" name=\"dodelete\" />\n\t<?php\n\twp_nonce_field( 'ms-users-delete' );\n\t$site_admins = get_super_admins();\n\t$admin_out   = '<option value=\"' . esc_attr( $current_user->ID ) . '\">' . $current_user->user_login . '</option>';\n\t?>\n\t<table class=\"form-table\" role=\"presentation\">\n\t<?php\n\t$allusers = (array) $_POST['allusers'];\n\tforeach ( $allusers as $user_id ) {\n\t\tif ( '' !== $user_id && '0' != $user_id ) {\n\t\t\t$delete_user = get_userdata( $user_id );\n\n\t\t\tif ( ! current_user_can( 'delete_user', $delete_user->ID ) ) {\n\t\t\t\twp_die(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: User login. */\n\t\t\t\t\t\t__( 'Warning! User %s cannot be deleted.' ),\n\t\t\t\t\t\t$delete_user->user_login\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( in_array( $delete_user->user_login, $site_admins, true ) ) {\n\t\t\t\twp_die(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: User login. */\n\t\t\t\t\t\t__( 'Warning! User cannot be deleted. The user %s is a network administrator.' ),\n\t\t\t\t\t\t'<em>' . $delete_user->user_login . '</em>'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t?>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><?php echo $delete_user->user_login; ?>\n\t\t\t\t\t<?php echo '<input type=\"hidden\" name=\"user[]\" value=\"' . esc_attr( $user_id ) . '\" />' . \"\\n\"; ?>\n\t\t\t\t</th>\n\t\t\t<?php\n\t\t\t$blogs = get_blogs_of_user( $user_id, true );\n\n\t\t\tif ( ! empty( $blogs ) ) {\n\t\t\t\t?>\n\t\t\t\t<td><fieldset><p><legend>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: User login. */\n\t\t\t\t\t__( 'What should be done with content owned by %s?' ),\n\t\t\t\t\t'<em>' . $delete_user->user_login . '</em>'\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t</legend></p>\n\t\t\t\t<?php\n\t\t\t\tforeach ( (array) $blogs as $key => $details ) {\n\t\t\t\t\t$blog_users = get_users(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'blog_id' => $details->userblog_id,\n\t\t\t\t\t\t\t'fields'  => array( 'ID', 'user_login' ),\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\tif ( is_array( $blog_users ) && ! empty( $blog_users ) ) {\n\t\t\t\t\t\t$user_site      = \"<a href='\" . esc_url( get_home_url( $details->userblog_id ) ) . \"'>{$details->blogname}</a>\";\n\t\t\t\t\t\t$user_dropdown  = '<label for=\"reassign_user\" class=\"screen-reader-text\">' . __( 'Select a user' ) . '</label>';\n\t\t\t\t\t\t$user_dropdown .= \"<select name='blog[$user_id][$key]' id='reassign_user'>\";\n\t\t\t\t\t\t$user_list      = '';\n\n\t\t\t\t\t\tforeach ( $blog_users as $user ) {\n\t\t\t\t\t\t\tif ( ! in_array( (int) $user->ID, $allusers, true ) ) {\n\t\t\t\t\t\t\t\t$user_list .= \"<option value='{$user->ID}'>{$user->user_login}</option>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( '' === $user_list ) {\n\t\t\t\t\t\t\t$user_list = $admin_out;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$user_dropdown .= $user_list;\n\t\t\t\t\t\t$user_dropdown .= \"</select>\\n\";\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<ul style=\"list-style:none;\">\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t/* translators: %s: Link to user's site. */\n\t\t\t\t\t\t\t\tprintf( __( 'Site: %s' ), $user_site );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li><label><input type=\"radio\" id=\"delete_option0\" name=\"delete[<?php echo $details->userblog_id . '][' . $delete_user->ID; ?>]\" value=\"delete\" checked=\"checked\" />\n\t\t\t\t\t\t\t<?php _e( 'Delete all content.' ); ?></label></li>\n\t\t\t\t\t\t\t<li><label><input type=\"radio\" id=\"delete_option1\" name=\"delete[<?php echo $details->userblog_id . '][' . $delete_user->ID; ?>]\" value=\"reassign\" />\n\t\t\t\t\t\t\t<?php _e( 'Attribute all content to:' ); ?></label>\n\t\t\t\t\t\t\t<?php echo $user_dropdown; ?></li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\techo '</fieldset></td></tr>';\n\t\t\t} else {\n\t\t\t\t?>\n\t\t\t\t<td><p><?php _e( 'User has no sites or content and will be deleted.' ); ?></p></td>\n\t\t\t<?php } ?>\n\t\t\t</tr>\n\t\t\t<?php\n\t\t}\n\t}\n\n\t?>\n\t</table>\n\t<?php\n\t/** This action is documented in wp-admin/users.php */\n\tdo_action( 'delete_user_form', $current_user, $allusers );\n\n\tif ( 1 === count( $users ) ) :\n\t\t?>\n\t\t<p><?php _e( 'Once you hit &#8220;Confirm Deletion&#8221;, the user will be permanently removed.' ); ?></p>\n\t<?php else : ?>\n\t\t<p><?php _e( 'Once you hit &#8220;Confirm Deletion&#8221;, these users will be permanently removed.' ); ?></p>\n\t\t<?php\n\tendif;\n\n\tsubmit_button( __( 'Confirm Deletion' ), 'primary' );\n\t?>\n\t</form>\n\t<?php\n\treturn true;\n}\n\n/**\n * Print JavaScript in the header on the Network Settings screen.\n *\n * @since 4.1.0\n */\nfunction network_settings_add_js() {\n\t?>\n<script type=\"text/javascript\">\njQuery(document).ready( function($) {\n\tvar languageSelect = $( '#WPLANG' );\n\t$( 'form' ).submit( function() {\n\t\t// Don't show a spinner for English and installed languages,\n\t\t// as there is nothing to download.\n\t\tif ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {\n\t\t\t$( '#submit', this ).after( '<span class=\"spinner language-install-spinner is-active\" />' );\n\t\t}\n\t});\n});\n</script>\n\t<?php\n}\n\n/**\n * Outputs the HTML for a network's \"Edit Site\" tabular interface.\n *\n * @since 4.6.0\n *\n * @param array $args {\n *     Optional. Array or string of Query parameters. Default empty array.\n *\n *     @type int    $blog_id  The site ID. Default is the current site.\n *     @type array  $links    The tabs to include with (label|url|cap) keys.\n *     @type string $selected The ID of the selected link.\n * }\n */\nfunction network_edit_site_nav( $args = array() ) {\n\n\t/**\n\t * Filters the links that appear on site-editing network pages.\n\t *\n\t * Default links: 'site-info', 'site-users', 'site-themes', and 'site-settings'.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param array $links {\n\t *     An array of link data representing individual network admin pages.\n\t *\n\t *     @type array $link_slug {\n\t *         An array of information about the individual link to a page.\n\t *\n\t *         $type string $label Label to use for the link.\n\t *         $type string $url   URL, relative to `network_admin_url()` to use for the link.\n\t *         $type string $cap   Capability required to see the link.\n\t *     }\n\t * }\n\t */\n\t$links = apply_filters(\n\t\t'network_edit_site_nav_links',\n\t\tarray(\n\t\t\t'site-info'     => array(\n\t\t\t\t'label' => __( 'Info' ),\n\t\t\t\t'url'   => 'site-info.php',\n\t\t\t\t'cap'   => 'manage_sites',\n\t\t\t),\n\t\t\t'site-users'    => array(\n\t\t\t\t'label' => __( 'Users' ),\n\t\t\t\t'url'   => 'site-users.php',\n\t\t\t\t'cap'   => 'manage_sites',\n\t\t\t),\n\t\t\t'site-themes'   => array(\n\t\t\t\t'label' => __( 'Themes' ),\n\t\t\t\t'url'   => 'site-themes.php',\n\t\t\t\t'cap'   => 'manage_sites',\n\t\t\t),\n\t\t\t'site-settings' => array(\n\t\t\t\t'label' => __( 'Settings' ),\n\t\t\t\t'url'   => 'site-settings.php',\n\t\t\t\t'cap'   => 'manage_sites',\n\t\t\t),\n\t\t)\n\t);\n\n\t// Parse arguments.\n\t$parsed_args = wp_parse_args(\n\t\t$args,\n\t\tarray(\n\t\t\t'blog_id'  => isset( $_GET['blog_id'] ) ? (int) $_GET['blog_id'] : 0,\n\t\t\t'links'    => $links,\n\t\t\t'selected' => 'site-info',\n\t\t)\n\t);\n\n\t// Setup the links array.\n\t$screen_links = array();\n\n\t// Loop through tabs.\n\tforeach ( $parsed_args['links'] as $link_id => $link ) {\n\n\t\t// Skip link if user can't access.\n\t\tif ( ! current_user_can( $link['cap'], $parsed_args['blog_id'] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Link classes.\n\t\t$classes = array( 'nav-tab' );\n\n\t\t// Aria-current attribute.\n\t\t$aria_current = '';\n\n\t\t// Selected is set by the parent OR assumed by the $pagenow global.\n\t\tif ( $parsed_args['selected'] === $link_id || $link['url'] === $GLOBALS['pagenow'] ) {\n\t\t\t$classes[]    = 'nav-tab-active';\n\t\t\t$aria_current = ' aria-current=\"page\"';\n\t\t}\n\n\t\t// Escape each class.\n\t\t$esc_classes = implode( ' ', $classes );\n\n\t\t// Get the URL for this link.\n\t\t$url = add_query_arg( array( 'id' => $parsed_args['blog_id'] ), network_admin_url( $link['url'] ) );\n\n\t\t// Add link to nav links.\n\t\t$screen_links[ $link_id ] = '<a href=\"' . esc_url( $url ) . '\" id=\"' . esc_attr( $link_id ) . '\" class=\"' . $esc_classes . '\"' . $aria_current . '>' . esc_html( $link['label'] ) . '</a>';\n\t}\n\n\t// All done!\n\techo '<nav class=\"nav-tab-wrapper wp-clearfix\" aria-label=\"' . esc_attr__( 'Secondary menu' ) . '\">';\n\techo implode( '', $screen_links );\n\techo '</nav>';\n}\n\n/**\n * Returns the arguments for the help tab on the Edit Site screens.\n *\n * @since 4.9.0\n *\n * @return array Help tab arguments.\n */\nfunction get_site_screen_help_tab_args() {\n\treturn array(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t'<p>' . __( 'The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.' ) . '</p>' .\n\t\t\t'<p>' . __( '<strong>Info</strong> &mdash; The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.' ) . '</p>' .\n\t\t\t'<p>' . __( '<strong>Users</strong> &mdash; This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.' ) . '</p>' .\n\t\t\t'<p>' . sprintf(\n\t\t\t\t/* translators: %s: URL to Network Themes screen. */\n\t\t\t\t__( '<strong>Themes</strong> &mdash; This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site&#8217;s Appearance menu. To enable a theme for the entire network, see the <a href=\"%s\">Network Themes</a> screen.' ),\n\t\t\t\tnetwork_admin_url( 'themes.php' )\n\t\t\t) . '</p>' .\n\t\t\t'<p>' . __( '<strong>Settings</strong> &mdash; This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.' ) . '</p>',\n\t);\n}\n\n/**\n * Returns the content for the help sidebar on the Edit Site screens.\n *\n * @since 4.9.0\n *\n * @return string Help sidebar content.\n */\nfunction get_site_screen_help_sidebar_content() {\n\treturn '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/network-admin-sites-screen/\">Documentation on Site Management</a>' ) . '</p>' .\n\t\t'<p>' . __( '<a href=\"https://wordpress.org/support/forum/multisite/\">Support Forums</a>' ) . '</p>';\n}\n", "num_lines": 1161}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Core Navigation Menu API\n *\n * @package WordPress\n * @subpackage Nav_Menus\n * @since 3.0.0\n */\n\n/** Walker_Nav_Menu_Edit class */\nrequire_once ABSPATH . 'wp-admin/includes/class-walker-nav-menu-edit.php';\n\n/** Walker_Nav_Menu_Checklist class */\nrequire_once ABSPATH . 'wp-admin/includes/class-walker-nav-menu-checklist.php';\n\n/**\n * Prints the appropriate response to a menu quick search.\n *\n * @since 3.0.0\n *\n * @param array $request The unsanitized request values.\n */\nfunction _wp_ajax_menu_quick_search( $request = array() ) {\n\t$args            = array();\n\t$type            = isset( $request['type'] ) ? $request['type'] : '';\n\t$object_type     = isset( $request['object_type'] ) ? $request['object_type'] : '';\n\t$query           = isset( $request['q'] ) ? $request['q'] : '';\n\t$response_format = isset( $request['response-format'] ) ? $request['response-format'] : '';\n\n\tif ( ! $response_format || ! in_array( $response_format, array( 'json', 'markup' ), true ) ) {\n\t\t$response_format = 'json';\n\t}\n\n\tif ( 'markup' === $response_format ) {\n\t\t$args['walker'] = new Walker_Nav_Menu_Checklist;\n\t}\n\n\tif ( 'get-post-item' === $type ) {\n\t\tif ( post_type_exists( $object_type ) ) {\n\t\t\tif ( isset( $request['ID'] ) ) {\n\t\t\t\t$object_id = (int) $request['ID'];\n\t\t\t\tif ( 'markup' === $response_format ) {\n\t\t\t\t\techo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', array( get_post( $object_id ) ) ), 0, (object) $args );\n\t\t\t\t} elseif ( 'json' === $response_format ) {\n\t\t\t\t\techo wp_json_encode(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'ID'         => $object_id,\n\t\t\t\t\t\t\t'post_title' => get_the_title( $object_id ),\n\t\t\t\t\t\t\t'post_type'  => get_post_type( $object_id ),\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\techo \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( taxonomy_exists( $object_type ) ) {\n\t\t\tif ( isset( $request['ID'] ) ) {\n\t\t\t\t$object_id = (int) $request['ID'];\n\t\t\t\tif ( 'markup' === $response_format ) {\n\t\t\t\t\techo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', array( get_term( $object_id, $object_type ) ) ), 0, (object) $args );\n\t\t\t\t} elseif ( 'json' === $response_format ) {\n\t\t\t\t\t$post_obj = get_term( $object_id, $object_type );\n\t\t\t\t\techo wp_json_encode(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'ID'         => $object_id,\n\t\t\t\t\t\t\t'post_title' => $post_obj->name,\n\t\t\t\t\t\t\t'post_type'  => $object_type,\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\techo \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} elseif ( preg_match( '/quick-search-(posttype|taxonomy)-([a-zA-Z_-]*\\b)/', $type, $matches ) ) {\n\t\tif ( 'posttype' === $matches[1] && get_post_type_object( $matches[2] ) ) {\n\t\t\t$post_type_obj = _wp_nav_menu_meta_box_object( get_post_type_object( $matches[2] ) );\n\t\t\t$args          = array_merge(\n\t\t\t\t$args,\n\t\t\t\tarray(\n\t\t\t\t\t'no_found_rows'          => true,\n\t\t\t\t\t'update_post_meta_cache' => false,\n\t\t\t\t\t'update_post_term_cache' => false,\n\t\t\t\t\t'posts_per_page'         => 10,\n\t\t\t\t\t'post_type'              => $matches[2],\n\t\t\t\t\t's'                      => $query,\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ( isset( $post_type_obj->_default_query ) ) {\n\t\t\t\t$args = array_merge( $args, (array) $post_type_obj->_default_query );\n\t\t\t}\n\t\t\t$search_results_query = new WP_Query( $args );\n\t\t\tif ( ! $search_results_query->have_posts() ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\twhile ( $search_results_query->have_posts() ) {\n\t\t\t\t$post = $search_results_query->next_post();\n\t\t\t\tif ( 'markup' === $response_format ) {\n\t\t\t\t\t$var_by_ref = $post->ID;\n\t\t\t\t\techo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', array( get_post( $var_by_ref ) ) ), 0, (object) $args );\n\t\t\t\t} elseif ( 'json' === $response_format ) {\n\t\t\t\t\techo wp_json_encode(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'ID'         => $post->ID,\n\t\t\t\t\t\t\t'post_title' => get_the_title( $post->ID ),\n\t\t\t\t\t\t\t'post_type'  => $matches[2],\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\techo \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( 'taxonomy' === $matches[1] ) {\n\t\t\t$terms = get_terms(\n\t\t\t\tarray(\n\t\t\t\t\t'taxonomy'   => $matches[2],\n\t\t\t\t\t'name__like' => $query,\n\t\t\t\t\t'number'     => 10,\n\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ( empty( $terms ) || is_wp_error( $terms ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tforeach ( (array) $terms as $term ) {\n\t\t\t\tif ( 'markup' === $response_format ) {\n\t\t\t\t\techo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', array( $term ) ), 0, (object) $args );\n\t\t\t\t} elseif ( 'json' === $response_format ) {\n\t\t\t\t\techo wp_json_encode(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'ID'         => $term->term_id,\n\t\t\t\t\t\t\t'post_title' => $term->name,\n\t\t\t\t\t\t\t'post_type'  => $matches[2],\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\techo \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Register nav menu meta boxes and advanced menu items.\n *\n * @since 3.0.0\n */\nfunction wp_nav_menu_setup() {\n\t// Register meta boxes.\n\twp_nav_menu_post_type_meta_boxes();\n\tadd_meta_box( 'add-custom-links', __( 'Custom Links' ), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );\n\twp_nav_menu_taxonomy_meta_boxes();\n\n\t// Register advanced menu items (columns).\n\tadd_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' );\n\n\t// If first time editing, disable advanced items by default.\n\tif ( false === get_user_option( 'managenav-menuscolumnshidden' ) ) {\n\t\t$user = wp_get_current_user();\n\t\tupdate_user_option(\n\t\t\t$user->ID,\n\t\t\t'managenav-menuscolumnshidden',\n\t\t\tarray(\n\t\t\t\t0 => 'link-target',\n\t\t\t\t1 => 'css-classes',\n\t\t\t\t2 => 'xfn',\n\t\t\t\t3 => 'description',\n\t\t\t\t4 => 'title-attribute',\n\t\t\t),\n\t\t\ttrue\n\t\t);\n\t}\n}\n\n/**\n * Limit the amount of meta boxes to pages, posts, links, and categories for first time users.\n *\n * @since 3.0.0\n *\n * @global array $wp_meta_boxes\n */\nfunction wp_initial_nav_menu_meta_boxes() {\n\tglobal $wp_meta_boxes;\n\n\tif ( get_user_option( 'metaboxhidden_nav-menus' ) !== false || ! is_array( $wp_meta_boxes ) ) {\n\t\treturn;\n\t}\n\n\t$initial_meta_boxes = array( 'add-post-type-page', 'add-post-type-post', 'add-custom-links', 'add-category' );\n\t$hidden_meta_boxes  = array();\n\n\tforeach ( array_keys( $wp_meta_boxes['nav-menus'] ) as $context ) {\n\t\tforeach ( array_keys( $wp_meta_boxes['nav-menus'][ $context ] ) as $priority ) {\n\t\t\tforeach ( $wp_meta_boxes['nav-menus'][ $context ][ $priority ] as $box ) {\n\t\t\t\tif ( in_array( $box['id'], $initial_meta_boxes, true ) ) {\n\t\t\t\t\tunset( $box['id'] );\n\t\t\t\t} else {\n\t\t\t\t\t$hidden_meta_boxes[] = $box['id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t$user = wp_get_current_user();\n\tupdate_user_option( $user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true );\n}\n\n/**\n * Creates meta boxes for any post type menu item..\n *\n * @since 3.0.0\n */\nfunction wp_nav_menu_post_type_meta_boxes() {\n\t$post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'object' );\n\n\tif ( ! $post_types ) {\n\t\treturn;\n\t}\n\n\tforeach ( $post_types as $post_type ) {\n\t\t/**\n\t\t * Filters whether a menu items meta box will be added for the current\n\t\t * object type.\n\t\t *\n\t\t * If a falsey value is returned instead of an object, the menu items\n\t\t * meta box for the current meta box object will not be added.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param WP_Post_Type|false $post_type The current object to add a menu items\n\t\t *                                      meta box for.\n\t\t */\n\t\t$post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );\n\t\tif ( $post_type ) {\n\t\t\t$id = $post_type->name;\n\t\t\t// Give pages a higher priority.\n\t\t\t$priority = ( 'page' === $post_type->name ? 'core' : 'default' );\n\t\t\tadd_meta_box( \"add-post-type-{$id}\", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', $priority, $post_type );\n\t\t}\n\t}\n}\n\n/**\n * Creates meta boxes for any taxonomy menu item.\n *\n * @since 3.0.0\n */\nfunction wp_nav_menu_taxonomy_meta_boxes() {\n\t$taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'object' );\n\n\tif ( ! $taxonomies ) {\n\t\treturn;\n\t}\n\n\tforeach ( $taxonomies as $tax ) {\n\t\t/** This filter is documented in wp-admin/includes/nav-menu.php */\n\t\t$tax = apply_filters( 'nav_menu_meta_box_object', $tax );\n\t\tif ( $tax ) {\n\t\t\t$id = $tax->name;\n\t\t\tadd_meta_box( \"add-{$id}\", $tax->labels->name, 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax );\n\t\t}\n\t}\n}\n\n/**\n * Check whether to disable the Menu Locations meta box submit button and inputs.\n *\n * @since 3.6.0\n * @since 5.3.1 The `$echo` parameter was added.\n *\n * @global bool $one_theme_location_no_menus to determine if no menus exist\n *\n * @param int|string $nav_menu_selected_id ID, name, or slug of the currently selected menu.\n * @param bool       $echo                 Whether to echo or just return the string.\n * @return string|false Disabled attribute if at least one menu exists, false if not.\n */\nfunction wp_nav_menu_disabled_check( $nav_menu_selected_id, $echo = true ) {\n\tglobal $one_theme_location_no_menus;\n\n\tif ( $one_theme_location_no_menus ) {\n\t\treturn false;\n\t}\n\n\treturn disabled( $nav_menu_selected_id, 0, $echo );\n}\n\n/**\n * Displays a meta box for the custom links menu item.\n *\n * @since 3.0.0\n *\n * @global int        $_nav_menu_placeholder\n * @global int|string $nav_menu_selected_id\n */\nfunction wp_nav_menu_item_link_meta_box() {\n\tglobal $_nav_menu_placeholder, $nav_menu_selected_id;\n\n\t$_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1;\n\n\t?>\n\t<div class=\"customlinkdiv\" id=\"customlinkdiv\">\n\t\t<input type=\"hidden\" value=\"custom\" name=\"menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-type]\" />\n\t\t<p id=\"menu-item-url-wrap\" class=\"wp-clearfix\">\n\t\t\t<label class=\"howto\" for=\"custom-menu-item-url\"><?php _e( 'URL' ); ?></label>\n\t\t\t<input id=\"custom-menu-item-url\" name=\"menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-url]\" type=\"text\"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class=\"code menu-item-textbox\" placeholder=\"https://\" />\n\t\t</p>\n\n\t\t<p id=\"menu-item-name-wrap\" class=\"wp-clearfix\">\n\t\t\t<label class=\"howto\" for=\"custom-menu-item-name\"><?php _e( 'Link Text' ); ?></label>\n\t\t\t<input id=\"custom-menu-item-name\" name=\"menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-title]\" type=\"text\"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class=\"regular-text menu-item-textbox\" />\n\t\t</p>\n\n\t\t<p class=\"button-controls wp-clearfix\">\n\t\t\t<span class=\"add-to-menu\">\n\t\t\t\t<input type=\"submit\"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class=\"button submit-add-to-menu right\" value=\"<?php esc_attr_e( 'Add to Menu' ); ?>\" name=\"add-custom-menu-item\" id=\"submit-customlinkdiv\" />\n\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t</span>\n\t\t</p>\n\n\t</div><!-- /.customlinkdiv -->\n\t<?php\n}\n\n/**\n * Displays a meta box for a post type menu item.\n *\n * @since 3.0.0\n *\n * @global int        $_nav_menu_placeholder\n * @global int|string $nav_menu_selected_id\n *\n * @param string $object Not used.\n * @param array  $box {\n *     Post type menu item meta box arguments.\n *\n *     @type string       $id       Meta box 'id' attribute.\n *     @type string       $title    Meta box title.\n *     @type callable     $callback Meta box display callback.\n *     @type WP_Post_Type $args     Extra meta box arguments (the post type object for this meta box).\n * }\n */\nfunction wp_nav_menu_item_post_type_meta_box( $object, $box ) {\n\tglobal $_nav_menu_placeholder, $nav_menu_selected_id;\n\n\t$post_type_name = $box['args']->name;\n\t$post_type      = get_post_type_object( $post_type_name );\n\t$tab_name       = $post_type_name . '-tab';\n\n\t// Paginate browsing for large numbers of post objects.\n\t$per_page = 50;\n\t$pagenum  = isset( $_REQUEST[ $tab_name ] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;\n\t$offset   = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0;\n\n\t$args = array(\n\t\t'offset'                 => $offset,\n\t\t'order'                  => 'ASC',\n\t\t'orderby'                => 'title',\n\t\t'posts_per_page'         => $per_page,\n\t\t'post_type'              => $post_type_name,\n\t\t'suppress_filters'       => true,\n\t\t'update_post_term_cache' => false,\n\t\t'update_post_meta_cache' => false,\n\t);\n\n\tif ( isset( $box['args']->_default_query ) ) {\n\t\t$args = array_merge( $args, (array) $box['args']->_default_query );\n\t}\n\n\t/*\n\t * If we're dealing with pages, let's prioritize the Front Page,\n\t * Posts Page and Privacy Policy Page at the top of the list.\n\t */\n\t$important_pages = array();\n\tif ( 'page' === $post_type_name ) {\n\t\t$suppress_page_ids = array();\n\n\t\t// Insert Front Page or custom Home link.\n\t\t$front_page = 'page' === get_option( 'show_on_front' ) ? (int) get_option( 'page_on_front' ) : 0;\n\n\t\t$front_page_obj = null;\n\t\tif ( ! empty( $front_page ) ) {\n\t\t\t$front_page_obj                = get_post( $front_page );\n\t\t\t$front_page_obj->front_or_home = true;\n\n\t\t\t$important_pages[]   = $front_page_obj;\n\t\t\t$suppress_page_ids[] = $front_page_obj->ID;\n\t\t} else {\n\t\t\t$_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval( $_nav_menu_placeholder ) - 1 : -1;\n\t\t\t$front_page_obj        = (object) array(\n\t\t\t\t'front_or_home' => true,\n\t\t\t\t'ID'            => 0,\n\t\t\t\t'object_id'     => $_nav_menu_placeholder,\n\t\t\t\t'post_content'  => '',\n\t\t\t\t'post_excerpt'  => '',\n\t\t\t\t'post_parent'   => '',\n\t\t\t\t'post_title'    => _x( 'Home', 'nav menu home label' ),\n\t\t\t\t'post_type'     => 'nav_menu_item',\n\t\t\t\t'type'          => 'custom',\n\t\t\t\t'url'           => home_url( '/' ),\n\t\t\t);\n\n\t\t\t$important_pages[] = $front_page_obj;\n\t\t}\n\n\t\t// Insert Posts Page.\n\t\t$posts_page = 'page' === get_option( 'show_on_front' ) ? (int) get_option( 'page_for_posts' ) : 0;\n\n\t\tif ( ! empty( $posts_page ) ) {\n\t\t\t$posts_page_obj             = get_post( $posts_page );\n\t\t\t$posts_page_obj->posts_page = true;\n\n\t\t\t$important_pages[]   = $posts_page_obj;\n\t\t\t$suppress_page_ids[] = $posts_page_obj->ID;\n\t\t}\n\n\t\t// Insert Privacy Policy Page.\n\t\t$privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );\n\n\t\tif ( ! empty( $privacy_policy_page_id ) ) {\n\t\t\t$privacy_policy_page = get_post( $privacy_policy_page_id );\n\t\t\tif ( $privacy_policy_page instanceof WP_Post && 'publish' === $privacy_policy_page->post_status ) {\n\t\t\t\t$privacy_policy_page->privacy_policy_page = true;\n\n\t\t\t\t$important_pages[]   = $privacy_policy_page;\n\t\t\t\t$suppress_page_ids[] = $privacy_policy_page->ID;\n\t\t\t}\n\t\t}\n\n\t\t// Add suppression array to arguments for WP_Query.\n\t\tif ( ! empty( $suppress_page_ids ) ) {\n\t\t\t$args['post__not_in'] = $suppress_page_ids;\n\t\t}\n\t}\n\n\t// @todo Transient caching of these results with proper invalidation on updating of a post of this type.\n\t$get_posts = new WP_Query;\n\t$posts     = $get_posts->query( $args );\n\n\t// Only suppress and insert when more than just suppression pages available.\n\tif ( ! $get_posts->post_count ) {\n\t\tif ( ! empty( $suppress_page_ids ) ) {\n\t\t\tunset( $args['post__not_in'] );\n\t\t\t$get_posts = new WP_Query;\n\t\t\t$posts     = $get_posts->query( $args );\n\t\t} else {\n\t\t\techo '<p>' . __( 'No items.' ) . '</p>';\n\t\t\treturn;\n\t\t}\n\t} elseif ( ! empty( $important_pages ) ) {\n\t\t$posts = array_merge( $important_pages, $posts );\n\t}\n\n\t$num_pages = $get_posts->max_num_pages;\n\n\t$page_links = paginate_links(\n\t\tarray(\n\t\t\t'base'               => add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t$tab_name     => 'all',\n\t\t\t\t\t'paged'       => '%#%',\n\t\t\t\t\t'item-type'   => 'post_type',\n\t\t\t\t\t'item-object' => $post_type_name,\n\t\t\t\t)\n\t\t\t),\n\t\t\t'format'             => '',\n\t\t\t'prev_text'          => '<span aria-label=\"' . esc_attr__( 'Previous page' ) . '\">' . __( '&laquo;' ) . '</span>',\n\t\t\t'next_text'          => '<span aria-label=\"' . esc_attr__( 'Next page' ) . '\">' . __( '&raquo;' ) . '</span>',\n\t\t\t'before_page_number' => '<span class=\"screen-reader-text\">' . __( 'Page' ) . '</span> ',\n\t\t\t'total'              => $num_pages,\n\t\t\t'current'            => $pagenum,\n\t\t)\n\t);\n\n\t$db_fields = false;\n\tif ( is_post_type_hierarchical( $post_type_name ) ) {\n\t\t$db_fields = array(\n\t\t\t'parent' => 'post_parent',\n\t\t\t'id'     => 'ID',\n\t\t);\n\t}\n\n\t$walker = new Walker_Nav_Menu_Checklist( $db_fields );\n\n\t$current_tab = 'most-recent';\n\n\tif ( isset( $_REQUEST[ $tab_name ] ) && in_array( $_REQUEST[ $tab_name ], array( 'all', 'search' ), true ) ) {\n\t\t$current_tab = $_REQUEST[ $tab_name ];\n\t}\n\n\tif ( ! empty( $_REQUEST[ 'quick-search-posttype-' . $post_type_name ] ) ) {\n\t\t$current_tab = 'search';\n\t}\n\n\t$removed_args = array(\n\t\t'action',\n\t\t'customlink-tab',\n\t\t'edit-menu-item',\n\t\t'menu-item',\n\t\t'page-tab',\n\t\t'_wpnonce',\n\t);\n\n\t$most_recent_url = '';\n\t$view_all_url    = '';\n\t$search_url      = '';\n\tif ( $nav_menu_selected_id ) {\n\t\t$most_recent_url = esc_url( add_query_arg( $tab_name, 'most-recent', remove_query_arg( $removed_args ) ) );\n\t\t$view_all_url    = esc_url( add_query_arg( $tab_name, 'all', remove_query_arg( $removed_args ) ) );\n\t\t$search_url      = esc_url( add_query_arg( $tab_name, 'search', remove_query_arg( $removed_args ) ) );\n\t}\n\t?>\n\t<div id=\"posttype-<?php echo $post_type_name; ?>\" class=\"posttypediv\">\n\t\t<ul id=\"posttype-<?php echo $post_type_name; ?>-tabs\" class=\"posttype-tabs add-menu-item-tabs\">\n\t\t\t<li <?php echo ( 'most-recent' === $current_tab ? ' class=\"tabs\"' : '' ); ?>>\n\t\t\t\t<a class=\"nav-tab-link\" data-type=\"tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-most-recent\" href=\"<?php echo $most_recent_url; ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent\">\n\t\t\t\t\t<?php _e( 'Most Recent' ); ?>\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t\t<li <?php echo ( 'all' === $current_tab ? ' class=\"tabs\"' : '' ); ?>>\n\t\t\t\t<a class=\"nav-tab-link\" data-type=\"<?php echo esc_attr( $post_type_name ); ?>-all\" href=\"<?php echo $view_all_url; ?>#<?php echo $post_type_name; ?>-all\">\n\t\t\t\t\t<?php _e( 'View All' ); ?>\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t\t<li <?php echo ( 'search' === $current_tab ? ' class=\"tabs\"' : '' ); ?>>\n\t\t\t\t<a class=\"nav-tab-link\" data-type=\"tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-search\" href=\"<?php echo $search_url; ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search\">\n\t\t\t\t\t<?php _e( 'Search' ); ?>\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t</ul><!-- .posttype-tabs -->\n\n\t\t<div id=\"tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent\" class=\"tabs-panel <?php echo ( 'most-recent' === $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>\" role=\"region\" aria-label=\"<?php _e( 'Most Recent' ); ?>\" tabindex=\"0\">\n\t\t\t<ul id=\"<?php echo $post_type_name; ?>checklist-most-recent\" class=\"categorychecklist form-no-clear\">\n\t\t\t\t<?php\n\t\t\t\t$recent_args    = array_merge(\n\t\t\t\t\t$args,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'orderby'        => 'post_date',\n\t\t\t\t\t\t'order'          => 'DESC',\n\t\t\t\t\t\t'posts_per_page' => 15,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$most_recent    = $get_posts->query( $recent_args );\n\t\t\t\t$args['walker'] = $walker;\n\n\t\t\t\t/**\n\t\t\t\t * Filters the posts displayed in the 'Most Recent' tab of the current\n\t\t\t\t * post type's menu items meta box.\n\t\t\t\t *\n\t\t\t\t * The dynamic portion of the hook name, `$post_type_name`, refers to the post type name.\n\t\t\t\t *\n\t\t\t\t * @since 4.3.0\n\t\t\t\t * @since 4.9.0 Added the `$recent_args` parameter.\n\t\t\t\t *\n\t\t\t\t * @param WP_Post[] $most_recent An array of post objects being listed.\n\t\t\t\t * @param array     $args        An array of `WP_Query` arguments for the meta box.\n\t\t\t\t * @param array     $box         Arguments passed to `wp_nav_menu_item_post_type_meta_box()`.\n\t\t\t\t * @param array     $recent_args An array of `WP_Query` arguments for 'Most Recent' tab.\n\t\t\t\t */\n\t\t\t\t$most_recent = apply_filters( \"nav_menu_items_{$post_type_name}_recent\", $most_recent, $args, $box, $recent_args );\n\n\t\t\t\techo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $most_recent ), 0, (object) $args );\n\t\t\t\t?>\n\t\t\t</ul>\n\t\t</div><!-- /.tabs-panel -->\n\n\t\t<div class=\"tabs-panel <?php echo ( 'search' === $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>\" id=\"tabs-panel-posttype-<?php echo $post_type_name; ?>-search\" role=\"region\" aria-label=\"<?php echo $post_type->labels->search_items; ?>\" tabindex=\"0\">\n\t\t\t<?php\n\t\t\tif ( isset( $_REQUEST[ 'quick-search-posttype-' . $post_type_name ] ) ) {\n\t\t\t\t$searched       = esc_attr( $_REQUEST[ 'quick-search-posttype-' . $post_type_name ] );\n\t\t\t\t$search_results = get_posts(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t's'         => $searched,\n\t\t\t\t\t\t'post_type' => $post_type_name,\n\t\t\t\t\t\t'fields'    => 'all',\n\t\t\t\t\t\t'order'     => 'DESC',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$searched       = '';\n\t\t\t\t$search_results = array();\n\t\t\t}\n\t\t\t?>\n\t\t\t<p class=\"quick-search-wrap\">\n\t\t\t\t<label for=\"quick-search-posttype-<?php echo $post_type_name; ?>\" class=\"screen-reader-text\"><?php _e( 'Search' ); ?></label>\n\t\t\t\t<input type=\"search\"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class=\"quick-search\" value=\"<?php echo $searched; ?>\" name=\"quick-search-posttype-<?php echo $post_type_name; ?>\" id=\"quick-search-posttype-<?php echo $post_type_name; ?>\" />\n\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t\t<?php submit_button( __( 'Search' ), 'small quick-search-submit hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-posttype-' . $post_type_name ) ); ?>\n\t\t\t</p>\n\n\t\t\t<ul id=\"<?php echo $post_type_name; ?>-search-checklist\" data-wp-lists=\"list:<?php echo $post_type_name; ?>\" class=\"categorychecklist form-no-clear\">\n\t\t\t<?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>\n\t\t\t\t<?php\n\t\t\t\t$args['walker'] = $walker;\n\t\t\t\techo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $search_results ), 0, (object) $args );\n\t\t\t\t?>\n\t\t\t<?php elseif ( is_wp_error( $search_results ) ) : ?>\n\t\t\t\t<li><?php echo $search_results->get_error_message(); ?></li>\n\t\t\t<?php elseif ( ! empty( $searched ) ) : ?>\n\t\t\t\t<li><?php _e( 'No results found.' ); ?></li>\n\t\t\t<?php endif; ?>\n\t\t\t</ul>\n\t\t</div><!-- /.tabs-panel -->\n\n\t\t<div id=\"<?php echo $post_type_name; ?>-all\" class=\"tabs-panel tabs-panel-view-all <?php echo ( 'all' === $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>\" role=\"region\" aria-label=\"<?php echo $post_type->labels->all_items; ?>\" tabindex=\"0\">\n\t\t\t<?php if ( ! empty( $page_links ) ) : ?>\n\t\t\t\t<div class=\"add-menu-item-pagelinks\">\n\t\t\t\t\t<?php echo $page_links; ?>\n\t\t\t\t</div>\n\t\t\t<?php endif; ?>\n\t\t\t<ul id=\"<?php echo $post_type_name; ?>checklist\" data-wp-lists=\"list:<?php echo $post_type_name; ?>\" class=\"categorychecklist form-no-clear\">\n\t\t\t\t<?php\n\t\t\t\t$args['walker'] = $walker;\n\n\t\t\t\tif ( $post_type->has_archive ) {\n\t\t\t\t\t$_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval( $_nav_menu_placeholder ) - 1 : -1;\n\t\t\t\t\tarray_unshift(\n\t\t\t\t\t\t$posts,\n\t\t\t\t\t\t(object) array(\n\t\t\t\t\t\t\t'ID'           => 0,\n\t\t\t\t\t\t\t'object_id'    => $_nav_menu_placeholder,\n\t\t\t\t\t\t\t'object'       => $post_type_name,\n\t\t\t\t\t\t\t'post_content' => '',\n\t\t\t\t\t\t\t'post_excerpt' => '',\n\t\t\t\t\t\t\t'post_title'   => $post_type->labels->archives,\n\t\t\t\t\t\t\t'post_type'    => 'nav_menu_item',\n\t\t\t\t\t\t\t'type'         => 'post_type_archive',\n\t\t\t\t\t\t\t'url'          => get_post_type_archive_link( $post_type_name ),\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\t * Filters the posts displayed in the 'View All' tab of the current\n\t\t\t\t * post type's menu items meta box.\n\t\t\t\t *\n\t\t\t\t * The dynamic portion of the hook name, `$post_type_name`, refers\n\t\t\t\t * to the slug of the current post type.\n\t\t\t\t *\n\t\t\t\t * @since 3.2.0\n\t\t\t\t * @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object.\n\t\t\t\t *\n\t\t\t\t * @see WP_Query::query()\n\t\t\t\t *\n\t\t\t\t * @param object[]     $posts     The posts for the current post type. Mostly `WP_Post` objects, but\n\t\t\t\t *                                can also contain \"fake\" post objects to represent other menu items.\n\t\t\t\t * @param array        $args      An array of `WP_Query` arguments.\n\t\t\t\t * @param WP_Post_Type $post_type The current post type object for this menu item meta box.\n\t\t\t\t */\n\t\t\t\t$posts = apply_filters( \"nav_menu_items_{$post_type_name}\", $posts, $args, $post_type );\n\n\t\t\t\t$checkbox_items = walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $posts ), 0, (object) $args );\n\n\t\t\t\techo $checkbox_items;\n\t\t\t\t?>\n\t\t\t</ul>\n\t\t\t<?php if ( ! empty( $page_links ) ) : ?>\n\t\t\t\t<div class=\"add-menu-item-pagelinks\">\n\t\t\t\t\t<?php echo $page_links; ?>\n\t\t\t\t</div>\n\t\t\t<?php endif; ?>\n\t\t</div><!-- /.tabs-panel -->\n\n\t\t<p class=\"button-controls wp-clearfix\" data-items-type=\"posttype-<?php echo esc_attr( $post_type_name ); ?>\">\n\t\t\t<span class=\"list-controls hide-if-no-js\">\n\t\t\t\t<input type=\"checkbox\"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> id=\"<?php echo esc_attr( $tab_name ); ?>\" class=\"select-all\" />\n\t\t\t\t<label for=\"<?php echo esc_attr( $tab_name ); ?>\"><?php _e( 'Select All' ); ?></label>\n\t\t\t</span>\n\n\t\t\t<span class=\"add-to-menu\">\n\t\t\t\t<input type=\"submit\"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class=\"button submit-add-to-menu right\" value=\"<?php esc_attr_e( 'Add to Menu' ); ?>\" name=\"add-post-type-menu-item\" id=\"<?php echo esc_attr( 'submit-posttype-' . $post_type_name ); ?>\" />\n\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t</span>\n\t\t</p>\n\n\t</div><!-- /.posttypediv -->\n\t<?php\n}\n\n/**\n * Displays a meta box for a taxonomy menu item.\n *\n * @since 3.0.0\n *\n * @global int|string $nav_menu_selected_id\n *\n * @param string $object Not used.\n * @param array  $box {\n *     Taxonomy menu item meta box arguments.\n *\n *     @type string   $id       Meta box 'id' attribute.\n *     @type string   $title    Meta box title.\n *     @type callable $callback Meta box display callback.\n *     @type object   $args     Extra meta box arguments (the taxonomy object for this meta box).\n * }\n */\nfunction wp_nav_menu_item_taxonomy_meta_box( $object, $box ) {\n\tglobal $nav_menu_selected_id;\n\n\t$taxonomy_name = $box['args']->name;\n\t$taxonomy      = get_taxonomy( $taxonomy_name );\n\t$tab_name      = $taxonomy_name . '-tab';\n\n\t// Paginate browsing for large numbers of objects.\n\t$per_page = 50;\n\t$pagenum  = isset( $_REQUEST[ $tab_name ] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;\n\t$offset   = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0;\n\n\t$args = array(\n\t\t'taxonomy'     => $taxonomy_name,\n\t\t'child_of'     => 0,\n\t\t'exclude'      => '',\n\t\t'hide_empty'   => false,\n\t\t'hierarchical' => 1,\n\t\t'include'      => '',\n\t\t'number'       => $per_page,\n\t\t'offset'       => $offset,\n\t\t'order'        => 'ASC',\n\t\t'orderby'      => 'name',\n\t\t'pad_counts'   => false,\n\t);\n\n\t$terms = get_terms( $args );\n\n\tif ( ! $terms || is_wp_error( $terms ) ) {\n\t\techo '<p>' . __( 'No items.' ) . '</p>';\n\t\treturn;\n\t}\n\n\t$num_pages = ceil(\n\t\twp_count_terms(\n\t\t\t$taxonomy_name,\n\t\t\tarray_merge(\n\t\t\t\t$args,\n\t\t\t\tarray(\n\t\t\t\t\t'number' => '',\n\t\t\t\t\t'offset' => '',\n\t\t\t\t)\n\t\t\t)\n\t\t) / $per_page\n\t);\n\n\t$page_links = paginate_links(\n\t\tarray(\n\t\t\t'base'               => add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t$tab_name     => 'all',\n\t\t\t\t\t'paged'       => '%#%',\n\t\t\t\t\t'item-type'   => 'taxonomy',\n\t\t\t\t\t'item-object' => $taxonomy_name,\n\t\t\t\t)\n\t\t\t),\n\t\t\t'format'             => '',\n\t\t\t'prev_text'          => '<span aria-label=\"' . esc_attr__( 'Previous page' ) . '\">' . __( '&laquo;' ) . '</span>',\n\t\t\t'next_text'          => '<span aria-label=\"' . esc_attr__( 'Next page' ) . '\">' . __( '&raquo;' ) . '</span>',\n\t\t\t'before_page_number' => '<span class=\"screen-reader-text\">' . __( 'Page' ) . '</span> ',\n\t\t\t'total'              => $num_pages,\n\t\t\t'current'            => $pagenum,\n\t\t)\n\t);\n\n\t$db_fields = false;\n\tif ( is_taxonomy_hierarchical( $taxonomy_name ) ) {\n\t\t$db_fields = array(\n\t\t\t'parent' => 'parent',\n\t\t\t'id'     => 'term_id',\n\t\t);\n\t}\n\n\t$walker = new Walker_Nav_Menu_Checklist( $db_fields );\n\n\t$current_tab = 'most-used';\n\n\tif ( isset( $_REQUEST[ $tab_name ] ) && in_array( $_REQUEST[ $tab_name ], array( 'all', 'most-used', 'search' ), true ) ) {\n\t\t$current_tab = $_REQUEST[ $tab_name ];\n\t}\n\n\tif ( ! empty( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] ) ) {\n\t\t$current_tab = 'search';\n\t}\n\n\t$removed_args = array(\n\t\t'action',\n\t\t'customlink-tab',\n\t\t'edit-menu-item',\n\t\t'menu-item',\n\t\t'page-tab',\n\t\t'_wpnonce',\n\t);\n\n\t$most_used_url = '';\n\t$view_all_url  = '';\n\t$search_url    = '';\n\tif ( $nav_menu_selected_id ) {\n\t\t$most_used_url = esc_url( add_query_arg( $tab_name, 'most-used', remove_query_arg( $removed_args ) ) );\n\t\t$view_all_url  = esc_url( add_query_arg( $tab_name, 'all', remove_query_arg( $removed_args ) ) );\n\t\t$search_url    = esc_url( add_query_arg( $tab_name, 'search', remove_query_arg( $removed_args ) ) );\n\t}\n\t?>\n\t<div id=\"taxonomy-<?php echo $taxonomy_name; ?>\" class=\"taxonomydiv\">\n\t\t<ul id=\"taxonomy-<?php echo $taxonomy_name; ?>-tabs\" class=\"taxonomy-tabs add-menu-item-tabs\">\n\t\t\t<li <?php echo ( 'most-used' === $current_tab ? ' class=\"tabs\"' : '' ); ?>>\n\t\t\t\t<a class=\"nav-tab-link\" data-type=\"tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-pop\" href=\"<?php echo $most_used_url; ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop\">\n\t\t\t\t\t<?php echo esc_html( $taxonomy->labels->most_used ); ?>\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t\t<li <?php echo ( 'all' === $current_tab ? ' class=\"tabs\"' : '' ); ?>>\n\t\t\t\t<a class=\"nav-tab-link\" data-type=\"tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-all\" href=\"<?php echo $view_all_url; ?>#tabs-panel-<?php echo $taxonomy_name; ?>-all\">\n\t\t\t\t\t<?php _e( 'View All' ); ?>\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t\t<li <?php echo ( 'search' === $current_tab ? ' class=\"tabs\"' : '' ); ?>>\n\t\t\t\t<a class=\"nav-tab-link\" data-type=\"tabs-panel-search-taxonomy-<?php echo esc_attr( $taxonomy_name ); ?>\" href=\"<?php echo $search_url; ?>#tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>\">\n\t\t\t\t\t<?php _e( 'Search' ); ?>\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t</ul><!-- .taxonomy-tabs -->\n\n\t\t<div id=\"tabs-panel-<?php echo $taxonomy_name; ?>-pop\" class=\"tabs-panel <?php echo ( 'most-used' === $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>\" role=\"region\" aria-label=\"<?php echo $taxonomy->labels->most_used; ?>\" tabindex=\"0\">\n\t\t\t<ul id=\"<?php echo $taxonomy_name; ?>checklist-pop\" class=\"categorychecklist form-no-clear\" >\n\t\t\t\t<?php\n\t\t\t\t$popular_terms  = get_terms(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'taxonomy'     => $taxonomy_name,\n\t\t\t\t\t\t'orderby'      => 'count',\n\t\t\t\t\t\t'order'        => 'DESC',\n\t\t\t\t\t\t'number'       => 10,\n\t\t\t\t\t\t'hierarchical' => false,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$args['walker'] = $walker;\n\t\t\t\techo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $popular_terms ), 0, (object) $args );\n\t\t\t\t?>\n\t\t\t</ul>\n\t\t</div><!-- /.tabs-panel -->\n\n\t\t<div id=\"tabs-panel-<?php echo $taxonomy_name; ?>-all\" class=\"tabs-panel tabs-panel-view-all <?php echo ( 'all' === $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>\" role=\"region\" aria-label=\"<?php echo $taxonomy->labels->all_items; ?>\" tabindex=\"0\">\n\t\t\t<?php if ( ! empty( $page_links ) ) : ?>\n\t\t\t\t<div class=\"add-menu-item-pagelinks\">\n\t\t\t\t\t<?php echo $page_links; ?>\n\t\t\t\t</div>\n\t\t\t<?php endif; ?>\n\t\t\t<ul id=\"<?php echo $taxonomy_name; ?>checklist\" data-wp-lists=\"list:<?php echo $taxonomy_name; ?>\" class=\"categorychecklist form-no-clear\">\n\t\t\t\t<?php\n\t\t\t\t$args['walker'] = $walker;\n\t\t\t\techo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $terms ), 0, (object) $args );\n\t\t\t\t?>\n\t\t\t</ul>\n\t\t\t<?php if ( ! empty( $page_links ) ) : ?>\n\t\t\t\t<div class=\"add-menu-item-pagelinks\">\n\t\t\t\t\t<?php echo $page_links; ?>\n\t\t\t\t</div>\n\t\t\t<?php endif; ?>\n\t\t</div><!-- /.tabs-panel -->\n\n\t\t<div class=\"tabs-panel <?php echo ( 'search' === $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>\" id=\"tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>\" role=\"region\" aria-label=\"<?php echo $taxonomy->labels->search_items; ?>\" tabindex=\"0\">\n\t\t\t<?php\n\t\t\tif ( isset( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] ) ) {\n\t\t\t\t$searched       = esc_attr( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] );\n\t\t\t\t$search_results = get_terms(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'taxonomy'     => $taxonomy_name,\n\t\t\t\t\t\t'name__like'   => $searched,\n\t\t\t\t\t\t'fields'       => 'all',\n\t\t\t\t\t\t'orderby'      => 'count',\n\t\t\t\t\t\t'order'        => 'DESC',\n\t\t\t\t\t\t'hierarchical' => false,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$searched       = '';\n\t\t\t\t$search_results = array();\n\t\t\t}\n\t\t\t?>\n\t\t\t<p class=\"quick-search-wrap\">\n\t\t\t\t<label for=\"quick-search-taxonomy-<?php echo $taxonomy_name; ?>\" class=\"screen-reader-text\"><?php _e( 'Search' ); ?></label>\n\t\t\t\t<input type=\"search\" class=\"quick-search\" value=\"<?php echo $searched; ?>\" name=\"quick-search-taxonomy-<?php echo $taxonomy_name; ?>\" id=\"quick-search-taxonomy-<?php echo $taxonomy_name; ?>\" />\n\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t\t<?php submit_button( __( 'Search' ), 'small quick-search-submit hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-taxonomy-' . $taxonomy_name ) ); ?>\n\t\t\t</p>\n\n\t\t\t<ul id=\"<?php echo $taxonomy_name; ?>-search-checklist\" data-wp-lists=\"list:<?php echo $taxonomy_name; ?>\" class=\"categorychecklist form-no-clear\">\n\t\t\t<?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>\n\t\t\t\t<?php\n\t\t\t\t$args['walker'] = $walker;\n\t\t\t\techo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $search_results ), 0, (object) $args );\n\t\t\t\t?>\n\t\t\t<?php elseif ( is_wp_error( $search_results ) ) : ?>\n\t\t\t\t<li><?php echo $search_results->get_error_message(); ?></li>\n\t\t\t<?php elseif ( ! empty( $searched ) ) : ?>\n\t\t\t\t<li><?php _e( 'No results found.' ); ?></li>\n\t\t\t<?php endif; ?>\n\t\t\t</ul>\n\t\t</div><!-- /.tabs-panel -->\n\n\t\t<p class=\"button-controls wp-clearfix\" data-items-type=\"taxonomy-<?php echo esc_attr( $taxonomy_name ); ?>\">\n\t\t\t<span class=\"list-controls hide-if-no-js\">\n\t\t\t\t<input type=\"checkbox\"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> id=\"<?php echo esc_attr( $tab_name ); ?>\" class=\"select-all\" />\n\t\t\t\t<label for=\"<?php echo esc_attr( $tab_name ); ?>\"><?php _e( 'Select All' ); ?></label>\n\t\t\t</span>\n\n\t\t\t<span class=\"add-to-menu\">\n\t\t\t\t<input type=\"submit\"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class=\"button submit-add-to-menu right\" value=\"<?php esc_attr_e( 'Add to Menu' ); ?>\" name=\"add-taxonomy-menu-item\" id=\"<?php echo esc_attr( 'submit-taxonomy-' . $taxonomy_name ); ?>\" />\n\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t</span>\n\t\t</p>\n\n\t</div><!-- /.taxonomydiv -->\n\t<?php\n}\n\n/**\n * Save posted nav menu item data.\n *\n * @since 3.0.0\n *\n * @param int     $menu_id   The menu ID for which to save this item. Value of 0 makes a draft, orphaned menu item. Default 0.\n * @param array[] $menu_data The unsanitized POSTed menu item data.\n * @return int[] The database IDs of the items saved\n */\nfunction wp_save_nav_menu_items( $menu_id = 0, $menu_data = array() ) {\n\t$menu_id     = (int) $menu_id;\n\t$items_saved = array();\n\n\tif ( 0 == $menu_id || is_nav_menu( $menu_id ) ) {\n\n\t\t// Loop through all the menu items' POST values.\n\t\tforeach ( (array) $menu_data as $_possible_db_id => $_item_object_data ) {\n\t\t\tif (\n\t\t\t\t// Checkbox is not checked.\n\t\t\t\tempty( $_item_object_data['menu-item-object-id'] ) &&\n\t\t\t\t(\n\t\t\t\t\t// And item type either isn't set.\n\t\t\t\t\t! isset( $_item_object_data['menu-item-type'] ) ||\n\t\t\t\t\t// Or URL is the default.\n\t\t\t\t\tin_array( $_item_object_data['menu-item-url'], array( 'https://', 'http://', '' ), true ) ||\n\t\t\t\t\t// Or it's not a custom menu item (but not the custom home page).\n\t\t\t\t\t! ( 'custom' === $_item_object_data['menu-item-type'] && ! isset( $_item_object_data['menu-item-db-id'] ) ) ||\n\t\t\t\t\t// Or it *is* a custom menu item that already exists.\n\t\t\t\t\t! empty( $_item_object_data['menu-item-db-id'] )\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// Then this potential menu item is not getting added to this menu.\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If this possible menu item doesn't actually have a menu database ID yet.\n\t\t\tif (\n\t\t\t\tempty( $_item_object_data['menu-item-db-id'] ) ||\n\t\t\t\t( 0 > $_possible_db_id ) ||\n\t\t\t\t$_possible_db_id != $_item_object_data['menu-item-db-id']\n\t\t\t) {\n\t\t\t\t$_actual_db_id = 0;\n\t\t\t} else {\n\t\t\t\t$_actual_db_id = (int) $_item_object_data['menu-item-db-id'];\n\t\t\t}\n\n\t\t\t$args = array(\n\t\t\t\t'menu-item-db-id'       => ( isset( $_item_object_data['menu-item-db-id'] ) ? $_item_object_data['menu-item-db-id'] : '' ),\n\t\t\t\t'menu-item-object-id'   => ( isset( $_item_object_data['menu-item-object-id'] ) ? $_item_object_data['menu-item-object-id'] : '' ),\n\t\t\t\t'menu-item-object'      => ( isset( $_item_object_data['menu-item-object'] ) ? $_item_object_data['menu-item-object'] : '' ),\n\t\t\t\t'menu-item-parent-id'   => ( isset( $_item_object_data['menu-item-parent-id'] ) ? $_item_object_data['menu-item-parent-id'] : '' ),\n\t\t\t\t'menu-item-position'    => ( isset( $_item_object_data['menu-item-position'] ) ? $_item_object_data['menu-item-position'] : '' ),\n\t\t\t\t'menu-item-type'        => ( isset( $_item_object_data['menu-item-type'] ) ? $_item_object_data['menu-item-type'] : '' ),\n\t\t\t\t'menu-item-title'       => ( isset( $_item_object_data['menu-item-title'] ) ? $_item_object_data['menu-item-title'] : '' ),\n\t\t\t\t'menu-item-url'         => ( isset( $_item_object_data['menu-item-url'] ) ? $_item_object_data['menu-item-url'] : '' ),\n\t\t\t\t'menu-item-description' => ( isset( $_item_object_data['menu-item-description'] ) ? $_item_object_data['menu-item-description'] : '' ),\n\t\t\t\t'menu-item-attr-title'  => ( isset( $_item_object_data['menu-item-attr-title'] ) ? $_item_object_data['menu-item-attr-title'] : '' ),\n\t\t\t\t'menu-item-target'      => ( isset( $_item_object_data['menu-item-target'] ) ? $_item_object_data['menu-item-target'] : '' ),\n\t\t\t\t'menu-item-classes'     => ( isset( $_item_object_data['menu-item-classes'] ) ? $_item_object_data['menu-item-classes'] : '' ),\n\t\t\t\t'menu-item-xfn'         => ( isset( $_item_object_data['menu-item-xfn'] ) ? $_item_object_data['menu-item-xfn'] : '' ),\n\t\t\t);\n\n\t\t\t$items_saved[] = wp_update_nav_menu_item( $menu_id, $_actual_db_id, $args );\n\n\t\t}\n\t}\n\treturn $items_saved;\n}\n\n/**\n * Adds custom arguments to some of the meta box object types.\n *\n * @since 3.0.0\n *\n * @access private\n *\n * @param object $object The post type or taxonomy meta-object.\n * @return object The post type or taxonomy object.\n */\nfunction _wp_nav_menu_meta_box_object( $object = null ) {\n\tif ( isset( $object->name ) ) {\n\n\t\tif ( 'page' === $object->name ) {\n\t\t\t$object->_default_query = array(\n\t\t\t\t'orderby'     => 'menu_order title',\n\t\t\t\t'post_status' => 'publish',\n\t\t\t);\n\n\t\t\t// Posts should show only published items.\n\t\t} elseif ( 'post' === $object->name ) {\n\t\t\t$object->_default_query = array(\n\t\t\t\t'post_status' => 'publish',\n\t\t\t);\n\n\t\t\t// Categories should be in reverse chronological order.\n\t\t} elseif ( 'category' === $object->name ) {\n\t\t\t$object->_default_query = array(\n\t\t\t\t'orderby' => 'id',\n\t\t\t\t'order'   => 'DESC',\n\t\t\t);\n\n\t\t\t// Custom post types should show only published items.\n\t\t} else {\n\t\t\t$object->_default_query = array(\n\t\t\t\t'post_status' => 'publish',\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $object;\n}\n\n/**\n * Returns the menu formatted to edit.\n *\n * @since 3.0.0\n *\n * @param int $menu_id Optional. The ID of the menu to format. Default 0.\n * @return string|WP_Error The menu formatted to edit or error object on failure.\n */\nfunction wp_get_nav_menu_to_edit( $menu_id = 0 ) {\n\t$menu = wp_get_nav_menu_object( $menu_id );\n\n\t// If the menu exists, get its items.\n\tif ( is_nav_menu( $menu ) ) {\n\t\t$menu_items = wp_get_nav_menu_items( $menu->term_id, array( 'post_status' => 'any' ) );\n\t\t$result     = '<div id=\"menu-instructions\" class=\"post-body-plain';\n\t\t$result    .= ( ! empty( $menu_items ) ) ? ' menu-instructions-inactive\">' : '\">';\n\t\t$result    .= '<p>' . __( 'Add menu items from the column on the left.' ) . '</p>';\n\t\t$result    .= '</div>';\n\n\t\tif ( empty( $menu_items ) ) {\n\t\t\treturn $result . ' <ul class=\"menu\" id=\"menu-to-edit\"> </ul>';\n\t\t}\n\n\t\t/**\n\t\t * Filters the Walker class used when adding nav menu items.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string $class   The walker class to use. Default 'Walker_Nav_Menu_Edit'.\n\t\t * @param int    $menu_id ID of the menu being rendered.\n\t\t */\n\t\t$walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id );\n\n\t\tif ( class_exists( $walker_class_name ) ) {\n\t\t\t$walker = new $walker_class_name;\n\t\t} else {\n\t\t\treturn new WP_Error(\n\t\t\t\t'menu_walker_not_exist',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Walker class name. */\n\t\t\t\t\t__( 'The Walker class named %s does not exist.' ),\n\t\t\t\t\t'<strong>' . $walker_class_name . '</strong>'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$some_pending_menu_items = false;\n\t\t$some_invalid_menu_items = false;\n\t\tforeach ( (array) $menu_items as $menu_item ) {\n\t\t\tif ( isset( $menu_item->post_status ) && 'draft' === $menu_item->post_status ) {\n\t\t\t\t$some_pending_menu_items = true;\n\t\t\t}\n\t\t\tif ( ! empty( $menu_item->_invalid ) ) {\n\t\t\t\t$some_invalid_menu_items = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( $some_pending_menu_items ) {\n\t\t\t$result .= '<div class=\"notice notice-info notice-alt inline\"><p>' . __( 'Click Save Menu to make pending menu items public.' ) . '</p></div>';\n\t\t}\n\n\t\tif ( $some_invalid_menu_items ) {\n\t\t\t$result .= '<div class=\"notice notice-error notice-alt inline\"><p>' . __( 'There are some invalid menu items. Please check or delete them.' ) . '</p></div>';\n\t\t}\n\n\t\t$result .= '<ul class=\"menu\" id=\"menu-to-edit\"> ';\n\t\t$result .= walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $menu_items ), 0, (object) array( 'walker' => $walker ) );\n\t\t$result .= ' </ul> ';\n\t\treturn $result;\n\t} elseif ( is_wp_error( $menu ) ) {\n\t\treturn $menu;\n\t}\n\n}\n\n/**\n * Returns the columns for the nav menus page.\n *\n * @since 3.0.0\n *\n * @return string[] Array of column titles keyed by their column name.\n */\nfunction wp_nav_menu_manage_columns() {\n\treturn array(\n\t\t'_title'          => __( 'Show advanced menu properties' ),\n\t\t'cb'              => '<input type=\"checkbox\" />',\n\t\t'link-target'     => __( 'Link Target' ),\n\t\t'title-attribute' => __( 'Title Attribute' ),\n\t\t'css-classes'     => __( 'CSS Classes' ),\n\t\t'xfn'             => __( 'Link Relationship (XFN)' ),\n\t\t'description'     => __( 'Description' ),\n\t);\n}\n\n/**\n * Deletes orphaned draft menu items\n *\n * @access private\n * @since 3.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction _wp_delete_orphaned_draft_menu_items() {\n\tglobal $wpdb;\n\t$delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS );\n\n\t// Delete orphaned draft menu items.\n\t$menu_items_to_delete = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts AS p LEFT JOIN $wpdb->postmeta AS m ON p.ID = m.post_id WHERE post_type = 'nav_menu_item' AND post_status = 'draft' AND meta_key = '_menu_item_orphaned' AND meta_value < %d\", $delete_timestamp ) );\n\n\tforeach ( (array) $menu_items_to_delete as $menu_item_id ) {\n\t\twp_delete_post( $menu_item_id, true );\n\t}\n}\n\n/**\n * Saves nav menu items\n *\n * @since 3.6.0\n *\n * @param int|string $nav_menu_selected_id    ID, slug, or name of the currently-selected menu.\n * @param string     $nav_menu_selected_title Title of the currently-selected menu.\n * @return array The menu updated message\n */\nfunction wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ) {\n\t$unsorted_menu_items = wp_get_nav_menu_items(\n\t\t$nav_menu_selected_id,\n\t\tarray(\n\t\t\t'orderby'     => 'ID',\n\t\t\t'output'      => ARRAY_A,\n\t\t\t'output_key'  => 'ID',\n\t\t\t'post_status' => 'draft,publish',\n\t\t)\n\t);\n\n\t$messages   = array();\n\t$menu_items = array();\n\n\t// Index menu items by DB ID.\n\tforeach ( $unsorted_menu_items as $_item ) {\n\t\t$menu_items[ $_item->db_id ] = $_item;\n\t}\n\n\t$post_fields = array(\n\t\t'menu-item-db-id',\n\t\t'menu-item-object-id',\n\t\t'menu-item-object',\n\t\t'menu-item-parent-id',\n\t\t'menu-item-position',\n\t\t'menu-item-type',\n\t\t'menu-item-title',\n\t\t'menu-item-url',\n\t\t'menu-item-description',\n\t\t'menu-item-attr-title',\n\t\t'menu-item-target',\n\t\t'menu-item-classes',\n\t\t'menu-item-xfn',\n\t);\n\n\twp_defer_term_counting( true );\n\n\t// Loop through all the menu items' POST variables.\n\tif ( ! empty( $_POST['menu-item-db-id'] ) ) {\n\t\tforeach ( (array) $_POST['menu-item-db-id'] as $_key => $k ) {\n\n\t\t\t// Menu item title can't be blank.\n\t\t\tif ( ! isset( $_POST['menu-item-title'][ $_key ] ) || '' === $_POST['menu-item-title'][ $_key ] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$args = array();\n\t\t\tforeach ( $post_fields as $field ) {\n\t\t\t\t$args[ $field ] = isset( $_POST[ $field ][ $_key ] ) ? $_POST[ $field ][ $_key ] : '';\n\t\t\t}\n\n\t\t\t$menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][ $_key ] != $_key ? 0 : $_key ), $args );\n\n\t\t\tif ( is_wp_error( $menu_item_db_id ) ) {\n\t\t\t\t$messages[] = '<div id=\"message\" class=\"error\"><p>' . $menu_item_db_id->get_error_message() . '</p></div>';\n\t\t\t} else {\n\t\t\t\tunset( $menu_items[ $menu_item_db_id ] );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove menu items from the menu that weren't in $_POST.\n\tif ( ! empty( $menu_items ) ) {\n\t\tforeach ( array_keys( $menu_items ) as $menu_item_id ) {\n\t\t\tif ( is_nav_menu_item( $menu_item_id ) ) {\n\t\t\t\twp_delete_post( $menu_item_id );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Store 'auto-add' pages.\n\t$auto_add        = ! empty( $_POST['auto-add-pages'] );\n\t$nav_menu_option = (array) get_option( 'nav_menu_options' );\n\n\tif ( ! isset( $nav_menu_option['auto_add'] ) ) {\n\t\t$nav_menu_option['auto_add'] = array();\n\t}\n\n\tif ( $auto_add ) {\n\t\tif ( ! in_array( $nav_menu_selected_id, $nav_menu_option['auto_add'], true ) ) {\n\t\t\t$nav_menu_option['auto_add'][] = $nav_menu_selected_id;\n\t\t}\n\t} else {\n\t\t$key = array_search( $nav_menu_selected_id, $nav_menu_option['auto_add'], true );\n\t\tif ( false !== $key ) {\n\t\t\tunset( $nav_menu_option['auto_add'][ $key ] );\n\t\t}\n\t}\n\n\t// Remove non-existent/deleted menus.\n\t$nav_menu_option['auto_add'] = array_intersect( $nav_menu_option['auto_add'], wp_get_nav_menus( array( 'fields' => 'ids' ) ) );\n\tupdate_option( 'nav_menu_options', $nav_menu_option );\n\n\twp_defer_term_counting( false );\n\n\t/** This action is documented in wp-includes/nav-menu.php */\n\tdo_action( 'wp_update_nav_menu', $nav_menu_selected_id );\n\n\t$messages[] = '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' .\n\t\tsprintf(\n\t\t\t/* translators: %s: Nav menu title. */\n\t\t\t__( '%s has been updated.' ),\n\t\t\t'<strong>' . $nav_menu_selected_title . '</strong>'\n\t\t) . '</p></div>';\n\n\tunset( $menu_items, $unsorted_menu_items );\n\n\treturn $messages;\n}\n\n/**\n * If a JSON blob of navigation menu data is in POST data, expand it and inject\n * it into `$_POST` to avoid PHP `max_input_vars` limitations. See #14134.\n *\n * @ignore\n * @since 4.5.3\n * @access private\n */\nfunction _wp_expand_nav_menu_post_data() {\n\tif ( ! isset( $_POST['nav-menu-data'] ) ) {\n\t\treturn;\n\t}\n\n\t$data = json_decode( stripslashes( $_POST['nav-menu-data'] ) );\n\n\tif ( ! is_null( $data ) && $data ) {\n\t\tforeach ( $data as $post_input_data ) {\n\t\t\t// For input names that are arrays (e.g. `menu-item-db-id[3][4][5]`),\n\t\t\t// derive the array path keys via regex and set the value in $_POST.\n\t\t\tpreg_match( '#([^\\[]*)(\\[(.+)\\])?#', $post_input_data->name, $matches );\n\n\t\t\t$array_bits = array( $matches[1] );\n\n\t\t\tif ( isset( $matches[3] ) ) {\n\t\t\t\t$array_bits = array_merge( $array_bits, explode( '][', $matches[3] ) );\n\t\t\t}\n\n\t\t\t$new_post_data = array();\n\n\t\t\t// Build the new array value from leaf to trunk.\n\t\t\tfor ( $i = count( $array_bits ) - 1; $i >= 0; $i-- ) {\n\t\t\t\tif ( count( $array_bits ) - 1 == $i ) {\n\t\t\t\t\t$new_post_data[ $array_bits[ $i ] ] = wp_slash( $post_input_data->value );\n\t\t\t\t} else {\n\t\t\t\t\t$new_post_data = array( $array_bits[ $i ] => $new_post_data );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$_POST = array_replace_recursive( $_POST, $new_post_data );\n\t\t}\n\t}\n}\n", "num_lines": 1295}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Network Administration API.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.4.0\n */\n\n/**\n * Check for an existing network.\n *\n * @since 3.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @return string|false Base domain if network exists, otherwise false.\n */\nfunction network_domain_check() {\n\tglobal $wpdb;\n\n\t$sql = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->site ) );\n\tif ( $wpdb->get_var( $sql ) ) {\n\t\treturn $wpdb->get_var( \"SELECT domain FROM $wpdb->site ORDER BY id ASC LIMIT 1\" );\n\t}\n\treturn false;\n}\n\n/**\n * Allow subdomain installation\n *\n * @since 3.0.0\n * @return bool Whether subdomain installation is allowed\n */\nfunction allow_subdomain_install() {\n\t$domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'home' ) );\n\tif ( parse_url( get_option( 'home' ), PHP_URL_PATH ) || 'localhost' === $domain || preg_match( '|^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$|', $domain ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Allow subdirectory installation.\n *\n * @since 3.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @return bool Whether subdirectory installation is allowed\n */\nfunction allow_subdirectory_install() {\n\tglobal $wpdb;\n\n\t/**\n\t * Filters whether to enable the subdirectory installation feature in Multisite.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param bool $allow Whether to enable the subdirectory installation feature in Multisite.\n\t *                    Default false.\n\t */\n\tif ( apply_filters( 'allow_subdirectory_install', false ) ) {\n\t\treturn true;\n\t}\n\n\tif ( defined( 'ALLOW_SUBDIRECTORY_INSTALL' ) && ALLOW_SUBDIRECTORY_INSTALL ) {\n\t\treturn true;\n\t}\n\n\t$post = $wpdb->get_row( \"SELECT ID FROM $wpdb->posts WHERE post_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) AND post_status = 'publish'\" );\n\tif ( empty( $post ) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Get base domain of network.\n *\n * @since 3.0.0\n * @return string Base domain.\n */\nfunction get_clean_basedomain() {\n\t$existing_domain = network_domain_check();\n\tif ( $existing_domain ) {\n\t\treturn $existing_domain;\n\t}\n\t$domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) );\n\t$slash  = strpos( $domain, '/' );\n\tif ( $slash ) {\n\t\t$domain = substr( $domain, 0, $slash );\n\t}\n\treturn $domain;\n}\n\n/**\n * Prints step 1 for Network installation process.\n *\n * @todo Realistically, step 1 should be a welcome screen explaining what a Network is and such.\n *       Navigating to Tools > Network should not be a sudden \"Welcome to a new install process!\n *       Fill this out and click here.\" See also contextual help todo.\n *\n * @since 3.0.0\n *\n * @global bool $is_apache\n *\n * @param WP_Error $errors\n */\nfunction network_step1( $errors = false ) {\n\tglobal $is_apache;\n\n\tif ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {\n\t\techo '<div class=\"error\"><p><strong>' . __( 'Error:' ) . '</strong> ' . sprintf(\n\t\t\t/* translators: %s: DO_NOT_UPGRADE_GLOBAL_TABLES */\n\t\t\t__( 'The constant %s cannot be defined when creating a network.' ),\n\t\t\t'<code>DO_NOT_UPGRADE_GLOBAL_TABLES</code>'\n\t\t) . '</p></div>';\n\t\techo '</div>';\n\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t\tdie();\n\t}\n\n\t$active_plugins = get_option( 'active_plugins' );\n\tif ( ! empty( $active_plugins ) ) {\n\t\techo '<div class=\"notice notice-warning\"><p><strong>' . __( 'Warning:' ) . '</strong> ' . sprintf(\n\t\t\t/* translators: %s: URL to Plugins screen. */\n\t\t\t__( 'Please <a href=\"%s\">deactivate your plugins</a> before enabling the Network feature.' ),\n\t\t\tadmin_url( 'plugins.php?plugin_status=active' )\n\t\t) . '</p></div>';\n\t\techo '<p>' . __( 'Once the network is created, you may reactivate your plugins.' ) . '</p>';\n\t\techo '</div>';\n\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t\tdie();\n\t}\n\n\t$hostname  = get_clean_basedomain();\n\t$has_ports = strstr( $hostname, ':' );\n\tif ( ( false !== $has_ports && ! in_array( $has_ports, array( ':80', ':443' ), true ) ) ) {\n\t\techo '<div class=\"error\"><p><strong>' . __( 'Error:' ) . '</strong> ' . __( 'You cannot install a network of sites with your server address.' ) . '</p></div>';\n\t\techo '<p>' . sprintf(\n\t\t\t/* translators: %s: Port number. */\n\t\t\t__( 'You cannot use port numbers such as %s.' ),\n\t\t\t'<code>' . $has_ports . '</code>'\n\t\t) . '</p>';\n\t\techo '<a href=\"' . esc_url( admin_url() ) . '\">' . __( 'Return to Dashboard' ) . '</a>';\n\t\techo '</div>';\n\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t\tdie();\n\t}\n\n\techo '<form method=\"post\">';\n\n\twp_nonce_field( 'install-network-1' );\n\n\t$error_codes = array();\n\tif ( is_wp_error( $errors ) ) {\n\t\techo '<div class=\"error\"><p><strong>' . __( 'Error: The network could not be created.' ) . '</strong></p>';\n\t\tforeach ( $errors->get_error_messages() as $error ) {\n\t\t\techo \"<p>$error</p>\";\n\t\t}\n\t\techo '</div>';\n\t\t$error_codes = $errors->get_error_codes();\n\t}\n\n\tif ( ! empty( $_POST['sitename'] ) && ! in_array( 'empty_sitename', $error_codes, true ) ) {\n\t\t$site_name = $_POST['sitename'];\n\t} else {\n\t\t/* translators: %s: Default network title. */\n\t\t$site_name = sprintf( __( '%s Sites' ), get_option( 'blogname' ) );\n\t}\n\n\tif ( ! empty( $_POST['email'] ) && ! in_array( 'invalid_email', $error_codes, true ) ) {\n\t\t$admin_email = $_POST['email'];\n\t} else {\n\t\t$admin_email = get_option( 'admin_email' );\n\t}\n\t?>\n\t<p><?php _e( 'Welcome to the Network installation process!' ); ?></p>\n\t<p><?php _e( 'Fill in the information below and you&#8217;ll be on your way to creating a network of WordPress sites. We will create configuration files in the next step.' ); ?></p>\n\t<?php\n\n\tif ( isset( $_POST['subdomain_install'] ) ) {\n\t\t$subdomain_install = (bool) $_POST['subdomain_install'];\n\t} elseif ( apache_mod_loaded( 'mod_rewrite' ) ) { // Assume nothing.\n\t\t$subdomain_install = true;\n\t} elseif ( ! allow_subdirectory_install() ) {\n\t\t$subdomain_install = true;\n\t} else {\n\t\t$subdomain_install = false;\n\t\t$got_mod_rewrite   = got_mod_rewrite();\n\t\tif ( $got_mod_rewrite ) { // Dangerous assumptions.\n\t\t\techo '<div class=\"updated inline\"><p><strong>' . __( 'Note:' ) . '</strong> ';\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: mod_rewrite */\n\t\t\t\t__( 'Please make sure the Apache %s module is installed as it will be used at the end of this installation.' ),\n\t\t\t\t'<code>mod_rewrite</code>'\n\t\t\t);\n\t\t\techo '</p>';\n\t\t} elseif ( $is_apache ) {\n\t\t\techo '<div class=\"error inline\"><p><strong>' . __( 'Warning:' ) . '</strong> ';\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: mod_rewrite */\n\t\t\t\t__( 'It looks like the Apache %s module is not installed.' ),\n\t\t\t\t'<code>mod_rewrite</code>'\n\t\t\t);\n\t\t\techo '</p>';\n\t\t}\n\n\t\tif ( $got_mod_rewrite || $is_apache ) { // Protect against mod_rewrite mimicry (but ! Apache).\n\t\t\techo '<p>';\n\t\t\tprintf(\n\t\t\t\t/* translators: 1: mod_rewrite, 2: mod_rewrite documentation URL, 3: Google search for mod_rewrite. */\n\t\t\t\t__( 'If %1$s is disabled, ask your administrator to enable that module, or look at the <a href=\"%2$s\">Apache documentation</a> or <a href=\"%3$s\">elsewhere</a> for help setting it up.' ),\n\t\t\t\t'<code>mod_rewrite</code>',\n\t\t\t\t'https://httpd.apache.org/docs/mod/mod_rewrite.html',\n\t\t\t\t'https://www.google.com/search?q=apache+mod_rewrite'\n\t\t\t);\n\t\t\techo '</p></div>';\n\t\t}\n\t}\n\n\tif ( allow_subdomain_install() && allow_subdirectory_install() ) :\n\t\t?>\n\t\t<h3><?php esc_html_e( 'Addresses of Sites in your Network' ); ?></h3>\n\t\t<p><?php _e( 'Please choose whether you would like sites in your WordPress network to use sub-domains or sub-directories.' ); ?>\n\t\t\t<strong><?php _e( 'You cannot change this later.' ); ?></strong></p>\n\t\t<p><?php _e( 'You will need a wildcard DNS record if you are going to use the virtual host (sub-domain) functionality.' ); ?></p>\n\t\t<?php // @todo Link to an MS readme? ?>\n\t\t<table class=\"form-table\" role=\"presentation\">\n\t\t\t<tr>\n\t\t\t\t<th><label><input type=\"radio\" name=\"subdomain_install\" value=\"1\"<?php checked( $subdomain_install ); ?> /> <?php _e( 'Sub-domains' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: Host name. */\n\t\t\t\t\t_x( 'like <code>site1.%1$s</code> and <code>site2.%1$s</code>', 'subdomain examples' ),\n\t\t\t\t\t$hostname\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th><label><input type=\"radio\" name=\"subdomain_install\" value=\"0\"<?php checked( ! $subdomain_install ); ?> /> <?php _e( 'Sub-directories' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: Host name. */\n\t\t\t\t\t_x( 'like <code>%1$s/site1</code> and <code>%1$s/site2</code>', 'subdirectory examples' ),\n\t\t\t\t\t$hostname\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\n\t\t<?php\n\tendif;\n\n\tif ( WP_CONTENT_DIR !== ABSPATH . 'wp-content' && ( allow_subdirectory_install() || ! allow_subdomain_install() ) ) {\n\t\techo '<div class=\"error inline\"><p><strong>' . __( 'Warning:' ) . '</strong> ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</p></div>';\n\t}\n\n\t$is_www = ( 0 === strpos( $hostname, 'www.' ) );\n\tif ( $is_www ) :\n\t\t?>\n\t\t<h3><?php esc_html_e( 'Server Address' ); ?></h3>\n\t\t<p>\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: 1: Site URL, 2: Host name, 3: www. */\n\t\t\t__( 'We recommend you change your site domain to %1$s before enabling the network feature. It will still be possible to visit your site using the %3$s prefix with an address like %2$s but any links will not have the %3$s prefix.' ),\n\t\t\t'<code>' . substr( $hostname, 4 ) . '</code>',\n\t\t\t'<code>' . $hostname . '</code>',\n\t\t\t'<code>www</code>'\n\t\t);\n\t\t?>\n\t\t</p>\n\t\t<table class=\"form-table\" role=\"presentation\">\n\t\t\t<tr>\n\t\t\t<th scope='row'><?php esc_html_e( 'Server Address' ); ?></th>\n\t\t\t<td>\n\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Host name. */\n\t\t\t\t\t\t__( 'The internet address of your network will be %s.' ),\n\t\t\t\t\t\t'<code>' . $hostname . '</code>'\n\t\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<?php endif; ?>\n\n\t\t<h3><?php esc_html_e( 'Network Details' ); ?></h3>\n\t\t<table class=\"form-table\" role=\"presentation\">\n\t\t<?php if ( 'localhost' === $hostname ) : ?>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><?php esc_html_e( 'Sub-directory Installation' ); ?></th>\n\t\t\t\t<td>\n\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: localhost, 2: localhost.localdomain */\n\t\t\t\t\t\t__( 'Because you are using %1$s, the sites in your WordPress network must use sub-directories. Consider using %2$s if you wish to use sub-domains.' ),\n\t\t\t\t\t\t'<code>localhost</code>',\n\t\t\t\t\t\t'<code>localhost.localdomain</code>'\n\t\t\t\t\t);\n\t\t\t\t\t// Uh oh:\n\t\t\t\tif ( ! allow_subdirectory_install() ) {\n\t\t\t\t\techo ' <strong>' . __( 'Warning:' ) . ' ' . __( 'The main site in a sub-directory installation will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t<?php elseif ( ! allow_subdomain_install() ) : ?>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><?php esc_html_e( 'Sub-directory Installation' ); ?></th>\n\t\t\t\t<td>\n\t\t\t\t<?php\n\t\t\t\t\t_e( 'Because your installation is in a directory, the sites in your WordPress network must use sub-directories.' );\n\t\t\t\t\t// Uh oh:\n\t\t\t\tif ( ! allow_subdirectory_install() ) {\n\t\t\t\t\techo ' <strong>' . __( 'Warning:' ) . ' ' . __( 'The main site in a sub-directory installation will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t<?php elseif ( ! allow_subdirectory_install() ) : ?>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><?php esc_html_e( 'Sub-domain Installation' ); ?></th>\n\t\t\t\t<td>\n\t\t\t\t<?php\n\t\t\t\t_e( 'Because your installation is not new, the sites in your WordPress network must use sub-domains.' );\n\t\t\t\t\techo ' <strong>' . __( 'The main site in a sub-directory installation will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>';\n\t\t\t\t?>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t<?php endif; ?>\n\t\t<?php if ( ! $is_www ) : ?>\n\t\t\t<tr>\n\t\t\t\t<th scope='row'><?php esc_html_e( 'Server Address' ); ?></th>\n\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Host name. */\n\t\t\t\t\t\t__( 'The internet address of your network will be %s.' ),\n\t\t\t\t\t\t'<code>' . $hostname . '</code>'\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t<?php endif; ?>\n\t\t\t<tr>\n\t\t\t\t<th scope='row'><label for=\"sitename\"><?php esc_html_e( 'Network Title' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<input name='sitename' id='sitename' type='text' size='45' value='<?php echo esc_attr( $site_name ); ?>' />\n\t\t\t\t\t<p class=\"description\">\n\t\t\t\t\t\t<?php _e( 'What would you like to call your network?' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th scope='row'><label for=\"email\"><?php esc_html_e( 'Network Admin Email' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<input name='email' id='email' type='text' size='45' value='<?php echo esc_attr( $admin_email ); ?>' />\n\t\t\t\t\t<p class=\"description\">\n\t\t\t\t\t\t<?php _e( 'Your email address.' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<?php submit_button( __( 'Install' ), 'primary', 'submit' ); ?>\n\t</form>\n\t<?php\n}\n\n/**\n * Prints step 2 for Network installation process.\n *\n * @since 3.0.0\n *\n * @global wpdb $wpdb     WordPress database abstraction object.\n * @global bool $is_nginx Whether the server software is Nginx or something else.\n *\n * @param WP_Error $errors\n */\nfunction network_step2( $errors = false ) {\n\tglobal $wpdb, $is_nginx;\n\n\t$hostname          = get_clean_basedomain();\n\t$slashed_home      = trailingslashit( get_option( 'home' ) );\n\t$base              = parse_url( $slashed_home, PHP_URL_PATH );\n\t$document_root_fix = str_replace( '\\\\', '/', realpath( $_SERVER['DOCUMENT_ROOT'] ) );\n\t$abspath_fix       = str_replace( '\\\\', '/', ABSPATH );\n\t$home_path         = 0 === strpos( $abspath_fix, $document_root_fix ) ? $document_root_fix . $base : get_home_path();\n\t$wp_siteurl_subdir = preg_replace( '#^' . preg_quote( $home_path, '#' ) . '#', '', $abspath_fix );\n\t$rewrite_base      = ! empty( $wp_siteurl_subdir ) ? ltrim( trailingslashit( $wp_siteurl_subdir ), '/' ) : '';\n\n\t$location_of_wp_config = $abspath_fix;\n\tif ( ! file_exists( ABSPATH . 'wp-config.php' ) && file_exists( dirname( ABSPATH ) . '/wp-config.php' ) ) {\n\t\t$location_of_wp_config = dirname( $abspath_fix );\n\t}\n\t$location_of_wp_config = trailingslashit( $location_of_wp_config );\n\n\t// Wildcard DNS message.\n\tif ( is_wp_error( $errors ) ) {\n\t\techo '<div class=\"error\">' . $errors->get_error_message() . '</div>';\n\t}\n\n\tif ( $_POST ) {\n\t\tif ( allow_subdomain_install() ) {\n\t\t\t$subdomain_install = allow_subdirectory_install() ? ! empty( $_POST['subdomain_install'] ) : true;\n\t\t} else {\n\t\t\t$subdomain_install = false;\n\t\t}\n\t} else {\n\t\tif ( is_multisite() ) {\n\t\t\t$subdomain_install = is_subdomain_install();\n\t\t\t?>\n\t<p><?php _e( 'The original configuration steps are shown here for reference.' ); ?></p>\n\t\t\t<?php\n\t\t} else {\n\t\t\t$subdomain_install = (bool) $wpdb->get_var( \"SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'\" );\n\t\t\t?>\n\t<div class=\"error\"><p><strong><?php _e( 'Warning:' ); ?></strong> <?php _e( 'An existing WordPress network was detected.' ); ?></p></div>\n\t<p><?php _e( 'Please complete the configuration steps. To create a new network, you will need to empty or remove the network database tables.' ); ?></p>\n\t\t\t<?php\n\t\t}\n\t}\n\n\t$subdir_match          = $subdomain_install ? '' : '([_0-9a-zA-Z-]+/)?';\n\t$subdir_replacement_01 = $subdomain_install ? '' : '$1';\n\t$subdir_replacement_12 = $subdomain_install ? '$1' : '$2';\n\n\tif ( $_POST || ! is_multisite() ) {\n\t\t?>\n\t\t<h3><?php esc_html_e( 'Enabling the Network' ); ?></h3>\n\t\t<p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p>\n\t\t<div class=\"notice notice-warning inline\"><p>\n\t\t<?php\n\t\tif ( file_exists( $home_path . '.htaccess' ) ) {\n\t\t\techo '<strong>' . __( 'Caution:' ) . '</strong> ';\n\t\t\tprintf(\n\t\t\t\t/* translators: 1: wp-config.php, 2: .htaccess */\n\t\t\t\t__( 'We recommend you back up your existing %1$s and %2$s files.' ),\n\t\t\t\t'<code>wp-config.php</code>',\n\t\t\t\t'<code>.htaccess</code>'\n\t\t\t);\n\t\t} elseif ( file_exists( $home_path . 'web.config' ) ) {\n\t\t\techo '<strong>' . __( 'Caution:' ) . '</strong> ';\n\t\t\tprintf(\n\t\t\t\t/* translators: 1: wp-config.php, 2: web.config */\n\t\t\t\t__( 'We recommend you back up your existing %1$s and %2$s files.' ),\n\t\t\t\t'<code>wp-config.php</code>',\n\t\t\t\t'<code>web.config</code>'\n\t\t\t);\n\t\t} else {\n\t\t\techo '<strong>' . __( 'Caution:' ) . '</strong> ';\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: wp-config.php */\n\t\t\t\t__( 'We recommend you back up your existing %s file.' ),\n\t\t\t\t'<code>wp-config.php</code>'\n\t\t\t);\n\t\t}\n\t\t?>\n\t\t</p></div>\n\t\t<?php\n\t}\n\t?>\n\t<ol>\n\t\t<li><p>\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: 1: wp-config.php, 2: Location of wp-config file, 3: Translated version of \"That's all, stop editing! Happy publishing.\" */\n\t\t\t__( 'Add the following to your %1$s file in %2$s <strong>above</strong> the line reading %3$s:' ),\n\t\t\t'<code>wp-config.php</code>',\n\t\t\t'<code>' . $location_of_wp_config . '</code>',\n\t\t\t/*\n\t\t\t * translators: This string should only be translated if wp-config-sample.php is localized.\n\t\t\t * You can check the localized release package or\n\t\t\t * https://i18n.svn.wordpress.org/<locale code>/branches/<wp version>/dist/wp-config-sample.php\n\t\t\t */\n\t\t\t'<code>/* ' . __( 'That&#8217;s all, stop editing! Happy publishing.' ) . ' */</code>'\n\t\t);\n\t\t?>\n\t\t</p>\n\t\t<textarea class=\"code\" readonly=\"readonly\" cols=\"100\" rows=\"7\">\ndefine('MULTISITE', true);\ndefine('SUBDOMAIN_INSTALL', <?php echo $subdomain_install ? 'true' : 'false'; ?>);\ndefine('DOMAIN_CURRENT_SITE', '<?php echo $hostname; ?>');\ndefine('PATH_CURRENT_SITE', '<?php echo $base; ?>');\ndefine('SITE_ID_CURRENT_SITE', 1);\ndefine('BLOG_ID_CURRENT_SITE', 1);\n</textarea>\n\t\t<?php\n\t\t$keys_salts = array(\n\t\t\t'AUTH_KEY'         => '',\n\t\t\t'SECURE_AUTH_KEY'  => '',\n\t\t\t'LOGGED_IN_KEY'    => '',\n\t\t\t'NONCE_KEY'        => '',\n\t\t\t'AUTH_SALT'        => '',\n\t\t\t'SECURE_AUTH_SALT' => '',\n\t\t\t'LOGGED_IN_SALT'   => '',\n\t\t\t'NONCE_SALT'       => '',\n\t\t);\n\t\tforeach ( $keys_salts as $c => $v ) {\n\t\t\tif ( defined( $c ) ) {\n\t\t\t\tunset( $keys_salts[ $c ] );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $keys_salts ) ) {\n\t\t\t$keys_salts_str = '';\n\t\t\t$from_api       = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );\n\t\t\tif ( is_wp_error( $from_api ) ) {\n\t\t\t\tforeach ( $keys_salts as $c => $v ) {\n\t\t\t\t\t$keys_salts_str .= \"\\ndefine( '$c', '\" . wp_generate_password( 64, true, true ) . \"' );\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$from_api = explode( \"\\n\", wp_remote_retrieve_body( $from_api ) );\n\t\t\t\tforeach ( $keys_salts as $c => $v ) {\n\t\t\t\t\t$keys_salts_str .= \"\\ndefine( '$c', '\" . substr( array_shift( $from_api ), 28, 64 ) . \"' );\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$num_keys_salts = count( $keys_salts );\n\t\t\t?>\n\t\t<p>\n\t\t\t<?php\n\t\t\tif ( 1 === $num_keys_salts ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: wp-config.php */\n\t\t\t\t\t__( 'This unique authentication key is also missing from your %s file.' ),\n\t\t\t\t\t'<code>wp-config.php</code>'\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: wp-config.php */\n\t\t\t\t\t__( 'These unique authentication keys are also missing from your %s file.' ),\n\t\t\t\t\t'<code>wp-config.php</code>'\n\t\t\t\t);\n\t\t\t}\n\t\t\t?>\n\t\t\t<?php _e( 'To make your installation more secure, you should also add:' ); ?>\n\t\t</p>\n\t\t<textarea class=\"code\" readonly=\"readonly\" cols=\"100\" rows=\"<?php echo $num_keys_salts; ?>\"><?php echo esc_textarea( $keys_salts_str ); ?></textarea>\n\t\t\t<?php\n\t\t}\n\t\t?>\n\t\t</li>\n\t<?php\n\tif ( iis7_supports_permalinks() ) :\n\t\t// IIS doesn't support RewriteBase, all your RewriteBase are belong to us.\n\t\t$iis_subdir_match       = ltrim( $base, '/' ) . $subdir_match;\n\t\t$iis_rewrite_base       = ltrim( $base, '/' ) . $rewrite_base;\n\t\t$iis_subdir_replacement = $subdomain_install ? '' : '{R:1}';\n\n\t\t$web_config_file = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<configuration>\n    <system.webServer>\n        <rewrite>\n            <rules>\n                <rule name=\"WordPress Rule 1\" stopProcessing=\"true\">\n                    <match url=\"^index\\.php$\" ignoreCase=\"false\" />\n                    <action type=\"None\" />\n                </rule>';\n\t\tif ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) {\n\t\t\t$web_config_file .= '\n                <rule name=\"WordPress Rule for Files\" stopProcessing=\"true\">\n                    <match url=\"^' . $iis_subdir_match . 'files/(.+)\" ignoreCase=\"false\" />\n                    <action type=\"Rewrite\" url=\"' . $iis_rewrite_base . WPINC . '/ms-files.php?file={R:1}\" appendQueryString=\"false\" />\n                </rule>';\n\t\t}\n\t\t\t$web_config_file .= '\n                <rule name=\"WordPress Rule 2\" stopProcessing=\"true\">\n                    <match url=\"^' . $iis_subdir_match . 'wp-admin$\" ignoreCase=\"false\" />\n                    <action type=\"Redirect\" url=\"' . $iis_subdir_replacement . 'wp-admin/\" redirectType=\"Permanent\" />\n                </rule>\n                <rule name=\"WordPress Rule 3\" stopProcessing=\"true\">\n                    <match url=\"^\" ignoreCase=\"false\" />\n                    <conditions logicalGrouping=\"MatchAny\">\n                        <add input=\"{REQUEST_FILENAME}\" matchType=\"IsFile\" ignoreCase=\"false\" />\n                        <add input=\"{REQUEST_FILENAME}\" matchType=\"IsDirectory\" ignoreCase=\"false\" />\n                    </conditions>\n                    <action type=\"None\" />\n                </rule>\n                <rule name=\"WordPress Rule 4\" stopProcessing=\"true\">\n                    <match url=\"^' . $iis_subdir_match . '(wp-(content|admin|includes).*)\" ignoreCase=\"false\" />\n                    <action type=\"Rewrite\" url=\"' . $iis_rewrite_base . '{R:1}\" />\n                </rule>\n                <rule name=\"WordPress Rule 5\" stopProcessing=\"true\">\n                    <match url=\"^' . $iis_subdir_match . '([_0-9a-zA-Z-]+/)?(.*\\.php)$\" ignoreCase=\"false\" />\n                    <action type=\"Rewrite\" url=\"' . $iis_rewrite_base . '{R:2}\" />\n                </rule>\n                <rule name=\"WordPress Rule 6\" stopProcessing=\"true\">\n                    <match url=\".\" ignoreCase=\"false\" />\n                    <action type=\"Rewrite\" url=\"index.php\" />\n                </rule>\n            </rules>\n        </rewrite>\n    </system.webServer>\n</configuration>\n';\n\n\t\t\techo '<li><p>';\n\t\t\tprintf(\n\t\t\t\t/* translators: 1: File name (.htaccess or web.config), 2: File path. */\n\t\t\t\t__( 'Add the following to your %1$s file in %2$s, <strong>replacing</strong> other WordPress rules:' ),\n\t\t\t\t'<code>web.config</code>',\n\t\t\t\t'<code>' . $home_path . '</code>'\n\t\t\t);\n\t\techo '</p>';\n\t\tif ( ! $subdomain_install && WP_CONTENT_DIR !== ABSPATH . 'wp-content' ) {\n\t\t\techo '<p><strong>' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';\n\t\t}\n\t\t?>\n\t\t<textarea class=\"code\" readonly=\"readonly\" cols=\"100\" rows=\"20\"><?php echo esc_textarea( $web_config_file ); ?></textarea>\n\t\t</li>\n\t</ol>\n\n\t\t<?php\n\telseif ( $is_nginx ) : // End iis7_supports_permalinks(). Link to Nginx documentation instead:\n\n\t\techo '<li><p>';\n\t\tprintf(\n\t\t\t/* translators: %s: Documentation URL. */\n\t\t\t__( 'It seems your network is running with Nginx web server. <a href=\"%s\">Learn more about further configuration</a>.' ),\n\t\t\t__( 'https://wordpress.org/support/article/nginx/' )\n\t\t);\n\t\techo '</p></li>';\n\n\telse : // End $is_nginx. Construct an .htaccess file instead:\n\n\t\t$ms_files_rewriting = '';\n\t\tif ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) {\n\t\t\t$ms_files_rewriting  = \"\\n# uploaded files\\nRewriteRule ^\";\n\t\t\t$ms_files_rewriting .= $subdir_match . \"files/(.+) {$rewrite_base}\" . WPINC . \"/ms-files.php?file={$subdir_replacement_12} [L]\" . \"\\n\";\n\t\t}\n\n\t\t$htaccess_file = <<<EOF\nRewriteEngine On\nRewriteBase {$base}\nRewriteRule ^index\\.php$ - [L]\n{$ms_files_rewriting}\n# add a trailing slash to /wp-admin\nRewriteRule ^{$subdir_match}wp-admin$ {$subdir_replacement_01}wp-admin/ [R=301,L]\n\nRewriteCond %{REQUEST_FILENAME} -f [OR]\nRewriteCond %{REQUEST_FILENAME} -d\nRewriteRule ^ - [L]\nRewriteRule ^{$subdir_match}(wp-(content|admin|includes).*) {$rewrite_base}{$subdir_replacement_12} [L]\nRewriteRule ^{$subdir_match}(.*\\.php)$ {$rewrite_base}$subdir_replacement_12 [L]\nRewriteRule . index.php [L]\n\nEOF;\n\n\t\techo '<li><p>';\n\t\tprintf(\n\t\t\t/* translators: 1: File name (.htaccess or web.config), 2: File path. */\n\t\t\t__( 'Add the following to your %1$s file in %2$s, <strong>replacing</strong> other WordPress rules:' ),\n\t\t\t'<code>.htaccess</code>',\n\t\t\t'<code>' . $home_path . '</code>'\n\t\t);\n\t\techo '</p>';\n\t\tif ( ! $subdomain_install && WP_CONTENT_DIR !== ABSPATH . 'wp-content' ) {\n\t\t\techo '<p><strong>' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';\n\t\t}\n\t\t?>\n\t\t<textarea class=\"code\" readonly=\"readonly\" cols=\"100\" rows=\"<?php echo substr_count( $htaccess_file, \"\\n\" ) + 1; ?>\"><?php echo esc_textarea( $htaccess_file ); ?></textarea>\n\t\t</li>\n\t</ol>\n\n\t\t<?php\n\tendif; // End IIS/Nginx/Apache code branches.\n\n\tif ( ! is_multisite() ) {\n\t\t?>\n\t\t<p><?php _e( 'Once you complete these steps, your network is enabled and configured. You will have to log in again.' ); ?> <a href=\"<?php echo esc_url( wp_login_url() ); ?>\"><?php _e( 'Log In' ); ?></a></p>\n\t\t<?php\n\t}\n}\n", "num_lines": 683}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Noop functions for load-scripts.php and load-styles.php.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.4.0\n */\n\n/**\n * @ignore\n */\nfunction __() {}\n\n/**\n * @ignore\n */\nfunction _x() {}\n\n/**\n * @ignore\n */\nfunction add_filter() {}\n\n/**\n * @ignore\n */\nfunction esc_attr() {}\n\n/**\n * @ignore\n */\nfunction apply_filters() {}\n\n/**\n * @ignore\n */\nfunction get_option() {}\n\n/**\n * @ignore\n */\nfunction is_lighttpd_before_150() {}\n\n/**\n * @ignore\n */\nfunction add_action() {}\n\n/**\n * @ignore\n */\nfunction did_action() {}\n\n/**\n * @ignore\n */\nfunction do_action_ref_array() {}\n\n/**\n * @ignore\n */\nfunction get_bloginfo() {}\n\n/**\n * @ignore\n */\nfunction is_admin() {\n\treturn true;}\n\n/**\n * @ignore\n */\nfunction site_url() {}\n\n/**\n * @ignore\n */\nfunction admin_url() {}\n\n/**\n * @ignore\n */\nfunction home_url() {}\n\n/**\n * @ignore\n */\nfunction includes_url() {}\n\n/**\n * @ignore\n */\nfunction wp_guess_url() {}\n\nfunction get_file( $path ) {\n\n\t$path = realpath( $path );\n\n\tif ( ! $path || ! @is_file( $path ) ) {\n\t\treturn '';\n\t}\n\n\treturn @file_get_contents( $path );\n}\n", "num_lines": 106}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Options Administration API.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.4.0\n */\n\n/**\n * Output JavaScript to toggle display of additional settings if avatars are disabled.\n *\n * @since 4.2.0\n */\nfunction options_discussion_add_js() {\n\t?>\n\t<script>\n\t(function($){\n\t\tvar parent = $( '#show_avatars' ),\n\t\t\tchildren = $( '.avatar-settings' );\n\t\tparent.change(function(){\n\t\t\tchildren.toggleClass( 'hide-if-js', ! this.checked );\n\t\t});\n\t})(jQuery);\n\t</script>\n\t<?php\n}\n\n/**\n * Display JavaScript on the page.\n *\n * @since 3.5.0\n */\nfunction options_general_add_js() {\n\t?>\n<script type=\"text/javascript\">\n\tjQuery(document).ready(function($){\n\t\tvar $siteName = $( '#wp-admin-bar-site-name' ).children( 'a' ).first(),\n\t\t\thomeURL = ( <?php echo wp_json_encode( get_home_url() ); ?> || '' ).replace( /^(https?:\\/\\/)?(www\\.)?/, '' );\n\n\t\t$( '#blogname' ).on( 'input', function() {\n\t\t\tvar title = $.trim( $( this ).val() ) || homeURL;\n\n\t\t\t// Truncate to 40 characters.\n\t\t\tif ( 40 < title.length ) {\n\t\t\t\ttitle = title.substring( 0, 40 ) + '\\u2026';\n\t\t\t}\n\n\t\t\t$siteName.text( title );\n\t\t});\n\n\t\t$( 'input[name=\"date_format\"]' ).click( function() {\n\t\t\tif ( 'date_format_custom_radio' !== $(this).attr( 'id' ) )\n\t\t\t\t$( 'input[name=\"date_format_custom\"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );\n\t\t});\n\n\t\t$( 'input[name=\"date_format_custom\"]' ).on( 'click input', function() {\n\t\t\t$( '#date_format_custom_radio' ).prop( 'checked', true );\n\t\t});\n\n\t\t$( 'input[name=\"time_format\"]' ).click( function() {\n\t\t\tif ( 'time_format_custom_radio' !== $(this).attr( 'id' ) )\n\t\t\t\t$( 'input[name=\"time_format_custom\"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );\n\t\t});\n\n\t\t$( 'input[name=\"time_format_custom\"]' ).on( 'click input', function() {\n\t\t\t$( '#time_format_custom_radio' ).prop( 'checked', true );\n\t\t});\n\n\t\t$( 'input[name=\"date_format_custom\"], input[name=\"time_format_custom\"]' ).on( 'input', function() {\n\t\t\tvar format = $( this ),\n\t\t\t\tfieldset = format.closest( 'fieldset' ),\n\t\t\t\texample = fieldset.find( '.example' ),\n\t\t\t\tspinner = fieldset.find( '.spinner' );\n\n\t\t\t// Debounce the event callback while users are typing.\n\t\t\tclearTimeout( $.data( this, 'timer' ) );\n\t\t\t$( this ).data( 'timer', setTimeout( function() {\n\t\t\t\t// If custom date is not empty.\n\t\t\t\tif ( format.val() ) {\n\t\t\t\t\tspinner.addClass( 'is-active' );\n\n\t\t\t\t\t$.post( ajaxurl, {\n\t\t\t\t\t\taction: 'date_format_custom' === format.attr( 'name' ) ? 'date_format' : 'time_format',\n\t\t\t\t\t\tdate \t: format.val()\n\t\t\t\t\t}, function( d ) { spinner.removeClass( 'is-active' ); example.text( d ); } );\n\t\t\t\t}\n\t\t\t}, 500 ) );\n\t\t} );\n\n\t\tvar languageSelect = $( '#WPLANG' );\n\t\t$( 'form' ).submit( function() {\n\t\t\t// Don't show a spinner for English and installed languages,\n\t\t\t// as there is nothing to download.\n\t\t\tif ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {\n\t\t\t\t$( '#submit', this ).after( '<span class=\"spinner language-install-spinner is-active\" />' );\n\t\t\t}\n\t\t});\n\t});\n</script>\n\t<?php\n}\n\n/**\n * Display JavaScript on the page.\n *\n * @since 3.5.0\n */\nfunction options_reading_add_js() {\n\t?>\n<script type=\"text/javascript\">\n\tjQuery(document).ready(function($){\n\t\tvar section = $('#front-static-pages'),\n\t\t\tstaticPage = section.find('input:radio[value=\"page\"]'),\n\t\t\tselects = section.find('select'),\n\t\t\tcheck_disabled = function(){\n\t\t\t\tselects.prop( 'disabled', ! staticPage.prop('checked') );\n\t\t\t};\n\t\tcheck_disabled();\n\t\tsection.find( 'input:radio' ).change( check_disabled );\n\t});\n</script>\n\t<?php\n}\n\n/**\n * Render the site charset setting.\n *\n * @since 3.5.0\n */\nfunction options_reading_blog_charset() {\n\techo '<input name=\"blog_charset\" type=\"text\" id=\"blog_charset\" value=\"' . esc_attr( get_option( 'blog_charset' ) ) . '\" class=\"regular-text\" />';\n\techo '<p class=\"description\">' . __( 'The <a href=\"https://wordpress.org/support/article/glossary/#character-set\">character encoding</a> of your site (UTF-8 is recommended)' ) . '</p>';\n}\n", "num_lines": 135}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Plugin Install Administration API\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Retrieves plugin installer pages from the WordPress.org Plugins API.\n *\n * It is possible for a plugin to override the Plugin API result with three\n * filters. Assume this is for plugins, which can extend on the Plugin Info to\n * offer more choices. This is very powerful and must be used with care when\n * overriding the filters.\n *\n * The first filter, {@see 'plugins_api_args'}, is for the args and gives the action\n * as the second parameter. The hook for {@see 'plugins_api_args'} must ensure that\n * an object is returned.\n *\n * The second filter, {@see 'plugins_api'}, allows a plugin to override the WordPress.org\n * Plugin Installation API entirely. If `$action` is 'query_plugins' or 'plugin_information',\n * an object MUST be passed. If `$action` is 'hot_tags' or 'hot_categories', an array MUST\n * be passed.\n *\n * Finally, the third filter, {@see 'plugins_api_result'}, makes it possible to filter the\n * response object or array, depending on the `$action` type.\n *\n * Supported arguments per action:\n *\n * | Argument Name        | query_plugins | plugin_information | hot_tags | hot_categories |\n * | -------------------- | :-----------: | :----------------: | :------: | :------------: |\n * | `$slug`              | No            |  Yes               | No       | No             |\n * | `$per_page`          | Yes           |  No                | No       | No             |\n * | `$page`              | Yes           |  No                | No       | No             |\n * | `$number`            | No            |  No                | Yes      | Yes            |\n * | `$search`            | Yes           |  No                | No       | No             |\n * | `$tag`               | Yes           |  No                | No       | No             |\n * | `$author`            | Yes           |  No                | No       | No             |\n * | `$user`              | Yes           |  No                | No       | No             |\n * | `$browse`            | Yes           |  No                | No       | No             |\n * | `$locale`            | Yes           |  Yes               | No       | No             |\n * | `$installed_plugins` | Yes           |  No                | No       | No             |\n * | `$is_ssl`            | Yes           |  Yes               | No       | No             |\n * | `$fields`            | Yes           |  Yes               | No       | No             |\n *\n * @since 2.7.0\n *\n * @param string       $action API action to perform: 'query_plugins', 'plugin_information',\n *                             'hot_tags' or 'hot_categories'.\n * @param array|object $args   {\n *     Optional. Array or object of arguments to serialize for the Plugin Info API.\n *\n *     @type string  $slug              The plugin slug. Default empty.\n *     @type int     $per_page          Number of plugins per page. Default 24.\n *     @type int     $page              Number of current page. Default 1.\n *     @type int     $number            Number of tags or categories to be queried.\n *     @type string  $search            A search term. Default empty.\n *     @type string  $tag               Tag to filter plugins. Default empty.\n *     @type string  $author            Username of an plugin author to filter plugins. Default empty.\n *     @type string  $user              Username to query for their favorites. Default empty.\n *     @type string  $browse            Browse view: 'popular', 'new', 'beta', 'recommended'.\n *     @type string  $locale            Locale to provide context-sensitive results. Default is the value\n *                                      of get_locale().\n *     @type string  $installed_plugins Installed plugins to provide context-sensitive results.\n *     @type bool    $is_ssl            Whether links should be returned with https or not. Default false.\n *     @type array   $fields            {\n *         Array of fields which should or should not be returned.\n *\n *         @type bool $short_description Whether to return the plugin short description. Default true.\n *         @type bool $description       Whether to return the plugin full description. Default false.\n *         @type bool $sections          Whether to return the plugin readme sections: description, installation,\n *                                       FAQ, screenshots, other notes, and changelog. Default false.\n *         @type bool $tested            Whether to return the 'Compatible up to' value. Default true.\n *         @type bool $requires          Whether to return the required WordPress version. Default true.\n *         @type bool $requires_php      Whether to return the required PHP version. Default true.\n *         @type bool $rating            Whether to return the rating in percent and total number of ratings.\n *                                       Default true.\n *         @type bool $ratings           Whether to return the number of rating for each star (1-5). Default true.\n *         @type bool $downloaded        Whether to return the download count. Default true.\n *         @type bool $downloadlink      Whether to return the download link for the package. Default true.\n *         @type bool $last_updated      Whether to return the date of the last update. Default true.\n *         @type bool $added             Whether to return the date when the plugin was added to the wordpress.org\n *                                       repository. Default true.\n *         @type bool $tags              Whether to return the assigned tags. Default true.\n *         @type bool $compatibility     Whether to return the WordPress compatibility list. Default true.\n *         @type bool $homepage          Whether to return the plugin homepage link. Default true.\n *         @type bool $versions          Whether to return the list of all available versions. Default false.\n *         @type bool $donate_link       Whether to return the donation link. Default true.\n *         @type bool $reviews           Whether to return the plugin reviews. Default false.\n *         @type bool $banners           Whether to return the banner images links. Default false.\n *         @type bool $icons             Whether to return the icon links. Default false.\n *         @type bool $active_installs   Whether to return the number of active installations. Default false.\n *         @type bool $group             Whether to return the assigned group. Default false.\n *         @type bool $contributors      Whether to return the list of contributors. Default false.\n *     }\n * }\n * @return object|array|WP_Error Response object or array on success, WP_Error on failure. See the\n *         {@link https://developer.wordpress.org/reference/functions/plugins_api/ function reference article}\n *         for more information on the make-up of possible return values depending on the value of `$action`.\n */\nfunction plugins_api( $action, $args = array() ) {\n\t// Include an unmodified $wp_version.\n\trequire ABSPATH . WPINC . '/version.php';\n\n\tif ( is_array( $args ) ) {\n\t\t$args = (object) $args;\n\t}\n\n\tif ( 'query_plugins' === $action ) {\n\t\tif ( ! isset( $args->per_page ) ) {\n\t\t\t$args->per_page = 24;\n\t\t}\n\t}\n\n\tif ( ! isset( $args->locale ) ) {\n\t\t$args->locale = get_user_locale();\n\t}\n\n\tif ( ! isset( $args->wp_version ) ) {\n\t\t$args->wp_version = substr( $wp_version, 0, 3 ); // x.y\n\t}\n\n\t/**\n\t * Filters the WordPress.org Plugin Installation API arguments.\n\t *\n\t * Important: An object MUST be returned to this filter.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param object $args   Plugin API arguments.\n\t * @param string $action The type of information being requested from the Plugin Installation API.\n\t */\n\t$args = apply_filters( 'plugins_api_args', $args, $action );\n\n\t/**\n\t * Filters the response for the current WordPress.org Plugin Installation API request.\n\t *\n\t * Passing a non-false value will effectively short-circuit the WordPress.org API request.\n\t *\n\t * If `$action` is 'query_plugins' or 'plugin_information', an object MUST be passed.\n\t * If `$action` is 'hot_tags' or 'hot_categories', an array should be passed.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param false|object|array $result The result object or array. Default false.\n\t * @param string             $action The type of information being requested from the Plugin Installation API.\n\t * @param object             $args   Plugin API arguments.\n\t */\n\t$res = apply_filters( 'plugins_api', false, $action, $args );\n\n\tif ( false === $res ) {\n\n\t\t$url = 'http://api.wordpress.org/plugins/info/1.2/';\n\t\t$url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'action'  => $action,\n\t\t\t\t'request' => $args,\n\t\t\t),\n\t\t\t$url\n\t\t);\n\n\t\t$http_url = $url;\n\t\t$ssl      = wp_http_supports( array( 'ssl' ) );\n\t\tif ( $ssl ) {\n\t\t\t$url = set_url_scheme( $url, 'https' );\n\t\t}\n\n\t\t$http_args = array(\n\t\t\t'timeout'    => 15,\n\t\t\t'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),\n\t\t);\n\t\t$request   = wp_remote_get( $url, $http_args );\n\n\t\tif ( $ssl && is_wp_error( $request ) ) {\n\t\t\tif ( ! wp_is_json_request() ) {\n\t\t\t\ttrigger_error(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t\t\t__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=\"%s\">support forums</a>.' ),\n\t\t\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t\t\t) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),\n\t\t\t\t\theaders_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$request = wp_remote_get( $http_url, $http_args );\n\t\t}\n\n\t\tif ( is_wp_error( $request ) ) {\n\t\t\t$res = new WP_Error(\n\t\t\t\t'plugins_api_failed',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t\t__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=\"%s\">support forums</a>.' ),\n\t\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t\t),\n\t\t\t\t$request->get_error_message()\n\t\t\t);\n\t\t} else {\n\t\t\t$res = json_decode( wp_remote_retrieve_body( $request ), true );\n\t\t\tif ( is_array( $res ) ) {\n\t\t\t\t// Object casting is required in order to match the info/1.0 format.\n\t\t\t\t$res = (object) $res;\n\t\t\t} elseif ( null === $res ) {\n\t\t\t\t$res = new WP_Error(\n\t\t\t\t\t'plugins_api_failed',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t\t\t__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=\"%s\">support forums</a>.' ),\n\t\t\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t\t\t),\n\t\t\t\t\twp_remote_retrieve_body( $request )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( isset( $res->error ) ) {\n\t\t\t\t$res = new WP_Error( 'plugins_api_failed', $res->error );\n\t\t\t}\n\t\t}\n\t} elseif ( ! is_wp_error( $res ) ) {\n\t\t$res->external = true;\n\t}\n\n\t/**\n\t * Filters the Plugin Installation API response results.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param object|WP_Error $res    Response object or WP_Error.\n\t * @param string          $action The type of information being requested from the Plugin Installation API.\n\t * @param object          $args   Plugin API arguments.\n\t */\n\treturn apply_filters( 'plugins_api_result', $res, $action, $args );\n}\n\n/**\n * Retrieve popular WordPress plugin tags.\n *\n * @since 2.7.0\n *\n * @param array $args\n * @return array\n */\nfunction install_popular_tags( $args = array() ) {\n\t$key  = md5( serialize( $args ) );\n\t$tags = get_site_transient( 'poptags_' . $key );\n\tif ( false !== $tags ) {\n\t\treturn $tags;\n\t}\n\n\t$tags = plugins_api( 'hot_tags', $args );\n\n\tif ( is_wp_error( $tags ) ) {\n\t\treturn $tags;\n\t}\n\n\tset_site_transient( 'poptags_' . $key, $tags, 3 * HOUR_IN_SECONDS );\n\n\treturn $tags;\n}\n\n/**\n * @since 2.7.0\n */\nfunction install_dashboard() {\n\t?>\n\t<p>\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: %s: https://wordpress.org/plugins/ */\n\t\t\t__( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href=\"%s\">WordPress Plugin Directory</a> or upload a plugin in .zip format by clicking the button at the top of this page.' ),\n\t\t\t__( 'https://wordpress.org/plugins/' )\n\t\t);\n\t\t?>\n\t</p>\n\n\t<?php display_plugins_table(); ?>\n\n\t<div class=\"plugins-popular-tags-wrapper\">\n\t<h2><?php _e( 'Popular tags' ); ?></h2>\n\t<p><?php _e( 'You may also browse based on the most popular tags in the Plugin Directory:' ); ?></p>\n\t<?php\n\n\t$api_tags = install_popular_tags();\n\n\techo '<p class=\"popular-tags\">';\n\tif ( is_wp_error( $api_tags ) ) {\n\t\techo $api_tags->get_error_message();\n\t} else {\n\t\t// Set up the tags in a way which can be interpreted by wp_generate_tag_cloud().\n\t\t$tags = array();\n\t\tforeach ( (array) $api_tags as $tag ) {\n\t\t\t$url                  = self_admin_url( 'plugin-install.php?tab=search&type=tag&s=' . urlencode( $tag['name'] ) );\n\t\t\t$data                 = array(\n\t\t\t\t'link'  => esc_url( $url ),\n\t\t\t\t'name'  => $tag['name'],\n\t\t\t\t'slug'  => $tag['slug'],\n\t\t\t\t'id'    => sanitize_title_with_dashes( $tag['name'] ),\n\t\t\t\t'count' => $tag['count'],\n\t\t\t);\n\t\t\t$tags[ $tag['name'] ] = (object) $data;\n\t\t}\n\t\techo wp_generate_tag_cloud(\n\t\t\t$tags,\n\t\t\tarray(\n\t\t\t\t/* translators: %s: Number of plugins. */\n\t\t\t\t'single_text'   => __( '%s plugin' ),\n\t\t\t\t/* translators: %s: Number of plugins. */\n\t\t\t\t'multiple_text' => __( '%s plugins' ),\n\t\t\t)\n\t\t);\n\t}\n\techo '</p><br class=\"clear\" /></div>';\n}\n\n/**\n * Displays a search form for searching plugins.\n *\n * @since 2.7.0\n * @since 4.6.0 The `$type_selector` parameter was deprecated.\n *\n * @param bool $deprecated Not used.\n */\nfunction install_search_form( $deprecated = true ) {\n\t$type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';\n\t$term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '';\n\t?>\n\t<form class=\"search-form search-plugins\" method=\"get\">\n\t\t<input type=\"hidden\" name=\"tab\" value=\"search\" />\n\t\t<label class=\"screen-reader-text\" for=\"typeselector\"><?php _e( 'Search plugins by:' ); ?></label>\n\t\t<select name=\"type\" id=\"typeselector\">\n\t\t\t<option value=\"term\"<?php selected( 'term', $type ); ?>><?php _e( 'Keyword' ); ?></option>\n\t\t\t<option value=\"author\"<?php selected( 'author', $type ); ?>><?php _e( 'Author' ); ?></option>\n\t\t\t<option value=\"tag\"<?php selected( 'tag', $type ); ?>><?php _ex( 'Tag', 'Plugin Installer' ); ?></option>\n\t\t</select>\n\t\t<label class=\"screen-reader-text\" for=\"search-plugins\"><?php _e( 'Search Plugins' ); ?></label>\n\t\t<input type=\"search\" name=\"s\" id=\"search-plugins\" value=\"<?php echo esc_attr( $term ); ?>\" class=\"wp-filter-search\" placeholder=\"<?php esc_attr_e( 'Search plugins...' ); ?>\" />\n\t\t<?php submit_button( __( 'Search Plugins' ), 'hide-if-js', false, false, array( 'id' => 'search-submit' ) ); ?>\n\t</form>\n\t<?php\n}\n\n/**\n * Upload from zip\n *\n * @since 2.8.0\n */\nfunction install_plugins_upload() {\n\t?>\n<div class=\"upload-plugin\">\n\t<p class=\"install-help\"><?php _e( 'If you have a plugin in a .zip format, you may install or update it by uploading it here.' ); ?></p>\n\t<form method=\"post\" enctype=\"multipart/form-data\" class=\"wp-upload-form\" action=\"<?php echo self_admin_url( 'update.php?action=upload-plugin' ); ?>\">\n\t\t<?php wp_nonce_field( 'plugin-upload' ); ?>\n\t\t<label class=\"screen-reader-text\" for=\"pluginzip\"><?php _e( 'Plugin zip file' ); ?></label>\n\t\t<input type=\"file\" id=\"pluginzip\" name=\"pluginzip\" accept=\".zip\" />\n\t\t<?php submit_button( __( 'Install Now' ), '', 'install-plugin-submit', false ); ?>\n\t</form>\n</div>\n\t<?php\n}\n\n/**\n * Show a username form for the favorites page\n *\n * @since 3.5.0\n */\nfunction install_plugins_favorites_form() {\n\t$user   = get_user_option( 'wporg_favorites' );\n\t$action = 'save_wporg_username_' . get_current_user_id();\n\t?>\n\t<p><?php _e( 'If you have marked plugins as favorites on WordPress.org, you can browse them here.' ); ?></p>\n\t<form method=\"get\">\n\t\t<input type=\"hidden\" name=\"tab\" value=\"favorites\" />\n\t\t<p>\n\t\t\t<label for=\"user\"><?php _e( 'Your WordPress.org username:' ); ?></label>\n\t\t\t<input type=\"search\" id=\"user\" name=\"user\" value=\"<?php echo esc_attr( $user ); ?>\" />\n\t\t\t<input type=\"submit\" class=\"button\" value=\"<?php esc_attr_e( 'Get Favorites' ); ?>\" />\n\t\t\t<input type=\"hidden\" id=\"wporg-username-nonce\" name=\"_wpnonce\" value=\"<?php echo esc_attr( wp_create_nonce( $action ) ); ?>\" />\n\t\t</p>\n\t</form>\n\t<?php\n}\n\n/**\n * Display plugin content based on plugin list.\n *\n * @since 2.7.0\n *\n * @global WP_List_Table $wp_list_table\n */\nfunction display_plugins_table() {\n\tglobal $wp_list_table;\n\n\tswitch ( current_filter() ) {\n\t\tcase 'install_plugins_favorites':\n\t\t\tif ( empty( $_GET['user'] ) && ! get_user_option( 'wporg_favorites' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'install_plugins_recommended':\n\t\t\techo '<p>' . __( 'These suggestions are based on the plugins you and other users have installed.' ) . '</p>';\n\t\t\tbreak;\n\t\tcase 'install_plugins_beta':\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: URL to \"Features as Plugins\" page. */\n\t\t\t\t'<p>' . __( 'You are using a development version of WordPress. These feature plugins are also under development. <a href=\"%s\">Learn more</a>.' ) . '</p>',\n\t\t\t\t'https://make.wordpress.org/core/handbook/about/release-cycle/features-as-plugins/'\n\t\t\t);\n\t\t\tbreak;\n\t}\n\n\t?>\n\t<form id=\"plugin-filter\" method=\"post\">\n\t\t<?php $wp_list_table->display(); ?>\n\t</form>\n\t<?php\n}\n\n/**\n * Determine the status we can perform on a plugin.\n *\n * @since 3.0.0\n *\n * @param array|object $api  Data about the plugin retrieved from the API.\n * @param bool         $loop Optional. Disable further loops. Default false.\n * @return array {\n *     Plugin installation status data.\n *\n *     @type string $status  Status of a plugin. Could be one of 'install', 'update_available', 'latest_installed' or 'newer_installed'.\n *     @type string $url     Plugin installation URL.\n *     @type string $version The most recent version of the plugin.\n *     @type string $file    Plugin filename relative to the plugins directory.\n * }\n */\nfunction install_plugin_install_status( $api, $loop = false ) {\n\t// This function is called recursively, $loop prevents further loops.\n\tif ( is_array( $api ) ) {\n\t\t$api = (object) $api;\n\t}\n\n\t// Default to a \"new\" plugin.\n\t$status      = 'install';\n\t$url         = false;\n\t$update_file = false;\n\t$version     = '';\n\n\t/*\n\t * Check to see if this plugin is known to be installed,\n\t * and has an update awaiting it.\n\t */\n\t$update_plugins = get_site_transient( 'update_plugins' );\n\tif ( isset( $update_plugins->response ) ) {\n\t\tforeach ( (array) $update_plugins->response as $file => $plugin ) {\n\t\t\tif ( $plugin->slug === $api->slug ) {\n\t\t\t\t$status      = 'update_available';\n\t\t\t\t$update_file = $file;\n\t\t\t\t$version     = $plugin->new_version;\n\t\t\t\tif ( current_user_can( 'update_plugins' ) ) {\n\t\t\t\t\t$url = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' . $update_file ), 'upgrade-plugin_' . $update_file );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( 'install' === $status ) {\n\t\tif ( is_dir( WP_PLUGIN_DIR . '/' . $api->slug ) ) {\n\t\t\t$installed_plugin = get_plugins( '/' . $api->slug );\n\t\t\tif ( empty( $installed_plugin ) ) {\n\t\t\t\tif ( current_user_can( 'install_plugins' ) ) {\n\t\t\t\t\t$url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $api->slug ), 'install-plugin_' . $api->slug );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$key = array_keys( $installed_plugin );\n\t\t\t\t// Use the first plugin regardless of the name.\n\t\t\t\t// Could have issues for multiple plugins in one directory if they share different version numbers.\n\t\t\t\t$key = reset( $key );\n\n\t\t\t\t$update_file = $api->slug . '/' . $key;\n\t\t\t\tif ( version_compare( $api->version, $installed_plugin[ $key ]['Version'], '=' ) ) {\n\t\t\t\t\t$status = 'latest_installed';\n\t\t\t\t} elseif ( version_compare( $api->version, $installed_plugin[ $key ]['Version'], '<' ) ) {\n\t\t\t\t\t$status  = 'newer_installed';\n\t\t\t\t\t$version = $installed_plugin[ $key ]['Version'];\n\t\t\t\t} else {\n\t\t\t\t\t// If the above update check failed, then that probably means that the update checker has out-of-date information, force a refresh.\n\t\t\t\t\tif ( ! $loop ) {\n\t\t\t\t\t\tdelete_site_transient( 'update_plugins' );\n\t\t\t\t\t\twp_update_plugins();\n\t\t\t\t\t\treturn install_plugin_install_status( $api, true );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// \"install\" & no directory with that slug.\n\t\t\tif ( current_user_can( 'install_plugins' ) ) {\n\t\t\t\t$url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $api->slug ), 'install-plugin_' . $api->slug );\n\t\t\t}\n\t\t}\n\t}\n\tif ( isset( $_GET['from'] ) ) {\n\t\t$url .= '&amp;from=' . urlencode( wp_unslash( $_GET['from'] ) );\n\t}\n\n\t$file = $update_file;\n\treturn compact( 'status', 'url', 'version', 'file' );\n}\n\n/**\n * Display plugin information in dialog box form.\n *\n * @since 2.7.0\n *\n * @global string $tab\n */\nfunction install_plugin_information() {\n\tglobal $tab;\n\n\tif ( empty( $_REQUEST['plugin'] ) ) {\n\t\treturn;\n\t}\n\n\t$api = plugins_api(\n\t\t'plugin_information',\n\t\tarray(\n\t\t\t'slug' => wp_unslash( $_REQUEST['plugin'] ),\n\t\t)\n\t);\n\n\tif ( is_wp_error( $api ) ) {\n\t\twp_die( $api );\n\t}\n\n\t$plugins_allowedtags = array(\n\t\t'a'          => array(\n\t\t\t'href'   => array(),\n\t\t\t'title'  => array(),\n\t\t\t'target' => array(),\n\t\t),\n\t\t'abbr'       => array( 'title' => array() ),\n\t\t'acronym'    => array( 'title' => array() ),\n\t\t'code'       => array(),\n\t\t'pre'        => array(),\n\t\t'em'         => array(),\n\t\t'strong'     => array(),\n\t\t'div'        => array( 'class' => array() ),\n\t\t'span'       => array( 'class' => array() ),\n\t\t'p'          => array(),\n\t\t'br'         => array(),\n\t\t'ul'         => array(),\n\t\t'ol'         => array(),\n\t\t'li'         => array(),\n\t\t'h1'         => array(),\n\t\t'h2'         => array(),\n\t\t'h3'         => array(),\n\t\t'h4'         => array(),\n\t\t'h5'         => array(),\n\t\t'h6'         => array(),\n\t\t'img'        => array(\n\t\t\t'src'   => array(),\n\t\t\t'class' => array(),\n\t\t\t'alt'   => array(),\n\t\t),\n\t\t'blockquote' => array( 'cite' => true ),\n\t);\n\n\t$plugins_section_titles = array(\n\t\t'description'  => _x( 'Description', 'Plugin installer section title' ),\n\t\t'installation' => _x( 'Installation', 'Plugin installer section title' ),\n\t\t'faq'          => _x( 'FAQ', 'Plugin installer section title' ),\n\t\t'screenshots'  => _x( 'Screenshots', 'Plugin installer section title' ),\n\t\t'changelog'    => _x( 'Changelog', 'Plugin installer section title' ),\n\t\t'reviews'      => _x( 'Reviews', 'Plugin installer section title' ),\n\t\t'other_notes'  => _x( 'Other Notes', 'Plugin installer section title' ),\n\t);\n\n\t// Sanitize HTML.\n\tforeach ( (array) $api->sections as $section_name => $content ) {\n\t\t$api->sections[ $section_name ] = wp_kses( $content, $plugins_allowedtags );\n\t}\n\n\tforeach ( array( 'version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug' ) as $key ) {\n\t\tif ( isset( $api->$key ) ) {\n\t\t\t$api->$key = wp_kses( $api->$key, $plugins_allowedtags );\n\t\t}\n\t}\n\n\t$_tab = esc_attr( $tab );\n\n\t// Default to the Description tab, Do not translate, API returns English.\n\t$section = isset( $_REQUEST['section'] ) ? wp_unslash( $_REQUEST['section'] ) : 'description';\n\tif ( empty( $section ) || ! isset( $api->sections[ $section ] ) ) {\n\t\t$section_titles = array_keys( (array) $api->sections );\n\t\t$section        = reset( $section_titles );\n\t}\n\n\tiframe_header( __( 'Plugin Installation' ) );\n\n\t$_with_banner = '';\n\n\tif ( ! empty( $api->banners ) && ( ! empty( $api->banners['low'] ) || ! empty( $api->banners['high'] ) ) ) {\n\t\t$_with_banner = 'with-banner';\n\t\t$low          = empty( $api->banners['low'] ) ? $api->banners['high'] : $api->banners['low'];\n\t\t$high         = empty( $api->banners['high'] ) ? $api->banners['low'] : $api->banners['high'];\n\t\t?>\n\t\t<style type=\"text/css\">\n\t\t\t#plugin-information-title.with-banner {\n\t\t\t\tbackground-image: url( <?php echo esc_url( $low ); ?> );\n\t\t\t}\n\t\t\t@media only screen and ( -webkit-min-device-pixel-ratio: 1.5 ) {\n\t\t\t\t#plugin-information-title.with-banner {\n\t\t\t\t\tbackground-image: url( <?php echo esc_url( $high ); ?> );\n\t\t\t\t}\n\t\t\t}\n\t\t</style>\n\t\t<?php\n\t}\n\n\techo '<div id=\"plugin-information-scrollable\">';\n\techo \"<div id='{$_tab}-title' class='{$_with_banner}'><div class='vignette'></div><h2>{$api->name}</h2></div>\";\n\techo \"<div id='{$_tab}-tabs' class='{$_with_banner}'>\\n\";\n\n\tforeach ( (array) $api->sections as $section_name => $content ) {\n\t\tif ( 'reviews' === $section_name && ( empty( $api->ratings ) || 0 === array_sum( (array) $api->ratings ) ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( isset( $plugins_section_titles[ $section_name ] ) ) {\n\t\t\t$title = $plugins_section_titles[ $section_name ];\n\t\t} else {\n\t\t\t$title = ucwords( str_replace( '_', ' ', $section_name ) );\n\t\t}\n\n\t\t$class       = ( $section_name === $section ) ? ' class=\"current\"' : '';\n\t\t$href        = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'tab'     => $tab,\n\t\t\t\t'section' => $section_name,\n\t\t\t)\n\t\t);\n\t\t$href        = esc_url( $href );\n\t\t$san_section = esc_attr( $section_name );\n\t\techo \"\\t<a name='$san_section' href='$href' $class>$title</a>\\n\";\n\t}\n\n\techo \"</div>\\n\";\n\n\t?>\n<div id=\"<?php echo $_tab; ?>-content\" class='<?php echo $_with_banner; ?>'>\n\t<div class=\"fyi\">\n\t\t<ul>\n\t\t\t<?php if ( ! empty( $api->version ) ) { ?>\n\t\t\t\t<li><strong><?php _e( 'Version:' ); ?></strong> <?php echo $api->version; ?></li>\n\t\t\t<?php } if ( ! empty( $api->author ) ) { ?>\n\t\t\t\t<li><strong><?php _e( 'Author:' ); ?></strong> <?php echo links_add_target( $api->author, '_blank' ); ?></li>\n\t\t\t<?php } if ( ! empty( $api->last_updated ) ) { ?>\n\t\t\t\t<li><strong><?php _e( 'Last Updated:' ); ?></strong>\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Human-readable time difference. */\n\t\t\t\t\tprintf( __( '%s ago' ), human_time_diff( strtotime( $api->last_updated ) ) );\n\t\t\t\t\t?>\n\t\t\t\t</li>\n\t\t\t<?php } if ( ! empty( $api->requires ) ) { ?>\n\t\t\t\t<li>\n\t\t\t\t\t<strong><?php _e( 'Requires WordPress Version:' ); ?></strong>\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Version number. */\n\t\t\t\t\tprintf( __( '%s or higher' ), $api->requires );\n\t\t\t\t\t?>\n\t\t\t\t</li>\n\t\t\t<?php } if ( ! empty( $api->tested ) ) { ?>\n\t\t\t\t<li><strong><?php _e( 'Compatible up to:' ); ?></strong> <?php echo $api->tested; ?></li>\n\t\t\t<?php } if ( ! empty( $api->requires_php ) ) { ?>\n\t\t\t\t<li>\n\t\t\t\t\t<strong><?php _e( 'Requires PHP Version:' ); ?></strong>\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Version number. */\n\t\t\t\t\tprintf( __( '%s or higher' ), $api->requires_php );\n\t\t\t\t\t?>\n\t\t\t\t</li>\n\t\t\t<?php } if ( isset( $api->active_installs ) ) { ?>\n\t\t\t\t<li><strong><?php _e( 'Active Installations:' ); ?></strong>\n\t\t\t\t<?php\n\t\t\t\tif ( $api->active_installs >= 1000000 ) {\n\t\t\t\t\t$active_installs_millions = floor( $api->active_installs / 1000000 );\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Number of millions. */\n\t\t\t\t\t\t_nx( '%s+ Million', '%s+ Million', $active_installs_millions, 'Active plugin installations' ),\n\t\t\t\t\t\tnumber_format_i18n( $active_installs_millions )\n\t\t\t\t\t);\n\t\t\t\t} elseif ( 0 == $api->active_installs ) {\n\t\t\t\t\t_ex( 'Less Than 10', 'Active plugin installations' );\n\t\t\t\t} else {\n\t\t\t\t\techo number_format_i18n( $api->active_installs ) . '+';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t</li>\n\t\t\t<?php } if ( ! empty( $api->slug ) && empty( $api->external ) ) { ?>\n\t\t\t\t<li><a target=\"_blank\" href=\"<?php echo __( 'https://wordpress.org/plugins/' ) . $api->slug; ?>/\"><?php _e( 'WordPress.org Plugin Page &#187;' ); ?></a></li>\n\t\t\t<?php } if ( ! empty( $api->homepage ) ) { ?>\n\t\t\t\t<li><a target=\"_blank\" href=\"<?php echo esc_url( $api->homepage ); ?>\"><?php _e( 'Plugin Homepage &#187;' ); ?></a></li>\n\t\t\t<?php } if ( ! empty( $api->donate_link ) && empty( $api->contributors ) ) { ?>\n\t\t\t\t<li><a target=\"_blank\" href=\"<?php echo esc_url( $api->donate_link ); ?>\"><?php _e( 'Donate to this plugin &#187;' ); ?></a></li>\n\t\t\t<?php } ?>\n\t\t</ul>\n\t\t<?php if ( ! empty( $api->rating ) ) { ?>\n\t\t\t<h3><?php _e( 'Average Rating' ); ?></h3>\n\t\t\t<?php\n\t\t\twp_star_rating(\n\t\t\t\tarray(\n\t\t\t\t\t'rating' => $api->rating,\n\t\t\t\t\t'type'   => 'percent',\n\t\t\t\t\t'number' => $api->num_ratings,\n\t\t\t\t)\n\t\t\t);\n\t\t\t?>\n\t\t\t<p aria-hidden=\"true\" class=\"fyi-description\">\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: Number of ratings. */\n\t\t\t\t\t_n( '(based on %s rating)', '(based on %s ratings)', $api->num_ratings ),\n\t\t\t\t\tnumber_format_i18n( $api->num_ratings )\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</p>\n\t\t\t<?php\n\t\t}\n\n\t\tif ( ! empty( $api->ratings ) && array_sum( (array) $api->ratings ) > 0 ) {\n\t\t\t?>\n\t\t\t<h3><?php _e( 'Reviews' ); ?></h3>\n\t\t\t<p class=\"fyi-description\"><?php _e( 'Read all reviews on WordPress.org or write your own!' ); ?></p>\n\t\t\t<?php\n\t\t\tforeach ( $api->ratings as $key => $ratecount ) {\n\t\t\t\t// Avoid div-by-zero.\n\t\t\t\t$_rating    = $api->num_ratings ? ( $ratecount / $api->num_ratings ) : 0;\n\t\t\t\t$aria_label = esc_attr(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1: Number of stars (used to determine singular/plural), 2: Number of reviews. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'Reviews with %1$d star: %2$s. Opens in a new tab.',\n\t\t\t\t\t\t\t'Reviews with %1$d stars: %2$s. Opens in a new tab.',\n\t\t\t\t\t\t\t$key\n\t\t\t\t\t\t),\n\t\t\t\t\t\t$key,\n\t\t\t\t\t\tnumber_format_i18n( $ratecount )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t<div class=\"counter-container\">\n\t\t\t\t\t\t<span class=\"counter-label\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t'<a href=\"%s\" target=\"_blank\" aria-label=\"%s\">%s</a>',\n\t\t\t\t\t\t\t\t\"https://wordpress.org/support/plugin/{$api->slug}/reviews/?filter={$key}\",\n\t\t\t\t\t\t\t\t$aria_label,\n\t\t\t\t\t\t\t\t/* translators: %s: Number of stars. */\n\t\t\t\t\t\t\t\tsprintf( _n( '%d star', '%d stars', $key ), $key )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"counter-back\">\n\t\t\t\t\t\t\t<span class=\"counter-bar\" style=\"width: <?php echo 92 * $_rating; ?>px;\"></span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"counter-count\" aria-hidden=\"true\"><?php echo number_format_i18n( $ratecount ); ?></span>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}\n\t\tif ( ! empty( $api->contributors ) ) {\n\t\t\t?>\n\t\t\t<h3><?php _e( 'Contributors' ); ?></h3>\n\t\t\t<ul class=\"contributors\">\n\t\t\t\t<?php\n\t\t\t\tforeach ( (array) $api->contributors as $contrib_username => $contrib_details ) {\n\t\t\t\t\t$contrib_name = $contrib_details['display_name'];\n\t\t\t\t\tif ( ! $contrib_name ) {\n\t\t\t\t\t\t$contrib_name = $contrib_username;\n\t\t\t\t\t}\n\t\t\t\t\t$contrib_name = esc_html( $contrib_name );\n\n\t\t\t\t\t$contrib_profile = esc_url( $contrib_details['profile'] );\n\t\t\t\t\t$contrib_avatar  = esc_url( add_query_arg( 's', '36', $contrib_details['avatar'] ) );\n\n\t\t\t\t\techo \"<li><a href='{$contrib_profile}' target='_blank'><img src='{$contrib_avatar}' width='18' height='18' alt='' />{$contrib_name}</a></li>\";\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</ul>\n\t\t\t\t\t<?php if ( ! empty( $api->donate_link ) ) { ?>\n\t\t\t\t<a target=\"_blank\" href=\"<?php echo esc_url( $api->donate_link ); ?>\"><?php _e( 'Donate to this plugin &#187;' ); ?></a>\n\t\t\t<?php } ?>\n\t\t\t\t<?php } ?>\n\t</div>\n\t<div id=\"section-holder\">\n\t<?php\n\t$requires_php = isset( $api->requires_php ) ? $api->requires_php : null;\n\t$requires_wp  = isset( $api->requires ) ? $api->requires : null;\n\n\t$compatible_php = is_php_version_compatible( $requires_php );\n\t$compatible_wp  = is_wp_version_compatible( $requires_wp );\n\t$tested_wp      = ( empty( $api->tested ) || version_compare( get_bloginfo( 'version' ), $api->tested, '<=' ) );\n\n\tif ( ! $compatible_php ) {\n\t\techo '<div class=\"notice notice-error notice-alt\"><p>';\n\t\t_e( '<strong>Error:</strong> This plugin <strong>requires a newer version of PHP</strong>.' );\n\t\tif ( current_user_can( 'update_php' ) ) {\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t' ' . __( '<a href=\"%s\" target=\"_blank\">Click here to learn more about updating PHP</a>.' ),\n\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t);\n\n\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t} else {\n\t\t\techo '</p>';\n\t\t}\n\t\techo '</div>';\n\t}\n\n\tif ( ! $tested_wp ) {\n\t\techo '<div class=\"notice notice-warning notice-alt\"><p>';\n\t\t_e( '<strong>Warning:</strong> This plugin <strong>has not been tested</strong> with your current version of WordPress.' );\n\t\techo '</p></div>';\n\t} elseif ( ! $compatible_wp ) {\n\t\techo '<div class=\"notice notice-error notice-alt\"><p>';\n\t\t_e( '<strong>Error:</strong> This plugin <strong>requires a newer version of WordPress</strong>.' );\n\t\tif ( current_user_can( 'update_core' ) ) {\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t' ' . __( '<a href=\"%s\" target=\"_parent\">Click here to update WordPress</a>.' ),\n\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t);\n\t\t}\n\t\techo '</p></div>';\n\t}\n\n\tforeach ( (array) $api->sections as $section_name => $content ) {\n\t\t$content = links_add_base_url( $content, 'https://wordpress.org/plugins/' . $api->slug . '/' );\n\t\t$content = links_add_target( $content, '_blank' );\n\n\t\t$san_section = esc_attr( $section_name );\n\n\t\t$display = ( $section_name === $section ) ? 'block' : 'none';\n\n\t\techo \"\\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\\n\";\n\t\techo $content;\n\t\techo \"\\t</div>\\n\";\n\t}\n\techo \"</div>\\n\";\n\techo \"</div>\\n\";\n\techo \"</div>\\n\"; // #plugin-information-scrollable\n\techo \"<div id='$tab-footer'>\\n\";\n\tif ( ! empty( $api->download_link ) && ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) ) {\n\t\t$status = install_plugin_install_status( $api );\n\t\tswitch ( $status['status'] ) {\n\t\t\tcase 'install':\n\t\t\t\tif ( $status['url'] ) {\n\t\t\t\t\tif ( $compatible_php && $compatible_wp ) {\n\t\t\t\t\t\techo '<a data-slug=\"' . esc_attr( $api->slug ) . '\" id=\"plugin_install_from_iframe\" class=\"button button-primary right\" href=\"' . $status['url'] . '\" target=\"_parent\">' . __( 'Install Now' ) . '</a>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t'<button type=\"button\" class=\"button button-primary button-disabled right\" disabled=\"disabled\">%s</button>',\n\t\t\t\t\t\t\t_x( 'Cannot Install', 'plugin' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'update_available':\n\t\t\t\tif ( $status['url'] ) {\n\t\t\t\t\tif ( $compatible_php ) {\n\t\t\t\t\t\techo '<a data-slug=\"' . esc_attr( $api->slug ) . '\" data-plugin=\"' . esc_attr( $status['file'] ) . '\" id=\"plugin_update_from_iframe\" class=\"button button-primary right\" href=\"' . $status['url'] . '\" target=\"_parent\">' . __( 'Install Update Now' ) . '</a>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t'<button type=\"button\" class=\"button button-primary button-disabled right\" disabled=\"disabled\">%s</button>',\n\t\t\t\t\t\t\t_x( 'Cannot Update', 'plugin' )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'newer_installed':\n\t\t\t\t/* translators: %s: Plugin version. */\n\t\t\t\techo '<a class=\"button button-primary right disabled\">' . sprintf( __( 'Newer Version (%s) Installed' ), $status['version'] ) . '</a>';\n\t\t\t\tbreak;\n\t\t\tcase 'latest_installed':\n\t\t\t\techo '<a class=\"button button-primary right disabled\">' . __( 'Latest Version Installed' ) . '</a>';\n\t\t\t\tbreak;\n\t\t}\n\t}\n\techo \"</div>\\n\";\n\n\tiframe_footer();\n\texit;\n}\n", "num_lines": 895}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Plugin Administration API\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Parses the plugin contents to retrieve plugin's metadata.\n *\n * All plugin headers must be on their own line. Plugin description must not have\n * any newlines, otherwise only parts of the description will be displayed.\n * The below is formatted for printing.\n *\n *     /*\n *     Plugin Name: Name of the plugin.\n *     Plugin URI: The home page of the plugin.\n *     Description: Plugin description.\n *     Author: Plugin author's name.\n *     Author URI: Link to the author's website.\n *     Version: Plugin version.\n *     Text Domain: Optional. Unique identifier, should be same as the one used in\n *          load_plugin_textdomain().\n *     Domain Path: Optional. Only useful if the translations are located in a\n *          folder above the plugin's base path. For example, if .mo files are\n *          located in the locale folder then Domain Path will be \"/locale/\" and\n *          must have the first slash. Defaults to the base folder the plugin is\n *          located in.\n *     Network: Optional. Specify \"Network: true\" to require that a plugin is activated\n *          across all sites in an installation. This will prevent a plugin from being\n *          activated on a single site when Multisite is enabled.\n *     Requires at least: Optional. Specify the minimum required WordPress version.\n *     Requires PHP: Optional. Specify the minimum required PHP version.\n *     * / # Remove the space to close comment.\n *\n * The first 8 KB of the file will be pulled in and if the plugin data is not\n * within that first 8 KB, then the plugin author should correct their plugin\n * and move the plugin data headers to the top.\n *\n * The plugin file is assumed to have permissions to allow for scripts to read\n * the file. This is not checked however and the file is only opened for\n * reading.\n *\n * @since 1.5.0\n * @since 5.3.0 Added support for `Requires at least` and `Requires PHP` headers.\n *\n * @param string $plugin_file Absolute path to the main plugin file.\n * @param bool   $markup      Optional. If the returned data should have HTML markup applied.\n *                            Default true.\n * @param bool   $translate   Optional. If the returned data should be translated. Default true.\n * @return array {\n *     Plugin data. Values will be empty if not supplied by the plugin.\n *\n *     @type string $Name        Name of the plugin. Should be unique.\n *     @type string $Title       Title of the plugin and link to the plugin's site (if set).\n *     @type string $Description Plugin description.\n *     @type string $Author      Author's name.\n *     @type string $AuthorURI   Author's website address (if set).\n *     @type string $Version     Plugin version.\n *     @type string $TextDomain  Plugin textdomain.\n *     @type string $DomainPath  Plugins relative directory path to .mo files.\n *     @type bool   $Network     Whether the plugin can only be activated network-wide.\n *     @type string $RequiresWP  Minimum required version of WordPress.\n *     @type string $RequiresPHP Minimum required version of PHP.\n * }\n */\nfunction get_plugin_data( $plugin_file, $markup = true, $translate = true ) {\n\n\t$default_headers = array(\n\t\t'Name'        => 'Plugin Name',\n\t\t'PluginURI'   => 'Plugin URI',\n\t\t'Version'     => 'Version',\n\t\t'Description' => 'Description',\n\t\t'Author'      => 'Author',\n\t\t'AuthorURI'   => 'Author URI',\n\t\t'TextDomain'  => 'Text Domain',\n\t\t'DomainPath'  => 'Domain Path',\n\t\t'Network'     => 'Network',\n\t\t'RequiresWP'  => 'Requires at least',\n\t\t'RequiresPHP' => 'Requires PHP',\n\t\t// Site Wide Only is deprecated in favor of Network.\n\t\t'_sitewide'   => 'Site Wide Only',\n\t);\n\n\t$plugin_data = get_file_data( $plugin_file, $default_headers, 'plugin' );\n\n\t// Site Wide Only is the old header for Network.\n\tif ( ! $plugin_data['Network'] && $plugin_data['_sitewide'] ) {\n\t\t/* translators: 1: Site Wide Only: true, 2: Network: true */\n\t\t_deprecated_argument( __FUNCTION__, '3.0.0', sprintf( __( 'The %1$s plugin header is deprecated. Use %2$s instead.' ), '<code>Site Wide Only: true</code>', '<code>Network: true</code>' ) );\n\t\t$plugin_data['Network'] = $plugin_data['_sitewide'];\n\t}\n\t$plugin_data['Network'] = ( 'true' === strtolower( $plugin_data['Network'] ) );\n\tunset( $plugin_data['_sitewide'] );\n\n\t// If no text domain is defined fall back to the plugin slug.\n\tif ( ! $plugin_data['TextDomain'] ) {\n\t\t$plugin_slug = dirname( plugin_basename( $plugin_file ) );\n\t\tif ( '.' !== $plugin_slug && false === strpos( $plugin_slug, '/' ) ) {\n\t\t\t$plugin_data['TextDomain'] = $plugin_slug;\n\t\t}\n\t}\n\n\tif ( $markup || $translate ) {\n\t\t$plugin_data = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup, $translate );\n\t} else {\n\t\t$plugin_data['Title']      = $plugin_data['Name'];\n\t\t$plugin_data['AuthorName'] = $plugin_data['Author'];\n\t}\n\n\treturn $plugin_data;\n}\n\n/**\n * Sanitizes plugin data, optionally adds markup, optionally translates.\n *\n * @since 2.7.0\n *\n * @see get_plugin_data()\n *\n * @access private\n *\n * @param string $plugin_file Path to the main plugin file.\n * @param array  $plugin_data An array of plugin data. See `get_plugin_data()`.\n * @param bool   $markup      Optional. If the returned data should have HTML markup applied.\n *                            Default true.\n * @param bool   $translate   Optional. If the returned data should be translated. Default true.\n * @return array {\n *     Plugin data. Values will be empty if not supplied by the plugin.\n *\n *     @type string $Name        Name of the plugin. Should be unique.\n *     @type string $Title       Title of the plugin and link to the plugin's site (if set).\n *     @type string $Description Plugin description.\n *     @type string $Author      Author's name.\n *     @type string $AuthorURI   Author's website address (if set).\n *     @type string $Version     Plugin version.\n *     @type string $TextDomain  Plugin textdomain.\n *     @type string $DomainPath  Plugins relative directory path to .mo files.\n *     @type bool   $Network     Whether the plugin can only be activated network-wide.\n * }\n */\nfunction _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup = true, $translate = true ) {\n\n\t// Sanitize the plugin filename to a WP_PLUGIN_DIR relative path.\n\t$plugin_file = plugin_basename( $plugin_file );\n\n\t// Translate fields.\n\tif ( $translate ) {\n\t\t$textdomain = $plugin_data['TextDomain'];\n\t\tif ( $textdomain ) {\n\t\t\tif ( ! is_textdomain_loaded( $textdomain ) ) {\n\t\t\t\tif ( $plugin_data['DomainPath'] ) {\n\t\t\t\t\tload_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) . $plugin_data['DomainPath'] );\n\t\t\t\t} else {\n\t\t\t\t\tload_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) );\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( 'hello.php' === basename( $plugin_file ) ) {\n\t\t\t$textdomain = 'default';\n\t\t}\n\t\tif ( $textdomain ) {\n\t\t\tforeach ( array( 'Name', 'PluginURI', 'Description', 'Author', 'AuthorURI', 'Version' ) as $field ) {\n\t\t\t\t// phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText,WordPress.WP.I18n.NonSingularStringLiteralDomain\n\t\t\t\t$plugin_data[ $field ] = translate( $plugin_data[ $field ], $textdomain );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Sanitize fields.\n\t$allowed_tags_in_links = array(\n\t\t'abbr'    => array( 'title' => true ),\n\t\t'acronym' => array( 'title' => true ),\n\t\t'code'    => true,\n\t\t'em'      => true,\n\t\t'strong'  => true,\n\t);\n\n\t$allowed_tags      = $allowed_tags_in_links;\n\t$allowed_tags['a'] = array(\n\t\t'href'  => true,\n\t\t'title' => true,\n\t);\n\n\t// Name is marked up inside <a> tags. Don't allow these.\n\t// Author is too, but some plugins have used <a> here (omitting Author URI).\n\t$plugin_data['Name']   = wp_kses( $plugin_data['Name'], $allowed_tags_in_links );\n\t$plugin_data['Author'] = wp_kses( $plugin_data['Author'], $allowed_tags );\n\n\t$plugin_data['Description'] = wp_kses( $plugin_data['Description'], $allowed_tags );\n\t$plugin_data['Version']     = wp_kses( $plugin_data['Version'], $allowed_tags );\n\n\t$plugin_data['PluginURI'] = esc_url( $plugin_data['PluginURI'] );\n\t$plugin_data['AuthorURI'] = esc_url( $plugin_data['AuthorURI'] );\n\n\t$plugin_data['Title']      = $plugin_data['Name'];\n\t$plugin_data['AuthorName'] = $plugin_data['Author'];\n\n\t// Apply markup.\n\tif ( $markup ) {\n\t\tif ( $plugin_data['PluginURI'] && $plugin_data['Name'] ) {\n\t\t\t$plugin_data['Title'] = '<a href=\"' . $plugin_data['PluginURI'] . '\">' . $plugin_data['Name'] . '</a>';\n\t\t}\n\n\t\tif ( $plugin_data['AuthorURI'] && $plugin_data['Author'] ) {\n\t\t\t$plugin_data['Author'] = '<a href=\"' . $plugin_data['AuthorURI'] . '\">' . $plugin_data['Author'] . '</a>';\n\t\t}\n\n\t\t$plugin_data['Description'] = wptexturize( $plugin_data['Description'] );\n\n\t\tif ( $plugin_data['Author'] ) {\n\t\t\t$plugin_data['Description'] .= sprintf(\n\t\t\t\t/* translators: %s: Plugin author. */\n\t\t\t\t' <cite>' . __( 'By %s.' ) . '</cite>',\n\t\t\t\t$plugin_data['Author']\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $plugin_data;\n}\n\n/**\n * Get a list of a plugin's files.\n *\n * @since 2.8.0\n *\n * @param string $plugin Path to the plugin file relative to the plugins directory.\n * @return string[] Array of file names relative to the plugin root.\n */\nfunction get_plugin_files( $plugin ) {\n\t$plugin_file = WP_PLUGIN_DIR . '/' . $plugin;\n\t$dir         = dirname( $plugin_file );\n\n\t$plugin_files = array( plugin_basename( $plugin_file ) );\n\n\tif ( is_dir( $dir ) && WP_PLUGIN_DIR !== $dir ) {\n\n\t\t/**\n\t\t * Filters the array of excluded directories and files while scanning the folder.\n\t\t *\n\t\t * @since 4.9.0\n\t\t *\n\t\t * @param string[] $exclusions Array of excluded directories and files.\n\t\t */\n\t\t$exclusions = (array) apply_filters( 'plugin_files_exclusions', array( 'CVS', 'node_modules', 'vendor', 'bower_components' ) );\n\n\t\t$list_files = list_files( $dir, 100, $exclusions );\n\t\t$list_files = array_map( 'plugin_basename', $list_files );\n\n\t\t$plugin_files = array_merge( $plugin_files, $list_files );\n\t\t$plugin_files = array_values( array_unique( $plugin_files ) );\n\t}\n\n\treturn $plugin_files;\n}\n\n/**\n * Check the plugins directory and retrieve all plugin files with plugin data.\n *\n * WordPress only supports plugin files in the base plugins directory\n * (wp-content/plugins) and in one directory above the plugins directory\n * (wp-content/plugins/my-plugin). The file it looks for has the plugin data\n * and must be found in those two locations. It is recommended to keep your\n * plugin files in their own directories.\n *\n * The file with the plugin data is the file that will be included and therefore\n * needs to have the main execution for the plugin. This does not mean\n * everything must be contained in the file and it is recommended that the file\n * be split for maintainability. Keep everything in one file for extreme\n * optimization purposes.\n *\n * @since 1.5.0\n *\n * @param string $plugin_folder Optional. Relative path to single plugin folder.\n * @return array[] Array of arrays of plugin data, keyed by plugin file name. See `get_plugin_data()`.\n */\nfunction get_plugins( $plugin_folder = '' ) {\n\n\t$cache_plugins = wp_cache_get( 'plugins', 'plugins' );\n\tif ( ! $cache_plugins ) {\n\t\t$cache_plugins = array();\n\t}\n\n\tif ( isset( $cache_plugins[ $plugin_folder ] ) ) {\n\t\treturn $cache_plugins[ $plugin_folder ];\n\t}\n\n\t$wp_plugins  = array();\n\t$plugin_root = WP_PLUGIN_DIR;\n\tif ( ! empty( $plugin_folder ) ) {\n\t\t$plugin_root .= $plugin_folder;\n\t}\n\n\t// Files in wp-content/plugins directory.\n\t$plugins_dir  = @ opendir( $plugin_root );\n\t$plugin_files = array();\n\n\tif ( $plugins_dir ) {\n\t\twhile ( ( $file = readdir( $plugins_dir ) ) !== false ) {\n\t\t\tif ( '.' === substr( $file, 0, 1 ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( is_dir( $plugin_root . '/' . $file ) ) {\n\t\t\t\t$plugins_subdir = @ opendir( $plugin_root . '/' . $file );\n\n\t\t\t\tif ( $plugins_subdir ) {\n\t\t\t\t\twhile ( ( $subfile = readdir( $plugins_subdir ) ) !== false ) {\n\t\t\t\t\t\tif ( '.' === substr( $subfile, 0, 1 ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( '.php' === substr( $subfile, -4 ) ) {\n\t\t\t\t\t\t\t$plugin_files[] = \"$file/$subfile\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tclosedir( $plugins_subdir );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( '.php' === substr( $file, -4 ) ) {\n\t\t\t\t\t$plugin_files[] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tclosedir( $plugins_dir );\n\t}\n\n\tif ( empty( $plugin_files ) ) {\n\t\treturn $wp_plugins;\n\t}\n\n\tforeach ( $plugin_files as $plugin_file ) {\n\t\tif ( ! is_readable( \"$plugin_root/$plugin_file\" ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Do not apply markup/translate as it will be cached.\n\t\t$plugin_data = get_plugin_data( \"$plugin_root/$plugin_file\", false, false );\n\n\t\tif ( empty( $plugin_data['Name'] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$wp_plugins[ plugin_basename( $plugin_file ) ] = $plugin_data;\n\t}\n\n\tuasort( $wp_plugins, '_sort_uname_callback' );\n\n\t$cache_plugins[ $plugin_folder ] = $wp_plugins;\n\twp_cache_set( 'plugins', $cache_plugins, 'plugins' );\n\n\treturn $wp_plugins;\n}\n\n/**\n * Check the mu-plugins directory and retrieve all mu-plugin files with any plugin data.\n *\n * WordPress only includes mu-plugin files in the base mu-plugins directory (wp-content/mu-plugins).\n *\n * @since 3.0.0\n * @return array[] Array of arrays of mu-plugin data, keyed by plugin file name. See `get_plugin_data()`.\n */\nfunction get_mu_plugins() {\n\t$wp_plugins   = array();\n\t$plugin_files = array();\n\n\tif ( ! is_dir( WPMU_PLUGIN_DIR ) ) {\n\t\treturn $wp_plugins;\n\t}\n\n\t// Files in wp-content/mu-plugins directory.\n\t$plugins_dir = @opendir( WPMU_PLUGIN_DIR );\n\tif ( $plugins_dir ) {\n\t\twhile ( ( $file = readdir( $plugins_dir ) ) !== false ) {\n\t\t\tif ( '.php' === substr( $file, -4 ) ) {\n\t\t\t\t$plugin_files[] = $file;\n\t\t\t}\n\t\t}\n\t} else {\n\t\treturn $wp_plugins;\n\t}\n\n\tclosedir( $plugins_dir );\n\n\tif ( empty( $plugin_files ) ) {\n\t\treturn $wp_plugins;\n\t}\n\n\tforeach ( $plugin_files as $plugin_file ) {\n\t\tif ( ! is_readable( WPMU_PLUGIN_DIR . \"/$plugin_file\" ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Do not apply markup/translate as it will be cached.\n\t\t$plugin_data = get_plugin_data( WPMU_PLUGIN_DIR . \"/$plugin_file\", false, false );\n\n\t\tif ( empty( $plugin_data['Name'] ) ) {\n\t\t\t$plugin_data['Name'] = $plugin_file;\n\t\t}\n\n\t\t$wp_plugins[ $plugin_file ] = $plugin_data;\n\t}\n\n\tif ( isset( $wp_plugins['index.php'] ) && filesize( WPMU_PLUGIN_DIR . '/index.php' ) <= 30 ) {\n\t\t// Silence is golden.\n\t\tunset( $wp_plugins['index.php'] );\n\t}\n\n\tuasort( $wp_plugins, '_sort_uname_callback' );\n\n\treturn $wp_plugins;\n}\n\n/**\n * Callback to sort array by a 'Name' key.\n *\n * @since 3.1.0\n *\n * @access private\n *\n * @param array $a array with 'Name' key.\n * @param array $b array with 'Name' key.\n * @return int Return 0 or 1 based on two string comparison.\n */\nfunction _sort_uname_callback( $a, $b ) {\n\treturn strnatcasecmp( $a['Name'], $b['Name'] );\n}\n\n/**\n * Check the wp-content directory and retrieve all drop-ins with any plugin data.\n *\n * @since 3.0.0\n * @return array[] Array of arrays of dropin plugin data, keyed by plugin file name. See `get_plugin_data()`.\n */\nfunction get_dropins() {\n\t$dropins      = array();\n\t$plugin_files = array();\n\n\t$_dropins = _get_dropins();\n\n\t// Files in wp-content directory.\n\t$plugins_dir = @opendir( WP_CONTENT_DIR );\n\tif ( $plugins_dir ) {\n\t\twhile ( ( $file = readdir( $plugins_dir ) ) !== false ) {\n\t\t\tif ( isset( $_dropins[ $file ] ) ) {\n\t\t\t\t$plugin_files[] = $file;\n\t\t\t}\n\t\t}\n\t} else {\n\t\treturn $dropins;\n\t}\n\n\tclosedir( $plugins_dir );\n\n\tif ( empty( $plugin_files ) ) {\n\t\treturn $dropins;\n\t}\n\n\tforeach ( $plugin_files as $plugin_file ) {\n\t\tif ( ! is_readable( WP_CONTENT_DIR . \"/$plugin_file\" ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Do not apply markup/translate as it will be cached.\n\t\t$plugin_data = get_plugin_data( WP_CONTENT_DIR . \"/$plugin_file\", false, false );\n\n\t\tif ( empty( $plugin_data['Name'] ) ) {\n\t\t\t$plugin_data['Name'] = $plugin_file;\n\t\t}\n\n\t\t$dropins[ $plugin_file ] = $plugin_data;\n\t}\n\n\tuksort( $dropins, 'strnatcasecmp' );\n\n\treturn $dropins;\n}\n\n/**\n * Returns drop-ins that WordPress uses.\n *\n * Includes Multisite drop-ins only when is_multisite()\n *\n * @since 3.0.0\n * @return array[] Key is file name. The value is an array, with the first value the\n *  purpose of the drop-in and the second value the name of the constant that must be\n *  true for the drop-in to be used, or true if no constant is required.\n */\nfunction _get_dropins() {\n\t$dropins = array(\n\t\t'advanced-cache.php'      => array( __( 'Advanced caching plugin.' ), 'WP_CACHE' ),  // WP_CACHE\n\t\t'db.php'                  => array( __( 'Custom database class.' ), true ),          // Auto on load.\n\t\t'db-error.php'            => array( __( 'Custom database error message.' ), true ),  // Auto on error.\n\t\t'install.php'             => array( __( 'Custom installation script.' ), true ),     // Auto on installation.\n\t\t'maintenance.php'         => array( __( 'Custom maintenance message.' ), true ),     // Auto on maintenance.\n\t\t'object-cache.php'        => array( __( 'External object cache.' ), true ),          // Auto on load.\n\t\t'php-error.php'           => array( __( 'Custom PHP error message.' ), true ),       // Auto on error.\n\t\t'fatal-error-handler.php' => array( __( 'Custom PHP fatal error handler.' ), true ), // Auto on error.\n\t);\n\n\tif ( is_multisite() ) {\n\t\t$dropins['sunrise.php']        = array( __( 'Executed before Multisite is loaded.' ), 'SUNRISE' ); // SUNRISE\n\t\t$dropins['blog-deleted.php']   = array( __( 'Custom site deleted message.' ), true );   // Auto on deleted blog.\n\t\t$dropins['blog-inactive.php']  = array( __( 'Custom site inactive message.' ), true );  // Auto on inactive blog.\n\t\t$dropins['blog-suspended.php'] = array( __( 'Custom site suspended message.' ), true ); // Auto on archived or spammed blog.\n\t}\n\n\treturn $dropins;\n}\n\n/**\n * Determines whether a plugin is active.\n *\n * Only plugins installed in the plugins/ folder can be active.\n *\n * Plugins in the mu-plugins/ folder can't be \"activated,\" so this function will\n * return false for those plugins.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.5.0\n *\n * @param string $plugin Path to the plugin file relative to the plugins directory.\n * @return bool True, if in the active plugins list. False, not in the list.\n */\nfunction is_plugin_active( $plugin ) {\n\treturn in_array( $plugin, (array) get_option( 'active_plugins', array() ), true ) || is_plugin_active_for_network( $plugin );\n}\n\n/**\n * Determines whether the plugin is inactive.\n *\n * Reverse of is_plugin_active(). Used as a callback.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 3.1.0\n *\n * @see is_plugin_active()\n *\n * @param string $plugin Path to the plugin file relative to the plugins directory.\n * @return bool True if inactive. False if active.\n */\nfunction is_plugin_inactive( $plugin ) {\n\treturn ! is_plugin_active( $plugin );\n}\n\n/**\n * Determines whether the plugin is active for the entire network.\n *\n * Only plugins installed in the plugins/ folder can be active.\n *\n * Plugins in the mu-plugins/ folder can't be \"activated,\" so this function will\n * return false for those plugins.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 3.0.0\n *\n * @param string $plugin Path to the plugin file relative to the plugins directory.\n * @return bool True if active for the network, otherwise false.\n */\nfunction is_plugin_active_for_network( $plugin ) {\n\tif ( ! is_multisite() ) {\n\t\treturn false;\n\t}\n\n\t$plugins = get_site_option( 'active_sitewide_plugins' );\n\tif ( isset( $plugins[ $plugin ] ) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Checks for \"Network: true\" in the plugin header to see if this should\n * be activated only as a network wide plugin. The plugin would also work\n * when Multisite is not enabled.\n *\n * Checks for \"Site Wide Only: true\" for backward compatibility.\n *\n * @since 3.0.0\n *\n * @param string $plugin Path to the plugin file relative to the plugins directory.\n * @return bool True if plugin is network only, false otherwise.\n */\nfunction is_network_only_plugin( $plugin ) {\n\t$plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );\n\tif ( $plugin_data ) {\n\t\treturn $plugin_data['Network'];\n\t}\n\treturn false;\n}\n\n/**\n * Attempts activation of plugin in a \"sandbox\" and redirects on success.\n *\n * A plugin that is already activated will not attempt to be activated again.\n *\n * The way it works is by setting the redirection to the error before trying to\n * include the plugin file. If the plugin fails, then the redirection will not\n * be overwritten with the success message. Also, the options will not be\n * updated and the activation hook will not be called on plugin error.\n *\n * It should be noted that in no way the below code will actually prevent errors\n * within the file. The code should not be used elsewhere to replicate the\n * \"sandbox\", which uses redirection to work.\n * {@source 13 1}\n *\n * If any errors are found or text is outputted, then it will be captured to\n * ensure that the success redirection will update the error redirection.\n *\n * @since 2.5.0\n * @since 5.2.0 Test for WordPress version and PHP version compatibility.\n *\n * @param string $plugin       Path to the plugin file relative to the plugins directory.\n * @param string $redirect     Optional. URL to redirect to.\n * @param bool   $network_wide Optional. Whether to enable the plugin for all sites in the network\n *                             or just the current site. Multisite only. Default false.\n * @param bool   $silent       Optional. Whether to prevent calling activation hooks. Default false.\n * @return null|WP_Error Null on success, WP_Error on invalid file.\n */\nfunction activate_plugin( $plugin, $redirect = '', $network_wide = false, $silent = false ) {\n\t$plugin = plugin_basename( trim( $plugin ) );\n\n\tif ( is_multisite() && ( $network_wide || is_network_only_plugin( $plugin ) ) ) {\n\t\t$network_wide        = true;\n\t\t$current             = get_site_option( 'active_sitewide_plugins', array() );\n\t\t$_GET['networkwide'] = 1; // Back compat for plugins looking for this value.\n\t} else {\n\t\t$current = get_option( 'active_plugins', array() );\n\t}\n\n\t$valid = validate_plugin( $plugin );\n\tif ( is_wp_error( $valid ) ) {\n\t\treturn $valid;\n\t}\n\n\t$requirements = validate_plugin_requirements( $plugin );\n\tif ( is_wp_error( $requirements ) ) {\n\t\treturn $requirements;\n\t}\n\n\tif ( ( $network_wide && ! isset( $current[ $plugin ] ) ) || ( ! $network_wide && ! in_array( $plugin, $current, true ) ) ) {\n\t\tif ( ! empty( $redirect ) ) {\n\t\t\t// We'll override this later if the plugin can be included without fatal error.\n\t\t\twp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) );\n\t\t}\n\n\t\tob_start();\n\n\t\tif ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {\n\t\t\tdefine( 'WP_SANDBOX_SCRAPING', true );\n\t\t}\n\n\t\twp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );\n\t\t$_wp_plugin_file = $plugin;\n\t\tinclude_once WP_PLUGIN_DIR . '/' . $plugin;\n\t\t$plugin = $_wp_plugin_file; // Avoid stomping of the $plugin variable in a plugin.\n\n\t\tif ( ! $silent ) {\n\t\t\t/**\n\t\t\t * Fires before a plugin is activated.\n\t\t\t *\n\t\t\t * If a plugin is silently activated (such as during an update),\n\t\t\t * this hook does not fire.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t *\n\t\t\t * @param string $plugin       Path to the plugin file relative to the plugins directory.\n\t\t\t * @param bool   $network_wide Whether to enable the plugin for all sites in the network\n\t\t\t *                             or just the current site. Multisite only. Default false.\n\t\t\t */\n\t\t\tdo_action( 'activate_plugin', $plugin, $network_wide );\n\n\t\t\t/**\n\t\t\t * Fires as a specific plugin is being activated.\n\t\t\t *\n\t\t\t * This hook is the \"activation\" hook used internally by register_activation_hook().\n\t\t\t * The dynamic portion of the hook name, `$plugin`, refers to the plugin basename.\n\t\t\t *\n\t\t\t * If a plugin is silently activated (such as during an update), this hook does not fire.\n\t\t\t *\n\t\t\t * @since 2.0.0\n\t\t\t *\n\t\t\t * @param bool $network_wide Whether to enable the plugin for all sites in the network\n\t\t\t *                           or just the current site. Multisite only. Default false.\n\t\t\t */\n\t\t\tdo_action( \"activate_{$plugin}\", $network_wide );\n\t\t}\n\n\t\tif ( $network_wide ) {\n\t\t\t$current            = get_site_option( 'active_sitewide_plugins', array() );\n\t\t\t$current[ $plugin ] = time();\n\t\t\tupdate_site_option( 'active_sitewide_plugins', $current );\n\t\t} else {\n\t\t\t$current   = get_option( 'active_plugins', array() );\n\t\t\t$current[] = $plugin;\n\t\t\tsort( $current );\n\t\t\tupdate_option( 'active_plugins', $current );\n\t\t}\n\n\t\tif ( ! $silent ) {\n\t\t\t/**\n\t\t\t * Fires after a plugin has been activated.\n\t\t\t *\n\t\t\t * If a plugin is silently activated (such as during an update),\n\t\t\t * this hook does not fire.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t *\n\t\t\t * @param string $plugin       Path to the plugin file relative to the plugins directory.\n\t\t\t * @param bool   $network_wide Whether to enable the plugin for all sites in the network\n\t\t\t *                             or just the current site. Multisite only. Default false.\n\t\t\t */\n\t\t\tdo_action( 'activated_plugin', $plugin, $network_wide );\n\t\t}\n\n\t\tif ( ob_get_length() > 0 ) {\n\t\t\t$output = ob_get_clean();\n\t\t\treturn new WP_Error( 'unexpected_output', __( 'The plugin generated unexpected output.' ), $output );\n\t\t}\n\t\tob_end_clean();\n\t}\n\n\treturn null;\n}\n\n/**\n * Deactivate a single plugin or multiple plugins.\n *\n * The deactivation hook is disabled by the plugin upgrader by using the $silent\n * parameter.\n *\n * @since 2.5.0\n *\n * @param string|string[] $plugins      Single plugin or list of plugins to deactivate.\n * @param bool            $silent       Prevent calling deactivation hooks. Default false.\n * @param bool|null       $network_wide Whether to deactivate the plugin for all sites in the network.\n *                                      A value of null will deactivate plugins for both the network\n *                                      and the current site. Multisite only. Default null.\n */\nfunction deactivate_plugins( $plugins, $silent = false, $network_wide = null ) {\n\tif ( is_multisite() ) {\n\t\t$network_current = get_site_option( 'active_sitewide_plugins', array() );\n\t}\n\t$current    = get_option( 'active_plugins', array() );\n\t$do_blog    = false;\n\t$do_network = false;\n\n\tforeach ( (array) $plugins as $plugin ) {\n\t\t$plugin = plugin_basename( trim( $plugin ) );\n\t\tif ( ! is_plugin_active( $plugin ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$network_deactivating = false !== $network_wide && is_plugin_active_for_network( $plugin );\n\n\t\tif ( ! $silent ) {\n\t\t\t/**\n\t\t\t * Fires before a plugin is deactivated.\n\t\t\t *\n\t\t\t * If a plugin is silently deactivated (such as during an update),\n\t\t\t * this hook does not fire.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t *\n\t\t\t * @param string $plugin               Path to the plugin file relative to the plugins directory.\n\t\t\t * @param bool   $network_deactivating Whether the plugin is deactivated for all sites in the network\n\t\t\t *                                     or just the current site. Multisite only. Default false.\n\t\t\t */\n\t\t\tdo_action( 'deactivate_plugin', $plugin, $network_deactivating );\n\t\t}\n\n\t\tif ( false !== $network_wide ) {\n\t\t\tif ( is_plugin_active_for_network( $plugin ) ) {\n\t\t\t\t$do_network = true;\n\t\t\t\tunset( $network_current[ $plugin ] );\n\t\t\t} elseif ( $network_wide ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif ( true !== $network_wide ) {\n\t\t\t$key = array_search( $plugin, $current, true );\n\t\t\tif ( false !== $key ) {\n\t\t\t\t$do_blog = true;\n\t\t\t\tunset( $current[ $key ] );\n\t\t\t}\n\t\t}\n\n\t\tif ( $do_blog && wp_is_recovery_mode() ) {\n\t\t\tlist( $extension ) = explode( '/', $plugin );\n\t\t\twp_paused_plugins()->delete( $extension );\n\t\t}\n\n\t\tif ( ! $silent ) {\n\t\t\t/**\n\t\t\t * Fires as a specific plugin is being deactivated.\n\t\t\t *\n\t\t\t * This hook is the \"deactivation\" hook used internally by register_deactivation_hook().\n\t\t\t * The dynamic portion of the hook name, `$plugin`, refers to the plugin basename.\n\t\t\t *\n\t\t\t * If a plugin is silently deactivated (such as during an update), this hook does not fire.\n\t\t\t *\n\t\t\t * @since 2.0.0\n\t\t\t *\n\t\t\t * @param bool $network_deactivating Whether the plugin is deactivated for all sites in the network\n\t\t\t *                                   or just the current site. Multisite only. Default false.\n\t\t\t */\n\t\t\tdo_action( \"deactivate_{$plugin}\", $network_deactivating );\n\n\t\t\t/**\n\t\t\t * Fires after a plugin is deactivated.\n\t\t\t *\n\t\t\t * If a plugin is silently deactivated (such as during an update),\n\t\t\t * this hook does not fire.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t *\n\t\t\t * @param string $plugin               Path to the plugin file relative to the plugins directory.\n\t\t\t * @param bool   $network_deactivating Whether the plugin is deactivated for all sites in the network\n\t\t\t *                                     or just the current site. Multisite only. Default false.\n\t\t\t */\n\t\t\tdo_action( 'deactivated_plugin', $plugin, $network_deactivating );\n\t\t}\n\t}\n\n\tif ( $do_blog ) {\n\t\tupdate_option( 'active_plugins', $current );\n\t}\n\tif ( $do_network ) {\n\t\tupdate_site_option( 'active_sitewide_plugins', $network_current );\n\t}\n}\n\n/**\n * Activate multiple plugins.\n *\n * When WP_Error is returned, it does not mean that one of the plugins had\n * errors. It means that one or more of the plugin file paths were invalid.\n *\n * The execution will be halted as soon as one of the plugins has an error.\n *\n * @since 2.6.0\n *\n * @param string|string[] $plugins      Single plugin or list of plugins to activate.\n * @param string          $redirect     Redirect to page after successful activation.\n * @param bool            $network_wide Whether to enable the plugin for all sites in the network.\n *                                      Default false.\n * @param bool            $silent       Prevent calling activation hooks. Default false.\n * @return bool|WP_Error True when finished or WP_Error if there were errors during a plugin activation.\n */\nfunction activate_plugins( $plugins, $redirect = '', $network_wide = false, $silent = false ) {\n\tif ( ! is_array( $plugins ) ) {\n\t\t$plugins = array( $plugins );\n\t}\n\n\t$errors = array();\n\tforeach ( $plugins as $plugin ) {\n\t\tif ( ! empty( $redirect ) ) {\n\t\t\t$redirect = add_query_arg( 'plugin', $plugin, $redirect );\n\t\t}\n\t\t$result = activate_plugin( $plugin, $redirect, $network_wide, $silent );\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\t$errors[ $plugin ] = $result;\n\t\t}\n\t}\n\n\tif ( ! empty( $errors ) ) {\n\t\treturn new WP_Error( 'plugins_invalid', __( 'One of the plugins is invalid.' ), $errors );\n\t}\n\n\treturn true;\n}\n\n/**\n * Remove directory and files of a plugin for a list of plugins.\n *\n * @since 2.6.0\n *\n * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n *\n * @param string[] $plugins    List of plugin paths to delete, relative to the plugins directory.\n * @param string   $deprecated Not used.\n * @return bool|null|WP_Error True on success, false if `$plugins` is empty, `WP_Error` on failure.\n *                            `null` if filesystem credentials are required to proceed.\n */\nfunction delete_plugins( $plugins, $deprecated = '' ) {\n\tglobal $wp_filesystem;\n\n\tif ( empty( $plugins ) ) {\n\t\treturn false;\n\t}\n\n\t$checked = array();\n\tforeach ( $plugins as $plugin ) {\n\t\t$checked[] = 'checked[]=' . $plugin;\n\t}\n\n\t$url = wp_nonce_url( 'plugins.php?action=delete-selected&verify-delete=1&' . implode( '&', $checked ), 'bulk-plugins' );\n\n\tob_start();\n\t$credentials = request_filesystem_credentials( $url );\n\t$data        = ob_get_clean();\n\n\tif ( false === $credentials ) {\n\t\tif ( ! empty( $data ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t\t\techo $data;\n\t\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t\t\texit;\n\t\t}\n\t\treturn;\n\t}\n\n\tif ( ! WP_Filesystem( $credentials ) ) {\n\t\tob_start();\n\t\t// Failed to connect. Error and request again.\n\t\trequest_filesystem_credentials( $url, '', true );\n\t\t$data = ob_get_clean();\n\n\t\tif ( ! empty( $data ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t\t\techo $data;\n\t\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t\t\texit;\n\t\t}\n\t\treturn;\n\t}\n\n\tif ( ! is_object( $wp_filesystem ) ) {\n\t\treturn new WP_Error( 'fs_unavailable', __( 'Could not access filesystem.' ) );\n\t}\n\n\tif ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {\n\t\treturn new WP_Error( 'fs_error', __( 'Filesystem error.' ), $wp_filesystem->errors );\n\t}\n\n\t// Get the base plugin folder.\n\t$plugins_dir = $wp_filesystem->wp_plugins_dir();\n\tif ( empty( $plugins_dir ) ) {\n\t\treturn new WP_Error( 'fs_no_plugins_dir', __( 'Unable to locate WordPress plugin directory.' ) );\n\t}\n\n\t$plugins_dir = trailingslashit( $plugins_dir );\n\n\t$plugin_translations = wp_get_installed_translations( 'plugins' );\n\n\t$errors = array();\n\n\tforeach ( $plugins as $plugin_file ) {\n\t\t// Run Uninstall hook.\n\t\tif ( is_uninstallable_plugin( $plugin_file ) ) {\n\t\t\tuninstall_plugin( $plugin_file );\n\t\t}\n\n\t\t/**\n\t\t * Fires immediately before a plugin deletion attempt.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string $plugin_file Path to the plugin file relative to the plugins directory.\n\t\t */\n\t\tdo_action( 'delete_plugin', $plugin_file );\n\n\t\t$this_plugin_dir = trailingslashit( dirname( $plugins_dir . $plugin_file ) );\n\n\t\t// If plugin is in its own directory, recursively delete the directory.\n\t\t// Base check on if plugin includes directory separator AND that it's not the root plugin folder.\n\t\tif ( strpos( $plugin_file, '/' ) && $this_plugin_dir != $plugins_dir ) {\n\t\t\t$deleted = $wp_filesystem->delete( $this_plugin_dir, true );\n\t\t} else {\n\t\t\t$deleted = $wp_filesystem->delete( $plugins_dir . $plugin_file );\n\t\t}\n\n\t\t/**\n\t\t * Fires immediately after a plugin deletion attempt.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string $plugin_file Path to the plugin file relative to the plugins directory.\n\t\t * @param bool   $deleted     Whether the plugin deletion was successful.\n\t\t */\n\t\tdo_action( 'deleted_plugin', $plugin_file, $deleted );\n\n\t\tif ( ! $deleted ) {\n\t\t\t$errors[] = $plugin_file;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Remove language files, silently.\n\t\t$plugin_slug = dirname( $plugin_file );\n\t\tif ( '.' !== $plugin_slug && ! empty( $plugin_translations[ $plugin_slug ] ) ) {\n\t\t\t$translations = $plugin_translations[ $plugin_slug ];\n\n\t\t\tforeach ( $translations as $translation => $data ) {\n\t\t\t\t$wp_filesystem->delete( WP_LANG_DIR . '/plugins/' . $plugin_slug . '-' . $translation . '.po' );\n\t\t\t\t$wp_filesystem->delete( WP_LANG_DIR . '/plugins/' . $plugin_slug . '-' . $translation . '.mo' );\n\n\t\t\t\t$json_translation_files = glob( WP_LANG_DIR . '/plugins/' . $plugin_slug . '-' . $translation . '-*.json' );\n\t\t\t\tif ( $json_translation_files ) {\n\t\t\t\t\tarray_map( array( $wp_filesystem, 'delete' ), $json_translation_files );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove deleted plugins from the plugin updates list.\n\t$current = get_site_transient( 'update_plugins' );\n\tif ( $current ) {\n\t\t// Don't remove the plugins that weren't deleted.\n\t\t$deleted = array_diff( $plugins, $errors );\n\n\t\tforeach ( $deleted as $plugin_file ) {\n\t\t\tunset( $current->response[ $plugin_file ] );\n\t\t}\n\n\t\tset_site_transient( 'update_plugins', $current );\n\t}\n\n\tif ( ! empty( $errors ) ) {\n\t\tif ( 1 === count( $errors ) ) {\n\t\t\t/* translators: %s: Plugin filename. */\n\t\t\t$message = __( 'Could not fully remove the plugin %s.' );\n\t\t} else {\n\t\t\t/* translators: %s: Comma-separated list of plugin filenames. */\n\t\t\t$message = __( 'Could not fully remove the plugins %s.' );\n\t\t}\n\n\t\treturn new WP_Error( 'could_not_remove_plugin', sprintf( $message, implode( ', ', $errors ) ) );\n\t}\n\n\treturn true;\n}\n\n/**\n * Validate active plugins\n *\n * Validate all active plugins, deactivates invalid and\n * returns an array of deactivated ones.\n *\n * @since 2.5.0\n * @return WP_Error[] Array of plugin errors keyed by plugin file name.\n */\nfunction validate_active_plugins() {\n\t$plugins = get_option( 'active_plugins', array() );\n\t// Validate vartype: array.\n\tif ( ! is_array( $plugins ) ) {\n\t\tupdate_option( 'active_plugins', array() );\n\t\t$plugins = array();\n\t}\n\n\tif ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) {\n\t\t$network_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );\n\t\t$plugins         = array_merge( $plugins, array_keys( $network_plugins ) );\n\t}\n\n\tif ( empty( $plugins ) ) {\n\t\treturn array();\n\t}\n\n\t$invalid = array();\n\n\t// Invalid plugins get deactivated.\n\tforeach ( $plugins as $plugin ) {\n\t\t$result = validate_plugin( $plugin );\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\t$invalid[ $plugin ] = $result;\n\t\t\tdeactivate_plugins( $plugin, true );\n\t\t}\n\t}\n\treturn $invalid;\n}\n\n/**\n * Validate the plugin path.\n *\n * Checks that the main plugin file exists and is a valid plugin. See validate_file().\n *\n * @since 2.5.0\n *\n * @param string $plugin Path to the plugin file relative to the plugins directory.\n * @return int|WP_Error 0 on success, WP_Error on failure.\n */\nfunction validate_plugin( $plugin ) {\n\tif ( validate_file( $plugin ) ) {\n\t\treturn new WP_Error( 'plugin_invalid', __( 'Invalid plugin path.' ) );\n\t}\n\tif ( ! file_exists( WP_PLUGIN_DIR . '/' . $plugin ) ) {\n\t\treturn new WP_Error( 'plugin_not_found', __( 'Plugin file does not exist.' ) );\n\t}\n\n\t$installed_plugins = get_plugins();\n\tif ( ! isset( $installed_plugins[ $plugin ] ) ) {\n\t\treturn new WP_Error( 'no_plugin_header', __( 'The plugin does not have a valid header.' ) );\n\t}\n\treturn 0;\n}\n\n/**\n * Validates the plugin requirements for WordPress version and PHP version.\n *\n * Uses the information from `Requires at least` and `Requires PHP` headers\n * defined in the plugin's main PHP file.\n *\n * If the headers are not present in the plugin's main PHP file,\n * `readme.txt` is also checked as a fallback.\n *\n * @since 5.2.0\n * @since 5.3.0 Added support for reading the headers from the plugin's\n *              main PHP file, with `readme.txt` as a fallback.\n *\n * @param string $plugin Path to the plugin file relative to the plugins directory.\n * @return true|WP_Error True if requirements are met, WP_Error on failure.\n */\nfunction validate_plugin_requirements( $plugin ) {\n\t$plugin_headers = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );\n\n\t$requirements = array(\n\t\t'requires'     => ! empty( $plugin_headers['RequiresWP'] ) ? $plugin_headers['RequiresWP'] : '',\n\t\t'requires_php' => ! empty( $plugin_headers['RequiresPHP'] ) ? $plugin_headers['RequiresPHP'] : '',\n\t);\n\n\t$readme_file = WP_PLUGIN_DIR . '/' . dirname( $plugin ) . '/readme.txt';\n\n\tif ( file_exists( $readme_file ) ) {\n\t\t$readme_headers = get_file_data(\n\t\t\t$readme_file,\n\t\t\tarray(\n\t\t\t\t'requires'     => 'Requires at least',\n\t\t\t\t'requires_php' => 'Requires PHP',\n\t\t\t),\n\t\t\t'plugin'\n\t\t);\n\n\t\t$requirements = array_merge( $readme_headers, $requirements );\n\t}\n\n\t$compatible_wp  = is_wp_version_compatible( $requirements['requires'] );\n\t$compatible_php = is_php_version_compatible( $requirements['requires_php'] );\n\n\t/* translators: %s: URL to Update PHP page. */\n\t$php_update_message = '</p><p>' . sprintf(\n\t\t__( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\tesc_url( wp_get_update_php_url() )\n\t);\n\n\t$annotation = wp_get_update_php_annotation();\n\n\tif ( $annotation ) {\n\t\t$php_update_message .= '</p><p><em>' . $annotation . '</em>';\n\t}\n\n\tif ( ! $compatible_wp && ! $compatible_php ) {\n\t\treturn new WP_Error(\n\t\t\t'plugin_wp_php_incompatible',\n\t\t\t'<p>' . sprintf(\n\t\t\t\t/* translators: 1: Current WordPress version, 2: Current PHP version, 3: Plugin name, 4: Required WordPress version, 5: Required PHP version. */\n\t\t\t\t_x( '<strong>Error:</strong> Current versions of WordPress (%1$s) and PHP (%2$s) do not meet minimum requirements for %3$s. The plugin requires WordPress %4$s and PHP %5$s.', 'plugin' ),\n\t\t\t\tget_bloginfo( 'version' ),\n\t\t\t\tphpversion(),\n\t\t\t\t$plugin_headers['Name'],\n\t\t\t\t$requirements['requires'],\n\t\t\t\t$requirements['requires_php']\n\t\t\t) . $php_update_message . '</p>'\n\t\t);\n\t} elseif ( ! $compatible_php ) {\n\t\treturn new WP_Error(\n\t\t\t'plugin_php_incompatible',\n\t\t\t'<p>' . sprintf(\n\t\t\t\t/* translators: 1: Current PHP version, 2: Plugin name, 3: Required PHP version. */\n\t\t\t\t_x( '<strong>Error:</strong> Current PHP version (%1$s) does not meet minimum requirements for %2$s. The plugin requires PHP %3$s.', 'plugin' ),\n\t\t\t\tphpversion(),\n\t\t\t\t$plugin_headers['Name'],\n\t\t\t\t$requirements['requires_php']\n\t\t\t) . $php_update_message . '</p>'\n\t\t);\n\t} elseif ( ! $compatible_wp ) {\n\t\treturn new WP_Error(\n\t\t\t'plugin_wp_incompatible',\n\t\t\t'<p>' . sprintf(\n\t\t\t\t/* translators: 1: Current WordPress version, 2: Plugin name, 3: Required WordPress version. */\n\t\t\t\t_x( '<strong>Error:</strong> Current WordPress version (%1$s) does not meet minimum requirements for %2$s. The plugin requires WordPress %3$s.', 'plugin' ),\n\t\t\t\tget_bloginfo( 'version' ),\n\t\t\t\t$plugin_headers['Name'],\n\t\t\t\t$requirements['requires']\n\t\t\t) . '</p>'\n\t\t);\n\t}\n\n\treturn true;\n}\n\n/**\n * Whether the plugin can be uninstalled.\n *\n * @since 2.7.0\n *\n * @param string $plugin Path to the plugin file relative to the plugins directory.\n * @return bool Whether plugin can be uninstalled.\n */\nfunction is_uninstallable_plugin( $plugin ) {\n\t$file = plugin_basename( $plugin );\n\n\t$uninstallable_plugins = (array) get_option( 'uninstall_plugins' );\n\tif ( isset( $uninstallable_plugins[ $file ] ) || file_exists( WP_PLUGIN_DIR . '/' . dirname( $file ) . '/uninstall.php' ) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Uninstall a single plugin.\n *\n * Calls the uninstall hook, if it is available.\n *\n * @since 2.7.0\n *\n * @param string $plugin Path to the plugin file relative to the plugins directory.\n * @return true True if a plugin's uninstall.php file has been found and included.\n */\nfunction uninstall_plugin( $plugin ) {\n\t$file = plugin_basename( $plugin );\n\n\t$uninstallable_plugins = (array) get_option( 'uninstall_plugins' );\n\n\t/**\n\t * Fires in uninstall_plugin() immediately before the plugin is uninstalled.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param string $plugin                Path to the plugin file relative to the plugins directory.\n\t * @param array  $uninstallable_plugins Uninstallable plugins.\n\t */\n\tdo_action( 'pre_uninstall_plugin', $plugin, $uninstallable_plugins );\n\n\tif ( file_exists( WP_PLUGIN_DIR . '/' . dirname( $file ) . '/uninstall.php' ) ) {\n\t\tif ( isset( $uninstallable_plugins[ $file ] ) ) {\n\t\t\tunset( $uninstallable_plugins[ $file ] );\n\t\t\tupdate_option( 'uninstall_plugins', $uninstallable_plugins );\n\t\t}\n\t\tunset( $uninstallable_plugins );\n\n\t\tdefine( 'WP_UNINSTALL_PLUGIN', $file );\n\n\t\twp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $file );\n\t\tinclude_once WP_PLUGIN_DIR . '/' . dirname( $file ) . '/uninstall.php';\n\n\t\treturn true;\n\t}\n\n\tif ( isset( $uninstallable_plugins[ $file ] ) ) {\n\t\t$callable = $uninstallable_plugins[ $file ];\n\t\tunset( $uninstallable_plugins[ $file ] );\n\t\tupdate_option( 'uninstall_plugins', $uninstallable_plugins );\n\t\tunset( $uninstallable_plugins );\n\n\t\twp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $file );\n\t\tinclude_once WP_PLUGIN_DIR . '/' . $file;\n\n\t\tadd_action( \"uninstall_{$file}\", $callable );\n\n\t\t/**\n\t\t * Fires in uninstall_plugin() once the plugin has been uninstalled.\n\t\t *\n\t\t * The action concatenates the 'uninstall_' prefix with the basename of the\n\t\t * plugin passed to uninstall_plugin() to create a dynamically-named action.\n\t\t *\n\t\t * @since 2.7.0\n\t\t */\n\t\tdo_action( \"uninstall_{$file}\" );\n\t}\n}\n\n//\n// Menu.\n//\n\n/**\n * Add a top-level menu page.\n *\n * This function takes a capability which will be used to determine whether\n * or not a page is included in the menu.\n *\n * The function which is hooked in to handle the output of the page must check\n * that the user has the required capability as well.\n *\n * @since 1.5.0\n *\n * @global array $menu\n * @global array $admin_page_hooks\n * @global array $_registered_pages\n * @global array $_parent_pages\n *\n * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.\n * @param string   $menu_title The text to be used for the menu.\n * @param string   $capability The capability required for this menu to be displayed to the user.\n * @param string   $menu_slug  The slug name to refer to this menu by. Should be unique for this menu page and only\n *                             include lowercase alphanumeric, dashes, and underscores characters to be compatible\n *                             with sanitize_key().\n * @param callable $function   The function to be called to output the content for this page.\n * @param string   $icon_url   The URL to the icon to be used for this menu.\n *                             * Pass a base64-encoded SVG using a data URI, which will be colored to match\n *                               the color scheme. This should begin with 'data:image/svg+xml;base64,'.\n *                             * Pass the name of a Dashicons helper class to use a font icon,\n *                               e.g. 'dashicons-chart-pie'.\n *                             * Pass 'none' to leave div.wp-menu-image empty so an icon can be added via CSS.\n * @param int      $position   The position in the menu order this item should appear.\n * @return string The resulting page's hook_suffix.\n */\nfunction add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '', $position = null ) {\n\tglobal $menu, $admin_page_hooks, $_registered_pages, $_parent_pages;\n\n\t$menu_slug = plugin_basename( $menu_slug );\n\n\t$admin_page_hooks[ $menu_slug ] = sanitize_title( $menu_title );\n\n\t$hookname = get_plugin_page_hookname( $menu_slug, '' );\n\n\tif ( ! empty( $function ) && ! empty( $hookname ) && current_user_can( $capability ) ) {\n\t\tadd_action( $hookname, $function );\n\t}\n\n\tif ( empty( $icon_url ) ) {\n\t\t$icon_url   = 'dashicons-admin-generic';\n\t\t$icon_class = 'menu-icon-generic ';\n\t} else {\n\t\t$icon_url   = set_url_scheme( $icon_url );\n\t\t$icon_class = '';\n\t}\n\n\t$new_menu = array( $menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $icon_class . $hookname, $hookname, $icon_url );\n\n\tif ( null === $position ) {\n\t\t$menu[] = $new_menu;\n\t} elseif ( isset( $menu[ \"$position\" ] ) ) {\n\t\t$position            = $position + substr( base_convert( md5( $menu_slug . $menu_title ), 16, 10 ), -5 ) * 0.00001;\n\t\t$menu[ \"$position\" ] = $new_menu;\n\t} else {\n\t\t$menu[ $position ] = $new_menu;\n\t}\n\n\t$_registered_pages[ $hookname ] = true;\n\n\t// No parent as top level.\n\t$_parent_pages[ $menu_slug ] = false;\n\n\treturn $hookname;\n}\n\n/**\n * Add a submenu page.\n *\n * This function takes a capability which will be used to determine whether\n * or not a page is included in the menu.\n *\n * The function which is hooked in to handle the output of the page must check\n * that the user has the required capability as well.\n *\n * @since 1.5.0\n * @since 5.3.0 Added the `$position` parameter.\n *\n * @global array $submenu\n * @global array $menu\n * @global array $_wp_real_parent_file\n * @global bool  $_wp_submenu_nopriv\n * @global array $_registered_pages\n * @global array $_parent_pages\n *\n * @param string   $parent_slug The slug name for the parent menu (or the file name of a standard\n *                              WordPress admin page).\n * @param string   $page_title  The text to be displayed in the title tags of the page when the menu\n *                              is selected.\n * @param string   $menu_title  The text to be used for the menu.\n * @param string   $capability  The capability required for this menu to be displayed to the user.\n * @param string   $menu_slug   The slug name to refer to this menu by. Should be unique for this menu\n *                              and only include lowercase alphanumeric, dashes, and underscores characters\n *                              to be compatible with sanitize_key().\n * @param callable $function    The function to be called to output the content for this page.\n * @param int      $position    The position in the menu order this item should appear.\n * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.\n */\nfunction add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {\n\tglobal $submenu, $menu, $_wp_real_parent_file, $_wp_submenu_nopriv,\n\t\t$_registered_pages, $_parent_pages;\n\n\t$menu_slug   = plugin_basename( $menu_slug );\n\t$parent_slug = plugin_basename( $parent_slug );\n\n\tif ( isset( $_wp_real_parent_file[ $parent_slug ] ) ) {\n\t\t$parent_slug = $_wp_real_parent_file[ $parent_slug ];\n\t}\n\n\tif ( ! current_user_can( $capability ) ) {\n\t\t$_wp_submenu_nopriv[ $parent_slug ][ $menu_slug ] = true;\n\t\treturn false;\n\t}\n\n\t/*\n\t * If the parent doesn't already have a submenu, add a link to the parent\n\t * as the first item in the submenu. If the submenu file is the same as the\n\t * parent file someone is trying to link back to the parent manually. In\n\t * this case, don't automatically add a link back to avoid duplication.\n\t */\n\tif ( ! isset( $submenu[ $parent_slug ] ) && $menu_slug != $parent_slug ) {\n\t\tforeach ( (array) $menu as $parent_menu ) {\n\t\t\tif ( $parent_menu[2] == $parent_slug && current_user_can( $parent_menu[1] ) ) {\n\t\t\t\t$submenu[ $parent_slug ][] = array_slice( $parent_menu, 0, 4 );\n\t\t\t}\n\t\t}\n\t}\n\n\t$new_sub_menu = array( $menu_title, $capability, $menu_slug, $page_title );\n\tif ( ! is_int( $position ) ) {\n\t\tif ( null !== $position ) {\n\t\t\t_doing_it_wrong(\n\t\t\t\t__FUNCTION__,\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: add_submenu_page() */\n\t\t\t\t\t__( 'The seventh parameter passed to %s should be an integer representing menu position.' ),\n\t\t\t\t\t'<code>add_submenu_page()</code>'\n\t\t\t\t),\n\t\t\t\t'5.3.0'\n\t\t\t);\n\t\t}\n\n\t\t$submenu[ $parent_slug ][] = $new_sub_menu;\n\t} else {\n\t\t// Append the submenu if the parent item is not present in the submenu,\n\t\t// or if position is equal or higher than the number of items in the array.\n\t\tif ( ! isset( $submenu[ $parent_slug ] ) || $position >= count( $submenu[ $parent_slug ] ) ) {\n\t\t\t$submenu[ $parent_slug ][] = $new_sub_menu;\n\t\t} else {\n\t\t\t// Test for a negative position.\n\t\t\t$position = max( $position, 0 );\n\t\t\tif ( 0 === $position ) {\n\t\t\t\t// For negative or `0` positions, prepend the submenu.\n\t\t\t\tarray_unshift( $submenu[ $parent_slug ], $new_sub_menu );\n\t\t\t} else {\n\t\t\t\t// Grab all of the items before the insertion point.\n\t\t\t\t$before_items = array_slice( $submenu[ $parent_slug ], 0, $position, true );\n\t\t\t\t// Grab all of the items after the insertion point.\n\t\t\t\t$after_items = array_slice( $submenu[ $parent_slug ], $position, null, true );\n\t\t\t\t// Add the new item.\n\t\t\t\t$before_items[] = $new_sub_menu;\n\t\t\t\t// Merge the items.\n\t\t\t\t$submenu[ $parent_slug ] = array_merge( $before_items, $after_items );\n\t\t\t}\n\t\t}\n\t}\n\t// Sort the parent array.\n\tksort( $submenu[ $parent_slug ] );\n\n\t$hookname = get_plugin_page_hookname( $menu_slug, $parent_slug );\n\tif ( ! empty( $function ) && ! empty( $hookname ) ) {\n\t\tadd_action( $hookname, $function );\n\t}\n\n\t$_registered_pages[ $hookname ] = true;\n\n\t/*\n\t * Backward-compatibility for plugins using add_management_page().\n\t * See wp-admin/admin.php for redirect from edit.php to tools.php.\n\t */\n\tif ( 'tools.php' === $parent_slug ) {\n\t\t$_registered_pages[ get_plugin_page_hookname( $menu_slug, 'edit.php' ) ] = true;\n\t}\n\n\t// No parent as top level.\n\t$_parent_pages[ $menu_slug ] = $parent_slug;\n\n\treturn $hookname;\n}\n\n/**\n * Add submenu page to the Tools main menu.\n *\n * This function takes a capability which will be used to determine whether\n * or not a page is included in the menu.\n *\n * The function which is hooked in to handle the output of the page must check\n * that the user has the required capability as well.\n *\n * @since 1.5.0\n * @since 5.3.0 Added the `$position` parameter.\n *\n * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.\n * @param string   $menu_title The text to be used for the menu.\n * @param string   $capability The capability required for this menu to be displayed to the user.\n * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).\n * @param callable $function   The function to be called to output the content for this page.\n * @param int      $position   The position in the menu order this item should appear.\n * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.\n */\nfunction add_management_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {\n\treturn add_submenu_page( 'tools.php', $page_title, $menu_title, $capability, $menu_slug, $function, $position );\n}\n\n/**\n * Add submenu page to the Settings main menu.\n *\n * This function takes a capability which will be used to determine whether\n * or not a page is included in the menu.\n *\n * The function which is hooked in to handle the output of the page must check\n * that the user has the required capability as well.\n *\n * @since 1.5.0\n * @since 5.3.0 Added the `$position` parameter.\n *\n * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.\n * @param string   $menu_title The text to be used for the menu.\n * @param string   $capability The capability required for this menu to be displayed to the user.\n * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).\n * @param callable $function   The function to be called to output the content for this page.\n * @param int      $position   The position in the menu order this item should appear.\n * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.\n */\nfunction add_options_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {\n\treturn add_submenu_page( 'options-general.php', $page_title, $menu_title, $capability, $menu_slug, $function, $position );\n}\n\n/**\n * Add submenu page to the Appearance main menu.\n *\n * This function takes a capability which will be used to determine whether\n * or not a page is included in the menu.\n *\n * The function which is hooked in to handle the output of the page must check\n * that the user has the required capability as well.\n *\n * @since 2.0.0\n * @since 5.3.0 Added the `$position` parameter.\n *\n * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.\n * @param string   $menu_title The text to be used for the menu.\n * @param string   $capability The capability required for this menu to be displayed to the user.\n * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).\n * @param callable $function   The function to be called to output the content for this page.\n * @param int      $position   The position in the menu order this item should appear.\n * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.\n */\nfunction add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {\n\treturn add_submenu_page( 'themes.php', $page_title, $menu_title, $capability, $menu_slug, $function, $position );\n}\n\n/**\n * Add submenu page to the Plugins main menu.\n *\n * This function takes a capability which will be used to determine whether\n * or not a page is included in the menu.\n *\n * The function which is hooked in to handle the output of the page must check\n * that the user has the required capability as well.\n *\n * @since 3.0.0\n * @since 5.3.0 Added the `$position` parameter.\n *\n * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.\n * @param string   $menu_title The text to be used for the menu.\n * @param string   $capability The capability required for this menu to be displayed to the user.\n * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).\n * @param callable $function   The function to be called to output the content for this page.\n * @param int      $position   The position in the menu order this item should appear.\n * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.\n */\nfunction add_plugins_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {\n\treturn add_submenu_page( 'plugins.php', $page_title, $menu_title, $capability, $menu_slug, $function, $position );\n}\n\n/**\n * Add submenu page to the Users/Profile main menu.\n *\n * This function takes a capability which will be used to determine whether\n * or not a page is included in the menu.\n *\n * The function which is hooked in to handle the output of the page must check\n * that the user has the required capability as well.\n *\n * @since 2.1.3\n * @since 5.3.0 Added the `$position` parameter.\n *\n * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.\n * @param string   $menu_title The text to be used for the menu.\n * @param string   $capability The capability required for this menu to be displayed to the user.\n * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).\n * @param callable $function   The function to be called to output the content for this page.\n * @param int      $position   The position in the menu order this item should appear.\n * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.\n */\nfunction add_users_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {\n\tif ( current_user_can( 'edit_users' ) ) {\n\t\t$parent = 'users.php';\n\t} else {\n\t\t$parent = 'profile.php';\n\t}\n\treturn add_submenu_page( $parent, $page_title, $menu_title, $capability, $menu_slug, $function, $position );\n}\n\n/**\n * Add submenu page to the Dashboard main menu.\n *\n * This function takes a capability which will be used to determine whether\n * or not a page is included in the menu.\n *\n * The function which is hooked in to handle the output of the page must check\n * that the user has the required capability as well.\n *\n * @since 2.7.0\n * @since 5.3.0 Added the `$position` parameter.\n *\n * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.\n * @param string   $menu_title The text to be used for the menu.\n * @param string   $capability The capability required for this menu to be displayed to the user.\n * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).\n * @param callable $function   The function to be called to output the content for this page.\n * @param int      $position   The position in the menu order this item should appear.\n * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.\n */\nfunction add_dashboard_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {\n\treturn add_submenu_page( 'index.php', $page_title, $menu_title, $capability, $menu_slug, $function, $position );\n}\n\n/**\n * Add submenu page to the Posts main menu.\n *\n * This function takes a capability which will be used to determine whether\n * or not a page is included in the menu.\n *\n * The function which is hooked in to handle the output of the page must check\n * that the user has the required capability as well.\n *\n * @since 2.7.0\n * @since 5.3.0 Added the `$position` parameter.\n *\n * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.\n * @param string   $menu_title The text to be used for the menu.\n * @param string   $capability The capability required for this menu to be displayed to the user.\n * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).\n * @param callable $function   The function to be called to output the content for this page.\n * @param int      $position   The position in the menu order this item should appear.\n * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.\n */\nfunction add_posts_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {\n\treturn add_submenu_page( 'edit.php', $page_title, $menu_title, $capability, $menu_slug, $function, $position );\n}\n\n/**\n * Add submenu page to the Media main menu.\n *\n * This function takes a capability which will be used to determine whether\n * or not a page is included in the menu.\n *\n * The function which is hooked in to handle the output of the page must check\n * that the user has the required capability as well.\n *\n * @since 2.7.0\n * @since 5.3.0 Added the `$position` parameter.\n *\n * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.\n * @param string   $menu_title The text to be used for the menu.\n * @param string   $capability The capability required for this menu to be displayed to the user.\n * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).\n * @param callable $function   The function to be called to output the content for this page.\n * @param int      $position   The position in the menu order this item should appear.\n * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.\n */\nfunction add_media_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {\n\treturn add_submenu_page( 'upload.php', $page_title, $menu_title, $capability, $menu_slug, $function, $position );\n}\n\n/**\n * Add submenu page to the Links main menu.\n *\n * This function takes a capability which will be used to determine whether\n * or not a page is included in the menu.\n *\n * The function which is hooked in to handle the output of the page must check\n * that the user has the required capability as well.\n *\n * @since 2.7.0\n * @since 5.3.0 Added the `$position` parameter.\n *\n * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.\n * @param string   $menu_title The text to be used for the menu.\n * @param string   $capability The capability required for this menu to be displayed to the user.\n * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).\n * @param callable $function   The function to be called to output the content for this page.\n * @param int      $position   The position in the menu order this item should appear.\n * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.\n */\nfunction add_links_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {\n\treturn add_submenu_page( 'link-manager.php', $page_title, $menu_title, $capability, $menu_slug, $function, $position );\n}\n\n/**\n * Add submenu page to the Pages main menu.\n *\n * This function takes a capability which will be used to determine whether\n * or not a page is included in the menu.\n *\n * The function which is hooked in to handle the output of the page must check\n * that the user has the required capability as well.\n *\n * @since 2.7.0\n * @since 5.3.0 Added the `$position` parameter.\n *\n * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.\n * @param string   $menu_title The text to be used for the menu.\n * @param string   $capability The capability required for this menu to be displayed to the user.\n * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).\n * @param callable $function   The function to be called to output the content for this page.\n * @param int      $position   The position in the menu order this item should appear.\n * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.\n */\nfunction add_pages_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {\n\treturn add_submenu_page( 'edit.php?post_type=page', $page_title, $menu_title, $capability, $menu_slug, $function, $position );\n}\n\n/**\n * Add submenu page to the Comments main menu.\n *\n * This function takes a capability which will be used to determine whether\n * or not a page is included in the menu.\n *\n * The function which is hooked in to handle the output of the page must check\n * that the user has the required capability as well.\n *\n * @since 2.7.0\n * @since 5.3.0 Added the `$position` parameter.\n *\n * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.\n * @param string   $menu_title The text to be used for the menu.\n * @param string   $capability The capability required for this menu to be displayed to the user.\n * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).\n * @param callable $function   The function to be called to output the content for this page.\n * @param int      $position   The position in the menu order this item should appear.\n * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.\n */\nfunction add_comments_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {\n\treturn add_submenu_page( 'edit-comments.php', $page_title, $menu_title, $capability, $menu_slug, $function, $position );\n}\n\n/**\n * Remove a top-level admin menu.\n *\n * @since 3.1.0\n *\n * @global array $menu\n *\n * @param string $menu_slug The slug of the menu.\n * @return array|bool The removed menu on success, false if not found.\n */\nfunction remove_menu_page( $menu_slug ) {\n\tglobal $menu;\n\n\tforeach ( $menu as $i => $item ) {\n\t\tif ( $menu_slug == $item[2] ) {\n\t\t\tunset( $menu[ $i ] );\n\t\t\treturn $item;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Remove an admin submenu.\n *\n * @since 3.1.0\n *\n * @global array $submenu\n *\n * @param string $menu_slug    The slug for the parent menu.\n * @param string $submenu_slug The slug of the submenu.\n * @return array|bool The removed submenu on success, false if not found.\n */\nfunction remove_submenu_page( $menu_slug, $submenu_slug ) {\n\tglobal $submenu;\n\n\tif ( ! isset( $submenu[ $menu_slug ] ) ) {\n\t\treturn false;\n\t}\n\n\tforeach ( $submenu[ $menu_slug ] as $i => $item ) {\n\t\tif ( $submenu_slug == $item[2] ) {\n\t\t\tunset( $submenu[ $menu_slug ][ $i ] );\n\t\t\treturn $item;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Get the URL to access a particular menu page based on the slug it was registered with.\n *\n * If the slug hasn't been registered properly, no URL will be returned.\n *\n * @since 3.0.0\n *\n * @global array $_parent_pages\n *\n * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).\n * @param bool   $echo      Whether or not to echo the URL. Default true.\n * @return string The menu page URL.\n */\nfunction menu_page_url( $menu_slug, $echo = true ) {\n\tglobal $_parent_pages;\n\n\tif ( isset( $_parent_pages[ $menu_slug ] ) ) {\n\t\t$parent_slug = $_parent_pages[ $menu_slug ];\n\t\tif ( $parent_slug && ! isset( $_parent_pages[ $parent_slug ] ) ) {\n\t\t\t$url = admin_url( add_query_arg( 'page', $menu_slug, $parent_slug ) );\n\t\t} else {\n\t\t\t$url = admin_url( 'admin.php?page=' . $menu_slug );\n\t\t}\n\t} else {\n\t\t$url = '';\n\t}\n\n\t$url = esc_url( $url );\n\n\tif ( $echo ) {\n\t\techo $url;\n\t}\n\n\treturn $url;\n}\n\n//\n// Pluggable Menu Support -- Private.\n//\n/**\n * Gets the parent file of the current admin page.\n *\n * @since 1.5.0\n *\n * @global string $parent_file\n * @global array  $menu\n * @global array  $submenu\n * @global string $pagenow\n * @global string $typenow\n * @global string $plugin_page\n * @global array  $_wp_real_parent_file\n * @global array  $_wp_menu_nopriv\n * @global array  $_wp_submenu_nopriv\n *\n * @param string $parent The slug name for the parent menu (or the file name of a standard\n *                       WordPress admin page). Default empty string.\n * @return string The parent file of the current admin page.\n */\nfunction get_admin_page_parent( $parent = '' ) {\n\tglobal $parent_file, $menu, $submenu, $pagenow, $typenow,\n\t\t$plugin_page, $_wp_real_parent_file, $_wp_menu_nopriv, $_wp_submenu_nopriv;\n\n\tif ( ! empty( $parent ) && 'admin.php' !== $parent ) {\n\t\tif ( isset( $_wp_real_parent_file[ $parent ] ) ) {\n\t\t\t$parent = $_wp_real_parent_file[ $parent ];\n\t\t}\n\t\treturn $parent;\n\t}\n\n\tif ( 'admin.php' === $pagenow && isset( $plugin_page ) ) {\n\t\tforeach ( (array) $menu as $parent_menu ) {\n\t\t\tif ( $parent_menu[2] == $plugin_page ) {\n\t\t\t\t$parent_file = $plugin_page;\n\t\t\t\tif ( isset( $_wp_real_parent_file[ $parent_file ] ) ) {\n\t\t\t\t\t$parent_file = $_wp_real_parent_file[ $parent_file ];\n\t\t\t\t}\n\t\t\t\treturn $parent_file;\n\t\t\t}\n\t\t}\n\t\tif ( isset( $_wp_menu_nopriv[ $plugin_page ] ) ) {\n\t\t\t$parent_file = $plugin_page;\n\t\t\tif ( isset( $_wp_real_parent_file[ $parent_file ] ) ) {\n\t\t\t\t\t$parent_file = $_wp_real_parent_file[ $parent_file ];\n\t\t\t}\n\t\t\treturn $parent_file;\n\t\t}\n\t}\n\n\tif ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[ $pagenow ][ $plugin_page ] ) ) {\n\t\t$parent_file = $pagenow;\n\t\tif ( isset( $_wp_real_parent_file[ $parent_file ] ) ) {\n\t\t\t$parent_file = $_wp_real_parent_file[ $parent_file ];\n\t\t}\n\t\treturn $parent_file;\n\t}\n\n\tforeach ( array_keys( (array) $submenu ) as $parent ) {\n\t\tforeach ( $submenu[ $parent ] as $submenu_array ) {\n\t\t\tif ( isset( $_wp_real_parent_file[ $parent ] ) ) {\n\t\t\t\t$parent = $_wp_real_parent_file[ $parent ];\n\t\t\t}\n\t\t\tif ( ! empty( $typenow ) && ( \"$pagenow?post_type=$typenow\" === $submenu_array[2] ) ) {\n\t\t\t\t$parent_file = $parent;\n\t\t\t\treturn $parent;\n\t\t\t} elseif ( $submenu_array[2] == $pagenow && empty( $typenow ) && ( empty( $parent_file ) || false === strpos( $parent_file, '?' ) ) ) {\n\t\t\t\t$parent_file = $parent;\n\t\t\t\treturn $parent;\n\t\t\t} elseif ( isset( $plugin_page ) && ( $plugin_page == $submenu_array[2] ) ) {\n\t\t\t\t$parent_file = $parent;\n\t\t\t\treturn $parent;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( empty( $parent_file ) ) {\n\t\t$parent_file = '';\n\t}\n\treturn '';\n}\n\n/**\n * Gets the title of the current admin page.\n *\n * @since 1.5.0\n *\n * @global string $title\n * @global array $menu\n * @global array $submenu\n * @global string $pagenow\n * @global string $plugin_page\n * @global string $typenow\n *\n * @return string The title of the current admin page.\n */\nfunction get_admin_page_title() {\n\tglobal $title, $menu, $submenu, $pagenow, $plugin_page, $typenow;\n\n\tif ( ! empty( $title ) ) {\n\t\treturn $title;\n\t}\n\n\t$hook = get_plugin_page_hook( $plugin_page, $pagenow );\n\n\t$parent  = get_admin_page_parent();\n\t$parent1 = $parent;\n\n\tif ( empty( $parent ) ) {\n\t\tforeach ( (array) $menu as $menu_array ) {\n\t\t\tif ( isset( $menu_array[3] ) ) {\n\t\t\t\tif ( $menu_array[2] == $pagenow ) {\n\t\t\t\t\t$title = $menu_array[3];\n\t\t\t\t\treturn $menu_array[3];\n\t\t\t\t} elseif ( isset( $plugin_page ) && ( $plugin_page == $menu_array[2] ) && ( $hook == $menu_array[5] ) ) {\n\t\t\t\t\t$title = $menu_array[3];\n\t\t\t\t\treturn $menu_array[3];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$title = $menu_array[0];\n\t\t\t\treturn $title;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tforeach ( array_keys( $submenu ) as $parent ) {\n\t\t\tforeach ( $submenu[ $parent ] as $submenu_array ) {\n\t\t\t\tif ( isset( $plugin_page ) &&\n\t\t\t\t\t( $plugin_page == $submenu_array[2] ) &&\n\t\t\t\t\t(\n\t\t\t\t\t\t( $parent == $pagenow ) ||\n\t\t\t\t\t\t( $parent == $plugin_page ) ||\n\t\t\t\t\t\t( $plugin_page == $hook ) ||\n\t\t\t\t\t\t( 'admin.php' === $pagenow && $parent1 != $submenu_array[2] ) ||\n\t\t\t\t\t\t( ! empty( $typenow ) && $parent == $pagenow . '?post_type=' . $typenow )\n\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\t$title = $submenu_array[3];\n\t\t\t\t\t\treturn $submenu_array[3];\n\t\t\t\t}\n\n\t\t\t\tif ( $submenu_array[2] != $pagenow || isset( $_GET['page'] ) ) { // Not the current page.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( isset( $submenu_array[3] ) ) {\n\t\t\t\t\t$title = $submenu_array[3];\n\t\t\t\t\treturn $submenu_array[3];\n\t\t\t\t} else {\n\t\t\t\t\t$title = $submenu_array[0];\n\t\t\t\t\treturn $title;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ( empty( $title ) ) {\n\t\t\tforeach ( $menu as $menu_array ) {\n\t\t\t\tif ( isset( $plugin_page ) &&\n\t\t\t\t\t( $plugin_page == $menu_array[2] ) &&\n\t\t\t\t\t( 'admin.php' === $pagenow ) &&\n\t\t\t\t\t( $parent1 == $menu_array[2] ) ) {\n\t\t\t\t\t\t$title = $menu_array[3];\n\t\t\t\t\t\treturn $menu_array[3];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $title;\n}\n\n/**\n * Gets the hook attached to the administrative page of a plugin.\n *\n * @since 1.5.0\n *\n * @param string $plugin_page The slug name of the plugin page.\n * @param string $parent_page The slug name for the parent menu (or the file name of a standard\n *                            WordPress admin page).\n * @return string|null Hook attached to the plugin page, null otherwise.\n */\nfunction get_plugin_page_hook( $plugin_page, $parent_page ) {\n\t$hook = get_plugin_page_hookname( $plugin_page, $parent_page );\n\tif ( has_action( $hook ) ) {\n\t\treturn $hook;\n\t} else {\n\t\treturn null;\n\t}\n}\n\n/**\n * Gets the hook name for the administrative page of a plugin.\n *\n * @since 1.5.0\n *\n * @global array $admin_page_hooks\n *\n * @param string $plugin_page The slug name of the plugin page.\n * @param string $parent_page The slug name for the parent menu (or the file name of a standard\n *                            WordPress admin page).\n * @return string Hook name for the plugin page.\n */\nfunction get_plugin_page_hookname( $plugin_page, $parent_page ) {\n\tglobal $admin_page_hooks;\n\n\t$parent = get_admin_page_parent( $parent_page );\n\n\t$page_type = 'admin';\n\tif ( empty( $parent_page ) || 'admin.php' === $parent_page || isset( $admin_page_hooks[ $plugin_page ] ) ) {\n\t\tif ( isset( $admin_page_hooks[ $plugin_page ] ) ) {\n\t\t\t$page_type = 'toplevel';\n\t\t} elseif ( isset( $admin_page_hooks[ $parent ] ) ) {\n\t\t\t$page_type = $admin_page_hooks[ $parent ];\n\t\t}\n\t} elseif ( isset( $admin_page_hooks[ $parent ] ) ) {\n\t\t$page_type = $admin_page_hooks[ $parent ];\n\t}\n\n\t$plugin_name = preg_replace( '!\\.php!', '', $plugin_page );\n\n\treturn $page_type . '_page_' . $plugin_name;\n}\n\n/**\n * Determines whether the current user can access the current admin page.\n *\n * @since 1.5.0\n *\n * @global string $pagenow\n * @global array  $menu\n * @global array  $submenu\n * @global array  $_wp_menu_nopriv\n * @global array  $_wp_submenu_nopriv\n * @global string $plugin_page\n * @global array  $_registered_pages\n *\n * @return bool True if the current user can access the admin page, false otherwise.\n */\nfunction user_can_access_admin_page() {\n\tglobal $pagenow, $menu, $submenu, $_wp_menu_nopriv, $_wp_submenu_nopriv,\n\t\t$plugin_page, $_registered_pages;\n\n\t$parent = get_admin_page_parent();\n\n\tif ( ! isset( $plugin_page ) && isset( $_wp_submenu_nopriv[ $parent ][ $pagenow ] ) ) {\n\t\treturn false;\n\t}\n\n\tif ( isset( $plugin_page ) ) {\n\t\tif ( isset( $_wp_submenu_nopriv[ $parent ][ $plugin_page ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$hookname = get_plugin_page_hookname( $plugin_page, $parent );\n\n\t\tif ( ! isset( $_registered_pages[ $hookname ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif ( empty( $parent ) ) {\n\t\tif ( isset( $_wp_menu_nopriv[ $pagenow ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( isset( $_wp_submenu_nopriv[ $pagenow ][ $pagenow ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[ $pagenow ][ $plugin_page ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( isset( $plugin_page ) && isset( $_wp_menu_nopriv[ $plugin_page ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ( array_keys( $_wp_submenu_nopriv ) as $key ) {\n\t\t\tif ( isset( $_wp_submenu_nopriv[ $key ][ $pagenow ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[ $key ][ $plugin_page ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tif ( isset( $plugin_page ) && ( $plugin_page == $parent ) && isset( $_wp_menu_nopriv[ $plugin_page ] ) ) {\n\t\treturn false;\n\t}\n\n\tif ( isset( $submenu[ $parent ] ) ) {\n\t\tforeach ( $submenu[ $parent ] as $submenu_array ) {\n\t\t\tif ( isset( $plugin_page ) && ( $submenu_array[2] == $plugin_page ) ) {\n\t\t\t\tif ( current_user_can( $submenu_array[1] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} elseif ( $submenu_array[2] == $pagenow ) {\n\t\t\t\tif ( current_user_can( $submenu_array[1] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tforeach ( $menu as $menu_array ) {\n\t\tif ( $menu_array[2] == $parent ) {\n\t\t\tif ( current_user_can( $menu_array[1] ) ) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/* Allowed list functions */\n\n/**\n * Refreshes the value of the allowed options list available via the 'allowed_options' hook.\n *\n * See the {@see 'allowed_options'} filter.\n *\n * @since 2.7.0\n * @since 5.5.0 `$new_whitelist_options` was renamed to `$new_allowed_options`.\n *              Please consider writing more inclusive code.\n *\n * @global array $new_allowed_options\n *\n * @param array $options\n * @return array\n */\nfunction option_update_filter( $options ) {\n\tglobal $new_allowed_options;\n\n\tif ( is_array( $new_allowed_options ) ) {\n\t\t$options = add_allowed_options( $new_allowed_options, $options );\n\t}\n\n\treturn $options;\n}\n\n/**\n * Adds an array of options to the list of allowed options.\n *\n * @since 2.7.0\n *\n * @global array $allowed_options\n *\n * @param array        $new_options\n * @param string|array $options\n * @return array\n */\nfunction add_allowed_options( $new_options, $options = '' ) {\n\tif ( '' === $options ) {\n\t\tglobal $allowed_options;\n\t} else {\n\t\t$allowed_options = $options;\n\t}\n\n\tforeach ( $new_options as $page => $keys ) {\n\t\tforeach ( $keys as $key ) {\n\t\t\tif ( ! isset( $allowed_options[ $page ] ) || ! is_array( $allowed_options[ $page ] ) ) {\n\t\t\t\t$allowed_options[ $page ]   = array();\n\t\t\t\t$allowed_options[ $page ][] = $key;\n\t\t\t} else {\n\t\t\t\t$pos = array_search( $key, $allowed_options[ $page ], true );\n\t\t\t\tif ( false === $pos ) {\n\t\t\t\t\t$allowed_options[ $page ][] = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $allowed_options;\n}\n\n/**\n * Removes a list of options from the allowed options list.\n *\n * @since 5.5.0\n *\n * @global array $allowed_options\n *\n * @param array        $del_options\n * @param string|array $options\n * @return array\n */\nfunction remove_allowed_options( $del_options, $options = '' ) {\n\tif ( '' === $options ) {\n\t\tglobal $allowed_options;\n\t} else {\n\t\t$allowed_options = $options;\n\t}\n\n\tforeach ( $del_options as $page => $keys ) {\n\t\tforeach ( $keys as $key ) {\n\t\t\tif ( isset( $allowed_options[ $page ] ) && is_array( $allowed_options[ $page ] ) ) {\n\t\t\t\t$pos = array_search( $key, $allowed_options[ $page ], true );\n\t\t\t\tif ( false !== $pos ) {\n\t\t\t\t\tunset( $allowed_options[ $page ][ $pos ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $allowed_options;\n}\n\n/**\n * Output nonce, action, and option_page fields for a settings page.\n *\n * @since 2.7.0\n *\n * @param string $option_group A settings group name. This should match the group name\n *                             used in register_setting().\n */\nfunction settings_fields( $option_group ) {\n\techo \"<input type='hidden' name='option_page' value='\" . esc_attr( $option_group ) . \"' />\";\n\techo '<input type=\"hidden\" name=\"action\" value=\"update\" />';\n\twp_nonce_field( \"$option_group-options\" );\n}\n\n/**\n * Clears the plugins cache used by get_plugins() and by default, the plugin updates cache.\n *\n * @since 3.7.0\n *\n * @param bool $clear_update_cache Whether to clear the plugin updates cache. Default true.\n */\nfunction wp_clean_plugins_cache( $clear_update_cache = true ) {\n\tif ( $clear_update_cache ) {\n\t\tdelete_site_transient( 'update_plugins' );\n\t}\n\twp_cache_delete( 'plugins', 'plugins' );\n}\n\n/**\n * Load a given plugin attempt to generate errors.\n *\n * @since 3.0.0\n * @since 4.4.0 Function was moved into the `wp-admin/includes/plugin.php` file.\n *\n * @param string $plugin Path to the plugin file relative to the plugins directory.\n */\nfunction plugin_sandbox_scrape( $plugin ) {\n\tif ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {\n\t\tdefine( 'WP_SANDBOX_SCRAPING', true );\n\t}\n\n\twp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );\n\tinclude WP_PLUGIN_DIR . '/' . $plugin;\n}\n\n/**\n * Helper function for adding content to the Privacy Policy Guide.\n *\n * Plugins and themes should suggest text for inclusion in the site's privacy policy.\n * The suggested text should contain information about any functionality that affects user privacy,\n * and will be shown on the Privacy Policy Guide screen.\n *\n * A plugin or theme can use this function multiple times as long as it will help to better present\n * the suggested policy content. For example modular plugins such as WooCommerse or Jetpack\n * can add or remove suggested content depending on the modules/extensions that are enabled.\n * For more information see the Plugin Handbook:\n * https://developer.wordpress.org/plugins/privacy/suggesting-text-for-the-site-privacy-policy/.\n *\n * The HTML contents of the `$policy_text` supports use of a specialized `.privacy-policy-tutorial`\n * CSS class which can be used to provide supplemental information. Any content contained within\n * HTML elements that have the `.privacy-policy-tutorial` CSS class applied will be omitted\n * from the clipboard when the section content is copied.\n *\n * Intended for use with the `'admin_init'` action.\n *\n * @since 4.9.6\n *\n * @param string $plugin_name The name of the plugin or theme that is suggesting content\n *                            for the site's privacy policy.\n * @param string $policy_text The suggested content for inclusion in the policy.\n */\nfunction wp_add_privacy_policy_content( $plugin_name, $policy_text ) {\n\tif ( ! is_admin() ) {\n\t\t_doing_it_wrong(\n\t\t\t__FUNCTION__,\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: admin_init */\n\t\t\t\t__( 'The suggested privacy policy content should be added only in wp-admin by using the %s (or later) action.' ),\n\t\t\t\t'<code>admin_init</code>'\n\t\t\t),\n\t\t\t'4.9.7'\n\t\t);\n\t\treturn;\n\t} elseif ( ! doing_action( 'admin_init' ) && ! did_action( 'admin_init' ) ) {\n\t\t_doing_it_wrong(\n\t\t\t__FUNCTION__,\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: admin_init */\n\t\t\t\t__( 'The suggested privacy policy content should be added by using the %s (or later) action. Please see the inline documentation.' ),\n\t\t\t\t'<code>admin_init</code>'\n\t\t\t),\n\t\t\t'4.9.7'\n\t\t);\n\t\treturn;\n\t}\n\n\tif ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php';\n\t}\n\n\tWP_Privacy_Policy_Content::add( $plugin_name, $policy_text );\n}\n\n/**\n * Determines whether a plugin is technically active but was paused while\n * loading.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 5.2.0\n *\n * @param string $plugin Path to the plugin file relative to the plugins directory.\n * @return bool True, if in the list of paused plugins. False, if not in the list.\n */\nfunction is_plugin_paused( $plugin ) {\n\tif ( ! isset( $GLOBALS['_paused_plugins'] ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! is_plugin_active( $plugin ) ) {\n\t\treturn false;\n\t}\n\n\tlist( $plugin ) = explode( '/', $plugin );\n\n\treturn array_key_exists( $plugin, $GLOBALS['_paused_plugins'] );\n}\n\n/**\n * Gets the error that was recorded for a paused plugin.\n *\n * @since 5.2.0\n *\n * @param string $plugin Path to the plugin file relative to the plugins directory.\n * @return array|false Array of error information as returned by `error_get_last()`,\n *                     or false if none was recorded.\n */\nfunction wp_get_plugin_error( $plugin ) {\n\tif ( ! isset( $GLOBALS['_paused_plugins'] ) ) {\n\t\treturn false;\n\t}\n\n\tlist( $plugin ) = explode( '/', $plugin );\n\n\tif ( ! array_key_exists( $plugin, $GLOBALS['_paused_plugins'] ) ) {\n\t\treturn false;\n\t}\n\n\treturn $GLOBALS['_paused_plugins'][ $plugin ];\n}\n\n/**\n * Tries to resume a single plugin.\n *\n * If a redirect was provided, we first ensure the plugin does not throw fatal\n * errors anymore.\n *\n * The way it works is by setting the redirection to the error before trying to\n * include the plugin file. If the plugin fails, then the redirection will not\n * be overwritten with the success message and the plugin will not be resumed.\n *\n * @since 5.2.0\n *\n * @param string $plugin   Single plugin to resume.\n * @param string $redirect Optional. URL to redirect to. Default empty string.\n * @return bool|WP_Error True on success, false if `$plugin` was not paused,\n *                       `WP_Error` on failure.\n */\nfunction resume_plugin( $plugin, $redirect = '' ) {\n\t/*\n\t * We'll override this later if the plugin could be resumed without\n\t * creating a fatal error.\n\t */\n\tif ( ! empty( $redirect ) ) {\n\t\twp_redirect(\n\t\t\tadd_query_arg(\n\t\t\t\t'_error_nonce',\n\t\t\t\twp_create_nonce( 'plugin-resume-error_' . $plugin ),\n\t\t\t\t$redirect\n\t\t\t)\n\t\t);\n\n\t\t// Load the plugin to test whether it throws a fatal error.\n\t\tob_start();\n\t\tplugin_sandbox_scrape( $plugin );\n\t\tob_clean();\n\t}\n\n\tlist( $extension ) = explode( '/', $plugin );\n\n\t$result = wp_paused_plugins()->delete( $extension );\n\n\tif ( ! $result ) {\n\t\treturn new WP_Error(\n\t\t\t'could_not_resume_plugin',\n\t\t\t__( 'Could not resume the plugin.' )\n\t\t);\n\t}\n\n\treturn true;\n}\n\n/**\n * Renders an admin notice in case some plugins have been paused due to errors.\n *\n * @since 5.2.0\n */\nfunction paused_plugins_notice() {\n\tif ( 'plugins.php' === $GLOBALS['pagenow'] ) {\n\t\treturn;\n\t}\n\n\tif ( ! current_user_can( 'resume_plugins' ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! isset( $GLOBALS['_paused_plugins'] ) || empty( $GLOBALS['_paused_plugins'] ) ) {\n\t\treturn;\n\t}\n\n\tprintf(\n\t\t'<div class=\"notice notice-error\"><p><strong>%s</strong><br>%s</p><p><a href=\"%s\">%s</a></p></div>',\n\t\t__( 'One or more plugins failed to load properly.' ),\n\t\t__( 'You can find more details and make changes on the Plugins screen.' ),\n\t\tesc_url( admin_url( 'plugins.php?plugin_status=paused' ) ),\n\t\t__( 'Go to the Plugins screen' )\n\t);\n}\n", "num_lines": 2485}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Post Administration API.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Rename $_POST data from form names to DB post columns.\n *\n * Manipulates $_POST directly.\n *\n * @since 2.6.0\n *\n * @param bool  $update    Are we updating a pre-existing post?\n * @param array $post_data Array of post data. Defaults to the contents of $_POST.\n * @return array|WP_Error Array of post data on success, WP_Error on failure.\n */\nfunction _wp_translate_postdata( $update = false, $post_data = null ) {\n\n\tif ( empty( $post_data ) ) {\n\t\t$post_data = &$_POST;\n\t}\n\n\tif ( $update ) {\n\t\t$post_data['ID'] = (int) $post_data['post_ID'];\n\t}\n\n\t$ptype = get_post_type_object( $post_data['post_type'] );\n\n\tif ( $update && ! current_user_can( 'edit_post', $post_data['ID'] ) ) {\n\t\tif ( 'page' === $post_data['post_type'] ) {\n\t\t\treturn new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to edit pages as this user.' ) );\n\t\t} else {\n\t\t\treturn new WP_Error( 'edit_others_posts', __( 'Sorry, you are not allowed to edit posts as this user.' ) );\n\t\t}\n\t} elseif ( ! $update && ! current_user_can( $ptype->cap->create_posts ) ) {\n\t\tif ( 'page' === $post_data['post_type'] ) {\n\t\t\treturn new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to create pages as this user.' ) );\n\t\t} else {\n\t\t\treturn new WP_Error( 'edit_others_posts', __( 'Sorry, you are not allowed to create posts as this user.' ) );\n\t\t}\n\t}\n\n\tif ( isset( $post_data['content'] ) ) {\n\t\t$post_data['post_content'] = $post_data['content'];\n\t}\n\n\tif ( isset( $post_data['excerpt'] ) ) {\n\t\t$post_data['post_excerpt'] = $post_data['excerpt'];\n\t}\n\n\tif ( isset( $post_data['parent_id'] ) ) {\n\t\t$post_data['post_parent'] = (int) $post_data['parent_id'];\n\t}\n\n\tif ( isset( $post_data['trackback_url'] ) ) {\n\t\t$post_data['to_ping'] = $post_data['trackback_url'];\n\t}\n\n\t$post_data['user_ID'] = get_current_user_id();\n\n\tif ( ! empty( $post_data['post_author_override'] ) ) {\n\t\t$post_data['post_author'] = (int) $post_data['post_author_override'];\n\t} else {\n\t\tif ( ! empty( $post_data['post_author'] ) ) {\n\t\t\t$post_data['post_author'] = (int) $post_data['post_author'];\n\t\t} else {\n\t\t\t$post_data['post_author'] = (int) $post_data['user_ID'];\n\t\t}\n\t}\n\n\tif ( isset( $post_data['user_ID'] ) && ( $post_data['post_author'] != $post_data['user_ID'] )\n\t\t&& ! current_user_can( $ptype->cap->edit_others_posts ) ) {\n\n\t\tif ( $update ) {\n\t\t\tif ( 'page' === $post_data['post_type'] ) {\n\t\t\t\treturn new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to edit pages as this user.' ) );\n\t\t\t} else {\n\t\t\t\treturn new WP_Error( 'edit_others_posts', __( 'Sorry, you are not allowed to edit posts as this user.' ) );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( 'page' === $post_data['post_type'] ) {\n\t\t\t\treturn new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to create pages as this user.' ) );\n\t\t\t} else {\n\t\t\t\treturn new WP_Error( 'edit_others_posts', __( 'Sorry, you are not allowed to create posts as this user.' ) );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! empty( $post_data['post_status'] ) ) {\n\t\t$post_data['post_status'] = sanitize_key( $post_data['post_status'] );\n\n\t\t// No longer an auto-draft.\n\t\tif ( 'auto-draft' === $post_data['post_status'] ) {\n\t\t\t$post_data['post_status'] = 'draft';\n\t\t}\n\n\t\tif ( ! get_post_status_object( $post_data['post_status'] ) ) {\n\t\t\tunset( $post_data['post_status'] );\n\t\t}\n\t}\n\n\t// What to do based on which button they pressed.\n\tif ( isset( $post_data['saveasdraft'] ) && '' !== $post_data['saveasdraft'] ) {\n\t\t$post_data['post_status'] = 'draft';\n\t}\n\tif ( isset( $post_data['saveasprivate'] ) && '' !== $post_data['saveasprivate'] ) {\n\t\t$post_data['post_status'] = 'private';\n\t}\n\tif ( isset( $post_data['publish'] ) && ( '' !== $post_data['publish'] )\n\t\t&& ( ! isset( $post_data['post_status'] ) || 'private' !== $post_data['post_status'] )\n\t) {\n\t\t$post_data['post_status'] = 'publish';\n\t}\n\tif ( isset( $post_data['advanced'] ) && '' !== $post_data['advanced'] ) {\n\t\t$post_data['post_status'] = 'draft';\n\t}\n\tif ( isset( $post_data['pending'] ) && '' !== $post_data['pending'] ) {\n\t\t$post_data['post_status'] = 'pending';\n\t}\n\n\tif ( isset( $post_data['ID'] ) ) {\n\t\t$post_id = $post_data['ID'];\n\t} else {\n\t\t$post_id = false;\n\t}\n\t$previous_status = $post_id ? get_post_field( 'post_status', $post_id ) : false;\n\n\tif ( isset( $post_data['post_status'] ) && 'private' === $post_data['post_status'] && ! current_user_can( $ptype->cap->publish_posts ) ) {\n\t\t$post_data['post_status'] = $previous_status ? $previous_status : 'pending';\n\t}\n\n\t$published_statuses = array( 'publish', 'future' );\n\n\t// Posts 'submitted for approval' are submitted to $_POST the same as if they were being published.\n\t// Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts.\n\tif ( isset( $post_data['post_status'] )\n\t\t&& ( in_array( $post_data['post_status'], $published_statuses, true )\n\t\t&& ! current_user_can( $ptype->cap->publish_posts ) )\n\t) {\n\t\tif ( ! in_array( $previous_status, $published_statuses, true ) || ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\t$post_data['post_status'] = 'pending';\n\t\t}\n\t}\n\n\tif ( ! isset( $post_data['post_status'] ) ) {\n\t\t$post_data['post_status'] = 'auto-draft' === $previous_status ? 'draft' : $previous_status;\n\t}\n\n\tif ( isset( $post_data['post_password'] ) && ! current_user_can( $ptype->cap->publish_posts ) ) {\n\t\tunset( $post_data['post_password'] );\n\t}\n\n\tif ( ! isset( $post_data['comment_status'] ) ) {\n\t\t$post_data['comment_status'] = 'closed';\n\t}\n\n\tif ( ! isset( $post_data['ping_status'] ) ) {\n\t\t$post_data['ping_status'] = 'closed';\n\t}\n\n\tforeach ( array( 'aa', 'mm', 'jj', 'hh', 'mn' ) as $timeunit ) {\n\t\tif ( ! empty( $post_data[ 'hidden_' . $timeunit ] ) && $post_data[ 'hidden_' . $timeunit ] != $post_data[ $timeunit ] ) {\n\t\t\t$post_data['edit_date'] = '1';\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ( ! empty( $post_data['edit_date'] ) ) {\n\t\t$aa                     = $post_data['aa'];\n\t\t$mm                     = $post_data['mm'];\n\t\t$jj                     = $post_data['jj'];\n\t\t$hh                     = $post_data['hh'];\n\t\t$mn                     = $post_data['mn'];\n\t\t$ss                     = $post_data['ss'];\n\t\t$aa                     = ( $aa <= 0 ) ? gmdate( 'Y' ) : $aa;\n\t\t$mm                     = ( $mm <= 0 ) ? gmdate( 'n' ) : $mm;\n\t\t$jj                     = ( $jj > 31 ) ? 31 : $jj;\n\t\t$jj                     = ( $jj <= 0 ) ? gmdate( 'j' ) : $jj;\n\t\t$hh                     = ( $hh > 23 ) ? $hh - 24 : $hh;\n\t\t$mn                     = ( $mn > 59 ) ? $mn - 60 : $mn;\n\t\t$ss                     = ( $ss > 59 ) ? $ss - 60 : $ss;\n\t\t$post_data['post_date'] = sprintf( '%04d-%02d-%02d %02d:%02d:%02d', $aa, $mm, $jj, $hh, $mn, $ss );\n\t\t$valid_date             = wp_checkdate( $mm, $jj, $aa, $post_data['post_date'] );\n\t\tif ( ! $valid_date ) {\n\t\t\treturn new WP_Error( 'invalid_date', __( 'Invalid date.' ) );\n\t\t}\n\t\t$post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] );\n\t}\n\n\tif ( isset( $post_data['post_category'] ) ) {\n\t\t$category_object = get_taxonomy( 'category' );\n\t\tif ( ! current_user_can( $category_object->cap->assign_terms ) ) {\n\t\t\tunset( $post_data['post_category'] );\n\t\t}\n\t}\n\n\treturn $post_data;\n}\n\n/**\n * Returns only allowed post data fields\n *\n * @since 5.0.1\n *\n * @param array $post_data Array of post data. Defaults to the contents of $_POST.\n * @return array|WP_Error Array of post data on success, WP_Error on failure.\n */\nfunction _wp_get_allowed_postdata( $post_data = null ) {\n\tif ( empty( $post_data ) ) {\n\t\t$post_data = $_POST;\n\t}\n\n\t// Pass through errors.\n\tif ( is_wp_error( $post_data ) ) {\n\t\treturn $post_data;\n\t}\n\n\treturn array_diff_key( $post_data, array_flip( array( 'meta_input', 'file', 'guid' ) ) );\n}\n\n/**\n * Update an existing post with values provided in $_POST.\n *\n * If post data is passed as an argument, it is treated as an array of data\n * keyed appropriately for turning into a post object.\n *\n * If post data is not passed, the $_POST global variable is used instead.\n *\n * @since 1.5.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param array $post_data Optional. Defaults to the $_POST global.\n * @return int Post ID.\n */\nfunction edit_post( $post_data = null ) {\n\tglobal $wpdb;\n\n\tif ( empty( $post_data ) ) {\n\t\t$post_data = &$_POST;\n\t}\n\n\t// Clear out any data in internal vars.\n\tunset( $post_data['filter'] );\n\n\t$post_ID                     = (int) $post_data['post_ID'];\n\t$post                        = get_post( $post_ID );\n\t$post_data['post_type']      = $post->post_type;\n\t$post_data['post_mime_type'] = $post->post_mime_type;\n\n\tif ( ! empty( $post_data['post_status'] ) ) {\n\t\t$post_data['post_status'] = sanitize_key( $post_data['post_status'] );\n\n\t\tif ( 'inherit' === $post_data['post_status'] ) {\n\t\t\tunset( $post_data['post_status'] );\n\t\t}\n\t}\n\n\t$ptype = get_post_type_object( $post_data['post_type'] );\n\tif ( ! current_user_can( 'edit_post', $post_ID ) ) {\n\t\tif ( 'page' === $post_data['post_type'] ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to edit this page.' ) );\n\t\t} else {\n\t\t\twp_die( __( 'Sorry, you are not allowed to edit this post.' ) );\n\t\t}\n\t}\n\n\tif ( post_type_supports( $ptype->name, 'revisions' ) ) {\n\t\t$revisions = wp_get_post_revisions(\n\t\t\t$post_ID,\n\t\t\tarray(\n\t\t\t\t'order'          => 'ASC',\n\t\t\t\t'posts_per_page' => 1,\n\t\t\t)\n\t\t);\n\t\t$revision  = current( $revisions );\n\n\t\t// Check if the revisions have been upgraded.\n\t\tif ( $revisions && _wp_get_post_revision_version( $revision ) < 1 ) {\n\t\t\t_wp_upgrade_revisions_of_post( $post, wp_get_post_revisions( $post_ID ) );\n\t\t}\n\t}\n\n\tif ( isset( $post_data['visibility'] ) ) {\n\t\tswitch ( $post_data['visibility'] ) {\n\t\t\tcase 'public':\n\t\t\t\t$post_data['post_password'] = '';\n\t\t\t\tbreak;\n\t\t\tcase 'password':\n\t\t\t\tunset( $post_data['sticky'] );\n\t\t\t\tbreak;\n\t\t\tcase 'private':\n\t\t\t\t$post_data['post_status']   = 'private';\n\t\t\t\t$post_data['post_password'] = '';\n\t\t\t\tunset( $post_data['sticky'] );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t$post_data = _wp_translate_postdata( true, $post_data );\n\tif ( is_wp_error( $post_data ) ) {\n\t\twp_die( $post_data->get_error_message() );\n\t}\n\t$translated = _wp_get_allowed_postdata( $post_data );\n\n\t// Post formats.\n\tif ( isset( $post_data['post_format'] ) ) {\n\t\tset_post_format( $post_ID, $post_data['post_format'] );\n\t}\n\n\t$format_meta_urls = array( 'url', 'link_url', 'quote_source_url' );\n\tforeach ( $format_meta_urls as $format_meta_url ) {\n\t\t$keyed = '_format_' . $format_meta_url;\n\t\tif ( isset( $post_data[ $keyed ] ) ) {\n\t\t\tupdate_post_meta( $post_ID, $keyed, wp_slash( esc_url_raw( wp_unslash( $post_data[ $keyed ] ) ) ) );\n\t\t}\n\t}\n\n\t$format_keys = array( 'quote', 'quote_source_name', 'image', 'gallery', 'audio_embed', 'video_embed' );\n\n\tforeach ( $format_keys as $key ) {\n\t\t$keyed = '_format_' . $key;\n\t\tif ( isset( $post_data[ $keyed ] ) ) {\n\t\t\tif ( current_user_can( 'unfiltered_html' ) ) {\n\t\t\t\tupdate_post_meta( $post_ID, $keyed, $post_data[ $keyed ] );\n\t\t\t} else {\n\t\t\t\tupdate_post_meta( $post_ID, $keyed, wp_filter_post_kses( $post_data[ $keyed ] ) );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( 'attachment' === $post_data['post_type'] && preg_match( '#^(audio|video)/#', $post_data['post_mime_type'] ) ) {\n\t\t$id3data = wp_get_attachment_metadata( $post_ID );\n\t\tif ( ! is_array( $id3data ) ) {\n\t\t\t$id3data = array();\n\t\t}\n\n\t\tforeach ( wp_get_attachment_id3_keys( $post, 'edit' ) as $key => $label ) {\n\t\t\tif ( isset( $post_data[ 'id3_' . $key ] ) ) {\n\t\t\t\t$id3data[ $key ] = sanitize_text_field( wp_unslash( $post_data[ 'id3_' . $key ] ) );\n\t\t\t}\n\t\t}\n\t\twp_update_attachment_metadata( $post_ID, $id3data );\n\t}\n\n\t// Meta stuff.\n\tif ( isset( $post_data['meta'] ) && $post_data['meta'] ) {\n\t\tforeach ( $post_data['meta'] as $key => $value ) {\n\t\t\t$meta = get_post_meta_by_id( $key );\n\t\t\tif ( ! $meta ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( $meta->post_id != $post_ID ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( is_protected_meta( $meta->meta_key, 'post' ) || ! current_user_can( 'edit_post_meta', $post_ID, $meta->meta_key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( is_protected_meta( $value['key'], 'post' ) || ! current_user_can( 'edit_post_meta', $post_ID, $value['key'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tupdate_meta( $key, $value['key'], $value['value'] );\n\t\t}\n\t}\n\n\tif ( isset( $post_data['deletemeta'] ) && $post_data['deletemeta'] ) {\n\t\tforeach ( $post_data['deletemeta'] as $key => $value ) {\n\t\t\t$meta = get_post_meta_by_id( $key );\n\t\t\tif ( ! $meta ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( $meta->post_id != $post_ID ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( is_protected_meta( $meta->meta_key, 'post' ) || ! current_user_can( 'delete_post_meta', $post_ID, $meta->meta_key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdelete_meta( $key );\n\t\t}\n\t}\n\n\t// Attachment stuff.\n\tif ( 'attachment' === $post_data['post_type'] ) {\n\t\tif ( isset( $post_data['_wp_attachment_image_alt'] ) ) {\n\t\t\t$image_alt = wp_unslash( $post_data['_wp_attachment_image_alt'] );\n\n\t\t\tif ( get_post_meta( $post_ID, '_wp_attachment_image_alt', true ) !== $image_alt ) {\n\t\t\t\t$image_alt = wp_strip_all_tags( $image_alt, true );\n\n\t\t\t\t// update_post_meta() expects slashed.\n\t\t\t\tupdate_post_meta( $post_ID, '_wp_attachment_image_alt', wp_slash( $image_alt ) );\n\t\t\t}\n\t\t}\n\n\t\t$attachment_data = isset( $post_data['attachments'][ $post_ID ] ) ? $post_data['attachments'][ $post_ID ] : array();\n\n\t\t/** This filter is documented in wp-admin/includes/media.php */\n\t\t$translated = apply_filters( 'attachment_fields_to_save', $translated, $attachment_data );\n\t}\n\n\t// Convert taxonomy input to term IDs, to avoid ambiguity.\n\tif ( isset( $post_data['tax_input'] ) ) {\n\t\tforeach ( (array) $post_data['tax_input'] as $taxonomy => $terms ) {\n\t\t\t$tax_object = get_taxonomy( $taxonomy );\n\n\t\t\tif ( $tax_object && isset( $tax_object->meta_box_sanitize_cb ) ) {\n\t\t\t\t$translated['tax_input'][ $taxonomy ] = call_user_func_array( $tax_object->meta_box_sanitize_cb, array( $taxonomy, $terms ) );\n\t\t\t}\n\t\t}\n\t}\n\n\tadd_meta( $post_ID );\n\n\tupdate_post_meta( $post_ID, '_edit_last', get_current_user_id() );\n\n\t$success = wp_update_post( $translated );\n\n\t// If the save failed, see if we can sanity check the main fields and try again.\n\tif ( ! $success && is_callable( array( $wpdb, 'strip_invalid_text_for_column' ) ) ) {\n\t\t$fields = array( 'post_title', 'post_content', 'post_excerpt' );\n\n\t\tforeach ( $fields as $field ) {\n\t\t\tif ( isset( $translated[ $field ] ) ) {\n\t\t\t\t$translated[ $field ] = $wpdb->strip_invalid_text_for_column( $wpdb->posts, $field, $translated[ $field ] );\n\t\t\t}\n\t\t}\n\n\t\twp_update_post( $translated );\n\t}\n\n\t// Now that we have an ID we can fix any attachment anchor hrefs.\n\t_fix_attachment_links( $post_ID );\n\n\twp_set_post_lock( $post_ID );\n\n\tif ( current_user_can( $ptype->cap->edit_others_posts ) && current_user_can( $ptype->cap->publish_posts ) ) {\n\t\tif ( ! empty( $post_data['sticky'] ) ) {\n\t\t\tstick_post( $post_ID );\n\t\t} else {\n\t\t\tunstick_post( $post_ID );\n\t\t}\n\t}\n\n\treturn $post_ID;\n}\n\n/**\n * Process the post data for the bulk editing of posts.\n *\n * Updates all bulk edited posts/pages, adding (but not removing) tags and\n * categories. Skips pages when they would be their own parent or child.\n *\n * @since 2.7.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param array $post_data Optional, the array of post data to process if not provided will use $_POST superglobal.\n * @return array\n */\nfunction bulk_edit_posts( $post_data = null ) {\n\tglobal $wpdb;\n\n\tif ( empty( $post_data ) ) {\n\t\t$post_data = &$_POST;\n\t}\n\n\tif ( isset( $post_data['post_type'] ) ) {\n\t\t$ptype = get_post_type_object( $post_data['post_type'] );\n\t} else {\n\t\t$ptype = get_post_type_object( 'post' );\n\t}\n\n\tif ( ! current_user_can( $ptype->cap->edit_posts ) ) {\n\t\tif ( 'page' === $ptype->name ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to edit pages.' ) );\n\t\t} else {\n\t\t\twp_die( __( 'Sorry, you are not allowed to edit posts.' ) );\n\t\t}\n\t}\n\n\tif ( -1 == $post_data['_status'] ) {\n\t\t$post_data['post_status'] = null;\n\t\tunset( $post_data['post_status'] );\n\t} else {\n\t\t$post_data['post_status'] = $post_data['_status'];\n\t}\n\tunset( $post_data['_status'] );\n\n\tif ( ! empty( $post_data['post_status'] ) ) {\n\t\t$post_data['post_status'] = sanitize_key( $post_data['post_status'] );\n\n\t\tif ( 'inherit' === $post_data['post_status'] ) {\n\t\t\tunset( $post_data['post_status'] );\n\t\t}\n\t}\n\n\t$post_IDs = array_map( 'intval', (array) $post_data['post'] );\n\n\t$reset = array(\n\t\t'post_author',\n\t\t'post_status',\n\t\t'post_password',\n\t\t'post_parent',\n\t\t'page_template',\n\t\t'comment_status',\n\t\t'ping_status',\n\t\t'keep_private',\n\t\t'tax_input',\n\t\t'post_category',\n\t\t'sticky',\n\t\t'post_format',\n\t);\n\n\tforeach ( $reset as $field ) {\n\t\tif ( isset( $post_data[ $field ] ) && ( '' === $post_data[ $field ] || -1 == $post_data[ $field ] ) ) {\n\t\t\tunset( $post_data[ $field ] );\n\t\t}\n\t}\n\n\tif ( isset( $post_data['post_category'] ) ) {\n\t\tif ( is_array( $post_data['post_category'] ) && ! empty( $post_data['post_category'] ) ) {\n\t\t\t$new_cats = array_map( 'absint', $post_data['post_category'] );\n\t\t} else {\n\t\t\tunset( $post_data['post_category'] );\n\t\t}\n\t}\n\n\t$tax_input = array();\n\tif ( isset( $post_data['tax_input'] ) ) {\n\t\tforeach ( $post_data['tax_input'] as $tax_name => $terms ) {\n\t\t\tif ( empty( $terms ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( is_taxonomy_hierarchical( $tax_name ) ) {\n\t\t\t\t$tax_input[ $tax_name ] = array_map( 'absint', $terms );\n\t\t\t} else {\n\t\t\t\t$comma = _x( ',', 'tag delimiter' );\n\t\t\t\tif ( ',' !== $comma ) {\n\t\t\t\t\t$terms = str_replace( $comma, ',', $terms );\n\t\t\t\t}\n\t\t\t\t$tax_input[ $tax_name ] = explode( ',', trim( $terms, \" \\n\\t\\r\\0\\x0B,\" ) );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( isset( $post_data['post_parent'] ) && (int) $post_data['post_parent'] ) {\n\t\t$parent   = (int) $post_data['post_parent'];\n\t\t$pages    = $wpdb->get_results( \"SELECT ID, post_parent FROM $wpdb->posts WHERE post_type = 'page'\" );\n\t\t$children = array();\n\n\t\tfor ( $i = 0; $i < 50 && $parent > 0; $i++ ) {\n\t\t\t$children[] = $parent;\n\n\t\t\tforeach ( $pages as $page ) {\n\t\t\t\tif ( (int) $page->ID === $parent ) {\n\t\t\t\t\t$parent = (int) $page->post_parent;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t$updated          = array();\n\t$skipped          = array();\n\t$locked           = array();\n\t$shared_post_data = $post_data;\n\n\tforeach ( $post_IDs as $post_ID ) {\n\t\t// Start with fresh post data with each iteration.\n\t\t$post_data = $shared_post_data;\n\n\t\t$post_type_object = get_post_type_object( get_post_type( $post_ID ) );\n\n\t\tif ( ! isset( $post_type_object )\n\t\t\t|| ( isset( $children ) && in_array( $post_ID, $children, true ) )\n\t\t\t|| ! current_user_can( 'edit_post', $post_ID )\n\t\t) {\n\t\t\t$skipped[] = $post_ID;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( wp_check_post_lock( $post_ID ) ) {\n\t\t\t$locked[] = $post_ID;\n\t\t\tcontinue;\n\t\t}\n\n\t\t$post      = get_post( $post_ID );\n\t\t$tax_names = get_object_taxonomies( $post );\n\t\tforeach ( $tax_names as $tax_name ) {\n\t\t\t$taxonomy_obj = get_taxonomy( $tax_name );\n\t\t\tif ( isset( $tax_input[ $tax_name ] ) && current_user_can( $taxonomy_obj->cap->assign_terms ) ) {\n\t\t\t\t$new_terms = $tax_input[ $tax_name ];\n\t\t\t} else {\n\t\t\t\t$new_terms = array();\n\t\t\t}\n\n\t\t\tif ( $taxonomy_obj->hierarchical ) {\n\t\t\t\t$current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array( 'fields' => 'ids' ) );\n\t\t\t} else {\n\t\t\t\t$current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array( 'fields' => 'names' ) );\n\t\t\t}\n\n\t\t\t$post_data['tax_input'][ $tax_name ] = array_merge( $current_terms, $new_terms );\n\t\t}\n\n\t\tif ( isset( $new_cats ) && in_array( 'category', $tax_names, true ) ) {\n\t\t\t$cats                       = (array) wp_get_post_categories( $post_ID );\n\t\t\t$post_data['post_category'] = array_unique( array_merge( $cats, $new_cats ) );\n\t\t\tunset( $post_data['tax_input']['category'] );\n\t\t}\n\n\t\t$post_data['post_ID']        = $post_ID;\n\t\t$post_data['post_type']      = $post->post_type;\n\t\t$post_data['post_mime_type'] = $post->post_mime_type;\n\n\t\tforeach ( array( 'comment_status', 'ping_status', 'post_author' ) as $field ) {\n\t\t\tif ( ! isset( $post_data[ $field ] ) ) {\n\t\t\t\t$post_data[ $field ] = $post->$field;\n\t\t\t}\n\t\t}\n\n\t\t$post_data = _wp_translate_postdata( true, $post_data );\n\t\tif ( is_wp_error( $post_data ) ) {\n\t\t\t$skipped[] = $post_ID;\n\t\t\tcontinue;\n\t\t}\n\t\t$post_data = _wp_get_allowed_postdata( $post_data );\n\n\t\tif ( isset( $shared_post_data['post_format'] ) ) {\n\t\t\tset_post_format( $post_ID, $shared_post_data['post_format'] );\n\t\t}\n\n\t\t// Prevent wp_insert_post() from overwriting post format with the old data.\n\t\tunset( $post_data['tax_input']['post_format'] );\n\n\t\t$updated[] = wp_update_post( $post_data );\n\n\t\tif ( isset( $post_data['sticky'] ) && current_user_can( $ptype->cap->edit_others_posts ) ) {\n\t\t\tif ( 'sticky' === $post_data['sticky'] ) {\n\t\t\t\tstick_post( $post_ID );\n\t\t\t} else {\n\t\t\t\tunstick_post( $post_ID );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn array(\n\t\t'updated' => $updated,\n\t\t'skipped' => $skipped,\n\t\t'locked'  => $locked,\n\t);\n}\n\n/**\n * Default post information to use when populating the \"Write Post\" form.\n *\n * @since 2.0.0\n *\n * @param string $post_type    Optional. A post type string. Default 'post'.\n * @param bool   $create_in_db Optional. Whether to insert the post into database. Default false.\n * @return WP_Post Post object containing all the default post data as attributes\n */\nfunction get_default_post_to_edit( $post_type = 'post', $create_in_db = false ) {\n\t$post_title = '';\n\tif ( ! empty( $_REQUEST['post_title'] ) ) {\n\t\t$post_title = esc_html( wp_unslash( $_REQUEST['post_title'] ) );\n\t}\n\n\t$post_content = '';\n\tif ( ! empty( $_REQUEST['content'] ) ) {\n\t\t$post_content = esc_html( wp_unslash( $_REQUEST['content'] ) );\n\t}\n\n\t$post_excerpt = '';\n\tif ( ! empty( $_REQUEST['excerpt'] ) ) {\n\t\t$post_excerpt = esc_html( wp_unslash( $_REQUEST['excerpt'] ) );\n\t}\n\n\tif ( $create_in_db ) {\n\t\t$post_id = wp_insert_post(\n\t\t\tarray(\n\t\t\t\t'post_title'  => __( 'Auto Draft' ),\n\t\t\t\t'post_type'   => $post_type,\n\t\t\t\t'post_status' => 'auto-draft',\n\t\t\t)\n\t\t);\n\t\t$post    = get_post( $post_id );\n\t\tif ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) && get_option( 'default_post_format' ) ) {\n\t\t\tset_post_format( $post, get_option( 'default_post_format' ) );\n\t\t}\n\n\t\t// Schedule auto-draft cleanup.\n\t\tif ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) ) {\n\t\t\twp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' );\n\t\t}\n\t} else {\n\t\t$post                 = new stdClass;\n\t\t$post->ID             = 0;\n\t\t$post->post_author    = '';\n\t\t$post->post_date      = '';\n\t\t$post->post_date_gmt  = '';\n\t\t$post->post_password  = '';\n\t\t$post->post_name      = '';\n\t\t$post->post_type      = $post_type;\n\t\t$post->post_status    = 'draft';\n\t\t$post->to_ping        = '';\n\t\t$post->pinged         = '';\n\t\t$post->comment_status = get_default_comment_status( $post_type );\n\t\t$post->ping_status    = get_default_comment_status( $post_type, 'pingback' );\n\t\t$post->post_pingback  = get_option( 'default_pingback_flag' );\n\t\t$post->post_category  = get_option( 'default_category' );\n\t\t$post->page_template  = 'default';\n\t\t$post->post_parent    = 0;\n\t\t$post->menu_order     = 0;\n\t\t$post                 = new WP_Post( $post );\n\t}\n\n\t/**\n\t * Filters the default post content initially used in the \"Write Post\" form.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string  $post_content Default post content.\n\t * @param WP_Post $post         Post object.\n\t */\n\t$post->post_content = (string) apply_filters( 'default_content', $post_content, $post );\n\n\t/**\n\t * Filters the default post title initially used in the \"Write Post\" form.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string  $post_title Default post title.\n\t * @param WP_Post $post       Post object.\n\t */\n\t$post->post_title = (string) apply_filters( 'default_title', $post_title, $post );\n\n\t/**\n\t * Filters the default post excerpt initially used in the \"Write Post\" form.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string  $post_excerpt Default post excerpt.\n\t * @param WP_Post $post         Post object.\n\t */\n\t$post->post_excerpt = (string) apply_filters( 'default_excerpt', $post_excerpt, $post );\n\n\treturn $post;\n}\n\n/**\n * Determines if a post exists based on title, content, date and type.\n *\n * @since 2.0.0\n * @since 5.2.0 Added the `$type` parameter.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $title   Post title.\n * @param string $content Optional post content.\n * @param string $date    Optional post date.\n * @param string $type    Optional post type.\n * @return int Post ID if post exists, 0 otherwise.\n */\nfunction post_exists( $title, $content = '', $date = '', $type = '' ) {\n\tglobal $wpdb;\n\n\t$post_title   = wp_unslash( sanitize_post_field( 'post_title', $title, 0, 'db' ) );\n\t$post_content = wp_unslash( sanitize_post_field( 'post_content', $content, 0, 'db' ) );\n\t$post_date    = wp_unslash( sanitize_post_field( 'post_date', $date, 0, 'db' ) );\n\t$post_type    = wp_unslash( sanitize_post_field( 'post_type', $type, 0, 'db' ) );\n\n\t$query = \"SELECT ID FROM $wpdb->posts WHERE 1=1\";\n\t$args  = array();\n\n\tif ( ! empty( $date ) ) {\n\t\t$query .= ' AND post_date = %s';\n\t\t$args[] = $post_date;\n\t}\n\n\tif ( ! empty( $title ) ) {\n\t\t$query .= ' AND post_title = %s';\n\t\t$args[] = $post_title;\n\t}\n\n\tif ( ! empty( $content ) ) {\n\t\t$query .= ' AND post_content = %s';\n\t\t$args[] = $post_content;\n\t}\n\n\tif ( ! empty( $type ) ) {\n\t\t$query .= ' AND post_type = %s';\n\t\t$args[] = $post_type;\n\t}\n\n\tif ( ! empty( $args ) ) {\n\t\treturn (int) $wpdb->get_var( $wpdb->prepare( $query, $args ) );\n\t}\n\n\treturn 0;\n}\n\n/**\n * Creates a new post from the \"Write Post\" form using $_POST information.\n *\n * @since 2.1.0\n *\n * @global WP_User $current_user\n *\n * @return int|WP_Error\n */\nfunction wp_write_post() {\n\tif ( isset( $_POST['post_type'] ) ) {\n\t\t$ptype = get_post_type_object( $_POST['post_type'] );\n\t} else {\n\t\t$ptype = get_post_type_object( 'post' );\n\t}\n\n\tif ( ! current_user_can( $ptype->cap->edit_posts ) ) {\n\t\tif ( 'page' === $ptype->name ) {\n\t\t\treturn new WP_Error( 'edit_pages', __( 'Sorry, you are not allowed to create pages on this site.' ) );\n\t\t} else {\n\t\t\treturn new WP_Error( 'edit_posts', __( 'Sorry, you are not allowed to create posts or drafts on this site.' ) );\n\t\t}\n\t}\n\n\t$_POST['post_mime_type'] = '';\n\n\t// Clear out any data in internal vars.\n\tunset( $_POST['filter'] );\n\n\t// Edit, don't write, if we have a post ID.\n\tif ( isset( $_POST['post_ID'] ) ) {\n\t\treturn edit_post();\n\t}\n\n\tif ( isset( $_POST['visibility'] ) ) {\n\t\tswitch ( $_POST['visibility'] ) {\n\t\t\tcase 'public':\n\t\t\t\t$_POST['post_password'] = '';\n\t\t\t\tbreak;\n\t\t\tcase 'password':\n\t\t\t\tunset( $_POST['sticky'] );\n\t\t\t\tbreak;\n\t\t\tcase 'private':\n\t\t\t\t$_POST['post_status']   = 'private';\n\t\t\t\t$_POST['post_password'] = '';\n\t\t\t\tunset( $_POST['sticky'] );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t$translated = _wp_translate_postdata( false );\n\tif ( is_wp_error( $translated ) ) {\n\t\treturn $translated;\n\t}\n\t$translated = _wp_get_allowed_postdata( $translated );\n\n\t// Create the post.\n\t$post_ID = wp_insert_post( $translated );\n\tif ( is_wp_error( $post_ID ) ) {\n\t\treturn $post_ID;\n\t}\n\n\tif ( empty( $post_ID ) ) {\n\t\treturn 0;\n\t}\n\n\tadd_meta( $post_ID );\n\n\tadd_post_meta( $post_ID, '_edit_last', $GLOBALS['current_user']->ID );\n\n\t// Now that we have an ID we can fix any attachment anchor hrefs.\n\t_fix_attachment_links( $post_ID );\n\n\twp_set_post_lock( $post_ID );\n\n\treturn $post_ID;\n}\n\n/**\n * Calls wp_write_post() and handles the errors.\n *\n * @since 2.0.0\n *\n * @return int|null\n */\nfunction write_post() {\n\t$result = wp_write_post();\n\tif ( is_wp_error( $result ) ) {\n\t\twp_die( $result->get_error_message() );\n\t} else {\n\t\treturn $result;\n\t}\n}\n\n//\n// Post Meta.\n//\n\n/**\n * Add post meta data defined in $_POST superglobal for post with given ID.\n *\n * @since 1.2.0\n *\n * @param int $post_ID\n * @return int|bool\n */\nfunction add_meta( $post_ID ) {\n\t$post_ID = (int) $post_ID;\n\n\t$metakeyselect = isset( $_POST['metakeyselect'] ) ? wp_unslash( trim( $_POST['metakeyselect'] ) ) : '';\n\t$metakeyinput  = isset( $_POST['metakeyinput'] ) ? wp_unslash( trim( $_POST['metakeyinput'] ) ) : '';\n\t$metavalue     = isset( $_POST['metavalue'] ) ? $_POST['metavalue'] : '';\n\tif ( is_string( $metavalue ) ) {\n\t\t$metavalue = trim( $metavalue );\n\t}\n\n\tif ( ( ( '#NONE#' !== $metakeyselect ) && ! empty( $metakeyselect ) ) || ! empty( $metakeyinput ) ) {\n\t\t/*\n\t\t * We have a key/value pair. If both the select and the input\n\t\t * for the key have data, the input takes precedence.\n\t\t */\n\t\tif ( '#NONE#' !== $metakeyselect ) {\n\t\t\t$metakey = $metakeyselect;\n\t\t}\n\n\t\tif ( $metakeyinput ) {\n\t\t\t$metakey = $metakeyinput; // Default.\n\t\t}\n\n\t\tif ( is_protected_meta( $metakey, 'post' ) || ! current_user_can( 'add_post_meta', $post_ID, $metakey ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$metakey = wp_slash( $metakey );\n\n\t\treturn add_post_meta( $post_ID, $metakey, $metavalue );\n\t}\n\n\treturn false;\n}\n\n/**\n * Delete post meta data by meta ID.\n *\n * @since 1.2.0\n *\n * @param int $mid\n * @return bool\n */\nfunction delete_meta( $mid ) {\n\treturn delete_metadata_by_mid( 'post', $mid );\n}\n\n/**\n * Get a list of previously defined keys.\n *\n * @since 1.2.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @return mixed\n */\nfunction get_meta_keys() {\n\tglobal $wpdb;\n\n\t$keys = $wpdb->get_col(\n\t\t\"\n\t\t\tSELECT meta_key\n\t\t\tFROM $wpdb->postmeta\n\t\t\tGROUP BY meta_key\n\t\t\tORDER BY meta_key\"\n\t);\n\n\treturn $keys;\n}\n\n/**\n * Get post meta data by meta ID.\n *\n * @since 2.1.0\n *\n * @param int $mid\n * @return object|bool\n */\nfunction get_post_meta_by_id( $mid ) {\n\treturn get_metadata_by_mid( 'post', $mid );\n}\n\n/**\n * Get meta data for the given post ID.\n *\n * @since 1.2.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int $postid\n * @return mixed\n */\nfunction has_meta( $postid ) {\n\tglobal $wpdb;\n\n\treturn $wpdb->get_results(\n\t\t$wpdb->prepare(\n\t\t\t\"SELECT meta_key, meta_value, meta_id, post_id\n\t\t\tFROM $wpdb->postmeta WHERE post_id = %d\n\t\t\tORDER BY meta_key,meta_id\",\n\t\t\t$postid\n\t\t),\n\t\tARRAY_A\n\t);\n}\n\n/**\n * Update post meta data by meta ID.\n *\n * @since 1.2.0\n *\n * @param int    $meta_id\n * @param string $meta_key Expect Slashed\n * @param string $meta_value Expect Slashed\n * @return bool\n */\nfunction update_meta( $meta_id, $meta_key, $meta_value ) {\n\t$meta_key   = wp_unslash( $meta_key );\n\t$meta_value = wp_unslash( $meta_value );\n\n\treturn update_metadata_by_mid( 'post', $meta_id, $meta_value, $meta_key );\n}\n\n//\n// Private.\n//\n\n/**\n * Replace hrefs of attachment anchors with up-to-date permalinks.\n *\n * @since 2.3.0\n * @access private\n *\n * @param int|object $post Post ID or post object.\n * @return void|int|WP_Error Void if nothing fixed. 0 or WP_Error on update failure. The post ID on update success.\n */\nfunction _fix_attachment_links( $post ) {\n\t$post    = get_post( $post, ARRAY_A );\n\t$content = $post['post_content'];\n\n\t// Don't run if no pretty permalinks or post is not published, scheduled, or privately published.\n\tif ( ! get_option( 'permalink_structure' ) || ! in_array( $post['post_status'], array( 'publish', 'future', 'private' ), true ) ) {\n\t\treturn;\n\t}\n\n\t// Short if there aren't any links or no '?attachment_id=' strings (strpos cannot be zero).\n\tif ( ! strpos( $content, '?attachment_id=' ) || ! preg_match_all( '/<a ([^>]+)>[\\s\\S]+?<\\/a>/', $content, $link_matches ) ) {\n\t\treturn;\n\t}\n\n\t$site_url = get_bloginfo( 'url' );\n\t$site_url = substr( $site_url, (int) strpos( $site_url, '://' ) ); // Remove the http(s).\n\t$replace  = '';\n\n\tforeach ( $link_matches[1] as $key => $value ) {\n\t\tif ( ! strpos( $value, '?attachment_id=' ) || ! strpos( $value, 'wp-att-' )\n\t\t\t|| ! preg_match( '/href=([\"\\'])[^\"\\']*\\?attachment_id=(\\d+)[^\"\\']*\\\\1/', $value, $url_match )\n\t\t\t|| ! preg_match( '/rel=[\"\\'][^\"\\']*wp-att-(\\d+)/', $value, $rel_match ) ) {\n\t\t\t\tcontinue;\n\t\t}\n\n\t\t$quote  = $url_match[1]; // The quote (single or double).\n\t\t$url_id = (int) $url_match[2];\n\t\t$rel_id = (int) $rel_match[1];\n\n\t\tif ( ! $url_id || ! $rel_id || $url_id != $rel_id || strpos( $url_match[0], $site_url ) === false ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$link    = $link_matches[0][ $key ];\n\t\t$replace = str_replace( $url_match[0], 'href=' . $quote . get_attachment_link( $url_id ) . $quote, $link );\n\n\t\t$content = str_replace( $link, $replace, $content );\n\t}\n\n\tif ( $replace ) {\n\t\t$post['post_content'] = $content;\n\t\t// Escape data pulled from DB.\n\t\t$post = add_magic_quotes( $post );\n\n\t\treturn wp_update_post( $post );\n\t}\n}\n\n/**\n * Get all the possible statuses for a post_type\n *\n * @since 2.5.0\n *\n * @param string $type The post_type you want the statuses for. Default 'post'.\n * @return string[] An array of all the statuses for the supplied post type.\n */\nfunction get_available_post_statuses( $type = 'post' ) {\n\t$stati = wp_count_posts( $type );\n\n\treturn array_keys( get_object_vars( $stati ) );\n}\n\n/**\n * Run the wp query to fetch the posts for listing on the edit posts page\n *\n * @since 2.5.0\n *\n * @param array|bool $q Array of query variables to use to build the query or false to use $_GET superglobal.\n * @return array\n */\nfunction wp_edit_posts_query( $q = false ) {\n\tif ( false === $q ) {\n\t\t$q = $_GET;\n\t}\n\t$q['m']     = isset( $q['m'] ) ? (int) $q['m'] : 0;\n\t$q['cat']   = isset( $q['cat'] ) ? (int) $q['cat'] : 0;\n\t$post_stati = get_post_stati();\n\n\tif ( isset( $q['post_type'] ) && in_array( $q['post_type'], get_post_types(), true ) ) {\n\t\t$post_type = $q['post_type'];\n\t} else {\n\t\t$post_type = 'post';\n\t}\n\n\t$avail_post_stati = get_available_post_statuses( $post_type );\n\t$post_status      = '';\n\t$perm             = '';\n\n\tif ( isset( $q['post_status'] ) && in_array( $q['post_status'], $post_stati, true ) ) {\n\t\t$post_status = $q['post_status'];\n\t\t$perm        = 'readable';\n\t}\n\n\t$orderby = '';\n\n\tif ( isset( $q['orderby'] ) ) {\n\t\t$orderby = $q['orderby'];\n\t} elseif ( isset( $q['post_status'] ) && in_array( $q['post_status'], array( 'pending', 'draft' ), true ) ) {\n\t\t$orderby = 'modified';\n\t}\n\n\t$order = '';\n\n\tif ( isset( $q['order'] ) ) {\n\t\t$order = $q['order'];\n\t} elseif ( isset( $q['post_status'] ) && 'pending' === $q['post_status'] ) {\n\t\t$order = 'ASC';\n\t}\n\n\t$per_page       = \"edit_{$post_type}_per_page\";\n\t$posts_per_page = (int) get_user_option( $per_page );\n\tif ( empty( $posts_per_page ) || $posts_per_page < 1 ) {\n\t\t$posts_per_page = 20;\n\t}\n\n\t/**\n\t * Filters the number of items per page to show for a specific 'per_page' type.\n\t *\n\t * The dynamic portion of the hook name, `$post_type`, refers to the post type.\n\t *\n\t * Some examples of filter hooks generated here include: 'edit_attachment_per_page',\n\t * 'edit_post_per_page', 'edit_page_per_page', etc.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param int $posts_per_page Number of posts to display per page for the given post\n\t *                            type. Default 20.\n\t */\n\t$posts_per_page = apply_filters( \"edit_{$post_type}_per_page\", $posts_per_page );\n\n\t/**\n\t * Filters the number of posts displayed per page when specifically listing \"posts\".\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param int    $posts_per_page Number of posts to be displayed. Default 20.\n\t * @param string $post_type      The post type.\n\t */\n\t$posts_per_page = apply_filters( 'edit_posts_per_page', $posts_per_page, $post_type );\n\n\t$query = compact( 'post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page' );\n\n\t// Hierarchical types require special args.\n\tif ( is_post_type_hierarchical( $post_type ) && empty( $orderby ) ) {\n\t\t$query['orderby']                = 'menu_order title';\n\t\t$query['order']                  = 'asc';\n\t\t$query['posts_per_page']         = -1;\n\t\t$query['posts_per_archive_page'] = -1;\n\t\t$query['fields']                 = 'id=>parent';\n\t}\n\n\tif ( ! empty( $q['show_sticky'] ) ) {\n\t\t$query['post__in'] = (array) get_option( 'sticky_posts' );\n\t}\n\n\twp( $query );\n\n\treturn $avail_post_stati;\n}\n\n/**\n * Get the query variables for the current attachments request.\n *\n * @since 4.2.0\n *\n * @param array|false $q Optional. Array of query variables to use to build the query or false\n *                       to use $_GET superglobal. Default false.\n * @return array The parsed query vars.\n */\nfunction wp_edit_attachments_query_vars( $q = false ) {\n\tif ( false === $q ) {\n\t\t$q = $_GET;\n\t}\n\t$q['m']         = isset( $q['m'] ) ? (int) $q['m'] : 0;\n\t$q['cat']       = isset( $q['cat'] ) ? (int) $q['cat'] : 0;\n\t$q['post_type'] = 'attachment';\n\t$post_type      = get_post_type_object( 'attachment' );\n\t$states         = 'inherit';\n\tif ( current_user_can( $post_type->cap->read_private_posts ) ) {\n\t\t$states .= ',private';\n\t}\n\n\t$q['post_status'] = isset( $q['status'] ) && 'trash' === $q['status'] ? 'trash' : $states;\n\t$q['post_status'] = isset( $q['attachment-filter'] ) && 'trash' === $q['attachment-filter'] ? 'trash' : $states;\n\n\t$media_per_page = (int) get_user_option( 'upload_per_page' );\n\tif ( empty( $media_per_page ) || $media_per_page < 1 ) {\n\t\t$media_per_page = 20;\n\t}\n\n\t/**\n\t * Filters the number of items to list per page when listing media items.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param int $media_per_page Number of media to list. Default 20.\n\t */\n\t$q['posts_per_page'] = apply_filters( 'upload_per_page', $media_per_page );\n\n\t$post_mime_types = get_post_mime_types();\n\tif ( isset( $q['post_mime_type'] ) && ! array_intersect( (array) $q['post_mime_type'], array_keys( $post_mime_types ) ) ) {\n\t\tunset( $q['post_mime_type'] );\n\t}\n\n\tforeach ( array_keys( $post_mime_types ) as $type ) {\n\t\tif ( isset( $q['attachment-filter'] ) && \"post_mime_type:$type\" === $q['attachment-filter'] ) {\n\t\t\t$q['post_mime_type'] = $type;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ( isset( $q['detached'] ) || ( isset( $q['attachment-filter'] ) && 'detached' === $q['attachment-filter'] ) ) {\n\t\t$q['post_parent'] = 0;\n\t}\n\n\tif ( isset( $q['mine'] ) || ( isset( $q['attachment-filter'] ) && 'mine' === $q['attachment-filter'] ) ) {\n\t\t$q['author'] = get_current_user_id();\n\t}\n\n\t// Filter query clauses to include filenames.\n\tif ( isset( $q['s'] ) ) {\n\t\tadd_filter( 'posts_clauses', '_filter_query_attachment_filenames' );\n\t}\n\n\treturn $q;\n}\n\n/**\n * Executes a query for attachments. An array of WP_Query arguments\n * can be passed in, which will override the arguments set by this function.\n *\n * @since 2.5.0\n *\n * @param array|false $q Array of query variables to use to build the query or false to use $_GET superglobal.\n * @return array\n */\nfunction wp_edit_attachments_query( $q = false ) {\n\twp( wp_edit_attachments_query_vars( $q ) );\n\n\t$post_mime_types       = get_post_mime_types();\n\t$avail_post_mime_types = get_available_post_mime_types( 'attachment' );\n\n\treturn array( $post_mime_types, $avail_post_mime_types );\n}\n\n/**\n * Returns the list of classes to be used by a meta box.\n *\n * @since 2.5.0\n *\n * @param string $box_id    Meta box ID (used in the 'id' attribute for the meta box).\n * @param string $screen_id The screen on which the meta box is shown.\n * @return string Space-separated string of class names.\n */\nfunction postbox_classes( $box_id, $screen_id ) {\n\tif ( isset( $_GET['edit'] ) && $_GET['edit'] == $box_id ) {\n\t\t$classes = array( '' );\n\t} elseif ( get_user_option( 'closedpostboxes_' . $screen_id ) ) {\n\t\t$closed = get_user_option( 'closedpostboxes_' . $screen_id );\n\t\tif ( ! is_array( $closed ) ) {\n\t\t\t$classes = array( '' );\n\t\t} else {\n\t\t\t$classes = in_array( $box_id, $closed, true ) ? array( 'closed' ) : array( '' );\n\t\t}\n\t} else {\n\t\t$classes = array( '' );\n\t}\n\n\t/**\n\t * Filters the postbox classes for a specific screen and box ID combo.\n\t *\n\t * The dynamic portions of the hook name, `$screen_id` and `$box_id`, refer to\n\t * the screen ID and meta box ID, respectively.\n\t *\n\t * @since 3.2.0\n\t *\n\t * @param string[] $classes An array of postbox classes.\n\t */\n\t$classes = apply_filters( \"postbox_classes_{$screen_id}_{$box_id}\", $classes );\n\treturn implode( ' ', $classes );\n}\n\n/**\n * Get a sample permalink based off of the post name.\n *\n * @since 2.5.0\n *\n * @param int    $id    Post ID or post object.\n * @param string $title Optional. Title to override the post's current title when generating the post name. Default null.\n * @param string $name  Optional. Name to override the post name. Default null.\n * @return array {\n *     Array containing the sample permalink with placeholder for the post name, and the post name.\n *\n *     @type string $0 The permalink with placeholder for the post name.\n *     @type string $1 The post name.\n * }\n */\nfunction get_sample_permalink( $id, $title = null, $name = null ) {\n\t$post = get_post( $id );\n\tif ( ! $post ) {\n\t\treturn array( '', '' );\n\t}\n\n\t$ptype = get_post_type_object( $post->post_type );\n\n\t$original_status = $post->post_status;\n\t$original_date   = $post->post_date;\n\t$original_name   = $post->post_name;\n\n\t// Hack: get_permalink() would return ugly permalink for drafts, so we will fake that our post is published.\n\tif ( in_array( $post->post_status, array( 'draft', 'pending', 'future' ), true ) ) {\n\t\t$post->post_status = 'publish';\n\t\t$post->post_name   = sanitize_title( $post->post_name ? $post->post_name : $post->post_title, $post->ID );\n\t}\n\n\t// If the user wants to set a new name -- override the current one.\n\t// Note: if empty name is supplied -- use the title instead, see #6072.\n\tif ( ! is_null( $name ) ) {\n\t\t$post->post_name = sanitize_title( $name ? $name : $title, $post->ID );\n\t}\n\n\t$post->post_name = wp_unique_post_slug( $post->post_name, $post->ID, $post->post_status, $post->post_type, $post->post_parent );\n\n\t$post->filter = 'sample';\n\n\t$permalink = get_permalink( $post, true );\n\n\t// Replace custom post_type token with generic pagename token for ease of use.\n\t$permalink = str_replace( \"%$post->post_type%\", '%pagename%', $permalink );\n\n\t// Handle page hierarchy.\n\tif ( $ptype->hierarchical ) {\n\t\t$uri = get_page_uri( $post );\n\t\tif ( $uri ) {\n\t\t\t$uri = untrailingslashit( $uri );\n\t\t\t$uri = strrev( stristr( strrev( $uri ), '/' ) );\n\t\t\t$uri = untrailingslashit( $uri );\n\t\t}\n\n\t\t/** This filter is documented in wp-admin/edit-tag-form.php */\n\t\t$uri = apply_filters( 'editable_slug', $uri, $post );\n\t\tif ( ! empty( $uri ) ) {\n\t\t\t$uri .= '/';\n\t\t}\n\t\t$permalink = str_replace( '%pagename%', \"{$uri}%pagename%\", $permalink );\n\t}\n\n\t/** This filter is documented in wp-admin/edit-tag-form.php */\n\t$permalink         = array( $permalink, apply_filters( 'editable_slug', $post->post_name, $post ) );\n\t$post->post_status = $original_status;\n\t$post->post_date   = $original_date;\n\t$post->post_name   = $original_name;\n\tunset( $post->filter );\n\n\t/**\n\t * Filters the sample permalink.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array   $permalink {\n\t *     Array containing the sample permalink with placeholder for the post name, and the post name.\n\t *\n\t *     @type string $0 The permalink with placeholder for the post name.\n\t *     @type string $1 The post name.\n\t * }\n\t * @param int     $post_id   Post ID.\n\t * @param string  $title     Post title.\n\t * @param string  $name      Post name (slug).\n\t * @param WP_Post $post      Post object.\n\t */\n\treturn apply_filters( 'get_sample_permalink', $permalink, $post->ID, $title, $name, $post );\n}\n\n/**\n * Returns the HTML of the sample permalink slug editor.\n *\n * @since 2.5.0\n *\n * @param int    $id        Post ID or post object.\n * @param string $new_title Optional. New title. Default null.\n * @param string $new_slug  Optional. New slug. Default null.\n * @return string The HTML of the sample permalink slug editor.\n */\nfunction get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {\n\t$post = get_post( $id );\n\tif ( ! $post ) {\n\t\treturn '';\n\t}\n\n\tlist($permalink, $post_name) = get_sample_permalink( $post->ID, $new_title, $new_slug );\n\n\t$view_link      = false;\n\t$preview_target = '';\n\n\tif ( current_user_can( 'read_post', $post->ID ) ) {\n\t\tif ( 'draft' === $post->post_status || empty( $post->post_name ) ) {\n\t\t\t$view_link      = get_preview_post_link( $post );\n\t\t\t$preview_target = \" target='wp-preview-{$post->ID}'\";\n\t\t} else {\n\t\t\tif ( 'publish' === $post->post_status || 'attachment' === $post->post_type ) {\n\t\t\t\t$view_link = get_permalink( $post );\n\t\t\t} else {\n\t\t\t\t// Allow non-published (private, future) to be viewed at a pretty permalink, in case $post->post_name is set.\n\t\t\t\t$view_link = str_replace( array( '%pagename%', '%postname%' ), $post->post_name, $permalink );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Permalinks without a post/page name placeholder don't have anything to edit.\n\tif ( false === strpos( $permalink, '%postname%' ) && false === strpos( $permalink, '%pagename%' ) ) {\n\t\t$return = '<strong>' . __( 'Permalink:' ) . \"</strong>\\n\";\n\n\t\tif ( false !== $view_link ) {\n\t\t\t$display_link = urldecode( $view_link );\n\t\t\t$return      .= '<a id=\"sample-permalink\" href=\"' . esc_url( $view_link ) . '\"' . $preview_target . '>' . esc_html( $display_link ) . \"</a>\\n\";\n\t\t} else {\n\t\t\t$return .= '<span id=\"sample-permalink\">' . $permalink . \"</span>\\n\";\n\t\t}\n\n\t\t// Encourage a pretty permalink setting.\n\t\tif ( ! get_option( 'permalink_structure' ) && current_user_can( 'manage_options' )\n\t\t\t&& ! ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $id )\n\t\t) {\n\t\t\t$return .= '<span id=\"change-permalinks\"><a href=\"options-permalink.php\" class=\"button button-small\" target=\"_blank\">' . __( 'Change Permalinks' ) . \"</a></span>\\n\";\n\t\t}\n\t} else {\n\t\tif ( mb_strlen( $post_name ) > 34 ) {\n\t\t\t$post_name_abridged = mb_substr( $post_name, 0, 16 ) . '&hellip;' . mb_substr( $post_name, -16 );\n\t\t} else {\n\t\t\t$post_name_abridged = $post_name;\n\t\t}\n\n\t\t$post_name_html = '<span id=\"editable-post-name\">' . esc_html( $post_name_abridged ) . '</span>';\n\t\t$display_link   = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, esc_html( urldecode( $permalink ) ) );\n\n\t\t$return  = '<strong>' . __( 'Permalink:' ) . \"</strong>\\n\";\n\t\t$return .= '<span id=\"sample-permalink\"><a href=\"' . esc_url( $view_link ) . '\"' . $preview_target . '>' . $display_link . \"</a></span>\\n\";\n\t\t$return .= '&lrm;'; // Fix bi-directional text display defect in RTL languages.\n\t\t$return .= '<span id=\"edit-slug-buttons\"><button type=\"button\" class=\"edit-slug button button-small hide-if-no-js\" aria-label=\"' . __( 'Edit permalink' ) . '\">' . __( 'Edit' ) . \"</button></span>\\n\";\n\t\t$return .= '<span id=\"editable-post-name-full\">' . esc_html( $post_name ) . \"</span>\\n\";\n\t}\n\n\t/**\n\t * Filters the sample permalink HTML markup.\n\t *\n\t * @since 2.9.0\n\t * @since 4.4.0 Added `$post` parameter.\n\t *\n\t * @param string  $return    Sample permalink HTML markup.\n\t * @param int     $post_id   Post ID.\n\t * @param string  $new_title New sample permalink title.\n\t * @param string  $new_slug  New sample permalink slug.\n\t * @param WP_Post $post      Post object.\n\t */\n\t$return = apply_filters( 'get_sample_permalink_html', $return, $post->ID, $new_title, $new_slug, $post );\n\n\treturn $return;\n}\n\n/**\n * Returns HTML for the post thumbnail meta box.\n *\n * @since 2.9.0\n *\n * @param int         $thumbnail_id ID of the attachment used for thumbnail\n * @param int|WP_Post $post         Optional. The post ID or object associated with the thumbnail, defaults to global $post.\n * @return string The post thumbnail HTML.\n */\nfunction _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) {\n\t$_wp_additional_image_sizes = wp_get_additional_image_sizes();\n\n\t$post               = get_post( $post );\n\t$post_type_object   = get_post_type_object( $post->post_type );\n\t$set_thumbnail_link = '<p class=\"hide-if-no-js\"><a href=\"%s\" id=\"set-post-thumbnail\"%s class=\"thickbox\">%s</a></p>';\n\t$upload_iframe_src  = get_upload_iframe_src( 'image', $post->ID );\n\n\t$content = sprintf(\n\t\t$set_thumbnail_link,\n\t\tesc_url( $upload_iframe_src ),\n\t\t'', // Empty when there's no featured image set, `aria-describedby` attribute otherwise.\n\t\tesc_html( $post_type_object->labels->set_featured_image )\n\t);\n\n\tif ( $thumbnail_id && get_post( $thumbnail_id ) ) {\n\t\t$size = isset( $_wp_additional_image_sizes['post-thumbnail'] ) ? 'post-thumbnail' : array( 266, 266 );\n\n\t\t/**\n\t\t * Filters the size used to display the post thumbnail image in the 'Featured image' meta box.\n\t\t *\n\t\t * Note: When a theme adds 'post-thumbnail' support, a special 'post-thumbnail'\n\t\t * image size is registered, which differs from the 'thumbnail' image size\n\t\t * managed via the Settings > Media screen. See the `$size` parameter description\n\t\t * for more information on default values.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string|array $size         Post thumbnail image size to display in the meta box. Accepts any valid\n\t\t *                                   image size, or an array of width and height values in pixels (in that order).\n\t\t *                                   If the 'post-thumbnail' size is set, default is 'post-thumbnail'. Otherwise,\n\t\t *                                   default is an array with 266 as both the height and width values.\n\t\t * @param int          $thumbnail_id Post thumbnail attachment ID.\n\t\t * @param WP_Post      $post         The post object associated with the thumbnail.\n\t\t */\n\t\t$size = apply_filters( 'admin_post_thumbnail_size', $size, $thumbnail_id, $post );\n\n\t\t$thumbnail_html = wp_get_attachment_image( $thumbnail_id, $size );\n\n\t\tif ( ! empty( $thumbnail_html ) ) {\n\t\t\t$content  = sprintf(\n\t\t\t\t$set_thumbnail_link,\n\t\t\t\tesc_url( $upload_iframe_src ),\n\t\t\t\t' aria-describedby=\"set-post-thumbnail-desc\"',\n\t\t\t\t$thumbnail_html\n\t\t\t);\n\t\t\t$content .= '<p class=\"hide-if-no-js howto\" id=\"set-post-thumbnail-desc\">' . __( 'Click the image to edit or update' ) . '</p>';\n\t\t\t$content .= '<p class=\"hide-if-no-js\"><a href=\"#\" id=\"remove-post-thumbnail\">' . esc_html( $post_type_object->labels->remove_featured_image ) . '</a></p>';\n\t\t}\n\t}\n\n\t$content .= '<input type=\"hidden\" id=\"_thumbnail_id\" name=\"_thumbnail_id\" value=\"' . esc_attr( $thumbnail_id ? $thumbnail_id : '-1' ) . '\" />';\n\n\t/**\n\t * Filters the admin post thumbnail HTML markup to return.\n\t *\n\t * @since 2.9.0\n\t * @since 3.5.0 Added the `$post_id` parameter.\n\t * @since 4.6.0 Added the `$thumbnail_id` parameter.\n\t *\n\t * @param string   $content      Admin post thumbnail HTML markup.\n\t * @param int      $post_id      Post ID.\n\t * @param int|null $thumbnail_id Thumbnail attachment ID, or null if there isn't one.\n\t */\n\treturn apply_filters( 'admin_post_thumbnail_html', $content, $post->ID, $thumbnail_id );\n}\n\n/**\n * Check to see if the post is currently being edited by another user.\n *\n * @since 2.5.0\n *\n * @param int $post_id ID of the post to check for editing.\n * @return int|false ID of the user with lock. False if the post does not exist, post is not locked,\n *                   the user with lock does not exist, or the post is locked by current user.\n */\nfunction wp_check_post_lock( $post_id ) {\n\t$post = get_post( $post_id );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$lock = get_post_meta( $post->ID, '_edit_lock', true );\n\tif ( ! $lock ) {\n\t\treturn false;\n\t}\n\n\t$lock = explode( ':', $lock );\n\t$time = $lock[0];\n\t$user = isset( $lock[1] ) ? $lock[1] : get_post_meta( $post->ID, '_edit_last', true );\n\n\tif ( ! get_userdata( $user ) ) {\n\t\treturn false;\n\t}\n\n\t/** This filter is documented in wp-admin/includes/ajax-actions.php */\n\t$time_window = apply_filters( 'wp_check_post_lock_window', 150 );\n\n\tif ( $time && $time > time() - $time_window && get_current_user_id() != $user ) {\n\t\treturn $user;\n\t}\n\n\treturn false;\n}\n\n/**\n * Mark the post as currently being edited by the current user\n *\n * @since 2.5.0\n *\n * @param int $post_id ID of the post being edited.\n * @return array|false Array of the lock time and user ID. False if the post does not exist, or\n *                     there is no current user.\n */\nfunction wp_set_post_lock( $post_id ) {\n\t$post = get_post( $post_id );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$user_id = get_current_user_id();\n\tif ( 0 == $user_id ) {\n\t\treturn false;\n\t}\n\n\t$now  = time();\n\t$lock = \"$now:$user_id\";\n\n\tupdate_post_meta( $post->ID, '_edit_lock', $lock );\n\n\treturn array( $now, $user_id );\n}\n\n/**\n * Outputs the HTML for the notice to say that someone else is editing or has taken over editing of this post.\n *\n * @since 2.8.5\n */\nfunction _admin_notice_post_locked() {\n\t$post = get_post();\n\tif ( ! $post ) {\n\t\treturn;\n\t}\n\n\t$user    = null;\n\t$user_id = wp_check_post_lock( $post->ID );\n\tif ( $user_id ) {\n\t\t$user = get_userdata( $user_id );\n\t}\n\n\tif ( $user ) {\n\t\t/**\n\t\t * Filters whether to show the post locked dialog.\n\t\t *\n\t\t * Returning false from the filter will prevent the dialog from being displayed.\n\t\t *\n\t\t * @since 3.6.0\n\t\t *\n\t\t * @param bool    $display Whether to display the dialog. Default true.\n\t\t * @param WP_Post $post    Post object.\n\t\t * @param WP_User $user    The user with the lock for the post.\n\t\t */\n\t\tif ( ! apply_filters( 'show_post_locked_dialog', true, $post, $user ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$locked = true;\n\t} else {\n\t\t$locked = false;\n\t}\n\n\t$sendback = wp_get_referer();\n\tif ( $locked && $sendback && false === strpos( $sendback, 'post.php' ) && false === strpos( $sendback, 'post-new.php' ) ) {\n\n\t\t$sendback_text = __( 'Go back' );\n\t} else {\n\t\t$sendback = admin_url( 'edit.php' );\n\n\t\tif ( 'post' !== $post->post_type ) {\n\t\t\t$sendback = add_query_arg( 'post_type', $post->post_type, $sendback );\n\t\t}\n\n\t\t$sendback_text = get_post_type_object( $post->post_type )->labels->all_items;\n\t}\n\n\t$hidden = $locked ? '' : ' hidden';\n\n\t?>\n\t<div id=\"post-lock-dialog\" class=\"notification-dialog-wrap<?php echo $hidden; ?>\">\n\t<div class=\"notification-dialog-background\"></div>\n\t<div class=\"notification-dialog\">\n\t<?php\n\n\tif ( $locked ) {\n\t\t$query_args = array();\n\t\tif ( get_post_type_object( $post->post_type )->public ) {\n\t\t\tif ( 'publish' === $post->post_status || $user->ID != $post->post_author ) {\n\t\t\t\t// Latest content is in autosave.\n\t\t\t\t$nonce                       = wp_create_nonce( 'post_preview_' . $post->ID );\n\t\t\t\t$query_args['preview_id']    = $post->ID;\n\t\t\t\t$query_args['preview_nonce'] = $nonce;\n\t\t\t}\n\t\t}\n\n\t\t$preview_link = get_preview_post_link( $post->ID, $query_args );\n\n\t\t/**\n\t\t * Filters whether to allow the post lock to be overridden.\n\t\t *\n\t\t * Returning false from the filter will disable the ability\n\t\t * to override the post lock.\n\t\t *\n\t\t * @since 3.6.0\n\t\t *\n\t\t * @param bool    $override Whether to allow the post lock to be overridden. Default true.\n\t\t * @param WP_Post $post     Post object.\n\t\t * @param WP_User $user     The user with the lock for the post.\n\t\t */\n\t\t$override = apply_filters( 'override_post_lock', true, $post, $user );\n\t\t$tab_last = $override ? '' : ' wp-tab-last';\n\n\t\t?>\n\t\t<div class=\"post-locked-message\">\n\t\t<div class=\"post-locked-avatar\"><?php echo get_avatar( $user->ID, 64 ); ?></div>\n\t\t<p class=\"currently-editing wp-tab-first\" tabindex=\"0\">\n\t\t<?php\n\t\tif ( $override ) {\n\t\t\t/* translators: %s: User's display name. */\n\t\t\tprintf( __( '%s is already editing this post. Do you want to take over?' ), esc_html( $user->display_name ) );\n\t\t} else {\n\t\t\t/* translators: %s: User's display name. */\n\t\t\tprintf( __( '%s is already editing this post.' ), esc_html( $user->display_name ) );\n\t\t}\n\t\t?>\n\t\t</p>\n\t\t<?php\n\t\t/**\n\t\t * Fires inside the post locked dialog before the buttons are displayed.\n\t\t *\n\t\t * @since 3.6.0\n\t\t * @since 5.4.0 The $user parameter was added.\n\t\t *\n\t\t * @param WP_Post $post Post object.\n\t\t * @param WP_User $user The user with the lock for the post.\n\t\t */\n\t\tdo_action( 'post_locked_dialog', $post, $user );\n\t\t?>\n\t\t<p>\n\t\t<a class=\"button\" href=\"<?php echo esc_url( $sendback ); ?>\"><?php echo $sendback_text; ?></a>\n\t\t<?php if ( $preview_link ) { ?>\n\t\t<a class=\"button<?php echo $tab_last; ?>\" href=\"<?php echo esc_url( $preview_link ); ?>\"><?php _e( 'Preview' ); ?></a>\n\t\t\t<?php\n\t\t}\n\n\t\t// Allow plugins to prevent some users overriding the post lock.\n\t\tif ( $override ) {\n\t\t\t?>\n\t<a class=\"button button-primary wp-tab-last\" href=\"<?php echo esc_url( add_query_arg( 'get-post-lock', '1', wp_nonce_url( get_edit_post_link( $post->ID, 'url' ), 'lock-post_' . $post->ID ) ) ); ?>\"><?php _e( 'Take over' ); ?></a>\n\t\t\t<?php\n\t\t}\n\n\t\t?>\n\t\t</p>\n\t\t</div>\n\t\t<?php\n\t} else {\n\t\t?>\n\t\t<div class=\"post-taken-over\">\n\t\t\t<div class=\"post-locked-avatar\"></div>\n\t\t\t<p class=\"wp-tab-first\" tabindex=\"0\">\n\t\t\t<span class=\"currently-editing\"></span><br />\n\t\t\t<span class=\"locked-saving hidden\"><img src=\"<?php echo esc_url( admin_url( 'images/spinner-2x.gif' ) ); ?>\" width=\"16\" height=\"16\" alt=\"\" /> <?php _e( 'Saving revision&hellip;' ); ?></span>\n\t\t\t<span class=\"locked-saved hidden\"><?php _e( 'Your latest changes were saved as a revision.' ); ?></span>\n\t\t\t</p>\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * Fires inside the dialog displayed when a user has lost the post lock.\n\t\t\t *\n\t\t\t * @since 3.6.0\n\t\t\t *\n\t\t\t * @param WP_Post $post Post object.\n\t\t\t */\n\t\t\tdo_action( 'post_lock_lost_dialog', $post );\n\t\t\t?>\n\t\t\t<p><a class=\"button button-primary wp-tab-last\" href=\"<?php echo esc_url( $sendback ); ?>\"><?php echo $sendback_text; ?></a></p>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t?>\n\t</div>\n\t</div>\n\t<?php\n}\n\n/**\n * Creates autosave data for the specified post from $_POST data.\n *\n * @since 2.6.0\n *\n * @param array|int $post_data Associative array containing the post data or int post ID.\n * @return int|WP_Error The autosave revision ID. WP_Error or 0 on error.\n */\nfunction wp_create_post_autosave( $post_data ) {\n\tif ( is_numeric( $post_data ) ) {\n\t\t$post_id   = $post_data;\n\t\t$post_data = $_POST;\n\t} else {\n\t\t$post_id = (int) $post_data['post_ID'];\n\t}\n\n\t$post_data = _wp_translate_postdata( true, $post_data );\n\tif ( is_wp_error( $post_data ) ) {\n\t\treturn $post_data;\n\t}\n\t$post_data = _wp_get_allowed_postdata( $post_data );\n\n\t$post_author = get_current_user_id();\n\n\t// Store one autosave per author. If there is already an autosave, overwrite it.\n\t$old_autosave = wp_get_post_autosave( $post_id, $post_author );\n\tif ( $old_autosave ) {\n\t\t$new_autosave                = _wp_post_revision_data( $post_data, true );\n\t\t$new_autosave['ID']          = $old_autosave->ID;\n\t\t$new_autosave['post_author'] = $post_author;\n\n\t\t$post = get_post( $post_id );\n\n\t\t// If the new autosave has the same content as the post, delete the autosave.\n\t\t$autosave_is_different = false;\n\t\tforeach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields( $post ) ) ) as $field ) {\n\t\t\tif ( normalize_whitespace( $new_autosave[ $field ] ) !== normalize_whitespace( $post->$field ) ) {\n\t\t\t\t$autosave_is_different = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $autosave_is_different ) {\n\t\t\twp_delete_post_revision( $old_autosave->ID );\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * Fires before an autosave is stored.\n\t\t *\n\t\t * @since 4.1.0\n\t\t *\n\t\t * @param array $new_autosave Post array - the autosave that is about to be saved.\n\t\t */\n\t\tdo_action( 'wp_creating_autosave', $new_autosave );\n\n\t\treturn wp_update_post( $new_autosave );\n\t}\n\n\t// _wp_put_post_revision() expects unescaped.\n\t$post_data = wp_unslash( $post_data );\n\n\t// Otherwise create the new autosave as a special post revision.\n\treturn _wp_put_post_revision( $post_data, true );\n}\n\n/**\n * Saves a draft or manually autosaves for the purpose of showing a post preview.\n *\n * @since 2.7.0\n *\n * @return string URL to redirect to show the preview.\n */\nfunction post_preview() {\n\n\t$post_ID     = (int) $_POST['post_ID'];\n\t$_POST['ID'] = $post_ID;\n\n\t$post = get_post( $post_ID );\n\tif ( ! $post ) {\n\t\twp_die( __( 'Sorry, you are not allowed to edit this post.' ) );\n\t}\n\n\tif ( ! current_user_can( 'edit_post', $post->ID ) ) {\n\t\twp_die( __( 'Sorry, you are not allowed to edit this post.' ) );\n\t}\n\n\t$is_autosave = false;\n\n\tif ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() == $post->post_author\n\t\t&& ( 'draft' === $post->post_status || 'auto-draft' === $post->post_status )\n\t) {\n\t\t$saved_post_id = edit_post();\n\t} else {\n\t\t$is_autosave = true;\n\n\t\tif ( isset( $_POST['post_status'] ) && 'auto-draft' === $_POST['post_status'] ) {\n\t\t\t$_POST['post_status'] = 'draft';\n\t\t}\n\n\t\t$saved_post_id = wp_create_post_autosave( $post->ID );\n\t}\n\n\tif ( is_wp_error( $saved_post_id ) ) {\n\t\twp_die( $saved_post_id->get_error_message() );\n\t}\n\n\t$query_args = array();\n\n\tif ( $is_autosave && $saved_post_id ) {\n\t\t$query_args['preview_id']    = $post->ID;\n\t\t$query_args['preview_nonce'] = wp_create_nonce( 'post_preview_' . $post->ID );\n\n\t\tif ( isset( $_POST['post_format'] ) ) {\n\t\t\t$query_args['post_format'] = empty( $_POST['post_format'] ) ? 'standard' : sanitize_key( $_POST['post_format'] );\n\t\t}\n\n\t\tif ( isset( $_POST['_thumbnail_id'] ) ) {\n\t\t\t$query_args['_thumbnail_id'] = ( intval( $_POST['_thumbnail_id'] ) <= 0 ) ? '-1' : intval( $_POST['_thumbnail_id'] );\n\t\t}\n\t}\n\n\treturn get_preview_post_link( $post, $query_args );\n}\n\n/**\n * Save a post submitted with XHR\n *\n * Intended for use with heartbeat and autosave.js\n *\n * @since 3.9.0\n *\n * @param array $post_data Associative array of the submitted post data.\n * @return mixed The value 0 or WP_Error on failure. The saved post ID on success.\n *               The ID can be the draft post_id or the autosave revision post_id.\n */\nfunction wp_autosave( $post_data ) {\n\t// Back-compat.\n\tif ( ! defined( 'DOING_AUTOSAVE' ) ) {\n\t\tdefine( 'DOING_AUTOSAVE', true );\n\t}\n\n\t$post_id              = (int) $post_data['post_id'];\n\t$post_data['ID']      = $post_id;\n\t$post_data['post_ID'] = $post_id;\n\n\tif ( false === wp_verify_nonce( $post_data['_wpnonce'], 'update-post_' . $post_id ) ) {\n\t\treturn new WP_Error( 'invalid_nonce', __( 'Error while saving.' ) );\n\t}\n\n\t$post = get_post( $post_id );\n\n\tif ( ! current_user_can( 'edit_post', $post->ID ) ) {\n\t\treturn new WP_Error( 'edit_posts', __( 'Sorry, you are not allowed to edit this item.' ) );\n\t}\n\n\tif ( 'auto-draft' === $post->post_status ) {\n\t\t$post_data['post_status'] = 'draft';\n\t}\n\n\tif ( 'page' !== $post_data['post_type'] && ! empty( $post_data['catslist'] ) ) {\n\t\t$post_data['post_category'] = explode( ',', $post_data['catslist'] );\n\t}\n\n\tif ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() == $post->post_author\n\t\t&& ( 'auto-draft' === $post->post_status || 'draft' === $post->post_status )\n\t) {\n\t\t// Drafts and auto-drafts are just overwritten by autosave for the same user if the post is not locked.\n\t\treturn edit_post( wp_slash( $post_data ) );\n\t} else {\n\t\t// Non-drafts or other users' drafts are not overwritten.\n\t\t// The autosave is stored in a special post revision for each user.\n\t\treturn wp_create_post_autosave( wp_slash( $post_data ) );\n\t}\n}\n\n/**\n * Redirect to previous page.\n *\n * @since 2.7.0\n *\n * @param int $post_id Optional. Post ID.\n */\nfunction redirect_post( $post_id = '' ) {\n\tif ( isset( $_POST['save'] ) || isset( $_POST['publish'] ) ) {\n\t\t$status = get_post_status( $post_id );\n\n\t\tif ( isset( $_POST['publish'] ) ) {\n\t\t\tswitch ( $status ) {\n\t\t\t\tcase 'pending':\n\t\t\t\t\t$message = 8;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'future':\n\t\t\t\t\t$message = 9;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$message = 6;\n\t\t\t}\n\t\t} else {\n\t\t\t$message = 'draft' === $status ? 10 : 1;\n\t\t}\n\n\t\t$location = add_query_arg( 'message', $message, get_edit_post_link( $post_id, 'url' ) );\n\t} elseif ( isset( $_POST['addmeta'] ) && $_POST['addmeta'] ) {\n\t\t$location = add_query_arg( 'message', 2, wp_get_referer() );\n\t\t$location = explode( '#', $location );\n\t\t$location = $location[0] . '#postcustom';\n\t} elseif ( isset( $_POST['deletemeta'] ) && $_POST['deletemeta'] ) {\n\t\t$location = add_query_arg( 'message', 3, wp_get_referer() );\n\t\t$location = explode( '#', $location );\n\t\t$location = $location[0] . '#postcustom';\n\t} else {\n\t\t$location = add_query_arg( 'message', 4, get_edit_post_link( $post_id, 'url' ) );\n\t}\n\n\t/**\n\t * Filters the post redirect destination URL.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string $location The destination URL.\n\t * @param int    $post_id  The post ID.\n\t */\n\twp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) );\n\texit;\n}\n\n/**\n * Sanitizes POST values from a checkbox taxonomy metabox.\n *\n * @since 5.1.0\n *\n * @param string $taxonomy The taxonomy name.\n * @param array  $terms    Raw term data from the 'tax_input' field.\n * @return int[] Array of sanitized term IDs.\n */\nfunction taxonomy_meta_box_sanitize_cb_checkboxes( $taxonomy, $terms ) {\n\treturn array_map( 'intval', $terms );\n}\n\n/**\n * Sanitizes POST values from an input taxonomy metabox.\n *\n * @since 5.1.0\n *\n * @param string       $taxonomy The taxonomy name.\n * @param array|string $terms    Raw term data from the 'tax_input' field.\n * @return array\n */\nfunction taxonomy_meta_box_sanitize_cb_input( $taxonomy, $terms ) {\n\t/*\n\t * Assume that a 'tax_input' string is a comma-separated list of term names.\n\t * Some languages may use a character other than a comma as a delimiter, so we standardize on\n\t * commas before parsing the list.\n\t */\n\tif ( ! is_array( $terms ) ) {\n\t\t$comma = _x( ',', 'tag delimiter' );\n\t\tif ( ',' !== $comma ) {\n\t\t\t$terms = str_replace( $comma, ',', $terms );\n\t\t}\n\t\t$terms = explode( ',', trim( $terms, \" \\n\\t\\r\\0\\x0B,\" ) );\n\t}\n\n\t$clean_terms = array();\n\tforeach ( $terms as $term ) {\n\t\t// Empty terms are invalid input.\n\t\tif ( empty( $term ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$_term = get_terms(\n\t\t\tarray(\n\t\t\t\t'taxonomy'   => $taxonomy,\n\t\t\t\t'name'       => $term,\n\t\t\t\t'fields'     => 'ids',\n\t\t\t\t'hide_empty' => false,\n\t\t\t)\n\t\t);\n\n\t\tif ( ! empty( $_term ) ) {\n\t\t\t$clean_terms[] = intval( $_term[0] );\n\t\t} else {\n\t\t\t// No existing term was found, so pass the string. A new term will be created.\n\t\t\t$clean_terms[] = $term;\n\t\t}\n\t}\n\n\treturn $clean_terms;\n}\n\n/**\n * Return whether the post can be edited in the block editor.\n *\n * @since 5.0.0\n *\n * @param int|WP_Post $post Post ID or WP_Post object.\n * @return bool Whether the post can be edited in the block editor.\n */\nfunction use_block_editor_for_post( $post ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t// We're in the meta box loader, so don't use the block editor.\n\tif ( isset( $_GET['meta-box-loader'] ) ) {\n\t\tcheck_admin_referer( 'meta-box-loader', 'meta-box-loader-nonce' );\n\t\treturn false;\n\t}\n\n\t// The posts page can't be edited in the block editor.\n\tif ( absint( get_option( 'page_for_posts' ) ) === $post->ID && empty( $post->post_content ) ) {\n\t\treturn false;\n\t}\n\n\t$use_block_editor = use_block_editor_for_post_type( $post->post_type );\n\n\t/**\n\t * Filter whether a post is able to be edited in the block editor.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param bool    $use_block_editor Whether the post can be edited or not.\n\t * @param WP_Post $post             The post being checked.\n\t */\n\treturn apply_filters( 'use_block_editor_for_post', $use_block_editor, $post );\n}\n\n/**\n * Return whether a post type is compatible with the block editor.\n *\n * The block editor depends on the REST API, and if the post type is not shown in the\n * REST API, then it won't work with the block editor.\n *\n * @since 5.0.0\n *\n * @param string $post_type The post type.\n * @return bool Whether the post type can be edited with the block editor.\n */\nfunction use_block_editor_for_post_type( $post_type ) {\n\tif ( ! post_type_exists( $post_type ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! post_type_supports( $post_type, 'editor' ) ) {\n\t\treturn false;\n\t}\n\n\t$post_type_object = get_post_type_object( $post_type );\n\tif ( $post_type_object && ! $post_type_object->show_in_rest ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Filter whether a post is able to be edited in the block editor.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param bool   $use_block_editor  Whether the post type can be edited or not. Default true.\n\t * @param string $post_type         The post type being checked.\n\t */\n\treturn apply_filters( 'use_block_editor_for_post_type', true, $post_type );\n}\n\n/**\n * Returns all the block categories that will be shown in the block editor.\n *\n * @since 5.0.0\n *\n * @param WP_Post $post Post object.\n * @return array[] Array of block categories.\n */\nfunction get_block_categories( $post ) {\n\t$default_categories = array(\n\t\tarray(\n\t\t\t'slug'  => 'text',\n\t\t\t'title' => _x( 'Text', 'block category' ),\n\t\t\t'icon'  => null,\n\t\t),\n\t\tarray(\n\t\t\t'slug'  => 'media',\n\t\t\t'title' => _x( 'Media', 'block category' ),\n\t\t\t'icon'  => null,\n\t\t),\n\t\tarray(\n\t\t\t'slug'  => 'design',\n\t\t\t'title' => _x( 'Design', 'block category' ),\n\t\t\t'icon'  => null,\n\t\t),\n\t\tarray(\n\t\t\t'slug'  => 'widgets',\n\t\t\t'title' => _x( 'Widgets', 'block category' ),\n\t\t\t'icon'  => null,\n\t\t),\n\t\tarray(\n\t\t\t'slug'  => 'embed',\n\t\t\t'title' => _x( 'Embeds', 'block category' ),\n\t\t\t'icon'  => null,\n\t\t),\n\t\tarray(\n\t\t\t'slug'  => 'reusable',\n\t\t\t'title' => _x( 'Reusable Blocks', 'block category' ),\n\t\t\t'icon'  => null,\n\t\t),\n\t);\n\n\t/**\n\t * Filter the default array of block categories.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param array[] $default_categories Array of block categories.\n\t * @param WP_Post $post               Post being loaded.\n\t */\n\treturn apply_filters( 'block_categories', $default_categories, $post );\n}\n\n/**\n * Prepares server-registered blocks for the block editor.\n *\n * Returns an associative array of registered block data keyed by block name. Data includes properties\n * of a block relevant for client registration.\n *\n * @since 5.0.0\n *\n * @return array An associative array of registered block data.\n */\nfunction get_block_editor_server_block_settings() {\n\t$block_registry = WP_Block_Type_Registry::get_instance();\n\t$blocks         = array();\n\t$fields_to_pick = array(\n\t\t'title'            => 'title',\n\t\t'description'      => 'description',\n\t\t'icon'             => 'icon',\n\t\t'category'         => 'category',\n\t\t'keywords'         => 'keywords',\n\t\t'parent'           => 'parent',\n\t\t'supports'         => 'supports',\n\t\t'attributes'       => 'attributes',\n\t\t'provides_context' => 'providesContext',\n\t\t'uses_context'     => 'usesContext',\n\t\t'styles'           => 'styles',\n\t\t'textdomain'       => 'textdomain',\n\t\t'example'          => 'example',\n\t);\n\n\tforeach ( $block_registry->get_all_registered() as $block_name => $block_type ) {\n\t\tforeach ( $fields_to_pick as $field => $key ) {\n\t\t\tif ( ! isset( $block_type->{ $field } ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! isset( $blocks[ $block_name ] ) ) {\n\t\t\t\t$blocks[ $block_name ] = array();\n\t\t\t}\n\n\t\t\t$blocks[ $block_name ][ $key ] = $block_type->{ $field };\n\t\t}\n\t}\n\n\treturn $blocks;\n}\n\n/**\n * Renders the meta boxes forms.\n *\n * @since 5.0.0\n */\nfunction the_block_editor_meta_boxes() {\n\tglobal $post, $current_screen, $wp_meta_boxes;\n\n\t// Handle meta box state.\n\t$_original_meta_boxes = $wp_meta_boxes;\n\n\t/**\n\t * Fires right before the meta boxes are rendered.\n\t *\n\t * This allows for the filtering of meta box data, that should already be\n\t * present by this point. Do not use as a means of adding meta box data.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param array $wp_meta_boxes Global meta box state.\n\t */\n\t$wp_meta_boxes = apply_filters( 'filter_block_editor_meta_boxes', $wp_meta_boxes );\n\t$locations     = array( 'side', 'normal', 'advanced' );\n\t$priorities    = array( 'high', 'sorted', 'core', 'default', 'low' );\n\n\t// Render meta boxes.\n\t?>\n\t<form class=\"metabox-base-form\">\n\t<?php the_block_editor_meta_box_post_form_hidden_fields( $post ); ?>\n\t</form>\n\t<form id=\"toggle-custom-fields-form\" method=\"post\" action=\"<?php echo esc_attr( admin_url( 'post.php' ) ); ?>\">\n\t\t<?php wp_nonce_field( 'toggle-custom-fields' ); ?>\n\t\t<input type=\"hidden\" name=\"action\" value=\"toggle-custom-fields\" />\n\t</form>\n\t<?php foreach ( $locations as $location ) : ?>\n\t\t<form class=\"metabox-location-<?php echo esc_attr( $location ); ?>\" onsubmit=\"return false;\">\n\t\t\t<div id=\"poststuff\" class=\"sidebar-open\">\n\t\t\t\t<div id=\"postbox-container-2\" class=\"postbox-container\">\n\t\t\t\t\t<?php\n\t\t\t\t\tdo_meta_boxes(\n\t\t\t\t\t\t$current_screen,\n\t\t\t\t\t\t$location,\n\t\t\t\t\t\t$post\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</form>\n\t<?php endforeach; ?>\n\t<?php\n\n\t$meta_boxes_per_location = array();\n\tforeach ( $locations as $location ) {\n\t\t$meta_boxes_per_location[ $location ] = array();\n\n\t\tif ( ! isset( $wp_meta_boxes[ $current_screen->id ][ $location ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tforeach ( $priorities as $priority ) {\n\t\t\tif ( ! isset( $wp_meta_boxes[ $current_screen->id ][ $location ][ $priority ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$meta_boxes = (array) $wp_meta_boxes[ $current_screen->id ][ $location ][ $priority ];\n\t\t\tforeach ( $meta_boxes as $meta_box ) {\n\t\t\t\tif ( false == $meta_box || ! $meta_box['title'] ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// If a meta box is just here for back compat, don't show it in the block editor.\n\t\t\t\tif ( isset( $meta_box['args']['__back_compat_meta_box'] ) && $meta_box['args']['__back_compat_meta_box'] ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$meta_boxes_per_location[ $location ][] = array(\n\t\t\t\t\t'id'    => $meta_box['id'],\n\t\t\t\t\t'title' => $meta_box['title'],\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Sadly we probably can not add this data directly into editor settings.\n\t *\n\t * Some meta boxes need admin_head to fire for meta box registry.\n\t * admin_head fires after admin_enqueue_scripts, which is where we create our\n\t * editor instance.\n\t */\n\t$script = 'window._wpLoadBlockEditor.then( function() {\n\t\twp.data.dispatch( \\'core/edit-post\\' ).setAvailableMetaBoxesPerLocation( ' . wp_json_encode( $meta_boxes_per_location ) . ' );\n\t} );';\n\n\twp_add_inline_script( 'wp-edit-post', $script );\n\n\t/**\n\t * When `wp-edit-post` is output in the `<head>`, the inline script needs to be manually printed. Otherwise,\n\t * meta boxes will not display because inline scripts for `wp-edit-post` will not be printed again after this point.\n\t */\n\tif ( wp_script_is( 'wp-edit-post', 'done' ) ) {\n\t\tprintf( \"<script type='text/javascript'>\\n%s\\n</script>\\n\", trim( $script ) );\n\t}\n\n\t/**\n\t * If the 'postcustom' meta box is enabled, then we need to perform some\n\t * extra initialization on it.\n\t */\n\t$enable_custom_fields = (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true );\n\tif ( $enable_custom_fields ) {\n\t\t$script = \"( function( $ ) {\n\t\t\tif ( $('#postcustom').length ) {\n\t\t\t\t$( '#the-list' ).wpList( {\n\t\t\t\t\taddBefore: function( s ) {\n\t\t\t\t\t\ts.data += '&post_id=$post->ID';\n\t\t\t\t\t\treturn s;\n\t\t\t\t\t},\n\t\t\t\t\taddAfter: function() {\n\t\t\t\t\t\t$('table#list-table').show();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} )( jQuery );\";\n\t\twp_enqueue_script( 'wp-lists' );\n\t\twp_add_inline_script( 'wp-lists', $script );\n\t}\n\n\t// Reset meta box data.\n\t$wp_meta_boxes = $_original_meta_boxes;\n}\n\n/**\n * Renders the hidden form required for the meta boxes form.\n *\n * @since 5.0.0\n *\n * @param WP_Post $post Current post object.\n */\nfunction the_block_editor_meta_box_post_form_hidden_fields( $post ) {\n\t$form_extra = '';\n\tif ( 'auto-draft' === $post->post_status ) {\n\t\t$form_extra .= \"<input type='hidden' id='auto_draft' name='auto_draft' value='1' />\";\n\t}\n\t$form_action  = 'editpost';\n\t$nonce_action = 'update-post_' . $post->ID;\n\t$form_extra  .= \"<input type='hidden' id='post_ID' name='post_ID' value='\" . esc_attr( $post->ID ) . \"' />\";\n\t$referer      = wp_get_referer();\n\t$current_user = wp_get_current_user();\n\t$user_id      = $current_user->ID;\n\twp_nonce_field( $nonce_action );\n\n\t/*\n\t * Some meta boxes hook into these actions to add hidden input fields in the classic post form. For backwards\n\t * compatibility, we can capture the output from these actions, and extract the hidden input fields.\n\t */\n\tob_start();\n\t/** This filter is documented in wp-admin/edit-form-advanced.php */\n\tdo_action( 'edit_form_after_title', $post );\n\t/** This filter is documented in wp-admin/edit-form-advanced.php */\n\tdo_action( 'edit_form_advanced', $post );\n\t$classic_output = ob_get_clean();\n\n\t$classic_elements = wp_html_split( $classic_output );\n\t$hidden_inputs    = '';\n\tforeach ( $classic_elements as $element ) {\n\t\tif ( 0 !== strpos( $element, '<input ' ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( preg_match( '/\\stype=[\\'\"]hidden[\\'\"]\\s/', $element ) ) {\n\t\t\techo $element;\n\t\t}\n\t}\n\t?>\n\t<input type=\"hidden\" id=\"user-id\" name=\"user_ID\" value=\"<?php echo (int) $user_id; ?>\" />\n\t<input type=\"hidden\" id=\"hiddenaction\" name=\"action\" value=\"<?php echo esc_attr( $form_action ); ?>\" />\n\t<input type=\"hidden\" id=\"originalaction\" name=\"originalaction\" value=\"<?php echo esc_attr( $form_action ); ?>\" />\n\t<input type=\"hidden\" id=\"post_type\" name=\"post_type\" value=\"<?php echo esc_attr( $post->post_type ); ?>\" />\n\t<input type=\"hidden\" id=\"original_post_status\" name=\"original_post_status\" value=\"<?php echo esc_attr( $post->post_status ); ?>\" />\n\t<input type=\"hidden\" id=\"referredby\" name=\"referredby\" value=\"<?php echo $referer ? esc_url( $referer ) : ''; ?>\" />\n\n\t<?php\n\tif ( 'draft' !== get_post_status( $post ) ) {\n\t\twp_original_referer_field( true, 'previous' );\n\t}\n\techo $form_extra;\n\twp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );\n\twp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );\n\t// Permalink title nonce.\n\twp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );\n\n\t/**\n\t * Add hidden input fields to the meta box save form.\n\t *\n\t * Hook into this action to print `<input type=\"hidden\" ... />` fields, which will be POSTed back to\n\t * the server when meta boxes are saved.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_Post $post The post that is being edited.\n\t */\n\tdo_action( 'block_editor_meta_box_hidden_fields', $post );\n}\n", "num_lines": 2478}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Administration Privacy Tools API.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Resend an existing request and return the result.\n *\n * @since 4.9.6\n * @access private\n *\n * @param int $request_id Request ID.\n * @return bool|WP_Error Returns true/false based on the success of sending the email, or a WP_Error object.\n */\nfunction _wp_privacy_resend_request( $request_id ) {\n\t$request_id = absint( $request_id );\n\t$request    = get_post( $request_id );\n\n\tif ( ! $request || 'user_request' !== $request->post_type ) {\n\t\treturn new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) );\n\t}\n\n\t$result = wp_send_user_request( $request_id );\n\n\tif ( is_wp_error( $result ) ) {\n\t\treturn $result;\n\t} elseif ( ! $result ) {\n\t\treturn new WP_Error( 'privacy_request_error', __( 'Unable to initiate confirmation request.' ) );\n\t}\n\n\treturn true;\n}\n\n/**\n * Marks a request as completed by the admin and logs the current timestamp.\n *\n * @since 4.9.6\n * @access private\n *\n * @param int $request_id Request ID.\n * @return int|WP_Error Request ID on success, or a WP_Error on failure.\n */\nfunction _wp_privacy_completed_request( $request_id ) {\n\t// Get the request.\n\t$request_id = absint( $request_id );\n\t$request    = wp_get_user_request( $request_id );\n\n\tif ( ! $request ) {\n\t\treturn new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) );\n\t}\n\n\tupdate_post_meta( $request_id, '_wp_user_request_completed_timestamp', time() );\n\n\t$result = wp_update_post(\n\t\tarray(\n\t\t\t'ID'          => $request_id,\n\t\t\t'post_status' => 'request-completed',\n\t\t)\n\t);\n\n\treturn $result;\n}\n\n/**\n * Handle list table actions.\n *\n * @since 4.9.6\n * @access private\n */\nfunction _wp_personal_data_handle_actions() {\n\tif ( isset( $_POST['privacy_action_email_retry'] ) ) {\n\t\tcheck_admin_referer( 'bulk-privacy_requests' );\n\n\t\t$request_id = absint( current( array_keys( (array) wp_unslash( $_POST['privacy_action_email_retry'] ) ) ) );\n\t\t$result     = _wp_privacy_resend_request( $request_id );\n\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\tadd_settings_error(\n\t\t\t\t'privacy_action_email_retry',\n\t\t\t\t'privacy_action_email_retry',\n\t\t\t\t$result->get_error_message(),\n\t\t\t\t'error'\n\t\t\t);\n\t\t} else {\n\t\t\tadd_settings_error(\n\t\t\t\t'privacy_action_email_retry',\n\t\t\t\t'privacy_action_email_retry',\n\t\t\t\t__( 'Confirmation request sent again successfully.' ),\n\t\t\t\t'success'\n\t\t\t);\n\t\t}\n\t} elseif ( isset( $_POST['action'] ) ) {\n\t\t$action = ! empty( $_POST['action'] ) ? sanitize_key( wp_unslash( $_POST['action'] ) ) : '';\n\n\t\tswitch ( $action ) {\n\t\t\tcase 'add_export_personal_data_request':\n\t\t\tcase 'add_remove_personal_data_request':\n\t\t\t\tcheck_admin_referer( 'personal-data-request' );\n\n\t\t\t\tif ( ! isset( $_POST['type_of_action'], $_POST['username_or_email_for_privacy_request'] ) ) {\n\t\t\t\t\tadd_settings_error(\n\t\t\t\t\t\t'action_type',\n\t\t\t\t\t\t'action_type',\n\t\t\t\t\t\t__( 'Invalid action.' ),\n\t\t\t\t\t\t'error'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t$action_type               = sanitize_text_field( wp_unslash( $_POST['type_of_action'] ) );\n\t\t\t\t$username_or_email_address = sanitize_text_field( wp_unslash( $_POST['username_or_email_for_privacy_request'] ) );\n\t\t\t\t$email_address             = '';\n\n\t\t\t\tif ( ! in_array( $action_type, _wp_privacy_action_request_types(), true ) ) {\n\t\t\t\t\tadd_settings_error(\n\t\t\t\t\t\t'action_type',\n\t\t\t\t\t\t'action_type',\n\t\t\t\t\t\t__( 'Invalid action.' ),\n\t\t\t\t\t\t'error'\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( ! is_email( $username_or_email_address ) ) {\n\t\t\t\t\t$user = get_user_by( 'login', $username_or_email_address );\n\t\t\t\t\tif ( ! $user instanceof WP_User ) {\n\t\t\t\t\t\tadd_settings_error(\n\t\t\t\t\t\t\t'username_or_email_for_privacy_request',\n\t\t\t\t\t\t\t'username_or_email_for_privacy_request',\n\t\t\t\t\t\t\t__( 'Unable to add this request. A valid email address or username must be supplied.' ),\n\t\t\t\t\t\t\t'error'\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$email_address = $user->user_email;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$email_address = $username_or_email_address;\n\t\t\t\t}\n\n\t\t\t\tif ( empty( $email_address ) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$request_id = wp_create_user_request( $email_address, $action_type );\n\n\t\t\t\tif ( is_wp_error( $request_id ) ) {\n\t\t\t\t\tadd_settings_error(\n\t\t\t\t\t\t'username_or_email_for_privacy_request',\n\t\t\t\t\t\t'username_or_email_for_privacy_request',\n\t\t\t\t\t\t$request_id->get_error_message(),\n\t\t\t\t\t\t'error'\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t} elseif ( ! $request_id ) {\n\t\t\t\t\tadd_settings_error(\n\t\t\t\t\t\t'username_or_email_for_privacy_request',\n\t\t\t\t\t\t'username_or_email_for_privacy_request',\n\t\t\t\t\t\t__( 'Unable to initiate confirmation request.' ),\n\t\t\t\t\t\t'error'\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\twp_send_user_request( $request_id );\n\n\t\t\t\tadd_settings_error(\n\t\t\t\t\t'username_or_email_for_privacy_request',\n\t\t\t\t\t'username_or_email_for_privacy_request',\n\t\t\t\t\t__( 'Confirmation request initiated successfully.' ),\n\t\t\t\t\t'success'\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n\n/**\n * Cleans up failed and expired requests before displaying the list table.\n *\n * @since 4.9.6\n * @access private\n */\nfunction _wp_personal_data_cleanup_requests() {\n\t/** This filter is documented in wp-includes/user.php */\n\t$expires = (int) apply_filters( 'user_request_key_expiration', DAY_IN_SECONDS );\n\n\t$requests_query = new WP_Query(\n\t\tarray(\n\t\t\t'post_type'      => 'user_request',\n\t\t\t'posts_per_page' => -1,\n\t\t\t'post_status'    => 'request-pending',\n\t\t\t'fields'         => 'ids',\n\t\t\t'date_query'     => array(\n\t\t\t\tarray(\n\t\t\t\t\t'column' => 'post_modified_gmt',\n\t\t\t\t\t'before' => $expires . ' seconds ago',\n\t\t\t\t),\n\t\t\t),\n\t\t)\n\t);\n\n\t$request_ids = $requests_query->posts;\n\n\tforeach ( $request_ids as $request_id ) {\n\t\twp_update_post(\n\t\t\tarray(\n\t\t\t\t'ID'            => $request_id,\n\t\t\t\t'post_status'   => 'request-failed',\n\t\t\t\t'post_password' => '',\n\t\t\t)\n\t\t);\n\t}\n}\n\n/**\n * Generate a single group for the personal data export report.\n *\n * @since 4.9.6\n * @since 5.4.0 Added the `$group_id` and `$groups_count` parameters.\n *\n * @param array  $group_data {\n *     The group data to render.\n *\n *     @type string $group_label  The user-facing heading for the group, e.g. 'Comments'.\n *     @type array  $items        {\n *         An array of group items.\n *\n *         @type array  $group_item_data  {\n *             An array of name-value pairs for the item.\n *\n *             @type string $name   The user-facing name of an item name-value pair, e.g. 'IP Address'.\n *             @type string $value  The user-facing value of an item data pair, e.g. '50.60.70.0'.\n *         }\n *     }\n * }\n * @param string $group_id     The group identifier.\n * @param int    $groups_count The number of all groups\n * @return string The HTML for this group and its items.\n */\nfunction wp_privacy_generate_personal_data_export_group_html( $group_data, $group_id = '', $groups_count = 1 ) {\n\t$group_id_attr = sanitize_title_with_dashes( $group_data['group_label'] . '-' . $group_id );\n\n\t$group_html  = '<h2 id=\"' . esc_attr( $group_id_attr ) . '\">';\n\t$group_html .= esc_html( $group_data['group_label'] );\n\n\t$items_count = count( (array) $group_data['items'] );\n\tif ( $items_count > 1 ) {\n\t\t$group_html .= sprintf( ' <span class=\"count\">(%d)</span>', $items_count );\n\t}\n\n\t$group_html .= '</h2>';\n\n\tif ( ! empty( $group_data['group_description'] ) ) {\n\t\t$group_html .= '<p>' . esc_html( $group_data['group_description'] ) . '</p>';\n\t}\n\n\t$group_html .= '<div>';\n\n\tforeach ( (array) $group_data['items'] as $group_item_id => $group_item_data ) {\n\t\t$group_html .= '<table>';\n\t\t$group_html .= '<tbody>';\n\n\t\tforeach ( (array) $group_item_data as $group_item_datum ) {\n\t\t\t$value = $group_item_datum['value'];\n\t\t\t// If it looks like a link, make it a link.\n\t\t\tif ( false === strpos( $value, ' ' ) && ( 0 === strpos( $value, 'http://' ) || 0 === strpos( $value, 'https://' ) ) ) {\n\t\t\t\t$value = '<a href=\"' . esc_url( $value ) . '\">' . esc_html( $value ) . '</a>';\n\t\t\t}\n\n\t\t\t$group_html .= '<tr>';\n\t\t\t$group_html .= '<th>' . esc_html( $group_item_datum['name'] ) . '</th>';\n\t\t\t$group_html .= '<td>' . wp_kses( $value, 'personal_data_export' ) . '</td>';\n\t\t\t$group_html .= '</tr>';\n\t\t}\n\n\t\t$group_html .= '</tbody>';\n\t\t$group_html .= '</table>';\n\t}\n\n\tif ( $groups_count > 1 ) {\n\t\t$group_html .= '<div class=\"return-to-top\">';\n\t\t$group_html .= '<a href=\"#top\"><span aria-hidden=\"true\">&uarr; </span> ' . esc_html__( 'Return to top' ) . '</a>';\n\t\t$group_html .= '</div>';\n\t}\n\n\t$group_html .= '</div>';\n\n\treturn $group_html;\n}\n\n/**\n * Generate the personal data export file.\n *\n * @since 4.9.6\n *\n * @param int $request_id The export request ID.\n */\nfunction wp_privacy_generate_personal_data_export_file( $request_id ) {\n\tif ( ! class_exists( 'ZipArchive' ) ) {\n\t\twp_send_json_error( __( 'Unable to generate export file. ZipArchive not available.' ) );\n\t}\n\n\t// Get the request.\n\t$request = wp_get_user_request( $request_id );\n\n\tif ( ! $request || 'export_personal_data' !== $request->action_name ) {\n\t\twp_send_json_error( __( 'Invalid request ID when generating export file.' ) );\n\t}\n\n\t$email_address = $request->email;\n\n\tif ( ! is_email( $email_address ) ) {\n\t\twp_send_json_error( __( 'Invalid email address when generating export file.' ) );\n\t}\n\n\t// Create the exports folder if needed.\n\t$exports_dir = wp_privacy_exports_dir();\n\t$exports_url = wp_privacy_exports_url();\n\n\tif ( ! wp_mkdir_p( $exports_dir ) ) {\n\t\twp_send_json_error( __( 'Unable to create export folder.' ) );\n\t}\n\n\t// Protect export folder from browsing.\n\t$index_pathname = $exports_dir . 'index.html';\n\tif ( ! file_exists( $index_pathname ) ) {\n\t\t$file = fopen( $index_pathname, 'w' );\n\t\tif ( false === $file ) {\n\t\t\twp_send_json_error( __( 'Unable to protect export folder from browsing.' ) );\n\t\t}\n\t\tfwrite( $file, '<!-- Silence is golden. -->' );\n\t\tfclose( $file );\n\t}\n\n\t$obscura              = wp_generate_password( 32, false, false );\n\t$file_basename        = 'wp-personal-data-file-' . $obscura;\n\t$html_report_filename = wp_unique_filename( $exports_dir, $file_basename . '.html' );\n\t$html_report_pathname = wp_normalize_path( $exports_dir . $html_report_filename );\n\t$json_report_filename = $file_basename . '.json';\n\t$json_report_pathname = wp_normalize_path( $exports_dir . $json_report_filename );\n\n\t/*\n\t * Gather general data needed.\n\t */\n\n\t// Title.\n\t$title = sprintf(\n\t\t/* translators: %s: User's email address. */\n\t\t__( 'Personal Data Export for %s' ),\n\t\t$email_address\n\t);\n\n\t// And now, all the Groups.\n\t$groups = get_post_meta( $request_id, '_export_data_grouped', true );\n\n\t// First, build an \"About\" group on the fly for this report.\n\t$about_group = array(\n\t\t/* translators: Header for the About section in a personal data export. */\n\t\t'group_label'       => _x( 'About', 'personal data group label' ),\n\t\t/* translators: Description for the About section in a personal data export. */\n\t\t'group_description' => _x( 'Overview of export report.', 'personal data group description' ),\n\t\t'items'             => array(\n\t\t\t'about-1' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'name'  => _x( 'Report generated for', 'email address' ),\n\t\t\t\t\t'value' => $email_address,\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name'  => _x( 'For site', 'website name' ),\n\t\t\t\t\t'value' => get_bloginfo( 'name' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name'  => _x( 'At URL', 'website URL' ),\n\t\t\t\t\t'value' => get_bloginfo( 'url' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name'  => _x( 'On', 'date/time' ),\n\t\t\t\t\t'value' => current_time( 'mysql' ),\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t);\n\n\t// Merge in the special about group.\n\t$groups = array_merge( array( 'about' => $about_group ), $groups );\n\n\t$groups_count = count( $groups );\n\n\t// Convert the groups to JSON format.\n\t$groups_json = wp_json_encode( $groups );\n\n\t/*\n\t * Handle the JSON export.\n\t */\n\t$file = fopen( $json_report_pathname, 'w' );\n\n\tif ( false === $file ) {\n\t\twp_send_json_error( __( 'Unable to open export file (JSON report) for writing.' ) );\n\t}\n\n\tfwrite( $file, '{' );\n\tfwrite( $file, '\"' . $title . '\":' );\n\tfwrite( $file, $groups_json );\n\tfwrite( $file, '}' );\n\tfclose( $file );\n\n\t/*\n\t * Handle the HTML export.\n\t */\n\t$file = fopen( $html_report_pathname, 'w' );\n\n\tif ( false === $file ) {\n\t\twp_send_json_error( __( 'Unable to open export file (HTML report) for writing.' ) );\n\t}\n\n\tfwrite( $file, \"<!DOCTYPE html>\\n\" );\n\tfwrite( $file, \"<html>\\n\" );\n\tfwrite( $file, \"<head>\\n\" );\n\tfwrite( $file, \"<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />\\n\" );\n\tfwrite( $file, \"<style type='text/css'>\" );\n\tfwrite( $file, 'body { color: black; font-family: Arial, sans-serif; font-size: 11pt; margin: 15px auto; width: 860px; }' );\n\tfwrite( $file, 'table { background: #f0f0f0; border: 1px solid #ddd; margin-bottom: 20px; width: 100%; }' );\n\tfwrite( $file, 'th { padding: 5px; text-align: left; width: 20%; }' );\n\tfwrite( $file, 'td { padding: 5px; }' );\n\tfwrite( $file, 'tr:nth-child(odd) { background-color: #fafafa; }' );\n\tfwrite( $file, '.return-to-top { text-align: right; }' );\n\tfwrite( $file, '</style>' );\n\tfwrite( $file, '<title>' );\n\tfwrite( $file, esc_html( $title ) );\n\tfwrite( $file, '</title>' );\n\tfwrite( $file, \"</head>\\n\" );\n\tfwrite( $file, \"<body>\\n\" );\n\tfwrite( $file, '<h1 id=\"top\">' . esc_html__( 'Personal Data Export' ) . '</h1>' );\n\n\t// Create TOC.\n\tif ( $groups_count > 1 ) {\n\t\tfwrite( $file, '<div id=\"table_of_contents\">' );\n\t\tfwrite( $file, '<h2>' . esc_html__( 'Table of Contents' ) . '</h2>' );\n\t\tfwrite( $file, '<ul>' );\n\t\tforeach ( (array) $groups as $group_id => $group_data ) {\n\t\t\t$group_label       = esc_html( $group_data['group_label'] );\n\t\t\t$group_id_attr     = sanitize_title_with_dashes( $group_data['group_label'] . '-' . $group_id );\n\t\t\t$group_items_count = count( (array) $group_data['items'] );\n\t\t\tif ( $group_items_count > 1 ) {\n\t\t\t\t$group_label .= sprintf( ' <span class=\"count\">(%d)</span>', $group_items_count );\n\t\t\t}\n\t\t\tfwrite( $file, '<li>' );\n\t\t\tfwrite( $file, '<a href=\"#' . esc_attr( $group_id_attr ) . '\">' . $group_label . '</a>' );\n\t\t\tfwrite( $file, '</li>' );\n\t\t}\n\t\tfwrite( $file, '</ul>' );\n\t\tfwrite( $file, '</div>' );\n\t}\n\n\t// Now, iterate over every group in $groups and have the formatter render it in HTML.\n\tforeach ( (array) $groups as $group_id => $group_data ) {\n\t\tfwrite( $file, wp_privacy_generate_personal_data_export_group_html( $group_data, $group_id, $groups_count ) );\n\t}\n\n\tfwrite( $file, \"</body>\\n\" );\n\tfwrite( $file, \"</html>\\n\" );\n\tfclose( $file );\n\n\t/*\n\t * Now, generate the ZIP.\n\t *\n\t * If an archive has already been generated, then remove it and reuse the filename,\n\t * to avoid breaking any URLs that may have been previously sent via email.\n\t */\n\t$error = false;\n\n\t// This meta value is used from version 5.5.\n\t$archive_filename = get_post_meta( $request_id, '_export_file_name', true );\n\n\t// This one stored an absolute path and is used for backward compatibility.\n\t$archive_pathname = get_post_meta( $request_id, '_export_file_path', true );\n\n\t// If a filename meta exists, use it.\n\tif ( ! empty( $archive_filename ) ) {\n\t\t$archive_pathname = $exports_dir . $archive_filename;\n\t} elseif ( ! empty( $archive_pathname ) ) {\n\t\t// If a full path meta exists, use it and create the new meta value.\n\t\t$archive_filename = basename( $archive_pathname );\n\n\t\tupdate_post_meta( $request_id, '_export_file_name', $archive_filename );\n\n\t\t// Remove the back-compat meta values.\n\t\tdelete_post_meta( $request_id, '_export_file_url' );\n\t\tdelete_post_meta( $request_id, '_export_file_path' );\n\t} else {\n\t\t// If there's no filename or full path stored, create a new file.\n\t\t$archive_filename = $file_basename . '.zip';\n\t\t$archive_pathname = $exports_dir . $archive_filename;\n\n\t\tupdate_post_meta( $request_id, '_export_file_name', $archive_filename );\n\t}\n\n\t$archive_url = $exports_url . $archive_filename;\n\n\tif ( ! empty( $archive_pathname ) && file_exists( $archive_pathname ) ) {\n\t\twp_delete_file( $archive_pathname );\n\t}\n\n\t$zip = new ZipArchive;\n\tif ( true === $zip->open( $archive_pathname, ZipArchive::CREATE ) ) {\n\t\tif ( ! $zip->addFile( $json_report_pathname, 'export.json' ) ) {\n\t\t\t$error = __( 'Unable to add data to JSON file.' );\n\t\t}\n\n\t\tif ( ! $zip->addFile( $html_report_pathname, 'index.html' ) ) {\n\t\t\t$error = __( 'Unable to add data to HTML file.' );\n\t\t}\n\n\t\t$zip->close();\n\n\t\tif ( ! $error ) {\n\t\t\t/**\n\t\t\t * Fires right after all personal data has been written to the export file.\n\t\t\t *\n\t\t\t * @since 4.9.6\n\t\t\t * @since 5.4.0 Added the `$json_report_pathname` parameter.\n\t\t\t *\n\t\t\t * @param string $archive_pathname     The full path to the export file on the filesystem.\n\t\t\t * @param string $archive_url          The URL of the archive file.\n\t\t\t * @param string $html_report_pathname The full path to the HTML personal data report on the filesystem.\n\t\t\t * @param int    $request_id           The export request ID.\n\t\t\t * @param string $json_report_pathname The full path to the JSON personal data report on the filesystem.\n\t\t\t */\n\t\t\tdo_action( 'wp_privacy_personal_data_export_file_created', $archive_pathname, $archive_url, $html_report_pathname, $request_id, $json_report_pathname );\n\t\t}\n\t} else {\n\t\t$error = __( 'Unable to open export file (archive) for writing.' );\n\t}\n\n\t// Remove the JSON file.\n\tunlink( $json_report_pathname );\n\n\t// Remove the HTML file.\n\tunlink( $html_report_pathname );\n\n\tif ( $error ) {\n\t\twp_send_json_error( $error );\n\t}\n}\n\n/**\n * Send an email to the user with a link to the personal data export file\n *\n * @since 4.9.6\n *\n * @param int $request_id The request ID for this personal data export.\n * @return true|WP_Error True on success or `WP_Error` on failure.\n */\nfunction wp_privacy_send_personal_data_export_email( $request_id ) {\n\t// Get the request.\n\t$request = wp_get_user_request( $request_id );\n\n\tif ( ! $request || 'export_personal_data' !== $request->action_name ) {\n\t\treturn new WP_Error( 'invalid_request', __( 'Invalid request ID when sending personal data export email.' ) );\n\t}\n\n\t// Localize message content for user; fallback to site default for visitors.\n\tif ( ! empty( $request->user_id ) ) {\n\t\t$locale = get_user_locale( $request->user_id );\n\t} else {\n\t\t$locale = get_locale();\n\t}\n\n\t$switched_locale = switch_to_locale( $locale );\n\n\t/** This filter is documented in wp-includes/functions.php */\n\t$expiration      = apply_filters( 'wp_privacy_export_expiration', 3 * DAY_IN_SECONDS );\n\t$expiration_date = date_i18n( get_option( 'date_format' ), time() + $expiration );\n\n\t$exports_url      = wp_privacy_exports_url();\n\t$export_file_name = get_post_meta( $request_id, '_export_file_name', true );\n\t$export_file_url  = $exports_url . $export_file_name;\n\n\t$site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );\n\t$site_url  = home_url();\n\n\t/**\n\t * Filters the recipient of the personal data export email notification.\n\t * Should be used with great caution to avoid sending the data export link to wrong emails.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param string          $request_email The email address of the notification recipient.\n\t * @param WP_User_Request $request       The request that is initiating the notification.\n\t */\n\t$request_email = apply_filters( 'wp_privacy_personal_data_email_to', $request->email, $request );\n\n\t$email_data = array(\n\t\t'request'           => $request,\n\t\t'expiration'        => $expiration,\n\t\t'expiration_date'   => $expiration_date,\n\t\t'message_recipient' => $request_email,\n\t\t'export_file_url'   => $export_file_url,\n\t\t'sitename'          => $site_name,\n\t\t'siteurl'           => $site_url,\n\t);\n\n\t/* translators: Personal data export notification email subject. %s: Site title. */\n\t$subject = sprintf( __( '[%s] Personal Data Export' ), $site_name );\n\n\t/**\n\t * Filters the subject of the email sent when an export request is completed.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param string $subject    The email subject.\n\t * @param string $sitename   The name of the site.\n\t * @param array  $email_data {\n\t *     Data relating to the account action email.\n\t *\n\t *     @type WP_User_Request $request           User request object.\n\t *     @type int             $expiration        The time in seconds until the export file expires.\n\t *     @type string          $expiration_date   The localized date and time when the export file expires.\n\t *     @type string          $message_recipient The address that the email will be sent to. Defaults\n\t *                                              to the value of `$request->email`, but can be changed\n\t *                                              by the `wp_privacy_personal_data_email_to` filter.\n\t *     @type string          $export_file_url   The export file URL.\n\t *     @type string          $sitename          The site name sending the mail.\n\t *     @type string          $siteurl           The site URL sending the mail.\n\t * }\n\t */\n\t$subject = apply_filters( 'wp_privacy_personal_data_email_subject', $subject, $site_name, $email_data );\n\n\t/* translators: Do not translate EXPIRATION, LINK, SITENAME, SITEURL: those are placeholders. */\n\t$email_text = __(\n\t\t'Howdy,\n\nYour request for an export of personal data has been completed. You may\ndownload your personal data by clicking on the link below. For privacy\nand security, we will automatically delete the file on ###EXPIRATION###,\nso please download it before then.\n\n###LINK###\n\nRegards,\nAll at ###SITENAME###\n###SITEURL###'\n\t);\n\n\t/**\n\t * Filters the text of the email sent with a personal data export file.\n\t *\n\t * The following strings have a special meaning and will get replaced dynamically:\n\t * ###EXPIRATION###         The date when the URL will be automatically deleted.\n\t * ###LINK###               URL of the personal data export file for the user.\n\t * ###SITENAME###           The name of the site.\n\t * ###SITEURL###            The URL to the site.\n\t *\n\t * @since 4.9.6\n\t * @since 5.3.0 Introduced the `$email_data` array.\n\t *\n\t * @param string $email_text Text in the email.\n\t * @param int    $request_id The request ID for this personal data export.\n\t * @param array  $email_data {\n\t *     Data relating to the account action email.\n\t *\n\t *     @type WP_User_Request $request           User request object.\n\t *     @type int             $expiration        The time in seconds until the export file expires.\n\t *     @type string          $expiration_date   The localized date and time when the export file expires.\n\t *     @type string          $message_recipient The address that the email will be sent to. Defaults\n\t *                                              to the value of `$request->email`, but can be changed\n\t *                                              by the `wp_privacy_personal_data_email_to` filter.\n\t *     @type string          $export_file_url   The export file URL.\n\t *     @type string          $sitename          The site name sending the mail.\n\t *     @type string          $siteurl           The site URL sending the mail.\n\t */\n\t$content = apply_filters( 'wp_privacy_personal_data_email_content', $email_text, $request_id, $email_data );\n\n\t$content = str_replace( '###EXPIRATION###', $expiration_date, $content );\n\t$content = str_replace( '###LINK###', esc_url_raw( $export_file_url ), $content );\n\t$content = str_replace( '###EMAIL###', $request_email, $content );\n\t$content = str_replace( '###SITENAME###', $site_name, $content );\n\t$content = str_replace( '###SITEURL###', esc_url_raw( $site_url ), $content );\n\n\t$headers = '';\n\n\t/**\n\t * Filters the headers of the email sent with a personal data export file.\n\t *\n\t * @since 5.4.0\n\t *\n\t * @param string|array $headers    The email headers.\n\t * @param string       $subject    The email subject.\n\t * @param string       $content    The email content.\n\t * @param int          $request_id The request ID.\n\t * @param array        $email_data {\n\t *     Data relating to the account action email.\n\t *\n\t *     @type WP_User_Request $request           User request object.\n\t *     @type int             $expiration        The time in seconds until the export file expires.\n\t *     @type string          $expiration_date   The localized date and time when the export file expires.\n\t *     @type string          $message_recipient The address that the email will be sent to. Defaults\n\t *                                              to the value of `$request->email`, but can be changed\n\t *                                              by the `wp_privacy_personal_data_email_to` filter.\n\t *     @type string          $export_file_url   The export file URL.\n\t *     @type string          $sitename          The site name sending the mail.\n\t *     @type string          $siteurl           The site URL sending the mail.\n\t * }\n\t */\n\t$headers = apply_filters( 'wp_privacy_personal_data_email_headers', $headers, $subject, $content, $request_id, $email_data );\n\n\t$mail_success = wp_mail( $request_email, $subject, $content, $headers );\n\n\tif ( $switched_locale ) {\n\t\trestore_previous_locale();\n\t}\n\n\tif ( ! $mail_success ) {\n\t\treturn new WP_Error( 'privacy_email_error', __( 'Unable to send personal data export email.' ) );\n\t}\n\n\treturn true;\n}\n\n/**\n * Intercept personal data exporter page Ajax responses in order to assemble the personal data export file.\n *\n * @since 4.9.6\n *\n * @see 'wp_privacy_personal_data_export_page'\n *\n * @param array  $response        The response from the personal data exporter for the given page.\n * @param int    $exporter_index  The index of the personal data exporter. Begins at 1.\n * @param string $email_address   The email address of the user whose personal data this is.\n * @param int    $page            The page of personal data for this exporter. Begins at 1.\n * @param int    $request_id      The request ID for this personal data export.\n * @param bool   $send_as_email   Whether the final results of the export should be emailed to the user.\n * @param string $exporter_key    The slug (key) of the exporter.\n * @return array The filtered response.\n */\nfunction wp_privacy_process_personal_data_export_page( $response, $exporter_index, $email_address, $page, $request_id, $send_as_email, $exporter_key ) {\n\t/* Do some simple checks on the shape of the response from the exporter.\n\t * If the exporter response is malformed, don't attempt to consume it - let it\n\t * pass through to generate a warning to the user by default Ajax processing.\n\t */\n\tif ( ! is_array( $response ) ) {\n\t\treturn $response;\n\t}\n\n\tif ( ! array_key_exists( 'done', $response ) ) {\n\t\treturn $response;\n\t}\n\n\tif ( ! array_key_exists( 'data', $response ) ) {\n\t\treturn $response;\n\t}\n\n\tif ( ! is_array( $response['data'] ) ) {\n\t\treturn $response;\n\t}\n\n\t// Get the request.\n\t$request = wp_get_user_request( $request_id );\n\n\tif ( ! $request || 'export_personal_data' !== $request->action_name ) {\n\t\twp_send_json_error( __( 'Invalid request ID when merging exporter data.' ) );\n\t}\n\n\t$export_data = array();\n\n\t// First exporter, first page? Reset the report data accumulation array.\n\tif ( 1 === $exporter_index && 1 === $page ) {\n\t\tupdate_post_meta( $request_id, '_export_data_raw', $export_data );\n\t} else {\n\t\t$export_data = get_post_meta( $request_id, '_export_data_raw', true );\n\t}\n\n\t// Now, merge the data from the exporter response into the data we have accumulated already.\n\t$export_data = array_merge( $export_data, $response['data'] );\n\tupdate_post_meta( $request_id, '_export_data_raw', $export_data );\n\n\t// If we are not yet on the last page of the last exporter, return now.\n\t/** This filter is documented in wp-admin/includes/ajax-actions.php */\n\t$exporters        = apply_filters( 'wp_privacy_personal_data_exporters', array() );\n\t$is_last_exporter = count( $exporters ) === $exporter_index;\n\t$exporter_done    = $response['done'];\n\tif ( ! $is_last_exporter || ! $exporter_done ) {\n\t\treturn $response;\n\t}\n\n\t// Last exporter, last page - let's prepare the export file.\n\n\t// First we need to re-organize the raw data hierarchically in groups and items.\n\t$groups = array();\n\tforeach ( (array) $export_data as $export_datum ) {\n\t\t$group_id    = $export_datum['group_id'];\n\t\t$group_label = $export_datum['group_label'];\n\n\t\t$group_description = '';\n\t\tif ( ! empty( $export_datum['group_description'] ) ) {\n\t\t\t$group_description = $export_datum['group_description'];\n\t\t}\n\n\t\tif ( ! array_key_exists( $group_id, $groups ) ) {\n\t\t\t$groups[ $group_id ] = array(\n\t\t\t\t'group_label'       => $group_label,\n\t\t\t\t'group_description' => $group_description,\n\t\t\t\t'items'             => array(),\n\t\t\t);\n\t\t}\n\n\t\t$item_id = $export_datum['item_id'];\n\t\tif ( ! array_key_exists( $item_id, $groups[ $group_id ]['items'] ) ) {\n\t\t\t$groups[ $group_id ]['items'][ $item_id ] = array();\n\t\t}\n\n\t\t$old_item_data                            = $groups[ $group_id ]['items'][ $item_id ];\n\t\t$merged_item_data                         = array_merge( $export_datum['data'], $old_item_data );\n\t\t$groups[ $group_id ]['items'][ $item_id ] = $merged_item_data;\n\t}\n\n\t// Then save the grouped data into the request.\n\tdelete_post_meta( $request_id, '_export_data_raw' );\n\tupdate_post_meta( $request_id, '_export_data_grouped', $groups );\n\n\t/**\n\t * Generate the export file from the collected, grouped personal data.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param int $request_id The export request ID.\n\t */\n\tdo_action( 'wp_privacy_personal_data_export_file', $request_id );\n\n\t// Clear the grouped data now that it is no longer needed.\n\tdelete_post_meta( $request_id, '_export_data_grouped' );\n\n\t// If the destination is email, send it now.\n\tif ( $send_as_email ) {\n\t\t$mail_success = wp_privacy_send_personal_data_export_email( $request_id );\n\t\tif ( is_wp_error( $mail_success ) ) {\n\t\t\twp_send_json_error( $mail_success->get_error_message() );\n\t\t}\n\n\t\t// Update the request to completed state when the export email is sent.\n\t\t_wp_privacy_completed_request( $request_id );\n\t} else {\n\t\t// Modify the response to include the URL of the export file so the browser can fetch it.\n\t\t$exports_url      = wp_privacy_exports_url();\n\t\t$export_file_name = get_post_meta( $request_id, '_export_file_name', true );\n\t\t$export_file_url  = $exports_url . $export_file_name;\n\n\t\tif ( ! empty( $export_file_url ) ) {\n\t\t\t$response['url'] = $export_file_url;\n\t\t}\n\t}\n\n\treturn $response;\n}\n\n/**\n * Mark erasure requests as completed after processing is finished.\n *\n * This intercepts the Ajax responses to personal data eraser page requests, and\n * monitors the status of a request. Once all of the processing has finished, the\n * request is marked as completed.\n *\n * @since 4.9.6\n *\n * @see 'wp_privacy_personal_data_erasure_page'\n *\n * @param array  $response      The response from the personal data eraser for\n *                              the given page.\n * @param int    $eraser_index  The index of the personal data eraser. Begins\n *                              at 1.\n * @param string $email_address The email address of the user whose personal\n *                              data this is.\n * @param int    $page          The page of personal data for this eraser.\n *                              Begins at 1.\n * @param int    $request_id    The request ID for this personal data erasure.\n * @return array The filtered response.\n */\nfunction wp_privacy_process_personal_data_erasure_page( $response, $eraser_index, $email_address, $page, $request_id ) {\n\t/*\n\t * If the eraser response is malformed, don't attempt to consume it; let it\n\t * pass through, so that the default Ajax processing will generate a warning\n\t * to the user.\n\t */\n\tif ( ! is_array( $response ) ) {\n\t\treturn $response;\n\t}\n\n\tif ( ! array_key_exists( 'done', $response ) ) {\n\t\treturn $response;\n\t}\n\n\tif ( ! array_key_exists( 'items_removed', $response ) ) {\n\t\treturn $response;\n\t}\n\n\tif ( ! array_key_exists( 'items_retained', $response ) ) {\n\t\treturn $response;\n\t}\n\n\tif ( ! array_key_exists( 'messages', $response ) ) {\n\t\treturn $response;\n\t}\n\n\t// Get the request.\n\t$request = wp_get_user_request( $request_id );\n\n\tif ( ! $request || 'remove_personal_data' !== $request->action_name ) {\n\t\twp_send_json_error( __( 'Invalid request ID when processing eraser data.' ) );\n\t}\n\n\t/** This filter is documented in wp-admin/includes/ajax-actions.php */\n\t$erasers        = apply_filters( 'wp_privacy_personal_data_erasers', array() );\n\t$is_last_eraser = count( $erasers ) === $eraser_index;\n\t$eraser_done    = $response['done'];\n\n\tif ( ! $is_last_eraser || ! $eraser_done ) {\n\t\treturn $response;\n\t}\n\n\t_wp_privacy_completed_request( $request_id );\n\n\t/**\n\t * Fires immediately after a personal data erasure request has been marked completed.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param int $request_id The privacy request post ID associated with this request.\n\t */\n\tdo_action( 'wp_privacy_personal_data_erased', $request_id );\n\n\treturn $response;\n}\n", "num_lines": 933}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Administration Revisions API\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.6.0\n */\n\n/**\n * Get the revision UI diff.\n *\n * @since 3.6.0\n *\n * @param WP_Post|int $post         The post object or post ID.\n * @param int         $compare_from The revision ID to compare from.\n * @param int         $compare_to   The revision ID to come to.\n * @return array|bool Associative array of a post's revisioned fields and their diffs.\n *                    Or, false on failure.\n */\nfunction wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) {\n\t$post = get_post( $post );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\tif ( $compare_from ) {\n\t\t$compare_from = get_post( $compare_from );\n\t\tif ( ! $compare_from ) {\n\t\t\treturn false;\n\t\t}\n\t} else {\n\t\t// If we're dealing with the first revision...\n\t\t$compare_from = false;\n\t}\n\n\t$compare_to = get_post( $compare_to );\n\tif ( ! $compare_to ) {\n\t\treturn false;\n\t}\n\n\t// If comparing revisions, make sure we're dealing with the right post parent.\n\t// The parent post may be a 'revision' when revisions are disabled and we're looking at autosaves.\n\tif ( $compare_from && $compare_from->post_parent !== $post->ID && $compare_from->ID !== $post->ID ) {\n\t\treturn false;\n\t}\n\tif ( $compare_to->post_parent !== $post->ID && $compare_to->ID !== $post->ID ) {\n\t\treturn false;\n\t}\n\n\tif ( $compare_from && strtotime( $compare_from->post_date_gmt ) > strtotime( $compare_to->post_date_gmt ) ) {\n\t\t$temp         = $compare_from;\n\t\t$compare_from = $compare_to;\n\t\t$compare_to   = $temp;\n\t}\n\n\t// Add default title if title field is empty.\n\tif ( $compare_from && empty( $compare_from->post_title ) ) {\n\t\t$compare_from->post_title = __( '(no title)' );\n\t}\n\tif ( empty( $compare_to->post_title ) ) {\n\t\t$compare_to->post_title = __( '(no title)' );\n\t}\n\n\t$return = array();\n\n\tforeach ( _wp_post_revision_fields( $post ) as $field => $name ) {\n\t\t/**\n\t\t * Contextually filter a post revision field.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$field`, corresponds to each of the post\n\t\t * fields of the revision object being iterated over in a foreach statement.\n\t\t *\n\t\t * @since 3.6.0\n\t\t *\n\t\t * @param string  $revision_field The current revision field to compare to or from.\n\t\t * @param string  $field          The current revision field.\n\t\t * @param WP_Post $compare_from   The revision post object to compare to or from.\n\t\t * @param string  $context        The context of whether the current revision is the old\n\t\t *                                or the new one. Values are 'to' or 'from'.\n\t\t */\n\t\t$content_from = $compare_from ? apply_filters( \"_wp_post_revision_field_{$field}\", $compare_from->$field, $field, $compare_from, 'from' ) : '';\n\n\t\t/** This filter is documented in wp-admin/includes/revision.php */\n\t\t$content_to = apply_filters( \"_wp_post_revision_field_{$field}\", $compare_to->$field, $field, $compare_to, 'to' );\n\n\t\t$args = array(\n\t\t\t'show_split_view' => true,\n\t\t);\n\n\t\t/**\n\t\t * Filters revisions text diff options.\n\t\t *\n\t\t * Filters the options passed to wp_text_diff() when viewing a post revision.\n\t\t *\n\t\t * @since 4.1.0\n\t\t *\n\t\t * @param array   $args {\n\t\t *     Associative array of options to pass to wp_text_diff().\n\t\t *\n\t\t *     @type bool $show_split_view True for split view (two columns), false for\n\t\t *                                 un-split view (single column). Default true.\n\t\t * }\n\t\t * @param string  $field        The current revision field.\n\t\t * @param WP_Post $compare_from The revision post to compare from.\n\t\t * @param WP_Post $compare_to   The revision post to compare to.\n\t\t */\n\t\t$args = apply_filters( 'revision_text_diff_options', $args, $field, $compare_from, $compare_to );\n\n\t\t$diff = wp_text_diff( $content_from, $content_to, $args );\n\n\t\tif ( ! $diff && 'post_title' === $field ) {\n\t\t\t// It's a better user experience to still show the Title, even if it didn't change.\n\t\t\t// No, you didn't see this.\n\t\t\t$diff = '<table class=\"diff\"><colgroup><col class=\"content diffsplit left\"><col class=\"content diffsplit middle\"><col class=\"content diffsplit right\"></colgroup><tbody><tr>';\n\n\t\t\t// In split screen mode, show the title before/after side by side.\n\t\t\tif ( true === $args['show_split_view'] ) {\n\t\t\t\t$diff .= '<td>' . esc_html( $compare_from->post_title ) . '</td><td></td><td>' . esc_html( $compare_to->post_title ) . '</td>';\n\t\t\t} else {\n\t\t\t\t$diff .= '<td>' . esc_html( $compare_from->post_title ) . '</td>';\n\n\t\t\t\t// In single column mode, only show the title once if unchanged.\n\t\t\t\tif ( $compare_from->post_title !== $compare_to->post_title ) {\n\t\t\t\t\t$diff .= '</tr><tr><td>' . esc_html( $compare_to->post_title ) . '</td>';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$diff .= '</tr></tbody>';\n\t\t\t$diff .= '</table>';\n\t\t}\n\n\t\tif ( $diff ) {\n\t\t\t$return[] = array(\n\t\t\t\t'id'   => $field,\n\t\t\t\t'name' => $name,\n\t\t\t\t'diff' => $diff,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Filters the fields displayed in the post revision diff UI.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param array[] $return       Array of revision UI fields. Each item is an array of id, name, and diff.\n\t * @param WP_Post $compare_from The revision post to compare from.\n\t * @param WP_Post $compare_to   The revision post to compare to.\n\t */\n\treturn apply_filters( 'wp_get_revision_ui_diff', $return, $compare_from, $compare_to );\n\n}\n\n/**\n * Prepare revisions for JavaScript.\n *\n * @since 3.6.0\n *\n * @param WP_Post|int $post                 The post object or post ID.\n * @param int         $selected_revision_id The selected revision ID.\n * @param int         $from                 Optional. The revision ID to compare from.\n * @return array An associative array of revision data and related settings.\n */\nfunction wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null ) {\n\t$post    = get_post( $post );\n\t$authors = array();\n\t$now_gmt = time();\n\n\t$revisions = wp_get_post_revisions(\n\t\t$post->ID,\n\t\tarray(\n\t\t\t'order'         => 'ASC',\n\t\t\t'check_enabled' => false,\n\t\t)\n\t);\n\t// If revisions are disabled, we only want autosaves and the current post.\n\tif ( ! wp_revisions_enabled( $post ) ) {\n\t\tforeach ( $revisions as $revision_id => $revision ) {\n\t\t\tif ( ! wp_is_post_autosave( $revision ) ) {\n\t\t\t\tunset( $revisions[ $revision_id ] );\n\t\t\t}\n\t\t}\n\t\t$revisions = array( $post->ID => $post ) + $revisions;\n\t}\n\n\t$show_avatars = get_option( 'show_avatars' );\n\n\tcache_users( wp_list_pluck( $revisions, 'post_author' ) );\n\n\t$can_restore = current_user_can( 'edit_post', $post->ID );\n\t$current_id  = false;\n\n\tforeach ( $revisions as $revision ) {\n\t\t$modified     = strtotime( $revision->post_modified );\n\t\t$modified_gmt = strtotime( $revision->post_modified_gmt . ' +0000' );\n\t\tif ( $can_restore ) {\n\t\t\t$restore_link = str_replace(\n\t\t\t\t'&amp;',\n\t\t\t\t'&',\n\t\t\t\twp_nonce_url(\n\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'revision' => $revision->ID,\n\t\t\t\t\t\t\t'action'   => 'restore',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tadmin_url( 'revision.php' )\n\t\t\t\t\t),\n\t\t\t\t\t\"restore-post_{$revision->ID}\"\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( ! isset( $authors[ $revision->post_author ] ) ) {\n\t\t\t$authors[ $revision->post_author ] = array(\n\t\t\t\t'id'     => (int) $revision->post_author,\n\t\t\t\t'avatar' => $show_avatars ? get_avatar( $revision->post_author, 32 ) : '',\n\t\t\t\t'name'   => get_the_author_meta( 'display_name', $revision->post_author ),\n\t\t\t);\n\t\t}\n\n\t\t$autosave = (bool) wp_is_post_autosave( $revision );\n\t\t$current  = ! $autosave && $revision->post_modified_gmt === $post->post_modified_gmt;\n\t\tif ( $current && ! empty( $current_id ) ) {\n\t\t\t// If multiple revisions have the same post_modified_gmt, highest ID is current.\n\t\t\tif ( $current_id < $revision->ID ) {\n\t\t\t\t$revisions[ $current_id ]['current'] = false;\n\t\t\t\t$current_id                          = $revision->ID;\n\t\t\t} else {\n\t\t\t\t$current = false;\n\t\t\t}\n\t\t} elseif ( $current ) {\n\t\t\t$current_id = $revision->ID;\n\t\t}\n\n\t\t$revisions_data = array(\n\t\t\t'id'         => $revision->ID,\n\t\t\t'title'      => get_the_title( $post->ID ),\n\t\t\t'author'     => $authors[ $revision->post_author ],\n\t\t\t'date'       => date_i18n( __( 'M j, Y @ H:i' ), $modified ),\n\t\t\t'dateShort'  => date_i18n( _x( 'j M @ H:i', 'revision date short format' ), $modified ),\n\t\t\t/* translators: %s: Human-readable time difference. */\n\t\t\t'timeAgo'    => sprintf( __( '%s ago' ), human_time_diff( $modified_gmt, $now_gmt ) ),\n\t\t\t'autosave'   => $autosave,\n\t\t\t'current'    => $current,\n\t\t\t'restoreUrl' => $can_restore ? $restore_link : false,\n\t\t);\n\n\t\t/**\n\t\t * Filters the array of revisions used on the revisions screen.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param array   $revisions_data {\n\t\t *     The bootstrapped data for the revisions screen.\n\t\t *\n\t\t *     @type int        $id         Revision ID.\n\t\t *     @type string     $title      Title for the revision's parent WP_Post object.\n\t\t *     @type int        $author     Revision post author ID.\n\t\t *     @type string     $date       Date the revision was modified.\n\t\t *     @type string     $dateShort  Short-form version of the date the revision was modified.\n\t\t *     @type string     $timeAgo    GMT-aware amount of time ago the revision was modified.\n\t\t *     @type bool       $autosave   Whether the revision is an autosave.\n\t\t *     @type bool       $current    Whether the revision is both not an autosave and the post\n\t\t *                                  modified date matches the revision modified date (GMT-aware).\n\t\t *     @type bool|false $restoreUrl URL if the revision can be restored, false otherwise.\n\t\t * }\n\t\t * @param WP_Post $revision       The revision's WP_Post object.\n\t\t * @param WP_Post $post           The revision's parent WP_Post object.\n\t\t */\n\t\t$revisions[ $revision->ID ] = apply_filters( 'wp_prepare_revision_for_js', $revisions_data, $revision, $post );\n\t}\n\n\t/**\n\t * If we only have one revision, the initial revision is missing; This happens\n\t * when we have an autsosave and the user has clicked 'View the Autosave'\n\t */\n\tif ( 1 === sizeof( $revisions ) ) {\n\t\t$revisions[ $post->ID ] = array(\n\t\t\t'id'         => $post->ID,\n\t\t\t'title'      => get_the_title( $post->ID ),\n\t\t\t'author'     => $authors[ $post->post_author ],\n\t\t\t'date'       => date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_modified ) ),\n\t\t\t'dateShort'  => date_i18n( _x( 'j M @ H:i', 'revision date short format' ), strtotime( $post->post_modified ) ),\n\t\t\t/* translators: %s: Human-readable time difference. */\n\t\t\t'timeAgo'    => sprintf( __( '%s ago' ), human_time_diff( strtotime( $post->post_modified_gmt ), $now_gmt ) ),\n\t\t\t'autosave'   => false,\n\t\t\t'current'    => true,\n\t\t\t'restoreUrl' => false,\n\t\t);\n\t\t$current_id             = $post->ID;\n\t}\n\n\t/*\n\t * If a post has been saved since the last revision (no revisioned fields\n\t * were changed), we may not have a \"current\" revision. Mark the latest\n\t * revision as \"current\".\n\t */\n\tif ( empty( $current_id ) ) {\n\t\tif ( $revisions[ $revision->ID ]['autosave'] ) {\n\t\t\t$revision = end( $revisions );\n\t\t\twhile ( $revision['autosave'] ) {\n\t\t\t\t$revision = prev( $revisions );\n\t\t\t}\n\t\t\t$current_id = $revision['id'];\n\t\t} else {\n\t\t\t$current_id = $revision->ID;\n\t\t}\n\t\t$revisions[ $current_id ]['current'] = true;\n\t}\n\n\t// Now, grab the initial diff.\n\t$compare_two_mode = is_numeric( $from );\n\tif ( ! $compare_two_mode ) {\n\t\t$found = array_search( $selected_revision_id, array_keys( $revisions ), true );\n\t\tif ( $found ) {\n\t\t\t$from = array_keys( array_slice( $revisions, $found - 1, 1, true ) );\n\t\t\t$from = reset( $from );\n\t\t} else {\n\t\t\t$from = 0;\n\t\t}\n\t}\n\n\t$from = absint( $from );\n\n\t$diffs = array(\n\t\tarray(\n\t\t\t'id'     => $from . ':' . $selected_revision_id,\n\t\t\t'fields' => wp_get_revision_ui_diff( $post->ID, $from, $selected_revision_id ),\n\t\t),\n\t);\n\n\treturn array(\n\t\t'postId'         => $post->ID,\n\t\t'nonce'          => wp_create_nonce( 'revisions-ajax-nonce' ),\n\t\t'revisionData'   => array_values( $revisions ),\n\t\t'to'             => $selected_revision_id,\n\t\t'from'           => $from,\n\t\t'diffData'       => $diffs,\n\t\t'baseUrl'        => parse_url( admin_url( 'revision.php' ), PHP_URL_PATH ),\n\t\t'compareTwoMode' => absint( $compare_two_mode ), // Apparently booleans are not allowed.\n\t\t'revisionIds'    => array_keys( $revisions ),\n\t);\n}\n\n/**\n * Print JavaScript templates required for the revisions experience.\n *\n * @since 4.1.0\n *\n * @global WP_Post $post Global post object.\n */\nfunction wp_print_revision_templates() {\n\tglobal $post;\n\t?><script id=\"tmpl-revisions-frame\" type=\"text/html\">\n\t\t<div class=\"revisions-control-frame\"></div>\n\t\t<div class=\"revisions-diff-frame\"></div>\n\t</script>\n\n\t<script id=\"tmpl-revisions-buttons\" type=\"text/html\">\n\t\t<div class=\"revisions-previous\">\n\t\t\t<input class=\"button\" type=\"button\" value=\"<?php echo esc_attr_x( 'Previous', 'Button label for a previous revision' ); ?>\" />\n\t\t</div>\n\n\t\t<div class=\"revisions-next\">\n\t\t\t<input class=\"button\" type=\"button\" value=\"<?php echo esc_attr_x( 'Next', 'Button label for a next revision' ); ?>\" />\n\t\t</div>\n\t</script>\n\n\t<script id=\"tmpl-revisions-checkbox\" type=\"text/html\">\n\t\t<div class=\"revision-toggle-compare-mode\">\n\t\t\t<label>\n\t\t\t\t<input type=\"checkbox\" class=\"compare-two-revisions\"\n\t\t\t\t<#\n\t\t\t\tif ( 'undefined' !== typeof data && data.model.attributes.compareTwoMode ) {\n\t\t\t\t\t#> checked=\"checked\"<#\n\t\t\t\t}\n\t\t\t\t#>\n\t\t\t\t/>\n\t\t\t\t<?php esc_html_e( 'Compare any two revisions' ); ?>\n\t\t\t</label>\n\t\t</div>\n\t</script>\n\n\t<script id=\"tmpl-revisions-meta\" type=\"text/html\">\n\t\t<# if ( ! _.isUndefined( data.attributes ) ) { #>\n\t\t\t<div class=\"diff-title\">\n\t\t\t\t<# if ( 'from' === data.type ) { #>\n\t\t\t\t\t<strong><?php _ex( 'From:', 'Followed by post revision info' ); ?></strong>\n\t\t\t\t<# } else if ( 'to' === data.type ) { #>\n\t\t\t\t\t<strong><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong>\n\t\t\t\t<# } #>\n\t\t\t\t<div class=\"author-card<# if ( data.attributes.autosave ) { #> autosave<# } #>\">\n\t\t\t\t\t{{{ data.attributes.author.avatar }}}\n\t\t\t\t\t<div class=\"author-info\">\n\t\t\t\t\t<# if ( data.attributes.autosave ) { #>\n\t\t\t\t\t\t<span class=\"byline\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: User's display name. */\n\t\t\t\t\t\t\t__( 'Autosave by %s' ),\n\t\t\t\t\t\t\t'<span class=\"author-name\">{{ data.attributes.author.name }}</span>'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t<# } else if ( data.attributes.current ) { #>\n\t\t\t\t\t\t<span class=\"byline\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: User's display name. */\n\t\t\t\t\t\t\t__( 'Current Revision by %s' ),\n\t\t\t\t\t\t\t'<span class=\"author-name\">{{ data.attributes.author.name }}</span>'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t<span class=\"byline\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: User's display name. */\n\t\t\t\t\t\t\t__( 'Revision by %s' ),\n\t\t\t\t\t\t\t'<span class=\"author-name\">{{ data.attributes.author.name }}</span>'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t<# } #>\n\t\t\t\t\t\t<span class=\"time-ago\">{{ data.attributes.timeAgo }}</span>\n\t\t\t\t\t\t<span class=\"date\">({{ data.attributes.dateShort }})</span>\n\t\t\t\t\t</div>\n\t\t\t\t<# if ( 'to' === data.type && data.attributes.restoreUrl ) { #>\n\t\t\t\t\t<input  <?php if ( wp_check_post_lock( $post->ID ) ) { ?>\n\t\t\t\t\t\tdisabled=\"disabled\"\n\t\t\t\t\t<?php } else { ?>\n\t\t\t\t\t\t<# if ( data.attributes.current ) { #>\n\t\t\t\t\t\t\tdisabled=\"disabled\"\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t<# if ( data.attributes.autosave ) { #>\n\t\t\t\t\t\ttype=\"button\" class=\"restore-revision button button-primary\" value=\"<?php esc_attr_e( 'Restore This Autosave' ); ?>\" />\n\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\ttype=\"button\" class=\"restore-revision button button-primary\" value=\"<?php esc_attr_e( 'Restore This Revision' ); ?>\" />\n\t\t\t\t\t<# } #>\n\t\t\t\t<# } #>\n\t\t\t</div>\n\t\t<# if ( 'tooltip' === data.type ) { #>\n\t\t\t<div class=\"revisions-tooltip-arrow\"><span></span></div>\n\t\t<# } #>\n\t<# } #>\n\t</script>\n\n\t<script id=\"tmpl-revisions-diff\" type=\"text/html\">\n\t\t<div class=\"loading-indicator\"><span class=\"spinner\"></span></div>\n\t\t<div class=\"diff-error\"><?php _e( 'Sorry, something went wrong. The requested comparison could not be loaded.' ); ?></div>\n\t\t<div class=\"diff\">\n\t\t<# _.each( data.fields, function( field ) { #>\n\t\t\t<h3>{{ field.name }}</h3>\n\t\t\t{{{ field.diff }}}\n\t\t<# }); #>\n\t\t</div>\n\t</script>\n\t<?php\n}\n", "num_lines": 463}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Administration Scheme API\n *\n * Here we keep the DB structure and option values.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Declare these as global in case schema.php is included from a function.\n *\n * @global wpdb   $wpdb            WordPress database abstraction object.\n * @global array  $wp_queries\n * @global string $charset_collate\n */\nglobal $wpdb, $wp_queries, $charset_collate;\n\n/**\n * The database character collate.\n */\n$charset_collate = $wpdb->get_charset_collate();\n\n/**\n * Retrieve the SQL for creating database tables.\n *\n * @since 3.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $scope   Optional. The tables for which to retrieve SQL. Can be all, global, ms_global, or blog tables. Defaults to all.\n * @param int    $blog_id Optional. The site ID for which to retrieve SQL. Default is the current site ID.\n * @return string The SQL needed to create the requested tables.\n */\nfunction wp_get_db_schema( $scope = 'all', $blog_id = null ) {\n\tglobal $wpdb;\n\n\t$charset_collate = $wpdb->get_charset_collate();\n\n\tif ( $blog_id && $blog_id != $wpdb->blogid ) {\n\t\t$old_blog_id = $wpdb->set_blog_id( $blog_id );\n\t}\n\n\t// Engage multisite if in the middle of turning it on from network.php.\n\t$is_multisite = is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK );\n\n\t/*\n\t * Indexes have a maximum size of 767 bytes. Historically, we haven't need to be concerned about that.\n\t * As of 4.2, however, we moved to utf8mb4, which uses 4 bytes per character. This means that an index which\n\t * used to have room for floor(767/3) = 255 characters, now only has room for floor(767/4) = 191 characters.\n\t */\n\t$max_index_length = 191;\n\n\t// Blog-specific tables.\n\t$blog_tables = \"CREATE TABLE $wpdb->termmeta (\n\tmeta_id bigint(20) unsigned NOT NULL auto_increment,\n\tterm_id bigint(20) unsigned NOT NULL default '0',\n\tmeta_key varchar(255) default NULL,\n\tmeta_value longtext,\n\tPRIMARY KEY  (meta_id),\n\tKEY term_id (term_id),\n\tKEY meta_key (meta_key($max_index_length))\n) $charset_collate;\nCREATE TABLE $wpdb->terms (\n term_id bigint(20) unsigned NOT NULL auto_increment,\n name varchar(200) NOT NULL default '',\n slug varchar(200) NOT NULL default '',\n term_group bigint(10) NOT NULL default 0,\n PRIMARY KEY  (term_id),\n KEY slug (slug($max_index_length)),\n KEY name (name($max_index_length))\n) $charset_collate;\nCREATE TABLE $wpdb->term_taxonomy (\n term_taxonomy_id bigint(20) unsigned NOT NULL auto_increment,\n term_id bigint(20) unsigned NOT NULL default 0,\n taxonomy varchar(32) NOT NULL default '',\n description longtext NOT NULL,\n parent bigint(20) unsigned NOT NULL default 0,\n count bigint(20) NOT NULL default 0,\n PRIMARY KEY  (term_taxonomy_id),\n UNIQUE KEY term_id_taxonomy (term_id,taxonomy),\n KEY taxonomy (taxonomy)\n) $charset_collate;\nCREATE TABLE $wpdb->term_relationships (\n object_id bigint(20) unsigned NOT NULL default 0,\n term_taxonomy_id bigint(20) unsigned NOT NULL default 0,\n term_order int(11) NOT NULL default 0,\n PRIMARY KEY  (object_id,term_taxonomy_id),\n KEY term_taxonomy_id (term_taxonomy_id)\n) $charset_collate;\nCREATE TABLE $wpdb->commentmeta (\n\tmeta_id bigint(20) unsigned NOT NULL auto_increment,\n\tcomment_id bigint(20) unsigned NOT NULL default '0',\n\tmeta_key varchar(255) default NULL,\n\tmeta_value longtext,\n\tPRIMARY KEY  (meta_id),\n\tKEY comment_id (comment_id),\n\tKEY meta_key (meta_key($max_index_length))\n) $charset_collate;\nCREATE TABLE $wpdb->comments (\n\tcomment_ID bigint(20) unsigned NOT NULL auto_increment,\n\tcomment_post_ID bigint(20) unsigned NOT NULL default '0',\n\tcomment_author tinytext NOT NULL,\n\tcomment_author_email varchar(100) NOT NULL default '',\n\tcomment_author_url varchar(200) NOT NULL default '',\n\tcomment_author_IP varchar(100) NOT NULL default '',\n\tcomment_date datetime NOT NULL default '0000-00-00 00:00:00',\n\tcomment_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',\n\tcomment_content text NOT NULL,\n\tcomment_karma int(11) NOT NULL default '0',\n\tcomment_approved varchar(20) NOT NULL default '1',\n\tcomment_agent varchar(255) NOT NULL default '',\n\tcomment_type varchar(20) NOT NULL default 'comment',\n\tcomment_parent bigint(20) unsigned NOT NULL default '0',\n\tuser_id bigint(20) unsigned NOT NULL default '0',\n\tPRIMARY KEY  (comment_ID),\n\tKEY comment_post_ID (comment_post_ID),\n\tKEY comment_approved_date_gmt (comment_approved,comment_date_gmt),\n\tKEY comment_date_gmt (comment_date_gmt),\n\tKEY comment_parent (comment_parent),\n\tKEY comment_author_email (comment_author_email(10))\n) $charset_collate;\nCREATE TABLE $wpdb->links (\n\tlink_id bigint(20) unsigned NOT NULL auto_increment,\n\tlink_url varchar(255) NOT NULL default '',\n\tlink_name varchar(255) NOT NULL default '',\n\tlink_image varchar(255) NOT NULL default '',\n\tlink_target varchar(25) NOT NULL default '',\n\tlink_description varchar(255) NOT NULL default '',\n\tlink_visible varchar(20) NOT NULL default 'Y',\n\tlink_owner bigint(20) unsigned NOT NULL default '1',\n\tlink_rating int(11) NOT NULL default '0',\n\tlink_updated datetime NOT NULL default '0000-00-00 00:00:00',\n\tlink_rel varchar(255) NOT NULL default '',\n\tlink_notes mediumtext NOT NULL,\n\tlink_rss varchar(255) NOT NULL default '',\n\tPRIMARY KEY  (link_id),\n\tKEY link_visible (link_visible)\n) $charset_collate;\nCREATE TABLE $wpdb->options (\n\toption_id bigint(20) unsigned NOT NULL auto_increment,\n\toption_name varchar(191) NOT NULL default '',\n\toption_value longtext NOT NULL,\n\tautoload varchar(20) NOT NULL default 'yes',\n\tPRIMARY KEY  (option_id),\n\tUNIQUE KEY option_name (option_name),\n\tKEY autoload (autoload)\n) $charset_collate;\nCREATE TABLE $wpdb->postmeta (\n\tmeta_id bigint(20) unsigned NOT NULL auto_increment,\n\tpost_id bigint(20) unsigned NOT NULL default '0',\n\tmeta_key varchar(255) default NULL,\n\tmeta_value longtext,\n\tPRIMARY KEY  (meta_id),\n\tKEY post_id (post_id),\n\tKEY meta_key (meta_key($max_index_length))\n) $charset_collate;\nCREATE TABLE $wpdb->posts (\n\tID bigint(20) unsigned NOT NULL auto_increment,\n\tpost_author bigint(20) unsigned NOT NULL default '0',\n\tpost_date datetime NOT NULL default '0000-00-00 00:00:00',\n\tpost_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',\n\tpost_content longtext NOT NULL,\n\tpost_title text NOT NULL,\n\tpost_excerpt text NOT NULL,\n\tpost_status varchar(20) NOT NULL default 'publish',\n\tcomment_status varchar(20) NOT NULL default 'open',\n\tping_status varchar(20) NOT NULL default 'open',\n\tpost_password varchar(255) NOT NULL default '',\n\tpost_name varchar(200) NOT NULL default '',\n\tto_ping text NOT NULL,\n\tpinged text NOT NULL,\n\tpost_modified datetime NOT NULL default '0000-00-00 00:00:00',\n\tpost_modified_gmt datetime NOT NULL default '0000-00-00 00:00:00',\n\tpost_content_filtered longtext NOT NULL,\n\tpost_parent bigint(20) unsigned NOT NULL default '0',\n\tguid varchar(255) NOT NULL default '',\n\tmenu_order int(11) NOT NULL default '0',\n\tpost_type varchar(20) NOT NULL default 'post',\n\tpost_mime_type varchar(100) NOT NULL default '',\n\tcomment_count bigint(20) NOT NULL default '0',\n\tPRIMARY KEY  (ID),\n\tKEY post_name (post_name($max_index_length)),\n\tKEY type_status_date (post_type,post_status,post_date,ID),\n\tKEY post_parent (post_parent),\n\tKEY post_author (post_author)\n) $charset_collate;\\n\";\n\n\t// Single site users table. The multisite flavor of the users table is handled below.\n\t$users_single_table = \"CREATE TABLE $wpdb->users (\n\tID bigint(20) unsigned NOT NULL auto_increment,\n\tuser_login varchar(60) NOT NULL default '',\n\tuser_pass varchar(255) NOT NULL default '',\n\tuser_nicename varchar(50) NOT NULL default '',\n\tuser_email varchar(100) NOT NULL default '',\n\tuser_url varchar(100) NOT NULL default '',\n\tuser_registered datetime NOT NULL default '0000-00-00 00:00:00',\n\tuser_activation_key varchar(255) NOT NULL default '',\n\tuser_status int(11) NOT NULL default '0',\n\tdisplay_name varchar(250) NOT NULL default '',\n\tPRIMARY KEY  (ID),\n\tKEY user_login_key (user_login),\n\tKEY user_nicename (user_nicename),\n\tKEY user_email (user_email)\n) $charset_collate;\\n\";\n\n\t// Multisite users table.\n\t$users_multi_table = \"CREATE TABLE $wpdb->users (\n\tID bigint(20) unsigned NOT NULL auto_increment,\n\tuser_login varchar(60) NOT NULL default '',\n\tuser_pass varchar(255) NOT NULL default '',\n\tuser_nicename varchar(50) NOT NULL default '',\n\tuser_email varchar(100) NOT NULL default '',\n\tuser_url varchar(100) NOT NULL default '',\n\tuser_registered datetime NOT NULL default '0000-00-00 00:00:00',\n\tuser_activation_key varchar(255) NOT NULL default '',\n\tuser_status int(11) NOT NULL default '0',\n\tdisplay_name varchar(250) NOT NULL default '',\n\tspam tinyint(2) NOT NULL default '0',\n\tdeleted tinyint(2) NOT NULL default '0',\n\tPRIMARY KEY  (ID),\n\tKEY user_login_key (user_login),\n\tKEY user_nicename (user_nicename),\n\tKEY user_email (user_email)\n) $charset_collate;\\n\";\n\n\t// Usermeta.\n\t$usermeta_table = \"CREATE TABLE $wpdb->usermeta (\n\tumeta_id bigint(20) unsigned NOT NULL auto_increment,\n\tuser_id bigint(20) unsigned NOT NULL default '0',\n\tmeta_key varchar(255) default NULL,\n\tmeta_value longtext,\n\tPRIMARY KEY  (umeta_id),\n\tKEY user_id (user_id),\n\tKEY meta_key (meta_key($max_index_length))\n) $charset_collate;\\n\";\n\n\t// Global tables.\n\tif ( $is_multisite ) {\n\t\t$global_tables = $users_multi_table . $usermeta_table;\n\t} else {\n\t\t$global_tables = $users_single_table . $usermeta_table;\n\t}\n\n\t// Multisite global tables.\n\t$ms_global_tables = \"CREATE TABLE $wpdb->blogs (\n\tblog_id bigint(20) NOT NULL auto_increment,\n\tsite_id bigint(20) NOT NULL default '0',\n\tdomain varchar(200) NOT NULL default '',\n\tpath varchar(100) NOT NULL default '',\n\tregistered datetime NOT NULL default '0000-00-00 00:00:00',\n\tlast_updated datetime NOT NULL default '0000-00-00 00:00:00',\n\tpublic tinyint(2) NOT NULL default '1',\n\tarchived tinyint(2) NOT NULL default '0',\n\tmature tinyint(2) NOT NULL default '0',\n\tspam tinyint(2) NOT NULL default '0',\n\tdeleted tinyint(2) NOT NULL default '0',\n\tlang_id int(11) NOT NULL default '0',\n\tPRIMARY KEY  (blog_id),\n\tKEY domain (domain(50),path(5)),\n\tKEY lang_id (lang_id)\n) $charset_collate;\nCREATE TABLE $wpdb->blogmeta (\n\tmeta_id bigint(20) unsigned NOT NULL auto_increment,\n\tblog_id bigint(20) NOT NULL default '0',\n\tmeta_key varchar(255) default NULL,\n\tmeta_value longtext,\n\tPRIMARY KEY  (meta_id),\n\tKEY meta_key (meta_key($max_index_length)),\n\tKEY blog_id (blog_id)\n) $charset_collate;\nCREATE TABLE $wpdb->registration_log (\n\tID bigint(20) NOT NULL auto_increment,\n\temail varchar(255) NOT NULL default '',\n\tIP varchar(30) NOT NULL default '',\n\tblog_id bigint(20) NOT NULL default '0',\n\tdate_registered datetime NOT NULL default '0000-00-00 00:00:00',\n\tPRIMARY KEY  (ID),\n\tKEY IP (IP)\n) $charset_collate;\nCREATE TABLE $wpdb->site (\n\tid bigint(20) NOT NULL auto_increment,\n\tdomain varchar(200) NOT NULL default '',\n\tpath varchar(100) NOT NULL default '',\n\tPRIMARY KEY  (id),\n\tKEY domain (domain(140),path(51))\n) $charset_collate;\nCREATE TABLE $wpdb->sitemeta (\n\tmeta_id bigint(20) NOT NULL auto_increment,\n\tsite_id bigint(20) NOT NULL default '0',\n\tmeta_key varchar(255) default NULL,\n\tmeta_value longtext,\n\tPRIMARY KEY  (meta_id),\n\tKEY meta_key (meta_key($max_index_length)),\n\tKEY site_id (site_id)\n) $charset_collate;\nCREATE TABLE $wpdb->signups (\n\tsignup_id bigint(20) NOT NULL auto_increment,\n\tdomain varchar(200) NOT NULL default '',\n\tpath varchar(100) NOT NULL default '',\n\ttitle longtext NOT NULL,\n\tuser_login varchar(60) NOT NULL default '',\n\tuser_email varchar(100) NOT NULL default '',\n\tregistered datetime NOT NULL default '0000-00-00 00:00:00',\n\tactivated datetime NOT NULL default '0000-00-00 00:00:00',\n\tactive tinyint(1) NOT NULL default '0',\n\tactivation_key varchar(50) NOT NULL default '',\n\tmeta longtext,\n\tPRIMARY KEY  (signup_id),\n\tKEY activation_key (activation_key),\n\tKEY user_email (user_email),\n\tKEY user_login_email (user_login,user_email),\n\tKEY domain_path (domain(140),path(51))\n) $charset_collate;\";\n\n\tswitch ( $scope ) {\n\t\tcase 'blog':\n\t\t\t$queries = $blog_tables;\n\t\t\tbreak;\n\t\tcase 'global':\n\t\t\t$queries = $global_tables;\n\t\t\tif ( $is_multisite ) {\n\t\t\t\t$queries .= $ms_global_tables;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'ms_global':\n\t\t\t$queries = $ms_global_tables;\n\t\t\tbreak;\n\t\tcase 'all':\n\t\tdefault:\n\t\t\t$queries = $global_tables . $blog_tables;\n\t\t\tif ( $is_multisite ) {\n\t\t\t\t$queries .= $ms_global_tables;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\tif ( isset( $old_blog_id ) ) {\n\t\t$wpdb->set_blog_id( $old_blog_id );\n\t}\n\n\treturn $queries;\n}\n\n// Populate for back compat.\n$wp_queries = wp_get_db_schema( 'all' );\n\n/**\n * Create WordPress options and set the default values.\n *\n * @since 1.5.0\n * @since 5.1.0 The $options parameter has been added.\n *\n * @global wpdb $wpdb                  WordPress database abstraction object.\n * @global int  $wp_db_version         WordPress database version.\n * @global int  $wp_current_db_version The old (current) database version.\n *\n * @param array $options Optional. Custom option $key => $value pairs to use. Default empty array.\n */\nfunction populate_options( array $options = array() ) {\n\tglobal $wpdb, $wp_db_version, $wp_current_db_version;\n\n\t$guessurl = wp_guess_url();\n\t/**\n\t * Fires before creating WordPress options and populating their default values.\n\t *\n\t * @since 2.6.0\n\t */\n\tdo_action( 'populate_options' );\n\n\t// If WP_DEFAULT_THEME doesn't exist, fall back to the latest core default theme.\n\t$stylesheet = WP_DEFAULT_THEME;\n\t$template   = WP_DEFAULT_THEME;\n\t$theme      = wp_get_theme( WP_DEFAULT_THEME );\n\tif ( ! $theme->exists() ) {\n\t\t$theme = WP_Theme::get_core_default_theme();\n\t}\n\n\t// If we can't find a core default theme, WP_DEFAULT_THEME is the best we can do.\n\tif ( $theme ) {\n\t\t$stylesheet = $theme->get_stylesheet();\n\t\t$template   = $theme->get_template();\n\t}\n\n\t$timezone_string = '';\n\t$gmt_offset      = 0;\n\t/*\n\t * translators: default GMT offset or timezone string. Must be either a valid offset (-12 to 14)\n\t * or a valid timezone string (America/New_York). See https://www.php.net/manual/en/timezones.php\n\t * for all timezone strings supported by PHP.\n\t */\n\t$offset_or_tz = _x( '0', 'default GMT offset or timezone string' ); // phpcs:ignore WordPress.WP.I18n.NoEmptyStrings\n\tif ( is_numeric( $offset_or_tz ) ) {\n\t\t$gmt_offset = $offset_or_tz;\n\t} elseif ( $offset_or_tz && in_array( $offset_or_tz, timezone_identifiers_list(), true ) ) {\n\t\t\t$timezone_string = $offset_or_tz;\n\t}\n\n\t$defaults = array(\n\t\t'siteurl'                         => $guessurl,\n\t\t'home'                            => $guessurl,\n\t\t'blogname'                        => __( 'My Site' ),\n\t\t/* translators: Site tagline. */\n\t\t'blogdescription'                 => __( 'Just another WordPress site' ),\n\t\t'users_can_register'              => 0,\n\t\t'admin_email'                     => 'you@example.com',\n\t\t/* translators: Default start of the week. 0 = Sunday, 1 = Monday. */\n\t\t'start_of_week'                   => _x( '1', 'start of week' ),\n\t\t'use_balanceTags'                 => 0,\n\t\t'use_smilies'                     => 1,\n\t\t'require_name_email'              => 1,\n\t\t'comments_notify'                 => 1,\n\t\t'posts_per_rss'                   => 10,\n\t\t'rss_use_excerpt'                 => 0,\n\t\t'mailserver_url'                  => 'mail.example.com',\n\t\t'mailserver_login'                => 'login@example.com',\n\t\t'mailserver_pass'                 => 'password',\n\t\t'mailserver_port'                 => 110,\n\t\t'default_category'                => 1,\n\t\t'default_comment_status'          => 'open',\n\t\t'default_ping_status'             => 'open',\n\t\t'default_pingback_flag'           => 1,\n\t\t'posts_per_page'                  => 10,\n\t\t/* translators: Default date format, see https://www.php.net/date */\n\t\t'date_format'                     => __( 'F j, Y' ),\n\t\t/* translators: Default time format, see https://www.php.net/date */\n\t\t'time_format'                     => __( 'g:i a' ),\n\t\t/* translators: Links last updated date format, see https://www.php.net/date */\n\t\t'links_updated_date_format'       => __( 'F j, Y g:i a' ),\n\t\t'comment_moderation'              => 0,\n\t\t'moderation_notify'               => 1,\n\t\t'permalink_structure'             => '',\n\t\t'rewrite_rules'                   => '',\n\t\t'hack_file'                       => 0,\n\t\t'blog_charset'                    => 'UTF-8',\n\t\t'moderation_keys'                 => '',\n\t\t'active_plugins'                  => array(),\n\t\t'category_base'                   => '',\n\t\t'ping_sites'                      => 'http://rpc.pingomatic.com/',\n\t\t'comment_max_links'               => 2,\n\t\t'gmt_offset'                      => $gmt_offset,\n\n\t\t// 1.5.0\n\t\t'default_email_category'          => 1,\n\t\t'recently_edited'                 => '',\n\t\t'template'                        => $template,\n\t\t'stylesheet'                      => $stylesheet,\n\t\t'comment_registration'            => 0,\n\t\t'html_type'                       => 'text/html',\n\n\t\t// 1.5.1\n\t\t'use_trackback'                   => 0,\n\n\t\t// 2.0.0\n\t\t'default_role'                    => 'subscriber',\n\t\t'db_version'                      => $wp_db_version,\n\n\t\t// 2.0.1\n\t\t'uploads_use_yearmonth_folders'   => 1,\n\t\t'upload_path'                     => '',\n\n\t\t// 2.1.0\n\t\t'blog_public'                     => '1',\n\t\t'default_link_category'           => 2,\n\t\t'show_on_front'                   => 'posts',\n\n\t\t// 2.2.0\n\t\t'tag_base'                        => '',\n\n\t\t// 2.5.0\n\t\t'show_avatars'                    => '1',\n\t\t'avatar_rating'                   => 'G',\n\t\t'upload_url_path'                 => '',\n\t\t'thumbnail_size_w'                => 150,\n\t\t'thumbnail_size_h'                => 150,\n\t\t'thumbnail_crop'                  => 1,\n\t\t'medium_size_w'                   => 300,\n\t\t'medium_size_h'                   => 300,\n\n\t\t// 2.6.0\n\t\t'avatar_default'                  => 'mystery',\n\n\t\t// 2.7.0\n\t\t'large_size_w'                    => 1024,\n\t\t'large_size_h'                    => 1024,\n\t\t'image_default_link_type'         => 'none',\n\t\t'image_default_size'              => '',\n\t\t'image_default_align'             => '',\n\t\t'close_comments_for_old_posts'    => 0,\n\t\t'close_comments_days_old'         => 14,\n\t\t'thread_comments'                 => 1,\n\t\t'thread_comments_depth'           => 5,\n\t\t'page_comments'                   => 0,\n\t\t'comments_per_page'               => 50,\n\t\t'default_comments_page'           => 'newest',\n\t\t'comment_order'                   => 'asc',\n\t\t'sticky_posts'                    => array(),\n\t\t'widget_categories'               => array(),\n\t\t'widget_text'                     => array(),\n\t\t'widget_rss'                      => array(),\n\t\t'uninstall_plugins'               => array(),\n\n\t\t// 2.8.0\n\t\t'timezone_string'                 => $timezone_string,\n\n\t\t// 3.0.0\n\t\t'page_for_posts'                  => 0,\n\t\t'page_on_front'                   => 0,\n\n\t\t// 3.1.0\n\t\t'default_post_format'             => 0,\n\n\t\t// 3.5.0\n\t\t'link_manager_enabled'            => 0,\n\n\t\t// 4.3.0\n\t\t'finished_splitting_shared_terms' => 1,\n\t\t'site_icon'                       => 0,\n\n\t\t// 4.4.0\n\t\t'medium_large_size_w'             => 768,\n\t\t'medium_large_size_h'             => 0,\n\n\t\t// 4.9.6\n\t\t'wp_page_for_privacy_policy'      => 0,\n\n\t\t// 4.9.8\n\t\t'show_comments_cookies_opt_in'    => 1,\n\n\t\t// 5.3.0\n\t\t'admin_email_lifespan'            => ( time() + 6 * MONTH_IN_SECONDS ),\n\n\t\t// 5.5.0\n\t\t'disallowed_keys'                 => '',\n\t\t'comment_previously_approved'     => 1,\n\t\t'auto_plugin_theme_update_emails' => array(),\n\t);\n\n\t// 3.3.0\n\tif ( ! is_multisite() ) {\n\t\t$defaults['initial_db_version'] = ! empty( $wp_current_db_version ) && $wp_current_db_version < $wp_db_version\n\t\t\t? $wp_current_db_version : $wp_db_version;\n\t}\n\n\t// 3.0.0 multisite.\n\tif ( is_multisite() ) {\n\t\t/* translators: %s: Network title. */\n\t\t$defaults['blogdescription']     = sprintf( __( 'Just another %s site' ), get_network()->site_name );\n\t\t$defaults['permalink_structure'] = '/%year%/%monthnum%/%day%/%postname%/';\n\t}\n\n\t$options = wp_parse_args( $options, $defaults );\n\n\t// Set autoload to no for these options.\n\t$fat_options = array(\n\t\t'moderation_keys',\n\t\t'recently_edited',\n\t\t'disallowed_keys',\n\t\t'uninstall_plugins',\n\t\t'auto_plugin_theme_update_emails',\n\t);\n\n\t$keys             = \"'\" . implode( \"', '\", array_keys( $options ) ) . \"'\";\n\t$existing_options = $wpdb->get_col( \"SELECT option_name FROM $wpdb->options WHERE option_name in ( $keys )\" ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\n\t$insert = '';\n\n\tforeach ( $options as $option => $value ) {\n\t\tif ( in_array( $option, $existing_options, true ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( in_array( $option, $fat_options, true ) ) {\n\t\t\t$autoload = 'no';\n\t\t} else {\n\t\t\t$autoload = 'yes';\n\t\t}\n\n\t\tif ( is_array( $value ) ) {\n\t\t\t$value = serialize( $value );\n\t\t}\n\n\t\tif ( ! empty( $insert ) ) {\n\t\t\t$insert .= ', ';\n\t\t}\n\n\t\t$insert .= $wpdb->prepare( '(%s, %s, %s)', $option, $value, $autoload );\n\t}\n\n\tif ( ! empty( $insert ) ) {\n\t\t$wpdb->query( \"INSERT INTO $wpdb->options (option_name, option_value, autoload) VALUES \" . $insert ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t}\n\n\t// In case it is set, but blank, update \"home\".\n\tif ( ! __get_option( 'home' ) ) {\n\t\tupdate_option( 'home', $guessurl );\n\t}\n\n\t// Delete unused options.\n\t$unusedoptions = array(\n\t\t'blodotgsping_url',\n\t\t'bodyterminator',\n\t\t'emailtestonly',\n\t\t'phoneemail_separator',\n\t\t'smilies_directory',\n\t\t'subjectprefix',\n\t\t'use_bbcode',\n\t\t'use_blodotgsping',\n\t\t'use_phoneemail',\n\t\t'use_quicktags',\n\t\t'use_weblogsping',\n\t\t'weblogs_cache_file',\n\t\t'use_preview',\n\t\t'use_htmltrans',\n\t\t'smilies_directory',\n\t\t'fileupload_allowedusers',\n\t\t'use_phoneemail',\n\t\t'default_post_status',\n\t\t'default_post_category',\n\t\t'archive_mode',\n\t\t'time_difference',\n\t\t'links_minadminlevel',\n\t\t'links_use_adminlevels',\n\t\t'links_rating_type',\n\t\t'links_rating_char',\n\t\t'links_rating_ignore_zero',\n\t\t'links_rating_single_image',\n\t\t'links_rating_image0',\n\t\t'links_rating_image1',\n\t\t'links_rating_image2',\n\t\t'links_rating_image3',\n\t\t'links_rating_image4',\n\t\t'links_rating_image5',\n\t\t'links_rating_image6',\n\t\t'links_rating_image7',\n\t\t'links_rating_image8',\n\t\t'links_rating_image9',\n\t\t'links_recently_updated_time',\n\t\t'links_recently_updated_prepend',\n\t\t'links_recently_updated_append',\n\t\t'weblogs_cacheminutes',\n\t\t'comment_allowed_tags',\n\t\t'search_engine_friendly_urls',\n\t\t'default_geourl_lat',\n\t\t'default_geourl_lon',\n\t\t'use_default_geourl',\n\t\t'weblogs_xml_url',\n\t\t'new_users_can_blog',\n\t\t'_wpnonce',\n\t\t'_wp_http_referer',\n\t\t'Update',\n\t\t'action',\n\t\t'rich_editing',\n\t\t'autosave_interval',\n\t\t'deactivated_plugins',\n\t\t'can_compress_scripts',\n\t\t'page_uris',\n\t\t'update_core',\n\t\t'update_plugins',\n\t\t'update_themes',\n\t\t'doing_cron',\n\t\t'random_seed',\n\t\t'rss_excerpt_length',\n\t\t'secret',\n\t\t'use_linksupdate',\n\t\t'default_comment_status_page',\n\t\t'wporg_popular_tags',\n\t\t'what_to_show',\n\t\t'rss_language',\n\t\t'language',\n\t\t'enable_xmlrpc',\n\t\t'enable_app',\n\t\t'embed_autourls',\n\t\t'default_post_edit_rows',\n\t\t'gzipcompression',\n\t\t'advanced_edit',\n\t);\n\tforeach ( $unusedoptions as $option ) {\n\t\tdelete_option( $option );\n\t}\n\n\t// Delete obsolete magpie stuff.\n\t$wpdb->query( \"DELETE FROM $wpdb->options WHERE option_name REGEXP '^rss_[0-9a-f]{32}(_ts)?$'\" );\n\n\t// Clear expired transients.\n\tdelete_expired_transients( true );\n}\n\n/**\n * Execute WordPress role creation for the various WordPress versions.\n *\n * @since 2.0.0\n */\nfunction populate_roles() {\n\tpopulate_roles_160();\n\tpopulate_roles_210();\n\tpopulate_roles_230();\n\tpopulate_roles_250();\n\tpopulate_roles_260();\n\tpopulate_roles_270();\n\tpopulate_roles_280();\n\tpopulate_roles_300();\n}\n\n/**\n * Create the roles for WordPress 2.0\n *\n * @since 2.0.0\n */\nfunction populate_roles_160() {\n\t// Add roles.\n\tadd_role( 'administrator', 'Administrator' );\n\tadd_role( 'editor', 'Editor' );\n\tadd_role( 'author', 'Author' );\n\tadd_role( 'contributor', 'Contributor' );\n\tadd_role( 'subscriber', 'Subscriber' );\n\n\t// Add caps for Administrator role.\n\t$role = get_role( 'administrator' );\n\t$role->add_cap( 'switch_themes' );\n\t$role->add_cap( 'edit_themes' );\n\t$role->add_cap( 'activate_plugins' );\n\t$role->add_cap( 'edit_plugins' );\n\t$role->add_cap( 'edit_users' );\n\t$role->add_cap( 'edit_files' );\n\t$role->add_cap( 'manage_options' );\n\t$role->add_cap( 'moderate_comments' );\n\t$role->add_cap( 'manage_categories' );\n\t$role->add_cap( 'manage_links' );\n\t$role->add_cap( 'upload_files' );\n\t$role->add_cap( 'import' );\n\t$role->add_cap( 'unfiltered_html' );\n\t$role->add_cap( 'edit_posts' );\n\t$role->add_cap( 'edit_others_posts' );\n\t$role->add_cap( 'edit_published_posts' );\n\t$role->add_cap( 'publish_posts' );\n\t$role->add_cap( 'edit_pages' );\n\t$role->add_cap( 'read' );\n\t$role->add_cap( 'level_10' );\n\t$role->add_cap( 'level_9' );\n\t$role->add_cap( 'level_8' );\n\t$role->add_cap( 'level_7' );\n\t$role->add_cap( 'level_6' );\n\t$role->add_cap( 'level_5' );\n\t$role->add_cap( 'level_4' );\n\t$role->add_cap( 'level_3' );\n\t$role->add_cap( 'level_2' );\n\t$role->add_cap( 'level_1' );\n\t$role->add_cap( 'level_0' );\n\n\t// Add caps for Editor role.\n\t$role = get_role( 'editor' );\n\t$role->add_cap( 'moderate_comments' );\n\t$role->add_cap( 'manage_categories' );\n\t$role->add_cap( 'manage_links' );\n\t$role->add_cap( 'upload_files' );\n\t$role->add_cap( 'unfiltered_html' );\n\t$role->add_cap( 'edit_posts' );\n\t$role->add_cap( 'edit_others_posts' );\n\t$role->add_cap( 'edit_published_posts' );\n\t$role->add_cap( 'publish_posts' );\n\t$role->add_cap( 'edit_pages' );\n\t$role->add_cap( 'read' );\n\t$role->add_cap( 'level_7' );\n\t$role->add_cap( 'level_6' );\n\t$role->add_cap( 'level_5' );\n\t$role->add_cap( 'level_4' );\n\t$role->add_cap( 'level_3' );\n\t$role->add_cap( 'level_2' );\n\t$role->add_cap( 'level_1' );\n\t$role->add_cap( 'level_0' );\n\n\t// Add caps for Author role.\n\t$role = get_role( 'author' );\n\t$role->add_cap( 'upload_files' );\n\t$role->add_cap( 'edit_posts' );\n\t$role->add_cap( 'edit_published_posts' );\n\t$role->add_cap( 'publish_posts' );\n\t$role->add_cap( 'read' );\n\t$role->add_cap( 'level_2' );\n\t$role->add_cap( 'level_1' );\n\t$role->add_cap( 'level_0' );\n\n\t// Add caps for Contributor role.\n\t$role = get_role( 'contributor' );\n\t$role->add_cap( 'edit_posts' );\n\t$role->add_cap( 'read' );\n\t$role->add_cap( 'level_1' );\n\t$role->add_cap( 'level_0' );\n\n\t// Add caps for Subscriber role.\n\t$role = get_role( 'subscriber' );\n\t$role->add_cap( 'read' );\n\t$role->add_cap( 'level_0' );\n}\n\n/**\n * Create and modify WordPress roles for WordPress 2.1.\n *\n * @since 2.1.0\n */\nfunction populate_roles_210() {\n\t$roles = array( 'administrator', 'editor' );\n\tforeach ( $roles as $role ) {\n\t\t$role = get_role( $role );\n\t\tif ( empty( $role ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$role->add_cap( 'edit_others_pages' );\n\t\t$role->add_cap( 'edit_published_pages' );\n\t\t$role->add_cap( 'publish_pages' );\n\t\t$role->add_cap( 'delete_pages' );\n\t\t$role->add_cap( 'delete_others_pages' );\n\t\t$role->add_cap( 'delete_published_pages' );\n\t\t$role->add_cap( 'delete_posts' );\n\t\t$role->add_cap( 'delete_others_posts' );\n\t\t$role->add_cap( 'delete_published_posts' );\n\t\t$role->add_cap( 'delete_private_posts' );\n\t\t$role->add_cap( 'edit_private_posts' );\n\t\t$role->add_cap( 'read_private_posts' );\n\t\t$role->add_cap( 'delete_private_pages' );\n\t\t$role->add_cap( 'edit_private_pages' );\n\t\t$role->add_cap( 'read_private_pages' );\n\t}\n\n\t$role = get_role( 'administrator' );\n\tif ( ! empty( $role ) ) {\n\t\t$role->add_cap( 'delete_users' );\n\t\t$role->add_cap( 'create_users' );\n\t}\n\n\t$role = get_role( 'author' );\n\tif ( ! empty( $role ) ) {\n\t\t$role->add_cap( 'delete_posts' );\n\t\t$role->add_cap( 'delete_published_posts' );\n\t}\n\n\t$role = get_role( 'contributor' );\n\tif ( ! empty( $role ) ) {\n\t\t$role->add_cap( 'delete_posts' );\n\t}\n}\n\n/**\n * Create and modify WordPress roles for WordPress 2.3.\n *\n * @since 2.3.0\n */\nfunction populate_roles_230() {\n\t$role = get_role( 'administrator' );\n\n\tif ( ! empty( $role ) ) {\n\t\t$role->add_cap( 'unfiltered_upload' );\n\t}\n}\n\n/**\n * Create and modify WordPress roles for WordPress 2.5.\n *\n * @since 2.5.0\n */\nfunction populate_roles_250() {\n\t$role = get_role( 'administrator' );\n\n\tif ( ! empty( $role ) ) {\n\t\t$role->add_cap( 'edit_dashboard' );\n\t}\n}\n\n/**\n * Create and modify WordPress roles for WordPress 2.6.\n *\n * @since 2.6.0\n */\nfunction populate_roles_260() {\n\t$role = get_role( 'administrator' );\n\n\tif ( ! empty( $role ) ) {\n\t\t$role->add_cap( 'update_plugins' );\n\t\t$role->add_cap( 'delete_plugins' );\n\t}\n}\n\n/**\n * Create and modify WordPress roles for WordPress 2.7.\n *\n * @since 2.7.0\n */\nfunction populate_roles_270() {\n\t$role = get_role( 'administrator' );\n\n\tif ( ! empty( $role ) ) {\n\t\t$role->add_cap( 'install_plugins' );\n\t\t$role->add_cap( 'update_themes' );\n\t}\n}\n\n/**\n * Create and modify WordPress roles for WordPress 2.8.\n *\n * @since 2.8.0\n */\nfunction populate_roles_280() {\n\t$role = get_role( 'administrator' );\n\n\tif ( ! empty( $role ) ) {\n\t\t$role->add_cap( 'install_themes' );\n\t}\n}\n\n/**\n * Create and modify WordPress roles for WordPress 3.0.\n *\n * @since 3.0.0\n */\nfunction populate_roles_300() {\n\t$role = get_role( 'administrator' );\n\n\tif ( ! empty( $role ) ) {\n\t\t$role->add_cap( 'update_core' );\n\t\t$role->add_cap( 'list_users' );\n\t\t$role->add_cap( 'remove_users' );\n\t\t$role->add_cap( 'promote_users' );\n\t\t$role->add_cap( 'edit_theme_options' );\n\t\t$role->add_cap( 'delete_themes' );\n\t\t$role->add_cap( 'export' );\n\t}\n}\n\nif ( ! function_exists( 'install_network' ) ) :\n\t/**\n\t * Install Network.\n\t *\n\t * @since 3.0.0\n\t */\n\tfunction install_network() {\n\t\tif ( ! defined( 'WP_INSTALLING_NETWORK' ) ) {\n\t\t\tdefine( 'WP_INSTALLING_NETWORK', true );\n\t\t}\n\n\t\tdbDelta( wp_get_db_schema( 'global' ) );\n\t}\nendif;\n\n/**\n * Populate network settings.\n *\n * @since 3.0.0\n *\n * @global wpdb       $wpdb         WordPress database abstraction object.\n * @global object     $current_site\n * @global WP_Rewrite $wp_rewrite   WordPress rewrite component.\n *\n * @param int    $network_id        ID of network to populate.\n * @param string $domain            The domain name for the network (eg. \"example.com\").\n * @param string $email             Email address for the network administrator.\n * @param string $site_name         The name of the network.\n * @param string $path              Optional. The path to append to the network's domain name. Default '/'.\n * @param bool   $subdomain_install Optional. Whether the network is a subdomain installation or a subdirectory installation.\n *                                  Default false, meaning the network is a subdirectory installation.\n * @return bool|WP_Error True on success, or WP_Error on warning (with the installation otherwise successful,\n *                       so the error code must be checked) or failure.\n */\nfunction populate_network( $network_id = 1, $domain = '', $email = '', $site_name = '', $path = '/', $subdomain_install = false ) {\n\tglobal $wpdb, $current_site, $wp_rewrite;\n\n\t$errors = new WP_Error();\n\tif ( '' === $domain ) {\n\t\t$errors->add( 'empty_domain', __( 'You must provide a domain name.' ) );\n\t}\n\tif ( '' === $site_name ) {\n\t\t$errors->add( 'empty_sitename', __( 'You must provide a name for your network of sites.' ) );\n\t}\n\n\t// Check for network collision.\n\t$network_exists = false;\n\tif ( is_multisite() ) {\n\t\tif ( get_network( (int) $network_id ) ) {\n\t\t\t$errors->add( 'siteid_exists', __( 'The network already exists.' ) );\n\t\t}\n\t} else {\n\t\tif ( $network_id == $wpdb->get_var( $wpdb->prepare( \"SELECT id FROM $wpdb->site WHERE id = %d\", $network_id ) ) ) {\n\t\t\t$errors->add( 'siteid_exists', __( 'The network already exists.' ) );\n\t\t}\n\t}\n\n\tif ( ! is_email( $email ) ) {\n\t\t$errors->add( 'invalid_email', __( 'You must provide a valid email address.' ) );\n\t}\n\n\tif ( $errors->has_errors() ) {\n\t\treturn $errors;\n\t}\n\n\tif ( 1 == $network_id ) {\n\t\t$wpdb->insert(\n\t\t\t$wpdb->site,\n\t\t\tarray(\n\t\t\t\t'domain' => $domain,\n\t\t\t\t'path'   => $path,\n\t\t\t)\n\t\t);\n\t\t$network_id = $wpdb->insert_id;\n\t} else {\n\t\t$wpdb->insert(\n\t\t\t$wpdb->site,\n\t\t\tarray(\n\t\t\t\t'domain' => $domain,\n\t\t\t\t'path'   => $path,\n\t\t\t\t'id'     => $network_id,\n\t\t\t)\n\t\t);\n\t}\n\n\tpopulate_network_meta(\n\t\t$network_id,\n\t\tarray(\n\t\t\t'admin_email'       => $email,\n\t\t\t'site_name'         => $site_name,\n\t\t\t'subdomain_install' => $subdomain_install,\n\t\t)\n\t);\n\n\t$site_user = get_userdata( (int) $wpdb->get_var( $wpdb->prepare( \"SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = %s AND site_id = %d\", 'admin_user_id', $network_id ) ) );\n\n\t/*\n\t * When upgrading from single to multisite, assume the current site will\n\t * become the main site of the network. When using populate_network()\n\t * to create another network in an existing multisite environment, skip\n\t * these steps since the main site of the new network has not yet been\n\t * created.\n\t */\n\tif ( ! is_multisite() ) {\n\t\t$current_site            = new stdClass;\n\t\t$current_site->domain    = $domain;\n\t\t$current_site->path      = $path;\n\t\t$current_site->site_name = ucfirst( $domain );\n\t\t$wpdb->insert(\n\t\t\t$wpdb->blogs,\n\t\t\tarray(\n\t\t\t\t'site_id'    => $network_id,\n\t\t\t\t'blog_id'    => 1,\n\t\t\t\t'domain'     => $domain,\n\t\t\t\t'path'       => $path,\n\t\t\t\t'registered' => current_time( 'mysql' ),\n\t\t\t)\n\t\t);\n\t\t$current_site->blog_id = $wpdb->insert_id;\n\t\tupdate_user_meta( $site_user->ID, 'source_domain', $domain );\n\t\tupdate_user_meta( $site_user->ID, 'primary_blog', $current_site->blog_id );\n\n\t\tif ( $subdomain_install ) {\n\t\t\t$wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );\n\t\t} else {\n\t\t\t$wp_rewrite->set_permalink_structure( '/blog/%year%/%monthnum%/%day%/%postname%/' );\n\t\t}\n\n\t\tflush_rewrite_rules();\n\n\t\tif ( ! $subdomain_install ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$vhost_ok = false;\n\t\t$errstr   = '';\n\t\t$hostname = substr( md5( time() ), 0, 6 ) . '.' . $domain; // Very random hostname!\n\t\t$page     = wp_remote_get(\n\t\t\t'http://' . $hostname,\n\t\t\tarray(\n\t\t\t\t'timeout'     => 5,\n\t\t\t\t'httpversion' => '1.1',\n\t\t\t)\n\t\t);\n\t\tif ( is_wp_error( $page ) ) {\n\t\t\t$errstr = $page->get_error_message();\n\t\t} elseif ( 200 == wp_remote_retrieve_response_code( $page ) ) {\n\t\t\t\t$vhost_ok = true;\n\t\t}\n\n\t\tif ( ! $vhost_ok ) {\n\t\t\t$msg = '<p><strong>' . __( 'Warning! Wildcard DNS may not be configured correctly!' ) . '</strong></p>';\n\n\t\t\t$msg .= '<p>' . sprintf(\n\t\t\t\t/* translators: %s: Host name. */\n\t\t\t\t__( 'The installer attempted to contact a random hostname (%s) on your domain.' ),\n\t\t\t\t'<code>' . $hostname . '</code>'\n\t\t\t);\n\t\t\tif ( ! empty( $errstr ) ) {\n\t\t\t\t/* translators: %s: Error message. */\n\t\t\t\t$msg .= ' ' . sprintf( __( 'This resulted in an error message: %s' ), '<code>' . $errstr . '</code>' );\n\t\t\t}\n\t\t\t$msg .= '</p>';\n\n\t\t\t$msg .= '<p>' . sprintf(\n\t\t\t\t/* translators: %s: Asterisk symbol (*). */\n\t\t\t\t__( 'To use a subdomain configuration, you must have a wildcard entry in your DNS. This usually means adding a %s hostname record pointing at your web server in your DNS configuration tool.' ),\n\t\t\t\t'<code>*</code>'\n\t\t\t) . '</p>';\n\n\t\t\t$msg .= '<p>' . __( 'You can still use your site but any subdomain you create may not be accessible. If you know your DNS is correct, ignore this message.' ) . '</p>';\n\n\t\t\treturn new WP_Error( 'no_wildcard_dns', $msg );\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Creates WordPress network meta and sets the default values.\n *\n * @since 5.1.0\n *\n * @global wpdb $wpdb          WordPress database abstraction object.\n * @global int  $wp_db_version WordPress database version.\n *\n * @param int   $network_id Network ID to populate meta for.\n * @param array $meta       Optional. Custom meta $key => $value pairs to use. Default empty array.\n */\nfunction populate_network_meta( $network_id, array $meta = array() ) {\n\tglobal $wpdb, $wp_db_version;\n\n\t$network_id = (int) $network_id;\n\n\t$email             = ! empty( $meta['admin_email'] ) ? $meta['admin_email'] : '';\n\t$subdomain_install = isset( $meta['subdomain_install'] ) ? (int) $meta['subdomain_install'] : 0;\n\n\t// If a user with the provided email does not exist, default to the current user as the new network admin.\n\t$site_user = ! empty( $email ) ? get_user_by( 'email', $email ) : false;\n\tif ( false === $site_user ) {\n\t\t$site_user = wp_get_current_user();\n\t}\n\n\tif ( empty( $email ) ) {\n\t\t$email = $site_user->user_email;\n\t}\n\n\t$template       = get_option( 'template' );\n\t$stylesheet     = get_option( 'stylesheet' );\n\t$allowed_themes = array( $stylesheet => true );\n\n\tif ( $template != $stylesheet ) {\n\t\t$allowed_themes[ $template ] = true;\n\t}\n\n\tif ( WP_DEFAULT_THEME != $stylesheet && WP_DEFAULT_THEME != $template ) {\n\t\t$allowed_themes[ WP_DEFAULT_THEME ] = true;\n\t}\n\n\t// If WP_DEFAULT_THEME doesn't exist, also include the latest core default theme.\n\tif ( ! wp_get_theme( WP_DEFAULT_THEME )->exists() ) {\n\t\t$core_default = WP_Theme::get_core_default_theme();\n\t\tif ( $core_default ) {\n\t\t\t$allowed_themes[ $core_default->get_stylesheet() ] = true;\n\t\t}\n\t}\n\n\tif ( function_exists( 'clean_network_cache' ) ) {\n\t\tclean_network_cache( $network_id );\n\t} else {\n\t\twp_cache_delete( $network_id, 'networks' );\n\t}\n\n\twp_cache_delete( 'networks_have_paths', 'site-options' );\n\n\tif ( ! is_multisite() ) {\n\t\t$site_admins = array( $site_user->user_login );\n\t\t$users       = get_users(\n\t\t\tarray(\n\t\t\t\t'fields' => array( 'user_login' ),\n\t\t\t\t'role'   => 'administrator',\n\t\t\t)\n\t\t);\n\t\tif ( $users ) {\n\t\t\tforeach ( $users as $user ) {\n\t\t\t\t$site_admins[] = $user->user_login;\n\t\t\t}\n\n\t\t\t$site_admins = array_unique( $site_admins );\n\t\t}\n\t} else {\n\t\t$site_admins = get_site_option( 'site_admins' );\n\t}\n\n\t/* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD: those are placeholders. */\n\t$welcome_email = __(\n\t\t'Howdy USERNAME,\n\nYour new SITE_NAME site has been successfully set up at:\nBLOG_URL\n\nYou can log in to the administrator account with the following information:\n\nUsername: USERNAME\nPassword: PASSWORD\nLog in here: BLOG_URLwp-login.php\n\nWe hope you enjoy your new site. Thanks!\n\n--The Team @ SITE_NAME'\n\t);\n\n\t$misc_exts        = array(\n\t\t// Images.\n\t\t'jpg',\n\t\t'jpeg',\n\t\t'png',\n\t\t'gif',\n\t\t// Video.\n\t\t'mov',\n\t\t'avi',\n\t\t'mpg',\n\t\t'3gp',\n\t\t'3g2',\n\t\t// \"audio\".\n\t\t'midi',\n\t\t'mid',\n\t\t// Miscellaneous.\n\t\t'pdf',\n\t\t'doc',\n\t\t'ppt',\n\t\t'odt',\n\t\t'pptx',\n\t\t'docx',\n\t\t'pps',\n\t\t'ppsx',\n\t\t'xls',\n\t\t'xlsx',\n\t\t'key',\n\t);\n\t$audio_exts       = wp_get_audio_extensions();\n\t$video_exts       = wp_get_video_extensions();\n\t$upload_filetypes = array_unique( array_merge( $misc_exts, $audio_exts, $video_exts ) );\n\n\t$sitemeta = array(\n\t\t'site_name'                   => __( 'My Network' ),\n\t\t'admin_email'                 => $email,\n\t\t'admin_user_id'               => $site_user->ID,\n\t\t'registration'                => 'none',\n\t\t'upload_filetypes'            => implode( ' ', $upload_filetypes ),\n\t\t'blog_upload_space'           => 100,\n\t\t'fileupload_maxk'             => 1500,\n\t\t'site_admins'                 => $site_admins,\n\t\t'allowedthemes'               => $allowed_themes,\n\t\t'illegal_names'               => array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator', 'files' ),\n\t\t'wpmu_upgrade_site'           => $wp_db_version,\n\t\t'welcome_email'               => $welcome_email,\n\t\t/* translators: %s: Site link. */\n\t\t'first_post'                  => __( 'Welcome to %s. This is your first post. Edit or delete it, then start writing!' ),\n\t\t// @todo - Network admins should have a method of editing the network siteurl (used for cookie hash).\n\t\t'siteurl'                     => get_option( 'siteurl' ) . '/',\n\t\t'add_new_users'               => '0',\n\t\t'upload_space_check_disabled' => is_multisite() ? get_site_option( 'upload_space_check_disabled' ) : '1',\n\t\t'subdomain_install'           => $subdomain_install,\n\t\t'global_terms_enabled'        => global_terms_enabled() ? '1' : '0',\n\t\t'ms_files_rewriting'          => is_multisite() ? get_site_option( 'ms_files_rewriting' ) : '0',\n\t\t'initial_db_version'          => get_option( 'initial_db_version' ),\n\t\t'active_sitewide_plugins'     => array(),\n\t\t'WPLANG'                      => get_locale(),\n\t);\n\tif ( ! $subdomain_install ) {\n\t\t$sitemeta['illegal_names'][] = 'blog';\n\t}\n\n\t$sitemeta = wp_parse_args( $meta, $sitemeta );\n\n\t/**\n\t * Filters meta for a network on creation.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param array $sitemeta   Associative array of network meta keys and values to be inserted.\n\t * @param int   $network_id ID of network to populate.\n\t */\n\t$sitemeta = apply_filters( 'populate_network_meta', $sitemeta, $network_id );\n\n\t$insert = '';\n\tforeach ( $sitemeta as $meta_key => $meta_value ) {\n\t\tif ( is_array( $meta_value ) ) {\n\t\t\t$meta_value = serialize( $meta_value );\n\t\t}\n\t\tif ( ! empty( $insert ) ) {\n\t\t\t$insert .= ', ';\n\t\t}\n\t\t$insert .= $wpdb->prepare( '( %d, %s, %s)', $network_id, $meta_key, $meta_value );\n\t}\n\t$wpdb->query( \"INSERT INTO $wpdb->sitemeta ( site_id, meta_key, meta_value ) VALUES \" . $insert ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n}\n\n/**\n * Creates WordPress site meta and sets the default values.\n *\n * @since 5.1.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int   $site_id Site ID to populate meta for.\n * @param array $meta    Optional. Custom meta $key => $value pairs to use. Default empty array.\n */\nfunction populate_site_meta( $site_id, array $meta = array() ) {\n\tglobal $wpdb;\n\n\t$site_id = (int) $site_id;\n\n\tif ( ! is_site_meta_supported() ) {\n\t\treturn;\n\t}\n\n\tif ( empty( $meta ) ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Filters meta for a site on creation.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param array $meta    Associative array of site meta keys and values to be inserted.\n\t * @param int   $site_id ID of site to populate.\n\t */\n\t$site_meta = apply_filters( 'populate_site_meta', $meta, $site_id );\n\n\t$insert = '';\n\tforeach ( $site_meta as $meta_key => $meta_value ) {\n\t\tif ( is_array( $meta_value ) ) {\n\t\t\t$meta_value = serialize( $meta_value );\n\t\t}\n\t\tif ( ! empty( $insert ) ) {\n\t\t\t$insert .= ', ';\n\t\t}\n\t\t$insert .= $wpdb->prepare( '( %d, %s, %s)', $site_id, $meta_key, $meta_value );\n\t}\n\n\t$wpdb->query( \"INSERT INTO $wpdb->blogmeta ( blog_id, meta_key, meta_value ) VALUES \" . $insert ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\n\twp_cache_delete( $site_id, 'blog_meta' );\n\twp_cache_set_sites_last_changed();\n}\n", "num_lines": 1341}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Administration Screen API.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Get the column headers for a screen\n *\n * @since 2.7.0\n *\n * @param string|WP_Screen $screen The screen you want the headers for\n * @return string[] The column header labels keyed by column ID.\n */\nfunction get_column_headers( $screen ) {\n\tif ( is_string( $screen ) ) {\n\t\t$screen = convert_to_screen( $screen );\n\t}\n\n\tstatic $column_headers = array();\n\n\tif ( ! isset( $column_headers[ $screen->id ] ) ) {\n\t\t/**\n\t\t * Filters the column headers for a list table on a specific screen.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$screen->id`, refers to the\n\t\t * ID of a specific screen. For example, the screen ID for the Posts\n\t\t * list table is edit-post, so the filter for that screen would be\n\t\t * manage_edit-post_columns.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string[] $columns The column header labels keyed by column ID.\n\t\t */\n\t\t$column_headers[ $screen->id ] = apply_filters( \"manage_{$screen->id}_columns\", array() );\n\t}\n\n\treturn $column_headers[ $screen->id ];\n}\n\n/**\n * Get a list of hidden columns.\n *\n * @since 2.7.0\n *\n * @param string|WP_Screen $screen The screen you want the hidden columns for\n * @return string[] Array of IDs of hidden columns.\n */\nfunction get_hidden_columns( $screen ) {\n\tif ( is_string( $screen ) ) {\n\t\t$screen = convert_to_screen( $screen );\n\t}\n\n\t$hidden = get_user_option( 'manage' . $screen->id . 'columnshidden' );\n\n\t$use_defaults = ! is_array( $hidden );\n\n\tif ( $use_defaults ) {\n\t\t$hidden = array();\n\n\t\t/**\n\t\t * Filters the default list of hidden columns.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string[]  $hidden Array of IDs of columns hidden by default.\n\t\t * @param WP_Screen $screen WP_Screen object of the current screen.\n\t\t */\n\t\t$hidden = apply_filters( 'default_hidden_columns', $hidden, $screen );\n\t}\n\n\t/**\n\t * Filters the list of hidden columns.\n\t *\n\t * @since 4.4.0\n\t * @since 4.4.1 Added the `use_defaults` parameter.\n\t *\n\t * @param string[]  $hidden       Array of IDs of hidden columns.\n\t * @param WP_Screen $screen       WP_Screen object of the current screen.\n\t * @param bool      $use_defaults Whether to show the default columns.\n\t */\n\treturn apply_filters( 'hidden_columns', $hidden, $screen, $use_defaults );\n}\n\n/**\n * Prints the meta box preferences for screen meta.\n *\n * @since 2.7.0\n *\n * @global array $wp_meta_boxes\n *\n * @param WP_Screen $screen\n */\nfunction meta_box_prefs( $screen ) {\n\tglobal $wp_meta_boxes;\n\n\tif ( is_string( $screen ) ) {\n\t\t$screen = convert_to_screen( $screen );\n\t}\n\n\tif ( empty( $wp_meta_boxes[ $screen->id ] ) ) {\n\t\treturn;\n\t}\n\n\t$hidden = get_hidden_meta_boxes( $screen );\n\n\tforeach ( array_keys( $wp_meta_boxes[ $screen->id ] ) as $context ) {\n\t\tforeach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {\n\t\t\tif ( ! isset( $wp_meta_boxes[ $screen->id ][ $context ][ $priority ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tforeach ( $wp_meta_boxes[ $screen->id ][ $context ][ $priority ] as $box ) {\n\t\t\t\tif ( false == $box || ! $box['title'] ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Submit box cannot be hidden.\n\t\t\t\tif ( 'submitdiv' === $box['id'] || 'linksubmitdiv' === $box['id'] ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$widget_title = $box['title'];\n\n\t\t\t\tif ( is_array( $box['args'] ) && isset( $box['args']['__widget_basename'] ) ) {\n\t\t\t\t\t$widget_title = $box['args']['__widget_basename'];\n\t\t\t\t}\n\n\t\t\t\t$is_hidden = in_array( $box['id'], $hidden, true );\n\n\t\t\t\tprintf(\n\t\t\t\t\t'<label for=\"%1$s-hide\"><input class=\"hide-postbox-tog\" name=\"%1$s-hide\" type=\"checkbox\" id=\"%1$s-hide\" value=\"%1$s\" %2$s />%3$s</label>',\n\t\t\t\t\tesc_attr( $box['id'] ),\n\t\t\t\t\tchecked( $is_hidden, false, false ),\n\t\t\t\t\t$widget_title\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Gets an array of IDs of hidden meta boxes.\n *\n * @since 2.7.0\n *\n * @param string|WP_Screen $screen Screen identifier\n * @return string[] IDs of hidden meta boxes.\n */\nfunction get_hidden_meta_boxes( $screen ) {\n\tif ( is_string( $screen ) ) {\n\t\t$screen = convert_to_screen( $screen );\n\t}\n\n\t$hidden = get_user_option( \"metaboxhidden_{$screen->id}\" );\n\n\t$use_defaults = ! is_array( $hidden );\n\n\t// Hide slug boxes by default.\n\tif ( $use_defaults ) {\n\t\t$hidden = array();\n\t\tif ( 'post' === $screen->base ) {\n\t\t\tif ( in_array( $screen->post_type, array( 'post', 'page', 'attachment' ), true ) ) {\n\t\t\t\t$hidden = array( 'slugdiv', 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv' );\n\t\t\t} else {\n\t\t\t\t$hidden = array( 'slugdiv' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the default list of hidden meta boxes.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string[]  $hidden An array of IDs of meta boxes hidden by default.\n\t\t * @param WP_Screen $screen WP_Screen object of the current screen.\n\t\t */\n\t\t$hidden = apply_filters( 'default_hidden_meta_boxes', $hidden, $screen );\n\t}\n\n\t/**\n\t * Filters the list of hidden meta boxes.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string[]  $hidden       An array of IDs of hidden meta boxes.\n\t * @param WP_Screen $screen       WP_Screen object of the current screen.\n\t * @param bool      $use_defaults Whether to show the default meta boxes.\n\t *                                Default true.\n\t */\n\treturn apply_filters( 'hidden_meta_boxes', $hidden, $screen, $use_defaults );\n}\n\n/**\n * Register and configure an admin screen option\n *\n * @since 3.1.0\n *\n * @param string $option An option name.\n * @param mixed  $args   Option-dependent arguments.\n */\nfunction add_screen_option( $option, $args = array() ) {\n\t$current_screen = get_current_screen();\n\n\tif ( ! $current_screen ) {\n\t\treturn;\n\t}\n\n\t$current_screen->add_option( $option, $args );\n}\n\n/**\n * Get the current screen object\n *\n * @since 3.1.0\n *\n * @global WP_Screen $current_screen WordPress current screen object.\n *\n * @return WP_Screen|null Current screen object or null when screen not defined.\n */\nfunction get_current_screen() {\n\tglobal $current_screen;\n\n\tif ( ! isset( $current_screen ) ) {\n\t\treturn null;\n\t}\n\n\treturn $current_screen;\n}\n\n/**\n * Set the current screen object\n *\n * @since 3.0.0\n *\n * @param string|WP_Screen $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen,\n *                                    or an existing screen object.\n */\nfunction set_current_screen( $hook_name = '' ) {\n\tWP_Screen::get( $hook_name )->set_current_screen();\n}\n", "num_lines": 242}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Taxonomy Administration API.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n//\n// Category.\n//\n\n/**\n * Check whether a category exists.\n *\n * @since 2.0.0\n *\n * @see term_exists()\n *\n * @param int|string $cat_name Category name.\n * @param int        $parent   Optional. ID of parent term.\n * @return mixed\n */\nfunction category_exists( $cat_name, $parent = null ) {\n\t$id = term_exists( $cat_name, 'category', $parent );\n\tif ( is_array( $id ) ) {\n\t\t$id = $id['term_id'];\n\t}\n\treturn $id;\n}\n\n/**\n * Get category object for given ID and 'edit' filter context.\n *\n * @since 2.0.0\n *\n * @param int $id\n * @return object\n */\nfunction get_category_to_edit( $id ) {\n\t$category = get_term( $id, 'category', OBJECT, 'edit' );\n\t_make_cat_compat( $category );\n\treturn $category;\n}\n\n/**\n * Add a new category to the database if it does not already exist.\n *\n * @since 2.0.0\n *\n * @param int|string $cat_name\n * @param int        $parent\n * @return int|WP_Error\n */\nfunction wp_create_category( $cat_name, $parent = 0 ) {\n\t$id = category_exists( $cat_name, $parent );\n\tif ( $id ) {\n\t\treturn $id;\n\t}\n\n\treturn wp_insert_category(\n\t\tarray(\n\t\t\t'cat_name'        => $cat_name,\n\t\t\t'category_parent' => $parent,\n\t\t)\n\t);\n}\n\n/**\n * Create categories for the given post.\n *\n * @since 2.0.0\n *\n * @param string[] $categories Array of category names to create.\n * @param int      $post_id    Optional. The post ID. Default empty.\n * @return int[] Array of IDs of categories assigned to the given post.\n */\nfunction wp_create_categories( $categories, $post_id = '' ) {\n\t$cat_ids = array();\n\tforeach ( $categories as $category ) {\n\t\t$id = category_exists( $category );\n\t\tif ( $id ) {\n\t\t\t$cat_ids[] = $id;\n\t\t} else {\n\t\t\t$id = wp_create_category( $category );\n\t\t\tif ( $id ) {\n\t\t\t\t$cat_ids[] = $id;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( $post_id ) {\n\t\twp_set_post_categories( $post_id, $cat_ids );\n\t}\n\n\treturn $cat_ids;\n}\n\n/**\n * Updates an existing Category or creates a new Category.\n *\n * @since 2.0.0\n * @since 2.5.0 $wp_error parameter was added.\n * @since 3.0.0 The 'taxonomy' argument was added.\n *\n * @param array $catarr {\n *     Array of arguments for inserting a new category.\n *\n *     @type int        $cat_ID               Category ID. A non-zero value updates an existing category.\n *                                            Default 0.\n *     @type string     $taxonomy             Taxonomy slug. Default 'category'.\n *     @type string     $cat_name             Category name. Default empty.\n *     @type string     $category_description Category description. Default empty.\n *     @type string     $category_nicename    Category nice (display) name. Default empty.\n *     @type int|string $category_parent      Category parent ID. Default empty.\n * }\n * @param bool  $wp_error Optional. Default false.\n * @return int|object The ID number of the new or updated Category on success. Zero or a WP_Error on failure,\n *                    depending on param $wp_error.\n */\nfunction wp_insert_category( $catarr, $wp_error = false ) {\n\t$cat_defaults = array(\n\t\t'cat_ID'               => 0,\n\t\t'taxonomy'             => 'category',\n\t\t'cat_name'             => '',\n\t\t'category_description' => '',\n\t\t'category_nicename'    => '',\n\t\t'category_parent'      => '',\n\t);\n\t$catarr       = wp_parse_args( $catarr, $cat_defaults );\n\n\tif ( '' === trim( $catarr['cat_name'] ) ) {\n\t\tif ( ! $wp_error ) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn new WP_Error( 'cat_name', __( 'You did not enter a category name.' ) );\n\t\t}\n\t}\n\n\t$catarr['cat_ID'] = (int) $catarr['cat_ID'];\n\n\t// Are we updating or creating?\n\t$update = ! empty( $catarr['cat_ID'] );\n\n\t$name        = $catarr['cat_name'];\n\t$description = $catarr['category_description'];\n\t$slug        = $catarr['category_nicename'];\n\t$parent      = (int) $catarr['category_parent'];\n\tif ( $parent < 0 ) {\n\t\t$parent = 0;\n\t}\n\n\tif ( empty( $parent )\n\t\t|| ! term_exists( $parent, $catarr['taxonomy'] )\n\t\t|| ( $catarr['cat_ID'] && term_is_ancestor_of( $catarr['cat_ID'], $parent, $catarr['taxonomy'] ) ) ) {\n\t\t$parent = 0;\n\t}\n\n\t$args = compact( 'name', 'slug', 'parent', 'description' );\n\n\tif ( $update ) {\n\t\t$catarr['cat_ID'] = wp_update_term( $catarr['cat_ID'], $catarr['taxonomy'], $args );\n\t} else {\n\t\t$catarr['cat_ID'] = wp_insert_term( $catarr['cat_name'], $catarr['taxonomy'], $args );\n\t}\n\n\tif ( is_wp_error( $catarr['cat_ID'] ) ) {\n\t\tif ( $wp_error ) {\n\t\t\treturn $catarr['cat_ID'];\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n\treturn $catarr['cat_ID']['term_id'];\n}\n\n/**\n * Aliases wp_insert_category() with minimal args.\n *\n * If you want to update only some fields of an existing category, call this\n * function with only the new values set inside $catarr.\n *\n * @since 2.0.0\n *\n * @param array $catarr The 'cat_ID' value is required. All other keys are optional.\n * @return int|bool The ID number of the new or updated Category on success. Zero or FALSE on failure.\n */\nfunction wp_update_category( $catarr ) {\n\t$cat_ID = (int) $catarr['cat_ID'];\n\n\tif ( isset( $catarr['category_parent'] ) && ( $cat_ID == $catarr['category_parent'] ) ) {\n\t\treturn false;\n\t}\n\n\t// First, get all of the original fields.\n\t$category = get_term( $cat_ID, 'category', ARRAY_A );\n\t_make_cat_compat( $category );\n\n\t// Escape data pulled from DB.\n\t$category = wp_slash( $category );\n\n\t// Merge old and new fields with new fields overwriting old ones.\n\t$catarr = array_merge( $category, $catarr );\n\n\treturn wp_insert_category( $catarr );\n}\n\n//\n// Tags.\n//\n\n/**\n * Check whether a post tag with a given name exists.\n *\n * @since 2.3.0\n *\n * @param int|string $tag_name\n * @return mixed\n */\nfunction tag_exists( $tag_name ) {\n\treturn term_exists( $tag_name, 'post_tag' );\n}\n\n/**\n * Add a new tag to the database if it does not already exist.\n *\n * @since 2.3.0\n *\n * @param int|string $tag_name\n * @return array|WP_Error\n */\nfunction wp_create_tag( $tag_name ) {\n\treturn wp_create_term( $tag_name, 'post_tag' );\n}\n\n/**\n * Get comma-separated list of tags available to edit.\n *\n * @since 2.3.0\n *\n * @param int    $post_id\n * @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'.\n * @return string|bool|WP_Error\n */\nfunction get_tags_to_edit( $post_id, $taxonomy = 'post_tag' ) {\n\treturn get_terms_to_edit( $post_id, $taxonomy );\n}\n\n/**\n * Get comma-separated list of terms available to edit for the given post ID.\n *\n * @since 2.8.0\n *\n * @param int    $post_id\n * @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'.\n * @return string|bool|WP_Error\n */\nfunction get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) {\n\t$post_id = (int) $post_id;\n\tif ( ! $post_id ) {\n\t\treturn false;\n\t}\n\n\t$terms = get_object_term_cache( $post_id, $taxonomy );\n\tif ( false === $terms ) {\n\t\t$terms = wp_get_object_terms( $post_id, $taxonomy );\n\t\twp_cache_add( $post_id, wp_list_pluck( $terms, 'term_id' ), $taxonomy . '_relationships' );\n\t}\n\n\tif ( ! $terms ) {\n\t\treturn false;\n\t}\n\tif ( is_wp_error( $terms ) ) {\n\t\treturn $terms;\n\t}\n\t$term_names = array();\n\tforeach ( $terms as $term ) {\n\t\t$term_names[] = $term->name;\n\t}\n\n\t$terms_to_edit = esc_attr( join( ',', $term_names ) );\n\n\t/**\n\t * Filters the comma-separated list of terms available to edit.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @see get_terms_to_edit()\n\t *\n\t * @param string $terms_to_edit A comma-separated list of term names.\n\t * @param string $taxonomy      The taxonomy name for which to retrieve terms.\n\t */\n\t$terms_to_edit = apply_filters( 'terms_to_edit', $terms_to_edit, $taxonomy );\n\n\treturn $terms_to_edit;\n}\n\n/**\n * Add a new term to the database if it does not already exist.\n *\n * @since 2.8.0\n *\n * @param string $tag_name The term name.\n * @param string $taxonomy Optional. The taxonomy within which to create the term. Default 'post_tag'.\n * @return array|WP_Error\n */\nfunction wp_create_term( $tag_name, $taxonomy = 'post_tag' ) {\n\t$id = term_exists( $tag_name, $taxonomy );\n\tif ( $id ) {\n\t\treturn $id;\n\t}\n\n\treturn wp_insert_term( $tag_name, $taxonomy );\n}\n", "num_lines": 315}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template WordPress Administration API.\n *\n * A Big Mess. Also some neat functions that are nicely written.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** Walker_Category_Checklist class */\nrequire_once ABSPATH . 'wp-admin/includes/class-walker-category-checklist.php';\n\n/** WP_Internal_Pointers class */\nrequire_once ABSPATH . 'wp-admin/includes/class-wp-internal-pointers.php';\n\n//\n// Category Checklists.\n//\n\n/**\n * Output an unordered list of checkbox input elements labeled with category names.\n *\n * @since 2.5.1\n *\n * @see wp_terms_checklist()\n *\n * @param int    $post_id              Optional. Post to generate a categories checklist for. Default 0.\n *                                     $selected_cats must not be an array. Default 0.\n * @param int    $descendants_and_self Optional. ID of the category to output along with its descendants.\n *                                     Default 0.\n * @param int[]  $selected_cats        Optional. Array of category IDs to mark as checked. Default false.\n * @param int[]  $popular_cats         Optional. Array of category IDs to receive the \"popular-category\" class.\n *                                     Default false.\n * @param Walker $walker               Optional. Walker object to use to build the output.\n *                                     Default is a Walker_Category_Checklist instance.\n * @param bool   $checked_ontop        Optional. Whether to move checked items out of the hierarchy and to\n *                                     the top of the list. Default true.\n */\nfunction wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {\n\twp_terms_checklist(\n\t\t$post_id,\n\t\tarray(\n\t\t\t'taxonomy'             => 'category',\n\t\t\t'descendants_and_self' => $descendants_and_self,\n\t\t\t'selected_cats'        => $selected_cats,\n\t\t\t'popular_cats'         => $popular_cats,\n\t\t\t'walker'               => $walker,\n\t\t\t'checked_ontop'        => $checked_ontop,\n\t\t)\n\t);\n}\n\n/**\n * Output an unordered list of checkbox input elements labelled with term names.\n *\n * Taxonomy-independent version of wp_category_checklist().\n *\n * @since 3.0.0\n * @since 4.4.0 Introduced the `$echo` argument.\n *\n * @param int          $post_id Optional. Post ID. Default 0.\n * @param array|string $args {\n *     Optional. Array or string of arguments for generating a terms checklist. Default empty array.\n *\n *     @type int    $descendants_and_self ID of the category to output along with its descendants.\n *                                        Default 0.\n *     @type int[]  $selected_cats        Array of category IDs to mark as checked. Default false.\n *     @type int[]  $popular_cats         Array of category IDs to receive the \"popular-category\" class.\n *                                        Default false.\n *     @type Walker $walker               Walker object to use to build the output.\n *                                        Default is a Walker_Category_Checklist instance.\n *     @type string $taxonomy             Taxonomy to generate the checklist for. Default 'category'.\n *     @type bool   $checked_ontop        Whether to move checked items out of the hierarchy and to\n *                                        the top of the list. Default true.\n *     @type bool   $echo                 Whether to echo the generated markup. False to return the markup instead\n *                                        of echoing it. Default true.\n * }\n * @return string HTML list of input elements.\n */\nfunction wp_terms_checklist( $post_id = 0, $args = array() ) {\n\t$defaults = array(\n\t\t'descendants_and_self' => 0,\n\t\t'selected_cats'        => false,\n\t\t'popular_cats'         => false,\n\t\t'walker'               => null,\n\t\t'taxonomy'             => 'category',\n\t\t'checked_ontop'        => true,\n\t\t'echo'                 => true,\n\t);\n\n\t/**\n\t * Filters the taxonomy terms checklist arguments.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @see wp_terms_checklist()\n\t *\n\t * @param array $args    An array of arguments.\n\t * @param int   $post_id The post ID.\n\t */\n\t$params = apply_filters( 'wp_terms_checklist_args', $args, $post_id );\n\n\t$parsed_args = wp_parse_args( $params, $defaults );\n\n\tif ( empty( $parsed_args['walker'] ) || ! ( $parsed_args['walker'] instanceof Walker ) ) {\n\t\t$walker = new Walker_Category_Checklist;\n\t} else {\n\t\t$walker = $parsed_args['walker'];\n\t}\n\n\t$taxonomy             = $parsed_args['taxonomy'];\n\t$descendants_and_self = (int) $parsed_args['descendants_and_self'];\n\n\t$args = array( 'taxonomy' => $taxonomy );\n\n\t$tax              = get_taxonomy( $taxonomy );\n\t$args['disabled'] = ! current_user_can( $tax->cap->assign_terms );\n\n\t$args['list_only'] = ! empty( $parsed_args['list_only'] );\n\n\tif ( is_array( $parsed_args['selected_cats'] ) ) {\n\t\t$args['selected_cats'] = array_map( 'intval', $parsed_args['selected_cats'] );\n\t} elseif ( $post_id ) {\n\t\t$args['selected_cats'] = wp_get_object_terms( $post_id, $taxonomy, array_merge( $args, array( 'fields' => 'ids' ) ) );\n\t} else {\n\t\t$args['selected_cats'] = array();\n\t}\n\n\tif ( is_array( $parsed_args['popular_cats'] ) ) {\n\t\t$args['popular_cats'] = array_map( 'intval', $parsed_args['popular_cats'] );\n\t} else {\n\t\t$args['popular_cats'] = get_terms(\n\t\t\tarray(\n\t\t\t\t'taxonomy'     => $taxonomy,\n\t\t\t\t'fields'       => 'ids',\n\t\t\t\t'orderby'      => 'count',\n\t\t\t\t'order'        => 'DESC',\n\t\t\t\t'number'       => 10,\n\t\t\t\t'hierarchical' => false,\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( $descendants_and_self ) {\n\t\t$categories = (array) get_terms(\n\t\t\tarray(\n\t\t\t\t'taxonomy'     => $taxonomy,\n\t\t\t\t'child_of'     => $descendants_and_self,\n\t\t\t\t'hierarchical' => 0,\n\t\t\t\t'hide_empty'   => 0,\n\t\t\t)\n\t\t);\n\t\t$self       = get_term( $descendants_and_self, $taxonomy );\n\t\tarray_unshift( $categories, $self );\n\t} else {\n\t\t$categories = (array) get_terms(\n\t\t\tarray(\n\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t'get'      => 'all',\n\t\t\t)\n\t\t);\n\t}\n\n\t$output = '';\n\n\tif ( $parsed_args['checked_ontop'] ) {\n\t\t// Post-process $categories rather than adding an exclude to the get_terms() query\n\t\t// to keep the query the same across all posts (for any query cache).\n\t\t$checked_categories = array();\n\t\t$keys               = array_keys( $categories );\n\n\t\tforeach ( $keys as $k ) {\n\t\t\tif ( in_array( $categories[ $k ]->term_id, $args['selected_cats'], true ) ) {\n\t\t\t\t$checked_categories[] = $categories[ $k ];\n\t\t\t\tunset( $categories[ $k ] );\n\t\t\t}\n\t\t}\n\n\t\t// Put checked categories on top.\n\t\t$output .= $walker->walk( $checked_categories, 0, $args );\n\t}\n\t// Then the rest of them.\n\t$output .= $walker->walk( $categories, 0, $args );\n\n\tif ( $parsed_args['echo'] ) {\n\t\techo $output;\n\t}\n\n\treturn $output;\n}\n\n/**\n * Retrieve a list of the most popular terms from the specified taxonomy.\n *\n * If the $echo argument is true then the elements for a list of checkbox\n * `<input>` elements labelled with the names of the selected terms is output.\n * If the $post_ID global isn't empty then the terms associated with that\n * post will be marked as checked.\n *\n * @since 2.5.0\n *\n * @param string $taxonomy Taxonomy to retrieve terms from.\n * @param int    $default  Not used.\n * @param int    $number   Number of terms to retrieve. Defaults to 10.\n * @param bool   $echo     Optionally output the list as well. Defaults to true.\n * @return int[] Array of popular term IDs.\n */\nfunction wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) {\n\t$post = get_post();\n\n\tif ( $post && $post->ID ) {\n\t\t$checked_terms = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );\n\t} else {\n\t\t$checked_terms = array();\n\t}\n\n\t$terms = get_terms(\n\t\tarray(\n\t\t\t'taxonomy'     => $taxonomy,\n\t\t\t'orderby'      => 'count',\n\t\t\t'order'        => 'DESC',\n\t\t\t'number'       => $number,\n\t\t\t'hierarchical' => false,\n\t\t)\n\t);\n\n\t$tax = get_taxonomy( $taxonomy );\n\n\t$popular_ids = array();\n\n\tforeach ( (array) $terms as $term ) {\n\t\t$popular_ids[] = $term->term_id;\n\t\tif ( ! $echo ) { // Hack for Ajax use.\n\t\t\tcontinue;\n\t\t}\n\t\t$id      = \"popular-$taxonomy-$term->term_id\";\n\t\t$checked = in_array( $term->term_id, $checked_terms, true ) ? 'checked=\"checked\"' : '';\n\t\t?>\n\n\t\t<li id=\"<?php echo $id; ?>\" class=\"popular-category\">\n\t\t\t<label class=\"selectit\">\n\t\t\t\t<input id=\"in-<?php echo $id; ?>\" type=\"checkbox\" <?php echo $checked; ?> value=\"<?php echo (int) $term->term_id; ?>\" <?php disabled( ! current_user_can( $tax->cap->assign_terms ) ); ?> />\n\t\t\t\t<?php\n\t\t\t\t/** This filter is documented in wp-includes/category-template.php */\n\t\t\t\techo esc_html( apply_filters( 'the_category', $term->name, '', '' ) );\n\t\t\t\t?>\n\t\t\t</label>\n\t\t</li>\n\n\t\t<?php\n\t}\n\treturn $popular_ids;\n}\n\n/**\n * Outputs a link category checklist element.\n *\n * @since 2.5.1\n *\n * @param int $link_id\n */\nfunction wp_link_category_checklist( $link_id = 0 ) {\n\t$default = 1;\n\n\t$checked_categories = array();\n\n\tif ( $link_id ) {\n\t\t$checked_categories = wp_get_link_cats( $link_id );\n\t\t// No selected categories, strange.\n\t\tif ( ! count( $checked_categories ) ) {\n\t\t\t$checked_categories[] = $default;\n\t\t}\n\t} else {\n\t\t$checked_categories[] = $default;\n\t}\n\n\t$categories = get_terms(\n\t\tarray(\n\t\t\t'taxonomy'   => 'link_category',\n\t\t\t'orderby'    => 'name',\n\t\t\t'hide_empty' => 0,\n\t\t)\n\t);\n\n\tif ( empty( $categories ) ) {\n\t\treturn;\n\t}\n\n\tforeach ( $categories as $category ) {\n\t\t$cat_id = $category->term_id;\n\n\t\t/** This filter is documented in wp-includes/category-template.php */\n\t\t$name    = esc_html( apply_filters( 'the_category', $category->name, '', '' ) );\n\t\t$checked = in_array( $cat_id, $checked_categories, true ) ? ' checked=\"checked\"' : '';\n\t\techo '<li id=\"link-category-', $cat_id, '\"><label for=\"in-link-category-', $cat_id, '\" class=\"selectit\"><input value=\"', $cat_id, '\" type=\"checkbox\" name=\"link_category[]\" id=\"in-link-category-', $cat_id, '\"', $checked, '/> ', $name, '</label></li>';\n\t}\n}\n\n/**\n * Adds hidden fields with the data for use in the inline editor for posts and pages.\n *\n * @since 2.7.0\n *\n * @param WP_Post $post Post object.\n */\nfunction get_inline_data( $post ) {\n\t$post_type_object = get_post_type_object( $post->post_type );\n\tif ( ! current_user_can( 'edit_post', $post->ID ) ) {\n\t\treturn;\n\t}\n\n\t$title = esc_textarea( trim( $post->post_title ) );\n\n\techo '\n<div class=\"hidden\" id=\"inline_' . $post->ID . '\">\n\t<div class=\"post_title\">' . $title . '</div>' .\n\t/** This filter is documented in wp-admin/edit-tag-form.php */\n\t'<div class=\"post_name\">' . apply_filters( 'editable_slug', $post->post_name, $post ) . '</div>\n\t<div class=\"post_author\">' . $post->post_author . '</div>\n\t<div class=\"comment_status\">' . esc_html( $post->comment_status ) . '</div>\n\t<div class=\"ping_status\">' . esc_html( $post->ping_status ) . '</div>\n\t<div class=\"_status\">' . esc_html( $post->post_status ) . '</div>\n\t<div class=\"jj\">' . mysql2date( 'd', $post->post_date, false ) . '</div>\n\t<div class=\"mm\">' . mysql2date( 'm', $post->post_date, false ) . '</div>\n\t<div class=\"aa\">' . mysql2date( 'Y', $post->post_date, false ) . '</div>\n\t<div class=\"hh\">' . mysql2date( 'H', $post->post_date, false ) . '</div>\n\t<div class=\"mn\">' . mysql2date( 'i', $post->post_date, false ) . '</div>\n\t<div class=\"ss\">' . mysql2date( 's', $post->post_date, false ) . '</div>\n\t<div class=\"post_password\">' . esc_html( $post->post_password ) . '</div>';\n\n\tif ( $post_type_object->hierarchical ) {\n\t\techo '<div class=\"post_parent\">' . $post->post_parent . '</div>';\n\t}\n\n\techo '<div class=\"page_template\">' . ( $post->page_template ? esc_html( $post->page_template ) : 'default' ) . '</div>';\n\n\tif ( post_type_supports( $post->post_type, 'page-attributes' ) ) {\n\t\techo '<div class=\"menu_order\">' . $post->menu_order . '</div>';\n\t}\n\n\t$taxonomy_names = get_object_taxonomies( $post->post_type );\n\n\tforeach ( $taxonomy_names as $taxonomy_name ) {\n\t\t$taxonomy = get_taxonomy( $taxonomy_name );\n\n\t\tif ( $taxonomy->hierarchical && $taxonomy->show_ui ) {\n\n\t\t\t$terms = get_object_term_cache( $post->ID, $taxonomy_name );\n\t\t\tif ( false === $terms ) {\n\t\t\t\t$terms = wp_get_object_terms( $post->ID, $taxonomy_name );\n\t\t\t\twp_cache_add( $post->ID, wp_list_pluck( $terms, 'term_id' ), $taxonomy_name . '_relationships' );\n\t\t\t}\n\t\t\t$term_ids = empty( $terms ) ? array() : wp_list_pluck( $terms, 'term_id' );\n\n\t\t\techo '<div class=\"post_category\" id=\"' . $taxonomy_name . '_' . $post->ID . '\">' . implode( ',', $term_ids ) . '</div>';\n\n\t\t} elseif ( $taxonomy->show_ui ) {\n\n\t\t\t$terms_to_edit = get_terms_to_edit( $post->ID, $taxonomy_name );\n\t\t\tif ( ! is_string( $terms_to_edit ) ) {\n\t\t\t\t$terms_to_edit = '';\n\t\t\t}\n\n\t\t\techo '<div class=\"tags_input\" id=\"' . $taxonomy_name . '_' . $post->ID . '\">'\n\t\t\t\t. esc_html( str_replace( ',', ', ', $terms_to_edit ) ) . '</div>';\n\n\t\t}\n\t}\n\n\tif ( ! $post_type_object->hierarchical ) {\n\t\techo '<div class=\"sticky\">' . ( is_sticky( $post->ID ) ? 'sticky' : '' ) . '</div>';\n\t}\n\n\tif ( post_type_supports( $post->post_type, 'post-formats' ) ) {\n\t\techo '<div class=\"post_format\">' . esc_html( get_post_format( $post->ID ) ) . '</div>';\n\t}\n\n\t/**\n\t * Fires after outputting the fields for the inline editor for posts and pages.\n\t *\n\t * @since 4.9.8\n\t *\n\t * @param WP_Post      $post             The current post object.\n\t * @param WP_Post_Type $post_type_object The current post's post type object.\n\t */\n\tdo_action( 'add_inline_data', $post, $post_type_object );\n\n\techo '</div>';\n}\n\n/**\n * Outputs the in-line comment reply-to form in the Comments list table.\n *\n * @since 2.7.0\n *\n * @global WP_List_Table $wp_list_table\n *\n * @param int    $position\n * @param bool   $checkbox\n * @param string $mode\n * @param bool   $table_row\n */\nfunction wp_comment_reply( $position = 1, $checkbox = false, $mode = 'single', $table_row = true ) {\n\tglobal $wp_list_table;\n\t/**\n\t * Filters the in-line comment reply-to form output in the Comments\n\t * list table.\n\t *\n\t * Returning a non-empty value here will short-circuit display\n\t * of the in-line comment-reply form in the Comments list table,\n\t * echoing the returned value instead.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @see wp_comment_reply()\n\t *\n\t * @param string $content The reply-to form content.\n\t * @param array  $args    An array of default args.\n\t */\n\t$content = apply_filters(\n\t\t'wp_comment_reply',\n\t\t'',\n\t\tarray(\n\t\t\t'position' => $position,\n\t\t\t'checkbox' => $checkbox,\n\t\t\t'mode'     => $mode,\n\t\t)\n\t);\n\n\tif ( ! empty( $content ) ) {\n\t\techo $content;\n\t\treturn;\n\t}\n\n\tif ( ! $wp_list_table ) {\n\t\tif ( 'single' === $mode ) {\n\t\t\t$wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table' );\n\t\t} else {\n\t\t\t$wp_list_table = _get_list_table( 'WP_Comments_List_Table' );\n\t\t}\n\t}\n\n\t?>\n<form method=\"get\">\n\t<?php if ( $table_row ) : ?>\n<table style=\"display:none;\"><tbody id=\"com-reply\"><tr id=\"replyrow\" class=\"inline-edit-row\" style=\"display:none;\"><td colspan=\"<?php echo $wp_list_table->get_column_count(); ?>\" class=\"colspanchange\">\n<?php else : ?>\n<div id=\"com-reply\" style=\"display:none;\"><div id=\"replyrow\" style=\"display:none;\">\n<?php endif; ?>\n\t<fieldset class=\"comment-reply\">\n\t<legend>\n\t\t<span class=\"hidden\" id=\"editlegend\"><?php _e( 'Edit Comment' ); ?></span>\n\t\t<span class=\"hidden\" id=\"replyhead\"><?php _e( 'Reply to Comment' ); ?></span>\n\t\t<span class=\"hidden\" id=\"addhead\"><?php _e( 'Add new Comment' ); ?></span>\n\t</legend>\n\n\t<div id=\"replycontainer\">\n\t<label for=\"replycontent\" class=\"screen-reader-text\"><?php _e( 'Comment' ); ?></label>\n\t<?php\n\t$quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );\n\twp_editor(\n\t\t'',\n\t\t'replycontent',\n\t\tarray(\n\t\t\t'media_buttons' => false,\n\t\t\t'tinymce'       => false,\n\t\t\t'quicktags'     => $quicktags_settings,\n\t\t)\n\t);\n\t?>\n\t</div>\n\n\t<div id=\"edithead\" style=\"display:none;\">\n\t\t<div class=\"inside\">\n\t\t<label for=\"author-name\"><?php _e( 'Name' ); ?></label>\n\t\t<input type=\"text\" name=\"newcomment_author\" size=\"50\" value=\"\" id=\"author-name\" />\n\t\t</div>\n\n\t\t<div class=\"inside\">\n\t\t<label for=\"author-email\"><?php _e( 'Email' ); ?></label>\n\t\t<input type=\"text\" name=\"newcomment_author_email\" size=\"50\" value=\"\" id=\"author-email\" />\n\t\t</div>\n\n\t\t<div class=\"inside\">\n\t\t<label for=\"author-url\"><?php _e( 'URL' ); ?></label>\n\t\t<input type=\"text\" id=\"author-url\" name=\"newcomment_author_url\" class=\"code\" size=\"103\" value=\"\" />\n\t\t</div>\n\t</div>\n\n\t<div id=\"replysubmit\" class=\"submit\">\n\t\t<p class=\"reply-submit-buttons\">\n\t\t\t<button type=\"button\" class=\"save button button-primary\">\n\t\t\t\t<span id=\"addbtn\" style=\"display: none;\"><?php _e( 'Add Comment' ); ?></span>\n\t\t\t\t<span id=\"savebtn\" style=\"display: none;\"><?php _e( 'Update Comment' ); ?></span>\n\t\t\t\t<span id=\"replybtn\" style=\"display: none;\"><?php _e( 'Submit Reply' ); ?></span>\n\t\t\t</button>\n\t\t\t<button type=\"button\" class=\"cancel button\"><?php _e( 'Cancel' ); ?></button>\n\t\t\t<span class=\"waiting spinner\"></span>\n\t\t</p>\n\t\t<div class=\"notice notice-error notice-alt inline hidden\">\n\t\t\t<p class=\"error\"></p>\n\t\t</div>\n\t</div>\n\n\t<input type=\"hidden\" name=\"action\" id=\"action\" value=\"\" />\n\t<input type=\"hidden\" name=\"comment_ID\" id=\"comment_ID\" value=\"\" />\n\t<input type=\"hidden\" name=\"comment_post_ID\" id=\"comment_post_ID\" value=\"\" />\n\t<input type=\"hidden\" name=\"status\" id=\"status\" value=\"\" />\n\t<input type=\"hidden\" name=\"position\" id=\"position\" value=\"<?php echo $position; ?>\" />\n\t<input type=\"hidden\" name=\"checkbox\" id=\"checkbox\" value=\"<?php echo $checkbox ? 1 : 0; ?>\" />\n\t<input type=\"hidden\" name=\"mode\" id=\"mode\" value=\"<?php echo esc_attr( $mode ); ?>\" />\n\t<?php\n\t\twp_nonce_field( 'replyto-comment', '_ajax_nonce-replyto-comment', false );\n\tif ( current_user_can( 'unfiltered_html' ) ) {\n\t\twp_nonce_field( 'unfiltered-html-comment', '_wp_unfiltered_html_comment', false );\n\t}\n\t?>\n\t</fieldset>\n\t<?php if ( $table_row ) : ?>\n</td></tr></tbody></table>\n\t<?php else : ?>\n</div></div>\n\t<?php endif; ?>\n</form>\n\t<?php\n}\n\n/**\n * Output 'undo move to Trash' text for comments\n *\n * @since 2.9.0\n */\nfunction wp_comment_trashnotice() {\n\t?>\n<div class=\"hidden\" id=\"trash-undo-holder\">\n\t<div class=\"trash-undo-inside\">\n\t\t<?php\n\t\t/* translators: %s: Comment author, filled by Ajax. */\n\t\tprintf( __( 'Comment by %s moved to the Trash.' ), '<strong></strong>' );\n\t\t?>\n\t\t<span class=\"undo untrash\"><a href=\"#\"><?php _e( 'Undo' ); ?></a></span>\n\t</div>\n</div>\n<div class=\"hidden\" id=\"spam-undo-holder\">\n\t<div class=\"spam-undo-inside\">\n\t\t<?php\n\t\t/* translators: %s: Comment author, filled by Ajax. */\n\t\tprintf( __( 'Comment by %s marked as spam.' ), '<strong></strong>' );\n\t\t?>\n\t\t<span class=\"undo unspam\"><a href=\"#\"><?php _e( 'Undo' ); ?></a></span>\n\t</div>\n</div>\n\t<?php\n}\n\n/**\n * Outputs a post's public meta data in the Custom Fields meta box.\n *\n * @since 1.2.0\n *\n * @param array $meta\n */\nfunction list_meta( $meta ) {\n\t// Exit if no meta.\n\tif ( ! $meta ) {\n\t\techo '\n<table id=\"list-table\" style=\"display: none;\">\n\t<thead>\n\t<tr>\n\t\t<th class=\"left\">' . _x( 'Name', 'meta name' ) . '</th>\n\t\t<th>' . __( 'Value' ) . '</th>\n\t</tr>\n\t</thead>\n\t<tbody id=\"the-list\" data-wp-lists=\"list:meta\">\n\t<tr><td></td></tr>\n\t</tbody>\n</table>'; // TBODY needed for list-manipulation JS.\n\t\treturn;\n\t}\n\t$count = 0;\n\t?>\n<table id=\"list-table\">\n\t<thead>\n\t<tr>\n\t\t<th class=\"left\"><?php _ex( 'Name', 'meta name' ); ?></th>\n\t\t<th><?php _e( 'Value' ); ?></th>\n\t</tr>\n\t</thead>\n\t<tbody id='the-list' data-wp-lists='list:meta'>\n\t<?php\n\tforeach ( $meta as $entry ) {\n\t\techo _list_meta_row( $entry, $count );\n\t}\n\t?>\n\t</tbody>\n</table>\n\t<?php\n}\n\n/**\n * Outputs a single row of public meta data in the Custom Fields meta box.\n *\n * @since 2.5.0\n *\n * @param array $entry\n * @param int   $count\n * @return string\n */\nfunction _list_meta_row( $entry, &$count ) {\n\tstatic $update_nonce = '';\n\n\tif ( is_protected_meta( $entry['meta_key'], 'post' ) ) {\n\t\treturn '';\n\t}\n\n\tif ( ! $update_nonce ) {\n\t\t$update_nonce = wp_create_nonce( 'add-meta' );\n\t}\n\n\t$r = '';\n\t++ $count;\n\n\tif ( is_serialized( $entry['meta_value'] ) ) {\n\t\tif ( is_serialized_string( $entry['meta_value'] ) ) {\n\t\t\t// This is a serialized string, so we should display it.\n\t\t\t$entry['meta_value'] = maybe_unserialize( $entry['meta_value'] );\n\t\t} else {\n\t\t\t// This is a serialized array/object so we should NOT display it.\n\t\t\t--$count;\n\t\t\treturn '';\n\t\t}\n\t}\n\n\t$entry['meta_key']   = esc_attr( $entry['meta_key'] );\n\t$entry['meta_value'] = esc_textarea( $entry['meta_value'] ); // Using a <textarea />.\n\t$entry['meta_id']    = (int) $entry['meta_id'];\n\n\t$delete_nonce = wp_create_nonce( 'delete-meta_' . $entry['meta_id'] );\n\n\t$r .= \"\\n\\t<tr id='meta-{$entry['meta_id']}'>\";\n\t$r .= \"\\n\\t\\t<td class='left'><label class='screen-reader-text' for='meta-{$entry['meta_id']}-key'>\" . __( 'Key' ) . \"</label><input name='meta[{$entry['meta_id']}][key]' id='meta-{$entry['meta_id']}-key' type='text' size='20' value='{$entry['meta_key']}' />\";\n\n\t$r .= \"\\n\\t\\t<div class='submit'>\";\n\t$r .= get_submit_button( __( 'Delete' ), 'deletemeta small', \"deletemeta[{$entry['meta_id']}]\", false, array( 'data-wp-lists' => \"delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce\" ) );\n\t$r .= \"\\n\\t\\t\";\n\t$r .= get_submit_button( __( 'Update' ), 'updatemeta small', \"meta-{$entry['meta_id']}-submit\", false, array( 'data-wp-lists' => \"add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce\" ) );\n\t$r .= '</div>';\n\t$r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false );\n\t$r .= '</td>';\n\n\t$r .= \"\\n\\t\\t<td><label class='screen-reader-text' for='meta-{$entry['meta_id']}-value'>\" . __( 'Value' ) . \"</label><textarea name='meta[{$entry['meta_id']}][value]' id='meta-{$entry['meta_id']}-value' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>\\n\\t</tr>\";\n\treturn $r;\n}\n\n/**\n * Prints the form in the Custom Fields meta box.\n *\n * @since 1.2.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param WP_Post $post Optional. The post being edited.\n */\nfunction meta_form( $post = null ) {\n\tglobal $wpdb;\n\t$post = get_post( $post );\n\n\t/**\n\t * Filters values for the meta key dropdown in the Custom Fields meta box.\n\t *\n\t * Returning a non-null value will effectively short-circuit and avoid a\n\t * potentially expensive query against postmeta.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array|null $keys Pre-defined meta keys to be used in place of a postmeta query. Default null.\n\t * @param WP_Post    $post The current post object.\n\t */\n\t$keys = apply_filters( 'postmeta_form_keys', null, $post );\n\n\tif ( null === $keys ) {\n\t\t/**\n\t\t * Filters the number of custom fields to retrieve for the drop-down\n\t\t * in the Custom Fields meta box.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param int $limit Number of custom fields to retrieve. Default 30.\n\t\t */\n\t\t$limit = apply_filters( 'postmeta_form_limit', 30 );\n\n\t\t$keys = $wpdb->get_col(\n\t\t\t$wpdb->prepare(\n\t\t\t\t\"SELECT DISTINCT meta_key\n\t\t\t\tFROM $wpdb->postmeta\n\t\t\t\tWHERE meta_key NOT BETWEEN '_' AND '_z'\n\t\t\t\tHAVING meta_key NOT LIKE %s\n\t\t\t\tORDER BY meta_key\n\t\t\t\tLIMIT %d\",\n\t\t\t\t$wpdb->esc_like( '_' ) . '%',\n\t\t\t\t$limit\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( $keys ) {\n\t\tnatcasesort( $keys );\n\t\t$meta_key_input_id = 'metakeyselect';\n\t} else {\n\t\t$meta_key_input_id = 'metakeyinput';\n\t}\n\t?>\n<p><strong><?php _e( 'Add New Custom Field:' ); ?></strong></p>\n<table id=\"newmeta\">\n<thead>\n<tr>\n<th class=\"left\"><label for=\"<?php echo $meta_key_input_id; ?>\"><?php _ex( 'Name', 'meta name' ); ?></label></th>\n<th><label for=\"metavalue\"><?php _e( 'Value' ); ?></label></th>\n</tr>\n</thead>\n\n<tbody>\n<tr>\n<td id=\"newmetaleft\" class=\"left\">\n\t<?php if ( $keys ) { ?>\n<select id=\"metakeyselect\" name=\"metakeyselect\">\n<option value=\"#NONE#\"><?php _e( '&mdash; Select &mdash;' ); ?></option>\n\t\t<?php\n\t\tforeach ( $keys as $key ) {\n\t\t\tif ( is_protected_meta( $key, 'post' ) || ! current_user_can( 'add_post_meta', $post->ID, $key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\techo \"\\n<option value='\" . esc_attr( $key ) . \"'>\" . esc_html( $key ) . '</option>';\n\t\t}\n\t\t?>\n</select>\n<input class=\"hide-if-js\" type=\"text\" id=\"metakeyinput\" name=\"metakeyinput\" value=\"\" />\n<a href=\"#postcustomstuff\" class=\"hide-if-no-js\" onclick=\"jQuery('#metakeyinput, #metakeyselect, #enternew, #cancelnew').toggle();return false;\">\n<span id=\"enternew\"><?php _e( 'Enter new' ); ?></span>\n<span id=\"cancelnew\" class=\"hidden\"><?php _e( 'Cancel' ); ?></span></a>\n<?php } else { ?>\n<input type=\"text\" id=\"metakeyinput\" name=\"metakeyinput\" value=\"\" />\n<?php } ?>\n</td>\n<td><textarea id=\"metavalue\" name=\"metavalue\" rows=\"2\" cols=\"25\"></textarea></td>\n</tr>\n\n<tr><td colspan=\"2\">\n<div class=\"submit\">\n\t<?php\n\tsubmit_button(\n\t\t__( 'Add Custom Field' ),\n\t\t'',\n\t\t'addmeta',\n\t\tfalse,\n\t\tarray(\n\t\t\t'id'            => 'newmeta-submit',\n\t\t\t'data-wp-lists' => 'add:the-list:newmeta',\n\t\t)\n\t);\n\t?>\n</div>\n\t<?php wp_nonce_field( 'add-meta', '_ajax_nonce-add-meta', false ); ?>\n</td></tr>\n</tbody>\n</table>\n\t<?php\n\n}\n\n/**\n * Print out HTML form date elements for editing post or comment publish date.\n *\n * @since 0.71\n * @since 4.4.0 Converted to use get_comment() instead of the global `$comment`.\n *\n * @global WP_Locale $wp_locale WordPress date and time locale object.\n *\n * @param int|bool $edit      Accepts 1|true for editing the date, 0|false for adding the date.\n * @param int|bool $for_post  Accepts 1|true for applying the date to a post, 0|false for a comment.\n * @param int      $tab_index The tabindex attribute to add. Default 0.\n * @param int|bool $multi     Optional. Whether the additional fields and buttons should be added.\n *                            Default 0|false.\n */\nfunction touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {\n\tglobal $wp_locale;\n\t$post = get_post();\n\n\tif ( $for_post ) {\n\t\t$edit = ! ( in_array( $post->post_status, array( 'draft', 'pending' ), true ) && ( ! $post->post_date_gmt || '0000-00-00 00:00:00' === $post->post_date_gmt ) );\n\t}\n\n\t$tab_index_attribute = '';\n\tif ( (int) $tab_index > 0 ) {\n\t\t$tab_index_attribute = \" tabindex=\\\"$tab_index\\\"\";\n\t}\n\n\t// @todo Remove this?\n\t// echo '<label for=\"timestamp\" style=\"display: block;\"><input type=\"checkbox\" class=\"checkbox\" name=\"edit_date\" value=\"1\" id=\"timestamp\"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';\n\n\t$post_date = ( $for_post ) ? $post->post_date : get_comment()->comment_date;\n\t$jj        = ( $edit ) ? mysql2date( 'd', $post_date, false ) : current_time( 'd' );\n\t$mm        = ( $edit ) ? mysql2date( 'm', $post_date, false ) : current_time( 'm' );\n\t$aa        = ( $edit ) ? mysql2date( 'Y', $post_date, false ) : current_time( 'Y' );\n\t$hh        = ( $edit ) ? mysql2date( 'H', $post_date, false ) : current_time( 'H' );\n\t$mn        = ( $edit ) ? mysql2date( 'i', $post_date, false ) : current_time( 'i' );\n\t$ss        = ( $edit ) ? mysql2date( 's', $post_date, false ) : current_time( 's' );\n\n\t$cur_jj = current_time( 'd' );\n\t$cur_mm = current_time( 'm' );\n\t$cur_aa = current_time( 'Y' );\n\t$cur_hh = current_time( 'H' );\n\t$cur_mn = current_time( 'i' );\n\n\t$month = '<label><span class=\"screen-reader-text\">' . __( 'Month' ) . '</span><select ' . ( $multi ? '' : 'id=\"mm\" ' ) . 'name=\"mm\"' . $tab_index_attribute . \">\\n\";\n\tfor ( $i = 1; $i < 13; $i = $i + 1 ) {\n\t\t$monthnum  = zeroise( $i, 2 );\n\t\t$monthtext = $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) );\n\t\t$month    .= \"\\t\\t\\t\" . '<option value=\"' . $monthnum . '\" data-text=\"' . $monthtext . '\" ' . selected( $monthnum, $mm, false ) . '>';\n\t\t/* translators: 1: Month number (01, 02, etc.), 2: Month abbreviation. */\n\t\t$month .= sprintf( __( '%1$s-%2$s' ), $monthnum, $monthtext ) . \"</option>\\n\";\n\t}\n\t$month .= '</select></label>';\n\n\t$day    = '<label><span class=\"screen-reader-text\">' . __( 'Day' ) . '</span><input type=\"text\" ' . ( $multi ? '' : 'id=\"jj\" ' ) . 'name=\"jj\" value=\"' . $jj . '\" size=\"2\" maxlength=\"2\"' . $tab_index_attribute . ' autocomplete=\"off\" /></label>';\n\t$year   = '<label><span class=\"screen-reader-text\">' . __( 'Year' ) . '</span><input type=\"text\" ' . ( $multi ? '' : 'id=\"aa\" ' ) . 'name=\"aa\" value=\"' . $aa . '\" size=\"4\" maxlength=\"4\"' . $tab_index_attribute . ' autocomplete=\"off\" /></label>';\n\t$hour   = '<label><span class=\"screen-reader-text\">' . __( 'Hour' ) . '</span><input type=\"text\" ' . ( $multi ? '' : 'id=\"hh\" ' ) . 'name=\"hh\" value=\"' . $hh . '\" size=\"2\" maxlength=\"2\"' . $tab_index_attribute . ' autocomplete=\"off\" /></label>';\n\t$minute = '<label><span class=\"screen-reader-text\">' . __( 'Minute' ) . '</span><input type=\"text\" ' . ( $multi ? '' : 'id=\"mn\" ' ) . 'name=\"mn\" value=\"' . $mn . '\" size=\"2\" maxlength=\"2\"' . $tab_index_attribute . ' autocomplete=\"off\" /></label>';\n\n\techo '<div class=\"timestamp-wrap\">';\n\t/* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */\n\tprintf( __( '%1$s %2$s, %3$s at %4$s:%5$s' ), $month, $day, $year, $hour, $minute );\n\n\techo '</div><input type=\"hidden\" id=\"ss\" name=\"ss\" value=\"' . $ss . '\" />';\n\n\tif ( $multi ) {\n\t\treturn;\n\t}\n\n\techo \"\\n\\n\";\n\n\t$map = array(\n\t\t'mm' => array( $mm, $cur_mm ),\n\t\t'jj' => array( $jj, $cur_jj ),\n\t\t'aa' => array( $aa, $cur_aa ),\n\t\t'hh' => array( $hh, $cur_hh ),\n\t\t'mn' => array( $mn, $cur_mn ),\n\t);\n\n\tforeach ( $map as $timeunit => $value ) {\n\t\tlist( $unit, $curr ) = $value;\n\n\t\techo '<input type=\"hidden\" id=\"hidden_' . $timeunit . '\" name=\"hidden_' . $timeunit . '\" value=\"' . $unit . '\" />' . \"\\n\";\n\t\t$cur_timeunit = 'cur_' . $timeunit;\n\t\techo '<input type=\"hidden\" id=\"' . $cur_timeunit . '\" name=\"' . $cur_timeunit . '\" value=\"' . $curr . '\" />' . \"\\n\";\n\t}\n\t?>\n\n<p>\n<a href=\"#edit_timestamp\" class=\"save-timestamp hide-if-no-js button\"><?php _e( 'OK' ); ?></a>\n<a href=\"#edit_timestamp\" class=\"cancel-timestamp hide-if-no-js button-cancel\"><?php _e( 'Cancel' ); ?></a>\n</p>\n\t<?php\n}\n\n/**\n * Print out option HTML elements for the page templates drop-down.\n *\n * @since 1.5.0\n * @since 4.7.0 Added the `$post_type` parameter.\n *\n * @param string $default   Optional. The template file name. Default empty.\n * @param string $post_type Optional. Post type to get templates for. Default 'post'.\n */\nfunction page_template_dropdown( $default = '', $post_type = 'page' ) {\n\t$templates = get_page_templates( null, $post_type );\n\n\tksort( $templates );\n\n\tforeach ( array_keys( $templates ) as $template ) {\n\t\t$selected = selected( $default, $templates[ $template ], false );\n\t\techo \"\\n\\t<option value='\" . esc_attr( $templates[ $template ] ) . \"' $selected>\" . esc_html( $template ) . '</option>';\n\t}\n}\n\n/**\n * Print out option HTML elements for the page parents drop-down.\n *\n * @since 1.5.0\n * @since 4.4.0 `$post` argument was added.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int         $default Optional. The default page ID to be pre-selected. Default 0.\n * @param int         $parent  Optional. The parent page ID. Default 0.\n * @param int         $level   Optional. Page depth level. Default 0.\n * @param int|WP_Post $post    Post ID or WP_Post object.\n * @return void|false Void on success, false if the page has no children.\n */\nfunction parent_dropdown( $default = 0, $parent = 0, $level = 0, $post = null ) {\n\tglobal $wpdb;\n\n\t$post  = get_post( $post );\n\t$items = $wpdb->get_results( $wpdb->prepare( \"SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order\", $parent ) );\n\n\tif ( $items ) {\n\t\tforeach ( $items as $item ) {\n\t\t\t// A page cannot be its own parent.\n\t\t\tif ( $post && $post->ID && (int) $item->ID === $post->ID ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$pad      = str_repeat( '&nbsp;', $level * 3 );\n\t\t\t$selected = selected( $default, $item->ID, false );\n\n\t\t\techo \"\\n\\t<option class='level-$level' value='$item->ID' $selected>$pad \" . esc_html( $item->post_title ) . '</option>';\n\t\t\tparent_dropdown( $default, $item->ID, $level + 1 );\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\n}\n\n/**\n * Print out option HTML elements for role selectors.\n *\n * @since 2.1.0\n *\n * @param string $selected Slug for the role that should be already selected.\n */\nfunction wp_dropdown_roles( $selected = '' ) {\n\t$r = '';\n\n\t$editable_roles = array_reverse( get_editable_roles() );\n\n\tforeach ( $editable_roles as $role => $details ) {\n\t\t$name = translate_user_role( $details['name'] );\n\t\t// Preselect specified role.\n\t\tif ( $selected === $role ) {\n\t\t\t$r .= \"\\n\\t<option selected='selected' value='\" . esc_attr( $role ) . \"'>$name</option>\";\n\t\t} else {\n\t\t\t$r .= \"\\n\\t<option value='\" . esc_attr( $role ) . \"'>$name</option>\";\n\t\t}\n\t}\n\n\techo $r;\n}\n\n/**\n * Outputs the form used by the importers to accept the data to be imported\n *\n * @since 2.0.0\n *\n * @param string $action The action attribute for the form.\n */\nfunction wp_import_upload_form( $action ) {\n\n\t/**\n\t * Filters the maximum allowed upload size for import files.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @see wp_max_upload_size()\n\t *\n\t * @param int $max_upload_size Allowed upload size. Default 1 MB.\n\t */\n\t$bytes      = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );\n\t$size       = size_format( $bytes );\n\t$upload_dir = wp_upload_dir();\n\tif ( ! empty( $upload_dir['error'] ) ) :\n\t\t?>\n\t\t<div class=\"error\"><p><?php _e( 'Before you can upload your import file, you will need to fix the following error:' ); ?></p>\n\t\t<p><strong><?php echo $upload_dir['error']; ?></strong></p></div>\n\t\t\t\t\t\t\t\t<?php\n\telse :\n\t\t?>\n<form enctype=\"multipart/form-data\" id=\"import-upload-form\" method=\"post\" class=\"wp-upload-form\" action=\"<?php echo esc_url( wp_nonce_url( $action, 'import-upload' ) ); ?>\">\n<p>\n\t\t<?php\n\t\tprintf(\n\t\t\t'<label for=\"upload\">%s</label> (%s)',\n\t\t\t__( 'Choose a file from your computer:' ),\n\t\t\t/* translators: %s: Maximum allowed file size. */\n\t\t\tsprintf( __( 'Maximum size: %s' ), $size )\n\t\t);\n\t\t?>\n<input type=\"file\" id=\"upload\" name=\"import\" size=\"25\" />\n<input type=\"hidden\" name=\"action\" value=\"save\" />\n<input type=\"hidden\" name=\"max_file_size\" value=\"<?php echo $bytes; ?>\" />\n</p>\n\t\t<?php submit_button( __( 'Upload file and import' ), 'primary' ); ?>\n</form>\n\t\t<?php\n\tendif;\n}\n\n/**\n * Adds a meta box to one or more screens.\n *\n * @since 2.5.0\n * @since 4.4.0 The `$screen` parameter now accepts an array of screen IDs.\n *\n * @global array $wp_meta_boxes\n *\n * @param string                 $id            Meta box ID (used in the 'id' attribute for the meta box).\n * @param string                 $title         Title of the meta box.\n * @param callable               $callback      Function that fills the box with the desired content.\n *                                              The function should echo its output.\n * @param string|array|WP_Screen $screen        Optional. The screen or screens on which to show the box\n *                                              (such as a post type, 'link', or 'comment'). Accepts a single\n *                                              screen ID, WP_Screen object, or array of screen IDs. Default\n *                                              is the current screen.  If you have used add_menu_page() or\n *                                              add_submenu_page() to create a new screen (and hence screen_id),\n *                                              make sure your menu slug conforms to the limits of sanitize_key()\n *                                              otherwise the 'screen' menu may not correctly render on your page.\n * @param string                 $context       Optional. The context within the screen where the boxes\n *                                              should display. Available contexts vary from screen to\n *                                              screen. Post edit screen contexts include 'normal', 'side',\n *                                              and 'advanced'. Comments screen contexts include 'normal'\n *                                              and 'side'. Menus meta boxes (accordion sections) all use\n *                                              the 'side' context. Global default is 'advanced'.\n * @param string                 $priority      Optional. The priority within the context where the boxes\n *                                              should show ('high', 'low'). Default 'default'.\n * @param array                  $callback_args Optional. Data that should be set as the $args property\n *                                              of the box array (which is the second parameter passed\n *                                              to your callback). Default null.\n */\nfunction add_meta_box( $id, $title, $callback, $screen = null, $context = 'advanced', $priority = 'default', $callback_args = null ) {\n\tglobal $wp_meta_boxes;\n\n\tif ( empty( $screen ) ) {\n\t\t$screen = get_current_screen();\n\t} elseif ( is_string( $screen ) ) {\n\t\t$screen = convert_to_screen( $screen );\n\t} elseif ( is_array( $screen ) ) {\n\t\tforeach ( $screen as $single_screen ) {\n\t\t\tadd_meta_box( $id, $title, $callback, $single_screen, $context, $priority, $callback_args );\n\t\t}\n\t}\n\n\tif ( ! isset( $screen->id ) ) {\n\t\treturn;\n\t}\n\n\t$page = $screen->id;\n\n\tif ( ! isset( $wp_meta_boxes ) ) {\n\t\t$wp_meta_boxes = array();\n\t}\n\tif ( ! isset( $wp_meta_boxes[ $page ] ) ) {\n\t\t$wp_meta_boxes[ $page ] = array();\n\t}\n\tif ( ! isset( $wp_meta_boxes[ $page ][ $context ] ) ) {\n\t\t$wp_meta_boxes[ $page ][ $context ] = array();\n\t}\n\n\tforeach ( array_keys( $wp_meta_boxes[ $page ] ) as $a_context ) {\n\t\tforeach ( array( 'high', 'core', 'default', 'low' ) as $a_priority ) {\n\t\t\tif ( ! isset( $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If a core box was previously removed, don't add.\n\t\t\tif ( ( 'core' === $priority || 'sorted' === $priority )\n\t\t\t\t&& false === $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ]\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a core box was previously added by a plugin, don't add.\n\t\t\tif ( 'core' === $priority ) {\n\t\t\t\t/*\n\t\t\t\t * If the box was added with default priority, give it core priority\n\t\t\t\t * to maintain sort order.\n\t\t\t\t */\n\t\t\t\tif ( 'default' === $a_priority ) {\n\t\t\t\t\t$wp_meta_boxes[ $page ][ $a_context ]['core'][ $id ] = $wp_meta_boxes[ $page ][ $a_context ]['default'][ $id ];\n\t\t\t\t\tunset( $wp_meta_boxes[ $page ][ $a_context ]['default'][ $id ] );\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If no priority given and ID already present, use existing priority.\n\t\t\tif ( empty( $priority ) ) {\n\t\t\t\t$priority = $a_priority;\n\t\t\t\t/*\n\t\t\t\t * Else, if we're adding to the sorted priority, we don't know the title\n\t\t\t\t * or callback. Grab them from the previously added context/priority.\n\t\t\t\t */\n\t\t\t} elseif ( 'sorted' === $priority ) {\n\t\t\t\t$title         = $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ]['title'];\n\t\t\t\t$callback      = $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ]['callback'];\n\t\t\t\t$callback_args = $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ]['args'];\n\t\t\t}\n\n\t\t\t// An ID can be in only one priority and one context.\n\t\t\tif ( $priority !== $a_priority || $context !== $a_context ) {\n\t\t\t\tunset( $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ] );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( empty( $priority ) ) {\n\t\t$priority = 'low';\n\t}\n\n\tif ( ! isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {\n\t\t$wp_meta_boxes[ $page ][ $context ][ $priority ] = array();\n\t}\n\n\t$wp_meta_boxes[ $page ][ $context ][ $priority ][ $id ] = array(\n\t\t'id'       => $id,\n\t\t'title'    => $title,\n\t\t'callback' => $callback,\n\t\t'args'     => $callback_args,\n\t);\n}\n\n\n/**\n * Function that renders a \"fake\" meta box with an information message,\n * shown on the block editor, when an incompatible meta box is found.\n *\n * @since 5.0.0\n *\n * @param mixed $object The data object being rendered on this screen.\n * @param array $box    {\n *     Custom formats meta box arguments.\n *\n *     @type string   $id           Meta box 'id' attribute.\n *     @type string   $title        Meta box title.\n *     @type callable $old_callback The original callback for this meta box.\n *     @type array    $args         Extra meta box arguments.\n * }\n */\nfunction do_block_editor_incompatible_meta_box( $object, $box ) {\n\t$plugin  = _get_plugin_from_callback( $box['old_callback'] );\n\t$plugins = get_plugins();\n\techo '<p>';\n\tif ( $plugin ) {\n\t\t/* translators: %s: The name of the plugin that generated this meta box. */\n\t\tprintf( __( \"This meta box, from the %s plugin, isn't compatible with the block editor.\" ), \"<strong>{$plugin['Name']}</strong>\" );\n\t} else {\n\t\t_e( \"This meta box isn't compatible with the block editor.\" );\n\t}\n\techo '</p>';\n\n\tif ( empty( $plugins['classic-editor/classic-editor.php'] ) ) {\n\t\tif ( current_user_can( 'install_plugins' ) ) {\n\t\t\techo '<p>';\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: A link to install the Classic Editor plugin. */\n\t\t\t\t__( 'Please install the <a href=\"%s\">Classic Editor plugin</a> to use this meta box.' ),\n\t\t\t\tesc_url( wp_nonce_url( self_admin_url( 'plugin-install.php?tab=favorites&user=wordpressdotorg&save=0' ), 'save_wporg_username_' . get_current_user_id() ) )\n\t\t\t);\n\t\t\techo '</p>';\n\t\t}\n\t} elseif ( is_plugin_inactive( 'classic-editor/classic-editor.php' ) ) {\n\t\tif ( current_user_can( 'activate_plugins' ) ) {\n\t\t\t$activate_url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=classic-editor/classic-editor.php' ), 'activate-plugin_classic-editor/classic-editor.php' );\n\t\t\techo '<p>';\n\t\t\t/* translators: %s: A link to activate the Classic Editor plugin. */\n\t\t\tprintf( __( 'Please activate the <a href=\"%s\">Classic Editor plugin</a> to use this meta box.' ), esc_url( $activate_url ) );\n\t\t\techo '</p>';\n\t\t}\n\t} elseif ( $object instanceof WP_Post ) {\n\t\t$edit_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'classic-editor'         => '',\n\t\t\t\t'classic-editor__forget' => '',\n\t\t\t),\n\t\t\tget_edit_post_link( $object )\n\t\t);\n\t\techo '<p>';\n\t\t/* translators: %s: A link to use the Classic Editor plugin. */\n\t\tprintf( __( 'Please open the <a href=\"%s\">classic editor</a> to use this meta box.' ), esc_url( $edit_url ) );\n\t\techo '</p>';\n\t}\n}\n\n/**\n * Internal helper function to find the plugin from a meta box callback.\n *\n * @since 5.0.0\n *\n * @access private\n *\n * @param callable $callback The callback function to check.\n * @return array|null The plugin that the callback belongs to, or null if it doesn't belong to a plugin.\n */\nfunction _get_plugin_from_callback( $callback ) {\n\ttry {\n\t\tif ( is_array( $callback ) ) {\n\t\t\t$reflection = new ReflectionMethod( $callback[0], $callback[1] );\n\t\t} elseif ( is_string( $callback ) && false !== strpos( $callback, '::' ) ) {\n\t\t\t$reflection = new ReflectionMethod( $callback );\n\t\t} else {\n\t\t\t$reflection = new ReflectionFunction( $callback );\n\t\t}\n\t} catch ( ReflectionException $exception ) {\n\t\t// We could not properly reflect on the callable, so we abort here.\n\t\treturn null;\n\t}\n\n\t// Don't show an error if it's an internal PHP function.\n\tif ( ! $reflection->isInternal() ) {\n\n\t\t// Only show errors if the meta box was registered by a plugin.\n\t\t$filename   = wp_normalize_path( $reflection->getFileName() );\n\t\t$plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );\n\n\t\tif ( strpos( $filename, $plugin_dir ) === 0 ) {\n\t\t\t$filename = str_replace( $plugin_dir, '', $filename );\n\t\t\t$filename = preg_replace( '|^/([^/]*/).*$|', '\\\\1', $filename );\n\n\t\t\t$plugins = get_plugins();\n\n\t\t\tforeach ( $plugins as $name => $plugin ) {\n\t\t\t\tif ( strpos( $name, $filename ) === 0 ) {\n\t\t\t\t\treturn $plugin;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n\n/**\n * Meta-Box template function.\n *\n * @since 2.5.0\n *\n * @global array $wp_meta_boxes\n *\n * @param string|WP_Screen $screen  The screen identifier. If you have used add_menu_page() or\n *                                  add_submenu_page() to create a new screen (and hence screen_id)\n *                                  make sure your menu slug conforms to the limits of sanitize_key()\n *                                  otherwise the 'screen' menu may not correctly render on your page.\n * @param string           $context The screen context for which to display meta boxes.\n * @param mixed            $object  Gets passed to the meta box callback function as the first parameter.\n *                                  Often this is the object that's the focus of the current screen, for\n *                                  example a `WP_Post` or `WP_Comment` object.\n * @return int Number of meta_boxes.\n */\nfunction do_meta_boxes( $screen, $context, $object ) {\n\tglobal $wp_meta_boxes;\n\tstatic $already_sorted = false;\n\n\tif ( empty( $screen ) ) {\n\t\t$screen = get_current_screen();\n\t} elseif ( is_string( $screen ) ) {\n\t\t$screen = convert_to_screen( $screen );\n\t}\n\n\t$page = $screen->id;\n\n\t$hidden = get_hidden_meta_boxes( $screen );\n\n\tprintf( '<div id=\"%s-sortables\" class=\"meta-box-sortables\">', esc_attr( $context ) );\n\n\t// Grab the ones the user has manually sorted.\n\t// Pull them out of their previous context/priority and into the one the user chose.\n\t$sorted = get_user_option( \"meta-box-order_$page\" );\n\n\tif ( ! $already_sorted && $sorted ) {\n\t\tforeach ( $sorted as $box_context => $ids ) {\n\t\t\tforeach ( explode( ',', $ids ) as $id ) {\n\t\t\t\tif ( $id && 'dashboard_browser_nag' !== $id ) {\n\t\t\t\t\tadd_meta_box( $id, null, null, $screen, $box_context, 'sorted' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t$already_sorted = true;\n\n\t$i = 0;\n\n\tif ( isset( $wp_meta_boxes[ $page ][ $context ] ) ) {\n\t\tforeach ( array( 'high', 'sorted', 'core', 'default', 'low' ) as $priority ) {\n\t\t\tif ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {\n\t\t\t\tforeach ( (array) $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {\n\t\t\t\t\tif ( false === $box || ! $box['title'] ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$block_compatible = true;\n\t\t\t\t\tif ( is_array( $box['args'] ) ) {\n\t\t\t\t\t\t// If a meta box is just here for back compat, don't show it in the block editor.\n\t\t\t\t\t\tif ( $screen->is_block_editor() && isset( $box['args']['__back_compat_meta_box'] ) && $box['args']['__back_compat_meta_box'] ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( isset( $box['args']['__block_editor_compatible_meta_box'] ) ) {\n\t\t\t\t\t\t\t$block_compatible = (bool) $box['args']['__block_editor_compatible_meta_box'];\n\t\t\t\t\t\t\tunset( $box['args']['__block_editor_compatible_meta_box'] );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If the meta box is declared as incompatible with the block editor, override the callback function.\n\t\t\t\t\t\tif ( ! $block_compatible && $screen->is_block_editor() ) {\n\t\t\t\t\t\t\t$box['old_callback'] = $box['callback'];\n\t\t\t\t\t\t\t$box['callback']     = 'do_block_editor_incompatible_meta_box';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( isset( $box['args']['__back_compat_meta_box'] ) ) {\n\t\t\t\t\t\t\t$block_compatible = $block_compatible || (bool) $box['args']['__back_compat_meta_box'];\n\t\t\t\t\t\t\tunset( $box['args']['__back_compat_meta_box'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$i++;\n\t\t\t\t\t// get_hidden_meta_boxes() doesn't apply in the block editor.\n\t\t\t\t\t$hidden_class = ( ! $screen->is_block_editor() && in_array( $box['id'], $hidden, true ) ) ? ' hide-if-js' : '';\n\t\t\t\t\techo '<div id=\"' . $box['id'] . '\" class=\"postbox ' . postbox_classes( $box['id'], $page ) . $hidden_class . '\" ' . '>' . \"\\n\";\n\n\t\t\t\t\techo '<div class=\"postbox-header\">';\n\t\t\t\t\techo '<h2 class=\"hndle\">';\n\t\t\t\t\tif ( 'dashboard_php_nag' === $box['id'] ) {\n\t\t\t\t\t\techo '<span aria-hidden=\"true\" class=\"dashicons dashicons-warning\"></span>';\n\t\t\t\t\t\techo '<span class=\"screen-reader-text\">' . __( 'Warning:' ) . ' </span>';\n\t\t\t\t\t}\n\t\t\t\t\techo \"{$box['title']}\";\n\t\t\t\t\techo \"</h2>\\n\";\n\n\t\t\t\t\tif ( 'dashboard_browser_nag' !== $box['id'] ) {\n\t\t\t\t\t\t$widget_title = $box['title'];\n\n\t\t\t\t\t\tif ( is_array( $box['args'] ) && isset( $box['args']['__widget_basename'] ) ) {\n\t\t\t\t\t\t\t$widget_title = $box['args']['__widget_basename'];\n\t\t\t\t\t\t\t// Do not pass this parameter to the user callback function.\n\t\t\t\t\t\t\tunset( $box['args']['__widget_basename'] );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\techo '<div class=\"handle-actions hide-if-no-js\">';\n\n\t\t\t\t\t\techo '<button type=\"button\" class=\"handle-order-higher\" aria-disabled=\"false\" aria-describedby=\"' . $box['id'] . '-handle-order-higher-description\">';\n\t\t\t\t\t\techo '<span class=\"screen-reader-text\">' . __( 'Move up' ) . '</span>';\n\t\t\t\t\t\techo '<span class=\"order-higher-indicator\" aria-hidden=\"true\"></span>';\n\t\t\t\t\t\techo '</button>';\n\t\t\t\t\t\techo '<span class=\"hidden\" id=\"' . $box['id'] . '-handle-order-higher-description\">' . sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Meta box title. */\n\t\t\t\t\t\t\t__( 'Move %s box up' ),\n\t\t\t\t\t\t\t$widget_title\n\t\t\t\t\t\t) . '</span>';\n\n\t\t\t\t\t\techo '<button type=\"button\" class=\"handle-order-lower\" aria-disabled=\"false\" aria-describedby=\"' . $box['id'] . '-handle-order-lower-description\">';\n\t\t\t\t\t\techo '<span class=\"screen-reader-text\">' . __( 'Move down' ) . '</span>';\n\t\t\t\t\t\techo '<span class=\"order-lower-indicator\" aria-hidden=\"true\"></span>';\n\t\t\t\t\t\techo '</button>';\n\t\t\t\t\t\techo '<span class=\"hidden\" id=\"' . $box['id'] . '-handle-order-lower-description\">' . sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Meta box title. */\n\t\t\t\t\t\t\t__( 'Move %s box down' ),\n\t\t\t\t\t\t\t$widget_title\n\t\t\t\t\t\t) . '</span>';\n\n\t\t\t\t\t\techo '<button type=\"button\" class=\"handlediv\" aria-expanded=\"true\">';\n\t\t\t\t\t\techo '<span class=\"screen-reader-text\">' . sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Meta box title. */\n\t\t\t\t\t\t\t__( 'Toggle panel: %s' ),\n\t\t\t\t\t\t\t$widget_title\n\t\t\t\t\t\t) . '</span>';\n\t\t\t\t\t\techo '<span class=\"toggle-indicator\" aria-hidden=\"true\"></span>';\n\t\t\t\t\t\techo '</button>';\n\n\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t}\n\t\t\t\t\techo '</div>';\n\n\t\t\t\t\techo '<div class=\"inside\">' . \"\\n\";\n\n\t\t\t\t\tif ( WP_DEBUG && ! $block_compatible && 'edit' === $screen->parent_base && ! $screen->is_block_editor() && ! isset( $_GET['meta-box-loader'] ) ) {\n\t\t\t\t\t\t$plugin = _get_plugin_from_callback( $box['callback'] );\n\t\t\t\t\t\tif ( $plugin ) {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<div class=\"error inline\">\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: The name of the plugin that generated this meta box. */\n\t\t\t\t\t\t\t\t\t\tprintf( __( \"This meta box, from the %s plugin, isn't compatible with the block editor.\" ), \"<strong>{$plugin['Name']}</strong>\" );\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcall_user_func( $box['callback'], $object, $box );\n\t\t\t\t\techo \"</div>\\n\";\n\t\t\t\t\techo \"</div>\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\techo '</div>';\n\n\treturn $i;\n\n}\n\n/**\n * Removes a meta box from one or more screens.\n *\n * @since 2.6.0\n * @since 4.4.0 The `$screen` parameter now accepts an array of screen IDs.\n *\n * @global array $wp_meta_boxes\n *\n * @param string                 $id      Meta box ID (used in the 'id' attribute for the meta box).\n * @param string|array|WP_Screen $screen  The screen or screens on which the meta box is shown (such as a\n *                                        post type, 'link', or 'comment'). Accepts a single screen ID,\n *                                        WP_Screen object, or array of screen IDs.\n * @param string                 $context The context within the screen where the box is set to display.\n *                                        Contexts vary from screen to screen. Post edit screen contexts\n *                                        include 'normal', 'side', and 'advanced'. Comments screen contexts\n *                                        include 'normal' and 'side'. Menus meta boxes (accordion sections)\n *                                        all use the 'side' context.\n */\nfunction remove_meta_box( $id, $screen, $context ) {\n\tglobal $wp_meta_boxes;\n\n\tif ( empty( $screen ) ) {\n\t\t$screen = get_current_screen();\n\t} elseif ( is_string( $screen ) ) {\n\t\t$screen = convert_to_screen( $screen );\n\t} elseif ( is_array( $screen ) ) {\n\t\tforeach ( $screen as $single_screen ) {\n\t\t\tremove_meta_box( $id, $single_screen, $context );\n\t\t}\n\t}\n\n\tif ( ! isset( $screen->id ) ) {\n\t\treturn;\n\t}\n\n\t$page = $screen->id;\n\n\tif ( ! isset( $wp_meta_boxes ) ) {\n\t\t$wp_meta_boxes = array();\n\t}\n\tif ( ! isset( $wp_meta_boxes[ $page ] ) ) {\n\t\t$wp_meta_boxes[ $page ] = array();\n\t}\n\tif ( ! isset( $wp_meta_boxes[ $page ][ $context ] ) ) {\n\t\t$wp_meta_boxes[ $page ][ $context ] = array();\n\t}\n\n\tforeach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {\n\t\t$wp_meta_boxes[ $page ][ $context ][ $priority ][ $id ] = false;\n\t}\n}\n\n/**\n * Meta Box Accordion Template Function.\n *\n * Largely made up of abstracted code from do_meta_boxes(), this\n * function serves to build meta boxes as list items for display as\n * a collapsible accordion.\n *\n * @since 3.6.0\n *\n * @uses global $wp_meta_boxes Used to retrieve registered meta boxes.\n *\n * @param string|object $screen  The screen identifier.\n * @param string        $context The screen context for which to display accordion sections.\n * @param mixed         $object  Gets passed to the section callback function as the first parameter.\n * @return int Number of meta boxes as accordion sections.\n */\nfunction do_accordion_sections( $screen, $context, $object ) {\n\tglobal $wp_meta_boxes;\n\n\twp_enqueue_script( 'accordion' );\n\n\tif ( empty( $screen ) ) {\n\t\t$screen = get_current_screen();\n\t} elseif ( is_string( $screen ) ) {\n\t\t$screen = convert_to_screen( $screen );\n\t}\n\n\t$page = $screen->id;\n\n\t$hidden = get_hidden_meta_boxes( $screen );\n\t?>\n\t<div id=\"side-sortables\" class=\"accordion-container\">\n\t\t<ul class=\"outer-border\">\n\t<?php\n\t$i          = 0;\n\t$first_open = false;\n\n\tif ( isset( $wp_meta_boxes[ $page ][ $context ] ) ) {\n\t\tforeach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {\n\t\t\tif ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {\n\t\t\t\tforeach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {\n\t\t\t\t\tif ( false === $box || ! $box['title'] ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$i++;\n\t\t\t\t\t$hidden_class = in_array( $box['id'], $hidden, true ) ? 'hide-if-js' : '';\n\n\t\t\t\t\t$open_class = '';\n\t\t\t\t\tif ( ! $first_open && empty( $hidden_class ) ) {\n\t\t\t\t\t\t$first_open = true;\n\t\t\t\t\t\t$open_class = 'open';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"control-section accordion-section <?php echo $hidden_class; ?> <?php echo $open_class; ?> <?php echo esc_attr( $box['id'] ); ?>\" id=\"<?php echo esc_attr( $box['id'] ); ?>\">\n\t\t\t\t\t\t<h3 class=\"accordion-section-title hndle\" tabindex=\"0\">\n\t\t\t\t\t\t\t<?php echo esc_html( $box['title'] ); ?>\n\t\t\t\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Press return or enter to open this section' ); ?></span>\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t<div class=\"accordion-section-content <?php postbox_classes( $box['id'], $page ); ?>\">\n\t\t\t\t\t\t\t<div class=\"inside\">\n\t\t\t\t\t\t\t\t<?php call_user_func( $box['callback'], $object, $box ); ?>\n\t\t\t\t\t\t\t</div><!-- .inside -->\n\t\t\t\t\t\t</div><!-- .accordion-section-content -->\n\t\t\t\t\t</li><!-- .accordion-section -->\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t?>\n\t\t</ul><!-- .outer-border -->\n\t</div><!-- .accordion-container -->\n\t<?php\n\treturn $i;\n}\n\n/**\n * Add a new section to a settings page.\n *\n * Part of the Settings API. Use this to define new settings sections for an admin page.\n * Show settings sections in your admin page callback function with do_settings_sections().\n * Add settings fields to your section with add_settings_field().\n *\n * The $callback argument should be the name of a function that echoes out any\n * content you want to show at the top of the settings section before the actual\n * fields. It can output nothing if you want.\n *\n * @since 2.7.0\n *\n * @global array $wp_settings_sections Storage array of all settings sections added to admin pages.\n *\n * @param string   $id       Slug-name to identify the section. Used in the 'id' attribute of tags.\n * @param string   $title    Formatted title of the section. Shown as the heading for the section.\n * @param callable $callback Function that echos out any content at the top of the section (between heading and fields).\n * @param string   $page     The slug-name of the settings page on which to show the section. Built-in pages include\n *                           'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using\n *                           add_options_page();\n */\nfunction add_settings_section( $id, $title, $callback, $page ) {\n\tglobal $wp_settings_sections;\n\n\tif ( 'misc' === $page ) {\n\t\t_deprecated_argument(\n\t\t\t__FUNCTION__,\n\t\t\t'3.0.0',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: misc */\n\t\t\t\t__( 'The \"%s\" options group has been removed. Use another settings group.' ),\n\t\t\t\t'misc'\n\t\t\t)\n\t\t);\n\t\t$page = 'general';\n\t}\n\n\tif ( 'privacy' === $page ) {\n\t\t_deprecated_argument(\n\t\t\t__FUNCTION__,\n\t\t\t'3.5.0',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: privacy */\n\t\t\t\t__( 'The \"%s\" options group has been removed. Use another settings group.' ),\n\t\t\t\t'privacy'\n\t\t\t)\n\t\t);\n\t\t$page = 'reading';\n\t}\n\n\t$wp_settings_sections[ $page ][ $id ] = array(\n\t\t'id'       => $id,\n\t\t'title'    => $title,\n\t\t'callback' => $callback,\n\t);\n}\n\n/**\n * Add a new field to a section of a settings page.\n *\n * Part of the Settings API. Use this to define a settings field that will show\n * as part of a settings section inside a settings page. The fields are shown using\n * do_settings_fields() in do_settings-sections()\n *\n * The $callback argument should be the name of a function that echoes out the\n * HTML input tags for this setting field. Use get_option() to retrieve existing\n * values to show.\n *\n * @since 2.7.0\n * @since 4.2.0 The `$class` argument was added.\n *\n * @global array $wp_settings_fields Storage array of settings fields and info about their pages/sections.\n *\n * @param string   $id       Slug-name to identify the field. Used in the 'id' attribute of tags.\n * @param string   $title    Formatted title of the field. Shown as the label for the field\n *                           during output.\n * @param callable $callback Function that fills the field with the desired form inputs. The\n *                           function should echo its output.\n * @param string   $page     The slug-name of the settings page on which to show the section\n *                           (general, reading, writing, ...).\n * @param string   $section  Optional. The slug-name of the section of the settings page\n *                           in which to show the box. Default 'default'.\n * @param array    $args {\n *     Optional. Extra arguments used when outputting the field.\n *\n *     @type string $label_for When supplied, the setting title will be wrapped\n *                             in a `<label>` element, its `for` attribute populated\n *                             with this value.\n *     @type string $class     CSS Class to be added to the `<tr>` element when the\n *                             field is output.\n * }\n */\nfunction add_settings_field( $id, $title, $callback, $page, $section = 'default', $args = array() ) {\n\tglobal $wp_settings_fields;\n\n\tif ( 'misc' === $page ) {\n\t\t_deprecated_argument(\n\t\t\t__FUNCTION__,\n\t\t\t'3.0.0',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: misc */\n\t\t\t\t__( 'The \"%s\" options group has been removed. Use another settings group.' ),\n\t\t\t\t'misc'\n\t\t\t)\n\t\t);\n\t\t$page = 'general';\n\t}\n\n\tif ( 'privacy' === $page ) {\n\t\t_deprecated_argument(\n\t\t\t__FUNCTION__,\n\t\t\t'3.5.0',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: privacy */\n\t\t\t\t__( 'The \"%s\" options group has been removed. Use another settings group.' ),\n\t\t\t\t'privacy'\n\t\t\t)\n\t\t);\n\t\t$page = 'reading';\n\t}\n\n\t$wp_settings_fields[ $page ][ $section ][ $id ] = array(\n\t\t'id'       => $id,\n\t\t'title'    => $title,\n\t\t'callback' => $callback,\n\t\t'args'     => $args,\n\t);\n}\n\n/**\n * Prints out all settings sections added to a particular settings page\n *\n * Part of the Settings API. Use this in a settings page callback function\n * to output all the sections and fields that were added to that $page with\n * add_settings_section() and add_settings_field()\n *\n * @global array $wp_settings_sections Storage array of all settings sections added to admin pages.\n * @global array $wp_settings_fields Storage array of settings fields and info about their pages/sections.\n * @since 2.7.0\n *\n * @param string $page The slug name of the page whose settings sections you want to output.\n */\nfunction do_settings_sections( $page ) {\n\tglobal $wp_settings_sections, $wp_settings_fields;\n\n\tif ( ! isset( $wp_settings_sections[ $page ] ) ) {\n\t\treturn;\n\t}\n\n\tforeach ( (array) $wp_settings_sections[ $page ] as $section ) {\n\t\tif ( $section['title'] ) {\n\t\t\techo \"<h2>{$section['title']}</h2>\\n\";\n\t\t}\n\n\t\tif ( $section['callback'] ) {\n\t\t\tcall_user_func( $section['callback'], $section );\n\t\t}\n\n\t\tif ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[ $page ] ) || ! isset( $wp_settings_fields[ $page ][ $section['id'] ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\techo '<table class=\"form-table\" role=\"presentation\">';\n\t\tdo_settings_fields( $page, $section['id'] );\n\t\techo '</table>';\n\t}\n}\n\n/**\n * Print out the settings fields for a particular settings section.\n *\n * Part of the Settings API. Use this in a settings page to output\n * a specific section. Should normally be called by do_settings_sections()\n * rather than directly.\n *\n * @global array $wp_settings_fields Storage array of settings fields and their pages/sections.\n *\n * @since 2.7.0\n *\n * @param string $page Slug title of the admin page whose settings fields you want to show.\n * @param string $section Slug title of the settings section whose fields you want to show.\n */\nfunction do_settings_fields( $page, $section ) {\n\tglobal $wp_settings_fields;\n\n\tif ( ! isset( $wp_settings_fields[ $page ][ $section ] ) ) {\n\t\treturn;\n\t}\n\n\tforeach ( (array) $wp_settings_fields[ $page ][ $section ] as $field ) {\n\t\t$class = '';\n\n\t\tif ( ! empty( $field['args']['class'] ) ) {\n\t\t\t$class = ' class=\"' . esc_attr( $field['args']['class'] ) . '\"';\n\t\t}\n\n\t\techo \"<tr{$class}>\";\n\n\t\tif ( ! empty( $field['args']['label_for'] ) ) {\n\t\t\techo '<th scope=\"row\"><label for=\"' . esc_attr( $field['args']['label_for'] ) . '\">' . $field['title'] . '</label></th>';\n\t\t} else {\n\t\t\techo '<th scope=\"row\">' . $field['title'] . '</th>';\n\t\t}\n\n\t\techo '<td>';\n\t\tcall_user_func( $field['callback'], $field['args'] );\n\t\techo '</td>';\n\t\techo '</tr>';\n\t}\n}\n\n/**\n * Register a settings error to be displayed to the user.\n *\n * Part of the Settings API. Use this to show messages to users about settings validation\n * problems, missing settings or anything else.\n *\n * Settings errors should be added inside the $sanitize_callback function defined in\n * register_setting() for a given setting to give feedback about the submission.\n *\n * By default messages will show immediately after the submission that generated the error.\n * Additional calls to settings_errors() can be used to show errors even when the settings\n * page is first accessed.\n *\n * @since 3.0.0\n * @since 5.3.0 Added `warning` and `info` as possible values for `$type`.\n *\n * @global array $wp_settings_errors Storage array of errors registered during this pageload\n *\n * @param string $setting Slug title of the setting to which this error applies.\n * @param string $code    Slug-name to identify the error. Used as part of 'id' attribute in HTML output.\n * @param string $message The formatted message text to display to the user (will be shown inside styled\n *                        `<div>` and `<p>` tags).\n * @param string $type    Optional. Message type, controls HTML class. Possible values include 'error',\n *                        'success', 'warning', 'info'. Default 'error'.\n */\nfunction add_settings_error( $setting, $code, $message, $type = 'error' ) {\n\tglobal $wp_settings_errors;\n\n\t$wp_settings_errors[] = array(\n\t\t'setting' => $setting,\n\t\t'code'    => $code,\n\t\t'message' => $message,\n\t\t'type'    => $type,\n\t);\n}\n\n/**\n * Fetch settings errors registered by add_settings_error().\n *\n * Checks the $wp_settings_errors array for any errors declared during the current\n * pageload and returns them.\n *\n * If changes were just submitted ($_GET['settings-updated']) and settings errors were saved\n * to the 'settings_errors' transient then those errors will be returned instead. This\n * is used to pass errors back across pageloads.\n *\n * Use the $sanitize argument to manually re-sanitize the option before returning errors.\n * This is useful if you have errors or notices you want to show even when the user\n * hasn't submitted data (i.e. when they first load an options page, or in the {@see 'admin_notices'}\n * action hook).\n *\n * @since 3.0.0\n *\n * @global array $wp_settings_errors Storage array of errors registered during this pageload\n *\n * @param string $setting  Optional. Slug title of a specific setting whose errors you want.\n * @param bool   $sanitize Optional. Whether to re-sanitize the setting value before returning errors.\n * @return array Array of settings errors.\n */\nfunction get_settings_errors( $setting = '', $sanitize = false ) {\n\tglobal $wp_settings_errors;\n\n\t/*\n\t * If $sanitize is true, manually re-run the sanitization for this option\n\t * This allows the $sanitize_callback from register_setting() to run, adding\n\t * any settings errors you want to show by default.\n\t */\n\tif ( $sanitize ) {\n\t\tsanitize_option( $setting, get_option( $setting ) );\n\t}\n\n\t// If settings were passed back from options.php then use them.\n\tif ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] && get_transient( 'settings_errors' ) ) {\n\t\t$wp_settings_errors = array_merge( (array) $wp_settings_errors, get_transient( 'settings_errors' ) );\n\t\tdelete_transient( 'settings_errors' );\n\t}\n\n\t// Check global in case errors have been added on this pageload.\n\tif ( empty( $wp_settings_errors ) ) {\n\t\treturn array();\n\t}\n\n\t// Filter the results to those of a specific setting if one was set.\n\tif ( $setting ) {\n\t\t$setting_errors = array();\n\n\t\tforeach ( (array) $wp_settings_errors as $key => $details ) {\n\t\t\tif ( $setting === $details['setting'] ) {\n\t\t\t\t$setting_errors[] = $wp_settings_errors[ $key ];\n\t\t\t}\n\t\t}\n\n\t\treturn $setting_errors;\n\t}\n\n\treturn $wp_settings_errors;\n}\n\n/**\n * Display settings errors registered by add_settings_error().\n *\n * Part of the Settings API. Outputs a div for each error retrieved by\n * get_settings_errors().\n *\n * This is called automatically after a settings page based on the\n * Settings API is submitted. Errors should be added during the validation\n * callback function for a setting defined in register_setting().\n *\n * The $sanitize option is passed into get_settings_errors() and will\n * re-run the setting sanitization\n * on its current value.\n *\n * The $hide_on_update option will cause errors to only show when the settings\n * page is first loaded. if the user has already saved new values it will be\n * hidden to avoid repeating messages already shown in the default error\n * reporting after submission. This is useful to show general errors like\n * missing settings when the user arrives at the settings page.\n *\n * @since 3.0.0\n * @since 5.3.0 Legacy `error` and `updated` CSS classes are mapped to\n *              `notice-error` and `notice-success`.\n *\n * @param string $setting        Optional slug title of a specific setting whose errors you want.\n * @param bool   $sanitize       Whether to re-sanitize the setting value before returning errors.\n * @param bool   $hide_on_update If set to true errors will not be shown if the settings page has\n *                               already been submitted.\n */\nfunction settings_errors( $setting = '', $sanitize = false, $hide_on_update = false ) {\n\n\tif ( $hide_on_update && ! empty( $_GET['settings-updated'] ) ) {\n\t\treturn;\n\t}\n\n\t$settings_errors = get_settings_errors( $setting, $sanitize );\n\n\tif ( empty( $settings_errors ) ) {\n\t\treturn;\n\t}\n\n\t$output = '';\n\n\tforeach ( $settings_errors as $key => $details ) {\n\t\tif ( 'updated' === $details['type'] ) {\n\t\t\t$details['type'] = 'success';\n\t\t}\n\n\t\tif ( in_array( $details['type'], array( 'error', 'success', 'warning', 'info' ), true ) ) {\n\t\t\t$details['type'] = 'notice-' . $details['type'];\n\t\t}\n\n\t\t$css_id    = sprintf(\n\t\t\t'setting-error-%s',\n\t\t\tesc_attr( $details['code'] )\n\t\t);\n\t\t$css_class = sprintf(\n\t\t\t'notice %s settings-error is-dismissible',\n\t\t\tesc_attr( $details['type'] )\n\t\t);\n\n\t\t$output .= \"<div id='$css_id' class='$css_class'> \\n\";\n\t\t$output .= \"<p><strong>{$details['message']}</strong></p>\";\n\t\t$output .= \"</div> \\n\";\n\t}\n\n\techo $output;\n}\n\n/**\n * Outputs the modal window used for attaching media to posts or pages in the media-listing screen.\n *\n * @since 2.7.0\n *\n * @param string $found_action\n */\nfunction find_posts_div( $found_action = '' ) {\n\t?>\n\t<div id=\"find-posts\" class=\"find-box\" style=\"display: none;\">\n\t\t<div id=\"find-posts-head\" class=\"find-box-head\">\n\t\t\t<?php _e( 'Attach to existing content' ); ?>\n\t\t\t<button type=\"button\" id=\"find-posts-close\"><span class=\"screen-reader-text\"><?php _e( 'Close media attachment panel' ); ?></span></button>\n\t\t</div>\n\t\t<div class=\"find-box-inside\">\n\t\t\t<div class=\"find-box-search\">\n\t\t\t\t<?php if ( $found_action ) { ?>\n\t\t\t\t\t<input type=\"hidden\" name=\"found_action\" value=\"<?php echo esc_attr( $found_action ); ?>\" />\n\t\t\t\t<?php } ?>\n\t\t\t\t<input type=\"hidden\" name=\"affected\" id=\"affected\" value=\"\" />\n\t\t\t\t<?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?>\n\t\t\t\t<label class=\"screen-reader-text\" for=\"find-posts-input\"><?php _e( 'Search' ); ?></label>\n\t\t\t\t<input type=\"text\" id=\"find-posts-input\" name=\"ps\" value=\"\" />\n\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t\t<input type=\"button\" id=\"find-posts-search\" value=\"<?php esc_attr_e( 'Search' ); ?>\" class=\"button\" />\n\t\t\t\t<div class=\"clear\"></div>\n\t\t\t</div>\n\t\t\t<div id=\"find-posts-response\"></div>\n\t\t</div>\n\t\t<div class=\"find-box-buttons\">\n\t\t\t<?php submit_button( __( 'Select' ), 'primary alignright', 'find-posts-submit', false ); ?>\n\t\t\t<div class=\"clear\"></div>\n\t\t</div>\n\t</div>\n\t<?php\n}\n\n/**\n * Displays the post password.\n *\n * The password is passed through esc_attr() to ensure that it is safe for placing in an HTML attribute.\n *\n * @since 2.7.0\n */\nfunction the_post_password() {\n\t$post = get_post();\n\tif ( isset( $post->post_password ) ) {\n\t\techo esc_attr( $post->post_password );\n\t}\n}\n\n/**\n * Get the post title.\n *\n * The post title is fetched and if it is blank then a default string is\n * returned.\n *\n * @since 2.7.0\n *\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.\n * @return string The post title if set.\n */\nfunction _draft_or_post_title( $post = 0 ) {\n\t$title = get_the_title( $post );\n\tif ( empty( $title ) ) {\n\t\t$title = __( '(no title)' );\n\t}\n\treturn esc_html( $title );\n}\n\n/**\n * Displays the search query.\n *\n * A simple wrapper to display the \"s\" parameter in a `GET` URI. This function\n * should only be used when the_search_query() cannot.\n *\n * @since 2.7.0\n */\nfunction _admin_search_query() {\n\techo isset( $_REQUEST['s'] ) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : '';\n}\n\n/**\n * Generic Iframe header for use with Thickbox\n *\n * @since 2.7.0\n *\n * @global string    $hook_suffix\n * @global string    $admin_body_class\n * @global WP_Locale $wp_locale        WordPress date and time locale object.\n *\n * @param string $title      Optional. Title of the Iframe page. Default empty.\n * @param bool   $deprecated Not used.\n */\nfunction iframe_header( $title = '', $deprecated = false ) {\n\tshow_admin_bar( false );\n\tglobal $hook_suffix, $admin_body_class, $wp_locale;\n\t$admin_body_class = preg_replace( '/[^a-z0-9_-]+/i', '-', $hook_suffix );\n\n\t$current_screen = get_current_screen();\n\n\theader( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );\n\t_wp_admin_html_begin();\n\t?>\n<title><?php bloginfo( 'name' ); ?> &rsaquo; <?php echo $title; ?> &#8212; <?php _e( 'WordPress' ); ?></title>\n\t<?php\n\twp_enqueue_style( 'colors' );\n\t?>\n<script type=\"text/javascript\">\naddLoadEvent = function(func){if(typeof jQuery!=\"undefined\")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};\nfunction tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();}\nvar ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>',\n\tpagenow = '<?php echo esc_js( $current_screen->id ); ?>',\n\ttypenow = '<?php echo esc_js( $current_screen->post_type ); ?>',\n\tadminpage = '<?php echo esc_js( $admin_body_class ); ?>',\n\tthousandsSeparator = '<?php echo esc_js( $wp_locale->number_format['thousands_sep'] ); ?>',\n\tdecimalPoint = '<?php echo esc_js( $wp_locale->number_format['decimal_point'] ); ?>',\n\tisRtl = <?php echo (int) is_rtl(); ?>;\n</script>\n\t<?php\n\t/** This action is documented in wp-admin/admin-header.php */\n\tdo_action( 'admin_enqueue_scripts', $hook_suffix );\n\n\t/** This action is documented in wp-admin/admin-header.php */\n\tdo_action( \"admin_print_styles-{$hook_suffix}\" );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t/** This action is documented in wp-admin/admin-header.php */\n\tdo_action( 'admin_print_styles' );\n\n\t/** This action is documented in wp-admin/admin-header.php */\n\tdo_action( \"admin_print_scripts-{$hook_suffix}\" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t/** This action is documented in wp-admin/admin-header.php */\n\tdo_action( 'admin_print_scripts' );\n\n\t/** This action is documented in wp-admin/admin-header.php */\n\tdo_action( \"admin_head-{$hook_suffix}\" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t/** This action is documented in wp-admin/admin-header.php */\n\tdo_action( 'admin_head' );\n\n\t$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );\n\n\tif ( is_rtl() ) {\n\t\t$admin_body_class .= ' rtl';\n\t}\n\n\t?>\n</head>\n\t<?php\n\t/**\n\t * @global string $body_id\n\t */\n\t$admin_body_id = isset( $GLOBALS['body_id'] ) ? 'id=\"' . $GLOBALS['body_id'] . '\" ' : '';\n\n\t/** This filter is documented in wp-admin/admin-header.php */\n\t$admin_body_classes = apply_filters( 'admin_body_class', '' );\n\t$admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class );\n\t?>\n<body <?php echo $admin_body_id; ?>class=\"wp-admin wp-core-ui no-js iframe <?php echo $admin_body_classes; ?>\">\n<script type=\"text/javascript\">\n(function(){\nvar c = document.body.className;\nc = c.replace(/no-js/, 'js');\ndocument.body.className = c;\n})();\n</script>\n\t<?php\n}\n\n/**\n * Generic Iframe footer for use with Thickbox\n *\n * @since 2.7.0\n */\nfunction iframe_footer() {\n\t/*\n\t * We're going to hide any footer output on iFrame pages,\n\t * but run the hooks anyway since they output JavaScript\n\t * or other needed content.\n\t */\n\n\t/**\n\t * @global string $hook_suffix\n\t */\n\tglobal $hook_suffix;\n\t?>\n\t<div class=\"hidden\">\n\t<?php\n\t/** This action is documented in wp-admin/admin-footer.php */\n\tdo_action( 'admin_footer', $hook_suffix );\n\n\t/** This action is documented in wp-admin/admin-footer.php */\n\tdo_action( \"admin_print_footer_scripts-{$hook_suffix}\" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t/** This action is documented in wp-admin/admin-footer.php */\n\tdo_action( 'admin_print_footer_scripts' );\n\t?>\n\t</div>\n<script type=\"text/javascript\">if(typeof wpOnload==\"function\")wpOnload();</script>\n</body>\n</html>\n\t<?php\n}\n\n/**\n * Function to echo or return the post states as HTML.\n *\n * @since 2.7.0\n * @since 5.3.0 Added the `$echo` parameter and a return value.\n *\n * @see get_post_states()\n *\n * @param WP_Post $post The post to retrieve states for.\n * @param bool    $echo Optional. Whether to echo the post states as an HTML string. Default true.\n * @return string Post states string.\n */\nfunction _post_states( $post, $echo = true ) {\n\t$post_states        = get_post_states( $post );\n\t$post_states_string = '';\n\n\tif ( ! empty( $post_states ) ) {\n\t\t$state_count = count( $post_states );\n\t\t$i           = 0;\n\n\t\t$post_states_string .= ' &mdash; ';\n\n\t\tforeach ( $post_states as $state ) {\n\t\t\t$sep = ( ++$i === $state_count ) ? '' : ', ';\n\n\t\t\t$post_states_string .= \"<span class='post-state'>$state$sep</span>\";\n\t\t}\n\t}\n\n\tif ( $echo ) {\n\t\techo $post_states_string;\n\t}\n\n\treturn $post_states_string;\n}\n\n/**\n * Retrieves an array of post states from a post.\n *\n * @since 5.3.0\n *\n * @param WP_Post $post The post to retrieve states for.\n * @return string[] Array of post state labels keyed by their state.\n */\nfunction get_post_states( $post ) {\n\t$post_states = array();\n\n\tif ( isset( $_REQUEST['post_status'] ) ) {\n\t\t$post_status = $_REQUEST['post_status'];\n\t} else {\n\t\t$post_status = '';\n\t}\n\n\tif ( ! empty( $post->post_password ) ) {\n\t\t$post_states['protected'] = _x( 'Password protected', 'post status' );\n\t}\n\n\tif ( 'private' === $post->post_status && 'private' !== $post_status ) {\n\t\t$post_states['private'] = _x( 'Private', 'post status' );\n\t}\n\n\tif ( 'draft' === $post->post_status ) {\n\t\tif ( get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) {\n\t\t\t$post_states[] = __( 'Customization Draft' );\n\t\t} elseif ( 'draft' !== $post_status ) {\n\t\t\t$post_states['draft'] = _x( 'Draft', 'post status' );\n\t\t}\n\t} elseif ( 'trash' === $post->post_status && get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) {\n\t\t$post_states[] = _x( 'Customization Draft', 'post status' );\n\t}\n\n\tif ( 'pending' === $post->post_status && 'pending' !== $post_status ) {\n\t\t$post_states['pending'] = _x( 'Pending', 'post status' );\n\t}\n\n\tif ( is_sticky( $post->ID ) ) {\n\t\t$post_states['sticky'] = _x( 'Sticky', 'post status' );\n\t}\n\n\tif ( 'future' === $post->post_status ) {\n\t\t$post_states['scheduled'] = _x( 'Scheduled', 'post status' );\n\t}\n\n\tif ( 'page' === get_option( 'show_on_front' ) ) {\n\t\tif ( intval( get_option( 'page_on_front' ) ) === $post->ID ) {\n\t\t\t$post_states['page_on_front'] = _x( 'Front Page', 'page label' );\n\t\t}\n\n\t\tif ( intval( get_option( 'page_for_posts' ) ) === $post->ID ) {\n\t\t\t$post_states['page_for_posts'] = _x( 'Posts Page', 'page label' );\n\t\t}\n\t}\n\n\tif ( intval( get_option( 'wp_page_for_privacy_policy' ) ) === $post->ID ) {\n\t\t$post_states['page_for_privacy_policy'] = _x( 'Privacy Policy Page', 'page label' );\n\t}\n\n\t/**\n\t * Filters the default post display states used in the posts list table.\n\t *\n\t * @since 2.8.0\n\t * @since 3.6.0 Added the `$post` parameter.\n\t * @since 5.5.0 Also applied in the Customizer context. If any admin functions\n\t *              are used within the filter, their existence should be checked\n\t *              with `function_exists()` before being used.\n\t *\n\t * @param string[] $post_states An array of post display states.\n\t * @param WP_Post  $post        The current post object.\n\t */\n\treturn apply_filters( 'display_post_states', $post_states, $post );\n}\n\n/**\n * Outputs the attachment media states as HTML.\n *\n * @since 3.2.0\n *\n * @param WP_Post $post The attachment post to retrieve states for.\n */\nfunction _media_states( $post ) {\n\tstatic $header_images;\n\n\t$media_states = array();\n\t$stylesheet   = get_option( 'stylesheet' );\n\n\tif ( current_theme_supports( 'custom-header' ) ) {\n\t\t$meta_header = get_post_meta( $post->ID, '_wp_attachment_is_custom_header', true );\n\n\t\tif ( is_random_header_image() ) {\n\t\t\tif ( ! isset( $header_images ) ) {\n\t\t\t\t$header_images = wp_list_pluck( get_uploaded_header_images(), 'attachment_id' );\n\t\t\t}\n\n\t\t\tif ( $meta_header === $stylesheet && in_array( $post->ID, $header_images, true ) ) {\n\t\t\t\t$media_states[] = __( 'Header Image' );\n\t\t\t}\n\t\t} else {\n\t\t\t$header_image = get_header_image();\n\n\t\t\t// Display \"Header Image\" if the image was ever used as a header image.\n\t\t\tif ( ! empty( $meta_header ) && $meta_header === $stylesheet && wp_get_attachment_url( $post->ID ) !== $header_image ) {\n\t\t\t\t$media_states[] = __( 'Header Image' );\n\t\t\t}\n\n\t\t\t// Display \"Current Header Image\" if the image is currently the header image.\n\t\t\tif ( $header_image && wp_get_attachment_url( $post->ID ) === $header_image ) {\n\t\t\t\t$media_states[] = __( 'Current Header Image' );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( current_theme_supports( 'custom-background' ) ) {\n\t\t$meta_background = get_post_meta( $post->ID, '_wp_attachment_is_custom_background', true );\n\n\t\tif ( ! empty( $meta_background ) && $meta_background === $stylesheet ) {\n\t\t\t$media_states[] = __( 'Background Image' );\n\n\t\t\t$background_image = get_background_image();\n\t\t\tif ( $background_image && wp_get_attachment_url( $post->ID ) === $background_image ) {\n\t\t\t\t$media_states[] = __( 'Current Background Image' );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( (int) get_option( 'site_icon' ) === $post->ID ) {\n\t\t$media_states[] = __( 'Site Icon' );\n\t}\n\n\tif ( (int) get_theme_mod( 'custom_logo' ) === $post->ID ) {\n\t\t$media_states[] = __( 'Logo' );\n\t}\n\n\t/**\n\t * Filters the default media display states for items in the Media list table.\n\t *\n\t * @since 3.2.0\n\t * @since 4.8.0 Added the `$post` parameter.\n\t *\n\t * @param string[] $media_states An array of media states. Default 'Header Image',\n\t *                               'Background Image', 'Site Icon', 'Logo'.\n\t * @param WP_Post  $post         The current attachment object.\n\t */\n\t$media_states = apply_filters( 'display_media_states', $media_states, $post );\n\n\tif ( ! empty( $media_states ) ) {\n\t\t$state_count = count( $media_states );\n\t\t$i           = 0;\n\n\t\techo ' &mdash; ';\n\n\t\tforeach ( $media_states as $state ) {\n\t\t\t$sep = ( ++$i === $state_count ) ? '' : ', ';\n\n\t\t\techo \"<span class='post-state'>$state$sep</span>\";\n\t\t}\n\t}\n}\n\n/**\n * Test support for compressing JavaScript from PHP\n *\n * Outputs JavaScript that tests if compression from PHP works as expected\n * and sets an option with the result. Has no effect when the current user\n * is not an administrator. To run the test again the option 'can_compress_scripts'\n * has to be deleted.\n *\n * @since 2.8.0\n */\nfunction compression_test() {\n\t?>\n\t<script type=\"text/javascript\">\n\tvar compressionNonce = <?php echo wp_json_encode( wp_create_nonce( 'update_can_compress_scripts' ) ); ?>;\n\tvar testCompression = {\n\t\tget : function(test) {\n\t\t\tvar x;\n\t\t\tif ( window.XMLHttpRequest ) {\n\t\t\t\tx = new XMLHttpRequest();\n\t\t\t} else {\n\t\t\t\ttry{x=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{x=new ActiveXObject('Microsoft.XMLHTTP');}catch(e){};}\n\t\t\t}\n\n\t\t\tif (x) {\n\t\t\t\tx.onreadystatechange = function() {\n\t\t\t\t\tvar r, h;\n\t\t\t\t\tif ( x.readyState == 4 ) {\n\t\t\t\t\t\tr = x.responseText.substr(0, 18);\n\t\t\t\t\t\th = x.getResponseHeader('Content-Encoding');\n\t\t\t\t\t\ttestCompression.check(r, h, test);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tx.open('GET', ajaxurl + '?action=wp-compression-test&test='+test+'&_ajax_nonce='+compressionNonce+'&'+(new Date()).getTime(), true);\n\t\t\t\tx.send('');\n\t\t\t}\n\t\t},\n\n\t\tcheck : function(r, h, test) {\n\t\t\tif ( ! r && ! test )\n\t\t\t\tthis.get(1);\n\n\t\t\tif ( 1 == test ) {\n\t\t\t\tif ( h && ( h.match(/deflate/i) || h.match(/gzip/i) ) )\n\t\t\t\t\tthis.get('no');\n\t\t\t\telse\n\t\t\t\t\tthis.get(2);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( 2 == test ) {\n\t\t\t\tif ( '\"wpCompressionTest' === r )\n\t\t\t\t\tthis.get('yes');\n\t\t\t\telse\n\t\t\t\t\tthis.get('no');\n\t\t\t}\n\t\t}\n\t};\n\ttestCompression.check();\n\t</script>\n\t<?php\n}\n\n/**\n * Echoes a submit button, with provided text and appropriate class(es).\n *\n * @since 3.1.0\n *\n * @see get_submit_button()\n *\n * @param string       $text             The text of the button (defaults to 'Save Changes')\n * @param string       $type             Optional. The type and CSS class(es) of the button. Core values\n *                                       include 'primary', 'small', and 'large'. Default 'primary'.\n * @param string       $name             The HTML name of the submit button. Defaults to \"submit\". If no\n *                                       id attribute is given in $other_attributes below, $name will be\n *                                       used as the button's id.\n * @param bool         $wrap             True if the output button should be wrapped in a paragraph tag,\n *                                       false otherwise. Defaults to true.\n * @param array|string $other_attributes Other attributes that should be output with the button, mapping\n *                                       attributes to their values, such as setting tabindex to 1, etc.\n *                                       These key/value attribute pairs will be output as attribute=\"value\",\n *                                       where attribute is the key. Other attributes can also be provided\n *                                       as a string such as 'tabindex=\"1\"', though the array format is\n *                                       preferred. Default null.\n */\nfunction submit_button( $text = null, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = null ) {\n\techo get_submit_button( $text, $type, $name, $wrap, $other_attributes );\n}\n\n/**\n * Returns a submit button, with provided text and appropriate class\n *\n * @since 3.1.0\n *\n * @param string       $text             Optional. The text of the button. Default 'Save Changes'.\n * @param string       $type             Optional. The type and CSS class(es) of the button. Core values\n *                                       include 'primary', 'small', and 'large'. Default 'primary large'.\n * @param string       $name             Optional. The HTML name of the submit button. Defaults to \"submit\".\n *                                       If no id attribute is given in $other_attributes below, `$name` will\n *                                       be used as the button's id. Default 'submit'.\n * @param bool         $wrap             Optional. True if the output button should be wrapped in a paragraph\n *                                       tag, false otherwise. Default true.\n * @param array|string $other_attributes Optional. Other attributes that should be output with the button,\n *                                       mapping attributes to their values, such as `array( 'tabindex' => '1' )`.\n *                                       These attributes will be output as `attribute=\"value\"`, such as\n *                                       `tabindex=\"1\"`. Other attributes can also be provided as a string such\n *                                       as `tabindex=\"1\"`, though the array format is typically cleaner.\n *                                       Default empty.\n * @return string Submit button HTML.\n */\nfunction get_submit_button( $text = '', $type = 'primary large', $name = 'submit', $wrap = true, $other_attributes = '' ) {\n\tif ( ! is_array( $type ) ) {\n\t\t$type = explode( ' ', $type );\n\t}\n\n\t$button_shorthand = array( 'primary', 'small', 'large' );\n\t$classes          = array( 'button' );\n\n\tforeach ( $type as $t ) {\n\t\tif ( 'secondary' === $t || 'button-secondary' === $t ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$classes[] = in_array( $t, $button_shorthand, true ) ? 'button-' . $t : $t;\n\t}\n\n\t// Remove empty items, remove duplicate items, and finally build a string.\n\t$class = implode( ' ', array_unique( array_filter( $classes ) ) );\n\n\t$text = $text ? $text : __( 'Save Changes' );\n\n\t// Default the id attribute to $name unless an id was specifically provided in $other_attributes.\n\t$id = $name;\n\tif ( is_array( $other_attributes ) && isset( $other_attributes['id'] ) ) {\n\t\t$id = $other_attributes['id'];\n\t\tunset( $other_attributes['id'] );\n\t}\n\n\t$attributes = '';\n\tif ( is_array( $other_attributes ) ) {\n\t\tforeach ( $other_attributes as $attribute => $value ) {\n\t\t\t$attributes .= $attribute . '=\"' . esc_attr( $value ) . '\" '; // Trailing space is important.\n\t\t}\n\t} elseif ( ! empty( $other_attributes ) ) { // Attributes provided as a string.\n\t\t$attributes = $other_attributes;\n\t}\n\n\t// Don't output empty name and id attributes.\n\t$name_attr = $name ? ' name=\"' . esc_attr( $name ) . '\"' : '';\n\t$id_attr   = $id ? ' id=\"' . esc_attr( $id ) . '\"' : '';\n\n\t$button  = '<input type=\"submit\"' . $name_attr . $id_attr . ' class=\"' . esc_attr( $class );\n\t$button .= '\" value=\"' . esc_attr( $text ) . '\" ' . $attributes . ' />';\n\n\tif ( $wrap ) {\n\t\t$button = '<p class=\"submit\">' . $button . '</p>';\n\t}\n\n\treturn $button;\n}\n\n/**\n * @global bool $is_IE\n */\nfunction _wp_admin_html_begin() {\n\tglobal $is_IE;\n\n\t$admin_html_class = ( is_admin_bar_showing() ) ? 'wp-toolbar' : '';\n\n\tif ( $is_IE ) {\n\t\theader( 'X-UA-Compatible: IE=edge' );\n\t}\n\n\t?>\n<!DOCTYPE html>\n<html class=\"<?php echo $admin_html_class; ?>\"\n\t<?php\n\t/**\n\t * Fires inside the HTML tag in the admin header.\n\t *\n\t * @since 2.2.0\n\t */\n\tdo_action( 'admin_xml_ns' );\n\n\tlanguage_attributes();\n\t?>\n>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>\" />\n\t<?php\n}\n\n/**\n * Convert a screen string to a screen object\n *\n * @since 3.0.0\n *\n * @param string $hook_name The hook name (also known as the hook suffix) used to determine the screen.\n * @return WP_Screen Screen object.\n */\nfunction convert_to_screen( $hook_name ) {\n\tif ( ! class_exists( 'WP_Screen' ) ) {\n\t\t_doing_it_wrong(\n\t\t\t'convert_to_screen(), add_meta_box()',\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: wp-admin/includes/template.php, 2: add_meta_box(), 3: add_meta_boxes */\n\t\t\t\t__( 'Likely direct inclusion of %1$s in order to use %2$s. This is very wrong. Hook the %2$s call into the %3$s action instead.' ),\n\t\t\t\t'<code>wp-admin/includes/template.php</code>',\n\t\t\t\t'<code>add_meta_box()</code>',\n\t\t\t\t'<code>add_meta_boxes</code>'\n\t\t\t),\n\t\t\t'3.3.0'\n\t\t);\n\t\treturn (object) array(\n\t\t\t'id'   => '_invalid',\n\t\t\t'base' => '_are_belong_to_us',\n\t\t);\n\t}\n\n\treturn WP_Screen::get( $hook_name );\n}\n\n/**\n * Output the HTML for restoring the post data from DOM storage\n *\n * @since 3.6.0\n * @access private\n */\nfunction _local_storage_notice() {\n\t?>\n\t<div id=\"local-storage-notice\" class=\"hidden notice is-dismissible\">\n\t<p class=\"local-restore\">\n\t\t<?php _e( 'The backup of this post in your browser is different from the version below.' ); ?>\n\t\t<button type=\"button\" class=\"button restore-backup\"><?php _e( 'Restore the backup' ); ?></button>\n\t</p>\n\t<p class=\"help\">\n\t\t<?php _e( 'This will replace the current editor content with the last backup version. You can use undo and redo in the editor to get the old content back or to return to the restored version.' ); ?>\n\t</p>\n\t</div>\n\t<?php\n}\n\n/**\n * Output a HTML element with a star rating for a given rating.\n *\n * Outputs a HTML element with the star rating exposed on a 0..5 scale in\n * half star increments (ie. 1, 1.5, 2 stars). Optionally, if specified, the\n * number of ratings may also be displayed by passing the $number parameter.\n *\n * @since 3.8.0\n * @since 4.4.0 Introduced the `echo` parameter.\n *\n * @param array $args {\n *     Optional. Array of star ratings arguments.\n *\n *     @type int|float $rating The rating to display, expressed in either a 0.5 rating increment,\n *                             or percentage. Default 0.\n *     @type string    $type   Format that the $rating is in. Valid values are 'rating' (default),\n *                             or, 'percent'. Default 'rating'.\n *     @type int       $number The number of ratings that makes up this rating. Default 0.\n *     @type bool      $echo   Whether to echo the generated markup. False to return the markup instead\n *                             of echoing it. Default true.\n * }\n * @return string Star rating HTML.\n */\nfunction wp_star_rating( $args = array() ) {\n\t$defaults    = array(\n\t\t'rating' => 0,\n\t\t'type'   => 'rating',\n\t\t'number' => 0,\n\t\t'echo'   => true,\n\t);\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t// Non-English decimal places when the $rating is coming from a string.\n\t$rating = (float) str_replace( ',', '.', $parsed_args['rating'] );\n\n\t// Convert percentage to star rating, 0..5 in .5 increments.\n\tif ( 'percent' === $parsed_args['type'] ) {\n\t\t$rating = round( $rating / 10, 0 ) / 2;\n\t}\n\n\t// Calculate the number of each type of star needed.\n\t$full_stars  = floor( $rating );\n\t$half_stars  = ceil( $rating - $full_stars );\n\t$empty_stars = 5 - $full_stars - $half_stars;\n\n\tif ( $parsed_args['number'] ) {\n\t\t/* translators: 1: The rating, 2: The number of ratings. */\n\t\t$format = _n( '%1$s rating based on %2$s rating', '%1$s rating based on %2$s ratings', $parsed_args['number'] );\n\t\t$title  = sprintf( $format, number_format_i18n( $rating, 1 ), number_format_i18n( $parsed_args['number'] ) );\n\t} else {\n\t\t/* translators: %s: The rating. */\n\t\t$title = sprintf( __( '%s rating' ), number_format_i18n( $rating, 1 ) );\n\t}\n\n\t$output  = '<div class=\"star-rating\">';\n\t$output .= '<span class=\"screen-reader-text\">' . $title . '</span>';\n\t$output .= str_repeat( '<div class=\"star star-full\" aria-hidden=\"true\"></div>', $full_stars );\n\t$output .= str_repeat( '<div class=\"star star-half\" aria-hidden=\"true\"></div>', $half_stars );\n\t$output .= str_repeat( '<div class=\"star star-empty\" aria-hidden=\"true\"></div>', $empty_stars );\n\t$output .= '</div>';\n\n\tif ( $parsed_args['echo'] ) {\n\t\techo $output;\n\t}\n\n\treturn $output;\n}\n\n/**\n * Output a notice when editing the page for posts (internal use only).\n *\n * @ignore\n * @since 4.2.0\n */\nfunction _wp_posts_page_notice() {\n\techo '<div class=\"notice notice-warning inline\"><p>' . __( 'You are currently editing the page that shows your latest posts.' ) . '</p></div>';\n}\n", "num_lines": 2633}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Theme Installation Administration API\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n$themes_allowedtags = array(\n\t'a'       => array(\n\t\t'href'   => array(),\n\t\t'title'  => array(),\n\t\t'target' => array(),\n\t),\n\t'abbr'    => array( 'title' => array() ),\n\t'acronym' => array( 'title' => array() ),\n\t'code'    => array(),\n\t'pre'     => array(),\n\t'em'      => array(),\n\t'strong'  => array(),\n\t'div'     => array(),\n\t'p'       => array(),\n\t'ul'      => array(),\n\t'ol'      => array(),\n\t'li'      => array(),\n\t'h1'      => array(),\n\t'h2'      => array(),\n\t'h3'      => array(),\n\t'h4'      => array(),\n\t'h5'      => array(),\n\t'h6'      => array(),\n\t'img'     => array(\n\t\t'src'   => array(),\n\t\t'class' => array(),\n\t\t'alt'   => array(),\n\t),\n);\n\n$theme_field_defaults = array(\n\t'description'  => true,\n\t'sections'     => false,\n\t'tested'       => true,\n\t'requires'     => true,\n\t'rating'       => true,\n\t'downloaded'   => true,\n\t'downloadlink' => true,\n\t'last_updated' => true,\n\t'homepage'     => true,\n\t'tags'         => true,\n\t'num_ratings'  => true,\n);\n\n/**\n * Retrieve list of WordPress theme features (aka theme tags).\n *\n * @since 2.8.0\n *\n * @deprecated 3.1.0 Use get_theme_feature_list() instead.\n *\n * @return array\n */\nfunction install_themes_feature_list() {\n\t_deprecated_function( __FUNCTION__, '3.1.0', 'get_theme_feature_list()' );\n\n\t$cache = get_transient( 'wporg_theme_feature_list' );\n\tif ( ! $cache ) {\n\t\tset_transient( 'wporg_theme_feature_list', array(), 3 * HOUR_IN_SECONDS );\n\t}\n\n\tif ( $cache ) {\n\t\treturn $cache;\n\t}\n\n\t$feature_list = themes_api( 'feature_list', array() );\n\tif ( is_wp_error( $feature_list ) ) {\n\t\treturn array();\n\t}\n\n\tset_transient( 'wporg_theme_feature_list', $feature_list, 3 * HOUR_IN_SECONDS );\n\n\treturn $feature_list;\n}\n\n/**\n * Display search form for searching themes.\n *\n * @since 2.8.0\n *\n * @param bool $type_selector\n */\nfunction install_theme_search_form( $type_selector = true ) {\n\t$type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';\n\t$term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '';\n\tif ( ! $type_selector ) {\n\t\techo '<p class=\"install-help\">' . __( 'Search for themes by keyword.' ) . '</p>';\n\t}\n\t?>\n<form id=\"search-themes\" method=\"get\">\n\t<input type=\"hidden\" name=\"tab\" value=\"search\" />\n\t<?php if ( $type_selector ) : ?>\n\t<label class=\"screen-reader-text\" for=\"typeselector\"><?php _e( 'Type of search' ); ?></label>\n\t<select\tname=\"type\" id=\"typeselector\">\n\t<option value=\"term\" <?php selected( 'term', $type ); ?>><?php _e( 'Keyword' ); ?></option>\n\t<option value=\"author\" <?php selected( 'author', $type ); ?>><?php _e( 'Author' ); ?></option>\n\t<option value=\"tag\" <?php selected( 'tag', $type ); ?>><?php _ex( 'Tag', 'Theme Installer' ); ?></option>\n\t</select>\n\t<label class=\"screen-reader-text\" for=\"s\">\n\t\t<?php\n\t\tswitch ( $type ) {\n\t\t\tcase 'term':\n\t\t\t\t_e( 'Search by keyword' );\n\t\t\t\tbreak;\n\t\t\tcase 'author':\n\t\t\t\t_e( 'Search by author' );\n\t\t\t\tbreak;\n\t\t\tcase 'tag':\n\t\t\t\t_e( 'Search by tag' );\n\t\t\t\tbreak;\n\t\t}\n\t\t?>\n\t</label>\n\t<?php else : ?>\n\t<label class=\"screen-reader-text\" for=\"s\"><?php _e( 'Search by keyword' ); ?></label>\n\t<?php endif; ?>\n\t<input type=\"search\" name=\"s\" id=\"s\" size=\"30\" value=\"<?php echo esc_attr( $term ); ?>\" autofocus=\"autofocus\" />\n\t<?php submit_button( __( 'Search' ), '', 'search', false ); ?>\n</form>\n\t<?php\n}\n\n/**\n * Display tags filter for themes.\n *\n * @since 2.8.0\n */\nfunction install_themes_dashboard() {\n\tinstall_theme_search_form( false );\n\t?>\n<h4><?php _e( 'Feature Filter' ); ?></h4>\n<p class=\"install-help\"><?php _e( 'Find a theme based on specific features.' ); ?></p>\n\n<form method=\"get\">\n\t<input type=\"hidden\" name=\"tab\" value=\"search\" />\n\t<?php\n\t$feature_list = get_theme_feature_list();\n\techo '<div class=\"feature-filter\">';\n\n\tforeach ( (array) $feature_list as $feature_name => $features ) {\n\t\t$feature_name = esc_html( $feature_name );\n\t\techo '<div class=\"feature-name\">' . $feature_name . '</div>';\n\n\t\techo '<ol class=\"feature-group\">';\n\t\tforeach ( $features as $feature => $feature_name ) {\n\t\t\t$feature_name = esc_html( $feature_name );\n\t\t\t$feature      = esc_attr( $feature );\n\t\t\t?>\n\n<li>\n\t<input type=\"checkbox\" name=\"features[]\" id=\"feature-id-<?php echo $feature; ?>\" value=\"<?php echo $feature; ?>\" />\n\t<label for=\"feature-id-<?php echo $feature; ?>\"><?php echo $feature_name; ?></label>\n</li>\n\n<?php\t} ?>\n</ol>\n<br class=\"clear\" />\n\t\t<?php\n\t}\n\t?>\n\n</div>\n<br class=\"clear\" />\n\t<?php submit_button( __( 'Find Themes' ), '', 'search' ); ?>\n</form>\n\t<?php\n}\n\n/**\n * @since 2.8.0\n */\nfunction install_themes_upload() {\n\t?>\n<p class=\"install-help\"><?php _e( 'If you have a theme in a .zip format, you may install or update it by uploading it here.' ); ?></p>\n<form method=\"post\" enctype=\"multipart/form-data\" class=\"wp-upload-form\" action=\"<?php echo self_admin_url( 'update.php?action=upload-theme' ); ?>\">\n\t<?php wp_nonce_field( 'theme-upload' ); ?>\n\t<label class=\"screen-reader-text\" for=\"themezip\"><?php _e( 'Theme zip file' ); ?></label>\n\t<input type=\"file\" id=\"themezip\" name=\"themezip\" accept=\".zip\"/>\n\t<?php submit_button( __( 'Install Now' ), '', 'install-theme-submit', false ); ?>\n</form>\n\t<?php\n}\n\n/**\n * Prints a theme on the Install Themes pages.\n *\n * @deprecated 3.4.0\n *\n * @global WP_Theme_Install_List_Table $wp_list_table\n *\n * @param object $theme\n */\nfunction display_theme( $theme ) {\n\t_deprecated_function( __FUNCTION__, '3.4.0' );\n\tglobal $wp_list_table;\n\tif ( ! isset( $wp_list_table ) ) {\n\t\t$wp_list_table = _get_list_table( 'WP_Theme_Install_List_Table' );\n\t}\n\t$wp_list_table->prepare_items();\n\t$wp_list_table->single_row( $theme );\n}\n\n/**\n * Display theme content based on theme list.\n *\n * @since 2.8.0\n *\n * @global WP_Theme_Install_List_Table $wp_list_table\n */\nfunction display_themes() {\n\tglobal $wp_list_table;\n\n\tif ( ! isset( $wp_list_table ) ) {\n\t\t$wp_list_table = _get_list_table( 'WP_Theme_Install_List_Table' );\n\t}\n\t$wp_list_table->prepare_items();\n\t$wp_list_table->display();\n\n}\n\n/**\n * Display theme information in dialog box form.\n *\n * @since 2.8.0\n *\n * @global WP_Theme_Install_List_Table $wp_list_table\n */\nfunction install_theme_information() {\n\tglobal $wp_list_table;\n\n\t$theme = themes_api( 'theme_information', array( 'slug' => wp_unslash( $_REQUEST['theme'] ) ) );\n\n\tif ( is_wp_error( $theme ) ) {\n\t\twp_die( $theme );\n\t}\n\n\tiframe_header( __( 'Theme Installation' ) );\n\tif ( ! isset( $wp_list_table ) ) {\n\t\t$wp_list_table = _get_list_table( 'WP_Theme_Install_List_Table' );\n\t}\n\t$wp_list_table->theme_installer_single( $theme );\n\tiframe_footer();\n\texit;\n}\n", "num_lines": 253}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Theme Administration API\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Remove a theme\n *\n * @since 2.8.0\n *\n * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.\n *\n * @param string $stylesheet Stylesheet of the theme to delete.\n * @param string $redirect   Redirect to page when complete.\n * @return bool|null|WP_Error True on success, false if `$stylesheet` is empty, WP_Error on failure.\n *                            Null if filesystem credentials are required to proceed.\n */\nfunction delete_theme( $stylesheet, $redirect = '' ) {\n\tglobal $wp_filesystem;\n\n\tif ( empty( $stylesheet ) ) {\n\t\treturn false;\n\t}\n\n\tif ( empty( $redirect ) ) {\n\t\t$redirect = wp_nonce_url( 'themes.php?action=delete&stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet );\n\t}\n\n\tob_start();\n\t$credentials = request_filesystem_credentials( $redirect );\n\t$data        = ob_get_clean();\n\n\tif ( false === $credentials ) {\n\t\tif ( ! empty( $data ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t\t\techo $data;\n\t\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t\t\texit;\n\t\t}\n\t\treturn;\n\t}\n\n\tif ( ! WP_Filesystem( $credentials ) ) {\n\t\tob_start();\n\t\t// Failed to connect. Error and request again.\n\t\trequest_filesystem_credentials( $redirect, '', true );\n\t\t$data = ob_get_clean();\n\n\t\tif ( ! empty( $data ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t\t\techo $data;\n\t\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t\t\texit;\n\t\t}\n\t\treturn;\n\t}\n\n\tif ( ! is_object( $wp_filesystem ) ) {\n\t\treturn new WP_Error( 'fs_unavailable', __( 'Could not access filesystem.' ) );\n\t}\n\n\tif ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {\n\t\treturn new WP_Error( 'fs_error', __( 'Filesystem error.' ), $wp_filesystem->errors );\n\t}\n\n\t// Get the base plugin folder.\n\t$themes_dir = $wp_filesystem->wp_themes_dir();\n\tif ( empty( $themes_dir ) ) {\n\t\treturn new WP_Error( 'fs_no_themes_dir', __( 'Unable to locate WordPress theme directory.' ) );\n\t}\n\n\t$themes_dir = trailingslashit( $themes_dir );\n\t$theme_dir  = trailingslashit( $themes_dir . $stylesheet );\n\t$deleted    = $wp_filesystem->delete( $theme_dir, true );\n\n\tif ( ! $deleted ) {\n\t\treturn new WP_Error(\n\t\t\t'could_not_remove_theme',\n\t\t\t/* translators: %s: Theme name. */\n\t\t\tsprintf( __( 'Could not fully remove the theme %s.' ), $stylesheet )\n\t\t);\n\t}\n\n\t$theme_translations = wp_get_installed_translations( 'themes' );\n\n\t// Remove language files, silently.\n\tif ( ! empty( $theme_translations[ $stylesheet ] ) ) {\n\t\t$translations = $theme_translations[ $stylesheet ];\n\n\t\tforeach ( $translations as $translation => $data ) {\n\t\t\t$wp_filesystem->delete( WP_LANG_DIR . '/themes/' . $stylesheet . '-' . $translation . '.po' );\n\t\t\t$wp_filesystem->delete( WP_LANG_DIR . '/themes/' . $stylesheet . '-' . $translation . '.mo' );\n\n\t\t\t$json_translation_files = glob( WP_LANG_DIR . '/themes/' . $stylesheet . '-' . $translation . '-*.json' );\n\t\t\tif ( $json_translation_files ) {\n\t\t\t\tarray_map( array( $wp_filesystem, 'delete' ), $json_translation_files );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove the theme from allowed themes on the network.\n\tif ( is_multisite() ) {\n\t\tWP_Theme::network_disable_theme( $stylesheet );\n\t}\n\n\t// Force refresh of theme update information.\n\tdelete_site_transient( 'update_themes' );\n\n\treturn true;\n}\n\n/**\n * Gets the page templates available in this theme.\n *\n * @since 1.5.0\n * @since 4.7.0 Added the `$post_type` parameter.\n *\n * @param WP_Post|null $post      Optional. The post being edited, provided for context.\n * @param string       $post_type Optional. Post type to get the templates for. Default 'page'.\n * @return string[] Array of template file names keyed by the template header name.\n */\nfunction get_page_templates( $post = null, $post_type = 'page' ) {\n\treturn array_flip( wp_get_theme()->get_page_templates( $post, $post_type ) );\n}\n\n/**\n * Tidies a filename for url display by the theme editor.\n *\n * @since 2.9.0\n * @access private\n *\n * @param string $fullpath Full path to the theme file\n * @param string $containingfolder Path of the theme parent folder\n * @return string\n */\nfunction _get_template_edit_filename( $fullpath, $containingfolder ) {\n\treturn str_replace( dirname( dirname( $containingfolder ) ), '', $fullpath );\n}\n\n/**\n * Check if there is an update for a theme available.\n *\n * Will display link, if there is an update available.\n *\n * @since 2.7.0\n *\n * @see get_theme_update_available()\n *\n * @param WP_Theme $theme Theme data object.\n */\nfunction theme_update_available( $theme ) {\n\techo get_theme_update_available( $theme );\n}\n\n/**\n * Retrieve the update link if there is a theme update available.\n *\n * Will return a link if there is an update available.\n *\n * @since 3.8.0\n *\n * @param WP_Theme $theme WP_Theme object.\n * @return string|false HTML for the update link, or false if invalid info was passed.\n */\nfunction get_theme_update_available( $theme ) {\n\tstatic $themes_update = null;\n\n\tif ( ! current_user_can( 'update_themes' ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! isset( $themes_update ) ) {\n\t\t$themes_update = get_site_transient( 'update_themes' );\n\t}\n\n\tif ( ! ( $theme instanceof WP_Theme ) ) {\n\t\treturn false;\n\t}\n\n\t$stylesheet = $theme->get_stylesheet();\n\n\t$html = '';\n\n\tif ( isset( $themes_update->response[ $stylesheet ] ) ) {\n\t\t$update      = $themes_update->response[ $stylesheet ];\n\t\t$theme_name  = $theme->display( 'Name' );\n\t\t$details_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'TB_iframe' => 'true',\n\t\t\t\t'width'     => 1024,\n\t\t\t\t'height'    => 800,\n\t\t\t),\n\t\t\t$update['url']\n\t\t); // Theme browser inside WP? Replace this. Also, theme preview JS will override this on the available list.\n\t\t$update_url  = wp_nonce_url( admin_url( 'update.php?action=upgrade-theme&amp;theme=' . urlencode( $stylesheet ) ), 'upgrade-theme_' . $stylesheet );\n\n\t\tif ( ! is_multisite() ) {\n\t\t\tif ( ! current_user_can( 'update_themes' ) ) {\n\t\t\t\t$html = sprintf(\n\t\t\t\t\t/* translators: 1: Theme name, 2: Theme details URL, 3: Additional link attributes, 4: Version number. */\n\t\t\t\t\t'<p><strong>' . __( 'There is a new version of %1$s available. <a href=\"%2$s\" %3$s>View version %4$s details</a>.' ) . '</strong></p>',\n\t\t\t\t\t$theme_name,\n\t\t\t\t\tesc_url( $details_url ),\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t'class=\"thickbox open-plugin-details-modal\" aria-label=\"%s\"',\n\t\t\t\t\t\t/* translators: 1: Theme name, 2: Version number. */\n\t\t\t\t\t\tesc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $update['new_version'] ) )\n\t\t\t\t\t),\n\t\t\t\t\t$update['new_version']\n\t\t\t\t);\n\t\t\t} elseif ( empty( $update['package'] ) ) {\n\t\t\t\t$html = sprintf(\n\t\t\t\t\t/* translators: 1: Theme name, 2: Theme details URL, 3: Additional link attributes, 4: Version number. */\n\t\t\t\t\t'<p><strong>' . __( 'There is a new version of %1$s available. <a href=\"%2$s\" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ) . '</strong></p>',\n\t\t\t\t\t$theme_name,\n\t\t\t\t\tesc_url( $details_url ),\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t'class=\"thickbox open-plugin-details-modal\" aria-label=\"%s\"',\n\t\t\t\t\t\t/* translators: 1: Theme name, 2: Version number. */\n\t\t\t\t\t\tesc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $update['new_version'] ) )\n\t\t\t\t\t),\n\t\t\t\t\t$update['new_version']\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$html = sprintf(\n\t\t\t\t\t/* translators: 1: Theme name, 2: Theme details URL, 3: Additional link attributes, 4: Version number, 5: Update URL, 6: Additional link attributes. */\n\t\t\t\t\t'<p><strong>' . __( 'There is a new version of %1$s available. <a href=\"%2$s\" %3$s>View version %4$s details</a> or <a href=\"%5$s\" %6$s>update now</a>.' ) . '</strong></p>',\n\t\t\t\t\t$theme_name,\n\t\t\t\t\tesc_url( $details_url ),\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t'class=\"thickbox open-plugin-details-modal\" aria-label=\"%s\"',\n\t\t\t\t\t\t/* translators: 1: Theme name, 2: Version number. */\n\t\t\t\t\t\tesc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $update['new_version'] ) )\n\t\t\t\t\t),\n\t\t\t\t\t$update['new_version'],\n\t\t\t\t\t$update_url,\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t'aria-label=\"%s\" id=\"update-theme\" data-slug=\"%s\"',\n\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\tesc_attr( sprintf( _x( 'Update %s now', 'theme' ), $theme_name ) ),\n\t\t\t\t\t\t$stylesheet\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $html;\n}\n\n/**\n * Retrieve list of WordPress theme features (aka theme tags).\n *\n * @since 3.1.0\n * @since 3.2.0 Added 'Gray' color and 'Featured Image Header', 'Featured Images',\n *              'Full Width Template', and 'Post Formats' features.\n * @since 3.5.0 Added 'Flexible Header' feature.\n * @since 3.8.0 Renamed 'Width' filter to 'Layout'.\n * @since 3.8.0 Renamed 'Fixed Width' and 'Flexible Width' options\n *              to 'Fixed Layout' and 'Fluid Layout'.\n * @since 3.8.0 Added 'Accessibility Ready' feature and 'Responsive Layout' option.\n * @since 3.9.0 Combined 'Layout' and 'Columns' filters.\n * @since 4.6.0 Removed 'Colors' filter.\n * @since 4.6.0 Added 'Grid Layout' option.\n *              Removed 'Fixed Layout', 'Fluid Layout', and 'Responsive Layout' options.\n * @since 4.6.0 Added 'Custom Logo' and 'Footer Widgets' features.\n *              Removed 'Blavatar' feature.\n * @since 4.6.0 Added 'Blog', 'E-Commerce', 'Education', 'Entertainment', 'Food & Drink',\n *              'Holiday', 'News', 'Photography', and 'Portfolio' subjects.\n *              Removed 'Photoblogging' and 'Seasonal' subjects.\n * @since 4.9.0 Reordered the filters from 'Layout', 'Features', 'Subject'\n *              to 'Subject', 'Features', 'Layout'.\n * @since 4.9.0 Removed 'BuddyPress', 'Custom Menu', 'Flexible Header',\n *              'Front Page Posting', 'Microformats', 'RTL Language Support',\n *              'Threaded Comments', and 'Translation Ready' features.\n * @since 5.5.0 Added 'Block Editor Patterns', 'Block Editor Styles',\n *              and 'Full Site Editing' features.\n * @since 5.5.0 Added 'Wide Blocks' layout option.\n *\n * @param bool $api Optional. Whether try to fetch tags from the WordPress.org API. Defaults to true.\n * @return array Array of features keyed by category with translations keyed by slug.\n */\nfunction get_theme_feature_list( $api = true ) {\n\t// Hard-coded list is used if API is not accessible.\n\t$features = array(\n\n\t\t__( 'Subject' )  => array(\n\t\t\t'blog'           => __( 'Blog' ),\n\t\t\t'e-commerce'     => __( 'E-Commerce' ),\n\t\t\t'education'      => __( 'Education' ),\n\t\t\t'entertainment'  => __( 'Entertainment' ),\n\t\t\t'food-and-drink' => __( 'Food & Drink' ),\n\t\t\t'holiday'        => __( 'Holiday' ),\n\t\t\t'news'           => __( 'News' ),\n\t\t\t'photography'    => __( 'Photography' ),\n\t\t\t'portfolio'      => __( 'Portfolio' ),\n\t\t),\n\n\t\t__( 'Features' ) => array(\n\t\t\t'accessibility-ready'   => __( 'Accessibility Ready' ),\n\t\t\t'block-patterns'        => __( 'Block Editor Patterns' ),\n\t\t\t'block-styles'          => __( 'Block Editor Styles' ),\n\t\t\t'custom-background'     => __( 'Custom Background' ),\n\t\t\t'custom-colors'         => __( 'Custom Colors' ),\n\t\t\t'custom-header'         => __( 'Custom Header' ),\n\t\t\t'custom-logo'           => __( 'Custom Logo' ),\n\t\t\t'editor-style'          => __( 'Editor Style' ),\n\t\t\t'featured-image-header' => __( 'Featured Image Header' ),\n\t\t\t'featured-images'       => __( 'Featured Images' ),\n\t\t\t'footer-widgets'        => __( 'Footer Widgets' ),\n\t\t\t'full-site-editing'     => __( 'Full Site Editing' ),\n\t\t\t'full-width-template'   => __( 'Full Width Template' ),\n\t\t\t'post-formats'          => __( 'Post Formats' ),\n\t\t\t'sticky-post'           => __( 'Sticky Post' ),\n\t\t\t'theme-options'         => __( 'Theme Options' ),\n\t\t),\n\n\t\t__( 'Layout' )   => array(\n\t\t\t'grid-layout'   => __( 'Grid Layout' ),\n\t\t\t'one-column'    => __( 'One Column' ),\n\t\t\t'two-columns'   => __( 'Two Columns' ),\n\t\t\t'three-columns' => __( 'Three Columns' ),\n\t\t\t'four-columns'  => __( 'Four Columns' ),\n\t\t\t'left-sidebar'  => __( 'Left Sidebar' ),\n\t\t\t'right-sidebar' => __( 'Right Sidebar' ),\n\t\t\t'wide-blocks'   => __( 'Wide Blocks' ),\n\t\t),\n\n\t);\n\n\tif ( ! $api || ! current_user_can( 'install_themes' ) ) {\n\t\treturn $features;\n\t}\n\n\t$feature_list = get_site_transient( 'wporg_theme_feature_list' );\n\tif ( ! $feature_list ) {\n\t\tset_site_transient( 'wporg_theme_feature_list', array(), 3 * HOUR_IN_SECONDS );\n\t}\n\n\tif ( ! $feature_list ) {\n\t\t$feature_list = themes_api( 'feature_list', array() );\n\t\tif ( is_wp_error( $feature_list ) ) {\n\t\t\treturn $features;\n\t\t}\n\t}\n\n\tif ( ! $feature_list ) {\n\t\treturn $features;\n\t}\n\n\tset_site_transient( 'wporg_theme_feature_list', $feature_list, 3 * HOUR_IN_SECONDS );\n\n\t$category_translations = array(\n\t\t'Layout'   => __( 'Layout' ),\n\t\t'Features' => __( 'Features' ),\n\t\t'Subject'  => __( 'Subject' ),\n\t);\n\n\t$wporg_features = array();\n\n\t// Loop over the wp.org canonical list and apply translations.\n\tforeach ( (array) $feature_list as $feature_category => $feature_items ) {\n\t\tif ( isset( $category_translations[ $feature_category ] ) ) {\n\t\t\t$feature_category = $category_translations[ $feature_category ];\n\t\t}\n\n\t\t$wporg_features[ $feature_category ] = array();\n\n\t\tforeach ( $feature_items as $feature ) {\n\t\t\tif ( isset( $features[ $feature_category ][ $feature ] ) ) {\n\t\t\t\t$wporg_features[ $feature_category ][ $feature ] = $features[ $feature_category ][ $feature ];\n\t\t\t} else {\n\t\t\t\t$wporg_features[ $feature_category ][ $feature ] = $feature;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $wporg_features;\n}\n\n/**\n * Retrieves theme installer pages from the WordPress.org Themes API.\n *\n * It is possible for a theme to override the Themes API result with three\n * filters. Assume this is for themes, which can extend on the Theme Info to\n * offer more choices. This is very powerful and must be used with care, when\n * overriding the filters.\n *\n * The first filter, {@see 'themes_api_args'}, is for the args and gives the action\n * as the second parameter. The hook for {@see 'themes_api_args'} must ensure that\n * an object is returned.\n *\n * The second filter, {@see 'themes_api'}, allows a plugin to override the WordPress.org\n * Theme API entirely. If `$action` is 'query_themes', 'theme_information', or 'feature_list',\n * an object MUST be passed. If `$action` is 'hot_tags', an array should be passed.\n *\n * Finally, the third filter, {@see 'themes_api_result'}, makes it possible to filter the\n * response object or array, depending on the `$action` type.\n *\n * Supported arguments per action:\n *\n * | Argument Name      | 'query_themes' | 'theme_information' | 'hot_tags' | 'feature_list'   |\n * | -------------------| :------------: | :-----------------: | :--------: | :--------------: |\n * | `$slug`            | No             |  Yes                | No         | No               |\n * | `$per_page`        | Yes            |  No                 | No         | No               |\n * | `$page`            | Yes            |  No                 | No         | No               |\n * | `$number`          | No             |  No                 | Yes        | No               |\n * | `$search`          | Yes            |  No                 | No         | No               |\n * | `$tag`             | Yes            |  No                 | No         | No               |\n * | `$author`          | Yes            |  No                 | No         | No               |\n * | `$user`            | Yes            |  No                 | No         | No               |\n * | `$browse`          | Yes            |  No                 | No         | No               |\n * | `$locale`          | Yes            |  Yes                | No         | No               |\n * | `$fields`          | Yes            |  Yes                | No         | No               |\n *\n * @since 2.8.0\n *\n * @param string       $action API action to perform: 'query_themes', 'theme_information',\n *                             'hot_tags' or 'feature_list'.\n * @param array|object $args   {\n *     Optional. Array or object of arguments to serialize for the Themes API.\n *\n *     @type string  $slug     The theme slug. Default empty.\n *     @type int     $per_page Number of themes per page. Default 24.\n *     @type int     $page     Number of current page. Default 1.\n *     @type int     $number   Number of tags to be queried.\n *     @type string  $search   A search term. Default empty.\n *     @type string  $tag      Tag to filter themes. Default empty.\n *     @type string  $author   Username of an author to filter themes. Default empty.\n *     @type string  $user     Username to query for their favorites. Default empty.\n *     @type string  $browse   Browse view: 'featured', 'popular', 'updated', 'favorites'.\n *     @type string  $locale   Locale to provide context-sensitive results. Default is the value of get_locale().\n *     @type array   $fields   {\n *         Array of fields which should or should not be returned.\n *\n *         @type bool $description        Whether to return the theme full description. Default false.\n *         @type bool $sections           Whether to return the theme readme sections: description, installation,\n *                                        FAQ, screenshots, other notes, and changelog. Default false.\n *         @type bool $rating             Whether to return the rating in percent and total number of ratings.\n *                                        Default false.\n *         @type bool $ratings            Whether to return the number of rating for each star (1-5). Default false.\n *         @type bool $downloaded         Whether to return the download count. Default false.\n *         @type bool $downloadlink       Whether to return the download link for the package. Default false.\n *         @type bool $last_updated       Whether to return the date of the last update. Default false.\n *         @type bool $tags               Whether to return the assigned tags. Default false.\n *         @type bool $homepage           Whether to return the theme homepage link. Default false.\n *         @type bool $screenshots        Whether to return the screenshots. Default false.\n *         @type int  $screenshot_count   Number of screenshots to return. Default 1.\n *         @type bool $screenshot_url     Whether to return the URL of the first screenshot. Default false.\n *         @type bool $photon_screenshots Whether to return the screenshots via Photon. Default false.\n *         @type bool $template           Whether to return the slug of the parent theme. Default false.\n *         @type bool $parent             Whether to return the slug, name and homepage of the parent theme. Default false.\n *         @type bool $versions           Whether to return the list of all available versions. Default false.\n *         @type bool $theme_url          Whether to return theme's URL. Default false.\n *         @type bool $extended_author    Whether to return nicename or nicename and display name. Default false.\n *     }\n * }\n * @return object|array|WP_Error Response object or array on success, WP_Error on failure. See the\n *         {@link https://developer.wordpress.org/reference/functions/themes_api/ function reference article}\n *         for more information on the make-up of possible return objects depending on the value of `$action`.\n */\nfunction themes_api( $action, $args = array() ) {\n\t// Include an unmodified $wp_version.\n\trequire ABSPATH . WPINC . '/version.php';\n\n\tif ( is_array( $args ) ) {\n\t\t$args = (object) $args;\n\t}\n\n\tif ( 'query_themes' === $action ) {\n\t\tif ( ! isset( $args->per_page ) ) {\n\t\t\t$args->per_page = 24;\n\t\t}\n\t}\n\n\tif ( ! isset( $args->locale ) ) {\n\t\t$args->locale = get_user_locale();\n\t}\n\n\tif ( ! isset( $args->wp_version ) ) {\n\t\t$args->wp_version = substr( $wp_version, 0, 3 ); // x.y\n\t}\n\n\t/**\n\t * Filters arguments used to query for installer pages from the WordPress.org Themes API.\n\t *\n\t * Important: An object MUST be returned to this filter.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param object $args   Arguments used to query for installer pages from the WordPress.org Themes API.\n\t * @param string $action Requested action. Likely values are 'theme_information',\n\t *                       'feature_list', or 'query_themes'.\n\t */\n\t$args = apply_filters( 'themes_api_args', $args, $action );\n\n\t/**\n\t * Filters whether to override the WordPress.org Themes API.\n\t *\n\t * Passing a non-false value will effectively short-circuit the WordPress.org API request.\n\t *\n\t * If `$action` is 'query_themes', 'theme_information', or 'feature_list', an object MUST\n\t * be passed. If `$action` is 'hot_tags', an array should be passed.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param false|object|array $override Whether to override the WordPress.org Themes API. Default false.\n\t * @param string             $action   Requested action. Likely values are 'theme_information',\n\t *                                    'feature_list', or 'query_themes'.\n\t * @param object             $args     Arguments used to query for installer pages from the Themes API.\n\t */\n\t$res = apply_filters( 'themes_api', false, $action, $args );\n\n\tif ( ! $res ) {\n\t\t$url = 'http://api.wordpress.org/themes/info/1.2/';\n\t\t$url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'action'  => $action,\n\t\t\t\t'request' => $args,\n\t\t\t),\n\t\t\t$url\n\t\t);\n\n\t\t$http_url = $url;\n\t\t$ssl      = wp_http_supports( array( 'ssl' ) );\n\t\tif ( $ssl ) {\n\t\t\t$url = set_url_scheme( $url, 'https' );\n\t\t}\n\n\t\t$http_args = array(\n\t\t\t'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),\n\t\t);\n\t\t$request   = wp_remote_get( $url, $http_args );\n\n\t\tif ( $ssl && is_wp_error( $request ) ) {\n\t\t\tif ( ! wp_doing_ajax() ) {\n\t\t\t\ttrigger_error(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t\t\t__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=\"%s\">support forums</a>.' ),\n\t\t\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t\t\t) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),\n\t\t\t\t\theaders_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE\n\t\t\t\t);\n\t\t\t}\n\t\t\t$request = wp_remote_get( $http_url, $http_args );\n\t\t}\n\n\t\tif ( is_wp_error( $request ) ) {\n\t\t\t$res = new WP_Error(\n\t\t\t\t'themes_api_failed',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t\t__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=\"%s\">support forums</a>.' ),\n\t\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t\t),\n\t\t\t\t$request->get_error_message()\n\t\t\t);\n\t\t} else {\n\t\t\t$res = json_decode( wp_remote_retrieve_body( $request ), true );\n\t\t\tif ( is_array( $res ) ) {\n\t\t\t\t// Object casting is required in order to match the info/1.0 format.\n\t\t\t\t$res = (object) $res;\n\t\t\t} elseif ( null === $res ) {\n\t\t\t\t$res = new WP_Error(\n\t\t\t\t\t'themes_api_failed',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t\t\t__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=\"%s\">support forums</a>.' ),\n\t\t\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t\t\t),\n\t\t\t\t\twp_remote_retrieve_body( $request )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( isset( $res->error ) ) {\n\t\t\t\t$res = new WP_Error( 'themes_api_failed', $res->error );\n\t\t\t}\n\t\t}\n\n\t\t// Back-compat for info/1.2 API, upgrade the theme objects in query_themes to objects.\n\t\tif ( 'query_themes' === $action ) {\n\t\t\tforeach ( $res->themes as $i => $theme ) {\n\t\t\t\t$res->themes[ $i ] = (object) $theme;\n\t\t\t}\n\t\t}\n\t\t// Back-compat for info/1.2 API, downgrade the feature_list result back to an array.\n\t\tif ( 'feature_list' === $action ) {\n\t\t\t$res = (array) $res;\n\t\t}\n\t}\n\n\t/**\n\t * Filters the returned WordPress.org Themes API response.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array|object|WP_Error $res    WordPress.org Themes API response.\n\t * @param string                $action Requested action. Likely values are 'theme_information',\n\t *                                      'feature_list', or 'query_themes'.\n\t * @param object                $args   Arguments used to query for installer pages from the WordPress.org Themes API.\n\t */\n\treturn apply_filters( 'themes_api_result', $res, $action, $args );\n}\n\n/**\n * Prepare themes for JavaScript.\n *\n * @since 3.8.0\n *\n * @param WP_Theme[] $themes Optional. Array of theme objects to prepare.\n *                           Defaults to all allowed themes.\n *\n * @return array An associative array of theme data, sorted by name.\n */\nfunction wp_prepare_themes_for_js( $themes = null ) {\n\t$current_theme = get_stylesheet();\n\n\t/**\n\t * Filters theme data before it is prepared for JavaScript.\n\t *\n\t * Passing a non-empty array will result in wp_prepare_themes_for_js() returning\n\t * early with that value instead.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param array           $prepared_themes An associative array of theme data. Default empty array.\n\t * @param WP_Theme[]|null $themes          An array of theme objects to prepare, if any.\n\t * @param string          $current_theme   The current theme slug.\n\t */\n\t$prepared_themes = (array) apply_filters( 'pre_prepare_themes_for_js', array(), $themes, $current_theme );\n\n\tif ( ! empty( $prepared_themes ) ) {\n\t\treturn $prepared_themes;\n\t}\n\n\t// Make sure the current theme is listed first.\n\t$prepared_themes[ $current_theme ] = array();\n\n\tif ( null === $themes ) {\n\t\t$themes = wp_get_themes( array( 'allowed' => true ) );\n\t\tif ( ! isset( $themes[ $current_theme ] ) ) {\n\t\t\t$themes[ $current_theme ] = wp_get_theme();\n\t\t}\n\t}\n\n\t$updates    = array();\n\t$no_updates = array();\n\tif ( current_user_can( 'update_themes' ) ) {\n\t\t$updates_transient = get_site_transient( 'update_themes' );\n\t\tif ( isset( $updates_transient->response ) ) {\n\t\t\t$updates = $updates_transient->response;\n\t\t}\n\t\tif ( isset( $updates_transient->no_update ) ) {\n\t\t\t$no_updates = $updates_transient->no_update;\n\t\t}\n\t}\n\n\tWP_Theme::sort_by_name( $themes );\n\n\t$parents = array();\n\n\t$auto_updates = (array) get_site_option( 'auto_update_themes', array() );\n\n\tforeach ( $themes as $theme ) {\n\t\t$slug         = $theme->get_stylesheet();\n\t\t$encoded_slug = urlencode( $slug );\n\n\t\t$parent = false;\n\t\tif ( $theme->parent() ) {\n\t\t\t$parent           = $theme->parent();\n\t\t\t$parents[ $slug ] = $parent->get_stylesheet();\n\t\t\t$parent           = $parent->display( 'Name' );\n\t\t}\n\n\t\t$customize_action = null;\n\t\tif ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {\n\t\t\t$customize_action = esc_url(\n\t\t\t\tadd_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'return' => urlencode( esc_url_raw( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ),\n\t\t\t\t\t),\n\t\t\t\t\twp_customize_url( $slug )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$update_requires_wp  = isset( $updates[ $slug ]['requires'] ) ? $updates[ $slug ]['requires'] : null;\n\t\t$update_requires_php = isset( $updates[ $slug ]['requires_php'] ) ? $updates[ $slug ]['requires_php'] : null;\n\n\t\t$auto_update        = in_array( $slug, $auto_updates, true );\n\t\t$auto_update_action = $auto_update ? 'disable-auto-update' : 'enable-auto-update';\n\n\t\tif ( isset( $updates[ $slug ] ) ) {\n\t\t\t$auto_update_supported      = true;\n\t\t\t$auto_update_filter_payload = (object) $updates[ $slug ];\n\t\t} elseif ( isset( $no_updates[ $slug ] ) ) {\n\t\t\t$auto_update_supported      = true;\n\t\t\t$auto_update_filter_payload = (object) $no_updates[ $slug ];\n\t\t} else {\n\t\t\t$auto_update_supported = false;\n\t\t\t/*\n\t\t\t * Create the expected payload for the auto_update_theme filter, this is the same data\n\t\t\t * as contained within $updates or $no_updates but used when the Theme is not known.\n\t\t\t */\n\t\t\t$auto_update_filter_payload = (object) array(\n\t\t\t\t'theme'        => $slug,\n\t\t\t\t'new_version'  => $theme->get( 'Version' ),\n\t\t\t\t'url'          => '',\n\t\t\t\t'package'      => '',\n\t\t\t\t'requires'     => $theme->get( 'RequiresWP' ),\n\t\t\t\t'requires_php' => $theme->get( 'RequiresPHP' ),\n\t\t\t);\n\t\t}\n\n\t\t$type = 'theme';\n\t\t/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */\n\t\t$auto_update_forced = apply_filters( \"auto_update_{$type}\", null, $auto_update_filter_payload );\n\n\t\t$prepared_themes[ $slug ] = array(\n\t\t\t'id'             => $slug,\n\t\t\t'name'           => $theme->display( 'Name' ),\n\t\t\t'screenshot'     => array( $theme->get_screenshot() ), // @todo Multiple screenshots.\n\t\t\t'description'    => $theme->display( 'Description' ),\n\t\t\t'author'         => $theme->display( 'Author', false, true ),\n\t\t\t'authorAndUri'   => $theme->display( 'Author' ),\n\t\t\t'tags'           => $theme->display( 'Tags' ),\n\t\t\t'version'        => $theme->get( 'Version' ),\n\t\t\t'compatibleWP'   => is_wp_version_compatible( $theme->get( 'RequiresWP' ) ),\n\t\t\t'compatiblePHP'  => is_php_version_compatible( $theme->get( 'RequiresPHP' ) ),\n\t\t\t'updateResponse' => array(\n\t\t\t\t'compatibleWP'  => is_wp_version_compatible( $update_requires_wp ),\n\t\t\t\t'compatiblePHP' => is_php_version_compatible( $update_requires_php ),\n\t\t\t),\n\t\t\t'parent'         => $parent,\n\t\t\t'active'         => $slug === $current_theme,\n\t\t\t'hasUpdate'      => isset( $updates[ $slug ] ),\n\t\t\t'hasPackage'     => isset( $updates[ $slug ] ) && ! empty( $updates[ $slug ]['package'] ),\n\t\t\t'update'         => get_theme_update_available( $theme ),\n\t\t\t'autoupdate'     => array(\n\t\t\t\t'enabled'   => $auto_update || $auto_update_forced,\n\t\t\t\t'supported' => $auto_update_supported,\n\t\t\t\t'forced'    => $auto_update_forced,\n\t\t\t),\n\t\t\t'actions'        => array(\n\t\t\t\t'activate'   => current_user_can( 'switch_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=activate&amp;stylesheet=' . $encoded_slug ), 'switch-theme_' . $slug ) : null,\n\t\t\t\t'customize'  => $customize_action,\n\t\t\t\t'delete'     => current_user_can( 'delete_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=delete&amp;stylesheet=' . $encoded_slug ), 'delete-theme_' . $slug ) : null,\n\t\t\t\t'autoupdate' => wp_is_auto_update_enabled_for_type( 'theme' ) && ! is_multisite() && current_user_can( 'update_themes' )\n\t\t\t\t\t? wp_nonce_url( admin_url( 'themes.php?action=' . $auto_update_action . '&amp;stylesheet=' . $encoded_slug ), 'updates' )\n\t\t\t\t\t: null,\n\t\t\t),\n\t\t);\n\t}\n\n\t// Remove 'delete' action if theme has an active child.\n\tif ( ! empty( $parents ) && array_key_exists( $current_theme, $parents ) ) {\n\t\tunset( $prepared_themes[ $parents[ $current_theme ] ]['actions']['delete'] );\n\t}\n\n\t/**\n\t * Filters the themes prepared for JavaScript, for themes.php.\n\t *\n\t * Could be useful for changing the order, which is by name by default.\n\t *\n\t * @since 3.8.0\n\t *\n\t * @param array $prepared_themes Array of theme data.\n\t */\n\t$prepared_themes = apply_filters( 'wp_prepare_themes_for_js', $prepared_themes );\n\t$prepared_themes = array_values( $prepared_themes );\n\treturn array_filter( $prepared_themes );\n}\n\n/**\n * Print JS templates for the theme-browsing UI in the Customizer.\n *\n * @since 4.2.0\n */\nfunction customize_themes_print_templates() {\n\t?>\n\t<script type=\"text/html\" id=\"tmpl-customize-themes-details-view\">\n\t\t<div class=\"theme-backdrop\"></div>\n\t\t<div class=\"theme-wrap wp-clearfix\" role=\"document\">\n\t\t\t<div class=\"theme-header\">\n\t\t\t\t<button type=\"button\" class=\"left dashicons dashicons-no\"><span class=\"screen-reader-text\"><?php _e( 'Show previous theme' ); ?></span></button>\n\t\t\t\t<button type=\"button\" class=\"right dashicons dashicons-no\"><span class=\"screen-reader-text\"><?php _e( 'Show next theme' ); ?></span></button>\n\t\t\t\t<button type=\"button\" class=\"close dashicons dashicons-no\"><span class=\"screen-reader-text\"><?php _e( 'Close details dialog' ); ?></span></button>\n\t\t\t</div>\n\t\t\t<div class=\"theme-about wp-clearfix\">\n\t\t\t\t<div class=\"theme-screenshots\">\n\t\t\t\t<# if ( data.screenshot && data.screenshot[0] ) { #>\n\t\t\t\t\t<div class=\"screenshot\"><img src=\"{{ data.screenshot[0] }}\" alt=\"\" /></div>\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<div class=\"screenshot blank\"></div>\n\t\t\t\t<# } #>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"theme-info\">\n\t\t\t\t\t<# if ( data.active ) { #>\n\t\t\t\t\t\t<span class=\"current-label\"><?php _e( 'Current Theme' ); ?></span>\n\t\t\t\t\t<# } #>\n\t\t\t\t\t<h2 class=\"theme-name\">{{{ data.name }}}<span class=\"theme-version\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t/* translators: %s: Theme version. */\n\t\t\t\t\t\tprintf( __( 'Version: %s' ), '{{ data.version }}' );\n\t\t\t\t\t\t?>\n\t\t\t\t\t</span></h2>\n\t\t\t\t\t<h3 class=\"theme-author\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t/* translators: %s: Theme author link. */\n\t\t\t\t\t\tprintf( __( 'By %s' ), '{{{ data.authorAndUri }}}' );\n\t\t\t\t\t\t?>\n\t\t\t\t\t</h3>\n\n\t\t\t\t\t<# if ( data.stars && 0 != data.num_ratings ) { #>\n\t\t\t\t\t\t<div class=\"theme-rating\">\n\t\t\t\t\t\t\t{{{ data.stars }}}\n\t\t\t\t\t\t\t<a class=\"num-ratings\" target=\"_blank\" href=\"{{ data.reviews_url }}\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t'%1$s <span class=\"screen-reader-text\">%2$s</span>',\n\t\t\t\t\t\t\t\t\t/* translators: %s: Number of ratings. */\n\t\t\t\t\t\t\t\t\tsprintf( __( '(%s ratings)' ), '{{ data.num_ratings }}' ),\n\t\t\t\t\t\t\t\t\t/* translators: Accessibility text. */\n\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\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</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<# } #>\n\n\t\t\t\t\t<# if ( data.hasUpdate ) { #>\n\t\t\t\t\t\t<# if ( data.updateResponse.compatibleWP && data.updateResponse.compatiblePHP ) { #>\n\t\t\t\t\t\t\t<div class=\"notice notice-warning notice-alt notice-large\" data-slug=\"{{ data.id }}\">\n\t\t\t\t\t\t\t\t<h3 class=\"notice-title\"><?php _e( 'Update Available' ); ?></h3>\n\t\t\t\t\t\t\t\t{{{ data.update }}}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t<div class=\"notice notice-error notice-alt notice-large\" data-slug=\"{{ data.id }}\">\n\t\t\t\t\t\t\t\t<h3 class=\"notice-title\"><?php _e( 'Update Incompatible' ); ?></h3>\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t<# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t\t\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),\n\t\t\t\t\t\t\t\t\t\t\t'{{{ data.name }}}'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tif ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%1$s\">Please update WordPress</a>, and then <a href=\"%2$s\">learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t\t\t\t\t\t} elseif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} elseif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<# } else if ( ! data.updateResponse.compatibleWP ) { #>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t\t\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),\n\t\t\t\t\t\t\t\t\t\t\t'{{{ data.name }}}'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<# } else if ( ! data.updateResponse.compatiblePHP ) { #>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t\t\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),\n\t\t\t\t\t\t\t\t\t\t\t'{{{ data.name }}}'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t\t\t\t\t\t}\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</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t<# } #>\n\n\t\t\t\t\t<# if ( data.parent ) { #>\n\t\t\t\t\t\t<p class=\"parent-theme\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t\t\t__( 'This is a child theme of %s.' ),\n\t\t\t\t\t\t\t\t'<strong>{{{ data.parent }}}</strong>'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t<# } #>\n\n\t\t\t\t\t<# if ( ! data.compatibleWP || ! data.compatiblePHP ) { #>\n\t\t\t\t\t\t<div class=\"notice notice-error notice-alt notice-large\"><p>\n\t\t\t\t\t\t\t<# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t_e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );\n\t\t\t\t\t\t\t\tif ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%1$s\">Please update WordPress</a>, and then <a href=\"%2$s\">learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t\t\t\t} elseif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} elseif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\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<# } else if ( ! data.compatibleWP ) { #>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t_e( 'This theme doesn&#8217;t work with your version of WordPress.' );\n\t\t\t\t\t\t\t\tif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\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\t?>\n\t\t\t\t\t\t\t<# } else if ( ! data.compatiblePHP ) { #>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t_e( 'This theme doesn&#8217;t work with your version of PHP.' );\n\t\t\t\t\t\t\t\tif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\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<# } #>\n\t\t\t\t\t\t</p></div>\n\t\t\t\t\t<# } #>\n\n\t\t\t\t\t<p class=\"theme-description\">{{{ data.description }}}</p>\n\n\t\t\t\t\t<# if ( data.tags ) { #>\n\t\t\t\t\t\t<p class=\"theme-tags\"><span><?php _e( 'Tags:' ); ?></span> {{{ data.tags }}}</p>\n\t\t\t\t\t<# } #>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class=\"theme-actions\">\n\t\t\t\t<# if ( data.active ) { #>\n\t\t\t\t\t<button type=\"button\" class=\"button button-primary customize-theme\"><?php _e( 'Customize' ); ?></button>\n\t\t\t\t<# } else if ( 'installed' === data.type ) { #>\n\t\t\t\t\t<?php if ( current_user_can( 'delete_themes' ) ) { ?>\n\t\t\t\t\t\t<# if ( data.actions && data.actions['delete'] ) { #>\n\t\t\t\t\t\t\t<a href=\"{{{ data.actions['delete'] }}}\" data-slug=\"{{ data.id }}\" class=\"button button-secondary delete-theme\"><?php _e( 'Delete' ); ?></a>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t<?php } ?>\n\n\t\t\t\t\t<# if ( data.compatibleWP && data.compatiblePHP ) { #>\n\t\t\t\t\t\t<button type=\"button\" class=\"button button-primary preview-theme\" data-slug=\"{{ data.id }}\"><?php _e( 'Live Preview' ); ?></button>\n\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t<button class=\"button button-primary disabled\"><?php _e( 'Live Preview' ); ?></button>\n\t\t\t\t\t<# } #>\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<# if ( data.compatibleWP && data.compatiblePHP ) { #>\n\t\t\t\t\t\t<button type=\"button\" class=\"button theme-install\" data-slug=\"{{ data.id }}\"><?php _e( 'Install' ); ?></button>\n\t\t\t\t\t\t<button type=\"button\" class=\"button button-primary theme-install preview\" data-slug=\"{{ data.id }}\"><?php _e( 'Install &amp; Preview' ); ?></button>\n\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t<button type=\"button\" class=\"button disabled\"><?php _ex( 'Cannot Install', 'theme' ); ?></button>\n\t\t\t\t\t\t<button type=\"button\" class=\"button button-primary disabled\"><?php _e( 'Install &amp; Preview' ); ?></button>\n\t\t\t\t\t<# } #>\n\t\t\t\t<# } #>\n\t\t\t</div>\n\t\t</div>\n\t</script>\n\t<?php\n}\n\n/**\n * Determines whether a theme is technically active but was paused while\n * loading.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 5.2.0\n *\n * @param string $theme Path to the theme directory relative to the themes directory.\n * @return bool True, if in the list of paused themes. False, not in the list.\n */\nfunction is_theme_paused( $theme ) {\n\tif ( ! isset( $GLOBALS['_paused_themes'] ) ) {\n\t\treturn false;\n\t}\n\n\tif ( get_stylesheet() !== $theme && get_template() !== $theme ) {\n\t\treturn false;\n\t}\n\n\treturn array_key_exists( $theme, $GLOBALS['_paused_themes'] );\n}\n\n/**\n * Gets the error that was recorded for a paused theme.\n *\n * @since 5.2.0\n *\n * @param string $theme Path to the theme directory relative to the themes\n *                      directory.\n * @return array|false Array of error information as it was returned by\n *                     `error_get_last()`, or false if none was recorded.\n */\nfunction wp_get_theme_error( $theme ) {\n\tif ( ! isset( $GLOBALS['_paused_themes'] ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! array_key_exists( $theme, $GLOBALS['_paused_themes'] ) ) {\n\t\treturn false;\n\t}\n\n\treturn $GLOBALS['_paused_themes'][ $theme ];\n}\n\n/**\n * Tries to resume a single theme.\n *\n * If a redirect was provided and a functions.php file was found, we first ensure that\n * functions.php file does not throw fatal errors anymore.\n *\n * The way it works is by setting the redirection to the error before trying to\n * include the file. If the theme fails, then the redirection will not be overwritten\n * with the success message and the theme will not be resumed.\n *\n * @since 5.2.0\n *\n * @param string $theme    Single theme to resume.\n * @param string $redirect Optional. URL to redirect to. Default empty string.\n * @return bool|WP_Error True on success, false if `$theme` was not paused,\n *                       `WP_Error` on failure.\n */\nfunction resume_theme( $theme, $redirect = '' ) {\n\tlist( $extension ) = explode( '/', $theme );\n\n\t/*\n\t * We'll override this later if the theme could be resumed without\n\t * creating a fatal error.\n\t */\n\tif ( ! empty( $redirect ) ) {\n\t\t$functions_path = '';\n\t\tif ( strpos( STYLESHEETPATH, $extension ) ) {\n\t\t\t$functions_path = STYLESHEETPATH . '/functions.php';\n\t\t} elseif ( strpos( TEMPLATEPATH, $extension ) ) {\n\t\t\t$functions_path = TEMPLATEPATH . '/functions.php';\n\t\t}\n\n\t\tif ( ! empty( $functions_path ) ) {\n\t\t\twp_redirect(\n\t\t\t\tadd_query_arg(\n\t\t\t\t\t'_error_nonce',\n\t\t\t\t\twp_create_nonce( 'theme-resume-error_' . $theme ),\n\t\t\t\t\t$redirect\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Load the theme's functions.php to test whether it throws a fatal error.\n\t\t\tob_start();\n\t\t\tif ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {\n\t\t\t\tdefine( 'WP_SANDBOX_SCRAPING', true );\n\t\t\t}\n\t\t\tinclude $functions_path;\n\t\t\tob_clean();\n\t\t}\n\t}\n\n\t$result = wp_paused_themes()->delete( $extension );\n\n\tif ( ! $result ) {\n\t\treturn new WP_Error(\n\t\t\t'could_not_resume_theme',\n\t\t\t__( 'Could not resume the theme.' )\n\t\t);\n\t}\n\n\treturn true;\n}\n\n/**\n * Renders an admin notice in case some themes have been paused due to errors.\n *\n * @since 5.2.0\n */\nfunction paused_themes_notice() {\n\tif ( 'themes.php' === $GLOBALS['pagenow'] ) {\n\t\treturn;\n\t}\n\n\tif ( ! current_user_can( 'resume_themes' ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! isset( $GLOBALS['_paused_themes'] ) || empty( $GLOBALS['_paused_themes'] ) ) {\n\t\treturn;\n\t}\n\n\tprintf(\n\t\t'<div class=\"notice notice-error\"><p><strong>%s</strong><br>%s</p><p><a href=\"%s\">%s</a></p></div>',\n\t\t__( 'One or more themes failed to load properly.' ),\n\t\t__( 'You can find more details and make changes on the Themes screen.' ),\n\t\tesc_url( admin_url( 'themes.php' ) ),\n\t\t__( 'Go to the Themes screen' )\n\t);\n}\n", "num_lines": 1154}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Translation Installation Administration API\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n\n/**\n * Retrieve translations from WordPress Translation API.\n *\n * @since 4.0.0\n *\n * @param string       $type Type of translations. Accepts 'plugins', 'themes', 'core'.\n * @param array|object $args Translation API arguments. Optional.\n * @return object|WP_Error On success an object of translations, WP_Error on failure.\n */\nfunction translations_api( $type, $args = null ) {\n\t// Include an unmodified $wp_version.\n\trequire ABSPATH . WPINC . '/version.php';\n\n\tif ( ! in_array( $type, array( 'plugins', 'themes', 'core' ), true ) ) {\n\t\treturn new WP_Error( 'invalid_type', __( 'Invalid translation type.' ) );\n\t}\n\n\t/**\n\t * Allows a plugin to override the WordPress.org Translation Installation API entirely.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param bool|array  $result The result object. Default false.\n\t * @param string      $type   The type of translations being requested.\n\t * @param object      $args   Translation API arguments.\n\t */\n\t$res = apply_filters( 'translations_api', false, $type, $args );\n\n\tif ( false === $res ) {\n\t\t$url      = 'http://api.wordpress.org/translations/' . $type . '/1.0/';\n\t\t$http_url = $url;\n\t\t$ssl      = wp_http_supports( array( 'ssl' ) );\n\t\tif ( $ssl ) {\n\t\t\t$url = set_url_scheme( $url, 'https' );\n\t\t}\n\n\t\t$options = array(\n\t\t\t'timeout' => 3,\n\t\t\t'body'    => array(\n\t\t\t\t'wp_version' => $wp_version,\n\t\t\t\t'locale'     => get_locale(),\n\t\t\t\t'version'    => $args['version'], // Version of plugin, theme or core.\n\t\t\t),\n\t\t);\n\n\t\tif ( 'core' !== $type ) {\n\t\t\t$options['body']['slug'] = $args['slug']; // Plugin or theme slug.\n\t\t}\n\n\t\t$request = wp_remote_post( $url, $options );\n\n\t\tif ( $ssl && is_wp_error( $request ) ) {\n\t\t\ttrigger_error(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t\t__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=\"%s\">support forums</a>.' ),\n\t\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t\t) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),\n\t\t\t\theaders_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE\n\t\t\t);\n\n\t\t\t$request = wp_remote_post( $http_url, $options );\n\t\t}\n\n\t\tif ( is_wp_error( $request ) ) {\n\t\t\t$res = new WP_Error(\n\t\t\t\t'translations_api_failed',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t\t__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=\"%s\">support forums</a>.' ),\n\t\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t\t),\n\t\t\t\t$request->get_error_message()\n\t\t\t);\n\t\t} else {\n\t\t\t$res = json_decode( wp_remote_retrieve_body( $request ), true );\n\t\t\tif ( ! is_object( $res ) && ! is_array( $res ) ) {\n\t\t\t\t$res = new WP_Error(\n\t\t\t\t\t'translations_api_failed',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t\t\t__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=\"%s\">support forums</a>.' ),\n\t\t\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t\t\t),\n\t\t\t\t\twp_remote_retrieve_body( $request )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filters the Translation Installation API response results.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param object|WP_Error $res  Response object or WP_Error.\n\t * @param string          $type The type of translations being requested.\n\t * @param object          $args Translation API arguments.\n\t */\n\treturn apply_filters( 'translations_api_result', $res, $type, $args );\n}\n\n/**\n * Get available translations from the WordPress.org API.\n *\n * @since 4.0.0\n *\n * @see translations_api()\n *\n * @return array[] Array of translations, each an array of data, keyed by the language. If the API response results\n *                 in an error, an empty array will be returned.\n */\nfunction wp_get_available_translations() {\n\tif ( ! wp_installing() ) {\n\t\t$translations = get_site_transient( 'available_translations' );\n\t\tif ( false !== $translations ) {\n\t\t\treturn $translations;\n\t\t}\n\t}\n\n\t// Include an unmodified $wp_version.\n\trequire ABSPATH . WPINC . '/version.php';\n\n\t$api = translations_api( 'core', array( 'version' => $wp_version ) );\n\n\tif ( is_wp_error( $api ) || empty( $api['translations'] ) ) {\n\t\treturn array();\n\t}\n\n\t$translations = array();\n\t// Key the array with the language code for now.\n\tforeach ( $api['translations'] as $translation ) {\n\t\t$translations[ $translation['language'] ] = $translation;\n\t}\n\n\tif ( ! defined( 'WP_INSTALLING' ) ) {\n\t\tset_site_transient( 'available_translations', $translations, 3 * HOUR_IN_SECONDS );\n\t}\n\n\treturn $translations;\n}\n\n/**\n * Output the select form for the language selection on the installation screen.\n *\n * @since 4.0.0\n *\n * @global string $wp_local_package Locale code of the package.\n *\n * @param array[] $languages Array of available languages (populated via the Translation API).\n */\nfunction wp_install_language_form( $languages ) {\n\tglobal $wp_local_package;\n\n\t$installed_languages = get_available_languages();\n\n\techo \"<label class='screen-reader-text' for='language'>Select a default language</label>\\n\";\n\techo \"<select size='14' name='language' id='language'>\\n\";\n\techo '<option value=\"\" lang=\"en\" selected=\"selected\" data-continue=\"Continue\" data-installed=\"1\">English (United States)</option>';\n\techo \"\\n\";\n\n\tif ( ! empty( $wp_local_package ) && isset( $languages[ $wp_local_package ] ) ) {\n\t\tif ( isset( $languages[ $wp_local_package ] ) ) {\n\t\t\t$language = $languages[ $wp_local_package ];\n\t\t\tprintf(\n\t\t\t\t'<option value=\"%s\" lang=\"%s\" data-continue=\"%s\"%s>%s</option>' . \"\\n\",\n\t\t\t\tesc_attr( $language['language'] ),\n\t\t\t\tesc_attr( current( $language['iso'] ) ),\n\t\t\t\tesc_attr( $language['strings']['continue'] ? $language['strings']['continue'] : 'Continue' ),\n\t\t\t\tin_array( $language['language'], $installed_languages, true ) ? ' data-installed=\"1\"' : '',\n\t\t\t\tesc_html( $language['native_name'] )\n\t\t\t);\n\n\t\t\tunset( $languages[ $wp_local_package ] );\n\t\t}\n\t}\n\n\tforeach ( $languages as $language ) {\n\t\tprintf(\n\t\t\t'<option value=\"%s\" lang=\"%s\" data-continue=\"%s\"%s>%s</option>' . \"\\n\",\n\t\t\tesc_attr( $language['language'] ),\n\t\t\tesc_attr( current( $language['iso'] ) ),\n\t\t\tesc_attr( $language['strings']['continue'] ? $language['strings']['continue'] : 'Continue' ),\n\t\t\tin_array( $language['language'], $installed_languages, true ) ? ' data-installed=\"1\"' : '',\n\t\t\tesc_html( $language['native_name'] )\n\t\t);\n\t}\n\techo \"</select>\\n\";\n\techo '<p class=\"step\"><span class=\"spinner\"></span><input id=\"language-continue\" type=\"submit\" class=\"button button-primary button-large\" value=\"Continue\" /></p>';\n}\n\n/**\n * Download a language pack.\n *\n * @since 4.0.0\n *\n * @see wp_get_available_translations()\n *\n * @param string $download Language code to download.\n * @return string|bool Returns the language code if successfully downloaded\n *                     (or already installed), or false on failure.\n */\nfunction wp_download_language_pack( $download ) {\n\t// Check if the translation is already installed.\n\tif ( in_array( $download, get_available_languages(), true ) ) {\n\t\treturn $download;\n\t}\n\n\tif ( ! wp_is_file_mod_allowed( 'download_language_pack' ) ) {\n\t\treturn false;\n\t}\n\n\t// Confirm the translation is one we can download.\n\t$translations = wp_get_available_translations();\n\tif ( ! $translations ) {\n\t\treturn false;\n\t}\n\tforeach ( $translations as $translation ) {\n\t\tif ( $translation['language'] === $download ) {\n\t\t\t$translation_to_load = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ( empty( $translation_to_load ) ) {\n\t\treturn false;\n\t}\n\t$translation = (object) $translation;\n\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\t$skin              = new Automatic_Upgrader_Skin;\n\t$upgrader          = new Language_Pack_Upgrader( $skin );\n\t$translation->type = 'core';\n\t$result            = $upgrader->upgrade( $translation, array( 'clear_update_cache' => false ) );\n\n\tif ( ! $result || is_wp_error( $result ) ) {\n\t\treturn false;\n\t}\n\n\treturn $translation->language;\n}\n\n/**\n * Check if WordPress has access to the filesystem without asking for\n * credentials.\n *\n * @since 4.0.0\n *\n * @return bool Returns true on success, false on failure.\n */\nfunction wp_can_install_language_pack() {\n\tif ( ! wp_is_file_mod_allowed( 'can_install_language_pack' ) ) {\n\t\treturn false;\n\t}\n\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\t$skin     = new Automatic_Upgrader_Skin;\n\t$upgrader = new Language_Pack_Upgrader( $skin );\n\t$upgrader->init();\n\n\t$check = $upgrader->fs_connect( array( WP_CONTENT_DIR, WP_LANG_DIR ) );\n\n\tif ( ! $check || is_wp_error( $check ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n", "num_lines": 278}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress core upgrade functionality.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 2.7.0\n */\n\n/**\n * Stores files to be deleted.\n *\n * @since 2.7.0\n *\n * @global array $_old_files\n * @var array\n * @name $_old_files\n */\nglobal $_old_files;\n\n$_old_files = array(\n\t// 2.0\n\t'wp-admin/import-b2.php',\n\t'wp-admin/import-blogger.php',\n\t'wp-admin/import-greymatter.php',\n\t'wp-admin/import-livejournal.php',\n\t'wp-admin/import-mt.php',\n\t'wp-admin/import-rss.php',\n\t'wp-admin/import-textpattern.php',\n\t'wp-admin/quicktags.js',\n\t'wp-images/fade-butt.png',\n\t'wp-images/get-firefox.png',\n\t'wp-images/header-shadow.png',\n\t'wp-images/smilies',\n\t'wp-images/wp-small.png',\n\t'wp-images/wpminilogo.png',\n\t'wp.php',\n\t// 2.0.8\n\t'wp-includes/js/tinymce/plugins/inlinepopups/readme.txt',\n\t// 2.1\n\t'wp-admin/edit-form-ajax-cat.php',\n\t'wp-admin/execute-pings.php',\n\t'wp-admin/inline-uploading.php',\n\t'wp-admin/link-categories.php',\n\t'wp-admin/list-manipulation.js',\n\t'wp-admin/list-manipulation.php',\n\t'wp-includes/comment-functions.php',\n\t'wp-includes/feed-functions.php',\n\t'wp-includes/functions-compat.php',\n\t'wp-includes/functions-formatting.php',\n\t'wp-includes/functions-post.php',\n\t'wp-includes/js/dbx-key.js',\n\t'wp-includes/js/tinymce/plugins/autosave/langs/cs.js',\n\t'wp-includes/js/tinymce/plugins/autosave/langs/sv.js',\n\t'wp-includes/links.php',\n\t'wp-includes/pluggable-functions.php',\n\t'wp-includes/template-functions-author.php',\n\t'wp-includes/template-functions-category.php',\n\t'wp-includes/template-functions-general.php',\n\t'wp-includes/template-functions-links.php',\n\t'wp-includes/template-functions-post.php',\n\t'wp-includes/wp-l10n.php',\n\t// 2.2\n\t'wp-admin/cat-js.php',\n\t'wp-admin/import/b2.php',\n\t'wp-includes/js/autosave-js.php',\n\t'wp-includes/js/list-manipulation-js.php',\n\t'wp-includes/js/wp-ajax-js.php',\n\t// 2.3\n\t'wp-admin/admin-db.php',\n\t'wp-admin/cat.js',\n\t'wp-admin/categories.js',\n\t'wp-admin/custom-fields.js',\n\t'wp-admin/dbx-admin-key.js',\n\t'wp-admin/edit-comments.js',\n\t'wp-admin/install-rtl.css',\n\t'wp-admin/install.css',\n\t'wp-admin/upgrade-schema.php',\n\t'wp-admin/upload-functions.php',\n\t'wp-admin/upload-rtl.css',\n\t'wp-admin/upload.css',\n\t'wp-admin/upload.js',\n\t'wp-admin/users.js',\n\t'wp-admin/widgets-rtl.css',\n\t'wp-admin/widgets.css',\n\t'wp-admin/xfn.js',\n\t'wp-includes/js/tinymce/license.html',\n\t// 2.5\n\t'wp-admin/css/upload.css',\n\t'wp-admin/images/box-bg-left.gif',\n\t'wp-admin/images/box-bg-right.gif',\n\t'wp-admin/images/box-bg.gif',\n\t'wp-admin/images/box-butt-left.gif',\n\t'wp-admin/images/box-butt-right.gif',\n\t'wp-admin/images/box-butt.gif',\n\t'wp-admin/images/box-head-left.gif',\n\t'wp-admin/images/box-head-right.gif',\n\t'wp-admin/images/box-head.gif',\n\t'wp-admin/images/heading-bg.gif',\n\t'wp-admin/images/login-bkg-bottom.gif',\n\t'wp-admin/images/login-bkg-tile.gif',\n\t'wp-admin/images/notice.gif',\n\t'wp-admin/images/toggle.gif',\n\t'wp-admin/includes/upload.php',\n\t'wp-admin/js/dbx-admin-key.js',\n\t'wp-admin/js/link-cat.js',\n\t'wp-admin/profile-update.php',\n\t'wp-admin/templates.php',\n\t'wp-includes/images/wlw/WpComments.png',\n\t'wp-includes/images/wlw/WpIcon.png',\n\t'wp-includes/images/wlw/WpWatermark.png',\n\t'wp-includes/js/dbx.js',\n\t'wp-includes/js/fat.js',\n\t'wp-includes/js/list-manipulation.js',\n\t'wp-includes/js/tinymce/langs/en.js',\n\t'wp-includes/js/tinymce/plugins/autosave/editor_plugin_src.js',\n\t'wp-includes/js/tinymce/plugins/autosave/langs',\n\t'wp-includes/js/tinymce/plugins/directionality/images',\n\t'wp-includes/js/tinymce/plugins/directionality/langs',\n\t'wp-includes/js/tinymce/plugins/inlinepopups/css',\n\t'wp-includes/js/tinymce/plugins/inlinepopups/images',\n\t'wp-includes/js/tinymce/plugins/inlinepopups/jscripts',\n\t'wp-includes/js/tinymce/plugins/paste/images',\n\t'wp-includes/js/tinymce/plugins/paste/jscripts',\n\t'wp-includes/js/tinymce/plugins/paste/langs',\n\t'wp-includes/js/tinymce/plugins/spellchecker/classes/HttpClient.class.php',\n\t'wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php',\n\t'wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspell.class.php',\n\t'wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php',\n\t'wp-includes/js/tinymce/plugins/spellchecker/css/spellchecker.css',\n\t'wp-includes/js/tinymce/plugins/spellchecker/images',\n\t'wp-includes/js/tinymce/plugins/spellchecker/langs',\n\t'wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php',\n\t'wp-includes/js/tinymce/plugins/wordpress/images',\n\t'wp-includes/js/tinymce/plugins/wordpress/langs',\n\t'wp-includes/js/tinymce/plugins/wordpress/wordpress.css',\n\t'wp-includes/js/tinymce/plugins/wphelp',\n\t'wp-includes/js/tinymce/themes/advanced/css',\n\t'wp-includes/js/tinymce/themes/advanced/images',\n\t'wp-includes/js/tinymce/themes/advanced/jscripts',\n\t'wp-includes/js/tinymce/themes/advanced/langs',\n\t// 2.5.1\n\t'wp-includes/js/tinymce/tiny_mce_gzip.php',\n\t// 2.6\n\t'wp-admin/bookmarklet.php',\n\t'wp-includes/js/jquery/jquery.dimensions.min.js',\n\t'wp-includes/js/tinymce/plugins/wordpress/popups.css',\n\t'wp-includes/js/wp-ajax.js',\n\t// 2.7\n\t'wp-admin/css/press-this-ie-rtl.css',\n\t'wp-admin/css/press-this-ie.css',\n\t'wp-admin/css/upload-rtl.css',\n\t'wp-admin/edit-form.php',\n\t'wp-admin/images/comment-pill.gif',\n\t'wp-admin/images/comment-stalk-classic.gif',\n\t'wp-admin/images/comment-stalk-fresh.gif',\n\t'wp-admin/images/comment-stalk-rtl.gif',\n\t'wp-admin/images/del.png',\n\t'wp-admin/images/gear.png',\n\t'wp-admin/images/media-button-gallery.gif',\n\t'wp-admin/images/media-buttons.gif',\n\t'wp-admin/images/postbox-bg.gif',\n\t'wp-admin/images/tab.png',\n\t'wp-admin/images/tail.gif',\n\t'wp-admin/js/forms.js',\n\t'wp-admin/js/upload.js',\n\t'wp-admin/link-import.php',\n\t'wp-includes/images/audio.png',\n\t'wp-includes/images/css.png',\n\t'wp-includes/images/default.png',\n\t'wp-includes/images/doc.png',\n\t'wp-includes/images/exe.png',\n\t'wp-includes/images/html.png',\n\t'wp-includes/images/js.png',\n\t'wp-includes/images/pdf.png',\n\t'wp-includes/images/swf.png',\n\t'wp-includes/images/tar.png',\n\t'wp-includes/images/text.png',\n\t'wp-includes/images/video.png',\n\t'wp-includes/images/zip.png',\n\t'wp-includes/js/tinymce/tiny_mce_config.php',\n\t'wp-includes/js/tinymce/tiny_mce_ext.js',\n\t// 2.8\n\t'wp-admin/js/users.js',\n\t'wp-includes/js/swfupload/plugins/swfupload.documentready.js',\n\t'wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js',\n\t'wp-includes/js/swfupload/swfupload_f9.swf',\n\t'wp-includes/js/tinymce/plugins/autosave',\n\t'wp-includes/js/tinymce/plugins/paste/css',\n\t'wp-includes/js/tinymce/utils/mclayer.js',\n\t'wp-includes/js/tinymce/wordpress.css',\n\t// 2.8.5\n\t'wp-admin/import/btt.php',\n\t'wp-admin/import/jkw.php',\n\t// 2.9\n\t'wp-admin/js/page.dev.js',\n\t'wp-admin/js/page.js',\n\t'wp-admin/js/set-post-thumbnail-handler.dev.js',\n\t'wp-admin/js/set-post-thumbnail-handler.js',\n\t'wp-admin/js/slug.dev.js',\n\t'wp-admin/js/slug.js',\n\t'wp-includes/gettext.php',\n\t'wp-includes/js/tinymce/plugins/wordpress/js',\n\t'wp-includes/streams.php',\n\t// MU\n\t'README.txt',\n\t'htaccess.dist',\n\t'index-install.php',\n\t'wp-admin/css/mu-rtl.css',\n\t'wp-admin/css/mu.css',\n\t'wp-admin/images/site-admin.png',\n\t'wp-admin/includes/mu.php',\n\t'wp-admin/wpmu-admin.php',\n\t'wp-admin/wpmu-blogs.php',\n\t'wp-admin/wpmu-edit.php',\n\t'wp-admin/wpmu-options.php',\n\t'wp-admin/wpmu-themes.php',\n\t'wp-admin/wpmu-upgrade-site.php',\n\t'wp-admin/wpmu-users.php',\n\t'wp-includes/images/wordpress-mu.png',\n\t'wp-includes/wpmu-default-filters.php',\n\t'wp-includes/wpmu-functions.php',\n\t'wpmu-settings.php',\n\t// 3.0\n\t'wp-admin/categories.php',\n\t'wp-admin/edit-category-form.php',\n\t'wp-admin/edit-page-form.php',\n\t'wp-admin/edit-pages.php',\n\t'wp-admin/images/admin-header-footer.png',\n\t'wp-admin/images/browse-happy.gif',\n\t'wp-admin/images/ico-add.png',\n\t'wp-admin/images/ico-close.png',\n\t'wp-admin/images/ico-edit.png',\n\t'wp-admin/images/ico-viewpage.png',\n\t'wp-admin/images/fav-top.png',\n\t'wp-admin/images/screen-options-left.gif',\n\t'wp-admin/images/wp-logo-vs.gif',\n\t'wp-admin/images/wp-logo.gif',\n\t'wp-admin/import',\n\t'wp-admin/js/wp-gears.dev.js',\n\t'wp-admin/js/wp-gears.js',\n\t'wp-admin/options-misc.php',\n\t'wp-admin/page-new.php',\n\t'wp-admin/page.php',\n\t'wp-admin/rtl.css',\n\t'wp-admin/rtl.dev.css',\n\t'wp-admin/update-links.php',\n\t'wp-admin/wp-admin.css',\n\t'wp-admin/wp-admin.dev.css',\n\t'wp-includes/js/codepress',\n\t'wp-includes/js/codepress/engines/khtml.js',\n\t'wp-includes/js/codepress/engines/older.js',\n\t'wp-includes/js/jquery/autocomplete.dev.js',\n\t'wp-includes/js/jquery/autocomplete.js',\n\t'wp-includes/js/jquery/interface.js',\n\t'wp-includes/js/scriptaculous/prototype.js',\n\t// Following file added back in 5.1, see #45645.\n\t//'wp-includes/js/tinymce/wp-tinymce.js',\n\t// 3.1\n\t'wp-admin/edit-attachment-rows.php',\n\t'wp-admin/edit-link-categories.php',\n\t'wp-admin/edit-link-category-form.php',\n\t'wp-admin/edit-post-rows.php',\n\t'wp-admin/images/button-grad-active-vs.png',\n\t'wp-admin/images/button-grad-vs.png',\n\t'wp-admin/images/fav-arrow-vs-rtl.gif',\n\t'wp-admin/images/fav-arrow-vs.gif',\n\t'wp-admin/images/fav-top-vs.gif',\n\t'wp-admin/images/list-vs.png',\n\t'wp-admin/images/screen-options-right-up.gif',\n\t'wp-admin/images/screen-options-right.gif',\n\t'wp-admin/images/visit-site-button-grad-vs.gif',\n\t'wp-admin/images/visit-site-button-grad.gif',\n\t'wp-admin/link-category.php',\n\t'wp-admin/sidebar.php',\n\t'wp-includes/classes.php',\n\t'wp-includes/js/tinymce/blank.htm',\n\t'wp-includes/js/tinymce/plugins/media/css/content.css',\n\t'wp-includes/js/tinymce/plugins/media/img',\n\t'wp-includes/js/tinymce/plugins/safari',\n\t// 3.2\n\t'wp-admin/images/logo-login.gif',\n\t'wp-admin/images/star.gif',\n\t'wp-admin/js/list-table.dev.js',\n\t'wp-admin/js/list-table.js',\n\t'wp-includes/default-embeds.php',\n\t'wp-includes/js/tinymce/plugins/wordpress/img/help.gif',\n\t'wp-includes/js/tinymce/plugins/wordpress/img/more.gif',\n\t'wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif',\n\t'wp-includes/js/tinymce/themes/advanced/img/fm.gif',\n\t'wp-includes/js/tinymce/themes/advanced/img/sflogo.png',\n\t// 3.3\n\t'wp-admin/css/colors-classic-rtl.css',\n\t'wp-admin/css/colors-classic-rtl.dev.css',\n\t'wp-admin/css/colors-fresh-rtl.css',\n\t'wp-admin/css/colors-fresh-rtl.dev.css',\n\t'wp-admin/css/dashboard-rtl.dev.css',\n\t'wp-admin/css/dashboard.dev.css',\n\t'wp-admin/css/global-rtl.css',\n\t'wp-admin/css/global-rtl.dev.css',\n\t'wp-admin/css/global.css',\n\t'wp-admin/css/global.dev.css',\n\t'wp-admin/css/install-rtl.dev.css',\n\t'wp-admin/css/login-rtl.dev.css',\n\t'wp-admin/css/login.dev.css',\n\t'wp-admin/css/ms.css',\n\t'wp-admin/css/ms.dev.css',\n\t'wp-admin/css/nav-menu-rtl.css',\n\t'wp-admin/css/nav-menu-rtl.dev.css',\n\t'wp-admin/css/nav-menu.css',\n\t'wp-admin/css/nav-menu.dev.css',\n\t'wp-admin/css/plugin-install-rtl.css',\n\t'wp-admin/css/plugin-install-rtl.dev.css',\n\t'wp-admin/css/plugin-install.css',\n\t'wp-admin/css/plugin-install.dev.css',\n\t'wp-admin/css/press-this-rtl.dev.css',\n\t'wp-admin/css/press-this.dev.css',\n\t'wp-admin/css/theme-editor-rtl.css',\n\t'wp-admin/css/theme-editor-rtl.dev.css',\n\t'wp-admin/css/theme-editor.css',\n\t'wp-admin/css/theme-editor.dev.css',\n\t'wp-admin/css/theme-install-rtl.css',\n\t'wp-admin/css/theme-install-rtl.dev.css',\n\t'wp-admin/css/theme-install.css',\n\t'wp-admin/css/theme-install.dev.css',\n\t'wp-admin/css/widgets-rtl.dev.css',\n\t'wp-admin/css/widgets.dev.css',\n\t'wp-admin/includes/internal-linking.php',\n\t'wp-includes/images/admin-bar-sprite-rtl.png',\n\t'wp-includes/js/jquery/ui.button.js',\n\t'wp-includes/js/jquery/ui.core.js',\n\t'wp-includes/js/jquery/ui.dialog.js',\n\t'wp-includes/js/jquery/ui.draggable.js',\n\t'wp-includes/js/jquery/ui.droppable.js',\n\t'wp-includes/js/jquery/ui.mouse.js',\n\t'wp-includes/js/jquery/ui.position.js',\n\t'wp-includes/js/jquery/ui.resizable.js',\n\t'wp-includes/js/jquery/ui.selectable.js',\n\t'wp-includes/js/jquery/ui.sortable.js',\n\t'wp-includes/js/jquery/ui.tabs.js',\n\t'wp-includes/js/jquery/ui.widget.js',\n\t'wp-includes/js/l10n.dev.js',\n\t'wp-includes/js/l10n.js',\n\t'wp-includes/js/tinymce/plugins/wplink/css',\n\t'wp-includes/js/tinymce/plugins/wplink/img',\n\t'wp-includes/js/tinymce/plugins/wplink/js',\n\t'wp-includes/js/tinymce/themes/advanced/img/wpicons.png',\n\t'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/butt2.png',\n\t'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/button_bg.png',\n\t'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/down_arrow.gif',\n\t'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/fade-butt.png',\n\t'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/separator.gif',\n\t// Don't delete, yet: 'wp-rss.php',\n\t// Don't delete, yet: 'wp-rdf.php',\n\t// Don't delete, yet: 'wp-rss2.php',\n\t// Don't delete, yet: 'wp-commentsrss2.php',\n\t// Don't delete, yet: 'wp-atom.php',\n\t// Don't delete, yet: 'wp-feed.php',\n\t// 3.4\n\t'wp-admin/images/gray-star.png',\n\t'wp-admin/images/logo-login.png',\n\t'wp-admin/images/star.png',\n\t'wp-admin/index-extra.php',\n\t'wp-admin/network/index-extra.php',\n\t'wp-admin/user/index-extra.php',\n\t'wp-admin/images/screenshots/admin-flyouts.png',\n\t'wp-admin/images/screenshots/coediting.png',\n\t'wp-admin/images/screenshots/drag-and-drop.png',\n\t'wp-admin/images/screenshots/help-screen.png',\n\t'wp-admin/images/screenshots/media-icon.png',\n\t'wp-admin/images/screenshots/new-feature-pointer.png',\n\t'wp-admin/images/screenshots/welcome-screen.png',\n\t'wp-includes/css/editor-buttons.css',\n\t'wp-includes/css/editor-buttons.dev.css',\n\t'wp-includes/js/tinymce/plugins/paste/blank.htm',\n\t'wp-includes/js/tinymce/plugins/wordpress/css',\n\t'wp-includes/js/tinymce/plugins/wordpress/editor_plugin.dev.js',\n\t'wp-includes/js/tinymce/plugins/wordpress/img/embedded.png',\n\t'wp-includes/js/tinymce/plugins/wordpress/img/more_bug.gif',\n\t'wp-includes/js/tinymce/plugins/wordpress/img/page_bug.gif',\n\t'wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.dev.js',\n\t'wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css',\n\t'wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.dev.js',\n\t'wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.dev.js',\n\t'wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.dev.js',\n\t'wp-includes/js/tinymce/plugins/wpgallery/img/gallery.png',\n\t'wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js',\n\t// Don't delete, yet: 'wp-pass.php',\n\t// Don't delete, yet: 'wp-register.php',\n\t// 3.5\n\t'wp-admin/gears-manifest.php',\n\t'wp-admin/includes/manifest.php',\n\t'wp-admin/images/archive-link.png',\n\t'wp-admin/images/blue-grad.png',\n\t'wp-admin/images/button-grad-active.png',\n\t'wp-admin/images/button-grad.png',\n\t'wp-admin/images/ed-bg-vs.gif',\n\t'wp-admin/images/ed-bg.gif',\n\t'wp-admin/images/fade-butt.png',\n\t'wp-admin/images/fav-arrow-rtl.gif',\n\t'wp-admin/images/fav-arrow.gif',\n\t'wp-admin/images/fav-vs.png',\n\t'wp-admin/images/fav.png',\n\t'wp-admin/images/gray-grad.png',\n\t'wp-admin/images/loading-publish.gif',\n\t'wp-admin/images/logo-ghost.png',\n\t'wp-admin/images/logo.gif',\n\t'wp-admin/images/menu-arrow-frame-rtl.png',\n\t'wp-admin/images/menu-arrow-frame.png',\n\t'wp-admin/images/menu-arrows.gif',\n\t'wp-admin/images/menu-bits-rtl-vs.gif',\n\t'wp-admin/images/menu-bits-rtl.gif',\n\t'wp-admin/images/menu-bits-vs.gif',\n\t'wp-admin/images/menu-bits.gif',\n\t'wp-admin/images/menu-dark-rtl-vs.gif',\n\t'wp-admin/images/menu-dark-rtl.gif',\n\t'wp-admin/images/menu-dark-vs.gif',\n\t'wp-admin/images/menu-dark.gif',\n\t'wp-admin/images/required.gif',\n\t'wp-admin/images/screen-options-toggle-vs.gif',\n\t'wp-admin/images/screen-options-toggle.gif',\n\t'wp-admin/images/toggle-arrow-rtl.gif',\n\t'wp-admin/images/toggle-arrow.gif',\n\t'wp-admin/images/upload-classic.png',\n\t'wp-admin/images/upload-fresh.png',\n\t'wp-admin/images/white-grad-active.png',\n\t'wp-admin/images/white-grad.png',\n\t'wp-admin/images/widgets-arrow-vs.gif',\n\t'wp-admin/images/widgets-arrow.gif',\n\t'wp-admin/images/wpspin_dark.gif',\n\t'wp-includes/images/upload.png',\n\t'wp-includes/js/prototype.js',\n\t'wp-includes/js/scriptaculous',\n\t'wp-admin/css/wp-admin-rtl.dev.css',\n\t'wp-admin/css/wp-admin.dev.css',\n\t'wp-admin/css/media-rtl.dev.css',\n\t'wp-admin/css/media.dev.css',\n\t'wp-admin/css/colors-classic.dev.css',\n\t'wp-admin/css/customize-controls-rtl.dev.css',\n\t'wp-admin/css/customize-controls.dev.css',\n\t'wp-admin/css/ie-rtl.dev.css',\n\t'wp-admin/css/ie.dev.css',\n\t'wp-admin/css/install.dev.css',\n\t'wp-admin/css/colors-fresh.dev.css',\n\t'wp-includes/js/customize-base.dev.js',\n\t'wp-includes/js/json2.dev.js',\n\t'wp-includes/js/comment-reply.dev.js',\n\t'wp-includes/js/customize-preview.dev.js',\n\t'wp-includes/js/wplink.dev.js',\n\t'wp-includes/js/tw-sack.dev.js',\n\t'wp-includes/js/wp-list-revisions.dev.js',\n\t'wp-includes/js/autosave.dev.js',\n\t'wp-includes/js/admin-bar.dev.js',\n\t'wp-includes/js/quicktags.dev.js',\n\t'wp-includes/js/wp-ajax-response.dev.js',\n\t'wp-includes/js/wp-pointer.dev.js',\n\t'wp-includes/js/hoverIntent.dev.js',\n\t'wp-includes/js/colorpicker.dev.js',\n\t'wp-includes/js/wp-lists.dev.js',\n\t'wp-includes/js/customize-loader.dev.js',\n\t'wp-includes/js/jquery/jquery.table-hotkeys.dev.js',\n\t'wp-includes/js/jquery/jquery.color.dev.js',\n\t'wp-includes/js/jquery/jquery.color.js',\n\t'wp-includes/js/jquery/jquery.hotkeys.dev.js',\n\t'wp-includes/js/jquery/jquery.form.dev.js',\n\t'wp-includes/js/jquery/suggest.dev.js',\n\t'wp-admin/js/xfn.dev.js',\n\t'wp-admin/js/set-post-thumbnail.dev.js',\n\t'wp-admin/js/comment.dev.js',\n\t'wp-admin/js/theme.dev.js',\n\t'wp-admin/js/cat.dev.js',\n\t'wp-admin/js/password-strength-meter.dev.js',\n\t'wp-admin/js/user-profile.dev.js',\n\t'wp-admin/js/theme-preview.dev.js',\n\t'wp-admin/js/post.dev.js',\n\t'wp-admin/js/media-upload.dev.js',\n\t'wp-admin/js/word-count.dev.js',\n\t'wp-admin/js/plugin-install.dev.js',\n\t'wp-admin/js/edit-comments.dev.js',\n\t'wp-admin/js/media-gallery.dev.js',\n\t'wp-admin/js/custom-fields.dev.js',\n\t'wp-admin/js/custom-background.dev.js',\n\t'wp-admin/js/common.dev.js',\n\t'wp-admin/js/inline-edit-tax.dev.js',\n\t'wp-admin/js/gallery.dev.js',\n\t'wp-admin/js/utils.dev.js',\n\t'wp-admin/js/widgets.dev.js',\n\t'wp-admin/js/wp-fullscreen.dev.js',\n\t'wp-admin/js/nav-menu.dev.js',\n\t'wp-admin/js/dashboard.dev.js',\n\t'wp-admin/js/link.dev.js',\n\t'wp-admin/js/user-suggest.dev.js',\n\t'wp-admin/js/postbox.dev.js',\n\t'wp-admin/js/tags.dev.js',\n\t'wp-admin/js/image-edit.dev.js',\n\t'wp-admin/js/media.dev.js',\n\t'wp-admin/js/customize-controls.dev.js',\n\t'wp-admin/js/inline-edit-post.dev.js',\n\t'wp-admin/js/categories.dev.js',\n\t'wp-admin/js/editor.dev.js',\n\t'wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.dev.js',\n\t'wp-includes/js/tinymce/plugins/wpdialogs/js/popup.dev.js',\n\t'wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js',\n\t'wp-includes/js/plupload/handlers.dev.js',\n\t'wp-includes/js/plupload/wp-plupload.dev.js',\n\t'wp-includes/js/swfupload/handlers.dev.js',\n\t'wp-includes/js/jcrop/jquery.Jcrop.dev.js',\n\t'wp-includes/js/jcrop/jquery.Jcrop.js',\n\t'wp-includes/js/jcrop/jquery.Jcrop.css',\n\t'wp-includes/js/imgareaselect/jquery.imgareaselect.dev.js',\n\t'wp-includes/css/wp-pointer.dev.css',\n\t'wp-includes/css/editor.dev.css',\n\t'wp-includes/css/jquery-ui-dialog.dev.css',\n\t'wp-includes/css/admin-bar-rtl.dev.css',\n\t'wp-includes/css/admin-bar.dev.css',\n\t'wp-includes/js/jquery/ui/jquery.effects.clip.min.js',\n\t'wp-includes/js/jquery/ui/jquery.effects.scale.min.js',\n\t'wp-includes/js/jquery/ui/jquery.effects.blind.min.js',\n\t'wp-includes/js/jquery/ui/jquery.effects.core.min.js',\n\t'wp-includes/js/jquery/ui/jquery.effects.shake.min.js',\n\t'wp-includes/js/jquery/ui/jquery.effects.fade.min.js',\n\t'wp-includes/js/jquery/ui/jquery.effects.explode.min.js',\n\t'wp-includes/js/jquery/ui/jquery.effects.slide.min.js',\n\t'wp-includes/js/jquery/ui/jquery.effects.drop.min.js',\n\t'wp-includes/js/jquery/ui/jquery.effects.highlight.min.js',\n\t'wp-includes/js/jquery/ui/jquery.effects.bounce.min.js',\n\t'wp-includes/js/jquery/ui/jquery.effects.pulsate.min.js',\n\t'wp-includes/js/jquery/ui/jquery.effects.transfer.min.js',\n\t'wp-includes/js/jquery/ui/jquery.effects.fold.min.js',\n\t'wp-admin/images/screenshots/captions-1.png',\n\t'wp-admin/images/screenshots/captions-2.png',\n\t'wp-admin/images/screenshots/flex-header-1.png',\n\t'wp-admin/images/screenshots/flex-header-2.png',\n\t'wp-admin/images/screenshots/flex-header-3.png',\n\t'wp-admin/images/screenshots/flex-header-media-library.png',\n\t'wp-admin/images/screenshots/theme-customizer.png',\n\t'wp-admin/images/screenshots/twitter-embed-1.png',\n\t'wp-admin/images/screenshots/twitter-embed-2.png',\n\t'wp-admin/js/utils.js',\n\t// Added back in 5.3 [45448], see #43895.\n\t// 'wp-admin/options-privacy.php',\n\t'wp-app.php',\n\t'wp-includes/class-wp-atom-server.php',\n\t'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css',\n\t// 3.5.2\n\t'wp-includes/js/swfupload/swfupload-all.js',\n\t// 3.6\n\t'wp-admin/js/revisions-js.php',\n\t'wp-admin/images/screenshots',\n\t'wp-admin/js/categories.js',\n\t'wp-admin/js/categories.min.js',\n\t'wp-admin/js/custom-fields.js',\n\t'wp-admin/js/custom-fields.min.js',\n\t// 3.7\n\t'wp-admin/js/cat.js',\n\t'wp-admin/js/cat.min.js',\n\t'wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.min.js',\n\t// 3.8\n\t'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/page_bug.gif',\n\t'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/more_bug.gif',\n\t'wp-includes/js/thickbox/tb-close-2x.png',\n\t'wp-includes/js/thickbox/tb-close.png',\n\t'wp-includes/images/wpmini-blue-2x.png',\n\t'wp-includes/images/wpmini-blue.png',\n\t'wp-admin/css/colors-fresh.css',\n\t'wp-admin/css/colors-classic.css',\n\t'wp-admin/css/colors-fresh.min.css',\n\t'wp-admin/css/colors-classic.min.css',\n\t'wp-admin/js/about.min.js',\n\t'wp-admin/js/about.js',\n\t'wp-admin/images/arrows-dark-vs-2x.png',\n\t'wp-admin/images/wp-logo-vs.png',\n\t'wp-admin/images/arrows-dark-vs.png',\n\t'wp-admin/images/wp-logo.png',\n\t'wp-admin/images/arrows-pr.png',\n\t'wp-admin/images/arrows-dark.png',\n\t'wp-admin/images/press-this.png',\n\t'wp-admin/images/press-this-2x.png',\n\t'wp-admin/images/arrows-vs-2x.png',\n\t'wp-admin/images/welcome-icons.png',\n\t'wp-admin/images/wp-logo-2x.png',\n\t'wp-admin/images/stars-rtl-2x.png',\n\t'wp-admin/images/arrows-dark-2x.png',\n\t'wp-admin/images/arrows-pr-2x.png',\n\t'wp-admin/images/menu-shadow-rtl.png',\n\t'wp-admin/images/arrows-vs.png',\n\t'wp-admin/images/about-search-2x.png',\n\t'wp-admin/images/bubble_bg-rtl-2x.gif',\n\t'wp-admin/images/wp-badge-2x.png',\n\t'wp-admin/images/wordpress-logo-2x.png',\n\t'wp-admin/images/bubble_bg-rtl.gif',\n\t'wp-admin/images/wp-badge.png',\n\t'wp-admin/images/menu-shadow.png',\n\t'wp-admin/images/about-globe-2x.png',\n\t'wp-admin/images/welcome-icons-2x.png',\n\t'wp-admin/images/stars-rtl.png',\n\t'wp-admin/images/wp-logo-vs-2x.png',\n\t'wp-admin/images/about-updates-2x.png',\n\t// 3.9\n\t'wp-admin/css/colors.css',\n\t'wp-admin/css/colors.min.css',\n\t'wp-admin/css/colors-rtl.css',\n\t'wp-admin/css/colors-rtl.min.css',\n\t// Following files added back in 4.5, see #36083.\n\t// 'wp-admin/css/media-rtl.min.css',\n\t// 'wp-admin/css/media.min.css',\n\t// 'wp-admin/css/farbtastic-rtl.min.css',\n\t'wp-admin/images/lock-2x.png',\n\t'wp-admin/images/lock.png',\n\t'wp-admin/js/theme-preview.js',\n\t'wp-admin/js/theme-install.min.js',\n\t'wp-admin/js/theme-install.js',\n\t'wp-admin/js/theme-preview.min.js',\n\t'wp-includes/js/plupload/plupload.html4.js',\n\t'wp-includes/js/plupload/plupload.html5.js',\n\t'wp-includes/js/plupload/changelog.txt',\n\t'wp-includes/js/plupload/plupload.silverlight.js',\n\t'wp-includes/js/plupload/plupload.flash.js',\n\t// Added back in 4.9 [41328], see #41755.\n\t// 'wp-includes/js/plupload/plupload.js',\n\t'wp-includes/js/tinymce/plugins/spellchecker',\n\t'wp-includes/js/tinymce/plugins/inlinepopups',\n\t'wp-includes/js/tinymce/plugins/media/js',\n\t'wp-includes/js/tinymce/plugins/media/css',\n\t'wp-includes/js/tinymce/plugins/wordpress/img',\n\t'wp-includes/js/tinymce/plugins/wpdialogs/js',\n\t'wp-includes/js/tinymce/plugins/wpeditimage/img',\n\t'wp-includes/js/tinymce/plugins/wpeditimage/js',\n\t'wp-includes/js/tinymce/plugins/wpeditimage/css',\n\t'wp-includes/js/tinymce/plugins/wpgallery/img',\n\t'wp-includes/js/tinymce/plugins/wpfullscreen/css',\n\t'wp-includes/js/tinymce/plugins/paste/js',\n\t'wp-includes/js/tinymce/themes/advanced',\n\t'wp-includes/js/tinymce/tiny_mce.js',\n\t'wp-includes/js/tinymce/mark_loaded_src.js',\n\t'wp-includes/js/tinymce/wp-tinymce-schema.js',\n\t'wp-includes/js/tinymce/plugins/media/editor_plugin.js',\n\t'wp-includes/js/tinymce/plugins/media/editor_plugin_src.js',\n\t'wp-includes/js/tinymce/plugins/media/media.htm',\n\t'wp-includes/js/tinymce/plugins/wpview/editor_plugin_src.js',\n\t'wp-includes/js/tinymce/plugins/wpview/editor_plugin.js',\n\t'wp-includes/js/tinymce/plugins/directionality/editor_plugin.js',\n\t'wp-includes/js/tinymce/plugins/directionality/editor_plugin_src.js',\n\t'wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js',\n\t'wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js',\n\t'wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin_src.js',\n\t'wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.js',\n\t'wp-includes/js/tinymce/plugins/wpeditimage/editimage.html',\n\t'wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js',\n\t'wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js',\n\t'wp-includes/js/tinymce/plugins/fullscreen/editor_plugin_src.js',\n\t'wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm',\n\t'wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js',\n\t'wp-includes/js/tinymce/plugins/wplink/editor_plugin_src.js',\n\t'wp-includes/js/tinymce/plugins/wplink/editor_plugin.js',\n\t'wp-includes/js/tinymce/plugins/wpgallery/editor_plugin_src.js',\n\t'wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js',\n\t'wp-includes/js/tinymce/plugins/tabfocus/editor_plugin.js',\n\t'wp-includes/js/tinymce/plugins/tabfocus/editor_plugin_src.js',\n\t'wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.js',\n\t'wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js',\n\t'wp-includes/js/tinymce/plugins/paste/editor_plugin.js',\n\t'wp-includes/js/tinymce/plugins/paste/pasteword.htm',\n\t'wp-includes/js/tinymce/plugins/paste/editor_plugin_src.js',\n\t'wp-includes/js/tinymce/plugins/paste/pastetext.htm',\n\t'wp-includes/js/tinymce/langs/wp-langs.php',\n\t// 4.1\n\t'wp-includes/js/jquery/ui/jquery.ui.accordion.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.autocomplete.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.button.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.core.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.datepicker.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.dialog.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.draggable.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.droppable.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.effect-blind.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.effect-bounce.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.effect-clip.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.effect-drop.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.effect-explode.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.effect-fade.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.effect-fold.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.effect-highlight.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.effect-pulsate.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.effect-scale.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.effect-shake.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.effect-slide.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.effect-transfer.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.effect.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.menu.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.mouse.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.position.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.progressbar.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.resizable.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.selectable.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.slider.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.sortable.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.spinner.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.tabs.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.tooltip.min.js',\n\t'wp-includes/js/jquery/ui/jquery.ui.widget.min.js',\n\t'wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png',\n\t// 4.3\n\t'wp-admin/js/wp-fullscreen.js',\n\t'wp-admin/js/wp-fullscreen.min.js',\n\t'wp-includes/js/tinymce/wp-mce-help.php',\n\t'wp-includes/js/tinymce/plugins/wpfullscreen',\n\t// 4.5\n\t'wp-includes/theme-compat/comments-popup.php',\n\t// 4.6\n\t'wp-admin/includes/class-wp-automatic-upgrader.php', // Wrong file name, see #37628.\n\t// 4.8\n\t'wp-includes/js/tinymce/plugins/wpembed',\n\t'wp-includes/js/tinymce/plugins/media/moxieplayer.swf',\n\t'wp-includes/js/tinymce/skins/lightgray/fonts/readme.md',\n\t'wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.json',\n\t'wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.json',\n\t'wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css',\n\t// 4.9\n\t'wp-admin/css/press-this-editor-rtl.css',\n\t'wp-admin/css/press-this-editor-rtl.min.css',\n\t'wp-admin/css/press-this-editor.css',\n\t'wp-admin/css/press-this-editor.min.css',\n\t'wp-admin/css/press-this-rtl.css',\n\t'wp-admin/css/press-this-rtl.min.css',\n\t'wp-admin/css/press-this.css',\n\t'wp-admin/css/press-this.min.css',\n\t'wp-admin/includes/class-wp-press-this.php',\n\t'wp-admin/js/bookmarklet.js',\n\t'wp-admin/js/bookmarklet.min.js',\n\t'wp-admin/js/press-this.js',\n\t'wp-admin/js/press-this.min.js',\n\t'wp-includes/js/mediaelement/background.png',\n\t'wp-includes/js/mediaelement/bigplay.png',\n\t'wp-includes/js/mediaelement/bigplay.svg',\n\t'wp-includes/js/mediaelement/controls.png',\n\t'wp-includes/js/mediaelement/controls.svg',\n\t'wp-includes/js/mediaelement/flashmediaelement.swf',\n\t'wp-includes/js/mediaelement/froogaloop.min.js',\n\t'wp-includes/js/mediaelement/jumpforward.png',\n\t'wp-includes/js/mediaelement/loading.gif',\n\t'wp-includes/js/mediaelement/silverlightmediaelement.xap',\n\t'wp-includes/js/mediaelement/skipback.png',\n\t'wp-includes/js/plupload/plupload.flash.swf',\n\t'wp-includes/js/plupload/plupload.full.min.js',\n\t'wp-includes/js/plupload/plupload.silverlight.xap',\n\t'wp-includes/js/swfupload/plugins',\n\t'wp-includes/js/swfupload/swfupload.swf',\n\t// 4.9.2\n\t'wp-includes/js/mediaelement/lang',\n\t'wp-includes/js/mediaelement/lang/ca.js',\n\t'wp-includes/js/mediaelement/lang/cs.js',\n\t'wp-includes/js/mediaelement/lang/de.js',\n\t'wp-includes/js/mediaelement/lang/es.js',\n\t'wp-includes/js/mediaelement/lang/fa.js',\n\t'wp-includes/js/mediaelement/lang/fr.js',\n\t'wp-includes/js/mediaelement/lang/hr.js',\n\t'wp-includes/js/mediaelement/lang/hu.js',\n\t'wp-includes/js/mediaelement/lang/it.js',\n\t'wp-includes/js/mediaelement/lang/ja.js',\n\t'wp-includes/js/mediaelement/lang/ko.js',\n\t'wp-includes/js/mediaelement/lang/nl.js',\n\t'wp-includes/js/mediaelement/lang/pl.js',\n\t'wp-includes/js/mediaelement/lang/pt.js',\n\t'wp-includes/js/mediaelement/lang/ro.js',\n\t'wp-includes/js/mediaelement/lang/ru.js',\n\t'wp-includes/js/mediaelement/lang/sk.js',\n\t'wp-includes/js/mediaelement/lang/sv.js',\n\t'wp-includes/js/mediaelement/lang/uk.js',\n\t'wp-includes/js/mediaelement/lang/zh-cn.js',\n\t'wp-includes/js/mediaelement/lang/zh.js',\n\t'wp-includes/js/mediaelement/mediaelement-flash-audio-ogg.swf',\n\t'wp-includes/js/mediaelement/mediaelement-flash-audio.swf',\n\t'wp-includes/js/mediaelement/mediaelement-flash-video-hls.swf',\n\t'wp-includes/js/mediaelement/mediaelement-flash-video-mdash.swf',\n\t'wp-includes/js/mediaelement/mediaelement-flash-video.swf',\n\t'wp-includes/js/mediaelement/renderers/dailymotion.js',\n\t'wp-includes/js/mediaelement/renderers/dailymotion.min.js',\n\t'wp-includes/js/mediaelement/renderers/facebook.js',\n\t'wp-includes/js/mediaelement/renderers/facebook.min.js',\n\t'wp-includes/js/mediaelement/renderers/soundcloud.js',\n\t'wp-includes/js/mediaelement/renderers/soundcloud.min.js',\n\t'wp-includes/js/mediaelement/renderers/twitch.js',\n\t'wp-includes/js/mediaelement/renderers/twitch.min.js',\n\t// 5.0\n\t'wp-includes/js/codemirror/jshint.js',\n\t// 5.1\n\t'wp-includes/random_compat/random_bytes_openssl.php',\n\t'wp-includes/js/tinymce/wp-tinymce.js.gz',\n\t// 5.3\n\t'wp-includes/js/wp-a11y.js',     // Moved to: wp-includes/js/dist/a11y.js\n\t'wp-includes/js/wp-a11y.min.js', // Moved to: wp-includes/js/dist/a11y.min.js\n\t// 5.4\n\t'wp-admin/js/wp-fullscreen-stub.js',\n\t'wp-admin/js/wp-fullscreen-stub.min.js',\n\t// 5.5\n\t'wp-admin/css/ie.css',\n\t'wp-admin/css/ie.min.css',\n\t'wp-admin/css/ie-rtl.css',\n\t'wp-admin/css/ie-rtl.min.css',\n);\n\n/**\n * Stores new files in wp-content to copy\n *\n * The contents of this array indicate any new bundled plugins/themes which\n * should be installed with the WordPress Upgrade. These items will not be\n * re-installed in future upgrades, this behaviour is controlled by the\n * introduced version present here being older than the current installed version.\n *\n * The content of this array should follow the following format:\n * Filename (relative to wp-content) => Introduced version\n * Directories should be noted by suffixing it with a trailing slash (/)\n *\n * @since 3.2.0\n * @since 4.7.0 New themes were not automatically installed for 4.4-4.6 on\n *              upgrade. New themes are now installed again. To disable new\n *              themes from being installed on upgrade, explicitly define\n *              CORE_UPGRADE_SKIP_NEW_BUNDLED as true.\n * @global array $_new_bundled_files\n * @var array\n * @name $_new_bundled_files\n */\nglobal $_new_bundled_files;\n\n$_new_bundled_files = array(\n\t'plugins/akismet/'        => '2.0',\n\t'themes/twentyten/'       => '3.0',\n\t'themes/twentyeleven/'    => '3.2',\n\t'themes/twentytwelve/'    => '3.5',\n\t'themes/twentythirteen/'  => '3.6',\n\t'themes/twentyfourteen/'  => '3.8',\n\t'themes/twentyfifteen/'   => '4.1',\n\t'themes/twentysixteen/'   => '4.4',\n\t'themes/twentyseventeen/' => '4.7',\n\t'themes/twentynineteen/'  => '5.0',\n\t'themes/twentytwenty/'    => '5.3',\n);\n\n/**\n * Upgrades the core of WordPress.\n *\n * This will create a .maintenance file at the base of the WordPress directory\n * to ensure that people can not access the web site, when the files are being\n * copied to their locations.\n *\n * The files in the `$_old_files` list will be removed and the new files\n * copied from the zip file after the database is upgraded.\n *\n * The files in the `$_new_bundled_files` list will be added to the installation\n * if the version is greater than or equal to the old version being upgraded.\n *\n * The steps for the upgrader for after the new release is downloaded and\n * unzipped is:\n *   1. Test unzipped location for select files to ensure that unzipped worked.\n *   2. Create the .maintenance file in current WordPress base.\n *   3. Copy new WordPress directory over old WordPress files.\n *   4. Upgrade WordPress to new version.\n *     4.1. Copy all files/folders other than wp-content\n *     4.2. Copy any language files to WP_LANG_DIR (which may differ from WP_CONTENT_DIR\n *     4.3. Copy any new bundled themes/plugins to their respective locations\n *   5. Delete new WordPress directory path.\n *   6. Delete .maintenance file.\n *   7. Remove old files.\n *   8. Delete 'update_core' option.\n *\n * There are several areas of failure. For instance if PHP times out before step\n * 6, then you will not be able to access any portion of your site. Also, since\n * the upgrade will not continue where it left off, you will not be able to\n * automatically remove old files and remove the 'update_core' option. This\n * isn't that bad.\n *\n * If the copy of the new WordPress over the old fails, then the worse is that\n * the new WordPress directory will remain.\n *\n * If it is assumed that every file will be copied over, including plugins and\n * themes, then if you edit the default theme, you should rename it, so that\n * your changes remain.\n *\n * @since 2.7.0\n *\n * @global WP_Filesystem_Base $wp_filesystem          WordPress filesystem subclass.\n * @global array              $_old_files\n * @global array              $_new_bundled_files\n * @global wpdb               $wpdb                   WordPress database abstraction object.\n * @global string             $wp_version\n * @global string             $required_php_version\n * @global string             $required_mysql_version\n *\n * @param string $from New release unzipped path.\n * @param string $to   Path to old WordPress installation.\n * @return string|WP_Error New WordPress version on success, WP_Error on failure.\n */\nfunction update_core( $from, $to ) {\n\tglobal $wp_filesystem, $_old_files, $_new_bundled_files, $wpdb;\n\n\tset_time_limit( 300 );\n\n\t/**\n\t * Filters feedback messages displayed during the core update process.\n\t *\n\t * The filter is first evaluated after the zip file for the latest version\n\t * has been downloaded and unzipped. It is evaluated five more times during\n\t * the process:\n\t *\n\t * 1. Before WordPress begins the core upgrade process.\n\t * 2. Before Maintenance Mode is enabled.\n\t * 3. Before WordPress begins copying over the necessary files.\n\t * 4. Before Maintenance Mode is disabled.\n\t * 5. Before the database is upgraded.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $feedback The core update feedback messages.\n\t */\n\tapply_filters( 'update_feedback', __( 'Verifying the unpacked files&#8230;' ) );\n\n\t// Sanity check the unzipped distribution.\n\t$distro = '';\n\t$roots  = array( '/wordpress/', '/wordpress-mu/' );\n\tforeach ( $roots as $root ) {\n\t\tif ( $wp_filesystem->exists( $from . $root . 'readme.html' ) && $wp_filesystem->exists( $from . $root . 'wp-includes/version.php' ) ) {\n\t\t\t$distro = $root;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif ( ! $distro ) {\n\t\t$wp_filesystem->delete( $from, true );\n\t\treturn new WP_Error( 'insane_distro', __( 'The update could not be unpacked' ) );\n\t}\n\n\t/*\n\t * Import $wp_version, $required_php_version, and $required_mysql_version from the new version.\n\t * DO NOT globalise any variables imported from `version-current.php` in this function.\n\t *\n\t * BC Note: $wp_filesystem->wp_content_dir() returned unslashed pre-2.8\n\t */\n\t$versions_file = trailingslashit( $wp_filesystem->wp_content_dir() ) . 'upgrade/version-current.php';\n\tif ( ! $wp_filesystem->copy( $from . $distro . 'wp-includes/version.php', $versions_file ) ) {\n\t\t$wp_filesystem->delete( $from, true );\n\t\treturn new WP_Error( 'copy_failed_for_version_file', __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' ), 'wp-includes/version.php' );\n\t}\n\n\t$wp_filesystem->chmod( $versions_file, FS_CHMOD_FILE );\n\trequire WP_CONTENT_DIR . '/upgrade/version-current.php';\n\t$wp_filesystem->delete( $versions_file );\n\n\t$php_version       = phpversion();\n\t$mysql_version     = $wpdb->db_version();\n\t$old_wp_version    = $GLOBALS['wp_version']; // The version of WordPress we're updating from.\n\t$development_build = ( false !== strpos( $old_wp_version . $wp_version, '-' ) ); // A dash in the version indicates a development release.\n\t$php_compat        = version_compare( $php_version, $required_php_version, '>=' );\n\tif ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) {\n\t\t$mysql_compat = true;\n\t} else {\n\t\t$mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' );\n\t}\n\n\tif ( ! $mysql_compat || ! $php_compat ) {\n\t\t$wp_filesystem->delete( $from, true );\n\t}\n\n\t$php_update_message = '';\n\n\tif ( function_exists( 'wp_get_update_php_url' ) ) {\n\t\t/* translators: %s: URL to Update PHP page. */\n\t\t$php_update_message = '</p><p>' . sprintf(\n\t\t\t__( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\tesc_url( wp_get_update_php_url() )\n\t\t);\n\n\t\tif ( function_exists( 'wp_get_update_php_annotation' ) ) {\n\t\t\t$annotation = wp_get_update_php_annotation();\n\n\t\t\tif ( $annotation ) {\n\t\t\t\t$php_update_message .= '</p><p><em>' . $annotation . '</em>';\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! $mysql_compat && ! $php_compat ) {\n\t\treturn new WP_Error(\n\t\t\t'php_mysql_not_compatible',\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: WordPress version number, 2: Minimum required PHP version number, 3: Minimum required MySQL version number, 4: Current PHP version number, 5: Current MySQL version number. */\n\t\t\t\t__( 'The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.' ),\n\t\t\t\t$wp_version,\n\t\t\t\t$required_php_version,\n\t\t\t\t$required_mysql_version,\n\t\t\t\t$php_version,\n\t\t\t\t$mysql_version\n\t\t\t) . $php_update_message\n\t\t);\n\t} elseif ( ! $php_compat ) {\n\t\treturn new WP_Error(\n\t\t\t'php_not_compatible',\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: WordPress version number, 2: Minimum required PHP version number, 3: Current PHP version number. */\n\t\t\t\t__( 'The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.' ),\n\t\t\t\t$wp_version,\n\t\t\t\t$required_php_version,\n\t\t\t\t$php_version\n\t\t\t) . $php_update_message\n\t\t);\n\t} elseif ( ! $mysql_compat ) {\n\t\treturn new WP_Error(\n\t\t\t'mysql_not_compatible',\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: WordPress version number, 2: Minimum required MySQL version number, 3: Current MySQL version number. */\n\t\t\t\t__( 'The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.' ),\n\t\t\t\t$wp_version,\n\t\t\t\t$required_mysql_version,\n\t\t\t\t$mysql_version\n\t\t\t)\n\t\t);\n\t}\n\n\t// Add a warning when the JSON PHP extension is missing.\n\tif ( ! extension_loaded( 'json' ) ) {\n\t\treturn new WP_Error(\n\t\t\t'php_not_compatible_json',\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: WordPress version number, 2: The PHP extension name needed. */\n\t\t\t\t__( 'The update cannot be installed because WordPress %1$s requires the %2$s PHP extension.' ),\n\t\t\t\t$wp_version,\n\t\t\t\t'JSON'\n\t\t\t)\n\t\t);\n\t}\n\n\t/** This filter is documented in wp-admin/includes/update-core.php */\n\tapply_filters( 'update_feedback', __( 'Preparing to install the latest version&#8230;' ) );\n\n\t// Don't copy wp-content, we'll deal with that below.\n\t// We also copy version.php last so failed updates report their old version.\n\t$skip              = array( 'wp-content', 'wp-includes/version.php' );\n\t$check_is_writable = array();\n\n\t// Check to see which files don't really need updating - only available for 3.7 and higher.\n\tif ( function_exists( 'get_core_checksums' ) ) {\n\t\t// Find the local version of the working directory.\n\t\t$working_dir_local = WP_CONTENT_DIR . '/upgrade/' . basename( $from ) . $distro;\n\n\t\t$checksums = get_core_checksums( $wp_version, isset( $wp_local_package ) ? $wp_local_package : 'en_US' );\n\t\tif ( is_array( $checksums ) && isset( $checksums[ $wp_version ] ) ) {\n\t\t\t$checksums = $checksums[ $wp_version ]; // Compat code for 3.7-beta2.\n\t\t}\n\t\tif ( is_array( $checksums ) ) {\n\t\t\tforeach ( $checksums as $file => $checksum ) {\n\t\t\t\tif ( 'wp-content' === substr( $file, 0, 10 ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( ! file_exists( ABSPATH . $file ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( ! file_exists( $working_dir_local . $file ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( '.' === dirname( $file ) && in_array( pathinfo( $file, PATHINFO_EXTENSION ), array( 'html', 'txt' ), true ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( md5_file( ABSPATH . $file ) === $checksum ) {\n\t\t\t\t\t$skip[] = $file;\n\t\t\t\t} else {\n\t\t\t\t\t$check_is_writable[ $file ] = ABSPATH . $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// If we're using the direct method, we can predict write failures that are due to permissions.\n\tif ( $check_is_writable && 'direct' === $wp_filesystem->method ) {\n\t\t$files_writable = array_filter( $check_is_writable, array( $wp_filesystem, 'is_writable' ) );\n\t\tif ( $files_writable !== $check_is_writable ) {\n\t\t\t$files_not_writable = array_diff_key( $check_is_writable, $files_writable );\n\t\t\tforeach ( $files_not_writable as $relative_file_not_writable => $file_not_writable ) {\n\t\t\t\t// If the writable check failed, chmod file to 0644 and try again, same as copy_dir().\n\t\t\t\t$wp_filesystem->chmod( $file_not_writable, FS_CHMOD_FILE );\n\t\t\t\tif ( $wp_filesystem->is_writable( $file_not_writable ) ) {\n\t\t\t\t\tunset( $files_not_writable[ $relative_file_not_writable ] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Store package-relative paths (the key) of non-writable files in the WP_Error object.\n\t\t\t$error_data = version_compare( $old_wp_version, '3.7-beta2', '>' ) ? array_keys( $files_not_writable ) : '';\n\n\t\t\tif ( $files_not_writable ) {\n\t\t\t\treturn new WP_Error( 'files_not_writable', __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' ), implode( ', ', $error_data ) );\n\t\t\t}\n\t\t}\n\t}\n\n\t/** This filter is documented in wp-admin/includes/update-core.php */\n\tapply_filters( 'update_feedback', __( 'Enabling Maintenance mode&#8230;' ) );\n\t// Create maintenance file to signal that we are upgrading.\n\t$maintenance_string = '<?php $upgrading = ' . time() . '; ?>';\n\t$maintenance_file   = $to . '.maintenance';\n\t$wp_filesystem->delete( $maintenance_file );\n\t$wp_filesystem->put_contents( $maintenance_file, $maintenance_string, FS_CHMOD_FILE );\n\n\t/** This filter is documented in wp-admin/includes/update-core.php */\n\tapply_filters( 'update_feedback', __( 'Copying the required files&#8230;' ) );\n\t// Copy new versions of WP files into place.\n\t$result = _copy_dir( $from . $distro, $to, $skip );\n\tif ( is_wp_error( $result ) ) {\n\t\t$result = new WP_Error( $result->get_error_code(), $result->get_error_message(), substr( $result->get_error_data(), strlen( $to ) ) );\n\t}\n\n\t// Since we know the core files have copied over, we can now copy the version file.\n\tif ( ! is_wp_error( $result ) ) {\n\t\tif ( ! $wp_filesystem->copy( $from . $distro . 'wp-includes/version.php', $to . 'wp-includes/version.php', true /* overwrite */ ) ) {\n\t\t\t$wp_filesystem->delete( $from, true );\n\t\t\t$result = new WP_Error( 'copy_failed_for_version_file', __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' ), 'wp-includes/version.php' );\n\t\t}\n\t\t$wp_filesystem->chmod( $to . 'wp-includes/version.php', FS_CHMOD_FILE );\n\t}\n\n\t// Check to make sure everything copied correctly, ignoring the contents of wp-content.\n\t$skip   = array( 'wp-content' );\n\t$failed = array();\n\tif ( isset( $checksums ) && is_array( $checksums ) ) {\n\t\tforeach ( $checksums as $file => $checksum ) {\n\t\t\tif ( 'wp-content' === substr( $file, 0, 10 ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( ! file_exists( $working_dir_local . $file ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( '.' === dirname( $file ) && in_array( pathinfo( $file, PATHINFO_EXTENSION ), array( 'html', 'txt' ), true ) ) {\n\t\t\t\t$skip[] = $file;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( file_exists( ABSPATH . $file ) && md5_file( ABSPATH . $file ) == $checksum ) {\n\t\t\t\t$skip[] = $file;\n\t\t\t} else {\n\t\t\t\t$failed[] = $file;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Some files didn't copy properly.\n\tif ( ! empty( $failed ) ) {\n\t\t$total_size = 0;\n\t\tforeach ( $failed as $file ) {\n\t\t\tif ( file_exists( $working_dir_local . $file ) ) {\n\t\t\t\t$total_size += filesize( $working_dir_local . $file );\n\t\t\t}\n\t\t}\n\n\t\t// If we don't have enough free space, it isn't worth trying again.\n\t\t// Unlikely to be hit due to the check in unzip_file().\n\t\t$available_space = @disk_free_space( ABSPATH );\n\t\tif ( $available_space && $total_size >= $available_space ) {\n\t\t\t$result = new WP_Error( 'disk_full', __( 'There is not enough free disk space to complete the update.' ) );\n\t\t} else {\n\t\t\t$result = _copy_dir( $from . $distro, $to, $skip );\n\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\t$result = new WP_Error( $result->get_error_code() . '_retry', $result->get_error_message(), substr( $result->get_error_data(), strlen( $to ) ) );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Custom content directory needs updating now.\n\t// Copy languages.\n\tif ( ! is_wp_error( $result ) && $wp_filesystem->is_dir( $from . $distro . 'wp-content/languages' ) ) {\n\t\tif ( WP_LANG_DIR != ABSPATH . WPINC . '/languages' || @is_dir( WP_LANG_DIR ) ) {\n\t\t\t$lang_dir = WP_LANG_DIR;\n\t\t} else {\n\t\t\t$lang_dir = WP_CONTENT_DIR . '/languages';\n\t\t}\n\n\t\t// Check if the language directory exists first.\n\t\tif ( ! @is_dir( $lang_dir ) && 0 === strpos( $lang_dir, ABSPATH ) ) {\n\t\t\t// If it's within the ABSPATH we can handle it here, otherwise they're out of luck.\n\t\t\t$wp_filesystem->mkdir( $to . str_replace( ABSPATH, '', $lang_dir ), FS_CHMOD_DIR );\n\t\t\tclearstatcache(); // For FTP, need to clear the stat cache.\n\t\t}\n\n\t\tif ( @is_dir( $lang_dir ) ) {\n\t\t\t$wp_lang_dir = $wp_filesystem->find_folder( $lang_dir );\n\t\t\tif ( $wp_lang_dir ) {\n\t\t\t\t$result = copy_dir( $from . $distro . 'wp-content/languages/', $wp_lang_dir );\n\t\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\t\t$result = new WP_Error( $result->get_error_code() . '_languages', $result->get_error_message(), substr( $result->get_error_data(), strlen( $wp_lang_dir ) ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/** This filter is documented in wp-admin/includes/update-core.php */\n\tapply_filters( 'update_feedback', __( 'Disabling Maintenance mode&#8230;' ) );\n\t// Remove maintenance file, we're done with potential site-breaking changes.\n\t$wp_filesystem->delete( $maintenance_file );\n\n\t// 3.5 -> 3.5+ - an empty twentytwelve directory was created upon upgrade to 3.5 for some users, preventing installation of Twenty Twelve.\n\tif ( '3.5' === $old_wp_version ) {\n\t\tif ( is_dir( WP_CONTENT_DIR . '/themes/twentytwelve' ) && ! file_exists( WP_CONTENT_DIR . '/themes/twentytwelve/style.css' ) ) {\n\t\t\t$wp_filesystem->delete( $wp_filesystem->wp_themes_dir() . 'twentytwelve/' );\n\t\t}\n\t}\n\n\t/*\n\t * Copy new bundled plugins & themes.\n\t * This gives us the ability to install new plugins & themes bundled with\n\t * future versions of WordPress whilst avoiding the re-install upon upgrade issue.\n\t * $development_build controls us overwriting bundled themes and plugins when a non-stable release is being updated.\n\t */\n\tif ( ! is_wp_error( $result ) && ( ! defined( 'CORE_UPGRADE_SKIP_NEW_BUNDLED' ) || ! CORE_UPGRADE_SKIP_NEW_BUNDLED ) ) {\n\t\tforeach ( (array) $_new_bundled_files as $file => $introduced_version ) {\n\t\t\t// If a $development_build or if $introduced version is greater than what the site was previously running.\n\t\t\tif ( $development_build || version_compare( $introduced_version, $old_wp_version, '>' ) ) {\n\t\t\t\t$directory = ( '/' === $file[ strlen( $file ) - 1 ] );\n\n\t\t\t\tlist( $type, $filename ) = explode( '/', $file, 2 );\n\n\t\t\t\t// Check to see if the bundled items exist before attempting to copy them.\n\t\t\t\tif ( ! $wp_filesystem->exists( $from . $distro . 'wp-content/' . $file ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( 'plugins' === $type ) {\n\t\t\t\t\t$dest = $wp_filesystem->wp_plugins_dir();\n\t\t\t\t} elseif ( 'themes' === $type ) {\n\t\t\t\t\t// Back-compat, ::wp_themes_dir() did not return trailingslash'd pre-3.2.\n\t\t\t\t\t$dest = trailingslashit( $wp_filesystem->wp_themes_dir() );\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( ! $directory ) {\n\t\t\t\t\tif ( ! $development_build && $wp_filesystem->exists( $dest . $filename ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! $wp_filesystem->copy( $from . $distro . 'wp-content/' . $file, $dest . $filename, FS_CHMOD_FILE ) ) {\n\t\t\t\t\t\t$result = new WP_Error( \"copy_failed_for_new_bundled_$type\", __( 'Could not copy file.' ), $dest . $filename );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( ! $development_build && $wp_filesystem->is_dir( $dest . $filename ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$wp_filesystem->mkdir( $dest . $filename, FS_CHMOD_DIR );\n\t\t\t\t\t$_result = copy_dir( $from . $distro . 'wp-content/' . $file, $dest . $filename );\n\n\t\t\t\t\t// If a error occurs partway through this final step, keep the error flowing through, but keep process going.\n\t\t\t\t\tif ( is_wp_error( $_result ) ) {\n\t\t\t\t\t\tif ( ! is_wp_error( $result ) ) {\n\t\t\t\t\t\t\t$result = new WP_Error;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result->add( $_result->get_error_code() . \"_$type\", $_result->get_error_message(), substr( $_result->get_error_data(), strlen( $dest ) ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} // End foreach.\n\t}\n\n\t// Handle $result error from the above blocks.\n\tif ( is_wp_error( $result ) ) {\n\t\t$wp_filesystem->delete( $from, true );\n\t\treturn $result;\n\t}\n\n\t// Remove old files.\n\tforeach ( $_old_files as $old_file ) {\n\t\t$old_file = $to . $old_file;\n\t\tif ( ! $wp_filesystem->exists( $old_file ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// If the file isn't deleted, try writing an empty string to the file instead.\n\t\tif ( ! $wp_filesystem->delete( $old_file, true ) && $wp_filesystem->is_file( $old_file ) ) {\n\t\t\t$wp_filesystem->put_contents( $old_file, '' );\n\t\t}\n\t}\n\n\t// Remove any Genericons example.html's from the filesystem.\n\t_upgrade_422_remove_genericons();\n\n\t// Remove the REST API plugin if its version is Beta 4 or lower.\n\t_upgrade_440_force_deactivate_incompatible_plugins();\n\n\t// Upgrade DB with separate request.\n\t/** This filter is documented in wp-admin/includes/update-core.php */\n\tapply_filters( 'update_feedback', __( 'Upgrading database&#8230;' ) );\n\t$db_upgrade_url = admin_url( 'upgrade.php?step=upgrade_db' );\n\twp_remote_post( $db_upgrade_url, array( 'timeout' => 60 ) );\n\n\t// Clear the cache to prevent an update_option() from saving a stale db_version to the cache.\n\twp_cache_flush();\n\t// Not all cache back ends listen to 'flush'.\n\twp_cache_delete( 'alloptions', 'options' );\n\n\t// Remove working directory.\n\t$wp_filesystem->delete( $from, true );\n\n\t// Force refresh of update information.\n\tif ( function_exists( 'delete_site_transient' ) ) {\n\t\tdelete_site_transient( 'update_core' );\n\t} else {\n\t\tdelete_option( 'update_core' );\n\t}\n\n\t/**\n\t * Fires after WordPress core has been successfully updated.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $wp_version The current WordPress version.\n\t */\n\tdo_action( '_core_updated_successfully', $wp_version );\n\n\t// Clear the option that blocks auto-updates after failures, now that we've been successful.\n\tif ( function_exists( 'delete_site_option' ) ) {\n\t\tdelete_site_option( 'auto_core_update_failed' );\n\t}\n\n\treturn $wp_version;\n}\n\n/**\n * Copies a directory from one location to another via the WordPress Filesystem Abstraction.\n *\n * Assumes that WP_Filesystem() has already been called and setup.\n *\n * This is a standalone copy of the `copy_dir()` function that is used to\n * upgrade the core files. It is placed here so that the version of this\n * function from the *new* WordPress version will be called.\n *\n * It was initially added for the 3.1 -> 3.2 upgrade.\n *\n * @ignore\n * @since 3.2.0\n * @since 3.7.0 Updated not to use a regular expression for the skip list.\n *\n * @see copy_dir()\n * @link https://core.trac.wordpress.org/ticket/17173\n *\n * @global WP_Filesystem_Base $wp_filesystem\n *\n * @param string   $from      Source directory.\n * @param string   $to        Destination directory.\n * @param string[] $skip_list Array of files/folders to skip copying.\n * @return true|WP_Error True on success, WP_Error on failure.\n */\nfunction _copy_dir( $from, $to, $skip_list = array() ) {\n\tglobal $wp_filesystem;\n\n\t$dirlist = $wp_filesystem->dirlist( $from );\n\n\t$from = trailingslashit( $from );\n\t$to   = trailingslashit( $to );\n\n\tforeach ( (array) $dirlist as $filename => $fileinfo ) {\n\t\tif ( in_array( $filename, $skip_list, true ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( 'f' === $fileinfo['type'] ) {\n\t\t\tif ( ! $wp_filesystem->copy( $from . $filename, $to . $filename, true, FS_CHMOD_FILE ) ) {\n\t\t\t\t// If copy failed, chmod file to 0644 and try again.\n\t\t\t\t$wp_filesystem->chmod( $to . $filename, FS_CHMOD_FILE );\n\t\t\t\tif ( ! $wp_filesystem->copy( $from . $filename, $to . $filename, true, FS_CHMOD_FILE ) ) {\n\t\t\t\t\treturn new WP_Error( 'copy_failed__copy_dir', __( 'Could not copy file.' ), $to . $filename );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// `wp_opcache_invalidate()` only exists in WordPress 5.5, so don't run it when upgrading to 5.5.\n\t\t\tif ( function_exists( 'wp_opcache_invalidate' ) ) {\n\t\t\t\twp_opcache_invalidate( $to . $filename );\n\t\t\t}\n\t\t} elseif ( 'd' === $fileinfo['type'] ) {\n\t\t\tif ( ! $wp_filesystem->is_dir( $to . $filename ) ) {\n\t\t\t\tif ( ! $wp_filesystem->mkdir( $to . $filename, FS_CHMOD_DIR ) ) {\n\t\t\t\t\treturn new WP_Error( 'mkdir_failed__copy_dir', __( 'Could not create directory.' ), $to . $filename );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Generate the $sub_skip_list for the subdirectory as a sub-set\n\t\t\t * of the existing $skip_list.\n\t\t\t */\n\t\t\t$sub_skip_list = array();\n\t\t\tforeach ( $skip_list as $skip_item ) {\n\t\t\t\tif ( 0 === strpos( $skip_item, $filename . '/' ) ) {\n\t\t\t\t\t$sub_skip_list[] = preg_replace( '!^' . preg_quote( $filename, '!' ) . '/!i', '', $skip_item );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$result = _copy_dir( $from . $filename, $to . $filename, $sub_skip_list );\n\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * Redirect to the About WordPress page after a successful upgrade.\n *\n * This function is only needed when the existing installation is older than 3.4.0.\n *\n * @since 3.3.0\n *\n * @global string $wp_version The WordPress version string.\n * @global string $pagenow\n * @global string $action\n *\n * @param string $new_version\n */\nfunction _redirect_to_about_wordpress( $new_version ) {\n\tglobal $wp_version, $pagenow, $action;\n\n\tif ( version_compare( $wp_version, '3.4-RC1', '>=' ) ) {\n\t\treturn;\n\t}\n\n\t// Ensure we only run this on the update-core.php page. The Core_Upgrader may be used in other contexts.\n\tif ( 'update-core.php' !== $pagenow ) {\n\t\treturn;\n\t}\n\n\tif ( 'do-core-upgrade' !== $action && 'do-core-reinstall' !== $action ) {\n\t\treturn;\n\t}\n\n\t// Load the updated default text localization domain for new strings.\n\tload_default_textdomain();\n\n\t// See do_core_upgrade().\n\tshow_message( __( 'WordPress updated successfully.' ) );\n\n\t// self_admin_url() won't exist when upgrading from <= 3.0, so relative URLs are intentional.\n\tshow_message(\n\t\t'<span class=\"hide-if-no-js\">' . sprintf(\n\t\t\t/* translators: 1: WordPress version, 2: URL to About screen. */\n\t\t\t__( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href=\"%2$s\">here</a>.' ),\n\t\t\t$new_version,\n\t\t\t'about.php?updated'\n\t\t) . '</span>'\n\t);\n\tshow_message(\n\t\t'<span class=\"hide-if-js\">' . sprintf(\n\t\t\t/* translators: 1: WordPress version, 2: URL to About screen. */\n\t\t\t__( 'Welcome to WordPress %1$s. <a href=\"%2$s\">Learn more</a>.' ),\n\t\t\t$new_version,\n\t\t\t'about.php?updated'\n\t\t) . '</span>'\n\t);\n\techo '</div>';\n\t?>\n<script type=\"text/javascript\">\nwindow.location = 'about.php?updated';\n</script>\n\t<?php\n\n\t// Include admin-footer.php and exit.\n\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\texit;\n}\n\n/**\n * Cleans up Genericons example files.\n *\n * @since 4.2.2\n *\n * @global array              $wp_theme_directories\n * @global WP_Filesystem_Base $wp_filesystem\n */\nfunction _upgrade_422_remove_genericons() {\n\tglobal $wp_theme_directories, $wp_filesystem;\n\n\t// A list of the affected files using the filesystem absolute paths.\n\t$affected_files = array();\n\n\t// Themes.\n\tforeach ( $wp_theme_directories as $directory ) {\n\t\t$affected_theme_files = _upgrade_422_find_genericons_files_in_folder( $directory );\n\t\t$affected_files       = array_merge( $affected_files, $affected_theme_files );\n\t}\n\n\t// Plugins.\n\t$affected_plugin_files = _upgrade_422_find_genericons_files_in_folder( WP_PLUGIN_DIR );\n\t$affected_files        = array_merge( $affected_files, $affected_plugin_files );\n\n\tforeach ( $affected_files as $file ) {\n\t\t$gen_dir = $wp_filesystem->find_folder( trailingslashit( dirname( $file ) ) );\n\t\tif ( empty( $gen_dir ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// The path when the file is accessed via WP_Filesystem may differ in the case of FTP.\n\t\t$remote_file = $gen_dir . basename( $file );\n\n\t\tif ( ! $wp_filesystem->exists( $remote_file ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( ! $wp_filesystem->delete( $remote_file, false, 'f' ) ) {\n\t\t\t$wp_filesystem->put_contents( $remote_file, '' );\n\t\t}\n\t}\n}\n\n/**\n * Recursively find Genericons example files in a given folder.\n *\n * @ignore\n * @since 4.2.2\n *\n * @param string $directory Directory path. Expects trailingslashed.\n * @return array\n */\nfunction _upgrade_422_find_genericons_files_in_folder( $directory ) {\n\t$directory = trailingslashit( $directory );\n\t$files     = array();\n\n\tif ( file_exists( \"{$directory}example.html\" ) && false !== strpos( file_get_contents( \"{$directory}example.html\" ), '<title>Genericons</title>' ) ) {\n\t\t$files[] = \"{$directory}example.html\";\n\t}\n\n\t$dirs = glob( $directory . '*', GLOB_ONLYDIR );\n\tif ( $dirs ) {\n\t\tforeach ( $dirs as $dir ) {\n\t\t\t$files = array_merge( $files, _upgrade_422_find_genericons_files_in_folder( $dir ) );\n\t\t}\n\t}\n\n\treturn $files;\n}\n\n/**\n * @ignore\n * @since 4.4.0\n */\nfunction _upgrade_440_force_deactivate_incompatible_plugins() {\n\tif ( defined( 'REST_API_VERSION' ) && version_compare( REST_API_VERSION, '2.0-beta4', '<=' ) ) {\n\t\tdeactivate_plugins( array( 'rest-api/plugin.php' ), true );\n\t}\n}\n", "num_lines": 1542}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Administration Update API\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Selects the first update version from the update_core option.\n *\n * @since 2.7.0\n *\n * @return object|array|false The response from the API on success, false on failure.\n */\nfunction get_preferred_from_update_core() {\n\t$updates = get_core_updates();\n\tif ( ! is_array( $updates ) ) {\n\t\treturn false;\n\t}\n\tif ( empty( $updates ) ) {\n\t\treturn (object) array( 'response' => 'latest' );\n\t}\n\treturn $updates[0];\n}\n\n/**\n * Gets available core updates.\n *\n * @since 2.7.0\n *\n * @param array $options Set $options['dismissed'] to true to show dismissed upgrades too,\n *                       set $options['available'] to false to skip not-dismissed updates.\n * @return array|false Array of the update objects on success, false on failure.\n */\nfunction get_core_updates( $options = array() ) {\n\t$options   = array_merge(\n\t\tarray(\n\t\t\t'available' => true,\n\t\t\t'dismissed' => false,\n\t\t),\n\t\t$options\n\t);\n\t$dismissed = get_site_option( 'dismissed_update_core' );\n\n\tif ( ! is_array( $dismissed ) ) {\n\t\t$dismissed = array();\n\t}\n\n\t$from_api = get_site_transient( 'update_core' );\n\n\tif ( ! isset( $from_api->updates ) || ! is_array( $from_api->updates ) ) {\n\t\treturn false;\n\t}\n\n\t$updates = $from_api->updates;\n\t$result  = array();\n\tforeach ( $updates as $update ) {\n\t\tif ( 'autoupdate' === $update->response ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( array_key_exists( $update->current . '|' . $update->locale, $dismissed ) ) {\n\t\t\tif ( $options['dismissed'] ) {\n\t\t\t\t$update->dismissed = true;\n\t\t\t\t$result[]          = $update;\n\t\t\t}\n\t\t} else {\n\t\t\tif ( $options['available'] ) {\n\t\t\t\t$update->dismissed = false;\n\t\t\t\t$result[]          = $update;\n\t\t\t}\n\t\t}\n\t}\n\treturn $result;\n}\n\n/**\n * Gets the best available (and enabled) Auto-Update for WordPress core.\n *\n * If there's 1.2.3 and 1.3 on offer, it'll choose 1.3 if the installation allows it, else, 1.2.3.\n *\n * @since 3.7.0\n *\n * @return object|false The core update offering on success, false on failure.\n */\nfunction find_core_auto_update() {\n\t$updates = get_site_transient( 'update_core' );\n\tif ( ! $updates || empty( $updates->updates ) ) {\n\t\treturn false;\n\t}\n\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\n\t$auto_update = false;\n\t$upgrader    = new WP_Automatic_Updater;\n\tforeach ( $updates->updates as $update ) {\n\t\tif ( 'autoupdate' !== $update->response ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( ! $upgrader->should_update( 'core', $update, ABSPATH ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( ! $auto_update || version_compare( $update->current, $auto_update->current, '>' ) ) {\n\t\t\t$auto_update = $update;\n\t\t}\n\t}\n\treturn $auto_update;\n}\n\n/**\n * Gets and caches the checksums for the given version of WordPress.\n *\n * @since 3.7.0\n *\n * @param string $version Version string to query.\n * @param string $locale  Locale to query.\n * @return array|false An array of checksums on success, false on failure.\n */\nfunction get_core_checksums( $version, $locale ) {\n\t$http_url = 'http://api.wordpress.org/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), null, '&' );\n\t$url      = $http_url;\n\n\t$ssl = wp_http_supports( array( 'ssl' ) );\n\tif ( $ssl ) {\n\t\t$url = set_url_scheme( $url, 'https' );\n\t}\n\n\t$options = array(\n\t\t'timeout' => wp_doing_cron() ? 30 : 3,\n\t);\n\n\t$response = wp_remote_get( $url, $options );\n\tif ( $ssl && is_wp_error( $response ) ) {\n\t\ttrigger_error(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=\"%s\">support forums</a>.' ),\n\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),\n\t\t\theaders_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE\n\t\t);\n\t\t$response = wp_remote_get( $http_url, $options );\n\t}\n\n\tif ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {\n\t\treturn false;\n\t}\n\n\t$body = trim( wp_remote_retrieve_body( $response ) );\n\t$body = json_decode( $body, true );\n\n\tif ( ! is_array( $body ) || ! isset( $body['checksums'] ) || ! is_array( $body['checksums'] ) ) {\n\t\treturn false;\n\t}\n\n\treturn $body['checksums'];\n}\n\n/**\n * Dismisses core update.\n *\n * @since 2.7.0\n *\n * @param object $update\n * @return bool\n */\nfunction dismiss_core_update( $update ) {\n\t$dismissed = get_site_option( 'dismissed_update_core' );\n\t$dismissed[ $update->current . '|' . $update->locale ] = true;\n\treturn update_site_option( 'dismissed_update_core', $dismissed );\n}\n\n/**\n * Undismisses core update.\n *\n * @since 2.7.0\n *\n * @param string $version\n * @param string $locale\n * @return bool\n */\nfunction undismiss_core_update( $version, $locale ) {\n\t$dismissed = get_site_option( 'dismissed_update_core' );\n\t$key       = $version . '|' . $locale;\n\n\tif ( ! isset( $dismissed[ $key ] ) ) {\n\t\treturn false;\n\t}\n\n\tunset( $dismissed[ $key ] );\n\treturn update_site_option( 'dismissed_update_core', $dismissed );\n}\n\n/**\n * Finds the available update for WordPress core.\n *\n * @since 2.7.0\n *\n * @param string $version Version string to find the update for.\n * @param string $locale  Locale to find the update for.\n * @return object|false The core update offering on success, false on failure.\n */\nfunction find_core_update( $version, $locale ) {\n\t$from_api = get_site_transient( 'update_core' );\n\n\tif ( ! isset( $from_api->updates ) || ! is_array( $from_api->updates ) ) {\n\t\treturn false;\n\t}\n\n\t$updates = $from_api->updates;\n\tforeach ( $updates as $update ) {\n\t\tif ( $update->current == $version && $update->locale == $locale ) {\n\t\t\treturn $update;\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * @since 2.3.0\n *\n * @param string $msg\n * @return string\n */\nfunction core_update_footer( $msg = '' ) {\n\tif ( ! current_user_can( 'update_core' ) ) {\n\t\t/* translators: %s: WordPress version. */\n\t\treturn sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) );\n\t}\n\n\t$cur = get_preferred_from_update_core();\n\tif ( ! is_object( $cur ) ) {\n\t\t$cur = new stdClass;\n\t}\n\n\tif ( ! isset( $cur->current ) ) {\n\t\t$cur->current = '';\n\t}\n\n\tif ( ! isset( $cur->url ) ) {\n\t\t$cur->url = '';\n\t}\n\n\tif ( ! isset( $cur->response ) ) {\n\t\t$cur->response = '';\n\t}\n\n\tswitch ( $cur->response ) {\n\t\tcase 'development':\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: 1: WordPress version number, 2: URL to WordPress Updates screen. */\n\t\t\t\t__( 'You are using a development version (%1$s). Cool! Please <a href=\"%2$s\">stay updated</a>.' ),\n\t\t\t\tget_bloginfo( 'version', 'display' ),\n\t\t\t\tnetwork_admin_url( 'update-core.php' )\n\t\t\t);\n\n\t\tcase 'upgrade':\n\t\t\treturn sprintf(\n\t\t\t\t'<strong><a href=\"%s\">%s</a></strong>',\n\t\t\t\tnetwork_admin_url( 'update-core.php' ),\n\t\t\t\t/* translators: %s: WordPress version. */\n\t\t\t\tsprintf( __( 'Get Version %s' ), $cur->current )\n\t\t\t);\n\n\t\tcase 'latest':\n\t\tdefault:\n\t\t\t/* translators: %s: WordPress version. */\n\t\t\treturn sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) );\n\t}\n}\n\n/**\n * @since 2.3.0\n *\n * @global string $pagenow\n * @return void|false\n */\nfunction update_nag() {\n\tif ( is_multisite() && ! current_user_can( 'update_core' ) ) {\n\t\treturn false;\n\t}\n\n\tglobal $pagenow;\n\n\tif ( 'update-core.php' === $pagenow ) {\n\t\treturn;\n\t}\n\n\t$cur = get_preferred_from_update_core();\n\n\tif ( ! isset( $cur->response ) || 'upgrade' !== $cur->response ) {\n\t\treturn false;\n\t}\n\n\t$version_url = sprintf(\n\t\t/* translators: %s: WordPress version. */\n\t\tesc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),\n\t\tsanitize_title( $cur->current )\n\t);\n\n\tif ( current_user_can( 'update_core' ) ) {\n\t\t$msg = sprintf(\n\t\t\t/* translators: 1: URL to WordPress release notes, 2: New WordPress version, 3: URL to network admin, 4: Accessibility text. */\n\t\t\t__( '<a href=\"%1$s\">WordPress %2$s</a> is available! <a href=\"%3$s\" aria-label=\"%4$s\">Please update now</a>.' ),\n\t\t\t$version_url,\n\t\t\t$cur->current,\n\t\t\tnetwork_admin_url( 'update-core.php' ),\n\t\t\tesc_attr__( 'Please update WordPress now' )\n\t\t);\n\t} else {\n\t\t$msg = sprintf(\n\t\t\t/* translators: 1: URL to WordPress release notes, 2: New WordPress version. */\n\t\t\t__( '<a href=\"%1$s\">WordPress %2$s</a> is available! Please notify the site administrator.' ),\n\t\t\t$version_url,\n\t\t\t$cur->current\n\t\t);\n\t}\n\n\techo \"<div class='update-nag notice notice-warning inline'>$msg</div>\";\n}\n\n/**\n * Displays WordPress version and active theme in the 'At a Glance' dashboard widget.\n *\n * @since 2.5.0\n */\nfunction update_right_now_message() {\n\t$theme_name = wp_get_theme();\n\tif ( current_user_can( 'switch_themes' ) ) {\n\t\t$theme_name = sprintf( '<a href=\"themes.php\">%1$s</a>', $theme_name );\n\t}\n\n\t$msg = '';\n\n\tif ( current_user_can( 'update_core' ) ) {\n\t\t$cur = get_preferred_from_update_core();\n\n\t\tif ( isset( $cur->response ) && 'upgrade' === $cur->response ) {\n\t\t\t$msg .= sprintf(\n\t\t\t\t'<a href=\"%s\" class=\"button\" aria-describedby=\"wp-version\">%s</a> ',\n\t\t\t\tnetwork_admin_url( 'update-core.php' ),\n\t\t\t\t/* translators: %s: WordPress version number, or 'Latest' string. */\n\t\t\t\tsprintf( __( 'Update to %s' ), $cur->current ? $cur->current : __( 'Latest' ) )\n\t\t\t);\n\t\t}\n\t}\n\n\t/* translators: 1: Version number, 2: Theme name. */\n\t$content = __( 'WordPress %1$s running %2$s theme.' );\n\n\t/**\n\t * Filters the text displayed in the 'At a Glance' dashboard widget.\n\t *\n\t * Prior to 3.8.0, the widget was named 'Right Now'.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $content Default text.\n\t */\n\t$content = apply_filters( 'update_right_now_text', $content );\n\n\t$msg .= sprintf( '<span id=\"wp-version\">' . $content . '</span>', get_bloginfo( 'version', 'display' ), $theme_name );\n\n\techo \"<p id='wp-version-message'>$msg</p>\";\n}\n\n/**\n * @since 2.9.0\n *\n * @return array\n */\nfunction get_plugin_updates() {\n\t$all_plugins     = get_plugins();\n\t$upgrade_plugins = array();\n\t$current         = get_site_transient( 'update_plugins' );\n\tforeach ( (array) $all_plugins as $plugin_file => $plugin_data ) {\n\t\tif ( isset( $current->response[ $plugin_file ] ) ) {\n\t\t\t$upgrade_plugins[ $plugin_file ]         = (object) $plugin_data;\n\t\t\t$upgrade_plugins[ $plugin_file ]->update = $current->response[ $plugin_file ];\n\t\t}\n\t}\n\n\treturn $upgrade_plugins;\n}\n\n/**\n * @since 2.9.0\n */\nfunction wp_plugin_update_rows() {\n\tif ( ! current_user_can( 'update_plugins' ) ) {\n\t\treturn;\n\t}\n\n\t$plugins = get_site_transient( 'update_plugins' );\n\tif ( isset( $plugins->response ) && is_array( $plugins->response ) ) {\n\t\t$plugins = array_keys( $plugins->response );\n\t\tforeach ( $plugins as $plugin_file ) {\n\t\t\tadd_action( \"after_plugin_row_{$plugin_file}\", 'wp_plugin_update_row', 10, 2 );\n\t\t}\n\t}\n}\n\n/**\n * Displays update information for a plugin.\n *\n * @since 2.3.0\n *\n * @param string $file        Plugin basename.\n * @param array  $plugin_data Plugin information.\n * @return void|false\n */\nfunction wp_plugin_update_row( $file, $plugin_data ) {\n\t$current = get_site_transient( 'update_plugins' );\n\tif ( ! isset( $current->response[ $file ] ) ) {\n\t\treturn false;\n\t}\n\n\t$response = $current->response[ $file ];\n\n\t$plugins_allowedtags = array(\n\t\t'a'       => array(\n\t\t\t'href'  => array(),\n\t\t\t'title' => array(),\n\t\t),\n\t\t'abbr'    => array( 'title' => array() ),\n\t\t'acronym' => array( 'title' => array() ),\n\t\t'code'    => array(),\n\t\t'em'      => array(),\n\t\t'strong'  => array(),\n\t);\n\n\t$plugin_name = wp_kses( $plugin_data['Name'], $plugins_allowedtags );\n\t$details_url = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $response->slug . '&section=changelog&TB_iframe=true&width=600&height=800' );\n\n\t/** @var WP_Plugins_List_Table $wp_list_table */\n\t$wp_list_table = _get_list_table(\n\t\t'WP_Plugins_List_Table',\n\t\tarray(\n\t\t\t'screen' => get_current_screen(),\n\t\t)\n\t);\n\n\tif ( is_network_admin() || ! is_multisite() ) {\n\t\tif ( is_network_admin() ) {\n\t\t\t$active_class = is_plugin_active_for_network( $file ) ? ' active' : '';\n\t\t} else {\n\t\t\t$active_class = is_plugin_active( $file ) ? ' active' : '';\n\t\t}\n\n\t\t$requires_php   = isset( $response->requires_php ) ? $response->requires_php : null;\n\t\t$compatible_php = is_php_version_compatible( $requires_php );\n\t\t$notice_type    = $compatible_php ? 'notice-warning' : 'notice-error';\n\n\t\tprintf(\n\t\t\t'<tr class=\"plugin-update-tr%s\" id=\"%s\" data-slug=\"%s\" data-plugin=\"%s\">' .\n\t\t\t'<td colspan=\"%s\" class=\"plugin-update colspanchange\">' .\n\t\t\t'<div class=\"update-message notice inline %s notice-alt\"><p>',\n\t\t\t$active_class,\n\t\t\tesc_attr( $response->slug . '-update' ),\n\t\t\tesc_attr( $response->slug ),\n\t\t\tesc_attr( $file ),\n\t\t\tesc_attr( $wp_list_table->get_column_count() ),\n\t\t\t$notice_type\n\t\t);\n\n\t\tif ( ! current_user_can( 'update_plugins' ) ) {\n\t\t\tprintf(\n\t\t\t\t/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number. */\n\t\t\t\t__( 'There is a new version of %1$s available. <a href=\"%2$s\" %3$s>View version %4$s details</a>.' ),\n\t\t\t\t$plugin_name,\n\t\t\t\tesc_url( $details_url ),\n\t\t\t\tsprintf(\n\t\t\t\t\t'class=\"thickbox open-plugin-details-modal\" aria-label=\"%s\"',\n\t\t\t\t\t/* translators: 1: Plugin name, 2: Version number. */\n\t\t\t\t\tesc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )\n\t\t\t\t),\n\t\t\t\tesc_attr( $response->new_version )\n\t\t\t);\n\t\t} elseif ( empty( $response->package ) ) {\n\t\t\tprintf(\n\t\t\t\t/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number. */\n\t\t\t\t__( 'There is a new version of %1$s available. <a href=\"%2$s\" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>' ),\n\t\t\t\t$plugin_name,\n\t\t\t\tesc_url( $details_url ),\n\t\t\t\tsprintf(\n\t\t\t\t\t'class=\"thickbox open-plugin-details-modal\" aria-label=\"%s\"',\n\t\t\t\t\t/* translators: 1: Plugin name, 2: Version number. */\n\t\t\t\t\tesc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )\n\t\t\t\t),\n\t\t\t\tesc_attr( $response->new_version )\n\t\t\t);\n\t\t} else {\n\t\t\tif ( $compatible_php ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number, 5: Update URL, 6: Additional link attributes. */\n\t\t\t\t\t__( 'There is a new version of %1$s available. <a href=\"%2$s\" %3$s>View version %4$s details</a> or <a href=\"%5$s\" %6$s>update now</a>.' ),\n\t\t\t\t\t$plugin_name,\n\t\t\t\t\tesc_url( $details_url ),\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t'class=\"thickbox open-plugin-details-modal\" aria-label=\"%s\"',\n\t\t\t\t\t\t/* translators: 1: Plugin name, 2: Version number. */\n\t\t\t\t\t\tesc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )\n\t\t\t\t\t),\n\t\t\t\t\tesc_attr( $response->new_version ),\n\t\t\t\t\twp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ),\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t'class=\"update-link\" aria-label=\"%s\"',\n\t\t\t\t\t\t/* translators: %s: Plugin name. */\n\t\t\t\t\t\tesc_attr( sprintf( _x( 'Update %s now', 'plugin' ), $plugin_name ) )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number 5: URL to Update PHP page. */\n\t\t\t\t\t__( 'There is a new version of %1$s available, but it doesn&#8217;t work with your version of PHP. <a href=\"%2$s\" %3$s>View version %4$s details</a> or <a href=\"%5$s\">learn more about updating PHP</a>.' ),\n\t\t\t\t\t$plugin_name,\n\t\t\t\t\tesc_url( $details_url ),\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t'class=\"thickbox open-plugin-details-modal\" aria-label=\"%s\"',\n\t\t\t\t\t\t/* translators: 1: Plugin name, 2: Version number. */\n\t\t\t\t\t\tesc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )\n\t\t\t\t\t),\n\t\t\t\t\tesc_attr( $response->new_version ),\n\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t);\n\t\t\t\twp_update_php_annotation( '<br><em>', '</em>' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Fires at the end of the update message container in each\n\t\t * row of the plugins list table.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$file`, refers to the path\n\t\t * of the plugin's primary file relative to the plugins directory.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param array $plugin_data {\n\t\t *     An array of plugin metadata.\n\t\t *\n\t\t *     @type string $name        The human-readable name of the plugin.\n\t\t *     @type string $plugin_uri  Plugin URI.\n\t\t *     @type string $version     Plugin version.\n\t\t *     @type string $description Plugin description.\n\t\t *     @type string $author      Plugin author.\n\t\t *     @type string $author_uri  Plugin author URI.\n\t\t *     @type string $text_domain Plugin text domain.\n\t\t *     @type string $domain_path Relative path to the plugin's .mo file(s).\n\t\t *     @type bool   $network     Whether the plugin can only be activated network wide.\n\t\t *     @type string $title       The human-readable title of the plugin.\n\t\t *     @type string $author_name Plugin author's name.\n\t\t *     @type bool   $update      Whether there's an available update. Default null.\n\t\t * }\n\t\t * @param array $response {\n\t\t *     An array of metadata about the available plugin update.\n\t\t *\n\t\t *     @type int    $id          Plugin ID.\n\t\t *     @type string $slug        Plugin slug.\n\t\t *     @type string $new_version New plugin version.\n\t\t *     @type string $url         Plugin URL.\n\t\t *     @type string $package     Plugin update package URL.\n\t\t * }\n\t\t */\n\t\tdo_action( \"in_plugin_update_message-{$file}\", $plugin_data, $response ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\techo '</p></div></td></tr>';\n\t}\n}\n\n/**\n * @since 2.9.0\n *\n * @return array\n */\nfunction get_theme_updates() {\n\t$current = get_site_transient( 'update_themes' );\n\n\tif ( ! isset( $current->response ) ) {\n\t\treturn array();\n\t}\n\n\t$update_themes = array();\n\tforeach ( $current->response as $stylesheet => $data ) {\n\t\t$update_themes[ $stylesheet ]         = wp_get_theme( $stylesheet );\n\t\t$update_themes[ $stylesheet ]->update = $data;\n\t}\n\n\treturn $update_themes;\n}\n\n/**\n * @since 3.1.0\n */\nfunction wp_theme_update_rows() {\n\tif ( ! current_user_can( 'update_themes' ) ) {\n\t\treturn;\n\t}\n\n\t$themes = get_site_transient( 'update_themes' );\n\tif ( isset( $themes->response ) && is_array( $themes->response ) ) {\n\t\t$themes = array_keys( $themes->response );\n\n\t\tforeach ( $themes as $theme ) {\n\t\t\tadd_action( \"after_theme_row_{$theme}\", 'wp_theme_update_row', 10, 2 );\n\t\t}\n\t}\n}\n\n/**\n * Displays update information for a theme.\n *\n * @since 3.1.0\n *\n * @param string   $theme_key Theme stylesheet.\n * @param WP_Theme $theme     Theme object.\n * @return void|false\n */\nfunction wp_theme_update_row( $theme_key, $theme ) {\n\t$current = get_site_transient( 'update_themes' );\n\n\tif ( ! isset( $current->response[ $theme_key ] ) ) {\n\t\treturn false;\n\t}\n\n\t$response = $current->response[ $theme_key ];\n\n\t$details_url = add_query_arg(\n\t\tarray(\n\t\t\t'TB_iframe' => 'true',\n\t\t\t'width'     => 1024,\n\t\t\t'height'    => 800,\n\t\t),\n\t\t$current->response[ $theme_key ]['url']\n\t);\n\n\t/** @var WP_MS_Themes_List_Table $wp_list_table */\n\t$wp_list_table = _get_list_table( 'WP_MS_Themes_List_Table' );\n\n\t$active = $theme->is_allowed( 'network' ) ? ' active' : '';\n\n\t$requires_wp  = isset( $response['requires'] ) ? $response['requires'] : null;\n\t$requires_php = isset( $response['requires_php'] ) ? $response['requires_php'] : null;\n\n\t$compatible_wp  = is_wp_version_compatible( $requires_wp );\n\t$compatible_php = is_php_version_compatible( $requires_php );\n\n\tprintf(\n\t\t'<tr class=\"plugin-update-tr%s\" id=\"%s\" data-slug=\"%s\">' .\n\t\t'<td colspan=\"%s\" class=\"plugin-update colspanchange\">' .\n\t\t'<div class=\"update-message notice inline notice-warning notice-alt\"><p>',\n\t\t$active,\n\t\tesc_attr( $theme->get_stylesheet() . '-update' ),\n\t\tesc_attr( $theme->get_stylesheet() ),\n\t\t$wp_list_table->get_column_count()\n\t);\n\n\tif ( $compatible_wp && $compatible_php ) {\n\t\tif ( ! current_user_can( 'update_themes' ) ) {\n\t\t\tprintf(\n\t\t\t\t/* translators: 1: Theme name, 2: Details URL, 3: Additional link attributes, 4: Version number. */\n\t\t\t\t__( 'There is a new version of %1$s available. <a href=\"%2$s\" %3$s>View version %4$s details</a>.' ),\n\t\t\t\t$theme['Name'],\n\t\t\t\tesc_url( $details_url ),\n\t\t\t\tsprintf(\n\t\t\t\t\t'class=\"thickbox open-plugin-details-modal\" aria-label=\"%s\"',\n\t\t\t\t\t/* translators: 1: Theme name, 2: Version number. */\n\t\t\t\t\tesc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) )\n\t\t\t\t),\n\t\t\t\t$response['new_version']\n\t\t\t);\n\t\t} elseif ( empty( $response['package'] ) ) {\n\t\t\tprintf(\n\t\t\t\t/* translators: 1: Theme name, 2: Details URL, 3: Additional link attributes, 4: Version number. */\n\t\t\t\t__( 'There is a new version of %1$s available. <a href=\"%2$s\" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ),\n\t\t\t\t$theme['Name'],\n\t\t\t\tesc_url( $details_url ),\n\t\t\t\tsprintf(\n\t\t\t\t\t'class=\"thickbox open-plugin-details-modal\" aria-label=\"%s\"',\n\t\t\t\t\t/* translators: 1: Theme name, 2: Version number. */\n\t\t\t\t\tesc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) )\n\t\t\t\t),\n\t\t\t\t$response['new_version']\n\t\t\t);\n\t\t} else {\n\t\t\tprintf(\n\t\t\t\t/* translators: 1: Theme name, 2: Details URL, 3: Additional link attributes, 4: Version number, 5: Update URL, 6: Additional link attributes. */\n\t\t\t\t__( 'There is a new version of %1$s available. <a href=\"%2$s\" %3$s>View version %4$s details</a> or <a href=\"%5$s\" %6$s>update now</a>.' ),\n\t\t\t\t$theme['Name'],\n\t\t\t\tesc_url( $details_url ),\n\t\t\t\tsprintf(\n\t\t\t\t\t'class=\"thickbox open-plugin-details-modal\" aria-label=\"%s\"',\n\t\t\t\t\t/* translators: 1: Theme name, 2: Version number. */\n\t\t\t\t\tesc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) )\n\t\t\t\t),\n\t\t\t\t$response['new_version'],\n\t\t\t\twp_nonce_url( self_admin_url( 'update.php?action=upgrade-theme&theme=' ) . $theme_key, 'upgrade-theme_' . $theme_key ),\n\t\t\t\tsprintf(\n\t\t\t\t\t'class=\"update-link\" aria-label=\"%s\"',\n\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\tesc_attr( sprintf( _x( 'Update %s now', 'theme' ), $theme['Name'] ) )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif ( ! $compatible_wp && ! $compatible_php ) {\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),\n\t\t\t\t$theme['Name']\n\t\t\t);\n\t\t\tif ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */\n\t\t\t\t\t' ' . __( '<a href=\"%1$s\">Please update WordPress</a>, and then <a href=\"%2$s\">learn more about updating PHP</a>.' ),\n\t\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t);\n\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t} elseif ( current_user_can( 'update_core' ) ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t);\n\t\t\t} elseif ( current_user_can( 'update_php' ) ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t);\n\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t}\n\t\t} elseif ( ! $compatible_wp ) {\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),\n\t\t\t\t$theme['Name']\n\t\t\t);\n\t\t\tif ( current_user_can( 'update_core' ) ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t);\n\t\t\t}\n\t\t} elseif ( ! $compatible_php ) {\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),\n\t\t\t\t$theme['Name']\n\t\t\t);\n\t\t\tif ( current_user_can( 'update_php' ) ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t);\n\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Fires at the end of the update message container in each\n\t * row of the themes list table.\n\t *\n\t * The dynamic portion of the hook name, `$theme_key`, refers to\n\t * the theme slug as found in the WordPress.org themes repository.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param WP_Theme $theme    The WP_Theme object.\n\t * @param array    $response {\n\t *     An array of metadata about the available theme update.\n\t *\n\t *     @type string $new_version New theme version.\n\t *     @type string $url         Theme URL.\n\t *     @type string $package     Theme update package URL.\n\t * }\n\t */\n\tdo_action( \"in_theme_update_message-{$theme_key}\", $theme, $response ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\techo '</p></div></td></tr>';\n}\n\n/**\n * @since 2.7.0\n *\n * @global int $upgrading\n * @return void|false\n */\nfunction maintenance_nag() {\n\t// Include an unmodified $wp_version.\n\trequire ABSPATH . WPINC . '/version.php';\n\tglobal $upgrading;\n\t$nag = isset( $upgrading );\n\tif ( ! $nag ) {\n\t\t$failed = get_site_option( 'auto_core_update_failed' );\n\t\t/*\n\t\t * If an update failed critically, we may have copied over version.php but not other files.\n\t\t * In that case, if the installation claims we're running the version we attempted, nag.\n\t\t * This is serious enough to err on the side of nagging.\n\t\t *\n\t\t * If we simply failed to update before we tried to copy any files, then assume things are\n\t\t * OK if they are now running the latest.\n\t\t *\n\t\t * This flag is cleared whenever a successful update occurs using Core_Upgrader.\n\t\t */\n\t\t$comparison = ! empty( $failed['critical'] ) ? '>=' : '>';\n\t\tif ( isset( $failed['attempted'] ) && version_compare( $failed['attempted'], $wp_version, $comparison ) ) {\n\t\t\t$nag = true;\n\t\t}\n\t}\n\n\tif ( ! $nag ) {\n\t\treturn false;\n\t}\n\n\tif ( current_user_can( 'update_core' ) ) {\n\t\t$msg = sprintf(\n\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t__( 'An automated WordPress update has failed to complete - <a href=\"%s\">please attempt the update again now</a>.' ),\n\t\t\t'update-core.php'\n\t\t);\n\t} else {\n\t\t$msg = __( 'An automated WordPress update has failed to complete! Please notify the site administrator.' );\n\t}\n\n\techo \"<div class='update-nag notice notice-warning inline'>$msg</div>\";\n}\n\n/**\n * Prints the JavaScript templates for update admin notices.\n *\n * Template takes one argument with four values:\n *\n *     param {object} data {\n *         Arguments for admin notice.\n *\n *         @type string id        ID of the notice.\n *         @type string className Class names for the notice.\n *         @type string message   The notice's message.\n *         @type string type      The type of update the notice is for. Either 'plugin' or 'theme'.\n *     }\n *\n * @since 4.6.0\n */\nfunction wp_print_admin_notice_templates() {\n\t?>\n\t<script id=\"tmpl-wp-updates-admin-notice\" type=\"text/html\">\n\t\t<div <# if ( data.id ) { #>id=\"{{ data.id }}\"<# } #> class=\"notice {{ data.className }}\"><p>{{{ data.message }}}</p></div>\n\t</script>\n\t<script id=\"tmpl-wp-bulk-updates-admin-notice\" type=\"text/html\">\n\t\t<div id=\"{{ data.id }}\" class=\"{{ data.className }} notice <# if ( data.errors ) { #>notice-error<# } else { #>notice-success<# } #>\">\n\t\t\t<p>\n\t\t\t\t<# if ( data.successes ) { #>\n\t\t\t\t\t<# if ( 1 === data.successes ) { #>\n\t\t\t\t\t\t<# if ( 'plugin' === data.type ) { #>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/* translators: %s: Number of plugins. */\n\t\t\t\t\t\t\tprintf( __( '%s plugin successfully updated.' ), '{{ data.successes }}' );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/* translators: %s: Number of themes. */\n\t\t\t\t\t\t\tprintf( __( '%s theme successfully updated.' ), '{{ data.successes }}' );\n\t\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<# if ( 'plugin' === data.type ) { #>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/* translators: %s: Number of plugins. */\n\t\t\t\t\t\t\tprintf( __( '%s plugins successfully updated.' ), '{{ data.successes }}' );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/* translators: %s: Number of themes. */\n\t\t\t\t\t\t\tprintf( __( '%s themes successfully updated.' ), '{{ data.successes }}' );\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\t\t\t\t<# if ( data.errors ) { #>\n\t\t\t\t\t<button class=\"button-link bulk-action-errors-collapsed\" aria-expanded=\"false\">\n\t\t\t\t\t\t<# if ( 1 === data.errors ) { #>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/* translators: %s: Number of failed updates. */\n\t\t\t\t\t\t\tprintf( __( '%s update failed.' ), '{{ data.errors }}' );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/* translators: %s: Number of failed updates. */\n\t\t\t\t\t\t\tprintf( __( '%s updates failed.' ), '{{ data.errors }}' );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Show more details' ); ?></span>\n\t\t\t\t\t\t<span class=\"toggle-indicator\" aria-hidden=\"true\"></span>\n\t\t\t\t\t</button>\n\t\t\t\t<# } #>\n\t\t\t</p>\n\t\t\t<# if ( data.errors ) { #>\n\t\t\t\t<ul class=\"bulk-action-errors hidden\">\n\t\t\t\t\t<# _.each( data.errorMessages, function( errorMessage ) { #>\n\t\t\t\t\t\t<li>{{ errorMessage }}</li>\n\t\t\t\t\t<# } ); #>\n\t\t\t\t</ul>\n\t\t\t<# } #>\n\t\t</div>\n\t</script>\n\t<?php\n}\n\n/**\n * Prints the JavaScript templates for update and deletion rows in list tables.\n *\n * The update template takes one argument with four values:\n *\n *     param {object} data {\n *         Arguments for the update row\n *\n *         @type string slug    Plugin slug.\n *         @type string plugin  Plugin base name.\n *         @type string colspan The number of table columns this row spans.\n *         @type string content The row content.\n *     }\n *\n * The delete template takes one argument with four values:\n *\n *     param {object} data {\n *         Arguments for the update row\n *\n *         @type string slug    Plugin slug.\n *         @type string plugin  Plugin base name.\n *         @type string name    Plugin name.\n *         @type string colspan The number of table columns this row spans.\n *     }\n *\n * @since 4.6.0\n */\nfunction wp_print_update_row_templates() {\n\t?>\n\t<script id=\"tmpl-item-update-row\" type=\"text/template\">\n\t\t<tr class=\"plugin-update-tr update\" id=\"{{ data.slug }}-update\" data-slug=\"{{ data.slug }}\" <# if ( data.plugin ) { #>data-plugin=\"{{ data.plugin }}\"<# } #>>\n\t\t\t<td colspan=\"{{ data.colspan }}\" class=\"plugin-update colspanchange\">\n\t\t\t\t{{{ data.content }}}\n\t\t\t</td>\n\t\t</tr>\n\t</script>\n\t<script id=\"tmpl-item-deleted-row\" type=\"text/template\">\n\t\t<tr class=\"plugin-deleted-tr inactive deleted\" id=\"{{ data.slug }}-deleted\" data-slug=\"{{ data.slug }}\" <# if ( data.plugin ) { #>data-plugin=\"{{ data.plugin }}\"<# } #>>\n\t\t\t<td colspan=\"{{ data.colspan }}\" class=\"plugin-update colspanchange\">\n\t\t\t\t<# if ( data.plugin ) { #>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Plugin name. */\n\t\t\t\t\t\t_x( '%s was successfully deleted.', 'plugin' ),\n\t\t\t\t\t\t'<strong>{{{ data.name }}}</strong>'\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t_x( '%s was successfully deleted.', 'theme' ),\n\t\t\t\t\t\t'<strong>{{{ data.name }}}</strong>'\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t<# } #>\n\t\t\t</td>\n\t\t</tr>\n\t</script>\n\t<?php\n}\n\n/**\n * Displays a notice when the user is in recovery mode.\n *\n * @since 5.2.0\n */\nfunction wp_recovery_mode_nag() {\n\tif ( ! wp_is_recovery_mode() ) {\n\t\treturn;\n\t}\n\n\t$url = wp_login_url();\n\t$url = add_query_arg( 'action', WP_Recovery_Mode::EXIT_ACTION, $url );\n\t$url = wp_nonce_url( $url, WP_Recovery_Mode::EXIT_ACTION );\n\n\t?>\n\t<div class=\"notice notice-info\">\n\t\t<p>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: Recovery Mode exit link. */\n\t\t\t\t__( 'You are in recovery mode. This means there may be an error with a theme or plugin. To exit recovery mode, log out or use the Exit button. <a href=\"%s\">Exit Recovery Mode</a>' ),\n\t\t\t\tesc_url( $url )\n\t\t\t);\n\t\t\t?>\n\t\t</p>\n\t</div>\n\t<?php\n}\n\n/**\n * Checks whether auto-updates are enabled.\n *\n * @since 5.5.0\n *\n * @param string $type The type of update being checked: 'theme' or 'plugin'.\n * @return bool True if auto-updates are enabled for `$type`, false otherwise.\n */\nfunction wp_is_auto_update_enabled_for_type( $type ) {\n\tif ( ! class_exists( 'WP_Automatic_Updater' ) ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-automatic-updater.php';\n\t}\n\n\t$updater = new WP_Automatic_Updater();\n\t$enabled = ! $updater->is_disabled();\n\n\tswitch ( $type ) {\n\t\tcase 'plugin':\n\t\t\t/**\n\t\t\t * Filters whether plugins auto-update is enabled.\n\t\t\t *\n\t\t\t * @since 5.5.0\n\t\t\t *\n\t\t\t * @param bool $enabled True if plugins auto-update is enabled, false otherwise.\n\t\t\t */\n\t\t\treturn apply_filters( 'plugins_auto_update_enabled', $enabled );\n\t\tcase 'theme':\n\t\t\t/**\n\t\t\t * Filters whether themes auto-update is enabled.\n\t\t\t *\n\t\t\t * @since 5.5.0\n\t\t\t *\n\t\t\t * @param bool $enabled True if themes auto-update is enabled, false otherwise.\n\t\t\t */\n\t\t\treturn apply_filters( 'themes_auto_update_enabled', $enabled );\n\t}\n\n\treturn false;\n}\n\n/**\n * Determines the appropriate auto-update message to be displayed.\n *\n * @since 5.5.0\n *\n * @return string The update message to be shown.\n */\nfunction wp_get_auto_update_message() {\n\t$next_update_time = wp_next_scheduled( 'wp_version_check' );\n\n\t// Check if the event exists.\n\tif ( false === $next_update_time ) {\n\t\t$message = __( 'Automatic update not scheduled. There may be a problem with WP-Cron.' );\n\t} else {\n\t\t$time_to_next_update = human_time_diff( intval( $next_update_time ) );\n\n\t\t// See if cron is overdue.\n\t\t$overdue = ( time() - $next_update_time ) > 0;\n\n\t\tif ( $overdue ) {\n\t\t\t$message = sprintf(\n\t\t\t\t/* translators: %s: Duration that WP-Cron has been overdue. */\n\t\t\t\t__( 'Automatic update overdue by %s. There may be a problem with WP-Cron.' ),\n\t\t\t\t$time_to_next_update\n\t\t\t);\n\t\t} else {\n\t\t\t$message = sprintf(\n\t\t\t\t/* translators: %s: Time until the next update. */\n\t\t\t\t__( 'Automatic update scheduled in %s.' ),\n\t\t\t\t$time_to_next_update\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $message;\n}\n", "num_lines": 1084}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Upgrade API\n *\n * Most of the functions are pluggable and can be overwritten.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/** Include user installation customization script. */\nif ( file_exists( WP_CONTENT_DIR . '/install.php' ) ) {\n\trequire WP_CONTENT_DIR . '/install.php';\n}\n\n/** WordPress Administration API */\nrequire_once ABSPATH . 'wp-admin/includes/admin.php';\n\n/** WordPress Schema API */\nrequire_once ABSPATH . 'wp-admin/includes/schema.php';\n\nif ( ! function_exists( 'wp_install' ) ) :\n\t/**\n\t * Installs the site.\n\t *\n\t * Runs the required functions to set up and populate the database,\n\t * including primary admin user and initial options.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $blog_title    Site title.\n\t * @param string $user_name     User's username.\n\t * @param string $user_email    User's email.\n\t * @param bool   $public        Whether site is public.\n\t * @param string $deprecated    Optional. Not used.\n\t * @param string $user_password Optional. User's chosen password. Default empty (random password).\n\t * @param string $language      Optional. Language chosen. Default empty.\n\t * @return array {\n\t *     Data for the newly installed site.\n\t *\n\t *     @type string $url              The URL of the site.\n\t *     @type int    $user_id          The ID of the site owner.\n\t *     @type string $password         The password of the site owner, if their user account didn't already exist.\n\t *     @type string $password_message The explanatory message regarding the password.\n\t * }\n\t */\n\tfunction wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '', $language = '' ) {\n\t\tif ( ! empty( $deprecated ) ) {\n\t\t\t_deprecated_argument( __FUNCTION__, '2.6.0' );\n\t\t}\n\n\t\twp_check_mysql_version();\n\t\twp_cache_flush();\n\t\tmake_db_current_silent();\n\t\tpopulate_options();\n\t\tpopulate_roles();\n\n\t\tupdate_option( 'blogname', $blog_title );\n\t\tupdate_option( 'admin_email', $user_email );\n\t\tupdate_option( 'blog_public', $public );\n\n\t\t// Freshness of site - in the future, this could get more specific about actions taken, perhaps.\n\t\tupdate_option( 'fresh_site', 1 );\n\n\t\tif ( $language ) {\n\t\t\tupdate_option( 'WPLANG', $language );\n\t\t}\n\n\t\t$guessurl = wp_guess_url();\n\n\t\tupdate_option( 'siteurl', $guessurl );\n\n\t\t// If not a public site, don't ping.\n\t\tif ( ! $public ) {\n\t\t\tupdate_option( 'default_pingback_flag', 0 );\n\t\t}\n\n\t\t/*\n\t\t * Create default user. If the user already exists, the user tables are\n\t\t * being shared among sites. Just set the role in that case.\n\t\t */\n\t\t$user_id        = username_exists( $user_name );\n\t\t$user_password  = trim( $user_password );\n\t\t$email_password = false;\n\t\t$user_created   = false;\n\n\t\tif ( ! $user_id && empty( $user_password ) ) {\n\t\t\t$user_password = wp_generate_password( 12, false );\n\t\t\t$message       = __( '<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.' );\n\t\t\t$user_id       = wp_create_user( $user_name, $user_password, $user_email );\n\t\t\tupdate_user_option( $user_id, 'default_password_nag', true, true );\n\t\t\t$email_password = true;\n\t\t\t$user_created   = true;\n\t\t} elseif ( ! $user_id ) {\n\t\t\t// Password has been provided.\n\t\t\t$message      = '<em>' . __( 'Your chosen password.' ) . '</em>';\n\t\t\t$user_id      = wp_create_user( $user_name, $user_password, $user_email );\n\t\t\t$user_created = true;\n\t\t} else {\n\t\t\t$message = __( 'User already exists. Password inherited.' );\n\t\t}\n\n\t\t$user = new WP_User( $user_id );\n\t\t$user->set_role( 'administrator' );\n\n\t\tif ( $user_created ) {\n\t\t\t$user->user_url = $guessurl;\n\t\t\twp_update_user( $user );\n\t\t}\n\n\t\twp_install_defaults( $user_id );\n\n\t\twp_install_maybe_enable_pretty_permalinks();\n\n\t\tflush_rewrite_rules();\n\n\t\twp_new_blog_notification( $blog_title, $guessurl, $user_id, ( $email_password ? $user_password : __( 'The password you chose during installation.' ) ) );\n\n\t\twp_cache_flush();\n\n\t\t/**\n\t\t * Fires after a site is fully installed.\n\t\t *\n\t\t * @since 3.9.0\n\t\t *\n\t\t * @param WP_User $user The site owner.\n\t\t */\n\t\tdo_action( 'wp_install', $user );\n\n\t\treturn array(\n\t\t\t'url'              => $guessurl,\n\t\t\t'user_id'          => $user_id,\n\t\t\t'password'         => $user_password,\n\t\t\t'password_message' => $message,\n\t\t);\n\t}\nendif;\n\nif ( ! function_exists( 'wp_install_defaults' ) ) :\n\t/**\n\t * Creates the initial content for a newly-installed site.\n\t *\n\t * Adds the default \"Uncategorized\" category, the first post (with comment),\n\t * first page, and default widgets for default theme for the current version.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @global wpdb       $wpdb         WordPress database abstraction object.\n\t * @global WP_Rewrite $wp_rewrite   WordPress rewrite component.\n\t * @global string     $table_prefix\n\t *\n\t * @param int $user_id User ID.\n\t */\n\tfunction wp_install_defaults( $user_id ) {\n\t\tglobal $wpdb, $wp_rewrite, $table_prefix;\n\n\t\t// Default category.\n\t\t$cat_name = __( 'Uncategorized' );\n\t\t/* translators: Default category slug. */\n\t\t$cat_slug = sanitize_title( _x( 'Uncategorized', 'Default category slug' ) );\n\n\t\tif ( global_terms_enabled() ) {\n\t\t\t$cat_id = $wpdb->get_var( $wpdb->prepare( \"SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s\", $cat_slug ) );\n\t\t\tif ( null == $cat_id ) {\n\t\t\t\t$wpdb->insert(\n\t\t\t\t\t$wpdb->sitecategories,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'cat_ID'            => 0,\n\t\t\t\t\t\t'cat_name'          => $cat_name,\n\t\t\t\t\t\t'category_nicename' => $cat_slug,\n\t\t\t\t\t\t'last_updated'      => current_time( 'mysql', true ),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$cat_id = $wpdb->insert_id;\n\t\t\t}\n\t\t\tupdate_option( 'default_category', $cat_id );\n\t\t} else {\n\t\t\t$cat_id = 1;\n\t\t}\n\n\t\t$wpdb->insert(\n\t\t\t$wpdb->terms,\n\t\t\tarray(\n\t\t\t\t'term_id'    => $cat_id,\n\t\t\t\t'name'       => $cat_name,\n\t\t\t\t'slug'       => $cat_slug,\n\t\t\t\t'term_group' => 0,\n\t\t\t)\n\t\t);\n\t\t$wpdb->insert(\n\t\t\t$wpdb->term_taxonomy,\n\t\t\tarray(\n\t\t\t\t'term_id'     => $cat_id,\n\t\t\t\t'taxonomy'    => 'category',\n\t\t\t\t'description' => '',\n\t\t\t\t'parent'      => 0,\n\t\t\t\t'count'       => 1,\n\t\t\t)\n\t\t);\n\t\t$cat_tt_id = $wpdb->insert_id;\n\n\t\t// First post.\n\t\t$now             = current_time( 'mysql' );\n\t\t$now_gmt         = current_time( 'mysql', 1 );\n\t\t$first_post_guid = get_option( 'home' ) . '/?p=1';\n\n\t\tif ( is_multisite() ) {\n\t\t\t$first_post = get_site_option( 'first_post' );\n\n\t\t\tif ( ! $first_post ) {\n\t\t\t\t$first_post = \"<!-- wp:paragraph -->\\n<p>\" .\n\t\t\t\t/* translators: First post content. %s: Site link. */\n\t\t\t\t__( 'Welcome to %s. This is your first post. Edit or delete it, then start writing!' ) .\n\t\t\t\t\"</p>\\n<!-- /wp:paragraph -->\";\n\t\t\t}\n\n\t\t\t$first_post = sprintf(\n\t\t\t\t$first_post,\n\t\t\t\tsprintf( '<a href=\"%s\">%s</a>', esc_url( network_home_url() ), get_network()->site_name )\n\t\t\t);\n\n\t\t\t// Back-compat for pre-4.4.\n\t\t\t$first_post = str_replace( 'SITE_URL', esc_url( network_home_url() ), $first_post );\n\t\t\t$first_post = str_replace( 'SITE_NAME', get_network()->site_name, $first_post );\n\t\t} else {\n\t\t\t$first_post = \"<!-- wp:paragraph -->\\n<p>\" .\n\t\t\t/* translators: First post content. %s: Site link. */\n\t\t\t__( 'Welcome to WordPress. This is your first post. Edit or delete it, then start writing!' ) .\n\t\t\t\"</p>\\n<!-- /wp:paragraph -->\";\n\t\t}\n\n\t\t$wpdb->insert(\n\t\t\t$wpdb->posts,\n\t\t\tarray(\n\t\t\t\t'post_author'           => $user_id,\n\t\t\t\t'post_date'             => $now,\n\t\t\t\t'post_date_gmt'         => $now_gmt,\n\t\t\t\t'post_content'          => $first_post,\n\t\t\t\t'post_excerpt'          => '',\n\t\t\t\t'post_title'            => __( 'Hello world!' ),\n\t\t\t\t/* translators: Default post slug. */\n\t\t\t\t'post_name'             => sanitize_title( _x( 'hello-world', 'Default post slug' ) ),\n\t\t\t\t'post_modified'         => $now,\n\t\t\t\t'post_modified_gmt'     => $now_gmt,\n\t\t\t\t'guid'                  => $first_post_guid,\n\t\t\t\t'comment_count'         => 1,\n\t\t\t\t'to_ping'               => '',\n\t\t\t\t'pinged'                => '',\n\t\t\t\t'post_content_filtered' => '',\n\t\t\t)\n\t\t);\n\t\t$wpdb->insert(\n\t\t\t$wpdb->term_relationships,\n\t\t\tarray(\n\t\t\t\t'term_taxonomy_id' => $cat_tt_id,\n\t\t\t\t'object_id'        => 1,\n\t\t\t)\n\t\t);\n\n\t\t// Default comment.\n\t\tif ( is_multisite() ) {\n\t\t\t$first_comment_author = get_site_option( 'first_comment_author' );\n\t\t\t$first_comment_email  = get_site_option( 'first_comment_email' );\n\t\t\t$first_comment_url    = get_site_option( 'first_comment_url', network_home_url() );\n\t\t\t$first_comment        = get_site_option( 'first_comment' );\n\t\t}\n\n\t\t$first_comment_author = ! empty( $first_comment_author ) ? $first_comment_author : __( 'A WordPress Commenter' );\n\t\t$first_comment_email  = ! empty( $first_comment_email ) ? $first_comment_email : 'wapuu@wordpress.example';\n\t\t$first_comment_url    = ! empty( $first_comment_url ) ? $first_comment_url : 'https://wordpress.org/';\n\t\t$first_comment        = ! empty( $first_comment ) ? $first_comment : __(\n\t\t\t'Hi, this is a comment.\nTo get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.\nCommenter avatars come from <a href=\"https://gravatar.com\">Gravatar</a>.'\n\t\t);\n\t\t$wpdb->insert(\n\t\t\t$wpdb->comments,\n\t\t\tarray(\n\t\t\t\t'comment_post_ID'      => 1,\n\t\t\t\t'comment_author'       => $first_comment_author,\n\t\t\t\t'comment_author_email' => $first_comment_email,\n\t\t\t\t'comment_author_url'   => $first_comment_url,\n\t\t\t\t'comment_date'         => $now,\n\t\t\t\t'comment_date_gmt'     => $now_gmt,\n\t\t\t\t'comment_content'      => $first_comment,\n\t\t\t\t'comment_type'         => 'comment',\n\t\t\t)\n\t\t);\n\n\t\t// First page.\n\t\tif ( is_multisite() ) {\n\t\t\t$first_page = get_site_option( 'first_page' );\n\t\t}\n\n\t\tif ( empty( $first_page ) ) {\n\t\t\t$first_page = \"<!-- wp:paragraph -->\\n<p>\";\n\t\t\t/* translators: First page content. */\n\t\t\t$first_page .= __( \"This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:\" );\n\t\t\t$first_page .= \"</p>\\n<!-- /wp:paragraph -->\\n\\n\";\n\n\t\t\t$first_page .= \"<!-- wp:quote -->\\n<blockquote class=\\\"wp-block-quote\\\"><p>\";\n\t\t\t/* translators: First page content. */\n\t\t\t$first_page .= __( \"Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like pi&#241;a coladas. (And gettin' caught in the rain.)\" );\n\t\t\t$first_page .= \"</p></blockquote>\\n<!-- /wp:quote -->\\n\\n\";\n\n\t\t\t$first_page .= \"<!-- wp:paragraph -->\\n<p>\";\n\t\t\t/* translators: First page content. */\n\t\t\t$first_page .= __( '...or something like this:' );\n\t\t\t$first_page .= \"</p>\\n<!-- /wp:paragraph -->\\n\\n\";\n\n\t\t\t$first_page .= \"<!-- wp:quote -->\\n<blockquote class=\\\"wp-block-quote\\\"><p>\";\n\t\t\t/* translators: First page content. */\n\t\t\t$first_page .= __( 'The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.' );\n\t\t\t$first_page .= \"</p></blockquote>\\n<!-- /wp:quote -->\\n\\n\";\n\n\t\t\t$first_page .= \"<!-- wp:paragraph -->\\n<p>\";\n\t\t\t$first_page .= sprintf(\n\t\t\t\t/* translators: First page content. %s: Site admin URL. */\n\t\t\t\t__( 'As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to delete this page and create new pages for your content. Have fun!' ),\n\t\t\t\tadmin_url()\n\t\t\t);\n\t\t\t$first_page .= \"</p>\\n<!-- /wp:paragraph -->\";\n\t\t}\n\n\t\t$first_post_guid = get_option( 'home' ) . '/?page_id=2';\n\t\t$wpdb->insert(\n\t\t\t$wpdb->posts,\n\t\t\tarray(\n\t\t\t\t'post_author'           => $user_id,\n\t\t\t\t'post_date'             => $now,\n\t\t\t\t'post_date_gmt'         => $now_gmt,\n\t\t\t\t'post_content'          => $first_page,\n\t\t\t\t'post_excerpt'          => '',\n\t\t\t\t'comment_status'        => 'closed',\n\t\t\t\t'post_title'            => __( 'Sample Page' ),\n\t\t\t\t/* translators: Default page slug. */\n\t\t\t\t'post_name'             => __( 'sample-page' ),\n\t\t\t\t'post_modified'         => $now,\n\t\t\t\t'post_modified_gmt'     => $now_gmt,\n\t\t\t\t'guid'                  => $first_post_guid,\n\t\t\t\t'post_type'             => 'page',\n\t\t\t\t'to_ping'               => '',\n\t\t\t\t'pinged'                => '',\n\t\t\t\t'post_content_filtered' => '',\n\t\t\t)\n\t\t);\n\t\t$wpdb->insert(\n\t\t\t$wpdb->postmeta,\n\t\t\tarray(\n\t\t\t\t'post_id'    => 2,\n\t\t\t\t'meta_key'   => '_wp_page_template',\n\t\t\t\t'meta_value' => 'default',\n\t\t\t)\n\t\t);\n\n\t\t// Privacy Policy page.\n\t\tif ( is_multisite() ) {\n\t\t\t// Disable by default unless the suggested content is provided.\n\t\t\t$privacy_policy_content = get_site_option( 'default_privacy_policy_content' );\n\t\t} else {\n\t\t\tif ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {\n\t\t\t\tinclude_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php';\n\t\t\t}\n\n\t\t\t$privacy_policy_content = WP_Privacy_Policy_Content::get_default_content();\n\t\t}\n\n\t\tif ( ! empty( $privacy_policy_content ) ) {\n\t\t\t$privacy_policy_guid = get_option( 'home' ) . '/?page_id=3';\n\n\t\t\t$wpdb->insert(\n\t\t\t\t$wpdb->posts,\n\t\t\t\tarray(\n\t\t\t\t\t'post_author'           => $user_id,\n\t\t\t\t\t'post_date'             => $now,\n\t\t\t\t\t'post_date_gmt'         => $now_gmt,\n\t\t\t\t\t'post_content'          => $privacy_policy_content,\n\t\t\t\t\t'post_excerpt'          => '',\n\t\t\t\t\t'comment_status'        => 'closed',\n\t\t\t\t\t'post_title'            => __( 'Privacy Policy' ),\n\t\t\t\t\t/* translators: Privacy Policy page slug. */\n\t\t\t\t\t'post_name'             => __( 'privacy-policy' ),\n\t\t\t\t\t'post_modified'         => $now,\n\t\t\t\t\t'post_modified_gmt'     => $now_gmt,\n\t\t\t\t\t'guid'                  => $privacy_policy_guid,\n\t\t\t\t\t'post_type'             => 'page',\n\t\t\t\t\t'post_status'           => 'draft',\n\t\t\t\t\t'to_ping'               => '',\n\t\t\t\t\t'pinged'                => '',\n\t\t\t\t\t'post_content_filtered' => '',\n\t\t\t\t)\n\t\t\t);\n\t\t\t$wpdb->insert(\n\t\t\t\t$wpdb->postmeta,\n\t\t\t\tarray(\n\t\t\t\t\t'post_id'    => 3,\n\t\t\t\t\t'meta_key'   => '_wp_page_template',\n\t\t\t\t\t'meta_value' => 'default',\n\t\t\t\t)\n\t\t\t);\n\t\t\tupdate_option( 'wp_page_for_privacy_policy', 3 );\n\t\t}\n\n\t\t// Set up default widgets for default theme.\n\t\tupdate_option(\n\t\t\t'widget_search',\n\t\t\tarray(\n\t\t\t\t2              => array( 'title' => '' ),\n\t\t\t\t'_multiwidget' => 1,\n\t\t\t)\n\t\t);\n\t\tupdate_option(\n\t\t\t'widget_recent-posts',\n\t\t\tarray(\n\t\t\t\t2              => array(\n\t\t\t\t\t'title'  => '',\n\t\t\t\t\t'number' => 5,\n\t\t\t\t),\n\t\t\t\t'_multiwidget' => 1,\n\t\t\t)\n\t\t);\n\t\tupdate_option(\n\t\t\t'widget_recent-comments',\n\t\t\tarray(\n\t\t\t\t2              => array(\n\t\t\t\t\t'title'  => '',\n\t\t\t\t\t'number' => 5,\n\t\t\t\t),\n\t\t\t\t'_multiwidget' => 1,\n\t\t\t)\n\t\t);\n\t\tupdate_option(\n\t\t\t'widget_archives',\n\t\t\tarray(\n\t\t\t\t2              => array(\n\t\t\t\t\t'title'    => '',\n\t\t\t\t\t'count'    => 0,\n\t\t\t\t\t'dropdown' => 0,\n\t\t\t\t),\n\t\t\t\t'_multiwidget' => 1,\n\t\t\t)\n\t\t);\n\t\tupdate_option(\n\t\t\t'widget_categories',\n\t\t\tarray(\n\t\t\t\t2              => array(\n\t\t\t\t\t'title'        => '',\n\t\t\t\t\t'count'        => 0,\n\t\t\t\t\t'hierarchical' => 0,\n\t\t\t\t\t'dropdown'     => 0,\n\t\t\t\t),\n\t\t\t\t'_multiwidget' => 1,\n\t\t\t)\n\t\t);\n\t\tupdate_option(\n\t\t\t'widget_meta',\n\t\t\tarray(\n\t\t\t\t2              => array( 'title' => '' ),\n\t\t\t\t'_multiwidget' => 1,\n\t\t\t)\n\t\t);\n\t\tupdate_option(\n\t\t\t'sidebars_widgets',\n\t\t\tarray(\n\t\t\t\t'wp_inactive_widgets' => array(),\n\t\t\t\t'sidebar-1'           => array(\n\t\t\t\t\t0 => 'search-2',\n\t\t\t\t\t1 => 'recent-posts-2',\n\t\t\t\t\t2 => 'recent-comments-2',\n\t\t\t\t),\n\t\t\t\t'sidebar-2'           => array(\n\t\t\t\t\t0 => 'archives-2',\n\t\t\t\t\t1 => 'categories-2',\n\t\t\t\t\t2 => 'meta-2',\n\t\t\t\t),\n\t\t\t\t'array_version'       => 3,\n\t\t\t)\n\t\t);\n\t\tif ( ! is_multisite() ) {\n\t\t\tupdate_user_meta( $user_id, 'show_welcome_panel', 1 );\n\t\t} elseif ( ! is_super_admin( $user_id ) && ! metadata_exists( 'user', $user_id, 'show_welcome_panel' ) ) {\n\t\t\tupdate_user_meta( $user_id, 'show_welcome_panel', 2 );\n\t\t}\n\n\t\tif ( is_multisite() ) {\n\t\t\t// Flush rules to pick up the new page.\n\t\t\t$wp_rewrite->init();\n\t\t\t$wp_rewrite->flush_rules();\n\n\t\t\t$user = new WP_User( $user_id );\n\t\t\t$wpdb->update( $wpdb->options, array( 'option_value' => $user->user_email ), array( 'option_name' => 'admin_email' ) );\n\n\t\t\t// Remove all perms except for the login user.\n\t\t\t$wpdb->query( $wpdb->prepare( \"DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s\", $user_id, $table_prefix . 'user_level' ) );\n\t\t\t$wpdb->query( $wpdb->prepare( \"DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s\", $user_id, $table_prefix . 'capabilities' ) );\n\n\t\t\t// Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.)\n\t\t\t// TODO: Get previous_blog_id.\n\t\t\tif ( ! is_super_admin( $user_id ) && 1 != $user_id ) {\n\t\t\t\t$wpdb->delete(\n\t\t\t\t\t$wpdb->usermeta,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'user_id'  => $user_id,\n\t\t\t\t\t\t'meta_key' => $wpdb->base_prefix . '1_capabilities',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\nendif;\n\n/**\n * Maybe enable pretty permalinks on installation.\n *\n * If after enabling pretty permalinks don't work, fallback to query-string permalinks.\n *\n * @since 4.2.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @return bool Whether pretty permalinks are enabled. False otherwise.\n */\nfunction wp_install_maybe_enable_pretty_permalinks() {\n\tglobal $wp_rewrite;\n\n\t// Bail if a permalink structure is already enabled.\n\tif ( get_option( 'permalink_structure' ) ) {\n\t\treturn true;\n\t}\n\n\t/*\n\t * The Permalink structures to attempt.\n\t *\n\t * The first is designed for mod_rewrite or nginx rewriting.\n\t *\n\t * The second is PATHINFO-based permalinks for web server configurations\n\t * without a true rewrite module enabled.\n\t */\n\t$permalink_structures = array(\n\t\t'/%year%/%monthnum%/%day%/%postname%/',\n\t\t'/index.php/%year%/%monthnum%/%day%/%postname%/',\n\t);\n\n\tforeach ( (array) $permalink_structures as $permalink_structure ) {\n\t\t$wp_rewrite->set_permalink_structure( $permalink_structure );\n\n\t\t/*\n\t\t * Flush rules with the hard option to force refresh of the web-server's\n\t\t * rewrite config file (e.g. .htaccess or web.config).\n\t\t */\n\t\t$wp_rewrite->flush_rules( true );\n\n\t\t$test_url = '';\n\n\t\t// Test against a real WordPress post.\n\t\t$first_post = get_page_by_path( sanitize_title( _x( 'hello-world', 'Default post slug' ) ), OBJECT, 'post' );\n\t\tif ( $first_post ) {\n\t\t\t$test_url = get_permalink( $first_post->ID );\n\t\t}\n\n\t\t/*\n\t\t * Send a request to the site, and check whether\n\t\t * the 'x-pingback' header is returned as expected.\n\t\t *\n\t\t * Uses wp_remote_get() instead of wp_remote_head() because web servers\n\t\t * can block head requests.\n\t\t */\n\t\t$response          = wp_remote_get( $test_url, array( 'timeout' => 5 ) );\n\t\t$x_pingback_header = wp_remote_retrieve_header( $response, 'x-pingback' );\n\t\t$pretty_permalinks = $x_pingback_header && get_bloginfo( 'pingback_url' ) === $x_pingback_header;\n\n\t\tif ( $pretty_permalinks ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t/*\n\t * If it makes it this far, pretty permalinks failed.\n\t * Fallback to query-string permalinks.\n\t */\n\t$wp_rewrite->set_permalink_structure( '' );\n\t$wp_rewrite->flush_rules( true );\n\n\treturn false;\n}\n\nif ( ! function_exists( 'wp_new_blog_notification' ) ) :\n\t/**\n\t * Notifies the site admin that the setup is complete.\n\t *\n\t * Sends an email with wp_mail to the new administrator that the site setup is complete,\n\t * and provides them with a record of their login credentials.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $blog_title Site title.\n\t * @param string $blog_url   Site url.\n\t * @param int    $user_id    User ID.\n\t * @param string $password   User's Password.\n\t */\n\tfunction wp_new_blog_notification( $blog_title, $blog_url, $user_id, $password ) {\n\t\t$user      = new WP_User( $user_id );\n\t\t$email     = $user->user_email;\n\t\t$name      = $user->user_login;\n\t\t$login_url = wp_login_url();\n\n\t\t$message = sprintf(\n\t\t\t/* translators: New site notification email. 1: New site URL, 2: User login, 3: User password or password reset link, 4: Login URL. */\n\t\t\t__(\n\t\t\t\t'Your new WordPress site has been successfully set up at:\n\n%1$s\n\nYou can log in to the administrator account with the following information:\n\nUsername: %2$s\nPassword: %3$s\nLog in here: %4$s\n\nWe hope you enjoy your new site. Thanks!\n\n--The WordPress Team\nhttps://wordpress.org/\n'\n\t\t\t),\n\t\t\t$blog_url,\n\t\t\t$name,\n\t\t\t$password,\n\t\t\t$login_url\n\t\t);\n\n\t\twp_mail( $email, __( 'New WordPress Site' ), $message );\n\t}\nendif;\n\nif ( ! function_exists( 'wp_upgrade' ) ) :\n\t/**\n\t * Runs WordPress Upgrade functions.\n\t *\n\t * Upgrades the database if needed during a site update.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @global int  $wp_current_db_version The old (current) database version.\n\t * @global int  $wp_db_version         The new database version.\n\t * @global wpdb $wpdb                  WordPress database abstraction object.\n\t */\n\tfunction wp_upgrade() {\n\t\tglobal $wp_current_db_version, $wp_db_version, $wpdb;\n\n\t\t$wp_current_db_version = __get_option( 'db_version' );\n\n\t\t// We are up to date. Nothing to do.\n\t\tif ( $wp_db_version == $wp_current_db_version ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! is_blog_installed() ) {\n\t\t\treturn;\n\t\t}\n\n\t\twp_check_mysql_version();\n\t\twp_cache_flush();\n\t\tpre_schema_upgrade();\n\t\tmake_db_current_silent();\n\t\tupgrade_all();\n\t\tif ( is_multisite() && is_main_site() ) {\n\t\t\tupgrade_network();\n\t\t}\n\t\twp_cache_flush();\n\n\t\tif ( is_multisite() ) {\n\t\t\tupdate_site_meta( get_current_blog_id(), 'db_version', $wp_db_version );\n\t\t\tupdate_site_meta( get_current_blog_id(), 'db_last_updated', microtime() );\n\t\t}\n\n\t\t/**\n\t\t * Fires after a site is fully upgraded.\n\t\t *\n\t\t * @since 3.9.0\n\t\t *\n\t\t * @param int $wp_db_version         The new $wp_db_version.\n\t\t * @param int $wp_current_db_version The old (current) $wp_db_version.\n\t\t */\n\t\tdo_action( 'wp_upgrade', $wp_db_version, $wp_current_db_version );\n\t}\nendif;\n\n/**\n * Functions to be called in installation and upgrade scripts.\n *\n * Contains conditional checks to determine which upgrade scripts to run,\n * based on database version and WP version being updated-to.\n *\n * @ignore\n * @since 1.0.1\n *\n * @global int $wp_current_db_version The old (current) database version.\n * @global int $wp_db_version         The new database version.\n */\nfunction upgrade_all() {\n\tglobal $wp_current_db_version, $wp_db_version;\n\n\t$wp_current_db_version = __get_option( 'db_version' );\n\n\t// We are up to date. Nothing to do.\n\tif ( $wp_db_version == $wp_current_db_version ) {\n\t\treturn;\n\t}\n\n\t// If the version is not set in the DB, try to guess the version.\n\tif ( empty( $wp_current_db_version ) ) {\n\t\t$wp_current_db_version = 0;\n\n\t\t// If the template option exists, we have 1.5.\n\t\t$template = __get_option( 'template' );\n\t\tif ( ! empty( $template ) ) {\n\t\t\t$wp_current_db_version = 2541;\n\t\t}\n\t}\n\n\tif ( $wp_current_db_version < 6039 ) {\n\t\tupgrade_230_options_table();\n\t}\n\n\tpopulate_options();\n\n\tif ( $wp_current_db_version < 2541 ) {\n\t\tupgrade_100();\n\t\tupgrade_101();\n\t\tupgrade_110();\n\t\tupgrade_130();\n\t}\n\n\tif ( $wp_current_db_version < 3308 ) {\n\t\tupgrade_160();\n\t}\n\n\tif ( $wp_current_db_version < 4772 ) {\n\t\tupgrade_210();\n\t}\n\n\tif ( $wp_current_db_version < 4351 ) {\n\t\tupgrade_old_slugs();\n\t}\n\n\tif ( $wp_current_db_version < 5539 ) {\n\t\tupgrade_230();\n\t}\n\n\tif ( $wp_current_db_version < 6124 ) {\n\t\tupgrade_230_old_tables();\n\t}\n\n\tif ( $wp_current_db_version < 7499 ) {\n\t\tupgrade_250();\n\t}\n\n\tif ( $wp_current_db_version < 7935 ) {\n\t\tupgrade_252();\n\t}\n\n\tif ( $wp_current_db_version < 8201 ) {\n\t\tupgrade_260();\n\t}\n\n\tif ( $wp_current_db_version < 8989 ) {\n\t\tupgrade_270();\n\t}\n\n\tif ( $wp_current_db_version < 10360 ) {\n\t\tupgrade_280();\n\t}\n\n\tif ( $wp_current_db_version < 11958 ) {\n\t\tupgrade_290();\n\t}\n\n\tif ( $wp_current_db_version < 15260 ) {\n\t\tupgrade_300();\n\t}\n\n\tif ( $wp_current_db_version < 19389 ) {\n\t\tupgrade_330();\n\t}\n\n\tif ( $wp_current_db_version < 20080 ) {\n\t\tupgrade_340();\n\t}\n\n\tif ( $wp_current_db_version < 22422 ) {\n\t\tupgrade_350();\n\t}\n\n\tif ( $wp_current_db_version < 25824 ) {\n\t\tupgrade_370();\n\t}\n\n\tif ( $wp_current_db_version < 26148 ) {\n\t\tupgrade_372();\n\t}\n\n\tif ( $wp_current_db_version < 26691 ) {\n\t\tupgrade_380();\n\t}\n\n\tif ( $wp_current_db_version < 29630 ) {\n\t\tupgrade_400();\n\t}\n\n\tif ( $wp_current_db_version < 33055 ) {\n\t\tupgrade_430();\n\t}\n\n\tif ( $wp_current_db_version < 33056 ) {\n\t\tupgrade_431();\n\t}\n\n\tif ( $wp_current_db_version < 35700 ) {\n\t\tupgrade_440();\n\t}\n\n\tif ( $wp_current_db_version < 36686 ) {\n\t\tupgrade_450();\n\t}\n\n\tif ( $wp_current_db_version < 37965 ) {\n\t\tupgrade_460();\n\t}\n\n\tif ( $wp_current_db_version < 44719 ) {\n\t\tupgrade_510();\n\t}\n\n\tif ( $wp_current_db_version < 45744 ) {\n\t\tupgrade_530();\n\t}\n\n\tif ( $wp_current_db_version < 48575 ) {\n\t\tupgrade_550();\n\t}\n\n\tmaybe_disable_link_manager();\n\n\tmaybe_disable_automattic_widgets();\n\n\tupdate_option( 'db_version', $wp_db_version );\n\tupdate_option( 'db_upgraded', true );\n}\n\n/**\n * Execute changes made in WordPress 1.0.\n *\n * @ignore\n * @since 1.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction upgrade_100() {\n\tglobal $wpdb;\n\n\t// Get the title and ID of every post, post_name to check if it already has a value.\n\t$posts = $wpdb->get_results( \"SELECT ID, post_title, post_name FROM $wpdb->posts WHERE post_name = ''\" );\n\tif ( $posts ) {\n\t\tforeach ( $posts as $post ) {\n\t\t\tif ( '' === $post->post_name ) {\n\t\t\t\t$newtitle = sanitize_title( $post->post_title );\n\t\t\t\t$wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET post_name = %s WHERE ID = %d\", $newtitle, $post->ID ) );\n\t\t\t}\n\t\t}\n\t}\n\n\t$categories = $wpdb->get_results( \"SELECT cat_ID, cat_name, category_nicename FROM $wpdb->categories\" );\n\tforeach ( $categories as $category ) {\n\t\tif ( '' === $category->category_nicename ) {\n\t\t\t$newtitle = sanitize_title( $category->cat_name );\n\t\t\t$wpdb->update( $wpdb->categories, array( 'category_nicename' => $newtitle ), array( 'cat_ID' => $category->cat_ID ) );\n\t\t}\n\t}\n\n\t$sql = \"UPDATE $wpdb->options\n\t\tSET option_value = REPLACE(option_value, 'wp-links/links-images/', 'wp-images/links/')\n\t\tWHERE option_name LIKE %s\n\t\tAND option_value LIKE %s\";\n\t$wpdb->query( $wpdb->prepare( $sql, $wpdb->esc_like( 'links_rating_image' ) . '%', $wpdb->esc_like( 'wp-links/links-images/' ) . '%' ) );\n\n\t$done_ids = $wpdb->get_results( \"SELECT DISTINCT post_id FROM $wpdb->post2cat\" );\n\tif ( $done_ids ) :\n\t\t$done_posts = array();\n\t\tforeach ( $done_ids as $done_id ) :\n\t\t\t$done_posts[] = $done_id->post_id;\n\t\tendforeach;\n\t\t$catwhere = ' AND ID NOT IN (' . implode( ',', $done_posts ) . ')';\n\telse :\n\t\t$catwhere = '';\n\tendif;\n\n\t$allposts = $wpdb->get_results( \"SELECT ID, post_category FROM $wpdb->posts WHERE post_category != '0' $catwhere\" );\n\tif ( $allposts ) :\n\t\tforeach ( $allposts as $post ) {\n\t\t\t// Check to see if it's already been imported.\n\t\t\t$cat = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $wpdb->post2cat WHERE post_id = %d AND category_id = %d\", $post->ID, $post->post_category ) );\n\t\t\tif ( ! $cat && 0 != $post->post_category ) { // If there's no result.\n\t\t\t\t$wpdb->insert(\n\t\t\t\t\t$wpdb->post2cat,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_id'     => $post->ID,\n\t\t\t\t\t\t'category_id' => $post->post_category,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\tendif;\n}\n\n/**\n * Execute changes made in WordPress 1.0.1.\n *\n * @ignore\n * @since 1.0.1\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction upgrade_101() {\n\tglobal $wpdb;\n\n\t// Clean up indices, add a few.\n\tadd_clean_index( $wpdb->posts, 'post_name' );\n\tadd_clean_index( $wpdb->posts, 'post_status' );\n\tadd_clean_index( $wpdb->categories, 'category_nicename' );\n\tadd_clean_index( $wpdb->comments, 'comment_approved' );\n\tadd_clean_index( $wpdb->comments, 'comment_post_ID' );\n\tadd_clean_index( $wpdb->links, 'link_category' );\n\tadd_clean_index( $wpdb->links, 'link_visible' );\n}\n\n/**\n * Execute changes made in WordPress 1.2.\n *\n * @ignore\n * @since 1.2.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction upgrade_110() {\n\tglobal $wpdb;\n\n\t// Set user_nicename.\n\t$users = $wpdb->get_results( \"SELECT ID, user_nickname, user_nicename FROM $wpdb->users\" );\n\tforeach ( $users as $user ) {\n\t\tif ( '' === $user->user_nicename ) {\n\t\t\t$newname = sanitize_title( $user->user_nickname );\n\t\t\t$wpdb->update( $wpdb->users, array( 'user_nicename' => $newname ), array( 'ID' => $user->ID ) );\n\t\t}\n\t}\n\n\t$users = $wpdb->get_results( \"SELECT ID, user_pass from $wpdb->users\" );\n\tforeach ( $users as $row ) {\n\t\tif ( ! preg_match( '/^[A-Fa-f0-9]{32}$/', $row->user_pass ) ) {\n\t\t\t$wpdb->update( $wpdb->users, array( 'user_pass' => md5( $row->user_pass ) ), array( 'ID' => $row->ID ) );\n\t\t}\n\t}\n\n\t// Get the GMT offset, we'll use that later on.\n\t$all_options = get_alloptions_110();\n\n\t$time_difference = $all_options->time_difference;\n\n\t\t$server_time = time() + gmdate( 'Z' );\n\t$weblogger_time  = $server_time + $time_difference * HOUR_IN_SECONDS;\n\t$gmt_time        = time();\n\n\t$diff_gmt_server       = ( $gmt_time - $server_time ) / HOUR_IN_SECONDS;\n\t$diff_weblogger_server = ( $weblogger_time - $server_time ) / HOUR_IN_SECONDS;\n\t$diff_gmt_weblogger    = $diff_gmt_server - $diff_weblogger_server;\n\t$gmt_offset            = -$diff_gmt_weblogger;\n\n\t// Add a gmt_offset option, with value $gmt_offset.\n\tadd_option( 'gmt_offset', $gmt_offset );\n\n\t/*\n\t * Check if we already set the GMT fields. If we did, then\n\t * MAX(post_date_gmt) can't be '0000-00-00 00:00:00'.\n\t * <michel_v> I just slapped myself silly for not thinking about it earlier.\n\t */\n\t$got_gmt_fields = ( '0000-00-00 00:00:00' !== $wpdb->get_var( \"SELECT MAX(post_date_gmt) FROM $wpdb->posts\" ) );\n\n\tif ( ! $got_gmt_fields ) {\n\n\t\t// Add or subtract time to all dates, to get GMT dates.\n\t\t$add_hours   = intval( $diff_gmt_weblogger );\n\t\t$add_minutes = intval( 60 * ( $diff_gmt_weblogger - $add_hours ) );\n\t\t$wpdb->query( \"UPDATE $wpdb->posts SET post_date_gmt = DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)\" );\n\t\t$wpdb->query( \"UPDATE $wpdb->posts SET post_modified = post_date\" );\n\t\t$wpdb->query( \"UPDATE $wpdb->posts SET post_modified_gmt = DATE_ADD(post_modified, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE) WHERE post_modified != '0000-00-00 00:00:00'\" );\n\t\t$wpdb->query( \"UPDATE $wpdb->comments SET comment_date_gmt = DATE_ADD(comment_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)\" );\n\t\t$wpdb->query( \"UPDATE $wpdb->users SET user_registered = DATE_ADD(user_registered, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)\" );\n\t}\n\n}\n\n/**\n * Execute changes made in WordPress 1.5.\n *\n * @ignore\n * @since 1.5.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction upgrade_130() {\n\tglobal $wpdb;\n\n\t// Remove extraneous backslashes.\n\t$posts = $wpdb->get_results( \"SELECT ID, post_title, post_content, post_excerpt, guid, post_date, post_name, post_status, post_author FROM $wpdb->posts\" );\n\tif ( $posts ) {\n\t\tforeach ( $posts as $post ) {\n\t\t\t$post_content = addslashes( deslash( $post->post_content ) );\n\t\t\t$post_title   = addslashes( deslash( $post->post_title ) );\n\t\t\t$post_excerpt = addslashes( deslash( $post->post_excerpt ) );\n\t\t\tif ( empty( $post->guid ) ) {\n\t\t\t\t$guid = get_permalink( $post->ID );\n\t\t\t} else {\n\t\t\t\t$guid = $post->guid;\n\t\t\t}\n\n\t\t\t$wpdb->update( $wpdb->posts, compact( 'post_title', 'post_content', 'post_excerpt', 'guid' ), array( 'ID' => $post->ID ) );\n\n\t\t}\n\t}\n\n\t// Remove extraneous backslashes.\n\t$comments = $wpdb->get_results( \"SELECT comment_ID, comment_author, comment_content FROM $wpdb->comments\" );\n\tif ( $comments ) {\n\t\tforeach ( $comments as $comment ) {\n\t\t\t$comment_content = deslash( $comment->comment_content );\n\t\t\t$comment_author  = deslash( $comment->comment_author );\n\n\t\t\t$wpdb->update( $wpdb->comments, compact( 'comment_content', 'comment_author' ), array( 'comment_ID' => $comment->comment_ID ) );\n\t\t}\n\t}\n\n\t// Remove extraneous backslashes.\n\t$links = $wpdb->get_results( \"SELECT link_id, link_name, link_description FROM $wpdb->links\" );\n\tif ( $links ) {\n\t\tforeach ( $links as $link ) {\n\t\t\t$link_name        = deslash( $link->link_name );\n\t\t\t$link_description = deslash( $link->link_description );\n\n\t\t\t$wpdb->update( $wpdb->links, compact( 'link_name', 'link_description' ), array( 'link_id' => $link->link_id ) );\n\t\t}\n\t}\n\n\t$active_plugins = __get_option( 'active_plugins' );\n\n\t/*\n\t * If plugins are not stored in an array, they're stored in the old\n\t * newline separated format. Convert to new format.\n\t */\n\tif ( ! is_array( $active_plugins ) ) {\n\t\t$active_plugins = explode( \"\\n\", trim( $active_plugins ) );\n\t\tupdate_option( 'active_plugins', $active_plugins );\n\t}\n\n\t// Obsolete tables.\n\t$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optionvalues' );\n\t$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optiontypes' );\n\t$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optiongroups' );\n\t$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optiongroup_options' );\n\n\t// Update comments table to use comment_type.\n\t$wpdb->query( \"UPDATE $wpdb->comments SET comment_type='trackback', comment_content = REPLACE(comment_content, '<trackback />', '') WHERE comment_content LIKE '<trackback />%'\" );\n\t$wpdb->query( \"UPDATE $wpdb->comments SET comment_type='pingback', comment_content = REPLACE(comment_content, '<pingback />', '') WHERE comment_content LIKE '<pingback />%'\" );\n\n\t// Some versions have multiple duplicate option_name rows with the same values.\n\t$options = $wpdb->get_results( \"SELECT option_name, COUNT(option_name) AS dupes FROM `$wpdb->options` GROUP BY option_name\" );\n\tforeach ( $options as $option ) {\n\t\tif ( 1 != $option->dupes ) { // Could this be done in the query?\n\t\t\t$limit    = $option->dupes - 1;\n\t\t\t$dupe_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT option_id FROM $wpdb->options WHERE option_name = %s LIMIT %d\", $option->option_name, $limit ) );\n\t\t\tif ( $dupe_ids ) {\n\t\t\t\t$dupe_ids = join( ',', $dupe_ids );\n\t\t\t\t$wpdb->query( \"DELETE FROM $wpdb->options WHERE option_id IN ($dupe_ids)\" );\n\t\t\t}\n\t\t}\n\t}\n\n\tmake_site_theme();\n}\n\n/**\n * Execute changes made in WordPress 2.0.\n *\n * @ignore\n * @since 2.0.0\n *\n * @global wpdb $wpdb                  WordPress database abstraction object.\n * @global int  $wp_current_db_version The old (current) database version.\n */\nfunction upgrade_160() {\n\tglobal $wpdb, $wp_current_db_version;\n\n\tpopulate_roles_160();\n\n\t$users = $wpdb->get_results( \"SELECT * FROM $wpdb->users\" );\n\tforeach ( $users as $user ) :\n\t\tif ( ! empty( $user->user_firstname ) ) {\n\t\t\tupdate_user_meta( $user->ID, 'first_name', wp_slash( $user->user_firstname ) );\n\t\t}\n\t\tif ( ! empty( $user->user_lastname ) ) {\n\t\t\tupdate_user_meta( $user->ID, 'last_name', wp_slash( $user->user_lastname ) );\n\t\t}\n\t\tif ( ! empty( $user->user_nickname ) ) {\n\t\t\tupdate_user_meta( $user->ID, 'nickname', wp_slash( $user->user_nickname ) );\n\t\t}\n\t\tif ( ! empty( $user->user_level ) ) {\n\t\t\tupdate_user_meta( $user->ID, $wpdb->prefix . 'user_level', $user->user_level );\n\t\t}\n\t\tif ( ! empty( $user->user_icq ) ) {\n\t\t\tupdate_user_meta( $user->ID, 'icq', wp_slash( $user->user_icq ) );\n\t\t}\n\t\tif ( ! empty( $user->user_aim ) ) {\n\t\t\tupdate_user_meta( $user->ID, 'aim', wp_slash( $user->user_aim ) );\n\t\t}\n\t\tif ( ! empty( $user->user_msn ) ) {\n\t\t\tupdate_user_meta( $user->ID, 'msn', wp_slash( $user->user_msn ) );\n\t\t}\n\t\tif ( ! empty( $user->user_yim ) ) {\n\t\t\tupdate_user_meta( $user->ID, 'yim', wp_slash( $user->user_icq ) );\n\t\t}\n\t\tif ( ! empty( $user->user_description ) ) {\n\t\t\tupdate_user_meta( $user->ID, 'description', wp_slash( $user->user_description ) );\n\t\t}\n\n\t\tif ( isset( $user->user_idmode ) ) :\n\t\t\t$idmode = $user->user_idmode;\n\t\t\tif ( 'nickname' === $idmode ) {\n\t\t\t\t$id = $user->user_nickname;\n\t\t\t}\n\t\t\tif ( 'login' === $idmode ) {\n\t\t\t\t$id = $user->user_login;\n\t\t\t}\n\t\t\tif ( 'firstname' === $idmode ) {\n\t\t\t\t$id = $user->user_firstname;\n\t\t\t}\n\t\t\tif ( 'lastname' === $idmode ) {\n\t\t\t\t$id = $user->user_lastname;\n\t\t\t}\n\t\t\tif ( 'namefl' === $idmode ) {\n\t\t\t\t$id = $user->user_firstname . ' ' . $user->user_lastname;\n\t\t\t}\n\t\t\tif ( 'namelf' === $idmode ) {\n\t\t\t\t$id = $user->user_lastname . ' ' . $user->user_firstname;\n\t\t\t}\n\t\t\tif ( ! $idmode ) {\n\t\t\t\t$id = $user->user_nickname;\n\t\t\t}\n\t\t\t$wpdb->update( $wpdb->users, array( 'display_name' => $id ), array( 'ID' => $user->ID ) );\n\t\tendif;\n\n\t\t// FIXME: RESET_CAPS is temporary code to reset roles and caps if flag is set.\n\t\t$caps = get_user_meta( $user->ID, $wpdb->prefix . 'capabilities' );\n\t\tif ( empty( $caps ) || defined( 'RESET_CAPS' ) ) {\n\t\t\t$level = get_user_meta( $user->ID, $wpdb->prefix . 'user_level', true );\n\t\t\t$role  = translate_level_to_role( $level );\n\t\t\tupdate_user_meta( $user->ID, $wpdb->prefix . 'capabilities', array( $role => true ) );\n\t\t}\n\n\tendforeach;\n\t$old_user_fields = array( 'user_firstname', 'user_lastname', 'user_icq', 'user_aim', 'user_msn', 'user_yim', 'user_idmode', 'user_ip', 'user_domain', 'user_browser', 'user_description', 'user_nickname', 'user_level' );\n\t$wpdb->hide_errors();\n\tforeach ( $old_user_fields as $old ) {\n\t\t$wpdb->query( \"ALTER TABLE $wpdb->users DROP $old\" );\n\t}\n\t$wpdb->show_errors();\n\n\t// Populate comment_count field of posts table.\n\t$comments = $wpdb->get_results( \"SELECT comment_post_ID, COUNT(*) as c FROM $wpdb->comments WHERE comment_approved = '1' GROUP BY comment_post_ID\" );\n\tif ( is_array( $comments ) ) {\n\t\tforeach ( $comments as $comment ) {\n\t\t\t$wpdb->update( $wpdb->posts, array( 'comment_count' => $comment->c ), array( 'ID' => $comment->comment_post_ID ) );\n\t\t}\n\t}\n\n\t/*\n\t * Some alpha versions used a post status of object instead of attachment\n\t * and put the mime type in post_type instead of post_mime_type.\n\t */\n\tif ( $wp_current_db_version > 2541 && $wp_current_db_version <= 3091 ) {\n\t\t$objects = $wpdb->get_results( \"SELECT ID, post_type FROM $wpdb->posts WHERE post_status = 'object'\" );\n\t\tforeach ( $objects as $object ) {\n\t\t\t$wpdb->update(\n\t\t\t\t$wpdb->posts,\n\t\t\t\tarray(\n\t\t\t\t\t'post_status'    => 'attachment',\n\t\t\t\t\t'post_mime_type' => $object->post_type,\n\t\t\t\t\t'post_type'      => '',\n\t\t\t\t),\n\t\t\t\tarray( 'ID' => $object->ID )\n\t\t\t);\n\n\t\t\t$meta = get_post_meta( $object->ID, 'imagedata', true );\n\t\t\tif ( ! empty( $meta['file'] ) ) {\n\t\t\t\tupdate_attached_file( $object->ID, $meta['file'] );\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Execute changes made in WordPress 2.1.\n *\n * @ignore\n * @since 2.1.0\n *\n * @global int  $wp_current_db_version The old (current) database version.\n * @global wpdb $wpdb                  WordPress database abstraction object.\n */\nfunction upgrade_210() {\n\tglobal $wp_current_db_version, $wpdb;\n\n\tif ( $wp_current_db_version < 3506 ) {\n\t\t// Update status and type.\n\t\t$posts = $wpdb->get_results( \"SELECT ID, post_status FROM $wpdb->posts\" );\n\n\t\tif ( ! empty( $posts ) ) {\n\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t$status = $post->post_status;\n\t\t\t\t$type   = 'post';\n\n\t\t\t\tif ( 'static' === $status ) {\n\t\t\t\t\t$status = 'publish';\n\t\t\t\t\t$type   = 'page';\n\t\t\t\t} elseif ( 'attachment' === $status ) {\n\t\t\t\t\t$status = 'inherit';\n\t\t\t\t\t$type   = 'attachment';\n\t\t\t\t}\n\n\t\t\t\t$wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET post_status = %s, post_type = %s WHERE ID = %d\", $status, $type, $post->ID ) );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( $wp_current_db_version < 3845 ) {\n\t\tpopulate_roles_210();\n\t}\n\n\tif ( $wp_current_db_version < 3531 ) {\n\t\t// Give future posts a post_status of future.\n\t\t$now = gmdate( 'Y-m-d H:i:59' );\n\t\t$wpdb->query( \"UPDATE $wpdb->posts SET post_status = 'future' WHERE post_status = 'publish' AND post_date_gmt > '$now'\" );\n\n\t\t$posts = $wpdb->get_results( \"SELECT ID, post_date FROM $wpdb->posts WHERE post_status ='future'\" );\n\t\tif ( ! empty( $posts ) ) {\n\t\t\tforeach ( $posts as $post ) {\n\t\t\t\twp_schedule_single_event( mysql2date( 'U', $post->post_date, false ), 'publish_future_post', array( $post->ID ) );\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Execute changes made in WordPress 2.3.\n *\n * @ignore\n * @since 2.3.0\n *\n * @global int  $wp_current_db_version The old (current) database version.\n * @global wpdb $wpdb                  WordPress database abstraction object.\n */\nfunction upgrade_230() {\n\tglobal $wp_current_db_version, $wpdb;\n\n\tif ( $wp_current_db_version < 5200 ) {\n\t\tpopulate_roles_230();\n\t}\n\n\t// Convert categories to terms.\n\t$tt_ids     = array();\n\t$have_tags  = false;\n\t$categories = $wpdb->get_results( \"SELECT * FROM $wpdb->categories ORDER BY cat_ID\" );\n\tforeach ( $categories as $category ) {\n\t\t$term_id     = (int) $category->cat_ID;\n\t\t$name        = $category->cat_name;\n\t\t$description = $category->category_description;\n\t\t$slug        = $category->category_nicename;\n\t\t$parent      = $category->category_parent;\n\t\t$term_group  = 0;\n\n\t\t// Associate terms with the same slug in a term group and make slugs unique.\n\t\t$exists = $wpdb->get_results( $wpdb->prepare( \"SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s\", $slug ) );\n\t\tif ( $exists ) {\n\t\t\t$term_group = $exists[0]->term_group;\n\t\t\t$id         = $exists[0]->term_id;\n\t\t\t$num        = 2;\n\t\t\tdo {\n\t\t\t\t$alt_slug = $slug . \"-$num\";\n\t\t\t\t$num++;\n\t\t\t\t$slug_check = $wpdb->get_var( $wpdb->prepare( \"SELECT slug FROM $wpdb->terms WHERE slug = %s\", $alt_slug ) );\n\t\t\t} while ( $slug_check );\n\n\t\t\t$slug = $alt_slug;\n\n\t\t\tif ( empty( $term_group ) ) {\n\t\t\t\t$term_group = $wpdb->get_var( \"SELECT MAX(term_group) FROM $wpdb->terms GROUP BY term_group\" ) + 1;\n\t\t\t\t$wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->terms SET term_group = %d WHERE term_id = %d\", $term_group, $id ) );\n\t\t\t}\n\t\t}\n\n\t\t$wpdb->query(\n\t\t\t$wpdb->prepare(\n\t\t\t\t\"INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES\n\t\t(%d, %s, %s, %d)\",\n\t\t\t\t$term_id,\n\t\t\t\t$name,\n\t\t\t\t$slug,\n\t\t\t\t$term_group\n\t\t\t)\n\t\t);\n\n\t\t$count = 0;\n\t\tif ( ! empty( $category->category_count ) ) {\n\t\t\t$count    = (int) $category->category_count;\n\t\t\t$taxonomy = 'category';\n\t\t\t$wpdb->query( $wpdb->prepare( \"INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)\", $term_id, $taxonomy, $description, $parent, $count ) );\n\t\t\t$tt_ids[ $term_id ][ $taxonomy ] = (int) $wpdb->insert_id;\n\t\t}\n\n\t\tif ( ! empty( $category->link_count ) ) {\n\t\t\t$count    = (int) $category->link_count;\n\t\t\t$taxonomy = 'link_category';\n\t\t\t$wpdb->query( $wpdb->prepare( \"INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)\", $term_id, $taxonomy, $description, $parent, $count ) );\n\t\t\t$tt_ids[ $term_id ][ $taxonomy ] = (int) $wpdb->insert_id;\n\t\t}\n\n\t\tif ( ! empty( $category->tag_count ) ) {\n\t\t\t$have_tags = true;\n\t\t\t$count     = (int) $category->tag_count;\n\t\t\t$taxonomy  = 'post_tag';\n\t\t\t$wpdb->insert( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent', 'count' ) );\n\t\t\t$tt_ids[ $term_id ][ $taxonomy ] = (int) $wpdb->insert_id;\n\t\t}\n\n\t\tif ( empty( $count ) ) {\n\t\t\t$count    = 0;\n\t\t\t$taxonomy = 'category';\n\t\t\t$wpdb->insert( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent', 'count' ) );\n\t\t\t$tt_ids[ $term_id ][ $taxonomy ] = (int) $wpdb->insert_id;\n\t\t}\n\t}\n\n\t$select = 'post_id, category_id';\n\tif ( $have_tags ) {\n\t\t$select .= ', rel_type';\n\t}\n\n\t$posts = $wpdb->get_results( \"SELECT $select FROM $wpdb->post2cat GROUP BY post_id, category_id\" );\n\tforeach ( $posts as $post ) {\n\t\t$post_id  = (int) $post->post_id;\n\t\t$term_id  = (int) $post->category_id;\n\t\t$taxonomy = 'category';\n\t\tif ( ! empty( $post->rel_type ) && 'tag' === $post->rel_type ) {\n\t\t\t$taxonomy = 'tag';\n\t\t}\n\t\t$tt_id = $tt_ids[ $term_id ][ $taxonomy ];\n\t\tif ( empty( $tt_id ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$wpdb->insert(\n\t\t\t$wpdb->term_relationships,\n\t\t\tarray(\n\t\t\t\t'object_id'        => $post_id,\n\t\t\t\t'term_taxonomy_id' => $tt_id,\n\t\t\t)\n\t\t);\n\t}\n\n\t// < 3570 we used linkcategories. >= 3570 we used categories and link2cat.\n\tif ( $wp_current_db_version < 3570 ) {\n\t\t/*\n\t\t * Create link_category terms for link categories. Create a map of link\n\t\t * category IDs to link_category terms.\n\t\t */\n\t\t$link_cat_id_map  = array();\n\t\t$default_link_cat = 0;\n\t\t$tt_ids           = array();\n\t\t$link_cats        = $wpdb->get_results( 'SELECT cat_id, cat_name FROM ' . $wpdb->prefix . 'linkcategories' );\n\t\tforeach ( $link_cats as $category ) {\n\t\t\t$cat_id     = (int) $category->cat_id;\n\t\t\t$term_id    = 0;\n\t\t\t$name       = wp_slash( $category->cat_name );\n\t\t\t$slug       = sanitize_title( $name );\n\t\t\t$term_group = 0;\n\n\t\t\t// Associate terms with the same slug in a term group and make slugs unique.\n\t\t\t$exists = $wpdb->get_results( $wpdb->prepare( \"SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s\", $slug ) );\n\t\t\tif ( $exists ) {\n\t\t\t\t$term_group = $exists[0]->term_group;\n\t\t\t\t$term_id    = $exists[0]->term_id;\n\t\t\t}\n\n\t\t\tif ( empty( $term_id ) ) {\n\t\t\t\t$wpdb->insert( $wpdb->terms, compact( 'name', 'slug', 'term_group' ) );\n\t\t\t\t$term_id = (int) $wpdb->insert_id;\n\t\t\t}\n\n\t\t\t$link_cat_id_map[ $cat_id ] = $term_id;\n\t\t\t$default_link_cat           = $term_id;\n\n\t\t\t$wpdb->insert(\n\t\t\t\t$wpdb->term_taxonomy,\n\t\t\t\tarray(\n\t\t\t\t\t'term_id'     => $term_id,\n\t\t\t\t\t'taxonomy'    => 'link_category',\n\t\t\t\t\t'description' => '',\n\t\t\t\t\t'parent'      => 0,\n\t\t\t\t\t'count'       => 0,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$tt_ids[ $term_id ] = (int) $wpdb->insert_id;\n\t\t}\n\n\t\t// Associate links to categories.\n\t\t$links = $wpdb->get_results( \"SELECT link_id, link_category FROM $wpdb->links\" );\n\t\tif ( ! empty( $links ) ) {\n\t\t\tforeach ( $links as $link ) {\n\t\t\t\tif ( 0 == $link->link_category ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( ! isset( $link_cat_id_map[ $link->link_category ] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$term_id = $link_cat_id_map[ $link->link_category ];\n\t\t\t\t$tt_id   = $tt_ids[ $term_id ];\n\t\t\t\tif ( empty( $tt_id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$wpdb->insert(\n\t\t\t\t\t$wpdb->term_relationships,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'object_id'        => $link->link_id,\n\t\t\t\t\t\t'term_taxonomy_id' => $tt_id,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Set default to the last category we grabbed during the upgrade loop.\n\t\tupdate_option( 'default_link_category', $default_link_cat );\n\t} else {\n\t\t$links = $wpdb->get_results( \"SELECT link_id, category_id FROM $wpdb->link2cat GROUP BY link_id, category_id\" );\n\t\tforeach ( $links as $link ) {\n\t\t\t$link_id  = (int) $link->link_id;\n\t\t\t$term_id  = (int) $link->category_id;\n\t\t\t$taxonomy = 'link_category';\n\t\t\t$tt_id    = $tt_ids[ $term_id ][ $taxonomy ];\n\t\t\tif ( empty( $tt_id ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$wpdb->insert(\n\t\t\t\t$wpdb->term_relationships,\n\t\t\t\tarray(\n\t\t\t\t\t'object_id'        => $link_id,\n\t\t\t\t\t'term_taxonomy_id' => $tt_id,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\tif ( $wp_current_db_version < 4772 ) {\n\t\t// Obsolete linkcategories table.\n\t\t$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'linkcategories' );\n\t}\n\n\t// Recalculate all counts.\n\t$terms = $wpdb->get_results( \"SELECT term_taxonomy_id, taxonomy FROM $wpdb->term_taxonomy\" );\n\tforeach ( (array) $terms as $term ) {\n\t\tif ( 'post_tag' === $term->taxonomy || 'category' === $term->taxonomy ) {\n\t\t\t$count = $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type = 'post' AND term_taxonomy_id = %d\", $term->term_taxonomy_id ) );\n\t\t} else {\n\t\t\t$count = $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d\", $term->term_taxonomy_id ) );\n\t\t}\n\t\t$wpdb->update( $wpdb->term_taxonomy, array( 'count' => $count ), array( 'term_taxonomy_id' => $term->term_taxonomy_id ) );\n\t}\n}\n\n/**\n * Remove old options from the database.\n *\n * @ignore\n * @since 2.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction upgrade_230_options_table() {\n\tglobal $wpdb;\n\t$old_options_fields = array( 'option_can_override', 'option_type', 'option_width', 'option_height', 'option_description', 'option_admin_level' );\n\t$wpdb->hide_errors();\n\tforeach ( $old_options_fields as $old ) {\n\t\t$wpdb->query( \"ALTER TABLE $wpdb->options DROP $old\" );\n\t}\n\t$wpdb->show_errors();\n}\n\n/**\n * Remove old categories, link2cat, and post2cat database tables.\n *\n * @ignore\n * @since 2.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction upgrade_230_old_tables() {\n\tglobal $wpdb;\n\t$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'categories' );\n\t$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'link2cat' );\n\t$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'post2cat' );\n}\n\n/**\n * Upgrade old slugs made in version 2.2.\n *\n * @ignore\n * @since 2.2.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction upgrade_old_slugs() {\n\t// Upgrade people who were using the Redirect Old Slugs plugin.\n\tglobal $wpdb;\n\t$wpdb->query( \"UPDATE $wpdb->postmeta SET meta_key = '_wp_old_slug' WHERE meta_key = 'old_slug'\" );\n}\n\n/**\n * Execute changes made in WordPress 2.5.0.\n *\n * @ignore\n * @since 2.5.0\n *\n * @global int $wp_current_db_version The old (current) database version.\n */\nfunction upgrade_250() {\n\tglobal $wp_current_db_version;\n\n\tif ( $wp_current_db_version < 6689 ) {\n\t\tpopulate_roles_250();\n\t}\n\n}\n\n/**\n * Execute changes made in WordPress 2.5.2.\n *\n * @ignore\n * @since 2.5.2\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction upgrade_252() {\n\tglobal $wpdb;\n\n\t$wpdb->query( \"UPDATE $wpdb->users SET user_activation_key = ''\" );\n}\n\n/**\n * Execute changes made in WordPress 2.6.\n *\n * @ignore\n * @since 2.6.0\n *\n * @global int $wp_current_db_version The old (current) database version.\n */\nfunction upgrade_260() {\n\tglobal $wp_current_db_version;\n\n\tif ( $wp_current_db_version < 8000 ) {\n\t\tpopulate_roles_260();\n\t}\n}\n\n/**\n * Execute changes made in WordPress 2.7.\n *\n * @ignore\n * @since 2.7.0\n *\n * @global int  $wp_current_db_version The old (current) database version.\n * @global wpdb $wpdb                  WordPress database abstraction object.\n */\nfunction upgrade_270() {\n\tglobal $wp_current_db_version, $wpdb;\n\n\tif ( $wp_current_db_version < 8980 ) {\n\t\tpopulate_roles_270();\n\t}\n\n\t// Update post_date for unpublished posts with empty timestamp.\n\tif ( $wp_current_db_version < 8921 ) {\n\t\t$wpdb->query( \"UPDATE $wpdb->posts SET post_date = post_modified WHERE post_date = '0000-00-00 00:00:00'\" );\n\t}\n}\n\n/**\n * Execute changes made in WordPress 2.8.\n *\n * @ignore\n * @since 2.8.0\n *\n * @global int  $wp_current_db_version The old (current) database version.\n * @global wpdb $wpdb                  WordPress database abstraction object.\n */\nfunction upgrade_280() {\n\tglobal $wp_current_db_version, $wpdb;\n\n\tif ( $wp_current_db_version < 10360 ) {\n\t\tpopulate_roles_280();\n\t}\n\tif ( is_multisite() ) {\n\t\t$start = 0;\n\t\twhile ( $rows = $wpdb->get_results( \"SELECT option_name, option_value FROM $wpdb->options ORDER BY option_id LIMIT $start, 20\" ) ) {\n\t\t\tforeach ( $rows as $row ) {\n\t\t\t\t$value = $row->option_value;\n\t\t\t\tif ( ! @unserialize( $value ) ) {\n\t\t\t\t\t$value = stripslashes( $value );\n\t\t\t\t}\n\t\t\t\tif ( $value !== $row->option_value ) {\n\t\t\t\t\tupdate_option( $row->option_name, $value );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$start += 20;\n\t\t}\n\t\tclean_blog_cache( get_current_blog_id() );\n\t}\n}\n\n/**\n * Execute changes made in WordPress 2.9.\n *\n * @ignore\n * @since 2.9.0\n *\n * @global int $wp_current_db_version The old (current) database version.\n */\nfunction upgrade_290() {\n\tglobal $wp_current_db_version;\n\n\tif ( $wp_current_db_version < 11958 ) {\n\t\t// Previously, setting depth to 1 would redundantly disable threading,\n\t\t// but now 2 is the minimum depth to avoid confusion.\n\t\tif ( get_option( 'thread_comments_depth' ) == '1' ) {\n\t\t\tupdate_option( 'thread_comments_depth', 2 );\n\t\t\tupdate_option( 'thread_comments', 0 );\n\t\t}\n\t}\n}\n\n/**\n * Execute changes made in WordPress 3.0.\n *\n * @ignore\n * @since 3.0.0\n *\n * @global int  $wp_current_db_version The old (current) database version.\n * @global wpdb $wpdb                  WordPress database abstraction object.\n */\nfunction upgrade_300() {\n\tglobal $wp_current_db_version, $wpdb;\n\n\tif ( $wp_current_db_version < 15093 ) {\n\t\tpopulate_roles_300();\n\t}\n\n\tif ( $wp_current_db_version < 14139 && is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false ) {\n\t\tadd_site_option( 'siteurl', '' );\n\t}\n\n\t// 3.0 screen options key name changes.\n\tif ( wp_should_upgrade_global_tables() ) {\n\t\t$sql    = \"DELETE FROM $wpdb->usermeta\n\t\t\tWHERE meta_key LIKE %s\n\t\t\tOR meta_key LIKE %s\n\t\t\tOR meta_key LIKE %s\n\t\t\tOR meta_key LIKE %s\n\t\t\tOR meta_key LIKE %s\n\t\t\tOR meta_key LIKE %s\n\t\t\tOR meta_key = 'manageedittagscolumnshidden'\n\t\t\tOR meta_key = 'managecategoriescolumnshidden'\n\t\t\tOR meta_key = 'manageedit-tagscolumnshidden'\n\t\t\tOR meta_key = 'manageeditcolumnshidden'\n\t\t\tOR meta_key = 'categories_per_page'\n\t\t\tOR meta_key = 'edit_tags_per_page'\";\n\t\t$prefix = $wpdb->esc_like( $wpdb->base_prefix );\n\t\t$wpdb->query(\n\t\t\t$wpdb->prepare(\n\t\t\t\t$sql,\n\t\t\t\t$prefix . '%' . $wpdb->esc_like( 'meta-box-hidden' ) . '%',\n\t\t\t\t$prefix . '%' . $wpdb->esc_like( 'closedpostboxes' ) . '%',\n\t\t\t\t$prefix . '%' . $wpdb->esc_like( 'manage-' ) . '%' . $wpdb->esc_like( '-columns-hidden' ) . '%',\n\t\t\t\t$prefix . '%' . $wpdb->esc_like( 'meta-box-order' ) . '%',\n\t\t\t\t$prefix . '%' . $wpdb->esc_like( 'metaboxorder' ) . '%',\n\t\t\t\t$prefix . '%' . $wpdb->esc_like( 'screen_layout' ) . '%'\n\t\t\t)\n\t\t);\n\t}\n\n}\n\n/**\n * Execute changes made in WordPress 3.3.\n *\n * @ignore\n * @since 3.3.0\n *\n * @global int   $wp_current_db_version The old (current) database version.\n * @global wpdb  $wpdb                  WordPress database abstraction object.\n * @global array $wp_registered_widgets\n * @global array $sidebars_widgets\n */\nfunction upgrade_330() {\n\tglobal $wp_current_db_version, $wpdb, $wp_registered_widgets, $sidebars_widgets;\n\n\tif ( $wp_current_db_version < 19061 && wp_should_upgrade_global_tables() ) {\n\t\t$wpdb->query( \"DELETE FROM $wpdb->usermeta WHERE meta_key IN ('show_admin_bar_admin', 'plugins_last_view')\" );\n\t}\n\n\tif ( $wp_current_db_version >= 11548 ) {\n\t\treturn;\n\t}\n\n\t$sidebars_widgets  = get_option( 'sidebars_widgets', array() );\n\t$_sidebars_widgets = array();\n\n\tif ( isset( $sidebars_widgets['wp_inactive_widgets'] ) || empty( $sidebars_widgets ) ) {\n\t\t$sidebars_widgets['array_version'] = 3;\n\t} elseif ( ! isset( $sidebars_widgets['array_version'] ) ) {\n\t\t$sidebars_widgets['array_version'] = 1;\n\t}\n\n\tswitch ( $sidebars_widgets['array_version'] ) {\n\t\tcase 1:\n\t\t\tforeach ( (array) $sidebars_widgets as $index => $sidebar ) {\n\t\t\t\tif ( is_array( $sidebar ) ) {\n\t\t\t\t\tforeach ( (array) $sidebar as $i => $name ) {\n\t\t\t\t\t\t$id = strtolower( $name );\n\t\t\t\t\t\tif ( isset( $wp_registered_widgets[ $id ] ) ) {\n\t\t\t\t\t\t\t$_sidebars_widgets[ $index ][ $i ] = $id;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$id = sanitize_title( $name );\n\t\t\t\t\t\tif ( isset( $wp_registered_widgets[ $id ] ) ) {\n\t\t\t\t\t\t\t$_sidebars_widgets[ $index ][ $i ] = $id;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$found = false;\n\n\t\t\t\t\t\tforeach ( $wp_registered_widgets as $widget_id => $widget ) {\n\t\t\t\t\t\t\tif ( strtolower( $widget['name'] ) == strtolower( $name ) ) {\n\t\t\t\t\t\t\t\t$_sidebars_widgets[ $index ][ $i ] = $widget['id'];\n\t\t\t\t\t\t\t\t$found                             = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} elseif ( sanitize_title( $widget['name'] ) == sanitize_title( $name ) ) {\n\t\t\t\t\t\t\t\t$_sidebars_widgets[ $index ][ $i ] = $widget['id'];\n\t\t\t\t\t\t\t\t$found                             = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( $found ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tunset( $_sidebars_widgets[ $index ][ $i ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$_sidebars_widgets['array_version'] = 2;\n\t\t\t$sidebars_widgets                   = $_sidebars_widgets;\n\t\t\tunset( $_sidebars_widgets );\n\n\t\t\t// Intentional fall-through to upgrade to the next version.\n\t\tcase 2:\n\t\t\t$sidebars_widgets                  = retrieve_widgets();\n\t\t\t$sidebars_widgets['array_version'] = 3;\n\t\t\tupdate_option( 'sidebars_widgets', $sidebars_widgets );\n\t}\n}\n\n/**\n * Execute changes made in WordPress 3.4.\n *\n * @ignore\n * @since 3.4.0\n *\n * @global int  $wp_current_db_version The old (current) database version.\n * @global wpdb $wpdb                  WordPress database abstraction object.\n */\nfunction upgrade_340() {\n\tglobal $wp_current_db_version, $wpdb;\n\n\tif ( $wp_current_db_version < 19798 ) {\n\t\t$wpdb->hide_errors();\n\t\t$wpdb->query( \"ALTER TABLE $wpdb->options DROP COLUMN blog_id\" );\n\t\t$wpdb->show_errors();\n\t}\n\n\tif ( $wp_current_db_version < 19799 ) {\n\t\t$wpdb->hide_errors();\n\t\t$wpdb->query( \"ALTER TABLE $wpdb->comments DROP INDEX comment_approved\" );\n\t\t$wpdb->show_errors();\n\t}\n\n\tif ( $wp_current_db_version < 20022 && wp_should_upgrade_global_tables() ) {\n\t\t$wpdb->query( \"DELETE FROM $wpdb->usermeta WHERE meta_key = 'themes_last_view'\" );\n\t}\n\n\tif ( $wp_current_db_version < 20080 ) {\n\t\tif ( 'yes' === $wpdb->get_var( \"SELECT autoload FROM $wpdb->options WHERE option_name = 'uninstall_plugins'\" ) ) {\n\t\t\t$uninstall_plugins = get_option( 'uninstall_plugins' );\n\t\t\tdelete_option( 'uninstall_plugins' );\n\t\t\tadd_option( 'uninstall_plugins', $uninstall_plugins, null, 'no' );\n\t\t}\n\t}\n}\n\n/**\n * Execute changes made in WordPress 3.5.\n *\n * @ignore\n * @since 3.5.0\n *\n * @global int  $wp_current_db_version The old (current) database version.\n * @global wpdb $wpdb                  WordPress database abstraction object.\n */\nfunction upgrade_350() {\n\tglobal $wp_current_db_version, $wpdb;\n\n\tif ( $wp_current_db_version < 22006 && $wpdb->get_var( \"SELECT link_id FROM $wpdb->links LIMIT 1\" ) ) {\n\t\tupdate_option( 'link_manager_enabled', 1 ); // Previously set to 0 by populate_options().\n\t}\n\n\tif ( $wp_current_db_version < 21811 && wp_should_upgrade_global_tables() ) {\n\t\t$meta_keys = array();\n\t\tforeach ( array_merge( get_post_types(), get_taxonomies() ) as $name ) {\n\t\t\tif ( false !== strpos( $name, '-' ) ) {\n\t\t\t\t$meta_keys[] = 'edit_' . str_replace( '-', '_', $name ) . '_per_page';\n\t\t\t}\n\t\t}\n\t\tif ( $meta_keys ) {\n\t\t\t$meta_keys = implode( \"', '\", $meta_keys );\n\t\t\t$wpdb->query( \"DELETE FROM $wpdb->usermeta WHERE meta_key IN ('$meta_keys')\" );\n\t\t}\n\t}\n\n\tif ( $wp_current_db_version < 22422 ) {\n\t\t$term = get_term_by( 'slug', 'post-format-standard', 'post_format' );\n\t\tif ( $term ) {\n\t\t\twp_delete_term( $term->term_id, 'post_format' );\n\t\t}\n\t}\n}\n\n/**\n * Execute changes made in WordPress 3.7.\n *\n * @ignore\n * @since 3.7.0\n *\n * @global int $wp_current_db_version The old (current) database version.\n */\nfunction upgrade_370() {\n\tglobal $wp_current_db_version;\n\n\tif ( $wp_current_db_version < 25824 ) {\n\t\twp_clear_scheduled_hook( 'wp_auto_updates_maybe_update' );\n\t}\n}\n\n/**\n * Execute changes made in WordPress 3.7.2.\n *\n * @ignore\n * @since 3.7.2\n * @since 3.8.0\n *\n * @global int $wp_current_db_version The old (current) database version.\n */\nfunction upgrade_372() {\n\tglobal $wp_current_db_version;\n\n\tif ( $wp_current_db_version < 26148 ) {\n\t\twp_clear_scheduled_hook( 'wp_maybe_auto_update' );\n\t}\n}\n\n/**\n * Execute changes made in WordPress 3.8.0.\n *\n * @ignore\n * @since 3.8.0\n *\n * @global int $wp_current_db_version The old (current) database version.\n */\nfunction upgrade_380() {\n\tglobal $wp_current_db_version;\n\n\tif ( $wp_current_db_version < 26691 ) {\n\t\tdeactivate_plugins( array( 'mp6/mp6.php' ), true );\n\t}\n}\n\n/**\n * Execute changes made in WordPress 4.0.0.\n *\n * @ignore\n * @since 4.0.0\n *\n * @global int $wp_current_db_version The old (current) database version.\n */\nfunction upgrade_400() {\n\tglobal $wp_current_db_version;\n\n\tif ( $wp_current_db_version < 29630 ) {\n\t\tif ( ! is_multisite() && false === get_option( 'WPLANG' ) ) {\n\t\t\tif ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && in_array( WPLANG, get_available_languages(), true ) ) {\n\t\t\t\tupdate_option( 'WPLANG', WPLANG );\n\t\t\t} else {\n\t\t\t\tupdate_option( 'WPLANG', '' );\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Execute changes made in WordPress 4.2.0.\n *\n * @ignore\n * @since 4.2.0\n */\nfunction upgrade_420() {}\n\n/**\n * Executes changes made in WordPress 4.3.0.\n *\n * @ignore\n * @since 4.3.0\n *\n * @global int  $wp_current_db_version The old (current) database version.\n * @global wpdb $wpdb                  WordPress database abstraction object.\n */\nfunction upgrade_430() {\n\tglobal $wp_current_db_version, $wpdb;\n\n\tif ( $wp_current_db_version < 32364 ) {\n\t\tupgrade_430_fix_comments();\n\t}\n\n\t// Shared terms are split in a separate process.\n\tif ( $wp_current_db_version < 32814 ) {\n\t\tupdate_option( 'finished_splitting_shared_terms', 0 );\n\t\twp_schedule_single_event( time() + ( 1 * MINUTE_IN_SECONDS ), 'wp_split_shared_term_batch' );\n\t}\n\n\tif ( $wp_current_db_version < 33055 && 'utf8mb4' === $wpdb->charset ) {\n\t\tif ( is_multisite() ) {\n\t\t\t$tables = $wpdb->tables( 'blog' );\n\t\t} else {\n\t\t\t$tables = $wpdb->tables( 'all' );\n\t\t\tif ( ! wp_should_upgrade_global_tables() ) {\n\t\t\t\t$global_tables = $wpdb->tables( 'global' );\n\t\t\t\t$tables        = array_diff_assoc( $tables, $global_tables );\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $tables as $table ) {\n\t\t\tmaybe_convert_table_to_utf8mb4( $table );\n\t\t}\n\t}\n}\n\n/**\n * Executes comments changes made in WordPress 4.3.0.\n *\n * @ignore\n * @since 4.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction upgrade_430_fix_comments() {\n\tglobal $wpdb;\n\n\t$content_length = $wpdb->get_col_length( $wpdb->comments, 'comment_content' );\n\n\tif ( is_wp_error( $content_length ) ) {\n\t\treturn;\n\t}\n\n\tif ( false === $content_length ) {\n\t\t$content_length = array(\n\t\t\t'type'   => 'byte',\n\t\t\t'length' => 65535,\n\t\t);\n\t} elseif ( ! is_array( $content_length ) ) {\n\t\t$length         = (int) $content_length > 0 ? (int) $content_length : 65535;\n\t\t$content_length = array(\n\t\t\t'type'   => 'byte',\n\t\t\t'length' => $length,\n\t\t);\n\t}\n\n\tif ( 'byte' !== $content_length['type'] || 0 === $content_length['length'] ) {\n\t\t// Sites with malformed DB schemas are on their own.\n\t\treturn;\n\t}\n\n\t$allowed_length = intval( $content_length['length'] ) - 10;\n\n\t$comments = $wpdb->get_results(\n\t\t\"SELECT `comment_ID` FROM `{$wpdb->comments}`\n\t\t\tWHERE `comment_date_gmt` > '2015-04-26'\n\t\t\tAND LENGTH( `comment_content` ) >= {$allowed_length}\n\t\t\tAND ( `comment_content` LIKE '%<%' OR `comment_content` LIKE '%>%' )\"\n\t);\n\n\tforeach ( $comments as $comment ) {\n\t\twp_delete_comment( $comment->comment_ID, true );\n\t}\n}\n\n/**\n * Executes changes made in WordPress 4.3.1.\n *\n * @ignore\n * @since 4.3.1\n */\nfunction upgrade_431() {\n\t// Fix incorrect cron entries for term splitting.\n\t$cron_array = _get_cron_array();\n\tif ( isset( $cron_array['wp_batch_split_terms'] ) ) {\n\t\tunset( $cron_array['wp_batch_split_terms'] );\n\t\t_set_cron_array( $cron_array );\n\t}\n}\n\n/**\n * Executes changes made in WordPress 4.4.0.\n *\n * @ignore\n * @since 4.4.0\n *\n * @global int  $wp_current_db_version The old (current) database version.\n * @global wpdb $wpdb                  WordPress database abstraction object.\n */\nfunction upgrade_440() {\n\tglobal $wp_current_db_version, $wpdb;\n\n\tif ( $wp_current_db_version < 34030 ) {\n\t\t$wpdb->query( \"ALTER TABLE {$wpdb->options} MODIFY option_name VARCHAR(191)\" );\n\t}\n\n\t// Remove the unused 'add_users' role.\n\t$roles = wp_roles();\n\tforeach ( $roles->role_objects as $role ) {\n\t\tif ( $role->has_cap( 'add_users' ) ) {\n\t\t\t$role->remove_cap( 'add_users' );\n\t\t}\n\t}\n}\n\n/**\n * Executes changes made in WordPress 4.5.0.\n *\n * @ignore\n * @since 4.5.0\n *\n * @global int  $wp_current_db_version The old (current) database version.\n * @global wpdb $wpdb                  WordPress database abstraction object.\n */\nfunction upgrade_450() {\n\tglobal $wp_current_db_version, $wpdb;\n\n\tif ( $wp_current_db_version < 36180 ) {\n\t\twp_clear_scheduled_hook( 'wp_maybe_auto_update' );\n\t}\n\n\t// Remove unused email confirmation options, moved to usermeta.\n\tif ( $wp_current_db_version < 36679 && is_multisite() ) {\n\t\t$wpdb->query( \"DELETE FROM $wpdb->options WHERE option_name REGEXP '^[0-9]+_new_email$'\" );\n\t}\n\n\t// Remove unused user setting for wpLink.\n\tdelete_user_setting( 'wplink' );\n}\n\n/**\n * Executes changes made in WordPress 4.6.0.\n *\n * @ignore\n * @since 4.6.0\n *\n * @global int $wp_current_db_version The old (current) database version.\n */\nfunction upgrade_460() {\n\tglobal $wp_current_db_version;\n\n\t// Remove unused post meta.\n\tif ( $wp_current_db_version < 37854 ) {\n\t\tdelete_post_meta_by_key( '_post_restored_from' );\n\t}\n\n\t// Remove plugins with callback as an array object/method as the uninstall hook, see #13786.\n\tif ( $wp_current_db_version < 37965 ) {\n\t\t$uninstall_plugins = get_option( 'uninstall_plugins', array() );\n\n\t\tif ( ! empty( $uninstall_plugins ) ) {\n\t\t\tforeach ( $uninstall_plugins as $basename => $callback ) {\n\t\t\t\tif ( is_array( $callback ) && is_object( $callback[0] ) ) {\n\t\t\t\t\tunset( $uninstall_plugins[ $basename ] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tupdate_option( 'uninstall_plugins', $uninstall_plugins );\n\t\t}\n\t}\n}\n\n/**\n * Executes changes made in WordPress 5.0.0.\n *\n * @ignore\n * @since 5.0.0\n * @deprecated 5.1.0\n */\nfunction upgrade_500() {\n}\n\n/**\n * Executes changes made in WordPress 5.1.0.\n *\n * @ignore\n * @since 5.1.0\n */\nfunction upgrade_510() {\n\tdelete_site_option( 'upgrade_500_was_gutenberg_active' );\n}\n\n/**\n * Executes changes made in WordPress 5.3.0.\n *\n * @ignore\n * @since 5.3.0\n */\nfunction upgrade_530() {\n\t/*\n\t * The `admin_email_lifespan` option may have been set by an admin that just logged in,\n\t * saw the verification screen, clicked on a button there, and is now upgrading the db,\n\t * or by populate_options() that is called earlier in upgrade_all().\n\t * In the second case `admin_email_lifespan` should be reset so the verification screen\n\t * is shown next time an admin logs in.\n\t */\n\tif ( function_exists( 'current_user_can' ) && ! current_user_can( 'manage_options' ) ) {\n\t\tupdate_option( 'admin_email_lifespan', 0 );\n\t}\n}\n\n/**\n * Executes changes made in WordPress 5.5.0.\n *\n * @ignore\n * @since 5.5.0\n */\nfunction upgrade_550() {\n\tglobal $wp_current_db_version;\n\n\tif ( $wp_current_db_version < 48121 ) {\n\t\t$comment_previously_approved = get_option( 'comment_whitelist', '' );\n\t\tupdate_option( 'comment_previously_approved', $comment_previously_approved );\n\t\tdelete_option( 'comment_whitelist' );\n\t}\n\n\tif ( $wp_current_db_version < 48575 ) {\n\t\t// Use more clear and inclusive language.\n\t\t$disallowed_list = get_option( 'blacklist_keys' );\n\n\t\t/*\n\t\t * This option key was briefly renamed `blocklist_keys`.\n\t\t * Account for sites that have this key present when the original key does not exist.\n\t\t */\n\t\tif ( false === $disallowed_list ) {\n\t\t\t$disallowed_list = get_option( 'blocklist_keys' );\n\t\t}\n\n\t\tupdate_option( 'disallowed_keys', $disallowed_list );\n\t\tdelete_option( 'blacklist_keys' );\n\t\tdelete_option( 'blocklist_keys' );\n\t}\n\n\tif ( $wp_current_db_version < 48748 ) {\n\t\tupdate_option( 'finished_updating_comment_type', 0 );\n\t\twp_schedule_single_event( time() + ( 1 * MINUTE_IN_SECONDS ), 'wp_update_comment_type_batch' );\n\t}\n}\n\n/**\n * Executes network-level upgrade routines.\n *\n * @since 3.0.0\n *\n * @global int  $wp_current_db_version The old (current) database version.\n * @global wpdb $wpdb                  WordPress database abstraction object.\n */\nfunction upgrade_network() {\n\tglobal $wp_current_db_version, $wpdb;\n\n\t// Always clear expired transients.\n\tdelete_expired_transients( true );\n\n\t// 2.8.0\n\tif ( $wp_current_db_version < 11549 ) {\n\t\t$wpmu_sitewide_plugins   = get_site_option( 'wpmu_sitewide_plugins' );\n\t\t$active_sitewide_plugins = get_site_option( 'active_sitewide_plugins' );\n\t\tif ( $wpmu_sitewide_plugins ) {\n\t\t\tif ( ! $active_sitewide_plugins ) {\n\t\t\t\t$sitewide_plugins = (array) $wpmu_sitewide_plugins;\n\t\t\t} else {\n\t\t\t\t$sitewide_plugins = array_merge( (array) $active_sitewide_plugins, (array) $wpmu_sitewide_plugins );\n\t\t\t}\n\n\t\t\tupdate_site_option( 'active_sitewide_plugins', $sitewide_plugins );\n\t\t}\n\t\tdelete_site_option( 'wpmu_sitewide_plugins' );\n\t\tdelete_site_option( 'deactivated_sitewide_plugins' );\n\n\t\t$start = 0;\n\t\twhile ( $rows = $wpdb->get_results( \"SELECT meta_key, meta_value FROM {$wpdb->sitemeta} ORDER BY meta_id LIMIT $start, 20\" ) ) {\n\t\t\tforeach ( $rows as $row ) {\n\t\t\t\t$value = $row->meta_value;\n\t\t\t\tif ( ! @unserialize( $value ) ) {\n\t\t\t\t\t$value = stripslashes( $value );\n\t\t\t\t}\n\t\t\t\tif ( $value !== $row->meta_value ) {\n\t\t\t\t\tupdate_site_option( $row->meta_key, $value );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$start += 20;\n\t\t}\n\t}\n\n\t// 3.0.0\n\tif ( $wp_current_db_version < 13576 ) {\n\t\tupdate_site_option( 'global_terms_enabled', '1' );\n\t}\n\n\t// 3.3.0\n\tif ( $wp_current_db_version < 19390 ) {\n\t\tupdate_site_option( 'initial_db_version', $wp_current_db_version );\n\t}\n\n\tif ( $wp_current_db_version < 19470 ) {\n\t\tif ( false === get_site_option( 'active_sitewide_plugins' ) ) {\n\t\t\tupdate_site_option( 'active_sitewide_plugins', array() );\n\t\t}\n\t}\n\n\t// 3.4.0\n\tif ( $wp_current_db_version < 20148 ) {\n\t\t// 'allowedthemes' keys things by stylesheet. 'allowed_themes' keyed things by name.\n\t\t$allowedthemes  = get_site_option( 'allowedthemes' );\n\t\t$allowed_themes = get_site_option( 'allowed_themes' );\n\t\tif ( false === $allowedthemes && is_array( $allowed_themes ) && $allowed_themes ) {\n\t\t\t$converted = array();\n\t\t\t$themes    = wp_get_themes();\n\t\t\tforeach ( $themes as $stylesheet => $theme_data ) {\n\t\t\t\tif ( isset( $allowed_themes[ $theme_data->get( 'Name' ) ] ) ) {\n\t\t\t\t\t$converted[ $stylesheet ] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tupdate_site_option( 'allowedthemes', $converted );\n\t\t\tdelete_site_option( 'allowed_themes' );\n\t\t}\n\t}\n\n\t// 3.5.0\n\tif ( $wp_current_db_version < 21823 ) {\n\t\tupdate_site_option( 'ms_files_rewriting', '1' );\n\t}\n\n\t// 3.5.2\n\tif ( $wp_current_db_version < 24448 ) {\n\t\t$illegal_names = get_site_option( 'illegal_names' );\n\t\tif ( is_array( $illegal_names ) && count( $illegal_names ) === 1 ) {\n\t\t\t$illegal_name  = reset( $illegal_names );\n\t\t\t$illegal_names = explode( ' ', $illegal_name );\n\t\t\tupdate_site_option( 'illegal_names', $illegal_names );\n\t\t}\n\t}\n\n\t// 4.2.0\n\tif ( $wp_current_db_version < 31351 && 'utf8mb4' === $wpdb->charset ) {\n\t\tif ( wp_should_upgrade_global_tables() ) {\n\t\t\t$wpdb->query( \"ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))\" );\n\t\t\t$wpdb->query( \"ALTER TABLE $wpdb->site DROP INDEX domain, ADD INDEX domain(domain(140),path(51))\" );\n\t\t\t$wpdb->query( \"ALTER TABLE $wpdb->sitemeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))\" );\n\t\t\t$wpdb->query( \"ALTER TABLE $wpdb->signups DROP INDEX domain_path, ADD INDEX domain_path(domain(140),path(51))\" );\n\n\t\t\t$tables = $wpdb->tables( 'global' );\n\n\t\t\t// sitecategories may not exist.\n\t\t\tif ( ! $wpdb->get_var( \"SHOW TABLES LIKE '{$tables['sitecategories']}'\" ) ) {\n\t\t\t\tunset( $tables['sitecategories'] );\n\t\t\t}\n\n\t\t\tforeach ( $tables as $table ) {\n\t\t\t\tmaybe_convert_table_to_utf8mb4( $table );\n\t\t\t}\n\t\t}\n\t}\n\n\t// 4.3.0\n\tif ( $wp_current_db_version < 33055 && 'utf8mb4' === $wpdb->charset ) {\n\t\tif ( wp_should_upgrade_global_tables() ) {\n\t\t\t$upgrade = false;\n\t\t\t$indexes = $wpdb->get_results( \"SHOW INDEXES FROM $wpdb->signups\" );\n\t\t\tforeach ( $indexes as $index ) {\n\t\t\t\tif ( 'domain_path' === $index->Key_name && 'domain' === $index->Column_name && 140 != $index->Sub_part ) {\n\t\t\t\t\t$upgrade = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $upgrade ) {\n\t\t\t\t$wpdb->query( \"ALTER TABLE $wpdb->signups DROP INDEX domain_path, ADD INDEX domain_path(domain(140),path(51))\" );\n\t\t\t}\n\n\t\t\t$tables = $wpdb->tables( 'global' );\n\n\t\t\t// sitecategories may not exist.\n\t\t\tif ( ! $wpdb->get_var( \"SHOW TABLES LIKE '{$tables['sitecategories']}'\" ) ) {\n\t\t\t\tunset( $tables['sitecategories'] );\n\t\t\t}\n\n\t\t\tforeach ( $tables as $table ) {\n\t\t\t\tmaybe_convert_table_to_utf8mb4( $table );\n\t\t\t}\n\t\t}\n\t}\n\n\t// 5.1.0\n\tif ( $wp_current_db_version < 44467 ) {\n\t\t$network_id = get_main_network_id();\n\t\tdelete_network_option( $network_id, 'site_meta_supported' );\n\t\tis_site_meta_supported();\n\t}\n}\n\n//\n// General functions we use to actually do stuff.\n//\n\n/**\n * Creates a table in the database, if it doesn't already exist.\n *\n * This method checks for an existing database and creates a new one if it's not\n * already present. It doesn't rely on MySQL's \"IF NOT EXISTS\" statement, but chooses\n * to query all tables first and then run the SQL statement creating the table.\n *\n * @since 1.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $table_name Database table name.\n * @param string $create_ddl SQL statement to create table.\n * @return bool True on success or if the table already exists. False on failure.\n */\nfunction maybe_create_table( $table_name, $create_ddl ) {\n\tglobal $wpdb;\n\n\t$query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table_name ) );\n\n\tif ( $wpdb->get_var( $query ) === $table_name ) {\n\t\treturn true;\n\t}\n\n\t// Didn't find it, so try to create it.\n\t$wpdb->query( $create_ddl );\n\n\t// We cannot directly tell that whether this succeeded!\n\tif ( $wpdb->get_var( $query ) === $table_name ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Drops a specified index from a table.\n *\n * @since 1.0.1\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $table Database table name.\n * @param string $index Index name to drop.\n * @return true True, when finished.\n */\nfunction drop_index( $table, $index ) {\n\tglobal $wpdb;\n\n\t$wpdb->hide_errors();\n\n\t$wpdb->query( \"ALTER TABLE `$table` DROP INDEX `$index`\" );\n\n\t// Now we need to take out all the extra ones we may have created.\n\tfor ( $i = 0; $i < 25; $i++ ) {\n\t\t$wpdb->query( \"ALTER TABLE `$table` DROP INDEX `{$index}_$i`\" );\n\t}\n\n\t$wpdb->show_errors();\n\n\treturn true;\n}\n\n/**\n * Adds an index to a specified table.\n *\n * @since 1.0.1\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $table Database table name.\n * @param string $index Database table index column.\n * @return true True, when done with execution.\n */\nfunction add_clean_index( $table, $index ) {\n\tglobal $wpdb;\n\n\tdrop_index( $table, $index );\n\t$wpdb->query( \"ALTER TABLE `$table` ADD INDEX ( `$index` )\" );\n\n\treturn true;\n}\n\n/**\n * Adds column to a database table, if it doesn't already exist.\n *\n * @since 1.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $table_name  Database table name.\n * @param string $column_name Table column name.\n * @param string $create_ddl  SQL statement to add column.\n * @return bool True on success or if the column already exists. False on failure.\n */\nfunction maybe_add_column( $table_name, $column_name, $create_ddl ) {\n\tglobal $wpdb;\n\n\tforeach ( $wpdb->get_col( \"DESC $table_name\", 0 ) as $column ) {\n\t\tif ( $column === $column_name ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t// Didn't find it, so try to create it.\n\t$wpdb->query( $create_ddl );\n\n\t// We cannot directly tell that whether this succeeded!\n\tforeach ( $wpdb->get_col( \"DESC $table_name\", 0 ) as $column ) {\n\t\tif ( $column === $column_name ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * If a table only contains utf8 or utf8mb4 columns, convert it to utf8mb4.\n *\n * @since 4.2.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $table The table to convert.\n * @return bool True if the table was converted, false if it wasn't.\n */\nfunction maybe_convert_table_to_utf8mb4( $table ) {\n\tglobal $wpdb;\n\n\t$results = $wpdb->get_results( \"SHOW FULL COLUMNS FROM `$table`\" );\n\tif ( ! $results ) {\n\t\treturn false;\n\t}\n\n\tforeach ( $results as $column ) {\n\t\tif ( $column->Collation ) {\n\t\t\tlist( $charset ) = explode( '_', $column->Collation );\n\t\t\t$charset         = strtolower( $charset );\n\t\t\tif ( 'utf8' !== $charset && 'utf8mb4' !== $charset ) {\n\t\t\t\t// Don't upgrade tables that have non-utf8 columns.\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\t$table_details = $wpdb->get_row( \"SHOW TABLE STATUS LIKE '$table'\" );\n\tif ( ! $table_details ) {\n\t\treturn false;\n\t}\n\n\tlist( $table_charset ) = explode( '_', $table_details->Collation );\n\t$table_charset         = strtolower( $table_charset );\n\tif ( 'utf8mb4' === $table_charset ) {\n\t\treturn true;\n\t}\n\n\treturn $wpdb->query( \"ALTER TABLE $table CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci\" );\n}\n\n/**\n * Retrieve all options as it was for 1.2.\n *\n * @since 1.2.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @return stdClass List of options.\n */\nfunction get_alloptions_110() {\n\tglobal $wpdb;\n\t$all_options = new stdClass;\n\t$options     = $wpdb->get_results( \"SELECT option_name, option_value FROM $wpdb->options\" );\n\tif ( $options ) {\n\t\tforeach ( $options as $option ) {\n\t\t\tif ( 'siteurl' === $option->option_name || 'home' === $option->option_name || 'category_base' === $option->option_name ) {\n\t\t\t\t$option->option_value = untrailingslashit( $option->option_value );\n\t\t\t}\n\t\t\t$all_options->{$option->option_name} = stripslashes( $option->option_value );\n\t\t}\n\t}\n\treturn $all_options;\n}\n\n/**\n * Utility version of get_option that is private to installation/upgrade.\n *\n * @ignore\n * @since 1.5.1\n * @access private\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $setting Option name.\n * @return mixed\n */\nfunction __get_option( $setting ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore\n\tglobal $wpdb;\n\n\tif ( 'home' === $setting && defined( 'WP_HOME' ) ) {\n\t\treturn untrailingslashit( WP_HOME );\n\t}\n\n\tif ( 'siteurl' === $setting && defined( 'WP_SITEURL' ) ) {\n\t\treturn untrailingslashit( WP_SITEURL );\n\t}\n\n\t$option = $wpdb->get_var( $wpdb->prepare( \"SELECT option_value FROM $wpdb->options WHERE option_name = %s\", $setting ) );\n\n\tif ( 'home' === $setting && ! $option ) {\n\t\treturn __get_option( 'siteurl' );\n\t}\n\n\tif ( in_array( $setting, array( 'siteurl', 'home', 'category_base', 'tag_base' ), true ) ) {\n\t\t$option = untrailingslashit( $option );\n\t}\n\n\treturn maybe_unserialize( $option );\n}\n\n/**\n * Filters for content to remove unnecessary slashes.\n *\n * @since 1.5.0\n *\n * @param string $content The content to modify.\n * @return string The de-slashed content.\n */\nfunction deslash( $content ) {\n\t// Note: \\\\\\ inside a regex denotes a single backslash.\n\n\t/*\n\t * Replace one or more backslashes followed by a single quote with\n\t * a single quote.\n\t */\n\t$content = preg_replace( \"/\\\\\\+'/\", \"'\", $content );\n\n\t/*\n\t * Replace one or more backslashes followed by a double quote with\n\t * a double quote.\n\t */\n\t$content = preg_replace( '/\\\\\\+\"/', '\"', $content );\n\n\t// Replace one or more backslashes with one backslash.\n\t$content = preg_replace( '/\\\\\\+/', '\\\\', $content );\n\n\treturn $content;\n}\n\n/**\n * Modifies the database based on specified SQL statements.\n *\n * Useful for creating new tables and updating existing tables to a new structure.\n *\n * @since 1.5.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string[]|string $queries Optional. The query to run. Can be multiple queries\n *                                 in an array, or a string of queries separated by\n *                                 semicolons. Default empty string.\n * @param bool            $execute Optional. Whether or not to execute the query right away.\n *                                 Default true.\n * @return array Strings containing the results of the various update queries.\n */\nfunction dbDelta( $queries = '', $execute = true ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid\n\tglobal $wpdb;\n\n\tif ( in_array( $queries, array( '', 'all', 'blog', 'global', 'ms_global' ), true ) ) {\n\t\t$queries = wp_get_db_schema( $queries );\n\t}\n\n\t// Separate individual queries into an array.\n\tif ( ! is_array( $queries ) ) {\n\t\t$queries = explode( ';', $queries );\n\t\t$queries = array_filter( $queries );\n\t}\n\n\t/**\n\t * Filters the dbDelta SQL queries.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string[] $queries An array of dbDelta SQL queries.\n\t */\n\t$queries = apply_filters( 'dbdelta_queries', $queries );\n\n\t$cqueries   = array(); // Creation queries.\n\t$iqueries   = array(); // Insertion queries.\n\t$for_update = array();\n\n\t// Create a tablename index for an array ($cqueries) of queries.\n\tforeach ( $queries as $qry ) {\n\t\tif ( preg_match( '|CREATE TABLE ([^ ]*)|', $qry, $matches ) ) {\n\t\t\t$cqueries[ trim( $matches[1], '`' ) ] = $qry;\n\t\t\t$for_update[ $matches[1] ]            = 'Created table ' . $matches[1];\n\t\t} elseif ( preg_match( '|CREATE DATABASE ([^ ]*)|', $qry, $matches ) ) {\n\t\t\tarray_unshift( $cqueries, $qry );\n\t\t} elseif ( preg_match( '|INSERT INTO ([^ ]*)|', $qry, $matches ) ) {\n\t\t\t$iqueries[] = $qry;\n\t\t} elseif ( preg_match( '|UPDATE ([^ ]*)|', $qry, $matches ) ) {\n\t\t\t$iqueries[] = $qry;\n\t\t} else {\n\t\t\t// Unrecognized query type.\n\t\t}\n\t}\n\n\t/**\n\t * Filters the dbDelta SQL queries for creating tables and/or databases.\n\t *\n\t * Queries filterable via this hook contain \"CREATE TABLE\" or \"CREATE DATABASE\".\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string[] $cqueries An array of dbDelta create SQL queries.\n\t */\n\t$cqueries = apply_filters( 'dbdelta_create_queries', $cqueries );\n\n\t/**\n\t * Filters the dbDelta SQL queries for inserting or updating.\n\t *\n\t * Queries filterable via this hook contain \"INSERT INTO\" or \"UPDATE\".\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string[] $iqueries An array of dbDelta insert or update SQL queries.\n\t */\n\t$iqueries = apply_filters( 'dbdelta_insert_queries', $iqueries );\n\n\t$text_fields = array( 'tinytext', 'text', 'mediumtext', 'longtext' );\n\t$blob_fields = array( 'tinyblob', 'blob', 'mediumblob', 'longblob' );\n\n\t$global_tables = $wpdb->tables( 'global' );\n\tforeach ( $cqueries as $table => $qry ) {\n\t\t// Upgrade global tables only for the main site. Don't upgrade at all if conditions are not optimal.\n\t\tif ( in_array( $table, $global_tables, true ) && ! wp_should_upgrade_global_tables() ) {\n\t\t\tunset( $cqueries[ $table ], $for_update[ $table ] );\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Fetch the table column structure from the database.\n\t\t$suppress    = $wpdb->suppress_errors();\n\t\t$tablefields = $wpdb->get_results( \"DESCRIBE {$table};\" );\n\t\t$wpdb->suppress_errors( $suppress );\n\n\t\tif ( ! $tablefields ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Clear the field and index arrays.\n\t\t$cfields                  = array();\n\t\t$indices                  = array();\n\t\t$indices_without_subparts = array();\n\n\t\t// Get all of the field names in the query from between the parentheses.\n\t\tpreg_match( '|\\((.*)\\)|ms', $qry, $match2 );\n\t\t$qryline = trim( $match2[1] );\n\n\t\t// Separate field lines into an array.\n\t\t$flds = explode( \"\\n\", $qryline );\n\n\t\t// For every field line specified in the query.\n\t\tforeach ( $flds as $fld ) {\n\t\t\t$fld = trim( $fld, \" \\t\\n\\r\\0\\x0B,\" ); // Default trim characters, plus ','.\n\n\t\t\t// Extract the field name.\n\t\t\tpreg_match( '|^([^ ]*)|', $fld, $fvals );\n\t\t\t$fieldname            = trim( $fvals[1], '`' );\n\t\t\t$fieldname_lowercased = strtolower( $fieldname );\n\n\t\t\t// Verify the found field name.\n\t\t\t$validfield = true;\n\t\t\tswitch ( $fieldname_lowercased ) {\n\t\t\t\tcase '':\n\t\t\t\tcase 'primary':\n\t\t\t\tcase 'index':\n\t\t\t\tcase 'fulltext':\n\t\t\t\tcase 'unique':\n\t\t\t\tcase 'key':\n\t\t\t\tcase 'spatial':\n\t\t\t\t\t$validfield = false;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Normalize the index definition.\n\t\t\t\t\t *\n\t\t\t\t\t * This is done so the definition can be compared against the result of a\n\t\t\t\t\t * `SHOW INDEX FROM $table_name` query which returns the current table\n\t\t\t\t\t * index information.\n\t\t\t\t\t */\n\n\t\t\t\t\t// Extract type, name and columns from the definition.\n\t\t\t\t\t// phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation\n\t\t\t\t\tpreg_match(\n\t\t\t\t\t\t'/^'\n\t\t\t\t\t\t.   '(?P<index_type>'             // 1) Type of the index.\n\t\t\t\t\t\t.       'PRIMARY\\s+KEY|(?:UNIQUE|FULLTEXT|SPATIAL)\\s+(?:KEY|INDEX)|KEY|INDEX'\n\t\t\t\t\t\t.   ')'\n\t\t\t\t\t\t.   '\\s+'                         // Followed by at least one white space character.\n\t\t\t\t\t\t.   '(?:'                         // Name of the index. Optional if type is PRIMARY KEY.\n\t\t\t\t\t\t.       '`?'                      // Name can be escaped with a backtick.\n\t\t\t\t\t\t.           '(?P<index_name>'     // 2) Name of the index.\n\t\t\t\t\t\t.               '(?:[0-9a-zA-Z$_-]|[\\xC2-\\xDF][\\x80-\\xBF])+'\n\t\t\t\t\t\t.           ')'\n\t\t\t\t\t\t.       '`?'                      // Name can be escaped with a backtick.\n\t\t\t\t\t\t.       '\\s+'                     // Followed by at least one white space character.\n\t\t\t\t\t\t.   ')*'\n\t\t\t\t\t\t.   '\\('                          // Opening bracket for the columns.\n\t\t\t\t\t\t.       '(?P<index_columns>'\n\t\t\t\t\t\t.           '.+?'                 // 3) Column names, index prefixes, and orders.\n\t\t\t\t\t\t.       ')'\n\t\t\t\t\t\t.   '\\)'                          // Closing bracket for the columns.\n\t\t\t\t\t\t. '$/im',\n\t\t\t\t\t\t$fld,\n\t\t\t\t\t\t$index_matches\n\t\t\t\t\t);\n\t\t\t\t\t// phpcs:enable\n\n\t\t\t\t\t// Uppercase the index type and normalize space characters.\n\t\t\t\t\t$index_type = strtoupper( preg_replace( '/\\s+/', ' ', trim( $index_matches['index_type'] ) ) );\n\n\t\t\t\t\t// 'INDEX' is a synonym for 'KEY', standardize on 'KEY'.\n\t\t\t\t\t$index_type = str_replace( 'INDEX', 'KEY', $index_type );\n\n\t\t\t\t\t// Escape the index name with backticks. An index for a primary key has no name.\n\t\t\t\t\t$index_name = ( 'PRIMARY KEY' === $index_type ) ? '' : '`' . strtolower( $index_matches['index_name'] ) . '`';\n\n\t\t\t\t\t// Parse the columns. Multiple columns are separated by a comma.\n\t\t\t\t\t$index_columns                  = array_map( 'trim', explode( ',', $index_matches['index_columns'] ) );\n\t\t\t\t\t$index_columns_without_subparts = $index_columns;\n\n\t\t\t\t\t// Normalize columns.\n\t\t\t\t\tforeach ( $index_columns as $id => &$index_column ) {\n\t\t\t\t\t\t// Extract column name and number of indexed characters (sub_part).\n\t\t\t\t\t\tpreg_match(\n\t\t\t\t\t\t\t'/'\n\t\t\t\t\t\t\t. '`?'                      // Name can be escaped with a backtick.\n\t\t\t\t\t\t\t. '(?P<column_name>'    // 1) Name of the column.\n\t\t\t\t\t\t\t. '(?:[0-9a-zA-Z$_-]|[\\xC2-\\xDF][\\x80-\\xBF])+'\n\t\t\t\t\t\t\t. ')'\n\t\t\t\t\t\t\t. '`?'                      // Name can be escaped with a backtick.\n\t\t\t\t\t\t\t. '(?:'                     // Optional sub part.\n\t\t\t\t\t\t\t. '\\s*'                 // Optional white space character between name and opening bracket.\n\t\t\t\t\t\t\t. '\\('                  // Opening bracket for the sub part.\n\t\t\t\t\t\t\t. '\\s*'             // Optional white space character after opening bracket.\n\t\t\t\t\t\t\t. '(?P<sub_part>'\n\t\t\t\t\t\t\t. '\\d+'         // 2) Number of indexed characters.\n\t\t\t\t\t\t\t. ')'\n\t\t\t\t\t\t\t. '\\s*'             // Optional white space character before closing bracket.\n\t\t\t\t\t\t\t. '\\)'                 // Closing bracket for the sub part.\n\t\t\t\t\t\t\t. ')?'\n\t\t\t\t\t\t\t. '/',\n\t\t\t\t\t\t\t$index_column,\n\t\t\t\t\t\t\t$index_column_matches\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Escape the column name with backticks.\n\t\t\t\t\t\t$index_column = '`' . $index_column_matches['column_name'] . '`';\n\n\t\t\t\t\t\t// We don't need to add the subpart to $index_columns_without_subparts\n\t\t\t\t\t\t$index_columns_without_subparts[ $id ] = $index_column;\n\n\t\t\t\t\t\t// Append the optional sup part with the number of indexed characters.\n\t\t\t\t\t\tif ( isset( $index_column_matches['sub_part'] ) ) {\n\t\t\t\t\t\t\t$index_column .= '(' . $index_column_matches['sub_part'] . ')';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Build the normalized index definition and add it to the list of indices.\n\t\t\t\t\t$indices[]                  = \"{$index_type} {$index_name} (\" . implode( ',', $index_columns ) . ')';\n\t\t\t\t\t$indices_without_subparts[] = \"{$index_type} {$index_name} (\" . implode( ',', $index_columns_without_subparts ) . ')';\n\n\t\t\t\t\t// Destroy no longer needed variables.\n\t\t\t\t\tunset( $index_column, $index_column_matches, $index_matches, $index_type, $index_name, $index_columns, $index_columns_without_subparts );\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// If it's a valid field, add it to the field array.\n\t\t\tif ( $validfield ) {\n\t\t\t\t$cfields[ $fieldname_lowercased ] = $fld;\n\t\t\t}\n\t\t}\n\n\t\t// For every field in the table.\n\t\tforeach ( $tablefields as $tablefield ) {\n\t\t\t$tablefield_field_lowercased = strtolower( $tablefield->Field );\n\t\t\t$tablefield_type_lowercased  = strtolower( $tablefield->Type );\n\n\t\t\t// If the table field exists in the field array...\n\t\t\tif ( array_key_exists( $tablefield_field_lowercased, $cfields ) ) {\n\n\t\t\t\t// Get the field type from the query.\n\t\t\t\tpreg_match( '|`?' . $tablefield->Field . '`? ([^ ]*( unsigned)?)|i', $cfields[ $tablefield_field_lowercased ], $matches );\n\t\t\t\t$fieldtype            = $matches[1];\n\t\t\t\t$fieldtype_lowercased = strtolower( $fieldtype );\n\n\t\t\t\t// Is actual field type different from the field type in query?\n\t\t\t\tif ( $tablefield->Type != $fieldtype ) {\n\t\t\t\t\t$do_change = true;\n\t\t\t\t\tif ( in_array( $fieldtype_lowercased, $text_fields, true ) && in_array( $tablefield_type_lowercased, $text_fields, true ) ) {\n\t\t\t\t\t\tif ( array_search( $fieldtype_lowercased, $text_fields, true ) < array_search( $tablefield_type_lowercased, $text_fields, true ) ) {\n\t\t\t\t\t\t\t$do_change = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( in_array( $fieldtype_lowercased, $blob_fields, true ) && in_array( $tablefield_type_lowercased, $blob_fields, true ) ) {\n\t\t\t\t\t\tif ( array_search( $fieldtype_lowercased, $blob_fields, true ) < array_search( $tablefield_type_lowercased, $blob_fields, true ) ) {\n\t\t\t\t\t\t\t$do_change = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $do_change ) {\n\t\t\t\t\t\t// Add a query to change the column type.\n\t\t\t\t\t\t$cqueries[] = \"ALTER TABLE {$table} CHANGE COLUMN `{$tablefield->Field}` \" . $cfields[ $tablefield_field_lowercased ];\n\n\t\t\t\t\t\t$for_update[ $table . '.' . $tablefield->Field ] = \"Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Get the default value from the array.\n\t\t\t\tif ( preg_match( \"| DEFAULT '(.*?)'|i\", $cfields[ $tablefield_field_lowercased ], $matches ) ) {\n\t\t\t\t\t$default_value = $matches[1];\n\t\t\t\t\tif ( $tablefield->Default != $default_value ) {\n\t\t\t\t\t\t// Add a query to change the column's default value\n\t\t\t\t\t\t$cqueries[] = \"ALTER TABLE {$table} ALTER COLUMN `{$tablefield->Field}` SET DEFAULT '{$default_value}'\";\n\n\t\t\t\t\t\t$for_update[ $table . '.' . $tablefield->Field ] = \"Changed default value of {$table}.{$tablefield->Field} from {$tablefield->Default} to {$default_value}\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Remove the field from the array (so it's not added).\n\t\t\t\tunset( $cfields[ $tablefield_field_lowercased ] );\n\t\t\t} else {\n\t\t\t\t// This field exists in the table, but not in the creation queries?\n\t\t\t}\n\t\t}\n\n\t\t// For every remaining field specified for the table.\n\t\tforeach ( $cfields as $fieldname => $fielddef ) {\n\t\t\t// Push a query line into $cqueries that adds the field to that table.\n\t\t\t$cqueries[] = \"ALTER TABLE {$table} ADD COLUMN $fielddef\";\n\n\t\t\t$for_update[ $table . '.' . $fieldname ] = 'Added column ' . $table . '.' . $fieldname;\n\t\t}\n\n\t\t// Index stuff goes here. Fetch the table index structure from the database.\n\t\t$tableindices = $wpdb->get_results( \"SHOW INDEX FROM {$table};\" );\n\n\t\tif ( $tableindices ) {\n\t\t\t// Clear the index array.\n\t\t\t$index_ary = array();\n\n\t\t\t// For every index in the table.\n\t\t\tforeach ( $tableindices as $tableindex ) {\n\t\t\t\t$keyname = strtolower( $tableindex->Key_name );\n\n\t\t\t\t// Add the index to the index data array.\n\t\t\t\t$index_ary[ $keyname ]['columns'][]  = array(\n\t\t\t\t\t'fieldname' => $tableindex->Column_name,\n\t\t\t\t\t'subpart'   => $tableindex->Sub_part,\n\t\t\t\t);\n\t\t\t\t$index_ary[ $keyname ]['unique']     = ( 0 == $tableindex->Non_unique ) ? true : false;\n\t\t\t\t$index_ary[ $keyname ]['index_type'] = $tableindex->Index_type;\n\t\t\t}\n\n\t\t\t// For each actual index in the index array.\n\t\t\tforeach ( $index_ary as $index_name => $index_data ) {\n\n\t\t\t\t// Build a create string to compare to the query.\n\t\t\t\t$index_string = '';\n\t\t\t\tif ( 'primary' === $index_name ) {\n\t\t\t\t\t$index_string .= 'PRIMARY ';\n\t\t\t\t} elseif ( $index_data['unique'] ) {\n\t\t\t\t\t$index_string .= 'UNIQUE ';\n\t\t\t\t}\n\t\t\t\tif ( 'FULLTEXT' === strtoupper( $index_data['index_type'] ) ) {\n\t\t\t\t\t$index_string .= 'FULLTEXT ';\n\t\t\t\t}\n\t\t\t\tif ( 'SPATIAL' === strtoupper( $index_data['index_type'] ) ) {\n\t\t\t\t\t$index_string .= 'SPATIAL ';\n\t\t\t\t}\n\t\t\t\t$index_string .= 'KEY ';\n\t\t\t\tif ( 'primary' !== $index_name ) {\n\t\t\t\t\t$index_string .= '`' . $index_name . '`';\n\t\t\t\t}\n\t\t\t\t$index_columns = '';\n\n\t\t\t\t// For each column in the index.\n\t\t\t\tforeach ( $index_data['columns'] as $column_data ) {\n\t\t\t\t\tif ( '' !== $index_columns ) {\n\t\t\t\t\t\t$index_columns .= ',';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add the field to the column list string.\n\t\t\t\t\t$index_columns .= '`' . $column_data['fieldname'] . '`';\n\t\t\t\t}\n\n\t\t\t\t// Add the column list to the index create string.\n\t\t\t\t$index_string .= \" ($index_columns)\";\n\n\t\t\t\t// Check if the index definition exists, ignoring subparts.\n\t\t\t\t$aindex = array_search( $index_string, $indices_without_subparts, true );\n\t\t\t\tif ( false !== $aindex ) {\n\t\t\t\t\t// If the index already exists (even with different subparts), we don't need to create it.\n\t\t\t\t\tunset( $indices_without_subparts[ $aindex ] );\n\t\t\t\t\tunset( $indices[ $aindex ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// For every remaining index specified for the table.\n\t\tforeach ( (array) $indices as $index ) {\n\t\t\t// Push a query line into $cqueries that adds the index to that table.\n\t\t\t$cqueries[] = \"ALTER TABLE {$table} ADD $index\";\n\n\t\t\t$for_update[] = 'Added index ' . $table . ' ' . $index;\n\t\t}\n\n\t\t// Remove the original table creation query from processing.\n\t\tunset( $cqueries[ $table ], $for_update[ $table ] );\n\t}\n\n\t$allqueries = array_merge( $cqueries, $iqueries );\n\tif ( $execute ) {\n\t\tforeach ( $allqueries as $query ) {\n\t\t\t$wpdb->query( $query );\n\t\t}\n\t}\n\n\treturn $for_update;\n}\n\n/**\n * Updates the database tables to a new schema.\n *\n * By default, updates all the tables to use the latest defined schema, but can also\n * be used to update a specific set of tables in wp_get_db_schema().\n *\n * @since 1.5.0\n *\n * @uses dbDelta\n *\n * @param string $tables Optional. Which set of tables to update. Default is 'all'.\n */\nfunction make_db_current( $tables = 'all' ) {\n\t$alterations = dbDelta( $tables );\n\techo \"<ol>\\n\";\n\tforeach ( $alterations as $alteration ) {\n\t\techo \"<li>$alteration</li>\\n\";\n\t}\n\techo \"</ol>\\n\";\n}\n\n/**\n * Updates the database tables to a new schema, but without displaying results.\n *\n * By default, updates all the tables to use the latest defined schema, but can\n * also be used to update a specific set of tables in wp_get_db_schema().\n *\n * @since 1.5.0\n *\n * @see make_db_current()\n *\n * @param string $tables Optional. Which set of tables to update. Default is 'all'.\n */\nfunction make_db_current_silent( $tables = 'all' ) {\n\tdbDelta( $tables );\n}\n\n/**\n * Creates a site theme from an existing theme.\n *\n * {@internal Missing Long Description}}\n *\n * @since 1.5.0\n *\n * @param string $theme_name The name of the theme.\n * @param string $template   The directory name of the theme.\n * @return bool\n */\nfunction make_site_theme_from_oldschool( $theme_name, $template ) {\n\t$home_path = get_home_path();\n\t$site_dir  = WP_CONTENT_DIR . \"/themes/$template\";\n\n\tif ( ! file_exists( \"$home_path/index.php\" ) ) {\n\t\treturn false;\n\t}\n\n\t/*\n\t * Copy files from the old locations to the site theme.\n\t * TODO: This does not copy arbitrary include dependencies. Only the standard WP files are copied.\n\t */\n\t$files = array(\n\t\t'index.php'             => 'index.php',\n\t\t'wp-layout.css'         => 'style.css',\n\t\t'wp-comments.php'       => 'comments.php',\n\t\t'wp-comments-popup.php' => 'comments-popup.php',\n\t);\n\n\tforeach ( $files as $oldfile => $newfile ) {\n\t\tif ( 'index.php' === $oldfile ) {\n\t\t\t$oldpath = $home_path;\n\t\t} else {\n\t\t\t$oldpath = ABSPATH;\n\t\t}\n\n\t\t// Check to make sure it's not a new index.\n\t\tif ( 'index.php' === $oldfile ) {\n\t\t\t$index = implode( '', file( \"$oldpath/$oldfile\" ) );\n\t\t\tif ( strpos( $index, 'WP_USE_THEMES' ) !== false ) {\n\t\t\t\tif ( ! copy( WP_CONTENT_DIR . '/themes/' . WP_DEFAULT_THEME . '/index.php', \"$site_dir/$newfile\" ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Don't copy anything.\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! copy( \"$oldpath/$oldfile\", \"$site_dir/$newfile\" ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tchmod( \"$site_dir/$newfile\", 0777 );\n\n\t\t// Update the blog header include in each file.\n\t\t$lines = explode( \"\\n\", implode( '', file( \"$site_dir/$newfile\" ) ) );\n\t\tif ( $lines ) {\n\t\t\t$f = fopen( \"$site_dir/$newfile\", 'w' );\n\n\t\t\tforeach ( $lines as $line ) {\n\t\t\t\tif ( preg_match( '/require.*wp-blog-header/', $line ) ) {\n\t\t\t\t\t$line = '//' . $line;\n\t\t\t\t}\n\n\t\t\t\t// Update stylesheet references.\n\t\t\t\t$line = str_replace( \"<?php echo __get_option('siteurl'); ?>/wp-layout.css\", \"<?php bloginfo('stylesheet_url'); ?>\", $line );\n\n\t\t\t\t// Update comments template inclusion.\n\t\t\t\t$line = str_replace( \"<?php include(ABSPATH . 'wp-comments.php'); ?>\", '<?php comments_template(); ?>', $line );\n\n\t\t\t\tfwrite( $f, \"{$line}\\n\" );\n\t\t\t}\n\t\t\tfclose( $f );\n\t\t}\n\t}\n\n\t// Add a theme header.\n\t$header = \"/*\\nTheme Name: $theme_name\\nTheme URI: \" . __get_option( 'siteurl' ) . \"\\nDescription: A theme automatically created by the update.\\nVersion: 1.0\\nAuthor: Moi\\n*/\\n\";\n\n\t$stylelines = file_get_contents( \"$site_dir/style.css\" );\n\tif ( $stylelines ) {\n\t\t$f = fopen( \"$site_dir/style.css\", 'w' );\n\n\t\tfwrite( $f, $header );\n\t\tfwrite( $f, $stylelines );\n\t\tfclose( $f );\n\t}\n\n\treturn true;\n}\n\n/**\n * Creates a site theme from the default theme.\n *\n * {@internal Missing Long Description}}\n *\n * @since 1.5.0\n *\n * @param string $theme_name The name of the theme.\n * @param string $template   The directory name of the theme.\n * @return void|false\n */\nfunction make_site_theme_from_default( $theme_name, $template ) {\n\t$site_dir    = WP_CONTENT_DIR . \"/themes/$template\";\n\t$default_dir = WP_CONTENT_DIR . '/themes/' . WP_DEFAULT_THEME;\n\n\t// Copy files from the default theme to the site theme.\n\t// $files = array( 'index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css' );\n\n\t$theme_dir = @opendir( $default_dir );\n\tif ( $theme_dir ) {\n\t\twhile ( ( $theme_file = readdir( $theme_dir ) ) !== false ) {\n\t\t\tif ( is_dir( \"$default_dir/$theme_file\" ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( ! copy( \"$default_dir/$theme_file\", \"$site_dir/$theme_file\" ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tchmod( \"$site_dir/$theme_file\", 0777 );\n\t\t}\n\n\t\tclosedir( $theme_dir );\n\t}\n\n\t// Rewrite the theme header.\n\t$stylelines = explode( \"\\n\", implode( '', file( \"$site_dir/style.css\" ) ) );\n\tif ( $stylelines ) {\n\t\t$f = fopen( \"$site_dir/style.css\", 'w' );\n\n\t\tforeach ( $stylelines as $line ) {\n\t\t\tif ( strpos( $line, 'Theme Name:' ) !== false ) {\n\t\t\t\t$line = 'Theme Name: ' . $theme_name;\n\t\t\t} elseif ( strpos( $line, 'Theme URI:' ) !== false ) {\n\t\t\t\t$line = 'Theme URI: ' . __get_option( 'url' );\n\t\t\t} elseif ( strpos( $line, 'Description:' ) !== false ) {\n\t\t\t\t$line = 'Description: Your theme.';\n\t\t\t} elseif ( strpos( $line, 'Version:' ) !== false ) {\n\t\t\t\t$line = 'Version: 1';\n\t\t\t} elseif ( strpos( $line, 'Author:' ) !== false ) {\n\t\t\t\t$line = 'Author: You';\n\t\t\t}\n\t\t\tfwrite( $f, $line . \"\\n\" );\n\t\t}\n\t\tfclose( $f );\n\t}\n\n\t// Copy the images.\n\tumask( 0 );\n\tif ( ! mkdir( \"$site_dir/images\", 0777 ) ) {\n\t\treturn false;\n\t}\n\n\t$images_dir = @opendir( \"$default_dir/images\" );\n\tif ( $images_dir ) {\n\t\twhile ( ( $image = readdir( $images_dir ) ) !== false ) {\n\t\t\tif ( is_dir( \"$default_dir/images/$image\" ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( ! copy( \"$default_dir/images/$image\", \"$site_dir/images/$image\" ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tchmod( \"$site_dir/images/$image\", 0777 );\n\t\t}\n\n\t\tclosedir( $images_dir );\n\t}\n}\n\n/**\n * Creates a site theme.\n *\n * {@internal Missing Long Description}}\n *\n * @since 1.5.0\n *\n * @return string|false\n */\nfunction make_site_theme() {\n\t// Name the theme after the blog.\n\t$theme_name = __get_option( 'blogname' );\n\t$template   = sanitize_title( $theme_name );\n\t$site_dir   = WP_CONTENT_DIR . \"/themes/$template\";\n\n\t// If the theme already exists, nothing to do.\n\tif ( is_dir( $site_dir ) ) {\n\t\treturn false;\n\t}\n\n\t// We must be able to write to the themes dir.\n\tif ( ! is_writable( WP_CONTENT_DIR . '/themes' ) ) {\n\t\treturn false;\n\t}\n\n\tumask( 0 );\n\tif ( ! mkdir( $site_dir, 0777 ) ) {\n\t\treturn false;\n\t}\n\n\tif ( file_exists( ABSPATH . 'wp-layout.css' ) ) {\n\t\tif ( ! make_site_theme_from_oldschool( $theme_name, $template ) ) {\n\t\t\t// TODO: rm -rf the site theme directory.\n\t\t\treturn false;\n\t\t}\n\t} else {\n\t\tif ( ! make_site_theme_from_default( $theme_name, $template ) ) {\n\t\t\t// TODO: rm -rf the site theme directory.\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Make the new site theme active.\n\t$current_template = __get_option( 'template' );\n\tif ( WP_DEFAULT_THEME == $current_template ) {\n\t\tupdate_option( 'template', $template );\n\t\tupdate_option( 'stylesheet', $template );\n\t}\n\treturn $template;\n}\n\n/**\n * Translate user level to user role name.\n *\n * @since 2.0.0\n *\n * @param int $level User level.\n * @return string User role name.\n */\nfunction translate_level_to_role( $level ) {\n\tswitch ( $level ) {\n\t\tcase 10:\n\t\tcase 9:\n\t\tcase 8:\n\t\t\treturn 'administrator';\n\t\tcase 7:\n\t\tcase 6:\n\t\tcase 5:\n\t\t\treturn 'editor';\n\t\tcase 4:\n\t\tcase 3:\n\t\tcase 2:\n\t\t\treturn 'author';\n\t\tcase 1:\n\t\t\treturn 'contributor';\n\t\tcase 0:\n\t\tdefault:\n\t\t\treturn 'subscriber';\n\t}\n}\n\n/**\n * Checks the version of the installed MySQL binary.\n *\n * @since 2.1.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction wp_check_mysql_version() {\n\tglobal $wpdb;\n\t$result = $wpdb->check_database_version();\n\tif ( is_wp_error( $result ) ) {\n\t\twp_die( $result );\n\t}\n}\n\n/**\n * Disables the Automattic widgets plugin, which was merged into core.\n *\n * @since 2.2.0\n */\nfunction maybe_disable_automattic_widgets() {\n\t$plugins = __get_option( 'active_plugins' );\n\n\tforeach ( (array) $plugins as $plugin ) {\n\t\tif ( 'widgets.php' === basename( $plugin ) ) {\n\t\t\tarray_splice( $plugins, array_search( $plugin, $plugins, true ), 1 );\n\t\t\tupdate_option( 'active_plugins', $plugins );\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n/**\n * Disables the Link Manager on upgrade if, at the time of upgrade, no links exist in the DB.\n *\n * @since 3.5.0\n *\n * @global int  $wp_current_db_version The old (current) database version.\n * @global wpdb $wpdb                  WordPress database abstraction object.\n */\nfunction maybe_disable_link_manager() {\n\tglobal $wp_current_db_version, $wpdb;\n\n\tif ( $wp_current_db_version >= 22006 && get_option( 'link_manager_enabled' ) && ! $wpdb->get_var( \"SELECT link_id FROM $wpdb->links LIMIT 1\" ) ) {\n\t\tupdate_option( 'link_manager_enabled', 0 );\n\t}\n}\n\n/**\n * Runs before the schema is upgraded.\n *\n * @since 2.9.0\n *\n * @global int  $wp_current_db_version The old (current) database version.\n * @global wpdb $wpdb                  WordPress database abstraction object.\n */\nfunction pre_schema_upgrade() {\n\tglobal $wp_current_db_version, $wpdb;\n\n\t// Upgrade versions prior to 2.9.\n\tif ( $wp_current_db_version < 11557 ) {\n\t\t// Delete duplicate options. Keep the option with the highest option_id.\n\t\t$wpdb->query( \"DELETE o1 FROM $wpdb->options AS o1 JOIN $wpdb->options AS o2 USING (`option_name`) WHERE o2.option_id > o1.option_id\" );\n\n\t\t// Drop the old primary key and add the new.\n\t\t$wpdb->query( \"ALTER TABLE $wpdb->options DROP PRIMARY KEY, ADD PRIMARY KEY(option_id)\" );\n\n\t\t// Drop the old option_name index. dbDelta() doesn't do the drop.\n\t\t$wpdb->query( \"ALTER TABLE $wpdb->options DROP INDEX option_name\" );\n\t}\n\n\t// Multisite schema upgrades.\n\tif ( $wp_current_db_version < 25448 && is_multisite() && wp_should_upgrade_global_tables() ) {\n\n\t\t// Upgrade versions prior to 3.7.\n\t\tif ( $wp_current_db_version < 25179 ) {\n\t\t\t// New primary key for signups.\n\t\t\t$wpdb->query( \"ALTER TABLE $wpdb->signups ADD signup_id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST\" );\n\t\t\t$wpdb->query( \"ALTER TABLE $wpdb->signups DROP INDEX domain\" );\n\t\t}\n\n\t\tif ( $wp_current_db_version < 25448 ) {\n\t\t\t// Convert archived from enum to tinyint.\n\t\t\t$wpdb->query( \"ALTER TABLE $wpdb->blogs CHANGE COLUMN archived archived varchar(1) NOT NULL default '0'\" );\n\t\t\t$wpdb->query( \"ALTER TABLE $wpdb->blogs CHANGE COLUMN archived archived tinyint(2) NOT NULL default 0\" );\n\t\t}\n\t}\n\n\t// Upgrade versions prior to 4.2.\n\tif ( $wp_current_db_version < 31351 ) {\n\t\tif ( ! is_multisite() && wp_should_upgrade_global_tables() ) {\n\t\t\t$wpdb->query( \"ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))\" );\n\t\t}\n\t\t$wpdb->query( \"ALTER TABLE $wpdb->terms DROP INDEX slug, ADD INDEX slug(slug(191))\" );\n\t\t$wpdb->query( \"ALTER TABLE $wpdb->terms DROP INDEX name, ADD INDEX name(name(191))\" );\n\t\t$wpdb->query( \"ALTER TABLE $wpdb->commentmeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))\" );\n\t\t$wpdb->query( \"ALTER TABLE $wpdb->postmeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))\" );\n\t\t$wpdb->query( \"ALTER TABLE $wpdb->posts DROP INDEX post_name, ADD INDEX post_name(post_name(191))\" );\n\t}\n\n\t// Upgrade versions prior to 4.4.\n\tif ( $wp_current_db_version < 34978 ) {\n\t\t// If compatible termmeta table is found, use it, but enforce a proper index and update collation.\n\t\tif ( $wpdb->get_var( \"SHOW TABLES LIKE '{$wpdb->termmeta}'\" ) && $wpdb->get_results( \"SHOW INDEX FROM {$wpdb->termmeta} WHERE Column_name = 'meta_key'\" ) ) {\n\t\t\t$wpdb->query( \"ALTER TABLE $wpdb->termmeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))\" );\n\t\t\tmaybe_convert_table_to_utf8mb4( $wpdb->termmeta );\n\t\t}\n\t}\n}\n\nif ( ! function_exists( 'install_global_terms' ) ) :\n\t/**\n\t * Install global terms.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @global wpdb   $wpdb            WordPress database abstraction object.\n\t * @global string $charset_collate\n\t */\n\tfunction install_global_terms() {\n\t\tglobal $wpdb, $charset_collate;\n\t\t$ms_queries = \"\nCREATE TABLE $wpdb->sitecategories (\n  cat_ID bigint(20) NOT NULL auto_increment,\n  cat_name varchar(55) NOT NULL default '',\n  category_nicename varchar(200) NOT NULL default '',\n  last_updated timestamp NOT NULL,\n  PRIMARY KEY  (cat_ID),\n  KEY category_nicename (category_nicename),\n  KEY last_updated (last_updated)\n) $charset_collate;\n\";\n\t\t// Now create tables.\n\t\tdbDelta( $ms_queries );\n\t}\nendif;\n\n/**\n * Determine if global tables should be upgraded.\n *\n * This function performs a series of checks to ensure the environment allows\n * for the safe upgrading of global WordPress database tables. It is necessary\n * because global tables will commonly grow to millions of rows on large\n * installations, and the ability to control their upgrade routines can be\n * critical to the operation of large networks.\n *\n * In a future iteration, this function may use `wp_is_large_network()` to more-\n * intelligently prevent global table upgrades. Until then, we make sure\n * WordPress is on the main site of the main network, to avoid running queries\n * more than once in multi-site or multi-network environments.\n *\n * @since 4.3.0\n *\n * @return bool Whether to run the upgrade routines on global tables.\n */\nfunction wp_should_upgrade_global_tables() {\n\n\t// Return false early if explicitly not upgrading.\n\tif ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {\n\t\treturn false;\n\t}\n\n\t// Assume global tables should be upgraded.\n\t$should_upgrade = true;\n\n\t// Set to false if not on main network (does not matter if not multi-network).\n\tif ( ! is_main_network() ) {\n\t\t$should_upgrade = false;\n\t}\n\n\t// Set to false if not on main site of current network (does not matter if not multi-site).\n\tif ( ! is_main_site() ) {\n\t\t$should_upgrade = false;\n\t}\n\n\t/**\n\t * Filters if upgrade routines should be run on global tables.\n\t *\n\t * @param bool $should_upgrade Whether to run the upgrade routines on global tables.\n\t */\n\treturn apply_filters( 'wp_should_upgrade_global_tables', $should_upgrade );\n}\n", "num_lines": 3463}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress user administration API.\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Creates a new user from the \"Users\" form using $_POST information.\n *\n * @since 2.0.0\n *\n * @return int|WP_Error WP_Error or User ID.\n */\nfunction add_user() {\n\treturn edit_user();\n}\n\n/**\n * Edit user settings based on contents of $_POST\n *\n * Used on user-edit.php and profile.php to manage and process user options, passwords etc.\n *\n * @since 2.0.0\n *\n * @param int $user_id Optional. User ID.\n * @return int|WP_Error User ID of the updated user.\n */\nfunction edit_user( $user_id = 0 ) {\n\t$wp_roles = wp_roles();\n\t$user     = new stdClass;\n\t$user_id  = (int) $user_id;\n\tif ( $user_id ) {\n\t\t$update           = true;\n\t\t$user->ID         = $user_id;\n\t\t$userdata         = get_userdata( $user_id );\n\t\t$user->user_login = wp_slash( $userdata->user_login );\n\t} else {\n\t\t$update = false;\n\t}\n\n\tif ( ! $update && isset( $_POST['user_login'] ) ) {\n\t\t$user->user_login = sanitize_user( wp_unslash( $_POST['user_login'] ), true );\n\t}\n\n\t$pass1 = '';\n\t$pass2 = '';\n\tif ( isset( $_POST['pass1'] ) ) {\n\t\t$pass1 = $_POST['pass1'];\n\t}\n\tif ( isset( $_POST['pass2'] ) ) {\n\t\t$pass2 = $_POST['pass2'];\n\t}\n\n\tif ( isset( $_POST['role'] ) && current_user_can( 'promote_users' ) && ( ! $user_id || current_user_can( 'promote_user', $user_id ) ) ) {\n\t\t$new_role = sanitize_text_field( $_POST['role'] );\n\n\t\t// If the new role isn't editable by the logged-in user die with error.\n\t\t$editable_roles = get_editable_roles();\n\t\tif ( ! empty( $new_role ) && empty( $editable_roles[ $new_role ] ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 );\n\t\t}\n\n\t\t$potential_role = isset( $wp_roles->role_objects[ $new_role ] ) ? $wp_roles->role_objects[ $new_role ] : false;\n\n\t\t/*\n\t\t * Don't let anyone with 'promote_users' edit their own role to something without it.\n\t\t * Multisite super admins can freely edit their roles, they possess all caps.\n\t\t */\n\t\tif (\n\t\t\t( is_multisite() && current_user_can( 'manage_network_users' ) ) ||\n\t\t\tget_current_user_id() !== $user_id ||\n\t\t\t( $potential_role && $potential_role->has_cap( 'promote_users' ) )\n\t\t) {\n\t\t\t$user->role = $new_role;\n\t\t}\n\t}\n\n\tif ( isset( $_POST['email'] ) ) {\n\t\t$user->user_email = sanitize_text_field( wp_unslash( $_POST['email'] ) );\n\t}\n\tif ( isset( $_POST['url'] ) ) {\n\t\tif ( empty( $_POST['url'] ) || 'http://' === $_POST['url'] ) {\n\t\t\t$user->user_url = '';\n\t\t} else {\n\t\t\t$user->user_url = esc_url_raw( $_POST['url'] );\n\t\t\t$protocols      = implode( '|', array_map( 'preg_quote', wp_allowed_protocols() ) );\n\t\t\t$user->user_url = preg_match( '/^(' . $protocols . '):/is', $user->user_url ) ? $user->user_url : 'http://' . $user->user_url;\n\t\t}\n\t}\n\tif ( isset( $_POST['first_name'] ) ) {\n\t\t$user->first_name = sanitize_text_field( $_POST['first_name'] );\n\t}\n\tif ( isset( $_POST['last_name'] ) ) {\n\t\t$user->last_name = sanitize_text_field( $_POST['last_name'] );\n\t}\n\tif ( isset( $_POST['nickname'] ) ) {\n\t\t$user->nickname = sanitize_text_field( $_POST['nickname'] );\n\t}\n\tif ( isset( $_POST['display_name'] ) ) {\n\t\t$user->display_name = sanitize_text_field( $_POST['display_name'] );\n\t}\n\n\tif ( isset( $_POST['description'] ) ) {\n\t\t$user->description = trim( $_POST['description'] );\n\t}\n\n\tforeach ( wp_get_user_contact_methods( $user ) as $method => $name ) {\n\t\tif ( isset( $_POST[ $method ] ) ) {\n\t\t\t$user->$method = sanitize_text_field( $_POST[ $method ] );\n\t\t}\n\t}\n\n\tif ( isset( $_POST['locale'] ) ) {\n\t\t$locale = sanitize_text_field( $_POST['locale'] );\n\t\tif ( 'site-default' === $locale ) {\n\t\t\t$locale = '';\n\t\t} elseif ( '' === $locale ) {\n\t\t\t$locale = 'en_US';\n\t\t} elseif ( ! in_array( $locale, get_available_languages(), true ) ) {\n\t\t\t$locale = '';\n\t\t}\n\n\t\t$user->locale = $locale;\n\t}\n\n\tif ( $update ) {\n\t\t$user->rich_editing         = isset( $_POST['rich_editing'] ) && 'false' === $_POST['rich_editing'] ? 'false' : 'true';\n\t\t$user->syntax_highlighting  = isset( $_POST['syntax_highlighting'] ) && 'false' === $_POST['syntax_highlighting'] ? 'false' : 'true';\n\t\t$user->admin_color          = isset( $_POST['admin_color'] ) ? sanitize_text_field( $_POST['admin_color'] ) : 'fresh';\n\t\t$user->show_admin_bar_front = isset( $_POST['admin_bar_front'] ) ? 'true' : 'false';\n\t}\n\n\t$user->comment_shortcuts = isset( $_POST['comment_shortcuts'] ) && 'true' === $_POST['comment_shortcuts'] ? 'true' : '';\n\n\t$user->use_ssl = 0;\n\tif ( ! empty( $_POST['use_ssl'] ) ) {\n\t\t$user->use_ssl = 1;\n\t}\n\n\t$errors = new WP_Error();\n\n\t/* checking that username has been typed */\n\tif ( '' === $user->user_login ) {\n\t\t$errors->add( 'user_login', __( '<strong>Error</strong>: Please enter a username.' ) );\n\t}\n\n\t/* checking that nickname has been typed */\n\tif ( $update && empty( $user->nickname ) ) {\n\t\t$errors->add( 'nickname', __( '<strong>Error</strong>: Please enter a nickname.' ) );\n\t}\n\n\t/**\n\t * Fires before the password and confirm password fields are checked for congruity.\n\t *\n\t * @since 1.5.1\n\t *\n\t * @param string $user_login The username.\n\t * @param string $pass1     The password (passed by reference).\n\t * @param string $pass2     The confirmed password (passed by reference).\n\t */\n\tdo_action_ref_array( 'check_passwords', array( $user->user_login, &$pass1, &$pass2 ) );\n\n\t// Check for blank password when adding a user.\n\tif ( ! $update && empty( $pass1 ) ) {\n\t\t$errors->add( 'pass', __( '<strong>Error</strong>: Please enter a password.' ), array( 'form-field' => 'pass1' ) );\n\t}\n\n\t// Check for \"\\\" in password.\n\tif ( false !== strpos( wp_unslash( $pass1 ), '\\\\' ) ) {\n\t\t$errors->add( 'pass', __( '<strong>Error</strong>: Passwords may not contain the character \"\\\\\".' ), array( 'form-field' => 'pass1' ) );\n\t}\n\n\t// Checking the password has been typed twice the same.\n\tif ( ( $update || ! empty( $pass1 ) ) && $pass1 != $pass2 ) {\n\t\t$errors->add( 'pass', __( '<strong>Error</strong>: Passwords don&#8217;t match. Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) );\n\t}\n\n\tif ( ! empty( $pass1 ) ) {\n\t\t$user->user_pass = $pass1;\n\t}\n\n\tif ( ! $update && isset( $_POST['user_login'] ) && ! validate_username( $_POST['user_login'] ) ) {\n\t\t$errors->add( 'user_login', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );\n\t}\n\n\tif ( ! $update && username_exists( $user->user_login ) ) {\n\t\t$errors->add( 'user_login', __( '<strong>Error</strong>: This username is already registered. Please choose another one.' ) );\n\t}\n\n\t/** This filter is documented in wp-includes/user.php */\n\t$illegal_logins = (array) apply_filters( 'illegal_user_logins', array() );\n\n\tif ( in_array( strtolower( $user->user_login ), array_map( 'strtolower', $illegal_logins ), true ) ) {\n\t\t$errors->add( 'invalid_username', __( '<strong>Error</strong>: Sorry, that username is not allowed.' ) );\n\t}\n\n\t/* checking email address */\n\tif ( empty( $user->user_email ) ) {\n\t\t$errors->add( 'empty_email', __( '<strong>Error</strong>: Please enter an email address.' ), array( 'form-field' => 'email' ) );\n\t} elseif ( ! is_email( $user->user_email ) ) {\n\t\t$errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address isn&#8217;t correct.' ), array( 'form-field' => 'email' ) );\n\t} else {\n\t\t$owner_id = email_exists( $user->user_email );\n\t\tif ( $owner_id && ( ! $update || ( $owner_id != $user->ID ) ) ) {\n\t\t\t$errors->add( 'email_exists', __( '<strong>Error</strong>: This email is already registered. Please choose another one.' ), array( 'form-field' => 'email' ) );\n\t\t}\n\t}\n\n\t/**\n\t * Fires before user profile update errors are returned.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param WP_Error $errors WP_Error object (passed by reference).\n\t * @param bool     $update Whether this is a user update.\n\t * @param stdClass $user   User object (passed by reference).\n\t */\n\tdo_action_ref_array( 'user_profile_update_errors', array( &$errors, $update, &$user ) );\n\n\tif ( $errors->has_errors() ) {\n\t\treturn $errors;\n\t}\n\n\tif ( $update ) {\n\t\t$user_id = wp_update_user( $user );\n\t} else {\n\t\t$user_id = wp_insert_user( $user );\n\t\t$notify  = isset( $_POST['send_user_notification'] ) ? 'both' : 'admin';\n\n\t\t/**\n\t\t * Fires after a new user has been created.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param int    $user_id ID of the newly created user.\n\t\t * @param string $notify  Type of notification that should happen. See wp_send_new_user_notifications()\n\t\t *                        for more information on possible values.\n\t\t */\n\t\tdo_action( 'edit_user_created_user', $user_id, $notify );\n\t}\n\treturn $user_id;\n}\n\n/**\n * Fetch a filtered list of user roles that the current user is\n * allowed to edit.\n *\n * Simple function whose main purpose is to allow filtering of the\n * list of roles in the $wp_roles object so that plugins can remove\n * inappropriate ones depending on the situation or user making edits.\n * Specifically because without filtering anyone with the edit_users\n * capability can edit others to be administrators, even if they are\n * only editors or authors. This filter allows admins to delegate\n * user management.\n *\n * @since 2.8.0\n *\n * @return array[] Array of arrays containing role information.\n */\nfunction get_editable_roles() {\n\t$all_roles = wp_roles()->roles;\n\n\t/**\n\t * Filters the list of editable roles.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array[] $all_roles Array of arrays containing role information.\n\t */\n\t$editable_roles = apply_filters( 'editable_roles', $all_roles );\n\n\treturn $editable_roles;\n}\n\n/**\n * Retrieve user data and filter it.\n *\n * @since 2.0.5\n *\n * @param int $user_id User ID.\n * @return WP_User|bool WP_User object on success, false on failure.\n */\nfunction get_user_to_edit( $user_id ) {\n\t$user = get_userdata( $user_id );\n\n\tif ( $user ) {\n\t\t$user->filter = 'edit';\n\t}\n\n\treturn $user;\n}\n\n/**\n * Retrieve the user's drafts.\n *\n * @since 2.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int $user_id User ID.\n * @return array\n */\nfunction get_users_drafts( $user_id ) {\n\tglobal $wpdb;\n\t$query = $wpdb->prepare( \"SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = %d ORDER BY post_modified DESC\", $user_id );\n\n\t/**\n\t * Filters the user's drafts query string.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $query The user's drafts query string.\n\t */\n\t$query = apply_filters( 'get_users_drafts', $query );\n\treturn $wpdb->get_results( $query );\n}\n\n/**\n * Remove user and optionally reassign posts and links to another user.\n *\n * If the $reassign parameter is not assigned to a User ID, then all posts will\n * be deleted of that user. The action {@see 'delete_user'} that is passed the User ID\n * being deleted will be run after the posts are either reassigned or deleted.\n * The user meta will also be deleted that are for that User ID.\n *\n * @since 2.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int $id User ID.\n * @param int $reassign Optional. Reassign posts and links to new User ID.\n * @return bool True when finished.\n */\nfunction wp_delete_user( $id, $reassign = null ) {\n\tglobal $wpdb;\n\n\tif ( ! is_numeric( $id ) ) {\n\t\treturn false;\n\t}\n\n\t$id   = (int) $id;\n\t$user = new WP_User( $id );\n\n\tif ( ! $user->exists() ) {\n\t\treturn false;\n\t}\n\n\t// Normalize $reassign to null or a user ID. 'novalue' was an older default.\n\tif ( 'novalue' === $reassign ) {\n\t\t$reassign = null;\n\t} elseif ( null !== $reassign ) {\n\t\t$reassign = (int) $reassign;\n\t}\n\n\t/**\n\t * Fires immediately before a user is deleted from the database.\n\t *\n\t * @since 2.0.0\n\t * @since 5.5.0 Added the `$user` parameter.\n\t *\n\t * @param int      $id       ID of the user to delete.\n\t * @param int|null $reassign ID of the user to reassign posts and links to.\n\t *                           Default null, for no reassignment.\n\t * @param WP_User  $user     WP_User object of the user to delete.\n\t */\n\tdo_action( 'delete_user', $id, $reassign, $user );\n\n\tif ( null === $reassign ) {\n\t\t$post_types_to_delete = array();\n\t\tforeach ( get_post_types( array(), 'objects' ) as $post_type ) {\n\t\t\tif ( $post_type->delete_with_user ) {\n\t\t\t\t$post_types_to_delete[] = $post_type->name;\n\t\t\t} elseif ( null === $post_type->delete_with_user && post_type_supports( $post_type->name, 'author' ) ) {\n\t\t\t\t$post_types_to_delete[] = $post_type->name;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the list of post types to delete with a user.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param string[] $post_types_to_delete Array of post types to delete.\n\t\t * @param int      $id                   User ID.\n\t\t */\n\t\t$post_types_to_delete = apply_filters( 'post_types_to_delete_with_user', $post_types_to_delete, $id );\n\t\t$post_types_to_delete = implode( \"', '\", $post_types_to_delete );\n\t\t$post_ids             = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE post_author = %d AND post_type IN ('$post_types_to_delete')\", $id ) );\n\t\tif ( $post_ids ) {\n\t\t\tforeach ( $post_ids as $post_id ) {\n\t\t\t\twp_delete_post( $post_id );\n\t\t\t}\n\t\t}\n\n\t\t// Clean links.\n\t\t$link_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT link_id FROM $wpdb->links WHERE link_owner = %d\", $id ) );\n\n\t\tif ( $link_ids ) {\n\t\t\tforeach ( $link_ids as $link_id ) {\n\t\t\t\twp_delete_link( $link_id );\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$post_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE post_author = %d\", $id ) );\n\t\t$wpdb->update( $wpdb->posts, array( 'post_author' => $reassign ), array( 'post_author' => $id ) );\n\t\tif ( ! empty( $post_ids ) ) {\n\t\t\tforeach ( $post_ids as $post_id ) {\n\t\t\t\tclean_post_cache( $post_id );\n\t\t\t}\n\t\t}\n\t\t$link_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT link_id FROM $wpdb->links WHERE link_owner = %d\", $id ) );\n\t\t$wpdb->update( $wpdb->links, array( 'link_owner' => $reassign ), array( 'link_owner' => $id ) );\n\t\tif ( ! empty( $link_ids ) ) {\n\t\t\tforeach ( $link_ids as $link_id ) {\n\t\t\t\tclean_bookmark_cache( $link_id );\n\t\t\t}\n\t\t}\n\t}\n\n\t// FINALLY, delete user.\n\tif ( is_multisite() ) {\n\t\tremove_user_from_blog( $id, get_current_blog_id() );\n\t} else {\n\t\t$meta = $wpdb->get_col( $wpdb->prepare( \"SELECT umeta_id FROM $wpdb->usermeta WHERE user_id = %d\", $id ) );\n\t\tforeach ( $meta as $mid ) {\n\t\t\tdelete_metadata_by_mid( 'user', $mid );\n\t\t}\n\n\t\t$wpdb->delete( $wpdb->users, array( 'ID' => $id ) );\n\t}\n\n\tclean_user_cache( $user );\n\n\t/**\n\t * Fires immediately after a user is deleted from the database.\n\t *\n\t * @since 2.9.0\n\t * @since 5.5.0 Added the `$user` parameter.\n\t *\n\t * @param int      $id       ID of the deleted user.\n\t * @param int|null $reassign ID of the user to reassign posts and links to.\n\t *                           Default null, for no reassignment.\n\t * @param WP_User  $user     WP_User object of the deleted user.\n\t */\n\tdo_action( 'deleted_user', $id, $reassign, $user );\n\n\treturn true;\n}\n\n/**\n * Remove all capabilities from user.\n *\n * @since 2.1.0\n *\n * @param int $id User ID.\n */\nfunction wp_revoke_user( $id ) {\n\t$id = (int) $id;\n\n\t$user = new WP_User( $id );\n\t$user->remove_all_caps();\n}\n\n/**\n * @since 2.8.0\n *\n * @global int $user_ID\n *\n * @param false $errors Deprecated.\n */\nfunction default_password_nag_handler( $errors = false ) {\n\tglobal $user_ID;\n\t// Short-circuit it.\n\tif ( ! get_user_option( 'default_password_nag' ) ) {\n\t\treturn;\n\t}\n\n\t// get_user_setting() = JS-saved UI setting. Else no-js-fallback code.\n\tif ( 'hide' === get_user_setting( 'default_password_nag' )\n\t\t|| isset( $_GET['default_password_nag'] ) && '0' == $_GET['default_password_nag']\n\t) {\n\t\tdelete_user_setting( 'default_password_nag' );\n\t\tupdate_user_option( $user_ID, 'default_password_nag', false, true );\n\t}\n}\n\n/**\n * @since 2.8.0\n *\n * @param int    $user_ID\n * @param object $old_data\n */\nfunction default_password_nag_edit_user( $user_ID, $old_data ) {\n\t// Short-circuit it.\n\tif ( ! get_user_option( 'default_password_nag', $user_ID ) ) {\n\t\treturn;\n\t}\n\n\t$new_data = get_userdata( $user_ID );\n\n\t// Remove the nag if the password has been changed.\n\tif ( $new_data->user_pass != $old_data->user_pass ) {\n\t\tdelete_user_setting( 'default_password_nag' );\n\t\tupdate_user_option( $user_ID, 'default_password_nag', false, true );\n\t}\n}\n\n/**\n * @since 2.8.0\n *\n * @global string $pagenow\n */\nfunction default_password_nag() {\n\tglobal $pagenow;\n\t// Short-circuit it.\n\tif ( 'profile.php' === $pagenow || ! get_user_option( 'default_password_nag' ) ) {\n\t\treturn;\n\t}\n\n\techo '<div class=\"error default-password-nag\">';\n\techo '<p>';\n\techo '<strong>' . __( 'Notice:' ) . '</strong> ';\n\t_e( 'You&rsquo;re using the auto-generated password for your account. Would you like to change it?' );\n\techo '</p><p>';\n\tprintf( '<a href=\"%s\">' . __( 'Yes, take me to my profile page' ) . '</a> | ', get_edit_profile_url() . '#password' );\n\tprintf( '<a href=\"%s\" id=\"default-password-nag-no\">' . __( 'No thanks, do not remind me again' ) . '</a>', '?default_password_nag=0' );\n\techo '</p></div>';\n}\n\n/**\n * @since 3.5.0\n * @access private\n */\nfunction delete_users_add_js() {\n\t?>\n<script>\njQuery(document).ready( function($) {\n\tvar submit = $('#submit').prop('disabled', true);\n\t$('input[name=\"delete_option\"]').one('change', function() {\n\t\tsubmit.prop('disabled', false);\n\t});\n\t$('#reassign_user').focus( function() {\n\t\t$('#delete_option1').prop('checked', true).trigger('change');\n\t});\n});\n</script>\n\t<?php\n}\n\n/**\n * Optional SSL preference that can be turned on by hooking to the 'personal_options' action.\n *\n * See the {@see 'personal_options'} action.\n *\n * @since 2.7.0\n *\n * @param WP_User $user User data object.\n */\nfunction use_ssl_preference( $user ) {\n\t?>\n\t<tr class=\"user-use-ssl-wrap\">\n\t\t<th scope=\"row\"><?php _e( 'Use https' ); ?></th>\n\t\t<td><label for=\"use_ssl\"><input name=\"use_ssl\" type=\"checkbox\" id=\"use_ssl\" value=\"1\" <?php checked( '1', $user->use_ssl ); ?> /> <?php _e( 'Always use https when visiting the admin' ); ?></label></td>\n\t</tr>\n\t<?php\n}\n\n/**\n * @since MU (3.0.0)\n *\n * @param string $text\n * @return string\n */\nfunction admin_created_user_email( $text ) {\n\t$roles = get_editable_roles();\n\t$role  = $roles[ $_REQUEST['role'] ];\n\n\treturn sprintf(\n\t\t/* translators: 1: Site title, 2: Site URL, 3: User role. */\n\t\t__(\n\t\t\t'Hi,\nYou\\'ve been invited to join \\'%1$s\\' at\n%2$s with the role of %3$s.\nIf you do not want to join this site please ignore\nthis email. This invitation will expire in a few days.\n\nPlease click the following link to activate your user account:\n%%s'\n\t\t),\n\t\twp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ),\n\t\thome_url(),\n\t\twp_specialchars_decode( translate_user_role( $role['name'] ) )\n\t);\n}\n", "num_lines": 597}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Widgets Administration API\n *\n * @package WordPress\n * @subpackage Administration\n */\n\n/**\n * Display list of the available widgets.\n *\n * @since 2.5.0\n *\n * @global array $wp_registered_widgets\n * @global array $wp_registered_widget_controls\n */\nfunction wp_list_widgets() {\n\tglobal $wp_registered_widgets, $wp_registered_widget_controls;\n\n\t$sort = $wp_registered_widgets;\n\tusort( $sort, '_sort_name_callback' );\n\t$done = array();\n\n\tforeach ( $sort as $widget ) {\n\t\tif ( in_array( $widget['callback'], $done, true ) ) { // We already showed this multi-widget.\n\t\t\tcontinue;\n\t\t}\n\n\t\t$sidebar = is_active_widget( $widget['callback'], $widget['id'], false, false );\n\t\t$done[]  = $widget['callback'];\n\n\t\tif ( ! isset( $widget['params'][0] ) ) {\n\t\t\t$widget['params'][0] = array();\n\t\t}\n\n\t\t$args = array(\n\t\t\t'widget_id'   => $widget['id'],\n\t\t\t'widget_name' => $widget['name'],\n\t\t\t'_display'    => 'template',\n\t\t);\n\n\t\tif ( isset( $wp_registered_widget_controls[ $widget['id'] ]['id_base'] ) && isset( $widget['params'][0]['number'] ) ) {\n\t\t\t$id_base            = $wp_registered_widget_controls[ $widget['id'] ]['id_base'];\n\t\t\t$args['_temp_id']   = \"$id_base-__i__\";\n\t\t\t$args['_multi_num'] = next_widget_id_number( $id_base );\n\t\t\t$args['_add']       = 'multi';\n\t\t} else {\n\t\t\t$args['_add'] = 'single';\n\t\t\tif ( $sidebar ) {\n\t\t\t\t$args['_hide'] = '1';\n\t\t\t}\n\t\t}\n\n\t\t$control_args = array(\n\t\t\t0 => $args,\n\t\t\t1 => $widget['params'][0],\n\t\t);\n\t\t$sidebar_args = wp_list_widget_controls_dynamic_sidebar( $control_args );\n\n\t\twp_widget_control( ...$sidebar_args );\n\t}\n}\n\n/**\n * Callback to sort array by a 'name' key.\n *\n * @since 3.1.0\n * @access private\n *\n * @return int\n */\nfunction _sort_name_callback( $a, $b ) {\n\treturn strnatcasecmp( $a['name'], $b['name'] );\n}\n\n/**\n * Show the widgets and their settings for a sidebar.\n * Used in the admin widget config screen.\n *\n * @since 2.5.0\n *\n * @param string $sidebar      Sidebar ID.\n * @param string $sidebar_name Optional. Sidebar name. Default empty.\n */\nfunction wp_list_widget_controls( $sidebar, $sidebar_name = '' ) {\n\tadd_filter( 'dynamic_sidebar_params', 'wp_list_widget_controls_dynamic_sidebar' );\n\n\t$description = wp_sidebar_description( $sidebar );\n\n\techo '<div id=\"' . esc_attr( $sidebar ) . '\" class=\"widgets-sortables\">';\n\n\tif ( $sidebar_name ) {\n\t\t$add_to = sprintf(\n\t\t\t/* translators: %s: Widgets sidebar name. */\n\t\t\t__( 'Add to: %s' ),\n\t\t\t$sidebar_name\n\t\t);\n\t\t?>\n\t\t<div class=\"sidebar-name\" data-add-to=\"<?php echo esc_attr( $add_to ); ?>\">\n\t\t\t<button type=\"button\" class=\"handlediv hide-if-no-js\" aria-expanded=\"true\">\n\t\t\t\t<span class=\"screen-reader-text\"><?php echo esc_html( $sidebar_name ); ?></span>\n\t\t\t\t<span class=\"toggle-indicator\" aria-hidden=\"true\"></span>\n\t\t\t</button>\n\t\t\t<h2><?php echo esc_html( $sidebar_name ); ?> <span class=\"spinner\"></span></h2>\n\t\t</div>\n\t\t<?php\n\t}\n\n\tif ( ! empty( $description ) ) {\n\t\t?>\n\t\t<div class=\"sidebar-description\">\n\t\t\t<p class=\"description\"><?php echo $description; ?></p>\n\t\t</div>\n\t\t<?php\n\t}\n\n\tdynamic_sidebar( $sidebar );\n\n\techo '</div>';\n}\n\n/**\n * Retrieves the widget control arguments.\n *\n * @since 2.5.0\n *\n * @global array $wp_registered_widgets\n *\n * @param array $params\n * @return array\n */\nfunction wp_list_widget_controls_dynamic_sidebar( $params ) {\n\tglobal $wp_registered_widgets;\n\tstatic $i = 0;\n\t$i++;\n\n\t$widget_id = $params[0]['widget_id'];\n\t$id        = isset( $params[0]['_temp_id'] ) ? $params[0]['_temp_id'] : $widget_id;\n\t$hidden    = isset( $params[0]['_hide'] ) ? ' style=\"display:none;\"' : '';\n\n\t$params[0]['before_widget'] = \"<div id='widget-{$i}_{$id}' class='widget'$hidden>\";\n\t$params[0]['after_widget']  = '</div>';\n\t$params[0]['before_title']  = '%BEG_OF_TITLE%'; // Deprecated.\n\t$params[0]['after_title']   = '%END_OF_TITLE%'; // Deprecated.\n\n\tif ( is_callable( $wp_registered_widgets[ $widget_id ]['callback'] ) ) {\n\t\t$wp_registered_widgets[ $widget_id ]['_callback'] = $wp_registered_widgets[ $widget_id ]['callback'];\n\t\t$wp_registered_widgets[ $widget_id ]['callback']  = 'wp_widget_control';\n\t}\n\n\treturn $params;\n}\n\n/**\n * @global array $wp_registered_widgets\n *\n * @param string $id_base\n * @return int\n */\nfunction next_widget_id_number( $id_base ) {\n\tglobal $wp_registered_widgets;\n\t$number = 1;\n\n\tforeach ( $wp_registered_widgets as $widget_id => $widget ) {\n\t\tif ( preg_match( '/' . $id_base . '-([0-9]+)$/', $widget_id, $matches ) ) {\n\t\t\t$number = max( $number, $matches[1] );\n\t\t}\n\t}\n\t$number++;\n\n\treturn $number;\n}\n\n/**\n * Meta widget used to display the control form for a widget.\n *\n * Called from dynamic_sidebar().\n *\n * @since 2.5.0\n *\n * @global array $wp_registered_widgets\n * @global array $wp_registered_widget_controls\n * @global array $sidebars_widgets\n *\n * @param array $sidebar_args\n * @return array\n */\nfunction wp_widget_control( $sidebar_args ) {\n\tglobal $wp_registered_widgets, $wp_registered_widget_controls, $sidebars_widgets;\n\n\t$widget_id  = $sidebar_args['widget_id'];\n\t$sidebar_id = isset( $sidebar_args['id'] ) ? $sidebar_args['id'] : false;\n\t$key        = $sidebar_id ? array_search( $widget_id, $sidebars_widgets[ $sidebar_id ], true ) : '-1'; // Position of widget in sidebar.\n\t$control    = isset( $wp_registered_widget_controls[ $widget_id ] ) ? $wp_registered_widget_controls[ $widget_id ] : array();\n\t$widget     = $wp_registered_widgets[ $widget_id ];\n\n\t$id_format     = $widget['id'];\n\t$widget_number = isset( $control['params'][0]['number'] ) ? $control['params'][0]['number'] : '';\n\t$id_base       = isset( $control['id_base'] ) ? $control['id_base'] : $widget_id;\n\t$width         = isset( $control['width'] ) ? $control['width'] : '';\n\t$height        = isset( $control['height'] ) ? $control['height'] : '';\n\t$multi_number  = isset( $sidebar_args['_multi_num'] ) ? $sidebar_args['_multi_num'] : '';\n\t$add_new       = isset( $sidebar_args['_add'] ) ? $sidebar_args['_add'] : '';\n\n\t$before_form           = isset( $sidebar_args['before_form'] ) ? $sidebar_args['before_form'] : '<form method=\"post\">';\n\t$after_form            = isset( $sidebar_args['after_form'] ) ? $sidebar_args['after_form'] : '</form>';\n\t$before_widget_content = isset( $sidebar_args['before_widget_content'] ) ? $sidebar_args['before_widget_content'] : '<div class=\"widget-content\">';\n\t$after_widget_content  = isset( $sidebar_args['after_widget_content'] ) ? $sidebar_args['after_widget_content'] : '</div>';\n\n\t$query_arg = array( 'editwidget' => $widget['id'] );\n\tif ( $add_new ) {\n\t\t$query_arg['addnew'] = 1;\n\t\tif ( $multi_number ) {\n\t\t\t$query_arg['num']  = $multi_number;\n\t\t\t$query_arg['base'] = $id_base;\n\t\t}\n\t} else {\n\t\t$query_arg['sidebar'] = $sidebar_id;\n\t\t$query_arg['key']     = $key;\n\t}\n\n\t/*\n\t * We aren't showing a widget control, we're outputting a template\n\t * for a multi-widget control.\n\t */\n\tif ( isset( $sidebar_args['_display'] ) && 'template' === $sidebar_args['_display'] && $widget_number ) {\n\t\t// number == -1 implies a template where id numbers are replaced by a generic '__i__'.\n\t\t$control['params'][0]['number'] = -1;\n\t\t// With id_base widget id's are constructed like {$id_base}-{$id_number}.\n\t\tif ( isset( $control['id_base'] ) ) {\n\t\t\t$id_format = $control['id_base'] . '-__i__';\n\t\t}\n\t}\n\n\t$wp_registered_widgets[ $widget_id ]['callback'] = $wp_registered_widgets[ $widget_id ]['_callback'];\n\tunset( $wp_registered_widgets[ $widget_id ]['_callback'] );\n\n\t$widget_title = esc_html( strip_tags( $sidebar_args['widget_name'] ) );\n\t$has_form     = 'noform';\n\n\techo $sidebar_args['before_widget'];\n\t?>\n\t<div class=\"widget-top\">\n\t<div class=\"widget-title-action\">\n\t\t<button type=\"button\" class=\"widget-action hide-if-no-js\" aria-expanded=\"false\">\n\t\t\t<span class=\"screen-reader-text edit\">\n\t\t\t\t<?php\n\t\t\t\t/* translators: %s: Widget title. */\n\t\t\t\tprintf( __( 'Edit widget: %s' ), $widget_title );\n\t\t\t\t?>\n\t\t\t</span>\n\t\t\t<span class=\"screen-reader-text add\">\n\t\t\t\t<?php\n\t\t\t\t/* translators: %s: Widget title. */\n\t\t\t\tprintf( __( 'Add widget: %s' ), $widget_title );\n\t\t\t\t?>\n\t\t\t</span>\n\t\t\t<span class=\"toggle-indicator\" aria-hidden=\"true\"></span>\n\t\t</button>\n\t\t<a class=\"widget-control-edit hide-if-js\" href=\"<?php echo esc_url( add_query_arg( $query_arg ) ); ?>\">\n\t\t\t<span class=\"edit\"><?php _ex( 'Edit', 'widget' ); ?></span>\n\t\t\t<span class=\"add\"><?php _ex( 'Add', 'widget' ); ?></span>\n\t\t\t<span class=\"screen-reader-text\"><?php echo $widget_title; ?></span>\n\t\t</a>\n\t</div>\n\t<div class=\"widget-title\"><h3><?php echo $widget_title; ?><span class=\"in-widget-title\"></span></h3></div>\n\t</div>\n\n\t<div class=\"widget-inside\">\n\t<?php echo $before_form; ?>\n\t<?php echo $before_widget_content; ?>\n\t<?php\n\tif ( isset( $control['callback'] ) ) {\n\t\t$has_form = call_user_func_array( $control['callback'], $control['params'] );\n\t} else {\n\t\techo \"\\t\\t<p>\" . __( 'There are no options for this widget.' ) . \"</p>\\n\";\n\t}\n\n\t$noform_class = '';\n\tif ( 'noform' === $has_form ) {\n\t\t$noform_class = ' widget-control-noform';\n\t}\n\t?>\n\t<?php echo $after_widget_content; ?>\n\t<input type=\"hidden\" name=\"widget-id\" class=\"widget-id\" value=\"<?php echo esc_attr( $id_format ); ?>\" />\n\t<input type=\"hidden\" name=\"id_base\" class=\"id_base\" value=\"<?php echo esc_attr( $id_base ); ?>\" />\n\t<input type=\"hidden\" name=\"widget-width\" class=\"widget-width\" value=\"<?php echo esc_attr( $width ); ?>\" />\n\t<input type=\"hidden\" name=\"widget-height\" class=\"widget-height\" value=\"<?php echo esc_attr( $height ); ?>\" />\n\t<input type=\"hidden\" name=\"widget_number\" class=\"widget_number\" value=\"<?php echo esc_attr( $widget_number ); ?>\" />\n\t<input type=\"hidden\" name=\"multi_number\" class=\"multi_number\" value=\"<?php echo esc_attr( $multi_number ); ?>\" />\n\t<input type=\"hidden\" name=\"add_new\" class=\"add_new\" value=\"<?php echo esc_attr( $add_new ); ?>\" />\n\n\t<div class=\"widget-control-actions\">\n\t\t<div class=\"alignleft\">\n\t\t\t<button type=\"button\" class=\"button-link button-link-delete widget-control-remove\"><?php _e( 'Delete' ); ?></button>\n\t\t\t<span class=\"widget-control-close-wrapper\">\n\t\t\t\t|\n\t\t\t\t<button type=\"button\" class=\"button-link widget-control-close\"><?php _e( 'Done' ); ?></button>\n\t\t\t</span>\n\t\t</div>\n\t\t<div class=\"alignright<?php echo $noform_class; ?>\">\n\t\t\t<?php submit_button( __( 'Save' ), 'primary widget-control-save right', 'savewidget', false, array( 'id' => 'widget-' . esc_attr( $id_format ) . '-savewidget' ) ); ?>\n\t\t\t<span class=\"spinner\"></span>\n\t\t</div>\n\t\t<br class=\"clear\" />\n\t</div>\n\t<?php echo $after_form; ?>\n\t</div>\n\n\t<div class=\"widget-description\">\n\t<?php\n\t$widget_description = wp_widget_description( $widget_id );\n\techo ( $widget_description ) ? \"$widget_description\\n\" : \"$widget_title\\n\";\n\t?>\n\t</div>\n\t<?php\n\techo $sidebar_args['after_widget'];\n\n\treturn $sidebar_args;\n}\n\n/**\n * @param string $classes\n * @return string\n */\nfunction wp_widgets_access_body_class( $classes ) {\n\treturn \"$classes widgets_access \";\n}\n", "num_lines": 329}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Database Repair and Optimization Script.\n *\n * @package WordPress\n * @subpackage Database\n */\ndefine( 'WP_REPAIRING', true );\n\nrequire_once dirname( dirname( __DIR__ ) ) . '/wp-load.php';\n\nheader( 'Content-Type: text/html; charset=utf-8' );\n?>\n<!DOCTYPE html>\n<html <?php language_attributes(); ?>>\n<head>\n\t<meta name=\"viewport\" content=\"width=device-width\" />\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\t<meta name=\"robots\" content=\"noindex,nofollow\" />\n\t<title><?php _e( 'WordPress &rsaquo; Database Repair' ); ?></title>\n\t<?php wp_admin_css( 'install', true ); ?>\n</head>\n<body class=\"wp-core-ui\">\n<p id=\"logo\"><a href=\"<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>\"><?php _e( 'WordPress' ); ?></a></p>\n\n<?php\n\nif ( ! defined( 'WP_ALLOW_REPAIR' ) || ! WP_ALLOW_REPAIR ) {\n\n\techo '<h1 class=\"screen-reader-text\">' . __( 'Allow automatic database repair' ) . '</h1>';\n\n\techo '<p>';\n\tprintf(\n\t\t/* translators: %s: wp-config.php */\n\t\t__( 'To allow use of this page to automatically repair database problems, please add the following line to your %s file. Once this line is added to your config, reload this page.' ),\n\t\t'<code>wp-config.php</code>'\n\t);\n\techo \"</p><p><code>define('WP_ALLOW_REPAIR', true);</code></p>\";\n\n\t$default_key     = 'put your unique phrase here';\n\t$missing_key     = false;\n\t$duplicated_keys = array();\n\n\tforeach ( array( 'AUTH_KEY', 'SECURE_AUTH_KEY', 'LOGGED_IN_KEY', 'NONCE_KEY', 'AUTH_SALT', 'SECURE_AUTH_SALT', 'LOGGED_IN_SALT', 'NONCE_SALT' ) as $key ) {\n\t\tif ( defined( $key ) ) {\n\t\t\t// Check for unique values of each key.\n\t\t\t$duplicated_keys[ constant( $key ) ] = isset( $duplicated_keys[ constant( $key ) ] );\n\t\t} else {\n\t\t\t// If a constant is not defined, it's missing.\n\t\t\t$missing_key = true;\n\t\t}\n\t}\n\n\t// If at least one key uses the default value, consider it duplicated.\n\tif ( isset( $duplicated_keys[ $default_key ] ) ) {\n\t\t$duplicated_keys[ $default_key ] = true;\n\t}\n\n\t// Weed out all unique, non-default values.\n\t$duplicated_keys = array_filter( $duplicated_keys );\n\n\tif ( $duplicated_keys || $missing_key ) {\n\n\t\techo '<h2 class=\"screen-reader-text\">' . __( 'Check secret keys' ) . '</h2>';\n\n\t\t/* translators: 1: wp-config.php, 2: Secret key service URL. */\n\t\techo '<p>' . sprintf( __( 'While you are editing your %1$s file, take a moment to make sure you have all 8 keys and that they are unique. You can generate these using the <a href=\"%2$s\">WordPress.org secret key service</a>.' ), '<code>wp-config.php</code>', 'https://api.wordpress.org/secret-key/1.1/salt/' ) . '</p>';\n\t}\n} elseif ( isset( $_GET['repair'] ) ) {\n\n\techo '<h1 class=\"screen-reader-text\">' . __( 'Database repair results' ) . '</h1>';\n\n\t$optimize = 2 == $_GET['repair'];\n\t$okay     = true;\n\t$problems = array();\n\n\t$tables = $wpdb->tables();\n\n\t// Sitecategories may not exist if global terms are disabled.\n\t$query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->sitecategories ) );\n\tif ( is_multisite() && ! $wpdb->get_var( $query ) ) {\n\t\tunset( $tables['sitecategories'] );\n\t}\n\n\t/**\n\t * Filters additional database tables to repair.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string[] $tables Array of prefixed table names to be repaired.\n\t */\n\t$tables = array_merge( $tables, (array) apply_filters( 'tables_to_repair', array() ) );\n\n\t// Loop over the tables, checking and repairing as needed.\n\tforeach ( $tables as $table ) {\n\t\t$check = $wpdb->get_row( \"CHECK TABLE $table\" );\n\n\t\techo '<p>';\n\t\tif ( 'OK' === $check->Msg_text ) {\n\t\t\t/* translators: %s: Table name. */\n\t\t\tprintf( __( 'The %s table is okay.' ), \"<code>$table</code>\" );\n\t\t} else {\n\t\t\t/* translators: 1: Table name, 2: Error message. */\n\t\t\tprintf( __( 'The %1$s table is not okay. It is reporting the following error: %2$s. WordPress will attempt to repair this table&hellip;' ), \"<code>$table</code>\", \"<code>$check->Msg_text</code>\" );\n\n\t\t\t$repair = $wpdb->get_row( \"REPAIR TABLE $table\" );\n\n\t\t\techo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';\n\t\t\tif ( 'OK' === $check->Msg_text ) {\n\t\t\t\t/* translators: %s: Table name. */\n\t\t\t\tprintf( __( 'Successfully repaired the %s table.' ), \"<code>$table</code>\" );\n\t\t\t} else {\n\t\t\t\t/* translators: 1: Table name, 2: Error message. */\n\t\t\t\tprintf( __( 'Failed to repair the %1$s table. Error: %2$s' ), \"<code>$table</code>\", \"<code>$check->Msg_text</code>\" ) . '<br />';\n\t\t\t\t$problems[ $table ] = $check->Msg_text;\n\t\t\t\t$okay               = false;\n\t\t\t}\n\t\t}\n\n\t\tif ( $okay && $optimize ) {\n\t\t\t$check = $wpdb->get_row( \"ANALYZE TABLE $table\" );\n\n\t\t\techo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';\n\t\t\tif ( 'Table is already up to date' === $check->Msg_text ) {\n\t\t\t\t/* translators: %s: Table name. */\n\t\t\t\tprintf( __( 'The %s table is already optimized.' ), \"<code>$table</code>\" );\n\t\t\t} else {\n\t\t\t\t$check = $wpdb->get_row( \"OPTIMIZE TABLE $table\" );\n\n\t\t\t\techo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';\n\t\t\t\tif ( 'OK' === $check->Msg_text || 'Table is already up to date' === $check->Msg_text ) {\n\t\t\t\t\t/* translators: %s: Table name. */\n\t\t\t\t\tprintf( __( 'Successfully optimized the %s table.' ), \"<code>$table</code>\" );\n\t\t\t\t} else {\n\t\t\t\t\t/* translators: 1: Table name. 2: Error message. */\n\t\t\t\t\tprintf( __( 'Failed to optimize the %1$s table. Error: %2$s' ), \"<code>$table</code>\", \"<code>$check->Msg_text</code>\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo '</p>';\n\t}\n\n\tif ( $problems ) {\n\t\tprintf(\n\t\t\t/* translators: %s: URL to \"Fixing WordPress\" forum. */\n\t\t\t'<p>' . __( 'Some database problems could not be repaired. Please copy-and-paste the following list of errors to the <a href=\"%s\">WordPress support forums</a> to get additional assistance.' ) . '</p>',\n\t\t\t__( 'https://wordpress.org/support/forum/how-to-and-troubleshooting' )\n\t\t);\n\t\t$problem_output = '';\n\t\tforeach ( $problems as $table => $problem ) {\n\t\t\t$problem_output .= \"$table: $problem\\n\";\n\t\t}\n\t\techo '<p><textarea name=\"errors\" id=\"errors\" rows=\"20\" cols=\"60\">' . esc_textarea( $problem_output ) . '</textarea></p>';\n\t} else {\n\t\techo '<p>' . __( 'Repairs complete. Please remove the following line from wp-config.php to prevent this page from being used by unauthorized users.' ) . \"</p><p><code>define('WP_ALLOW_REPAIR', true);</code></p>\";\n\t}\n} else {\n\n\techo '<h1 class=\"screen-reader-text\">' . __( 'WordPress database repair' ) . '</h1>';\n\n\tif ( isset( $_GET['referrer'] ) && 'is_blog_installed' === $_GET['referrer'] ) {\n\t\techo '<p>' . __( 'One or more database tables are unavailable. To allow WordPress to attempt to repair these tables, press the &#8220;Repair Database&#8221; button. Repairing can take a while, so please be patient.' ) . '</p>';\n\t} else {\n\t\techo '<p>' . __( 'WordPress can automatically look for some common database problems and repair them. Repairing can take a while, so please be patient.' ) . '</p>';\n\t}\n\t?>\n\t<p class=\"step\"><a class=\"button button-large\" href=\"repair.php?repair=1\"><?php _e( 'Repair Database' ); ?></a></p>\n\t<p><?php _e( 'WordPress can also attempt to optimize the database. This improves performance in some situations. Repairing and optimizing the database can take a long time and the database will be locked while optimizing.' ); ?></p>\n\t<p class=\"step\"><a class=\"button button-large\" href=\"repair.php?repair=2\"><?php _e( 'Repair and Optimize Database' ); ?></a></p>\n\t<?php\n}\n?>\n</body>\n</html>\n", "num_lines": 175}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Network About administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.4.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/about.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Network Administration Bootstrap\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\ndefine( 'WP_NETWORK_ADMIN', true );\n\n/** Load WordPress Administration Bootstrap */\nrequire_once dirname( __DIR__ ) . '/admin.php';\n\n// Do not remove this check. It is required by individual network admin pages.\nif ( ! is_multisite() ) {\n\twp_die( __( 'Multisite support is not enabled.' ) );\n}\n\n$redirect_network_admin_request = ( 0 !== strcasecmp( $current_blog->domain, $current_site->domain ) || 0 !== strcasecmp( $current_blog->path, $current_site->path ) );\n\n/**\n * Filters whether to redirect the request to the Network Admin.\n *\n * @since 3.2.0\n *\n * @param bool $redirect_network_admin_request Whether the request should be redirected.\n */\n$redirect_network_admin_request = apply_filters( 'redirect_network_admin_request', $redirect_network_admin_request );\n\nif ( $redirect_network_admin_request ) {\n\twp_redirect( network_admin_url() );\n\texit;\n}\n\nunset( $redirect_network_admin_request );\n", "num_lines": 37}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Network Credits administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.4.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/credits.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Action handler for Multisite administration panels.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n$action = ( isset( $_GET['action'] ) ) ? $_GET['action'] : '';\n\nif ( empty( $action ) ) {\n\twp_redirect( network_admin_url() );\n\texit;\n}\n\n/**\n * Fires just before the action handler in several Network Admin screens.\n *\n * This hook fires on multiple screens in the Multisite Network Admin,\n * including Users, Network Settings, and Site Settings.\n *\n * @since 3.0.0\n */\ndo_action( 'wpmuadminedit' );\n\n/**\n * Fires the requested handler action.\n *\n * The dynamic portion of the hook name, `$action`, refers to the name\n * of the requested action derived from the `GET` request.\n *\n * @since 3.1.0\n */\ndo_action( \"network_admin_edit_{$action}\" );\n\nwp_redirect( network_admin_url() );\nexit;\n", "num_lines": 42}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Network Freedoms administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.4.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/freedoms.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n/** Load WordPress dashboard API */\nrequire_once ABSPATH . 'wp-admin/includes/dashboard.php';\n\nif ( ! current_user_can( 'manage_network' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );\n}\n\n$title       = __( 'Dashboard' );\n$parent_file = 'index.php';\n\n$overview  = '<p>' . __( 'Welcome to your Network Admin. This area of the Administration Screens is used for managing all aspects of your Multisite Network.' ) . '</p>';\n$overview .= '<p>' . __( 'From here you can:' ) . '</p>';\n$overview .= '<ul><li>' . __( 'Add and manage sites or users' ) . '</li>';\n$overview .= '<li>' . __( 'Install and activate themes or plugins' ) . '</li>';\n$overview .= '<li>' . __( 'Update your network' ) . '</li>';\n$overview .= '<li>' . __( 'Modify global network settings' ) . '</li></ul>';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' => $overview,\n\t)\n);\n\n$quick_tasks  = '<p>' . __( 'The Right Now widget on this screen provides current user and site counts on your network.' ) . '</p>';\n$quick_tasks .= '<ul><li>' . __( 'To add a new user, <strong>click Create a New User</strong>.' ) . '</li>';\n$quick_tasks .= '<li>' . __( 'To add a new site, <strong>click Create a New Site</strong>.' ) . '</li></ul>';\n$quick_tasks .= '<p>' . __( 'To search for a user or site, use the search boxes.' ) . '</p>';\n$quick_tasks .= '<ul><li>' . __( 'To search for a user, <strong>enter an email address or username</strong>. Use a wildcard to search for a partial username, such as user&#42;.' ) . '</li>';\n$quick_tasks .= '<li>' . __( 'To search for a site, <strong>enter the path or domain</strong>.' ) . '</li></ul>';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'quick-tasks',\n\t\t'title'   => __( 'Quick Tasks' ),\n\t\t'content' => $quick_tasks,\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/network-admin/\">Documentation on the Network Admin</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/forum/multisite/\">Support Forums</a>' ) . '</p>'\n);\n\nwp_dashboard_setup();\n\nwp_enqueue_script( 'dashboard' );\nwp_enqueue_script( 'plugin-install' );\nadd_thickbox();\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n?>\n\n<div class=\"wrap\">\n<h1><?php echo esc_html( $title ); ?></h1>\n\n<div id=\"dashboard-widgets-wrap\">\n\n<?php wp_dashboard(); ?>\n\n<div class=\"clear\"></div>\n</div><!-- dashboard-widgets-wrap -->\n\n</div><!-- wrap -->\n\n<?php\nwp_print_community_events_templates();\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 84}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Build Network Administration Menu.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\n/* translators: Network menu item. */\n$menu[2] = array( __( 'Dashboard' ), 'manage_network', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' );\n\n$submenu['index.php'][0] = array( __( 'Home' ), 'read', 'index.php' );\n\nif ( current_user_can( 'update_core' ) ) {\n\t$cap = 'update_core';\n} elseif ( current_user_can( 'update_plugins' ) ) {\n\t$cap = 'update_plugins';\n} elseif ( current_user_can( 'update_themes' ) ) {\n\t$cap = 'update_themes';\n} else {\n\t$cap = 'update_languages';\n}\n\n$update_data = wp_get_update_data();\nif ( $update_data['counts']['total'] ) {\n\t$submenu['index.php'][10] = array(\n\t\tsprintf(\n\t\t\t/* translators: %s: Number of available updates. */\n\t\t\t__( 'Updates %s' ),\n\t\t\tsprintf(\n\t\t\t\t'<span class=\"update-plugins count-%s\"><span class=\"update-count\">%s</span></span>',\n\t\t\t\t$update_data['counts']['total'],\n\t\t\t\tnumber_format_i18n( $update_data['counts']['total'] )\n\t\t\t)\n\t\t),\n\t\t$cap,\n\t\t'update-core.php',\n\t);\n} else {\n\t$submenu['index.php'][10] = array( __( 'Updates' ), $cap, 'update-core.php' );\n}\n\nunset( $cap );\n\n$submenu['index.php'][15] = array( __( 'Upgrade Network' ), 'upgrade_network', 'upgrade.php' );\n\n$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );\n\n/* translators: Sites menu item. */\n$menu[5]                  = array( __( 'Sites' ), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'dashicons-admin-multisite' );\n$submenu['sites.php'][5]  = array( __( 'All Sites' ), 'manage_sites', 'sites.php' );\n$submenu['sites.php'][10] = array( _x( 'Add New', 'site' ), 'create_sites', 'site-new.php' );\n\n$menu[10]                 = array( __( 'Users' ), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );\n$submenu['users.php'][5]  = array( __( 'All Users' ), 'manage_network_users', 'users.php' );\n$submenu['users.php'][10] = array( _x( 'Add New', 'user' ), 'create_users', 'user-new.php' );\n\nif ( current_user_can( 'update_themes' ) && $update_data['counts']['themes'] ) {\n\t$menu[15] = array(\n\t\tsprintf(\n\t\t\t/* translators: %s: Number of available theme updates. */\n\t\t\t__( 'Themes %s' ),\n\t\t\tsprintf(\n\t\t\t\t'<span class=\"update-plugins count-%s\"><span class=\"theme-count\">%s</span></span>',\n\t\t\t\t$update_data['counts']['themes'],\n\t\t\t\tnumber_format_i18n( $update_data['counts']['themes'] )\n\t\t\t)\n\t\t),\n\t\t'manage_network_themes',\n\t\t'themes.php',\n\t\t'',\n\t\t'menu-top menu-icon-appearance',\n\t\t'menu-appearance',\n\t\t'dashicons-admin-appearance',\n\t);\n} else {\n\t$menu[15] = array( __( 'Themes' ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );\n}\n$submenu['themes.php'][5]  = array( __( 'Installed Themes' ), 'manage_network_themes', 'themes.php' );\n$submenu['themes.php'][10] = array( _x( 'Add New', 'theme' ), 'install_themes', 'theme-install.php' );\n$submenu['themes.php'][15] = array( __( 'Theme Editor' ), 'edit_themes', 'theme-editor.php' );\n\nif ( current_user_can( 'update_plugins' ) && $update_data['counts']['plugins'] ) {\n\t$menu[20] = array(\n\t\tsprintf(\n\t\t\t/* translators: %s: Number of available plugin updates. */\n\t\t\t__( 'Plugins %s' ),\n\t\t\tsprintf(\n\t\t\t\t'<span class=\"update-plugins count-%s\"><span class=\"plugin-count\">%s</span></span>',\n\t\t\t\t$update_data['counts']['plugins'],\n\t\t\t\tnumber_format_i18n( $update_data['counts']['plugins'] )\n\t\t\t)\n\t\t),\n\t\t'manage_network_plugins',\n\t\t'plugins.php',\n\t\t'',\n\t\t'menu-top menu-icon-plugins',\n\t\t'menu-plugins',\n\t\t'dashicons-admin-plugins',\n\t);\n} else {\n\t$menu[20] = array( __( 'Plugins' ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );\n}\n$submenu['plugins.php'][5]  = array( __( 'Installed Plugins' ), 'manage_network_plugins', 'plugins.php' );\n$submenu['plugins.php'][10] = array( _x( 'Add New', 'plugin' ), 'install_plugins', 'plugin-install.php' );\n$submenu['plugins.php'][15] = array( __( 'Plugin Editor' ), 'edit_plugins', 'plugin-editor.php' );\n\n$menu[25] = array( __( 'Settings' ), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' );\nif ( defined( 'MULTISITE' ) && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {\n\t$submenu['settings.php'][5]  = array( __( 'Network Settings' ), 'manage_network_options', 'settings.php' );\n\t$submenu['settings.php'][10] = array( __( 'Network Setup' ), 'setup_network', 'setup.php' );\n}\nunset( $update_data );\n\n$menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator' );\n\nrequire_once ABSPATH . 'wp-admin/includes/menu.php';\n", "num_lines": 119}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Plugin editor network administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/plugin-editor.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Install plugin network administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\nif ( isset( $_GET['tab'] ) && ( 'plugin-information' === $_GET['tab'] ) ) {\n\tdefine( 'IFRAME_REQUEST', true );\n}\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/plugin-install.php';\n", "num_lines": 18}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Network Plugins administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/plugins.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Network Privacy administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 4.9.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/privacy.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * User profile network administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/profile.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite network settings administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n/** WordPress Translation Installation API */\nrequire_once ABSPATH . 'wp-admin/includes/translation-install.php';\n\nif ( ! current_user_can( 'manage_network_options' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );\n}\n\n$title       = __( 'Network Settings' );\n$parent_file = 'settings.php';\n\n// Handle network admin email change requests.\nif ( ! empty( $_GET['network_admin_hash'] ) ) {\n\t$new_admin_details = get_site_option( 'network_admin_hash' );\n\t$redirect          = 'settings.php?updated=false';\n\tif ( is_array( $new_admin_details ) && hash_equals( $new_admin_details['hash'], $_GET['network_admin_hash'] ) && ! empty( $new_admin_details['newemail'] ) ) {\n\t\tupdate_site_option( 'admin_email', $new_admin_details['newemail'] );\n\t\tdelete_site_option( 'network_admin_hash' );\n\t\tdelete_site_option( 'new_admin_email' );\n\t\t$redirect = 'settings.php?updated=true';\n\t}\n\twp_redirect( network_admin_url( $redirect ) );\n\texit;\n} elseif ( ! empty( $_GET['dismiss'] ) && 'new_network_admin_email' === $_GET['dismiss'] ) {\n\tcheck_admin_referer( 'dismiss_new_network_admin_email' );\n\tdelete_site_option( 'network_admin_hash' );\n\tdelete_site_option( 'new_admin_email' );\n\twp_redirect( network_admin_url( 'settings.php?updated=true' ) );\n\texit;\n}\n\nadd_action( 'admin_head', 'network_settings_add_js' );\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t'<p>' . __( 'This screen sets and changes options for the network as a whole. The first site is the main site in the network and network options are pulled from that original site&#8217;s options.' ) . '</p>' .\n\t\t\t'<p>' . __( 'Operational settings has fields for the network&#8217;s name and admin email.' ) . '</p>' .\n\t\t\t'<p>' . __( 'Registration settings can disable/enable public signups. If you let others sign up for a site, install spam plugins. Spaces, not commas, should separate names banned as sites for this network.' ) . '</p>' .\n\t\t\t'<p>' . __( 'New site settings are defaults applied when a new site is created in the network. These include welcome email for when a new site or user account is registered, and what&#8127;s put in the first post, page, comment, comment author, and comment URL.' ) . '</p>' .\n\t\t\t'<p>' . __( 'Upload settings control the size of the uploaded files and the amount of available upload space for each site. You can change the default value for specific sites when you edit a particular site. Allowed file types are also listed (space separated only).' ) . '</p>' .\n\t\t\t'<p>' . __( 'You can set the language, and the translation files will be automatically downloaded and installed (available if your filesystem is writable).' ) . '</p>' .\n\t\t\t'<p>' . __( 'Menu setting enables/disables the plugin menus from appearing for non super admins, so that only super admins, not site admins, have access to activate plugins.' ) . '</p>' .\n\t\t\t'<p>' . __( 'Super admins can no longer be added on the Options screen. You must now go to the list of existing users on Network Admin > Users and click on Username or the Edit action link below that name. This goes to an Edit User page where you can check a box to grant super admin privileges.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://codex.wordpress.org/Network_Admin_Settings_Screen\">Documentation on Network Settings</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nif ( $_POST ) {\n\t/** This action is documented in wp-admin/network/edit.php */\n\tdo_action( 'wpmuadminedit' );\n\n\tcheck_admin_referer( 'siteoptions' );\n\n\t$checked_options = array(\n\t\t'menu_items'                  => array(),\n\t\t'registrationnotification'    => 'no',\n\t\t'upload_space_check_disabled' => 1,\n\t\t'add_new_users'               => 0,\n\t);\n\tforeach ( $checked_options as $option_name => $option_unchecked_value ) {\n\t\tif ( ! isset( $_POST[ $option_name ] ) ) {\n\t\t\t$_POST[ $option_name ] = $option_unchecked_value;\n\t\t}\n\t}\n\n\t$options = array(\n\t\t'registrationnotification',\n\t\t'registration',\n\t\t'add_new_users',\n\t\t'menu_items',\n\t\t'upload_space_check_disabled',\n\t\t'blog_upload_space',\n\t\t'upload_filetypes',\n\t\t'site_name',\n\t\t'first_post',\n\t\t'first_page',\n\t\t'first_comment',\n\t\t'first_comment_url',\n\t\t'first_comment_author',\n\t\t'welcome_email',\n\t\t'welcome_user_email',\n\t\t'fileupload_maxk',\n\t\t'global_terms_enabled',\n\t\t'illegal_names',\n\t\t'limited_email_domains',\n\t\t'banned_email_domains',\n\t\t'WPLANG',\n\t\t'new_admin_email',\n\t\t'first_comment_email',\n\t);\n\n\t// Handle translation installation.\n\tif ( ! empty( $_POST['WPLANG'] ) && current_user_can( 'install_languages' ) && wp_can_install_language_pack() ) {\n\t\t$language = wp_download_language_pack( $_POST['WPLANG'] );\n\t\tif ( $language ) {\n\t\t\t$_POST['WPLANG'] = $language;\n\t\t}\n\t}\n\n\tforeach ( $options as $option_name ) {\n\t\tif ( ! isset( $_POST[ $option_name ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\t$value = wp_unslash( $_POST[ $option_name ] );\n\t\tupdate_site_option( $option_name, $value );\n\t}\n\n\t/**\n\t * Fires after the network options are updated.\n\t *\n\t * @since MU (3.0.0)\n\t */\n\tdo_action( 'update_wpmu_options' );\n\n\twp_redirect( add_query_arg( 'updated', 'true', network_admin_url( 'settings.php' ) ) );\n\texit;\n}\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\nif ( isset( $_GET['updated'] ) ) {\n\t?><div id=\"message\" class=\"updated notice is-dismissible\"><p><?php _e( 'Settings saved.' ); ?></p></div>\n\t<?php\n}\n?>\n\n<div class=\"wrap\">\n\t<h1><?php echo esc_html( $title ); ?></h1>\n\t<form method=\"post\" action=\"settings.php\" novalidate=\"novalidate\">\n\t\t<?php wp_nonce_field( 'siteoptions' ); ?>\n\t\t<h2><?php _e( 'Operational Settings' ); ?></h2>\n\t\t<table class=\"form-table\" role=\"presentation\">\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"site_name\"><?php _e( 'Network Title' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<input name=\"site_name\" type=\"text\" id=\"site_name\" class=\"regular-text\" value=\"<?php echo esc_attr( get_network()->site_name ); ?>\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"admin_email\"><?php _e( 'Network Admin Email' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<input name=\"new_admin_email\" type=\"email\" id=\"admin_email\" aria-describedby=\"admin-email-desc\" class=\"regular-text\" value=\"<?php echo esc_attr( get_site_option( 'admin_email' ) ); ?>\" />\n\t\t\t\t\t<p class=\"description\" id=\"admin-email-desc\">\n\t\t\t\t\t\t<?php _e( 'This address is used for admin purposes. If you change this, we will send you an email at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t\t<?php\n\t\t\t\t\t$new_admin_email = get_site_option( 'new_admin_email' );\n\t\t\t\t\tif ( $new_admin_email && get_site_option( 'admin_email' ) !== $new_admin_email ) :\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"updated inline\">\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: New network admin email. */\n\t\t\t\t\t\t\t\t__( 'There is a pending change of the network admin email to %s.' ),\n\t\t\t\t\t\t\t\t'<code>' . esc_html( $new_admin_email ) . '</code>'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t' <a href=\"%1$s\">%2$s</a>',\n\t\t\t\t\t\t\t\tesc_url( wp_nonce_url( network_admin_url( 'settings.php?dismiss=new_network_admin_email' ), 'dismiss_new_network_admin_email' ) ),\n\t\t\t\t\t\t\t\t__( 'Cancel' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<h2><?php _e( 'Registration Settings' ); ?></h2>\n\t\t<table class=\"form-table\" role=\"presentation\">\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><?php _e( 'Allow new registrations' ); ?></th>\n\t\t\t\t<?php\n\t\t\t\tif ( ! get_site_option( 'registration' ) ) {\n\t\t\t\t\tupdate_site_option( 'registration', 'none' );\n\t\t\t\t}\n\t\t\t\t$reg = get_site_option( 'registration' );\n\t\t\t\t?>\n\t\t\t\t<td>\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t<legend class=\"screen-reader-text\"><?php _e( 'New registrations settings' ); ?></legend>\n\t\t\t\t\t<label><input name=\"registration\" type=\"radio\" id=\"registration1\" value=\"none\"<?php checked( $reg, 'none' ); ?> /> <?php _e( 'Registration is disabled' ); ?></label><br />\n\t\t\t\t\t<label><input name=\"registration\" type=\"radio\" id=\"registration2\" value=\"user\"<?php checked( $reg, 'user' ); ?> /> <?php _e( 'User accounts may be registered' ); ?></label><br />\n\t\t\t\t\t<label><input name=\"registration\" type=\"radio\" id=\"registration3\" value=\"blog\"<?php checked( $reg, 'blog' ); ?> /> <?php _e( 'Logged in users may register new sites' ); ?></label><br />\n\t\t\t\t\t<label><input name=\"registration\" type=\"radio\" id=\"registration4\" value=\"all\"<?php checked( $reg, 'all' ); ?> /> <?php _e( 'Both sites and user accounts can be registered' ); ?></label>\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( is_subdomain_install() ) {\n\t\t\t\t\t\techo '<p class=\"description\">';\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: 1: NOBLOGREDIRECT, 2: wp-config.php */\n\t\t\t\t\t\t\t__( 'If registration is disabled, please set %1$s in %2$s to a URL you will redirect visitors to if they visit a non-existent site.' ),\n\t\t\t\t\t\t\t'<code>NOBLOGREDIRECT</code>',\n\t\t\t\t\t\t\t'<code>wp-config.php</code>'\n\t\t\t\t\t\t);\n\t\t\t\t\t\techo '</p>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t</fieldset>\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><?php _e( 'Registration notification' ); ?></th>\n\t\t\t\t<?php\n\t\t\t\tif ( ! get_site_option( 'registrationnotification' ) ) {\n\t\t\t\t\tupdate_site_option( 'registrationnotification', 'yes' );\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<td>\n\t\t\t\t\t<label><input name=\"registrationnotification\" type=\"checkbox\" id=\"registrationnotification\" value=\"yes\"<?php checked( get_site_option( 'registrationnotification' ), 'yes' ); ?> /> <?php _e( 'Send the network admin an email notification every time someone registers a site or user account' ); ?></label>\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t\t<tr id=\"addnewusers\">\n\t\t\t\t<th scope=\"row\"><?php _e( 'Add New Users' ); ?></th>\n\t\t\t\t<td>\n\t\t\t\t\t<label><input name=\"add_new_users\" type=\"checkbox\" id=\"add_new_users\" value=\"1\"<?php checked( get_site_option( 'add_new_users' ) ); ?> /> <?php _e( 'Allow site administrators to add new users to their site via the \"Users &rarr; Add New\" page' ); ?></label>\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"illegal_names\"><?php _e( 'Banned Names' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<input name=\"illegal_names\" type=\"text\" id=\"illegal_names\" aria-describedby=\"illegal-names-desc\" class=\"large-text\" value=\"<?php echo esc_attr( implode( ' ', (array) get_site_option( 'illegal_names' ) ) ); ?>\" size=\"45\" />\n\t\t\t\t\t<p class=\"description\" id=\"illegal-names-desc\">\n\t\t\t\t\t\t<?php _e( 'Users are not allowed to register these sites. Separate names by spaces.' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"limited_email_domains\"><?php _e( 'Limited Email Registrations' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t$limited_email_domains = get_site_option( 'limited_email_domains' );\n\t\t\t\t\t$limited_email_domains = str_replace( ' ', \"\\n\", $limited_email_domains );\n\n\t\t\t\t\tif ( $limited_email_domains ) {\n\t\t\t\t\t\t$limited_email_domains = implode( \"\\n\", (array) $limited_email_domains );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t<textarea name=\"limited_email_domains\" id=\"limited_email_domains\" aria-describedby=\"limited-email-domains-desc\" cols=\"45\" rows=\"5\">\n<?php echo esc_textarea( $limited_email_domains ); ?></textarea>\n\t\t\t\t\t<p class=\"description\" id=\"limited-email-domains-desc\">\n\t\t\t\t\t\t<?php _e( 'If you want to limit site registrations to certain domains. One domain per line.' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"banned_email_domains\"><?php _e( 'Banned Email Domains' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t$banned_email_domains = get_site_option( 'banned_email_domains' );\n\n\t\t\t\t\tif ( $banned_email_domains ) {\n\t\t\t\t\t\t$banned_email_domains = implode( \"\\n\", (array) $banned_email_domains );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t<textarea name=\"banned_email_domains\" id=\"banned_email_domains\" aria-describedby=\"banned-email-domains-desc\" cols=\"45\" rows=\"5\">\n<?php echo esc_textarea( $banned_email_domains ); ?></textarea>\n\t\t\t\t\t<p class=\"description\" id=\"banned-email-domains-desc\">\n\t\t\t\t\t\t<?php _e( 'If you want to ban domains from site registrations. One domain per line.' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t</table>\n\t\t<h2><?php _e( 'New Site Settings' ); ?></h2>\n\t\t<table class=\"form-table\" role=\"presentation\">\n\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"welcome_email\"><?php _e( 'Welcome Email' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<textarea name=\"welcome_email\" id=\"welcome_email\" aria-describedby=\"welcome-email-desc\" rows=\"5\" cols=\"45\" class=\"large-text\">\n<?php echo esc_textarea( get_site_option( 'welcome_email' ) ); ?></textarea>\n\t\t\t\t\t<p class=\"description\" id=\"welcome-email-desc\">\n\t\t\t\t\t\t<?php _e( 'The welcome email sent to new site owners.' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"welcome_user_email\"><?php _e( 'Welcome User Email' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<textarea name=\"welcome_user_email\" id=\"welcome_user_email\" aria-describedby=\"welcome-user-email-desc\" rows=\"5\" cols=\"45\" class=\"large-text\">\n<?php echo esc_textarea( get_site_option( 'welcome_user_email' ) ); ?></textarea>\n\t\t\t\t\t<p class=\"description\" id=\"welcome-user-email-desc\">\n\t\t\t\t\t\t<?php _e( 'The welcome email sent to new users.' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"first_post\"><?php _e( 'First Post' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<textarea name=\"first_post\" id=\"first_post\" aria-describedby=\"first-post-desc\" rows=\"5\" cols=\"45\" class=\"large-text\">\n<?php echo esc_textarea( get_site_option( 'first_post' ) ); ?></textarea>\n\t\t\t\t\t<p class=\"description\" id=\"first-post-desc\">\n\t\t\t\t\t\t<?php _e( 'The first post on a new site.' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"first_page\"><?php _e( 'First Page' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<textarea name=\"first_page\" id=\"first_page\" aria-describedby=\"first-page-desc\" rows=\"5\" cols=\"45\" class=\"large-text\">\n<?php echo esc_textarea( get_site_option( 'first_page' ) ); ?></textarea>\n\t\t\t\t\t<p class=\"description\" id=\"first-page-desc\">\n\t\t\t\t\t\t<?php _e( 'The first page on a new site.' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"first_comment\"><?php _e( 'First Comment' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<textarea name=\"first_comment\" id=\"first_comment\" aria-describedby=\"first-comment-desc\" rows=\"5\" cols=\"45\" class=\"large-text\">\n<?php echo esc_textarea( get_site_option( 'first_comment' ) ); ?></textarea>\n\t\t\t\t\t<p class=\"description\" id=\"first-comment-desc\">\n\t\t\t\t\t\t<?php _e( 'The first comment on a new site.' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"first_comment_author\"><?php _e( 'First Comment Author' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" size=\"40\" name=\"first_comment_author\" id=\"first_comment_author\" aria-describedby=\"first-comment-author-desc\" value=\"<?php echo esc_attr( get_site_option( 'first_comment_author' ) ); ?>\" />\n\t\t\t\t\t<p class=\"description\" id=\"first-comment-author-desc\">\n\t\t\t\t\t\t<?php _e( 'The author of the first comment on a new site.' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"first_comment_email\"><?php _e( 'First Comment Email' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" size=\"40\" name=\"first_comment_email\" id=\"first_comment_email\" aria-describedby=\"first-comment-email-desc\" value=\"<?php echo esc_attr( get_site_option( 'first_comment_email' ) ); ?>\" />\n\t\t\t\t\t<p class=\"description\" id=\"first-comment-email-desc\">\n\t\t\t\t\t\t<?php _e( 'The email address of the first comment author on a new site.' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"first_comment_url\"><?php _e( 'First Comment URL' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" size=\"40\" name=\"first_comment_url\" id=\"first_comment_url\" aria-describedby=\"first-comment-url-desc\" value=\"<?php echo esc_attr( get_site_option( 'first_comment_url' ) ); ?>\" />\n\t\t\t\t\t<p class=\"description\" id=\"first-comment-url-desc\">\n\t\t\t\t\t\t<?php _e( 'The URL for the first comment on a new site.' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<h2><?php _e( 'Upload Settings' ); ?></h2>\n\t\t<table class=\"form-table\" role=\"presentation\">\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><?php _e( 'Site upload space' ); ?></th>\n\t\t\t\t<td>\n\t\t\t\t\t<label><input type=\"checkbox\" id=\"upload_space_check_disabled\" name=\"upload_space_check_disabled\" value=\"0\"<?php checked( (bool) get_site_option( 'upload_space_check_disabled' ), false ); ?>/>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: Number of megabytes to limit uploads to. */\n\t\t\t\t\t\t\t__( 'Limit total size of files uploaded to %s MB' ),\n\t\t\t\t\t\t\t'</label><label><input name=\"blog_upload_space\" type=\"number\" min=\"0\" style=\"width: 100px\" id=\"blog_upload_space\" aria-describedby=\"blog-upload-space-desc\" value=\"' . esc_attr( get_site_option( 'blog_upload_space', 100 ) ) . '\" />'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t</label><br />\n\t\t\t\t\t<p class=\"screen-reader-text\" id=\"blog-upload-space-desc\">\n\t\t\t\t\t\t<?php _e( 'Size in megabytes' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"upload_filetypes\"><?php _e( 'Upload file types' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<input name=\"upload_filetypes\" type=\"text\" id=\"upload_filetypes\" aria-describedby=\"upload-filetypes-desc\" class=\"large-text\" value=\"<?php echo esc_attr( get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) ); ?>\" size=\"45\" />\n\t\t\t\t\t<p class=\"description\" id=\"upload-filetypes-desc\">\n\t\t\t\t\t\t<?php _e( 'Allowed file types. Separate types by spaces.' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"fileupload_maxk\"><?php _e( 'Max upload file size' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: File size in kilobytes. */\n\t\t\t\t\t\t\t__( '%s KB' ),\n\t\t\t\t\t\t\t'<input name=\"fileupload_maxk\" type=\"number\" min=\"0\" style=\"width: 100px\" id=\"fileupload_maxk\" aria-describedby=\"fileupload-maxk-desc\" value=\"' . esc_attr( get_site_option( 'fileupload_maxk', 300 ) ) . '\" />'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t<p class=\"screen-reader-text\" id=\"fileupload-maxk-desc\">\n\t\t\t\t\t\t<?php _e( 'Size in kilobytes' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\n\t\t<?php\n\t\t$languages    = get_available_languages();\n\t\t$translations = wp_get_available_translations();\n\t\tif ( ! empty( $languages ) || ! empty( $translations ) ) {\n\t\t\t?>\n\t\t\t<h2><?php _e( 'Language Settings' ); ?></h2>\n\t\t\t<table class=\"form-table\" role=\"presentation\">\n\t\t\t\t<tr>\n\t\t\t\t\t<th><label for=\"WPLANG\"><?php _e( 'Default Language' ); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$lang = get_site_option( 'WPLANG' );\n\t\t\t\t\t\tif ( ! in_array( $lang, $languages, true ) ) {\n\t\t\t\t\t\t\t$lang = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twp_dropdown_languages(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'name'         => 'WPLANG',\n\t\t\t\t\t\t\t\t'id'           => 'WPLANG',\n\t\t\t\t\t\t\t\t'selected'     => $lang,\n\t\t\t\t\t\t\t\t'languages'    => $languages,\n\t\t\t\t\t\t\t\t'translations' => $translations,\n\t\t\t\t\t\t\t\t'show_available_translations' => current_user_can( 'install_languages' ) && wp_can_install_language_pack(),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<?php\n\t\t}\n\t\t?>\n\n\t\t<?php\n\t\t$menu_perms = get_site_option( 'menu_items' );\n\t\t/**\n\t\t * Filters available network-wide administration menu options.\n\t\t *\n\t\t * Options returned to this filter are output as individual checkboxes that, when selected,\n\t\t * enable site administrator access to the specified administration menu in certain contexts.\n\t\t *\n\t\t * Adding options for specific menus here hinges on the appropriate checks and capabilities\n\t\t * being in place in the site dashboard on the other side. For instance, when the single\n\t\t * default option, 'plugins' is enabled, site administrators are granted access to the Plugins\n\t\t * screen in their individual sites' dashboards.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t *\n\t\t * @param string[] $admin_menus Associative array of the menu items available.\n\t\t */\n\t\t$menu_items = apply_filters( 'mu_menu_items', array( 'plugins' => __( 'Plugins' ) ) );\n\n\t\tif ( $menu_items ) :\n\t\t\t?>\n\t\t\t<h2><?php _e( 'Menu Settings' ); ?></h2>\n\t\t\t<table id=\"menu\" class=\"form-table\">\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"row\"><?php _e( 'Enable administration menus' ); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\techo '<fieldset><legend class=\"screen-reader-text\">' . __( 'Enable menus' ) . '</legend>';\n\n\t\t\t\t\t\tforeach ( (array) $menu_items as $key => $val ) {\n\t\t\t\t\t\t\techo \"<label><input type='checkbox' name='menu_items[\" . $key . \"]' value='1'\" . ( isset( $menu_perms[ $key ] ) ? checked( $menu_perms[ $key ], '1', false ) : '' ) . ' /> ' . esc_html( $val ) . '</label><br/>';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\techo '</fieldset>';\n\t\t\t\t\t\t?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<?php\n\t\tendif;\n\t\t?>\n\n\t\t<?php\n\t\t/**\n\t\t * Fires at the end of the Network Settings form, before the submit button.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t */\n\t\tdo_action( 'wpmu_options' );\n\t\t?>\n\t\t<?php submit_button(); ?>\n\t</form>\n</div>\n\n<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 507}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Network Setup administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/network.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit Site Info Administration Screen\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'manage_sites' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to edit this site.' ) );\n}\n\nget_current_screen()->add_help_tab( get_site_screen_help_tab_args() );\nget_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );\n\n$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;\n\nif ( ! $id ) {\n\twp_die( __( 'Invalid site ID.' ) );\n}\n\n$details = get_site( $id );\nif ( ! $details ) {\n\twp_die( __( 'The requested site does not exist.' ) );\n}\n\nif ( ! can_edit_network( $details->site_id ) ) {\n\twp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );\n}\n\n$parsed_scheme = parse_url( $details->siteurl, PHP_URL_SCHEME );\n$is_main_site  = is_main_site( $id );\n\nif ( isset( $_REQUEST['action'] ) && 'update-site' === $_REQUEST['action'] ) {\n\tcheck_admin_referer( 'edit-site' );\n\n\tswitch_to_blog( $id );\n\n\t// Rewrite rules can't be flushed during switch to blog.\n\tdelete_option( 'rewrite_rules' );\n\n\t$blog_data           = wp_unslash( $_POST['blog'] );\n\t$blog_data['scheme'] = $parsed_scheme;\n\n\tif ( $is_main_site ) {\n\t\t// On the network's main site, don't allow the domain or path to change.\n\t\t$blog_data['domain'] = $details->domain;\n\t\t$blog_data['path']   = $details->path;\n\t} else {\n\t\t// For any other site, the scheme, domain, and path can all be changed. We first\n\t\t// need to ensure a scheme has been provided, otherwise fallback to the existing.\n\t\t$new_url_scheme = parse_url( $blog_data['url'], PHP_URL_SCHEME );\n\n\t\tif ( ! $new_url_scheme ) {\n\t\t\t$blog_data['url'] = esc_url( $parsed_scheme . '://' . $blog_data['url'] );\n\t\t}\n\t\t$update_parsed_url = parse_url( $blog_data['url'] );\n\n\t\t// If a path is not provided, use the default of `/`.\n\t\tif ( ! isset( $update_parsed_url['path'] ) ) {\n\t\t\t$update_parsed_url['path'] = '/';\n\t\t}\n\n\t\t$blog_data['scheme'] = $update_parsed_url['scheme'];\n\t\t$blog_data['domain'] = $update_parsed_url['host'];\n\t\t$blog_data['path']   = $update_parsed_url['path'];\n\t}\n\n\t$existing_details     = get_site( $id );\n\t$blog_data_checkboxes = array( 'public', 'archived', 'spam', 'mature', 'deleted' );\n\n\tforeach ( $blog_data_checkboxes as $c ) {\n\t\tif ( ! in_array( (int) $existing_details->$c, array( 0, 1 ), true ) ) {\n\t\t\t$blog_data[ $c ] = $existing_details->$c;\n\t\t} else {\n\t\t\t$blog_data[ $c ] = isset( $_POST['blog'][ $c ] ) ? 1 : 0;\n\t\t}\n\t}\n\n\tupdate_blog_details( $id, $blog_data );\n\n\t// Maybe update home and siteurl options.\n\t$new_details = get_site( $id );\n\n\t$old_home_url    = trailingslashit( esc_url( get_option( 'home' ) ) );\n\t$old_home_parsed = parse_url( $old_home_url );\n\n\tif ( $old_home_parsed['host'] === $existing_details->domain && $old_home_parsed['path'] === $existing_details->path ) {\n\t\t$new_home_url = untrailingslashit( esc_url_raw( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) );\n\t\tupdate_option( 'home', $new_home_url );\n\t}\n\n\t$old_site_url    = trailingslashit( esc_url( get_option( 'siteurl' ) ) );\n\t$old_site_parsed = parse_url( $old_site_url );\n\n\tif ( $old_site_parsed['host'] === $existing_details->domain && $old_site_parsed['path'] === $existing_details->path ) {\n\t\t$new_site_url = untrailingslashit( esc_url_raw( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) );\n\t\tupdate_option( 'siteurl', $new_site_url );\n\t}\n\n\trestore_current_blog();\n\twp_redirect(\n\t\tadd_query_arg(\n\t\t\tarray(\n\t\t\t\t'update' => 'updated',\n\t\t\t\t'id'     => $id,\n\t\t\t),\n\t\t\t'site-info.php'\n\t\t)\n\t);\n\texit;\n}\n\nif ( isset( $_GET['update'] ) ) {\n\t$messages = array();\n\tif ( 'updated' === $_GET['update'] ) {\n\t\t$messages[] = __( 'Site info updated.' );\n\t}\n}\n\n/* translators: %s: Site title. */\n$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );\n\n$parent_file  = 'sites.php';\n$submenu_file = 'sites.php';\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n?>\n\n<div class=\"wrap\">\n<h1 id=\"edit-site\"><?php echo $title; ?></h1>\n<p class=\"edit-site-actions\"><a href=\"<?php echo esc_url( get_home_url( $id, '/' ) ); ?>\"><?php _e( 'Visit' ); ?></a> | <a href=\"<?php echo esc_url( get_admin_url( $id ) ); ?>\"><?php _e( 'Dashboard' ); ?></a></p>\n<?php\n\nnetwork_edit_site_nav(\n\tarray(\n\t\t'blog_id'  => $id,\n\t\t'selected' => 'site-info',\n\t)\n);\n\nif ( ! empty( $messages ) ) {\n\tforeach ( $messages as $msg ) {\n\t\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . $msg . '</p></div>';\n\t}\n}\n?>\n<form method=\"post\" action=\"site-info.php?action=update-site\">\n\t<?php wp_nonce_field( 'edit-site' ); ?>\n\t<input type=\"hidden\" name=\"id\" value=\"<?php echo esc_attr( $id ); ?>\" />\n\t<table class=\"form-table\" role=\"presentation\">\n\t\t<?php\n\t\t// The main site of the network should not be updated on this page.\n\t\tif ( $is_main_site ) :\n\t\t\t?>\n\t\t<tr class=\"form-field\">\n\t\t\t<th scope=\"row\"><?php _e( 'Site Address (URL)' ); ?></th>\n\t\t\t<td><?php echo esc_url( $parsed_scheme . '://' . $details->domain . $details->path ); ?></td>\n\t\t</tr>\n\t\t\t<?php\n\t\t\t// For any other site, the scheme, domain, and path can all be changed.\n\t\telse :\n\t\t\t?>\n\t\t<tr class=\"form-field form-required\">\n\t\t\t<th scope=\"row\"><label for=\"url\"><?php _e( 'Site Address (URL)' ); ?></label></th>\n\t\t\t<td><input name=\"blog[url]\" type=\"text\" id=\"url\" value=\"<?php echo $parsed_scheme . '://' . esc_attr( $details->domain ) . esc_attr( $details->path ); ?>\" /></td>\n\t\t</tr>\n\t\t<?php endif; ?>\n\n\t\t<tr class=\"form-field\">\n\t\t\t<th scope=\"row\"><label for=\"blog_registered\"><?php _ex( 'Registered', 'site' ); ?></label></th>\n\t\t\t<td><input name=\"blog[registered]\" type=\"text\" id=\"blog_registered\" value=\"<?php echo esc_attr( $details->registered ); ?>\" /></td>\n\t\t</tr>\n\t\t<tr class=\"form-field\">\n\t\t\t<th scope=\"row\"><label for=\"blog_last_updated\"><?php _e( 'Last Updated' ); ?></label></th>\n\t\t\t<td><input name=\"blog[last_updated]\" type=\"text\" id=\"blog_last_updated\" value=\"<?php echo esc_attr( $details->last_updated ); ?>\" /></td>\n\t\t</tr>\n\t\t<?php\n\t\t$attribute_fields = array( 'public' => __( 'Public' ) );\n\t\tif ( ! $is_main_site ) {\n\t\t\t$attribute_fields['archived'] = __( 'Archived' );\n\t\t\t$attribute_fields['spam']     = _x( 'Spam', 'site' );\n\t\t\t$attribute_fields['deleted']  = __( 'Deleted' );\n\t\t}\n\t\t$attribute_fields['mature'] = __( 'Mature' );\n\t\t?>\n\t\t<tr>\n\t\t\t<th scope=\"row\"><?php _e( 'Attributes' ); ?></th>\n\t\t\t<td>\n\t\t\t<fieldset>\n\t\t\t<legend class=\"screen-reader-text\"><?php _e( 'Set site attributes' ); ?></legend>\n\t\t\t<?php foreach ( $attribute_fields as $field_key => $field_label ) : ?>\n\t\t\t\t<label><input type=\"checkbox\" name=\"blog[<?php echo $field_key; ?>]\" value=\"1\" <?php checked( (bool) $details->$field_key, true ); ?> <?php disabled( ! in_array( (int) $details->$field_key, array( 0, 1 ), true ) ); ?> />\n\t\t\t\t<?php echo $field_label; ?></label><br/>\n\t\t\t<?php endforeach; ?>\n\t\t\t<fieldset>\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n\t<?php submit_button(); ?>\n</form>\n\n</div>\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 211}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Add Site Administration Screen\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\n/** WordPress Translation Installation API */\nrequire_once ABSPATH . 'wp-admin/includes/translation-install.php';\n\nif ( ! current_user_can( 'create_sites' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to add sites to this network.' ) );\n}\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t'<p>' . __( 'This screen is for Super Admins to add new sites to the network. This is not affected by the registration settings.' ) . '</p>' .\n\t\t\t'<p>' . __( 'If the admin email for the new site does not exist in the database, a new user will also be created.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/network-admin-sites-screen/\">Documentation on Site Management</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/forum/multisite/\">Support Forums</a>' ) . '</p>'\n);\n\nif ( isset( $_REQUEST['action'] ) && 'add-site' === $_REQUEST['action'] ) {\n\tcheck_admin_referer( 'add-blog', '_wpnonce_add-blog' );\n\n\tif ( ! is_array( $_POST['blog'] ) ) {\n\t\twp_die( __( 'Can&#8217;t create an empty site.' ) );\n\t}\n\n\t$blog   = $_POST['blog'];\n\t$domain = '';\n\n\t$blog['domain'] = trim( $blog['domain'] );\n\tif ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) ) {\n\t\t$domain = strtolower( $blog['domain'] );\n\t}\n\n\t// If not a subdomain installation, make sure the domain isn't a reserved word.\n\tif ( ! is_subdomain_install() ) {\n\t\t$subdirectory_reserved_names = get_subdirectory_reserved_names();\n\n\t\tif ( in_array( $domain, $subdirectory_reserved_names, true ) ) {\n\t\t\twp_die(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Reserved names list. */\n\t\t\t\t\t__( 'The following words are reserved for use by WordPress functions and cannot be used as blog names: %s' ),\n\t\t\t\t\t'<code>' . implode( '</code>, <code>', $subdirectory_reserved_names ) . '</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\t$title = $blog['title'];\n\n\t$meta = array(\n\t\t'public' => 1,\n\t);\n\n\t// Handle translation installation for the new site.\n\tif ( isset( $_POST['WPLANG'] ) ) {\n\t\tif ( '' === $_POST['WPLANG'] ) {\n\t\t\t$meta['WPLANG'] = ''; // en_US\n\t\t} elseif ( in_array( $_POST['WPLANG'], get_available_languages(), true ) ) {\n\t\t\t$meta['WPLANG'] = $_POST['WPLANG'];\n\t\t} elseif ( current_user_can( 'install_languages' ) && wp_can_install_language_pack() ) {\n\t\t\t$language = wp_download_language_pack( wp_unslash( $_POST['WPLANG'] ) );\n\t\t\tif ( $language ) {\n\t\t\t\t$meta['WPLANG'] = $language;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( empty( $domain ) ) {\n\t\twp_die( __( 'Missing or invalid site address.' ) );\n\t}\n\n\tif ( isset( $blog['email'] ) && '' === trim( $blog['email'] ) ) {\n\t\twp_die( __( 'Missing email address.' ) );\n\t}\n\n\t$email = sanitize_email( $blog['email'] );\n\tif ( ! is_email( $email ) ) {\n\t\twp_die( __( 'Invalid email address.' ) );\n\t}\n\n\tif ( is_subdomain_install() ) {\n\t\t$newdomain = $domain . '.' . preg_replace( '|^www\\.|', '', get_network()->domain );\n\t\t$path      = get_network()->path;\n\t} else {\n\t\t$newdomain = get_network()->domain;\n\t\t$path      = get_network()->path . $domain . '/';\n\t}\n\n\t$password = 'N/A';\n\t$user_id  = email_exists( $email );\n\tif ( ! $user_id ) { // Create a new user with a random password.\n\t\t/**\n\t\t * Fires immediately before a new user is created via the network site-new.php page.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @param string $email Email of the non-existent user.\n\t\t */\n\t\tdo_action( 'pre_network_site_new_created_user', $email );\n\n\t\t$user_id = username_exists( $domain );\n\t\tif ( $user_id ) {\n\t\t\twp_die( __( 'The domain or path entered conflicts with an existing username.' ) );\n\t\t}\n\t\t$password = wp_generate_password( 12, false );\n\t\t$user_id  = wpmu_create_user( $domain, $password, $email );\n\t\tif ( false === $user_id ) {\n\t\t\twp_die( __( 'There was an error creating the user.' ) );\n\t\t}\n\n\t\t/**\n\t\t * Fires after a new user has been created via the network site-new.php page.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param int $user_id ID of the newly created user.\n\t\t */\n\t\tdo_action( 'network_site_new_created_user', $user_id );\n\t}\n\n\t$wpdb->hide_errors();\n\t$id = wpmu_create_blog( $newdomain, $path, $title, $user_id, $meta, get_current_network_id() );\n\t$wpdb->show_errors();\n\n\tif ( ! is_wp_error( $id ) ) {\n\t\tif ( ! is_super_admin( $user_id ) && ! get_user_option( 'primary_blog', $user_id ) ) {\n\t\t\tupdate_user_option( $user_id, 'primary_blog', $id, true );\n\t\t}\n\n\t\twp_mail(\n\t\t\tget_site_option( 'admin_email' ),\n\t\t\tsprintf(\n\t\t\t\t/* translators: New site notification email subject. %s: Network title. */\n\t\t\t\t__( '[%s] New Site Created' ),\n\t\t\t\tget_network()->site_name\n\t\t\t),\n\t\t\tsprintf(\n\t\t\t\t/* translators: New site notification email. 1: User login, 2: Site URL, 3: Site title. */\n\t\t\t\t__(\n\t\t\t\t\t'New site created by %1$s\n\nAddress: %2$s\nName: %3$s'\n\t\t\t\t),\n\t\t\t\t$current_user->user_login,\n\t\t\t\tget_site_url( $id ),\n\t\t\t\twp_unslash( $title )\n\t\t\t),\n\t\t\tsprintf(\n\t\t\t\t'From: \"%1$s\" <%2$s>',\n\t\t\t\t_x( 'Site Admin', 'email \"From\" field' ),\n\t\t\t\tget_site_option( 'admin_email' )\n\t\t\t)\n\t\t);\n\t\twpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) );\n\t\twp_redirect(\n\t\t\tadd_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'update' => 'added',\n\t\t\t\t\t'id'     => $id,\n\t\t\t\t),\n\t\t\t\t'site-new.php'\n\t\t\t)\n\t\t);\n\t\texit;\n\t} else {\n\t\twp_die( $id->get_error_message() );\n\t}\n}\n\nif ( isset( $_GET['update'] ) ) {\n\t$messages = array();\n\tif ( 'added' === $_GET['update'] ) {\n\t\t$messages[] = sprintf(\n\t\t\t/* translators: 1: Dashboard URL, 2: Network admin edit URL. */\n\t\t\t__( 'Site added. <a href=\"%1$s\">Visit Dashboard</a> or <a href=\"%2$s\">Edit Site</a>' ),\n\t\t\tesc_url( get_admin_url( absint( $_GET['id'] ) ) ),\n\t\t\tnetwork_admin_url( 'site-info.php?id=' . absint( $_GET['id'] ) )\n\t\t);\n\t}\n}\n\n$title       = __( 'Add New Site' );\n$parent_file = 'sites.php';\n\nwp_enqueue_script( 'user-suggest' );\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n?>\n\n<div class=\"wrap\">\n<h1 id=\"add-new-site\"><?php _e( 'Add New Site' ); ?></h1>\n<?php\nif ( ! empty( $messages ) ) {\n\tforeach ( $messages as $msg ) {\n\t\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . $msg . '</p></div>';\n\t}\n}\n?>\n<p>\n<?php\nprintf(\n\t/* translators: %s: Asterisk symbol (*). */\n\t__( 'Required fields are marked %s' ),\n\t'<span class=\"required\">*</span>'\n);\n?>\n</p>\n<form method=\"post\" action=\"<?php echo network_admin_url( 'site-new.php?action=add-site' ); ?>\" novalidate=\"novalidate\">\n<?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ); ?>\n\t<table class=\"form-table\" role=\"presentation\">\n\t\t<tr class=\"form-field form-required\">\n\t\t\t<th scope=\"row\"><label for=\"site-address\"><?php _e( 'Site Address (URL)' ); ?> <span class=\"required\">*</span></label></th>\n\t\t\t<td>\n\t\t\t<?php if ( is_subdomain_install() ) { ?>\n\t\t\t\t<input name=\"blog[domain]\" type=\"text\" class=\"regular-text ltr\" id=\"site-address\" aria-describedby=\"site-address-desc\" autocapitalize=\"none\" autocorrect=\"off\" required /><span class=\"no-break\">.<?php echo preg_replace( '|^www\\.|', '', get_network()->domain ); ?></span>\n\t\t\t\t<?php\n\t\t\t} else {\n\t\t\t\techo get_network()->domain . get_network()->path\n\t\t\t\t?>\n\t\t\t\t<input name=\"blog[domain]\" type=\"text\" class=\"regular-text ltr\" id=\"site-address\" aria-describedby=\"site-address-desc\" autocapitalize=\"none\" autocorrect=\"off\" required />\n\t\t\t\t<?php\n\t\t\t}\n\t\t\techo '<p class=\"description\" id=\"site-address-desc\">' . __( 'Only lowercase letters (a-z), numbers, and hyphens are allowed.' ) . '</p>';\n\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"form-field form-required\">\n\t\t\t<th scope=\"row\"><label for=\"site-title\"><?php _e( 'Site Title' ); ?> <span class=\"required\">*</span></label></th>\n\t\t\t<td><input name=\"blog[title]\" type=\"text\" class=\"regular-text\" id=\"site-title\" required /></td>\n\t\t</tr>\n\t\t<?php\n\t\t$languages    = get_available_languages();\n\t\t$translations = wp_get_available_translations();\n\t\tif ( ! empty( $languages ) || ! empty( $translations ) ) :\n\t\t\t?>\n\t\t\t<tr class=\"form-field form-required\">\n\t\t\t\t<th scope=\"row\"><label for=\"site-language\"><?php _e( 'Site Language' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<?php\n\t\t\t\t\t// Network default.\n\t\t\t\t\t$lang = get_site_option( 'WPLANG' );\n\n\t\t\t\t\t// Use English if the default isn't available.\n\t\t\t\t\tif ( ! in_array( $lang, $languages, true ) ) {\n\t\t\t\t\t\t$lang = '';\n\t\t\t\t\t}\n\n\t\t\t\t\twp_dropdown_languages(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'name'                        => 'WPLANG',\n\t\t\t\t\t\t\t'id'                          => 'site-language',\n\t\t\t\t\t\t\t'selected'                    => $lang,\n\t\t\t\t\t\t\t'languages'                   => $languages,\n\t\t\t\t\t\t\t'translations'                => $translations,\n\t\t\t\t\t\t\t'show_available_translations' => current_user_can( 'install_languages' ) && wp_can_install_language_pack(),\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t<?php endif; // Languages. ?>\n\t\t<tr class=\"form-field form-required\">\n\t\t\t<th scope=\"row\"><label for=\"admin-email\"><?php _e( 'Admin Email' ); ?> <span class=\"required\">*</span></label></th>\n\t\t\t<td><input name=\"blog[email]\" type=\"email\" class=\"regular-text wp-suggest-user\" id=\"admin-email\" data-autocomplete-type=\"search\" data-autocomplete-field=\"user_email\" aria-describedby=\"site-admin-email\" required /></td>\n\t\t</tr>\n\t\t<tr class=\"form-field\">\n\t\t\t<td colspan=\"2\" class=\"td-full\"><p id=\"site-admin-email\"><?php _e( 'A new user will be created if the above email address is not in the database.' ); ?><br /><?php _e( 'The username and a link to set the password will be mailed to this email address.' ); ?></p></td>\n\t\t</tr>\n\t</table>\n\n\t<?php\n\t/**\n\t * Fires at the end of the new site form in network admin.\n\t *\n\t * @since 4.5.0\n\t */\n\tdo_action( 'network_site_new_form' );\n\n\tsubmit_button( __( 'Add Site' ), 'primary', 'add-site' );\n\t?>\n\t</form>\n</div>\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 305}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit Site Settings Administration Screen\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'manage_sites' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to edit this site.' ) );\n}\n\nget_current_screen()->add_help_tab( get_site_screen_help_tab_args() );\nget_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );\n\n$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;\n\nif ( ! $id ) {\n\twp_die( __( 'Invalid site ID.' ) );\n}\n\n$details = get_site( $id );\nif ( ! $details ) {\n\twp_die( __( 'The requested site does not exist.' ) );\n}\n\nif ( ! can_edit_network( $details->site_id ) ) {\n\twp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );\n}\n\n$is_main_site = is_main_site( $id );\n\nif ( isset( $_REQUEST['action'] ) && 'update-site' === $_REQUEST['action'] && is_array( $_POST['option'] ) ) {\n\tcheck_admin_referer( 'edit-site' );\n\n\tswitch_to_blog( $id );\n\n\t$skip_options = array( 'allowedthemes' ); // Don't update these options since they are handled elsewhere in the form.\n\tforeach ( (array) $_POST['option'] as $key => $val ) {\n\t\t$key = wp_unslash( $key );\n\t\t$val = wp_unslash( $val );\n\t\tif ( 0 === $key || is_array( $val ) || in_array( $key, $skip_options, true ) ) {\n\t\t\tcontinue; // Avoids \"0 is a protected WP option and may not be modified\" error when editing blog options.\n\t\t}\n\t\tupdate_option( $key, $val );\n\t}\n\n\t/**\n\t * Fires after the site options are updated.\n\t *\n\t * @since 3.0.0\n\t * @since 4.4.0 Added `$id` parameter.\n\t *\n\t * @param int $id The ID of the site being updated.\n\t */\n\tdo_action( 'wpmu_update_blog_options', $id );\n\n\trestore_current_blog();\n\twp_redirect(\n\t\tadd_query_arg(\n\t\t\tarray(\n\t\t\t\t'update' => 'updated',\n\t\t\t\t'id'     => $id,\n\t\t\t),\n\t\t\t'site-settings.php'\n\t\t)\n\t);\n\texit;\n}\n\nif ( isset( $_GET['update'] ) ) {\n\t$messages = array();\n\tif ( 'updated' === $_GET['update'] ) {\n\t\t$messages[] = __( 'Site options updated.' );\n\t}\n}\n\n/* translators: %s: Site title. */\n$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );\n\n$parent_file  = 'sites.php';\n$submenu_file = 'sites.php';\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n?>\n\n<div class=\"wrap\">\n<h1 id=\"edit-site\"><?php echo $title; ?></h1>\n<p class=\"edit-site-actions\"><a href=\"<?php echo esc_url( get_home_url( $id, '/' ) ); ?>\"><?php _e( 'Visit' ); ?></a> | <a href=\"<?php echo esc_url( get_admin_url( $id ) ); ?>\"><?php _e( 'Dashboard' ); ?></a></p>\n\n<?php\n\nnetwork_edit_site_nav(\n\tarray(\n\t\t'blog_id'  => $id,\n\t\t'selected' => 'site-settings',\n\t)\n);\n\nif ( ! empty( $messages ) ) {\n\tforeach ( $messages as $msg ) {\n\t\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . $msg . '</p></div>';\n\t}\n}\n?>\n<form method=\"post\" action=\"site-settings.php?action=update-site\">\n\t<?php wp_nonce_field( 'edit-site' ); ?>\n\t<input type=\"hidden\" name=\"id\" value=\"<?php echo esc_attr( $id ); ?>\" />\n\t<table class=\"form-table\" role=\"presentation\">\n\t\t<?php\n\t\t$blog_prefix = $wpdb->get_blog_prefix( $id );\n\t\t$sql         = \"SELECT * FROM {$blog_prefix}options\n\t\t\tWHERE option_name NOT LIKE %s\n\t\t\tAND option_name NOT LIKE %s\";\n\t\t$query       = $wpdb->prepare(\n\t\t\t$sql,\n\t\t\t$wpdb->esc_like( '_' ) . '%',\n\t\t\t'%' . $wpdb->esc_like( 'user_roles' )\n\t\t);\n\t\t$options     = $wpdb->get_results( $query );\n\n\t\tforeach ( $options as $option ) {\n\t\t\tif ( 'default_role' === $option->option_name ) {\n\t\t\t\t$editblog_default_role = $option->option_value;\n\t\t\t}\n\n\t\t\t$disabled = false;\n\t\t\t$class    = 'all-options';\n\n\t\t\tif ( is_serialized( $option->option_value ) ) {\n\t\t\t\tif ( is_serialized_string( $option->option_value ) ) {\n\t\t\t\t\t$option->option_value = esc_html( maybe_unserialize( $option->option_value ) );\n\t\t\t\t} else {\n\t\t\t\t\t$option->option_value = 'SERIALIZED DATA';\n\t\t\t\t\t$disabled             = true;\n\t\t\t\t\t$class                = 'all-options disabled';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( strpos( $option->option_value, \"\\n\" ) !== false ) {\n\t\t\t\t?>\n\t\t\t\t<tr class=\"form-field\">\n\t\t\t\t\t<th scope=\"row\"><label for=\"<?php echo esc_attr( $option->option_name ); ?>\"><?php echo ucwords( str_replace( '_', ' ', $option->option_name ) ); ?></label></th>\n\t\t\t\t\t<td><textarea class=\"<?php echo $class; ?>\" rows=\"5\" cols=\"40\" name=\"option[<?php echo esc_attr( $option->option_name ); ?>]\" id=\"<?php echo esc_attr( $option->option_name ); ?>\"<?php disabled( $disabled ); ?>><?php echo esc_textarea( $option->option_value ); ?></textarea></td>\n\t\t\t\t</tr>\n\t\t\t\t<?php\n\t\t\t} else {\n\t\t\t\t?>\n\t\t\t\t<tr class=\"form-field\">\n\t\t\t\t\t<th scope=\"row\"><label for=\"<?php echo esc_attr( $option->option_name ); ?>\"><?php echo esc_html( ucwords( str_replace( '_', ' ', $option->option_name ) ) ); ?></label></th>\n\t\t\t\t\t<?php if ( $is_main_site && in_array( $option->option_name, array( 'siteurl', 'home' ), true ) ) { ?>\n\t\t\t\t\t<td><code><?php echo esc_html( $option->option_value ); ?></code></td>\n\t\t\t\t\t<?php } else { ?>\n\t\t\t\t\t<td><input class=\"<?php echo $class; ?>\" name=\"option[<?php echo esc_attr( $option->option_name ); ?>]\" type=\"text\" id=\"<?php echo esc_attr( $option->option_name ); ?>\" value=\"<?php echo esc_attr( $option->option_value ); ?>\" size=\"40\" <?php disabled( $disabled ); ?> /></td>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</tr>\n\t\t\t\t<?php\n\t\t\t}\n\t\t} // End foreach.\n\n\t\t/**\n\t\t * Fires at the end of the Edit Site form, before the submit button.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param int $id Site ID.\n\t\t */\n\t\tdo_action( 'wpmueditblogaction', $id );\n\t\t?>\n\t</table>\n\t<?php submit_button(); ?>\n</form>\n\n</div>\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 182}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit Site Themes Administration Screen\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'manage_sites' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to manage themes for this site.' ) );\n}\n\nget_current_screen()->add_help_tab( get_site_screen_help_tab_args() );\nget_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );\n\nget_current_screen()->set_screen_reader_content(\n\tarray(\n\t\t'heading_views'      => __( 'Filter site themes list' ),\n\t\t'heading_pagination' => __( 'Site themes list navigation' ),\n\t\t'heading_list'       => __( 'Site themes list' ),\n\t)\n);\n\n$wp_list_table = _get_list_table( 'WP_MS_Themes_List_Table' );\n\n$action = $wp_list_table->current_action();\n\n$s = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';\n\n// Clean up request URI from temporary args for screen options/paging uri's to work as expected.\n$temp_args              = array( 'enabled', 'disabled', 'error' );\n$_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI'] );\n$referer                = remove_query_arg( $temp_args, wp_get_referer() );\n\nif ( ! empty( $_REQUEST['paged'] ) ) {\n\t$referer = add_query_arg( 'paged', (int) $_REQUEST['paged'], $referer );\n}\n\n$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;\n\nif ( ! $id ) {\n\twp_die( __( 'Invalid site ID.' ) );\n}\n\n$wp_list_table->prepare_items();\n\n$details = get_site( $id );\nif ( ! $details ) {\n\twp_die( __( 'The requested site does not exist.' ) );\n}\n\nif ( ! can_edit_network( $details->site_id ) ) {\n\twp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );\n}\n\n$is_main_site = is_main_site( $id );\n\nif ( $action ) {\n\tswitch_to_blog( $id );\n\t$allowed_themes = get_option( 'allowedthemes' );\n\n\tswitch ( $action ) {\n\t\tcase 'enable':\n\t\t\tcheck_admin_referer( 'enable-theme_' . $_GET['theme'] );\n\t\t\t$theme  = $_GET['theme'];\n\t\t\t$action = 'enabled';\n\t\t\t$n      = 1;\n\t\t\tif ( ! $allowed_themes ) {\n\t\t\t\t$allowed_themes = array( $theme => true );\n\t\t\t} else {\n\t\t\t\t$allowed_themes[ $theme ] = true;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'disable':\n\t\t\tcheck_admin_referer( 'disable-theme_' . $_GET['theme'] );\n\t\t\t$theme  = $_GET['theme'];\n\t\t\t$action = 'disabled';\n\t\t\t$n      = 1;\n\t\t\tif ( ! $allowed_themes ) {\n\t\t\t\t$allowed_themes = array();\n\t\t\t} else {\n\t\t\t\tunset( $allowed_themes[ $theme ] );\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'enable-selected':\n\t\t\tcheck_admin_referer( 'bulk-themes' );\n\t\t\tif ( isset( $_POST['checked'] ) ) {\n\t\t\t\t$themes = (array) $_POST['checked'];\n\t\t\t\t$action = 'enabled';\n\t\t\t\t$n      = count( $themes );\n\t\t\t\tforeach ( (array) $themes as $theme ) {\n\t\t\t\t\t$allowed_themes[ $theme ] = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$action = 'error';\n\t\t\t\t$n      = 'none';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'disable-selected':\n\t\t\tcheck_admin_referer( 'bulk-themes' );\n\t\t\tif ( isset( $_POST['checked'] ) ) {\n\t\t\t\t$themes = (array) $_POST['checked'];\n\t\t\t\t$action = 'disabled';\n\t\t\t\t$n      = count( $themes );\n\t\t\t\tforeach ( (array) $themes as $theme ) {\n\t\t\t\t\tunset( $allowed_themes[ $theme ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$action = 'error';\n\t\t\t\t$n      = 'none';\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif ( isset( $_POST['checked'] ) ) {\n\t\t\t\tcheck_admin_referer( 'bulk-themes' );\n\t\t\t\t$themes = (array) $_POST['checked'];\n\t\t\t\t$n      = count( $themes );\n\t\t\t\t$screen = get_current_screen()->id;\n\n\t\t\t\t/**\n\t\t\t\t * Fires when a custom bulk action should be handled.\n\t\t\t\t *\n\t\t\t\t * The redirect link should be modified with success or failure feedback\n\t\t\t\t * from the action to be used to display feedback to the user.\n\t\t\t\t *\n\t\t\t\t * The dynamic portion of the hook name, `$screen`, refers to the current screen ID.\n\t\t\t\t *\n\t\t\t\t * @since 4.7.0\n\t\t\t\t *\n\t\t\t\t * @param string $redirect_url The redirect URL.\n\t\t\t\t * @param string $action       The action being taken.\n\t\t\t\t * @param array  $items        The items to take the action on.\n\t\t\t\t * @param int    $site_id      The site ID.\n\t\t\t\t */\n\t\t\t\t$referer = apply_filters( \"handle_network_bulk_actions-{$screen}\", $referer, $action, $themes, $id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t\t\t} else {\n\t\t\t\t$action = 'error';\n\t\t\t\t$n      = 'none';\n\t\t\t}\n\t}\n\n\tupdate_option( 'allowedthemes', $allowed_themes );\n\trestore_current_blog();\n\n\twp_safe_redirect(\n\t\tadd_query_arg(\n\t\t\tarray(\n\t\t\t\t'id'    => $id,\n\t\t\t\t$action => $n,\n\t\t\t),\n\t\t\t$referer\n\t\t)\n\t);\n\texit;\n}\n\nif ( isset( $_GET['action'] ) && 'update-site' === $_GET['action'] ) {\n\twp_safe_redirect( $referer );\n\texit;\n}\n\nadd_thickbox();\nadd_screen_option( 'per_page' );\n\n/* translators: %s: Site title. */\n$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );\n\n$parent_file  = 'sites.php';\n$submenu_file = 'sites.php';\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php'; ?>\n\n<div class=\"wrap\">\n<h1 id=\"edit-site\"><?php echo $title; ?></h1>\n<p class=\"edit-site-actions\"><a href=\"<?php echo esc_url( get_home_url( $id, '/' ) ); ?>\"><?php _e( 'Visit' ); ?></a> | <a href=\"<?php echo esc_url( get_admin_url( $id ) ); ?>\"><?php _e( 'Dashboard' ); ?></a></p>\n<?php\n\nnetwork_edit_site_nav(\n\tarray(\n\t\t'blog_id'  => $id,\n\t\t'selected' => 'site-themes',\n\t)\n);\n\nif ( isset( $_GET['enabled'] ) ) {\n\t$enabled = absint( $_GET['enabled'] );\n\tif ( 1 === $enabled ) {\n\t\t$message = __( 'Theme enabled.' );\n\t} else {\n\t\t/* translators: %s: Number of themes. */\n\t\t$message = _n( '%s theme enabled.', '%s themes enabled.', $enabled );\n\t}\n\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';\n} elseif ( isset( $_GET['disabled'] ) ) {\n\t$disabled = absint( $_GET['disabled'] );\n\tif ( 1 === $disabled ) {\n\t\t$message = __( 'Theme disabled.' );\n\t} else {\n\t\t/* translators: %s: Number of themes. */\n\t\t$message = _n( '%s theme disabled.', '%s themes disabled.', $disabled );\n\t}\n\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';\n} elseif ( isset( $_GET['error'] ) && 'none' === $_GET['error'] ) {\n\techo '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . __( 'No theme selected.' ) . '</p></div>';\n}\n?>\n\n<p><?php _e( 'Network enabled themes are not shown on this screen.' ); ?></p>\n\n<form method=\"get\">\n<?php $wp_list_table->search_box( __( 'Search Installed Themes' ), 'theme' ); ?>\n<input type=\"hidden\" name=\"id\" value=\"<?php echo esc_attr( $id ); ?>\" />\n</form>\n\n<?php $wp_list_table->views(); ?>\n\n<form method=\"post\" action=\"site-themes.php?action=update-site\">\n\t<input type=\"hidden\" name=\"id\" value=\"<?php echo esc_attr( $id ); ?>\" />\n\n<?php $wp_list_table->display(); ?>\n\n</form>\n\n</div>\n<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 230}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit Site Users Administration Screen\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'manage_sites' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to edit this site.' ), 403 );\n}\n\n$wp_list_table = _get_list_table( 'WP_Users_List_Table' );\n$wp_list_table->prepare_items();\n\nget_current_screen()->add_help_tab( get_site_screen_help_tab_args() );\nget_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );\n\nget_current_screen()->set_screen_reader_content(\n\tarray(\n\t\t'heading_views'      => __( 'Filter site users list' ),\n\t\t'heading_pagination' => __( 'Site users list navigation' ),\n\t\t'heading_list'       => __( 'Site users list' ),\n\t)\n);\n\n$_SERVER['REQUEST_URI'] = remove_query_arg( 'update', $_SERVER['REQUEST_URI'] );\n$referer                = remove_query_arg( 'update', wp_get_referer() );\n\nif ( ! empty( $_REQUEST['paged'] ) ) {\n\t$referer = add_query_arg( 'paged', (int) $_REQUEST['paged'], $referer );\n}\n\n$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;\n\nif ( ! $id ) {\n\twp_die( __( 'Invalid site ID.' ) );\n}\n\n$details = get_site( $id );\nif ( ! $details ) {\n\twp_die( __( 'The requested site does not exist.' ) );\n}\n\nif ( ! can_edit_network( $details->site_id ) ) {\n\twp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );\n}\n\n$is_main_site = is_main_site( $id );\n\nswitch_to_blog( $id );\n\n$action = $wp_list_table->current_action();\n\nif ( $action ) {\n\n\tswitch ( $action ) {\n\t\tcase 'newuser':\n\t\t\tcheck_admin_referer( 'add-user', '_wpnonce_add-new-user' );\n\t\t\t$user = $_POST['user'];\n\t\t\tif ( ! is_array( $_POST['user'] ) || empty( $user['username'] ) || empty( $user['email'] ) ) {\n\t\t\t\t$update = 'err_new';\n\t\t\t} else {\n\t\t\t\t$password = wp_generate_password( 12, false );\n\t\t\t\t$user_id  = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );\n\n\t\t\t\tif ( false === $user_id ) {\n\t\t\t\t\t$update = 'err_new_dup';\n\t\t\t\t} else {\n\t\t\t\t\t$result = add_user_to_blog( $id, $user_id, $_POST['new_role'] );\n\n\t\t\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\t\t\t$update = 'err_add_fail';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$update = 'newuser';\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Fires after a user has been created via the network site-users.php page.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @since 4.4.0\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @param int $user_id ID of the newly created user.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tdo_action( 'network_site_users_created_user', $user_id );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'adduser':\n\t\t\tcheck_admin_referer( 'add-user', '_wpnonce_add-user' );\n\t\t\tif ( ! empty( $_POST['newuser'] ) ) {\n\t\t\t\t$update  = 'adduser';\n\t\t\t\t$newuser = $_POST['newuser'];\n\t\t\t\t$user    = get_user_by( 'login', $newuser );\n\t\t\t\tif ( $user && $user->exists() ) {\n\t\t\t\t\tif ( ! is_user_member_of_blog( $user->ID, $id ) ) {\n\t\t\t\t\t\t$result = add_user_to_blog( $id, $user->ID, $_POST['new_role'] );\n\n\t\t\t\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\t\t\t\t$update = 'err_add_fail';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$update = 'err_add_member';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$update = 'err_add_notfound';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$update = 'err_add_notfound';\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'remove':\n\t\t\tif ( ! current_user_can( 'remove_users' ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to remove users.' ), 403 );\n\t\t\t}\n\n\t\t\tcheck_admin_referer( 'bulk-users' );\n\n\t\t\t$update = 'remove';\n\t\t\tif ( isset( $_REQUEST['users'] ) ) {\n\t\t\t\t$userids = $_REQUEST['users'];\n\n\t\t\t\tforeach ( $userids as $user_id ) {\n\t\t\t\t\t$user_id = (int) $user_id;\n\t\t\t\t\tremove_user_from_blog( $user_id, $id );\n\t\t\t\t}\n\t\t\t} elseif ( isset( $_GET['user'] ) ) {\n\t\t\t\tremove_user_from_blog( $_GET['user'] );\n\t\t\t} else {\n\t\t\t\t$update = 'err_remove';\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'promote':\n\t\t\tcheck_admin_referer( 'bulk-users' );\n\t\t\t$editable_roles = get_editable_roles();\n\t\t\t$role           = false;\n\t\t\tif ( ! empty( $_REQUEST['new_role2'] ) ) {\n\t\t\t\t$role = $_REQUEST['new_role2'];\n\t\t\t} elseif ( ! empty( $_REQUEST['new_role'] ) ) {\n\t\t\t\t$role = $_REQUEST['new_role'];\n\t\t\t}\n\n\t\t\tif ( empty( $editable_roles[ $role ] ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 );\n\t\t\t}\n\n\t\t\tif ( isset( $_REQUEST['users'] ) ) {\n\t\t\t\t$userids = $_REQUEST['users'];\n\t\t\t\t$update  = 'promote';\n\t\t\t\tforeach ( $userids as $user_id ) {\n\t\t\t\t\t$user_id = (int) $user_id;\n\n\t\t\t\t\t// If the user doesn't already belong to the blog, bail.\n\t\t\t\t\tif ( ! is_user_member_of_blog( $user_id ) ) {\n\t\t\t\t\t\twp_die(\n\t\t\t\t\t\t\t'<h1>' . __( 'Something went wrong.' ) . '</h1>' .\n\t\t\t\t\t\t\t'<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>',\n\t\t\t\t\t\t\t403\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$user = get_userdata( $user_id );\n\t\t\t\t\t$user->set_role( $role );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$update = 'err_promote';\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif ( ! isset( $_REQUEST['users'] ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcheck_admin_referer( 'bulk-users' );\n\t\t\t$userids = $_REQUEST['users'];\n\n\t\t\t/** This action is documented in wp-admin/network/site-themes.php */\n\t\t\t$referer = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $referer, $action, $userids, $id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\t\t$update = $action;\n\t\t\tbreak;\n\t}\n\n\twp_safe_redirect( add_query_arg( 'update', $update, $referer ) );\n\texit;\n}\n\nrestore_current_blog();\n\nif ( isset( $_GET['action'] ) && 'update-site' === $_GET['action'] ) {\n\twp_safe_redirect( $referer );\n\texit;\n}\n\nadd_screen_option( 'per_page' );\n\n/* translators: %s: Site title. */\n$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );\n\n$parent_file  = 'sites.php';\n$submenu_file = 'sites.php';\n\n/**\n * Filters whether to show the Add Existing User form on the Multisite Users screen.\n *\n * @since 3.1.0\n *\n * @param bool $bool Whether to show the Add Existing User form. Default true.\n */\nif ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) {\n\twp_enqueue_script( 'user-suggest' );\n}\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php'; ?>\n\n<script type=\"text/javascript\">\nvar current_site_id = <?php echo absint( $id ); ?>;\n</script>\n\n\n<div class=\"wrap\">\n<h1 id=\"edit-site\"><?php echo $title; ?></h1>\n<p class=\"edit-site-actions\"><a href=\"<?php echo esc_url( get_home_url( $id, '/' ) ); ?>\"><?php _e( 'Visit' ); ?></a> | <a href=\"<?php echo esc_url( get_admin_url( $id ) ); ?>\"><?php _e( 'Dashboard' ); ?></a></p>\n<?php\n\nnetwork_edit_site_nav(\n\tarray(\n\t\t'blog_id'  => $id,\n\t\t'selected' => 'site-users',\n\t)\n);\n\nif ( isset( $_GET['update'] ) ) :\n\tswitch ( $_GET['update'] ) {\n\t\tcase 'adduser':\n\t\t\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . __( 'User added.' ) . '</p></div>';\n\t\t\tbreak;\n\t\tcase 'err_add_member':\n\t\t\techo '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . __( 'User is already a member of this site.' ) . '</p></div>';\n\t\t\tbreak;\n\t\tcase 'err_add_fail':\n\t\t\techo '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . __( 'User could not be added to this site.' ) . '</p></div>';\n\t\t\tbreak;\n\t\tcase 'err_add_notfound':\n\t\t\techo '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>';\n\t\t\tbreak;\n\t\tcase 'promote':\n\t\t\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . __( 'Changed roles.' ) . '</p></div>';\n\t\t\tbreak;\n\t\tcase 'err_promote':\n\t\t\techo '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . __( 'Select a user to change role.' ) . '</p></div>';\n\t\t\tbreak;\n\t\tcase 'remove':\n\t\t\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . __( 'User removed from this site.' ) . '</p></div>';\n\t\t\tbreak;\n\t\tcase 'err_remove':\n\t\t\techo '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . __( 'Select a user to remove.' ) . '</p></div>';\n\t\t\tbreak;\n\t\tcase 'newuser':\n\t\t\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . __( 'User created.' ) . '</p></div>';\n\t\t\tbreak;\n\t\tcase 'err_new':\n\t\t\techo '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . __( 'Enter the username and email.' ) . '</p></div>';\n\t\t\tbreak;\n\t\tcase 'err_new_dup':\n\t\t\techo '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>';\n\t\t\tbreak;\n\t}\nendif;\n?>\n\n<form class=\"search-form\" method=\"get\">\n<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>\n<input type=\"hidden\" name=\"id\" value=\"<?php echo esc_attr( $id ); ?>\" />\n</form>\n\n<?php $wp_list_table->views(); ?>\n\n<form method=\"post\" action=\"site-users.php?action=update-site\">\n\t<input type=\"hidden\" name=\"id\" value=\"<?php echo esc_attr( $id ); ?>\" />\n\n<?php $wp_list_table->display(); ?>\n\n</form>\n\n<?php\n/**\n * Fires after the list table on the Users screen in the Multisite Network Admin.\n *\n * @since 3.1.0\n */\ndo_action( 'network_site_users_after_list_table' );\n\n/** This filter is documented in wp-admin/network/site-users.php */\nif ( current_user_can( 'promote_users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) :\n\t?>\n<h2 id=\"add-existing-user\"><?php _e( 'Add Existing User' ); ?></h2>\n<form action=\"site-users.php?action=adduser\" id=\"adduser\" method=\"post\">\n\t<input type=\"hidden\" name=\"id\" value=\"<?php echo esc_attr( $id ); ?>\" />\n\t<table class=\"form-table\" role=\"presentation\">\n\t\t<tr>\n\t\t\t<th scope=\"row\"><label for=\"newuser\"><?php _e( 'Username' ); ?></label></th>\n\t\t\t<td><input type=\"text\" class=\"regular-text wp-suggest-user\" name=\"newuser\" id=\"newuser\" /></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th scope=\"row\"><label for=\"new_role_adduser\"><?php _e( 'Role' ); ?></label></th>\n\t\t\t<td><select name=\"new_role\" id=\"new_role_adduser\">\n\t\t\t<?php\n\t\t\tswitch_to_blog( $id );\n\t\t\twp_dropdown_roles( get_option( 'default_role' ) );\n\t\t\trestore_current_blog();\n\t\t\t?>\n\t\t\t</select></td>\n\t\t</tr>\n\t</table>\n\t<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ); ?>\n\t<?php submit_button( __( 'Add User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-existing-user' ) ); ?>\n</form>\n<?php endif; ?>\n\n<?php\n/**\n * Filters whether to show the Add New User form on the Multisite Users screen.\n *\n * @since 3.1.0\n *\n * @param bool $bool Whether to show the Add New User form. Default true.\n */\nif ( current_user_can( 'create_users' ) && apply_filters( 'show_network_site_users_add_new_form', true ) ) :\n\t?>\n<h2 id=\"add-new-user\"><?php _e( 'Add New User' ); ?></h2>\n<form action=\"<?php echo network_admin_url( 'site-users.php?action=newuser' ); ?>\" id=\"newuser\" method=\"post\">\n\t<input type=\"hidden\" name=\"id\" value=\"<?php echo esc_attr( $id ); ?>\" />\n\t<table class=\"form-table\" role=\"presentation\">\n\t\t<tr>\n\t\t\t<th scope=\"row\"><label for=\"user_username\"><?php _e( 'Username' ); ?></label></th>\n\t\t\t<td><input type=\"text\" class=\"regular-text\" name=\"user[username]\" id=\"user_username\" /></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th scope=\"row\"><label for=\"user_email\"><?php _e( 'Email' ); ?></label></th>\n\t\t\t<td><input type=\"text\" class=\"regular-text\" name=\"user[email]\" id=\"user_email\" /></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th scope=\"row\"><label for=\"new_role_newuser\"><?php _e( 'Role' ); ?></label></th>\n\t\t\t<td><select name=\"new_role\" id=\"new_role_newuser\">\n\t\t\t<?php\n\t\t\tswitch_to_blog( $id );\n\t\t\twp_dropdown_roles( get_option( 'default_role' ) );\n\t\t\trestore_current_blog();\n\t\t\t?>\n\t\t\t</select></td>\n\t\t</tr>\n\t\t<tr class=\"form-field\">\n\t\t\t<td colspan=\"2\" class=\"td-full\"><?php _e( 'A password reset link will be sent to the user via email.' ); ?></td>\n\t\t</tr>\n\t</table>\n\t<?php wp_nonce_field( 'add-user', '_wpnonce_add-new-user' ); ?>\n\t<?php submit_button( __( 'Add New User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-user' ) ); ?>\n</form>\n<?php endif; ?>\n</div>\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 370}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite sites administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'manage_sites' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );\n}\n\n$wp_list_table = _get_list_table( 'WP_MS_Sites_List_Table' );\n$pagenum       = $wp_list_table->get_pagenum();\n\n$title       = __( 'Sites' );\n$parent_file = 'sites.php';\n\nadd_screen_option( 'per_page' );\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t'<p>' . __( 'Add New takes you to the Add New Site screen. You can search for a site by Name, ID number, or IP address. Screen Options allows you to choose how many sites to display on one page.' ) . '</p>' .\n\t\t\t'<p>' . __( 'This is the main table of all sites on this network. Switch between list and excerpt views by using the icons above the right side of the table.' ) . '</p>' .\n\t\t\t'<p>' . __( 'Hovering over each site reveals seven options (three for the primary site):' ) . '</p>' .\n\t\t\t'<ul><li>' . __( 'An Edit link to a separate Edit Site screen.' ) . '</li>' .\n\t\t\t'<li>' . __( 'Dashboard leads to the Dashboard for that site.' ) . '</li>' .\n\t\t\t'<li>' . __( 'Deactivate, Archive, and Spam which lead to confirmation screens. These actions can be reversed later.' ) . '</li>' .\n\t\t\t'<li>' . __( 'Delete which is a permanent action after the confirmation screens.' ) . '</li>' .\n\t\t\t'<li>' . __( 'Visit to go to the front-end site live.' ) . '</li></ul>' .\n\t\t\t'<p>' . __( 'The site ID is used internally, and is not shown on the front end of the site or to users/viewers.' ) . '</p>' .\n\t\t\t'<p>' . __( 'Clicking on bold headings can re-sort this table.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/network-admin-sites-screen/\">Documentation on Site Management</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/forum/multisite/\">Support Forums</a>' ) . '</p>'\n);\n\nget_current_screen()->set_screen_reader_content(\n\tarray(\n\t\t'heading_pagination' => __( 'Sites list navigation' ),\n\t\t'heading_list'       => __( 'Sites list' ),\n\t)\n);\n\n$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;\n\nif ( isset( $_GET['action'] ) ) {\n\t/** This action is documented in wp-admin/network/edit.php */\n\tdo_action( 'wpmuadminedit' );\n\n\t// A list of valid actions and their associated messaging for confirmation output.\n\t$manage_actions = array(\n\t\t/* translators: %s: Site URL. */\n\t\t'activateblog'   => __( 'You are about to activate the site %s.' ),\n\t\t/* translators: %s: Site URL. */\n\t\t'deactivateblog' => __( 'You are about to deactivate the site %s.' ),\n\t\t/* translators: %s: Site URL. */\n\t\t'unarchiveblog'  => __( 'You are about to unarchive the site %s.' ),\n\t\t/* translators: %s: Site URL. */\n\t\t'archiveblog'    => __( 'You are about to archive the site %s.' ),\n\t\t/* translators: %s: Site URL. */\n\t\t'unspamblog'     => __( 'You are about to unspam the site %s.' ),\n\t\t/* translators: %s: Site URL. */\n\t\t'spamblog'       => __( 'You are about to mark the site %s as spam.' ),\n\t\t/* translators: %s: Site URL. */\n\t\t'deleteblog'     => __( 'You are about to delete the site %s.' ),\n\t\t/* translators: %s: Site URL. */\n\t\t'unmatureblog'   => __( 'You are about to mark the site %s as mature.' ),\n\t\t/* translators: %s: Site URL. */\n\t\t'matureblog'     => __( 'You are about to mark the site %s as not mature.' ),\n\t);\n\n\tif ( 'confirm' === $_GET['action'] ) {\n\t\t// The action2 parameter contains the action being taken on the site.\n\t\t$site_action = $_GET['action2'];\n\n\t\tif ( ! array_key_exists( $site_action, $manage_actions ) ) {\n\t\t\twp_die( __( 'The requested action is not valid.' ) );\n\t\t}\n\n\t\t// The mature/unmature UI exists only as external code. Check the \"confirm\" nonce for backward compatibility.\n\t\tif ( 'matureblog' === $site_action || 'unmatureblog' === $site_action ) {\n\t\t\tcheck_admin_referer( 'confirm' );\n\t\t} else {\n\t\t\tcheck_admin_referer( $site_action . '_' . $id );\n\t\t}\n\n\t\tif ( ! headers_sent() ) {\n\t\t\tnocache_headers();\n\t\t\theader( 'Content-Type: text/html; charset=utf-8' );\n\t\t}\n\n\t\tif ( get_network()->site_id == $id ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to change the current site.' ) );\n\t\t}\n\n\t\t$site_details = get_site( $id );\n\t\t$site_address = untrailingslashit( $site_details->domain . $site_details->path );\n\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t\t?>\n\t\t\t<div class=\"wrap\">\n\t\t\t\t<h1><?php _e( 'Confirm your action' ); ?></h1>\n\t\t\t\t<form action=\"sites.php?action=<?php echo esc_attr( $site_action ); ?>\" method=\"post\">\n\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"<?php echo esc_attr( $site_action ); ?>\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"<?php echo esc_attr( $id ); ?>\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"_wp_http_referer\" value=\"<?php echo esc_attr( wp_get_referer() ); ?>\" />\n\t\t\t\t\t<?php wp_nonce_field( $site_action . '_' . $id, '_wpnonce', false ); ?>\n\t\t\t\t\t<p><?php printf( $manage_actions[ $site_action ], $site_address ); ?></p>\n\t\t\t\t\t<?php submit_button( __( 'Confirm' ), 'primary' ); ?>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t<?php\n\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t\texit;\n\t} elseif ( array_key_exists( $_GET['action'], $manage_actions ) ) {\n\t\t$action = $_GET['action'];\n\t\tcheck_admin_referer( $action . '_' . $id );\n\t} elseif ( 'allblogs' === $_GET['action'] ) {\n\t\tcheck_admin_referer( 'bulk-sites' );\n\t}\n\n\t$updated_action = '';\n\n\tswitch ( $_GET['action'] ) {\n\n\t\tcase 'deleteblog':\n\t\t\tif ( ! current_user_can( 'delete_sites' ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to access this page.' ), '', array( 'response' => 403 ) );\n\t\t\t}\n\n\t\t\t$updated_action = 'not_deleted';\n\t\t\tif ( '0' != $id && get_network()->site_id != $id && current_user_can( 'delete_site', $id ) ) {\n\t\t\t\twpmu_delete_blog( $id, true );\n\t\t\t\t$updated_action = 'delete';\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'delete_sites':\n\t\t\tcheck_admin_referer( 'ms-delete-sites' );\n\n\t\t\tforeach ( (array) $_POST['site_ids'] as $site_id ) {\n\t\t\t\t$site_id = (int) $site_id;\n\n\t\t\t\tif ( get_network()->site_id == $site_id ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( ! current_user_can( 'delete_site', $site_id ) ) {\n\t\t\t\t\t$site         = get_site( $site_id );\n\t\t\t\t\t$site_address = untrailingslashit( $site->domain . $site->path );\n\n\t\t\t\t\twp_die(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: Site URL. */\n\t\t\t\t\t\t\t__( 'Sorry, you are not allowed to delete the site %s.' ),\n\t\t\t\t\t\t\t$site_address\n\t\t\t\t\t\t),\n\t\t\t\t\t\t403\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$updated_action = 'all_delete';\n\t\t\t\twpmu_delete_blog( $site_id, true );\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'allblogs':\n\t\t\tif ( ( isset( $_POST['action'] ) || isset( $_POST['action2'] ) ) && isset( $_POST['allblogs'] ) ) {\n\t\t\t\t$doaction = -1 != $_POST['action'] ? $_POST['action'] : $_POST['action2'];\n\n\t\t\t\tforeach ( (array) $_POST['allblogs'] as $key => $val ) {\n\t\t\t\t\tif ( '0' != $val && get_network()->site_id != $val ) {\n\t\t\t\t\t\tswitch ( $doaction ) {\n\t\t\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\t\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<div class=\"wrap\">\n\t\t\t\t\t\t\t\t\t<h1><?php _e( 'Confirm your action' ); ?></h1>\n\t\t\t\t\t\t\t\t\t<form action=\"sites.php?action=delete_sites\" method=\"post\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"delete_sites\" />\n\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"_wp_http_referer\" value=\"<?php echo esc_attr( wp_get_referer() ); ?>\" />\n\t\t\t\t\t\t\t\t\t\t<?php wp_nonce_field( 'ms-delete-sites', '_wpnonce', false ); ?>\n\t\t\t\t\t\t\t\t\t\t<p><?php _e( 'You are about to delete the following sites:' ); ?></p>\n\t\t\t\t\t\t\t\t\t\t<ul class=\"ul-disc\">\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\tforeach ( $_POST['allblogs'] as $site_id ) :\n\t\t\t\t\t\t\t\t\t\t\t\t$site         = get_site( $site_id );\n\t\t\t\t\t\t\t\t\t\t\t\t$site_address = untrailingslashit( $site->domain . $site->path );\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo $site_address; ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"site_ids[]\" value=\"<?php echo (int) $site_id; ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t<?php submit_button( __( 'Confirm' ), 'primary' ); ?>\n\t\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t\t\t\t\t\t\t\texit;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'spam':\n\t\t\t\t\t\t\tcase 'notspam':\n\t\t\t\t\t\t\t\t$updated_action = ( 'spam' === $doaction ) ? 'all_spam' : 'all_notspam';\n\t\t\t\t\t\t\t\tupdate_blog_status( $val, 'spam', ( 'spam' === $doaction ) ? '1' : '0' );\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\twp_die( __( 'Sorry, you are not allowed to change the current site.' ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( ! in_array( $doaction, array( 'delete', 'spam', 'notspam' ), true ) ) {\n\t\t\t\t\t$redirect_to = wp_get_referer();\n\t\t\t\t\t$blogs       = (array) $_POST['allblogs'];\n\n\t\t\t\t\t/** This action is documented in wp-admin/network/site-themes.php */\n\t\t\t\t\t$redirect_to = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $redirect_to, $doaction, $blogs, $id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\t\t\t\twp_safe_redirect( $redirect_to );\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Process query defined by WP_MS_Site_List_Table::extra_table_nav().\n\t\t\t\t$location = remove_query_arg(\n\t\t\t\t\tarray( '_wp_http_referer', '_wpnonce' ),\n\t\t\t\t\tadd_query_arg( $_POST, network_admin_url( 'sites.php' ) )\n\t\t\t\t);\n\n\t\t\t\twp_redirect( $location );\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase 'archiveblog':\n\t\tcase 'unarchiveblog':\n\t\t\tupdate_blog_status( $id, 'archived', ( 'archiveblog' === $_GET['action'] ) ? '1' : '0' );\n\t\t\tbreak;\n\n\t\tcase 'activateblog':\n\t\t\tupdate_blog_status( $id, 'deleted', '0' );\n\n\t\t\t/**\n\t\t\t * Fires after a network site is activated.\n\t\t\t *\n\t\t\t * @since MU (3.0.0)\n\t\t\t *\n\t\t\t * @param string $id The ID of the activated site.\n\t\t\t */\n\t\t\tdo_action( 'activate_blog', $id );\n\t\t\tbreak;\n\n\t\tcase 'deactivateblog':\n\t\t\t/**\n\t\t\t * Fires before a network site is deactivated.\n\t\t\t *\n\t\t\t * @since MU (3.0.0)\n\t\t\t *\n\t\t\t * @param string $id The ID of the site being deactivated.\n\t\t\t */\n\t\t\tdo_action( 'deactivate_blog', $id );\n\n\t\t\tupdate_blog_status( $id, 'deleted', '1' );\n\t\t\tbreak;\n\n\t\tcase 'unspamblog':\n\t\tcase 'spamblog':\n\t\t\tupdate_blog_status( $id, 'spam', ( 'spamblog' === $_GET['action'] ) ? '1' : '0' );\n\t\t\tbreak;\n\n\t\tcase 'unmatureblog':\n\t\tcase 'matureblog':\n\t\t\tupdate_blog_status( $id, 'mature', ( 'matureblog' === $_GET['action'] ) ? '1' : '0' );\n\t\t\tbreak;\n\t}\n\n\tif ( empty( $updated_action ) && array_key_exists( $_GET['action'], $manage_actions ) ) {\n\t\t$updated_action = $_GET['action'];\n\t}\n\n\tif ( ! empty( $updated_action ) ) {\n\t\twp_safe_redirect( add_query_arg( array( 'updated' => $updated_action ), wp_get_referer() ) );\n\t\texit;\n\t}\n}\n\n$msg = '';\nif ( isset( $_GET['updated'] ) ) {\n\t$action = $_GET['updated'];\n\n\tswitch ( $action ) {\n\t\tcase 'all_notspam':\n\t\t\t$msg = __( 'Sites removed from spam.' );\n\t\t\tbreak;\n\t\tcase 'all_spam':\n\t\t\t$msg = __( 'Sites marked as spam.' );\n\t\t\tbreak;\n\t\tcase 'all_delete':\n\t\t\t$msg = __( 'Sites deleted.' );\n\t\t\tbreak;\n\t\tcase 'delete':\n\t\t\t$msg = __( 'Site deleted.' );\n\t\t\tbreak;\n\t\tcase 'not_deleted':\n\t\t\t$msg = __( 'Sorry, you are not allowed to delete that site.' );\n\t\t\tbreak;\n\t\tcase 'archiveblog':\n\t\t\t$msg = __( 'Site archived.' );\n\t\t\tbreak;\n\t\tcase 'unarchiveblog':\n\t\t\t$msg = __( 'Site unarchived.' );\n\t\t\tbreak;\n\t\tcase 'activateblog':\n\t\t\t$msg = __( 'Site activated.' );\n\t\t\tbreak;\n\t\tcase 'deactivateblog':\n\t\t\t$msg = __( 'Site deactivated.' );\n\t\t\tbreak;\n\t\tcase 'unspamblog':\n\t\t\t$msg = __( 'Site removed from spam.' );\n\t\t\tbreak;\n\t\tcase 'spamblog':\n\t\t\t$msg = __( 'Site marked as spam.' );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t/**\n\t\t\t * Filters a specific, non-default, site-updated message in the Network admin.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$action`, refers to the non-default\n\t\t\t * site update action.\n\t\t\t *\n\t\t\t * @since 3.1.0\n\t\t\t *\n\t\t\t * @param string $msg The update message. Default 'Settings saved'.\n\t\t\t */\n\t\t\t$msg = apply_filters( \"network_sites_updated_message_{$action}\", __( 'Settings saved.' ) );\n\t\t\tbreak;\n\t}\n\n\tif ( ! empty( $msg ) ) {\n\t\t$msg = '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . $msg . '</p></div>';\n\t}\n}\n\n$wp_list_table->prepare_items();\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n?>\n\n<div class=\"wrap\">\n<h1 class=\"wp-heading-inline\"><?php _e( 'Sites' ); ?></h1>\n\n<?php if ( current_user_can( 'create_sites' ) ) : ?>\n\t<a href=\"<?php echo network_admin_url( 'site-new.php' ); ?>\" class=\"page-title-action\"><?php echo esc_html_x( 'Add New', 'site' ); ?></a>\n<?php endif; ?>\n\n<?php\nif ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {\n\t/* translators: %s: Search query. */\n\tprintf( '<span class=\"subtitle\">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $s ) );\n}\n?>\n\n<hr class=\"wp-header-end\">\n\n<?php $wp_list_table->views(); ?>\n\n<?php echo $msg; ?>\n\n<form method=\"get\" id=\"ms-search\" class=\"wp-clearfix\">\n<?php $wp_list_table->search_box( __( 'Search Sites' ), 'site' ); ?>\n<input type=\"hidden\" name=\"action\" value=\"blogs\" />\n</form>\n\n<form id=\"form-site-list\" action=\"sites.php?action=allblogs\" method=\"post\">\n\t<?php $wp_list_table->display(); ?>\n</form>\n</div>\n<?php\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 397}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Theme editor network administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/theme-editor.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Install theme network administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\nif ( isset( $_GET['tab'] ) && ( 'theme-information' === $_GET['tab'] ) ) {\n\tdefine( 'IFRAME_REQUEST', true );\n}\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/theme-install.php';\n", "num_lines": 18}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite themes administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'manage_network_themes' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to manage network themes.' ) );\n}\n\n$wp_list_table = _get_list_table( 'WP_MS_Themes_List_Table' );\n$pagenum       = $wp_list_table->get_pagenum();\n\n$action = $wp_list_table->current_action();\n\n$s = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';\n\n// Clean up request URI from temporary args for screen options/paging uri's to work as expected.\n$temp_args = array(\n\t'enabled',\n\t'disabled',\n\t'deleted',\n\t'error',\n\t'enabled-auto-update',\n\t'disabled-auto-update',\n);\n\n$_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI'] );\n$referer                = remove_query_arg( $temp_args, wp_get_referer() );\n\nif ( $action ) {\n\tswitch ( $action ) {\n\t\tcase 'enable':\n\t\t\tcheck_admin_referer( 'enable-theme_' . $_GET['theme'] );\n\t\t\tWP_Theme::network_enable_theme( $_GET['theme'] );\n\t\t\tif ( false === strpos( $referer, '/network/themes.php' ) ) {\n\t\t\t\twp_redirect( network_admin_url( 'themes.php?enabled=1' ) );\n\t\t\t} else {\n\t\t\t\twp_safe_redirect( add_query_arg( 'enabled', 1, $referer ) );\n\t\t\t}\n\t\t\texit;\n\t\tcase 'disable':\n\t\t\tcheck_admin_referer( 'disable-theme_' . $_GET['theme'] );\n\t\t\tWP_Theme::network_disable_theme( $_GET['theme'] );\n\t\t\twp_safe_redirect( add_query_arg( 'disabled', '1', $referer ) );\n\t\t\texit;\n\t\tcase 'enable-selected':\n\t\t\tcheck_admin_referer( 'bulk-themes' );\n\t\t\t$themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();\n\t\t\tif ( empty( $themes ) ) {\n\t\t\t\twp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );\n\t\t\t\texit;\n\t\t\t}\n\t\t\tWP_Theme::network_enable_theme( (array) $themes );\n\t\t\twp_safe_redirect( add_query_arg( 'enabled', count( $themes ), $referer ) );\n\t\t\texit;\n\t\tcase 'disable-selected':\n\t\t\tcheck_admin_referer( 'bulk-themes' );\n\t\t\t$themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();\n\t\t\tif ( empty( $themes ) ) {\n\t\t\t\twp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );\n\t\t\t\texit;\n\t\t\t}\n\t\t\tWP_Theme::network_disable_theme( (array) $themes );\n\t\t\twp_safe_redirect( add_query_arg( 'disabled', count( $themes ), $referer ) );\n\t\t\texit;\n\t\tcase 'update-selected':\n\t\t\tcheck_admin_referer( 'bulk-themes' );\n\n\t\t\tif ( isset( $_GET['themes'] ) ) {\n\t\t\t\t$themes = explode( ',', $_GET['themes'] );\n\t\t\t} elseif ( isset( $_POST['checked'] ) ) {\n\t\t\t\t$themes = (array) $_POST['checked'];\n\t\t\t} else {\n\t\t\t\t$themes = array();\n\t\t\t}\n\n\t\t\t$title       = __( 'Update Themes' );\n\t\t\t$parent_file = 'themes.php';\n\n\t\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n\t\t\techo '<div class=\"wrap\">';\n\t\t\techo '<h1>' . esc_html( $title ) . '</h1>';\n\n\t\t\t$url = self_admin_url( 'update.php?action=update-selected-themes&amp;themes=' . urlencode( join( ',', $themes ) ) );\n\t\t\t$url = wp_nonce_url( $url, 'bulk-update-themes' );\n\n\t\t\techo \"<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>\";\n\t\t\techo '</div>';\n\t\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t\t\texit;\n\t\tcase 'delete-selected':\n\t\t\tif ( ! current_user_can( 'delete_themes' ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to delete themes for this site.' ) );\n\t\t\t}\n\n\t\t\tcheck_admin_referer( 'bulk-themes' );\n\n\t\t\t$themes = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();\n\n\t\t\tif ( empty( $themes ) ) {\n\t\t\t\twp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t$themes = array_diff( $themes, array( get_option( 'stylesheet' ), get_option( 'template' ) ) );\n\n\t\t\tif ( empty( $themes ) ) {\n\t\t\t\twp_safe_redirect( add_query_arg( 'error', 'main', $referer ) );\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t$theme_info = array();\n\t\t\tforeach ( $themes as $key => $theme ) {\n\t\t\t\t$theme_info[ $theme ] = wp_get_theme( $theme );\n\t\t\t}\n\n\t\t\trequire ABSPATH . 'wp-admin/update.php';\n\n\t\t\t$parent_file = 'themes.php';\n\n\t\t\tif ( ! isset( $_REQUEST['verify-delete'] ) ) {\n\t\t\t\twp_enqueue_script( 'jquery' );\n\t\t\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t\t\t\t$themes_to_delete = count( $themes );\n\t\t\t\t?>\n\t\t\t\t<div class=\"wrap\">\n\t\t\t\t<?php if ( 1 === $themes_to_delete ) : ?>\n\t\t\t\t\t<h1><?php _e( 'Delete Theme' ); ?></h1>\n\t\t\t\t\t<div class=\"error\"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'This theme may be active on other sites in the network.' ); ?></p></div>\n\t\t\t\t\t<p><?php _e( 'You are about to remove the following theme:' ); ?></p>\n\t\t\t\t<?php else : ?>\n\t\t\t\t\t<h1><?php _e( 'Delete Themes' ); ?></h1>\n\t\t\t\t\t<div class=\"error\"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'These themes may be active on other sites in the network.' ); ?></p></div>\n\t\t\t\t\t<p><?php _e( 'You are about to remove the following themes:' ); ?></p>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<ul class=\"ul-disc\">\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $theme_info as $theme ) {\n\t\t\t\t\t\techo '<li>' . sprintf(\n\t\t\t\t\t\t\t/* translators: 1: Theme name, 2: Theme author. */\n\t\t\t\t\t\t\t_x( '%1$s by %2$s', 'theme' ),\n\t\t\t\t\t\t\t'<strong>' . $theme->display( 'Name' ) . '</strong>',\n\t\t\t\t\t\t\t'<em>' . $theme->display( 'Author' ) . '</em>'\n\t\t\t\t\t\t) . '</li>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t</ul>\n\t\t\t\t<?php if ( 1 === $themes_to_delete ) : ?>\n\t\t\t\t\t<p><?php _e( 'Are you sure you want to delete this theme?' ); ?></p>\n\t\t\t\t<?php else : ?>\n\t\t\t\t\t<p><?php _e( 'Are you sure you want to delete these themes?' ); ?></p>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<form method=\"post\" action=\"<?php echo esc_url( $_SERVER['REQUEST_URI'] ); ?>\" style=\"display:inline;\">\n\t\t\t\t\t<input type=\"hidden\" name=\"verify-delete\" value=\"1\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"delete-selected\" />\n\t\t\t\t\t<?php\n\n\t\t\t\t\tforeach ( (array) $themes as $theme ) {\n\t\t\t\t\t\techo '<input type=\"hidden\" name=\"checked[]\" value=\"' . esc_attr( $theme ) . '\" />';\n\t\t\t\t\t}\n\n\t\t\t\t\twp_nonce_field( 'bulk-themes' );\n\n\t\t\t\t\tif ( 1 === $themes_to_delete ) {\n\t\t\t\t\t\tsubmit_button( __( 'Yes, delete this theme' ), '', 'submit', false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsubmit_button( __( 'Yes, delete these themes' ), '', 'submit', false );\n\t\t\t\t\t}\n\n\t\t\t\t\t?>\n\t\t\t\t</form>\n\t\t\t\t<?php $referer = wp_get_referer(); ?>\n\t\t\t\t<form method=\"post\" action=\"<?php echo $referer ? esc_url( $referer ) : ''; ?>\" style=\"display:inline;\">\n\t\t\t\t\t<?php submit_button( __( 'No, return me to the theme list' ), '', 'submit', false ); ?>\n\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\n\t\t\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t\t\t\texit;\n\t\t\t} // End if verify-delete.\n\n\t\t\tforeach ( $themes as $theme ) {\n\t\t\t\t$delete_result = delete_theme(\n\t\t\t\t\t$theme,\n\t\t\t\t\tesc_url(\n\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'verify-delete' => 1,\n\t\t\t\t\t\t\t\t'action'        => 'delete-selected',\n\t\t\t\t\t\t\t\t'checked'       => $_REQUEST['checked'],\n\t\t\t\t\t\t\t\t'_wpnonce'      => $_REQUEST['_wpnonce'],\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tnetwork_admin_url( 'themes.php' )\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$paged = ( $_REQUEST['paged'] ) ? $_REQUEST['paged'] : 1;\n\t\t\twp_redirect(\n\t\t\t\tadd_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'deleted' => count( $themes ),\n\t\t\t\t\t\t'paged'   => $paged,\n\t\t\t\t\t\t's'       => $s,\n\t\t\t\t\t),\n\t\t\t\t\tnetwork_admin_url( 'themes.php' )\n\t\t\t\t)\n\t\t\t);\n\t\t\texit;\n\t\tcase 'enable-auto-update':\n\t\tcase 'disable-auto-update':\n\t\tcase 'enable-auto-update-selected':\n\t\tcase 'disable-auto-update-selected':\n\t\t\tif ( ! ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to change themes automatic update settings.' ) );\n\t\t\t}\n\n\t\t\tif ( 'enable-auto-update' === $action || 'disable-auto-update' === $action ) {\n\t\t\t\tcheck_admin_referer( 'updates' );\n\t\t\t} else {\n\t\t\t\tif ( empty( $_POST['checked'] ) ) {\n\t\t\t\t\t// Nothing to do.\n\t\t\t\t\twp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t\tcheck_admin_referer( 'bulk-themes' );\n\t\t\t}\n\n\t\t\t$auto_updates = (array) get_site_option( 'auto_update_themes', array() );\n\n\t\t\tif ( 'enable-auto-update' === $action ) {\n\t\t\t\t$auto_updates[] = $_GET['theme'];\n\t\t\t\t$auto_updates   = array_unique( $auto_updates );\n\t\t\t\t$referer        = add_query_arg( 'enabled-auto-update', 1, $referer );\n\t\t\t} elseif ( 'disable-auto-update' === $action ) {\n\t\t\t\t$auto_updates = array_diff( $auto_updates, array( $_GET['theme'] ) );\n\t\t\t\t$referer      = add_query_arg( 'disabled-auto-update', 1, $referer );\n\t\t\t} else {\n\t\t\t\t// Bulk enable/disable.\n\t\t\t\t$themes = (array) wp_unslash( $_POST['checked'] );\n\n\t\t\t\tif ( 'enable-auto-update-selected' === $action ) {\n\t\t\t\t\t$auto_updates = array_merge( $auto_updates, $themes );\n\t\t\t\t\t$auto_updates = array_unique( $auto_updates );\n\t\t\t\t\t$referer      = add_query_arg( 'enabled-auto-update', count( $themes ), $referer );\n\t\t\t\t} else {\n\t\t\t\t\t$auto_updates = array_diff( $auto_updates, $themes );\n\t\t\t\t\t$referer      = add_query_arg( 'disabled-auto-update', count( $themes ), $referer );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$all_items = wp_get_themes();\n\n\t\t\t// Remove themes that don't exist or have been deleted since the option was last updated.\n\t\t\t$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) );\n\n\t\t\tupdate_site_option( 'auto_update_themes', $auto_updates );\n\n\t\t\twp_safe_redirect( $referer );\n\t\t\texit;\n\t\tdefault:\n\t\t\t$themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();\n\t\t\tif ( empty( $themes ) ) {\n\t\t\t\twp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );\n\t\t\t\texit;\n\t\t\t}\n\t\t\tcheck_admin_referer( 'bulk-themes' );\n\n\t\t\t/** This action is documented in wp-admin/network/site-themes.php */\n\t\t\t$referer = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $referer, $action, $themes ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\t\twp_safe_redirect( $referer );\n\t\t\texit;\n\t}\n}\n\n$wp_list_table->prepare_items();\n\nadd_thickbox();\n\nadd_screen_option( 'per_page' );\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t'<p>' . __( 'This screen enables and disables the inclusion of themes available to choose in the Appearance menu for each site. It does not activate or deactivate which theme a site is currently using.' ) . '</p>' .\n\t\t\t'<p>' . __( 'If the network admin disables a theme that is in use, it can still remain selected on that site. If another theme is chosen, the disabled theme will not appear in the site&#8217;s Appearance > Themes screen.' ) . '</p>' .\n\t\t\t'<p>' . __( 'Themes can be enabled on a site by site basis by the network admin on the Edit Site screen (which has a Themes tab); get there via the Edit action link on the All Sites screen. Only network admins are able to install or edit themes.' ) . '</p>',\n\t)\n);\n\n$help_sidebar_autoupdates = '';\n\nif ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) {\n\tget_current_screen()->add_help_tab(\n\t\tarray(\n\t\t\t'id'      => 'plugins-themes-auto-updates',\n\t\t\t'title'   => __( 'Auto-updates' ),\n\t\t\t'content' =>\n\t\t\t\t'<p>' . __( 'Auto-updates can be enabled or disabled for each individual theme. Themes with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates depends on the WP-Cron task scheduling system.' ) . '</p>' .\n\t\t\t\t'<p>' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '</p>',\n\t\t)\n\t);\n\n\t$help_sidebar_autoupdates = '<p>' . __( '<a href=\"https://wordpress.org/support/article/plugins-themes-auto-updates/\">Learn more: Auto-updates documentation</a>' ) . '</p>';\n}\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://codex.wordpress.org/Network_Admin_Themes_Screen\">Documentation on Network Themes</a>' ) . '</p>' .\n\t$help_sidebar_autoupdates .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nget_current_screen()->set_screen_reader_content(\n\tarray(\n\t\t'heading_views'      => __( 'Filter themes list' ),\n\t\t'heading_pagination' => __( 'Themes list navigation' ),\n\t\t'heading_list'       => __( 'Themes list' ),\n\t)\n);\n\n$title       = __( 'Themes' );\n$parent_file = 'themes.php';\n\nwp_enqueue_script( 'updates' );\nwp_enqueue_script( 'theme-preview' );\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\n?>\n\n<div class=\"wrap\">\n<h1 class=\"wp-heading-inline\"><?php echo esc_html( $title ); ?></h1>\n\n<?php if ( current_user_can( 'install_themes' ) ) : ?>\n\t<a href=\"theme-install.php\" class=\"page-title-action\"><?php echo esc_html_x( 'Add New', 'theme' ); ?></a>\n<?php endif; ?>\n\n<?php\nif ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {\n\t/* translators: %s: Search query. */\n\tprintf( '<span class=\"subtitle\">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $s ) );\n}\n?>\n\n<hr class=\"wp-header-end\">\n\n<?php\nif ( isset( $_GET['enabled'] ) ) {\n\t$enabled = absint( $_GET['enabled'] );\n\tif ( 1 === $enabled ) {\n\t\t$message = __( 'Theme enabled.' );\n\t} else {\n\t\t/* translators: %s: Number of themes. */\n\t\t$message = _n( '%s theme enabled.', '%s themes enabled.', $enabled );\n\t}\n\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';\n} elseif ( isset( $_GET['disabled'] ) ) {\n\t$disabled = absint( $_GET['disabled'] );\n\tif ( 1 === $disabled ) {\n\t\t$message = __( 'Theme disabled.' );\n\t} else {\n\t\t/* translators: %s: Number of themes. */\n\t\t$message = _n( '%s theme disabled.', '%s themes disabled.', $disabled );\n\t}\n\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';\n} elseif ( isset( $_GET['deleted'] ) ) {\n\t$deleted = absint( $_GET['deleted'] );\n\tif ( 1 === $deleted ) {\n\t\t$message = __( 'Theme deleted.' );\n\t} else {\n\t\t/* translators: %s: Number of themes. */\n\t\t$message = _n( '%s theme deleted.', '%s themes deleted.', $deleted );\n\t}\n\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . sprintf( $message, number_format_i18n( $deleted ) ) . '</p></div>';\n} elseif ( isset( $_GET['enabled-auto-update'] ) ) {\n\t$enabled = absint( $_GET['enabled-auto-update'] );\n\tif ( 1 === $enabled ) {\n\t\t$message = __( 'Theme will be auto-updated.' );\n\t} else {\n\t\t/* translators: %s: Number of themes. */\n\t\t$message = _n( '%s theme will be auto-updated.', '%s themes will be auto-updated.', $enabled );\n\t}\n\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';\n} elseif ( isset( $_GET['disabled-auto-update'] ) ) {\n\t$disabled = absint( $_GET['disabled-auto-update'] );\n\tif ( 1 === $disabled ) {\n\t\t$message = __( 'Theme will no longer be auto-updated.' );\n\t} else {\n\t\t/* translators: %s: Number of themes. */\n\t\t$message = _n( '%s theme will no longer be auto-updated.', '%s themes will no longer be auto-updated.', $disabled );\n\t}\n\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';\n} elseif ( isset( $_GET['error'] ) && 'none' === $_GET['error'] ) {\n\techo '<div id=\"message\" class=\"error notice is-dismissible\"><p>' . __( 'No theme selected.' ) . '</p></div>';\n} elseif ( isset( $_GET['error'] ) && 'main' === $_GET['error'] ) {\n\techo '<div class=\"error notice is-dismissible\"><p>' . __( 'You cannot delete a theme while it is active on the main site.' ) . '</p></div>';\n}\n\n?>\n\n<form method=\"get\">\n<?php $wp_list_table->search_box( __( 'Search Installed Themes' ), 'theme' ); ?>\n</form>\n\n<?php\n$wp_list_table->views();\n\nif ( 'broken' === $status ) {\n\techo '<p class=\"clear\">' . __( 'The following themes are installed but incomplete.' ) . '</p>';\n}\n?>\n\n<form id=\"bulk-action-form\" method=\"post\">\n<input type=\"hidden\" name=\"theme_status\" value=\"<?php echo esc_attr( $status ); ?>\" />\n<input type=\"hidden\" name=\"paged\" value=\"<?php echo esc_attr( $page ); ?>\" />\n\n<?php $wp_list_table->display(); ?>\n</form>\n\n</div>\n\n<?php\nwp_print_request_filesystem_credentials_modal();\nwp_print_admin_notice_templates();\nwp_print_update_row_templates();\n\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 443}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Updates network administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/update-core.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Update/Install Plugin/Theme network administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\nif ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'update-selected', 'activate-plugin', 'update-selected-themes' ), true ) ) {\n\tdefine( 'IFRAME_REQUEST', true );\n}\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/update.php';\n", "num_lines": 18}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite upgrade administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire_once ABSPATH . WPINC . '/http.php';\n\n$title       = __( 'Upgrade Network' );\n$parent_file = 'upgrade.php';\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t'<p>' . __( 'Only use this screen once you have updated to a new version of WordPress through Updates/Available Updates (via the Network Administration navigation menu or the Toolbar). Clicking the Upgrade Network button will step through each site in the network, five at a time, and make sure any database updates are applied.' ) . '</p>' .\n\t\t\t'<p>' . __( 'If a version update to core has not happened, clicking this button won&#8217;t affect anything.' ) . '</p>' .\n\t\t\t'<p>' . __( 'If this process fails for any reason, users logging in to their sites will force the same update.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/article/network-admin-updates-screen/\">Documentation on Upgrade Network</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/\">Support</a>' ) . '</p>'\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\nif ( ! current_user_can( 'upgrade_network' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );\n}\n\necho '<div class=\"wrap\">';\necho '<h1>' . __( 'Upgrade Network' ) . '</h1>';\n\n$action = isset( $_GET['action'] ) ? $_GET['action'] : 'show';\n\nswitch ( $action ) {\n\tcase 'upgrade':\n\t\t$n = ( isset( $_GET['n'] ) ) ? intval( $_GET['n'] ) : 0;\n\n\t\tif ( $n < 5 ) {\n\t\t\t/**\n\t\t\t * @global int $wp_db_version WordPress database version.\n\t\t\t */\n\t\t\tglobal $wp_db_version;\n\t\t\tupdate_site_option( 'wpmu_upgrade_site', $wp_db_version );\n\t\t}\n\n\t\t$site_ids = get_sites(\n\t\t\tarray(\n\t\t\t\t'spam'                   => 0,\n\t\t\t\t'deleted'                => 0,\n\t\t\t\t'archived'               => 0,\n\t\t\t\t'network_id'             => get_current_network_id(),\n\t\t\t\t'number'                 => 5,\n\t\t\t\t'offset'                 => $n,\n\t\t\t\t'fields'                 => 'ids',\n\t\t\t\t'order'                  => 'DESC',\n\t\t\t\t'orderby'                => 'id',\n\t\t\t\t'update_site_meta_cache' => false,\n\t\t\t)\n\t\t);\n\t\tif ( empty( $site_ids ) ) {\n\t\t\techo '<p>' . __( 'All done!' ) . '</p>';\n\t\t\tbreak;\n\t\t}\n\t\techo '<ul>';\n\t\tforeach ( (array) $site_ids as $site_id ) {\n\t\t\tswitch_to_blog( $site_id );\n\t\t\t$siteurl     = site_url();\n\t\t\t$upgrade_url = admin_url( 'upgrade.php?step=upgrade_db' );\n\t\t\trestore_current_blog();\n\n\t\t\techo \"<li>$siteurl</li>\";\n\n\t\t\t$response = wp_remote_get(\n\t\t\t\t$upgrade_url,\n\t\t\t\tarray(\n\t\t\t\t\t'timeout'     => 120,\n\t\t\t\t\t'httpversion' => '1.1',\n\t\t\t\t\t'sslverify'   => false,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\twp_die(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1: Site URL, 2: Server error message. */\n\t\t\t\t\t\t__( 'Warning! Problem updating %1$s. Your server may not be able to connect to sites running on it. Error message: %2$s' ),\n\t\t\t\t\t\t$siteurl,\n\t\t\t\t\t\t'<em>' . $response->get_error_message() . '</em>'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Fires after the Multisite DB upgrade for each site is complete.\n\t\t\t *\n\t\t\t * @since MU (3.0.0)\n\t\t\t *\n\t\t\t * @param array|WP_Error $response The upgrade response array or WP_Error on failure.\n\t\t\t */\n\t\t\tdo_action( 'after_mu_upgrade', $response );\n\n\t\t\t/**\n\t\t\t * Fires after each site has been upgraded.\n\t\t\t *\n\t\t\t * @since MU (3.0.0)\n\t\t\t *\n\t\t\t * @param int $site_id The Site ID.\n\t\t\t */\n\t\t\tdo_action( 'wpmu_upgrade_site', $site_id );\n\t\t}\n\t\techo '</ul>';\n\t\t?><p><?php _e( 'If your browser doesn&#8217;t start loading the next page automatically, click this link:' ); ?> <a class=\"button\" href=\"upgrade.php?action=upgrade&amp;n=<?php echo ( $n + 5 ); ?>\"><?php _e( 'Next Sites' ); ?></a></p>\n\t\t<script type=\"text/javascript\">\n\t\t<!--\n\t\tfunction nextpage() {\n\t\t\tlocation.href = \"upgrade.php?action=upgrade&n=<?php echo ( $n + 5 ); ?>\";\n\t\t}\n\t\tsetTimeout( \"nextpage()\", 250 );\n\t\t//-->\n\t\t</script>\n\t\t<?php\n\t\tbreak;\n\tcase 'show':\n\tdefault:\n\t\tif ( (int) get_site_option( 'wpmu_upgrade_site' ) !== $GLOBALS['wp_db_version'] ) :\n\t\t\t?>\n\t\t<h2><?php _e( 'Database Update Required' ); ?></h2>\n\t\t<p><?php _e( 'WordPress has been updated! Before we send you on your way, we need to individually upgrade the sites in your network.' ); ?></p>\n\t\t<?php endif; ?>\n\n\t\t<p><?php _e( 'The database update process may take a little while, so please be patient.' ); ?></p>\n\t\t<p><a class=\"button button-primary\" href=\"upgrade.php?action=upgrade\"><?php _e( 'Upgrade Network' ); ?></a></p>\n\t\t<?php\n\t\t/**\n\t\t * Fires before the footer on the network upgrade screen.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t */\n\t\tdo_action( 'wpmu_upgrade_page' );\n\t\tbreak;\n}\n?>\n</div>\n\n<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 158}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit user network administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/user-edit.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Add New User network administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'create_users' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to add users to this network.' ) );\n}\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t'<p>' . __( 'Add User will set up a new user account on the network and send that person an email with username and password.' ) . '</p>' .\n\t\t\t'<p>' . __( 'Users who are signed up to the network without a site are added as subscribers to the main or primary dashboard site, giving them profile pages to manage their accounts. These users will only see Dashboard and My Sites in the main navigation until a site is created for them.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://codex.wordpress.org/Network_Admin_Users_Screen\">Documentation on Network Users</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/forum/multisite/\">Support Forums</a>' ) . '</p>'\n);\n\nif ( isset( $_REQUEST['action'] ) && 'add-user' === $_REQUEST['action'] ) {\n\tcheck_admin_referer( 'add-user', '_wpnonce_add-user' );\n\n\tif ( ! current_user_can( 'manage_network_users' ) ) {\n\t\twp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );\n\t}\n\n\tif ( ! is_array( $_POST['user'] ) ) {\n\t\twp_die( __( 'Cannot create an empty user.' ) );\n\t}\n\n\t$user = wp_unslash( $_POST['user'] );\n\n\t$user_details = wpmu_validate_user_signup( $user['username'], $user['email'] );\n\n\tif ( is_wp_error( $user_details['errors'] ) && $user_details['errors']->has_errors() ) {\n\t\t$add_user_errors = $user_details['errors'];\n\t} else {\n\t\t$password = wp_generate_password( 12, false );\n\t\t$user_id  = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, sanitize_email( $user['email'] ) );\n\n\t\tif ( ! $user_id ) {\n\t\t\t$add_user_errors = new WP_Error( 'add_user_fail', __( 'Cannot add user.' ) );\n\t\t} else {\n\t\t\t/**\n\t\t\t * Fires after a new user has been created via the network user-new.php page.\n\t\t\t *\n\t\t\t * @since 4.4.0\n\t\t\t *\n\t\t\t * @param int $user_id ID of the newly created user.\n\t\t\t */\n\t\t\tdo_action( 'network_user_new_created_user', $user_id );\n\n\t\t\twp_redirect(\n\t\t\t\tadd_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'update'  => 'added',\n\t\t\t\t\t\t'user_id' => $user_id,\n\t\t\t\t\t),\n\t\t\t\t\t'user-new.php'\n\t\t\t\t)\n\t\t\t);\n\t\t\texit;\n\t\t}\n\t}\n}\n\nif ( isset( $_GET['update'] ) ) {\n\t$messages = array();\n\tif ( 'added' === $_GET['update'] ) {\n\t\t$edit_link = '';\n\t\tif ( isset( $_GET['user_id'] ) ) {\n\t\t\t$user_id_new = absint( $_GET['user_id'] );\n\t\t\tif ( $user_id_new ) {\n\t\t\t\t$edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user_id_new ) ) );\n\t\t\t}\n\t\t}\n\n\t\t$message = __( 'User added.' );\n\n\t\tif ( $edit_link ) {\n\t\t\t$message .= sprintf( ' <a href=\"%s\">%s</a>', $edit_link, __( 'Edit user' ) );\n\t\t}\n\n\t\t$messages[] = $message;\n\t}\n}\n\n$title       = __( 'Add New User' );\n$parent_file = 'users.php';\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php'; ?>\n\n<div class=\"wrap\">\n<h1 id=\"add-new-user\"><?php _e( 'Add New User' ); ?></h1>\n<?php\nif ( ! empty( $messages ) ) {\n\tforeach ( $messages as $msg ) {\n\t\techo '<div id=\"message\" class=\"updated notice is-dismissible\"><p>' . $msg . '</p></div>';\n\t}\n}\n\nif ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) {\n\t?>\n\t<div class=\"error\">\n\t\t<?php\n\t\tforeach ( $add_user_errors->get_error_messages() as $message ) {\n\t\t\techo \"<p>$message</p>\";\n\t\t}\n\t\t?>\n\t</div>\n<?php } ?>\n\t<form action=\"<?php echo network_admin_url( 'user-new.php?action=add-user' ); ?>\" id=\"adduser\" method=\"post\" novalidate=\"novalidate\">\n\t<table class=\"form-table\" role=\"presentation\">\n\t\t<tr class=\"form-field form-required\">\n\t\t\t<th scope=\"row\"><label for=\"username\"><?php _e( 'Username' ); ?></label></th>\n\t\t\t<td><input type=\"text\" class=\"regular-text\" name=\"user[username]\" id=\"username\" autocapitalize=\"none\" autocorrect=\"off\" maxlength=\"60\" /></td>\n\t\t</tr>\n\t\t<tr class=\"form-field form-required\">\n\t\t\t<th scope=\"row\"><label for=\"email\"><?php _e( 'Email' ); ?></label></th>\n\t\t\t<td><input type=\"email\" class=\"regular-text\" name=\"user[email]\" id=\"email\"/></td>\n\t\t</tr>\n\t\t<tr class=\"form-field\">\n\t\t\t<td colspan=\"2\" class=\"td-full\"><?php _e( 'A password reset link will be sent to the user via email.' ); ?></td>\n\t\t</tr>\n\t</table>\n\t<?php\n\t/**\n\t * Fires at the end of the new user form in network admin.\n\t *\n\t * @since 4.5.0\n\t */\n\tdo_action( 'network_user_new_form' );\n\n\twp_nonce_field( 'add-user', '_wpnonce_add-user' );\n\tsubmit_button( __( 'Add User' ), 'primary', 'add-user' );\n\t?>\n\t</form>\n</div>\n<?php\nrequire_once ABSPATH . 'wp-admin/admin-footer.php';\n", "num_lines": 154}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite users administration panel.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nif ( ! current_user_can( 'manage_network_users' ) ) {\n\twp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );\n}\n\nif ( isset( $_GET['action'] ) ) {\n\t/** This action is documented in wp-admin/network/edit.php */\n\tdo_action( 'wpmuadminedit' );\n\n\tswitch ( $_GET['action'] ) {\n\t\tcase 'deleteuser':\n\t\t\tif ( ! current_user_can( 'manage_network_users' ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );\n\t\t\t}\n\n\t\t\tcheck_admin_referer( 'deleteuser' );\n\n\t\t\t$id = intval( $_GET['id'] );\n\t\t\tif ( $id > 1 ) {\n\t\t\t\t$_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle arrays.\n\t\t\t\t$title             = __( 'Users' );\n\t\t\t\t$parent_file       = 'users.php';\n\t\t\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t\t\t\techo '<div class=\"wrap\">';\n\t\t\t\tconfirm_delete_users( $_POST['allusers'] );\n\t\t\t\techo '</div>';\n\t\t\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t\t\t} else {\n\t\t\t\twp_redirect( network_admin_url( 'users.php' ) );\n\t\t\t}\n\t\t\texit;\n\n\t\tcase 'allusers':\n\t\t\tif ( ! current_user_can( 'manage_network_users' ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );\n\t\t\t}\n\n\t\t\tif ( ( isset( $_POST['action'] ) || isset( $_POST['action2'] ) ) && isset( $_POST['allusers'] ) ) {\n\t\t\t\tcheck_admin_referer( 'bulk-users-network' );\n\n\t\t\t\t$doaction     = -1 != $_POST['action'] ? $_POST['action'] : $_POST['action2'];\n\t\t\t\t$userfunction = '';\n\n\t\t\t\tforeach ( (array) $_POST['allusers'] as $user_id ) {\n\t\t\t\t\tif ( ! empty( $user_id ) ) {\n\t\t\t\t\t\tswitch ( $doaction ) {\n\t\t\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\t\t\tif ( ! current_user_can( 'delete_users' ) ) {\n\t\t\t\t\t\t\t\t\twp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$title       = __( 'Users' );\n\t\t\t\t\t\t\t\t$parent_file = 'users.php';\n\t\t\t\t\t\t\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t\t\t\t\t\t\t\techo '<div class=\"wrap\">';\n\t\t\t\t\t\t\t\tconfirm_delete_users( $_POST['allusers'] );\n\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\trequire_once ABSPATH . 'wp-admin/admin-footer.php';\n\t\t\t\t\t\t\t\texit;\n\n\t\t\t\t\t\t\tcase 'spam':\n\t\t\t\t\t\t\t\t$user = get_userdata( $user_id );\n\t\t\t\t\t\t\t\tif ( is_super_admin( $user->ID ) ) {\n\t\t\t\t\t\t\t\t\twp_die(\n\t\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: User login. */\n\t\t\t\t\t\t\t\t\t\t\t__( 'Warning! User cannot be modified. The user %s is a network administrator.' ),\n\t\t\t\t\t\t\t\t\t\t\tesc_html( $user->user_login )\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}\n\n\t\t\t\t\t\t\t\t$userfunction = 'all_spam';\n\t\t\t\t\t\t\t\t$blogs        = get_blogs_of_user( $user_id, true );\n\n\t\t\t\t\t\t\t\tforeach ( (array) $blogs as $details ) {\n\t\t\t\t\t\t\t\t\tif ( get_network()->site_id != $details->userblog_id ) { // Main blog is not a spam!\n\t\t\t\t\t\t\t\t\t\tupdate_blog_status( $details->userblog_id, 'spam', '1' );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$user_data         = $user->to_array();\n\t\t\t\t\t\t\t\t$user_data['spam'] = '1';\n\n\t\t\t\t\t\t\t\twp_update_user( $user_data );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'notspam':\n\t\t\t\t\t\t\t\t$user = get_userdata( $user_id );\n\n\t\t\t\t\t\t\t\t$userfunction = 'all_notspam';\n\t\t\t\t\t\t\t\t$blogs        = get_blogs_of_user( $user_id, true );\n\n\t\t\t\t\t\t\t\tforeach ( (array) $blogs as $details ) {\n\t\t\t\t\t\t\t\t\tupdate_blog_status( $details->userblog_id, 'spam', '0' );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$user_data         = $user->to_array();\n\t\t\t\t\t\t\t\t$user_data['spam'] = '0';\n\n\t\t\t\t\t\t\t\twp_update_user( $user_data );\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( ! in_array( $doaction, array( 'delete', 'spam', 'notspam' ), true ) ) {\n\t\t\t\t\t$sendback = wp_get_referer();\n\t\t\t\t\t$user_ids = (array) $_POST['allusers'];\n\n\t\t\t\t\t/** This action is documented in wp-admin/network/site-themes.php */\n\t\t\t\t\t$sendback = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $sendback, $doaction, $user_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\t\t\t\twp_safe_redirect( $sendback );\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t\twp_safe_redirect(\n\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'updated' => 'true',\n\t\t\t\t\t\t\t'action'  => $userfunction,\n\t\t\t\t\t\t),\n\t\t\t\t\t\twp_get_referer()\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$location = network_admin_url( 'users.php' );\n\n\t\t\t\tif ( ! empty( $_REQUEST['paged'] ) ) {\n\t\t\t\t\t$location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location );\n\t\t\t\t}\n\t\t\t\twp_redirect( $location );\n\t\t\t}\n\t\t\texit;\n\n\t\tcase 'dodelete':\n\t\t\tcheck_admin_referer( 'ms-users-delete' );\n\t\t\tif ( ! ( current_user_can( 'manage_network_users' ) && current_user_can( 'delete_users' ) ) ) {\n\t\t\t\twp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );\n\t\t\t}\n\n\t\t\tif ( ! empty( $_POST['blog'] ) && is_array( $_POST['blog'] ) ) {\n\t\t\t\tforeach ( $_POST['blog'] as $id => $users ) {\n\t\t\t\t\tforeach ( $users as $blogid => $user_id ) {\n\t\t\t\t\t\tif ( ! current_user_can( 'delete_user', $id ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! empty( $_POST['delete'] ) && 'reassign' === $_POST['delete'][ $blogid ][ $id ] ) {\n\t\t\t\t\t\t\tremove_user_from_blog( $id, $blogid, (int) $user_id );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tremove_user_from_blog( $id, $blogid );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$i = 0;\n\n\t\t\tif ( is_array( $_POST['user'] ) && ! empty( $_POST['user'] ) ) {\n\t\t\t\tforeach ( $_POST['user'] as $id ) {\n\t\t\t\t\tif ( ! current_user_can( 'delete_user', $id ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\twpmu_delete_user( $id );\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( 1 === $i ) {\n\t\t\t\t$deletefunction = 'delete';\n\t\t\t} else {\n\t\t\t\t$deletefunction = 'all_delete';\n\t\t\t}\n\n\t\t\twp_redirect(\n\t\t\t\tadd_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'updated' => 'true',\n\t\t\t\t\t\t'action'  => $deletefunction,\n\t\t\t\t\t),\n\t\t\t\t\tnetwork_admin_url( 'users.php' )\n\t\t\t\t)\n\t\t\t);\n\t\t\texit;\n\t}\n}\n\n$wp_list_table = _get_list_table( 'WP_MS_Users_List_Table' );\n$pagenum       = $wp_list_table->get_pagenum();\n$wp_list_table->prepare_items();\n$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );\n\nif ( $pagenum > $total_pages && $total_pages > 0 ) {\n\twp_redirect( add_query_arg( 'paged', $total_pages ) );\n\texit;\n}\n$title       = __( 'Users' );\n$parent_file = 'users.php';\n\nadd_screen_option( 'per_page' );\n\nget_current_screen()->add_help_tab(\n\tarray(\n\t\t'id'      => 'overview',\n\t\t'title'   => __( 'Overview' ),\n\t\t'content' =>\n\t\t\t'<p>' . __( 'This table shows all users across the network and the sites to which they are assigned.' ) . '</p>' .\n\t\t\t'<p>' . __( 'Hover over any user on the list to make the edit links appear. The Edit link on the left will take you to their Edit User profile page; the Edit link on the right by any site name goes to an Edit Site screen for that site.' ) . '</p>' .\n\t\t\t'<p>' . __( 'You can also go to the user&#8217;s profile page by clicking on the individual username.' ) . '</p>' .\n\t\t\t'<p>' . __( 'You can sort the table by clicking on any of the table headings and switch between list and excerpt views by using the icons above the users list.' ) . '</p>' .\n\t\t\t'<p>' . __( 'The bulk action will permanently delete selected users, or mark/unmark those selected as spam. Spam users will have posts removed and will be unable to sign up again with the same email addresses.' ) . '</p>' .\n\t\t\t'<p>' . __( 'You can make an existing user an additional super admin by going to the Edit User profile page and checking the box to grant that privilege.' ) . '</p>',\n\t)\n);\n\nget_current_screen()->set_help_sidebar(\n\t'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .\n\t'<p>' . __( '<a href=\"https://codex.wordpress.org/Network_Admin_Users_Screen\">Documentation on Network Users</a>' ) . '</p>' .\n\t'<p>' . __( '<a href=\"https://wordpress.org/support/forum/multisite/\">Support Forums</a>' ) . '</p>'\n);\n\nget_current_screen()->set_screen_reader_content(\n\tarray(\n\t\t'heading_views'      => __( 'Filter users list' ),\n\t\t'heading_pagination' => __( 'Users list navigation' ),\n\t\t'heading_list'       => __( 'Users list' ),\n\t)\n);\n\nrequire_once ABSPATH . 'wp-admin/admin-header.php';\n\nif ( isset( $_REQUEST['updated'] ) && 'true' == $_REQUEST['updated'] && ! empty( $_REQUEST['action'] ) ) {\n\t?>\n\t<div id=\"message\" class=\"updated notice is-dismissible\"><p>\n\t\t<?php\n\t\tswitch ( $_REQUEST['action'] ) {\n\t\t\tcase 'delete':\n\t\t\t\t_e( 'User deleted.' );\n\t\t\t\tbreak;\n\t\t\tcase 'all_spam':\n\t\t\t\t_e( 'Users marked as spam.' );\n\t\t\t\tbreak;\n\t\t\tcase 'all_notspam':\n\t\t\t\t_e( 'Users removed from spam.' );\n\t\t\t\tbreak;\n\t\t\tcase 'all_delete':\n\t\t\t\t_e( 'Users deleted.' );\n\t\t\t\tbreak;\n\t\t\tcase 'add':\n\t\t\t\t_e( 'User added.' );\n\t\t\t\tbreak;\n\t\t}\n\t\t?>\n\t</p></div>\n\t<?php\n}\n?>\n<div class=\"wrap\">\n\t<h1 class=\"wp-heading-inline\"><?php esc_html_e( 'Users' ); ?></h1>\n\n\t<?php\n\tif ( current_user_can( 'create_users' ) ) :\n\t\t?>\n\t\t<a href=\"<?php echo network_admin_url( 'user-new.php' ); ?>\" class=\"page-title-action\"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>\n\t\t\t\t\t\t\t<?php\n\tendif;\n\n\tif ( strlen( $usersearch ) ) {\n\t\t/* translators: %s: Search query. */\n\t\tprintf( '<span class=\"subtitle\">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) );\n\t}\n\t?>\n\n\t<hr class=\"wp-header-end\">\n\n\t<?php $wp_list_table->views(); ?>\n\n\t<form method=\"get\" class=\"search-form\">\n\t\t<?php $wp_list_table->search_box( __( 'Search Users' ), 'all-user' ); ?>\n\t</form>\n\n\t<form id=\"form-user-list\" action=\"users.php?action=allusers\" method=\"post\">\n\t\t<?php $wp_list_table->display(); ?>\n\t</form>\n</div>\n\n<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>\n", "num_lines": 300}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * User Dashboard About administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.4.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/about.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress User Administration Bootstrap\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\ndefine( 'WP_USER_ADMIN', true );\n\nrequire_once dirname( __DIR__ ) . '/admin.php';\n\nif ( ! is_multisite() ) {\n\twp_redirect( admin_url() );\n\texit;\n}\n\n$redirect_user_admin_request = ( 0 !== strcasecmp( $current_blog->domain, $current_site->domain ) || 0 !== strcasecmp( $current_blog->path, $current_site->path ) );\n\n/**\n * Filters whether to redirect the request to the User Admin in Multisite.\n *\n * @since 3.2.0\n *\n * @param bool $redirect_user_admin_request Whether the request should be redirected.\n */\n$redirect_user_admin_request = apply_filters( 'redirect_user_admin_request', $redirect_user_admin_request );\n\nif ( $redirect_user_admin_request ) {\n\twp_redirect( user_admin_url() );\n\texit;\n}\n\nunset( $redirect_user_admin_request );\n", "num_lines": 36}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * User Dashboard Credits administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.4.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/credits.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * User Dashboard Freedoms administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.4.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/freedoms.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * User Dashboard Administration Screen\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/index.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Build User Administration Menu.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n$menu[2] = array( __( 'Dashboard' ), 'exist', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' );\n\n$menu[4] = array( '', 'exist', 'separator1', '', 'wp-menu-separator' );\n\n$menu[70] = array( __( 'Profile' ), 'exist', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );\n\n$menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator' );\n\n$_wp_real_parent_file['users.php'] = 'profile.php';\n$compat                            = array();\n$submenu                           = array();\n\nrequire_once ABSPATH . 'wp-admin/includes/menu.php';\n", "num_lines": 23}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * User Dashboard Privacy administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 4.9.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/privacy.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * User Profile Administration Screen.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/profile.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Edit user administration panel.\n *\n * @package WordPress\n * @subpackage Administration\n * @since 3.1.0\n */\n\n/** Load WordPress Administration Bootstrap */\nrequire_once __DIR__ . '/admin.php';\n\nrequire ABSPATH . 'wp-admin/user-edit.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n// Silence is golden.\n", "num_lines": 3}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * @package Hello_Dolly\n * @version 1.7.2\n */\n/*\nPlugin Name: Hello Dolly\nPlugin URI: http://wordpress.org/plugins/hello-dolly/\nDescription: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.\nAuthor: Matt Mullenweg\nVersion: 1.7.2\nAuthor URI: http://ma.tt/\n*/\n\nfunction hello_dolly_get_lyric() {\n\t/** These are the lyrics to Hello Dolly */\n\t$lyrics = \"Hello, Dolly\nWell, hello, Dolly\nIt's so nice to have you back where you belong\nYou're lookin' swell, Dolly\nI can tell, Dolly\nYou're still glowin', you're still crowin'\nYou're still goin' strong\nI feel the room swayin'\nWhile the band's playin'\nOne of our old favorite songs from way back when\nSo, take her wrap, fellas\nDolly, never go away again\nHello, Dolly\nWell, hello, Dolly\nIt's so nice to have you back where you belong\nYou're lookin' swell, Dolly\nI can tell, Dolly\nYou're still glowin', you're still crowin'\nYou're still goin' strong\nI feel the room swayin'\nWhile the band's playin'\nOne of our old favorite songs from way back when\nSo, golly, gee, fellas\nHave a little faith in me, fellas\nDolly, never go away\nPromise, you'll never go away\nDolly'll never go away again\";\n\n\t// Here we split it into lines.\n\t$lyrics = explode( \"\\n\", $lyrics );\n\n\t// And then randomly choose a line.\n\treturn wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] );\n}\n\n// This just echoes the chosen line, we'll position it later.\nfunction hello_dolly() {\n\t$chosen = hello_dolly_get_lyric();\n\t$lang   = '';\n\tif ( 'en_' !== substr( get_user_locale(), 0, 3 ) ) {\n\t\t$lang = ' lang=\"en\"';\n\t}\n\n\tprintf(\n\t\t'<p id=\"dolly\"><span class=\"screen-reader-text\">%s </span><span dir=\"ltr\"%s>%s</span></p>',\n\t\t__( 'Quote from Hello Dolly song, by Jerry Herman:' ),\n\t\t$lang,\n\t\t$chosen\n\t);\n}\n\n// Now we set that function up to execute when the admin_notices action is called.\nadd_action( 'admin_notices', 'hello_dolly' );\n\n// We need some CSS to position the paragraph.\nfunction dolly_css() {\n\techo \"\n\t<style type='text/css'>\n\t#dolly {\n\t\tfloat: right;\n\t\tpadding: 5px 10px;\n\t\tmargin: 0;\n\t\tfont-size: 12px;\n\t\tline-height: 1.6666;\n\t}\n\t.rtl #dolly {\n\t\tfloat: left;\n\t}\n\t.block-editor-page #dolly {\n\t\tdisplay: none;\n\t}\n\t@media screen and (max-width: 782px) {\n\t\t#dolly,\n\t\t.rtl #dolly {\n\t\t\tfloat: none;\n\t\t\tpadding-left: 0;\n\t\t\tpadding-right: 0;\n\t\t}\n\t}\n\t</style>\n\t\";\n}\n\nadd_action( 'admin_head', 'dolly_css' );\n", "num_lines": 101}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n// Silence is golden.\n", "num_lines": 3}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * @package Akismet\n */\n/*\nPlugin Name: Akismet Anti-Spam\nPlugin URI: https://akismet.com/\nDescription: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. It keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key.\nVersion: 4.1.7\nAuthor: Automattic\nAuthor URI: https://automattic.com/wordpress-plugins/\nLicense: GPLv2 or later\nText Domain: akismet\n*/\n\n/*\nThis program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU General Public License\nas published by the Free Software Foundation; either version 2\nof the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n\nCopyright 2005-2015 Automattic, Inc.\n*/\n\n// Make sure we don't expose any info if called directly\nif ( !function_exists( 'add_action' ) ) {\n\techo 'Hi there!  I\\'m just a plugin, not much I can do when called directly.';\n\texit;\n}\n\ndefine( 'AKISMET_VERSION', '4.1.7' );\ndefine( 'AKISMET__MINIMUM_WP_VERSION', '4.0' );\ndefine( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );\ndefine( 'AKISMET_DELETE_LIMIT', 100000 );\n\nregister_activation_hook( __FILE__, array( 'Akismet', 'plugin_activation' ) );\nregister_deactivation_hook( __FILE__, array( 'Akismet', 'plugin_deactivation' ) );\n\nrequire_once( AKISMET__PLUGIN_DIR . 'class.akismet.php' );\nrequire_once( AKISMET__PLUGIN_DIR . 'class.akismet-widget.php' );\nrequire_once( AKISMET__PLUGIN_DIR . 'class.akismet-rest-api.php' );\n\nadd_action( 'init', array( 'Akismet', 'init' ) );\n\nadd_action( 'rest_api_init', array( 'Akismet_REST_API', 'init' ) );\n\nif ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {\n\trequire_once( AKISMET__PLUGIN_DIR . 'class.akismet-admin.php' );\n\tadd_action( 'init', array( 'Akismet_Admin', 'init' ) );\n}\n\n//add wrapper class around deprecated akismet functions that are referenced elsewhere\nrequire_once( AKISMET__PLUGIN_DIR . 'wrapper.php' );\n\nif ( defined( 'WP_CLI' ) && WP_CLI ) {\n\trequire_once( AKISMET__PLUGIN_DIR . 'class.akismet-cli.php' );\n}\n", "num_lines": 67}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nclass Akismet_Admin {\n\tconst NONCE = 'akismet-update-key';\n\n\tprivate static $initiated = false;\n\tprivate static $notices   = array();\n\tprivate static $allowed   = array(\n\t    'a' => array(\n\t        'href' => true,\n\t        'title' => true,\n\t    ),\n\t    'b' => array(),\n\t    'code' => array(),\n\t    'del' => array(\n\t        'datetime' => true,\n\t    ),\n\t    'em' => array(),\n\t    'i' => array(),\n\t    'q' => array(\n\t        'cite' => true,\n\t    ),\n\t    'strike' => array(),\n\t    'strong' => array(),\n\t);\n\n\tpublic static function init() {\n\t\tif ( ! self::$initiated ) {\n\t\t\tself::init_hooks();\n\t\t}\n\n\t\tif ( isset( $_POST['action'] ) && $_POST['action'] == 'enter-key' ) {\n\t\t\tself::enter_api_key();\n\t\t}\n\t}\n\n\tpublic static function init_hooks() {\n\t\t// The standalone stats page was removed in 3.0 for an all-in-one config and stats page.\n\t\t// Redirect any links that might have been bookmarked or in browser history.\n\t\tif ( isset( $_GET['page'] ) && 'akismet-stats-display' == $_GET['page'] ) {\n\t\t\twp_safe_redirect( esc_url_raw( self::get_page_url( 'stats' ) ), 301 );\n\t\t\tdie;\n\t\t}\n\n\t\tself::$initiated = true;\n\n\t\tadd_action( 'admin_init', array( 'Akismet_Admin', 'admin_init' ) );\n\t\tadd_action( 'admin_menu', array( 'Akismet_Admin', 'admin_menu' ), 5 ); # Priority 5, so it's called before Jetpack's admin_menu.\n\t\tadd_action( 'admin_notices', array( 'Akismet_Admin', 'display_notice' ) );\n\t\tadd_action( 'admin_enqueue_scripts', array( 'Akismet_Admin', 'load_resources' ) );\n\t\tadd_action( 'activity_box_end', array( 'Akismet_Admin', 'dashboard_stats' ) );\n\t\tadd_action( 'rightnow_end', array( 'Akismet_Admin', 'rightnow_stats' ) );\n\t\tadd_action( 'manage_comments_nav', array( 'Akismet_Admin', 'check_for_spam_button' ) );\n\t\tadd_action( 'admin_action_akismet_recheck_queue', array( 'Akismet_Admin', 'recheck_queue' ) );\n\t\tadd_action( 'wp_ajax_akismet_recheck_queue', array( 'Akismet_Admin', 'recheck_queue' ) );\n\t\tadd_action( 'wp_ajax_comment_author_deurl', array( 'Akismet_Admin', 'remove_comment_author_url' ) );\n\t\tadd_action( 'wp_ajax_comment_author_reurl', array( 'Akismet_Admin', 'add_comment_author_url' ) );\n\t\tadd_action( 'jetpack_auto_activate_akismet', array( 'Akismet_Admin', 'connect_jetpack_user' ) );\n\n\t\tadd_filter( 'plugin_action_links', array( 'Akismet_Admin', 'plugin_action_links' ), 10, 2 );\n\t\tadd_filter( 'comment_row_actions', array( 'Akismet_Admin', 'comment_row_action' ), 10, 2 );\n\t\t\n\t\tadd_filter( 'plugin_action_links_'.plugin_basename( plugin_dir_path( __FILE__ ) . 'akismet.php'), array( 'Akismet_Admin', 'admin_plugin_settings_link' ) );\n\t\t\n\t\tadd_filter( 'wxr_export_skip_commentmeta', array( 'Akismet_Admin', 'exclude_commentmeta_from_export' ), 10, 3 );\n\t\t\n\t\tadd_filter( 'all_plugins', array( 'Akismet_Admin', 'modify_plugin_description' ) );\n\n\t\t// priority=1 because we need ours to run before core's comment anonymizer runs, and that's registered at priority=10\n\t\tadd_filter( 'wp_privacy_personal_data_erasers', array( 'Akismet_Admin', 'register_personal_data_eraser' ), 1 );\n\t}\n\n\tpublic static function admin_init() {\n\t\tif ( get_option( 'Activated_Akismet' ) ) {\n\t\t\tdelete_option( 'Activated_Akismet' );\n\t\t\tif ( ! headers_sent() ) {\n\t\t\t\twp_redirect( add_query_arg( array( 'page' => 'akismet-key-config', 'view' => 'start' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'options-general.php' ) ) );\n\t\t\t}\n\t\t}\n\n\t\tload_plugin_textdomain( 'akismet' );\n\t\tadd_meta_box( 'akismet-status', __('Comment History', 'akismet'), array( 'Akismet_Admin', 'comment_status_meta_box' ), 'comment', 'normal' );\n\n\t\tif ( function_exists( 'wp_add_privacy_policy_content' ) ) {\n\t\t\twp_add_privacy_policy_content(\n\t\t\t\t__( 'Akismet', 'akismet' ),\n\t\t\t\t__( 'We collect information about visitors who comment on Sites that use our Akismet anti-spam service. The information we collect depends on how the User sets up Akismet for the Site, but typically includes the commenter\\'s IP address, user agent, referrer, and Site URL (along with other information directly provided by the commenter such as their name, username, email address, and the comment itself).', 'akismet' )\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic static function admin_menu() {\n\t\tif ( class_exists( 'Jetpack' ) )\n\t\t\tadd_action( 'jetpack_admin_menu', array( 'Akismet_Admin', 'load_menu' ) );\n\t\telse\n\t\t\tself::load_menu();\n\t}\n\n\tpublic static function admin_head() {\n\t\tif ( !current_user_can( 'manage_options' ) )\n\t\t\treturn;\n\t}\n\t\n\tpublic static function admin_plugin_settings_link( $links ) { \n  \t\t$settings_link = '<a href=\"'.esc_url( self::get_page_url() ).'\">'.__('Settings', 'akismet').'</a>';\n  \t\tarray_unshift( $links, $settings_link ); \n  \t\treturn $links; \n\t}\n\n\tpublic static function load_menu() {\n\t\tif ( class_exists( 'Jetpack' ) ) {\n\t\t\t$hook = add_submenu_page( 'jetpack', __( 'Akismet Anti-Spam' , 'akismet'), __( 'Akismet Anti-Spam' , 'akismet'), 'manage_options', 'akismet-key-config', array( 'Akismet_Admin', 'display_page' ) );\n\t\t}\n\t\telse {\n\t\t\t$hook = add_options_page( __('Akismet Anti-Spam', 'akismet'), __('Akismet Anti-Spam', 'akismet'), 'manage_options', 'akismet-key-config', array( 'Akismet_Admin', 'display_page' ) );\n\t\t}\n\t\t\n\t\tif ( $hook ) {\n\t\t\tadd_action( \"load-$hook\", array( 'Akismet_Admin', 'admin_help' ) );\n\t\t}\n\t}\n\n\tpublic static function load_resources() {\n\t\tglobal $hook_suffix;\n\n\t\tif ( in_array( $hook_suffix, apply_filters( 'akismet_admin_page_hook_suffixes', array(\n\t\t\t'index.php', # dashboard\n\t\t\t'edit-comments.php',\n\t\t\t'comment.php',\n\t\t\t'post.php',\n\t\t\t'settings_page_akismet-key-config',\n\t\t\t'jetpack_page_akismet-key-config',\n\t\t\t'plugins.php',\n\t\t) ) ) ) {\n\t\t\twp_register_style( 'akismet.css', plugin_dir_url( __FILE__ ) . '_inc/akismet.css', array(), AKISMET_VERSION );\n\t\t\twp_enqueue_style( 'akismet.css');\n\n\t\t\twp_register_script( 'akismet.js', plugin_dir_url( __FILE__ ) . '_inc/akismet.js', array('jquery'), AKISMET_VERSION );\n\t\t\twp_enqueue_script( 'akismet.js' );\n\t\t\n\t\t\t$inline_js = array(\n\t\t\t\t'comment_author_url_nonce' => wp_create_nonce( 'comment_author_url_nonce' ),\n\t\t\t\t'strings' => array(\n\t\t\t\t\t'Remove this URL' => __( 'Remove this URL' , 'akismet'),\n\t\t\t\t\t'Removing...'     => __( 'Removing...' , 'akismet'),\n\t\t\t\t\t'URL removed'     => __( 'URL removed' , 'akismet'),\n\t\t\t\t\t'(undo)'          => __( '(undo)' , 'akismet'),\n\t\t\t\t\t'Re-adding...'    => __( 'Re-adding...' , 'akismet'),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( isset( $_GET['akismet_recheck'] ) && wp_verify_nonce( $_GET['akismet_recheck'], 'akismet_recheck' ) ) {\n\t\t\t\t$inline_js['start_recheck'] = true;\n\t\t\t}\n\n\t\t\tif ( apply_filters( 'akismet_enable_mshots', true ) ) {\n\t\t\t\t$inline_js['enable_mshots'] = true;\n\t\t\t}\n\n\t\t\twp_localize_script( 'akismet.js', 'WPAkismet', $inline_js );\n\t\t}\n\t}\n\n\t/**\n\t * Add help to the Akismet page\n\t *\n\t * @return false if not the Akismet page\n\t */\n\tpublic static function admin_help() {\n\t\t$current_screen = get_current_screen();\n\n\t\t// Screen Content\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\tif ( !Akismet::get_api_key() || ( isset( $_GET['view'] ) && $_GET['view'] == 'start' ) ) {\n\t\t\t\t//setup page\n\t\t\t\t$current_screen->add_help_tab(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'\t\t=> 'overview',\n\t\t\t\t\t\t'title'\t\t=> __( 'Overview' , 'akismet'),\n\t\t\t\t\t\t'content'\t=>\n\t\t\t\t\t\t\t'<p><strong>' . esc_html__( 'Akismet Setup' , 'akismet') . '</strong></p>' .\n\t\t\t\t\t\t\t'<p>' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '</p>' .\n\t\t\t\t\t\t\t'<p>' . esc_html__( 'On this page, you are able to set up the Akismet plugin.' , 'akismet') . '</p>',\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t$current_screen->add_help_tab(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'\t\t=> 'setup-signup',\n\t\t\t\t\t\t'title'\t\t=> __( 'New to Akismet' , 'akismet'),\n\t\t\t\t\t\t'content'\t=>\n\t\t\t\t\t\t\t'<p><strong>' . esc_html__( 'Akismet Setup' , 'akismet') . '</strong></p>' .\n\t\t\t\t\t\t\t'<p>' . esc_html__( 'You need to enter an API key to activate the Akismet service on your site.' , 'akismet') . '</p>' .\n\t\t\t\t\t\t\t'<p>' . sprintf( __( 'Sign up for an account on %s to get an API Key.' , 'akismet'), '<a href=\"https://akismet.com/plugin-signup/\" target=\"_blank\">Akismet.com</a>' ) . '</p>',\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t$current_screen->add_help_tab(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'\t\t=> 'setup-manual',\n\t\t\t\t\t\t'title'\t\t=> __( 'Enter an API Key' , 'akismet'),\n\t\t\t\t\t\t'content'\t=>\n\t\t\t\t\t\t\t'<p><strong>' . esc_html__( 'Akismet Setup' , 'akismet') . '</strong></p>' .\n\t\t\t\t\t\t\t'<p>' . esc_html__( 'If you already have an API key' , 'akismet') . '</p>' .\n\t\t\t\t\t\t\t'<ol>' .\n\t\t\t\t\t\t\t\t'<li>' . esc_html__( 'Copy and paste the API key into the text field.' , 'akismet') . '</li>' .\n\t\t\t\t\t\t\t\t'<li>' . esc_html__( 'Click the Use this Key button.' , 'akismet') . '</li>' .\n\t\t\t\t\t\t\t'</ol>',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\telseif ( isset( $_GET['view'] ) && $_GET['view'] == 'stats' ) {\n\t\t\t\t//stats page\n\t\t\t\t$current_screen->add_help_tab(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'\t\t=> 'overview',\n\t\t\t\t\t\t'title'\t\t=> __( 'Overview' , 'akismet'),\n\t\t\t\t\t\t'content'\t=>\n\t\t\t\t\t\t\t'<p><strong>' . esc_html__( 'Akismet Stats' , 'akismet') . '</strong></p>' .\n\t\t\t\t\t\t\t'<p>' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '</p>' .\n\t\t\t\t\t\t\t'<p>' . esc_html__( 'On this page, you are able to view stats on spam filtered on your site.' , 'akismet') . '</p>',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//configuration page\n\t\t\t\t$current_screen->add_help_tab(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'\t\t=> 'overview',\n\t\t\t\t\t\t'title'\t\t=> __( 'Overview' , 'akismet'),\n\t\t\t\t\t\t'content'\t=>\n\t\t\t\t\t\t\t'<p><strong>' . esc_html__( 'Akismet Configuration' , 'akismet') . '</strong></p>' .\n\t\t\t\t\t\t\t'<p>' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '</p>' .\n\t\t\t\t\t\t\t'<p>' . esc_html__( 'On this page, you are able to update your Akismet settings and view spam stats.' , 'akismet') . '</p>',\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t$current_screen->add_help_tab(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'\t\t=> 'settings',\n\t\t\t\t\t\t'title'\t\t=> __( 'Settings' , 'akismet'),\n\t\t\t\t\t\t'content'\t=>\n\t\t\t\t\t\t\t'<p><strong>' . esc_html__( 'Akismet Configuration' , 'akismet') . '</strong></p>' .\n\t\t\t\t\t\t\t( Akismet::predefined_api_key() ? '' : '<p><strong>' . esc_html__( 'API Key' , 'akismet') . '</strong> - ' . esc_html__( 'Enter/remove an API key.' , 'akismet') . '</p>' ) .\n\t\t\t\t\t\t\t'<p><strong>' . esc_html__( 'Comments' , 'akismet') . '</strong> - ' . esc_html__( 'Show the number of approved comments beside each comment author in the comments list page.' , 'akismet') . '</p>' .\n\t\t\t\t\t\t\t'<p><strong>' . esc_html__( 'Strictness' , 'akismet') . '</strong> - ' . esc_html__( 'Choose to either discard the worst spam automatically or to always put all spam in spam folder.' , 'akismet') . '</p>',\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tif ( ! Akismet::predefined_api_key() ) {\n\t\t\t\t\t$current_screen->add_help_tab(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id'\t\t=> 'account',\n\t\t\t\t\t\t\t'title'\t\t=> __( 'Account' , 'akismet'),\n\t\t\t\t\t\t\t'content'\t=>\n\t\t\t\t\t\t\t\t'<p><strong>' . esc_html__( 'Akismet Configuration' , 'akismet') . '</strong></p>' .\n\t\t\t\t\t\t\t\t'<p><strong>' . esc_html__( 'Subscription Type' , 'akismet') . '</strong> - ' . esc_html__( 'The Akismet subscription plan' , 'akismet') . '</p>' .\n\t\t\t\t\t\t\t\t'<p><strong>' . esc_html__( 'Status' , 'akismet') . '</strong> - ' . esc_html__( 'The subscription status - active, cancelled or suspended' , 'akismet') . '</p>',\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Help Sidebar\n\t\t$current_screen->set_help_sidebar(\n\t\t\t'<p><strong>' . esc_html__( 'For more information:' , 'akismet') . '</strong></p>' .\n\t\t\t'<p><a href=\"https://akismet.com/faq/\" target=\"_blank\">'     . esc_html__( 'Akismet FAQ' , 'akismet') . '</a></p>' .\n\t\t\t'<p><a href=\"https://akismet.com/support/\" target=\"_blank\">' . esc_html__( 'Akismet Support' , 'akismet') . '</a></p>'\n\t\t);\n\t}\n\n\tpublic static function enter_api_key() {\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\tdie( __( 'Cheatin&#8217; uh?', 'akismet' ) );\n\t\t}\n\n\t\tif ( !wp_verify_nonce( $_POST['_wpnonce'], self::NONCE ) )\n\t\t\treturn false;\n\n\t\tforeach( array( 'akismet_strictness', 'akismet_show_user_comments_approved' ) as $option ) {\n\t\t\tupdate_option( $option, isset( $_POST[$option] ) && (int) $_POST[$option] == 1 ? '1' : '0' );\n\t\t}\n\n\t\tif ( ! empty( $_POST['akismet_comment_form_privacy_notice'] ) ) {\n\t\t\tself::set_form_privacy_notice_option( $_POST['akismet_comment_form_privacy_notice'] );\n\t\t} else {\n\t\t\tself::set_form_privacy_notice_option( 'hide' );\n\t\t}\n\n\t\tif ( Akismet::predefined_api_key() ) {\n\t\t\treturn false; //shouldn't have option to save key if already defined\n\t\t}\n\t\t\n\t\t$new_key = preg_replace( '/[^a-f0-9]/i', '', $_POST['key'] );\n\t\t$old_key = Akismet::get_api_key();\n\n\t\tif ( empty( $new_key ) ) {\n\t\t\tif ( !empty( $old_key ) ) {\n\t\t\t\tdelete_option( 'wordpress_api_key' );\n\t\t\t\tself::$notices[] = 'new-key-empty';\n\t\t\t}\n\t\t}\n\t\telseif ( $new_key != $old_key ) {\n\t\t\tself::save_key( $new_key );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic static function save_key( $api_key ) {\n\t\t$key_status = Akismet::verify_key( $api_key );\n\n\t\tif ( $key_status == 'valid' ) {\n\t\t\t$akismet_user = self::get_akismet_user( $api_key );\n\t\t\t\n\t\t\tif ( $akismet_user ) {\t\t\t\t\n\t\t\t\tif ( in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub' ) ) )\n\t\t\t\t\tupdate_option( 'wordpress_api_key', $api_key );\n\t\t\t\t\n\t\t\t\tif ( $akismet_user->status == 'active' )\n\t\t\t\t\tself::$notices['status'] = 'new-key-valid';\n\t\t\t\telseif ( $akismet_user->status == 'notice' )\n\t\t\t\t\tself::$notices['status'] = $akismet_user;\n\t\t\t\telse\n\t\t\t\t\tself::$notices['status'] = $akismet_user->status;\n\t\t\t}\n\t\t\telse\n\t\t\t\tself::$notices['status'] = 'new-key-invalid';\n\t\t}\n\t\telseif ( in_array( $key_status, array( 'invalid', 'failed' ) ) )\n\t\t\tself::$notices['status'] = 'new-key-'.$key_status;\n\t}\n\n\tpublic static function dashboard_stats() {\n\t\tif ( did_action( 'rightnow_end' ) ) {\n\t\t\treturn; // We already displayed this info in the \"Right Now\" section\n\t\t}\n\n\t\tif ( !$count = get_option('akismet_spam_count') )\n\t\t\treturn;\n\n\t\tglobal $submenu;\n\n\t\techo '<h3>' . esc_html( _x( 'Spam', 'comments' , 'akismet') ) . '</h3>';\n\n\t\techo '<p>'.sprintf( _n(\n\t\t\t\t'<a href=\"%1$s\">Akismet</a> has protected your site from <a href=\"%2$s\">%3$s spam comment</a>.',\n\t\t\t\t'<a href=\"%1$s\">Akismet</a> has protected your site from <a href=\"%2$s\">%3$s spam comments</a>.',\n\t\t\t\t$count\n\t\t\t, 'akismet'), 'https://akismet.com/wordpress/', esc_url( add_query_arg( array( 'page' => 'akismet-admin' ), admin_url( isset( $submenu['edit-comments.php'] ) ? 'edit-comments.php' : 'edit.php' ) ) ), number_format_i18n($count) ).'</p>';\n\t}\n\n\t// WP 2.5+\n\tpublic static function rightnow_stats() {\n\t\tif ( $count = get_option('akismet_spam_count') ) {\n\t\t\t$intro = sprintf( _n(\n\t\t\t\t'<a href=\"%1$s\">Akismet</a> has protected your site from %2$s spam comment already. ',\n\t\t\t\t'<a href=\"%1$s\">Akismet</a> has protected your site from %2$s spam comments already. ',\n\t\t\t\t$count\n\t\t\t, 'akismet'), 'https://akismet.com/wordpress/', number_format_i18n( $count ) );\n\t\t} else {\n\t\t\t$intro = sprintf( __('<a href=\"%s\">Akismet</a> blocks spam from getting to your blog. ', 'akismet'), 'https://akismet.com/wordpress/' );\n\t\t}\n\n\t\t$link = add_query_arg( array( 'comment_status' => 'spam' ), admin_url( 'edit-comments.php' ) );\n\n\t\tif ( $queue_count = self::get_spam_count() ) {\n\t\t\t$queue_text = sprintf( _n(\n\t\t\t\t'There&#8217;s <a href=\"%2$s\">%1$s comment</a> in your spam queue right now.',\n\t\t\t\t'There are <a href=\"%2$s\">%1$s comments</a> in your spam queue right now.',\n\t\t\t\t$queue_count\n\t\t\t, 'akismet'), number_format_i18n( $queue_count ), esc_url( $link ) );\n\t\t} else {\n\t\t\t$queue_text = sprintf( __( \"There&#8217;s nothing in your <a href='%s'>spam queue</a> at the moment.\" , 'akismet'), esc_url( $link ) );\n\t\t}\n\n\t\t$text = $intro . '<br />' . $queue_text;\n\t\techo \"<p class='akismet-right-now'>$text</p>\\n\";\n\t}\n\n\tpublic static function check_for_spam_button( $comment_status ) {\n\t\t// The \"Check for Spam\" button should only appear when the page might be showing\n\t\t// a comment with comment_approved=0, which means an un-trashed, un-spammed,\n\t\t// not-yet-moderated comment.\n\t\tif ( 'all' != $comment_status && 'moderated' != $comment_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$link = '';\n\n\t\t$comments_count = wp_count_comments();\n\t\t\n\t\techo '</div>';\n\t\techo '<div class=\"alignleft actions\">';\n\n\t\t$classes = array(\n\t\t\t'button-secondary',\n\t\t\t'checkforspam',\n\t\t\t'button-disabled'\t// Disable button until the page is loaded\n\t\t);\n\n\t\tif ( $comments_count->moderated > 0 ) {\n\t\t\t$classes[] = 'enable-on-load';\n\n\t\t\tif ( ! Akismet::get_api_key() ) {\n\t\t\t\t$link = add_query_arg( array( 'page' => 'akismet-key-config' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'options-general.php' ) );\n\t\t\t\t$classes[] = 'ajax-disabled';\n\t\t\t}\n\t\t}\n\n\t\techo '<a\n\t\t\t\tclass=\"' . esc_attr( implode( ' ', $classes ) ) . '\"' .\n\t\t\t\t( ! empty( $link ) ? ' href=\"' . esc_url( $link ) . '\"' : '' ) .\n\t\t\t\t/* translators: The placeholder is for showing how much of the process has completed, as a percent. e.g., \"Checking for Spam (40%)\" */\n\t\t\t\t' data-progress-label=\"' . esc_attr( __( 'Checking for Spam (%1$s%)', 'akismet' ) ) . '\"\n\t\t\t\tdata-success-url=\"' . esc_attr( remove_query_arg( array( 'akismet_recheck', 'akismet_recheck_error' ), add_query_arg( array( 'akismet_recheck_complete' => 1, 'recheck_count' => urlencode( '__recheck_count__' ), 'spam_count' => urlencode( '__spam_count__' ) ) ) ) ) . '\"\n\t\t\t\tdata-failure-url=\"' . esc_attr( remove_query_arg( array( 'akismet_recheck', 'akismet_recheck_complete' ), add_query_arg( array( 'akismet_recheck_error' => 1 ) ) ) ) . '\"\n\t\t\t\tdata-pending-comment-count=\"' . esc_attr( $comments_count->moderated ) . '\"\n\t\t\t\tdata-nonce=\"' . esc_attr( wp_create_nonce( 'akismet_check_for_spam' ) ) . '\"\n\t\t\t\t' . ( ! in_array( 'ajax-disabled', $classes ) ? 'onclick=\"return false;\"' : '' ) . '\n\t\t\t\t>' . esc_html__('Check for Spam', 'akismet') . '</a>';\n\t\techo '<span class=\"checkforspam-spinner\"></span>';\n\t}\n\n\tpublic static function recheck_queue() {\n\t\tglobal $wpdb;\n\n\t\tAkismet::fix_scheduled_recheck();\n\n\t\tif ( ! ( isset( $_GET['recheckqueue'] ) || ( isset( $_REQUEST['action'] ) && 'akismet_recheck_queue' == $_REQUEST['action'] ) ) ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( ! wp_verify_nonce( $_POST['nonce'], 'akismet_check_for_spam' ) ) {\n\t\t\twp_send_json( array(\n\t\t\t\t'error' => __( \"You don't have permission to do that.\"),\n\t\t\t));\n\t\t\treturn;\n\t\t}\n\n\t\t$result_counts = self::recheck_queue_portion( empty( $_POST['offset'] ) ? 0 : $_POST['offset'], empty( $_POST['limit'] ) ? 100 : $_POST['limit'] );\n\n\t\tif ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {\n\t\t\twp_send_json( array(\n\t\t\t\t'counts' => $result_counts,\n\t\t\t));\n\t\t}\n\t\telse {\n\t\t\t$redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : admin_url( 'edit-comments.php' );\n\t\t\twp_safe_redirect( $redirect_to );\n\t\t\texit;\n\t\t}\n\t}\n\t\n\tpublic static function recheck_queue_portion( $start = 0, $limit = 100 ) {\n\t\tglobal $wpdb;\n\t\t\n\t\t$paginate = '';\n\n\t\tif ( $limit <= 0 ) {\n\t\t\t$limit = 100;\n\t\t}\n\n\t\tif ( $start < 0 ) {\n\t\t\t$start = 0;\n\t\t}\n\n\t\t$moderation = $wpdb->get_col( $wpdb->prepare( \"SELECT * FROM {$wpdb->comments} WHERE comment_approved = '0' LIMIT %d OFFSET %d\", $limit, $start ) );\n\n\t\t$result_counts = array(\n\t\t\t'processed' => count( $moderation ),\n\t\t\t'spam' => 0,\n\t\t\t'ham' => 0,\n\t\t\t'error' => 0,\n\t\t);\n\n\t\tforeach ( $moderation as $comment_id ) {\n\t\t\t$api_response = Akismet::recheck_comment( $comment_id, 'recheck_queue' );\n\n\t\t\tif ( 'true' === $api_response ) {\n\t\t\t\t++$result_counts['spam'];\n\t\t\t}\n\t\t\telseif ( 'false' === $api_response ) {\n\t\t\t\t++$result_counts['ham'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t++$result_counts['error'];\n\t\t\t}\n\t\t}\n\n\t\treturn $result_counts;\n\t}\n\n\t// Adds an 'x' link next to author URLs, clicking will remove the author URL and show an undo link\n\tpublic static function remove_comment_author_url() {\n\t\tif ( !empty( $_POST['id'] ) && check_admin_referer( 'comment_author_url_nonce' ) ) {\n\t\t\t$comment_id = intval( $_POST['id'] );\n\t\t\t$comment = get_comment( $comment_id, ARRAY_A );\n\t\t\tif ( $comment && current_user_can( 'edit_comment', $comment['comment_ID'] ) ) {\n\t\t\t\t$comment['comment_author_url'] = '';\n\t\t\t\tdo_action( 'comment_remove_author_url' );\n\t\t\t\tprint( wp_update_comment( $comment ) );\n\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static function add_comment_author_url() {\n\t\tif ( !empty( $_POST['id'] ) && !empty( $_POST['url'] ) && check_admin_referer( 'comment_author_url_nonce' ) ) {\n\t\t\t$comment_id = intval( $_POST['id'] );\n\t\t\t$comment = get_comment( $comment_id, ARRAY_A );\n\t\t\tif ( $comment && current_user_can( 'edit_comment', $comment['comment_ID'] ) ) {\n\t\t\t\t$comment['comment_author_url'] = esc_url( $_POST['url'] );\n\t\t\t\tdo_action( 'comment_add_author_url' );\n\t\t\t\tprint( wp_update_comment( $comment ) );\n\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static function comment_row_action( $a, $comment ) {\n\t\t$akismet_result = get_comment_meta( $comment->comment_ID, 'akismet_result', true );\n\t\t$akismet_error  = get_comment_meta( $comment->comment_ID, 'akismet_error', true );\n\t\t$user_result    = get_comment_meta( $comment->comment_ID, 'akismet_user_result', true);\n\t\t$comment_status = wp_get_comment_status( $comment->comment_ID );\n\t\t$desc = null;\n\t\tif ( $akismet_error ) {\n\t\t\t$desc = __( 'Awaiting spam check' , 'akismet');\n\t\t} elseif ( !$user_result || $user_result == $akismet_result ) {\n\t\t\t// Show the original Akismet result if the user hasn't overridden it, or if their decision was the same\n\t\t\tif ( $akismet_result == 'true' && $comment_status != 'spam' && $comment_status != 'trash' )\n\t\t\t\t$desc = __( 'Flagged as spam by Akismet' , 'akismet');\n\t\t\telseif ( $akismet_result == 'false' && $comment_status == 'spam' )\n\t\t\t\t$desc = __( 'Cleared by Akismet' , 'akismet');\n\t\t} else {\n\t\t\t$who = get_comment_meta( $comment->comment_ID, 'akismet_user', true );\n\t\t\tif ( $user_result == 'true' )\n\t\t\t\t$desc = sprintf( __('Flagged as spam by %s', 'akismet'), $who );\n\t\t\telse\n\t\t\t\t$desc = sprintf( __('Un-spammed by %s', 'akismet'), $who );\n\t\t}\n\n\t\t// add a History item to the hover links, just after Edit\n\t\tif ( $akismet_result ) {\n\t\t\t$b = array();\n\t\t\tforeach ( $a as $k => $item ) {\n\t\t\t\t$b[ $k ] = $item;\n\t\t\t\tif (\n\t\t\t\t\t$k == 'edit'\n\t\t\t\t\t|| $k == 'unspam'\n\t\t\t\t) {\n\t\t\t\t\t$b['history'] = '<a href=\"comment.php?action=editcomment&amp;c='.$comment->comment_ID.'#akismet-status\" title=\"'. esc_attr__( 'View comment history' , 'akismet') . '\"> '. esc_html__('History', 'akismet') . '</a>';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$a = $b;\n\t\t}\n\n\t\tif ( $desc )\n\t\t\techo '<span class=\"akismet-status\" commentid=\"'.$comment->comment_ID.'\"><a href=\"comment.php?action=editcomment&amp;c='.$comment->comment_ID.'#akismet-status\" title=\"' . esc_attr__( 'View comment history' , 'akismet') . '\">'.esc_html( $desc ).'</a></span>';\n\n\t\t$show_user_comments_option = get_option( 'akismet_show_user_comments_approved' );\n\t\t\n\t\tif ( $show_user_comments_option === false ) {\n\t\t\t// Default to active if the user hasn't made a decision.\n\t\t\t$show_user_comments_option = '1';\n\t\t}\n\t\t\n\t\t$show_user_comments = apply_filters( 'akismet_show_user_comments_approved', $show_user_comments_option );\n\t\t$show_user_comments = $show_user_comments === 'false' ? false : $show_user_comments; //option used to be saved as 'false' / 'true'\n\t\t\n\t\tif ( $show_user_comments ) {\n\t\t\t$comment_count = Akismet::get_user_comments_approved( $comment->user_id, $comment->comment_author_email, $comment->comment_author, $comment->comment_author_url );\n\t\t\t$comment_count = intval( $comment_count );\n\t\t\techo '<span class=\"akismet-user-comment-count\" commentid=\"'.$comment->comment_ID.'\" style=\"display:none;\"><br><span class=\"akismet-user-comment-counts\">'. sprintf( esc_html( _n( '%s approved', '%s approved', $comment_count , 'akismet') ), number_format_i18n( $comment_count ) ) . '</span></span>';\n\t\t}\n\n\t\treturn $a;\n\t}\n\n\tpublic static function comment_status_meta_box( $comment ) {\n\t\t$history = Akismet::get_comment_history( $comment->comment_ID );\n\n\t\tif ( $history ) {\n\t\t\tforeach ( $history as $row ) {\n\t\t\t\t$time = date( 'D d M Y @ h:i:s a', $row['time'] ) . ' GMT';\n\t\t\t\t\n\t\t\t\t$message = '';\n\t\t\t\t\n\t\t\t\tif ( ! empty( $row['message'] ) ) {\n\t\t\t\t\t// Old versions of Akismet stored the message as a literal string in the commentmeta.\n\t\t\t\t\t// New versions don't do that for two reasons:\n\t\t\t\t\t// 1) Save space.\n\t\t\t\t\t// 2) The message can be translated into the current language of the blog, not stuck \n\t\t\t\t\t//    in the language of the blog when the comment was made.\n\t\t\t\t\t$message = esc_html( $row['message'] );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// If possible, use a current translation.\n\t\t\t\tswitch ( $row['event'] ) {\n\t\t\t\t\tcase 'recheck-spam';\n\t\t\t\t\t\t$message = esc_html( __( 'Akismet re-checked and caught this comment as spam.', 'akismet' ) );\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'check-spam':\n\t\t\t\t\t\t$message = esc_html( __( 'Akismet caught this comment as spam.', 'akismet' ) );\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'recheck-ham':\n\t\t\t\t\t\t$message = esc_html( __( 'Akismet re-checked and cleared this comment.', 'akismet' ) );\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'check-ham':\n\t\t\t\t\t\t$message = esc_html( __( 'Akismet cleared this comment.', 'akismet' ) );\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'wp-blacklisted':\n\t\t\t\t\tcase 'wp-disallowed':\n\t\t\t\t\t\t$message = sprintf(\n\t\t\t\t\t\t\t/* translators: The placeholder is a WordPress PHP function name. */\n\t\t\t\t\t\t\tesc_html( __( 'Comment was caught by %s.', 'akismet' ) ),\n\t\t\t\t\t\t\tfunction_exists( 'wp_check_comment_disallowed_list' ) ? '<code>wp_check_comment_disallowed_list</code>' : '<code>wp_blacklist_check</code>'\n\t\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'report-spam':\n\t\t\t\t\t\tif ( isset( $row['user'] ) ) {\n\t\t\t\t\t\t\t$message = esc_html( sprintf( __( '%s reported this comment as spam.', 'akismet' ), $row['user'] ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ( ! $message ) {\n\t\t\t\t\t\t\t$message = esc_html( __( 'This comment was reported as spam.', 'akismet' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'report-ham':\n\t\t\t\t\t\tif ( isset( $row['user'] ) ) {\n\t\t\t\t\t\t\t$message = esc_html( sprintf( __( '%s reported this comment as not spam.', 'akismet' ), $row['user'] ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ( ! $message ) {\n\t\t\t\t\t\t\t$message = esc_html( __( 'This comment was reported as not spam.', 'akismet' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'cron-retry-spam':\n\t\t\t\t\t\t$message = esc_html( __( 'Akismet caught this comment as spam during an automatic retry.' , 'akismet') );\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'cron-retry-ham':\n\t\t\t\t\t\t$message = esc_html( __( 'Akismet cleared this comment during an automatic retry.', 'akismet') );\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'check-error':\n\t\t\t\t\t\tif ( isset( $row['meta'], $row['meta']['response'] ) ) {\n\t\t\t\t\t\t\t$message = sprintf( esc_html( __( 'Akismet was unable to check this comment (response: %s) but will automatically retry later.', 'akismet') ), '<code>' . esc_html( $row['meta']['response'] ) . '</code>' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$message = esc_html( __( 'Akismet was unable to check this comment but will automatically retry later.', 'akismet' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'recheck-error':\n\t\t\t\t\t\tif ( isset( $row['meta'], $row['meta']['response'] ) ) {\n\t\t\t\t\t\t\t$message = sprintf( esc_html( __( 'Akismet was unable to recheck this comment (response: %s).', 'akismet') ), '<code>' . esc_html( $row['meta']['response'] ) . '</code>' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$message = esc_html( __( 'Akismet was unable to recheck this comment.', 'akismet' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif ( preg_match( '/^status-changed/', $row['event'] ) ) {\n\t\t\t\t\t\t\t// Half of these used to be saved without the dash after 'status-changed'.\n\t\t\t\t\t\t\t// See https://plugins.trac.wordpress.org/changeset/1150658/akismet/trunk\n\t\t\t\t\t\t\t$new_status = preg_replace( '/^status-changed-?/', '', $row['event'] );\n\t\t\t\t\t\t\t$message = sprintf( esc_html( __( 'Comment status was changed to %s', 'akismet' ) ), '<code>' . esc_html( $new_status ) . '</code>' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ( preg_match( '/^status-/', $row['event'] ) ) {\n\t\t\t\t\t\t\t$new_status = preg_replace( '/^status-/', '', $row['event'] );\n\n\t\t\t\t\t\t\tif ( isset( $row['user'] ) ) {\n\t\t\t\t\t\t\t\t$message = sprintf( esc_html( __( '%1$s changed the comment status to %2$s.', 'akismet' ) ), $row['user'], '<code>' . esc_html( $new_status ) . '</code>' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $message ) ) {\n\t\t\t\t\techo '<p>';\n\t\t\t\t\techo '<span style=\"color: #999;\" alt=\"' . $time . '\" title=\"' . $time . '\">' . sprintf( esc_html__('%s ago', 'akismet'), human_time_diff( $row['time'] ) ) . '</span>';\n\t\t\t\t\techo ' - ';\n\t\t\t\t\techo $message; // esc_html() is done above so that we can use HTML in some messages.\n\t\t\t\t\techo '</p>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\techo '<p>';\n\t\t\techo esc_html( __( 'No comment history.', 'akismet' ) );\n\t\t\techo '</p>';\n\t\t}\n\t}\n\n\tpublic static function plugin_action_links( $links, $file ) {\n\t\tif ( $file == plugin_basename( plugin_dir_url( __FILE__ ) . '/akismet.php' ) ) {\n\t\t\t$links[] = '<a href=\"' . esc_url( self::get_page_url() ) . '\">'.esc_html__( 'Settings' , 'akismet').'</a>';\n\t\t}\n\n\t\treturn $links;\n\t}\n\n\t// Total spam in queue\n\t// get_option( 'akismet_spam_count' ) is the total caught ever\n\tpublic static function get_spam_count( $type = false ) {\n\t\tglobal $wpdb;\n\n\t\tif ( !$type ) { // total\n\t\t\t$count = wp_cache_get( 'akismet_spam_count', 'widget' );\n\t\t\tif ( false === $count ) {\n\t\t\t\t$count = wp_count_comments();\n\t\t\t\t$count = $count->spam;\n\t\t\t\twp_cache_set( 'akismet_spam_count', $count, 'widget', 3600 );\n\t\t\t}\n\t\t\treturn $count;\n\t\t} elseif ( 'comments' == $type || 'comment' == $type ) { // comments\n\t\t\t$type = '';\n\t\t}\n\n\t\treturn (int) $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT(comment_ID) FROM {$wpdb->comments} WHERE comment_approved = 'spam' AND comment_type = %s\", $type ) );\n\t}\n\n\t// Check connectivity between the WordPress blog and Akismet's servers.\n\t// Returns an associative array of server IP addresses, where the key is the IP address, and value is true (available) or false (unable to connect).\n\tpublic static function check_server_ip_connectivity() {\n\t\t\n\t\t$servers = $ips = array();\n\n\t\t// Some web hosts may disable this function\n\t\tif ( function_exists('gethostbynamel') ) {\t\n\t\t\t\n\t\t\t$ips = gethostbynamel( 'rest.akismet.com' );\n\t\t\tif ( $ips && is_array($ips) && count($ips) ) {\n\t\t\t\t$api_key = Akismet::get_api_key();\n\t\t\t\t\n\t\t\t\tforeach ( $ips as $ip ) {\n\t\t\t\t\t$response = Akismet::verify_key( $api_key, $ip );\n\t\t\t\t\t// even if the key is invalid, at least we know we have connectivity\n\t\t\t\t\tif ( $response == 'valid' || $response == 'invalid' )\n\t\t\t\t\t\t$servers[$ip] = 'connected';\n\t\t\t\t\telse\n\t\t\t\t\t\t$servers[$ip] = $response ? $response : 'unable to connect';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $servers;\n\t}\n\t\n\t// Simpler connectivity check\n\tpublic static function check_server_connectivity($cache_timeout = 86400) {\n\t\t\n\t\t$debug = array();\n\t\t$debug[ 'PHP_VERSION' ]         = PHP_VERSION;\n\t\t$debug[ 'WORDPRESS_VERSION' ]   = $GLOBALS['wp_version'];\n\t\t$debug[ 'AKISMET_VERSION' ]     = AKISMET_VERSION;\n\t\t$debug[ 'AKISMET__PLUGIN_DIR' ] = AKISMET__PLUGIN_DIR;\n\t\t$debug[ 'SITE_URL' ]            = site_url();\n\t\t$debug[ 'HOME_URL' ]            = home_url();\n\t\t\n\t\t$servers = get_option('akismet_available_servers');\n\t\tif ( (time() - get_option('akismet_connectivity_time') < $cache_timeout) && $servers !== false ) {\n\t\t\t$servers = self::check_server_ip_connectivity();\n\t\t\tupdate_option('akismet_available_servers', $servers);\n\t\t\tupdate_option('akismet_connectivity_time', time());\n\t\t}\n\n\t\tif ( wp_http_supports( array( 'ssl' ) ) ) {\n\t\t\t$response = wp_remote_get( 'https://rest.akismet.com/1.1/test' );\n\t\t}\n\t\telse {\n\t\t\t$response = wp_remote_get( 'http://rest.akismet.com/1.1/test' );\n\t\t}\n\n\t\t$debug[ 'gethostbynamel' ]  = function_exists('gethostbynamel') ? 'exists' : 'not here';\n\t\t$debug[ 'Servers' ]         = $servers;\n\t\t$debug[ 'Test Connection' ] = $response;\n\t\t\n\t\tAkismet::log( $debug );\n\t\t\n\t\tif ( $response && 'connected' == wp_remote_retrieve_body( $response ) )\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t}\n\n\t// Check the server connectivity and store the available servers in an option. \n\tpublic static function get_server_connectivity($cache_timeout = 86400) {\n\t\treturn self::check_server_connectivity( $cache_timeout );\n\t}\n\n\t/**\n\t * Find out whether any comments in the Pending queue have not yet been checked by Akismet.\n\t *\n\t * @return bool\n\t */\n\tpublic static function are_any_comments_waiting_to_be_checked() {\n\t\treturn !! get_comments( array(\n\t\t\t// Exclude comments that are not pending. This would happen if someone manually approved or spammed a comment\n\t\t\t// that was waiting to be checked. The akismet_error meta entry will eventually be removed by the cron recheck job.\n\t\t\t'status' => 'hold',\n\t\t\t\n\t\t\t// This is the commentmeta that is saved when a comment couldn't be checked.\n\t\t\t'meta_key' => 'akismet_error',\n\t\t\t\n\t\t\t// We only need to know whether at least one comment is waiting for a check.\n\t\t\t'number' => 1,\n\t\t) );\n\t}\n\n\tpublic static function get_page_url( $page = 'config' ) {\n\n\t\t$args = array( 'page' => 'akismet-key-config' );\n\n\t\tif ( $page == 'stats' )\n\t\t\t$args = array( 'page' => 'akismet-key-config', 'view' => 'stats' );\n\t\telseif ( $page == 'delete_key' )\n\t\t\t$args = array( 'page' => 'akismet-key-config', 'view' => 'start', 'action' => 'delete-key', '_wpnonce' => wp_create_nonce( self::NONCE ) );\n\n\t\t$url = add_query_arg( $args, class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'options-general.php' ) );\n\n\t\treturn $url;\n\t}\n\t\n\tpublic static function get_akismet_user( $api_key ) {\n\t\t$akismet_user = false;\n\n\t\t$subscription_verification = Akismet::http_post( Akismet::build_query( array( 'key' => $api_key, 'blog' => get_option( 'home' ) ) ), 'get-subscription' );\n\n\t\tif ( ! empty( $subscription_verification[1] ) ) {\n\t\t\tif ( 'invalid' !== $subscription_verification[1] ) {\n\t\t\t\t$akismet_user = json_decode( $subscription_verification[1] );\n\t\t\t}\n\t\t}\n\n\t\treturn $akismet_user;\n\t}\n\t\n\tpublic static function get_stats( $api_key ) {\n\t\t$stat_totals = array();\n\n\t\tforeach( array( '6-months', 'all' ) as $interval ) {\n\t\t\t$response = Akismet::http_post( Akismet::build_query( array( 'blog' => get_option( 'home' ), 'key' => $api_key, 'from' => $interval ) ), 'get-stats' );\n\n\t\t\tif ( ! empty( $response[1] ) ) {\n\t\t\t\t$stat_totals[$interval] = json_decode( $response[1] );\n\t\t\t}\n\t\t}\n\n\t\treturn $stat_totals;\n\t}\n\t\n\tpublic static function verify_wpcom_key( $api_key, $user_id, $extra = array() ) {\n\t\t$akismet_account = Akismet::http_post( Akismet::build_query( array_merge( array(\n\t\t\t'user_id'          => $user_id,\n\t\t\t'api_key'          => $api_key,\n\t\t\t'get_account_type' => 'true'\n\t\t), $extra ) ), 'verify-wpcom-key' );\n\n\t\tif ( ! empty( $akismet_account[1] ) )\n\t\t\t$akismet_account = json_decode( $akismet_account[1] );\n\n\t\tAkismet::log( compact( 'akismet_account' ) );\n\t\t\n\t\treturn $akismet_account;\n\t}\n\t\n\tpublic static function connect_jetpack_user() {\n\t\n\t\tif ( $jetpack_user = self::get_jetpack_user() ) {\n\t\t\tif ( isset( $jetpack_user['user_id'] ) && isset(  $jetpack_user['api_key'] ) ) {\n\t\t\t\t$akismet_user = self::verify_wpcom_key( $jetpack_user['api_key'], $jetpack_user['user_id'], array( 'action' => 'connect_jetpack_user' ) );\n\t\t\t\t\t\t\t\n\t\t\t\tif ( is_object( $akismet_user ) ) {\n\t\t\t\t\tself::save_key( $akismet_user->api_key );\n\t\t\t\t\treturn in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}\n\n\tpublic static function display_alert() {\n\t\tAkismet::view( 'notice', array(\n\t\t\t'type' => 'alert',\n\t\t\t'code' => (int) get_option( 'akismet_alert_code' ),\n\t\t\t'msg'  => get_option( 'akismet_alert_msg' )\n\t\t) );\n\t}\n\n\tpublic static function display_spam_check_warning() {\n\t\tAkismet::fix_scheduled_recheck();\n\n\t\tif ( wp_next_scheduled('akismet_schedule_cron_recheck') > time() && self::are_any_comments_waiting_to_be_checked() ) {\n\t\t\t$link_text = apply_filters( 'akismet_spam_check_warning_link_text', sprintf( __( 'Please check your <a href=\"%s\">Akismet configuration</a> and contact your web host if problems persist.', 'akismet'), esc_url( self::get_page_url() ) ) );\n\t\t\tAkismet::view( 'notice', array( 'type' => 'spam-check', 'link_text' => $link_text ) );\n\t\t}\n\t}\n\n\tpublic static function display_api_key_warning() {\n\t\tAkismet::view( 'notice', array( 'type' => 'plugin' ) );\n\t}\n\n\tpublic static function display_page() {\n\t\tif ( !Akismet::get_api_key() || ( isset( $_GET['view'] ) && $_GET['view'] == 'start' ) )\n\t\t\tself::display_start_page();\n\t\telseif ( isset( $_GET['view'] ) && $_GET['view'] == 'stats' )\n\t\t\tself::display_stats_page();\n\t\telse\n\t\t\tself::display_configuration_page();\n\t}\n\n\tpublic static function display_start_page() {\n\t\tif ( isset( $_GET['action'] ) ) {\n\t\t\tif ( $_GET['action'] == 'delete-key' ) {\n\t\t\t\tif ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], self::NONCE ) )\n\t\t\t\t\tdelete_option( 'wordpress_api_key' );\n\t\t\t}\n\t\t}\n\n\t\tif ( $api_key = Akismet::get_api_key() && ( empty( self::$notices['status'] ) || 'existing-key-invalid' != self::$notices['status'] ) ) {\n\t\t\tself::display_configuration_page();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//the user can choose to auto connect their API key by clicking a button on the akismet done page\n\t\t//if jetpack, get verified api key by using connected wpcom user id\n\t\t//if no jetpack, get verified api key by using an akismet token\t\n\t\t\n\t\t$akismet_user = false;\n\t\t\n\t\tif ( isset( $_GET['token'] ) && preg_match('/^(\\d+)-[0-9a-f]{20}$/', $_GET['token'] ) )\n\t\t\t$akismet_user = self::verify_wpcom_key( '', '', array( 'token' => $_GET['token'] ) );\n\t\telseif ( $jetpack_user = self::get_jetpack_user() )\n\t\t\t$akismet_user = self::verify_wpcom_key( $jetpack_user['api_key'], $jetpack_user['user_id'] );\n\t\t\t\n\t\tif ( isset( $_GET['action'] ) ) {\n\t\t\tif ( $_GET['action'] == 'save-key' ) {\n\t\t\t\tif ( is_object( $akismet_user ) ) {\n\t\t\t\t\tself::save_key( $akismet_user->api_key );\n\t\t\t\t\tself::display_configuration_page();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tAkismet::view( 'start', compact( 'akismet_user' ) );\n\n\t\t/*\n\t\t// To see all variants when testing.\n\t\t$akismet_user->status = 'no-sub';\n\t\tAkismet::view( 'start', compact( 'akismet_user' ) );\n\t\t$akismet_user->status = 'cancelled';\n\t\tAkismet::view( 'start', compact( 'akismet_user' ) );\n\t\t$akismet_user->status = 'suspended';\n\t\tAkismet::view( 'start', compact( 'akismet_user' ) );\n\t\t$akismet_user->status = 'other';\n\t\tAkismet::view( 'start', compact( 'akismet_user' ) );\n\t\t$akismet_user = false;\n\t\t*/\n\t}\n\n\tpublic static function display_stats_page() {\n\t\tAkismet::view( 'stats' );\n\t}\n\n\tpublic static function display_configuration_page() {\n\t\t$api_key      = Akismet::get_api_key();\n\t\t$akismet_user = self::get_akismet_user( $api_key );\n\t\t\n\t\tif ( ! $akismet_user ) {\n\t\t\t// This could happen if the user's key became invalid after it was previously valid and successfully set up.\n\t\t\tself::$notices['status'] = 'existing-key-invalid';\n\t\t\tself::display_start_page();\n\t\t\treturn;\n\t\t}\n\n\t\t$stat_totals  = self::get_stats( $api_key );\n\n\t\t// If unset, create the new strictness option using the old discard option to determine its default.\n\t\t// If the old option wasn't set, default to discarding the blatant spam.\n\t\tif ( get_option( 'akismet_strictness' ) === false ) {\n\t\t\tadd_option( 'akismet_strictness', ( get_option( 'akismet_discard_month' ) === 'false' ? '0' : '1' ) );\n\t\t}\n\t\t\n\t\t// Sync the local \"Total spam blocked\" count with the authoritative count from the server.\n\t\tif ( isset( $stat_totals['all'], $stat_totals['all']->spam ) ) {\n\t\t\tupdate_option( 'akismet_spam_count', $stat_totals['all']->spam );\n\t\t}\n\n\t\t$notices = array();\n\n\t\tif ( empty( self::$notices ) ) {\n\t\t\tif ( ! empty( $stat_totals['all'] ) && isset( $stat_totals['all']->time_saved ) && $akismet_user->status == 'active' && $akismet_user->account_type == 'free-api-key' ) {\n\n\t\t\t\t$time_saved = false;\n\n\t\t\t\tif ( $stat_totals['all']->time_saved > 1800 ) {\n\t\t\t\t\t$total_in_minutes = round( $stat_totals['all']->time_saved / 60 );\n\t\t\t\t\t$total_in_hours   = round( $total_in_minutes / 60 );\n\t\t\t\t\t$total_in_days    = round( $total_in_hours / 8 );\n\t\t\t\t\t$cleaning_up      = __( 'Cleaning up spam takes time.' , 'akismet');\n\n\t\t\t\t\tif ( $total_in_days > 1 )\n\t\t\t\t\t\t$time_saved = $cleaning_up . ' ' . sprintf( _n( 'Akismet has saved you %s day!', 'Akismet has saved you %s days!', $total_in_days, 'akismet' ), number_format_i18n( $total_in_days ) );\n\t\t\t\t\telseif ( $total_in_hours > 1 )\n\t\t\t\t\t\t$time_saved = $cleaning_up . ' ' . sprintf( _n( 'Akismet has saved you %d hour!', 'Akismet has saved you %d hours!', $total_in_hours, 'akismet' ), $total_in_hours );\n\t\t\t\t\telseif ( $total_in_minutes >= 30 )\n\t\t\t\t\t\t$time_saved = $cleaning_up . ' ' . sprintf( _n( 'Akismet has saved you %d minute!', 'Akismet has saved you %d minutes!', $total_in_minutes, 'akismet' ), $total_in_minutes );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$notices[] =  array( 'type' => 'active-notice', 'time_saved' => $time_saved );\n\t\t\t}\n\t\t\t\n\t\t\tif ( !empty( $akismet_user->limit_reached ) && in_array( $akismet_user->limit_reached, array( 'yellow', 'red' ) ) ) {\n\t\t\t\t$notices[] = array( 'type' => 'limit-reached', 'level' => $akismet_user->limit_reached );\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( !isset( self::$notices['status'] ) && in_array( $akismet_user->status, array( 'cancelled', 'suspended', 'missing', 'no-sub' ) ) ) {\n\t\t\t$notices[] = array( 'type' => $akismet_user->status );\n\t\t}\n\n\t\t/*\n\t\t// To see all variants when testing.\n\t\t$notices[] = array( 'type' => 'active-notice', 'time_saved' => 'Cleaning up spam takes time. Akismet has saved you 1 minute!' );\n\t\t$notices[] = array( 'type' => 'plugin' );\n\t\t$notices[] = array( 'type' => 'spam-check', 'link_text' => 'Link text.' );\n\t\t$notices[] = array( 'type' => 'notice', 'notice_header' => 'This is the notice header.', 'notice_text' => 'This is the notice text.' );\n\t\t$notices[] = array( 'type' => 'missing-functions' );\n\t\t$notices[] = array( 'type' => 'servers-be-down' );\n\t\t$notices[] = array( 'type' => 'active-dunning' );\n\t\t$notices[] = array( 'type' => 'cancelled' );\n\t\t$notices[] = array( 'type' => 'suspended' );\n\t\t$notices[] = array( 'type' => 'missing' );\n\t\t$notices[] = array( 'type' => 'no-sub' );\n\t\t$notices[] = array( 'type' => 'new-key-valid' );\n\t\t$notices[] = array( 'type' => 'new-key-invalid' );\n\t\t$notices[] = array( 'type' => 'existing-key-invalid' );\n\t\t$notices[] = array( 'type' => 'new-key-failed' );\n\t\t$notices[] = array( 'type' => 'limit-reached', 'level' => 'yellow' );\n\t\t$notices[] = array( 'type' => 'limit-reached', 'level' => 'red' );\n\t\t*/\n\t\t\n\t\tAkismet::log( compact( 'stat_totals', 'akismet_user' ) );\n\t\tAkismet::view( 'config', compact( 'api_key', 'akismet_user', 'stat_totals', 'notices' ) );\n\t}\n\n\tpublic static function display_notice() {\n\t\tglobal $hook_suffix;\n\n\t\tif ( in_array( $hook_suffix, array( 'jetpack_page_akismet-key-config', 'settings_page_akismet-key-config' ) ) ) {\n\t\t\t// This page manages the notices and puts them inline where they make sense.\n\t\t\treturn;\n\t\t}\n\n\t\tif ( in_array( $hook_suffix, array( 'edit-comments.php' ) ) && (int) get_option( 'akismet_alert_code' ) > 0 ) {\n\t\t\tAkismet::verify_key( Akismet::get_api_key() ); //verify that the key is still in alert state\n\t\t\t\n\t\t\tif ( get_option( 'akismet_alert_code' ) > 0 )\n\t\t\t\tself::display_alert();\n\t\t}\n\t\telseif ( ( 'plugins.php' === $hook_suffix || 'edit-comments.php' === $hook_suffix ) && ! Akismet::get_api_key() ) {\n\t\t\t// Show the \"Set Up Akismet\" banner on the comments and plugin pages if no API key has been set.\n\t\t\tself::display_api_key_warning();\n\t\t}\n\t\telseif ( $hook_suffix == 'edit-comments.php' && wp_next_scheduled( 'akismet_schedule_cron_recheck' ) ) {\n\t\t\tself::display_spam_check_warning();\n\t\t}\n\t\t\n\t\tif ( isset( $_GET['akismet_recheck_complete'] ) ) {\n\t\t\t$recheck_count = (int) $_GET['recheck_count'];\n\t\t\t$spam_count = (int) $_GET['spam_count'];\n\t\t\t\n\t\t\tif ( $recheck_count === 0 ) {\n\t\t\t\t$message = __( 'There were no comments to check. Akismet will only check comments awaiting moderation.', 'akismet' );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$message = sprintf( _n( 'Akismet checked %s comment.', 'Akismet checked %s comments.', $recheck_count, 'akismet' ), number_format( $recheck_count ) );\n\t\t\t\t$message .= ' ';\n\t\t\t\n\t\t\t\tif ( $spam_count === 0 ) {\n\t\t\t\t\t$message .= __( 'No comments were caught as spam.', 'akismet' );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$message .= sprintf( _n( '%s comment was caught as spam.', '%s comments were caught as spam.', $spam_count, 'akismet' ), number_format( $spam_count ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\techo '<div class=\"notice notice-success\"><p>' . esc_html( $message ) . '</p></div>';\n\t\t}\n\t\telse if ( isset( $_GET['akismet_recheck_error'] ) ) {\n\t\t\techo '<div class=\"notice notice-error\"><p>' . esc_html( __( 'Akismet could not recheck your comments for spam.', 'akismet' ) ) . '</p></div>';\n\t\t}\n\t}\n\n\tpublic static function display_status() {\n\t\tif ( ! self::get_server_connectivity() ) {\n\t\t\tAkismet::view( 'notice', array( 'type' => 'servers-be-down' ) );\n\t\t}\n\t\telse if ( ! empty( self::$notices ) ) {\n\t\t\tforeach ( self::$notices as $index => $type ) {\n\t\t\t\tif ( is_object( $type ) ) {\n\t\t\t\t\t$notice_header = $notice_text = '';\n\t\t\t\t\t\n\t\t\t\t\tif ( property_exists( $type, 'notice_header' ) ) {\n\t\t\t\t\t\t$notice_header = wp_kses( $type->notice_header, self::$allowed );\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif ( property_exists( $type, 'notice_text' ) ) {\n\t\t\t\t\t\t$notice_text = wp_kses( $type->notice_text, self::$allowed );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ( property_exists( $type, 'status' ) ) {\n\t\t\t\t\t\t$type = wp_kses( $type->status, self::$allowed );\n\t\t\t\t\t\tAkismet::view( 'notice', compact( 'type', 'notice_header', 'notice_text' ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\tunset( self::$notices[ $index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tAkismet::view( 'notice', compact( 'type' ) );\n\t\t\t\t\t\n\t\t\t\t\tunset( self::$notices[ $index ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static function get_jetpack_user() {\n\t\tif ( !class_exists('Jetpack') )\n\t\t\treturn false;\n\n\t\tif ( defined( 'JETPACK__VERSION' ) && version_compare( JETPACK__VERSION, '7.7', '<' )  ) {\n\t\t\t// For version of Jetpack prior to 7.7.\n\t\t\tJetpack::load_xml_rpc_client();\n\t\t}\n\n\t\t$xml = new Jetpack_IXR_ClientMulticall( array( 'user_id' => get_current_user_id() ) );\n\n\t\t$xml->addCall( 'wpcom.getUserID' );\n\t\t$xml->addCall( 'akismet.getAPIKey' );\n\t\t$xml->query();\n\n\t\tAkismet::log( compact( 'xml' ) );\n\n\t\tif ( !$xml->isError() ) {\n\t\t\t$responses = $xml->getResponse();\n\t\t\tif ( count( $responses ) > 1 ) {\n\t\t\t\t// Due to a quirk in how Jetpack does multi-calls, the response order\n\t\t\t\t// can't be trusted to match the call order. It's a good thing our\n\t\t\t\t// return values can be mostly differentiated from each other.\n\t\t\t\t$first_response_value = array_shift( $responses[0] );\n\t\t\t\t$second_response_value = array_shift( $responses[1] );\n\t\t\t\t\n\t\t\t\t// If WPCOM ever reaches 100 billion users, this will fail. :-)\n\t\t\t\tif ( preg_match( '/^[a-f0-9]{12}$/i', $first_response_value ) ) {\n\t\t\t\t\t$api_key = $first_response_value;\n\t\t\t\t\t$user_id = (int) $second_response_value;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$api_key = $second_response_value;\n\t\t\t\t\t$user_id = (int) $first_response_value;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn compact( 'api_key', 'user_id' );\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\t\n\t/**\n\t * Some commentmeta isn't useful in an export file. Suppress it (when supported).\n\t *\n\t * @param bool $exclude\n\t * @param string $key The meta key\n\t * @param object $meta The meta object\n\t * @return bool Whether to exclude this meta entry from the export.\n\t */\n\tpublic static function exclude_commentmeta_from_export( $exclude, $key, $meta ) {\n\t\tif ( in_array( $key, array( 'akismet_as_submitted', 'akismet_rechecking', 'akismet_delayed_moderation_email' ) ) ) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn $exclude;\n\t}\n\t\n\t/**\n\t * When Akismet is active, remove the \"Activate Akismet\" step from the plugin description.\n\t */\n\tpublic static function modify_plugin_description( $all_plugins ) {\n\t\tif ( isset( $all_plugins['akismet/akismet.php'] ) ) {\n\t\t\tif ( Akismet::get_api_key() ) {\n\t\t\t\t$all_plugins['akismet/akismet.php']['Description'] = __( 'Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. Your site is fully configured and being protected, even while you sleep.', 'akismet' );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$all_plugins['akismet/akismet.php']['Description'] = __( 'Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. It keeps your site protected even while you sleep. To get started, just go to <a href=\"admin.php?page=akismet-key-config\">your Akismet Settings page</a> to set up your API key.', 'akismet' );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $all_plugins;\n\t}\n\n\tprivate static function set_form_privacy_notice_option( $state ) {\n\t\tif ( in_array( $state, array( 'display', 'hide' ) ) ) {\n\t\t\tupdate_option( 'akismet_comment_form_privacy_notice', $state );\n\t\t}\n\t}\n\t\n\tpublic static function register_personal_data_eraser( $erasers ) {\n\t\t$erasers['akismet'] = array(\n\t\t\t'eraser_friendly_name' => __( 'Akismet', 'akismet' ),\n\t\t\t'callback' => array( 'Akismet_Admin', 'erase_personal_data' ),\n\t\t);\n\n\t\treturn $erasers;\n\t}\n\t\n\t/**\n\t * When a user requests that their personal data be removed, Akismet has a duty to discard\n\t * any personal data we store outside of the comment itself. Right now, that is limited\n\t * to the copy of the comment we store in the akismet_as_submitted commentmeta.\n\t *\n\t * FWIW, this information would be automatically deleted after 15 days.\n\t * \n\t * @param $email_address string The email address of the user who has requested erasure.\n\t * @param $page int This function can (and will) be called multiple times to prevent timeouts,\n\t *                  so this argument is used for pagination.\n\t * @return array\n\t * @see https://developer.wordpress.org/plugins/privacy/adding-the-personal-data-eraser-to-your-plugin/\n\t */\n\tpublic static function erase_personal_data( $email_address, $page = 1 ) {\n\t\t$items_removed = false;\n\t\t\n\t\t$number = 50;\n\t\t$page = (int) $page;\n\n\t\t$comments = get_comments(\n\t\t\tarray(\n\t\t\t\t'author_email' => $email_address,\n\t\t\t\t'number'       => $number,\n\t\t\t\t'paged'        => $page,\n\t\t\t\t'order_by'     => 'comment_ID',\n\t\t\t\t'order'        => 'ASC',\n\t\t\t)\n\t\t);\n\n\t\tforeach ( (array) $comments as $comment ) {\n\t\t\t$comment_as_submitted = get_comment_meta( $comment->comment_ID, 'akismet_as_submitted', true );\n\t\t\t\n\t\t\tif ( $comment_as_submitted ) {\n\t\t\t\tdelete_comment_meta( $comment->comment_ID, 'akismet_as_submitted' );\n\t\t\t\t$items_removed = true;\n\t\t\t}\n\t\t}\n\n\t\t// Tell core if we have more comments to work on still\n\t\t$done = count( $comments ) < $number;\n\t\t\n\t\treturn array(\n\t\t\t'items_removed' => $items_removed,\n\t\t\t'items_retained' => false, // always false in this example\n\t\t\t'messages' => array(), // no messages in this example\n\t\t\t'done' => $done,\n\t\t);\n\t}\n}\n", "num_lines": 1268}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nWP_CLI::add_command( 'akismet', 'Akismet_CLI' );\n\n/**\n * Filter spam comments.\n */\nclass Akismet_CLI extends WP_CLI_Command {\n\t/**\n\t * Checks one or more comments against the Akismet API.\n\t *\n\t * ## OPTIONS\n\t * <comment_id>...\n\t * : The ID(s) of the comment(s) to check.\n\t *\n\t * [--noaction]\n\t * : Don't change the status of the comment. Just report what Akismet thinks it is.\n\t *\n\t * ## EXAMPLES\n\t *\n\t *     wp akismet check 12345\n\t *\n\t * @alias comment-check\n\t */\n\tpublic function check( $args, $assoc_args ) {\n\t\tforeach ( $args as $comment_id ) {\n\t\t\tif ( isset( $assoc_args['noaction'] ) ) {\n\t\t\t\t// Check the comment, but don't reclassify it.\n\t\t\t\t$api_response = Akismet::check_db_comment( $comment_id, 'wp-cli' );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$api_response = Akismet::recheck_comment( $comment_id, 'wp-cli' );\n\t\t\t}\n\t\t\t\n\t\t\tif ( 'true' === $api_response ) {\n\t\t\t\tWP_CLI::line( sprintf( __( \"Comment #%d is spam.\", 'akismet' ), $comment_id ) );\n\t\t\t}\n\t\t\telse if ( 'false' === $api_response ) {\n\t\t\t\tWP_CLI::line( sprintf( __( \"Comment #%d is not spam.\", 'akismet' ), $comment_id ) );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ( false === $api_response ) {\n\t\t\t\t\tWP_CLI::error( __( \"Failed to connect to Akismet.\", 'akismet' ) );\n\t\t\t\t}\n\t\t\t\telse if ( is_wp_error( $api_response ) ) {\n\t\t\t\t\tWP_CLI::warning( sprintf( __( \"Comment #%d could not be checked.\", 'akismet' ), $comment_id ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t/**\n\t * Recheck all comments in the Pending queue.\n\t *\n\t * ## EXAMPLES\n\t *\n\t *     wp akismet recheck_queue\n\t *\n\t * @alias recheck-queue\n\t */\n\tpublic function recheck_queue() {\n\t\t$batch_size = 100;\n\t\t$start = 0;\n\t\t\n\t\t$total_counts = array();\n\t\t\n\t\tdo {\n\t\t\t$result_counts = Akismet_Admin::recheck_queue_portion( $start, $batch_size );\n\t\t\t\n\t\t\tif ( $result_counts['processed'] > 0 ) {\n\t\t\t\tforeach ( $result_counts as $key => $count ) {\n\t\t\t\t\tif ( ! isset( $total_counts[ $key ] ) ) {\n\t\t\t\t\t\t$total_counts[ $key ] = $count;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$total_counts[ $key ] += $count;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$start += $batch_size;\n\t\t\t\t$start -= $result_counts['spam']; // These comments will have been removed from the queue.\n\t\t\t}\n\t\t} while ( $result_counts['processed'] > 0 );\n\t\t\n\t\tWP_CLI::line( sprintf( _n( \"Processed %d comment.\", \"Processed %d comments.\", $total_counts['processed'], 'akismet' ), number_format( $total_counts['processed'] ) ) );\n\t\tWP_CLI::line( sprintf( _n( \"%d comment moved to Spam.\", \"%d comments moved to Spam.\", $total_counts['spam'], 'akismet' ), number_format( $total_counts['spam'] ) ) );\n\t\t\n\t\tif ( $total_counts['error'] ) {\n\t\t\tWP_CLI::line( sprintf( _n( \"%d comment could not be checked.\", \"%d comments could not be checked.\", $total_counts['error'], 'akismet' ), number_format( $total_counts['error'] ) ) );\n\t\t}\n\t}\n\t\n\t/**\n\t * Fetches stats from the Akismet API.\n\t *\n\t * ## OPTIONS\n\t *\n\t * [<interval>]\n\t * : The time period for which to retrieve stats.\n\t * ---\n\t * default: all\n\t * options:\n\t *  - days\n\t *  - months\n\t *  - all\n\t * ---\n\t *\n\t * [--format=<format>]\n\t * : Allows overriding the output of the command when listing connections.\n\t * ---\n\t * default: table\n\t * options:\n\t *  - table\n\t *  - json\n\t *  - csv\n\t *  - yaml\n\t *  - count\n\t * ---\n\t *\n\t * [--summary]\n\t * : When set, will display a summary of the stats.\n\t *\n\t * ## EXAMPLES\n\t *\n\t * wp akismet stats\n\t * wp akismet stats all\n\t * wp akismet stats days\n\t * wp akismet stats months\n\t * wp akismet stats all --summary\n\t */\n\tpublic function stats( $args, $assoc_args ) {\n\t\t$api_key = Akismet::get_api_key();\n \n\t\tif ( empty( $api_key ) ) {\n\t\t\tWP_CLI::error( __( 'API key must be set to fetch stats.', 'akismet' ) );\n\t\t}\n \n\t\tswitch ( $args[0] ) {\n\t\t\tcase 'days':\n\t\t\t\t$interval = '60-days';\n\t\t\t\tbreak;\n\t\t\tcase 'months':\n\t\t\t\t$interval = '6-months';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$interval = 'all';\n\t\t\t\tbreak;\n\t\t}\n \n\t\t$response = Akismet::http_post(\n\t\t\tAkismet::build_query( array(\n\t\t\t\t'blog' => get_option( 'home' ),\n\t\t\t\t'key'  => $api_key,\n\t\t\t\t'from' => $interval,\n\t\t\t) ),\n\t\t\t'get-stats'\n\t\t);\n \n\t\tif ( empty( $response[1] ) ) {\n\t\t\tWP_CLI::error( __( 'Currently unable to fetch stats. Please try again.', 'akismet' ) );\n\t\t}\n \n\t\t$response_body = json_decode( $response[1], true );\n\t\t\n\t\tif ( is_null( $response_body ) ) {\n\t\t\tWP_CLI::error( __( 'Stats response could not be decoded.', 'akismet' ) );\n\t\t}\n \n\t\tif ( isset( $assoc_args['summary'] ) ) {\n\t\t\t$keys = array(\n\t\t\t\t'spam',\n\t\t\t\t'ham',\n\t\t\t\t'missed_spam',\n\t\t\t\t'false_positives',\n\t\t\t\t'accuracy',\n\t\t\t\t'time_saved',\n\t\t\t);\n \n\t\t\tWP_CLI\\Utils\\format_items( $assoc_args['format'], array( $response_body ), $keys );\n\t\t}\n\t\telse {\n\t\t\t$stats = $response_body['breakdown'];\n\t\t\tWP_CLI\\Utils\\format_items( $assoc_args['format'], $stats, array_keys( end( $stats ) ) );\n\t\t}\n\t}\n}", "num_lines": 185}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nclass Akismet_REST_API {\n\t/**\n\t * Register the REST API routes.\n\t */\n\tpublic static function init() {\n\t\tif ( ! function_exists( 'register_rest_route' ) ) {\n\t\t\t// The REST API wasn't integrated into core until 4.4, and we support 4.0+ (for now).\n\t\t\treturn false;\n\t\t}\n\n\t\tregister_rest_route( 'akismet/v1', '/key', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),\n\t\t\t\t'callback' => array( 'Akismet_REST_API', 'get_key' ),\n\t\t\t), array(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),\n\t\t\t\t'callback' => array( 'Akismet_REST_API', 'set_key' ),\n\t\t\t\t'args' => array(\n\t\t\t\t\t'key' => array(\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),\n\t\t\t\t\t\t'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t), array(\n\t\t\t\t'methods' => WP_REST_Server::DELETABLE,\n\t\t\t\t'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),\n\t\t\t\t'callback' => array( 'Akismet_REST_API', 'delete_key' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( 'akismet/v1', '/settings/', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),\n\t\t\t\t'callback' => array( 'Akismet_REST_API', 'get_settings' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),\n\t\t\t\t'callback' => array( 'Akismet_REST_API', 'set_boolean_settings' ),\n\t\t\t\t'args' => array(\n\t\t\t\t\t'akismet_strictness' => array(\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t'description' => __( 'If true, Akismet will automatically discard the worst spam automatically rather than putting it in the spam folder.', 'akismet' ),\n\t\t\t\t\t),\n\t\t\t\t\t'akismet_show_user_comments_approved' => array(\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t'description' => __( 'If true, show the number of approved comments beside each comment author in the comments list page.', 'akismet' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( 'akismet/v1', '/stats', array(\n\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),\n\t\t\t'callback' => array( 'Akismet_REST_API', 'get_stats' ),\n\t\t\t'args' => array(\n\t\t\t\t'interval' => array(\n\t\t\t\t\t'required' => false,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_interval' ),\n\t\t\t\t\t'description' => __( 'The time period for which to retrieve stats. Options: 60-days, 6-months, all', 'akismet' ),\n\t\t\t\t\t'default' => 'all',\n\t\t\t\t),\n\t\t\t),\n\t\t) );\n\n\t\tregister_rest_route( 'akismet/v1', '/stats/(?P<interval>[\\w+])', array(\n\t\t\t'args' => array(\n\t\t\t\t'interval' => array(\n\t\t\t\t\t'description' => __( 'The time period for which to retrieve stats. Options: 60-days, 6-months, all', 'akismet' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),\n\t\t\t\t'callback' => array( 'Akismet_REST_API', 'get_stats' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( 'akismet/v1', '/alert', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'permission_callback' => array( 'Akismet_REST_API', 'remote_call_permission_callback' ),\n\t\t\t\t'callback' => array( 'Akismet_REST_API', 'get_alert' ),\n\t\t\t\t'args' => array(\n\t\t\t\t\t'key' => array(\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),\n\t\t\t\t\t\t'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'permission_callback' => array( 'Akismet_REST_API', 'remote_call_permission_callback' ),\n\t\t\t\t'callback' => array( 'Akismet_REST_API', 'set_alert' ),\n\t\t\t\t'args' => array(\n\t\t\t\t\t'key' => array(\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),\n\t\t\t\t\t\t'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::DELETABLE,\n\t\t\t\t'permission_callback' => array( 'Akismet_REST_API', 'remote_call_permission_callback' ),\n\t\t\t\t'callback' => array( 'Akismet_REST_API', 'delete_alert' ),\n\t\t\t\t'args' => array(\n\t\t\t\t\t'key' => array(\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),\n\t\t\t\t\t\t'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t) );\n\t}\n\n\t/**\n\t * Get the current Akismet API key.\n\t *\n\t * @param WP_REST_Request $request\n\t * @return WP_Error|WP_REST_Response\n\t */\n\tpublic static function get_key( $request = null ) {\n\t\treturn rest_ensure_response( Akismet::get_api_key() );\n\t}\n\n\t/**\n\t * Set the API key, if possible.\n\t *\n\t * @param WP_REST_Request $request\n\t * @return WP_Error|WP_REST_Response\n\t */\n\tpublic static function set_key( $request ) {\n\t\tif ( defined( 'WPCOM_API_KEY' ) ) {\n\t\t\treturn rest_ensure_response( new WP_Error( 'hardcoded_key', __( 'This site\\'s API key is hardcoded and cannot be changed via the API.', 'akismet' ), array( 'status'=> 409 ) ) );\n\t\t}\n\n\t\t$new_api_key = $request->get_param( 'key' );\n\n\t\tif ( ! self::key_is_valid( $new_api_key ) ) {\n\t\t\treturn rest_ensure_response( new WP_Error( 'invalid_key', __( 'The value provided is not a valid and registered API key.', 'akismet' ), array( 'status' => 400 ) ) );\n\t\t}\n\n\t\tupdate_option( 'wordpress_api_key', $new_api_key );\n\n\t\treturn self::get_key();\n\t}\n\n\t/**\n\t * Unset the API key, if possible.\n\t *\n\t * @param WP_REST_Request $request\n\t * @return WP_Error|WP_REST_Response\n\t */\n\tpublic static function delete_key( $request ) {\n\t\tif ( defined( 'WPCOM_API_KEY' ) ) {\n\t\t\treturn rest_ensure_response( new WP_Error( 'hardcoded_key', __( 'This site\\'s API key is hardcoded and cannot be deleted.', 'akismet' ), array( 'status'=> 409 ) ) );\n\t\t}\n\n\t\tdelete_option( 'wordpress_api_key' );\n\n\t\treturn rest_ensure_response( true );\n\t}\n\n\t/**\n\t * Get the Akismet settings.\n\t *\n\t * @param WP_REST_Request $request\n\t * @return WP_Error|WP_REST_Response\n\t */\n\tpublic static function get_settings( $request = null ) {\n\t\treturn rest_ensure_response( array(\n\t\t\t'akismet_strictness' => ( get_option( 'akismet_strictness', '1' ) === '1' ),\n\t\t\t'akismet_show_user_comments_approved' => ( get_option( 'akismet_show_user_comments_approved', '1' ) === '1' ),\n\t\t) );\n\t}\n\n\t/**\n\t * Update the Akismet settings.\n\t *\n\t * @param WP_REST_Request $request\n\t * @return WP_Error|WP_REST_Response\n\t */\n\tpublic static function set_boolean_settings( $request ) {\n\t\tforeach ( array(\n\t\t\t'akismet_strictness',\n\t\t\t'akismet_show_user_comments_approved',\n\t\t) as $setting_key ) {\n\n\t\t\t$setting_value = $request->get_param( $setting_key );\n\t\t\tif ( is_null( $setting_value ) ) {\n\t\t\t\t// This setting was not specified.\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// From 4.7+, WP core will ensure that these are always boolean\n\t\t\t// values because they are registered with 'type' => 'boolean',\n\t\t\t// but we need to do this ourselves for prior versions.\n\t\t\t$setting_value = Akismet_REST_API::parse_boolean( $setting_value );\n\n\t\t\tupdate_option( $setting_key, $setting_value ? '1' : '0' );\n\t\t}\n\n\t\treturn self::get_settings();\n\t}\n\n\t/**\n\t * Parse a numeric or string boolean value into a boolean.\n\t *\n\t * @param mixed $value The value to convert into a boolean.\n\t * @return bool The converted value.\n\t */\n\tpublic static function parse_boolean( $value ) {\n\t\tswitch ( $value ) {\n\t\t\tcase true:\n\t\t\tcase 'true':\n\t\t\tcase '1':\n\t\t\tcase 1:\n\t\t\t\treturn true;\n\n\t\t\tcase false:\n\t\t\tcase 'false':\n\t\t\tcase '0':\n\t\t\tcase 0:\n\t\t\t\treturn false;\n\n\t\t\tdefault:\n\t\t\t\treturn (bool) $value;\n\t\t}\n\t}\n\n\t/**\n\t * Get the Akismet stats for a given time period.\n\t *\n\t * Possible `interval` values:\n\t * - all\n\t * - 60-days\n\t * - 6-months\n\t *\n\t * @param WP_REST_Request $request\n\t * @return WP_Error|WP_REST_Response\n\t */\n\tpublic static function get_stats( $request ) {\n\t\t$api_key = Akismet::get_api_key();\n\n\t\t$interval = $request->get_param( 'interval' );\n\n\t\t$stat_totals = array();\n\n\t\t$response = Akismet::http_post( Akismet::build_query( array( 'blog' => get_option( 'home' ), 'key' => $api_key, 'from' => $interval ) ), 'get-stats' );\n\n\t\tif ( ! empty( $response[1] ) ) {\n\t\t\t$stat_totals[$interval] = json_decode( $response[1] );\n\t\t}\n\n\t\treturn rest_ensure_response( $stat_totals );\n\t}\n\n\t/**\n\t * Get the current alert code and message. Alert codes are used to notify the site owner\n\t * if there's a problem, like a connection issue between their site and the Akismet API,\n\t * invalid requests being sent, etc.\n\t *\n\t * @param WP_REST_Request $request\n\t * @return WP_Error|WP_REST_Response\n\t */\n\tpublic static function get_alert( $request ) {\n\t\treturn rest_ensure_response( array(\n\t\t\t'code' => get_option( 'akismet_alert_code' ),\n\t\t\t'message' => get_option( 'akismet_alert_msg' ),\n\t\t) );\n\t}\n\n\t/**\n\t * Update the current alert code and message by triggering a call to the Akismet server.\n\t *\n\t * @param WP_REST_Request $request\n\t * @return WP_Error|WP_REST_Response\n\t */\n\tpublic static function set_alert( $request ) {\n\t\tdelete_option( 'akismet_alert_code' );\n\t\tdelete_option( 'akismet_alert_msg' );\n\n\t\t// Make a request so the most recent alert code and message are retrieved.\n\t\tAkismet::verify_key( Akismet::get_api_key() );\n\n\t\treturn self::get_alert( $request );\n\t}\n\n\t/**\n\t * Clear the current alert code and message.\n\t *\n\t * @param WP_REST_Request $request\n\t * @return WP_Error|WP_REST_Response\n\t */\n\tpublic static function delete_alert( $request ) {\n\t\tdelete_option( 'akismet_alert_code' );\n\t\tdelete_option( 'akismet_alert_msg' );\n\n\t\treturn self::get_alert( $request );\n\t}\n\n\tprivate static function key_is_valid( $key ) {\n\t\t$response = Akismet::http_post(\n\t\t\tAkismet::build_query(\n\t\t\t\tarray(\n\t\t\t\t\t'key' => $key,\n\t\t\t\t\t'blog' => get_option( 'home' )\n\t\t\t\t)\n\t\t\t),\n\t\t\t'verify-key'\n\t\t);\n\n\t\tif ( $response[1] == 'valid' ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic static function privileged_permission_callback() {\n\t\treturn current_user_can( 'manage_options' );\n\t}\n\n\t/**\n\t * For calls that Akismet.com makes to the site to clear outdated alert codes, use the API key for authorization.\n\t */\n\tpublic static function remote_call_permission_callback( $request ) {\n\t\t$local_key = Akismet::get_api_key();\n\n\t\treturn $local_key && ( strtolower( $request->get_param( 'key' ) ) === strtolower( $local_key ) );\n\t}\n\n\tpublic static function sanitize_interval( $interval, $request, $param ) {\n\t\t$interval = trim( $interval );\n\n\t\t$valid_intervals = array( '60-days', '6-months', 'all', );\n\n\t\tif ( ! in_array( $interval, $valid_intervals ) ) {\n\t\t\t$interval = 'all';\n\t\t}\n\n\t\treturn $interval;\n\t}\n\n\tpublic static function sanitize_key( $key, $request, $param ) {\n\t\treturn trim( $key );\n\t}\n}\n", "num_lines": 367}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * @package Akismet\n */\nclass Akismet_Widget extends WP_Widget {\n\n\tfunction __construct() {\n\t\tload_plugin_textdomain( 'akismet' );\n\t\t\n\t\tparent::__construct(\n\t\t\t'akismet_widget',\n\t\t\t__( 'Akismet Widget' , 'akismet'),\n\t\t\tarray( 'description' => __( 'Display the number of spam comments Akismet has caught' , 'akismet') )\n\t\t);\n\n\t\tif ( is_active_widget( false, false, $this->id_base ) ) {\n\t\t\tadd_action( 'wp_head', array( $this, 'css' ) );\n\t\t}\n\t}\n\n\tfunction css() {\n?>\n\n<style type=\"text/css\">\n.a-stats {\n\twidth: auto;\n}\n.a-stats a {\n\tbackground: #7CA821;\n\tbackground-image:-moz-linear-gradient(0% 100% 90deg,#5F8E14,#7CA821);\n\tbackground-image:-webkit-gradient(linear,0% 0,0% 100%,from(#7CA821),to(#5F8E14));\n\tborder: 1px solid #5F8E14;\n\tborder-radius:3px;\n\tcolor: #CFEA93;\n\tcursor: pointer;\n\tdisplay: block;\n\tfont-weight: normal;\n\theight: 100%;\n\t-moz-border-radius:3px;\n\tpadding: 7px 0 8px;\n\ttext-align: center;\n\ttext-decoration: none;\n\t-webkit-border-radius:3px;\n\twidth: 100%;\n}\n.a-stats a:hover {\n\ttext-decoration: none;\n\tbackground-image:-moz-linear-gradient(0% 100% 90deg,#6F9C1B,#659417);\n\tbackground-image:-webkit-gradient(linear,0% 0,0% 100%,from(#659417),to(#6F9C1B));\n}\n.a-stats .count {\n\tcolor: #FFF;\n\tdisplay: block;\n\tfont-size: 15px;\n\tline-height: 16px;\n\tpadding: 0 13px;\n\twhite-space: nowrap;\n}\n</style>\n\n<?php\n\t}\n\n\tfunction form( $instance ) {\n\t\tif ( $instance && isset( $instance['title'] ) ) {\n\t\t\t$title = $instance['title'];\n\t\t}\n\t\telse {\n\t\t\t$title = __( 'Spam Blocked' , 'akismet' );\n\t\t}\n?>\n\n\t\t<p>\n\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php esc_html_e( 'Title:' , 'akismet'); ?></label>\n\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" />\n\t\t</p>\n\n<?php\n\t}\n\n\tfunction update( $new_instance, $old_instance ) {\n\t\t$instance['title'] = strip_tags( $new_instance['title'] );\n\t\treturn $instance;\n\t}\n\n\tfunction widget( $args, $instance ) {\n\t\t$count = get_option( 'akismet_spam_count' );\n\n\t\tif ( ! isset( $instance['title'] ) ) {\n\t\t\t$instance['title'] = __( 'Spam Blocked' , 'akismet' );\n\t\t}\n\n\t\techo $args['before_widget'];\n\t\tif ( ! empty( $instance['title'] ) ) {\n\t\t\techo $args['before_title'];\n\t\t\techo esc_html( $instance['title'] );\n\t\t\techo $args['after_title'];\n\t\t}\n?>\n\n\t<div class=\"a-stats\">\n\t\t<a href=\"https://akismet.com\" target=\"_blank\" title=\"\"><?php printf( _n( '<strong class=\"count\">%1$s spam</strong> blocked by <strong>Akismet</strong>', '<strong class=\"count\">%1$s spam</strong> blocked by <strong>Akismet</strong>', $count , 'akismet'), number_format_i18n( $count ) ); ?></a>\n\t</div>\n\n<?php\n\t\techo $args['after_widget'];\n\t}\n}\n\nfunction akismet_register_widgets() {\n\tregister_widget( 'Akismet_Widget' );\n}\n\nadd_action( 'widgets_init', 'akismet_register_widgets' );\n", "num_lines": 115}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nclass Akismet {\n\tconst API_HOST = 'rest.akismet.com';\n\tconst API_PORT = 80;\n\tconst MAX_DELAY_BEFORE_MODERATION_EMAIL = 86400; // One day in seconds\n\n\tprivate static $last_comment = '';\n\tprivate static $initiated = false;\n\tprivate static $prevent_moderation_email_for_these_comments = array();\n\tprivate static $last_comment_result = null;\n\tprivate static $comment_as_submitted_allowed_keys = array( 'blog' => '', 'blog_charset' => '', 'blog_lang' => '', 'blog_ua' => '', 'comment_agent' => '', 'comment_author' => '', 'comment_author_IP' => '', 'comment_author_email' => '', 'comment_author_url' => '', 'comment_content' => '', 'comment_date_gmt' => '', 'comment_tags' => '', 'comment_type' => '', 'guid' => '', 'is_test' => '', 'permalink' => '', 'reporter' => '', 'site_domain' => '', 'submit_referer' => '', 'submit_uri' => '', 'user_ID' => '', 'user_agent' => '', 'user_id' => '', 'user_ip' => '' );\n\tprivate static $is_rest_api_call = false;\n\t\n\tpublic static function init() {\n\t\tif ( ! self::$initiated ) {\n\t\t\tself::init_hooks();\n\t\t}\n\t}\n\n\t/**\n\t * Initializes WordPress hooks\n\t */\n\tprivate static function init_hooks() {\n\t\tself::$initiated = true;\n\n\t\tadd_action( 'wp_insert_comment', array( 'Akismet', 'auto_check_update_meta' ), 10, 2 );\n\t\tadd_filter( 'preprocess_comment', array( 'Akismet', 'auto_check_comment' ), 1 );\n\t\tadd_filter( 'rest_pre_insert_comment', array( 'Akismet', 'rest_auto_check_comment' ), 1 );\n\n\t\tadd_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_old_comments' ) );\n\t\tadd_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_old_comments_meta' ) );\n\t\tadd_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_orphaned_commentmeta' ) );\n\t\tadd_action( 'akismet_schedule_cron_recheck', array( 'Akismet', 'cron_recheck' ) );\n\n\t\tadd_action( 'comment_form',  array( 'Akismet',  'add_comment_nonce' ), 1 );\n\n\t\tadd_action( 'admin_head-edit-comments.php', array( 'Akismet', 'load_form_js' ) );\n\t\tadd_action( 'comment_form', array( 'Akismet', 'load_form_js' ) );\n\t\tadd_action( 'comment_form', array( 'Akismet', 'inject_ak_js' ) );\n\t\tadd_filter( 'script_loader_tag', array( 'Akismet', 'set_form_js_async' ), 10, 3 );\n\n\t\tadd_filter( 'comment_moderation_recipients', array( 'Akismet', 'disable_moderation_emails_if_unreachable' ), 1000, 2 );\n\t\tadd_filter( 'pre_comment_approved', array( 'Akismet', 'last_comment_status' ), 10, 2 );\n\t\t\n\t\tadd_action( 'transition_comment_status', array( 'Akismet', 'transition_comment_status' ), 10, 3 );\n\n\t\t// Run this early in the pingback call, before doing a remote fetch of the source uri\n\t\tadd_action( 'xmlrpc_call', array( 'Akismet', 'pre_check_pingback' ) );\n\t\t\n\t\t// Jetpack compatibility\n\t\tadd_filter( 'jetpack_options_whitelist', array( 'Akismet', 'add_to_jetpack_options_whitelist' ) );\n\t\tadd_action( 'update_option_wordpress_api_key', array( 'Akismet', 'updated_option' ), 10, 2 );\n\t\tadd_action( 'add_option_wordpress_api_key', array( 'Akismet', 'added_option' ), 10, 2 );\n\n\t\tadd_action( 'comment_form_after',  array( 'Akismet',  'display_comment_form_privacy_notice' ) );\n\t}\n\n\tpublic static function get_api_key() {\n\t\treturn apply_filters( 'akismet_get_api_key', defined('WPCOM_API_KEY') ? constant('WPCOM_API_KEY') : get_option('wordpress_api_key') );\n\t}\n\n\tpublic static function check_key_status( $key, $ip = null ) {\n\t\treturn self::http_post( Akismet::build_query( array( 'key' => $key, 'blog' => get_option( 'home' ) ) ), 'verify-key', $ip );\n\t}\n\n\tpublic static function verify_key( $key, $ip = null ) {\n\t\t// Shortcut for obviously invalid keys.\n\t\tif ( strlen( $key ) != 12 ) {\n\t\t\treturn 'invalid';\n\t\t}\n\t\t\n\t\t$response = self::check_key_status( $key, $ip );\n\n\t\tif ( $response[1] != 'valid' && $response[1] != 'invalid' )\n\t\t\treturn 'failed';\n\n\t\treturn $response[1];\n\t}\n\n\tpublic static function deactivate_key( $key ) {\n\t\t$response = self::http_post( Akismet::build_query( array( 'key' => $key, 'blog' => get_option( 'home' ) ) ), 'deactivate' );\n\n\t\tif ( $response[1] != 'deactivated' )\n\t\t\treturn 'failed';\n\n\t\treturn $response[1];\n\t}\n\n\t/**\n\t * Add the akismet option to the Jetpack options management whitelist.\n\t *\n\t * @param array $options The list of whitelisted option names.\n\t * @return array The updated whitelist\n\t */\n\tpublic static function add_to_jetpack_options_whitelist( $options ) {\n\t\t$options[] = 'wordpress_api_key';\n\t\treturn $options;\n\t}\n\n\t/**\n\t * When the akismet option is updated, run the registration call.\n\t *\n\t * This should only be run when the option is updated from the Jetpack/WP.com\n\t * API call, and only if the new key is different than the old key.\n\t *\n\t * @param mixed  $old_value   The old option value.\n\t * @param mixed  $value       The new option value.\n\t */\n\tpublic static function updated_option( $old_value, $value ) {\n\t\t// Not an API call\n\t\tif ( ! class_exists( 'WPCOM_JSON_API_Update_Option_Endpoint' ) ) {\n\t\t\treturn;\n\t\t}\n\t\t// Only run the registration if the old key is different.\n\t\tif ( $old_value !== $value ) {\n\t\t\tself::verify_key( $value );\n\t\t}\n\t}\n\t\n\t/**\n\t * Treat the creation of an API key the same as updating the API key to a new value.\n\t *\n\t * @param mixed  $option_name   Will always be \"wordpress_api_key\", until something else hooks in here.\n\t * @param mixed  $value         The option value.\n\t */\n\tpublic static function added_option( $option_name, $value ) {\n\t\tif ( 'wordpress_api_key' === $option_name ) {\n\t\t\treturn self::updated_option( '', $value );\n\t\t}\n\t}\n\t\n\tpublic static function rest_auto_check_comment( $commentdata ) {\n\t\tself::$is_rest_api_call = true;\n\t\t\n\t\treturn self::auto_check_comment( $commentdata );\n\t}\n\n\tpublic static function auto_check_comment( $commentdata ) {\n\t\t// If no key is configured, then there's no point in doing any of this.\n\t\tif ( ! self::get_api_key() ) {\n\t\t\treturn $commentdata;\n\t\t}\n\n\t\tself::$last_comment_result = null;\n\n\t\t$comment = $commentdata;\n\n\t\t$comment['user_ip']      = self::get_ip_address();\n\t\t$comment['user_agent']   = self::get_user_agent();\n\t\t$comment['referrer']     = self::get_referer();\n\t\t$comment['blog']         = get_option( 'home' );\n\t\t$comment['blog_lang']    = get_locale();\n\t\t$comment['blog_charset'] = get_option('blog_charset');\n\t\t$comment['permalink']    = get_permalink( $comment['comment_post_ID'] );\n\n\t\tif ( ! empty( $comment['user_ID'] ) ) {\n\t\t\t$comment['user_role'] = Akismet::get_user_roles( $comment['user_ID'] );\n\t\t}\n\n\t\t/** See filter documentation in init_hooks(). */\n\t\t$akismet_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );\n\t\t$comment['akismet_comment_nonce'] = 'inactive';\n\t\tif ( $akismet_nonce_option == 'true' || $akismet_nonce_option == '' ) {\n\t\t\t$comment['akismet_comment_nonce'] = 'failed';\n\t\t\tif ( isset( $_POST['akismet_comment_nonce'] ) && wp_verify_nonce( $_POST['akismet_comment_nonce'], 'akismet_comment_nonce_' . $comment['comment_post_ID'] ) )\n\t\t\t\t$comment['akismet_comment_nonce'] = 'passed';\n\n\t\t\t// comment reply in wp-admin\n\t\t\tif ( isset( $_POST['_ajax_nonce-replyto-comment'] ) && check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' ) )\n\t\t\t\t$comment['akismet_comment_nonce'] = 'passed';\n\n\t\t}\n\n\t\tif ( self::is_test_mode() )\n\t\t\t$comment['is_test'] = 'true';\n\n\t\tforeach( $_POST as $key => $value ) {\n\t\t\tif ( is_string( $value ) )\n\t\t\t\t$comment[\"POST_{$key}\"] = $value;\n\t\t}\n\n\t\tforeach ( $_SERVER as $key => $value ) {\n\t\t\tif ( ! is_string( $value ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( preg_match( \"/^HTTP_COOKIE/\", $key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Send any potentially useful $_SERVER vars, but avoid sending junk we don't need.\n\t\t\tif ( preg_match( \"/^(HTTP_|REMOTE_ADDR|REQUEST_URI|DOCUMENT_URI)/\", $key ) ) {\n\t\t\t\t$comment[ \"$key\" ] = $value;\n\t\t\t}\n\t\t}\n\n\t\t$post = get_post( $comment['comment_post_ID'] );\n\n\t\tif ( ! is_null( $post ) ) {\n\t\t\t// $post can technically be null, although in the past, it's always been an indicator of another plugin interfering.\n\t\t\t$comment[ 'comment_post_modified_gmt' ] = $post->post_modified_gmt;\n\t\t}\n\n\t\t$response = self::http_post( Akismet::build_query( $comment ), 'comment-check' );\n\n\t\tdo_action( 'akismet_comment_check_response', $response );\n\n\t\t$commentdata['comment_as_submitted'] = array_intersect_key( $comment, self::$comment_as_submitted_allowed_keys );\n\t\t$commentdata['akismet_result']       = $response[1];\n\n\t\tif ( isset( $response[0]['x-akismet-pro-tip'] ) )\n\t        $commentdata['akismet_pro_tip'] = $response[0]['x-akismet-pro-tip'];\n\n\t\tif ( isset( $response[0]['x-akismet-error'] ) ) {\n\t\t\t// An error occurred that we anticipated (like a suspended key) and want the user to act on.\n\t\t\t// Send to moderation.\n\t\t\tself::$last_comment_result = '0';\n\t\t}\n\t\telse if ( 'true' == $response[1] ) {\n\t\t\t// akismet_spam_count will be incremented later by comment_is_spam()\n\t\t\tself::$last_comment_result = 'spam';\n\n\t\t\t$discard = ( isset( $commentdata['akismet_pro_tip'] ) && $commentdata['akismet_pro_tip'] === 'discard' && self::allow_discard() );\n\n\t\t\tdo_action( 'akismet_spam_caught', $discard );\n\n\t\t\tif ( $discard ) {\n\t\t\t\t// The spam is obvious, so we're bailing out early. \n\t\t\t\t// akismet_result_spam() won't be called so bump the counter here\n\t\t\t\tif ( $incr = apply_filters( 'akismet_spam_count_incr', 1 ) ) {\n\t\t\t\t\tupdate_option( 'akismet_spam_count', get_option( 'akismet_spam_count' ) + $incr );\n\t\t\t\t}\n\n\t\t\t\tif ( self::$is_rest_api_call ) {\n\t\t\t\t\treturn new WP_Error( 'akismet_rest_comment_discarded', __( 'Comment discarded.', 'akismet' ) );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Redirect back to the previous page, or failing that, the post permalink, or failing that, the homepage of the blog.\n\t\t\t\t\t$redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ( $post ? get_permalink( $post ) : home_url() );\n\t\t\t\t\twp_safe_redirect( esc_url_raw( $redirect_to ) );\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( self::$is_rest_api_call ) {\n\t\t\t\t// The way the REST API structures its calls, we can set the comment_approved value right away.\n\t\t\t\t$commentdata['comment_approved'] = 'spam';\n\t\t\t}\n\t\t}\n\t\t\n\t\t// if the response is neither true nor false, hold the comment for moderation and schedule a recheck\n\t\tif ( 'true' != $response[1] && 'false' != $response[1] ) {\n\t\t\tif ( !current_user_can('moderate_comments') ) {\n\t\t\t\t// Comment status should be moderated\n\t\t\t\tself::$last_comment_result = '0';\n\t\t\t}\n\n\t\t\tif ( ! wp_next_scheduled( 'akismet_schedule_cron_recheck' ) ) {\n\t\t\t\twp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );\n\t\t\t\tdo_action( 'akismet_scheduled_recheck', 'invalid-response-' . $response[1] );\n\t\t\t}\n\n\t\t\tself::$prevent_moderation_email_for_these_comments[] = $commentdata;\n\t\t}\n\n\t\t// Delete old comments daily\n\t\tif ( ! wp_next_scheduled( 'akismet_scheduled_delete' ) ) {\n\t\t\twp_schedule_event( time(), 'daily', 'akismet_scheduled_delete' );\n\t\t}\n\n\t\tself::set_last_comment( $commentdata );\n\t\tself::fix_scheduled_recheck();\n\n\t\treturn $commentdata;\n\t}\n\t\n\tpublic static function get_last_comment() {\n\t\treturn self::$last_comment;\n\t}\n\t\n\tpublic static function set_last_comment( $comment ) {\n\t\tif ( is_null( $comment ) ) {\n\t\t\tself::$last_comment = null;\n\t\t}\n\t\telse {\n\t\t\t// We filter it here so that it matches the filtered comment data that we'll have to compare against later.\n\t\t\t// wp_filter_comment expects comment_author_IP\n\t\t\tself::$last_comment = wp_filter_comment(\n\t\t\t\tarray_merge(\n\t\t\t\t\tarray( 'comment_author_IP' => self::get_ip_address() ),\n\t\t\t\t\t$comment\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\t// this fires on wp_insert_comment.  we can't update comment_meta when auto_check_comment() runs\n\t// because we don't know the comment ID at that point.\n\tpublic static function auto_check_update_meta( $id, $comment ) {\n\t\t// wp_insert_comment() might be called in other contexts, so make sure this is the same comment\n\t\t// as was checked by auto_check_comment\n\t\tif ( is_object( $comment ) && !empty( self::$last_comment ) && is_array( self::$last_comment ) ) {\n\t\t\tif ( self::matches_last_comment( $comment ) ) {\n\t\t\t\tload_plugin_textdomain( 'akismet' );\n\n\t\t\t\t// normal result: true or false\n\t\t\t\tif ( self::$last_comment['akismet_result'] == 'true' ) {\n\t\t\t\t\tupdate_comment_meta( $comment->comment_ID, 'akismet_result', 'true' );\n\t\t\t\t\tself::update_comment_history( $comment->comment_ID, '', 'check-spam' );\n\t\t\t\t\tif ( $comment->comment_approved != 'spam' ) {\n\t\t\t\t\t\tself::update_comment_history(\n\t\t\t\t\t\t\t$comment->comment_ID,\n\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t'status-changed-' . $comment->comment_approved\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} elseif ( self::$last_comment['akismet_result'] == 'false' ) {\n\t\t\t\t\tupdate_comment_meta( $comment->comment_ID, 'akismet_result', 'false' );\n\t\t\t\t\tself::update_comment_history( $comment->comment_ID, '', 'check-ham' );\n\t\t\t\t\t// Status could be spam or trash, depending on the WP version and whether this change applies:\n\t\t\t\t\t// https://core.trac.wordpress.org/changeset/34726\n\t\t\t\t\tif ( $comment->comment_approved == 'spam' || $comment->comment_approved == 'trash' ) {\n\t\t\t\t\t\tif ( function_exists( 'wp_check_comment_disallowed_list' ) ) {\n\t\t\t\t\t\t\tif ( wp_check_comment_disallowed_list( $comment->comment_author, $comment->comment_author_email, $comment->comment_author_url, $comment->comment_content, $comment->comment_author_IP, $comment->comment_agent ) ) {\n\t\t\t\t\t\t\t\tself::update_comment_history( $comment->comment_ID, '', 'wp-disallowed' );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tself::update_comment_history( $comment->comment_ID, '', 'status-changed-' . $comment->comment_approved );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ( function_exists( 'wp_blacklist_check' ) && wp_blacklist_check( $comment->comment_author, $comment->comment_author_email, $comment->comment_author_url, $comment->comment_content, $comment->comment_author_IP, $comment->comment_agent ) ) {\n\t\t\t\t\t\t\tself::update_comment_history( $comment->comment_ID, '', 'wp-blacklisted' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tself::update_comment_history( $comment->comment_ID, '', 'status-changed-' . $comment->comment_approved );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t // abnormal result: error\n\t\t\t\t\tupdate_comment_meta( $comment->comment_ID, 'akismet_error', time() );\n\t\t\t\t\tself::update_comment_history(\n\t\t\t\t\t\t$comment->comment_ID,\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'check-error',\n\t\t\t\t\t\tarray( 'response' => substr( self::$last_comment['akismet_result'], 0, 50 ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// record the complete original data as submitted for checking\n\t\t\t\tif ( isset( self::$last_comment['comment_as_submitted'] ) ) {\n\t\t\t\t\tupdate_comment_meta( $comment->comment_ID, 'akismet_as_submitted', self::$last_comment['comment_as_submitted'] );\n\t\t\t\t}\n\n\t\t\t\tif ( isset( self::$last_comment['akismet_pro_tip'] ) ) {\n\t\t\t\t\tupdate_comment_meta( $comment->comment_ID, 'akismet_pro_tip', self::$last_comment['akismet_pro_tip'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static function delete_old_comments() {\n\t\tglobal $wpdb;\n\n\t\t/**\n\t\t * Determines how many comments will be deleted in each batch.\n\t\t *\n\t\t * @param int The default, as defined by AKISMET_DELETE_LIMIT.\n\t\t */\n\t\t$delete_limit = apply_filters( 'akismet_delete_comment_limit', defined( 'AKISMET_DELETE_LIMIT' ) ? AKISMET_DELETE_LIMIT : 10000 );\n\t\t$delete_limit = max( 1, intval( $delete_limit ) );\n\n\t\t/**\n\t\t * Determines how many days a comment will be left in the Spam queue before being deleted.\n\t\t *\n\t\t * @param int The default number of days.\n\t\t */\n\t\t$delete_interval = apply_filters( 'akismet_delete_comment_interval', 15 );\n\t\t$delete_interval = max( 1, intval( $delete_interval ) );\n\n\t\twhile ( $comment_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT comment_id FROM {$wpdb->comments} WHERE DATE_SUB(NOW(), INTERVAL %d DAY) > comment_date_gmt AND comment_approved = 'spam' LIMIT %d\", $delete_interval, $delete_limit ) ) ) {\n\t\t\tif ( empty( $comment_ids ) )\n\t\t\t\treturn;\n\n\t\t\t$wpdb->queries = array();\n\n\t\t\tforeach ( $comment_ids as $comment_id ) {\n\t\t\t\tdo_action( 'delete_comment', $comment_id );\n\t\t\t\tdo_action( 'akismet_batch_delete_count', __FUNCTION__ );\n\t\t\t}\n\n\t\t\t// Prepared as strings since comment_id is an unsigned BIGINT, and using %d will constrain the value to the maximum signed BIGINT.\n\t\t\t$format_string = implode( \", \", array_fill( 0, count( $comment_ids ), '%s' ) );\n\n\t\t\t$wpdb->query( $wpdb->prepare( \"DELETE FROM {$wpdb->comments} WHERE comment_id IN ( \" . $format_string . \" )\", $comment_ids ) );\n\t\t\t$wpdb->query( $wpdb->prepare( \"DELETE FROM {$wpdb->commentmeta} WHERE comment_id IN ( \" . $format_string . \" )\", $comment_ids ) );\n\n\t\t\tclean_comment_cache( $comment_ids );\n\t\t\tdo_action( 'akismet_delete_comment_batch', count( $comment_ids ) );\n\t\t}\n\n\t\tif ( apply_filters( 'akismet_optimize_table', ( mt_rand(1, 5000) == 11), $wpdb->comments ) ) // lucky number\n\t\t\t$wpdb->query(\"OPTIMIZE TABLE {$wpdb->comments}\");\n\t}\n\n\tpublic static function delete_old_comments_meta() {\n\t\tglobal $wpdb;\n\n\t\t$interval = apply_filters( 'akismet_delete_commentmeta_interval', 15 );\n\n\t\t# enforce a minimum of 1 day\n\t\t$interval = absint( $interval );\n\t\tif ( $interval < 1 )\n\t\t\t$interval = 1;\n\n\t\t// akismet_as_submitted meta values are large, so expire them\n\t\t// after $interval days regardless of the comment status\n\t\twhile ( $comment_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT m.comment_id FROM {$wpdb->commentmeta} as m INNER JOIN {$wpdb->comments} as c USING(comment_id) WHERE m.meta_key = 'akismet_as_submitted' AND DATE_SUB(NOW(), INTERVAL %d DAY) > c.comment_date_gmt LIMIT 10000\", $interval ) ) ) {\n\t\t\tif ( empty( $comment_ids ) )\n\t\t\t\treturn;\n\n\t\t\t$wpdb->queries = array();\n\n\t\t\tforeach ( $comment_ids as $comment_id ) {\n\t\t\t\tdelete_comment_meta( $comment_id, 'akismet_as_submitted' );\n\t\t\t\tdo_action( 'akismet_batch_delete_count', __FUNCTION__ );\n\t\t\t}\n\n\t\t\tdo_action( 'akismet_delete_commentmeta_batch', count( $comment_ids ) );\n\t\t}\n\n\t\tif ( apply_filters( 'akismet_optimize_table', ( mt_rand(1, 5000) == 11), $wpdb->commentmeta ) ) // lucky number\n\t\t\t$wpdb->query(\"OPTIMIZE TABLE {$wpdb->commentmeta}\");\n\t}\n\n\t// Clear out comments meta that no longer have corresponding comments in the database\n\tpublic static function delete_orphaned_commentmeta() {\n\t\tglobal $wpdb;\n\n\t\t$last_meta_id = 0;\n\t\t$start_time = isset( $_SERVER['REQUEST_TIME_FLOAT'] ) ? $_SERVER['REQUEST_TIME_FLOAT'] : microtime( true );\n\t\t$max_exec_time = max( ini_get('max_execution_time') - 5, 3 );\n\n\t\twhile ( $commentmeta_results = $wpdb->get_results( $wpdb->prepare( \"SELECT m.meta_id, m.comment_id, m.meta_key FROM {$wpdb->commentmeta} as m LEFT JOIN {$wpdb->comments} as c USING(comment_id) WHERE c.comment_id IS NULL AND m.meta_id > %d ORDER BY m.meta_id LIMIT 1000\", $last_meta_id ) ) ) {\n\t\t\tif ( empty( $commentmeta_results ) )\n\t\t\t\treturn;\n\n\t\t\t$wpdb->queries = array();\n\n\t\t\t$commentmeta_deleted = 0;\n\n\t\t\tforeach ( $commentmeta_results as $commentmeta ) {\n\t\t\t\tif ( 'akismet_' == substr( $commentmeta->meta_key, 0, 8 ) ) {\n\t\t\t\t\tdelete_comment_meta( $commentmeta->comment_id, $commentmeta->meta_key );\n\t\t\t\t\tdo_action( 'akismet_batch_delete_count', __FUNCTION__ );\n\t\t\t\t\t$commentmeta_deleted++;\n\t\t\t\t}\n\n\t\t\t\t$last_meta_id = $commentmeta->meta_id;\n\t\t\t}\n\n\t\t\tdo_action( 'akismet_delete_commentmeta_batch', $commentmeta_deleted );\n\n\t\t\t// If we're getting close to max_execution_time, quit for this round.\n\t\t\tif ( microtime(true) - $start_time > $max_exec_time )\n\t\t\t\treturn;\n\t\t}\n\n\t\tif ( apply_filters( 'akismet_optimize_table', ( mt_rand(1, 5000) == 11), $wpdb->commentmeta ) ) // lucky number\n\t\t\t$wpdb->query(\"OPTIMIZE TABLE {$wpdb->commentmeta}\");\n\t}\n\n\t// how many approved comments does this author have?\n\tpublic static function get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) {\n\t\tglobal $wpdb;\n\n\t\tif ( !empty( $user_id ) )\n\t\t\treturn (int) $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT(*) FROM {$wpdb->comments} WHERE user_id = %d AND comment_approved = 1\", $user_id ) );\n\n\t\tif ( !empty( $comment_author_email ) )\n\t\t\treturn (int) $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT(*) FROM {$wpdb->comments} WHERE comment_author_email = %s AND comment_author = %s AND comment_author_url = %s AND comment_approved = 1\", $comment_author_email, $comment_author, $comment_author_url ) );\n\n\t\treturn 0;\n\t}\n\n\t// get the full comment history for a given comment, as an array in reverse chronological order\n\tpublic static function get_comment_history( $comment_id ) {\n\t\t$history = get_comment_meta( $comment_id, 'akismet_history', false );\n\t\tif ( empty( $history ) || empty( $history[ 0 ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/*\n\t\t// To see all variants when testing.\n\t\t$history[] = array( 'time' => 445856401, 'message' => 'Old versions of Akismet stored the message as a literal string in the commentmeta.', 'event' => null );\n\t\t$history[] = array( 'time' => 445856402, 'event' => 'recheck-spam' );\n\t\t$history[] = array( 'time' => 445856403, 'event' => 'check-spam' );\n\t\t$history[] = array( 'time' => 445856404, 'event' => 'recheck-ham' );\n\t\t$history[] = array( 'time' => 445856405, 'event' => 'check-ham' );\n\t\t$history[] = array( 'time' => 445856406, 'event' => 'wp-blacklisted' );\n\t\t$history[] = array( 'time' => 445856406, 'event' => 'wp-disallowed' );\n\t\t$history[] = array( 'time' => 445856407, 'event' => 'report-spam' );\n\t\t$history[] = array( 'time' => 445856408, 'event' => 'report-spam', 'user' => 'sam' );\n\t\t$history[] = array( 'message' => 'sam reported this comment as spam (hardcoded message).', 'time' => 445856400, 'event' => 'report-spam', 'user' => 'sam' );\n\t\t$history[] = array( 'time' => 445856409, 'event' => 'report-ham', 'user' => 'sam' );\n\t\t$history[] = array( 'message' => 'sam reported this comment as ham (hardcoded message).', 'time' => 445856400, 'event' => 'report-ham', 'user' => 'sam' ); //\n\t\t$history[] = array( 'time' => 445856410, 'event' => 'cron-retry-spam' );\n\t\t$history[] = array( 'time' => 445856411, 'event' => 'cron-retry-ham' );\n\t\t$history[] = array( 'time' => 445856412, 'event' => 'check-error' ); //\n\t\t$history[] = array( 'time' => 445856413, 'event' => 'check-error', 'meta' => array( 'response' => 'The server was taking a nap.' ) );\n\t\t$history[] = array( 'time' => 445856414, 'event' => 'recheck-error' ); // Should not generate a message.\n\t\t$history[] = array( 'time' => 445856415, 'event' => 'recheck-error', 'meta' => array( 'response' => 'The server was taking a nap.' ) );\n\t\t$history[] = array( 'time' => 445856416, 'event' => 'status-changedtrash' );\n\t\t$history[] = array( 'time' => 445856417, 'event' => 'status-changedspam' );\n\t\t$history[] = array( 'time' => 445856418, 'event' => 'status-changedhold' );\n\t\t$history[] = array( 'time' => 445856419, 'event' => 'status-changedapprove' );\n\t\t$history[] = array( 'time' => 445856420, 'event' => 'status-changed-trash' );\n\t\t$history[] = array( 'time' => 445856421, 'event' => 'status-changed-spam' );\n\t\t$history[] = array( 'time' => 445856422, 'event' => 'status-changed-hold' );\n\t\t$history[] = array( 'time' => 445856423, 'event' => 'status-changed-approve' );\n\t\t$history[] = array( 'time' => 445856424, 'event' => 'status-trash', 'user' => 'sam' );\n\t\t$history[] = array( 'time' => 445856425, 'event' => 'status-spam', 'user' => 'sam' );\n\t\t$history[] = array( 'time' => 445856426, 'event' => 'status-hold', 'user' => 'sam' );\n\t\t$history[] = array( 'time' => 445856427, 'event' => 'status-approve', 'user' => 'sam' );\n\t\t*/\n\t\t\n\t\tusort( $history, array( 'Akismet', '_cmp_time' ) );\n\t\treturn $history;\n\t}\n\n\t/**\n\t * Log an event for a given comment, storing it in comment_meta.\n\t *\n\t * @param int $comment_id The ID of the relevant comment.\n\t * @param string $message The string description of the event. No longer used.\n\t * @param string $event The event code.\n\t * @param array $meta Metadata about the history entry. e.g., the user that reported or changed the status of a given comment.\n\t */\n\tpublic static function update_comment_history( $comment_id, $message, $event=null, $meta=null ) {\n\t\tglobal $current_user;\n\n\t\t$user = '';\n\n\t\t$event = array(\n\t\t\t'time'    => self::_get_microtime(),\n\t\t\t'event'   => $event,\n\t\t);\n\t\t\n\t\tif ( is_object( $current_user ) && isset( $current_user->user_login ) ) {\n\t\t\t$event['user'] = $current_user->user_login;\n\t\t}\n\t\t\n\t\tif ( ! empty( $meta ) ) {\n\t\t\t$event['meta'] = $meta;\n\t\t}\n\n\t\t// $unique = false so as to allow multiple values per comment\n\t\t$r = add_comment_meta( $comment_id, 'akismet_history', $event, false );\n\t}\n\n\tpublic static function check_db_comment( $id, $recheck_reason = 'recheck_queue' ) {\n\t\tglobal $wpdb;\n\n\t\tif ( ! self::get_api_key() ) {\n\t\t\treturn new WP_Error( 'akismet-not-configured', __( 'Akismet is not configured. Please enter an API key.', 'akismet' ) );\n\t\t}\n\n\t\t$c = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->comments} WHERE comment_ID = %d\", $id ), ARRAY_A );\n\t\t\n\t\tif ( ! $c ) {\n\t\t\treturn new WP_Error( 'invalid-comment-id', __( 'Comment not found.', 'akismet' ) );\n\t\t}\n\n\t\t$c['user_ip']        = $c['comment_author_IP'];\n\t\t$c['user_agent']     = $c['comment_agent'];\n\t\t$c['referrer']       = '';\n\t\t$c['blog']           = get_option( 'home' );\n\t\t$c['blog_lang']      = get_locale();\n\t\t$c['blog_charset']   = get_option('blog_charset');\n\t\t$c['permalink']      = get_permalink($c['comment_post_ID']);\n\t\t$c['recheck_reason'] = $recheck_reason;\n\n\t\t$c['user_role'] = '';\n\t\tif ( ! empty( $c['user_ID'] ) ) {\n\t\t\t$c['user_role'] = Akismet::get_user_roles( $c['user_ID'] );\n\t\t}\n\n\t\tif ( self::is_test_mode() )\n\t\t\t$c['is_test'] = 'true';\n\n\t\t$response = self::http_post( Akismet::build_query( $c ), 'comment-check' );\n\n\t\tif ( ! empty( $response[1] ) ) {\n\t\t\treturn $response[1];\n\t\t}\n\n\t\treturn false;\n\t}\n\t\n\tpublic static function recheck_comment( $id, $recheck_reason = 'recheck_queue' ) {\n\t\tadd_comment_meta( $id, 'akismet_rechecking', true );\n\t\t\n\t\t$api_response = self::check_db_comment( $id, $recheck_reason );\n\n\t\tdelete_comment_meta( $id, 'akismet_rechecking' );\n\n\t\tif ( is_wp_error( $api_response ) ) {\n\t\t\t// Invalid comment ID.\n\t\t}\n\t\telse if ( 'true' === $api_response ) {\n\t\t\twp_set_comment_status( $id, 'spam' );\n\t\t\tupdate_comment_meta( $id, 'akismet_result', 'true' );\n\t\t\tdelete_comment_meta( $id, 'akismet_error' );\n\t\t\tdelete_comment_meta( $id, 'akismet_delayed_moderation_email' );\n\t\t\tAkismet::update_comment_history( $id, '', 'recheck-spam' );\n\t\t}\n\t\telseif ( 'false' === $api_response ) {\n\t\t\tupdate_comment_meta( $id, 'akismet_result', 'false' );\n\t\t\tdelete_comment_meta( $id, 'akismet_error' );\n\t\t\tdelete_comment_meta( $id, 'akismet_delayed_moderation_email' );\n\t\t\tAkismet::update_comment_history( $id, '', 'recheck-ham' );\n\t\t}\n\t\telse {\n\t\t\t// abnormal result: error\n\t\t\tupdate_comment_meta( $id, 'akismet_result', 'error' );\n\t\t\tAkismet::update_comment_history(\n\t\t\t\t$id,\n\t\t\t\t'',\n\t\t\t\t'recheck-error',\n\t\t\t\tarray( 'response' => substr( $api_response, 0, 50 ) )\n\t\t\t);\n\t\t}\n\n\t\treturn $api_response;\n\t}\n\n\tpublic static function transition_comment_status( $new_status, $old_status, $comment ) {\n\t\t\n\t\tif ( $new_status == $old_status )\n\t\t\treturn;\n\n\t\tif ( 'spam' === $new_status || 'spam' === $old_status ) {\n\t\t\t// Clear the cache of the \"X comments in your spam queue\" count on the dashboard.\n\t\t\twp_cache_delete( 'akismet_spam_count', 'widget' );\n\t\t}\n\n\t\t# we don't need to record a history item for deleted comments\n\t\tif ( $new_status == 'delete' )\n\t\t\treturn;\n\t\t\n\t\tif ( !current_user_can( 'edit_post', $comment->comment_post_ID ) && !current_user_can( 'moderate_comments' ) )\n\t\t\treturn;\n\n\t\tif ( defined('WP_IMPORTING') && WP_IMPORTING == true )\n\t\t\treturn;\n\t\t\t\n\t\t// if this is present, it means the status has been changed by a re-check, not an explicit user action\n\t\tif ( get_comment_meta( $comment->comment_ID, 'akismet_rechecking' ) )\n\t\t\treturn;\n\t\t\n\t\t// Assumption alert:\n\t\t// We want to submit comments to Akismet only when a moderator explicitly spams or approves it - not if the status\n\t\t// is changed automatically by another plugin.  Unfortunately WordPress doesn't provide an unambiguous way to\n\t\t// determine why the transition_comment_status action was triggered.  And there are several different ways by which\n\t\t// to spam and unspam comments: bulk actions, ajax, links in moderation emails, the dashboard, and perhaps others.\n\t\t// We'll assume that this is an explicit user action if certain POST/GET variables exist.\n\t\tif (\n\t\t\t // status=spam: Marking as spam via the REST API or...\n\t\t\t // status=unspam: I'm not sure. Maybe this used to be used instead of status=approved? Or the UI for removing from spam but not approving has been since removed?...\n\t\t\t // status=approved: Unspamming via the REST API (Calypso) or...\n\t\t\t ( isset( $_POST['status'] ) && in_array( $_POST['status'], array( 'spam', 'unspam', 'approved', ) ) )\n\t\t\t // spam=1: Clicking \"Spam\" underneath a comment in wp-admin and allowing the AJAX request to happen.\n\t\t\t || ( isset( $_POST['spam'] ) && (int) $_POST['spam'] == 1 )\n\t\t\t // unspam=1: Clicking \"Not Spam\" underneath a comment in wp-admin and allowing the AJAX request to happen. Or, clicking \"Undo\" after marking something as spam.\n\t\t\t || ( isset( $_POST['unspam'] ) && (int) $_POST['unspam'] == 1 )\n\t\t\t // comment_status=spam/unspam: It's unclear where this is happening.\n\t\t\t || ( isset( $_POST['comment_status'] )  && in_array( $_POST['comment_status'], array( 'spam', 'unspam' ) ) )\n\t\t\t // action=spam: Choosing \"Mark as Spam\" from the Bulk Actions dropdown in wp-admin (or the \"Spam it\" link in notification emails).\n\t\t\t // action=unspam: Choosing \"Not Spam\" from the Bulk Actions dropdown in wp-admin.\n\t\t\t // action=spamcomment: Following the \"Spam\" link below a comment in wp-admin (not allowing AJAX request to happen).\n\t\t\t // action=unspamcomment: Following the \"Not Spam\" link below a comment in wp-admin (not allowing AJAX request to happen).\n\t\t\t || ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'spam', 'unspam', 'spamcomment', 'unspamcomment', ) ) )\n\t\t\t // action=editedcomment: Editing a comment via wp-admin (and possibly changing its status).\n\t\t\t || ( isset( $_POST['action'] ) && in_array( $_POST['action'], array( 'editedcomment' ) ) )\n\t\t\t // for=jetpack: Moderation via the WordPress app, Calypso, anything powered by the Jetpack connection.\n\t\t\t || ( isset( $_GET['for'] ) && ( 'jetpack' == $_GET['for'] ) && ( ! defined( 'IS_WPCOM' ) || ! IS_WPCOM ) ) \n\t\t\t // Certain WordPress.com API requests\n\t\t\t || ( defined( 'REST_API_REQUEST' ) && REST_API_REQUEST )\n\t\t\t // WordPress.org REST API requests\n\t\t\t || ( defined( 'REST_REQUEST' ) && REST_REQUEST )\n\t\t ) {\n\t\t\tif ( $new_status == 'spam' && ( $old_status == 'approved' || $old_status == 'unapproved' || !$old_status ) ) {\n\t\t\t\treturn self::submit_spam_comment( $comment->comment_ID );\n\t\t\t} elseif ( $old_status == 'spam' && ( $new_status == 'approved' || $new_status == 'unapproved' ) ) {\n\t\t\t\treturn self::submit_nonspam_comment( $comment->comment_ID );\n\t\t\t}\n\t\t}\n\n\t\tself::update_comment_history( $comment->comment_ID, '', 'status-' . $new_status );\n\t}\n\t\n\tpublic static function submit_spam_comment( $comment_id ) {\n\t\tglobal $wpdb, $current_user, $current_site;\n\n\t\t$comment_id = (int) $comment_id;\n\n\t\t$comment = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->comments} WHERE comment_ID = %d\", $comment_id ) );\n\n\t\tif ( !$comment ) // it was deleted\n\t\t\treturn;\n\n\t\tif ( 'spam' != $comment->comment_approved )\n\t\t\treturn;\n\n\t\tself::update_comment_history( $comment_id, '', 'report-spam' );\n\n\t\t// If the user hasn't configured Akismet, there's nothing else to do at this point.\n\t\tif ( ! self::get_api_key() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// use the original version stored in comment_meta if available\n\t\t$as_submitted = self::sanitize_comment_as_submitted( get_comment_meta( $comment_id, 'akismet_as_submitted', true ) );\n\n\t\tif ( $as_submitted && is_array( $as_submitted ) && isset( $as_submitted['comment_content'] ) )\n\t\t\t$comment = (object) array_merge( (array)$comment, $as_submitted );\n\n\t\t$comment->blog         = get_option( 'home' );\n\t\t$comment->blog_lang    = get_locale();\n\t\t$comment->blog_charset = get_option('blog_charset');\n\t\t$comment->permalink    = get_permalink($comment->comment_post_ID);\n\n\t\tif ( is_object($current_user) )\n\t\t\t$comment->reporter = $current_user->user_login;\n\n\t\tif ( is_object($current_site) )\n\t\t\t$comment->site_domain = $current_site->domain;\n\n\t\t$comment->user_role = '';\n\t\tif ( ! empty( $comment->user_ID ) ) {\n\t\t\t$comment->user_role = Akismet::get_user_roles( $comment->user_ID );\n\t\t}\n\n\t\tif ( self::is_test_mode() )\n\t\t\t$comment->is_test = 'true';\n\n\t\t$post = get_post( $comment->comment_post_ID );\n\n\t\tif ( ! is_null( $post ) ) {\n\t\t\t$comment->comment_post_modified_gmt = $post->post_modified_gmt;\n\t\t}\n\n\t\t$response = Akismet::http_post( Akismet::build_query( $comment ), 'submit-spam' );\n\n\t\tupdate_comment_meta( $comment_id, 'akismet_user_result', 'true' );\n\n\t\tif ( $comment->reporter ) {\n\t\t\tupdate_comment_meta( $comment_id, 'akismet_user', $comment->reporter );\n\t\t}\n\n\t\tdo_action('akismet_submit_spam_comment', $comment_id, $response[1]);\n\t}\n\n\tpublic static function submit_nonspam_comment( $comment_id ) {\n\t\tglobal $wpdb, $current_user, $current_site;\n\n\t\t$comment_id = (int) $comment_id;\n\n\t\t$comment = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->comments} WHERE comment_ID = %d\", $comment_id ) );\n\t\tif ( !$comment ) // it was deleted\n\t\t\treturn;\n\n\t\tself::update_comment_history( $comment_id, '', 'report-ham' );\n\n\t\t// If the user hasn't configured Akismet, there's nothing else to do at this point.\n\t\tif ( ! self::get_api_key() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// use the original version stored in comment_meta if available\n\t\t$as_submitted = self::sanitize_comment_as_submitted( get_comment_meta( $comment_id, 'akismet_as_submitted', true ) );\n\n\t\tif ( $as_submitted && is_array($as_submitted) && isset($as_submitted['comment_content']) )\n\t\t\t$comment = (object) array_merge( (array)$comment, $as_submitted );\n\n\t\t$comment->blog         = get_option( 'home' );\n\t\t$comment->blog_lang    = get_locale();\n\t\t$comment->blog_charset = get_option('blog_charset');\n\t\t$comment->permalink    = get_permalink( $comment->comment_post_ID );\n\t\t$comment->user_role    = '';\n\n\t\tif ( is_object($current_user) )\n\t\t\t$comment->reporter = $current_user->user_login;\n\n\t\tif ( is_object($current_site) )\n\t\t\t$comment->site_domain = $current_site->domain;\n\n\t\tif ( ! empty( $comment->user_ID ) ) {\n\t\t\t$comment->user_role = Akismet::get_user_roles( $comment->user_ID );\n\t\t}\n\n\t\tif ( Akismet::is_test_mode() )\n\t\t\t$comment->is_test = 'true';\n\n\t\t$post = get_post( $comment->comment_post_ID );\n\n\t\tif ( ! is_null( $post ) ) {\n\t\t\t$comment->comment_post_modified_gmt = $post->post_modified_gmt;\n\t\t}\n\n\t\t$response = self::http_post( Akismet::build_query( $comment ), 'submit-ham' );\n\n\t\tupdate_comment_meta( $comment_id, 'akismet_user_result', 'false' );\n\n\t\tif ( $comment->reporter ) {\n\t\t\tupdate_comment_meta( $comment_id, 'akismet_user', $comment->reporter );\n\t\t}\n\n\t\tdo_action('akismet_submit_nonspam_comment', $comment_id, $response[1]);\n\t}\n\n\tpublic static function cron_recheck() {\n\t\tglobal $wpdb;\n\n\t\t$api_key = self::get_api_key();\n\n\t\t$status = self::verify_key( $api_key );\n\t\tif ( get_option( 'akismet_alert_code' ) || $status == 'invalid' ) {\n\t\t\t// since there is currently a problem with the key, reschedule a check for 6 hours hence\n\t\t\twp_schedule_single_event( time() + 21600, 'akismet_schedule_cron_recheck' );\n\t\t\tdo_action( 'akismet_scheduled_recheck', 'key-problem-' . get_option( 'akismet_alert_code' ) . '-' . $status );\n\t\t\treturn false;\n\t\t}\n\n\t\tdelete_option('akismet_available_servers');\n\n\t\t$comment_errors = $wpdb->get_col( \"SELECT comment_id FROM {$wpdb->commentmeta} WHERE meta_key = 'akismet_error'\tLIMIT 100\" );\n\t\t\n\t\tload_plugin_textdomain( 'akismet' );\n\n\t\tforeach ( (array) $comment_errors as $comment_id ) {\n\t\t\t// if the comment no longer exists, or is too old, remove the meta entry from the queue to avoid getting stuck\n\t\t\t$comment = get_comment( $comment_id );\n\n\t\t\tif (\n\t\t\t\t! $comment // Comment has been deleted\n\t\t\t\t|| strtotime( $comment->comment_date_gmt ) < strtotime( \"-15 days\" ) // Comment is too old.\n\t\t\t\t|| $comment->comment_approved !== \"0\" // Comment is no longer in the Pending queue\n\t\t\t\t) {\n\t\t\t\tdelete_comment_meta( $comment_id, 'akismet_error' );\n\t\t\t\tdelete_comment_meta( $comment_id, 'akismet_delayed_moderation_email' );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tadd_comment_meta( $comment_id, 'akismet_rechecking', true );\n\t\t\t$status = self::check_db_comment( $comment_id, 'retry' );\n\n\t\t\t$event = '';\n\t\t\tif ( $status == 'true' ) {\n\t\t\t\t$event = 'cron-retry-spam';\n\t\t\t} elseif ( $status == 'false' ) {\n\t\t\t\t$event = 'cron-retry-ham';\n\t\t\t}\n\n\t\t\t// If we got back a legit response then update the comment history\n\t\t\t// other wise just bail now and try again later.  No point in\n\t\t\t// re-trying all the comments once we hit one failure.\n\t\t\tif ( !empty( $event ) ) {\n\t\t\t\tdelete_comment_meta( $comment_id, 'akismet_error' );\n\t\t\t\tself::update_comment_history( $comment_id, '', $event );\n\t\t\t\tupdate_comment_meta( $comment_id, 'akismet_result', $status );\n\t\t\t\t// make sure the comment status is still pending.  if it isn't, that means the user has already moved it elsewhere.\n\t\t\t\t$comment = get_comment( $comment_id );\n\t\t\t\tif ( $comment && 'unapproved' == wp_get_comment_status( $comment_id ) ) {\n\t\t\t\t\tif ( $status == 'true' ) {\n\t\t\t\t\t\twp_spam_comment( $comment_id );\n\t\t\t\t\t} elseif ( $status == 'false' ) {\n\t\t\t\t\t\t// comment is good, but it's still in the pending queue.  depending on the moderation settings\n\t\t\t\t\t\t// we may need to change it to approved.\n\t\t\t\t\t\tif ( check_comment($comment->comment_author, $comment->comment_author_email, $comment->comment_author_url, $comment->comment_content, $comment->comment_author_IP, $comment->comment_agent, $comment->comment_type) )\n\t\t\t\t\t\t\twp_set_comment_status( $comment_id, 1 );\n\t\t\t\t\t\telse if ( get_comment_meta( $comment_id, 'akismet_delayed_moderation_email', true ) )\n\t\t\t\t\t\t\twp_notify_moderator( $comment_id );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdelete_comment_meta( $comment_id, 'akismet_delayed_moderation_email' );\n\t\t\t} else {\n\t\t\t\t// If this comment has been pending moderation for longer than MAX_DELAY_BEFORE_MODERATION_EMAIL,\n\t\t\t\t// send a moderation email now.\n\t\t\t\tif ( ( intval( gmdate( 'U' ) ) - strtotime( $comment->comment_date_gmt ) ) < self::MAX_DELAY_BEFORE_MODERATION_EMAIL ) {\n\t\t\t\t\tdelete_comment_meta( $comment_id, 'akismet_delayed_moderation_email' );\n\t\t\t\t\twp_notify_moderator( $comment_id );\n\t\t\t\t}\n\n\t\t\t\tdelete_comment_meta( $comment_id, 'akismet_rechecking' );\n\t\t\t\twp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );\n\t\t\t\tdo_action( 'akismet_scheduled_recheck', 'check-db-comment-' . $status );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete_comment_meta( $comment_id, 'akismet_rechecking' );\n\t\t}\n\n\t\t$remaining = $wpdb->get_var( \"SELECT COUNT(*) FROM {$wpdb->commentmeta} WHERE meta_key = 'akismet_error'\" );\n\t\tif ( $remaining && !wp_next_scheduled('akismet_schedule_cron_recheck') ) {\n\t\t\twp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );\n\t\t\tdo_action( 'akismet_scheduled_recheck', 'remaining' );\n\t\t}\n\t}\n\n\tpublic static function fix_scheduled_recheck() {\n\t\t$future_check = wp_next_scheduled( 'akismet_schedule_cron_recheck' );\n\t\tif ( !$future_check ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( get_option( 'akismet_alert_code' ) > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$check_range = time() + 1200;\n\t\tif ( $future_check > $check_range ) {\n\t\t\twp_clear_scheduled_hook( 'akismet_schedule_cron_recheck' );\n\t\t\twp_schedule_single_event( time() + 300, 'akismet_schedule_cron_recheck' );\n\t\t\tdo_action( 'akismet_scheduled_recheck', 'fix-scheduled-recheck' );\n\t\t}\n\t}\n\n\tpublic static function add_comment_nonce( $post_id ) {\n\t\t/**\n\t\t * To disable the Akismet comment nonce, add a filter for the 'akismet_comment_nonce' tag\n\t\t * and return any string value that is not 'true' or '' (empty string).\n\t\t *\n\t\t * Don't return boolean false, because that implies that the 'akismet_comment_nonce' option\n\t\t * has not been set and that Akismet should just choose the default behavior for that\n\t\t * situation.\n\t\t */\n\t\t\n\t\tif ( ! self::get_api_key() ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$akismet_comment_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );\n\n\t\tif ( $akismet_comment_nonce_option == 'true' || $akismet_comment_nonce_option == '' ) {\n\t\t\techo '<p style=\"display: none;\">';\n\t\t\twp_nonce_field( 'akismet_comment_nonce_' . $post_id, 'akismet_comment_nonce', FALSE );\n\t\t\techo '</p>';\n\t\t}\n\t}\n\n\tpublic static function is_test_mode() {\n\t\treturn defined('AKISMET_TEST_MODE') && AKISMET_TEST_MODE;\n\t}\n\t\n\tpublic static function allow_discard() {\n\t\tif ( defined( 'DOING_AJAX' ) && DOING_AJAX )\n\t\t\treturn false;\n\t\tif ( is_user_logged_in() )\n\t\t\treturn false;\n\t\n\t\treturn ( get_option( 'akismet_strictness' ) === '1'  );\n\t}\n\n\tpublic static function get_ip_address() {\n\t\treturn isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : null;\n\t}\n\t\n\t/**\n\t * Do these two comments, without checking the comment_ID, \"match\"?\n\t *\n\t * @param mixed $comment1 A comment object or array.\n\t * @param mixed $comment2 A comment object or array.\n\t * @return bool Whether the two comments should be treated as the same comment.\n\t */\n\tprivate static function comments_match( $comment1, $comment2 ) {\n\t\t$comment1 = (array) $comment1;\n\t\t$comment2 = (array) $comment2;\n\n\t\t// Set default values for these strings that we check in order to simplify\n\t\t// the checks and avoid PHP warnings.\n\t\tif ( ! isset( $comment1['comment_author'] ) ) {\n\t\t\t$comment1['comment_author'] = '';\n\t\t}\n\n\t\tif ( ! isset( $comment2['comment_author'] ) ) {\n\t\t\t$comment2['comment_author'] = '';\n\t\t}\n\n\t\tif ( ! isset( $comment1['comment_author_email'] ) ) {\n\t\t\t$comment1['comment_author_email'] = '';\n\t\t}\n\n\t\tif ( ! isset( $comment2['comment_author_email'] ) ) {\n\t\t\t$comment2['comment_author_email'] = '';\n\t\t}\n\n\t\t$comments_match = (\n\t\t\t   isset( $comment1['comment_post_ID'], $comment2['comment_post_ID'] )\n\t\t\t&& intval( $comment1['comment_post_ID'] ) == intval( $comment2['comment_post_ID'] )\n\t\t\t&& (\n\t\t\t\t// The comment author length max is 255 characters, limited by the TINYTEXT column type.\n\t\t\t\t// If the comment author includes multibyte characters right around the 255-byte mark, they\n\t\t\t\t// may be stripped when the author is saved in the DB, so a 300+ char author may turn into\n\t\t\t\t// a 253-char author when it's saved, not 255 exactly.  The longest possible character is\n\t\t\t\t// theoretically 6 bytes, so we'll only look at the first 248 bytes to be safe.\n\t\t\t\tsubstr( $comment1['comment_author'], 0, 248 ) == substr( $comment2['comment_author'], 0, 248 )\n\t\t\t\t|| substr( stripslashes( $comment1['comment_author'] ), 0, 248 ) == substr( $comment2['comment_author'], 0, 248 )\n\t\t\t\t|| substr( $comment1['comment_author'], 0, 248 ) == substr( stripslashes( $comment2['comment_author'] ), 0, 248 )\n\t\t\t\t// Certain long comment author names will be truncated to nothing, depending on their encoding.\n\t\t\t\t|| ( ! $comment1['comment_author'] && strlen( $comment2['comment_author'] ) > 248 )\n\t\t\t\t|| ( ! $comment2['comment_author'] && strlen( $comment1['comment_author'] ) > 248 )\n\t\t\t\t)\n\t\t\t&& (\n\t\t\t\t// The email max length is 100 characters, limited by the VARCHAR(100) column type.\n\t\t\t\t// Same argument as above for only looking at the first 93 characters.\n\t\t\t\tsubstr( $comment1['comment_author_email'], 0, 93 ) == substr( $comment2['comment_author_email'], 0, 93 )\n\t\t\t\t|| substr( stripslashes( $comment1['comment_author_email'] ), 0, 93 ) == substr( $comment2['comment_author_email'], 0, 93 )\n\t\t\t\t|| substr( $comment1['comment_author_email'], 0, 93 ) == substr( stripslashes( $comment2['comment_author_email'] ), 0, 93 )\n\t\t\t\t// Very long emails can be truncated and then stripped if the [0:100] substring isn't a valid address.\n\t\t\t\t|| ( ! $comment1['comment_author_email'] && strlen( $comment2['comment_author_email'] ) > 100 )\n\t\t\t\t|| ( ! $comment2['comment_author_email'] && strlen( $comment1['comment_author_email'] ) > 100 )\n\t\t\t)\n\t\t);\n\n\t\treturn $comments_match;\n\t}\n\t\n\t// Does the supplied comment match the details of the one most recently stored in self::$last_comment?\n\tpublic static function matches_last_comment( $comment ) {\n\t\treturn self::comments_match( self::$last_comment, $comment );\n\t}\n\n\tprivate static function get_user_agent() {\n\t\treturn isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : null;\n\t}\n\n\tprivate static function get_referer() {\n\t\treturn isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : null;\n\t}\n\n\t// return a comma-separated list of role names for the given user\n\tpublic static function get_user_roles( $user_id ) {\n\t\t$roles = false;\n\n\t\tif ( !class_exists('WP_User') )\n\t\t\treturn false;\n\n\t\tif ( $user_id > 0 ) {\n\t\t\t$comment_user = new WP_User( $user_id );\n\t\t\tif ( isset( $comment_user->roles ) )\n\t\t\t\t$roles = join( ',', $comment_user->roles );\n\t\t}\n\n\t\tif ( is_multisite() && is_super_admin( $user_id ) ) {\n\t\t\tif ( empty( $roles ) ) {\n\t\t\t\t$roles = 'super_admin';\n\t\t\t} else {\n\t\t\t\t$comment_user->roles[] = 'super_admin';\n\t\t\t\t$roles = join( ',', $comment_user->roles );\n\t\t\t}\n\t\t}\n\n\t\treturn $roles;\n\t}\n\n\t// filter handler used to return a spam result to pre_comment_approved\n\tpublic static function last_comment_status( $approved, $comment ) {\n\t\tif ( is_null( self::$last_comment_result ) ) {\n\t\t\t// We didn't have reason to store the result of the last check.\n\t\t\treturn $approved;\n\t\t}\n\n\t\t// Only do this if it's the correct comment\n\t\tif ( ! self::matches_last_comment( $comment ) ) {\n\t\t\tself::log( \"comment_is_spam mismatched comment, returning unaltered $approved\" );\n\t\t\treturn $approved;\n\t\t}\n\n\t\tif ( 'trash' === $approved ) {\n\t\t\t// If the last comment we checked has had its approval set to 'trash',\n\t\t\t// then it failed the comment blacklist check. Let that blacklist override\n\t\t\t// the spam check, since users have the (valid) expectation that when\n\t\t\t// they fill out their blacklists, comments that match it will always\n\t\t\t// end up in the trash.\n\t\t\treturn $approved;\n\t\t}\n\n\t\t// bump the counter here instead of when the filter is added to reduce the possibility of overcounting\n\t\tif ( $incr = apply_filters('akismet_spam_count_incr', 1) )\n\t\t\tupdate_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr );\n\n\t\treturn self::$last_comment_result;\n\t}\n\t\n\t/**\n\t * If Akismet is temporarily unreachable, we don't want to \"spam\" the blogger with\n\t * moderation emails for comments that will be automatically cleared or spammed on\n\t * the next retry.\n\t *\n\t * For comments that will be rechecked later, empty the list of email addresses that\n\t * the moderation email would be sent to.\n\t *\n\t * @param array $emails An array of email addresses that the moderation email will be sent to.\n\t * @param int $comment_id The ID of the relevant comment.\n\t * @return array An array of email addresses that the moderation email will be sent to.\n\t */\n\tpublic static function disable_moderation_emails_if_unreachable( $emails, $comment_id ) {\n\t\tif ( ! empty( self::$prevent_moderation_email_for_these_comments ) && ! empty( $emails ) ) {\n\t\t\t$comment = get_comment( $comment_id );\n\n\t\t\tforeach ( self::$prevent_moderation_email_for_these_comments as $possible_match ) {\n\t\t\t\tif ( self::comments_match( $possible_match, $comment ) ) {\n\t\t\t\t\tupdate_comment_meta( $comment_id, 'akismet_delayed_moderation_email', true );\n\t\t\t\t\treturn array();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $emails;\n\t}\n\n\tpublic static function _cmp_time( $a, $b ) {\n\t\treturn $a['time'] > $b['time'] ? -1 : 1;\n\t}\n\n\tpublic static function _get_microtime() {\n\t\t$mtime = explode( ' ', microtime() );\n\t\treturn $mtime[1] + $mtime[0];\n\t}\n\n\t/**\n\t * Make a POST request to the Akismet API.\n\t *\n\t * @param string $request The body of the request.\n\t * @param string $path The path for the request.\n\t * @param string $ip The specific IP address to hit.\n\t * @return array A two-member array consisting of the headers and the response body, both empty in the case of a failure.\n\t */\n\tpublic static function http_post( $request, $path, $ip=null ) {\n\n\t\t$akismet_ua = sprintf( 'WordPress/%s | Akismet/%s', $GLOBALS['wp_version'], constant( 'AKISMET_VERSION' ) );\n\t\t$akismet_ua = apply_filters( 'akismet_ua', $akismet_ua );\n\n\t\t$content_length = strlen( $request );\n\n\t\t$api_key   = self::get_api_key();\n\t\t$host      = self::API_HOST;\n\n\t\tif ( !empty( $api_key ) )\n\t\t\t$host = $api_key.'.'.$host;\n\n\t\t$http_host = $host;\n\t\t// use a specific IP if provided\n\t\t// needed by Akismet_Admin::check_server_connectivity()\n\t\tif ( $ip && long2ip( ip2long( $ip ) ) ) {\n\t\t\t$http_host = $ip;\n\t\t}\n\n\t\t$http_args = array(\n\t\t\t'body' => $request,\n\t\t\t'headers' => array(\n\t\t\t\t'Content-Type' => 'application/x-www-form-urlencoded; charset=' . get_option( 'blog_charset' ),\n\t\t\t\t'Host' => $host,\n\t\t\t\t'User-Agent' => $akismet_ua,\n\t\t\t),\n\t\t\t'httpversion' => '1.0',\n\t\t\t'timeout' => 15\n\t\t);\n\n\t\t$akismet_url = $http_akismet_url = \"http://{$http_host}/1.1/{$path}\";\n\n\t\t/**\n\t\t * Try SSL first; if that fails, try without it and don't try it again for a while.\n\t\t */\n\n\t\t$ssl = $ssl_failed = false;\n\n\t\t// Check if SSL requests were disabled fewer than X hours ago.\n\t\t$ssl_disabled = get_option( 'akismet_ssl_disabled' );\n\n\t\tif ( $ssl_disabled && $ssl_disabled < ( time() - 60 * 60 * 24 ) ) { // 24 hours\n\t\t\t$ssl_disabled = false;\n\t\t\tdelete_option( 'akismet_ssl_disabled' );\n\t\t}\n\t\telse if ( $ssl_disabled ) {\n\t\t\tdo_action( 'akismet_ssl_disabled' );\n\t\t}\n\n\t\tif ( ! $ssl_disabled && ( $ssl = wp_http_supports( array( 'ssl' ) ) ) ) {\n\t\t\t$akismet_url = set_url_scheme( $akismet_url, 'https' );\n\n\t\t\tdo_action( 'akismet_https_request_pre' );\n\t\t}\n\n\t\t$response = wp_remote_post( $akismet_url, $http_args );\n\n\t\tAkismet::log( compact( 'akismet_url', 'http_args', 'response' ) );\n\n\t\tif ( $ssl && is_wp_error( $response ) ) {\n\t\t\tdo_action( 'akismet_https_request_failure', $response );\n\n\t\t\t// Intermittent connection problems may cause the first HTTPS\n\t\t\t// request to fail and subsequent HTTP requests to succeed randomly.\n\t\t\t// Retry the HTTPS request once before disabling SSL for a time.\n\t\t\t$response = wp_remote_post( $akismet_url, $http_args );\n\t\t\t\n\t\t\tAkismet::log( compact( 'akismet_url', 'http_args', 'response' ) );\n\n\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\t$ssl_failed = true;\n\n\t\t\t\tdo_action( 'akismet_https_request_failure', $response );\n\n\t\t\t\tdo_action( 'akismet_http_request_pre' );\n\n\t\t\t\t// Try the request again without SSL.\n\t\t\t\t$response = wp_remote_post( $http_akismet_url, $http_args );\n\n\t\t\t\tAkismet::log( compact( 'http_akismet_url', 'http_args', 'response' ) );\n\t\t\t}\n\t\t}\n\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\tdo_action( 'akismet_request_failure', $response );\n\n\t\t\treturn array( '', '' );\n\t\t}\n\n\t\tif ( $ssl_failed ) {\n\t\t\t// The request failed when using SSL but succeeded without it. Disable SSL for future requests.\n\t\t\tupdate_option( 'akismet_ssl_disabled', time() );\n\t\t\t\n\t\t\tdo_action( 'akismet_https_disabled' );\n\t\t}\n\t\t\n\t\t$simplified_response = array( $response['headers'], $response['body'] );\n\t\t\n\t\tself::update_alert( $simplified_response );\n\n\t\treturn $simplified_response;\n\t}\n\n\t// given a response from an API call like check_key_status(), update the alert code options if an alert is present.\n\tpublic static function update_alert( $response ) {\n\t\t$code = $msg = null;\n\t\tif ( isset( $response[0]['x-akismet-alert-code'] ) ) {\n\t\t\t$code = $response[0]['x-akismet-alert-code'];\n\t\t\t$msg  = $response[0]['x-akismet-alert-msg'];\n\t\t}\n\n\t\t// only call update_option() if the value has changed\n\t\tif ( $code != get_option( 'akismet_alert_code' ) ) {\n\t\t\tif ( ! $code ) {\n\t\t\t\tdelete_option( 'akismet_alert_code' );\n\t\t\t\tdelete_option( 'akismet_alert_msg' );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tupdate_option( 'akismet_alert_code', $code );\n\t\t\t\tupdate_option( 'akismet_alert_msg', $msg );\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static function load_form_js() {\n\t\tif ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! self::get_api_key() ) {\n\t\t\treturn;\n\t\t}\n\n\t\twp_register_script( 'akismet-form', plugin_dir_url( __FILE__ ) . '_inc/form.js', array(), AKISMET_VERSION, true );\n\t\twp_enqueue_script( 'akismet-form' );\n\t}\n\t\n\t/**\n\t * Mark form.js as async. Because nothing depends on it, it can run at any time\n\t * after it's loaded, and the browser won't have to wait for it to load to continue\n\t * parsing the rest of the page.\n\t */\n\tpublic static function set_form_js_async( $tag, $handle, $src ) {\n\t\tif ( 'akismet-form' !== $handle ) {\n\t\t\treturn $tag;\n\t\t}\n\t\t\n\t\treturn preg_replace( '/^<script /i', '<script async=\"async\" ', $tag );\n\t}\n\t\n\tpublic static function inject_ak_js( $fields ) {\n\t\techo '<p style=\"display: none;\">';\n\t\techo '<input type=\"hidden\" id=\"ak_js\" name=\"ak_js\" value=\"' . mt_rand( 0, 250 ) . '\"/>';\n\t\techo '</p>';\n\t}\n\n\tprivate static function bail_on_activation( $message, $deactivate = true ) {\n?>\n<!doctype html>\n<html>\n<head>\n<meta charset=\"<?php bloginfo( 'charset' ); ?>\" />\n<style>\n* {\n\ttext-align: center;\n\tmargin: 0;\n\tpadding: 0;\n\tfont-family: \"Lucida Grande\",Verdana,Arial,\"Bitstream Vera Sans\",sans-serif;\n}\np {\n\tmargin-top: 1em;\n\tfont-size: 18px;\n}\n</style>\n</head>\n<body>\n<p><?php echo esc_html( $message ); ?></p>\n</body>\n</html>\n<?php\n\t\tif ( $deactivate ) {\n\t\t\t$plugins = get_option( 'active_plugins' );\n\t\t\t$akismet = plugin_basename( AKISMET__PLUGIN_DIR . 'akismet.php' );\n\t\t\t$update  = false;\n\t\t\tforeach ( $plugins as $i => $plugin ) {\n\t\t\t\tif ( $plugin === $akismet ) {\n\t\t\t\t\t$plugins[$i] = false;\n\t\t\t\t\t$update = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $update ) {\n\t\t\t\tupdate_option( 'active_plugins', array_filter( $plugins ) );\n\t\t\t}\n\t\t}\n\t\texit;\n\t}\n\n\tpublic static function view( $name, array $args = array() ) {\n\t\t$args = apply_filters( 'akismet_view_arguments', $args, $name );\n\t\t\n\t\tforeach ( $args AS $key => $val ) {\n\t\t\t$$key = $val;\n\t\t}\n\t\t\n\t\tload_plugin_textdomain( 'akismet' );\n\n\t\t$file = AKISMET__PLUGIN_DIR . 'views/'. $name . '.php';\n\n\t\tinclude( $file );\n\t}\n\n\t/**\n\t * Attached to activate_{ plugin_basename( __FILES__ ) } by register_activation_hook()\n\t * @static\n\t */\n\tpublic static function plugin_activation() {\n\t\tif ( version_compare( $GLOBALS['wp_version'], AKISMET__MINIMUM_WP_VERSION, '<' ) ) {\n\t\t\tload_plugin_textdomain( 'akismet' );\n\t\t\t\n\t\t\t$message = '<strong>'.sprintf(esc_html__( 'Akismet %s requires WordPress %s or higher.' , 'akismet'), AKISMET_VERSION, AKISMET__MINIMUM_WP_VERSION ).'</strong> '.sprintf(__('Please <a href=\"%1$s\">upgrade WordPress</a> to a current version, or <a href=\"%2$s\">downgrade to version 2.4 of the Akismet plugin</a>.', 'akismet'), 'https://codex.wordpress.org/Upgrading_WordPress', 'https://wordpress.org/extend/plugins/akismet/download/');\n\n\t\t\tAkismet::bail_on_activation( $message );\n\t\t} elseif ( ! empty( $_SERVER['SCRIPT_NAME'] ) && false !== strpos( $_SERVER['SCRIPT_NAME'], '/wp-admin/plugins.php' ) ) {\n\t\t\tadd_option( 'Activated_Akismet', true );\n\t\t}\n\t}\n\n\t/**\n\t * Removes all connection options\n\t * @static\n\t */\n\tpublic static function plugin_deactivation( ) {\n\t\tself::deactivate_key( self::get_api_key() );\n\t\t\n\t\t// Remove any scheduled cron jobs.\n\t\t$akismet_cron_events = array(\n\t\t\t'akismet_schedule_cron_recheck',\n\t\t\t'akismet_scheduled_delete',\n\t\t);\n\t\t\n\t\tforeach ( $akismet_cron_events as $akismet_cron_event ) {\n\t\t\t$timestamp = wp_next_scheduled( $akismet_cron_event );\n\t\t\t\n\t\t\tif ( $timestamp ) {\n\t\t\t\twp_unschedule_event( $timestamp, $akismet_cron_event );\n\t\t\t}\n\t\t}\n\t}\n\t\n\t/**\n\t * Essentially a copy of WP's build_query but one that doesn't expect pre-urlencoded values.\n\t *\n\t * @param array $args An array of key => value pairs\n\t * @return string A string ready for use as a URL query string.\n\t */\n\tpublic static function build_query( $args ) {\n\t\treturn _http_build_query( $args, '', '&' );\n\t}\n\n\t/**\n\t * Log debugging info to the error log.\n\t *\n\t * Enabled when WP_DEBUG_LOG is enabled (and WP_DEBUG, since according to\n\t * core, \"WP_DEBUG_DISPLAY and WP_DEBUG_LOG perform no function unless\n\t * WP_DEBUG is true), but can be disabled via the akismet_debug_log filter.\n\t *\n\t * @param mixed $akismet_debug The data to log.\n\t */\n\tpublic static function log( $akismet_debug ) {\n\t\tif ( apply_filters( 'akismet_debug_log', defined( 'WP_DEBUG' ) && WP_DEBUG && defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG && defined( 'AKISMET_DEBUG' ) && AKISMET_DEBUG ) ) {\n\t\t\terror_log( print_r( compact( 'akismet_debug' ), true ) );\n\t\t}\n\t}\n\n\tpublic static function pre_check_pingback( $method ) {\n\t\tif ( $method !== 'pingback.ping' )\n\t\t\treturn;\n\n\t\tglobal $wp_xmlrpc_server;\n\t\n\t\tif ( !is_object( $wp_xmlrpc_server ) )\n\t\t\treturn false;\n\t\n\t\t// Lame: tightly coupled with the IXR class.\n\t\t$args = $wp_xmlrpc_server->message->params;\n\t\n\t\tif ( !empty( $args[1] ) ) {\n\t\t\t$post_id = url_to_postid( $args[1] );\n\n\t\t\t// If pingbacks aren't open on this post, we'll still check whether this request is part of a potential DDOS,\n\t\t\t// but indicate to the server that pingbacks are indeed closed so we don't include this request in the user's stats,\n\t\t\t// since the user has already done their part by disabling pingbacks.\n\t\t\t$pingbacks_closed = false;\n\t\t\t\n\t\t\t$post = get_post( $post_id );\n\t\t\t\n\t\t\tif ( ! $post || ! pings_open( $post ) ) {\n\t\t\t\t$pingbacks_closed = true;\n\t\t\t}\n\n\t\t\t$comment = array(\n\t\t\t\t'comment_author_url' => $args[0],\n\t\t\t\t'comment_post_ID' => $post_id,\n\t\t\t\t'comment_author' => '',\n\t\t\t\t'comment_author_email' => '',\n\t\t\t\t'comment_content' => '',\n\t\t\t\t'comment_type' => 'pingback',\n\t\t\t\t'akismet_pre_check' => '1',\n\t\t\t\t'comment_pingback_target' => $args[1],\n\t\t\t\t'pingbacks_closed' => $pingbacks_closed ? '1' : '0',\n\t\t\t);\n\n\t\t\t$comment = Akismet::auto_check_comment( $comment );\n\n\t\t\tif ( isset( $comment['akismet_result'] ) && 'true' == $comment['akismet_result'] ) {\n\t\t\t\t// Lame: tightly coupled with the IXR classes. Unfortunately the action provides no context and no way to return anything.\n\t\t\t\t$wp_xmlrpc_server->error( new IXR_Error( 0, 'Invalid discovery target' ) );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Ensure that we are loading expected scalar values from akismet_as_submitted commentmeta.\n\t *\n\t * @param mixed $meta_value\n\t * @return mixed\n\t */\n\tprivate static function sanitize_comment_as_submitted( $meta_value ) {\n\t\tif ( empty( $meta_value ) ) {\n\t\t\treturn $meta_value;\n\t\t}\n\n\t\t$meta_value = (array) $meta_value;\n\n\t\tforeach ( $meta_value as $key => $value ) {\n\t\t\tif ( ! isset( self::$comment_as_submitted_allowed_keys[$key] ) || ! is_scalar( $value ) ) {\n\t\t\t\tunset( $meta_value[$key] );\n\t\t\t}\n\t\t}\n\n\t\treturn $meta_value;\n\t}\n\t\n\tpublic static function predefined_api_key() {\n\t\tif ( defined( 'WPCOM_API_KEY' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn apply_filters( 'akismet_predefined_api_key', false );\n\t}\n\n\t/**\n\t * Controls the display of a privacy related notice underneath the comment form using the `akismet_comment_form_privacy_notice` option and filter respectively.\n\t * Default is top not display the notice, leaving the choice to site admins, or integrators.\n\t */\n\tpublic static function display_comment_form_privacy_notice() {\n\t\tif ( 'display' !== apply_filters( 'akismet_comment_form_privacy_notice', get_option( 'akismet_comment_form_privacy_notice', 'hide' ) ) ) {\n\t\t\treturn;\n\t\t}\n\t\techo apply_filters(\n\t\t\t'akismet_comment_form_privacy_notice_markup',\n\t\t\t'<p class=\"akismet_comment_form_privacy_notice\">' . sprintf(\n\t\t\t\t__( 'This site uses Akismet to reduce spam. <a href=\"%s\" target=\"_blank\" rel=\"nofollow noopener\">Learn how your comment data is processed</a>.', 'akismet' ),\n\t\t\t\t'https://akismet.com/privacy/'\n\t\t\t) . '</p>'\n\t\t);\n\t}\n}\n", "num_lines": 1506}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n# Silence is golden.", "num_lines": 2}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nglobal $wpcom_api_key, $akismet_api_host, $akismet_api_port;\n\n$wpcom_api_key    = defined( 'WPCOM_API_KEY' ) ? constant( 'WPCOM_API_KEY' ) : '';\n$akismet_api_host = Akismet::get_api_key() . '.rest.akismet.com';\n$akismet_api_port = 80;\n\nfunction akismet_test_mode() {\n\treturn Akismet::is_test_mode();\n}\n\nfunction akismet_http_post( $request, $host, $path, $port = 80, $ip = null ) {\n\t$path = str_replace( '/1.1/', '', $path );\n\n\treturn Akismet::http_post( $request, $path, $ip ); \n}\n\nfunction akismet_microtime() {\n\treturn Akismet::_get_microtime();\n}\n\nfunction akismet_delete_old() {\n\treturn Akismet::delete_old_comments();\n}\n\nfunction akismet_delete_old_metadata() { \n\treturn Akismet::delete_old_comments_meta();\n}\n\nfunction akismet_check_db_comment( $id, $recheck_reason = 'recheck_queue' ) {\n   \treturn Akismet::check_db_comment( $id, $recheck_reason );\n}\n\nfunction akismet_rightnow() {\n\tif ( !class_exists( 'Akismet_Admin' ) )\n\t\treturn false;\n   \n   \treturn Akismet_Admin::rightnow_stats();\n}\n\nfunction akismet_admin_init() {\n\t_deprecated_function( __FUNCTION__, '3.0' );\n}\nfunction akismet_version_warning() {\n\t_deprecated_function( __FUNCTION__, '3.0' );\n}\nfunction akismet_load_js_and_css() {\n\t_deprecated_function( __FUNCTION__, '3.0' );\n}\nfunction akismet_nonce_field( $action = -1 ) {\n\treturn wp_nonce_field( $action );\n}\nfunction akismet_plugin_action_links( $links, $file ) {\n\treturn Akismet_Admin::plugin_action_links( $links, $file );\n}\nfunction akismet_conf() {\n\t_deprecated_function( __FUNCTION__, '3.0' );\n}\nfunction akismet_stats_display() {\n\t_deprecated_function( __FUNCTION__, '3.0' );\n}\nfunction akismet_stats() {\n\treturn Akismet_Admin::dashboard_stats();\n}\nfunction akismet_admin_warnings() {\n\t_deprecated_function( __FUNCTION__, '3.0' );\n}\nfunction akismet_comment_row_action( $a, $comment ) {\n\treturn Akismet_Admin::comment_row_actions( $a, $comment );\n}\nfunction akismet_comment_status_meta_box( $comment ) {\n\treturn Akismet_Admin::comment_status_meta_box( $comment );\n}\nfunction akismet_comments_columns( $columns ) {\n\t_deprecated_function( __FUNCTION__, '3.0' );\n\n\treturn $columns;\n}\nfunction akismet_comment_column_row( $column, $comment_id ) {\n\t_deprecated_function( __FUNCTION__, '3.0' );\n}\nfunction akismet_text_add_link_callback( $m ) {\n\treturn Akismet_Admin::text_add_link_callback( $m );\n}\nfunction akismet_text_add_link_class( $comment_text ) {\n\treturn Akismet_Admin::text_add_link_class( $comment_text );\n}\nfunction akismet_check_for_spam_button( $comment_status ) {\n\treturn Akismet_Admin::check_for_spam_button( $comment_status );\n}\nfunction akismet_submit_nonspam_comment( $comment_id ) {\n\treturn Akismet::submit_nonspam_comment( $comment_id );\n}\nfunction akismet_submit_spam_comment( $comment_id ) {\n\treturn Akismet::submit_spam_comment( $comment_id );\n}\nfunction akismet_transition_comment_status( $new_status, $old_status, $comment ) {\n\treturn Akismet::transition_comment_status( $new_status, $old_status, $comment );\n}\nfunction akismet_spam_count( $type = false ) {\n\treturn Akismet_Admin::get_spam_count( $type );\n}\nfunction akismet_recheck_queue() {\n\treturn Akismet_Admin::recheck_queue();\n}\nfunction akismet_remove_comment_author_url() {\n\treturn Akismet_Admin::remove_comment_author_url();\n}\nfunction akismet_add_comment_author_url() {\n\treturn Akismet_Admin::add_comment_author_url();\n}\nfunction akismet_check_server_connectivity() {\n\treturn Akismet_Admin::check_server_connectivity();\n}\nfunction akismet_get_server_connectivity( $cache_timeout = 86400 ) {\n\treturn Akismet_Admin::get_server_connectivity( $cache_timeout );\n}\nfunction akismet_server_connectivity_ok() {\n\t_deprecated_function( __FUNCTION__, '3.0' );\n\n\treturn true;\n}\nfunction akismet_admin_menu() {\n\treturn Akismet_Admin::admin_menu();\n}\nfunction akismet_load_menu() {\n\treturn Akismet_Admin::load_menu();\n}\nfunction akismet_init() {\n\t_deprecated_function( __FUNCTION__, '3.0' );\n}\nfunction akismet_get_key() {\n\treturn Akismet::get_api_key();\n}\nfunction akismet_check_key_status( $key, $ip = null ) {\n\treturn Akismet::check_key_status( $key, $ip );\n}\nfunction akismet_update_alert( $response ) {\n\treturn Akismet::update_alert( $response );\n}\nfunction akismet_verify_key( $key, $ip = null ) {\n\treturn Akismet::verify_key( $key, $ip );\n}\nfunction akismet_get_user_roles( $user_id ) {\n\treturn Akismet::get_user_roles( $user_id );\n}\nfunction akismet_result_spam( $approved ) {\n\treturn Akismet::comment_is_spam( $approved );\n}\nfunction akismet_result_hold( $approved ) {\n\treturn Akismet::comment_needs_moderation( $approved );\n}\nfunction akismet_get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) {\n\treturn Akismet::get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url );\n}\nfunction akismet_update_comment_history( $comment_id, $message, $event = null ) {\n\treturn Akismet::update_comment_history( $comment_id, $message, $event );\n}\nfunction akismet_get_comment_history( $comment_id ) {\n\treturn Akismet::get_comment_history( $comment_id );\n}\nfunction akismet_cmp_time( $a, $b ) {\n\treturn Akismet::_cmp_time( $a, $b );\n}\nfunction akismet_auto_check_update_meta( $id, $comment ) {\n\treturn Akismet::auto_check_update_meta( $id, $comment );\n}\nfunction akismet_auto_check_comment( $commentdata ) {\n\treturn Akismet::auto_check_comment( $commentdata );\n}\nfunction akismet_get_ip_address() {\n\treturn Akismet::get_ip_address();\n}\nfunction akismet_cron_recheck() {\n\treturn Akismet::cron_recheck();\n}\nfunction akismet_add_comment_nonce( $post_id ) {\n\treturn Akismet::add_comment_nonce( $post_id );\n}\nfunction akismet_fix_scheduled_recheck() {\n\treturn Akismet::fix_scheduled_recheck();\n}\nfunction akismet_spam_comments() {\n\t_deprecated_function( __FUNCTION__, '3.0' );\n\n\treturn array();\n}\nfunction akismet_spam_totals() {\n\t_deprecated_function( __FUNCTION__, '3.0' );\n\n\treturn array();\n}\nfunction akismet_manage_page() {\n\t_deprecated_function( __FUNCTION__, '3.0' );\n}\nfunction akismet_caught() {\n\t_deprecated_function( __FUNCTION__, '3.0' );\n}\nfunction redirect_old_akismet_urls() {\n\t_deprecated_function( __FUNCTION__, '3.0' );\n}\nfunction akismet_kill_proxy_check( $option ) {\n\t_deprecated_function( __FUNCTION__, '3.0' );\n\n\treturn 0;\n}\nfunction akismet_pingback_forwarded_for( $r, $url ) {\n\t// This functionality is now in core.\n\treturn false;\n}\nfunction akismet_pre_check_pingback( $method ) {\n\treturn Akismet::pre_check_pingback( $method );\n}", "num_lines": 214}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<div class=\"akismet-box\">\n\t<?php Akismet::view( 'title' ); ?>\n\t<?php Akismet::view( 'setup' );?>\n</div>\n<br/>\n<div class=\"akismet-box\">\n\t<?php Akismet::view( 'enter' );?>\n</div>", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<div id=\"akismet-plugin-container\">\n\t<div class=\"akismet-masthead\">\n\t\t<div class=\"akismet-masthead__inside-container\">\n\t\t\t<div class=\"akismet-masthead__logo-container\">\n\t\t\t\t<img class=\"akismet-masthead__logo\" src=\"<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>\" alt=\"Akismet\" />\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class=\"akismet-lower\">\n\t\t<?php if ( Akismet::get_api_key() ) { ?>\n\t\t\t<?php Akismet_Admin::display_status(); ?>\n\t\t<?php } ?>\n\t\t<?php if ( ! empty( $notices ) ) { ?>\n\t\t\t<?php foreach ( $notices as $notice ) { ?>\n\t\t\t\t<?php Akismet::view( 'notice', $notice ); ?>\n\t\t\t<?php } ?>\n\t\t<?php } ?>\n\t\t<?php if ( $stat_totals && isset( $stat_totals['all'] ) && (int) $stat_totals['all']->spam > 0 ) : ?>\n\t\t\t<div class=\"akismet-card\">\n\t\t\t\t<div class=\"akismet-section-header\">\n\t\t\t\t\t<div class=\"akismet-section-header__label\">\n\t\t\t\t\t\t<span><?php esc_html_e( 'Statistics' , 'akismet'); ?></span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"akismet-section-header__actions\">\n\t\t\t\t\t\t<a href=\"<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>\">\n\t\t\t\t\t\t\t<?php esc_html_e( 'Detailed Stats' , 'akismet');?>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div class=\"akismet-new-snapshot\">\n\t\t\t\t\t<iframe allowtransparency=\"true\" scrolling=\"no\" frameborder=\"0\" style=\"width: 100%; height: 220px; overflow: hidden;\" src=\"<?php printf( '//akismet.com/web/1.0/snapshot.php?blog=%s&api_key=%s&height=200&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() );?>\"></iframe>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>\n\t\t\t\t\t\t\t<span><?php echo number_format( $stat_totals['6-months']->spam );?></span>\n\t\t\t\t\t\t\t<?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['6-months']->spam, 'akismet' ) ); ?>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<h3><?php esc_html_e( 'All time' , 'akismet');?></h3>\n\t\t\t\t\t\t\t<span><?php echo number_format( $stat_totals['all']->spam );?></span>\n\t\t\t\t\t\t\t<?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['all']->spam, 'akismet' ) ); ?>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<h3><?php esc_html_e( 'Accuracy' , 'akismet');?></h3>\n\t\t\t\t\t\t\t<span><?php echo floatval( $stat_totals['all']->accuracy ); ?>%</span>\n\t\t\t\t\t\t\t<?php printf( _n( '%s missed spam', '%s missed spam', $stat_totals['all']->missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ); ?>\n\t\t\t\t\t\t\t|\n\t\t\t\t\t\t\t<?php printf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ); ?>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<?php endif;?>\n\n\t\t<?php if ( $akismet_user ):?>\n\t\t\t<div class=\"akismet-card\">\n\t\t\t\t<div class=\"akismet-section-header\">\n\t\t\t\t\t<div class=\"akismet-section-header__label\">\n\t\t\t\t\t\t<span><?php esc_html_e( 'Settings' , 'akismet'); ?></span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"inside\">\n\t\t\t\t\t<form action=\"<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>\" method=\"POST\">\n\t\t\t\t\t\t<table cellspacing=\"0\" class=\"akismet-settings\">\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<?php if ( ! Akismet::predefined_api_key() ) { ?>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th class=\"akismet-api-key\" width=\"10%\" align=\"left\" scope=\"row\"><?php esc_html_e('API Key', 'akismet');?></th>\n\t\t\t\t\t\t\t\t\t<td width=\"5%\"/>\n\t\t\t\t\t\t\t\t\t<td align=\"left\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"api-key\"><input id=\"key\" name=\"key\" type=\"text\" size=\"15\" value=\"<?php echo esc_attr( get_option('wordpress_api_key') ); ?>\" class=\"<?php echo esc_attr( 'regular-text code ' . $akismet_user->status ); ?>\"></span>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t<?php if ( isset( $_GET['ssl_status'] ) ) { ?>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<th align=\"left\" scope=\"row\"><?php esc_html_e( 'SSL Status', 'akismet' ); ?></th>\n\t\t\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t\t\t<td align=\"left\">\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t\t\t\t\t\t\tif ( ! wp_http_supports( array( 'ssl' ) ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t?><b><?php esc_html_e( 'Disabled.', 'akismet' ); ?></b> <?php esc_html_e( 'Your Web server cannot make SSL requests; contact your Web host and ask them to add support for SSL requests.', 'akismet' ); ?><?php\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ssl_disabled = get_option( 'akismet_ssl_disabled' );\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( $ssl_disabled ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t?><b><?php esc_html_e( 'Temporarily disabled.', 'akismet' ); ?></b> <?php esc_html_e( 'Akismet encountered a problem with a previous SSL request and disabled it temporarily. It will begin using SSL for requests again shortly.', 'akismet' ); ?><?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t?><b><?php esc_html_e( 'Enabled.', 'akismet' ); ?></b> <?php esc_html_e( 'All systems functional.', 'akismet' ); ?><?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th align=\"left\" scope=\"row\"><?php esc_html_e('Comments', 'akismet');?></th>\n\t\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t\t<td align=\"left\">\n\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t<label for=\"akismet_show_user_comments_approved\" title=\"<?php esc_attr_e( 'Show approved comments' , 'akismet'); ?>\">\n\t\t\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\t\t\tname=\"akismet_show_user_comments_approved\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tid=\"akismet_show_user_comments_approved\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue=\"1\"\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t// If the option isn't set, or if it's enabled ('1'), or if it was enabled a long time ago ('true'), check the checkbox.\n\t\t\t\t\t\t\t\t\t\t\t\t\tchecked( true, ( in_array( get_option( 'akismet_show_user_comments_approved' ), array( false, '1', 'true' ), true ) ) );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Show the number of approved comments beside each comment author', 'akismet' ); ?>\n\t\t\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th class=\"strictness\" align=\"left\" scope=\"row\"><?php esc_html_e('Strictness', 'akismet'); ?></th>\n\t\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t\t<td align=\"left\">\n\t\t\t\t\t\t\t\t\t\t<fieldset><legend class=\"screen-reader-text\"><span><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></span></legend>\n\t\t\t\t\t\t\t\t\t\t<p><label for=\"akismet_strictness_1\"><input type=\"radio\" name=\"akismet_strictness\" id=\"akismet_strictness_1\" value=\"1\" <?php checked('1', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Silently discard the worst and most pervasive spam so I never see it.', 'akismet'); ?></label></p>\n\t\t\t\t\t\t\t\t\t\t<p><label for=\"akismet_strictness_0\"><input type=\"radio\" name=\"akismet_strictness\" id=\"akismet_strictness_0\" value=\"0\" <?php checked('0', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Always put spam in the Spam folder for review.', 'akismet'); ?></label></p>\n\t\t\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t\t\t\t<span class=\"akismet-note\"><strong><?php esc_html_e('Note:', 'akismet');?></strong>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$delete_interval = max( 1, intval( apply_filters( 'akismet_delete_comment_interval', 15 ) ) );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t\t\t'Spam in the <a href=\"%1$s\">spam folder</a> older than 1 day is deleted automatically.',\n\t\t\t\t\t\t\t\t\t\t\t\t'Spam in the <a href=\"%1$s\">spam folder</a> older than %2$d days is deleted automatically.',\n\t\t\t\t\t\t\t\t\t\t\t\t$delete_interval,\n\t\t\t\t\t\t\t\t\t\t\t\t'akismet'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tadmin_url( 'edit-comments.php?comment_status=spam' ),\n\t\t\t\t\t\t\t\t\t\t\t$delete_interval\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\t?>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th class=\"comment-form-privacy-notice\" align=\"left\" scope=\"row\"><?php esc_html_e('Privacy', 'akismet'); ?></th>\n\t\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t\t<td align=\"left\">\n\t\t\t\t\t\t\t\t\t\t<fieldset><legend class=\"screen-reader-text\"><span><?php esc_html_e('Akismet privacy notice', 'akismet'); ?></span></legend>\n\t\t\t\t\t\t\t\t\t\t<p><label for=\"akismet_comment_form_privacy_notice_display\"><input type=\"radio\" name=\"akismet_comment_form_privacy_notice\" id=\"akismet_comment_form_privacy_notice_display\" value=\"display\" <?php checked('display', get_option('akismet_comment_form_privacy_notice')); ?> /> <?php esc_html_e('Display a privacy notice under your comment forms.', 'akismet'); ?></label></p>\n\t\t\t\t\t\t\t\t\t\t<p><label for=\"akismet_comment_form_privacy_notice_hide\"><input type=\"radio\" name=\"akismet_comment_form_privacy_notice\" id=\"akismet_comment_form_privacy_notice_hide\" value=\"hide\" <?php echo in_array( get_option('akismet_comment_form_privacy_notice'), array('display', 'hide') ) ? checked('hide', get_option('akismet_comment_form_privacy_notice'), false) : 'checked=\"checked\"'; ?> /> <?php esc_html_e('Do not display privacy notice.', 'akismet'); ?></label></p>\n\t\t\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t\t\t\t<span class=\"akismet-note\"><?php esc_html_e( 'To help your site with transparency under privacy laws like the GDPR, Akismet can display a notice to your users under your comment forms. This feature is disabled by default, however, you can turn it on above.', 'akismet' );?></span>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<div class=\"akismet-card-actions\">\n\t\t\t\t\t\t\t<?php if ( ! Akismet::predefined_api_key() ) { ?>\n\t\t\t\t\t\t\t<div id=\"delete-action\">\n\t\t\t\t\t\t\t\t<a class=\"submitdelete deletion\" href=\"<?php echo esc_url( Akismet_Admin::get_page_url( 'delete_key' ) ); ?>\"><?php esc_html_e('Disconnect this account', 'akismet'); ?></a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t<?php wp_nonce_field(Akismet_Admin::NONCE) ?>\n\t\t\t\t\t\t\t<div id=\"publishing-action\">\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"enter-key\">\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"submit\" id=\"submit\" class=\"akismet-button akismet-could-be-primary\" value=\"<?php esc_attr_e('Save Changes', 'akismet');?>\">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\n\t\t\t<?php if ( ! Akismet::predefined_api_key() ) { ?>\n\t\t\t\t<div class=\"akismet-card\">\n\t\t\t\t\t<div class=\"akismet-section-header\">\n\t\t\t\t\t\t<div class=\"akismet-section-header__label\">\n\t\t\t\t\t\t\t<span><?php esc_html_e( 'Account' , 'akismet'); ?></span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t\t<div class=\"inside\">\n\t\t\t\t\t\t<table cellspacing=\"0\" border=\"0\" class=\"akismet-settings\">\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th scope=\"row\" align=\"left\"><?php esc_html_e( 'Subscription Type' , 'akismet');?></th>\n\t\t\t\t\t\t\t\t\t<td width=\"5%\"/>\n\t\t\t\t\t\t\t\t\t<td align=\"left\">\n\t\t\t\t\t\t\t\t\t\t<p><?php echo esc_html( $akismet_user->account_name ); ?></p>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th scope=\"row\" align=\"left\"><?php esc_html_e( 'Status' , 'akismet');?></th>\n\t\t\t\t\t\t\t\t\t<td width=\"5%\"/>\n\t\t\t\t\t\t\t\t\t<td align=\"left\">\n\t\t\t\t\t\t\t\t\t\t<p><?php \n\t\t\t\t\t\t\t\t\t\t\tif ( 'cancelled' == $akismet_user->status ) :\n\t\t\t\t\t\t\t\t\t\t\t\tesc_html_e( 'Cancelled', 'akismet' ); \n\t\t\t\t\t\t\t\t\t\t\telseif ( 'suspended' == $akismet_user->status ) :\n\t\t\t\t\t\t\t\t\t\t\t\tesc_html_e( 'Suspended', 'akismet' );\n\t\t\t\t\t\t\t\t\t\t\telseif ( 'missing' == $akismet_user->status ) :\n\t\t\t\t\t\t\t\t\t\t\t\tesc_html_e( 'Missing', 'akismet' ); \n\t\t\t\t\t\t\t\t\t\t\telseif ( 'no-sub' == $akismet_user->status ) :\n\t\t\t\t\t\t\t\t\t\t\t\tesc_html_e( 'No Subscription Found', 'akismet' );\n\t\t\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t\t\tesc_html_e( 'Active', 'akismet' );  \n\t\t\t\t\t\t\t\t\t\t\tendif; ?></p>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<?php if ( $akismet_user->next_billing_date ) : ?>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th scope=\"row\" align=\"left\"><?php esc_html_e( 'Next Billing Date' , 'akismet');?></th>\n\t\t\t\t\t\t\t\t\t<td width=\"5%\"/>\n\t\t\t\t\t\t\t\t\t<td align=\"left\">\n\t\t\t\t\t\t\t\t\t\t<p><?php echo date( 'F j, Y', $akismet_user->next_billing_date ); ?></p>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<div class=\"akismet-card-actions\">\n\t\t\t\t\t\t\t<div id=\"publishing-action\">\n\t\t\t\t\t\t\t\t<?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' && $akismet_user->status == 'active' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t<?php } ?>\n\t\t<?php endif;?>\n\t</div>\n</div>\n", "num_lines": 243}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n//phpcs:disable VariableAnalysis\n// There are \"undefined\" variables here because they're defined in the code that includes this file as a template.\n\n?>\n<div class=\"akismet-box\">\n\t<?php Akismet::view( 'title' ); ?>\n\t<div class=\"akismet-jp-connect\">\n\t\t<h3><?php esc_html_e( 'Connect with Jetpack', 'akismet' ); ?></h3><?php\n\t\tif ( in_array( $akismet_user->status, array( 'no-sub', 'missing' ) ) ) {?>\n\t\t<p><?php esc_html_e( 'Use your Jetpack connection to set up Akismet.', 'akismet' ); ?></p>\n\t\t<form name=\"akismet_activate\" id=\"akismet_activate\" action=\"https://akismet.com/get/\" method=\"post\" class=\"akismet-right\" target=\"_blank\">\n\t\t\t<input type=\"hidden\" name=\"passback_url\" value=\"<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>\"/>\n\t\t\t<input type=\"hidden\" name=\"blog\" value=\"<?php echo esc_url( get_option( 'home' ) ); ?>\"/>\n\t\t\t<input type=\"hidden\" name=\"auto-connect\" value=\"<?php echo esc_attr( $akismet_user->ID ); ?>\"/>\n\t\t\t<input type=\"hidden\" name=\"redirect\" value=\"plugin-signup\"/>\n\t\t\t<input type=\"submit\" class=\"akismet-button akismet-is-primary\" value=\"<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>\"/>\n\t\t</form>\n\t\t<?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>\n\t\t<p><?php\n\t\t\t/* translators: %s is the WordPress.com username */\n            echo sprintf( esc_html( __( 'You are connected as %s.', 'akismet' ) ), '<b>' . esc_html( $akismet_user->user_login ) . '</b>' ); ?><br /><span class=\"akismet-jetpack-email\"><?php echo esc_html( $akismet_user->user_email ); ?></span></p>\n\t\t<?php } elseif ( $akismet_user->status == 'cancelled' ) { ?>\n\t\t<p><?php esc_html_e( 'Use your Jetpack connection to set up Akismet.', 'akismet' ); ?></p>\n\t\t<form name=\"akismet_activate\" id=\"akismet_activate\" action=\"https://akismet.com/get/\" method=\"post\" class=\"akismet-right\" target=\"_blank\">\n\t\t\t<input type=\"hidden\" name=\"passback_url\" value=\"<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>\"/>\n\t\t\t<input type=\"hidden\" name=\"blog\" value=\"<?php echo esc_url( get_option( 'home' ) ); ?>\"/>\n\t\t\t<input type=\"hidden\" name=\"user_id\" value=\"<?php echo esc_attr( $akismet_user->ID ); ?>\"/>\n\t\t\t<input type=\"hidden\" name=\"redirect\" value=\"upgrade\"/>\n\t\t\t<input type=\"submit\" class=\"akismet-button akismet-is-primary\" value=\"<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>\"/>\n\t\t</form>\n\t\t<?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>\n\t\t<p><?php\n\t\t\t/* translators: %s is the WordPress.com email address */\n            echo esc_html( sprintf( __( 'Your subscription for %s is cancelled.' , 'akismet' ), $akismet_user->user_email ) ); ?><br /><span class=\"akismet-jetpack-email\"><?php echo esc_html( $akismet_user->user_email ); ?></span></p>\n\t\t<?php } elseif ( $akismet_user->status == 'suspended' ) { ?>\n\t\t<div class=\"akismet-right\">\n\t\t\t<p><a href=\"https://akismet.com/contact\" class=\"akismet-button akismet-is-primary\"><?php esc_html_e( 'Contact Akismet support' , 'akismet' ); ?></a></p>\n\t\t</div>\t\t\n\t\t<p>\n\t\t\t<span class=\"akismet-alert-text\"><?php\n\t\t\t\t/* translators: %s is the WordPress.com email address */\n                echo esc_html( sprintf( __( 'Your subscription for %s is suspended.' , 'akismet' ), $akismet_user->user_email ) ); ?></span>\n\t\t\t<?php esc_html_e( 'No worries! Get in touch and we&#8217;ll sort this out.', 'akismet' ); ?>\n\t\t</p>\n\t\t<?php } else { // ask do they want to use akismet account found using jetpack wpcom connection ?>\t\t\t\n\t\t<p><?php esc_html_e( 'Use your Jetpack connection to set up Akismet.', 'akismet' ); ?></p>\n\t\t<form name=\"akismet_use_wpcom_key\" action=\"<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>\" method=\"post\" id=\"akismet-activate\" class=\"akismet-right\">\n\t\t\t<input type=\"hidden\" name=\"key\" value=\"<?php echo esc_attr( $akismet_user->api_key );?>\"/>\n\t\t\t<input type=\"hidden\" name=\"action\" value=\"enter-key\">\n\t\t\t<?php wp_nonce_field( Akismet_Admin::NONCE ) ?>\n\t\t\t<input type=\"submit\" class=\"akismet-button akismet-is-primary\" value=\"<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>\"/>\n\t\t</form>\n\t\t<?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>\n\t\t<p><?php\n\t\t\t/* translators: %s is the WordPress.com username */\n            echo sprintf( esc_html( __( 'You are connected as %s.', 'akismet' ) ), '<b>' . esc_html( $akismet_user->user_login ) . '</b>' ); ?><br /><span class=\"akismet-jetpack-email\"><?php echo esc_html( $akismet_user->user_email ); ?></span></p>\n\t\t<?php }\t?>\n\t</div>\n\t<div class=\"akismet-ak-connect\">\n\t\t<?php Akismet::view( 'setup' );?>\n\t</div>\n\t<div class=\"centered akismet-toggles\">\n\t\t<a href=\"#\" class=\"toggle-jp-connect\"><?php esc_html_e( 'Connect with Jetpack' ); ?></a>\n\t\t<a href=\"#\" class=\"toggle-ak-connect\"><?php esc_html_e( 'Set up a different account' ); ?></a>\n\t</div>\n</div>\n<br/>\n<div class=\"akismet-box\">\n\t<?php Akismet::view( 'enter' );?>\n</div>", "num_lines": 72}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<div class=\"akismet-enter-api-key-box centered\">\n\t<a href=\"#\"><?php esc_html_e( 'Manually enter an API key' ); ?></a>\n\t<div class=\"enter-api-key\">\n\t\t<form action=\"<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>\" method=\"post\">\n\t\t\t<?php wp_nonce_field( Akismet_Admin::NONCE ) ?>\n\t\t\t<input type=\"hidden\" name=\"action\" value=\"enter-key\">\n\t\t\t<p style=\"width: 100%; display: flex; flex-wrap: nowrap; box-sizing: border-box;\">\n\t\t\t\t<input id=\"key\" name=\"key\" type=\"text\" size=\"15\" value=\"\" placeholder=\"<?php esc_attr_e( 'Enter your API key' , 'akismet' ); ?>\" class=\"regular-text code\" style=\"flex-grow: 1; margin-right: 1rem;\">\n\t\t\t\t<input type=\"submit\" name=\"submit\" id=\"submit\" class=\"akismet-button\" value=\"<?php esc_attr_e( 'Connect with API key', 'akismet' );?>\">\n\t\t\t</p>\n\t\t</form>\n\t</div>\n</div>", "num_lines": 13}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n//phpcs:disable VariableAnalysis\n// There are \"undefined\" variables here because they're defined in the code that includes this file as a template.\n\n?>\n<form name=\"akismet_activate\" action=\"https://akismet.com/get/\" method=\"POST\" target=\"_blank\">\n\t<input type=\"hidden\" name=\"passback_url\" value=\"<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>\"/>\n\t<input type=\"hidden\" name=\"blog\" value=\"<?php echo esc_url( get_option( 'home' ) ); ?>\"/>\n\t<input type=\"hidden\" name=\"redirect\" value=\"<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>\"/>\n\t<input type=\"submit\" class=\"<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'akismet-button';?>\" value=\"<?php echo esc_attr( $text ); ?>\"/>\n</form>", "num_lines": 12}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n//phpcs:disable VariableAnalysis\n// There are \"undefined\" variables here because they're defined in the code that includes this file as a template.\n\n?>\n<?php if ( $type == 'plugin' ) :?>\n<div class=\"updated\" id=\"akismet_setup_prompt\">\n\t<form name=\"akismet_activate\" action=\"<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>\" method=\"POST\">\n\t\t<div class=\"akismet_activate\">\n\t\t\t<div class=\"aa_a\">A</div>\n\t\t\t<div class=\"aa_button_container\">\n\t\t\t\t<div class=\"aa_button_border\">\n\t\t\t\t\t<input type=\"submit\" class=\"aa_button\" value=\"<?php esc_attr_e( 'Set up your Akismet account', 'akismet' ); ?>\" />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"aa_description\"><?php _e('<strong>Almost done</strong> - configure Akismet and say goodbye to spam', 'akismet');?></div>\n\t\t</div>\n\t</form>\n</div>\n<?php elseif ( $type == 'spam-check' ) :?>\n<div class=\"notice notice-warning\">\n\t<p><strong><?php esc_html_e( 'Akismet has detected a problem.', 'akismet' );?></strong></p>\n\t<p><?php esc_html_e( 'Some comments have not yet been checked for spam by Akismet. They have been temporarily held for moderation and will automatically be rechecked later.', 'akismet' ); ?></p>\n\t<?php if ( $link_text ) { ?>\n\t\t<p><?php echo $link_text; ?></p>\n\t<?php } ?>\n</div>\n<?php elseif ( $type == 'alert' ) :?>\n<div class='error'>\n\t<p><strong><?php printf( esc_html__( 'Akismet Error Code: %s', 'akismet' ), $code ); ?></strong></p>\n\t<p><?php echo esc_html( $msg ); ?></p>\n\t<p><?php\n\n\t/* translators: the placeholder is a clickable URL that leads to more information regarding an error code. */\n\tprintf( esc_html__( 'For more information: %s' , 'akismet'), '<a href=\"https://akismet.com/errors/' . $code . '\">https://akismet.com/errors/' . $code . '</a>' );\n\n\t?>\n\t</p>\n</div>\n<?php elseif ( $type == 'notice' ) :?>\n<div class=\"akismet-alert akismet-critical\">\n\t<h3 class=\"akismet-key-status failed\"><?php echo $notice_header; ?></h3>\n\t<p class=\"akismet-description\">\n\t\t<?php echo $notice_text; ?>\n\t</p>\n</div>\n<?php elseif ( $type == 'missing-functions' ) :?>\n<div class=\"akismet-alert akismet-critical\">\n\t<h3 class=\"akismet-key-status failed\"><?php esc_html_e('Network functions are disabled.', 'akismet'); ?></h3>\n\t<p class=\"akismet-description\"><?php printf( __('Your web host or server administrator has disabled PHP&#8217;s <code>gethostbynamel</code> function.  <strong>Akismet cannot work correctly until this is fixed.</strong>  Please contact your web host or firewall administrator and give them <a href=\"%s\" target=\"_blank\">this information about Akismet&#8217;s system requirements</a>.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>\n</div>\n<?php elseif ( $type == 'servers-be-down' ) :?>\n<div class=\"akismet-alert akismet-critical\">\n\t<h3 class=\"akismet-key-status failed\"><?php esc_html_e(\"Your site can&#8217;t connect to the Akismet servers.\", 'akismet'); ?></h3>\n\t<p class=\"akismet-description\"><?php printf( __('Your firewall may be blocking Akismet from connecting to its API. Please contact your host and refer to <a href=\"%s\" target=\"_blank\">our guide about firewalls</a>.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>\n</div>\n<?php elseif ( $type == 'active-dunning' ) :?>\n<div class=\"akismet-alert akismet-critical\">\n\t<h3 class=\"akismet-key-status\"><?php esc_html_e(\"Please update your payment information.\", 'akismet'); ?></h3>\n\t<p class=\"akismet-description\"><?php printf( __('We cannot process your payment. Please <a href=\"%s\" target=\"_blank\">update your payment details</a>.', 'akismet'), 'https://akismet.com/account/'); ?></p>\n</div>\n<?php elseif ( $type == 'cancelled' ) :?>\n<div class=\"akismet-alert akismet-critical\">\n\t<h3 class=\"akismet-key-status\"><?php esc_html_e(\"Your Akismet plan has been cancelled.\", 'akismet'); ?></h3>\n\t<p class=\"akismet-description\"><?php printf( __('Please visit your <a href=\"%s\" target=\"_blank\">Akismet account page</a> to reactivate your subscription.', 'akismet'), 'https://akismet.com/account/'); ?></p>\n</div>\n<?php elseif ( $type == 'suspended' ) :?>\n<div class=\"akismet-alert akismet-critical\">\n\t<h3 class=\"akismet-key-status failed\"><?php esc_html_e(\"Your Akismet subscription is suspended.\", 'akismet'); ?></h3>\n\t<p class=\"akismet-description\"><?php printf( __('Please contact <a href=\"%s\" target=\"_blank\">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>\n</div>\n<?php elseif ( $type == 'active-notice' && $time_saved ) :?>\n<div class=\"akismet-alert akismet-active\">\n\t<h3 class=\"akismet-key-status\"><?php echo esc_html( $time_saved ); ?></h3>\n\t<p class=\"akismet-description\"><?php printf( __('You can help us fight spam and upgrade your account by <a href=\"%s\" target=\"_blank\">contributing a token amount</a>.', 'akismet'), 'https://akismet.com/account/upgrade/'); ?></p>\n</div>\n<?php elseif ( $type == 'missing' ) :?>\n<div class=\"akismet-alert akismet-critical\">\n\t<h3 class=\"akismet-key-status failed\"><?php esc_html_e( 'There is a problem with your API key.', 'akismet'); ?></h3>\n\t<p class=\"akismet-description\"><?php printf( __('Please contact <a href=\"%s\" target=\"_blank\">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>\n</div>\n<?php elseif ( $type == 'no-sub' ) :?>\n<div class=\"akismet-alert akismet-critical\">\n\t<h3 class=\"akismet-key-status failed\"><?php esc_html_e( 'You don&#8217;t have an Akismet plan.', 'akismet'); ?></h3>\n\t<p class=\"akismet-description\">\n\t\t<?php printf( __( 'In 2012, Akismet began using subscription plans for all accounts (even free ones). A plan has not been assigned to your account, and we&#8217;d appreciate it if you&#8217;d <a href=\"%s\" target=\"_blank\">sign into your account</a> and choose one.', 'akismet'), 'https://akismet.com/account/upgrade/' ); ?>\n\t\t<br /><br />\n\t\t<?php printf( __( 'Please <a href=\"%s\" target=\"_blank\">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/' ); ?>\n\t</p>\n</div>\n<?php elseif ( $type == 'new-key-valid' ) :\n\tglobal $wpdb;\n\t\n\t$check_pending_link = false;\n\t\n\t$at_least_one_comment_in_moderation = !! $wpdb->get_var( \"SELECT comment_ID FROM {$wpdb->comments} WHERE comment_approved = '0' LIMIT 1\" );\n\t\n\tif ( $at_least_one_comment_in_moderation)  {\n\t\t$check_pending_link = 'edit-comments.php?akismet_recheck=' . wp_create_nonce( 'akismet_recheck' );\n\t}\n\t\n\t?>\n<div class=\"akismet-alert akismet-active\">\n\t<h3 class=\"akismet-key-status\"><?php esc_html_e( 'Akismet is now protecting your site from spam. Happy blogging!', 'akismet' ); ?></h3>\n\t<?php if ( $check_pending_link ) { ?>\n\t\t<p class=\"akismet-description\"><?php printf( __( 'Would you like to <a href=\"%s\">check pending comments</a>?', 'akismet' ), esc_url( $check_pending_link ) ); ?></p>\n\t<?php } ?>\n</div>\n<?php elseif ( $type == 'new-key-invalid' ) :?>\n<div class=\"akismet-alert akismet-critical\">\n\t<h3 class=\"akismet-key-status\"><?php esc_html_e( 'The key you entered is invalid. Please double-check it.' , 'akismet'); ?></h3>\n</div>\n<?php elseif ( $type == 'existing-key-invalid' ) :?>\n<div class=\"akismet-alert akismet-critical\">\n\t<h3 class=\"akismet-key-status\"><?php esc_html_e( 'Your API key is no longer valid. Please enter a new key or contact support@akismet.com.' , 'akismet'); ?></h3>\n</div>\n<?php elseif ( $type == 'new-key-failed' ) :?>\n<div class=\"akismet-alert akismet-critical\">\n\t<h3 class=\"akismet-key-status\"><?php esc_html_e( 'The API key you entered could not be verified.' , 'akismet'); ?></h3>\n\t<p class=\"akismet-description\"><?php printf( __('The connection to akismet.com could not be established. Please refer to <a href=\"%s\" target=\"_blank\">our guide about firewalls</a> and check your server configuration.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>\n</div>\n<?php elseif ( $type == 'limit-reached' && in_array( $level, array( 'yellow', 'red' ) ) ) :?>\n<div class=\"akismet-alert akismet-critical\">\n\t<?php if ( $level == 'yellow' ): ?>\n\t<h3 class=\"akismet-key-status failed\"><?php esc_html_e( 'You&#8217;re using your Akismet key on more sites than your Pro subscription allows.', 'akismet' ); ?></h3>\n\t<p class=\"akismet-description\">\n\t\t<?php printf( __( 'Your Pro subscription allows the use of Akismet on only one site. Please <a href=\"%s\" target=\"_blank\">purchase additional Pro subscriptions</a> or upgrade to an Enterprise subscription that allows the use of Akismet on unlimited sites.', 'akismet' ), 'https://docs.akismet.com/billing/add-more-sites/' ); ?>\n\t\t<br /><br />\n\t\t<?php printf( __( 'Please <a href=\"%s\" target=\"_blank\">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>\n\t</p>\n\t<?php elseif ( $level == 'red' ): ?>\n\t<h3 class=\"akismet-key-status failed\"><?php esc_html_e( 'You&#8217;re using Akismet on far too many sites for your Pro subscription.', 'akismet' ); ?></h3>\n\t<p class=\"akismet-description\">\n\t\t<?php printf( __( 'To continue your service, <a href=\"%s\" target=\"_blank\">upgrade to an Enterprise subscription</a>, which covers an unlimited number of sites.', 'akismet'), 'https://akismet.com/account/upgrade/' ); ?>\n\t\t<br /><br />\n\t\t<?php printf( __( 'Please <a href=\"%s\" target=\"_blank\">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>\n\t</p>\n\t<?php endif; ?>\n</div>\n<?php endif;?>", "num_lines": 141}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<div class=\"akismet-box\">\n\t<h2><?php esc_html_e( 'Manual Configuration', 'akismet' ); ?></h2>\n\t<p>\n\t\t<?php\n\n\t\t/* translators: %s is the wp-config.php file */\n\t\techo sprintf( esc_html__( 'An Akismet API key has been defined in the %s file for this site.', 'akismet' ), '<code>wp-config.php</code>' );\n\n\t\t?>\n\t</p>\n</div>", "num_lines": 11}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<div class=\"akismet-setup-instructions\">\n\t<p><?php esc_html_e( 'Set up your Akismet account to enable spam filtering on this site.', 'akismet' ); ?></p>\n\t<?php Akismet::view( 'get', array( 'text' => __( 'Set up your Akismet account' , 'akismet' ), 'classes' => array( 'akismet-button', 'akismet-is-primary' ) ) ); ?>\n</div>\n", "num_lines": 5}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n//phpcs:disable VariableAnalysis\n// There are \"undefined\" variables here because they're defined in the code that includes this file as a template.\n\n?>\n<div id=\"akismet-plugin-container\">\n\t<div class=\"akismet-masthead\">\n\t\t<div class=\"akismet-masthead__inside-container\">\n\t\t\t<div class=\"akismet-masthead__logo-container\">\n\t\t\t\t<img class=\"akismet-masthead__logo\" src=\"<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>\" alt=\"Akismet\" />\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class=\"akismet-lower\">\n\t\t<?php Akismet_Admin::display_status();?>\n\t\t<div class=\"akismet-boxes\">\n\t\t\t<?php\n\n\t\t\tif ( Akismet::predefined_api_key() ) {\n\t\t\t\tAkismet::view( 'predefined' );\n\t\t\t} elseif ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) {\n\t\t\t\tAkismet::view( 'connect-jp', compact( 'akismet_user' ) );\n\t\t\t} else {\n\t\t\t\tAkismet::view( 'activate' );\n\t\t\t}\n\n\t\t\t?>\n\t\t</div>\n\t</div>\n</div>", "num_lines": 31}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<div id=\"akismet-plugin-container\">\n\t<div class=\"akismet-masthead\">\n\t\t<div class=\"akismet-masthead__inside-container\">\n\t\t\t<a href=\"<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>\" class=\"akismet-right\"><?php esc_html_e( 'Anti-Spam Settings', 'akismet' ); ?></a>\n\t\t\t<div class=\"akismet-masthead__logo-container\">\n\t\t\t\t<img class=\"akismet-masthead__logo\" src=\"<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>\" alt=\"Akismet\" />\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<iframe src=\"<?php echo esc_url( sprintf( '//akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() ) ); ?>\" width=\"100%\" height=\"2500px\" frameborder=\"0\"></iframe>\n</div>", "num_lines": 11}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<div class=\"centered akismet-box-header\">\n\t<h2><?php esc_html_e( 'Eliminate spam from your site', 'akismet' ); ?></h2>\n</div>", "num_lines": 3}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n// Silence is golden.\n", "num_lines": 3}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying 404 pages (not found)\n *\n * @link https://codex.wordpress.org/Creating_an_Error_404_Page\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\nget_header();\n?>\n\n\t<div id=\"primary\" class=\"content-area\">\n\t\t<main id=\"main\" class=\"site-main\">\n\n\t\t\t<div class=\"error-404 not-found\">\n\t\t\t\t<header class=\"page-header\">\n\t\t\t\t\t<h1 class=\"page-title\"><?php _e( 'Oops! That page can&rsquo;t be found.', 'twentynineteen' ); ?></h1>\n\t\t\t\t</header><!-- .page-header -->\n\n\t\t\t\t<div class=\"page-content\">\n\t\t\t\t\t<p><?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'twentynineteen' ); ?></p>\n\t\t\t\t\t<?php get_search_form(); ?>\n\t\t\t\t</div><!-- .page-content -->\n\t\t\t</div><!-- .error-404 -->\n\n\t\t</main><!-- #main -->\n\t</div><!-- #primary -->\n\n<?php\nget_footer();\n", "num_lines": 34}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying archive pages\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\nget_header();\n?>\n\n\t<div id=\"primary\" class=\"content-area\">\n\t\t<main id=\"main\" class=\"site-main\">\n\n\t\t<?php if ( have_posts() ) : ?>\n\n\t\t\t<header class=\"page-header\">\n\t\t\t\t<?php\n\t\t\t\t\tthe_archive_title( '<h1 class=\"page-title\">', '</h1>' );\n\t\t\t\t?>\n\t\t\t</header><!-- .page-header -->\n\n\t\t\t<?php\n\t\t\t// Start the Loop.\n\t\t\twhile ( have_posts() ) :\n\t\t\t\tthe_post();\n\n\t\t\t\t/*\n\t\t\t\t * Include the Post-Format-specific template for the content.\n\t\t\t\t * If you want to override this in a child theme, then include a file\n\t\t\t\t * called content-___.php (where ___ is the Post Format name) and that\n\t\t\t\t * will be used instead.\n\t\t\t\t */\n\t\t\t\tget_template_part( 'template-parts/content/content', 'excerpt' );\n\n\t\t\t\t// End the loop.\n\t\t\tendwhile;\n\n\t\t\t// Previous/next page navigation.\n\t\t\ttwentynineteen_the_posts_navigation();\n\n\t\t\t// If no content, include the \"No posts found\" template.\n\t\telse :\n\t\t\tget_template_part( 'template-parts/content/content', 'none' );\n\n\t\tendif;\n\t\t?>\n\t\t</main><!-- #main -->\n\t</div><!-- #primary -->\n\n<?php\nget_footer();\n", "num_lines": 56}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying comments\n *\n * This is the template that displays the area of the page that contains both the current comments\n * and the comment form.\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\n/*\n * If the current post is protected by a password and\n * the visitor has not yet entered the password we will\n * return early without loading the comments.\n*/\nif ( post_password_required() ) {\n\treturn;\n}\n\n$discussion = twentynineteen_get_discussion_data();\n?>\n\n<div id=\"comments\" class=\"<?php echo comments_open() ? 'comments-area' : 'comments-area comments-closed'; ?>\">\n\t<div class=\"<?php echo $discussion->responses > 0 ? 'comments-title-wrap' : 'comments-title-wrap no-responses'; ?>\">\n\t\t<h2 class=\"comments-title\">\n\t\t<?php\n\t\tif ( comments_open() ) {\n\t\t\tif ( have_comments() ) {\n\t\t\t\t_e( 'Join the Conversation', 'twentynineteen' );\n\t\t\t} else {\n\t\t\t\t_e( 'Leave a comment', 'twentynineteen' );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( '1' == $discussion->responses ) {\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\tprintf( _x( 'One reply on &ldquo;%s&rdquo;', 'comments title', 'twentynineteen' ), get_the_title() );\n\t\t\t} else {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: Number of comments, 2: Post title. */\n\t\t\t\t\t_nx(\n\t\t\t\t\t\t'%1$s reply on &ldquo;%2$s&rdquo;',\n\t\t\t\t\t\t'%1$s replies on &ldquo;%2$s&rdquo;',\n\t\t\t\t\t\t$discussion->responses,\n\t\t\t\t\t\t'comments title',\n\t\t\t\t\t\t'twentynineteen'\n\t\t\t\t\t),\n\t\t\t\t\tnumber_format_i18n( $discussion->responses ),\n\t\t\t\t\tget_the_title()\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t?>\n\t\t</h2><!-- .comments-title -->\n\t\t<?php\n\t\t// Only show discussion meta information when comments are open and available.\n\t\tif ( have_comments() && comments_open() ) {\n\t\t\tget_template_part( 'template-parts/post/discussion', 'meta' );\n\t\t}\n\t\t?>\n\t</div><!-- .comments-title-flex -->\n\t<?php\n\tif ( have_comments() ) :\n\n\t\t// Show comment form at top if showing newest comments at the top.\n\t\tif ( comments_open() ) {\n\t\t\ttwentynineteen_comment_form( 'desc' );\n\t\t}\n\n\t\t?>\n\t\t<ol class=\"comment-list\">\n\t\t\t<?php\n\t\t\twp_list_comments(\n\t\t\t\tarray(\n\t\t\t\t\t'walker'      => new TwentyNineteen_Walker_Comment(),\n\t\t\t\t\t'avatar_size' => twentynineteen_get_avatar_size(),\n\t\t\t\t\t'short_ping'  => true,\n\t\t\t\t\t'style'       => 'ol',\n\t\t\t\t)\n\t\t\t);\n\t\t\t?>\n\t\t</ol><!-- .comment-list -->\n\t\t<?php\n\n\t\t// Show comment navigation.\n\t\tif ( have_comments() ) :\n\t\t\t$prev_icon     = twentynineteen_get_icon_svg( 'chevron_left', 22 );\n\t\t\t$next_icon     = twentynineteen_get_icon_svg( 'chevron_right', 22 );\n\t\t\t$comments_text = __( 'Comments', 'twentynineteen' );\n\t\t\tthe_comments_navigation(\n\t\t\t\tarray(\n\t\t\t\t\t'prev_text' => sprintf( '%s <span class=\"nav-prev-text\"><span class=\"primary-text\">%s</span> <span class=\"secondary-text\">%s</span></span>', $prev_icon, __( 'Previous', 'twentynineteen' ), __( 'Comments', 'twentynineteen' ) ),\n\t\t\t\t\t'next_text' => sprintf( '<span class=\"nav-next-text\"><span class=\"primary-text\">%s</span> <span class=\"secondary-text\">%s</span></span> %s', __( 'Next', 'twentynineteen' ), __( 'Comments', 'twentynineteen' ), $next_icon ),\n\t\t\t\t)\n\t\t\t);\n\t\tendif;\n\n\t\t// Show comment form at bottom if showing newest comments at the bottom.\n\t\tif ( comments_open() && 'asc' === strtolower( get_option( 'comment_order', 'asc' ) ) ) :\n\t\t\t?>\n\t\t\t<div class=\"comment-form-flex\">\n\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Leave a comment', 'twentynineteen' ); ?></span>\n\t\t\t\t<?php twentynineteen_comment_form( 'asc' ); ?>\n\t\t\t\t<h2 class=\"comments-title\" aria-hidden=\"true\"><?php _e( 'Leave a comment', 'twentynineteen' ); ?></h2>\n\t\t\t</div>\n\t\t\t<?php\n\t\tendif;\n\n\t\t// If comments are closed and there are comments, let's leave a little note, shall we?\n\t\tif ( ! comments_open() ) :\n\t\t\t?>\n\t\t\t<p class=\"no-comments\">\n\t\t\t\t<?php _e( 'Comments are closed.', 'twentynineteen' ); ?>\n\t\t\t</p>\n\t\t\t<?php\n\t\tendif;\n\n\telse :\n\n\t\t// Show comment form.\n\t\ttwentynineteen_comment_form( true );\n\n\tendif; // if have_comments();\n\t?>\n</div><!-- #comments -->\n", "num_lines": 129}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying the footer\n *\n * Contains the closing of the #content div and all content after.\n *\n * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\n?>\n\n\t</div><!-- #content -->\n\n\t<footer id=\"colophon\" class=\"site-footer\">\n\t\t<?php get_template_part( 'template-parts/footer/footer', 'widgets' ); ?>\n\t\t<div class=\"site-info\">\n\t\t\t<?php $blog_info = get_bloginfo( 'name' ); ?>\n\t\t\t<?php if ( ! empty( $blog_info ) ) : ?>\n\t\t\t\t<a class=\"site-name\" href=\"<?php echo esc_url( home_url( '/' ) ); ?>\" rel=\"home\"><?php bloginfo( 'name' ); ?></a>,\n\t\t\t<?php endif; ?>\n\t\t\t<a href=\"<?php echo esc_url( __( 'https://wordpress.org/', 'twentynineteen' ) ); ?>\" class=\"imprint\">\n\t\t\t\t<?php\n\t\t\t\t/* translators: %s: WordPress. */\n\t\t\t\tprintf( __( 'Proudly powered by %s.', 'twentynineteen' ), 'WordPress' );\n\t\t\t\t?>\n\t\t\t</a>\n\t\t\t<?php\n\t\t\tif ( function_exists( 'the_privacy_policy_link' ) ) {\n\t\t\t\tthe_privacy_policy_link( '', '<span role=\"separator\" aria-hidden=\"true\"></span>' );\n\t\t\t}\n\t\t\t?>\n\t\t\t<?php if ( has_nav_menu( 'footer' ) ) : ?>\n\t\t\t\t<nav class=\"footer-navigation\" aria-label=\"<?php esc_attr_e( 'Footer Menu', 'twentynineteen' ); ?>\">\n\t\t\t\t\t<?php\n\t\t\t\t\twp_nav_menu(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'theme_location' => 'footer',\n\t\t\t\t\t\t\t'menu_class'     => 'footer-menu',\n\t\t\t\t\t\t\t'depth'          => 1,\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</nav><!-- .footer-navigation -->\n\t\t\t<?php endif; ?>\n\t\t</div><!-- .site-info -->\n\t</footer><!-- #colophon -->\n\n</div><!-- #page -->\n\n<?php wp_footer(); ?>\n\n</body>\n</html>\n", "num_lines": 58}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Twenty Nineteen functions and definitions\n *\n * @link https://developer.wordpress.org/themes/basics/theme-functions/\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\n/**\n * Twenty Nineteen only works in WordPress 4.7 or later.\n */\nif ( version_compare( $GLOBALS['wp_version'], '4.7', '<' ) ) {\n\trequire get_template_directory() . '/inc/back-compat.php';\n\treturn;\n}\n\nif ( ! function_exists( 'twentynineteen_setup' ) ) :\n\t/**\n\t * Sets up theme defaults and registers support for various WordPress features.\n\t *\n\t * Note that this function is hooked into the after_setup_theme hook, which\n\t * runs before the init hook. The init hook is too late for some features, such\n\t * as indicating support for post thumbnails.\n\t */\n\tfunction twentynineteen_setup() {\n\t\t/*\n\t\t * Make theme available for translation.\n\t\t * Translations can be filed in the /languages/ directory.\n\t\t * If you're building a theme based on Twenty Nineteen, use a find and replace\n\t\t * to change 'twentynineteen' to the name of your theme in all the template files.\n\t\t */\n\t\tload_theme_textdomain( 'twentynineteen', get_template_directory() . '/languages' );\n\n\t\t// Add default posts and comments RSS feed links to head.\n\t\tadd_theme_support( 'automatic-feed-links' );\n\n\t\t/*\n\t\t * Let WordPress manage the document title.\n\t\t * By adding theme support, we declare that this theme does not use a\n\t\t * hard-coded <title> tag in the document head, and expect WordPress to\n\t\t * provide it for us.\n\t\t */\n\t\tadd_theme_support( 'title-tag' );\n\n\t\t/*\n\t\t * Enable support for Post Thumbnails on posts and pages.\n\t\t *\n\t\t * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/\n\t\t */\n\t\tadd_theme_support( 'post-thumbnails' );\n\t\tset_post_thumbnail_size( 1568, 9999 );\n\n\t\t// This theme uses wp_nav_menu() in two locations.\n\t\tregister_nav_menus(\n\t\t\tarray(\n\t\t\t\t'menu-1' => __( 'Primary', 'twentynineteen' ),\n\t\t\t\t'footer' => __( 'Footer Menu', 'twentynineteen' ),\n\t\t\t\t'social' => __( 'Social Links Menu', 'twentynineteen' ),\n\t\t\t)\n\t\t);\n\n\t\t/*\n\t\t * Switch default core markup for search form, comment form, and comments\n\t\t * to output valid HTML5.\n\t\t */\n\t\tadd_theme_support(\n\t\t\t'html5',\n\t\t\tarray(\n\t\t\t\t'search-form',\n\t\t\t\t'comment-form',\n\t\t\t\t'comment-list',\n\t\t\t\t'gallery',\n\t\t\t\t'caption',\n\t\t\t\t'script',\n\t\t\t\t'style',\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Add support for core custom logo.\n\t\t *\n\t\t * @link https://codex.wordpress.org/Theme_Logo\n\t\t */\n\t\tadd_theme_support(\n\t\t\t'custom-logo',\n\t\t\tarray(\n\t\t\t\t'height'      => 190,\n\t\t\t\t'width'       => 190,\n\t\t\t\t'flex-width'  => false,\n\t\t\t\t'flex-height' => false,\n\t\t\t)\n\t\t);\n\n\t\t// Add theme support for selective refresh for widgets.\n\t\tadd_theme_support( 'customize-selective-refresh-widgets' );\n\n\t\t// Add support for Block Styles.\n\t\tadd_theme_support( 'wp-block-styles' );\n\n\t\t// Add support for full and wide align images.\n\t\tadd_theme_support( 'align-wide' );\n\n\t\t// Add support for editor styles.\n\t\tadd_theme_support( 'editor-styles' );\n\n\t\t// Enqueue editor styles.\n\t\tadd_editor_style( 'style-editor.css' );\n\n\t\t// Add custom editor font sizes.\n\t\tadd_theme_support(\n\t\t\t'editor-font-sizes',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'name'      => __( 'Small', 'twentynineteen' ),\n\t\t\t\t\t'shortName' => __( 'S', 'twentynineteen' ),\n\t\t\t\t\t'size'      => 19.5,\n\t\t\t\t\t'slug'      => 'small',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name'      => __( 'Normal', 'twentynineteen' ),\n\t\t\t\t\t'shortName' => __( 'M', 'twentynineteen' ),\n\t\t\t\t\t'size'      => 22,\n\t\t\t\t\t'slug'      => 'normal',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name'      => __( 'Large', 'twentynineteen' ),\n\t\t\t\t\t'shortName' => __( 'L', 'twentynineteen' ),\n\t\t\t\t\t'size'      => 36.5,\n\t\t\t\t\t'slug'      => 'large',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name'      => __( 'Huge', 'twentynineteen' ),\n\t\t\t\t\t'shortName' => __( 'XL', 'twentynineteen' ),\n\t\t\t\t\t'size'      => 49.5,\n\t\t\t\t\t'slug'      => 'huge',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t// Editor color palette.\n\t\tadd_theme_support(\n\t\t\t'editor-color-palette',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'name'  => 'default' === get_theme_mod( 'primary_color' ) ? __( 'Blue', 'twentynineteen' ) : null,\n\t\t\t\t\t'slug'  => 'primary',\n\t\t\t\t\t'color' => twentynineteen_hsl_hex( 'default' === get_theme_mod( 'primary_color' ) ? 199 : get_theme_mod( 'primary_color_hue', 199 ), 100, 33 ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name'  => 'default' === get_theme_mod( 'primary_color' ) ? __( 'Dark Blue', 'twentynineteen' ) : null,\n\t\t\t\t\t'slug'  => 'secondary',\n\t\t\t\t\t'color' => twentynineteen_hsl_hex( 'default' === get_theme_mod( 'primary_color' ) ? 199 : get_theme_mod( 'primary_color_hue', 199 ), 100, 23 ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name'  => __( 'Dark Gray', 'twentynineteen' ),\n\t\t\t\t\t'slug'  => 'dark-gray',\n\t\t\t\t\t'color' => '#111',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name'  => __( 'Light Gray', 'twentynineteen' ),\n\t\t\t\t\t'slug'  => 'light-gray',\n\t\t\t\t\t'color' => '#767676',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name'  => __( 'White', 'twentynineteen' ),\n\t\t\t\t\t'slug'  => 'white',\n\t\t\t\t\t'color' => '#FFF',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t// Add support for responsive embedded content.\n\t\tadd_theme_support( 'responsive-embeds' );\n\t}\nendif;\nadd_action( 'after_setup_theme', 'twentynineteen_setup' );\n\n/**\n * Register widget area.\n *\n * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar\n */\nfunction twentynineteen_widgets_init() {\n\n\tregister_sidebar(\n\t\tarray(\n\t\t\t'name'          => __( 'Footer', 'twentynineteen' ),\n\t\t\t'id'            => 'sidebar-1',\n\t\t\t'description'   => __( 'Add widgets here to appear in your footer.', 'twentynineteen' ),\n\t\t\t'before_widget' => '<section id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget'  => '</section>',\n\t\t\t'before_title'  => '<h2 class=\"widget-title\">',\n\t\t\t'after_title'   => '</h2>',\n\t\t)\n\t);\n\n}\nadd_action( 'widgets_init', 'twentynineteen_widgets_init' );\n\n/**\n * Set the content width in pixels, based on the theme's design and stylesheet.\n *\n * Priority 0 to make it available to lower priority callbacks.\n *\n * @global int $content_width Content width.\n */\nfunction twentynineteen_content_width() {\n\t// This variable is intended to be overruled from themes.\n\t// Open WPCS issue: {@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1043}.\n\t// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound\n\t$GLOBALS['content_width'] = apply_filters( 'twentynineteen_content_width', 640 );\n}\nadd_action( 'after_setup_theme', 'twentynineteen_content_width', 0 );\n\n/**\n * Enqueue scripts and styles.\n */\nfunction twentynineteen_scripts() {\n\twp_enqueue_style( 'twentynineteen-style', get_stylesheet_uri(), array(), wp_get_theme()->get( 'Version' ) );\n\n\twp_style_add_data( 'twentynineteen-style', 'rtl', 'replace' );\n\n\tif ( has_nav_menu( 'menu-1' ) ) {\n\t\twp_enqueue_script( 'twentynineteen-priority-menu', get_theme_file_uri( '/js/priority-menu.js' ), array(), '20181214', true );\n\t\twp_enqueue_script( 'twentynineteen-touch-navigation', get_theme_file_uri( '/js/touch-keyboard-navigation.js' ), array(), '20181231', true );\n\t}\n\n\twp_enqueue_style( 'twentynineteen-print-style', get_template_directory_uri() . '/print.css', array(), wp_get_theme()->get( 'Version' ), 'print' );\n\n\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n}\nadd_action( 'wp_enqueue_scripts', 'twentynineteen_scripts' );\n\n/**\n * Fix skip link focus in IE11.\n *\n * This does not enqueue the script because it is tiny and because it is only for IE11,\n * thus it does not warrant having an entire dedicated blocking script being loaded.\n *\n * @link https://git.io/vWdr2\n */\nfunction twentynineteen_skip_link_focus_fix() {\n\t// The following is minified via `terser --compress --mangle -- js/skip-link-focus-fix.js`.\n\t?>\n\t<script>\n\t/(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener(\"hashchange\",function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())},!1);\n\t</script>\n\t<?php\n}\nadd_action( 'wp_print_footer_scripts', 'twentynineteen_skip_link_focus_fix' );\n\n/**\n * Enqueue supplemental block editor styles.\n */\nfunction twentynineteen_editor_customizer_styles() {\n\n\twp_enqueue_style( 'twentynineteen-editor-customizer-styles', get_theme_file_uri( '/style-editor-customizer.css' ), false, '1.1', 'all' );\n\n\tif ( 'custom' === get_theme_mod( 'primary_color' ) ) {\n\t\t// Include color patterns.\n\t\trequire_once get_parent_theme_file_path( '/inc/color-patterns.php' );\n\t\twp_add_inline_style( 'twentynineteen-editor-customizer-styles', twentynineteen_custom_colors_css() );\n\t}\n}\nadd_action( 'enqueue_block_editor_assets', 'twentynineteen_editor_customizer_styles' );\n\n/**\n * Display custom color CSS in customizer and on frontend.\n */\nfunction twentynineteen_colors_css_wrap() {\n\n\t// Only include custom colors in customizer or frontend.\n\tif ( ( ! is_customize_preview() && 'default' === get_theme_mod( 'primary_color', 'default' ) ) || is_admin() ) {\n\t\treturn;\n\t}\n\n\trequire_once get_parent_theme_file_path( '/inc/color-patterns.php' );\n\n\t$primary_color = 199;\n\tif ( 'default' !== get_theme_mod( 'primary_color', 'default' ) ) {\n\t\t$primary_color = get_theme_mod( 'primary_color_hue', 199 );\n\t}\n\t?>\n\n\t<style type=\"text/css\" id=\"custom-theme-colors\" <?php echo is_customize_preview() ? 'data-hue=\"' . absint( $primary_color ) . '\"' : ''; ?>>\n\t\t<?php echo twentynineteen_custom_colors_css(); ?>\n\t</style>\n\t<?php\n}\nadd_action( 'wp_head', 'twentynineteen_colors_css_wrap' );\n\n/**\n * SVG Icons class.\n */\nrequire get_template_directory() . '/classes/class-twentynineteen-svg-icons.php';\n\n/**\n * Custom Comment Walker template.\n */\nrequire get_template_directory() . '/classes/class-twentynineteen-walker-comment.php';\n\n/**\n * Common theme functions.\n */\nrequire get_template_directory() . '/inc/helper-functions.php';\n\n/**\n * SVG Icons related functions.\n */\nrequire get_template_directory() . '/inc/icon-functions.php';\n\n/**\n * Enhance the theme by hooking into WordPress.\n */\nrequire get_template_directory() . '/inc/template-functions.php';\n\n/**\n * Custom template tags for the theme.\n */\nrequire get_template_directory() . '/inc/template-tags.php';\n\n/**\n * Customizer additions.\n */\nrequire get_template_directory() . '/inc/customizer.php';\n", "num_lines": 331}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The header for our theme\n *\n * This is the template that displays all of the <head> section and everything up until <div id=\"content\">\n *\n * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n?><!doctype html>\n<html <?php language_attributes(); ?>>\n<head>\n\t<meta charset=\"<?php bloginfo( 'charset' ); ?>\" />\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n\t<link rel=\"profile\" href=\"https://gmpg.org/xfn/11\" />\n\t<?php wp_head(); ?>\n</head>\n\n<body <?php body_class(); ?>>\n<?php wp_body_open(); ?>\n<div id=\"page\" class=\"site\">\n\t<a class=\"skip-link screen-reader-text\" href=\"#content\"><?php _e( 'Skip to content', 'twentynineteen' ); ?></a>\n\n\t\t<header id=\"masthead\" class=\"<?php echo is_singular() && twentynineteen_can_show_post_thumbnail() ? 'site-header featured-image' : 'site-header'; ?>\">\n\n\t\t\t<div class=\"site-branding-container\">\n\t\t\t\t<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>\n\t\t\t</div><!-- .site-branding-container -->\n\n\t\t\t<?php if ( is_singular() && twentynineteen_can_show_post_thumbnail() ) : ?>\n\t\t\t\t<div class=\"site-featured-image\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\ttwentynineteen_post_thumbnail();\n\t\t\t\t\t\tthe_post();\n\t\t\t\t\t\t$discussion = ! is_page() && twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null;\n\n\t\t\t\t\t\t$classes = 'entry-header';\n\t\t\t\t\tif ( ! empty( $discussion ) && absint( $discussion->responses ) > 0 ) {\n\t\t\t\t\t\t$classes = 'entry-header has-discussion';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t<div class=\"<?php echo $classes; ?>\">\n\t\t\t\t\t\t<?php get_template_part( 'template-parts/header/entry', 'header' ); ?>\n\t\t\t\t\t</div><!-- .entry-header -->\n\t\t\t\t\t<?php rewind_posts(); ?>\n\t\t\t\t</div>\n\t\t\t<?php endif; ?>\n\t\t</header><!-- #masthead -->\n\n\t<div id=\"content\" class=\"site-content\">\n", "num_lines": 54}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying image attachments\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\nget_header();\n?>\n\n\t<div id=\"primary\" class=\"content-area\">\n\t\t<main id=\"main\" class=\"site-main\">\n\n\t\t\t<?php\n\t\t\t// Start the Loop.\n\t\t\twhile ( have_posts() ) :\n\t\t\t\tthe_post();\n\t\t\t\t?>\n\n\t\t\t\t<article id=\"post-<?php the_ID(); ?>\" <?php post_class(); ?>>\n\n\t\t\t\t\t<header class=\"entry-header\">\n\t\t\t\t\t<?php the_title( '<h1 class=\"entry-title\">', '</h1>' ); ?>\n\t\t\t\t\t</header><!-- .entry-header -->\n\n\t\t\t\t\t<div class=\"entry-content\">\n\n\t\t\t\t\t\t<figure class=\"entry-attachment wp-block-image\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Filter the default twentynineteen image attachment size.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @since Twenty Sixteen 1.0\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @param string $image_size Image size. Default 'large'.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t$image_size = apply_filters( 'twentynineteen_attachment_size', 'full' );\n\n\t\t\t\t\t\t\techo wp_get_attachment_image( get_the_ID(), $image_size );\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t<figcaption class=\"wp-caption-text\"><?php the_excerpt(); ?></figcaption>\n\n\t\t\t\t\t\t</figure><!-- .entry-attachment -->\n\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tthe_content();\n\t\t\t\t\t\twp_link_pages(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'before'      => '<div class=\"page-links\"><span class=\"page-links-title\">' . __( 'Pages:', 'twentynineteen' ) . '</span>',\n\t\t\t\t\t\t\t\t'after'       => '</div>',\n\t\t\t\t\t\t\t\t'link_before' => '<span>',\n\t\t\t\t\t\t\t\t'link_after'  => '</span>',\n\t\t\t\t\t\t\t\t'pagelink'    => '<span class=\"screen-reader-text\">' . __( 'Page', 'twentynineteen' ) . ' </span>%',\n\t\t\t\t\t\t\t\t'separator'   => '<span class=\"screen-reader-text\">, </span>',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t</div><!-- .entry-content -->\n\n\t\t\t\t\t<footer class=\"entry-footer\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t// Retrieve attachment metadata.\n\t\t\t\t\t\t$metadata = wp_get_attachment_metadata();\n\t\t\t\t\tif ( $metadata ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t'<span class=\"full-size-link\"><span class=\"screen-reader-text\">%1$s</span><a href=\"%2$s\">%3$s &times; %4$s</a></span>',\n\t\t\t\t\t\t\t_x( 'Full size', 'Used before full size attachment link.', 'twentynineteen' ),\n\t\t\t\t\t\t\tesc_url( wp_get_attachment_url() ),\n\t\t\t\t\t\t\tabsint( $metadata['width'] ),\n\t\t\t\t\t\t\tabsint( $metadata['height'] )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\n\t\t\t\t\t\t<?php twentynineteen_entry_footer(); ?>\n\n\t\t\t\t\t</footer><!-- .entry-footer -->\n\t\t\t\t</article><!-- #post-<?php the_ID(); ?> -->\n\n\t\t\t\t<?php\n\t\t\t\t// Parent post navigation.\n\t\t\t\tthe_post_navigation(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'prev_text' => _x( '<span class=\"meta-nav\">Published in</span><br><span class=\"post-title\">%title</span>', 'Parent post link', 'twentynineteen' ),\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// If comments are open or we have at least one comment, load up the comment template.\n\t\t\t\tif ( comments_open() || get_comments_number() ) {\n\t\t\t\t\tcomments_template();\n\t\t\t\t}\n\n\t\t\t\t// End the loop.\n\t\t\t\tendwhile;\n\t\t\t?>\n\n\t\t</main><!-- .site-main -->\n\t</div><!-- .content-area -->\n\n<?php\nget_footer();\n", "num_lines": 105}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The main template file\n *\n * This is the most generic template file in a WordPress theme\n * and one of the two required files for a theme (the other being style.css).\n * It is used to display a page when nothing more specific matches a query.\n * E.g., it puts together the home page when no home.php file exists.\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\nget_header();\n?>\n\n\t<div id=\"primary\" class=\"content-area\">\n\t\t<main id=\"main\" class=\"site-main\">\n\n\t\t<?php\n\t\tif ( have_posts() ) {\n\n\t\t\t// Load posts loop.\n\t\t\twhile ( have_posts() ) {\n\t\t\t\tthe_post();\n\t\t\t\tget_template_part( 'template-parts/content/content' );\n\t\t\t}\n\n\t\t\t// Previous/next page navigation.\n\t\t\ttwentynineteen_the_posts_navigation();\n\n\t\t} else {\n\n\t\t\t// If no content, include the \"No posts found\" template.\n\t\t\tget_template_part( 'template-parts/content/content', 'none' );\n\n\t\t}\n\t\t?>\n\n\t\t</main><!-- .site-main -->\n\t</div><!-- .content-area -->\n\n<?php\nget_footer();\n", "num_lines": 48}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying all single posts\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\nget_header();\n?>\n\n\t<div id=\"primary\" class=\"content-area\">\n\t\t<main id=\"main\" class=\"site-main\">\n\n\t\t\t<?php\n\n\t\t\t// Start the Loop.\n\t\t\twhile ( have_posts() ) :\n\t\t\t\tthe_post();\n\n\t\t\t\tget_template_part( 'template-parts/content/content', 'page' );\n\n\t\t\t\t// If comments are open or we have at least one comment, load up the comment template.\n\t\t\t\tif ( comments_open() || get_comments_number() ) {\n\t\t\t\t\tcomments_template();\n\t\t\t\t}\n\n\t\t\tendwhile; // End the loop.\n\t\t\t?>\n\n\t\t</main><!-- #main -->\n\t</div><!-- #primary -->\n\n<?php\nget_footer();\n", "num_lines": 39}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying search results pages\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\nget_header();\n?>\n\n\t<div id=\"primary\" class=\"content-area\">\n\t\t<main id=\"main\" class=\"site-main\">\n\n\t\t<?php if ( have_posts() ) : ?>\n\n\t\t\t<header class=\"page-header\">\n\t\t\t\t<h1 class=\"page-title\">\n\t\t\t\t\t<?php _e( 'Search results for: ', 'twentynineteen' ); ?>\n\t\t\t\t\t<span class=\"page-description\"><?php echo get_search_query(); ?></span>\n\t\t\t\t</h1>\n\t\t\t</header><!-- .page-header -->\n\n\t\t\t<?php\n\t\t\t// Start the Loop.\n\t\t\twhile ( have_posts() ) :\n\t\t\t\tthe_post();\n\n\t\t\t\t/*\n\t\t\t\t * Include the Post-Format-specific template for the content.\n\t\t\t\t * If you want to override this in a child theme, then include a file\n\t\t\t\t * called content-___.php (where ___ is the Post Format name) and that\n\t\t\t\t * will be used instead.\n\t\t\t\t */\n\t\t\t\tget_template_part( 'template-parts/content/content', 'excerpt' );\n\n\t\t\t\t// End the loop.\n\t\t\tendwhile;\n\n\t\t\t// Previous/next page navigation.\n\t\t\ttwentynineteen_the_posts_navigation();\n\n\t\t\t// If no content, include the \"No posts found\" template.\n\t\telse :\n\t\t\tget_template_part( 'template-parts/content/content', 'none' );\n\n\t\tendif;\n\t\t?>\n\t\t</main><!-- #main -->\n\t</div><!-- #primary -->\n\n<?php\nget_footer();\n", "num_lines": 57}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying all single posts\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\nget_header();\n?>\n\n\t<div id=\"primary\" class=\"content-area\">\n\t\t<main id=\"main\" class=\"site-main\">\n\n\t\t\t<?php\n\n\t\t\t// Start the Loop.\n\t\t\twhile ( have_posts() ) :\n\t\t\t\tthe_post();\n\n\t\t\t\tget_template_part( 'template-parts/content/content', 'single' );\n\n\t\t\t\tif ( is_singular( 'attachment' ) ) {\n\t\t\t\t\t// Parent post navigation.\n\t\t\t\t\tthe_post_navigation(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t/* translators: %s: Parent post link. */\n\t\t\t\t\t\t\t'prev_text' => sprintf( __( '<span class=\"meta-nav\">Published in</span><span class=\"post-title\">%s</span>', 'twentynineteen' ), '%title' ),\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t} elseif ( is_singular( 'post' ) ) {\n\t\t\t\t\t// Previous/next post navigation.\n\t\t\t\t\tthe_post_navigation(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'next_text' => '<span class=\"meta-nav\" aria-hidden=\"true\">' . __( 'Next Post', 'twentynineteen' ) . '</span> ' .\n\t\t\t\t\t\t\t\t'<span class=\"screen-reader-text\">' . __( 'Next post:', 'twentynineteen' ) . '</span> <br/>' .\n\t\t\t\t\t\t\t\t'<span class=\"post-title\">%title</span>',\n\t\t\t\t\t\t\t'prev_text' => '<span class=\"meta-nav\" aria-hidden=\"true\">' . __( 'Previous Post', 'twentynineteen' ) . '</span> ' .\n\t\t\t\t\t\t\t\t'<span class=\"screen-reader-text\">' . __( 'Previous post:', 'twentynineteen' ) . '</span> <br/>' .\n\t\t\t\t\t\t\t\t'<span class=\"post-title\">%title</span>',\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// If comments are open or we have at least one comment, load up the comment template.\n\t\t\t\tif ( comments_open() || get_comments_number() ) {\n\t\t\t\t\tcomments_template();\n\t\t\t\t}\n\n\t\t\tendwhile; // End the loop.\n\t\t\t?>\n\n\t\t</main><!-- #main -->\n\t</div><!-- #primary -->\n\n<?php\nget_footer();\n", "num_lines": 61}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SVG Icons class\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\n/**\n * This class is in charge of displaying SVG icons across the site.\n *\n * Place each <svg> source on its own array key, without adding the\n * both `width` and `height` attributes, since these are added dynamically,\n * before rendering the SVG code.\n *\n * All icons are assumed to have equal width and height, hence the option\n * to only specify a `$size` parameter in the svg methods.\n *\n * @since Twenty Nineteen 1.0\n */\nclass TwentyNineteen_SVG_Icons {\n\n\t/**\n\t * Gets the SVG code for a given icon.\n\t */\n\tpublic static function get_svg( $group, $icon, $size ) {\n\t\tif ( 'ui' === $group ) {\n\t\t\t$arr = self::$ui_icons;\n\t\t} elseif ( 'social' === $group ) {\n\t\t\t$arr = self::$social_icons;\n\t\t} else {\n\t\t\t$arr = array();\n\t\t}\n\t\tif ( array_key_exists( $icon, $arr ) ) {\n\t\t\t$repl = sprintf( '<svg class=\"svg-icon\" width=\"%d\" height=\"%d\" aria-hidden=\"true\" role=\"img\" focusable=\"false\" ', $size, $size );\n\t\t\t$svg  = preg_replace( '/^<svg /', $repl, trim( $arr[ $icon ] ) ); // Add extra attributes to SVG code.\n\t\t\t$svg  = preg_replace( \"/([\\n\\t]+)/\", ' ', $svg ); // Remove newlines & tabs.\n\t\t\t$svg  = preg_replace( '/>\\s*</', '><', $svg );    // Remove whitespace between SVG tags.\n\t\t\treturn $svg;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Detects the social network from a URL and returns the SVG code for its icon.\n\t */\n\tpublic static function get_social_link_svg( $uri, $size ) {\n\t\tstatic $regex_map; // Only compute regex map once, for performance.\n\t\tif ( ! isset( $regex_map ) ) {\n\t\t\t$regex_map = array();\n\t\t\t$map       = &self::$social_icons_map; // Use reference instead of copy, to save memory.\n\t\t\tforeach ( array_keys( self::$social_icons ) as $icon ) {\n\t\t\t\t$domains            = array_key_exists( $icon, $map ) ? $map[ $icon ] : array( sprintf( '%s.com', $icon ) );\n\t\t\t\t$domains            = array_map( 'trim', $domains ); // Remove leading/trailing spaces, to prevent regex from failing to match.\n\t\t\t\t$domains            = array_map( 'preg_quote', $domains );\n\t\t\t\t$regex_map[ $icon ] = sprintf( '/(%s)/i', implode( '|', $domains ) );\n\t\t\t}\n\t\t}\n\t\tforeach ( $regex_map as $icon => $regex ) {\n\t\t\tif ( preg_match( $regex, $uri ) ) {\n\t\t\t\treturn self::get_svg( 'social', $icon, $size );\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * User Interface icons \u00e2\u20ac\u201c svg sources.\n\t *\n\t * @var array\n\t */\n\tstatic $ui_icons = array(\n\t\t'link'                     => /* material-design \u00e2\u20ac\u201c link */ '\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n    <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\n    <path d=\"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z\"></path>\n</svg>',\n\n\t\t'watch'                    => /* material-design \u00e2\u20ac\u201c watch-later */ '\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n    <defs>\n        <path id=\"a\" d=\"M0 0h24v24H0V0z\"></path>\n    </defs>\n    <clipPath id=\"b\">\n        <use xlink:href=\"#a\" overflow=\"visible\"></use>\n    </clipPath>\n    <path clip-path=\"url(#b)\" d=\"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm4.2 14.2L11 13V7h1.5v5.2l4.5 2.7-.8 1.3z\"></path>\n</svg>',\n\n\t\t'archive'                  => /* material-design \u00e2\u20ac\u201c folder */ '\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n    <path d=\"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z\"></path>\n    <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\n</svg>',\n\n\t\t'tag'                      => /* material-design \u00e2\u20ac\u201c local_offer */ '\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t<path d=\"M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7z\"></path>\n\t<path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\n</svg>',\n\n\t\t'comment'                  => /* material-design \u00e2\u20ac\u201c comment */ '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <path d=\"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18z\"></path>\n    <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\n</svg>',\n\n\t\t'person'                   => /* material-design \u00e2\u20ac\u201c person */ '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <path d=\"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z\"></path>\n    <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\n</svg>',\n\n\t\t'edit'                     => /* material-design \u00e2\u20ac\u201c edit */ '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <path d=\"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z\"></path>\n    <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\n</svg>',\n\n\t\t'chevron_left'             => /* material-design \u00e2\u20ac\u201c chevron_left */ '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n    <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"></path>\n    <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\n</svg>',\n\n\t\t'chevron_right'            => /* material-design \u00e2\u20ac\u201c chevron_right */ '\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n    <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"></path>\n    <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\n</svg>',\n\n\t\t'check'                    => /* material-design \u00e2\u20ac\u201c check */ '\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n    <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\n    <path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"></path>\n</svg>',\n\n\t\t'arrow_drop_down_circle'   => /* material-design \u00e2\u20ac\u201c arrow_drop_down_circle */ '\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t<path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\n\t<path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 12l-4-4h8l-4 4z\"></path>\n</svg>',\n\n\t\t'keyboard_arrow_down'      => /* material-design \u00e2\u20ac\u201c keyboard_arrow_down */ '\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t<path d=\"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z\"></path>\n\t<path fill=\"none\" d=\"M0 0h24v24H0V0z\"></path>\n</svg>',\n\n\t\t'keyboard_arrow_right'     => /* material-design \u00e2\u20ac\u201c keyboard_arrow_right */ '\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t<path d=\"M10 17l5-5-5-5v10z\"></path>\n\t<path fill=\"none\" d=\"M0 24V0h24v24H0z\"></path>\n</svg>',\n\n\t\t'keyboard_arrow_left'      => /* material-design \u00e2\u20ac\u201c keyboard_arrow_left */ '\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t<path d=\"M14 7l-5 5 5 5V7z\"></path>\n\t<path fill=\"none\" d=\"M24 0v24H0V0h24z\"></path>\n</svg>',\n\n\t\t'arrow_drop_down_ellipsis' => /* custom \u00e2\u20ac\u201c arrow_drop_down_ellipsis */ '\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n    <g fill=\"none\" fill-rule=\"evenodd\">\n        <path d=\"M0 0h24v24H0z\"/>\n        <path fill=\"currentColor\" fill-rule=\"nonzero\" d=\"M12 2c5.52 0 10 4.48 10 10s-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2zM6 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm6 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm6 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4z\"/>\n    </g>\n</svg>',\n\n\t);\n\n\t/**\n\t * Social Icons \u00e2\u20ac\u201c domain mappings.\n\t *\n\t * By default, each Icon ID is matched against a .com TLD. To override this behavior,\n\t * specify all the domains it covers (including the .com TLD too, if applicable).\n\t *\n\t * @var array\n\t */\n\tstatic $social_icons_map = array(\n\t\t'amazon'      => array(\n\t\t\t'amazon.com',\n\t\t\t'amazon.cn',\n\t\t\t'amazon.in',\n\t\t\t'amazon.fr',\n\t\t\t'amazon.de',\n\t\t\t'amazon.it',\n\t\t\t'amazon.nl',\n\t\t\t'amazon.es',\n\t\t\t'amazon.co',\n\t\t\t'amazon.ca',\n\t\t),\n\t\t'apple'       => array(\n\t\t\t'apple.com',\n\t\t\t'itunes.com',\n\t\t),\n\t\t'behance'     => array(\n\t\t\t'behance.net',\n\t\t),\n\t\t'codepen'     => array(\n\t\t\t'codepen.io',\n\t\t),\n\t\t'facebook'    => array(\n\t\t\t'facebook.com',\n\t\t\t'fb.me',\n\t\t),\n\t\t'feed'        => array(\n\t\t\t'feed',\n\t\t),\n\t\t'google-plus' => array(\n\t\t\t'plus.google.com',\n\t\t),\n\t\t'lastfm'      => array(\n\t\t\t'last.fm',\n\t\t),\n\t\t'mail'        => array(\n\t\t\t'mailto:',\n\t\t),\n\t\t'slideshare'  => array(\n\t\t\t'slideshare.net',\n\t\t),\n\t\t'pocket'      => array(\n\t\t\t'getpocket.com',\n\t\t),\n\t\t'twitch'      => array(\n\t\t\t'twitch.tv',\n\t\t),\n\t\t'wordpress'   => array(\n\t\t\t'wordpress.com',\n\t\t\t'wordpress.org',\n\t\t),\n\t);\n\n\t/**\n\t * Social Icons \u00e2\u20ac\u201c svg sources.\n\t *\n\t * @var array\n\t */\n\tstatic $social_icons = array(\n\t\t'500px'       => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z\"></path>\n</svg>',\n\n\t\t'amazon'      => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z\"></path>\n</svg>',\n\n\t\t'apple'       => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M20.07,17.586a10.874,10.874,0,0,1-1.075,1.933,9.822,9.822,0,0,1-1.385,1.674,2.687,2.687,0,0,1-1.78.784,4.462,4.462,0,0,1-1.644-.393,4.718,4.718,0,0,0-1.77-.391,4.878,4.878,0,0,0-1.82.391A4.9,4.9,0,0,1,9.021,22a2.53,2.53,0,0,1-1.82-.8A10.314,10.314,0,0,1,5.752,19.46,11.987,11.987,0,0,1,4.22,16.417a11.143,11.143,0,0,1-.643-3.627,6.623,6.623,0,0,1,.87-3.465A5.1,5.1,0,0,1,6.268,7.483a4.9,4.9,0,0,1,2.463-.695,5.8,5.8,0,0,1,1.9.443,6.123,6.123,0,0,0,1.511.444,9.04,9.04,0,0,0,1.675-.523,5.537,5.537,0,0,1,2.277-.4,4.835,4.835,0,0,1,3.788,1.994,4.213,4.213,0,0,0-2.235,3.827,4.222,4.222,0,0,0,1.386,3.181,4.556,4.556,0,0,0,1.385.909q-.167.483-.353.927ZM16.211,2.4a4.267,4.267,0,0,1-1.094,2.8,3.726,3.726,0,0,1-3.1,1.528A3.114,3.114,0,0,1,12,6.347a4.384,4.384,0,0,1,1.16-2.828,4.467,4.467,0,0,1,1.414-1.061A4.215,4.215,0,0,1,16.19,2a3.633,3.633,0,0,1,.021.4Z\"></path>\n</svg>',\n\n\t\t'bandcamp'    => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289\"></path>\n</svg>',\n\n\t\t'behance'     => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z\"></path>\n</svg>',\n\n\t\t'chain'       => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M19.647,16.706a1.134,1.134,0,0,0-.343-.833l-2.549-2.549a1.134,1.134,0,0,0-.833-.343,1.168,1.168,0,0,0-.883.392l.233.226q.2.189.264.264a2.922,2.922,0,0,1,.184.233.986.986,0,0,1,.159.312,1.242,1.242,0,0,1,.043.337,1.172,1.172,0,0,1-1.176,1.176,1.237,1.237,0,0,1-.337-.043,1,1,0,0,1-.312-.159,2.76,2.76,0,0,1-.233-.184q-.073-.068-.264-.264l-.226-.233a1.19,1.19,0,0,0-.4.895,1.134,1.134,0,0,0,.343.833L15.837,19.3a1.13,1.13,0,0,0,.833.331,1.18,1.18,0,0,0,.833-.318l1.8-1.789a1.12,1.12,0,0,0,.343-.821Zm-8.615-8.64a1.134,1.134,0,0,0-.343-.833L8.163,4.7a1.134,1.134,0,0,0-.833-.343,1.184,1.184,0,0,0-.833.331L4.7,6.473a1.12,1.12,0,0,0-.343.821,1.134,1.134,0,0,0,.343.833l2.549,2.549a1.13,1.13,0,0,0,.833.331,1.184,1.184,0,0,0,.883-.38L8.728,10.4q-.2-.189-.264-.264A2.922,2.922,0,0,1,8.28,9.9a.986.986,0,0,1-.159-.312,1.242,1.242,0,0,1-.043-.337A1.172,1.172,0,0,1,9.254,8.079a1.237,1.237,0,0,1,.337.043,1,1,0,0,1,.312.159,2.761,2.761,0,0,1,.233.184q.073.068.264.264l.226.233a1.19,1.19,0,0,0,.4-.895ZM22,16.706a3.343,3.343,0,0,1-1.042,2.488l-1.8,1.789a3.536,3.536,0,0,1-4.988-.025l-2.525-2.537a3.384,3.384,0,0,1-1.017-2.488,3.448,3.448,0,0,1,1.078-2.561l-1.078-1.078a3.434,3.434,0,0,1-2.549,1.078,3.4,3.4,0,0,1-2.5-1.029L3.029,9.794A3.4,3.4,0,0,1,2,7.294,3.343,3.343,0,0,1,3.042,4.806l1.8-1.789A3.384,3.384,0,0,1,7.331,2a3.357,3.357,0,0,1,2.5,1.042l2.525,2.537a3.384,3.384,0,0,1,1.017,2.488,3.448,3.448,0,0,1-1.078,2.561l1.078,1.078a3.551,3.551,0,0,1,5.049-.049l2.549,2.549A3.4,3.4,0,0,1,22,16.706Z\"></path>\n</svg>',\n\n\t\t'codepen'     => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z\"></path>\n</svg>',\n\n\t\t'deviantart'  => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z\"></path>\n</svg>',\n\n\t\t'digg'        => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M4.5,5.4h2.2V16H1V8.5h3.5V5.4L4.5,5.4z M4.5,14.2v-4H3.2v4H4.5z M7.6,8.5V16h2.2V8.5C9.8,8.5,7.6,8.5,7.6,8.5z M7.6,5.4 v2.2h2.2V5.4C9.8,5.4,7.6,5.4,7.6,5.4z M10.7,8.5h5.7v10.1h-5.7v-1.8h3.5V16h-3.5C10.7,16,10.7,8.5,10.7,8.5z M14.2,14.2v-4h-1.3v4 H14.2z M17.3,8.5H23v10.1h-5.7v-1.8h3.5V16h-3.5C17.3,16,17.3,8.5,17.3,8.5z M20.8,14.2v-4h-1.3v4H20.8z\"></path>\n</svg>',\n\n\t\t'dribbble'    => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z\"></path>\n</svg>',\n\n\t\t'dropbox'     => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z\"></path>\n</svg>',\n\n\t\t'etsy'        => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z\"></path>\n</svg>',\n\n\t\t'facebook'    => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M20.007,3H3.993C3.445,3,3,3.445,3,3.993v16.013C3,20.555,3.445,21,3.993,21h8.621v-6.971h-2.346v-2.717h2.346V9.31 c0-2.325,1.42-3.591,3.494-3.591c0.993,0,1.847,0.074,2.096,0.107v2.43l-1.438,0.001c-1.128,0-1.346,0.536-1.346,1.323v1.734h2.69 l-0.35,2.717h-2.34V21h4.587C20.555,21,21,20.555,21,20.007V3.993C21,3.445,20.555,3,20.007,3z\"></path>\n</svg>',\n\n\t\t'feed'        => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z\"></path>\n</svg>',\n\n\t\t'flickr'      => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z\"></path>\n</svg>',\n\n\t\t'foursquare'  => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z\"></path>\n</svg>',\n\n\t\t'goodreads'   => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z\"></path>\n</svg>',\n\n\t\t'google-plus' => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M8,11h6.61c0.06,0.35,0.11,0.7,0.11,1.16c0,4-2.68,6.84-6.72,6.84c-3.87,0-7-3.13-7-7s3.13-7,7-7 c1.89,0,3.47,0.69,4.69,1.83l-1.9,1.83C10.27,8.16,9.36,7.58,8,7.58c-2.39,0-4.34,1.98-4.34,4.42S5.61,16.42,8,16.42 c2.77,0,3.81-1.99,3.97-3.02H8V11L8,11z M23,11h-2V9h-2v2h-2v2h2v2h2v-2h2\"></path>\n</svg>',\n\n\t\t'google'      => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z\"></path>\n</svg>',\n\n\t\t'github'      => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z\"></path>\n</svg>',\n\n\t\t'instagram'   => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z\"></path>\n</svg>',\n\n\t\t'lastfm'      => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M10.5002,0 C4.7006,0 0,4.70109753 0,10.4998496 C0,16.2989526 4.7006,21 10.5002,21 C16.299,21 21,16.2989526 21,10.4998496 C21,4.70109753 16.299,0 10.5002,0 Z M14.69735,14.7204413 C13.3164,14.7151781 12.4346,14.0870017 11.83445,12.6859357 L11.6816001,12.3451305 L10.35405,9.31011397 C9.92709997,8.26875064 8.85260001,7.57120012 7.68010001,7.57120012 C6.06945001,7.57120012 4.75925001,8.88509738 4.75925001,10.5009524 C4.75925001,12.1164565 6.06945001,13.4303036 7.68010001,13.4303036 C8.77200001,13.4303036 9.76514999,12.827541 10.2719501,11.8567047 C10.2893,11.8235214 10.3239,11.8019673 10.36305,11.8038219 C10.4007,11.8053759 10.43535,11.8287847 10.4504,11.8631709 L10.98655,13.1045863 C11.0016,13.1389726 10.9956,13.17782 10.97225,13.2068931 C10.1605001,14.1995341 8.96020001,14.7683115 7.68010001,14.7683115 C5.33305,14.7683115 3.42340001,12.8535563 3.42340001,10.5009524 C3.42340001,8.14679459 5.33300001,6.23203946 7.68010001,6.23203946 C9.45720002,6.23203946 10.8909,7.19074535 11.6138,8.86359341 C11.6205501,8.88018505 12.3412,10.5707777 12.97445,12.0190621 C13.34865,12.8739575 13.64615,13.3959676 14.6288,13.4291508 C15.5663001,13.4612814 16.25375,12.9121534 16.25375,12.1484869 C16.25375,11.4691321 15.8320501,11.3003585 14.8803,10.98216 C13.2365,10.4397989 12.34495,9.88605929 12.34495,8.51817658 C12.34495,7.1809207 13.26665,6.31615054 14.692,6.31615054 C15.62875,6.31615054 16.3155,6.7286858 16.79215,7.5768142 C16.80495,7.60062396 16.8079001,7.62814302 16.8004001,7.65420843 C16.7929,7.68027384 16.7748,7.70212868 16.7507001,7.713808 L15.86145,8.16900031 C15.8178001,8.19200805 15.7643,8.17807308 15.73565,8.13847371 C15.43295,7.71345711 15.0956,7.52513451 14.6423,7.52513451 C14.05125,7.52513451 13.6220001,7.92899802 13.6220001,8.48649708 C13.6220001,9.17382194 14.1529001,9.34144259 15.0339,9.61923972 C15.14915,9.65578139 15.26955,9.69397731 15.39385,9.73432853 C16.7763,10.1865133 17.57675,10.7311301 17.57675,12.1836251 C17.57685,13.629654 16.3389,14.7204413 14.69735,14.7204413 Z\"></path>\n</svg>',\n\n\t\t'linkedin'    => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z\"></path>\n</svg>',\n\n\t\t'mail'        => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M20,4H4C2.895,4,2,4.895,2,6v12c0,1.105,0.895,2,2,2h16c1.105,0,2-0.895,2-2V6C22,4.895,21.105,4,20,4z M20,8.236l-8,4.882 L4,8.236V6h16V8.236z\"></path>\n</svg>',\n\n\t\t'meetup'      => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z\"></path>\n</svg>',\n\n\t\t'medium'      => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M20.962,7.257l-5.457,8.867l-3.923-6.375l3.126-5.08c0.112-0.182,0.319-0.286,0.527-0.286c0.05,0,0.1,0.008,0.149,0.02 c0.039,0.01,0.078,0.023,0.114,0.041l5.43,2.715l0.006,0.003c0.004,0.002,0.007,0.006,0.011,0.008 C20.971,7.191,20.98,7.227,20.962,7.257z M9.86,8.592v5.783l5.14,2.57L9.86,8.592z M15.772,17.331l4.231,2.115 C20.554,19.721,21,19.529,21,19.016V8.835L15.772,17.331z M8.968,7.178L3.665,4.527C3.569,4.479,3.478,4.456,3.395,4.456 C3.163,4.456,3,4.636,3,4.938v11.45c0,0.306,0.224,0.669,0.498,0.806l4.671,2.335c0.12,0.06,0.234,0.088,0.337,0.088 c0.29,0,0.494-0.225,0.494-0.602V7.231C9,7.208,8.988,7.188,8.968,7.178z\"></path>\n</svg>',\n\n\t\t'pinterest'   => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2\"></path>\n</svg>',\n\n\t\t'pocket'      => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z\"></path>\n</svg>',\n\n\t\t'reddit'      => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M22,11.816c0-1.256-1.021-2.277-2.277-2.277c-0.593,0-1.122,0.24-1.526,0.614c-1.481-0.965-3.455-1.594-5.647-1.69 l1.171-3.702l3.18,0.748c0.008,1.028,0.846,1.862,1.876,1.862c1.035,0,1.877-0.842,1.877-1.878c0-1.035-0.842-1.877-1.877-1.877 c-0.769,0-1.431,0.466-1.72,1.13l-3.508-0.826c-0.203-0.047-0.399,0.067-0.46,0.261l-1.35,4.268 c-2.316,0.038-4.411,0.67-5.97,1.671C5.368,9.765,4.853,9.539,4.277,9.539C3.021,9.539,2,10.56,2,11.816 c0,0.814,0.433,1.523,1.078,1.925c-0.037,0.221-0.061,0.444-0.061,0.672c0,3.292,4.011,5.97,8.941,5.97s8.941-2.678,8.941-5.97 c0-0.214-0.02-0.424-0.053-0.632C21.533,13.39,22,12.661,22,11.816z M18.776,4.394c0.606,0,1.1,0.493,1.1,1.1s-0.493,1.1-1.1,1.1 s-1.1-0.494-1.1-1.1S18.169,4.394,18.776,4.394z M2.777,11.816c0-0.827,0.672-1.5,1.499-1.5c0.313,0,0.598,0.103,0.838,0.269 c-0.851,0.676-1.477,1.479-1.812,2.36C2.983,12.672,2.777,12.27,2.777,11.816z M11.959,19.606c-4.501,0-8.164-2.329-8.164-5.193 S7.457,9.22,11.959,9.22s8.164,2.329,8.164,5.193S16.46,19.606,11.959,19.606z M20.636,13.001c-0.326-0.89-0.948-1.701-1.797-2.384 c0.248-0.186,0.55-0.301,0.883-0.301c0.827,0,1.5,0.673,1.5,1.5C21.223,12.299,20.992,12.727,20.636,13.001z M8.996,14.704 c-0.76,0-1.397-0.616-1.397-1.376c0-0.76,0.637-1.397,1.397-1.397c0.76,0,1.376,0.637,1.376,1.397 C10.372,14.088,9.756,14.704,8.996,14.704z M16.401,13.328c0,0.76-0.616,1.376-1.376,1.376c-0.76,0-1.399-0.616-1.399-1.376 c0-0.76,0.639-1.397,1.399-1.397C15.785,11.931,16.401,12.568,16.401,13.328z M15.229,16.708c0.152,0.152,0.152,0.398,0,0.55 c-0.674,0.674-1.727,1.002-3.219,1.002c-0.004,0-0.007-0.002-0.011-0.002c-0.004,0-0.007,0.002-0.011,0.002 c-1.492,0-2.544-0.328-3.218-1.002c-0.152-0.152-0.152-0.398,0-0.55c0.152-0.152,0.399-0.151,0.55,0 c0.521,0.521,1.394,0.775,2.669,0.775c0.004,0,0.007,0.002,0.011,0.002c0.004,0,0.007-0.002,0.011-0.002 c1.275,0,2.148-0.253,2.669-0.775C14.831,16.556,15.078,16.556,15.229,16.708z\"></path>\n</svg>',\n\n\t\t'skype'       => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z\"></path>\n</svg>',\n\n\t\t'slideshare'  => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M11.738,10.232a2.142,2.142,0,0,1-.721,1.619,2.556,2.556,0,0,1-3.464,0,2.183,2.183,0,0,1,0-3.243,2.572,2.572,0,0,1,3.464,0A2.136,2.136,0,0,1,11.738,10.232Zm5.7,0a2.15,2.15,0,0,1-.715,1.619,2.563,2.563,0,0,1-3.469,0,2.183,2.183,0,0,1,0-3.243,2.58,2.58,0,0,1,3.469,0A2.144,2.144,0,0,1,17.439,10.232Zm2.555,2.045V4.7a2.128,2.128,0,0,0-.363-1.4,1.614,1.614,0,0,0-1.261-.415H5.742a1.656,1.656,0,0,0-1.278.386A2.246,2.246,0,0,0,4.129,4.7v7.643a8.212,8.212,0,0,0,1,.454q.516.193.92.318a6.847,6.847,0,0,0,.92.21q.516.085.806.125a6.615,6.615,0,0,0,.795.045l.665.006q.16,0,.642-.023t.506-.023a1.438,1.438,0,0,1,1.079.307,1.134,1.134,0,0,0,.114.1,7.215,7.215,0,0,0,.693.579q.079-1.033,1.34-.988.057,0,.415.017l.488.023q.13.006.517.011t.6-.011l.619-.051a5.419,5.419,0,0,0,.693-.1l.7-.153a5.353,5.353,0,0,0,.761-.221q.345-.131.766-.307a8.727,8.727,0,0,0,.818-.392Zm1.851-.057a10.4,10.4,0,0,1-4.225,2.862,6.5,6.5,0,0,1-.261,5.281,3.524,3.524,0,0,1-2.078,1.681,2.452,2.452,0,0,1-2.067-.17,1.915,1.915,0,0,1-.931-1.863l-.011-3.7V16.3l-.279-.068q-.188-.045-.267-.057l-.011,3.839a1.9,1.9,0,0,1-.943,1.863,2.481,2.481,0,0,1-2.078.17,3.519,3.519,0,0,1-2.067-1.7,6.546,6.546,0,0,1-.25-5.258A10.4,10.4,0,0,1,2.152,12.22a.56.56,0,0,1-.045-.715q.238-.3.681.011l.125.079a.767.767,0,0,1,.125.091V3.8a1.987,1.987,0,0,1,.534-1.4,1.7,1.7,0,0,1,1.295-.579H19.141a1.7,1.7,0,0,1,1.295.579,1.985,1.985,0,0,1,.534,1.4v7.882l.238-.17q.443-.307.681-.011a.56.56,0,0,1-.045.715Z\"></path>\n</svg>',\n\n\t\t'snapchat'    => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z\"></path>\n</svg>',\n\n\t\t'soundcloud'  => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M8.9,16.1L9,14L8.9,9.5c0-0.1,0-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1c-0.1,0-0.1,0-0.1,0.1c0,0-0.1,0.1-0.1,0.1L8.3,14l0.1,2.1 c0,0.1,0,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1C8.8,16.3,8.9,16.3,8.9,16.1z M11.4,15.9l0.1-1.8L11.4,9c0-0.1,0-0.2-0.1-0.2 c0,0-0.1,0-0.1,0s-0.1,0-0.1,0c-0.1,0-0.1,0.1-0.1,0.2l0,0.1l-0.1,5c0,0,0,0.7,0.1,2v0c0,0.1,0,0.1,0.1,0.1c0.1,0.1,0.1,0.1,0.2,0.1 c0.1,0,0.1,0,0.2-0.1c0.1,0,0.1-0.1,0.1-0.2L11.4,15.9z M2.4,12.9L2.5,14l-0.2,1.1c0,0.1,0,0.1-0.1,0.1c0,0-0.1,0-0.1-0.1L2.1,14 l0.1-1.1C2.2,12.9,2.3,12.9,2.4,12.9C2.3,12.9,2.4,12.9,2.4,12.9z M3.1,12.2L3.3,14l-0.2,1.8c0,0.1,0,0.1-0.1,0.1 c-0.1,0-0.1,0-0.1-0.1L2.8,14L3,12.2C3,12.2,3,12.2,3.1,12.2C3.1,12.2,3.1,12.2,3.1,12.2z M3.9,11.9L4.1,14l-0.2,2.1 c0,0.1,0,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L3.5,14l0.2-2.1c0-0.1,0-0.1,0.1-0.1C3.9,11.8,3.9,11.8,3.9,11.9z M4.7,11.9L4.9,14 l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L4.3,14l0.2-2.2c0-0.1,0-0.1,0.1-0.1C4.7,11.7,4.7,11.8,4.7,11.9z M5.6,12 l0.2,2l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c0,0-0.1,0-0.1,0c0,0,0-0.1,0-0.1L5.1,14l0.2-2c0,0,0-0.1,0-0.1s0.1,0,0.1,0 C5.5,11.9,5.5,11.9,5.6,12L5.6,12z M6.4,10.7L6.6,14l-0.2,2.1c0,0,0,0.1,0,0.1c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.2L5.9,14 l0.2-3.3c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0C6.4,10.7,6.4,10.7,6.4,10.7z M7.2,10l0.2,4.1l-0.2,2.1c0,0,0,0.1,0,0.1 c0,0-0.1,0-0.1,0c-0.1,0-0.2-0.1-0.2-0.2l-0.1-2.1L6.8,10c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0S7.2,9.9,7.2,10z M8,9.6L8.2,14 L8,16.1c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.2-0.1-0.2-0.2L7.5,14l0.1-4.4c0-0.1,0-0.1,0.1-0.1c0,0,0.1-0.1,0.1-0.1c0.1,0,0.1,0,0.1,0.1 C8,9.6,8,9.6,8,9.6z M11.4,16.1L11.4,16.1L11.4,16.1z M9.7,9.6L9.8,14l-0.1,2.1c0,0.1,0,0.1-0.1,0.2s-0.1,0.1-0.2,0.1 c-0.1,0-0.1,0-0.1-0.1s-0.1-0.1-0.1-0.2L9.2,14l0.1-4.4c0-0.1,0-0.1,0.1-0.2s0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S9.7,9.5,9.7,9.6 L9.7,9.6z M10.6,9.8l0.1,4.3l-0.1,2c0,0.1,0,0.1-0.1,0.2c0,0-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c0,0-0.1-0.1-0.1-0.2L10,14 l0.1-4.3c0-0.1,0-0.1,0.1-0.2c0,0,0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S10.6,9.7,10.6,9.8z M12.4,14l-0.1,2c0,0.1,0,0.1-0.1,0.2 c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2l-0.1-1l-0.1-1l0.1-5.5v0c0-0.1,0-0.2,0.1-0.2 c0.1,0,0.1-0.1,0.2-0.1c0,0,0.1,0,0.1,0c0.1,0,0.1,0.1,0.1,0.2L12.4,14z M22.1,13.9c0,0.7-0.2,1.3-0.7,1.7c-0.5,0.5-1.1,0.7-1.7,0.7 h-6.8c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2V8.2c0-0.1,0.1-0.2,0.2-0.3c0.5-0.2,1-0.3,1.6-0.3c1.1,0,2.1,0.4,2.9,1.1 c0.8,0.8,1.3,1.7,1.4,2.8c0.3-0.1,0.6-0.2,1-0.2c0.7,0,1.3,0.2,1.7,0.7C21.8,12.6,22.1,13.2,22.1,13.9L22.1,13.9z\"></path>\n</svg>',\n\n\t\t'spotify'     => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865\"></path>\n</svg>',\n\n\t\t'stumbleupon' => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M12,4.294c-2.469,0-4.471,2.002-4.471,4.471v6.353c0,0.585-0.474,1.059-1.059,1.059c-0.585,0-1.059-0.474-1.059-1.059 v-2.824H2v2.941c0,2.469,2.002,4.471,4.471,4.471c2.469,0,4.471-2.002,4.471-4.471V8.765c0-0.585,0.474-1.059,1.059-1.059 s1.059,0.474,1.059,1.059v1.294l1.412,0.647l2-0.647V8.765C16.471,6.296,14.469,4.294,12,4.294z M13.059,12.353v2.882 c0,2.469,2.002,4.471,4.471,4.471S22,17.704,22,15.235v-2.824h-3.412v2.824c0,0.585-0.474,1.059-1.059,1.059 c-0.585,0-1.059-0.474-1.059-1.059v-2.882l-2,0.647L13.059,12.353z\"></path>\n</svg>',\n\n\t\t'tumblr'      => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M16.749,17.396c-0.357,0.17-1.041,0.319-1.551,0.332c-1.539,0.041-1.837-1.081-1.85-1.896V9.847h3.861V6.937h-3.847V2.039 c0,0-2.77,0-2.817,0c-0.046,0-0.127,0.041-0.138,0.144c-0.165,1.499-0.867,4.13-3.783,5.181v2.484h1.945v6.282 c0,2.151,1.587,5.206,5.775,5.135c1.413-0.024,2.982-0.616,3.329-1.126L16.749,17.396z\"></path>\n</svg>',\n\n\t\t'twitch'      => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z\"></path>\n</svg>',\n\n\t\t'twitter'     => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z\"></path>\n</svg>',\n\n\t\t'vimeo'       => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z\"></path>\n</svg>',\n\n\t\t'vk'          => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z\"></path>\n</svg>',\n\n\t\t'wordpress'   => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z\"></path>\n</svg>',\n\n\t\t'yelp'        => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z\"></path>\n</svg>',\n\n\t\t'youtube'     => '\n<svg viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<path d=\"M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z\"></path>\n</svg>',\n\n\t);\n\n}\n", "num_lines": 459}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Custom comment walker for this theme\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\n/**\n * This class outputs custom comment walker for HTML5 friendly WordPress comment and threaded replies.\n *\n * @since Twenty Nineteen 1.0\n */\nclass TwentyNineteen_Walker_Comment extends Walker_Comment {\n\n\t/**\n\t * Outputs a comment in the HTML5 format.\n\t *\n\t * @see wp_list_comments()\n\t *\n\t * @param WP_Comment $comment Comment to display.\n\t * @param int        $depth   Depth of the current comment.\n\t * @param array      $args    An array of arguments.\n\t */\n\tprotected function html5_comment( $comment, $depth, $args ) {\n\n\t\t$tag = ( 'div' === $args['style'] ) ? 'div' : 'li';\n\n\t\t?>\n\t\t<<?php echo $tag; ?> id=\"comment-<?php comment_ID(); ?>\" <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?>>\n\t\t\t<article id=\"div-comment-<?php comment_ID(); ?>\" class=\"comment-body\">\n\t\t\t\t<footer class=\"comment-meta\">\n\t\t\t\t\t<div class=\"comment-author vcard\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$comment_author_url = get_comment_author_url( $comment );\n\t\t\t\t\t\t$comment_author     = get_comment_author( $comment );\n\t\t\t\t\t\t$avatar             = get_avatar( $comment, $args['avatar_size'] );\n\t\t\t\t\t\tif ( 0 != $args['avatar_size'] ) {\n\t\t\t\t\t\t\tif ( empty( $comment_author_url ) ) {\n\t\t\t\t\t\t\t\techo $avatar;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tprintf( '<a href=\"%s\" rel=\"external nofollow\" class=\"url\">', $comment_author_url );\n\t\t\t\t\t\t\t\techo $avatar;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Using the `check` icon instead of `check_circle`, since we can't add a\n\t\t\t\t\t\t * fill color to the inner check shape when in circle form.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif ( twentynineteen_is_comment_by_post_author( $comment ) ) {\n\t\t\t\t\t\t\tprintf( '<span class=\"post-author-badge\" aria-hidden=\"true\">%s</span>', twentynineteen_get_icon_svg( 'check', 24 ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\twp_kses(\n\t\t\t\t\t\t\t\t/* translators: %s: Comment author link. */\n\t\t\t\t\t\t\t\t__( '%s <span class=\"screen-reader-text says\">says:</span>', 'twentynineteen' ),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'span' => array(\n\t\t\t\t\t\t\t\t\t\t'class' => array(),\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),\n\t\t\t\t\t\t\t'<b class=\"fn\">' . $comment_author . '</b>'\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( ! empty( $comment_author_url ) ) {\n\t\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t</div><!-- .comment-author -->\n\n\t\t\t\t\t<div class=\"comment-metadata\">\n\t\t\t\t\t\t<a href=\"<?php echo esc_url( get_comment_link( $comment, $args ) ); ?>\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t/* translators: 1: Comment date, 2: Comment time. */\n\t\t\t\t\t\t\t\t$comment_timestamp = sprintf( __( '%1$s at %2$s', 'twentynineteen' ), get_comment_date( '', $comment ), get_comment_time() );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<time datetime=\"<?php comment_time( 'c' ); ?>\" title=\"<?php echo $comment_timestamp; ?>\">\n\t\t\t\t\t\t\t\t<?php echo $comment_timestamp; ?>\n\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$edit_comment_icon = twentynineteen_get_icon_svg( 'edit', 16 );\n\t\t\t\t\t\t\tedit_comment_link( __( 'Edit', 'twentynineteen' ), '<span class=\"edit-link-sep\">&mdash;</span> <span class=\"edit-link\">' . $edit_comment_icon, '</span>' );\n\t\t\t\t\t\t?>\n\t\t\t\t\t</div><!-- .comment-metadata -->\n\n\t\t\t\t\t<?php\n\t\t\t\t\t$commenter = wp_get_current_commenter();\n\t\t\t\t\tif ( $commenter['comment_author_email'] ) {\n\t\t\t\t\t\t$moderation_note = __( 'Your comment is awaiting moderation.', 'twentynineteen' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$moderation_note = __( 'Your comment is awaiting moderation. This is a preview, your comment will be visible after it has been approved.', 'twentynineteen' );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\n\t\t\t\t\t<?php if ( '0' == $comment->comment_approved ) : ?>\n\t\t\t\t\t<p class=\"comment-awaiting-moderation\"><?php echo $moderation_note; ?></p>\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t</footer><!-- .comment-meta -->\n\n\t\t\t\t<div class=\"comment-content\">\n\t\t\t\t\t<?php comment_text(); ?>\n\t\t\t\t</div><!-- .comment-content -->\n\n\t\t\t</article><!-- .comment-body -->\n\n\t\t\t<?php\n\t\t\tcomment_reply_link(\n\t\t\t\tarray_merge(\n\t\t\t\t\t$args,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'add_below' => 'div-comment',\n\t\t\t\t\t\t'depth'     => $depth,\n\t\t\t\t\t\t'max_depth' => $args['max_depth'],\n\t\t\t\t\t\t'before'    => '<div class=\"comment-reply\">',\n\t\t\t\t\t\t'after'     => '</div>',\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\t?>\n\t\t<?php\n\t}\n}\n", "num_lines": 129}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Twenty Nineteen back compat functionality\n *\n * Prevents Twenty Nineteen from running on WordPress versions prior to 4.7,\n * since this theme is not meant to be backward compatible beyond that and\n * relies on many newer functions and markup changes introduced in 4.7.\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0.0\n */\n\n/**\n * Prevent switching to Twenty Nineteen on old versions of WordPress.\n *\n * Switches to the default theme.\n *\n * @since Twenty Nineteen 1.0.0\n */\nfunction twentynineteen_switch_theme() {\n\tswitch_theme( WP_DEFAULT_THEME );\n\tunset( $_GET['activated'] );\n\tadd_action( 'admin_notices', 'twentynineteen_upgrade_notice' );\n}\nadd_action( 'after_switch_theme', 'twentynineteen_switch_theme' );\n\n/**\n * Adds a message for unsuccessful theme switch.\n *\n * Prints an update nag after an unsuccessful attempt to switch to\n * Twenty Nineteen on WordPress versions prior to 4.7.\n *\n * @since Twenty Nineteen 1.0.0\n *\n * @global string $wp_version WordPress version.\n */\nfunction twentynineteen_upgrade_notice() {\n\t/* translators: %s: WordPress version. */\n\t$message = sprintf( __( 'Twenty Nineteen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentynineteen' ), $GLOBALS['wp_version'] );\n\tprintf( '<div class=\"error\"><p>%s</p></div>', $message );\n}\n\n/**\n * Prevents the Customizer from being loaded on WordPress versions prior to 4.7.\n *\n * @since Twenty Nineteen 1.0.0\n *\n * @global string $wp_version WordPress version.\n */\nfunction twentynineteen_customize() {\n\twp_die(\n\t\tsprintf(\n\t\t\t/* translators: %s: WordPress version. */\n\t\t\t__( 'Twenty Nineteen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentynineteen' ),\n\t\t\t$GLOBALS['wp_version']\n\t\t),\n\t\t'',\n\t\tarray(\n\t\t\t'back_link' => true,\n\t\t)\n\t);\n}\nadd_action( 'load-customize.php', 'twentynineteen_customize' );\n\n/**\n * Prevents the Theme Preview from being loaded on WordPress versions prior to 4.7.\n *\n * @since Twenty Nineteen 1.0.0\n *\n * @global string $wp_version WordPress version.\n */\nfunction twentynineteen_preview() {\n\tif ( isset( $_GET['preview'] ) ) {\n\t\t/* translators: %s: WordPress version. */\n\t\twp_die( sprintf( __( 'Twenty Nineteen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentynineteen' ), $GLOBALS['wp_version'] ) );\n\t}\n}\nadd_action( 'template_redirect', 'twentynineteen_preview' );\n", "num_lines": 80}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Twenty Nineteen: Color Patterns\n *\n * @package WordPress\n * @subpackage TwentyNineteen\n * @since Twenty Nineteen 1.0\n */\n\n/**\n * Generate the CSS for the current primary color.\n */\nfunction twentynineteen_custom_colors_css() {\n\n\t$primary_color = 199;\n\tif ( 'default' !== get_theme_mod( 'primary_color', 'default' ) ) {\n\t\t$primary_color = absint( get_theme_mod( 'primary_color_hue', 199 ) );\n\t}\n\n\t/**\n\t * Filter Twenty Nineteen default saturation level.\n\t *\n\t * @since Twenty Nineteen 1.0\n\t *\n\t * @param int $saturation Color saturation level.\n\t */\n\t$saturation = apply_filters( 'twentynineteen_custom_colors_saturation', 100 );\n\t$saturation = absint( $saturation ) . '%';\n\n\t/**\n\t * Filter Twenty Nineteen default selection saturation level.\n\t *\n\t * @since Twenty Nineteen 1.0\n\t *\n\t * @param int $saturation_selection Selection color saturation level.\n\t */\n\t$saturation_selection = absint( apply_filters( 'twentynineteen_custom_colors_saturation_selection', 50 ) );\n\t$saturation_selection = $saturation_selection . '%';\n\n\t/**\n\t * Filter Twenty Nineteen default lightness level.\n\t *\n\t * @since Twenty Nineteen 1.0\n\t *\n\t * @param int $lightness Color lightness level.\n\t */\n\t$lightness = apply_filters( 'twentynineteen_custom_colors_lightness', 33 );\n\t$lightness = absint( $lightness ) . '%';\n\n\t/**\n\t * Filter Twenty Nineteen default hover lightness level.\n\t *\n\t * @since Twenty Nineteen 1.0\n\t *\n\t * @param int $lightness_hover Hover color lightness level.\n\t */\n\t$lightness_hover = apply_filters( 'twentynineteen_custom_colors_lightness_hover', 23 );\n\t$lightness_hover = absint( $lightness_hover ) . '%';\n\n\t/**\n\t * Filter Twenty Nineteen default selection lightness level.\n\t *\n\t * @since Twenty Nineteen 1.0\n\t *\n\t * @param int $lightness_selection Selection color lightness level.\n\t */\n\t$lightness_selection = apply_filters( 'twentynineteen_custom_colors_lightness_selection', 90 );\n\t$lightness_selection = absint( $lightness_selection ) . '%';\n\n\t$theme_css = '\n\t\t/*\n\t\t * Set background for:\n\t\t * - featured image :before\n\t\t * - featured image :before\n\t\t * - post thumbmail :before\n\t\t * - post thumbmail :before\n\t\t * - Submenu\n\t\t * - Sticky Post\n\t\t * - buttons\n\t\t * - WP Block Button\n\t\t * - Blocks\n\t\t */\n\t\t.image-filters-enabled .site-header.featured-image .site-featured-image:before,\n\t\t.image-filters-enabled .site-header.featured-image .site-featured-image:after,\n\t\t.image-filters-enabled .entry .post-thumbnail:before,\n\t\t.image-filters-enabled .entry .post-thumbnail:after,\n\t\t.main-navigation .sub-menu,\n\t\t.sticky-post,\n\t\t.entry .entry-content .wp-block-button .wp-block-button__link:not(.has-background),\n\t\t.entry .button, button, input[type=\"button\"], input[type=\"reset\"], input[type=\"submit\"],\n\t\t.entry .entry-content > .has-primary-background-color,\n\t\t.entry .entry-content > *[class^=\"wp-block-\"].has-primary-background-color,\n\t\t.entry .entry-content > *[class^=\"wp-block-\"] .has-primary-background-color,\n\t\t.entry .entry-content > *[class^=\"wp-block-\"].is-style-solid-color,\n\t\t.entry .entry-content > *[class^=\"wp-block-\"].is-style-solid-color.has-primary-background-color,\n\t\t.entry .entry-content .wp-block-file .wp-block-file__button {\n\t\t\tbackground-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */\n\t\t}\n\n\t\t/*\n\t\t * Set Color for:\n\t\t * - all links\n\t\t * - main navigation links\n\t\t * - Post navigation links\n\t\t * - Post entry meta hover\n\t\t * - Post entry header more-link hover\n\t\t * - main navigation svg\n\t\t * - comment navigation\n\t\t * - Comment edit link hover\n\t\t * - Site Footer Link hover\n\t\t * - Widget links\n\t\t */\n\t\ta,\n\t\ta:visited,\n\t\t.main-navigation .main-menu > li,\n\t\t.main-navigation ul.main-menu > li > a,\n\t\t.post-navigation .post-title,\n\t\t.entry .entry-meta a:hover,\n\t\t.entry .entry-footer a:hover,\n\t\t.entry .entry-content .more-link:hover,\n\t\t.main-navigation .main-menu > li > a + svg,\n\t\t.comment .comment-metadata > a:hover,\n\t\t.comment .comment-metadata .comment-edit-link:hover,\n\t\t#colophon .site-info a:hover,\n\t\t.widget a,\n\t\t.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color),\n\t\t.entry .entry-content > .has-primary-color,\n\t\t.entry .entry-content > *[class^=\"wp-block-\"] .has-primary-color,\n\t\t.entry .entry-content > *[class^=\"wp-block-\"].is-style-solid-color blockquote.has-primary-color,\n\t\t.entry .entry-content > *[class^=\"wp-block-\"].is-style-solid-color blockquote.has-primary-color p {\n\t\t\tcolor: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */\n\t\t}\n\n\t\t/*\n\t\t * Set border color for:\n\t\t * wp block quote\n\t\t * :focus\n\t\t */\n\t\tblockquote,\n\t\t.entry .entry-content blockquote,\n\t\t.entry .entry-content .wp-block-quote:not(.is-large),\n\t\t.entry .entry-content .wp-block-quote:not(.is-style-large),\n\t\tinput[type=\"text\"]:focus,\n\t\tinput[type=\"email\"]:focus,\n\t\tinput[type=\"url\"]:focus,\n\t\tinput[type=\"password\"]:focus,\n\t\tinput[type=\"search\"]:focus,\n\t\tinput[type=\"number\"]:focus,\n\t\tinput[type=\"tel\"]:focus,\n\t\tinput[type=\"range\"]:focus,\n\t\tinput[type=\"date\"]:focus,\n\t\tinput[type=\"month\"]:focus,\n\t\tinput[type=\"week\"]:focus,\n\t\tinput[type=\"time\"]:focus,\n\t\tinput[type=\"datetime\"]:focus,\n\t\tinput[type=\"datetime-local\"]:focus,\n\t\tinput[type=\"color\"]:focus,\n\t\ttextarea:focus {\n\t\t\tborder-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */\n\t\t}\n\n\t\t.gallery-item > div > a:focus {\n\t\t\tbox-shadow: 0 0 0 2px hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */\n\t\t}\n\n\t\t/* Hover colors */\n\t\ta:hover, a:active,\n\t\t.main-navigation .main-menu > li > a:hover,\n\t\t.main-navigation .main-menu > li > a:hover + svg,\n\t\t.post-navigation .nav-links a:hover,\n\t\t.post-navigation .nav-links a:hover .post-title,\n\t\t.author-bio .author-description .author-link:hover,\n\t\t.entry .entry-content > .has-secondary-color,\n\t\t.entry .entry-content > *[class^=\"wp-block-\"] .has-secondary-color,\n\t\t.entry .entry-content > *[class^=\"wp-block-\"].is-style-solid-color blockquote.has-secondary-color,\n\t\t.entry .entry-content > *[class^=\"wp-block-\"].is-style-solid-color blockquote.has-secondary-color p,\n\t\t.comment .comment-author .fn a:hover,\n\t\t.comment-reply-link:hover,\n\t\t.comment-navigation .nav-previous a:hover,\n\t\t.comment-navigation .nav-next a:hover,\n\t\t#cancel-comment-reply-link:hover,\n\t\t.widget a:hover {\n\t\t\tcolor: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */\n\t\t}\n\n\t\t.main-navigation .sub-menu > li > a:hover,\n\t\t.main-navigation .sub-menu > li > a:focus,\n\t\t.main-navigation .sub-menu > li > a:hover:after,\n\t\t.main-navigation .sub-menu > li > a:focus:after,\n\t\t.main-navigation .sub-menu > li > .menu-item-link-return:hover,\n\t\t.main-navigation .sub-menu > li > .menu-item-link-return:focus,\n\t\t.main-navigation .sub-menu > li > a:not(.submenu-expand):hover,\n\t\t.main-navigation .sub-menu > li > a:not(.submenu-expand):focus,\n\t\t.entry .entry-content > .has-secondary-background-color,\n\t\t.entry .entry-content > *[class^=\"wp-block-\"].has-secondary-background-color,\n\t\t.entry .entry-content > *[class^=\"wp-block-\"] .has-secondary-background-color,\n\t\t.entry .entry-content > *[class^=\"wp-block-\"].is-style-solid-color.has-secondary-background-color {\n\t\t\tbackground-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */\n\t\t}\n\n\t\t/* Text selection colors */\n\t\t::selection {\n\t\t\tbackground-color: hsl( ' . $primary_color . ', ' . $saturation_selection . ', ' . $lightness_selection . ' ); /* base: #005177; */\n\t\t}\n\t\t::-moz-selection {\n\t\t\tbackground-color: hsl( ' . $primary_color . ', ' . $saturation_selection . ', ' . $lightness_selection . ' ); /* base: #005177; */\n\t\t}';\n\n\t$editor_css = '\n\t\t/*\n\t\t * Set colors for:\n\t\t * - links\n\t\t * - blockquote\n\t\t * - pullquote (solid color)\n\t\t * - buttons\n\t\t */\n\t\t.editor-block-list__layout .editor-block-list__block a,\n\t\t.editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color),\n\t\t.editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:hover .wp-block-button__link:not(.has-text-color),\n\t\t.editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:focus .wp-block-button__link:not(.has-text-color),\n\t\t.editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:active .wp-block-button__link:not(.has-text-color),\n\t\t.editor-block-list__layout .editor-block-list__block .wp-block-file .wp-block-file__textlink {\n\t\t\tcolor: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */\n\t\t}\n\n\t\t.editor-block-list__layout .editor-block-list__block .wp-block-quote:not(.is-large):not(.is-style-large),\n\t\t.editor-styles-wrapper .editor-block-list__layout .wp-block-freeform blockquote {\n\t\t\tborder-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */\n\t\t}\n\n\t\t.editor-block-list__layout .editor-block-list__block .wp-block-pullquote.is-style-solid-color:not(.has-background-color) {\n\t\t\tbackground-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */\n\t\t}\n\n\t\t.editor-block-list__layout .editor-block-list__block .wp-block-file .wp-block-file__button,\n\t\t.editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link,\n\t\t.editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:active,\n\t\t.editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:focus,\n\t\t.editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {\n\t\t\tbackground-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */\n\t\t}\n\n\t\t/* Hover colors */\n\t\t.editor-block-list__layout .editor-block-list__block a:hover,\n\t\t.editor-block-list__layout .editor-block-list__block a:active,\n\t\t.editor-block-list__layout .editor-block-list__block .wp-block-file .wp-block-file__textlink:hover {\n\t\t\tcolor: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */\n\t\t}\n\n\t\t/* Do not overwrite solid color pullquote or cover links */\n\t\t.editor-block-list__layout .editor-block-list__block .wp-block-pullquote.is-style-solid-color a,\n\t\t.editor-block-list__layout .editor-block-list__block .wp-block-cover a {\n\t\t\tcolor: inherit;\n\t\t}\n\t\t';\n\n\tif ( function_exists( 'register_block_type' ) && is_admin() ) {\n\t\t$theme_css = $editor_css;\n\t}\n\n\t/**\n\t * Filters Twenty Nineteen custom colors CSS.\n\t *\n\t * @since Twenty Nineteen 1.0\n\t *\n\t * @param string $css           Base theme colors CSS.\n\t * @param int    $primary_color The user's selected color hue.\n\t * @param string $saturation    Filtered theme color saturation level.\n\t */\n\treturn apply_filters( 'twentynineteen_custom_colors_css', $theme_css, $primary_color, $saturation );\n}\n", "num_lines": 272}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Twenty Nineteen: Customizer\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\n/**\n * Add postMessage support for site title and description for the Theme Customizer.\n *\n * @param WP_Customize_Manager $wp_customize Theme Customizer object.\n */\nfunction twentynineteen_customize_register( $wp_customize ) {\n\t$wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';\n\t$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';\n\t$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';\n\n\tif ( isset( $wp_customize->selective_refresh ) ) {\n\t\t$wp_customize->selective_refresh->add_partial(\n\t\t\t'blogname',\n\t\t\tarray(\n\t\t\t\t'selector'        => '.site-title a',\n\t\t\t\t'render_callback' => 'twentynineteen_customize_partial_blogname',\n\t\t\t)\n\t\t);\n\t\t$wp_customize->selective_refresh->add_partial(\n\t\t\t'blogdescription',\n\t\t\tarray(\n\t\t\t\t'selector'        => '.site-description',\n\t\t\t\t'render_callback' => 'twentynineteen_customize_partial_blogdescription',\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Primary color.\n\t */\n\t$wp_customize->add_setting(\n\t\t'primary_color',\n\t\tarray(\n\t\t\t'default'           => 'default',\n\t\t\t'transport'         => 'postMessage',\n\t\t\t'sanitize_callback' => 'twentynineteen_sanitize_color_option',\n\t\t)\n\t);\n\n\t$wp_customize->add_control(\n\t\t'primary_color',\n\t\tarray(\n\t\t\t'type'     => 'radio',\n\t\t\t'label'    => __( 'Primary Color', 'twentynineteen' ),\n\t\t\t'choices'  => array(\n\t\t\t\t'default' => _x( 'Default', 'primary color', 'twentynineteen' ),\n\t\t\t\t'custom'  => _x( 'Custom', 'primary color', 'twentynineteen' ),\n\t\t\t),\n\t\t\t'section'  => 'colors',\n\t\t\t'priority' => 5,\n\t\t)\n\t);\n\n\t// Add primary color hue setting and control.\n\t$wp_customize->add_setting(\n\t\t'primary_color_hue',\n\t\tarray(\n\t\t\t'default'           => 199,\n\t\t\t'transport'         => 'postMessage',\n\t\t\t'sanitize_callback' => 'absint',\n\t\t)\n\t);\n\n\t$wp_customize->add_control(\n\t\tnew WP_Customize_Color_Control(\n\t\t\t$wp_customize,\n\t\t\t'primary_color_hue',\n\t\t\tarray(\n\t\t\t\t'description' => __( 'Apply a custom color for buttons, links, featured images, etc.', 'twentynineteen' ),\n\t\t\t\t'section'     => 'colors',\n\t\t\t\t'mode'        => 'hue',\n\t\t\t)\n\t\t)\n\t);\n\n\t// Add image filter setting and control.\n\t$wp_customize->add_setting(\n\t\t'image_filter',\n\t\tarray(\n\t\t\t'default'           => 1,\n\t\t\t'sanitize_callback' => 'absint',\n\t\t\t'transport'         => 'postMessage',\n\t\t)\n\t);\n\n\t$wp_customize->add_control(\n\t\t'image_filter',\n\t\tarray(\n\t\t\t'label'   => __( 'Apply a filter to featured images using the primary color', 'twentynineteen' ),\n\t\t\t'section' => 'colors',\n\t\t\t'type'    => 'checkbox',\n\t\t)\n\t);\n}\nadd_action( 'customize_register', 'twentynineteen_customize_register' );\n\n/**\n * Render the site title for the selective refresh partial.\n *\n * @return void\n */\nfunction twentynineteen_customize_partial_blogname() {\n\tbloginfo( 'name' );\n}\n\n/**\n * Render the site tagline for the selective refresh partial.\n *\n * @return void\n */\nfunction twentynineteen_customize_partial_blogdescription() {\n\tbloginfo( 'description' );\n}\n\n/**\n * Bind JS handlers to instantly live-preview changes.\n */\nfunction twentynineteen_customize_preview_js() {\n\twp_enqueue_script( 'twentynineteen-customize-preview', get_theme_file_uri( '/js/customize-preview.js' ), array( 'customize-preview' ), '20181214', true );\n}\nadd_action( 'customize_preview_init', 'twentynineteen_customize_preview_js' );\n\n/**\n * Load dynamic logic for the customizer controls area.\n */\nfunction twentynineteen_panels_js() {\n\twp_enqueue_script( 'twentynineteen-customize-controls', get_theme_file_uri( '/js/customize-controls.js' ), array(), '20181214', true );\n}\nadd_action( 'customize_controls_enqueue_scripts', 'twentynineteen_panels_js' );\n\n/**\n * Sanitize custom color choice.\n *\n * @param string $choice Whether image filter is active.\n * @return string\n */\nfunction twentynineteen_sanitize_color_option( $choice ) {\n\t$valid = array(\n\t\t'default',\n\t\t'custom',\n\t);\n\n\tif ( in_array( $choice, $valid, true ) ) {\n\t\treturn $choice;\n\t}\n\n\treturn 'default';\n}\n", "num_lines": 158}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Common theme functions\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.5\n */\n\n/**\n * Determines if post thumbnail can be displayed.\n */\nfunction twentynineteen_can_show_post_thumbnail() {\n\treturn apply_filters( 'twentynineteen_can_show_post_thumbnail', ! post_password_required() && ! is_attachment() && has_post_thumbnail() );\n}\n\n/**\n * Returns true if image filters are enabled on the theme options.\n */\nfunction twentynineteen_image_filters_enabled() {\n\treturn 0 !== get_theme_mod( 'image_filter', 1 );\n}\n\n/**\n * Returns the size for avatars used in the theme.\n */\nfunction twentynineteen_get_avatar_size() {\n\treturn 60;\n}\n\n/**\n * Returns true if comment is by author of the post.\n *\n * @see get_comment_class()\n */\nfunction twentynineteen_is_comment_by_post_author( $comment = null ) {\n\tif ( is_object( $comment ) && $comment->user_id > 0 ) {\n\t\t$user = get_userdata( $comment->user_id );\n\t\t$post = get_post( $comment->comment_post_ID );\n\t\tif ( ! empty( $user ) && ! empty( $post ) ) {\n\t\t\treturn $comment->user_id === $post->post_author;\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Returns information about the current post's discussion, with cache support.\n */\nfunction twentynineteen_get_discussion_data() {\n\tstatic $discussion, $post_id;\n\n\t$current_post_id = get_the_ID();\n\tif ( $current_post_id === $post_id ) {\n\t\treturn $discussion; /* If we have discussion information for post ID, return cached object */\n\t} else {\n\t\t$post_id = $current_post_id;\n\t}\n\n\t$comments = get_comments(\n\t\tarray(\n\t\t\t'post_id' => $current_post_id,\n\t\t\t'orderby' => 'comment_date_gmt',\n\t\t\t'order'   => get_option( 'comment_order', 'asc' ), /* Respect comment order from Settings \u00c2\u00bb Discussion. */\n\t\t\t'status'  => 'approve',\n\t\t\t'number'  => 20, /* Only retrieve the last 20 comments, as the end goal is just 6 unique authors */\n\t\t)\n\t);\n\n\t$authors = array();\n\tforeach ( $comments as $comment ) {\n\t\t$authors[] = ( (int) $comment->user_id > 0 ) ? (int) $comment->user_id : $comment->comment_author_email;\n\t}\n\n\t$authors    = array_unique( $authors );\n\t$discussion = (object) array(\n\t\t'authors'   => array_slice( $authors, 0, 6 ),           /* Six unique authors commenting on the post. */\n\t\t'responses' => get_comments_number( $current_post_id ), /* Number of responses. */\n\t);\n\n\treturn $discussion;\n}\n\n/**\n * Converts HSL to HEX colors.\n */\nfunction twentynineteen_hsl_hex( $h, $s, $l, $to_hex = true ) {\n\n\t$h /= 360;\n\t$s /= 100;\n\t$l /= 100;\n\n\t$r = $l;\n\t$g = $l;\n\t$b = $l;\n\t$v = ( $l <= 0.5 ) ? ( $l * ( 1.0 + $s ) ) : ( $l + $s - $l * $s );\n\tif ( $v > 0 ) {\n\t\t$m;\n\t\t$sv;\n\t\t$sextant;\n\t\t$fract;\n\t\t$vsf;\n\t\t$mid1;\n\t\t$mid2;\n\n\t\t$m       = $l + $l - $v;\n\t\t$sv      = ( $v - $m ) / $v;\n\t\t$h      *= 6.0;\n\t\t$sextant = floor( $h );\n\t\t$fract   = $h - $sextant;\n\t\t$vsf     = $v * $sv * $fract;\n\t\t$mid1    = $m + $vsf;\n\t\t$mid2    = $v - $vsf;\n\n\t\tswitch ( $sextant ) {\n\t\t\tcase 0:\n\t\t\t\t$r = $v;\n\t\t\t\t$g = $mid1;\n\t\t\t\t$b = $m;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$r = $mid2;\n\t\t\t\t$g = $v;\n\t\t\t\t$b = $m;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$r = $m;\n\t\t\t\t$g = $v;\n\t\t\t\t$b = $mid1;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$r = $m;\n\t\t\t\t$g = $mid2;\n\t\t\t\t$b = $v;\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$r = $mid1;\n\t\t\t\t$g = $m;\n\t\t\t\t$b = $v;\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$r = $v;\n\t\t\t\t$g = $m;\n\t\t\t\t$b = $mid2;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t$r = round( $r * 255, 0 );\n\t$g = round( $g * 255, 0 );\n\t$b = round( $b * 255, 0 );\n\n\tif ( $to_hex ) {\n\n\t\t$r = ( $r < 15 ) ? '0' . dechex( $r ) : dechex( $r );\n\t\t$g = ( $g < 15 ) ? '0' . dechex( $g ) : dechex( $g );\n\t\t$b = ( $b < 15 ) ? '0' . dechex( $b ) : dechex( $b );\n\n\t\treturn \"#$r$g$b\";\n\n\t}\n\n\treturn \"rgb($r, $g, $b)\";\n}\n", "num_lines": 164}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SVG icons related functions\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\n/**\n * Gets the SVG code for a given icon.\n */\nfunction twentynineteen_get_icon_svg( $icon, $size = 24 ) {\n\treturn TwentyNineteen_SVG_Icons::get_svg( 'ui', $icon, $size );\n}\n\n/**\n * Gets the SVG code for a given social icon.\n */\nfunction twentynineteen_get_social_icon_svg( $icon, $size = 24 ) {\n\treturn TwentyNineteen_SVG_Icons::get_svg( 'social', $icon, $size );\n}\n\n/**\n * Detects the social network from a URL and returns the SVG code for its icon.\n */\nfunction twentynineteen_get_social_link_svg( $uri, $size = 24 ) {\n\treturn TwentyNineteen_SVG_Icons::get_social_link_svg( $uri, $size );\n}\n\n/**\n * Display SVG icons in social links menu.\n *\n * @param string   $item_output The menu item's starting HTML output.\n * @param WP_Post  $item        Menu item data object.\n * @param int      $depth       Depth of the menu. Used for padding.\n * @param stdClass $args        An object of wp_nav_menu() arguments.\n * @return string The menu item output with social icon.\n */\nfunction twentynineteen_nav_menu_social_icons( $item_output, $item, $depth, $args ) {\n\t// Change SVG icon inside social links menu if there is supported URL.\n\tif ( 'social' === $args->theme_location ) {\n\t\t$svg = twentynineteen_get_social_link_svg( $item->url, 26 );\n\t\tif ( empty( $svg ) ) {\n\t\t\t$svg = twentynineteen_get_icon_svg( 'link' );\n\t\t}\n\t\t$item_output = str_replace( $args->link_after, '</span>' . $svg, $item_output );\n\t}\n\n\treturn $item_output;\n}\nadd_filter( 'walker_nav_menu_start_el', 'twentynineteen_nav_menu_social_icons', 10, 4 );\n\n/**\n * Add a dropdown icon to top-level menu items.\n *\n * @param string   $item_output The menu item's starting HTML output.\n * @param WP_Post  $item        Menu item data object.\n * @param int      $depth       Depth of the menu. Used for padding.\n * @param stdClass $args        An object of wp_nav_menu() arguments.\n * @return string Nav menu item start element.\n */\nfunction twentynineteen_add_dropdown_icons( $item_output, $item, $depth, $args ) {\n\n\t// Only add class to 'top level' items on the 'primary' menu.\n\tif ( ! isset( $args->theme_location ) || 'menu-1' !== $args->theme_location ) {\n\t\treturn $item_output;\n\t}\n\n\tif ( in_array( 'mobile-parent-nav-menu-item', $item->classes, true ) && isset( $item->original_id ) ) {\n\t\t// Inject the keyboard_arrow_left SVG inside the parent nav menu item, and let the item link to the parent item.\n\t\t// @todo Only do this for nested submenus? If on a first-level submenu, then really the link could be \"#\" since the desire is to remove the target entirely.\n\t\t$link = sprintf(\n\t\t\t'<button class=\"menu-item-link-return\" tabindex=\"-1\">%s',\n\t\t\ttwentynineteen_get_icon_svg( 'chevron_left', 24 )\n\t\t);\n\n\t\t// Replace opening <a> with <button>.\n\t\t$item_output = preg_replace(\n\t\t\t'/<a\\s.*?>/',\n\t\t\t$link,\n\t\t\t$item_output,\n\t\t\t1 // Limit.\n\t\t);\n\n\t\t// Replace closing </a> with </button>.\n\t\t$item_output = preg_replace(\n\t\t\t'#</a>#i',\n\t\t\t'</button>',\n\t\t\t$item_output,\n\t\t\t1 // Limit.\n\t\t);\n\n\t} elseif ( in_array( 'menu-item-has-children', $item->classes, true ) ) {\n\n\t\t// Add SVG icon to parent items.\n\t\t$icon = twentynineteen_get_icon_svg( 'keyboard_arrow_down', 24 );\n\n\t\t$item_output .= sprintf(\n\t\t\t'<button class=\"submenu-expand\" tabindex=\"-1\">%s</button>',\n\t\t\t$icon\n\t\t);\n\t}\n\n\treturn $item_output;\n}\nadd_filter( 'walker_nav_menu_start_el', 'twentynineteen_add_dropdown_icons', 10, 4 );\n", "num_lines": 108}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Functions which enhance the theme by hooking into WordPress\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\n/**\n * Adds custom classes to the array of body classes.\n *\n * @param array $classes Classes for the body element.\n * @return array\n */\nfunction twentynineteen_body_classes( $classes ) {\n\n\tif ( is_singular() ) {\n\t\t// Adds `singular` to singular pages.\n\t\t$classes[] = 'singular';\n\t} else {\n\t\t// Adds `hfeed` to non-singular pages.\n\t\t$classes[] = 'hfeed';\n\t}\n\n\t// Adds a class if image filters are enabled.\n\tif ( twentynineteen_image_filters_enabled() ) {\n\t\t$classes[] = 'image-filters-enabled';\n\t}\n\n\treturn $classes;\n}\nadd_filter( 'body_class', 'twentynineteen_body_classes' );\n\n/**\n * Adds custom class to the array of posts classes.\n */\nfunction twentynineteen_post_classes( $classes, $class, $post_id ) {\n\t$classes[] = 'entry';\n\n\treturn $classes;\n}\nadd_filter( 'post_class', 'twentynineteen_post_classes', 10, 3 );\n\n\n/**\n * Add a pingback url auto-discovery header for single posts, pages, or attachments.\n */\nfunction twentynineteen_pingback_header() {\n\tif ( is_singular() && pings_open() ) {\n\t\techo '<link rel=\"pingback\" href=\"', esc_url( get_bloginfo( 'pingback_url' ) ), '\">';\n\t}\n}\nadd_action( 'wp_head', 'twentynineteen_pingback_header' );\n\n/**\n * Changes comment form default fields.\n */\nfunction twentynineteen_comment_form_defaults( $defaults ) {\n\t$comment_field = $defaults['comment_field'];\n\n\t// Adjust height of comment form.\n\t$defaults['comment_field'] = preg_replace( '/rows=\"\\d+\"/', 'rows=\"5\"', $comment_field );\n\n\treturn $defaults;\n}\nadd_filter( 'comment_form_defaults', 'twentynineteen_comment_form_defaults' );\n\n/**\n * Filters the default archive titles.\n */\nfunction twentynineteen_get_the_archive_title() {\n\tif ( is_category() ) {\n\t\t$title = __( 'Category Archives: ', 'twentynineteen' ) . '<span class=\"page-description\">' . single_term_title( '', false ) . '</span>';\n\t} elseif ( is_tag() ) {\n\t\t$title = __( 'Tag Archives: ', 'twentynineteen' ) . '<span class=\"page-description\">' . single_term_title( '', false ) . '</span>';\n\t} elseif ( is_author() ) {\n\t\t$title = __( 'Author Archives: ', 'twentynineteen' ) . '<span class=\"page-description\">' . get_the_author_meta( 'display_name' ) . '</span>';\n\t} elseif ( is_year() ) {\n\t\t$title = __( 'Yearly Archives: ', 'twentynineteen' ) . '<span class=\"page-description\">' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentynineteen' ) ) . '</span>';\n\t} elseif ( is_month() ) {\n\t\t$title = __( 'Monthly Archives: ', 'twentynineteen' ) . '<span class=\"page-description\">' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentynineteen' ) ) . '</span>';\n\t} elseif ( is_day() ) {\n\t\t$title = __( 'Daily Archives: ', 'twentynineteen' ) . '<span class=\"page-description\">' . get_the_date() . '</span>';\n\t} elseif ( is_post_type_archive() ) {\n\t\t$title = __( 'Post Type Archives: ', 'twentynineteen' ) . '<span class=\"page-description\">' . post_type_archive_title( '', false ) . '</span>';\n\t} elseif ( is_tax() ) {\n\t\t$tax = get_taxonomy( get_queried_object()->taxonomy );\n\t\t/* translators: %s: Taxonomy singular name. */\n\t\t$title = sprintf( esc_html__( '%s Archives:', 'twentynineteen' ), $tax->labels->singular_name );\n\t} else {\n\t\t$title = __( 'Archives:', 'twentynineteen' );\n\t}\n\treturn $title;\n}\nadd_filter( 'get_the_archive_title', 'twentynineteen_get_the_archive_title' );\n\n/**\n * Add custom sizes attribute to responsive image functionality for post thumbnails.\n *\n * @origin Twenty Nineteen 1.0\n *\n * @param array $attr  Attributes for the image markup.\n * @return string Value for use in post thumbnail 'sizes' attribute.\n */\nfunction twentynineteen_post_thumbnail_sizes_attr( $attr ) {\n\n\tif ( is_admin() ) {\n\t\treturn $attr;\n\t}\n\n\tif ( ! is_singular() ) {\n\t\t$attr['sizes'] = '(max-width: 34.9rem) calc(100vw - 2rem), (max-width: 53rem) calc(8 * (100vw / 12)), (min-width: 53rem) calc(6 * (100vw / 12)), 100vw';\n\t}\n\n\treturn $attr;\n}\nadd_filter( 'wp_get_attachment_image_attributes', 'twentynineteen_post_thumbnail_sizes_attr', 10, 1 );\n\n/**\n * Add an extra menu to our nav for our priority+ navigation to use\n *\n * @param object $nav_menu  Nav menu.\n * @param object $args      Nav menu args.\n * @return string More link for hidden menu items.\n */\nfunction twentynineteen_add_ellipses_to_nav( $nav_menu, $args ) {\n\n\tif ( 'menu-1' === $args->theme_location ) :\n\n\t\t$nav_menu .= '\n\t\t\t<div class=\"main-menu-more\">\n\t\t\t\t<ul class=\"main-menu\">\n\t\t\t\t\t<li class=\"menu-item menu-item-has-children\">\n\t\t\t\t\t\t<button class=\"submenu-expand main-menu-more-toggle is-empty\" tabindex=\"-1\"\n\t\t\t\t\t\t\taria-label=\"' . esc_attr__( 'More', 'twentynineteen' ) . '\" aria-haspopup=\"true\" aria-expanded=\"false\">' .\n\t\t\t\t\t\t\ttwentynineteen_get_icon_svg( 'arrow_drop_down_ellipsis' ) . '\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<ul class=\"sub-menu hidden-links\">\n\t\t\t\t\t\t\t<li class=\"mobile-parent-nav-menu-item\">\n\t\t\t\t\t\t\t\t<button class=\"menu-item-link-return\">' .\n\t\t\t\t\t\t\t\t\ttwentynineteen_get_icon_svg( 'chevron_left' ) .\n\t\t\t\t\t\t\t\t\tesc_html__( 'Back', 'twentynineteen' ) . '\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>';\n\n\tendif;\n\n\treturn $nav_menu;\n}\nadd_filter( 'wp_nav_menu', 'twentynineteen_add_ellipses_to_nav', 10, 2 );\n\n/**\n * WCAG 2.0 Attributes for Dropdown Menus\n *\n * Adjustments to menu attributes tot support WCAG 2.0 recommendations\n * for flyout and dropdown menus.\n *\n * @ref https://www.w3.org/WAI/tutorials/menus/flyout/\n */\nfunction twentynineteen_nav_menu_link_attributes( $atts, $item, $args, $depth ) {\n\n\t// Add [aria-haspopup] and [aria-expanded] to menu items that have children.\n\t$item_has_children = in_array( 'menu-item-has-children', $item->classes, true );\n\tif ( $item_has_children ) {\n\t\t$atts['aria-haspopup'] = 'true';\n\t\t$atts['aria-expanded'] = 'false';\n\t}\n\n\treturn $atts;\n}\nadd_filter( 'nav_menu_link_attributes', 'twentynineteen_nav_menu_link_attributes', 10, 4 );\n\n/**\n * Create a nav menu item to be displayed on mobile to navigate from submenu back to the parent.\n *\n * This duplicates each parent nav menu item and makes it the first child of itself.\n *\n * @param array  $sorted_menu_items Sorted nav menu items.\n * @param object $args              Nav menu args.\n * @return array Amended nav menu items.\n */\nfunction twentynineteen_add_mobile_parent_nav_menu_items( $sorted_menu_items, $args ) {\n\tstatic $pseudo_id = 0;\n\tif ( ! isset( $args->theme_location ) || 'menu-1' !== $args->theme_location ) {\n\t\treturn $sorted_menu_items;\n\t}\n\n\t$amended_menu_items = array();\n\tforeach ( $sorted_menu_items as $nav_menu_item ) {\n\t\t$amended_menu_items[] = $nav_menu_item;\n\t\tif ( in_array( 'menu-item-has-children', $nav_menu_item->classes, true ) ) {\n\t\t\t$parent_menu_item                   = clone $nav_menu_item;\n\t\t\t$parent_menu_item->original_id      = $nav_menu_item->ID;\n\t\t\t$parent_menu_item->ID               = --$pseudo_id;\n\t\t\t$parent_menu_item->db_id            = $parent_menu_item->ID;\n\t\t\t$parent_menu_item->object_id        = $parent_menu_item->ID;\n\t\t\t$parent_menu_item->classes          = array( 'mobile-parent-nav-menu-item' );\n\t\t\t$parent_menu_item->menu_item_parent = $nav_menu_item->ID;\n\n\t\t\t$amended_menu_items[] = $parent_menu_item;\n\t\t}\n\t}\n\n\treturn $amended_menu_items;\n}\nadd_filter( 'wp_nav_menu_objects', 'twentynineteen_add_mobile_parent_nav_menu_items', 10, 2 );\n", "num_lines": 212}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Custom template tags for this theme\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\nif ( ! function_exists( 'twentynineteen_posted_on' ) ) :\n\t/**\n\t * Prints HTML with meta information for the current post-date/time.\n\t */\n\tfunction twentynineteen_posted_on() {\n\t\t$time_string = '<time class=\"entry-date published updated\" datetime=\"%1$s\">%2$s</time>';\n\t\tif ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {\n\t\t\t$time_string = '<time class=\"entry-date published\" datetime=\"%1$s\">%2$s</time><time class=\"updated\" datetime=\"%3$s\">%4$s</time>';\n\t\t}\n\n\t\t$time_string = sprintf(\n\t\t\t$time_string,\n\t\t\tesc_attr( get_the_date( DATE_W3C ) ),\n\t\t\tesc_html( get_the_date() ),\n\t\t\tesc_attr( get_the_modified_date( DATE_W3C ) ),\n\t\t\tesc_html( get_the_modified_date() )\n\t\t);\n\n\t\tprintf(\n\t\t\t'<span class=\"posted-on\">%1$s<a href=\"%2$s\" rel=\"bookmark\">%3$s</a></span>',\n\t\t\ttwentynineteen_get_icon_svg( 'watch', 16 ),\n\t\t\tesc_url( get_permalink() ),\n\t\t\t$time_string\n\t\t);\n\t}\nendif;\n\nif ( ! function_exists( 'twentynineteen_posted_by' ) ) :\n\t/**\n\t * Prints HTML with meta information about theme author.\n\t */\n\tfunction twentynineteen_posted_by() {\n\t\tprintf(\n\t\t\t/* translators: 1: SVG icon. 2: Post author, only visible to screen readers. 3: Author link. */\n\t\t\t'<span class=\"byline\">%1$s<span class=\"screen-reader-text\">%2$s</span><span class=\"author vcard\"><a class=\"url fn n\" href=\"%3$s\">%4$s</a></span></span>',\n\t\t\ttwentynineteen_get_icon_svg( 'person', 16 ),\n\t\t\t__( 'Posted by', 'twentynineteen' ),\n\t\t\tesc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\n\t\t\tesc_html( get_the_author() )\n\t\t);\n\t}\nendif;\n\nif ( ! function_exists( 'twentynineteen_comment_count' ) ) :\n\t/**\n\t * Prints HTML with the comment count for the current post.\n\t */\n\tfunction twentynineteen_comment_count() {\n\t\tif ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {\n\t\t\techo '<span class=\"comments-link\">';\n\t\t\techo twentynineteen_get_icon_svg( 'comment', 16 );\n\n\t\t\t/* translators: %s: Post title. Only visible to screen readers. */\n\t\t\tcomments_popup_link( sprintf( __( 'Leave a comment<span class=\"screen-reader-text\"> on %s</span>', 'twentynineteen' ), get_the_title() ) );\n\n\t\t\techo '</span>';\n\t\t}\n\t}\nendif;\n\nif ( ! function_exists( 'twentynineteen_entry_footer' ) ) :\n\t/**\n\t * Prints HTML with meta information for the categories, tags and comments.\n\t */\n\tfunction twentynineteen_entry_footer() {\n\n\t\t// Hide author, post date, category and tag text for pages.\n\t\tif ( 'post' === get_post_type() ) {\n\n\t\t\t// Posted by.\n\t\t\ttwentynineteen_posted_by();\n\n\t\t\t// Posted on.\n\t\t\ttwentynineteen_posted_on();\n\n\t\t\t/* translators: Used between list items, there is a space after the comma. */\n\t\t\t$categories_list = get_the_category_list( __( ', ', 'twentynineteen' ) );\n\t\t\tif ( $categories_list ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: SVG icon. 2: Posted in label, only visible to screen readers. 3: List of categories. */\n\t\t\t\t\t'<span class=\"cat-links\">%1$s<span class=\"screen-reader-text\">%2$s</span>%3$s</span>',\n\t\t\t\t\ttwentynineteen_get_icon_svg( 'archive', 16 ),\n\t\t\t\t\t__( 'Posted in', 'twentynineteen' ),\n\t\t\t\t\t$categories_list\n\t\t\t\t); // WPCS: XSS OK.\n\t\t\t}\n\n\t\t\t/* translators: Used between list items, there is a space after the comma. */\n\t\t\t$tags_list = get_the_tag_list( '', __( ', ', 'twentynineteen' ) );\n\t\t\tif ( $tags_list && ! is_wp_error( $tags_list ) ) {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: SVG icon. 2: Posted in label, only visible to screen readers. 3: List of tags. */\n\t\t\t\t\t'<span class=\"tags-links\">%1$s<span class=\"screen-reader-text\">%2$s </span>%3$s</span>',\n\t\t\t\t\ttwentynineteen_get_icon_svg( 'tag', 16 ),\n\t\t\t\t\t__( 'Tags:', 'twentynineteen' ),\n\t\t\t\t\t$tags_list\n\t\t\t\t); // WPCS: XSS OK.\n\t\t\t}\n\t\t}\n\n\t\t// Comment count.\n\t\tif ( ! is_singular() ) {\n\t\t\ttwentynineteen_comment_count();\n\t\t}\n\n\t\t// Edit post link.\n\t\tedit_post_link(\n\t\t\tsprintf(\n\t\t\t\twp_kses(\n\t\t\t\t\t/* translators: %s: Post title. Only visible to screen readers. */\n\t\t\t\t\t__( 'Edit <span class=\"screen-reader-text\">%s</span>', 'twentynineteen' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'span' => array(\n\t\t\t\t\t\t\t'class' => array(),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tget_the_title()\n\t\t\t),\n\t\t\t'<span class=\"edit-link\">' . twentynineteen_get_icon_svg( 'edit', 16 ),\n\t\t\t'</span>'\n\t\t);\n\t}\nendif;\n\nif ( ! function_exists( 'twentynineteen_post_thumbnail' ) ) :\n\t/**\n\t * Displays an optional post thumbnail.\n\t *\n\t * Wraps the post thumbnail in an anchor element on index views, or a div\n\t * element when on single views.\n\t */\n\tfunction twentynineteen_post_thumbnail() {\n\t\tif ( ! twentynineteen_can_show_post_thumbnail() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( is_singular() ) :\n\t\t\t?>\n\n\t\t\t<figure class=\"post-thumbnail\">\n\t\t\t\t<?php the_post_thumbnail(); ?>\n\t\t\t</figure><!-- .post-thumbnail -->\n\n\t\t\t<?php\n\t\telse :\n\t\t\t?>\n\n\t\t<figure class=\"post-thumbnail\">\n\t\t\t<a class=\"post-thumbnail-inner\" href=\"<?php the_permalink(); ?>\" aria-hidden=\"true\" tabindex=\"-1\">\n\t\t\t\t<?php the_post_thumbnail( 'post-thumbnail' ); ?>\n\t\t\t</a>\n\t\t</figure>\n\n\t\t\t<?php\n\t\tendif; // End is_singular().\n\t}\nendif;\n\nif ( ! function_exists( 'twentynineteen_get_user_avatar_markup' ) ) :\n\t/**\n\t * Returns the HTML markup to generate a user avatar.\n\t */\n\tfunction twentynineteen_get_user_avatar_markup( $id_or_email = null ) {\n\n\t\tif ( ! isset( $id_or_email ) ) {\n\t\t\t$id_or_email = get_current_user_id();\n\t\t}\n\n\t\treturn sprintf( '<div class=\"comment-user-avatar comment-author vcard\">%s</div>', get_avatar( $id_or_email, twentynineteen_get_avatar_size() ) );\n\t}\nendif;\n\nif ( ! function_exists( 'twentynineteen_discussion_avatars_list' ) ) :\n\t/**\n\t * Displays a list of avatars involved in a discussion for a given post.\n\t */\n\tfunction twentynineteen_discussion_avatars_list( $comment_authors ) {\n\t\tif ( empty( $comment_authors ) ) {\n\t\t\treturn;\n\t\t}\n\t\techo '<ol class=\"discussion-avatar-list\">', \"\\n\";\n\t\tforeach ( $comment_authors as $id_or_email ) {\n\t\t\tprintf(\n\t\t\t\t\"<li>%s</li>\\n\",\n\t\t\t\ttwentynineteen_get_user_avatar_markup( $id_or_email )\n\t\t\t);\n\t\t}\n\t\techo '</ol><!-- .discussion-avatar-list -->', \"\\n\";\n\t}\nendif;\n\nif ( ! function_exists( 'twentynineteen_comment_form' ) ) :\n\t/**\n\t * Documentation for function.\n\t */\n\tfunction twentynineteen_comment_form( $order ) {\n\t\tif ( true === $order || strtolower( $order ) === strtolower( get_option( 'comment_order', 'asc' ) ) ) {\n\n\t\t\tcomment_form(\n\t\t\t\tarray(\n\t\t\t\t\t'logged_in_as' => null,\n\t\t\t\t\t'title_reply'  => null,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\nendif;\n\nif ( ! function_exists( 'twentynineteen_the_posts_navigation' ) ) :\n\t/**\n\t * Documentation for function.\n\t */\n\tfunction twentynineteen_the_posts_navigation() {\n\t\tthe_posts_pagination(\n\t\t\tarray(\n\t\t\t\t'mid_size'  => 2,\n\t\t\t\t'prev_text' => sprintf(\n\t\t\t\t\t'%s <span class=\"nav-prev-text\">%s</span>',\n\t\t\t\t\ttwentynineteen_get_icon_svg( 'chevron_left', 22 ),\n\t\t\t\t\t__( 'Newer posts', 'twentynineteen' )\n\t\t\t\t),\n\t\t\t\t'next_text' => sprintf(\n\t\t\t\t\t'<span class=\"nav-next-text\">%s</span> %s',\n\t\t\t\t\t__( 'Older posts', 'twentynineteen' ),\n\t\t\t\t\ttwentynineteen_get_icon_svg( 'chevron_right', 22 )\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}\nendif;\n\nif ( ! function_exists( 'wp_body_open' ) ) :\n\t/**\n\t * Fire the wp_body_open action.\n\t *\n\t * Added for backward compatibility to support pre-5.2.0 WordPress versions.\n\t *\n\t * @since Twenty Nineteen 1.4\n\t */\n\tfunction wp_body_open() {\n\t\t/**\n\t\t * Triggered after the opening <body> tag.\n\t\t *\n\t\t * @since Twenty Nineteen 1.4\n\t\t */\n\t\tdo_action( 'wp_body_open' );\n\t}\nendif;\n", "num_lines": 259}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template part for displaying post archives and search results\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\n?>\n\n<article id=\"post-<?php the_ID(); ?>\" <?php post_class(); ?>>\n\t<header class=\"entry-header\">\n\t\t<?php\n\t\tif ( is_sticky() && is_home() && ! is_paged() ) {\n\t\t\tprintf( '<span class=\"sticky-post\">%s</span>', _x( 'Featured', 'post', 'twentynineteen' ) );\n\t\t}\n\t\tthe_title( sprintf( '<h2 class=\"entry-title\"><a href=\"%s\" rel=\"bookmark\">', esc_url( get_permalink() ) ), '</a></h2>' );\n\t\t?>\n\t</header><!-- .entry-header -->\n\n\t<?php twentynineteen_post_thumbnail(); ?>\n\n\t<div class=\"entry-content\">\n\t\t<?php the_excerpt(); ?>\n\t</div><!-- .entry-content -->\n\n\t<footer class=\"entry-footer\">\n\t\t<?php twentynineteen_entry_footer(); ?>\n\t</footer><!-- .entry-footer -->\n</article><!-- #post-<?php the_ID(); ?> -->\n", "num_lines": 34}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template part for displaying a message that posts cannot be found\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\n?>\n\n<section class=\"no-results not-found\">\n\t<header class=\"page-header\">\n\t\t<h1 class=\"page-title\"><?php _e( 'Nothing Found', 'twentynineteen' ); ?></h1>\n\t</header><!-- .page-header -->\n\n\t<div class=\"page-content\">\n\t\t<?php\n\t\tif ( is_home() && current_user_can( 'publish_posts' ) ) :\n\n\t\t\tprintf(\n\t\t\t\t'<p>' . wp_kses(\n\t\t\t\t\t/* translators: 1: Link to WP admin new post page. */\n\t\t\t\t\t__( 'Ready to publish your first post? <a href=\"%1$s\">Get started here</a>.', 'twentynineteen' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'a' => array(\n\t\t\t\t\t\t\t'href' => array(),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t) . '</p>',\n\t\t\t\tesc_url( admin_url( 'post-new.php' ) )\n\t\t\t);\n\n\t\telseif ( is_search() ) :\n\t\t\t?>\n\n\t\t\t<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentynineteen' ); ?></p>\n\t\t\t<?php\n\t\t\tget_search_form();\n\n\t\telse :\n\t\t\t?>\n\n\t\t\t<p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentynineteen' ); ?></p>\n\t\t\t<?php\n\t\t\tget_search_form();\n\n\t\tendif;\n\t\t?>\n\t</div><!-- .page-content -->\n</section><!-- .no-results -->\n", "num_lines": 54}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template part for displaying page content in page.php\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\n?>\n\n<article id=\"post-<?php the_ID(); ?>\" <?php post_class(); ?>>\n\t<?php if ( ! twentynineteen_can_show_post_thumbnail() ) : ?>\n\t<header class=\"entry-header\">\n\t\t<?php get_template_part( 'template-parts/header/entry', 'header' ); ?>\n\t</header>\n\t<?php endif; ?>\n\n\t<div class=\"entry-content\">\n\t\t<?php\n\t\tthe_content();\n\n\t\twp_link_pages(\n\t\t\tarray(\n\t\t\t\t'before' => '<div class=\"page-links\">' . __( 'Pages:', 'twentynineteen' ),\n\t\t\t\t'after'  => '</div>',\n\t\t\t)\n\t\t);\n\t\t?>\n\t</div><!-- .entry-content -->\n\n\t<?php if ( get_edit_post_link() ) : ?>\n\t\t<footer class=\"entry-footer\">\n\t\t\t<?php\n\t\t\tedit_post_link(\n\t\t\t\tsprintf(\n\t\t\t\t\twp_kses(\n\t\t\t\t\t\t/* translators: %s: Post title. Only visible to screen readers. */\n\t\t\t\t\t\t__( 'Edit <span class=\"screen-reader-text\">%s</span>', 'twentynineteen' ),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'span' => array(\n\t\t\t\t\t\t\t\t'class' => array(),\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\tget_the_title()\n\t\t\t\t),\n\t\t\t\t'<span class=\"edit-link\">' . twentynineteen_get_icon_svg( 'edit', 16 ),\n\t\t\t\t'</span>'\n\t\t\t);\n\t\t\t?>\n\t\t</footer><!-- .entry-footer -->\n\t<?php endif; ?>\n</article><!-- #post-<?php the_ID(); ?> -->\n", "num_lines": 57}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template part for displaying posts\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\n?>\n\n<article id=\"post-<?php the_ID(); ?>\" <?php post_class(); ?>>\n\t<?php if ( ! twentynineteen_can_show_post_thumbnail() ) : ?>\n\t<header class=\"entry-header\">\n\t\t<?php get_template_part( 'template-parts/header/entry', 'header' ); ?>\n\t</header>\n\t<?php endif; ?>\n\n\t<div class=\"entry-content\">\n\t\t<?php\n\t\tthe_content(\n\t\t\tsprintf(\n\t\t\t\twp_kses(\n\t\t\t\t\t/* translators: %s: Post title. Only visible to screen readers. */\n\t\t\t\t\t__( 'Continue reading<span class=\"screen-reader-text\"> \"%s\"</span>', 'twentynineteen' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'span' => array(\n\t\t\t\t\t\t\t'class' => array(),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tget_the_title()\n\t\t\t)\n\t\t);\n\n\t\twp_link_pages(\n\t\t\tarray(\n\t\t\t\t'before' => '<div class=\"page-links\">' . __( 'Pages:', 'twentynineteen' ),\n\t\t\t\t'after'  => '</div>',\n\t\t\t)\n\t\t);\n\t\t?>\n\t</div><!-- .entry-content -->\n\n\t<footer class=\"entry-footer\">\n\t\t<?php twentynineteen_entry_footer(); ?>\n\t</footer><!-- .entry-footer -->\n\n\t<?php if ( ! is_singular( 'attachment' ) ) : ?>\n\t\t<?php get_template_part( 'template-parts/post/author', 'bio' ); ?>\n\t<?php endif; ?>\n\n</article><!-- #post-<?php the_ID(); ?> -->\n", "num_lines": 56}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template part for displaying posts\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\n?>\n\n<article id=\"post-<?php the_ID(); ?>\" <?php post_class(); ?>>\n\t<header class=\"entry-header\">\n\t\t<?php\n\t\tif ( is_sticky() && is_home() && ! is_paged() ) {\n\t\t\tprintf( '<span class=\"sticky-post\">%s</span>', _x( 'Featured', 'post', 'twentynineteen' ) );\n\t\t}\n\t\tif ( is_singular() ) :\n\t\t\tthe_title( '<h1 class=\"entry-title\">', '</h1>' );\n\t\telse :\n\t\t\tthe_title( sprintf( '<h2 class=\"entry-title\"><a href=\"%s\" rel=\"bookmark\">', esc_url( get_permalink() ) ), '</a></h2>' );\n\t\tendif;\n\t\t?>\n\t</header><!-- .entry-header -->\n\n\t<?php twentynineteen_post_thumbnail(); ?>\n\n\t<div class=\"entry-content\">\n\t\t<?php\n\t\tthe_content(\n\t\t\tsprintf(\n\t\t\t\twp_kses(\n\t\t\t\t\t/* translators: %s: Post title. Only visible to screen readers. */\n\t\t\t\t\t__( 'Continue reading<span class=\"screen-reader-text\"> \"%s\"</span>', 'twentynineteen' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'span' => array(\n\t\t\t\t\t\t\t'class' => array(),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tget_the_title()\n\t\t\t)\n\t\t);\n\n\t\twp_link_pages(\n\t\t\tarray(\n\t\t\t\t'before' => '<div class=\"page-links\">' . __( 'Pages:', 'twentynineteen' ),\n\t\t\t\t'after'  => '</div>',\n\t\t\t)\n\t\t);\n\t\t?>\n\t</div><!-- .entry-content -->\n\n\t<footer class=\"entry-footer\">\n\t\t<?php twentynineteen_entry_footer(); ?>\n\t</footer><!-- .entry-footer -->\n</article><!-- #post-<?php the_ID(); ?> -->\n", "num_lines": 60}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays the footer widget area\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\nif ( is_active_sidebar( 'sidebar-1' ) ) : ?>\n\n\t<aside class=\"widget-area\" role=\"complementary\" aria-label=\"<?php esc_attr_e( 'Footer', 'twentynineteen' ); ?>\">\n\t\t<?php\n\t\tif ( is_active_sidebar( 'sidebar-1' ) ) {\n\t\t\t?>\n\t\t\t\t\t<div class=\"widget-column footer-widget-1\">\n\t\t\t\t\t<?php dynamic_sidebar( 'sidebar-1' ); ?>\n\t\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t}\n\t\t?>\n\t</aside><!-- .widget-area -->\n\n<?php endif; ?>\n", "num_lines": 25}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays the post header\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\n$discussion = ! is_page() && twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null; ?>\n\n<?php the_title( '<h1 class=\"entry-title\">', '</h1>' ); ?>\n\n<?php if ( ! is_page() ) : ?>\n<div class=\"entry-meta\">\n\t<?php twentynineteen_posted_by(); ?>\n\t<?php twentynineteen_posted_on(); ?>\n\t<span class=\"comment-count\">\n\t\t<?php\n\t\tif ( ! empty( $discussion ) ) {\n\t\t\ttwentynineteen_discussion_avatars_list( $discussion->authors );\n\t\t}\n\t\t?>\n\t\t<?php twentynineteen_comment_count(); ?>\n\t</span>\n\t<?php\n\t\t// Edit post link.\n\t\tedit_post_link(\n\t\t\tsprintf(\n\t\t\t\twp_kses(\n\t\t\t\t\t/* translators: %s: Post title. Only visible to screen readers. */\n\t\t\t\t\t__( 'Edit <span class=\"screen-reader-text\">%s</span>', 'twentynineteen' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'span' => array(\n\t\t\t\t\t\t\t'class' => array(),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tget_the_title()\n\t\t\t),\n\t\t\t'<span class=\"edit-link\">' . twentynineteen_get_icon_svg( 'edit', 16 ),\n\t\t\t'</span>'\n\t\t);\n\t?>\n</div><!-- .entry-meta -->\n<?php endif; ?>\n", "num_lines": 47}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays header site branding\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n?>\n<div class=\"site-branding\">\n\n\t<?php if ( has_custom_logo() ) : ?>\n\t\t<div class=\"site-logo\"><?php the_custom_logo(); ?></div>\n\t<?php endif; ?>\n\t<?php $blog_info = get_bloginfo( 'name' ); ?>\n\t<?php if ( ! empty( $blog_info ) ) : ?>\n\t\t<?php if ( is_front_page() && is_home() ) : ?>\n\t\t\t<h1 class=\"site-title\"><a href=\"<?php echo esc_url( home_url( '/' ) ); ?>\" rel=\"home\"><?php bloginfo( 'name' ); ?></a></h1>\n\t\t<?php else : ?>\n\t\t\t<p class=\"site-title\"><a href=\"<?php echo esc_url( home_url( '/' ) ); ?>\" rel=\"home\"><?php bloginfo( 'name' ); ?></a></p>\n\t\t<?php endif; ?>\n\t<?php endif; ?>\n\n\t<?php\n\t$description = get_bloginfo( 'description', 'display' );\n\tif ( $description || is_customize_preview() ) :\n\t\t?>\n\t\t\t<p class=\"site-description\">\n\t\t\t\t<?php echo $description; ?>\n\t\t\t</p>\n\t<?php endif; ?>\n\t<?php if ( has_nav_menu( 'menu-1' ) ) : ?>\n\t\t<nav id=\"site-navigation\" class=\"main-navigation\" aria-label=\"<?php esc_attr_e( 'Top Menu', 'twentynineteen' ); ?>\">\n\t\t\t<?php\n\t\t\twp_nav_menu(\n\t\t\t\tarray(\n\t\t\t\t\t'theme_location' => 'menu-1',\n\t\t\t\t\t'menu_class'     => 'main-menu',\n\t\t\t\t\t'items_wrap'     => '<ul id=\"%1$s\" class=\"%2$s\">%3$s</ul>',\n\t\t\t\t)\n\t\t\t);\n\t\t\t?>\n\t\t</nav><!-- #site-navigation -->\n\t<?php endif; ?>\n\t<?php if ( has_nav_menu( 'social' ) ) : ?>\n\t\t<nav class=\"social-navigation\" aria-label=\"<?php esc_attr_e( 'Social Links Menu', 'twentynineteen' ); ?>\">\n\t\t\t<?php\n\t\t\twp_nav_menu(\n\t\t\t\tarray(\n\t\t\t\t\t'theme_location' => 'social',\n\t\t\t\t\t'menu_class'     => 'social-links-menu',\n\t\t\t\t\t'link_before'    => '<span class=\"screen-reader-text\">',\n\t\t\t\t\t'link_after'     => '</span>' . twentynineteen_get_icon_svg( 'link' ),\n\t\t\t\t\t'depth'          => 1,\n\t\t\t\t)\n\t\t\t);\n\t\t\t?>\n\t\t</nav><!-- .social-navigation -->\n\t<?php endif; ?>\n</div><!-- .site-branding -->\n", "num_lines": 61}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying Author info\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\nif ( (bool) get_the_author_meta( 'description' ) ) : ?>\n<div class=\"author-bio\">\n\t<h2 class=\"author-title\">\n\t\t<span class=\"author-heading\">\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: Post author. */\n\t\t\t\t__( 'Published by %s', 'twentynineteen' ),\n\t\t\t\tesc_html( get_the_author() )\n\t\t\t);\n\t\t\t?>\n\t\t</span>\n\t</h2>\n\t<p class=\"author-description\">\n\t\t<?php the_author_meta( 'description' ); ?>\n\t\t<a class=\"author-link\" href=\"<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>\" rel=\"author\">\n\t\t\t<?php _e( 'View more posts', 'twentynineteen' ); ?>\n\t\t</a>\n\t</p><!-- .author-description -->\n</div><!-- .author-bio -->\n<?php endif; ?>\n", "num_lines": 31}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying Current Discussion on posts\n *\n * @package WordPress\n * @subpackage Twenty_Nineteen\n * @since Twenty Nineteen 1.0\n */\n\n/* Get data from current discussion on post. */\n$discussion    = twentynineteen_get_discussion_data();\n$has_responses = $discussion->responses > 0;\n\nif ( $has_responses ) {\n\t/* translators: %d: Number of comments. */\n\t$meta_label = sprintf( _n( '%d Comment', '%d Comments', $discussion->responses, 'twentynineteen' ), $discussion->responses );\n} else {\n\t$meta_label = __( 'No comments', 'twentynineteen' );\n}\n?>\n\n<div class=\"discussion-meta\">\n\t<?php\n\tif ( $has_responses ) {\n\t\ttwentynineteen_discussion_avatars_list( $discussion->authors );\n\t}\n\t?>\n\t<p class=\"discussion-meta-info\">\n\t\t<?php echo twentynineteen_get_icon_svg( 'comment', 24 ); ?>\n\t\t<span><?php echo esc_html( $meta_label ); ?></span>\n\t</p>\n</div><!-- .discussion-meta -->\n", "num_lines": 33}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying 404 pages (not found)\n *\n * @link https://codex.wordpress.org/Creating_an_Error_404_Page\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\nget_header(); ?>\n\n<div class=\"wrap\">\n\t<div id=\"primary\" class=\"content-area\">\n\t\t<main id=\"main\" class=\"site-main\" role=\"main\">\n\n\t\t\t<section class=\"error-404 not-found\">\n\t\t\t\t<header class=\"page-header\">\n\t\t\t\t\t<h1 class=\"page-title\"><?php _e( 'Oops! That page can&rsquo;t be found.', 'twentyseventeen' ); ?></h1>\n\t\t\t\t</header><!-- .page-header -->\n\t\t\t\t<div class=\"page-content\">\n\t\t\t\t\t<p><?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'twentyseventeen' ); ?></p>\n\n\t\t\t\t\t<?php get_search_form(); ?>\n\n\t\t\t\t</div><!-- .page-content -->\n\t\t\t</section><!-- .error-404 -->\n\t\t</main><!-- #main -->\n\t</div><!-- #primary -->\n</div><!-- .wrap -->\n\n<?php\nget_footer();\n", "num_lines": 36}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying archive pages\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\nget_header(); ?>\n\n<div class=\"wrap\">\n\n\t<?php if ( have_posts() ) : ?>\n\t\t<header class=\"page-header\">\n\t\t\t<?php\n\t\t\t\tthe_archive_title( '<h1 class=\"page-title\">', '</h1>' );\n\t\t\t\tthe_archive_description( '<div class=\"taxonomy-description\">', '</div>' );\n\t\t\t?>\n\t\t</header><!-- .page-header -->\n\t<?php endif; ?>\n\n\t<div id=\"primary\" class=\"content-area\">\n\t\t<main id=\"main\" class=\"site-main\" role=\"main\">\n\n\t\t<?php\n\t\tif ( have_posts() ) :\n\t\t\t?>\n\t\t\t<?php\n\t\t\t// Start the Loop.\n\t\t\twhile ( have_posts() ) :\n\t\t\t\tthe_post();\n\n\t\t\t\t/*\n\t\t\t\t * Include the Post-Format-specific template for the content.\n\t\t\t\t * If you want to override this in a child theme, then include a file\n\t\t\t\t * called content-___.php (where ___ is the Post Format name) and that\n\t\t\t\t * will be used instead.\n\t\t\t\t */\n\t\t\t\tget_template_part( 'template-parts/post/content', get_post_format() );\n\n\t\t\tendwhile;\n\n\t\t\tthe_posts_pagination(\n\t\t\t\tarray(\n\t\t\t\t\t'prev_text'          => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class=\"screen-reader-text\">' . __( 'Previous page', 'twentyseventeen' ) . '</span>',\n\t\t\t\t\t'next_text'          => '<span class=\"screen-reader-text\">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),\n\t\t\t\t\t'before_page_number' => '<span class=\"meta-nav screen-reader-text\">' . __( 'Page', 'twentyseventeen' ) . ' </span>',\n\t\t\t\t)\n\t\t\t);\n\n\t\telse :\n\n\t\t\tget_template_part( 'template-parts/post/content', 'none' );\n\n\t\tendif;\n\t\t?>\n\n\t\t</main><!-- #main -->\n\t</div><!-- #primary -->\n\t<?php get_sidebar(); ?>\n</div><!-- .wrap -->\n\n<?php\nget_footer();\n", "num_lines": 69}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying comments\n *\n * This is the template that displays the area of the page that contains both the current comments\n * and the comment form.\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\n/*\n * If the current post is protected by a password and\n * the visitor has not yet entered the password we will\n * return early without loading the comments.\n */\nif ( post_password_required() ) {\n\treturn;\n}\n?>\n\n<div id=\"comments\" class=\"comments-area\">\n\n\t<?php\n\t// You can start editing here -- including this comment!\n\tif ( have_comments() ) :\n\t\t?>\n\t\t<h2 class=\"comments-title\">\n\t\t\t<?php\n\t\t\t$comments_number = get_comments_number();\n\t\t\tif ( '1' === $comments_number ) {\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\tprintf( _x( 'One Reply to &ldquo;%s&rdquo;', 'comments title', 'twentyseventeen' ), get_the_title() );\n\t\t\t} else {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: Number of comments, 2: Post title. */\n\t\t\t\t\t_nx(\n\t\t\t\t\t\t'%1$s Reply to &ldquo;%2$s&rdquo;',\n\t\t\t\t\t\t'%1$s Replies to &ldquo;%2$s&rdquo;',\n\t\t\t\t\t\t$comments_number,\n\t\t\t\t\t\t'comments title',\n\t\t\t\t\t\t'twentyseventeen'\n\t\t\t\t\t),\n\t\t\t\t\tnumber_format_i18n( $comments_number ),\n\t\t\t\t\tget_the_title()\n\t\t\t\t);\n\t\t\t}\n\t\t\t?>\n\t\t</h2>\n\n\t\t<ol class=\"comment-list\">\n\t\t\t<?php\n\t\t\t\twp_list_comments(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'avatar_size' => 100,\n\t\t\t\t\t\t'style'       => 'ol',\n\t\t\t\t\t\t'short_ping'  => true,\n\t\t\t\t\t\t'reply_text'  => twentyseventeen_get_svg( array( 'icon' => 'mail-reply' ) ) . __( 'Reply', 'twentyseventeen' ),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t?>\n\t\t</ol>\n\n\t\t<?php\n\t\tthe_comments_pagination(\n\t\t\tarray(\n\t\t\t\t'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class=\"screen-reader-text\">' . __( 'Previous', 'twentyseventeen' ) . '</span>',\n\t\t\t\t'next_text' => '<span class=\"screen-reader-text\">' . __( 'Next', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),\n\t\t\t)\n\t\t);\n\n\tendif; // Check for have_comments().\n\n\t// If comments are closed and there are comments, let's leave a little note, shall we?\n\tif ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :\n\t\t?>\n\n\t\t<p class=\"no-comments\"><?php _e( 'Comments are closed.', 'twentyseventeen' ); ?></p>\n\t\t<?php\n\tendif;\n\n\tcomment_form();\n\t?>\n\n</div><!-- #comments -->\n", "num_lines": 90}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying the footer\n *\n * Contains the closing of the #content div and all content after.\n *\n * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.2\n */\n\n?>\n\n\t\t</div><!-- #content -->\n\n\t\t<footer id=\"colophon\" class=\"site-footer\" role=\"contentinfo\">\n\t\t\t<div class=\"wrap\">\n\t\t\t\t<?php\n\t\t\t\tget_template_part( 'template-parts/footer/footer', 'widgets' );\n\n\t\t\t\tif ( has_nav_menu( 'social' ) ) :\n\t\t\t\t\t?>\n\t\t\t\t\t<nav class=\"social-navigation\" role=\"navigation\" aria-label=\"<?php esc_attr_e( 'Footer Social Links Menu', 'twentyseventeen' ); ?>\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\twp_nav_menu(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'theme_location' => 'social',\n\t\t\t\t\t\t\t\t\t'menu_class'     => 'social-links-menu',\n\t\t\t\t\t\t\t\t\t'depth'          => 1,\n\t\t\t\t\t\t\t\t\t'link_before'    => '<span class=\"screen-reader-text\">',\n\t\t\t\t\t\t\t\t\t'link_after'     => '</span>' . twentyseventeen_get_svg( array( 'icon' => 'chain' ) ),\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</nav><!-- .social-navigation -->\n\t\t\t\t\t<?php\n\t\t\t\tendif;\n\n\t\t\t\tget_template_part( 'template-parts/footer/site', 'info' );\n\t\t\t\t?>\n\t\t\t</div><!-- .wrap -->\n\t\t</footer><!-- #colophon -->\n\t</div><!-- .site-content-contain -->\n</div><!-- #page -->\n<?php wp_footer(); ?>\n\n</body>\n</html>\n", "num_lines": 52}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The front page template file\n *\n * If the user has selected a static page for their homepage, this is what will\n * appear.\n * Learn more: https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\nget_header(); ?>\n\n<div id=\"primary\" class=\"content-area\">\n\t<main id=\"main\" class=\"site-main\" role=\"main\">\n\n\t\t<?php\n\t\t// Show the selected front page content.\n\t\tif ( have_posts() ) :\n\t\t\twhile ( have_posts() ) :\n\t\t\t\tthe_post();\n\t\t\t\tget_template_part( 'template-parts/page/content', 'front-page' );\n\t\t\tendwhile;\n\t\telse :\n\t\t\tget_template_part( 'template-parts/post/content', 'none' );\n\t\tendif;\n\t\t?>\n\n\t\t<?php\n\t\t// Get each of our panels and show the post data.\n\t\tif ( 0 !== twentyseventeen_panel_count() || is_customize_preview() ) : // If we have pages to show.\n\n\t\t\t/**\n\t\t\t * Filter number of front page sections in Twenty Seventeen.\n\t\t\t *\n\t\t\t * @since Twenty Seventeen 1.0\n\t\t\t *\n\t\t\t * @param int $num_sections Number of front page sections.\n\t\t\t */\n\t\t\t$num_sections = apply_filters( 'twentyseventeen_front_page_sections', 4 );\n\t\t\tglobal $twentyseventeencounter;\n\n\t\t\t// Create a setting and control for each of the sections available in the theme.\n\t\t\tfor ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) {\n\t\t\t\t$twentyseventeencounter = $i;\n\t\t\t\ttwentyseventeen_front_page_section( null, $i );\n\t\t\t}\n\n\tendif; // The if ( 0 !== twentyseventeen_panel_count() ) ends here.\n\t\t?>\n\n\t</main><!-- #main -->\n</div><!-- #primary -->\n\n<?php\nget_footer();\n", "num_lines": 60}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Twenty Seventeen functions and definitions\n *\n * @link https://developer.wordpress.org/themes/basics/theme-functions/\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n */\n\n/**\n * Twenty Seventeen only works in WordPress 4.7 or later.\n */\nif ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '<' ) ) {\n\trequire get_template_directory() . '/inc/back-compat.php';\n\treturn;\n}\n\n/**\n * Sets up theme defaults and registers support for various WordPress features.\n *\n * Note that this function is hooked into the after_setup_theme hook, which\n * runs before the init hook. The init hook is too late for some features, such\n * as indicating support for post thumbnails.\n */\nfunction twentyseventeen_setup() {\n\t/*\n\t * Make theme available for translation.\n\t * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyseventeen\n\t * If you're building a theme based on Twenty Seventeen, use a find and replace\n\t * to change 'twentyseventeen' to the name of your theme in all the template files.\n\t */\n\tload_theme_textdomain( 'twentyseventeen' );\n\n\t// Add default posts and comments RSS feed links to head.\n\tadd_theme_support( 'automatic-feed-links' );\n\n\t/*\n\t * Let WordPress manage the document title.\n\t * By adding theme support, we declare that this theme does not use a\n\t * hard-coded <title> tag in the document head, and expect WordPress to\n\t * provide it for us.\n\t */\n\tadd_theme_support( 'title-tag' );\n\n\t/*\n\t * Enable support for Post Thumbnails on posts and pages.\n\t *\n\t * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/\n\t */\n\tadd_theme_support( 'post-thumbnails' );\n\n\tadd_image_size( 'twentyseventeen-featured-image', 2000, 1200, true );\n\n\tadd_image_size( 'twentyseventeen-thumbnail-avatar', 100, 100, true );\n\n\t// Set the default content width.\n\t$GLOBALS['content_width'] = 525;\n\n\t// This theme uses wp_nav_menu() in two locations.\n\tregister_nav_menus(\n\t\tarray(\n\t\t\t'top'    => __( 'Top Menu', 'twentyseventeen' ),\n\t\t\t'social' => __( 'Social Links Menu', 'twentyseventeen' ),\n\t\t)\n\t);\n\n\t/*\n\t * Switch default core markup for search form, comment form, and comments\n\t * to output valid HTML5.\n\t */\n\tadd_theme_support(\n\t\t'html5',\n\t\tarray(\n\t\t\t'comment-form',\n\t\t\t'comment-list',\n\t\t\t'gallery',\n\t\t\t'caption',\n\t\t\t'script',\n\t\t\t'style',\n\t\t)\n\t);\n\n\t/*\n\t * Enable support for Post Formats.\n\t *\n\t * See: https://wordpress.org/support/article/post-formats/\n\t */\n\tadd_theme_support(\n\t\t'post-formats',\n\t\tarray(\n\t\t\t'aside',\n\t\t\t'image',\n\t\t\t'video',\n\t\t\t'quote',\n\t\t\t'link',\n\t\t\t'gallery',\n\t\t\t'audio',\n\t\t)\n\t);\n\n\t// Add theme support for Custom Logo.\n\tadd_theme_support(\n\t\t'custom-logo',\n\t\tarray(\n\t\t\t'width'      => 250,\n\t\t\t'height'     => 250,\n\t\t\t'flex-width' => true,\n\t\t)\n\t);\n\n\t// Add theme support for selective refresh for widgets.\n\tadd_theme_support( 'customize-selective-refresh-widgets' );\n\n\t/*\n\t * This theme styles the visual editor to resemble the theme style,\n\t * specifically font, colors, and column width.\n\t  */\n\tadd_editor_style( array( 'assets/css/editor-style.css', twentyseventeen_fonts_url() ) );\n\n\t// Load regular editor styles into the new block-based editor.\n\tadd_theme_support( 'editor-styles' );\n\n\t// Load default block styles.\n\tadd_theme_support( 'wp-block-styles' );\n\n\t// Add support for responsive embeds.\n\tadd_theme_support( 'responsive-embeds' );\n\n\t// Define and register starter content to showcase the theme on new sites.\n\t$starter_content = array(\n\t\t'widgets'     => array(\n\t\t\t// Place three core-defined widgets in the sidebar area.\n\t\t\t'sidebar-1' => array(\n\t\t\t\t'text_business_info',\n\t\t\t\t'search',\n\t\t\t\t'text_about',\n\t\t\t),\n\n\t\t\t// Add the core-defined business info widget to the footer 1 area.\n\t\t\t'sidebar-2' => array(\n\t\t\t\t'text_business_info',\n\t\t\t),\n\n\t\t\t// Put two core-defined widgets in the footer 2 area.\n\t\t\t'sidebar-3' => array(\n\t\t\t\t'text_about',\n\t\t\t\t'search',\n\t\t\t),\n\t\t),\n\n\t\t// Specify the core-defined pages to create and add custom thumbnails to some of them.\n\t\t'posts'       => array(\n\t\t\t'home',\n\t\t\t'about'            => array(\n\t\t\t\t'thumbnail' => '{{image-sandwich}}',\n\t\t\t),\n\t\t\t'contact'          => array(\n\t\t\t\t'thumbnail' => '{{image-espresso}}',\n\t\t\t),\n\t\t\t'blog'             => array(\n\t\t\t\t'thumbnail' => '{{image-coffee}}',\n\t\t\t),\n\t\t\t'homepage-section' => array(\n\t\t\t\t'thumbnail' => '{{image-espresso}}',\n\t\t\t),\n\t\t),\n\n\t\t// Create the custom image attachments used as post thumbnails for pages.\n\t\t'attachments' => array(\n\t\t\t'image-espresso' => array(\n\t\t\t\t'post_title' => _x( 'Espresso', 'Theme starter content', 'twentyseventeen' ),\n\t\t\t\t'file'       => 'assets/images/espresso.jpg', // URL relative to the template directory.\n\t\t\t),\n\t\t\t'image-sandwich' => array(\n\t\t\t\t'post_title' => _x( 'Sandwich', 'Theme starter content', 'twentyseventeen' ),\n\t\t\t\t'file'       => 'assets/images/sandwich.jpg',\n\t\t\t),\n\t\t\t'image-coffee'   => array(\n\t\t\t\t'post_title' => _x( 'Coffee', 'Theme starter content', 'twentyseventeen' ),\n\t\t\t\t'file'       => 'assets/images/coffee.jpg',\n\t\t\t),\n\t\t),\n\n\t\t// Default to a static front page and assign the front and posts pages.\n\t\t'options'     => array(\n\t\t\t'show_on_front'  => 'page',\n\t\t\t'page_on_front'  => '{{home}}',\n\t\t\t'page_for_posts' => '{{blog}}',\n\t\t),\n\n\t\t// Set the front page section theme mods to the IDs of the core-registered pages.\n\t\t'theme_mods'  => array(\n\t\t\t'panel_1' => '{{homepage-section}}',\n\t\t\t'panel_2' => '{{about}}',\n\t\t\t'panel_3' => '{{blog}}',\n\t\t\t'panel_4' => '{{contact}}',\n\t\t),\n\n\t\t// Set up nav menus for each of the two areas registered in the theme.\n\t\t'nav_menus'   => array(\n\t\t\t// Assign a menu to the \"top\" location.\n\t\t\t'top'    => array(\n\t\t\t\t'name'  => __( 'Top Menu', 'twentyseventeen' ),\n\t\t\t\t'items' => array(\n\t\t\t\t\t'link_home', // Note that the core \"home\" page is actually a link in case a static front page is not used.\n\t\t\t\t\t'page_about',\n\t\t\t\t\t'page_blog',\n\t\t\t\t\t'page_contact',\n\t\t\t\t),\n\t\t\t),\n\n\t\t\t// Assign a menu to the \"social\" location.\n\t\t\t'social' => array(\n\t\t\t\t'name'  => __( 'Social Links Menu', 'twentyseventeen' ),\n\t\t\t\t'items' => array(\n\t\t\t\t\t'link_yelp',\n\t\t\t\t\t'link_facebook',\n\t\t\t\t\t'link_twitter',\n\t\t\t\t\t'link_instagram',\n\t\t\t\t\t'link_email',\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t);\n\n\t/**\n\t * Filters Twenty Seventeen array of starter content.\n\t *\n\t * @since Twenty Seventeen 1.1\n\t *\n\t * @param array $starter_content Array of starter content.\n\t */\n\t$starter_content = apply_filters( 'twentyseventeen_starter_content', $starter_content );\n\n\tadd_theme_support( 'starter-content', $starter_content );\n}\nadd_action( 'after_setup_theme', 'twentyseventeen_setup' );\n\n/**\n * Set the content width in pixels, based on the theme's design and stylesheet.\n *\n * Priority 0 to make it available to lower priority callbacks.\n *\n * @global int $content_width\n */\nfunction twentyseventeen_content_width() {\n\n\t$content_width = $GLOBALS['content_width'];\n\n\t// Get layout.\n\t$page_layout = get_theme_mod( 'page_layout' );\n\n\t// Check if layout is one column.\n\tif ( 'one-column' === $page_layout ) {\n\t\tif ( twentyseventeen_is_frontpage() ) {\n\t\t\t$content_width = 644;\n\t\t} elseif ( is_page() ) {\n\t\t\t$content_width = 740;\n\t\t}\n\t}\n\n\t// Check if is single post and there is no sidebar.\n\tif ( is_single() && ! is_active_sidebar( 'sidebar-1' ) ) {\n\t\t$content_width = 740;\n\t}\n\n\t/**\n\t * Filter Twenty Seventeen content width of the theme.\n\t *\n\t * @since Twenty Seventeen 1.0\n\t *\n\t * @param int $content_width Content width in pixels.\n\t */\n\t$GLOBALS['content_width'] = apply_filters( 'twentyseventeen_content_width', $content_width );\n}\nadd_action( 'template_redirect', 'twentyseventeen_content_width', 0 );\n\n/**\n * Register custom fonts.\n */\nfunction twentyseventeen_fonts_url() {\n\t$fonts_url = '';\n\n\t/*\n\t * translators: If there are characters in your language that are not supported\n\t * by Libre Franklin, translate this to 'off'. Do not translate into your own language.\n\t */\n\t$libre_franklin = _x( 'on', 'Libre Franklin font: on or off', 'twentyseventeen' );\n\n\tif ( 'off' !== $libre_franklin ) {\n\t\t$font_families = array();\n\n\t\t$font_families[] = 'Libre Franklin:300,300i,400,400i,600,600i,800,800i';\n\n\t\t$query_args = array(\n\t\t\t'family'  => urlencode( implode( '|', $font_families ) ),\n\t\t\t'subset'  => urlencode( 'latin,latin-ext' ),\n\t\t\t'display' => urlencode( 'fallback' ),\n\t\t);\n\n\t\t$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );\n\t}\n\n\treturn esc_url_raw( $fonts_url );\n}\n\n/**\n * Add preconnect for Google Fonts.\n *\n * @since Twenty Seventeen 1.0\n *\n * @param array  $urls          URLs to print for resource hints.\n * @param string $relation_type The relation type the URLs are printed.\n * @return array URLs to print for resource hints.\n */\nfunction twentyseventeen_resource_hints( $urls, $relation_type ) {\n\tif ( wp_style_is( 'twentyseventeen-fonts', 'queue' ) && 'preconnect' === $relation_type ) {\n\t\t$urls[] = array(\n\t\t\t'href' => 'https://fonts.gstatic.com',\n\t\t\t'crossorigin',\n\t\t);\n\t}\n\n\treturn $urls;\n}\nadd_filter( 'wp_resource_hints', 'twentyseventeen_resource_hints', 10, 2 );\n\n/**\n * Register widget area.\n *\n * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar\n */\nfunction twentyseventeen_widgets_init() {\n\tregister_sidebar(\n\t\tarray(\n\t\t\t'name'          => __( 'Blog Sidebar', 'twentyseventeen' ),\n\t\t\t'id'            => 'sidebar-1',\n\t\t\t'description'   => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'twentyseventeen' ),\n\t\t\t'before_widget' => '<section id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget'  => '</section>',\n\t\t\t'before_title'  => '<h2 class=\"widget-title\">',\n\t\t\t'after_title'   => '</h2>',\n\t\t)\n\t);\n\n\tregister_sidebar(\n\t\tarray(\n\t\t\t'name'          => __( 'Footer 1', 'twentyseventeen' ),\n\t\t\t'id'            => 'sidebar-2',\n\t\t\t'description'   => __( 'Add widgets here to appear in your footer.', 'twentyseventeen' ),\n\t\t\t'before_widget' => '<section id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget'  => '</section>',\n\t\t\t'before_title'  => '<h2 class=\"widget-title\">',\n\t\t\t'after_title'   => '</h2>',\n\t\t)\n\t);\n\n\tregister_sidebar(\n\t\tarray(\n\t\t\t'name'          => __( 'Footer 2', 'twentyseventeen' ),\n\t\t\t'id'            => 'sidebar-3',\n\t\t\t'description'   => __( 'Add widgets here to appear in your footer.', 'twentyseventeen' ),\n\t\t\t'before_widget' => '<section id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget'  => '</section>',\n\t\t\t'before_title'  => '<h2 class=\"widget-title\">',\n\t\t\t'after_title'   => '</h2>',\n\t\t)\n\t);\n}\nadd_action( 'widgets_init', 'twentyseventeen_widgets_init' );\n\n/**\n * Replaces \"[...]\" (appended to automatically generated excerpts) with ... and\n * a 'Continue reading' link.\n *\n * @since Twenty Seventeen 1.0\n *\n * @param string $link Link to single post/page.\n * @return string 'Continue reading' link prepended with an ellipsis.\n */\nfunction twentyseventeen_excerpt_more( $link ) {\n\tif ( is_admin() ) {\n\t\treturn $link;\n\t}\n\n\t$link = sprintf(\n\t\t'<p class=\"link-more\"><a href=\"%1$s\" class=\"more-link\">%2$s</a></p>',\n\t\tesc_url( get_permalink( get_the_ID() ) ),\n\t\t/* translators: %s: Post title. */\n\t\tsprintf( __( 'Continue reading<span class=\"screen-reader-text\"> \"%s\"</span>', 'twentyseventeen' ), get_the_title( get_the_ID() ) )\n\t);\n\treturn ' &hellip; ' . $link;\n}\nadd_filter( 'excerpt_more', 'twentyseventeen_excerpt_more' );\n\n/**\n * Handles JavaScript detection.\n *\n * Adds a `js` class to the root `<html>` element when JavaScript is detected.\n *\n * @since Twenty Seventeen 1.0\n */\nfunction twentyseventeen_javascript_detection() {\n\techo \"<script>(function(html){html.className = html.className.replace(/\\bno-js\\b/,'js')})(document.documentElement);</script>\\n\";\n}\nadd_action( 'wp_head', 'twentyseventeen_javascript_detection', 0 );\n\n/**\n * Add a pingback url auto-discovery header for singularly identifiable articles.\n */\nfunction twentyseventeen_pingback_header() {\n\tif ( is_singular() && pings_open() ) {\n\t\tprintf( '<link rel=\"pingback\" href=\"%s\">' . \"\\n\", esc_url( get_bloginfo( 'pingback_url' ) ) );\n\t}\n}\nadd_action( 'wp_head', 'twentyseventeen_pingback_header' );\n\n/**\n * Display custom color CSS.\n */\nfunction twentyseventeen_colors_css_wrap() {\n\tif ( 'custom' !== get_theme_mod( 'colorscheme' ) && ! is_customize_preview() ) {\n\t\treturn;\n\t}\n\n\trequire_once get_parent_theme_file_path( '/inc/color-patterns.php' );\n\t$hue = absint( get_theme_mod( 'colorscheme_hue', 250 ) );\n\n\t$customize_preview_data_hue = '';\n\tif ( is_customize_preview() ) {\n\t\t$customize_preview_data_hue = 'data-hue=\"' . $hue . '\"';\n\t}\n\t?>\n\t<style type=\"text/css\" id=\"custom-theme-colors\" <?php echo $customize_preview_data_hue; ?>>\n\t\t<?php echo twentyseventeen_custom_colors_css(); ?>\n\t</style>\n\t<?php\n}\nadd_action( 'wp_head', 'twentyseventeen_colors_css_wrap' );\n\n/**\n * Enqueues scripts and styles.\n */\nfunction twentyseventeen_scripts() {\n\t// Add custom fonts, used in the main stylesheet.\n\twp_enqueue_style( 'twentyseventeen-fonts', twentyseventeen_fonts_url(), array(), null );\n\n\t// Theme stylesheet.\n\twp_enqueue_style( 'twentyseventeen-style', get_stylesheet_uri(), array(), '20190507' );\n\n\t// Theme block stylesheet.\n\twp_enqueue_style( 'twentyseventeen-block-style', get_theme_file_uri( '/assets/css/blocks.css' ), array( 'twentyseventeen-style' ), '20190105' );\n\n\t// Load the dark colorscheme.\n\tif ( 'dark' === get_theme_mod( 'colorscheme', 'light' ) || is_customize_preview() ) {\n\t\twp_enqueue_style( 'twentyseventeen-colors-dark', get_theme_file_uri( '/assets/css/colors-dark.css' ), array( 'twentyseventeen-style' ), '20190408' );\n\t}\n\n\t// Load the Internet Explorer 9 specific stylesheet, to fix display issues in the Customizer.\n\tif ( is_customize_preview() ) {\n\t\twp_enqueue_style( 'twentyseventeen-ie9', get_theme_file_uri( '/assets/css/ie9.css' ), array( 'twentyseventeen-style' ), '20161202' );\n\t\twp_style_add_data( 'twentyseventeen-ie9', 'conditional', 'IE 9' );\n\t}\n\n\t// Load the Internet Explorer 8 specific stylesheet.\n\twp_enqueue_style( 'twentyseventeen-ie8', get_theme_file_uri( '/assets/css/ie8.css' ), array( 'twentyseventeen-style' ), '20161202' );\n\twp_style_add_data( 'twentyseventeen-ie8', 'conditional', 'lt IE 9' );\n\n\t// Load the html5 shiv.\n\twp_enqueue_script( 'html5', get_theme_file_uri( '/assets/js/html5.js' ), array(), '20161020' );\n\twp_script_add_data( 'html5', 'conditional', 'lt IE 9' );\n\n\twp_enqueue_script( 'twentyseventeen-skip-link-focus-fix', get_theme_file_uri( '/assets/js/skip-link-focus-fix.js' ), array(), '20161114', true );\n\n\t$twentyseventeen_l10n = array(\n\t\t'quote' => twentyseventeen_get_svg( array( 'icon' => 'quote-right' ) ),\n\t);\n\n\tif ( has_nav_menu( 'top' ) ) {\n\t\twp_enqueue_script( 'twentyseventeen-navigation', get_theme_file_uri( '/assets/js/navigation.js' ), array( 'jquery' ), '20161203', true );\n\t\t$twentyseventeen_l10n['expand']   = __( 'Expand child menu', 'twentyseventeen' );\n\t\t$twentyseventeen_l10n['collapse'] = __( 'Collapse child menu', 'twentyseventeen' );\n\t\t$twentyseventeen_l10n['icon']     = twentyseventeen_get_svg(\n\t\t\tarray(\n\t\t\t\t'icon'     => 'angle-down',\n\t\t\t\t'fallback' => true,\n\t\t\t)\n\t\t);\n\t}\n\n\twp_enqueue_script( 'twentyseventeen-global', get_theme_file_uri( '/assets/js/global.js' ), array( 'jquery' ), '20190121', true );\n\n\twp_enqueue_script( 'jquery-scrollto', get_theme_file_uri( '/assets/js/jquery.scrollTo.js' ), array( 'jquery' ), '2.1.2', true );\n\n\twp_localize_script( 'twentyseventeen-skip-link-focus-fix', 'twentyseventeenScreenReaderText', $twentyseventeen_l10n );\n\n\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n}\nadd_action( 'wp_enqueue_scripts', 'twentyseventeen_scripts' );\n\n/**\n * Enqueues styles for the block-based editor.\n *\n * @since Twenty Seventeen 1.8\n */\nfunction twentyseventeen_block_editor_styles() {\n\t// Block styles.\n\twp_enqueue_style( 'twentyseventeen-block-editor-style', get_theme_file_uri( '/assets/css/editor-blocks.css' ), array(), '20190328' );\n\t// Add custom fonts.\n\twp_enqueue_style( 'twentyseventeen-fonts', twentyseventeen_fonts_url(), array(), null );\n}\nadd_action( 'enqueue_block_editor_assets', 'twentyseventeen_block_editor_styles' );\n\n/**\n * Add custom image sizes attribute to enhance responsive image functionality\n * for content images.\n *\n * @since Twenty Seventeen 1.0\n *\n * @param string $sizes A source size value for use in a 'sizes' attribute.\n * @param array  $size  Image size. Accepts an array of width and height\n *                      values in pixels (in that order).\n * @return string A source size value for use in a content image 'sizes' attribute.\n */\nfunction twentyseventeen_content_image_sizes_attr( $sizes, $size ) {\n\t$width = $size[0];\n\n\tif ( 740 <= $width ) {\n\t\t$sizes = '(max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px';\n\t}\n\n\tif ( is_active_sidebar( 'sidebar-1' ) || is_archive() || is_search() || is_home() || is_page() ) {\n\t\tif ( ! ( is_page() && 'one-column' === get_theme_mod( 'page_options' ) ) && 767 <= $width ) {\n\t\t\t$sizes = '(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px';\n\t\t}\n\t}\n\n\treturn $sizes;\n}\nadd_filter( 'wp_calculate_image_sizes', 'twentyseventeen_content_image_sizes_attr', 10, 2 );\n\n/**\n * Filter the `sizes` value in the header image markup.\n *\n * @since Twenty Seventeen 1.0\n *\n * @param string $html   The HTML image tag markup being filtered.\n * @param object $header The custom header object returned by 'get_custom_header()'.\n * @param array  $attr   Array of the attributes for the image tag.\n * @return string The filtered header image HTML.\n */\nfunction twentyseventeen_header_image_tag( $html, $header, $attr ) {\n\tif ( isset( $attr['sizes'] ) ) {\n\t\t$html = str_replace( $attr['sizes'], '100vw', $html );\n\t}\n\treturn $html;\n}\nadd_filter( 'get_header_image_tag', 'twentyseventeen_header_image_tag', 10, 3 );\n\n/**\n * Add custom image sizes attribute to enhance responsive image functionality\n * for post thumbnails.\n *\n * @since Twenty Seventeen 1.0\n *\n * @param array $attr       Attributes for the image markup.\n * @param int   $attachment Image attachment ID.\n * @param array $size       Registered image size or flat array of height and width dimensions.\n * @return array The filtered attributes for the image markup.\n */\nfunction twentyseventeen_post_thumbnail_sizes_attr( $attr, $attachment, $size ) {\n\tif ( is_archive() || is_search() || is_home() ) {\n\t\t$attr['sizes'] = '(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px';\n\t} else {\n\t\t$attr['sizes'] = '100vw';\n\t}\n\n\treturn $attr;\n}\nadd_filter( 'wp_get_attachment_image_attributes', 'twentyseventeen_post_thumbnail_sizes_attr', 10, 3 );\n\n/**\n * Use front-page.php when Front page displays is set to a static page.\n *\n * @since Twenty Seventeen 1.0\n *\n * @param string $template front-page.php.\n * @return string The template to be used: blank if is_home() is true (defaults to index.php),\n *                otherwise $template.\n */\nfunction twentyseventeen_front_page_template( $template ) {\n\treturn is_home() ? '' : $template;\n}\nadd_filter( 'frontpage_template', 'twentyseventeen_front_page_template' );\n\n/**\n * Modifies tag cloud widget arguments to display all tags in the same font size\n * and use list format for better accessibility.\n *\n * @since Twenty Seventeen 1.4\n *\n * @param array $args Arguments for tag cloud widget.\n * @return array The filtered arguments for tag cloud widget.\n */\nfunction twentyseventeen_widget_tag_cloud_args( $args ) {\n\t$args['largest']  = 1;\n\t$args['smallest'] = 1;\n\t$args['unit']     = 'em';\n\t$args['format']   = 'list';\n\n\treturn $args;\n}\nadd_filter( 'widget_tag_cloud_args', 'twentyseventeen_widget_tag_cloud_args' );\n\n/**\n * Gets unique ID.\n *\n * This is a PHP implementation of Underscore's uniqueId method. A static variable\n * contains an integer that is incremented with each call. This number is returned\n * with the optional prefix. As such the returned value is not universally unique,\n * but it is unique across the life of the PHP process.\n *\n * @since Twenty Seventeen 2.0\n *\n * @see wp_unique_id() Themes requiring WordPress 5.0.3 and greater should use this instead.\n *\n * @param string $prefix Prefix for the returned ID.\n * @return string Unique ID.\n */\nfunction twentyseventeen_unique_id( $prefix = '' ) {\n\tstatic $id_counter = 0;\n\tif ( function_exists( 'wp_unique_id' ) ) {\n\t\treturn wp_unique_id( $prefix );\n\t}\n\treturn $prefix . (string) ++$id_counter;\n}\n\n/**\n * Implement the Custom Header feature.\n */\nrequire get_parent_theme_file_path( '/inc/custom-header.php' );\n\n/**\n * Custom template tags for this theme.\n */\nrequire get_parent_theme_file_path( '/inc/template-tags.php' );\n\n/**\n * Additional features to allow styling of the templates.\n */\nrequire get_parent_theme_file_path( '/inc/template-functions.php' );\n\n/**\n * Customizer additions.\n */\nrequire get_parent_theme_file_path( '/inc/customizer.php' );\n\n/**\n * SVG icons functions and filters.\n */\nrequire get_parent_theme_file_path( '/inc/icon-functions.php' );\n", "num_lines": 666}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The header for our theme\n *\n * This is the template that displays all of the <head> section and everything up until <div id=\"content\">\n *\n * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\n?><!DOCTYPE html>\n<html <?php language_attributes(); ?> class=\"no-js no-svg\">\n<head>\n<meta charset=\"<?php bloginfo( 'charset' ); ?>\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<link rel=\"profile\" href=\"https://gmpg.org/xfn/11\">\n\n<?php wp_head(); ?>\n</head>\n\n<body <?php body_class(); ?>>\n<?php wp_body_open(); ?>\n<div id=\"page\" class=\"site\">\n\t<a class=\"skip-link screen-reader-text\" href=\"#content\"><?php _e( 'Skip to content', 'twentyseventeen' ); ?></a>\n\n\t<header id=\"masthead\" class=\"site-header\" role=\"banner\">\n\n\t\t<?php get_template_part( 'template-parts/header/header', 'image' ); ?>\n\n\t\t<?php if ( has_nav_menu( 'top' ) ) : ?>\n\t\t\t<div class=\"navigation-top\">\n\t\t\t\t<div class=\"wrap\">\n\t\t\t\t\t<?php get_template_part( 'template-parts/navigation/navigation', 'top' ); ?>\n\t\t\t\t</div><!-- .wrap -->\n\t\t\t</div><!-- .navigation-top -->\n\t\t<?php endif; ?>\n\n\t</header><!-- #masthead -->\n\n\t<?php\n\n\t/*\n\t * If a regular post or page, and not the front page, show the featured image.\n\t * Using get_queried_object_id() here since the $post global may not be set before a call to the_post().\n\t */\n\tif ( ( is_single() || ( is_page() && ! twentyseventeen_is_frontpage() ) ) && has_post_thumbnail( get_queried_object_id() ) ) :\n\t\techo '<div class=\"single-featured-image-header\">';\n\t\techo get_the_post_thumbnail( get_queried_object_id(), 'twentyseventeen-featured-image' );\n\t\techo '</div><!-- .single-featured-image-header -->';\n\tendif;\n\t?>\n\n\t<div class=\"site-content-contain\">\n\t\t<div id=\"content\" class=\"site-content\">\n", "num_lines": 59}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The main template file\n *\n * This is the most generic template file in a WordPress theme\n * and one of the two required files for a theme (the other being style.css).\n * It is used to display a page when nothing more specific matches a query.\n * E.g., it puts together the home page when no home.php file exists.\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\nget_header(); ?>\n\n<div class=\"wrap\">\n\t<?php if ( is_home() && ! is_front_page() ) : ?>\n\t\t<header class=\"page-header\">\n\t\t\t<h1 class=\"page-title\"><?php single_post_title(); ?></h1>\n\t\t</header>\n\t<?php else : ?>\n\t<header class=\"page-header\">\n\t\t<h2 class=\"page-title\"><?php _e( 'Posts', 'twentyseventeen' ); ?></h2>\n\t</header>\n\t<?php endif; ?>\n\n\t<div id=\"primary\" class=\"content-area\">\n\t\t<main id=\"main\" class=\"site-main\" role=\"main\">\n\n\t\t\t<?php\n\t\t\tif ( have_posts() ) :\n\n\t\t\t\t// Start the Loop.\n\t\t\t\twhile ( have_posts() ) :\n\t\t\t\t\tthe_post();\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Include the Post-Format-specific template for the content.\n\t\t\t\t\t * If you want to override this in a child theme, then include a file\n\t\t\t\t\t * called content-___.php (where ___ is the Post Format name) and that\n\t\t\t\t\t * will be used instead.\n\t\t\t\t\t */\n\t\t\t\t\tget_template_part( 'template-parts/post/content', get_post_format() );\n\n\t\t\t\tendwhile;\n\n\t\t\t\tthe_posts_pagination(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'prev_text'          => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class=\"screen-reader-text\">' . __( 'Previous page', 'twentyseventeen' ) . '</span>',\n\t\t\t\t\t\t'next_text'          => '<span class=\"screen-reader-text\">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),\n\t\t\t\t\t\t'before_page_number' => '<span class=\"meta-nav screen-reader-text\">' . __( 'Page', 'twentyseventeen' ) . ' </span>',\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\telse :\n\n\t\t\t\tget_template_part( 'template-parts/post/content', 'none' );\n\n\t\t\tendif;\n\t\t\t?>\n\n\t\t</main><!-- #main -->\n\t</div><!-- #primary -->\n\t<?php get_sidebar(); ?>\n</div><!-- .wrap -->\n\n<?php\nget_footer();\n", "num_lines": 73}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying all pages\n *\n * This is the template that displays all pages by default.\n * Please note that this is the WordPress construct of pages\n * and that other 'pages' on your WordPress site may use a\n * different template.\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\nget_header(); ?>\n\n<div class=\"wrap\">\n\t<div id=\"primary\" class=\"content-area\">\n\t\t<main id=\"main\" class=\"site-main\" role=\"main\">\n\n\t\t\t<?php\n\t\t\twhile ( have_posts() ) :\n\t\t\t\tthe_post();\n\n\t\t\t\tget_template_part( 'template-parts/page/content', 'page' );\n\n\t\t\t\t// If comments are open or we have at least one comment, load up the comment template.\n\t\t\t\tif ( comments_open() || get_comments_number() ) :\n\t\t\t\t\tcomments_template();\n\t\t\t\tendif;\n\n\t\t\tendwhile; // End the loop.\n\t\t\t?>\n\n\t\t</main><!-- #main -->\n\t</div><!-- #primary -->\n</div><!-- .wrap -->\n\n<?php\nget_footer();\n", "num_lines": 44}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying search results pages\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\nget_header(); ?>\n\n<div class=\"wrap\">\n\n\t<header class=\"page-header\">\n\t\t<?php if ( have_posts() ) : ?>\n\t\t\t<h1 class=\"page-title\">\n\t\t\t<?php\n\t\t\t/* translators: Search query. */\n\t\t\tprintf( __( 'Search Results for: %s', 'twentyseventeen' ), '<span>' . get_search_query() . '</span>' );\n\t\t\t?>\n\t\t\t</h1>\n\t\t<?php else : ?>\n\t\t\t<h1 class=\"page-title\"><?php _e( 'Nothing Found', 'twentyseventeen' ); ?></h1>\n\t\t<?php endif; ?>\n\t</header><!-- .page-header -->\n\n\t<div id=\"primary\" class=\"content-area\">\n\t\t<main id=\"main\" class=\"site-main\" role=\"main\">\n\n\t\t<?php\n\t\tif ( have_posts() ) :\n\t\t\t// Start the Loop.\n\t\t\twhile ( have_posts() ) :\n\t\t\t\tthe_post();\n\n\t\t\t\t/**\n\t\t\t\t * Run the loop for the search to output the results.\n\t\t\t\t * If you want to overload this in a child theme then include a file\n\t\t\t\t * called content-search.php and that will be used instead.\n\t\t\t\t */\n\t\t\t\tget_template_part( 'template-parts/post/content', 'excerpt' );\n\n\t\t\tendwhile; // End the loop.\n\n\t\t\tthe_posts_pagination(\n\t\t\t\tarray(\n\t\t\t\t\t'prev_text'          => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class=\"screen-reader-text\">' . __( 'Previous page', 'twentyseventeen' ) . '</span>',\n\t\t\t\t\t'next_text'          => '<span class=\"screen-reader-text\">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),\n\t\t\t\t\t'before_page_number' => '<span class=\"meta-nav screen-reader-text\">' . __( 'Page', 'twentyseventeen' ) . ' </span>',\n\t\t\t\t)\n\t\t\t);\n\n\t\telse :\n\t\t\t?>\n\n\t\t\t<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentyseventeen' ); ?></p>\n\t\t\t<?php\n\t\t\t\tget_search_form();\n\n\t\tendif;\n\t\t?>\n\n\t\t</main><!-- #main -->\n\t</div><!-- #primary -->\n\t<?php get_sidebar(); ?>\n</div><!-- .wrap -->\n\n<?php\nget_footer();\n", "num_lines": 73}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template for displaying search forms in Twenty Seventeen\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\n?>\n\n<?php $unique_id = esc_attr( twentyseventeen_unique_id( 'search-form-' ) ); ?>\n\n<form role=\"search\" method=\"get\" class=\"search-form\" action=\"<?php echo esc_url( home_url( '/' ) ); ?>\">\n\t<label for=\"<?php echo $unique_id; ?>\">\n\t\t<span class=\"screen-reader-text\"><?php echo _x( 'Search for:', 'label', 'twentyseventeen' ); ?></span>\n\t</label>\n\t<input type=\"search\" id=\"<?php echo $unique_id; ?>\" class=\"search-field\" placeholder=\"<?php echo esc_attr_x( 'Search &hellip;', 'placeholder', 'twentyseventeen' ); ?>\" value=\"<?php echo get_search_query(); ?>\" name=\"s\" />\n\t<button type=\"submit\" class=\"search-submit\"><?php echo twentyseventeen_get_svg( array( 'icon' => 'search' ) ); ?><span class=\"screen-reader-text\"><?php echo _x( 'Search', 'submit button', 'twentyseventeen' ); ?></span></button>\n</form>\n", "num_lines": 22}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The sidebar containing the main widget area\n *\n * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\nif ( ! is_active_sidebar( 'sidebar-1' ) ) {\n\treturn;\n}\n?>\n\n<aside id=\"secondary\" class=\"widget-area\" role=\"complementary\" aria-label=\"<?php esc_attr_e( 'Blog Sidebar', 'twentyseventeen' ); ?>\">\n\t<?php dynamic_sidebar( 'sidebar-1' ); ?>\n</aside><!-- #secondary -->\n", "num_lines": 21}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying all single posts\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\nget_header(); ?>\n\n<div class=\"wrap\">\n\t<div id=\"primary\" class=\"content-area\">\n\t\t<main id=\"main\" class=\"site-main\" role=\"main\">\n\n\t\t\t<?php\n\t\t\t// Start the Loop.\n\t\t\twhile ( have_posts() ) :\n\t\t\t\tthe_post();\n\n\t\t\t\tget_template_part( 'template-parts/post/content', get_post_format() );\n\n\t\t\t\t// If comments are open or we have at least one comment, load up the comment template.\n\t\t\t\tif ( comments_open() || get_comments_number() ) :\n\t\t\t\t\tcomments_template();\n\t\t\t\tendif;\n\n\t\t\t\tthe_post_navigation(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'prev_text' => '<span class=\"screen-reader-text\">' . __( 'Previous Post', 'twentyseventeen' ) . '</span><span aria-hidden=\"true\" class=\"nav-subtitle\">' . __( 'Previous', 'twentyseventeen' ) . '</span> <span class=\"nav-title\"><span class=\"nav-title-icon-wrapper\">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '</span>%title</span>',\n\t\t\t\t\t\t'next_text' => '<span class=\"screen-reader-text\">' . __( 'Next Post', 'twentyseventeen' ) . '</span><span aria-hidden=\"true\" class=\"nav-subtitle\">' . __( 'Next', 'twentyseventeen' ) . '</span> <span class=\"nav-title\">%title<span class=\"nav-title-icon-wrapper\">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ) . '</span></span>',\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\tendwhile; // End the loop.\n\t\t\t?>\n\n\t\t</main><!-- #main -->\n\t</div><!-- #primary -->\n\t<?php get_sidebar(); ?>\n</div><!-- .wrap -->\n\n<?php\nget_footer();\n", "num_lines": 48}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Twenty Seventeen back compat functionality\n *\n * Prevents Twenty Seventeen from running on WordPress versions prior to 4.7,\n * since this theme is not meant to be backward compatible beyond that and\n * relies on many newer functions and markup changes introduced in 4.7.\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n */\n\n/**\n * Prevent switching to Twenty Seventeen on old versions of WordPress.\n *\n * Switches to the default theme.\n *\n * @since Twenty Seventeen 1.0\n */\nfunction twentyseventeen_switch_theme() {\n\tswitch_theme( WP_DEFAULT_THEME );\n\tunset( $_GET['activated'] );\n\tadd_action( 'admin_notices', 'twentyseventeen_upgrade_notice' );\n}\nadd_action( 'after_switch_theme', 'twentyseventeen_switch_theme' );\n\n/**\n * Adds a message for unsuccessful theme switch.\n *\n * Prints an update nag after an unsuccessful attempt to switch to\n * Twenty Seventeen on WordPress versions prior to 4.7.\n *\n * @since Twenty Seventeen 1.0\n *\n * @global string $wp_version WordPress version.\n */\nfunction twentyseventeen_upgrade_notice() {\n\t/* translators: %s: The current WordPress version. */\n\t$message = sprintf( __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), $GLOBALS['wp_version'] );\n\tprintf( '<div class=\"error\"><p>%s</p></div>', $message );\n}\n\n/**\n * Prevents the Customizer from being loaded on WordPress versions prior to 4.7.\n *\n * @since Twenty Seventeen 1.0\n *\n * @global string $wp_version WordPress version.\n */\nfunction twentyseventeen_customize() {\n\twp_die(\n\t\t/* translators: %s: The current WordPress version. */\n\t\tsprintf( __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), $GLOBALS['wp_version'] ),\n\t\t'',\n\t\tarray(\n\t\t\t'back_link' => true,\n\t\t)\n\t);\n}\nadd_action( 'load-customize.php', 'twentyseventeen_customize' );\n\n/**\n * Prevents the Theme Preview from being loaded on WordPress versions prior to 4.7.\n *\n * @since Twenty Seventeen 1.0\n *\n * @global string $wp_version WordPress version.\n */\nfunction twentyseventeen_preview() {\n\tif ( isset( $_GET['preview'] ) ) {\n\t\t/* translators: %s: The current WordPress version. */\n\t\twp_die( sprintf( __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), $GLOBALS['wp_version'] ) );\n\t}\n}\nadd_action( 'template_redirect', 'twentyseventeen_preview' );\n", "num_lines": 77}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Twenty Seventeen: Color Patterns\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n */\n\n/**\n * Generate the CSS for the current custom color scheme.\n */\nfunction twentyseventeen_custom_colors_css() {\n\t$hue = absint( get_theme_mod( 'colorscheme_hue', 250 ) );\n\n\t/**\n\t * Filter Twenty Seventeen default saturation level.\n\t *\n\t * @since Twenty Seventeen 1.0\n\t *\n\t * @param int $saturation Color saturation level.\n\t */\n\t$saturation         = absint( apply_filters( 'twentyseventeen_custom_colors_saturation', 50 ) );\n\t$reduced_saturation = ( .8 * $saturation ) . '%';\n\t$saturation         = $saturation . '%';\n\t$css                = '\n/**\n * Twenty Seventeen: Color Patterns\n *\n * Colors are ordered from dark to light.\n */\n\n.colors-custom a:hover,\n.colors-custom a:active,\n.colors-custom .entry-content a:focus,\n.colors-custom .entry-content a:hover,\n.colors-custom .entry-summary a:focus,\n.colors-custom .entry-summary a:hover,\n.colors-custom .comment-content a:focus,\n.colors-custom .comment-content a:hover,\n.colors-custom .widget a:focus,\n.colors-custom .widget a:hover,\n.colors-custom .site-footer .widget-area a:focus,\n.colors-custom .site-footer .widget-area a:hover,\n.colors-custom .posts-navigation a:focus,\n.colors-custom .posts-navigation a:hover,\n.colors-custom .comment-metadata a:focus,\n.colors-custom .comment-metadata a:hover,\n.colors-custom .comment-metadata a.comment-edit-link:focus,\n.colors-custom .comment-metadata a.comment-edit-link:hover,\n.colors-custom .comment-reply-link:focus,\n.colors-custom .comment-reply-link:hover,\n.colors-custom .widget_authors a:focus strong,\n.colors-custom .widget_authors a:hover strong,\n.colors-custom .entry-title a:focus,\n.colors-custom .entry-title a:hover,\n.colors-custom .entry-meta a:focus,\n.colors-custom .entry-meta a:hover,\n.colors-custom.blog .entry-meta a.post-edit-link:focus,\n.colors-custom.blog .entry-meta a.post-edit-link:hover,\n.colors-custom.archive .entry-meta a.post-edit-link:focus,\n.colors-custom.archive .entry-meta a.post-edit-link:hover,\n.colors-custom.search .entry-meta a.post-edit-link:focus,\n.colors-custom.search .entry-meta a.post-edit-link:hover,\n.colors-custom .page-links a:focus .page-number,\n.colors-custom .page-links a:hover .page-number,\n.colors-custom .entry-footer a:focus,\n.colors-custom .entry-footer a:hover,\n.colors-custom .entry-footer .cat-links a:focus,\n.colors-custom .entry-footer .cat-links a:hover,\n.colors-custom .entry-footer .tags-links a:focus,\n.colors-custom .entry-footer .tags-links a:hover,\n.colors-custom .post-navigation a:focus,\n.colors-custom .post-navigation a:hover,\n.colors-custom .pagination a:not(.prev):not(.next):focus,\n.colors-custom .pagination a:not(.prev):not(.next):hover,\n.colors-custom .comments-pagination a:not(.prev):not(.next):focus,\n.colors-custom .comments-pagination a:not(.prev):not(.next):hover,\n.colors-custom .logged-in-as a:focus,\n.colors-custom .logged-in-as a:hover,\n.colors-custom a:focus .nav-title,\n.colors-custom a:hover .nav-title,\n.colors-custom .edit-link a:focus,\n.colors-custom .edit-link a:hover,\n.colors-custom .site-info a:focus,\n.colors-custom .site-info a:hover,\n.colors-custom .widget .widget-title a:focus,\n.colors-custom .widget .widget-title a:hover,\n.colors-custom .widget ul li a:focus,\n.colors-custom .widget ul li a:hover {\n\tcolor: hsl( ' . $hue . ', ' . $saturation . ', 0% ); /* base: #000; */\n}\n\n.colors-custom .entry-content a,\n.colors-custom .entry-summary a,\n.colors-custom .comment-content a,\n.colors-custom .widget a,\n.colors-custom .site-footer .widget-area a,\n.colors-custom .posts-navigation a,\n.colors-custom .widget_authors a strong {\n\t-webkit-box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 6% ); /* base: rgba(15, 15, 15, 1); */\n\tbox-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 6% ); /* base: rgba(15, 15, 15, 1); */\n}\n\n.colors-custom button,\n.colors-custom input[type=\"button\"],\n.colors-custom input[type=\"submit\"],\n.colors-custom .entry-footer .edit-link a.post-edit-link {\n\tbackground-color: hsl( ' . $hue . ', ' . $saturation . ', 13% ); /* base: #222; */\n}\n\n.colors-custom input[type=\"text\"]:focus,\n.colors-custom input[type=\"email\"]:focus,\n.colors-custom input[type=\"url\"]:focus,\n.colors-custom input[type=\"password\"]:focus,\n.colors-custom input[type=\"search\"]:focus,\n.colors-custom input[type=\"number\"]:focus,\n.colors-custom input[type=\"tel\"]:focus,\n.colors-custom input[type=\"range\"]:focus,\n.colors-custom input[type=\"date\"]:focus,\n.colors-custom input[type=\"month\"]:focus,\n.colors-custom input[type=\"week\"]:focus,\n.colors-custom input[type=\"time\"]:focus,\n.colors-custom input[type=\"datetime\"]:focus,\n.colors-custom .colors-custom input[type=\"datetime-local\"]:focus,\n.colors-custom input[type=\"color\"]:focus,\n.colors-custom textarea:focus,\n.colors-custom button.secondary,\n.colors-custom input[type=\"reset\"],\n.colors-custom input[type=\"button\"].secondary,\n.colors-custom input[type=\"reset\"].secondary,\n.colors-custom input[type=\"submit\"].secondary,\n.colors-custom a,\n.colors-custom .site-title,\n.colors-custom .site-title a,\n.colors-custom .navigation-top a,\n.colors-custom .dropdown-toggle,\n.colors-custom .menu-toggle,\n.colors-custom .page .panel-content .entry-title,\n.colors-custom .page-title,\n.colors-custom.page:not(.twentyseventeen-front-page) .entry-title,\n.colors-custom .page-links a .page-number,\n.colors-custom .comment-metadata a.comment-edit-link,\n.colors-custom .comment-reply-link .icon,\n.colors-custom h2.widget-title,\n.colors-custom mark,\n.colors-custom .post-navigation a:focus .icon,\n.colors-custom .post-navigation a:hover .icon,\n.colors-custom .site-content .site-content-light,\n.colors-custom .twentyseventeen-panel .recent-posts .entry-header .edit-link {\n\tcolor: hsl( ' . $hue . ', ' . $saturation . ', 13% ); /* base: #222; */\n}\n\n.colors-custom .entry-content a:focus,\n.colors-custom .entry-content a:hover,\n.colors-custom .entry-summary a:focus,\n.colors-custom .entry-summary a:hover,\n.colors-custom .comment-content a:focus,\n.colors-custom .comment-content a:hover,\n.colors-custom .widget a:focus,\n.colors-custom .widget a:hover,\n.colors-custom .site-footer .widget-area a:focus,\n.colors-custom .site-footer .widget-area a:hover,\n.colors-custom .posts-navigation a:focus,\n.colors-custom .posts-navigation a:hover,\n.colors-custom .comment-metadata a:focus,\n.colors-custom .comment-metadata a:hover,\n.colors-custom .comment-metadata a.comment-edit-link:focus,\n.colors-custom .comment-metadata a.comment-edit-link:hover,\n.colors-custom .comment-reply-link:focus,\n.colors-custom .comment-reply-link:hover,\n.colors-custom .widget_authors a:focus strong,\n.colors-custom .widget_authors a:hover strong,\n.colors-custom .entry-title a:focus,\n.colors-custom .entry-title a:hover,\n.colors-custom .entry-meta a:focus,\n.colors-custom .entry-meta a:hover,\n.colors-custom.blog .entry-meta a.post-edit-link:focus,\n.colors-custom.blog .entry-meta a.post-edit-link:hover,\n.colors-custom.archive .entry-meta a.post-edit-link:focus,\n.colors-custom.archive .entry-meta a.post-edit-link:hover,\n.colors-custom.search .entry-meta a.post-edit-link:focus,\n.colors-custom.search .entry-meta a.post-edit-link:hover,\n.colors-custom .page-links a:focus .page-number,\n.colors-custom .page-links a:hover .page-number,\n.colors-custom .entry-footer .cat-links a:focus,\n.colors-custom .entry-footer .cat-links a:hover,\n.colors-custom .entry-footer .tags-links a:focus,\n.colors-custom .entry-footer .tags-links a:hover,\n.colors-custom .post-navigation a:focus,\n.colors-custom .post-navigation a:hover,\n.colors-custom .pagination a:not(.prev):not(.next):focus,\n.colors-custom .pagination a:not(.prev):not(.next):hover,\n.colors-custom .comments-pagination a:not(.prev):not(.next):focus,\n.colors-custom .comments-pagination a:not(.prev):not(.next):hover,\n.colors-custom .logged-in-as a:focus,\n.colors-custom .logged-in-as a:hover,\n.colors-custom a:focus .nav-title,\n.colors-custom a:hover .nav-title,\n.colors-custom .edit-link a:focus,\n.colors-custom .edit-link a:hover,\n.colors-custom .site-info a:focus,\n.colors-custom .site-info a:hover,\n.colors-custom .widget .widget-title a:focus,\n.colors-custom .widget .widget-title a:hover,\n.colors-custom .widget ul li a:focus,\n.colors-custom .widget ul li a:hover {\n\t-webkit-box-shadow: inset 0 0 0 hsl( ' . $hue . ', ' . $saturation . ', 13% ), 0 3px 0 hsl( ' . $hue . ', ' . $saturation . ', 13% );\n\tbox-shadow: inset 0 0 0 hsl( ' . $hue . ', ' . $saturation . ' , 13% ), 0 3px 0 hsl( ' . $hue . ', ' . $saturation . ', 13% );\n}\n\nbody.colors-custom,\n.colors-custom button,\n.colors-custom input,\n.colors-custom select,\n.colors-custom textarea,\n.colors-custom h3,\n.colors-custom h4,\n.colors-custom h6,\n.colors-custom label,\n.colors-custom .entry-title a,\n.colors-custom.twentyseventeen-front-page .panel-content .recent-posts article,\n.colors-custom .entry-footer .cat-links a,\n.colors-custom .entry-footer .tags-links a,\n.colors-custom .format-quote blockquote,\n.colors-custom .nav-title,\n.colors-custom .comment-body,\n.colors-custom .site-content .wp-playlist-light .wp-playlist-current-item .wp-playlist-item-album {\n\tcolor: hsl( ' . $hue . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */\n}\n\n.colors-custom .social-navigation a:hover,\n.colors-custom .social-navigation a:focus {\n\tbackground: hsl( ' . $hue . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */\n}\n\n.colors-custom input[type=\"text\"]:focus,\n.colors-custom input[type=\"email\"]:focus,\n.colors-custom input[type=\"url\"]:focus,\n.colors-custom input[type=\"password\"]:focus,\n.colors-custom input[type=\"search\"]:focus,\n.colors-custom input[type=\"number\"]:focus,\n.colors-custom input[type=\"tel\"]:focus,\n.colors-custom input[type=\"range\"]:focus,\n.colors-custom input[type=\"date\"]:focus,\n.colors-custom input[type=\"month\"]:focus,\n.colors-custom input[type=\"week\"]:focus,\n.colors-custom input[type=\"time\"]:focus,\n.colors-custom input[type=\"datetime\"]:focus,\n.colors-custom input[type=\"datetime-local\"]:focus,\n.colors-custom input[type=\"color\"]:focus,\n.colors-custom textarea:focus,\n.bypostauthor > .comment-body > .comment-meta > .comment-author .avatar {\n\tborder-color: hsl( ' . $hue . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */\n}\n\n.colors-custom h2,\n.colors-custom blockquote,\n.colors-custom input[type=\"text\"],\n.colors-custom input[type=\"email\"],\n.colors-custom input[type=\"url\"],\n.colors-custom input[type=\"password\"],\n.colors-custom input[type=\"search\"],\n.colors-custom input[type=\"number\"],\n.colors-custom input[type=\"tel\"],\n.colors-custom input[type=\"range\"],\n.colors-custom input[type=\"date\"],\n.colors-custom input[type=\"month\"],\n.colors-custom input[type=\"week\"],\n.colors-custom input[type=\"time\"],\n.colors-custom input[type=\"datetime\"],\n.colors-custom input[type=\"datetime-local\"],\n.colors-custom input[type=\"color\"],\n.colors-custom textarea,\n.colors-custom .site-description,\n.colors-custom .entry-content blockquote.alignleft,\n.colors-custom .entry-content blockquote.alignright,\n.colors-custom .colors-custom .taxonomy-description,\n.colors-custom .site-info a,\n.colors-custom .wp-caption,\n.colors-custom .gallery-caption {\n\tcolor: hsl( ' . $hue . ', ' . $saturation . ', 40% ); /* base: #666; */\n}\n\n.colors-custom abbr,\n.colors-custom acronym {\n\tborder-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 40% ); /* base: #666; */\n}\n\n.colors-custom h5,\n.colors-custom .entry-meta,\n.colors-custom .entry-meta a,\n.colors-custom.blog .entry-meta a.post-edit-link,\n.colors-custom.archive .entry-meta a.post-edit-link,\n.colors-custom.search .entry-meta a.post-edit-link,\n.colors-custom .nav-subtitle,\n.colors-custom .comment-metadata,\n.colors-custom .comment-metadata a,\n.colors-custom .no-comments,\n.colors-custom .comment-awaiting-moderation,\n.colors-custom .page-numbers.current,\n.colors-custom .page-links .page-number,\n.colors-custom .navigation-top .current-menu-item > a,\n.colors-custom .navigation-top .current_page_item > a,\n.colors-custom .main-navigation a:hover,\n.colors-custom .site-content .wp-playlist-light .wp-playlist-current-item .wp-playlist-item-artist {\n\tcolor: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */\n}\n\n.colors-custom :not( .mejs-button ) > button:hover,\n.colors-custom :not( .mejs-button ) > button:focus,\n.colors-custom input[type=\"button\"]:hover,\n.colors-custom input[type=\"button\"]:focus,\n.colors-custom input[type=\"submit\"]:hover,\n.colors-custom input[type=\"submit\"]:focus,\n.colors-custom .entry-footer .edit-link a.post-edit-link:hover,\n.colors-custom .entry-footer .edit-link a.post-edit-link:focus,\n.colors-custom .social-navigation a,\n.colors-custom .prev.page-numbers:focus,\n.colors-custom .prev.page-numbers:hover,\n.colors-custom .next.page-numbers:focus,\n.colors-custom .next.page-numbers:hover,\n.colors-custom .site-content .wp-playlist-light .wp-playlist-item:hover,\n.colors-custom .site-content .wp-playlist-light .wp-playlist-item:focus {\n\tbackground: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 46% ); /* base: #767676; */\n}\n\n.colors-custom button.secondary:hover,\n.colors-custom button.secondary:focus,\n.colors-custom input[type=\"reset\"]:hover,\n.colors-custom input[type=\"reset\"]:focus,\n.colors-custom input[type=\"button\"].secondary:hover,\n.colors-custom input[type=\"button\"].secondary:focus,\n.colors-custom input[type=\"reset\"].secondary:hover,\n.colors-custom input[type=\"reset\"].secondary:focus,\n.colors-custom input[type=\"submit\"].secondary:hover,\n.colors-custom input[type=\"submit\"].secondary:focus,\n.colors-custom hr {\n\tbackground: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */\n}\n\n.colors-custom input[type=\"text\"],\n.colors-custom input[type=\"email\"],\n.colors-custom input[type=\"url\"],\n.colors-custom input[type=\"password\"],\n.colors-custom input[type=\"search\"],\n.colors-custom input[type=\"number\"],\n.colors-custom input[type=\"tel\"],\n.colors-custom input[type=\"range\"],\n.colors-custom input[type=\"date\"],\n.colors-custom input[type=\"month\"],\n.colors-custom input[type=\"week\"],\n.colors-custom input[type=\"time\"],\n.colors-custom input[type=\"datetime\"],\n.colors-custom input[type=\"datetime-local\"],\n.colors-custom input[type=\"color\"],\n.colors-custom textarea,\n.colors-custom select,\n.colors-custom fieldset,\n.colors-custom .widget .tagcloud a:hover,\n.colors-custom .widget .tagcloud a:focus,\n.colors-custom .widget.widget_tag_cloud a:hover,\n.colors-custom .widget.widget_tag_cloud a:focus,\n.colors-custom .wp_widget_tag_cloud a:hover,\n.colors-custom .wp_widget_tag_cloud a:focus {\n\tborder-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */\n}\n\n.colors-custom thead th {\n\tborder-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */\n}\n\n.colors-custom .entry-footer .cat-links .icon,\n.colors-custom .entry-footer .tags-links .icon {\n\tcolor: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */\n}\n\n.colors-custom button.secondary,\n.colors-custom input[type=\"reset\"],\n.colors-custom input[type=\"button\"].secondary,\n.colors-custom input[type=\"reset\"].secondary,\n.colors-custom input[type=\"submit\"].secondary,\n.colors-custom .prev.page-numbers,\n.colors-custom .next.page-numbers {\n\tbackground-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */\n}\n\n.colors-custom .widget .tagcloud a,\n.colors-custom .widget.widget_tag_cloud a,\n.colors-custom .wp_widget_tag_cloud a {\n\tborder-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */\n}\n\n.colors-custom.twentyseventeen-front-page article:not(.has-post-thumbnail):not(:first-child),\n.colors-custom .widget ul li {\n\tborder-top-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */\n}\n\n.colors-custom .widget ul li {\n\tborder-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */\n}\n\n.colors-custom pre,\n.colors-custom mark,\n.colors-custom ins {\n\tbackground: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */\n}\n\n.colors-custom .navigation-top,\n.colors-custom .main-navigation > div > ul,\n.colors-custom .pagination,\n.colors-custom .comments-pagination,\n.colors-custom .entry-footer,\n.colors-custom .site-footer {\n\tborder-top-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */\n}\n\n.colors-custom .navigation-top,\n.colors-custom .main-navigation li,\n.colors-custom .entry-footer,\n.colors-custom .single-featured-image-header,\n.colors-custom .site-content .wp-playlist-light .wp-playlist-item,\n.colors-custom tr {\n\tborder-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */\n}\n\n.colors-custom .site-content .wp-playlist-light {\n\tborder-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */\n}\n\n.colors-custom .site-header,\n.colors-custom .single-featured-image-header {\n\tbackground-color: hsl( ' . $hue . ', ' . $saturation . ', 98% ); /* base: #fafafa; */\n}\n\n.colors-custom button,\n.colors-custom input[type=\"button\"],\n.colors-custom input[type=\"submit\"],\n.colors-custom .entry-footer .edit-link a.post-edit-link,\n.colors-custom .social-navigation a,\n.colors-custom .site-content .wp-playlist-light a.wp-playlist-caption:hover,\n.colors-custom .site-content .wp-playlist-light .wp-playlist-item:hover a,\n.colors-custom .site-content .wp-playlist-light .wp-playlist-item:focus a,\n.colors-custom .site-content .wp-playlist-light .wp-playlist-item:hover,\n.colors-custom .site-content .wp-playlist-light .wp-playlist-item:focus,\n.colors-custom .prev.page-numbers:focus,\n.colors-custom .prev.page-numbers:hover,\n.colors-custom .next.page-numbers:focus,\n.colors-custom .next.page-numbers:hover,\n.colors-custom.has-header-image .site-title,\n.colors-custom.has-header-video .site-title,\n.colors-custom.has-header-image .site-title a,\n.colors-custom.has-header-video .site-title a,\n.colors-custom.has-header-image .site-description,\n.colors-custom.has-header-video .site-description {\n\tcolor: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */\n}\n\nbody.colors-custom,\n.colors-custom .navigation-top,\n.colors-custom .main-navigation ul {\n\tbackground: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */\n}\n\n.colors-custom .widget ul li a,\n.colors-custom .site-footer .widget-area ul li a {\n\t-webkit-box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: rgba(255, 255, 255, 1); */\n\tbox-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 100% );  /* base: rgba(255, 255, 255, 1); */\n}\n\n.colors-custom .menu-toggle,\n.colors-custom .menu-toggle:hover,\n.colors-custom .menu-toggle:focus,\n.colors-custom .menu .dropdown-toggle,\n.colors-custom .menu-scroll-down,\n.colors-custom .menu-scroll-down:hover,\n.colors-custom .menu-scroll-down:focus {\n\tbackground-color: transparent;\n}\n\n.colors-custom .widget .tagcloud a,\n.colors-custom .widget .tagcloud a:focus,\n.colors-custom .widget .tagcloud a:hover,\n.colors-custom .widget.widget_tag_cloud a,\n.colors-custom .widget.widget_tag_cloud a:focus,\n.colors-custom .widget.widget_tag_cloud a:hover,\n.colors-custom .wp_widget_tag_cloud a,\n.colors-custom .wp_widget_tag_cloud a:focus,\n.colors-custom .wp_widget_tag_cloud a:hover,\n.colors-custom .entry-footer .edit-link a.post-edit-link:focus,\n.colors-custom .entry-footer .edit-link a.post-edit-link:hover {\n\t-webkit-box-shadow: none !important;\n\tbox-shadow: none !important;\n}\n\n/* Reset non-customizable hover styling for links */\n.colors-custom .entry-content a:hover,\n.colors-custom .entry-content a:focus,\n.colors-custom .entry-summary a:hover,\n.colors-custom .entry-summary a:focus,\n.colors-custom .comment-content a:focus,\n.colors-custom .comment-content a:hover,\n.colors-custom .widget a:hover,\n.colors-custom .widget a:focus,\n.colors-custom .site-footer .widget-area a:hover,\n.colors-custom .site-footer .widget-area a:focus,\n.colors-custom .posts-navigation a:hover,\n.colors-custom .posts-navigation a:focus,\n.colors-custom .widget_authors a:hover strong,\n.colors-custom .widget_authors a:focus strong {\n\t-webkit-box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 3px 0 rgba(0, 0, 0, 1);\n\tbox-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 3px 0 rgba(0, 0, 0, 1);\n}\n\n.colors-custom .gallery-item a,\n.colors-custom .gallery-item a:hover,\n.colors-custom .gallery-item a:focus {\n\t-webkit-box-shadow: none;\n\tbox-shadow: none;\n}\n\n@media screen and (min-width: 48em) {\n\n\t.colors-custom .nav-links .nav-previous .nav-title .icon,\n\t.colors-custom .nav-links .nav-next .nav-title .icon {\n\t\tcolor: hsl( ' . $hue . ', ' . $saturation . ', 20% ); /* base: #222; */\n\t}\n\n\t.colors-custom .main-navigation li li:hover,\n\t.colors-custom .main-navigation li li.focus {\n\t\tbackground: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */\n\t}\n\n\t.colors-custom .navigation-top .menu-scroll-down {\n\t\tcolor: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */;\n\t}\n\n\t.colors-custom abbr[title] {\n\t\tborder-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */;\n\t}\n\n\t.colors-custom .main-navigation ul ul {\n\t\tborder-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */\n\t\tbackground: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */\n\t}\n\n\t.colors-custom .main-navigation ul li.menu-item-has-children:before,\n\t.colors-custom .main-navigation ul li.page_item_has_children:before {\n\t\tborder-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */\n\t}\n\n\t.colors-custom .main-navigation ul li.menu-item-has-children:after,\n\t.colors-custom .main-navigation ul li.page_item_has_children:after {\n\t\tborder-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */\n\t}\n\n\t.colors-custom .main-navigation li li.focus > a,\n\t.colors-custom .main-navigation li li:focus > a,\n\t.colors-custom .main-navigation li li:hover > a,\n\t.colors-custom .main-navigation li li a:hover,\n\t.colors-custom .main-navigation li li a:focus,\n\t.colors-custom .main-navigation li li.current_page_item a:hover,\n\t.colors-custom .main-navigation li li.current-menu-item a:hover,\n\t.colors-custom .main-navigation li li.current_page_item a:focus,\n\t.colors-custom .main-navigation li li.current-menu-item a:focus {\n\t\tcolor: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */\n\t}\n}';\n\n\t/**\n\t * Filters Twenty Seventeen custom colors CSS.\n\t *\n\t * @since Twenty Seventeen 1.0\n\t *\n\t * @param string $css        Base theme colors CSS.\n\t * @param int    $hue        The user's selected color hue.\n\t * @param string $saturation Filtered theme color saturation level.\n\t */\n\treturn apply_filters( 'twentyseventeen_custom_colors_css', $css, $hue, $saturation );\n}\n", "num_lines": 581}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Custom header implementation\n *\n * @link https://codex.wordpress.org/Custom_Headers\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n */\n\n/**\n * Set up the WordPress core custom header feature.\n *\n * @uses twentyseventeen_header_style()\n */\nfunction twentyseventeen_custom_header_setup() {\n\n\tadd_theme_support(\n\t\t'custom-header',\n\t\t/**\n\t\t * Filter Twenty Seventeen custom-header support arguments.\n\t\t *\n\t\t * @since Twenty Seventeen 1.0\n\t\t *\n\t\t * @param array $args {\n\t\t *     An array of custom-header support arguments.\n\t\t *\n\t\t *     @type string $default-image    Default image of the header.\n\t\t *     @type int    $width            Width in pixels of the custom header image. Default 954.\n\t\t *     @type int    $height           Height in pixels of the custom header image. Default 1300.\n\t\t *     @type string $flex-height      Flex support for height of header.\n\t\t *     @type string $video            Video support for header.\n\t\t *     @type string $wp-head-callback Callback function used to styles the header image and text\n\t\t *                                    displayed on the blog.\n\t\t * }\n\t\t */\n\t\tapply_filters(\n\t\t\t'twentyseventeen_custom_header_args',\n\t\t\tarray(\n\t\t\t\t'default-image'    => get_parent_theme_file_uri( '/assets/images/header.jpg' ),\n\t\t\t\t'width'            => 2000,\n\t\t\t\t'height'           => 1200,\n\t\t\t\t'flex-height'      => true,\n\t\t\t\t'video'            => true,\n\t\t\t\t'wp-head-callback' => 'twentyseventeen_header_style',\n\t\t\t)\n\t\t)\n\t);\n\n\tregister_default_headers(\n\t\tarray(\n\t\t\t'default-image' => array(\n\t\t\t\t'url'           => '%s/assets/images/header.jpg',\n\t\t\t\t'thumbnail_url' => '%s/assets/images/header.jpg',\n\t\t\t\t'description'   => __( 'Default Header Image', 'twentyseventeen' ),\n\t\t\t),\n\t\t)\n\t);\n}\nadd_action( 'after_setup_theme', 'twentyseventeen_custom_header_setup' );\n\nif ( ! function_exists( 'twentyseventeen_header_style' ) ) :\n\t/**\n\t * Styles the header image and text displayed on the blog.\n\t *\n\t * @see twentyseventeen_custom_header_setup().\n\t */\n\tfunction twentyseventeen_header_style() {\n\t\t$header_text_color = get_header_textcolor();\n\n\t\t// If no custom options for text are set, let's bail.\n\t\t// get_header_textcolor() options: add_theme_support( 'custom-header' ) is default, hide text (returns 'blank') or any hex value.\n\t\tif ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If we get this far, we have custom styles. Let's do this.\n\t\t?>\n\t\t<style id=\"twentyseventeen-custom-header-styles\" type=\"text/css\">\n\t\t<?php\n\t\t// Has the text been hidden?\n\t\tif ( 'blank' === $header_text_color ) :\n\t\t\t?>\n\t\t.site-title,\n\t\t.site-description {\n\t\t\tposition: absolute;\n\t\t\tclip: rect(1px, 1px, 1px, 1px);\n\t\t}\n\t\t\t<?php\n\t\t\t// If the user has set a custom color for the text use that.\n\t\telse :\n\t\t\t?>\n\t\t.site-title a,\n\t\t.colors-dark .site-title a,\n\t\t.colors-custom .site-title a,\n\t\tbody.has-header-image .site-title a,\n\t\tbody.has-header-video .site-title a,\n\t\tbody.has-header-image.colors-dark .site-title a,\n\t\tbody.has-header-video.colors-dark .site-title a,\n\t\tbody.has-header-image.colors-custom .site-title a,\n\t\tbody.has-header-video.colors-custom .site-title a,\n\t\t.site-description,\n\t\t.colors-dark .site-description,\n\t\t.colors-custom .site-description,\n\t\tbody.has-header-image .site-description,\n\t\tbody.has-header-video .site-description,\n\t\tbody.has-header-image.colors-dark .site-description,\n\t\tbody.has-header-video.colors-dark .site-description,\n\t\tbody.has-header-image.colors-custom .site-description,\n\t\tbody.has-header-video.colors-custom .site-description {\n\t\t\tcolor: #<?php echo esc_attr( $header_text_color ); ?>;\n\t\t}\n\t<?php endif; ?>\n\t</style>\n\t\t<?php\n\t}\nendif; // End of twentyseventeen_header_style().\n\n/**\n * Customize video play/pause button in the custom header.\n *\n * @param array $settings Video settings.\n * @return array The filtered video settings.\n */\nfunction twentyseventeen_video_controls( $settings ) {\n\t$settings['l10n']['play']  = '<span class=\"screen-reader-text\">' . __( 'Play background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'play' ) );\n\t$settings['l10n']['pause'] = '<span class=\"screen-reader-text\">' . __( 'Pause background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'pause' ) );\n\treturn $settings;\n}\nadd_filter( 'header_video_settings', 'twentyseventeen_video_controls' );\n", "num_lines": 132}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Twenty Seventeen: Customizer\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n */\n\n/**\n * Add postMessage support for site title and description for the Theme Customizer.\n *\n * @param WP_Customize_Manager $wp_customize Theme Customizer object.\n */\nfunction twentyseventeen_customize_register( $wp_customize ) {\n\t$wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';\n\t$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';\n\t$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';\n\n\t$wp_customize->selective_refresh->add_partial(\n\t\t'blogname',\n\t\tarray(\n\t\t\t'selector'        => '.site-title a',\n\t\t\t'render_callback' => 'twentyseventeen_customize_partial_blogname',\n\t\t)\n\t);\n\t$wp_customize->selective_refresh->add_partial(\n\t\t'blogdescription',\n\t\tarray(\n\t\t\t'selector'        => '.site-description',\n\t\t\t'render_callback' => 'twentyseventeen_customize_partial_blogdescription',\n\t\t)\n\t);\n\n\t/**\n\t * Custom colors.\n\t */\n\t$wp_customize->add_setting(\n\t\t'colorscheme',\n\t\tarray(\n\t\t\t'default'           => 'light',\n\t\t\t'transport'         => 'postMessage',\n\t\t\t'sanitize_callback' => 'twentyseventeen_sanitize_colorscheme',\n\t\t)\n\t);\n\n\t$wp_customize->add_setting(\n\t\t'colorscheme_hue',\n\t\tarray(\n\t\t\t'default'           => 250,\n\t\t\t'transport'         => 'postMessage',\n\t\t\t'sanitize_callback' => 'absint', // The hue is stored as a positive integer.\n\t\t)\n\t);\n\n\t$wp_customize->add_control(\n\t\t'colorscheme',\n\t\tarray(\n\t\t\t'type'     => 'radio',\n\t\t\t'label'    => __( 'Color Scheme', 'twentyseventeen' ),\n\t\t\t'choices'  => array(\n\t\t\t\t'light'  => __( 'Light', 'twentyseventeen' ),\n\t\t\t\t'dark'   => __( 'Dark', 'twentyseventeen' ),\n\t\t\t\t'custom' => __( 'Custom', 'twentyseventeen' ),\n\t\t\t),\n\t\t\t'section'  => 'colors',\n\t\t\t'priority' => 5,\n\t\t)\n\t);\n\n\t$wp_customize->add_control(\n\t\tnew WP_Customize_Color_Control(\n\t\t\t$wp_customize,\n\t\t\t'colorscheme_hue',\n\t\t\tarray(\n\t\t\t\t'mode'     => 'hue',\n\t\t\t\t'section'  => 'colors',\n\t\t\t\t'priority' => 6,\n\t\t\t)\n\t\t)\n\t);\n\n\t/**\n\t * Theme options.\n\t */\n\t$wp_customize->add_section(\n\t\t'theme_options',\n\t\tarray(\n\t\t\t'title'    => __( 'Theme Options', 'twentyseventeen' ),\n\t\t\t'priority' => 130, // Before Additional CSS.\n\t\t)\n\t);\n\n\t$wp_customize->add_setting(\n\t\t'page_layout',\n\t\tarray(\n\t\t\t'default'           => 'two-column',\n\t\t\t'sanitize_callback' => 'twentyseventeen_sanitize_page_layout',\n\t\t\t'transport'         => 'postMessage',\n\t\t)\n\t);\n\n\t$wp_customize->add_control(\n\t\t'page_layout',\n\t\tarray(\n\t\t\t'label'           => __( 'Page Layout', 'twentyseventeen' ),\n\t\t\t'section'         => 'theme_options',\n\t\t\t'type'            => 'radio',\n\t\t\t'description'     => __( 'When the two-column layout is assigned, the page title is in one column and content is in the other.', 'twentyseventeen' ),\n\t\t\t'choices'         => array(\n\t\t\t\t'one-column' => __( 'One Column', 'twentyseventeen' ),\n\t\t\t\t'two-column' => __( 'Two Column', 'twentyseventeen' ),\n\t\t\t),\n\t\t\t'active_callback' => 'twentyseventeen_is_view_with_layout_option',\n\t\t)\n\t);\n\n\t/**\n\t * Filter number of front page sections in Twenty Seventeen.\n\t *\n\t * @since Twenty Seventeen 1.0\n\t *\n\t * @param int $num_sections Number of front page sections.\n\t */\n\t$num_sections = apply_filters( 'twentyseventeen_front_page_sections', 4 );\n\n\t// Create a setting and control for each of the sections available in the theme.\n\tfor ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) {\n\t\t$wp_customize->add_setting(\n\t\t\t'panel_' . $i,\n\t\t\tarray(\n\t\t\t\t'default'           => false,\n\t\t\t\t'sanitize_callback' => 'absint',\n\t\t\t\t'transport'         => 'postMessage',\n\t\t\t)\n\t\t);\n\n\t\t$wp_customize->add_control(\n\t\t\t'panel_' . $i,\n\t\t\tarray(\n\t\t\t\t/* translators: %d: The front page section number. */\n\t\t\t\t'label'           => sprintf( __( 'Front Page Section %d Content', 'twentyseventeen' ), $i ),\n\t\t\t\t'description'     => ( 1 !== $i ? '' : __( 'Select pages to feature in each area from the dropdowns. Add an image to a section by setting a featured image in the page editor. Empty sections will not be displayed.', 'twentyseventeen' ) ),\n\t\t\t\t'section'         => 'theme_options',\n\t\t\t\t'type'            => 'dropdown-pages',\n\t\t\t\t'allow_addition'  => true,\n\t\t\t\t'active_callback' => 'twentyseventeen_is_static_front_page',\n\t\t\t)\n\t\t);\n\n\t\t$wp_customize->selective_refresh->add_partial(\n\t\t\t'panel_' . $i,\n\t\t\tarray(\n\t\t\t\t'selector'            => '#panel' . $i,\n\t\t\t\t'render_callback'     => 'twentyseventeen_front_page_section',\n\t\t\t\t'container_inclusive' => true,\n\t\t\t)\n\t\t);\n\t}\n}\nadd_action( 'customize_register', 'twentyseventeen_customize_register' );\n\n/**\n * Sanitize the page layout options.\n *\n * @param string $input Page layout.\n */\nfunction twentyseventeen_sanitize_page_layout( $input ) {\n\t$valid = array(\n\t\t'one-column' => __( 'One Column', 'twentyseventeen' ),\n\t\t'two-column' => __( 'Two Column', 'twentyseventeen' ),\n\t);\n\n\tif ( array_key_exists( $input, $valid ) ) {\n\t\treturn $input;\n\t}\n\n\treturn '';\n}\n\n/**\n * Sanitize the colorscheme.\n *\n * @param string $input Color scheme.\n */\nfunction twentyseventeen_sanitize_colorscheme( $input ) {\n\t$valid = array( 'light', 'dark', 'custom' );\n\n\tif ( in_array( $input, $valid, true ) ) {\n\t\treturn $input;\n\t}\n\n\treturn 'light';\n}\n\n/**\n * Render the site title for the selective refresh partial.\n *\n * @since Twenty Seventeen 1.0\n *\n * @see twentyseventeen_customize_register()\n *\n * @return void\n */\nfunction twentyseventeen_customize_partial_blogname() {\n\tbloginfo( 'name' );\n}\n\n/**\n * Render the site tagline for the selective refresh partial.\n *\n * @since Twenty Seventeen 1.0\n *\n * @see twentyseventeen_customize_register()\n *\n * @return void\n */\nfunction twentyseventeen_customize_partial_blogdescription() {\n\tbloginfo( 'description' );\n}\n\n/**\n * Return whether we're previewing the front page and it's a static page.\n */\nfunction twentyseventeen_is_static_front_page() {\n\treturn ( is_front_page() && ! is_home() );\n}\n\n/**\n * Return whether we're on a view that supports a one or two column layout.\n */\nfunction twentyseventeen_is_view_with_layout_option() {\n\t// This option is available on all pages. It's also available on archives when there isn't a sidebar.\n\treturn ( is_page() || ( is_archive() && ! is_active_sidebar( 'sidebar-1' ) ) );\n}\n\n/**\n * Bind JS handlers to instantly live-preview changes.\n */\nfunction twentyseventeen_customize_preview_js() {\n\twp_enqueue_script( 'twentyseventeen-customize-preview', get_theme_file_uri( '/assets/js/customize-preview.js' ), array( 'customize-preview' ), '20161002', true );\n}\nadd_action( 'customize_preview_init', 'twentyseventeen_customize_preview_js' );\n\n/**\n * Load dynamic logic for the customizer controls area.\n */\nfunction twentyseventeen_panels_js() {\n\twp_enqueue_script( 'twentyseventeen-customize-controls', get_theme_file_uri( '/assets/js/customize-controls.js' ), array(), '20161020', true );\n}\nadd_action( 'customize_controls_enqueue_scripts', 'twentyseventeen_panels_js' );\n", "num_lines": 252}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SVG icons related functions and filters\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n */\n\n/**\n * Add SVG definitions to the footer.\n */\nfunction twentyseventeen_include_svg_icons() {\n\t// Define SVG sprite file.\n\t$svg_icons = get_parent_theme_file_path( '/assets/images/svg-icons.svg' );\n\n\t// If it exists, include it.\n\tif ( file_exists( $svg_icons ) ) {\n\t\trequire_once $svg_icons;\n\t}\n}\nadd_action( 'wp_footer', 'twentyseventeen_include_svg_icons', 9999 );\n\n/**\n * Return SVG markup.\n *\n * @param array $args {\n *     Parameters needed to display an SVG.\n *\n *     @type string $icon  Required SVG icon filename.\n *     @type string $title Optional SVG title.\n *     @type string $desc  Optional SVG description.\n * }\n * @return string SVG markup.\n */\nfunction twentyseventeen_get_svg( $args = array() ) {\n\t// Make sure $args are an array.\n\tif ( empty( $args ) ) {\n\t\treturn __( 'Please define default parameters in the form of an array.', 'twentyseventeen' );\n\t}\n\n\t// Define an icon.\n\tif ( false === array_key_exists( 'icon', $args ) ) {\n\t\treturn __( 'Please define an SVG icon filename.', 'twentyseventeen' );\n\t}\n\n\t// Set defaults.\n\t$defaults = array(\n\t\t'icon'     => '',\n\t\t'title'    => '',\n\t\t'desc'     => '',\n\t\t'fallback' => false,\n\t);\n\n\t// Parse args.\n\t$args = wp_parse_args( $args, $defaults );\n\n\t// Set aria hidden.\n\t$aria_hidden = ' aria-hidden=\"true\"';\n\n\t// Set ARIA.\n\t$aria_labelledby = '';\n\n\t/*\n\t * Twenty Seventeen doesn't use the SVG title or description attributes; non-decorative icons are described with .screen-reader-text.\n\t *\n\t * However, child themes can use the title and description to add information to non-decorative SVG icons to improve accessibility.\n\t *\n\t * Example 1 with title: <?php echo twentyseventeen_get_svg( array( 'icon' => 'arrow-right', 'title' => __( 'This is the title', 'textdomain' ) ) ); ?>\n\t *\n\t * Example 2 with title and description: <?php echo twentyseventeen_get_svg( array( 'icon' => 'arrow-right', 'title' => __( 'This is the title', 'textdomain' ), 'desc' => __( 'This is the description', 'textdomain' ) ) ); ?>\n\t *\n\t * See https://www.paciellogroup.com/blog/2013/12/using-aria-enhance-svg-accessibility/.\n\t */\n\tif ( $args['title'] ) {\n\t\t$aria_hidden     = '';\n\t\t$unique_id       = twentyseventeen_unique_id();\n\t\t$aria_labelledby = ' aria-labelledby=\"title-' . $unique_id . '\"';\n\n\t\tif ( $args['desc'] ) {\n\t\t\t$aria_labelledby = ' aria-labelledby=\"title-' . $unique_id . ' desc-' . $unique_id . '\"';\n\t\t}\n\t}\n\n\t// Begin SVG markup.\n\t$svg = '<svg class=\"icon icon-' . esc_attr( $args['icon'] ) . '\"' . $aria_hidden . $aria_labelledby . ' role=\"img\">';\n\n\t// Display the title.\n\tif ( $args['title'] ) {\n\t\t$svg .= '<title id=\"title-' . $unique_id . '\">' . esc_html( $args['title'] ) . '</title>';\n\n\t\t// Display the desc only if the title is already set.\n\t\tif ( $args['desc'] ) {\n\t\t\t$svg .= '<desc id=\"desc-' . $unique_id . '\">' . esc_html( $args['desc'] ) . '</desc>';\n\t\t}\n\t}\n\n\t/*\n\t * Display the icon.\n\t *\n\t * The whitespace around `<use>` is intentional - it is a work around to a keyboard navigation bug in Safari 10.\n\t *\n\t * See https://core.trac.wordpress.org/ticket/38387.\n\t */\n\t$svg .= ' <use href=\"#icon-' . esc_html( $args['icon'] ) . '\" xlink:href=\"#icon-' . esc_html( $args['icon'] ) . '\"></use> ';\n\n\t// Add some markup to use as a fallback for browsers that do not support SVGs.\n\tif ( $args['fallback'] ) {\n\t\t$svg .= '<span class=\"svg-fallback icon-' . esc_attr( $args['icon'] ) . '\"></span>';\n\t}\n\n\t$svg .= '</svg>';\n\n\treturn $svg;\n}\n\n/**\n * Display SVG icons in social links menu.\n *\n * @param string   $item_output The menu item's starting HTML output.\n * @param WP_Post  $item        Menu item data object.\n * @param int      $depth       Depth of the menu. Used for padding.\n * @param stdClass $args        An object of wp_nav_menu() arguments.\n * @return string The menu item output with social icon.\n */\nfunction twentyseventeen_nav_menu_social_icons( $item_output, $item, $depth, $args ) {\n\t// Get supported social icons.\n\t$social_icons = twentyseventeen_social_links_icons();\n\n\t// Change SVG icon inside social links menu if there is supported URL.\n\tif ( 'social' === $args->theme_location ) {\n\t\tforeach ( $social_icons as $attr => $value ) {\n\t\t\tif ( false !== strpos( $item_output, $attr ) ) {\n\t\t\t\t$item_output = str_replace( $args->link_after, '</span>' . twentyseventeen_get_svg( array( 'icon' => esc_attr( $value ) ) ), $item_output );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $item_output;\n}\nadd_filter( 'walker_nav_menu_start_el', 'twentyseventeen_nav_menu_social_icons', 10, 4 );\n\n/**\n * Add dropdown icon if menu item has children.\n *\n * @param string   $title The menu item's title.\n * @param WP_Post  $item  The current menu item.\n * @param stdClass $args  An object of wp_nav_menu() arguments.\n * @param int      $depth Depth of menu item. Used for padding.\n * @return string The menu item's title with dropdown icon.\n */\nfunction twentyseventeen_dropdown_icon_to_menu_link( $title, $item, $args, $depth ) {\n\tif ( 'top' === $args->theme_location ) {\n\t\tforeach ( $item->classes as $value ) {\n\t\t\tif ( 'menu-item-has-children' === $value || 'page_item_has_children' === $value ) {\n\t\t\t\t$title = $title . twentyseventeen_get_svg( array( 'icon' => 'angle-down' ) );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $title;\n}\nadd_filter( 'nav_menu_item_title', 'twentyseventeen_dropdown_icon_to_menu_link', 10, 4 );\n\n/**\n * Returns an array of supported social links (URL and icon name).\n *\n * @return array Array of social links icons.\n */\nfunction twentyseventeen_social_links_icons() {\n\t// Supported social links icons.\n\t$social_links_icons = array(\n\t\t'behance.net'     => 'behance',\n\t\t'codepen.io'      => 'codepen',\n\t\t'deviantart.com'  => 'deviantart',\n\t\t'digg.com'        => 'digg',\n\t\t'docker.com'      => 'dockerhub',\n\t\t'dribbble.com'    => 'dribbble',\n\t\t'dropbox.com'     => 'dropbox',\n\t\t'facebook.com'    => 'facebook',\n\t\t'flickr.com'      => 'flickr',\n\t\t'foursquare.com'  => 'foursquare',\n\t\t'plus.google.com' => 'google-plus',\n\t\t'github.com'      => 'github',\n\t\t'instagram.com'   => 'instagram',\n\t\t'linkedin.com'    => 'linkedin',\n\t\t'mailto:'         => 'envelope-o',\n\t\t'medium.com'      => 'medium',\n\t\t'pinterest.com'   => 'pinterest-p',\n\t\t'pscp.tv'         => 'periscope',\n\t\t'getpocket.com'   => 'get-pocket',\n\t\t'reddit.com'      => 'reddit-alien',\n\t\t'skype.com'       => 'skype',\n\t\t'skype:'          => 'skype',\n\t\t'slideshare.net'  => 'slideshare',\n\t\t'snapchat.com'    => 'snapchat-ghost',\n\t\t'soundcloud.com'  => 'soundcloud',\n\t\t'spotify.com'     => 'spotify',\n\t\t'stumbleupon.com' => 'stumbleupon',\n\t\t't.me'            => 'telegram',\n\t\t'telegram.me'     => 'telegram',\n\t\t'tumblr.com'      => 'tumblr',\n\t\t'twitch.tv'       => 'twitch',\n\t\t'twitter.com'     => 'twitter',\n\t\t'vimeo.com'       => 'vimeo',\n\t\t'vine.co'         => 'vine',\n\t\t'vk.com'          => 'vk',\n\t\t'whatsapp.com'    => 'whatsapp',\n\t\t'wordpress.org'   => 'wordpress',\n\t\t'wordpress.com'   => 'wordpress',\n\t\t'yelp.com'        => 'yelp',\n\t\t'youtube.com'     => 'youtube',\n\t);\n\n\t/**\n\t * Filter Twenty Seventeen social links icons.\n\t *\n\t * @since Twenty Seventeen 1.0\n\t *\n\t * @param array $social_links_icons Array of social links icons.\n\t */\n\treturn apply_filters( 'twentyseventeen_social_links_icons', $social_links_icons );\n}\n", "num_lines": 224}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Additional features to allow styling of the templates\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n */\n\n/**\n * Adds custom classes to the array of body classes.\n *\n * @param array $classes Classes for the body element.\n * @return array\n */\nfunction twentyseventeen_body_classes( $classes ) {\n\t// Add class of group-blog to blogs with more than 1 published author.\n\tif ( is_multi_author() ) {\n\t\t$classes[] = 'group-blog';\n\t}\n\n\t// Add class of hfeed to non-singular pages.\n\tif ( ! is_singular() ) {\n\t\t$classes[] = 'hfeed';\n\t}\n\n\t// Add class if we're viewing the Customizer for easier styling of theme options.\n\tif ( is_customize_preview() ) {\n\t\t$classes[] = 'twentyseventeen-customizer';\n\t}\n\n\t// Add class on front page.\n\tif ( is_front_page() && 'posts' !== get_option( 'show_on_front' ) ) {\n\t\t$classes[] = 'twentyseventeen-front-page';\n\t}\n\n\t// Add a class if there is a custom header.\n\tif ( has_header_image() ) {\n\t\t$classes[] = 'has-header-image';\n\t}\n\n\t// Add class if sidebar is used.\n\tif ( is_active_sidebar( 'sidebar-1' ) && ! is_page() ) {\n\t\t$classes[] = 'has-sidebar';\n\t}\n\n\t// Add class for one or two column page layouts.\n\tif ( is_page() || is_archive() ) {\n\t\tif ( 'one-column' === get_theme_mod( 'page_layout' ) ) {\n\t\t\t$classes[] = 'page-one-column';\n\t\t} else {\n\t\t\t$classes[] = 'page-two-column';\n\t\t}\n\t}\n\n\t// Add class if the site title and tagline is hidden.\n\tif ( 'blank' === get_header_textcolor() ) {\n\t\t$classes[] = 'title-tagline-hidden';\n\t}\n\n\t// Get the colorscheme or the default if there isn't one.\n\t$colors    = twentyseventeen_sanitize_colorscheme( get_theme_mod( 'colorscheme', 'light' ) );\n\t$classes[] = 'colors-' . $colors;\n\n\treturn $classes;\n}\nadd_filter( 'body_class', 'twentyseventeen_body_classes' );\n\n/**\n * Count our number of active panels.\n *\n * Primarily used to see if we have any panels active, duh.\n */\nfunction twentyseventeen_panel_count() {\n\n\t$panel_count = 0;\n\n\t/**\n\t * Filter number of front page sections in Twenty Seventeen.\n\t *\n\t * @since Twenty Seventeen 1.0\n\t *\n\t * @param int $num_sections Number of front page sections.\n\t */\n\t$num_sections = apply_filters( 'twentyseventeen_front_page_sections', 4 );\n\n\t// Create a setting and control for each of the sections available in the theme.\n\tfor ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) {\n\t\tif ( get_theme_mod( 'panel_' . $i ) ) {\n\t\t\t$panel_count++;\n\t\t}\n\t}\n\n\treturn $panel_count;\n}\n\n/**\n * Checks to see if we're on the front page or not.\n */\nfunction twentyseventeen_is_frontpage() {\n\treturn ( is_front_page() && ! is_home() );\n}\n", "num_lines": 103}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Custom template tags for this theme\n *\n * Eventually, some of the functionality here could be replaced by core features.\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n */\n\nif ( ! function_exists( 'twentyseventeen_posted_on' ) ) :\n\t/**\n\t * Prints HTML with meta information for the current post-date/time and author.\n\t */\n\tfunction twentyseventeen_posted_on() {\n\n\t\t// Get the author name; wrap it in a link.\n\t\t$byline = sprintf(\n\t\t\t/* translators: %s: Post author. */\n\t\t\t__( 'by %s', 'twentyseventeen' ),\n\t\t\t'<span class=\"author vcard\"><a class=\"url fn n\" href=\"' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '\">' . get_the_author() . '</a></span>'\n\t\t);\n\n\t\t// Finally, let's write all of this to the page.\n\t\techo '<span class=\"posted-on\">' . twentyseventeen_time_link() . '</span><span class=\"byline\"> ' . $byline . '</span>';\n\t}\nendif;\n\n\nif ( ! function_exists( 'twentyseventeen_time_link' ) ) :\n\t/**\n\t * Gets a nicely formatted string for the published date.\n\t */\n\tfunction twentyseventeen_time_link() {\n\t\t$time_string = '<time class=\"entry-date published updated\" datetime=\"%1$s\">%2$s</time>';\n\t\tif ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {\n\t\t\t$time_string = '<time class=\"entry-date published\" datetime=\"%1$s\">%2$s</time><time class=\"updated\" datetime=\"%3$s\">%4$s</time>';\n\t\t}\n\n\t\t$time_string = sprintf(\n\t\t\t$time_string,\n\t\t\tget_the_date( DATE_W3C ),\n\t\t\tget_the_date(),\n\t\t\tget_the_modified_date( DATE_W3C ),\n\t\t\tget_the_modified_date()\n\t\t);\n\n\t\t// Wrap the time string in a link, and preface it with 'Posted on'.\n\t\treturn sprintf(\n\t\t\t/* translators: %s: Post date. */\n\t\t\t__( '<span class=\"screen-reader-text\">Posted on</span> %s', 'twentyseventeen' ),\n\t\t\t'<a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">' . $time_string . '</a>'\n\t\t);\n\t}\nendif;\n\n\nif ( ! function_exists( 'twentyseventeen_entry_footer' ) ) :\n\t/**\n\t * Prints HTML with meta information for the categories, tags and comments.\n\t */\n\tfunction twentyseventeen_entry_footer() {\n\n\t\t/* translators: Used between list items, there is a space after the comma. */\n\t\t$separate_meta = __( ', ', 'twentyseventeen' );\n\n\t\t// Get Categories for posts.\n\t\t$categories_list = get_the_category_list( $separate_meta );\n\n\t\t// Get Tags for posts.\n\t\t$tags_list = get_the_tag_list( '', $separate_meta );\n\n\t\t// We don't want to output .entry-footer if it will be empty, so make sure its not.\n\t\tif ( ( ( twentyseventeen_categorized_blog() && $categories_list ) || $tags_list ) || get_edit_post_link() ) {\n\n\t\t\techo '<footer class=\"entry-footer\">';\n\n\t\t\tif ( 'post' === get_post_type() ) {\n\t\t\t\tif ( ( $categories_list && twentyseventeen_categorized_blog() ) || $tags_list ) {\n\t\t\t\t\techo '<span class=\"cat-tags-links\">';\n\n\t\t\t\t\t// Make sure there's more than one category before displaying.\n\t\t\t\t\tif ( $categories_list && twentyseventeen_categorized_blog() ) {\n\t\t\t\t\t\techo '<span class=\"cat-links\">' . twentyseventeen_get_svg( array( 'icon' => 'folder-open' ) ) . '<span class=\"screen-reader-text\">' . __( 'Categories', 'twentyseventeen' ) . '</span>' . $categories_list . '</span>';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $tags_list && ! is_wp_error( $tags_list ) ) {\n\t\t\t\t\t\techo '<span class=\"tags-links\">' . twentyseventeen_get_svg( array( 'icon' => 'hashtag' ) ) . '<span class=\"screen-reader-text\">' . __( 'Tags', 'twentyseventeen' ) . '</span>' . $tags_list . '</span>';\n\t\t\t\t\t}\n\n\t\t\t\t\techo '</span>';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttwentyseventeen_edit_link();\n\n\t\t\techo '</footer> <!-- .entry-footer -->';\n\t\t}\n\t}\nendif;\n\n\nif ( ! function_exists( 'twentyseventeen_edit_link' ) ) :\n\t/**\n\t * Returns an accessibility-friendly link to edit a post or page.\n\t *\n\t * This also gives us a little context about what exactly we're editing\n\t * (post or page?) so that users understand a bit more where they are in terms\n\t * of the template hierarchy and their content. Helpful when/if the single-page\n\t * layout with multiple posts/pages shown gets confusing.\n\t */\n\tfunction twentyseventeen_edit_link() {\n\t\tedit_post_link(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t__( 'Edit<span class=\"screen-reader-text\"> \"%s\"</span>', 'twentyseventeen' ),\n\t\t\t\tget_the_title()\n\t\t\t),\n\t\t\t'<span class=\"edit-link\">',\n\t\t\t'</span>'\n\t\t);\n\t}\nendif;\n\n/**\n * Display a front page section.\n *\n * @param WP_Customize_Partial $partial Partial associated with a selective refresh request.\n * @param integer              $id Front page section to display.\n */\nfunction twentyseventeen_front_page_section( $partial = null, $id = 0 ) {\n\tif ( is_a( $partial, 'WP_Customize_Partial' ) ) {\n\t\t// Find out the ID and set it up during a selective refresh.\n\t\tglobal $twentyseventeencounter;\n\n\t\t$id = str_replace( 'panel_', '', $partial->id );\n\n\t\t$twentyseventeencounter = $id;\n\t}\n\n\tglobal $post; // Modify the global post object before setting up post data.\n\tif ( get_theme_mod( 'panel_' . $id ) ) {\n\t\t$post = get_post( get_theme_mod( 'panel_' . $id ) );\n\t\tsetup_postdata( $post );\n\t\tset_query_var( 'panel', $id );\n\n\t\tget_template_part( 'template-parts/page/content', 'front-page-panels' );\n\n\t\twp_reset_postdata();\n\t} elseif ( is_customize_preview() ) {\n\t\t// The output placeholder anchor.\n\t\tprintf(\n\t\t\t'<article class=\"panel-placeholder panel twentyseventeen-panel twentyseventeen-panel%1$s\" id=\"panel%1$s\">' .\n\t\t\t'<span class=\"twentyseventeen-panel-title\">%2$s</span></article>',\n\t\t\t$id,\n\t\t\t/* translators: %s: The section ID. */\n\t\t\tsprintf( __( 'Front Page Section %s Placeholder', 'twentyseventeen' ), $id )\n\t\t);\n\t}\n}\n\n/**\n * Returns true if a blog has more than 1 category.\n *\n * @return bool\n */\nfunction twentyseventeen_categorized_blog() {\n\t$category_count = get_transient( 'twentyseventeen_categories' );\n\n\tif ( false === $category_count ) {\n\t\t// Create an array of all the categories that are attached to posts.\n\t\t$categories = get_categories(\n\t\t\tarray(\n\t\t\t\t'fields'     => 'ids',\n\t\t\t\t'hide_empty' => 1,\n\t\t\t\t// We only need to know if there is more than one category.\n\t\t\t\t'number'     => 2,\n\t\t\t)\n\t\t);\n\n\t\t// Count the number of categories that are attached to the posts.\n\t\t$category_count = count( $categories );\n\n\t\tset_transient( 'twentyseventeen_categories', $category_count );\n\t}\n\n\t// Allow viewing case of 0 or 1 categories in post preview.\n\tif ( is_preview() ) {\n\t\treturn true;\n\t}\n\n\treturn $category_count > 1;\n}\n\n\n/**\n * Flush out the transients used in twentyseventeen_categorized_blog.\n */\nfunction twentyseventeen_category_transient_flusher() {\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\treturn;\n\t}\n\t// Like, beat it. Dig?\n\tdelete_transient( 'twentyseventeen_categories' );\n}\nadd_action( 'edit_category', 'twentyseventeen_category_transient_flusher' );\nadd_action( 'save_post', 'twentyseventeen_category_transient_flusher' );\n\nif ( ! function_exists( 'wp_body_open' ) ) :\n\t/**\n\t * Fire the wp_body_open action.\n\t *\n\t * Added for backward compatibility to support pre-5.2.0 WordPress versions.\n\t *\n\t * @since Twenty Seventeen 2.2\n\t */\n\tfunction wp_body_open() {\n\t\t/**\n\t\t * Triggered after the opening <body> tag.\n\t\t *\n\t\t * @since Twenty Seventeen 2.2\n\t\t */\n\t\tdo_action( 'wp_body_open' );\n\t}\nendif;\n", "num_lines": 227}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays footer widgets if assigned\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\n?>\n\n<?php\nif ( is_active_sidebar( 'sidebar-2' ) ||\n\tis_active_sidebar( 'sidebar-3' ) ) :\n\t?>\n\n\t<aside class=\"widget-area\" role=\"complementary\" aria-label=\"<?php esc_attr_e( 'Footer', 'twentyseventeen' ); ?>\">\n\t\t<?php\n\t\tif ( is_active_sidebar( 'sidebar-2' ) ) {\n\t\t\t?>\n\t\t\t<div class=\"widget-column footer-widget-1\">\n\t\t\t\t<?php dynamic_sidebar( 'sidebar-2' ); ?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t\tif ( is_active_sidebar( 'sidebar-3' ) ) {\n\t\t\t?>\n\t\t\t<div class=\"widget-column footer-widget-2\">\n\t\t\t\t<?php dynamic_sidebar( 'sidebar-3' ); ?>\n\t\t\t</div>\n\t\t<?php } ?>\n\t</aside><!-- .widget-area -->\n\n<?php endif; ?>\n", "num_lines": 36}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays footer site info\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\n?>\n<div class=\"site-info\">\n\t<?php\n\tif ( function_exists( 'the_privacy_policy_link' ) ) {\n\t\tthe_privacy_policy_link( '', '<span role=\"separator\" aria-hidden=\"true\"></span>' );\n\t}\n\t?>\n\t<a href=\"<?php echo esc_url( __( 'https://wordpress.org/', 'twentyseventeen' ) ); ?>\" class=\"imprint\">\n\t\t<?php\n\t\t\t/* translators: %s: WordPress */\n\t\tprintf( __( 'Proudly powered by %s', 'twentyseventeen' ), 'WordPress' );\n\t\t?>\n\t</a>\n</div><!-- .site-info -->\n", "num_lines": 25}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays header media\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\n?>\n<div class=\"custom-header\">\n\n\t\t<div class=\"custom-header-media\">\n\t\t\t<?php the_custom_header_markup(); ?>\n\t\t</div>\n\n\t<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>\n\n</div><!-- .custom-header -->\n", "num_lines": 21}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays header site branding\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\n?>\n<div class=\"site-branding\">\n\t<div class=\"wrap\">\n\n\t\t<?php the_custom_logo(); ?>\n\n\t\t<div class=\"site-branding-text\">\n\t\t\t<?php if ( is_front_page() ) : ?>\n\t\t\t\t<h1 class=\"site-title\"><a href=\"<?php echo esc_url( home_url( '/' ) ); ?>\" rel=\"home\"><?php bloginfo( 'name' ); ?></a></h1>\n\t\t\t<?php else : ?>\n\t\t\t\t<p class=\"site-title\"><a href=\"<?php echo esc_url( home_url( '/' ) ); ?>\" rel=\"home\"><?php bloginfo( 'name' ); ?></a></p>\n\t\t\t<?php endif; ?>\n\n\t\t\t<?php\n\t\t\t$description = get_bloginfo( 'description', 'display' );\n\n\t\t\tif ( $description || is_customize_preview() ) :\n\t\t\t\t?>\n\t\t\t\t<p class=\"site-description\"><?php echo $description; ?></p>\n\t\t\t<?php endif; ?>\n\t\t</div><!-- .site-branding-text -->\n\n\t\t<?php if ( ( twentyseventeen_is_frontpage() || ( is_home() && is_front_page() ) ) && ! has_nav_menu( 'top' ) ) : ?>\n\t\t<a href=\"#content\" class=\"menu-scroll-down\"><?php echo twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ); ?><span class=\"screen-reader-text\"><?php _e( 'Scroll down to content', 'twentyseventeen' ); ?></span></a>\n\t<?php endif; ?>\n\n\t</div><!-- .wrap -->\n</div><!-- .site-branding -->\n", "num_lines": 39}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays top navigation\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.2\n */\n\n?>\n<nav id=\"site-navigation\" class=\"main-navigation\" role=\"navigation\" aria-label=\"<?php esc_attr_e( 'Top Menu', 'twentyseventeen' ); ?>\">\n\t<button class=\"menu-toggle\" aria-controls=\"top-menu\" aria-expanded=\"false\">\n\t\t<?php\n\t\techo twentyseventeen_get_svg( array( 'icon' => 'bars' ) );\n\t\techo twentyseventeen_get_svg( array( 'icon' => 'close' ) );\n\t\t_e( 'Menu', 'twentyseventeen' );\n\t\t?>\n\t</button>\n\n\t<?php\n\twp_nav_menu(\n\t\tarray(\n\t\t\t'theme_location' => 'top',\n\t\t\t'menu_id'        => 'top-menu',\n\t\t)\n\t);\n\t?>\n\n\t<?php if ( ( twentyseventeen_is_frontpage() || ( is_home() && is_front_page() ) ) && has_custom_header() ) : ?>\n\t\t<a href=\"#content\" class=\"menu-scroll-down\"><?php echo twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ); ?><span class=\"screen-reader-text\"><?php _e( 'Scroll down to content', 'twentyseventeen' ); ?></span></a>\n\t<?php endif; ?>\n</nav><!-- #site-navigation -->\n", "num_lines": 34}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template part for displaying pages on front page\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\nglobal $twentyseventeencounter;\n\n?>\n\n<article id=\"panel<?php echo $twentyseventeencounter; ?>\" <?php post_class( 'twentyseventeen-panel ' ); ?> >\n\n\t<?php\n\tif ( has_post_thumbnail() ) :\n\t\t$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' );\n\n\t\t// Calculate aspect ratio: h / w * 100%.\n\t\t$ratio = $thumbnail[2] / $thumbnail[1] * 100;\n\t\t?>\n\n\t\t<div class=\"panel-image\" style=\"background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>);\">\n\t\t\t<div class=\"panel-image-prop\" style=\"padding-top: <?php echo esc_attr( $ratio ); ?>%\"></div>\n\t\t</div><!-- .panel-image -->\n\n\t<?php endif; ?>\n\n\t<div class=\"panel-content\">\n\t\t<div class=\"wrap\">\n\t\t\t<header class=\"entry-header\">\n\t\t\t\t<?php the_title( '<h2 class=\"entry-title\">', '</h2>' ); ?>\n\n\t\t\t\t<?php twentyseventeen_edit_link( get_the_ID() ); ?>\n\n\t\t\t</header><!-- .entry-header -->\n\n\t\t\t<div class=\"entry-content\">\n\t\t\t\t<?php\n\t\t\t\t\tthe_content(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\t\t\t__( 'Continue reading<span class=\"screen-reader-text\"> \"%s\"</span>', 'twentyseventeen' ),\n\t\t\t\t\t\t\tget_the_title()\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t</div><!-- .entry-content -->\n\n\t\t\t<?php\n\t\t\t// Show recent blog posts if is blog posts page (Note that get_option returns a string, so we're casting the result as an int).\n\t\t\tif ( get_the_ID() === (int) get_option( 'page_for_posts' ) ) :\n\t\t\t\t?>\n\n\t\t\t\t<?php\n\t\t\t\t// Show three most recent posts.\n\t\t\t\t$recent_posts = new WP_Query(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'posts_per_page'      => 3,\n\t\t\t\t\t\t'post_status'         => 'publish',\n\t\t\t\t\t\t'ignore_sticky_posts' => true,\n\t\t\t\t\t\t'no_found_rows'       => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t?>\n\n\t\t\t\t<?php if ( $recent_posts->have_posts() ) : ?>\n\n\t\t\t\t\t<div class=\"recent-posts\">\n\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\twhile ( $recent_posts->have_posts() ) :\n\t\t\t\t\t\t\t$recent_posts->the_post();\n\t\t\t\t\t\t\tget_template_part( 'template-parts/post/content', 'excerpt' );\n\t\t\t\t\t\tendwhile;\n\t\t\t\t\t\twp_reset_postdata();\n\t\t\t\t\t\t?>\n\t\t\t\t\t</div><!-- .recent-posts -->\n\t\t\t\t<?php endif; ?>\n\t\t\t<?php endif; ?>\n\n\t\t</div><!-- .wrap -->\n\t</div><!-- .panel-content -->\n\n</article><!-- #post-<?php the_ID(); ?> -->\n", "num_lines": 88}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays content for front page\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\n?>\n<article id=\"post-<?php the_ID(); ?>\" <?php post_class( 'twentyseventeen-panel ' ); ?> >\n\n\t<?php\n\tif ( has_post_thumbnail() ) :\n\t\t$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' );\n\n\t\t// Calculate aspect ratio: h / w * 100%.\n\t\t$ratio = $thumbnail[2] / $thumbnail[1] * 100;\n\t\t?>\n\n\t\t<div class=\"panel-image\" style=\"background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>);\">\n\t\t\t<div class=\"panel-image-prop\" style=\"padding-top: <?php echo esc_attr( $ratio ); ?>%\"></div>\n\t\t</div><!-- .panel-image -->\n\n\t<?php endif; ?>\n\n\t<div class=\"panel-content\">\n\t\t<div class=\"wrap\">\n\t\t\t<header class=\"entry-header\">\n\t\t\t\t<?php the_title( '<h2 class=\"entry-title\">', '</h2>' ); ?>\n\n\t\t\t\t<?php twentyseventeen_edit_link( get_the_ID() ); ?>\n\n\t\t\t</header><!-- .entry-header -->\n\n\t\t\t<div class=\"entry-content\">\n\t\t\t\t<?php\n\t\t\t\t\tthe_content(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\t\t\t__( 'Continue reading<span class=\"screen-reader-text\"> \"%s\"</span>', 'twentyseventeen' ),\n\t\t\t\t\t\t\tget_the_title()\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\twp_link_pages(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'before' => '<div class=\"page-links\">' . __( 'Pages:', 'twentyseventeen' ),\n\t\t\t\t\t\t\t'after'  => '</div>',\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t</div><!-- .entry-content -->\n\n\t\t</div><!-- .wrap -->\n\t</div><!-- .panel-content -->\n\n</article><!-- #post-<?php the_ID(); ?> -->\n", "num_lines": 59}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template part for displaying page content in page.php\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\n?>\n\n<article id=\"post-<?php the_ID(); ?>\" <?php post_class(); ?>>\n\t<header class=\"entry-header\">\n\t\t<?php the_title( '<h1 class=\"entry-title\">', '</h1>' ); ?>\n\t\t<?php twentyseventeen_edit_link( get_the_ID() ); ?>\n\t</header><!-- .entry-header -->\n\t<div class=\"entry-content\">\n\t\t<?php\n\t\t\tthe_content();\n\n\t\t\twp_link_pages(\n\t\t\t\tarray(\n\t\t\t\t\t'before' => '<div class=\"page-links\">' . __( 'Pages:', 'twentyseventeen' ),\n\t\t\t\t\t'after'  => '</div>',\n\t\t\t\t)\n\t\t\t);\n\t\t\t?>\n\t</div><!-- .entry-content -->\n</article><!-- #post-<?php the_ID(); ?> -->\n", "num_lines": 33}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template part for displaying audio posts\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.2\n */\n\n?>\n\n<article id=\"post-<?php the_ID(); ?>\" <?php post_class(); ?>>\n\t<?php\n\tif ( is_sticky() && is_home() ) {\n\t\techo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );\n\t}\n\t?>\n\t<header class=\"entry-header\">\n\t\t<?php\n\t\tif ( 'post' === get_post_type() ) {\n\t\t\techo '<div class=\"entry-meta\">';\n\t\t\tif ( is_single() ) {\n\t\t\t\ttwentyseventeen_posted_on();\n\t\t\t} else {\n\t\t\t\techo twentyseventeen_time_link();\n\t\t\t\ttwentyseventeen_edit_link();\n\t\t\t};\n\t\t\t\techo '</div><!-- .entry-meta -->';\n\t\t};\n\n\t\tif ( is_single() ) {\n\t\t\tthe_title( '<h1 class=\"entry-title\">', '</h1>' );\n\t\t} elseif ( is_front_page() && is_home() ) {\n\t\t\tthe_title( '<h3 class=\"entry-title\"><a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">', '</a></h3>' );\n\t\t} else {\n\t\t\tthe_title( '<h2 class=\"entry-title\"><a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">', '</a></h2>' );\n\t\t}\n\t\t?>\n\t</header><!-- .entry-header -->\n\n\t<?php\n\t\t$content = apply_filters( 'the_content', get_the_content() );\n\t\t$audio   = false;\n\n\t\t// Only get audio from the content if a playlist isn't present.\n\tif ( false === strpos( $content, 'wp-playlist-script' ) ) {\n\t\t$audio = get_media_embedded_in_content( $content, array( 'audio' ) );\n\t}\n\n\t?>\n\n\t<?php if ( '' !== get_the_post_thumbnail() && ! is_single() ) : ?>\n\t\t<div class=\"post-thumbnail\">\n\t\t\t<a href=\"<?php the_permalink(); ?>\">\n\t\t\t\t<?php the_post_thumbnail( 'twentyseventeen-featured-image' ); ?>\n\t\t\t</a>\n\t\t</div><!-- .post-thumbnail -->\n\t<?php endif; ?>\n\n\t<div class=\"entry-content\">\n\n\t\t<?php\n\t\tif ( ! is_single() ) {\n\n\t\t\t// If not a single post, highlight the audio file.\n\t\t\tif ( ! empty( $audio ) ) {\n\t\t\t\tforeach ( $audio as $audio_html ) {\n\t\t\t\t\techo '<div class=\"entry-audio\">';\n\t\t\t\t\t\techo $audio_html;\n\t\t\t\t\techo '</div><!-- .entry-audio -->';\n\t\t\t\t}\n\t\t\t};\n\n\t\t};\n\n\t\tif ( is_single() || empty( $audio ) ) {\n\n\t\t\tthe_content(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\t__( 'Continue reading<span class=\"screen-reader-text\"> \"%s\"</span>', 'twentyseventeen' ),\n\t\t\t\t\tget_the_title()\n\t\t\t\t)\n\t\t\t);\n\n\t\t\twp_link_pages(\n\t\t\t\tarray(\n\t\t\t\t\t'before'      => '<div class=\"page-links\">' . __( 'Pages:', 'twentyseventeen' ),\n\t\t\t\t\t'after'       => '</div>',\n\t\t\t\t\t'link_before' => '<span class=\"page-number\">',\n\t\t\t\t\t'link_after'  => '</span>',\n\t\t\t\t)\n\t\t\t);\n\n\t\t};\n\t\t?>\n\n\t</div><!-- .entry-content -->\n\n\t<?php\n\tif ( is_single() ) {\n\t\ttwentyseventeen_entry_footer();\n\t}\n\t?>\n\n</article><!-- #post-<?php the_ID(); ?> -->\n", "num_lines": 110}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template part for displaying posts with excerpts\n *\n * Used in Search Results and for Recent Posts in Front Page panels.\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.2\n */\n\n?>\n\n<article id=\"post-<?php the_ID(); ?>\" <?php post_class(); ?>>\n\n\t<header class=\"entry-header\">\n\t\t<?php if ( 'post' === get_post_type() ) : ?>\n\t\t\t<div class=\"entry-meta\">\n\t\t\t\t<?php\n\t\t\t\techo twentyseventeen_time_link();\n\t\t\t\ttwentyseventeen_edit_link();\n\t\t\t\t?>\n\t\t\t</div><!-- .entry-meta -->\n\t\t<?php elseif ( 'page' === get_post_type() && get_edit_post_link() ) : ?>\n\t\t\t<div class=\"entry-meta\">\n\t\t\t\t<?php twentyseventeen_edit_link(); ?>\n\t\t\t</div><!-- .entry-meta -->\n\t\t<?php endif; ?>\n\n\t\t<?php\n\t\tif ( is_front_page() && ! is_home() ) {\n\n\t\t\t// The excerpt is being displayed within a front page section, so it's a lower hierarchy than h2.\n\t\t\tthe_title( sprintf( '<h3 class=\"entry-title\"><a href=\"%s\" rel=\"bookmark\">', esc_url( get_permalink() ) ), '</a></h3>' );\n\t\t} else {\n\t\t\tthe_title( sprintf( '<h2 class=\"entry-title\"><a href=\"%s\" rel=\"bookmark\">', esc_url( get_permalink() ) ), '</a></h2>' );\n\t\t}\n\t\t?>\n\t</header><!-- .entry-header -->\n\n\t<div class=\"entry-summary\">\n\t\t<?php the_excerpt(); ?>\n\t</div><!-- .entry-summary -->\n\n</article><!-- #post-<?php the_ID(); ?> -->\n", "num_lines": 49}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template part for displaying gallery posts\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.2\n */\n\n?>\n\n<article id=\"post-<?php the_ID(); ?>\" <?php post_class(); ?>>\n\t<?php\n\tif ( is_sticky() && is_home() ) {\n\t\techo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );\n\t}\n\t?>\n\t<header class=\"entry-header\">\n\t\t<?php\n\t\tif ( 'post' === get_post_type() ) {\n\t\t\techo '<div class=\"entry-meta\">';\n\t\t\tif ( is_single() ) {\n\t\t\t\ttwentyseventeen_posted_on();\n\t\t\t} else {\n\t\t\t\techo twentyseventeen_time_link();\n\t\t\t\ttwentyseventeen_edit_link();\n\t\t\t};\n\t\t\techo '</div><!-- .entry-meta -->';\n\t\t};\n\n\t\tif ( is_single() ) {\n\t\t\tthe_title( '<h1 class=\"entry-title\">', '</h1>' );\n\t\t} elseif ( is_front_page() && is_home() ) {\n\t\t\tthe_title( '<h3 class=\"entry-title\"><a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">', '</a></h3>' );\n\t\t} else {\n\t\t\tthe_title( '<h2 class=\"entry-title\"><a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">', '</a></h2>' );\n\t\t}\n\t\t?>\n\t</header><!-- .entry-header -->\n\n\t<?php if ( '' !== get_the_post_thumbnail() && ! is_single() && ! get_post_gallery() ) : ?>\n\t\t<div class=\"post-thumbnail\">\n\t\t\t<a href=\"<?php the_permalink(); ?>\">\n\t\t\t\t<?php the_post_thumbnail( 'twentyseventeen-featured-image' ); ?>\n\t\t\t</a>\n\t\t</div><!-- .post-thumbnail -->\n\t<?php endif; ?>\n\n\t<div class=\"entry-content\">\n\n\t\t<?php\n\t\tif ( ! is_single() ) {\n\n\t\t\t// If not a single post, highlight the gallery.\n\t\t\tif ( get_post_gallery() ) {\n\t\t\t\techo '<div class=\"entry-gallery\">';\n\t\t\t\t\techo get_post_gallery();\n\t\t\t\techo '</div>';\n\t\t\t};\n\n\t\t};\n\n\t\tif ( is_single() || ! get_post_gallery() ) {\n\n\t\t\tthe_content(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\t__( 'Continue reading<span class=\"screen-reader-text\"> \"%s\"</span>', 'twentyseventeen' ),\n\t\t\t\t\tget_the_title()\n\t\t\t\t)\n\t\t\t);\n\n\t\t\twp_link_pages(\n\t\t\t\tarray(\n\t\t\t\t\t'before'      => '<div class=\"page-links\">' . __( 'Pages:', 'twentyseventeen' ),\n\t\t\t\t\t'after'       => '</div>',\n\t\t\t\t\t'link_before' => '<span class=\"page-number\">',\n\t\t\t\t\t'link_after'  => '</span>',\n\t\t\t\t)\n\t\t\t);\n\n\t\t};\n\t\t?>\n\n\t</div><!-- .entry-content -->\n\n\t<?php\n\tif ( is_single() ) {\n\t\ttwentyseventeen_entry_footer();\n\t}\n\t?>\n\n</article><!-- #post-<?php the_ID(); ?> -->\n", "num_lines": 97}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template part for displaying image posts\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.2\n */\n\n?>\n\n<article id=\"post-<?php the_ID(); ?>\" <?php post_class(); ?>>\n\t<?php\n\tif ( is_sticky() && is_home() ) {\n\t\techo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );\n\t}\n\t?>\n\t<header class=\"entry-header\">\n\t\t<?php\n\t\tif ( 'post' === get_post_type() ) {\n\t\t\techo '<div class=\"entry-meta\">';\n\t\t\tif ( is_single() ) {\n\t\t\t\ttwentyseventeen_posted_on();\n\t\t\t} else {\n\t\t\t\techo twentyseventeen_time_link();\n\t\t\t\ttwentyseventeen_edit_link();\n\t\t\t};\n\t\t\t\techo '</div><!-- .entry-meta -->';\n\t\t};\n\n\t\tif ( is_single() ) {\n\t\t\tthe_title( '<h1 class=\"entry-title\">', '</h1>' );\n\t\t} elseif ( is_front_page() && is_home() ) {\n\t\t\tthe_title( '<h3 class=\"entry-title\"><a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">', '</a></h3>' );\n\t\t} else {\n\t\t\tthe_title( '<h2 class=\"entry-title\"><a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">', '</a></h2>' );\n\t\t}\n\t\t?>\n\t</header><!-- .entry-header -->\n\n\t<?php if ( '' !== get_the_post_thumbnail() && ! is_single() ) : ?>\n\t\t<div class=\"post-thumbnail\">\n\t\t\t<a href=\"<?php the_permalink(); ?>\">\n\t\t\t\t<?php the_post_thumbnail( 'twentyseventeen-featured-image' ); ?>\n\t\t\t</a>\n\t\t</div><!-- .post-thumbnail -->\n\t<?php endif; ?>\n\n\t<div class=\"entry-content\">\n\n\t\t<?php\n\t\tif ( is_single() || '' === get_the_post_thumbnail() ) {\n\n\t\t\t// Only show content if is a single post, or if there's no featured image.\n\t\t\tthe_content(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\t__( 'Continue reading<span class=\"screen-reader-text\"> \"%s\"</span>', 'twentyseventeen' ),\n\t\t\t\t\tget_the_title()\n\t\t\t\t)\n\t\t\t);\n\n\t\t\twp_link_pages(\n\t\t\t\tarray(\n\t\t\t\t\t'before'      => '<div class=\"page-links\">' . __( 'Pages:', 'twentyseventeen' ),\n\t\t\t\t\t'after'       => '</div>',\n\t\t\t\t\t'link_before' => '<span class=\"page-number\">',\n\t\t\t\t\t'link_after'  => '</span>',\n\t\t\t\t)\n\t\t\t);\n\n\t\t};\n\t\t?>\n\n\t</div><!-- .entry-content -->\n\n\t<?php\n\tif ( is_single() ) {\n\t\ttwentyseventeen_entry_footer();\n\t}\n\t?>\n\n</article><!-- #post-<?php the_ID(); ?> -->\n", "num_lines": 87}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template part for displaying a message that posts cannot be found\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.0\n */\n\n?>\n\n<section class=\"no-results not-found\">\n\t<header class=\"page-header\">\n\t\t<h1 class=\"page-title\"><?php _e( 'Nothing Found', 'twentyseventeen' ); ?></h1>\n\t</header>\n\t<div class=\"page-content\">\n\t\t<?php\n\t\tif ( is_home() && current_user_can( 'publish_posts' ) ) :\n\t\t\t?>\n\n\t\t\t<p>\n\t\t\t<?php\n\t\t\t/* translators: %s: Post editor URL. */\n\t\t\tprintf( __( 'Ready to publish your first post? <a href=\"%s\">Get started here</a>.', 'twentyseventeen' ), esc_url( admin_url( 'post-new.php' ) ) );\n\t\t\t?>\n\t\t\t</p>\n\n\t\t<?php else : ?>\n\n\t\t\t<p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentyseventeen' ); ?></p>\n\t\t\t<?php\n\t\t\t\tget_search_form();\n\n\t\tendif;\n\t\t?>\n\t</div><!-- .page-content -->\n</section><!-- .no-results -->\n", "num_lines": 41}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template part for displaying video posts\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.2\n */\n\n?>\n\n<article id=\"post-<?php the_ID(); ?>\" <?php post_class(); ?>>\n\t<?php\n\tif ( is_sticky() && is_home() ) {\n\t\techo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );\n\t}\n\t?>\n\t<header class=\"entry-header\">\n\t\t<?php\n\t\tif ( 'post' === get_post_type() ) {\n\t\t\techo '<div class=\"entry-meta\">';\n\t\t\tif ( is_single() ) {\n\t\t\t\ttwentyseventeen_posted_on();\n\t\t\t} else {\n\t\t\t\techo twentyseventeen_time_link();\n\t\t\t\ttwentyseventeen_edit_link();\n\t\t\t}\n\t\t\t\techo '</div><!-- .entry-meta -->';\n\t\t};\n\n\t\tif ( is_single() ) {\n\t\t\tthe_title( '<h1 class=\"entry-title\">', '</h1>' );\n\t\t} elseif ( is_front_page() && is_home() ) {\n\t\t\tthe_title( '<h3 class=\"entry-title\"><a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">', '</a></h3>' );\n\t\t} else {\n\t\t\tthe_title( '<h2 class=\"entry-title\"><a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">', '</a></h2>' );\n\t\t}\n\t\t?>\n\t</header><!-- .entry-header -->\n\n\t<?php\n\t\t$content = apply_filters( 'the_content', get_the_content() );\n\t\t$video   = false;\n\n\t\t// Only get video from the content if a playlist isn't present.\n\tif ( false === strpos( $content, 'wp-playlist-script' ) ) {\n\t\t$video = get_media_embedded_in_content( $content, array( 'video', 'object', 'embed', 'iframe' ) );\n\t}\n\t?>\n\n\t<?php if ( '' !== get_the_post_thumbnail() && ! is_single() && empty( $video ) ) : ?>\n\t\t<div class=\"post-thumbnail\">\n\t\t\t<a href=\"<?php the_permalink(); ?>\">\n\t\t\t\t<?php the_post_thumbnail( 'twentyseventeen-featured-image' ); ?>\n\t\t\t</a>\n\t\t</div><!-- .post-thumbnail -->\n\t<?php endif; ?>\n\n\t<div class=\"entry-content\">\n\n\t\t<?php\n\t\tif ( ! is_single() ) {\n\n\t\t\t// If not a single post, highlight the video file.\n\t\t\tif ( ! empty( $video ) ) {\n\t\t\t\tforeach ( $video as $video_html ) {\n\t\t\t\t\techo '<div class=\"entry-video\">';\n\t\t\t\t\t\techo $video_html;\n\t\t\t\t\techo '</div>';\n\t\t\t\t}\n\t\t\t};\n\n\t\t};\n\n\t\tif ( is_single() || empty( $video ) ) {\n\n\t\t\tthe_content(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\t__( 'Continue reading<span class=\"screen-reader-text\"> \"%s\"</span>', 'twentyseventeen' ),\n\t\t\t\t\tget_the_title()\n\t\t\t\t)\n\t\t\t);\n\n\t\t\twp_link_pages(\n\t\t\t\tarray(\n\t\t\t\t\t'before'      => '<div class=\"page-links\">' . __( 'Pages:', 'twentyseventeen' ),\n\t\t\t\t\t'after'       => '</div>',\n\t\t\t\t\t'link_before' => '<span class=\"page-number\">',\n\t\t\t\t\t'link_after'  => '</span>',\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\t?>\n\n\t</div><!-- .entry-content -->\n\n\t<?php\n\tif ( is_single() ) {\n\t\ttwentyseventeen_entry_footer();\n\t}\n\t?>\n\n</article><!-- #post-<?php the_ID(); ?> -->\n", "num_lines": 108}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template part for displaying posts\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Seventeen\n * @since Twenty Seventeen 1.0\n * @version 1.2\n */\n\n?>\n\n<article id=\"post-<?php the_ID(); ?>\" <?php post_class(); ?>>\n\t<?php\n\tif ( is_sticky() && is_home() ) :\n\t\techo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );\n\tendif;\n\t?>\n\t<header class=\"entry-header\">\n\t\t<?php\n\t\tif ( 'post' === get_post_type() ) {\n\t\t\techo '<div class=\"entry-meta\">';\n\t\t\tif ( is_single() ) {\n\t\t\t\ttwentyseventeen_posted_on();\n\t\t\t} else {\n\t\t\t\techo twentyseventeen_time_link();\n\t\t\t\ttwentyseventeen_edit_link();\n\t\t\t};\n\t\t\techo '</div><!-- .entry-meta -->';\n\t\t};\n\n\t\tif ( is_single() ) {\n\t\t\tthe_title( '<h1 class=\"entry-title\">', '</h1>' );\n\t\t} elseif ( is_front_page() && is_home() ) {\n\t\t\tthe_title( '<h3 class=\"entry-title\"><a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">', '</a></h3>' );\n\t\t} else {\n\t\t\tthe_title( '<h2 class=\"entry-title\"><a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">', '</a></h2>' );\n\t\t}\n\t\t?>\n\t</header><!-- .entry-header -->\n\n\t<?php if ( '' !== get_the_post_thumbnail() && ! is_single() ) : ?>\n\t\t<div class=\"post-thumbnail\">\n\t\t\t<a href=\"<?php the_permalink(); ?>\">\n\t\t\t\t<?php the_post_thumbnail( 'twentyseventeen-featured-image' ); ?>\n\t\t\t</a>\n\t\t</div><!-- .post-thumbnail -->\n\t<?php endif; ?>\n\n\t<div class=\"entry-content\">\n\t\t<?php\n\t\tthe_content(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t__( 'Continue reading<span class=\"screen-reader-text\"> \"%s\"</span>', 'twentyseventeen' ),\n\t\t\t\tget_the_title()\n\t\t\t)\n\t\t);\n\n\t\twp_link_pages(\n\t\t\tarray(\n\t\t\t\t'before'      => '<div class=\"page-links\">' . __( 'Pages:', 'twentyseventeen' ),\n\t\t\t\t'after'       => '</div>',\n\t\t\t\t'link_before' => '<span class=\"page-number\">',\n\t\t\t\t'link_after'  => '</span>',\n\t\t\t)\n\t\t);\n\t\t?>\n\t</div><!-- .entry-content -->\n\n\t<?php\n\tif ( is_single() ) {\n\t\ttwentyseventeen_entry_footer();\n\t}\n\t?>\n\n</article><!-- #post-<?php the_ID(); ?> -->\n", "num_lines": 80}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying the 404 template in the Twenty Twenty theme.\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\nget_header();\n?>\n\n<main id=\"site-content\" role=\"main\">\n\n\t<div class=\"section-inner thin error404-content\">\n\n\t\t<h1 class=\"entry-title\"><?php _e( 'Page Not Found', 'twentytwenty' ); ?></h1>\n\n\t\t<div class=\"intro-text\"><p><?php _e( 'The page you were looking for could not be found. It might have been removed, renamed, or did not exist in the first place.', 'twentytwenty' ); ?></p></div>\n\n\t\t<?php\n\t\tget_search_form(\n\t\t\tarray(\n\t\t\t\t'label' => __( '404 not found', 'twentytwenty' ),\n\t\t\t)\n\t\t);\n\t\t?>\n\n\t</div><!-- .section-inner -->\n\n</main><!-- #site-content -->\n\n<?php get_template_part( 'template-parts/footer-menus-widgets' ); ?>\n\n<?php\nget_footer();\n", "num_lines": 37}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template file for displaying the comments and comment form for the\n * Twenty Twenty theme.\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\n/*\n * If the current post is protected by a password and\n * the visitor has not yet entered the password we will\n * return early without loading the comments.\n*/\nif ( post_password_required() ) {\n\treturn;\n}\n\nif ( $comments ) {\n\t?>\n\n\t<div class=\"comments\" id=\"comments\">\n\n\t\t<?php\n\t\t$comments_number = absint( get_comments_number() );\n\t\t?>\n\n\t\t<div class=\"comments-header section-inner small max-percentage\">\n\n\t\t\t<h2 class=\"comment-reply-title\">\n\t\t\t<?php\n\t\t\tif ( ! have_comments() ) {\n\t\t\t\t_e( 'Leave a comment', 'twentytwenty' );\n\t\t\t} elseif ( 1 === $comments_number ) {\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\tprintf( _x( 'One reply on &ldquo;%s&rdquo;', 'comments title', 'twentytwenty' ), get_the_title() );\n\t\t\t} else {\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: 1: Number of comments, 2: Post title. */\n\t\t\t\t\t_nx(\n\t\t\t\t\t\t'%1$s reply on &ldquo;%2$s&rdquo;',\n\t\t\t\t\t\t'%1$s replies on &ldquo;%2$s&rdquo;',\n\t\t\t\t\t\t$comments_number,\n\t\t\t\t\t\t'comments title',\n\t\t\t\t\t\t'twentytwenty'\n\t\t\t\t\t),\n\t\t\t\t\tnumber_format_i18n( $comments_number ),\n\t\t\t\t\tget_the_title()\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t?>\n\t\t\t</h2><!-- .comments-title -->\n\n\t\t</div><!-- .comments-header -->\n\n\t\t<div class=\"comments-inner section-inner thin max-percentage\">\n\n\t\t\t<?php\n\t\t\twp_list_comments(\n\t\t\t\tarray(\n\t\t\t\t\t'walker'      => new TwentyTwenty_Walker_Comment(),\n\t\t\t\t\t'avatar_size' => 120,\n\t\t\t\t\t'style'       => 'div',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$comment_pagination = paginate_comments_links(\n\t\t\t\tarray(\n\t\t\t\t\t'echo'      => false,\n\t\t\t\t\t'end_size'  => 0,\n\t\t\t\t\t'mid_size'  => 0,\n\t\t\t\t\t'next_text' => __( 'Newer Comments', 'twentytwenty' ) . ' <span aria-hidden=\"true\">&rarr;</span>',\n\t\t\t\t\t'prev_text' => '<span aria-hidden=\"true\">&larr;</span> ' . __( 'Older Comments', 'twentytwenty' ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( $comment_pagination ) {\n\t\t\t\t$pagination_classes = '';\n\n\t\t\t\t// If we're only showing the \"Next\" link, add a class indicating so.\n\t\t\t\tif ( false === strpos( $comment_pagination, 'prev page-numbers' ) ) {\n\t\t\t\t\t$pagination_classes = ' only-next';\n\t\t\t\t}\n\t\t\t\t?>\n\n\t\t\t\t<nav class=\"comments-pagination pagination<?php echo $pagination_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>\" aria-label=\"<?php esc_attr_e( 'Comments', 'twentytwenty' ); ?>\">\n\t\t\t\t\t<?php echo wp_kses_post( $comment_pagination ); ?>\n\t\t\t\t</nav>\n\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\n\t\t</div><!-- .comments-inner -->\n\n\t</div><!-- comments -->\n\n\t<?php\n}\n\nif ( comments_open() || pings_open() ) {\n\n\tif ( $comments ) {\n\t\techo '<hr class=\"styled-separator is-style-wide\" aria-hidden=\"true\" />';\n\t}\n\n\tcomment_form(\n\t\tarray(\n\t\t\t'class_form'         => 'section-inner thin max-percentage',\n\t\t\t'title_reply_before' => '<h2 id=\"reply-title\" class=\"comment-reply-title\">',\n\t\t\t'title_reply_after'  => '</h2>',\n\t\t)\n\t);\n\n} elseif ( is_single() ) {\n\n\tif ( $comments ) {\n\t\techo '<hr class=\"styled-separator is-style-wide\" aria-hidden=\"true\" />';\n\t}\n\n\t?>\n\n\t<div class=\"comment-respond\" id=\"respond\">\n\n\t\t<p class=\"comments-closed\"><?php _e( 'Comments are closed.', 'twentytwenty' ); ?></p>\n\n\t</div><!-- #respond -->\n\n\t<?php\n}\n", "num_lines": 133}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying the footer\n *\n * Contains the opening of the #site-footer div and all content after.\n *\n * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\n?>\n\t\t\t<footer id=\"site-footer\" role=\"contentinfo\" class=\"header-footer-group\">\n\n\t\t\t\t<div class=\"section-inner\">\n\n\t\t\t\t\t<div class=\"footer-credits\">\n\n\t\t\t\t\t\t<p class=\"footer-copyright\">&copy;\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo date_i18n(\n\t\t\t\t\t\t\t\t/* translators: Copyright date format, see https://www.php.net/date */\n\t\t\t\t\t\t\t\t_x( 'Y', 'copyright date format', 'twentytwenty' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<a href=\"<?php echo esc_url( home_url( '/' ) ); ?>\"><?php bloginfo( 'name' ); ?></a>\n\t\t\t\t\t\t</p><!-- .footer-copyright -->\n\n\t\t\t\t\t\t<p class=\"powered-by-wordpress\">\n\t\t\t\t\t\t\t<a href=\"<?php echo esc_url( __( 'https://wordpress.org/', 'twentytwenty' ) ); ?>\">\n\t\t\t\t\t\t\t\t<?php _e( 'Powered by WordPress', 'twentytwenty' ); ?>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</p><!-- .powered-by-wordpress -->\n\n\t\t\t\t\t</div><!-- .footer-credits -->\n\n\t\t\t\t\t<a class=\"to-the-top\" href=\"#site-header\">\n\t\t\t\t\t\t<span class=\"to-the-top-long\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/* translators: %s: HTML character for up arrow. */\n\t\t\t\t\t\t\tprintf( __( 'To the top %s', 'twentytwenty' ), '<span class=\"arrow\" aria-hidden=\"true\">&uarr;</span>' );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</span><!-- .to-the-top-long -->\n\t\t\t\t\t\t<span class=\"to-the-top-short\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/* translators: %s: HTML character for up arrow. */\n\t\t\t\t\t\t\tprintf( __( 'Up %s', 'twentytwenty' ), '<span class=\"arrow\" aria-hidden=\"true\">&uarr;</span>' );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</span><!-- .to-the-top-short -->\n\t\t\t\t\t</a><!-- .to-the-top -->\n\n\t\t\t\t</div><!-- .section-inner -->\n\n\t\t\t</footer><!-- #site-footer -->\n\n\t\t<?php wp_footer(); ?>\n\n\t</body>\n</html>\n", "num_lines": 62}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Twenty Twenty functions and definitions\n *\n * @link https://developer.wordpress.org/themes/basics/theme-functions/\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\n/**\n * Table of Contents:\n * Theme Support\n * Required Files\n * Register Styles\n * Register Scripts\n * Register Menus\n * Custom Logo\n * WP Body Open\n * Register Sidebars\n * Enqueue Block Editor Assets\n * Enqueue Classic Editor Styles\n * Block Editor Settings\n */\n\n/**\n * Sets up theme defaults and registers support for various WordPress features.\n *\n * Note that this function is hooked into the after_setup_theme hook, which\n * runs before the init hook. The init hook is too late for some features, such\n * as indicating support for post thumbnails.\n */\nfunction twentytwenty_theme_support() {\n\n\t// Add default posts and comments RSS feed links to head.\n\tadd_theme_support( 'automatic-feed-links' );\n\n\t// Custom background color.\n\tadd_theme_support(\n\t\t'custom-background',\n\t\tarray(\n\t\t\t'default-color' => 'f5efe0',\n\t\t)\n\t);\n\n\t// Set content-width.\n\tglobal $content_width;\n\tif ( ! isset( $content_width ) ) {\n\t\t$content_width = 580;\n\t}\n\n\t/*\n\t * Enable support for Post Thumbnails on posts and pages.\n\t *\n\t * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/\n\t */\n\tadd_theme_support( 'post-thumbnails' );\n\n\t// Set post thumbnail size.\n\tset_post_thumbnail_size( 1200, 9999 );\n\n\t// Add custom image size used in Cover Template.\n\tadd_image_size( 'twentytwenty-fullscreen', 1980, 9999 );\n\n\t// Custom logo.\n\t$logo_width  = 120;\n\t$logo_height = 90;\n\n\t// If the retina setting is active, double the recommended width and height.\n\tif ( get_theme_mod( 'retina_logo', false ) ) {\n\t\t$logo_width  = floor( $logo_width * 2 );\n\t\t$logo_height = floor( $logo_height * 2 );\n\t}\n\n\tadd_theme_support(\n\t\t'custom-logo',\n\t\tarray(\n\t\t\t'height'      => $logo_height,\n\t\t\t'width'       => $logo_width,\n\t\t\t'flex-height' => true,\n\t\t\t'flex-width'  => true,\n\t\t)\n\t);\n\n\t/*\n\t * Let WordPress manage the document title.\n\t * By adding theme support, we declare that this theme does not use a\n\t * hard-coded <title> tag in the document head, and expect WordPress to\n\t * provide it for us.\n\t */\n\tadd_theme_support( 'title-tag' );\n\n\t/*\n\t * Switch default core markup for search form, comment form, and comments\n\t * to output valid HTML5.\n\t */\n\tadd_theme_support(\n\t\t'html5',\n\t\tarray(\n\t\t\t'search-form',\n\t\t\t'comment-form',\n\t\t\t'comment-list',\n\t\t\t'gallery',\n\t\t\t'caption',\n\t\t\t'script',\n\t\t\t'style',\n\t\t)\n\t);\n\n\t/*\n\t * Make theme available for translation.\n\t * Translations can be filed in the /languages/ directory.\n\t * If you're building a theme based on Twenty Twenty, use a find and replace\n\t * to change 'twentytwenty' to the name of your theme in all the template files.\n\t */\n\tload_theme_textdomain( 'twentytwenty' );\n\n\t// Add support for full and wide align images.\n\tadd_theme_support( 'align-wide' );\n\n\t// Add support for responsive embeds.\n\tadd_theme_support( 'responsive-embeds' );\n\n\t/*\n\t * Adds starter content to highlight the theme on fresh sites.\n\t * This is done conditionally to avoid loading the starter content on every\n\t * page load, as it is a one-off operation only needed once in the customizer.\n\t */\n\tif ( is_customize_preview() ) {\n\t\trequire get_template_directory() . '/inc/starter-content.php';\n\t\tadd_theme_support( 'starter-content', twentytwenty_get_starter_content() );\n\t}\n\n\t// Add theme support for selective refresh for widgets.\n\tadd_theme_support( 'customize-selective-refresh-widgets' );\n\n\t/*\n\t * Adds `async` and `defer` support for scripts registered or enqueued\n\t * by the theme.\n\t */\n\t$loader = new TwentyTwenty_Script_Loader();\n\tadd_filter( 'script_loader_tag', array( $loader, 'filter_script_loader_tag' ), 10, 2 );\n\n}\n\nadd_action( 'after_setup_theme', 'twentytwenty_theme_support' );\n\n/**\n * REQUIRED FILES\n * Include required files.\n */\nrequire get_template_directory() . '/inc/template-tags.php';\n\n// Handle SVG icons.\nrequire get_template_directory() . '/classes/class-twentytwenty-svg-icons.php';\nrequire get_template_directory() . '/inc/svg-icons.php';\n\n// Handle Customizer settings.\nrequire get_template_directory() . '/classes/class-twentytwenty-customize.php';\n\n// Require Separator Control class.\nrequire get_template_directory() . '/classes/class-twentytwenty-separator-control.php';\n\n// Custom comment walker.\nrequire get_template_directory() . '/classes/class-twentytwenty-walker-comment.php';\n\n// Custom page walker.\nrequire get_template_directory() . '/classes/class-twentytwenty-walker-page.php';\n\n// Custom script loader class.\nrequire get_template_directory() . '/classes/class-twentytwenty-script-loader.php';\n\n// Non-latin language handling.\nrequire get_template_directory() . '/classes/class-twentytwenty-non-latin-languages.php';\n\n// Custom CSS.\nrequire get_template_directory() . '/inc/custom-css.php';\n\n/**\n * Register and Enqueue Styles.\n */\nfunction twentytwenty_register_styles() {\n\n\t$theme_version = wp_get_theme()->get( 'Version' );\n\n\twp_enqueue_style( 'twentytwenty-style', get_stylesheet_uri(), array(), $theme_version );\n\twp_style_add_data( 'twentytwenty-style', 'rtl', 'replace' );\n\n\t// Add output of Customizer settings as inline style.\n\twp_add_inline_style( 'twentytwenty-style', twentytwenty_get_customizer_css( 'front-end' ) );\n\n\t// Add print CSS.\n\twp_enqueue_style( 'twentytwenty-print-style', get_template_directory_uri() . '/print.css', null, $theme_version, 'print' );\n\n}\n\nadd_action( 'wp_enqueue_scripts', 'twentytwenty_register_styles' );\n\n/**\n * Register and Enqueue Scripts.\n */\nfunction twentytwenty_register_scripts() {\n\n\t$theme_version = wp_get_theme()->get( 'Version' );\n\n\tif ( ( ! is_admin() ) && is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n\n\twp_enqueue_script( 'twentytwenty-js', get_template_directory_uri() . '/assets/js/index.js', array(), $theme_version, false );\n\twp_script_add_data( 'twentytwenty-js', 'async', true );\n\n}\n\nadd_action( 'wp_enqueue_scripts', 'twentytwenty_register_scripts' );\n\n/**\n * Fix skip link focus in IE11.\n *\n * This does not enqueue the script because it is tiny and because it is only for IE11,\n * thus it does not warrant having an entire dedicated blocking script being loaded.\n *\n * @link https://git.io/vWdr2\n */\nfunction twentytwenty_skip_link_focus_fix() {\n\t// The following is minified via `terser --compress --mangle -- assets/js/skip-link-focus-fix.js`.\n\t?>\n\t<script>\n\t/(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener(\"hashchange\",function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())},!1);\n\t</script>\n\t<?php\n}\nadd_action( 'wp_print_footer_scripts', 'twentytwenty_skip_link_focus_fix' );\n\n/** Enqueue non-latin language styles\n *\n * @since Twenty Twenty 1.0\n *\n * @return void\n */\nfunction twentytwenty_non_latin_languages() {\n\t$custom_css = TwentyTwenty_Non_Latin_Languages::get_non_latin_css( 'front-end' );\n\n\tif ( $custom_css ) {\n\t\twp_add_inline_style( 'twentytwenty-style', $custom_css );\n\t}\n}\n\nadd_action( 'wp_enqueue_scripts', 'twentytwenty_non_latin_languages' );\n\n/**\n * Register navigation menus uses wp_nav_menu in five places.\n */\nfunction twentytwenty_menus() {\n\n\t$locations = array(\n\t\t'primary'  => __( 'Desktop Horizontal Menu', 'twentytwenty' ),\n\t\t'expanded' => __( 'Desktop Expanded Menu', 'twentytwenty' ),\n\t\t'mobile'   => __( 'Mobile Menu', 'twentytwenty' ),\n\t\t'footer'   => __( 'Footer Menu', 'twentytwenty' ),\n\t\t'social'   => __( 'Social Menu', 'twentytwenty' ),\n\t);\n\n\tregister_nav_menus( $locations );\n}\n\nadd_action( 'init', 'twentytwenty_menus' );\n\n/**\n * Get the information about the logo.\n *\n * @param string $html The HTML output from get_custom_logo (core function).\n * @return string\n */\nfunction twentytwenty_get_custom_logo( $html ) {\n\n\t$logo_id = get_theme_mod( 'custom_logo' );\n\n\tif ( ! $logo_id ) {\n\t\treturn $html;\n\t}\n\n\t$logo = wp_get_attachment_image_src( $logo_id, 'full' );\n\n\tif ( $logo ) {\n\t\t// For clarity.\n\t\t$logo_width  = esc_attr( $logo[1] );\n\t\t$logo_height = esc_attr( $logo[2] );\n\n\t\t// If the retina logo setting is active, reduce the width/height by half.\n\t\tif ( get_theme_mod( 'retina_logo', false ) ) {\n\t\t\t$logo_width  = floor( $logo_width / 2 );\n\t\t\t$logo_height = floor( $logo_height / 2 );\n\n\t\t\t$search = array(\n\t\t\t\t'/width=\\\"\\d+\\\"/iU',\n\t\t\t\t'/height=\\\"\\d+\\\"/iU',\n\t\t\t);\n\n\t\t\t$replace = array(\n\t\t\t\t\"width=\\\"{$logo_width}\\\"\",\n\t\t\t\t\"height=\\\"{$logo_height}\\\"\",\n\t\t\t);\n\n\t\t\t// Add a style attribute with the height, or append the height to the style attribute if the style attribute already exists.\n\t\t\tif ( strpos( $html, ' style=' ) === false ) {\n\t\t\t\t$search[]  = '/(src=)/';\n\t\t\t\t$replace[] = \"style=\\\"height: {$logo_height}px;\\\" src=\";\n\t\t\t} else {\n\t\t\t\t$search[]  = '/(style=\"[^\"]*)/';\n\t\t\t\t$replace[] = \"$1 height: {$logo_height}px;\";\n\t\t\t}\n\n\t\t\t$html = preg_replace( $search, $replace, $html );\n\n\t\t}\n\t}\n\n\treturn $html;\n\n}\n\nadd_filter( 'get_custom_logo', 'twentytwenty_get_custom_logo' );\n\nif ( ! function_exists( 'wp_body_open' ) ) {\n\n\t/**\n\t * Shim for wp_body_open, ensuring backward compatibility with versions of WordPress older than 5.2.\n\t */\n\tfunction wp_body_open() {\n\t\tdo_action( 'wp_body_open' );\n\t}\n}\n\n/**\n * Include a skip to content link at the top of the page so that users can bypass the menu.\n */\nfunction twentytwenty_skip_link() {\n\techo '<a class=\"skip-link screen-reader-text\" href=\"#site-content\">' . __( 'Skip to the content', 'twentytwenty' ) . '</a>';\n}\n\nadd_action( 'wp_body_open', 'twentytwenty_skip_link', 5 );\n\n/**\n * Register widget areas.\n *\n * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar\n */\nfunction twentytwenty_sidebar_registration() {\n\n\t// Arguments used in all register_sidebar() calls.\n\t$shared_args = array(\n\t\t'before_title'  => '<h2 class=\"widget-title subheading heading-size-3\">',\n\t\t'after_title'   => '</h2>',\n\t\t'before_widget' => '<div class=\"widget %2$s\"><div class=\"widget-content\">',\n\t\t'after_widget'  => '</div></div>',\n\t);\n\n\t// Footer #1.\n\tregister_sidebar(\n\t\tarray_merge(\n\t\t\t$shared_args,\n\t\t\tarray(\n\t\t\t\t'name'        => __( 'Footer #1', 'twentytwenty' ),\n\t\t\t\t'id'          => 'sidebar-1',\n\t\t\t\t'description' => __( 'Widgets in this area will be displayed in the first column in the footer.', 'twentytwenty' ),\n\t\t\t)\n\t\t)\n\t);\n\n\t// Footer #2.\n\tregister_sidebar(\n\t\tarray_merge(\n\t\t\t$shared_args,\n\t\t\tarray(\n\t\t\t\t'name'        => __( 'Footer #2', 'twentytwenty' ),\n\t\t\t\t'id'          => 'sidebar-2',\n\t\t\t\t'description' => __( 'Widgets in this area will be displayed in the second column in the footer.', 'twentytwenty' ),\n\t\t\t)\n\t\t)\n\t);\n\n}\n\nadd_action( 'widgets_init', 'twentytwenty_sidebar_registration' );\n\n/**\n * Enqueue supplemental block editor styles.\n */\nfunction twentytwenty_block_editor_styles() {\n\n\t// Enqueue the editor styles.\n\twp_enqueue_style( 'twentytwenty-block-editor-styles', get_theme_file_uri( '/assets/css/editor-style-block.css' ), array(), wp_get_theme()->get( 'Version' ), 'all' );\n\twp_style_add_data( 'twentytwenty-block-editor-styles', 'rtl', 'replace' );\n\n\t// Add inline style from the Customizer.\n\twp_add_inline_style( 'twentytwenty-block-editor-styles', twentytwenty_get_customizer_css( 'block-editor' ) );\n\n\t// Add inline style for non-latin fonts.\n\twp_add_inline_style( 'twentytwenty-block-editor-styles', TwentyTwenty_Non_Latin_Languages::get_non_latin_css( 'block-editor' ) );\n\n\t// Enqueue the editor script.\n\twp_enqueue_script( 'twentytwenty-block-editor-script', get_theme_file_uri( '/assets/js/editor-script-block.js' ), array( 'wp-blocks', 'wp-dom' ), wp_get_theme()->get( 'Version' ), true );\n}\n\nadd_action( 'enqueue_block_editor_assets', 'twentytwenty_block_editor_styles', 1, 1 );\n\n/**\n * Enqueue classic editor styles.\n */\nfunction twentytwenty_classic_editor_styles() {\n\n\t$classic_editor_styles = array(\n\t\t'/assets/css/editor-style-classic.css',\n\t);\n\n\tadd_editor_style( $classic_editor_styles );\n\n}\n\nadd_action( 'init', 'twentytwenty_classic_editor_styles' );\n\n/**\n * Output Customizer settings in the classic editor.\n * Adds styles to the head of the TinyMCE iframe. Kudos to @Otto42 for the original solution.\n *\n * @param array $mce_init TinyMCE styles.\n * @return array TinyMCE styles.\n */\nfunction twentytwenty_add_classic_editor_customizer_styles( $mce_init ) {\n\n\t$styles = twentytwenty_get_customizer_css( 'classic-editor' );\n\n\tif ( ! isset( $mce_init['content_style'] ) ) {\n\t\t$mce_init['content_style'] = $styles . ' ';\n\t} else {\n\t\t$mce_init['content_style'] .= ' ' . $styles . ' ';\n\t}\n\n\treturn $mce_init;\n\n}\n\nadd_filter( 'tiny_mce_before_init', 'twentytwenty_add_classic_editor_customizer_styles' );\n\n/**\n * Output non-latin font styles in the classic editor.\n * Adds styles to the head of the TinyMCE iframe. Kudos to @Otto42 for the original solution.\n *\n * @param array $mce_init TinyMCE styles.\n * @return array TinyMCE styles.\n */\nfunction twentytwenty_add_classic_editor_non_latin_styles( $mce_init ) {\n\n\t$styles = TwentyTwenty_Non_Latin_Languages::get_non_latin_css( 'classic-editor' );\n\n\t// Return if there are no styles to add.\n\tif ( ! $styles ) {\n\t\treturn $mce_init;\n\t}\n\n\tif ( ! isset( $mce_init['content_style'] ) ) {\n\t\t$mce_init['content_style'] = $styles . ' ';\n\t} else {\n\t\t$mce_init['content_style'] .= ' ' . $styles . ' ';\n\t}\n\n\treturn $mce_init;\n\n}\n\nadd_filter( 'tiny_mce_before_init', 'twentytwenty_add_classic_editor_non_latin_styles' );\n\n/**\n * Block Editor Settings.\n * Add custom colors and font sizes to the block editor.\n */\nfunction twentytwenty_block_editor_settings() {\n\n\t// Block Editor Palette.\n\t$editor_color_palette = array(\n\t\tarray(\n\t\t\t'name'  => __( 'Accent Color', 'twentytwenty' ),\n\t\t\t'slug'  => 'accent',\n\t\t\t'color' => twentytwenty_get_color_for_area( 'content', 'accent' ),\n\t\t),\n\t\tarray(\n\t\t\t'name'  => __( 'Primary', 'twentytwenty' ),\n\t\t\t'slug'  => 'primary',\n\t\t\t'color' => twentytwenty_get_color_for_area( 'content', 'text' ),\n\t\t),\n\t\tarray(\n\t\t\t'name'  => __( 'Secondary', 'twentytwenty' ),\n\t\t\t'slug'  => 'secondary',\n\t\t\t'color' => twentytwenty_get_color_for_area( 'content', 'secondary' ),\n\t\t),\n\t\tarray(\n\t\t\t'name'  => __( 'Subtle Background', 'twentytwenty' ),\n\t\t\t'slug'  => 'subtle-background',\n\t\t\t'color' => twentytwenty_get_color_for_area( 'content', 'borders' ),\n\t\t),\n\t);\n\n\t// Add the background option.\n\t$background_color = get_theme_mod( 'background_color' );\n\tif ( ! $background_color ) {\n\t\t$background_color_arr = get_theme_support( 'custom-background' );\n\t\t$background_color     = $background_color_arr[0]['default-color'];\n\t}\n\t$editor_color_palette[] = array(\n\t\t'name'  => __( 'Background Color', 'twentytwenty' ),\n\t\t'slug'  => 'background',\n\t\t'color' => '#' . $background_color,\n\t);\n\n\t// If we have accent colors, add them to the block editor palette.\n\tif ( $editor_color_palette ) {\n\t\tadd_theme_support( 'editor-color-palette', $editor_color_palette );\n\t}\n\n\t// Block Editor Font Sizes.\n\tadd_theme_support(\n\t\t'editor-font-sizes',\n\t\tarray(\n\t\t\tarray(\n\t\t\t\t'name'      => _x( 'Small', 'Name of the small font size in the block editor', 'twentytwenty' ),\n\t\t\t\t'shortName' => _x( 'S', 'Short name of the small font size in the block editor.', 'twentytwenty' ),\n\t\t\t\t'size'      => 18,\n\t\t\t\t'slug'      => 'small',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'      => _x( 'Regular', 'Name of the regular font size in the block editor', 'twentytwenty' ),\n\t\t\t\t'shortName' => _x( 'M', 'Short name of the regular font size in the block editor.', 'twentytwenty' ),\n\t\t\t\t'size'      => 21,\n\t\t\t\t'slug'      => 'normal',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'      => _x( 'Large', 'Name of the large font size in the block editor', 'twentytwenty' ),\n\t\t\t\t'shortName' => _x( 'L', 'Short name of the large font size in the block editor.', 'twentytwenty' ),\n\t\t\t\t'size'      => 26.25,\n\t\t\t\t'slug'      => 'large',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'      => _x( 'Larger', 'Name of the larger font size in the block editor', 'twentytwenty' ),\n\t\t\t\t'shortName' => _x( 'XL', 'Short name of the larger font size in the block editor.', 'twentytwenty' ),\n\t\t\t\t'size'      => 32,\n\t\t\t\t'slug'      => 'larger',\n\t\t\t),\n\t\t)\n\t);\n\n\tadd_theme_support( 'editor-styles' );\n\n\t// If we have a dark background color then add support for dark editor style.\n\t// We can determine if the background color is dark by checking if the text-color is white.\n\tif ( '#ffffff' === strtolower( twentytwenty_get_color_for_area( 'content', 'text' ) ) ) {\n\t\tadd_theme_support( 'dark-editor-style' );\n\t}\n\n}\n\nadd_action( 'after_setup_theme', 'twentytwenty_block_editor_settings' );\n\n/**\n * Overwrite default more tag with styling and screen reader markup.\n *\n * @param string $html The default output HTML for the more tag.\n * @return string\n */\nfunction twentytwenty_read_more_tag( $html ) {\n\treturn preg_replace( '/<a(.*)>(.*)<\\/a>/iU', sprintf( '<div class=\"read-more-button-wrap\"><a$1><span class=\"faux-button\">$2</span> <span class=\"screen-reader-text\">\"%1$s\"</span></a></div>', get_the_title( get_the_ID() ) ), $html );\n}\n\nadd_filter( 'the_content_more_link', 'twentytwenty_read_more_tag' );\n\n/**\n * Enqueues scripts for customizer controls & settings.\n *\n * @since Twenty Twenty 1.0\n *\n * @return void\n */\nfunction twentytwenty_customize_controls_enqueue_scripts() {\n\t$theme_version = wp_get_theme()->get( 'Version' );\n\n\t// Add main customizer js file.\n\twp_enqueue_script( 'twentytwenty-customize', get_template_directory_uri() . '/assets/js/customize.js', array( 'jquery' ), $theme_version, false );\n\n\t// Add script for color calculations.\n\twp_enqueue_script( 'twentytwenty-color-calculations', get_template_directory_uri() . '/assets/js/color-calculations.js', array( 'wp-color-picker' ), $theme_version, false );\n\n\t// Add script for controls.\n\twp_enqueue_script( 'twentytwenty-customize-controls', get_template_directory_uri() . '/assets/js/customize-controls.js', array( 'twentytwenty-color-calculations', 'customize-controls', 'underscore', 'jquery' ), $theme_version, false );\n\twp_localize_script( 'twentytwenty-customize-controls', 'twentyTwentyBgColors', twentytwenty_get_customizer_color_vars() );\n}\n\nadd_action( 'customize_controls_enqueue_scripts', 'twentytwenty_customize_controls_enqueue_scripts' );\n\n/**\n * Enqueue scripts for the customizer preview.\n *\n * @since Twenty Twenty 1.0\n *\n * @return void\n */\nfunction twentytwenty_customize_preview_init() {\n\t$theme_version = wp_get_theme()->get( 'Version' );\n\n\twp_enqueue_script( 'twentytwenty-customize-preview', get_theme_file_uri( '/assets/js/customize-preview.js' ), array( 'customize-preview', 'customize-selective-refresh', 'jquery' ), $theme_version, true );\n\twp_localize_script( 'twentytwenty-customize-preview', 'twentyTwentyBgColors', twentytwenty_get_customizer_color_vars() );\n\twp_localize_script( 'twentytwenty-customize-preview', 'twentyTwentyPreviewEls', twentytwenty_get_elements_array() );\n\n\twp_add_inline_script(\n\t\t'twentytwenty-customize-preview',\n\t\tsprintf(\n\t\t\t'wp.customize.selectiveRefresh.partialConstructor[ %1$s ].prototype.attrs = %2$s;',\n\t\t\twp_json_encode( 'cover_opacity' ),\n\t\t\twp_json_encode( twentytwenty_customize_opacity_range() )\n\t\t)\n\t);\n}\n\nadd_action( 'customize_preview_init', 'twentytwenty_customize_preview_init' );\n\n/**\n * Get accessible color for an area.\n *\n * @since Twenty Twenty 1.0\n *\n * @param string $area The area we want to get the colors for.\n * @param string $context Can be 'text' or 'accent'.\n * @return string Returns a HEX color.\n */\nfunction twentytwenty_get_color_for_area( $area = 'content', $context = 'text' ) {\n\n\t// Get the value from the theme-mod.\n\t$settings = get_theme_mod(\n\t\t'accent_accessible_colors',\n\t\tarray(\n\t\t\t'content'       => array(\n\t\t\t\t'text'      => '#000000',\n\t\t\t\t'accent'    => '#cd2653',\n\t\t\t\t'secondary' => '#6d6d6d',\n\t\t\t\t'borders'   => '#dcd7ca',\n\t\t\t),\n\t\t\t'header-footer' => array(\n\t\t\t\t'text'      => '#000000',\n\t\t\t\t'accent'    => '#cd2653',\n\t\t\t\t'secondary' => '#6d6d6d',\n\t\t\t\t'borders'   => '#dcd7ca',\n\t\t\t),\n\t\t)\n\t);\n\n\t// If we have a value return it.\n\tif ( isset( $settings[ $area ] ) && isset( $settings[ $area ][ $context ] ) ) {\n\t\treturn $settings[ $area ][ $context ];\n\t}\n\n\t// Return false if the option doesn't exist.\n\treturn false;\n}\n\n/**\n * Returns an array of variables for the customizer preview.\n *\n * @since Twenty Twenty 1.0\n *\n * @return array\n */\nfunction twentytwenty_get_customizer_color_vars() {\n\t$colors = array(\n\t\t'content'       => array(\n\t\t\t'setting' => 'background_color',\n\t\t),\n\t\t'header-footer' => array(\n\t\t\t'setting' => 'header_footer_background_color',\n\t\t),\n\t);\n\treturn $colors;\n}\n\n/**\n * Get an array of elements.\n *\n * @since Twenty Twenty 1.0\n *\n * @return array\n */\nfunction twentytwenty_get_elements_array() {\n\n\t// The array is formatted like this:\n\t// [key-in-saved-setting][sub-key-in-setting][css-property] = [elements].\n\t$elements = array(\n\t\t'content'       => array(\n\t\t\t'accent'     => array(\n\t\t\t\t'color'            => array( '.color-accent', '.color-accent-hover:hover', '.color-accent-hover:focus', ':root .has-accent-color', '.has-drop-cap:not(:focus):first-letter', '.wp-block-button.is-style-outline', 'a' ),\n\t\t\t\t'border-color'     => array( 'blockquote', '.border-color-accent', '.border-color-accent-hover:hover', '.border-color-accent-hover:focus' ),\n\t\t\t\t'background-color' => array( 'button', '.button', '.faux-button', '.wp-block-button__link', '.wp-block-file .wp-block-file__button', 'input[type=\"button\"]', 'input[type=\"reset\"]', 'input[type=\"submit\"]', '.bg-accent', '.bg-accent-hover:hover', '.bg-accent-hover:focus', ':root .has-accent-background-color', '.comment-reply-link' ),\n\t\t\t\t'fill'             => array( '.fill-children-accent', '.fill-children-accent *' ),\n\t\t\t),\n\t\t\t'background' => array(\n\t\t\t\t'color'            => array( ':root .has-background-color', 'button', '.button', '.faux-button', '.wp-block-button__link', '.wp-block-file__button', 'input[type=\"button\"]', 'input[type=\"reset\"]', 'input[type=\"submit\"]', '.wp-block-button', '.comment-reply-link', '.has-background.has-primary-background-color:not(.has-text-color)', '.has-background.has-primary-background-color *:not(.has-text-color)', '.has-background.has-accent-background-color:not(.has-text-color)', '.has-background.has-accent-background-color *:not(.has-text-color)' ),\n\t\t\t\t'background-color' => array( ':root .has-background-background-color' ),\n\t\t\t),\n\t\t\t'text'       => array(\n\t\t\t\t'color'            => array( 'body', '.entry-title a', ':root .has-primary-color' ),\n\t\t\t\t'background-color' => array( ':root .has-primary-background-color' ),\n\t\t\t),\n\t\t\t'secondary'  => array(\n\t\t\t\t'color'            => array( 'cite', 'figcaption', '.wp-caption-text', '.post-meta', '.entry-content .wp-block-archives li', '.entry-content .wp-block-categories li', '.entry-content .wp-block-latest-posts li', '.wp-block-latest-comments__comment-date', '.wp-block-latest-posts__post-date', '.wp-block-embed figcaption', '.wp-block-image figcaption', '.wp-block-pullquote cite', '.comment-metadata', '.comment-respond .comment-notes', '.comment-respond .logged-in-as', '.pagination .dots', '.entry-content hr:not(.has-background)', 'hr.styled-separator', ':root .has-secondary-color' ),\n\t\t\t\t'background-color' => array( ':root .has-secondary-background-color' ),\n\t\t\t),\n\t\t\t'borders'    => array(\n\t\t\t\t'border-color'        => array( 'pre', 'fieldset', 'input', 'textarea', 'table', 'table *', 'hr' ),\n\t\t\t\t'background-color'    => array( 'caption', 'code', 'code', 'kbd', 'samp', '.wp-block-table.is-style-stripes tbody tr:nth-child(odd)', ':root .has-subtle-background-background-color' ),\n\t\t\t\t'border-bottom-color' => array( '.wp-block-table.is-style-stripes' ),\n\t\t\t\t'border-top-color'    => array( '.wp-block-latest-posts.is-grid li' ),\n\t\t\t\t'color'               => array( ':root .has-subtle-background-color' ),\n\t\t\t),\n\t\t),\n\t\t'header-footer' => array(\n\t\t\t'accent'     => array(\n\t\t\t\t'color'            => array( 'body:not(.overlay-header) .primary-menu > li > a', 'body:not(.overlay-header) .primary-menu > li > .icon', '.modal-menu a', '.footer-menu a, .footer-widgets a', '#site-footer .wp-block-button.is-style-outline', '.wp-block-pullquote:before', '.singular:not(.overlay-header) .entry-header a', '.archive-header a', '.header-footer-group .color-accent', '.header-footer-group .color-accent-hover:hover' ),\n\t\t\t\t'background-color' => array( '.social-icons a', '#site-footer button:not(.toggle)', '#site-footer .button', '#site-footer .faux-button', '#site-footer .wp-block-button__link', '#site-footer .wp-block-file__button', '#site-footer input[type=\"button\"]', '#site-footer input[type=\"reset\"]', '#site-footer input[type=\"submit\"]' ),\n\t\t\t),\n\t\t\t'background' => array(\n\t\t\t\t'color'            => array( '.social-icons a', 'body:not(.overlay-header) .primary-menu ul', '.header-footer-group button', '.header-footer-group .button', '.header-footer-group .faux-button', '.header-footer-group .wp-block-button:not(.is-style-outline) .wp-block-button__link', '.header-footer-group .wp-block-file__button', '.header-footer-group input[type=\"button\"]', '.header-footer-group input[type=\"reset\"]', '.header-footer-group input[type=\"submit\"]' ),\n\t\t\t\t'background-color' => array( '#site-header', '.footer-nav-widgets-wrapper', '#site-footer', '.menu-modal', '.menu-modal-inner', '.search-modal-inner', '.archive-header', '.singular .entry-header', '.singular .featured-media:before', '.wp-block-pullquote:before' ),\n\t\t\t),\n\t\t\t'text'       => array(\n\t\t\t\t'color'               => array( '.header-footer-group', 'body:not(.overlay-header) #site-header .toggle', '.menu-modal .toggle' ),\n\t\t\t\t'background-color'    => array( 'body:not(.overlay-header) .primary-menu ul' ),\n\t\t\t\t'border-bottom-color' => array( 'body:not(.overlay-header) .primary-menu > li > ul:after' ),\n\t\t\t\t'border-left-color'   => array( 'body:not(.overlay-header) .primary-menu ul ul:after' ),\n\t\t\t),\n\t\t\t'secondary'  => array(\n\t\t\t\t'color' => array( '.site-description', 'body:not(.overlay-header) .toggle-inner .toggle-text', '.widget .post-date', '.widget .rss-date', '.widget_archive li', '.widget_categories li', '.widget cite', '.widget_pages li', '.widget_meta li', '.widget_nav_menu li', '.powered-by-wordpress', '.to-the-top', '.singular .entry-header .post-meta', '.singular:not(.overlay-header) .entry-header .post-meta a' ),\n\t\t\t),\n\t\t\t'borders'    => array(\n\t\t\t\t'border-color'     => array( '.header-footer-group pre', '.header-footer-group fieldset', '.header-footer-group input', '.header-footer-group textarea', '.header-footer-group table', '.header-footer-group table *', '.footer-nav-widgets-wrapper', '#site-footer', '.menu-modal nav *', '.footer-widgets-outer-wrapper', '.footer-top' ),\n\t\t\t\t'background-color' => array( '.header-footer-group table caption', 'body:not(.overlay-header) .header-inner .toggle-wrapper::before' ),\n\t\t\t),\n\t\t),\n\t);\n\n\t/**\n\t* Filters Twenty Twenty theme elements\n\t*\n\t* @since Twenty Twenty 1.0\n\t*\n\t* @param array Array of elements\n\t*/\n\treturn apply_filters( 'twentytwenty_get_elements_array', $elements );\n}\n", "num_lines": 757}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Header file for the Twenty Twenty WordPress default theme.\n *\n * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\n?><!DOCTYPE html>\n\n<html class=\"no-js\" <?php language_attributes(); ?>>\n\n\t<head>\n\n\t\t<meta charset=\"<?php bloginfo( 'charset' ); ?>\">\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" >\n\n\t\t<link rel=\"profile\" href=\"https://gmpg.org/xfn/11\">\n\n\t\t<?php wp_head(); ?>\n\n\t</head>\n\n\t<body <?php body_class(); ?>>\n\n\t\t<?php\n\t\twp_body_open();\n\t\t?>\n\n\t\t<header id=\"site-header\" class=\"header-footer-group\" role=\"banner\">\n\n\t\t\t<div class=\"header-inner section-inner\">\n\n\t\t\t\t<div class=\"header-titles-wrapper\">\n\n\t\t\t\t\t<?php\n\n\t\t\t\t\t// Check whether the header search is activated in the customizer.\n\t\t\t\t\t$enable_header_search = get_theme_mod( 'enable_header_search', true );\n\n\t\t\t\t\tif ( true === $enable_header_search ) {\n\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t<button class=\"toggle search-toggle mobile-search-toggle\" data-toggle-target=\".search-modal\" data-toggle-body-class=\"showing-search-modal\" data-set-focus=\".search-modal .search-field\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t<span class=\"toggle-inner\">\n\t\t\t\t\t\t\t\t<span class=\"toggle-icon\">\n\t\t\t\t\t\t\t\t\t<?php twentytwenty_the_theme_svg( 'search' ); ?>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span class=\"toggle-text\"><?php _e( 'Search', 'twentytwenty' ); ?></span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</button><!-- .search-toggle -->\n\n\t\t\t\t\t<?php } ?>\n\n\t\t\t\t\t<div class=\"header-titles\">\n\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t// Site title or logo.\n\t\t\t\t\t\t\ttwentytwenty_site_logo();\n\n\t\t\t\t\t\t\t// Site description.\n\t\t\t\t\t\t\ttwentytwenty_site_description();\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t</div><!-- .header-titles -->\n\n\t\t\t\t\t<button class=\"toggle nav-toggle mobile-nav-toggle\" data-toggle-target=\".menu-modal\"  data-toggle-body-class=\"showing-menu-modal\" aria-expanded=\"false\" data-set-focus=\".close-nav-toggle\">\n\t\t\t\t\t\t<span class=\"toggle-inner\">\n\t\t\t\t\t\t\t<span class=\"toggle-icon\">\n\t\t\t\t\t\t\t\t<?php twentytwenty_the_theme_svg( 'ellipsis' ); ?>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span class=\"toggle-text\"><?php _e( 'Menu', 'twentytwenty' ); ?></span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</button><!-- .nav-toggle -->\n\n\t\t\t\t</div><!-- .header-titles-wrapper -->\n\n\t\t\t\t<div class=\"header-navigation-wrapper\">\n\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( has_nav_menu( 'primary' ) || ! has_nav_menu( 'expanded' ) ) {\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t<nav class=\"primary-menu-wrapper\" aria-label=\"<?php esc_attr_e( 'Horizontal', 'twentytwenty' ); ?>\" role=\"navigation\">\n\n\t\t\t\t\t\t\t\t<ul class=\"primary-menu reset-list-style\">\n\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( has_nav_menu( 'primary' ) ) {\n\n\t\t\t\t\t\t\t\t\twp_nav_menu(\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'container'  => '',\n\t\t\t\t\t\t\t\t\t\t\t'items_wrap' => '%3$s',\n\t\t\t\t\t\t\t\t\t\t\t'theme_location' => 'primary',\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t} elseif ( ! has_nav_menu( 'expanded' ) ) {\n\n\t\t\t\t\t\t\t\t\twp_list_pages(\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'match_menu_classes' => true,\n\t\t\t\t\t\t\t\t\t\t\t'show_sub_menu_icons' => true,\n\t\t\t\t\t\t\t\t\t\t\t'title_li' => false,\n\t\t\t\t\t\t\t\t\t\t\t'walker'   => new TwentyTwenty_Walker_Page(),\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t\t\t</nav><!-- .primary-menu-wrapper -->\n\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( true === $enable_header_search || has_nav_menu( 'expanded' ) ) {\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t<div class=\"header-toggles hide-no-js\">\n\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( has_nav_menu( 'expanded' ) ) {\n\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t<div class=\"toggle-wrapper nav-toggle-wrapper has-expanded-menu\">\n\n\t\t\t\t\t\t\t\t<button class=\"toggle nav-toggle desktop-nav-toggle\" data-toggle-target=\".menu-modal\" data-toggle-body-class=\"showing-menu-modal\" aria-expanded=\"false\" data-set-focus=\".close-nav-toggle\">\n\t\t\t\t\t\t\t\t\t<span class=\"toggle-inner\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"toggle-text\"><?php _e( 'Menu', 'twentytwenty' ); ?></span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"toggle-icon\">\n\t\t\t\t\t\t\t\t\t\t\t<?php twentytwenty_the_theme_svg( 'ellipsis' ); ?>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</button><!-- .nav-toggle -->\n\n\t\t\t\t\t\t\t</div><!-- .nav-toggle-wrapper -->\n\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( true === $enable_header_search ) {\n\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t<div class=\"toggle-wrapper search-toggle-wrapper\">\n\n\t\t\t\t\t\t\t\t<button class=\"toggle search-toggle desktop-search-toggle\" data-toggle-target=\".search-modal\" data-toggle-body-class=\"showing-search-modal\" data-set-focus=\".search-modal .search-field\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t<span class=\"toggle-inner\">\n\t\t\t\t\t\t\t\t\t\t<?php twentytwenty_the_theme_svg( 'search' ); ?>\n\t\t\t\t\t\t\t\t\t\t<span class=\"toggle-text\"><?php _e( 'Search', 'twentytwenty' ); ?></span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</button><!-- .search-toggle -->\n\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t</div><!-- .header-toggles -->\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\n\t\t\t\t</div><!-- .header-navigation-wrapper -->\n\n\t\t\t</div><!-- .header-inner -->\n\n\t\t\t<?php\n\t\t\t// Output the search modal (if it is activated in the customizer).\n\t\t\tif ( true === $enable_header_search ) {\n\t\t\t\tget_template_part( 'template-parts/modal-search' );\n\t\t\t}\n\t\t\t?>\n\n\t\t</header><!-- #site-header -->\n\n\t\t<?php\n\t\t// Output the menu modal.\n\t\tget_template_part( 'template-parts/modal-menu' );\n", "num_lines": 188}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The main template file\n *\n * This is the most generic template file in a WordPress theme\n * and one of the two required files for a theme (the other being style.css).\n * It is used to display a page when nothing more specific matches a query.\n * E.g., it puts together the home page when no home.php file exists.\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\nget_header();\n?>\n\n<main id=\"site-content\" role=\"main\">\n\n\t<?php\n\n\t$archive_title    = '';\n\t$archive_subtitle = '';\n\n\tif ( is_search() ) {\n\t\tglobal $wp_query;\n\n\t\t$archive_title = sprintf(\n\t\t\t'%1$s %2$s',\n\t\t\t'<span class=\"color-accent\">' . __( 'Search:', 'twentytwenty' ) . '</span>',\n\t\t\t'&ldquo;' . get_search_query() . '&rdquo;'\n\t\t);\n\n\t\tif ( $wp_query->found_posts ) {\n\t\t\t$archive_subtitle = sprintf(\n\t\t\t\t/* translators: %s: Number of search results. */\n\t\t\t\t_n(\n\t\t\t\t\t'We found %s result for your search.',\n\t\t\t\t\t'We found %s results for your search.',\n\t\t\t\t\t$wp_query->found_posts,\n\t\t\t\t\t'twentytwenty'\n\t\t\t\t),\n\t\t\t\tnumber_format_i18n( $wp_query->found_posts )\n\t\t\t);\n\t\t} else {\n\t\t\t$archive_subtitle = __( 'We could not find any results for your search. You can give it another try through the search form below.', 'twentytwenty' );\n\t\t}\n\t} elseif ( is_archive() && ! have_posts() ) {\n\t\t$archive_title = __( 'Nothing Found', 'twentytwenty' );\n\t} elseif ( ! is_home() ) {\n\t\t$archive_title    = get_the_archive_title();\n\t\t$archive_subtitle = get_the_archive_description();\n\t}\n\n\tif ( $archive_title || $archive_subtitle ) {\n\t\t?>\n\n\t\t<header class=\"archive-header has-text-align-center header-footer-group\">\n\n\t\t\t<div class=\"archive-header-inner section-inner medium\">\n\n\t\t\t\t<?php if ( $archive_title ) { ?>\n\t\t\t\t\t<h1 class=\"archive-title\"><?php echo wp_kses_post( $archive_title ); ?></h1>\n\t\t\t\t<?php } ?>\n\n\t\t\t\t<?php if ( $archive_subtitle ) { ?>\n\t\t\t\t\t<div class=\"archive-subtitle section-inner thin max-percentage intro-text\"><?php echo wp_kses_post( wpautop( $archive_subtitle ) ); ?></div>\n\t\t\t\t<?php } ?>\n\n\t\t\t</div><!-- .archive-header-inner -->\n\n\t\t</header><!-- .archive-header -->\n\n\t\t<?php\n\t}\n\n\tif ( have_posts() ) {\n\n\t\t$i = 0;\n\n\t\twhile ( have_posts() ) {\n\t\t\t$i++;\n\t\t\tif ( $i > 1 ) {\n\t\t\t\techo '<hr class=\"post-separator styled-separator is-style-wide section-inner\" aria-hidden=\"true\" />';\n\t\t\t}\n\t\t\tthe_post();\n\n\t\t\tget_template_part( 'template-parts/content', get_post_type() );\n\n\t\t}\n\t} elseif ( is_search() ) {\n\t\t?>\n\n\t\t<div class=\"no-search-results-form section-inner thin\">\n\n\t\t\t<?php\n\t\t\tget_search_form(\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'search again', 'twentytwenty' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\t?>\n\n\t\t</div><!-- .no-search-results -->\n\n\t\t<?php\n\t}\n\t?>\n\n\t<?php get_template_part( 'template-parts/pagination' ); ?>\n\n</main><!-- #site-content -->\n\n<?php get_template_part( 'template-parts/footer-menus-widgets' ); ?>\n\n<?php\nget_footer();\n", "num_lines": 120}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The searchform.php template.\n *\n * Used any time that get_search_form() is called.\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\n/*\n * Generate a unique ID for each form and a string containing an aria-label\n * if one was passed to get_search_form() in the args array.\n */\n$twentytwenty_unique_id = twentytwenty_unique_id( 'search-form-' );\n\n$twentytwenty_aria_label = ! empty( $args['label'] ) ? 'aria-label=\"' . esc_attr( $args['label'] ) . '\"' : '';\n?>\n<form role=\"search\" <?php echo $twentytwenty_aria_label; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped above. ?> method=\"get\" class=\"search-form\" action=\"<?php echo esc_url( home_url( '/' ) ); ?>\">\n\t<label for=\"<?php echo esc_attr( $twentytwenty_unique_id ); ?>\">\n\t\t<span class=\"screen-reader-text\"><?php _e( 'Search for:', 'twentytwenty' ); // phpcs:ignore: WordPress.Security.EscapeOutput.UnsafePrintingFunction -- core trusts translations ?></span>\n\t\t<input type=\"search\" id=\"<?php echo esc_attr( $twentytwenty_unique_id ); ?>\" class=\"search-field\" placeholder=\"<?php echo esc_attr_x( 'Search &hellip;', 'placeholder', 'twentytwenty' ); ?>\" value=\"<?php echo get_search_query(); ?>\" name=\"s\" />\n\t</label>\n\t<input type=\"submit\" class=\"search-submit\" value=\"<?php echo esc_attr_x( 'Search', 'submit button', 'twentytwenty' ); ?>\" />\n</form>\n", "num_lines": 29}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying single posts and pages.\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\nget_header();\n?>\n\n<main id=\"site-content\" role=\"main\">\n\n\t<?php\n\n\tif ( have_posts() ) {\n\n\t\twhile ( have_posts() ) {\n\t\t\tthe_post();\n\n\t\t\tget_template_part( 'template-parts/content', get_post_type() );\n\t\t}\n\t}\n\n\t?>\n\n</main><!-- #site-content -->\n\n<?php get_template_part( 'template-parts/footer-menus-widgets' ); ?>\n\n<?php get_footer(); ?>\n", "num_lines": 35}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customizer settings for this theme.\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\nif ( ! class_exists( 'TwentyTwenty_Customize' ) ) {\n\t/**\n\t * CUSTOMIZER SETTINGS\n\t */\n\tclass TwentyTwenty_Customize {\n\n\t\t/**\n\t\t * Register customizer options.\n\t\t *\n\t\t * @param WP_Customize_Manager $wp_customize Theme Customizer object.\n\t\t */\n\t\tpublic static function register( $wp_customize ) {\n\n\t\t\t/**\n\t\t\t * Site Title & Description.\n\t\t\t * */\n\t\t\t$wp_customize->get_setting( 'blogname' )->transport        = 'postMessage';\n\t\t\t$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';\n\n\t\t\t$wp_customize->selective_refresh->add_partial(\n\t\t\t\t'blogname',\n\t\t\t\tarray(\n\t\t\t\t\t'selector'        => '.site-title a',\n\t\t\t\t\t'render_callback' => 'twentytwenty_customize_partial_blogname',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_customize->selective_refresh->add_partial(\n\t\t\t\t'blogdescription',\n\t\t\t\tarray(\n\t\t\t\t\t'selector'        => '.site-description',\n\t\t\t\t\t'render_callback' => 'twentytwenty_customize_partial_blogdescription',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_customize->selective_refresh->add_partial(\n\t\t\t\t'custom_logo',\n\t\t\t\tarray(\n\t\t\t\t\t'selector'        => '.header-titles [class*=site-]:not(.site-description)',\n\t\t\t\t\t'render_callback' => 'twentytwenty_customize_partial_site_logo',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_customize->selective_refresh->add_partial(\n\t\t\t\t'retina_logo',\n\t\t\t\tarray(\n\t\t\t\t\t'selector'        => '.header-titles [class*=site-]:not(.site-description)',\n\t\t\t\t\t'render_callback' => 'twentytwenty_customize_partial_site_logo',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Site Identity\n\t\t\t */\n\n\t\t\t/* 2X Header Logo ---------------- */\n\t\t\t$wp_customize->add_setting(\n\t\t\t\t'retina_logo',\n\t\t\t\tarray(\n\t\t\t\t\t'capability'        => 'edit_theme_options',\n\t\t\t\t\t'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ),\n\t\t\t\t\t'transport'         => 'postMessage',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_customize->add_control(\n\t\t\t\t'retina_logo',\n\t\t\t\tarray(\n\t\t\t\t\t'type'        => 'checkbox',\n\t\t\t\t\t'section'     => 'title_tagline',\n\t\t\t\t\t'priority'    => 10,\n\t\t\t\t\t'label'       => __( 'Retina logo', 'twentytwenty' ),\n\t\t\t\t\t'description' => __( 'Scales the logo to half its uploaded size, making it sharp on high-res screens.', 'twentytwenty' ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Header & Footer Background Color.\n\t\t\t$wp_customize->add_setting(\n\t\t\t\t'header_footer_background_color',\n\t\t\t\tarray(\n\t\t\t\t\t'default'           => '#ffffff',\n\t\t\t\t\t'sanitize_callback' => 'sanitize_hex_color',\n\t\t\t\t\t'transport'         => 'postMessage',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_customize->add_control(\n\t\t\t\tnew WP_Customize_Color_Control(\n\t\t\t\t\t$wp_customize,\n\t\t\t\t\t'header_footer_background_color',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'label'   => __( 'Header &amp; Footer Background Color', 'twentytwenty' ),\n\t\t\t\t\t\t'section' => 'colors',\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Enable picking an accent color.\n\t\t\t$wp_customize->add_setting(\n\t\t\t\t'accent_hue_active',\n\t\t\t\tarray(\n\t\t\t\t\t'capability'        => 'edit_theme_options',\n\t\t\t\t\t'sanitize_callback' => array( __CLASS__, 'sanitize_select' ),\n\t\t\t\t\t'transport'         => 'postMessage',\n\t\t\t\t\t'default'           => 'default',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_customize->add_control(\n\t\t\t\t'accent_hue_active',\n\t\t\t\tarray(\n\t\t\t\t\t'type'    => 'radio',\n\t\t\t\t\t'section' => 'colors',\n\t\t\t\t\t'label'   => __( 'Primary Color', 'twentytwenty' ),\n\t\t\t\t\t'choices' => array(\n\t\t\t\t\t\t'default' => __( 'Default', 'twentytwenty' ),\n\t\t\t\t\t\t'custom'  => __( 'Custom', 'twentytwenty' ),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Implementation for the accent color.\n\t\t\t * This is different to all other color options because of the accessibility enhancements.\n\t\t\t * The control is a hue-only colorpicker, and there is a separate setting that holds values\n\t\t\t * for other colors calculated based on the selected hue and various background-colors on the page.\n\t\t\t *\n\t\t\t * @since Twenty Twenty 1.0\n\t\t\t */\n\n\t\t\t// Add the setting for the hue colorpicker.\n\t\t\t$wp_customize->add_setting(\n\t\t\t\t'accent_hue',\n\t\t\t\tarray(\n\t\t\t\t\t'default'           => 344,\n\t\t\t\t\t'type'              => 'theme_mod',\n\t\t\t\t\t'sanitize_callback' => 'absint',\n\t\t\t\t\t'transport'         => 'postMessage',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Add setting to hold colors derived from the accent hue.\n\t\t\t$wp_customize->add_setting(\n\t\t\t\t'accent_accessible_colors',\n\t\t\t\tarray(\n\t\t\t\t\t'default'           => array(\n\t\t\t\t\t\t'content'       => array(\n\t\t\t\t\t\t\t'text'      => '#000000',\n\t\t\t\t\t\t\t'accent'    => '#cd2653',\n\t\t\t\t\t\t\t'secondary' => '#6d6d6d',\n\t\t\t\t\t\t\t'borders'   => '#dcd7ca',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'header-footer' => array(\n\t\t\t\t\t\t\t'text'      => '#000000',\n\t\t\t\t\t\t\t'accent'    => '#cd2653',\n\t\t\t\t\t\t\t'secondary' => '#6d6d6d',\n\t\t\t\t\t\t\t'borders'   => '#dcd7ca',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'type'              => 'theme_mod',\n\t\t\t\t\t'transport'         => 'postMessage',\n\t\t\t\t\t'sanitize_callback' => array( __CLASS__, 'sanitize_accent_accessible_colors' ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Add the hue-only colorpicker for the accent color.\n\t\t\t$wp_customize->add_control(\n\t\t\t\tnew WP_Customize_Color_Control(\n\t\t\t\t\t$wp_customize,\n\t\t\t\t\t'accent_hue',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'section'         => 'colors',\n\t\t\t\t\t\t'settings'        => 'accent_hue',\n\t\t\t\t\t\t'description'     => __( 'Apply a custom color for links, buttons, featured images.', 'twentytwenty' ),\n\t\t\t\t\t\t'mode'            => 'hue',\n\t\t\t\t\t\t'active_callback' => function() use ( $wp_customize ) {\n\t\t\t\t\t\t\treturn ( 'custom' === $wp_customize->get_setting( 'accent_hue_active' )->value() );\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Update background color with postMessage, so inline CSS output is updated as well.\n\t\t\t$wp_customize->get_setting( 'background_color' )->transport = 'postMessage';\n\n\t\t\t/**\n\t\t\t * Theme Options\n\t\t\t */\n\n\t\t\t$wp_customize->add_section(\n\t\t\t\t'options',\n\t\t\t\tarray(\n\t\t\t\t\t'title'      => __( 'Theme Options', 'twentytwenty' ),\n\t\t\t\t\t'priority'   => 40,\n\t\t\t\t\t'capability' => 'edit_theme_options',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t/* Enable Header Search ----------------------------------------------- */\n\n\t\t\t$wp_customize->add_setting(\n\t\t\t\t'enable_header_search',\n\t\t\t\tarray(\n\t\t\t\t\t'capability'        => 'edit_theme_options',\n\t\t\t\t\t'default'           => true,\n\t\t\t\t\t'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_customize->add_control(\n\t\t\t\t'enable_header_search',\n\t\t\t\tarray(\n\t\t\t\t\t'type'     => 'checkbox',\n\t\t\t\t\t'section'  => 'options',\n\t\t\t\t\t'priority' => 10,\n\t\t\t\t\t'label'    => __( 'Show search in header', 'twentytwenty' ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t/* Show author bio ---------------------------------------------------- */\n\n\t\t\t$wp_customize->add_setting(\n\t\t\t\t'show_author_bio',\n\t\t\t\tarray(\n\t\t\t\t\t'capability'        => 'edit_theme_options',\n\t\t\t\t\t'default'           => true,\n\t\t\t\t\t'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_customize->add_control(\n\t\t\t\t'show_author_bio',\n\t\t\t\tarray(\n\t\t\t\t\t'type'     => 'checkbox',\n\t\t\t\t\t'section'  => 'options',\n\t\t\t\t\t'priority' => 10,\n\t\t\t\t\t'label'    => __( 'Show author bio', 'twentytwenty' ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t/* Display full content or excerpts on the blog and archives --------- */\n\n\t\t\t$wp_customize->add_setting(\n\t\t\t\t'blog_content',\n\t\t\t\tarray(\n\t\t\t\t\t'capability'        => 'edit_theme_options',\n\t\t\t\t\t'default'           => 'full',\n\t\t\t\t\t'sanitize_callback' => array( __CLASS__, 'sanitize_select' ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_customize->add_control(\n\t\t\t\t'blog_content',\n\t\t\t\tarray(\n\t\t\t\t\t'type'     => 'radio',\n\t\t\t\t\t'section'  => 'options',\n\t\t\t\t\t'priority' => 10,\n\t\t\t\t\t'label'    => __( 'On archive pages, posts show:', 'twentytwenty' ),\n\t\t\t\t\t'choices'  => array(\n\t\t\t\t\t\t'full'    => __( 'Full text', 'twentytwenty' ),\n\t\t\t\t\t\t'summary' => __( 'Summary', 'twentytwenty' ),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Template: Cover Template.\n\t\t\t */\n\t\t\t$wp_customize->add_section(\n\t\t\t\t'cover_template_options',\n\t\t\t\tarray(\n\t\t\t\t\t'title'       => __( 'Cover Template', 'twentytwenty' ),\n\t\t\t\t\t'capability'  => 'edit_theme_options',\n\t\t\t\t\t'description' => __( 'Settings for the \"Cover Template\" page template. Add a featured image to use as background.', 'twentytwenty' ),\n\t\t\t\t\t'priority'    => 42,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t/* Overlay Fixed Background ------ */\n\n\t\t\t$wp_customize->add_setting(\n\t\t\t\t'cover_template_fixed_background',\n\t\t\t\tarray(\n\t\t\t\t\t'capability'        => 'edit_theme_options',\n\t\t\t\t\t'default'           => true,\n\t\t\t\t\t'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ),\n\t\t\t\t\t'transport'         => 'postMessage',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_customize->add_control(\n\t\t\t\t'cover_template_fixed_background',\n\t\t\t\tarray(\n\t\t\t\t\t'type'        => 'checkbox',\n\t\t\t\t\t'section'     => 'cover_template_options',\n\t\t\t\t\t'label'       => __( 'Fixed Background Image', 'twentytwenty' ),\n\t\t\t\t\t'description' => __( 'Creates a parallax effect when the visitor scrolls.', 'twentytwenty' ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_customize->selective_refresh->add_partial(\n\t\t\t\t'cover_template_fixed_background',\n\t\t\t\tarray(\n\t\t\t\t\t'selector' => '.cover-header',\n\t\t\t\t\t'type'     => 'cover_fixed',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t/* Separator --------------------- */\n\n\t\t\t$wp_customize->add_setting(\n\t\t\t\t'cover_template_separator_1',\n\t\t\t\tarray(\n\t\t\t\t\t'sanitize_callback' => 'wp_filter_nohtml_kses',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_customize->add_control(\n\t\t\t\tnew TwentyTwenty_Separator_Control(\n\t\t\t\t\t$wp_customize,\n\t\t\t\t\t'cover_template_separator_1',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'section' => 'cover_template_options',\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t/* Overlay Background Color ------ */\n\n\t\t\t$wp_customize->add_setting(\n\t\t\t\t'cover_template_overlay_background_color',\n\t\t\t\tarray(\n\t\t\t\t\t'default'           => twentytwenty_get_color_for_area( 'content', 'accent' ),\n\t\t\t\t\t'sanitize_callback' => 'sanitize_hex_color',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_customize->add_control(\n\t\t\t\tnew WP_Customize_Color_Control(\n\t\t\t\t\t$wp_customize,\n\t\t\t\t\t'cover_template_overlay_background_color',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'label'       => __( 'Overlay Background Color', 'twentytwenty' ),\n\t\t\t\t\t\t'description' => __( 'The color used for the overlay. Defaults to the accent color.', 'twentytwenty' ),\n\t\t\t\t\t\t'section'     => 'cover_template_options',\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t/* Overlay Text Color ------------ */\n\n\t\t\t$wp_customize->add_setting(\n\t\t\t\t'cover_template_overlay_text_color',\n\t\t\t\tarray(\n\t\t\t\t\t'default'           => '#ffffff',\n\t\t\t\t\t'sanitize_callback' => 'sanitize_hex_color',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_customize->add_control(\n\t\t\t\tnew WP_Customize_Color_Control(\n\t\t\t\t\t$wp_customize,\n\t\t\t\t\t'cover_template_overlay_text_color',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'label'       => __( 'Overlay Text Color', 'twentytwenty' ),\n\t\t\t\t\t\t'description' => __( 'The color used for the text in the overlay.', 'twentytwenty' ),\n\t\t\t\t\t\t'section'     => 'cover_template_options',\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t/* Overlay Color Opacity --------- */\n\n\t\t\t$wp_customize->add_setting(\n\t\t\t\t'cover_template_overlay_opacity',\n\t\t\t\tarray(\n\t\t\t\t\t'default'           => 80,\n\t\t\t\t\t'sanitize_callback' => 'absint',\n\t\t\t\t\t'transport'         => 'postMessage',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_customize->add_control(\n\t\t\t\t'cover_template_overlay_opacity',\n\t\t\t\tarray(\n\t\t\t\t\t'label'       => __( 'Overlay Opacity', 'twentytwenty' ),\n\t\t\t\t\t'description' => __( 'Make sure that the contrast is high enough so that the text is readable.', 'twentytwenty' ),\n\t\t\t\t\t'section'     => 'cover_template_options',\n\t\t\t\t\t'type'        => 'range',\n\t\t\t\t\t'input_attrs' => twentytwenty_customize_opacity_range(),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_customize->selective_refresh->add_partial(\n\t\t\t\t'cover_template_overlay_opacity',\n\t\t\t\tarray(\n\t\t\t\t\t'selector' => '.cover-color-overlay',\n\t\t\t\t\t'type'     => 'cover_opacity',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Sanitization callback for the \"accent_accessible_colors\" setting.\n\t\t *\n\t\t * @static\n\t\t * @access public\n\t\t * @since Twenty Twenty 1.0\n\t\t * @param array $value The value we want to sanitize.\n\t\t * @return array Returns sanitized value. Each item in the array gets sanitized separately.\n\t\t */\n\t\tpublic static function sanitize_accent_accessible_colors( $value ) {\n\n\t\t\t// Make sure the value is an array. Do not typecast, use empty array as fallback.\n\t\t\t$value = is_array( $value ) ? $value : array();\n\n\t\t\t// Loop values.\n\t\t\tforeach ( $value as $area => $values ) {\n\t\t\t\tforeach ( $values as $context => $color_val ) {\n\t\t\t\t\t$value[ $area ][ $context ] = sanitize_hex_color( $color_val );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $value;\n\t\t}\n\n\t\t/**\n\t\t * Sanitize select.\n\t\t *\n\t\t * @param string $input The input from the setting.\n\t\t * @param object $setting The selected setting.\n\t\t * @return string The input from the setting or the default setting.\n\t\t */\n\t\tpublic static function sanitize_select( $input, $setting ) {\n\t\t\t$input   = sanitize_key( $input );\n\t\t\t$choices = $setting->manager->get_control( $setting->id )->choices;\n\t\t\treturn ( array_key_exists( $input, $choices ) ? $input : $setting->default );\n\t\t}\n\n\t\t/**\n\t\t * Sanitize boolean for checkbox.\n\t\t *\n\t\t * @param bool $checked Whether or not a box is checked.\n\t\t * @return bool\n\t\t */\n\t\tpublic static function sanitize_checkbox( $checked ) {\n\t\t\treturn ( ( isset( $checked ) && true === $checked ) ? true : false );\n\t\t}\n\n\t}\n\n\t// Setup the Theme Customizer settings and controls.\n\tadd_action( 'customize_register', array( 'TwentyTwenty_Customize', 'register' ) );\n\n}\n\n/**\n * PARTIAL REFRESH FUNCTIONS\n * */\nif ( ! function_exists( 'twentytwenty_customize_partial_blogname' ) ) {\n\t/**\n\t * Render the site title for the selective refresh partial.\n\t */\n\tfunction twentytwenty_customize_partial_blogname() {\n\t\tbloginfo( 'name' );\n\t}\n}\n\nif ( ! function_exists( 'twentytwenty_customize_partial_blogdescription' ) ) {\n\t/**\n\t * Render the site description for the selective refresh partial.\n\t */\n\tfunction twentytwenty_customize_partial_blogdescription() {\n\t\tbloginfo( 'description' );\n\t}\n}\n\nif ( ! function_exists( 'twentytwenty_customize_partial_site_logo' ) ) {\n\t/**\n\t * Render the site logo for the selective refresh partial.\n\t *\n\t * Doing it this way so we don't have issues with `render_callback`'s arguments.\n\t */\n\tfunction twentytwenty_customize_partial_site_logo() {\n\t\ttwentytwenty_site_logo();\n\t}\n}\n\n\n/**\n * Input attributes for cover overlay opacity option.\n *\n * @return array Array containing attribute names and their values.\n */\nfunction twentytwenty_customize_opacity_range() {\n\t/**\n\t * Filter the input attributes for opacity\n\t *\n\t * @param array $attrs {\n\t *     The attributes\n\t *\n\t *     @type int $min Minimum value\n\t *     @type int $max Maximum value\n\t *     @type int $step Interval between numbers\n\t * }\n\t */\n\treturn apply_filters(\n\t\t'twentytwenty_customize_opacity_range',\n\t\tarray(\n\t\t\t'min'  => 0,\n\t\t\t'max'  => 90,\n\t\t\t'step' => 5,\n\t\t)\n\t);\n}\n", "num_lines": 525}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Non-latin language handling.\n *\n * Handle non-latin language styles.\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\nif ( ! class_exists( 'TwentyTwenty_Non_Latin_Languages' ) ) {\n\t/**\n\t * Language handling.\n\t */\n\tclass TwentyTwenty_Non_Latin_Languages {\n\n\t\t/**\n\t\t * Get custom CSS.\n\t\t *\n\t\t * Return CSS for non-latin language, if available, or null\n\t\t *\n\t\t * @param string $type Whether to return CSS for the \"front-end\", \"block-editor\" or \"classic-editor\".\n\t\t * @return void\n\t\t */\n\t\tpublic static function get_non_latin_css( $type = 'front-end' ) {\n\n\t\t\t// Fetch site locale.\n\t\t\t$locale = get_bloginfo( 'language' );\n\n\t\t\t// Define fallback fonts for non-latin languages.\n\t\t\t$font_family = apply_filters(\n\t\t\t\t'twentytwenty_get_localized_font_family_types',\n\t\t\t\tarray(\n\n\t\t\t\t\t// Arabic.\n\t\t\t\t\t'ar'    => array( 'Tahoma', 'Arial', 'sans-serif' ),\n\t\t\t\t\t'ary'   => array( 'Tahoma', 'Arial', 'sans-serif' ),\n\t\t\t\t\t'azb'   => array( 'Tahoma', 'Arial', 'sans-serif' ),\n\t\t\t\t\t'ckb'   => array( 'Tahoma', 'Arial', 'sans-serif' ),\n\t\t\t\t\t'fa-IR' => array( 'Tahoma', 'Arial', 'sans-serif' ),\n\t\t\t\t\t'haz'   => array( 'Tahoma', 'Arial', 'sans-serif' ),\n\t\t\t\t\t'ps'    => array( 'Tahoma', 'Arial', 'sans-serif' ),\n\n\t\t\t\t\t// Chinese Simplified (China) - Noto Sans SC.\n\t\t\t\t\t'zh-CN' => array( '\\'PingFang SC\\'', '\\'Helvetica Neue\\'', '\\'Microsoft YaHei New\\'', '\\'STHeiti Light\\'', 'sans-serif' ),\n\n\t\t\t\t\t// Chinese Traditional (Taiwan) - Noto Sans TC.\n\t\t\t\t\t'zh-TW' => array( '\\'PingFang TC\\'', '\\'Helvetica Neue\\'', '\\'Microsoft YaHei New\\'', '\\'STHeiti Light\\'', 'sans-serif' ),\n\n\t\t\t\t\t// Chinese (Hong Kong) - Noto Sans HK.\n\t\t\t\t\t'zh-HK' => array( '\\'PingFang HK\\'', '\\'Helvetica Neue\\'', '\\'Microsoft YaHei New\\'', '\\'STHeiti Light\\'', 'sans-serif' ),\n\n\t\t\t\t\t// Cyrillic.\n\t\t\t\t\t'bel'   => array( '\\'Helvetica Neue\\'', 'Helvetica', '\\'Segoe UI\\'', 'Arial', 'sans-serif' ),\n\t\t\t\t\t'bg-BG' => array( '\\'Helvetica Neue\\'', 'Helvetica', '\\'Segoe UI\\'', 'Arial', 'sans-serif' ),\n\t\t\t\t\t'kk'    => array( '\\'Helvetica Neue\\'', 'Helvetica', '\\'Segoe UI\\'', 'Arial', 'sans-serif' ),\n\t\t\t\t\t'mk-MK' => array( '\\'Helvetica Neue\\'', 'Helvetica', '\\'Segoe UI\\'', 'Arial', 'sans-serif' ),\n\t\t\t\t\t'mn'    => array( '\\'Helvetica Neue\\'', 'Helvetica', '\\'Segoe UI\\'', 'Arial', 'sans-serif' ),\n\t\t\t\t\t'ru-RU' => array( '\\'Helvetica Neue\\'', 'Helvetica', '\\'Segoe UI\\'', 'Arial', 'sans-serif' ),\n\t\t\t\t\t'sah'   => array( '\\'Helvetica Neue\\'', 'Helvetica', '\\'Segoe UI\\'', 'Arial', 'sans-serif' ),\n\t\t\t\t\t'sr-RS' => array( '\\'Helvetica Neue\\'', 'Helvetica', '\\'Segoe UI\\'', 'Arial', 'sans-serif' ),\n\t\t\t\t\t'tt-RU' => array( '\\'Helvetica Neue\\'', 'Helvetica', '\\'Segoe UI\\'', 'Arial', 'sans-serif' ),\n\t\t\t\t\t'uk'    => array( '\\'Helvetica Neue\\'', 'Helvetica', '\\'Segoe UI\\'', 'Arial', 'sans-serif' ),\n\n\t\t\t\t\t// Devanagari.\n\t\t\t\t\t'bn-BD' => array( 'Arial', 'sans-serif' ),\n\t\t\t\t\t'hi-IN' => array( 'Arial', 'sans-serif' ),\n\t\t\t\t\t'mr'    => array( 'Arial', 'sans-serif' ),\n\t\t\t\t\t'ne-NP' => array( 'Arial', 'sans-serif' ),\n\n\t\t\t\t\t// Greek.\n\t\t\t\t\t'el'    => array( '\\'Helvetica Neue\\', Helvetica, Arial, sans-serif' ),\n\n\t\t\t\t\t// Gujarati.\n\t\t\t\t\t'gu'    => array( 'Arial', 'sans-serif' ),\n\n\t\t\t\t\t// Hebrew.\n\t\t\t\t\t'he-IL' => array( '\\'Arial Hebrew\\'', 'Arial', 'sans-serif' ),\n\n\t\t\t\t\t// Japanese.\n\t\t\t\t\t'ja'    => array( 'sans-serif' ),\n\n\t\t\t\t\t// Korean.\n\t\t\t\t\t'ko-KR' => array( '\\'Apple SD Gothic Neo\\'', '\\'Malgun Gothic\\'', '\\'Nanum Gothic\\'', 'Dotum', 'sans-serif' ),\n\n\t\t\t\t\t// Thai.\n\t\t\t\t\t'th'    => array( '\\'Sukhumvit Set\\'', '\\'Helvetica Neue\\'', 'Helvetica', 'Arial', 'sans-serif' ),\n\n\t\t\t\t\t// Vietnamese.\n\t\t\t\t\t'vi'    => array( '\\'Libre Franklin\\'', 'sans-serif' ),\n\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Return if the selected language has no fallback fonts.\n\t\t\tif ( empty( $font_family[ $locale ] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Define elements to apply fallback fonts to.\n\t\t\t$elements = apply_filters(\n\t\t\t\t'twentytwenty_get_localized_font_family_elements',\n\t\t\t\tarray(\n\t\t\t\t\t'front-end'      => array( 'body', 'input', 'textarea', 'button', '.button', '.faux-button', '.wp-block-button__link', '.wp-block-file__button', '.has-drop-cap:not(:focus)::first-letter', '.has-drop-cap:not(:focus)::first-letter', '.entry-content .wp-block-archives', '.entry-content .wp-block-categories', '.entry-content .wp-block-cover-image', '.entry-content .wp-block-latest-comments', '.entry-content .wp-block-latest-posts', '.entry-content .wp-block-pullquote', '.entry-content .wp-block-quote.is-large', '.entry-content .wp-block-quote.is-style-large', '.entry-content .wp-block-archives *', '.entry-content .wp-block-categories *', '.entry-content .wp-block-latest-posts *', '.entry-content .wp-block-latest-comments *', '.entry-content p', '.entry-content ol', '.entry-content ul', '.entry-content dl', '.entry-content dt', '.entry-content cite', '.entry-content figcaption', '.entry-content .wp-caption-text', '.comment-content p', '.comment-content ol', '.comment-content ul', '.comment-content dl', '.comment-content dt', '.comment-content cite', '.comment-content figcaption', '.comment-content .wp-caption-text', '.widget_text p', '.widget_text ol', '.widget_text ul', '.widget_text dl', '.widget_text dt', '.widget-content .rssSummary', '.widget-content cite', '.widget-content figcaption', '.widget-content .wp-caption-text' ),\n\t\t\t\t\t'block-editor'   => array( '.editor-styles-wrapper > *', '.editor-styles-wrapper p', '.editor-styles-wrapper ol', '.editor-styles-wrapper ul', '.editor-styles-wrapper dl', '.editor-styles-wrapper dt', '.editor-post-title__block .editor-post-title__input', '.editor-styles-wrapper .wp-block h1', '.editor-styles-wrapper .wp-block h2', '.editor-styles-wrapper .wp-block h3', '.editor-styles-wrapper .wp-block h4', '.editor-styles-wrapper .wp-block h5', '.editor-styles-wrapper .wp-block h6', '.editor-styles-wrapper .has-drop-cap:not(:focus)::first-letter', '.editor-styles-wrapper cite', '.editor-styles-wrapper figcaption', '.editor-styles-wrapper .wp-caption-text' ),\n\t\t\t\t\t'classic-editor' => array( 'body#tinymce.wp-editor', 'body#tinymce.wp-editor p', 'body#tinymce.wp-editor ol', 'body#tinymce.wp-editor ul', 'body#tinymce.wp-editor dl', 'body#tinymce.wp-editor dt', 'body#tinymce.wp-editor figcaption', 'body#tinymce.wp-editor .wp-caption-text', 'body#tinymce.wp-editor .wp-caption-dd', 'body#tinymce.wp-editor cite', 'body#tinymce.wp-editor table' ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Return if the specified type doesn't exist.\n\t\t\tif ( empty( $elements[ $type ] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Return the specified styles.\n\t\t\treturn twentytwenty_generate_css( implode( ',', $elements[ $type ] ), 'font-family', implode( ',', $font_family[ $locale ] ), null, null, false );\n\n\t\t}\n\t}\n}\n", "num_lines": 122}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Javascript Loader Class\n *\n * Allow `async` and `defer` while enqueuing Javascript.\n *\n * Based on a solution in WP Rig.\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\nif ( ! class_exists( 'TwentyTwenty_Script_Loader' ) ) {\n\t/**\n\t * A class that provides a way to add `async` or `defer` attributes to scripts.\n\t */\n\tclass TwentyTwenty_Script_Loader {\n\n\t\t/**\n\t\t * Adds async/defer attributes to enqueued / registered scripts.\n\t\t *\n\t\t * If #12009 lands in WordPress, this function can no-op since it would be handled in core.\n\t\t *\n\t\t * @link https://core.trac.wordpress.org/ticket/12009\n\t\t *\n\t\t * @param string $tag    The script tag.\n\t\t * @param string $handle The script handle.\n\t\t * @return string Script HTML string.\n\t\t */\n\t\tpublic function filter_script_loader_tag( $tag, $handle ) {\n\t\t\tforeach ( array( 'async', 'defer' ) as $attr ) {\n\t\t\t\tif ( ! wp_scripts()->get_data( $handle, $attr ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Prevent adding attribute when already added in #12009.\n\t\t\t\tif ( ! preg_match( \":\\s$attr(=|>|\\s):\", $tag ) ) {\n\t\t\t\t\t$tag = preg_replace( ':(?=></script>):', \" $attr\", $tag, 1 );\n\t\t\t\t}\n\t\t\t\t// Only allow async or defer, not both.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn $tag;\n\t\t}\n\n\t}\n}\n", "num_lines": 48}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customizer Separator Control settings for this theme.\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\nif ( class_exists( 'WP_Customize_Control' ) ) {\n\n\tif ( ! class_exists( 'TwentyTwenty_Separator_Control' ) ) {\n\t\t/**\n\t\t * Separator Control.\n\t\t */\n\t\tclass TwentyTwenty_Separator_Control extends WP_Customize_Control {\n\t\t\t/**\n\t\t\t * Render the hr.\n\t\t\t */\n\t\t\tpublic function render_content() {\n\t\t\t\techo '<hr/>';\n\t\t\t}\n\n\t\t}\n\t}\n}\n", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Custom icons for this theme.\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\nif ( ! class_exists( 'TwentyTwenty_SVG_Icons' ) ) {\n\t/**\n\t * SVG ICONS CLASS\n\t * Retrieve the SVG code for the specified icon. Based on a solution in Twenty Nineteen.\n\t */\n\tclass TwentyTwenty_SVG_Icons {\n\t\t/**\n\t\t * GET SVG CODE\n\t\t * Get the SVG code for the specified icon\n\t\t *\n\t\t * @param string $icon  Icon name.\n\t\t * @param string $group Icon group.\n\t\t * @param string $color Color.\n\t\t */\n\t\tpublic static function get_svg( $icon, $group = 'ui', $color = '#1A1A1B' ) {\n\t\t\tif ( 'ui' === $group ) {\n\t\t\t\t$arr = self::$ui_icons;\n\t\t\t} elseif ( 'social' === $group ) {\n\t\t\t\t$arr = self::$social_icons;\n\t\t\t} else {\n\t\t\t\t$arr = array();\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters Twenty Twenty's array of icons.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$group`, refers to\n\t\t\t * the name of the group of icons, either \"ui\" or \"social\".\n\t\t\t *\n\t\t\t * @since Twenty Twenty 1.5\n\t\t\t *\n\t\t\t * @param array $arr Array of icons.\n\t\t\t */\n\t\t\t$arr = apply_filters( \"twentytwenty_svg_icons_{$group}\", $arr );\n\n\t\t\t/**\n\t\t\t * Filters an SVG icon's color.\n\t\t\t *\n\t\t\t * @since Twenty Twenty 1.5\n\t\t\t *\n\t\t\t * @param string $color The icon color.\n\t\t\t * @param string $icon  The icon name.\n\t\t\t * @param string $group The icon group.\n\t\t\t */\n\t\t\t$color = apply_filters( 'twentytwenty_svg_icon_color', $color, $icon, $group );\n\n\t\t\tif ( array_key_exists( $icon, $arr ) ) {\n\t\t\t\t$repl = '<svg class=\"svg-icon\" aria-hidden=\"true\" role=\"img\" focusable=\"false\" ';\n\t\t\t\t$svg  = preg_replace( '/^<svg /', $repl, trim( $arr[ $icon ] ) ); // Add extra attributes to SVG code.\n\t\t\t\t$svg  = str_replace( '#1A1A1B', $color, $svg );   // Replace the color.\n\t\t\t\t$svg  = str_replace( '#', '%23', $svg );          // Urlencode hashes.\n\t\t\t\t$svg  = preg_replace( \"/([\\n\\t]+)/\", ' ', $svg ); // Remove newlines & tabs.\n\t\t\t\t$svg  = preg_replace( '/>\\s*</', '><', $svg );    // Remove whitespace between SVG tags.\n\t\t\t\treturn $svg;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * GET SOCIAL LINK SVG\n\t\t * Detects the social network from a URL and returns the SVG code for its icon.\n\t\t *\n\t\t * @param string $uri The URL to retrieve SVG for.\n\t\t */\n\t\tpublic static function get_social_link_svg( $uri ) {\n\t\t\tstatic $regex_map; // Only compute regex map once, for performance.\n\t\t\tif ( ! isset( $regex_map ) ) {\n\t\t\t\t$regex_map = array();\n\n\t\t\t\t/**\n\t\t\t\t * Filters Twenty Twenty's array of domain mappings for social icons.\n\t\t\t\t *\n\t\t\t\t * By default, each Icon ID is matched against a .com TLD. To override this behavior,\n\t\t\t\t * specify all the domains it covers (including the .com TLD too, if applicable).\n\t\t\t\t *\n\t\t\t\t * @since Twenty Twenty 1.5\n\t\t\t\t *\n\t\t\t\t * @param array $social_icons_map Array of default social icons.\n\t\t\t\t */\n\t\t\t\t$map = apply_filters( 'twentytwenty_social_icons_map', self::$social_icons_map );\n\n\t\t\t\t/**\n\t\t\t\t * Filters Twenty Twenty's array of social icons.\n\t\t\t\t *\n\t\t\t\t * @since Twenty Twenty 1.5\n\t\t\t\t *\n\t\t\t\t * @param array $social_icons Array of default social icons.\n\t\t\t\t */\n\t\t\t\t$social_icons = apply_filters( 'twentytwenty_svg_icons_social', self::$social_icons );\n\n\t\t\t\tforeach ( array_keys( $social_icons ) as $icon ) {\n\t\t\t\t\t$domains            = array_key_exists( $icon, $map ) ? $map[ $icon ] : array( sprintf( '%s.com', $icon ) );\n\t\t\t\t\t$domains            = array_map( 'trim', $domains ); // Remove leading/trailing spaces, to prevent regex from failing to match.\n\t\t\t\t\t$domains            = array_map( 'preg_quote', $domains );\n\t\t\t\t\t$regex_map[ $icon ] = sprintf( '/(%s)/i', implode( '|', $domains ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ( $regex_map as $icon => $regex ) {\n\t\t\t\tif ( preg_match( $regex, $uri ) ) {\n\t\t\t\t\treturn twentytwenty_get_theme_svg( $icon, 'social' );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * ICON STORAGE\n\t\t * Store the code for all SVGs in an array.\n\t\t *\n\t\t * @var array\n\t\t */\n\t\tpublic static $ui_icons = array(\n\t\t\t'arrow-down'         => '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"22\" height=\"24\" viewBox=\"0 0 22 24\">\n\t\t<polygon fill=\"#FFF\" points=\"721.105 856 721.105 874.315 728.083 867.313 730.204 869.41 719.59 880 709 869.41 711.074 867.313 718.076 874.315 718.076 856\" transform=\"translate(-709 -856)\"/>\n\t\t</svg>',\n\t\t\t'arrow-down-circled' => '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 32 32\">\n\t\t<path fill=\"#FFF\" fill-rule=\"evenodd\" d=\"M16,32 C7.163444,32 0,24.836556 0,16 C0,7.163444 7.163444,0 16,0 C24.836556,0 32,7.163444 32,16 C32,24.836556 24.836556,32 16,32 Z M16.7934656,8 L15.4886113,8 L15.4886113,21.5300971 L10.082786,16.1242718 L9.18181515,17.0407767 L16.1410384,24 L23.1157957,17.0407767 L22.1915239,16.1242718 L16.7934656,21.5300971 L16.7934656,8 Z\"/>\n\t\t</svg>',\n\t\t\t'bookmark'           => '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"18\" viewBox=\"0 0 15 18\">\n\t\t<path d=\"M12.598889,2.699762 C12.598889,2.20275 12.195981,1.799841 11.698969,1.799841 L2.699762,1.799841 C2.20275,1.799841 1.799841,2.20275 1.799841,2.699762 L1.799841,15.349777 L6.676297,11.866594 C6.989197,11.643094 7.409533,11.643094 7.722434,11.866594 L12.598889,15.349777 L12.598889,2.699762 Z M1.422989,17.830788 C0.82736,18.256238 0,17.830464 0,17.098493 L0,2.699762 C0,1.208725 1.208725,0 2.699762,0 L11.698969,0 C13.190006,0 14.398731,1.208725 14.398731,2.699762 L14.398731,17.098493 C14.398731,17.830464 13.571371,18.256238 12.975742,17.830788 L7.199365,13.704805 L1.422989,17.830788 Z\"/>\n\t\t</svg>',\n\t\t\t'calendar'           => '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"19\" viewBox=\"0 0 18 19\">\n\t\t<path fill=\"#1A1A1B\" d=\"M4.60069444,4.09375 L3.25,4.09375 C2.47334957,4.09375 1.84375,4.72334957 1.84375,5.5 L1.84375,7.26736111 L16.15625,7.26736111 L16.15625,5.5 C16.15625,4.72334957 15.5266504,4.09375 14.75,4.09375 L13.3993056,4.09375 L13.3993056,4.55555556 C13.3993056,5.02154581 13.0215458,5.39930556 12.5555556,5.39930556 C12.0895653,5.39930556 11.7118056,5.02154581 11.7118056,4.55555556 L11.7118056,4.09375 L6.28819444,4.09375 L6.28819444,4.55555556 C6.28819444,5.02154581 5.9104347,5.39930556 5.44444444,5.39930556 C4.97845419,5.39930556 4.60069444,5.02154581 4.60069444,4.55555556 L4.60069444,4.09375 Z M6.28819444,2.40625 L11.7118056,2.40625 L11.7118056,1 C11.7118056,0.534009742 12.0895653,0.15625 12.5555556,0.15625 C13.0215458,0.15625 13.3993056,0.534009742 13.3993056,1 L13.3993056,2.40625 L14.75,2.40625 C16.4586309,2.40625 17.84375,3.79136906 17.84375,5.5 L17.84375,15.875 C17.84375,17.5836309 16.4586309,18.96875 14.75,18.96875 L3.25,18.96875 C1.54136906,18.96875 0.15625,17.5836309 0.15625,15.875 L0.15625,5.5 C0.15625,3.79136906 1.54136906,2.40625 3.25,2.40625 L4.60069444,2.40625 L4.60069444,1 C4.60069444,0.534009742 4.97845419,0.15625 5.44444444,0.15625 C5.9104347,0.15625 6.28819444,0.534009742 6.28819444,1 L6.28819444,2.40625 Z M1.84375,8.95486111 L1.84375,15.875 C1.84375,16.6516504 2.47334957,17.28125 3.25,17.28125 L14.75,17.28125 C15.5266504,17.28125 16.15625,16.6516504 16.15625,15.875 L16.15625,8.95486111 L1.84375,8.95486111 Z\"/>\n\t\t</svg>',\n\t\t\t'chevron-down'       => '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"12\" viewBox=\"0 0 20 12\">\n\t\t<polygon fill=\"#1A1A1B\" fill-rule=\"evenodd\" points=\"1319.899 365.778 1327.678 358 1329.799 360.121 1319.899 370.021 1310 360.121 1312.121 358\" transform=\"translate(-1310 -358)\"/>\n\t\t</svg>',\n\t\t\t'comment'            => '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"19\" height=\"19\" viewBox=\"0 0 19 19\">\n\t\t<path d=\"M9.43016863,13.2235931 C9.58624731,13.094699 9.7823475,13.0241935 9.98476849,13.0241935 L15.0564516,13.0241935 C15.8581553,13.0241935 16.5080645,12.3742843 16.5080645,11.5725806 L16.5080645,3.44354839 C16.5080645,2.64184472 15.8581553,1.99193548 15.0564516,1.99193548 L3.44354839,1.99193548 C2.64184472,1.99193548 1.99193548,2.64184472 1.99193548,3.44354839 L1.99193548,11.5725806 C1.99193548,12.3742843 2.64184472,13.0241935 3.44354839,13.0241935 L5.76612903,13.0241935 C6.24715123,13.0241935 6.63709677,13.4141391 6.63709677,13.8951613 L6.63709677,15.5301903 L9.43016863,13.2235931 Z M3.44354839,14.766129 C1.67980032,14.766129 0.25,13.3363287 0.25,11.5725806 L0.25,3.44354839 C0.25,1.67980032 1.67980032,0.25 3.44354839,0.25 L15.0564516,0.25 C16.8201997,0.25 18.25,1.67980032 18.25,3.44354839 L18.25,11.5725806 C18.25,13.3363287 16.8201997,14.766129 15.0564516,14.766129 L10.2979143,14.766129 L6.32072889,18.0506004 C5.75274472,18.5196577 4.89516129,18.1156602 4.89516129,17.3790323 L4.89516129,14.766129 L3.44354839,14.766129 Z\"/>\n\t\t</svg>',\n\t\t\t'cross'              => '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\">\n\t\t<polygon fill=\"#1A1A1B\" fill-rule=\"evenodd\" points=\"6.852 7.649 .399 1.195 1.445 .149 7.899 6.602 14.352 .149 15.399 1.195 8.945 7.649 15.399 14.102 14.352 15.149 7.899 8.695 1.445 15.149 .399 14.102\"/>\n\t\t</svg>',\n\t\t\t'ellipsis'           => '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"26\" height=\"7\" viewBox=\"0 0 26 7\">\n\t\t<path fill-rule=\"evenodd\" d=\"M332.5,45 C330.567003,45 329,43.4329966 329,41.5 C329,39.5670034 330.567003,38 332.5,38 C334.432997,38 336,39.5670034 336,41.5 C336,43.4329966 334.432997,45 332.5,45 Z M342,45 C340.067003,45 338.5,43.4329966 338.5,41.5 C338.5,39.5670034 340.067003,38 342,38 C343.932997,38 345.5,39.5670034 345.5,41.5 C345.5,43.4329966 343.932997,45 342,45 Z M351.5,45 C349.567003,45 348,43.4329966 348,41.5 C348,39.5670034 349.567003,38 351.5,38 C353.432997,38 355,39.5670034 355,41.5 C355,43.4329966 353.432997,45 351.5,45 Z\" transform=\"translate(-329 -38)\"/>\n\t\t</svg>',\n\t\t\t'edit'               => '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 18 18\">\n\t\t<path fill=\"#1A1A1B\" d=\"M14.7272727,11.1763636 C14.7272727,10.7244943 15.0935852,10.3581818 15.5454545,10.3581818 C15.9973239,10.3581818 16.3636364,10.7244943 16.3636364,11.1763636 L16.3636364,15.5454545 C16.3636364,16.9010626 15.2646989,18 13.9090909,18 L2.45454545,18 C1.09893743,18 0,16.9010626 0,15.5454545 L0,4.09090909 C0,2.73530107 1.09893743,1.63636364 2.45454545,1.63636364 L6.82363636,1.63636364 C7.2755057,1.63636364 7.64181818,2.00267611 7.64181818,2.45454545 C7.64181818,2.9064148 7.2755057,3.27272727 6.82363636,3.27272727 L2.45454545,3.27272727 C2.00267611,3.27272727 1.63636364,3.63903975 1.63636364,4.09090909 L1.63636364,15.5454545 C1.63636364,15.9973239 2.00267611,16.3636364 2.45454545,16.3636364 L13.9090909,16.3636364 C14.3609602,16.3636364 14.7272727,15.9973239 14.7272727,15.5454545 L14.7272727,11.1763636 Z M6.54545455,9.33890201 L6.54545455,11.4545455 L8.66109799,11.4545455 L16.0247344,4.09090909 L13.9090909,1.97526564 L6.54545455,9.33890201 Z M14.4876328,0.239639906 L17.7603601,3.51236718 C18.07988,3.83188705 18.07988,4.34993113 17.7603601,4.669451 L9.57854191,12.8512692 C9.42510306,13.004708 9.21699531,13.0909091 9,13.0909091 L5.72727273,13.0909091 C5.27540339,13.0909091 4.90909091,12.7245966 4.90909091,12.2727273 L4.90909091,9 C4.90909091,8.78300469 4.99529196,8.57489694 5.14873082,8.42145809 L13.330549,0.239639906 C13.6500689,-0.0798799688 14.1681129,-0.0798799688 14.4876328,0.239639906 Z\"/>\n\t\t</svg>',\n\t\t\t'folder'             => '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"19\" viewBox=\"0 0 20 19\">\n\t\t<path fill=\"#1A1A1B\" d=\"M2.8,1.85 C2.275329,1.85 1.85,2.27532949 1.85,2.8 L1.85,15.4 C1.85,15.9246705 2.275329,16.35 2.8,16.35 L17.2,16.35 C17.724671,16.35 18.15,15.9246705 18.15,15.4 L18.15,5.5 C18.15,4.97532949 17.724671,4.55 17.2,4.55 L9.1,4.55 C8.8158,4.55 8.550403,4.40796403 8.392757,4.17149517 L6.845094,1.85 L2.8,1.85 Z M17.2,2.85 C18.663555,2.85 19.85,4.03644541 19.85,5.5 L19.85,15.4 C19.85,16.8635546 18.663555,18.05 17.2,18.05 L2.8,18.05 C1.336445,18.05 0.15,16.8635546 0.15,15.4 L0.15,2.8 C0.15,1.33644541 1.336445,0.15 2.8,0.15 L7.3,0.15 C7.5842,0.15 7.849597,0.292035965 8.007243,0.528504833 L9.554906,2.85 L17.2,2.85 Z\"/>\n\t\t</svg>',\n\t\t\t'link'               => '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 18 18\">\n\t\t<path d=\"M6.70846497,10.3082552 C6.43780491,9.94641406 6.5117218,9.43367048 6.87356298,9.16301045 C7.23540415,8.89235035 7.74814771,8.96626726 8.01880776,9.32810842 C8.5875786,10.0884893 9.45856383,10.5643487 10.4057058,10.6321812 C11.3528479,10.7000136 12.2827563,10.3531306 12.9541853,9.68145807 L15.3987642,7.23705399 C16.6390369,5.9529049 16.6212992,3.91168563 15.3588977,2.6492841 C14.0964962,1.38688258 12.0552769,1.36914494 10.77958,2.60113525 L9.37230725,4.00022615 C9.05185726,4.31881314 8.53381538,4.31730281 8.21522839,3.99685275 C7.89664141,3.67640269 7.89815174,3.15836082 8.21860184,2.83977385 L9.63432671,1.43240056 C11.5605503,-0.42800847 14.6223793,-0.401402004 16.5159816,1.49220028 C18.4095838,3.38580256 18.4361903,6.44763148 16.5658147,8.38399647 L14.1113741,10.838437 C13.1043877,11.8457885 11.7095252,12.366113 10.2888121,12.2643643 C8.86809903,12.1626156 7.56162126,11.4488264 6.70846497,10.3082552 Z M11.291535,7.6917448 C11.5621951,8.05358597 11.4882782,8.56632952 11.126437,8.83698955 C10.7645959,9.10764965 10.2518523,9.03373274 9.98119227,8.67189158 C9.4124214,7.91151075 8.54143617,7.43565129 7.59429414,7.36781884 C6.6471521,7.29998638 5.71724372,7.64686937 5.04581464,8.31854193 L2.60123581,10.762946 C1.36096312,12.0470951 1.37870076,14.0883144 2.64110228,15.3507159 C3.90350381,16.6131174 5.94472309,16.630855 7.21873082,15.400549 L8.61782171,14.0014581 C8.93734159,13.6819382 9.45538568,13.6819382 9.77490556,14.0014581 C10.0944254,14.320978 10.0944254,14.839022 9.77490556,15.1585419 L8.36567329,16.5675994 C6.43944966,18.4280085 3.37762074,18.401402 1.48401846,16.5077998 C-0.409583822,14.6141975 -0.436190288,11.5523685 1.43418536,9.61600353 L3.88862594,7.16156298 C4.89561225,6.15421151 6.29047483,5.63388702 7.71118789,5.7356357 C9.13190097,5.83738438 10.4383788,6.55117356 11.291535,7.6917448 Z\"/>\n\t\t</svg>',\n\t\t\t'search'             => '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"23\" height=\"23\" viewBox=\"0 0 23 23\">\n\t\t<path d=\"M38.710696,48.0601792 L43,52.3494831 L41.3494831,54 L37.0601792,49.710696 C35.2632422,51.1481185 32.9839107,52.0076499 30.5038249,52.0076499 C24.7027226,52.0076499 20,47.3049272 20,41.5038249 C20,35.7027226 24.7027226,31 30.5038249,31 C36.3049272,31 41.0076499,35.7027226 41.0076499,41.5038249 C41.0076499,43.9839107 40.1481185,46.2632422 38.710696,48.0601792 Z M36.3875844,47.1716785 C37.8030221,45.7026647 38.6734666,43.7048964 38.6734666,41.5038249 C38.6734666,36.9918565 35.0157934,33.3341833 30.5038249,33.3341833 C25.9918565,33.3341833 22.3341833,36.9918565 22.3341833,41.5038249 C22.3341833,46.0157934 25.9918565,49.6734666 30.5038249,49.6734666 C32.7048964,49.6734666 34.7026647,48.8030221 36.1716785,47.3875844 C36.2023931,47.347638 36.2360451,47.3092237 36.2726343,47.2726343 C36.3092237,47.2360451 36.347638,47.2023931 36.3875844,47.1716785 Z\" transform=\"translate(-20 -31)\"/>\n\t\t</svg>',\n\t\t\t'tag'                => '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 18 18\">\n\t\t<path fill=\"#1A1A1B\" d=\"M15.4496399,8.42490555 L8.66109799,1.63636364 L1.63636364,1.63636364 L1.63636364,8.66081885 L8.42522727,15.44178 C8.57869221,15.5954158 8.78693789,15.6817418 9.00409091,15.6817418 C9.22124393,15.6817418 9.42948961,15.5954158 9.58327627,15.4414581 L15.4486339,9.57610048 C15.7651495,9.25692435 15.7649133,8.74206554 15.4496399,8.42490555 Z M16.6084423,10.7304545 L10.7406818,16.59822 C10.280287,17.0591273 9.65554997,17.3181054 9.00409091,17.3181054 C8.35263185,17.3181054 7.72789481,17.0591273 7.26815877,16.5988788 L0.239976954,9.57887876 C0.0863319284,9.4254126 0,9.21716044 0,9 L0,0.818181818 C0,0.366312477 0.366312477,0 0.818181818,0 L9,0 C9.21699531,0 9.42510306,0.0862010512 9.57854191,0.239639906 L16.6084423,7.26954545 C17.5601275,8.22691012 17.5601275,9.77308988 16.6084423,10.7304545 Z M5,6 C4.44771525,6 4,5.55228475 4,5 C4,4.44771525 4.44771525,4 5,4 C5.55228475,4 6,4.44771525 6,5 C6,5.55228475 5.55228475,6 5,6 Z\"/>\n\t\t</svg>',\n\t\t\t'user'               => '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"20\" viewBox=\"0 0 18 20\">\n\t\t<path fill=\"#1A1A1B\" d=\"M18,19 C18,19.5522847 17.5522847,20 17,20 C16.4477153,20 16,19.5522847 16,19 L16,17 C16,15.3431458 14.6568542,14 13,14 L5,14 C3.34314575,14 2,15.3431458 2,17 L2,19 C2,19.5522847 1.55228475,20 1,20 C0.44771525,20 0,19.5522847 0,19 L0,17 C0,14.2385763 2.23857625,12 5,12 L13,12 C15.7614237,12 18,14.2385763 18,17 L18,19 Z M9,10 C6.23857625,10 4,7.76142375 4,5 C4,2.23857625 6.23857625,0 9,0 C11.7614237,0 14,2.23857625 14,5 C14,7.76142375 11.7614237,10 9,10 Z M9,8 C10.6568542,8 12,6.65685425 12,5 C12,3.34314575 10.6568542,2 9,2 C7.34314575,2 6,3.34314575 6,5 C6,6.65685425 7.34314575,8 9,8 Z\"/>\n\t\t</svg>',\n\t\t);\n\n\t\t/**\n\t\t * Social Icons \u00e2\u20ac\u201c domain mappings.\n\t\t *\n\t\t * By default, each Icon ID is matched against a .com TLD. To override this behavior,\n\t\t * specify all the domains it covers (including the .com TLD too, if applicable).\n\t\t *\n\t\t * @var array\n\t\t */\n\t\tpublic static $social_icons_map = array(\n\t\t\t'amazon'    => array(\n\t\t\t\t'amazon.com',\n\t\t\t\t'amazon.cn',\n\t\t\t\t'amazon.in',\n\t\t\t\t'amazon.fr',\n\t\t\t\t'amazon.de',\n\t\t\t\t'amazon.it',\n\t\t\t\t'amazon.nl',\n\t\t\t\t'amazon.es',\n\t\t\t\t'amazon.co',\n\t\t\t\t'amazon.ca',\n\t\t\t),\n\t\t\t'behance'   => array(\n\t\t\t\t'behance.net',\n\t\t\t),\n\t\t\t'codepen'   => array(\n\t\t\t\t'codepen.io',\n\t\t\t),\n\t\t\t'facebook'  => array(\n\t\t\t\t'facebook.com',\n\t\t\t\t'fb.me',\n\t\t\t),\n\t\t\t'feed'      => array(\n\t\t\t\t'feed',\n\t\t\t),\n\t\t\t'google'    => array(\n\t\t\t\t'g.page',\n\t\t\t),\n\t\t\t'lastfm'    => array(\n\t\t\t\t'last.fm',\n\t\t\t),\n\t\t\t'mail'      => array(\n\t\t\t\t'mailto:',\n\t\t\t),\n\t\t\t'pocket'    => array(\n\t\t\t\t'getpocket.com',\n\t\t\t),\n\t\t\t'tiktok'    => array(\n\t\t\t\t'tiktok.com',\n\t\t\t),\n\t\t\t'twitch'    => array(\n\t\t\t\t'twitch.tv',\n\t\t\t),\n\t\t\t'wordpress' => array(\n\t\t\t\t'wordpress.com',\n\t\t\t\t'wordpress.org',\n\t\t\t),\n\t\t);\n\n\t\t/**\n\t\t * Social Icons \u00e2\u20ac\u201c svg sources.\n\t\t *\n\t\t * @var array\n\t\t */\n\t\tpublic static $social_icons = array(\n\t\t\t'500px'      => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z\"></path></svg>',\n\n\t\t\t'amazon'     => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z\"></path></svg>',\n\n\t\t\t'bandcamp'   => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289\"></path></svg>',\n\n\t\t\t'behance'    => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z\"></path></svg>',\n\n\t\t\t'codepen'    => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z\"></path></svg>',\n\n\t\t\t'deviantart' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z\"></path></svg>',\n\n\t\t\t'dribbble'   => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z\"></path></svg>',\n\n\t\t\t'dropbox'    => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z\"></path></svg>',\n\n\t\t\t'etsy'       => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z\"></path></svg>',\n\n\t\t\t'facebook'   => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z\"></path></svg>',\n\n\t\t\t'feed'       => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z\"></path></svg>',\n\n\t\t\t'flickr'     => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z\"></path></svg>',\n\n\t\t\t'foursquare' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z\"></path></svg>',\n\n\t\t\t'goodreads'  => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z\"></path></svg>',\n\n\t\t\t'google'     => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z\"></path></svg>',\n\n\t\t\t'github'     => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z\"></path></svg>',\n\n\t\t\t'instagram'  => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z\"></path></svg>',\n\n\t\t\t'lastfm'     => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10.5002,0 C4.7006,0 0,4.70109753 0,10.4998496 C0,16.2989526 4.7006,21 10.5002,21 C16.299,21 21,16.2989526 21,10.4998496 C21,4.70109753 16.299,0 10.5002,0 Z M14.69735,14.7204413 C13.3164,14.7151781 12.4346,14.0870017 11.83445,12.6859357 L11.6816001,12.3451305 L10.35405,9.31011397 C9.92709997,8.26875064 8.85260001,7.57120012 7.68010001,7.57120012 C6.06945001,7.57120012 4.75925001,8.88509738 4.75925001,10.5009524 C4.75925001,12.1164565 6.06945001,13.4303036 7.68010001,13.4303036 C8.77200001,13.4303036 9.76514999,12.827541 10.2719501,11.8567047 C10.2893,11.8235214 10.3239,11.8019673 10.36305,11.8038219 C10.4007,11.8053759 10.43535,11.8287847 10.4504,11.8631709 L10.98655,13.1045863 C11.0016,13.1389726 10.9956,13.17782 10.97225,13.2068931 C10.1605001,14.1995341 8.96020001,14.7683115 7.68010001,14.7683115 C5.33305,14.7683115 3.42340001,12.8535563 3.42340001,10.5009524 C3.42340001,8.14679459 5.33300001,6.23203946 7.68010001,6.23203946 C9.45720002,6.23203946 10.8909,7.19074535 11.6138,8.86359341 C11.6205501,8.88018505 12.3412,10.5707777 12.97445,12.0190621 C13.34865,12.8739575 13.64615,13.3959676 14.6288,13.4291508 C15.5663001,13.4612814 16.25375,12.9121534 16.25375,12.1484869 C16.25375,11.4691321 15.8320501,11.3003585 14.8803,10.98216 C13.2365,10.4397989 12.34495,9.88605929 12.34495,8.51817658 C12.34495,7.1809207 13.26665,6.31615054 14.692,6.31615054 C15.62875,6.31615054 16.3155,6.7286858 16.79215,7.5768142 C16.80495,7.60062396 16.8079001,7.62814302 16.8004001,7.65420843 C16.7929,7.68027384 16.7748,7.70212868 16.7507001,7.713808 L15.86145,8.16900031 C15.8178001,8.19200805 15.7643,8.17807308 15.73565,8.13847371 C15.43295,7.71345711 15.0956,7.52513451 14.6423,7.52513451 C14.05125,7.52513451 13.6220001,7.92899802 13.6220001,8.48649708 C13.6220001,9.17382194 14.1529001,9.34144259 15.0339,9.61923972 C15.14915,9.65578139 15.26955,9.69397731 15.39385,9.73432853 C16.7763,10.1865133 17.57675,10.7311301 17.57675,12.1836251 C17.57685,13.629654 16.3389,14.7204413 14.69735,14.7204413 Z\"></path></svg>',\n\n\t\t\t'linkedin'   => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z\"></path></svg>',\n\n\t\t\t'mail'       => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M20,4H4C2.895,4,2,4.895,2,6v12c0,1.105,0.895,2,2,2h16c1.105,0,2-0.895,2-2V6C22,4.895,21.105,4,20,4z M20,8.236l-8,4.882 L4,8.236V6h16V8.236z\"></path></svg>',\n\n\t\t\t'mastodon'   => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z\"/></svg>',\n\n\t\t\t'medium'     => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M20.962,7.257l-5.457,8.867l-3.923-6.375l3.126-5.08c0.112-0.182,0.319-0.286,0.527-0.286c0.05,0,0.1,0.008,0.149,0.02 c0.039,0.01,0.078,0.023,0.114,0.041l5.43,2.715l0.006,0.003c0.004,0.002,0.007,0.006,0.011,0.008 C20.971,7.191,20.98,7.227,20.962,7.257z M9.86,8.592v5.783l5.14,2.57L9.86,8.592z M15.772,17.331l4.231,2.115 C20.554,19.721,21,19.529,21,19.016V8.835L15.772,17.331z M8.968,7.178L3.665,4.527C3.569,4.479,3.478,4.456,3.395,4.456 C3.163,4.456,3,4.636,3,4.938v11.45c0,0.306,0.224,0.669,0.498,0.806l4.671,2.335c0.12,0.06,0.234,0.088,0.337,0.088 c0.29,0,0.494-0.225,0.494-0.602V7.231C9,7.208,8.988,7.188,8.968,7.178z\"></path></svg>',\n\n\t\t\t'meetup'     => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z\"></path></svg>',\n\n\t\t\t'pinterest'  => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2\"></path></svg>',\n\n\t\t\t'pocket'     => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z\"></path></svg>',\n\n\t\t\t'reddit'     => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M22,11.816c0-1.256-1.021-2.277-2.277-2.277c-0.593,0-1.122,0.24-1.526,0.614c-1.481-0.965-3.455-1.594-5.647-1.69 l1.171-3.702l3.18,0.748c0.008,1.028,0.846,1.862,1.876,1.862c1.035,0,1.877-0.842,1.877-1.878c0-1.035-0.842-1.877-1.877-1.877 c-0.769,0-1.431,0.466-1.72,1.13l-3.508-0.826c-0.203-0.047-0.399,0.067-0.46,0.261l-1.35,4.268 c-2.316,0.038-4.411,0.67-5.97,1.671C5.368,9.765,4.853,9.539,4.277,9.539C3.021,9.539,2,10.56,2,11.816 c0,0.814,0.433,1.523,1.078,1.925c-0.037,0.221-0.061,0.444-0.061,0.672c0,3.292,4.011,5.97,8.941,5.97s8.941-2.678,8.941-5.97 c0-0.214-0.02-0.424-0.053-0.632C21.533,13.39,22,12.661,22,11.816z M18.776,4.394c0.606,0,1.1,0.493,1.1,1.1s-0.493,1.1-1.1,1.1 s-1.1-0.494-1.1-1.1S18.169,4.394,18.776,4.394z M2.777,11.816c0-0.827,0.672-1.5,1.499-1.5c0.313,0,0.598,0.103,0.838,0.269 c-0.851,0.676-1.477,1.479-1.812,2.36C2.983,12.672,2.777,12.27,2.777,11.816z M11.959,19.606c-4.501,0-8.164-2.329-8.164-5.193 S7.457,9.22,11.959,9.22s8.164,2.329,8.164,5.193S16.46,19.606,11.959,19.606z M20.636,13.001c-0.326-0.89-0.948-1.701-1.797-2.384 c0.248-0.186,0.55-0.301,0.883-0.301c0.827,0,1.5,0.673,1.5,1.5C21.223,12.299,20.992,12.727,20.636,13.001z M8.996,14.704 c-0.76,0-1.397-0.616-1.397-1.376c0-0.76,0.637-1.397,1.397-1.397c0.76,0,1.376,0.637,1.376,1.397 C10.372,14.088,9.756,14.704,8.996,14.704z M16.401,13.328c0,0.76-0.616,1.376-1.376,1.376c-0.76,0-1.399-0.616-1.399-1.376 c0-0.76,0.639-1.397,1.399-1.397C15.785,11.931,16.401,12.568,16.401,13.328z M15.229,16.708c0.152,0.152,0.152,0.398,0,0.55 c-0.674,0.674-1.727,1.002-3.219,1.002c-0.004,0-0.007-0.002-0.011-0.002c-0.004,0-0.007,0.002-0.011,0.002 c-1.492,0-2.544-0.328-3.218-1.002c-0.152-0.152-0.152-0.398,0-0.55c0.152-0.152,0.399-0.151,0.55,0 c0.521,0.521,1.394,0.775,2.669,0.775c0.004,0,0.007,0.002,0.011,0.002c0.004,0,0.007-0.002,0.011-0.002 c1.275,0,2.148-0.253,2.669-0.775C14.831,16.556,15.078,16.556,15.229,16.708z\"></path></svg>',\n\n\t\t\t'skype'      => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z\"></path></svg>',\n\n\t\t\t'snapchat'   => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z\"></path></svg>',\n\n\t\t\t'soundcloud' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8.9,16.1L9,14L8.9,9.5c0-0.1,0-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1c-0.1,0-0.1,0-0.1,0.1c0,0-0.1,0.1-0.1,0.1L8.3,14l0.1,2.1 c0,0.1,0,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1C8.8,16.3,8.9,16.3,8.9,16.1z M11.4,15.9l0.1-1.8L11.4,9c0-0.1,0-0.2-0.1-0.2 c0,0-0.1,0-0.1,0s-0.1,0-0.1,0c-0.1,0-0.1,0.1-0.1,0.2l0,0.1l-0.1,5c0,0,0,0.7,0.1,2v0c0,0.1,0,0.1,0.1,0.1c0.1,0.1,0.1,0.1,0.2,0.1 c0.1,0,0.1,0,0.2-0.1c0.1,0,0.1-0.1,0.1-0.2L11.4,15.9z M2.4,12.9L2.5,14l-0.2,1.1c0,0.1,0,0.1-0.1,0.1c0,0-0.1,0-0.1-0.1L2.1,14 l0.1-1.1C2.2,12.9,2.3,12.9,2.4,12.9C2.3,12.9,2.4,12.9,2.4,12.9z M3.1,12.2L3.3,14l-0.2,1.8c0,0.1,0,0.1-0.1,0.1 c-0.1,0-0.1,0-0.1-0.1L2.8,14L3,12.2C3,12.2,3,12.2,3.1,12.2C3.1,12.2,3.1,12.2,3.1,12.2z M3.9,11.9L4.1,14l-0.2,2.1 c0,0.1,0,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L3.5,14l0.2-2.1c0-0.1,0-0.1,0.1-0.1C3.9,11.8,3.9,11.8,3.9,11.9z M4.7,11.9L4.9,14 l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L4.3,14l0.2-2.2c0-0.1,0-0.1,0.1-0.1C4.7,11.7,4.7,11.8,4.7,11.9z M5.6,12 l0.2,2l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c0,0-0.1,0-0.1,0c0,0,0-0.1,0-0.1L5.1,14l0.2-2c0,0,0-0.1,0-0.1s0.1,0,0.1,0 C5.5,11.9,5.5,11.9,5.6,12L5.6,12z M6.4,10.7L6.6,14l-0.2,2.1c0,0,0,0.1,0,0.1c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.2L5.9,14 l0.2-3.3c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0C6.4,10.7,6.4,10.7,6.4,10.7z M7.2,10l0.2,4.1l-0.2,2.1c0,0,0,0.1,0,0.1 c0,0-0.1,0-0.1,0c-0.1,0-0.2-0.1-0.2-0.2l-0.1-2.1L6.8,10c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0S7.2,9.9,7.2,10z M8,9.6L8.2,14 L8,16.1c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.2-0.1-0.2-0.2L7.5,14l0.1-4.4c0-0.1,0-0.1,0.1-0.1c0,0,0.1-0.1,0.1-0.1c0.1,0,0.1,0,0.1,0.1 C8,9.6,8,9.6,8,9.6z M11.4,16.1L11.4,16.1L11.4,16.1z M9.7,9.6L9.8,14l-0.1,2.1c0,0.1,0,0.1-0.1,0.2s-0.1,0.1-0.2,0.1 c-0.1,0-0.1,0-0.1-0.1s-0.1-0.1-0.1-0.2L9.2,14l0.1-4.4c0-0.1,0-0.1,0.1-0.2s0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S9.7,9.5,9.7,9.6 L9.7,9.6z M10.6,9.8l0.1,4.3l-0.1,2c0,0.1,0,0.1-0.1,0.2c0,0-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c0,0-0.1-0.1-0.1-0.2L10,14 l0.1-4.3c0-0.1,0-0.1,0.1-0.2c0,0,0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S10.6,9.7,10.6,9.8z M12.4,14l-0.1,2c0,0.1,0,0.1-0.1,0.2 c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2l-0.1-1l-0.1-1l0.1-5.5v0c0-0.1,0-0.2,0.1-0.2 c0.1,0,0.1-0.1,0.2-0.1c0,0,0.1,0,0.1,0c0.1,0,0.1,0.1,0.1,0.2L12.4,14z M22.1,13.9c0,0.7-0.2,1.3-0.7,1.7c-0.5,0.5-1.1,0.7-1.7,0.7 h-6.8c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2V8.2c0-0.1,0.1-0.2,0.2-0.3c0.5-0.2,1-0.3,1.6-0.3c1.1,0,2.1,0.4,2.9,1.1 c0.8,0.8,1.3,1.7,1.4,2.8c0.3-0.1,0.6-0.2,1-0.2c0.7,0,1.3,0.2,1.7,0.7C21.8,12.6,22.1,13.2,22.1,13.9L22.1,13.9z\"></path></svg>',\n\n\t\t\t'spotify'    => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865\"></path></svg>',\n\n\t\t\t'tumblr'     => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M16.749,17.396c-0.357,0.17-1.041,0.319-1.551,0.332c-1.539,0.041-1.837-1.081-1.85-1.896V9.847h3.861V6.937h-3.847V2.039 c0,0-2.77,0-2.817,0c-0.046,0-0.127,0.041-0.138,0.144c-0.165,1.499-0.867,4.13-3.783,5.181v2.484h1.945v6.282 c0,2.151,1.587,5.206,5.775,5.135c1.413-0.024,2.982-0.616,3.329-1.126L16.749,17.396z\"></path></svg>',\n\n\t\t\t'tiktok'     => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M22.601273,3.99398422 C22.3543419,3.81786432 22.035286,3.77722295 21.7519316,3.88579503 C20.7673827,4.3053476 19.6367473,4.19781761 18.749359,3.60023293 C17.8619707,3.00264826 17.3390468,1.99663905 17.3606558,0.92862387 C17.366873,0.687165991 17.2757319,0.453316101 17.1076605,0.279488738 C16.937965,0.101864383 16.7030375,0.000936521363 16.4571011,0 L12.8428824,0 C12.343863,0 11.9393277,0.403649581 11.9393277,0.901576573 L11.9393277,16.3365675 C11.9393277,17.581385 10.9279897,18.5905089 9.68044104,18.5905089 C8.43289237,18.5905089 7.42155434,17.581385 7.42155434,16.3365675 C7.42155434,15.09175 8.43289237,14.0826261 9.68044104,14.0826261 C10.1794605,14.0826261 10.5839957,13.6789765 10.5839957,13.1810495 L10.5839957,9.57474321 C10.5839957,9.07681622 10.1794605,8.67316663 9.68044104,8.67316663 C5.44083962,8.67813472 2.00520525,12.1062476 2.00022626,16.3365675 C1.98771579,17.9546233 2.49430163,19.5342383 3.44591375,20.8444504 C3.61458557,21.0808398 5.05966461,19.9481604 4.91870788,19.7535427 C4.19555103,18.760421 3.80646351,17.5641499 3.80733562,16.3365675 C3.81165144,13.4484211 5.91803869,10.991254 8.77688636,10.5394301 L8.77688636,12.3425833 C6.70706914,12.8134053 5.34862709,14.7938709 5.65804701,16.8895228 C5.96746693,18.9851748 7.84059425,20.4905907 9.95854931,20.3457987 C12.0765044,20.2010067 13.7263573,18.4547454 13.7464371,16.3365675 L13.7464371,1.80315315 L15.6167953,1.80315315 C16.0103639,4.20249558 18.0864975,5.96506252 20.5230972,5.96843692 C20.7496837,5.96688212 20.975975,5.95182905 21.2007632,5.92335809 L21.2007632,7.67241664 C19.7293748,7.92650626 18.2152284,7.66195137 16.917914,6.92410808 C16.6383532,6.76305694 16.2939201,6.76305694 16.0143593,6.92410808 C15.7336844,7.0857977 15.5612953,7.38509793 15.562582,7.7084797 L15.562582,16.3365675 C15.5580692,18.2941869 14.5756972,20.1206948 12.9432814,21.2065896 C11.9060301,21.8965766 10.6930991,22.229824 9.48148608,22.189012 C8.78627447,22.1655944 8.08246121,22.0477035 7.42155434,21.774707 C7.12504167,21.5395062 5.484375,20.8444504 4.91870788,19.7535427 C4.66351437,19.2613936 3.0238563,20.6306805 3.44591375,20.8444504 C4.91870788,23.1351563 7.99726562,23.9999684 9.69851213,23.9999684 C13.7074483,23.9999684 17.0406982,20.9190082 17.3606558,16.931608 C17.3657425,16.8836579 17.3657425,16.8353059 17.3606558,16.7873558 L17.3606558,9.10592339 C18.9684136,9.66657941 20.7106733,9.71696914 22.3482777,9.25017564 C22.7469793,9.13449784 23.0153499,8.76257691 22.998837,8.34859907 L22.998837,4.7873716 C23.0148813,4.47165088 22.8640303,4.17060935 22.601273,3.99398422 Z\" /></svg>',\n\n\t\t\t'twitch'     => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z\"></path></svg>',\n\n\t\t\t'twitter'    => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z\"></path></svg>',\n\n\t\t\t'vimeo'      => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z\"></path></svg>',\n\n\t\t\t'vk'         => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z\"></path></svg>',\n\n\t\t\t'whatsapp'   => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M16.75,13.96C17,14.09 17.16,14.16 17.21,14.26C17.27,14.37 17.25,14.87 17,15.44C16.8,16 15.76,16.54 15.3,16.56C14.84,16.58 14.83,16.92 12.34,15.83C9.85,14.74 8.35,12.08 8.23,11.91C8.11,11.74 7.27,10.53 7.31,9.3C7.36,8.08 8,7.5 8.26,7.26C8.5,7 8.77,6.97 8.94,7H9.41C9.56,7 9.77,6.94 9.96,7.45L10.65,9.32C10.71,9.45 10.75,9.6 10.66,9.76L10.39,10.17L10,10.59C9.88,10.71 9.74,10.84 9.88,11.09C10,11.35 10.5,12.18 11.2,12.87C12.11,13.75 12.91,14.04 13.15,14.17C13.39,14.31 13.54,14.29 13.69,14.13L14.5,13.19C14.69,12.94 14.85,13 15.08,13.08L16.75,13.96M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C10.03,22 8.2,21.43 6.65,20.45L2,22L3.55,17.35C2.57,15.8 2,13.97 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12C4,13.72 4.54,15.31 5.46,16.61L4.5,19.5L7.39,18.54C8.69,19.46 10.28,20 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z\" />\n</svg>',\n\n\t\t\t// phpcs:disable WordPress.WP.CapitalPDangit.Misspelled\n\t\t\t'wordpress'  => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z\"></path></svg>',\n\n\t\t\t'yelp'       => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z\"></path></svg>',\n\n\t\t\t'youtube'    => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z\"></path></svg>',\n\n\t\t);\n\n\t}\n}\n", "num_lines": 316}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Custom comment walker for this theme.\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\nif ( ! class_exists( 'TwentyTwenty_Walker_Comment' ) ) {\n\t/**\n\t * CUSTOM COMMENT WALKER\n\t * A custom walker for comments, based on the walker in Twenty Nineteen.\n\t */\n\tclass TwentyTwenty_Walker_Comment extends Walker_Comment {\n\n\t\t/**\n\t\t * Outputs a comment in the HTML5 format.\n\t\t *\n\t\t * @see wp_list_comments()\n\t\t * @see https://developer.wordpress.org/reference/functions/get_comment_author_url/\n\t\t * @see https://developer.wordpress.org/reference/functions/get_comment_author/\n\t\t * @see https://developer.wordpress.org/reference/functions/get_avatar/\n\t\t * @see https://developer.wordpress.org/reference/functions/get_comment_reply_link/\n\t\t * @see https://developer.wordpress.org/reference/functions/get_edit_comment_link/\n\t\t *\n\t\t * @param WP_Comment $comment Comment to display.\n\t\t * @param int        $depth   Depth of the current comment.\n\t\t * @param array      $args    An array of arguments.\n\t\t */\n\t\tprotected function html5_comment( $comment, $depth, $args ) {\n\n\t\t\t$tag = ( 'div' === $args['style'] ) ? 'div' : 'li';\n\n\t\t\t?>\n\t\t\t<<?php echo $tag; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?> id=\"comment-<?php comment_ID(); ?>\" <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?>>\n\t\t\t\t<article id=\"div-comment-<?php comment_ID(); ?>\" class=\"comment-body\">\n\t\t\t\t\t<footer class=\"comment-meta\">\n\t\t\t\t\t\t<div class=\"comment-author vcard\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$comment_author_url = get_comment_author_url( $comment );\n\t\t\t\t\t\t\t$comment_author     = get_comment_author( $comment );\n\t\t\t\t\t\t\t$avatar             = get_avatar( $comment, $args['avatar_size'] );\n\t\t\t\t\t\t\tif ( 0 !== $args['avatar_size'] ) {\n\t\t\t\t\t\t\t\tif ( empty( $comment_author_url ) ) {\n\t\t\t\t\t\t\t\t\techo wp_kses_post( $avatar );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tprintf( '<a href=\"%s\" rel=\"external nofollow\" class=\"url\">', $comment_author_url ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped --Escaped in https://developer.wordpress.org/reference/functions/get_comment_author_url/\n\t\t\t\t\t\t\t\t\techo wp_kses_post( $avatar );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t'<span class=\"fn\">%1$s</span><span class=\"screen-reader-text says\">%2$s</span>',\n\t\t\t\t\t\t\t\tesc_html( $comment_author ),\n\t\t\t\t\t\t\t\t__( 'says:', 'twentytwenty' )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( ! empty( $comment_author_url ) ) {\n\t\t\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div><!-- .comment-author -->\n\n\t\t\t\t\t\t<div class=\"comment-metadata\">\n\t\t\t\t\t\t\t<a href=\"<?php echo esc_url( get_comment_link( $comment, $args ) ); ?>\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t/* translators: 1: Comment date, 2: Comment time. */\n\t\t\t\t\t\t\t\t$comment_timestamp = sprintf( __( '%1$s at %2$s', 'twentytwenty' ), get_comment_date( '', $comment ), get_comment_time() );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<time datetime=\"<?php comment_time( 'c' ); ?>\" title=\"<?php echo esc_attr( $comment_timestamp ); ?>\">\n\t\t\t\t\t\t\t\t\t<?php echo esc_html( $comment_timestamp ); ?>\n\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( get_edit_comment_link() ) {\n\t\t\t\t\t\t\t\techo ' <span aria-hidden=\"true\">&bull;</span> <a class=\"comment-edit-link\" href=\"' . esc_url( get_edit_comment_link() ) . '\">' . __( 'Edit', 'twentytwenty' ) . '</a>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div><!-- .comment-metadata -->\n\n\t\t\t\t\t</footer><!-- .comment-meta -->\n\n\t\t\t\t\t<div class=\"comment-content entry-content\">\n\n\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\tcomment_text();\n\n\t\t\t\t\t\tif ( '0' === $comment->comment_approved ) {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<p class=\"comment-awaiting-moderation\"><?php _e( 'Your comment is awaiting moderation.', 'twentytwenty' ); ?></p>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t</div><!-- .comment-content -->\n\n\t\t\t\t\t<?php\n\n\t\t\t\t\t$comment_reply_link = get_comment_reply_link(\n\t\t\t\t\t\tarray_merge(\n\t\t\t\t\t\t\t$args,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'add_below' => 'div-comment',\n\t\t\t\t\t\t\t\t'depth'     => $depth,\n\t\t\t\t\t\t\t\t'max_depth' => $args['max_depth'],\n\t\t\t\t\t\t\t\t'before'    => '<span class=\"comment-reply\">',\n\t\t\t\t\t\t\t\t'after'     => '</span>',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$by_post_author = twentytwenty_is_comment_by_post_author( $comment );\n\n\t\t\t\t\tif ( $comment_reply_link || $by_post_author ) {\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t<footer class=\"comment-footer-meta\">\n\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( $comment_reply_link ) {\n\t\t\t\t\t\t\t\techo $comment_reply_link; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Link is escaped in https://developer.wordpress.org/reference/functions/get_comment_reply_link/\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( $by_post_author ) {\n\t\t\t\t\t\t\t\techo '<span class=\"by-post-author\">' . __( 'By Post Author', 'twentytwenty' ) . '</span>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t</footer>\n\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\n\t\t\t\t</article><!-- .comment-body -->\n\n\t\t\t<?php\n\t\t}\n\t}\n}\n", "num_lines": 143}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Custom page walker for this theme.\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\nif ( ! class_exists( 'TwentyTwenty_Walker_Page' ) ) {\n\t/**\n\t * CUSTOM PAGE WALKER\n\t * A custom walker for pages.\n\t */\n\tclass TwentyTwenty_Walker_Page extends Walker_Page {\n\n\t\t/**\n\t\t * Outputs the beginning of the current element in the tree.\n\t\t *\n\t\t * @see Walker::start_el()\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param string  $output       Used to append additional content. Passed by reference.\n\t\t * @param WP_Post $page         Page data object.\n\t\t * @param int     $depth        Optional. Depth of page. Used for padding. Default 0.\n\t\t * @param array   $args         Optional. Array of arguments. Default empty array.\n\t\t * @param int     $current_page Optional. Page ID. Default 0.\n\t\t */\n\t\tpublic function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) {\n\n\t\t\tif ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {\n\t\t\t\t$t = \"\\t\";\n\t\t\t\t$n = \"\\n\";\n\t\t\t} else {\n\t\t\t\t$t = '';\n\t\t\t\t$n = '';\n\t\t\t}\n\t\t\tif ( $depth ) {\n\t\t\t\t$indent = str_repeat( $t, $depth );\n\t\t\t} else {\n\t\t\t\t$indent = '';\n\t\t\t}\n\n\t\t\t$css_class = array( 'page_item', 'page-item-' . $page->ID );\n\n\t\t\tif ( isset( $args['pages_with_children'][ $page->ID ] ) ) {\n\t\t\t\t$css_class[] = 'page_item_has_children';\n\t\t\t}\n\n\t\t\tif ( ! empty( $current_page ) ) {\n\t\t\t\t$_current_page = get_post( $current_page );\n\t\t\t\tif ( $_current_page && in_array( $page->ID, $_current_page->ancestors, true ) ) {\n\t\t\t\t\t$css_class[] = 'current_page_ancestor';\n\t\t\t\t}\n\t\t\t\tif ( $page->ID === $current_page ) {\n\t\t\t\t\t$css_class[] = 'current_page_item';\n\t\t\t\t} elseif ( $_current_page && $page->ID === $_current_page->post_parent ) {\n\t\t\t\t\t$css_class[] = 'current_page_parent';\n\t\t\t\t}\n\t\t\t} elseif ( get_option( 'page_for_posts' ) === $page->ID ) {\n\t\t\t\t$css_class[] = 'current_page_parent';\n\t\t\t}\n\n\t\t\t/** This filter is documented in wp-includes/class-walker-page.php */\n\t\t\t$css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) );\n\t\t\t$css_classes = $css_classes ? ' class=\"' . esc_attr( $css_classes ) . '\"' : '';\n\n\t\t\tif ( '' === $page->post_title ) {\n\t\t\t\t/* translators: %d: ID of a post. */\n\t\t\t\t$page->post_title = sprintf( __( '#%d (no title)', 'twentytwenty' ), $page->ID );\n\t\t\t}\n\n\t\t\t$args['link_before'] = empty( $args['link_before'] ) ? '' : $args['link_before'];\n\t\t\t$args['link_after']  = empty( $args['link_after'] ) ? '' : $args['link_after'];\n\n\t\t\t$atts                 = array();\n\t\t\t$atts['href']         = get_permalink( $page->ID );\n\t\t\t$atts['aria-current'] = ( $page->ID === $current_page ) ? 'page' : '';\n\n\t\t\t/** This filter is documented in wp-includes/class-walker-page.php */\n\t\t\t$atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page );\n\n\t\t\t$attributes = '';\n\t\t\tforeach ( $atts as $attr => $value ) {\n\t\t\t\tif ( ! empty( $value ) ) {\n\t\t\t\t\t$value       = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );\n\t\t\t\t\t$attributes .= ' ' . $attr . '=\"' . $value . '\"';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$args['list_item_before'] = '';\n\t\t\t$args['list_item_after']  = '';\n\n\t\t\t// Wrap the link in a div and append a sub menu toggle.\n\t\t\tif ( isset( $args['show_toggles'] ) && true === $args['show_toggles'] ) {\n\t\t\t\t// Wrap the menu item link contents in a div, used for positioning.\n\t\t\t\t$args['list_item_before'] = '<div class=\"ancestor-wrapper\">';\n\t\t\t\t$args['list_item_after']  = '';\n\n\t\t\t\t// Add a toggle to items with children.\n\t\t\t\tif ( isset( $args['pages_with_children'][ $page->ID ] ) ) {\n\n\t\t\t\t\t$toggle_target_string = '.menu-modal .page-item-' . $page->ID . ' > ul';\n\t\t\t\t\t$toggle_duration      = twentytwenty_toggle_duration();\n\n\t\t\t\t\t// Add the sub menu toggle.\n\t\t\t\t\t$args['list_item_after'] .= '<button class=\"toggle sub-menu-toggle fill-children-current-color\" data-toggle-target=\"' . $toggle_target_string . '\" data-toggle-type=\"slidetoggle\" data-toggle-duration=\"' . absint( $toggle_duration ) . '\" aria-expanded=\"false\"><span class=\"screen-reader-text\">' . __( 'Show sub menu', 'twentytwenty' ) . '</span>' . twentytwenty_get_theme_svg( 'chevron-down' ) . '</button>';\n\n\t\t\t\t}\n\n\t\t\t\t// Close the wrapper.\n\t\t\t\t$args['list_item_after'] .= '</div><!-- .ancestor-wrapper -->';\n\t\t\t}\n\n\t\t\t// Add icons to menu items with children.\n\t\t\tif ( isset( $args['show_sub_menu_icons'] ) && true === $args['show_sub_menu_icons'] ) {\n\t\t\t\tif ( isset( $args['pages_with_children'][ $page->ID ] ) ) {\n\t\t\t\t\t$args['list_item_after'] = '<span class=\"icon\"></span>';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$output .= $indent . sprintf(\n\t\t\t\t'<li%s>%s<a%s>%s%s%s</a>%s',\n\t\t\t\t$css_classes,\n\t\t\t\t$args['list_item_before'],\n\t\t\t\t$attributes,\n\t\t\t\t$args['link_before'],\n\t\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t\tapply_filters( 'the_title', $page->post_title, $page->ID ),\n\t\t\t\t$args['link_after'],\n\t\t\t\t$args['list_item_after']\n\t\t\t);\n\n\t\t\tif ( ! empty( $args['show_date'] ) ) {\n\t\t\t\tif ( 'modified' === $args['show_date'] ) {\n\t\t\t\t\t$time = $page->post_modified;\n\t\t\t\t} else {\n\t\t\t\t\t$time = $page->post_date;\n\t\t\t\t}\n\n\t\t\t\t$date_format = empty( $args['date_format'] ) ? '' : $args['date_format'];\n\t\t\t\t$output     .= ' ' . mysql2date( $date_format, $time );\n\t\t\t}\n\t\t}\n\t}\n}\n", "num_lines": 147}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Twenty Twenty Custom CSS\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\nif ( ! function_exists( 'twentytwenty_generate_css' ) ) {\n\n\t/**\n\t * Generate CSS.\n\t *\n\t * @param string $selector The CSS selector.\n\t * @param string $style The CSS style.\n\t * @param string $value The CSS value.\n\t * @param string $prefix The CSS prefix.\n\t * @param string $suffix The CSS suffix.\n\t * @param bool   $echo Echo the styles.\n\t */\n\tfunction twentytwenty_generate_css( $selector, $style, $value, $prefix = '', $suffix = '', $echo = true ) {\n\n\t\t$return = '';\n\n\t\t/*\n\t\t * Bail early if we have no $selector elements or properties and $value.\n\t\t */\n\t\tif ( ! $value || ! $selector ) {\n\n\t\t\treturn;\n\t\t}\n\n\t\t$return = sprintf( '%s { %s: %s; }', $selector, $style, $prefix . $value . $suffix );\n\n\t\tif ( $echo ) {\n\n\t\t\techo $return; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- We need to double check this, but for now, we want to pass PHPCS ;)\n\n\t\t}\n\n\t\treturn $return;\n\n\t}\n}\n\nif ( ! function_exists( 'twentytwenty_get_customizer_css' ) ) {\n\n\t/**\n\t * Get CSS Built from Customizer Options.\n\t * Build CSS reflecting colors, fonts and other options set in the Customizer, and return them for output.\n\t *\n\t * @param string $type Whether to return CSS for the \"front-end\", \"block-editor\" or \"classic-editor\".\n\t */\n\tfunction twentytwenty_get_customizer_css( $type = 'front-end' ) {\n\n\t\t// Get variables.\n\t\t$body              = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'text' ) );\n\t\t$body_default      = '#000000';\n\t\t$secondary         = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'secondary' ) );\n\t\t$secondary_default = '#6d6d6d';\n\t\t$borders           = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'borders' ) );\n\t\t$borders_default   = '#dcd7ca';\n\t\t$accent            = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'accent' ) );\n\t\t$accent_default    = '#cd2653';\n\n\t\t// Header.\n\t\t$header_footer_background         = sanitize_hex_color( twentytwenty_get_color_for_area( 'header-footer', 'background' ) );\n\t\t$header_footer_background_default = '#ffffff';\n\n\t\t// Cover.\n\t\t$cover         = sanitize_hex_color( get_theme_mod( 'cover_template_overlay_text_color' ) );\n\t\t$cover_default = '#ffffff';\n\n\t\t// Background.\n\t\t$background         = sanitize_hex_color_no_hash( get_theme_mod( 'background_color' ) );\n\t\t$background_default = 'f5efe0';\n\n\t\tob_start();\n\n\t\t/**\n\t\t * Note \u00e2\u20ac\u201c Styles are applied in this order:\n\t\t * 1. Element specific\n\t\t * 2. Helper classes\n\t\t *\n\t\t * This enables all helper classes to overwrite base element styles,\n\t\t * meaning that any color classes applied in the block editor will\n\t\t * have a higher priority than the base element styles.\n\t\t*/\n\n\t\t// Front-End Styles.\n\t\tif ( 'front-end' === $type ) {\n\n\t\t\t// Auto-calculated colors.\n\t\t\t$elements_definitions = twentytwenty_get_elements_array();\n\t\t\tforeach ( $elements_definitions as $context => $props ) {\n\t\t\t\tforeach ( $props as $key => $definitions ) {\n\t\t\t\t\tforeach ( $definitions as $property => $elements ) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * If we don't have an elements array or it is empty\n\t\t\t\t\t\t * then skip this iteration early;\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif ( ! is_array( $elements ) || empty( $elements ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$val = twentytwenty_get_color_for_area( $context, $key );\n\t\t\t\t\t\tif ( $val ) {\n\t\t\t\t\t\t\ttwentytwenty_generate_css( implode( ',', $elements ), $property, $val );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $cover && $cover !== $cover_default ) {\n\t\t\t\ttwentytwenty_generate_css( '.overlay-header .header-inner', 'color', $cover );\n\t\t\t\ttwentytwenty_generate_css( '.cover-header .entry-header *', 'color', $cover );\n\t\t\t}\n\n\t\t\t// Block Editor Styles.\n\t\t} elseif ( 'block-editor' === $type ) {\n\n\t\t\t// Colors.\n\t\t\t// Accent color.\n\t\t\tif ( $accent && $accent !== $accent_default ) {\n\t\t\t\ttwentytwenty_generate_css( '.has-accent-color, .editor-styles-wrapper .editor-block-list__layout a, .editor-styles-wrapper .has-drop-cap:not(:focus)::first-letter, .editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link, .editor-styles-wrapper .wp-block-pullquote::before, .editor-styles-wrapper .wp-block-file .wp-block-file__textlink', 'color', $accent );\n\t\t\t\ttwentytwenty_generate_css( '.editor-styles-wrapper .wp-block-quote', 'border-color', $accent, '' );\n\t\t\t\ttwentytwenty_generate_css( '.has-accent-background-color, .editor-styles-wrapper .wp-block-button__link, .editor-styles-wrapper .wp-block-file__button', 'background-color', $accent );\n\t\t\t}\n\n\t\t\t// Background color.\n\t\t\tif ( $background && $background !== $background_default ) {\n\t\t\t\ttwentytwenty_generate_css( '.editor-styles-wrapper', 'background-color', '#' . $background );\n\t\t\t\ttwentytwenty_generate_css( '.has-background.has-primary-background-color:not(.has-text-color),.has-background.has-primary-background-color *:not(.has-text-color),.has-background.has-accent-background-color:not(.has-text-color),.has-background.has-accent-background-color *:not(.has-text-color)', 'color', '#' . $background );\n\t\t\t}\n\n\t\t\t// Borders color.\n\t\t\tif ( $borders && $borders !== $borders_default ) {\n\t\t\t\ttwentytwenty_generate_css( '.editor-styles-wrapper .wp-block-code, .editor-styles-wrapper pre, .editor-styles-wrapper .wp-block-preformatted pre, .editor-styles-wrapper .wp-block-verse pre, .editor-styles-wrapper fieldset, .editor-styles-wrapper .wp-block-table, .editor-styles-wrapper .wp-block-table *, .editor-styles-wrapper .wp-block-table.is-style-stripes, .editor-styles-wrapper .wp-block-latest-posts.is-grid li', 'border-color', $borders );\n\t\t\t\ttwentytwenty_generate_css( '.editor-styles-wrapper .wp-block-table caption, .editor-styles-wrapper .wp-block-table.is-style-stripes tbody tr:nth-child(odd)', 'background-color', $borders );\n\t\t\t}\n\n\t\t\t// Text color.\n\t\t\tif ( $body && $body !== $body_default ) {\n\t\t\t\ttwentytwenty_generate_css( 'body .editor-styles-wrapper, .editor-post-title__block .editor-post-title__input, .editor-post-title__block .editor-post-title__input:focus', 'color', $body );\n\t\t\t}\n\n\t\t\t// Secondary color.\n\t\t\tif ( $secondary && $secondary !== $secondary_default ) {\n\t\t\t\ttwentytwenty_generate_css( '.editor-styles-wrapper figcaption, .editor-styles-wrapper cite, .editor-styles-wrapper .wp-block-quote__citation, .editor-styles-wrapper .wp-block-quote cite, .editor-styles-wrapper .wp-block-quote footer, .editor-styles-wrapper .wp-block-pullquote__citation, .editor-styles-wrapper .wp-block-pullquote cite, .editor-styles-wrapper .wp-block-pullquote footer, .editor-styles-wrapper ul.wp-block-archives li, .editor-styles-wrapper ul.wp-block-categories li, .editor-styles-wrapper ul.wp-block-latest-posts li, .editor-styles-wrapper ul.wp-block-categories__list li, .editor-styles-wrapper .wp-block-latest-comments time, .editor-styles-wrapper .wp-block-latest-posts time', 'color', $secondary );\n\t\t\t}\n\n\t\t\t// Header Footer Background Color.\n\t\t\tif ( $header_footer_background && $header_footer_background !== $header_footer_background_default ) {\n\t\t\t\ttwentytwenty_generate_css( '.editor-styles-wrapper .wp-block-pullquote::before', 'background-color', $header_footer_background );\n\t\t\t}\n\t\t} elseif ( 'classic-editor' === $type ) {\n\n\t\t\t// Colors.\n\t\t\t// Accent color.\n\t\t\tif ( $accent && $accent !== $accent_default ) {\n\t\t\t\ttwentytwenty_generate_css( 'body#tinymce.wp-editor.content a, body#tinymce.wp-editor.content a:focus, body#tinymce.wp-editor.content a:hover', 'color', $accent );\n\t\t\t\ttwentytwenty_generate_css( 'body#tinymce.wp-editor.content blockquote, body#tinymce.wp-editor.content .wp-block-quote', 'border-color', $accent, '', ' !important' );\n\t\t\t\ttwentytwenty_generate_css( 'body#tinymce.wp-editor.content button, body#tinymce.wp-editor.content .faux-button, body#tinymce.wp-editor.content .wp-block-button__link, body#tinymce.wp-editor.content .wp-block-file__button, body#tinymce.wp-editor.content input[type=\\'button\\'], body#tinymce.wp-editor.content input[type=\\'reset\\'], body#tinymce.wp-editor.content input[type=\\'submit\\']', 'background-color', $accent );\n\t\t\t}\n\n\t\t\t// Background color.\n\t\t\tif ( $background && $background !== $background_default ) {\n\t\t\t\ttwentytwenty_generate_css( 'body#tinymce.wp-editor.content', 'background-color', '#' . $background );\n\t\t\t}\n\n\t\t\t// Text color.\n\t\t\tif ( $body && $body !== $body_default ) {\n\t\t\t\ttwentytwenty_generate_css( 'body#tinymce.wp-editor.content', 'color', $body );\n\t\t\t}\n\n\t\t\t// Secondary color.\n\t\t\tif ( $secondary && $secondary !== $secondary_default ) {\n\t\t\t\ttwentytwenty_generate_css( 'body#tinymce.wp-editor.content hr:not(.is-style-dots), body#tinymce.wp-editor.content cite, body#tinymce.wp-editor.content figcaption, body#tinymce.wp-editor.content .wp-caption-text, body#tinymce.wp-editor.content .wp-caption-dd, body#tinymce.wp-editor.content .gallery-caption', 'color', $secondary );\n\t\t\t}\n\n\t\t\t// Borders color.\n\t\t\tif ( $borders && $borders !== $borders_default ) {\n\t\t\t\ttwentytwenty_generate_css( 'body#tinymce.wp-editor.content pre, body#tinymce.wp-editor.content hr, body#tinymce.wp-editor.content fieldset,body#tinymce.wp-editor.content input, body#tinymce.wp-editor.content textarea', 'border-color', $borders );\n\t\t\t}\n\t\t}\n\n\t\t// Return the results.\n\t\treturn ob_get_clean();\n\n\t}\n}\n", "num_lines": 192}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Twenty Twenty Starter Content\n *\n * @link https://make.wordpress.org/core/2016/11/30/starter-content-for-themes-in-4-7/\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\n/**\n * Function to return the array of starter content for the theme.\n *\n * Passes it through the `twentytwenty_starter_content` filter before returning.\n *\n * @since Twenty Twenty 1.0\n *\n * @return array A filtered array of args for the starter_content.\n */\nfunction twentytwenty_get_starter_content() {\n\n\t// Define and register starter content to showcase the theme on new sites.\n\t$starter_content = array(\n\t\t'widgets'     => array(\n\t\t\t// Place one core-defined widgets in the first footer widget area.\n\t\t\t'sidebar-1' => array(\n\t\t\t\t'text_about',\n\t\t\t),\n\t\t\t// Place one core-defined widgets in the second footer widget area.\n\t\t\t'sidebar-2' => array(\n\t\t\t\t'text_business_info',\n\t\t\t),\n\t\t),\n\n\t\t// Create the custom image attachments used as post thumbnails for pages.\n\t\t'attachments' => array(\n\t\t\t'image-opening' => array(\n\t\t\t\t'post_title' => _x( 'The New UMoMA Opens its Doors', 'Theme starter content', 'twentytwenty' ),\n\t\t\t\t'file'       => 'assets/images/2020-landscape-1.png', // URL relative to the template directory.\n\t\t\t),\n\t\t),\n\n\t\t// Specify the core-defined pages to create and add custom thumbnails to some of them.\n\t\t'posts'       => array(\n\t\t\t'front' => array(\n\t\t\t\t'post_type'    => 'page',\n\t\t\t\t'post_title'   => __( 'The New UMoMA Opens its Doors', 'twentytwenty' ),\n\t\t\t\t// Use the above featured image with the predefined about page.\n\t\t\t\t'thumbnail'    => '{{image-opening}}',\n\t\t\t\t'post_content' => join(\n\t\t\t\t\t'',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'<!-- wp:group {\"align\":\"wide\"} -->',\n\t\t\t\t\t\t'<div class=\"wp-block-group alignwide\"><div class=\"wp-block-group__inner-container\"><!-- wp:heading {\"align\":\"center\"} -->',\n\t\t\t\t\t\t'<h2 class=\"has-text-align-center\">' . __( 'The premier destination for modern art in Northern Sweden. Open from 10 AM to 6 PM every day during the summer months.', 'twentytwenty' ) . '</h2>',\n\t\t\t\t\t\t'<!-- /wp:heading --></div></div>',\n\t\t\t\t\t\t'<!-- /wp:group -->',\n\t\t\t\t\t\t'<!-- wp:columns {\"align\":\"wide\"} -->',\n\t\t\t\t\t\t'<div class=\"wp-block-columns alignwide\"><!-- wp:column -->',\n\t\t\t\t\t\t'<div class=\"wp-block-column\"><!-- wp:group -->',\n\t\t\t\t\t\t'<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">',\n\t\t\t\t\t\t'<!-- wp:image {\"align\":\"full\",\"id\":37,\"sizeSlug\":\"full\"} -->',\n\t\t\t\t\t\t'<figure class=\"wp-block-image alignfull size-full\"><img src=\"' . get_theme_file_uri() . '/assets/images/2020-three-quarters-1.png\" alt=\"\" class=\"wp-image-37\"/></figure>',\n\t\t\t\t\t\t'<!-- /wp:image -->',\n\t\t\t\t\t\t'<!-- wp:heading {\"level\":3} -->',\n\t\t\t\t\t\t'<h3>' . __( 'Works and Days', 'twentytwenty' ) . '</h3>',\n\t\t\t\t\t\t'<!-- /wp:heading -->',\n\t\t\t\t\t\t'<!-- wp:paragraph -->',\n\t\t\t\t\t\t'<p>' . __( 'August 1 -- December 1', 'twentytwenty' ) . '</p>',\n\t\t\t\t\t\t'<!-- /wp:paragraph -->',\n\t\t\t\t\t\t'<!-- wp:button {\"className\":\"is-style-outline\"} -->',\n\t\t\t\t\t\t'<div class=\"wp-block-button is-style-outline\"><a class=\"wp-block-button__link\" href=\"https://make.wordpress.org/core/2019/09/27/block-editor-theme-related-updates-in-wordpress-5-3/\">' . __( 'Read More', 'twentytwenty' ) . '</a></div>',\n\t\t\t\t\t\t'<!-- /wp:button --></div></div>',\n\t\t\t\t\t\t'<!-- /wp:group -->',\n\t\t\t\t\t\t'<!-- wp:group -->',\n\t\t\t\t\t\t'<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">',\n\t\t\t\t\t\t'<!-- wp:image {\"align\":\"full\",\"id\":37,\"sizeSlug\":\"full\"} -->',\n\t\t\t\t\t\t'<figure class=\"wp-block-image alignfull size-full\"><img src=\"' . get_theme_file_uri() . '/assets/images/2020-three-quarters-3.png\" alt=\"\" class=\"wp-image-37\"/></figure>',\n\t\t\t\t\t\t'<!-- /wp:image -->',\n\t\t\t\t\t\t'<!-- wp:heading {\"level\":3} -->',\n\t\t\t\t\t\t'<h3>' . __( 'Theatre of Operations', 'twentytwenty' ) . '</h3>',\n\t\t\t\t\t\t'<!-- /wp:heading -->',\n\t\t\t\t\t\t'<!-- wp:paragraph -->',\n\t\t\t\t\t\t'<p>' . __( 'October 1 -- December 1', 'twentytwenty' ) . '</p>',\n\t\t\t\t\t\t'<!-- /wp:paragraph -->',\n\t\t\t\t\t\t'<!-- wp:button {\"className\":\"is-style-outline\"} -->',\n\t\t\t\t\t\t'<div class=\"wp-block-button is-style-outline\"><a class=\"wp-block-button__link\" href=\"https://make.wordpress.org/core/2019/09/27/block-editor-theme-related-updates-in-wordpress-5-3/\">' . __( 'Read More', 'twentytwenty' ) . '</a></div>',\n\t\t\t\t\t\t'<!-- /wp:button --></div></div>',\n\t\t\t\t\t\t'<!-- /wp:group --></div>',\n\t\t\t\t\t\t'<!-- /wp:column -->',\n\t\t\t\t\t\t'<!-- wp:column -->',\n\t\t\t\t\t\t'<div class=\"wp-block-column\"><!-- wp:group -->',\n\t\t\t\t\t\t'<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">',\n\t\t\t\t\t\t'<!-- wp:image {\"align\":\"full\",\"id\":37,\"sizeSlug\":\"full\"} -->',\n\t\t\t\t\t\t'<figure class=\"wp-block-image alignfull size-full\"><img src=\"' . get_theme_file_uri() . '/assets/images/2020-three-quarters-2.png\" alt=\"\" class=\"wp-image-37\"/></figure>',\n\t\t\t\t\t\t'<!-- /wp:image -->',\n\t\t\t\t\t\t'<!-- wp:heading {\"level\":3} -->',\n\t\t\t\t\t\t'<h3>' . __( 'The Life I Deserve', 'twentytwenty' ) . '</h3>',\n\t\t\t\t\t\t'<!-- /wp:heading -->',\n\t\t\t\t\t\t'<!-- wp:paragraph -->',\n\t\t\t\t\t\t'<p>' . __( 'August 1 -- December 1', 'twentytwenty' ) . '</p>',\n\t\t\t\t\t\t'<!-- /wp:paragraph -->',\n\t\t\t\t\t\t'<!-- wp:button {\"className\":\"is-style-outline\"} -->',\n\t\t\t\t\t\t'<div class=\"wp-block-button is-style-outline\"><a class=\"wp-block-button__link\" href=\"https://make.wordpress.org/core/2019/09/27/block-editor-theme-related-updates-in-wordpress-5-3/\">' . __( 'Read More', 'twentytwenty' ) . '</a></div>',\n\t\t\t\t\t\t'<!-- /wp:button --></div></div>',\n\t\t\t\t\t\t'<!-- /wp:group -->',\n\t\t\t\t\t\t'<!-- wp:group -->',\n\t\t\t\t\t\t'<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">',\n\t\t\t\t\t\t'<!-- wp:image {\"align\":\"full\",\"id\":37,\"sizeSlug\":\"full\"} -->',\n\t\t\t\t\t\t'<figure class=\"wp-block-image alignfull size-full\"><img src=\"' . get_theme_file_uri() . '/assets/images/2020-three-quarters-4.png\" alt=\"\" class=\"wp-image-37\"/></figure>',\n\t\t\t\t\t\t'<!-- /wp:image -->',\n\t\t\t\t\t\t'<!-- wp:heading {\"level\":3} -->',\n\t\t\t\t\t\t'<h3>' . __( 'From Signac to Matisse', 'twentytwenty' ) . '</h3>',\n\t\t\t\t\t\t'<!-- /wp:heading -->',\n\t\t\t\t\t\t'<!-- wp:paragraph -->',\n\t\t\t\t\t\t'<p>' . __( 'October 1 -- December 1', 'twentytwenty' ) . '</p>',\n\t\t\t\t\t\t'<!-- /wp:paragraph -->',\n\t\t\t\t\t\t'<!-- wp:button {\"className\":\"is-style-outline\"} -->',\n\t\t\t\t\t\t'<div class=\"wp-block-button is-style-outline\"><a class=\"wp-block-button__link\" href=\"https://make.wordpress.org/core/2019/09/27/block-editor-theme-related-updates-in-wordpress-5-3/\">' . __( 'Read More', 'twentytwenty' ) . '</a></div>',\n\t\t\t\t\t\t'<!-- /wp:button --></div></div>',\n\t\t\t\t\t\t'<!-- /wp:group --></div>',\n\t\t\t\t\t\t'<!-- /wp:column --></div>',\n\t\t\t\t\t\t'<!-- /wp:columns -->',\n\t\t\t\t\t\t'<!-- wp:image {\"align\":\"full\",\"id\":37,\"sizeSlug\":\"full\"} -->',\n\t\t\t\t\t\t'<figure class=\"wp-block-image alignfull size-full\"><img src=\"' . get_theme_file_uri() . '/assets/images/2020-landscape-2.png\" alt=\"\" class=\"wp-image-37\"/></figure>',\n\t\t\t\t\t\t'<!-- /wp:image -->',\n\t\t\t\t\t\t'<!-- wp:group {\"align\":\"wide\"} -->',\n\t\t\t\t\t\t'<div class=\"wp-block-group alignwide\"><div class=\"wp-block-group__inner-container\"><!-- wp:heading {\"align\":\"center\",\"textColor\":\"accent\"} -->',\n\t\t\t\t\t\t'<h2 class=\"has-accent-color has-text-align-center\">' . __( '&#8220;Cyborgs, as the philosopher Donna Haraway established, are not reverent. They do not remember the cosmos.&#8221;', 'twentytwenty' ) . '</h2>',\n\t\t\t\t\t\t'<!-- /wp:heading --></div></div>',\n\t\t\t\t\t\t'<!-- /wp:group -->',\n\t\t\t\t\t\t'<!-- wp:paragraph {\"dropCap\":true} -->',\n\t\t\t\t\t\t'<p class=\"has-drop-cap\">' . __( 'With seven floors of striking architecture, UMoMA shows exhibitions of international contemporary art, sometimes along with art historical retrospectives. Existential, political and philosophical issues are intrinsic to our programme. As visitor you are invited to guided tours artist talks, lectures, film screenings and other events with free admission', 'twentytwenty' ) . '</p>',\n\t\t\t\t\t\t'<!-- /wp:paragraph -->',\n\t\t\t\t\t\t'<!-- wp:paragraph -->',\n\t\t\t\t\t\t'<p>' . __( 'The exhibitions are produced by UMoMA in collaboration with artists and museums around the world and they often attract international attention. UMoMA has received a Special Commendation from the European Museum of the Year, and was among the top candidates for the Swedish Museum of the Year Award as well as for the Council of Europe Museum Prize.', 'twentytwenty' ) . '</p>',\n\t\t\t\t\t\t'<!-- /wp:paragraph -->',\n\t\t\t\t\t\t'<!-- wp:paragraph -->',\n\t\t\t\t\t\t'<p></p>',\n\t\t\t\t\t\t'<!-- /wp:paragraph -->',\n\t\t\t\t\t\t'<!-- wp:group {\"customBackgroundColor\":\"#ffffff\",\"align\":\"wide\"} -->',\n\t\t\t\t\t\t'<div class=\"wp-block-group alignwide has-background\" style=\"background-color:#ffffff\"><div class=\"wp-block-group__inner-container\"><!-- wp:group -->',\n\t\t\t\t\t\t'<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\"><!-- wp:heading {\"align\":\"center\"} -->',\n\t\t\t\t\t\t'<h2 class=\"has-text-align-center\">' . __( 'Become a Member and Get Exclusive Offers!', 'twentytwenty' ) . '</h2>',\n\t\t\t\t\t\t'<!-- /wp:heading -->',\n\t\t\t\t\t\t'<!-- wp:paragraph {\"align\":\"center\"} -->',\n\t\t\t\t\t\t'<p class=\"has-text-align-center\">' . __( 'Members get access to exclusive exhibits and sales. Our memberships cost $99.99 and are billed annually.', 'twentytwenty' ) . '</p>',\n\t\t\t\t\t\t'<!-- /wp:paragraph -->',\n\t\t\t\t\t\t'<!-- wp:button {\"align\":\"center\"} -->',\n\t\t\t\t\t\t'<div class=\"wp-block-button aligncenter\"><a class=\"wp-block-button__link\" href=\"https://make.wordpress.org/core/2019/09/27/block-editor-theme-related-updates-in-wordpress-5-3/\">' . __( 'Join the Club', 'twentytwenty' ) . '</a></div>',\n\t\t\t\t\t\t'<!-- /wp:button --></div></div>',\n\t\t\t\t\t\t'<!-- /wp:group --></div></div>',\n\t\t\t\t\t\t'<!-- /wp:group -->',\n\t\t\t\t\t\t'<!-- wp:gallery {\"ids\":[39,38],\"align\":\"wide\"} -->',\n\t\t\t\t\t\t'<figure class=\"wp-block-gallery alignwide columns-2 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img src=\"' . get_theme_file_uri() . '/assets/images/2020-square-2.png\" alt=\"\" data-id=\"39\" data-full-url=\"' . get_theme_file_uri() . '/assets/images/2020-square-2.png\" data-link=\"assets/images/2020-square-2/\" class=\"wp-image-39\"/></figure></li><li class=\"blocks-gallery-item\"><figure><img src=\"' . get_theme_file_uri() . '/assets/images/2020-square-1.png\" alt=\"\" data-id=\"38\" data-full-url=\"' . get_theme_file_uri() . '/assets/images/2020-square-1.png\" data-link=\"' . get_theme_file_uri() . '/assets/images/2020-square-1/\" class=\"wp-image-38\"/></figure></li></ul></figure>',\n\t\t\t\t\t\t'<!-- /wp:gallery -->',\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\t'about',\n\t\t\t'contact',\n\t\t\t'blog',\n\t\t),\n\n\t\t// Default to a static front page and assign the front and posts pages.\n\t\t'options'     => array(\n\t\t\t'show_on_front'  => 'page',\n\t\t\t'page_on_front'  => '{{front}}',\n\t\t\t'page_for_posts' => '{{blog}}',\n\t\t),\n\n\t\t// Set up nav menus for each of the two areas registered in the theme.\n\t\t'nav_menus'   => array(\n\t\t\t// Assign a menu to the \"primary\" location.\n\t\t\t'primary'  => array(\n\t\t\t\t'name'  => __( 'Primary', 'twentytwenty' ),\n\t\t\t\t'items' => array(\n\t\t\t\t\t'link_home', // Note that the core \"home\" page is actually a link in case a static front page is not used.\n\t\t\t\t\t'page_about',\n\t\t\t\t\t'page_blog',\n\t\t\t\t\t'page_contact',\n\t\t\t\t),\n\t\t\t),\n\t\t\t// This replicates primary just to demonstrate the expanded menu.\n\t\t\t'expanded' => array(\n\t\t\t\t'name'  => __( 'Primary', 'twentytwenty' ),\n\t\t\t\t'items' => array(\n\t\t\t\t\t'link_home', // Note that the core \"home\" page is actually a link in case a static front page is not used.\n\t\t\t\t\t'page_about',\n\t\t\t\t\t'page_blog',\n\t\t\t\t\t'page_contact',\n\t\t\t\t),\n\t\t\t),\n\t\t\t// Assign a menu to the \"social\" location.\n\t\t\t'social'   => array(\n\t\t\t\t'name'  => __( 'Social Links Menu', 'twentytwenty' ),\n\t\t\t\t'items' => array(\n\t\t\t\t\t'link_yelp',\n\t\t\t\t\t'link_facebook',\n\t\t\t\t\t'link_twitter',\n\t\t\t\t\t'link_instagram',\n\t\t\t\t\t'link_email',\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t);\n\n\t/**\n\t * Filters Twenty Twenty array of starter content.\n\t *\n\t * @since Twenty Twenty 1.0\n\t *\n\t * @param array $starter_content Array of starter content.\n\t */\n\treturn apply_filters( 'twentytwenty_starter_content', $starter_content );\n\n}\n", "num_lines": 219}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Twenty Twenty SVG Icon helper functions\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\nif ( ! function_exists( 'twentytwenty_the_theme_svg' ) ) {\n\t/**\n\t * Output and Get Theme SVG.\n\t * Output and get the SVG markup for an icon in the TwentyTwenty_SVG_Icons class.\n\t *\n\t * @param string $svg_name The name of the icon.\n\t * @param string $group The group the icon belongs to.\n\t * @param string $color Color code.\n\t */\n\tfunction twentytwenty_the_theme_svg( $svg_name, $group = 'ui', $color = '' ) {\n\t\techo twentytwenty_get_theme_svg( $svg_name, $group, $color ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in twentytwenty_get_theme_svg().\n\t}\n}\n\nif ( ! function_exists( 'twentytwenty_get_theme_svg' ) ) {\n\n\t/**\n\t * Get information about the SVG icon.\n\t *\n\t * @param string $svg_name The name of the icon.\n\t * @param string $group The group the icon belongs to.\n\t * @param string $color Color code.\n\t */\n\tfunction twentytwenty_get_theme_svg( $svg_name, $group = 'ui', $color = '' ) {\n\n\t\t// Make sure that only our allowed tags and attributes are included.\n\t\t$svg = wp_kses(\n\t\t\tTwentyTwenty_SVG_Icons::get_svg( $svg_name, $group, $color ),\n\t\t\tarray(\n\t\t\t\t'svg'     => array(\n\t\t\t\t\t'class'       => true,\n\t\t\t\t\t'xmlns'       => true,\n\t\t\t\t\t'width'       => true,\n\t\t\t\t\t'height'      => true,\n\t\t\t\t\t'viewbox'     => true,\n\t\t\t\t\t'aria-hidden' => true,\n\t\t\t\t\t'role'        => true,\n\t\t\t\t\t'focusable'   => true,\n\t\t\t\t),\n\t\t\t\t'path'    => array(\n\t\t\t\t\t'fill'      => true,\n\t\t\t\t\t'fill-rule' => true,\n\t\t\t\t\t'd'         => true,\n\t\t\t\t\t'transform' => true,\n\t\t\t\t),\n\t\t\t\t'polygon' => array(\n\t\t\t\t\t'fill'      => true,\n\t\t\t\t\t'fill-rule' => true,\n\t\t\t\t\t'points'    => true,\n\t\t\t\t\t'transform' => true,\n\t\t\t\t\t'focusable' => true,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\tif ( ! $svg ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $svg;\n\t}\n}\n", "num_lines": 71}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Custom template tags for this theme.\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\n/**\n * Table of Contents:\n * Logo & Description\n * Comments\n * Post Meta\n * Menus\n * Classes\n * Archives\n * Miscellaneous\n */\n\n/**\n * Logo & Description\n */\n\n/**\n * Displays the site logo, either text or image.\n *\n * @param array   $args Arguments for displaying the site logo either as an image or text.\n * @param boolean $echo Echo or return the HTML.\n * @return string Compiled HTML based on our arguments.\n */\nfunction twentytwenty_site_logo( $args = array(), $echo = true ) {\n\t$logo       = get_custom_logo();\n\t$site_title = get_bloginfo( 'name' );\n\t$contents   = '';\n\t$classname  = '';\n\n\t$defaults = array(\n\t\t'logo'        => '%1$s<span class=\"screen-reader-text\">%2$s</span>',\n\t\t'logo_class'  => 'site-logo',\n\t\t'title'       => '<a href=\"%1$s\">%2$s</a>',\n\t\t'title_class' => 'site-title',\n\t\t'home_wrap'   => '<h1 class=\"%1$s\">%2$s</h1>',\n\t\t'single_wrap' => '<div class=\"%1$s faux-heading\">%2$s</div>',\n\t\t'condition'   => ( is_front_page() || is_home() ) && ! is_page(),\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\t/**\n\t * Filters the arguments for `twentytwenty_site_logo()`.\n\t *\n\t * @param array  $args     Parsed arguments.\n\t * @param array  $defaults Function's default arguments.\n\t */\n\t$args = apply_filters( 'twentytwenty_site_logo_args', $args, $defaults );\n\n\tif ( has_custom_logo() ) {\n\t\t$contents  = sprintf( $args['logo'], $logo, esc_html( $site_title ) );\n\t\t$classname = $args['logo_class'];\n\t} else {\n\t\t$contents  = sprintf( $args['title'], esc_url( get_home_url( null, '/' ) ), esc_html( $site_title ) );\n\t\t$classname = $args['title_class'];\n\t}\n\n\t$wrap = $args['condition'] ? 'home_wrap' : 'single_wrap';\n\n\t$html = sprintf( $args[ $wrap ], $classname, $contents );\n\n\t/**\n\t * Filters the arguments for `twentytwenty_site_logo()`.\n\t *\n\t * @param string $html      Compiled HTML based on our arguments.\n\t * @param array  $args      Parsed arguments.\n\t * @param string $classname Class name based on current view, home or single.\n\t * @param string $contents  HTML for site title or logo.\n\t */\n\t$html = apply_filters( 'twentytwenty_site_logo', $html, $args, $classname, $contents );\n\n\tif ( ! $echo ) {\n\t\treturn $html;\n\t}\n\n\techo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\n}\n\n/**\n * Displays the site description.\n *\n * @param boolean $echo Echo or return the html.\n * @return string The HTML to display.\n */\nfunction twentytwenty_site_description( $echo = true ) {\n\t$description = get_bloginfo( 'description' );\n\n\tif ( ! $description ) {\n\t\treturn;\n\t}\n\n\t$wrapper = '<div class=\"site-description\">%s</div><!-- .site-description -->';\n\n\t$html = sprintf( $wrapper, esc_html( $description ) );\n\n\t/**\n\t * Filters the HTML for the site description.\n\t *\n\t * @since Twenty Twenty 1.0\n\t *\n\t * @param string $html         The HTML to display.\n\t * @param string $description  Site description via `bloginfo()`.\n\t * @param string $wrapper      The format used in case you want to reuse it in a `sprintf()`.\n\t */\n\t$html = apply_filters( 'twentytwenty_site_description', $html, $description, $wrapper );\n\n\tif ( ! $echo ) {\n\t\treturn $html;\n\t}\n\n\techo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n}\n\n/**\n * Comments\n */\n\n/**\n * Checks if the specified comment is written by the author of the post commented on.\n *\n * @param object $comment Comment data.\n * @return bool\n */\nfunction twentytwenty_is_comment_by_post_author( $comment = null ) {\n\n\tif ( is_object( $comment ) && $comment->user_id > 0 ) {\n\n\t\t$user = get_userdata( $comment->user_id );\n\t\t$post = get_post( $comment->comment_post_ID );\n\n\t\tif ( ! empty( $user ) && ! empty( $post ) ) {\n\n\t\t\treturn $comment->user_id === $post->post_author;\n\n\t\t}\n\t}\n\treturn false;\n\n}\n\n/**\n * Filters comment reply link to not JS scroll.\n *\n * Filter the comment reply link to add a class indicating it should not use JS slow-scroll, as it\n * makes it scroll to the wrong position on the page.\n *\n * @param string $link Link to the top of the page.\n * @return string Link to the top of the page.\n */\nfunction twentytwenty_filter_comment_reply_link( $link ) {\n\n\t$link = str_replace( 'class=\\'', 'class=\\'do-not-scroll ', $link );\n\treturn $link;\n\n}\n\nadd_filter( 'comment_reply_link', 'twentytwenty_filter_comment_reply_link' );\n\n/**\n * Post Meta\n */\n\n/**\n * Retrieves and displays the post meta.\n *\n * If it's a single post, outputs the post meta values specified in the Customizer settings.\n *\n * @param int    $post_id  The ID of the post for which the post meta should be output.\n * @param string $location Which post meta location to output \u00e2\u20ac\u201c single or preview.\n */\nfunction twentytwenty_the_post_meta( $post_id = null, $location = 'single-top' ) {\n\n\techo twentytwenty_get_post_meta( $post_id, $location ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in twentytwenty_get_post_meta().\n\n}\n\n/**\n * Filters the edit post link to add an icon and use the post meta structure.\n *\n * @param string $link    Anchor tag for the edit link.\n * @param int    $post_id Post ID.\n * @param string $text    Anchor text.\n */\nfunction twentytwenty_edit_post_link( $link, $post_id, $text ) {\n\tif ( is_admin() ) {\n\t\treturn $link;\n\t}\n\n\t$edit_url = get_edit_post_link( $post_id );\n\n\tif ( ! $edit_url ) {\n\t\treturn;\n\t}\n\n\t$text = sprintf(\n\t\twp_kses(\n\t\t\t/* translators: %s: Post title. Only visible to screen readers. */\n\t\t\t__( 'Edit <span class=\"screen-reader-text\">%s</span>', 'twentytwenty' ),\n\t\t\tarray(\n\t\t\t\t'span' => array(\n\t\t\t\t\t'class' => array(),\n\t\t\t\t),\n\t\t\t)\n\t\t),\n\t\tget_the_title( $post_id )\n\t);\n\n\treturn '<div class=\"post-meta-wrapper post-meta-edit-link-wrapper\"><ul class=\"post-meta\"><li class=\"post-edit meta-wrapper\"><span class=\"meta-icon\">' . twentytwenty_get_theme_svg( 'edit' ) . '</span><span class=\"meta-text\"><a href=\"' . esc_url( $edit_url ) . '\">' . $text . '</a></span></li></ul><!-- .post-meta --></div><!-- .post-meta-wrapper -->';\n\n}\n\nadd_filter( 'edit_post_link', 'twentytwenty_edit_post_link', 10, 3 );\n\n/**\n * Retrieves the post meta.\n *\n * @param int    $post_id The ID of the post.\n * @param string $location The location where the meta is shown.\n */\nfunction twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' ) {\n\n\t// Require post ID.\n\tif ( ! $post_id ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Filters post types array.\n\t *\n\t * This filter can be used to hide post meta information of post, page or custom post type\n\t * registered by child themes or plugins.\n\t *\n\t * @since Twenty Twenty 1.0\n\t *\n\t * @param array Array of post types\n\t */\n\t$disallowed_post_types = apply_filters( 'twentytwenty_disallowed_post_types_for_meta_output', array( 'page' ) );\n\n\t// Check whether the post type is allowed to output post meta.\n\tif ( in_array( get_post_type( $post_id ), $disallowed_post_types, true ) ) {\n\t\treturn;\n\t}\n\n\t$post_meta_wrapper_classes = '';\n\t$post_meta_classes         = '';\n\n\t// Get the post meta settings for the location specified.\n\tif ( 'single-top' === $location ) {\n\t\t/**\n\t\t * Filters post meta info visibility.\n\t\t *\n\t\t * Use this filter to hide post meta information like Author, Post date, Comments, Is sticky status.\n\t\t *\n\t\t * @since Twenty Twenty 1.0\n\t\t *\n\t\t * @param array $args {\n\t\t *  @type string 'author'\n\t\t *  @type string 'post-date'\n\t\t *  @type string 'comments'\n\t\t *  @type string 'sticky'\n\t\t * }\n\t\t */\n\t\t$post_meta = apply_filters(\n\t\t\t'twentytwenty_post_meta_location_single_top',\n\t\t\tarray(\n\t\t\t\t'author',\n\t\t\t\t'post-date',\n\t\t\t\t'comments',\n\t\t\t\t'sticky',\n\t\t\t)\n\t\t);\n\n\t\t$post_meta_wrapper_classes = ' post-meta-single post-meta-single-top';\n\n\t} elseif ( 'single-bottom' === $location ) {\n\n\t\t/**\n\t\t * Filters post tags visibility.\n\t\t *\n\t\t * Use this filter to hide post tags.\n\t\t *\n\t\t * @since Twenty Twenty 1.0\n\t\t *\n\t\t * @param array $args {\n\t\t *   @type string 'tags'\n\t\t * }\n\t\t */\n\t\t$post_meta = apply_filters(\n\t\t\t'twentytwenty_post_meta_location_single_bottom',\n\t\t\tarray(\n\t\t\t\t'tags',\n\t\t\t)\n\t\t);\n\n\t\t$post_meta_wrapper_classes = ' post-meta-single post-meta-single-bottom';\n\n\t}\n\n\t// If the post meta setting has the value 'empty', it's explicitly empty and the default post meta shouldn't be output.\n\tif ( $post_meta && ! in_array( 'empty', $post_meta, true ) ) {\n\n\t\t// Make sure we don't output an empty container.\n\t\t$has_meta = false;\n\n\t\tglobal $post;\n\t\t$the_post = get_post( $post_id );\n\t\tsetup_postdata( $the_post );\n\n\t\tob_start();\n\n\t\t?>\n\n\t\t<div class=\"post-meta-wrapper<?php echo esc_attr( $post_meta_wrapper_classes ); ?>\">\n\n\t\t\t<ul class=\"post-meta<?php echo esc_attr( $post_meta_classes ); ?>\">\n\n\t\t\t\t<?php\n\n\t\t\t\t/**\n\t\t\t\t * Fires before post meta HTML display.\n\t\t\t\t *\n\t\t\t\t * Allow output of additional post meta info to be added by child themes and plugins.\n\t\t\t\t *\n\t\t\t\t * @since Twenty Twenty 1.0\n\t\t\t\t * @since Twenty Twenty 1.1 Added the `$post_meta` and `$location` parameters.\n\t\t\t\t *\n\t\t\t\t * @param int    $post_id   Post ID.\n\t\t\t\t * @param array  $post_meta An array of post meta information.\n\t\t\t\t * @param string $location  The location where the meta is shown.\n\t\t\t\t *                          Accepts 'single-top' or 'single-bottom'.\n\t\t\t\t */\n\t\t\t\tdo_action( 'twentytwenty_start_of_post_meta_list', $post_id, $post_meta, $location );\n\n\t\t\t\t// Author.\n\t\t\t\tif ( post_type_supports( get_post_type( $post_id ), 'author' ) && in_array( 'author', $post_meta, true ) ) {\n\n\t\t\t\t\t$has_meta = true;\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"post-author meta-wrapper\">\n\t\t\t\t\t\t<span class=\"meta-icon\">\n\t\t\t\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Post author', 'twentytwenty' ); ?></span>\n\t\t\t\t\t\t\t<?php twentytwenty_the_theme_svg( 'user' ); ?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"meta-text\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: Author name. */\n\t\t\t\t\t\t\t\t__( 'By %s', 'twentytwenty' ),\n\t\t\t\t\t\t\t\t'<a href=\"' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '\">' . esc_html( get_the_author_meta( 'display_name' ) ) . '</a>'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<?php\n\n\t\t\t\t}\n\n\t\t\t\t// Post date.\n\t\t\t\tif ( in_array( 'post-date', $post_meta, true ) ) {\n\n\t\t\t\t\t$has_meta = true;\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"post-date meta-wrapper\">\n\t\t\t\t\t\t<span class=\"meta-icon\">\n\t\t\t\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Post date', 'twentytwenty' ); ?></span>\n\t\t\t\t\t\t\t<?php twentytwenty_the_theme_svg( 'calendar' ); ?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"meta-text\">\n\t\t\t\t\t\t\t<a href=\"<?php the_permalink(); ?>\"><?php the_time( get_option( 'date_format' ) ); ?></a>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<?php\n\n\t\t\t\t}\n\n\t\t\t\t// Categories.\n\t\t\t\tif ( in_array( 'categories', $post_meta, true ) && has_category() ) {\n\n\t\t\t\t\t$has_meta = true;\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"post-categories meta-wrapper\">\n\t\t\t\t\t\t<span class=\"meta-icon\">\n\t\t\t\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Categories', 'twentytwenty' ); ?></span>\n\t\t\t\t\t\t\t<?php twentytwenty_the_theme_svg( 'folder' ); ?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"meta-text\">\n\t\t\t\t\t\t\t<?php _ex( 'In', 'A string that is output before one or more categories', 'twentytwenty' ); ?> <?php the_category( ', ' ); ?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<?php\n\n\t\t\t\t}\n\n\t\t\t\t// Tags.\n\t\t\t\tif ( in_array( 'tags', $post_meta, true ) && has_tag() ) {\n\n\t\t\t\t\t$has_meta = true;\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"post-tags meta-wrapper\">\n\t\t\t\t\t\t<span class=\"meta-icon\">\n\t\t\t\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Tags', 'twentytwenty' ); ?></span>\n\t\t\t\t\t\t\t<?php twentytwenty_the_theme_svg( 'tag' ); ?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"meta-text\">\n\t\t\t\t\t\t\t<?php the_tags( '', ', ', '' ); ?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<?php\n\n\t\t\t\t}\n\n\t\t\t\t// Comments link.\n\t\t\t\tif ( in_array( 'comments', $post_meta, true ) && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {\n\n\t\t\t\t\t$has_meta = true;\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"post-comment-link meta-wrapper\">\n\t\t\t\t\t\t<span class=\"meta-icon\">\n\t\t\t\t\t\t\t<?php twentytwenty_the_theme_svg( 'comment' ); ?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"meta-text\">\n\t\t\t\t\t\t\t<?php comments_popup_link(); ?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<?php\n\n\t\t\t\t}\n\n\t\t\t\t// Sticky.\n\t\t\t\tif ( in_array( 'sticky', $post_meta, true ) && is_sticky() ) {\n\n\t\t\t\t\t$has_meta = true;\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"post-sticky meta-wrapper\">\n\t\t\t\t\t\t<span class=\"meta-icon\">\n\t\t\t\t\t\t\t<?php twentytwenty_the_theme_svg( 'bookmark' ); ?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"meta-text\">\n\t\t\t\t\t\t\t<?php _e( 'Sticky post', 'twentytwenty' ); ?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<?php\n\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Fires after post meta HTML display.\n\t\t\t\t *\n\t\t\t\t * Allow output of additional post meta info to be added by child themes and plugins.\n\t\t\t\t *\n\t\t\t\t * @since Twenty Twenty 1.0\n\t\t\t\t * @since Twenty Twenty 1.1 Added the `$post_meta` and `$location` parameters.\n\t\t\t\t *\n\t\t\t\t * @param int    $post_id   Post ID.\n\t\t\t\t * @param array  $post_meta An array of post meta information.\n\t\t\t\t * @param string $location  The location where the meta is shown.\n\t\t\t\t *                          Accepts 'single-top' or 'single-bottom'.\n\t\t\t\t */\n\t\t\t\tdo_action( 'twentytwenty_end_of_post_meta_list', $post_id, $post_meta, $location );\n\n\t\t\t\t?>\n\n\t\t\t</ul><!-- .post-meta -->\n\n\t\t</div><!-- .post-meta-wrapper -->\n\n\t\t<?php\n\n\t\twp_reset_postdata();\n\n\t\t$meta_output = ob_get_clean();\n\n\t\t// If there is meta to output, return it.\n\t\tif ( $has_meta && $meta_output ) {\n\n\t\t\treturn $meta_output;\n\n\t\t}\n\t}\n\n}\n\n/**\n * Menus\n */\n\n/**\n * Filters classes of wp_list_pages items to match menu items.\n *\n * Filter the class applied to wp_list_pages() items with children to match the menu class, to simplify.\n * styling of sub levels in the fallback. Only applied if the match_menu_classes argument is set.\n *\n * @param string[] $css_class    An array of CSS classes to be applied to each list item.\n * @param WP_Post  $page         Page data object.\n * @param int      $depth        Depth of page, used for padding.\n * @param array    $args         An array of arguments.\n * @param int      $current_page ID of the current page.\n * @return array CSS class names.\n */\nfunction twentytwenty_filter_wp_list_pages_item_classes( $css_class, $page, $depth, $args, $current_page ) {\n\n\t// Only apply to wp_list_pages() calls with match_menu_classes set to true.\n\t$match_menu_classes = isset( $args['match_menu_classes'] );\n\n\tif ( ! $match_menu_classes ) {\n\t\treturn $css_class;\n\t}\n\n\t// Add current menu item class.\n\tif ( in_array( 'current_page_item', $css_class, true ) ) {\n\t\t$css_class[] = 'current-menu-item';\n\t}\n\n\t// Add menu item has children class.\n\tif ( in_array( 'page_item_has_children', $css_class, true ) ) {\n\t\t$css_class[] = 'menu-item-has-children';\n\t}\n\n\treturn $css_class;\n\n}\n\nadd_filter( 'page_css_class', 'twentytwenty_filter_wp_list_pages_item_classes', 10, 5 );\n\n/**\n * Adds a Sub Nav Toggle to the Expanded Menu and Mobile Menu.\n *\n * @param stdClass $args  An object of wp_nav_menu() arguments.\n * @param WP_Post  $item  Menu item data object.\n * @param int      $depth Depth of menu item. Used for padding.\n * @return stdClass An object of wp_nav_menu() arguments.\n */\nfunction twentytwenty_add_sub_toggles_to_main_menu( $args, $item, $depth ) {\n\n\t// Add sub menu toggles to the Expanded Menu with toggles.\n\tif ( isset( $args->show_toggles ) && $args->show_toggles ) {\n\n\t\t// Wrap the menu item link contents in a div, used for positioning.\n\t\t$args->before = '<div class=\"ancestor-wrapper\">';\n\t\t$args->after  = '';\n\n\t\t// Add a toggle to items with children.\n\t\tif ( in_array( 'menu-item-has-children', $item->classes, true ) ) {\n\n\t\t\t$toggle_target_string = '.menu-modal .menu-item-' . $item->ID . ' > .sub-menu';\n\t\t\t$toggle_duration      = twentytwenty_toggle_duration();\n\n\t\t\t// Add the sub menu toggle.\n\t\t\t$args->after .= '<button class=\"toggle sub-menu-toggle fill-children-current-color\" data-toggle-target=\"' . $toggle_target_string . '\" data-toggle-type=\"slidetoggle\" data-toggle-duration=\"' . absint( $toggle_duration ) . '\" aria-expanded=\"false\"><span class=\"screen-reader-text\">' . __( 'Show sub menu', 'twentytwenty' ) . '</span>' . twentytwenty_get_theme_svg( 'chevron-down' ) . '</button>';\n\n\t\t}\n\n\t\t// Close the wrapper.\n\t\t$args->after .= '</div><!-- .ancestor-wrapper -->';\n\n\t\t// Add sub menu icons to the primary menu without toggles.\n\t} elseif ( 'primary' === $args->theme_location ) {\n\t\tif ( in_array( 'menu-item-has-children', $item->classes, true ) ) {\n\t\t\t$args->after = '<span class=\"icon\"></span>';\n\t\t} else {\n\t\t\t$args->after = '';\n\t\t}\n\t}\n\n\treturn $args;\n\n}\n\nadd_filter( 'nav_menu_item_args', 'twentytwenty_add_sub_toggles_to_main_menu', 10, 3 );\n\n/**\n * Displays SVG icons in social links menu.\n *\n * @param string   $item_output The menu item's starting HTML output.\n * @param WP_Post  $item        Menu item data object.\n * @param int      $depth       Depth of the menu. Used for padding.\n * @param stdClass $args        An object of wp_nav_menu() arguments.\n * @return string The menu item output with social icon.\n */\nfunction twentytwenty_nav_menu_social_icons( $item_output, $item, $depth, $args ) {\n\t// Change SVG icon inside social links menu if there is supported URL.\n\tif ( 'social' === $args->theme_location ) {\n\t\t$svg = TwentyTwenty_SVG_Icons::get_social_link_svg( $item->url );\n\t\tif ( empty( $svg ) ) {\n\t\t\t$svg = twentytwenty_get_theme_svg( 'link' );\n\t\t}\n\t\t$item_output = str_replace( $args->link_after, '</span>' . $svg, $item_output );\n\t}\n\n\treturn $item_output;\n}\n\nadd_filter( 'walker_nav_menu_start_el', 'twentytwenty_nav_menu_social_icons', 10, 4 );\n\n/**\n * Classes\n */\n\n/**\n * Adds 'no-js' class.\n *\n * If we're missing JavaScript support, the HTML element will have a 'no-js' class.\n */\nfunction twentytwenty_no_js_class() {\n\n\t?>\n\t<script>document.documentElement.className = document.documentElement.className.replace( 'no-js', 'js' );</script>\n\t<?php\n\n}\n\nadd_action( 'wp_head', 'twentytwenty_no_js_class' );\n\n/**\n * Adds conditional body classes.\n *\n * @param array $classes Classes added to the body tag.\n * @return array Classes added to the body tag.\n */\nfunction twentytwenty_body_classes( $classes ) {\n\n\tglobal $post;\n\t$post_type = isset( $post ) ? $post->post_type : false;\n\n\t// Check whether we're singular.\n\tif ( is_singular() ) {\n\t\t$classes[] = 'singular';\n\t}\n\n\t// Check whether the current page should have an overlay header.\n\tif ( is_page_template( array( 'templates/template-cover.php' ) ) ) {\n\t\t$classes[] = 'overlay-header';\n\t}\n\n\t// Check whether the current page has full-width content.\n\tif ( is_page_template( array( 'templates/template-full-width.php' ) ) ) {\n\t\t$classes[] = 'has-full-width-content';\n\t}\n\n\t// Check for enabled search.\n\tif ( true === get_theme_mod( 'enable_header_search', true ) ) {\n\t\t$classes[] = 'enable-search-modal';\n\t}\n\n\t// Check for post thumbnail.\n\tif ( is_singular() && has_post_thumbnail() ) {\n\t\t$classes[] = 'has-post-thumbnail';\n\t} elseif ( is_singular() ) {\n\t\t$classes[] = 'missing-post-thumbnail';\n\t}\n\n\t// Check whether we're in the customizer preview.\n\tif ( is_customize_preview() ) {\n\t\t$classes[] = 'customizer-preview';\n\t}\n\n\t// Check if posts have single pagination.\n\tif ( is_single() && ( get_next_post() || get_previous_post() ) ) {\n\t\t$classes[] = 'has-single-pagination';\n\t} else {\n\t\t$classes[] = 'has-no-pagination';\n\t}\n\n\t// Check if we're showing comments.\n\tif ( $post && ( ( 'post' === $post_type || comments_open() || get_comments_number() ) && ! post_password_required() ) ) {\n\t\t$classes[] = 'showing-comments';\n\t} else {\n\t\t$classes[] = 'not-showing-comments';\n\t}\n\n\t// Check if avatars are visible.\n\t$classes[] = get_option( 'show_avatars' ) ? 'show-avatars' : 'hide-avatars';\n\n\t// Slim page template class names (class = name - file suffix).\n\tif ( is_page_template() ) {\n\t\t$classes[] = basename( get_page_template_slug(), '.php' );\n\t}\n\n\t// Check for the elements output in the top part of the footer.\n\t$has_footer_menu = has_nav_menu( 'footer' );\n\t$has_social_menu = has_nav_menu( 'social' );\n\t$has_sidebar_1   = is_active_sidebar( 'sidebar-1' );\n\t$has_sidebar_2   = is_active_sidebar( 'sidebar-2' );\n\n\t// Add a class indicating whether those elements are output.\n\tif ( $has_footer_menu || $has_social_menu || $has_sidebar_1 || $has_sidebar_2 ) {\n\t\t$classes[] = 'footer-top-visible';\n\t} else {\n\t\t$classes[] = 'footer-top-hidden';\n\t}\n\n\t// Get header/footer background color.\n\t$header_footer_background = get_theme_mod( 'header_footer_background_color', '#ffffff' );\n\t$header_footer_background = strtolower( '#' . ltrim( $header_footer_background, '#' ) );\n\n\t// Get content background color.\n\t$background_color = get_theme_mod( 'background_color', 'f5efe0' );\n\t$background_color = strtolower( '#' . ltrim( $background_color, '#' ) );\n\n\t// Add extra class if main background and header/footer background are the same color.\n\tif ( $background_color === $header_footer_background ) {\n\t\t$classes[] = 'reduced-spacing';\n\t}\n\n\treturn $classes;\n\n}\n\nadd_filter( 'body_class', 'twentytwenty_body_classes' );\n\n/**\n * Archives\n */\n\n/**\n * Filters the archive title and styles the word before the first colon.\n *\n * @param string $title Current archive title.\n * @return string Current archive title.\n */\nfunction twentytwenty_get_the_archive_title( $title ) {\n\n\t$regex = apply_filters(\n\t\t'twentytwenty_get_the_archive_title_regex',\n\t\tarray(\n\t\t\t'pattern'     => '/(\\A[^\\:]+\\:)/',\n\t\t\t'replacement' => '<span class=\"color-accent\">$1</span>',\n\t\t)\n\t);\n\n\tif ( empty( $regex ) ) {\n\n\t\treturn $title;\n\n\t}\n\n\treturn preg_replace( $regex['pattern'], $regex['replacement'], $title );\n\n}\n\nadd_filter( 'get_the_archive_title', 'twentytwenty_get_the_archive_title' );\n\n/**\n * Miscellaneous\n */\n\n/**\n * Toggles animation duration in milliseconds.\n *\n * @return int Duration in milliseconds\n */\nfunction twentytwenty_toggle_duration() {\n\t/**\n\t * Filters the animation duration/speed used usually for submenu toggles.\n\t *\n\t * @since Twenty Twenty 1.0\n\t *\n\t * @param int $duration Duration in milliseconds.\n\t */\n\t$duration = apply_filters( 'twentytwenty_toggle_duration', 250 );\n\n\treturn $duration;\n}\n\n/**\n * Gets unique ID.\n *\n * This is a PHP implementation of Underscore's uniqueId method. A static variable\n * contains an integer that is incremented with each call. This number is returned\n * with the optional prefix. As such the returned value is not universally unique,\n * but it is unique across the life of the PHP process.\n *\n * @see wp_unique_id() Themes requiring WordPress 5.0.3 and greater should use this instead.\n *\n * @param string $prefix Prefix for the returned ID.\n * @return string Unique ID.\n */\nfunction twentytwenty_unique_id( $prefix = '' ) {\n\tstatic $id_counter = 0;\n\tif ( function_exists( 'wp_unique_id' ) ) {\n\t\treturn wp_unique_id( $prefix );\n\t}\n\treturn $prefix . (string) ++$id_counter;\n}\n", "num_lines": 794}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays the content when the cover template is used.\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\n?>\n\n<article <?php post_class(); ?> id=\"post-<?php the_ID(); ?>\">\n\t<?php\n\t// On the cover page template, output the cover header.\n\t$cover_header_style   = '';\n\t$cover_header_classes = '';\n\n\t$color_overlay_style   = '';\n\t$color_overlay_classes = '';\n\n\t$image_url = ! post_password_required() ? get_the_post_thumbnail_url( get_the_ID(), 'twentytwenty-fullscreen' ) : '';\n\n\tif ( $image_url ) {\n\t\t$cover_header_style   = ' style=\"background-image: url( ' . esc_url( $image_url ) . ' );\"';\n\t\t$cover_header_classes = ' bg-image';\n\t}\n\n\t// Get the color used for the color overlay.\n\t$color_overlay_color = get_theme_mod( 'cover_template_overlay_background_color' );\n\tif ( $color_overlay_color ) {\n\t\t$color_overlay_style = ' style=\"color: ' . esc_attr( $color_overlay_color ) . ';\"';\n\t} else {\n\t\t$color_overlay_style = '';\n\t}\n\n\t// Get the fixed background attachment option.\n\tif ( get_theme_mod( 'cover_template_fixed_background', true ) ) {\n\t\t$cover_header_classes .= ' bg-attachment-fixed';\n\t}\n\n\t// Get the opacity of the color overlay.\n\t$color_overlay_opacity  = get_theme_mod( 'cover_template_overlay_opacity' );\n\t$color_overlay_opacity  = ( false === $color_overlay_opacity ) ? 80 : $color_overlay_opacity;\n\t$color_overlay_classes .= ' opacity-' . $color_overlay_opacity;\n\t?>\n\n\t<div class=\"cover-header <?php echo $cover_header_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>\"<?php echo $cover_header_style; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- We need to double check this, but for now, we want to pass PHPCS ;) ?>>\n\t\t<div class=\"cover-header-inner-wrapper screen-height\">\n\t\t\t<div class=\"cover-header-inner\">\n\t\t\t\t<div class=\"cover-color-overlay color-accent<?php echo esc_attr( $color_overlay_classes ); ?>\"<?php echo $color_overlay_style; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- We need to double check this, but for now, we want to pass PHPCS ;) ?>></div>\n\n\t\t\t\t\t<header class=\"entry-header has-text-align-center\">\n\t\t\t\t\t\t<div class=\"entry-header-inner section-inner medium\">\n\n\t\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Allow child themes and plugins to filter the display of the categories in the article header.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @since Twenty Twenty 1.0\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @param bool Whether to show the categories in article header, Default true.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t$show_categories = apply_filters( 'twentytwenty_show_categories_in_entry_header', true );\n\n\t\t\t\t\t\t\tif ( true === $show_categories && has_category() ) {\n\t\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t\t<div class=\"entry-categories\">\n\t\t\t\t\t\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Categories', 'twentytwenty' ); ?></span>\n\t\t\t\t\t\t\t\t\t<div class=\"entry-categories-inner\">\n\t\t\t\t\t\t\t\t\t\t<?php the_category( ' ' ); ?>\n\t\t\t\t\t\t\t\t\t</div><!-- .entry-categories-inner -->\n\t\t\t\t\t\t\t\t</div><!-- .entry-categories -->\n\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthe_title( '<h1 class=\"entry-title\">', '</h1>' );\n\n\t\t\t\t\t\t\tif ( is_page() ) {\n\t\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t\t<div class=\"to-the-content-wrapper\">\n\n\t\t\t\t\t\t\t\t\t<a href=\"#post-inner\" class=\"to-the-content fill-children-current-color\">\n\t\t\t\t\t\t\t\t\t\t<?php twentytwenty_the_theme_svg( 'arrow-down' ); ?>\n\t\t\t\t\t\t\t\t\t\t<div class=\"screen-reader-text\"><?php _e( 'Scroll Down', 'twentytwenty' ); ?></div>\n\t\t\t\t\t\t\t\t\t</a><!-- .to-the-content -->\n\n\t\t\t\t\t\t\t\t</div><!-- .to-the-content-wrapper -->\n\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t$intro_text_width = '';\n\n\t\t\t\t\t\t\t\tif ( is_singular() ) {\n\t\t\t\t\t\t\t\t\t$intro_text_width = ' small';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$intro_text_width = ' thin';\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( has_excerpt() ) {\n\t\t\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t\t\t<div class=\"intro-text section-inner max-percentage<?php echo esc_attr( $intro_text_width ); ?>\">\n\t\t\t\t\t\t\t\t\t\t<?php the_excerpt(); ?>\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttwentytwenty_the_post_meta( get_the_ID(), 'single-top' );\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t</div><!-- .entry-header-inner -->\n\t\t\t\t\t</header><!-- .entry-header -->\n\n\t\t\t</div><!-- .cover-header-inner -->\n\t\t</div><!-- .cover-header-inner-wrapper -->\n\t</div><!-- .cover-header -->\n\n\t<div class=\"post-inner\" id=\"post-inner\">\n\n\t\t<div class=\"entry-content\">\n\n\t\t<?php\n\t\tthe_content();\n\t\t?>\n\n\t\t</div><!-- .entry-content -->\n\t\t<?php\n\t\twp_link_pages(\n\t\t\tarray(\n\t\t\t\t'before'      => '<nav class=\"post-nav-links bg-light-background\" aria-label=\"' . esc_attr__( 'Page', 'twentytwenty' ) . '\"><span class=\"label\">' . __( 'Pages:', 'twentytwenty' ) . '</span>',\n\t\t\t\t'after'       => '</nav>',\n\t\t\t\t'link_before' => '<span class=\"page-number\">',\n\t\t\t\t'link_after'  => '</span>',\n\t\t\t)\n\t\t);\n\n\t\tedit_post_link();\n\t\t// Single bottom post meta.\n\t\ttwentytwenty_the_post_meta( get_the_ID(), 'single-bottom' );\n\n\t\tif ( post_type_supports( get_post_type( get_the_ID() ), 'author' ) && is_single() ) {\n\n\t\t\tget_template_part( 'template-parts/entry-author-bio' );\n\n\t\t}\n\t\t?>\n\n\t</div><!-- .post-inner -->\n\n\t<?php\n\n\tif ( is_single() ) {\n\n\t\tget_template_part( 'template-parts/navigation' );\n\t}\n\n\t/**\n\t *  Output comments wrapper if it's a post, or if comments are open,\n\t * or if there's a comment number \u00e2\u20ac\u201c and check for password.\n\t * */\n\tif ( ( is_single() || is_page() ) && ( comments_open() || get_comments_number() ) && ! post_password_required() ) {\n\t\t?>\n\n\t\t<div class=\"comments-wrapper section-inner\">\n\n\t\t\t<?php comments_template(); ?>\n\n\t\t</div><!-- .comments-wrapper -->\n\n\t\t<?php\n\t}\n\t?>\n\n</article><!-- .post -->\n", "num_lines": 183}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The default template for displaying content\n *\n * Used for both singular and index.\n *\n * @link https://developer.wordpress.org/themes/basics/template-hierarchy/\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\n?>\n\n<article <?php post_class(); ?> id=\"post-<?php the_ID(); ?>\">\n\n\t<?php\n\n\tget_template_part( 'template-parts/entry-header' );\n\n\tif ( ! is_search() ) {\n\t\tget_template_part( 'template-parts/featured-image' );\n\t}\n\n\t?>\n\n\t<div class=\"post-inner <?php echo is_page_template( 'templates/template-full-width.php' ) ? '' : 'thin'; ?> \">\n\n\t\t<div class=\"entry-content\">\n\n\t\t\t<?php\n\t\t\tif ( is_search() || ! is_singular() && 'summary' === get_theme_mod( 'blog_content', 'full' ) ) {\n\t\t\t\tthe_excerpt();\n\t\t\t} else {\n\t\t\t\tthe_content( __( 'Continue reading', 'twentytwenty' ) );\n\t\t\t}\n\t\t\t?>\n\n\t\t</div><!-- .entry-content -->\n\n\t</div><!-- .post-inner -->\n\n\t<div class=\"section-inner\">\n\t\t<?php\n\t\twp_link_pages(\n\t\t\tarray(\n\t\t\t\t'before'      => '<nav class=\"post-nav-links bg-light-background\" aria-label=\"' . esc_attr__( 'Page', 'twentytwenty' ) . '\"><span class=\"label\">' . __( 'Pages:', 'twentytwenty' ) . '</span>',\n\t\t\t\t'after'       => '</nav>',\n\t\t\t\t'link_before' => '<span class=\"page-number\">',\n\t\t\t\t'link_after'  => '</span>',\n\t\t\t)\n\t\t);\n\n\t\tedit_post_link();\n\n\t\t// Single bottom post meta.\n\t\ttwentytwenty_the_post_meta( get_the_ID(), 'single-bottom' );\n\n\t\tif ( post_type_supports( get_post_type( get_the_ID() ), 'author' ) && is_single() ) {\n\n\t\t\tget_template_part( 'template-parts/entry-author-bio' );\n\n\t\t}\n\t\t?>\n\n\t</div><!-- .section-inner -->\n\n\t<?php\n\n\tif ( is_single() ) {\n\n\t\tget_template_part( 'template-parts/navigation' );\n\n\t}\n\n\t/**\n\t *  Output comments wrapper if it's a post, or if comments are open,\n\t * or if there's a comment number \u00e2\u20ac\u201c and check for password.\n\t * */\n\tif ( ( is_single() || is_page() ) && ( comments_open() || get_comments_number() ) && ! post_password_required() ) {\n\t\t?>\n\n\t\t<div class=\"comments-wrapper section-inner\">\n\n\t\t\t<?php comments_template(); ?>\n\n\t\t</div><!-- .comments-wrapper -->\n\n\t\t<?php\n\t}\n\t?>\n\n</article><!-- .post -->\n", "num_lines": 95}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The template for displaying Author info\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\nif ( (bool) get_the_author_meta( 'description' ) && (bool) get_theme_mod( 'show_author_bio', true ) ) : ?>\n<div class=\"author-bio\">\n\t<div class=\"author-title-wrapper\">\n\t\t<div class=\"author-avatar vcard\">\n\t\t\t<?php echo get_avatar( get_the_author_meta( 'ID' ), 160 ); ?>\n\t\t</div>\n\t\t<h2 class=\"author-title heading-size-4\">\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: Author name. */\n\t\t\t\t__( 'By %s', 'twentytwenty' ),\n\t\t\t\tesc_html( get_the_author() )\n\t\t\t);\n\t\t\t?>\n\t\t</h2>\n\t</div><!-- .author-name -->\n\t<div class=\"author-description\">\n\t\t<?php echo wp_kses_post( wpautop( get_the_author_meta( 'description' ) ) ); ?>\n\t\t<a class=\"author-link\" href=\"<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>\" rel=\"author\">\n\t\t\t<?php _e( 'View Archive <span aria-hidden=\"true\">&rarr;</span>', 'twentytwenty' ); ?>\n\t\t</a>\n\t</div><!-- .author-description -->\n</div><!-- .author-bio -->\n<?php endif; ?>\n", "num_lines": 34}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays the post header\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\n$entry_header_classes = '';\n\nif ( is_singular() ) {\n\t$entry_header_classes .= ' header-footer-group';\n}\n\n?>\n\n<header class=\"entry-header has-text-align-center<?php echo esc_attr( $entry_header_classes ); ?>\">\n\n\t<div class=\"entry-header-inner section-inner medium\">\n\n\t\t<?php\n\t\t/**\n\t\t * Allow child themes and plugins to filter the display of the categories in the entry header.\n\t\t *\n\t\t * @since Twenty Twenty 1.0\n\t\t *\n\t\t * @param bool   Whether to show the categories in header, Default true.\n\t\t */\n\t\t$show_categories = apply_filters( 'twentytwenty_show_categories_in_entry_header', true );\n\n\t\tif ( true === $show_categories && has_category() ) {\n\t\t\t?>\n\n\t\t\t<div class=\"entry-categories\">\n\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Categories', 'twentytwenty' ); ?></span>\n\t\t\t\t<div class=\"entry-categories-inner\">\n\t\t\t\t\t<?php the_category( ' ' ); ?>\n\t\t\t\t</div><!-- .entry-categories-inner -->\n\t\t\t</div><!-- .entry-categories -->\n\n\t\t\t<?php\n\t\t}\n\n\t\tif ( is_singular() ) {\n\t\t\tthe_title( '<h1 class=\"entry-title\">', '</h1>' );\n\t\t} else {\n\t\t\tthe_title( '<h2 class=\"entry-title heading-size-1\"><a href=\"' . esc_url( get_permalink() ) . '\">', '</a></h2>' );\n\t\t}\n\n\t\t$intro_text_width = '';\n\n\t\tif ( is_singular() ) {\n\t\t\t$intro_text_width = ' small';\n\t\t} else {\n\t\t\t$intro_text_width = ' thin';\n\t\t}\n\n\t\tif ( has_excerpt() && is_singular() ) {\n\t\t\t?>\n\n\t\t\t<div class=\"intro-text section-inner max-percentage<?php echo $intro_text_width; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>\">\n\t\t\t\t<?php the_excerpt(); ?>\n\t\t\t</div>\n\n\t\t\t<?php\n\t\t}\n\n\t\t// Default to displaying the post meta.\n\t\ttwentytwenty_the_post_meta( get_the_ID(), 'single-top' );\n\t\t?>\n\n\t</div><!-- .entry-header-inner -->\n\n</header><!-- .entry-header -->\n", "num_lines": 76}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays the featured image\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\nif ( has_post_thumbnail() && ! post_password_required() ) {\n\n\t$featured_media_inner_classes = '';\n\n\t// Make the featured media thinner on archive pages.\n\tif ( ! is_singular() ) {\n\t\t$featured_media_inner_classes .= ' medium';\n\t}\n\t?>\n\n\t<figure class=\"featured-media\">\n\n\t\t<div class=\"featured-media-inner section-inner<?php echo $featured_media_inner_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>\">\n\n\t\t\t<?php\n\t\t\tthe_post_thumbnail();\n\n\t\t\t$caption = get_the_post_thumbnail_caption();\n\n\t\t\tif ( $caption ) {\n\t\t\t\t?>\n\n\t\t\t\t<figcaption class=\"wp-caption-text\"><?php echo wp_kses_post( $caption ); ?></figcaption>\n\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\n\t\t</div><!-- .featured-media-inner -->\n\n\t</figure><!-- .featured-media -->\n\n\t<?php\n}\n", "num_lines": 44}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays the menus and widgets at the end of the main element.\n * Visually, this output is presented as part of the footer element.\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\n$has_footer_menu = has_nav_menu( 'footer' );\n$has_social_menu = has_nav_menu( 'social' );\n\n$has_sidebar_1 = is_active_sidebar( 'sidebar-1' );\n$has_sidebar_2 = is_active_sidebar( 'sidebar-2' );\n\n// Only output the container if there are elements to display.\nif ( $has_footer_menu || $has_social_menu || $has_sidebar_1 || $has_sidebar_2 ) {\n\t?>\n\n\t<div class=\"footer-nav-widgets-wrapper header-footer-group\">\n\n\t\t<div class=\"footer-inner section-inner\">\n\n\t\t\t<?php\n\n\t\t\t$footer_top_classes = '';\n\n\t\t\t$footer_top_classes .= $has_footer_menu ? ' has-footer-menu' : '';\n\t\t\t$footer_top_classes .= $has_social_menu ? ' has-social-menu' : '';\n\n\t\t\tif ( $has_footer_menu || $has_social_menu ) {\n\t\t\t\t?>\n\t\t\t\t<div class=\"footer-top<?php echo $footer_top_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>\">\n\t\t\t\t\t<?php if ( $has_footer_menu ) { ?>\n\n\t\t\t\t\t\t<nav aria-label=\"<?php esc_attr_e( 'Footer', 'twentytwenty' ); ?>\" role=\"navigation\" class=\"footer-menu-wrapper\">\n\n\t\t\t\t\t\t\t<ul class=\"footer-menu reset-list-style\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\twp_nav_menu(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'container'      => '',\n\t\t\t\t\t\t\t\t\t\t'depth'          => 1,\n\t\t\t\t\t\t\t\t\t\t'items_wrap'     => '%3$s',\n\t\t\t\t\t\t\t\t\t\t'theme_location' => 'footer',\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\t?>\n\t\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t\t</nav><!-- .site-nav -->\n\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t<?php if ( $has_social_menu ) { ?>\n\n\t\t\t\t\t\t<nav aria-label=\"<?php esc_attr_e( 'Social links', 'twentytwenty' ); ?>\" class=\"footer-social-wrapper\">\n\n\t\t\t\t\t\t\t<ul class=\"social-menu footer-social reset-list-style social-icons fill-children-current-color\">\n\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\twp_nav_menu(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'theme_location'  => 'social',\n\t\t\t\t\t\t\t\t\t\t'container'       => '',\n\t\t\t\t\t\t\t\t\t\t'container_class' => '',\n\t\t\t\t\t\t\t\t\t\t'items_wrap'      => '%3$s',\n\t\t\t\t\t\t\t\t\t\t'menu_id'         => '',\n\t\t\t\t\t\t\t\t\t\t'menu_class'      => '',\n\t\t\t\t\t\t\t\t\t\t'depth'           => 1,\n\t\t\t\t\t\t\t\t\t\t'link_before'     => '<span class=\"screen-reader-text\">',\n\t\t\t\t\t\t\t\t\t\t'link_after'      => '</span>',\n\t\t\t\t\t\t\t\t\t\t'fallback_cb'     => '',\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\t?>\n\n\t\t\t\t\t\t\t</ul><!-- .footer-social -->\n\n\t\t\t\t\t\t</nav><!-- .footer-social-wrapper -->\n\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</div><!-- .footer-top -->\n\n\t\t\t<?php } ?>\n\n\t\t\t<?php if ( $has_sidebar_1 || $has_sidebar_2 ) { ?>\n\n\t\t\t\t<aside class=\"footer-widgets-outer-wrapper\" role=\"complementary\">\n\n\t\t\t\t\t<div class=\"footer-widgets-wrapper\">\n\n\t\t\t\t\t\t<?php if ( $has_sidebar_1 ) { ?>\n\n\t\t\t\t\t\t\t<div class=\"footer-widgets column-one grid-item\">\n\t\t\t\t\t\t\t\t<?php dynamic_sidebar( 'sidebar-1' ); ?>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<?php } ?>\n\n\t\t\t\t\t\t<?php if ( $has_sidebar_2 ) { ?>\n\n\t\t\t\t\t\t\t<div class=\"footer-widgets column-two grid-item\">\n\t\t\t\t\t\t\t\t<?php dynamic_sidebar( 'sidebar-2' ); ?>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<?php } ?>\n\n\t\t\t\t\t</div><!-- .footer-widgets-wrapper -->\n\n\t\t\t\t</aside><!-- .footer-widgets-outer-wrapper -->\n\n\t\t\t<?php } ?>\n\n\t\t</div><!-- .footer-inner -->\n\n\t</div><!-- .footer-nav-widgets-wrapper -->\n\n<?php } ?>\n", "num_lines": 120}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays the menu icon and modal\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\n?>\n\n<div class=\"menu-modal cover-modal header-footer-group\" data-modal-target-string=\".menu-modal\">\n\n\t<div class=\"menu-modal-inner modal-inner\">\n\n\t\t<div class=\"menu-wrapper section-inner\">\n\n\t\t\t<div class=\"menu-top\">\n\n\t\t\t\t<button class=\"toggle close-nav-toggle fill-children-current-color\" data-toggle-target=\".menu-modal\" data-toggle-body-class=\"showing-menu-modal\" aria-expanded=\"false\" data-set-focus=\".menu-modal\">\n\t\t\t\t\t<span class=\"toggle-text\"><?php _e( 'Close Menu', 'twentytwenty' ); ?></span>\n\t\t\t\t\t<?php twentytwenty_the_theme_svg( 'cross' ); ?>\n\t\t\t\t</button><!-- .nav-toggle -->\n\n\t\t\t\t<?php\n\n\t\t\t\t$mobile_menu_location = '';\n\n\t\t\t\t// If the mobile menu location is not set, use the primary and expanded locations as fallbacks, in that order.\n\t\t\t\tif ( has_nav_menu( 'mobile' ) ) {\n\t\t\t\t\t$mobile_menu_location = 'mobile';\n\t\t\t\t} elseif ( has_nav_menu( 'primary' ) ) {\n\t\t\t\t\t$mobile_menu_location = 'primary';\n\t\t\t\t} elseif ( has_nav_menu( 'expanded' ) ) {\n\t\t\t\t\t$mobile_menu_location = 'expanded';\n\t\t\t\t}\n\n\t\t\t\tif ( has_nav_menu( 'expanded' ) ) {\n\n\t\t\t\t\t$expanded_nav_classes = '';\n\n\t\t\t\t\tif ( 'expanded' === $mobile_menu_location ) {\n\t\t\t\t\t\t$expanded_nav_classes .= ' mobile-menu';\n\t\t\t\t\t}\n\n\t\t\t\t\t?>\n\n\t\t\t\t\t<nav class=\"expanded-menu<?php echo esc_attr( $expanded_nav_classes ); ?>\" aria-label=\"<?php esc_attr_e( 'Expanded', 'twentytwenty' ); ?>\" role=\"navigation\">\n\n\t\t\t\t\t\t<ul class=\"modal-menu reset-list-style\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( has_nav_menu( 'expanded' ) ) {\n\t\t\t\t\t\t\t\twp_nav_menu(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'container'      => '',\n\t\t\t\t\t\t\t\t\t\t'items_wrap'     => '%3$s',\n\t\t\t\t\t\t\t\t\t\t'show_toggles'   => true,\n\t\t\t\t\t\t\t\t\t\t'theme_location' => 'expanded',\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}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t</nav>\n\n\t\t\t\t\t<?php\n\t\t\t\t}\n\n\t\t\t\tif ( 'expanded' !== $mobile_menu_location ) {\n\t\t\t\t\t?>\n\n\t\t\t\t\t<nav class=\"mobile-menu\" aria-label=\"<?php esc_attr_e( 'Mobile', 'twentytwenty' ); ?>\" role=\"navigation\">\n\n\t\t\t\t\t\t<ul class=\"modal-menu reset-list-style\">\n\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( $mobile_menu_location ) {\n\n\t\t\t\t\t\t\twp_nav_menu(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'container'      => '',\n\t\t\t\t\t\t\t\t\t'items_wrap'     => '%3$s',\n\t\t\t\t\t\t\t\t\t'show_toggles'   => true,\n\t\t\t\t\t\t\t\t\t'theme_location' => $mobile_menu_location,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\twp_list_pages(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'match_menu_classes' => true,\n\t\t\t\t\t\t\t\t\t'show_toggles'       => true,\n\t\t\t\t\t\t\t\t\t'title_li'           => false,\n\t\t\t\t\t\t\t\t\t'walker'             => new TwentyTwenty_Walker_Page(),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t</nav>\n\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\n\t\t\t</div><!-- .menu-top -->\n\n\t\t\t<div class=\"menu-bottom\">\n\n\t\t\t\t<?php if ( has_nav_menu( 'social' ) ) { ?>\n\n\t\t\t\t\t<nav aria-label=\"<?php esc_attr_e( 'Expanded Social links', 'twentytwenty' ); ?>\" role=\"navigation\">\n\t\t\t\t\t\t<ul class=\"social-menu reset-list-style social-icons fill-children-current-color\">\n\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\twp_nav_menu(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'theme_location'  => 'social',\n\t\t\t\t\t\t\t\t\t'container'       => '',\n\t\t\t\t\t\t\t\t\t'container_class' => '',\n\t\t\t\t\t\t\t\t\t'items_wrap'      => '%3$s',\n\t\t\t\t\t\t\t\t\t'menu_id'         => '',\n\t\t\t\t\t\t\t\t\t'menu_class'      => '',\n\t\t\t\t\t\t\t\t\t'depth'           => 1,\n\t\t\t\t\t\t\t\t\t'link_before'     => '<span class=\"screen-reader-text\">',\n\t\t\t\t\t\t\t\t\t'link_after'      => '</span>',\n\t\t\t\t\t\t\t\t\t'fallback_cb'     => '',\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?>\n\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</nav><!-- .social-menu -->\n\n\t\t\t\t<?php } ?>\n\n\t\t\t</div><!-- .menu-bottom -->\n\n\t\t</div><!-- .menu-wrapper -->\n\n\t</div><!-- .menu-modal-inner -->\n\n</div><!-- .menu-modal -->\n", "num_lines": 149}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays the search icon and modal\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\n?>\n<div class=\"search-modal cover-modal header-footer-group\" data-modal-target-string=\".search-modal\">\n\n\t<div class=\"search-modal-inner modal-inner\">\n\n\t\t<div class=\"section-inner\">\n\n\t\t\t<?php\n\t\t\tget_search_form(\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Search for:', 'twentytwenty' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\t?>\n\n\t\t\t<button class=\"toggle search-untoggle close-search-toggle fill-children-current-color\" data-toggle-target=\".search-modal\" data-toggle-body-class=\"showing-search-modal\" data-set-focus=\".search-modal .search-field\" aria-expanded=\"false\">\n\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Close search', 'twentytwenty' ); ?></span>\n\t\t\t\t<?php twentytwenty_the_theme_svg( 'cross' ); ?>\n\t\t\t</button><!-- .search-toggle -->\n\n\t\t</div><!-- .section-inner -->\n\n\t</div><!-- .search-modal-inner -->\n\n</div><!-- .menu-modal -->\n", "num_lines": 35}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Displays the next and previous post navigation in single posts.\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\n$next_post = get_next_post();\n$prev_post = get_previous_post();\n\nif ( $next_post || $prev_post ) {\n\n\t$pagination_classes = '';\n\n\tif ( ! $next_post ) {\n\t\t$pagination_classes = ' only-one only-prev';\n\t} elseif ( ! $prev_post ) {\n\t\t$pagination_classes = ' only-one only-next';\n\t}\n\n\t?>\n\n\t<nav class=\"pagination-single section-inner<?php echo esc_attr( $pagination_classes ); ?>\" aria-label=\"<?php esc_attr_e( 'Post', 'twentytwenty' ); ?>\" role=\"navigation\">\n\n\t\t<hr class=\"styled-separator is-style-wide\" aria-hidden=\"true\" />\n\n\t\t<div class=\"pagination-single-inner\">\n\n\t\t\t<?php\n\t\t\tif ( $prev_post ) {\n\t\t\t\t?>\n\n\t\t\t\t<a class=\"previous-post\" href=\"<?php echo esc_url( get_permalink( $prev_post->ID ) ); ?>\">\n\t\t\t\t\t<span class=\"arrow\" aria-hidden=\"true\">&larr;</span>\n\t\t\t\t\t<span class=\"title\"><span class=\"title-inner\"><?php echo wp_kses_post( get_the_title( $prev_post->ID ) ); ?></span></span>\n\t\t\t\t</a>\n\n\t\t\t\t<?php\n\t\t\t}\n\n\t\t\tif ( $next_post ) {\n\t\t\t\t?>\n\n\t\t\t\t<a class=\"next-post\" href=\"<?php echo esc_url( get_permalink( $next_post->ID ) ); ?>\">\n\t\t\t\t\t<span class=\"arrow\" aria-hidden=\"true\">&rarr;</span>\n\t\t\t\t\t\t<span class=\"title\"><span class=\"title-inner\"><?php echo wp_kses_post( get_the_title( $next_post->ID ) ); ?></span></span>\n\t\t\t\t</a>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\n\t\t</div><!-- .pagination-single-inner -->\n\n\t\t<hr class=\"styled-separator is-style-wide\" aria-hidden=\"true\" />\n\n\t</nav><!-- .pagination-single -->\n\n\t<?php\n}\n", "num_lines": 62}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * A template partial to output pagination for the Twenty Twenty default theme.\n *\n * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\n/**\n * Translators:\n * This text contains HTML to allow the text to be shorter on small screens.\n * The text inside the span with the class nav-short will be hidden on small screens.\n */\n\n$prev_text = sprintf(\n\t'%s <span class=\"nav-prev-text\">%s</span>',\n\t'<span aria-hidden=\"true\">&larr;</span>',\n\t__( 'Newer <span class=\"nav-short\">Posts</span>', 'twentytwenty' )\n);\n$next_text = sprintf(\n\t'<span class=\"nav-next-text\">%s</span> %s',\n\t__( 'Older <span class=\"nav-short\">Posts</span>', 'twentytwenty' ),\n\t'<span aria-hidden=\"true\">&rarr;</span>'\n);\n\n$posts_pagination = get_the_posts_pagination(\n\tarray(\n\t\t'mid_size'  => 1,\n\t\t'prev_text' => $prev_text,\n\t\t'next_text' => $next_text,\n\t)\n);\n\n// If we're not outputting the previous page link, prepend a placeholder with `visibility: hidden` to take its place.\nif ( strpos( $posts_pagination, 'prev page-numbers' ) === false ) {\n\t$posts_pagination = str_replace( '<div class=\"nav-links\">', '<div class=\"nav-links\"><span class=\"prev page-numbers placeholder\" aria-hidden=\"true\">' . $prev_text . '</span>', $posts_pagination );\n}\n\n// If we're not outputting the next page link, append a placeholder with `visibility: hidden` to take its place.\nif ( strpos( $posts_pagination, 'next page-numbers' ) === false ) {\n\t$posts_pagination = str_replace( '</div>', '<span class=\"next page-numbers placeholder\" aria-hidden=\"true\">' . $next_text . '</span></div>', $posts_pagination );\n}\n\nif ( $posts_pagination ) { ?>\n\n\t<div class=\"pagination-wrapper section-inner\">\n\n\t\t<hr class=\"styled-separator pagination-separator is-style-wide\" aria-hidden=\"true\" />\n\n\t\t<?php echo $posts_pagination; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- already escaped during generation. ?>\n\n\t</div><!-- .pagination-wrapper -->\n\n\t<?php\n}\n", "num_lines": 59}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template Name: Cover Template\n * Template Post Type: post, page\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\nget_header();\n?>\n\n<main id=\"site-content\" role=\"main\">\n\n\t<?php\n\n\tif ( have_posts() ) {\n\n\t\twhile ( have_posts() ) {\n\t\t\tthe_post();\n\n\t\t\tget_template_part( 'template-parts/content-cover' );\n\t\t}\n\t}\n\n\t?>\n\n</main><!-- #site-content -->\n\n<?php get_template_part( 'template-parts/footer-menus-widgets' ); ?>\n\n<?php get_footer(); ?>\n", "num_lines": 34}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template Name: Full Width Template\n * Template Post Type: post, page\n *\n * @package WordPress\n * @subpackage Twenty_Twenty\n * @since Twenty Twenty 1.0\n */\n\nget_template_part( 'singular' );\n", "num_lines": 12}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Toolbar API: Top-level Toolbar functionality\n *\n * @package WordPress\n * @subpackage Toolbar\n * @since 3.1.0\n */\n\n/**\n * Instantiate the admin bar object and set it up as a global for access elsewhere.\n *\n * UNHOOKING THIS FUNCTION WILL NOT PROPERLY REMOVE THE ADMIN BAR.\n * For that, use show_admin_bar(false) or the {@see 'show_admin_bar'} filter.\n *\n * @since 3.1.0\n * @access private\n *\n * @global WP_Admin_Bar $wp_admin_bar\n *\n * @return bool Whether the admin bar was successfully initialized.\n */\nfunction _wp_admin_bar_init() {\n\tglobal $wp_admin_bar;\n\n\tif ( ! is_admin_bar_showing() ) {\n\t\treturn false;\n\t}\n\n\t/* Load the admin bar class code ready for instantiation */\n\trequire_once ABSPATH . WPINC . '/class-wp-admin-bar.php';\n\n\t/* Instantiate the admin bar */\n\n\t/**\n\t * Filters the admin bar class to instantiate.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $wp_admin_bar_class Admin bar class to use. Default 'WP_Admin_Bar'.\n\t */\n\t$admin_bar_class = apply_filters( 'wp_admin_bar_class', 'WP_Admin_Bar' );\n\tif ( class_exists( $admin_bar_class ) ) {\n\t\t$wp_admin_bar = new $admin_bar_class;\n\t} else {\n\t\treturn false;\n\t}\n\n\t$wp_admin_bar->initialize();\n\t$wp_admin_bar->add_menus();\n\n\treturn true;\n}\n\n/**\n * Renders the admin bar to the page based on the $wp_admin_bar->menu member var.\n *\n * This is called very early on the {@see 'wp_body_open'} action so that it will render\n * before anything else being added to the page body.\n *\n * For backward compatibility with themes not using the 'wp_body_open' action,\n * the function is also called late on {@see 'wp_footer'}.\n *\n * It includes the {@see 'admin_bar_menu'} action which should be used to hook in and\n * add new menus to the admin bar. That way you can be sure that you are adding at most\n * optimal point, right before the admin bar is rendered. This also gives you access to\n * the `$post` global, among others.\n *\n * @since 3.1.0\n * @since 5.4.0 Called on 'wp_body_open' action first, with 'wp_footer' as a fallback.\n *\n * @global WP_Admin_Bar $wp_admin_bar\n */\nfunction wp_admin_bar_render() {\n\tglobal $wp_admin_bar;\n\tstatic $rendered = false;\n\n\tif ( $rendered ) {\n\t\treturn;\n\t}\n\n\tif ( ! is_admin_bar_showing() || ! is_object( $wp_admin_bar ) ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Load all necessary admin bar items.\n\t *\n\t * This is the hook used to add, remove, or manipulate admin bar items.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance, passed by reference\n\t */\n\tdo_action_ref_array( 'admin_bar_menu', array( &$wp_admin_bar ) );\n\n\t/**\n\t * Fires before the admin bar is rendered.\n\t *\n\t * @since 3.1.0\n\t */\n\tdo_action( 'wp_before_admin_bar_render' );\n\n\t$wp_admin_bar->render();\n\n\t/**\n\t * Fires after the admin bar is rendered.\n\t *\n\t * @since 3.1.0\n\t */\n\tdo_action( 'wp_after_admin_bar_render' );\n\n\t$rendered = true;\n}\n\n/**\n * Add the WordPress logo menu.\n *\n * @since 3.3.0\n *\n * @param WP_Admin_Bar $wp_admin_bar\n */\nfunction wp_admin_bar_wp_menu( $wp_admin_bar ) {\n\tif ( current_user_can( 'read' ) ) {\n\t\t$about_url = self_admin_url( 'about.php' );\n\t} elseif ( is_multisite() ) {\n\t\t$about_url = get_dashboard_url( get_current_user_id(), 'about.php' );\n\t} else {\n\t\t$about_url = false;\n\t}\n\n\t$wp_logo_menu_args = array(\n\t\t'id'    => 'wp-logo',\n\t\t'title' => '<span class=\"ab-icon\"></span><span class=\"screen-reader-text\">' . __( 'About WordPress' ) . '</span>',\n\t\t'href'  => $about_url,\n\t);\n\n\t// Set tabindex=\"0\" to make sub menus accessible when no URL is available.\n\tif ( ! $about_url ) {\n\t\t$wp_logo_menu_args['meta'] = array(\n\t\t\t'tabindex' => 0,\n\t\t);\n\t}\n\n\t$wp_admin_bar->add_node( $wp_logo_menu_args );\n\n\tif ( $about_url ) {\n\t\t// Add \"About WordPress\" link.\n\t\t$wp_admin_bar->add_node(\n\t\t\tarray(\n\t\t\t\t'parent' => 'wp-logo',\n\t\t\t\t'id'     => 'about',\n\t\t\t\t'title'  => __( 'About WordPress' ),\n\t\t\t\t'href'   => $about_url,\n\t\t\t)\n\t\t);\n\t}\n\n\t// Add WordPress.org link.\n\t$wp_admin_bar->add_node(\n\t\tarray(\n\t\t\t'parent' => 'wp-logo-external',\n\t\t\t'id'     => 'wporg',\n\t\t\t'title'  => __( 'WordPress.org' ),\n\t\t\t'href'   => __( 'https://wordpress.org/' ),\n\t\t)\n\t);\n\n\t// Add Codex link.\n\t$wp_admin_bar->add_node(\n\t\tarray(\n\t\t\t'parent' => 'wp-logo-external',\n\t\t\t'id'     => 'documentation',\n\t\t\t'title'  => __( 'Documentation' ),\n\t\t\t'href'   => __( 'https://codex.wordpress.org/' ),\n\t\t)\n\t);\n\n\t// Add forums link.\n\t$wp_admin_bar->add_node(\n\t\tarray(\n\t\t\t'parent' => 'wp-logo-external',\n\t\t\t'id'     => 'support-forums',\n\t\t\t'title'  => __( 'Support' ),\n\t\t\t'href'   => __( 'https://wordpress.org/support/' ),\n\t\t)\n\t);\n\n\t// Add feedback link.\n\t$wp_admin_bar->add_node(\n\t\tarray(\n\t\t\t'parent' => 'wp-logo-external',\n\t\t\t'id'     => 'feedback',\n\t\t\t'title'  => __( 'Feedback' ),\n\t\t\t'href'   => __( 'https://wordpress.org/support/forum/requests-and-feedback' ),\n\t\t)\n\t);\n}\n\n/**\n * Add the sidebar toggle button.\n *\n * @since 3.8.0\n *\n * @param WP_Admin_Bar $wp_admin_bar\n */\nfunction wp_admin_bar_sidebar_toggle( $wp_admin_bar ) {\n\tif ( is_admin() ) {\n\t\t$wp_admin_bar->add_node(\n\t\t\tarray(\n\t\t\t\t'id'    => 'menu-toggle',\n\t\t\t\t'title' => '<span class=\"ab-icon\"></span><span class=\"screen-reader-text\">' . __( 'Menu' ) . '</span>',\n\t\t\t\t'href'  => '#',\n\t\t\t)\n\t\t);\n\t}\n}\n\n/**\n * Add the \"My Account\" item.\n *\n * @since 3.3.0\n *\n * @param WP_Admin_Bar $wp_admin_bar\n */\nfunction wp_admin_bar_my_account_item( $wp_admin_bar ) {\n\t$user_id      = get_current_user_id();\n\t$current_user = wp_get_current_user();\n\n\tif ( ! $user_id ) {\n\t\treturn;\n\t}\n\n\tif ( current_user_can( 'read' ) ) {\n\t\t$profile_url = get_edit_profile_url( $user_id );\n\t} elseif ( is_multisite() ) {\n\t\t$profile_url = get_dashboard_url( $user_id, 'profile.php' );\n\t} else {\n\t\t$profile_url = false;\n\t}\n\n\t$avatar = get_avatar( $user_id, 26 );\n\t/* translators: %s: Current user's display name. */\n\t$howdy = sprintf( __( 'Howdy, %s' ), '<span class=\"display-name\">' . $current_user->display_name . '</span>' );\n\t$class = empty( $avatar ) ? '' : 'with-avatar';\n\n\t$wp_admin_bar->add_node(\n\t\tarray(\n\t\t\t'id'     => 'my-account',\n\t\t\t'parent' => 'top-secondary',\n\t\t\t'title'  => $howdy . $avatar,\n\t\t\t'href'   => $profile_url,\n\t\t\t'meta'   => array(\n\t\t\t\t'class' => $class,\n\t\t\t),\n\t\t)\n\t);\n}\n\n/**\n * Add the \"My Account\" submenu items.\n *\n * @since 3.1.0\n *\n * @param WP_Admin_Bar $wp_admin_bar\n */\nfunction wp_admin_bar_my_account_menu( $wp_admin_bar ) {\n\t$user_id      = get_current_user_id();\n\t$current_user = wp_get_current_user();\n\n\tif ( ! $user_id ) {\n\t\treturn;\n\t}\n\n\tif ( current_user_can( 'read' ) ) {\n\t\t$profile_url = get_edit_profile_url( $user_id );\n\t} elseif ( is_multisite() ) {\n\t\t$profile_url = get_dashboard_url( $user_id, 'profile.php' );\n\t} else {\n\t\t$profile_url = false;\n\t}\n\n\t$wp_admin_bar->add_group(\n\t\tarray(\n\t\t\t'parent' => 'my-account',\n\t\t\t'id'     => 'user-actions',\n\t\t)\n\t);\n\n\t$user_info  = get_avatar( $user_id, 64 );\n\t$user_info .= \"<span class='display-name'>{$current_user->display_name}</span>\";\n\n\tif ( $current_user->display_name !== $current_user->user_login ) {\n\t\t$user_info .= \"<span class='username'>{$current_user->user_login}</span>\";\n\t}\n\n\t$wp_admin_bar->add_node(\n\t\tarray(\n\t\t\t'parent' => 'user-actions',\n\t\t\t'id'     => 'user-info',\n\t\t\t'title'  => $user_info,\n\t\t\t'href'   => $profile_url,\n\t\t\t'meta'   => array(\n\t\t\t\t'tabindex' => -1,\n\t\t\t),\n\t\t)\n\t);\n\n\tif ( false !== $profile_url ) {\n\t\t$wp_admin_bar->add_node(\n\t\t\tarray(\n\t\t\t\t'parent' => 'user-actions',\n\t\t\t\t'id'     => 'edit-profile',\n\t\t\t\t'title'  => __( 'Edit Profile' ),\n\t\t\t\t'href'   => $profile_url,\n\t\t\t)\n\t\t);\n\t}\n\n\t$wp_admin_bar->add_node(\n\t\tarray(\n\t\t\t'parent' => 'user-actions',\n\t\t\t'id'     => 'logout',\n\t\t\t'title'  => __( 'Log Out' ),\n\t\t\t'href'   => wp_logout_url(),\n\t\t)\n\t);\n}\n\n/**\n * Add the \"Site Name\" menu.\n *\n * @since 3.3.0\n *\n * @param WP_Admin_Bar $wp_admin_bar\n */\nfunction wp_admin_bar_site_menu( $wp_admin_bar ) {\n\t// Don't show for logged out users.\n\tif ( ! is_user_logged_in() ) {\n\t\treturn;\n\t}\n\n\t// Show only when the user is a member of this site, or they're a super admin.\n\tif ( ! is_user_member_of_blog() && ! current_user_can( 'manage_network' ) ) {\n\t\treturn;\n\t}\n\n\t$blogname = get_bloginfo( 'name' );\n\n\tif ( ! $blogname ) {\n\t\t$blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() );\n\t}\n\n\tif ( is_network_admin() ) {\n\t\t/* translators: %s: Site title. */\n\t\t$blogname = sprintf( __( 'Network Admin: %s' ), esc_html( get_network()->site_name ) );\n\t} elseif ( is_user_admin() ) {\n\t\t/* translators: %s: Site title. */\n\t\t$blogname = sprintf( __( 'User Dashboard: %s' ), esc_html( get_network()->site_name ) );\n\t}\n\n\t$title = wp_html_excerpt( $blogname, 40, '&hellip;' );\n\n\t$wp_admin_bar->add_node(\n\t\tarray(\n\t\t\t'id'    => 'site-name',\n\t\t\t'title' => $title,\n\t\t\t'href'  => ( is_admin() || ! current_user_can( 'read' ) ) ? home_url( '/' ) : admin_url(),\n\t\t)\n\t);\n\n\t// Create submenu items.\n\n\tif ( is_admin() ) {\n\t\t// Add an option to visit the site.\n\t\t$wp_admin_bar->add_node(\n\t\t\tarray(\n\t\t\t\t'parent' => 'site-name',\n\t\t\t\t'id'     => 'view-site',\n\t\t\t\t'title'  => __( 'Visit Site' ),\n\t\t\t\t'href'   => home_url( '/' ),\n\t\t\t)\n\t\t);\n\n\t\tif ( is_blog_admin() && is_multisite() && current_user_can( 'manage_sites' ) ) {\n\t\t\t$wp_admin_bar->add_node(\n\t\t\t\tarray(\n\t\t\t\t\t'parent' => 'site-name',\n\t\t\t\t\t'id'     => 'edit-site',\n\t\t\t\t\t'title'  => __( 'Edit Site' ),\n\t\t\t\t\t'href'   => network_admin_url( 'site-info.php?id=' . get_current_blog_id() ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t} elseif ( current_user_can( 'read' ) ) {\n\t\t// We're on the front end, link to the Dashboard.\n\t\t$wp_admin_bar->add_node(\n\t\t\tarray(\n\t\t\t\t'parent' => 'site-name',\n\t\t\t\t'id'     => 'dashboard',\n\t\t\t\t'title'  => __( 'Dashboard' ),\n\t\t\t\t'href'   => admin_url(),\n\t\t\t)\n\t\t);\n\n\t\t// Add the appearance submenu items.\n\t\twp_admin_bar_appearance_menu( $wp_admin_bar );\n\t}\n}\n\n/**\n * Adds the \"Customize\" link to the Toolbar.\n *\n * @since 4.3.0\n *\n * @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance.\n * @global WP_Customize_Manager $wp_customize\n */\nfunction wp_admin_bar_customize_menu( $wp_admin_bar ) {\n\tglobal $wp_customize;\n\n\t// Don't show for users who can't access the customizer or when in the admin.\n\tif ( ! current_user_can( 'customize' ) || is_admin() ) {\n\t\treturn;\n\t}\n\n\t// Don't show if the user cannot edit a given customize_changeset post currently being previewed.\n\tif ( is_customize_preview() && $wp_customize->changeset_post_id()\n\t\t&& ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $wp_customize->changeset_post_id() )\n\t) {\n\t\treturn;\n\t}\n\n\t$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\tif ( is_customize_preview() && $wp_customize->changeset_uuid() ) {\n\t\t$current_url = remove_query_arg( 'customize_changeset_uuid', $current_url );\n\t}\n\n\t$customize_url = add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() );\n\tif ( is_customize_preview() ) {\n\t\t$customize_url = add_query_arg( array( 'changeset_uuid' => $wp_customize->changeset_uuid() ), $customize_url );\n\t}\n\n\t$wp_admin_bar->add_node(\n\t\tarray(\n\t\t\t'id'    => 'customize',\n\t\t\t'title' => __( 'Customize' ),\n\t\t\t'href'  => $customize_url,\n\t\t\t'meta'  => array(\n\t\t\t\t'class' => 'hide-if-no-customize',\n\t\t\t),\n\t\t)\n\t);\n\tadd_action( 'wp_before_admin_bar_render', 'wp_customize_support_script' );\n}\n\n/**\n * Add the \"My Sites/[Site Name]\" menu and all submenus.\n *\n * @since 3.1.0\n *\n * @param WP_Admin_Bar $wp_admin_bar\n */\nfunction wp_admin_bar_my_sites_menu( $wp_admin_bar ) {\n\t// Don't show for logged out users or single site mode.\n\tif ( ! is_user_logged_in() || ! is_multisite() ) {\n\t\treturn;\n\t}\n\n\t// Show only when the user has at least one site, or they're a super admin.\n\tif ( count( $wp_admin_bar->user->blogs ) < 1 && ! current_user_can( 'manage_network' ) ) {\n\t\treturn;\n\t}\n\n\tif ( $wp_admin_bar->user->active_blog ) {\n\t\t$my_sites_url = get_admin_url( $wp_admin_bar->user->active_blog->blog_id, 'my-sites.php' );\n\t} else {\n\t\t$my_sites_url = admin_url( 'my-sites.php' );\n\t}\n\n\t$wp_admin_bar->add_node(\n\t\tarray(\n\t\t\t'id'    => 'my-sites',\n\t\t\t'title' => __( 'My Sites' ),\n\t\t\t'href'  => $my_sites_url,\n\t\t)\n\t);\n\n\tif ( current_user_can( 'manage_network' ) ) {\n\t\t$wp_admin_bar->add_group(\n\t\t\tarray(\n\t\t\t\t'parent' => 'my-sites',\n\t\t\t\t'id'     => 'my-sites-super-admin',\n\t\t\t)\n\t\t);\n\n\t\t$wp_admin_bar->add_node(\n\t\t\tarray(\n\t\t\t\t'parent' => 'my-sites-super-admin',\n\t\t\t\t'id'     => 'network-admin',\n\t\t\t\t'title'  => __( 'Network Admin' ),\n\t\t\t\t'href'   => network_admin_url(),\n\t\t\t)\n\t\t);\n\n\t\t$wp_admin_bar->add_node(\n\t\t\tarray(\n\t\t\t\t'parent' => 'network-admin',\n\t\t\t\t'id'     => 'network-admin-d',\n\t\t\t\t'title'  => __( 'Dashboard' ),\n\t\t\t\t'href'   => network_admin_url(),\n\t\t\t)\n\t\t);\n\n\t\tif ( current_user_can( 'manage_sites' ) ) {\n\t\t\t$wp_admin_bar->add_node(\n\t\t\t\tarray(\n\t\t\t\t\t'parent' => 'network-admin',\n\t\t\t\t\t'id'     => 'network-admin-s',\n\t\t\t\t\t'title'  => __( 'Sites' ),\n\t\t\t\t\t'href'   => network_admin_url( 'sites.php' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( current_user_can( 'manage_network_users' ) ) {\n\t\t\t$wp_admin_bar->add_node(\n\t\t\t\tarray(\n\t\t\t\t\t'parent' => 'network-admin',\n\t\t\t\t\t'id'     => 'network-admin-u',\n\t\t\t\t\t'title'  => __( 'Users' ),\n\t\t\t\t\t'href'   => network_admin_url( 'users.php' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( current_user_can( 'manage_network_themes' ) ) {\n\t\t\t$wp_admin_bar->add_node(\n\t\t\t\tarray(\n\t\t\t\t\t'parent' => 'network-admin',\n\t\t\t\t\t'id'     => 'network-admin-t',\n\t\t\t\t\t'title'  => __( 'Themes' ),\n\t\t\t\t\t'href'   => network_admin_url( 'themes.php' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( current_user_can( 'manage_network_plugins' ) ) {\n\t\t\t$wp_admin_bar->add_node(\n\t\t\t\tarray(\n\t\t\t\t\t'parent' => 'network-admin',\n\t\t\t\t\t'id'     => 'network-admin-p',\n\t\t\t\t\t'title'  => __( 'Plugins' ),\n\t\t\t\t\t'href'   => network_admin_url( 'plugins.php' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( current_user_can( 'manage_network_options' ) ) {\n\t\t\t$wp_admin_bar->add_node(\n\t\t\t\tarray(\n\t\t\t\t\t'parent' => 'network-admin',\n\t\t\t\t\t'id'     => 'network-admin-o',\n\t\t\t\t\t'title'  => __( 'Settings' ),\n\t\t\t\t\t'href'   => network_admin_url( 'settings.php' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\t// Add site links.\n\t$wp_admin_bar->add_group(\n\t\tarray(\n\t\t\t'parent' => 'my-sites',\n\t\t\t'id'     => 'my-sites-list',\n\t\t\t'meta'   => array(\n\t\t\t\t'class' => current_user_can( 'manage_network' ) ? 'ab-sub-secondary' : '',\n\t\t\t),\n\t\t)\n\t);\n\n\tforeach ( (array) $wp_admin_bar->user->blogs as $blog ) {\n\t\tswitch_to_blog( $blog->userblog_id );\n\n\t\t$blavatar = '<div class=\"blavatar\"></div>';\n\n\t\t$blogname = $blog->blogname;\n\n\t\tif ( ! $blogname ) {\n\t\t\t$blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() );\n\t\t}\n\n\t\t$menu_id = 'blog-' . $blog->userblog_id;\n\n\t\tif ( current_user_can( 'read' ) ) {\n\t\t\t$wp_admin_bar->add_node(\n\t\t\t\tarray(\n\t\t\t\t\t'parent' => 'my-sites-list',\n\t\t\t\t\t'id'     => $menu_id,\n\t\t\t\t\t'title'  => $blavatar . $blogname,\n\t\t\t\t\t'href'   => admin_url(),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$wp_admin_bar->add_node(\n\t\t\t\tarray(\n\t\t\t\t\t'parent' => $menu_id,\n\t\t\t\t\t'id'     => $menu_id . '-d',\n\t\t\t\t\t'title'  => __( 'Dashboard' ),\n\t\t\t\t\t'href'   => admin_url(),\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t$wp_admin_bar->add_node(\n\t\t\t\tarray(\n\t\t\t\t\t'parent' => 'my-sites-list',\n\t\t\t\t\t'id'     => $menu_id,\n\t\t\t\t\t'title'  => $blavatar . $blogname,\n\t\t\t\t\t'href'   => home_url(),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {\n\t\t\t$wp_admin_bar->add_node(\n\t\t\t\tarray(\n\t\t\t\t\t'parent' => $menu_id,\n\t\t\t\t\t'id'     => $menu_id . '-n',\n\t\t\t\t\t'title'  => get_post_type_object( 'post' )->labels->new_item,\n\t\t\t\t\t'href'   => admin_url( 'post-new.php' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( current_user_can( 'edit_posts' ) ) {\n\t\t\t$wp_admin_bar->add_node(\n\t\t\t\tarray(\n\t\t\t\t\t'parent' => $menu_id,\n\t\t\t\t\t'id'     => $menu_id . '-c',\n\t\t\t\t\t'title'  => __( 'Manage Comments' ),\n\t\t\t\t\t'href'   => admin_url( 'edit-comments.php' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$wp_admin_bar->add_node(\n\t\t\tarray(\n\t\t\t\t'parent' => $menu_id,\n\t\t\t\t'id'     => $menu_id . '-v',\n\t\t\t\t'title'  => __( 'Visit Site' ),\n\t\t\t\t'href'   => home_url( '/' ),\n\t\t\t)\n\t\t);\n\n\t\trestore_current_blog();\n\t}\n}\n\n/**\n * Provide a shortlink.\n *\n * @since 3.1.0\n *\n * @param WP_Admin_Bar $wp_admin_bar\n */\nfunction wp_admin_bar_shortlink_menu( $wp_admin_bar ) {\n\t$short = wp_get_shortlink( 0, 'query' );\n\t$id    = 'get-shortlink';\n\n\tif ( empty( $short ) ) {\n\t\treturn;\n\t}\n\n\t$html = '<input class=\"shortlink-input\" type=\"text\" readonly=\"readonly\" value=\"' . esc_attr( $short ) . '\" />';\n\n\t$wp_admin_bar->add_node(\n\t\tarray(\n\t\t\t'id'    => $id,\n\t\t\t'title' => __( 'Shortlink' ),\n\t\t\t'href'  => $short,\n\t\t\t'meta'  => array( 'html' => $html ),\n\t\t)\n\t);\n}\n\n/**\n * Provide an edit link for posts and terms.\n *\n * @since 3.1.0\n *\n * @global WP_Term  $tag\n * @global WP_Query $wp_the_query WordPress Query object.\n * @global int      $user_id      The ID of the user being edited. Not to be confused with the\n *                                global $user_ID, which contains the ID of the current user.\n * @global int      $post_id      The ID of the post when editing comments for a single post.\n *\n * @param WP_Admin_Bar $wp_admin_bar\n */\nfunction wp_admin_bar_edit_menu( $wp_admin_bar ) {\n\tglobal $tag, $wp_the_query, $user_id, $post_id;\n\n\tif ( is_admin() ) {\n\t\t$current_screen   = get_current_screen();\n\t\t$post             = get_post();\n\t\t$post_type_object = null;\n\n\t\tif ( 'post' === $current_screen->base ) {\n\t\t\t$post_type_object = get_post_type_object( $post->post_type );\n\t\t} elseif ( 'edit' === $current_screen->base ) {\n\t\t\t$post_type_object = get_post_type_object( $current_screen->post_type );\n\t\t} elseif ( 'edit-comments' === $current_screen->base && $post_id ) {\n\t\t\t$post = get_post( $post_id );\n\t\t\tif ( $post ) {\n\t\t\t\t$post_type_object = get_post_type_object( $post->post_type );\n\t\t\t}\n\t\t}\n\n\t\tif ( ( 'post' === $current_screen->base || 'edit-comments' === $current_screen->base )\n\t\t\t&& 'add' !== $current_screen->action\n\t\t\t&& ( $post_type_object )\n\t\t\t&& current_user_can( 'read_post', $post->ID )\n\t\t\t&& ( $post_type_object->public )\n\t\t\t&& ( $post_type_object->show_in_admin_bar ) ) {\n\t\t\tif ( 'draft' === $post->post_status ) {\n\t\t\t\t$preview_link = get_preview_post_link( $post );\n\t\t\t\t$wp_admin_bar->add_node(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'    => 'preview',\n\t\t\t\t\t\t'title' => $post_type_object->labels->view_item,\n\t\t\t\t\t\t'href'  => esc_url( $preview_link ),\n\t\t\t\t\t\t'meta'  => array( 'target' => 'wp-preview-' . $post->ID ),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$wp_admin_bar->add_node(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'    => 'view',\n\t\t\t\t\t\t'title' => $post_type_object->labels->view_item,\n\t\t\t\t\t\t'href'  => get_permalink( $post->ID ),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t} elseif ( 'edit' === $current_screen->base\n\t\t\t&& ( $post_type_object )\n\t\t\t&& ( $post_type_object->public )\n\t\t\t&& ( $post_type_object->show_in_admin_bar )\n\t\t\t&& ( get_post_type_archive_link( $post_type_object->name ) )\n\t\t\t&& ! ( 'post' === $post_type_object->name && 'posts' === get_option( 'show_on_front' ) ) ) {\n\t\t\t$wp_admin_bar->add_node(\n\t\t\t\tarray(\n\t\t\t\t\t'id'    => 'archive',\n\t\t\t\t\t'title' => $post_type_object->labels->view_items,\n\t\t\t\t\t'href'  => get_post_type_archive_link( $current_screen->post_type ),\n\t\t\t\t)\n\t\t\t);\n\t\t} elseif ( 'term' === $current_screen->base && isset( $tag ) && is_object( $tag ) && ! is_wp_error( $tag ) ) {\n\t\t\t$tax = get_taxonomy( $tag->taxonomy );\n\t\t\tif ( is_taxonomy_viewable( $tax ) ) {\n\t\t\t\t$wp_admin_bar->add_node(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'    => 'view',\n\t\t\t\t\t\t'title' => $tax->labels->view_item,\n\t\t\t\t\t\t'href'  => get_term_link( $tag ),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t} elseif ( 'user-edit' === $current_screen->base && isset( $user_id ) ) {\n\t\t\t$user_object = get_userdata( $user_id );\n\t\t\t$view_link   = get_author_posts_url( $user_object->ID );\n\t\t\tif ( $user_object->exists() && $view_link ) {\n\t\t\t\t$wp_admin_bar->add_node(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'    => 'view',\n\t\t\t\t\t\t'title' => __( 'View User' ),\n\t\t\t\t\t\t'href'  => $view_link,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$current_object = $wp_the_query->get_queried_object();\n\n\t\tif ( empty( $current_object ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! empty( $current_object->post_type ) ) {\n\t\t\t$post_type_object = get_post_type_object( $current_object->post_type );\n\t\t\t$edit_post_link   = get_edit_post_link( $current_object->ID );\n\t\t\tif ( $post_type_object\n\t\t\t\t&& $edit_post_link\n\t\t\t\t&& current_user_can( 'edit_post', $current_object->ID )\n\t\t\t\t&& $post_type_object->show_in_admin_bar ) {\n\t\t\t\t$wp_admin_bar->add_node(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'    => 'edit',\n\t\t\t\t\t\t'title' => $post_type_object->labels->edit_item,\n\t\t\t\t\t\t'href'  => $edit_post_link,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t} elseif ( ! empty( $current_object->taxonomy ) ) {\n\t\t\t$tax            = get_taxonomy( $current_object->taxonomy );\n\t\t\t$edit_term_link = get_edit_term_link( $current_object->term_id, $current_object->taxonomy );\n\t\t\tif ( $tax && $edit_term_link && current_user_can( 'edit_term', $current_object->term_id ) ) {\n\t\t\t\t$wp_admin_bar->add_node(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'    => 'edit',\n\t\t\t\t\t\t'title' => $tax->labels->edit_item,\n\t\t\t\t\t\t'href'  => $edit_term_link,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t} elseif ( is_a( $current_object, 'WP_User' ) && current_user_can( 'edit_user', $current_object->ID ) ) {\n\t\t\t$edit_user_link = get_edit_user_link( $current_object->ID );\n\t\t\tif ( $edit_user_link ) {\n\t\t\t\t$wp_admin_bar->add_node(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'    => 'edit',\n\t\t\t\t\t\t'title' => __( 'Edit User' ),\n\t\t\t\t\t\t'href'  => $edit_user_link,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Add \"Add New\" menu.\n *\n * @since 3.1.0\n *\n * @param WP_Admin_Bar $wp_admin_bar\n */\nfunction wp_admin_bar_new_content_menu( $wp_admin_bar ) {\n\t$actions = array();\n\n\t$cpts = (array) get_post_types( array( 'show_in_admin_bar' => true ), 'objects' );\n\n\tif ( isset( $cpts['post'] ) && current_user_can( $cpts['post']->cap->create_posts ) ) {\n\t\t$actions['post-new.php'] = array( $cpts['post']->labels->name_admin_bar, 'new-post' );\n\t}\n\n\tif ( isset( $cpts['attachment'] ) && current_user_can( 'upload_files' ) ) {\n\t\t$actions['media-new.php'] = array( $cpts['attachment']->labels->name_admin_bar, 'new-media' );\n\t}\n\n\tif ( current_user_can( 'manage_links' ) ) {\n\t\t$actions['link-add.php'] = array( _x( 'Link', 'add new from admin bar' ), 'new-link' );\n\t}\n\n\tif ( isset( $cpts['page'] ) && current_user_can( $cpts['page']->cap->create_posts ) ) {\n\t\t$actions['post-new.php?post_type=page'] = array( $cpts['page']->labels->name_admin_bar, 'new-page' );\n\t}\n\n\tunset( $cpts['post'], $cpts['page'], $cpts['attachment'] );\n\n\t// Add any additional custom post types.\n\tforeach ( $cpts as $cpt ) {\n\t\tif ( ! current_user_can( $cpt->cap->create_posts ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$key             = 'post-new.php?post_type=' . $cpt->name;\n\t\t$actions[ $key ] = array( $cpt->labels->name_admin_bar, 'new-' . $cpt->name );\n\t}\n\t// Avoid clash with parent node and a 'content' post type.\n\tif ( isset( $actions['post-new.php?post_type=content'] ) ) {\n\t\t$actions['post-new.php?post_type=content'][1] = 'add-new-content';\n\t}\n\n\tif ( current_user_can( 'create_users' ) || ( is_multisite() && current_user_can( 'promote_users' ) ) ) {\n\t\t$actions['user-new.php'] = array( _x( 'User', 'add new from admin bar' ), 'new-user' );\n\t}\n\n\tif ( ! $actions ) {\n\t\treturn;\n\t}\n\n\t$title = '<span class=\"ab-icon\"></span><span class=\"ab-label\">' . _x( 'New', 'admin bar menu group label' ) . '</span>';\n\n\t$wp_admin_bar->add_node(\n\t\tarray(\n\t\t\t'id'    => 'new-content',\n\t\t\t'title' => $title,\n\t\t\t'href'  => admin_url( current( array_keys( $actions ) ) ),\n\t\t)\n\t);\n\n\tforeach ( $actions as $link => $action ) {\n\t\tlist( $title, $id ) = $action;\n\n\t\t$wp_admin_bar->add_node(\n\t\t\tarray(\n\t\t\t\t'parent' => 'new-content',\n\t\t\t\t'id'     => $id,\n\t\t\t\t'title'  => $title,\n\t\t\t\t'href'   => admin_url( $link ),\n\t\t\t)\n\t\t);\n\t}\n}\n\n/**\n * Add edit comments link with awaiting moderation count bubble.\n *\n * @since 3.1.0\n *\n * @param WP_Admin_Bar $wp_admin_bar\n */\nfunction wp_admin_bar_comments_menu( $wp_admin_bar ) {\n\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\treturn;\n\t}\n\n\t$awaiting_mod  = wp_count_comments();\n\t$awaiting_mod  = $awaiting_mod->moderated;\n\t$awaiting_text = sprintf(\n\t\t/* translators: %s: Number of comments. */\n\t\t_n( '%s Comment in moderation', '%s Comments in moderation', $awaiting_mod ),\n\t\tnumber_format_i18n( $awaiting_mod )\n\t);\n\n\t$icon   = '<span class=\"ab-icon\"></span>';\n\t$title  = '<span class=\"ab-label awaiting-mod pending-count count-' . $awaiting_mod . '\" aria-hidden=\"true\">' . number_format_i18n( $awaiting_mod ) . '</span>';\n\t$title .= '<span class=\"screen-reader-text comments-in-moderation-text\">' . $awaiting_text . '</span>';\n\n\t$wp_admin_bar->add_node(\n\t\tarray(\n\t\t\t'id'    => 'comments',\n\t\t\t'title' => $icon . $title,\n\t\t\t'href'  => admin_url( 'edit-comments.php' ),\n\t\t)\n\t);\n}\n\n/**\n * Add appearance submenu items to the \"Site Name\" menu.\n *\n * @since 3.1.0\n *\n * @param WP_Admin_Bar $wp_admin_bar\n */\nfunction wp_admin_bar_appearance_menu( $wp_admin_bar ) {\n\t$wp_admin_bar->add_group(\n\t\tarray(\n\t\t\t'parent' => 'site-name',\n\t\t\t'id'     => 'appearance',\n\t\t)\n\t);\n\n\tif ( current_user_can( 'switch_themes' ) ) {\n\t\t$wp_admin_bar->add_node(\n\t\t\tarray(\n\t\t\t\t'parent' => 'appearance',\n\t\t\t\t'id'     => 'themes',\n\t\t\t\t'title'  => __( 'Themes' ),\n\t\t\t\t'href'   => admin_url( 'themes.php' ),\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\treturn;\n\t}\n\n\tif ( current_theme_supports( 'widgets' ) ) {\n\t\t$wp_admin_bar->add_node(\n\t\t\tarray(\n\t\t\t\t'parent' => 'appearance',\n\t\t\t\t'id'     => 'widgets',\n\t\t\t\t'title'  => __( 'Widgets' ),\n\t\t\t\t'href'   => admin_url( 'widgets.php' ),\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {\n\t\t$wp_admin_bar->add_node(\n\t\t\tarray(\n\t\t\t\t'parent' => 'appearance',\n\t\t\t\t'id'     => 'menus',\n\t\t\t\t'title'  => __( 'Menus' ),\n\t\t\t\t'href'   => admin_url( 'nav-menus.php' ),\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( current_theme_supports( 'custom-background' ) ) {\n\t\t$wp_admin_bar->add_node(\n\t\t\tarray(\n\t\t\t\t'parent' => 'appearance',\n\t\t\t\t'id'     => 'background',\n\t\t\t\t'title'  => __( 'Background' ),\n\t\t\t\t'href'   => admin_url( 'themes.php?page=custom-background' ),\n\t\t\t\t'meta'   => array(\n\t\t\t\t\t'class' => 'hide-if-customize',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( current_theme_supports( 'custom-header' ) ) {\n\t\t$wp_admin_bar->add_node(\n\t\t\tarray(\n\t\t\t\t'parent' => 'appearance',\n\t\t\t\t'id'     => 'header',\n\t\t\t\t'title'  => __( 'Header' ),\n\t\t\t\t'href'   => admin_url( 'themes.php?page=custom-header' ),\n\t\t\t\t'meta'   => array(\n\t\t\t\t\t'class' => 'hide-if-customize',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}\n\n}\n\n/**\n * Provide an update link if theme/plugin/core updates are available.\n *\n * @since 3.1.0\n *\n * @param WP_Admin_Bar $wp_admin_bar\n */\nfunction wp_admin_bar_updates_menu( $wp_admin_bar ) {\n\n\t$update_data = wp_get_update_data();\n\n\tif ( ! $update_data['counts']['total'] ) {\n\t\treturn;\n\t}\n\n\t$title  = '<span class=\"ab-icon\"></span><span class=\"ab-label\">' . number_format_i18n( $update_data['counts']['total'] ) . '</span>';\n\t$title .= '<span class=\"screen-reader-text\">' . $update_data['title'] . '</span>';\n\n\t$wp_admin_bar->add_node(\n\t\tarray(\n\t\t\t'id'    => 'updates',\n\t\t\t'title' => $title,\n\t\t\t'href'  => network_admin_url( 'update-core.php' ),\n\t\t\t'meta'  => array(\n\t\t\t\t'title' => $update_data['title'],\n\t\t\t),\n\t\t)\n\t);\n}\n\n/**\n * Add search form.\n *\n * @since 3.3.0\n *\n * @param WP_Admin_Bar $wp_admin_bar\n */\nfunction wp_admin_bar_search_menu( $wp_admin_bar ) {\n\tif ( is_admin() ) {\n\t\treturn;\n\t}\n\n\t$form  = '<form action=\"' . esc_url( home_url( '/' ) ) . '\" method=\"get\" id=\"adminbarsearch\">';\n\t$form .= '<input class=\"adminbar-input\" name=\"s\" id=\"adminbar-search\" type=\"text\" value=\"\" maxlength=\"150\" />';\n\t$form .= '<label for=\"adminbar-search\" class=\"screen-reader-text\">' . __( 'Search' ) . '</label>';\n\t$form .= '<input type=\"submit\" class=\"adminbar-button\" value=\"' . __( 'Search' ) . '\"/>';\n\t$form .= '</form>';\n\n\t$wp_admin_bar->add_node(\n\t\tarray(\n\t\t\t'parent' => 'top-secondary',\n\t\t\t'id'     => 'search',\n\t\t\t'title'  => $form,\n\t\t\t'meta'   => array(\n\t\t\t\t'class'    => 'admin-bar-search',\n\t\t\t\t'tabindex' => -1,\n\t\t\t),\n\t\t)\n\t);\n}\n\n/**\n * Add a link to exit recovery mode when Recovery Mode is active.\n *\n * @since 5.2.0\n *\n * @param WP_Admin_Bar $wp_admin_bar\n */\nfunction wp_admin_bar_recovery_mode_menu( $wp_admin_bar ) {\n\tif ( ! wp_is_recovery_mode() ) {\n\t\treturn;\n\t}\n\n\t$url = wp_login_url();\n\t$url = add_query_arg( 'action', WP_Recovery_Mode::EXIT_ACTION, $url );\n\t$url = wp_nonce_url( $url, WP_Recovery_Mode::EXIT_ACTION );\n\n\t$wp_admin_bar->add_node(\n\t\tarray(\n\t\t\t'parent' => 'top-secondary',\n\t\t\t'id'     => 'recovery-mode',\n\t\t\t'title'  => __( 'Exit Recovery Mode' ),\n\t\t\t'href'   => $url,\n\t\t)\n\t);\n}\n\n/**\n * Add secondary menus.\n *\n * @since 3.3.0\n *\n * @param WP_Admin_Bar $wp_admin_bar\n */\nfunction wp_admin_bar_add_secondary_groups( $wp_admin_bar ) {\n\t$wp_admin_bar->add_group(\n\t\tarray(\n\t\t\t'id'   => 'top-secondary',\n\t\t\t'meta' => array(\n\t\t\t\t'class' => 'ab-top-secondary',\n\t\t\t),\n\t\t)\n\t);\n\n\t$wp_admin_bar->add_group(\n\t\tarray(\n\t\t\t'parent' => 'wp-logo',\n\t\t\t'id'     => 'wp-logo-external',\n\t\t\t'meta'   => array(\n\t\t\t\t'class' => 'ab-sub-secondary',\n\t\t\t),\n\t\t)\n\t);\n}\n\n/**\n * Style and scripts for the admin bar.\n *\n * @since 3.1.0\n */\nfunction wp_admin_bar_header() {\n\t$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type=\"text/css\"';\n\t?>\n<style<?php echo $type_attr; ?> media=\"print\">#wpadminbar { display:none; }</style>\n\t<?php\n}\n\n/**\n * Default admin bar callback.\n *\n * @since 3.1.0\n */\nfunction _admin_bar_bump_cb() {\n\t$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type=\"text/css\"';\n\t?>\n<style<?php echo $type_attr; ?> media=\"screen\">\n\thtml { margin-top: 32px !important; }\n\t* html body { margin-top: 32px !important; }\n\t@media screen and ( max-width: 782px ) {\n\t\thtml { margin-top: 46px !important; }\n\t\t* html body { margin-top: 46px !important; }\n\t}\n</style>\n\t<?php\n}\n\n/**\n * Sets the display status of the admin bar.\n *\n * This can be called immediately upon plugin load. It does not need to be called\n * from a function hooked to the {@see 'init'} action.\n *\n * @since 3.1.0\n *\n * @global bool $show_admin_bar\n *\n * @param bool $show Whether to allow the admin bar to show.\n */\nfunction show_admin_bar( $show ) {\n\tglobal $show_admin_bar;\n\t$show_admin_bar = (bool) $show;\n}\n\n/**\n * Determines whether the admin bar should be showing.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 3.1.0\n *\n * @global bool   $show_admin_bar\n * @global string $pagenow\n *\n * @return bool Whether the admin bar should be showing.\n */\nfunction is_admin_bar_showing() {\n\tglobal $show_admin_bar, $pagenow;\n\n\t// For all these types of requests, we never want an admin bar.\n\tif ( defined( 'XMLRPC_REQUEST' ) || defined( 'DOING_AJAX' ) || defined( 'IFRAME_REQUEST' ) || wp_is_json_request() ) {\n\t\treturn false;\n\t}\n\n\tif ( is_embed() ) {\n\t\treturn false;\n\t}\n\n\t// Integrated into the admin.\n\tif ( is_admin() ) {\n\t\treturn true;\n\t}\n\n\tif ( ! isset( $show_admin_bar ) ) {\n\t\tif ( ! is_user_logged_in() || 'wp-login.php' === $pagenow ) {\n\t\t\t$show_admin_bar = false;\n\t\t} else {\n\t\t\t$show_admin_bar = _get_admin_bar_pref();\n\t\t}\n\t}\n\n\t/**\n\t * Filters whether to show the admin bar.\n\t *\n\t * Returning false to this hook is the recommended way to hide the admin bar.\n\t * The user's display preference is used for logged in users.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param bool $show_admin_bar Whether the admin bar should be shown. Default false.\n\t */\n\t$show_admin_bar = apply_filters( 'show_admin_bar', $show_admin_bar );\n\n\treturn $show_admin_bar;\n}\n\n/**\n * Retrieve the admin bar display preference of a user.\n *\n * @since 3.1.0\n * @access private\n *\n * @param string $context Context of this preference check. Defaults to 'front'. The 'admin'\n *                        preference is no longer used.\n * @param int    $user    Optional. ID of the user to check, defaults to 0 for current user.\n * @return bool Whether the admin bar should be showing for this user.\n */\nfunction _get_admin_bar_pref( $context = 'front', $user = 0 ) {\n\t$pref = get_user_option( \"show_admin_bar_{$context}\", $user );\n\tif ( false === $pref ) {\n\t\treturn true;\n\t}\n\n\treturn 'true' === $pref;\n}\n", "num_lines": 1256}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Atom Syndication Format PHP Library\n *\n * @package AtomLib\n * @link http://code.google.com/p/phpatomlib/\n *\n * @author Elias Torres <elias@torrez.us>\n * @version 0.4\n * @since 2.3.0\n */\n\n/**\n * Structure that store common Atom Feed Properties\n *\n * @package AtomLib\n */\nclass AtomFeed {\n\t/**\n\t * Stores Links\n\t * @var array\n\t * @access public\n\t */\n    var $links = array();\n    /**\n     * Stores Categories\n     * @var array\n     * @access public\n     */\n    var $categories = array();\n\t/**\n\t * Stores Entries\n\t *\n\t * @var array\n\t * @access public\n\t */\n    var $entries = array();\n}\n\n/**\n * Structure that store Atom Entry Properties\n *\n * @package AtomLib\n */\nclass AtomEntry {\n\t/**\n\t * Stores Links\n\t * @var array\n\t * @access public\n\t */\n    var $links = array();\n    /**\n     * Stores Categories\n     * @var array\n\t * @access public\n     */\n    var $categories = array();\n}\n\n/**\n * AtomLib Atom Parser API\n *\n * @package AtomLib\n */\nclass AtomParser {\n\n    var $NS = 'http://www.w3.org/2005/Atom';\n    var $ATOM_CONTENT_ELEMENTS = array('content','summary','title','subtitle','rights');\n    var $ATOM_SIMPLE_ELEMENTS = array('id','updated','published','draft');\n\n    var $debug = false;\n\n    var $depth = 0;\n    var $indent = 2;\n    var $in_content;\n    var $ns_contexts = array();\n    var $ns_decls = array();\n    var $content_ns_decls = array();\n    var $content_ns_contexts = array();\n    var $is_xhtml = false;\n    var $is_html = false;\n    var $is_text = true;\n    var $skipped_div = false;\n\n    var $FILE = \"php://input\";\n\n    var $feed;\n    var $current;\n\n\t/**\n\t * PHP5 constructor.\n\t */\n    function __construct() {\n\n        $this->feed = new AtomFeed();\n        $this->current = null;\n        $this->map_attrs_func = array( __CLASS__, 'map_attrs' );\n        $this->map_xmlns_func = array( __CLASS__, 'map_xmlns' );\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function AtomParser() {\n\t\tself::__construct();\n\t}\n\n\t/**\n\t * Map attributes to key=\"val\"\n\t *\n\t * @param string $k Key\n\t * @param string $v Value\n\t * @return string\n\t */\n\tpublic static function map_attrs($k, $v) {\n\t\treturn \"$k=\\\"$v\\\"\";\n\t}\n\n\t/**\n\t * Map XML namespace to string.\n\t *\n\t * @param indexish $p XML Namespace element index\n\t * @param array $n Two-element array pair. [ 0 => {namespace}, 1 => {url} ]\n\t * @return string 'xmlns=\"{url}\"' or 'xmlns:{namespace}=\"{url}\"'\n\t */\n\tpublic static function map_xmlns($p, $n) {\n\t\t$xd = \"xmlns\";\n\t\tif( 0 < strlen($n[0]) ) {\n\t\t\t$xd .= \":{$n[0]}\";\n\t\t}\n\t\treturn \"{$xd}=\\\"{$n[1]}\\\"\";\n\t}\n\n    function _p($msg) {\n        if($this->debug) {\n            print str_repeat(\" \", $this->depth * $this->indent) . $msg .\"\\n\";\n        }\n    }\n\n    function error_handler($log_level, $log_text, $error_file, $error_line) {\n        $this->error = $log_text;\n    }\n\n    function parse() {\n\n        set_error_handler(array(&$this, 'error_handler'));\n\n        array_unshift($this->ns_contexts, array());\n\n        if ( ! function_exists( 'xml_parser_create_ns' ) ) {\n        \ttrigger_error( __( \"PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension.\" ) );\n        \treturn false;\n        }\n\n        $parser = xml_parser_create_ns();\n        xml_set_object($parser, $this);\n        xml_set_element_handler($parser, \"start_element\", \"end_element\");\n        xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);\n        xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,0);\n        xml_set_character_data_handler($parser, \"cdata\");\n        xml_set_default_handler($parser, \"_default\");\n        xml_set_start_namespace_decl_handler($parser, \"start_ns\");\n        xml_set_end_namespace_decl_handler($parser, \"end_ns\");\n\n        $this->content = '';\n\n        $ret = true;\n\n        $fp = fopen($this->FILE, \"r\");\n        while ($data = fread($fp, 4096)) {\n            if($this->debug) $this->content .= $data;\n\n            if(!xml_parse($parser, $data, feof($fp))) {\n                /* translators: 1: Error message, 2: Line number. */\n                trigger_error(sprintf(__('XML Error: %1$s at line %2$s').\"\\n\",\n                    xml_error_string(xml_get_error_code($parser)),\n                    xml_get_current_line_number($parser)));\n                $ret = false;\n                break;\n            }\n        }\n        fclose($fp);\n\n        xml_parser_free($parser);\n        unset($parser);\n\n        restore_error_handler();\n\n        return $ret;\n    }\n\n    function start_element($parser, $name, $attrs) {\n\n        $tag = array_pop(explode(\":\", $name));\n\n        switch($name) {\n            case $this->NS . ':feed':\n                $this->current = $this->feed;\n                break;\n            case $this->NS . ':entry':\n                $this->current = new AtomEntry();\n                break;\n        };\n\n        $this->_p(\"start_element('$name')\");\n        #$this->_p(print_r($this->ns_contexts,true));\n        #$this->_p('current(' . $this->current . ')');\n\n        array_unshift($this->ns_contexts, $this->ns_decls);\n\n        $this->depth++;\n\n        if(!empty($this->in_content)) {\n\n            $this->content_ns_decls = array();\n\n            if($this->is_html || $this->is_text)\n                trigger_error(\"Invalid content in element found. Content must not be of type text or html if it contains markup.\");\n\n            $attrs_prefix = array();\n\n            // resolve prefixes for attributes\n            foreach($attrs as $key => $value) {\n                $with_prefix = $this->ns_to_prefix($key, true);\n                $attrs_prefix[$with_prefix[1]] = $this->xml_escape($value);\n            }\n\n            $attrs_str = join(' ', array_map($this->map_attrs_func, array_keys($attrs_prefix), array_values($attrs_prefix)));\n            if(strlen($attrs_str) > 0) {\n                $attrs_str = \" \" . $attrs_str;\n            }\n\n            $with_prefix = $this->ns_to_prefix($name);\n\n            if(!$this->is_declared_content_ns($with_prefix[0])) {\n                array_push($this->content_ns_decls, $with_prefix[0]);\n            }\n\n            $xmlns_str = '';\n            if(count($this->content_ns_decls) > 0) {\n                array_unshift($this->content_ns_contexts, $this->content_ns_decls);\n                $xmlns_str .= join(' ', array_map($this->map_xmlns_func, array_keys($this->content_ns_contexts[0]), array_values($this->content_ns_contexts[0])));\n                if(strlen($xmlns_str) > 0) {\n                    $xmlns_str = \" \" . $xmlns_str;\n                }\n            }\n\n            array_push($this->in_content, array($tag, $this->depth, \"<\". $with_prefix[1] .\"{$xmlns_str}{$attrs_str}\" . \">\"));\n\n        } else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) {\n            $this->in_content = array();\n            $this->is_xhtml = $attrs['type'] == 'xhtml';\n            $this->is_html = $attrs['type'] == 'html' || $attrs['type'] == 'text/html';\n            $this->is_text = !in_array('type',array_keys($attrs)) || $attrs['type'] == 'text';\n            $type = $this->is_xhtml ? 'XHTML' : ($this->is_html ? 'HTML' : ($this->is_text ? 'TEXT' : $attrs['type']));\n\n            if(in_array('src',array_keys($attrs))) {\n                $this->current->$tag = $attrs;\n            } else {\n                array_push($this->in_content, array($tag,$this->depth, $type));\n            }\n        } else if($tag == 'link') {\n            array_push($this->current->links, $attrs);\n        } else if($tag == 'category') {\n            array_push($this->current->categories, $attrs);\n        }\n\n        $this->ns_decls = array();\n    }\n\n    function end_element($parser, $name) {\n\n        $tag = array_pop(explode(\":\", $name));\n\n        $ccount = count($this->in_content);\n\n        # if we are *in* content, then let's proceed to serialize it\n        if(!empty($this->in_content)) {\n            # if we are ending the original content element\n            # then let's finalize the content\n            if($this->in_content[0][0] == $tag &&\n                $this->in_content[0][1] == $this->depth) {\n                $origtype = $this->in_content[0][2];\n                array_shift($this->in_content);\n                $newcontent = array();\n                foreach($this->in_content as $c) {\n                    if(count($c) == 3) {\n                        array_push($newcontent, $c[2]);\n                    } else {\n                        if($this->is_xhtml || $this->is_text) {\n                            array_push($newcontent, $this->xml_escape($c));\n                        } else {\n                            array_push($newcontent, $c);\n                        }\n                    }\n                }\n                if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS)) {\n                    $this->current->$tag = array($origtype, join('',$newcontent));\n                } else {\n                    $this->current->$tag = join('',$newcontent);\n                }\n                $this->in_content = array();\n            } else if($this->in_content[$ccount-1][0] == $tag &&\n                $this->in_content[$ccount-1][1] == $this->depth) {\n                $this->in_content[$ccount-1][2] = substr($this->in_content[$ccount-1][2],0,-1) . \"/>\";\n            } else {\n                # else, just finalize the current element's content\n                $endtag = $this->ns_to_prefix($name);\n                array_push($this->in_content, array($tag, $this->depth, \"</$endtag[1]>\"));\n            }\n        }\n\n        array_shift($this->ns_contexts);\n\n        $this->depth--;\n\n        if($name == ($this->NS . ':entry')) {\n            array_push($this->feed->entries, $this->current);\n            $this->current = null;\n        }\n\n        $this->_p(\"end_element('$name')\");\n    }\n\n    function start_ns($parser, $prefix, $uri) {\n        $this->_p(\"starting: \" . $prefix . \":\" . $uri);\n        array_push($this->ns_decls, array($prefix,$uri));\n    }\n\n    function end_ns($parser, $prefix) {\n        $this->_p(\"ending: #\" . $prefix . \"#\");\n    }\n\n    function cdata($parser, $data) {\n        $this->_p(\"data: #\" . str_replace(array(\"\\n\"), array(\"\\\\n\"), trim($data)) . \"#\");\n        if(!empty($this->in_content)) {\n            array_push($this->in_content, $data);\n        }\n    }\n\n    function _default($parser, $data) {\n        # when does this gets called?\n    }\n\n\n    function ns_to_prefix($qname, $attr=false) {\n        # split 'http://www.w3.org/1999/xhtml:div' into ('http','//www.w3.org/1999/xhtml','div')\n        $components = explode(\":\", $qname);\n\n        # grab the last one (e.g 'div')\n        $name = array_pop($components);\n\n        if(!empty($components)) {\n            # re-join back the namespace component\n            $ns = join(\":\",$components);\n            foreach($this->ns_contexts as $context) {\n                foreach($context as $mapping) {\n                    if($mapping[1] == $ns && strlen($mapping[0]) > 0) {\n                        return array($mapping, \"$mapping[0]:$name\");\n                    }\n                }\n            }\n        }\n\n        if($attr) {\n            return array(null, $name);\n        } else {\n            foreach($this->ns_contexts as $context) {\n                foreach($context as $mapping) {\n                    if(strlen($mapping[0]) == 0) {\n                        return array($mapping, $name);\n                    }\n                }\n            }\n        }\n    }\n\n    function is_declared_content_ns($new_mapping) {\n        foreach($this->content_ns_contexts as $context) {\n            foreach($context as $mapping) {\n                if($new_mapping == $mapping) {\n                    return true;\n                }\n            }\n        }\n        return false;\n    }\n\n    function xml_escape($string)\n    {\n             return str_replace(array('&','\"',\"'\",'<','>'),\n                array('&amp;','&quot;','&apos;','&lt;','&gt;'),\n                $string );\n    }\n}\n", "num_lines": 396}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Author Template functions for use in themes.\n *\n * These functions must be used within the WordPress Loop.\n *\n * @link https://codex.wordpress.org/Author_Templates\n *\n * @package WordPress\n * @subpackage Template\n */\n\n/**\n * Retrieve the author of the current post.\n *\n * @since 1.5.0\n *\n * @global WP_User $authordata The current author's data.\n *\n * @param string $deprecated Deprecated.\n * @return string|null The author's display name.\n */\nfunction get_the_author( $deprecated = '' ) {\n\tglobal $authordata;\n\n\tif ( ! empty( $deprecated ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '2.1.0' );\n\t}\n\n\t/**\n\t * Filters the display name of the current post's author.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string|null $display_name The author's display name.\n\t */\n\treturn apply_filters( 'the_author', is_object( $authordata ) ? $authordata->display_name : null );\n}\n\n/**\n * Display the name of the author of the current post.\n *\n * The behavior of this function is based off of old functionality predating\n * get_the_author(). This function is not deprecated, but is designed to echo\n * the value from get_the_author() and as an result of any old theme that might\n * still use the old behavior will also pass the value from get_the_author().\n *\n * The normal, expected behavior of this function is to echo the author and not\n * return it. However, backward compatibility has to be maintained.\n *\n * @since 0.71\n *\n * @see get_the_author()\n * @link https://developer.wordpress.org/reference/functions/the_author/\n *\n * @param string $deprecated      Deprecated.\n * @param bool   $deprecated_echo Deprecated. Use get_the_author(). Echo the string or return it.\n * @return string|null The author's display name, from get_the_author().\n */\nfunction the_author( $deprecated = '', $deprecated_echo = true ) {\n\tif ( ! empty( $deprecated ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '2.1.0' );\n\t}\n\n\tif ( true !== $deprecated_echo ) {\n\t\t_deprecated_argument(\n\t\t\t__FUNCTION__,\n\t\t\t'1.5.0',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: get_the_author() */\n\t\t\t\t__( 'Use %s instead if you do not want the value echoed.' ),\n\t\t\t\t'<code>get_the_author()</code>'\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( $deprecated_echo ) {\n\t\techo get_the_author();\n\t}\n\n\treturn get_the_author();\n}\n\n/**\n * Retrieve the author who last edited the current post.\n *\n * @since 2.8.0\n *\n * @return string|void The author's display name.\n */\nfunction get_the_modified_author() {\n\t$last_id = get_post_meta( get_post()->ID, '_edit_last', true );\n\n\tif ( $last_id ) {\n\t\t$last_user = get_userdata( $last_id );\n\n\t\t/**\n\t\t * Filters the display name of the author who last edited the current post.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string $display_name The author's display name.\n\t\t */\n\t\treturn apply_filters( 'the_modified_author', $last_user->display_name );\n\t}\n}\n\n/**\n * Display the name of the author who last edited the current post,\n * if the author's ID is available.\n *\n * @since 2.8.0\n *\n * @see get_the_author()\n */\nfunction the_modified_author() {\n\techo get_the_modified_author();\n}\n\n/**\n * Retrieves the requested data of the author of the current post.\n *\n * Valid values for the `$field` parameter include:\n *\n * - admin_color\n * - aim\n * - comment_shortcuts\n * - description\n * - display_name\n * - first_name\n * - ID\n * - jabber\n * - last_name\n * - nickname\n * - plugins_last_view\n * - plugins_per_page\n * - rich_editing\n * - syntax_highlighting\n * - user_activation_key\n * - user_description\n * - user_email\n * - user_firstname\n * - user_lastname\n * - user_level\n * - user_login\n * - user_nicename\n * - user_pass\n * - user_registered\n * - user_status\n * - user_url\n * - yim\n *\n * @since 2.8.0\n *\n * @global WP_User $authordata The current author's data.\n *\n * @param string    $field   Optional. The user field to retrieve. Default empty.\n * @param int|false $user_id Optional. User ID.\n * @return string The author's field from the current author's DB object, otherwise an empty string.\n */\nfunction get_the_author_meta( $field = '', $user_id = false ) {\n\t$original_user_id = $user_id;\n\n\tif ( ! $user_id ) {\n\t\tglobal $authordata;\n\t\t$user_id = isset( $authordata->ID ) ? $authordata->ID : 0;\n\t} else {\n\t\t$authordata = get_userdata( $user_id );\n\t}\n\n\tif ( in_array( $field, array( 'login', 'pass', 'nicename', 'email', 'url', 'registered', 'activation_key', 'status' ), true ) ) {\n\t\t$field = 'user_' . $field;\n\t}\n\n\t$value = isset( $authordata->$field ) ? $authordata->$field : '';\n\n\t/**\n\t * Filters the value of the requested user metadata.\n\t *\n\t * The filter name is dynamic and depends on the $field parameter of the function.\n\t *\n\t * @since 2.8.0\n\t * @since 4.3.0 The `$original_user_id` parameter was added.\n\t *\n\t * @param string    $value            The value of the metadata.\n\t * @param int       $user_id          The user ID for the value.\n\t * @param int|false $original_user_id The original user ID, as passed to the function.\n\t */\n\treturn apply_filters( \"get_the_author_{$field}\", $value, $user_id, $original_user_id );\n}\n\n/**\n * Outputs the field from the user's DB object. Defaults to current post's author.\n *\n * @since 2.8.0\n *\n * @param string    $field   Selects the field of the users record. See get_the_author_meta()\n *                           for the list of possible fields.\n * @param int|false $user_id Optional. User ID.\n *\n * @see get_the_author_meta()\n */\nfunction the_author_meta( $field = '', $user_id = false ) {\n\t$author_meta = get_the_author_meta( $field, $user_id );\n\n\t/**\n\t * The value of the requested user metadata.\n\t *\n\t * The filter name is dynamic and depends on the $field parameter of the function.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string    $author_meta The value of the metadata.\n\t * @param int|false $user_id     The user ID.\n\t */\n\techo apply_filters( \"the_author_{$field}\", $author_meta, $user_id );\n}\n\n/**\n * Retrieve either author's link or author's name.\n *\n * If the author has a home page set, return an HTML link, otherwise just return the\n * author's name.\n *\n * @since 3.0.0\n *\n * @return string|null An HTML link if the author's url exist in user meta,\n *                     else the result of get_the_author().\n */\nfunction get_the_author_link() {\n\tif ( get_the_author_meta( 'url' ) ) {\n\t\treturn sprintf(\n\t\t\t'<a href=\"%1$s\" title=\"%2$s\" rel=\"author external\">%3$s</a>',\n\t\t\tesc_url( get_the_author_meta( 'url' ) ),\n\t\t\t/* translators: %s: Author's display name. */\n\t\t\tesc_attr( sprintf( __( 'Visit %s&#8217;s website' ), get_the_author() ) ),\n\t\t\tget_the_author()\n\t\t);\n\t} else {\n\t\treturn get_the_author();\n\t}\n}\n\n/**\n * Display either author's link or author's name.\n *\n * If the author has a home page set, echo an HTML link, otherwise just echo the\n * author's name.\n *\n * @link https://developer.wordpress.org/reference/functions/the_author_link/\n *\n * @since 2.1.0\n */\nfunction the_author_link() {\n\techo get_the_author_link();\n}\n\n/**\n * Retrieve the number of posts by the author of the current post.\n *\n * @since 1.5.0\n *\n * @return int The number of posts by the author.\n */\nfunction get_the_author_posts() {\n\t$post = get_post();\n\tif ( ! $post ) {\n\t\treturn 0;\n\t}\n\treturn count_user_posts( $post->post_author, $post->post_type );\n}\n\n/**\n * Display the number of posts by the author of the current post.\n *\n * @link https://developer.wordpress.org/reference/functions/the_author_posts/\n * @since 0.71\n */\nfunction the_author_posts() {\n\techo get_the_author_posts();\n}\n\n/**\n * Retrieves an HTML link to the author page of the current post's author.\n *\n * Returns an HTML-formatted link using get_author_posts_url().\n *\n * @since 4.4.0\n *\n * @global WP_User $authordata The current author's data.\n *\n * @return string An HTML link to the author page, or an empty string if $authordata isn't defined.\n */\nfunction get_the_author_posts_link() {\n\tglobal $authordata;\n\tif ( ! is_object( $authordata ) ) {\n\t\treturn '';\n\t}\n\n\t$link = sprintf(\n\t\t'<a href=\"%1$s\" title=\"%2$s\" rel=\"author\">%3$s</a>',\n\t\tesc_url( get_author_posts_url( $authordata->ID, $authordata->user_nicename ) ),\n\t\t/* translators: %s: Author's display name. */\n\t\tesc_attr( sprintf( __( 'Posts by %s' ), get_the_author() ) ),\n\t\tget_the_author()\n\t);\n\n\t/**\n\t * Filters the link to the author page of the author of the current post.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string $link HTML link.\n\t */\n\treturn apply_filters( 'the_author_posts_link', $link );\n}\n\n/**\n * Displays an HTML link to the author page of the current post's author.\n *\n * @since 1.2.0\n * @since 4.4.0 Converted into a wrapper for get_the_author_posts_link()\n *\n * @param string $deprecated Unused.\n */\nfunction the_author_posts_link( $deprecated = '' ) {\n\tif ( ! empty( $deprecated ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '2.1.0' );\n\t}\n\techo get_the_author_posts_link();\n}\n\n/**\n * Retrieve the URL to the author page for the user with the ID provided.\n *\n * @since 2.1.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param int    $author_id       Author ID.\n * @param string $author_nicename Optional. The author's nicename (slug). Default empty.\n * @return string The URL to the author's page.\n */\nfunction get_author_posts_url( $author_id, $author_nicename = '' ) {\n\tglobal $wp_rewrite;\n\t$auth_ID = (int) $author_id;\n\t$link    = $wp_rewrite->get_author_permastruct();\n\n\tif ( empty( $link ) ) {\n\t\t$file = home_url( '/' );\n\t\t$link = $file . '?author=' . $auth_ID;\n\t} else {\n\t\tif ( '' === $author_nicename ) {\n\t\t\t$user = get_userdata( $author_id );\n\t\t\tif ( ! empty( $user->user_nicename ) ) {\n\t\t\t\t$author_nicename = $user->user_nicename;\n\t\t\t}\n\t\t}\n\t\t$link = str_replace( '%author%', $author_nicename, $link );\n\t\t$link = home_url( user_trailingslashit( $link ) );\n\t}\n\n\t/**\n\t * Filters the URL to the author's page.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $link            The URL to the author's page.\n\t * @param int    $author_id       The author's ID.\n\t * @param string $author_nicename The author's nice name.\n\t */\n\t$link = apply_filters( 'author_link', $link, $author_id, $author_nicename );\n\n\treturn $link;\n}\n\n/**\n * List all the authors of the site, with several options available.\n *\n * @link https://developer.wordpress.org/reference/functions/wp_list_authors/\n *\n * @since 1.2.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string|array $args {\n *     Optional. Array or string of default arguments.\n *\n *     @type string       $orderby       How to sort the authors. Accepts 'nicename', 'email', 'url', 'registered',\n *                                       'user_nicename', 'user_email', 'user_url', 'user_registered', 'name',\n *                                       'display_name', 'post_count', 'ID', 'meta_value', 'user_login'. Default 'name'.\n *     @type string       $order         Sorting direction for $orderby. Accepts 'ASC', 'DESC'. Default 'ASC'.\n *     @type int          $number        Maximum authors to return or display. Default empty (all authors).\n *     @type bool         $optioncount   Show the count in parenthesis next to the author's name. Default false.\n *     @type bool         $exclude_admin Whether to exclude the 'admin' account, if it exists. Default true.\n *     @type bool         $show_fullname Whether to show the author's full name. Default false.\n *     @type bool         $hide_empty    Whether to hide any authors with no posts. Default true.\n *     @type string       $feed          If not empty, show a link to the author's feed and use this text as the alt\n *                                       parameter of the link. Default empty.\n *     @type string       $feed_image    If not empty, show a link to the author's feed and use this image URL as\n *                                       clickable anchor. Default empty.\n *     @type string       $feed_type     The feed type to link to. Possible values include 'rss2', 'atom'.\n *                                       Default is the value of get_default_feed().\n *     @type bool         $echo          Whether to output the result or instead return it. Default true.\n *     @type string       $style         If 'list', each author is wrapped in an `<li>` element, otherwise the authors\n *                                       will be separated by commas.\n *     @type bool         $html          Whether to list the items in HTML form or plaintext. Default true.\n *     @type array|string $exclude       Array or comma/space-separated list of author IDs to exclude. Default empty.\n *     @type array|string $include       Array or comma/space-separated list of author IDs to include. Default empty.\n * }\n * @return void|string Void if 'echo' argument is true, list of authors if 'echo' is false.\n */\nfunction wp_list_authors( $args = '' ) {\n\tglobal $wpdb;\n\n\t$defaults = array(\n\t\t'orderby'       => 'name',\n\t\t'order'         => 'ASC',\n\t\t'number'        => '',\n\t\t'optioncount'   => false,\n\t\t'exclude_admin' => true,\n\t\t'show_fullname' => false,\n\t\t'hide_empty'    => true,\n\t\t'feed'          => '',\n\t\t'feed_image'    => '',\n\t\t'feed_type'     => '',\n\t\t'echo'          => true,\n\t\t'style'         => 'list',\n\t\t'html'          => true,\n\t\t'exclude'       => '',\n\t\t'include'       => '',\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\t$return = '';\n\n\t$query_args           = wp_array_slice_assoc( $args, array( 'orderby', 'order', 'number', 'exclude', 'include' ) );\n\t$query_args['fields'] = 'ids';\n\t$authors              = get_users( $query_args );\n\n\t$author_count = array();\n\tforeach ( (array) $wpdb->get_results( \"SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE \" . get_private_posts_cap_sql( 'post' ) . ' GROUP BY post_author' ) as $row ) {\n\t\t$author_count[ $row->post_author ] = $row->count;\n\t}\n\tforeach ( $authors as $author_id ) {\n\t\t$posts = isset( $author_count[ $author_id ] ) ? $author_count[ $author_id ] : 0;\n\n\t\tif ( ! $posts && $args['hide_empty'] ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$author = get_userdata( $author_id );\n\n\t\tif ( $args['exclude_admin'] && 'admin' === $author->display_name ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( $args['show_fullname'] && $author->first_name && $author->last_name ) {\n\t\t\t$name = \"$author->first_name $author->last_name\";\n\t\t} else {\n\t\t\t$name = $author->display_name;\n\t\t}\n\n\t\tif ( ! $args['html'] ) {\n\t\t\t$return .= $name . ', ';\n\n\t\t\tcontinue; // No need to go further to process HTML.\n\t\t}\n\n\t\tif ( 'list' === $args['style'] ) {\n\t\t\t$return .= '<li>';\n\t\t}\n\n\t\t$link = sprintf(\n\t\t\t'<a href=\"%1$s\" title=\"%2$s\">%3$s</a>',\n\t\t\tget_author_posts_url( $author->ID, $author->user_nicename ),\n\t\t\t/* translators: %s: Author's display name. */\n\t\t\tesc_attr( sprintf( __( 'Posts by %s' ), $author->display_name ) ),\n\t\t\t$name\n\t\t);\n\n\t\tif ( ! empty( $args['feed_image'] ) || ! empty( $args['feed'] ) ) {\n\t\t\t$link .= ' ';\n\t\t\tif ( empty( $args['feed_image'] ) ) {\n\t\t\t\t$link .= '(';\n\t\t\t}\n\n\t\t\t$link .= '<a href=\"' . get_author_feed_link( $author->ID, $args['feed_type'] ) . '\"';\n\n\t\t\t$alt = '';\n\t\t\tif ( ! empty( $args['feed'] ) ) {\n\t\t\t\t$alt  = ' alt=\"' . esc_attr( $args['feed'] ) . '\"';\n\t\t\t\t$name = $args['feed'];\n\t\t\t}\n\n\t\t\t$link .= '>';\n\n\t\t\tif ( ! empty( $args['feed_image'] ) ) {\n\t\t\t\t$link .= '<img src=\"' . esc_url( $args['feed_image'] ) . '\" style=\"border: none;\"' . $alt . ' />';\n\t\t\t} else {\n\t\t\t\t$link .= $name;\n\t\t\t}\n\n\t\t\t$link .= '</a>';\n\n\t\t\tif ( empty( $args['feed_image'] ) ) {\n\t\t\t\t$link .= ')';\n\t\t\t}\n\t\t}\n\n\t\tif ( $args['optioncount'] ) {\n\t\t\t$link .= ' (' . $posts . ')';\n\t\t}\n\n\t\t$return .= $link;\n\t\t$return .= ( 'list' === $args['style'] ) ? '</li>' : ', ';\n\t}\n\n\t$return = rtrim( $return, ', ' );\n\n\tif ( $args['echo'] ) {\n\t\techo $return;\n\t} else {\n\t\treturn $return;\n\t}\n}\n\n/**\n * Determines whether this site has more than one author.\n *\n * Checks to see if more than one author has published posts.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 3.2.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @return bool Whether or not we have more than one author\n */\nfunction is_multi_author() {\n\tglobal $wpdb;\n\n\t$is_multi_author = get_transient( 'is_multi_author' );\n\tif ( false === $is_multi_author ) {\n\t\t$rows            = (array) $wpdb->get_col( \"SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 2\" );\n\t\t$is_multi_author = 1 < count( $rows ) ? 1 : 0;\n\t\tset_transient( 'is_multi_author', $is_multi_author );\n\t}\n\n\t/**\n\t * Filters whether the site has more than one author with published posts.\n\t *\n\t * @since 3.2.0\n\t *\n\t * @param bool $is_multi_author Whether $is_multi_author should evaluate as true.\n\t */\n\treturn apply_filters( 'is_multi_author', (bool) $is_multi_author );\n}\n\n/**\n * Helper function to clear the cache for number of authors.\n *\n * @since 3.2.0\n * @access private\n */\nfunction __clear_multi_author_cache() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore\n\tdelete_transient( 'is_multi_author' );\n}\n", "num_lines": 573}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Register the block patterns and block patterns categories\n *\n * @package WordPress\n * @since 5.5.0\n */\n\nadd_theme_support( 'core-block-patterns' );\n\n/**\n * Registers the core block patterns and categories.\n *\n * @since 5.5.0\n * @private\n */\nfunction _register_core_block_patterns_and_categories() {\n\t$should_register_core_patterns = get_theme_support( 'core-block-patterns' );\n\n\tif ( $should_register_core_patterns ) {\n\t\t$core_block_patterns = array(\n\t\t\t'text-two-columns',\n\t\t\t'two-buttons',\n\t\t\t'two-images',\n\t\t\t'text-two-columns-with-images',\n\t\t\t'text-three-columns-buttons',\n\t\t\t'large-header',\n\t\t\t'large-header-button',\n\t\t\t'three-buttons',\n\t\t\t'heading-paragraph',\n\t\t\t'quote',\n\t\t);\n\n\t\tforeach ( $core_block_patterns as $core_block_pattern ) {\n\t\t\tregister_block_pattern(\n\t\t\t\t'core/' . $core_block_pattern,\n\t\t\t\trequire __DIR__ . '/block-patterns/' . $core_block_pattern . '.php'\n\t\t\t);\n\t\t}\n\t}\n\n\tregister_block_pattern_category( 'buttons', array( 'label' => _x( 'Buttons', 'Block pattern category' ) ) );\n\tregister_block_pattern_category( 'columns', array( 'label' => _x( 'Columns', 'Block pattern category' ) ) );\n\tregister_block_pattern_category( 'gallery', array( 'label' => _x( 'Gallery', 'Block pattern category' ) ) );\n\tregister_block_pattern_category( 'header', array( 'label' => _x( 'Headers', 'Block pattern category' ) ) );\n\tregister_block_pattern_category( 'text', array( 'label' => _x( 'Text', 'Block pattern category' ) ) );\n}\n", "num_lines": 48}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Functions related to registering and parsing blocks.\n *\n * @package WordPress\n * @subpackage Blocks\n * @since 5.0.0\n */\n\n/**\n * Registers a block type.\n *\n * @since 5.0.0\n *\n * @param string|WP_Block_Type $name Block type name including namespace, or alternatively\n *                                   a complete WP_Block_Type instance. In case a WP_Block_Type\n *                                   is provided, the $args parameter will be ignored.\n * @param array                $args {\n *     Optional. Array of block type arguments. Accepts any public property of `WP_Block_Type`.\n *     Any arguments may be defined, however the ones described below are supported by default.\n *     Default empty array.\n *\n *     @type callable $render_callback Callback used to render blocks of this block type.\n * }\n * @return WP_Block_Type|false The registered block type on success, or false on failure.\n */\nfunction register_block_type( $name, $args = array() ) {\n\treturn WP_Block_Type_Registry::get_instance()->register( $name, $args );\n}\n\n/**\n * Unregisters a block type.\n *\n * @since 5.0.0\n *\n * @param string|WP_Block_Type $name Block type name including namespace, or alternatively\n *                                   a complete WP_Block_Type instance.\n * @return WP_Block_Type|false The unregistered block type on success, or false on failure.\n */\nfunction unregister_block_type( $name ) {\n\treturn WP_Block_Type_Registry::get_instance()->unregister( $name );\n}\n\n/**\n * Removes the block asset's path prefix if provided.\n *\n * @since 5.5.0\n *\n * @param string $asset_handle_or_path Asset handle or prefixed path.\n * @return string Path without the prefix or the original value.\n */\nfunction remove_block_asset_path_prefix( $asset_handle_or_path ) {\n\t$path_prefix = 'file:';\n\tif ( 0 !== strpos( $asset_handle_or_path, $path_prefix ) ) {\n\t\treturn $asset_handle_or_path;\n\t}\n\treturn substr(\n\t\t$asset_handle_or_path,\n\t\tstrlen( $path_prefix )\n\t);\n}\n\n/**\n * Generates the name for an asset based on the name of the block\n * and the field name provided.\n *\n * @since 5.5.0\n *\n * @param string $block_name Name of the block.\n * @param string $field_name Name of the metadata field.\n * @return string Generated asset name for the block's field.\n */\nfunction generate_block_asset_handle( $block_name, $field_name ) {\n\t$field_mappings = array(\n\t\t'editorScript' => 'editor-script',\n\t\t'script'       => 'script',\n\t\t'editorStyle'  => 'editor-style',\n\t\t'style'        => 'style',\n\t);\n\treturn str_replace( '/', '-', $block_name ) .\n\t\t'-' . $field_mappings[ $field_name ];\n}\n\n/**\n * Finds a script handle for the selected block metadata field. It detects\n * when a path to file was provided and finds a corresponding asset file\n * with details necessary to register the script under automatically\n * generated handle name. It returns unprocessed script handle otherwise.\n *\n * @since 5.5.0\n *\n * @param array  $metadata   Block metadata.\n * @param string $field_name Field name to pick from metadata.\n * @return string|bool Script handle provided directly or created through\n *                     script's registration, or false on failure.\n */\nfunction register_block_script_handle( $metadata, $field_name ) {\n\tif ( empty( $metadata[ $field_name ] ) ) {\n\t\treturn false;\n\t}\n\t$script_handle = $metadata[ $field_name ];\n\t$script_path   = remove_block_asset_path_prefix( $metadata[ $field_name ] );\n\tif ( $script_handle === $script_path ) {\n\t\treturn $script_handle;\n\t}\n\n\t$script_handle     = generate_block_asset_handle( $metadata['name'], $field_name );\n\t$script_asset_path = realpath(\n\t\tdirname( $metadata['file'] ) . '/' .\n\t\tsubstr_replace( $script_path, '.asset.php', - strlen( '.js' ) )\n\t);\n\tif ( ! file_exists( $script_asset_path ) ) {\n\t\t$message = sprintf(\n\t\t\t/* translators: %1: field name. %2: block name */\n\t\t\t__( 'The asset file for the \"%1$s\" defined in \"%2$s\" block definition is missing.', 'default' ),\n\t\t\t$field_name,\n\t\t\t$metadata['name']\n\t\t);\n\t\t_doing_it_wrong( __FUNCTION__, $message, '5.5.0' );\n\t\treturn false;\n\t}\n\t$script_asset = require $script_asset_path;\n\t$result       = wp_register_script(\n\t\t$script_handle,\n\t\tplugins_url( $script_path, $metadata['file'] ),\n\t\t$script_asset['dependencies'],\n\t\t$script_asset['version']\n\t);\n\treturn $result ? $script_handle : false;\n}\n\n/**\n * Finds a style handle for the block metadata field. It detects when a path\n * to file was provided and registers the style under automatically\n * generated handle name. It returns unprocessed style handle otherwise.\n *\n * @since 5.5.0\n *\n * @param array  $metadata Block metadata.\n * @param string $field_name Field name to pick from metadata.\n * @return string|boolean Style handle provided directly or created through\n *                        style's registration, or false on failure.\n */\nfunction register_block_style_handle( $metadata, $field_name ) {\n\tif ( empty( $metadata[ $field_name ] ) ) {\n\t\treturn false;\n\t}\n\t$style_handle = $metadata[ $field_name ];\n\t$style_path   = remove_block_asset_path_prefix( $metadata[ $field_name ] );\n\tif ( $style_handle === $style_path ) {\n\t\treturn $style_handle;\n\t}\n\n\t$style_handle = generate_block_asset_handle( $metadata['name'], $field_name );\n\t$block_dir    = dirname( $metadata['file'] );\n\t$result       = wp_register_style(\n\t\t$style_handle,\n\t\tplugins_url( $style_path, $metadata['file'] ),\n\t\tarray(),\n\t\tfilemtime( realpath( \"$block_dir/$style_path\" ) )\n\t);\n\treturn $result ? $style_handle : false;\n}\n\n/**\n * Registers a block type from metadata stored in the `block.json` file.\n *\n * @since 5.5.0\n *\n * @param string $file_or_folder Path to the JSON file with metadata definition for\n *                               the block or path to the folder where the `block.json` file is located.\n * @param array  $args {\n *     Optional. Array of block type arguments. Accepts any public property of `WP_Block_Type`.\n *     Any arguments may be defined, however the ones described below are supported by default.\n *     Default empty array.\n *\n *     @type callable $render_callback Callback used to render blocks of this block type.\n * }\n * @return WP_Block_Type|false The registered block type on success, or false on failure.\n */\nfunction register_block_type_from_metadata( $file_or_folder, $args = array() ) {\n\t$filename      = 'block.json';\n\t$metadata_file = ( substr( $file_or_folder, -strlen( $filename ) ) !== $filename ) ?\n\t\ttrailingslashit( $file_or_folder ) . $filename :\n\t\t$file_or_folder;\n\tif ( ! file_exists( $metadata_file ) ) {\n\t\treturn false;\n\t}\n\n\t$metadata = json_decode( file_get_contents( $metadata_file ), true );\n\tif ( ! is_array( $metadata ) || empty( $metadata['name'] ) ) {\n\t\treturn false;\n\t}\n\t$metadata['file'] = $metadata_file;\n\n\t$settings          = array();\n\t$property_mappings = array(\n\t\t'title'           => 'title',\n\t\t'category'        => 'category',\n\t\t'parent'          => 'parent',\n\t\t'icon'            => 'icon',\n\t\t'description'     => 'description',\n\t\t'keywords'        => 'keywords',\n\t\t'attributes'      => 'attributes',\n\t\t'providesContext' => 'provides_context',\n\t\t'usesContext'     => 'uses_context',\n\t\t'supports'        => 'supports',\n\t\t'styles'          => 'styles',\n\t\t'example'         => 'example',\n\t);\n\n\tforeach ( $property_mappings as $key => $mapped_key ) {\n\t\tif ( isset( $metadata[ $key ] ) ) {\n\t\t\t$settings[ $mapped_key ] = $metadata[ $key ];\n\t\t}\n\t}\n\n\tif ( ! empty( $metadata['editorScript'] ) ) {\n\t\t$settings['editor_script'] = register_block_script_handle(\n\t\t\t$metadata,\n\t\t\t'editorScript'\n\t\t);\n\t}\n\n\tif ( ! empty( $metadata['script'] ) ) {\n\t\t$settings['script'] = register_block_script_handle(\n\t\t\t$metadata,\n\t\t\t'script'\n\t\t);\n\t}\n\n\tif ( ! empty( $metadata['editorStyle'] ) ) {\n\t\t$settings['editor_style'] = register_block_style_handle(\n\t\t\t$metadata,\n\t\t\t'editorStyle'\n\t\t);\n\t}\n\n\tif ( ! empty( $metadata['style'] ) ) {\n\t\t$settings['style'] = register_block_style_handle(\n\t\t\t$metadata,\n\t\t\t'style'\n\t\t);\n\t}\n\n\treturn register_block_type(\n\t\t$metadata['name'],\n\t\tarray_merge(\n\t\t\t$settings,\n\t\t\t$args\n\t\t)\n\t);\n}\n\n/**\n * Determine whether a post or content string has blocks.\n *\n * This test optimizes for performance rather than strict accuracy, detecting\n * the pattern of a block but not validating its structure. For strict accuracy,\n * you should use the block parser on post content.\n *\n * @since 5.0.0\n *\n * @see parse_blocks()\n *\n * @param int|string|WP_Post|null $post Optional. Post content, post ID, or post object. Defaults to global $post.\n * @return bool Whether the post has blocks.\n */\nfunction has_blocks( $post = null ) {\n\tif ( ! is_string( $post ) ) {\n\t\t$wp_post = get_post( $post );\n\t\tif ( $wp_post instanceof WP_Post ) {\n\t\t\t$post = $wp_post->post_content;\n\t\t}\n\t}\n\n\treturn false !== strpos( (string) $post, '<!-- wp:' );\n}\n\n/**\n * Determine whether a $post or a string contains a specific block type.\n *\n * This test optimizes for performance rather than strict accuracy, detecting\n * the block type exists but not validating its structure. For strict accuracy,\n * you should use the block parser on post content.\n *\n * @since 5.0.0\n *\n * @see parse_blocks()\n *\n * @param string                  $block_name Full Block type to look for.\n * @param int|string|WP_Post|null $post Optional. Post content, post ID, or post object. Defaults to global $post.\n * @return bool Whether the post content contains the specified block.\n */\nfunction has_block( $block_name, $post = null ) {\n\tif ( ! has_blocks( $post ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! is_string( $post ) ) {\n\t\t$wp_post = get_post( $post );\n\t\tif ( $wp_post instanceof WP_Post ) {\n\t\t\t$post = $wp_post->post_content;\n\t\t}\n\t}\n\n\t/*\n\t * Normalize block name to include namespace, if provided as non-namespaced.\n\t * This matches behavior for WordPress 5.0.0 - 5.3.0 in matching blocks by\n\t * their serialized names.\n\t */\n\tif ( false === strpos( $block_name, '/' ) ) {\n\t\t$block_name = 'core/' . $block_name;\n\t}\n\n\t// Test for existence of block by its fully qualified name.\n\t$has_block = false !== strpos( $post, '<!-- wp:' . $block_name . ' ' );\n\n\tif ( ! $has_block ) {\n\t\t/*\n\t\t * If the given block name would serialize to a different name, test for\n\t\t * existence by the serialized form.\n\t\t */\n\t\t$serialized_block_name = strip_core_block_namespace( $block_name );\n\t\tif ( $serialized_block_name !== $block_name ) {\n\t\t\t$has_block = false !== strpos( $post, '<!-- wp:' . $serialized_block_name . ' ' );\n\t\t}\n\t}\n\n\treturn $has_block;\n}\n\n/**\n * Returns an array of the names of all registered dynamic block types.\n *\n * @since 5.0.0\n *\n * @return string[] Array of dynamic block names.\n */\nfunction get_dynamic_block_names() {\n\t$dynamic_block_names = array();\n\n\t$block_types = WP_Block_Type_Registry::get_instance()->get_all_registered();\n\tforeach ( $block_types as $block_type ) {\n\t\tif ( $block_type->is_dynamic() ) {\n\t\t\t$dynamic_block_names[] = $block_type->name;\n\t\t}\n\t}\n\n\treturn $dynamic_block_names;\n}\n\n/**\n * Given an array of attributes, returns a string in the serialized attributes\n * format prepared for post content.\n *\n * The serialized result is a JSON-encoded string, with unicode escape sequence\n * substitution for characters which might otherwise interfere with embedding\n * the result in an HTML comment.\n *\n * @since 5.3.1\n *\n * @param array $block_attributes Attributes object.\n * @return string Serialized attributes.\n */\nfunction serialize_block_attributes( $block_attributes ) {\n\t$encoded_attributes = json_encode( $block_attributes );\n\t$encoded_attributes = preg_replace( '/--/', '\\\\u002d\\\\u002d', $encoded_attributes );\n\t$encoded_attributes = preg_replace( '/</', '\\\\u003c', $encoded_attributes );\n\t$encoded_attributes = preg_replace( '/>/', '\\\\u003e', $encoded_attributes );\n\t$encoded_attributes = preg_replace( '/&/', '\\\\u0026', $encoded_attributes );\n\t// Regex: /\\\\\"/\n\t$encoded_attributes = preg_replace( '/\\\\\\\\\"/', '\\\\u0022', $encoded_attributes );\n\n\treturn $encoded_attributes;\n}\n\n/**\n * Returns the block name to use for serialization. This will remove the default\n * \"core/\" namespace from a block name.\n *\n * @since 5.3.1\n *\n * @param string $block_name Original block name.\n * @return string Block name to use for serialization.\n */\nfunction strip_core_block_namespace( $block_name = null ) {\n\tif ( is_string( $block_name ) && 0 === strpos( $block_name, 'core/' ) ) {\n\t\treturn substr( $block_name, 5 );\n\t}\n\n\treturn $block_name;\n}\n\n/**\n * Returns the content of a block, including comment delimiters.\n *\n * @since 5.3.1\n *\n * @param string $block_name       Block name.\n * @param array  $block_attributes Block attributes.\n * @param string $block_content    Block save content.\n * @return string Comment-delimited block content.\n */\nfunction get_comment_delimited_block_content( $block_name = null, $block_attributes, $block_content ) {\n\tif ( is_null( $block_name ) ) {\n\t\treturn $block_content;\n\t}\n\n\t$serialized_block_name = strip_core_block_namespace( $block_name );\n\t$serialized_attributes = empty( $block_attributes ) ? '' : serialize_block_attributes( $block_attributes ) . ' ';\n\n\tif ( empty( $block_content ) ) {\n\t\treturn sprintf( '<!-- wp:%s %s/-->', $serialized_block_name, $serialized_attributes );\n\t}\n\n\treturn sprintf(\n\t\t'<!-- wp:%s %s-->%s<!-- /wp:%s -->',\n\t\t$serialized_block_name,\n\t\t$serialized_attributes,\n\t\t$block_content,\n\t\t$serialized_block_name\n\t);\n}\n\n/**\n * Returns the content of a block, including comment delimiters, serializing all\n * attributes from the given parsed block.\n *\n * This should be used when preparing a block to be saved to post content.\n * Prefer `render_block` when preparing a block for display. Unlike\n * `render_block`, this does not evaluate a block's `render_callback`, and will\n * instead preserve the markup as parsed.\n *\n * @since 5.3.1\n *\n * @param WP_Block_Parser_Block $block A single parsed block object.\n * @return string String of rendered HTML.\n */\nfunction serialize_block( $block ) {\n\t$block_content = '';\n\n\t$index = 0;\n\tforeach ( $block['innerContent'] as $chunk ) {\n\t\t$block_content .= is_string( $chunk ) ? $chunk : serialize_block( $block['innerBlocks'][ $index++ ] );\n\t}\n\n\tif ( ! is_array( $block['attrs'] ) ) {\n\t\t$block['attrs'] = array();\n\t}\n\n\treturn get_comment_delimited_block_content(\n\t\t$block['blockName'],\n\t\t$block['attrs'],\n\t\t$block_content\n\t);\n}\n\n/**\n * Returns a joined string of the aggregate serialization of the given parsed\n * blocks.\n *\n * @since 5.3.1\n *\n * @param WP_Block_Parser_Block[] $blocks Parsed block objects.\n * @return string String of rendered HTML.\n */\nfunction serialize_blocks( $blocks ) {\n\treturn implode( '', array_map( 'serialize_block', $blocks ) );\n}\n\n/**\n * Filters and sanitizes block content to remove non-allowable HTML from\n * parsed block attribute values.\n *\n * @since 5.3.1\n *\n * @param string         $text              Text that may contain block content.\n * @param array[]|string $allowed_html      An array of allowed HTML elements\n *                                          and attributes, or a context name\n *                                          such as 'post'.\n * @param string[]       $allowed_protocols Array of allowed URL protocols.\n * @return string The filtered and sanitized content result.\n */\nfunction filter_block_content( $text, $allowed_html = 'post', $allowed_protocols = array() ) {\n\t$result = '';\n\n\t$blocks = parse_blocks( $text );\n\tforeach ( $blocks as $block ) {\n\t\t$block   = filter_block_kses( $block, $allowed_html, $allowed_protocols );\n\t\t$result .= serialize_block( $block );\n\t}\n\n\treturn $result;\n}\n\n/**\n * Filters and sanitizes a parsed block to remove non-allowable HTML from block\n * attribute values.\n *\n * @since 5.3.1\n *\n * @param WP_Block_Parser_Block $block             The parsed block object.\n * @param array[]|string        $allowed_html      An array of allowed HTML\n *                                                 elements and attributes, or a\n *                                                 context name such as 'post'.\n * @param string[]              $allowed_protocols Allowed URL protocols.\n * @return array The filtered and sanitized block object result.\n */\nfunction filter_block_kses( $block, $allowed_html, $allowed_protocols = array() ) {\n\t$block['attrs'] = filter_block_kses_value( $block['attrs'], $allowed_html, $allowed_protocols );\n\n\tif ( is_array( $block['innerBlocks'] ) ) {\n\t\tforeach ( $block['innerBlocks'] as $i => $inner_block ) {\n\t\t\t$block['innerBlocks'][ $i ] = filter_block_kses( $inner_block, $allowed_html, $allowed_protocols );\n\t\t}\n\t}\n\n\treturn $block;\n}\n\n/**\n * Filters and sanitizes a parsed block attribute value to remove non-allowable\n * HTML.\n *\n * @since 5.3.1\n *\n * @param string[]|string $value             The attribute value to filter.\n * @param array[]|string  $allowed_html      An array of allowed HTML elements\n *                                           and attributes, or a context name\n *                                           such as 'post'.\n * @param string[]        $allowed_protocols Array of allowed URL protocols.\n * @return string[]|string The filtered and sanitized result.\n */\nfunction filter_block_kses_value( $value, $allowed_html, $allowed_protocols = array() ) {\n\tif ( is_array( $value ) ) {\n\t\tforeach ( $value as $key => $inner_value ) {\n\t\t\t$filtered_key   = filter_block_kses_value( $key, $allowed_html, $allowed_protocols );\n\t\t\t$filtered_value = filter_block_kses_value( $inner_value, $allowed_html, $allowed_protocols );\n\n\t\t\tif ( $filtered_key !== $key ) {\n\t\t\t\tunset( $value[ $key ] );\n\t\t\t}\n\n\t\t\t$value[ $filtered_key ] = $filtered_value;\n\t\t}\n\t} elseif ( is_string( $value ) ) {\n\t\treturn wp_kses( $value, $allowed_html, $allowed_protocols );\n\t}\n\n\treturn $value;\n}\n\n/**\n * Parses blocks out of a content string, and renders those appropriate for the excerpt.\n *\n * As the excerpt should be a small string of text relevant to the full post content,\n * this function renders the blocks that are most likely to contain such text.\n *\n * @since 5.0.0\n *\n * @param string $content The content to parse.\n * @return string The parsed and filtered content.\n */\nfunction excerpt_remove_blocks( $content ) {\n\t$allowed_inner_blocks = array(\n\t\t// Classic blocks have their blockName set to null.\n\t\tnull,\n\t\t'core/freeform',\n\t\t'core/heading',\n\t\t'core/html',\n\t\t'core/list',\n\t\t'core/media-text',\n\t\t'core/paragraph',\n\t\t'core/preformatted',\n\t\t'core/pullquote',\n\t\t'core/quote',\n\t\t'core/table',\n\t\t'core/verse',\n\t);\n\n\t$allowed_blocks = array_merge( $allowed_inner_blocks, array( 'core/columns' ) );\n\n\t/**\n\t * Filters the list of blocks that can contribute to the excerpt.\n\t *\n\t * If a dynamic block is added to this list, it must not generate another\n\t * excerpt, as this will cause an infinite loop to occur.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param array $allowed_blocks The list of allowed blocks.\n\t */\n\t$allowed_blocks = apply_filters( 'excerpt_allowed_blocks', $allowed_blocks );\n\t$blocks         = parse_blocks( $content );\n\t$output         = '';\n\n\tforeach ( $blocks as $block ) {\n\t\tif ( in_array( $block['blockName'], $allowed_blocks, true ) ) {\n\t\t\tif ( ! empty( $block['innerBlocks'] ) ) {\n\t\t\t\tif ( 'core/columns' === $block['blockName'] ) {\n\t\t\t\t\t$output .= _excerpt_render_inner_columns_blocks( $block, $allowed_inner_blocks );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Skip the block if it has disallowed or nested inner blocks.\n\t\t\t\tforeach ( $block['innerBlocks'] as $inner_block ) {\n\t\t\t\t\tif (\n\t\t\t\t\t\t! in_array( $inner_block['blockName'], $allowed_inner_blocks, true ) ||\n\t\t\t\t\t\t! empty( $inner_block['innerBlocks'] )\n\t\t\t\t\t) {\n\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$output .= render_block( $block );\n\t\t}\n\t}\n\n\treturn $output;\n}\n\n/**\n * Render inner blocks from the `core/columns` block for generating an excerpt.\n *\n * @since 5.2.0\n * @access private\n *\n * @param array $columns        The parsed columns block.\n * @param array $allowed_blocks The list of allowed inner blocks.\n * @return string The rendered inner blocks.\n */\nfunction _excerpt_render_inner_columns_blocks( $columns, $allowed_blocks ) {\n\t$output = '';\n\n\tforeach ( $columns['innerBlocks'] as $column ) {\n\t\tforeach ( $column['innerBlocks'] as $inner_block ) {\n\t\t\tif ( in_array( $inner_block['blockName'], $allowed_blocks, true ) && empty( $inner_block['innerBlocks'] ) ) {\n\t\t\t\t$output .= render_block( $inner_block );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $output;\n}\n\n/**\n * Renders a single block into a HTML string.\n *\n * @since 5.0.0\n *\n * @global WP_Post  $post     The post to edit.\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param array $parsed_block A single parsed block object.\n * @return string String of rendered HTML.\n */\nfunction render_block( $parsed_block ) {\n\tglobal $post, $wp_query;\n\n\t/**\n\t * Allows render_block() to be short-circuited, by returning a non-null value.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param string|null $pre_render   The pre-rendered content. Default null.\n\t * @param array       $parsed_block The block being rendered.\n\t */\n\t$pre_render = apply_filters( 'pre_render_block', null, $parsed_block );\n\tif ( ! is_null( $pre_render ) ) {\n\t\treturn $pre_render;\n\t}\n\n\t$source_block = $parsed_block;\n\n\t/**\n\t * Filters the block being rendered in render_block(), before it's processed.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param array $parsed_block The block being rendered.\n\t * @param array $source_block An un-modified copy of $parsed_block, as it appeared in the source content.\n\t */\n\t$parsed_block = apply_filters( 'render_block_data', $parsed_block, $source_block );\n\n\t$context = array();\n\n\tif ( $post instanceof WP_Post ) {\n\t\t$context['postId'] = $post->ID;\n\n\t\t/*\n\t\t * The `postType` context is largely unnecessary server-side, since the ID\n\t\t * is usually sufficient on its own. That being said, since a block's\n\t\t * manifest is expected to be shared between the server and the client,\n\t\t * it should be included to consistently fulfill the expectation.\n\t\t */\n\t\t$context['postType'] = $post->post_type;\n\t}\n\n\tif ( $wp_query instanceof WP_Query && isset( $wp_query->tax_query->queried_terms['category'] ) ) {\n\t\t$context['query'] = array( 'categoryIds' => array() );\n\t\tforeach ( $wp_query->tax_query->queried_terms['category']['terms'] as $category_slug_or_id ) {\n\t\t\t$context['query']['categoryIds'][] = 'slug' === $wp_query->tax_query->queried_terms['category']['field'] ? get_cat_ID( $category_slug_or_id ) : $category_slug_or_id;\n\t\t}\n\t}\n\n\t/**\n\t * Filters the default context provided to a rendered block.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param array $context      Default context.\n\t * @param array $parsed_block Block being rendered, filtered by `render_block_data`.\n\t */\n\t$context = apply_filters( 'render_block_context', $context, $parsed_block );\n\n\t$block = new WP_Block( $parsed_block, $context );\n\n\treturn $block->render();\n}\n\n/**\n * Parses blocks out of a content string.\n *\n * @since 5.0.0\n *\n * @param string $content Post content.\n * @return array[] Array of parsed block objects.\n */\nfunction parse_blocks( $content ) {\n\t/**\n\t * Filter to allow plugins to replace the server-side block parser\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param string $parser_class Name of block parser class.\n\t */\n\t$parser_class = apply_filters( 'block_parser_class', 'WP_Block_Parser' );\n\n\t$parser = new $parser_class();\n\treturn $parser->parse( $content );\n}\n\n/**\n * Parses dynamic blocks out of `post_content` and re-renders them.\n *\n * @since 5.0.0\n *\n * @param string $content Post content.\n * @return string Updated post content.\n */\nfunction do_blocks( $content ) {\n\t$blocks = parse_blocks( $content );\n\t$output = '';\n\n\tforeach ( $blocks as $block ) {\n\t\t$output .= render_block( $block );\n\t}\n\n\t// If there are blocks in this content, we shouldn't run wpautop() on it later.\n\t$priority = has_filter( 'the_content', 'wpautop' );\n\tif ( false !== $priority && doing_filter( 'the_content' ) && has_blocks( $content ) ) {\n\t\tremove_filter( 'the_content', 'wpautop', $priority );\n\t\tadd_filter( 'the_content', '_restore_wpautop_hook', $priority + 1 );\n\t}\n\n\treturn $output;\n}\n\n/**\n * If do_blocks() needs to remove wpautop() from the `the_content` filter, this re-adds it afterwards,\n * for subsequent `the_content` usage.\n *\n * @access private\n *\n * @since 5.0.0\n *\n * @param string $content The post content running through this filter.\n * @return string The unmodified content.\n */\nfunction _restore_wpautop_hook( $content ) {\n\t$current_priority = has_filter( 'the_content', '_restore_wpautop_hook' );\n\n\tadd_filter( 'the_content', 'wpautop', $current_priority - 1 );\n\tremove_filter( 'the_content', '_restore_wpautop_hook', $current_priority );\n\n\treturn $content;\n}\n\n/**\n * Returns the current version of the block format that the content string is using.\n *\n * If the string doesn't contain blocks, it returns 0.\n *\n * @since 5.0.0\n *\n * @param string $content Content to test.\n * @return int The block format version is 1 if the content contains one or more blocks, 0 otherwise.\n */\nfunction block_version( $content ) {\n\treturn has_blocks( $content ) ? 1 : 0;\n}\n\n/**\n * Registers a new block style.\n *\n * @since 5.3.0\n *\n * @param string $block_name       Block type name including namespace.\n * @param array  $style_properties Array containing the properties of the style name,\n *                                 label, style (name of the stylesheet to be enqueued),\n *                                 inline_style (string containing the CSS to be added).\n * @return boolean True if the block style was registered with success and false otherwise.\n */\nfunction register_block_style( $block_name, $style_properties ) {\n\treturn WP_Block_Styles_Registry::get_instance()->register( $block_name, $style_properties );\n}\n\n/**\n * Unregisters a block style.\n *\n * @since 5.3.0\n *\n * @param string $block_name       Block type name including namespace.\n * @param array  $block_style_name Block style name.\n * @return boolean True if the block style was unregistered with success and false otherwise.\n */\nfunction unregister_block_style( $block_name, $block_style_name ) {\n\treturn WP_Block_Styles_Registry::get_instance()->unregister( $block_name, $block_style_name );\n}\n", "num_lines": 832}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Bookmark Template Functions for usage in Themes\n *\n * @package WordPress\n * @subpackage Template\n */\n\n/**\n * The formatted output of a list of bookmarks.\n *\n * The $bookmarks array must contain bookmark objects and will be iterated over\n * to retrieve the bookmark to be used in the output.\n *\n * The output is formatted as HTML with no way to change that format. However,\n * what is between, before, and after can be changed. The link itself will be\n * HTML.\n *\n * This function is used internally by wp_list_bookmarks() and should not be\n * used by themes.\n *\n * @since 2.1.0\n * @access private\n *\n * @param array        $bookmarks List of bookmarks to traverse.\n * @param string|array $args {\n *     Optional. Bookmarks arguments.\n *\n *     @type int|bool $show_updated     Whether to show the time the bookmark was last updated.\n *                                      Accepts 1|true or 0|false. Default 0|false.\n *     @type int|bool $show_description Whether to show the bookmark description. Accepts 1|true,\n *                                      Accepts 1|true or 0|false. Default 0|false.\n *     @type int|bool $show_images      Whether to show the link image if available. Accepts 1|true\n *                                      or 0|false. Default 1|true.\n *     @type int|bool $show_name        Whether to show link name if available. Accepts 1|true or\n *                                      0|false. Default 0|false.\n *     @type string   $before           The HTML or text to prepend to each bookmark. Default `<li>`.\n *     @type string   $after            The HTML or text to append to each bookmark. Default `</li>`.\n *     @type string   $link_before      The HTML or text to prepend to each bookmark inside the anchor\n *                                      tags. Default empty.\n *     @type string   $link_after       The HTML or text to append to each bookmark inside the anchor\n *                                      tags. Default empty.\n *     @type string   $between          The string for use in between the link, description, and image.\n *                                      Default \"\\n\".\n *     @type int|bool $show_rating      Whether to show the link rating. Accepts 1|true or 0|false.\n *                                      Default 0|false.\n *\n * }\n * @return string Formatted output in HTML\n */\nfunction _walk_bookmarks( $bookmarks, $args = '' ) {\n\t$defaults = array(\n\t\t'show_updated'     => 0,\n\t\t'show_description' => 0,\n\t\t'show_images'      => 1,\n\t\t'show_name'        => 0,\n\t\t'before'           => '<li>',\n\t\t'after'            => '</li>',\n\t\t'between'          => \"\\n\",\n\t\t'show_rating'      => 0,\n\t\t'link_before'      => '',\n\t\t'link_after'       => '',\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t$output = ''; // Blank string to start with.\n\n\tforeach ( (array) $bookmarks as $bookmark ) {\n\t\tif ( ! isset( $bookmark->recently_updated ) ) {\n\t\t\t$bookmark->recently_updated = false;\n\t\t}\n\t\t$output .= $parsed_args['before'];\n\t\tif ( $parsed_args['show_updated'] && $bookmark->recently_updated ) {\n\t\t\t$output .= '<em>';\n\t\t}\n\t\t$the_link = '#';\n\t\tif ( ! empty( $bookmark->link_url ) ) {\n\t\t\t$the_link = esc_url( $bookmark->link_url );\n\t\t}\n\t\t$desc  = esc_attr( sanitize_bookmark_field( 'link_description', $bookmark->link_description, $bookmark->link_id, 'display' ) );\n\t\t$name  = esc_attr( sanitize_bookmark_field( 'link_name', $bookmark->link_name, $bookmark->link_id, 'display' ) );\n\t\t$title = $desc;\n\n\t\tif ( $parsed_args['show_updated'] ) {\n\t\t\tif ( '00' !== substr( $bookmark->link_updated_f, 0, 2 ) ) {\n\t\t\t\t$title .= ' (';\n\t\t\t\t$title .= sprintf(\n\t\t\t\t\t/* translators: %s: Date and time of last update. */\n\t\t\t\t\t__( 'Last updated: %s' ),\n\t\t\t\t\tgmdate(\n\t\t\t\t\t\tget_option( 'links_updated_date_format' ),\n\t\t\t\t\t\t$bookmark->link_updated_f + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$title .= ')';\n\t\t\t}\n\t\t}\n\t\t$alt = ' alt=\"' . $name . ( $parsed_args['show_description'] ? ' ' . $title : '' ) . '\"';\n\n\t\tif ( '' !== $title ) {\n\t\t\t$title = ' title=\"' . $title . '\"';\n\t\t}\n\t\t$rel = $bookmark->link_rel;\n\t\tif ( '' !== $rel ) {\n\t\t\t$rel = ' rel=\"' . esc_attr( $rel ) . '\"';\n\t\t}\n\t\t$target = $bookmark->link_target;\n\t\tif ( '' !== $target ) {\n\t\t\t$target = ' target=\"' . $target . '\"';\n\t\t}\n\t\t$output .= '<a href=\"' . $the_link . '\"' . $rel . $title . $target . '>';\n\n\t\t$output .= $parsed_args['link_before'];\n\n\t\tif ( null != $bookmark->link_image && $parsed_args['show_images'] ) {\n\t\t\tif ( strpos( $bookmark->link_image, 'http' ) === 0 ) {\n\t\t\t\t$output .= \"<img src=\\\"$bookmark->link_image\\\" $alt $title />\";\n\t\t\t} else { // If it's a relative path.\n\t\t\t\t$output .= '<img src=\"' . get_option( 'siteurl' ) . \"$bookmark->link_image\\\" $alt $title />\";\n\t\t\t}\n\t\t\tif ( $parsed_args['show_name'] ) {\n\t\t\t\t$output .= \" $name\";\n\t\t\t}\n\t\t} else {\n\t\t\t$output .= $name;\n\t\t}\n\n\t\t$output .= $parsed_args['link_after'];\n\n\t\t$output .= '</a>';\n\n\t\tif ( $parsed_args['show_updated'] && $bookmark->recently_updated ) {\n\t\t\t$output .= '</em>';\n\t\t}\n\n\t\tif ( $parsed_args['show_description'] && '' !== $desc ) {\n\t\t\t$output .= $parsed_args['between'] . $desc;\n\t\t}\n\n\t\tif ( $parsed_args['show_rating'] ) {\n\t\t\t$output .= $parsed_args['between'] . sanitize_bookmark_field(\n\t\t\t\t'link_rating',\n\t\t\t\t$bookmark->link_rating,\n\t\t\t\t$bookmark->link_id,\n\t\t\t\t'display'\n\t\t\t);\n\t\t}\n\t\t$output .= $parsed_args['after'] . \"\\n\";\n\t} // End while.\n\n\treturn $output;\n}\n\n/**\n * Retrieve or echo all of the bookmarks.\n *\n * List of default arguments are as follows:\n *\n * These options define how the Category name will appear before the category\n * links are displayed, if 'categorize' is 1. If 'categorize' is 0, then it will\n * display for only the 'title_li' string and only if 'title_li' is not empty.\n *\n * @since 2.1.0\n *\n * @see _walk_bookmarks()\n *\n * @param string|array $args {\n *     Optional. String or array of arguments to list bookmarks.\n *\n *     @type string   $orderby          How to order the links by. Accepts post fields. Default 'name'.\n *     @type string   $order            Whether to order bookmarks in ascending or descending order.\n *                                      Accepts 'ASC' (ascending) or 'DESC' (descending). Default 'ASC'.\n *     @type int      $limit            Amount of bookmarks to display. Accepts 1+ or -1 for all.\n *                                      Default -1.\n *     @type string   $category         Comma-separated list of category IDs to include links from.\n *                                      Default empty.\n *     @type string   $category_name    Category to retrieve links for by name. Default empty.\n *     @type int|bool $hide_invisible   Whether to show or hide links marked as 'invisible'. Accepts\n *                                      1|true or 0|false. Default 1|true.\n *     @type int|bool $show_updated     Whether to display the time the bookmark was last updated.\n *                                      Accepts 1|true or 0|false. Default 0|false.\n *     @type int|bool $echo             Whether to echo or return the formatted bookmarks. Accepts\n *                                      1|true (echo) or 0|false (return). Default 1|true.\n *     @type int|bool $categorize       Whether to show links listed by category or in a single column.\n *                                      Accepts 1|true (by category) or 0|false (one column). Default 1|true.\n *     @type int|bool $show_description Whether to show the bookmark descriptions. Accepts 1|true or 0|false.\n *                                      Default 0|false.\n *     @type string   $title_li         What to show before the links appear. Default 'Bookmarks'.\n *     @type string   $title_before     The HTML or text to prepend to the $title_li string. Default '<h2>'.\n *     @type string   $title_after      The HTML or text to append to the $title_li string. Default '</h2>'.\n *     @type string   $class            The CSS class to use for the $title_li. Default 'linkcat'.\n *     @type string   $category_before  The HTML or text to prepend to $title_before if $categorize is true.\n *                                      String must contain '%id' and '%class' to inherit the category ID and\n *                                      the $class argument used for formatting in themes.\n *                                      Default '<li id=\"%id\" class=\"%class\">'.\n *     @type string   $category_after   The HTML or text to append to $title_after if $categorize is true.\n *                                      Default '</li>'.\n *     @type string   $category_orderby How to order the bookmark category based on term scheme if $categorize\n *                                      is true. Default 'name'.\n *     @type string   $category_order   Whether to order categories in ascending or descending order if\n *                                      $categorize is true. Accepts 'ASC' (ascending) or 'DESC' (descending).\n *                                      Default 'ASC'.\n * }\n * @return void|string Void if 'echo' argument is true, HTML list of bookmarks if 'echo' is false.\n */\nfunction wp_list_bookmarks( $args = '' ) {\n\t$defaults = array(\n\t\t'orderby'          => 'name',\n\t\t'order'            => 'ASC',\n\t\t'limit'            => -1,\n\t\t'category'         => '',\n\t\t'exclude_category' => '',\n\t\t'category_name'    => '',\n\t\t'hide_invisible'   => 1,\n\t\t'show_updated'     => 0,\n\t\t'echo'             => 1,\n\t\t'categorize'       => 1,\n\t\t'title_li'         => __( 'Bookmarks' ),\n\t\t'title_before'     => '<h2>',\n\t\t'title_after'      => '</h2>',\n\t\t'category_orderby' => 'name',\n\t\t'category_order'   => 'ASC',\n\t\t'class'            => 'linkcat',\n\t\t'category_before'  => '<li id=\"%id\" class=\"%class\">',\n\t\t'category_after'   => '</li>',\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t$output = '';\n\n\tif ( ! is_array( $parsed_args['class'] ) ) {\n\t\t$parsed_args['class'] = explode( ' ', $parsed_args['class'] );\n\t}\n\t$parsed_args['class'] = array_map( 'sanitize_html_class', $parsed_args['class'] );\n\t$parsed_args['class'] = trim( join( ' ', $parsed_args['class'] ) );\n\n\tif ( $parsed_args['categorize'] ) {\n\t\t$cats = get_terms(\n\t\t\tarray(\n\t\t\t\t'taxonomy'     => 'link_category',\n\t\t\t\t'name__like'   => $parsed_args['category_name'],\n\t\t\t\t'include'      => $parsed_args['category'],\n\t\t\t\t'exclude'      => $parsed_args['exclude_category'],\n\t\t\t\t'orderby'      => $parsed_args['category_orderby'],\n\t\t\t\t'order'        => $parsed_args['category_order'],\n\t\t\t\t'hierarchical' => 0,\n\t\t\t)\n\t\t);\n\t\tif ( empty( $cats ) ) {\n\t\t\t$parsed_args['categorize'] = false;\n\t\t}\n\t}\n\n\tif ( $parsed_args['categorize'] ) {\n\t\t// Split the bookmarks into ul's for each category.\n\t\tforeach ( (array) $cats as $cat ) {\n\t\t\t$params    = array_merge( $parsed_args, array( 'category' => $cat->term_id ) );\n\t\t\t$bookmarks = get_bookmarks( $params );\n\t\t\tif ( empty( $bookmarks ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$output .= str_replace(\n\t\t\t\tarray( '%id', '%class' ),\n\t\t\t\tarray( \"linkcat-$cat->term_id\", $parsed_args['class'] ),\n\t\t\t\t$parsed_args['category_before']\n\t\t\t);\n\t\t\t/**\n\t\t\t * Filters the category name.\n\t\t\t *\n\t\t\t * @since 2.2.0\n\t\t\t *\n\t\t\t * @param string $cat_name The category name.\n\t\t\t */\n\t\t\t$catname = apply_filters( 'link_category', $cat->name );\n\n\t\t\t$output .= $parsed_args['title_before'];\n\t\t\t$output .= $catname;\n\t\t\t$output .= $parsed_args['title_after'];\n\t\t\t$output .= \"\\n\\t<ul class='xoxo blogroll'>\\n\";\n\t\t\t$output .= _walk_bookmarks( $bookmarks, $parsed_args );\n\t\t\t$output .= \"\\n\\t</ul>\\n\";\n\t\t\t$output .= $parsed_args['category_after'] . \"\\n\";\n\t\t}\n\t} else {\n\t\t// Output one single list using title_li for the title.\n\t\t$bookmarks = get_bookmarks( $parsed_args );\n\n\t\tif ( ! empty( $bookmarks ) ) {\n\t\t\tif ( ! empty( $parsed_args['title_li'] ) ) {\n\t\t\t\t$output .= str_replace(\n\t\t\t\t\tarray( '%id', '%class' ),\n\t\t\t\t\tarray( 'linkcat-' . $parsed_args['category'], $parsed_args['class'] ),\n\t\t\t\t\t$parsed_args['category_before']\n\t\t\t\t);\n\t\t\t\t$output .= $parsed_args['title_before'];\n\t\t\t\t$output .= $parsed_args['title_li'];\n\t\t\t\t$output .= $parsed_args['title_after'];\n\t\t\t\t$output .= \"\\n\\t<ul class='xoxo blogroll'>\\n\";\n\t\t\t\t$output .= _walk_bookmarks( $bookmarks, $parsed_args );\n\t\t\t\t$output .= \"\\n\\t</ul>\\n\";\n\t\t\t\t$output .= $parsed_args['category_after'] . \"\\n\";\n\t\t\t} else {\n\t\t\t\t$output .= _walk_bookmarks( $bookmarks, $parsed_args );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filters the bookmarks list before it is echoed or returned.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $html The HTML list of bookmarks.\n\t */\n\t$html = apply_filters( 'wp_list_bookmarks', $output );\n\n\tif ( $parsed_args['echo'] ) {\n\t\techo $html;\n\t} else {\n\t\treturn $html;\n\t}\n}\n", "num_lines": 325}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Link/Bookmark API\n *\n * @package WordPress\n * @subpackage Bookmark\n */\n\n/**\n * Retrieve Bookmark data\n *\n * @since 2.1.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int|stdClass $bookmark\n * @param string       $output   Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which\n *                               correspond to an stdClass object, an associative array, or a numeric array,\n *                               respectively. Default OBJECT.\n * @param string       $filter   Optional. How to sanitize bookmark fields. Default 'raw'.\n * @return array|object|null Type returned depends on $output value.\n */\nfunction get_bookmark( $bookmark, $output = OBJECT, $filter = 'raw' ) {\n\tglobal $wpdb;\n\n\tif ( empty( $bookmark ) ) {\n\t\tif ( isset( $GLOBALS['link'] ) ) {\n\t\t\t$_bookmark = & $GLOBALS['link'];\n\t\t} else {\n\t\t\t$_bookmark = null;\n\t\t}\n\t} elseif ( is_object( $bookmark ) ) {\n\t\twp_cache_add( $bookmark->link_id, $bookmark, 'bookmark' );\n\t\t$_bookmark = $bookmark;\n\t} else {\n\t\tif ( isset( $GLOBALS['link'] ) && ( $GLOBALS['link']->link_id == $bookmark ) ) {\n\t\t\t$_bookmark = & $GLOBALS['link'];\n\t\t} else {\n\t\t\t$_bookmark = wp_cache_get( $bookmark, 'bookmark' );\n\t\t\tif ( ! $_bookmark ) {\n\t\t\t\t$_bookmark = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $wpdb->links WHERE link_id = %d LIMIT 1\", $bookmark ) );\n\t\t\t\tif ( $_bookmark ) {\n\t\t\t\t\t$_bookmark->link_category = array_unique( wp_get_object_terms( $_bookmark->link_id, 'link_category', array( 'fields' => 'ids' ) ) );\n\t\t\t\t\twp_cache_add( $_bookmark->link_id, $_bookmark, 'bookmark' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! $_bookmark ) {\n\t\treturn $_bookmark;\n\t}\n\n\t$_bookmark = sanitize_bookmark( $_bookmark, $filter );\n\n\tif ( OBJECT == $output ) {\n\t\treturn $_bookmark;\n\t} elseif ( ARRAY_A == $output ) {\n\t\treturn get_object_vars( $_bookmark );\n\t} elseif ( ARRAY_N == $output ) {\n\t\treturn array_values( get_object_vars( $_bookmark ) );\n\t} else {\n\t\treturn $_bookmark;\n\t}\n}\n\n/**\n * Retrieve single bookmark data item or field.\n *\n * @since 2.3.0\n *\n * @param string $field    The name of the data field to return.\n * @param int    $bookmark The bookmark ID to get field.\n * @param string $context  Optional. The context of how the field will be used.\n * @return string|WP_Error\n */\nfunction get_bookmark_field( $field, $bookmark, $context = 'display' ) {\n\t$bookmark = (int) $bookmark;\n\t$bookmark = get_bookmark( $bookmark );\n\n\tif ( is_wp_error( $bookmark ) ) {\n\t\treturn $bookmark;\n\t}\n\n\tif ( ! is_object( $bookmark ) ) {\n\t\treturn '';\n\t}\n\n\tif ( ! isset( $bookmark->$field ) ) {\n\t\treturn '';\n\t}\n\n\treturn sanitize_bookmark_field( $field, $bookmark->$field, $bookmark->link_id, $context );\n}\n\n/**\n * Retrieves the list of bookmarks\n *\n * Attempts to retrieve from the cache first based on MD5 hash of arguments. If\n * that fails, then the query will be built from the arguments and executed. The\n * results will be stored to the cache.\n *\n * @since 2.1.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string|array $args {\n *     Optional. String or array of arguments to retrieve bookmarks.\n *\n *     @type string   $orderby        How to order the links by. Accepts 'id', 'link_id', 'name', 'link_name',\n *                                    'url', 'link_url', 'visible', 'link_visible', 'rating', 'link_rating',\n *                                    'owner', 'link_owner', 'updated', 'link_updated', 'notes', 'link_notes',\n *                                    'description', 'link_description', 'length' and 'rand'.\n *                                    When `$orderby` is 'length', orders by the character length of\n *                                    'link_name'. Default 'name'.\n *     @type string   $order          Whether to order bookmarks in ascending or descending order.\n *                                    Accepts 'ASC' (ascending) or 'DESC' (descending). Default 'ASC'.\n *     @type int      $limit          Amount of bookmarks to display. Accepts any positive number or\n *                                    -1 for all.  Default -1.\n *     @type string   $category       Comma-separated list of category IDs to include links from.\n *                                    Default empty.\n *     @type string   $category_name  Category to retrieve links for by name. Default empty.\n *     @type int|bool $hide_invisible Whether to show or hide links marked as 'invisible'. Accepts\n *                                    1|true or 0|false. Default 1|true.\n *     @type int|bool $show_updated   Whether to display the time the bookmark was last updated.\n *                                    Accepts 1|true or 0|false. Default 0|false.\n *     @type string   $include        Comma-separated list of bookmark IDs to include. Default empty.\n *     @type string   $exclude        Comma-separated list of bookmark IDs to exclude. Default empty.\n *     @type string   $search         Search terms. Will be SQL-formatted with wildcards before and after\n *                                    and searched in 'link_url', 'link_name' and 'link_description'.\n *                                    Default empty.\n * }\n * @return object[] List of bookmark row objects.\n */\nfunction get_bookmarks( $args = '' ) {\n\tglobal $wpdb;\n\n\t$defaults = array(\n\t\t'orderby'        => 'name',\n\t\t'order'          => 'ASC',\n\t\t'limit'          => -1,\n\t\t'category'       => '',\n\t\t'category_name'  => '',\n\t\t'hide_invisible' => 1,\n\t\t'show_updated'   => 0,\n\t\t'include'        => '',\n\t\t'exclude'        => '',\n\t\t'search'         => '',\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t$key   = md5( serialize( $parsed_args ) );\n\t$cache = wp_cache_get( 'get_bookmarks', 'bookmark' );\n\n\tif ( 'rand' !== $parsed_args['orderby'] && $cache ) {\n\t\tif ( is_array( $cache ) && isset( $cache[ $key ] ) ) {\n\t\t\t$bookmarks = $cache[ $key ];\n\t\t\t/**\n\t\t\t * Filters the returned list of bookmarks.\n\t\t\t *\n\t\t\t * The first time the hook is evaluated in this file, it returns the cached\n\t\t\t * bookmarks list. The second evaluation returns a cached bookmarks list if the\n\t\t\t * link category is passed but does not exist. The third evaluation returns\n\t\t\t * the full cached results.\n\t\t\t *\n\t\t\t * @since 2.1.0\n\t\t\t *\n\t\t\t * @see get_bookmarks()\n\t\t\t *\n\t\t\t * @param array $bookmarks   List of the cached bookmarks.\n\t\t\t * @param array $parsed_args An array of bookmark query arguments.\n\t\t\t */\n\t\t\treturn apply_filters( 'get_bookmarks', $bookmarks, $parsed_args );\n\t\t}\n\t}\n\n\tif ( ! is_array( $cache ) ) {\n\t\t$cache = array();\n\t}\n\n\t$inclusions = '';\n\tif ( ! empty( $parsed_args['include'] ) ) {\n\t\t$parsed_args['exclude']       = '';  // Ignore exclude, category, and category_name params if using include.\n\t\t$parsed_args['category']      = '';\n\t\t$parsed_args['category_name'] = '';\n\n\t\t$inclinks = wp_parse_id_list( $parsed_args['include'] );\n\t\tif ( count( $inclinks ) ) {\n\t\t\tforeach ( $inclinks as $inclink ) {\n\t\t\t\tif ( empty( $inclusions ) ) {\n\t\t\t\t\t$inclusions = ' AND ( link_id = ' . $inclink . ' ';\n\t\t\t\t} else {\n\t\t\t\t\t$inclusions .= ' OR link_id = ' . $inclink . ' ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif ( ! empty( $inclusions ) ) {\n\t\t$inclusions .= ')';\n\t}\n\n\t$exclusions = '';\n\tif ( ! empty( $parsed_args['exclude'] ) ) {\n\t\t$exlinks = wp_parse_id_list( $parsed_args['exclude'] );\n\t\tif ( count( $exlinks ) ) {\n\t\t\tforeach ( $exlinks as $exlink ) {\n\t\t\t\tif ( empty( $exclusions ) ) {\n\t\t\t\t\t$exclusions = ' AND ( link_id <> ' . $exlink . ' ';\n\t\t\t\t} else {\n\t\t\t\t\t$exclusions .= ' AND link_id <> ' . $exlink . ' ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif ( ! empty( $exclusions ) ) {\n\t\t$exclusions .= ')';\n\t}\n\n\tif ( ! empty( $parsed_args['category_name'] ) ) {\n\t\t$parsed_args['category'] = get_term_by( 'name', $parsed_args['category_name'], 'link_category' );\n\t\tif ( $parsed_args['category'] ) {\n\t\t\t$parsed_args['category'] = $parsed_args['category']->term_id;\n\t\t} else {\n\t\t\t$cache[ $key ] = array();\n\t\t\twp_cache_set( 'get_bookmarks', $cache, 'bookmark' );\n\t\t\t/** This filter is documented in wp-includes/bookmark.php */\n\t\t\treturn apply_filters( 'get_bookmarks', array(), $parsed_args );\n\t\t}\n\t}\n\n\t$search = '';\n\tif ( ! empty( $parsed_args['search'] ) ) {\n\t\t$like   = '%' . $wpdb->esc_like( $parsed_args['search'] ) . '%';\n\t\t$search = $wpdb->prepare( ' AND ( (link_url LIKE %s) OR (link_name LIKE %s) OR (link_description LIKE %s) ) ', $like, $like, $like );\n\t}\n\n\t$category_query = '';\n\t$join           = '';\n\tif ( ! empty( $parsed_args['category'] ) ) {\n\t\t$incategories = wp_parse_id_list( $parsed_args['category'] );\n\t\tif ( count( $incategories ) ) {\n\t\t\tforeach ( $incategories as $incat ) {\n\t\t\t\tif ( empty( $category_query ) ) {\n\t\t\t\t\t$category_query = ' AND ( tt.term_id = ' . $incat . ' ';\n\t\t\t\t} else {\n\t\t\t\t\t$category_query .= ' OR tt.term_id = ' . $incat . ' ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif ( ! empty( $category_query ) ) {\n\t\t$category_query .= \") AND taxonomy = 'link_category'\";\n\t\t$join            = \" INNER JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id\";\n\t}\n\n\tif ( $parsed_args['show_updated'] ) {\n\t\t$recently_updated_test = ', IF (DATE_ADD(link_updated, INTERVAL 120 MINUTE) >= NOW(), 1,0) as recently_updated ';\n\t} else {\n\t\t$recently_updated_test = '';\n\t}\n\n\t$get_updated = ( $parsed_args['show_updated'] ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : '';\n\n\t$orderby = strtolower( $parsed_args['orderby'] );\n\t$length  = '';\n\tswitch ( $orderby ) {\n\t\tcase 'length':\n\t\t\t$length = ', CHAR_LENGTH(link_name) AS length';\n\t\t\tbreak;\n\t\tcase 'rand':\n\t\t\t$orderby = 'rand()';\n\t\t\tbreak;\n\t\tcase 'link_id':\n\t\t\t$orderby = \"$wpdb->links.link_id\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$orderparams = array();\n\t\t\t$keys        = array( 'link_id', 'link_name', 'link_url', 'link_visible', 'link_rating', 'link_owner', 'link_updated', 'link_notes', 'link_description' );\n\t\t\tforeach ( explode( ',', $orderby ) as $ordparam ) {\n\t\t\t\t$ordparam = trim( $ordparam );\n\n\t\t\t\tif ( in_array( 'link_' . $ordparam, $keys, true ) ) {\n\t\t\t\t\t$orderparams[] = 'link_' . $ordparam;\n\t\t\t\t} elseif ( in_array( $ordparam, $keys, true ) ) {\n\t\t\t\t\t$orderparams[] = $ordparam;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$orderby = implode( ',', $orderparams );\n\t}\n\n\tif ( empty( $orderby ) ) {\n\t\t$orderby = 'link_name';\n\t}\n\n\t$order = strtoupper( $parsed_args['order'] );\n\tif ( '' !== $order && ! in_array( $order, array( 'ASC', 'DESC' ), true ) ) {\n\t\t$order = 'ASC';\n\t}\n\n\t$visible = '';\n\tif ( $parsed_args['hide_invisible'] ) {\n\t\t$visible = \"AND link_visible = 'Y'\";\n\t}\n\n\t$query  = \"SELECT * $length $recently_updated_test $get_updated FROM $wpdb->links $join WHERE 1=1 $visible $category_query\";\n\t$query .= \" $exclusions $inclusions $search\";\n\t$query .= \" ORDER BY $orderby $order\";\n\tif ( -1 != $parsed_args['limit'] ) {\n\t\t$query .= ' LIMIT ' . $parsed_args['limit'];\n\t}\n\n\t$results = $wpdb->get_results( $query );\n\n\tif ( 'rand()' !== $orderby ) {\n\t\t$cache[ $key ] = $results;\n\t\twp_cache_set( 'get_bookmarks', $cache, 'bookmark' );\n\t}\n\n\t/** This filter is documented in wp-includes/bookmark.php */\n\treturn apply_filters( 'get_bookmarks', $results, $parsed_args );\n}\n\n/**\n * Sanitizes all bookmark fields.\n *\n * @since 2.3.0\n *\n * @param stdClass|array $bookmark Bookmark row.\n * @param string         $context  Optional. How to filter the fields. Default 'display'.\n * @return stdClass|array Same type as $bookmark but with fields sanitized.\n */\nfunction sanitize_bookmark( $bookmark, $context = 'display' ) {\n\t$fields = array(\n\t\t'link_id',\n\t\t'link_url',\n\t\t'link_name',\n\t\t'link_image',\n\t\t'link_target',\n\t\t'link_category',\n\t\t'link_description',\n\t\t'link_visible',\n\t\t'link_owner',\n\t\t'link_rating',\n\t\t'link_updated',\n\t\t'link_rel',\n\t\t'link_notes',\n\t\t'link_rss',\n\t);\n\n\tif ( is_object( $bookmark ) ) {\n\t\t$do_object = true;\n\t\t$link_id   = $bookmark->link_id;\n\t} else {\n\t\t$do_object = false;\n\t\t$link_id   = $bookmark['link_id'];\n\t}\n\n\tforeach ( $fields as $field ) {\n\t\tif ( $do_object ) {\n\t\t\tif ( isset( $bookmark->$field ) ) {\n\t\t\t\t$bookmark->$field = sanitize_bookmark_field( $field, $bookmark->$field, $link_id, $context );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( isset( $bookmark[ $field ] ) ) {\n\t\t\t\t$bookmark[ $field ] = sanitize_bookmark_field( $field, $bookmark[ $field ], $link_id, $context );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $bookmark;\n}\n\n/**\n * Sanitizes a bookmark field.\n *\n * Sanitizes the bookmark fields based on what the field name is. If the field\n * has a strict value set, then it will be tested for that, else a more generic\n * filtering is applied. After the more strict filter is applied, if the `$context`\n * is 'raw' then the value is immediately return.\n *\n * Hooks exist for the more generic cases. With the 'edit' context, the {@see 'edit_$field'}\n * filter will be called and passed the `$value` and `$bookmark_id` respectively.\n *\n * With the 'db' context, the {@see 'pre_$field'} filter is called and passed the value.\n * The 'display' context is the final context and has the `$field` has the filter name\n * and is passed the `$value`, `$bookmark_id`, and `$context`, respectively.\n *\n * @since 2.3.0\n *\n * @param string $field       The bookmark field.\n * @param mixed  $value       The bookmark field value.\n * @param int    $bookmark_id Bookmark ID.\n * @param string $context     How to filter the field value. Accepts 'raw', 'edit', 'attribute',\n *                            'js', 'db', or 'display'\n * @return mixed The filtered value.\n */\nfunction sanitize_bookmark_field( $field, $value, $bookmark_id, $context ) {\n\tswitch ( $field ) {\n\t\tcase 'link_id': // ints\n\t\tcase 'link_rating':\n\t\t\t$value = (int) $value;\n\t\t\tbreak;\n\t\tcase 'link_category': // array( ints )\n\t\t\t$value = array_map( 'absint', (array) $value );\n\t\t\t// We return here so that the categories aren't filtered.\n\t\t\t// The 'link_category' filter is for the name of a link category, not an array of a link's link categories.\n\t\t\treturn $value;\n\n\t\tcase 'link_visible': // bool stored as Y|N\n\t\t\t$value = preg_replace( '/[^YNyn]/', '', $value );\n\t\t\tbreak;\n\t\tcase 'link_target': // \"enum\"\n\t\t\t$targets = array( '_top', '_blank' );\n\t\t\tif ( ! in_array( $value, $targets, true ) ) {\n\t\t\t\t$value = '';\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\tif ( 'raw' === $context ) {\n\t\treturn $value;\n\t}\n\n\tif ( 'edit' === $context ) {\n\t\t/** This filter is documented in wp-includes/post.php */\n\t\t$value = apply_filters( \"edit_{$field}\", $value, $bookmark_id );\n\n\t\tif ( 'link_notes' === $field ) {\n\t\t\t$value = esc_html( $value ); // textarea_escaped\n\t\t} else {\n\t\t\t$value = esc_attr( $value );\n\t\t}\n\t} elseif ( 'db' === $context ) {\n\t\t/** This filter is documented in wp-includes/post.php */\n\t\t$value = apply_filters( \"pre_{$field}\", $value );\n\t} else {\n\t\t/** This filter is documented in wp-includes/post.php */\n\t\t$value = apply_filters( \"{$field}\", $value, $bookmark_id, $context );\n\n\t\tif ( 'attribute' === $context ) {\n\t\t\t$value = esc_attr( $value );\n\t\t} elseif ( 'js' === $context ) {\n\t\t\t$value = esc_js( $value );\n\t\t}\n\t}\n\n\treturn $value;\n}\n\n/**\n * Deletes the bookmark cache.\n *\n * @since 2.7.0\n *\n * @param int $bookmark_id Bookmark ID.\n */\nfunction clean_bookmark_cache( $bookmark_id ) {\n\twp_cache_delete( $bookmark_id, 'bookmark' );\n\twp_cache_delete( 'get_bookmarks', 'bookmark' );\n\tclean_object_term_cache( $bookmark_id, 'link' );\n}\n", "num_lines": 463}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Object Cache API functions missing from 3rd party object caches.\n *\n * @link https://codex.wordpress.org/Class_Reference/WP_Object_Cache\n *\n * @package WordPress\n * @subpackage Cache\n */\n\nif ( ! function_exists( 'wp_cache_get_multiple' ) ) :\n\t/**\n\t * Retrieves multiple values from the cache in one call.\n\t *\n\t * Compat function to mimic wp_cache_get_multiple().\n\t *\n\t * @ignore\n\t * @since 5.5.0\n\t *\n\t * @see wp_cache_get_multiple()\n\t *\n\t * @param array  $keys  Array of keys under which the cache contents are stored.\n\t * @param string $group Optional. Where the cache contents are grouped. Default empty.\n\t * @param bool   $force Optional. Whether to force an update of the local cache\n\t *                      from the persistent cache. Default false.\n\t * @return array Array of values organized into groups.\n\t */\n\tfunction wp_cache_get_multiple( $keys, $group = '', $force = false ) {\n\t\t$values = array();\n\n\t\tforeach ( $keys as $key ) {\n\t\t\t$values[ $key ] = wp_cache_get( $key, $group, $force );\n\t\t}\n\n\t\treturn $values;\n\t}\nendif;\n", "num_lines": 38}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Object Cache API\n *\n * @link https://codex.wordpress.org/Class_Reference/WP_Object_Cache\n *\n * @package WordPress\n * @subpackage Cache\n */\n\n/** WP_Object_Cache class */\nrequire_once ABSPATH . WPINC . '/class-wp-object-cache.php';\n\n/**\n * Adds data to the cache, if the cache key doesn't already exist.\n *\n * @since 2.0.0\n *\n * @see WP_Object_Cache::add()\n * @global WP_Object_Cache $wp_object_cache Object cache global instance.\n *\n * @param int|string $key    The cache key to use for retrieval later.\n * @param mixed      $data   The data to add to the cache.\n * @param string     $group  Optional. The group to add the cache to. Enables the same key\n *                           to be used across groups. Default empty.\n * @param int        $expire Optional. When the cache data should expire, in seconds.\n *                           Default 0 (no expiration).\n * @return bool True on success, false if cache key and group already exist.\n */\nfunction wp_cache_add( $key, $data, $group = '', $expire = 0 ) {\n\tglobal $wp_object_cache;\n\n\treturn $wp_object_cache->add( $key, $data, $group, (int) $expire );\n}\n\n/**\n * Closes the cache.\n *\n * This function has ceased to do anything since WordPress 2.5. The\n * functionality was removed along with the rest of the persistent cache.\n *\n * This does not mean that plugins can't implement this function when they need\n * to make sure that the cache is cleaned up after WordPress no longer needs it.\n *\n * @since 2.0.0\n *\n * @return true Always returns true.\n */\nfunction wp_cache_close() {\n\treturn true;\n}\n\n/**\n * Decrements numeric cache item's value.\n *\n * @since 3.3.0\n *\n * @see WP_Object_Cache::decr()\n * @global WP_Object_Cache $wp_object_cache Object cache global instance.\n *\n * @param int|string $key    The cache key to decrement.\n * @param int        $offset Optional. The amount by which to decrement the item's value. Default 1.\n * @param string     $group  Optional. The group the key is in. Default empty.\n * @return int|false The item's new value on success, false on failure.\n */\nfunction wp_cache_decr( $key, $offset = 1, $group = '' ) {\n\tglobal $wp_object_cache;\n\n\treturn $wp_object_cache->decr( $key, $offset, $group );\n}\n\n/**\n * Removes the cache contents matching key and group.\n *\n * @since 2.0.0\n *\n * @see WP_Object_Cache::delete()\n * @global WP_Object_Cache $wp_object_cache Object cache global instance.\n *\n * @param int|string $key   What the contents in the cache are called.\n * @param string     $group Optional. Where the cache contents are grouped. Default empty.\n * @return bool True on successful removal, false on failure.\n */\nfunction wp_cache_delete( $key, $group = '' ) {\n\tglobal $wp_object_cache;\n\n\treturn $wp_object_cache->delete( $key, $group );\n}\n\n/**\n * Removes all cache items.\n *\n * @since 2.0.0\n *\n * @see WP_Object_Cache::flush()\n * @global WP_Object_Cache $wp_object_cache Object cache global instance.\n *\n * @return bool True on success, false on failure.\n */\nfunction wp_cache_flush() {\n\tglobal $wp_object_cache;\n\n\treturn $wp_object_cache->flush();\n}\n\n/**\n * Retrieves the cache contents from the cache by key and group.\n *\n * @since 2.0.0\n *\n * @see WP_Object_Cache::get()\n * @global WP_Object_Cache $wp_object_cache Object cache global instance.\n *\n * @param int|string $key   The key under which the cache contents are stored.\n * @param string     $group Optional. Where the cache contents are grouped. Default empty.\n * @param bool       $force Optional. Whether to force an update of the local cache\n *                          from the persistent cache. Default false.\n * @param bool       $found Optional. Whether the key was found in the cache (passed by reference).\n *                          Disambiguates a return of false, a storable value. Default null.\n * @return mixed|false The cache contents on success, false on failure to retrieve contents.\n */\nfunction wp_cache_get( $key, $group = '', $force = false, &$found = null ) {\n\tglobal $wp_object_cache;\n\n\treturn $wp_object_cache->get( $key, $group, $force, $found );\n}\n\n/**\n * Retrieves multiple values from the cache in one call.\n *\n * @since 5.5.0\n *\n * @see WP_Object_Cache::get_multiple()\n * @global WP_Object_Cache $wp_object_cache Object cache global instance.\n *\n * @param array  $keys  Array of keys under which the cache contents are stored.\n * @param string $group Optional. Where the cache contents are grouped. Default empty.\n * @param bool   $force Optional. Whether to force an update of the local cache\n *                      from the persistent cache. Default false.\n * @return array Array of values organized into groups.\n */\nfunction wp_cache_get_multiple( $keys, $group = '', $force = false ) {\n\tglobal $wp_object_cache;\n\n\treturn $wp_object_cache->get_multiple( $keys, $group, $force );\n}\n\n/**\n * Increment numeric cache item's value\n *\n * @since 3.3.0\n *\n * @see WP_Object_Cache::incr()\n * @global WP_Object_Cache $wp_object_cache Object cache global instance.\n *\n * @param int|string $key    The key for the cache contents that should be incremented.\n * @param int        $offset Optional. The amount by which to increment the item's value. Default 1.\n * @param string     $group  Optional. The group the key is in. Default empty.\n * @return int|false The item's new value on success, false on failure.\n */\nfunction wp_cache_incr( $key, $offset = 1, $group = '' ) {\n\tglobal $wp_object_cache;\n\n\treturn $wp_object_cache->incr( $key, $offset, $group );\n}\n\n/**\n * Sets up Object Cache Global and assigns it.\n *\n * @since 2.0.0\n *\n * @global WP_Object_Cache $wp_object_cache\n */\nfunction wp_cache_init() {\n\t$GLOBALS['wp_object_cache'] = new WP_Object_Cache();\n}\n\n/**\n * Replaces the contents of the cache with new data.\n *\n * @since 2.0.0\n *\n * @see WP_Object_Cache::replace()\n * @global WP_Object_Cache $wp_object_cache Object cache global instance.\n *\n * @param int|string $key    The key for the cache data that should be replaced.\n * @param mixed      $data   The new data to store in the cache.\n * @param string     $group  Optional. The group for the cache data that should be replaced.\n *                           Default empty.\n * @param int        $expire Optional. When to expire the cache contents, in seconds.\n *                           Default 0 (no expiration).\n * @return bool False if original value does not exist, true if contents were replaced\n */\nfunction wp_cache_replace( $key, $data, $group = '', $expire = 0 ) {\n\tglobal $wp_object_cache;\n\n\treturn $wp_object_cache->replace( $key, $data, $group, (int) $expire );\n}\n\n/**\n * Saves the data to the cache.\n *\n * Differs from wp_cache_add() and wp_cache_replace() in that it will always write data.\n *\n * @since 2.0.0\n *\n * @see WP_Object_Cache::set()\n * @global WP_Object_Cache $wp_object_cache Object cache global instance.\n *\n * @param int|string $key    The cache key to use for retrieval later.\n * @param mixed      $data   The contents to store in the cache.\n * @param string     $group  Optional. Where to group the cache contents. Enables the same key\n *                           to be used across groups. Default empty.\n * @param int        $expire Optional. When to expire the cache contents, in seconds.\n *                           Default 0 (no expiration).\n * @return bool True on success, false on failure.\n */\nfunction wp_cache_set( $key, $data, $group = '', $expire = 0 ) {\n\tglobal $wp_object_cache;\n\n\treturn $wp_object_cache->set( $key, $data, $group, (int) $expire );\n}\n\n/**\n * Switches the internal blog ID.\n *\n * This changes the blog id used to create keys in blog specific groups.\n *\n * @since 3.5.0\n *\n * @see WP_Object_Cache::switch_to_blog()\n * @global WP_Object_Cache $wp_object_cache Object cache global instance.\n *\n * @param int $blog_id Site ID.\n */\nfunction wp_cache_switch_to_blog( $blog_id ) {\n\tglobal $wp_object_cache;\n\n\t$wp_object_cache->switch_to_blog( $blog_id );\n}\n\n/**\n * Adds a group or set of groups to the list of global groups.\n *\n * @since 2.6.0\n *\n * @see WP_Object_Cache::add_global_groups()\n * @global WP_Object_Cache $wp_object_cache Object cache global instance.\n *\n * @param string|array $groups A group or an array of groups to add.\n */\nfunction wp_cache_add_global_groups( $groups ) {\n\tglobal $wp_object_cache;\n\n\t$wp_object_cache->add_global_groups( $groups );\n}\n\n/**\n * Adds a group or set of groups to the list of non-persistent groups.\n *\n * @since 2.6.0\n *\n * @param string|array $groups A group or an array of groups to add.\n */\nfunction wp_cache_add_non_persistent_groups( $groups ) {\n\t// Default cache doesn't persist so nothing to do here.\n}\n\n/**\n * Reset internal cache keys and structures.\n *\n * If the cache back end uses global blog or site IDs as part of its cache keys,\n * this function instructs the back end to reset those keys and perform any cleanup\n * since blog or site IDs have changed since cache init.\n *\n * This function is deprecated. Use wp_cache_switch_to_blog() instead of this\n * function when preparing the cache for a blog switch. For clearing the cache\n * during unit tests, consider using wp_cache_init(). wp_cache_init() is not\n * recommended outside of unit tests as the performance penalty for using it is\n * high.\n *\n * @since 2.6.0\n * @deprecated 3.5.0 WP_Object_Cache::reset()\n * @see WP_Object_Cache::reset()\n *\n * @global WP_Object_Cache $wp_object_cache Object cache global instance.\n */\nfunction wp_cache_reset() {\n\t_deprecated_function( __FUNCTION__, '3.5.0', 'WP_Object_Cache::reset()' );\n\n\tglobal $wp_object_cache;\n\n\t$wp_object_cache->reset();\n}\n", "num_lines": 295}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Canonical API to handle WordPress Redirecting\n *\n * Based on \"Permalink Redirect\" from Scott Yang and \"Enforce www. Preference\"\n * by Mark Jaquith\n *\n * @package WordPress\n * @since 2.3.0\n */\n\n/**\n * Redirects incoming links to the proper URL based on the site url.\n *\n * Search engines consider www.somedomain.com and somedomain.com to be two\n * different URLs when they both go to the same location. This SEO enhancement\n * prevents penalty for duplicate content by redirecting all incoming links to\n * one or the other.\n *\n * Prevents redirection for feeds, trackbacks, searches, and\n * admin URLs. Does not redirect on non-pretty-permalink-supporting IIS 7+,\n * page/post previews, WP admin, Trackbacks, robots.txt, favicon.ico, searches,\n * or on POST requests.\n *\n * Will also attempt to find the correct link when a user enters a URL that does\n * not exist based on exact WordPress query. Will instead try to parse the URL\n * or query in an attempt to figure the correct page to go to.\n *\n * @since 2.3.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n * @global bool       $is_IIS\n * @global WP_Query   $wp_query   WordPress Query object.\n * @global wpdb       $wpdb       WordPress database abstraction object.\n * @global WP         $wp         Current WordPress environment instance.\n *\n * @param string $requested_url Optional. The URL that was requested, used to\n *                              figure if redirect is needed.\n * @param bool   $do_redirect   Optional. Redirect to the new URL.\n * @return string|void The string of the URL, if redirect needed.\n */\nfunction redirect_canonical( $requested_url = null, $do_redirect = true ) {\n\tglobal $wp_rewrite, $is_IIS, $wp_query, $wpdb, $wp;\n\n\tif ( isset( $_SERVER['REQUEST_METHOD'] ) && ! in_array( strtoupper( $_SERVER['REQUEST_METHOD'] ), array( 'GET', 'HEAD' ), true ) ) {\n\t\treturn;\n\t}\n\n\t// If we're not in wp-admin and the post has been published and preview nonce\n\t// is non-existent or invalid then no need for preview in query.\n\tif ( is_preview() && get_query_var( 'p' ) && 'publish' === get_post_status( get_query_var( 'p' ) ) ) {\n\t\tif ( ! isset( $_GET['preview_id'] )\n\t\t\t|| ! isset( $_GET['preview_nonce'] )\n\t\t\t|| ! wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . (int) $_GET['preview_id'] )\n\t\t) {\n\t\t\t$wp_query->is_preview = false;\n\t\t}\n\t}\n\n\tif ( is_admin() || is_search() || is_preview() || is_trackback() || is_favicon()\n\t\t|| ( $is_IIS && ! iis7_supports_permalinks() )\n\t) {\n\t\treturn;\n\t}\n\n\tif ( ! $requested_url && isset( $_SERVER['HTTP_HOST'] ) ) {\n\t\t// Build the URL in the address bar.\n\t\t$requested_url  = is_ssl() ? 'https://' : 'http://';\n\t\t$requested_url .= $_SERVER['HTTP_HOST'];\n\t\t$requested_url .= $_SERVER['REQUEST_URI'];\n\t}\n\n\t$original = parse_url( $requested_url );\n\tif ( false === $original ) {\n\t\treturn;\n\t}\n\n\t$redirect     = $original;\n\t$redirect_url = false;\n\n\t// Notice fixing.\n\tif ( ! isset( $redirect['path'] ) ) {\n\t\t$redirect['path'] = '';\n\t}\n\tif ( ! isset( $redirect['query'] ) ) {\n\t\t$redirect['query'] = '';\n\t}\n\n\t/*\n\t * If the original URL ended with non-breaking spaces, they were almost\n\t * certainly inserted by accident. Let's remove them, so the reader doesn't\n\t * see a 404 error with no obvious cause.\n\t */\n\t$redirect['path'] = preg_replace( '|(%C2%A0)+$|i', '', $redirect['path'] );\n\n\t// It's not a preview, so remove it from URL.\n\tif ( get_query_var( 'preview' ) ) {\n\t\t$redirect['query'] = remove_query_arg( 'preview', $redirect['query'] );\n\t}\n\n\t$post_id = get_query_var( 'p' );\n\n\tif ( is_feed() && $post_id ) {\n\t\t$redirect_url = get_post_comments_feed_link( $post_id, get_query_var( 'feed' ) );\n\n\t\tif ( $redirect_url ) {\n\t\t\t$redirect['query'] = _remove_qs_args_if_not_in_url(\n\t\t\t\t$redirect['query'],\n\t\t\t\tarray( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type', 'feed' ),\n\t\t\t\t$redirect_url\n\t\t\t);\n\n\t\t\t$redirect['path'] = parse_url( $redirect_url, PHP_URL_PATH );\n\t\t}\n\t}\n\n\tif ( is_singular() && $wp_query->post_count < 1 && $post_id ) {\n\n\t\t$vars = $wpdb->get_results( $wpdb->prepare( \"SELECT post_type, post_parent FROM $wpdb->posts WHERE ID = %d\", $post_id ) );\n\n\t\tif ( ! empty( $vars[0] ) ) {\n\t\t\t$vars = $vars[0];\n\n\t\t\tif ( 'revision' === $vars->post_type && $vars->post_parent > 0 ) {\n\t\t\t\t$post_id = $vars->post_parent;\n\t\t\t}\n\n\t\t\t$redirect_url = get_permalink( $post_id );\n\n\t\t\tif ( $redirect_url ) {\n\t\t\t\t$redirect['query'] = _remove_qs_args_if_not_in_url(\n\t\t\t\t\t$redirect['query'],\n\t\t\t\t\tarray( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ),\n\t\t\t\t\t$redirect_url\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t// These tests give us a WP-generated permalink.\n\tif ( is_404() ) {\n\n\t\t// Redirect ?page_id, ?p=, ?attachment_id= to their respective URLs.\n\t\t$post_id = max( get_query_var( 'p' ), get_query_var( 'page_id' ), get_query_var( 'attachment_id' ) );\n\n\t\t$redirect_post = $post_id ? get_post( $post_id ) : false;\n\n\t\tif ( $redirect_post ) {\n\t\t\t$post_type_obj = get_post_type_object( $redirect_post->post_type );\n\n\t\t\tif ( $post_type_obj->public && 'auto-draft' !== $redirect_post->post_status ) {\n\t\t\t\t$redirect_url = get_permalink( $redirect_post );\n\n\t\t\t\t$redirect['query'] = _remove_qs_args_if_not_in_url(\n\t\t\t\t\t$redirect['query'],\n\t\t\t\t\tarray( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ),\n\t\t\t\t\t$redirect_url\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$year  = get_query_var( 'year' );\n\t\t$month = get_query_var( 'monthnum' );\n\t\t$day   = get_query_var( 'day' );\n\n\t\tif ( $year && $month && $day ) {\n\t\t\t$date = sprintf( '%04d-%02d-%02d', $year, $month, $day );\n\n\t\t\tif ( ! wp_checkdate( $month, $day, $year, $date ) ) {\n\t\t\t\t$redirect_url = get_month_link( $year, $month );\n\n\t\t\t\t$redirect['query'] = _remove_qs_args_if_not_in_url(\n\t\t\t\t\t$redirect['query'],\n\t\t\t\t\tarray( 'year', 'monthnum', 'day' ),\n\t\t\t\t\t$redirect_url\n\t\t\t\t);\n\t\t\t}\n\t\t} elseif ( $year && $month && $month > 12 ) {\n\t\t\t$redirect_url = get_year_link( $year );\n\n\t\t\t$redirect['query'] = _remove_qs_args_if_not_in_url(\n\t\t\t\t$redirect['query'],\n\t\t\t\tarray( 'year', 'monthnum' ),\n\t\t\t\t$redirect_url\n\t\t\t);\n\t\t}\n\n\t\t// Strip off non-existing <!--nextpage--> links from single posts or pages.\n\t\tif ( get_query_var( 'page' ) ) {\n\t\t\t$post_id = 0;\n\n\t\t\tif ( $wp_query->queried_object instanceof WP_Post ) {\n\t\t\t\t$post_id = $wp_query->queried_object->ID;\n\t\t\t} elseif ( $wp_query->post ) {\n\t\t\t\t$post_id = $wp_query->post->ID;\n\t\t\t}\n\n\t\t\tif ( $post_id ) {\n\t\t\t\t$redirect_url = get_permalink( $post_id );\n\n\t\t\t\t$redirect['path']  = rtrim( $redirect['path'], (int) get_query_var( 'page' ) . '/' );\n\t\t\t\t$redirect['query'] = remove_query_arg( 'page', $redirect['query'] );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $redirect_url ) {\n\t\t\t$redirect_url = redirect_guess_404_permalink();\n\n\t\t\tif ( $redirect_url ) {\n\t\t\t\t$redirect['query'] = _remove_qs_args_if_not_in_url(\n\t\t\t\t\t$redirect['query'],\n\t\t\t\t\tarray( 'page', 'feed', 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ),\n\t\t\t\t\t$redirect_url\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t} elseif ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() ) {\n\n\t\t// Rewriting of old ?p=X, ?m=2004, ?m=200401, ?m=20040101.\n\t\tif ( is_attachment()\n\t\t\t&& ! array_diff( array_keys( $wp->query_vars ), array( 'attachment', 'attachment_id' ) )\n\t\t\t&& ! $redirect_url\n\t\t) {\n\t\t\tif ( ! empty( $_GET['attachment_id'] ) ) {\n\t\t\t\t$redirect_url = get_attachment_link( get_query_var( 'attachment_id' ) );\n\n\t\t\t\tif ( $redirect_url ) {\n\t\t\t\t\t$redirect['query'] = remove_query_arg( 'attachment_id', $redirect['query'] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$redirect_url = get_attachment_link();\n\t\t\t}\n\t\t} elseif ( is_single() && ! empty( $_GET['p'] ) && ! $redirect_url ) {\n\t\t\t$redirect_url = get_permalink( get_query_var( 'p' ) );\n\n\t\t\tif ( $redirect_url ) {\n\t\t\t\t$redirect['query'] = remove_query_arg( array( 'p', 'post_type' ), $redirect['query'] );\n\t\t\t}\n\t\t} elseif ( is_single() && ! empty( $_GET['name'] ) && ! $redirect_url ) {\n\t\t\t$redirect_url = get_permalink( $wp_query->get_queried_object_id() );\n\n\t\t\tif ( $redirect_url ) {\n\t\t\t\t$redirect['query'] = remove_query_arg( 'name', $redirect['query'] );\n\t\t\t}\n\t\t} elseif ( is_page() && ! empty( $_GET['page_id'] ) && ! $redirect_url ) {\n\t\t\t$redirect_url = get_permalink( get_query_var( 'page_id' ) );\n\n\t\t\tif ( $redirect_url ) {\n\t\t\t\t$redirect['query'] = remove_query_arg( 'page_id', $redirect['query'] );\n\t\t\t}\n\t\t} elseif ( is_page() && ! is_feed() && ! $redirect_url\n\t\t\t&& 'page' === get_option( 'show_on_front' ) && get_queried_object_id() === (int) get_option( 'page_on_front' )\n\t\t) {\n\t\t\t$redirect_url = home_url( '/' );\n\t\t} elseif ( is_home() && ! empty( $_GET['page_id'] ) && ! $redirect_url\n\t\t\t&& 'page' === get_option( 'show_on_front' ) && get_query_var( 'page_id' ) === (int) get_option( 'page_for_posts' )\n\t\t) {\n\t\t\t$redirect_url = get_permalink( get_option( 'page_for_posts' ) );\n\n\t\t\tif ( $redirect_url ) {\n\t\t\t\t$redirect['query'] = remove_query_arg( 'page_id', $redirect['query'] );\n\t\t\t}\n\t\t} elseif ( ! empty( $_GET['m'] ) && ( is_year() || is_month() || is_day() ) ) {\n\t\t\t$m = get_query_var( 'm' );\n\n\t\t\tswitch ( strlen( $m ) ) {\n\t\t\t\tcase 4: // Yearly.\n\t\t\t\t\t$redirect_url = get_year_link( $m );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6: // Monthly.\n\t\t\t\t\t$redirect_url = get_month_link( substr( $m, 0, 4 ), substr( $m, 4, 2 ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8: // Daily.\n\t\t\t\t\t$redirect_url = get_day_link( substr( $m, 0, 4 ), substr( $m, 4, 2 ), substr( $m, 6, 2 ) );\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( $redirect_url ) {\n\t\t\t\t$redirect['query'] = remove_query_arg( 'm', $redirect['query'] );\n\t\t\t}\n\t\t\t// Now moving on to non ?m=X year/month/day links.\n\t\t} elseif ( is_date() ) {\n\t\t\t$year  = get_query_var( 'year' );\n\t\t\t$month = get_query_var( 'monthnum' );\n\t\t\t$day   = get_query_var( 'day' );\n\n\t\t\tif ( is_day() && $year && $month && ! empty( $_GET['day'] ) ) {\n\t\t\t\t$redirect_url = get_day_link( $year, $month, $day );\n\n\t\t\t\tif ( $redirect_url ) {\n\t\t\t\t\t$redirect['query'] = remove_query_arg( array( 'year', 'monthnum', 'day' ), $redirect['query'] );\n\t\t\t\t}\n\t\t\t} elseif ( is_month() && $year && ! empty( $_GET['monthnum'] ) ) {\n\t\t\t\t$redirect_url = get_month_link( $year, $month );\n\n\t\t\t\tif ( $redirect_url ) {\n\t\t\t\t\t$redirect['query'] = remove_query_arg( array( 'year', 'monthnum' ), $redirect['query'] );\n\t\t\t\t}\n\t\t\t} elseif ( is_year() && ! empty( $_GET['year'] ) ) {\n\t\t\t\t$redirect_url = get_year_link( $year );\n\n\t\t\t\tif ( $redirect_url ) {\n\t\t\t\t\t$redirect['query'] = remove_query_arg( 'year', $redirect['query'] );\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( is_author() && ! empty( $_GET['author'] ) && preg_match( '|^[0-9]+$|', $_GET['author'] ) ) {\n\t\t\t$author = get_userdata( get_query_var( 'author' ) );\n\n\t\t\tif ( false !== $author\n\t\t\t\t&& $wpdb->get_var( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE $wpdb->posts.post_author = %d AND $wpdb->posts.post_status = 'publish' LIMIT 1\", $author->ID ) )\n\t\t\t) {\n\t\t\t\t$redirect_url = get_author_posts_url( $author->ID, $author->user_nicename );\n\n\t\t\t\tif ( $redirect_url ) {\n\t\t\t\t\t$redirect['query'] = remove_query_arg( 'author', $redirect['query'] );\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( is_category() || is_tag() || is_tax() ) { // Terms (tags/categories).\n\t\t\t$term_count = 0;\n\n\t\t\tforeach ( $wp_query->tax_query->queried_terms as $tax_query ) {\n\t\t\t\t$term_count += count( $tax_query['terms'] );\n\t\t\t}\n\n\t\t\t$obj = $wp_query->get_queried_object();\n\n\t\t\tif ( $term_count <= 1 && ! empty( $obj->term_id ) ) {\n\t\t\t\t$tax_url = get_term_link( (int) $obj->term_id, $obj->taxonomy );\n\n\t\t\t\tif ( $tax_url && ! is_wp_error( $tax_url ) ) {\n\t\t\t\t\tif ( ! empty( $redirect['query'] ) ) {\n\t\t\t\t\t\t// Strip taxonomy query vars off the URL.\n\t\t\t\t\t\t$qv_remove = array( 'term', 'taxonomy' );\n\n\t\t\t\t\t\tif ( is_category() ) {\n\t\t\t\t\t\t\t$qv_remove[] = 'category_name';\n\t\t\t\t\t\t\t$qv_remove[] = 'cat';\n\t\t\t\t\t\t} elseif ( is_tag() ) {\n\t\t\t\t\t\t\t$qv_remove[] = 'tag';\n\t\t\t\t\t\t\t$qv_remove[] = 'tag_id';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Custom taxonomies will have a custom query var, remove those too.\n\t\t\t\t\t\t\t$tax_obj = get_taxonomy( $obj->taxonomy );\n\t\t\t\t\t\t\tif ( false !== $tax_obj->query_var ) {\n\t\t\t\t\t\t\t\t$qv_remove[] = $tax_obj->query_var;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$rewrite_vars = array_diff( array_keys( $wp_query->query ), array_keys( $_GET ) );\n\n\t\t\t\t\t\t// Check to see if all the query vars are coming from the rewrite, none are set via $_GET.\n\t\t\t\t\t\tif ( ! array_diff( $rewrite_vars, array_keys( $_GET ) ) ) {\n\t\t\t\t\t\t\t// Remove all of the per-tax query vars.\n\t\t\t\t\t\t\t$redirect['query'] = remove_query_arg( $qv_remove, $redirect['query'] );\n\n\t\t\t\t\t\t\t// Create the destination URL for this taxonomy.\n\t\t\t\t\t\t\t$tax_url = parse_url( $tax_url );\n\n\t\t\t\t\t\t\tif ( ! empty( $tax_url['query'] ) ) {\n\t\t\t\t\t\t\t\t// Taxonomy accessible via ?taxonomy=...&term=... or any custom query var.\n\t\t\t\t\t\t\t\tparse_str( $tax_url['query'], $query_vars );\n\t\t\t\t\t\t\t\t$redirect['query'] = add_query_arg( $query_vars, $redirect['query'] );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Taxonomy is accessible via a \"pretty URL\".\n\t\t\t\t\t\t\t\t$redirect['path'] = $tax_url['path'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Some query vars are set via $_GET. Unset those from $_GET that exist via the rewrite.\n\t\t\t\t\t\t\tforeach ( $qv_remove as $_qv ) {\n\t\t\t\t\t\t\t\tif ( isset( $rewrite_vars[ $_qv ] ) ) {\n\t\t\t\t\t\t\t\t\t$redirect['query'] = remove_query_arg( $_qv, $redirect['query'] );\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\t\t\t}\n\t\t} elseif ( is_single() && strpos( $wp_rewrite->permalink_structure, '%category%' ) !== false ) {\n\t\t\t$category_name = get_query_var( 'category_name' );\n\n\t\t\tif ( $category_name ) {\n\t\t\t\t$category = get_category_by_path( $category_name );\n\n\t\t\t\tif ( ! $category || is_wp_error( $category )\n\t\t\t\t\t|| ! has_term( $category->term_id, 'category', $wp_query->get_queried_object_id() )\n\t\t\t\t) {\n\t\t\t\t\t$redirect_url = get_permalink( $wp_query->get_queried_object_id() );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Post paging.\n\t\tif ( is_singular() && get_query_var( 'page' ) ) {\n\t\t\t$page = get_query_var( 'page' );\n\n\t\t\tif ( ! $redirect_url ) {\n\t\t\t\t$redirect_url = get_permalink( get_queried_object_id() );\n\t\t\t}\n\n\t\t\tif ( $page > 1 ) {\n\t\t\t\t$redirect_url = trailingslashit( $redirect_url );\n\n\t\t\t\tif ( is_front_page() ) {\n\t\t\t\t\t$redirect_url .= user_trailingslashit( \"$wp_rewrite->pagination_base/$page\", 'paged' );\n\t\t\t\t} else {\n\t\t\t\t\t$redirect_url .= user_trailingslashit( $page, 'single_paged' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$redirect['query'] = remove_query_arg( 'page', $redirect['query'] );\n\t\t}\n\n\t\tif ( get_query_var( 'sitemap' ) ) {\n\t\t\t$redirect_url      = get_sitemap_url( get_query_var( 'sitemap' ), get_query_var( 'sitemap-subtype' ), get_query_var( 'paged' ) );\n\t\t\t$redirect['query'] = remove_query_arg( array( 'sitemap', 'sitemap-subtype', 'paged' ), $redirect['query'] );\n\t\t} elseif ( get_query_var( 'paged' ) || is_feed() || get_query_var( 'cpage' ) ) {\n\t\t\t// Paging and feeds.\n\t\t\t$paged = get_query_var( 'paged' );\n\t\t\t$feed  = get_query_var( 'feed' );\n\t\t\t$cpage = get_query_var( 'cpage' );\n\n\t\t\twhile ( preg_match( \"#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#\", $redirect['path'] )\n\t\t\t\t|| preg_match( '#/(comments/?)?(feed|rss2?|rdf|atom)(/+)?$#', $redirect['path'] )\n\t\t\t\t|| preg_match( \"#/{$wp_rewrite->comments_pagination_base}-[0-9]+(/+)?$#\", $redirect['path'] )\n\t\t\t) {\n\t\t\t\t// Strip off any existing paging.\n\t\t\t\t$redirect['path'] = preg_replace( \"#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#\", '/', $redirect['path'] );\n\t\t\t\t// Strip off feed endings.\n\t\t\t\t$redirect['path'] = preg_replace( '#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/', $redirect['path'] );\n\t\t\t\t// Strip off any existing comment paging.\n\t\t\t\t$redirect['path'] = preg_replace( \"#/{$wp_rewrite->comments_pagination_base}-[0-9]+?(/+)?$#\", '/', $redirect['path'] );\n\t\t\t}\n\n\t\t\t$addl_path    = '';\n\t\t\t$default_feed = get_default_feed();\n\n\t\t\tif ( is_feed() && in_array( $feed, $wp_rewrite->feeds, true ) ) {\n\t\t\t\t$addl_path = ! empty( $addl_path ) ? trailingslashit( $addl_path ) : '';\n\n\t\t\t\tif ( ! is_singular() && get_query_var( 'withcomments' ) ) {\n\t\t\t\t\t$addl_path .= 'comments/';\n\t\t\t\t}\n\n\t\t\t\tif ( ( 'rss' === $default_feed && 'feed' === $feed ) || 'rss' === $feed ) {\n\t\t\t\t\t$format = ( 'rss2' === $default_feed ) ? '' : 'rss2';\n\t\t\t\t} else {\n\t\t\t\t\t$format = ( $default_feed === $feed || 'feed' === $feed ) ? '' : $feed;\n\t\t\t\t}\n\n\t\t\t\t$addl_path .= user_trailingslashit( 'feed/' . $format, 'feed' );\n\n\t\t\t\t$redirect['query'] = remove_query_arg( 'feed', $redirect['query'] );\n\t\t\t} elseif ( is_feed() && 'old' === $feed ) {\n\t\t\t\t$old_feed_files = array(\n\t\t\t\t\t'wp-atom.php'         => 'atom',\n\t\t\t\t\t'wp-commentsrss2.php' => 'comments_rss2',\n\t\t\t\t\t'wp-feed.php'         => $default_feed,\n\t\t\t\t\t'wp-rdf.php'          => 'rdf',\n\t\t\t\t\t'wp-rss.php'          => 'rss2',\n\t\t\t\t\t'wp-rss2.php'         => 'rss2',\n\t\t\t\t);\n\n\t\t\t\tif ( isset( $old_feed_files[ basename( $redirect['path'] ) ] ) ) {\n\t\t\t\t\t$redirect_url = get_feed_link( $old_feed_files[ basename( $redirect['path'] ) ] );\n\n\t\t\t\t\twp_redirect( $redirect_url, 301 );\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $paged > 0 ) {\n\t\t\t\t$redirect['query'] = remove_query_arg( 'paged', $redirect['query'] );\n\n\t\t\t\tif ( ! is_feed() ) {\n\t\t\t\t\tif ( ! is_single() ) {\n\t\t\t\t\t\t$addl_path = ! empty( $addl_path ) ? trailingslashit( $addl_path ) : '';\n\n\t\t\t\t\t\tif ( $paged > 1 ) {\n\t\t\t\t\t\t\t$addl_path .= user_trailingslashit( \"$wp_rewrite->pagination_base/$paged\", 'paged' );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} elseif ( $paged > 1 ) {\n\t\t\t\t\t$redirect['query'] = add_query_arg( 'paged', $paged, $redirect['query'] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$default_comments_page = get_option( 'default_comments_page' );\n\n\t\t\tif ( get_option( 'page_comments' )\n\t\t\t\t&& ( 'newest' === $default_comments_page && $cpage > 0\n\t\t\t\t\t|| 'newest' !== $default_comments_page && $cpage > 1 )\n\t\t\t) {\n\t\t\t\t$addl_path  = ( ! empty( $addl_path ) ? trailingslashit( $addl_path ) : '' );\n\t\t\t\t$addl_path .= user_trailingslashit( $wp_rewrite->comments_pagination_base . '-' . $cpage, 'commentpaged' );\n\n\t\t\t\t$redirect['query'] = remove_query_arg( 'cpage', $redirect['query'] );\n\t\t\t}\n\n\t\t\t// Strip off trailing /index.php/.\n\t\t\t$redirect['path'] = preg_replace( '|/' . preg_quote( $wp_rewrite->index, '|' ) . '/?$|', '/', $redirect['path'] );\n\t\t\t$redirect['path'] = user_trailingslashit( $redirect['path'] );\n\n\t\t\tif ( ! empty( $addl_path )\n\t\t\t\t&& $wp_rewrite->using_index_permalinks()\n\t\t\t\t&& strpos( $redirect['path'], '/' . $wp_rewrite->index . '/' ) === false\n\t\t\t) {\n\t\t\t\t$redirect['path'] = trailingslashit( $redirect['path'] ) . $wp_rewrite->index . '/';\n\t\t\t}\n\n\t\t\tif ( ! empty( $addl_path ) ) {\n\t\t\t\t$redirect['path'] = trailingslashit( $redirect['path'] ) . $addl_path;\n\t\t\t}\n\n\t\t\t$redirect_url = $redirect['scheme'] . '://' . $redirect['host'] . $redirect['path'];\n\t\t}\n\n\t\tif ( 'wp-register.php' === basename( $redirect['path'] ) ) {\n\t\t\tif ( is_multisite() ) {\n\t\t\t\t/** This filter is documented in wp-login.php */\n\t\t\t\t$redirect_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) );\n\t\t\t} else {\n\t\t\t\t$redirect_url = wp_registration_url();\n\t\t\t}\n\n\t\t\twp_redirect( $redirect_url, 301 );\n\t\t\tdie();\n\t\t}\n\t}\n\n\t$redirect['query'] = preg_replace( '#^\\??&*?#', '', $redirect['query'] );\n\n\t// Tack on any additional query vars.\n\tif ( $redirect_url && ! empty( $redirect['query'] ) ) {\n\t\tparse_str( $redirect['query'], $_parsed_query );\n\t\t$redirect = parse_url( $redirect_url );\n\n\t\tif ( ! empty( $_parsed_query['name'] ) && ! empty( $redirect['query'] ) ) {\n\t\t\tparse_str( $redirect['query'], $_parsed_redirect_query );\n\n\t\t\tif ( empty( $_parsed_redirect_query['name'] ) ) {\n\t\t\t\tunset( $_parsed_query['name'] );\n\t\t\t}\n\t\t}\n\n\t\t$_parsed_query = array_combine(\n\t\t\trawurlencode_deep( array_keys( $_parsed_query ) ),\n\t\t\trawurlencode_deep( array_values( $_parsed_query ) )\n\t\t);\n\n\t\t$redirect_url = add_query_arg( $_parsed_query, $redirect_url );\n\t}\n\n\tif ( $redirect_url ) {\n\t\t$redirect = parse_url( $redirect_url );\n\t}\n\n\t// www.example.com vs. example.com\n\t$user_home = parse_url( home_url() );\n\n\tif ( ! empty( $user_home['host'] ) ) {\n\t\t$redirect['host'] = $user_home['host'];\n\t}\n\n\tif ( empty( $user_home['path'] ) ) {\n\t\t$user_home['path'] = '/';\n\t}\n\n\t// Handle ports.\n\tif ( ! empty( $user_home['port'] ) ) {\n\t\t$redirect['port'] = $user_home['port'];\n\t} else {\n\t\tunset( $redirect['port'] );\n\t}\n\n\t// Trailing /index.php.\n\t$redirect['path'] = preg_replace( '|/' . preg_quote( $wp_rewrite->index, '|' ) . '/*?$|', '/', $redirect['path'] );\n\n\t$punctuation_pattern = implode(\n\t\t'|',\n\t\tarray_map(\n\t\t\t'preg_quote',\n\t\t\tarray(\n\t\t\t\t' ',\n\t\t\t\t'%20',  // Space.\n\t\t\t\t'!',\n\t\t\t\t'%21',  // Exclamation mark.\n\t\t\t\t'\"',\n\t\t\t\t'%22',  // Double quote.\n\t\t\t\t\"'\",\n\t\t\t\t'%27',  // Single quote.\n\t\t\t\t'(',\n\t\t\t\t'%28',  // Opening bracket.\n\t\t\t\t')',\n\t\t\t\t'%29',  // Closing bracket.\n\t\t\t\t',',\n\t\t\t\t'%2C',  // Comma.\n\t\t\t\t'.',\n\t\t\t\t'%2E',  // Period.\n\t\t\t\t';',\n\t\t\t\t'%3B',  // Semicolon.\n\t\t\t\t'{',\n\t\t\t\t'%7B',  // Opening curly bracket.\n\t\t\t\t'}',\n\t\t\t\t'%7D',  // Closing curly bracket.\n\t\t\t\t'%E2%80%9C', // Opening curly quote.\n\t\t\t\t'%E2%80%9D', // Closing curly quote.\n\t\t\t)\n\t\t)\n\t);\n\n\t// Remove trailing spaces and end punctuation from the path.\n\t$redirect['path'] = preg_replace( \"#($punctuation_pattern)+$#\", '', $redirect['path'] );\n\n\tif ( ! empty( $redirect['query'] ) ) {\n\t\t// Remove trailing spaces and end punctuation from certain terminating query string args.\n\t\t$redirect['query'] = preg_replace( \"#((^|&)(p|page_id|cat|tag)=[^&]*?)($punctuation_pattern)+$#\", '$1', $redirect['query'] );\n\n\t\t// Clean up empty query strings.\n\t\t$redirect['query'] = trim( preg_replace( '#(^|&)(p|page_id|cat|tag)=?(&|$)#', '&', $redirect['query'] ), '&' );\n\n\t\t// Redirect obsolete feeds.\n\t\t$redirect['query'] = preg_replace( '#(^|&)feed=rss(&|$)#', '$1feed=rss2$2', $redirect['query'] );\n\n\t\t// Remove redundant leading ampersands.\n\t\t$redirect['query'] = preg_replace( '#^\\??&*?#', '', $redirect['query'] );\n\t}\n\n\t// Strip /index.php/ when we're not using PATHINFO permalinks.\n\tif ( ! $wp_rewrite->using_index_permalinks() ) {\n\t\t$redirect['path'] = str_replace( '/' . $wp_rewrite->index . '/', '/', $redirect['path'] );\n\t}\n\n\t// Trailing slashes.\n\tif ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks()\n\t\t&& ! is_404() && ( ! is_front_page() || is_front_page() && get_query_var( 'paged' ) > 1 )\n\t) {\n\t\t$user_ts_type = '';\n\n\t\tif ( get_query_var( 'paged' ) > 0 ) {\n\t\t\t$user_ts_type = 'paged';\n\t\t} else {\n\t\t\tforeach ( array( 'single', 'category', 'page', 'day', 'month', 'year', 'home' ) as $type ) {\n\t\t\t\t$func = 'is_' . $type;\n\t\t\t\tif ( call_user_func( $func ) ) {\n\t\t\t\t\t$user_ts_type = $type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$redirect['path'] = user_trailingslashit( $redirect['path'], $user_ts_type );\n\t} elseif ( is_front_page() ) {\n\t\t$redirect['path'] = trailingslashit( $redirect['path'] );\n\t}\n\n\t// Remove trailing slash for robots.txt or sitemap requests.\n\tif ( is_robots()\n\t\t|| ! empty( get_query_var( 'sitemap' ) ) || ! empty( get_query_var( 'sitemap-stylesheet' ) )\n\t) {\n\t\t$redirect['path'] = untrailingslashit( $redirect['path'] );\n\t}\n\n\t// Strip multiple slashes out of the URL.\n\tif ( strpos( $redirect['path'], '//' ) > -1 ) {\n\t\t$redirect['path'] = preg_replace( '|/+|', '/', $redirect['path'] );\n\t}\n\n\t// Always trailing slash the Front Page URL.\n\tif ( trailingslashit( $redirect['path'] ) === trailingslashit( $user_home['path'] ) ) {\n\t\t$redirect['path'] = trailingslashit( $redirect['path'] );\n\t}\n\n\t$original_host_low = strtolower( $original['host'] );\n\t$redirect_host_low = strtolower( $redirect['host'] );\n\n\t// Ignore differences in host capitalization, as this can lead to infinite redirects.\n\t// Only redirect no-www <=> yes-www.\n\tif ( $original_host_low === $redirect_host_low\n\t\t|| ( 'www.' . $original_host_low !== $redirect_host_low\n\t\t\t&& 'www.' . $redirect_host_low !== $original_host_low )\n\t) {\n\t\t$redirect['host'] = $original['host'];\n\t}\n\n\t$compare_original = array( $original['host'], $original['path'] );\n\n\tif ( ! empty( $original['port'] ) ) {\n\t\t$compare_original[] = $original['port'];\n\t}\n\n\tif ( ! empty( $original['query'] ) ) {\n\t\t$compare_original[] = $original['query'];\n\t}\n\n\t$compare_redirect = array( $redirect['host'], $redirect['path'] );\n\n\tif ( ! empty( $redirect['port'] ) ) {\n\t\t$compare_redirect[] = $redirect['port'];\n\t}\n\n\tif ( ! empty( $redirect['query'] ) ) {\n\t\t$compare_redirect[] = $redirect['query'];\n\t}\n\n\tif ( $compare_original !== $compare_redirect ) {\n\t\t$redirect_url = $redirect['scheme'] . '://' . $redirect['host'];\n\n\t\tif ( ! empty( $redirect['port'] ) ) {\n\t\t\t$redirect_url .= ':' . $redirect['port'];\n\t\t}\n\n\t\t$redirect_url .= $redirect['path'];\n\n\t\tif ( ! empty( $redirect['query'] ) ) {\n\t\t\t$redirect_url .= '?' . $redirect['query'];\n\t\t}\n\t}\n\n\tif ( ! $redirect_url || $redirect_url === $requested_url ) {\n\t\treturn;\n\t}\n\n\t// Hex encoded octets are case-insensitive.\n\tif ( false !== strpos( $requested_url, '%' ) ) {\n\t\tif ( ! function_exists( 'lowercase_octets' ) ) {\n\t\t\t/**\n\t\t\t * Converts the first hex-encoded octet match to lowercase.\n\t\t\t *\n\t\t\t * @since 3.1.0\n\t\t\t * @ignore\n\t\t\t *\n\t\t\t * @param array $matches Hex-encoded octet matches for the requested URL.\n\t\t\t * @return string Lowercased version of the first match.\n\t\t\t */\n\t\t\tfunction lowercase_octets( $matches ) {\n\t\t\t\treturn strtolower( $matches[0] );\n\t\t\t}\n\t\t}\n\n\t\t$requested_url = preg_replace_callback( '|%[a-fA-F0-9][a-fA-F0-9]|', 'lowercase_octets', $requested_url );\n\t}\n\n\t/**\n\t * Filters the canonical redirect URL.\n\t *\n\t * Returning false to this filter will cancel the redirect.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string $redirect_url  The redirect URL.\n\t * @param string $requested_url The requested URL.\n\t */\n\t$redirect_url = apply_filters( 'redirect_canonical', $redirect_url, $requested_url );\n\n\t// Yes, again -- in case the filter aborted the request.\n\tif ( ! $redirect_url || strip_fragment_from_url( $redirect_url ) === strip_fragment_from_url( $requested_url ) ) {\n\t\treturn;\n\t}\n\n\tif ( $do_redirect ) {\n\t\t// Protect against chained redirects.\n\t\tif ( ! redirect_canonical( $redirect_url, false ) ) {\n\t\t\twp_redirect( $redirect_url, 301 );\n\t\t\texit;\n\t\t} else {\n\t\t\t// Debug.\n\t\t\t// die(\"1: $redirect_url<br />2: \" . redirect_canonical( $redirect_url, false ) );\n\t\t\treturn;\n\t\t}\n\t} else {\n\t\treturn $redirect_url;\n\t}\n}\n\n/**\n * Removes arguments from a query string if they are not present in a URL\n * DO NOT use this in plugin code.\n *\n * @since 3.4.0\n * @access private\n *\n * @param string $query_string\n * @param array  $args_to_check\n * @param string $url\n * @return string The altered query string\n */\nfunction _remove_qs_args_if_not_in_url( $query_string, array $args_to_check, $url ) {\n\t$parsed_url = parse_url( $url );\n\n\tif ( ! empty( $parsed_url['query'] ) ) {\n\t\tparse_str( $parsed_url['query'], $parsed_query );\n\n\t\tforeach ( $args_to_check as $qv ) {\n\t\t\tif ( ! isset( $parsed_query[ $qv ] ) ) {\n\t\t\t\t$query_string = remove_query_arg( $qv, $query_string );\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$query_string = remove_query_arg( $args_to_check, $query_string );\n\t}\n\n\treturn $query_string;\n}\n\n/**\n * Strips the #fragment from a URL, if one is present.\n *\n * @since 4.4.0\n *\n * @param string $url The URL to strip.\n * @return string The altered URL.\n */\nfunction strip_fragment_from_url( $url ) {\n\t$parsed_url = parse_url( $url );\n\n\tif ( ! empty( $parsed_url['host'] ) ) {\n\t\t// This mirrors code in redirect_canonical(). It does not handle every case.\n\t\t$url = $parsed_url['scheme'] . '://' . $parsed_url['host'];\n\t\tif ( ! empty( $parsed_url['port'] ) ) {\n\t\t\t$url .= ':' . $parsed_url['port'];\n\t\t}\n\n\t\tif ( ! empty( $parsed_url['path'] ) ) {\n\t\t\t$url .= $parsed_url['path'];\n\t\t}\n\n\t\tif ( ! empty( $parsed_url['query'] ) ) {\n\t\t\t$url .= '?' . $parsed_url['query'];\n\t\t}\n\t}\n\n\treturn $url;\n}\n\n/**\n * Attempts to guess the correct URL for a 404 request based on query vars.\n *\n * @since 2.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @return string|false The correct URL if one is found. False on failure.\n */\nfunction redirect_guess_404_permalink() {\n\tglobal $wpdb;\n\n\t/**\n\t * Filters whether to attempt to guess a redirect URL for a 404 request.\n\t *\n\t * Returning a false value from the filter will disable the URL guessing\n\t * and return early without performing a redirect.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param bool $do_redirect_guess Whether to attempt to guess a redirect URL\n\t *                                for a 404 request. Default true.\n\t */\n\tif ( false === apply_filters( 'do_redirect_guess_404_permalink', true ) ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Short-circuits the redirect URL guessing for 404 requests.\n\t *\n\t * Returning a non-null value from the filter will effectively short-circuit\n\t * the URL guessing, returning the passed value instead.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param null|string|false $pre Whether to short-circuit guessing the redirect for a 404.\n\t *                               Default null to continue with the URL guessing.\n\t */\n\t$pre = apply_filters( 'pre_redirect_guess_404_permalink', null );\n\tif ( null !== $pre ) {\n\t\treturn $pre;\n\t}\n\n\tif ( get_query_var( 'name' ) ) {\n\t\t/**\n\t\t * Filters whether to perform a strict guess for a 404 redirect.\n\t\t *\n\t\t * Returning a truthy value from the filter will redirect only exact post_name matches.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param bool $strict_guess Whether to perform a strict guess. Default false (loose guess).\n\t\t */\n\t\t$strict_guess = apply_filters( 'strict_redirect_guess_404_permalink', false );\n\n\t\tif ( $strict_guess ) {\n\t\t\t$where = $wpdb->prepare( 'post_name = %s', get_query_var( 'name' ) );\n\t\t} else {\n\t\t\t$where = $wpdb->prepare( 'post_name LIKE %s', $wpdb->esc_like( get_query_var( 'name' ) ) . '%' );\n\t\t}\n\n\t\t// If any of post_type, year, monthnum, or day are set, use them to refine the query.\n\t\tif ( get_query_var( 'post_type' ) ) {\n\t\t\t$where .= $wpdb->prepare( ' AND post_type = %s', get_query_var( 'post_type' ) );\n\t\t} else {\n\t\t\t$where .= \" AND post_type IN ('\" . implode( \"', '\", get_post_types( array( 'public' => true ) ) ) . \"')\";\n\t\t}\n\n\t\tif ( get_query_var( 'year' ) ) {\n\t\t\t$where .= $wpdb->prepare( ' AND YEAR(post_date) = %d', get_query_var( 'year' ) );\n\t\t}\n\t\tif ( get_query_var( 'monthnum' ) ) {\n\t\t\t$where .= $wpdb->prepare( ' AND MONTH(post_date) = %d', get_query_var( 'monthnum' ) );\n\t\t}\n\t\tif ( get_query_var( 'day' ) ) {\n\t\t\t$where .= $wpdb->prepare( ' AND DAYOFMONTH(post_date) = %d', get_query_var( 'day' ) );\n\t\t}\n\n\t\t// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared\n\t\t$post_id = $wpdb->get_var( \"SELECT ID FROM $wpdb->posts WHERE $where AND post_status = 'publish'\" );\n\n\t\tif ( ! $post_id ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( get_query_var( 'feed' ) ) {\n\t\t\treturn get_post_comments_feed_link( $post_id, get_query_var( 'feed' ) );\n\t\t} elseif ( get_query_var( 'page' ) > 1 ) {\n\t\t\treturn trailingslashit( get_permalink( $post_id ) ) . user_trailingslashit( get_query_var( 'page' ), 'single_paged' );\n\t\t} else {\n\t\t\treturn get_permalink( $post_id );\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Redirects a variety of shorthand URLs to the admin.\n *\n * If a user visits example.com/admin, they'll be redirected to /wp-admin.\n * Visiting /login redirects to /wp-login.php, and so on.\n *\n * @since 3.4.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n */\nfunction wp_redirect_admin_locations() {\n\tglobal $wp_rewrite;\n\n\tif ( ! ( is_404() && $wp_rewrite->using_permalinks() ) ) {\n\t\treturn;\n\t}\n\n\t$admins = array(\n\t\thome_url( 'wp-admin', 'relative' ),\n\t\thome_url( 'dashboard', 'relative' ),\n\t\thome_url( 'admin', 'relative' ),\n\t\tsite_url( 'dashboard', 'relative' ),\n\t\tsite_url( 'admin', 'relative' ),\n\t);\n\n\tif ( in_array( untrailingslashit( $_SERVER['REQUEST_URI'] ), $admins, true ) ) {\n\t\twp_redirect( admin_url() );\n\t\texit;\n\t}\n\n\t$logins = array(\n\t\thome_url( 'wp-login.php', 'relative' ),\n\t\thome_url( 'login', 'relative' ),\n\t\tsite_url( 'login', 'relative' ),\n\t);\n\n\tif ( in_array( untrailingslashit( $_SERVER['REQUEST_URI'] ), $logins, true ) ) {\n\t\twp_redirect( wp_login_url() );\n\t\texit;\n\t}\n}\n", "num_lines": 973}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Core User Role & Capabilities API\n *\n * @package WordPress\n * @subpackage Users\n */\n\n/**\n * Maps meta capabilities to primitive capabilities.\n *\n * This function also accepts an ID of an object to map against if the capability is a meta capability. Meta\n * capabilities such as `edit_post` and `edit_user` are capabilities used by this function to map to primitive\n * capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`.\n *\n * Example usage:\n *\n *     map_meta_cap( 'edit_posts', $user->ID );\n *     map_meta_cap( 'edit_post', $user->ID, $post->ID );\n *     map_meta_cap( 'edit_post_meta', $user->ID, $post->ID, $meta_key );\n *\n * This does not actually compare whether the user ID has the actual capability,\n * just what the capability or capabilities are. Meta capability list value can\n * be 'delete_user', 'edit_user', 'remove_user', 'promote_user', 'delete_post',\n * 'delete_page', 'edit_post', 'edit_page', 'read_post', or 'read_page'.\n *\n * @since 2.0.0\n * @since 5.3.0 Formalized the existing and already documented `...$args` parameter\n *              by adding it to the function signature.\n *\n * @global array $post_type_meta_caps Used to get post type meta capabilities.\n *\n * @param string $cap     Capability name.\n * @param int    $user_id User ID.\n * @param mixed  ...$args Optional further parameters, typically starting with an object ID.\n * @return string[] Actual capabilities for meta capability.\n */\nfunction map_meta_cap( $cap, $user_id, ...$args ) {\n\t$caps = array();\n\n\tswitch ( $cap ) {\n\t\tcase 'remove_user':\n\t\t\t// In multisite the user must be a super admin to remove themselves.\n\t\t\tif ( isset( $args[0] ) && $user_id == $args[0] && ! is_super_admin( $user_id ) ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t} else {\n\t\t\t\t$caps[] = 'remove_users';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'promote_user':\n\t\tcase 'add_users':\n\t\t\t$caps[] = 'promote_users';\n\t\t\tbreak;\n\t\tcase 'edit_user':\n\t\tcase 'edit_users':\n\t\t\t// Allow user to edit themselves.\n\t\t\tif ( 'edit_user' === $cap && isset( $args[0] ) && $user_id == $args[0] ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// In multisite the user must have manage_network_users caps. If editing a super admin, the user must be a super admin.\n\t\t\tif ( is_multisite() && ( ( ! is_super_admin( $user_id ) && 'edit_user' === $cap && is_super_admin( $args[0] ) ) || ! user_can( $user_id, 'manage_network_users' ) ) ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t} else {\n\t\t\t\t$caps[] = 'edit_users'; // edit_user maps to edit_users.\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'delete_post':\n\t\tcase 'delete_page':\n\t\t\t$post = get_post( $args[0] );\n\t\t\tif ( ! $post ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( 'revision' === $post->post_type ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( ( get_option( 'page_for_posts' ) == $post->ID ) || ( get_option( 'page_on_front' ) == $post->ID ) ) {\n\t\t\t\t$caps[] = 'manage_options';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$post_type = get_post_type_object( $post->post_type );\n\t\t\tif ( ! $post_type ) {\n\t\t\t\t/* translators: 1: Post type, 2: Capability name. */\n\t\t\t\t_doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability \"%2$s\" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' );\n\t\t\t\t$caps[] = 'edit_others_posts';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( ! $post_type->map_meta_cap ) {\n\t\t\t\t$caps[] = $post_type->cap->$cap;\n\t\t\t\t// Prior to 3.1 we would re-call map_meta_cap here.\n\t\t\t\tif ( 'delete_post' === $cap ) {\n\t\t\t\t\t$cap = $post_type->cap->$cap;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// If the post author is set and the user is the author...\n\t\t\tif ( $post->post_author && $user_id == $post->post_author ) {\n\t\t\t\t// If the post is published or scheduled...\n\t\t\t\tif ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) {\n\t\t\t\t\t$caps[] = $post_type->cap->delete_published_posts;\n\t\t\t\t} elseif ( 'trash' === $post->post_status ) {\n\t\t\t\t\t$status = get_post_meta( $post->ID, '_wp_trash_meta_status', true );\n\t\t\t\t\tif ( in_array( $status, array( 'publish', 'future' ), true ) ) {\n\t\t\t\t\t\t$caps[] = $post_type->cap->delete_published_posts;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$caps[] = $post_type->cap->delete_posts;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// If the post is draft...\n\t\t\t\t\t$caps[] = $post_type->cap->delete_posts;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// The user is trying to edit someone else's post.\n\t\t\t\t$caps[] = $post_type->cap->delete_others_posts;\n\t\t\t\t// The post is published or scheduled, extra cap required.\n\t\t\t\tif ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) {\n\t\t\t\t\t$caps[] = $post_type->cap->delete_published_posts;\n\t\t\t\t} elseif ( 'private' === $post->post_status ) {\n\t\t\t\t\t$caps[] = $post_type->cap->delete_private_posts;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Setting the privacy policy page requires `manage_privacy_options`,\n\t\t\t * so deleting it should require that too.\n\t\t\t */\n\t\t\tif ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post->ID ) {\n\t\t\t\t$caps = array_merge( $caps, map_meta_cap( 'manage_privacy_options', $user_id ) );\n\t\t\t}\n\n\t\t\tbreak;\n\t\t// edit_post breaks down to edit_posts, edit_published_posts, or\n\t\t// edit_others_posts.\n\t\tcase 'edit_post':\n\t\tcase 'edit_page':\n\t\t\t$post = get_post( $args[0] );\n\t\t\tif ( ! $post ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( 'revision' === $post->post_type ) {\n\t\t\t\t$post = get_post( $post->post_parent );\n\t\t\t\tif ( ! $post ) {\n\t\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$post_type = get_post_type_object( $post->post_type );\n\t\t\tif ( ! $post_type ) {\n\t\t\t\t/* translators: 1: Post type, 2: Capability name. */\n\t\t\t\t_doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability \"%2$s\" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' );\n\t\t\t\t$caps[] = 'edit_others_posts';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( ! $post_type->map_meta_cap ) {\n\t\t\t\t$caps[] = $post_type->cap->$cap;\n\t\t\t\t// Prior to 3.1 we would re-call map_meta_cap here.\n\t\t\t\tif ( 'edit_post' === $cap ) {\n\t\t\t\t\t$cap = $post_type->cap->$cap;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// If the post author is set and the user is the author...\n\t\t\tif ( $post->post_author && $user_id == $post->post_author ) {\n\t\t\t\t// If the post is published or scheduled...\n\t\t\t\tif ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) {\n\t\t\t\t\t$caps[] = $post_type->cap->edit_published_posts;\n\t\t\t\t} elseif ( 'trash' === $post->post_status ) {\n\t\t\t\t\t$status = get_post_meta( $post->ID, '_wp_trash_meta_status', true );\n\t\t\t\t\tif ( in_array( $status, array( 'publish', 'future' ), true ) ) {\n\t\t\t\t\t\t$caps[] = $post_type->cap->edit_published_posts;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$caps[] = $post_type->cap->edit_posts;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// If the post is draft...\n\t\t\t\t\t$caps[] = $post_type->cap->edit_posts;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// The user is trying to edit someone else's post.\n\t\t\t\t$caps[] = $post_type->cap->edit_others_posts;\n\t\t\t\t// The post is published or scheduled, extra cap required.\n\t\t\t\tif ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) {\n\t\t\t\t\t$caps[] = $post_type->cap->edit_published_posts;\n\t\t\t\t} elseif ( 'private' === $post->post_status ) {\n\t\t\t\t\t$caps[] = $post_type->cap->edit_private_posts;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Setting the privacy policy page requires `manage_privacy_options`,\n\t\t\t * so editing it should require that too.\n\t\t\t */\n\t\t\tif ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post->ID ) {\n\t\t\t\t$caps = array_merge( $caps, map_meta_cap( 'manage_privacy_options', $user_id ) );\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase 'read_post':\n\t\tcase 'read_page':\n\t\t\t$post = get_post( $args[0] );\n\t\t\tif ( ! $post ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( 'revision' === $post->post_type ) {\n\t\t\t\t$post = get_post( $post->post_parent );\n\t\t\t\tif ( ! $post ) {\n\t\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$post_type = get_post_type_object( $post->post_type );\n\t\t\tif ( ! $post_type ) {\n\t\t\t\t/* translators: 1: Post type, 2: Capability name. */\n\t\t\t\t_doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability \"%2$s\" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' );\n\t\t\t\t$caps[] = 'edit_others_posts';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( ! $post_type->map_meta_cap ) {\n\t\t\t\t$caps[] = $post_type->cap->$cap;\n\t\t\t\t// Prior to 3.1 we would re-call map_meta_cap here.\n\t\t\t\tif ( 'read_post' === $cap ) {\n\t\t\t\t\t$cap = $post_type->cap->$cap;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$status_obj = get_post_status_object( $post->post_status );\n\t\t\tif ( ! $status_obj ) {\n\t\t\t\t/* translators: 1: Post status, 2: Capability name. */\n\t\t\t\t_doing_it_wrong( __FUNCTION__, sprintf( __( 'The post status %1$s is not registered, so it may not be reliable to check the capability \"%2$s\" against a post with that status.' ), $post->post_status, $cap ), '5.4.0' );\n\t\t\t\t$caps[] = 'edit_others_posts';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( $status_obj->public ) {\n\t\t\t\t$caps[] = $post_type->cap->read;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( $post->post_author && $user_id == $post->post_author ) {\n\t\t\t\t$caps[] = $post_type->cap->read;\n\t\t\t} elseif ( $status_obj->private ) {\n\t\t\t\t$caps[] = $post_type->cap->read_private_posts;\n\t\t\t} else {\n\t\t\t\t$caps = map_meta_cap( 'edit_post', $user_id, $post->ID );\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'publish_post':\n\t\t\t$post = get_post( $args[0] );\n\t\t\tif ( ! $post ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$post_type = get_post_type_object( $post->post_type );\n\t\t\tif ( ! $post_type ) {\n\t\t\t\t/* translators: 1: Post type, 2: Capability name. */\n\t\t\t\t_doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability \"%2$s\" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' );\n\t\t\t\t$caps[] = 'edit_others_posts';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$caps[] = $post_type->cap->publish_posts;\n\t\t\tbreak;\n\t\tcase 'edit_post_meta':\n\t\tcase 'delete_post_meta':\n\t\tcase 'add_post_meta':\n\t\tcase 'edit_comment_meta':\n\t\tcase 'delete_comment_meta':\n\t\tcase 'add_comment_meta':\n\t\tcase 'edit_term_meta':\n\t\tcase 'delete_term_meta':\n\t\tcase 'add_term_meta':\n\t\tcase 'edit_user_meta':\n\t\tcase 'delete_user_meta':\n\t\tcase 'add_user_meta':\n\t\t\t$object_type = explode( '_', $cap )[1];\n\t\t\t$object_id   = (int) $args[0];\n\n\t\t\t$object_subtype = get_object_subtype( $object_type, $object_id );\n\n\t\t\tif ( empty( $object_subtype ) ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$caps = map_meta_cap( \"edit_{$object_type}\", $user_id, $object_id );\n\n\t\t\t$meta_key = isset( $args[1] ) ? $args[1] : false;\n\n\t\t\tif ( $meta_key ) {\n\t\t\t\t$allowed = ! is_protected_meta( $meta_key, $object_type );\n\n\t\t\t\tif ( ! empty( $object_subtype ) && has_filter( \"auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}\" ) ) {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters whether the user is allowed to edit a specific meta key of a specific object type and subtype.\n\t\t\t\t\t *\n\t\t\t\t\t * The dynamic portions of the hook name, `$object_type`, `$meta_key`,\n\t\t\t\t\t * and `$object_subtype`, refer to the metadata object type (comment, post, term or user),\n\t\t\t\t\t * the meta key value, and the object subtype respectively.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 4.9.8\n\t\t\t\t\t *\n\t\t\t\t\t * @param bool     $allowed   Whether the user can add the object meta. Default false.\n\t\t\t\t\t * @param string   $meta_key  The meta key.\n\t\t\t\t\t * @param int      $object_id Object ID.\n\t\t\t\t\t * @param int      $user_id   User ID.\n\t\t\t\t\t * @param string   $cap       Capability name.\n\t\t\t\t\t * @param string[] $caps      Array of the user's capabilities.\n\t\t\t\t\t */\n\t\t\t\t\t$allowed = apply_filters( \"auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}\", $allowed, $meta_key, $object_id, $user_id, $cap, $caps );\n\t\t\t\t} else {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters whether the user is allowed to edit a specific meta key of a specific object type.\n\t\t\t\t\t *\n\t\t\t\t\t * Return true to have the mapped meta caps from `edit_{$object_type}` apply.\n\t\t\t\t\t *\n\t\t\t\t\t * The dynamic portion of the hook name, `$object_type` refers to the object type being filtered.\n\t\t\t\t\t * The dynamic portion of the hook name, `$meta_key`, refers to the meta key passed to map_meta_cap().\n\t\t\t\t\t *\n\t\t\t\t\t * @since 3.3.0 As `auth_post_meta_{$meta_key}`.\n\t\t\t\t\t * @since 4.6.0\n\t\t\t\t\t *\n\t\t\t\t\t * @param bool     $allowed   Whether the user can add the object meta. Default false.\n\t\t\t\t\t * @param string   $meta_key  The meta key.\n\t\t\t\t\t * @param int      $object_id Object ID.\n\t\t\t\t\t * @param int      $user_id   User ID.\n\t\t\t\t\t * @param string   $cap       Capability name.\n\t\t\t\t\t * @param string[] $caps      Array of the user's capabilities.\n\t\t\t\t\t */\n\t\t\t\t\t$allowed = apply_filters( \"auth_{$object_type}_meta_{$meta_key}\", $allowed, $meta_key, $object_id, $user_id, $cap, $caps );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $object_subtype ) ) {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters whether the user is allowed to edit meta for specific object types/subtypes.\n\t\t\t\t\t *\n\t\t\t\t\t * Return true to have the mapped meta caps from `edit_{$object_type}` apply.\n\t\t\t\t\t *\n\t\t\t\t\t * The dynamic portion of the hook name, `$object_type` refers to the object type being filtered.\n\t\t\t\t\t * The dynamic portion of the hook name, `$object_subtype` refers to the object subtype being filtered.\n\t\t\t\t\t * The dynamic portion of the hook name, `$meta_key`, refers to the meta key passed to map_meta_cap().\n\t\t\t\t\t *\n\t\t\t\t\t * @since 4.6.0 As `auth_post_{$post_type}_meta_{$meta_key}`.\n\t\t\t\t\t * @since 4.7.0 Renamed from `auth_post_{$post_type}_meta_{$meta_key}` to\n\t\t\t\t\t *              `auth_{$object_type}_{$object_subtype}_meta_{$meta_key}`.\n\t\t\t\t\t * @deprecated 4.9.8 Use {@see 'auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}'} instead.\n\t\t\t\t\t *\n\t\t\t\t\t * @param bool     $allowed   Whether the user can add the object meta. Default false.\n\t\t\t\t\t * @param string   $meta_key  The meta key.\n\t\t\t\t\t * @param int      $object_id Object ID.\n\t\t\t\t\t * @param int      $user_id   User ID.\n\t\t\t\t\t * @param string   $cap       Capability name.\n\t\t\t\t\t * @param string[] $caps      Array of the user's capabilities.\n\t\t\t\t\t */\n\t\t\t\t\t$allowed = apply_filters_deprecated(\n\t\t\t\t\t\t\"auth_{$object_type}_{$object_subtype}_meta_{$meta_key}\",\n\t\t\t\t\t\tarray( $allowed, $meta_key, $object_id, $user_id, $cap, $caps ),\n\t\t\t\t\t\t'4.9.8',\n\t\t\t\t\t\t\"auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}\"\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( ! $allowed ) {\n\t\t\t\t\t$caps[] = $cap;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'edit_comment':\n\t\t\t$comment = get_comment( $args[0] );\n\t\t\tif ( ! $comment ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$post = get_post( $comment->comment_post_ID );\n\n\t\t\t/*\n\t\t\t * If the post doesn't exist, we have an orphaned comment.\n\t\t\t * Fall back to the edit_posts capability, instead.\n\t\t\t */\n\t\t\tif ( $post ) {\n\t\t\t\t$caps = map_meta_cap( 'edit_post', $user_id, $post->ID );\n\t\t\t} else {\n\t\t\t\t$caps = map_meta_cap( 'edit_posts', $user_id );\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'unfiltered_upload':\n\t\t\tif ( defined( 'ALLOW_UNFILTERED_UPLOADS' ) && ALLOW_UNFILTERED_UPLOADS && ( ! is_multisite() || is_super_admin( $user_id ) ) ) {\n\t\t\t\t$caps[] = $cap;\n\t\t\t} else {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'edit_css':\n\t\tcase 'unfiltered_html':\n\t\t\t// Disallow unfiltered_html for all users, even admins and super admins.\n\t\t\tif ( defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t} elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t} else {\n\t\t\t\t$caps[] = 'unfiltered_html';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'edit_files':\n\t\tcase 'edit_plugins':\n\t\tcase 'edit_themes':\n\t\t\t// Disallow the file editors.\n\t\t\tif ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t} elseif ( ! wp_is_file_mod_allowed( 'capability_edit_themes' ) ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t} elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t} else {\n\t\t\t\t$caps[] = $cap;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'update_plugins':\n\t\tcase 'delete_plugins':\n\t\tcase 'install_plugins':\n\t\tcase 'upload_plugins':\n\t\tcase 'update_themes':\n\t\tcase 'delete_themes':\n\t\tcase 'install_themes':\n\t\tcase 'upload_themes':\n\t\tcase 'update_core':\n\t\t\t// Disallow anything that creates, deletes, or updates core, plugin, or theme files.\n\t\t\t// Files in uploads are excepted.\n\t\t\tif ( ! wp_is_file_mod_allowed( 'capability_update_core' ) ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t} elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t} elseif ( 'upload_themes' === $cap ) {\n\t\t\t\t$caps[] = 'install_themes';\n\t\t\t} elseif ( 'upload_plugins' === $cap ) {\n\t\t\t\t$caps[] = 'install_plugins';\n\t\t\t} else {\n\t\t\t\t$caps[] = $cap;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'install_languages':\n\t\tcase 'update_languages':\n\t\t\tif ( ! wp_is_file_mod_allowed( 'can_install_language_pack' ) ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t} elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t} else {\n\t\t\t\t$caps[] = 'install_languages';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'activate_plugins':\n\t\tcase 'deactivate_plugins':\n\t\tcase 'activate_plugin':\n\t\tcase 'deactivate_plugin':\n\t\t\t$caps[] = 'activate_plugins';\n\t\t\tif ( is_multisite() ) {\n\t\t\t\t// update_, install_, and delete_ are handled above with is_super_admin().\n\t\t\t\t$menu_perms = get_site_option( 'menu_items', array() );\n\t\t\t\tif ( empty( $menu_perms['plugins'] ) ) {\n\t\t\t\t\t$caps[] = 'manage_network_plugins';\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'resume_plugin':\n\t\t\t$caps[] = 'resume_plugins';\n\t\t\tbreak;\n\t\tcase 'resume_theme':\n\t\t\t$caps[] = 'resume_themes';\n\t\t\tbreak;\n\t\tcase 'delete_user':\n\t\tcase 'delete_users':\n\t\t\t// If multisite only super admins can delete users.\n\t\t\tif ( is_multisite() && ! is_super_admin( $user_id ) ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t} else {\n\t\t\t\t$caps[] = 'delete_users'; // delete_user maps to delete_users.\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'create_users':\n\t\t\tif ( ! is_multisite() ) {\n\t\t\t\t$caps[] = $cap;\n\t\t\t} elseif ( is_super_admin( $user_id ) || get_site_option( 'add_new_users' ) ) {\n\t\t\t\t$caps[] = $cap;\n\t\t\t} else {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'manage_links':\n\t\t\tif ( get_option( 'link_manager_enabled' ) ) {\n\t\t\t\t$caps[] = $cap;\n\t\t\t} else {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'customize':\n\t\t\t$caps[] = 'edit_theme_options';\n\t\t\tbreak;\n\t\tcase 'delete_site':\n\t\t\tif ( is_multisite() ) {\n\t\t\t\t$caps[] = 'manage_options';\n\t\t\t} else {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'edit_term':\n\t\tcase 'delete_term':\n\t\tcase 'assign_term':\n\t\t\t$term_id = (int) $args[0];\n\t\t\t$term    = get_term( $term_id );\n\t\t\tif ( ! $term || is_wp_error( $term ) ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$tax = get_taxonomy( $term->taxonomy );\n\t\t\tif ( ! $tax ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( 'delete_term' === $cap\n\t\t\t\t&& ( get_option( 'default_' . $term->taxonomy ) == $term->term_id\n\t\t\t\t\t|| get_option( 'default_term_' . $term->taxonomy ) == $term->term_id )\n\t\t\t) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$taxo_cap = $cap . 's';\n\n\t\t\t$caps = map_meta_cap( $tax->cap->$taxo_cap, $user_id, $term_id );\n\n\t\t\tbreak;\n\t\tcase 'manage_post_tags':\n\t\tcase 'edit_categories':\n\t\tcase 'edit_post_tags':\n\t\tcase 'delete_categories':\n\t\tcase 'delete_post_tags':\n\t\t\t$caps[] = 'manage_categories';\n\t\t\tbreak;\n\t\tcase 'assign_categories':\n\t\tcase 'assign_post_tags':\n\t\t\t$caps[] = 'edit_posts';\n\t\t\tbreak;\n\t\tcase 'create_sites':\n\t\tcase 'delete_sites':\n\t\tcase 'manage_network':\n\t\tcase 'manage_sites':\n\t\tcase 'manage_network_users':\n\t\tcase 'manage_network_plugins':\n\t\tcase 'manage_network_themes':\n\t\tcase 'manage_network_options':\n\t\tcase 'upgrade_network':\n\t\t\t$caps[] = $cap;\n\t\t\tbreak;\n\t\tcase 'setup_network':\n\t\t\tif ( is_multisite() ) {\n\t\t\t\t$caps[] = 'manage_network_options';\n\t\t\t} else {\n\t\t\t\t$caps[] = 'manage_options';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'update_php':\n\t\t\tif ( is_multisite() && ! is_super_admin( $user_id ) ) {\n\t\t\t\t$caps[] = 'do_not_allow';\n\t\t\t} else {\n\t\t\t\t$caps[] = 'update_core';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'export_others_personal_data':\n\t\tcase 'erase_others_personal_data':\n\t\tcase 'manage_privacy_options':\n\t\t\t$caps[] = is_multisite() ? 'manage_network' : 'manage_options';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// Handle meta capabilities for custom post types.\n\t\t\tglobal $post_type_meta_caps;\n\t\t\tif ( isset( $post_type_meta_caps[ $cap ] ) ) {\n\t\t\t\treturn map_meta_cap( $post_type_meta_caps[ $cap ], $user_id, ...$args );\n\t\t\t}\n\n\t\t\t// Block capabilities map to their post equivalent.\n\t\t\t$block_caps = array(\n\t\t\t\t'edit_blocks',\n\t\t\t\t'edit_others_blocks',\n\t\t\t\t'publish_blocks',\n\t\t\t\t'read_private_blocks',\n\t\t\t\t'delete_blocks',\n\t\t\t\t'delete_private_blocks',\n\t\t\t\t'delete_published_blocks',\n\t\t\t\t'delete_others_blocks',\n\t\t\t\t'edit_private_blocks',\n\t\t\t\t'edit_published_blocks',\n\t\t\t);\n\t\t\tif ( in_array( $cap, $block_caps, true ) ) {\n\t\t\t\t$cap = str_replace( '_blocks', '_posts', $cap );\n\t\t\t}\n\n\t\t\t// If no meta caps match, return the original cap.\n\t\t\t$caps[] = $cap;\n\t}\n\n\t/**\n\t * Filters a user's capabilities depending on specific context and/or privilege.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string[] $caps    Array of the user's capabilities.\n\t * @param string   $cap     Capability name.\n\t * @param int      $user_id The user ID.\n\t * @param array    $args    Adds the context to the cap. Typically the object ID.\n\t */\n\treturn apply_filters( 'map_meta_cap', $caps, $cap, $user_id, $args );\n}\n\n/**\n * Returns whether the current user has the specified capability.\n *\n * This function also accepts an ID of an object to check against if the capability is a meta capability. Meta\n * capabilities such as `edit_post` and `edit_user` are capabilities used by the `map_meta_cap()` function to\n * map to primitive capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`.\n *\n * Example usage:\n *\n *     current_user_can( 'edit_posts' );\n *     current_user_can( 'edit_post', $post->ID );\n *     current_user_can( 'edit_post_meta', $post->ID, $meta_key );\n *\n * While checking against particular roles in place of a capability is supported\n * in part, this practice is discouraged as it may produce unreliable results.\n *\n * Note: Will always return true if the current user is a super admin, unless specifically denied.\n *\n * @since 2.0.0\n * @since 5.3.0 Formalized the existing and already documented `...$args` parameter\n *              by adding it to the function signature.\n *\n * @see WP_User::has_cap()\n * @see map_meta_cap()\n *\n * @param string $capability Capability name.\n * @param mixed  ...$args    Optional further parameters, typically starting with an object ID.\n * @return bool Whether the current user has the given capability. If `$capability` is a meta cap and `$object_id` is\n *              passed, whether the current user has the given meta capability for the given object.\n */\nfunction current_user_can( $capability, ...$args ) {\n\t$current_user = wp_get_current_user();\n\n\tif ( empty( $current_user ) ) {\n\t\treturn false;\n\t}\n\n\treturn $current_user->has_cap( $capability, ...$args );\n}\n\n/**\n * Returns whether the current user has the specified capability for a given site.\n *\n * This function also accepts an ID of an object to check against if the capability is a meta capability. Meta\n * capabilities such as `edit_post` and `edit_user` are capabilities used by the `map_meta_cap()` function to\n * map to primitive capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`.\n *\n * Example usage:\n *\n *     current_user_can_for_blog( $blog_id, 'edit_posts' );\n *     current_user_can_for_blog( $blog_id, 'edit_post', $post->ID );\n *     current_user_can_for_blog( $blog_id, 'edit_post_meta', $post->ID, $meta_key );\n *\n * @since 3.0.0\n * @since 5.3.0 Formalized the existing and already documented `...$args` parameter\n *              by adding it to the function signature.\n *\n * @param int    $blog_id    Site ID.\n * @param string $capability Capability name.\n * @param mixed  ...$args    Optional further parameters, typically starting with an object ID.\n * @return bool Whether the user has the given capability.\n */\nfunction current_user_can_for_blog( $blog_id, $capability, ...$args ) {\n\t$switched = is_multisite() ? switch_to_blog( $blog_id ) : false;\n\n\t$current_user = wp_get_current_user();\n\n\tif ( empty( $current_user ) ) {\n\t\tif ( $switched ) {\n\t\t\trestore_current_blog();\n\t\t}\n\t\treturn false;\n\t}\n\n\t$can = $current_user->has_cap( $capability, ...$args );\n\n\tif ( $switched ) {\n\t\trestore_current_blog();\n\t}\n\n\treturn $can;\n}\n\n/**\n * Returns whether the author of the supplied post has the specified capability.\n *\n * This function also accepts an ID of an object to check against if the capability is a meta capability. Meta\n * capabilities such as `edit_post` and `edit_user` are capabilities used by the `map_meta_cap()` function to\n * map to primitive capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`.\n *\n * Example usage:\n *\n *     author_can( $post, 'edit_posts' );\n *     author_can( $post, 'edit_post', $post->ID );\n *     author_can( $post, 'edit_post_meta', $post->ID, $meta_key );\n *\n * @since 2.9.0\n * @since 5.3.0 Formalized the existing and already documented `...$args` parameter\n *              by adding it to the function signature.\n *\n * @param int|WP_Post $post       Post ID or post object.\n * @param string      $capability Capability name.\n * @param mixed       ...$args    Optional further parameters, typically starting with an object ID.\n * @return bool Whether the post author has the given capability.\n */\nfunction author_can( $post, $capability, ...$args ) {\n\t$post = get_post( $post );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$author = get_userdata( $post->post_author );\n\n\tif ( ! $author ) {\n\t\treturn false;\n\t}\n\n\treturn $author->has_cap( $capability, ...$args );\n}\n\n/**\n * Returns whether a particular user has the specified capability.\n *\n * This function also accepts an ID of an object to check against if the capability is a meta capability. Meta\n * capabilities such as `edit_post` and `edit_user` are capabilities used by the `map_meta_cap()` function to\n * map to primitive capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`.\n *\n * Example usage:\n *\n *     user_can( $user->ID, 'edit_posts' );\n *     user_can( $user->ID, 'edit_post', $post->ID );\n *     user_can( $user->ID, 'edit_post_meta', $post->ID, $meta_key );\n *\n * @since 3.1.0\n * @since 5.3.0 Formalized the existing and already documented `...$args` parameter\n *              by adding it to the function signature.\n *\n * @param int|WP_User $user       User ID or object.\n * @param string      $capability Capability name.\n * @param mixed       ...$args    Optional further parameters, typically starting with an object ID.\n * @return bool Whether the user has the given capability.\n */\nfunction user_can( $user, $capability, ...$args ) {\n\tif ( ! is_object( $user ) ) {\n\t\t$user = get_userdata( $user );\n\t}\n\n\tif ( ! $user || ! $user->exists() ) {\n\t\treturn false;\n\t}\n\n\treturn $user->has_cap( $capability, ...$args );\n}\n\n/**\n * Retrieves the global WP_Roles instance and instantiates it if necessary.\n *\n * @since 4.3.0\n *\n * @global WP_Roles $wp_roles WordPress role management object.\n *\n * @return WP_Roles WP_Roles global instance if not already instantiated.\n */\nfunction wp_roles() {\n\tglobal $wp_roles;\n\n\tif ( ! isset( $wp_roles ) ) {\n\t\t$wp_roles = new WP_Roles();\n\t}\n\treturn $wp_roles;\n}\n\n/**\n * Retrieve role object.\n *\n * @since 2.0.0\n *\n * @param string $role Role name.\n * @return WP_Role|null WP_Role object if found, null if the role does not exist.\n */\nfunction get_role( $role ) {\n\treturn wp_roles()->get_role( $role );\n}\n\n/**\n * Add role, if it does not exist.\n *\n * @since 2.0.0\n *\n * @param string $role         Role name.\n * @param string $display_name Display name for role.\n * @param bool[] $capabilities List of capabilities keyed by the capability name,\n *                             e.g. array( 'edit_posts' => true, 'delete_posts' => false ).\n * @return WP_Role|null WP_Role object if role is added, null if already exists.\n */\nfunction add_role( $role, $display_name, $capabilities = array() ) {\n\tif ( empty( $role ) ) {\n\t\treturn;\n\t}\n\treturn wp_roles()->add_role( $role, $display_name, $capabilities );\n}\n\n/**\n * Remove role, if it exists.\n *\n * @since 2.0.0\n *\n * @param string $role Role name.\n */\nfunction remove_role( $role ) {\n\twp_roles()->remove_role( $role );\n}\n\n/**\n * Retrieve a list of super admins.\n *\n * @since 3.0.0\n *\n * @global array $super_admins\n *\n * @return string[] List of super admin logins.\n */\nfunction get_super_admins() {\n\tglobal $super_admins;\n\n\tif ( isset( $super_admins ) ) {\n\t\treturn $super_admins;\n\t} else {\n\t\treturn get_site_option( 'site_admins', array( 'admin' ) );\n\t}\n}\n\n/**\n * Determine if user is a site admin.\n *\n * @since 3.0.0\n *\n * @param int $user_id (Optional) The ID of a user. Defaults to the current user.\n * @return bool True if the user is a site admin.\n */\nfunction is_super_admin( $user_id = false ) {\n\tif ( ! $user_id || get_current_user_id() == $user_id ) {\n\t\t$user = wp_get_current_user();\n\t} else {\n\t\t$user = get_userdata( $user_id );\n\t}\n\n\tif ( ! $user || ! $user->exists() ) {\n\t\treturn false;\n\t}\n\n\tif ( is_multisite() ) {\n\t\t$super_admins = get_super_admins();\n\t\tif ( is_array( $super_admins ) && in_array( $user->user_login, $super_admins, true ) ) {\n\t\t\treturn true;\n\t\t}\n\t} else {\n\t\tif ( $user->has_cap( 'delete_users' ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Grants Super Admin privileges.\n *\n * @since 3.0.0\n *\n * @global array $super_admins\n *\n * @param int $user_id ID of the user to be granted Super Admin privileges.\n * @return bool True on success, false on failure. This can fail when the user is\n *              already a super admin or when the `$super_admins` global is defined.\n */\nfunction grant_super_admin( $user_id ) {\n\t// If global super_admins override is defined, there is nothing to do here.\n\tif ( isset( $GLOBALS['super_admins'] ) || ! is_multisite() ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Fires before the user is granted Super Admin privileges.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param int $user_id ID of the user that is about to be granted Super Admin privileges.\n\t */\n\tdo_action( 'grant_super_admin', $user_id );\n\n\t// Directly fetch site_admins instead of using get_super_admins().\n\t$super_admins = get_site_option( 'site_admins', array( 'admin' ) );\n\n\t$user = get_userdata( $user_id );\n\tif ( $user && ! in_array( $user->user_login, $super_admins, true ) ) {\n\t\t$super_admins[] = $user->user_login;\n\t\tupdate_site_option( 'site_admins', $super_admins );\n\n\t\t/**\n\t\t * Fires after the user is granted Super Admin privileges.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param int $user_id ID of the user that was granted Super Admin privileges.\n\t\t */\n\t\tdo_action( 'granted_super_admin', $user_id );\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Revokes Super Admin privileges.\n *\n * @since 3.0.0\n *\n * @global array $super_admins\n *\n * @param int $user_id ID of the user Super Admin privileges to be revoked from.\n * @return bool True on success, false on failure. This can fail when the user's email\n *              is the network admin email or when the `$super_admins` global is defined.\n */\nfunction revoke_super_admin( $user_id ) {\n\t// If global super_admins override is defined, there is nothing to do here.\n\tif ( isset( $GLOBALS['super_admins'] ) || ! is_multisite() ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Fires before the user's Super Admin privileges are revoked.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param int $user_id ID of the user Super Admin privileges are being revoked from.\n\t */\n\tdo_action( 'revoke_super_admin', $user_id );\n\n\t// Directly fetch site_admins instead of using get_super_admins().\n\t$super_admins = get_site_option( 'site_admins', array( 'admin' ) );\n\n\t$user = get_userdata( $user_id );\n\tif ( $user && 0 !== strcasecmp( $user->user_email, get_site_option( 'admin_email' ) ) ) {\n\t\t$key = array_search( $user->user_login, $super_admins, true );\n\t\tif ( false !== $key ) {\n\t\t\tunset( $super_admins[ $key ] );\n\t\t\tupdate_site_option( 'site_admins', $super_admins );\n\n\t\t\t/**\n\t\t\t * Fires after the user's Super Admin privileges are revoked.\n\t\t\t *\n\t\t\t * @since 3.0.0\n\t\t\t *\n\t\t\t * @param int $user_id ID of the user Super Admin privileges were revoked from.\n\t\t\t */\n\t\t\tdo_action( 'revoked_super_admin', $user_id );\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Filters the user capabilities to grant the 'install_languages' capability as necessary.\n *\n * A user must have at least one out of the 'update_core', 'install_plugins', and\n * 'install_themes' capabilities to qualify for 'install_languages'.\n *\n * @since 4.9.0\n *\n * @param bool[] $allcaps An array of all the user's capabilities.\n * @return bool[] Filtered array of the user's capabilities.\n */\nfunction wp_maybe_grant_install_languages_cap( $allcaps ) {\n\tif ( ! empty( $allcaps['update_core'] ) || ! empty( $allcaps['install_plugins'] ) || ! empty( $allcaps['install_themes'] ) ) {\n\t\t$allcaps['install_languages'] = true;\n\t}\n\n\treturn $allcaps;\n}\n\n/**\n * Filters the user capabilities to grant the 'resume_plugins' and 'resume_themes' capabilities as necessary.\n *\n * @since 5.2.0\n *\n * @param bool[] $allcaps An array of all the user's capabilities.\n * @return bool[] Filtered array of the user's capabilities.\n */\nfunction wp_maybe_grant_resume_extensions_caps( $allcaps ) {\n\t// Even in a multisite, regular administrators should be able to resume plugins.\n\tif ( ! empty( $allcaps['activate_plugins'] ) ) {\n\t\t$allcaps['resume_plugins'] = true;\n\t}\n\n\t// Even in a multisite, regular administrators should be able to resume themes.\n\tif ( ! empty( $allcaps['switch_themes'] ) ) {\n\t\t$allcaps['resume_themes'] = true;\n\t}\n\n\treturn $allcaps;\n}\n\n/**\n * Filters the user capabilities to grant the 'view_site_health_checks' capabilities as necessary.\n *\n * @since 5.2.2\n *\n * @param bool[]   $allcaps An array of all the user's capabilities.\n * @param string[] $caps    Required primitive capabilities for the requested capability.\n * @param array    $args {\n *     Arguments that accompany the requested capability check.\n *\n *     @type string    $0 Requested capability.\n *     @type int       $1 Concerned user ID.\n *     @type mixed  ...$2 Optional second and further parameters, typically object ID.\n * }\n * @param WP_User  $user    The user object.\n * @return bool[] Filtered array of the user's capabilities.\n */\nfunction wp_maybe_grant_site_health_caps( $allcaps, $caps, $args, $user ) {\n\tif ( ! empty( $allcaps['install_plugins'] ) && ( ! is_multisite() || is_super_admin( $user->ID ) ) ) {\n\t\t$allcaps['view_site_health_checks'] = true;\n\t}\n\n\treturn $allcaps;\n}\n\nreturn;\n\n// Dummy gettext calls to get strings in the catalog.\n/* translators: User role for administrators. */\n_x( 'Administrator', 'User role' );\n/* translators: User role for editors. */\n_x( 'Editor', 'User role' );\n/* translators: User role for authors. */\n_x( 'Author', 'User role' );\n/* translators: User role for contributors. */\n_x( 'Contributor', 'User role' );\n/* translators: User role for subscribers. */\n_x( 'Subscriber', 'User role' );\n", "num_lines": 1078}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Taxonomy API: Core category-specific template tags\n *\n * @package WordPress\n * @subpackage Template\n * @since 1.2.0\n */\n\n/**\n * Retrieves category link URL.\n *\n * @since 1.0.0\n *\n * @see get_term_link()\n *\n * @param int|object $category Category ID or object.\n * @return string Link on success, empty string if category does not exist.\n */\nfunction get_category_link( $category ) {\n\tif ( ! is_object( $category ) ) {\n\t\t$category = (int) $category;\n\t}\n\n\t$category = get_term_link( $category );\n\n\tif ( is_wp_error( $category ) ) {\n\t\treturn '';\n\t}\n\n\treturn $category;\n}\n\n/**\n * Retrieves category parents with separator.\n *\n * @since 1.2.0\n * @since 4.8.0 The `$visited` parameter was deprecated and renamed to `$deprecated`.\n *\n * @param int    $category_id Category ID.\n * @param bool   $link        Optional. Whether to format with link. Default false.\n * @param string $separator   Optional. How to separate categories. Default '/'.\n * @param bool   $nicename    Optional. Whether to use nice name for display. Default false.\n * @param array  $deprecated  Not used.\n * @return string|WP_Error A list of category parents on success, WP_Error on failure.\n */\nfunction get_category_parents( $category_id, $link = false, $separator = '/', $nicename = false, $deprecated = array() ) {\n\n\tif ( ! empty( $deprecated ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '4.8.0' );\n\t}\n\n\t$format = $nicename ? 'slug' : 'name';\n\n\t$args = array(\n\t\t'separator' => $separator,\n\t\t'link'      => $link,\n\t\t'format'    => $format,\n\t);\n\n\treturn get_term_parents_list( $category_id, 'category', $args );\n}\n\n/**\n * Retrieves post categories.\n *\n * This tag may be used outside The Loop by passing a post ID as the parameter.\n *\n * Note: This function only returns results from the default \"category\" taxonomy.\n * For custom taxonomies use get_the_terms().\n *\n * @since 0.71\n *\n * @param int $post_id Optional. The post ID. Defaults to current post ID.\n * @return WP_Term[] Array of WP_Term objects, one for each category assigned to the post.\n */\nfunction get_the_category( $post_id = false ) {\n\t$categories = get_the_terms( $post_id, 'category' );\n\tif ( ! $categories || is_wp_error( $categories ) ) {\n\t\t$categories = array();\n\t}\n\n\t$categories = array_values( $categories );\n\n\tforeach ( array_keys( $categories ) as $key ) {\n\t\t_make_cat_compat( $categories[ $key ] );\n\t}\n\n\t/**\n\t * Filters the array of categories to return for a post.\n\t *\n\t * @since 3.1.0\n\t * @since 4.4.0 Added `$post_id` parameter.\n\t *\n\t * @param WP_Term[] $categories An array of categories to return for the post.\n\t * @param int|false $post_id    ID of the post.\n\t */\n\treturn apply_filters( 'get_the_categories', $categories, $post_id );\n}\n\n/**\n * Retrieves category name based on category ID.\n *\n * @since 0.71\n *\n * @param int $cat_ID Category ID.\n * @return string|WP_Error Category name on success, WP_Error on failure.\n */\nfunction get_the_category_by_ID( $cat_ID ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid\n\t$cat_ID   = (int) $cat_ID;\n\t$category = get_term( $cat_ID );\n\n\tif ( is_wp_error( $category ) ) {\n\t\treturn $category;\n\t}\n\n\treturn ( $category ) ? $category->name : '';\n}\n\n/**\n * Retrieves category list for a post in either HTML list or custom format.\n *\n * Generally used for quick, delimited (e.g. comma-separated) lists of categories,\n * as part of a post entry meta.\n *\n * For a more powerful, list-based function, see wp_list_categories().\n *\n * @since 1.5.1\n *\n * @see wp_list_categories()\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string $separator Optional. Separator between the categories. By default, the links are placed\n *                          in an unordered list. An empty string will result in the default behavior.\n * @param string $parents   Optional. How to display the parents.\n * @param int    $post_id   Optional. Post ID to retrieve categories.\n * @return string Category list for a post.\n */\nfunction get_the_category_list( $separator = '', $parents = '', $post_id = false ) {\n\tglobal $wp_rewrite;\n\n\tif ( ! is_object_in_taxonomy( get_post_type( $post_id ), 'category' ) ) {\n\t\t/** This filter is documented in wp-includes/category-template.php */\n\t\treturn apply_filters( 'the_category', '', $separator, $parents );\n\t}\n\n\t/**\n\t * Filters the categories before building the category list.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param WP_Term[] $categories An array of the post's categories.\n\t * @param int|bool  $post_id    ID of the post we're retrieving categories for.\n\t *                              When `false`, we assume the current post in the loop.\n\t */\n\t$categories = apply_filters( 'the_category_list', get_the_category( $post_id ), $post_id );\n\n\tif ( empty( $categories ) ) {\n\t\t/** This filter is documented in wp-includes/category-template.php */\n\t\treturn apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents );\n\t}\n\n\t$rel = ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() ) ? 'rel=\"category tag\"' : 'rel=\"category\"';\n\n\t$thelist = '';\n\tif ( '' === $separator ) {\n\t\t$thelist .= '<ul class=\"post-categories\">';\n\t\tforeach ( $categories as $category ) {\n\t\t\t$thelist .= \"\\n\\t<li>\";\n\t\t\tswitch ( strtolower( $parents ) ) {\n\t\t\t\tcase 'multiple':\n\t\t\t\t\tif ( $category->parent ) {\n\t\t\t\t\t\t$thelist .= get_category_parents( $category->parent, true, $separator );\n\t\t\t\t\t}\n\t\t\t\t\t$thelist .= '<a href=\"' . esc_url( get_category_link( $category->term_id ) ) . '\" ' . $rel . '>' . $category->name . '</a></li>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'single':\n\t\t\t\t\t$thelist .= '<a href=\"' . esc_url( get_category_link( $category->term_id ) ) . '\"  ' . $rel . '>';\n\t\t\t\t\tif ( $category->parent ) {\n\t\t\t\t\t\t$thelist .= get_category_parents( $category->parent, false, $separator );\n\t\t\t\t\t}\n\t\t\t\t\t$thelist .= $category->name . '</a></li>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '':\n\t\t\t\tdefault:\n\t\t\t\t\t$thelist .= '<a href=\"' . esc_url( get_category_link( $category->term_id ) ) . '\" ' . $rel . '>' . $category->name . '</a></li>';\n\t\t\t}\n\t\t}\n\t\t$thelist .= '</ul>';\n\t} else {\n\t\t$i = 0;\n\t\tforeach ( $categories as $category ) {\n\t\t\tif ( 0 < $i ) {\n\t\t\t\t$thelist .= $separator;\n\t\t\t}\n\t\t\tswitch ( strtolower( $parents ) ) {\n\t\t\t\tcase 'multiple':\n\t\t\t\t\tif ( $category->parent ) {\n\t\t\t\t\t\t$thelist .= get_category_parents( $category->parent, true, $separator );\n\t\t\t\t\t}\n\t\t\t\t\t$thelist .= '<a href=\"' . esc_url( get_category_link( $category->term_id ) ) . '\" ' . $rel . '>' . $category->name . '</a>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'single':\n\t\t\t\t\t$thelist .= '<a href=\"' . esc_url( get_category_link( $category->term_id ) ) . '\" ' . $rel . '>';\n\t\t\t\t\tif ( $category->parent ) {\n\t\t\t\t\t\t$thelist .= get_category_parents( $category->parent, false, $separator );\n\t\t\t\t\t}\n\t\t\t\t\t$thelist .= \"$category->name</a>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '':\n\t\t\t\tdefault:\n\t\t\t\t\t$thelist .= '<a href=\"' . esc_url( get_category_link( $category->term_id ) ) . '\" ' . $rel . '>' . $category->name . '</a>';\n\t\t\t}\n\t\t\t++$i;\n\t\t}\n\t}\n\n\t/**\n\t * Filters the category or list of categories.\n\t *\n\t * @since 1.2.0\n\t *\n\t * @param string $thelist   List of categories for the current post.\n\t * @param string $separator Separator used between the categories.\n\t * @param string $parents   How to display the category parents. Accepts 'multiple',\n\t *                          'single', or empty.\n\t */\n\treturn apply_filters( 'the_category', $thelist, $separator, $parents );\n}\n\n/**\n * Checks if the current post is within any of the given categories.\n *\n * The given categories are checked against the post's categories' term_ids, names and slugs.\n * Categories given as integers will only be checked against the post's categories' term_ids.\n *\n * Prior to v2.5 of WordPress, category names were not supported.\n * Prior to v2.7, category slugs were not supported.\n * Prior to v2.7, only one category could be compared: in_category( $single_category ).\n * Prior to v2.7, this function could only be used in the WordPress Loop.\n * As of 2.7, the function can be used anywhere if it is provided a post ID or post object.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.2.0\n * @since 2.7.0 The `$post` parameter was added.\n *\n * @param int|string|array $category Category ID, name or slug, or array of said.\n * @param int|object       $post     Optional. Post to check instead of the current post.\n * @return bool True if the current post is in any of the given categories.\n */\nfunction in_category( $category, $post = null ) {\n\tif ( empty( $category ) ) {\n\t\treturn false;\n\t}\n\n\treturn has_category( $category, $post );\n}\n\n/**\n * Displays category list for a post in either HTML list or custom format.\n *\n * @since 0.71\n *\n * @param string $separator Optional. Separator between the categories. By default, the links are placed\n *                          in an unordered list. An empty string will result in the default behavior.\n * @param string $parents   Optional. How to display the parents.\n * @param int    $post_id   Optional. Post ID to retrieve categories.\n */\nfunction the_category( $separator = '', $parents = '', $post_id = false ) {\n\techo get_the_category_list( $separator, $parents, $post_id );\n}\n\n/**\n * Retrieves category description.\n *\n * @since 1.0.0\n *\n * @param int $category Optional. Category ID. Defaults to the current category ID.\n * @return string Category description, if available.\n */\nfunction category_description( $category = 0 ) {\n\treturn term_description( $category );\n}\n\n/**\n * Displays or retrieves the HTML dropdown list of categories.\n *\n * The 'hierarchical' argument, which is disabled by default, will override the\n * depth argument, unless it is true. When the argument is false, it will\n * display all of the categories. When it is enabled it will use the value in\n * the 'depth' argument.\n *\n * @since 2.1.0\n * @since 4.2.0 Introduced the `value_field` argument.\n * @since 4.6.0 Introduced the `required` argument.\n *\n * @param array|string $args {\n *     Optional. Array or string of arguments to generate a categories drop-down element. See WP_Term_Query::__construct()\n *     for information on additional accepted arguments.\n *\n *     @type string       $show_option_all   Text to display for showing all categories. Default empty.\n *     @type string       $show_option_none  Text to display for showing no categories. Default empty.\n *     @type string       $option_none_value Value to use when no category is selected. Default empty.\n *     @type string       $orderby           Which column to use for ordering categories. See get_terms() for a list\n *                                           of accepted values. Default 'id' (term_id).\n *     @type bool         $pad_counts        See get_terms() for an argument description. Default false.\n *     @type bool|int     $show_count        Whether to include post counts. Accepts 0, 1, or their bool equivalents.\n *                                           Default 0.\n *     @type bool|int     $echo              Whether to echo or return the generated markup. Accepts 0, 1, or their\n *                                           bool equivalents. Default 1.\n *     @type bool|int     $hierarchical      Whether to traverse the taxonomy hierarchy. Accepts 0, 1, or their bool\n *                                           equivalents. Default 0.\n *     @type int          $depth             Maximum depth. Default 0.\n *     @type int          $tab_index         Tab index for the select element. Default 0 (no tabindex).\n *     @type string       $name              Value for the 'name' attribute of the select element. Default 'cat'.\n *     @type string       $id                Value for the 'id' attribute of the select element. Defaults to the value\n *                                           of `$name`.\n *     @type string       $class             Value for the 'class' attribute of the select element. Default 'postform'.\n *     @type int|string   $selected          Value of the option that should be selected. Default 0.\n *     @type string       $value_field       Term field that should be used to populate the 'value' attribute\n *                                           of the option elements. Accepts any valid term field: 'term_id', 'name',\n *                                           'slug', 'term_group', 'term_taxonomy_id', 'taxonomy', 'description',\n *                                           'parent', 'count'. Default 'term_id'.\n *     @type string|array $taxonomy          Name of the category or categories to retrieve. Default 'category'.\n *     @type bool         $hide_if_empty     True to skip generating markup if no categories are found.\n *                                           Default false (create select element even if no categories are found).\n *     @type bool         $required          Whether the `<select>` element should have the HTML5 'required' attribute.\n *                                           Default false.\n * }\n * @return string HTML dropdown list of categories.\n */\nfunction wp_dropdown_categories( $args = '' ) {\n\t$defaults = array(\n\t\t'show_option_all'   => '',\n\t\t'show_option_none'  => '',\n\t\t'orderby'           => 'id',\n\t\t'order'             => 'ASC',\n\t\t'show_count'        => 0,\n\t\t'hide_empty'        => 1,\n\t\t'child_of'          => 0,\n\t\t'exclude'           => '',\n\t\t'echo'              => 1,\n\t\t'selected'          => 0,\n\t\t'hierarchical'      => 0,\n\t\t'name'              => 'cat',\n\t\t'id'                => '',\n\t\t'class'             => 'postform',\n\t\t'depth'             => 0,\n\t\t'tab_index'         => 0,\n\t\t'taxonomy'          => 'category',\n\t\t'hide_if_empty'     => false,\n\t\t'option_none_value' => -1,\n\t\t'value_field'       => 'term_id',\n\t\t'required'          => false,\n\t);\n\n\t$defaults['selected'] = ( is_category() ) ? get_query_var( 'cat' ) : 0;\n\n\t// Back compat.\n\tif ( isset( $args['type'] ) && 'link' === $args['type'] ) {\n\t\t_deprecated_argument(\n\t\t\t__FUNCTION__,\n\t\t\t'3.0.0',\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: \"type => link\", 2: \"taxonomy => link_category\" */\n\t\t\t\t__( '%1$s is deprecated. Use %2$s instead.' ),\n\t\t\t\t'<code>type => link</code>',\n\t\t\t\t'<code>taxonomy => link_category</code>'\n\t\t\t)\n\t\t);\n\t\t$args['taxonomy'] = 'link_category';\n\t}\n\n\t// Parse incoming $args into an array and merge it with $defaults.\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t$option_none_value = $parsed_args['option_none_value'];\n\n\tif ( ! isset( $parsed_args['pad_counts'] ) && $parsed_args['show_count'] && $parsed_args['hierarchical'] ) {\n\t\t$parsed_args['pad_counts'] = true;\n\t}\n\n\t$tab_index = $parsed_args['tab_index'];\n\n\t$tab_index_attribute = '';\n\tif ( (int) $tab_index > 0 ) {\n\t\t$tab_index_attribute = \" tabindex=\\\"$tab_index\\\"\";\n\t}\n\n\t// Avoid clashes with the 'name' param of get_terms().\n\t$get_terms_args = $parsed_args;\n\tunset( $get_terms_args['name'] );\n\t$categories = get_terms( $get_terms_args );\n\n\t$name     = esc_attr( $parsed_args['name'] );\n\t$class    = esc_attr( $parsed_args['class'] );\n\t$id       = $parsed_args['id'] ? esc_attr( $parsed_args['id'] ) : $name;\n\t$required = $parsed_args['required'] ? 'required' : '';\n\n\tif ( ! $parsed_args['hide_if_empty'] || ! empty( $categories ) ) {\n\t\t$output = \"<select $required name='$name' id='$id' class='$class' $tab_index_attribute>\\n\";\n\t} else {\n\t\t$output = '';\n\t}\n\tif ( empty( $categories ) && ! $parsed_args['hide_if_empty'] && ! empty( $parsed_args['show_option_none'] ) ) {\n\n\t\t/**\n\t\t * Filters a taxonomy drop-down display element.\n\t\t *\n\t\t * A variety of taxonomy drop-down display elements can be modified\n\t\t * just prior to display via this filter. Filterable arguments include\n\t\t * 'show_option_none', 'show_option_all', and various forms of the\n\t\t * term name.\n\t\t *\n\t\t * @since 1.2.0\n\t\t *\n\t\t * @see wp_dropdown_categories()\n\t\t *\n\t\t * @param string       $element  Category name.\n\t\t * @param WP_Term|null $category The category object, or null if there's no corresponding category.\n\t\t */\n\t\t$show_option_none = apply_filters( 'list_cats', $parsed_args['show_option_none'], null );\n\t\t$output          .= \"\\t<option value='\" . esc_attr( $option_none_value ) . \"' selected='selected'>$show_option_none</option>\\n\";\n\t}\n\n\tif ( ! empty( $categories ) ) {\n\n\t\tif ( $parsed_args['show_option_all'] ) {\n\n\t\t\t/** This filter is documented in wp-includes/category-template.php */\n\t\t\t$show_option_all = apply_filters( 'list_cats', $parsed_args['show_option_all'], null );\n\t\t\t$selected        = ( '0' === strval( $parsed_args['selected'] ) ) ? \" selected='selected'\" : '';\n\t\t\t$output         .= \"\\t<option value='0'$selected>$show_option_all</option>\\n\";\n\t\t}\n\n\t\tif ( $parsed_args['show_option_none'] ) {\n\n\t\t\t/** This filter is documented in wp-includes/category-template.php */\n\t\t\t$show_option_none = apply_filters( 'list_cats', $parsed_args['show_option_none'], null );\n\t\t\t$selected         = selected( $option_none_value, $parsed_args['selected'], false );\n\t\t\t$output          .= \"\\t<option value='\" . esc_attr( $option_none_value ) . \"'$selected>$show_option_none</option>\\n\";\n\t\t}\n\n\t\tif ( $parsed_args['hierarchical'] ) {\n\t\t\t$depth = $parsed_args['depth'];  // Walk the full depth.\n\t\t} else {\n\t\t\t$depth = -1; // Flat.\n\t\t}\n\t\t$output .= walk_category_dropdown_tree( $categories, $depth, $parsed_args );\n\t}\n\n\tif ( ! $parsed_args['hide_if_empty'] || ! empty( $categories ) ) {\n\t\t$output .= \"</select>\\n\";\n\t}\n\n\t/**\n\t * Filters the taxonomy drop-down output.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $output      HTML output.\n\t * @param array  $parsed_args Arguments used to build the drop-down.\n\t */\n\t$output = apply_filters( 'wp_dropdown_cats', $output, $parsed_args );\n\n\tif ( $parsed_args['echo'] ) {\n\t\techo $output;\n\t}\n\n\treturn $output;\n}\n\n/**\n * Displays or retrieves the HTML list of categories.\n *\n * @since 2.1.0\n * @since 4.4.0 Introduced the `hide_title_if_empty` and `separator` arguments.\n * @since 4.4.0 The `current_category` argument was modified to optionally accept an array of values.\n *\n * @param array|string $args {\n *     Array of optional arguments. See get_categories(), get_terms(), and WP_Term_Query::__construct()\n *     for information on additional accepted arguments.\n *\n *     @type int|array    $current_category      ID of category, or array of IDs of categories, that should get the\n *                                               'current-cat' class. Default 0.\n *     @type int          $depth                 Category depth. Used for tab indentation. Default 0.\n *     @type bool|int     $echo                  Whether to echo or return the generated markup. Accepts 0, 1, or their\n *                                               bool equivalents. Default 1.\n *     @type array|string $exclude               Array or comma/space-separated string of term IDs to exclude.\n *                                               If `$hierarchical` is true, descendants of `$exclude` terms will also\n *                                               be excluded; see `$exclude_tree`. See get_terms().\n *                                               Default empty string.\n *     @type array|string $exclude_tree          Array or comma/space-separated string of term IDs to exclude, along\n *                                               with their descendants. See get_terms(). Default empty string.\n *     @type string       $feed                  Text to use for the feed link. Default 'Feed for all posts filed\n *                                               under [cat name]'.\n *     @type string       $feed_image            URL of an image to use for the feed link. Default empty string.\n *     @type string       $feed_type             Feed type. Used to build feed link. See get_term_feed_link().\n *                                               Default empty string (default feed).\n *     @type bool         $hide_title_if_empty   Whether to hide the `$title_li` element if there are no terms in\n *                                               the list. Default false (title will always be shown).\n *     @type string       $separator             Separator between links. Default '<br />'.\n *     @type bool|int     $show_count            Whether to include post counts. Accepts 0, 1, or their bool equivalents.\n *                                               Default 0.\n *     @type string       $show_option_all       Text to display for showing all categories. Default empty string.\n *     @type string       $show_option_none      Text to display for the 'no categories' option.\n *                                               Default 'No categories'.\n *     @type string       $style                 The style used to display the categories list. If 'list', categories\n *                                               will be output as an unordered list. If left empty or another value,\n *                                               categories will be output separated by `<br>` tags. Default 'list'.\n *     @type string       $title_li              Text to use for the list title `<li>` element. Pass an empty string\n *                                               to disable. Default 'Categories'.\n *     @type bool|int     $use_desc_for_title    Whether to use the category description as the title attribute.\n *                                               Accepts 0, 1, or their bool equivalents. Default 1.\n * }\n * @return void|string|false Void if 'echo' argument is true, HTML list of categories if 'echo' is false.\n *                           False if the taxonomy does not exist.\n */\nfunction wp_list_categories( $args = '' ) {\n\t$defaults = array(\n\t\t'child_of'            => 0,\n\t\t'current_category'    => 0,\n\t\t'depth'               => 0,\n\t\t'echo'                => 1,\n\t\t'exclude'             => '',\n\t\t'exclude_tree'        => '',\n\t\t'feed'                => '',\n\t\t'feed_image'          => '',\n\t\t'feed_type'           => '',\n\t\t'hide_empty'          => 1,\n\t\t'hide_title_if_empty' => false,\n\t\t'hierarchical'        => true,\n\t\t'order'               => 'ASC',\n\t\t'orderby'             => 'name',\n\t\t'separator'           => '<br />',\n\t\t'show_count'          => 0,\n\t\t'show_option_all'     => '',\n\t\t'show_option_none'    => __( 'No categories' ),\n\t\t'style'               => 'list',\n\t\t'taxonomy'            => 'category',\n\t\t'title_li'            => __( 'Categories' ),\n\t\t'use_desc_for_title'  => 1,\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\tif ( ! isset( $parsed_args['pad_counts'] ) && $parsed_args['show_count'] && $parsed_args['hierarchical'] ) {\n\t\t$parsed_args['pad_counts'] = true;\n\t}\n\n\t// Descendants of exclusions should be excluded too.\n\tif ( true == $parsed_args['hierarchical'] ) {\n\t\t$exclude_tree = array();\n\n\t\tif ( $parsed_args['exclude_tree'] ) {\n\t\t\t$exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $parsed_args['exclude_tree'] ) );\n\t\t}\n\n\t\tif ( $parsed_args['exclude'] ) {\n\t\t\t$exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $parsed_args['exclude'] ) );\n\t\t}\n\n\t\t$parsed_args['exclude_tree'] = $exclude_tree;\n\t\t$parsed_args['exclude']      = '';\n\t}\n\n\tif ( ! isset( $parsed_args['class'] ) ) {\n\t\t$parsed_args['class'] = ( 'category' === $parsed_args['taxonomy'] ) ? 'categories' : $parsed_args['taxonomy'];\n\t}\n\n\tif ( ! taxonomy_exists( $parsed_args['taxonomy'] ) ) {\n\t\treturn false;\n\t}\n\n\t$show_option_all  = $parsed_args['show_option_all'];\n\t$show_option_none = $parsed_args['show_option_none'];\n\n\t$categories = get_categories( $parsed_args );\n\n\t$output = '';\n\n\tif ( $parsed_args['title_li'] && 'list' === $parsed_args['style']\n\t\t&& ( ! empty( $categories ) || ! $parsed_args['hide_title_if_empty'] )\n\t) {\n\t\t$output = '<li class=\"' . esc_attr( $parsed_args['class'] ) . '\">' . $parsed_args['title_li'] . '<ul>';\n\t}\n\n\tif ( empty( $categories ) ) {\n\t\tif ( ! empty( $show_option_none ) ) {\n\t\t\tif ( 'list' === $parsed_args['style'] ) {\n\t\t\t\t$output .= '<li class=\"cat-item-none\">' . $show_option_none . '</li>';\n\t\t\t} else {\n\t\t\t\t$output .= $show_option_none;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ( ! empty( $show_option_all ) ) {\n\n\t\t\t$posts_page = '';\n\n\t\t\t// For taxonomies that belong only to custom post types, point to a valid archive.\n\t\t\t$taxonomy_object = get_taxonomy( $parsed_args['taxonomy'] );\n\t\t\tif ( ! in_array( 'post', $taxonomy_object->object_type, true ) && ! in_array( 'page', $taxonomy_object->object_type, true ) ) {\n\t\t\t\tforeach ( $taxonomy_object->object_type as $object_type ) {\n\t\t\t\t\t$_object_type = get_post_type_object( $object_type );\n\n\t\t\t\t\t// Grab the first one.\n\t\t\t\t\tif ( ! empty( $_object_type->has_archive ) ) {\n\t\t\t\t\t\t$posts_page = get_post_type_archive_link( $object_type );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Fallback for the 'All' link is the posts page.\n\t\t\tif ( ! $posts_page ) {\n\t\t\t\tif ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) ) {\n\t\t\t\t\t$posts_page = get_permalink( get_option( 'page_for_posts' ) );\n\t\t\t\t} else {\n\t\t\t\t\t$posts_page = home_url( '/' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$posts_page = esc_url( $posts_page );\n\t\t\tif ( 'list' === $parsed_args['style'] ) {\n\t\t\t\t$output .= \"<li class='cat-item-all'><a href='$posts_page'>$show_option_all</a></li>\";\n\t\t\t} else {\n\t\t\t\t$output .= \"<a href='$posts_page'>$show_option_all</a>\";\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $parsed_args['current_category'] ) && ( is_category() || is_tax() || is_tag() ) ) {\n\t\t\t$current_term_object = get_queried_object();\n\t\t\tif ( $current_term_object && $parsed_args['taxonomy'] === $current_term_object->taxonomy ) {\n\t\t\t\t$parsed_args['current_category'] = get_queried_object_id();\n\t\t\t}\n\t\t}\n\n\t\tif ( $parsed_args['hierarchical'] ) {\n\t\t\t$depth = $parsed_args['depth'];\n\t\t} else {\n\t\t\t$depth = -1; // Flat.\n\t\t}\n\t\t$output .= walk_category_tree( $categories, $depth, $parsed_args );\n\t}\n\n\tif ( $parsed_args['title_li'] && 'list' === $parsed_args['style']\n\t\t&& ( ! empty( $categories ) || ! $parsed_args['hide_title_if_empty'] )\n\t) {\n\t\t$output .= '</ul></li>';\n\t}\n\n\t/**\n\t * Filters the HTML output of a taxonomy list.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $output HTML output.\n\t * @param array  $args   An array of taxonomy-listing arguments.\n\t */\n\t$html = apply_filters( 'wp_list_categories', $output, $args );\n\n\tif ( $parsed_args['echo'] ) {\n\t\techo $html;\n\t} else {\n\t\treturn $html;\n\t}\n}\n\n/**\n * Displays a tag cloud.\n *\n * Outputs a list of tags in what is called a 'tag cloud', where the size of each tag\n * is determined by how many times that particular tag has been assigned to posts.\n *\n * @since 2.3.0\n * @since 2.8.0 Added the `taxonomy` argument.\n * @since 4.8.0 Added the `show_count` argument.\n *\n * @param array|string $args {\n *     Optional. Array or string of arguments for displaying a tag cloud. See wp_generate_tag_cloud()\n *     and get_terms() for the full lists of arguments that can be passed in `$args`.\n *\n *     @type int    $number    The number of tags to display. Accepts any positive integer\n *                             or zero to return all. Default 0 (all tags).\n *     @type string $link      Whether to display term editing links or term permalinks.\n *                             Accepts 'edit' and 'view'. Default 'view'.\n *     @type string $post_type The post type. Used to highlight the proper post type menu\n *                             on the linked edit page. Defaults to the first post type\n *                             associated with the taxonomy.\n *     @type bool   $echo      Whether or not to echo the return value. Default true.\n * }\n * @return void|string|array Void if 'echo' argument is true, or on failure. Otherwise, tag cloud\n *                           as a string or an array, depending on 'format' argument.\n */\nfunction wp_tag_cloud( $args = '' ) {\n\t$defaults = array(\n\t\t'smallest'   => 8,\n\t\t'largest'    => 22,\n\t\t'unit'       => 'pt',\n\t\t'number'     => 45,\n\t\t'format'     => 'flat',\n\t\t'separator'  => \"\\n\",\n\t\t'orderby'    => 'name',\n\t\t'order'      => 'ASC',\n\t\t'exclude'    => '',\n\t\t'include'    => '',\n\t\t'link'       => 'view',\n\t\t'taxonomy'   => 'post_tag',\n\t\t'post_type'  => '',\n\t\t'echo'       => true,\n\t\t'show_count' => 0,\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\t$tags = get_terms(\n\t\tarray_merge(\n\t\t\t$args,\n\t\t\tarray(\n\t\t\t\t'orderby' => 'count',\n\t\t\t\t'order'   => 'DESC',\n\t\t\t)\n\t\t)\n\t); // Always query top tags.\n\n\tif ( empty( $tags ) || is_wp_error( $tags ) ) {\n\t\treturn;\n\t}\n\n\tforeach ( $tags as $key => $tag ) {\n\t\tif ( 'edit' === $args['link'] ) {\n\t\t\t$link = get_edit_term_link( $tag->term_id, $tag->taxonomy, $args['post_type'] );\n\t\t} else {\n\t\t\t$link = get_term_link( intval( $tag->term_id ), $tag->taxonomy );\n\t\t}\n\n\t\tif ( is_wp_error( $link ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$tags[ $key ]->link = $link;\n\t\t$tags[ $key ]->id   = $tag->term_id;\n\t}\n\n\t// Here's where those top tags get sorted according to $args.\n\t$return = wp_generate_tag_cloud( $tags, $args );\n\n\t/**\n\t * Filters the tag cloud output.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string|array $return Tag cloud as a string or an array, depending on 'format' argument.\n\t * @param array        $args   An array of tag cloud arguments.\n\t */\n\t$return = apply_filters( 'wp_tag_cloud', $return, $args );\n\n\tif ( 'array' === $args['format'] || empty( $args['echo'] ) ) {\n\t\treturn $return;\n\t}\n\n\techo $return;\n}\n\n/**\n * Default topic count scaling for tag links.\n *\n * @since 2.9.0\n *\n * @param int $count Number of posts with that tag.\n * @return int Scaled count.\n */\nfunction default_topic_count_scale( $count ) {\n\treturn round( log10( $count + 1 ) * 100 );\n}\n\n/**\n * Generates a tag cloud (heatmap) from provided data.\n *\n * @todo Complete functionality.\n * @since 2.3.0\n * @since 4.8.0 Added the `show_count` argument.\n *\n * @param WP_Term[]    $tags Array of WP_Term objects to generate the tag cloud for.\n * @param string|array $args {\n *     Optional. Array or string of arguments for generating a tag cloud.\n *\n *     @type int      $smallest                   Smallest font size used to display tags. Paired\n *                                                with the value of `$unit`, to determine CSS text\n *                                                size unit. Default 8 (pt).\n *     @type int      $largest                    Largest font size used to display tags. Paired\n *                                                with the value of `$unit`, to determine CSS text\n *                                                size unit. Default 22 (pt).\n *     @type string   $unit                       CSS text size unit to use with the `$smallest`\n *                                                and `$largest` values. Accepts any valid CSS text\n *                                                size unit. Default 'pt'.\n *     @type int      $number                     The number of tags to return. Accepts any\n *                                                positive integer or zero to return all.\n *                                                Default 0.\n *     @type string   $format                     Format to display the tag cloud in. Accepts 'flat'\n *                                                (tags separated with spaces), 'list' (tags displayed\n *                                                in an unordered list), or 'array' (returns an array).\n *                                                Default 'flat'.\n *     @type string   $separator                  HTML or text to separate the tags. Default \"\\n\" (newline).\n *     @type string   $orderby                    Value to order tags by. Accepts 'name' or 'count'.\n *                                                Default 'name'. The {@see 'tag_cloud_sort'} filter\n *                                                can also affect how tags are sorted.\n *     @type string   $order                      How to order the tags. Accepts 'ASC' (ascending),\n *                                                'DESC' (descending), or 'RAND' (random). Default 'ASC'.\n *     @type int|bool $filter                     Whether to enable filtering of the final output\n *                                                via {@see 'wp_generate_tag_cloud'}. Default 1|true.\n *     @type string   $topic_count_text           Nooped plural text from _n_noop() to supply to\n *                                                tag counts. Default null.\n *     @type callable $topic_count_text_callback  Callback used to generate nooped plural text for\n *                                                tag counts based on the count. Default null.\n *     @type callable $topic_count_scale_callback Callback used to determine the tag count scaling\n *                                                value. Default default_topic_count_scale().\n *     @type bool|int $show_count                 Whether to display the tag counts. Default 0. Accepts\n *                                                0, 1, or their bool equivalents.\n * }\n * @return string|array Tag cloud as a string or an array, depending on 'format' argument.\n */\nfunction wp_generate_tag_cloud( $tags, $args = '' ) {\n\t$defaults = array(\n\t\t'smallest'                   => 8,\n\t\t'largest'                    => 22,\n\t\t'unit'                       => 'pt',\n\t\t'number'                     => 0,\n\t\t'format'                     => 'flat',\n\t\t'separator'                  => \"\\n\",\n\t\t'orderby'                    => 'name',\n\t\t'order'                      => 'ASC',\n\t\t'topic_count_text'           => null,\n\t\t'topic_count_text_callback'  => null,\n\t\t'topic_count_scale_callback' => 'default_topic_count_scale',\n\t\t'filter'                     => 1,\n\t\t'show_count'                 => 0,\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\t$return = ( 'array' === $args['format'] ) ? array() : '';\n\n\tif ( empty( $tags ) ) {\n\t\treturn $return;\n\t}\n\n\t// Juggle topic counts.\n\tif ( isset( $args['topic_count_text'] ) ) {\n\t\t// First look for nooped plural support via topic_count_text.\n\t\t$translate_nooped_plural = $args['topic_count_text'];\n\t} elseif ( ! empty( $args['topic_count_text_callback'] ) ) {\n\t\t// Look for the alternative callback style. Ignore the previous default.\n\t\tif ( 'default_topic_count_text' === $args['topic_count_text_callback'] ) {\n\t\t\t/* translators: %s: Number of items (tags). */\n\t\t\t$translate_nooped_plural = _n_noop( '%s item', '%s items' );\n\t\t} else {\n\t\t\t$translate_nooped_plural = false;\n\t\t}\n\t} elseif ( isset( $args['single_text'] ) && isset( $args['multiple_text'] ) ) {\n\t\t// If no callback exists, look for the old-style single_text and multiple_text arguments.\n\t\t// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralSingle,WordPress.WP.I18n.NonSingularStringLiteralPlural\n\t\t$translate_nooped_plural = _n_noop( $args['single_text'], $args['multiple_text'] );\n\t} else {\n\t\t// This is the default for when no callback, plural, or argument is passed in.\n\t\t/* translators: %s: Number of items (tags). */\n\t\t$translate_nooped_plural = _n_noop( '%s item', '%s items' );\n\t}\n\n\t/**\n\t * Filters how the items in a tag cloud are sorted.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param WP_Term[] $tags Ordered array of terms.\n\t * @param array     $args An array of tag cloud arguments.\n\t */\n\t$tags_sorted = apply_filters( 'tag_cloud_sort', $tags, $args );\n\tif ( empty( $tags_sorted ) ) {\n\t\treturn $return;\n\t}\n\n\tif ( $tags_sorted !== $tags ) {\n\t\t$tags = $tags_sorted;\n\t\tunset( $tags_sorted );\n\t} else {\n\t\tif ( 'RAND' === $args['order'] ) {\n\t\t\tshuffle( $tags );\n\t\t} else {\n\t\t\t// SQL cannot save you; this is a second (potentially different) sort on a subset of data.\n\t\t\tif ( 'name' === $args['orderby'] ) {\n\t\t\t\tuasort( $tags, '_wp_object_name_sort_cb' );\n\t\t\t} else {\n\t\t\t\tuasort( $tags, '_wp_object_count_sort_cb' );\n\t\t\t}\n\n\t\t\tif ( 'DESC' === $args['order'] ) {\n\t\t\t\t$tags = array_reverse( $tags, true );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( $args['number'] > 0 ) {\n\t\t$tags = array_slice( $tags, 0, $args['number'] );\n\t}\n\n\t$counts      = array();\n\t$real_counts = array(); // For the alt tag.\n\tforeach ( (array) $tags as $key => $tag ) {\n\t\t$real_counts[ $key ] = $tag->count;\n\t\t$counts[ $key ]      = call_user_func( $args['topic_count_scale_callback'], $tag->count );\n\t}\n\n\t$min_count = min( $counts );\n\t$spread    = max( $counts ) - $min_count;\n\tif ( $spread <= 0 ) {\n\t\t$spread = 1;\n\t}\n\t$font_spread = $args['largest'] - $args['smallest'];\n\tif ( $font_spread < 0 ) {\n\t\t$font_spread = 1;\n\t}\n\t$font_step = $font_spread / $spread;\n\n\t$aria_label = false;\n\t/*\n\t * Determine whether to output an 'aria-label' attribute with the tag name and count.\n\t * When tags have a different font size, they visually convey an important information\n\t * that should be available to assistive technologies too. On the other hand, sometimes\n\t * themes set up the Tag Cloud to display all tags with the same font size (setting\n\t * the 'smallest' and 'largest' arguments to the same value).\n\t * In order to always serve the same content to all users, the 'aria-label' gets printed out:\n\t * - when tags have a different size\n\t * - when the tag count is displayed (for example when users check the checkbox in the\n\t *   Tag Cloud widget), regardless of the tags font size\n\t */\n\tif ( $args['show_count'] || 0 !== $font_spread ) {\n\t\t$aria_label = true;\n\t}\n\n\t// Assemble the data that will be used to generate the tag cloud markup.\n\t$tags_data = array();\n\tforeach ( $tags as $key => $tag ) {\n\t\t$tag_id = isset( $tag->id ) ? $tag->id : $key;\n\n\t\t$count      = $counts[ $key ];\n\t\t$real_count = $real_counts[ $key ];\n\n\t\tif ( $translate_nooped_plural ) {\n\t\t\t$formatted_count = sprintf( translate_nooped_plural( $translate_nooped_plural, $real_count ), number_format_i18n( $real_count ) );\n\t\t} else {\n\t\t\t$formatted_count = call_user_func( $args['topic_count_text_callback'], $real_count, $tag, $args );\n\t\t}\n\n\t\t$tags_data[] = array(\n\t\t\t'id'              => $tag_id,\n\t\t\t'url'             => ( '#' !== $tag->link ) ? $tag->link : '#',\n\t\t\t'role'            => ( '#' !== $tag->link ) ? '' : ' role=\"button\"',\n\t\t\t'name'            => $tag->name,\n\t\t\t'formatted_count' => $formatted_count,\n\t\t\t'slug'            => $tag->slug,\n\t\t\t'real_count'      => $real_count,\n\t\t\t'class'           => 'tag-cloud-link tag-link-' . $tag_id,\n\t\t\t'font_size'       => $args['smallest'] + ( $count - $min_count ) * $font_step,\n\t\t\t'aria_label'      => $aria_label ? sprintf( ' aria-label=\"%1$s (%2$s)\"', esc_attr( $tag->name ), esc_attr( $formatted_count ) ) : '',\n\t\t\t'show_count'      => $args['show_count'] ? '<span class=\"tag-link-count\"> (' . $real_count . ')</span>' : '',\n\t\t);\n\t}\n\n\t/**\n\t * Filters the data used to generate the tag cloud.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param array $tags_data An array of term data for term used to generate the tag cloud.\n\t */\n\t$tags_data = apply_filters( 'wp_generate_tag_cloud_data', $tags_data );\n\n\t$a = array();\n\n\t// Generate the output links array.\n\tforeach ( $tags_data as $key => $tag_data ) {\n\t\t$class = $tag_data['class'] . ' tag-link-position-' . ( $key + 1 );\n\t\t$a[]   = sprintf(\n\t\t\t'<a href=\"%1$s\"%2$s class=\"%3$s\" style=\"font-size: %4$s;\"%5$s>%6$s%7$s</a>',\n\t\t\tesc_url( $tag_data['url'] ),\n\t\t\t$tag_data['role'],\n\t\t\tesc_attr( $class ),\n\t\t\tesc_attr( str_replace( ',', '.', $tag_data['font_size'] ) . $args['unit'] ),\n\t\t\t$tag_data['aria_label'],\n\t\t\tesc_html( $tag_data['name'] ),\n\t\t\t$tag_data['show_count']\n\t\t);\n\t}\n\n\tswitch ( $args['format'] ) {\n\t\tcase 'array':\n\t\t\t$return =& $a;\n\t\t\tbreak;\n\t\tcase 'list':\n\t\t\t/*\n\t\t\t * Force role=\"list\", as some browsers (sic: Safari 10) don't expose to assistive\n\t\t\t * technologies the default role when the list is styled with `list-style: none`.\n\t\t\t * Note: this is redundant but doesn't harm.\n\t\t\t */\n\t\t\t$return  = \"<ul class='wp-tag-cloud' role='list'>\\n\\t<li>\";\n\t\t\t$return .= join( \"</li>\\n\\t<li>\", $a );\n\t\t\t$return .= \"</li>\\n</ul>\\n\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$return = join( $args['separator'], $a );\n\t\t\tbreak;\n\t}\n\n\tif ( $args['filter'] ) {\n\t\t/**\n\t\t * Filters the generated output of a tag cloud.\n\t\t *\n\t\t * The filter is only evaluated if a true value is passed\n\t\t * to the $filter argument in wp_generate_tag_cloud().\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @see wp_generate_tag_cloud()\n\t\t *\n\t\t * @param array|string $return String containing the generated HTML tag cloud output\n\t\t *                             or an array of tag links if the 'format' argument\n\t\t *                             equals 'array'.\n\t\t * @param WP_Term[]    $tags   An array of terms used in the tag cloud.\n\t\t * @param array        $args   An array of wp_generate_tag_cloud() arguments.\n\t\t */\n\t\treturn apply_filters( 'wp_generate_tag_cloud', $return, $tags, $args );\n\t} else {\n\t\treturn $return;\n\t}\n}\n\n/**\n * Serves as a callback for comparing objects based on name.\n *\n * Used with `uasort()`.\n *\n * @since 3.1.0\n * @access private\n *\n * @param object $a The first object to compare.\n * @param object $b The second object to compare.\n * @return int Negative number if `$a->name` is less than `$b->name`, zero if they are equal,\n *             or greater than zero if `$a->name` is greater than `$b->name`.\n */\nfunction _wp_object_name_sort_cb( $a, $b ) {\n\treturn strnatcasecmp( $a->name, $b->name );\n}\n\n/**\n * Serves as a callback for comparing objects based on count.\n *\n * Used with `uasort()`.\n *\n * @since 3.1.0\n * @access private\n *\n * @param object $a The first object to compare.\n * @param object $b The second object to compare.\n * @return bool Whether the count value for `$a` is greater than the count value for `$b`.\n */\nfunction _wp_object_count_sort_cb( $a, $b ) {\n\treturn ( $a->count > $b->count );\n}\n\n//\n// Helper functions.\n//\n\n/**\n * Retrieves HTML list content for category list.\n *\n * @since 2.1.0\n * @since 5.3.0 Formalized the existing `...$args` parameter by adding it\n *              to the function signature.\n *\n * @uses Walker_Category to create HTML list content.\n * @see Walker::walk() for parameters and return description.\n *\n * @param mixed ...$args Elements array, maximum hierarchical depth and optional additional arguments.\n * @return string\n */\nfunction walk_category_tree( ...$args ) {\n\t// The user's options are the third parameter.\n\tif ( empty( $args[2]['walker'] ) || ! ( $args[2]['walker'] instanceof Walker ) ) {\n\t\t$walker = new Walker_Category;\n\t} else {\n\t\t/**\n\t\t * @var Walker $walker\n\t\t */\n\t\t$walker = $args[2]['walker'];\n\t}\n\treturn $walker->walk( ...$args );\n}\n\n/**\n * Retrieves HTML dropdown (select) content for category list.\n *\n * @since 2.1.0\n * @since 5.3.0 Formalized the existing `...$args` parameter by adding it\n *              to the function signature.\n *\n * @uses Walker_CategoryDropdown to create HTML dropdown content.\n * @see Walker::walk() for parameters and return description.\n *\n * @param mixed ...$args Elements array, maximum hierarchical depth and optional additional arguments.\n * @return string\n */\nfunction walk_category_dropdown_tree( ...$args ) {\n\t// The user's options are the third parameter.\n\tif ( empty( $args[2]['walker'] ) || ! ( $args[2]['walker'] instanceof Walker ) ) {\n\t\t$walker = new Walker_CategoryDropdown;\n\t} else {\n\t\t/**\n\t\t * @var Walker $walker\n\t\t */\n\t\t$walker = $args[2]['walker'];\n\t}\n\treturn $walker->walk( ...$args );\n}\n\n//\n// Tags.\n//\n\n/**\n * Retrieves the link to the tag.\n *\n * @since 2.3.0\n *\n * @see get_term_link()\n *\n * @param int|object $tag Tag ID or object.\n * @return string Link on success, empty string if tag does not exist.\n */\nfunction get_tag_link( $tag ) {\n\treturn get_category_link( $tag );\n}\n\n/**\n * Retrieves the tags for a post.\n *\n * @since 2.3.0\n *\n * @param int $post_id Post ID.\n * @return array|false|WP_Error Array of tag objects on success, false on failure.\n */\nfunction get_the_tags( $post_id = 0 ) {\n\t$terms = get_the_terms( $post_id, 'post_tag' );\n\n\t/**\n\t * Filters the array of tags for the given post.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @see get_the_terms()\n\t *\n\t * @param WP_Term[] $terms An array of tags for the given post.\n\t */\n\treturn apply_filters( 'get_the_tags', $terms );\n}\n\n/**\n * Retrieves the tags for a post formatted as a string.\n *\n * @since 2.3.0\n *\n * @param string $before  Optional. String to use before the tags. Default empty.\n * @param string $sep     Optional. String to use between the tags. Default empty.\n * @param string $after   Optional. String to use after the tags. Default empty.\n * @param int    $post_id Optional. Post ID. Defaults to the current post ID.\n * @return string|false|WP_Error A list of tags on success, false if there are no terms,\n *                               WP_Error on failure.\n */\nfunction get_the_tag_list( $before = '', $sep = '', $after = '', $post_id = 0 ) {\n\t$tag_list = get_the_term_list( $post_id, 'post_tag', $before, $sep, $after );\n\n\t/**\n\t * Filters the tags list for a given post.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string $tag_list List of tags.\n\t * @param string $before   String to use before the tags.\n\t * @param string $sep      String to use between the tags.\n\t * @param string $after    String to use after the tags.\n\t * @param int    $post_id  Post ID.\n\t */\n\treturn apply_filters( 'the_tags', $tag_list, $before, $sep, $after, $post_id );\n}\n\n/**\n * Displays the tags for a post.\n *\n * @since 2.3.0\n *\n * @param string $before Optional. String to use before the tags. Defaults to 'Tags:'.\n * @param string $sep    Optional. String to use between the tags. Default ', '.\n * @param string $after  Optional. String to use after the tags. Default empty.\n */\nfunction the_tags( $before = null, $sep = ', ', $after = '' ) {\n\tif ( null === $before ) {\n\t\t$before = __( 'Tags: ' );\n\t}\n\n\t$the_tags = get_the_tag_list( $before, $sep, $after );\n\n\tif ( ! is_wp_error( $the_tags ) ) {\n\t\techo $the_tags;\n\t}\n}\n\n/**\n * Retrieves tag description.\n *\n * @since 2.8.0\n *\n * @param int $tag Optional. Tag ID. Defaults to the current tag ID.\n * @return string Tag description, if available.\n */\nfunction tag_description( $tag = 0 ) {\n\treturn term_description( $tag );\n}\n\n/**\n * Retrieves term description.\n *\n * @since 2.8.0\n * @since 4.9.2 The `$taxonomy` parameter was deprecated.\n *\n * @param int  $term       Optional. Term ID. Defaults to the current term ID.\n * @param null $deprecated Deprecated. Not used.\n * @return string Term description, if available.\n */\nfunction term_description( $term = 0, $deprecated = null ) {\n\tif ( ! $term && ( is_tax() || is_tag() || is_category() ) ) {\n\t\t$term = get_queried_object();\n\t\tif ( $term ) {\n\t\t\t$term = $term->term_id;\n\t\t}\n\t}\n\n\t$description = get_term_field( 'description', $term );\n\n\treturn is_wp_error( $description ) ? '' : $description;\n}\n\n/**\n * Retrieves the terms of the taxonomy that are attached to the post.\n *\n * @since 2.5.0\n *\n * @param int|WP_Post $post     Post ID or object.\n * @param string      $taxonomy Taxonomy name.\n * @return WP_Term[]|false|WP_Error Array of WP_Term objects on success, false if there are no terms\n *                                  or the post does not exist, WP_Error on failure.\n */\nfunction get_the_terms( $post, $taxonomy ) {\n\t$post = get_post( $post );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$terms = get_object_term_cache( $post->ID, $taxonomy );\n\tif ( false === $terms ) {\n\t\t$terms = wp_get_object_terms( $post->ID, $taxonomy );\n\t\tif ( ! is_wp_error( $terms ) ) {\n\t\t\t$term_ids = wp_list_pluck( $terms, 'term_id' );\n\t\t\twp_cache_add( $post->ID, $term_ids, $taxonomy . '_relationships' );\n\t\t}\n\t}\n\n\t/**\n\t * Filters the list of terms attached to the given post.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param WP_Term[]|WP_Error $terms    Array of attached terms, or WP_Error on failure.\n\t * @param int                $post_id  Post ID.\n\t * @param string             $taxonomy Name of the taxonomy.\n\t */\n\t$terms = apply_filters( 'get_the_terms', $terms, $post->ID, $taxonomy );\n\n\tif ( empty( $terms ) ) {\n\t\treturn false;\n\t}\n\n\treturn $terms;\n}\n\n/**\n * Retrieves a post's terms as a list with specified format.\n *\n * Terms are linked to their respective term listing pages.\n *\n * @since 2.5.0\n *\n * @param int    $post_id  Post ID.\n * @param string $taxonomy Taxonomy name.\n * @param string $before   Optional. String to use before the terms. Default empty.\n * @param string $sep      Optional. String to use between the terms. Default empty.\n * @param string $after    Optional. String to use after the terms. Default empty.\n * @return string|false|WP_Error A list of terms on success, false if there are no terms,\n *                               WP_Error on failure.\n */\nfunction get_the_term_list( $post_id, $taxonomy, $before = '', $sep = '', $after = '' ) {\n\t$terms = get_the_terms( $post_id, $taxonomy );\n\n\tif ( is_wp_error( $terms ) ) {\n\t\treturn $terms;\n\t}\n\n\tif ( empty( $terms ) ) {\n\t\treturn false;\n\t}\n\n\t$links = array();\n\n\tforeach ( $terms as $term ) {\n\t\t$link = get_term_link( $term, $taxonomy );\n\t\tif ( is_wp_error( $link ) ) {\n\t\t\treturn $link;\n\t\t}\n\t\t$links[] = '<a href=\"' . esc_url( $link ) . '\" rel=\"tag\">' . $term->name . '</a>';\n\t}\n\n\t/**\n\t * Filters the term links for a given taxonomy.\n\t *\n\t * The dynamic portion of the filter name, `$taxonomy`, refers\n\t * to the taxonomy slug.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string[] $links An array of term links.\n\t */\n\t$term_links = apply_filters( \"term_links-{$taxonomy}\", $links );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\treturn $before . join( $sep, $term_links ) . $after;\n}\n\n/**\n * Retrieves term parents with separator.\n *\n * @since 4.8.0\n *\n * @param int          $term_id  Term ID.\n * @param string       $taxonomy Taxonomy name.\n * @param string|array $args {\n *     Array of optional arguments.\n *\n *     @type string $format    Use term names or slugs for display. Accepts 'name' or 'slug'.\n *                             Default 'name'.\n *     @type string $separator Separator for between the terms. Default '/'.\n *     @type bool   $link      Whether to format as a link. Default true.\n *     @type bool   $inclusive Include the term to get the parents for. Default true.\n * }\n * @return string|WP_Error A list of term parents on success, WP_Error or empty string on failure.\n */\nfunction get_term_parents_list( $term_id, $taxonomy, $args = array() ) {\n\t$list = '';\n\t$term = get_term( $term_id, $taxonomy );\n\n\tif ( is_wp_error( $term ) ) {\n\t\treturn $term;\n\t}\n\n\tif ( ! $term ) {\n\t\treturn $list;\n\t}\n\n\t$term_id = $term->term_id;\n\n\t$defaults = array(\n\t\t'format'    => 'name',\n\t\t'separator' => '/',\n\t\t'link'      => true,\n\t\t'inclusive' => true,\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\tforeach ( array( 'link', 'inclusive' ) as $bool ) {\n\t\t$args[ $bool ] = wp_validate_boolean( $args[ $bool ] );\n\t}\n\n\t$parents = get_ancestors( $term_id, $taxonomy, 'taxonomy' );\n\n\tif ( $args['inclusive'] ) {\n\t\tarray_unshift( $parents, $term_id );\n\t}\n\n\tforeach ( array_reverse( $parents ) as $term_id ) {\n\t\t$parent = get_term( $term_id, $taxonomy );\n\t\t$name   = ( 'slug' === $args['format'] ) ? $parent->slug : $parent->name;\n\n\t\tif ( $args['link'] ) {\n\t\t\t$list .= '<a href=\"' . esc_url( get_term_link( $parent->term_id, $taxonomy ) ) . '\">' . $name . '</a>' . $args['separator'];\n\t\t} else {\n\t\t\t$list .= $name . $args['separator'];\n\t\t}\n\t}\n\n\treturn $list;\n}\n\n/**\n * Displays the terms for a post in a list.\n *\n * @since 2.5.0\n *\n * @param int    $post_id  Post ID.\n * @param string $taxonomy Taxonomy name.\n * @param string $before   Optional. String to use before the terms. Default empty.\n * @param string $sep      Optional. String to use between the terms. Default ', '.\n * @param string $after    Optional. String to use after the terms. Default empty.\n * @return void|false Void on success, false on failure.\n */\nfunction the_terms( $post_id, $taxonomy, $before = '', $sep = ', ', $after = '' ) {\n\t$term_list = get_the_term_list( $post_id, $taxonomy, $before, $sep, $after );\n\n\tif ( is_wp_error( $term_list ) ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Filters the list of terms to display.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string $term_list List of terms to display.\n\t * @param string $taxonomy  The taxonomy name.\n\t * @param string $before    String to use before the terms.\n\t * @param string $sep       String to use between the terms.\n\t * @param string $after     String to use after the terms.\n\t */\n\techo apply_filters( 'the_terms', $term_list, $taxonomy, $before, $sep, $after );\n}\n\n/**\n * Checks if the current post has any of given category.\n *\n * The given categories are checked against the post's categories' term_ids, names and slugs.\n * Categories given as integers will only be checked against the post's categories' term_ids.\n *\n * If no categories are given, determines if post has any categories.\n *\n * @since 3.1.0\n *\n * @param string|int|array $category Optional. The category name/term_id/slug,\n *                                   or an array of them to check for. Default empty.\n * @param int|object       $post     Optional. Post to check instead of the current post.\n * @return bool True if the current post has any of the given categories\n *              (or any category, if no category specified). False otherwise.\n */\nfunction has_category( $category = '', $post = null ) {\n\treturn has_term( $category, 'category', $post );\n}\n\n/**\n * Checks if the current post has any of given tags.\n *\n * The given tags are checked against the post's tags' term_ids, names and slugs.\n * Tags given as integers will only be checked against the post's tags' term_ids.\n *\n * If no tags are given, determines if post has any tags.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.6.0\n * @since 2.7.0 Tags given as integers are only checked against\n *              the post's tags' term_ids, not names or slugs.\n * @since 2.7.0 Can be used outside of the WordPress Loop if `$post` is provided.\n *\n * @param string|int|array $tag  Optional. The tag name/term_id/slug,\n *                               or an array of them to check for. Default empty.\n * @param int|object       $post Optional. Post to check instead of the current post.\n * @return bool True if the current post has any of the given tags\n *              (or any tag, if no tag specified). False otherwise.\n */\nfunction has_tag( $tag = '', $post = null ) {\n\treturn has_term( $tag, 'post_tag', $post );\n}\n\n/**\n * Checks if the current post has any of given terms.\n *\n * The given terms are checked against the post's terms' term_ids, names and slugs.\n * Terms given as integers will only be checked against the post's terms' term_ids.\n *\n * If no terms are given, determines if post has any terms.\n *\n * @since 3.1.0\n *\n * @param string|int|array $term     Optional. The term name/term_id/slug,\n *                                   or an array of them to check for. Default empty.\n * @param string           $taxonomy Optional. Taxonomy name. Default empty.\n * @param int|WP_Post      $post     Optional. Post to check instead of the current post.\n * @return bool True if the current post has any of the given terms\n *              (or any term, if no term specified). False otherwise.\n */\nfunction has_term( $term = '', $taxonomy = '', $post = null ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$r = is_object_in_term( $post->ID, $taxonomy, $term );\n\tif ( is_wp_error( $r ) ) {\n\t\treturn false;\n\t}\n\n\treturn $r;\n}\n", "num_lines": 1528}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Taxonomy API: Core category-specific functionality\n *\n * @package WordPress\n * @subpackage Taxonomy\n */\n\n/**\n * Retrieves a list of category objects.\n *\n * If you set the 'taxonomy' argument to 'link_category', the link categories\n * will be returned instead.\n *\n * @since 2.1.0\n *\n * @see get_terms() Type of arguments that can be changed.\n *\n * @param string|array $args {\n *     Optional. Arguments to retrieve categories. See get_terms() for additional options.\n *\n *     @type string $taxonomy Taxonomy to retrieve terms for. Default 'category'.\n * }\n * @return array List of category objects.\n */\nfunction get_categories( $args = '' ) {\n\t$defaults = array( 'taxonomy' => 'category' );\n\t$args     = wp_parse_args( $args, $defaults );\n\n\t/**\n\t * Filters the taxonomy used to retrieve terms when calling get_categories().\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $taxonomy Taxonomy to retrieve terms from.\n\t * @param array  $args     An array of arguments. See get_terms().\n\t */\n\t$args['taxonomy'] = apply_filters( 'get_categories_taxonomy', $args['taxonomy'], $args );\n\n\t// Back compat.\n\tif ( isset( $args['type'] ) && 'link' === $args['type'] ) {\n\t\t_deprecated_argument(\n\t\t\t__FUNCTION__,\n\t\t\t'3.0.0',\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: \"type => link\", 2: \"taxonomy => link_category\" */\n\t\t\t\t__( '%1$s is deprecated. Use %2$s instead.' ),\n\t\t\t\t'<code>type => link</code>',\n\t\t\t\t'<code>taxonomy => link_category</code>'\n\t\t\t)\n\t\t);\n\t\t$args['taxonomy'] = 'link_category';\n\t}\n\n\t$categories = get_terms( $args );\n\n\tif ( is_wp_error( $categories ) ) {\n\t\t$categories = array();\n\t} else {\n\t\t$categories = (array) $categories;\n\t\tforeach ( array_keys( $categories ) as $k ) {\n\t\t\t_make_cat_compat( $categories[ $k ] );\n\t\t}\n\t}\n\n\treturn $categories;\n}\n\n/**\n * Retrieves category data given a category ID or category object.\n *\n * If you pass the $category parameter an object, which is assumed to be the\n * category row object retrieved the database. It will cache the category data.\n *\n * If you pass $category an integer of the category ID, then that category will\n * be retrieved from the database, if it isn't already cached, and pass it back.\n *\n * If you look at get_term(), then both types will be passed through several\n * filters and finally sanitized based on the $filter parameter value.\n *\n * @since 1.5.1\n *\n * @param int|object $category Category ID or category row object.\n * @param string     $output   Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which\n *                             correspond to a WP_Term object, an associative array, or a numeric array,\n *                             respectively. Default OBJECT.\n * @param string     $filter   Optional. How to sanitize category fields. Default 'raw'.\n * @return object|array|WP_Error|null Category data in type defined by $output parameter.\n *                                    WP_Error if $category is empty, null if it does not exist.\n */\nfunction get_category( $category, $output = OBJECT, $filter = 'raw' ) {\n\t$category = get_term( $category, 'category', $output, $filter );\n\n\tif ( is_wp_error( $category ) ) {\n\t\treturn $category;\n\t}\n\n\t_make_cat_compat( $category );\n\n\treturn $category;\n}\n\n/**\n * Retrieves a category based on URL containing the category slug.\n *\n * Breaks the $category_path parameter up to get the category slug.\n *\n * Tries to find the child path and will return it. If it doesn't find a\n * match, then it will return the first category matching slug, if $full_match,\n * is set to false. If it does not, then it will return null.\n *\n * It is also possible that it will return a WP_Error object on failure. Check\n * for it when using this function.\n *\n * @since 2.1.0\n *\n * @param string $category_path URL containing category slugs.\n * @param bool   $full_match    Optional. Whether full path should be matched.\n * @param string $output        Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which\n *                              correspond to a WP_Term object, an associative array, or a numeric array,\n *                              respectively. Default OBJECT.\n * @return WP_Term|array|WP_Error|null Type is based on $output value.\n */\nfunction get_category_by_path( $category_path, $full_match = true, $output = OBJECT ) {\n\t$category_path  = rawurlencode( urldecode( $category_path ) );\n\t$category_path  = str_replace( '%2F', '/', $category_path );\n\t$category_path  = str_replace( '%20', ' ', $category_path );\n\t$category_paths = '/' . trim( $category_path, '/' );\n\t$leaf_path      = sanitize_title( basename( $category_paths ) );\n\t$category_paths = explode( '/', $category_paths );\n\t$full_path      = '';\n\n\tforeach ( (array) $category_paths as $pathdir ) {\n\t\t$full_path .= ( '' !== $pathdir ? '/' : '' ) . sanitize_title( $pathdir );\n\t}\n\n\t$categories = get_terms(\n\t\tarray(\n\t\t\t'taxonomy' => 'category',\n\t\t\t'get'      => 'all',\n\t\t\t'slug'     => $leaf_path,\n\t\t)\n\t);\n\n\tif ( empty( $categories ) ) {\n\t\treturn;\n\t}\n\n\tforeach ( $categories as $category ) {\n\t\t$path        = '/' . $leaf_path;\n\t\t$curcategory = $category;\n\t\twhile ( ( 0 != $curcategory->parent ) && ( $curcategory->parent != $curcategory->term_id ) ) {\n\t\t\t$curcategory = get_term( $curcategory->parent, 'category' );\n\n\t\t\tif ( is_wp_error( $curcategory ) ) {\n\t\t\t\treturn $curcategory;\n\t\t\t}\n\n\t\t\t$path = '/' . $curcategory->slug . $path;\n\t\t}\n\n\t\tif ( $path == $full_path ) {\n\t\t\t$category = get_term( $category->term_id, 'category', $output );\n\t\t\t_make_cat_compat( $category );\n\n\t\t\treturn $category;\n\t\t}\n\t}\n\n\t// If full matching is not required, return the first cat that matches the leaf.\n\tif ( ! $full_match ) {\n\t\t$category = get_term( reset( $categories )->term_id, 'category', $output );\n\t\t_make_cat_compat( $category );\n\n\t\treturn $category;\n\t}\n}\n\n/**\n * Retrieves a category object by category slug.\n *\n * @since 2.3.0\n *\n * @param string $slug The category slug.\n * @return object|false Category data object on success, false if not found.\n */\nfunction get_category_by_slug( $slug ) {\n\t$category = get_term_by( 'slug', $slug, 'category' );\n\n\tif ( $category ) {\n\t\t_make_cat_compat( $category );\n\t}\n\n\treturn $category;\n}\n\n/**\n * Retrieves the ID of a category from its name.\n *\n * @since 1.0.0\n *\n * @param string $cat_name Category name.\n * @return int Category ID on success, 0 if the category doesn't exist.\n */\nfunction get_cat_ID( $cat_name ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid\n\t$cat = get_term_by( 'name', $cat_name, 'category' );\n\n\tif ( $cat ) {\n\t\treturn $cat->term_id;\n\t}\n\n\treturn 0;\n}\n\n/**\n * Retrieves the name of a category from its ID.\n *\n * @since 1.0.0\n *\n * @param int $cat_id Category ID.\n * @return string Category name, or an empty string if the category doesn't exist.\n */\nfunction get_cat_name( $cat_id ) {\n\t$cat_id   = (int) $cat_id;\n\t$category = get_term( $cat_id, 'category' );\n\n\tif ( ! $category || is_wp_error( $category ) ) {\n\t\treturn '';\n\t}\n\n\treturn $category->name;\n}\n\n/**\n * Checks if a category is an ancestor of another category.\n *\n * You can use either an ID or the category object for both parameters.\n * If you use an integer, the category will be retrieved.\n *\n * @since 2.1.0\n *\n * @param int|object $cat1 ID or object to check if this is the parent category.\n * @param int|object $cat2 The child category.\n * @return bool Whether $cat2 is child of $cat1.\n */\nfunction cat_is_ancestor_of( $cat1, $cat2 ) {\n\treturn term_is_ancestor_of( $cat1, $cat2, 'category' );\n}\n\n/**\n * Sanitizes category data based on context.\n *\n * @since 2.3.0\n *\n * @param object|array $category Category data.\n * @param string       $context  Optional. Default 'display'.\n * @return object|array Same type as $category with sanitized data for safe use.\n */\nfunction sanitize_category( $category, $context = 'display' ) {\n\treturn sanitize_term( $category, 'category', $context );\n}\n\n/**\n * Sanitizes data in single category key field.\n *\n * @since 2.3.0\n *\n * @param string $field   Category key to sanitize.\n * @param mixed  $value   Category value to sanitize.\n * @param int    $cat_id  Category ID.\n * @param string $context What filter to use, 'raw', 'display', etc.\n * @return mixed Same type as $value after $value has been sanitized.\n */\nfunction sanitize_category_field( $field, $value, $cat_id, $context ) {\n\treturn sanitize_term_field( $field, $value, $cat_id, 'category', $context );\n}\n\n/* Tags */\n\n/**\n * Retrieves all post tags.\n *\n * @since 2.3.0\n *\n * @param string|array $args {\n *     Optional. Arguments to retrieve tags. See get_terms() for additional options.\n *\n *     @type string $taxonomy Taxonomy to retrieve terms for. Default 'post_tag'.\n * }\n * @return WP_Term[]|int|WP_Error Array of 'post_tag' term objects, a count thereof,\n *                                or WP_Error if any of the taxonomies do not exist.\n */\nfunction get_tags( $args = '' ) {\n\t$defaults = array( 'taxonomy' => 'post_tag' );\n\t$args     = wp_parse_args( $args, $defaults );\n\n\t$tags = get_terms( $args );\n\n\tif ( empty( $tags ) ) {\n\t\t$tags = array();\n\t} else {\n\t\t/**\n\t\t * Filters the array of term objects returned for the 'post_tag' taxonomy.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param WP_Term[]|int|WP_Error $tags Array of 'post_tag' term objects, a count thereof,\n\t\t *                                     or WP_Error if any of the taxonomies do not exist.\n\t\t * @param array                  $args An array of arguments. @see get_terms()\n\t\t */\n\t\t$tags = apply_filters( 'get_tags', $tags, $args );\n\t}\n\n\treturn $tags;\n}\n\n/**\n * Retrieves a post tag by tag ID or tag object.\n *\n * If you pass the $tag parameter an object, which is assumed to be the tag row\n * object retrieved from the database, it will cache the tag data.\n *\n * If you pass $tag an integer of the tag ID, then that tag will be retrieved\n * from the database, if it isn't already cached, and passed back.\n *\n * If you look at get_term(), both types will be passed through several filters\n * and finally sanitized based on the $filter parameter value.\n *\n * @since 2.3.0\n *\n * @param int|WP_Term|object $tag    A tag ID or object.\n * @param string             $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which\n *                                   correspond to a WP_Term object, an associative array, or a numeric array,\n *                                   respectively. Default OBJECT.\n * @param string             $filter Optional. How to sanitize tag fields. Default 'raw'.\n * @return WP_Term|array|WP_Error|null Tag data in type defined by $output parameter.\n *                                     WP_Error if $tag is empty, null if it does not exist.\n */\nfunction get_tag( $tag, $output = OBJECT, $filter = 'raw' ) {\n\treturn get_term( $tag, 'post_tag', $output, $filter );\n}\n\n/* Cache */\n\n/**\n * Removes the category cache data based on ID.\n *\n * @since 2.1.0\n *\n * @param int $id Category ID\n */\nfunction clean_category_cache( $id ) {\n\tclean_term_cache( $id, 'category' );\n}\n\n/**\n * Updates category structure to old pre-2.3 from new taxonomy structure.\n *\n * This function was added for the taxonomy support to update the new category\n * structure with the old category one. This will maintain compatibility with\n * plugins and themes which depend on the old key or property names.\n *\n * The parameter should only be passed a variable and not create the array or\n * object inline to the parameter. The reason for this is that parameter is\n * passed by reference and PHP will fail unless it has the variable.\n *\n * There is no return value, because everything is updated on the variable you\n * pass to it. This is one of the features with using pass by reference in PHP.\n *\n * @since 2.3.0\n * @since 4.4.0 The `$category` parameter now also accepts a WP_Term object.\n * @access private\n *\n * @param array|object|WP_Term $category Category row object or array.\n */\nfunction _make_cat_compat( &$category ) {\n\tif ( is_object( $category ) && ! is_wp_error( $category ) ) {\n\t\t$category->cat_ID               = $category->term_id;\n\t\t$category->category_count       = $category->count;\n\t\t$category->category_description = $category->description;\n\t\t$category->cat_name             = $category->name;\n\t\t$category->category_nicename    = $category->slug;\n\t\t$category->category_parent      = $category->parent;\n\t} elseif ( is_array( $category ) && isset( $category['term_id'] ) ) {\n\t\t$category['cat_ID']               = &$category['term_id'];\n\t\t$category['category_count']       = &$category['count'];\n\t\t$category['category_description'] = &$category['description'];\n\t\t$category['cat_name']             = &$category['name'];\n\t\t$category['category_nicename']    = &$category['slug'];\n\t\t$category['category_parent']      = &$category['parent'];\n\t}\n}\n", "num_lines": 393}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Feed API\n *\n * @package WordPress\n * @subpackage Feed\n * @deprecated 4.7.0\n */\n\n_deprecated_file( basename( __FILE__ ), '4.7.0', 'fetch_feed()' );\n\nif ( ! class_exists( 'SimplePie', false ) ) {\n\trequire_once ABSPATH . WPINC . '/class-simplepie.php';\n}\n\nrequire_once ABSPATH . WPINC . '/class-wp-feed-cache.php';\nrequire_once ABSPATH . WPINC . '/class-wp-feed-cache-transient.php';\nrequire_once ABSPATH . WPINC . '/class-wp-simplepie-file.php';\nrequire_once ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php';\n", "num_lines": 20}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * HTTP API: WP_Http class\n *\n * @package WordPress\n * @subpackage HTTP\n * @since 2.7.0\n */\n\nif ( ! class_exists( 'Requests' ) ) {\n\trequire ABSPATH . WPINC . '/class-requests.php';\n\n\tRequests::register_autoloader();\n\tRequests::set_certificate_path( ABSPATH . WPINC . '/certificates/ca-bundle.crt' );\n}\n\n/**\n * Core class used for managing HTTP transports and making HTTP requests.\n *\n * This class is used to consistently make outgoing HTTP requests easy for developers\n * while still being compatible with the many PHP configurations under which\n * WordPress runs.\n *\n * Debugging includes several actions, which pass different variables for debugging the HTTP API.\n *\n * @since 2.7.0\n */\nclass WP_Http {\n\n\t// Aliases for HTTP response codes.\n\tconst HTTP_CONTINUE       = 100;\n\tconst SWITCHING_PROTOCOLS = 101;\n\tconst PROCESSING          = 102;\n\tconst EARLY_HINTS         = 103;\n\n\tconst OK                            = 200;\n\tconst CREATED                       = 201;\n\tconst ACCEPTED                      = 202;\n\tconst NON_AUTHORITATIVE_INFORMATION = 203;\n\tconst NO_CONTENT                    = 204;\n\tconst RESET_CONTENT                 = 205;\n\tconst PARTIAL_CONTENT               = 206;\n\tconst MULTI_STATUS                  = 207;\n\tconst IM_USED                       = 226;\n\n\tconst MULTIPLE_CHOICES   = 300;\n\tconst MOVED_PERMANENTLY  = 301;\n\tconst FOUND              = 302;\n\tconst SEE_OTHER          = 303;\n\tconst NOT_MODIFIED       = 304;\n\tconst USE_PROXY          = 305;\n\tconst RESERVED           = 306;\n\tconst TEMPORARY_REDIRECT = 307;\n\tconst PERMANENT_REDIRECT = 308;\n\n\tconst BAD_REQUEST                     = 400;\n\tconst UNAUTHORIZED                    = 401;\n\tconst PAYMENT_REQUIRED                = 402;\n\tconst FORBIDDEN                       = 403;\n\tconst NOT_FOUND                       = 404;\n\tconst METHOD_NOT_ALLOWED              = 405;\n\tconst NOT_ACCEPTABLE                  = 406;\n\tconst PROXY_AUTHENTICATION_REQUIRED   = 407;\n\tconst REQUEST_TIMEOUT                 = 408;\n\tconst CONFLICT                        = 409;\n\tconst GONE                            = 410;\n\tconst LENGTH_REQUIRED                 = 411;\n\tconst PRECONDITION_FAILED             = 412;\n\tconst REQUEST_ENTITY_TOO_LARGE        = 413;\n\tconst REQUEST_URI_TOO_LONG            = 414;\n\tconst UNSUPPORTED_MEDIA_TYPE          = 415;\n\tconst REQUESTED_RANGE_NOT_SATISFIABLE = 416;\n\tconst EXPECTATION_FAILED              = 417;\n\tconst IM_A_TEAPOT                     = 418;\n\tconst MISDIRECTED_REQUEST             = 421;\n\tconst UNPROCESSABLE_ENTITY            = 422;\n\tconst LOCKED                          = 423;\n\tconst FAILED_DEPENDENCY               = 424;\n\tconst UPGRADE_REQUIRED                = 426;\n\tconst PRECONDITION_REQUIRED           = 428;\n\tconst TOO_MANY_REQUESTS               = 429;\n\tconst REQUEST_HEADER_FIELDS_TOO_LARGE = 431;\n\tconst UNAVAILABLE_FOR_LEGAL_REASONS   = 451;\n\n\tconst INTERNAL_SERVER_ERROR           = 500;\n\tconst NOT_IMPLEMENTED                 = 501;\n\tconst BAD_GATEWAY                     = 502;\n\tconst SERVICE_UNAVAILABLE             = 503;\n\tconst GATEWAY_TIMEOUT                 = 504;\n\tconst HTTP_VERSION_NOT_SUPPORTED      = 505;\n\tconst VARIANT_ALSO_NEGOTIATES         = 506;\n\tconst INSUFFICIENT_STORAGE            = 507;\n\tconst NOT_EXTENDED                    = 510;\n\tconst NETWORK_AUTHENTICATION_REQUIRED = 511;\n\n\t/**\n\t * Send an HTTP request to a URI.\n\t *\n\t * Please note: The only URI that are supported in the HTTP Transport implementation\n\t * are the HTTP and HTTPS protocols.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string       $url  The request URL.\n\t * @param string|array $args {\n\t *     Optional. Array or string of HTTP request arguments.\n\t *\n\t *     @type string       $method              Request method. Accepts 'GET', 'POST', 'HEAD', 'PUT', 'DELETE',\n\t *                                             'TRACE', 'OPTIONS', or 'PATCH'.\n\t *                                             Some transports technically allow others, but should not be\n\t *                                             assumed. Default 'GET'.\n\t *     @type float        $timeout             How long the connection should stay open in seconds. Default 5.\n\t *     @type int          $redirection         Number of allowed redirects. Not supported by all transports\n\t *                                             Default 5.\n\t *     @type string       $httpversion         Version of the HTTP protocol to use. Accepts '1.0' and '1.1'.\n\t *                                             Default '1.0'.\n\t *     @type string       $user-agent          User-agent value sent.\n\t *                                             Default 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ).\n\t *     @type bool         $reject_unsafe_urls  Whether to pass URLs through wp_http_validate_url().\n\t *                                             Default false.\n\t *     @type bool         $blocking            Whether the calling code requires the result of the request.\n\t *                                             If set to false, the request will be sent to the remote server,\n\t *                                             and processing returned to the calling code immediately, the caller\n\t *                                             will know if the request succeeded or failed, but will not receive\n\t *                                             any response from the remote server. Default true.\n\t *     @type string|array $headers             Array or string of headers to send with the request.\n\t *                                             Default empty array.\n\t *     @type array        $cookies             List of cookies to send with the request. Default empty array.\n\t *     @type string|array $body                Body to send with the request. Default null.\n\t *     @type bool         $compress            Whether to compress the $body when sending the request.\n\t *                                             Default false.\n\t *     @type bool         $decompress          Whether to decompress a compressed response. If set to false and\n\t *                                             compressed content is returned in the response anyway, it will\n\t *                                             need to be separately decompressed. Default true.\n\t *     @type bool         $sslverify           Whether to verify SSL for the request. Default true.\n\t *     @type string       $sslcertificates     Absolute path to an SSL certificate .crt file.\n\t *                                             Default ABSPATH . WPINC . '/certificates/ca-bundle.crt'.\n\t *     @type bool         $stream              Whether to stream to a file. If set to true and no filename was\n\t *                                             given, it will be droped it in the WP temp dir and its name will\n\t *                                             be set using the basename of the URL. Default false.\n\t *     @type string       $filename            Filename of the file to write to when streaming. $stream must be\n\t *                                             set to true. Default null.\n\t *     @type int          $limit_response_size Size in bytes to limit the response to. Default null.\n\t *\n\t * }\n\t * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'.\n\t *                        A WP_Error instance upon error.\n\t */\n\tpublic function request( $url, $args = array() ) {\n\t\t$defaults = array(\n\t\t\t'method'              => 'GET',\n\t\t\t/**\n\t\t\t * Filters the timeout value for an HTTP request.\n\t\t\t *\n\t\t\t * @since 2.7.0\n\t\t\t * @since 5.1.0 The `$url` parameter was added.\n\t\t\t *\n\t\t\t * @param float  $timeout_value Time in seconds until a request times out. Default 5.\n\t\t\t * @param string $url           The request URL.\n\t\t\t */\n\t\t\t'timeout'             => apply_filters( 'http_request_timeout', 5, $url ),\n\t\t\t/**\n\t\t\t * Filters the number of redirects allowed during an HTTP request.\n\t\t\t *\n\t\t\t * @since 2.7.0\n\t\t\t * @since 5.1.0 The `$url` parameter was added.\n\t\t\t *\n\t\t\t * @param int    $redirect_count Number of redirects allowed. Default 5.\n\t\t\t * @param string $url            The request URL.\n\t\t\t */\n\t\t\t'redirection'         => apply_filters( 'http_request_redirection_count', 5, $url ),\n\t\t\t/**\n\t\t\t * Filters the version of the HTTP protocol used in a request.\n\t\t\t *\n\t\t\t * @since 2.7.0\n\t\t\t * @since 5.1.0 The `$url` parameter was added.\n\t\t\t *\n\t\t\t * @param string $version Version of HTTP used. Accepts '1.0' and '1.1'. Default '1.0'.\n\t\t\t * @param string $url     The request URL.\n\t\t\t */\n\t\t\t'httpversion'         => apply_filters( 'http_request_version', '1.0', $url ),\n\t\t\t/**\n\t\t\t * Filters the user agent value sent with an HTTP request.\n\t\t\t *\n\t\t\t * @since 2.7.0\n\t\t\t * @since 5.1.0 The `$url` parameter was added.\n\t\t\t *\n\t\t\t * @param string $user_agent WordPress user agent string.\n\t\t\t * @param string $url        The request URL.\n\t\t\t */\n\t\t\t'user-agent'          => apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ), $url ),\n\t\t\t/**\n\t\t\t * Filters whether to pass URLs through wp_http_validate_url() in an HTTP request.\n\t\t\t *\n\t\t\t * @since 3.6.0\n\t\t\t * @since 5.1.0 The `$url` parameter was added.\n\t\t\t *\n\t\t\t * @param bool   $pass_url Whether to pass URLs through wp_http_validate_url(). Default false.\n\t\t\t * @param string $url      The request URL.\n\t\t\t */\n\t\t\t'reject_unsafe_urls'  => apply_filters( 'http_request_reject_unsafe_urls', false, $url ),\n\t\t\t'blocking'            => true,\n\t\t\t'headers'             => array(),\n\t\t\t'cookies'             => array(),\n\t\t\t'body'                => null,\n\t\t\t'compress'            => false,\n\t\t\t'decompress'          => true,\n\t\t\t'sslverify'           => true,\n\t\t\t'sslcertificates'     => ABSPATH . WPINC . '/certificates/ca-bundle.crt',\n\t\t\t'stream'              => false,\n\t\t\t'filename'            => null,\n\t\t\t'limit_response_size' => null,\n\t\t);\n\n\t\t// Pre-parse for the HEAD checks.\n\t\t$args = wp_parse_args( $args );\n\n\t\t// By default, HEAD requests do not cause redirections.\n\t\tif ( isset( $args['method'] ) && 'HEAD' === $args['method'] ) {\n\t\t\t$defaults['redirection'] = 0;\n\t\t}\n\n\t\t$parsed_args = wp_parse_args( $args, $defaults );\n\t\t/**\n\t\t * Filters the arguments used in an HTTP request.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param array  $parsed_args An array of HTTP request arguments.\n\t\t * @param string $url         The request URL.\n\t\t */\n\t\t$parsed_args = apply_filters( 'http_request_args', $parsed_args, $url );\n\n\t\t// The transports decrement this, store a copy of the original value for loop purposes.\n\t\tif ( ! isset( $parsed_args['_redirection'] ) ) {\n\t\t\t$parsed_args['_redirection'] = $parsed_args['redirection'];\n\t\t}\n\n\t\t/**\n\t\t * Filters the preemptive return value of an HTTP request.\n\t\t *\n\t\t * Returning a non-false value from the filter will short-circuit the HTTP request and return\n\t\t * early with that value. A filter should return one of:\n\t\t *\n\t\t *  - An array containing 'headers', 'body', 'response', 'cookies', and 'filename' elements\n\t\t *  - A WP_Error instance\n\t\t *  - boolean false to avoid short-circuiting the response\n\t\t *\n\t\t * Returning any other value may result in unexpected behaviour.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param false|array|WP_Error $preempt     A preemptive return value of an HTTP request. Default false.\n\t\t * @param array                $parsed_args HTTP request arguments.\n\t\t * @param string               $url         The request URL.\n\t\t */\n\t\t$pre = apply_filters( 'pre_http_request', false, $parsed_args, $url );\n\n\t\tif ( false !== $pre ) {\n\t\t\treturn $pre;\n\t\t}\n\n\t\tif ( function_exists( 'wp_kses_bad_protocol' ) ) {\n\t\t\tif ( $parsed_args['reject_unsafe_urls'] ) {\n\t\t\t\t$url = wp_http_validate_url( $url );\n\t\t\t}\n\t\t\tif ( $url ) {\n\t\t\t\t$url = wp_kses_bad_protocol( $url, array( 'http', 'https', 'ssl' ) );\n\t\t\t}\n\t\t}\n\n\t\t$arrURL = parse_url( $url );\n\n\t\tif ( empty( $url ) || empty( $arrURL['scheme'] ) ) {\n\t\t\t$response = new WP_Error( 'http_request_failed', __( 'A valid URL was not provided.' ) );\n\t\t\t/** This action is documented in wp-includes/class-http.php */\n\t\t\tdo_action( 'http_api_debug', $response, 'response', 'Requests', $parsed_args, $url );\n\t\t\treturn $response;\n\t\t}\n\n\t\tif ( $this->block_request( $url ) ) {\n\t\t\t$response = new WP_Error( 'http_request_not_executed', __( 'User has blocked requests through HTTP.' ) );\n\t\t\t/** This action is documented in wp-includes/class-http.php */\n\t\t\tdo_action( 'http_api_debug', $response, 'response', 'Requests', $parsed_args, $url );\n\t\t\treturn $response;\n\t\t}\n\n\t\t// If we are streaming to a file but no filename was given drop it in the WP temp dir\n\t\t// and pick its name using the basename of the $url.\n\t\tif ( $parsed_args['stream'] ) {\n\t\t\tif ( empty( $parsed_args['filename'] ) ) {\n\t\t\t\t$parsed_args['filename'] = get_temp_dir() . basename( $url );\n\t\t\t}\n\n\t\t\t// Force some settings if we are streaming to a file and check for existence\n\t\t\t// and perms of destination directory.\n\t\t\t$parsed_args['blocking'] = true;\n\t\t\tif ( ! wp_is_writable( dirname( $parsed_args['filename'] ) ) ) {\n\t\t\t\t$response = new WP_Error( 'http_request_failed', __( 'Destination directory for file streaming does not exist or is not writable.' ) );\n\t\t\t\t/** This action is documented in wp-includes/class-http.php */\n\t\t\t\tdo_action( 'http_api_debug', $response, 'response', 'Requests', $parsed_args, $url );\n\t\t\t\treturn $response;\n\t\t\t}\n\t\t}\n\n\t\tif ( is_null( $parsed_args['headers'] ) ) {\n\t\t\t$parsed_args['headers'] = array();\n\t\t}\n\n\t\t// WP allows passing in headers as a string, weirdly.\n\t\tif ( ! is_array( $parsed_args['headers'] ) ) {\n\t\t\t$processedHeaders       = WP_Http::processHeaders( $parsed_args['headers'] );\n\t\t\t$parsed_args['headers'] = $processedHeaders['headers'];\n\t\t}\n\n\t\t// Setup arguments.\n\t\t$headers = $parsed_args['headers'];\n\t\t$data    = $parsed_args['body'];\n\t\t$type    = $parsed_args['method'];\n\t\t$options = array(\n\t\t\t'timeout'   => $parsed_args['timeout'],\n\t\t\t'useragent' => $parsed_args['user-agent'],\n\t\t\t'blocking'  => $parsed_args['blocking'],\n\t\t\t'hooks'     => new WP_HTTP_Requests_Hooks( $url, $parsed_args ),\n\t\t);\n\n\t\t// Ensure redirects follow browser behaviour.\n\t\t$options['hooks']->register( 'requests.before_redirect', array( get_class(), 'browser_redirect_compatibility' ) );\n\n\t\t// Validate redirected URLs.\n\t\tif ( function_exists( 'wp_kses_bad_protocol' ) && $parsed_args['reject_unsafe_urls'] ) {\n\t\t\t$options['hooks']->register( 'requests.before_redirect', array( get_class(), 'validate_redirects' ) );\n\t\t}\n\n\t\tif ( $parsed_args['stream'] ) {\n\t\t\t$options['filename'] = $parsed_args['filename'];\n\t\t}\n\t\tif ( empty( $parsed_args['redirection'] ) ) {\n\t\t\t$options['follow_redirects'] = false;\n\t\t} else {\n\t\t\t$options['redirects'] = $parsed_args['redirection'];\n\t\t}\n\n\t\t// Use byte limit, if we can.\n\t\tif ( isset( $parsed_args['limit_response_size'] ) ) {\n\t\t\t$options['max_bytes'] = $parsed_args['limit_response_size'];\n\t\t}\n\n\t\t// If we've got cookies, use and convert them to Requests_Cookie.\n\t\tif ( ! empty( $parsed_args['cookies'] ) ) {\n\t\t\t$options['cookies'] = WP_Http::normalize_cookies( $parsed_args['cookies'] );\n\t\t}\n\n\t\t// SSL certificate handling.\n\t\tif ( ! $parsed_args['sslverify'] ) {\n\t\t\t$options['verify']     = false;\n\t\t\t$options['verifyname'] = false;\n\t\t} else {\n\t\t\t$options['verify'] = $parsed_args['sslcertificates'];\n\t\t}\n\n\t\t// All non-GET/HEAD requests should put the arguments in the form body.\n\t\tif ( 'HEAD' !== $type && 'GET' !== $type ) {\n\t\t\t$options['data_format'] = 'body';\n\t\t}\n\n\t\t/**\n\t\t * Filters whether SSL should be verified for non-local requests.\n\t\t *\n\t\t * @since 2.8.0\n\t\t * @since 5.1.0 The `$url` parameter was added.\n\t\t *\n\t\t * @param bool   $ssl_verify Whether to verify the SSL connection. Default true.\n\t\t * @param string $url        The request URL.\n\t\t */\n\t\t$options['verify'] = apply_filters( 'https_ssl_verify', $options['verify'], $url );\n\n\t\t// Check for proxies.\n\t\t$proxy = new WP_HTTP_Proxy();\n\t\tif ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {\n\t\t\t$options['proxy'] = new Requests_Proxy_HTTP( $proxy->host() . ':' . $proxy->port() );\n\n\t\t\tif ( $proxy->use_authentication() ) {\n\t\t\t\t$options['proxy']->use_authentication = true;\n\t\t\t\t$options['proxy']->user               = $proxy->username();\n\t\t\t\t$options['proxy']->pass               = $proxy->password();\n\t\t\t}\n\t\t}\n\n\t\t// Avoid issues where mbstring.func_overload is enabled.\n\t\tmbstring_binary_safe_encoding();\n\n\t\ttry {\n\t\t\t$requests_response = Requests::request( $url, $headers, $data, $type, $options );\n\n\t\t\t// Convert the response into an array.\n\t\t\t$http_response = new WP_HTTP_Requests_Response( $requests_response, $parsed_args['filename'] );\n\t\t\t$response      = $http_response->to_array();\n\n\t\t\t// Add the original object to the array.\n\t\t\t$response['http_response'] = $http_response;\n\t\t} catch ( Requests_Exception $e ) {\n\t\t\t$response = new WP_Error( 'http_request_failed', $e->getMessage() );\n\t\t}\n\n\t\treset_mbstring_encoding();\n\n\t\t/**\n\t\t * Fires after an HTTP API response is received and before the response is returned.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param array|WP_Error $response    HTTP response or WP_Error object.\n\t\t * @param string         $context     Context under which the hook is fired.\n\t\t * @param string         $class       HTTP transport used.\n\t\t * @param array          $parsed_args HTTP request arguments.\n\t\t * @param string         $url         The request URL.\n\t\t */\n\t\tdo_action( 'http_api_debug', $response, 'response', 'Requests', $parsed_args, $url );\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\treturn $response;\n\t\t}\n\n\t\tif ( ! $parsed_args['blocking'] ) {\n\t\t\treturn array(\n\t\t\t\t'headers'       => array(),\n\t\t\t\t'body'          => '',\n\t\t\t\t'response'      => array(\n\t\t\t\t\t'code'    => false,\n\t\t\t\t\t'message' => false,\n\t\t\t\t),\n\t\t\t\t'cookies'       => array(),\n\t\t\t\t'http_response' => null,\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Filters the HTTP API response immediately before the response is returned.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param array  $response    HTTP response.\n\t\t * @param array  $parsed_args HTTP request arguments.\n\t\t * @param string $url         The request URL.\n\t\t */\n\t\treturn apply_filters( 'http_response', $response, $parsed_args, $url );\n\t}\n\n\t/**\n\t * Normalizes cookies for using in Requests.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param array $cookies Array of cookies to send with the request.\n\t * @return Requests_Cookie_Jar Cookie holder object.\n\t */\n\tpublic static function normalize_cookies( $cookies ) {\n\t\t$cookie_jar = new Requests_Cookie_Jar();\n\n\t\tforeach ( $cookies as $name => $value ) {\n\t\t\tif ( $value instanceof WP_Http_Cookie ) {\n\t\t\t\t$cookie_jar[ $value->name ] = new Requests_Cookie( $value->name, $value->value, $value->get_attributes(), array( 'host-only' => $value->host_only ) );\n\t\t\t} elseif ( is_scalar( $value ) ) {\n\t\t\t\t$cookie_jar[ $name ] = new Requests_Cookie( $name, $value );\n\t\t\t}\n\t\t}\n\n\t\treturn $cookie_jar;\n\t}\n\n\t/**\n\t * Match redirect behaviour to browser handling.\n\t *\n\t * Changes 302 redirects from POST to GET to match browser handling. Per\n\t * RFC 7231, user agents can deviate from the strict reading of the\n\t * specification for compatibility purposes.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string            $location URL to redirect to.\n\t * @param array             $headers  Headers for the redirect.\n\t * @param string|array      $data     Body to send with the request.\n\t * @param array             $options  Redirect request options.\n\t * @param Requests_Response $original Response object.\n\t */\n\tpublic static function browser_redirect_compatibility( $location, $headers, $data, &$options, $original ) {\n\t\t// Browser compatibility.\n\t\tif ( 302 === $original->status_code ) {\n\t\t\t$options['type'] = Requests::GET;\n\t\t}\n\t}\n\n\t/**\n\t * Validate redirected URLs.\n\t *\n\t * @since 4.7.5\n\t *\n\t * @throws Requests_Exception On unsuccessful URL validation.\n\t * @param string $location URL to redirect to.\n\t */\n\tpublic static function validate_redirects( $location ) {\n\t\tif ( ! wp_http_validate_url( $location ) ) {\n\t\t\tthrow new Requests_Exception( __( 'A valid URL was not provided.' ), 'wp_http.redirect_failed_validation' );\n\t\t}\n\t}\n\n\t/**\n\t * Tests which transports are capable of supporting the request.\n\t *\n\t * @since 3.2.0\n\t *\n\t * @param array  $args Request arguments.\n\t * @param string $url  URL to request.\n\t * @return string|false Class name for the first transport that claims to support the request.\n\t *                      False if no transport claims to support the request.\n\t */\n\tpublic function _get_first_available_transport( $args, $url = null ) {\n\t\t$transports = array( 'curl', 'streams' );\n\n\t\t/**\n\t\t * Filters which HTTP transports are available and in what order.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param string[] $transports Array of HTTP transports to check. Default array contains\n\t\t *                             'curl' and 'streams', in that order.\n\t\t * @param array    $args       HTTP request arguments.\n\t\t * @param string   $url        The URL to request.\n\t\t */\n\t\t$request_order = apply_filters( 'http_api_transports', $transports, $args, $url );\n\n\t\t// Loop over each transport on each HTTP request looking for one which will serve this request's needs.\n\t\tforeach ( $request_order as $transport ) {\n\t\t\tif ( in_array( $transport, $transports, true ) ) {\n\t\t\t\t$transport = ucfirst( $transport );\n\t\t\t}\n\t\t\t$class = 'WP_Http_' . $transport;\n\n\t\t\t// Check to see if this transport is a possibility, calls the transport statically.\n\t\t\tif ( ! call_user_func( array( $class, 'test' ), $args, $url ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\treturn $class;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Dispatches a HTTP request to a supporting transport.\n\t *\n\t * Tests each transport in order to find a transport which matches the request arguments.\n\t * Also caches the transport instance to be used later.\n\t *\n\t * The order for requests is cURL, and then PHP Streams.\n\t *\n\t * @since 3.2.0\n\t * @deprecated 5.1.0 Use WP_Http::request()\n\t * @see WP_Http::request()\n\t *\n\t * @param string $url  URL to request.\n\t * @param array  $args Request arguments.\n\t * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'.\n\t *                        A WP_Error instance upon error.\n\t */\n\tprivate function _dispatch_request( $url, $args ) {\n\t\tstatic $transports = array();\n\n\t\t$class = $this->_get_first_available_transport( $args, $url );\n\t\tif ( ! $class ) {\n\t\t\treturn new WP_Error( 'http_failure', __( 'There are no HTTP transports available which can complete the requested request.' ) );\n\t\t}\n\n\t\t// Transport claims to support request, instantiate it and give it a whirl.\n\t\tif ( empty( $transports[ $class ] ) ) {\n\t\t\t$transports[ $class ] = new $class;\n\t\t}\n\n\t\t$response = $transports[ $class ]->request( $url, $args );\n\n\t\t/** This action is documented in wp-includes/class-http.php */\n\t\tdo_action( 'http_api_debug', $response, 'response', $class, $args, $url );\n\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\treturn $response;\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/class-http.php */\n\t\treturn apply_filters( 'http_response', $response, $args, $url );\n\t}\n\n\t/**\n\t * Uses the POST HTTP method.\n\t *\n\t * Used for sending data that is expected to be in the body.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string       $url  The request URL.\n\t * @param string|array $args Optional. Override the defaults.\n\t * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'.\n\t *                        A WP_Error instance upon error.\n\t */\n\tpublic function post( $url, $args = array() ) {\n\t\t$defaults    = array( 'method' => 'POST' );\n\t\t$parsed_args = wp_parse_args( $args, $defaults );\n\t\treturn $this->request( $url, $parsed_args );\n\t}\n\n\t/**\n\t * Uses the GET HTTP method.\n\t *\n\t * Used for sending data that is expected to be in the body.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string       $url  The request URL.\n\t * @param string|array $args Optional. Override the defaults.\n\t * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'.\n\t *                        A WP_Error instance upon error.\n\t */\n\tpublic function get( $url, $args = array() ) {\n\t\t$defaults    = array( 'method' => 'GET' );\n\t\t$parsed_args = wp_parse_args( $args, $defaults );\n\t\treturn $this->request( $url, $parsed_args );\n\t}\n\n\t/**\n\t * Uses the HEAD HTTP method.\n\t *\n\t * Used for sending data that is expected to be in the body.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string       $url  The request URL.\n\t * @param string|array $args Optional. Override the defaults.\n\t * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'.\n\t *                        A WP_Error instance upon error.\n\t */\n\tpublic function head( $url, $args = array() ) {\n\t\t$defaults    = array( 'method' => 'HEAD' );\n\t\t$parsed_args = wp_parse_args( $args, $defaults );\n\t\treturn $this->request( $url, $parsed_args );\n\t}\n\n\t/**\n\t * Parses the responses and splits the parts into headers and body.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $strResponse The full response string.\n\t * @return array {\n\t *     Array with response headers and body.\n\t *\n\t *     @type string $headers HTTP response headers.\n\t *     @type string $body    HTTP response body.\n\t * }\n\t */\n\tpublic static function processResponse( $strResponse ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid\n\t\t$res = explode( \"\\r\\n\\r\\n\", $strResponse, 2 );\n\n\t\treturn array(\n\t\t\t'headers' => $res[0],\n\t\t\t'body'    => isset( $res[1] ) ? $res[1] : '',\n\t\t);\n\t}\n\n\t/**\n\t * Transforms header string into an array.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string|array $headers The original headers. If a string is passed, it will be converted\n\t *                              to an array. If an array is passed, then it is assumed to be\n\t *                              raw header data with numeric keys with the headers as the values.\n\t *                              No headers must be passed that were already processed.\n\t * @param string       $url     Optional. The URL that was requested. Default empty.\n\t * @return array {\n\t *     Processed string headers. If duplicate headers are encountered,\n\t *     then a numbered array is returned as the value of that header-key.\n\t *\n\t *     @type array            $response {\n\t *          @type int    $code    The response status code. Default 0.\n\t *          @type string $message The response message. Default empty.\n\t *     }\n\t *     @type array            $newheaders The processed header data as a multidimensional array.\n\t *     @type WP_Http_Cookie[] $cookies    If the original headers contain the 'Set-Cookie' key,\n\t *                                        an array containing `WP_Http_Cookie` objects is returned.\n\t * }\n\t */\n\tpublic static function processHeaders( $headers, $url = '' ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid\n\t\t// Split headers, one per array element.\n\t\tif ( is_string( $headers ) ) {\n\t\t\t// Tolerate line terminator: CRLF = LF (RFC 2616 19.3).\n\t\t\t$headers = str_replace( \"\\r\\n\", \"\\n\", $headers );\n\t\t\t/*\n\t\t\t * Unfold folded header fields. LWS = [CRLF] 1*( SP | HT ) <US-ASCII SP, space (32)>,\n\t\t\t * <US-ASCII HT, horizontal-tab (9)> (RFC 2616 2.2).\n\t\t\t */\n\t\t\t$headers = preg_replace( '/\\n[ \\t]/', ' ', $headers );\n\t\t\t// Create the headers array.\n\t\t\t$headers = explode( \"\\n\", $headers );\n\t\t}\n\n\t\t$response = array(\n\t\t\t'code'    => 0,\n\t\t\t'message' => '',\n\t\t);\n\n\t\t/*\n\t\t * If a redirection has taken place, The headers for each page request may have been passed.\n\t\t * In this case, determine the final HTTP header and parse from there.\n\t\t */\n\t\tfor ( $i = count( $headers ) - 1; $i >= 0; $i-- ) {\n\t\t\tif ( ! empty( $headers[ $i ] ) && false === strpos( $headers[ $i ], ':' ) ) {\n\t\t\t\t$headers = array_splice( $headers, $i );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$cookies    = array();\n\t\t$newheaders = array();\n\t\tforeach ( (array) $headers as $tempheader ) {\n\t\t\tif ( empty( $tempheader ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( false === strpos( $tempheader, ':' ) ) {\n\t\t\t\t$stack   = explode( ' ', $tempheader, 3 );\n\t\t\t\t$stack[] = '';\n\t\t\t\tlist( , $response['code'], $response['message']) = $stack;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlist($key, $value) = explode( ':', $tempheader, 2 );\n\n\t\t\t$key   = strtolower( $key );\n\t\t\t$value = trim( $value );\n\n\t\t\tif ( isset( $newheaders[ $key ] ) ) {\n\t\t\t\tif ( ! is_array( $newheaders[ $key ] ) ) {\n\t\t\t\t\t$newheaders[ $key ] = array( $newheaders[ $key ] );\n\t\t\t\t}\n\t\t\t\t$newheaders[ $key ][] = $value;\n\t\t\t} else {\n\t\t\t\t$newheaders[ $key ] = $value;\n\t\t\t}\n\t\t\tif ( 'set-cookie' === $key ) {\n\t\t\t\t$cookies[] = new WP_Http_Cookie( $value, $url );\n\t\t\t}\n\t\t}\n\n\t\t// Cast the Response Code to an int.\n\t\t$response['code'] = intval( $response['code'] );\n\n\t\treturn array(\n\t\t\t'response' => $response,\n\t\t\t'headers'  => $newheaders,\n\t\t\t'cookies'  => $cookies,\n\t\t);\n\t}\n\n\t/**\n\t * Takes the arguments for a ::request() and checks for the cookie array.\n\t *\n\t * If it's found, then it upgrades any basic name => value pairs to WP_Http_Cookie instances,\n\t * which are each parsed into strings and added to the Cookie: header (within the arguments array).\n\t * Edits the array by reference.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $r Full array of args passed into ::request()\n\t */\n\tpublic static function buildCookieHeader( &$r ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid\n\t\tif ( ! empty( $r['cookies'] ) ) {\n\t\t\t// Upgrade any name => value cookie pairs to WP_HTTP_Cookie instances.\n\t\t\tforeach ( $r['cookies'] as $name => $value ) {\n\t\t\t\tif ( ! is_object( $value ) ) {\n\t\t\t\t\t$r['cookies'][ $name ] = new WP_Http_Cookie(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'name'  => $name,\n\t\t\t\t\t\t\t'value' => $value,\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$cookies_header = '';\n\t\t\tforeach ( (array) $r['cookies'] as $cookie ) {\n\t\t\t\t$cookies_header .= $cookie->getHeaderValue() . '; ';\n\t\t\t}\n\n\t\t\t$cookies_header         = substr( $cookies_header, 0, -2 );\n\t\t\t$r['headers']['cookie'] = $cookies_header;\n\t\t}\n\t}\n\n\t/**\n\t * Decodes chunk transfer-encoding, based off the HTTP 1.1 specification.\n\t *\n\t * Based off the HTTP http_encoding_dechunk function.\n\t *\n\t * @link https://tools.ietf.org/html/rfc2616#section-19.4.6 Process for chunked decoding.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $body Body content.\n\t * @return string Chunked decoded body on success or raw body on failure.\n\t */\n\tpublic static function chunkTransferDecode( $body ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid\n\t\t// The body is not chunked encoded or is malformed.\n\t\tif ( ! preg_match( '/^([0-9a-f]+)[^\\r\\n]*\\r\\n/i', trim( $body ) ) ) {\n\t\t\treturn $body;\n\t\t}\n\n\t\t$parsed_body = '';\n\n\t\t// We'll be altering $body, so need a backup in case of error.\n\t\t$body_original = $body;\n\n\t\twhile ( true ) {\n\t\t\t$has_chunk = (bool) preg_match( '/^([0-9a-f]+)[^\\r\\n]*\\r\\n/i', $body, $match );\n\t\t\tif ( ! $has_chunk || empty( $match[1] ) ) {\n\t\t\t\treturn $body_original;\n\t\t\t}\n\n\t\t\t$length       = hexdec( $match[1] );\n\t\t\t$chunk_length = strlen( $match[0] );\n\n\t\t\t// Parse out the chunk of data.\n\t\t\t$parsed_body .= substr( $body, $chunk_length, $length );\n\n\t\t\t// Remove the chunk from the raw data.\n\t\t\t$body = substr( $body, $length + $chunk_length );\n\n\t\t\t// End of the document.\n\t\t\tif ( '0' === trim( $body ) ) {\n\t\t\t\treturn $parsed_body;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Determines whether an HTTP API request to the given URL should be blocked.\n\t *\n\t * Those who are behind a proxy and want to prevent access to certain hosts may do so. This will\n\t * prevent plugins from working and core functionality, if you don't include `api.wordpress.org`.\n\t *\n\t * You block external URL requests by defining `WP_HTTP_BLOCK_EXTERNAL` as true in your `wp-config.php`\n\t * file and this will only allow localhost and your site to make requests. The constant\n\t * `WP_ACCESSIBLE_HOSTS` will allow additional hosts to go through for requests. The format of the\n\t * `WP_ACCESSIBLE_HOSTS` constant is a comma separated list of hostnames to allow, wildcard domains\n\t * are supported, eg `*.wordpress.org` will allow for all subdomains of `wordpress.org` to be contacted.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @link https://core.trac.wordpress.org/ticket/8927 Allow preventing external requests.\n\t * @link https://core.trac.wordpress.org/ticket/14636 Allow wildcard domains in WP_ACCESSIBLE_HOSTS\n\t *\n\t * @param string $uri URI of url.\n\t * @return bool True to block, false to allow.\n\t */\n\tpublic function block_request( $uri ) {\n\t\t// We don't need to block requests, because nothing is blocked.\n\t\tif ( ! defined( 'WP_HTTP_BLOCK_EXTERNAL' ) || ! WP_HTTP_BLOCK_EXTERNAL ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$check = parse_url( $uri );\n\t\tif ( ! $check ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$home = parse_url( get_option( 'siteurl' ) );\n\n\t\t// Don't block requests back to ourselves by default.\n\t\tif ( 'localhost' === $check['host'] || ( isset( $home['host'] ) && $home['host'] == $check['host'] ) ) {\n\t\t\t/**\n\t\t\t * Filters whether to block local HTTP API requests.\n\t\t\t *\n\t\t\t * A local request is one to `localhost` or to the same host as the site itself.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t *\n\t\t\t * @param bool $block Whether to block local requests. Default false.\n\t\t\t */\n\t\t\treturn apply_filters( 'block_local_requests', false );\n\t\t}\n\n\t\tif ( ! defined( 'WP_ACCESSIBLE_HOSTS' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tstatic $accessible_hosts = null;\n\t\tstatic $wildcard_regex   = array();\n\t\tif ( null === $accessible_hosts ) {\n\t\t\t$accessible_hosts = preg_split( '|,\\s*|', WP_ACCESSIBLE_HOSTS );\n\n\t\t\tif ( false !== strpos( WP_ACCESSIBLE_HOSTS, '*' ) ) {\n\t\t\t\t$wildcard_regex = array();\n\t\t\t\tforeach ( $accessible_hosts as $host ) {\n\t\t\t\t\t$wildcard_regex[] = str_replace( '\\*', '.+', preg_quote( $host, '/' ) );\n\t\t\t\t}\n\t\t\t\t$wildcard_regex = '/^(' . implode( '|', $wildcard_regex ) . ')$/i';\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $wildcard_regex ) ) {\n\t\t\treturn ! preg_match( $wildcard_regex, $check['host'] );\n\t\t} else {\n\t\t\treturn ! in_array( $check['host'], $accessible_hosts, true ); // Inverse logic, if it's in the array, then don't block it.\n\t\t}\n\n\t}\n\n\t/**\n\t * Used as a wrapper for PHP's parse_url() function that handles edgecases in < PHP 5.4.7.\n\t *\n\t * @deprecated 4.4.0 Use wp_parse_url()\n\t * @see wp_parse_url()\n\t *\n\t * @param string $url The URL to parse.\n\t * @return bool|array False on failure; Array of URL components on success;\n\t *                    See parse_url()'s return values.\n\t */\n\tprotected static function parse_url( $url ) {\n\t\t_deprecated_function( __METHOD__, '4.4.0', 'wp_parse_url()' );\n\t\treturn wp_parse_url( $url );\n\t}\n\n\t/**\n\t * Converts a relative URL to an absolute URL relative to a given URL.\n\t *\n\t * If an Absolute URL is provided, no processing of that URL is done.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $maybe_relative_path The URL which might be relative.\n\t * @param string $url                 The URL which $maybe_relative_path is relative to.\n\t * @return string An Absolute URL, in a failure condition where the URL cannot be parsed, the relative URL will be returned.\n\t */\n\tpublic static function make_absolute_url( $maybe_relative_path, $url ) {\n\t\tif ( empty( $url ) ) {\n\t\t\treturn $maybe_relative_path;\n\t\t}\n\n\t\t$url_parts = wp_parse_url( $url );\n\t\tif ( ! $url_parts ) {\n\t\t\treturn $maybe_relative_path;\n\t\t}\n\n\t\t$relative_url_parts = wp_parse_url( $maybe_relative_path );\n\t\tif ( ! $relative_url_parts ) {\n\t\t\treturn $maybe_relative_path;\n\t\t}\n\n\t\t// Check for a scheme on the 'relative' URL.\n\t\tif ( ! empty( $relative_url_parts['scheme'] ) ) {\n\t\t\treturn $maybe_relative_path;\n\t\t}\n\n\t\t$absolute_path = $url_parts['scheme'] . '://';\n\n\t\t// Schemeless URLs will make it this far, so we check for a host in the relative URL\n\t\t// and convert it to a protocol-URL.\n\t\tif ( isset( $relative_url_parts['host'] ) ) {\n\t\t\t$absolute_path .= $relative_url_parts['host'];\n\t\t\tif ( isset( $relative_url_parts['port'] ) ) {\n\t\t\t\t$absolute_path .= ':' . $relative_url_parts['port'];\n\t\t\t}\n\t\t} else {\n\t\t\t$absolute_path .= $url_parts['host'];\n\t\t\tif ( isset( $url_parts['port'] ) ) {\n\t\t\t\t$absolute_path .= ':' . $url_parts['port'];\n\t\t\t}\n\t\t}\n\n\t\t// Start off with the absolute URL path.\n\t\t$path = ! empty( $url_parts['path'] ) ? $url_parts['path'] : '/';\n\n\t\t// If it's a root-relative path, then great.\n\t\tif ( ! empty( $relative_url_parts['path'] ) && '/' === $relative_url_parts['path'][0] ) {\n\t\t\t$path = $relative_url_parts['path'];\n\n\t\t\t// Else it's a relative path.\n\t\t} elseif ( ! empty( $relative_url_parts['path'] ) ) {\n\t\t\t// Strip off any file components from the absolute path.\n\t\t\t$path = substr( $path, 0, strrpos( $path, '/' ) + 1 );\n\n\t\t\t// Build the new path.\n\t\t\t$path .= $relative_url_parts['path'];\n\n\t\t\t// Strip all /path/../ out of the path.\n\t\t\twhile ( strpos( $path, '../' ) > 1 ) {\n\t\t\t\t$path = preg_replace( '![^/]+/\\.\\./!', '', $path );\n\t\t\t}\n\n\t\t\t// Strip any final leading ../ from the path.\n\t\t\t$path = preg_replace( '!^/(\\.\\./)+!', '', $path );\n\t\t}\n\n\t\t// Add the query string.\n\t\tif ( ! empty( $relative_url_parts['query'] ) ) {\n\t\t\t$path .= '?' . $relative_url_parts['query'];\n\t\t}\n\n\t\treturn $absolute_path . '/' . ltrim( $path, '/' );\n\t}\n\n\t/**\n\t * Handles an HTTP redirect and follows it if appropriate.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param string $url      The URL which was requested.\n\t * @param array  $args     The arguments which were used to make the request.\n\t * @param array  $response The response of the HTTP request.\n\t * @return array|false|WP_Error An HTTP API response array if the redirect is successfully followed,\n\t *                              false if no redirect is present, or a WP_Error object if there's an error.\n\t */\n\tpublic static function handle_redirects( $url, $args, $response ) {\n\t\t// If no redirects are present, or, redirects were not requested, perform no action.\n\t\tif ( ! isset( $response['headers']['location'] ) || 0 === $args['_redirection'] ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only perform redirections on redirection http codes.\n\t\tif ( $response['response']['code'] > 399 || $response['response']['code'] < 300 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Don't redirect if we've run out of redirects.\n\t\tif ( $args['redirection']-- <= 0 ) {\n\t\t\treturn new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );\n\t\t}\n\n\t\t$redirect_location = $response['headers']['location'];\n\n\t\t// If there were multiple Location headers, use the last header specified.\n\t\tif ( is_array( $redirect_location ) ) {\n\t\t\t$redirect_location = array_pop( $redirect_location );\n\t\t}\n\n\t\t$redirect_location = WP_Http::make_absolute_url( $redirect_location, $url );\n\n\t\t// POST requests should not POST to a redirected location.\n\t\tif ( 'POST' === $args['method'] ) {\n\t\t\tif ( in_array( $response['response']['code'], array( 302, 303 ), true ) ) {\n\t\t\t\t$args['method'] = 'GET';\n\t\t\t}\n\t\t}\n\n\t\t// Include valid cookies in the redirect process.\n\t\tif ( ! empty( $response['cookies'] ) ) {\n\t\t\tforeach ( $response['cookies'] as $cookie ) {\n\t\t\t\tif ( $cookie->test( $redirect_location ) ) {\n\t\t\t\t\t$args['cookies'][] = $cookie;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn wp_remote_request( $redirect_location, $args );\n\t}\n\n\t/**\n\t * Determines if a specified string represents an IP address or not.\n\t *\n\t * This function also detects the type of the IP address, returning either\n\t * '4' or '6' to represent a IPv4 and IPv6 address respectively.\n\t * This does not verify if the IP is a valid IP, only that it appears to be\n\t * an IP address.\n\t *\n\t * @link http://home.deds.nl/~aeron/regex/ for IPv6 regex.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param string $maybe_ip A suspected IP address.\n\t * @return integer|bool Upon success, '4' or '6' to represent a IPv4 or IPv6 address, false upon failure\n\t */\n\tpublic static function is_ip_address( $maybe_ip ) {\n\t\tif ( preg_match( '/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/', $maybe_ip ) ) {\n\t\t\treturn 4;\n\t\t}\n\n\t\tif ( false !== strpos( $maybe_ip, ':' ) && preg_match( '/^(((?=.*(::))(?!.*\\3.+\\3))\\3?|([\\dA-F]{1,4}(\\3|:\\b|$)|\\2))(?4){5}((?4){2}|(((2[0-4]|1\\d|[1-9])?\\d|25[0-5])\\.?\\b){4})$/i', trim( $maybe_ip, ' []' ) ) ) {\n\t\t\treturn 6;\n\t\t}\n\n\t\treturn false;\n\t}\n\n}\n", "num_lines": 1094}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * IXR - The Incutio XML-RPC Library\n *\n * Copyright (c) 2010, Incutio Ltd.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n *  - Redistributions of source code must retain the above copyright notice,\n *    this list of conditions and the following disclaimer.\n *  - Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *  - Neither the name of Incutio Ltd. nor the names of its contributors\n *    may be used to endorse or promote products derived from this software\n *    without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n * IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\n * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE\n * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * @package IXR\n * @since 1.5.0\n *\n * @copyright  Incutio Ltd 2010 (http://www.incutio.com)\n * @version    1.7.4 7th September 2010\n * @author     Simon Willison\n * @link       http://scripts.incutio.com/xmlrpc/ Site/manual\n * @license    http://www.opensource.org/licenses/bsd-license.php BSD\n */\n\nrequire_once ABSPATH . WPINC . '/IXR/class-IXR-server.php';\n\nrequire_once ABSPATH . WPINC . '/IXR/class-IXR-base64.php';\n\nrequire_once ABSPATH . WPINC . '/IXR/class-IXR-client.php';\n\nrequire_once ABSPATH . WPINC . '/IXR/class-IXR-clientmulticall.php';\n\nrequire_once ABSPATH . WPINC . '/IXR/class-IXR-date.php';\n\nrequire_once ABSPATH . WPINC . '/IXR/class-IXR-error.php';\n\nrequire_once ABSPATH . WPINC . '/IXR/class-IXR-introspectionserver.php';\n\nrequire_once ABSPATH . WPINC . '/IXR/class-IXR-message.php';\n\nrequire_once ABSPATH . WPINC . '/IXR/class-IXR-request.php';\n\nrequire_once ABSPATH . WPINC . '/IXR/class-IXR-value.php';", "num_lines": 60}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n_deprecated_file( basename( __FILE__ ), '5.3.0', null, 'The PHP native JSON extension is now a requirement.' );\n\nif ( ! class_exists( 'Services_JSON' ) ) :\n/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */\n/**\n * Converts to and from JSON format.\n *\n * JSON (JavaScript Object Notation) is a lightweight data-interchange\n * format. It is easy for humans to read and write. It is easy for machines\n * to parse and generate. It is based on a subset of the JavaScript\n * Programming Language, Standard ECMA-262 3rd Edition - December 1999.\n * This feature can also be found in  Python. JSON is a text format that is\n * completely language independent but uses conventions that are familiar\n * to programmers of the C-family of languages, including C, C++, C#, Java,\n * JavaScript, Perl, TCL, and many others. These properties make JSON an\n * ideal data-interchange language.\n *\n * This package provides a simple encoder and decoder for JSON notation. It\n * is intended for use with client-side JavaScript applications that make\n * use of HTTPRequest to perform server communication functions - data can\n * be encoded into JSON notation for use in a client-side javaScript, or\n * decoded from incoming JavaScript requests. JSON format is native to\n * JavaScript, and can be directly eval()'ed with no further parsing\n * overhead\n *\n * All strings should be in ASCII or UTF-8 format!\n *\n * LICENSE: Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met: Redistributions of source code must retain the\n * above copyright notice, this list of conditions and the following\n * disclaimer. Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *\n * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN\n * NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\n * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE\n * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n * DAMAGE.\n *\n * @category\n * @package     Services_JSON\n * @author      Michal Migurski <mike-json@teczno.com>\n * @author      Matt Knapp <mdknapp[at]gmail[dot]com>\n * @author      Brett Stimmerman <brettstimmerman[at]gmail[dot]com>\n * @copyright   2005 Michal Migurski\n * @version     CVS: $Id: JSON.php 305040 2010-11-02 23:19:03Z alan_k $\n * @license     http://www.opensource.org/licenses/bsd-license.php\n * @link        http://pear.php.net/pepr/pepr-proposal-show.php?id=198\n */\n\n/**\n * Marker constant for Services_JSON::decode(), used to flag stack state\n */\ndefine('SERVICES_JSON_SLICE',   1);\n\n/**\n * Marker constant for Services_JSON::decode(), used to flag stack state\n */\ndefine('SERVICES_JSON_IN_STR',  2);\n\n/**\n * Marker constant for Services_JSON::decode(), used to flag stack state\n */\ndefine('SERVICES_JSON_IN_ARR',  3);\n\n/**\n * Marker constant for Services_JSON::decode(), used to flag stack state\n */\ndefine('SERVICES_JSON_IN_OBJ',  4);\n\n/**\n * Marker constant for Services_JSON::decode(), used to flag stack state\n */\ndefine('SERVICES_JSON_IN_CMT', 5);\n\n/**\n * Behavior switch for Services_JSON::decode()\n */\ndefine('SERVICES_JSON_LOOSE_TYPE', 16);\n\n/**\n * Behavior switch for Services_JSON::decode()\n */\ndefine('SERVICES_JSON_SUPPRESS_ERRORS', 32);\n\n/**\n * Behavior switch for Services_JSON::decode()\n */\ndefine('SERVICES_JSON_USE_TO_JSON', 64);\n\n/**\n * Converts to and from JSON format.\n *\n * Brief example of use:\n *\n * <code>\n * // create a new instance of Services_JSON\n * $json = new Services_JSON();\n *\n * // convert a complex value to JSON notation, and send it to the browser\n * $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4)));\n * $output = $json->encode($value);\n *\n * print($output);\n * // prints: [\"foo\",\"bar\",[1,2,\"baz\"],[3,[4]]]\n *\n * // accept incoming POST data, assumed to be in JSON notation\n * $input = file_get_contents('php://input', 1000000);\n * $value = $json->decode($input);\n * </code>\n */\nclass Services_JSON\n{\n   /**\n    * constructs a new JSON instance\n    *\n    * @deprecated 5.3.0 Use the PHP native JSON extension instead.\n    *\n    * @param    int     $use    object behavior flags; combine with boolean-OR\n    *\n    *                           possible values:\n    *                           - SERVICES_JSON_LOOSE_TYPE:  loose typing.\n    *                                   \"{...}\" syntax creates associative arrays\n    *                                   instead of objects in decode().\n    *                           - SERVICES_JSON_SUPPRESS_ERRORS:  error suppression.\n    *                                   Values which can't be encoded (e.g. resources)\n    *                                   appear as NULL instead of throwing errors.\n    *                                   By default, a deeply-nested resource will\n    *                                   bubble up with an error, so all return values\n    *                                   from encode() should be checked with isError()\n    *                           - SERVICES_JSON_USE_TO_JSON:  call toJSON when serializing objects\n    *                                   It serializes the return value from the toJSON call rather \n    *                                   than the object itself, toJSON can return associative arrays, \n    *                                   strings or numbers, if you return an object, make sure it does\n    *                                   not have a toJSON method, otherwise an error will occur.\n    */\n    function __construct( $use = 0 )\n    {\n        _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );\n\n        $this->use = $use;\n        $this->_mb_strlen            = function_exists('mb_strlen');\n        $this->_mb_convert_encoding  = function_exists('mb_convert_encoding');\n        $this->_mb_substr            = function_exists('mb_substr');\n    }\n\n\t/**\n\t * PHP4 constructor.\n     *\n     * @deprecated 5.3.0 Use __construct() instead.\n     *\n     * @see Services_JSON::__construct()\n\t */\n\tpublic function Services_JSON( $use = 0 ) {\n\t\t_deprecated_constructor( 'Services_JSON', '5.3.0', get_class( $this ) );\n\t\tself::__construct( $use );\n\t}\n    // private - cache the mbstring lookup results..\n    var $_mb_strlen = false;\n    var $_mb_substr = false;\n    var $_mb_convert_encoding = false;\n    \n   /**\n    * convert a string from one UTF-16 char to one UTF-8 char\n    *\n    * Normally should be handled by mb_convert_encoding, but\n    * provides a slower PHP-only method for installations\n    * that lack the multibye string extension.\n    *\n    * @deprecated 5.3.0 Use the PHP native JSON extension instead.\n    *\n    * @param    string  $utf16  UTF-16 character\n    * @return   string  UTF-8 character\n    * @access   private\n    */\n    function utf162utf8($utf16)\n    {\n        _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );\n\n        // oh please oh please oh please oh please oh please\n        if($this->_mb_convert_encoding) {\n            return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');\n        }\n\n        $bytes = (ord($utf16[0]) << 8) | ord($utf16[1]);\n\n        switch(true) {\n            case ((0x7F & $bytes) == $bytes):\n                // this case should never be reached, because we are in ASCII range\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return chr(0x7F & $bytes);\n\n            case (0x07FF & $bytes) == $bytes:\n                // return a 2-byte UTF-8 character\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return chr(0xC0 | (($bytes >> 6) & 0x1F))\n                     . chr(0x80 | ($bytes & 0x3F));\n\n            case (0xFFFF & $bytes) == $bytes:\n                // return a 3-byte UTF-8 character\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return chr(0xE0 | (($bytes >> 12) & 0x0F))\n                     . chr(0x80 | (($bytes >> 6) & 0x3F))\n                     . chr(0x80 | ($bytes & 0x3F));\n        }\n\n        // ignoring UTF-32 for now, sorry\n        return '';\n    }\n\n   /**\n    * convert a string from one UTF-8 char to one UTF-16 char\n    *\n    * Normally should be handled by mb_convert_encoding, but\n    * provides a slower PHP-only method for installations\n    * that lack the multibyte string extension.\n    *\n    * @deprecated 5.3.0 Use the PHP native JSON extension instead.\n    *\n    * @param    string  $utf8   UTF-8 character\n    * @return   string  UTF-16 character\n    * @access   private\n    */\n    function utf82utf16($utf8)\n    {\n        _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );\n\n        // oh please oh please oh please oh please oh please\n        if($this->_mb_convert_encoding) {\n            return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');\n        }\n\n        switch($this->strlen8($utf8)) {\n            case 1:\n                // this case should never be reached, because we are in ASCII range\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return $utf8;\n\n            case 2:\n                // return a UTF-16 character from a 2-byte UTF-8 char\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return chr(0x07 & (ord($utf8[0]) >> 2))\n                     . chr((0xC0 & (ord($utf8[0]) << 6))\n                         | (0x3F & ord($utf8[1])));\n\n            case 3:\n                // return a UTF-16 character from a 3-byte UTF-8 char\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return chr((0xF0 & (ord($utf8[0]) << 4))\n                         | (0x0F & (ord($utf8[1]) >> 2)))\n                     . chr((0xC0 & (ord($utf8[1]) << 6))\n                         | (0x7F & ord($utf8[2])));\n        }\n\n        // ignoring UTF-32 for now, sorry\n        return '';\n    }\n\n   /**\n    * encodes an arbitrary variable into JSON format (and sends JSON Header)\n    *\n    * @deprecated 5.3.0 Use the PHP native JSON extension instead.\n    *\n    * @param    mixed   $var    any number, boolean, string, array, or object to be encoded.\n    *                           see argument 1 to Services_JSON() above for array-parsing behavior.\n    *                           if var is a string, note that encode() always expects it\n    *                           to be in ASCII or UTF-8 format!\n    *\n    * @return   mixed   JSON string representation of input var or an error if a problem occurs\n    * @access   public\n    */\n    function encode($var)\n    {\n        _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );\n\n        header('Content-type: application/json');\n        return $this->encodeUnsafe($var);\n    }\n    /**\n    * encodes an arbitrary variable into JSON format without JSON Header - warning - may allow XSS!!!!)\n    *\n    * @deprecated 5.3.0 Use the PHP native JSON extension instead.\n    *\n    * @param    mixed   $var    any number, boolean, string, array, or object to be encoded.\n    *                           see argument 1 to Services_JSON() above for array-parsing behavior.\n    *                           if var is a string, note that encode() always expects it\n    *                           to be in ASCII or UTF-8 format!\n    *\n    * @return   mixed   JSON string representation of input var or an error if a problem occurs\n    * @access   public\n    */\n    function encodeUnsafe($var)\n    {\n        _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );\n\n        // see bug #16908 - regarding numeric locale printing\n        $lc = setlocale(LC_NUMERIC, 0);\n        setlocale(LC_NUMERIC, 'C');\n        $ret = $this->_encode($var);\n        setlocale(LC_NUMERIC, $lc);\n        return $ret;\n        \n    }\n    /**\n    * PRIVATE CODE that does the work of encodes an arbitrary variable into JSON format \n    *\n    * @deprecated 5.3.0 Use the PHP native JSON extension instead.\n    *\n    * @param    mixed   $var    any number, boolean, string, array, or object to be encoded.\n    *                           see argument 1 to Services_JSON() above for array-parsing behavior.\n    *                           if var is a string, note that encode() always expects it\n    *                           to be in ASCII or UTF-8 format!\n    *\n    * @return   mixed   JSON string representation of input var or an error if a problem occurs\n    * @access   public\n    */\n    function _encode($var) \n    {\n        _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );\n\n        switch (gettype($var)) {\n            case 'boolean':\n                return $var ? 'true' : 'false';\n\n            case 'NULL':\n                return 'null';\n\n            case 'integer':\n                return (int) $var;\n\n            case 'double':\n            case 'float':\n                return  (float) $var;\n\n            case 'string':\n                // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT\n                $ascii = '';\n                $strlen_var = $this->strlen8($var);\n\n               /*\n                * Iterate over every character in the string,\n                * escaping with a slash or encoding to UTF-8 where necessary\n                */\n                for ($c = 0; $c < $strlen_var; ++$c) {\n\n                    $ord_var_c = ord($var[$c]);\n\n                    switch (true) {\n                        case $ord_var_c == 0x08:\n                            $ascii .= '\\b';\n                            break;\n                        case $ord_var_c == 0x09:\n                            $ascii .= '\\t';\n                            break;\n                        case $ord_var_c == 0x0A:\n                            $ascii .= '\\n';\n                            break;\n                        case $ord_var_c == 0x0C:\n                            $ascii .= '\\f';\n                            break;\n                        case $ord_var_c == 0x0D:\n                            $ascii .= '\\r';\n                            break;\n\n                        case $ord_var_c == 0x22:\n                        case $ord_var_c == 0x2F:\n                        case $ord_var_c == 0x5C:\n                            // double quote, slash, slosh\n                            $ascii .= '\\\\'.$var[$c];\n                            break;\n\n                        case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):\n                            // characters U-00000000 - U-0000007F (same as ASCII)\n                            $ascii .= $var[$c];\n                            break;\n\n                        case (($ord_var_c & 0xE0) == 0xC0):\n                            // characters U-00000080 - U-000007FF, mask 110XXXXX\n                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                            if ($c+1 >= $strlen_var) {\n                                $c += 1;\n                                $ascii .= '?';\n                                break;\n                            }\n                            \n                            $char = pack('C*', $ord_var_c, ord($var[$c + 1]));\n                            $c += 1;\n                            $utf16 = $this->utf82utf16($char);\n                            $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n                            break;\n\n                        case (($ord_var_c & 0xF0) == 0xE0):\n                            if ($c+2 >= $strlen_var) {\n                                $c += 2;\n                                $ascii .= '?';\n                                break;\n                            }\n                            // characters U-00000800 - U-0000FFFF, mask 1110XXXX\n                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                            $char = pack('C*', $ord_var_c,\n                                         @ord($var[$c + 1]),\n                                         @ord($var[$c + 2]));\n                            $c += 2;\n                            $utf16 = $this->utf82utf16($char);\n                            $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n                            break;\n\n                        case (($ord_var_c & 0xF8) == 0xF0):\n                            if ($c+3 >= $strlen_var) {\n                                $c += 3;\n                                $ascii .= '?';\n                                break;\n                            }\n                            // characters U-00010000 - U-001FFFFF, mask 11110XXX\n                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                            $char = pack('C*', $ord_var_c,\n                                         ord($var[$c + 1]),\n                                         ord($var[$c + 2]),\n                                         ord($var[$c + 3]));\n                            $c += 3;\n                            $utf16 = $this->utf82utf16($char);\n                            $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n                            break;\n\n                        case (($ord_var_c & 0xFC) == 0xF8):\n                            // characters U-00200000 - U-03FFFFFF, mask 111110XX\n                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                            if ($c+4 >= $strlen_var) {\n                                $c += 4;\n                                $ascii .= '?';\n                                break;\n                            }\n                            $char = pack('C*', $ord_var_c,\n                                         ord($var[$c + 1]),\n                                         ord($var[$c + 2]),\n                                         ord($var[$c + 3]),\n                                         ord($var[$c + 4]));\n                            $c += 4;\n                            $utf16 = $this->utf82utf16($char);\n                            $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n                            break;\n\n                        case (($ord_var_c & 0xFE) == 0xFC):\n                        if ($c+5 >= $strlen_var) {\n                                $c += 5;\n                                $ascii .= '?';\n                                break;\n                            }\n                            // characters U-04000000 - U-7FFFFFFF, mask 1111110X\n                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                            $char = pack('C*', $ord_var_c,\n                                         ord($var[$c + 1]),\n                                         ord($var[$c + 2]),\n                                         ord($var[$c + 3]),\n                                         ord($var[$c + 4]),\n                                         ord($var[$c + 5]));\n                            $c += 5;\n                            $utf16 = $this->utf82utf16($char);\n                            $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n                            break;\n                    }\n                }\n                return  '\"'.$ascii.'\"';\n\n            case 'array':\n               /*\n                * As per JSON spec if any array key is not an integer\n                * we must treat the whole array as an object. We\n                * also try to catch a sparsely populated associative\n                * array with numeric keys here because some JS engines\n                * will create an array with empty indexes up to\n                * max_index which can cause memory issues and because\n                * the keys, which may be relevant, will be remapped\n                * otherwise.\n                *\n                * As per the ECMA and JSON specification an object may\n                * have any string as a property. Unfortunately due to\n                * a hole in the ECMA specification if the key is a\n                * ECMA reserved word or starts with a digit the\n                * parameter is only accessible using ECMAScript's\n                * bracket notation.\n                */\n\n                // treat as a JSON object\n                if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {\n                    $properties = array_map(array($this, 'name_value'),\n                                            array_keys($var),\n                                            array_values($var));\n\n                    foreach($properties as $property) {\n                        if(Services_JSON::isError($property)) {\n                            return $property;\n                        }\n                    }\n\n                    return '{' . join(',', $properties) . '}';\n                }\n\n                // treat it like a regular array\n                $elements = array_map(array($this, '_encode'), $var);\n\n                foreach($elements as $element) {\n                    if(Services_JSON::isError($element)) {\n                        return $element;\n                    }\n                }\n\n                return '[' . join(',', $elements) . ']';\n\n            case 'object':\n            \n                // support toJSON methods.\n                if (($this->use & SERVICES_JSON_USE_TO_JSON) && method_exists($var, 'toJSON')) {\n                    // this may end up allowing unlimited recursion\n                    // so we check the return value to make sure it's not got the same method.\n                    $recode = $var->toJSON();\n                    \n                    if (method_exists($recode, 'toJSON')) {\n                        \n                        return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)\n                        ? 'null'\n                        : new Services_JSON_Error(get_class($var).\n                            \" toJSON returned an object with a toJSON method.\");\n                            \n                    }\n                    \n                    return $this->_encode( $recode );\n                } \n                \n                $vars = get_object_vars($var);\n                \n                $properties = array_map(array($this, 'name_value'),\n                                        array_keys($vars),\n                                        array_values($vars));\n\n                foreach($properties as $property) {\n                    if(Services_JSON::isError($property)) {\n                        return $property;\n                    }\n                }\n\n                return '{' . join(',', $properties) . '}';\n\n            default:\n                return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)\n                    ? 'null'\n                    : new Services_JSON_Error(gettype($var).\" can not be encoded as JSON string\");\n        }\n    }\n\n   /**\n    * array-walking function for use in generating JSON-formatted name-value pairs\n    *\n    * @deprecated 5.3.0 Use the PHP native JSON extension instead.\n    *\n    * @param    string  $name   name of key to use\n    * @param    mixed   $value  reference to an array element to be encoded\n    *\n    * @return   string  JSON-formatted name-value pair, like '\"name\":value'\n    * @access   private\n    */\n    function name_value($name, $value)\n    {\n        _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );\n\n        $encoded_value = $this->_encode($value);\n\n        if(Services_JSON::isError($encoded_value)) {\n            return $encoded_value;\n        }\n\n        return $this->_encode(strval($name)) . ':' . $encoded_value;\n    }\n\n   /**\n    * reduce a string by removing leading and trailing comments and whitespace\n    *\n    * @deprecated 5.3.0 Use the PHP native JSON extension instead.\n    *\n    * @param    $str    string      string value to strip of comments and whitespace\n    *\n    * @return   string  string value stripped of comments and whitespace\n    * @access   private\n    */\n    function reduce_string($str)\n    {\n        _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );\n\n        $str = preg_replace(array(\n\n                // eliminate single line comments in '// ...' form\n                '#^\\s*//(.+)$#m',\n\n                // eliminate multi-line comments in '/* ... */' form, at start of string\n                '#^\\s*/\\*(.+)\\*/#Us',\n\n                // eliminate multi-line comments in '/* ... */' form, at end of string\n                '#/\\*(.+)\\*/\\s*$#Us'\n\n            ), '', $str);\n\n        // eliminate extraneous space\n        return trim($str);\n    }\n\n   /**\n    * decodes a JSON string into appropriate variable\n    *\n    * @deprecated 5.3.0 Use the PHP native JSON extension instead.\n    *\n    * @param    string  $str    JSON-formatted string\n    *\n    * @return   mixed   number, boolean, string, array, or object\n    *                   corresponding to given JSON input string.\n    *                   See argument 1 to Services_JSON() above for object-output behavior.\n    *                   Note that decode() always returns strings\n    *                   in ASCII or UTF-8 format!\n    * @access   public\n    */\n    function decode($str)\n    {\n        _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );\n\n        $str = $this->reduce_string($str);\n\n        switch (strtolower($str)) {\n            case 'true':\n                return true;\n\n            case 'false':\n                return false;\n\n            case 'null':\n                return null;\n\n            default:\n                $m = array();\n\n                if (is_numeric($str)) {\n                    // Lookie-loo, it's a number\n\n                    // This would work on its own, but I'm trying to be\n                    // good about returning integers where appropriate:\n                    // return (float)$str;\n\n                    // Return float or int, as appropriate\n                    return ((float)$str == (integer)$str)\n                        ? (integer)$str\n                        : (float)$str;\n\n                } elseif (preg_match('/^(\"|\\').*(\\1)$/s', $str, $m) && $m[1] == $m[2]) {\n                    // STRINGS RETURNED IN UTF-8 FORMAT\n                    $delim = $this->substr8($str, 0, 1);\n                    $chrs = $this->substr8($str, 1, -1);\n                    $utf8 = '';\n                    $strlen_chrs = $this->strlen8($chrs);\n\n                    for ($c = 0; $c < $strlen_chrs; ++$c) {\n\n                        $substr_chrs_c_2 = $this->substr8($chrs, $c, 2);\n                        $ord_chrs_c = ord($chrs[$c]);\n\n                        switch (true) {\n                            case $substr_chrs_c_2 == '\\b':\n                                $utf8 .= chr(0x08);\n                                ++$c;\n                                break;\n                            case $substr_chrs_c_2 == '\\t':\n                                $utf8 .= chr(0x09);\n                                ++$c;\n                                break;\n                            case $substr_chrs_c_2 == '\\n':\n                                $utf8 .= chr(0x0A);\n                                ++$c;\n                                break;\n                            case $substr_chrs_c_2 == '\\f':\n                                $utf8 .= chr(0x0C);\n                                ++$c;\n                                break;\n                            case $substr_chrs_c_2 == '\\r':\n                                $utf8 .= chr(0x0D);\n                                ++$c;\n                                break;\n\n                            case $substr_chrs_c_2 == '\\\\\"':\n                            case $substr_chrs_c_2 == '\\\\\\'':\n                            case $substr_chrs_c_2 == '\\\\\\\\':\n                            case $substr_chrs_c_2 == '\\\\/':\n                                if (($delim == '\"' && $substr_chrs_c_2 != '\\\\\\'') ||\n                                   ($delim == \"'\" && $substr_chrs_c_2 != '\\\\\"')) {\n                                    $utf8 .= $chrs[++$c];\n                                }\n                                break;\n\n                            case preg_match('/\\\\\\u[0-9A-F]{4}/i', $this->substr8($chrs, $c, 6)):\n                                // single, escaped unicode character\n                                $utf16 = chr(hexdec($this->substr8($chrs, ($c + 2), 2)))\n                                       . chr(hexdec($this->substr8($chrs, ($c + 4), 2)));\n                                $utf8 .= $this->utf162utf8($utf16);\n                                $c += 5;\n                                break;\n\n                            case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):\n                                $utf8 .= $chrs[$c];\n                                break;\n\n                            case ($ord_chrs_c & 0xE0) == 0xC0:\n                                // characters U-00000080 - U-000007FF, mask 110XXXXX\n                                //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                                $utf8 .= $this->substr8($chrs, $c, 2);\n                                ++$c;\n                                break;\n\n                            case ($ord_chrs_c & 0xF0) == 0xE0:\n                                // characters U-00000800 - U-0000FFFF, mask 1110XXXX\n                                // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                                $utf8 .= $this->substr8($chrs, $c, 3);\n                                $c += 2;\n                                break;\n\n                            case ($ord_chrs_c & 0xF8) == 0xF0:\n                                // characters U-00010000 - U-001FFFFF, mask 11110XXX\n                                // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                                $utf8 .= $this->substr8($chrs, $c, 4);\n                                $c += 3;\n                                break;\n\n                            case ($ord_chrs_c & 0xFC) == 0xF8:\n                                // characters U-00200000 - U-03FFFFFF, mask 111110XX\n                                // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                                $utf8 .= $this->substr8($chrs, $c, 5);\n                                $c += 4;\n                                break;\n\n                            case ($ord_chrs_c & 0xFE) == 0xFC:\n                                // characters U-04000000 - U-7FFFFFFF, mask 1111110X\n                                // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                                $utf8 .= $this->substr8($chrs, $c, 6);\n                                $c += 5;\n                                break;\n\n                        }\n\n                    }\n\n                    return $utf8;\n\n                } elseif (preg_match('/^\\[.*\\]$/s', $str) || preg_match('/^\\{.*\\}$/s', $str)) {\n                    // array, or object notation\n\n                    if ($str[0] == '[') {\n                        $stk = array(SERVICES_JSON_IN_ARR);\n                        $arr = array();\n                    } else {\n                        if ($this->use & SERVICES_JSON_LOOSE_TYPE) {\n                            $stk = array(SERVICES_JSON_IN_OBJ);\n                            $obj = array();\n                        } else {\n                            $stk = array(SERVICES_JSON_IN_OBJ);\n                            $obj = new stdClass();\n                        }\n                    }\n\n                    array_push($stk, array('what'  => SERVICES_JSON_SLICE,\n                                           'where' => 0,\n                                           'delim' => false));\n\n                    $chrs = $this->substr8($str, 1, -1);\n                    $chrs = $this->reduce_string($chrs);\n\n                    if ($chrs == '') {\n                        if (reset($stk) == SERVICES_JSON_IN_ARR) {\n                            return $arr;\n\n                        } else {\n                            return $obj;\n\n                        }\n                    }\n\n                    //print(\"\\nparsing {$chrs}\\n\");\n\n                    $strlen_chrs = $this->strlen8($chrs);\n\n                    for ($c = 0; $c <= $strlen_chrs; ++$c) {\n\n                        $top = end($stk);\n                        $substr_chrs_c_2 = $this->substr8($chrs, $c, 2);\n\n                        if (($c == $strlen_chrs) || (($chrs[$c] == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {\n                            // found a comma that is not inside a string, array, etc.,\n                            // OR we've reached the end of the character list\n                            $slice = $this->substr8($chrs, $top['where'], ($c - $top['where']));\n                            array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));\n                            //print(\"Found split at {$c}: \".$this->substr8($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n\n                            if (reset($stk) == SERVICES_JSON_IN_ARR) {\n                                // we are in an array, so just push an element onto the stack\n                                array_push($arr, $this->decode($slice));\n\n                            } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {\n                                // we are in an object, so figure\n                                // out the property name and set an\n                                // element in an associative array,\n                                // for now\n                                $parts = array();\n                                \n                               if (preg_match('/^\\s*([\"\\'].*[^\\\\\\][\"\\'])\\s*:/Uis', $slice, $parts)) {\n                                    // \"name\":value pair\n                                    $key = $this->decode($parts[1]);\n                                    $val = $this->decode(trim(substr($slice, strlen($parts[0])), \", \\t\\n\\r\\0\\x0B\"));\n                                    if ($this->use & SERVICES_JSON_LOOSE_TYPE) {\n                                        $obj[$key] = $val;\n                                    } else {\n                                        $obj->$key = $val;\n                                    }\n                                } elseif (preg_match('/^\\s*(\\w+)\\s*:/Uis', $slice, $parts)) {\n                                    // name:value pair, where name is unquoted\n                                    $key = $parts[1];\n                                    $val = $this->decode(trim(substr($slice, strlen($parts[0])), \", \\t\\n\\r\\0\\x0B\"));\n\n                                    if ($this->use & SERVICES_JSON_LOOSE_TYPE) {\n                                        $obj[$key] = $val;\n                                    } else {\n                                        $obj->$key = $val;\n                                    }\n                                }\n\n                            }\n\n                        } elseif ((($chrs[$c] == '\"') || ($chrs[$c] == \"'\")) && ($top['what'] != SERVICES_JSON_IN_STR)) {\n                            // found a quote, and we are not inside a string\n                            array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs[$c]));\n                            //print(\"Found start of string at {$c}\\n\");\n\n                        } elseif (($chrs[$c] == $top['delim']) &&\n                                 ($top['what'] == SERVICES_JSON_IN_STR) &&\n                                 (($this->strlen8($this->substr8($chrs, 0, $c)) - $this->strlen8(rtrim($this->substr8($chrs, 0, $c), '\\\\'))) % 2 != 1)) {\n                            // found a quote, we're in a string, and it's not escaped\n                            // we know that it's not escaped because there is _not_ an\n                            // odd number of backslashes at the end of the string so far\n                            array_pop($stk);\n                            //print(\"Found end of string at {$c}: \".$this->substr8($chrs, $top['where'], (1 + 1 + $c - $top['where'])).\"\\n\");\n\n                        } elseif (($chrs[$c] == '[') &&\n                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {\n                            // found a left-bracket, and we are in an array, object, or slice\n                            array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));\n                            //print(\"Found start of array at {$c}\\n\");\n\n                        } elseif (($chrs[$c] == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {\n                            // found a right-bracket, and we're in an array\n                            array_pop($stk);\n                            //print(\"Found end of array at {$c}: \".$this->substr8($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n\n                        } elseif (($chrs[$c] == '{') &&\n                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {\n                            // found a left-brace, and we are in an array, object, or slice\n                            array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));\n                            //print(\"Found start of object at {$c}\\n\");\n\n                        } elseif (($chrs[$c] == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {\n                            // found a right-brace, and we're in an object\n                            array_pop($stk);\n                            //print(\"Found end of object at {$c}: \".$this->substr8($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n\n                        } elseif (($substr_chrs_c_2 == '/*') &&\n                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {\n                            // found a comment start, and we are in an array, object, or slice\n                            array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));\n                            $c++;\n                            //print(\"Found start of comment at {$c}\\n\");\n\n                        } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {\n                            // found a comment end, and we're in one now\n                            array_pop($stk);\n                            $c++;\n\n                            for ($i = $top['where']; $i <= $c; ++$i)\n                                $chrs = substr_replace($chrs, ' ', $i, 1);\n\n                            //print(\"Found end of comment at {$c}: \".$this->substr8($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n\n                        }\n\n                    }\n\n                    if (reset($stk) == SERVICES_JSON_IN_ARR) {\n                        return $arr;\n\n                    } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {\n                        return $obj;\n\n                    }\n\n                }\n        }\n    }\n\n    /**\n     * @deprecated 5.3.0 Use the PHP native JSON extension instead.\n     *\n     * @todo Ultimately, this should just call PEAR::isError()\n     */\n    function isError($data, $code = null)\n    {\n        _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );\n\n        if (class_exists('pear')) {\n            return PEAR::isError($data, $code);\n        } elseif (is_object($data) && (get_class($data) == 'services_json_error' ||\n                                 is_subclass_of($data, 'services_json_error'))) {\n            return true;\n        }\n\n        return false;\n    }\n    \n    /**\n     * Calculates length of string in bytes\n     *\n     * @deprecated 5.3.0 Use the PHP native JSON extension instead.\n     *\n     * @param string\n     * @return integer length\n     */\n    function strlen8( $str ) \n    {\n        _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );\n\n        if ( $this->_mb_strlen ) {\n            return mb_strlen( $str, \"8bit\" );\n        }\n        return strlen( $str );\n    }\n    \n    /**\n     * Returns part of a string, interpreting $start and $length as number of bytes.\n     *\n     * @deprecated 5.3.0 Use the PHP native JSON extension instead.\n     *\n     * @param string\n     * @param integer start\n     * @param integer length\n     * @return integer length\n     */\n    function substr8( $string, $start, $length=false ) \n    {\n        _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );\n\n        if ( $length === false ) {\n            $length = $this->strlen8( $string ) - $start;\n        }\n        if ( $this->_mb_substr ) {\n            return mb_substr( $string, $start, $length, \"8bit\" );\n        }\n        return substr( $string, $start, $length );\n    }\n\n}\n\nif (class_exists('PEAR_Error')) {\n\n    class Services_JSON_Error extends PEAR_Error\n    {\n\t    /**\n\t     * PHP5 constructor.\n\t     *\n\t     * @deprecated 5.3.0 Use the PHP native JSON extension instead.\n\t     */\n        function __construct($message = 'unknown error', $code = null,\n                                     $mode = null, $options = null, $userinfo = null)\n        {\n            _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );\n\n            parent::PEAR_Error($message, $code, $mode, $options, $userinfo);\n        }\n\n\t    /**\n\t     * PHP4 constructor.\n\t     *\n\t     * @deprecated 5.3.0 Use __construct() instead.\n\t     *\n\t     * @see Services_JSON_Error::__construct()\n\t     */\n\t\tpublic function Services_JSON_Error($message = 'unknown error', $code = null,\n                                     $mode = null, $options = null, $userinfo = null) {\n\t\t\t_deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) );\n\t\t\tself::__construct($message, $code, $mode, $options, $userinfo);\n\t\t}\n    }\n\n} else {\n\n    /**\n     * @todo Ultimately, this class shall be descended from PEAR_Error\n     */\n    class Services_JSON_Error\n    {\n\t    /**\n\t     * PHP5 constructor.\n\t     *\n\t     * @deprecated 5.3.0 Use the PHP native JSON extension instead.\n\t     */\n        function __construct( $message = 'unknown error', $code = null,\n                                     $mode = null, $options = null, $userinfo = null )\n        {\n            _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );\n        }\n\n\t    /**\n\t     * PHP4 constructor.\n\t     *\n\t     * @deprecated 5.3.0 Use __construct() instead.\n\t     *\n\t     * @see Services_JSON_Error::__construct()\n\t     */\n\t\tpublic function Services_JSON_Error( $message = 'unknown error', $code = null,\n\t                                     $mode = null, $options = null, $userinfo = null ) {\n\t\t\t_deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) );\n\t\t\tself::__construct( $message, $code, $mode, $options, $userinfo );\n\t\t}\n    }\n\n}\n\nendif;\n", "num_lines": 1038}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * API for fetching the HTML to embed remote content based on a provided URL.\n *\n * This file is deprecated, use 'wp-includes/class-wp-oembed.php' instead.\n *\n * @deprecated 5.3.0\n * @package WordPress\n * @subpackage oEmbed\n */\n\n_deprecated_file( basename( __FILE__ ), '5.3.0', 'wp-includes/class-wp-oembed.php' );\n\n/** WP_oEmbed class */\nrequire_once ABSPATH . 'wp-includes/class-wp-oembed.php';\n", "num_lines": 16}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Portable PHP password hashing framework.\n * @package phpass\n * @since 2.5.0\n * @version 0.3 / WordPress\n * @link https://www.openwall.com/phpass/\n */\n\n#\n# Written by Solar Designer <solar at openwall.com> in 2004-2006 and placed in\n# the public domain.  Revised in subsequent years, still public domain.\n#\n# There's absolutely no warranty.\n#\n# Please be sure to update the Version line if you edit this file in any way.\n# It is suggested that you leave the main version number intact, but indicate\n# your project name (after the slash) and add your own revision information.\n#\n# Please do not change the \"private\" password hashing method implemented in\n# here, thereby making your hashes incompatible.  However, if you must, please\n# change the hash type identifier (the \"$P$\") to something different.\n#\n# Obviously, since this code is in the public domain, the above are not\n# requirements (there can be none), but merely suggestions.\n#\n\n/**\n * Portable PHP password hashing framework.\n *\n * @package phpass\n * @version 0.3 / WordPress\n * @link https://www.openwall.com/phpass/\n * @since 2.5.0\n */\nclass PasswordHash {\n\tvar $itoa64;\n\tvar $iteration_count_log2;\n\tvar $portable_hashes;\n\tvar $random_state;\n\n\t/**\n\t * PHP5 constructor.\n\t */\n\tfunction __construct( $iteration_count_log2, $portable_hashes )\n\t{\n\t\t$this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n\n\t\tif ($iteration_count_log2 < 4 || $iteration_count_log2 > 31)\n\t\t\t$iteration_count_log2 = 8;\n\t\t$this->iteration_count_log2 = $iteration_count_log2;\n\n\t\t$this->portable_hashes = $portable_hashes;\n\n\t\t$this->random_state = microtime() . uniqid(rand(), TRUE); // removed getmypid() for compatibility reasons\n\t}\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function PasswordHash( $iteration_count_log2, $portable_hashes ) {\n\t\tself::__construct( $iteration_count_log2, $portable_hashes );\n\t}\n\n\tfunction get_random_bytes($count)\n\t{\n\t\t$output = '';\n\t\tif ( @is_readable('/dev/urandom') &&\n\t\t    ($fh = @fopen('/dev/urandom', 'rb'))) {\n\t\t\t$output = fread($fh, $count);\n\t\t\tfclose($fh);\n\t\t}\n\n\t\tif (strlen($output) < $count) {\n\t\t\t$output = '';\n\t\t\tfor ($i = 0; $i < $count; $i += 16) {\n\t\t\t\t$this->random_state =\n\t\t\t\t    md5(microtime() . $this->random_state);\n\t\t\t\t$output .=\n\t\t\t\t    pack('H*', md5($this->random_state));\n\t\t\t}\n\t\t\t$output = substr($output, 0, $count);\n\t\t}\n\n\t\treturn $output;\n\t}\n\n\tfunction encode64($input, $count)\n\t{\n\t\t$output = '';\n\t\t$i = 0;\n\t\tdo {\n\t\t\t$value = ord($input[$i++]);\n\t\t\t$output .= $this->itoa64[$value & 0x3f];\n\t\t\tif ($i < $count)\n\t\t\t\t$value |= ord($input[$i]) << 8;\n\t\t\t$output .= $this->itoa64[($value >> 6) & 0x3f];\n\t\t\tif ($i++ >= $count)\n\t\t\t\tbreak;\n\t\t\tif ($i < $count)\n\t\t\t\t$value |= ord($input[$i]) << 16;\n\t\t\t$output .= $this->itoa64[($value >> 12) & 0x3f];\n\t\t\tif ($i++ >= $count)\n\t\t\t\tbreak;\n\t\t\t$output .= $this->itoa64[($value >> 18) & 0x3f];\n\t\t} while ($i < $count);\n\n\t\treturn $output;\n\t}\n\n\tfunction gensalt_private($input)\n\t{\n\t\t$output = '$P$';\n\t\t$output .= $this->itoa64[min($this->iteration_count_log2 +\n\t\t\t((PHP_VERSION >= '5') ? 5 : 3), 30)];\n\t\t$output .= $this->encode64($input, 6);\n\n\t\treturn $output;\n\t}\n\n\tfunction crypt_private($password, $setting)\n\t{\n\t\t$output = '*0';\n\t\tif (substr($setting, 0, 2) == $output)\n\t\t\t$output = '*1';\n\n\t\t$id = substr($setting, 0, 3);\n\t\t# We use \"$P$\", phpBB3 uses \"$H$\" for the same thing\n\t\tif ($id != '$P$' && $id != '$H$')\n\t\t\treturn $output;\n\n\t\t$count_log2 = strpos($this->itoa64, $setting[3]);\n\t\tif ($count_log2 < 7 || $count_log2 > 30)\n\t\t\treturn $output;\n\n\t\t$count = 1 << $count_log2;\n\n\t\t$salt = substr($setting, 4, 8);\n\t\tif (strlen($salt) != 8)\n\t\t\treturn $output;\n\n\t\t# We're kind of forced to use MD5 here since it's the only\n\t\t# cryptographic primitive available in all versions of PHP\n\t\t# currently in use.  To implement our own low-level crypto\n\t\t# in PHP would result in much worse performance and\n\t\t# consequently in lower iteration counts and hashes that are\n\t\t# quicker to crack (by non-PHP code).\n\t\tif (PHP_VERSION >= '5') {\n\t\t\t$hash = md5($salt . $password, TRUE);\n\t\t\tdo {\n\t\t\t\t$hash = md5($hash . $password, TRUE);\n\t\t\t} while (--$count);\n\t\t} else {\n\t\t\t$hash = pack('H*', md5($salt . $password));\n\t\t\tdo {\n\t\t\t\t$hash = pack('H*', md5($hash . $password));\n\t\t\t} while (--$count);\n\t\t}\n\n\t\t$output = substr($setting, 0, 12);\n\t\t$output .= $this->encode64($hash, 16);\n\n\t\treturn $output;\n\t}\n\n\tfunction gensalt_extended($input)\n\t{\n\t\t$count_log2 = min($this->iteration_count_log2 + 8, 24);\n\t\t# This should be odd to not reveal weak DES keys, and the\n\t\t# maximum valid value is (2**24 - 1) which is odd anyway.\n\t\t$count = (1 << $count_log2) - 1;\n\n\t\t$output = '_';\n\t\t$output .= $this->itoa64[$count & 0x3f];\n\t\t$output .= $this->itoa64[($count >> 6) & 0x3f];\n\t\t$output .= $this->itoa64[($count >> 12) & 0x3f];\n\t\t$output .= $this->itoa64[($count >> 18) & 0x3f];\n\n\t\t$output .= $this->encode64($input, 3);\n\n\t\treturn $output;\n\t}\n\n\tfunction gensalt_blowfish($input)\n\t{\n\t\t# This one needs to use a different order of characters and a\n\t\t# different encoding scheme from the one in encode64() above.\n\t\t# We care because the last character in our encoded string will\n\t\t# only represent 2 bits.  While two known implementations of\n\t\t# bcrypt will happily accept and correct a salt string which\n\t\t# has the 4 unused bits set to non-zero, we do not want to take\n\t\t# chances and we also do not want to waste an additional byte\n\t\t# of entropy.\n\t\t$itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n\t\t$output = '$2a$';\n\t\t$output .= chr(ord('0') + $this->iteration_count_log2 / 10);\n\t\t$output .= chr(ord('0') + $this->iteration_count_log2 % 10);\n\t\t$output .= '$';\n\n\t\t$i = 0;\n\t\tdo {\n\t\t\t$c1 = ord($input[$i++]);\n\t\t\t$output .= $itoa64[$c1 >> 2];\n\t\t\t$c1 = ($c1 & 0x03) << 4;\n\t\t\tif ($i >= 16) {\n\t\t\t\t$output .= $itoa64[$c1];\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$c2 = ord($input[$i++]);\n\t\t\t$c1 |= $c2 >> 4;\n\t\t\t$output .= $itoa64[$c1];\n\t\t\t$c1 = ($c2 & 0x0f) << 2;\n\n\t\t\t$c2 = ord($input[$i++]);\n\t\t\t$c1 |= $c2 >> 6;\n\t\t\t$output .= $itoa64[$c1];\n\t\t\t$output .= $itoa64[$c2 & 0x3f];\n\t\t} while (1);\n\n\t\treturn $output;\n\t}\n\n\tfunction HashPassword($password)\n\t{\n\t\tif ( strlen( $password ) > 4096 ) {\n\t\t\treturn '*';\n\t\t}\n\n\t\t$random = '';\n\n\t\tif (CRYPT_BLOWFISH == 1 && !$this->portable_hashes) {\n\t\t\t$random = $this->get_random_bytes(16);\n\t\t\t$hash =\n\t\t\t    crypt($password, $this->gensalt_blowfish($random));\n\t\t\tif (strlen($hash) == 60)\n\t\t\t\treturn $hash;\n\t\t}\n\n\t\tif (CRYPT_EXT_DES == 1 && !$this->portable_hashes) {\n\t\t\tif (strlen($random) < 3)\n\t\t\t\t$random = $this->get_random_bytes(3);\n\t\t\t$hash =\n\t\t\t    crypt($password, $this->gensalt_extended($random));\n\t\t\tif (strlen($hash) == 20)\n\t\t\t\treturn $hash;\n\t\t}\n\n\t\tif (strlen($random) < 6)\n\t\t\t$random = $this->get_random_bytes(6);\n\t\t$hash =\n\t\t    $this->crypt_private($password,\n\t\t    $this->gensalt_private($random));\n\t\tif (strlen($hash) == 34)\n\t\t\treturn $hash;\n\n\t\t# Returning '*' on error is safe here, but would _not_ be safe\n\t\t# in a crypt(3)-like function used _both_ for generating new\n\t\t# hashes and for validating passwords against existing hashes.\n\t\treturn '*';\n\t}\n\n\tfunction CheckPassword($password, $stored_hash)\n\t{\n\t\tif ( strlen( $password ) > 4096 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$hash = $this->crypt_private($password, $stored_hash);\n\t\tif ($hash[0] == '*')\n\t\t\t$hash = crypt($password, $stored_hash);\n\n\t\treturn $hash === $stored_hash;\n\t}\n}", "num_lines": 276}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * The PHPMailer class has been moved to the wp-includes/PHPMailer subdirectory and now uses the PHPMailer\\PHPMailer namespace.\n */\nif ( function_exists( '_deprecated_file' ) ) {\n\t_deprecated_file(\n\t\tbasename( __FILE__ ),\n\t\t'5.5.0',\n\t\tWPINC . '/PHPMailer/PHPMailer.php',\n\t\t__( 'The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\\PHPMailer namespace.' )\n\t);\n}\n\nrequire_once __DIR__ . '/PHPMailer/PHPMailer.php';\nrequire_once __DIR__ . '/PHPMailer/Exception.php';\n\nclass_alias( PHPMailer\\PHPMailer\\PHPMailer::class, 'PHPMailer' );\nclass_alias( PHPMailer\\PHPMailer\\Exception::class, 'phpmailerException' );\n", "num_lines": 20}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * mail_fetch/setup.php\n *\n * Copyright (c) 1999-2011 CDI (cdi@thewebmasters.net) All Rights Reserved\n * Modified by Philippe Mingo 2001-2009 mingo@rotedic.com\n * An RFC 1939 compliant wrapper class for the POP3 protocol.\n *\n * Licensed under the GNU GPL. For full terms see the file COPYING.\n *\n * POP3 class\n *\n * @copyright 1999-2011 The SquirrelMail Project Team\n * @license http://opensource.org/licenses/gpl-license.php GNU Public License\n * @package plugins\n * @subpackage mail_fetch\n */\n\nclass POP3 {\n    var $ERROR      = '';       //  Error string.\n\n    var $TIMEOUT    = 60;       //  Default timeout before giving up on a\n                                //  network operation.\n\n    var $COUNT      = -1;       //  Mailbox msg count\n\n    var $BUFFER     = 512;      //  Socket buffer for socket fgets() calls.\n                                //  Per RFC 1939 the returned line a POP3\n                                //  server can send is 512 bytes.\n\n    var $FP         = '';       //  The connection to the server's\n                                //  file descriptor\n\n    var $MAILSERVER = '';       // Set this to hard code the server name\n\n    var $DEBUG      = FALSE;    // set to true to echo pop3\n                                // commands and responses to error_log\n                                // this WILL log passwords!\n\n    var $BANNER     = '';       //  Holds the banner returned by the\n                                //  pop server - used for apop()\n\n    var $ALLOWAPOP  = FALSE;    //  Allow or disallow apop()\n                                //  This must be set to true\n                                //  manually\n\n\t/**\n\t * PHP5 constructor.\n\t */\n    function __construct ( $server = '', $timeout = '' ) {\n        settype($this->BUFFER,\"integer\");\n        if( !empty($server) ) {\n            // Do not allow programs to alter MAILSERVER\n            // if it is already specified. They can get around\n            // this if they -really- want to, so don't count on it.\n            if(empty($this->MAILSERVER))\n                $this->MAILSERVER = $server;\n        }\n        if(!empty($timeout)) {\n            settype($timeout,\"integer\");\n            $this->TIMEOUT = $timeout;\n            set_time_limit($timeout);\n        }\n        return true;\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function POP3( $server = '', $timeout = '' ) {\n\t\tself::__construct( $server, $timeout );\n\t}\n\n    function update_timer () {\n        set_time_limit($this->TIMEOUT);\n        return true;\n    }\n\n    function connect ($server, $port = 110)  {\n        //  Opens a socket to the specified server. Unless overridden,\n        //  port defaults to 110. Returns true on success, false on fail\n\n        // If MAILSERVER is set, override $server with its value.\n\n    if (!isset($port) || !$port) {$port = 110;}\n        if(!empty($this->MAILSERVER))\n            $server = $this->MAILSERVER;\n\n        if(empty($server)){\n            $this->ERROR = \"POP3 connect: \" . _(\"No server specified\");\n            unset($this->FP);\n            return false;\n        }\n\n        $fp = @fsockopen(\"$server\", $port, $errno, $errstr);\n\n        if(!$fp) {\n            $this->ERROR = \"POP3 connect: \" . _(\"Error \") . \"[$errno] [$errstr]\";\n            unset($this->FP);\n            return false;\n        }\n\n        socket_set_blocking($fp,-1);\n        $this->update_timer();\n        $reply = fgets($fp,$this->BUFFER);\n        $reply = $this->strip_clf($reply);\n        if($this->DEBUG)\n            error_log(\"POP3 SEND [connect: $server] GOT [$reply]\",0);\n        if(!$this->is_ok($reply)) {\n            $this->ERROR = \"POP3 connect: \" . _(\"Error \") . \"[$reply]\";\n            unset($this->FP);\n            return false;\n        }\n        $this->FP = $fp;\n        $this->BANNER = $this->parse_banner($reply);\n        return true;\n    }\n\n    function user ($user = \"\") {\n        // Sends the USER command, returns true or false\n\n        if( empty($user) ) {\n            $this->ERROR = \"POP3 user: \" . _(\"no login ID submitted\");\n            return false;\n        } elseif(!isset($this->FP)) {\n            $this->ERROR = \"POP3 user: \" . _(\"connection not established\");\n            return false;\n        } else {\n            $reply = $this->send_cmd(\"USER $user\");\n            if(!$this->is_ok($reply)) {\n                $this->ERROR = \"POP3 user: \" . _(\"Error \") . \"[$reply]\";\n                return false;\n            } else\n                return true;\n        }\n    }\n\n    function pass ($pass = \"\")     {\n        // Sends the PASS command, returns # of msgs in mailbox,\n        // returns false (undef) on Auth failure\n\n        if(empty($pass)) {\n            $this->ERROR = \"POP3 pass: \" . _(\"No password submitted\");\n            return false;\n        } elseif(!isset($this->FP)) {\n            $this->ERROR = \"POP3 pass: \" . _(\"connection not established\");\n            return false;\n        } else {\n            $reply = $this->send_cmd(\"PASS $pass\");\n            if(!$this->is_ok($reply)) {\n                $this->ERROR = \"POP3 pass: \" . _(\"Authentication failed\") . \" [$reply]\";\n                $this->quit();\n                return false;\n            } else {\n                //  Auth successful.\n                $count = $this->last(\"count\");\n                $this->COUNT = $count;\n                return $count;\n            }\n        }\n    }\n\n    function apop ($login,$pass) {\n        //  Attempts an APOP login. If this fails, it'll\n        //  try a standard login. YOUR SERVER MUST SUPPORT\n        //  THE USE OF THE APOP COMMAND!\n        //  (apop is optional per rfc1939)\n\n        if(!isset($this->FP)) {\n            $this->ERROR = \"POP3 apop: \" . _(\"No connection to server\");\n            return false;\n        } elseif(!$this->ALLOWAPOP) {\n            $retVal = $this->login($login,$pass);\n            return $retVal;\n        } elseif(empty($login)) {\n            $this->ERROR = \"POP3 apop: \" . _(\"No login ID submitted\");\n            return false;\n        } elseif(empty($pass)) {\n            $this->ERROR = \"POP3 apop: \" . _(\"No password submitted\");\n            return false;\n        } else {\n            $banner = $this->BANNER;\n            if( (!$banner) or (empty($banner)) ) {\n                $this->ERROR = \"POP3 apop: \" . _(\"No server banner\") . ' - ' . _(\"abort\");\n                $retVal = $this->login($login,$pass);\n                return $retVal;\n            } else {\n                $AuthString = $banner;\n                $AuthString .= $pass;\n                $APOPString = md5($AuthString);\n                $cmd = \"APOP $login $APOPString\";\n                $reply = $this->send_cmd($cmd);\n                if(!$this->is_ok($reply)) {\n                    $this->ERROR = \"POP3 apop: \" . _(\"apop authentication failed\") . ' - ' . _(\"abort\");\n                    $retVal = $this->login($login,$pass);\n                    return $retVal;\n                } else {\n                    //  Auth successful.\n                    $count = $this->last(\"count\");\n                    $this->COUNT = $count;\n                    return $count;\n                }\n            }\n        }\n    }\n\n    function login ($login = \"\", $pass = \"\") {\n        // Sends both user and pass. Returns # of msgs in mailbox or\n        // false on failure (or -1, if the error occurs while getting\n        // the number of messages.)\n\n        if( !isset($this->FP) ) {\n            $this->ERROR = \"POP3 login: \" . _(\"No connection to server\");\n            return false;\n        } else {\n            $fp = $this->FP;\n            if( !$this->user( $login ) ) {\n                //  Preserve the error generated by user()\n                return false;\n            } else {\n                $count = $this->pass($pass);\n                if( (!$count) || ($count == -1) ) {\n                    //  Preserve the error generated by last() and pass()\n                    return false;\n                } else\n                    return $count;\n            }\n        }\n    }\n\n    function top ($msgNum, $numLines = \"0\") {\n        //  Gets the header and first $numLines of the msg body\n        //  returns data in an array with each returned line being\n        //  an array element. If $numLines is empty, returns\n        //  only the header information, and none of the body.\n\n        if(!isset($this->FP)) {\n            $this->ERROR = \"POP3 top: \" . _(\"No connection to server\");\n            return false;\n        }\n        $this->update_timer();\n\n        $fp = $this->FP;\n        $buffer = $this->BUFFER;\n        $cmd = \"TOP $msgNum $numLines\";\n        fwrite($fp, \"TOP $msgNum $numLines\\r\\n\");\n        $reply = fgets($fp, $buffer);\n        $reply = $this->strip_clf($reply);\n        if($this->DEBUG) {\n            @error_log(\"POP3 SEND [$cmd] GOT [$reply]\",0);\n        }\n        if(!$this->is_ok($reply))\n        {\n            $this->ERROR = \"POP3 top: \" . _(\"Error \") . \"[$reply]\";\n            return false;\n        }\n\n        $count = 0;\n        $MsgArray = array();\n\n        $line = fgets($fp,$buffer);\n        while ( !preg_match('/^\\.\\r\\n/',$line))\n        {\n            $MsgArray[$count] = $line;\n            $count++;\n            $line = fgets($fp,$buffer);\n            if(empty($line))    { break; }\n        }\n\n        return $MsgArray;\n    }\n\n    function pop_list ($msgNum = \"\") {\n        //  If called with an argument, returns that msgs' size in octets\n        //  No argument returns an associative array of undeleted\n        //  msg numbers and their sizes in octets\n\n        if(!isset($this->FP))\n        {\n            $this->ERROR = \"POP3 pop_list: \" . _(\"No connection to server\");\n            return false;\n        }\n        $fp = $this->FP;\n        $Total = $this->COUNT;\n        if( (!$Total) or ($Total == -1) )\n        {\n            return false;\n        }\n        if($Total == 0)\n        {\n            return array(\"0\",\"0\");\n            // return -1;   // mailbox empty\n        }\n\n        $this->update_timer();\n\n        if(!empty($msgNum))\n        {\n            $cmd = \"LIST $msgNum\";\n            fwrite($fp,\"$cmd\\r\\n\");\n            $reply = fgets($fp,$this->BUFFER);\n            $reply = $this->strip_clf($reply);\n            if($this->DEBUG) {\n                @error_log(\"POP3 SEND [$cmd] GOT [$reply]\",0);\n            }\n            if(!$this->is_ok($reply))\n            {\n                $this->ERROR = \"POP3 pop_list: \" . _(\"Error \") . \"[$reply]\";\n                return false;\n            }\n            list($junk,$num,$size) = preg_split('/\\s+/',$reply);\n            return $size;\n        }\n        $cmd = \"LIST\";\n        $reply = $this->send_cmd($cmd);\n        if(!$this->is_ok($reply))\n        {\n            $reply = $this->strip_clf($reply);\n            $this->ERROR = \"POP3 pop_list: \" . _(\"Error \") .  \"[$reply]\";\n            return false;\n        }\n        $MsgArray = array();\n        $MsgArray[0] = $Total;\n        for($msgC=1;$msgC <= $Total; $msgC++)\n        {\n            if($msgC > $Total) { break; }\n            $line = fgets($fp,$this->BUFFER);\n            $line = $this->strip_clf($line);\n            if(strpos($line, '.') === 0)\n            {\n                $this->ERROR = \"POP3 pop_list: \" . _(\"Premature end of list\");\n                return false;\n            }\n            list($thisMsg,$msgSize) = preg_split('/\\s+/',$line);\n            settype($thisMsg,\"integer\");\n            if($thisMsg != $msgC)\n            {\n                $MsgArray[$msgC] = \"deleted\";\n            }\n            else\n            {\n                $MsgArray[$msgC] = $msgSize;\n            }\n        }\n        return $MsgArray;\n    }\n\n    function get ($msgNum) {\n        //  Retrieve the specified msg number. Returns an array\n        //  where each line of the msg is an array element.\n\n        if(!isset($this->FP))\n        {\n            $this->ERROR = \"POP3 get: \" . _(\"No connection to server\");\n            return false;\n        }\n\n        $this->update_timer();\n\n        $fp = $this->FP;\n        $buffer = $this->BUFFER;\n        $cmd = \"RETR $msgNum\";\n        $reply = $this->send_cmd($cmd);\n\n        if(!$this->is_ok($reply))\n        {\n            $this->ERROR = \"POP3 get: \" . _(\"Error \") . \"[$reply]\";\n            return false;\n        }\n\n        $count = 0;\n        $MsgArray = array();\n\n        $line = fgets($fp,$buffer);\n        while ( !preg_match('/^\\.\\r\\n/',$line))\n        {\n            if ( $line[0] == '.' ) { $line = substr($line,1); }\n            $MsgArray[$count] = $line;\n            $count++;\n            $line = fgets($fp,$buffer);\n            if(empty($line))    { break; }\n        }\n        return $MsgArray;\n    }\n\n    function last ( $type = \"count\" ) {\n        //  Returns the highest msg number in the mailbox.\n        //  returns -1 on error, 0+ on success, if type != count\n        //  results in a popstat() call (2 element array returned)\n\n        $last = -1;\n        if(!isset($this->FP))\n        {\n            $this->ERROR = \"POP3 last: \" . _(\"No connection to server\");\n            return $last;\n        }\n\n        $reply = $this->send_cmd(\"STAT\");\n        if(!$this->is_ok($reply))\n        {\n            $this->ERROR = \"POP3 last: \" . _(\"Error \") . \"[$reply]\";\n            return $last;\n        }\n\n        $Vars = preg_split('/\\s+/',$reply);\n        $count = $Vars[1];\n        $size = $Vars[2];\n        settype($count,\"integer\");\n        settype($size,\"integer\");\n        if($type != \"count\")\n        {\n            return array($count,$size);\n        }\n        return $count;\n    }\n\n    function reset () {\n        //  Resets the status of the remote server. This includes\n        //  resetting the status of ALL msgs to not be deleted.\n        //  This method automatically closes the connection to the server.\n\n        if(!isset($this->FP))\n        {\n            $this->ERROR = \"POP3 reset: \" . _(\"No connection to server\");\n            return false;\n        }\n        $reply = $this->send_cmd(\"RSET\");\n        if(!$this->is_ok($reply))\n        {\n            //  The POP3 RSET command -never- gives a -ERR\n            //  response - if it ever does, something truly\n            //  wild is going on.\n\n            $this->ERROR = \"POP3 reset: \" . _(\"Error \") . \"[$reply]\";\n            @error_log(\"POP3 reset: ERROR [$reply]\",0);\n        }\n        $this->quit();\n        return true;\n    }\n\n    function send_cmd ( $cmd = \"\" )\n    {\n        //  Sends a user defined command string to the\n        //  POP server and returns the results. Useful for\n        //  non-compliant or custom POP servers.\n        //  Do NOT includ the \\r\\n as part of your command\n        //  string - it will be appended automatically.\n\n        //  The return value is a standard fgets() call, which\n        //  will read up to $this->BUFFER bytes of data, until it\n        //  encounters a new line, or EOF, whichever happens first.\n\n        //  This method works best if $cmd responds with only\n        //  one line of data.\n\n        if(!isset($this->FP))\n        {\n            $this->ERROR = \"POP3 send_cmd: \" . _(\"No connection to server\");\n            return false;\n        }\n\n        if(empty($cmd))\n        {\n            $this->ERROR = \"POP3 send_cmd: \" . _(\"Empty command string\");\n            return \"\";\n        }\n\n        $fp = $this->FP;\n        $buffer = $this->BUFFER;\n        $this->update_timer();\n        fwrite($fp,\"$cmd\\r\\n\");\n        $reply = fgets($fp,$buffer);\n        $reply = $this->strip_clf($reply);\n        if($this->DEBUG) { @error_log(\"POP3 SEND [$cmd] GOT [$reply]\",0); }\n        return $reply;\n    }\n\n    function quit() {\n        //  Closes the connection to the POP3 server, deleting\n        //  any msgs marked as deleted.\n\n        if(!isset($this->FP))\n        {\n            $this->ERROR = \"POP3 quit: \" . _(\"connection does not exist\");\n            return false;\n        }\n        $fp = $this->FP;\n        $cmd = \"QUIT\";\n        fwrite($fp,\"$cmd\\r\\n\");\n        $reply = fgets($fp,$this->BUFFER);\n        $reply = $this->strip_clf($reply);\n        if($this->DEBUG) { @error_log(\"POP3 SEND [$cmd] GOT [$reply]\",0); }\n        fclose($fp);\n        unset($this->FP);\n        return true;\n    }\n\n    function popstat () {\n        //  Returns an array of 2 elements. The number of undeleted\n        //  msgs in the mailbox, and the size of the mbox in octets.\n\n        $PopArray = $this->last(\"array\");\n\n        if($PopArray == -1) { return false; }\n\n        if( (!$PopArray) or (empty($PopArray)) )\n        {\n            return false;\n        }\n        return $PopArray;\n    }\n\n    function uidl ($msgNum = \"\")\n    {\n        //  Returns the UIDL of the msg specified. If called with\n        //  no arguments, returns an associative array where each\n        //  undeleted msg num is a key, and the msg's uidl is the element\n        //  Array element 0 will contain the total number of msgs\n\n        if(!isset($this->FP)) {\n            $this->ERROR = \"POP3 uidl: \" . _(\"No connection to server\");\n            return false;\n        }\n\n        $fp = $this->FP;\n        $buffer = $this->BUFFER;\n\n        if(!empty($msgNum)) {\n            $cmd = \"UIDL $msgNum\";\n            $reply = $this->send_cmd($cmd);\n            if(!$this->is_ok($reply))\n            {\n                $this->ERROR = \"POP3 uidl: \" . _(\"Error \") . \"[$reply]\";\n                return false;\n            }\n            list ($ok,$num,$myUidl) = preg_split('/\\s+/',$reply);\n            return $myUidl;\n        } else {\n            $this->update_timer();\n\n            $UIDLArray = array();\n            $Total = $this->COUNT;\n            $UIDLArray[0] = $Total;\n\n            if ($Total < 1)\n            {\n                return $UIDLArray;\n            }\n            $cmd = \"UIDL\";\n            fwrite($fp, \"UIDL\\r\\n\");\n            $reply = fgets($fp, $buffer);\n            $reply = $this->strip_clf($reply);\n            if($this->DEBUG) { @error_log(\"POP3 SEND [$cmd] GOT [$reply]\",0); }\n            if(!$this->is_ok($reply))\n            {\n                $this->ERROR = \"POP3 uidl: \" . _(\"Error \") . \"[$reply]\";\n                return false;\n            }\n\n            $line = \"\";\n            $count = 1;\n            $line = fgets($fp,$buffer);\n            while ( !preg_match('/^\\.\\r\\n/',$line)) {\n                list ($msg,$msgUidl) = preg_split('/\\s+/',$line);\n                $msgUidl = $this->strip_clf($msgUidl);\n                if($count == $msg) {\n                    $UIDLArray[$msg] = $msgUidl;\n                }\n                else\n                {\n                    $UIDLArray[$count] = 'deleted';\n                }\n                $count++;\n                $line = fgets($fp,$buffer);\n            }\n        }\n        return $UIDLArray;\n    }\n\n    function delete ($msgNum = \"\") {\n        //  Flags a specified msg as deleted. The msg will not\n        //  be deleted until a quit() method is called.\n\n        if(!isset($this->FP))\n        {\n            $this->ERROR = \"POP3 delete: \" . _(\"No connection to server\");\n            return false;\n        }\n        if(empty($msgNum))\n        {\n            $this->ERROR = \"POP3 delete: \" . _(\"No msg number submitted\");\n            return false;\n        }\n        $reply = $this->send_cmd(\"DELE $msgNum\");\n        if(!$this->is_ok($reply))\n        {\n            $this->ERROR = \"POP3 delete: \" . _(\"Command failed \") . \"[$reply]\";\n            return false;\n        }\n        return true;\n    }\n\n    //  *********************************************************\n\n    //  The following methods are internal to the class.\n\n    function is_ok ($cmd = \"\") {\n        //  Return true or false on +OK or -ERR\n\n        if( empty($cmd) )\n            return false;\n        else\n            return( stripos($cmd, '+OK') !== false );\n    }\n\n    function strip_clf ($text = \"\") {\n        // Strips \\r\\n from server responses\n\n        if(empty($text))\n            return $text;\n        else {\n            $stripped = str_replace(array(\"\\r\",\"\\n\"),'',$text);\n            return $stripped;\n        }\n    }\n\n    function parse_banner ( $server_text ) {\n        $outside = true;\n        $banner = \"\";\n        $length = strlen($server_text);\n        for($count =0; $count < $length; $count++)\n        {\n            $digit = substr($server_text,$count,1);\n            if(!empty($digit))             {\n                if( (!$outside) && ($digit != '<') && ($digit != '>') )\n                {\n                    $banner .= $digit;\n                }\n                if ($digit == '<')\n                {\n                    $outside = false;\n                }\n                if($digit == '>')\n                {\n                    $outside = true;\n                }\n            }\n        }\n        $banner = $this->strip_clf($banner);    // Just in case\n        return \"<$banner>\";\n    }\n\n}   // End class\n\n// For php4 compatibility\nif (!function_exists(\"stripos\")) {\n    function stripos($haystack, $needle){\n        return strpos($haystack, stristr( $haystack, $needle ));\n    }\n}\n", "num_lines": 661}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Requests for PHP\n *\n * Inspired by Requests for Python.\n *\n * Based on concepts from SimplePie_File, RequestCore and WP_Http.\n *\n * @package Requests\n */\n\n/**\n * Requests for PHP\n *\n * Inspired by Requests for Python.\n *\n * Based on concepts from SimplePie_File, RequestCore and WP_Http.\n *\n * @package Requests\n */\nclass Requests {\n\t/**\n\t * POST method\n\t *\n\t * @var string\n\t */\n\tconst POST = 'POST';\n\n\t/**\n\t * PUT method\n\t *\n\t * @var string\n\t */\n\tconst PUT = 'PUT';\n\n\t/**\n\t * GET method\n\t *\n\t * @var string\n\t */\n\tconst GET = 'GET';\n\n\t/**\n\t * HEAD method\n\t *\n\t * @var string\n\t */\n\tconst HEAD = 'HEAD';\n\n\t/**\n\t * DELETE method\n\t *\n\t * @var string\n\t */\n\tconst DELETE = 'DELETE';\n\n\t/**\n\t * OPTIONS method\n\t *\n\t * @var string\n\t */\n\tconst OPTIONS = 'OPTIONS';\n\n\t/**\n\t * TRACE method\n\t *\n\t * @var string\n\t */\n\tconst TRACE = 'TRACE';\n\n\t/**\n\t * PATCH method\n\t *\n\t * @link https://tools.ietf.org/html/rfc5789\n\t * @var string\n\t */\n\tconst PATCH = 'PATCH';\n\n\t/**\n\t * Default size of buffer size to read streams\n\t *\n\t * @var integer\n\t */\n\tconst BUFFER_SIZE = 1160;\n\n\t/**\n\t * Current version of Requests\n\t *\n\t * @var string\n\t */\n\tconst VERSION = '1.7-3470169';\n\n\t/**\n\t * Registered transport classes\n\t *\n\t * @var array\n\t */\n\tprotected static $transports = array();\n\n\t/**\n\t * Selected transport name\n\t *\n\t * Use {@see get_transport()} instead\n\t *\n\t * @var array\n\t */\n\tpublic static $transport = array();\n\n\t/**\n\t * Default certificate path.\n\t *\n\t * @see Requests::get_certificate_path()\n\t * @see Requests::set_certificate_path()\n\t *\n\t * @var string\n\t */\n\tprotected static $certificate_path;\n\n\t/**\n\t * This is a static class, do not instantiate it\n\t *\n\t * @codeCoverageIgnore\n\t */\n\tprivate function __construct() {}\n\n\t/**\n\t * Autoloader for Requests\n\t *\n\t * Register this with {@see register_autoloader()} if you'd like to avoid\n\t * having to create your own.\n\t *\n\t * (You can also use `spl_autoload_register` directly if you'd prefer.)\n\t *\n\t * @codeCoverageIgnore\n\t *\n\t * @param string $class Class name to load\n\t */\n\tpublic static function autoloader($class) {\n\t\t// Check that the class starts with \"Requests\"\n\t\tif (strpos($class, 'Requests') !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t$file = str_replace('_', '/', $class);\n\t\tif (file_exists(dirname(__FILE__) . '/' . $file . '.php')) {\n\t\t\trequire_once(dirname(__FILE__) . '/' . $file . '.php');\n\t\t}\n\t}\n\n\t/**\n\t * Register the built-in autoloader\n\t *\n\t * @codeCoverageIgnore\n\t */\n\tpublic static function register_autoloader() {\n\t\tspl_autoload_register(array('Requests', 'autoloader'));\n\t}\n\n\t/**\n\t * Register a transport\n\t *\n\t * @param string $transport Transport class to add, must support the Requests_Transport interface\n\t */\n\tpublic static function add_transport($transport) {\n\t\tif (empty(self::$transports)) {\n\t\t\tself::$transports = array(\n\t\t\t\t'Requests_Transport_cURL',\n\t\t\t\t'Requests_Transport_fsockopen',\n\t\t\t);\n\t\t}\n\n\t\tself::$transports = array_merge(self::$transports, array($transport));\n\t}\n\n\t/**\n\t * Get a working transport\n\t *\n\t * @throws Requests_Exception If no valid transport is found (`notransport`)\n\t * @return Requests_Transport\n\t */\n\tprotected static function get_transport($capabilities = array()) {\n\t\t// Caching code, don't bother testing coverage\n\t\t// @codeCoverageIgnoreStart\n\t\t// array of capabilities as a string to be used as an array key\n\t\tksort($capabilities);\n\t\t$cap_string = serialize($capabilities);\n\n\t\t// Don't search for a transport if it's already been done for these $capabilities\n\t\tif (isset(self::$transport[$cap_string]) && self::$transport[$cap_string] !== null) {\n\t\t\t$class = self::$transport[$cap_string];\n\t\t\treturn new $class();\n\t\t}\n\t\t// @codeCoverageIgnoreEnd\n\n\t\tif (empty(self::$transports)) {\n\t\t\tself::$transports = array(\n\t\t\t\t'Requests_Transport_cURL',\n\t\t\t\t'Requests_Transport_fsockopen',\n\t\t\t);\n\t\t}\n\n\t\t// Find us a working transport\n\t\tforeach (self::$transports as $class) {\n\t\t\tif (!class_exists($class)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$result = call_user_func(array($class, 'test'), $capabilities);\n\t\t\tif ($result) {\n\t\t\t\tself::$transport[$cap_string] = $class;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (self::$transport[$cap_string] === null) {\n\t\t\tthrow new Requests_Exception('No working transports found', 'notransport', self::$transports);\n\t\t}\n\n\t\t$class = self::$transport[$cap_string];\n\t\treturn new $class();\n\t}\n\n\t/**#@+\n\t * @see request()\n\t * @param string $url\n\t * @param array $headers\n\t * @param array $options\n\t * @return Requests_Response\n\t */\n\t/**\n\t * Send a GET request\n\t */\n\tpublic static function get($url, $headers = array(), $options = array()) {\n\t\treturn self::request($url, $headers, null, self::GET, $options);\n\t}\n\n\t/**\n\t * Send a HEAD request\n\t */\n\tpublic static function head($url, $headers = array(), $options = array()) {\n\t\treturn self::request($url, $headers, null, self::HEAD, $options);\n\t}\n\n\t/**\n\t * Send a DELETE request\n\t */\n\tpublic static function delete($url, $headers = array(), $options = array()) {\n\t\treturn self::request($url, $headers, null, self::DELETE, $options);\n\t}\n\n\t/**\n\t * Send a TRACE request\n\t */\n\tpublic static function trace($url, $headers = array(), $options = array()) {\n\t\treturn self::request($url, $headers, null, self::TRACE, $options);\n\t}\n\t/**#@-*/\n\n\t/**#@+\n\t * @see request()\n\t * @param string $url\n\t * @param array $headers\n\t * @param array $data\n\t * @param array $options\n\t * @return Requests_Response\n\t */\n\t/**\n\t * Send a POST request\n\t */\n\tpublic static function post($url, $headers = array(), $data = array(), $options = array()) {\n\t\treturn self::request($url, $headers, $data, self::POST, $options);\n\t}\n\t/**\n\t * Send a PUT request\n\t */\n\tpublic static function put($url, $headers = array(), $data = array(), $options = array()) {\n\t\treturn self::request($url, $headers, $data, self::PUT, $options);\n\t}\n\n\t/**\n\t * Send an OPTIONS request\n\t */\n\tpublic static function options($url, $headers = array(), $data = array(), $options = array()) {\n\t\treturn self::request($url, $headers, $data, self::OPTIONS, $options);\n\t}\n\n\t/**\n\t * Send a PATCH request\n\t *\n\t * Note: Unlike {@see post} and {@see put}, `$headers` is required, as the\n\t * specification recommends that should send an ETag\n\t *\n\t * @link https://tools.ietf.org/html/rfc5789\n\t */\n\tpublic static function patch($url, $headers, $data = array(), $options = array()) {\n\t\treturn self::request($url, $headers, $data, self::PATCH, $options);\n\t}\n\t/**#@-*/\n\n\t/**\n\t * Main interface for HTTP requests\n\t *\n\t * This method initiates a request and sends it via a transport before\n\t * parsing.\n\t *\n\t * The `$options` parameter takes an associative array with the following\n\t * options:\n\t *\n\t * - `timeout`: How long should we wait for a response?\n\t *    Note: for cURL, a minimum of 1 second applies, as DNS resolution\n\t *    operates at second-resolution only.\n\t *    (float, seconds with a millisecond precision, default: 10, example: 0.01)\n\t * - `connect_timeout`: How long should we wait while trying to connect?\n\t *    (float, seconds with a millisecond precision, default: 10, example: 0.01)\n\t * - `useragent`: Useragent to send to the server\n\t *    (string, default: php-requests/$version)\n\t * - `follow_redirects`: Should we follow 3xx redirects?\n\t *    (boolean, default: true)\n\t * - `redirects`: How many times should we redirect before erroring?\n\t *    (integer, default: 10)\n\t * - `blocking`: Should we block processing on this request?\n\t *    (boolean, default: true)\n\t * - `filename`: File to stream the body to instead.\n\t *    (string|boolean, default: false)\n\t * - `auth`: Authentication handler or array of user/password details to use\n\t *    for Basic authentication\n\t *    (Requests_Auth|array|boolean, default: false)\n\t * - `proxy`: Proxy details to use for proxy by-passing and authentication\n\t *    (Requests_Proxy|array|string|boolean, default: false)\n\t * - `max_bytes`: Limit for the response body size.\n\t *    (integer|boolean, default: false)\n\t * - `idn`: Enable IDN parsing\n\t *    (boolean, default: true)\n\t * - `transport`: Custom transport. Either a class name, or a\n\t *    transport object. Defaults to the first working transport from\n\t *    {@see getTransport()}\n\t *    (string|Requests_Transport, default: {@see getTransport()})\n\t * - `hooks`: Hooks handler.\n\t *    (Requests_Hooker, default: new Requests_Hooks())\n\t * - `verify`: Should we verify SSL certificates? Allows passing in a custom\n\t *    certificate file as a string. (Using true uses the system-wide root\n\t *    certificate store instead, but this may have different behaviour\n\t *    across transports.)\n\t *    (string|boolean, default: library/Requests/Transport/cacert.pem)\n\t * - `verifyname`: Should we verify the common name in the SSL certificate?\n\t *    (boolean: default, true)\n\t * - `data_format`: How should we send the `$data` parameter?\n\t *    (string, one of 'query' or 'body', default: 'query' for\n\t *    HEAD/GET/DELETE, 'body' for POST/PUT/OPTIONS/PATCH)\n\t *\n\t * @throws Requests_Exception On invalid URLs (`nonhttp`)\n\t *\n\t * @param string $url URL to request\n\t * @param array $headers Extra headers to send with the request\n\t * @param array|null $data Data to send either as a query string for GET/HEAD requests, or in the body for POST requests\n\t * @param string $type HTTP request type (use Requests constants)\n\t * @param array $options Options for the request (see description for more information)\n\t * @return Requests_Response\n\t */\n\tpublic static function request($url, $headers = array(), $data = array(), $type = self::GET, $options = array()) {\n\t\tif (empty($options['type'])) {\n\t\t\t$options['type'] = $type;\n\t\t}\n\t\t$options = array_merge(self::get_default_options(), $options);\n\n\t\tself::set_defaults($url, $headers, $data, $type, $options);\n\n\t\t$options['hooks']->dispatch('requests.before_request', array(&$url, &$headers, &$data, &$type, &$options));\n\n\t\tif (!empty($options['transport'])) {\n\t\t\t$transport = $options['transport'];\n\n\t\t\tif (is_string($options['transport'])) {\n\t\t\t\t$transport = new $transport();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$need_ssl = (0 === stripos($url, 'https://'));\n\t\t\t$capabilities = array('ssl' => $need_ssl);\n\t\t\t$transport = self::get_transport($capabilities);\n\t\t}\n\t\t$response = $transport->request($url, $headers, $data, $options);\n\n\t\t$options['hooks']->dispatch('requests.before_parse', array(&$response, $url, $headers, $data, $type, $options));\n\n\t\treturn self::parse_response($response, $url, $headers, $data, $options);\n\t}\n\n\t/**\n\t * Send multiple HTTP requests simultaneously\n\t *\n\t * The `$requests` parameter takes an associative or indexed array of\n\t * request fields. The key of each request can be used to match up the\n\t * request with the returned data, or with the request passed into your\n\t * `multiple.request.complete` callback.\n\t *\n\t * The request fields value is an associative array with the following keys:\n\t *\n\t * - `url`: Request URL Same as the `$url` parameter to\n\t *    {@see Requests::request}\n\t *    (string, required)\n\t * - `headers`: Associative array of header fields. Same as the `$headers`\n\t *    parameter to {@see Requests::request}\n\t *    (array, default: `array()`)\n\t * - `data`: Associative array of data fields or a string. Same as the\n\t *    `$data` parameter to {@see Requests::request}\n\t *    (array|string, default: `array()`)\n\t * - `type`: HTTP request type (use Requests constants). Same as the `$type`\n\t *    parameter to {@see Requests::request}\n\t *    (string, default: `Requests::GET`)\n\t * - `cookies`: Associative array of cookie name to value, or cookie jar.\n\t *    (array|Requests_Cookie_Jar)\n\t *\n\t * If the `$options` parameter is specified, individual requests will\n\t * inherit options from it. This can be used to use a single hooking system,\n\t * or set all the types to `Requests::POST`, for example.\n\t *\n\t * In addition, the `$options` parameter takes the following global options:\n\t *\n\t * - `complete`: A callback for when a request is complete. Takes two\n\t *    parameters, a Requests_Response/Requests_Exception reference, and the\n\t *    ID from the request array (Note: this can also be overridden on a\n\t *    per-request basis, although that's a little silly)\n\t *    (callback)\n\t *\n\t * @param array $requests Requests data (see description for more information)\n\t * @param array $options Global and default options (see {@see Requests::request})\n\t * @return array Responses (either Requests_Response or a Requests_Exception object)\n\t */\n\tpublic static function request_multiple($requests, $options = array()) {\n\t\t$options = array_merge(self::get_default_options(true), $options);\n\n\t\tif (!empty($options['hooks'])) {\n\t\t\t$options['hooks']->register('transport.internal.parse_response', array('Requests', 'parse_multiple'));\n\t\t\tif (!empty($options['complete'])) {\n\t\t\t\t$options['hooks']->register('multiple.request.complete', $options['complete']);\n\t\t\t}\n\t\t}\n\n\t\tforeach ($requests as $id => &$request) {\n\t\t\tif (!isset($request['headers'])) {\n\t\t\t\t$request['headers'] = array();\n\t\t\t}\n\t\t\tif (!isset($request['data'])) {\n\t\t\t\t$request['data'] = array();\n\t\t\t}\n\t\t\tif (!isset($request['type'])) {\n\t\t\t\t$request['type'] = self::GET;\n\t\t\t}\n\t\t\tif (!isset($request['options'])) {\n\t\t\t\t$request['options'] = $options;\n\t\t\t\t$request['options']['type'] = $request['type'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (empty($request['options']['type'])) {\n\t\t\t\t\t$request['options']['type'] = $request['type'];\n\t\t\t\t}\n\t\t\t\t$request['options'] = array_merge($options, $request['options']);\n\t\t\t}\n\n\t\t\tself::set_defaults($request['url'], $request['headers'], $request['data'], $request['type'], $request['options']);\n\n\t\t\t// Ensure we only hook in once\n\t\t\tif ($request['options']['hooks'] !== $options['hooks']) {\n\t\t\t\t$request['options']['hooks']->register('transport.internal.parse_response', array('Requests', 'parse_multiple'));\n\t\t\t\tif (!empty($request['options']['complete'])) {\n\t\t\t\t\t$request['options']['hooks']->register('multiple.request.complete', $request['options']['complete']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tunset($request);\n\n\t\tif (!empty($options['transport'])) {\n\t\t\t$transport = $options['transport'];\n\n\t\t\tif (is_string($options['transport'])) {\n\t\t\t\t$transport = new $transport();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$transport = self::get_transport();\n\t\t}\n\t\t$responses = $transport->request_multiple($requests, $options);\n\n\t\tforeach ($responses as $id => &$response) {\n\t\t\t// If our hook got messed with somehow, ensure we end up with the\n\t\t\t// correct response\n\t\t\tif (is_string($response)) {\n\t\t\t\t$request = $requests[$id];\n\t\t\t\tself::parse_multiple($response, $request);\n\t\t\t\t$request['options']['hooks']->dispatch('multiple.request.complete', array(&$response, $id));\n\t\t\t}\n\t\t}\n\n\t\treturn $responses;\n\t}\n\n\t/**\n\t * Get the default options\n\t *\n\t * @see Requests::request() for values returned by this method\n\t * @param boolean $multirequest Is this a multirequest?\n\t * @return array Default option values\n\t */\n\tprotected static function get_default_options($multirequest = false) {\n\t\t$defaults = array(\n\t\t\t'timeout' => 10,\n\t\t\t'connect_timeout' => 10,\n\t\t\t'useragent' => 'php-requests/' . self::VERSION,\n\t\t\t'protocol_version' => 1.1,\n\t\t\t'redirected' => 0,\n\t\t\t'redirects' => 10,\n\t\t\t'follow_redirects' => true,\n\t\t\t'blocking' => true,\n\t\t\t'type' => self::GET,\n\t\t\t'filename' => false,\n\t\t\t'auth' => false,\n\t\t\t'proxy' => false,\n\t\t\t'cookies' => false,\n\t\t\t'max_bytes' => false,\n\t\t\t'idn' => true,\n\t\t\t'hooks' => null,\n\t\t\t'transport' => null,\n\t\t\t'verify' => Requests::get_certificate_path(),\n\t\t\t'verifyname' => true,\n\t\t);\n\t\tif ($multirequest !== false) {\n\t\t\t$defaults['complete'] = null;\n\t\t}\n\t\treturn $defaults;\n\t}\n\n\t/**\n\t * Get default certificate path.\n\t *\n\t * @return string Default certificate path.\n\t */\n\tpublic static function get_certificate_path() {\n\t\tif ( ! empty( Requests::$certificate_path ) ) {\n\t\t\treturn Requests::$certificate_path;\n\t\t}\n\n\t\treturn dirname(__FILE__) . '/Requests/Transport/cacert.pem';\n\t}\n\n\t/**\n\t * Set default certificate path.\n\t *\n\t * @param string $path Certificate path, pointing to a PEM file.\n\t */\n\tpublic static function set_certificate_path( $path ) {\n\t\tRequests::$certificate_path = $path;\n\t}\n\n\t/**\n\t * Set the default values\n\t *\n\t * @param string $url URL to request\n\t * @param array $headers Extra headers to send with the request\n\t * @param array|null $data Data to send either as a query string for GET/HEAD requests, or in the body for POST requests\n\t * @param string $type HTTP request type\n\t * @param array $options Options for the request\n\t * @return array $options\n\t */\n\tprotected static function set_defaults(&$url, &$headers, &$data, &$type, &$options) {\n\t\tif (!preg_match('/^http(s)?:\\/\\//i', $url, $matches)) {\n\t\t\tthrow new Requests_Exception('Only HTTP(S) requests are handled.', 'nonhttp', $url);\n\t\t}\n\n\t\tif (empty($options['hooks'])) {\n\t\t\t$options['hooks'] = new Requests_Hooks();\n\t\t}\n\n\t\tif (is_array($options['auth'])) {\n\t\t\t$options['auth'] = new Requests_Auth_Basic($options['auth']);\n\t\t}\n\t\tif ($options['auth'] !== false) {\n\t\t\t$options['auth']->register($options['hooks']);\n\t\t}\n\n\t\tif (is_string($options['proxy']) || is_array($options['proxy'])) {\n\t\t\t$options['proxy'] = new Requests_Proxy_HTTP($options['proxy']);\n\t\t}\n\t\tif ($options['proxy'] !== false) {\n\t\t\t$options['proxy']->register($options['hooks']);\n\t\t}\n\n\t\tif (is_array($options['cookies'])) {\n\t\t\t$options['cookies'] = new Requests_Cookie_Jar($options['cookies']);\n\t\t}\n\t\telseif (empty($options['cookies'])) {\n\t\t\t$options['cookies'] = new Requests_Cookie_Jar();\n\t\t}\n\t\tif ($options['cookies'] !== false) {\n\t\t\t$options['cookies']->register($options['hooks']);\n\t\t}\n\n\t\tif ($options['idn'] !== false) {\n\t\t\t$iri = new Requests_IRI($url);\n\t\t\t$iri->host = Requests_IDNAEncoder::encode($iri->ihost);\n\t\t\t$url = $iri->uri;\n\t\t}\n\n\t\t// Massage the type to ensure we support it.\n\t\t$type = strtoupper($type);\n\n\t\tif (!isset($options['data_format'])) {\n\t\t\tif (in_array($type, array(self::HEAD, self::GET, self::DELETE))) {\n\t\t\t\t$options['data_format'] = 'query';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$options['data_format'] = 'body';\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * HTTP response parser\n\t *\n\t * @throws Requests_Exception On missing head/body separator (`requests.no_crlf_separator`)\n\t * @throws Requests_Exception On missing head/body separator (`noversion`)\n\t * @throws Requests_Exception On missing head/body separator (`toomanyredirects`)\n\t *\n\t * @param string $headers Full response text including headers and body\n\t * @param string $url Original request URL\n\t * @param array $req_headers Original $headers array passed to {@link request()}, in case we need to follow redirects\n\t * @param array $req_data Original $data array passed to {@link request()}, in case we need to follow redirects\n\t * @param array $options Original $options array passed to {@link request()}, in case we need to follow redirects\n\t * @return Requests_Response\n\t */\n\tprotected static function parse_response($headers, $url, $req_headers, $req_data, $options) {\n\t\t$return = new Requests_Response();\n\t\tif (!$options['blocking']) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t$return->raw = $headers;\n\t\t$return->url = $url;\n\n\t\tif (!$options['filename']) {\n\t\t\tif (($pos = strpos($headers, \"\\r\\n\\r\\n\")) === false) {\n\t\t\t\t// Crap!\n\t\t\t\tthrow new Requests_Exception('Missing header/body separator', 'requests.no_crlf_separator');\n\t\t\t}\n\n\t\t\t$headers = substr($return->raw, 0, $pos);\n\t\t\t$return->body = substr($return->raw, $pos + strlen(\"\\n\\r\\n\\r\"));\n\t\t}\n\t\telse {\n\t\t\t$return->body = '';\n\t\t}\n\t\t// Pretend CRLF = LF for compatibility (RFC 2616, section 19.3)\n\t\t$headers = str_replace(\"\\r\\n\", \"\\n\", $headers);\n\t\t// Unfold headers (replace [CRLF] 1*( SP | HT ) with SP) as per RFC 2616 (section 2.2)\n\t\t$headers = preg_replace('/\\n[ \\t]/', ' ', $headers);\n\t\t$headers = explode(\"\\n\", $headers);\n\t\tpreg_match('#^HTTP/(1\\.\\d)[ \\t]+(\\d+)#i', array_shift($headers), $matches);\n\t\tif (empty($matches)) {\n\t\t\tthrow new Requests_Exception('Response could not be parsed', 'noversion', $headers);\n\t\t}\n\t\t$return->protocol_version = (float) $matches[1];\n\t\t$return->status_code = (int) $matches[2];\n\t\tif ($return->status_code >= 200 && $return->status_code < 300) {\n\t\t\t$return->success = true;\n\t\t}\n\n\t\tforeach ($headers as $header) {\n\t\t\tlist($key, $value) = explode(':', $header, 2);\n\t\t\t$value = trim($value);\n\t\t\tpreg_replace('#(\\s+)#i', ' ', $value);\n\t\t\t$return->headers[$key] = $value;\n\t\t}\n\t\tif (isset($return->headers['transfer-encoding'])) {\n\t\t\t$return->body = self::decode_chunked($return->body);\n\t\t\tunset($return->headers['transfer-encoding']);\n\t\t}\n\t\tif (isset($return->headers['content-encoding'])) {\n\t\t\t$return->body = self::decompress($return->body);\n\t\t}\n\n\t\t//fsockopen and cURL compatibility\n\t\tif (isset($return->headers['connection'])) {\n\t\t\tunset($return->headers['connection']);\n\t\t}\n\n\t\t$options['hooks']->dispatch('requests.before_redirect_check', array(&$return, $req_headers, $req_data, $options));\n\n\t\tif ($return->is_redirect() && $options['follow_redirects'] === true) {\n\t\t\tif (isset($return->headers['location']) && $options['redirected'] < $options['redirects']) {\n\t\t\t\tif ($return->status_code === 303) {\n\t\t\t\t\t$options['type'] = self::GET;\n\t\t\t\t}\n\t\t\t\t$options['redirected']++;\n\t\t\t\t$location = $return->headers['location'];\n\t\t\t\tif (strpos($location, 'http://') !== 0 && strpos($location, 'https://') !== 0) {\n\t\t\t\t\t// relative redirect, for compatibility make it absolute\n\t\t\t\t\t$location = Requests_IRI::absolutize($url, $location);\n\t\t\t\t\t$location = $location->uri;\n\t\t\t\t}\n\n\t\t\t\t$hook_args = array(\n\t\t\t\t\t&$location,\n\t\t\t\t\t&$req_headers,\n\t\t\t\t\t&$req_data,\n\t\t\t\t\t&$options,\n\t\t\t\t\t$return\n\t\t\t\t);\n\t\t\t\t$options['hooks']->dispatch('requests.before_redirect', $hook_args);\n\t\t\t\t$redirected = self::request($location, $req_headers, $req_data, $options['type'], $options);\n\t\t\t\t$redirected->history[] = $return;\n\t\t\t\treturn $redirected;\n\t\t\t}\n\t\t\telseif ($options['redirected'] >= $options['redirects']) {\n\t\t\t\tthrow new Requests_Exception('Too many redirects', 'toomanyredirects', $return);\n\t\t\t}\n\t\t}\n\n\t\t$return->redirects = $options['redirected'];\n\n\t\t$options['hooks']->dispatch('requests.after_request', array(&$return, $req_headers, $req_data, $options));\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Callback for `transport.internal.parse_response`\n\t *\n\t * Internal use only. Converts a raw HTTP response to a Requests_Response\n\t * while still executing a multiple request.\n\t *\n\t * @param string $response Full response text including headers and body (will be overwritten with Response instance)\n\t * @param array $request Request data as passed into {@see Requests::request_multiple()}\n\t * @return null `$response` is either set to a Requests_Response instance, or a Requests_Exception object\n\t */\n\tpublic static function parse_multiple(&$response, $request) {\n\t\ttry {\n\t\t\t$url = $request['url'];\n\t\t\t$headers = $request['headers'];\n\t\t\t$data = $request['data'];\n\t\t\t$options = $request['options'];\n\t\t\t$response = self::parse_response($response, $url, $headers, $data, $options);\n\t\t}\n\t\tcatch (Requests_Exception $e) {\n\t\t\t$response = $e;\n\t\t}\n\t}\n\n\t/**\n\t * Decoded a chunked body as per RFC 2616\n\t *\n\t * @see https://tools.ietf.org/html/rfc2616#section-3.6.1\n\t * @param string $data Chunked body\n\t * @return string Decoded body\n\t */\n\tprotected static function decode_chunked($data) {\n\t\tif (!preg_match('/^([0-9a-f]+)(?:;(?:[\\w-]*)(?:=(?:(?:[\\w-]*)*|\"(?:[^\\r\\n])*\"))?)*\\r\\n/i', trim($data))) {\n\t\t\treturn $data;\n\t\t}\n\n\n\n\t\t$decoded = '';\n\t\t$encoded = $data;\n\n\t\twhile (true) {\n\t\t\t$is_chunked = (bool) preg_match('/^([0-9a-f]+)(?:;(?:[\\w-]*)(?:=(?:(?:[\\w-]*)*|\"(?:[^\\r\\n])*\"))?)*\\r\\n/i', $encoded, $matches);\n\t\t\tif (!$is_chunked) {\n\t\t\t\t// Looks like it's not chunked after all\n\t\t\t\treturn $data;\n\t\t\t}\n\n\t\t\t$length = hexdec(trim($matches[1]));\n\t\t\tif ($length === 0) {\n\t\t\t\t// Ignore trailer headers\n\t\t\t\treturn $decoded;\n\t\t\t}\n\n\t\t\t$chunk_length = strlen($matches[0]);\n\t\t\t$decoded .= substr($encoded, $chunk_length, $length);\n\t\t\t$encoded = substr($encoded, $chunk_length + $length + 2);\n\n\t\t\tif (trim($encoded) === '0' || empty($encoded)) {\n\t\t\t\treturn $decoded;\n\t\t\t}\n\t\t}\n\n\t\t// We'll never actually get down here\n\t\t// @codeCoverageIgnoreStart\n\t}\n\t// @codeCoverageIgnoreEnd\n\n\t/**\n\t * Convert a key => value array to a 'key: value' array for headers\n\t *\n\t * @param array $array Dictionary of header values\n\t * @return string[] List of headers\n\t */\n\tpublic static function flatten($array) {\n\t\t$return = array();\n\t\tforeach ($array as $key => $value) {\n\t\t\t$return[] = sprintf('%s: %s', $key, $value);\n\t\t}\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Convert a key => value array to a 'key: value' array for headers\n\t *\n\t * @codeCoverageIgnore\n\t * @deprecated Misspelling of {@see Requests::flatten}\n\t * @param array $array Dictionary of header values\n\t * @return string[] List of headers\n\t */\n\tpublic static function flattern($array) {\n\t\treturn self::flatten($array);\n\t}\n\n\t/**\n\t * Decompress an encoded body\n\t *\n\t * Implements gzip, compress and deflate. Guesses which it is by attempting\n\t * to decode.\n\t *\n\t * @param string $data Compressed data in one of the above formats\n\t * @return string Decompressed string\n\t */\n\tpublic static function decompress($data) {\n\t\tif (substr($data, 0, 2) !== \"\\x1f\\x8b\" && substr($data, 0, 2) !== \"\\x78\\x9c\") {\n\t\t\t// Not actually compressed. Probably cURL ruining this for us.\n\t\t\treturn $data;\n\t\t}\n\n\t\tif (function_exists('gzdecode') && ($decoded = @gzdecode($data)) !== false) {\n\t\t\treturn $decoded;\n\t\t}\n\t\telseif (function_exists('gzinflate') && ($decoded = @gzinflate($data)) !== false) {\n\t\t\treturn $decoded;\n\t\t}\n\t\telseif (($decoded = self::compatible_gzinflate($data)) !== false) {\n\t\t\treturn $decoded;\n\t\t}\n\t\telseif (function_exists('gzuncompress') && ($decoded = @gzuncompress($data)) !== false) {\n\t\t\treturn $decoded;\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Decompression of deflated string while staying compatible with the majority of servers.\n\t *\n\t * Certain Servers will return deflated data with headers which PHP's gzinflate()\n\t * function cannot handle out of the box. The following function has been created from\n\t * various snippets on the gzinflate() PHP documentation.\n\t *\n\t * Warning: Magic numbers within. Due to the potential different formats that the compressed\n\t * data may be returned in, some \"magic offsets\" are needed to ensure proper decompression\n\t * takes place. For a simple progmatic way to determine the magic offset in use, see:\n\t * https://core.trac.wordpress.org/ticket/18273\n\t *\n\t * @since 2.8.1\n\t * @link https://core.trac.wordpress.org/ticket/18273\n\t * @link https://secure.php.net/manual/en/function.gzinflate.php#70875\n\t * @link https://secure.php.net/manual/en/function.gzinflate.php#77336\n\t *\n\t * @param string $gzData String to decompress.\n\t * @return string|bool False on failure.\n\t */\n\tpublic static function compatible_gzinflate($gzData) {\n\t\t// Compressed data might contain a full zlib header, if so strip it for\n\t\t// gzinflate()\n\t\tif (substr($gzData, 0, 3) == \"\\x1f\\x8b\\x08\") {\n\t\t\t$i = 10;\n\t\t\t$flg = ord(substr($gzData, 3, 1));\n\t\t\tif ($flg > 0) {\n\t\t\t\tif ($flg & 4) {\n\t\t\t\t\tlist($xlen) = unpack('v', substr($gzData, $i, 2));\n\t\t\t\t\t$i = $i + 2 + $xlen;\n\t\t\t\t}\n\t\t\t\tif ($flg & 8) {\n\t\t\t\t\t$i = strpos($gzData, \"\\0\", $i) + 1;\n\t\t\t\t}\n\t\t\t\tif ($flg & 16) {\n\t\t\t\t\t$i = strpos($gzData, \"\\0\", $i) + 1;\n\t\t\t\t}\n\t\t\t\tif ($flg & 2) {\n\t\t\t\t\t$i = $i + 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$decompressed = self::compatible_gzinflate(substr($gzData, $i));\n\t\t\tif (false !== $decompressed) {\n\t\t\t\treturn $decompressed;\n\t\t\t}\n\t\t}\n\n\t\t// If the data is Huffman Encoded, we must first strip the leading 2\n\t\t// byte Huffman marker for gzinflate()\n\t\t// The response is Huffman coded by many compressors such as\n\t\t// java.util.zip.Deflater, Ruby\u00e2\u20ac\u2122s Zlib::Deflate, and .NET's\n\t\t// System.IO.Compression.DeflateStream.\n\t\t//\n\t\t// See https://decompres.blogspot.com/ for a quick explanation of this\n\t\t// data type\n\t\t$huffman_encoded = false;\n\n\t\t// low nibble of first byte should be 0x08\n\t\tlist(, $first_nibble)    = unpack('h', $gzData);\n\n\t\t// First 2 bytes should be divisible by 0x1F\n\t\tlist(, $first_two_bytes) = unpack('n', $gzData);\n\n\t\tif (0x08 == $first_nibble && 0 == ($first_two_bytes % 0x1F)) {\n\t\t\t$huffman_encoded = true;\n\t\t}\n\n\t\tif ($huffman_encoded) {\n\t\t\tif (false !== ($decompressed = @gzinflate(substr($gzData, 2)))) {\n\t\t\t\treturn $decompressed;\n\t\t\t}\n\t\t}\n\n\t\tif (\"\\x50\\x4b\\x03\\x04\" == substr($gzData, 0, 4)) {\n\t\t\t// ZIP file format header\n\t\t\t// Offset 6: 2 bytes, General-purpose field\n\t\t\t// Offset 26: 2 bytes, filename length\n\t\t\t// Offset 28: 2 bytes, optional field length\n\t\t\t// Offset 30: Filename field, followed by optional field, followed\n\t\t\t// immediately by data\n\t\t\tlist(, $general_purpose_flag) = unpack('v', substr($gzData, 6, 2));\n\n\t\t\t// If the file has been compressed on the fly, 0x08 bit is set of\n\t\t\t// the general purpose field. We can use this to differentiate\n\t\t\t// between a compressed document, and a ZIP file\n\t\t\t$zip_compressed_on_the_fly = (0x08 == (0x08 & $general_purpose_flag));\n\n\t\t\tif (!$zip_compressed_on_the_fly) {\n\t\t\t\t// Don't attempt to decode a compressed zip file\n\t\t\t\treturn $gzData;\n\t\t\t}\n\n\t\t\t// Determine the first byte of data, based on the above ZIP header\n\t\t\t// offsets:\n\t\t\t$first_file_start = array_sum(unpack('v2', substr($gzData, 26, 4)));\n\t\t\tif (false !== ($decompressed = @gzinflate(substr($gzData, 30 + $first_file_start)))) {\n\t\t\t\treturn $decompressed;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t// Finally fall back to straight gzinflate\n\t\tif (false !== ($decompressed = @gzinflate($gzData))) {\n\t\t\treturn $decompressed;\n\t\t}\n\n\t\t// Fallback for all above failing, not expected, but included for\n\t\t// debugging and preventing regressions and to track stats\n\t\tif (false !== ($decompressed = @gzinflate(substr($gzData, 2)))) {\n\t\t\treturn $decompressed;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic static function match_domain($host, $reference) {\n\t\t// Check for a direct match\n\t\tif ($host === $reference) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Calculate the valid wildcard match if the host is not an IP address\n\t\t// Also validates that the host has 3 parts or more, as per Firefox's\n\t\t// ruleset.\n\t\t$parts = explode('.', $host);\n\t\tif (ip2long($host) === false && count($parts) >= 3) {\n\t\t\t$parts[0] = '*';\n\t\t\t$wildcard = implode('.', $parts);\n\t\t\tif ($wildcard === $reference) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n}\n", "num_lines": 983}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nif ( ! class_exists( 'SimplePie', false ) ) :\n\n// Load classes we will need.\nrequire ABSPATH . WPINC . '/SimplePie/Misc.php';\nrequire ABSPATH . WPINC . '/SimplePie/Cache.php';\nrequire ABSPATH . WPINC . '/SimplePie/File.php';\nrequire ABSPATH . WPINC . '/SimplePie/Sanitize.php';\nrequire ABSPATH . WPINC . '/SimplePie/Registry.php';\nrequire ABSPATH . WPINC . '/SimplePie/IRI.php';\nrequire ABSPATH . WPINC . '/SimplePie/Locator.php';\nrequire ABSPATH . WPINC . '/SimplePie/Content/Type/Sniffer.php';\nrequire ABSPATH . WPINC . '/SimplePie/XML/Declaration/Parser.php';\nrequire ABSPATH . WPINC . '/SimplePie/Parser.php';\nrequire ABSPATH . WPINC . '/SimplePie/Item.php';\nrequire ABSPATH . WPINC . '/SimplePie/Parse/Date.php';\nrequire ABSPATH . WPINC . '/SimplePie/Author.php';\n\n/**\n * WordPress autoloader for SimplePie.\n *\n * @since 3.5.0\n */\nfunction wp_simplepie_autoload( $class ) {\n\tif ( 0 !== strpos( $class, 'SimplePie_' ) )\n\t\treturn;\n\n\t$file = ABSPATH . WPINC . '/' . str_replace( '_', '/', $class ) . '.php';\n\tinclude $file;\n}\n\n/**\n * We autoload classes we may not need.\n */\nspl_autoload_register( 'wp_simplepie_autoload' );\n\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2017, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @version 1.5.5\n * @copyright 2004-2017 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * SimplePie Name\n */\ndefine('SIMPLEPIE_NAME', 'SimplePie');\n\n/**\n * SimplePie Version\n */\ndefine('SIMPLEPIE_VERSION', '1.5.5');\n\n/**\n * SimplePie Build\n * @todo Hardcode for release (there's no need to have to call SimplePie_Misc::get_build() only every load of simplepie.inc)\n */\ndefine('SIMPLEPIE_BUILD', gmdate('YmdHis', SimplePie_Misc::get_build()));\n\n/**\n * SimplePie Website URL\n */\ndefine('SIMPLEPIE_URL', 'http://simplepie.org');\n\n/**\n * SimplePie Useragent\n * @see SimplePie::set_useragent()\n */\ndefine('SIMPLEPIE_USERAGENT', SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION . ' (Feed Parser; ' . SIMPLEPIE_URL . '; Allow like Gecko) Build/' . SIMPLEPIE_BUILD);\n\n/**\n * SimplePie Linkback\n */\ndefine('SIMPLEPIE_LINKBACK', '<a href=\"' . SIMPLEPIE_URL . '\" title=\"' . SIMPLEPIE_NAME . ' ' . SIMPLEPIE_VERSION . '\">' . SIMPLEPIE_NAME . '</a>');\n\n/**\n * No Autodiscovery\n * @see SimplePie::set_autodiscovery_level()\n */\ndefine('SIMPLEPIE_LOCATOR_NONE', 0);\n\n/**\n * Feed Link Element Autodiscovery\n * @see SimplePie::set_autodiscovery_level()\n */\ndefine('SIMPLEPIE_LOCATOR_AUTODISCOVERY', 1);\n\n/**\n * Local Feed Extension Autodiscovery\n * @see SimplePie::set_autodiscovery_level()\n */\ndefine('SIMPLEPIE_LOCATOR_LOCAL_EXTENSION', 2);\n\n/**\n * Local Feed Body Autodiscovery\n * @see SimplePie::set_autodiscovery_level()\n */\ndefine('SIMPLEPIE_LOCATOR_LOCAL_BODY', 4);\n\n/**\n * Remote Feed Extension Autodiscovery\n * @see SimplePie::set_autodiscovery_level()\n */\ndefine('SIMPLEPIE_LOCATOR_REMOTE_EXTENSION', 8);\n\n/**\n * Remote Feed Body Autodiscovery\n * @see SimplePie::set_autodiscovery_level()\n */\ndefine('SIMPLEPIE_LOCATOR_REMOTE_BODY', 16);\n\n/**\n * All Feed Autodiscovery\n * @see SimplePie::set_autodiscovery_level()\n */\ndefine('SIMPLEPIE_LOCATOR_ALL', 31);\n\n/**\n * No known feed type\n */\ndefine('SIMPLEPIE_TYPE_NONE', 0);\n\n/**\n * RSS 0.90\n */\ndefine('SIMPLEPIE_TYPE_RSS_090', 1);\n\n/**\n * RSS 0.91 (Netscape)\n */\ndefine('SIMPLEPIE_TYPE_RSS_091_NETSCAPE', 2);\n\n/**\n * RSS 0.91 (Userland)\n */\ndefine('SIMPLEPIE_TYPE_RSS_091_USERLAND', 4);\n\n/**\n * RSS 0.91 (both Netscape and Userland)\n */\ndefine('SIMPLEPIE_TYPE_RSS_091', 6);\n\n/**\n * RSS 0.92\n */\ndefine('SIMPLEPIE_TYPE_RSS_092', 8);\n\n/**\n * RSS 0.93\n */\ndefine('SIMPLEPIE_TYPE_RSS_093', 16);\n\n/**\n * RSS 0.94\n */\ndefine('SIMPLEPIE_TYPE_RSS_094', 32);\n\n/**\n * RSS 1.0\n */\ndefine('SIMPLEPIE_TYPE_RSS_10', 64);\n\n/**\n * RSS 2.0\n */\ndefine('SIMPLEPIE_TYPE_RSS_20', 128);\n\n/**\n * RDF-based RSS\n */\ndefine('SIMPLEPIE_TYPE_RSS_RDF', 65);\n\n/**\n * Non-RDF-based RSS (truly intended as syndication format)\n */\ndefine('SIMPLEPIE_TYPE_RSS_SYNDICATION', 190);\n\n/**\n * All RSS\n */\ndefine('SIMPLEPIE_TYPE_RSS_ALL', 255);\n\n/**\n * Atom 0.3\n */\ndefine('SIMPLEPIE_TYPE_ATOM_03', 256);\n\n/**\n * Atom 1.0\n */\ndefine('SIMPLEPIE_TYPE_ATOM_10', 512);\n\n/**\n * All Atom\n */\ndefine('SIMPLEPIE_TYPE_ATOM_ALL', 768);\n\n/**\n * All feed types\n */\ndefine('SIMPLEPIE_TYPE_ALL', 1023);\n\n/**\n * No construct\n */\ndefine('SIMPLEPIE_CONSTRUCT_NONE', 0);\n\n/**\n * Text construct\n */\ndefine('SIMPLEPIE_CONSTRUCT_TEXT', 1);\n\n/**\n * HTML construct\n */\ndefine('SIMPLEPIE_CONSTRUCT_HTML', 2);\n\n/**\n * XHTML construct\n */\ndefine('SIMPLEPIE_CONSTRUCT_XHTML', 4);\n\n/**\n * base64-encoded construct\n */\ndefine('SIMPLEPIE_CONSTRUCT_BASE64', 8);\n\n/**\n * IRI construct\n */\ndefine('SIMPLEPIE_CONSTRUCT_IRI', 16);\n\n/**\n * A construct that might be HTML\n */\ndefine('SIMPLEPIE_CONSTRUCT_MAYBE_HTML', 32);\n\n/**\n * All constructs\n */\ndefine('SIMPLEPIE_CONSTRUCT_ALL', 63);\n\n/**\n * Don't change case\n */\ndefine('SIMPLEPIE_SAME_CASE', 1);\n\n/**\n * Change to lowercase\n */\ndefine('SIMPLEPIE_LOWERCASE', 2);\n\n/**\n * Change to uppercase\n */\ndefine('SIMPLEPIE_UPPERCASE', 4);\n\n/**\n * PCRE for HTML attributes\n */\ndefine('SIMPLEPIE_PCRE_HTML_ATTRIBUTE', '((?:[\\x09\\x0A\\x0B\\x0C\\x0D\\x20]+[^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x2F\\x3E][^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x2F\\x3D\\x3E]*(?:[\\x09\\x0A\\x0B\\x0C\\x0D\\x20]*=[\\x09\\x0A\\x0B\\x0C\\x0D\\x20]*(?:\"(?:[^\"]*)\"|\\'(?:[^\\']*)\\'|(?:[^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x22\\x27\\x3E][^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x3E]*)?))?)*)[\\x09\\x0A\\x0B\\x0C\\x0D\\x20]*');\n\n/**\n * PCRE for XML attributes\n */\ndefine('SIMPLEPIE_PCRE_XML_ATTRIBUTE', '((?:\\s+(?:(?:[^\\s:]+:)?[^\\s:]+)\\s*=\\s*(?:\"(?:[^\"]*)\"|\\'(?:[^\\']*)\\'))*)\\s*');\n\n/**\n * XML Namespace\n */\ndefine('SIMPLEPIE_NAMESPACE_XML', 'http://www.w3.org/XML/1998/namespace');\n\n/**\n * Atom 1.0 Namespace\n */\ndefine('SIMPLEPIE_NAMESPACE_ATOM_10', 'http://www.w3.org/2005/Atom');\n\n/**\n * Atom 0.3 Namespace\n */\ndefine('SIMPLEPIE_NAMESPACE_ATOM_03', 'http://purl.org/atom/ns#');\n\n/**\n * RDF Namespace\n */\ndefine('SIMPLEPIE_NAMESPACE_RDF', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');\n\n/**\n * RSS 0.90 Namespace\n */\ndefine('SIMPLEPIE_NAMESPACE_RSS_090', 'http://my.netscape.com/rdf/simple/0.9/');\n\n/**\n * RSS 1.0 Namespace\n */\ndefine('SIMPLEPIE_NAMESPACE_RSS_10', 'http://purl.org/rss/1.0/');\n\n/**\n * RSS 1.0 Content Module Namespace\n */\ndefine('SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT', 'http://purl.org/rss/1.0/modules/content/');\n\n/**\n * RSS 2.0 Namespace\n * (Stupid, I know, but I'm certain it will confuse people less with support.)\n */\ndefine('SIMPLEPIE_NAMESPACE_RSS_20', '');\n\n/**\n * DC 1.0 Namespace\n */\ndefine('SIMPLEPIE_NAMESPACE_DC_10', 'http://purl.org/dc/elements/1.0/');\n\n/**\n * DC 1.1 Namespace\n */\ndefine('SIMPLEPIE_NAMESPACE_DC_11', 'http://purl.org/dc/elements/1.1/');\n\n/**\n * W3C Basic Geo (WGS84 lat/long) Vocabulary Namespace\n */\ndefine('SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO', 'http://www.w3.org/2003/01/geo/wgs84_pos#');\n\n/**\n * GeoRSS Namespace\n */\ndefine('SIMPLEPIE_NAMESPACE_GEORSS', 'http://www.georss.org/georss');\n\n/**\n * Media RSS Namespace\n */\ndefine('SIMPLEPIE_NAMESPACE_MEDIARSS', 'http://search.yahoo.com/mrss/');\n\n/**\n * Wrong Media RSS Namespace. Caused by a long-standing typo in the spec.\n */\ndefine('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG', 'http://search.yahoo.com/mrss');\n\n/**\n * Wrong Media RSS Namespace #2. New namespace introduced in Media RSS 1.5.\n */\ndefine('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG2', 'http://video.search.yahoo.com/mrss');\n\n/**\n * Wrong Media RSS Namespace #3. A possible typo of the Media RSS 1.5 namespace.\n */\ndefine('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG3', 'http://video.search.yahoo.com/mrss/');\n\n/**\n * Wrong Media RSS Namespace #4. New spec location after the RSS Advisory Board takes it over, but not a valid namespace.\n */\ndefine('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG4', 'http://www.rssboard.org/media-rss');\n\n/**\n * Wrong Media RSS Namespace #5. A possible typo of the RSS Advisory Board URL.\n */\ndefine('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG5', 'http://www.rssboard.org/media-rss/');\n\n/**\n * iTunes RSS Namespace\n */\ndefine('SIMPLEPIE_NAMESPACE_ITUNES', 'http://www.itunes.com/dtds/podcast-1.0.dtd');\n\n/**\n * XHTML Namespace\n */\ndefine('SIMPLEPIE_NAMESPACE_XHTML', 'http://www.w3.org/1999/xhtml');\n\n/**\n * IANA Link Relations Registry\n */\ndefine('SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY', 'http://www.iana.org/assignments/relation/');\n\n/**\n * No file source\n */\ndefine('SIMPLEPIE_FILE_SOURCE_NONE', 0);\n\n/**\n * Remote file source\n */\ndefine('SIMPLEPIE_FILE_SOURCE_REMOTE', 1);\n\n/**\n * Local file source\n */\ndefine('SIMPLEPIE_FILE_SOURCE_LOCAL', 2);\n\n/**\n * fsockopen() file source\n */\ndefine('SIMPLEPIE_FILE_SOURCE_FSOCKOPEN', 4);\n\n/**\n * cURL file source\n */\ndefine('SIMPLEPIE_FILE_SOURCE_CURL', 8);\n\n/**\n * file_get_contents() file source\n */\ndefine('SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS', 16);\n\n\n\n/**\n * SimplePie\n *\n * @package SimplePie\n * @subpackage API\n */\nclass SimplePie\n{\n\t/**\n\t * @var array Raw data\n\t * @access private\n\t */\n\tpublic $data = array();\n\n\t/**\n\t * @var mixed Error string\n\t * @access private\n\t */\n\tpublic $error;\n\n\t/**\n\t * @var object Instance of SimplePie_Sanitize (or other class)\n\t * @see SimplePie::set_sanitize_class()\n\t * @access private\n\t */\n\tpublic $sanitize;\n\n\t/**\n\t * @var string SimplePie Useragent\n\t * @see SimplePie::set_useragent()\n\t * @access private\n\t */\n\tpublic $useragent = SIMPLEPIE_USERAGENT;\n\n\t/**\n\t * @var string Feed URL\n\t * @see SimplePie::set_feed_url()\n\t * @access private\n\t */\n\tpublic $feed_url;\n\n\t/**\n\t * @var string Original feed URL, or new feed URL iff HTTP 301 Moved Permanently\n\t * @see SimplePie::subscribe_url()\n\t * @access private\n\t */\n\tpublic $permanent_url = null;\n\n\t/**\n\t * @var object Instance of SimplePie_File to use as a feed\n\t * @see SimplePie::set_file()\n\t * @access private\n\t */\n\tpublic $file;\n\n\t/**\n\t * @var string Raw feed data\n\t * @see SimplePie::set_raw_data()\n\t * @access private\n\t */\n\tpublic $raw_data;\n\n\t/**\n\t * @var int Timeout for fetching remote files\n\t * @see SimplePie::set_timeout()\n\t * @access private\n\t */\n\tpublic $timeout = 10;\n\n\t/**\n\t * @var array Custom curl options\n\t * @see SimplePie::set_curl_options()\n\t * @access private\n\t */\n\tpublic $curl_options = array();\n\n\t/**\n\t * @var bool Forces fsockopen() to be used for remote files instead\n\t * of cURL, even if a new enough version is installed\n\t * @see SimplePie::force_fsockopen()\n\t * @access private\n\t */\n\tpublic $force_fsockopen = false;\n\n\t/**\n\t * @var bool Force the given data/URL to be treated as a feed no matter what\n\t * it appears like\n\t * @see SimplePie::force_feed()\n\t * @access private\n\t */\n\tpublic $force_feed = false;\n\n\t/**\n\t * @var bool Enable/Disable Caching\n\t * @see SimplePie::enable_cache()\n\t * @access private\n\t */\n\tpublic $cache = true;\n\n\t/**\n\t * @var bool Force SimplePie to fallback to expired cache, if enabled,\n\t * when feed is unavailable.\n\t * @see SimplePie::force_cache_fallback()\n\t * @access private\n\t */\n\tpublic $force_cache_fallback = false;\n\n\t/**\n\t * @var int Cache duration (in seconds)\n\t * @see SimplePie::set_cache_duration()\n\t * @access private\n\t */\n\tpublic $cache_duration = 3600;\n\n\t/**\n\t * @var int Auto-discovery cache duration (in seconds)\n\t * @see SimplePie::set_autodiscovery_cache_duration()\n\t * @access private\n\t */\n\tpublic $autodiscovery_cache_duration = 604800; // 7 Days.\n\n\t/**\n\t * @var string Cache location (relative to executing script)\n\t * @see SimplePie::set_cache_location()\n\t * @access private\n\t */\n\tpublic $cache_location = './cache';\n\n\t/**\n\t * @var string Function that creates the cache filename\n\t * @see SimplePie::set_cache_name_function()\n\t * @access private\n\t */\n\tpublic $cache_name_function = 'md5';\n\n\t/**\n\t * @var bool Reorder feed by date descending\n\t * @see SimplePie::enable_order_by_date()\n\t * @access private\n\t */\n\tpublic $order_by_date = true;\n\n\t/**\n\t * @var mixed Force input encoding to be set to the follow value\n\t * (false, or anything type-cast to false, disables this feature)\n\t * @see SimplePie::set_input_encoding()\n\t * @access private\n\t */\n\tpublic $input_encoding = false;\n\n\t/**\n\t * @var int Feed Autodiscovery Level\n\t * @see SimplePie::set_autodiscovery_level()\n\t * @access private\n\t */\n\tpublic $autodiscovery = SIMPLEPIE_LOCATOR_ALL;\n\n\t/**\n\t * Class registry object\n\t *\n\t * @var SimplePie_Registry\n\t */\n\tpublic $registry;\n\n\t/**\n\t * @var int Maximum number of feeds to check with autodiscovery\n\t * @see SimplePie::set_max_checked_feeds()\n\t * @access private\n\t */\n\tpublic $max_checked_feeds = 10;\n\n\t/**\n\t * @var array All the feeds found during the autodiscovery process\n\t * @see SimplePie::get_all_discovered_feeds()\n\t * @access private\n\t */\n\tpublic $all_discovered_feeds = array();\n\n\t/**\n\t * @var string Web-accessible path to the handler_image.php file.\n\t * @see SimplePie::set_image_handler()\n\t * @access private\n\t */\n\tpublic $image_handler = '';\n\n\t/**\n\t * @var array Stores the URLs when multiple feeds are being initialized.\n\t * @see SimplePie::set_feed_url()\n\t * @access private\n\t */\n\tpublic $multifeed_url = array();\n\n\t/**\n\t * @var array Stores SimplePie objects when multiple feeds initialized.\n\t * @access private\n\t */\n\tpublic $multifeed_objects = array();\n\n\t/**\n\t * @var array Stores the get_object_vars() array for use with multifeeds.\n\t * @see SimplePie::set_feed_url()\n\t * @access private\n\t */\n\tpublic $config_settings = null;\n\n\t/**\n\t * @var integer Stores the number of items to return per-feed with multifeeds.\n\t * @see SimplePie::set_item_limit()\n\t * @access private\n\t */\n\tpublic $item_limit = 0;\n\n\t/**\n\t * @var bool Stores if last-modified and/or etag headers were sent with the\n\t * request when checking a feed.\n\t */\n\tpublic $check_modified = false;\n\n\t/**\n\t * @var array Stores the default attributes to be stripped by strip_attributes().\n\t * @see SimplePie::strip_attributes()\n\t * @access private\n\t */\n\tpublic $strip_attributes = array('bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc');\n\n\t/**\n\t * @var array Stores the default attributes to add to different tags by add_attributes().\n\t * @see SimplePie::add_attributes()\n\t * @access private\n\t */\n\tpublic $add_attributes = array('audio' => array('preload' => 'none'), 'iframe' => array('sandbox' => 'allow-scripts allow-same-origin'), 'video' => array('preload' => 'none'));\n\n\t/**\n\t * @var array Stores the default tags to be stripped by strip_htmltags().\n\t * @see SimplePie::strip_htmltags()\n\t * @access private\n\t */\n\tpublic $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style');\n\n\t/**\n\t * @var bool Should we throw exceptions, or use the old-style error property?\n\t * @access private\n\t */\n\tpublic $enable_exceptions = false;\n\n\t/**\n\t * The SimplePie class contains feed level data and options\n\t *\n\t * To use SimplePie, create the SimplePie object with no parameters. You can\n\t * then set configuration options using the provided methods. After setting\n\t * them, you must initialise the feed using $feed->init(). At that point the\n\t * object's methods and properties will be available to you.\n\t *\n\t * Previously, it was possible to pass in the feed URL along with cache\n\t * options directly into the constructor. This has been removed as of 1.3 as\n\t * it caused a lot of confusion.\n\t *\n\t * @since 1.0 Preview Release\n\t */\n\tpublic function __construct()\n\t{\n\t\tif (version_compare(PHP_VERSION, '5.6', '<'))\n\t\t{\n\t\t\ttrigger_error('Please upgrade to PHP 5.6 or newer.');\n\t\t\tdie();\n\t\t}\n\n\t\t// Other objects, instances created here so we can set options on them\n\t\t$this->sanitize = new SimplePie_Sanitize();\n\t\t$this->registry = new SimplePie_Registry();\n\n\t\tif (func_num_args() > 0)\n\t\t{\n\t\t\t$level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING;\n\t\t\ttrigger_error('Passing parameters to the constructor is no longer supported. Please use set_feed_url(), set_cache_location(), and set_cache_duration() directly.', $level);\n\n\t\t\t$args = func_get_args();\n\t\t\tswitch (count($args)) {\n\t\t\t\tcase 3:\n\t\t\t\t\t$this->set_cache_duration($args[2]);\n\t\t\t\tcase 2:\n\t\t\t\t\t$this->set_cache_location($args[1]);\n\t\t\t\tcase 1:\n\t\t\t\t\t$this->set_feed_url($args[0]);\n\t\t\t\t\t$this->init();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Used for converting object to a string\n\t */\n\tpublic function __toString()\n\t{\n\t\treturn md5(serialize($this->data));\n\t}\n\n\t/**\n\t * Remove items that link back to this before destroying this object\n\t */\n\tpublic function __destruct()\n\t{\n\t\tif (!gc_enabled())\n\t\t{\n\t\t\tif (!empty($this->data['items']))\n\t\t\t{\n\t\t\t\tforeach ($this->data['items'] as $item)\n\t\t\t\t{\n\t\t\t\t\t$item->__destruct();\n\t\t\t\t}\n\t\t\t\tunset($item, $this->data['items']);\n\t\t\t}\n\t\t\tif (!empty($this->data['ordered_items']))\n\t\t\t{\n\t\t\t\tforeach ($this->data['ordered_items'] as $item)\n\t\t\t\t{\n\t\t\t\t\t$item->__destruct();\n\t\t\t\t}\n\t\t\t\tunset($item, $this->data['ordered_items']);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Force the given data/URL to be treated as a feed\n\t *\n\t * This tells SimplePie to ignore the content-type provided by the server.\n\t * Be careful when using this option, as it will also disable autodiscovery.\n\t *\n\t * @since 1.1\n\t * @param bool $enable Force the given data/URL to be treated as a feed\n\t */\n\tpublic function force_feed($enable = false)\n\t{\n\t\t$this->force_feed = (bool) $enable;\n\t}\n\n\t/**\n\t * Set the URL of the feed you want to parse\n\t *\n\t * This allows you to enter the URL of the feed you want to parse, or the\n\t * website you want to try to use auto-discovery on. This takes priority\n\t * over any set raw data.\n\t *\n\t * You can set multiple feeds to mash together by passing an array instead\n\t * of a string for the $url. Remember that with each additional feed comes\n\t * additional processing and resources.\n\t *\n\t * @since 1.0 Preview Release\n\t * @see set_raw_data()\n\t * @param string|array $url This is the URL (or array of URLs) that you want to parse.\n\t */\n\tpublic function set_feed_url($url)\n\t{\n\t\t$this->multifeed_url = array();\n\t\tif (is_array($url))\n\t\t{\n\t\t\tforeach ($url as $value)\n\t\t\t{\n\t\t\t\t$this->multifeed_url[] = $this->registry->call('Misc', 'fix_protocol', array($value, 1));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->feed_url = $this->registry->call('Misc', 'fix_protocol', array($url, 1));\n\t\t\t$this->permanent_url = $this->feed_url;\n\t\t}\n\t}\n\n\t/**\n\t * Set an instance of {@see SimplePie_File} to use as a feed\n\t *\n\t * @param SimplePie_File &$file\n\t * @return bool True on success, false on failure\n\t */\n\tpublic function set_file(&$file)\n\t{\n\t\tif ($file instanceof SimplePie_File)\n\t\t{\n\t\t\t$this->feed_url = $file->url;\n\t\t\t$this->permanent_url = $this->feed_url;\n\t\t\t$this->file =& $file;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Set the raw XML data to parse\n\t *\n\t * Allows you to use a string of RSS/Atom data instead of a remote feed.\n\t *\n\t * If you have a feed available as a string in PHP, you can tell SimplePie\n\t * to parse that data string instead of a remote feed. Any set feed URL\n\t * takes precedence.\n\t *\n\t * @since 1.0 Beta 3\n\t * @param string $data RSS or Atom data as a string.\n\t * @see set_feed_url()\n\t */\n\tpublic function set_raw_data($data)\n\t{\n\t\t$this->raw_data = $data;\n\t}\n\n\t/**\n\t * Set the default timeout for fetching remote feeds\n\t *\n\t * This allows you to change the maximum time the feed's server to respond\n\t * and send the feed back.\n\t *\n\t * @since 1.0 Beta 3\n\t * @param int $timeout The maximum number of seconds to spend waiting to retrieve a feed.\n\t */\n\tpublic function set_timeout($timeout = 10)\n\t{\n\t\t$this->timeout = (int) $timeout;\n\t}\n\n\t/**\n\t * Set custom curl options\n\t *\n\t * This allows you to change default curl options\n\t *\n\t * @since 1.0 Beta 3\n\t * @param array $curl_options Curl options to add to default settings\n\t */\n\tpublic function set_curl_options(array $curl_options = array())\n\t{\n\t\t$this->curl_options = $curl_options;\n\t}\n\n\t/**\n\t * Force SimplePie to use fsockopen() instead of cURL\n\t *\n\t * @since 1.0 Beta 3\n\t * @param bool $enable Force fsockopen() to be used\n\t */\n\tpublic function force_fsockopen($enable = false)\n\t{\n\t\t$this->force_fsockopen = (bool) $enable;\n\t}\n\n\t/**\n\t * Enable/disable caching in SimplePie.\n\t *\n\t * This option allows you to disable caching all-together in SimplePie.\n\t * However, disabling the cache can lead to longer load times.\n\t *\n\t * @since 1.0 Preview Release\n\t * @param bool $enable Enable caching\n\t */\n\tpublic function enable_cache($enable = true)\n\t{\n\t\t$this->cache = (bool) $enable;\n\t}\n\n\t/**\n\t * SimplePie to continue to fall back to expired cache, if enabled, when\n\t * feed is unavailable.\n\t *\n\t * This tells SimplePie to ignore any file errors and fall back to cache\n\t * instead. This only works if caching is enabled and cached content\n\t * still exists.\n\n\t * @param bool $enable Force use of cache on fail.\n\t */\n\tpublic function force_cache_fallback($enable = false)\n\t{\n\t\t$this->force_cache_fallback= (bool) $enable;\n\t}\n\n\t/**\n\t * Set the length of time (in seconds) that the contents of a feed will be\n\t * cached\n\t *\n\t * @param int $seconds The feed content cache duration\n\t */\n\tpublic function set_cache_duration($seconds = 3600)\n\t{\n\t\t$this->cache_duration = (int) $seconds;\n\t}\n\n\t/**\n\t * Set the length of time (in seconds) that the autodiscovered feed URL will\n\t * be cached\n\t *\n\t * @param int $seconds The autodiscovered feed URL cache duration.\n\t */\n\tpublic function set_autodiscovery_cache_duration($seconds = 604800)\n\t{\n\t\t$this->autodiscovery_cache_duration = (int) $seconds;\n\t}\n\n\t/**\n\t * Set the file system location where the cached files should be stored\n\t *\n\t * @param string $location The file system location.\n\t */\n\tpublic function set_cache_location($location = './cache')\n\t{\n\t\t$this->cache_location = (string) $location;\n\t}\n\n\t/**\n\t * Set whether feed items should be sorted into reverse chronological order\n\t *\n\t * @param bool $enable Sort as reverse chronological order.\n\t */\n\tpublic function enable_order_by_date($enable = true)\n\t{\n\t\t$this->order_by_date = (bool) $enable;\n\t}\n\n\t/**\n\t * Set the character encoding used to parse the feed\n\t *\n\t * This overrides the encoding reported by the feed, however it will fall\n\t * back to the normal encoding detection if the override fails\n\t *\n\t * @param string $encoding Character encoding\n\t */\n\tpublic function set_input_encoding($encoding = false)\n\t{\n\t\tif ($encoding)\n\t\t{\n\t\t\t$this->input_encoding = (string) $encoding;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->input_encoding = false;\n\t\t}\n\t}\n\n\t/**\n\t * Set how much feed autodiscovery to do\n\t *\n\t * @see SIMPLEPIE_LOCATOR_NONE\n\t * @see SIMPLEPIE_LOCATOR_AUTODISCOVERY\n\t * @see SIMPLEPIE_LOCATOR_LOCAL_EXTENSION\n\t * @see SIMPLEPIE_LOCATOR_LOCAL_BODY\n\t * @see SIMPLEPIE_LOCATOR_REMOTE_EXTENSION\n\t * @see SIMPLEPIE_LOCATOR_REMOTE_BODY\n\t * @see SIMPLEPIE_LOCATOR_ALL\n\t * @param int $level Feed Autodiscovery Level (level can be a combination of the above constants, see bitwise OR operator)\n\t */\n\tpublic function set_autodiscovery_level($level = SIMPLEPIE_LOCATOR_ALL)\n\t{\n\t\t$this->autodiscovery = (int) $level;\n\t}\n\n\t/**\n\t * Get the class registry\n\t *\n\t * Use this to override SimplePie's default classes\n\t * @see SimplePie_Registry\n\t * @return SimplePie_Registry\n\t */\n\tpublic function &get_registry()\n\t{\n\t\treturn $this->registry;\n\t}\n\n\t/**#@+\n\t * Useful when you are overloading or extending SimplePie's default classes.\n\t *\n\t * @deprecated Use {@see get_registry()} instead\n\t * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation\n\t * @param string $class Name of custom class\n\t * @return boolean True on success, false otherwise\n\t */\n\t/**\n\t * Set which class SimplePie uses for caching\n\t */\n\tpublic function set_cache_class($class = 'SimplePie_Cache')\n\t{\n\t\treturn $this->registry->register('Cache', $class, true);\n\t}\n\n\t/**\n\t * Set which class SimplePie uses for auto-discovery\n\t */\n\tpublic function set_locator_class($class = 'SimplePie_Locator')\n\t{\n\t\treturn $this->registry->register('Locator', $class, true);\n\t}\n\n\t/**\n\t * Set which class SimplePie uses for XML parsing\n\t */\n\tpublic function set_parser_class($class = 'SimplePie_Parser')\n\t{\n\t\treturn $this->registry->register('Parser', $class, true);\n\t}\n\n\t/**\n\t * Set which class SimplePie uses for remote file fetching\n\t */\n\tpublic function set_file_class($class = 'SimplePie_File')\n\t{\n\t\treturn $this->registry->register('File', $class, true);\n\t}\n\n\t/**\n\t * Set which class SimplePie uses for data sanitization\n\t */\n\tpublic function set_sanitize_class($class = 'SimplePie_Sanitize')\n\t{\n\t\treturn $this->registry->register('Sanitize', $class, true);\n\t}\n\n\t/**\n\t * Set which class SimplePie uses for handling feed items\n\t */\n\tpublic function set_item_class($class = 'SimplePie_Item')\n\t{\n\t\treturn $this->registry->register('Item', $class, true);\n\t}\n\n\t/**\n\t * Set which class SimplePie uses for handling author data\n\t */\n\tpublic function set_author_class($class = 'SimplePie_Author')\n\t{\n\t\treturn $this->registry->register('Author', $class, true);\n\t}\n\n\t/**\n\t * Set which class SimplePie uses for handling category data\n\t */\n\tpublic function set_category_class($class = 'SimplePie_Category')\n\t{\n\t\treturn $this->registry->register('Category', $class, true);\n\t}\n\n\t/**\n\t * Set which class SimplePie uses for feed enclosures\n\t */\n\tpublic function set_enclosure_class($class = 'SimplePie_Enclosure')\n\t{\n\t\treturn $this->registry->register('Enclosure', $class, true);\n\t}\n\n\t/**\n\t * Set which class SimplePie uses for `<media:text>` captions\n\t */\n\tpublic function set_caption_class($class = 'SimplePie_Caption')\n\t{\n\t\treturn $this->registry->register('Caption', $class, true);\n\t}\n\n\t/**\n\t * Set which class SimplePie uses for `<media:copyright>`\n\t */\n\tpublic function set_copyright_class($class = 'SimplePie_Copyright')\n\t{\n\t\treturn $this->registry->register('Copyright', $class, true);\n\t}\n\n\t/**\n\t * Set which class SimplePie uses for `<media:credit>`\n\t */\n\tpublic function set_credit_class($class = 'SimplePie_Credit')\n\t{\n\t\treturn $this->registry->register('Credit', $class, true);\n\t}\n\n\t/**\n\t * Set which class SimplePie uses for `<media:rating>`\n\t */\n\tpublic function set_rating_class($class = 'SimplePie_Rating')\n\t{\n\t\treturn $this->registry->register('Rating', $class, true);\n\t}\n\n\t/**\n\t * Set which class SimplePie uses for `<media:restriction>`\n\t */\n\tpublic function set_restriction_class($class = 'SimplePie_Restriction')\n\t{\n\t\treturn $this->registry->register('Restriction', $class, true);\n\t}\n\n\t/**\n\t * Set which class SimplePie uses for content-type sniffing\n\t */\n\tpublic function set_content_type_sniffer_class($class = 'SimplePie_Content_Type_Sniffer')\n\t{\n\t\treturn $this->registry->register('Content_Type_Sniffer', $class, true);\n\t}\n\n\t/**\n\t * Set which class SimplePie uses item sources\n\t */\n\tpublic function set_source_class($class = 'SimplePie_Source')\n\t{\n\t\treturn $this->registry->register('Source', $class, true);\n\t}\n\t/**#@-*/\n\n\t/**\n\t * Set the user agent string\n\t *\n\t * @param string $ua New user agent string.\n\t */\n\tpublic function set_useragent($ua = SIMPLEPIE_USERAGENT)\n\t{\n\t\t$this->useragent = (string) $ua;\n\t}\n\n\t/**\n\t * Set callback function to create cache filename with\n\t *\n\t * @param mixed $function Callback function\n\t */\n\tpublic function set_cache_name_function($function = 'md5')\n\t{\n\t\tif (is_callable($function))\n\t\t{\n\t\t\t$this->cache_name_function = $function;\n\t\t}\n\t}\n\n\t/**\n\t * Set options to make SP as fast as possible\n\t *\n\t * Forgoes a substantial amount of data sanitization in favor of speed. This\n\t * turns SimplePie into a dumb parser of feeds.\n\t *\n\t * @param bool $set Whether to set them or not\n\t */\n\tpublic function set_stupidly_fast($set = false)\n\t{\n\t\tif ($set)\n\t\t{\n\t\t\t$this->enable_order_by_date(false);\n\t\t\t$this->remove_div(false);\n\t\t\t$this->strip_comments(false);\n\t\t\t$this->strip_htmltags(false);\n\t\t\t$this->strip_attributes(false);\n\t\t\t$this->add_attributes(false);\n\t\t\t$this->set_image_handler(false);\n\t\t}\n\t}\n\n\t/**\n\t * Set maximum number of feeds to check with autodiscovery\n\t *\n\t * @param int $max Maximum number of feeds to check\n\t */\n\tpublic function set_max_checked_feeds($max = 10)\n\t{\n\t\t$this->max_checked_feeds = (int) $max;\n\t}\n\n\tpublic function remove_div($enable = true)\n\t{\n\t\t$this->sanitize->remove_div($enable);\n\t}\n\n\tpublic function strip_htmltags($tags = '', $encode = null)\n\t{\n\t\tif ($tags === '')\n\t\t{\n\t\t\t$tags = $this->strip_htmltags;\n\t\t}\n\t\t$this->sanitize->strip_htmltags($tags);\n\t\tif ($encode !== null)\n\t\t{\n\t\t\t$this->sanitize->encode_instead_of_strip($tags);\n\t\t}\n\t}\n\n\tpublic function encode_instead_of_strip($enable = true)\n\t{\n\t\t$this->sanitize->encode_instead_of_strip($enable);\n\t}\n\n\tpublic function strip_attributes($attribs = '')\n\t{\n\t\tif ($attribs === '')\n\t\t{\n\t\t\t$attribs = $this->strip_attributes;\n\t\t}\n\t\t$this->sanitize->strip_attributes($attribs);\n\t}\n\n\tpublic function add_attributes($attribs = '')\n\t{\n\t\tif ($attribs === '')\n\t\t{\n\t\t\t$attribs = $this->add_attributes;\n\t\t}\n\t\t$this->sanitize->add_attributes($attribs);\n\t}\n\n\t/**\n\t * Set the output encoding\n\t *\n\t * Allows you to override SimplePie's output to match that of your webpage.\n\t * This is useful for times when your webpages are not being served as\n\t * UTF-8. This setting will be obeyed by {@see handle_content_type()}, and\n\t * is similar to {@see set_input_encoding()}.\n\t *\n\t * It should be noted, however, that not all character encodings can support\n\t * all characters. If your page is being served as ISO-8859-1 and you try\n\t * to display a Japanese feed, you'll likely see garbled characters.\n\t * Because of this, it is highly recommended to ensure that your webpages\n\t * are served as UTF-8.\n\t *\n\t * The number of supported character encodings depends on whether your web\n\t * host supports {@link http://php.net/mbstring mbstring},\n\t * {@link http://php.net/iconv iconv}, or both. See\n\t * {@link http://simplepie.org/wiki/faq/Supported_Character_Encodings} for\n\t * more information.\n\t *\n\t * @param string $encoding\n\t */\n\tpublic function set_output_encoding($encoding = 'UTF-8')\n\t{\n\t\t$this->sanitize->set_output_encoding($encoding);\n\t}\n\n\tpublic function strip_comments($strip = false)\n\t{\n\t\t$this->sanitize->strip_comments($strip);\n\t}\n\n\t/**\n\t * Set element/attribute key/value pairs of HTML attributes\n\t * containing URLs that need to be resolved relative to the feed\n\t *\n\t * Defaults to |a|@href, |area|@href, |blockquote|@cite, |del|@cite,\n\t * |form|@action, |img|@longdesc, |img|@src, |input|@src, |ins|@cite,\n\t * |q|@cite\n\t *\n\t * @since 1.0\n\t * @param array|null $element_attribute Element/attribute key/value pairs, null for default\n\t */\n\tpublic function set_url_replacements($element_attribute = null)\n\t{\n\t\t$this->sanitize->set_url_replacements($element_attribute);\n\t}\n\n\t/**\n\t * Set the handler to enable the display of cached images.\n\t *\n\t * @param string $page Web-accessible path to the handler_image.php file.\n\t * @param string $qs The query string that the value should be passed to.\n\t */\n\tpublic function set_image_handler($page = false, $qs = 'i')\n\t{\n\t\tif ($page !== false)\n\t\t{\n\t\t\t$this->sanitize->set_image_handler($page . '?' . $qs . '=');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->image_handler = '';\n\t\t}\n\t}\n\n\t/**\n\t * Set the limit for items returned per-feed with multifeeds\n\t *\n\t * @param integer $limit The maximum number of items to return.\n\t */\n\tpublic function set_item_limit($limit = 0)\n\t{\n\t\t$this->item_limit = (int) $limit;\n\t}\n\n\t/**\n\t * Enable throwing exceptions\n\t *\n\t * @param boolean $enable Should we throw exceptions, or use the old-style error property?\n\t */\n\tpublic function enable_exceptions($enable = true)\n\t{\n\t\t$this->enable_exceptions = $enable;\n\t}\n\n\t/**\n\t * Initialize the feed object\n\t *\n\t * This is what makes everything happen. Period. This is where all of the\n\t * configuration options get processed, feeds are fetched, cached, and\n\t * parsed, and all of that other good stuff.\n\t *\n\t * @return boolean True if successful, false otherwise\n\t */\n\tpublic function init()\n\t{\n\t\t// Check absolute bare minimum requirements.\n\t\tif (!extension_loaded('xml') || !extension_loaded('pcre'))\n\t\t{\n\t\t\t$this->error = 'XML or PCRE extensions not loaded!';\n\t\t\treturn false;\n\t\t}\n\t\t// Then check the xml extension is sane (i.e., libxml 2.7.x issue on PHP < 5.2.9 and libxml 2.7.0 to 2.7.2 on any version) if we don't have xmlreader.\n\t\telseif (!extension_loaded('xmlreader'))\n\t\t{\n\t\t\tstatic $xml_is_sane = null;\n\t\t\tif ($xml_is_sane === null)\n\t\t\t{\n\t\t\t\t$parser_check = xml_parser_create();\n\t\t\t\txml_parse_into_struct($parser_check, '<foo>&amp;</foo>', $values);\n\t\t\t\txml_parser_free($parser_check);\n\t\t\t\t$xml_is_sane = isset($values[0]['value']);\n\t\t\t}\n\t\t\tif (!$xml_is_sane)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// The default sanitize class gets set in the constructor, check if it has\n\t\t// changed.\n\t\tif ($this->registry->get_class('Sanitize') !== 'SimplePie_Sanitize') {\n\t\t\t$this->sanitize = $this->registry->create('Sanitize');\n\t\t}\n\t\tif (method_exists($this->sanitize, 'set_registry'))\n\t\t{\n\t\t\t$this->sanitize->set_registry($this->registry);\n\t\t}\n\n\t\t// Pass whatever was set with config options over to the sanitizer.\n\t\t// Pass the classes in for legacy support; new classes should use the registry instead\n\t\t$this->sanitize->pass_cache_data($this->cache, $this->cache_location, $this->cache_name_function, $this->registry->get_class('Cache'));\n\t\t$this->sanitize->pass_file_data($this->registry->get_class('File'), $this->timeout, $this->useragent, $this->force_fsockopen, $this->curl_options);\n\n\t\tif (!empty($this->multifeed_url))\n\t\t{\n\t\t\t$i = 0;\n\t\t\t$success = 0;\n\t\t\t$this->multifeed_objects = array();\n\t\t\t$this->error = array();\n\t\t\tforeach ($this->multifeed_url as $url)\n\t\t\t{\n\t\t\t\t$this->multifeed_objects[$i] = clone $this;\n\t\t\t\t$this->multifeed_objects[$i]->set_feed_url($url);\n\t\t\t\t$single_success = $this->multifeed_objects[$i]->init();\n\t\t\t\t$success |= $single_success;\n\t\t\t\tif (!$single_success)\n\t\t\t\t{\n\t\t\t\t\t$this->error[$i] = $this->multifeed_objects[$i]->error();\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn (bool) $success;\n\t\t}\n\t\telseif ($this->feed_url === null && $this->raw_data === null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->error = null;\n\t\t$this->data = array();\n\t\t$this->check_modified = false;\n\t\t$this->multifeed_objects = array();\n\t\t$cache = false;\n\n\t\tif ($this->feed_url !== null)\n\t\t{\n\t\t\t$parsed_feed_url = $this->registry->call('Misc', 'parse_url', array($this->feed_url));\n\n\t\t\t// Decide whether to enable caching\n\t\t\tif ($this->cache && $parsed_feed_url['scheme'] !== '')\n\t\t\t{\n\t\t\t\t$url = $this->feed_url . ($this->force_feed ? '#force_feed' : '');\n\t\t\t\t$cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, call_user_func($this->cache_name_function, $url), 'spc'));\n\t\t\t}\n\n\t\t\t// Fetch the data via SimplePie_File into $this->raw_data\n\t\t\tif (($fetched = $this->fetch_data($cache)) === true)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telseif ($fetched === false) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tlist($headers, $sniffed) = $fetched;\n\t\t}\n\n\t\t// Empty response check\n\t\tif(empty($this->raw_data)){\n\t\t\t$this->error = \"A feed could not be found at `$this->feed_url`. Empty body.\";\n\t\t\t$this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__));\n\t\t\treturn false;\n\t\t}\n\n\t\t// Set up array of possible encodings\n\t\t$encodings = array();\n\n\t\t// First check to see if input has been overridden.\n\t\tif ($this->input_encoding !== false)\n\t\t{\n\t\t\t$encodings[] = strtoupper($this->input_encoding);\n\t\t}\n\n\t\t$application_types = array('application/xml', 'application/xml-dtd', 'application/xml-external-parsed-entity');\n\t\t$text_types = array('text/xml', 'text/xml-external-parsed-entity');\n\n\t\t// RFC 3023 (only applies to sniffed content)\n\t\tif (isset($sniffed))\n\t\t{\n\t\t\tif (in_array($sniffed, $application_types) || substr($sniffed, 0, 12) === 'application/' && substr($sniffed, -4) === '+xml')\n\t\t\t{\n\t\t\t\tif (isset($headers['content-type']) && preg_match('/;\\x20?charset=([^;]*)/i', $headers['content-type'], $charset))\n\t\t\t\t{\n\t\t\t\t\t$encodings[] = strtoupper($charset[1]);\n\t\t\t\t}\n\t\t\t\t$encodings = array_merge($encodings, $this->registry->call('Misc', 'xml_encoding', array($this->raw_data, &$this->registry)));\n\t\t\t\t$encodings[] = 'UTF-8';\n\t\t\t}\n\t\t\telseif (in_array($sniffed, $text_types) || substr($sniffed, 0, 5) === 'text/' && substr($sniffed, -4) === '+xml')\n\t\t\t{\n\t\t\t\tif (isset($headers['content-type']) && preg_match('/;\\x20?charset=([^;]*)/i', $headers['content-type'], $charset))\n\t\t\t\t{\n\t\t\t\t\t$encodings[] = strtoupper($charset[1]);\n\t\t\t\t}\n\t\t\t\t$encodings[] = 'US-ASCII';\n\t\t\t}\n\t\t\t// Text MIME-type default\n\t\t\telseif (substr($sniffed, 0, 5) === 'text/')\n\t\t\t{\n\t\t\t\t$encodings[] = 'UTF-8';\n\t\t\t}\n\t\t}\n\n\t\t// Fallback to XML 1.0 Appendix F.1/UTF-8/ISO-8859-1\n\t\t$encodings = array_merge($encodings, $this->registry->call('Misc', 'xml_encoding', array($this->raw_data, &$this->registry)));\n\t\t$encodings[] = 'UTF-8';\n\t\t$encodings[] = 'ISO-8859-1';\n\n\t\t// There's no point in trying an encoding twice\n\t\t$encodings = array_unique($encodings);\n\n\t\t// Loop through each possible encoding, till we return something, or run out of possibilities\n\t\tforeach ($encodings as $encoding)\n\t\t{\n\t\t\t// Change the encoding to UTF-8 (as we always use UTF-8 internally)\n\t\t\tif ($utf8_data = $this->registry->call('Misc', 'change_encoding', array($this->raw_data, $encoding, 'UTF-8')))\n\t\t\t{\n\t\t\t\t// Create new parser\n\t\t\t\t$parser = $this->registry->create('Parser');\n\n\t\t\t\t// If it's parsed fine\n\t\t\t\tif ($parser->parse($utf8_data, 'UTF-8', $this->permanent_url))\n\t\t\t\t{\n\t\t\t\t\t$this->data = $parser->get_data();\n\t\t\t\t\tif (!($this->get_type() & ~SIMPLEPIE_TYPE_NONE))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->error = \"A feed could not be found at `$this->feed_url`. This does not appear to be a valid RSS or Atom feed.\";\n\t\t\t\t\t\t$this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__));\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($headers))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->data['headers'] = $headers;\n\t\t\t\t\t}\n\t\t\t\t\t$this->data['build'] = SIMPLEPIE_BUILD;\n\n\t\t\t\t\t// Cache the file if caching is enabled\n\t\t\t\t\tif ($cache && !$cache->save($this))\n\t\t\t\t\t{\n\t\t\t\t\t\ttrigger_error(\"$this->cache_location is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.\", E_USER_WARNING);\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (isset($parser))\n\t\t{\n\t\t\t// We have an error, just set SimplePie_Misc::error to it and quit\n\t\t\t$this->error = $this->feed_url;\n\t\t\t$this->error .= sprintf(' is invalid XML, likely due to invalid characters. XML error: %s at line %d, column %d', $parser->get_error_string(), $parser->get_current_line(), $parser->get_current_column());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error = 'The data could not be converted to UTF-8.';\n\t\t\tif (!extension_loaded('mbstring') && !extension_loaded('iconv') && !class_exists('\\UConverter')) {\n\t\t\t\t$this->error .= ' You MUST have either the iconv, mbstring or intl (PHP 5.5+) extension installed and enabled.';\n\t\t\t} else {\n\t\t\t\t$missingExtensions = array();\n\t\t\t\tif (!extension_loaded('iconv')) {\n\t\t\t\t\t$missingExtensions[] = 'iconv';\n\t\t\t\t}\n\t\t\t\tif (!extension_loaded('mbstring')) {\n\t\t\t\t\t$missingExtensions[] = 'mbstring';\n\t\t\t\t}\n\t\t\t\tif (!class_exists('\\UConverter')) {\n\t\t\t\t\t$missingExtensions[] = 'intl (PHP 5.5+)';\n\t\t\t\t}\n\t\t\t\t$this->error .= ' Try installing/enabling the ' . implode(' or ', $missingExtensions) . ' extension.';\n\t\t\t}\n\t\t}\n\n\t\t$this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__));\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Fetch the data via SimplePie_File\n\t *\n\t * If the data is already cached, attempt to fetch it from there instead\n\t * @param SimplePie_Cache|false $cache Cache handler, or false to not load from the cache\n\t * @return array|true Returns true if the data was loaded from the cache, or an array of HTTP headers and sniffed type\n\t */\n\tprotected function fetch_data(&$cache)\n\t{\n\t\t// If it's enabled, use the cache\n\t\tif ($cache)\n\t\t{\n\t\t\t// Load the Cache\n\t\t\t$this->data = $cache->load();\n\t\t\tif (!empty($this->data))\n\t\t\t{\n\t\t\t\t// If the cache is for an outdated build of SimplePie\n\t\t\t\tif (!isset($this->data['build']) || $this->data['build'] !== SIMPLEPIE_BUILD)\n\t\t\t\t{\n\t\t\t\t\t$cache->unlink();\n\t\t\t\t\t$this->data = array();\n\t\t\t\t}\n\t\t\t\t// If we've hit a collision just rerun it with caching disabled\n\t\t\t\telseif (isset($this->data['url']) && $this->data['url'] !== $this->feed_url)\n\t\t\t\t{\n\t\t\t\t\t$cache = false;\n\t\t\t\t\t$this->data = array();\n\t\t\t\t}\n\t\t\t\t// If we've got a non feed_url stored (if the page isn't actually a feed, or is a redirect) use that URL.\n\t\t\t\telseif (isset($this->data['feed_url']))\n\t\t\t\t{\n\t\t\t\t\t// If the autodiscovery cache is still valid use it.\n\t\t\t\t\tif ($cache->mtime() + $this->autodiscovery_cache_duration > time())\n\t\t\t\t\t{\n\t\t\t\t\t\t// Do not need to do feed autodiscovery yet.\n\t\t\t\t\t\tif ($this->data['feed_url'] !== $this->data['url'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->set_feed_url($this->data['feed_url']);\n\t\t\t\t\t\t\treturn $this->init();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$cache->unlink();\n\t\t\t\t\t\t$this->data = array();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Check if the cache has been updated\n\t\t\t\telseif ($cache->mtime() + $this->cache_duration < time())\n\t\t\t\t{\n\t\t\t\t\t// Want to know if we tried to send last-modified and/or etag headers\n\t\t\t\t\t// when requesting this file. (Note that it's up to the file to\n\t\t\t\t\t// support this, but we don't always send the headers either.)\n\t\t\t\t\t$this->check_modified = true;\n\t\t\t\t\tif (isset($this->data['headers']['last-modified']) || isset($this->data['headers']['etag']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$headers = array(\n\t\t\t\t\t\t\t'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1',\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (isset($this->data['headers']['last-modified']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$headers['if-modified-since'] = $this->data['headers']['last-modified'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($this->data['headers']['etag']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$headers['if-none-match'] = $this->data['headers']['etag'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$file = $this->registry->create('File', array($this->feed_url, $this->timeout/10, 5, $headers, $this->useragent, $this->force_fsockopen, $this->curl_options));\n\n\t\t\t\t\t\tif ($file->success)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($file->status_code === 304)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Set raw_data to false here too, to signify that the cache\n\t\t\t\t\t\t\t\t// is still valid.\n\t\t\t\t\t\t\t\t$this->raw_data = false;\n\t\t\t\t\t\t\t\t$cache->touch();\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\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->check_modified = false;\n\t\t\t\t\t\t\tif($this->force_cache_fallback)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cache->touch();\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tunset($file);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If the cache is still valid, just return true\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->raw_data = false;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If the cache is empty, delete it\n\t\t\telse\n\t\t\t{\n\t\t\t\t$cache->unlink();\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t}\n\t\t// If we don't already have the file (it'll only exist if we've opened it to check if the cache has been modified), open it.\n\t\tif (!isset($file))\n\t\t{\n\t\t\tif ($this->file instanceof SimplePie_File && $this->file->url === $this->feed_url)\n\t\t\t{\n\t\t\t\t$file =& $this->file;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$headers = array(\n\t\t\t\t\t'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1',\n\t\t\t\t);\n\t\t\t\t$file = $this->registry->create('File', array($this->feed_url, $this->timeout, 5, $headers, $this->useragent, $this->force_fsockopen, $this->curl_options));\n\t\t\t}\n\t\t}\n\t\t// If the file connection has an error, set SimplePie::error to that and quit\n\t\tif (!$file->success && !($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)))\n\t\t{\n\t\t\t$this->error = $file->error;\n\t\t\treturn !empty($this->data);\n\t\t}\n\n\t\tif (!$this->force_feed)\n\t\t{\n\t\t\t// Check if the supplied URL is a feed, if it isn't, look for it.\n\t\t\t$locate = $this->registry->create('Locator', array(&$file, $this->timeout, $this->useragent, $this->max_checked_feeds, $this->force_fsockopen, $this->curl_options));\n\n\t\t\tif (!$locate->is_feed($file))\n\t\t\t{\n\t\t\t\t$copyStatusCode = $file->status_code;\n\t\t\t\t$copyContentType = $file->headers['content-type'];\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$microformats = false;\n\t\t\t\t\tif (class_exists('DOMXpath') && function_exists('Mf2\\parse')) {\n\t\t\t\t\t\t$doc = new DOMDocument();\n\t\t\t\t\t\t@$doc->loadHTML($file->body);\n\t\t\t\t\t\t$xpath = new DOMXpath($doc);\n\t\t\t\t\t\t// Check for both h-feed and h-entry, as both a feed with no entries\n\t\t\t\t\t\t// and a list of entries without an h-feed wrapper are both valid.\n\t\t\t\t\t\t$query = '//*[contains(concat(\" \", @class, \" \"), \" h-feed \") or '.\n\t\t\t\t\t\t\t'contains(concat(\" \", @class, \" \"), \" h-entry \")]';\n\t\t\t\t\t\t$result = $xpath->query($query);\n\t\t\t\t\t\t$microformats = $result->length !== 0;\n\t\t\t\t\t}\n\t\t\t\t\t// Now also do feed discovery, but if microformats were found don't\n\t\t\t\t\t// overwrite the current value of file.\n\t\t\t\t\t$discovered = $locate->find($this->autodiscovery,\n\t\t\t\t\t                            $this->all_discovered_feeds);\n\t\t\t\t\tif ($microformats)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($hub = $locate->get_rel_link('hub'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$self = $locate->get_rel_link('self');\n\t\t\t\t\t\t\t$this->store_links($file, $hub, $self);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Push the current file onto all_discovered feeds so the user can\n\t\t\t\t\t\t// be shown this as one of the options.\n\t\t\t\t\t\tif (isset($this->all_discovered_feeds)) {\n\t\t\t\t\t\t\t$this->all_discovered_feeds[] = $file;\n\t\t\t\t\t\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\tif ($discovered)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$file = $discovered;\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// We need to unset this so that if SimplePie::set_file() has\n\t\t\t\t\t\t\t// been called that object is untouched\n\t\t\t\t\t\t\tunset($file);\n\t\t\t\t\t\t\t$this->error = \"A feed could not be found at `$this->feed_url`; the status code is `$copyStatusCode` and content-type is `$copyContentType`\";\n\t\t\t\t\t\t\t$this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__));\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (SimplePie_Exception $e)\n\t\t\t\t{\n\t\t\t\t\t// We need to unset this so that if SimplePie::set_file() has been called that object is untouched\n\t\t\t\t\tunset($file);\n\t\t\t\t\t// This is usually because DOMDocument doesn't exist\n\t\t\t\t\t$this->error = $e->getMessage();\n\t\t\t\t\t$this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, $e->getFile(), $e->getLine()));\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif ($cache)\n\t\t\t\t{\n\t\t\t\t\t$this->data = array('url' => $this->feed_url, 'feed_url' => $file->url, 'build' => SIMPLEPIE_BUILD);\n\t\t\t\t\tif (!$cache->save($this))\n\t\t\t\t\t{\n\t\t\t\t\t\ttrigger_error(\"$this->cache_location is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.\", E_USER_WARNING);\n\t\t\t\t\t}\n\t\t\t\t\t$cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, call_user_func($this->cache_name_function, $file->url), 'spc'));\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->feed_url = $file->url;\n\t\t\t$locate = null;\n\t\t}\n\n\t\t$this->raw_data = $file->body;\n\t\t$this->permanent_url = $file->permanent_url;\n\t\t$headers = $file->headers;\n\t\t$sniffer = $this->registry->create('Content_Type_Sniffer', array(&$file));\n\t\t$sniffed = $sniffer->get_type();\n\n\t\treturn array($headers, $sniffed);\n\t}\n\n\t/**\n\t * Get the error message for the occured error\n\t *\n\t * @return string|array Error message, or array of messages for multifeeds\n\t */\n\tpublic function error()\n\t{\n\t\treturn $this->error;\n\t}\n\n\t/**\n\t * Get the raw XML\n\t *\n\t * This is the same as the old `$feed->enable_xml_dump(true)`, but returns\n\t * the data instead of printing it.\n\t *\n\t * @return string|boolean Raw XML data, false if the cache is used\n\t */\n\tpublic function get_raw_data()\n\t{\n\t\treturn $this->raw_data;\n\t}\n\n\t/**\n\t * Get the character encoding used for output\n\t *\n\t * @since Preview Release\n\t * @return string\n\t */\n\tpublic function get_encoding()\n\t{\n\t\treturn $this->sanitize->output_encoding;\n\t}\n\n\t/**\n\t * Send the content-type header with correct encoding\n\t *\n\t * This method ensures that the SimplePie-enabled page is being served with\n\t * the correct {@link http://www.iana.org/assignments/media-types/ mime-type}\n\t * and character encoding HTTP headers (character encoding determined by the\n\t * {@see set_output_encoding} config option).\n\t *\n\t * This won't work properly if any content or whitespace has already been\n\t * sent to the browser, because it relies on PHP's\n\t * {@link http://php.net/header header()} function, and these are the\n\t * circumstances under which the function works.\n\t *\n\t * Because it's setting these settings for the entire page (as is the nature\n\t * of HTTP headers), this should only be used once per page (again, at the\n\t * top).\n\t *\n\t * @param string $mime MIME type to serve the page as\n\t */\n\tpublic function handle_content_type($mime = 'text/html')\n\t{\n\t\tif (!headers_sent())\n\t\t{\n\t\t\t$header = \"Content-type: $mime;\";\n\t\t\tif ($this->get_encoding())\n\t\t\t{\n\t\t\t\t$header .= ' charset=' . $this->get_encoding();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$header .= ' charset=UTF-8';\n\t\t\t}\n\t\t\theader($header);\n\t\t}\n\t}\n\n\t/**\n\t * Get the type of the feed\n\t *\n\t * This returns a SIMPLEPIE_TYPE_* constant, which can be tested against\n\t * using {@link http://php.net/language.operators.bitwise bitwise operators}\n\t *\n\t * @since 0.8 (usage changed to using constants in 1.0)\n\t * @see SIMPLEPIE_TYPE_NONE Unknown.\n\t * @see SIMPLEPIE_TYPE_RSS_090 RSS 0.90.\n\t * @see SIMPLEPIE_TYPE_RSS_091_NETSCAPE RSS 0.91 (Netscape).\n\t * @see SIMPLEPIE_TYPE_RSS_091_USERLAND RSS 0.91 (Userland).\n\t * @see SIMPLEPIE_TYPE_RSS_091 RSS 0.91.\n\t * @see SIMPLEPIE_TYPE_RSS_092 RSS 0.92.\n\t * @see SIMPLEPIE_TYPE_RSS_093 RSS 0.93.\n\t * @see SIMPLEPIE_TYPE_RSS_094 RSS 0.94.\n\t * @see SIMPLEPIE_TYPE_RSS_10 RSS 1.0.\n\t * @see SIMPLEPIE_TYPE_RSS_20 RSS 2.0.x.\n\t * @see SIMPLEPIE_TYPE_RSS_RDF RDF-based RSS.\n\t * @see SIMPLEPIE_TYPE_RSS_SYNDICATION Non-RDF-based RSS (truly intended as syndication format).\n\t * @see SIMPLEPIE_TYPE_RSS_ALL Any version of RSS.\n\t * @see SIMPLEPIE_TYPE_ATOM_03 Atom 0.3.\n\t * @see SIMPLEPIE_TYPE_ATOM_10 Atom 1.0.\n\t * @see SIMPLEPIE_TYPE_ATOM_ALL Any version of Atom.\n\t * @see SIMPLEPIE_TYPE_ALL Any known/supported feed type.\n\t * @return int SIMPLEPIE_TYPE_* constant\n\t */\n\tpublic function get_type()\n\t{\n\t\tif (!isset($this->data['type']))\n\t\t{\n\t\t\t$this->data['type'] = SIMPLEPIE_TYPE_ALL;\n\t\t\tif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed']))\n\t\t\t{\n\t\t\t\t$this->data['type'] &= SIMPLEPIE_TYPE_ATOM_10;\n\t\t\t}\n\t\t\telseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed']))\n\t\t\t{\n\t\t\t\t$this->data['type'] &= SIMPLEPIE_TYPE_ATOM_03;\n\t\t\t}\n\t\t\telseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF']))\n\t\t\t{\n\t\t\t\tif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_10]['channel'])\n\t\t\t\t|| isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_10]['image'])\n\t\t\t\t|| isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item'])\n\t\t\t\t|| isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_10]['textinput']))\n\t\t\t\t{\n\t\t\t\t\t$this->data['type'] &= SIMPLEPIE_TYPE_RSS_10;\n\t\t\t\t}\n\t\t\t\tif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_090]['channel'])\n\t\t\t\t|| isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_090]['image'])\n\t\t\t\t|| isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item'])\n\t\t\t\t|| isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_090]['textinput']))\n\t\t\t\t{\n\t\t\t\t\t$this->data['type'] &= SIMPLEPIE_TYPE_RSS_090;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss']))\n\t\t\t{\n\t\t\t\t$this->data['type'] &= SIMPLEPIE_TYPE_RSS_ALL;\n\t\t\t\tif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['attribs']['']['version']))\n\t\t\t\t{\n\t\t\t\t\tswitch (trim($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['attribs']['']['version']))\n\t\t\t\t\t{\n\t\t\t\t\t\tcase '0.91':\n\t\t\t\t\t\t\t$this->data['type'] &= SIMPLEPIE_TYPE_RSS_091;\n\t\t\t\t\t\t\tif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['skiphours']['hour'][0]['data']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tswitch (trim($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['skiphours']['hour'][0]['data']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcase '0':\n\t\t\t\t\t\t\t\t\t\t$this->data['type'] &= SIMPLEPIE_TYPE_RSS_091_NETSCAPE;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase '24':\n\t\t\t\t\t\t\t\t\t\t$this->data['type'] &= SIMPLEPIE_TYPE_RSS_091_USERLAND;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '0.92':\n\t\t\t\t\t\t\t$this->data['type'] &= SIMPLEPIE_TYPE_RSS_092;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '0.93':\n\t\t\t\t\t\t\t$this->data['type'] &= SIMPLEPIE_TYPE_RSS_093;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '0.94':\n\t\t\t\t\t\t\t$this->data['type'] &= SIMPLEPIE_TYPE_RSS_094;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '2.0':\n\t\t\t\t\t\t\t$this->data['type'] &= SIMPLEPIE_TYPE_RSS_20;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->data['type'] = SIMPLEPIE_TYPE_NONE;\n\t\t\t}\n\t\t}\n\t\treturn $this->data['type'];\n\t}\n\n\t/**\n\t * Get the URL for the feed\n\t *\n\t * When the 'permanent' mode is enabled, returns the original feed URL,\n\t * except in the case of an `HTTP 301 Moved Permanently` status response,\n\t * in which case the location of the first redirection is returned.\n\t *\n\t * When the 'permanent' mode is disabled (default),\n\t * may or may not be different from the URL passed to {@see set_feed_url()},\n\t * depending on whether auto-discovery was used, and whether there were\n\t * any redirects along the way.\n\t *\n\t * @since Preview Release (previously called `get_feed_url()` since SimplePie 0.8.)\n\t * @todo Support <itunes:new-feed-url>\n\t * @todo Also, |atom:link|@rel=self\n\t * @param bool $permanent Permanent mode to return only the original URL or the first redirection\n\t * iff it is a 301 redirection\n\t * @return string|null\n\t */\n\tpublic function subscribe_url($permanent = false)\n\t{\n\t\tif ($permanent)\n\t\t{\n\t\t\tif ($this->permanent_url !== null)\n\t\t\t{\n\t\t\t\t// sanitize encodes ampersands which are required when used in a url.\n\t\t\t\treturn str_replace('&amp;', '&',\n\t\t\t\t                   $this->sanitize($this->permanent_url,\n\t\t\t\t                                   SIMPLEPIE_CONSTRUCT_IRI));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($this->feed_url !== null)\n\t\t\t{\n\t\t\t\treturn str_replace('&amp;', '&',\n\t\t\t\t                   $this->sanitize($this->feed_url,\n\t\t\t\t                                   SIMPLEPIE_CONSTRUCT_IRI));\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get data for an feed-level element\n\t *\n\t * This method allows you to get access to ANY element/attribute that is a\n\t * sub-element of the opening feed tag.\n\t *\n\t * The return value is an indexed array of elements matching the given\n\t * namespace and tag name. Each element has `attribs`, `data` and `child`\n\t * subkeys. For `attribs` and `child`, these contain namespace subkeys.\n\t * `attribs` then has one level of associative name => value data (where\n\t * `value` is a string) after the namespace. `child` has tag-indexed keys\n\t * after the namespace, each member of which is an indexed array matching\n\t * this same format.\n\t *\n\t * For example:\n\t * <pre>\n\t * // This is probably a bad example because we already support\n\t * // <media:content> natively, but it shows you how to parse through\n\t * // the nodes.\n\t * $group = $item->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group');\n\t * $content = $group[0]['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'];\n\t * $file = $content[0]['attribs']['']['url'];\n\t * echo $file;\n\t * </pre>\n\t *\n\t * @since 1.0\n\t * @see http://simplepie.org/wiki/faq/supported_xml_namespaces\n\t * @param string $namespace The URL of the XML namespace of the elements you're trying to access\n\t * @param string $tag Tag name\n\t * @return array\n\t */\n\tpublic function get_feed_tags($namespace, $tag)\n\t{\n\t\t$type = $this->get_type();\n\t\tif ($type & SIMPLEPIE_TYPE_ATOM_10)\n\t\t{\n\t\t\tif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['child'][$namespace][$tag]))\n\t\t\t{\n\t\t\t\treturn $this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['child'][$namespace][$tag];\n\t\t\t}\n\t\t}\n\t\tif ($type & SIMPLEPIE_TYPE_ATOM_03)\n\t\t{\n\t\t\tif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['child'][$namespace][$tag]))\n\t\t\t{\n\t\t\t\treturn $this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['child'][$namespace][$tag];\n\t\t\t}\n\t\t}\n\t\tif ($type & SIMPLEPIE_TYPE_RSS_RDF)\n\t\t{\n\t\t\tif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][$namespace][$tag]))\n\t\t\t{\n\t\t\t\treturn $this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][$namespace][$tag];\n\t\t\t}\n\t\t}\n\t\tif ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION)\n\t\t{\n\t\t\tif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag]))\n\t\t\t{\n\t\t\t\treturn $this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get data for an channel-level element\n\t *\n\t * This method allows you to get access to ANY element/attribute in the\n\t * channel/header section of the feed.\n\t *\n\t * See {@see SimplePie::get_feed_tags()} for a description of the return value\n\t *\n\t * @since 1.0\n\t * @see http://simplepie.org/wiki/faq/supported_xml_namespaces\n\t * @param string $namespace The URL of the XML namespace of the elements you're trying to access\n\t * @param string $tag Tag name\n\t * @return array\n\t */\n\tpublic function get_channel_tags($namespace, $tag)\n\t{\n\t\t$type = $this->get_type();\n\t\tif ($type & SIMPLEPIE_TYPE_ATOM_ALL)\n\t\t{\n\t\t\tif ($return = $this->get_feed_tags($namespace, $tag))\n\t\t\t{\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t}\n\t\tif ($type & SIMPLEPIE_TYPE_RSS_10)\n\t\t{\n\t\t\tif ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'channel'))\n\t\t\t{\n\t\t\t\tif (isset($channel[0]['child'][$namespace][$tag]))\n\t\t\t\t{\n\t\t\t\t\treturn $channel[0]['child'][$namespace][$tag];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($type & SIMPLEPIE_TYPE_RSS_090)\n\t\t{\n\t\t\tif ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'channel'))\n\t\t\t{\n\t\t\t\tif (isset($channel[0]['child'][$namespace][$tag]))\n\t\t\t\t{\n\t\t\t\t\treturn $channel[0]['child'][$namespace][$tag];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION)\n\t\t{\n\t\t\tif ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'channel'))\n\t\t\t{\n\t\t\t\tif (isset($channel[0]['child'][$namespace][$tag]))\n\t\t\t\t{\n\t\t\t\t\treturn $channel[0]['child'][$namespace][$tag];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get data for an channel-level element\n\t *\n\t * This method allows you to get access to ANY element/attribute in the\n\t * image/logo section of the feed.\n\t *\n\t * See {@see SimplePie::get_feed_tags()} for a description of the return value\n\t *\n\t * @since 1.0\n\t * @see http://simplepie.org/wiki/faq/supported_xml_namespaces\n\t * @param string $namespace The URL of the XML namespace of the elements you're trying to access\n\t * @param string $tag Tag name\n\t * @return array\n\t */\n\tpublic function get_image_tags($namespace, $tag)\n\t{\n\t\t$type = $this->get_type();\n\t\tif ($type & SIMPLEPIE_TYPE_RSS_10)\n\t\t{\n\t\t\tif ($image = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'image'))\n\t\t\t{\n\t\t\t\tif (isset($image[0]['child'][$namespace][$tag]))\n\t\t\t\t{\n\t\t\t\t\treturn $image[0]['child'][$namespace][$tag];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($type & SIMPLEPIE_TYPE_RSS_090)\n\t\t{\n\t\t\tif ($image = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'image'))\n\t\t\t{\n\t\t\t\tif (isset($image[0]['child'][$namespace][$tag]))\n\t\t\t\t{\n\t\t\t\t\treturn $image[0]['child'][$namespace][$tag];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION)\n\t\t{\n\t\t\tif ($image = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'image'))\n\t\t\t{\n\t\t\t\tif (isset($image[0]['child'][$namespace][$tag]))\n\t\t\t\t{\n\t\t\t\t\treturn $image[0]['child'][$namespace][$tag];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the base URL value from the feed\n\t *\n\t * Uses `<xml:base>` if available, otherwise uses the first link in the\n\t * feed, or failing that, the URL of the feed itself.\n\t *\n\t * @see get_link\n\t * @see subscribe_url\n\t *\n\t * @param array $element\n\t * @return string\n\t */\n\tpublic function get_base($element = array())\n\t{\n\t\tif (!($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION) && !empty($element['xml_base_explicit']) && isset($element['xml_base']))\n\t\t{\n\t\t\treturn $element['xml_base'];\n\t\t}\n\t\telseif ($this->get_link() !== null)\n\t\t{\n\t\t\treturn $this->get_link();\n\t\t}\n\n\t\treturn $this->subscribe_url();\n\t}\n\n\t/**\n\t * Sanitize feed data\n\t *\n\t * @access private\n\t * @see SimplePie_Sanitize::sanitize()\n\t * @param string $data Data to sanitize\n\t * @param int $type One of the SIMPLEPIE_CONSTRUCT_* constants\n\t * @param string $base Base URL to resolve URLs against\n\t * @return string Sanitized data\n\t */\n\tpublic function sanitize($data, $type, $base = '')\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn $this->sanitize->sanitize($data, $type, $base);\n\t\t}\n\t\tcatch (SimplePie_Exception $e)\n\t\t{\n\t\t\tif (!$this->enable_exceptions)\n\t\t\t{\n\t\t\t\t$this->error = $e->getMessage();\n\t\t\t\t$this->registry->call('Misc', 'error', array($this->error, E_USER_WARNING, $e->getFile(), $e->getLine()));\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tthrow $e;\n\t\t}\n\t}\n\n\t/**\n\t * Get the title of the feed\n\t *\n\t * Uses `<atom:title>`, `<title>` or `<dc:title>`\n\t *\n\t * @since 1.0 (previously called `get_feed_title` since 0.8)\n\t * @return string|null\n\t */\n\tpublic function get_title()\n\t{\n\t\tif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get a category for the feed\n\t *\n\t * @since Unknown\n\t * @param int $key The category that you want to return. Remember that arrays begin with 0, not 1\n\t * @return SimplePie_Category|null\n\t */\n\tpublic function get_category($key = 0)\n\t{\n\t\t$categories = $this->get_categories();\n\t\tif (isset($categories[$key]))\n\t\t{\n\t\t\treturn $categories[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all categories for the feed\n\t *\n\t * Uses `<atom:category>`, `<category>` or `<dc:subject>`\n\t *\n\t * @since Unknown\n\t * @return array|null List of {@see SimplePie_Category} objects\n\t */\n\tpublic function get_categories()\n\t{\n\t\t$categories = array();\n\n\t\tforeach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category)\n\t\t{\n\t\t\t$term = null;\n\t\t\t$scheme = null;\n\t\t\t$label = null;\n\t\t\tif (isset($category['attribs']['']['term']))\n\t\t\t{\n\t\t\t\t$term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($category['attribs']['']['scheme']))\n\t\t\t{\n\t\t\t\t$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($category['attribs']['']['label']))\n\t\t\t{\n\t\t\t\t$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\t$categories[] = $this->registry->create('Category', array($term, $scheme, $label));\n\t\t}\n\t\tforeach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category)\n\t\t{\n\t\t\t// This is really the label, but keep this as the term also for BC.\n\t\t\t// Label will also work on retrieving because that falls back to term.\n\t\t\t$term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\tif (isset($category['attribs']['']['domain']))\n\t\t\t{\n\t\t\t\t$scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$scheme = null;\n\t\t\t}\n\t\t\t$categories[] = $this->registry->create('Category', array($term, $scheme, null));\n\t\t}\n\t\tforeach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category)\n\t\t{\n\t\t\t$categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));\n\t\t}\n\t\tforeach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'subject') as $category)\n\t\t{\n\t\t\t$categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));\n\t\t}\n\n\t\tif (!empty($categories))\n\t\t{\n\t\t\treturn array_unique($categories);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get an author for the feed\n\t *\n\t * @since 1.1\n\t * @param int $key The author that you want to return. Remember that arrays begin with 0, not 1\n\t * @return SimplePie_Author|null\n\t */\n\tpublic function get_author($key = 0)\n\t{\n\t\t$authors = $this->get_authors();\n\t\tif (isset($authors[$key]))\n\t\t{\n\t\t\treturn $authors[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all authors for the feed\n\t *\n\t * Uses `<atom:author>`, `<author>`, `<dc:creator>` or `<itunes:author>`\n\t *\n\t * @since 1.1\n\t * @return array|null List of {@see SimplePie_Author} objects\n\t */\n\tpublic function get_authors()\n\t{\n\t\t$authors = array();\n\t\tforeach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author)\n\t\t{\n\t\t\t$name = null;\n\t\t\t$uri = null;\n\t\t\t$email = null;\n\t\t\tif (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))\n\t\t\t{\n\t\t\t\t$name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))\n\t\t\t{\n\t\t\t\t$uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));\n\t\t\t}\n\t\t\tif (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))\n\t\t\t{\n\t\t\t\t$email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif ($name !== null || $email !== null || $uri !== null)\n\t\t\t{\n\t\t\t\t$authors[] = $this->registry->create('Author', array($name, $uri, $email));\n\t\t\t}\n\t\t}\n\t\tif ($author = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))\n\t\t{\n\t\t\t$name = null;\n\t\t\t$url = null;\n\t\t\t$email = null;\n\t\t\tif (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))\n\t\t\t{\n\t\t\t\t$name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))\n\t\t\t{\n\t\t\t\t$url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));\n\t\t\t}\n\t\t\tif (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))\n\t\t\t{\n\t\t\t\t$email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif ($name !== null || $email !== null || $url !== null)\n\t\t\t{\n\t\t\t\t$authors[] = $this->registry->create('Author', array($name, $url, $email));\n\t\t\t}\n\t\t}\n\t\tforeach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author)\n\t\t{\n\t\t\t$authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));\n\t\t}\n\t\tforeach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author)\n\t\t{\n\t\t\t$authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));\n\t\t}\n\t\tforeach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author)\n\t\t{\n\t\t\t$authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));\n\t\t}\n\n\t\tif (!empty($authors))\n\t\t{\n\t\t\treturn array_unique($authors);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get a contributor for the feed\n\t *\n\t * @since 1.1\n\t * @param int $key The contrbutor that you want to return. Remember that arrays begin with 0, not 1\n\t * @return SimplePie_Author|null\n\t */\n\tpublic function get_contributor($key = 0)\n\t{\n\t\t$contributors = $this->get_contributors();\n\t\tif (isset($contributors[$key]))\n\t\t{\n\t\t\treturn $contributors[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all contributors for the feed\n\t *\n\t * Uses `<atom:contributor>`\n\t *\n\t * @since 1.1\n\t * @return array|null List of {@see SimplePie_Author} objects\n\t */\n\tpublic function get_contributors()\n\t{\n\t\t$contributors = array();\n\t\tforeach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor)\n\t\t{\n\t\t\t$name = null;\n\t\t\t$uri = null;\n\t\t\t$email = null;\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))\n\t\t\t{\n\t\t\t\t$name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))\n\t\t\t{\n\t\t\t\t$uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));\n\t\t\t}\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))\n\t\t\t{\n\t\t\t\t$email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif ($name !== null || $email !== null || $uri !== null)\n\t\t\t{\n\t\t\t\t$contributors[] = $this->registry->create('Author', array($name, $uri, $email));\n\t\t\t}\n\t\t}\n\t\tforeach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor)\n\t\t{\n\t\t\t$name = null;\n\t\t\t$url = null;\n\t\t\t$email = null;\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))\n\t\t\t{\n\t\t\t\t$name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))\n\t\t\t{\n\t\t\t\t$url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));\n\t\t\t}\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))\n\t\t\t{\n\t\t\t\t$email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif ($name !== null || $email !== null || $url !== null)\n\t\t\t{\n\t\t\t\t$contributors[] = $this->registry->create('Author', array($name, $url, $email));\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($contributors))\n\t\t{\n\t\t\treturn array_unique($contributors);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get a single link for the feed\n\t *\n\t * @since 1.0 (previously called `get_feed_link` since Preview Release, `get_feed_permalink()` since 0.8)\n\t * @param int $key The link that you want to return. Remember that arrays begin with 0, not 1\n\t * @param string $rel The relationship of the link to return\n\t * @return string|null Link URL\n\t */\n\tpublic function get_link($key = 0, $rel = 'alternate')\n\t{\n\t\t$links = $this->get_links($rel);\n\t\tif (isset($links[$key]))\n\t\t{\n\t\t\treturn $links[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the permalink for the item\n\t *\n\t * Returns the first link available with a relationship of \"alternate\".\n\t * Identical to {@see get_link()} with key 0\n\t *\n\t * @see get_link\n\t * @since 1.0 (previously called `get_feed_link` since Preview Release, `get_feed_permalink()` since 0.8)\n\t * @internal Added for parity between the parent-level and the item/entry-level.\n\t * @return string|null Link URL\n\t */\n\tpublic function get_permalink()\n\t{\n\t\treturn $this->get_link(0);\n\t}\n\n\t/**\n\t * Get all links for the feed\n\t *\n\t * Uses `<atom:link>` or `<link>`\n\t *\n\t * @since Beta 2\n\t * @param string $rel The relationship of links to return\n\t * @return array|null Links found for the feed (strings)\n\t */\n\tpublic function get_links($rel = 'alternate')\n\t{\n\t\tif (!isset($this->data['links']))\n\t\t{\n\t\t\t$this->data['links'] = array();\n\t\t\tif ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link'))\n\t\t\t{\n\t\t\t\tforeach ($links as $link)\n\t\t\t\t{\n\t\t\t\t\tif (isset($link['attribs']['']['href']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';\n\t\t\t\t\t\t$this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link'))\n\t\t\t{\n\t\t\t\tforeach ($links as $link)\n\t\t\t\t{\n\t\t\t\t\tif (isset($link['attribs']['']['href']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';\n\t\t\t\t\t\t$this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link'))\n\t\t\t{\n\t\t\t\t$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));\n\t\t\t}\n\t\t\tif ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link'))\n\t\t\t{\n\t\t\t\t$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));\n\t\t\t}\n\t\t\tif ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))\n\t\t\t{\n\t\t\t\t$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));\n\t\t\t}\n\n\t\t\t$keys = array_keys($this->data['links']);\n\t\t\tforeach ($keys as $key)\n\t\t\t{\n\t\t\t\tif ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))\n\t\t\t\t{\n\t\t\t\t\tif (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]);\n\t\t\t\t\t\t$this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key];\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->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)\n\t\t\t\t{\n\t\t\t\t\t$this->data['links'][substr($key, 41)] =& $this->data['links'][$key];\n\t\t\t\t}\n\t\t\t\t$this->data['links'][$key] = array_unique($this->data['links'][$key]);\n\t\t\t}\n\t\t}\n\n\t\tif (isset($this->data['headers']['link']) &&\n\t\t    preg_match('/<([^>]+)>; rel='.preg_quote($rel).'/',\n\t\t               $this->data['headers']['link'], $match))\n\t\t{\n\t\t\treturn array($match[1]);\n\t\t}\n\t\telse if (isset($this->data['links'][$rel]))\n\t\t{\n\t\t\treturn $this->data['links'][$rel];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic function get_all_discovered_feeds()\n\t{\n\t\treturn $this->all_discovered_feeds;\n\t}\n\n\t/**\n\t * Get the content for the item\n\t *\n\t * Uses `<atom:subtitle>`, `<atom:tagline>`, `<description>`,\n\t * `<dc:description>`, `<itunes:summary>` or `<itunes:subtitle>`\n\t *\n\t * @since 1.0 (previously called `get_feed_description()` since 0.8)\n\t * @return string|null\n\t */\n\tpublic function get_description()\n\t{\n\t\tif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'tagline'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the copyright info for the feed\n\t *\n\t * Uses `<atom:rights>`, `<atom:copyright>` or `<dc:rights>`\n\t *\n\t * @since 1.0 (previously called `get_feed_copyright()` since 0.8)\n\t * @return string|null\n\t */\n\tpublic function get_copyright()\n\t{\n\t\tif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'copyright'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the language for the feed\n\t *\n\t * Uses `<language>`, `<dc:language>`, or @xml_lang\n\t *\n\t * @since 1.0 (previously called `get_feed_language()` since 0.8)\n\t * @return string|null\n\t */\n\tpublic function get_language()\n\t{\n\t\tif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'language'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'language'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['xml_lang']))\n\t\t{\n\t\t\treturn $this->sanitize($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['xml_lang']))\n\t\t{\n\t\t\treturn $this->sanitize($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['xml_lang']))\n\t\t{\n\t\t\treturn $this->sanitize($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif (isset($this->data['headers']['content-language']))\n\t\t{\n\t\t\treturn $this->sanitize($this->data['headers']['content-language'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the latitude coordinates for the item\n\t *\n\t * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications\n\t *\n\t * Uses `<geo:lat>` or `<georss:point>`\n\t *\n\t * @since 1.0\n\t * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo\n\t * @link http://www.georss.org/ GeoRSS\n\t * @return string|null\n\t */\n\tpublic function get_latitude()\n\t{\n\n\t\tif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat'))\n\t\t{\n\t\t\treturn (float) $return[0]['data'];\n\t\t}\n\t\telseif (($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\\.[0-9]+)) ((?:-)?[0-9]+(?:\\.[0-9]+))$/', trim($return[0]['data']), $match))\n\t\t{\n\t\t\treturn (float) $match[1];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the longitude coordinates for the feed\n\t *\n\t * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications\n\t *\n\t * Uses `<geo:long>`, `<geo:lon>` or `<georss:point>`\n\t *\n\t * @since 1.0\n\t * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo\n\t * @link http://www.georss.org/ GeoRSS\n\t * @return string|null\n\t */\n\tpublic function get_longitude()\n\t{\n\t\tif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long'))\n\t\t{\n\t\t\treturn (float) $return[0]['data'];\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon'))\n\t\t{\n\t\t\treturn (float) $return[0]['data'];\n\t\t}\n\t\telseif (($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\\.[0-9]+)) ((?:-)?[0-9]+(?:\\.[0-9]+))$/', trim($return[0]['data']), $match))\n\t\t{\n\t\t\treturn (float) $match[2];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the feed logo's title\n\t *\n\t * RSS 0.9.0, 1.0 and 2.0 feeds are allowed to have a \"feed logo\" title.\n\t *\n\t * Uses `<image><title>` or `<image><dc:title>`\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_image_title()\n\t{\n\t\tif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the feed logo's URL\n\t *\n\t * RSS 0.9.0, 2.0, Atom 1.0, and feeds with iTunes RSS tags are allowed to\n\t * have a \"feed logo\" URL. This points directly to the image itself.\n\t *\n\t * Uses `<itunes:image>`, `<atom:logo>`, `<atom:icon>`,\n\t * `<image><title>` or `<image><dc:title>`\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_image_url()\n\t{\n\t\tif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'image'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI);\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'logo'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'icon'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'url'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'url'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));\n\t\t}\n\n\t\treturn null;\n\t}\n\n\n\t/**\n\t * Get the feed logo's link\n\t *\n\t * RSS 0.9.0, 1.0 and 2.0 feeds are allowed to have a \"feed logo\" link. This\n\t * points to a human-readable page that the image should link to.\n\t *\n\t * Uses `<itunes:image>`, `<atom:logo>`, `<atom:icon>`,\n\t * `<image><title>` or `<image><dc:title>`\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_image_link()\n\t{\n\t\tif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the feed logo's link\n\t *\n\t * RSS 2.0 feeds are allowed to have a \"feed logo\" width.\n\t *\n\t * Uses `<image><width>` or defaults to 88.0 if no width is specified and\n\t * the feed is an RSS 2.0 feed.\n\t *\n\t * @return int|float|null\n\t */\n\tpublic function get_image_width()\n\t{\n\t\tif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'width'))\n\t\t{\n\t\t\treturn round($return[0]['data']);\n\t\t}\n\t\telseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))\n\t\t{\n\t\t\treturn 88.0;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the feed logo's height\n\t *\n\t * RSS 2.0 feeds are allowed to have a \"feed logo\" height.\n\t *\n\t * Uses `<image><height>` or defaults to 31.0 if no height is specified and\n\t * the feed is an RSS 2.0 feed.\n\t *\n\t * @return int|float|null\n\t */\n\tpublic function get_image_height()\n\t{\n\t\tif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'height'))\n\t\t{\n\t\t\treturn round($return[0]['data']);\n\t\t}\n\t\telseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))\n\t\t{\n\t\t\treturn 31.0;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the number of items in the feed\n\t *\n\t * This is well-suited for {@link http://php.net/for for()} loops with\n\t * {@see get_item()}\n\t *\n\t * @param int $max Maximum value to return. 0 for no limit\n\t * @return int Number of items in the feed\n\t */\n\tpublic function get_item_quantity($max = 0)\n\t{\n\t\t$max = (int) $max;\n\t\t$qty = count($this->get_items());\n\t\tif ($max === 0)\n\t\t{\n\t\t\treturn $qty;\n\t\t}\n\n\t\treturn ($qty > $max) ? $max : $qty;\n\t}\n\n\t/**\n\t * Get a single item from the feed\n\t *\n\t * This is better suited for {@link http://php.net/for for()} loops, whereas\n\t * {@see get_items()} is better suited for\n\t * {@link http://php.net/foreach foreach()} loops.\n\t *\n\t * @see get_item_quantity()\n\t * @since Beta 2\n\t * @param int $key The item that you want to return. Remember that arrays begin with 0, not 1\n\t * @return SimplePie_Item|null\n\t */\n\tpublic function get_item($key = 0)\n\t{\n\t\t$items = $this->get_items();\n\t\tif (isset($items[$key]))\n\t\t{\n\t\t\treturn $items[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all items from the feed\n\t *\n\t * This is better suited for {@link http://php.net/for for()} loops, whereas\n\t * {@see get_items()} is better suited for\n\t * {@link http://php.net/foreach foreach()} loops.\n\t *\n\t * @see get_item_quantity\n\t * @since Beta 2\n\t * @param int $start Index to start at\n\t * @param int $end Number of items to return. 0 for all items after `$start`\n\t * @return SimplePie_Item[]|null List of {@see SimplePie_Item} objects\n\t */\n\tpublic function get_items($start = 0, $end = 0)\n\t{\n\t\tif (!isset($this->data['items']))\n\t\t{\n\t\t\tif (!empty($this->multifeed_objects))\n\t\t\t{\n\t\t\t\t$this->data['items'] = SimplePie::merge_items($this->multifeed_objects, $start, $end, $this->item_limit);\n\t\t\t\tif (empty($this->data['items']))\n\t\t\t\t{\n\t\t\t\t\treturn array();\n\t\t\t\t}\n\t\t\t\treturn $this->data['items'];\n\t\t\t}\n\t\t\t$this->data['items'] = array();\n\t\t\tif ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'entry'))\n\t\t\t{\n\t\t\t\t$keys = array_keys($items);\n\t\t\t\tforeach ($keys as $key)\n\t\t\t\t{\n\t\t\t\t\t$this->data['items'][] = $this->registry->create('Item', array($this, $items[$key]));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'entry'))\n\t\t\t{\n\t\t\t\t$keys = array_keys($items);\n\t\t\t\tforeach ($keys as $key)\n\t\t\t\t{\n\t\t\t\t\t$this->data['items'][] = $this->registry->create('Item', array($this, $items[$key]));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'item'))\n\t\t\t{\n\t\t\t\t$keys = array_keys($items);\n\t\t\t\tforeach ($keys as $key)\n\t\t\t\t{\n\t\t\t\t\t$this->data['items'][] = $this->registry->create('Item', array($this, $items[$key]));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'item'))\n\t\t\t{\n\t\t\t\t$keys = array_keys($items);\n\t\t\t\tforeach ($keys as $key)\n\t\t\t\t{\n\t\t\t\t\t$this->data['items'][] = $this->registry->create('Item', array($this, $items[$key]));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($items = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'item'))\n\t\t\t{\n\t\t\t\t$keys = array_keys($items);\n\t\t\t\tforeach ($keys as $key)\n\t\t\t\t{\n\t\t\t\t\t$this->data['items'][] = $this->registry->create('Item', array($this, $items[$key]));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (empty($this->data['items']))\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\tif ($this->order_by_date)\n\t\t{\n\t\t\tif (!isset($this->data['ordered_items']))\n\t\t\t{\n\t\t\t\t$this->data['ordered_items'] = $this->data['items'];\n\t\t\t\tusort($this->data['ordered_items'], array(get_class($this), 'sort_items'));\n\t\t \t}\n\t\t\t$items = $this->data['ordered_items'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$items = $this->data['items'];\n\t\t}\n\t\t// Slice the data as desired\n\t\tif ($end === 0)\n\t\t{\n\t\t\treturn array_slice($items, $start);\n\t\t}\n\n\t\treturn array_slice($items, $start, $end);\n\t}\n\n\t/**\n\t * Set the favicon handler\n\t *\n\t * @deprecated Use your own favicon handling instead\n\t */\n\tpublic function set_favicon_handler($page = false, $qs = 'i')\n\t{\n\t\t$level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING;\n\t\ttrigger_error('Favicon handling has been removed, please use your own handling', $level);\n\t\treturn false;\n\t}\n\n\t/**\n\t * Get the favicon for the current feed\n\t *\n\t * @deprecated Use your own favicon handling instead\n\t */\n\tpublic function get_favicon()\n\t{\n\t\t$level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING;\n\t\ttrigger_error('Favicon handling has been removed, please use your own handling', $level);\n\n\t\tif (($url = $this->get_link()) !== null)\n\t\t{\n\t\t\treturn 'https://www.google.com/s2/favicons?domain=' . urlencode($url);\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Magic method handler\n\t *\n\t * @param string $method Method name\n\t * @param array $args Arguments to the method\n\t * @return mixed\n\t */\n\tpublic function __call($method, $args)\n\t{\n\t\tif (strpos($method, 'subscribe_') === 0)\n\t\t{\n\t\t\t$level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING;\n\t\t\ttrigger_error('subscribe_*() has been deprecated, implement the callback yourself', $level);\n\t\t\treturn '';\n\t\t}\n\t\tif ($method === 'enable_xml_dump')\n\t\t{\n\t\t\t$level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING;\n\t\t\ttrigger_error('enable_xml_dump() has been deprecated, use get_raw_data() instead', $level);\n\t\t\treturn false;\n\t\t}\n\n\t\t$class = get_class($this);\n\t\t$trace = debug_backtrace(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection\n\t\t$file = $trace[0]['file'];\n\t\t$line = $trace[0]['line'];\n\t\ttrigger_error(\"Call to undefined method $class::$method() in $file on line $line\", E_USER_ERROR);\n\t}\n\n\t/**\n\t * Sorting callback for items\n\t *\n\t * @access private\n\t * @param SimplePie $a\n\t * @param SimplePie $b\n\t * @return boolean\n\t */\n\tpublic static function sort_items($a, $b)\n\t{\n\t\t$a_date = $a->get_date('U');\n\t\t$b_date = $b->get_date('U');\n\t\tif ($a_date && $b_date) {\n\t\t\treturn $a_date > $b_date ? -1 : 1;\n\t\t}\n\t\t// Sort items without dates to the top.\n\t\tif ($a_date) {\n\t\t\treturn 1;\n\t\t}\n\t\tif ($b_date) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t}\n\n\t/**\n\t * Merge items from several feeds into one\n\t *\n\t * If you're merging multiple feeds together, they need to all have dates\n\t * for the items or else SimplePie will refuse to sort them.\n\t *\n\t * @link http://simplepie.org/wiki/tutorial/sort_multiple_feeds_by_time_and_date#if_feeds_require_separate_per-feed_settings\n\t * @param array $urls List of SimplePie feed objects to merge\n\t * @param int $start Starting item\n\t * @param int $end Number of items to return\n\t * @param int $limit Maximum number of items per feed\n\t * @return array\n\t */\n\tpublic static function merge_items($urls, $start = 0, $end = 0, $limit = 0)\n\t{\n\t\tif (is_array($urls) && sizeof($urls) > 0)\n\t\t{\n\t\t\t$items = array();\n\t\t\tforeach ($urls as $arg)\n\t\t\t{\n\t\t\t\tif ($arg instanceof SimplePie)\n\t\t\t\t{\n\t\t\t\t\t$items = array_merge($items, $arg->get_items(0, $limit));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttrigger_error('Arguments must be SimplePie objects', E_USER_WARNING);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tusort($items, array(get_class($urls[0]), 'sort_items'));\n\n\t\t\tif ($end === 0)\n\t\t\t{\n\t\t\t\treturn array_slice($items, $start);\n\t\t\t}\n\n\t\t\treturn array_slice($items, $start, $end);\n\t\t}\n\n\t\ttrigger_error('Cannot merge zero SimplePie objects', E_USER_WARNING);\n\t\treturn array();\n\t}\n\n\t/**\n\t * Store PubSubHubbub links as headers\n\t *\n\t * There is no way to find PuSH links in the body of a microformats feed,\n\t * so they are added to the headers when found, to be used later by get_links.\n\t * @param SimplePie_File $file\n\t * @param string $hub\n\t * @param string $self\n\t */\n\tprivate function store_links(&$file, $hub, $self) {\n\t\tif (isset($file->headers['link']['hub']) ||\n\t\t\t  (isset($file->headers['link']) &&\n\t\t\t   preg_match('/rel=hub/', $file->headers['link'])))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif ($hub)\n\t\t{\n\t\t\tif (isset($file->headers['link']))\n\t\t\t{\n\t\t\t\tif ($file->headers['link'] !== '')\n\t\t\t\t{\n\t\t\t\t\t$file->headers['link'] = ', ';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$file->headers['link'] = '';\n\t\t\t}\n\t\t\t$file->headers['link'] .= '<'.$hub.'>; rel=hub';\n\t\t\tif ($self)\n\t\t\t{\n\t\t\t\t$file->headers['link'] .= ', <'.$self.'>; rel=self';\n\t\t\t}\n\t\t}\n\t}\n}\nendif;\n", "num_lines": 3282}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * The SMTP class has been moved to the wp-includes/PHPMailer subdirectory and now uses the PHPMailer\\PHPMailer namespace.\n */\n_deprecated_file(\n\tbasename( __FILE__ ),\n\t'5.5.0',\n\tWPINC . '/PHPMailer/SMTP.php',\n\t__( 'The SMTP class has been moved to the wp-includes/PHPMailer subdirectory and now uses the PHPMailer\\PHPMailer namespace.' )\n);\n\nrequire __DIR__ . '/PHPMailer/SMTP.php';\n\nclass_alias( PHPMailer\\PHPMailer\\SMTP::class, 'SMTP' );\n", "num_lines": 16}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * Deprecated. Use WP_HTTP (http.php) instead.\n */\n_deprecated_file( basename( __FILE__ ), '3.0.0', WPINC . '/http.php' );\n\nif ( ! class_exists( 'Snoopy', false ) ) :\n/*************************************************\n\nSnoopy - the PHP net client\nAuthor: Monte Ohrt <monte@ispi.net>\nCopyright (c): 1999-2008 New Digital Group, all rights reserved\nVersion: 1.2.4\n\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n\nYou may contact the author of Snoopy by e-mail at:\nmonte@ohrt.com\n\nThe latest version of Snoopy can be obtained from:\nhttp://snoopy.sourceforge.net/\n\n*************************************************/\n\nclass Snoopy\n{\n\t/**** Public variables ****/\n\n\t/* user definable vars */\n\n\tvar $host\t\t\t=\t\"www.php.net\";\t\t// host name we are connecting to\n\tvar $port\t\t\t=\t80;\t\t\t\t\t// port we are connecting to\n\tvar $proxy_host\t\t=\t\"\";\t\t\t\t\t// proxy host to use\n\tvar $proxy_port\t\t=\t\"\";\t\t\t\t\t// proxy port to use\n\tvar $proxy_user\t\t=\t\"\";\t\t\t\t\t// proxy user to use\n\tvar $proxy_pass\t\t=\t\"\";\t\t\t\t\t// proxy password to use\n\n\tvar $agent\t\t\t=\t\"Snoopy v1.2.4\";\t// agent we masquerade as\n\tvar\t$referer\t\t=\t\"\";\t\t\t\t\t// referer info to pass\n\tvar $cookies\t\t=\tarray();\t\t\t// array of cookies to pass\n\t\t\t\t\t\t\t\t\t\t\t\t// $cookies[\"username\"]=\"joe\";\n\tvar\t$rawheaders\t\t=\tarray();\t\t\t// array of raw headers to send\n\t\t\t\t\t\t\t\t\t\t\t\t// $rawheaders[\"Content-type\"]=\"text/html\";\n\n\tvar $maxredirs\t\t=\t5;\t\t\t\t\t// http redirection depth maximum. 0 = disallow\n\tvar $lastredirectaddr\t=\t\"\";\t\t\t\t// contains address of last redirected address\n\tvar\t$offsiteok\t\t=\ttrue;\t\t\t\t// allows redirection off-site\n\tvar $maxframes\t\t=\t0;\t\t\t\t\t// frame content depth maximum. 0 = disallow\n\tvar $expandlinks\t=\ttrue;\t\t\t\t// expand links to fully qualified URLs.\n\t\t\t\t\t\t\t\t\t\t\t\t// this only applies to fetchlinks()\n\t\t\t\t\t\t\t\t\t\t\t\t// submitlinks(), and submittext()\n\tvar $passcookies\t=\ttrue;\t\t\t\t// pass set cookies back through redirects\n\t\t\t\t\t\t\t\t\t\t\t\t// NOTE: this currently does not respect\n\t\t\t\t\t\t\t\t\t\t\t\t// dates, domains or paths.\n\n\tvar\t$user\t\t\t=\t\"\";\t\t\t\t\t// user for http authentication\n\tvar\t$pass\t\t\t=\t\"\";\t\t\t\t\t// password for http authentication\n\n\t// http accept types\n\tvar $accept\t\t\t=\t\"image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*\";\n\n\tvar $results\t\t=\t\"\";\t\t\t\t\t// where the content is put\n\n\tvar $error\t\t\t=\t\"\";\t\t\t\t\t// error messages sent here\n\tvar\t$response_code\t=\t\"\";\t\t\t\t\t// response code returned from server\n\tvar\t$headers\t\t=\tarray();\t\t\t// headers returned from server sent here\n\tvar\t$maxlength\t\t=\t500000;\t\t\t\t// max return data length (body)\n\tvar $read_timeout\t=\t0;\t\t\t\t\t// timeout on read operations, in seconds\n\t\t\t\t\t\t\t\t\t\t\t\t// supported only since PHP 4 Beta 4\n\t\t\t\t\t\t\t\t\t\t\t\t// set to 0 to disallow timeouts\n\tvar $timed_out\t\t=\tfalse;\t\t\t\t// if a read operation timed out\n\tvar\t$status\t\t\t=\t0;\t\t\t\t\t// http request status\n\n\tvar $temp_dir\t\t=\t\"/tmp\";\t\t\t\t// temporary directory that the webserver\n\t\t\t\t\t\t\t\t\t\t\t\t// has permission to write to.\n\t\t\t\t\t\t\t\t\t\t\t\t// under Windows, this should be C:\\temp\n\n\tvar\t$curl_path\t\t=\t\"/usr/local/bin/curl\";\n\t\t\t\t\t\t\t\t\t\t\t\t// Snoopy will use cURL for fetching\n\t\t\t\t\t\t\t\t\t\t\t\t// SSL content if a full system path to\n\t\t\t\t\t\t\t\t\t\t\t\t// the cURL binary is supplied here.\n\t\t\t\t\t\t\t\t\t\t\t\t// set to false if you do not have\n\t\t\t\t\t\t\t\t\t\t\t\t// cURL installed. See http://curl.haxx.se\n\t\t\t\t\t\t\t\t\t\t\t\t// for details on installing cURL.\n\t\t\t\t\t\t\t\t\t\t\t\t// Snoopy does *not* use the cURL\n\t\t\t\t\t\t\t\t\t\t\t\t// library functions built into php,\n\t\t\t\t\t\t\t\t\t\t\t\t// as these functions are not stable\n\t\t\t\t\t\t\t\t\t\t\t\t// as of this Snoopy release.\n\n\t/**** Private variables ****/\n\n\tvar\t$_maxlinelen\t=\t4096;\t\t\t\t// max line length (headers)\n\n\tvar $_httpmethod\t=\t\"GET\";\t\t\t\t// default http request method\n\tvar $_httpversion\t=\t\"HTTP/1.0\";\t\t\t// default http request version\n\tvar $_submit_method\t=\t\"POST\";\t\t\t\t// default submit method\n\tvar $_submit_type\t=\t\"application/x-www-form-urlencoded\";\t// default submit type\n\tvar $_mime_boundary\t=   \"\";\t\t\t\t\t// MIME boundary for multipart/form-data submit type\n\tvar $_redirectaddr\t=\tfalse;\t\t\t\t// will be set if page fetched is a redirect\n\tvar $_redirectdepth\t=\t0;\t\t\t\t\t// increments on an http redirect\n\tvar $_frameurls\t\t= \tarray();\t\t\t// frame src urls\n\tvar $_framedepth\t=\t0;\t\t\t\t\t// increments on frame depth\n\n\tvar $_isproxy\t\t=\tfalse;\t\t\t\t// set if using a proxy server\n\tvar $_fp_timeout\t=\t30;\t\t\t\t\t// timeout for socket connection\n\n/*======================================================================*\\\n\tFunction:\tfetch\n\tPurpose:\tfetch the contents of a web page\n\t\t\t\t(and possibly other protocols in the\n\t\t\t\tfuture like ftp, nntp, gopher, etc.)\n\tInput:\t\t$URI\tthe location of the page to fetch\n\tOutput:\t\t$this->results\tthe output text from the fetch\n\\*======================================================================*/\n\n\tfunction fetch($URI)\n\t{\n\n\t\t//preg_match(\"|^([^:]+)://([^:/]+)(:[\\d]+)*(.*)|\",$URI,$URI_PARTS);\n\t\t$URI_PARTS = parse_url($URI);\n\t\tif (!empty($URI_PARTS[\"user\"]))\n\t\t\t$this->user = $URI_PARTS[\"user\"];\n\t\tif (!empty($URI_PARTS[\"pass\"]))\n\t\t\t$this->pass = $URI_PARTS[\"pass\"];\n\t\tif (empty($URI_PARTS[\"query\"]))\n\t\t\t$URI_PARTS[\"query\"] = '';\n\t\tif (empty($URI_PARTS[\"path\"]))\n\t\t\t$URI_PARTS[\"path\"] = '';\n\n\t\tswitch(strtolower($URI_PARTS[\"scheme\"]))\n\t\t{\n\t\t\tcase \"http\":\n\t\t\t\t$this->host = $URI_PARTS[\"host\"];\n\t\t\t\tif(!empty($URI_PARTS[\"port\"]))\n\t\t\t\t\t$this->port = $URI_PARTS[\"port\"];\n\t\t\t\tif($this->_connect($fp))\n\t\t\t\t{\n\t\t\t\t\tif($this->_isproxy)\n\t\t\t\t\t{\n\t\t\t\t\t\t// using proxy, send entire URI\n\t\t\t\t\t\t$this->_httprequest($URI,$fp,$URI,$this->_httpmethod);\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$path = $URI_PARTS[\"path\"].($URI_PARTS[\"query\"] ? \"?\".$URI_PARTS[\"query\"] : \"\");\n\t\t\t\t\t\t// no proxy, send only the path\n\t\t\t\t\t\t$this->_httprequest($path, $fp, $URI, $this->_httpmethod);\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->_disconnect($fp);\n\n\t\t\t\t\tif($this->_redirectaddr)\n\t\t\t\t\t{\n\t\t\t\t\t\t/* url was redirected, check if we've hit the max depth */\n\t\t\t\t\t\tif($this->maxredirs > $this->_redirectdepth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// only follow redirect if it's on this site, or offsiteok is true\n\t\t\t\t\t\t\tif(preg_match(\"|^http://\".preg_quote($this->host).\"|i\",$this->_redirectaddr) || $this->offsiteok)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* follow the redirect */\n\t\t\t\t\t\t\t\t$this->_redirectdepth++;\n\t\t\t\t\t\t\t\t$this->lastredirectaddr=$this->_redirectaddr;\n\t\t\t\t\t\t\t\t$this->fetch($this->_redirectaddr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$frameurls = $this->_frameurls;\n\t\t\t\t\t\t$this->_frameurls = array();\n\n\t\t\t\t\t\tforeach ( $frameurls as $frameurl )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->_framedepth < $this->maxframes)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->fetch($frameurl);\n\t\t\t\t\t\t\t\t$this->_framedepth++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\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\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tcase \"https\":\n\t\t\t\tif(!$this->curl_path)\n\t\t\t\t\treturn false;\n\t\t\t\tif(function_exists(\"is_executable\"))\n\t\t\t\t    if (!is_executable($this->curl_path))\n\t\t\t\t        return false;\n\t\t\t\t$this->host = $URI_PARTS[\"host\"];\n\t\t\t\tif(!empty($URI_PARTS[\"port\"]))\n\t\t\t\t\t$this->port = $URI_PARTS[\"port\"];\n\t\t\t\tif($this->_isproxy)\n\t\t\t\t{\n\t\t\t\t\t// using proxy, send entire URI\n\t\t\t\t\t$this->_httpsrequest($URI,$URI,$this->_httpmethod);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$path = $URI_PARTS[\"path\"].($URI_PARTS[\"query\"] ? \"?\".$URI_PARTS[\"query\"] : \"\");\n\t\t\t\t\t// no proxy, send only the path\n\t\t\t\t\t$this->_httpsrequest($path, $URI, $this->_httpmethod);\n\t\t\t\t}\n\n\t\t\t\tif($this->_redirectaddr)\n\t\t\t\t{\n\t\t\t\t\t/* url was redirected, check if we've hit the max depth */\n\t\t\t\t\tif($this->maxredirs > $this->_redirectdepth)\n\t\t\t\t\t{\n\t\t\t\t\t\t// only follow redirect if it's on this site, or offsiteok is true\n\t\t\t\t\t\tif(preg_match(\"|^http://\".preg_quote($this->host).\"|i\",$this->_redirectaddr) || $this->offsiteok)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* follow the redirect */\n\t\t\t\t\t\t\t$this->_redirectdepth++;\n\t\t\t\t\t\t\t$this->lastredirectaddr=$this->_redirectaddr;\n\t\t\t\t\t\t\t$this->fetch($this->_redirectaddr);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)\n\t\t\t\t{\n\t\t\t\t\t$frameurls = $this->_frameurls;\n\t\t\t\t\t$this->_frameurls = array();\n\n\t\t\t\t\tforeach ( $frameurls as $frameurl )\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->_framedepth < $this->maxframes)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->fetch($frameurl);\n\t\t\t\t\t\t\t$this->_framedepth++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// not a valid protocol\n\t\t\t\t$this->error\t=\t'Invalid protocol \"'.$URI_PARTS[\"scheme\"].'\"\\n';\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn true;\n\t}\n\n/*======================================================================*\\\n\tFunction:\tsubmit\n\tPurpose:\tsubmit an http form\n\tInput:\t\t$URI\tthe location to post the data\n\t\t\t\t$formvars\tthe formvars to use.\n\t\t\t\t\tformat: $formvars[\"var\"] = \"val\";\n\t\t\t\t$formfiles  an array of files to submit\n\t\t\t\t\tformat: $formfiles[\"var\"] = \"/dir/filename.ext\";\n\tOutput:\t\t$this->results\tthe text output from the post\n\\*======================================================================*/\n\n\tfunction submit($URI, $formvars=\"\", $formfiles=\"\")\n\t{\n\t\tunset($postdata);\n\n\t\t$postdata = $this->_prepare_post_body($formvars, $formfiles);\n\n\t\t$URI_PARTS = parse_url($URI);\n\t\tif (!empty($URI_PARTS[\"user\"]))\n\t\t\t$this->user = $URI_PARTS[\"user\"];\n\t\tif (!empty($URI_PARTS[\"pass\"]))\n\t\t\t$this->pass = $URI_PARTS[\"pass\"];\n\t\tif (empty($URI_PARTS[\"query\"]))\n\t\t\t$URI_PARTS[\"query\"] = '';\n\t\tif (empty($URI_PARTS[\"path\"]))\n\t\t\t$URI_PARTS[\"path\"] = '';\n\n\t\tswitch(strtolower($URI_PARTS[\"scheme\"]))\n\t\t{\n\t\t\tcase \"http\":\n\t\t\t\t$this->host = $URI_PARTS[\"host\"];\n\t\t\t\tif(!empty($URI_PARTS[\"port\"]))\n\t\t\t\t\t$this->port = $URI_PARTS[\"port\"];\n\t\t\t\tif($this->_connect($fp))\n\t\t\t\t{\n\t\t\t\t\tif($this->_isproxy)\n\t\t\t\t\t{\n\t\t\t\t\t\t// using proxy, send entire URI\n\t\t\t\t\t\t$this->_httprequest($URI,$fp,$URI,$this->_submit_method,$this->_submit_type,$postdata);\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$path = $URI_PARTS[\"path\"].($URI_PARTS[\"query\"] ? \"?\".$URI_PARTS[\"query\"] : \"\");\n\t\t\t\t\t\t// no proxy, send only the path\n\t\t\t\t\t\t$this->_httprequest($path, $fp, $URI, $this->_submit_method, $this->_submit_type, $postdata);\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->_disconnect($fp);\n\n\t\t\t\t\tif($this->_redirectaddr)\n\t\t\t\t\t{\n\t\t\t\t\t\t/* url was redirected, check if we've hit the max depth */\n\t\t\t\t\t\tif($this->maxredirs > $this->_redirectdepth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(!preg_match(\"|^\".$URI_PARTS[\"scheme\"].\"://|\", $this->_redirectaddr))\n\t\t\t\t\t\t\t\t$this->_redirectaddr = $this->_expandlinks($this->_redirectaddr,$URI_PARTS[\"scheme\"].\"://\".$URI_PARTS[\"host\"]);\n\n\t\t\t\t\t\t\t// only follow redirect if it's on this site, or offsiteok is true\n\t\t\t\t\t\t\tif(preg_match(\"|^http://\".preg_quote($this->host).\"|i\",$this->_redirectaddr) || $this->offsiteok)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* follow the redirect */\n\t\t\t\t\t\t\t\t$this->_redirectdepth++;\n\t\t\t\t\t\t\t\t$this->lastredirectaddr=$this->_redirectaddr;\n\t\t\t\t\t\t\t\tif( strpos( $this->_redirectaddr, \"?\" ) > 0 )\n\t\t\t\t\t\t\t\t\t$this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$this->submit($this->_redirectaddr,$formvars, $formfiles);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$frameurls = $this->_frameurls;\n\t\t\t\t\t\t$this->_frameurls = array();\n\n\t\t\t\t\t\tforeach ( $frameurls as $frameurl )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->_framedepth < $this->maxframes)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->fetch($frameurl);\n\t\t\t\t\t\t\t\t$this->_framedepth++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tcase \"https\":\n\t\t\t\tif(!$this->curl_path)\n\t\t\t\t\treturn false;\n\t\t\t\tif(function_exists(\"is_executable\"))\n\t\t\t\t    if (!is_executable($this->curl_path))\n\t\t\t\t        return false;\n\t\t\t\t$this->host = $URI_PARTS[\"host\"];\n\t\t\t\tif(!empty($URI_PARTS[\"port\"]))\n\t\t\t\t\t$this->port = $URI_PARTS[\"port\"];\n\t\t\t\tif($this->_isproxy)\n\t\t\t\t{\n\t\t\t\t\t// using proxy, send entire URI\n\t\t\t\t\t$this->_httpsrequest($URI, $URI, $this->_submit_method, $this->_submit_type, $postdata);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$path = $URI_PARTS[\"path\"].($URI_PARTS[\"query\"] ? \"?\".$URI_PARTS[\"query\"] : \"\");\n\t\t\t\t\t// no proxy, send only the path\n\t\t\t\t\t$this->_httpsrequest($path, $URI, $this->_submit_method, $this->_submit_type, $postdata);\n\t\t\t\t}\n\n\t\t\t\tif($this->_redirectaddr)\n\t\t\t\t{\n\t\t\t\t\t/* url was redirected, check if we've hit the max depth */\n\t\t\t\t\tif($this->maxredirs > $this->_redirectdepth)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!preg_match(\"|^\".$URI_PARTS[\"scheme\"].\"://|\", $this->_redirectaddr))\n\t\t\t\t\t\t\t$this->_redirectaddr = $this->_expandlinks($this->_redirectaddr,$URI_PARTS[\"scheme\"].\"://\".$URI_PARTS[\"host\"]);\n\n\t\t\t\t\t\t// only follow redirect if it's on this site, or offsiteok is true\n\t\t\t\t\t\tif(preg_match(\"|^http://\".preg_quote($this->host).\"|i\",$this->_redirectaddr) || $this->offsiteok)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* follow the redirect */\n\t\t\t\t\t\t\t$this->_redirectdepth++;\n\t\t\t\t\t\t\t$this->lastredirectaddr=$this->_redirectaddr;\n\t\t\t\t\t\t\tif( strpos( $this->_redirectaddr, \"?\" ) > 0 )\n\t\t\t\t\t\t\t\t$this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$this->submit($this->_redirectaddr,$formvars, $formfiles);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)\n\t\t\t\t{\n\t\t\t\t\t$frameurls = $this->_frameurls;\n\t\t\t\t\t$this->_frameurls = array();\n\n\t\t\t\t\tforeach ( $frameurls as $frameurl )\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->_framedepth < $this->maxframes)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->fetch($frameurl);\n\t\t\t\t\t\t\t$this->_framedepth++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// not a valid protocol\n\t\t\t\t$this->error\t=\t'Invalid protocol \"'.$URI_PARTS[\"scheme\"].'\"\\n';\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn true;\n\t}\n\n/*======================================================================*\\\n\tFunction:\tfetchlinks\n\tPurpose:\tfetch the links from a web page\n\tInput:\t\t$URI\twhere you are fetching from\n\tOutput:\t\t$this->results\tan array of the URLs\n\\*======================================================================*/\n\n\tfunction fetchlinks($URI)\n\t{\n\t\tif ($this->fetch($URI))\n\t\t{\n\t\t\tif($this->lastredirectaddr)\n\t\t\t\t$URI = $this->lastredirectaddr;\n\t\t\tif(is_array($this->results))\n\t\t\t{\n\t\t\t\tfor($x=0;$x<count($this->results);$x++)\n\t\t\t\t\t$this->results[$x] = $this->_striplinks($this->results[$x]);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$this->results = $this->_striplinks($this->results);\n\n\t\t\tif($this->expandlinks)\n\t\t\t\t$this->results = $this->_expandlinks($this->results, $URI);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}\n\n/*======================================================================*\\\n\tFunction:\tfetchform\n\tPurpose:\tfetch the form elements from a web page\n\tInput:\t\t$URI\twhere you are fetching from\n\tOutput:\t\t$this->results\tthe resulting html form\n\\*======================================================================*/\n\n\tfunction fetchform($URI)\n\t{\n\n\t\tif ($this->fetch($URI))\n\t\t{\n\n\t\t\tif(is_array($this->results))\n\t\t\t{\n\t\t\t\tfor($x=0;$x<count($this->results);$x++)\n\t\t\t\t\t$this->results[$x] = $this->_stripform($this->results[$x]);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$this->results = $this->_stripform($this->results);\n\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}\n\n\n/*======================================================================*\\\n\tFunction:\tfetchtext\n\tPurpose:\tfetch the text from a web page, stripping the links\n\tInput:\t\t$URI\twhere you are fetching from\n\tOutput:\t\t$this->results\tthe text from the web page\n\\*======================================================================*/\n\n\tfunction fetchtext($URI)\n\t{\n\t\tif($this->fetch($URI))\n\t\t{\n\t\t\tif(is_array($this->results))\n\t\t\t{\n\t\t\t\tfor($x=0;$x<count($this->results);$x++)\n\t\t\t\t\t$this->results[$x] = $this->_striptext($this->results[$x]);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$this->results = $this->_striptext($this->results);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}\n\n/*======================================================================*\\\n\tFunction:\tsubmitlinks\n\tPurpose:\tgrab links from a form submission\n\tInput:\t\t$URI\twhere you are submitting from\n\tOutput:\t\t$this->results\tan array of the links from the post\n\\*======================================================================*/\n\n\tfunction submitlinks($URI, $formvars=\"\", $formfiles=\"\")\n\t{\n\t\tif($this->submit($URI,$formvars, $formfiles))\n\t\t{\n\t\t\tif($this->lastredirectaddr)\n\t\t\t\t$URI = $this->lastredirectaddr;\n\t\t\tif(is_array($this->results))\n\t\t\t{\n\t\t\t\tfor($x=0;$x<count($this->results);$x++)\n\t\t\t\t{\n\t\t\t\t\t$this->results[$x] = $this->_striplinks($this->results[$x]);\n\t\t\t\t\tif($this->expandlinks)\n\t\t\t\t\t\t$this->results[$x] = $this->_expandlinks($this->results[$x],$URI);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->results = $this->_striplinks($this->results);\n\t\t\t\tif($this->expandlinks)\n\t\t\t\t\t$this->results = $this->_expandlinks($this->results,$URI);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}\n\n/*======================================================================*\\\n\tFunction:\tsubmittext\n\tPurpose:\tgrab text from a form submission\n\tInput:\t\t$URI\twhere you are submitting from\n\tOutput:\t\t$this->results\tthe text from the web page\n\\*======================================================================*/\n\n\tfunction submittext($URI, $formvars = \"\", $formfiles = \"\")\n\t{\n\t\tif($this->submit($URI,$formvars, $formfiles))\n\t\t{\n\t\t\tif($this->lastredirectaddr)\n\t\t\t\t$URI = $this->lastredirectaddr;\n\t\t\tif(is_array($this->results))\n\t\t\t{\n\t\t\t\tfor($x=0;$x<count($this->results);$x++)\n\t\t\t\t{\n\t\t\t\t\t$this->results[$x] = $this->_striptext($this->results[$x]);\n\t\t\t\t\tif($this->expandlinks)\n\t\t\t\t\t\t$this->results[$x] = $this->_expandlinks($this->results[$x],$URI);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->results = $this->_striptext($this->results);\n\t\t\t\tif($this->expandlinks)\n\t\t\t\t\t$this->results = $this->_expandlinks($this->results,$URI);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}\n\n\n\n/*======================================================================*\\\n\tFunction:\tset_submit_multipart\n\tPurpose:\tSet the form submission content type to\n\t\t\t\tmultipart/form-data\n\\*======================================================================*/\n\tfunction set_submit_multipart()\n\t{\n\t\t$this->_submit_type = \"multipart/form-data\";\n\t}\n\n\n/*======================================================================*\\\n\tFunction:\tset_submit_normal\n\tPurpose:\tSet the form submission content type to\n\t\t\t\tapplication/x-www-form-urlencoded\n\\*======================================================================*/\n\tfunction set_submit_normal()\n\t{\n\t\t$this->_submit_type = \"application/x-www-form-urlencoded\";\n\t}\n\n\n\n\n/*======================================================================*\\\n\tPrivate functions\n\\*======================================================================*/\n\n\n/*======================================================================*\\\n\tFunction:\t_striplinks\n\tPurpose:\tstrip the hyperlinks from an html document\n\tInput:\t\t$document\tdocument to strip.\n\tOutput:\t\t$match\t\tan array of the links\n\\*======================================================================*/\n\n\tfunction _striplinks($document)\n\t{\n\t\tpreg_match_all(\"'<\\s*a\\s.*?href\\s*=\\s*\t\t\t# find <a href=\n\t\t\t\t\t\t([\\\"\\'])?\t\t\t\t\t# find single or double quote\n\t\t\t\t\t\t(?(1) (.*?)\\\\1 | ([^\\s\\>]+))\t\t# if quote found, match up to next matching\n\t\t\t\t\t\t\t\t\t\t\t\t\t# quote, otherwise match up to next space\n\t\t\t\t\t\t'isx\",$document,$links);\n\n\n\t\t// catenate the non-empty matches from the conditional subpattern\n\n\t\tforeach ( $links[2] as $key => $val )\n\t\t{\n\t\t\tif(!empty($val))\n\t\t\t\t$match[] = $val;\n\t\t}\n\n\t\tforeach ( $links[3] as $key => $val )\n\t\t{\n\t\t\tif(!empty($val))\n\t\t\t\t$match[] = $val;\n\t\t}\n\n\t\t// return the links\n\t\treturn $match;\n\t}\n\n/*======================================================================*\\\n\tFunction:\t_stripform\n\tPurpose:\tstrip the form elements from an html document\n\tInput:\t\t$document\tdocument to strip.\n\tOutput:\t\t$match\t\tan array of the links\n\\*======================================================================*/\n\n\tfunction _stripform($document)\n\t{\n\t\tpreg_match_all(\"'<\\/?(FORM|INPUT|SELECT|TEXTAREA|(OPTION))[^<>]*>(?(2)(.*(?=<\\/?(option|select)[^<>]*>[\\r\\n]*)|(?=[\\r\\n]*))|(?=[\\r\\n]*))'Usi\",$document,$elements);\n\n\t\t// catenate the matches\n\t\t$match = implode(\"\\r\\n\",$elements[0]);\n\n\t\t// return the links\n\t\treturn $match;\n\t}\n\n\n\n/*======================================================================*\\\n\tFunction:\t_striptext\n\tPurpose:\tstrip the text from an html document\n\tInput:\t\t$document\tdocument to strip.\n\tOutput:\t\t$text\t\tthe resulting text\n\\*======================================================================*/\n\n\tfunction _striptext($document)\n\t{\n\n\t\t// I didn't use preg eval (//e) since that is only available in PHP 4.0.\n\t\t// so, list your entities one by one here. I included some of the\n\t\t// more common ones.\n\n\t\t$search = array(\"'<script[^>]*?>.*?</script>'si\",\t// strip out javascript\n\t\t\t\t\t\t\"'<[\\/\\!]*?[^<>]*?>'si\",\t\t\t// strip out html tags\n\t\t\t\t\t\t\"'([\\r\\n])[\\s]+'\",\t\t\t\t\t// strip out white space\n\t\t\t\t\t\t\"'&(quot|#34|#034|#x22);'i\",\t\t// replace html entities\n\t\t\t\t\t\t\"'&(amp|#38|#038|#x26);'i\",\t\t\t// added hexadecimal values\n\t\t\t\t\t\t\"'&(lt|#60|#060|#x3c);'i\",\n\t\t\t\t\t\t\"'&(gt|#62|#062|#x3e);'i\",\n\t\t\t\t\t\t\"'&(nbsp|#160|#xa0);'i\",\n\t\t\t\t\t\t\"'&(iexcl|#161);'i\",\n\t\t\t\t\t\t\"'&(cent|#162);'i\",\n\t\t\t\t\t\t\"'&(pound|#163);'i\",\n\t\t\t\t\t\t\"'&(copy|#169);'i\",\n\t\t\t\t\t\t\"'&(reg|#174);'i\",\n\t\t\t\t\t\t\"'&(deg|#176);'i\",\n\t\t\t\t\t\t\"'&(#39|#039|#x27);'\",\n\t\t\t\t\t\t\"'&(euro|#8364);'i\",\t\t\t\t// europe\n\t\t\t\t\t\t\"'&a(uml|UML);'\",\t\t\t\t\t// german\n\t\t\t\t\t\t\"'&o(uml|UML);'\",\n\t\t\t\t\t\t\"'&u(uml|UML);'\",\n\t\t\t\t\t\t\"'&A(uml|UML);'\",\n\t\t\t\t\t\t\"'&O(uml|UML);'\",\n\t\t\t\t\t\t\"'&U(uml|UML);'\",\n\t\t\t\t\t\t\"'&szlig;'i\",\n\t\t\t\t\t\t);\n\t\t$replace = array(\t\"\",\n\t\t\t\t\t\t\t\"\",\n\t\t\t\t\t\t\t\"\\\\1\",\n\t\t\t\t\t\t\t\"\\\"\",\n\t\t\t\t\t\t\t\"&\",\n\t\t\t\t\t\t\t\"<\",\n\t\t\t\t\t\t\t\">\",\n\t\t\t\t\t\t\t\" \",\n\t\t\t\t\t\t\tchr(161),\n\t\t\t\t\t\t\tchr(162),\n\t\t\t\t\t\t\tchr(163),\n\t\t\t\t\t\t\tchr(169),\n\t\t\t\t\t\t\tchr(174),\n\t\t\t\t\t\t\tchr(176),\n\t\t\t\t\t\t\tchr(39),\n\t\t\t\t\t\t\tchr(128),\n\t\t\t\t\t\t\tchr(0xE4), // ANSI &auml;\n\t\t\t\t\t\t\tchr(0xF6), // ANSI &ouml;\n\t\t\t\t\t\t\tchr(0xFC), // ANSI &uuml;\n\t\t\t\t\t\t\tchr(0xC4), // ANSI &Auml;\n\t\t\t\t\t\t\tchr(0xD6), // ANSI &Ouml;\n\t\t\t\t\t\t\tchr(0xDC), // ANSI &Uuml;\n\t\t\t\t\t\t\tchr(0xDF), // ANSI &szlig;\n\t\t\t\t\t\t);\n\n\t\t$text = preg_replace($search,$replace,$document);\n\n\t\treturn $text;\n\t}\n\n/*======================================================================*\\\n\tFunction:\t_expandlinks\n\tPurpose:\texpand each link into a fully qualified URL\n\tInput:\t\t$links\t\t\tthe links to qualify\n\t\t\t\t$URI\t\t\tthe full URI to get the base from\n\tOutput:\t\t$expandedLinks\tthe expanded links\n\\*======================================================================*/\n\n\tfunction _expandlinks($links,$URI)\n\t{\n\n\t\tpreg_match(\"/^[^\\?]+/\",$URI,$match);\n\n\t\t$match = preg_replace(\"|/[^\\/\\.]+\\.[^\\/\\.]+$|\",\"\",$match[0]);\n\t\t$match = preg_replace(\"|/$|\",\"\",$match);\n\t\t$match_part = parse_url($match);\n\t\t$match_root =\n\t\t$match_part[\"scheme\"].\"://\".$match_part[\"host\"];\n\n\t\t$search = array( \t\"|^http://\".preg_quote($this->host).\"|i\",\n\t\t\t\t\t\t\t\"|^(\\/)|i\",\n\t\t\t\t\t\t\t\"|^(?!http://)(?!mailto:)|i\",\n\t\t\t\t\t\t\t\"|/\\./|\",\n\t\t\t\t\t\t\t\"|/[^\\/]+/\\.\\./|\"\n\t\t\t\t\t\t);\n\n\t\t$replace = array(\t\"\",\n\t\t\t\t\t\t\t$match_root.\"/\",\n\t\t\t\t\t\t\t$match.\"/\",\n\t\t\t\t\t\t\t\"/\",\n\t\t\t\t\t\t\t\"/\"\n\t\t\t\t\t\t);\n\n\t\t$expandedLinks = preg_replace($search,$replace,$links);\n\n\t\treturn $expandedLinks;\n\t}\n\n/*======================================================================*\\\n\tFunction:\t_httprequest\n\tPurpose:\tgo get the http data from the server\n\tInput:\t\t$url\t\tthe url to fetch\n\t\t\t\t$fp\t\t\tthe current open file pointer\n\t\t\t\t$URI\t\tthe full URI\n\t\t\t\t$body\t\tbody contents to send if any (POST)\n\tOutput:\n\\*======================================================================*/\n\n\tfunction _httprequest($url,$fp,$URI,$http_method,$content_type=\"\",$body=\"\")\n\t{\n\t\t$cookie_headers = '';\n\t\tif($this->passcookies && $this->_redirectaddr)\n\t\t\t$this->setcookies();\n\n\t\t$URI_PARTS = parse_url($URI);\n\t\tif(empty($url))\n\t\t\t$url = \"/\";\n\t\t$headers = $http_method.\" \".$url.\" \".$this->_httpversion.\"\\r\\n\";\n\t\tif(!empty($this->agent))\n\t\t\t$headers .= \"User-Agent: \".$this->agent.\"\\r\\n\";\n\t\tif(!empty($this->host) && !isset($this->rawheaders['Host'])) {\n\t\t\t$headers .= \"Host: \".$this->host;\n\t\t\tif(!empty($this->port) && $this->port != 80)\n\t\t\t\t$headers .= \":\".$this->port;\n\t\t\t$headers .= \"\\r\\n\";\n\t\t}\n\t\tif(!empty($this->accept))\n\t\t\t$headers .= \"Accept: \".$this->accept.\"\\r\\n\";\n\t\tif(!empty($this->referer))\n\t\t\t$headers .= \"Referer: \".$this->referer.\"\\r\\n\";\n\t\tif(!empty($this->cookies))\n\t\t{\n\t\t\tif(!is_array($this->cookies))\n\t\t\t\t$this->cookies = (array)$this->cookies;\n\n\t\t\treset($this->cookies);\n\t\t\tif ( count($this->cookies) > 0 ) {\n\t\t\t\t$cookie_headers .= 'Cookie: ';\n\t\t\t\tforeach ( $this->cookies as $cookieKey => $cookieVal ) {\n\t\t\t\t$cookie_headers .= $cookieKey.\"=\".urlencode($cookieVal).\"; \";\n\t\t\t\t}\n\t\t\t\t$headers .= substr($cookie_headers,0,-2) . \"\\r\\n\";\n\t\t\t}\n\t\t}\n\t\tif(!empty($this->rawheaders))\n\t\t{\n\t\t\tif(!is_array($this->rawheaders))\n\t\t\t\t$this->rawheaders = (array)$this->rawheaders;\n\t\t\tforeach ( $this->rawheaders as $headerKey => $headerVal )\n\t\t\t\t$headers .= $headerKey.\": \".$headerVal.\"\\r\\n\";\n\t\t}\n\t\tif(!empty($content_type)) {\n\t\t\t$headers .= \"Content-type: $content_type\";\n\t\t\tif ($content_type == \"multipart/form-data\")\n\t\t\t\t$headers .= \"; boundary=\".$this->_mime_boundary;\n\t\t\t$headers .= \"\\r\\n\";\n\t\t}\n\t\tif(!empty($body))\n\t\t\t$headers .= \"Content-length: \".strlen($body).\"\\r\\n\";\n\t\tif(!empty($this->user) || !empty($this->pass))\n\t\t\t$headers .= \"Authorization: Basic \".base64_encode($this->user.\":\".$this->pass).\"\\r\\n\";\n\n\t\t//add proxy auth headers\n\t\tif(!empty($this->proxy_user))\n\t\t\t$headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass).\"\\r\\n\";\n\n\n\t\t$headers .= \"\\r\\n\";\n\n\t\t// set the read timeout if needed\n\t\tif ($this->read_timeout > 0)\n\t\t\tsocket_set_timeout($fp, $this->read_timeout);\n\t\t$this->timed_out = false;\n\n\t\tfwrite($fp,$headers.$body,strlen($headers.$body));\n\n\t\t$this->_redirectaddr = false;\n\t\tunset($this->headers);\n\n\t\twhile($currentHeader = fgets($fp,$this->_maxlinelen))\n\t\t{\n\t\t\tif ($this->read_timeout > 0 && $this->_check_timeout($fp))\n\t\t\t{\n\t\t\t\t$this->status=-100;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif($currentHeader == \"\\r\\n\")\n\t\t\t\tbreak;\n\n\t\t\t// if a header begins with Location: or URI:, set the redirect\n\t\t\tif(preg_match(\"/^(Location:|URI:)/i\",$currentHeader))\n\t\t\t{\n\t\t\t\t// get URL portion of the redirect\n\t\t\t\tpreg_match(\"/^(Location:|URI:)[ ]+(.*)/i\",chop($currentHeader),$matches);\n\t\t\t\t// look for :// in the Location header to see if hostname is included\n\t\t\t\tif(!preg_match(\"|\\:\\/\\/|\",$matches[2]))\n\t\t\t\t{\n\t\t\t\t\t// no host in the path, so prepend\n\t\t\t\t\t$this->_redirectaddr = $URI_PARTS[\"scheme\"].\"://\".$this->host.\":\".$this->port;\n\t\t\t\t\t// eliminate double slash\n\t\t\t\t\tif(!preg_match(\"|^/|\",$matches[2]))\n\t\t\t\t\t\t\t$this->_redirectaddr .= \"/\".$matches[2];\n\t\t\t\t\telse\n\t\t\t\t\t\t\t$this->_redirectaddr .= $matches[2];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$this->_redirectaddr = $matches[2];\n\t\t\t}\n\n\t\t\tif(preg_match(\"|^HTTP/|\",$currentHeader))\n\t\t\t{\n                if(preg_match(\"|^HTTP/[^\\s]*\\s(.*?)\\s|\",$currentHeader, $status))\n\t\t\t\t{\n\t\t\t\t\t$this->status= $status[1];\n                }\n\t\t\t\t$this->response_code = $currentHeader;\n\t\t\t}\n\n\t\t\t$this->headers[] = $currentHeader;\n\t\t}\n\n\t\t$results = '';\n\t\tdo {\n    \t\t$_data = fread($fp, $this->maxlength);\n    \t\tif (strlen($_data) == 0) {\n        \t\tbreak;\n    \t\t}\n    \t\t$results .= $_data;\n\t\t} while(true);\n\n\t\tif ($this->read_timeout > 0 && $this->_check_timeout($fp))\n\t\t{\n\t\t\t$this->status=-100;\n\t\t\treturn false;\n\t\t}\n\n\t\t// check if there is a redirect meta tag\n\n\t\tif(preg_match(\"'<meta[\\s]*http-equiv[^>]*?content[\\s]*=[\\s]*[\\\"\\']?\\d+;[\\s]*URL[\\s]*=[\\s]*([^\\\"\\']*?)[\\\"\\']?>'i\",$results,$match))\n\n\t\t{\n\t\t\t$this->_redirectaddr = $this->_expandlinks($match[1],$URI);\n\t\t}\n\n\t\t// have we hit our frame depth and is there frame src to fetch?\n\t\tif(($this->_framedepth < $this->maxframes) && preg_match_all(\"'<frame\\s+.*src[\\s]*=[\\'\\\"]?([^\\'\\\"\\>]+)'i\",$results,$match))\n\t\t{\n\t\t\t$this->results[] = $results;\n\t\t\tfor($x=0; $x<count($match[1]); $x++)\n\t\t\t\t$this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS[\"scheme\"].\"://\".$this->host);\n\t\t}\n\t\t// have we already fetched framed content?\n\t\telseif(is_array($this->results))\n\t\t\t$this->results[] = $results;\n\t\t// no framed content\n\t\telse\n\t\t\t$this->results = $results;\n\n\t\treturn true;\n\t}\n\n/*======================================================================*\\\n\tFunction:\t_httpsrequest\n\tPurpose:\tgo get the https data from the server using curl\n\tInput:\t\t$url\t\tthe url to fetch\n\t\t\t\t$URI\t\tthe full URI\n\t\t\t\t$body\t\tbody contents to send if any (POST)\n\tOutput:\n\\*======================================================================*/\n\n\tfunction _httpsrequest($url,$URI,$http_method,$content_type=\"\",$body=\"\")\n\t{\n\t\tif($this->passcookies && $this->_redirectaddr)\n\t\t\t$this->setcookies();\n\n\t\t$headers = array();\n\n\t\t$URI_PARTS = parse_url($URI);\n\t\tif(empty($url))\n\t\t\t$url = \"/\";\n\t\t// GET ... header not needed for curl\n\t\t//$headers[] = $http_method.\" \".$url.\" \".$this->_httpversion;\n\t\tif(!empty($this->agent))\n\t\t\t$headers[] = \"User-Agent: \".$this->agent;\n\t\tif(!empty($this->host))\n\t\t\tif(!empty($this->port))\n\t\t\t\t$headers[] = \"Host: \".$this->host.\":\".$this->port;\n\t\t\telse\n\t\t\t\t$headers[] = \"Host: \".$this->host;\n\t\tif(!empty($this->accept))\n\t\t\t$headers[] = \"Accept: \".$this->accept;\n\t\tif(!empty($this->referer))\n\t\t\t$headers[] = \"Referer: \".$this->referer;\n\t\tif(!empty($this->cookies))\n\t\t{\n\t\t\tif(!is_array($this->cookies))\n\t\t\t\t$this->cookies = (array)$this->cookies;\n\n\t\t\treset($this->cookies);\n\t\t\tif ( count($this->cookies) > 0 ) {\n\t\t\t\t$cookie_str = 'Cookie: ';\n\t\t\t\tforeach ( $this->cookies as $cookieKey => $cookieVal ) {\n\t\t\t\t$cookie_str .= $cookieKey.\"=\".urlencode($cookieVal).\"; \";\n\t\t\t\t}\n\t\t\t\t$headers[] = substr($cookie_str,0,-2);\n\t\t\t}\n\t\t}\n\t\tif(!empty($this->rawheaders))\n\t\t{\n\t\t\tif(!is_array($this->rawheaders))\n\t\t\t\t$this->rawheaders = (array)$this->rawheaders;\n\t\t\tforeach ( $this->rawheaders as $headerKey => $headerVal )\n\t\t\t\t$headers[] = $headerKey.\": \".$headerVal;\n\t\t}\n\t\tif(!empty($content_type)) {\n\t\t\tif ($content_type == \"multipart/form-data\")\n\t\t\t\t$headers[] = \"Content-type: $content_type; boundary=\".$this->_mime_boundary;\n\t\t\telse\n\t\t\t\t$headers[] = \"Content-type: $content_type\";\n\t\t}\n\t\tif(!empty($body))\n\t\t\t$headers[] = \"Content-length: \".strlen($body);\n\t\tif(!empty($this->user) || !empty($this->pass))\n\t\t\t$headers[] = \"Authorization: BASIC \".base64_encode($this->user.\":\".$this->pass);\n\n\t\t$headerfile = tempnam( $this->temp_dir, \"sno\" );\n\t\t$cmdline_params = '-k -D ' . escapeshellarg( $headerfile );\n\n\t\tforeach ( $headers as $header ) {\n\t\t\t$cmdline_params .= ' -H ' . escapeshellarg( $header );\n\t\t}\n\n\t\tif ( ! empty( $body ) ) {\n\t\t\t$cmdline_params .= ' -d ' . escapeshellarg( $body );\n\t\t}\n\n\t\tif ( $this->read_timeout > 0 ) {\n\t\t\t$cmdline_params .= ' -m ' . escapeshellarg( $this->read_timeout );\n\t\t}\n\n\n\t\texec( $this->curl_path . ' ' . $cmdline_params . ' ' . escapeshellarg( $URI ), $results, $return );\n\n\t\tif($return)\n\t\t{\n\t\t\t$this->error = \"Error: cURL could not retrieve the document, error $return.\";\n\t\t\treturn false;\n\t\t}\n\n\n\t\t$results = implode(\"\\r\\n\",$results);\n\n\t\t$result_headers = file(\"$headerfile\");\n\n\t\t$this->_redirectaddr = false;\n\t\tunset($this->headers);\n\n\t\tfor($currentHeader = 0; $currentHeader < count($result_headers); $currentHeader++)\n\t\t{\n\n\t\t\t// if a header begins with Location: or URI:, set the redirect\n\t\t\tif(preg_match(\"/^(Location: |URI: )/i\",$result_headers[$currentHeader]))\n\t\t\t{\n\t\t\t\t// get URL portion of the redirect\n\t\t\t\tpreg_match(\"/^(Location: |URI:)\\s+(.*)/\",chop($result_headers[$currentHeader]),$matches);\n\t\t\t\t// look for :// in the Location header to see if hostname is included\n\t\t\t\tif(!preg_match(\"|\\:\\/\\/|\",$matches[2]))\n\t\t\t\t{\n\t\t\t\t\t// no host in the path, so prepend\n\t\t\t\t\t$this->_redirectaddr = $URI_PARTS[\"scheme\"].\"://\".$this->host.\":\".$this->port;\n\t\t\t\t\t// eliminate double slash\n\t\t\t\t\tif(!preg_match(\"|^/|\",$matches[2]))\n\t\t\t\t\t\t\t$this->_redirectaddr .= \"/\".$matches[2];\n\t\t\t\t\telse\n\t\t\t\t\t\t\t$this->_redirectaddr .= $matches[2];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$this->_redirectaddr = $matches[2];\n\t\t\t}\n\n\t\t\tif(preg_match(\"|^HTTP/|\",$result_headers[$currentHeader]))\n\t\t\t\t$this->response_code = $result_headers[$currentHeader];\n\n\t\t\t$this->headers[] = $result_headers[$currentHeader];\n\t\t}\n\n\t\t// check if there is a redirect meta tag\n\n\t\tif(preg_match(\"'<meta[\\s]*http-equiv[^>]*?content[\\s]*=[\\s]*[\\\"\\']?\\d+;[\\s]*URL[\\s]*=[\\s]*([^\\\"\\']*?)[\\\"\\']?>'i\",$results,$match))\n\t\t{\n\t\t\t$this->_redirectaddr = $this->_expandlinks($match[1],$URI);\n\t\t}\n\n\t\t// have we hit our frame depth and is there frame src to fetch?\n\t\tif(($this->_framedepth < $this->maxframes) && preg_match_all(\"'<frame\\s+.*src[\\s]*=[\\'\\\"]?([^\\'\\\"\\>]+)'i\",$results,$match))\n\t\t{\n\t\t\t$this->results[] = $results;\n\t\t\tfor($x=0; $x<count($match[1]); $x++)\n\t\t\t\t$this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS[\"scheme\"].\"://\".$this->host);\n\t\t}\n\t\t// have we already fetched framed content?\n\t\telseif(is_array($this->results))\n\t\t\t$this->results[] = $results;\n\t\t// no framed content\n\t\telse\n\t\t\t$this->results = $results;\n\n\t\tunlink(\"$headerfile\");\n\n\t\treturn true;\n\t}\n\n/*======================================================================*\\\n\tFunction:\tsetcookies()\n\tPurpose:\tset cookies for a redirection\n\\*======================================================================*/\n\n\tfunction setcookies()\n\t{\n\t\tfor($x=0; $x<count($this->headers); $x++)\n\t\t{\n\t\tif(preg_match('/^set-cookie:[\\s]+([^=]+)=([^;]+)/i', $this->headers[$x],$match))\n\t\t\t$this->cookies[$match[1]] = urldecode($match[2]);\n\t\t}\n\t}\n\n\n/*======================================================================*\\\n\tFunction:\t_check_timeout\n\tPurpose:\tchecks whether timeout has occurred\n\tInput:\t\t$fp\tfile pointer\n\\*======================================================================*/\n\n\tfunction _check_timeout($fp)\n\t{\n\t\tif ($this->read_timeout > 0) {\n\t\t\t$fp_status = socket_get_status($fp);\n\t\t\tif ($fp_status[\"timed_out\"]) {\n\t\t\t\t$this->timed_out = true;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n/*======================================================================*\\\n\tFunction:\t_connect\n\tPurpose:\tmake a socket connection\n\tInput:\t\t$fp\tfile pointer\n\\*======================================================================*/\n\n\tfunction _connect(&$fp)\n\t{\n\t\tif(!empty($this->proxy_host) && !empty($this->proxy_port))\n\t\t\t{\n\t\t\t\t$this->_isproxy = true;\n\n\t\t\t\t$host = $this->proxy_host;\n\t\t\t\t$port = $this->proxy_port;\n\t\t\t}\n\t\telse\n\t\t{\n\t\t\t$host = $this->host;\n\t\t\t$port = $this->port;\n\t\t}\n\n\t\t$this->status = 0;\n\n\t\tif($fp = fsockopen(\n\t\t\t\t\t$host,\n\t\t\t\t\t$port,\n\t\t\t\t\t$errno,\n\t\t\t\t\t$errstr,\n\t\t\t\t\t$this->_fp_timeout\n\t\t\t\t\t))\n\t\t{\n\t\t\t// socket connection succeeded\n\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// socket connection failed\n\t\t\t$this->status = $errno;\n\t\t\tswitch($errno)\n\t\t\t{\n\t\t\t\tcase -3:\n\t\t\t\t\t$this->error=\"socket creation failed (-3)\";\n\t\t\t\tcase -4:\n\t\t\t\t\t$this->error=\"dns lookup failure (-4)\";\n\t\t\t\tcase -5:\n\t\t\t\t\t$this->error=\"connection refused or timed out (-5)\";\n\t\t\t\tdefault:\n\t\t\t\t\t$this->error=\"connection failed (\".$errno.\")\";\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n/*======================================================================*\\\n\tFunction:\t_disconnect\n\tPurpose:\tdisconnect a socket connection\n\tInput:\t\t$fp\tfile pointer\n\\*======================================================================*/\n\n\tfunction _disconnect($fp)\n\t{\n\t\treturn(fclose($fp));\n\t}\n\n\n/*======================================================================*\\\n\tFunction:\t_prepare_post_body\n\tPurpose:\tPrepare post body according to encoding type\n\tInput:\t\t$formvars  - form variables\n\t\t\t\t$formfiles - form upload files\n\tOutput:\t\tpost body\n\\*======================================================================*/\n\n\tfunction _prepare_post_body($formvars, $formfiles)\n\t{\n\t\tsettype($formvars, \"array\");\n\t\tsettype($formfiles, \"array\");\n\t\t$postdata = '';\n\n\t\tif (count($formvars) == 0 && count($formfiles) == 0)\n\t\t\treturn;\n\n\t\tswitch ($this->_submit_type) {\n\t\t\tcase \"application/x-www-form-urlencoded\":\n\t\t\t\treset($formvars);\n\t\t\t\tforeach ( $formvars as $key => $val ) {\n\t\t\t\t\tif (is_array($val) || is_object($val)) {\n\t\t\t\t\t\tforeach ( $val as $cur_key => $cur_val ) {\n\t\t\t\t\t\t\t$postdata .= urlencode($key).\"[]=\".urlencode($cur_val).\"&\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\t$postdata .= urlencode($key).\"=\".urlencode($val).\"&\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"multipart/form-data\":\n\t\t\t\t$this->_mime_boundary = \"Snoopy\".md5(uniqid(microtime()));\n\n\t\t\t\treset($formvars);\n\t\t\t\tforeach ( $formvars as $key => $val ) {\n\t\t\t\t\tif (is_array($val) || is_object($val)) {\n\t\t\t\t\t\tforeach ( $val as $cur_key => $cur_val ) {\n\t\t\t\t\t\t\t$postdata .= \"--\".$this->_mime_boundary.\"\\r\\n\";\n\t\t\t\t\t\t\t$postdata .= \"Content-Disposition: form-data; name=\\\"$key\\[\\]\\\"\\r\\n\\r\\n\";\n\t\t\t\t\t\t\t$postdata .= \"$cur_val\\r\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$postdata .= \"--\".$this->_mime_boundary.\"\\r\\n\";\n\t\t\t\t\t\t$postdata .= \"Content-Disposition: form-data; name=\\\"$key\\\"\\r\\n\\r\\n\";\n\t\t\t\t\t\t$postdata .= \"$val\\r\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treset($formfiles);\n\t\t\t\tforeach ( $formfiles as $field_name => $file_names ) {\n\t\t\t\t\tsettype($file_names, \"array\");\n\t\t\t\t\tforeach ( $file_names as $file_name ) {\n\t\t\t\t\t\tif (!is_readable($file_name)) continue;\n\n\t\t\t\t\t\t$fp = fopen($file_name, \"r\");\n\t\t\t\t\t\t$file_content = fread($fp, filesize($file_name));\n\t\t\t\t\t\tfclose($fp);\n\t\t\t\t\t\t$base_name = basename($file_name);\n\n\t\t\t\t\t\t$postdata .= \"--\".$this->_mime_boundary.\"\\r\\n\";\n\t\t\t\t\t\t$postdata .= \"Content-Disposition: form-data; name=\\\"$field_name\\\"; filename=\\\"$base_name\\\"\\r\\n\\r\\n\";\n\t\t\t\t\t\t$postdata .= \"$file_content\\r\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$postdata .= \"--\".$this->_mime_boundary.\"--\\r\\n\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $postdata;\n\t}\n}\nendif;\n?>\n", "num_lines": 1260}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Taxonomy API: Walker_CategoryDropdown class\n *\n * @package WordPress\n * @subpackage Template\n * @since 4.4.0\n */\n\n/**\n * Core class used to create an HTML dropdown list of Categories.\n *\n * @since 2.1.0\n *\n * @see Walker\n */\nclass Walker_CategoryDropdown extends Walker {\n\n\t/**\n\t * What the class handles.\n\t *\n\t * @since 2.1.0\n\t * @var string\n\t *\n\t * @see Walker::$tree_type\n\t */\n\tpublic $tree_type = 'category';\n\n\t/**\n\t * Database fields to use.\n\t *\n\t * @since 2.1.0\n\t * @todo Decouple this\n\t * @var array\n\t *\n\t * @see Walker::$db_fields\n\t */\n\tpublic $db_fields = array(\n\t\t'parent' => 'parent',\n\t\t'id'     => 'term_id',\n\t);\n\n\t/**\n\t * Starts the element output.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @see Walker::start_el()\n\t *\n\t * @param string $output   Used to append additional content (passed by reference).\n\t * @param object $category Category data object.\n\t * @param int    $depth    Depth of category. Used for padding.\n\t * @param array  $args     Uses 'selected', 'show_count', and 'value_field' keys, if they exist.\n\t *                         See wp_dropdown_categories().\n\t * @param int    $id       Optional. ID of the current category. Default 0 (unused).\n\t */\n\tpublic function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {\n\t\t$pad = str_repeat( '&nbsp;', $depth * 3 );\n\n\t\t/** This filter is documented in wp-includes/category-template.php */\n\t\t$cat_name = apply_filters( 'list_cats', $category->name, $category );\n\n\t\tif ( isset( $args['value_field'] ) && isset( $category->{$args['value_field']} ) ) {\n\t\t\t$value_field = $args['value_field'];\n\t\t} else {\n\t\t\t$value_field = 'term_id';\n\t\t}\n\n\t\t$output .= \"\\t<option class=\\\"level-$depth\\\" value=\\\"\" . esc_attr( $category->{$value_field} ) . '\"';\n\n\t\t// Type-juggling causes false matches, so we force everything to a string.\n\t\tif ( (string) $category->{$value_field} === (string) $args['selected'] ) {\n\t\t\t$output .= ' selected=\"selected\"';\n\t\t}\n\t\t$output .= '>';\n\t\t$output .= $pad . $cat_name;\n\t\tif ( $args['show_count'] ) {\n\t\t\t$output .= '&nbsp;&nbsp;(' . number_format_i18n( $category->count ) . ')';\n\t\t}\n\t\t$output .= \"</option>\\n\";\n\t}\n}\n", "num_lines": 83}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Taxonomy API: Walker_Category class\n *\n * @package WordPress\n * @subpackage Template\n * @since 4.4.0\n */\n\n/**\n * Core class used to create an HTML list of categories.\n *\n * @since 2.1.0\n *\n * @see Walker\n */\nclass Walker_Category extends Walker {\n\n\t/**\n\t * What the class handles.\n\t *\n\t * @since 2.1.0\n\t * @var string\n\t *\n\t * @see Walker::$tree_type\n\t */\n\tpublic $tree_type = 'category';\n\n\t/**\n\t * Database fields to use.\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t *\n\t * @see Walker::$db_fields\n\t * @todo Decouple this\n\t */\n\tpublic $db_fields = array(\n\t\t'parent' => 'parent',\n\t\t'id'     => 'term_id',\n\t);\n\n\t/**\n\t * Starts the list before the elements are added.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @see Walker::start_lvl()\n\t *\n\t * @param string $output Used to append additional content. Passed by reference.\n\t * @param int    $depth  Optional. Depth of category. Used for tab indentation. Default 0.\n\t * @param array  $args   Optional. An array of arguments. Will only append content if style argument\n\t *                       value is 'list'. See wp_list_categories(). Default empty array.\n\t */\n\tpublic function start_lvl( &$output, $depth = 0, $args = array() ) {\n\t\tif ( 'list' !== $args['style'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$indent  = str_repeat( \"\\t\", $depth );\n\t\t$output .= \"$indent<ul class='children'>\\n\";\n\t}\n\n\t/**\n\t * Ends the list of after the elements are added.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @see Walker::end_lvl()\n\t *\n\t * @param string $output Used to append additional content. Passed by reference.\n\t * @param int    $depth  Optional. Depth of category. Used for tab indentation. Default 0.\n\t * @param array  $args   Optional. An array of arguments. Will only append content if style argument\n\t *                       value is 'list'. See wp_list_categories(). Default empty array.\n\t */\n\tpublic function end_lvl( &$output, $depth = 0, $args = array() ) {\n\t\tif ( 'list' !== $args['style'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$indent  = str_repeat( \"\\t\", $depth );\n\t\t$output .= \"$indent</ul>\\n\";\n\t}\n\n\t/**\n\t * Starts the element output.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @see Walker::start_el()\n\t *\n\t * @param string $output   Used to append additional content (passed by reference).\n\t * @param object $category Category data object.\n\t * @param int    $depth    Optional. Depth of category in reference to parents. Default 0.\n\t * @param array  $args     Optional. An array of arguments. See wp_list_categories(). Default empty array.\n\t * @param int    $id       Optional. ID of the current category. Default 0.\n\t */\n\tpublic function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {\n\t\t/** This filter is documented in wp-includes/category-template.php */\n\t\t$cat_name = apply_filters( 'list_cats', esc_attr( $category->name ), $category );\n\n\t\t// Don't generate an element if the category name is empty.\n\t\tif ( '' === $cat_name ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$atts         = array();\n\t\t$atts['href'] = get_term_link( $category );\n\n\t\tif ( $args['use_desc_for_title'] && ! empty( $category->description ) ) {\n\t\t\t/**\n\t\t\t * Filters the category description for display.\n\t\t\t *\n\t\t\t * @since 1.2.0\n\t\t\t *\n\t\t\t * @param string $description Category description.\n\t\t\t * @param object $category    Category object.\n\t\t\t */\n\t\t\t$atts['title'] = strip_tags( apply_filters( 'category_description', $category->description, $category ) );\n\t\t}\n\n\t\t/**\n\t\t * Filters the HTML attributes applied to a category list item's anchor element.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param array   $atts {\n\t\t *     The HTML attributes applied to the list item's `<a>` element, empty strings are ignored.\n\t\t *\n\t\t *     @type string $href  The href attribute.\n\t\t *     @type string $title The title attribute.\n\t\t * }\n\t\t * @param WP_Term $category Term data object.\n\t\t * @param int     $depth    Depth of category, used for padding.\n\t\t * @param array   $args     An array of arguments.\n\t\t * @param int     $id       ID of the current category.\n\t\t */\n\t\t$atts = apply_filters( 'category_list_link_attributes', $atts, $category, $depth, $args, $id );\n\n\t\t$attributes = '';\n\t\tforeach ( $atts as $attr => $value ) {\n\t\t\tif ( is_scalar( $value ) && '' !== $value && false !== $value ) {\n\t\t\t\t$value       = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );\n\t\t\t\t$attributes .= ' ' . $attr . '=\"' . $value . '\"';\n\t\t\t}\n\t\t}\n\n\t\t$link = sprintf(\n\t\t\t'<a%s>%s</a>',\n\t\t\t$attributes,\n\t\t\t$cat_name\n\t\t);\n\n\t\tif ( ! empty( $args['feed_image'] ) || ! empty( $args['feed'] ) ) {\n\t\t\t$link .= ' ';\n\n\t\t\tif ( empty( $args['feed_image'] ) ) {\n\t\t\t\t$link .= '(';\n\t\t\t}\n\n\t\t\t$link .= '<a href=\"' . esc_url( get_term_feed_link( $category->term_id, $category->taxonomy, $args['feed_type'] ) ) . '\"';\n\n\t\t\tif ( empty( $args['feed'] ) ) {\n\t\t\t\t/* translators: %s: Category name. */\n\t\t\t\t$alt = ' alt=\"' . sprintf( __( 'Feed for all posts filed under %s' ), $cat_name ) . '\"';\n\t\t\t} else {\n\t\t\t\t$alt   = ' alt=\"' . $args['feed'] . '\"';\n\t\t\t\t$name  = $args['feed'];\n\t\t\t\t$link .= empty( $args['title'] ) ? '' : $args['title'];\n\t\t\t}\n\n\t\t\t$link .= '>';\n\n\t\t\tif ( empty( $args['feed_image'] ) ) {\n\t\t\t\t$link .= $name;\n\t\t\t} else {\n\t\t\t\t$link .= \"<img src='\" . esc_url( $args['feed_image'] ) . \"'$alt\" . ' />';\n\t\t\t}\n\t\t\t$link .= '</a>';\n\n\t\t\tif ( empty( $args['feed_image'] ) ) {\n\t\t\t\t$link .= ')';\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $args['show_count'] ) ) {\n\t\t\t$link .= ' (' . number_format_i18n( $category->count ) . ')';\n\t\t}\n\t\tif ( 'list' === $args['style'] ) {\n\t\t\t$output     .= \"\\t<li\";\n\t\t\t$css_classes = array(\n\t\t\t\t'cat-item',\n\t\t\t\t'cat-item-' . $category->term_id,\n\t\t\t);\n\n\t\t\tif ( ! empty( $args['current_category'] ) ) {\n\t\t\t\t// 'current_category' can be an array, so we use `get_terms()`.\n\t\t\t\t$_current_terms = get_terms(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'taxonomy'   => $category->taxonomy,\n\t\t\t\t\t\t'include'    => $args['current_category'],\n\t\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tforeach ( $_current_terms as $_current_term ) {\n\t\t\t\t\tif ( $category->term_id == $_current_term->term_id ) {\n\t\t\t\t\t\t$css_classes[] = 'current-cat';\n\t\t\t\t\t\t$link          = str_replace( '<a', '<a aria-current=\"page\"', $link );\n\t\t\t\t\t} elseif ( $category->term_id == $_current_term->parent ) {\n\t\t\t\t\t\t$css_classes[] = 'current-cat-parent';\n\t\t\t\t\t}\n\t\t\t\t\twhile ( $_current_term->parent ) {\n\t\t\t\t\t\tif ( $category->term_id == $_current_term->parent ) {\n\t\t\t\t\t\t\t$css_classes[] = 'current-cat-ancestor';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$_current_term = get_term( $_current_term->parent, $category->taxonomy );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the list of CSS classes to include with each category in the list.\n\t\t\t *\n\t\t\t * @since 4.2.0\n\t\t\t *\n\t\t\t * @see wp_list_categories()\n\t\t\t *\n\t\t\t * @param array  $css_classes An array of CSS classes to be applied to each list item.\n\t\t\t * @param object $category    Category data object.\n\t\t\t * @param int    $depth       Depth of page, used for padding.\n\t\t\t * @param array  $args        An array of wp_list_categories() arguments.\n\t\t\t */\n\t\t\t$css_classes = implode( ' ', apply_filters( 'category_css_class', $css_classes, $category, $depth, $args ) );\n\t\t\t$css_classes = $css_classes ? ' class=\"' . esc_attr( $css_classes ) . '\"' : '';\n\n\t\t\t$output .= $css_classes;\n\t\t\t$output .= \">$link\\n\";\n\t\t} elseif ( isset( $args['separator'] ) ) {\n\t\t\t$output .= \"\\t$link\" . $args['separator'] . \"\\n\";\n\t\t} else {\n\t\t\t$output .= \"\\t$link<br />\\n\";\n\t\t}\n\t}\n\n\t/**\n\t * Ends the element output, if needed.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @see Walker::end_el()\n\t *\n\t * @param string $output Used to append additional content (passed by reference).\n\t * @param object $page   Not used.\n\t * @param int    $depth  Optional. Depth of category. Not used.\n\t * @param array  $args   Optional. An array of arguments. Only uses 'list' for whether should append\n\t *                       to output. See wp_list_categories(). Default empty array.\n\t */\n\tpublic function end_el( &$output, $page, $depth = 0, $args = array() ) {\n\t\tif ( 'list' !== $args['style'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$output .= \"</li>\\n\";\n\t}\n\n}\n", "num_lines": 269}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Comment API: Walker_Comment class\n *\n * @package WordPress\n * @subpackage Comments\n * @since 4.4.0\n */\n\n/**\n * Core walker class used to create an HTML list of comments.\n *\n * @since 2.7.0\n *\n * @see Walker\n */\nclass Walker_Comment extends Walker {\n\n\t/**\n\t * What the class handles.\n\t *\n\t * @since 2.7.0\n\t * @var string\n\t *\n\t * @see Walker::$tree_type\n\t */\n\tpublic $tree_type = 'comment';\n\n\t/**\n\t * Database fields to use.\n\t *\n\t * @since 2.7.0\n\t * @var array\n\t *\n\t * @see Walker::$db_fields\n\t * @todo Decouple this\n\t */\n\tpublic $db_fields = array(\n\t\t'parent' => 'comment_parent',\n\t\t'id'     => 'comment_ID',\n\t);\n\n\t/**\n\t * Starts the list before the elements are added.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @see Walker::start_lvl()\n\t * @global int $comment_depth\n\t *\n\t * @param string $output Used to append additional content (passed by reference).\n\t * @param int    $depth  Optional. Depth of the current comment. Default 0.\n\t * @param array  $args   Optional. Uses 'style' argument for type of HTML list. Default empty array.\n\t */\n\tpublic function start_lvl( &$output, $depth = 0, $args = array() ) {\n\t\t$GLOBALS['comment_depth'] = $depth + 1;\n\n\t\tswitch ( $args['style'] ) {\n\t\t\tcase 'div':\n\t\t\t\tbreak;\n\t\t\tcase 'ol':\n\t\t\t\t$output .= '<ol class=\"children\">' . \"\\n\";\n\t\t\t\tbreak;\n\t\t\tcase 'ul':\n\t\t\tdefault:\n\t\t\t\t$output .= '<ul class=\"children\">' . \"\\n\";\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Ends the list of items after the elements are added.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @see Walker::end_lvl()\n\t * @global int $comment_depth\n\t *\n\t * @param string $output Used to append additional content (passed by reference).\n\t * @param int    $depth  Optional. Depth of the current comment. Default 0.\n\t * @param array  $args   Optional. Will only append content if style argument value is 'ol' or 'ul'.\n\t *                       Default empty array.\n\t */\n\tpublic function end_lvl( &$output, $depth = 0, $args = array() ) {\n\t\t$GLOBALS['comment_depth'] = $depth + 1;\n\n\t\tswitch ( $args['style'] ) {\n\t\t\tcase 'div':\n\t\t\t\tbreak;\n\t\t\tcase 'ol':\n\t\t\t\t$output .= \"</ol><!-- .children -->\\n\";\n\t\t\t\tbreak;\n\t\t\tcase 'ul':\n\t\t\tdefault:\n\t\t\t\t$output .= \"</ul><!-- .children -->\\n\";\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Traverses elements to create list from elements.\n\t *\n\t * This function is designed to enhance Walker::display_element() to\n\t * display children of higher nesting levels than selected inline on\n\t * the highest depth level displayed. This prevents them being orphaned\n\t * at the end of the comment list.\n\t *\n\t * Example: max_depth = 2, with 5 levels of nested content.\n\t *     1\n\t *      1.1\n\t *        1.1.1\n\t *        1.1.1.1\n\t *        1.1.1.1.1\n\t *        1.1.2\n\t *        1.1.2.1\n\t *     2\n\t *      2.2\n\t *\n\t * @since 2.7.0\n\t *\n\t * @see Walker::display_element()\n\t * @see wp_list_comments()\n\t *\n\t * @param WP_Comment $element           Comment data object.\n\t * @param array      $children_elements List of elements to continue traversing. Passed by reference.\n\t * @param int        $max_depth         Max depth to traverse.\n\t * @param int        $depth             Depth of the current element.\n\t * @param array      $args              An array of arguments.\n\t * @param string     $output            Used to append additional content. Passed by reference.\n\t */\n\tpublic function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {\n\t\tif ( ! $element ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$id_field = $this->db_fields['id'];\n\t\t$id       = $element->$id_field;\n\n\t\tparent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );\n\n\t\t/*\n\t\t * If at the max depth, and the current element still has children, loop over those\n\t\t * and display them at this level. This is to prevent them being orphaned to the end\n\t\t * of the list.\n\t\t */\n\t\tif ( $max_depth <= $depth + 1 && isset( $children_elements[ $id ] ) ) {\n\t\t\tforeach ( $children_elements[ $id ] as $child ) {\n\t\t\t\t$this->display_element( $child, $children_elements, $max_depth, $depth, $args, $output );\n\t\t\t}\n\n\t\t\tunset( $children_elements[ $id ] );\n\t\t}\n\n\t}\n\n\t/**\n\t * Starts the element output.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @see Walker::start_el()\n\t * @see wp_list_comments()\n\t * @global int        $comment_depth\n\t * @global WP_Comment $comment       Global comment object.\n\t *\n\t * @param string     $output  Used to append additional content. Passed by reference.\n\t * @param WP_Comment $comment Comment data object.\n\t * @param int        $depth   Optional. Depth of the current comment in reference to parents. Default 0.\n\t * @param array      $args    Optional. An array of arguments. Default empty array.\n\t * @param int        $id      Optional. ID of the current comment. Default 0 (unused).\n\t */\n\tpublic function start_el( &$output, $comment, $depth = 0, $args = array(), $id = 0 ) {\n\t\t$depth++;\n\t\t$GLOBALS['comment_depth'] = $depth;\n\t\t$GLOBALS['comment']       = $comment;\n\n\t\tif ( ! empty( $args['callback'] ) ) {\n\t\t\tob_start();\n\t\t\tcall_user_func( $args['callback'], $comment, $args, $depth );\n\t\t\t$output .= ob_get_clean();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'comment' === $comment->comment_type ) {\n\t\t\tadd_filter( 'comment_text', array( $this, 'filter_comment_text' ), 40, 2 );\n\t\t}\n\n\t\tif ( ( 'pingback' === $comment->comment_type || 'trackback' === $comment->comment_type ) && $args['short_ping'] ) {\n\t\t\tob_start();\n\t\t\t$this->ping( $comment, $depth, $args );\n\t\t\t$output .= ob_get_clean();\n\t\t} elseif ( 'html5' === $args['format'] ) {\n\t\t\tob_start();\n\t\t\t$this->html5_comment( $comment, $depth, $args );\n\t\t\t$output .= ob_get_clean();\n\t\t} else {\n\t\t\tob_start();\n\t\t\t$this->comment( $comment, $depth, $args );\n\t\t\t$output .= ob_get_clean();\n\t\t}\n\n\t\tif ( 'comment' === $comment->comment_type ) {\n\t\t\tremove_filter( 'comment_text', array( $this, 'filter_comment_text' ), 40, 2 );\n\t\t}\n\t}\n\n\t/**\n\t * Ends the element output, if needed.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @see Walker::end_el()\n\t * @see wp_list_comments()\n\t *\n\t * @param string     $output  Used to append additional content. Passed by reference.\n\t * @param WP_Comment $comment The current comment object. Default current comment.\n\t * @param int        $depth   Optional. Depth of the current comment. Default 0.\n\t * @param array      $args    Optional. An array of arguments. Default empty array.\n\t */\n\tpublic function end_el( &$output, $comment, $depth = 0, $args = array() ) {\n\t\tif ( ! empty( $args['end-callback'] ) ) {\n\t\t\tob_start();\n\t\t\tcall_user_func( $args['end-callback'], $comment, $args, $depth );\n\t\t\t$output .= ob_get_clean();\n\t\t\treturn;\n\t\t}\n\t\tif ( 'div' === $args['style'] ) {\n\t\t\t$output .= \"</div><!-- #comment-## -->\\n\";\n\t\t} else {\n\t\t\t$output .= \"</li><!-- #comment-## -->\\n\";\n\t\t}\n\t}\n\n\t/**\n\t * Outputs a pingback comment.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @see wp_list_comments()\n\t *\n\t * @param WP_Comment $comment The comment object.\n\t * @param int        $depth   Depth of the current comment.\n\t * @param array      $args    An array of arguments.\n\t */\n\tprotected function ping( $comment, $depth, $args ) {\n\t\t$tag = ( 'div' === $args['style'] ) ? 'div' : 'li';\n\t\t?>\n\t\t<<?php echo $tag; ?> id=\"comment-<?php comment_ID(); ?>\" <?php comment_class( '', $comment ); ?>>\n\t\t\t<div class=\"comment-body\">\n\t\t\t\t<?php _e( 'Pingback:' ); ?> <?php comment_author_link( $comment ); ?> <?php edit_comment_link( __( 'Edit' ), '<span class=\"edit-link\">', '</span>' ); ?>\n\t\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Filters the comment text.\n\t *\n\t * Removes links from the pending comment's text if the commenter did not consent\n\t * to the comment cookies.\n\t *\n\t * @since 5.4.2\n\t *\n\t * @param string          $comment_text Text of the current comment.\n\t * @param WP_Comment|null $comment      The comment object. Null if not found.\n\t * @return string Filtered text of the current comment.\n\t */\n\tpublic function filter_comment_text( $comment_text, $comment ) {\n\t\t$commenter          = wp_get_current_commenter();\n\t\t$show_pending_links = ! empty( $commenter['comment_author'] );\n\n\t\tif ( $comment && '0' == $comment->comment_approved && ! $show_pending_links ) {\n\t\t\t$comment_text = wp_kses( $comment_text, array() );\n\t\t}\n\n\t\treturn $comment_text;\n\t}\n\n\t/**\n\t * Outputs a single comment.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @see wp_list_comments()\n\t *\n\t * @param WP_Comment $comment Comment to display.\n\t * @param int        $depth   Depth of the current comment.\n\t * @param array      $args    An array of arguments.\n\t */\n\tprotected function comment( $comment, $depth, $args ) {\n\t\tif ( 'div' === $args['style'] ) {\n\t\t\t$tag       = 'div';\n\t\t\t$add_below = 'comment';\n\t\t} else {\n\t\t\t$tag       = 'li';\n\t\t\t$add_below = 'div-comment';\n\t\t}\n\n\t\t$commenter          = wp_get_current_commenter();\n\t\t$show_pending_links = isset( $commenter['comment_author'] ) && $commenter['comment_author'];\n\n\t\tif ( $commenter['comment_author_email'] ) {\n\t\t\t$moderation_note = __( 'Your comment is awaiting moderation.' );\n\t\t} else {\n\t\t\t$moderation_note = __( 'Your comment is awaiting moderation. This is a preview, your comment will be visible after it has been approved.' );\n\t\t}\n\t\t?>\n\t\t<<?php echo $tag; ?> <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?> id=\"comment-<?php comment_ID(); ?>\">\n\t\t<?php if ( 'div' !== $args['style'] ) : ?>\n\t\t<div id=\"div-comment-<?php comment_ID(); ?>\" class=\"comment-body\">\n\t\t<?php endif; ?>\n\t\t<div class=\"comment-author vcard\">\n\t\t\t<?php\n\t\t\tif ( 0 != $args['avatar_size'] ) {\n\t\t\t\techo get_avatar( $comment, $args['avatar_size'] );\n\t\t\t}\n\t\t\t?>\n\t\t\t<?php\n\t\t\t$comment_author = get_comment_author_link( $comment );\n\n\t\t\tif ( '0' == $comment->comment_approved && ! $show_pending_links ) {\n\t\t\t\t$comment_author = get_comment_author( $comment );\n\t\t\t}\n\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: Comment author link. */\n\t\t\t\t__( '%s <span class=\"says\">says:</span>' ),\n\t\t\t\tsprintf( '<cite class=\"fn\">%s</cite>', $comment_author )\n\t\t\t);\n\t\t\t?>\n\t\t</div>\n\t\t<?php if ( '0' == $comment->comment_approved ) : ?>\n\t\t<em class=\"comment-awaiting-moderation\"><?php echo $moderation_note; ?></em>\n\t\t<br />\n\t\t<?php endif; ?>\n\n\t\t<div class=\"comment-meta commentmetadata\"><a href=\"<?php echo esc_url( get_comment_link( $comment, $args ) ); ?>\">\n\t\t\t<?php\n\t\t\t\t/* translators: 1: Comment date, 2: Comment time. */\n\t\t\t\tprintf( __( '%1$s at %2$s' ), get_comment_date( '', $comment ), get_comment_time() );\n\t\t\t?>\n\t\t\t\t</a>\n\t\t\t\t<?php\n\t\t\t\tedit_comment_link( __( '(Edit)' ), '&nbsp;&nbsp;', '' );\n\t\t\t\t?>\n\t\t</div>\n\n\t\t<?php\n\t\tcomment_text(\n\t\t\t$comment,\n\t\t\tarray_merge(\n\t\t\t\t$args,\n\t\t\t\tarray(\n\t\t\t\t\t'add_below' => $add_below,\n\t\t\t\t\t'depth'     => $depth,\n\t\t\t\t\t'max_depth' => $args['max_depth'],\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t?>\n\n\t\t<?php\n\t\tcomment_reply_link(\n\t\t\tarray_merge(\n\t\t\t\t$args,\n\t\t\t\tarray(\n\t\t\t\t\t'add_below' => $add_below,\n\t\t\t\t\t'depth'     => $depth,\n\t\t\t\t\t'max_depth' => $args['max_depth'],\n\t\t\t\t\t'before'    => '<div class=\"reply\">',\n\t\t\t\t\t'after'     => '</div>',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t?>\n\n\t\t<?php if ( 'div' !== $args['style'] ) : ?>\n\t\t</div>\n\t\t<?php endif; ?>\n\t\t<?php\n\t}\n\n\t/**\n\t * Outputs a comment in the HTML5 format.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @see wp_list_comments()\n\t *\n\t * @param WP_Comment $comment Comment to display.\n\t * @param int        $depth   Depth of the current comment.\n\t * @param array      $args    An array of arguments.\n\t */\n\tprotected function html5_comment( $comment, $depth, $args ) {\n\t\t$tag = ( 'div' === $args['style'] ) ? 'div' : 'li';\n\n\t\t$commenter          = wp_get_current_commenter();\n\t\t$show_pending_links = ! empty( $commenter['comment_author'] );\n\n\t\tif ( $commenter['comment_author_email'] ) {\n\t\t\t$moderation_note = __( 'Your comment is awaiting moderation.' );\n\t\t} else {\n\t\t\t$moderation_note = __( 'Your comment is awaiting moderation. This is a preview, your comment will be visible after it has been approved.' );\n\t\t}\n\t\t?>\n\t\t<<?php echo $tag; ?> id=\"comment-<?php comment_ID(); ?>\" <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?>>\n\t\t\t<article id=\"div-comment-<?php comment_ID(); ?>\" class=\"comment-body\">\n\t\t\t\t<footer class=\"comment-meta\">\n\t\t\t\t\t<div class=\"comment-author vcard\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( 0 != $args['avatar_size'] ) {\n\t\t\t\t\t\t\techo get_avatar( $comment, $args['avatar_size'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$comment_author = get_comment_author_link( $comment );\n\n\t\t\t\t\t\tif ( '0' == $comment->comment_approved && ! $show_pending_links ) {\n\t\t\t\t\t\t\t$comment_author = get_comment_author( $comment );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: Comment author link. */\n\t\t\t\t\t\t\t__( '%s <span class=\"says\">says:</span>' ),\n\t\t\t\t\t\t\tsprintf( '<b class=\"fn\">%s</b>', $comment_author )\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t</div><!-- .comment-author -->\n\n\t\t\t\t\t<div class=\"comment-metadata\">\n\t\t\t\t\t\t<a href=\"<?php echo esc_url( get_comment_link( $comment, $args ) ); ?>\">\n\t\t\t\t\t\t\t<time datetime=\"<?php comment_time( 'c' ); ?>\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t/* translators: 1: Comment date, 2: Comment time. */\n\t\t\t\t\t\t\t\t\tprintf( __( '%1$s at %2$s' ), get_comment_date( '', $comment ), get_comment_time() );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<?php edit_comment_link( __( 'Edit' ), '<span class=\"edit-link\">', '</span>' ); ?>\n\t\t\t\t\t</div><!-- .comment-metadata -->\n\n\t\t\t\t\t<?php if ( '0' == $comment->comment_approved ) : ?>\n\t\t\t\t\t<em class=\"comment-awaiting-moderation\"><?php echo $moderation_note; ?></em>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t</footer><!-- .comment-meta -->\n\n\t\t\t\t<div class=\"comment-content\">\n\t\t\t\t\t<?php comment_text(); ?>\n\t\t\t\t</div><!-- .comment-content -->\n\n\t\t\t\t<?php\n\t\t\t\tif ( '1' == $comment->comment_approved || $show_pending_links ) {\n\t\t\t\t\tcomment_reply_link(\n\t\t\t\t\t\tarray_merge(\n\t\t\t\t\t\t\t$args,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'add_below' => 'div-comment',\n\t\t\t\t\t\t\t\t'depth'     => $depth,\n\t\t\t\t\t\t\t\t'max_depth' => $args['max_depth'],\n\t\t\t\t\t\t\t\t'before'    => '<div class=\"reply\">',\n\t\t\t\t\t\t\t\t'after'     => '</div>',\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\t\t\t\t?>\n\t\t\t</article><!-- .comment-body -->\n\t\t<?php\n\t}\n}\n", "num_lines": 470}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Nav Menu API: Walker_Nav_Menu class\n *\n * @package WordPress\n * @subpackage Nav_Menus\n * @since 4.6.0\n */\n\n/**\n * Core class used to implement an HTML list of nav menu items.\n *\n * @since 3.0.0\n *\n * @see Walker\n */\nclass Walker_Nav_Menu extends Walker {\n\t/**\n\t * What the class handles.\n\t *\n\t * @since 3.0.0\n\t * @var string\n\t *\n\t * @see Walker::$tree_type\n\t */\n\tpublic $tree_type = array( 'post_type', 'taxonomy', 'custom' );\n\n\t/**\n\t * Database fields to use.\n\t *\n\t * @since 3.0.0\n\t * @todo Decouple this.\n\t * @var array\n\t *\n\t * @see Walker::$db_fields\n\t */\n\tpublic $db_fields = array(\n\t\t'parent' => 'menu_item_parent',\n\t\t'id'     => 'db_id',\n\t);\n\n\t/**\n\t * Starts the list before the elements are added.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @see Walker::start_lvl()\n\t *\n\t * @param string   $output Used to append additional content (passed by reference).\n\t * @param int      $depth  Depth of menu item. Used for padding.\n\t * @param stdClass $args   An object of wp_nav_menu() arguments.\n\t */\n\tpublic function start_lvl( &$output, $depth = 0, $args = null ) {\n\t\tif ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {\n\t\t\t$t = '';\n\t\t\t$n = '';\n\t\t} else {\n\t\t\t$t = \"\\t\";\n\t\t\t$n = \"\\n\";\n\t\t}\n\t\t$indent = str_repeat( $t, $depth );\n\n\t\t// Default class.\n\t\t$classes = array( 'sub-menu' );\n\n\t\t/**\n\t\t * Filters the CSS class(es) applied to a menu list element.\n\t\t *\n\t\t * @since 4.8.0\n\t\t *\n\t\t * @param string[] $classes Array of the CSS classes that are applied to the menu `<ul>` element.\n\t\t * @param stdClass $args    An object of `wp_nav_menu()` arguments.\n\t\t * @param int      $depth   Depth of menu item. Used for padding.\n\t\t */\n\t\t$class_names = join( ' ', apply_filters( 'nav_menu_submenu_css_class', $classes, $args, $depth ) );\n\t\t$class_names = $class_names ? ' class=\"' . esc_attr( $class_names ) . '\"' : '';\n\n\t\t$output .= \"{$n}{$indent}<ul$class_names>{$n}\";\n\t}\n\n\t/**\n\t * Ends the list of after the elements are added.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @see Walker::end_lvl()\n\t *\n\t * @param string   $output Used to append additional content (passed by reference).\n\t * @param int      $depth  Depth of menu item. Used for padding.\n\t * @param stdClass $args   An object of wp_nav_menu() arguments.\n\t */\n\tpublic function end_lvl( &$output, $depth = 0, $args = null ) {\n\t\tif ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {\n\t\t\t$t = '';\n\t\t\t$n = '';\n\t\t} else {\n\t\t\t$t = \"\\t\";\n\t\t\t$n = \"\\n\";\n\t\t}\n\t\t$indent  = str_repeat( $t, $depth );\n\t\t$output .= \"$indent</ul>{$n}\";\n\t}\n\n\t/**\n\t * Starts the element output.\n\t *\n\t * @since 3.0.0\n\t * @since 4.4.0 The {@see 'nav_menu_item_args'} filter was added.\n\t *\n\t * @see Walker::start_el()\n\t *\n\t * @param string   $output Used to append additional content (passed by reference).\n\t * @param WP_Post  $item   Menu item data object.\n\t * @param int      $depth  Depth of menu item. Used for padding.\n\t * @param stdClass $args   An object of wp_nav_menu() arguments.\n\t * @param int      $id     Current item ID.\n\t */\n\tpublic function start_el( &$output, $item, $depth = 0, $args = null, $id = 0 ) {\n\t\tif ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {\n\t\t\t$t = '';\n\t\t\t$n = '';\n\t\t} else {\n\t\t\t$t = \"\\t\";\n\t\t\t$n = \"\\n\";\n\t\t}\n\t\t$indent = ( $depth ) ? str_repeat( $t, $depth ) : '';\n\n\t\t$classes   = empty( $item->classes ) ? array() : (array) $item->classes;\n\t\t$classes[] = 'menu-item-' . $item->ID;\n\n\t\t/**\n\t\t * Filters the arguments for a single nav menu item.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param stdClass $args  An object of wp_nav_menu() arguments.\n\t\t * @param WP_Post  $item  Menu item data object.\n\t\t * @param int      $depth Depth of menu item. Used for padding.\n\t\t */\n\t\t$args = apply_filters( 'nav_menu_item_args', $args, $item, $depth );\n\n\t\t/**\n\t\t * Filters the CSS classes applied to a menu item's list item element.\n\t\t *\n\t\t * @since 3.0.0\n\t\t * @since 4.1.0 The `$depth` parameter was added.\n\t\t *\n\t\t * @param string[] $classes Array of the CSS classes that are applied to the menu item's `<li>` element.\n\t\t * @param WP_Post  $item    The current menu item.\n\t\t * @param stdClass $args    An object of wp_nav_menu() arguments.\n\t\t * @param int      $depth   Depth of menu item. Used for padding.\n\t\t */\n\t\t$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args, $depth ) );\n\t\t$class_names = $class_names ? ' class=\"' . esc_attr( $class_names ) . '\"' : '';\n\n\t\t/**\n\t\t * Filters the ID applied to a menu item's list item element.\n\t\t *\n\t\t * @since 3.0.1\n\t\t * @since 4.1.0 The `$depth` parameter was added.\n\t\t *\n\t\t * @param string   $menu_id The ID that is applied to the menu item's `<li>` element.\n\t\t * @param WP_Post  $item    The current menu item.\n\t\t * @param stdClass $args    An object of wp_nav_menu() arguments.\n\t\t * @param int      $depth   Depth of menu item. Used for padding.\n\t\t */\n\t\t$id = apply_filters( 'nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args, $depth );\n\t\t$id = $id ? ' id=\"' . esc_attr( $id ) . '\"' : '';\n\n\t\t$output .= $indent . '<li' . $id . $class_names . '>';\n\n\t\t$atts           = array();\n\t\t$atts['title']  = ! empty( $item->attr_title ) ? $item->attr_title : '';\n\t\t$atts['target'] = ! empty( $item->target ) ? $item->target : '';\n\t\tif ( '_blank' === $item->target && empty( $item->xfn ) ) {\n\t\t\t$atts['rel'] = 'noopener noreferrer';\n\t\t} else {\n\t\t\t$atts['rel'] = $item->xfn;\n\t\t}\n\t\t$atts['href']         = ! empty( $item->url ) ? $item->url : '';\n\t\t$atts['aria-current'] = $item->current ? 'page' : '';\n\n\t\t/**\n\t\t * Filters the HTML attributes applied to a menu item's anchor element.\n\t\t *\n\t\t * @since 3.6.0\n\t\t * @since 4.1.0 The `$depth` parameter was added.\n\t\t *\n\t\t * @param array $atts {\n\t\t *     The HTML attributes applied to the menu item's `<a>` element, empty strings are ignored.\n\t\t *\n\t\t *     @type string $title        Title attribute.\n\t\t *     @type string $target       Target attribute.\n\t\t *     @type string $rel          The rel attribute.\n\t\t *     @type string $href         The href attribute.\n\t\t *     @type string $aria_current The aria-current attribute.\n\t\t * }\n\t\t * @param WP_Post  $item  The current menu item.\n\t\t * @param stdClass $args  An object of wp_nav_menu() arguments.\n\t\t * @param int      $depth Depth of menu item. Used for padding.\n\t\t */\n\t\t$atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args, $depth );\n\n\t\t$attributes = '';\n\t\tforeach ( $atts as $attr => $value ) {\n\t\t\tif ( is_scalar( $value ) && '' !== $value && false !== $value ) {\n\t\t\t\t$value       = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );\n\t\t\t\t$attributes .= ' ' . $attr . '=\"' . $value . '\"';\n\t\t\t}\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t$title = apply_filters( 'the_title', $item->title, $item->ID );\n\n\t\t/**\n\t\t * Filters a menu item's title.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string   $title The menu item's title.\n\t\t * @param WP_Post  $item  The current menu item.\n\t\t * @param stdClass $args  An object of wp_nav_menu() arguments.\n\t\t * @param int      $depth Depth of menu item. Used for padding.\n\t\t */\n\t\t$title = apply_filters( 'nav_menu_item_title', $title, $item, $args, $depth );\n\n\t\t$item_output  = $args->before;\n\t\t$item_output .= '<a' . $attributes . '>';\n\t\t$item_output .= $args->link_before . $title . $args->link_after;\n\t\t$item_output .= '</a>';\n\t\t$item_output .= $args->after;\n\n\t\t/**\n\t\t * Filters a menu item's starting output.\n\t\t *\n\t\t * The menu item's starting output only includes `$args->before`, the opening `<a>`,\n\t\t * the menu item's title, the closing `</a>`, and `$args->after`. Currently, there is\n\t\t * no filter for modifying the opening and closing `<li>` for a menu item.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string   $item_output The menu item's starting HTML output.\n\t\t * @param WP_Post  $item        Menu item data object.\n\t\t * @param int      $depth       Depth of menu item. Used for padding.\n\t\t * @param stdClass $args        An object of wp_nav_menu() arguments.\n\t\t */\n\t\t$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );\n\t}\n\n\t/**\n\t * Ends the element output, if needed.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @see Walker::end_el()\n\t *\n\t * @param string   $output Used to append additional content (passed by reference).\n\t * @param WP_Post  $item   Page data object. Not used.\n\t * @param int      $depth  Depth of page. Not Used.\n\t * @param stdClass $args   An object of wp_nav_menu() arguments.\n\t */\n\tpublic function end_el( &$output, $item, $depth = 0, $args = null ) {\n\t\tif ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {\n\t\t\t$t = '';\n\t\t\t$n = '';\n\t\t} else {\n\t\t\t$t = \"\\t\";\n\t\t\t$n = \"\\n\";\n\t\t}\n\t\t$output .= \"</li>{$n}\";\n\t}\n\n}\n", "num_lines": 274}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Post API: Walker_PageDropdown class\n *\n * @package WordPress\n * @subpackage Post\n * @since 4.4.0\n */\n\n/**\n * Core class used to create an HTML drop-down list of pages.\n *\n * @since 2.1.0\n *\n * @see Walker\n */\nclass Walker_PageDropdown extends Walker {\n\n\t/**\n\t * What the class handles.\n\t *\n\t * @since 2.1.0\n\t * @var string\n\t *\n\t * @see Walker::$tree_type\n\t */\n\tpublic $tree_type = 'page';\n\n\t/**\n\t * Database fields to use.\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t *\n\t * @see Walker::$db_fields\n\t * @todo Decouple this\n\t */\n\tpublic $db_fields = array(\n\t\t'parent' => 'post_parent',\n\t\t'id'     => 'ID',\n\t);\n\n\t/**\n\t * Starts the element output.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @see Walker::start_el()\n\t *\n\t * @param string  $output Used to append additional content. Passed by reference.\n\t * @param WP_Post $page   Page data object.\n\t * @param int     $depth  Optional. Depth of page in reference to parent pages. Used for padding.\n\t *                        Default 0.\n\t * @param array   $args   Optional. Uses 'selected' argument for selected page to set selected HTML\n\t *                        attribute for option element. Uses 'value_field' argument to fill \"value\"\n\t *                        attribute. See wp_dropdown_pages(). Default empty array.\n\t * @param int     $id     Optional. ID of the current page. Default 0 (unused).\n\t */\n\tpublic function start_el( &$output, $page, $depth = 0, $args = array(), $id = 0 ) {\n\t\t$pad = str_repeat( '&nbsp;', $depth * 3 );\n\n\t\tif ( ! isset( $args['value_field'] ) || ! isset( $page->{$args['value_field']} ) ) {\n\t\t\t$args['value_field'] = 'ID';\n\t\t}\n\n\t\t$output .= \"\\t<option class=\\\"level-$depth\\\" value=\\\"\" . esc_attr( $page->{$args['value_field']} ) . '\"';\n\t\tif ( $page->ID == $args['selected'] ) {\n\t\t\t$output .= ' selected=\"selected\"';\n\t\t}\n\t\t$output .= '>';\n\n\t\t$title = $page->post_title;\n\t\tif ( '' === $title ) {\n\t\t\t/* translators: %d: ID of a post. */\n\t\t\t$title = sprintf( __( '#%d (no title)' ), $page->ID );\n\t\t}\n\n\t\t/**\n\t\t * Filters the page title when creating an HTML drop-down list of pages.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string  $title Page title.\n\t\t * @param WP_Post $page  Page data object.\n\t\t */\n\t\t$title = apply_filters( 'list_pages', $title, $page );\n\n\t\t$output .= $pad . esc_html( $title );\n\t\t$output .= \"</option>\\n\";\n\t}\n}\n", "num_lines": 92}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Post API: Walker_Page class\n *\n * @package WordPress\n * @subpackage Template\n * @since 4.4.0\n */\n\n/**\n * Core walker class used to create an HTML list of pages.\n *\n * @since 2.1.0\n *\n * @see Walker\n */\nclass Walker_Page extends Walker {\n\n\t/**\n\t * What the class handles.\n\t *\n\t * @since 2.1.0\n\t * @var string\n\t *\n\t * @see Walker::$tree_type\n\t */\n\tpublic $tree_type = 'page';\n\n\t/**\n\t * Database fields to use.\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t *\n\t * @see Walker::$db_fields\n\t * @todo Decouple this.\n\t */\n\tpublic $db_fields = array(\n\t\t'parent' => 'post_parent',\n\t\t'id'     => 'ID',\n\t);\n\n\t/**\n\t * Outputs the beginning of the current level in the tree before elements are output.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @see Walker::start_lvl()\n\t *\n\t * @param string $output Used to append additional content (passed by reference).\n\t * @param int    $depth  Optional. Depth of page. Used for padding. Default 0.\n\t * @param array  $args   Optional. Arguments for outputting the next level.\n\t *                       Default empty array.\n\t */\n\tpublic function start_lvl( &$output, $depth = 0, $args = array() ) {\n\t\tif ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {\n\t\t\t$t = \"\\t\";\n\t\t\t$n = \"\\n\";\n\t\t} else {\n\t\t\t$t = '';\n\t\t\t$n = '';\n\t\t}\n\t\t$indent  = str_repeat( $t, $depth );\n\t\t$output .= \"{$n}{$indent}<ul class='children'>{$n}\";\n\t}\n\n\t/**\n\t * Outputs the end of the current level in the tree after elements are output.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @see Walker::end_lvl()\n\t *\n\t * @param string $output Used to append additional content (passed by reference).\n\t * @param int    $depth  Optional. Depth of page. Used for padding. Default 0.\n\t * @param array  $args   Optional. Arguments for outputting the end of the current level.\n\t *                       Default empty array.\n\t */\n\tpublic function end_lvl( &$output, $depth = 0, $args = array() ) {\n\t\tif ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {\n\t\t\t$t = \"\\t\";\n\t\t\t$n = \"\\n\";\n\t\t} else {\n\t\t\t$t = '';\n\t\t\t$n = '';\n\t\t}\n\t\t$indent  = str_repeat( $t, $depth );\n\t\t$output .= \"{$indent}</ul>{$n}\";\n\t}\n\n\t/**\n\t * Outputs the beginning of the current element in the tree.\n\t *\n\t * @see Walker::start_el()\n\t * @since 2.1.0\n\t *\n\t * @param string  $output       Used to append additional content. Passed by reference.\n\t * @param WP_Post $page         Page data object.\n\t * @param int     $depth        Optional. Depth of page. Used for padding. Default 0.\n\t * @param array   $args         Optional. Array of arguments. Default empty array.\n\t * @param int     $current_page Optional. Page ID. Default 0.\n\t */\n\tpublic function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) {\n\t\tif ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {\n\t\t\t$t = \"\\t\";\n\t\t\t$n = \"\\n\";\n\t\t} else {\n\t\t\t$t = '';\n\t\t\t$n = '';\n\t\t}\n\t\tif ( $depth ) {\n\t\t\t$indent = str_repeat( $t, $depth );\n\t\t} else {\n\t\t\t$indent = '';\n\t\t}\n\n\t\t$css_class = array( 'page_item', 'page-item-' . $page->ID );\n\n\t\tif ( isset( $args['pages_with_children'][ $page->ID ] ) ) {\n\t\t\t$css_class[] = 'page_item_has_children';\n\t\t}\n\n\t\tif ( ! empty( $current_page ) ) {\n\t\t\t$_current_page = get_post( $current_page );\n\n\t\t\tif ( $_current_page && in_array( $page->ID, $_current_page->ancestors, true ) ) {\n\t\t\t\t$css_class[] = 'current_page_ancestor';\n\t\t\t}\n\n\t\t\tif ( $page->ID == $current_page ) {\n\t\t\t\t$css_class[] = 'current_page_item';\n\t\t\t} elseif ( $_current_page && $page->ID === $_current_page->post_parent ) {\n\t\t\t\t$css_class[] = 'current_page_parent';\n\t\t\t}\n\t\t} elseif ( get_option( 'page_for_posts' ) == $page->ID ) {\n\t\t\t$css_class[] = 'current_page_parent';\n\t\t}\n\n\t\t/**\n\t\t * Filters the list of CSS classes to include with each page item in the list.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @see wp_list_pages()\n\t\t *\n\t\t * @param string[] $css_class    An array of CSS classes to be applied to each list item.\n\t\t * @param WP_Post  $page         Page data object.\n\t\t * @param int      $depth        Depth of page, used for padding.\n\t\t * @param array    $args         An array of arguments.\n\t\t * @param int      $current_page ID of the current page.\n\t\t */\n\t\t$css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) );\n\t\t$css_classes = $css_classes ? ' class=\"' . esc_attr( $css_classes ) . '\"' : '';\n\n\t\tif ( '' === $page->post_title ) {\n\t\t\t/* translators: %d: ID of a post. */\n\t\t\t$page->post_title = sprintf( __( '#%d (no title)' ), $page->ID );\n\t\t}\n\n\t\t$args['link_before'] = empty( $args['link_before'] ) ? '' : $args['link_before'];\n\t\t$args['link_after']  = empty( $args['link_after'] ) ? '' : $args['link_after'];\n\n\t\t$atts                 = array();\n\t\t$atts['href']         = get_permalink( $page->ID );\n\t\t$atts['aria-current'] = ( $page->ID == $current_page ) ? 'page' : '';\n\n\t\t/**\n\t\t * Filters the HTML attributes applied to a page menu item's anchor element.\n\t\t *\n\t\t * @since 4.8.0\n\t\t *\n\t\t * @param array $atts {\n\t\t *     The HTML attributes applied to the menu item's `<a>` element, empty strings are ignored.\n\t\t *\n\t\t *     @type string $href         The href attribute.\n\t\t *     @type string $aria_current The aria-current attribute.\n\t\t * }\n\t\t * @param WP_Post $page         Page data object.\n\t\t * @param int     $depth        Depth of page, used for padding.\n\t\t * @param array   $args         An array of arguments.\n\t\t * @param int     $current_page ID of the current page.\n\t\t */\n\t\t$atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page );\n\n\t\t$attributes = '';\n\t\tforeach ( $atts as $attr => $value ) {\n\t\t\tif ( is_scalar( $value ) && '' !== $value && false !== $value ) {\n\t\t\t\t$value       = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );\n\t\t\t\t$attributes .= ' ' . $attr . '=\"' . $value . '\"';\n\t\t\t}\n\t\t}\n\n\t\t$output .= $indent . sprintf(\n\t\t\t'<li%s><a%s>%s%s%s</a>',\n\t\t\t$css_classes,\n\t\t\t$attributes,\n\t\t\t$args['link_before'],\n\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\tapply_filters( 'the_title', $page->post_title, $page->ID ),\n\t\t\t$args['link_after']\n\t\t);\n\n\t\tif ( ! empty( $args['show_date'] ) ) {\n\t\t\tif ( 'modified' === $args['show_date'] ) {\n\t\t\t\t$time = $page->post_modified;\n\t\t\t} else {\n\t\t\t\t$time = $page->post_date;\n\t\t\t}\n\n\t\t\t$date_format = empty( $args['date_format'] ) ? '' : $args['date_format'];\n\t\t\t$output     .= ' ' . mysql2date( $date_format, $time );\n\t\t}\n\t}\n\n\t/**\n\t * Outputs the end of the current element in the tree.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @see Walker::end_el()\n\t *\n\t * @param string  $output Used to append additional content. Passed by reference.\n\t * @param WP_Post $page   Page data object. Not used.\n\t * @param int     $depth  Optional. Depth of page. Default 0 (unused).\n\t * @param array   $args   Optional. Array of arguments. Default empty array.\n\t */\n\tpublic function end_el( &$output, $page, $depth = 0, $args = array() ) {\n\t\tif ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {\n\t\t\t$t = \"\\t\";\n\t\t\t$n = \"\\n\";\n\t\t} else {\n\t\t\t$t = '';\n\t\t\t$n = '';\n\t\t}\n\t\t$output .= \"</li>{$n}\";\n\t}\n\n}\n", "num_lines": 239}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Toolbar API: WP_Admin_Bar class\n *\n * @package WordPress\n * @subpackage Toolbar\n * @since 3.1.0\n */\n\n/**\n * Core class used to implement the Toolbar API.\n *\n * @since 3.1.0\n */\nclass WP_Admin_Bar {\n\tprivate $nodes = array();\n\tprivate $bound = false;\n\tpublic $user;\n\n\t/**\n\t * @param string $name\n\t * @return string|array|void\n\t */\n\tpublic function __get( $name ) {\n\t\tswitch ( $name ) {\n\t\t\tcase 'proto':\n\t\t\t\treturn is_ssl() ? 'https://' : 'http://';\n\n\t\t\tcase 'menu':\n\t\t\t\t_deprecated_argument( 'WP_Admin_Bar', '3.3.0', 'Modify admin bar nodes with WP_Admin_Bar::get_node(), WP_Admin_Bar::add_node(), and WP_Admin_Bar::remove_node(), not the <code>menu</code> property.' );\n\t\t\t\treturn array(); // Sorry, folks.\n\t\t}\n\t}\n\n\t/**\n\t */\n\tpublic function initialize() {\n\t\t$this->user = new stdClass;\n\n\t\tif ( is_user_logged_in() ) {\n\t\t\t/* Populate settings we need for the menu based on the current user. */\n\t\t\t$this->user->blogs = get_blogs_of_user( get_current_user_id() );\n\t\t\tif ( is_multisite() ) {\n\t\t\t\t$this->user->active_blog    = get_active_blog_for_user( get_current_user_id() );\n\t\t\t\t$this->user->domain         = empty( $this->user->active_blog ) ? user_admin_url() : trailingslashit( get_home_url( $this->user->active_blog->blog_id ) );\n\t\t\t\t$this->user->account_domain = $this->user->domain;\n\t\t\t} else {\n\t\t\t\t$this->user->active_blog    = $this->user->blogs[ get_current_blog_id() ];\n\t\t\t\t$this->user->domain         = trailingslashit( home_url() );\n\t\t\t\t$this->user->account_domain = $this->user->domain;\n\t\t\t}\n\t\t}\n\n\t\tadd_action( 'wp_head', 'wp_admin_bar_header' );\n\n\t\tadd_action( 'admin_head', 'wp_admin_bar_header' );\n\n\t\tif ( current_theme_supports( 'admin-bar' ) ) {\n\t\t\t/**\n\t\t\t * To remove the default padding styles from WordPress for the Toolbar, use the following code:\n\t\t\t * add_theme_support( 'admin-bar', array( 'callback' => '__return_false' ) );\n\t\t\t */\n\t\t\t$admin_bar_args  = get_theme_support( 'admin-bar' );\n\t\t\t$header_callback = $admin_bar_args[0]['callback'];\n\t\t}\n\n\t\tif ( empty( $header_callback ) ) {\n\t\t\t$header_callback = '_admin_bar_bump_cb';\n\t\t}\n\n\t\tadd_action( 'wp_head', $header_callback );\n\n\t\twp_enqueue_script( 'admin-bar' );\n\t\twp_enqueue_style( 'admin-bar' );\n\n\t\t/**\n\t\t * Fires after WP_Admin_Bar is initialized.\n\t\t *\n\t\t * @since 3.1.0\n\t\t */\n\t\tdo_action( 'admin_bar_init' );\n\t}\n\n\t/**\n\t * Add a node (menu item) to the Admin Bar menu.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param array $node The attributes that define the node.\n\t */\n\tpublic function add_menu( $node ) {\n\t\t$this->add_node( $node );\n\t}\n\n\t/**\n\t * Remove a node from the admin bar.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $id The menu slug to remove.\n\t */\n\tpublic function remove_menu( $id ) {\n\t\t$this->remove_node( $id );\n\t}\n\n\t/**\n\t * Adds a node to the menu.\n\t *\n\t * @since 3.1.0\n\t * @since 4.5.0 Added the ability to pass 'lang' and 'dir' meta data.\n\t *\n\t * @param array $args {\n\t *     Arguments for adding a node.\n\t *\n\t *     @type string $id     ID of the item.\n\t *     @type string $title  Title of the node.\n\t *     @type string $parent Optional. ID of the parent node.\n\t *     @type string $href   Optional. Link for the item.\n\t *     @type bool   $group  Optional. Whether or not the node is a group. Default false.\n\t *     @type array  $meta   Meta data including the following keys: 'html', 'class', 'rel', 'lang', 'dir',\n\t *                          'onclick', 'target', 'title', 'tabindex'. Default empty.\n\t * }\n\t */\n\tpublic function add_node( $args ) {\n\t\t// Shim for old method signature: add_node( $parent_id, $menu_obj, $args ).\n\t\tif ( func_num_args() >= 3 && is_string( $args ) ) {\n\t\t\t$args = array_merge( array( 'parent' => $args ), func_get_arg( 2 ) );\n\t\t}\n\n\t\tif ( is_object( $args ) ) {\n\t\t\t$args = get_object_vars( $args );\n\t\t}\n\n\t\t// Ensure we have a valid title.\n\t\tif ( empty( $args['id'] ) ) {\n\t\t\tif ( empty( $args['title'] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_doing_it_wrong( __METHOD__, __( 'The menu ID should not be empty.' ), '3.3.0' );\n\t\t\t// Deprecated: Generate an ID from the title.\n\t\t\t$args['id'] = esc_attr( sanitize_title( trim( $args['title'] ) ) );\n\t\t}\n\n\t\t$defaults = array(\n\t\t\t'id'     => false,\n\t\t\t'title'  => false,\n\t\t\t'parent' => false,\n\t\t\t'href'   => false,\n\t\t\t'group'  => false,\n\t\t\t'meta'   => array(),\n\t\t);\n\n\t\t// If the node already exists, keep any data that isn't provided.\n\t\t$maybe_defaults = $this->get_node( $args['id'] );\n\t\tif ( $maybe_defaults ) {\n\t\t\t$defaults = get_object_vars( $maybe_defaults );\n\t\t}\n\n\t\t// Do the same for 'meta' items.\n\t\tif ( ! empty( $defaults['meta'] ) && ! empty( $args['meta'] ) ) {\n\t\t\t$args['meta'] = wp_parse_args( $args['meta'], $defaults['meta'] );\n\t\t}\n\n\t\t$args = wp_parse_args( $args, $defaults );\n\n\t\t$back_compat_parents = array(\n\t\t\t'my-account-with-avatar' => array( 'my-account', '3.3' ),\n\t\t\t'my-blogs'               => array( 'my-sites', '3.3' ),\n\t\t);\n\n\t\tif ( isset( $back_compat_parents[ $args['parent'] ] ) ) {\n\t\t\tlist( $new_parent, $version ) = $back_compat_parents[ $args['parent'] ];\n\t\t\t_deprecated_argument( __METHOD__, $version, sprintf( 'Use <code>%s</code> as the parent for the <code>%s</code> admin bar node instead of <code>%s</code>.', $new_parent, $args['id'], $args['parent'] ) );\n\t\t\t$args['parent'] = $new_parent;\n\t\t}\n\n\t\t$this->_set_node( $args );\n\t}\n\n\t/**\n\t * @param array $args\n\t */\n\tfinal protected function _set_node( $args ) {\n\t\t$this->nodes[ $args['id'] ] = (object) $args;\n\t}\n\n\t/**\n\t * Gets a node.\n\t *\n\t * @param string $id\n\t * @return object|void Node.\n\t */\n\tfinal public function get_node( $id ) {\n\t\t$node = $this->_get_node( $id );\n\t\tif ( $node ) {\n\t\t\treturn clone $node;\n\t\t}\n\t}\n\n\t/**\n\t * @param string $id\n\t * @return object|void\n\t */\n\tfinal protected function _get_node( $id ) {\n\t\tif ( $this->bound ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( empty( $id ) ) {\n\t\t\t$id = 'root';\n\t\t}\n\n\t\tif ( isset( $this->nodes[ $id ] ) ) {\n\t\t\treturn $this->nodes[ $id ];\n\t\t}\n\t}\n\n\t/**\n\t * @return array|void\n\t */\n\tfinal public function get_nodes() {\n\t\t$nodes = $this->_get_nodes();\n\t\tif ( ! $nodes ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $nodes as &$node ) {\n\t\t\t$node = clone $node;\n\t\t}\n\t\treturn $nodes;\n\t}\n\n\t/**\n\t * @return array|void\n\t */\n\tfinal protected function _get_nodes() {\n\t\tif ( $this->bound ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn $this->nodes;\n\t}\n\n\t/**\n\t * Add a group to a menu node.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param array $args {\n\t *     Array of arguments for adding a group.\n\t *\n\t *     @type string $id     ID of the item.\n\t *     @type string $parent Optional. ID of the parent node. Default 'root'.\n\t *     @type array  $meta   Meta data for the group including the following keys:\n\t *                         'class', 'onclick', 'target', and 'title'.\n\t * }\n\t */\n\tfinal public function add_group( $args ) {\n\t\t$args['group'] = true;\n\n\t\t$this->add_node( $args );\n\t}\n\n\t/**\n\t * Remove a node.\n\t *\n\t * @param string $id The ID of the item.\n\t */\n\tpublic function remove_node( $id ) {\n\t\t$this->_unset_node( $id );\n\t}\n\n\t/**\n\t * @param string $id\n\t */\n\tfinal protected function _unset_node( $id ) {\n\t\tunset( $this->nodes[ $id ] );\n\t}\n\n\t/**\n\t */\n\tpublic function render() {\n\t\t$root = $this->_bind();\n\t\tif ( $root ) {\n\t\t\t$this->_render( $root );\n\t\t}\n\t}\n\n\t/**\n\t * @return object|void\n\t */\n\tfinal protected function _bind() {\n\t\tif ( $this->bound ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add the root node.\n\t\t// Clear it first, just in case. Don't mess with The Root.\n\t\t$this->remove_node( 'root' );\n\t\t$this->add_node(\n\t\t\tarray(\n\t\t\t\t'id'    => 'root',\n\t\t\t\t'group' => false,\n\t\t\t)\n\t\t);\n\n\t\t// Normalize nodes: define internal 'children' and 'type' properties.\n\t\tforeach ( $this->_get_nodes() as $node ) {\n\t\t\t$node->children = array();\n\t\t\t$node->type     = ( $node->group ) ? 'group' : 'item';\n\t\t\tunset( $node->group );\n\n\t\t\t// The Root wants your orphans. No lonely items allowed.\n\t\t\tif ( ! $node->parent ) {\n\t\t\t\t$node->parent = 'root';\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $this->_get_nodes() as $node ) {\n\t\t\tif ( 'root' === $node->id ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Fetch the parent node. If it isn't registered, ignore the node.\n\t\t\t$parent = $this->_get_node( $node->parent );\n\t\t\tif ( ! $parent ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Generate the group class (we distinguish between top level and other level groups).\n\t\t\t$group_class = ( 'root' === $node->parent ) ? 'ab-top-menu' : 'ab-submenu';\n\n\t\t\tif ( 'group' === $node->type ) {\n\t\t\t\tif ( empty( $node->meta['class'] ) ) {\n\t\t\t\t\t$node->meta['class'] = $group_class;\n\t\t\t\t} else {\n\t\t\t\t\t$node->meta['class'] .= ' ' . $group_class;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Items in items aren't allowed. Wrap nested items in 'default' groups.\n\t\t\tif ( 'item' === $parent->type && 'item' === $node->type ) {\n\t\t\t\t$default_id = $parent->id . '-default';\n\t\t\t\t$default    = $this->_get_node( $default_id );\n\n\t\t\t\t// The default group is added here to allow groups that are\n\t\t\t\t// added before standard menu items to render first.\n\t\t\t\tif ( ! $default ) {\n\t\t\t\t\t// Use _set_node because add_node can be overloaded.\n\t\t\t\t\t// Make sure to specify default settings for all properties.\n\t\t\t\t\t$this->_set_node(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id'       => $default_id,\n\t\t\t\t\t\t\t'parent'   => $parent->id,\n\t\t\t\t\t\t\t'type'     => 'group',\n\t\t\t\t\t\t\t'children' => array(),\n\t\t\t\t\t\t\t'meta'     => array(\n\t\t\t\t\t\t\t\t'class' => $group_class,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'title'    => false,\n\t\t\t\t\t\t\t'href'     => false,\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t$default            = $this->_get_node( $default_id );\n\t\t\t\t\t$parent->children[] = $default;\n\t\t\t\t}\n\t\t\t\t$parent = $default;\n\n\t\t\t\t// Groups in groups aren't allowed. Add a special 'container' node.\n\t\t\t\t// The container will invisibly wrap both groups.\n\t\t\t} elseif ( 'group' === $parent->type && 'group' === $node->type ) {\n\t\t\t\t$container_id = $parent->id . '-container';\n\t\t\t\t$container    = $this->_get_node( $container_id );\n\n\t\t\t\t// We need to create a container for this group, life is sad.\n\t\t\t\tif ( ! $container ) {\n\t\t\t\t\t// Use _set_node because add_node can be overloaded.\n\t\t\t\t\t// Make sure to specify default settings for all properties.\n\t\t\t\t\t$this->_set_node(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id'       => $container_id,\n\t\t\t\t\t\t\t'type'     => 'container',\n\t\t\t\t\t\t\t'children' => array( $parent ),\n\t\t\t\t\t\t\t'parent'   => false,\n\t\t\t\t\t\t\t'title'    => false,\n\t\t\t\t\t\t\t'href'     => false,\n\t\t\t\t\t\t\t'meta'     => array(),\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$container = $this->_get_node( $container_id );\n\n\t\t\t\t\t// Link the container node if a grandparent node exists.\n\t\t\t\t\t$grandparent = $this->_get_node( $parent->parent );\n\n\t\t\t\t\tif ( $grandparent ) {\n\t\t\t\t\t\t$container->parent = $grandparent->id;\n\n\t\t\t\t\t\t$index = array_search( $parent, $grandparent->children, true );\n\t\t\t\t\t\tif ( false === $index ) {\n\t\t\t\t\t\t\t$grandparent->children[] = $container;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tarray_splice( $grandparent->children, $index, 1, array( $container ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$parent->parent = $container->id;\n\t\t\t\t}\n\n\t\t\t\t$parent = $container;\n\t\t\t}\n\n\t\t\t// Update the parent ID (it might have changed).\n\t\t\t$node->parent = $parent->id;\n\n\t\t\t// Add the node to the tree.\n\t\t\t$parent->children[] = $node;\n\t\t}\n\n\t\t$root        = $this->_get_node( 'root' );\n\t\t$this->bound = true;\n\t\treturn $root;\n\t}\n\n\t/**\n\t * @param object $root\n\t */\n\tfinal protected function _render( $root ) {\n\t\t// Add browser classes.\n\t\t// We have to do this here since admin bar shows on the front end.\n\t\t$class = 'nojq nojs';\n\t\tif ( wp_is_mobile() ) {\n\t\t\t$class .= ' mobile';\n\t\t}\n\n\t\t?>\n\t\t<div id=\"wpadminbar\" class=\"<?php echo $class; ?>\">\n\t\t\t<?php if ( ! is_admin() ) { ?>\n\t\t\t\t<a class=\"screen-reader-shortcut\" href=\"#wp-toolbar\" tabindex=\"1\"><?php _e( 'Skip to toolbar' ); ?></a>\n\t\t\t<?php } ?>\n\t\t\t<div class=\"quicklinks\" id=\"wp-toolbar\" role=\"navigation\" aria-label=\"<?php esc_attr_e( 'Toolbar' ); ?>\">\n\t\t\t\t<?php\n\t\t\t\tforeach ( $root->children as $group ) {\n\t\t\t\t\t$this->_render_group( $group );\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<?php if ( is_user_logged_in() ) : ?>\n\t\t\t<a class=\"screen-reader-shortcut\" href=\"<?php echo esc_url( wp_logout_url() ); ?>\"><?php _e( 'Log Out' ); ?></a>\n\t\t\t<?php endif; ?>\n\t\t</div>\n\n\t\t<?php\n\t}\n\n\t/**\n\t * @param object $node\n\t */\n\tfinal protected function _render_container( $node ) {\n\t\tif ( 'container' !== $node->type || empty( $node->children ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo '<div id=\"' . esc_attr( 'wp-admin-bar-' . $node->id ) . '\" class=\"ab-group-container\">';\n\t\tforeach ( $node->children as $group ) {\n\t\t\t$this->_render_group( $group );\n\t\t}\n\t\techo '</div>';\n\t}\n\n\t/**\n\t * @param object $node\n\t */\n\tfinal protected function _render_group( $node ) {\n\t\tif ( 'container' === $node->type ) {\n\t\t\t$this->_render_container( $node );\n\t\t\treturn;\n\t\t}\n\t\tif ( 'group' !== $node->type || empty( $node->children ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! empty( $node->meta['class'] ) ) {\n\t\t\t$class = ' class=\"' . esc_attr( trim( $node->meta['class'] ) ) . '\"';\n\t\t} else {\n\t\t\t$class = '';\n\t\t}\n\n\t\techo \"<ul id='\" . esc_attr( 'wp-admin-bar-' . $node->id ) . \"'$class>\";\n\t\tforeach ( $node->children as $item ) {\n\t\t\t$this->_render_item( $item );\n\t\t}\n\t\techo '</ul>';\n\t}\n\n\t/**\n\t * @param object $node\n\t */\n\tfinal protected function _render_item( $node ) {\n\t\tif ( 'item' !== $node->type ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$is_parent             = ! empty( $node->children );\n\t\t$has_link              = ! empty( $node->href );\n\t\t$is_root_top_item      = 'root-default' === $node->parent;\n\t\t$is_top_secondary_item = 'top-secondary' === $node->parent;\n\n\t\t// Allow only numeric values, then casted to integers, and allow a tabindex value of `0` for a11y.\n\t\t$tabindex        = ( isset( $node->meta['tabindex'] ) && is_numeric( $node->meta['tabindex'] ) ) ? (int) $node->meta['tabindex'] : '';\n\t\t$aria_attributes = ( '' !== $tabindex ) ? ' tabindex=\"' . $tabindex . '\"' : '';\n\n\t\t$menuclass = '';\n\t\t$arrow     = '';\n\n\t\tif ( $is_parent ) {\n\t\t\t$menuclass        = 'menupop ';\n\t\t\t$aria_attributes .= ' aria-haspopup=\"true\"';\n\t\t}\n\n\t\tif ( ! empty( $node->meta['class'] ) ) {\n\t\t\t$menuclass .= $node->meta['class'];\n\t\t}\n\n\t\t// Print the arrow icon for the menu children with children.\n\t\tif ( ! $is_root_top_item && ! $is_top_secondary_item && $is_parent ) {\n\t\t\t$arrow = '<span class=\"wp-admin-bar-arrow\" aria-hidden=\"true\"></span>';\n\t\t}\n\n\t\tif ( $menuclass ) {\n\t\t\t$menuclass = ' class=\"' . esc_attr( trim( $menuclass ) ) . '\"';\n\t\t}\n\n\t\techo \"<li id='\" . esc_attr( 'wp-admin-bar-' . $node->id ) . \"'$menuclass>\";\n\n\t\tif ( $has_link ) {\n\t\t\t$attributes = array( 'onclick', 'target', 'title', 'rel', 'lang', 'dir' );\n\t\t\techo \"<a class='ab-item'$aria_attributes href='\" . esc_url( $node->href ) . \"'\";\n\t\t} else {\n\t\t\t$attributes = array( 'onclick', 'target', 'title', 'rel', 'lang', 'dir' );\n\t\t\techo '<div class=\"ab-item ab-empty-item\"' . $aria_attributes;\n\t\t}\n\n\t\tforeach ( $attributes as $attribute ) {\n\t\t\tif ( empty( $node->meta[ $attribute ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( 'onclick' === $attribute ) {\n\t\t\t\techo \" $attribute='\" . esc_js( $node->meta[ $attribute ] ) . \"'\";\n\t\t\t} else {\n\t\t\t\techo \" $attribute='\" . esc_attr( $node->meta[ $attribute ] ) . \"'\";\n\t\t\t}\n\t\t}\n\n\t\techo \">{$arrow}{$node->title}\";\n\n\t\tif ( $has_link ) {\n\t\t\techo '</a>';\n\t\t} else {\n\t\t\techo '</div>';\n\t\t}\n\n\t\tif ( $is_parent ) {\n\t\t\techo '<div class=\"ab-sub-wrapper\">';\n\t\t\tforeach ( $node->children as $group ) {\n\t\t\t\t$this->_render_group( $group );\n\t\t\t}\n\t\t\techo '</div>';\n\t\t}\n\n\t\tif ( ! empty( $node->meta['html'] ) ) {\n\t\t\techo $node->meta['html'];\n\t\t}\n\n\t\techo '</li>';\n\t}\n\n\t/**\n\t * Renders toolbar items recursively.\n\t *\n\t * @since 3.1.0\n\t * @deprecated 3.3.0 Use WP_Admin_Bar::_render_item() or WP_Admin_bar::render() instead.\n\t * @see WP_Admin_Bar::_render_item()\n\t * @see WP_Admin_Bar::render()\n\t *\n\t * @param string $id    Unused.\n\t * @param object $node\n\t */\n\tpublic function recursive_render( $id, $node ) {\n\t\t_deprecated_function( __METHOD__, '3.3.0', 'WP_Admin_bar::render(), WP_Admin_Bar::_render_item()' );\n\t\t$this->_render_item( $node );\n\t}\n\n\t/**\n\t */\n\tpublic function add_menus() {\n\t\t// User-related, aligned right.\n\t\tadd_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 0 );\n\t\tadd_action( 'admin_bar_menu', 'wp_admin_bar_search_menu', 4 );\n\t\tadd_action( 'admin_bar_menu', 'wp_admin_bar_my_account_item', 7 );\n\t\tadd_action( 'admin_bar_menu', 'wp_admin_bar_recovery_mode_menu', 8 );\n\n\t\t// Site-related.\n\t\tadd_action( 'admin_bar_menu', 'wp_admin_bar_sidebar_toggle', 0 );\n\t\tadd_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu', 10 );\n\t\tadd_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 );\n\t\tadd_action( 'admin_bar_menu', 'wp_admin_bar_site_menu', 30 );\n\t\tadd_action( 'admin_bar_menu', 'wp_admin_bar_customize_menu', 40 );\n\t\tadd_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 50 );\n\n\t\t// Content-related.\n\t\tif ( ! is_network_admin() && ! is_user_admin() ) {\n\t\t\tadd_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 );\n\t\t\tadd_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 70 );\n\t\t}\n\t\tadd_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 );\n\n\t\tadd_action( 'admin_bar_menu', 'wp_admin_bar_add_secondary_groups', 200 );\n\n\t\t/**\n\t\t * Fires after menus are added to the menu bar.\n\t\t *\n\t\t * @since 3.1.0\n\t\t */\n\t\tdo_action( 'add_admin_bar_menus' );\n\t}\n}\n", "num_lines": 630}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Send XML response back to Ajax request.\n *\n * @package WordPress\n * @since 2.1.0\n */\nclass WP_Ajax_Response {\n\t/**\n\t * Store XML responses to send.\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t */\n\tpublic $responses = array();\n\n\t/**\n\t * Constructor - Passes args to WP_Ajax_Response::add().\n\t *\n\t * @since 2.1.0\n\t *\n\t * @see WP_Ajax_Response::add()\n\t *\n\t * @param string|array $args Optional. Will be passed to add() method.\n\t */\n\tpublic function __construct( $args = '' ) {\n\t\tif ( ! empty( $args ) ) {\n\t\t\t$this->add( $args );\n\t\t}\n\t}\n\n\t/**\n\t * Appends data to an XML response based on given arguments.\n\t *\n\t * With `$args` defaults, extra data output would be:\n\t *\n\t *     <response action='{$action}_$id'>\n\t *      <$what id='$id' position='$position'>\n\t *          <response_data><![CDATA[$data]]></response_data>\n\t *      </$what>\n\t *     </response>\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string|array $args {\n\t *     Optional. An array or string of XML response arguments.\n\t *\n\t *     @type string          $what         XML-RPC response type. Used as a child element of `<response>`.\n\t *                                         Default 'object' (`<object>`).\n\t *     @type string|false    $action       Value to use for the `action` attribute in `<response>`. Will be\n\t *                                         appended with `_$id` on output. If false, `$action` will default to\n\t *                                         the value of `$_POST['action']`. Default false.\n\t *     @type int|WP_Error    $id           The response ID, used as the response type `id` attribute. Also\n\t *                                         accepts a `WP_Error` object if the ID does not exist. Default 0.\n\t *     @type int|false       $old_id       The previous response ID. Used as the value for the response type\n\t *                                         `old_id` attribute. False hides the attribute. Default false.\n\t *     @type string          $position     Value of the response type `position` attribute. Accepts 1 (bottom),\n\t *                                         -1 (top), HTML ID (after), or -HTML ID (before). Default 1 (bottom).\n\t *     @type string|WP_Error $data         The response content/message. Also accepts a WP_Error object if the\n\t *                                         ID does not exist. Default empty.\n\t *     @type array           $supplemental An array of extra strings that will be output within a `<supplemental>`\n\t *                                         element as CDATA. Default empty array.\n\t * }\n\t * @return string XML response.\n\t */\n\tpublic function add( $args = '' ) {\n\t\t$defaults = array(\n\t\t\t'what'         => 'object',\n\t\t\t'action'       => false,\n\t\t\t'id'           => '0',\n\t\t\t'old_id'       => false,\n\t\t\t'position'     => 1,\n\t\t\t'data'         => '',\n\t\t\t'supplemental' => array(),\n\t\t);\n\n\t\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t\t$position = preg_replace( '/[^a-z0-9:_-]/i', '', $parsed_args['position'] );\n\t\t$id       = $parsed_args['id'];\n\t\t$what     = $parsed_args['what'];\n\t\t$action   = $parsed_args['action'];\n\t\t$old_id   = $parsed_args['old_id'];\n\t\t$data     = $parsed_args['data'];\n\n\t\tif ( is_wp_error( $id ) ) {\n\t\t\t$data = $id;\n\t\t\t$id   = 0;\n\t\t}\n\n\t\t$response = '';\n\t\tif ( is_wp_error( $data ) ) {\n\t\t\tforeach ( (array) $data->get_error_codes() as $code ) {\n\t\t\t\t$response  .= \"<wp_error code='$code'><![CDATA[\" . $data->get_error_message( $code ) . ']]></wp_error>';\n\t\t\t\t$error_data = $data->get_error_data( $code );\n\t\t\t\tif ( ! $error_data ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$class = '';\n\t\t\t\tif ( is_object( $error_data ) ) {\n\t\t\t\t\t$class      = ' class=\"' . get_class( $error_data ) . '\"';\n\t\t\t\t\t$error_data = get_object_vars( $error_data );\n\t\t\t\t}\n\n\t\t\t\t$response .= \"<wp_error_data code='$code'$class>\";\n\n\t\t\t\tif ( is_scalar( $error_data ) ) {\n\t\t\t\t\t$response .= \"<![CDATA[$error_data]]>\";\n\t\t\t\t} elseif ( is_array( $error_data ) ) {\n\t\t\t\t\tforeach ( $error_data as $k => $v ) {\n\t\t\t\t\t\t$response .= \"<$k><![CDATA[$v]]></$k>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$response .= '</wp_error_data>';\n\t\t\t}\n\t\t} else {\n\t\t\t$response = \"<response_data><![CDATA[$data]]></response_data>\";\n\t\t}\n\n\t\t$s = '';\n\t\tif ( is_array( $parsed_args['supplemental'] ) ) {\n\t\t\tforeach ( $parsed_args['supplemental'] as $k => $v ) {\n\t\t\t\t$s .= \"<$k><![CDATA[$v]]></$k>\";\n\t\t\t}\n\t\t\t$s = \"<supplemental>$s</supplemental>\";\n\t\t}\n\n\t\tif ( false === $action ) {\n\t\t\t$action = $_POST['action'];\n\t\t}\n\t\t$x  = '';\n\t\t$x .= \"<response action='{$action}_$id'>\"; // The action attribute in the xml output is formatted like a nonce action.\n\t\t$x .= \"<$what id='$id' \" . ( false === $old_id ? '' : \"old_id='$old_id' \" ) . \"position='$position'>\";\n\t\t$x .= $response;\n\t\t$x .= $s;\n\t\t$x .= \"</$what>\";\n\t\t$x .= '</response>';\n\n\t\t$this->responses[] = $x;\n\t\treturn $x;\n\t}\n\n\t/**\n\t * Display XML formatted responses.\n\t *\n\t * Sets the content type header to text/xml.\n\t *\n\t * @since 2.1.0\n\t */\n\tpublic function send() {\n\t\theader( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ) );\n\t\techo \"<?xml version='1.0' encoding='\" . get_option( 'blog_charset' ) . \"' standalone='yes'?><wp_ajax>\";\n\t\tforeach ( (array) $this->responses as $response ) {\n\t\t\techo $response;\n\t\t}\n\t\techo '</wp_ajax>';\n\t\tif ( wp_doing_ajax() ) {\n\t\t\twp_die();\n\t\t} else {\n\t\t\tdie();\n\t\t}\n\t}\n}\n", "num_lines": 165}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Blocks API: WP_Block_List class\n *\n * @package WordPress\n * @since 5.5.0\n */\n\n/**\n * Class representing a list of block instances.\n *\n * @since 5.5.0\n */\nclass WP_Block_List implements Iterator, ArrayAccess, Countable {\n\n\t/**\n\t * Original array of parsed block data, or block instances.\n\t *\n\t * @since 5.5.0\n\t * @var array[]|WP_Block[]\n\t * @access protected\n\t */\n\tprotected $blocks;\n\n\t/**\n\t * All available context of the current hierarchy.\n\t *\n\t * @since 5.5.0\n\t * @var array\n\t * @access protected\n\t */\n\tprotected $available_context;\n\n\t/**\n\t * Block type registry to use in constructing block instances.\n\t *\n\t * @since 5.5.0\n\t * @var WP_Block_Type_Registry\n\t * @access protected\n\t */\n\tprotected $registry;\n\n\t/**\n\t * Constructor.\n\t *\n\t * Populates object properties from the provided block instance argument.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param array[]|WP_Block[]     $blocks            Array of parsed block data, or block instances.\n\t * @param array                  $available_context Optional array of ancestry context values.\n\t * @param WP_Block_Type_Registry $registry          Optional block type registry.\n\t */\n\tpublic function __construct( $blocks, $available_context = array(), $registry = null ) {\n\t\tif ( ! $registry instanceof WP_Block_Type_Registry ) {\n\t\t\t$registry = WP_Block_Type_Registry::get_instance();\n\t\t}\n\n\t\t$this->blocks            = $blocks;\n\t\t$this->available_context = $available_context;\n\t\t$this->registry          = $registry;\n\t}\n\n\t/**\n\t * Returns true if a block exists by the specified block index, or false\n\t * otherwise.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @link https://www.php.net/manual/en/arrayaccess.offsetexists.php\n\t *\n\t * @param string $index Index of block to check.\n\t * @return bool Whether block exists.\n\t */\n\tpublic function offsetExists( $index ) {\n\t\treturn isset( $this->blocks[ $index ] );\n\t}\n\n\t/**\n\t * Returns the value by the specified block index.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @link https://www.php.net/manual/en/arrayaccess.offsetget.php\n\t *\n\t * @param string $index Index of block value to retrieve.\n\t * @return mixed|null Block value if exists, or null.\n\t */\n\tpublic function offsetGet( $index ) {\n\t\t$block = $this->blocks[ $index ];\n\n\t\tif ( isset( $block ) && is_array( $block ) ) {\n\t\t\t$block                  = new WP_Block( $block, $this->available_context, $this->registry );\n\t\t\t$this->blocks[ $index ] = $block;\n\t\t}\n\n\t\treturn $block;\n\t}\n\n\t/**\n\t * Assign a block value by the specified block index.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @link https://www.php.net/manual/en/arrayaccess.offsetset.php\n\t *\n\t * @param string $index Index of block value to set.\n\t * @param mixed  $value Block value.\n\t */\n\tpublic function offsetSet( $index, $value ) {\n\t\tif ( is_null( $index ) ) {\n\t\t\t$this->blocks[] = $value;\n\t\t} else {\n\t\t\t$this->blocks[ $index ] = $value;\n\t\t}\n\t}\n\n\t/**\n\t * Unset a block.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @link https://www.php.net/manual/en/arrayaccess.offsetunset.php\n\t *\n\t * @param string $index Index of block value to unset.\n\t */\n\tpublic function offsetUnset( $index ) {\n\t\tunset( $this->blocks[ $index ] );\n\t}\n\n\t/**\n\t * Rewinds back to the first element of the Iterator.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @link https://www.php.net/manual/en/iterator.rewind.php\n\t */\n\tpublic function rewind() {\n\t\treset( $this->blocks );\n\t}\n\n\t/**\n\t * Returns the current element of the block list.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @link https://www.php.net/manual/en/iterator.current.php\n\t *\n\t * @return mixed Current element.\n\t */\n\tpublic function current() {\n\t\treturn $this->offsetGet( $this->key() );\n\t}\n\n\t/**\n\t * Returns the key of the current element of the block list.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @link https://www.php.net/manual/en/iterator.key.php\n\t *\n\t * @return mixed Key of the current element.\n\t */\n\tpublic function key() {\n\t\treturn key( $this->blocks );\n\t}\n\n\t/**\n\t * Moves the current position of the block list to the next element.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @link https://www.php.net/manual/en/iterator.next.php\n\t */\n\tpublic function next() {\n\t\tnext( $this->blocks );\n\t}\n\n\t/**\n\t * Checks if current position is valid.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @link https://www.php.net/manual/en/iterator.valid.php\n\t */\n\tpublic function valid() {\n\t\treturn null !== key( $this->blocks );\n\t}\n\n\t/**\n\t * Returns the count of blocks in the list.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @link https://www.php.net/manual/en/countable.count.php\n\t *\n\t * @return int Block count.\n\t */\n\tpublic function count() {\n\t\treturn count( $this->blocks );\n\t}\n\n}\n", "num_lines": 204}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Block Serialization Parser\n *\n * @package WordPress\n */\n\n/**\n * Class WP_Block_Parser_Block\n *\n * Holds the block structure in memory\n *\n * @since 3.8.0\n */\nclass WP_Block_Parser_Block {\n\t/**\n\t * Name of block\n\t *\n\t * @example \"core/paragraph\"\n\t *\n\t * @since 3.8.0\n\t * @var string\n\t */\n\tpublic $blockName;\n\n\t/**\n\t * Optional set of attributes from block comment delimiters\n\t *\n\t * @example null\n\t * @example array( 'columns' => 3 )\n\t *\n\t * @since 3.8.0\n\t * @var array|null\n\t */\n\tpublic $attrs;\n\n\t/**\n\t * List of inner blocks (of this same class)\n\t *\n\t * @since 3.8.0\n\t * @var WP_Block_Parser_Block[]\n\t */\n\tpublic $innerBlocks;\n\n\t/**\n\t * Resultant HTML from inside block comment delimiters\n\t * after removing inner blocks\n\t *\n\t * @example \"...Just <!-- wp:test /--> testing...\" -> \"Just testing...\"\n\t *\n\t * @since 3.8.0\n\t * @var string\n\t */\n\tpublic $innerHTML;\n\n\t/**\n\t * List of string fragments and null markers where inner blocks were found\n\t *\n\t * @example array(\n\t *   'innerHTML'    => 'BeforeInnerAfter',\n\t *   'innerBlocks'  => array( block, block ),\n\t *   'innerContent' => array( 'Before', null, 'Inner', null, 'After' ),\n\t * )\n\t *\n\t * @since 4.2.0\n\t * @var array\n\t */\n\tpublic $innerContent;\n\n\t/**\n\t * Constructor.\n\t *\n\t * Will populate object properties from the provided arguments.\n\t *\n\t * @since 3.8.0\n\t *\n\t * @param string $name         Name of block.\n\t * @param array  $attrs        Optional set of attributes from block comment delimiters.\n\t * @param array  $innerBlocks  List of inner blocks (of this same class).\n\t * @param string $innerHTML    Resultant HTML from inside block comment delimiters after removing inner blocks.\n\t * @param array  $innerContent List of string fragments and null markers where inner blocks were found.\n\t */\n\tfunction __construct( $name, $attrs, $innerBlocks, $innerHTML, $innerContent ) {\n\t\t$this->blockName    = $name;\n\t\t$this->attrs        = $attrs;\n\t\t$this->innerBlocks  = $innerBlocks;\n\t\t$this->innerHTML    = $innerHTML;\n\t\t$this->innerContent = $innerContent;\n\t}\n}\n\n/**\n * Class WP_Block_Parser_Frame\n *\n * Holds partial blocks in memory while parsing\n *\n * @internal\n * @since 3.8.0\n */\nclass WP_Block_Parser_Frame {\n\t/**\n\t * Full or partial block\n\t *\n\t * @since 3.8.0\n\t * @var WP_Block_Parser_Block\n\t */\n\tpublic $block;\n\n\t/**\n\t * Byte offset into document for start of parse token\n\t *\n\t * @since 3.8.0\n\t * @var int\n\t */\n\tpublic $token_start;\n\n\t/**\n\t * Byte length of entire parse token string\n\t *\n\t * @since 3.8.0\n\t * @var int\n\t */\n\tpublic $token_length;\n\n\t/**\n\t * Byte offset into document for after parse token ends\n\t * (used during reconstruction of stack into parse production)\n\t *\n\t * @since 3.8.0\n\t * @var int\n\t */\n\tpublic $prev_offset;\n\n\t/**\n\t * Byte offset into document where leading HTML before token starts\n\t *\n\t * @since 3.8.0\n\t * @var int\n\t */\n\tpublic $leading_html_start;\n\n\t/**\n\t * Constructor\n\t *\n\t * Will populate object properties from the provided arguments.\n\t *\n\t * @since 3.8.0\n\t *\n\t * @param WP_Block_Parser_Block $block              Full or partial block.\n\t * @param int                   $token_start        Byte offset into document for start of parse token.\n\t * @param int                   $token_length       Byte length of entire parse token string.\n\t * @param int                   $prev_offset        Byte offset into document for after parse token ends.\n\t * @param int                   $leading_html_start Byte offset into document where leading HTML before token starts.\n\t */\n\tfunction __construct( $block, $token_start, $token_length, $prev_offset = null, $leading_html_start = null ) {\n\t\t$this->block              = $block;\n\t\t$this->token_start        = $token_start;\n\t\t$this->token_length       = $token_length;\n\t\t$this->prev_offset        = isset( $prev_offset ) ? $prev_offset : $token_start + $token_length;\n\t\t$this->leading_html_start = $leading_html_start;\n\t}\n}\n\n/**\n * Class WP_Block_Parser\n *\n * Parses a document and constructs a list of parsed block objects\n *\n * @since 3.8.0\n * @since 4.0.0 returns arrays not objects, all attributes are arrays\n */\nclass WP_Block_Parser {\n\t/**\n\t * Input document being parsed\n\t *\n\t * @example \"Pre-text\\n<!-- wp:paragraph -->This is inside a block!<!-- /wp:paragraph -->\"\n\t *\n\t * @since 3.8.0\n\t * @var string\n\t */\n\tpublic $document;\n\n\t/**\n\t * Tracks parsing progress through document\n\t *\n\t * @since 3.8.0\n\t * @var int\n\t */\n\tpublic $offset;\n\n\t/**\n\t * List of parsed blocks\n\t *\n\t * @since 3.8.0\n\t * @var WP_Block_Parser_Block[]\n\t */\n\tpublic $output;\n\n\t/**\n\t * Stack of partially-parsed structures in memory during parse\n\t *\n\t * @since 3.8.0\n\t * @var WP_Block_Parser_Frame[]\n\t */\n\tpublic $stack;\n\n\t/**\n\t * Empty associative array, here due to PHP quirks\n\t *\n\t * @since 4.4.0\n\t * @var array empty associative array\n\t */\n\tpublic $empty_attrs;\n\n\t/**\n\t * Parses a document and returns a list of block structures\n\t *\n\t * When encountering an invalid parse will return a best-effort\n\t * parse. In contrast to the specification parser this does not\n\t * return an error on invalid inputs.\n\t *\n\t * @since 3.8.0\n\t *\n\t * @param string $document Input document being parsed.\n\t * @return WP_Block_Parser_Block[]\n\t */\n\tfunction parse( $document ) {\n\t\t$this->document    = $document;\n\t\t$this->offset      = 0;\n\t\t$this->output      = array();\n\t\t$this->stack       = array();\n\t\t$this->empty_attrs = json_decode( '{}', true );\n\n\t\tdo {\n\t\t\t// twiddle our thumbs.\n\t\t} while ( $this->proceed() );\n\n\t\treturn $this->output;\n\t}\n\n\t/**\n\t * Processes the next token from the input document\n\t * and returns whether to proceed eating more tokens\n\t *\n\t * This is the \"next step\" function that essentially\n\t * takes a token as its input and decides what to do\n\t * with that token before descending deeper into a\n\t * nested block tree or continuing along the document\n\t * or breaking out of a level of nesting.\n\t *\n\t * @internal\n\t * @since 3.8.0\n\t * @return bool\n\t */\n\tfunction proceed() {\n\t\t$next_token = $this->next_token();\n\t\tlist( $token_type, $block_name, $attrs, $start_offset, $token_length ) = $next_token;\n\t\t$stack_depth = count( $this->stack );\n\n\t\t// we may have some HTML soup before the next block.\n\t\t$leading_html_start = $start_offset > $this->offset ? $this->offset : null;\n\n\t\tswitch ( $token_type ) {\n\t\t\tcase 'no-more-tokens':\n\t\t\t\t// if not in a block then flush output.\n\t\t\t\tif ( 0 === $stack_depth ) {\n\t\t\t\t\t$this->add_freeform();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * Otherwise we have a problem\n\t\t\t\t * This is an error\n\t\t\t\t *\n\t\t\t\t * we have options\n\t\t\t\t * - treat it all as freeform text\n\t\t\t\t * - assume an implicit closer (easiest when not nesting)\n\t\t\t\t */\n\n\t\t\t\t// for the easy case we'll assume an implicit closer.\n\t\t\t\tif ( 1 === $stack_depth ) {\n\t\t\t\t\t$this->add_block_from_stack();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * for the nested case where it's more difficult we'll\n\t\t\t\t * have to assume that multiple closers are missing\n\t\t\t\t * and so we'll collapse the whole stack piecewise\n\t\t\t\t */\n\t\t\t\twhile ( 0 < count( $this->stack ) ) {\n\t\t\t\t\t$this->add_block_from_stack();\n\t\t\t\t}\n\t\t\t\treturn false;\n\n\t\t\tcase 'void-block':\n\t\t\t\t/*\n\t\t\t\t * easy case is if we stumbled upon a void block\n\t\t\t\t * in the top-level of the document\n\t\t\t\t */\n\t\t\t\tif ( 0 === $stack_depth ) {\n\t\t\t\t\tif ( isset( $leading_html_start ) ) {\n\t\t\t\t\t\t$this->output[] = (array) self::freeform(\n\t\t\t\t\t\t\tsubstr(\n\t\t\t\t\t\t\t\t$this->document,\n\t\t\t\t\t\t\t\t$leading_html_start,\n\t\t\t\t\t\t\t\t$start_offset - $leading_html_start\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->output[] = (array) new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() );\n\t\t\t\t\t$this->offset   = $start_offset + $token_length;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\t// otherwise we found an inner block.\n\t\t\t\t$this->add_inner_block(\n\t\t\t\t\tnew WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ),\n\t\t\t\t\t$start_offset,\n\t\t\t\t\t$token_length\n\t\t\t\t);\n\t\t\t\t$this->offset = $start_offset + $token_length;\n\t\t\t\treturn true;\n\n\t\t\tcase 'block-opener':\n\t\t\t\t// track all newly-opened blocks on the stack.\n\t\t\t\tarray_push(\n\t\t\t\t\t$this->stack,\n\t\t\t\t\tnew WP_Block_Parser_Frame(\n\t\t\t\t\t\tnew WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ),\n\t\t\t\t\t\t$start_offset,\n\t\t\t\t\t\t$token_length,\n\t\t\t\t\t\t$start_offset + $token_length,\n\t\t\t\t\t\t$leading_html_start\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$this->offset = $start_offset + $token_length;\n\t\t\t\treturn true;\n\n\t\t\tcase 'block-closer':\n\t\t\t\t/*\n\t\t\t\t * if we're missing an opener we're in trouble\n\t\t\t\t * This is an error\n\t\t\t\t */\n\t\t\t\tif ( 0 === $stack_depth ) {\n\t\t\t\t\t/*\n\t\t\t\t\t * we have options\n\t\t\t\t\t * - assume an implicit opener\n\t\t\t\t\t * - assume _this_ is the opener\n\t\t\t\t\t * - give up and close out the document\n\t\t\t\t\t */\n\t\t\t\t\t$this->add_freeform();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// if we're not nesting then this is easy - close the block.\n\t\t\t\tif ( 1 === $stack_depth ) {\n\t\t\t\t\t$this->add_block_from_stack( $start_offset );\n\t\t\t\t\t$this->offset = $start_offset + $token_length;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * otherwise we're nested and we have to close out the current\n\t\t\t\t * block and add it as a new innerBlock to the parent\n\t\t\t\t */\n\t\t\t\t$stack_top                        = array_pop( $this->stack );\n\t\t\t\t$html                             = substr( $this->document, $stack_top->prev_offset, $start_offset - $stack_top->prev_offset );\n\t\t\t\t$stack_top->block->innerHTML     .= $html;\n\t\t\t\t$stack_top->block->innerContent[] = $html;\n\t\t\t\t$stack_top->prev_offset           = $start_offset + $token_length;\n\n\t\t\t\t$this->add_inner_block(\n\t\t\t\t\t$stack_top->block,\n\t\t\t\t\t$stack_top->token_start,\n\t\t\t\t\t$stack_top->token_length,\n\t\t\t\t\t$start_offset + $token_length\n\t\t\t\t);\n\t\t\t\t$this->offset = $start_offset + $token_length;\n\t\t\t\treturn true;\n\n\t\t\tdefault:\n\t\t\t\t// This is an error.\n\t\t\t\t$this->add_freeform();\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Scans the document from where we last left off\n\t * and finds the next valid token to parse if it exists\n\t *\n\t * Returns the type of the find: kind of find, block information, attributes\n\t *\n\t * @internal\n\t * @since 3.8.0\n\t * @since 4.6.1 fixed a bug in attribute parsing which caused catastrophic backtracking on invalid block comments\n\t * @return array\n\t */\n\tfunction next_token() {\n\t\t$matches = null;\n\n\t\t/*\n\t\t * aye the magic\n\t\t * we're using a single RegExp to tokenize the block comment delimiters\n\t\t * we're also using a trick here because the only difference between a\n\t\t * block opener and a block closer is the leading `/` before `wp:` (and\n\t\t * a closer has no attributes). we can trap them both and process the\n\t\t * match back in PHP to see which one it was.\n\t\t */\n\t\t$has_match = preg_match(\n\t\t\t'/<!--\\s+(?P<closer>\\/)?wp:(?P<namespace>[a-z][a-z0-9_-]*\\/)?(?P<name>[a-z][a-z0-9_-]*)\\s+(?P<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\\s+\\/?-->).)*+)?}\\s+)?(?P<void>\\/)?-->/s',\n\t\t\t$this->document,\n\t\t\t$matches,\n\t\t\tPREG_OFFSET_CAPTURE,\n\t\t\t$this->offset\n\t\t);\n\n\t\t// if we get here we probably have catastrophic backtracking or out-of-memory in the PCRE.\n\t\tif ( false === $has_match ) {\n\t\t\treturn array( 'no-more-tokens', null, null, null, null );\n\t\t}\n\n\t\t// we have no more tokens.\n\t\tif ( 0 === $has_match ) {\n\t\t\treturn array( 'no-more-tokens', null, null, null, null );\n\t\t}\n\n\t\tlist( $match, $started_at ) = $matches[0];\n\n\t\t$length    = strlen( $match );\n\t\t$is_closer = isset( $matches['closer'] ) && -1 !== $matches['closer'][1];\n\t\t$is_void   = isset( $matches['void'] ) && -1 !== $matches['void'][1];\n\t\t$namespace = $matches['namespace'];\n\t\t$namespace = ( isset( $namespace ) && -1 !== $namespace[1] ) ? $namespace[0] : 'core/';\n\t\t$name      = $namespace . $matches['name'][0];\n\t\t$has_attrs = isset( $matches['attrs'] ) && -1 !== $matches['attrs'][1];\n\n\t\t/*\n\t\t * Fun fact! It's not trivial in PHP to create \"an empty associative array\" since all arrays\n\t\t * are associative arrays. If we use `array()` we get a JSON `[]`\n\t\t */\n\t\t$attrs = $has_attrs\n\t\t\t? json_decode( $matches['attrs'][0], /* as-associative */ true )\n\t\t\t: $this->empty_attrs;\n\n\t\t/*\n\t\t * This state isn't allowed\n\t\t * This is an error\n\t\t */\n\t\tif ( $is_closer && ( $is_void || $has_attrs ) ) {\n\t\t\t// we can ignore them since they don't hurt anything.\n\t\t}\n\n\t\tif ( $is_void ) {\n\t\t\treturn array( 'void-block', $name, $attrs, $started_at, $length );\n\t\t}\n\n\t\tif ( $is_closer ) {\n\t\t\treturn array( 'block-closer', $name, null, $started_at, $length );\n\t\t}\n\n\t\treturn array( 'block-opener', $name, $attrs, $started_at, $length );\n\t}\n\n\t/**\n\t * Returns a new block object for freeform HTML\n\t *\n\t * @internal\n\t * @since 3.9.0\n\t *\n\t * @param string $innerHTML HTML content of block.\n\t * @return WP_Block_Parser_Block freeform block object.\n\t */\n\tfunction freeform( $innerHTML ) {\n\t\treturn new WP_Block_Parser_Block( null, $this->empty_attrs, array(), $innerHTML, array( $innerHTML ) );\n\t}\n\n\t/**\n\t * Pushes a length of text from the input document\n\t * to the output list as a freeform block.\n\t *\n\t * @internal\n\t * @since 3.8.0\n\t * @param null $length how many bytes of document text to output.\n\t */\n\tfunction add_freeform( $length = null ) {\n\t\t$length = $length ? $length : strlen( $this->document ) - $this->offset;\n\n\t\tif ( 0 === $length ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->output[] = (array) self::freeform( substr( $this->document, $this->offset, $length ) );\n\t}\n\n\t/**\n\t * Given a block structure from memory pushes\n\t * a new block to the output list.\n\t *\n\t * @internal\n\t * @since 3.8.0\n\t * @param WP_Block_Parser_Block $block        The block to add to the output.\n\t * @param int                   $token_start  Byte offset into the document where the first token for the block starts.\n\t * @param int                   $token_length Byte length of entire block from start of opening token to end of closing token.\n\t * @param int|null              $last_offset  Last byte offset into document if continuing form earlier output.\n\t */\n\tfunction add_inner_block( WP_Block_Parser_Block $block, $token_start, $token_length, $last_offset = null ) {\n\t\t$parent                       = $this->stack[ count( $this->stack ) - 1 ];\n\t\t$parent->block->innerBlocks[] = (array) $block;\n\t\t$html                         = substr( $this->document, $parent->prev_offset, $token_start - $parent->prev_offset );\n\n\t\tif ( ! empty( $html ) ) {\n\t\t\t$parent->block->innerHTML     .= $html;\n\t\t\t$parent->block->innerContent[] = $html;\n\t\t}\n\n\t\t$parent->block->innerContent[] = null;\n\t\t$parent->prev_offset           = $last_offset ? $last_offset : $token_start + $token_length;\n\t}\n\n\t/**\n\t * Pushes the top block from the parsing stack to the output list.\n\t *\n\t * @internal\n\t * @since 3.8.0\n\t * @param int|null $end_offset byte offset into document for where we should stop sending text output as HTML.\n\t */\n\tfunction add_block_from_stack( $end_offset = null ) {\n\t\t$stack_top   = array_pop( $this->stack );\n\t\t$prev_offset = $stack_top->prev_offset;\n\n\t\t$html = isset( $end_offset )\n\t\t\t? substr( $this->document, $prev_offset, $end_offset - $prev_offset )\n\t\t\t: substr( $this->document, $prev_offset );\n\n\t\tif ( ! empty( $html ) ) {\n\t\t\t$stack_top->block->innerHTML     .= $html;\n\t\t\t$stack_top->block->innerContent[] = $html;\n\t\t}\n\n\t\tif ( isset( $stack_top->leading_html_start ) ) {\n\t\t\t$this->output[] = (array) self::freeform(\n\t\t\t\tsubstr(\n\t\t\t\t\t$this->document,\n\t\t\t\t\t$stack_top->leading_html_start,\n\t\t\t\t\t$stack_top->token_start - $stack_top->leading_html_start\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$this->output[] = (array) $stack_top->block;\n\t}\n}\n", "num_lines": 556}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Blocks API: WP_Block_Pattern_Categories_Registry class\n *\n * @package WordPress\n * @subpackage Blocks\n * @since 5.5.0\n */\n\n/**\n * Class used for interacting with block pattern categories.\n */\nfinal class WP_Block_Pattern_Categories_Registry {\n\t/**\n\t * Registered block pattern categories array.\n\t *\n\t * @var array\n\t */\n\tprivate $registered_categories = array();\n\n\t/**\n\t * Container for the main instance of the class.\n\t *\n\t * @var WP_Block_Pattern_Categories_Registry|null\n\t */\n\tprivate static $instance = null;\n\n\t/**\n\t * Registers a pattern category.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $category_name       Pattern category name.\n\t * @param array  $category_properties Array containing the properties of the category: label.\n\t * @return bool True if the pattern was registered with success and false otherwise.\n\t */\n\tpublic function register( $category_name, $category_properties ) {\n\t\tif ( ! isset( $category_name ) || ! is_string( $category_name ) ) {\n\t\t\t_doing_it_wrong( __METHOD__, __( 'Block pattern category name must be a string.' ), '5.5.0' );\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->registered_categories[ $category_name ] = array_merge(\n\t\t\tarray( 'name' => $category_name ),\n\t\t\t$category_properties\n\t\t);\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Unregisters a pattern category.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $category_name     Pattern name including namespace.\n\t * @return bool True if the pattern was unregistered with success and false otherwise.\n\t */\n\tpublic function unregister( $category_name ) {\n\t\tif ( ! $this->is_registered( $category_name ) ) {\n\t\t\t/* translators: 1: Block pattern name. */\n\t\t\t$message = sprintf( __( 'Block pattern category \"%1$s\" not found.' ), $category_name );\n\t\t\t_doing_it_wrong( __METHOD__, $message, '5.5.0' );\n\t\t\treturn false;\n\t\t}\n\n\t\tunset( $this->registered_categories[ $category_name ] );\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves an array containing the properties of a registered pattern category.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $category_name Pattern category name.\n\t * @return array Registered pattern properties.\n\t */\n\tpublic function get_registered( $category_name ) {\n\t\tif ( ! $this->is_registered( $category_name ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->registered_categories[ $category_name ];\n\t}\n\n\t/**\n\t * Retrieves all registered pattern categories.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array Array of arrays containing the registered pattern categories properties.\n\t */\n\tpublic function get_all_registered() {\n\t\treturn array_values( $this->registered_categories );\n\t}\n\n\t/**\n\t * Checks if a pattern category is registered.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $category_name       Pattern category name.\n\t * @return bool True if the pattern category is registered, false otherwise.\n\t */\n\tpublic function is_registered( $category_name ) {\n\t\treturn isset( $this->registered_categories[ $category_name ] );\n\t}\n\n\t/**\n\t * Utility method to retrieve the main instance of the class.\n\t *\n\t * The instance will be created if it does not exist yet.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return WP_Block_Pattern_Categories_Registry The main instance.\n\t */\n\tpublic static function get_instance() {\n\t\tif ( null === self::$instance ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}\n}\n\n/**\n * Registers a new pattern category.\n *\n * @since 5.5.0\n *\n * @param string $category_name       Pattern category name.\n * @param array  $category_properties Array containing the properties of the category.\n * @return bool True if the pattern category was registered with success and false otherwise.\n */\nfunction register_block_pattern_category( $category_name, $category_properties ) {\n\treturn WP_Block_Pattern_Categories_Registry::get_instance()->register( $category_name, $category_properties );\n}\n\n/**\n * Unregisters a pattern category.\n *\n * @since 5.5.0\n *\n * @param string $category_name       Pattern category name including namespace.\n * @return bool True if the pattern category was unregistered with success and false otherwise.\n */\nfunction unregister_block_pattern_category( $category_name ) {\n\treturn WP_Block_Pattern_Categories_Registry::get_instance()->unregister( $category_name );\n}\n", "num_lines": 153}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Blocks API: WP_Block_Patterns_Registry class\n *\n * @package WordPress\n * @subpackage Blocks\n * @since 5.5.0\n */\n\n/**\n * Class used for interacting with patterns.\n *\n * @since 5.5.0\n */\nfinal class WP_Block_Patterns_Registry {\n\t/**\n\t * Registered patterns array.\n\t *\n\t * @var array\n\t */\n\tprivate $registered_patterns = array();\n\n\t/**\n\t * Container for the main instance of the class.\n\t *\n\t * @var WP_Block_Patterns_Registry|null\n\t */\n\tprivate static $instance = null;\n\n\t/**\n\t * Registers a pattern.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $pattern_name       Pattern name including namespace.\n\t * @param array  $pattern_properties Array containing the properties of the pattern: title,\n\t *                                   content, description, viewportWidth, categories, keywords.\n\t * @return bool True if the pattern was registered with success and false otherwise.\n\t */\n\tpublic function register( $pattern_name, $pattern_properties ) {\n\t\tif ( ! isset( $pattern_name ) || ! is_string( $pattern_name ) ) {\n\t\t\t_doing_it_wrong( __METHOD__, __( 'Pattern name must be a string.' ), '5.5.0' );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! isset( $pattern_properties['title'] ) || ! is_string( $pattern_properties['title'] ) ) {\n\t\t\t_doing_it_wrong( __METHOD__, __( 'Pattern title must be a string.' ), '5.5.0' );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! isset( $pattern_properties['content'] ) || ! is_string( $pattern_properties['content'] ) ) {\n\t\t\t_doing_it_wrong( __METHOD__, __( 'Pattern content must be a string.' ), '5.5.0' );\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->registered_patterns[ $pattern_name ] = array_merge(\n\t\t\t$pattern_properties,\n\t\t\tarray( 'name' => $pattern_name )\n\t\t);\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Unregisters a pattern.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $pattern_name Pattern name including namespace.\n\t * @return bool True if the pattern was unregistered with success and false otherwise.\n\t */\n\tpublic function unregister( $pattern_name ) {\n\t\tif ( ! $this->is_registered( $pattern_name ) ) {\n\t\t\t/* translators: 1: Pattern name. */\n\t\t\t$message = sprintf( __( 'Pattern \"%1$s\" not found.' ), $pattern_name );\n\t\t\t_doing_it_wrong( __METHOD__, $message, '5.5.0' );\n\t\t\treturn false;\n\t\t}\n\n\t\tunset( $this->registered_patterns[ $pattern_name ] );\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves an array containing the properties of a registered pattern.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $pattern_name Pattern name including namespace.\n\t * @return array Registered pattern properties.\n\t */\n\tpublic function get_registered( $pattern_name ) {\n\t\tif ( ! $this->is_registered( $pattern_name ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->registered_patterns[ $pattern_name ];\n\t}\n\n\t/**\n\t * Retrieves all registered patterns.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array Array of arrays containing the registered patterns properties,\n\t *               and per style.\n\t */\n\tpublic function get_all_registered() {\n\t\treturn array_values( $this->registered_patterns );\n\t}\n\n\t/**\n\t * Checks if a pattern is registered.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $pattern_name Pattern name including namespace.\n\t * @return bool True if the pattern is registered, false otherwise.\n\t */\n\tpublic function is_registered( $pattern_name ) {\n\t\treturn isset( $this->registered_patterns[ $pattern_name ] );\n\t}\n\n\t/**\n\t * Utility method to retrieve the main instance of the class.\n\t *\n\t * The instance will be created if it does not exist yet.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return WP_Block_Patterns_Registry The main instance.\n\t */\n\tpublic static function get_instance() {\n\t\tif ( null === self::$instance ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}\n}\n\n/**\n * Registers a new pattern.\n *\n * @since 5.5.0\n *\n * @param string $pattern_name       Pattern name including namespace.\n * @param array  $pattern_properties Array containing the properties of the pattern.\n * @return bool True if the pattern was registered with success and false otherwise.\n */\nfunction register_block_pattern( $pattern_name, $pattern_properties ) {\n\treturn WP_Block_Patterns_Registry::get_instance()->register( $pattern_name, $pattern_properties );\n}\n\n/**\n * Unregisters a pattern.\n *\n * @since 5.5.0\n *\n * @param string $pattern_name       Pattern name including namespace.\n * @return bool True if the pattern was unregistered with success and false otherwise.\n */\nfunction unregister_block_pattern( $pattern_name ) {\n\treturn WP_Block_Patterns_Registry::get_instance()->unregister( $pattern_name );\n}\n", "num_lines": 167}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Blocks API: WP_Block_Styles_Registry class\n *\n * @package WordPress\n * @subpackage Blocks\n * @since 5.3.0\n */\n\n/**\n * Class used for interacting with block styles.\n *\n * @since 5.3.0\n */\nfinal class WP_Block_Styles_Registry {\n\t/**\n\t * Registered block styles, as `$block_name => $block_style_name => $block_style_properties` multidimensional arrays.\n\t *\n\t * @since 5.3.0\n\t * @var array\n\t */\n\tprivate $registered_block_styles = array();\n\n\t/**\n\t * Container for the main instance of the class.\n\t *\n\t * @since 5.3.0\n\t * @var WP_Block_Styles_Registry|null\n\t */\n\tprivate static $instance = null;\n\n\t/**\n\t * Registers a block style.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param string $block_name       Block type name including namespace.\n\t * @param array  $style_properties Array containing the properties of the style name, label,\n\t *                                 style (name of the stylesheet to be enqueued),\n\t *                                 inline_style (string containing the CSS to be added).\n\t * @return boolean True if the block style was registered with success and false otherwise.\n\t */\n\tpublic function register( $block_name, $style_properties ) {\n\n\t\tif ( ! isset( $block_name ) || ! is_string( $block_name ) ) {\n\t\t\t$message = __( 'Block name must be a string.' );\n\t\t\t_doing_it_wrong( __METHOD__, $message, '5.3.0' );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! isset( $style_properties['name'] ) || ! is_string( $style_properties['name'] ) ) {\n\t\t\t$message = __( 'Block style name must be a string.' );\n\t\t\t_doing_it_wrong( __METHOD__, $message, '5.3.0' );\n\t\t\treturn false;\n\t\t}\n\n\t\t$block_style_name = $style_properties['name'];\n\n\t\tif ( ! isset( $this->registered_block_styles[ $block_name ] ) ) {\n\t\t\t$this->registered_block_styles[ $block_name ] = array();\n\t\t}\n\t\t$this->registered_block_styles[ $block_name ][ $block_style_name ] = $style_properties;\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Unregisters a block style.\n\t *\n\t * @param string $block_name       Block type name including namespace.\n\t * @param string $block_style_name Block style name.\n\t * @return boolean True if the block style was unregistered with success and false otherwise.\n\t */\n\tpublic function unregister( $block_name, $block_style_name ) {\n\t\tif ( ! $this->is_registered( $block_name, $block_style_name ) ) {\n\t\t\t/* translators: 1: Block name, 2: Block style name. */\n\t\t\t$message = sprintf( __( 'Block \"%1$s\" does not contain a style named \"%2$s\".' ), $block_name, $block_style_name );\n\t\t\t_doing_it_wrong( __METHOD__, $message, '5.3.0' );\n\t\t\treturn false;\n\t\t}\n\n\t\tunset( $this->registered_block_styles[ $block_name ][ $block_style_name ] );\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves an array containing the properties of a registered block style.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param string $block_name       Block type name including namespace.\n\t * @param string $block_style_name Block style name.\n\t * @return array Registered block style properties.\n\t */\n\tpublic function get_registered( $block_name, $block_style_name ) {\n\t\tif ( ! $this->is_registered( $block_name, $block_style_name ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->registered_block_styles[ $block_name ][ $block_style_name ];\n\t}\n\n\t/**\n\t * Retrieves all registered block styles.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @return array Array of arrays containing the registered block styles properties grouped per block,\n\t *               and per style.\n\t */\n\tpublic function get_all_registered() {\n\t\treturn $this->registered_block_styles;\n\t}\n\n\t/**\n\t * Retrieves registered block styles for a specific block.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param string $block_name Block type name including namespace.\n\t * @return array Array whose keys are block style names and whose value are block style properties.\n\t */\n\tpublic function get_registered_styles_for_block( $block_name ) {\n\t\tif ( isset( $this->registered_block_styles[ $block_name ] ) ) {\n\t\t\treturn $this->registered_block_styles[ $block_name ];\n\t\t}\n\t\treturn array();\n\t}\n\n\t/**\n\t * Checks if a block style is registered.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param string $block_name       Block type name including namespace.\n\t * @param string $block_style_name Block style name.\n\t * @return bool True if the block style is registered, false otherwise.\n\t */\n\tpublic function is_registered( $block_name, $block_style_name ) {\n\t\treturn isset( $this->registered_block_styles[ $block_name ][ $block_style_name ] );\n\t}\n\n\t/**\n\t * Utility method to retrieve the main instance of the class.\n\t *\n\t * The instance will be created if it does not exist yet.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @return WP_Block_Styles_Registry The main instance.\n\t */\n\tpublic static function get_instance() {\n\t\tif ( null === self::$instance ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}\n}\n", "num_lines": 161}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Blocks API: WP_Block_Type_Registry class\n *\n * @package WordPress\n * @subpackage Blocks\n * @since 5.0.0\n */\n\n/**\n * Core class used for interacting with block types.\n *\n * @since 5.0.0\n */\nfinal class WP_Block_Type_Registry {\n\t/**\n\t * Registered block types, as `$name => $instance` pairs.\n\t *\n\t * @since 5.0.0\n\t * @var WP_Block_Type[]\n\t */\n\tprivate $registered_block_types = array();\n\n\t/**\n\t * Container for the main instance of the class.\n\t *\n\t * @since 5.0.0\n\t * @var WP_Block_Type_Registry|null\n\t */\n\tprivate static $instance = null;\n\n\t/**\n\t * Registers a block type.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param string|WP_Block_Type $name Block type name including namespace, or alternatively\n\t *                                   a complete WP_Block_Type instance. In case a WP_Block_Type\n\t *                                   is provided, the $args parameter will be ignored.\n\t * @param array                $args {\n\t *     Optional. Array of block type arguments. Accepts any public property of `WP_Block_Type`.\n\t *     Any arguments may be defined, however the ones described below are supported by default.\n\t *     Default empty array.\n\t *\n\t *     @type callable $render_callback Callback used to render blocks of this block type.\n\t *     @type array    $attributes      Block attributes mapping, property name to schema.\n\t * }\n\t * @return WP_Block_Type|false The registered block type on success, or false on failure.\n\t */\n\tpublic function register( $name, $args = array() ) {\n\t\t$block_type = null;\n\t\tif ( $name instanceof WP_Block_Type ) {\n\t\t\t$block_type = $name;\n\t\t\t$name       = $block_type->name;\n\t\t}\n\n\t\tif ( ! is_string( $name ) ) {\n\t\t\t$message = __( 'Block type names must be strings.' );\n\t\t\t_doing_it_wrong( __METHOD__, $message, '5.0.0' );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( preg_match( '/[A-Z]+/', $name ) ) {\n\t\t\t$message = __( 'Block type names must not contain uppercase characters.' );\n\t\t\t_doing_it_wrong( __METHOD__, $message, '5.0.0' );\n\t\t\treturn false;\n\t\t}\n\n\t\t$name_matcher = '/^[a-z0-9-]+\\/[a-z0-9-]+$/';\n\t\tif ( ! preg_match( $name_matcher, $name ) ) {\n\t\t\t$message = __( 'Block type names must contain a namespace prefix. Example: my-plugin/my-custom-block-type' );\n\t\t\t_doing_it_wrong( __METHOD__, $message, '5.0.0' );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $this->is_registered( $name ) ) {\n\t\t\t/* translators: %s: Block name. */\n\t\t\t$message = sprintf( __( 'Block type \"%s\" is already registered.' ), $name );\n\t\t\t_doing_it_wrong( __METHOD__, $message, '5.0.0' );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $block_type ) {\n\t\t\t$block_type = new WP_Block_Type( $name, $args );\n\t\t}\n\n\t\t$this->registered_block_types[ $name ] = $block_type;\n\n\t\treturn $block_type;\n\t}\n\n\t/**\n\t * Unregisters a block type.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param string|WP_Block_Type $name Block type name including namespace, or alternatively\n\t *                                   a complete WP_Block_Type instance.\n\t * @return WP_Block_Type|false The unregistered block type on success, or false on failure.\n\t */\n\tpublic function unregister( $name ) {\n\t\tif ( $name instanceof WP_Block_Type ) {\n\t\t\t$name = $name->name;\n\t\t}\n\n\t\tif ( ! $this->is_registered( $name ) ) {\n\t\t\t/* translators: %s: Block name. */\n\t\t\t$message = sprintf( __( 'Block type \"%s\" is not registered.' ), $name );\n\t\t\t_doing_it_wrong( __METHOD__, $message, '5.0.0' );\n\t\t\treturn false;\n\t\t}\n\n\t\t$unregistered_block_type = $this->registered_block_types[ $name ];\n\t\tunset( $this->registered_block_types[ $name ] );\n\n\t\treturn $unregistered_block_type;\n\t}\n\n\t/**\n\t * Retrieves a registered block type.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param string $name Block type name including namespace.\n\t * @return WP_Block_Type|null The registered block type, or null if it is not registered.\n\t */\n\tpublic function get_registered( $name ) {\n\t\tif ( ! $this->is_registered( $name ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->registered_block_types[ $name ];\n\t}\n\n\t/**\n\t * Retrieves all registered block types.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @return WP_Block_Type[] Associative array of `$block_type_name => $block_type` pairs.\n\t */\n\tpublic function get_all_registered() {\n\t\treturn $this->registered_block_types;\n\t}\n\n\t/**\n\t * Checks if a block type is registered.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param string $name Block type name including namespace.\n\t * @return bool True if the block type is registered, false otherwise.\n\t */\n\tpublic function is_registered( $name ) {\n\t\treturn isset( $this->registered_block_types[ $name ] );\n\t}\n\n\t/**\n\t * Utility method to retrieve the main instance of the class.\n\t *\n\t * The instance will be created if it does not exist yet.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @return WP_Block_Type_Registry The main instance.\n\t */\n\tpublic static function get_instance() {\n\t\tif ( null === self::$instance ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}\n}\n", "num_lines": 175}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Blocks API: WP_Block_Type class\n *\n * @package WordPress\n * @subpackage Blocks\n * @since 5.0.0\n */\n\n/**\n * Core class representing a block type.\n *\n * @since 5.0.0\n *\n * @see register_block_type()\n */\nclass WP_Block_Type {\n\n\t/**\n\t * Block type key.\n\t *\n\t * @since 5.0.0\n\t * @var string\n\t */\n\tpublic $name;\n\n\t/**\n\t * @since 5.5.0\n\t * @var string\n\t */\n\tpublic $title = '';\n\n\t/**\n\t * @since 5.5.0\n\t * @var string|null\n\t */\n\tpublic $category = null;\n\n\t/**\n\t * @since 5.5.0\n\t * @var array|null\n\t */\n\tpublic $parent = null;\n\n\t/**\n\t * @since 5.5.0\n\t * @var string|null\n\t */\n\tpublic $icon = null;\n\n\t/**\n\t * @since 5.5.0\n\t * @var string\n\t */\n\tpublic $description = '';\n\n\t/**\n\t * @since 5.5.0\n\t * @var array\n\t */\n\tpublic $keywords = array();\n\n\t/**\n\t * @since 5.5.0\n\t * @var string|null\n\t */\n\tpublic $textdomain = null;\n\n\t/**\n\t * @since 5.5.0\n\t * @var array\n\t */\n\tpublic $styles = array();\n\n\t/**\n\t * @since 5.5.0\n\t * @var array|null\n\t */\n\tpublic $supports = null;\n\n\t/**\n\t * @since 5.5.0\n\t * @var array|null\n\t */\n\tpublic $example = null;\n\n\t/**\n\t * Block type render callback.\n\t *\n\t * @since 5.0.0\n\t * @var callable\n\t */\n\tpublic $render_callback = null;\n\n\t/**\n\t * Block type attributes property schemas.\n\t *\n\t * @since 5.0.0\n\t * @var array|null\n\t */\n\tpublic $attributes = null;\n\n\t/**\n\t * Context values inherited by blocks of this type.\n\t *\n\t * @since 5.5.0\n\t * @var array\n\t */\n\tpublic $uses_context = array();\n\n\t/**\n\t * Context provided by blocks of this type.\n\t *\n\t * @since 5.5.0\n\t * @var array|null\n\t */\n\tpublic $provides_context = null;\n\n\t/**\n\t * Block type editor script handle.\n\t *\n\t * @since 5.0.0\n\t * @var string|null\n\t */\n\tpublic $editor_script = null;\n\n\t/**\n\t * Block type front end script handle.\n\t *\n\t * @since 5.0.0\n\t * @var string|null\n\t */\n\tpublic $script = null;\n\n\t/**\n\t * Block type editor style handle.\n\t *\n\t * @since 5.0.0\n\t * @var string|null\n\t */\n\tpublic $editor_style = null;\n\n\t/**\n\t * Block type front end style handle.\n\t *\n\t * @since 5.0.0\n\t * @var string|null\n\t */\n\tpublic $style = null;\n\n\t/**\n\t * Constructor.\n\t *\n\t * Will populate object properties from the provided arguments.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @see register_block_type()\n\t *\n\t * @param string       $block_type Block type name including namespace.\n\t * @param array|string $args       Optional. Array or string of arguments for registering a block type.\n\t *                                 Default empty array.\n\t */\n\tpublic function __construct( $block_type, $args = array() ) {\n\t\t$this->name = $block_type;\n\n\t\t$this->set_props( $args );\n\t}\n\n\t/**\n\t * Renders the block type output for given attributes.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param array  $attributes Optional. Block attributes. Default empty array.\n\t * @param string $content    Optional. Block content. Default empty string.\n\t * @return string Rendered block type output.\n\t */\n\tpublic function render( $attributes = array(), $content = '' ) {\n\t\tif ( ! $this->is_dynamic() ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$attributes = $this->prepare_attributes_for_render( $attributes );\n\n\t\treturn (string) call_user_func( $this->render_callback, $attributes, $content );\n\t}\n\n\t/**\n\t * Returns true if the block type is dynamic, or false otherwise. A dynamic\n\t * block is one which defers its rendering to occur on-demand at runtime.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @return boolean Whether block type is dynamic.\n\t */\n\tpublic function is_dynamic() {\n\t\treturn is_callable( $this->render_callback );\n\t}\n\n\t/**\n\t * Validates attributes against the current block schema, populating\n\t * defaulted and missing values.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param array $attributes Original block attributes.\n\t * @return array Prepared block attributes.\n\t */\n\tpublic function prepare_attributes_for_render( $attributes ) {\n\t\t// If there are no attribute definitions for the block type, skip\n\t\t// processing and return vebatim.\n\t\tif ( ! isset( $this->attributes ) ) {\n\t\t\treturn $attributes;\n\t\t}\n\n\t\tforeach ( $attributes as $attribute_name => $value ) {\n\t\t\t// If the attribute is not defined by the block type, it cannot be\n\t\t\t// validated.\n\t\t\tif ( ! isset( $this->attributes[ $attribute_name ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$schema = $this->attributes[ $attribute_name ];\n\n\t\t\t// Validate value by JSON schema. An invalid value should revert to\n\t\t\t// its default, if one exists. This occurs by virtue of the missing\n\t\t\t// attributes loop immediately following. If there is not a default\n\t\t\t// assigned, the attribute value should remain unset.\n\t\t\t$is_valid = rest_validate_value_from_schema( $value, $schema );\n\t\t\tif ( is_wp_error( $is_valid ) ) {\n\t\t\t\tunset( $attributes[ $attribute_name ] );\n\t\t\t}\n\t\t}\n\n\t\t// Populate values of any missing attributes for which the block type\n\t\t// defines a default.\n\t\t$missing_schema_attributes = array_diff_key( $this->attributes, $attributes );\n\t\tforeach ( $missing_schema_attributes as $attribute_name => $schema ) {\n\t\t\tif ( isset( $schema['default'] ) ) {\n\t\t\t\t$attributes[ $attribute_name ] = $schema['default'];\n\t\t\t}\n\t\t}\n\n\t\treturn $attributes;\n\t}\n\n\t/**\n\t * Sets block type properties.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param array|string $args Array or string of arguments for registering a block type.\n\t */\n\tpublic function set_props( $args ) {\n\t\t$args = wp_parse_args(\n\t\t\t$args,\n\t\t\tarray(\n\t\t\t\t'render_callback' => null,\n\t\t\t)\n\t\t);\n\n\t\t$args['name'] = $this->name;\n\n\t\t/**\n\t\t * Filters the arguments for registering a block type.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param array  $args       Array of arguments for registering a block type.\n\t\t * @param string $block_type Block type name including namespace.\n\t\t */\n\t\t$args = apply_filters( 'register_block_type_args', $args, $this->name );\n\n\t\tforeach ( $args as $property_name => $property_value ) {\n\t\t\t$this->$property_name = $property_value;\n\t\t}\n\t}\n\n\t/**\n\t * Get all available block attributes including possible layout attribute from Columns block.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @return array Array of attributes.\n\t */\n\tpublic function get_attributes() {\n\t\treturn is_array( $this->attributes ) ?\n\t\t\t$this->attributes :\n\t\t\tarray();\n\t}\n}\n", "num_lines": 293}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Blocks API: WP_Block class\n *\n * @package WordPress\n * @since 5.5.0\n */\n\n/**\n * Class representing a parsed instance of a block.\n *\n * @since 5.5.0\n * @property array $attributes\n */\nclass WP_Block {\n\n\t/**\n\t * Original parsed array representation of block.\n\t *\n\t * @since 5.5.0\n\t * @var array\n\t */\n\tpublic $parsed_block;\n\n\t/**\n\t * Name of block.\n\t *\n\t * @example \"core/paragraph\"\n\t *\n\t * @since 5.5.0\n\t * @var string\n\t */\n\tpublic $name;\n\n\t/**\n\t * Block type associated with the instance.\n\t *\n\t * @since 5.5.0\n\t * @var WP_Block_Type\n\t */\n\tpublic $block_type;\n\n\t/**\n\t * Block context values.\n\t *\n\t * @since 5.5.0\n\t * @var array\n\t */\n\tpublic $context = array();\n\n\t/**\n\t * All available context of the current hierarchy.\n\t *\n\t * @since 5.5.0\n\t * @var array\n\t * @access protected\n\t */\n\tprotected $available_context;\n\n\t/**\n\t * List of inner blocks (of this same class)\n\t *\n\t * @since 5.5.0\n\t * @var WP_Block[]\n\t */\n\tpublic $inner_blocks = array();\n\n\t/**\n\t * Resultant HTML from inside block comment delimiters after removing inner\n\t * blocks.\n\t *\n\t * @example \"...Just <!-- wp:test /--> testing...\" -> \"Just testing...\"\n\t *\n\t * @since 5.5.0\n\t * @var string\n\t */\n\tpublic $inner_html = '';\n\n\t/**\n\t * List of string fragments and null markers where inner blocks were found\n\t *\n\t * @example array(\n\t *   'inner_html'    => 'BeforeInnerAfter',\n\t *   'inner_blocks'  => array( block, block ),\n\t *   'inner_content' => array( 'Before', null, 'Inner', null, 'After' ),\n\t * )\n\t *\n\t * @since 5.5.0\n\t * @var array\n\t */\n\tpublic $inner_content = array();\n\n\t/**\n\t * Constructor.\n\t *\n\t * Populates object properties from the provided block instance argument.\n\t *\n\t * The given array of context values will not necessarily be available on\n\t * the instance itself, but is treated as the full set of values provided by\n\t * the block's ancestry. This is assigned to the private `available_context`\n\t * property. Only values which are configured to consumed by the block via\n\t * its registered type will be assigned to the block's `context` property.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param array                  $block             Array of parsed block properties.\n\t * @param array                  $available_context Optional array of ancestry context values.\n\t * @param WP_Block_Type_Registry $registry          Optional block type registry.\n\t */\n\tpublic function __construct( $block, $available_context = array(), $registry = null ) {\n\t\t$this->parsed_block = $block;\n\t\t$this->name         = $block['blockName'];\n\n\t\tif ( is_null( $registry ) ) {\n\t\t\t$registry = WP_Block_Type_Registry::get_instance();\n\t\t}\n\n\t\t$this->block_type = $registry->get_registered( $this->name );\n\n\t\t$this->available_context = $available_context;\n\n\t\tif ( ! empty( $this->block_type->uses_context ) ) {\n\t\t\tforeach ( $this->block_type->uses_context as $context_name ) {\n\t\t\t\tif ( array_key_exists( $context_name, $this->available_context ) ) {\n\t\t\t\t\t$this->context[ $context_name ] = $this->available_context[ $context_name ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $block['innerBlocks'] ) ) {\n\t\t\t$child_context = $this->available_context;\n\n\t\t\tif ( ! empty( $this->block_type->provides_context ) ) {\n\t\t\t\tforeach ( $this->block_type->provides_context as $context_name => $attribute_name ) {\n\t\t\t\t\tif ( array_key_exists( $attribute_name, $this->attributes ) ) {\n\t\t\t\t\t\t$child_context[ $context_name ] = $this->attributes[ $attribute_name ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->inner_blocks = new WP_Block_List( $block['innerBlocks'], $child_context, $registry );\n\t\t}\n\n\t\tif ( ! empty( $block['innerHTML'] ) ) {\n\t\t\t$this->inner_html = $block['innerHTML'];\n\t\t}\n\n\t\tif ( ! empty( $block['innerContent'] ) ) {\n\t\t\t$this->inner_content = $block['innerContent'];\n\t\t}\n\t}\n\n\t/**\n\t * Returns a value from an inaccessible property.\n\t *\n\t * This is used to lazily initialize the `attributes` property of a block,\n\t * such that it is only prepared with default attributes at the time that\n\t * the property is accessed. For all other inaccessible properties, a `null`\n\t * value is returned.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $name Property name.\n\t * @return array|null Prepared attributes, or null.\n\t */\n\tpublic function __get( $name ) {\n\t\tif ( 'attributes' === $name ) {\n\t\t\t$this->attributes = isset( $this->parsed_block['attrs'] ) ?\n\t\t\t\t$this->parsed_block['attrs'] :\n\t\t\t\tarray();\n\n\t\t\tif ( ! is_null( $this->block_type ) ) {\n\t\t\t\t$this->attributes = $this->block_type->prepare_attributes_for_render( $this->attributes );\n\t\t\t}\n\n\t\t\treturn $this->attributes;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Generates the render output for the block.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param array $options {\n\t *   Optional options object.\n\t *\n\t *   @type bool $dynamic Defaults to 'true'. Optionally set to false to avoid using the block's render_callback.\n\t * }\n\t * @return string Rendered block output.\n\t */\n\tpublic function render( $options = array() ) {\n\t\tglobal $post;\n\t\t$options = wp_parse_args(\n\t\t\t$options,\n\t\t\tarray(\n\t\t\t\t'dynamic' => true,\n\t\t\t)\n\t\t);\n\n\t\t$is_dynamic    = $options['dynamic'] && $this->name && null !== $this->block_type && $this->block_type->is_dynamic();\n\t\t$block_content = '';\n\n\t\tif ( ! $options['dynamic'] || empty( $this->block_type->skip_inner_blocks ) ) {\n\t\t\t$index = 0;\n\t\t\tforeach ( $this->inner_content as $chunk ) {\n\t\t\t\t$block_content .= is_string( $chunk ) ?\n\t\t\t\t\t$chunk :\n\t\t\t\t\t$this->inner_blocks[ $index++ ]->render();\n\t\t\t}\n\t\t}\n\n\t\tif ( $is_dynamic ) {\n\t\t\t$global_post   = $post;\n\t\t\t$block_content = (string) call_user_func( $this->block_type->render_callback, $this->attributes, $block_content, $this );\n\t\t\t$post          = $global_post;\n\t\t}\n\n\t\tif ( ! empty( $this->block_type->script ) ) {\n\t\t\twp_enqueue_script( $this->block_type->script );\n\t\t}\n\n\t\tif ( ! empty( $this->block_type->style ) ) {\n\t\t\twp_enqueue_style( $this->block_type->style );\n\t\t}\n\n\t\t/**\n\t\t * Filters the content of a single block.\n\t\t *\n\t\t * @since 5.0.0\n\t\t *\n\t\t * @param string $block_content The block content about to be appended.\n\t\t * @param array  $block         The full block, including name and attributes.\n\t\t */\n\t\treturn apply_filters( 'render_block', $block_content, $this->parsed_block );\n\t}\n\n}\n", "num_lines": 241}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Comment API: WP_Comment_Query class\n *\n * @package WordPress\n * @subpackage Comments\n * @since 4.4.0\n */\n\n/**\n * Core class used for querying comments.\n *\n * @since 3.1.0\n *\n * @see WP_Comment_Query::__construct() for accepted arguments.\n */\nclass WP_Comment_Query {\n\n\t/**\n\t * SQL for database query.\n\t *\n\t * @since 4.0.1\n\t * @var string\n\t */\n\tpublic $request;\n\n\t/**\n\t * Metadata query container\n\t *\n\t * @since 3.5.0\n\t * @var WP_Meta_Query A meta query instance.\n\t */\n\tpublic $meta_query = false;\n\n\t/**\n\t * Metadata query clauses.\n\t *\n\t * @since 4.4.0\n\t * @var array\n\t */\n\tprotected $meta_query_clauses;\n\n\t/**\n\t * SQL query clauses.\n\t *\n\t * @since 4.4.0\n\t * @var array\n\t */\n\tprotected $sql_clauses = array(\n\t\t'select'  => '',\n\t\t'from'    => '',\n\t\t'where'   => array(),\n\t\t'groupby' => '',\n\t\t'orderby' => '',\n\t\t'limits'  => '',\n\t);\n\n\t/**\n\t * SQL WHERE clause.\n\t *\n\t * Stored after the {@see 'comments_clauses'} filter is run on the compiled WHERE sub-clauses.\n\t *\n\t * @since 4.4.2\n\t * @var string\n\t */\n\tprotected $filtered_where_clause;\n\n\t/**\n\t * Date query container\n\t *\n\t * @since 3.7.0\n\t * @var WP_Date_Query A date query instance.\n\t */\n\tpublic $date_query = false;\n\n\t/**\n\t * Query vars set by the user.\n\t *\n\t * @since 3.1.0\n\t * @var array\n\t */\n\tpublic $query_vars;\n\n\t/**\n\t * Default values for query vars.\n\t *\n\t * @since 4.2.0\n\t * @var array\n\t */\n\tpublic $query_var_defaults;\n\n\t/**\n\t * List of comments located by the query.\n\t *\n\t * @since 4.0.0\n\t * @var array\n\t */\n\tpublic $comments;\n\n\t/**\n\t * The amount of found comments for the current query.\n\t *\n\t * @since 4.4.0\n\t * @var int\n\t */\n\tpublic $found_comments = 0;\n\n\t/**\n\t * The number of pages.\n\t *\n\t * @since 4.4.0\n\t * @var int\n\t */\n\tpublic $max_num_pages = 0;\n\n\t/**\n\t * Make private/protected methods readable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name      Method to call.\n\t * @param array  $arguments Arguments to pass when calling.\n\t * @return mixed|false Return value of the callback, false otherwise.\n\t */\n\tpublic function __call( $name, $arguments ) {\n\t\tif ( 'get_search_sql' === $name ) {\n\t\t\treturn $this->get_search_sql( ...$arguments );\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Constructor.\n\t *\n\t * Sets up the comment query, based on the query vars passed.\n\t *\n\t * @since 4.2.0\n\t * @since 4.4.0 `$parent__in` and `$parent__not_in` were added.\n\t * @since 4.4.0 Order by `comment__in` was added. `$update_comment_meta_cache`, `$no_found_rows`,\n\t *              `$hierarchical`, and `$update_comment_post_cache` were added.\n\t * @since 4.5.0 Introduced the `$author_url` argument.\n\t * @since 4.6.0 Introduced the `$cache_domain` argument.\n\t * @since 4.9.0 Introduced the `$paged` argument.\n\t *\n\t * @param string|array $query {\n\t *     Optional. Array or query string of comment query parameters. Default empty.\n\t *\n\t *     @type string       $author_email              Comment author email address. Default empty.\n\t *     @type string       $author_url                Comment author URL. Default empty.\n\t *     @type array        $author__in                Array of author IDs to include comments for. Default empty.\n\t *     @type array        $author__not_in            Array of author IDs to exclude comments for. Default empty.\n\t *     @type array        $comment__in               Array of comment IDs to include. Default empty.\n\t *     @type array        $comment__not_in           Array of comment IDs to exclude. Default empty.\n\t *     @type bool         $count                     Whether to return a comment count (true) or array of\n\t *                                                   comment objects (false). Default false.\n\t *     @type array        $date_query                Date query clauses to limit comments by. See WP_Date_Query.\n\t *                                                   Default null.\n\t *     @type string       $fields                    Comment fields to return. Accepts 'ids' for comment IDs\n\t *                                                   only or empty for all fields. Default empty.\n\t *     @type int          $ID                        Currently unused.\n\t *     @type array        $include_unapproved        Array of IDs or email addresses of users whose unapproved\n\t *                                                   comments will be returned by the query regardless of\n\t *                                                   `$status`. Default empty.\n\t *     @type int          $karma                     Karma score to retrieve matching comments for.\n\t *                                                   Default empty.\n\t *     @type string       $meta_key                  Include comments with a matching comment meta key.\n\t *                                                   Default empty.\n\t *     @type string       $meta_value                Include comments with a matching comment meta value.\n\t *                                                   Requires `$meta_key` to be set. Default empty.\n\t *     @type array        $meta_query                Meta query clauses to limit retrieved comments by.\n\t *                                                   See WP_Meta_Query. Default empty.\n\t *     @type int          $number                    Maximum number of comments to retrieve.\n\t *                                                   Default empty (no limit).\n\t *     @type int          $paged                     When used with $number, defines the page of results to return.\n\t *                                                   When used with $offset, $offset takes precedence. Default 1.\n\t *     @type int          $offset                    Number of comments to offset the query. Used to build\n\t *                                                   LIMIT clause. Default 0.\n\t *     @type bool         $no_found_rows             Whether to disable the `SQL_CALC_FOUND_ROWS` query.\n\t *                                                   Default: true.\n\t *     @type string|array $orderby                   Comment status or array of statuses. To use 'meta_value'\n\t *                                                   or 'meta_value_num', `$meta_key` must also be defined.\n\t *                                                   To sort by a specific `$meta_query` clause, use that\n\t *                                                   clause's array key. Accepts 'comment_agent',\n\t *                                                   'comment_approved', 'comment_author',\n\t *                                                   'comment_author_email', 'comment_author_IP',\n\t *                                                   'comment_author_url', 'comment_content', 'comment_date',\n\t *                                                   'comment_date_gmt', 'comment_ID', 'comment_karma',\n\t *                                                   'comment_parent', 'comment_post_ID', 'comment_type',\n\t *                                                   'user_id', 'comment__in', 'meta_value', 'meta_value_num',\n\t *                                                   the value of $meta_key, and the array keys of\n\t *                                                   `$meta_query`. Also accepts false, an empty array, or\n\t *                                                   'none' to disable `ORDER BY` clause.\n\t *                                                   Default: 'comment_date_gmt'.\n\t *     @type string       $order                     How to order retrieved comments. Accepts 'ASC', 'DESC'.\n\t *                                                   Default: 'DESC'.\n\t *     @type int          $parent                    Parent ID of comment to retrieve children of.\n\t *                                                   Default empty.\n\t *     @type array        $parent__in                Array of parent IDs of comments to retrieve children for.\n\t *                                                   Default empty.\n\t *     @type array        $parent__not_in            Array of parent IDs of comments *not* to retrieve\n\t *                                                   children for. Default empty.\n\t *     @type array        $post_author__in           Array of author IDs to retrieve comments for.\n\t *                                                   Default empty.\n\t *     @type array        $post_author__not_in       Array of author IDs *not* to retrieve comments for.\n\t *                                                   Default empty.\n\t *     @type int          $post_ID                   Currently unused.\n\t *     @type int          $post_id                   Limit results to those affiliated with a given post ID.\n\t *                                                   Default 0.\n\t *     @type array        $post__in                  Array of post IDs to include affiliated comments for.\n\t *                                                   Default empty.\n\t *     @type array        $post__not_in              Array of post IDs to exclude affiliated comments for.\n\t *                                                   Default empty.\n\t *     @type int          $post_author               Post author ID to limit results by. Default empty.\n\t *     @type string|array $post_status               Post status or array of post statuses to retrieve\n\t *                                                   affiliated comments for. Pass 'any' to match any value.\n\t *                                                   Default empty.\n\t *     @type string       $post_type                 Post type or array of post types to retrieve affiliated\n\t *                                                   comments for. Pass 'any' to match any value. Default empty.\n\t *     @type string       $post_name                 Post name to retrieve affiliated comments for.\n\t *                                                   Default empty.\n\t *     @type int          $post_parent               Post parent ID to retrieve affiliated comments for.\n\t *                                                   Default empty.\n\t *     @type string       $search                    Search term(s) to retrieve matching comments for.\n\t *                                                   Default empty.\n\t *     @type string|array $status                    Comment stati to limit results by. Accepts an array\n\t *                                                   or space/comma-separated list of 'hold' (`comment_status=0`),\n\t *                                                   'approve' (`comment_status=1`), 'all', or a custom\n\t *                                                   comment status. Default 'all'.\n\t *     @type string|array $type                      Include comments of a given type, or array of types.\n\t *                                                   Accepts 'comment', 'pings' (includes 'pingback' and\n\t *                                                   'trackback'), or anycustom type string. Default empty.\n\t *     @type array        $type__in                  Include comments from a given array of comment types.\n\t *                                                   Default empty.\n\t *     @type array        $type__not_in              Exclude comments from a given array of comment types.\n\t *                                                   Default empty.\n\t *     @type int          $user_id                   Include comments for a specific user ID. Default empty.\n\t *     @type bool|string  $hierarchical              Whether to include comment descendants in the results.\n\t *                                                   'threaded' returns a tree, with each comment's children\n\t *                                                   stored in a `children` property on the `WP_Comment`\n\t *                                                   object. 'flat' returns a flat array of found comments plus\n\t *                                                   their children. Pass `false` to leave out descendants.\n\t *                                                   The parameter is ignored (forced to `false`) when\n\t *                                                   `$fields` is 'ids' or 'counts'. Accepts 'threaded',\n\t *                                                   'flat', or false. Default: false.\n\t *     @type string       $cache_domain              Unique cache key to be produced when this query is stored in\n\t *                                                   an object cache. Default is 'core'.\n\t *     @type bool         $update_comment_meta_cache Whether to prime the metadata cache for found comments.\n\t *                                                   Default true.\n\t *     @type bool         $update_comment_post_cache Whether to prime the cache for comment posts.\n\t *                                                   Default false.\n\t * }\n\t */\n\tpublic function __construct( $query = '' ) {\n\t\t$this->query_var_defaults = array(\n\t\t\t'author_email'              => '',\n\t\t\t'author_url'                => '',\n\t\t\t'author__in'                => '',\n\t\t\t'author__not_in'            => '',\n\t\t\t'include_unapproved'        => '',\n\t\t\t'fields'                    => '',\n\t\t\t'ID'                        => '',\n\t\t\t'comment__in'               => '',\n\t\t\t'comment__not_in'           => '',\n\t\t\t'karma'                     => '',\n\t\t\t'number'                    => '',\n\t\t\t'offset'                    => '',\n\t\t\t'no_found_rows'             => true,\n\t\t\t'orderby'                   => '',\n\t\t\t'order'                     => 'DESC',\n\t\t\t'paged'                     => 1,\n\t\t\t'parent'                    => '',\n\t\t\t'parent__in'                => '',\n\t\t\t'parent__not_in'            => '',\n\t\t\t'post_author__in'           => '',\n\t\t\t'post_author__not_in'       => '',\n\t\t\t'post_ID'                   => '',\n\t\t\t'post_id'                   => 0,\n\t\t\t'post__in'                  => '',\n\t\t\t'post__not_in'              => '',\n\t\t\t'post_author'               => '',\n\t\t\t'post_name'                 => '',\n\t\t\t'post_parent'               => '',\n\t\t\t'post_status'               => '',\n\t\t\t'post_type'                 => '',\n\t\t\t'status'                    => 'all',\n\t\t\t'type'                      => '',\n\t\t\t'type__in'                  => '',\n\t\t\t'type__not_in'              => '',\n\t\t\t'user_id'                   => '',\n\t\t\t'search'                    => '',\n\t\t\t'count'                     => false,\n\t\t\t'meta_key'                  => '',\n\t\t\t'meta_value'                => '',\n\t\t\t'meta_query'                => '',\n\t\t\t'date_query'                => null, // See WP_Date_Query.\n\t\t\t'hierarchical'              => false,\n\t\t\t'cache_domain'              => 'core',\n\t\t\t'update_comment_meta_cache' => true,\n\t\t\t'update_comment_post_cache' => false,\n\t\t);\n\n\t\tif ( ! empty( $query ) ) {\n\t\t\t$this->query( $query );\n\t\t}\n\t}\n\n\t/**\n\t * Parse arguments passed to the comment query with default query parameters.\n\t *\n\t * @since 4.2.0 Extracted from WP_Comment_Query::query().\n\t *\n\t * @param string|array $query WP_Comment_Query arguments. See WP_Comment_Query::__construct()\n\t */\n\tpublic function parse_query( $query = '' ) {\n\t\tif ( empty( $query ) ) {\n\t\t\t$query = $this->query_vars;\n\t\t}\n\n\t\t$this->query_vars = wp_parse_args( $query, $this->query_var_defaults );\n\n\t\t/**\n\t\t * Fires after the comment query vars have been parsed.\n\t\t *\n\t\t * @since 4.2.0\n\t\t *\n\t\t * @param WP_Comment_Query $this The WP_Comment_Query instance (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'parse_comment_query', array( &$this ) );\n\t}\n\n\t/**\n\t * Sets up the WordPress query for retrieving comments.\n\t *\n\t * @since 3.1.0\n\t * @since 4.1.0 Introduced 'comment__in', 'comment__not_in', 'post_author__in',\n\t *              'post_author__not_in', 'author__in', 'author__not_in', 'post__in',\n\t *              'post__not_in', 'include_unapproved', 'type__in', and 'type__not_in'\n\t *              arguments to $query_vars.\n\t * @since 4.2.0 Moved parsing to WP_Comment_Query::parse_query().\n\t *\n\t * @param string|array $query Array or URL query string of parameters.\n\t * @return array|int List of comments, or number of comments when 'count' is passed as a query var.\n\t */\n\tpublic function query( $query ) {\n\t\t$this->query_vars = wp_parse_args( $query );\n\t\treturn $this->get_comments();\n\t}\n\n\t/**\n\t * Get a list of comments matching the query vars.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @return int|array List of comments or number of found comments if `$count` argument is true.\n\t */\n\tpublic function get_comments() {\n\t\tglobal $wpdb;\n\n\t\t$this->parse_query();\n\n\t\t// Parse meta query.\n\t\t$this->meta_query = new WP_Meta_Query();\n\t\t$this->meta_query->parse_query_vars( $this->query_vars );\n\n\t\t/**\n\t\t * Fires before comments are retrieved.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param WP_Comment_Query $this Current instance of WP_Comment_Query (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'pre_get_comments', array( &$this ) );\n\n\t\t// Reparse query vars, in case they were modified in a 'pre_get_comments' callback.\n\t\t$this->meta_query->parse_query_vars( $this->query_vars );\n\t\tif ( ! empty( $this->meta_query->queries ) ) {\n\t\t\t$this->meta_query_clauses = $this->meta_query->get_sql( 'comment', $wpdb->comments, 'comment_ID', $this );\n\t\t}\n\n\t\t$comment_data = null;\n\n\t\t/**\n\t\t * Filter the comments data before the query takes place.\n\t\t *\n\t\t * Return a non-null value to bypass WordPress's default comment queries.\n\t\t *\n\t\t * The expected return type from this filter depends on the value passed in the request query_vars.\n\t\t * When `$this->query_vars['count']` is set, the filter should return the comment count as an int.\n\t\t * When `'ids' === $this->query_vars['fields']`, the filter should return an array of comment IDs.\n\t\t * Otherwise the filter should return an array of WP_Comment objects.\n\t\t *\n\t\t * @since 5.3.0\n\t\t *\n\t\t * @param array|int|null   $comment_data Return an array of comment data to short-circuit WP's comment query,\n\t\t *                                       the comment count as an integer if `$this->query_vars['count']` is set,\n\t\t *                                       or null to allow WP to run its normal queries.\n\t\t * @param WP_Comment_Query $this         The WP_Comment_Query instance, passed by reference.\n\t\t */\n\t\t$comment_data = apply_filters_ref_array( 'comments_pre_query', array( $comment_data, &$this ) );\n\n\t\tif ( null !== $comment_data ) {\n\t\t\treturn $comment_data;\n\t\t}\n\n\t\t/*\n\t\t * Only use the args defined in the query_var_defaults to compute the key,\n\t\t * but ignore 'fields', which does not affect query results.\n\t\t */\n\t\t$_args = wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) );\n\t\tunset( $_args['fields'] );\n\n\t\t$key          = md5( serialize( $_args ) );\n\t\t$last_changed = wp_cache_get_last_changed( 'comment' );\n\n\t\t$cache_key   = \"get_comments:$key:$last_changed\";\n\t\t$cache_value = wp_cache_get( $cache_key, 'comment' );\n\t\tif ( false === $cache_value ) {\n\t\t\t$comment_ids = $this->get_comment_ids();\n\t\t\tif ( $comment_ids ) {\n\t\t\t\t$this->set_found_comments();\n\t\t\t}\n\n\t\t\t$cache_value = array(\n\t\t\t\t'comment_ids'    => $comment_ids,\n\t\t\t\t'found_comments' => $this->found_comments,\n\t\t\t);\n\t\t\twp_cache_add( $cache_key, $cache_value, 'comment' );\n\t\t} else {\n\t\t\t$comment_ids          = $cache_value['comment_ids'];\n\t\t\t$this->found_comments = $cache_value['found_comments'];\n\t\t}\n\n\t\tif ( $this->found_comments && $this->query_vars['number'] ) {\n\t\t\t$this->max_num_pages = ceil( $this->found_comments / $this->query_vars['number'] );\n\t\t}\n\n\t\t// If querying for a count only, there's nothing more to do.\n\t\tif ( $this->query_vars['count'] ) {\n\t\t\t// $comment_ids is actually a count in this case.\n\t\t\treturn intval( $comment_ids );\n\t\t}\n\n\t\t$comment_ids = array_map( 'intval', $comment_ids );\n\n\t\tif ( 'ids' === $this->query_vars['fields'] ) {\n\t\t\t$this->comments = $comment_ids;\n\t\t\treturn $this->comments;\n\t\t}\n\n\t\t_prime_comment_caches( $comment_ids, $this->query_vars['update_comment_meta_cache'] );\n\n\t\t// Fetch full comment objects from the primed cache.\n\t\t$_comments = array();\n\t\tforeach ( $comment_ids as $comment_id ) {\n\t\t\t$_comment = get_comment( $comment_id );\n\t\t\tif ( $_comment ) {\n\t\t\t\t$_comments[] = $_comment;\n\t\t\t}\n\t\t}\n\n\t\t// Prime comment post caches.\n\t\tif ( $this->query_vars['update_comment_post_cache'] ) {\n\t\t\t$comment_post_ids = array();\n\t\t\tforeach ( $_comments as $_comment ) {\n\t\t\t\t$comment_post_ids[] = $_comment->comment_post_ID;\n\t\t\t}\n\n\t\t\t_prime_post_caches( $comment_post_ids, false, false );\n\t\t}\n\n\t\t/**\n\t\t * Filters the comment query results.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param WP_Comment[]     $_comments An array of comments.\n\t\t * @param WP_Comment_Query $this      Current instance of WP_Comment_Query (passed by reference).\n\t\t */\n\t\t$_comments = apply_filters_ref_array( 'the_comments', array( $_comments, &$this ) );\n\n\t\t// Convert to WP_Comment instances.\n\t\t$comments = array_map( 'get_comment', $_comments );\n\n\t\tif ( $this->query_vars['hierarchical'] ) {\n\t\t\t$comments = $this->fill_descendants( $comments );\n\t\t}\n\n\t\t$this->comments = $comments;\n\t\treturn $this->comments;\n\t}\n\n\t/**\n\t * Used internally to get a list of comment IDs matching the query vars.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @return int|array A single count of comment IDs if a count query. An array of comment IDs if a full query.\n\t */\n\tprotected function get_comment_ids() {\n\t\tglobal $wpdb;\n\n\t\t// Assemble clauses related to 'comment_approved'.\n\t\t$approved_clauses = array();\n\n\t\t// 'status' accepts an array or a comma-separated string.\n\t\t$status_clauses = array();\n\t\t$statuses       = wp_parse_list( $this->query_vars['status'] );\n\n\t\t// Empty 'status' should be interpreted as 'all'.\n\t\tif ( empty( $statuses ) ) {\n\t\t\t$statuses = array( 'all' );\n\t\t}\n\n\t\t// 'any' overrides other statuses.\n\t\tif ( ! in_array( 'any', $statuses, true ) ) {\n\t\t\tforeach ( $statuses as $status ) {\n\t\t\t\tswitch ( $status ) {\n\t\t\t\t\tcase 'hold':\n\t\t\t\t\t\t$status_clauses[] = \"comment_approved = '0'\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'approve':\n\t\t\t\t\t\t$status_clauses[] = \"comment_approved = '1'\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'all':\n\t\t\t\t\tcase '':\n\t\t\t\t\t\t$status_clauses[] = \"( comment_approved = '0' OR comment_approved = '1' )\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$status_clauses[] = $wpdb->prepare( 'comment_approved = %s', $status );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty( $status_clauses ) ) {\n\t\t\t\t$approved_clauses[] = '( ' . implode( ' OR ', $status_clauses ) . ' )';\n\t\t\t}\n\t\t}\n\n\t\t// User IDs or emails whose unapproved comments are included, regardless of $status.\n\t\tif ( ! empty( $this->query_vars['include_unapproved'] ) ) {\n\t\t\t$include_unapproved = wp_parse_list( $this->query_vars['include_unapproved'] );\n\n\t\t\t$unapproved_ids    = array();\n\t\t\t$unapproved_emails = array();\n\t\t\tforeach ( $include_unapproved as $unapproved_identifier ) {\n\t\t\t\t// Numeric values are assumed to be user IDs.\n\t\t\t\tif ( is_numeric( $unapproved_identifier ) ) {\n\t\t\t\t\t$approved_clauses[] = $wpdb->prepare( \"( user_id = %d AND comment_approved = '0' )\", $unapproved_identifier );\n\t\t\t\t} else {\n\t\t\t\t\t// Otherwise we match against email addresses.\n\t\t\t\t\tif ( ! empty( $_GET['unapproved'] ) && ! empty( $_GET['moderation-hash'] ) ) {\n\t\t\t\t\t\t// Only include requested comment.\n\t\t\t\t\t\t$approved_clauses[] = $wpdb->prepare( \"( comment_author_email = %s AND comment_approved = '0' AND comment_ID = %d )\", $unapproved_identifier, (int) $_GET['unapproved'] );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Include all of the author's unapproved comments.\n\t\t\t\t\t\t$approved_clauses[] = $wpdb->prepare( \"( comment_author_email = %s AND comment_approved = '0' )\", $unapproved_identifier );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Collapse comment_approved clauses into a single OR-separated clause.\n\t\tif ( ! empty( $approved_clauses ) ) {\n\t\t\tif ( 1 === count( $approved_clauses ) ) {\n\t\t\t\t$this->sql_clauses['where']['approved'] = $approved_clauses[0];\n\t\t\t} else {\n\t\t\t\t$this->sql_clauses['where']['approved'] = '( ' . implode( ' OR ', $approved_clauses ) . ' )';\n\t\t\t}\n\t\t}\n\n\t\t$order = ( 'ASC' === strtoupper( $this->query_vars['order'] ) ) ? 'ASC' : 'DESC';\n\n\t\t// Disable ORDER BY with 'none', an empty array, or boolean false.\n\t\tif ( in_array( $this->query_vars['orderby'], array( 'none', array(), false ), true ) ) {\n\t\t\t$orderby = '';\n\t\t} elseif ( ! empty( $this->query_vars['orderby'] ) ) {\n\t\t\t$ordersby = is_array( $this->query_vars['orderby'] ) ?\n\t\t\t\t$this->query_vars['orderby'] :\n\t\t\t\tpreg_split( '/[,\\s]/', $this->query_vars['orderby'] );\n\n\t\t\t$orderby_array            = array();\n\t\t\t$found_orderby_comment_id = false;\n\t\t\tforeach ( $ordersby as $_key => $_value ) {\n\t\t\t\tif ( ! $_value ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( is_int( $_key ) ) {\n\t\t\t\t\t$_orderby = $_value;\n\t\t\t\t\t$_order   = $order;\n\t\t\t\t} else {\n\t\t\t\t\t$_orderby = $_key;\n\t\t\t\t\t$_order   = $_value;\n\t\t\t\t}\n\n\t\t\t\tif ( ! $found_orderby_comment_id && in_array( $_orderby, array( 'comment_ID', 'comment__in' ), true ) ) {\n\t\t\t\t\t$found_orderby_comment_id = true;\n\t\t\t\t}\n\n\t\t\t\t$parsed = $this->parse_orderby( $_orderby );\n\n\t\t\t\tif ( ! $parsed ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( 'comment__in' === $_orderby ) {\n\t\t\t\t\t$orderby_array[] = $parsed;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$orderby_array[] = $parsed . ' ' . $this->parse_order( $_order );\n\t\t\t}\n\n\t\t\t// If no valid clauses were found, order by comment_date_gmt.\n\t\t\tif ( empty( $orderby_array ) ) {\n\t\t\t\t$orderby_array[] = \"$wpdb->comments.comment_date_gmt $order\";\n\t\t\t}\n\n\t\t\t// To ensure determinate sorting, always include a comment_ID clause.\n\t\t\tif ( ! $found_orderby_comment_id ) {\n\t\t\t\t$comment_id_order = '';\n\n\t\t\t\t// Inherit order from comment_date or comment_date_gmt, if available.\n\t\t\t\tforeach ( $orderby_array as $orderby_clause ) {\n\t\t\t\t\tif ( preg_match( '/comment_date(?:_gmt)*\\ (ASC|DESC)/', $orderby_clause, $match ) ) {\n\t\t\t\t\t\t$comment_id_order = $match[1];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If no date-related order is available, use the date from the first available clause.\n\t\t\t\tif ( ! $comment_id_order ) {\n\t\t\t\t\tforeach ( $orderby_array as $orderby_clause ) {\n\t\t\t\t\t\tif ( false !== strpos( 'ASC', $orderby_clause ) ) {\n\t\t\t\t\t\t\t$comment_id_order = 'ASC';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$comment_id_order = 'DESC';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Default to DESC.\n\t\t\t\tif ( ! $comment_id_order ) {\n\t\t\t\t\t$comment_id_order = 'DESC';\n\t\t\t\t}\n\n\t\t\t\t$orderby_array[] = \"$wpdb->comments.comment_ID $comment_id_order\";\n\t\t\t}\n\n\t\t\t$orderby = implode( ', ', $orderby_array );\n\t\t} else {\n\t\t\t$orderby = \"$wpdb->comments.comment_date_gmt $order\";\n\t\t}\n\n\t\t$number = absint( $this->query_vars['number'] );\n\t\t$offset = absint( $this->query_vars['offset'] );\n\t\t$paged  = absint( $this->query_vars['paged'] );\n\t\t$limits = '';\n\n\t\tif ( ! empty( $number ) ) {\n\t\t\tif ( $offset ) {\n\t\t\t\t$limits = 'LIMIT ' . $offset . ',' . $number;\n\t\t\t} else {\n\t\t\t\t$limits = 'LIMIT ' . ( $number * ( $paged - 1 ) ) . ',' . $number;\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->query_vars['count'] ) {\n\t\t\t$fields = 'COUNT(*)';\n\t\t} else {\n\t\t\t$fields = \"$wpdb->comments.comment_ID\";\n\t\t}\n\n\t\t$post_id = absint( $this->query_vars['post_id'] );\n\t\tif ( ! empty( $post_id ) ) {\n\t\t\t$this->sql_clauses['where']['post_id'] = $wpdb->prepare( 'comment_post_ID = %d', $post_id );\n\t\t}\n\n\t\t// Parse comment IDs for an IN clause.\n\t\tif ( ! empty( $this->query_vars['comment__in'] ) ) {\n\t\t\t$this->sql_clauses['where']['comment__in'] = \"$wpdb->comments.comment_ID IN ( \" . implode( ',', wp_parse_id_list( $this->query_vars['comment__in'] ) ) . ' )';\n\t\t}\n\n\t\t// Parse comment IDs for a NOT IN clause.\n\t\tif ( ! empty( $this->query_vars['comment__not_in'] ) ) {\n\t\t\t$this->sql_clauses['where']['comment__not_in'] = \"$wpdb->comments.comment_ID NOT IN ( \" . implode( ',', wp_parse_id_list( $this->query_vars['comment__not_in'] ) ) . ' )';\n\t\t}\n\n\t\t// Parse comment parent IDs for an IN clause.\n\t\tif ( ! empty( $this->query_vars['parent__in'] ) ) {\n\t\t\t$this->sql_clauses['where']['parent__in'] = 'comment_parent IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['parent__in'] ) ) . ' )';\n\t\t}\n\n\t\t// Parse comment parent IDs for a NOT IN clause.\n\t\tif ( ! empty( $this->query_vars['parent__not_in'] ) ) {\n\t\t\t$this->sql_clauses['where']['parent__not_in'] = 'comment_parent NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['parent__not_in'] ) ) . ' )';\n\t\t}\n\n\t\t// Parse comment post IDs for an IN clause.\n\t\tif ( ! empty( $this->query_vars['post__in'] ) ) {\n\t\t\t$this->sql_clauses['where']['post__in'] = 'comment_post_ID IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['post__in'] ) ) . ' )';\n\t\t}\n\n\t\t// Parse comment post IDs for a NOT IN clause.\n\t\tif ( ! empty( $this->query_vars['post__not_in'] ) ) {\n\t\t\t$this->sql_clauses['where']['post__not_in'] = 'comment_post_ID NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['post__not_in'] ) ) . ' )';\n\t\t}\n\n\t\tif ( '' !== $this->query_vars['author_email'] ) {\n\t\t\t$this->sql_clauses['where']['author_email'] = $wpdb->prepare( 'comment_author_email = %s', $this->query_vars['author_email'] );\n\t\t}\n\n\t\tif ( '' !== $this->query_vars['author_url'] ) {\n\t\t\t$this->sql_clauses['where']['author_url'] = $wpdb->prepare( 'comment_author_url = %s', $this->query_vars['author_url'] );\n\t\t}\n\n\t\tif ( '' !== $this->query_vars['karma'] ) {\n\t\t\t$this->sql_clauses['where']['karma'] = $wpdb->prepare( 'comment_karma = %d', $this->query_vars['karma'] );\n\t\t}\n\n\t\t// Filtering by comment_type: 'type', 'type__in', 'type__not_in'.\n\t\t$raw_types = array(\n\t\t\t'IN'     => array_merge( (array) $this->query_vars['type'], (array) $this->query_vars['type__in'] ),\n\t\t\t'NOT IN' => (array) $this->query_vars['type__not_in'],\n\t\t);\n\n\t\t$comment_types = array();\n\t\tforeach ( $raw_types as $operator => $_raw_types ) {\n\t\t\t$_raw_types = array_unique( $_raw_types );\n\n\t\t\tforeach ( $_raw_types as $type ) {\n\t\t\t\tswitch ( $type ) {\n\t\t\t\t\t// An empty translates to 'all', for backward compatibility.\n\t\t\t\t\tcase '':\n\t\t\t\t\tcase 'all':\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'comment':\n\t\t\t\t\tcase 'comments':\n\t\t\t\t\t\t$comment_types[ $operator ][] = \"''\";\n\t\t\t\t\t\t$comment_types[ $operator ][] = \"'comment'\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'pings':\n\t\t\t\t\t\t$comment_types[ $operator ][] = \"'pingback'\";\n\t\t\t\t\t\t$comment_types[ $operator ][] = \"'trackback'\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$comment_types[ $operator ][] = $wpdb->prepare( '%s', $type );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty( $comment_types[ $operator ] ) ) {\n\t\t\t\t$types_sql = implode( ', ', $comment_types[ $operator ] );\n\t\t\t\t$this->sql_clauses['where'][ 'comment_type__' . strtolower( str_replace( ' ', '_', $operator ) ) ] = \"comment_type $operator ($types_sql)\";\n\t\t\t}\n\t\t}\n\n\t\t$parent = $this->query_vars['parent'];\n\t\tif ( $this->query_vars['hierarchical'] && ! $parent ) {\n\t\t\t$parent = 0;\n\t\t}\n\n\t\tif ( '' !== $parent ) {\n\t\t\t$this->sql_clauses['where']['parent'] = $wpdb->prepare( 'comment_parent = %d', $parent );\n\t\t}\n\n\t\tif ( is_array( $this->query_vars['user_id'] ) ) {\n\t\t\t$this->sql_clauses['where']['user_id'] = 'user_id IN (' . implode( ',', array_map( 'absint', $this->query_vars['user_id'] ) ) . ')';\n\t\t} elseif ( '' !== $this->query_vars['user_id'] ) {\n\t\t\t$this->sql_clauses['where']['user_id'] = $wpdb->prepare( 'user_id = %d', $this->query_vars['user_id'] );\n\t\t}\n\n\t\t// Falsey search strings are ignored.\n\t\tif ( strlen( $this->query_vars['search'] ) ) {\n\t\t\t$search_sql = $this->get_search_sql(\n\t\t\t\t$this->query_vars['search'],\n\t\t\t\tarray( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_content' )\n\t\t\t);\n\n\t\t\t// Strip leading 'AND'.\n\t\t\t$this->sql_clauses['where']['search'] = preg_replace( '/^\\s*AND\\s*/', '', $search_sql );\n\t\t}\n\n\t\t// If any post-related query vars are passed, join the posts table.\n\t\t$join_posts_table = false;\n\t\t$plucked          = wp_array_slice_assoc( $this->query_vars, array( 'post_author', 'post_name', 'post_parent' ) );\n\t\t$post_fields      = array_filter( $plucked );\n\n\t\tif ( ! empty( $post_fields ) ) {\n\t\t\t$join_posts_table = true;\n\t\t\tforeach ( $post_fields as $field_name => $field_value ) {\n\t\t\t\t// $field_value may be an array.\n\t\t\t\t$esses = array_fill( 0, count( (array) $field_value ), '%s' );\n\n\t\t\t\t// phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare\n\t\t\t\t$this->sql_clauses['where'][ $field_name ] = $wpdb->prepare( \" {$wpdb->posts}.{$field_name} IN (\" . implode( ',', $esses ) . ')', $field_value );\n\t\t\t}\n\t\t}\n\n\t\t// 'post_status' and 'post_type' are handled separately, due to the specialized behavior of 'any'.\n\t\tforeach ( array( 'post_status', 'post_type' ) as $field_name ) {\n\t\t\t$q_values = array();\n\t\t\tif ( ! empty( $this->query_vars[ $field_name ] ) ) {\n\t\t\t\t$q_values = $this->query_vars[ $field_name ];\n\t\t\t\tif ( ! is_array( $q_values ) ) {\n\t\t\t\t\t$q_values = explode( ',', $q_values );\n\t\t\t\t}\n\n\t\t\t\t// 'any' will cause the query var to be ignored.\n\t\t\t\tif ( in_array( 'any', $q_values, true ) || empty( $q_values ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$join_posts_table = true;\n\n\t\t\t\t$esses = array_fill( 0, count( $q_values ), '%s' );\n\n\t\t\t\t// phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare\n\t\t\t\t$this->sql_clauses['where'][ $field_name ] = $wpdb->prepare( \" {$wpdb->posts}.{$field_name} IN (\" . implode( ',', $esses ) . ')', $q_values );\n\t\t\t}\n\t\t}\n\n\t\t// Comment author IDs for an IN clause.\n\t\tif ( ! empty( $this->query_vars['author__in'] ) ) {\n\t\t\t$this->sql_clauses['where']['author__in'] = 'user_id IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['author__in'] ) ) . ' )';\n\t\t}\n\n\t\t// Comment author IDs for a NOT IN clause.\n\t\tif ( ! empty( $this->query_vars['author__not_in'] ) ) {\n\t\t\t$this->sql_clauses['where']['author__not_in'] = 'user_id NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['author__not_in'] ) ) . ' )';\n\t\t}\n\n\t\t// Post author IDs for an IN clause.\n\t\tif ( ! empty( $this->query_vars['post_author__in'] ) ) {\n\t\t\t$join_posts_table                              = true;\n\t\t\t$this->sql_clauses['where']['post_author__in'] = 'post_author IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['post_author__in'] ) ) . ' )';\n\t\t}\n\n\t\t// Post author IDs for a NOT IN clause.\n\t\tif ( ! empty( $this->query_vars['post_author__not_in'] ) ) {\n\t\t\t$join_posts_table                                  = true;\n\t\t\t$this->sql_clauses['where']['post_author__not_in'] = 'post_author NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['post_author__not_in'] ) ) . ' )';\n\t\t}\n\n\t\t$join    = '';\n\t\t$groupby = '';\n\n\t\tif ( $join_posts_table ) {\n\t\t\t$join .= \"JOIN $wpdb->posts ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID\";\n\t\t}\n\n\t\tif ( ! empty( $this->meta_query_clauses ) ) {\n\t\t\t$join .= $this->meta_query_clauses['join'];\n\n\t\t\t// Strip leading 'AND'.\n\t\t\t$this->sql_clauses['where']['meta_query'] = preg_replace( '/^\\s*AND\\s*/', '', $this->meta_query_clauses['where'] );\n\n\t\t\tif ( ! $this->query_vars['count'] ) {\n\t\t\t\t$groupby = \"{$wpdb->comments}.comment_ID\";\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $this->query_vars['date_query'] ) && is_array( $this->query_vars['date_query'] ) ) {\n\t\t\t$this->date_query                         = new WP_Date_Query( $this->query_vars['date_query'], 'comment_date' );\n\t\t\t$this->sql_clauses['where']['date_query'] = preg_replace( '/^\\s*AND\\s*/', '', $this->date_query->get_sql() );\n\t\t}\n\n\t\t$where = implode( ' AND ', $this->sql_clauses['where'] );\n\n\t\t$pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );\n\t\t/**\n\t\t * Filters the comment query clauses.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string[]         $pieces An associative array of comment query clauses.\n\t\t * @param WP_Comment_Query $this   Current instance of WP_Comment_Query (passed by reference).\n\t\t */\n\t\t$clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) );\n\n\t\t$fields  = isset( $clauses['fields'] ) ? $clauses['fields'] : '';\n\t\t$join    = isset( $clauses['join'] ) ? $clauses['join'] : '';\n\t\t$where   = isset( $clauses['where'] ) ? $clauses['where'] : '';\n\t\t$orderby = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';\n\t\t$limits  = isset( $clauses['limits'] ) ? $clauses['limits'] : '';\n\t\t$groupby = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';\n\n\t\t$this->filtered_where_clause = $where;\n\n\t\tif ( $where ) {\n\t\t\t$where = 'WHERE ' . $where;\n\t\t}\n\n\t\tif ( $groupby ) {\n\t\t\t$groupby = 'GROUP BY ' . $groupby;\n\t\t}\n\n\t\tif ( $orderby ) {\n\t\t\t$orderby = \"ORDER BY $orderby\";\n\t\t}\n\n\t\t$found_rows = '';\n\t\tif ( ! $this->query_vars['no_found_rows'] ) {\n\t\t\t$found_rows = 'SQL_CALC_FOUND_ROWS';\n\t\t}\n\n\t\t$this->sql_clauses['select']  = \"SELECT $found_rows $fields\";\n\t\t$this->sql_clauses['from']    = \"FROM $wpdb->comments $join\";\n\t\t$this->sql_clauses['groupby'] = $groupby;\n\t\t$this->sql_clauses['orderby'] = $orderby;\n\t\t$this->sql_clauses['limits']  = $limits;\n\n\t\t$this->request = \"{$this->sql_clauses['select']} {$this->sql_clauses['from']} {$where} {$this->sql_clauses['groupby']} {$this->sql_clauses['orderby']} {$this->sql_clauses['limits']}\";\n\n\t\tif ( $this->query_vars['count'] ) {\n\t\t\treturn intval( $wpdb->get_var( $this->request ) );\n\t\t} else {\n\t\t\t$comment_ids = $wpdb->get_col( $this->request );\n\t\t\treturn array_map( 'intval', $comment_ids );\n\t\t}\n\t}\n\n\t/**\n\t * Populates found_comments and max_num_pages properties for the current\n\t * query if the limit clause was used.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t */\n\tprivate function set_found_comments() {\n\t\tglobal $wpdb;\n\n\t\tif ( $this->query_vars['number'] && ! $this->query_vars['no_found_rows'] ) {\n\t\t\t/**\n\t\t\t * Filters the query used to retrieve found comment count.\n\t\t\t *\n\t\t\t * @since 4.4.0\n\t\t\t *\n\t\t\t * @param string           $found_comments_query SQL query. Default 'SELECT FOUND_ROWS()'.\n\t\t\t * @param WP_Comment_Query $comment_query        The `WP_Comment_Query` instance.\n\t\t\t */\n\t\t\t$found_comments_query = apply_filters( 'found_comments_query', 'SELECT FOUND_ROWS()', $this );\n\n\t\t\t$this->found_comments = (int) $wpdb->get_var( $found_comments_query );\n\t\t}\n\t}\n\n\t/**\n\t * Fetch descendants for located comments.\n\t *\n\t * Instead of calling `get_children()` separately on each child comment, we do a single set of queries to fetch\n\t * the descendant trees for all matched top-level comments.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param WP_Comment[] $comments Array of top-level comments whose descendants should be filled in.\n\t * @return array\n\t */\n\tprotected function fill_descendants( $comments ) {\n\t\tglobal $wpdb;\n\n\t\t$levels = array(\n\t\t\t0 => wp_list_pluck( $comments, 'comment_ID' ),\n\t\t);\n\n\t\t$key          = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) );\n\t\t$last_changed = wp_cache_get_last_changed( 'comment' );\n\n\t\t// Fetch an entire level of the descendant tree at a time.\n\t\t$level        = 0;\n\t\t$exclude_keys = array( 'parent', 'parent__in', 'parent__not_in' );\n\t\tdo {\n\t\t\t// Parent-child relationships may be cached. Only query for those that are not.\n\t\t\t$child_ids           = array();\n\t\t\t$uncached_parent_ids = array();\n\t\t\t$_parent_ids         = $levels[ $level ];\n\t\t\tforeach ( $_parent_ids as $parent_id ) {\n\t\t\t\t$cache_key        = \"get_comment_child_ids:$parent_id:$key:$last_changed\";\n\t\t\t\t$parent_child_ids = wp_cache_get( $cache_key, 'comment' );\n\t\t\t\tif ( false !== $parent_child_ids ) {\n\t\t\t\t\t$child_ids = array_merge( $child_ids, $parent_child_ids );\n\t\t\t\t} else {\n\t\t\t\t\t$uncached_parent_ids[] = $parent_id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $uncached_parent_ids ) {\n\t\t\t\t// Fetch this level of comments.\n\t\t\t\t$parent_query_args = $this->query_vars;\n\t\t\t\tforeach ( $exclude_keys as $exclude_key ) {\n\t\t\t\t\t$parent_query_args[ $exclude_key ] = '';\n\t\t\t\t}\n\t\t\t\t$parent_query_args['parent__in']    = $uncached_parent_ids;\n\t\t\t\t$parent_query_args['no_found_rows'] = true;\n\t\t\t\t$parent_query_args['hierarchical']  = false;\n\t\t\t\t$parent_query_args['offset']        = 0;\n\t\t\t\t$parent_query_args['number']        = 0;\n\n\t\t\t\t$level_comments = get_comments( $parent_query_args );\n\n\t\t\t\t// Cache parent-child relationships.\n\t\t\t\t$parent_map = array_fill_keys( $uncached_parent_ids, array() );\n\t\t\t\tforeach ( $level_comments as $level_comment ) {\n\t\t\t\t\t$parent_map[ $level_comment->comment_parent ][] = $level_comment->comment_ID;\n\t\t\t\t\t$child_ids[]                                    = $level_comment->comment_ID;\n\t\t\t\t}\n\n\t\t\t\tforeach ( $parent_map as $parent_id => $children ) {\n\t\t\t\t\t$cache_key = \"get_comment_child_ids:$parent_id:$key:$last_changed\";\n\t\t\t\t\twp_cache_set( $cache_key, $children, 'comment' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$level++;\n\t\t\t$levels[ $level ] = $child_ids;\n\t\t} while ( $child_ids );\n\n\t\t// Prime comment caches for non-top-level comments.\n\t\t$descendant_ids = array();\n\t\tfor ( $i = 1, $c = count( $levels ); $i < $c; $i++ ) {\n\t\t\t$descendant_ids = array_merge( $descendant_ids, $levels[ $i ] );\n\t\t}\n\n\t\t_prime_comment_caches( $descendant_ids, $this->query_vars['update_comment_meta_cache'] );\n\n\t\t// Assemble a flat array of all comments + descendants.\n\t\t$all_comments = $comments;\n\t\tforeach ( $descendant_ids as $descendant_id ) {\n\t\t\t$all_comments[] = get_comment( $descendant_id );\n\t\t}\n\n\t\t// If a threaded representation was requested, build the tree.\n\t\tif ( 'threaded' === $this->query_vars['hierarchical'] ) {\n\t\t\t$threaded_comments = array();\n\t\t\t$ref               = array();\n\t\t\tforeach ( $all_comments as $k => $c ) {\n\t\t\t\t$_c = get_comment( $c->comment_ID );\n\n\t\t\t\t// If the comment isn't in the reference array, it goes in the top level of the thread.\n\t\t\t\tif ( ! isset( $ref[ $c->comment_parent ] ) ) {\n\t\t\t\t\t$threaded_comments[ $_c->comment_ID ] = $_c;\n\t\t\t\t\t$ref[ $_c->comment_ID ]               = $threaded_comments[ $_c->comment_ID ];\n\n\t\t\t\t\t// Otherwise, set it as a child of its parent.\n\t\t\t\t} else {\n\n\t\t\t\t\t$ref[ $_c->comment_parent ]->add_child( $_c );\n\t\t\t\t\t$ref[ $_c->comment_ID ] = $ref[ $_c->comment_parent ]->get_child( $_c->comment_ID );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set the 'populated_children' flag, to ensure additional database queries aren't run.\n\t\t\tforeach ( $ref as $_ref ) {\n\t\t\t\t$_ref->populated_children( true );\n\t\t\t}\n\n\t\t\t$comments = $threaded_comments;\n\t\t} else {\n\t\t\t$comments = $all_comments;\n\t\t}\n\n\t\treturn $comments;\n\t}\n\n\t/**\n\t * Used internally to generate an SQL string for searching across multiple columns\n\t *\n\t * @since 3.1.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $string\n\t * @param array  $cols\n\t * @return string\n\t */\n\tprotected function get_search_sql( $string, $cols ) {\n\t\tglobal $wpdb;\n\n\t\t$like = '%' . $wpdb->esc_like( $string ) . '%';\n\n\t\t$searches = array();\n\t\tforeach ( $cols as $col ) {\n\t\t\t$searches[] = $wpdb->prepare( \"$col LIKE %s\", $like );\n\t\t}\n\n\t\treturn ' AND (' . implode( ' OR ', $searches ) . ')';\n\t}\n\n\t/**\n\t * Parse and sanitize 'orderby' keys passed to the comment query.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $orderby Alias for the field to order by.\n\t * @return string|false Value to used in the ORDER clause. False otherwise.\n\t */\n\tprotected function parse_orderby( $orderby ) {\n\t\tglobal $wpdb;\n\n\t\t$allowed_keys = array(\n\t\t\t'comment_agent',\n\t\t\t'comment_approved',\n\t\t\t'comment_author',\n\t\t\t'comment_author_email',\n\t\t\t'comment_author_IP',\n\t\t\t'comment_author_url',\n\t\t\t'comment_content',\n\t\t\t'comment_date',\n\t\t\t'comment_date_gmt',\n\t\t\t'comment_ID',\n\t\t\t'comment_karma',\n\t\t\t'comment_parent',\n\t\t\t'comment_post_ID',\n\t\t\t'comment_type',\n\t\t\t'user_id',\n\t\t);\n\n\t\tif ( ! empty( $this->query_vars['meta_key'] ) ) {\n\t\t\t$allowed_keys[] = $this->query_vars['meta_key'];\n\t\t\t$allowed_keys[] = 'meta_value';\n\t\t\t$allowed_keys[] = 'meta_value_num';\n\t\t}\n\n\t\t$meta_query_clauses = $this->meta_query->get_clauses();\n\t\tif ( $meta_query_clauses ) {\n\t\t\t$allowed_keys = array_merge( $allowed_keys, array_keys( $meta_query_clauses ) );\n\t\t}\n\n\t\t$parsed = false;\n\t\tif ( $this->query_vars['meta_key'] === $orderby || 'meta_value' === $orderby ) {\n\t\t\t$parsed = \"$wpdb->commentmeta.meta_value\";\n\t\t} elseif ( 'meta_value_num' === $orderby ) {\n\t\t\t$parsed = \"$wpdb->commentmeta.meta_value+0\";\n\t\t} elseif ( 'comment__in' === $orderby ) {\n\t\t\t$comment__in = implode( ',', array_map( 'absint', $this->query_vars['comment__in'] ) );\n\t\t\t$parsed      = \"FIELD( {$wpdb->comments}.comment_ID, $comment__in )\";\n\t\t} elseif ( in_array( $orderby, $allowed_keys, true ) ) {\n\n\t\t\tif ( isset( $meta_query_clauses[ $orderby ] ) ) {\n\t\t\t\t$meta_clause = $meta_query_clauses[ $orderby ];\n\t\t\t\t$parsed      = sprintf( 'CAST(%s.meta_value AS %s)', esc_sql( $meta_clause['alias'] ), esc_sql( $meta_clause['cast'] ) );\n\t\t\t} else {\n\t\t\t\t$parsed = \"$wpdb->comments.$orderby\";\n\t\t\t}\n\t\t}\n\n\t\treturn $parsed;\n\t}\n\n\t/**\n\t * Parse an 'order' query variable and cast it to ASC or DESC as necessary.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param string $order The 'order' query variable.\n\t * @return string The sanitized 'order' query variable.\n\t */\n\tprotected function parse_order( $order ) {\n\t\tif ( ! is_string( $order ) || empty( $order ) ) {\n\t\t\treturn 'DESC';\n\t\t}\n\n\t\tif ( 'ASC' === strtoupper( $order ) ) {\n\t\t\treturn 'ASC';\n\t\t} else {\n\t\t\treturn 'DESC';\n\t\t}\n\t}\n}\n", "num_lines": 1187}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Comment API: WP_Comment class\n *\n * @package WordPress\n * @subpackage Comments\n * @since 4.4.0\n */\n\n/**\n * Core class used to organize comments as instantiated objects with defined members.\n *\n * @since 4.4.0\n */\nfinal class WP_Comment {\n\n\t/**\n\t * Comment ID.\n\t *\n\t * @since 4.4.0\n\t * @var int\n\t */\n\tpublic $comment_ID;\n\n\t/**\n\t * ID of the post the comment is associated with.\n\t *\n\t * @since 4.4.0\n\t * @var int\n\t */\n\tpublic $comment_post_ID = 0;\n\n\t/**\n\t * Comment author name.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $comment_author = '';\n\n\t/**\n\t * Comment author email address.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $comment_author_email = '';\n\n\t/**\n\t * Comment author URL.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $comment_author_url = '';\n\n\t/**\n\t * Comment author IP address (IPv4 format).\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $comment_author_IP = '';\n\n\t/**\n\t * Comment date in YYYY-MM-DD HH:MM:SS format.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $comment_date = '0000-00-00 00:00:00';\n\n\t/**\n\t * Comment GMT date in YYYY-MM-DD HH::MM:SS format.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $comment_date_gmt = '0000-00-00 00:00:00';\n\n\t/**\n\t * Comment content.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $comment_content;\n\n\t/**\n\t * Comment karma count.\n\t *\n\t * @since 4.4.0\n\t * @var int\n\t */\n\tpublic $comment_karma = 0;\n\n\t/**\n\t * Comment approval status.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $comment_approved = '1';\n\n\t/**\n\t * Comment author HTTP user agent.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $comment_agent = '';\n\n\t/**\n\t * Comment type.\n\t *\n\t * @since 4.4.0\n\t * @since 5.5.0 Default value changed to `comment`.\n\t * @var string\n\t */\n\tpublic $comment_type = 'comment';\n\n\t/**\n\t * Parent comment ID.\n\t *\n\t * @since 4.4.0\n\t * @var int\n\t */\n\tpublic $comment_parent = 0;\n\n\t/**\n\t * Comment author ID.\n\t *\n\t * @since 4.4.0\n\t * @var int\n\t */\n\tpublic $user_id = 0;\n\n\t/**\n\t * Comment children.\n\t *\n\t * @since 4.4.0\n\t * @var array\n\t */\n\tprotected $children;\n\n\t/**\n\t * Whether children have been populated for this comment object.\n\t *\n\t * @since 4.4.0\n\t * @var bool\n\t */\n\tprotected $populated_children = false;\n\n\t/**\n\t * Post fields.\n\t *\n\t * @since 4.4.0\n\t * @var array\n\t */\n\tprotected $post_fields = array( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_content_filtered', 'post_parent', 'guid', 'menu_order', 'post_type', 'post_mime_type', 'comment_count' );\n\n\t/**\n\t * Retrieves a WP_Comment instance.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param int $id Comment ID.\n\t * @return WP_Comment|false Comment object, otherwise false.\n\t */\n\tpublic static function get_instance( $id ) {\n\t\tglobal $wpdb;\n\n\t\t$comment_id = (int) $id;\n\t\tif ( ! $comment_id ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$_comment = wp_cache_get( $comment_id, 'comment' );\n\n\t\tif ( ! $_comment ) {\n\t\t\t$_comment = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1\", $comment_id ) );\n\n\t\t\tif ( ! $_comment ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\twp_cache_add( $_comment->comment_ID, $_comment, 'comment' );\n\t\t}\n\n\t\treturn new WP_Comment( $_comment );\n\t}\n\n\t/**\n\t * Constructor.\n\t *\n\t * Populates properties with object vars.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param WP_Comment $comment Comment object.\n\t */\n\tpublic function __construct( $comment ) {\n\t\tforeach ( get_object_vars( $comment ) as $key => $value ) {\n\t\t\t$this->$key = $value;\n\t\t}\n\t}\n\n\t/**\n\t * Convert object to array.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return array Object as array.\n\t */\n\tpublic function to_array() {\n\t\treturn get_object_vars( $this );\n\t}\n\n\t/**\n\t * Get the children of a comment.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $args {\n\t *     Array of arguments used to pass to get_comments() and determine format.\n\t *\n\t *     @type string $format        Return value format. 'tree' for a hierarchical tree, 'flat' for a flattened array.\n\t *                                 Default 'tree'.\n\t *     @type string $status        Comment status to limit results by. Accepts 'hold' (`comment_status=0`),\n\t *                                 'approve' (`comment_status=1`), 'all', or a custom comment status.\n\t *                                 Default 'all'.\n\t *     @type string $hierarchical  Whether to include comment descendants in the results.\n\t *                                 'threaded' returns a tree, with each comment's children\n\t *                                 stored in a `children` property on the `WP_Comment` object.\n\t *                                 'flat' returns a flat array of found comments plus their children.\n\t *                                 Pass `false` to leave out descendants.\n\t *                                 The parameter is ignored (forced to `false`) when `$fields` is 'ids' or 'counts'.\n\t *                                 Accepts 'threaded', 'flat', or false. Default: 'threaded'.\n\t *     @type string|array $orderby Comment status or array of statuses. To use 'meta_value'\n\t *                                 or 'meta_value_num', `$meta_key` must also be defined.\n\t *                                 To sort by a specific `$meta_query` clause, use that\n\t *                                 clause's array key. Accepts 'comment_agent',\n\t *                                 'comment_approved', 'comment_author',\n\t *                                 'comment_author_email', 'comment_author_IP',\n\t *                                 'comment_author_url', 'comment_content', 'comment_date',\n\t *                                 'comment_date_gmt', 'comment_ID', 'comment_karma',\n\t *                                 'comment_parent', 'comment_post_ID', 'comment_type',\n\t *                                 'user_id', 'comment__in', 'meta_value', 'meta_value_num',\n\t *                                 the value of $meta_key, and the array keys of\n\t *                                 `$meta_query`. Also accepts false, an empty array, or\n\t *                                 'none' to disable `ORDER BY` clause.\n\t * }\n\t * @return WP_Comment[] Array of `WP_Comment` objects.\n\t */\n\tpublic function get_children( $args = array() ) {\n\t\t$defaults = array(\n\t\t\t'format'       => 'tree',\n\t\t\t'status'       => 'all',\n\t\t\t'hierarchical' => 'threaded',\n\t\t\t'orderby'      => '',\n\t\t);\n\n\t\t$_args           = wp_parse_args( $args, $defaults );\n\t\t$_args['parent'] = $this->comment_ID;\n\n\t\tif ( is_null( $this->children ) ) {\n\t\t\tif ( $this->populated_children ) {\n\t\t\t\t$this->children = array();\n\t\t\t} else {\n\t\t\t\t$this->children = get_comments( $_args );\n\t\t\t}\n\t\t}\n\n\t\tif ( 'flat' === $_args['format'] ) {\n\t\t\t$children = array();\n\t\t\tforeach ( $this->children as $child ) {\n\t\t\t\t$child_args           = $_args;\n\t\t\t\t$child_args['format'] = 'flat';\n\t\t\t\t// get_children() resets this value automatically.\n\t\t\t\tunset( $child_args['parent'] );\n\n\t\t\t\t$children = array_merge( $children, array( $child ), $child->get_children( $child_args ) );\n\t\t\t}\n\t\t} else {\n\t\t\t$children = $this->children;\n\t\t}\n\n\t\treturn $children;\n\t}\n\n\t/**\n\t * Add a child to the comment.\n\t *\n\t * Used by `WP_Comment_Query` when bulk-filling descendants.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param WP_Comment $child Child comment.\n\t */\n\tpublic function add_child( WP_Comment $child ) {\n\t\t$this->children[ $child->comment_ID ] = $child;\n\t}\n\n\t/**\n\t * Get a child comment by ID.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param int $child_id ID of the child.\n\t * @return WP_Comment|bool Returns the comment object if found, otherwise false.\n\t */\n\tpublic function get_child( $child_id ) {\n\t\tif ( isset( $this->children[ $child_id ] ) ) {\n\t\t\treturn $this->children[ $child_id ];\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Set the 'populated_children' flag.\n\t *\n\t * This flag is important for ensuring that calling `get_children()` on a childless comment will not trigger\n\t * unneeded database queries.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param bool $set Whether the comment's children have already been populated.\n\t */\n\tpublic function populated_children( $set ) {\n\t\t$this->populated_children = (bool) $set;\n\t}\n\n\t/**\n\t * Check whether a non-public property is set.\n\t *\n\t * If `$name` matches a post field, the comment post will be loaded and the post's value checked.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $name Property name.\n\t * @return bool\n\t */\n\tpublic function __isset( $name ) {\n\t\tif ( in_array( $name, $this->post_fields, true ) && 0 !== (int) $this->comment_post_ID ) {\n\t\t\t$post = get_post( $this->comment_post_ID );\n\t\t\treturn property_exists( $post, $name );\n\t\t}\n\t}\n\n\t/**\n\t * Magic getter.\n\t *\n\t * If `$name` matches a post field, the comment post will be loaded and the post's value returned.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $name\n\t * @return mixed\n\t */\n\tpublic function __get( $name ) {\n\t\tif ( in_array( $name, $this->post_fields, true ) ) {\n\t\t\t$post = get_post( $this->comment_post_ID );\n\t\t\treturn $post->$name;\n\t\t}\n\t}\n}\n", "num_lines": 370}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Customize Control classes\n *\n * @package WordPress\n * @subpackage Customize\n * @since 3.4.0\n */\n\n/**\n * Customize Control class.\n *\n * @since 3.4.0\n */\nclass WP_Customize_Control {\n\n\t/**\n\t * Incremented with each new class instantiation, then stored in $instance_number.\n\t *\n\t * Used when sorting two instances whose priorities are equal.\n\t *\n\t * @since 4.1.0\n\t * @var int\n\t */\n\tprotected static $instance_count = 0;\n\n\t/**\n\t * Order in which this instance was created in relation to other instances.\n\t *\n\t * @since 4.1.0\n\t * @var int\n\t */\n\tpublic $instance_number;\n\n\t/**\n\t * Customizer manager.\n\t *\n\t * @since 3.4.0\n\t * @var WP_Customize_Manager\n\t */\n\tpublic $manager;\n\n\t/**\n\t * Control ID.\n\t *\n\t * @since 3.4.0\n\t * @var string\n\t */\n\tpublic $id;\n\n\t/**\n\t * All settings tied to the control.\n\t *\n\t * @since 3.4.0\n\t * @var array\n\t */\n\tpublic $settings;\n\n\t/**\n\t * The primary setting for the control (if there is one).\n\t *\n\t * @since 3.4.0\n\t * @var string\n\t */\n\tpublic $setting = 'default';\n\n\t/**\n\t * Capability required to use this control.\n\t *\n\t * Normally this is empty and the capability is derived from the capabilities\n\t * of the associated `$settings`.\n\t *\n\t * @since 4.5.0\n\t * @var string\n\t */\n\tpublic $capability;\n\n\t/**\n\t * Order priority to load the control in Customizer.\n\t *\n\t * @since 3.4.0\n\t * @var int\n\t */\n\tpublic $priority = 10;\n\n\t/**\n\t * Section the control belongs to.\n\t *\n\t * @since 3.4.0\n\t * @var string\n\t */\n\tpublic $section = '';\n\n\t/**\n\t * Label for the control.\n\t *\n\t * @since 3.4.0\n\t * @var string\n\t */\n\tpublic $label = '';\n\n\t/**\n\t * Description for the control.\n\t *\n\t * @since 4.0.0\n\t * @var string\n\t */\n\tpublic $description = '';\n\n\t/**\n\t * List of choices for 'radio' or 'select' type controls, where values are the keys, and labels are the values.\n\t *\n\t * @since 3.4.0\n\t * @var array\n\t */\n\tpublic $choices = array();\n\n\t/**\n\t * List of custom input attributes for control output, where attribute names are the keys and values are the values.\n\t *\n\t * Not used for 'checkbox', 'radio', 'select', 'textarea', or 'dropdown-pages' control types.\n\t *\n\t * @since 4.0.0\n\t * @var array\n\t */\n\tpublic $input_attrs = array();\n\n\t/**\n\t * Show UI for adding new content, currently only used for the dropdown-pages control.\n\t *\n\t * @since 4.7.0\n\t * @var bool\n\t */\n\tpublic $allow_addition = false;\n\n\t/**\n\t * @deprecated It is better to just call the json() method\n\t * @since 3.4.0\n\t * @var array\n\t */\n\tpublic $json = array();\n\n\t/**\n\t * Control's Type.\n\t *\n\t * @since 3.4.0\n\t * @var string\n\t */\n\tpublic $type = 'text';\n\n\t/**\n\t * Callback.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @see WP_Customize_Control::active()\n\t *\n\t * @var callable Callback is called with one argument, the instance of\n\t *               WP_Customize_Control, and returns bool to indicate whether\n\t *               the control is active (such as it relates to the URL\n\t *               currently being previewed).\n\t */\n\tpublic $active_callback = '';\n\n\t/**\n\t * Constructor.\n\t *\n\t * Supplied `$args` override class property defaults.\n\t *\n\t * If `$args['settings']` is not defined, use the $id as the setting ID.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t * @param string               $id      Control ID.\n\t * @param array                $args    {\n\t *     Optional. Array of properties for the new Control object. Default empty array.\n\t *\n\t *     @type int                  $instance_number Order in which this instance was created in relation\n\t *                                                 to other instances.\n\t *     @type WP_Customize_Manager $manager         Customizer bootstrap instance.\n\t *     @type string               $id              Control ID.\n\t *     @type array                $settings        All settings tied to the control. If undefined, `$id` will\n\t *                                                 be used.\n\t *     @type string               $setting         The primary setting for the control (if there is one).\n\t *                                                 Default 'default'.\n\t *     @type string               $capability      Capability required to use this control. Normally this is empty\n\t *                                                 and the capability is derived from `$settings`.\n\t *     @type int                  $priority        Order priority to load the control. Default 10.\n\t *     @type string               $section         Section the control belongs to. Default empty.\n\t *     @type string               $label           Label for the control. Default empty.\n\t *     @type string               $description     Description for the control. Default empty.\n\t *     @type array                $choices         List of choices for 'radio' or 'select' type controls, where\n\t *                                                 values are the keys, and labels are the values.\n\t *                                                 Default empty array.\n\t *     @type array                $input_attrs     List of custom input attributes for control output, where\n\t *                                                 attribute names are the keys and values are the values. Not\n\t *                                                 used for 'checkbox', 'radio', 'select', 'textarea', or\n\t *                                                 'dropdown-pages' control types. Default empty array.\n\t *     @type bool                 $allow_addition  Show UI for adding new content, currently only used for the\n\t *                                                 dropdown-pages control. Default false.\n\t *     @type array                $json            Deprecated. Use WP_Customize_Control::json() instead.\n\t *     @type string               $type            Control type. Core controls include 'text', 'checkbox',\n\t *                                                 'textarea', 'radio', 'select', and 'dropdown-pages'. Additional\n\t *                                                 input types such as 'email', 'url', 'number', 'hidden', and\n\t *                                                 'date' are supported implicitly. Default 'text'.\n\t *     @type callable             $active_callback Active callback.\n\t * }\n\t */\n\tpublic function __construct( $manager, $id, $args = array() ) {\n\t\t$keys = array_keys( get_object_vars( $this ) );\n\t\tforeach ( $keys as $key ) {\n\t\t\tif ( isset( $args[ $key ] ) ) {\n\t\t\t\t$this->$key = $args[ $key ];\n\t\t\t}\n\t\t}\n\n\t\t$this->manager = $manager;\n\t\t$this->id      = $id;\n\t\tif ( empty( $this->active_callback ) ) {\n\t\t\t$this->active_callback = array( $this, 'active_callback' );\n\t\t}\n\t\tself::$instance_count += 1;\n\t\t$this->instance_number = self::$instance_count;\n\n\t\t// Process settings.\n\t\tif ( ! isset( $this->settings ) ) {\n\t\t\t$this->settings = $id;\n\t\t}\n\n\t\t$settings = array();\n\t\tif ( is_array( $this->settings ) ) {\n\t\t\tforeach ( $this->settings as $key => $setting ) {\n\t\t\t\t$settings[ $key ] = $this->manager->get_setting( $setting );\n\t\t\t}\n\t\t} elseif ( is_string( $this->settings ) ) {\n\t\t\t$this->setting       = $this->manager->get_setting( $this->settings );\n\t\t\t$settings['default'] = $this->setting;\n\t\t}\n\t\t$this->settings = $settings;\n\t}\n\n\t/**\n\t * Enqueue control related scripts/styles.\n\t *\n\t * @since 3.4.0\n\t */\n\tpublic function enqueue() {}\n\n\t/**\n\t * Check whether control is active to current Customizer preview.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @return bool Whether the control is active to the current preview.\n\t */\n\tfinal public function active() {\n\t\t$control = $this;\n\t\t$active  = call_user_func( $this->active_callback, $this );\n\n\t\t/**\n\t\t * Filters response of WP_Customize_Control::active().\n\t\t *\n\t\t * @since 4.0.0\n\t\t *\n\t\t * @param bool                 $active  Whether the Customizer control is active.\n\t\t * @param WP_Customize_Control $control WP_Customize_Control instance.\n\t\t */\n\t\t$active = apply_filters( 'customize_control_active', $active, $control );\n\n\t\treturn $active;\n\t}\n\n\t/**\n\t * Default callback used when invoking WP_Customize_Control::active().\n\t *\n\t * Subclasses can override this with their specific logic, or they may\n\t * provide an 'active_callback' argument to the constructor.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @return true Always true.\n\t */\n\tpublic function active_callback() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Fetch a setting's value.\n\t * Grabs the main setting by default.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $setting_key\n\t * @return mixed The requested setting's value, if the setting exists.\n\t */\n\tfinal public function value( $setting_key = 'default' ) {\n\t\tif ( isset( $this->settings[ $setting_key ] ) ) {\n\t\t\treturn $this->settings[ $setting_key ]->value();\n\t\t}\n\t}\n\n\t/**\n\t * Refresh the parameters passed to the JavaScript via JSON.\n\t *\n\t * @since 3.4.0\n\t */\n\tpublic function to_json() {\n\t\t$this->json['settings'] = array();\n\t\tforeach ( $this->settings as $key => $setting ) {\n\t\t\t$this->json['settings'][ $key ] = $setting->id;\n\t\t}\n\n\t\t$this->json['type']           = $this->type;\n\t\t$this->json['priority']       = $this->priority;\n\t\t$this->json['active']         = $this->active();\n\t\t$this->json['section']        = $this->section;\n\t\t$this->json['content']        = $this->get_content();\n\t\t$this->json['label']          = $this->label;\n\t\t$this->json['description']    = $this->description;\n\t\t$this->json['instanceNumber'] = $this->instance_number;\n\n\t\tif ( 'dropdown-pages' === $this->type ) {\n\t\t\t$this->json['allow_addition'] = $this->allow_addition;\n\t\t}\n\t}\n\n\t/**\n\t * Get the data to export to the client via JSON.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @return array Array of parameters passed to the JavaScript.\n\t */\n\tpublic function json() {\n\t\t$this->to_json();\n\t\treturn $this->json;\n\t}\n\n\t/**\n\t * Checks if the user can use this control.\n\t *\n\t * Returns false if the user cannot manipulate one of the associated settings,\n\t * or if one of the associated settings does not exist. Also returns false if\n\t * the associated section does not exist or if its capability check returns\n\t * false.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return bool False if theme doesn't support the control or user doesn't have the required permissions, otherwise true.\n\t */\n\tfinal public function check_capabilities() {\n\t\tif ( ! empty( $this->capability ) && ! current_user_can( $this->capability ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ( $this->settings as $setting ) {\n\t\t\tif ( ! $setting || ! $setting->check_capabilities() ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$section = $this->manager->get_section( $this->section );\n\t\tif ( isset( $section ) && ! $section->check_capabilities() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Get the control's content for insertion into the Customizer pane.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @return string Contents of the control.\n\t */\n\tfinal public function get_content() {\n\t\tob_start();\n\t\t$this->maybe_render();\n\t\treturn trim( ob_get_clean() );\n\t}\n\n\t/**\n\t * Check capabilities and render the control.\n\t *\n\t * @since 3.4.0\n\t * @uses WP_Customize_Control::render()\n\t */\n\tfinal public function maybe_render() {\n\t\tif ( ! $this->check_capabilities() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Fires just before the current Customizer control is rendered.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param WP_Customize_Control $this WP_Customize_Control instance.\n\t\t */\n\t\tdo_action( 'customize_render_control', $this );\n\n\t\t/**\n\t\t * Fires just before a specific Customizer control is rendered.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->id`, refers to\n\t\t * the control ID.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param WP_Customize_Control $this WP_Customize_Control instance.\n\t\t */\n\t\tdo_action( \"customize_render_control_{$this->id}\", $this );\n\n\t\t$this->render();\n\t}\n\n\t/**\n\t * Renders the control wrapper and calls $this->render_content() for the internals.\n\t *\n\t * @since 3.4.0\n\t */\n\tprotected function render() {\n\t\t$id    = 'customize-control-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id );\n\t\t$class = 'customize-control customize-control-' . $this->type;\n\n\t\tprintf( '<li id=\"%s\" class=\"%s\">', esc_attr( $id ), esc_attr( $class ) );\n\t\t$this->render_content();\n\t\techo '</li>';\n\t}\n\n\t/**\n\t * Get the data link attribute for a setting.\n\t *\n\t * @since 3.4.0\n\t * @since 4.9.0 Return a `data-customize-setting-key-link` attribute if a setting is not registered for the supplied setting key.\n\t *\n\t * @param string $setting_key\n\t * @return string Data link parameter, a `data-customize-setting-link` attribute if the `$setting_key` refers to a pre-registered setting,\n\t *                and a `data-customize-setting-key-link` attribute if the setting is not yet registered.\n\t */\n\tpublic function get_link( $setting_key = 'default' ) {\n\t\tif ( isset( $this->settings[ $setting_key ] ) && $this->settings[ $setting_key ] instanceof WP_Customize_Setting ) {\n\t\t\treturn 'data-customize-setting-link=\"' . esc_attr( $this->settings[ $setting_key ]->id ) . '\"';\n\t\t} else {\n\t\t\treturn 'data-customize-setting-key-link=\"' . esc_attr( $setting_key ) . '\"';\n\t\t}\n\t}\n\n\t/**\n\t * Render the data link attribute for the control's input element.\n\t *\n\t * @since 3.4.0\n\t * @uses WP_Customize_Control::get_link()\n\t *\n\t * @param string $setting_key\n\t */\n\tpublic function link( $setting_key = 'default' ) {\n\t\techo $this->get_link( $setting_key );\n\t}\n\n\t/**\n\t * Render the custom attributes for the control's input element.\n\t *\n\t * @since 4.0.0\n\t */\n\tpublic function input_attrs() {\n\t\tforeach ( $this->input_attrs as $attr => $value ) {\n\t\t\techo $attr . '=\"' . esc_attr( $value ) . '\" ';\n\t\t}\n\t}\n\n\t/**\n\t * Render the control's content.\n\t *\n\t * Allows the content to be overridden without having to rewrite the wrapper in `$this::render()`.\n\t *\n\t * Supports basic input types `text`, `checkbox`, `textarea`, `radio`, `select` and `dropdown-pages`.\n\t * Additional input types such as `email`, `url`, `number`, `hidden` and `date` are supported implicitly.\n\t *\n\t * Control content can alternately be rendered in JS. See WP_Customize_Control::print_template().\n\t *\n\t * @since 3.4.0\n\t */\n\tprotected function render_content() {\n\t\t$input_id         = '_customize-input-' . $this->id;\n\t\t$description_id   = '_customize-description-' . $this->id;\n\t\t$describedby_attr = ( ! empty( $this->description ) ) ? ' aria-describedby=\"' . esc_attr( $description_id ) . '\" ' : '';\n\t\tswitch ( $this->type ) {\n\t\t\tcase 'checkbox':\n\t\t\t\t?>\n\t\t\t\t<span class=\"customize-inside-control-row\">\n\t\t\t\t\t<input\n\t\t\t\t\t\tid=\"<?php echo esc_attr( $input_id ); ?>\"\n\t\t\t\t\t\t<?php echo $describedby_attr; ?>\n\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\tvalue=\"<?php echo esc_attr( $this->value() ); ?>\"\n\t\t\t\t\t\t<?php $this->link(); ?>\n\t\t\t\t\t\t<?php checked( $this->value() ); ?>\n\t\t\t\t\t/>\n\t\t\t\t\t<label for=\"<?php echo esc_attr( $input_id ); ?>\"><?php echo esc_html( $this->label ); ?></label>\n\t\t\t\t\t<?php if ( ! empty( $this->description ) ) : ?>\n\t\t\t\t\t\t<span id=\"<?php echo esc_attr( $description_id ); ?>\" class=\"description customize-control-description\"><?php echo $this->description; ?></span>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t</span>\n\t\t\t\t<?php\n\t\t\t\tbreak;\n\t\t\tcase 'radio':\n\t\t\t\tif ( empty( $this->choices ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$name = '_customize-radio-' . $this->id;\n\t\t\t\t?>\n\t\t\t\t<?php if ( ! empty( $this->label ) ) : ?>\n\t\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) : ?>\n\t\t\t\t\t<span id=\"<?php echo esc_attr( $description_id ); ?>\" class=\"description customize-control-description\"><?php echo $this->description; ?></span>\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\t<?php foreach ( $this->choices as $value => $label ) : ?>\n\t\t\t\t\t<span class=\"customize-inside-control-row\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tid=\"<?php echo esc_attr( $input_id . '-radio-' . $value ); ?>\"\n\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t<?php echo $describedby_attr; ?>\n\t\t\t\t\t\t\tvalue=\"<?php echo esc_attr( $value ); ?>\"\n\t\t\t\t\t\t\tname=\"<?php echo esc_attr( $name ); ?>\"\n\t\t\t\t\t\t\t<?php $this->link(); ?>\n\t\t\t\t\t\t\t<?php checked( $this->value(), $value ); ?>\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t<label for=\"<?php echo esc_attr( $input_id . '-radio-' . $value ); ?>\"><?php echo esc_html( $label ); ?></label>\n\t\t\t\t\t</span>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t\t<?php\n\t\t\t\tbreak;\n\t\t\tcase 'select':\n\t\t\t\tif ( empty( $this->choices ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t?>\n\t\t\t\t<?php if ( ! empty( $this->label ) ) : ?>\n\t\t\t\t\t<label for=\"<?php echo esc_attr( $input_id ); ?>\" class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></label>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) : ?>\n\t\t\t\t\t<span id=\"<?php echo esc_attr( $description_id ); ?>\" class=\"description customize-control-description\"><?php echo $this->description; ?></span>\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\t<select id=\"<?php echo esc_attr( $input_id ); ?>\" <?php echo $describedby_attr; ?> <?php $this->link(); ?>>\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $this->choices as $value => $label ) {\n\t\t\t\t\t\techo '<option value=\"' . esc_attr( $value ) . '\"' . selected( $this->value(), $value, false ) . '>' . $label . '</option>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</select>\n\t\t\t\t<?php\n\t\t\t\tbreak;\n\t\t\tcase 'textarea':\n\t\t\t\t?>\n\t\t\t\t<?php if ( ! empty( $this->label ) ) : ?>\n\t\t\t\t\t<label for=\"<?php echo esc_attr( $input_id ); ?>\" class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></label>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) : ?>\n\t\t\t\t\t<span id=\"<?php echo esc_attr( $description_id ); ?>\" class=\"description customize-control-description\"><?php echo $this->description; ?></span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<textarea\n\t\t\t\t\tid=\"<?php echo esc_attr( $input_id ); ?>\"\n\t\t\t\t\trows=\"5\"\n\t\t\t\t\t<?php echo $describedby_attr; ?>\n\t\t\t\t\t<?php $this->input_attrs(); ?>\n\t\t\t\t\t<?php $this->link(); ?>\n\t\t\t\t><?php echo esc_textarea( $this->value() ); ?></textarea>\n\t\t\t\t<?php\n\t\t\t\tbreak;\n\t\t\tcase 'dropdown-pages':\n\t\t\t\t?>\n\t\t\t\t<?php if ( ! empty( $this->label ) ) : ?>\n\t\t\t\t\t<label for=\"<?php echo esc_attr( $input_id ); ?>\" class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></label>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) : ?>\n\t\t\t\t\t<span id=\"<?php echo esc_attr( $description_id ); ?>\" class=\"description customize-control-description\"><?php echo $this->description; ?></span>\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\t<?php\n\t\t\t\t$dropdown_name     = '_customize-dropdown-pages-' . $this->id;\n\t\t\t\t$show_option_none  = __( '&mdash; Select &mdash;' );\n\t\t\t\t$option_none_value = '0';\n\t\t\t\t$dropdown          = wp_dropdown_pages(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name'              => $dropdown_name,\n\t\t\t\t\t\t'echo'              => 0,\n\t\t\t\t\t\t'show_option_none'  => $show_option_none,\n\t\t\t\t\t\t'option_none_value' => $option_none_value,\n\t\t\t\t\t\t'selected'          => $this->value(),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tif ( empty( $dropdown ) ) {\n\t\t\t\t\t$dropdown  = sprintf( '<select id=\"%1$s\" name=\"%1$s\">', esc_attr( $dropdown_name ) );\n\t\t\t\t\t$dropdown .= sprintf( '<option value=\"%1$s\">%2$s</option>', esc_attr( $option_none_value ), esc_html( $show_option_none ) );\n\t\t\t\t\t$dropdown .= '</select>';\n\t\t\t\t}\n\n\t\t\t\t// Hackily add in the data link parameter.\n\t\t\t\t$dropdown = str_replace( '<select', '<select ' . $this->get_link() . ' id=\"' . esc_attr( $input_id ) . '\" ' . $describedby_attr, $dropdown );\n\n\t\t\t\t// Even more hacikly add auto-draft page stubs.\n\t\t\t\t// @todo Eventually this should be removed in favor of the pages being injected into the underlying get_pages() call. See <https://github.com/xwp/wp-customize-posts/pull/250>.\n\t\t\t\t$nav_menus_created_posts_setting = $this->manager->get_setting( 'nav_menus_created_posts' );\n\t\t\t\tif ( $nav_menus_created_posts_setting && current_user_can( 'publish_pages' ) ) {\n\t\t\t\t\t$auto_draft_page_options = '';\n\t\t\t\t\tforeach ( $nav_menus_created_posts_setting->value() as $auto_draft_page_id ) {\n\t\t\t\t\t\t$post = get_post( $auto_draft_page_id );\n\t\t\t\t\t\tif ( $post && 'page' === $post->post_type ) {\n\t\t\t\t\t\t\t$auto_draft_page_options .= sprintf( '<option value=\"%1$s\">%2$s</option>', esc_attr( $post->ID ), esc_html( $post->post_title ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( $auto_draft_page_options ) {\n\t\t\t\t\t\t$dropdown = str_replace( '</select>', $auto_draft_page_options . '</select>', $dropdown );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\techo $dropdown;\n\t\t\t\t?>\n\t\t\t\t<?php if ( $this->allow_addition && current_user_can( 'publish_pages' ) && current_user_can( 'edit_theme_options' ) ) : // Currently tied to menus functionality. ?>\n\t\t\t\t\t<button type=\"button\" class=\"button-link add-new-toggle\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t/* translators: %s: Add New Page label. */\n\t\t\t\t\t\tprintf( __( '+ %s' ), get_post_type_object( 'page' )->labels->add_new_item );\n\t\t\t\t\t\t?>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"new-content-item\">\n\t\t\t\t\t\t<label for=\"create-input-<?php echo $this->id; ?>\"><span class=\"screen-reader-text\"><?php _e( 'New page title' ); ?></span></label>\n\t\t\t\t\t\t<input type=\"text\" id=\"create-input-<?php echo $this->id; ?>\" class=\"create-item-input\" placeholder=\"<?php esc_attr_e( 'New page title&hellip;' ); ?>\">\n\t\t\t\t\t\t<button type=\"button\" class=\"button add-content\"><?php _e( 'Add' ); ?></button>\n\t\t\t\t\t</div>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t?>\n\t\t\t\t<?php if ( ! empty( $this->label ) ) : ?>\n\t\t\t\t\t<label for=\"<?php echo esc_attr( $input_id ); ?>\" class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></label>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) : ?>\n\t\t\t\t\t<span id=\"<?php echo esc_attr( $description_id ); ?>\" class=\"description customize-control-description\"><?php echo $this->description; ?></span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<input\n\t\t\t\t\tid=\"<?php echo esc_attr( $input_id ); ?>\"\n\t\t\t\t\ttype=\"<?php echo esc_attr( $this->type ); ?>\"\n\t\t\t\t\t<?php echo $describedby_attr; ?>\n\t\t\t\t\t<?php $this->input_attrs(); ?>\n\t\t\t\t\t<?php if ( ! isset( $this->input_attrs['value'] ) ) : ?>\n\t\t\t\t\t\tvalue=\"<?php echo esc_attr( $this->value() ); ?>\"\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<?php $this->link(); ?>\n\t\t\t\t\t/>\n\t\t\t\t<?php\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Render the control's JS template.\n\t *\n\t * This function is only run for control types that have been registered with\n\t * WP_Customize_Manager::register_control_type().\n\t *\n\t * In the future, this will also print the template for the control's container\n\t * element and be override-able.\n\t *\n\t * @since 4.1.0\n\t */\n\tfinal public function print_template() {\n\t\t?>\n\t\t<script type=\"text/html\" id=\"tmpl-customize-control-<?php echo $this->type; ?>-content\">\n\t\t\t<?php $this->content_template(); ?>\n\t\t</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * An Underscore (JS) template for this control's content (but not its container).\n\t *\n\t * Class variables for this control class are available in the `data` JS object;\n\t * export custom variables by overriding WP_Customize_Control::to_json().\n\t *\n\t * @see WP_Customize_Control::print_template()\n\t *\n\t * @since 4.1.0\n\t */\n\tprotected function content_template() {}\n\n}\n\n/**\n * WP_Customize_Color_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-color-control.php';\n\n/**\n * WP_Customize_Media_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-media-control.php';\n\n/**\n * WP_Customize_Upload_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-upload-control.php';\n\n/**\n * WP_Customize_Image_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-image-control.php';\n\n/**\n * WP_Customize_Background_Image_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-background-image-control.php';\n\n/**\n * WP_Customize_Background_Position_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-background-position-control.php';\n\n/**\n * WP_Customize_Cropped_Image_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php';\n\n/**\n * WP_Customize_Site_Icon_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php';\n\n/**\n * WP_Customize_Header_Image_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php';\n\n/**\n * WP_Customize_Theme_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php';\n\n/**\n * WP_Widget_Area_Customize_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-widget-area-customize-control.php';\n\n/**\n * WP_Widget_Form_Customize_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-widget-form-customize-control.php';\n\n/**\n * WP_Customize_Nav_Menu_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-control.php';\n\n/**\n * WP_Customize_Nav_Menu_Item_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-control.php';\n\n/**\n * WP_Customize_Nav_Menu_Location_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-location-control.php';\n\n/**\n * WP_Customize_Nav_Menu_Name_Control class.\n *\n * As this file is deprecated, it will trigger a deprecation notice if instantiated. In a subsequent\n * release, the require_once here will be removed and _deprecated_file() will be called if file is\n * required at all.\n *\n * @deprecated 4.9.0 This file is no longer used due to new menu creation UX.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-name-control.php';\n\n/**\n * WP_Customize_Nav_Menu_Locations_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-locations-control.php';\n\n/**\n * WP_Customize_Nav_Menu_Auto_Add_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-auto-add-control.php';\n\n/**\n * WP_Customize_Date_Time_Control class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-date-time-control.php';\n", "num_lines": 798}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Customize Manager classes\n *\n * @package WordPress\n * @subpackage Customize\n * @since 3.4.0\n */\n\n/**\n * Customize Manager class.\n *\n * Bootstraps the Customize experience on the server-side.\n *\n * Sets up the theme-switching process if a theme other than the active one is\n * being previewed and customized.\n *\n * Serves as a factory for Customize Controls and Settings, and\n * instantiates default Customize Controls and Settings.\n *\n * @since 3.4.0\n */\nfinal class WP_Customize_Manager {\n\t/**\n\t * An instance of the theme being previewed.\n\t *\n\t * @since 3.4.0\n\t * @var WP_Theme\n\t */\n\tprotected $theme;\n\n\t/**\n\t * The directory name of the previously active theme (within the theme_root).\n\t *\n\t * @since 3.4.0\n\t * @var string\n\t */\n\tprotected $original_stylesheet;\n\n\t/**\n\t * Whether this is a Customizer pageload.\n\t *\n\t * @since 3.4.0\n\t * @var bool\n\t */\n\tprotected $previewing = false;\n\n\t/**\n\t * Methods and properties dealing with managing widgets in the Customizer.\n\t *\n\t * @since 3.9.0\n\t * @var WP_Customize_Widgets\n\t */\n\tpublic $widgets;\n\n\t/**\n\t * Methods and properties dealing with managing nav menus in the Customizer.\n\t *\n\t * @since 4.3.0\n\t * @var WP_Customize_Nav_Menus\n\t */\n\tpublic $nav_menus;\n\n\t/**\n\t * Methods and properties dealing with selective refresh in the Customizer preview.\n\t *\n\t * @since 4.5.0\n\t * @var WP_Customize_Selective_Refresh\n\t */\n\tpublic $selective_refresh;\n\n\t/**\n\t * Registered instances of WP_Customize_Setting.\n\t *\n\t * @since 3.4.0\n\t * @var array\n\t */\n\tprotected $settings = array();\n\n\t/**\n\t * Sorted top-level instances of WP_Customize_Panel and WP_Customize_Section.\n\t *\n\t * @since 4.0.0\n\t * @var array\n\t */\n\tprotected $containers = array();\n\n\t/**\n\t * Registered instances of WP_Customize_Panel.\n\t *\n\t * @since 4.0.0\n\t * @var array\n\t */\n\tprotected $panels = array();\n\n\t/**\n\t * List of core components.\n\t *\n\t * @since 4.5.0\n\t * @var array\n\t */\n\tprotected $components = array( 'widgets', 'nav_menus' );\n\n\t/**\n\t * Registered instances of WP_Customize_Section.\n\t *\n\t * @since 3.4.0\n\t * @var array\n\t */\n\tprotected $sections = array();\n\n\t/**\n\t * Registered instances of WP_Customize_Control.\n\t *\n\t * @since 3.4.0\n\t * @var array\n\t */\n\tprotected $controls = array();\n\n\t/**\n\t * Panel types that may be rendered from JS templates.\n\t *\n\t * @since 4.3.0\n\t * @var array\n\t */\n\tprotected $registered_panel_types = array();\n\n\t/**\n\t * Section types that may be rendered from JS templates.\n\t *\n\t * @since 4.3.0\n\t * @var array\n\t */\n\tprotected $registered_section_types = array();\n\n\t/**\n\t * Control types that may be rendered from JS templates.\n\t *\n\t * @since 4.1.0\n\t * @var array\n\t */\n\tprotected $registered_control_types = array();\n\n\t/**\n\t * Initial URL being previewed.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tprotected $preview_url;\n\n\t/**\n\t * URL to link the user to when closing the Customizer.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tprotected $return_url;\n\n\t/**\n\t * Mapping of 'panel', 'section', 'control' to the ID which should be autofocused.\n\t *\n\t * @since 4.4.0\n\t * @var array\n\t */\n\tprotected $autofocus = array();\n\n\t/**\n\t * Messenger channel.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tprotected $messenger_channel;\n\n\t/**\n\t * Whether the autosave revision of the changeset should be loaded.\n\t *\n\t * @since 4.9.0\n\t * @var bool\n\t */\n\tprotected $autosaved = false;\n\n\t/**\n\t * Whether the changeset branching is allowed.\n\t *\n\t * @since 4.9.0\n\t * @var bool\n\t */\n\tprotected $branching = true;\n\n\t/**\n\t * Whether settings should be previewed.\n\t *\n\t * @since 4.9.0\n\t * @var bool\n\t */\n\tprotected $settings_previewed = true;\n\n\t/**\n\t * Whether a starter content changeset was saved.\n\t *\n\t * @since 4.9.0\n\t * @var bool\n\t */\n\tprotected $saved_starter_content_changeset = false;\n\n\t/**\n\t * Unsanitized values for Customize Settings parsed from $_POST['customized'].\n\t *\n\t * @var array\n\t */\n\tprivate $_post_values;\n\n\t/**\n\t * Changeset UUID.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tprivate $_changeset_uuid;\n\n\t/**\n\t * Changeset post ID.\n\t *\n\t * @since 4.7.0\n\t * @var int|false\n\t */\n\tprivate $_changeset_post_id;\n\n\t/**\n\t * Changeset data loaded from a customize_changeset post.\n\t *\n\t * @since 4.7.0\n\t * @var array|null\n\t */\n\tprivate $_changeset_data;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.4.0\n\t * @since 4.7.0 Added `$args` parameter.\n\t *\n\t * @param array $args {\n\t *     Args.\n\t *\n\t *     @type null|string|false $changeset_uuid     Changeset UUID, the `post_name` for the customize_changeset post containing the customized state.\n\t *                                                 Defaults to `null` resulting in a UUID to be immediately generated. If `false` is provided, then\n\t *                                                 then the changeset UUID will be determined during `after_setup_theme`: when the\n\t *                                                 `customize_changeset_branching` filter returns false, then the default UUID will be that\n\t *                                                 of the most recent `customize_changeset` post that has a status other than 'auto-draft',\n\t *                                                 'publish', or 'trash'. Otherwise, if changeset branching is enabled, then a random UUID will be used.\n\t *     @type string            $theme              Theme to be previewed (for theme switch). Defaults to customize_theme or theme query params.\n\t *     @type string            $messenger_channel  Messenger channel. Defaults to customize_messenger_channel query param.\n\t *     @type bool              $settings_previewed If settings should be previewed. Defaults to true.\n\t *     @type bool              $branching          If changeset branching is allowed; otherwise, changesets are linear. Defaults to true.\n\t *     @type bool              $autosaved          If data from a changeset's autosaved revision should be loaded if it exists. Defaults to false.\n\t * }\n\t */\n\tpublic function __construct( $args = array() ) {\n\n\t\t$args = array_merge(\n\t\t\tarray_fill_keys( array( 'changeset_uuid', 'theme', 'messenger_channel', 'settings_previewed', 'autosaved', 'branching' ), null ),\n\t\t\t$args\n\t\t);\n\n\t\t// Note that the UUID format will be validated in the setup_theme() method.\n\t\tif ( ! isset( $args['changeset_uuid'] ) ) {\n\t\t\t$args['changeset_uuid'] = wp_generate_uuid4();\n\t\t}\n\n\t\t// The theme and messenger_channel should be supplied via $args,\n\t\t// but they are also looked at in the $_REQUEST global here for back-compat.\n\t\tif ( ! isset( $args['theme'] ) ) {\n\t\t\tif ( isset( $_REQUEST['customize_theme'] ) ) {\n\t\t\t\t$args['theme'] = wp_unslash( $_REQUEST['customize_theme'] );\n\t\t\t} elseif ( isset( $_REQUEST['theme'] ) ) { // Deprecated.\n\t\t\t\t$args['theme'] = wp_unslash( $_REQUEST['theme'] );\n\t\t\t}\n\t\t}\n\t\tif ( ! isset( $args['messenger_channel'] ) && isset( $_REQUEST['customize_messenger_channel'] ) ) {\n\t\t\t$args['messenger_channel'] = sanitize_key( wp_unslash( $_REQUEST['customize_messenger_channel'] ) );\n\t\t}\n\n\t\t$this->original_stylesheet = get_stylesheet();\n\t\t$this->theme               = wp_get_theme( 0 === validate_file( $args['theme'] ) ? $args['theme'] : null );\n\t\t$this->messenger_channel   = $args['messenger_channel'];\n\t\t$this->_changeset_uuid     = $args['changeset_uuid'];\n\n\t\tforeach ( array( 'settings_previewed', 'autosaved', 'branching' ) as $key ) {\n\t\t\tif ( isset( $args[ $key ] ) ) {\n\t\t\t\t$this->$key = (bool) $args[ $key ];\n\t\t\t}\n\t\t}\n\n\t\trequire_once ABSPATH . WPINC . '/class-wp-customize-setting.php';\n\t\trequire_once ABSPATH . WPINC . '/class-wp-customize-panel.php';\n\t\trequire_once ABSPATH . WPINC . '/class-wp-customize-section.php';\n\t\trequire_once ABSPATH . WPINC . '/class-wp-customize-control.php';\n\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-color-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-media-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-upload-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-image-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-background-image-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-background-position-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-code-editor-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-widget-area-customize-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-widget-form-customize-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-location-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-name-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-locations-control.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-auto-add-control.php';\n\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menus-panel.php';\n\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-themes-panel.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-themes-section.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-sidebar-section.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-section.php';\n\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-custom-css-setting.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-filter-setting.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-header-image-setting.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-background-image-setting.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-setting.php';\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-setting.php';\n\n\t\t/**\n\t\t * Filters the core Customizer components to load.\n\t\t *\n\t\t * This allows Core components to be excluded from being instantiated by\n\t\t * filtering them out of the array. Note that this filter generally runs\n\t\t * during the {@see 'plugins_loaded'} action, so it cannot be added\n\t\t * in a theme.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @see WP_Customize_Manager::__construct()\n\t\t *\n\t\t * @param string[]             $components Array of core components to load.\n\t\t * @param WP_Customize_Manager $this       WP_Customize_Manager instance.\n\t\t */\n\t\t$components = apply_filters( 'customize_loaded_components', $this->components, $this );\n\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-selective-refresh.php';\n\t\t$this->selective_refresh = new WP_Customize_Selective_Refresh( $this );\n\n\t\tif ( in_array( 'widgets', $components, true ) ) {\n\t\t\trequire_once ABSPATH . WPINC . '/class-wp-customize-widgets.php';\n\t\t\t$this->widgets = new WP_Customize_Widgets( $this );\n\t\t}\n\n\t\tif ( in_array( 'nav_menus', $components, true ) ) {\n\t\t\trequire_once ABSPATH . WPINC . '/class-wp-customize-nav-menus.php';\n\t\t\t$this->nav_menus = new WP_Customize_Nav_Menus( $this );\n\t\t}\n\n\t\tadd_action( 'setup_theme', array( $this, 'setup_theme' ) );\n\t\tadd_action( 'wp_loaded', array( $this, 'wp_loaded' ) );\n\n\t\t// Do not spawn cron (especially the alternate cron) while running the Customizer.\n\t\tremove_action( 'init', 'wp_cron' );\n\n\t\t// Do not run update checks when rendering the controls.\n\t\tremove_action( 'admin_init', '_maybe_update_core' );\n\t\tremove_action( 'admin_init', '_maybe_update_plugins' );\n\t\tremove_action( 'admin_init', '_maybe_update_themes' );\n\n\t\tadd_action( 'wp_ajax_customize_save', array( $this, 'save' ) );\n\t\tadd_action( 'wp_ajax_customize_trash', array( $this, 'handle_changeset_trash_request' ) );\n\t\tadd_action( 'wp_ajax_customize_refresh_nonces', array( $this, 'refresh_nonces' ) );\n\t\tadd_action( 'wp_ajax_customize_load_themes', array( $this, 'handle_load_themes_request' ) );\n\t\tadd_filter( 'heartbeat_settings', array( $this, 'add_customize_screen_to_heartbeat_settings' ) );\n\t\tadd_filter( 'heartbeat_received', array( $this, 'check_changeset_lock_with_heartbeat' ), 10, 3 );\n\t\tadd_action( 'wp_ajax_customize_override_changeset_lock', array( $this, 'handle_override_changeset_lock_request' ) );\n\t\tadd_action( 'wp_ajax_customize_dismiss_autosave_or_lock', array( $this, 'handle_dismiss_autosave_or_lock_request' ) );\n\n\t\tadd_action( 'customize_register', array( $this, 'register_controls' ) );\n\t\tadd_action( 'customize_register', array( $this, 'register_dynamic_settings' ), 11 ); // Allow code to create settings first.\n\t\tadd_action( 'customize_controls_init', array( $this, 'prepare_controls' ) );\n\t\tadd_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ) );\n\n\t\t// Render Common, Panel, Section, and Control templates.\n\t\tadd_action( 'customize_controls_print_footer_scripts', array( $this, 'render_panel_templates' ), 1 );\n\t\tadd_action( 'customize_controls_print_footer_scripts', array( $this, 'render_section_templates' ), 1 );\n\t\tadd_action( 'customize_controls_print_footer_scripts', array( $this, 'render_control_templates' ), 1 );\n\n\t\t// Export header video settings with the partial response.\n\t\tadd_filter( 'customize_render_partials_response', array( $this, 'export_header_video_settings' ), 10, 3 );\n\n\t\t// Export the settings to JS via the _wpCustomizeSettings variable.\n\t\tadd_action( 'customize_controls_print_footer_scripts', array( $this, 'customize_pane_settings' ), 1000 );\n\n\t\t// Add theme update notices.\n\t\tif ( current_user_can( 'install_themes' ) || current_user_can( 'update_themes' ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/update.php';\n\t\t\tadd_action( 'customize_controls_print_footer_scripts', 'wp_print_admin_notice_templates' );\n\t\t}\n\t}\n\n\t/**\n\t * Return true if it's an Ajax request.\n\t *\n\t * @since 3.4.0\n\t * @since 4.2.0 Added `$action` param.\n\t *\n\t * @param string|null $action Whether the supplied Ajax action is being run.\n\t * @return bool True if it's an Ajax request, false otherwise.\n\t */\n\tpublic function doing_ajax( $action = null ) {\n\t\tif ( ! wp_doing_ajax() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $action ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\t/*\n\t\t\t * Note: we can't just use doing_action( \"wp_ajax_{$action}\" ) because we need\n\t\t\t * to check before admin-ajax.php gets to that point.\n\t\t\t */\n\t\t\treturn isset( $_REQUEST['action'] ) && wp_unslash( $_REQUEST['action'] ) === $action;\n\t\t}\n\t}\n\n\t/**\n\t * Custom wp_die wrapper. Returns either the standard message for UI\n\t * or the Ajax message.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string|WP_Error $ajax_message Ajax return.\n\t * @param string          $message      Optional. UI message.\n\t */\n\tprotected function wp_die( $ajax_message, $message = null ) {\n\t\tif ( $this->doing_ajax() ) {\n\t\t\twp_die( $ajax_message );\n\t\t}\n\n\t\tif ( ! $message ) {\n\t\t\t$message = __( 'Something went wrong.' );\n\t\t}\n\n\t\tif ( $this->messenger_channel ) {\n\t\t\tob_start();\n\t\t\twp_enqueue_scripts();\n\t\t\twp_print_scripts( array( 'customize-base' ) );\n\n\t\t\t$settings = array(\n\t\t\t\t'messengerArgs' => array(\n\t\t\t\t\t'channel' => $this->messenger_channel,\n\t\t\t\t\t'url'     => wp_customize_url(),\n\t\t\t\t),\n\t\t\t\t'error'         => $ajax_message,\n\t\t\t);\n\t\t\t?>\n\t\t\t<script>\n\t\t\t( function( api, settings ) {\n\t\t\t\tvar preview = new api.Messenger( settings.messengerArgs );\n\t\t\t\tpreview.send( 'iframe-loading-error', settings.error );\n\t\t\t} )( wp.customize, <?php echo wp_json_encode( $settings ); ?> );\n\t\t\t</script>\n\t\t\t<?php\n\t\t\t$message .= ob_get_clean();\n\t\t}\n\n\t\twp_die( $message );\n\t}\n\n\t/**\n\t * Return the Ajax wp_die() handler if it's a customized request.\n\t *\n\t * @since 3.4.0\n\t * @deprecated 4.7.0\n\t *\n\t * @return callable Die handler.\n\t */\n\tpublic function wp_die_handler() {\n\t\t_deprecated_function( __METHOD__, '4.7.0' );\n\n\t\tif ( $this->doing_ajax() || isset( $_POST['customized'] ) ) {\n\t\t\treturn '_ajax_wp_die_handler';\n\t\t}\n\n\t\treturn '_default_wp_die_handler';\n\t}\n\n\t/**\n\t * Start preview and customize theme.\n\t *\n\t * Check if customize query variable exist. Init filters to filter the current theme.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @global string $pagenow\n\t */\n\tpublic function setup_theme() {\n\t\tglobal $pagenow;\n\n\t\t// Check permissions for customize.php access since this method is called before customize.php can run any code.\n\t\tif ( 'customize.php' === $pagenow && ! current_user_can( 'customize' ) ) {\n\t\t\tif ( ! is_user_logged_in() ) {\n\t\t\t\tauth_redirect();\n\t\t\t} else {\n\t\t\t\twp_die(\n\t\t\t\t\t'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .\n\t\t\t\t\t'<p>' . __( 'Sorry, you are not allowed to customize this site.' ) . '</p>',\n\t\t\t\t\t403\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// If a changeset was provided is invalid.\n\t\tif ( isset( $this->_changeset_uuid ) && false !== $this->_changeset_uuid && ! wp_is_uuid( $this->_changeset_uuid ) ) {\n\t\t\t$this->wp_die( -1, __( 'Invalid changeset UUID' ) );\n\t\t}\n\n\t\t/*\n\t\t * Clear incoming post data if the user lacks a CSRF token (nonce). Note that the customizer\n\t\t * application will inject the customize_preview_nonce query parameter into all Ajax requests.\n\t\t * For similar behavior elsewhere in WordPress, see rest_cookie_check_errors() which logs out\n\t\t * a user when a valid nonce isn't present.\n\t\t */\n\t\t$has_post_data_nonce = (\n\t\t\tcheck_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'nonce', false )\n\t\t\t||\n\t\t\tcheck_ajax_referer( 'save-customize_' . $this->get_stylesheet(), 'nonce', false )\n\t\t\t||\n\t\t\tcheck_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'customize_preview_nonce', false )\n\t\t);\n\t\tif ( ! current_user_can( 'customize' ) || ! $has_post_data_nonce ) {\n\t\t\tunset( $_POST['customized'] );\n\t\t\tunset( $_REQUEST['customized'] );\n\t\t}\n\n\t\t/*\n\t\t * If unauthenticated then require a valid changeset UUID to load the preview.\n\t\t * In this way, the UUID serves as a secret key. If the messenger channel is present,\n\t\t * then send unauthenticated code to prompt re-auth.\n\t\t */\n\t\tif ( ! current_user_can( 'customize' ) && ! $this->changeset_post_id() ) {\n\t\t\t$this->wp_die( $this->messenger_channel ? 0 : -1, __( 'Non-existent changeset UUID.' ) );\n\t\t}\n\n\t\tif ( ! headers_sent() ) {\n\t\t\tsend_origin_headers();\n\t\t}\n\n\t\t// Hide the admin bar if we're embedded in the customizer iframe.\n\t\tif ( $this->messenger_channel ) {\n\t\t\tshow_admin_bar( false );\n\t\t}\n\n\t\tif ( $this->is_theme_active() ) {\n\t\t\t// Once the theme is loaded, we'll validate it.\n\t\t\tadd_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) );\n\t\t} else {\n\t\t\t// If the requested theme is not the active theme and the user doesn't have\n\t\t\t// the switch_themes cap, bail.\n\t\t\tif ( ! current_user_can( 'switch_themes' ) ) {\n\t\t\t\t$this->wp_die( -1, __( 'Sorry, you are not allowed to edit theme options on this site.' ) );\n\t\t\t}\n\n\t\t\t// If the theme has errors while loading, bail.\n\t\t\tif ( $this->theme()->errors() ) {\n\t\t\t\t$this->wp_die( -1, $this->theme()->errors()->get_error_message() );\n\t\t\t}\n\n\t\t\t// If the theme isn't allowed per multisite settings, bail.\n\t\t\tif ( ! $this->theme()->is_allowed() ) {\n\t\t\t\t$this->wp_die( -1, __( 'The requested theme does not exist.' ) );\n\t\t\t}\n\t\t}\n\n\t\t// Make sure changeset UUID is established immediately after the theme is loaded.\n\t\tadd_action( 'after_setup_theme', array( $this, 'establish_loaded_changeset' ), 5 );\n\n\t\t/*\n\t\t * Import theme starter content for fresh installations when landing in the customizer.\n\t\t * Import starter content at after_setup_theme:100 so that any\n\t\t * add_theme_support( 'starter-content' ) calls will have been made.\n\t\t */\n\t\tif ( get_option( 'fresh_site' ) && 'customize.php' === $pagenow ) {\n\t\t\tadd_action( 'after_setup_theme', array( $this, 'import_theme_starter_content' ), 100 );\n\t\t}\n\n\t\t$this->start_previewing_theme();\n\t}\n\n\t/**\n\t * Establish the loaded changeset.\n\t *\n\t * This method runs right at after_setup_theme and applies the 'customize_changeset_branching' filter to determine\n\t * whether concurrent changesets are allowed. Then if the Customizer is not initialized with a `changeset_uuid` param,\n\t * this method will determine which UUID should be used. If changeset branching is disabled, then the most saved\n\t * changeset will be loaded by default. Otherwise, if there are no existing saved changesets or if changeset branching is\n\t * enabled, then a new UUID will be generated.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @global string $pagenow\n\t */\n\tpublic function establish_loaded_changeset() {\n\t\tglobal $pagenow;\n\n\t\tif ( empty( $this->_changeset_uuid ) ) {\n\t\t\t$changeset_uuid = null;\n\n\t\t\tif ( ! $this->branching() && $this->is_theme_active() ) {\n\t\t\t\t$unpublished_changeset_posts = $this->get_changeset_posts(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_status'               => array_diff( get_post_stati(), array( 'auto-draft', 'publish', 'trash', 'inherit', 'private' ) ),\n\t\t\t\t\t\t'exclude_restore_dismissed' => false,\n\t\t\t\t\t\t'author'                    => 'any',\n\t\t\t\t\t\t'posts_per_page'            => 1,\n\t\t\t\t\t\t'order'                     => 'DESC',\n\t\t\t\t\t\t'orderby'                   => 'date',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$unpublished_changeset_post  = array_shift( $unpublished_changeset_posts );\n\t\t\t\tif ( ! empty( $unpublished_changeset_post ) && wp_is_uuid( $unpublished_changeset_post->post_name ) ) {\n\t\t\t\t\t$changeset_uuid = $unpublished_changeset_post->post_name;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If no changeset UUID has been set yet, then generate a new one.\n\t\t\tif ( empty( $changeset_uuid ) ) {\n\t\t\t\t$changeset_uuid = wp_generate_uuid4();\n\t\t\t}\n\n\t\t\t$this->_changeset_uuid = $changeset_uuid;\n\t\t}\n\n\t\tif ( is_admin() && 'customize.php' === $pagenow ) {\n\t\t\t$this->set_changeset_lock( $this->changeset_post_id() );\n\t\t}\n\t}\n\n\t/**\n\t * Callback to validate a theme once it is loaded\n\t *\n\t * @since 3.4.0\n\t */\n\tpublic function after_setup_theme() {\n\t\t$doing_ajax_or_is_customized = ( $this->doing_ajax() || isset( $_POST['customized'] ) );\n\t\tif ( ! $doing_ajax_or_is_customized && ! validate_current_theme() ) {\n\t\t\twp_redirect( 'themes.php?broken=true' );\n\t\t\texit;\n\t\t}\n\t}\n\n\t/**\n\t * If the theme to be previewed isn't the active theme, add filter callbacks\n\t * to swap it out at runtime.\n\t *\n\t * @since 3.4.0\n\t */\n\tpublic function start_previewing_theme() {\n\t\t// Bail if we're already previewing.\n\t\tif ( $this->is_preview() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->previewing = true;\n\n\t\tif ( ! $this->is_theme_active() ) {\n\t\t\tadd_filter( 'template', array( $this, 'get_template' ) );\n\t\t\tadd_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );\n\t\t\tadd_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );\n\n\t\t\t// @link: https://core.trac.wordpress.org/ticket/20027\n\t\t\tadd_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) );\n\t\t\tadd_filter( 'pre_option_template', array( $this, 'get_template' ) );\n\n\t\t\t// Handle custom theme roots.\n\t\t\tadd_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );\n\t\t\tadd_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) );\n\t\t}\n\n\t\t/**\n\t\t * Fires once the Customizer theme preview has started.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param WP_Customize_Manager $this WP_Customize_Manager instance.\n\t\t */\n\t\tdo_action( 'start_previewing_theme', $this );\n\t}\n\n\t/**\n\t * Stop previewing the selected theme.\n\t *\n\t * Removes filters to change the current theme.\n\t *\n\t * @since 3.4.0\n\t */\n\tpublic function stop_previewing_theme() {\n\t\tif ( ! $this->is_preview() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->previewing = false;\n\n\t\tif ( ! $this->is_theme_active() ) {\n\t\t\tremove_filter( 'template', array( $this, 'get_template' ) );\n\t\t\tremove_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );\n\t\t\tremove_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );\n\n\t\t\t// @link: https://core.trac.wordpress.org/ticket/20027\n\t\t\tremove_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) );\n\t\t\tremove_filter( 'pre_option_template', array( $this, 'get_template' ) );\n\n\t\t\t// Handle custom theme roots.\n\t\t\tremove_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );\n\t\t\tremove_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) );\n\t\t}\n\n\t\t/**\n\t\t * Fires once the Customizer theme preview has stopped.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param WP_Customize_Manager $this WP_Customize_Manager instance.\n\t\t */\n\t\tdo_action( 'stop_previewing_theme', $this );\n\t}\n\n\t/**\n\t * Gets whether settings are or will be previewed.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @see WP_Customize_Setting::preview()\n\t *\n\t * @return bool\n\t */\n\tpublic function settings_previewed() {\n\t\treturn $this->settings_previewed;\n\t}\n\n\t/**\n\t * Gets whether data from a changeset's autosaved revision should be loaded if it exists.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @see WP_Customize_Manager::changeset_data()\n\t *\n\t * @return bool Is using autosaved changeset revision.\n\t */\n\tpublic function autosaved() {\n\t\treturn $this->autosaved;\n\t}\n\n\t/**\n\t * Whether the changeset branching is allowed.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @see WP_Customize_Manager::establish_loaded_changeset()\n\t *\n\t * @return bool Is changeset branching.\n\t */\n\tpublic function branching() {\n\n\t\t/**\n\t\t * Filters whether or not changeset branching is\u00c2\u00a0allowed.\n\t\t *\n\t\t * By default in core, when changeset branching is not allowed, changesets will operate\n\t\t * linearly in that only one saved changeset will exist at a time (with a 'draft' or\n\t\t * 'future' status). This makes the Customizer operate in a way that is similar to going to\n\t\t * \"edit\" to one existing post: all users will be making changes to the same post, and autosave\n\t\t * revisions will be made for that post.\n\t\t *\n\t\t * By contrast, when changeset branching is allowed, then the model is like users going\n\t\t * to \"add new\" for a page and each user makes changes independently of each other since\n\t\t * they are all operating on their own separate pages, each getting their own separate\n\t\t * initial auto-drafts and then once initially saved, autosave revisions on top of that\n\t\t * user's specific post.\n\t\t *\n\t\t * Since linear changesets are deemed to be more suitable for the majority of WordPress users,\n\t\t * they are the default. For WordPress sites that have heavy site management in the Customizer\n\t\t * by multiple users then branching changesets should be enabled by means of this filter.\n\t\t *\n\t\t * @since 4.9.0\n\t\t *\n\t\t * @param bool                 $allow_branching Whether branching is allowed. If `false`, the default,\n\t\t *                                              then only one saved changeset exists at a time.\n\t\t * @param WP_Customize_Manager $wp_customize    Manager instance.\n\t\t */\n\t\t$this->branching = apply_filters( 'customize_changeset_branching', $this->branching, $this );\n\n\t\treturn $this->branching;\n\t}\n\n\t/**\n\t * Get the changeset UUID.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see WP_Customize_Manager::establish_loaded_changeset()\n\t *\n\t * @return string UUID.\n\t */\n\tpublic function changeset_uuid() {\n\t\tif ( empty( $this->_changeset_uuid ) ) {\n\t\t\t$this->establish_loaded_changeset();\n\t\t}\n\t\treturn $this->_changeset_uuid;\n\t}\n\n\t/**\n\t * Get the theme being customized.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return WP_Theme\n\t */\n\tpublic function theme() {\n\t\tif ( ! $this->theme ) {\n\t\t\t$this->theme = wp_get_theme();\n\t\t}\n\t\treturn $this->theme;\n\t}\n\n\t/**\n\t * Get the registered settings.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return array\n\t */\n\tpublic function settings() {\n\t\treturn $this->settings;\n\t}\n\n\t/**\n\t * Get the registered controls.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return array\n\t */\n\tpublic function controls() {\n\t\treturn $this->controls;\n\t}\n\n\t/**\n\t * Get the registered containers.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @return array\n\t */\n\tpublic function containers() {\n\t\treturn $this->containers;\n\t}\n\n\t/**\n\t * Get the registered sections.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return array\n\t */\n\tpublic function sections() {\n\t\treturn $this->sections;\n\t}\n\n\t/**\n\t * Get the registered panels.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @return array Panels.\n\t */\n\tpublic function panels() {\n\t\treturn $this->panels;\n\t}\n\n\t/**\n\t * Checks if the current theme is active.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return bool\n\t */\n\tpublic function is_theme_active() {\n\t\treturn $this->get_stylesheet() === $this->original_stylesheet;\n\t}\n\n\t/**\n\t * Register styles/scripts and initialize the preview of each setting\n\t *\n\t * @since 3.4.0\n\t */\n\tpublic function wp_loaded() {\n\n\t\t// Unconditionally register core types for panels, sections, and controls\n\t\t// in case plugin unhooks all customize_register actions.\n\t\t$this->register_panel_type( 'WP_Customize_Panel' );\n\t\t$this->register_panel_type( 'WP_Customize_Themes_Panel' );\n\t\t$this->register_section_type( 'WP_Customize_Section' );\n\t\t$this->register_section_type( 'WP_Customize_Sidebar_Section' );\n\t\t$this->register_section_type( 'WP_Customize_Themes_Section' );\n\t\t$this->register_control_type( 'WP_Customize_Color_Control' );\n\t\t$this->register_control_type( 'WP_Customize_Media_Control' );\n\t\t$this->register_control_type( 'WP_Customize_Upload_Control' );\n\t\t$this->register_control_type( 'WP_Customize_Image_Control' );\n\t\t$this->register_control_type( 'WP_Customize_Background_Image_Control' );\n\t\t$this->register_control_type( 'WP_Customize_Background_Position_Control' );\n\t\t$this->register_control_type( 'WP_Customize_Cropped_Image_Control' );\n\t\t$this->register_control_type( 'WP_Customize_Site_Icon_Control' );\n\t\t$this->register_control_type( 'WP_Customize_Theme_Control' );\n\t\t$this->register_control_type( 'WP_Customize_Code_Editor_Control' );\n\t\t$this->register_control_type( 'WP_Customize_Date_Time_Control' );\n\n\t\t/**\n\t\t * Fires once WordPress has loaded, allowing scripts and styles to be initialized.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param WP_Customize_Manager $this WP_Customize_Manager instance.\n\t\t */\n\t\tdo_action( 'customize_register', $this );\n\n\t\tif ( $this->settings_previewed() ) {\n\t\t\tforeach ( $this->settings as $setting ) {\n\t\t\t\t$setting->preview();\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->is_preview() && ! is_admin() ) {\n\t\t\t$this->customize_preview_init();\n\t\t}\n\t}\n\n\t/**\n\t * Prevents Ajax requests from following redirects when previewing a theme\n\t * by issuing a 200 response instead of a 30x.\n\t *\n\t * Instead, the JS will sniff out the location header.\n\t *\n\t * @since 3.4.0\n\t * @deprecated 4.7.0\n\t *\n\t * @param int $status Status.\n\t * @return int\n\t */\n\tpublic function wp_redirect_status( $status ) {\n\t\t_deprecated_function( __FUNCTION__, '4.7.0' );\n\n\t\tif ( $this->is_preview() && ! is_admin() ) {\n\t\t\treturn 200;\n\t\t}\n\n\t\treturn $status;\n\t}\n\n\t/**\n\t * Find the changeset post ID for a given changeset UUID.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $uuid Changeset UUID.\n\t * @return int|null Returns post ID on success and null on failure.\n\t */\n\tpublic function find_changeset_post_id( $uuid ) {\n\t\t$cache_group       = 'customize_changeset_post';\n\t\t$changeset_post_id = wp_cache_get( $uuid, $cache_group );\n\t\tif ( $changeset_post_id && 'customize_changeset' === get_post_type( $changeset_post_id ) ) {\n\t\t\treturn $changeset_post_id;\n\t\t}\n\n\t\t$changeset_post_query = new WP_Query(\n\t\t\tarray(\n\t\t\t\t'post_type'              => 'customize_changeset',\n\t\t\t\t'post_status'            => get_post_stati(),\n\t\t\t\t'name'                   => $uuid,\n\t\t\t\t'posts_per_page'         => 1,\n\t\t\t\t'no_found_rows'          => true,\n\t\t\t\t'cache_results'          => true,\n\t\t\t\t'update_post_meta_cache' => false,\n\t\t\t\t'update_post_term_cache' => false,\n\t\t\t\t'lazy_load_term_meta'    => false,\n\t\t\t)\n\t\t);\n\t\tif ( ! empty( $changeset_post_query->posts ) ) {\n\t\t\t// Note: 'fields'=>'ids' is not being used in order to cache the post object as it will be needed.\n\t\t\t$changeset_post_id = $changeset_post_query->posts[0]->ID;\n\t\t\twp_cache_set( $uuid, $changeset_post_id, $cache_group );\n\t\t\treturn $changeset_post_id;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get changeset posts.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param array $args {\n\t *     Args to pass into `get_posts()` to query changesets.\n\t *\n\t *     @type int    $posts_per_page             Number of posts to return. Defaults to -1 (all posts).\n\t *     @type int    $author                     Post author. Defaults to current user.\n\t *     @type string $post_status                Status of changeset. Defaults to 'auto-draft'.\n\t *     @type bool   $exclude_restore_dismissed  Whether to exclude changeset auto-drafts that have been dismissed. Defaults to true.\n\t * }\n\t * @return WP_Post[] Auto-draft changesets.\n\t */\n\tprotected function get_changeset_posts( $args = array() ) {\n\t\t$default_args = array(\n\t\t\t'exclude_restore_dismissed' => true,\n\t\t\t'posts_per_page'            => -1,\n\t\t\t'post_type'                 => 'customize_changeset',\n\t\t\t'post_status'               => 'auto-draft',\n\t\t\t'order'                     => 'DESC',\n\t\t\t'orderby'                   => 'date',\n\t\t\t'no_found_rows'             => true,\n\t\t\t'cache_results'             => true,\n\t\t\t'update_post_meta_cache'    => false,\n\t\t\t'update_post_term_cache'    => false,\n\t\t\t'lazy_load_term_meta'       => false,\n\t\t);\n\t\tif ( get_current_user_id() ) {\n\t\t\t$default_args['author'] = get_current_user_id();\n\t\t}\n\t\t$args = array_merge( $default_args, $args );\n\n\t\tif ( ! empty( $args['exclude_restore_dismissed'] ) ) {\n\t\t\tunset( $args['exclude_restore_dismissed'] );\n\t\t\t$args['meta_query'] = array(\n\t\t\t\tarray(\n\t\t\t\t\t'key'     => '_customize_restore_dismissed',\n\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn get_posts( $args );\n\t}\n\n\t/**\n\t * Dismiss all of the current user's auto-drafts (other than the present one).\n\t *\n\t * @since 4.9.0\n\t * @return int The number of auto-drafts that were dismissed.\n\t */\n\tprotected function dismiss_user_auto_draft_changesets() {\n\t\t$changeset_autodraft_posts = $this->get_changeset_posts(\n\t\t\tarray(\n\t\t\t\t'post_status'               => 'auto-draft',\n\t\t\t\t'exclude_restore_dismissed' => true,\n\t\t\t\t'posts_per_page'            => -1,\n\t\t\t)\n\t\t);\n\t\t$dismissed                 = 0;\n\t\tforeach ( $changeset_autodraft_posts as $autosave_autodraft_post ) {\n\t\t\tif ( $autosave_autodraft_post->ID === $this->changeset_post_id() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( update_post_meta( $autosave_autodraft_post->ID, '_customize_restore_dismissed', true ) ) {\n\t\t\t\t$dismissed++;\n\t\t\t}\n\t\t}\n\t\treturn $dismissed;\n\t}\n\n\t/**\n\t * Get the changeset post ID for the loaded changeset.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return int|null Post ID on success or null if there is no post yet saved.\n\t */\n\tpublic function changeset_post_id() {\n\t\tif ( ! isset( $this->_changeset_post_id ) ) {\n\t\t\t$post_id = $this->find_changeset_post_id( $this->changeset_uuid() );\n\t\t\tif ( ! $post_id ) {\n\t\t\t\t$post_id = false;\n\t\t\t}\n\t\t\t$this->_changeset_post_id = $post_id;\n\t\t}\n\t\tif ( false === $this->_changeset_post_id ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $this->_changeset_post_id;\n\t}\n\n\t/**\n\t * Get the data stored in a changeset post.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param int $post_id Changeset post ID.\n\t * @return array|WP_Error Changeset data or WP_Error on error.\n\t */\n\tprotected function get_changeset_post_data( $post_id ) {\n\t\tif ( ! $post_id ) {\n\t\t\treturn new WP_Error( 'empty_post_id' );\n\t\t}\n\t\t$changeset_post = get_post( $post_id );\n\t\tif ( ! $changeset_post ) {\n\t\t\treturn new WP_Error( 'missing_post' );\n\t\t}\n\t\tif ( 'revision' === $changeset_post->post_type ) {\n\t\t\tif ( 'customize_changeset' !== get_post_type( $changeset_post->post_parent ) ) {\n\t\t\t\treturn new WP_Error( 'wrong_post_type' );\n\t\t\t}\n\t\t} elseif ( 'customize_changeset' !== $changeset_post->post_type ) {\n\t\t\treturn new WP_Error( 'wrong_post_type' );\n\t\t}\n\t\t$changeset_data = json_decode( $changeset_post->post_content, true );\n\t\t$last_error     = json_last_error();\n\t\tif ( $last_error ) {\n\t\t\treturn new WP_Error( 'json_parse_error', '', $last_error );\n\t\t}\n\t\tif ( ! is_array( $changeset_data ) ) {\n\t\t\treturn new WP_Error( 'expected_array' );\n\t\t}\n\t\treturn $changeset_data;\n\t}\n\n\t/**\n\t * Get changeset data.\n\t *\n\t * @since 4.7.0\n\t * @since 4.9.0 This will return the changeset's data with a user's autosave revision merged on top, if one exists and $autosaved is true.\n\t *\n\t * @return array Changeset data.\n\t */\n\tpublic function changeset_data() {\n\t\tif ( isset( $this->_changeset_data ) ) {\n\t\t\treturn $this->_changeset_data;\n\t\t}\n\t\t$changeset_post_id = $this->changeset_post_id();\n\t\tif ( ! $changeset_post_id ) {\n\t\t\t$this->_changeset_data = array();\n\t\t} else {\n\t\t\tif ( $this->autosaved() && is_user_logged_in() ) {\n\t\t\t\t$autosave_post = wp_get_post_autosave( $changeset_post_id, get_current_user_id() );\n\t\t\t\tif ( $autosave_post ) {\n\t\t\t\t\t$data = $this->get_changeset_post_data( $autosave_post->ID );\n\t\t\t\t\tif ( ! is_wp_error( $data ) ) {\n\t\t\t\t\t\t$this->_changeset_data = $data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Load data from the changeset if it was not loaded from an autosave.\n\t\t\tif ( ! isset( $this->_changeset_data ) ) {\n\t\t\t\t$data = $this->get_changeset_post_data( $changeset_post_id );\n\t\t\t\tif ( ! is_wp_error( $data ) ) {\n\t\t\t\t\t$this->_changeset_data = $data;\n\t\t\t\t} else {\n\t\t\t\t\t$this->_changeset_data = array();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->_changeset_data;\n\t}\n\n\t/**\n\t * Starter content setting IDs.\n\t *\n\t * @since 4.7.0\n\t * @var array\n\t */\n\tprotected $pending_starter_content_settings_ids = array();\n\n\t/**\n\t * Import theme starter content into the customized state.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $starter_content Starter content. Defaults to `get_theme_starter_content()`.\n\t */\n\tfunction import_theme_starter_content( $starter_content = array() ) {\n\t\tif ( empty( $starter_content ) ) {\n\t\t\t$starter_content = get_theme_starter_content();\n\t\t}\n\n\t\t$changeset_data = array();\n\t\tif ( $this->changeset_post_id() ) {\n\t\t\t/*\n\t\t\t * Don't re-import starter content into a changeset saved persistently.\n\t\t\t * This will need to be revisited in the future once theme switching\n\t\t\t * is allowed with drafted/scheduled changesets, since switching to\n\t\t\t * another theme could result in more starter content being applied.\n\t\t\t * However, when doing an explicit save it is currently possible for\n\t\t\t * nav menus and nav menu items specifically to lose their starter_content\n\t\t\t * flags, thus resulting in duplicates being created since they fail\n\t\t\t * to get re-used. See #40146.\n\t\t\t */\n\t\t\tif ( 'auto-draft' !== get_post_status( $this->changeset_post_id() ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$changeset_data = $this->get_changeset_post_data( $this->changeset_post_id() );\n\t\t}\n\n\t\t$sidebars_widgets = isset( $starter_content['widgets'] ) && ! empty( $this->widgets ) ? $starter_content['widgets'] : array();\n\t\t$attachments      = isset( $starter_content['attachments'] ) && ! empty( $this->nav_menus ) ? $starter_content['attachments'] : array();\n\t\t$posts            = isset( $starter_content['posts'] ) && ! empty( $this->nav_menus ) ? $starter_content['posts'] : array();\n\t\t$options          = isset( $starter_content['options'] ) ? $starter_content['options'] : array();\n\t\t$nav_menus        = isset( $starter_content['nav_menus'] ) && ! empty( $this->nav_menus ) ? $starter_content['nav_menus'] : array();\n\t\t$theme_mods       = isset( $starter_content['theme_mods'] ) ? $starter_content['theme_mods'] : array();\n\n\t\t// Widgets.\n\t\t$max_widget_numbers = array();\n\t\tforeach ( $sidebars_widgets as $sidebar_id => $widgets ) {\n\t\t\t$sidebar_widget_ids = array();\n\t\t\tforeach ( $widgets as $widget ) {\n\t\t\t\tlist( $id_base, $instance ) = $widget;\n\n\t\t\t\tif ( ! isset( $max_widget_numbers[ $id_base ] ) ) {\n\n\t\t\t\t\t// When $settings is an array-like object, get an intrinsic array for use with array_keys().\n\t\t\t\t\t$settings = get_option( \"widget_{$id_base}\", array() );\n\t\t\t\t\tif ( $settings instanceof ArrayObject || $settings instanceof ArrayIterator ) {\n\t\t\t\t\t\t$settings = $settings->getArrayCopy();\n\t\t\t\t\t}\n\n\t\t\t\t\t// Find the max widget number for this type.\n\t\t\t\t\t$widget_numbers = array_keys( $settings );\n\t\t\t\t\tif ( count( $widget_numbers ) > 0 ) {\n\t\t\t\t\t\t$widget_numbers[]               = 1;\n\t\t\t\t\t\t$max_widget_numbers[ $id_base ] = max( ...$widget_numbers );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$max_widget_numbers[ $id_base ] = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$max_widget_numbers[ $id_base ] += 1;\n\n\t\t\t\t$widget_id  = sprintf( '%s-%d', $id_base, $max_widget_numbers[ $id_base ] );\n\t\t\t\t$setting_id = sprintf( 'widget_%s[%d]', $id_base, $max_widget_numbers[ $id_base ] );\n\n\t\t\t\t$setting_value = $this->widgets->sanitize_widget_js_instance( $instance );\n\t\t\t\tif ( empty( $changeset_data[ $setting_id ] ) || ! empty( $changeset_data[ $setting_id ]['starter_content'] ) ) {\n\t\t\t\t\t$this->set_post_value( $setting_id, $setting_value );\n\t\t\t\t\t$this->pending_starter_content_settings_ids[] = $setting_id;\n\t\t\t\t}\n\t\t\t\t$sidebar_widget_ids[] = $widget_id;\n\t\t\t}\n\n\t\t\t$setting_id = sprintf( 'sidebars_widgets[%s]', $sidebar_id );\n\t\t\tif ( empty( $changeset_data[ $setting_id ] ) || ! empty( $changeset_data[ $setting_id ]['starter_content'] ) ) {\n\t\t\t\t$this->set_post_value( $setting_id, $sidebar_widget_ids );\n\t\t\t\t$this->pending_starter_content_settings_ids[] = $setting_id;\n\t\t\t}\n\t\t}\n\n\t\t$starter_content_auto_draft_post_ids = array();\n\t\tif ( ! empty( $changeset_data['nav_menus_created_posts']['value'] ) ) {\n\t\t\t$starter_content_auto_draft_post_ids = array_merge( $starter_content_auto_draft_post_ids, $changeset_data['nav_menus_created_posts']['value'] );\n\t\t}\n\n\t\t// Make an index of all the posts needed and what their slugs are.\n\t\t$needed_posts = array();\n\t\t$attachments  = $this->prepare_starter_content_attachments( $attachments );\n\t\tforeach ( $attachments as $attachment ) {\n\t\t\t$key                  = 'attachment:' . $attachment['post_name'];\n\t\t\t$needed_posts[ $key ] = true;\n\t\t}\n\t\tforeach ( array_keys( $posts ) as $post_symbol ) {\n\t\t\tif ( empty( $posts[ $post_symbol ]['post_name'] ) && empty( $posts[ $post_symbol ]['post_title'] ) ) {\n\t\t\t\tunset( $posts[ $post_symbol ] );\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( empty( $posts[ $post_symbol ]['post_name'] ) ) {\n\t\t\t\t$posts[ $post_symbol ]['post_name'] = sanitize_title( $posts[ $post_symbol ]['post_title'] );\n\t\t\t}\n\t\t\tif ( empty( $posts[ $post_symbol ]['post_type'] ) ) {\n\t\t\t\t$posts[ $post_symbol ]['post_type'] = 'post';\n\t\t\t}\n\t\t\t$needed_posts[ $posts[ $post_symbol ]['post_type'] . ':' . $posts[ $post_symbol ]['post_name'] ] = true;\n\t\t}\n\t\t$all_post_slugs = array_merge(\n\t\t\twp_list_pluck( $attachments, 'post_name' ),\n\t\t\twp_list_pluck( $posts, 'post_name' )\n\t\t);\n\n\t\t/*\n\t\t * Obtain all post types referenced in starter content to use in query.\n\t\t * This is needed because 'any' will not account for post types not yet registered.\n\t\t */\n\t\t$post_types = array_filter( array_merge( array( 'attachment' ), wp_list_pluck( $posts, 'post_type' ) ) );\n\n\t\t// Re-use auto-draft starter content posts referenced in the current customized state.\n\t\t$existing_starter_content_posts = array();\n\t\tif ( ! empty( $starter_content_auto_draft_post_ids ) ) {\n\t\t\t$existing_posts_query = new WP_Query(\n\t\t\t\tarray(\n\t\t\t\t\t'post__in'       => $starter_content_auto_draft_post_ids,\n\t\t\t\t\t'post_status'    => 'auto-draft',\n\t\t\t\t\t'post_type'      => $post_types,\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t)\n\t\t\t);\n\t\t\tforeach ( $existing_posts_query->posts as $existing_post ) {\n\t\t\t\t$post_name = $existing_post->post_name;\n\t\t\t\tif ( empty( $post_name ) ) {\n\t\t\t\t\t$post_name = get_post_meta( $existing_post->ID, '_customize_draft_post_name', true );\n\t\t\t\t}\n\t\t\t\t$existing_starter_content_posts[ $existing_post->post_type . ':' . $post_name ] = $existing_post;\n\t\t\t}\n\t\t}\n\n\t\t// Re-use non-auto-draft posts.\n\t\tif ( ! empty( $all_post_slugs ) ) {\n\t\t\t$existing_posts_query = new WP_Query(\n\t\t\t\tarray(\n\t\t\t\t\t'post_name__in'  => $all_post_slugs,\n\t\t\t\t\t'post_status'    => array_diff( get_post_stati(), array( 'auto-draft' ) ),\n\t\t\t\t\t'post_type'      => 'any',\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t)\n\t\t\t);\n\t\t\tforeach ( $existing_posts_query->posts as $existing_post ) {\n\t\t\t\t$key = $existing_post->post_type . ':' . $existing_post->post_name;\n\t\t\t\tif ( isset( $needed_posts[ $key ] ) && ! isset( $existing_starter_content_posts[ $key ] ) ) {\n\t\t\t\t\t$existing_starter_content_posts[ $key ] = $existing_post;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Attachments are technically posts but handled differently.\n\t\tif ( ! empty( $attachments ) ) {\n\n\t\t\t$attachment_ids = array();\n\n\t\t\tforeach ( $attachments as $symbol => $attachment ) {\n\t\t\t\t$file_array    = array(\n\t\t\t\t\t'name' => $attachment['file_name'],\n\t\t\t\t);\n\t\t\t\t$file_path     = $attachment['file_path'];\n\t\t\t\t$attachment_id = null;\n\t\t\t\t$attached_file = null;\n\t\t\t\tif ( isset( $existing_starter_content_posts[ 'attachment:' . $attachment['post_name'] ] ) ) {\n\t\t\t\t\t$attachment_post = $existing_starter_content_posts[ 'attachment:' . $attachment['post_name'] ];\n\t\t\t\t\t$attachment_id   = $attachment_post->ID;\n\t\t\t\t\t$attached_file   = get_attached_file( $attachment_id );\n\t\t\t\t\tif ( empty( $attached_file ) || ! file_exists( $attached_file ) ) {\n\t\t\t\t\t\t$attachment_id = null;\n\t\t\t\t\t\t$attached_file = null;\n\t\t\t\t\t} elseif ( $this->get_stylesheet() !== get_post_meta( $attachment_post->ID, '_starter_content_theme', true ) ) {\n\n\t\t\t\t\t\t// Re-generate attachment metadata since it was previously generated for a different theme.\n\t\t\t\t\t\t$metadata = wp_generate_attachment_metadata( $attachment_post->ID, $attached_file );\n\t\t\t\t\t\twp_update_attachment_metadata( $attachment_id, $metadata );\n\t\t\t\t\t\tupdate_post_meta( $attachment_id, '_starter_content_theme', $this->get_stylesheet() );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Insert the attachment auto-draft because it doesn't yet exist or the attached file is gone.\n\t\t\t\tif ( ! $attachment_id ) {\n\n\t\t\t\t\t// Copy file to temp location so that original file won't get deleted from theme after sideloading.\n\t\t\t\t\t$temp_file_name = wp_tempnam( wp_basename( $file_path ) );\n\t\t\t\t\tif ( $temp_file_name && copy( $file_path, $temp_file_name ) ) {\n\t\t\t\t\t\t$file_array['tmp_name'] = $temp_file_name;\n\t\t\t\t\t}\n\t\t\t\t\tif ( empty( $file_array['tmp_name'] ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$attachment_post_data = array_merge(\n\t\t\t\t\t\twp_array_slice_assoc( $attachment, array( 'post_title', 'post_content', 'post_excerpt' ) ),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'post_status' => 'auto-draft', // So attachment will be garbage collected in a week if changeset is never published.\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$attachment_id = media_handle_sideload( $file_array, 0, null, $attachment_post_data );\n\t\t\t\t\tif ( is_wp_error( $attachment_id ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tupdate_post_meta( $attachment_id, '_starter_content_theme', $this->get_stylesheet() );\n\t\t\t\t\tupdate_post_meta( $attachment_id, '_customize_draft_post_name', $attachment['post_name'] );\n\t\t\t\t}\n\n\t\t\t\t$attachment_ids[ $symbol ] = $attachment_id;\n\t\t\t}\n\t\t\t$starter_content_auto_draft_post_ids = array_merge( $starter_content_auto_draft_post_ids, array_values( $attachment_ids ) );\n\t\t}\n\n\t\t// Posts & pages.\n\t\tif ( ! empty( $posts ) ) {\n\t\t\tforeach ( array_keys( $posts ) as $post_symbol ) {\n\t\t\t\tif ( empty( $posts[ $post_symbol ]['post_type'] ) || empty( $posts[ $post_symbol ]['post_name'] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$post_type = $posts[ $post_symbol ]['post_type'];\n\t\t\t\tif ( ! empty( $posts[ $post_symbol ]['post_name'] ) ) {\n\t\t\t\t\t$post_name = $posts[ $post_symbol ]['post_name'];\n\t\t\t\t} elseif ( ! empty( $posts[ $post_symbol ]['post_title'] ) ) {\n\t\t\t\t\t$post_name = sanitize_title( $posts[ $post_symbol ]['post_title'] );\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Use existing auto-draft post if one already exists with the same type and name.\n\t\t\t\tif ( isset( $existing_starter_content_posts[ $post_type . ':' . $post_name ] ) ) {\n\t\t\t\t\t$posts[ $post_symbol ]['ID'] = $existing_starter_content_posts[ $post_type . ':' . $post_name ]->ID;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Translate the featured image symbol.\n\t\t\t\tif ( ! empty( $posts[ $post_symbol ]['thumbnail'] )\n\t\t\t\t\t&& preg_match( '/^{{(?P<symbol>.+)}}$/', $posts[ $post_symbol ]['thumbnail'], $matches )\n\t\t\t\t\t&& isset( $attachment_ids[ $matches['symbol'] ] ) ) {\n\t\t\t\t\t$posts[ $post_symbol ]['meta_input']['_thumbnail_id'] = $attachment_ids[ $matches['symbol'] ];\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $posts[ $post_symbol ]['template'] ) ) {\n\t\t\t\t\t$posts[ $post_symbol ]['meta_input']['_wp_page_template'] = $posts[ $post_symbol ]['template'];\n\t\t\t\t}\n\n\t\t\t\t$r = $this->nav_menus->insert_auto_draft_post( $posts[ $post_symbol ] );\n\t\t\t\tif ( $r instanceof WP_Post ) {\n\t\t\t\t\t$posts[ $post_symbol ]['ID'] = $r->ID;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$starter_content_auto_draft_post_ids = array_merge( $starter_content_auto_draft_post_ids, wp_list_pluck( $posts, 'ID' ) );\n\t\t}\n\n\t\t// The nav_menus_created_posts setting is why nav_menus component is dependency for adding posts.\n\t\tif ( ! empty( $this->nav_menus ) && ! empty( $starter_content_auto_draft_post_ids ) ) {\n\t\t\t$setting_id = 'nav_menus_created_posts';\n\t\t\t$this->set_post_value( $setting_id, array_unique( array_values( $starter_content_auto_draft_post_ids ) ) );\n\t\t\t$this->pending_starter_content_settings_ids[] = $setting_id;\n\t\t}\n\n\t\t// Nav menus.\n\t\t$placeholder_id              = -1;\n\t\t$reused_nav_menu_setting_ids = array();\n\t\tforeach ( $nav_menus as $nav_menu_location => $nav_menu ) {\n\n\t\t\t$nav_menu_term_id    = null;\n\t\t\t$nav_menu_setting_id = null;\n\t\t\t$matches             = array();\n\n\t\t\t// Look for an existing placeholder menu with starter content to re-use.\n\t\t\tforeach ( $changeset_data as $setting_id => $setting_params ) {\n\t\t\t\t$can_reuse = (\n\t\t\t\t\t! empty( $setting_params['starter_content'] )\n\t\t\t\t\t&&\n\t\t\t\t\t! in_array( $setting_id, $reused_nav_menu_setting_ids, true )\n\t\t\t\t\t&&\n\t\t\t\t\tpreg_match( '#^nav_menu\\[(?P<nav_menu_id>-?\\d+)\\]$#', $setting_id, $matches )\n\t\t\t\t);\n\t\t\t\tif ( $can_reuse ) {\n\t\t\t\t\t$nav_menu_term_id              = intval( $matches['nav_menu_id'] );\n\t\t\t\t\t$nav_menu_setting_id           = $setting_id;\n\t\t\t\t\t$reused_nav_menu_setting_ids[] = $setting_id;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! $nav_menu_term_id ) {\n\t\t\t\twhile ( isset( $changeset_data[ sprintf( 'nav_menu[%d]', $placeholder_id ) ] ) ) {\n\t\t\t\t\t$placeholder_id--;\n\t\t\t\t}\n\t\t\t\t$nav_menu_term_id    = $placeholder_id;\n\t\t\t\t$nav_menu_setting_id = sprintf( 'nav_menu[%d]', $placeholder_id );\n\t\t\t}\n\n\t\t\t$this->set_post_value(\n\t\t\t\t$nav_menu_setting_id,\n\t\t\t\tarray(\n\t\t\t\t\t'name' => isset( $nav_menu['name'] ) ? $nav_menu['name'] : $nav_menu_location,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->pending_starter_content_settings_ids[] = $nav_menu_setting_id;\n\n\t\t\t// @todo Add support for menu_item_parent.\n\t\t\t$position = 0;\n\t\t\tforeach ( $nav_menu['items'] as $nav_menu_item ) {\n\t\t\t\t$nav_menu_item_setting_id = sprintf( 'nav_menu_item[%d]', $placeholder_id-- );\n\t\t\t\tif ( ! isset( $nav_menu_item['position'] ) ) {\n\t\t\t\t\t$nav_menu_item['position'] = $position++;\n\t\t\t\t}\n\t\t\t\t$nav_menu_item['nav_menu_term_id'] = $nav_menu_term_id;\n\n\t\t\t\tif ( isset( $nav_menu_item['object_id'] ) ) {\n\t\t\t\t\tif ( 'post_type' === $nav_menu_item['type'] && preg_match( '/^{{(?P<symbol>.+)}}$/', $nav_menu_item['object_id'], $matches ) && isset( $posts[ $matches['symbol'] ] ) ) {\n\t\t\t\t\t\t$nav_menu_item['object_id'] = $posts[ $matches['symbol'] ]['ID'];\n\t\t\t\t\t\tif ( empty( $nav_menu_item['title'] ) ) {\n\t\t\t\t\t\t\t$original_object        = get_post( $nav_menu_item['object_id'] );\n\t\t\t\t\t\t\t$nav_menu_item['title'] = $original_object->post_title;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$nav_menu_item['object_id'] = 0;\n\t\t\t\t}\n\n\t\t\t\tif ( empty( $changeset_data[ $nav_menu_item_setting_id ] ) || ! empty( $changeset_data[ $nav_menu_item_setting_id ]['starter_content'] ) ) {\n\t\t\t\t\t$this->set_post_value( $nav_menu_item_setting_id, $nav_menu_item );\n\t\t\t\t\t$this->pending_starter_content_settings_ids[] = $nav_menu_item_setting_id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$setting_id = sprintf( 'nav_menu_locations[%s]', $nav_menu_location );\n\t\t\tif ( empty( $changeset_data[ $setting_id ] ) || ! empty( $changeset_data[ $setting_id ]['starter_content'] ) ) {\n\t\t\t\t$this->set_post_value( $setting_id, $nav_menu_term_id );\n\t\t\t\t$this->pending_starter_content_settings_ids[] = $setting_id;\n\t\t\t}\n\t\t}\n\n\t\t// Options.\n\t\tforeach ( $options as $name => $value ) {\n\n\t\t\t// Serialize the value to check for post symbols.\n\t\t\t$value = maybe_serialize( $value );\n\n\t\t\tif ( is_serialized( $value ) ) {\n\t\t\t\tif ( preg_match( '/s:\\d+:\"{{(?P<symbol>.+)}}\"/', $value, $matches ) ) {\n\t\t\t\t\tif ( isset( $posts[ $matches['symbol'] ] ) ) {\n\t\t\t\t\t\t$symbol_match = $posts[ $matches['symbol'] ]['ID'];\n\t\t\t\t\t} elseif ( isset( $attachment_ids[ $matches['symbol'] ] ) ) {\n\t\t\t\t\t\t$symbol_match = $attachment_ids[ $matches['symbol'] ];\n\t\t\t\t\t}\n\n\t\t\t\t\t// If we have any symbol matches, update the values.\n\t\t\t\t\tif ( isset( $symbol_match ) ) {\n\t\t\t\t\t\t// Replace found string matches with post IDs.\n\t\t\t\t\t\t$value = str_replace( $matches[0], \"i:{$symbol_match}\", $value );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif ( preg_match( '/^{{(?P<symbol>.+)}}$/', $value, $matches ) ) {\n\t\t\t\tif ( isset( $posts[ $matches['symbol'] ] ) ) {\n\t\t\t\t\t$value = $posts[ $matches['symbol'] ]['ID'];\n\t\t\t\t} elseif ( isset( $attachment_ids[ $matches['symbol'] ] ) ) {\n\t\t\t\t\t$value = $attachment_ids[ $matches['symbol'] ];\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Unserialize values after checking for post symbols, so they can be properly referenced.\n\t\t\t$value = maybe_unserialize( $value );\n\n\t\t\tif ( empty( $changeset_data[ $name ] ) || ! empty( $changeset_data[ $name ]['starter_content'] ) ) {\n\t\t\t\t$this->set_post_value( $name, $value );\n\t\t\t\t$this->pending_starter_content_settings_ids[] = $name;\n\t\t\t}\n\t\t}\n\n\t\t// Theme mods.\n\t\tforeach ( $theme_mods as $name => $value ) {\n\n\t\t\t// Serialize the value to check for post symbols.\n\t\t\t$value = maybe_serialize( $value );\n\n\t\t\t// Check if value was serialized.\n\t\t\tif ( is_serialized( $value ) ) {\n\t\t\t\tif ( preg_match( '/s:\\d+:\"{{(?P<symbol>.+)}}\"/', $value, $matches ) ) {\n\t\t\t\t\tif ( isset( $posts[ $matches['symbol'] ] ) ) {\n\t\t\t\t\t\t$symbol_match = $posts[ $matches['symbol'] ]['ID'];\n\t\t\t\t\t} elseif ( isset( $attachment_ids[ $matches['symbol'] ] ) ) {\n\t\t\t\t\t\t$symbol_match = $attachment_ids[ $matches['symbol'] ];\n\t\t\t\t\t}\n\n\t\t\t\t\t// If we have any symbol matches, update the values.\n\t\t\t\t\tif ( isset( $symbol_match ) ) {\n\t\t\t\t\t\t// Replace found string matches with post IDs.\n\t\t\t\t\t\t$value = str_replace( $matches[0], \"i:{$symbol_match}\", $value );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif ( preg_match( '/^{{(?P<symbol>.+)}}$/', $value, $matches ) ) {\n\t\t\t\tif ( isset( $posts[ $matches['symbol'] ] ) ) {\n\t\t\t\t\t$value = $posts[ $matches['symbol'] ]['ID'];\n\t\t\t\t} elseif ( isset( $attachment_ids[ $matches['symbol'] ] ) ) {\n\t\t\t\t\t$value = $attachment_ids[ $matches['symbol'] ];\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Unserialize values after checking for post symbols, so they can be properly referenced.\n\t\t\t$value = maybe_unserialize( $value );\n\n\t\t\t// Handle header image as special case since setting has a legacy format.\n\t\t\tif ( 'header_image' === $name ) {\n\t\t\t\t$name     = 'header_image_data';\n\t\t\t\t$metadata = wp_get_attachment_metadata( $value );\n\t\t\t\tif ( empty( $metadata ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$value = array(\n\t\t\t\t\t'attachment_id' => $value,\n\t\t\t\t\t'url'           => wp_get_attachment_url( $value ),\n\t\t\t\t\t'height'        => $metadata['height'],\n\t\t\t\t\t'width'         => $metadata['width'],\n\t\t\t\t);\n\t\t\t} elseif ( 'background_image' === $name ) {\n\t\t\t\t$value = wp_get_attachment_url( $value );\n\t\t\t}\n\n\t\t\tif ( empty( $changeset_data[ $name ] ) || ! empty( $changeset_data[ $name ]['starter_content'] ) ) {\n\t\t\t\t$this->set_post_value( $name, $value );\n\t\t\t\t$this->pending_starter_content_settings_ids[] = $name;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $this->pending_starter_content_settings_ids ) ) {\n\t\t\tif ( did_action( 'customize_register' ) ) {\n\t\t\t\t$this->_save_starter_content_changeset();\n\t\t\t} else {\n\t\t\t\tadd_action( 'customize_register', array( $this, '_save_starter_content_changeset' ), 1000 );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Prepare starter content attachments.\n\t *\n\t * Ensure that the attachments are valid and that they have slugs and file name/path.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $attachments Attachments.\n\t * @return array Prepared attachments.\n\t */\n\tprotected function prepare_starter_content_attachments( $attachments ) {\n\t\t$prepared_attachments = array();\n\t\tif ( empty( $attachments ) ) {\n\t\t\treturn $prepared_attachments;\n\t\t}\n\n\t\t// Such is The WordPress Way.\n\t\trequire_once ABSPATH . 'wp-admin/includes/file.php';\n\t\trequire_once ABSPATH . 'wp-admin/includes/media.php';\n\t\trequire_once ABSPATH . 'wp-admin/includes/image.php';\n\n\t\tforeach ( $attachments as $symbol => $attachment ) {\n\n\t\t\t// A file is required and URLs to files are not currently allowed.\n\t\t\tif ( empty( $attachment['file'] ) || preg_match( '#^https?://$#', $attachment['file'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$file_path = null;\n\t\t\tif ( file_exists( $attachment['file'] ) ) {\n\t\t\t\t$file_path = $attachment['file']; // Could be absolute path to file in plugin.\n\t\t\t} elseif ( is_child_theme() && file_exists( get_stylesheet_directory() . '/' . $attachment['file'] ) ) {\n\t\t\t\t$file_path = get_stylesheet_directory() . '/' . $attachment['file'];\n\t\t\t} elseif ( file_exists( get_template_directory() . '/' . $attachment['file'] ) ) {\n\t\t\t\t$file_path = get_template_directory() . '/' . $attachment['file'];\n\t\t\t} else {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$file_name = wp_basename( $attachment['file'] );\n\n\t\t\t// Skip file types that are not recognized.\n\t\t\t$checked_filetype = wp_check_filetype( $file_name );\n\t\t\tif ( empty( $checked_filetype['type'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Ensure post_name is set since not automatically derived from post_title for new auto-draft posts.\n\t\t\tif ( empty( $attachment['post_name'] ) ) {\n\t\t\t\tif ( ! empty( $attachment['post_title'] ) ) {\n\t\t\t\t\t$attachment['post_name'] = sanitize_title( $attachment['post_title'] );\n\t\t\t\t} else {\n\t\t\t\t\t$attachment['post_name'] = sanitize_title( preg_replace( '/\\.\\w+$/', '', $file_name ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$attachment['file_name']         = $file_name;\n\t\t\t$attachment['file_path']         = $file_path;\n\t\t\t$prepared_attachments[ $symbol ] = $attachment;\n\t\t}\n\t\treturn $prepared_attachments;\n\t}\n\n\t/**\n\t * Save starter content changeset.\n\t *\n\t * @since 4.7.0\n\t */\n\tpublic function _save_starter_content_changeset() {\n\n\t\tif ( empty( $this->pending_starter_content_settings_ids ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->save_changeset_post(\n\t\t\tarray(\n\t\t\t\t'data'            => array_fill_keys( $this->pending_starter_content_settings_ids, array( 'starter_content' => true ) ),\n\t\t\t\t'starter_content' => true,\n\t\t\t)\n\t\t);\n\t\t$this->saved_starter_content_changeset = true;\n\n\t\t$this->pending_starter_content_settings_ids = array();\n\t}\n\n\t/**\n\t * Get dirty pre-sanitized setting values in the current customized state.\n\t *\n\t * The returned array consists of a merge of three sources:\n\t * 1. If the theme is not currently active, then the base array is any stashed\n\t *    theme mods that were modified previously but never published.\n\t * 2. The values from the current changeset, if it exists.\n\t * 3. If the user can customize, the values parsed from the incoming\n\t *    `$_POST['customized']` JSON data.\n\t * 4. Any programmatically-set post values via `WP_Customize_Manager::set_post_value()`.\n\t *\n\t * The name \"unsanitized_post_values\" is a carry-over from when the customized\n\t * state was exclusively sourced from `$_POST['customized']`. Nevertheless,\n\t * the value returned will come from the current changeset post and from the\n\t * incoming post data.\n\t *\n\t * @since 4.1.1\n\t * @since 4.7.0 Added `$args` parameter and merging with changeset values and stashed theme mods.\n\t *\n\t * @param array $args {\n\t *     Args.\n\t *\n\t *     @type bool $exclude_changeset Whether the changeset values should also be excluded. Defaults to false.\n\t *     @type bool $exclude_post_data Whether the post input values should also be excluded. Defaults to false when lacking the customize capability.\n\t * }\n\t * @return array\n\t */\n\tpublic function unsanitized_post_values( $args = array() ) {\n\t\t$args = array_merge(\n\t\t\tarray(\n\t\t\t\t'exclude_changeset' => false,\n\t\t\t\t'exclude_post_data' => ! current_user_can( 'customize' ),\n\t\t\t),\n\t\t\t$args\n\t\t);\n\n\t\t$values = array();\n\n\t\t// Let default values be from the stashed theme mods if doing a theme switch and if no changeset is present.\n\t\tif ( ! $this->is_theme_active() ) {\n\t\t\t$stashed_theme_mods = get_option( 'customize_stashed_theme_mods' );\n\t\t\t$stylesheet         = $this->get_stylesheet();\n\t\t\tif ( isset( $stashed_theme_mods[ $stylesheet ] ) ) {\n\t\t\t\t$values = array_merge( $values, wp_list_pluck( $stashed_theme_mods[ $stylesheet ], 'value' ) );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $args['exclude_changeset'] ) {\n\t\t\tforeach ( $this->changeset_data() as $setting_id => $setting_params ) {\n\t\t\t\tif ( ! array_key_exists( 'value', $setting_params ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( isset( $setting_params['type'] ) && 'theme_mod' === $setting_params['type'] ) {\n\n\t\t\t\t\t// Ensure that theme mods values are only used if they were saved under the current theme.\n\t\t\t\t\t$namespace_pattern = '/^(?P<stylesheet>.+?)::(?P<setting_id>.+)$/';\n\t\t\t\t\tif ( preg_match( $namespace_pattern, $setting_id, $matches ) && $this->get_stylesheet() === $matches['stylesheet'] ) {\n\t\t\t\t\t\t$values[ $matches['setting_id'] ] = $setting_params['value'];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$values[ $setting_id ] = $setting_params['value'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $args['exclude_post_data'] ) {\n\t\t\tif ( ! isset( $this->_post_values ) ) {\n\t\t\t\tif ( isset( $_POST['customized'] ) ) {\n\t\t\t\t\t$post_values = json_decode( wp_unslash( $_POST['customized'] ), true );\n\t\t\t\t} else {\n\t\t\t\t\t$post_values = array();\n\t\t\t\t}\n\t\t\t\tif ( is_array( $post_values ) ) {\n\t\t\t\t\t$this->_post_values = $post_values;\n\t\t\t\t} else {\n\t\t\t\t\t$this->_post_values = array();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$values = array_merge( $values, $this->_post_values );\n\t\t}\n\t\treturn $values;\n\t}\n\n\t/**\n\t * Returns the sanitized value for a given setting from the current customized state.\n\t *\n\t * The name \"post_value\" is a carry-over from when the customized state was exclusively\n\t * sourced from `$_POST['customized']`. Nevertheless, the value returned will come\n\t * from the current changeset post and from the incoming post data.\n\t *\n\t * @since 3.4.0\n\t * @since 4.1.1 Introduced the `$default` parameter.\n\t * @since 4.6.0 `$default` is now returned early when the setting post value is invalid.\n\t *\n\t * @see WP_REST_Server::dispatch()\n\t * @see WP_REST_Request::sanitize_params()\n\t * @see WP_REST_Request::has_valid_params()\n\t *\n\t * @param WP_Customize_Setting $setting A WP_Customize_Setting derived object.\n\t * @param mixed                $default Value returned $setting has no post value (added in 4.2.0)\n\t *                                      or the post value is invalid (added in 4.6.0).\n\t * @return string|mixed Sanitized value or the $default provided.\n\t */\n\tpublic function post_value( $setting, $default = null ) {\n\t\t$post_values = $this->unsanitized_post_values();\n\t\tif ( ! array_key_exists( $setting->id, $post_values ) ) {\n\t\t\treturn $default;\n\t\t}\n\t\t$value = $post_values[ $setting->id ];\n\t\t$valid = $setting->validate( $value );\n\t\tif ( is_wp_error( $valid ) ) {\n\t\t\treturn $default;\n\t\t}\n\t\t$value = $setting->sanitize( $value );\n\t\tif ( is_null( $value ) || is_wp_error( $value ) ) {\n\t\t\treturn $default;\n\t\t}\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Override a setting's value in the current customized state.\n\t *\n\t * The name \"post_value\" is a carry-over from when the customized state was\n\t * exclusively sourced from `$_POST['customized']`.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param string $setting_id ID for the WP_Customize_Setting instance.\n\t * @param mixed  $value      Post value.\n\t */\n\tpublic function set_post_value( $setting_id, $value ) {\n\t\t$this->unsanitized_post_values(); // Populate _post_values from $_POST['customized'].\n\t\t$this->_post_values[ $setting_id ] = $value;\n\n\t\t/**\n\t\t * Announce when a specific setting's unsanitized post value has been set.\n\t\t *\n\t\t * Fires when the WP_Customize_Manager::set_post_value() method is called.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$setting_id`, refers to the setting ID.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param mixed                $value Unsanitized setting post value.\n\t\t * @param WP_Customize_Manager $this  WP_Customize_Manager instance.\n\t\t */\n\t\tdo_action( \"customize_post_value_set_{$setting_id}\", $value, $this );\n\n\t\t/**\n\t\t * Announce when any setting's unsanitized post value has been set.\n\t\t *\n\t\t * Fires when the WP_Customize_Manager::set_post_value() method is called.\n\t\t *\n\t\t * This is useful for `WP_Customize_Setting` instances to watch\n\t\t * in order to update a cached previewed value.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string               $setting_id Setting ID.\n\t\t * @param mixed                $value      Unsanitized setting post value.\n\t\t * @param WP_Customize_Manager $this       WP_Customize_Manager instance.\n\t\t */\n\t\tdo_action( 'customize_post_value_set', $setting_id, $value, $this );\n\t}\n\n\t/**\n\t * Print JavaScript settings.\n\t *\n\t * @since 3.4.0\n\t */\n\tpublic function customize_preview_init() {\n\n\t\t/*\n\t\t * Now that Customizer previews are loaded into iframes via GET requests\n\t\t * and natural URLs with transaction UUIDs added, we need to ensure that\n\t\t * the responses are never cached by proxies. In practice, this will not\n\t\t * be needed if the user is logged-in anyway. But if anonymous access is\n\t\t * allowed then the auth cookies would not be sent and WordPress would\n\t\t * not send no-cache headers by default.\n\t\t */\n\t\tif ( ! headers_sent() ) {\n\t\t\tnocache_headers();\n\t\t\theader( 'X-Robots: noindex, nofollow, noarchive' );\n\t\t}\n\t\tadd_action( 'wp_head', 'wp_no_robots' );\n\t\tadd_filter( 'wp_headers', array( $this, 'filter_iframe_security_headers' ) );\n\n\t\t/*\n\t\t * If preview is being served inside the customizer preview iframe, and\n\t\t * if the user doesn't have customize capability, then it is assumed\n\t\t * that the user's session has expired and they need to re-authenticate.\n\t\t */\n\t\tif ( $this->messenger_channel && ! current_user_can( 'customize' ) ) {\n\t\t\t$this->wp_die(\n\t\t\t\t-1,\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: customize_messenger_channel */\n\t\t\t\t\t__( 'Unauthorized. You may remove the %s param to preview as frontend.' ),\n\t\t\t\t\t'<code>customize_messenger_channel<code>'\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t$this->prepare_controls();\n\n\t\tadd_filter( 'wp_redirect', array( $this, 'add_state_query_params' ) );\n\n\t\twp_enqueue_script( 'customize-preview' );\n\t\twp_enqueue_style( 'customize-preview' );\n\t\tadd_action( 'wp_head', array( $this, 'customize_preview_loading_style' ) );\n\t\tadd_action( 'wp_head', array( $this, 'remove_frameless_preview_messenger_channel' ) );\n\t\tadd_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 );\n\t\tadd_filter( 'get_edit_post_link', '__return_empty_string' );\n\n\t\t/**\n\t\t * Fires once the Customizer preview has initialized and JavaScript\n\t\t * settings have been printed.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param WP_Customize_Manager $this WP_Customize_Manager instance.\n\t\t */\n\t\tdo_action( 'customize_preview_init', $this );\n\t}\n\n\t/**\n\t * Filter the X-Frame-Options and Content-Security-Policy headers to ensure frontend can load in customizer.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $headers Headers.\n\t * @return array Headers.\n\t */\n\tpublic function filter_iframe_security_headers( $headers ) {\n\t\t$headers['X-Frame-Options']         = 'SAMEORIGIN';\n\t\t$headers['Content-Security-Policy'] = \"frame-ancestors 'self'\";\n\t\treturn $headers;\n\t}\n\n\t/**\n\t * Add customize state query params to a given URL if preview is allowed.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see wp_redirect()\n\t * @see WP_Customize_Manager::get_allowed_url()\n\t *\n\t * @param string $url URL.\n\t * @return string URL.\n\t */\n\tpublic function add_state_query_params( $url ) {\n\t\t$parsed_original_url = wp_parse_url( $url );\n\t\t$is_allowed          = false;\n\t\tforeach ( $this->get_allowed_urls() as $allowed_url ) {\n\t\t\t$parsed_allowed_url = wp_parse_url( $allowed_url );\n\t\t\t$is_allowed         = (\n\t\t\t\t$parsed_allowed_url['scheme'] === $parsed_original_url['scheme']\n\t\t\t\t&&\n\t\t\t\t$parsed_allowed_url['host'] === $parsed_original_url['host']\n\t\t\t\t&&\n\t\t\t\t0 === strpos( $parsed_original_url['path'], $parsed_allowed_url['path'] )\n\t\t\t);\n\t\t\tif ( $is_allowed ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( $is_allowed ) {\n\t\t\t$query_params = array(\n\t\t\t\t'customize_changeset_uuid' => $this->changeset_uuid(),\n\t\t\t);\n\t\t\tif ( ! $this->is_theme_active() ) {\n\t\t\t\t$query_params['customize_theme'] = $this->get_stylesheet();\n\t\t\t}\n\t\t\tif ( $this->messenger_channel ) {\n\t\t\t\t$query_params['customize_messenger_channel'] = $this->messenger_channel;\n\t\t\t}\n\t\t\t$url = add_query_arg( $query_params, $url );\n\t\t}\n\n\t\treturn $url;\n\t}\n\n\t/**\n\t * Prevent sending a 404 status when returning the response for the customize\n\t * preview, since it causes the jQuery Ajax to fail. Send 200 instead.\n\t *\n\t * @since 4.0.0\n\t * @deprecated 4.7.0\n\t */\n\tpublic function customize_preview_override_404_status() {\n\t\t_deprecated_function( __METHOD__, '4.7.0' );\n\t}\n\n\t/**\n\t * Print base element for preview frame.\n\t *\n\t * @since 3.4.0\n\t * @deprecated 4.7.0\n\t */\n\tpublic function customize_preview_base() {\n\t\t_deprecated_function( __METHOD__, '4.7.0' );\n\t}\n\n\t/**\n\t * Print a workaround to handle HTML5 tags in IE < 9.\n\t *\n\t * @since 3.4.0\n\t * @deprecated 4.7.0 Customizer no longer supports IE8, so all supported browsers recognize HTML5.\n\t */\n\tpublic function customize_preview_html5() {\n\t\t_deprecated_function( __FUNCTION__, '4.7.0' );\n\t}\n\n\t/**\n\t * Print CSS for loading indicators for the Customizer preview.\n\t *\n\t * @since 4.2.0\n\t */\n\tpublic function customize_preview_loading_style() {\n\t\t?>\n\t\t<style>\n\t\t\tbody.wp-customizer-unloading {\n\t\t\t\topacity: 0.25;\n\t\t\t\tcursor: progress !important;\n\t\t\t\t-webkit-transition: opacity 0.5s;\n\t\t\t\ttransition: opacity 0.5s;\n\t\t\t}\n\t\t\tbody.wp-customizer-unloading * {\n\t\t\t\tpointer-events: none !important;\n\t\t\t}\n\t\t\tform.customize-unpreviewable,\n\t\t\tform.customize-unpreviewable input,\n\t\t\tform.customize-unpreviewable select,\n\t\t\tform.customize-unpreviewable button,\n\t\t\ta.customize-unpreviewable,\n\t\t\tarea.customize-unpreviewable {\n\t\t\t\tcursor: not-allowed !important;\n\t\t\t}\n\t\t</style>\n\t\t<?php\n\t}\n\n\t/**\n\t * Remove customize_messenger_channel query parameter from the preview window when it is not in an iframe.\n\t *\n\t * This ensures that the admin bar will be shown. It also ensures that link navigation will\n\t * work as expected since the parent frame is not being sent the URL to navigate to.\n\t *\n\t * @since 4.7.0\n\t */\n\tpublic function remove_frameless_preview_messenger_channel() {\n\t\tif ( ! $this->messenger_channel ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<script>\n\t\t( function() {\n\t\t\tvar urlParser, oldQueryParams, newQueryParams, i;\n\t\t\tif ( parent !== window ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\turlParser = document.createElement( 'a' );\n\t\t\turlParser.href = location.href;\n\t\t\toldQueryParams = urlParser.search.substr( 1 ).split( /&/ );\n\t\t\tnewQueryParams = [];\n\t\t\tfor ( i = 0; i < oldQueryParams.length; i += 1 ) {\n\t\t\t\tif ( ! /^customize_messenger_channel=/.test( oldQueryParams[ i ] ) ) {\n\t\t\t\t\tnewQueryParams.push( oldQueryParams[ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t\turlParser.search = newQueryParams.join( '&' );\n\t\t\tif ( urlParser.search !== location.search ) {\n\t\t\t\tlocation.replace( urlParser.href );\n\t\t\t}\n\t\t} )();\n\t\t</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * Print JavaScript settings for preview frame.\n\t *\n\t * @since 3.4.0\n\t */\n\tpublic function customize_preview_settings() {\n\t\t$post_values                 = $this->unsanitized_post_values( array( 'exclude_changeset' => true ) );\n\t\t$setting_validities          = $this->validate_setting_values( $post_values );\n\t\t$exported_setting_validities = array_map( array( $this, 'prepare_setting_validity_for_js' ), $setting_validities );\n\n\t\t// Note that the REQUEST_URI is not passed into home_url() since this breaks subdirectory installations.\n\t\t$self_url           = empty( $_SERVER['REQUEST_URI'] ) ? home_url( '/' ) : esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) );\n\t\t$state_query_params = array(\n\t\t\t'customize_theme',\n\t\t\t'customize_changeset_uuid',\n\t\t\t'customize_messenger_channel',\n\t\t);\n\t\t$self_url           = remove_query_arg( $state_query_params, $self_url );\n\n\t\t$allowed_urls  = $this->get_allowed_urls();\n\t\t$allowed_hosts = array();\n\t\tforeach ( $allowed_urls as $allowed_url ) {\n\t\t\t$parsed = wp_parse_url( $allowed_url );\n\t\t\tif ( empty( $parsed['host'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$host = $parsed['host'];\n\t\t\tif ( ! empty( $parsed['port'] ) ) {\n\t\t\t\t$host .= ':' . $parsed['port'];\n\t\t\t}\n\t\t\t$allowed_hosts[] = $host;\n\t\t}\n\n\t\t$switched_locale = switch_to_locale( get_user_locale() );\n\t\t$l10n            = array(\n\t\t\t'shiftClickToEdit'  => __( 'Shift-click to edit this element.' ),\n\t\t\t'linkUnpreviewable' => __( 'This link is not live-previewable.' ),\n\t\t\t'formUnpreviewable' => __( 'This form is not live-previewable.' ),\n\t\t);\n\t\tif ( $switched_locale ) {\n\t\t\trestore_previous_locale();\n\t\t}\n\n\t\t$settings = array(\n\t\t\t'changeset'         => array(\n\t\t\t\t'uuid'      => $this->changeset_uuid(),\n\t\t\t\t'autosaved' => $this->autosaved(),\n\t\t\t),\n\t\t\t'timeouts'          => array(\n\t\t\t\t'selectiveRefresh' => 250,\n\t\t\t\t'keepAliveSend'    => 1000,\n\t\t\t),\n\t\t\t'theme'             => array(\n\t\t\t\t'stylesheet' => $this->get_stylesheet(),\n\t\t\t\t'active'     => $this->is_theme_active(),\n\t\t\t),\n\t\t\t'url'               => array(\n\t\t\t\t'self'          => $self_url,\n\t\t\t\t'allowed'       => array_map( 'esc_url_raw', $this->get_allowed_urls() ),\n\t\t\t\t'allowedHosts'  => array_unique( $allowed_hosts ),\n\t\t\t\t'isCrossDomain' => $this->is_cross_domain(),\n\t\t\t),\n\t\t\t'channel'           => $this->messenger_channel,\n\t\t\t'activePanels'      => array(),\n\t\t\t'activeSections'    => array(),\n\t\t\t'activeControls'    => array(),\n\t\t\t'settingValidities' => $exported_setting_validities,\n\t\t\t'nonce'             => current_user_can( 'customize' ) ? $this->get_nonces() : array(),\n\t\t\t'l10n'              => $l10n,\n\t\t\t'_dirty'            => array_keys( $post_values ),\n\t\t);\n\n\t\tforeach ( $this->panels as $panel_id => $panel ) {\n\t\t\tif ( $panel->check_capabilities() ) {\n\t\t\t\t$settings['activePanels'][ $panel_id ] = $panel->active();\n\t\t\t\tforeach ( $panel->sections as $section_id => $section ) {\n\t\t\t\t\tif ( $section->check_capabilities() ) {\n\t\t\t\t\t\t$settings['activeSections'][ $section_id ] = $section->active();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach ( $this->sections as $id => $section ) {\n\t\t\tif ( $section->check_capabilities() ) {\n\t\t\t\t$settings['activeSections'][ $id ] = $section->active();\n\t\t\t}\n\t\t}\n\t\tforeach ( $this->controls as $id => $control ) {\n\t\t\tif ( $control->check_capabilities() ) {\n\t\t\t\t$settings['activeControls'][ $id ] = $control->active();\n\t\t\t}\n\t\t}\n\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t\tvar _wpCustomizeSettings = <?php echo wp_json_encode( $settings ); ?>;\n\t\t\t_wpCustomizeSettings.values = {};\n\t\t\t(function( v ) {\n\t\t\t\t<?php\n\t\t\t\t/*\n\t\t\t\t * Serialize settings separately from the initial _wpCustomizeSettings\n\t\t\t\t * serialization in order to avoid a peak memory usage spike.\n\t\t\t\t * @todo We may not even need to export the values at all since the pane syncs them anyway.\n\t\t\t\t */\n\t\t\t\tforeach ( $this->settings as $id => $setting ) {\n\t\t\t\t\tif ( $setting->check_capabilities() ) {\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\"v[%s] = %s;\\n\",\n\t\t\t\t\t\t\twp_json_encode( $id ),\n\t\t\t\t\t\t\twp_json_encode( $setting->js_value() )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t})( _wpCustomizeSettings.values );\n\t\t</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * Prints a signature so we can ensure the Customizer was properly executed.\n\t *\n\t * @since 3.4.0\n\t * @deprecated 4.7.0\n\t */\n\tpublic function customize_preview_signature() {\n\t\t_deprecated_function( __METHOD__, '4.7.0' );\n\t}\n\n\t/**\n\t * Removes the signature in case we experience a case where the Customizer was not properly executed.\n\t *\n\t * @since 3.4.0\n\t * @deprecated 4.7.0\n\t *\n\t * @param mixed $return Value passed through for {@see 'wp_die_handler'} filter.\n\t * @return mixed Value passed through for {@see 'wp_die_handler'} filter.\n\t */\n\tpublic function remove_preview_signature( $return = null ) {\n\t\t_deprecated_function( __METHOD__, '4.7.0' );\n\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Is it a theme preview?\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return bool True if it's a preview, false if not.\n\t */\n\tpublic function is_preview() {\n\t\treturn (bool) $this->previewing;\n\t}\n\n\t/**\n\t * Retrieve the template name of the previewed theme.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return string Template name.\n\t */\n\tpublic function get_template() {\n\t\treturn $this->theme()->get_template();\n\t}\n\n\t/**\n\t * Retrieve the stylesheet name of the previewed theme.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return string Stylesheet name.\n\t */\n\tpublic function get_stylesheet() {\n\t\treturn $this->theme()->get_stylesheet();\n\t}\n\n\t/**\n\t * Retrieve the template root of the previewed theme.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return string Theme root.\n\t */\n\tpublic function get_template_root() {\n\t\treturn get_raw_theme_root( $this->get_template(), true );\n\t}\n\n\t/**\n\t * Retrieve the stylesheet root of the previewed theme.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return string Theme root.\n\t */\n\tpublic function get_stylesheet_root() {\n\t\treturn get_raw_theme_root( $this->get_stylesheet(), true );\n\t}\n\n\t/**\n\t * Filters the current theme and return the name of the previewed theme.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param mixed $current_theme {@internal Parameter is not used}\n\t * @return string Theme name.\n\t */\n\tpublic function current_theme( $current_theme ) {\n\t\treturn $this->theme()->display( 'Name' );\n\t}\n\n\t/**\n\t * Validates setting values.\n\t *\n\t * Validation is skipped for unregistered settings or for values that are\n\t * already null since they will be skipped anyway. Sanitization is applied\n\t * to values that pass validation, and values that become null or `WP_Error`\n\t * after sanitizing are marked invalid.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @see WP_REST_Request::has_valid_params()\n\t * @see WP_Customize_Setting::validate()\n\t *\n\t * @param array $setting_values Mapping of setting IDs to values to validate and sanitize.\n\t * @param array $options {\n\t *     Options.\n\t *\n\t *     @type bool $validate_existence  Whether a setting's existence will be checked.\n\t *     @type bool $validate_capability Whether the setting capability will be checked.\n\t * }\n\t * @return array Mapping of setting IDs to return value of validate method calls, either `true` or `WP_Error`.\n\t */\n\tpublic function validate_setting_values( $setting_values, $options = array() ) {\n\t\t$options = wp_parse_args(\n\t\t\t$options,\n\t\t\tarray(\n\t\t\t\t'validate_capability' => false,\n\t\t\t\t'validate_existence'  => false,\n\t\t\t)\n\t\t);\n\n\t\t$validities = array();\n\t\tforeach ( $setting_values as $setting_id => $unsanitized_value ) {\n\t\t\t$setting = $this->get_setting( $setting_id );\n\t\t\tif ( ! $setting ) {\n\t\t\t\tif ( $options['validate_existence'] ) {\n\t\t\t\t\t$validities[ $setting_id ] = new WP_Error( 'unrecognized', __( 'Setting does not exist or is unrecognized.' ) );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( $options['validate_capability'] && ! current_user_can( $setting->capability ) ) {\n\t\t\t\t$validity = new WP_Error( 'unauthorized', __( 'Unauthorized to modify setting due to capability.' ) );\n\t\t\t} else {\n\t\t\t\tif ( is_null( $unsanitized_value ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$validity = $setting->validate( $unsanitized_value );\n\t\t\t}\n\t\t\tif ( ! is_wp_error( $validity ) ) {\n\t\t\t\t/** This filter is documented in wp-includes/class-wp-customize-setting.php */\n\t\t\t\t$late_validity = apply_filters( \"customize_validate_{$setting->id}\", new WP_Error(), $unsanitized_value, $setting );\n\t\t\t\tif ( is_wp_error( $late_validity ) && $late_validity->has_errors() ) {\n\t\t\t\t\t$validity = $late_validity;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! is_wp_error( $validity ) ) {\n\t\t\t\t$value = $setting->sanitize( $unsanitized_value );\n\t\t\t\tif ( is_null( $value ) ) {\n\t\t\t\t\t$validity = false;\n\t\t\t\t} elseif ( is_wp_error( $value ) ) {\n\t\t\t\t\t$validity = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( false === $validity ) {\n\t\t\t\t$validity = new WP_Error( 'invalid_value', __( 'Invalid value.' ) );\n\t\t\t}\n\t\t\t$validities[ $setting_id ] = $validity;\n\t\t}\n\t\treturn $validities;\n\t}\n\n\t/**\n\t * Prepares setting validity for exporting to the client (JS).\n\t *\n\t * Converts `WP_Error` instance into array suitable for passing into the\n\t * `wp.customize.Notification` JS model.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param true|WP_Error $validity Setting validity.\n\t * @return true|array If `$validity` was a WP_Error, the error codes will be array-mapped\n\t *                    to their respective `message` and `data` to pass into the\n\t *                    `wp.customize.Notification` JS model.\n\t */\n\tpublic function prepare_setting_validity_for_js( $validity ) {\n\t\tif ( is_wp_error( $validity ) ) {\n\t\t\t$notification = array();\n\t\t\tforeach ( $validity->errors as $error_code => $error_messages ) {\n\t\t\t\t$notification[ $error_code ] = array(\n\t\t\t\t\t'message' => join( ' ', $error_messages ),\n\t\t\t\t\t'data'    => $validity->get_error_data( $error_code ),\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn $notification;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t/**\n\t * Handle customize_save WP Ajax request to save/update a changeset.\n\t *\n\t * @since 3.4.0\n\t * @since 4.7.0 The semantics of this method have changed to update a changeset, optionally to also change the status and other attributes.\n\t */\n\tpublic function save() {\n\t\tif ( ! is_user_logged_in() ) {\n\t\t\twp_send_json_error( 'unauthenticated' );\n\t\t}\n\n\t\tif ( ! $this->is_preview() ) {\n\t\t\twp_send_json_error( 'not_preview' );\n\t\t}\n\n\t\t$action = 'save-customize_' . $this->get_stylesheet();\n\t\tif ( ! check_ajax_referer( $action, 'nonce', false ) ) {\n\t\t\twp_send_json_error( 'invalid_nonce' );\n\t\t}\n\n\t\t$changeset_post_id = $this->changeset_post_id();\n\t\t$is_new_changeset  = empty( $changeset_post_id );\n\t\tif ( $is_new_changeset ) {\n\t\t\tif ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->create_posts ) ) {\n\t\t\t\twp_send_json_error( 'cannot_create_changeset_post' );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $changeset_post_id ) ) {\n\t\t\t\twp_send_json_error( 'cannot_edit_changeset_post' );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $_POST['customize_changeset_data'] ) ) {\n\t\t\t$input_changeset_data = json_decode( wp_unslash( $_POST['customize_changeset_data'] ), true );\n\t\t\tif ( ! is_array( $input_changeset_data ) ) {\n\t\t\t\twp_send_json_error( 'invalid_customize_changeset_data' );\n\t\t\t}\n\t\t} else {\n\t\t\t$input_changeset_data = array();\n\t\t}\n\n\t\t// Validate title.\n\t\t$changeset_title = null;\n\t\tif ( isset( $_POST['customize_changeset_title'] ) ) {\n\t\t\t$changeset_title = sanitize_text_field( wp_unslash( $_POST['customize_changeset_title'] ) );\n\t\t}\n\n\t\t// Validate changeset status param.\n\t\t$is_publish       = null;\n\t\t$changeset_status = null;\n\t\tif ( isset( $_POST['customize_changeset_status'] ) ) {\n\t\t\t$changeset_status = wp_unslash( $_POST['customize_changeset_status'] );\n\t\t\tif ( ! get_post_status_object( $changeset_status ) || ! in_array( $changeset_status, array( 'draft', 'pending', 'publish', 'future' ), true ) ) {\n\t\t\t\twp_send_json_error( 'bad_customize_changeset_status', 400 );\n\t\t\t}\n\t\t\t$is_publish = ( 'publish' === $changeset_status || 'future' === $changeset_status );\n\t\t\tif ( $is_publish && ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->publish_posts ) ) {\n\t\t\t\twp_send_json_error( 'changeset_publish_unauthorized', 403 );\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Validate changeset date param. Date is assumed to be in local time for\n\t\t * the WP if in MySQL format (YYYY-MM-DD HH:MM:SS). Otherwise, the date\n\t\t * is parsed with strtotime() so that ISO date format may be supplied\n\t\t * or a string like \"+10 minutes\".\n\t\t */\n\t\t$changeset_date_gmt = null;\n\t\tif ( isset( $_POST['customize_changeset_date'] ) ) {\n\t\t\t$changeset_date = wp_unslash( $_POST['customize_changeset_date'] );\n\t\t\tif ( preg_match( '/^\\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d:\\d\\d:\\d\\d$/', $changeset_date ) ) {\n\t\t\t\t$mm         = substr( $changeset_date, 5, 2 );\n\t\t\t\t$jj         = substr( $changeset_date, 8, 2 );\n\t\t\t\t$aa         = substr( $changeset_date, 0, 4 );\n\t\t\t\t$valid_date = wp_checkdate( $mm, $jj, $aa, $changeset_date );\n\t\t\t\tif ( ! $valid_date ) {\n\t\t\t\t\twp_send_json_error( 'bad_customize_changeset_date', 400 );\n\t\t\t\t}\n\t\t\t\t$changeset_date_gmt = get_gmt_from_date( $changeset_date );\n\t\t\t} else {\n\t\t\t\t$timestamp = strtotime( $changeset_date );\n\t\t\t\tif ( ! $timestamp ) {\n\t\t\t\t\twp_send_json_error( 'bad_customize_changeset_date', 400 );\n\t\t\t\t}\n\t\t\t\t$changeset_date_gmt = gmdate( 'Y-m-d H:i:s', $timestamp );\n\t\t\t}\n\t\t}\n\n\t\t$lock_user_id = null;\n\t\t$autosave     = ! empty( $_POST['customize_changeset_autosave'] );\n\t\tif ( ! $is_new_changeset ) {\n\t\t\t$lock_user_id = wp_check_post_lock( $this->changeset_post_id() );\n\t\t}\n\n\t\t// Force request to autosave when changeset is locked.\n\t\tif ( $lock_user_id && ! $autosave ) {\n\t\t\t$autosave           = true;\n\t\t\t$changeset_status   = null;\n\t\t\t$changeset_date_gmt = null;\n\t\t}\n\n\t\tif ( $autosave && ! defined( 'DOING_AUTOSAVE' ) ) { // Back-compat.\n\t\t\tdefine( 'DOING_AUTOSAVE', true );\n\t\t}\n\n\t\t$autosaved = false;\n\t\t$r         = $this->save_changeset_post(\n\t\t\tarray(\n\t\t\t\t'status'   => $changeset_status,\n\t\t\t\t'title'    => $changeset_title,\n\t\t\t\t'date_gmt' => $changeset_date_gmt,\n\t\t\t\t'data'     => $input_changeset_data,\n\t\t\t\t'autosave' => $autosave,\n\t\t\t)\n\t\t);\n\t\tif ( $autosave && ! is_wp_error( $r ) ) {\n\t\t\t$autosaved = true;\n\t\t}\n\n\t\t// If the changeset was locked and an autosave request wasn't itself an error, then now explicitly return with a failure.\n\t\tif ( $lock_user_id && ! is_wp_error( $r ) ) {\n\t\t\t$r = new WP_Error(\n\t\t\t\t'changeset_locked',\n\t\t\t\t__( 'Changeset is being edited by other user.' ),\n\t\t\t\tarray(\n\t\t\t\t\t'lock_user' => $this->get_lock_user_data( $lock_user_id ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( is_wp_error( $r ) ) {\n\t\t\t$response = array(\n\t\t\t\t'message' => $r->get_error_message(),\n\t\t\t\t'code'    => $r->get_error_code(),\n\t\t\t);\n\t\t\tif ( is_array( $r->get_error_data() ) ) {\n\t\t\t\t$response = array_merge( $response, $r->get_error_data() );\n\t\t\t} else {\n\t\t\t\t$response['data'] = $r->get_error_data();\n\t\t\t}\n\t\t} else {\n\t\t\t$response       = $r;\n\t\t\t$changeset_post = get_post( $this->changeset_post_id() );\n\n\t\t\t// Dismiss all other auto-draft changeset posts for this user (they serve like autosave revisions), as there should only be one.\n\t\t\tif ( $is_new_changeset ) {\n\t\t\t\t$this->dismiss_user_auto_draft_changesets();\n\t\t\t}\n\n\t\t\t// Note that if the changeset status was publish, then it will get set to Trash if revisions are not supported.\n\t\t\t$response['changeset_status'] = $changeset_post->post_status;\n\t\t\tif ( $is_publish && 'trash' === $response['changeset_status'] ) {\n\t\t\t\t$response['changeset_status'] = 'publish';\n\t\t\t}\n\n\t\t\tif ( 'publish' !== $response['changeset_status'] ) {\n\t\t\t\t$this->set_changeset_lock( $changeset_post->ID );\n\t\t\t}\n\n\t\t\tif ( 'future' === $response['changeset_status'] ) {\n\t\t\t\t$response['changeset_date'] = $changeset_post->post_date;\n\t\t\t}\n\n\t\t\tif ( 'publish' === $response['changeset_status'] || 'trash' === $response['changeset_status'] ) {\n\t\t\t\t$response['next_changeset_uuid'] = wp_generate_uuid4();\n\t\t\t}\n\t\t}\n\n\t\tif ( $autosave ) {\n\t\t\t$response['autosaved'] = $autosaved;\n\t\t}\n\n\t\tif ( isset( $response['setting_validities'] ) ) {\n\t\t\t$response['setting_validities'] = array_map( array( $this, 'prepare_setting_validity_for_js' ), $response['setting_validities'] );\n\t\t}\n\n\t\t/**\n\t\t * Filters response data for a successful customize_save Ajax request.\n\t\t *\n\t\t * This filter does not apply if there was a nonce or authentication failure.\n\t\t *\n\t\t * @since 4.2.0\n\t\t *\n\t\t * @param array                $response Additional information passed back to the 'saved'\n\t\t *                                       event on `wp.customize`.\n\t\t * @param WP_Customize_Manager $this     WP_Customize_Manager instance.\n\t\t */\n\t\t$response = apply_filters( 'customize_save_response', $response, $this );\n\n\t\tif ( is_wp_error( $r ) ) {\n\t\t\twp_send_json_error( $response );\n\t\t} else {\n\t\t\twp_send_json_success( $response );\n\t\t}\n\t}\n\n\t/**\n\t * Save the post for the loaded changeset.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $args {\n\t *     Args for changeset post.\n\t *\n\t *     @type array  $data            Optional additional changeset data. Values will be merged on top of any existing post values.\n\t *     @type string $status          Post status. Optional. If supplied, the save will be transactional and a post revision will be allowed.\n\t *     @type string $title           Post title. Optional.\n\t *     @type string $date_gmt        Date in GMT. Optional.\n\t *     @type int    $user_id         ID for user who is saving the changeset. Optional, defaults to the current user ID.\n\t *     @type bool   $starter_content Whether the data is starter content. If false (default), then $starter_content will be cleared for any $data being saved.\n\t *     @type bool   $autosave        Whether this is a request to create an autosave revision.\n\t * }\n\t *\n\t * @return array|WP_Error Returns array on success and WP_Error with array data on error.\n\t */\n\tfunction save_changeset_post( $args = array() ) {\n\n\t\t$args = array_merge(\n\t\t\tarray(\n\t\t\t\t'status'          => null,\n\t\t\t\t'title'           => null,\n\t\t\t\t'data'            => array(),\n\t\t\t\t'date_gmt'        => null,\n\t\t\t\t'user_id'         => get_current_user_id(),\n\t\t\t\t'starter_content' => false,\n\t\t\t\t'autosave'        => false,\n\t\t\t),\n\t\t\t$args\n\t\t);\n\n\t\t$changeset_post_id       = $this->changeset_post_id();\n\t\t$existing_changeset_data = array();\n\t\tif ( $changeset_post_id ) {\n\t\t\t$existing_status = get_post_status( $changeset_post_id );\n\t\t\tif ( 'publish' === $existing_status || 'trash' === $existing_status ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'changeset_already_published',\n\t\t\t\t\t__( 'The previous set of changes has already been published. Please try saving your current set of changes again.' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'next_changeset_uuid' => wp_generate_uuid4(),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$existing_changeset_data = $this->get_changeset_post_data( $changeset_post_id );\n\t\t\tif ( is_wp_error( $existing_changeset_data ) ) {\n\t\t\t\treturn $existing_changeset_data;\n\t\t\t}\n\t\t}\n\n\t\t// Fail if attempting to publish but publish hook is missing.\n\t\tif ( 'publish' === $args['status'] && false === has_action( 'transition_post_status', '_wp_customize_publish_changeset' ) ) {\n\t\t\treturn new WP_Error( 'missing_publish_callback' );\n\t\t}\n\n\t\t// Validate date.\n\t\t$now = gmdate( 'Y-m-d H:i:59' );\n\t\tif ( $args['date_gmt'] ) {\n\t\t\t$is_future_dated = ( mysql2date( 'U', $args['date_gmt'], false ) > mysql2date( 'U', $now, false ) );\n\t\t\tif ( ! $is_future_dated ) {\n\t\t\t\treturn new WP_Error( 'not_future_date', __( 'You must supply a future date to schedule.' ) ); // Only future dates are allowed.\n\t\t\t}\n\n\t\t\tif ( ! $this->is_theme_active() && ( 'future' === $args['status'] || $is_future_dated ) ) {\n\t\t\t\treturn new WP_Error( 'cannot_schedule_theme_switches' ); // This should be allowed in the future, when theme is a regular setting.\n\t\t\t}\n\t\t\t$will_remain_auto_draft = ( ! $args['status'] && ( ! $changeset_post_id || 'auto-draft' === get_post_status( $changeset_post_id ) ) );\n\t\t\tif ( $will_remain_auto_draft ) {\n\t\t\t\treturn new WP_Error( 'cannot_supply_date_for_auto_draft_changeset' );\n\t\t\t}\n\t\t} elseif ( $changeset_post_id && 'future' === $args['status'] ) {\n\n\t\t\t// Fail if the new status is future but the existing post's date is not in the future.\n\t\t\t$changeset_post = get_post( $changeset_post_id );\n\t\t\tif ( mysql2date( 'U', $changeset_post->post_date_gmt, false ) <= mysql2date( 'U', $now, false ) ) {\n\t\t\t\treturn new WP_Error( 'not_future_date', __( 'You must supply a future date to schedule.' ) );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $is_future_dated ) && 'publish' === $args['status'] ) {\n\t\t\t$args['status'] = 'future';\n\t\t}\n\n\t\t// Validate autosave param. See _wp_post_revision_fields() for why these fields are disallowed.\n\t\tif ( $args['autosave'] ) {\n\t\t\tif ( $args['date_gmt'] ) {\n\t\t\t\treturn new WP_Error( 'illegal_autosave_with_date_gmt' );\n\t\t\t} elseif ( $args['status'] ) {\n\t\t\t\treturn new WP_Error( 'illegal_autosave_with_status' );\n\t\t\t} elseif ( $args['user_id'] && get_current_user_id() !== $args['user_id'] ) {\n\t\t\t\treturn new WP_Error( 'illegal_autosave_with_non_current_user' );\n\t\t\t}\n\t\t}\n\n\t\t// The request was made via wp.customize.previewer.save().\n\t\t$update_transactionally = (bool) $args['status'];\n\t\t$allow_revision         = (bool) $args['status'];\n\n\t\t// Amend post values with any supplied data.\n\t\tforeach ( $args['data'] as $setting_id => $setting_params ) {\n\t\t\tif ( is_array( $setting_params ) && array_key_exists( 'value', $setting_params ) ) {\n\t\t\t\t$this->set_post_value( $setting_id, $setting_params['value'] ); // Add to post values so that they can be validated and sanitized.\n\t\t\t}\n\t\t}\n\n\t\t// Note that in addition to post data, this will include any stashed theme mods.\n\t\t$post_values = $this->unsanitized_post_values(\n\t\t\tarray(\n\t\t\t\t'exclude_changeset' => true,\n\t\t\t\t'exclude_post_data' => false,\n\t\t\t)\n\t\t);\n\t\t$this->add_dynamic_settings( array_keys( $post_values ) ); // Ensure settings get created even if they lack an input value.\n\n\t\t/*\n\t\t * Get list of IDs for settings that have values different from what is currently\n\t\t * saved in the changeset. By skipping any values that are already the same, the\n\t\t * subset of changed settings can be passed into validate_setting_values to prevent\n\t\t * an underprivileged modifying a single setting for which they have the capability\n\t\t * from being blocked from saving. This also prevents a user from touching of the\n\t\t * previous saved settings and overriding the associated user_id if they made no change.\n\t\t */\n\t\t$changed_setting_ids = array();\n\t\tforeach ( $post_values as $setting_id => $setting_value ) {\n\t\t\t$setting = $this->get_setting( $setting_id );\n\n\t\t\tif ( $setting && 'theme_mod' === $setting->type ) {\n\t\t\t\t$prefixed_setting_id = $this->get_stylesheet() . '::' . $setting->id;\n\t\t\t} else {\n\t\t\t\t$prefixed_setting_id = $setting_id;\n\t\t\t}\n\n\t\t\t$is_value_changed = (\n\t\t\t\t! isset( $existing_changeset_data[ $prefixed_setting_id ] )\n\t\t\t\t||\n\t\t\t\t! array_key_exists( 'value', $existing_changeset_data[ $prefixed_setting_id ] )\n\t\t\t\t||\n\t\t\t\t$existing_changeset_data[ $prefixed_setting_id ]['value'] !== $setting_value\n\t\t\t);\n\t\t\tif ( $is_value_changed ) {\n\t\t\t\t$changed_setting_ids[] = $setting_id;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Fires before save validation happens.\n\t\t *\n\t\t * Plugins can add just-in-time {@see 'customize_validate_{$this->ID}'} filters\n\t\t * at this point to catch any settings registered after `customize_register`.\n\t\t * The dynamic portion of the hook name, `$this->ID` refers to the setting ID.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param WP_Customize_Manager $this WP_Customize_Manager instance.\n\t\t */\n\t\tdo_action( 'customize_save_validation_before', $this );\n\n\t\t// Validate settings.\n\t\t$validated_values      = array_merge(\n\t\t\tarray_fill_keys( array_keys( $args['data'] ), null ), // Make sure existence/capability checks are done on value-less setting updates.\n\t\t\t$post_values\n\t\t);\n\t\t$setting_validities    = $this->validate_setting_values(\n\t\t\t$validated_values,\n\t\t\tarray(\n\t\t\t\t'validate_capability' => true,\n\t\t\t\t'validate_existence'  => true,\n\t\t\t)\n\t\t);\n\t\t$invalid_setting_count = count( array_filter( $setting_validities, 'is_wp_error' ) );\n\n\t\t/*\n\t\t * Short-circuit if there are invalid settings the update is transactional.\n\t\t * A changeset update is transactional when a status is supplied in the request.\n\t\t */\n\t\tif ( $update_transactionally && $invalid_setting_count > 0 ) {\n\t\t\t$response = array(\n\t\t\t\t'setting_validities' => $setting_validities,\n\t\t\t\t/* translators: %s: Number of invalid settings. */\n\t\t\t\t'message'            => sprintf( _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', $invalid_setting_count ), number_format_i18n( $invalid_setting_count ) ),\n\t\t\t);\n\t\t\treturn new WP_Error( 'transaction_fail', '', $response );\n\t\t}\n\n\t\t// Obtain/merge data for changeset.\n\t\t$original_changeset_data = $this->get_changeset_post_data( $changeset_post_id );\n\t\t$data                    = $original_changeset_data;\n\t\tif ( is_wp_error( $data ) ) {\n\t\t\t$data = array();\n\t\t}\n\n\t\t// Ensure that all post values are included in the changeset data.\n\t\tforeach ( $post_values as $setting_id => $post_value ) {\n\t\t\tif ( ! isset( $args['data'][ $setting_id ] ) ) {\n\t\t\t\t$args['data'][ $setting_id ] = array();\n\t\t\t}\n\t\t\tif ( ! isset( $args['data'][ $setting_id ]['value'] ) ) {\n\t\t\t\t$args['data'][ $setting_id ]['value'] = $post_value;\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $args['data'] as $setting_id => $setting_params ) {\n\t\t\t$setting = $this->get_setting( $setting_id );\n\t\t\tif ( ! $setting || ! $setting->check_capabilities() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip updating changeset for invalid setting values.\n\t\t\tif ( isset( $setting_validities[ $setting_id ] ) && is_wp_error( $setting_validities[ $setting_id ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$changeset_setting_id = $setting_id;\n\t\t\tif ( 'theme_mod' === $setting->type ) {\n\t\t\t\t$changeset_setting_id = sprintf( '%s::%s', $this->get_stylesheet(), $setting_id );\n\t\t\t}\n\n\t\t\tif ( null === $setting_params ) {\n\t\t\t\t// Remove setting from changeset entirely.\n\t\t\t\tunset( $data[ $changeset_setting_id ] );\n\t\t\t} else {\n\n\t\t\t\tif ( ! isset( $data[ $changeset_setting_id ] ) ) {\n\t\t\t\t\t$data[ $changeset_setting_id ] = array();\n\t\t\t\t}\n\n\t\t\t\t// Merge any additional setting params that have been supplied with the existing params.\n\t\t\t\t$merged_setting_params = array_merge( $data[ $changeset_setting_id ], $setting_params );\n\n\t\t\t\t// Skip updating setting params if unchanged (ensuring the user_id is not overwritten).\n\t\t\t\tif ( $data[ $changeset_setting_id ] === $merged_setting_params ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$data[ $changeset_setting_id ] = array_merge(\n\t\t\t\t\t$merged_setting_params,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type'              => $setting->type,\n\t\t\t\t\t\t'user_id'           => $args['user_id'],\n\t\t\t\t\t\t'date_modified_gmt' => current_time( 'mysql', true ),\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// Clear starter_content flag in data if changeset is not explicitly being updated for starter content.\n\t\t\t\tif ( empty( $args['starter_content'] ) ) {\n\t\t\t\t\tunset( $data[ $changeset_setting_id ]['starter_content'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$filter_context = array(\n\t\t\t'uuid'          => $this->changeset_uuid(),\n\t\t\t'title'         => $args['title'],\n\t\t\t'status'        => $args['status'],\n\t\t\t'date_gmt'      => $args['date_gmt'],\n\t\t\t'post_id'       => $changeset_post_id,\n\t\t\t'previous_data' => is_wp_error( $original_changeset_data ) ? array() : $original_changeset_data,\n\t\t\t'manager'       => $this,\n\t\t);\n\n\t\t/**\n\t\t * Filters the settings' data that will be persisted into the changeset.\n\t\t *\n\t\t * Plugins may amend additional data (such as additional meta for settings) into the changeset with this filter.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param array $data Updated changeset data, mapping setting IDs to arrays containing a $value item and optionally other metadata.\n\t\t * @param array $context {\n\t\t *     Filter context.\n\t\t *\n\t\t *     @type string               $uuid          Changeset UUID.\n\t\t *     @type string               $title         Requested title for the changeset post.\n\t\t *     @type string               $status        Requested status for the changeset post.\n\t\t *     @type string               $date_gmt      Requested date for the changeset post in MySQL format and GMT timezone.\n\t\t *     @type int|false            $post_id       Post ID for the changeset, or false if it doesn't exist yet.\n\t\t *     @type array                $previous_data Previous data contained in the changeset.\n\t\t *     @type WP_Customize_Manager $manager       Manager instance.\n\t\t * }\n\t\t */\n\t\t$data = apply_filters( 'customize_changeset_save_data', $data, $filter_context );\n\n\t\t// Switch theme if publishing changes now.\n\t\tif ( 'publish' === $args['status'] && ! $this->is_theme_active() ) {\n\t\t\t// Temporarily stop previewing the theme to allow switch_themes() to operate properly.\n\t\t\t$this->stop_previewing_theme();\n\t\t\tswitch_theme( $this->get_stylesheet() );\n\t\t\tupdate_option( 'theme_switched_via_customizer', true );\n\t\t\t$this->start_previewing_theme();\n\t\t}\n\n\t\t// Gather the data for wp_insert_post()/wp_update_post().\n\t\t$post_array = array(\n\t\t\t// JSON_UNESCAPED_SLASHES is only to improve readability as slashes needn't be escaped in storage.\n\t\t\t'post_content' => wp_json_encode( $data, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT ),\n\t\t);\n\t\tif ( $args['title'] ) {\n\t\t\t$post_array['post_title'] = $args['title'];\n\t\t}\n\t\tif ( $changeset_post_id ) {\n\t\t\t$post_array['ID'] = $changeset_post_id;\n\t\t} else {\n\t\t\t$post_array['post_type']   = 'customize_changeset';\n\t\t\t$post_array['post_name']   = $this->changeset_uuid();\n\t\t\t$post_array['post_status'] = 'auto-draft';\n\t\t}\n\t\tif ( $args['status'] ) {\n\t\t\t$post_array['post_status'] = $args['status'];\n\t\t}\n\n\t\t// Reset post date to now if we are publishing, otherwise pass post_date_gmt and translate for post_date.\n\t\tif ( 'publish' === $args['status'] ) {\n\t\t\t$post_array['post_date_gmt'] = '0000-00-00 00:00:00';\n\t\t\t$post_array['post_date']     = '0000-00-00 00:00:00';\n\t\t} elseif ( $args['date_gmt'] ) {\n\t\t\t$post_array['post_date_gmt'] = $args['date_gmt'];\n\t\t\t$post_array['post_date']     = get_date_from_gmt( $args['date_gmt'] );\n\t\t} elseif ( $changeset_post_id && 'auto-draft' === get_post_status( $changeset_post_id ) ) {\n\t\t\t/*\n\t\t\t * Keep bumping the date for the auto-draft whenever it is modified;\n\t\t\t * this extends its life, preserving it from garbage-collection via\n\t\t\t * wp_delete_auto_drafts().\n\t\t\t */\n\t\t\t$post_array['post_date']     = current_time( 'mysql' );\n\t\t\t$post_array['post_date_gmt'] = '';\n\t\t}\n\n\t\t$this->store_changeset_revision = $allow_revision;\n\t\tadd_filter( 'wp_save_post_revision_post_has_changed', array( $this, '_filter_revision_post_has_changed' ), 5, 3 );\n\n\t\t/*\n\t\t * Update the changeset post. The publish_customize_changeset action will cause the settings in the\n\t\t * changeset to be saved via WP_Customize_Setting::save(). Updating a post with publish status will\n\t\t * trigger WP_Customize_Manager::publish_changeset_values().\n\t\t */\n\t\tadd_filter( 'wp_insert_post_data', array( $this, 'preserve_insert_changeset_post_content' ), 5, 3 );\n\t\tif ( $changeset_post_id ) {\n\t\t\tif ( $args['autosave'] && 'auto-draft' !== get_post_status( $changeset_post_id ) ) {\n\t\t\t\t// See _wp_translate_postdata() for why this is required as it will use the edit_post meta capability.\n\t\t\t\tadd_filter( 'map_meta_cap', array( $this, 'grant_edit_post_capability_for_changeset' ), 10, 4 );\n\n\t\t\t\t$post_array['post_ID']   = $post_array['ID'];\n\t\t\t\t$post_array['post_type'] = 'customize_changeset';\n\n\t\t\t\t$r = wp_create_post_autosave( wp_slash( $post_array ) );\n\n\t\t\t\tremove_filter( 'map_meta_cap', array( $this, 'grant_edit_post_capability_for_changeset' ), 10 );\n\t\t\t} else {\n\t\t\t\t$post_array['edit_date'] = true; // Prevent date clearing.\n\n\t\t\t\t$r = wp_update_post( wp_slash( $post_array ), true );\n\n\t\t\t\t// Delete autosave revision for user when the changeset is updated.\n\t\t\t\tif ( ! empty( $args['user_id'] ) ) {\n\t\t\t\t\t$autosave_draft = wp_get_post_autosave( $changeset_post_id, $args['user_id'] );\n\t\t\t\t\tif ( $autosave_draft ) {\n\t\t\t\t\t\twp_delete_post( $autosave_draft->ID, true );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$r = wp_insert_post( wp_slash( $post_array ), true );\n\t\t\tif ( ! is_wp_error( $r ) ) {\n\t\t\t\t$this->_changeset_post_id = $r; // Update cached post ID for the loaded changeset.\n\t\t\t}\n\t\t}\n\t\tremove_filter( 'wp_insert_post_data', array( $this, 'preserve_insert_changeset_post_content' ), 5 );\n\n\t\t$this->_changeset_data = null; // Reset so WP_Customize_Manager::changeset_data() will re-populate with updated contents.\n\n\t\tremove_filter( 'wp_save_post_revision_post_has_changed', array( $this, '_filter_revision_post_has_changed' ) );\n\n\t\t$response = array(\n\t\t\t'setting_validities' => $setting_validities,\n\t\t);\n\n\t\tif ( is_wp_error( $r ) ) {\n\t\t\t$response['changeset_post_save_failure'] = $r->get_error_code();\n\t\t\treturn new WP_Error( 'changeset_post_save_failure', '', $response );\n\t\t}\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Preserve the initial JSON post_content passed to save into the post.\n\t *\n\t * This is needed to prevent KSES and other {@see 'content_save_pre'} filters\n\t * from corrupting JSON data.\n\t *\n\t * Note that WP_Customize_Manager::validate_setting_values() have already\n\t * run on the setting values being serialized as JSON into the post content\n\t * so it is pre-sanitized.\n\t *\n\t * Also, the sanitization logic is re-run through the respective\n\t * WP_Customize_Setting::sanitize() method when being read out of the\n\t * changeset, via WP_Customize_Manager::post_value(), and this sanitized\n\t * value will also be sent into WP_Customize_Setting::update() for\n\t * persisting to the DB.\n\t *\n\t * Multiple users can collaborate on a single changeset, where one user may\n\t * have the unfiltered_html capability but another may not. A user with\n\t * unfiltered_html may add a script tag to some field which needs to be kept\n\t * intact even when another user updates the changeset to modify another field\n\t * when they do not have unfiltered_html.\n\t *\n\t * @since 5.4.1\n\t *\n\t * @param array $data                An array of slashed and processed post data.\n\t * @param array $postarr             An array of sanitized (and slashed) but otherwise unmodified post data.\n\t * @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed post data as originally passed to wp_insert_post().\n\t * @return array Filtered post data.\n\t */\n\tpublic function preserve_insert_changeset_post_content( $data, $postarr, $unsanitized_postarr ) {\n\t\tif (\n\t\t\tisset( $data['post_type'] ) &&\n\t\t\tisset( $unsanitized_postarr['post_content'] ) &&\n\t\t\t'customize_changeset' === $data['post_type'] ||\n\t\t\t(\n\t\t\t\t'revision' === $data['post_type'] &&\n\t\t\t\t! empty( $data['post_parent'] ) &&\n\t\t\t\t'customize_changeset' === get_post_type( $data['post_parent'] )\n\t\t\t)\n\t\t) {\n\t\t\t$data['post_content'] = $unsanitized_postarr['post_content'];\n\t\t}\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Trash or delete a changeset post.\n\t *\n\t * The following re-formulates the logic from `wp_trash_post()` as done in\n\t * `wp_publish_post()`. The reason for bypassing `wp_trash_post()` is that it\n\t * will mutate the the `post_content` and the `post_name` when they should be\n\t * untouched.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @see wp_trash_post()\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param int|WP_Post $post The changeset post.\n\t * @return mixed A WP_Post object for the trashed post or an empty value on failure.\n\t */\n\tpublic function trash_changeset_post( $post ) {\n\t\tglobal $wpdb;\n\n\t\t$post = get_post( $post );\n\n\t\tif ( ! ( $post instanceof WP_Post ) ) {\n\t\t\treturn $post;\n\t\t}\n\t\t$post_id = $post->ID;\n\n\t\tif ( ! EMPTY_TRASH_DAYS ) {\n\t\t\treturn wp_delete_post( $post_id, true );\n\t\t}\n\n\t\tif ( 'trash' === get_post_status( $post ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/post.php */\n\t\t$check = apply_filters( 'pre_trash_post', null, $post );\n\t\tif ( null !== $check ) {\n\t\t\treturn $check;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/post.php */\n\t\tdo_action( 'wp_trash_post', $post_id );\n\n\t\tadd_post_meta( $post_id, '_wp_trash_meta_status', $post->post_status );\n\t\tadd_post_meta( $post_id, '_wp_trash_meta_time', time() );\n\n\t\t$old_status = $post->post_status;\n\t\t$new_status = 'trash';\n\t\t$wpdb->update( $wpdb->posts, array( 'post_status' => $new_status ), array( 'ID' => $post->ID ) );\n\t\tclean_post_cache( $post->ID );\n\n\t\t$post->post_status = $new_status;\n\t\twp_transition_post_status( $new_status, $old_status, $post );\n\n\t\t/** This action is documented in wp-includes/post.php */\n\t\tdo_action( \"edit_post_{$post->post_type}\", $post->ID, $post );\n\n\t\t/** This action is documented in wp-includes/post.php */\n\t\tdo_action( 'edit_post', $post->ID, $post );\n\n\t\t/** This action is documented in wp-includes/post.php */\n\t\tdo_action( \"save_post_{$post->post_type}\", $post->ID, $post, true );\n\n\t\t/** This action is documented in wp-includes/post.php */\n\t\tdo_action( 'save_post', $post->ID, $post, true );\n\n\t\t/** This action is documented in wp-includes/post.php */\n\t\tdo_action( 'wp_insert_post', $post->ID, $post, true );\n\n\t\twp_trash_post_comments( $post_id );\n\n\t\t/** This action is documented in wp-includes/post.php */\n\t\tdo_action( 'trashed_post', $post_id );\n\n\t\treturn $post;\n\t}\n\n\t/**\n\t * Handle request to trash a changeset.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic function handle_changeset_trash_request() {\n\t\tif ( ! is_user_logged_in() ) {\n\t\t\twp_send_json_error( 'unauthenticated' );\n\t\t}\n\n\t\tif ( ! $this->is_preview() ) {\n\t\t\twp_send_json_error( 'not_preview' );\n\t\t}\n\n\t\tif ( ! check_ajax_referer( 'trash_customize_changeset', 'nonce', false ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\tarray(\n\t\t\t\t\t'code'    => 'invalid_nonce',\n\t\t\t\t\t'message' => __( 'There was an authentication problem. Please reload and try again.' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$changeset_post_id = $this->changeset_post_id();\n\n\t\tif ( ! $changeset_post_id ) {\n\t\t\twp_send_json_error(\n\t\t\t\tarray(\n\t\t\t\t\t'message' => __( 'No changes saved yet, so there is nothing to trash.' ),\n\t\t\t\t\t'code'    => 'non_existent_changeset',\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $changeset_post_id ) {\n\t\t\tif ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->delete_post, $changeset_post_id ) ) {\n\t\t\t\twp_send_json_error(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'code'    => 'changeset_trash_unauthorized',\n\t\t\t\t\t\t'message' => __( 'Unable to trash changes.' ),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$lock_user = (int) wp_check_post_lock( $changeset_post_id );\n\n\t\t\tif ( $lock_user && get_current_user_id() !== $lock_user ) {\n\t\t\t\twp_send_json_error(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'code'     => 'changeset_locked',\n\t\t\t\t\t\t'message'  => __( 'Changeset is being edited by other user.' ),\n\t\t\t\t\t\t'lockUser' => $this->get_lock_user_data( $lock_user ),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( 'trash' === get_post_status( $changeset_post_id ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\tarray(\n\t\t\t\t\t'message' => __( 'Changes have already been trashed.' ),\n\t\t\t\t\t'code'    => 'changeset_already_trashed',\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t$r = $this->trash_changeset_post( $changeset_post_id );\n\t\tif ( ! ( $r instanceof WP_Post ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\tarray(\n\t\t\t\t\t'code'    => 'changeset_trash_failure',\n\t\t\t\t\t'message' => __( 'Unable to trash changes.' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\twp_send_json_success(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Changes trashed successfully.' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Re-map 'edit_post' meta cap for a customize_changeset post to be the same as 'customize' maps.\n\t *\n\t * There is essentially a \"meta meta\" cap in play here, where 'edit_post' meta cap maps to\n\t * the 'customize' meta cap which then maps to 'edit_theme_options'. This is currently\n\t * required in core for `wp_create_post_autosave()` because it will call\n\t * `_wp_translate_postdata()` which in turn will check if a user can 'edit_post', but the\n\t * the caps for the customize_changeset post type are all mapping to the meta capability.\n\t * This should be able to be removed once #40922 is addressed in core.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @link https://core.trac.wordpress.org/ticket/40922\n\t * @see WP_Customize_Manager::save_changeset_post()\n\t * @see _wp_translate_postdata()\n\t *\n\t * @param string[] $caps    Array of the user's capabilities.\n\t * @param string   $cap     Capability name.\n\t * @param int      $user_id The user ID.\n\t * @param array    $args    Adds the context to the cap. Typically the object ID.\n\t * @return array Capabilities.\n\t */\n\tpublic function grant_edit_post_capability_for_changeset( $caps, $cap, $user_id, $args ) {\n\t\tif ( 'edit_post' === $cap && ! empty( $args[0] ) && 'customize_changeset' === get_post_type( $args[0] ) ) {\n\t\t\t$post_type_obj = get_post_type_object( 'customize_changeset' );\n\t\t\t$caps          = map_meta_cap( $post_type_obj->cap->$cap, $user_id );\n\t\t}\n\t\treturn $caps;\n\t}\n\n\t/**\n\t * Marks the changeset post as being currently edited by the current user.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param int  $changeset_post_id Changeset post ID.\n\t * @param bool $take_over Whether to take over the changeset. Default false.\n\t */\n\tpublic function set_changeset_lock( $changeset_post_id, $take_over = false ) {\n\t\tif ( $changeset_post_id ) {\n\t\t\t$can_override = ! (bool) get_post_meta( $changeset_post_id, '_edit_lock', true );\n\n\t\t\tif ( $take_over ) {\n\t\t\t\t$can_override = true;\n\t\t\t}\n\n\t\t\tif ( $can_override ) {\n\t\t\t\t$lock = sprintf( '%s:%s', time(), get_current_user_id() );\n\t\t\t\tupdate_post_meta( $changeset_post_id, '_edit_lock', $lock );\n\t\t\t} else {\n\t\t\t\t$this->refresh_changeset_lock( $changeset_post_id );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Refreshes changeset lock with the current time if current user edited the changeset before.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param int $changeset_post_id Changeset post ID.\n\t */\n\tpublic function refresh_changeset_lock( $changeset_post_id ) {\n\t\tif ( ! $changeset_post_id ) {\n\t\t\treturn;\n\t\t}\n\t\t$lock = get_post_meta( $changeset_post_id, '_edit_lock', true );\n\t\t$lock = explode( ':', $lock );\n\n\t\tif ( $lock && ! empty( $lock[1] ) ) {\n\t\t\t$user_id         = intval( $lock[1] );\n\t\t\t$current_user_id = get_current_user_id();\n\t\t\tif ( $user_id === $current_user_id ) {\n\t\t\t\t$lock = sprintf( '%s:%s', time(), $user_id );\n\t\t\t\tupdate_post_meta( $changeset_post_id, '_edit_lock', $lock );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filter heartbeat settings for the Customizer.\n\t *\n\t * @since 4.9.0\n\t * @param array $settings Current settings to filter.\n\t * @return array Heartbeat settings.\n\t */\n\tpublic function add_customize_screen_to_heartbeat_settings( $settings ) {\n\t\tglobal $pagenow;\n\t\tif ( 'customize.php' === $pagenow ) {\n\t\t\t$settings['screenId'] = 'customize';\n\t\t}\n\t\treturn $settings;\n\t}\n\n\t/**\n\t * Get lock user data.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param int $user_id User ID.\n\t * @return array|null User data formatted for client.\n\t */\n\tprotected function get_lock_user_data( $user_id ) {\n\t\tif ( ! $user_id ) {\n\t\t\treturn null;\n\t\t}\n\t\t$lock_user = get_userdata( $user_id );\n\t\tif ( ! $lock_user ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn array(\n\t\t\t'id'     => $lock_user->ID,\n\t\t\t'name'   => $lock_user->display_name,\n\t\t\t'avatar' => get_avatar_url( $lock_user->ID, array( 'size' => 128 ) ),\n\t\t);\n\t}\n\n\t/**\n\t * Check locked changeset with heartbeat API.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param array  $response  The Heartbeat response.\n\t * @param array  $data      The $_POST data sent.\n\t * @param string $screen_id The screen id.\n\t * @return array The Heartbeat response.\n\t */\n\tpublic function check_changeset_lock_with_heartbeat( $response, $data, $screen_id ) {\n\t\tif ( isset( $data['changeset_uuid'] ) ) {\n\t\t\t$changeset_post_id = $this->find_changeset_post_id( $data['changeset_uuid'] );\n\t\t} else {\n\t\t\t$changeset_post_id = $this->changeset_post_id();\n\t\t}\n\n\t\tif (\n\t\t\tarray_key_exists( 'check_changeset_lock', $data )\n\t\t\t&& 'customize' === $screen_id\n\t\t\t&& $changeset_post_id\n\t\t\t&& current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $changeset_post_id )\n\t\t) {\n\t\t\t$lock_user_id = wp_check_post_lock( $changeset_post_id );\n\n\t\t\tif ( $lock_user_id ) {\n\t\t\t\t$response['customize_changeset_lock_user'] = $this->get_lock_user_data( $lock_user_id );\n\t\t\t} else {\n\n\t\t\t\t// Refreshing time will ensure that the user is sitting on customizer and has not closed the customizer tab.\n\t\t\t\t$this->refresh_changeset_lock( $changeset_post_id );\n\t\t\t}\n\t\t}\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Removes changeset lock when take over request is sent via Ajax.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic function handle_override_changeset_lock_request() {\n\t\tif ( ! $this->is_preview() ) {\n\t\t\twp_send_json_error( 'not_preview', 400 );\n\t\t}\n\n\t\tif ( ! check_ajax_referer( 'customize_override_changeset_lock', 'nonce', false ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\tarray(\n\t\t\t\t\t'code'    => 'invalid_nonce',\n\t\t\t\t\t'message' => __( 'Security check failed.' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$changeset_post_id = $this->changeset_post_id();\n\n\t\tif ( empty( $changeset_post_id ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\tarray(\n\t\t\t\t\t'code'    => 'no_changeset_found_to_take_over',\n\t\t\t\t\t'message' => __( 'No changeset found to take over' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $changeset_post_id ) ) {\n\t\t\twp_send_json_error(\n\t\t\t\tarray(\n\t\t\t\t\t'code'    => 'cannot_remove_changeset_lock',\n\t\t\t\t\t'message' => __( 'Sorry, you are not allowed to take over.' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$this->set_changeset_lock( $changeset_post_id, true );\n\n\t\twp_send_json_success( 'changeset_taken_over' );\n\t}\n\n\t/**\n\t * Whether a changeset revision should be made.\n\t *\n\t * @since 4.7.0\n\t * @var bool\n\t */\n\tprotected $store_changeset_revision;\n\n\t/**\n\t * Filters whether a changeset has changed to create a new revision.\n\t *\n\t * Note that this will not be called while a changeset post remains in auto-draft status.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param bool    $post_has_changed Whether the post has changed.\n\t * @param WP_Post $last_revision    The last revision post object.\n\t * @param WP_Post $post             The post object.\n\t * @return bool Whether a revision should be made.\n\t */\n\tpublic function _filter_revision_post_has_changed( $post_has_changed, $last_revision, $post ) {\n\t\tunset( $last_revision );\n\t\tif ( 'customize_changeset' === $post->post_type ) {\n\t\t\t$post_has_changed = $this->store_changeset_revision;\n\t\t}\n\t\treturn $post_has_changed;\n\t}\n\n\t/**\n\t * Publish changeset values.\n\t *\n\t * This will the values contained in a changeset, even changesets that do not\n\t * correspond to current manager instance. This is called by\n\t * `_wp_customize_publish_changeset()` when a customize_changeset post is\n\t * transitioned to the `publish` status. As such, this method should not be\n\t * called directly and instead `wp_publish_post()` should be used.\n\t *\n\t * Please note that if the settings in the changeset are for a non-activated\n\t * theme, the theme must first be switched to (via `switch_theme()`) before\n\t * invoking this method.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see _wp_customize_publish_changeset()\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param int $changeset_post_id ID for customize_changeset post. Defaults to the changeset for the current manager instance.\n\t * @return true|WP_Error True or error info.\n\t */\n\tpublic function _publish_changeset_values( $changeset_post_id ) {\n\t\tglobal $wpdb;\n\n\t\t$publishing_changeset_data = $this->get_changeset_post_data( $changeset_post_id );\n\t\tif ( is_wp_error( $publishing_changeset_data ) ) {\n\t\t\treturn $publishing_changeset_data;\n\t\t}\n\n\t\t$changeset_post = get_post( $changeset_post_id );\n\n\t\t/*\n\t\t * Temporarily override the changeset context so that it will be read\n\t\t * in calls to unsanitized_post_values() and so that it will be available\n\t\t * on the $wp_customize object passed to hooks during the save logic.\n\t\t */\n\t\t$previous_changeset_post_id = $this->_changeset_post_id;\n\t\t$this->_changeset_post_id   = $changeset_post_id;\n\t\t$previous_changeset_uuid    = $this->_changeset_uuid;\n\t\t$this->_changeset_uuid      = $changeset_post->post_name;\n\t\t$previous_changeset_data    = $this->_changeset_data;\n\t\t$this->_changeset_data      = $publishing_changeset_data;\n\n\t\t// Parse changeset data to identify theme mod settings and user IDs associated with settings to be saved.\n\t\t$setting_user_ids   = array();\n\t\t$theme_mod_settings = array();\n\t\t$namespace_pattern  = '/^(?P<stylesheet>.+?)::(?P<setting_id>.+)$/';\n\t\t$matches            = array();\n\t\tforeach ( $this->_changeset_data as $raw_setting_id => $setting_params ) {\n\t\t\t$actual_setting_id    = null;\n\t\t\t$is_theme_mod_setting = (\n\t\t\t\tisset( $setting_params['value'] )\n\t\t\t\t&&\n\t\t\t\tisset( $setting_params['type'] )\n\t\t\t\t&&\n\t\t\t\t'theme_mod' === $setting_params['type']\n\t\t\t\t&&\n\t\t\t\tpreg_match( $namespace_pattern, $raw_setting_id, $matches )\n\t\t\t);\n\t\t\tif ( $is_theme_mod_setting ) {\n\t\t\t\tif ( ! isset( $theme_mod_settings[ $matches['stylesheet'] ] ) ) {\n\t\t\t\t\t$theme_mod_settings[ $matches['stylesheet'] ] = array();\n\t\t\t\t}\n\t\t\t\t$theme_mod_settings[ $matches['stylesheet'] ][ $matches['setting_id'] ] = $setting_params;\n\n\t\t\t\tif ( $this->get_stylesheet() === $matches['stylesheet'] ) {\n\t\t\t\t\t$actual_setting_id = $matches['setting_id'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$actual_setting_id = $raw_setting_id;\n\t\t\t}\n\n\t\t\t// Keep track of the user IDs for settings actually for this theme.\n\t\t\tif ( $actual_setting_id && isset( $setting_params['user_id'] ) ) {\n\t\t\t\t$setting_user_ids[ $actual_setting_id ] = $setting_params['user_id'];\n\t\t\t}\n\t\t}\n\n\t\t$changeset_setting_values = $this->unsanitized_post_values(\n\t\t\tarray(\n\t\t\t\t'exclude_post_data' => true,\n\t\t\t\t'exclude_changeset' => false,\n\t\t\t)\n\t\t);\n\t\t$changeset_setting_ids    = array_keys( $changeset_setting_values );\n\t\t$this->add_dynamic_settings( $changeset_setting_ids );\n\n\t\t/**\n\t\t * Fires once the theme has switched in the Customizer, but before settings\n\t\t * have been saved.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param WP_Customize_Manager $manager WP_Customize_Manager instance.\n\t\t */\n\t\tdo_action( 'customize_save', $this );\n\n\t\t/*\n\t\t * Ensure that all settings will allow themselves to be saved. Note that\n\t\t * this is safe because the setting would have checked the capability\n\t\t * when the setting value was written into the changeset. So this is why\n\t\t * an additional capability check is not required here.\n\t\t */\n\t\t$original_setting_capabilities = array();\n\t\tforeach ( $changeset_setting_ids as $setting_id ) {\n\t\t\t$setting = $this->get_setting( $setting_id );\n\t\t\tif ( $setting && ! isset( $setting_user_ids[ $setting_id ] ) ) {\n\t\t\t\t$original_setting_capabilities[ $setting->id ] = $setting->capability;\n\t\t\t\t$setting->capability                           = 'exist';\n\t\t\t}\n\t\t}\n\n\t\t$original_user_id = get_current_user_id();\n\t\tforeach ( $changeset_setting_ids as $setting_id ) {\n\t\t\t$setting = $this->get_setting( $setting_id );\n\t\t\tif ( $setting ) {\n\t\t\t\t/*\n\t\t\t\t * Set the current user to match the user who saved the value into\n\t\t\t\t * the changeset so that any filters that apply during the save\n\t\t\t\t * process will respect the original user's capabilities. This\n\t\t\t\t * will ensure, for example, that KSES won't strip unsafe HTML\n\t\t\t\t * when a scheduled changeset publishes via WP Cron.\n\t\t\t\t */\n\t\t\t\tif ( isset( $setting_user_ids[ $setting_id ] ) ) {\n\t\t\t\t\twp_set_current_user( $setting_user_ids[ $setting_id ] );\n\t\t\t\t} else {\n\t\t\t\t\twp_set_current_user( $original_user_id );\n\t\t\t\t}\n\n\t\t\t\t$setting->save();\n\t\t\t}\n\t\t}\n\t\twp_set_current_user( $original_user_id );\n\n\t\t// Update the stashed theme mod settings, removing the active theme's stashed settings, if activated.\n\t\tif ( did_action( 'switch_theme' ) ) {\n\t\t\t$other_theme_mod_settings = $theme_mod_settings;\n\t\t\tunset( $other_theme_mod_settings[ $this->get_stylesheet() ] );\n\t\t\t$this->update_stashed_theme_mod_settings( $other_theme_mod_settings );\n\t\t}\n\n\t\t/**\n\t\t * Fires after Customize settings have been saved.\n\t\t *\n\t\t * @since 3.6.0\n\t\t *\n\t\t * @param WP_Customize_Manager $manager WP_Customize_Manager instance.\n\t\t */\n\t\tdo_action( 'customize_save_after', $this );\n\n\t\t// Restore original capabilities.\n\t\tforeach ( $original_setting_capabilities as $setting_id => $capability ) {\n\t\t\t$setting = $this->get_setting( $setting_id );\n\t\t\tif ( $setting ) {\n\t\t\t\t$setting->capability = $capability;\n\t\t\t}\n\t\t}\n\n\t\t// Restore original changeset data.\n\t\t$this->_changeset_data    = $previous_changeset_data;\n\t\t$this->_changeset_post_id = $previous_changeset_post_id;\n\t\t$this->_changeset_uuid    = $previous_changeset_uuid;\n\n\t\t/*\n\t\t * Convert all autosave revisions into their own auto-drafts so that users can be prompted to\n\t\t * restore them when a changeset is published, but they had been locked out from including\n\t\t * their changes in the changeset.\n\t\t */\n\t\t$revisions = wp_get_post_revisions( $changeset_post_id, array( 'check_enabled' => false ) );\n\t\tforeach ( $revisions as $revision ) {\n\t\t\tif ( false !== strpos( $revision->post_name, \"{$changeset_post_id}-autosave\" ) ) {\n\t\t\t\t$wpdb->update(\n\t\t\t\t\t$wpdb->posts,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_status' => 'auto-draft',\n\t\t\t\t\t\t'post_type'   => 'customize_changeset',\n\t\t\t\t\t\t'post_name'   => wp_generate_uuid4(),\n\t\t\t\t\t\t'post_parent' => 0,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'ID' => $revision->ID,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tclean_post_cache( $revision->ID );\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Update stashed theme mod settings.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $inactive_theme_mod_settings Mapping of stylesheet to arrays of theme mod settings.\n\t * @return array|false Returns array of updated stashed theme mods or false if the update failed or there were no changes.\n\t */\n\tprotected function update_stashed_theme_mod_settings( $inactive_theme_mod_settings ) {\n\t\t$stashed_theme_mod_settings = get_option( 'customize_stashed_theme_mods' );\n\t\tif ( empty( $stashed_theme_mod_settings ) ) {\n\t\t\t$stashed_theme_mod_settings = array();\n\t\t}\n\n\t\t// Delete any stashed theme mods for the active theme since they would have been loaded and saved upon activation.\n\t\tunset( $stashed_theme_mod_settings[ $this->get_stylesheet() ] );\n\n\t\t// Merge inactive theme mods with the stashed theme mod settings.\n\t\tforeach ( $inactive_theme_mod_settings as $stylesheet => $theme_mod_settings ) {\n\t\t\tif ( ! isset( $stashed_theme_mod_settings[ $stylesheet ] ) ) {\n\t\t\t\t$stashed_theme_mod_settings[ $stylesheet ] = array();\n\t\t\t}\n\n\t\t\t$stashed_theme_mod_settings[ $stylesheet ] = array_merge(\n\t\t\t\t$stashed_theme_mod_settings[ $stylesheet ],\n\t\t\t\t$theme_mod_settings\n\t\t\t);\n\t\t}\n\n\t\t$autoload = false;\n\t\t$result   = update_option( 'customize_stashed_theme_mods', $stashed_theme_mod_settings, $autoload );\n\t\tif ( ! $result ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $stashed_theme_mod_settings;\n\t}\n\n\t/**\n\t * Refresh nonces for the current preview.\n\t *\n\t * @since 4.2.0\n\t */\n\tpublic function refresh_nonces() {\n\t\tif ( ! $this->is_preview() ) {\n\t\t\twp_send_json_error( 'not_preview' );\n\t\t}\n\n\t\twp_send_json_success( $this->get_nonces() );\n\t}\n\n\t/**\n\t * Delete a given auto-draft changeset or the autosave revision for a given changeset or delete changeset lock.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic function handle_dismiss_autosave_or_lock_request() {\n\t\t// Calls to dismiss_user_auto_draft_changesets() and wp_get_post_autosave() require non-zero get_current_user_id().\n\t\tif ( ! is_user_logged_in() ) {\n\t\t\twp_send_json_error( 'unauthenticated', 401 );\n\t\t}\n\n\t\tif ( ! $this->is_preview() ) {\n\t\t\twp_send_json_error( 'not_preview', 400 );\n\t\t}\n\n\t\tif ( ! check_ajax_referer( 'customize_dismiss_autosave_or_lock', 'nonce', false ) ) {\n\t\t\twp_send_json_error( 'invalid_nonce', 403 );\n\t\t}\n\n\t\t$changeset_post_id = $this->changeset_post_id();\n\t\t$dismiss_lock      = ! empty( $_POST['dismiss_lock'] );\n\t\t$dismiss_autosave  = ! empty( $_POST['dismiss_autosave'] );\n\n\t\tif ( $dismiss_lock ) {\n\t\t\tif ( empty( $changeset_post_id ) && ! $dismiss_autosave ) {\n\t\t\t\twp_send_json_error( 'no_changeset_to_dismiss_lock', 404 );\n\t\t\t}\n\t\t\tif ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $changeset_post_id ) && ! $dismiss_autosave ) {\n\t\t\t\twp_send_json_error( 'cannot_remove_changeset_lock', 403 );\n\t\t\t}\n\n\t\t\tdelete_post_meta( $changeset_post_id, '_edit_lock' );\n\n\t\t\tif ( ! $dismiss_autosave ) {\n\t\t\t\twp_send_json_success( 'changeset_lock_dismissed' );\n\t\t\t}\n\t\t}\n\n\t\tif ( $dismiss_autosave ) {\n\t\t\tif ( empty( $changeset_post_id ) || 'auto-draft' === get_post_status( $changeset_post_id ) ) {\n\t\t\t\t$dismissed = $this->dismiss_user_auto_draft_changesets();\n\t\t\t\tif ( $dismissed > 0 ) {\n\t\t\t\t\twp_send_json_success( 'auto_draft_dismissed' );\n\t\t\t\t} else {\n\t\t\t\t\twp_send_json_error( 'no_auto_draft_to_delete', 404 );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$revision = wp_get_post_autosave( $changeset_post_id, get_current_user_id() );\n\n\t\t\t\tif ( $revision ) {\n\t\t\t\t\tif ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->delete_post, $changeset_post_id ) ) {\n\t\t\t\t\t\twp_send_json_error( 'cannot_delete_autosave_revision', 403 );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! wp_delete_post( $revision->ID, true ) ) {\n\t\t\t\t\t\twp_send_json_error( 'autosave_revision_deletion_failure', 500 );\n\t\t\t\t\t} else {\n\t\t\t\t\t\twp_send_json_success( 'autosave_revision_deleted' );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twp_send_json_error( 'no_autosave_revision_to_delete', 404 );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twp_send_json_error( 'unknown_error', 500 );\n\t}\n\n\t/**\n\t * Add a customize setting.\n\t *\n\t * @since 3.4.0\n\t * @since 4.5.0 Return added WP_Customize_Setting instance.\n\t *\n\t * @see WP_Customize_Setting::__construct()\n\t * @link https://developer.wordpress.org/themes/customize-api\n\t *\n\t * @param WP_Customize_Setting|string $id   Customize Setting object, or ID.\n\t * @param array                       $args Optional. Array of properties for the new Setting object.\n\t *                                          See WP_Customize_Setting::__construct() for information\n\t *                                          on accepted arguments. Default empty array.\n\t * @return WP_Customize_Setting The instance of the setting that was added.\n\t */\n\tpublic function add_setting( $id, $args = array() ) {\n\t\tif ( $id instanceof WP_Customize_Setting ) {\n\t\t\t$setting = $id;\n\t\t} else {\n\t\t\t$class = 'WP_Customize_Setting';\n\n\t\t\t/** This filter is documented in wp-includes/class-wp-customize-manager.php */\n\t\t\t$args = apply_filters( 'customize_dynamic_setting_args', $args, $id );\n\n\t\t\t/** This filter is documented in wp-includes/class-wp-customize-manager.php */\n\t\t\t$class = apply_filters( 'customize_dynamic_setting_class', $class, $id, $args );\n\n\t\t\t$setting = new $class( $this, $id, $args );\n\t\t}\n\n\t\t$this->settings[ $setting->id ] = $setting;\n\t\treturn $setting;\n\t}\n\n\t/**\n\t * Register any dynamically-created settings, such as those from $_POST['customized']\n\t * that have no corresponding setting created.\n\t *\n\t * This is a mechanism to \"wake up\" settings that have been dynamically created\n\t * on the front end and have been sent to WordPress in `$_POST['customized']`. When WP\n\t * loads, the dynamically-created settings then will get created and previewed\n\t * even though they are not directly created statically with code.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param array $setting_ids The setting IDs to add.\n\t * @return array The WP_Customize_Setting objects added.\n\t */\n\tpublic function add_dynamic_settings( $setting_ids ) {\n\t\t$new_settings = array();\n\t\tforeach ( $setting_ids as $setting_id ) {\n\t\t\t// Skip settings already created.\n\t\t\tif ( $this->get_setting( $setting_id ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$setting_args  = false;\n\t\t\t$setting_class = 'WP_Customize_Setting';\n\n\t\t\t/**\n\t\t\t * Filters a dynamic setting's constructor args.\n\t\t\t *\n\t\t\t * For a dynamic setting to be registered, this filter must be employed\n\t\t\t * to override the default false value with an array of args to pass to\n\t\t\t * the WP_Customize_Setting constructor.\n\t\t\t *\n\t\t\t * @since 4.2.0\n\t\t\t *\n\t\t\t * @param false|array $setting_args The arguments to the WP_Customize_Setting constructor.\n\t\t\t * @param string      $setting_id   ID for dynamic setting, usually coming from `$_POST['customized']`.\n\t\t\t */\n\t\t\t$setting_args = apply_filters( 'customize_dynamic_setting_args', $setting_args, $setting_id );\n\t\t\tif ( false === $setting_args ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Allow non-statically created settings to be constructed with custom WP_Customize_Setting subclass.\n\t\t\t *\n\t\t\t * @since 4.2.0\n\t\t\t *\n\t\t\t * @param string $setting_class WP_Customize_Setting or a subclass.\n\t\t\t * @param string $setting_id    ID for dynamic setting, usually coming from `$_POST['customized']`.\n\t\t\t * @param array  $setting_args  WP_Customize_Setting or a subclass.\n\t\t\t */\n\t\t\t$setting_class = apply_filters( 'customize_dynamic_setting_class', $setting_class, $setting_id, $setting_args );\n\n\t\t\t$setting = new $setting_class( $this, $setting_id, $setting_args );\n\n\t\t\t$this->add_setting( $setting );\n\t\t\t$new_settings[] = $setting;\n\t\t}\n\t\treturn $new_settings;\n\t}\n\n\t/**\n\t * Retrieve a customize setting.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $id Customize Setting ID.\n\t * @return WP_Customize_Setting|void The setting, if set.\n\t */\n\tpublic function get_setting( $id ) {\n\t\tif ( isset( $this->settings[ $id ] ) ) {\n\t\t\treturn $this->settings[ $id ];\n\t\t}\n\t}\n\n\t/**\n\t * Remove a customize setting.\n\t *\n\t * Note that removing the setting doesn't destroy the WP_Customize_Setting instance or remove its filters.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $id Customize Setting ID.\n\t */\n\tpublic function remove_setting( $id ) {\n\t\tunset( $this->settings[ $id ] );\n\t}\n\n\t/**\n\t * Add a customize panel.\n\t *\n\t * @since 4.0.0\n\t * @since 4.5.0 Return added WP_Customize_Panel instance.\n\t *\n\t * @see WP_Customize_Panel::__construct()\n\t *\n\t * @param WP_Customize_Panel|string $id   Customize Panel object, or ID.\n\t * @param array                     $args Optional. Array of properties for the new Panel object.\n\t *                                        See WP_Customize_Panel::__construct() for information\n\t *                                        on accepted arguments. Default empty array.\n\t * @return WP_Customize_Panel The instance of the panel that was added.\n\t */\n\tpublic function add_panel( $id, $args = array() ) {\n\t\tif ( $id instanceof WP_Customize_Panel ) {\n\t\t\t$panel = $id;\n\t\t} else {\n\t\t\t$panel = new WP_Customize_Panel( $this, $id, $args );\n\t\t}\n\n\t\t$this->panels[ $panel->id ] = $panel;\n\t\treturn $panel;\n\t}\n\n\t/**\n\t * Retrieve a customize panel.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $id Panel ID to get.\n\t * @return WP_Customize_Panel|void Requested panel instance, if set.\n\t */\n\tpublic function get_panel( $id ) {\n\t\tif ( isset( $this->panels[ $id ] ) ) {\n\t\t\treturn $this->panels[ $id ];\n\t\t}\n\t}\n\n\t/**\n\t * Remove a customize panel.\n\t *\n\t * Note that removing the panel doesn't destroy the WP_Customize_Panel instance or remove its filters.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $id Panel ID to remove.\n\t */\n\tpublic function remove_panel( $id ) {\n\t\t// Removing core components this way is _doing_it_wrong().\n\t\tif ( in_array( $id, $this->components, true ) ) {\n\t\t\t$message = sprintf(\n\t\t\t\t/* translators: 1: Panel ID, 2: Link to 'customize_loaded_components' filter reference. */\n\t\t\t\t__( 'Removing %1$s manually will cause PHP warnings. Use the %2$s filter instead.' ),\n\t\t\t\t$id,\n\t\t\t\tsprintf(\n\t\t\t\t\t'<a href=\"%1$s\">%2$s</a>',\n\t\t\t\t\tesc_url( 'https://developer.wordpress.org/reference/hooks/customize_loaded_components/' ),\n\t\t\t\t\t'<code>customize_loaded_components</code>'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t_doing_it_wrong( __METHOD__, $message, '4.5.0' );\n\t\t}\n\t\tunset( $this->panels[ $id ] );\n\t}\n\n\t/**\n\t * Register a customize panel type.\n\t *\n\t * Registered types are eligible to be rendered via JS and created dynamically.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see WP_Customize_Panel\n\t *\n\t * @param string $panel Name of a custom panel which is a subclass of WP_Customize_Panel.\n\t */\n\tpublic function register_panel_type( $panel ) {\n\t\t$this->registered_panel_types[] = $panel;\n\t}\n\n\t/**\n\t * Render JS templates for all registered panel types.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function render_panel_templates() {\n\t\tforeach ( $this->registered_panel_types as $panel_type ) {\n\t\t\t$panel = new $panel_type( $this, 'temp', array() );\n\t\t\t$panel->print_template();\n\t\t}\n\t}\n\n\t/**\n\t * Add a customize section.\n\t *\n\t * @since 3.4.0\n\t * @since 4.5.0 Return added WP_Customize_Section instance.\n\t *\n\t * @see WP_Customize_Section::__construct()\n\t *\n\t * @param WP_Customize_Section|string $id   Customize Section object, or ID.\n\t * @param array                       $args Optional. Array of properties for the new Section object.\n\t *                                          See WP_Customize_Section::__construct() for information\n\t *                                          on accepted arguments. Default empty array.\n\t * @return WP_Customize_Section The instance of the section that was added.\n\t */\n\tpublic function add_section( $id, $args = array() ) {\n\t\tif ( $id instanceof WP_Customize_Section ) {\n\t\t\t$section = $id;\n\t\t} else {\n\t\t\t$section = new WP_Customize_Section( $this, $id, $args );\n\t\t}\n\n\t\t$this->sections[ $section->id ] = $section;\n\t\treturn $section;\n\t}\n\n\t/**\n\t * Retrieve a customize section.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $id Section ID.\n\t * @return WP_Customize_Section|void The section, if set.\n\t */\n\tpublic function get_section( $id ) {\n\t\tif ( isset( $this->sections[ $id ] ) ) {\n\t\t\treturn $this->sections[ $id ];\n\t\t}\n\t}\n\n\t/**\n\t * Remove a customize section.\n\t *\n\t * Note that removing the section doesn't destroy the WP_Customize_Section instance or remove its filters.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $id Section ID.\n\t */\n\tpublic function remove_section( $id ) {\n\t\tunset( $this->sections[ $id ] );\n\t}\n\n\t/**\n\t * Register a customize section type.\n\t *\n\t * Registered types are eligible to be rendered via JS and created dynamically.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see WP_Customize_Section\n\t *\n\t * @param string $section Name of a custom section which is a subclass of WP_Customize_Section.\n\t */\n\tpublic function register_section_type( $section ) {\n\t\t$this->registered_section_types[] = $section;\n\t}\n\n\t/**\n\t * Render JS templates for all registered section types.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function render_section_templates() {\n\t\tforeach ( $this->registered_section_types as $section_type ) {\n\t\t\t$section = new $section_type( $this, 'temp', array() );\n\t\t\t$section->print_template();\n\t\t}\n\t}\n\n\t/**\n\t * Add a customize control.\n\t *\n\t * @since 3.4.0\n\t * @since 4.5.0 Return added WP_Customize_Control instance.\n\t *\n\t * @see WP_Customize_Control::__construct()\n\t *\n\t * @param WP_Customize_Control|string $id   Customize Control object, or ID.\n\t * @param array                       $args Optional. Array of properties for the new Control object.\n\t *                                          See WP_Customize_Control::__construct() for information\n\t *                                          on accepted arguments. Default empty array.\n\t * @return WP_Customize_Control The instance of the control that was added.\n\t */\n\tpublic function add_control( $id, $args = array() ) {\n\t\tif ( $id instanceof WP_Customize_Control ) {\n\t\t\t$control = $id;\n\t\t} else {\n\t\t\t$control = new WP_Customize_Control( $this, $id, $args );\n\t\t}\n\n\t\t$this->controls[ $control->id ] = $control;\n\t\treturn $control;\n\t}\n\n\t/**\n\t * Retrieve a customize control.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $id ID of the control.\n\t * @return WP_Customize_Control|void The control object, if set.\n\t */\n\tpublic function get_control( $id ) {\n\t\tif ( isset( $this->controls[ $id ] ) ) {\n\t\t\treturn $this->controls[ $id ];\n\t\t}\n\t}\n\n\t/**\n\t * Remove a customize control.\n\t *\n\t * Note that removing the control doesn't destroy the WP_Customize_Control instance or remove its filters.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $id ID of the control.\n\t */\n\tpublic function remove_control( $id ) {\n\t\tunset( $this->controls[ $id ] );\n\t}\n\n\t/**\n\t * Register a customize control type.\n\t *\n\t * Registered types are eligible to be rendered via JS and created dynamically.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param string $control Name of a custom control which is a subclass of\n\t *                        WP_Customize_Control.\n\t */\n\tpublic function register_control_type( $control ) {\n\t\t$this->registered_control_types[] = $control;\n\t}\n\n\t/**\n\t * Render JS templates for all registered control types.\n\t *\n\t * @since 4.1.0\n\t */\n\tpublic function render_control_templates() {\n\t\tif ( $this->branching() ) {\n\t\t\t$l10n = array(\n\t\t\t\t/* translators: %s: User who is customizing the changeset in customizer. */\n\t\t\t\t'locked'                => __( '%s is already customizing this changeset. Please wait until they are done to try customizing. Your latest changes have been autosaved.' ),\n\t\t\t\t/* translators: %s: User who is customizing the changeset in customizer. */\n\t\t\t\t'locked_allow_override' => __( '%s is already customizing this changeset. Do you want to take over?' ),\n\t\t\t);\n\t\t} else {\n\t\t\t$l10n = array(\n\t\t\t\t/* translators: %s: User who is customizing the changeset in customizer. */\n\t\t\t\t'locked'                => __( '%s is already customizing this site. Please wait until they are done to try customizing. Your latest changes have been autosaved.' ),\n\t\t\t\t/* translators: %s: User who is customizing the changeset in customizer. */\n\t\t\t\t'locked_allow_override' => __( '%s is already customizing this site. Do you want to take over?' ),\n\t\t\t);\n\t\t}\n\n\t\tforeach ( $this->registered_control_types as $control_type ) {\n\t\t\t$control = new $control_type(\n\t\t\t\t$this,\n\t\t\t\t'temp',\n\t\t\t\tarray(\n\t\t\t\t\t'settings' => array(),\n\t\t\t\t)\n\t\t\t);\n\t\t\t$control->print_template();\n\t\t}\n\t\t?>\n\n\t\t<script type=\"text/html\" id=\"tmpl-customize-control-default-content\">\n\t\t\t<#\n\t\t\tvar inputId = _.uniqueId( 'customize-control-default-input-' );\n\t\t\tvar descriptionId = _.uniqueId( 'customize-control-default-description-' );\n\t\t\tvar describedByAttr = data.description ? ' aria-describedby=\"' + descriptionId + '\" ' : '';\n\t\t\t#>\n\t\t\t<# switch ( data.type ) {\n\t\t\t\tcase 'checkbox': #>\n\t\t\t\t\t<span class=\"customize-inside-control-row\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tid=\"{{ inputId }}\"\n\t\t\t\t\t\t\t{{{ describedByAttr }}}\n\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\tvalue=\"{{ data.value }}\"\n\t\t\t\t\t\t\tdata-customize-setting-key-link=\"default\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t<label for=\"{{ inputId }}\">\n\t\t\t\t\t\t\t{{ data.label }}\n\t\t\t\t\t\t</label>\n\t\t\t\t\t\t<# if ( data.description ) { #>\n\t\t\t\t\t\t\t<span id=\"{{ descriptionId }}\" class=\"description customize-control-description\">{{{ data.description }}}</span>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t</span>\n\t\t\t\t\t<#\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'radio':\n\t\t\t\t\tif ( ! data.choices ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t#>\n\t\t\t\t\t<# if ( data.label ) { #>\n\t\t\t\t\t\t<label for=\"{{ inputId }}\" class=\"customize-control-title\">\n\t\t\t\t\t\t\t{{ data.label }}\n\t\t\t\t\t\t</label>\n\t\t\t\t\t<# } #>\n\t\t\t\t\t<# if ( data.description ) { #>\n\t\t\t\t\t\t<span id=\"{{ descriptionId }}\" class=\"description customize-control-description\">{{{ data.description }}}</span>\n\t\t\t\t\t<# } #>\n\t\t\t\t\t<# _.each( data.choices, function( val, key ) { #>\n\t\t\t\t\t\t<span class=\"customize-inside-control-row\">\n\t\t\t\t\t\t\t<#\n\t\t\t\t\t\t\tvar value, text;\n\t\t\t\t\t\t\tif ( _.isObject( val ) ) {\n\t\t\t\t\t\t\t\tvalue = val.value;\n\t\t\t\t\t\t\t\ttext = val.text;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvalue = key;\n\t\t\t\t\t\t\t\ttext = val;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t#>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tid=\"{{ inputId + '-' + value }}\"\n\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\tvalue=\"{{ value }}\"\n\t\t\t\t\t\t\t\tname=\"{{ inputId }}\"\n\t\t\t\t\t\t\t\tdata-customize-setting-key-link=\"default\"\n\t\t\t\t\t\t\t\t{{{ describedByAttr }}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<label for=\"{{ inputId + '-' + value }}\">{{ text }}</label>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t<# } ); #>\n\t\t\t\t\t<#\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t#>\n\t\t\t\t\t<# if ( data.label ) { #>\n\t\t\t\t\t\t<label for=\"{{ inputId }}\" class=\"customize-control-title\">\n\t\t\t\t\t\t\t{{ data.label }}\n\t\t\t\t\t\t</label>\n\t\t\t\t\t<# } #>\n\t\t\t\t\t<# if ( data.description ) { #>\n\t\t\t\t\t\t<span id=\"{{ descriptionId }}\" class=\"description customize-control-description\">{{{ data.description }}}</span>\n\t\t\t\t\t<# } #>\n\n\t\t\t\t\t<#\n\t\t\t\t\tvar inputAttrs = {\n\t\t\t\t\t\tid: inputId,\n\t\t\t\t\t\t'data-customize-setting-key-link': 'default'\n\t\t\t\t\t};\n\t\t\t\t\tif ( 'textarea' === data.type ) {\n\t\t\t\t\t\tinputAttrs.rows = '5';\n\t\t\t\t\t} else if ( 'button' === data.type ) {\n\t\t\t\t\t\tinputAttrs['class'] = 'button button-secondary';\n\t\t\t\t\t\tinputAttrs.type = 'button';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinputAttrs.type = data.type;\n\t\t\t\t\t}\n\t\t\t\t\tif ( data.description ) {\n\t\t\t\t\t\tinputAttrs['aria-describedby'] = descriptionId;\n\t\t\t\t\t}\n\t\t\t\t\t_.extend( inputAttrs, data.input_attrs );\n\t\t\t\t\t#>\n\n\t\t\t\t\t<# if ( 'button' === data.type ) { #>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t<# _.each( _.extend( inputAttrs ), function( value, key ) { #>\n\t\t\t\t\t\t\t\t{{{ key }}}=\"{{ value }}\"\n\t\t\t\t\t\t\t<# } ); #>\n\t\t\t\t\t\t>{{ inputAttrs.value }}</button>\n\t\t\t\t\t<# } else if ( 'textarea' === data.type ) { #>\n\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t<# _.each( _.extend( inputAttrs ), function( value, key ) { #>\n\t\t\t\t\t\t\t\t{{{ key }}}=\"{{ value }}\"\n\t\t\t\t\t\t\t<# }); #>\n\t\t\t\t\t\t>{{ inputAttrs.value }}</textarea>\n\t\t\t\t\t<# } else if ( 'select' === data.type ) { #>\n\t\t\t\t\t\t<# delete inputAttrs.type; #>\n\t\t\t\t\t\t<select\n\t\t\t\t\t\t\t<# _.each( _.extend( inputAttrs ), function( value, key ) { #>\n\t\t\t\t\t\t\t\t{{{ key }}}=\"{{ value }}\"\n\t\t\t\t\t\t\t<# }); #>\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<# _.each( data.choices, function( val, key ) { #>\n\t\t\t\t\t\t\t\t<#\n\t\t\t\t\t\t\t\tvar value, text;\n\t\t\t\t\t\t\t\tif ( _.isObject( val ) ) {\n\t\t\t\t\t\t\t\t\tvalue = val.value;\n\t\t\t\t\t\t\t\t\ttext = val.text;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvalue = key;\n\t\t\t\t\t\t\t\t\ttext = val;\n\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\t<option value=\"{{ value }}\">{{ text }}</option>\n\t\t\t\t\t\t\t<# } ); #>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t<# _.each( _.extend( inputAttrs ), function( value, key ) { #>\n\t\t\t\t\t\t\t\t{{{ key }}}=\"{{ value }}\"\n\t\t\t\t\t\t\t<# }); #>\n\t\t\t\t\t\t\t>\n\t\t\t\t\t<# } #>\n\t\t\t<# } #>\n\t\t</script>\n\n\t\t<script type=\"text/html\" id=\"tmpl-customize-notification\">\n\t\t\t<li class=\"notice notice-{{ data.type || 'info' }} {{ data.alt ? 'notice-alt' : '' }} {{ data.dismissible ? 'is-dismissible' : '' }} {{ data.containerClasses || '' }}\" data-code=\"{{ data.code }}\" data-type=\"{{ data.type }}\">\n\t\t\t\t<div class=\"notification-message\">{{{ data.message || data.code }}}</div>\n\t\t\t\t<# if ( data.dismissible ) { #>\n\t\t\t\t\t<button type=\"button\" class=\"notice-dismiss\"><span class=\"screen-reader-text\"><?php _e( 'Dismiss' ); ?></span></button>\n\t\t\t\t<# } #>\n\t\t\t</li>\n\t\t</script>\n\n\t\t<script type=\"text/html\" id=\"tmpl-customize-changeset-locked-notification\">\n\t\t\t<li class=\"notice notice-{{ data.type || 'info' }} {{ data.containerClasses || '' }}\" data-code=\"{{ data.code }}\" data-type=\"{{ data.type }}\">\n\t\t\t\t<div class=\"notification-message customize-changeset-locked-message\">\n\t\t\t\t\t<img class=\"customize-changeset-locked-avatar\" src=\"{{ data.lockUser.avatar }}\" alt=\"{{ data.lockUser.name }}\">\n\t\t\t\t\t<p class=\"currently-editing\">\n\t\t\t\t\t\t<# if ( data.message ) { #>\n\t\t\t\t\t\t\t{{{ data.message }}}\n\t\t\t\t\t\t<# } else if ( data.allowOverride ) { #>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo esc_html( sprintf( $l10n['locked_allow_override'], '{{ data.lockUser.name }}' ) );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo esc_html( sprintf( $l10n['locked'], '{{ data.lockUser.name }}' ) );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t</p>\n\t\t\t\t\t<p class=\"notice notice-error notice-alt\" hidden></p>\n\t\t\t\t\t<p class=\"action-buttons\">\n\t\t\t\t\t\t<# if ( data.returnUrl !== data.previewUrl ) { #>\n\t\t\t\t\t\t\t<a class=\"button customize-notice-go-back-button\" href=\"{{ data.returnUrl }}\"><?php _e( 'Go back' ); ?></a>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t\t<a class=\"button customize-notice-preview-button\" href=\"{{ data.frontendPreviewUrl }}\"><?php _e( 'Preview' ); ?></a>\n\t\t\t\t\t\t<# if ( data.allowOverride ) { #>\n\t\t\t\t\t\t\t<button class=\"button button-primary wp-tab-last customize-notice-take-over-button\"><?php _e( 'Take over' ); ?></button>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t</script>\n\n\t\t<script type=\"text/html\" id=\"tmpl-customize-code-editor-lint-error-notification\">\n\t\t\t<li class=\"notice notice-{{ data.type || 'info' }} {{ data.alt ? 'notice-alt' : '' }} {{ data.dismissible ? 'is-dismissible' : '' }} {{ data.containerClasses || '' }}\" data-code=\"{{ data.code }}\" data-type=\"{{ data.type }}\">\n\t\t\t\t<div class=\"notification-message\">{{{ data.message || data.code }}}</div>\n\n\t\t\t\t<p>\n\t\t\t\t\t<# var elementId = 'el-' + String( Math.random() ); #>\n\t\t\t\t\t<input id=\"{{ elementId }}\" type=\"checkbox\">\n\t\t\t\t\t<label for=\"{{ elementId }}\"><?php _e( 'Update anyway, even though it might break your site?' ); ?></label>\n\t\t\t\t</p>\n\t\t\t</li>\n\t\t</script>\n\n\t\t<?php\n\t\t/* The following template is obsolete in core but retained for plugins. */\n\t\t?>\n\t\t<script type=\"text/html\" id=\"tmpl-customize-control-notifications\">\n\t\t\t<ul>\n\t\t\t\t<# _.each( data.notifications, function( notification ) { #>\n\t\t\t\t\t<li class=\"notice notice-{{ notification.type || 'info' }} {{ data.altNotice ? 'notice-alt' : '' }}\" data-code=\"{{ notification.code }}\" data-type=\"{{ notification.type }}\">{{{ notification.message || notification.code }}}</li>\n\t\t\t\t<# } ); #>\n\t\t\t</ul>\n\t\t</script>\n\n\t\t<script type=\"text/html\" id=\"tmpl-customize-preview-link-control\" >\n\t\t\t<# var elementPrefix = _.uniqueId( 'el' ) + '-' #>\n\t\t\t<p class=\"customize-control-title\">\n\t\t\t\t<?php esc_html_e( 'Share Preview Link' ); ?>\n\t\t\t</p>\n\t\t\t<p class=\"description customize-control-description\"><?php esc_html_e( 'See how changes would look live on your website, and share the preview with people who can\\'t access the Customizer.' ); ?></p>\n\t\t\t<div class=\"customize-control-notifications-container\"></div>\n\t\t\t<div class=\"preview-link-wrapper\">\n\t\t\t\t<label for=\"{{ elementPrefix }}customize-preview-link-input\" class=\"screen-reader-text\"><?php esc_html_e( 'Preview Link' ); ?></label>\n\t\t\t\t<a href=\"\" target=\"\">\n\t\t\t\t\t<span class=\"preview-control-element\" data-component=\"url\"></span>\n\t\t\t\t\t<span class=\"screen-reader-text\"><?php _e( '(opens in a new tab)' ); ?></span>\n\t\t\t\t</a>\n\t\t\t\t<input id=\"{{ elementPrefix }}customize-preview-link-input\" readonly tabindex=\"-1\" class=\"preview-control-element\" data-component=\"input\">\n\t\t\t\t<button class=\"customize-copy-preview-link preview-control-element button button-secondary\" data-component=\"button\" data-copy-text=\"<?php esc_attr_e( 'Copy' ); ?>\" data-copied-text=\"<?php esc_attr_e( 'Copied' ); ?>\" ><?php esc_html_e( 'Copy' ); ?></button>\n\t\t\t</div>\n\t\t</script>\n\t\t<script type=\"text/html\" id=\"tmpl-customize-selected-changeset-status-control\">\n\t\t\t<# var inputId = _.uniqueId( 'customize-selected-changeset-status-control-input-' ); #>\n\t\t\t<# var descriptionId = _.uniqueId( 'customize-selected-changeset-status-control-description-' ); #>\n\t\t\t<# if ( data.label ) { #>\n\t\t\t\t<label for=\"{{ inputId }}\" class=\"customize-control-title\">{{ data.label }}</label>\n\t\t\t<# } #>\n\t\t\t<# if ( data.description ) { #>\n\t\t\t\t<span id=\"{{ descriptionId }}\" class=\"description customize-control-description\">{{{ data.description }}}</span>\n\t\t\t<# } #>\n\t\t\t<# _.each( data.choices, function( choice ) { #>\n\t\t\t\t<# var choiceId = inputId + '-' + choice.status; #>\n\t\t\t\t<span class=\"customize-inside-control-row\">\n\t\t\t\t\t<input id=\"{{ choiceId }}\" type=\"radio\" value=\"{{ choice.status }}\" name=\"{{ inputId }}\" data-customize-setting-key-link=\"default\">\n\t\t\t\t\t<label for=\"{{ choiceId }}\">{{ choice.label }}</label>\n\t\t\t\t</span>\n\t\t\t<# } ); #>\n\t\t</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * Helper function to compare two objects by priority, ensuring sort stability via instance_number.\n\t *\n\t * @since 3.4.0\n\t * @deprecated 4.7.0 Use wp_list_sort()\n\t *\n\t * @param WP_Customize_Panel|WP_Customize_Section|WP_Customize_Control $a Object A.\n\t * @param WP_Customize_Panel|WP_Customize_Section|WP_Customize_Control $b Object B.\n\t * @return int\n\t */\n\tprotected function _cmp_priority( $a, $b ) {\n\t\t_deprecated_function( __METHOD__, '4.7.0', 'wp_list_sort' );\n\n\t\tif ( $a->priority === $b->priority ) {\n\t\t\treturn $a->instance_number - $b->instance_number;\n\t\t} else {\n\t\t\treturn $a->priority - $b->priority;\n\t\t}\n\t}\n\n\t/**\n\t * Prepare panels, sections, and controls.\n\t *\n\t * For each, check if required related components exist,\n\t * whether the user has the necessary capabilities,\n\t * and sort by priority.\n\t *\n\t * @since 3.4.0\n\t */\n\tpublic function prepare_controls() {\n\n\t\t$controls       = array();\n\t\t$this->controls = wp_list_sort(\n\t\t\t$this->controls,\n\t\t\tarray(\n\t\t\t\t'priority'        => 'ASC',\n\t\t\t\t'instance_number' => 'ASC',\n\t\t\t),\n\t\t\t'ASC',\n\t\t\ttrue\n\t\t);\n\n\t\tforeach ( $this->controls as $id => $control ) {\n\t\t\tif ( ! isset( $this->sections[ $control->section ] ) || ! $control->check_capabilities() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->sections[ $control->section ]->controls[] = $control;\n\t\t\t$controls[ $id ]                                 = $control;\n\t\t}\n\t\t$this->controls = $controls;\n\n\t\t// Prepare sections.\n\t\t$this->sections = wp_list_sort(\n\t\t\t$this->sections,\n\t\t\tarray(\n\t\t\t\t'priority'        => 'ASC',\n\t\t\t\t'instance_number' => 'ASC',\n\t\t\t),\n\t\t\t'ASC',\n\t\t\ttrue\n\t\t);\n\t\t$sections       = array();\n\n\t\tforeach ( $this->sections as $section ) {\n\t\t\tif ( ! $section->check_capabilities() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$section->controls = wp_list_sort(\n\t\t\t\t$section->controls,\n\t\t\t\tarray(\n\t\t\t\t\t'priority'        => 'ASC',\n\t\t\t\t\t'instance_number' => 'ASC',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( ! $section->panel ) {\n\t\t\t\t// Top-level section.\n\t\t\t\t$sections[ $section->id ] = $section;\n\t\t\t} else {\n\t\t\t\t// This section belongs to a panel.\n\t\t\t\tif ( isset( $this->panels [ $section->panel ] ) ) {\n\t\t\t\t\t$this->panels[ $section->panel ]->sections[ $section->id ] = $section;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->sections = $sections;\n\n\t\t// Prepare panels.\n\t\t$this->panels = wp_list_sort(\n\t\t\t$this->panels,\n\t\t\tarray(\n\t\t\t\t'priority'        => 'ASC',\n\t\t\t\t'instance_number' => 'ASC',\n\t\t\t),\n\t\t\t'ASC',\n\t\t\ttrue\n\t\t);\n\t\t$panels       = array();\n\n\t\tforeach ( $this->panels as $panel ) {\n\t\t\tif ( ! $panel->check_capabilities() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$panel->sections      = wp_list_sort(\n\t\t\t\t$panel->sections,\n\t\t\t\tarray(\n\t\t\t\t\t'priority'        => 'ASC',\n\t\t\t\t\t'instance_number' => 'ASC',\n\t\t\t\t),\n\t\t\t\t'ASC',\n\t\t\t\ttrue\n\t\t\t);\n\t\t\t$panels[ $panel->id ] = $panel;\n\t\t}\n\t\t$this->panels = $panels;\n\n\t\t// Sort panels and top-level sections together.\n\t\t$this->containers = array_merge( $this->panels, $this->sections );\n\t\t$this->containers = wp_list_sort(\n\t\t\t$this->containers,\n\t\t\tarray(\n\t\t\t\t'priority'        => 'ASC',\n\t\t\t\t'instance_number' => 'ASC',\n\t\t\t),\n\t\t\t'ASC',\n\t\t\ttrue\n\t\t);\n\t}\n\n\t/**\n\t * Enqueue scripts for customize controls.\n\t *\n\t * @since 3.4.0\n\t */\n\tpublic function enqueue_control_scripts() {\n\t\tforeach ( $this->controls as $control ) {\n\t\t\t$control->enqueue();\n\t\t}\n\n\t\tif ( ! is_multisite() && ( current_user_can( 'install_themes' ) || current_user_can( 'update_themes' ) || current_user_can( 'delete_themes' ) ) ) {\n\t\t\twp_enqueue_script( 'updates' );\n\t\t\twp_localize_script(\n\t\t\t\t'updates',\n\t\t\t\t'_wpUpdatesItemCounts',\n\t\t\t\tarray(\n\t\t\t\t\t'totals' => wp_get_update_data(),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Determine whether the user agent is iOS.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return bool Whether the user agent is iOS.\n\t */\n\tpublic function is_ios() {\n\t\treturn wp_is_mobile() && preg_match( '/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT'] );\n\t}\n\n\t/**\n\t * Get the template string for the Customizer pane document title.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return string The template string for the document title.\n\t */\n\tpublic function get_document_title_template() {\n\t\tif ( $this->is_theme_active() ) {\n\t\t\t/* translators: %s: Document title from the preview. */\n\t\t\t$document_title_tmpl = __( 'Customize: %s' );\n\t\t} else {\n\t\t\t/* translators: %s: Document title from the preview. */\n\t\t\t$document_title_tmpl = __( 'Live Preview: %s' );\n\t\t}\n\t\t$document_title_tmpl = html_entity_decode( $document_title_tmpl, ENT_QUOTES, 'UTF-8' ); // Because exported to JS and assigned to document.title.\n\t\treturn $document_title_tmpl;\n\t}\n\n\t/**\n\t * Set the initial URL to be previewed.\n\t *\n\t * URL is validated.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $preview_url URL to be previewed.\n\t */\n\tpublic function set_preview_url( $preview_url ) {\n\t\t$preview_url       = esc_url_raw( $preview_url );\n\t\t$this->preview_url = wp_validate_redirect( $preview_url, home_url( '/' ) );\n\t}\n\n\t/**\n\t * Get the initial URL to be previewed.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return string URL being previewed.\n\t */\n\tpublic function get_preview_url() {\n\t\tif ( empty( $this->preview_url ) ) {\n\t\t\t$preview_url = home_url( '/' );\n\t\t} else {\n\t\t\t$preview_url = $this->preview_url;\n\t\t}\n\t\treturn $preview_url;\n\t}\n\n\t/**\n\t * Determines whether the admin and the frontend are on different domains.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return bool Whether cross-domain.\n\t */\n\tpublic function is_cross_domain() {\n\t\t$admin_origin = wp_parse_url( admin_url() );\n\t\t$home_origin  = wp_parse_url( home_url() );\n\t\t$cross_domain = ( strtolower( $admin_origin['host'] ) !== strtolower( $home_origin['host'] ) );\n\t\treturn $cross_domain;\n\t}\n\n\t/**\n\t * Get URLs allowed to be previewed.\n\t *\n\t * If the front end and the admin are served from the same domain, load the\n\t * preview over ssl if the Customizer is being loaded over ssl. This avoids\n\t * insecure content warnings. This is not attempted if the admin and front end\n\t * are on different domains to avoid the case where the front end doesn't have\n\t * ssl certs. Domain mapping plugins can allow other urls in these conditions\n\t * using the customize_allowed_urls filter.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Allowed URLs.\n\t */\n\tpublic function get_allowed_urls() {\n\t\t$allowed_urls = array( home_url( '/' ) );\n\n\t\tif ( is_ssl() && ! $this->is_cross_domain() ) {\n\t\t\t$allowed_urls[] = home_url( '/', 'https' );\n\t\t}\n\n\t\t/**\n\t\t * Filters the list of URLs allowed to be clicked and followed in the Customizer preview.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param string[] $allowed_urls An array of allowed URLs.\n\t\t */\n\t\t$allowed_urls = array_unique( apply_filters( 'customize_allowed_urls', $allowed_urls ) );\n\n\t\treturn $allowed_urls;\n\t}\n\n\t/**\n\t * Get messenger channel.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return string Messenger channel.\n\t */\n\tpublic function get_messenger_channel() {\n\t\treturn $this->messenger_channel;\n\t}\n\n\t/**\n\t * Set URL to link the user to when closing the Customizer.\n\t *\n\t * URL is validated.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $return_url URL for return link.\n\t */\n\tpublic function set_return_url( $return_url ) {\n\t\t$return_url       = esc_url_raw( $return_url );\n\t\t$return_url       = remove_query_arg( wp_removable_query_args(), $return_url );\n\t\t$return_url       = wp_validate_redirect( $return_url );\n\t\t$this->return_url = $return_url;\n\t}\n\n\t/**\n\t * Get URL to link the user to when closing the Customizer.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @global array $_registered_pages\n\t *\n\t * @return string URL for link to close Customizer.\n\t */\n\tpublic function get_return_url() {\n\t\tglobal $_registered_pages;\n\n\t\t$referer                    = wp_get_referer();\n\t\t$excluded_referer_basenames = array( 'customize.php', 'wp-login.php' );\n\n\t\tif ( $this->return_url ) {\n\t\t\t$return_url = $this->return_url;\n\t\t} elseif ( $referer && ! in_array( wp_basename( parse_url( $referer, PHP_URL_PATH ) ), $excluded_referer_basenames, true ) ) {\n\t\t\t$return_url = $referer;\n\t\t} elseif ( $this->preview_url ) {\n\t\t\t$return_url = $this->preview_url;\n\t\t} else {\n\t\t\t$return_url = home_url( '/' );\n\t\t}\n\n\t\t$return_url_basename = wp_basename( parse_url( $this->return_url, PHP_URL_PATH ) );\n\t\t$return_url_query    = parse_url( $this->return_url, PHP_URL_QUERY );\n\n\t\tif ( 'themes.php' === $return_url_basename && $return_url_query ) {\n\t\t\tparse_str( $return_url_query, $query_vars );\n\n\t\t\t/*\n\t\t\t * If the return URL is a page added by a theme to the Appearance menu via add_submenu_page(),\n\t\t\t * verify that belongs to the active theme, otherwise fall back to the Themes screen.\n\t\t\t */\n\t\t\tif ( isset( $query_vars['page'] ) && ! isset( $_registered_pages[ \"appearance_page_{$query_vars['page']}\" ] ) ) {\n\t\t\t\t$return_url = admin_url( 'themes.php' );\n\t\t\t}\n\t\t}\n\n\t\treturn $return_url;\n\t}\n\n\t/**\n\t * Set the autofocused constructs.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $autofocus {\n\t *     Mapping of 'panel', 'section', 'control' to the ID which should be autofocused.\n\t *\n\t *     @type string $control ID for control to be autofocused.\n\t *     @type string $section ID for section to be autofocused.\n\t *     @type string $panel   ID for panel to be autofocused.\n\t * }\n\t */\n\tpublic function set_autofocus( $autofocus ) {\n\t\t$this->autofocus = array_filter( wp_array_slice_assoc( $autofocus, array( 'panel', 'section', 'control' ) ), 'is_string' );\n\t}\n\n\t/**\n\t * Get the autofocused constructs.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return array {\n\t *     Mapping of 'panel', 'section', 'control' to the ID which should be autofocused.\n\t *\n\t *     @type string $control ID for control to be autofocused.\n\t *     @type string $section ID for section to be autofocused.\n\t *     @type string $panel   ID for panel to be autofocused.\n\t * }\n\t */\n\tpublic function get_autofocus() {\n\t\treturn $this->autofocus;\n\t}\n\n\t/**\n\t * Get nonces for the Customizer.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @return array Nonces.\n\t */\n\tpublic function get_nonces() {\n\t\t$nonces = array(\n\t\t\t'save'                     => wp_create_nonce( 'save-customize_' . $this->get_stylesheet() ),\n\t\t\t'preview'                  => wp_create_nonce( 'preview-customize_' . $this->get_stylesheet() ),\n\t\t\t'switch_themes'            => wp_create_nonce( 'switch_themes' ),\n\t\t\t'dismiss_autosave_or_lock' => wp_create_nonce( 'customize_dismiss_autosave_or_lock' ),\n\t\t\t'override_lock'            => wp_create_nonce( 'customize_override_changeset_lock' ),\n\t\t\t'trash'                    => wp_create_nonce( 'trash_customize_changeset' ),\n\t\t);\n\n\t\t/**\n\t\t * Filters nonces for Customizer.\n\t\t *\n\t\t * @since 4.2.0\n\t\t *\n\t\t * @param string[]             $nonces Array of refreshed nonces for save and\n\t\t *                                     preview actions.\n\t\t * @param WP_Customize_Manager $this   WP_Customize_Manager instance.\n\t\t */\n\t\t$nonces = apply_filters( 'customize_refresh_nonces', $nonces, $this );\n\n\t\treturn $nonces;\n\t}\n\n\t/**\n\t * Print JavaScript settings for parent window.\n\t *\n\t * @since 4.4.0\n\t */\n\tpublic function customize_pane_settings() {\n\n\t\t$login_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'interim-login'   => 1,\n\t\t\t\t'customize-login' => 1,\n\t\t\t),\n\t\t\twp_login_url()\n\t\t);\n\n\t\t// Ensure dirty flags are set for modified settings.\n\t\tforeach ( array_keys( $this->unsanitized_post_values() ) as $setting_id ) {\n\t\t\t$setting = $this->get_setting( $setting_id );\n\t\t\tif ( $setting ) {\n\t\t\t\t$setting->dirty = true;\n\t\t\t}\n\t\t}\n\n\t\t$autosave_revision_post  = null;\n\t\t$autosave_autodraft_post = null;\n\t\t$changeset_post_id       = $this->changeset_post_id();\n\t\tif ( ! $this->saved_starter_content_changeset && ! $this->autosaved() ) {\n\t\t\tif ( $changeset_post_id ) {\n\t\t\t\tif ( is_user_logged_in() ) {\n\t\t\t\t\t$autosave_revision_post = wp_get_post_autosave( $changeset_post_id, get_current_user_id() );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$autosave_autodraft_posts = $this->get_changeset_posts(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'posts_per_page'            => 1,\n\t\t\t\t\t\t'post_status'               => 'auto-draft',\n\t\t\t\t\t\t'exclude_restore_dismissed' => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tif ( ! empty( $autosave_autodraft_posts ) ) {\n\t\t\t\t\t$autosave_autodraft_post = array_shift( $autosave_autodraft_posts );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$current_user_can_publish = current_user_can( get_post_type_object( 'customize_changeset' )->cap->publish_posts );\n\n\t\t// @todo Include all of the status labels here from script-loader.php, and then allow it to be filtered.\n\t\t$status_choices = array();\n\t\tif ( $current_user_can_publish ) {\n\t\t\t$status_choices[] = array(\n\t\t\t\t'status' => 'publish',\n\t\t\t\t'label'  => __( 'Publish' ),\n\t\t\t);\n\t\t}\n\t\t$status_choices[] = array(\n\t\t\t'status' => 'draft',\n\t\t\t'label'  => __( 'Save Draft' ),\n\t\t);\n\t\tif ( $current_user_can_publish ) {\n\t\t\t$status_choices[] = array(\n\t\t\t\t'status' => 'future',\n\t\t\t\t'label'  => _x( 'Schedule', 'customizer changeset action/button label' ),\n\t\t\t);\n\t\t}\n\n\t\t// Prepare Customizer settings to pass to JavaScript.\n\t\t$changeset_post = null;\n\t\tif ( $changeset_post_id ) {\n\t\t\t$changeset_post = get_post( $changeset_post_id );\n\t\t}\n\n\t\t// Determine initial date to be at present or future, not past.\n\t\t$current_time = current_time( 'mysql', false );\n\t\t$initial_date = $current_time;\n\t\tif ( $changeset_post ) {\n\t\t\t$initial_date = get_the_time( 'Y-m-d H:i:s', $changeset_post->ID );\n\t\t\tif ( $initial_date < $current_time ) {\n\t\t\t\t$initial_date = $current_time;\n\t\t\t}\n\t\t}\n\n\t\t$lock_user_id = false;\n\t\tif ( $this->changeset_post_id() ) {\n\t\t\t$lock_user_id = wp_check_post_lock( $this->changeset_post_id() );\n\t\t}\n\n\t\t$settings = array(\n\t\t\t'changeset'              => array(\n\t\t\t\t'uuid'                  => $this->changeset_uuid(),\n\t\t\t\t'branching'             => $this->branching(),\n\t\t\t\t'autosaved'             => $this->autosaved(),\n\t\t\t\t'hasAutosaveRevision'   => ! empty( $autosave_revision_post ),\n\t\t\t\t'latestAutoDraftUuid'   => $autosave_autodraft_post ? $autosave_autodraft_post->post_name : null,\n\t\t\t\t'status'                => $changeset_post ? $changeset_post->post_status : '',\n\t\t\t\t'currentUserCanPublish' => $current_user_can_publish,\n\t\t\t\t'publishDate'           => $initial_date,\n\t\t\t\t'statusChoices'         => $status_choices,\n\t\t\t\t'lockUser'              => $lock_user_id ? $this->get_lock_user_data( $lock_user_id ) : null,\n\t\t\t),\n\t\t\t'initialServerDate'      => $current_time,\n\t\t\t'dateFormat'             => get_option( 'date_format' ),\n\t\t\t'timeFormat'             => get_option( 'time_format' ),\n\t\t\t'initialServerTimestamp' => floor( microtime( true ) * 1000 ),\n\t\t\t'initialClientTimestamp' => -1, // To be set with JS below.\n\t\t\t'timeouts'               => array(\n\t\t\t\t'windowRefresh'           => 250,\n\t\t\t\t'changesetAutoSave'       => AUTOSAVE_INTERVAL * 1000,\n\t\t\t\t'keepAliveCheck'          => 2500,\n\t\t\t\t'reflowPaneContents'      => 100,\n\t\t\t\t'previewFrameSensitivity' => 2000,\n\t\t\t),\n\t\t\t'theme'                  => array(\n\t\t\t\t'stylesheet'  => $this->get_stylesheet(),\n\t\t\t\t'active'      => $this->is_theme_active(),\n\t\t\t\t'_canInstall' => current_user_can( 'install_themes' ),\n\t\t\t),\n\t\t\t'url'                    => array(\n\t\t\t\t'preview'       => esc_url_raw( $this->get_preview_url() ),\n\t\t\t\t'return'        => esc_url_raw( $this->get_return_url() ),\n\t\t\t\t'parent'        => esc_url_raw( admin_url() ),\n\t\t\t\t'activated'     => esc_url_raw( home_url( '/' ) ),\n\t\t\t\t'ajax'          => esc_url_raw( admin_url( 'admin-ajax.php', 'relative' ) ),\n\t\t\t\t'allowed'       => array_map( 'esc_url_raw', $this->get_allowed_urls() ),\n\t\t\t\t'isCrossDomain' => $this->is_cross_domain(),\n\t\t\t\t'home'          => esc_url_raw( home_url( '/' ) ),\n\t\t\t\t'login'         => esc_url_raw( $login_url ),\n\t\t\t),\n\t\t\t'browser'                => array(\n\t\t\t\t'mobile' => wp_is_mobile(),\n\t\t\t\t'ios'    => $this->is_ios(),\n\t\t\t),\n\t\t\t'panels'                 => array(),\n\t\t\t'sections'               => array(),\n\t\t\t'nonce'                  => $this->get_nonces(),\n\t\t\t'autofocus'              => $this->get_autofocus(),\n\t\t\t'documentTitleTmpl'      => $this->get_document_title_template(),\n\t\t\t'previewableDevices'     => $this->get_previewable_devices(),\n\t\t\t'l10n'                   => array(\n\t\t\t\t'confirmDeleteTheme'   => __( 'Are you sure you want to delete this theme?' ),\n\t\t\t\t/* translators: %d: Number of theme search results, which cannot currently consider singular vs. plural forms. */\n\t\t\t\t'themeSearchResults'   => __( '%d themes found' ),\n\t\t\t\t/* translators: %d: Number of themes being displayed, which cannot currently consider singular vs. plural forms. */\n\t\t\t\t'announceThemeCount'   => __( 'Displaying %d themes' ),\n\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t'announceThemeDetails' => __( 'Showing details for theme: %s' ),\n\t\t\t),\n\t\t);\n\n\t\t// Temporarily disable installation in Customizer. See #42184.\n\t\t$filesystem_method = get_filesystem_method();\n\t\tob_start();\n\t\t$filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() );\n\t\tob_end_clean();\n\t\tif ( 'direct' !== $filesystem_method && ! $filesystem_credentials_are_stored ) {\n\t\t\t$settings['theme']['_filesystemCredentialsNeeded'] = true;\n\t\t}\n\n\t\t// Prepare Customize Section objects to pass to JavaScript.\n\t\tforeach ( $this->sections() as $id => $section ) {\n\t\t\tif ( $section->check_capabilities() ) {\n\t\t\t\t$settings['sections'][ $id ] = $section->json();\n\t\t\t}\n\t\t}\n\n\t\t// Prepare Customize Panel objects to pass to JavaScript.\n\t\tforeach ( $this->panels() as $panel_id => $panel ) {\n\t\t\tif ( $panel->check_capabilities() ) {\n\t\t\t\t$settings['panels'][ $panel_id ] = $panel->json();\n\t\t\t\tforeach ( $panel->sections as $section_id => $section ) {\n\t\t\t\t\tif ( $section->check_capabilities() ) {\n\t\t\t\t\t\t$settings['sections'][ $section_id ] = $section->json();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t\tvar _wpCustomizeSettings = <?php echo wp_json_encode( $settings ); ?>;\n\t\t\t_wpCustomizeSettings.initialClientTimestamp = _.now();\n\t\t\t_wpCustomizeSettings.controls = {};\n\t\t\t_wpCustomizeSettings.settings = {};\n\t\t\t<?php\n\n\t\t\t// Serialize settings one by one to improve memory usage.\n\t\t\techo \"(function ( s ){\\n\";\n\t\t\tforeach ( $this->settings() as $setting ) {\n\t\t\t\tif ( $setting->check_capabilities() ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t\"s[%s] = %s;\\n\",\n\t\t\t\t\t\twp_json_encode( $setting->id ),\n\t\t\t\t\t\twp_json_encode( $setting->json() )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\techo \"})( _wpCustomizeSettings.settings );\\n\";\n\n\t\t\t// Serialize controls one by one to improve memory usage.\n\t\t\techo \"(function ( c ){\\n\";\n\t\t\tforeach ( $this->controls() as $control ) {\n\t\t\t\tif ( $control->check_capabilities() ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t\"c[%s] = %s;\\n\",\n\t\t\t\t\t\twp_json_encode( $control->id ),\n\t\t\t\t\t\twp_json_encode( $control->json() )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\techo \"})( _wpCustomizeSettings.controls );\\n\";\n\t\t\t?>\n\t\t</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * Returns a list of devices to allow previewing.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @return array List of devices with labels and default setting.\n\t */\n\tpublic function get_previewable_devices() {\n\t\t$devices = array(\n\t\t\t'desktop' => array(\n\t\t\t\t'label'   => __( 'Enter desktop preview mode' ),\n\t\t\t\t'default' => true,\n\t\t\t),\n\t\t\t'tablet'  => array(\n\t\t\t\t'label' => __( 'Enter tablet preview mode' ),\n\t\t\t),\n\t\t\t'mobile'  => array(\n\t\t\t\t'label' => __( 'Enter mobile preview mode' ),\n\t\t\t),\n\t\t);\n\n\t\t/**\n\t\t * Filters the available devices to allow previewing in the Customizer.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @see WP_Customize_Manager::get_previewable_devices()\n\t\t *\n\t\t * @param array $devices List of devices with labels and default setting.\n\t\t */\n\t\t$devices = apply_filters( 'customize_previewable_devices', $devices );\n\n\t\treturn $devices;\n\t}\n\n\t/**\n\t * Register some default controls.\n\t *\n\t * @since 3.4.0\n\t */\n\tpublic function register_controls() {\n\n\t\t/* Themes (controls are loaded via ajax) */\n\n\t\t$this->add_panel(\n\t\t\tnew WP_Customize_Themes_Panel(\n\t\t\t\t$this,\n\t\t\t\t'themes',\n\t\t\t\tarray(\n\t\t\t\t\t'title'       => $this->theme()->display( 'Name' ),\n\t\t\t\t\t'description' => (\n\t\t\t\t\t'<p>' . __( 'Looking for a theme? You can search or browse the WordPress.org theme directory, install and preview themes, then activate them right here.' ) . '</p>' .\n\t\t\t\t\t'<p>' . __( 'While previewing a new theme, you can continue to tailor things like widgets and menus, and explore theme-specific options.' ) . '</p>'\n\t\t\t\t\t),\n\t\t\t\t\t'capability'  => 'switch_themes',\n\t\t\t\t\t'priority'    => 0,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$this->add_section(\n\t\t\tnew WP_Customize_Themes_Section(\n\t\t\t\t$this,\n\t\t\t\t'installed_themes',\n\t\t\t\tarray(\n\t\t\t\t\t'title'      => __( 'Installed themes' ),\n\t\t\t\t\t'action'     => 'installed',\n\t\t\t\t\t'capability' => 'switch_themes',\n\t\t\t\t\t'panel'      => 'themes',\n\t\t\t\t\t'priority'   => 0,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\tif ( ! is_multisite() ) {\n\t\t\t$this->add_section(\n\t\t\t\tnew WP_Customize_Themes_Section(\n\t\t\t\t\t$this,\n\t\t\t\t\t'wporg_themes',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title'       => __( 'WordPress.org themes' ),\n\t\t\t\t\t\t'action'      => 'wporg',\n\t\t\t\t\t\t'filter_type' => 'remote',\n\t\t\t\t\t\t'capability'  => 'install_themes',\n\t\t\t\t\t\t'panel'       => 'themes',\n\t\t\t\t\t\t'priority'    => 5,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// Themes Setting (unused - the theme is considerably more fundamental to the Customizer experience).\n\t\t$this->add_setting(\n\t\t\tnew WP_Customize_Filter_Setting(\n\t\t\t\t$this,\n\t\t\t\t'active_theme',\n\t\t\t\tarray(\n\t\t\t\t\t'capability' => 'switch_themes',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t/* Site Identity */\n\n\t\t$this->add_section(\n\t\t\t'title_tagline',\n\t\t\tarray(\n\t\t\t\t'title'    => __( 'Site Identity' ),\n\t\t\t\t'priority' => 20,\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\t'blogname',\n\t\t\tarray(\n\t\t\t\t'default'    => get_option( 'blogname' ),\n\t\t\t\t'type'       => 'option',\n\t\t\t\t'capability' => 'manage_options',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'blogname',\n\t\t\tarray(\n\t\t\t\t'label'   => __( 'Site Title' ),\n\t\t\t\t'section' => 'title_tagline',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\t'blogdescription',\n\t\t\tarray(\n\t\t\t\t'default'    => get_option( 'blogdescription' ),\n\t\t\t\t'type'       => 'option',\n\t\t\t\t'capability' => 'manage_options',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'blogdescription',\n\t\t\tarray(\n\t\t\t\t'label'   => __( 'Tagline' ),\n\t\t\t\t'section' => 'title_tagline',\n\t\t\t)\n\t\t);\n\n\t\t// Add a setting to hide header text if the theme doesn't support custom headers.\n\t\tif ( ! current_theme_supports( 'custom-header', 'header-text' ) ) {\n\t\t\t$this->add_setting(\n\t\t\t\t'header_text',\n\t\t\t\tarray(\n\t\t\t\t\t'theme_supports'    => array( 'custom-logo', 'header-text' ),\n\t\t\t\t\t'default'           => 1,\n\t\t\t\t\t'sanitize_callback' => 'absint',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->add_control(\n\t\t\t\t'header_text',\n\t\t\t\tarray(\n\t\t\t\t\t'label'    => __( 'Display Site Title and Tagline' ),\n\t\t\t\t\t'section'  => 'title_tagline',\n\t\t\t\t\t'settings' => 'header_text',\n\t\t\t\t\t'type'     => 'checkbox',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$this->add_setting(\n\t\t\t'site_icon',\n\t\t\tarray(\n\t\t\t\t'type'       => 'option',\n\t\t\t\t'capability' => 'manage_options',\n\t\t\t\t'transport'  => 'postMessage', // Previewed with JS in the Customizer controls window.\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\tnew WP_Customize_Site_Icon_Control(\n\t\t\t\t$this,\n\t\t\t\t'site_icon',\n\t\t\t\tarray(\n\t\t\t\t\t'label'       => __( 'Site Icon' ),\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t'<p>' . __( 'Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. Upload one here!' ) . '</p>' .\n\t\t\t\t\t\t/* translators: %s: Site icon size in pixels. */\n\t\t\t\t\t\t'<p>' . __( 'Site Icons should be square and at least %s pixels.' ) . '</p>',\n\t\t\t\t\t\t'<strong>512 &times; 512</strong>'\n\t\t\t\t\t),\n\t\t\t\t\t'section'     => 'title_tagline',\n\t\t\t\t\t'priority'    => 60,\n\t\t\t\t\t'height'      => 512,\n\t\t\t\t\t'width'       => 512,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\t'custom_logo',\n\t\t\tarray(\n\t\t\t\t'theme_supports' => array( 'custom-logo' ),\n\t\t\t\t'transport'      => 'postMessage',\n\t\t\t)\n\t\t);\n\n\t\t$custom_logo_args = get_theme_support( 'custom-logo' );\n\t\t$this->add_control(\n\t\t\tnew WP_Customize_Cropped_Image_Control(\n\t\t\t\t$this,\n\t\t\t\t'custom_logo',\n\t\t\t\tarray(\n\t\t\t\t\t'label'         => __( 'Logo' ),\n\t\t\t\t\t'section'       => 'title_tagline',\n\t\t\t\t\t'priority'      => 8,\n\t\t\t\t\t'height'        => isset( $custom_logo_args[0]['height'] ) ? $custom_logo_args[0]['height'] : null,\n\t\t\t\t\t'width'         => isset( $custom_logo_args[0]['width'] ) ? $custom_logo_args[0]['width'] : null,\n\t\t\t\t\t'flex_height'   => isset( $custom_logo_args[0]['flex-height'] ) ? $custom_logo_args[0]['flex-height'] : null,\n\t\t\t\t\t'flex_width'    => isset( $custom_logo_args[0]['flex-width'] ) ? $custom_logo_args[0]['flex-width'] : null,\n\t\t\t\t\t'button_labels' => array(\n\t\t\t\t\t\t'select'       => __( 'Select logo' ),\n\t\t\t\t\t\t'change'       => __( 'Change logo' ),\n\t\t\t\t\t\t'remove'       => __( 'Remove' ),\n\t\t\t\t\t\t'default'      => __( 'Default' ),\n\t\t\t\t\t\t'placeholder'  => __( 'No logo selected' ),\n\t\t\t\t\t\t'frame_title'  => __( 'Select logo' ),\n\t\t\t\t\t\t'frame_button' => __( 'Choose logo' ),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$this->selective_refresh->add_partial(\n\t\t\t'custom_logo',\n\t\t\tarray(\n\t\t\t\t'settings'            => array( 'custom_logo' ),\n\t\t\t\t'selector'            => '.custom-logo-link',\n\t\t\t\t'render_callback'     => array( $this, '_render_custom_logo_partial' ),\n\t\t\t\t'container_inclusive' => true,\n\t\t\t)\n\t\t);\n\n\t\t/* Colors */\n\n\t\t$this->add_section(\n\t\t\t'colors',\n\t\t\tarray(\n\t\t\t\t'title'    => __( 'Colors' ),\n\t\t\t\t'priority' => 40,\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\t'header_textcolor',\n\t\t\tarray(\n\t\t\t\t'theme_supports'       => array( 'custom-header', 'header-text' ),\n\t\t\t\t'default'              => get_theme_support( 'custom-header', 'default-text-color' ),\n\n\t\t\t\t'sanitize_callback'    => array( $this, '_sanitize_header_textcolor' ),\n\t\t\t\t'sanitize_js_callback' => 'maybe_hash_hex_color',\n\t\t\t)\n\t\t);\n\n\t\t// Input type: checkbox.\n\t\t// With custom value.\n\t\t$this->add_control(\n\t\t\t'display_header_text',\n\t\t\tarray(\n\t\t\t\t'settings' => 'header_textcolor',\n\t\t\t\t'label'    => __( 'Display Site Title and Tagline' ),\n\t\t\t\t'section'  => 'title_tagline',\n\t\t\t\t'type'     => 'checkbox',\n\t\t\t\t'priority' => 40,\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\tnew WP_Customize_Color_Control(\n\t\t\t\t$this,\n\t\t\t\t'header_textcolor',\n\t\t\t\tarray(\n\t\t\t\t\t'label'   => __( 'Header Text Color' ),\n\t\t\t\t\t'section' => 'colors',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t// Input type: color.\n\t\t// With sanitize_callback.\n\t\t$this->add_setting(\n\t\t\t'background_color',\n\t\t\tarray(\n\t\t\t\t'default'              => get_theme_support( 'custom-background', 'default-color' ),\n\t\t\t\t'theme_supports'       => 'custom-background',\n\n\t\t\t\t'sanitize_callback'    => 'sanitize_hex_color_no_hash',\n\t\t\t\t'sanitize_js_callback' => 'maybe_hash_hex_color',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\tnew WP_Customize_Color_Control(\n\t\t\t\t$this,\n\t\t\t\t'background_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label'   => __( 'Background Color' ),\n\t\t\t\t\t'section' => 'colors',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t/* Custom Header */\n\n\t\tif ( current_theme_supports( 'custom-header', 'video' ) ) {\n\t\t\t$title       = __( 'Header Media' );\n\t\t\t$description = '<p>' . __( 'If you add a video, the image will be used as a fallback while the video loads.' ) . '</p>';\n\n\t\t\t$width  = absint( get_theme_support( 'custom-header', 'width' ) );\n\t\t\t$height = absint( get_theme_support( 'custom-header', 'height' ) );\n\t\t\tif ( $width && $height ) {\n\t\t\t\t$control_description = sprintf(\n\t\t\t\t\t/* translators: 1: .mp4, 2: Header size in pixels. */\n\t\t\t\t\t__( 'Upload your video in %1$s format and minimize its file size for best results. Your theme recommends dimensions of %2$s pixels.' ),\n\t\t\t\t\t'<code>.mp4</code>',\n\t\t\t\t\tsprintf( '<strong>%s &times; %s</strong>', $width, $height )\n\t\t\t\t);\n\t\t\t} elseif ( $width ) {\n\t\t\t\t$control_description = sprintf(\n\t\t\t\t\t/* translators: 1: .mp4, 2: Header width in pixels. */\n\t\t\t\t\t__( 'Upload your video in %1$s format and minimize its file size for best results. Your theme recommends a width of %2$s pixels.' ),\n\t\t\t\t\t'<code>.mp4</code>',\n\t\t\t\t\tsprintf( '<strong>%s</strong>', $width )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$control_description = sprintf(\n\t\t\t\t\t/* translators: 1: .mp4, 2: Header height in pixels. */\n\t\t\t\t\t__( 'Upload your video in %1$s format and minimize its file size for best results. Your theme recommends a height of %2$s pixels.' ),\n\t\t\t\t\t'<code>.mp4</code>',\n\t\t\t\t\tsprintf( '<strong>%s</strong>', $height )\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\t$title               = __( 'Header Image' );\n\t\t\t$description         = '';\n\t\t\t$control_description = '';\n\t\t}\n\n\t\t$this->add_section(\n\t\t\t'header_image',\n\t\t\tarray(\n\t\t\t\t'title'          => $title,\n\t\t\t\t'description'    => $description,\n\t\t\t\t'theme_supports' => 'custom-header',\n\t\t\t\t'priority'       => 60,\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\t'header_video',\n\t\t\tarray(\n\t\t\t\t'theme_supports'    => array( 'custom-header', 'video' ),\n\t\t\t\t'transport'         => 'postMessage',\n\t\t\t\t'sanitize_callback' => 'absint',\n\t\t\t\t'validate_callback' => array( $this, '_validate_header_video' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\t'external_header_video',\n\t\t\tarray(\n\t\t\t\t'theme_supports'    => array( 'custom-header', 'video' ),\n\t\t\t\t'transport'         => 'postMessage',\n\t\t\t\t'sanitize_callback' => array( $this, '_sanitize_external_header_video' ),\n\t\t\t\t'validate_callback' => array( $this, '_validate_external_header_video' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\tnew WP_Customize_Filter_Setting(\n\t\t\t\t$this,\n\t\t\t\t'header_image',\n\t\t\t\tarray(\n\t\t\t\t\t'default'        => sprintf( get_theme_support( 'custom-header', 'default-image' ), get_template_directory_uri(), get_stylesheet_directory_uri() ),\n\t\t\t\t\t'theme_supports' => 'custom-header',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\tnew WP_Customize_Header_Image_Setting(\n\t\t\t\t$this,\n\t\t\t\t'header_image_data',\n\t\t\t\tarray(\n\t\t\t\t\t'theme_supports' => 'custom-header',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t/*\n\t\t * Switch image settings to postMessage when video support is enabled since\n\t\t * it entails that the_custom_header_markup() will be used, and thus selective\n\t\t * refresh can be utilized.\n\t\t */\n\t\tif ( current_theme_supports( 'custom-header', 'video' ) ) {\n\t\t\t$this->get_setting( 'header_image' )->transport      = 'postMessage';\n\t\t\t$this->get_setting( 'header_image_data' )->transport = 'postMessage';\n\t\t}\n\n\t\t$this->add_control(\n\t\t\tnew WP_Customize_Media_Control(\n\t\t\t\t$this,\n\t\t\t\t'header_video',\n\t\t\t\tarray(\n\t\t\t\t\t'theme_supports'  => array( 'custom-header', 'video' ),\n\t\t\t\t\t'label'           => __( 'Header Video' ),\n\t\t\t\t\t'description'     => $control_description,\n\t\t\t\t\t'section'         => 'header_image',\n\t\t\t\t\t'mime_type'       => 'video',\n\t\t\t\t\t'active_callback' => 'is_header_video_active',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'external_header_video',\n\t\t\tarray(\n\t\t\t\t'theme_supports'  => array( 'custom-header', 'video' ),\n\t\t\t\t'type'            => 'url',\n\t\t\t\t'description'     => __( 'Or, enter a YouTube URL:' ),\n\t\t\t\t'section'         => 'header_image',\n\t\t\t\t'active_callback' => 'is_header_video_active',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control( new WP_Customize_Header_Image_Control( $this ) );\n\n\t\t$this->selective_refresh->add_partial(\n\t\t\t'custom_header',\n\t\t\tarray(\n\t\t\t\t'selector'            => '#wp-custom-header',\n\t\t\t\t'render_callback'     => 'the_custom_header_markup',\n\t\t\t\t'settings'            => array( 'header_video', 'external_header_video', 'header_image' ), // The image is used as a video fallback here.\n\t\t\t\t'container_inclusive' => true,\n\t\t\t)\n\t\t);\n\n\t\t/* Custom Background */\n\n\t\t$this->add_section(\n\t\t\t'background_image',\n\t\t\tarray(\n\t\t\t\t'title'          => __( 'Background Image' ),\n\t\t\t\t'theme_supports' => 'custom-background',\n\t\t\t\t'priority'       => 80,\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\t'background_image',\n\t\t\tarray(\n\t\t\t\t'default'           => get_theme_support( 'custom-background', 'default-image' ),\n\t\t\t\t'theme_supports'    => 'custom-background',\n\t\t\t\t'sanitize_callback' => array( $this, '_sanitize_background_setting' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\tnew WP_Customize_Background_Image_Setting(\n\t\t\t\t$this,\n\t\t\t\t'background_image_thumb',\n\t\t\t\tarray(\n\t\t\t\t\t'theme_supports'    => 'custom-background',\n\t\t\t\t\t'sanitize_callback' => array( $this, '_sanitize_background_setting' ),\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control( new WP_Customize_Background_Image_Control( $this ) );\n\n\t\t$this->add_setting(\n\t\t\t'background_preset',\n\t\t\tarray(\n\t\t\t\t'default'           => get_theme_support( 'custom-background', 'default-preset' ),\n\t\t\t\t'theme_supports'    => 'custom-background',\n\t\t\t\t'sanitize_callback' => array( $this, '_sanitize_background_setting' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'background_preset',\n\t\t\tarray(\n\t\t\t\t'label'   => _x( 'Preset', 'Background Preset' ),\n\t\t\t\t'section' => 'background_image',\n\t\t\t\t'type'    => 'select',\n\t\t\t\t'choices' => array(\n\t\t\t\t\t'default' => _x( 'Default', 'Default Preset' ),\n\t\t\t\t\t'fill'    => __( 'Fill Screen' ),\n\t\t\t\t\t'fit'     => __( 'Fit to Screen' ),\n\t\t\t\t\t'repeat'  => _x( 'Repeat', 'Repeat Image' ),\n\t\t\t\t\t'custom'  => _x( 'Custom', 'Custom Preset' ),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\t'background_position_x',\n\t\t\tarray(\n\t\t\t\t'default'           => get_theme_support( 'custom-background', 'default-position-x' ),\n\t\t\t\t'theme_supports'    => 'custom-background',\n\t\t\t\t'sanitize_callback' => array( $this, '_sanitize_background_setting' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\t'background_position_y',\n\t\t\tarray(\n\t\t\t\t'default'           => get_theme_support( 'custom-background', 'default-position-y' ),\n\t\t\t\t'theme_supports'    => 'custom-background',\n\t\t\t\t'sanitize_callback' => array( $this, '_sanitize_background_setting' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\tnew WP_Customize_Background_Position_Control(\n\t\t\t\t$this,\n\t\t\t\t'background_position',\n\t\t\t\tarray(\n\t\t\t\t\t'label'    => __( 'Image Position' ),\n\t\t\t\t\t'section'  => 'background_image',\n\t\t\t\t\t'settings' => array(\n\t\t\t\t\t\t'x' => 'background_position_x',\n\t\t\t\t\t\t'y' => 'background_position_y',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\t'background_size',\n\t\t\tarray(\n\t\t\t\t'default'           => get_theme_support( 'custom-background', 'default-size' ),\n\t\t\t\t'theme_supports'    => 'custom-background',\n\t\t\t\t'sanitize_callback' => array( $this, '_sanitize_background_setting' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'background_size',\n\t\t\tarray(\n\t\t\t\t'label'   => __( 'Image Size' ),\n\t\t\t\t'section' => 'background_image',\n\t\t\t\t'type'    => 'select',\n\t\t\t\t'choices' => array(\n\t\t\t\t\t'auto'    => _x( 'Original', 'Original Size' ),\n\t\t\t\t\t'contain' => __( 'Fit to Screen' ),\n\t\t\t\t\t'cover'   => __( 'Fill Screen' ),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\t'background_repeat',\n\t\t\tarray(\n\t\t\t\t'default'           => get_theme_support( 'custom-background', 'default-repeat' ),\n\t\t\t\t'sanitize_callback' => array( $this, '_sanitize_background_setting' ),\n\t\t\t\t'theme_supports'    => 'custom-background',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'background_repeat',\n\t\t\tarray(\n\t\t\t\t'label'   => __( 'Repeat Background Image' ),\n\t\t\t\t'section' => 'background_image',\n\t\t\t\t'type'    => 'checkbox',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\t'background_attachment',\n\t\t\tarray(\n\t\t\t\t'default'           => get_theme_support( 'custom-background', 'default-attachment' ),\n\t\t\t\t'sanitize_callback' => array( $this, '_sanitize_background_setting' ),\n\t\t\t\t'theme_supports'    => 'custom-background',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'background_attachment',\n\t\t\tarray(\n\t\t\t\t'label'   => __( 'Scroll with Page' ),\n\t\t\t\t'section' => 'background_image',\n\t\t\t\t'type'    => 'checkbox',\n\t\t\t)\n\t\t);\n\n\t\t// If the theme is using the default background callback, we can update\n\t\t// the background CSS using postMessage.\n\t\tif ( get_theme_support( 'custom-background', 'wp-head-callback' ) === '_custom_background_cb' ) {\n\t\t\tforeach ( array( 'color', 'image', 'preset', 'position_x', 'position_y', 'size', 'repeat', 'attachment' ) as $prop ) {\n\t\t\t\t$this->get_setting( 'background_' . $prop )->transport = 'postMessage';\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Static Front Page\n\t\t * See also https://core.trac.wordpress.org/ticket/19627 which introduces the static-front-page theme_support.\n\t\t * The following replicates behavior from options-reading.php.\n\t\t */\n\n\t\t$this->add_section(\n\t\t\t'static_front_page',\n\t\t\tarray(\n\t\t\t\t'title'           => __( 'Homepage Settings' ),\n\t\t\t\t'priority'        => 120,\n\t\t\t\t'description'     => __( 'You can choose what&#8217;s displayed on the homepage of your site. It can be posts in reverse chronological order (classic blog), or a fixed/static page. To set a static homepage, you first need to create two Pages. One will become the homepage, and the other will be where your posts are displayed.' ),\n\t\t\t\t'active_callback' => array( $this, 'has_published_pages' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\t'show_on_front',\n\t\t\tarray(\n\t\t\t\t'default'    => get_option( 'show_on_front' ),\n\t\t\t\t'capability' => 'manage_options',\n\t\t\t\t'type'       => 'option',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'show_on_front',\n\t\t\tarray(\n\t\t\t\t'label'   => __( 'Your homepage displays' ),\n\t\t\t\t'section' => 'static_front_page',\n\t\t\t\t'type'    => 'radio',\n\t\t\t\t'choices' => array(\n\t\t\t\t\t'posts' => __( 'Your latest posts' ),\n\t\t\t\t\t'page'  => __( 'A static page' ),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\t'page_on_front',\n\t\t\tarray(\n\t\t\t\t'type'       => 'option',\n\t\t\t\t'capability' => 'manage_options',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'page_on_front',\n\t\t\tarray(\n\t\t\t\t'label'          => __( 'Homepage' ),\n\t\t\t\t'section'        => 'static_front_page',\n\t\t\t\t'type'           => 'dropdown-pages',\n\t\t\t\t'allow_addition' => true,\n\t\t\t)\n\t\t);\n\n\t\t$this->add_setting(\n\t\t\t'page_for_posts',\n\t\t\tarray(\n\t\t\t\t'type'       => 'option',\n\t\t\t\t'capability' => 'manage_options',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'page_for_posts',\n\t\t\tarray(\n\t\t\t\t'label'          => __( 'Posts page' ),\n\t\t\t\t'section'        => 'static_front_page',\n\t\t\t\t'type'           => 'dropdown-pages',\n\t\t\t\t'allow_addition' => true,\n\t\t\t)\n\t\t);\n\n\t\t/* Custom CSS */\n\t\t$section_description  = '<p>';\n\t\t$section_description .= __( 'Add your own CSS code here to customize the appearance and layout of your site.' );\n\t\t$section_description .= sprintf(\n\t\t\t' <a href=\"%1$s\" class=\"external-link\" target=\"_blank\">%2$s<span class=\"screen-reader-text\"> %3$s</span></a>',\n\t\t\tesc_url( __( 'https://codex.wordpress.org/CSS' ) ),\n\t\t\t__( 'Learn more about CSS' ),\n\t\t\t/* translators: Accessibility text. */\n\t\t\t__( '(opens in a new tab)' )\n\t\t);\n\t\t$section_description .= '</p>';\n\n\t\t$section_description .= '<p id=\"editor-keyboard-trap-help-1\">' . __( 'When using a keyboard to navigate:' ) . '</p>';\n\t\t$section_description .= '<ul>';\n\t\t$section_description .= '<li id=\"editor-keyboard-trap-help-2\">' . __( 'In the editing area, the Tab key enters a tab character.' ) . '</li>';\n\t\t$section_description .= '<li id=\"editor-keyboard-trap-help-3\">' . __( 'To move away from this area, press the Esc key followed by the Tab key.' ) . '</li>';\n\t\t$section_description .= '<li id=\"editor-keyboard-trap-help-4\">' . __( 'Screen reader users: when in forms mode, you may need to press the Esc key twice.' ) . '</li>';\n\t\t$section_description .= '</ul>';\n\n\t\tif ( 'false' !== wp_get_current_user()->syntax_highlighting ) {\n\t\t\t$section_description .= '<p>';\n\t\t\t$section_description .= sprintf(\n\t\t\t\t/* translators: 1: Link to user profile, 2: Additional link attributes, 3: Accessibility text. */\n\t\t\t\t__( 'The edit field automatically highlights code syntax. You can disable this in your <a href=\"%1$s\" %2$s>user profile%3$s</a> to work in plain text mode.' ),\n\t\t\t\tesc_url( get_edit_profile_url() ),\n\t\t\t\t'class=\"external-link\" target=\"_blank\"',\n\t\t\t\tsprintf(\n\t\t\t\t\t'<span class=\"screen-reader-text\"> %s</span>',\n\t\t\t\t\t/* translators: Accessibility text. */\n\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t)\n\t\t\t);\n\t\t\t$section_description .= '</p>';\n\t\t}\n\n\t\t$section_description .= '<p class=\"section-description-buttons\">';\n\t\t$section_description .= '<button type=\"button\" class=\"button-link section-description-close\">' . __( 'Close' ) . '</button>';\n\t\t$section_description .= '</p>';\n\n\t\t$this->add_section(\n\t\t\t'custom_css',\n\t\t\tarray(\n\t\t\t\t'title'              => __( 'Additional CSS' ),\n\t\t\t\t'priority'           => 200,\n\t\t\t\t'description_hidden' => true,\n\t\t\t\t'description'        => $section_description,\n\t\t\t)\n\t\t);\n\n\t\t$custom_css_setting = new WP_Customize_Custom_CSS_Setting(\n\t\t\t$this,\n\t\t\tsprintf( 'custom_css[%s]', get_stylesheet() ),\n\t\t\tarray(\n\t\t\t\t'capability' => 'edit_css',\n\t\t\t\t'default'    => '',\n\t\t\t)\n\t\t);\n\t\t$this->add_setting( $custom_css_setting );\n\n\t\t$this->add_control(\n\t\t\tnew WP_Customize_Code_Editor_Control(\n\t\t\t\t$this,\n\t\t\t\t'custom_css',\n\t\t\t\tarray(\n\t\t\t\t\t'label'       => __( 'CSS code' ),\n\t\t\t\t\t'section'     => 'custom_css',\n\t\t\t\t\t'settings'    => array( 'default' => $custom_css_setting->id ),\n\t\t\t\t\t'code_type'   => 'text/css',\n\t\t\t\t\t'input_attrs' => array(\n\t\t\t\t\t\t'aria-describedby' => 'editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Return whether there are published pages.\n\t *\n\t * Used as active callback for static front page section and controls.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return bool Whether there are published (or to be published) pages.\n\t */\n\tpublic function has_published_pages() {\n\n\t\t$setting = $this->get_setting( 'nav_menus_created_posts' );\n\t\tif ( $setting ) {\n\t\t\tforeach ( $setting->value() as $post_id ) {\n\t\t\t\tif ( 'page' === get_post_type( $post_id ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0 !== count( get_pages() );\n\t}\n\n\t/**\n\t * Add settings from the POST data that were not added with code, e.g. dynamically-created settings for Widgets\n\t *\n\t * @since 4.2.0\n\t *\n\t * @see add_dynamic_settings()\n\t */\n\tpublic function register_dynamic_settings() {\n\t\t$setting_ids = array_keys( $this->unsanitized_post_values() );\n\t\t$this->add_dynamic_settings( $setting_ids );\n\t}\n\n\t/**\n\t * Load themes into the theme browsing/installation UI.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic function handle_load_themes_request() {\n\t\tcheck_ajax_referer( 'switch_themes', 'nonce' );\n\n\t\tif ( ! current_user_can( 'switch_themes' ) ) {\n\t\t\twp_die( -1 );\n\t\t}\n\n\t\tif ( empty( $_POST['theme_action'] ) ) {\n\t\t\twp_send_json_error( 'missing_theme_action' );\n\t\t}\n\t\t$theme_action = sanitize_key( $_POST['theme_action'] );\n\t\t$themes       = array();\n\t\t$args         = array();\n\n\t\t// Define query filters based on user input.\n\t\tif ( ! array_key_exists( 'search', $_POST ) ) {\n\t\t\t$args['search'] = '';\n\t\t} else {\n\t\t\t$args['search'] = sanitize_text_field( wp_unslash( $_POST['search'] ) );\n\t\t}\n\n\t\tif ( ! array_key_exists( 'tags', $_POST ) ) {\n\t\t\t$args['tag'] = '';\n\t\t} else {\n\t\t\t$args['tag'] = array_map( 'sanitize_text_field', wp_unslash( (array) $_POST['tags'] ) );\n\t\t}\n\n\t\tif ( ! array_key_exists( 'page', $_POST ) ) {\n\t\t\t$args['page'] = 1;\n\t\t} else {\n\t\t\t$args['page'] = absint( $_POST['page'] );\n\t\t}\n\n\t\trequire_once ABSPATH . 'wp-admin/includes/theme.php';\n\n\t\tif ( 'installed' === $theme_action ) {\n\n\t\t\t// Load all installed themes from wp_prepare_themes_for_js().\n\t\t\t$themes = array( 'themes' => wp_prepare_themes_for_js() );\n\t\t\tforeach ( $themes['themes'] as &$theme ) {\n\t\t\t\t$theme['type']   = 'installed';\n\t\t\t\t$theme['active'] = ( isset( $_POST['customized_theme'] ) && $_POST['customized_theme'] === $theme['id'] );\n\t\t\t}\n\t\t} elseif ( 'wporg' === $theme_action ) {\n\n\t\t\t// Load WordPress.org themes from the .org API and normalize data to match installed theme objects.\n\t\t\tif ( ! current_user_can( 'install_themes' ) ) {\n\t\t\t\twp_die( -1 );\n\t\t\t}\n\n\t\t\t// Arguments for all queries.\n\t\t\t$wporg_args = array(\n\t\t\t\t'per_page' => 100,\n\t\t\t\t'fields'   => array(\n\t\t\t\t\t'reviews_url' => true, // Explicitly request the reviews URL to be linked from the customizer.\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t$args = array_merge( $wporg_args, $args );\n\n\t\t\tif ( '' === $args['search'] && '' === $args['tag'] ) {\n\t\t\t\t$args['browse'] = 'new'; // Sort by latest themes by default.\n\t\t\t}\n\n\t\t\t// Load themes from the .org API.\n\t\t\t$themes = themes_api( 'query_themes', $args );\n\t\t\tif ( is_wp_error( $themes ) ) {\n\t\t\t\twp_send_json_error();\n\t\t\t}\n\n\t\t\t// This list matches the allowed tags in wp-admin/includes/theme-install.php.\n\t\t\t$themes_allowedtags                     = array_fill_keys(\n\t\t\t\tarray( 'a', 'abbr', 'acronym', 'code', 'pre', 'em', 'strong', 'div', 'p', 'ul', 'ol', 'li', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'img' ),\n\t\t\t\tarray()\n\t\t\t);\n\t\t\t$themes_allowedtags['a']                = array_fill_keys( array( 'href', 'title', 'target' ), true );\n\t\t\t$themes_allowedtags['acronym']['title'] = true;\n\t\t\t$themes_allowedtags['abbr']['title']    = true;\n\t\t\t$themes_allowedtags['img']              = array_fill_keys( array( 'src', 'class', 'alt' ), true );\n\n\t\t\t// Prepare a list of installed themes to check against before the loop.\n\t\t\t$installed_themes = array();\n\t\t\t$wp_themes        = wp_get_themes();\n\t\t\tforeach ( $wp_themes as $theme ) {\n\t\t\t\t$installed_themes[] = $theme->get_stylesheet();\n\t\t\t}\n\t\t\t$update_php = network_admin_url( 'update.php?action=install-theme' );\n\n\t\t\t// Set up properties for themes available on WordPress.org.\n\t\t\tforeach ( $themes->themes as &$theme ) {\n\t\t\t\t$theme->install_url = add_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'theme'    => $theme->slug,\n\t\t\t\t\t\t'_wpnonce' => wp_create_nonce( 'install-theme_' . $theme->slug ),\n\t\t\t\t\t),\n\t\t\t\t\t$update_php\n\t\t\t\t);\n\n\t\t\t\t$theme->name        = wp_kses( $theme->name, $themes_allowedtags );\n\t\t\t\t$theme->version     = wp_kses( $theme->version, $themes_allowedtags );\n\t\t\t\t$theme->description = wp_kses( $theme->description, $themes_allowedtags );\n\t\t\t\t$theme->stars       = wp_star_rating(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'rating' => $theme->rating,\n\t\t\t\t\t\t'type'   => 'percent',\n\t\t\t\t\t\t'number' => $theme->num_ratings,\n\t\t\t\t\t\t'echo'   => false,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$theme->num_ratings = number_format_i18n( $theme->num_ratings );\n\t\t\t\t$theme->preview_url = set_url_scheme( $theme->preview_url );\n\n\t\t\t\t// Handle themes that are already installed as installed themes.\n\t\t\t\tif ( in_array( $theme->slug, $installed_themes, true ) ) {\n\t\t\t\t\t$theme->type = 'installed';\n\t\t\t\t} else {\n\t\t\t\t\t$theme->type = $theme_action;\n\t\t\t\t}\n\n\t\t\t\t// Set active based on customized theme.\n\t\t\t\t$theme->active = ( isset( $_POST['customized_theme'] ) && $_POST['customized_theme'] === $theme->slug );\n\n\t\t\t\t// Map available theme properties to installed theme properties.\n\t\t\t\t$theme->id            = $theme->slug;\n\t\t\t\t$theme->screenshot    = array( $theme->screenshot_url );\n\t\t\t\t$theme->authorAndUri  = wp_kses( $theme->author['display_name'], $themes_allowedtags );\n\t\t\t\t$theme->compatibleWP  = is_wp_version_compatible( $theme->requires ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName\n\t\t\t\t$theme->compatiblePHP = is_php_version_compatible( $theme->requires_php ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName\n\n\t\t\t\tif ( isset( $theme->parent ) ) {\n\t\t\t\t\t$theme->parent = $theme->parent['slug'];\n\t\t\t\t} else {\n\t\t\t\t\t$theme->parent = false;\n\t\t\t\t}\n\t\t\t\tunset( $theme->slug );\n\t\t\t\tunset( $theme->screenshot_url );\n\t\t\t\tunset( $theme->author );\n\t\t\t} // End foreach().\n\t\t} // End if().\n\n\t\t/**\n\t\t * Filters the theme data loaded in the customizer.\n\t\t *\n\t\t * This allows theme data to be loading from an external source,\n\t\t * or modification of data loaded from `wp_prepare_themes_for_js()`\n\t\t * or WordPress.org via `themes_api()`.\n\t\t *\n\t\t * @since 4.9.0\n\t\t *\n\t\t * @see wp_prepare_themes_for_js()\n\t\t * @see themes_api()\n\t\t * @see WP_Customize_Manager::__construct()\n\t\t *\n\t\t * @param array                $themes  Nested array of theme data.\n\t\t * @param array                $args    List of arguments, such as page, search term, and tags to query for.\n\t\t * @param WP_Customize_Manager $manager Instance of Customize manager.\n\t\t */\n\t\t$themes = apply_filters( 'customize_load_themes', $themes, $args, $this );\n\n\t\twp_send_json_success( $themes );\n\t}\n\n\n\t/**\n\t * Callback for validating the header_textcolor value.\n\t *\n\t * Accepts 'blank', and otherwise uses sanitize_hex_color_no_hash().\n\t * Returns default text color if hex color is empty.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $color\n\t * @return mixed\n\t */\n\tpublic function _sanitize_header_textcolor( $color ) {\n\t\tif ( 'blank' === $color ) {\n\t\t\treturn 'blank';\n\t\t}\n\n\t\t$color = sanitize_hex_color_no_hash( $color );\n\t\tif ( empty( $color ) ) {\n\t\t\t$color = get_theme_support( 'custom-header', 'default-text-color' );\n\t\t}\n\n\t\treturn $color;\n\t}\n\n\t/**\n\t * Callback for validating a background setting value.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string               $value   Repeat value.\n\t * @param WP_Customize_Setting $setting Setting.\n\t * @return string|WP_Error Background value or validation error.\n\t */\n\tpublic function _sanitize_background_setting( $value, $setting ) {\n\t\tif ( 'background_repeat' === $setting->id ) {\n\t\t\tif ( ! in_array( $value, array( 'repeat-x', 'repeat-y', 'repeat', 'no-repeat' ), true ) ) {\n\t\t\t\treturn new WP_Error( 'invalid_value', __( 'Invalid value for background repeat.' ) );\n\t\t\t}\n\t\t} elseif ( 'background_attachment' === $setting->id ) {\n\t\t\tif ( ! in_array( $value, array( 'fixed', 'scroll' ), true ) ) {\n\t\t\t\treturn new WP_Error( 'invalid_value', __( 'Invalid value for background attachment.' ) );\n\t\t\t}\n\t\t} elseif ( 'background_position_x' === $setting->id ) {\n\t\t\tif ( ! in_array( $value, array( 'left', 'center', 'right' ), true ) ) {\n\t\t\t\treturn new WP_Error( 'invalid_value', __( 'Invalid value for background position X.' ) );\n\t\t\t}\n\t\t} elseif ( 'background_position_y' === $setting->id ) {\n\t\t\tif ( ! in_array( $value, array( 'top', 'center', 'bottom' ), true ) ) {\n\t\t\t\treturn new WP_Error( 'invalid_value', __( 'Invalid value for background position Y.' ) );\n\t\t\t}\n\t\t} elseif ( 'background_size' === $setting->id ) {\n\t\t\tif ( ! in_array( $value, array( 'auto', 'contain', 'cover' ), true ) ) {\n\t\t\t\treturn new WP_Error( 'invalid_value', __( 'Invalid value for background size.' ) );\n\t\t\t}\n\t\t} elseif ( 'background_preset' === $setting->id ) {\n\t\t\tif ( ! in_array( $value, array( 'default', 'fill', 'fit', 'repeat', 'custom' ), true ) ) {\n\t\t\t\treturn new WP_Error( 'invalid_value', __( 'Invalid value for background size.' ) );\n\t\t\t}\n\t\t} elseif ( 'background_image' === $setting->id || 'background_image_thumb' === $setting->id ) {\n\t\t\t$value = empty( $value ) ? '' : esc_url_raw( $value );\n\t\t} else {\n\t\t\treturn new WP_Error( 'unrecognized_setting', __( 'Unrecognized background setting.' ) );\n\t\t}\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Export header video settings to facilitate selective refresh.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array                          $response          Response.\n\t * @param WP_Customize_Selective_Refresh $selective_refresh Selective refresh component.\n\t * @param array                          $partials          Array of partials.\n\t * @return array\n\t */\n\tpublic function export_header_video_settings( $response, $selective_refresh, $partials ) {\n\t\tif ( isset( $partials['custom_header'] ) ) {\n\t\t\t$response['custom_header_settings'] = get_header_video_settings();\n\t\t}\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Callback for validating the header_video value.\n\t *\n\t * Ensures that the selected video is less than 8MB and provides an error message.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Error $validity\n\t * @param mixed    $value\n\t * @return mixed\n\t */\n\tpublic function _validate_header_video( $validity, $value ) {\n\t\t$video = get_attached_file( absint( $value ) );\n\t\tif ( $video ) {\n\t\t\t$size = filesize( $video );\n\t\t\tif ( $size > 8 * MB_IN_BYTES ) {\n\t\t\t\t$validity->add(\n\t\t\t\t\t'size_too_large',\n\t\t\t\t\t__( 'This video file is too large to use as a header video. Try a shorter video or optimize the compression settings and re-upload a file that is less than 8MB. Or, upload your video to YouTube and link it with the option below.' )\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ( '.mp4' !== substr( $video, -4 ) && '.mov' !== substr( $video, -4 ) ) { // Check for .mp4 or .mov format, which (assuming h.264 encoding) are the only cross-browser-supported formats.\n\t\t\t\t$validity->add(\n\t\t\t\t\t'invalid_file_type',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1: .mp4, 2: .mov */\n\t\t\t\t\t\t__( 'Only %1$s or %2$s files may be used for header video. Please convert your video file and try again, or, upload your video to YouTube and link it with the option below.' ),\n\t\t\t\t\t\t'<code>.mp4</code>',\n\t\t\t\t\t\t'<code>.mov</code>'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn $validity;\n\t}\n\n\t/**\n\t * Callback for validating the external_header_video value.\n\t *\n\t * Ensures that the provided URL is supported.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Error $validity\n\t * @param mixed    $value\n\t * @return mixed\n\t */\n\tpublic function _validate_external_header_video( $validity, $value ) {\n\t\t$video = esc_url_raw( $value );\n\t\tif ( $video ) {\n\t\t\tif ( ! preg_match( '#^https?://(?:www\\.)?(?:youtube\\.com/watch|youtu\\.be/)#', $video ) ) {\n\t\t\t\t$validity->add( 'invalid_url', __( 'Please enter a valid YouTube URL.' ) );\n\t\t\t}\n\t\t}\n\t\treturn $validity;\n\t}\n\n\t/**\n\t * Callback for sanitizing the external_header_video value.\n\t *\n\t * @since 4.7.1\n\t *\n\t * @param string $value URL.\n\t * @return string Sanitized URL.\n\t */\n\tpublic function _sanitize_external_header_video( $value ) {\n\t\treturn esc_url_raw( trim( $value ) );\n\t}\n\n\t/**\n\t * Callback for rendering the custom logo, used in the custom_logo partial.\n\t *\n\t * This method exists because the partial object and context data are passed\n\t * into a partial's render_callback so we cannot use get_custom_logo() as\n\t * the render_callback directly since it expects a blog ID as the first\n\t * argument. When WP no longer supports PHP 5.3, this method can be removed\n\t * in favor of an anonymous function.\n\t *\n\t * @see WP_Customize_Manager::register_controls()\n\t *\n\t * @since 4.5.0\n\t *\n\t * @return string Custom logo.\n\t */\n\tpublic function _render_custom_logo_partial() {\n\t\treturn get_custom_logo();\n\t}\n}\n", "num_lines": 6102}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Customize Nav Menus classes\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.3.0\n */\n\n/**\n * Customize Nav Menus class.\n *\n * Implements menu management in the Customizer.\n *\n * @since 4.3.0\n *\n * @see WP_Customize_Manager\n */\nfinal class WP_Customize_Nav_Menus {\n\n\t/**\n\t * WP_Customize_Manager instance.\n\t *\n\t * @since 4.3.0\n\t * @var WP_Customize_Manager\n\t */\n\tpublic $manager;\n\n\t/**\n\t * Original nav menu locations before the theme was switched.\n\t *\n\t * @since 4.9.0\n\t * @var array\n\t */\n\tprotected $original_nav_menu_locations;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t */\n\tpublic function __construct( $manager ) {\n\t\t$this->manager                     = $manager;\n\t\t$this->original_nav_menu_locations = get_nav_menu_locations();\n\n\t\t// See https://github.com/xwp/wp-customize-snapshots/blob/962586659688a5b1fd9ae93618b7ce2d4e7a421c/php/class-customize-snapshot-manager.php#L469-L499\n\t\tadd_action( 'customize_register', array( $this, 'customize_register' ), 11 );\n\t\tadd_filter( 'customize_dynamic_setting_args', array( $this, 'filter_dynamic_setting_args' ), 10, 2 );\n\t\tadd_filter( 'customize_dynamic_setting_class', array( $this, 'filter_dynamic_setting_class' ), 10, 3 );\n\t\tadd_action( 'customize_save_nav_menus_created_posts', array( $this, 'save_nav_menus_created_posts' ) );\n\n\t\t// Skip remaining hooks when the user can't manage nav menus anyway.\n\t\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_filter( 'customize_refresh_nonces', array( $this, 'filter_nonces' ) );\n\t\tadd_action( 'wp_ajax_load-available-menu-items-customizer', array( $this, 'ajax_load_available_items' ) );\n\t\tadd_action( 'wp_ajax_search-available-menu-items-customizer', array( $this, 'ajax_search_available_items' ) );\n\t\tadd_action( 'wp_ajax_customize-nav-menus-insert-auto-draft', array( $this, 'ajax_insert_auto_draft_post' ) );\n\t\tadd_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_scripts' ) );\n\t\tadd_action( 'customize_controls_print_footer_scripts', array( $this, 'print_templates' ) );\n\t\tadd_action( 'customize_controls_print_footer_scripts', array( $this, 'available_items_template' ) );\n\t\tadd_action( 'customize_preview_init', array( $this, 'customize_preview_init' ) );\n\t\tadd_action( 'customize_preview_init', array( $this, 'make_auto_draft_status_previewable' ) );\n\n\t\t// Selective Refresh partials.\n\t\tadd_filter( 'customize_dynamic_partial_args', array( $this, 'customize_dynamic_partial_args' ), 10, 2 );\n\t}\n\n\t/**\n\t * Adds a nonce for customizing menus.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param string[] $nonces Array of nonces.\n\t * @return string[] Modified array of nonces.\n\t */\n\tpublic function filter_nonces( $nonces ) {\n\t\t$nonces['customize-menus'] = wp_create_nonce( 'customize-menus' );\n\t\treturn $nonces;\n\t}\n\n\t/**\n\t * Ajax handler for loading available menu items.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function ajax_load_available_items() {\n\t\tcheck_ajax_referer( 'customize-menus', 'customize-menus-nonce' );\n\n\t\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\t\twp_die( -1 );\n\t\t}\n\n\t\t$all_items  = array();\n\t\t$item_types = array();\n\t\tif ( isset( $_POST['item_types'] ) && is_array( $_POST['item_types'] ) ) {\n\t\t\t$item_types = wp_unslash( $_POST['item_types'] );\n\t\t} elseif ( isset( $_POST['type'] ) && isset( $_POST['object'] ) ) { // Back compat.\n\t\t\t$item_types[] = array(\n\t\t\t\t'type'   => wp_unslash( $_POST['type'] ),\n\t\t\t\t'object' => wp_unslash( $_POST['object'] ),\n\t\t\t\t'page'   => empty( $_POST['page'] ) ? 0 : absint( $_POST['page'] ),\n\t\t\t);\n\t\t} else {\n\t\t\twp_send_json_error( 'nav_menus_missing_type_or_object_parameter' );\n\t\t}\n\n\t\tforeach ( $item_types as $item_type ) {\n\t\t\tif ( empty( $item_type['type'] ) || empty( $item_type['object'] ) ) {\n\t\t\t\twp_send_json_error( 'nav_menus_missing_type_or_object_parameter' );\n\t\t\t}\n\t\t\t$type   = sanitize_key( $item_type['type'] );\n\t\t\t$object = sanitize_key( $item_type['object'] );\n\t\t\t$page   = empty( $item_type['page'] ) ? 0 : absint( $item_type['page'] );\n\t\t\t$items  = $this->load_available_items_query( $type, $object, $page );\n\t\t\tif ( is_wp_error( $items ) ) {\n\t\t\t\twp_send_json_error( $items->get_error_code() );\n\t\t\t}\n\t\t\t$all_items[ $item_type['type'] . ':' . $item_type['object'] ] = $items;\n\t\t}\n\n\t\twp_send_json_success( array( 'items' => $all_items ) );\n\t}\n\n\t/**\n\t * Performs the post_type and taxonomy queries for loading available menu items.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param string $type   Optional. Accepts any custom object type and has built-in support for\n\t *                         'post_type' and 'taxonomy'. Default is 'post_type'.\n\t * @param string $object Optional. Accepts any registered taxonomy or post type name. Default is 'page'.\n\t * @param int    $page   Optional. The page number used to generate the query offset. Default is '0'.\n\t * @return array|WP_Error An array of menu items on success, a WP_Error object on failure.\n\t */\n\tpublic function load_available_items_query( $type = 'post_type', $object = 'page', $page = 0 ) {\n\t\t$items = array();\n\n\t\tif ( 'post_type' === $type ) {\n\t\t\t$post_type = get_post_type_object( $object );\n\t\t\tif ( ! $post_type ) {\n\t\t\t\treturn new WP_Error( 'nav_menus_invalid_post_type' );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * If we're dealing with pages, let's prioritize the Front Page,\n\t\t\t * Posts Page and Privacy Policy Page at the top of the list.\n\t\t\t */\n\t\t\t$important_pages   = array();\n\t\t\t$suppress_page_ids = array();\n\t\t\tif ( 0 === $page && 'page' === $object ) {\n\t\t\t\t// Insert Front Page or custom \"Home\" link.\n\t\t\t\t$front_page = 'page' === get_option( 'show_on_front' ) ? (int) get_option( 'page_on_front' ) : 0;\n\t\t\t\tif ( ! empty( $front_page ) ) {\n\t\t\t\t\t$front_page_obj      = get_post( $front_page );\n\t\t\t\t\t$important_pages[]   = $front_page_obj;\n\t\t\t\t\t$suppress_page_ids[] = $front_page_obj->ID;\n\t\t\t\t} else {\n\t\t\t\t\t// Add \"Home\" link. Treat as a page, but switch to custom on add.\n\t\t\t\t\t$items[] = array(\n\t\t\t\t\t\t'id'         => 'home',\n\t\t\t\t\t\t'title'      => _x( 'Home', 'nav menu home label' ),\n\t\t\t\t\t\t'type'       => 'custom',\n\t\t\t\t\t\t'type_label' => __( 'Custom Link' ),\n\t\t\t\t\t\t'object'     => '',\n\t\t\t\t\t\t'url'        => home_url(),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Insert Posts Page.\n\t\t\t\t$posts_page = 'page' === get_option( 'show_on_front' ) ? (int) get_option( 'page_for_posts' ) : 0;\n\t\t\t\tif ( ! empty( $posts_page ) ) {\n\t\t\t\t\t$posts_page_obj      = get_post( $posts_page );\n\t\t\t\t\t$important_pages[]   = $posts_page_obj;\n\t\t\t\t\t$suppress_page_ids[] = $posts_page_obj->ID;\n\t\t\t\t}\n\n\t\t\t\t// Insert Privacy Policy Page.\n\t\t\t\t$privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );\n\t\t\t\tif ( ! empty( $privacy_policy_page_id ) ) {\n\t\t\t\t\t$privacy_policy_page = get_post( $privacy_policy_page_id );\n\t\t\t\t\tif ( $privacy_policy_page instanceof WP_Post && 'publish' === $privacy_policy_page->post_status ) {\n\t\t\t\t\t\t$important_pages[]   = $privacy_policy_page;\n\t\t\t\t\t\t$suppress_page_ids[] = $privacy_policy_page->ID;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif ( 'post' !== $object && 0 === $page && $post_type->has_archive ) {\n\t\t\t\t// Add a post type archive link.\n\t\t\t\t$items[] = array(\n\t\t\t\t\t'id'         => $object . '-archive',\n\t\t\t\t\t'title'      => $post_type->labels->archives,\n\t\t\t\t\t'type'       => 'post_type_archive',\n\t\t\t\t\t'type_label' => __( 'Post Type Archive' ),\n\t\t\t\t\t'object'     => $object,\n\t\t\t\t\t'url'        => get_post_type_archive_link( $object ),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Prepend posts with nav_menus_created_posts on first page.\n\t\t\t$posts = array();\n\t\t\tif ( 0 === $page && $this->manager->get_setting( 'nav_menus_created_posts' ) ) {\n\t\t\t\tforeach ( $this->manager->get_setting( 'nav_menus_created_posts' )->value() as $post_id ) {\n\t\t\t\t\t$auto_draft_post = get_post( $post_id );\n\t\t\t\t\tif ( $post_type->name === $auto_draft_post->post_type ) {\n\t\t\t\t\t\t$posts[] = $auto_draft_post;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$args = array(\n\t\t\t\t'numberposts' => 10,\n\t\t\t\t'offset'      => 10 * $page,\n\t\t\t\t'orderby'     => 'date',\n\t\t\t\t'order'       => 'DESC',\n\t\t\t\t'post_type'   => $object,\n\t\t\t);\n\n\t\t\t// Add suppression array to arguments for get_posts.\n\t\t\tif ( ! empty( $suppress_page_ids ) ) {\n\t\t\t\t$args['post__not_in'] = $suppress_page_ids;\n\t\t\t}\n\n\t\t\t$posts = array_merge(\n\t\t\t\t$posts,\n\t\t\t\t$important_pages,\n\t\t\t\tget_posts( $args )\n\t\t\t);\n\n\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t$post_title = $post->post_title;\n\t\t\t\tif ( '' === $post_title ) {\n\t\t\t\t\t/* translators: %d: ID of a post. */\n\t\t\t\t\t$post_title = sprintf( __( '#%d (no title)' ), $post->ID );\n\t\t\t\t}\n\n\t\t\t\t$post_type_label = get_post_type_object( $post->post_type )->labels->singular_name;\n\t\t\t\t$post_states     = get_post_states( $post );\n\t\t\t\tif ( ! empty( $post_states ) ) {\n\t\t\t\t\t$post_type_label = implode( ',', $post_states );\n\t\t\t\t}\n\n\t\t\t\t$items[] = array(\n\t\t\t\t\t'id'         => \"post-{$post->ID}\",\n\t\t\t\t\t'title'      => html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) ),\n\t\t\t\t\t'type'       => 'post_type',\n\t\t\t\t\t'type_label' => $post_type_label,\n\t\t\t\t\t'object'     => $post->post_type,\n\t\t\t\t\t'object_id'  => intval( $post->ID ),\n\t\t\t\t\t'url'        => get_permalink( intval( $post->ID ) ),\n\t\t\t\t);\n\t\t\t}\n\t\t} elseif ( 'taxonomy' === $type ) {\n\t\t\t$terms = get_terms(\n\t\t\t\tarray(\n\t\t\t\t\t'taxonomy'     => $object,\n\t\t\t\t\t'child_of'     => 0,\n\t\t\t\t\t'exclude'      => '',\n\t\t\t\t\t'hide_empty'   => false,\n\t\t\t\t\t'hierarchical' => 1,\n\t\t\t\t\t'include'      => '',\n\t\t\t\t\t'number'       => 10,\n\t\t\t\t\t'offset'       => 10 * $page,\n\t\t\t\t\t'order'        => 'DESC',\n\t\t\t\t\t'orderby'      => 'count',\n\t\t\t\t\t'pad_counts'   => false,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( is_wp_error( $terms ) ) {\n\t\t\t\treturn $terms;\n\t\t\t}\n\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$items[] = array(\n\t\t\t\t\t'id'         => \"term-{$term->term_id}\",\n\t\t\t\t\t'title'      => html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) ),\n\t\t\t\t\t'type'       => 'taxonomy',\n\t\t\t\t\t'type_label' => get_taxonomy( $term->taxonomy )->labels->singular_name,\n\t\t\t\t\t'object'     => $term->taxonomy,\n\t\t\t\t\t'object_id'  => intval( $term->term_id ),\n\t\t\t\t\t'url'        => get_term_link( intval( $term->term_id ), $term->taxonomy ),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the available menu items.\n\t\t *\n\t\t * @since 4.3.0\n\t\t *\n\t\t * @param array  $items  The array of menu items.\n\t\t * @param string $type   The object type.\n\t\t * @param string $object The object name.\n\t\t * @param int    $page   The current page number.\n\t\t */\n\t\t$items = apply_filters( 'customize_nav_menu_available_items', $items, $type, $object, $page );\n\n\t\treturn $items;\n\t}\n\n\t/**\n\t * Ajax handler for searching available menu items.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function ajax_search_available_items() {\n\t\tcheck_ajax_referer( 'customize-menus', 'customize-menus-nonce' );\n\n\t\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\t\twp_die( -1 );\n\t\t}\n\n\t\tif ( empty( $_POST['search'] ) ) {\n\t\t\twp_send_json_error( 'nav_menus_missing_search_parameter' );\n\t\t}\n\n\t\t$p = isset( $_POST['page'] ) ? absint( $_POST['page'] ) : 0;\n\t\tif ( $p < 1 ) {\n\t\t\t$p = 1;\n\t\t}\n\n\t\t$s     = sanitize_text_field( wp_unslash( $_POST['search'] ) );\n\t\t$items = $this->search_available_items_query(\n\t\t\tarray(\n\t\t\t\t'pagenum' => $p,\n\t\t\t\t's'       => $s,\n\t\t\t)\n\t\t);\n\n\t\tif ( empty( $items ) ) {\n\t\t\twp_send_json_error( array( 'message' => __( 'No results found.' ) ) );\n\t\t} else {\n\t\t\twp_send_json_success( array( 'items' => $items ) );\n\t\t}\n\t}\n\n\t/**\n\t * Performs post queries for available-item searching.\n\t *\n\t * Based on WP_Editor::wp_link_query().\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param array $args Optional. Accepts 'pagenum' and 's' (search) arguments.\n\t * @return array Menu items.\n\t */\n\tpublic function search_available_items_query( $args = array() ) {\n\t\t$items = array();\n\n\t\t$post_type_objects = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' );\n\t\t$query             = array(\n\t\t\t'post_type'              => array_keys( $post_type_objects ),\n\t\t\t'suppress_filters'       => true,\n\t\t\t'update_post_term_cache' => false,\n\t\t\t'update_post_meta_cache' => false,\n\t\t\t'post_status'            => 'publish',\n\t\t\t'posts_per_page'         => 20,\n\t\t);\n\n\t\t$args['pagenum'] = isset( $args['pagenum'] ) ? absint( $args['pagenum'] ) : 1;\n\t\t$query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0;\n\n\t\tif ( isset( $args['s'] ) ) {\n\t\t\t$query['s'] = $args['s'];\n\t\t}\n\n\t\t$posts = array();\n\n\t\t// Prepend list of posts with nav_menus_created_posts search results on first page.\n\t\t$nav_menus_created_posts_setting = $this->manager->get_setting( 'nav_menus_created_posts' );\n\t\tif ( 1 === $args['pagenum'] && $nav_menus_created_posts_setting && count( $nav_menus_created_posts_setting->value() ) > 0 ) {\n\t\t\t$stub_post_query = new WP_Query(\n\t\t\t\tarray_merge(\n\t\t\t\t\t$query,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_status'    => 'auto-draft',\n\t\t\t\t\t\t'post__in'       => $nav_menus_created_posts_setting->value(),\n\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\t$posts           = array_merge( $posts, $stub_post_query->posts );\n\t\t}\n\n\t\t// Query posts.\n\t\t$get_posts = new WP_Query( $query );\n\t\t$posts     = array_merge( $posts, $get_posts->posts );\n\n\t\t// Create items for posts.\n\t\tforeach ( $posts as $post ) {\n\t\t\t$post_title = $post->post_title;\n\t\t\tif ( '' === $post_title ) {\n\t\t\t\t/* translators: %d: ID of a post. */\n\t\t\t\t$post_title = sprintf( __( '#%d (no title)' ), $post->ID );\n\t\t\t}\n\n\t\t\t$post_type_label = $post_type_objects[ $post->post_type ]->labels->singular_name;\n\t\t\t$post_states     = get_post_states( $post );\n\t\t\tif ( ! empty( $post_states ) ) {\n\t\t\t\t$post_type_label = implode( ',', $post_states );\n\t\t\t}\n\n\t\t\t$items[] = array(\n\t\t\t\t'id'         => 'post-' . $post->ID,\n\t\t\t\t'title'      => html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) ),\n\t\t\t\t'type'       => 'post_type',\n\t\t\t\t'type_label' => $post_type_label,\n\t\t\t\t'object'     => $post->post_type,\n\t\t\t\t'object_id'  => intval( $post->ID ),\n\t\t\t\t'url'        => get_permalink( intval( $post->ID ) ),\n\t\t\t);\n\t\t}\n\n\t\t// Query taxonomy terms.\n\t\t$taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'names' );\n\t\t$terms      = get_terms(\n\t\t\tarray(\n\t\t\t\t'taxonomies' => $taxonomies,\n\t\t\t\t'name__like' => $args['s'],\n\t\t\t\t'number'     => 20,\n\t\t\t\t'hide_empty' => false,\n\t\t\t\t'offset'     => 20 * ( $args['pagenum'] - 1 ),\n\t\t\t)\n\t\t);\n\n\t\t// Check if any taxonomies were found.\n\t\tif ( ! empty( $terms ) ) {\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$items[] = array(\n\t\t\t\t\t'id'         => 'term-' . $term->term_id,\n\t\t\t\t\t'title'      => html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) ),\n\t\t\t\t\t'type'       => 'taxonomy',\n\t\t\t\t\t'type_label' => get_taxonomy( $term->taxonomy )->labels->singular_name,\n\t\t\t\t\t'object'     => $term->taxonomy,\n\t\t\t\t\t'object_id'  => intval( $term->term_id ),\n\t\t\t\t\t'url'        => get_term_link( intval( $term->term_id ), $term->taxonomy ),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Add \"Home\" link if search term matches. Treat as a page, but switch to custom on add.\n\t\tif ( isset( $args['s'] ) ) {\n\t\t\t// Only insert custom \"Home\" link if there's no Front Page\n\t\t\t$front_page = 'page' === get_option( 'show_on_front' ) ? (int) get_option( 'page_on_front' ) : 0;\n\t\t\tif ( empty( $front_page ) ) {\n\t\t\t\t$title   = _x( 'Home', 'nav menu home label' );\n\t\t\t\t$matches = function_exists( 'mb_stripos' ) ? false !== mb_stripos( $title, $args['s'] ) : false !== stripos( $title, $args['s'] );\n\t\t\t\tif ( $matches ) {\n\t\t\t\t\t$items[] = array(\n\t\t\t\t\t\t'id'         => 'home',\n\t\t\t\t\t\t'title'      => $title,\n\t\t\t\t\t\t'type'       => 'custom',\n\t\t\t\t\t\t'type_label' => __( 'Custom Link' ),\n\t\t\t\t\t\t'object'     => '',\n\t\t\t\t\t\t'url'        => home_url(),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the available menu items during a search request.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @param array $items The array of menu items.\n\t\t * @param array $args  Includes 'pagenum' and 's' (search) arguments.\n\t\t */\n\t\t$items = apply_filters( 'customize_nav_menu_searched_items', $items, $args );\n\n\t\treturn $items;\n\t}\n\n\t/**\n\t * Enqueue scripts and styles for Customizer pane.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function enqueue_scripts() {\n\t\twp_enqueue_style( 'customize-nav-menus' );\n\t\twp_enqueue_script( 'customize-nav-menus' );\n\n\t\t$temp_nav_menu_setting      = new WP_Customize_Nav_Menu_Setting( $this->manager, 'nav_menu[-1]' );\n\t\t$temp_nav_menu_item_setting = new WP_Customize_Nav_Menu_Item_Setting( $this->manager, 'nav_menu_item[-1]' );\n\n\t\t$num_locations = count( get_registered_nav_menus() );\n\t\tif ( 1 === $num_locations ) {\n\t\t\t$locations_description = __( 'Your theme can display menus in one location.' );\n\t\t} else {\n\t\t\t/* translators: %s: Number of menu locations. */\n\t\t\t$locations_description = sprintf( _n( 'Your theme can display menus in %s location.', 'Your theme can display menus in %s locations.', $num_locations ), number_format_i18n( $num_locations ) );\n\t\t}\n\n\t\t// Pass data to JS.\n\t\t$settings = array(\n\t\t\t'allMenus'                 => wp_get_nav_menus(),\n\t\t\t'itemTypes'                => $this->available_item_types(),\n\t\t\t'l10n'                     => array(\n\t\t\t\t'untitled'               => _x( '(no label)', 'missing menu item navigation label' ),\n\t\t\t\t'unnamed'                => _x( '(unnamed)', 'Missing menu name.' ),\n\t\t\t\t'custom_label'           => __( 'Custom Link' ),\n\t\t\t\t'page_label'             => get_post_type_object( 'page' )->labels->singular_name,\n\t\t\t\t/* translators: %s: Menu location. */\n\t\t\t\t'menuLocation'           => _x( '(Currently set to: %s)', 'menu' ),\n\t\t\t\t'locationsTitle'         => 1 === $num_locations ? __( 'Menu Location' ) : __( 'Menu Locations' ),\n\t\t\t\t'locationsDescription'   => $locations_description,\n\t\t\t\t'menuNameLabel'          => __( 'Menu Name' ),\n\t\t\t\t'newMenuNameDescription' => __( 'If your theme has multiple menus, giving them clear names will help you manage them.' ),\n\t\t\t\t'itemAdded'              => __( 'Menu item added' ),\n\t\t\t\t'itemDeleted'            => __( 'Menu item deleted' ),\n\t\t\t\t'menuAdded'              => __( 'Menu created' ),\n\t\t\t\t'menuDeleted'            => __( 'Menu deleted' ),\n\t\t\t\t'movedUp'                => __( 'Menu item moved up' ),\n\t\t\t\t'movedDown'              => __( 'Menu item moved down' ),\n\t\t\t\t'movedLeft'              => __( 'Menu item moved out of submenu' ),\n\t\t\t\t'movedRight'             => __( 'Menu item is now a sub-item' ),\n\t\t\t\t/* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */\n\t\t\t\t'customizingMenus'       => sprintf( __( 'Customizing &#9656; %s' ), esc_html( $this->manager->get_panel( 'nav_menus' )->title ) ),\n\t\t\t\t/* translators: %s: Title of an invalid menu item. */\n\t\t\t\t'invalidTitleTpl'        => __( '%s (Invalid)' ),\n\t\t\t\t/* translators: %s: Title of a menu item in draft status. */\n\t\t\t\t'pendingTitleTpl'        => __( '%s (Pending)' ),\n\t\t\t\t/* translators: %d: Number of menu items found. */\n\t\t\t\t'itemsFound'             => __( 'Number of items found: %d' ),\n\t\t\t\t/* translators: %d: Number of additional menu items found. */\n\t\t\t\t'itemsFoundMore'         => __( 'Additional items found: %d' ),\n\t\t\t\t'itemsLoadingMore'       => __( 'Loading more results... please wait.' ),\n\t\t\t\t'reorderModeOn'          => __( 'Reorder mode enabled' ),\n\t\t\t\t'reorderModeOff'         => __( 'Reorder mode closed' ),\n\t\t\t\t'reorderLabelOn'         => esc_attr__( 'Reorder menu items' ),\n\t\t\t\t'reorderLabelOff'        => esc_attr__( 'Close reorder mode' ),\n\t\t\t),\n\t\t\t'settingTransport'         => 'postMessage',\n\t\t\t'phpIntMax'                => PHP_INT_MAX,\n\t\t\t'defaultSettingValues'     => array(\n\t\t\t\t'nav_menu'      => $temp_nav_menu_setting->default,\n\t\t\t\t'nav_menu_item' => $temp_nav_menu_item_setting->default,\n\t\t\t),\n\t\t\t'locationSlugMappedToName' => get_registered_nav_menus(),\n\t\t);\n\n\t\t$data = sprintf( 'var _wpCustomizeNavMenusSettings = %s;', wp_json_encode( $settings ) );\n\t\twp_scripts()->add_data( 'customize-nav-menus', 'data', $data );\n\n\t\t// This is copied from nav-menus.php, and it has an unfortunate object name of `menus`.\n\t\t$nav_menus_l10n = array(\n\t\t\t'oneThemeLocationNoMenus' => null,\n\t\t\t'moveUp'                  => __( 'Move up one' ),\n\t\t\t'moveDown'                => __( 'Move down one' ),\n\t\t\t'moveToTop'               => __( 'Move to the top' ),\n\t\t\t/* translators: %s: Previous item name. */\n\t\t\t'moveUnder'               => __( 'Move under %s' ),\n\t\t\t/* translators: %s: Previous item name. */\n\t\t\t'moveOutFrom'             => __( 'Move out from under %s' ),\n\t\t\t/* translators: %s: Previous item name. */\n\t\t\t'under'                   => __( 'Under %s' ),\n\t\t\t/* translators: %s: Previous item name. */\n\t\t\t'outFrom'                 => __( 'Out from under %s' ),\n\t\t\t/* translators: 1: Item name, 2: Item position, 3: Total number of items. */\n\t\t\t'menuFocus'               => __( '%1$s. Menu item %2$d of %3$d.' ),\n\t\t\t/* translators: 1: Item name, 2: Item position, 3: Parent item name. */\n\t\t\t'subMenuFocus'            => __( '%1$s. Sub item number %2$d under %3$s.' ),\n\t\t);\n\t\twp_localize_script( 'nav-menu', 'menus', $nav_menus_l10n );\n\t}\n\n\t/**\n\t * Filters a dynamic setting's constructor args.\n\t *\n\t * For a dynamic setting to be registered, this filter must be employed\n\t * to override the default false value with an array of args to pass to\n\t * the WP_Customize_Setting constructor.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param false|array $setting_args The arguments to the WP_Customize_Setting constructor.\n\t * @param string      $setting_id   ID for dynamic setting, usually coming from `$_POST['customized']`.\n\t * @return array|false\n\t */\n\tpublic function filter_dynamic_setting_args( $setting_args, $setting_id ) {\n\t\tif ( preg_match( WP_Customize_Nav_Menu_Setting::ID_PATTERN, $setting_id ) ) {\n\t\t\t$setting_args = array(\n\t\t\t\t'type'      => WP_Customize_Nav_Menu_Setting::TYPE,\n\t\t\t\t'transport' => 'postMessage',\n\t\t\t);\n\t\t} elseif ( preg_match( WP_Customize_Nav_Menu_Item_Setting::ID_PATTERN, $setting_id ) ) {\n\t\t\t$setting_args = array(\n\t\t\t\t'type'      => WP_Customize_Nav_Menu_Item_Setting::TYPE,\n\t\t\t\t'transport' => 'postMessage',\n\t\t\t);\n\t\t}\n\t\treturn $setting_args;\n\t}\n\n\t/**\n\t * Allow non-statically created settings to be constructed with custom WP_Customize_Setting subclass.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param string $setting_class WP_Customize_Setting or a subclass.\n\t * @param string $setting_id    ID for dynamic setting, usually coming from `$_POST['customized']`.\n\t * @param array  $setting_args  WP_Customize_Setting or a subclass.\n\t * @return string\n\t */\n\tpublic function filter_dynamic_setting_class( $setting_class, $setting_id, $setting_args ) {\n\t\tunset( $setting_id );\n\n\t\tif ( ! empty( $setting_args['type'] ) && WP_Customize_Nav_Menu_Setting::TYPE === $setting_args['type'] ) {\n\t\t\t$setting_class = 'WP_Customize_Nav_Menu_Setting';\n\t\t} elseif ( ! empty( $setting_args['type'] ) && WP_Customize_Nav_Menu_Item_Setting::TYPE === $setting_args['type'] ) {\n\t\t\t$setting_class = 'WP_Customize_Nav_Menu_Item_Setting';\n\t\t}\n\t\treturn $setting_class;\n\t}\n\n\t/**\n\t * Add the customizer settings and controls.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function customize_register() {\n\t\t$changeset = $this->manager->unsanitized_post_values();\n\n\t\t// Preview settings for nav menus early so that the sections and controls will be added properly.\n\t\t$nav_menus_setting_ids = array();\n\t\tforeach ( array_keys( $changeset ) as $setting_id ) {\n\t\t\tif ( preg_match( '/^(nav_menu_locations|nav_menu|nav_menu_item)\\[/', $setting_id ) ) {\n\t\t\t\t$nav_menus_setting_ids[] = $setting_id;\n\t\t\t}\n\t\t}\n\t\t$settings = $this->manager->add_dynamic_settings( $nav_menus_setting_ids );\n\t\tif ( $this->manager->settings_previewed() ) {\n\t\t\tforeach ( $settings as $setting ) {\n\t\t\t\t$setting->preview();\n\t\t\t}\n\t\t}\n\n\t\t// Require JS-rendered control types.\n\t\t$this->manager->register_panel_type( 'WP_Customize_Nav_Menus_Panel' );\n\t\t$this->manager->register_control_type( 'WP_Customize_Nav_Menu_Control' );\n\t\t$this->manager->register_control_type( 'WP_Customize_Nav_Menu_Name_Control' );\n\t\t$this->manager->register_control_type( 'WP_Customize_Nav_Menu_Locations_Control' );\n\t\t$this->manager->register_control_type( 'WP_Customize_Nav_Menu_Auto_Add_Control' );\n\t\t$this->manager->register_control_type( 'WP_Customize_Nav_Menu_Item_Control' );\n\n\t\t// Create a panel for Menus.\n\t\t$description = '<p>' . __( 'This panel is used for managing navigation menus for content you have already published on your site. You can create menus and add items for existing content such as pages, posts, categories, tags, formats, or custom links.' ) . '</p>';\n\t\tif ( current_theme_supports( 'widgets' ) ) {\n\t\t\t$description .= '<p>' . sprintf(\n\t\t\t\t/* translators: %s: URL to the Widgets panel of the Customizer. */\n\t\t\t\t__( 'Menus can be displayed in locations defined by your theme or in <a href=\"%s\">widget areas</a> by adding a &#8220;Navigation Menu&#8221; widget.' ),\n\t\t\t\t\"javascript:wp.customize.panel( 'widgets' ).focus();\"\n\t\t\t) . '</p>';\n\t\t} else {\n\t\t\t$description .= '<p>' . __( 'Menus can be displayed in locations defined by your theme.' ) . '</p>';\n\t\t}\n\n\t\t/*\n\t\t * Once multiple theme supports are allowed in WP_Customize_Panel,\n\t\t * this panel can be restricted to themes that support menus or widgets.\n\t\t */\n\t\t$this->manager->add_panel(\n\t\t\tnew WP_Customize_Nav_Menus_Panel(\n\t\t\t\t$this->manager,\n\t\t\t\t'nav_menus',\n\t\t\t\tarray(\n\t\t\t\t\t'title'       => __( 'Menus' ),\n\t\t\t\t\t'description' => $description,\n\t\t\t\t\t'priority'    => 100,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t$menus = wp_get_nav_menus();\n\n\t\t// Menu locations.\n\t\t$locations     = get_registered_nav_menus();\n\t\t$num_locations = count( $locations );\n\t\tif ( 1 == $num_locations ) {\n\t\t\t$description = '<p>' . __( 'Your theme can display menus in one location. Select which menu you would like to use.' ) . '</p>';\n\t\t} else {\n\t\t\t/* translators: %s: Number of menu locations. */\n\t\t\t$description = '<p>' . sprintf( _n( 'Your theme can display menus in %s location. Select which menu you would like to use.', 'Your theme can display menus in %s locations. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) ) . '</p>';\n\t\t}\n\n\t\tif ( current_theme_supports( 'widgets' ) ) {\n\t\t\t/* translators: URL to the Widgets panel of the Customizer. */\n\t\t\t$description .= '<p>' . sprintf( __( 'If your theme has widget areas, you can also add menus there. Visit the <a href=\"%s\">Widgets panel</a> and add a &#8220;Navigation Menu widget&#8221; to display a menu in a sidebar or footer.' ), \"javascript:wp.customize.panel( 'widgets' ).focus();\" ) . '</p>';\n\t\t}\n\n\t\t$this->manager->add_section(\n\t\t\t'menu_locations',\n\t\t\tarray(\n\t\t\t\t'title'       => 1 === $num_locations ? _x( 'View Location', 'menu locations' ) : _x( 'View All Locations', 'menu locations' ),\n\t\t\t\t'panel'       => 'nav_menus',\n\t\t\t\t'priority'    => 30,\n\t\t\t\t'description' => $description,\n\t\t\t)\n\t\t);\n\n\t\t$choices = array( '0' => __( '&mdash; Select &mdash;' ) );\n\t\tforeach ( $menus as $menu ) {\n\t\t\t$choices[ $menu->term_id ] = wp_html_excerpt( $menu->name, 40, '&hellip;' );\n\t\t}\n\n\t\t// Attempt to re-map the nav menu location assignments when previewing a theme switch.\n\t\t$mapped_nav_menu_locations = array();\n\t\tif ( ! $this->manager->is_theme_active() ) {\n\t\t\t$theme_mods = get_option( 'theme_mods_' . $this->manager->get_stylesheet(), array() );\n\n\t\t\t// If there is no data from a previous activation, start fresh.\n\t\t\tif ( empty( $theme_mods['nav_menu_locations'] ) ) {\n\t\t\t\t$theme_mods['nav_menu_locations'] = array();\n\t\t\t}\n\n\t\t\t$mapped_nav_menu_locations = wp_map_nav_menu_locations( $theme_mods['nav_menu_locations'], $this->original_nav_menu_locations );\n\t\t}\n\n\t\tforeach ( $locations as $location => $description ) {\n\t\t\t$setting_id = \"nav_menu_locations[{$location}]\";\n\n\t\t\t$setting = $this->manager->get_setting( $setting_id );\n\t\t\tif ( $setting ) {\n\t\t\t\t$setting->transport = 'postMessage';\n\t\t\t\tremove_filter( \"customize_sanitize_{$setting_id}\", 'absint' );\n\t\t\t\tadd_filter( \"customize_sanitize_{$setting_id}\", array( $this, 'intval_base10' ) );\n\t\t\t} else {\n\t\t\t\t$this->manager->add_setting(\n\t\t\t\t\t$setting_id,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'sanitize_callback' => array( $this, 'intval_base10' ),\n\t\t\t\t\t\t'theme_supports'    => 'menus',\n\t\t\t\t\t\t'type'              => 'theme_mod',\n\t\t\t\t\t\t'transport'         => 'postMessage',\n\t\t\t\t\t\t'default'           => 0,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Override the assigned nav menu location if mapped during previewed theme switch.\n\t\t\tif ( empty( $changeset[ $setting_id ] ) && isset( $mapped_nav_menu_locations[ $location ] ) ) {\n\t\t\t\t$this->manager->set_post_value( $setting_id, $mapped_nav_menu_locations[ $location ] );\n\t\t\t}\n\n\t\t\t$this->manager->add_control(\n\t\t\t\tnew WP_Customize_Nav_Menu_Location_Control(\n\t\t\t\t\t$this->manager,\n\t\t\t\t\t$setting_id,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'label'       => $description,\n\t\t\t\t\t\t'location_id' => $location,\n\t\t\t\t\t\t'section'     => 'menu_locations',\n\t\t\t\t\t\t'choices'     => $choices,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// Used to denote post states for special pages.\n\t\tif ( ! function_exists( 'get_post_states' ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/template.php';\n\t\t}\n\n\t\t// Register each menu as a Customizer section, and add each menu item to each menu.\n\t\tforeach ( $menus as $menu ) {\n\t\t\t$menu_id = $menu->term_id;\n\n\t\t\t// Create a section for each menu.\n\t\t\t$section_id = 'nav_menu[' . $menu_id . ']';\n\t\t\t$this->manager->add_section(\n\t\t\t\tnew WP_Customize_Nav_Menu_Section(\n\t\t\t\t\t$this->manager,\n\t\t\t\t\t$section_id,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title'    => html_entity_decode( $menu->name, ENT_QUOTES, get_bloginfo( 'charset' ) ),\n\t\t\t\t\t\t'priority' => 10,\n\t\t\t\t\t\t'panel'    => 'nav_menus',\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$nav_menu_setting_id = 'nav_menu[' . $menu_id . ']';\n\t\t\t$this->manager->add_setting(\n\t\t\t\tnew WP_Customize_Nav_Menu_Setting(\n\t\t\t\t\t$this->manager,\n\t\t\t\t\t$nav_menu_setting_id,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'transport' => 'postMessage',\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Add the menu contents.\n\t\t\t$menu_items = (array) wp_get_nav_menu_items( $menu_id );\n\n\t\t\tforeach ( array_values( $menu_items ) as $i => $item ) {\n\n\t\t\t\t// Create a setting for each menu item (which doesn't actually manage data, currently).\n\t\t\t\t$menu_item_setting_id = 'nav_menu_item[' . $item->ID . ']';\n\n\t\t\t\t$value = (array) $item;\n\t\t\t\tif ( empty( $value['post_title'] ) ) {\n\t\t\t\t\t$value['title'] = '';\n\t\t\t\t}\n\n\t\t\t\t$value['nav_menu_term_id'] = $menu_id;\n\t\t\t\t$this->manager->add_setting(\n\t\t\t\t\tnew WP_Customize_Nav_Menu_Item_Setting(\n\t\t\t\t\t\t$this->manager,\n\t\t\t\t\t\t$menu_item_setting_id,\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'value'     => $value,\n\t\t\t\t\t\t\t'transport' => 'postMessage',\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// Create a control for each menu item.\n\t\t\t\t$this->manager->add_control(\n\t\t\t\t\tnew WP_Customize_Nav_Menu_Item_Control(\n\t\t\t\t\t\t$this->manager,\n\t\t\t\t\t\t$menu_item_setting_id,\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'label'    => $item->title,\n\t\t\t\t\t\t\t'section'  => $section_id,\n\t\t\t\t\t\t\t'priority' => 10 + $i,\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Note: other controls inside of this section get added dynamically in JS via the MenuSection.ready() function.\n\t\t}\n\n\t\t// Add the add-new-menu section and controls.\n\t\t$this->manager->add_section(\n\t\t\t'add_menu',\n\t\t\tarray(\n\t\t\t\t'type'     => 'new_menu',\n\t\t\t\t'title'    => __( 'New Menu' ),\n\t\t\t\t'panel'    => 'nav_menus',\n\t\t\t\t'priority' => 20,\n\t\t\t)\n\t\t);\n\n\t\t$this->manager->add_setting(\n\t\t\tnew WP_Customize_Filter_Setting(\n\t\t\t\t$this->manager,\n\t\t\t\t'nav_menus_created_posts',\n\t\t\t\tarray(\n\t\t\t\t\t'transport'         => 'postMessage',\n\t\t\t\t\t'type'              => 'option', // To prevent theme prefix in changeset.\n\t\t\t\t\t'default'           => array(),\n\t\t\t\t\t'sanitize_callback' => array( $this, 'sanitize_nav_menus_created_posts' ),\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Get the base10 intval.\n\t *\n\t * This is used as a setting's sanitize_callback; we can't use just plain\n\t * intval because the second argument is not what intval() expects.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param mixed $value Number to convert.\n\t * @return int Integer.\n\t */\n\tpublic function intval_base10( $value ) {\n\t\treturn intval( $value, 10 );\n\t}\n\n\t/**\n\t * Return an array of all the available item types.\n\t *\n\t * @since 4.3.0\n\t * @since 4.7.0  Each array item now includes a `$type_label` in addition to `$title`, `$type`, and `$object`.\n\t *\n\t * @return array The available menu item types.\n\t */\n\tpublic function available_item_types() {\n\t\t$item_types = array();\n\n\t\t$post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' );\n\t\tif ( $post_types ) {\n\t\t\tforeach ( $post_types as $slug => $post_type ) {\n\t\t\t\t$item_types[] = array(\n\t\t\t\t\t'title'      => $post_type->labels->name,\n\t\t\t\t\t'type_label' => $post_type->labels->singular_name,\n\t\t\t\t\t'type'       => 'post_type',\n\t\t\t\t\t'object'     => $post_type->name,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'objects' );\n\t\tif ( $taxonomies ) {\n\t\t\tforeach ( $taxonomies as $slug => $taxonomy ) {\n\t\t\t\tif ( 'post_format' === $taxonomy && ! current_theme_supports( 'post-formats' ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$item_types[] = array(\n\t\t\t\t\t'title'      => $taxonomy->labels->name,\n\t\t\t\t\t'type_label' => $taxonomy->labels->singular_name,\n\t\t\t\t\t'type'       => 'taxonomy',\n\t\t\t\t\t'object'     => $taxonomy->name,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the available menu item types.\n\t\t *\n\t\t * @since 4.3.0\n\t\t * @since 4.7.0  Each array item now includes a `$type_label` in addition to `$title`, `$type`, and `$object`.\n\t\t *\n\t\t * @param array $item_types Navigation menu item types.\n\t\t */\n\t\t$item_types = apply_filters( 'customize_nav_menu_available_item_types', $item_types );\n\n\t\treturn $item_types;\n\t}\n\n\t/**\n\t * Add a new `auto-draft` post.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $postarr {\n\t *     Post array. Note that post_status is overridden to be `auto-draft`.\n\t *\n\t * @var string $post_title   Post title. Required.\n\t * @var string $post_type    Post type. Required.\n\t * @var string $post_name    Post name.\n\t * @var string $post_content Post content.\n\t * }\n\t * @return WP_Post|WP_Error Inserted auto-draft post object or error.\n\t */\n\tpublic function insert_auto_draft_post( $postarr ) {\n\t\tif ( ! isset( $postarr['post_type'] ) ) {\n\t\t\treturn new WP_Error( 'unknown_post_type', __( 'Invalid post type.' ) );\n\t\t}\n\t\tif ( empty( $postarr['post_title'] ) ) {\n\t\t\treturn new WP_Error( 'empty_title', __( 'Empty title.' ) );\n\t\t}\n\t\tif ( ! empty( $postarr['post_status'] ) ) {\n\t\t\treturn new WP_Error( 'status_forbidden', __( 'Status is forbidden.' ) );\n\t\t}\n\n\t\t/*\n\t\t * If the changeset is a draft, this will change to draft the next time the changeset\n\t\t * is updated; otherwise, auto-draft will persist in autosave revisions, until save.\n\t\t */\n\t\t$postarr['post_status'] = 'auto-draft';\n\n\t\t// Auto-drafts are allowed to have empty post_names, so it has to be explicitly set.\n\t\tif ( empty( $postarr['post_name'] ) ) {\n\t\t\t$postarr['post_name'] = sanitize_title( $postarr['post_title'] );\n\t\t}\n\t\tif ( ! isset( $postarr['meta_input'] ) ) {\n\t\t\t$postarr['meta_input'] = array();\n\t\t}\n\t\t$postarr['meta_input']['_customize_draft_post_name'] = $postarr['post_name'];\n\t\t$postarr['meta_input']['_customize_changeset_uuid']  = $this->manager->changeset_uuid();\n\t\tunset( $postarr['post_name'] );\n\n\t\tadd_filter( 'wp_insert_post_empty_content', '__return_false', 1000 );\n\t\t$r = wp_insert_post( wp_slash( $postarr ), true );\n\t\tremove_filter( 'wp_insert_post_empty_content', '__return_false', 1000 );\n\n\t\tif ( is_wp_error( $r ) ) {\n\t\t\treturn $r;\n\t\t} else {\n\t\t\treturn get_post( $r );\n\t\t}\n\t}\n\n\t/**\n\t * Ajax handler for adding a new auto-draft post.\n\t *\n\t * @since 4.7.0\n\t */\n\tpublic function ajax_insert_auto_draft_post() {\n\t\tif ( ! check_ajax_referer( 'customize-menus', 'customize-menus-nonce', false ) ) {\n\t\t\twp_send_json_error( 'bad_nonce', 400 );\n\t\t}\n\n\t\tif ( ! current_user_can( 'customize' ) ) {\n\t\t\twp_send_json_error( 'customize_not_allowed', 403 );\n\t\t}\n\n\t\tif ( empty( $_POST['params'] ) || ! is_array( $_POST['params'] ) ) {\n\t\t\twp_send_json_error( 'missing_params', 400 );\n\t\t}\n\n\t\t$params         = wp_unslash( $_POST['params'] );\n\t\t$illegal_params = array_diff( array_keys( $params ), array( 'post_type', 'post_title' ) );\n\t\tif ( ! empty( $illegal_params ) ) {\n\t\t\twp_send_json_error( 'illegal_params', 400 );\n\t\t}\n\n\t\t$params = array_merge(\n\t\t\tarray(\n\t\t\t\t'post_type'  => '',\n\t\t\t\t'post_title' => '',\n\t\t\t),\n\t\t\t$params\n\t\t);\n\n\t\tif ( empty( $params['post_type'] ) || ! post_type_exists( $params['post_type'] ) ) {\n\t\t\tstatus_header( 400 );\n\t\t\twp_send_json_error( 'missing_post_type_param' );\n\t\t}\n\n\t\t$post_type_object = get_post_type_object( $params['post_type'] );\n\t\tif ( ! current_user_can( $post_type_object->cap->create_posts ) || ! current_user_can( $post_type_object->cap->publish_posts ) ) {\n\t\t\tstatus_header( 403 );\n\t\t\twp_send_json_error( 'insufficient_post_permissions' );\n\t\t}\n\n\t\t$params['post_title'] = trim( $params['post_title'] );\n\t\tif ( '' === $params['post_title'] ) {\n\t\t\tstatus_header( 400 );\n\t\t\twp_send_json_error( 'missing_post_title' );\n\t\t}\n\n\t\t$r = $this->insert_auto_draft_post( $params );\n\t\tif ( is_wp_error( $r ) ) {\n\t\t\t$error = $r;\n\t\t\tif ( ! empty( $post_type_object->labels->singular_name ) ) {\n\t\t\t\t$singular_name = $post_type_object->labels->singular_name;\n\t\t\t} else {\n\t\t\t\t$singular_name = __( 'Post' );\n\t\t\t}\n\n\t\t\t$data = array(\n\t\t\t\t/* translators: 1: Post type name, 2: Error message. */\n\t\t\t\t'message' => sprintf( __( '%1$s could not be created: %2$s' ), $singular_name, $error->get_error_message() ),\n\t\t\t);\n\t\t\twp_send_json_error( $data );\n\t\t} else {\n\t\t\t$post = $r;\n\t\t\t$data = array(\n\t\t\t\t'post_id' => $post->ID,\n\t\t\t\t'url'     => get_permalink( $post->ID ),\n\t\t\t);\n\t\t\twp_send_json_success( $data );\n\t\t}\n\t}\n\n\t/**\n\t * Print the JavaScript templates used to render Menu Customizer components.\n\t *\n\t * Templates are imported into the JS use wp.template.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function print_templates() {\n\t\t?>\n\t\t<script type=\"text/html\" id=\"tmpl-available-menu-item\">\n\t\t\t<li id=\"menu-item-tpl-{{ data.id }}\" class=\"menu-item-tpl\" data-menu-item-id=\"{{ data.id }}\">\n\t\t\t\t<div class=\"menu-item-bar\">\n\t\t\t\t\t<div class=\"menu-item-handle\">\n\t\t\t\t\t\t<span class=\"item-type\" aria-hidden=\"true\">{{ data.type_label }}</span>\n\t\t\t\t\t\t<span class=\"item-title\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t<span class=\"menu-item-title<# if ( ! data.title ) { #> no-title<# } #>\">{{ data.title || wp.customize.Menus.data.l10n.untitled }}</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<button type=\"button\" class=\"button-link item-add\">\n\t\t\t\t\t\t\t<span class=\"screen-reader-text\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t/* translators: 1: Title of a menu item, 2: Type of a menu item. */\n\t\t\t\t\t\t\t\tprintf( __( 'Add to menu: %1$s (%2$s)' ), '{{ data.title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.type_label }}' );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t</script>\n\n\t\t<script type=\"text/html\" id=\"tmpl-menu-item-reorder-nav\">\n\t\t\t<div class=\"menu-item-reorder-nav\">\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t'<button type=\"button\" class=\"menus-move-up\">%1$s</button><button type=\"button\" class=\"menus-move-down\">%2$s</button><button type=\"button\" class=\"menus-move-left\">%3$s</button><button type=\"button\" class=\"menus-move-right\">%4$s</button>',\n\t\t\t\t\t__( 'Move up' ),\n\t\t\t\t\t__( 'Move down' ),\n\t\t\t\t\t__( 'Move one level up' ),\n\t\t\t\t\t__( 'Move one level down' )\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</div>\n\t\t</script>\n\n\t\t<script type=\"text/html\" id=\"tmpl-nav-menu-delete-button\">\n\t\t\t<div class=\"menu-delete-item\">\n\t\t\t\t<button type=\"button\" class=\"button-link button-link-delete\">\n\t\t\t\t\t<?php _e( 'Delete Menu' ); ?>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</script>\n\n\t\t<script type=\"text/html\" id=\"tmpl-nav-menu-submit-new-button\">\n\t\t\t<p id=\"customize-new-menu-submit-description\"><?php _e( 'Click &#8220;Next&#8221; to start adding links to your new menu.' ); ?></p>\n\t\t\t<button id=\"customize-new-menu-submit\" type=\"button\" class=\"button\" aria-describedby=\"customize-new-menu-submit-description\"><?php _e( 'Next' ); ?></button>\n\t\t</script>\n\n\t\t<script type=\"text/html\" id=\"tmpl-nav-menu-locations-header\">\n\t\t\t<span class=\"customize-control-title customize-section-title-menu_locations-heading\">{{ data.l10n.locationsTitle }}</span>\n\t\t\t<p class=\"customize-control-description customize-section-title-menu_locations-description\">{{ data.l10n.locationsDescription }}</p>\n\t\t</script>\n\n\t\t<script type=\"text/html\" id=\"tmpl-nav-menu-create-menu-section-title\">\n\t\t\t<p class=\"add-new-menu-notice\">\n\t\t\t\t<?php _e( 'It doesn&#8217;t look like your site has any menus yet. Want to build one? Click the button to start.' ); ?>\n\t\t\t</p>\n\t\t\t<p class=\"add-new-menu-notice\">\n\t\t\t\t<?php _e( 'You&#8217;ll create a menu, assign it a location, and add menu items like links to pages and categories. If your theme has multiple menu areas, you might need to create more than one.' ); ?>\n\t\t\t</p>\n\t\t\t<h3>\n\t\t\t\t<button type=\"button\" class=\"button customize-add-menu-button\">\n\t\t\t\t\t<?php _e( 'Create New Menu' ); ?>\n\t\t\t\t</button>\n\t\t\t</h3>\n\t\t</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * Print the HTML template used to render the add-menu-item frame.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function available_items_template() {\n\t\t?>\n\t\t<div id=\"available-menu-items\" class=\"accordion-container\">\n\t\t\t<div class=\"customize-section-title\">\n\t\t\t\t<button type=\"button\" class=\"customize-section-back\" tabindex=\"-1\">\n\t\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Back' ); ?></span>\n\t\t\t\t</button>\n\t\t\t\t<h3>\n\t\t\t\t\t<span class=\"customize-action\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */\n\t\t\t\t\t\t\tprintf( __( 'Customizing &#9656; %s' ), esc_html( $this->manager->get_panel( 'nav_menus' )->title ) );\n\t\t\t\t\t\t?>\n\t\t\t\t\t</span>\n\t\t\t\t\t<?php _e( 'Add Menu Items' ); ?>\n\t\t\t\t</h3>\n\t\t\t</div>\n\t\t\t<div id=\"available-menu-items-search\" class=\"accordion-section cannot-expand\">\n\t\t\t\t<div class=\"accordion-section-title\">\n\t\t\t\t\t<label class=\"screen-reader-text\" for=\"menu-items-search\"><?php _e( 'Search Menu Items' ); ?></label>\n\t\t\t\t\t<input type=\"text\" id=\"menu-items-search\" placeholder=\"<?php esc_attr_e( 'Search menu items&hellip;' ); ?>\" aria-describedby=\"menu-items-search-desc\" />\n\t\t\t\t\t<p class=\"screen-reader-text\" id=\"menu-items-search-desc\"><?php _e( 'The search results will be updated as you type.' ); ?></p>\n\t\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"search-icon\" aria-hidden=\"true\"></div>\n\t\t\t\t<button type=\"button\" class=\"clear-results\"><span class=\"screen-reader-text\"><?php _e( 'Clear Results' ); ?></span></button>\n\t\t\t\t<ul class=\"accordion-section-content available-menu-items-list\" data-type=\"search\"></ul>\n\t\t\t</div>\n\t\t\t<?php\n\n\t\t\t// Ensure the page post type comes first in the list.\n\t\t\t$item_types     = $this->available_item_types();\n\t\t\t$page_item_type = null;\n\t\t\tforeach ( $item_types as $i => $item_type ) {\n\t\t\t\tif ( isset( $item_type['object'] ) && 'page' === $item_type['object'] ) {\n\t\t\t\t\t$page_item_type = $item_type;\n\t\t\t\t\tunset( $item_types[ $i ] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->print_custom_links_available_menu_item();\n\t\t\tif ( $page_item_type ) {\n\t\t\t\t$this->print_post_type_container( $page_item_type );\n\t\t\t}\n\t\t\t// Containers for per-post-type item browsing; items are added with JS.\n\t\t\tforeach ( $item_types as $item_type ) {\n\t\t\t\t$this->print_post_type_container( $item_type );\n\t\t\t}\n\t\t\t?>\n\t\t</div><!-- #available-menu-items -->\n\t\t<?php\n\t}\n\n\t/**\n\t * Print the markup for new menu items.\n\t *\n\t * To be used in the template #available-menu-items.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $available_item_type Menu item data to output, including title, type, and label.\n\t * @return void\n\t */\n\tprotected function print_post_type_container( $available_item_type ) {\n\t\t$id = sprintf( 'available-menu-items-%s-%s', $available_item_type['type'], $available_item_type['object'] );\n\t\t?>\n\t\t<div id=\"<?php echo esc_attr( $id ); ?>\" class=\"accordion-section\">\n\t\t\t<h4 class=\"accordion-section-title\" role=\"presentation\">\n\t\t\t\t<?php echo esc_html( $available_item_type['title'] ); ?>\n\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t\t<span class=\"no-items\"><?php _e( 'No items' ); ?></span>\n\t\t\t\t<button type=\"button\" class=\"button-link\" aria-expanded=\"false\">\n\t\t\t\t\t<span class=\"screen-reader-text\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t/* translators: %s: Title of a section with menu items. */\n\t\t\t\t\t\tprintf( __( 'Toggle section: %s' ), esc_html( $available_item_type['title'] ) );\n\t\t\t\t\t?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"toggle-indicator\" aria-hidden=\"true\"></span>\n\t\t\t\t</button>\n\t\t\t</h4>\n\t\t\t<div class=\"accordion-section-content\">\n\t\t\t\t<?php if ( 'post_type' === $available_item_type['type'] ) : ?>\n\t\t\t\t\t<?php $post_type_obj = get_post_type_object( $available_item_type['object'] ); ?>\n\t\t\t\t\t<?php if ( current_user_can( $post_type_obj->cap->create_posts ) && current_user_can( $post_type_obj->cap->publish_posts ) ) : ?>\n\t\t\t\t\t\t<div class=\"new-content-item\">\n\t\t\t\t\t\t\t<label for=\"<?php echo esc_attr( 'create-item-input-' . $available_item_type['object'] ); ?>\" class=\"screen-reader-text\"><?php echo esc_html( $post_type_obj->labels->add_new_item ); ?></label>\n\t\t\t\t\t\t\t<input type=\"text\" id=\"<?php echo esc_attr( 'create-item-input-' . $available_item_type['object'] ); ?>\" class=\"create-item-input\" placeholder=\"<?php echo esc_attr( $post_type_obj->labels->add_new_item ); ?>\">\n\t\t\t\t\t\t\t<button type=\"button\" class=\"button add-content\"><?php _e( 'Add' ); ?></button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<ul class=\"available-menu-items-list\" data-type=\"<?php echo esc_attr( $available_item_type['type'] ); ?>\" data-object=\"<?php echo esc_attr( $available_item_type['object'] ); ?>\" data-type_label=\"<?php echo esc_attr( isset( $available_item_type['type_label'] ) ? $available_item_type['type_label'] : $available_item_type['type'] ); ?>\"></ul>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Print the markup for available menu item custom links.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return void\n\t */\n\tprotected function print_custom_links_available_menu_item() {\n\t\t?>\n\t\t<div id=\"new-custom-menu-item\" class=\"accordion-section\">\n\t\t\t<h4 class=\"accordion-section-title\" role=\"presentation\">\n\t\t\t\t<?php _e( 'Custom Links' ); ?>\n\t\t\t\t<button type=\"button\" class=\"button-link\" aria-expanded=\"false\">\n\t\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Toggle section: Custom Links' ); ?></span>\n\t\t\t\t\t<span class=\"toggle-indicator\" aria-hidden=\"true\"></span>\n\t\t\t\t</button>\n\t\t\t</h4>\n\t\t\t<div class=\"accordion-section-content customlinkdiv\">\n\t\t\t\t<input type=\"hidden\" value=\"custom\" id=\"custom-menu-item-type\" name=\"menu-item[-1][menu-item-type]\" />\n\t\t\t\t<p id=\"menu-item-url-wrap\" class=\"wp-clearfix\">\n\t\t\t\t\t<label class=\"howto\" for=\"custom-menu-item-url\"><?php _e( 'URL' ); ?></label>\n\t\t\t\t\t<input id=\"custom-menu-item-url\" name=\"menu-item[-1][menu-item-url]\" type=\"text\" class=\"code menu-item-textbox\" placeholder=\"https://\">\n\t\t\t\t</p>\n\t\t\t\t<p id=\"menu-item-name-wrap\" class=\"wp-clearfix\">\n\t\t\t\t\t<label class=\"howto\" for=\"custom-menu-item-name\"><?php _e( 'Link Text' ); ?></label>\n\t\t\t\t\t<input id=\"custom-menu-item-name\" name=\"menu-item[-1][menu-item-title]\" type=\"text\" class=\"regular-text menu-item-textbox\">\n\t\t\t\t</p>\n\t\t\t\t<p class=\"button-controls\">\n\t\t\t\t\t<span class=\"add-to-menu\">\n\t\t\t\t\t\t<input type=\"submit\" class=\"button submit-add-to-menu right\" value=\"<?php esc_attr_e( 'Add to Menu' ); ?>\" name=\"add-custom-menu-item\" id=\"custom-menu-item-submit\">\n\t\t\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t//\n\t// Start functionality specific to partial-refresh of menu changes in Customizer preview.\n\t//\n\n\t/**\n\t * Nav menu args used for each instance, keyed by the args HMAC.\n\t *\n\t * @since 4.3.0\n\t * @var array\n\t */\n\tpublic $preview_nav_menu_instance_args = array();\n\n\t/**\n\t * Filters arguments for dynamic nav_menu selective refresh partials.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param array|false $partial_args Partial args.\n\t * @param string      $partial_id   Partial ID.\n\t * @return array Partial args.\n\t */\n\tpublic function customize_dynamic_partial_args( $partial_args, $partial_id ) {\n\n\t\tif ( preg_match( '/^nav_menu_instance\\[[0-9a-f]{32}\\]$/', $partial_id ) ) {\n\t\t\tif ( false === $partial_args ) {\n\t\t\t\t$partial_args = array();\n\t\t\t}\n\t\t\t$partial_args = array_merge(\n\t\t\t\t$partial_args,\n\t\t\t\tarray(\n\t\t\t\t\t'type'                => 'nav_menu_instance',\n\t\t\t\t\t'render_callback'     => array( $this, 'render_nav_menu_partial' ),\n\t\t\t\t\t'container_inclusive' => true,\n\t\t\t\t\t'settings'            => array(), // Empty because the nav menu instance may relate to a menu or a location.\n\t\t\t\t\t'capability'          => 'edit_theme_options',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn $partial_args;\n\t}\n\n\t/**\n\t * Add hooks for the Customizer preview.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function customize_preview_init() {\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'customize_preview_enqueue_deps' ) );\n\t\tadd_filter( 'wp_nav_menu_args', array( $this, 'filter_wp_nav_menu_args' ), 1000 );\n\t\tadd_filter( 'wp_nav_menu', array( $this, 'filter_wp_nav_menu' ), 10, 2 );\n\t\tadd_filter( 'wp_footer', array( $this, 'export_preview_data' ), 1 );\n\t\tadd_filter( 'customize_render_partials_response', array( $this, 'export_partial_rendered_nav_menu_instances' ) );\n\t}\n\n\t/**\n\t * Make the auto-draft status protected so that it can be queried.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @global array $wp_post_statuses List of post statuses.\n\t */\n\tpublic function make_auto_draft_status_previewable() {\n\t\tglobal $wp_post_statuses;\n\t\t$wp_post_statuses['auto-draft']->protected = true;\n\t}\n\n\t/**\n\t * Sanitize post IDs for posts created for nav menu items to be published.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $value Post IDs.\n\t * @return array Post IDs.\n\t */\n\tpublic function sanitize_nav_menus_created_posts( $value ) {\n\t\t$post_ids = array();\n\t\tforeach ( wp_parse_id_list( $value ) as $post_id ) {\n\t\t\tif ( empty( $post_id ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$post = get_post( $post_id );\n\t\t\tif ( 'auto-draft' !== $post->post_status && 'draft' !== $post->post_status ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$post_type_obj = get_post_type_object( $post->post_type );\n\t\t\tif ( ! $post_type_obj ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( ! current_user_can( $post_type_obj->cap->publish_posts ) || ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$post_ids[] = $post->ID;\n\t\t}\n\t\treturn $post_ids;\n\t}\n\n\t/**\n\t * Publish the auto-draft posts that were created for nav menu items.\n\t *\n\t * The post IDs will have been sanitized by already by\n\t * `WP_Customize_Nav_Menu_Items::sanitize_nav_menus_created_posts()` to\n\t * remove any post IDs for which the user cannot publish or for which the\n\t * post is not an auto-draft.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Customize_Setting $setting Customizer setting object.\n\t */\n\tpublic function save_nav_menus_created_posts( $setting ) {\n\t\t$post_ids = $setting->post_value();\n\t\tif ( ! empty( $post_ids ) ) {\n\t\t\tforeach ( $post_ids as $post_id ) {\n\n\t\t\t\t// Prevent overriding the status that a user may have prematurely updated the post to.\n\t\t\t\t$current_status = get_post_status( $post_id );\n\t\t\t\tif ( 'auto-draft' !== $current_status && 'draft' !== $current_status ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$target_status = 'attachment' === get_post_type( $post_id ) ? 'inherit' : 'publish';\n\t\t\t\t$args          = array(\n\t\t\t\t\t'ID'          => $post_id,\n\t\t\t\t\t'post_status' => $target_status,\n\t\t\t\t);\n\t\t\t\t$post_name     = get_post_meta( $post_id, '_customize_draft_post_name', true );\n\t\t\t\tif ( $post_name ) {\n\t\t\t\t\t$args['post_name'] = $post_name;\n\t\t\t\t}\n\n\t\t\t\t// Note that wp_publish_post() cannot be used because unique slugs need to be assigned.\n\t\t\t\twp_update_post( wp_slash( $args ) );\n\n\t\t\t\tdelete_post_meta( $post_id, '_customize_draft_post_name' );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Keep track of the arguments that are being passed to wp_nav_menu().\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see wp_nav_menu()\n\t * @see WP_Customize_Widgets::filter_dynamic_sidebar_params()\n\t *\n\t * @param array $args An array containing wp_nav_menu() arguments.\n\t * @return array Arguments.\n\t */\n\tpublic function filter_wp_nav_menu_args( $args ) {\n\t\t/*\n\t\t * The following conditions determine whether or not this instance of\n\t\t * wp_nav_menu() can use selective refreshed. A wp_nav_menu() can be\n\t\t * selective refreshed if...\n\t\t */\n\t\t$can_partial_refresh = (\n\t\t\t// ...if wp_nav_menu() is directly echoing out the menu (and thus isn't manipulating the string after generated),\n\t\t\t! empty( $args['echo'] )\n\t\t\t&&\n\t\t\t// ...and if the fallback_cb can be serialized to JSON, since it will be included in the placement context data,\n\t\t\t( empty( $args['fallback_cb'] ) || is_string( $args['fallback_cb'] ) )\n\t\t\t&&\n\t\t\t// ...and if the walker can also be serialized to JSON, since it will be included in the placement context data as well,\n\t\t\t( empty( $args['walker'] ) || is_string( $args['walker'] ) )\n\t\t\t// ...and if it has a theme location assigned or an assigned menu to display,\n\t\t\t&& (\n\t\t\t\t! empty( $args['theme_location'] )\n\t\t\t\t||\n\t\t\t\t( ! empty( $args['menu'] ) && ( is_numeric( $args['menu'] ) || is_object( $args['menu'] ) ) )\n\t\t\t)\n\t\t\t&&\n\t\t\t// ...and if the nav menu would be rendered with a wrapper container element (upon which to attach data-* attributes).\n\t\t\t(\n\t\t\t\t! empty( $args['container'] )\n\t\t\t\t||\n\t\t\t\t( isset( $args['items_wrap'] ) && '<' === substr( $args['items_wrap'], 0, 1 ) )\n\t\t\t)\n\t\t);\n\t\t$args['can_partial_refresh'] = $can_partial_refresh;\n\n\t\t$exported_args = $args;\n\n\t\t// Empty out args which may not be JSON-serializable.\n\t\tif ( ! $can_partial_refresh ) {\n\t\t\t$exported_args['fallback_cb'] = '';\n\t\t\t$exported_args['walker']      = '';\n\t\t}\n\n\t\t/*\n\t\t * Replace object menu arg with a term_id menu arg, as this exports better\n\t\t * to JS and is easier to compare hashes.\n\t\t */\n\t\tif ( ! empty( $exported_args['menu'] ) && is_object( $exported_args['menu'] ) ) {\n\t\t\t$exported_args['menu'] = $exported_args['menu']->term_id;\n\t\t}\n\n\t\tksort( $exported_args );\n\t\t$exported_args['args_hmac'] = $this->hash_nav_menu_args( $exported_args );\n\n\t\t$args['customize_preview_nav_menus_args']                            = $exported_args;\n\t\t$this->preview_nav_menu_instance_args[ $exported_args['args_hmac'] ] = $exported_args;\n\t\treturn $args;\n\t}\n\n\t/**\n\t * Prepares wp_nav_menu() calls for partial refresh.\n\t *\n\t * Injects attributes into container element.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see wp_nav_menu()\n\t *\n\t * @param string $nav_menu_content The HTML content for the navigation menu.\n\t * @param object $args             An object containing wp_nav_menu() arguments.\n\t * @return string Nav menu HTML with selective refresh attributes added if partial can be refreshed.\n\t */\n\tpublic function filter_wp_nav_menu( $nav_menu_content, $args ) {\n\t\tif ( isset( $args->customize_preview_nav_menus_args['can_partial_refresh'] ) && $args->customize_preview_nav_menus_args['can_partial_refresh'] ) {\n\t\t\t$attributes       = sprintf( ' data-customize-partial-id=\"%s\"', esc_attr( 'nav_menu_instance[' . $args->customize_preview_nav_menus_args['args_hmac'] . ']' ) );\n\t\t\t$attributes      .= ' data-customize-partial-type=\"nav_menu_instance\"';\n\t\t\t$attributes      .= sprintf( ' data-customize-partial-placement-context=\"%s\"', esc_attr( wp_json_encode( $args->customize_preview_nav_menus_args ) ) );\n\t\t\t$nav_menu_content = preg_replace( '#^(<\\w+)#', '$1 ' . str_replace( '\\\\', '\\\\\\\\', $attributes ), $nav_menu_content, 1 );\n\t\t}\n\t\treturn $nav_menu_content;\n\t}\n\n\t/**\n\t * Hashes (hmac) the nav menu arguments to ensure they are not tampered with when\n\t * submitted in the Ajax request.\n\t *\n\t * Note that the array is expected to be pre-sorted.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param array $args The arguments to hash.\n\t * @return string Hashed nav menu arguments.\n\t */\n\tpublic function hash_nav_menu_args( $args ) {\n\t\treturn wp_hash( serialize( $args ) );\n\t}\n\n\t/**\n\t * Enqueue scripts for the Customizer preview.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function customize_preview_enqueue_deps() {\n\t\twp_enqueue_script( 'customize-preview-nav-menus' ); // Note that we have overridden this.\n\t}\n\n\t/**\n\t * Exports data from PHP to JS.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function export_preview_data() {\n\n\t\t// Why not wp_localize_script? Because we're not localizing, and it forces values into strings.\n\t\t$exports = array(\n\t\t\t'navMenuInstanceArgs' => $this->preview_nav_menu_instance_args,\n\t\t);\n\t\tprintf( '<script>var _wpCustomizePreviewNavMenusExports = %s;</script>', wp_json_encode( $exports ) );\n\t}\n\n\t/**\n\t * Export any wp_nav_menu() calls during the rendering of any partials.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param array $response Response.\n\t * @return array Response.\n\t */\n\tpublic function export_partial_rendered_nav_menu_instances( $response ) {\n\t\t$response['nav_menu_instance_args'] = $this->preview_nav_menu_instance_args;\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Render a specific menu via wp_nav_menu() using the supplied arguments.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see wp_nav_menu()\n\t *\n\t * @param WP_Customize_Partial $partial       Partial.\n\t * @param array                $nav_menu_args Nav menu args supplied as container context.\n\t * @return string|false\n\t */\n\tpublic function render_nav_menu_partial( $partial, $nav_menu_args ) {\n\t\tunset( $partial );\n\n\t\tif ( ! isset( $nav_menu_args['args_hmac'] ) ) {\n\t\t\t// Error: missing_args_hmac.\n\t\t\treturn false;\n\t\t}\n\n\t\t$nav_menu_args_hmac = $nav_menu_args['args_hmac'];\n\t\tunset( $nav_menu_args['args_hmac'] );\n\n\t\tksort( $nav_menu_args );\n\t\tif ( ! hash_equals( $this->hash_nav_menu_args( $nav_menu_args ), $nav_menu_args_hmac ) ) {\n\t\t\t// Error: args_hmac_mismatch.\n\t\t\treturn false;\n\t\t}\n\n\t\tob_start();\n\t\twp_nav_menu( $nav_menu_args );\n\t\t$content = ob_get_clean();\n\n\t\treturn $content;\n\t}\n}\n", "num_lines": 1588}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Customize Panel classes\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.0.0\n */\n\n/**\n * Customize Panel class.\n *\n * A UI container for sections, managed by the WP_Customize_Manager.\n *\n * @since 4.0.0\n *\n * @see WP_Customize_Manager\n */\nclass WP_Customize_Panel {\n\n\t/**\n\t * Incremented with each new class instantiation, then stored in $instance_number.\n\t *\n\t * Used when sorting two instances whose priorities are equal.\n\t *\n\t * @since 4.1.0\n\t * @var int\n\t */\n\tprotected static $instance_count = 0;\n\n\t/**\n\t * Order in which this instance was created in relation to other instances.\n\t *\n\t * @since 4.1.0\n\t * @var int\n\t */\n\tpublic $instance_number;\n\n\t/**\n\t * WP_Customize_Manager instance.\n\t *\n\t * @since 4.0.0\n\t * @var WP_Customize_Manager\n\t */\n\tpublic $manager;\n\n\t/**\n\t * Unique identifier.\n\t *\n\t * @since 4.0.0\n\t * @var string\n\t */\n\tpublic $id;\n\n\t/**\n\t * Priority of the panel, defining the display order of panels and sections.\n\t *\n\t * @since 4.0.0\n\t * @var integer\n\t */\n\tpublic $priority = 160;\n\n\t/**\n\t * Capability required for the panel.\n\t *\n\t * @since 4.0.0\n\t * @var string\n\t */\n\tpublic $capability = 'edit_theme_options';\n\n\t/**\n\t * Theme features required to support the panel.\n\t *\n\t * @since 4.0.0\n\t * @var string|string[]\n\t */\n\tpublic $theme_supports = '';\n\n\t/**\n\t * Title of the panel to show in UI.\n\t *\n\t * @since 4.0.0\n\t * @var string\n\t */\n\tpublic $title = '';\n\n\t/**\n\t * Description to show in the UI.\n\t *\n\t * @since 4.0.0\n\t * @var string\n\t */\n\tpublic $description = '';\n\n\t/**\n\t * Auto-expand a section in a panel when the panel is expanded when the panel only has the one section.\n\t *\n\t * @since 4.7.4\n\t * @var bool\n\t */\n\tpublic $auto_expand_sole_section = false;\n\n\t/**\n\t * Customizer sections for this panel.\n\t *\n\t * @since 4.0.0\n\t * @var array\n\t */\n\tpublic $sections;\n\n\t/**\n\t * Type of this panel.\n\t *\n\t * @since 4.1.0\n\t * @var string\n\t */\n\tpublic $type = 'default';\n\n\t/**\n\t * Active callback.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @see WP_Customize_Section::active()\n\t *\n\t * @var callable Callback is called with one argument, the instance of\n\t *               WP_Customize_Section, and returns bool to indicate whether\n\t *               the section is active (such as it relates to the URL currently\n\t *               being previewed).\n\t */\n\tpublic $active_callback = '';\n\n\t/**\n\t * Constructor.\n\t *\n\t * Any supplied $args override class property defaults.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t * @param string               $id      A specific ID for the panel.\n\t * @param array                $args    {\n\t *     Optional. Array of properties for the new Panel object. Default empty array.\n\t *\n\t *     @type int             $priority        Priority of the panel, defining the display order\n\t *                                            of panels and sections. Default 160.\n\t *     @type string          $capability      Capability required for the panel.\n\t *                                            Default `edit_theme_options`.\n\t *     @type string|string[] $theme_supports  Theme features required to support the panel.\n\t *     @type string          $title           Title of the panel to show in UI.\n\t *     @type string          $description     Description to show in the UI.\n\t *     @type string          $type            Type of the panel.\n\t *     @type callable        $active_callback Active callback.\n\t * }\n\t */\n\tpublic function __construct( $manager, $id, $args = array() ) {\n\t\t$keys = array_keys( get_object_vars( $this ) );\n\t\tforeach ( $keys as $key ) {\n\t\t\tif ( isset( $args[ $key ] ) ) {\n\t\t\t\t$this->$key = $args[ $key ];\n\t\t\t}\n\t\t}\n\n\t\t$this->manager = $manager;\n\t\t$this->id      = $id;\n\t\tif ( empty( $this->active_callback ) ) {\n\t\t\t$this->active_callback = array( $this, 'active_callback' );\n\t\t}\n\t\tself::$instance_count += 1;\n\t\t$this->instance_number = self::$instance_count;\n\n\t\t$this->sections = array(); // Users cannot customize the $sections array.\n\t}\n\n\t/**\n\t * Check whether panel is active to current Customizer preview.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @return bool Whether the panel is active to the current preview.\n\t */\n\tfinal public function active() {\n\t\t$panel  = $this;\n\t\t$active = call_user_func( $this->active_callback, $this );\n\n\t\t/**\n\t\t * Filters response of WP_Customize_Panel::active().\n\t\t *\n\t\t * @since 4.1.0\n\t\t *\n\t\t * @param bool               $active Whether the Customizer panel is active.\n\t\t * @param WP_Customize_Panel $panel  WP_Customize_Panel instance.\n\t\t */\n\t\t$active = apply_filters( 'customize_panel_active', $active, $panel );\n\n\t\treturn $active;\n\t}\n\n\t/**\n\t * Default callback used when invoking WP_Customize_Panel::active().\n\t *\n\t * Subclasses can override this with their specific logic, or they may\n\t * provide an 'active_callback' argument to the constructor.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @return bool Always true.\n\t */\n\tpublic function active_callback() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Gather the parameters passed to client JavaScript via JSON.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @return array The array to be exported to the client as JSON.\n\t */\n\tpublic function json() {\n\t\t$array                          = wp_array_slice_assoc( (array) $this, array( 'id', 'description', 'priority', 'type' ) );\n\t\t$array['title']                 = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );\n\t\t$array['content']               = $this->get_content();\n\t\t$array['active']                = $this->active();\n\t\t$array['instanceNumber']        = $this->instance_number;\n\t\t$array['autoExpandSoleSection'] = $this->auto_expand_sole_section;\n\t\treturn $array;\n\t}\n\n\t/**\n\t * Checks required user capabilities and whether the theme has the\n\t * feature support required by the panel.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @return bool False if theme doesn't support the panel or the user doesn't have the capability.\n\t */\n\tfinal public function check_capabilities() {\n\t\tif ( $this->capability && ! current_user_can( $this->capability ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $this->theme_supports && ! current_theme_supports( ... (array) $this->theme_supports ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Get the panel's content template for insertion into the Customizer pane.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @return string Content for the panel.\n\t */\n\tfinal public function get_content() {\n\t\tob_start();\n\t\t$this->maybe_render();\n\t\treturn trim( ob_get_clean() );\n\t}\n\n\t/**\n\t * Check capabilities and render the panel.\n\t *\n\t * @since 4.0.0\n\t */\n\tfinal public function maybe_render() {\n\t\tif ( ! $this->check_capabilities() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Fires before rendering a Customizer panel.\n\t\t *\n\t\t * @since 4.0.0\n\t\t *\n\t\t * @param WP_Customize_Panel $this WP_Customize_Panel instance.\n\t\t */\n\t\tdo_action( 'customize_render_panel', $this );\n\n\t\t/**\n\t\t * Fires before rendering a specific Customizer panel.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->id`, refers to\n\t\t * the ID of the specific Customizer panel to be rendered.\n\t\t *\n\t\t * @since 4.0.0\n\t\t */\n\t\tdo_action( \"customize_render_panel_{$this->id}\" );\n\n\t\t$this->render();\n\t}\n\n\t/**\n\t * Render the panel container, and then its contents (via `this->render_content()`) in a subclass.\n\t *\n\t * Panel containers are now rendered in JS by default, see WP_Customize_Panel::print_template().\n\t *\n\t * @since 4.0.0\n\t */\n\tprotected function render() {}\n\n\t/**\n\t * Render the panel UI in a subclass.\n\t *\n\t * Panel contents are now rendered in JS by default, see WP_Customize_Panel::print_template().\n\t *\n\t * @since 4.1.0\n\t */\n\tprotected function render_content() {}\n\n\t/**\n\t * Render the panel's JS templates.\n\t *\n\t * This function is only run for panel types that have been registered with\n\t * WP_Customize_Manager::register_panel_type().\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see WP_Customize_Manager::register_panel_type()\n\t */\n\tpublic function print_template() {\n\t\t?>\n\t\t<script type=\"text/html\" id=\"tmpl-customize-panel-<?php echo esc_attr( $this->type ); ?>-content\">\n\t\t\t<?php $this->content_template(); ?>\n\t\t</script>\n\t\t<script type=\"text/html\" id=\"tmpl-customize-panel-<?php echo esc_attr( $this->type ); ?>\">\n\t\t\t<?php $this->render_template(); ?>\n\t\t</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * An Underscore (JS) template for rendering this panel's container.\n\t *\n\t * Class variables for this panel class are available in the `data` JS object;\n\t * export custom variables by overriding WP_Customize_Panel::json().\n\t *\n\t * @see WP_Customize_Panel::print_template()\n\t *\n\t * @since 4.3.0\n\t */\n\tprotected function render_template() {\n\t\t?>\n\t\t<li id=\"accordion-panel-{{ data.id }}\" class=\"accordion-section control-section control-panel control-panel-{{ data.type }}\">\n\t\t\t<h3 class=\"accordion-section-title\" tabindex=\"0\">\n\t\t\t\t{{ data.title }}\n\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Press return or enter to open this panel' ); ?></span>\n\t\t\t</h3>\n\t\t\t<ul class=\"accordion-sub-container control-panel-content\"></ul>\n\t\t</li>\n\t\t<?php\n\t}\n\n\t/**\n\t * An Underscore (JS) template for this panel's content (but not its container).\n\t *\n\t * Class variables for this panel class are available in the `data` JS object;\n\t * export custom variables by overriding WP_Customize_Panel::json().\n\t *\n\t * @see WP_Customize_Panel::print_template()\n\t *\n\t * @since 4.3.0\n\t */\n\tprotected function content_template() {\n\t\t?>\n\t\t<li class=\"panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>\">\n\t\t\t<button class=\"customize-panel-back\" tabindex=\"-1\"><span class=\"screen-reader-text\"><?php _e( 'Back' ); ?></span></button>\n\t\t\t<div class=\"accordion-section-title\">\n\t\t\t\t<span class=\"preview-notice\">\n\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: The site/panel title in the Customizer. */\n\t\t\t\t\tprintf( __( 'You are customizing %s' ), '<strong class=\"panel-title\">{{ data.title }}</strong>' );\n\t\t\t\t?>\n\t\t\t\t</span>\n\t\t\t\t<# if ( data.description ) { #>\n\t\t\t\t\t<button type=\"button\" class=\"customize-help-toggle dashicons dashicons-editor-help\" aria-expanded=\"false\"><span class=\"screen-reader-text\"><?php _e( 'Help' ); ?></span></button>\n\t\t\t\t<# } #>\n\t\t\t</div>\n\t\t\t<# if ( data.description ) { #>\n\t\t\t\t<div class=\"description customize-panel-description\">\n\t\t\t\t\t{{{ data.description }}}\n\t\t\t\t</div>\n\t\t\t<# } #>\n\n\t\t\t<div class=\"customize-control-notifications-container\"></div>\n\t\t</li>\n\t\t<?php\n\t}\n}\n\n/** WP_Customize_Nav_Menus_Panel class */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menus-panel.php';\n", "num_lines": 395}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Customize Section classes\n *\n * @package WordPress\n * @subpackage Customize\n * @since 3.4.0\n */\n\n/**\n * Customize Section class.\n *\n * A UI container for controls, managed by the WP_Customize_Manager class.\n *\n * @since 3.4.0\n *\n * @see WP_Customize_Manager\n */\nclass WP_Customize_Section {\n\n\t/**\n\t * Incremented with each new class instantiation, then stored in $instance_number.\n\t *\n\t * Used when sorting two instances whose priorities are equal.\n\t *\n\t * @since 4.1.0\n\t * @var int\n\t */\n\tprotected static $instance_count = 0;\n\n\t/**\n\t * Order in which this instance was created in relation to other instances.\n\t *\n\t * @since 4.1.0\n\t * @var int\n\t */\n\tpublic $instance_number;\n\n\t/**\n\t * WP_Customize_Manager instance.\n\t *\n\t * @since 3.4.0\n\t * @var WP_Customize_Manager\n\t */\n\tpublic $manager;\n\n\t/**\n\t * Unique identifier.\n\t *\n\t * @since 3.4.0\n\t * @var string\n\t */\n\tpublic $id;\n\n\t/**\n\t * Priority of the section which informs load order of sections.\n\t *\n\t * @since 3.4.0\n\t * @var integer\n\t */\n\tpublic $priority = 160;\n\n\t/**\n\t * Panel in which to show the section, making it a sub-section.\n\t *\n\t * @since 4.0.0\n\t * @var string\n\t */\n\tpublic $panel = '';\n\n\t/**\n\t * Capability required for the section.\n\t *\n\t * @since 3.4.0\n\t * @var string\n\t */\n\tpublic $capability = 'edit_theme_options';\n\n\t/**\n\t * Theme features required to support the section.\n\t *\n\t * @since 3.4.0\n\t * @var string|string[]\n\t */\n\tpublic $theme_supports = '';\n\n\t/**\n\t * Title of the section to show in UI.\n\t *\n\t * @since 3.4.0\n\t * @var string\n\t */\n\tpublic $title = '';\n\n\t/**\n\t * Description to show in the UI.\n\t *\n\t * @since 3.4.0\n\t * @var string\n\t */\n\tpublic $description = '';\n\n\t/**\n\t * Customizer controls for this section.\n\t *\n\t * @since 3.4.0\n\t * @var array\n\t */\n\tpublic $controls;\n\n\t/**\n\t * Type of this section.\n\t *\n\t * @since 4.1.0\n\t * @var string\n\t */\n\tpublic $type = 'default';\n\n\t/**\n\t * Active callback.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @see WP_Customize_Section::active()\n\t *\n\t * @var callable Callback is called with one argument, the instance of\n\t *               WP_Customize_Section, and returns bool to indicate whether\n\t *               the section is active (such as it relates to the URL currently\n\t *               being previewed).\n\t */\n\tpublic $active_callback = '';\n\n\t/**\n\t * Show the description or hide it behind the help icon.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @var bool Indicates whether the Section's description should be\n\t *           hidden behind a help icon (\"?\") in the Section header,\n\t *           similar to how help icons are displayed on Panels.\n\t */\n\tpublic $description_hidden = false;\n\n\t/**\n\t * Constructor.\n\t *\n\t * Any supplied $args override class property defaults.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t * @param string               $id      A specific ID of the section.\n\t * @param array                $args    {\n\t *     Optional. Array of properties for the new Section object. Default empty array.\n\t *\n\t *     @type int             $priority           Priority of the section, defining the display order\n\t *                                               of panels and sections. Default 160.\n\t *     @type string          $panel              The panel this section belongs to (if any).\n\t *                                               Default empty.\n\t *     @type string          $capability         Capability required for the section.\n\t *                                               Default 'edit_theme_options'\n\t *     @type string|string[] $theme_supports     Theme features required to support the section.\n\t *     @type string          $title              Title of the section to show in UI.\n\t *     @type string          $description        Description to show in the UI.\n\t *     @type string          $type               Type of the section.\n\t *     @type callable        $active_callback    Active callback.\n\t *     @type bool            $description_hidden Hide the description behind a help icon,\n\t *                                               instead of inline above the first control.\n\t *                                               Default false.\n\t * }\n\t */\n\tpublic function __construct( $manager, $id, $args = array() ) {\n\t\t$keys = array_keys( get_object_vars( $this ) );\n\t\tforeach ( $keys as $key ) {\n\t\t\tif ( isset( $args[ $key ] ) ) {\n\t\t\t\t$this->$key = $args[ $key ];\n\t\t\t}\n\t\t}\n\n\t\t$this->manager = $manager;\n\t\t$this->id      = $id;\n\t\tif ( empty( $this->active_callback ) ) {\n\t\t\t$this->active_callback = array( $this, 'active_callback' );\n\t\t}\n\t\tself::$instance_count += 1;\n\t\t$this->instance_number = self::$instance_count;\n\n\t\t$this->controls = array(); // Users cannot customize the $controls array.\n\t}\n\n\t/**\n\t * Check whether section is active to current Customizer preview.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @return bool Whether the section is active to the current preview.\n\t */\n\tfinal public function active() {\n\t\t$section = $this;\n\t\t$active  = call_user_func( $this->active_callback, $this );\n\n\t\t/**\n\t\t * Filters response of WP_Customize_Section::active().\n\t\t *\n\t\t * @since 4.1.0\n\t\t *\n\t\t * @param bool                 $active  Whether the Customizer section is active.\n\t\t * @param WP_Customize_Section $section WP_Customize_Section instance.\n\t\t */\n\t\t$active = apply_filters( 'customize_section_active', $active, $section );\n\n\t\treturn $active;\n\t}\n\n\t/**\n\t * Default callback used when invoking WP_Customize_Section::active().\n\t *\n\t * Subclasses can override this with their specific logic, or they may provide\n\t * an 'active_callback' argument to the constructor.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @return true Always true.\n\t */\n\tpublic function active_callback() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Gather the parameters passed to client JavaScript via JSON.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @return array The array to be exported to the client as JSON.\n\t */\n\tpublic function json() {\n\t\t$array                   = wp_array_slice_assoc( (array) $this, array( 'id', 'description', 'priority', 'panel', 'type', 'description_hidden' ) );\n\t\t$array['title']          = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );\n\t\t$array['content']        = $this->get_content();\n\t\t$array['active']         = $this->active();\n\t\t$array['instanceNumber'] = $this->instance_number;\n\n\t\tif ( $this->panel ) {\n\t\t\t/* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */\n\t\t\t$array['customizeAction'] = sprintf( __( 'Customizing &#9656; %s' ), esc_html( $this->manager->get_panel( $this->panel )->title ) );\n\t\t} else {\n\t\t\t$array['customizeAction'] = __( 'Customizing' );\n\t\t}\n\n\t\treturn $array;\n\t}\n\n\t/**\n\t * Checks required user capabilities and whether the theme has the\n\t * feature support required by the section.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return bool False if theme doesn't support the section or user doesn't have the capability.\n\t */\n\tfinal public function check_capabilities() {\n\t\tif ( $this->capability && ! current_user_can( $this->capability ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $this->theme_supports && ! current_theme_supports( ... (array) $this->theme_supports ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Get the section's content for insertion into the Customizer pane.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @return string Contents of the section.\n\t */\n\tfinal public function get_content() {\n\t\tob_start();\n\t\t$this->maybe_render();\n\t\treturn trim( ob_get_clean() );\n\t}\n\n\t/**\n\t * Check capabilities and render the section.\n\t *\n\t * @since 3.4.0\n\t */\n\tfinal public function maybe_render() {\n\t\tif ( ! $this->check_capabilities() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Fires before rendering a Customizer section.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param WP_Customize_Section $this WP_Customize_Section instance.\n\t\t */\n\t\tdo_action( 'customize_render_section', $this );\n\t\t/**\n\t\t * Fires before rendering a specific Customizer section.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->id`, refers to the ID\n\t\t * of the specific Customizer section to be rendered.\n\t\t *\n\t\t * @since 3.4.0\n\t\t */\n\t\tdo_action( \"customize_render_section_{$this->id}\" );\n\n\t\t$this->render();\n\t}\n\n\t/**\n\t * Render the section UI in a subclass.\n\t *\n\t * Sections are now rendered in JS by default, see WP_Customize_Section::print_template().\n\t *\n\t * @since 3.4.0\n\t */\n\tprotected function render() {}\n\n\t/**\n\t * Render the section's JS template.\n\t *\n\t * This function is only run for section types that have been registered with\n\t * WP_Customize_Manager::register_section_type().\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see WP_Customize_Manager::render_template()\n\t */\n\tpublic function print_template() {\n\t\t?>\n\t\t<script type=\"text/html\" id=\"tmpl-customize-section-<?php echo $this->type; ?>\">\n\t\t\t<?php $this->render_template(); ?>\n\t\t</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * An Underscore (JS) template for rendering this section.\n\t *\n\t * Class variables for this section class are available in the `data` JS object;\n\t * export custom variables by overriding WP_Customize_Section::json().\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see WP_Customize_Section::print_template()\n\t */\n\tprotected function render_template() {\n\t\t?>\n\t\t<li id=\"accordion-section-{{ data.id }}\" class=\"accordion-section control-section control-section-{{ data.type }}\">\n\t\t\t<h3 class=\"accordion-section-title\" tabindex=\"0\">\n\t\t\t\t{{ data.title }}\n\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Press return or enter to open this section' ); ?></span>\n\t\t\t</h3>\n\t\t\t<ul class=\"accordion-section-content\">\n\t\t\t\t<li class=\"customize-section-description-container section-meta <# if ( data.description_hidden ) { #>customize-info<# } #>\">\n\t\t\t\t\t<div class=\"customize-section-title\">\n\t\t\t\t\t\t<button class=\"customize-section-back\" tabindex=\"-1\">\n\t\t\t\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Back' ); ?></span>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<h3>\n\t\t\t\t\t\t\t<span class=\"customize-action\">\n\t\t\t\t\t\t\t\t{{{ data.customizeAction }}}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t{{ data.title }}\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t<# if ( data.description && data.description_hidden ) { #>\n\t\t\t\t\t\t\t<button type=\"button\" class=\"customize-help-toggle dashicons dashicons-editor-help\" aria-expanded=\"false\"><span class=\"screen-reader-text\"><?php _e( 'Help' ); ?></span></button>\n\t\t\t\t\t\t\t<div class=\"description customize-section-description\">\n\t\t\t\t\t\t\t\t{{{ data.description }}}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<# } #>\n\n\t\t\t\t\t\t<div class=\"customize-control-notifications-container\"></div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<# if ( data.description && ! data.description_hidden ) { #>\n\t\t\t\t\t\t<div class=\"description customize-section-description\">\n\t\t\t\t\t\t\t{{{ data.description }}}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<# } #>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</li>\n\t\t<?php\n\t}\n}\n\n/** WP_Customize_Themes_Section class */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-themes-section.php';\n\n/** WP_Customize_Sidebar_Section class */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-sidebar-section.php';\n\n/** WP_Customize_Nav_Menu_Section class */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-section.php';\n", "num_lines": 403}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Customize Setting classes\n *\n * @package WordPress\n * @subpackage Customize\n * @since 3.4.0\n */\n\n/**\n * Customize Setting class.\n *\n * Handles saving and sanitizing of settings.\n *\n * @since 3.4.0\n *\n * @see WP_Customize_Manager\n * @link https://developer.wordpress.org/themes/customize-api\n */\nclass WP_Customize_Setting {\n\t/**\n\t * Customizer bootstrap instance.\n\t *\n\t * @since 3.4.0\n\t * @var WP_Customize_Manager\n\t */\n\tpublic $manager;\n\n\t/**\n\t * Unique string identifier for the setting.\n\t *\n\t * @since 3.4.0\n\t * @var string\n\t */\n\tpublic $id;\n\n\t/**\n\t * Type of customize settings.\n\t *\n\t * @since 3.4.0\n\t * @var string\n\t */\n\tpublic $type = 'theme_mod';\n\n\t/**\n\t * Capability required to edit this setting.\n\t *\n\t * @since 3.4.0\n\t * @var string|array\n\t */\n\tpublic $capability = 'edit_theme_options';\n\n\t/**\n\t * Theme features required to support the setting.\n\t *\n\t * @since 3.4.0\n\t * @var string|string[]\n\t */\n\tpublic $theme_supports = '';\n\n\t/**\n\t * The default value for the setting.\n\t *\n\t * @since 3.4.0\n\t * @var string\n\t */\n\tpublic $default = '';\n\n\t/**\n\t * Options for rendering the live preview of changes in Customizer.\n\t *\n\t * Set this value to 'postMessage' to enable a custom JavaScript handler to render changes to this setting\n\t * as opposed to reloading the whole page.\n\t *\n\t * @since 3.4.0\n\t * @var string\n\t */\n\tpublic $transport = 'refresh';\n\n\t/**\n\t * Server-side validation callback for the setting's value.\n\t *\n\t * @since 4.6.0\n\t * @var callable\n\t */\n\tpublic $validate_callback = '';\n\n\t/**\n\t * Callback to filter a Customize setting value in un-slashed form.\n\t *\n\t * @since 3.4.0\n\t * @var callable\n\t */\n\tpublic $sanitize_callback = '';\n\n\t/**\n\t * Callback to convert a Customize PHP setting value to a value that is JSON serializable.\n\t *\n\t * @since 3.4.0\n\t * @var callable\n\t */\n\tpublic $sanitize_js_callback = '';\n\n\t/**\n\t * Whether or not the setting is initially dirty when created.\n\t *\n\t * This is used to ensure that a setting will be sent from the pane to the\n\t * preview when loading the Customizer. Normally a setting only is synced to\n\t * the preview if it has been changed. This allows the setting to be sent\n\t * from the start.\n\t *\n\t * @since 4.2.0\n\t * @var bool\n\t */\n\tpublic $dirty = false;\n\n\t/**\n\t * ID Data.\n\t *\n\t * @since 3.4.0\n\t * @var array\n\t */\n\tprotected $id_data = array();\n\n\t/**\n\t * Whether or not preview() was called.\n\t *\n\t * @since 4.4.0\n\t * @var bool\n\t */\n\tprotected $is_previewed = false;\n\n\t/**\n\t * Cache of multidimensional values to improve performance.\n\t *\n\t * @since 4.4.0\n\t * @var array\n\t */\n\tprotected static $aggregated_multidimensionals = array();\n\n\t/**\n\t * Whether the multidimensional setting is aggregated.\n\t *\n\t * @since 4.4.0\n\t * @var bool\n\t */\n\tprotected $is_multidimensional_aggregated = false;\n\n\t/**\n\t * Constructor.\n\t *\n\t * Any supplied $args override class property defaults.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t * @param string               $id      A specific ID of the setting.\n\t *                                      Can be a theme mod or option name.\n\t * @param array                $args    {\n\t *     Optional. Array of properties for the new Setting object. Default empty array.\n\t *\n\t *     @type string          $type                 Type of the setting. Default 'theme_mod'.\n\t *     @type string          $capability           Capability required for the setting. Default 'edit_theme_options'\n\t *     @type string|string[] $theme_supports       Theme features required to support the panel. Default is none.\n\t *     @type string          $default              Default value for the setting. Default is empty string.\n\t *     @type string          $transport            Options for rendering the live preview of changes in Customizer.\n\t *                                                 Using 'refresh' makes the change visible by reloading the whole preview.\n\t *                                                 Using 'postMessage' allows a custom JavaScript to handle live changes.\n\t *                                                 Default is 'refresh'.\n\t *     @type callable        $validate_callback    Server-side validation callback for the setting's value.\n\t *     @type callable        $sanitize_callback    Callback to filter a Customize setting value in un-slashed form.\n\t *     @type callable        $sanitize_js_callback Callback to convert a Customize PHP setting value to a value that is\n\t *                                                 JSON serializable.\n\t *     @type bool            $dirty                Whether or not the setting is initially dirty when created.\n\t * }\n\t */\n\tpublic function __construct( $manager, $id, $args = array() ) {\n\t\t$keys = array_keys( get_object_vars( $this ) );\n\t\tforeach ( $keys as $key ) {\n\t\t\tif ( isset( $args[ $key ] ) ) {\n\t\t\t\t$this->$key = $args[ $key ];\n\t\t\t}\n\t\t}\n\n\t\t$this->manager = $manager;\n\t\t$this->id      = $id;\n\n\t\t// Parse the ID for array keys.\n\t\t$this->id_data['keys'] = preg_split( '/\\[/', str_replace( ']', '', $this->id ) );\n\t\t$this->id_data['base'] = array_shift( $this->id_data['keys'] );\n\n\t\t// Rebuild the ID.\n\t\t$this->id = $this->id_data['base'];\n\t\tif ( ! empty( $this->id_data['keys'] ) ) {\n\t\t\t$this->id .= '[' . implode( '][', $this->id_data['keys'] ) . ']';\n\t\t}\n\n\t\tif ( $this->validate_callback ) {\n\t\t\tadd_filter( \"customize_validate_{$this->id}\", $this->validate_callback, 10, 3 );\n\t\t}\n\t\tif ( $this->sanitize_callback ) {\n\t\t\tadd_filter( \"customize_sanitize_{$this->id}\", $this->sanitize_callback, 10, 2 );\n\t\t}\n\t\tif ( $this->sanitize_js_callback ) {\n\t\t\tadd_filter( \"customize_sanitize_js_{$this->id}\", $this->sanitize_js_callback, 10, 2 );\n\t\t}\n\n\t\tif ( 'option' === $this->type || 'theme_mod' === $this->type ) {\n\t\t\t// Other setting types can opt-in to aggregate multidimensional explicitly.\n\t\t\t$this->aggregate_multidimensional();\n\n\t\t\t// Allow option settings to indicate whether they should be autoloaded.\n\t\t\tif ( 'option' === $this->type && isset( $args['autoload'] ) ) {\n\t\t\t\tself::$aggregated_multidimensionals[ $this->type ][ $this->id_data['base'] ]['autoload'] = $args['autoload'];\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Get parsed ID data for multidimensional setting.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return array {\n\t *     ID data for multidimensional setting.\n\t *\n\t *     @type string $base ID base\n\t *     @type array  $keys Keys for multidimensional array.\n\t * }\n\t */\n\tfinal public function id_data() {\n\t\treturn $this->id_data;\n\t}\n\n\t/**\n\t * Set up the setting for aggregated multidimensional values.\n\t *\n\t * When a multidimensional setting gets aggregated, all of its preview and update\n\t * calls get combined into one call, greatly improving performance.\n\t *\n\t * @since 4.4.0\n\t */\n\tprotected function aggregate_multidimensional() {\n\t\t$id_base = $this->id_data['base'];\n\t\tif ( ! isset( self::$aggregated_multidimensionals[ $this->type ] ) ) {\n\t\t\tself::$aggregated_multidimensionals[ $this->type ] = array();\n\t\t}\n\t\tif ( ! isset( self::$aggregated_multidimensionals[ $this->type ][ $id_base ] ) ) {\n\t\t\tself::$aggregated_multidimensionals[ $this->type ][ $id_base ] = array(\n\t\t\t\t'previewed_instances'       => array(), // Calling preview() will add the $setting to the array.\n\t\t\t\t'preview_applied_instances' => array(), // Flags for which settings have had their values applied.\n\t\t\t\t'root_value'                => $this->get_root_value( array() ), // Root value for initial state, manipulated by preview and update calls.\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $this->id_data['keys'] ) ) {\n\t\t\t// Note the preview-applied flag is cleared at priority 9 to ensure it is cleared before a deferred-preview runs.\n\t\t\tadd_action( \"customize_post_value_set_{$this->id}\", array( $this, '_clear_aggregated_multidimensional_preview_applied_flag' ), 9 );\n\t\t\t$this->is_multidimensional_aggregated = true;\n\t\t}\n\t}\n\n\t/**\n\t * Reset `$aggregated_multidimensionals` static variable.\n\t *\n\t * This is intended only for use by unit tests.\n\t *\n\t * @since 4.5.0\n\t * @ignore\n\t */\n\tstatic public function reset_aggregated_multidimensionals() {\n\t\tself::$aggregated_multidimensionals = array();\n\t}\n\n\t/**\n\t * The ID for the current site when the preview() method was called.\n\t *\n\t * @since 4.2.0\n\t * @var int\n\t */\n\tprotected $_previewed_blog_id;\n\n\t/**\n\t * Return true if the current site is not the same as the previewed site.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @return bool If preview() has been called.\n\t */\n\tpublic function is_current_blog_previewed() {\n\t\tif ( ! isset( $this->_previewed_blog_id ) ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn ( get_current_blog_id() === $this->_previewed_blog_id );\n\t}\n\n\t/**\n\t * Original non-previewed value stored by the preview method.\n\t *\n\t * @see WP_Customize_Setting::preview()\n\t * @since 4.1.1\n\t * @var mixed\n\t */\n\tprotected $_original_value;\n\n\t/**\n\t * Add filters to supply the setting's value when accessed.\n\t *\n\t * If the setting already has a pre-existing value and there is no incoming\n\t * post value for the setting, then this method will short-circuit since\n\t * there is no change to preview.\n\t *\n\t * @since 3.4.0\n\t * @since 4.4.0 Added boolean return value.\n\t *\n\t * @return bool False when preview short-circuits due no change needing to be previewed.\n\t */\n\tpublic function preview() {\n\t\tif ( ! isset( $this->_previewed_blog_id ) ) {\n\t\t\t$this->_previewed_blog_id = get_current_blog_id();\n\t\t}\n\n\t\t// Prevent re-previewing an already-previewed setting.\n\t\tif ( $this->is_previewed ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$id_base                 = $this->id_data['base'];\n\t\t$is_multidimensional     = ! empty( $this->id_data['keys'] );\n\t\t$multidimensional_filter = array( $this, '_multidimensional_preview_filter' );\n\n\t\t/*\n\t\t * Check if the setting has a pre-existing value (an isset check),\n\t\t * and if doesn't have any incoming post value. If both checks are true,\n\t\t * then the preview short-circuits because there is nothing that needs\n\t\t * to be previewed.\n\t\t */\n\t\t$undefined     = new stdClass();\n\t\t$needs_preview = ( $undefined !== $this->post_value( $undefined ) );\n\t\t$value         = null;\n\n\t\t// Since no post value was defined, check if we have an initial value set.\n\t\tif ( ! $needs_preview ) {\n\t\t\tif ( $this->is_multidimensional_aggregated ) {\n\t\t\t\t$root  = self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['root_value'];\n\t\t\t\t$value = $this->multidimensional_get( $root, $this->id_data['keys'], $undefined );\n\t\t\t} else {\n\t\t\t\t$default       = $this->default;\n\t\t\t\t$this->default = $undefined; // Temporarily set default to undefined so we can detect if existing value is set.\n\t\t\t\t$value         = $this->value();\n\t\t\t\t$this->default = $default;\n\t\t\t}\n\t\t\t$needs_preview = ( $undefined === $value ); // Because the default needs to be supplied.\n\t\t}\n\n\t\t// If the setting does not need previewing now, defer to when it has a value to preview.\n\t\tif ( ! $needs_preview ) {\n\t\t\tif ( ! has_action( \"customize_post_value_set_{$this->id}\", array( $this, 'preview' ) ) ) {\n\t\t\t\tadd_action( \"customize_post_value_set_{$this->id}\", array( $this, 'preview' ) );\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch ( $this->type ) {\n\t\t\tcase 'theme_mod':\n\t\t\t\tif ( ! $is_multidimensional ) {\n\t\t\t\t\tadd_filter( \"theme_mod_{$id_base}\", array( $this, '_preview_filter' ) );\n\t\t\t\t} else {\n\t\t\t\t\tif ( empty( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'] ) ) {\n\t\t\t\t\t\t// Only add this filter once for this ID base.\n\t\t\t\t\t\tadd_filter( \"theme_mod_{$id_base}\", $multidimensional_filter );\n\t\t\t\t\t}\n\t\t\t\t\tself::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'][ $this->id ] = $this;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'option':\n\t\t\t\tif ( ! $is_multidimensional ) {\n\t\t\t\t\tadd_filter( \"pre_option_{$id_base}\", array( $this, '_preview_filter' ) );\n\t\t\t\t} else {\n\t\t\t\t\tif ( empty( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'] ) ) {\n\t\t\t\t\t\t// Only add these filters once for this ID base.\n\t\t\t\t\t\tadd_filter( \"option_{$id_base}\", $multidimensional_filter );\n\t\t\t\t\t\tadd_filter( \"default_option_{$id_base}\", $multidimensional_filter );\n\t\t\t\t\t}\n\t\t\t\t\tself::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'][ $this->id ] = $this;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t/**\n\t\t\t\t * Fires when the WP_Customize_Setting::preview() method is called for settings\n\t\t\t\t * not handled as theme_mods or options.\n\t\t\t\t *\n\t\t\t\t * The dynamic portion of the hook name, `$this->id`, refers to the setting ID.\n\t\t\t\t *\n\t\t\t\t * @since 3.4.0\n\t\t\t\t *\n\t\t\t\t * @param WP_Customize_Setting $this WP_Customize_Setting instance.\n\t\t\t\t */\n\t\t\t\tdo_action( \"customize_preview_{$this->id}\", $this );\n\n\t\t\t\t/**\n\t\t\t\t * Fires when the WP_Customize_Setting::preview() method is called for settings\n\t\t\t\t * not handled as theme_mods or options.\n\t\t\t\t *\n\t\t\t\t * The dynamic portion of the hook name, `$this->type`, refers to the setting type.\n\t\t\t\t *\n\t\t\t\t * @since 4.1.0\n\t\t\t\t *\n\t\t\t\t * @param WP_Customize_Setting $this WP_Customize_Setting instance.\n\t\t\t\t */\n\t\t\t\tdo_action( \"customize_preview_{$this->type}\", $this );\n\t\t}\n\n\t\t$this->is_previewed = true;\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Clear out the previewed-applied flag for a multidimensional-aggregated value whenever its post value is updated.\n\t *\n\t * This ensures that the new value will get sanitized and used the next time\n\t * that `WP_Customize_Setting::_multidimensional_preview_filter()`\n\t * is called for this setting.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @see WP_Customize_Manager::set_post_value()\n\t * @see WP_Customize_Setting::_multidimensional_preview_filter()\n\t */\n\tfinal public function _clear_aggregated_multidimensional_preview_applied_flag() {\n\t\tunset( self::$aggregated_multidimensionals[ $this->type ][ $this->id_data['base'] ]['preview_applied_instances'][ $this->id ] );\n\t}\n\n\t/**\n\t * Callback function to filter non-multidimensional theme mods and options.\n\t *\n\t * If switch_to_blog() was called after the preview() method, and the current\n\t * site is now not the same site, then this method does a no-op and returns\n\t * the original value.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param mixed $original Old value.\n\t * @return mixed New or old value.\n\t */\n\tpublic function _preview_filter( $original ) {\n\t\tif ( ! $this->is_current_blog_previewed() ) {\n\t\t\treturn $original;\n\t\t}\n\n\t\t$undefined  = new stdClass(); // Symbol hack.\n\t\t$post_value = $this->post_value( $undefined );\n\t\tif ( $undefined !== $post_value ) {\n\t\t\t$value = $post_value;\n\t\t} else {\n\t\t\t/*\n\t\t\t * Note that we don't use $original here because preview() will\n\t\t\t * not add the filter in the first place if it has an initial value\n\t\t\t * and there is no post value.\n\t\t\t */\n\t\t\t$value = $this->default;\n\t\t}\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Callback function to filter multidimensional theme mods and options.\n\t *\n\t * For all multidimensional settings of a given type, the preview filter for\n\t * the first setting previewed will be used to apply the values for the others.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @see WP_Customize_Setting::$aggregated_multidimensionals\n\t * @param mixed $original Original root value.\n\t * @return mixed New or old value.\n\t */\n\tfinal public function _multidimensional_preview_filter( $original ) {\n\t\tif ( ! $this->is_current_blog_previewed() ) {\n\t\t\treturn $original;\n\t\t}\n\n\t\t$id_base = $this->id_data['base'];\n\n\t\t// If no settings have been previewed yet (which should not be the case, since $this is), just pass through the original value.\n\t\tif ( empty( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'] ) ) {\n\t\t\treturn $original;\n\t\t}\n\n\t\tforeach ( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'] as $previewed_setting ) {\n\t\t\t// Skip applying previewed value for any settings that have already been applied.\n\t\t\tif ( ! empty( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['preview_applied_instances'][ $previewed_setting->id ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Do the replacements of the posted/default sub value into the root value.\n\t\t\t$value = $previewed_setting->post_value( $previewed_setting->default );\n\t\t\t$root  = self::$aggregated_multidimensionals[ $previewed_setting->type ][ $id_base ]['root_value'];\n\t\t\t$root  = $previewed_setting->multidimensional_replace( $root, $previewed_setting->id_data['keys'], $value );\n\t\t\tself::$aggregated_multidimensionals[ $previewed_setting->type ][ $id_base ]['root_value'] = $root;\n\n\t\t\t// Mark this setting having been applied so that it will be skipped when the filter is called again.\n\t\t\tself::$aggregated_multidimensionals[ $previewed_setting->type ][ $id_base ]['preview_applied_instances'][ $previewed_setting->id ] = true;\n\t\t}\n\n\t\treturn self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['root_value'];\n\t}\n\n\t/**\n\t * Checks user capabilities and theme supports, and then saves\n\t * the value of the setting.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return void|false False if cap check fails or value isn't set or is invalid.\n\t */\n\tfinal public function save() {\n\t\t$value = $this->post_value();\n\n\t\tif ( ! $this->check_capabilities() || ! isset( $value ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$id_base = $this->id_data['base'];\n\n\t\t/**\n\t\t * Fires when the WP_Customize_Setting::save() method is called.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$id_base` refers to\n\t\t * the base slug of the setting name.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param WP_Customize_Setting $this WP_Customize_Setting instance.\n\t\t */\n\t\tdo_action( \"customize_save_{$id_base}\", $this );\n\n\t\t$this->update( $value );\n\t}\n\n\t/**\n\t * Fetch and sanitize the $_POST value for the setting.\n\t *\n\t * During a save request prior to save, post_value() provides the new value while value() does not.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param mixed $default A default value which is used as a fallback. Default null.\n\t * @return mixed The default value on failure, otherwise the sanitized and validated value.\n\t */\n\tfinal public function post_value( $default = null ) {\n\t\treturn $this->manager->post_value( $this, $default );\n\t}\n\n\t/**\n\t * Sanitize an input.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string|array $value    The value to sanitize.\n\t * @return string|array|null|WP_Error Sanitized value, or `null`/`WP_Error` if invalid.\n\t */\n\tpublic function sanitize( $value ) {\n\n\t\t/**\n\t\t * Filters a Customize setting value in un-slashed form.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param mixed                $value Value of the setting.\n\t\t * @param WP_Customize_Setting $this  WP_Customize_Setting instance.\n\t\t */\n\t\treturn apply_filters( \"customize_sanitize_{$this->id}\", $value, $this );\n\t}\n\n\t/**\n\t * Validates an input.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @see WP_REST_Request::has_valid_params()\n\t *\n\t * @param mixed $value Value to validate.\n\t * @return true|WP_Error True if the input was validated, otherwise WP_Error.\n\t */\n\tpublic function validate( $value ) {\n\t\tif ( is_wp_error( $value ) ) {\n\t\t\treturn $value;\n\t\t}\n\t\tif ( is_null( $value ) ) {\n\t\t\treturn new WP_Error( 'invalid_value', __( 'Invalid value.' ) );\n\t\t}\n\n\t\t$validity = new WP_Error();\n\n\t\t/**\n\t\t * Validates a Customize setting value.\n\t\t *\n\t\t * Plugins should amend the `$validity` object via its `WP_Error::add()` method.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->ID`, refers to the setting ID.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param WP_Error             $validity Filtered from `true` to `WP_Error` when invalid.\n\t\t * @param mixed                $value    Value of the setting.\n\t\t * @param WP_Customize_Setting $this     WP_Customize_Setting instance.\n\t\t */\n\t\t$validity = apply_filters( \"customize_validate_{$this->id}\", $validity, $value, $this );\n\n\t\tif ( is_wp_error( $validity ) && ! $validity->has_errors() ) {\n\t\t\t$validity = true;\n\t\t}\n\t\treturn $validity;\n\t}\n\n\t/**\n\t * Get the root value for a setting, especially for multidimensional ones.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param mixed $default Value to return if root does not exist.\n\t * @return mixed\n\t */\n\tprotected function get_root_value( $default = null ) {\n\t\t$id_base = $this->id_data['base'];\n\t\tif ( 'option' === $this->type ) {\n\t\t\treturn get_option( $id_base, $default );\n\t\t} elseif ( 'theme_mod' === $this->type ) {\n\t\t\treturn get_theme_mod( $id_base, $default );\n\t\t} else {\n\t\t\t/*\n\t\t\t * Any WP_Customize_Setting subclass implementing aggregate multidimensional\n\t\t\t * will need to override this method to obtain the data from the appropriate\n\t\t\t * location.\n\t\t\t */\n\t\t\treturn $default;\n\t\t}\n\t}\n\n\t/**\n\t * Set the root value for a setting, especially for multidimensional ones.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param mixed $value Value to set as root of multidimensional setting.\n\t * @return bool Whether the multidimensional root was updated successfully.\n\t */\n\tprotected function set_root_value( $value ) {\n\t\t$id_base = $this->id_data['base'];\n\t\tif ( 'option' === $this->type ) {\n\t\t\t$autoload = true;\n\t\t\tif ( isset( self::$aggregated_multidimensionals[ $this->type ][ $this->id_data['base'] ]['autoload'] ) ) {\n\t\t\t\t$autoload = self::$aggregated_multidimensionals[ $this->type ][ $this->id_data['base'] ]['autoload'];\n\t\t\t}\n\t\t\treturn update_option( $id_base, $value, $autoload );\n\t\t} elseif ( 'theme_mod' === $this->type ) {\n\t\t\tset_theme_mod( $id_base, $value );\n\t\t\treturn true;\n\t\t} else {\n\t\t\t/*\n\t\t\t * Any WP_Customize_Setting subclass implementing aggregate multidimensional\n\t\t\t * will need to override this method to obtain the data from the appropriate\n\t\t\t * location.\n\t\t\t */\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Save the value of the setting, using the related API.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param mixed $value The value to update.\n\t * @return bool The result of saving the value.\n\t */\n\tprotected function update( $value ) {\n\t\t$id_base = $this->id_data['base'];\n\t\tif ( 'option' === $this->type || 'theme_mod' === $this->type ) {\n\t\t\tif ( ! $this->is_multidimensional_aggregated ) {\n\t\t\t\treturn $this->set_root_value( $value );\n\t\t\t} else {\n\t\t\t\t$root = self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['root_value'];\n\t\t\t\t$root = $this->multidimensional_replace( $root, $this->id_data['keys'], $value );\n\t\t\t\tself::$aggregated_multidimensionals[ $this->type ][ $id_base ]['root_value'] = $root;\n\t\t\t\treturn $this->set_root_value( $root );\n\t\t\t}\n\t\t} else {\n\t\t\t/**\n\t\t\t * Fires when the WP_Customize_Setting::update() method is called for settings\n\t\t\t * not handled as theme_mods or options.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$this->type`, refers to the type of setting.\n\t\t\t *\n\t\t\t * @since 3.4.0\n\t\t\t *\n\t\t\t * @param mixed                $value Value of the setting.\n\t\t\t * @param WP_Customize_Setting $this  WP_Customize_Setting instance.\n\t\t\t */\n\t\t\tdo_action( \"customize_update_{$this->type}\", $value, $this );\n\n\t\t\treturn has_action( \"customize_update_{$this->type}\" );\n\t\t}\n\t}\n\n\t/**\n\t * Deprecated method.\n\t *\n\t * @since 3.4.0\n\t * @deprecated 4.4.0 Deprecated in favor of update() method.\n\t */\n\tprotected function _update_theme_mod() {\n\t\t_deprecated_function( __METHOD__, '4.4.0', __CLASS__ . '::update()' );\n\t}\n\n\t/**\n\t * Deprecated method.\n\t *\n\t * @since 3.4.0\n\t * @deprecated 4.4.0 Deprecated in favor of update() method.\n\t */\n\tprotected function _update_option() {\n\t\t_deprecated_function( __METHOD__, '4.4.0', __CLASS__ . '::update()' );\n\t}\n\n\t/**\n\t * Fetch the value of the setting.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return mixed The value.\n\t */\n\tpublic function value() {\n\t\t$id_base      = $this->id_data['base'];\n\t\t$is_core_type = ( 'option' === $this->type || 'theme_mod' === $this->type );\n\n\t\tif ( ! $is_core_type && ! $this->is_multidimensional_aggregated ) {\n\n\t\t\t// Use post value if previewed and a post value is present.\n\t\t\tif ( $this->is_previewed ) {\n\t\t\t\t$value = $this->post_value( null );\n\t\t\t\tif ( null !== $value ) {\n\t\t\t\t\treturn $value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$value = $this->get_root_value( $this->default );\n\n\t\t\t/**\n\t\t\t * Filters a Customize setting value not handled as a theme_mod or option.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$id_base`, refers to\n\t\t\t * the base slug of the setting name, initialized from `$this->id_data['base']`.\n\t\t\t *\n\t\t\t * For settings handled as theme_mods or options, see those corresponding\n\t\t\t * functions for available hooks.\n\t\t\t *\n\t\t\t * @since 3.4.0\n\t\t\t * @since 4.6.0 Added the `$this` setting instance as the second parameter.\n\t\t\t *\n\t\t\t * @param mixed                $default The setting default value. Default empty.\n\t\t\t * @param WP_Customize_Setting $this    The setting instance.\n\t\t\t */\n\t\t\t$value = apply_filters( \"customize_value_{$id_base}\", $value, $this );\n\t\t} elseif ( $this->is_multidimensional_aggregated ) {\n\t\t\t$root_value = self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['root_value'];\n\t\t\t$value      = $this->multidimensional_get( $root_value, $this->id_data['keys'], $this->default );\n\n\t\t\t// Ensure that the post value is used if the setting is previewed, since preview filters aren't applying on cached $root_value.\n\t\t\tif ( $this->is_previewed ) {\n\t\t\t\t$value = $this->post_value( $value );\n\t\t\t}\n\t\t} else {\n\t\t\t$value = $this->get_root_value( $this->default );\n\t\t}\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Sanitize the setting's value for use in JavaScript.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return mixed The requested escaped value.\n\t */\n\tpublic function js_value() {\n\n\t\t/**\n\t\t * Filters a Customize setting value for use in JavaScript.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->id`, refers to the setting ID.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param mixed                $value The setting value.\n\t\t * @param WP_Customize_Setting $this  WP_Customize_Setting instance.\n\t\t */\n\t\t$value = apply_filters( \"customize_sanitize_js_{$this->id}\", $this->value(), $this );\n\n\t\tif ( is_string( $value ) ) {\n\t\t\treturn html_entity_decode( $value, ENT_QUOTES, 'UTF-8' );\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Retrieves the data to export to the client via JSON.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @return array Array of parameters passed to JavaScript.\n\t */\n\tpublic function json() {\n\t\treturn array(\n\t\t\t'value'     => $this->js_value(),\n\t\t\t'transport' => $this->transport,\n\t\t\t'dirty'     => $this->dirty,\n\t\t\t'type'      => $this->type,\n\t\t);\n\t}\n\n\t/**\n\t * Validate user capabilities whether the theme supports the setting.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return bool False if theme doesn't support the setting or user can't change setting, otherwise true.\n\t */\n\tfinal public function check_capabilities() {\n\t\tif ( $this->capability && ! current_user_can( $this->capability ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $this->theme_supports && ! current_theme_supports( ... (array) $this->theme_supports ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Multidimensional helper function.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param array $root\n\t * @param array $keys\n\t * @param bool  $create Default false.\n\t * @return array|void Keys are 'root', 'node', and 'key'.\n\t */\n\tfinal protected function multidimensional( &$root, $keys, $create = false ) {\n\t\tif ( $create && empty( $root ) ) {\n\t\t\t$root = array();\n\t\t}\n\n\t\tif ( ! isset( $root ) || empty( $keys ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$last = array_pop( $keys );\n\t\t$node = &$root;\n\n\t\tforeach ( $keys as $key ) {\n\t\t\tif ( $create && ! isset( $node[ $key ] ) ) {\n\t\t\t\t$node[ $key ] = array();\n\t\t\t}\n\n\t\t\tif ( ! is_array( $node ) || ! isset( $node[ $key ] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$node = &$node[ $key ];\n\t\t}\n\n\t\tif ( $create ) {\n\t\t\tif ( ! is_array( $node ) ) {\n\t\t\t\t// Account for an array overriding a string or object value.\n\t\t\t\t$node = array();\n\t\t\t}\n\t\t\tif ( ! isset( $node[ $last ] ) ) {\n\t\t\t\t$node[ $last ] = array();\n\t\t\t}\n\t\t}\n\n\t\tif ( ! isset( $node[ $last ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn array(\n\t\t\t'root' => &$root,\n\t\t\t'node' => &$node,\n\t\t\t'key'  => $last,\n\t\t);\n\t}\n\n\t/**\n\t * Will attempt to replace a specific value in a multidimensional array.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param array $root\n\t * @param array $keys\n\t * @param mixed $value The value to update.\n\t * @return mixed\n\t */\n\tfinal protected function multidimensional_replace( $root, $keys, $value ) {\n\t\tif ( ! isset( $value ) ) {\n\t\t\treturn $root;\n\t\t} elseif ( empty( $keys ) ) { // If there are no keys, we're replacing the root.\n\t\t\treturn $value;\n\t\t}\n\n\t\t$result = $this->multidimensional( $root, $keys, true );\n\n\t\tif ( isset( $result ) ) {\n\t\t\t$result['node'][ $result['key'] ] = $value;\n\t\t}\n\n\t\treturn $root;\n\t}\n\n\t/**\n\t * Will attempt to fetch a specific value from a multidimensional array.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param array $root\n\t * @param array $keys\n\t * @param mixed $default A default value which is used as a fallback. Default null.\n\t * @return mixed The requested value or the default value.\n\t */\n\tfinal protected function multidimensional_get( $root, $keys, $default = null ) {\n\t\tif ( empty( $keys ) ) { // If there are no keys, test the root.\n\t\t\treturn isset( $root ) ? $root : $default;\n\t\t}\n\n\t\t$result = $this->multidimensional( $root, $keys );\n\t\treturn isset( $result ) ? $result['node'][ $result['key'] ] : $default;\n\t}\n\n\t/**\n\t * Will attempt to check if a specific value in a multidimensional array is set.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param array $root\n\t * @param array $keys\n\t * @return bool True if value is set, false if not.\n\t */\n\tfinal protected function multidimensional_isset( $root, $keys ) {\n\t\t$result = $this->multidimensional_get( $root, $keys );\n\t\treturn isset( $result );\n\t}\n}\n\n/**\n * WP_Customize_Filter_Setting class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-filter-setting.php';\n\n/**\n * WP_Customize_Header_Image_Setting class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-header-image-setting.php';\n\n/**\n * WP_Customize_Background_Image_Setting class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-background-image-setting.php';\n\n/**\n * WP_Customize_Nav_Menu_Item_Setting class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-setting.php';\n\n/**\n * WP_Customize_Nav_Menu_Setting class.\n */\nrequire_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-setting.php';\n", "num_lines": 983}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Customize Widgets classes\n *\n * @package WordPress\n * @subpackage Customize\n * @since 3.9.0\n */\n\n/**\n * Customize Widgets class.\n *\n * Implements widget management in the Customizer.\n *\n * @since 3.9.0\n *\n * @see WP_Customize_Manager\n */\nfinal class WP_Customize_Widgets {\n\n\t/**\n\t * WP_Customize_Manager instance.\n\t *\n\t * @since 3.9.0\n\t * @var WP_Customize_Manager\n\t */\n\tpublic $manager;\n\n\t/**\n\t * All id_bases for widgets defined in core.\n\t *\n\t * @since 3.9.0\n\t * @var array\n\t */\n\tprotected $core_widget_id_bases = array(\n\t\t'archives',\n\t\t'calendar',\n\t\t'categories',\n\t\t'custom_html',\n\t\t'links',\n\t\t'media_audio',\n\t\t'media_image',\n\t\t'media_video',\n\t\t'meta',\n\t\t'nav_menu',\n\t\t'pages',\n\t\t'recent-comments',\n\t\t'recent-posts',\n\t\t'rss',\n\t\t'search',\n\t\t'tag_cloud',\n\t\t'text',\n\t);\n\n\t/**\n\t * @since 3.9.0\n\t * @var array\n\t */\n\tprotected $rendered_sidebars = array();\n\n\t/**\n\t * @since 3.9.0\n\t * @var array\n\t */\n\tprotected $rendered_widgets = array();\n\n\t/**\n\t * @since 3.9.0\n\t * @var array\n\t */\n\tprotected $old_sidebars_widgets = array();\n\n\t/**\n\t * Mapping of widget ID base to whether it supports selective refresh.\n\t *\n\t * @since 4.5.0\n\t * @var array\n\t */\n\tprotected $selective_refreshable_widgets;\n\n\t/**\n\t * Mapping of setting type to setting ID pattern.\n\t *\n\t * @since 4.2.0\n\t * @var array\n\t */\n\tprotected $setting_id_patterns = array(\n\t\t'widget_instance' => '/^widget_(?P<id_base>.+?)(?:\\[(?P<widget_number>\\d+)\\])?$/',\n\t\t'sidebar_widgets' => '/^sidebars_widgets\\[(?P<sidebar_id>.+?)\\]$/',\n\t);\n\n\t/**\n\t * Initial loader.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t */\n\tpublic function __construct( $manager ) {\n\t\t$this->manager = $manager;\n\n\t\t// See https://github.com/xwp/wp-customize-snapshots/blob/962586659688a5b1fd9ae93618b7ce2d4e7a421c/php/class-customize-snapshot-manager.php#L420-L449\n\t\tadd_filter( 'customize_dynamic_setting_args', array( $this, 'filter_customize_dynamic_setting_args' ), 10, 2 );\n\t\tadd_action( 'widgets_init', array( $this, 'register_settings' ), 95 );\n\t\tadd_action( 'customize_register', array( $this, 'schedule_customize_register' ), 1 );\n\n\t\t// Skip remaining hooks when the user can't manage widgets anyway.\n\t\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_action( 'wp_loaded', array( $this, 'override_sidebars_widgets_for_theme_switch' ) );\n\t\tadd_action( 'customize_controls_init', array( $this, 'customize_controls_init' ) );\n\t\tadd_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_scripts' ) );\n\t\tadd_action( 'customize_controls_print_styles', array( $this, 'print_styles' ) );\n\t\tadd_action( 'customize_controls_print_scripts', array( $this, 'print_scripts' ) );\n\t\tadd_action( 'customize_controls_print_footer_scripts', array( $this, 'print_footer_scripts' ) );\n\t\tadd_action( 'customize_controls_print_footer_scripts', array( $this, 'output_widget_control_templates' ) );\n\t\tadd_action( 'customize_preview_init', array( $this, 'customize_preview_init' ) );\n\t\tadd_filter( 'customize_refresh_nonces', array( $this, 'refresh_nonces' ) );\n\n\t\tadd_action( 'dynamic_sidebar', array( $this, 'tally_rendered_widgets' ) );\n\t\tadd_filter( 'is_active_sidebar', array( $this, 'tally_sidebars_via_is_active_sidebar_calls' ), 10, 2 );\n\t\tadd_filter( 'dynamic_sidebar_has_widgets', array( $this, 'tally_sidebars_via_dynamic_sidebar_calls' ), 10, 2 );\n\n\t\t// Selective Refresh.\n\t\tadd_filter( 'customize_dynamic_partial_args', array( $this, 'customize_dynamic_partial_args' ), 10, 2 );\n\t\tadd_action( 'customize_preview_init', array( $this, 'selective_refresh_init' ) );\n\t}\n\n\t/**\n\t * List whether each registered widget can be use selective refresh.\n\t *\n\t * If the theme does not support the customize-selective-refresh-widgets feature,\n\t * then this will always return an empty array.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @global WP_Widget_Factory $wp_widget_factory\n\t *\n\t * @return array Mapping of id_base to support. If theme doesn't support\n\t *               selective refresh, an empty array is returned.\n\t */\n\tpublic function get_selective_refreshable_widgets() {\n\t\tglobal $wp_widget_factory;\n\t\tif ( ! current_theme_supports( 'customize-selective-refresh-widgets' ) ) {\n\t\t\treturn array();\n\t\t}\n\t\tif ( ! isset( $this->selective_refreshable_widgets ) ) {\n\t\t\t$this->selective_refreshable_widgets = array();\n\t\t\tforeach ( $wp_widget_factory->widgets as $wp_widget ) {\n\t\t\t\t$this->selective_refreshable_widgets[ $wp_widget->id_base ] = ! empty( $wp_widget->widget_options['customize_selective_refresh'] );\n\t\t\t}\n\t\t}\n\t\treturn $this->selective_refreshable_widgets;\n\t}\n\n\t/**\n\t * Determines if a widget supports selective refresh.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param string $id_base Widget ID Base.\n\t * @return bool Whether the widget can be selective refreshed.\n\t */\n\tpublic function is_widget_selective_refreshable( $id_base ) {\n\t\t$selective_refreshable_widgets = $this->get_selective_refreshable_widgets();\n\t\treturn ! empty( $selective_refreshable_widgets[ $id_base ] );\n\t}\n\n\t/**\n\t * Retrieves the widget setting type given a setting ID.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param string $setting_id Setting ID.\n\t * @return string|void Setting type.\n\t */\n\tprotected function get_setting_type( $setting_id ) {\n\t\tstatic $cache = array();\n\t\tif ( isset( $cache[ $setting_id ] ) ) {\n\t\t\treturn $cache[ $setting_id ];\n\t\t}\n\t\tforeach ( $this->setting_id_patterns as $type => $pattern ) {\n\t\t\tif ( preg_match( $pattern, $setting_id ) ) {\n\t\t\t\t$cache[ $setting_id ] = $type;\n\t\t\t\treturn $type;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Inspects the incoming customized data for any widget settings, and dynamically adds\n\t * them up-front so widgets will be initialized properly.\n\t *\n\t * @since 4.2.0\n\t */\n\tpublic function register_settings() {\n\t\t$widget_setting_ids   = array();\n\t\t$incoming_setting_ids = array_keys( $this->manager->unsanitized_post_values() );\n\t\tforeach ( $incoming_setting_ids as $setting_id ) {\n\t\t\tif ( ! is_null( $this->get_setting_type( $setting_id ) ) ) {\n\t\t\t\t$widget_setting_ids[] = $setting_id;\n\t\t\t}\n\t\t}\n\t\tif ( $this->manager->doing_ajax( 'update-widget' ) && isset( $_REQUEST['widget-id'] ) ) {\n\t\t\t$widget_setting_ids[] = $this->get_setting_id( wp_unslash( $_REQUEST['widget-id'] ) );\n\t\t}\n\n\t\t$settings = $this->manager->add_dynamic_settings( array_unique( $widget_setting_ids ) );\n\n\t\tif ( $this->manager->settings_previewed() ) {\n\t\t\tforeach ( $settings as $setting ) {\n\t\t\t\t$setting->preview();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Determines the arguments for a dynamically-created setting.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param false|array $args       The arguments to the WP_Customize_Setting constructor.\n\t * @param string      $setting_id ID for dynamic setting, usually coming from `$_POST['customized']`.\n\t * @return array|false Setting arguments, false otherwise.\n\t */\n\tpublic function filter_customize_dynamic_setting_args( $args, $setting_id ) {\n\t\tif ( $this->get_setting_type( $setting_id ) ) {\n\t\t\t$args = $this->get_setting_args( $setting_id );\n\t\t}\n\t\treturn $args;\n\t}\n\n\t/**\n\t * Retrieves an unslashed post value or return a default.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param string $name    Post value.\n\t * @param mixed  $default Default post value.\n\t * @return mixed Unslashed post value or default value.\n\t */\n\tprotected function get_post_value( $name, $default = null ) {\n\t\tif ( ! isset( $_POST[ $name ] ) ) {\n\t\t\treturn $default;\n\t\t}\n\n\t\treturn wp_unslash( $_POST[ $name ] );\n\t}\n\n\t/**\n\t * Override sidebars_widgets for theme switch.\n\t *\n\t * When switching a theme via the Customizer, supply any previously-configured\n\t * sidebars_widgets from the target theme as the initial sidebars_widgets\n\t * setting. Also store the old theme's existing settings so that they can\n\t * be passed along for storing in the sidebars_widgets theme_mod when the\n\t * theme gets switched.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @global array $sidebars_widgets\n\t * @global array $_wp_sidebars_widgets\n\t */\n\tpublic function override_sidebars_widgets_for_theme_switch() {\n\t\tglobal $sidebars_widgets;\n\n\t\tif ( $this->manager->doing_ajax() || $this->manager->is_theme_active() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->old_sidebars_widgets = wp_get_sidebars_widgets();\n\t\tadd_filter( 'customize_value_old_sidebars_widgets_data', array( $this, 'filter_customize_value_old_sidebars_widgets_data' ) );\n\t\t$this->manager->set_post_value( 'old_sidebars_widgets_data', $this->old_sidebars_widgets ); // Override any value cached in changeset.\n\n\t\t// retrieve_widgets() looks at the global $sidebars_widgets.\n\t\t$sidebars_widgets = $this->old_sidebars_widgets;\n\t\t$sidebars_widgets = retrieve_widgets( 'customize' );\n\t\tadd_filter( 'option_sidebars_widgets', array( $this, 'filter_option_sidebars_widgets_for_theme_switch' ), 1 );\n\t\t// Reset global cache var used by wp_get_sidebars_widgets().\n\t\tunset( $GLOBALS['_wp_sidebars_widgets'] );\n\t}\n\n\t/**\n\t * Filters old_sidebars_widgets_data Customizer setting.\n\t *\n\t * When switching themes, filter the Customizer setting old_sidebars_widgets_data\n\t * to supply initial $sidebars_widgets before they were overridden by retrieve_widgets().\n\t * The value for old_sidebars_widgets_data gets set in the old theme's sidebars_widgets\n\t * theme_mod.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @see WP_Customize_Widgets::handle_theme_switch()\n\t *\n\t * @param array $old_sidebars_widgets\n\t * @return array\n\t */\n\tpublic function filter_customize_value_old_sidebars_widgets_data( $old_sidebars_widgets ) {\n\t\treturn $this->old_sidebars_widgets;\n\t}\n\n\t/**\n\t * Filters sidebars_widgets option for theme switch.\n\t *\n\t * When switching themes, the retrieve_widgets() function is run when the Customizer initializes,\n\t * and then the new sidebars_widgets here get supplied as the default value for the sidebars_widgets\n\t * option.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @see WP_Customize_Widgets::handle_theme_switch()\n\t * @global array $sidebars_widgets\n\t *\n\t * @param array $sidebars_widgets\n\t * @return array\n\t */\n\tpublic function filter_option_sidebars_widgets_for_theme_switch( $sidebars_widgets ) {\n\t\t$sidebars_widgets                  = $GLOBALS['sidebars_widgets'];\n\t\t$sidebars_widgets['array_version'] = 3;\n\t\treturn $sidebars_widgets;\n\t}\n\n\t/**\n\t * Ensures all widgets get loaded into the Customizer.\n\t *\n\t * Note: these actions are also fired in wp_ajax_update_widget().\n\t *\n\t * @since 3.9.0\n\t */\n\tpublic function customize_controls_init() {\n\t\t/** This action is documented in wp-admin/includes/ajax-actions.php */\n\t\tdo_action( 'load-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\t/** This action is documented in wp-admin/includes/ajax-actions.php */\n\t\tdo_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\t/** This action is documented in wp-admin/widgets.php */\n\t\tdo_action( 'sidebar_admin_setup' );\n\t}\n\n\t/**\n\t * Ensures widgets are available for all types of previews.\n\t *\n\t * When in preview, hook to {@see 'customize_register'} for settings after WordPress is loaded\n\t * so that all filters have been initialized (e.g. Widget Visibility).\n\t *\n\t * @since 3.9.0\n\t */\n\tpublic function schedule_customize_register() {\n\t\tif ( is_admin() ) {\n\t\t\t$this->customize_register();\n\t\t} else {\n\t\t\tadd_action( 'wp', array( $this, 'customize_register' ) );\n\t\t}\n\t}\n\n\t/**\n\t * Registers Customizer settings and controls for all sidebars and widgets.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @global array $wp_registered_widgets\n\t * @global array $wp_registered_widget_controls\n\t * @global array $wp_registered_sidebars\n\t */\n\tpublic function customize_register() {\n\t\tglobal $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_sidebars;\n\n\t\tadd_filter( 'sidebars_widgets', array( $this, 'preview_sidebars_widgets' ), 1 );\n\n\t\t$sidebars_widgets = array_merge(\n\t\t\tarray( 'wp_inactive_widgets' => array() ),\n\t\t\tarray_fill_keys( array_keys( $wp_registered_sidebars ), array() ),\n\t\t\twp_get_sidebars_widgets()\n\t\t);\n\n\t\t$new_setting_ids = array();\n\n\t\t/*\n\t\t * Register a setting for all widgets, including those which are active,\n\t\t * inactive, and orphaned since a widget may get suppressed from a sidebar\n\t\t * via a plugin (like Widget Visibility).\n\t\t */\n\t\tforeach ( array_keys( $wp_registered_widgets ) as $widget_id ) {\n\t\t\t$setting_id   = $this->get_setting_id( $widget_id );\n\t\t\t$setting_args = $this->get_setting_args( $setting_id );\n\t\t\tif ( ! $this->manager->get_setting( $setting_id ) ) {\n\t\t\t\t$this->manager->add_setting( $setting_id, $setting_args );\n\t\t\t}\n\t\t\t$new_setting_ids[] = $setting_id;\n\t\t}\n\n\t\t/*\n\t\t * Add a setting which will be supplied for the theme's sidebars_widgets\n\t\t * theme_mod when the theme is switched.\n\t\t */\n\t\tif ( ! $this->manager->is_theme_active() ) {\n\t\t\t$setting_id   = 'old_sidebars_widgets_data';\n\t\t\t$setting_args = $this->get_setting_args(\n\t\t\t\t$setting_id,\n\t\t\t\tarray(\n\t\t\t\t\t'type'  => 'global_variable',\n\t\t\t\t\t'dirty' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->manager->add_setting( $setting_id, $setting_args );\n\t\t}\n\n\t\t$this->manager->add_panel(\n\t\t\t'widgets',\n\t\t\tarray(\n\t\t\t\t'type'                     => 'widgets',\n\t\t\t\t'title'                    => __( 'Widgets' ),\n\t\t\t\t'description'              => __( 'Widgets are independent sections of content that can be placed into widgetized areas provided by your theme (commonly called sidebars).' ),\n\t\t\t\t'priority'                 => 110,\n\t\t\t\t'active_callback'          => array( $this, 'is_panel_active' ),\n\t\t\t\t'auto_expand_sole_section' => true,\n\t\t\t)\n\t\t);\n\n\t\tforeach ( $sidebars_widgets as $sidebar_id => $sidebar_widget_ids ) {\n\t\t\tif ( empty( $sidebar_widget_ids ) ) {\n\t\t\t\t$sidebar_widget_ids = array();\n\t\t\t}\n\n\t\t\t$is_registered_sidebar = is_registered_sidebar( $sidebar_id );\n\t\t\t$is_inactive_widgets   = ( 'wp_inactive_widgets' === $sidebar_id );\n\t\t\t$is_active_sidebar     = ( $is_registered_sidebar && ! $is_inactive_widgets );\n\n\t\t\t// Add setting for managing the sidebar's widgets.\n\t\t\tif ( $is_registered_sidebar || $is_inactive_widgets ) {\n\t\t\t\t$setting_id   = sprintf( 'sidebars_widgets[%s]', $sidebar_id );\n\t\t\t\t$setting_args = $this->get_setting_args( $setting_id );\n\t\t\t\tif ( ! $this->manager->get_setting( $setting_id ) ) {\n\t\t\t\t\tif ( ! $this->manager->is_theme_active() ) {\n\t\t\t\t\t\t$setting_args['dirty'] = true;\n\t\t\t\t\t}\n\t\t\t\t\t$this->manager->add_setting( $setting_id, $setting_args );\n\t\t\t\t}\n\t\t\t\t$new_setting_ids[] = $setting_id;\n\n\t\t\t\t// Add section to contain controls.\n\t\t\t\t$section_id = sprintf( 'sidebar-widgets-%s', $sidebar_id );\n\t\t\t\tif ( $is_active_sidebar ) {\n\n\t\t\t\t\t$section_args = array(\n\t\t\t\t\t\t'title'       => $wp_registered_sidebars[ $sidebar_id ]['name'],\n\t\t\t\t\t\t'description' => $wp_registered_sidebars[ $sidebar_id ]['description'],\n\t\t\t\t\t\t'priority'    => array_search( $sidebar_id, array_keys( $wp_registered_sidebars ), true ),\n\t\t\t\t\t\t'panel'       => 'widgets',\n\t\t\t\t\t\t'sidebar_id'  => $sidebar_id,\n\t\t\t\t\t);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters Customizer widget section arguments for a given sidebar.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 3.9.0\n\t\t\t\t\t *\n\t\t\t\t\t * @param array      $section_args Array of Customizer widget section arguments.\n\t\t\t\t\t * @param string     $section_id   Customizer section ID.\n\t\t\t\t\t * @param int|string $sidebar_id   Sidebar ID.\n\t\t\t\t\t */\n\t\t\t\t\t$section_args = apply_filters( 'customizer_widgets_section_args', $section_args, $section_id, $sidebar_id );\n\n\t\t\t\t\t$section = new WP_Customize_Sidebar_Section( $this->manager, $section_id, $section_args );\n\t\t\t\t\t$this->manager->add_section( $section );\n\n\t\t\t\t\t$control           = new WP_Widget_Area_Customize_Control(\n\t\t\t\t\t\t$this->manager,\n\t\t\t\t\t\t$setting_id,\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'section'    => $section_id,\n\t\t\t\t\t\t\t'sidebar_id' => $sidebar_id,\n\t\t\t\t\t\t\t'priority'   => count( $sidebar_widget_ids ), // place 'Add Widget' and 'Reorder' buttons at end.\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t$new_setting_ids[] = $setting_id;\n\n\t\t\t\t\t$this->manager->add_control( $control );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add a control for each active widget (located in a sidebar).\n\t\t\tforeach ( $sidebar_widget_ids as $i => $widget_id ) {\n\n\t\t\t\t// Skip widgets that may have gone away due to a plugin being deactivated.\n\t\t\t\tif ( ! $is_active_sidebar || ! isset( $wp_registered_widgets[ $widget_id ] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$registered_widget = $wp_registered_widgets[ $widget_id ];\n\t\t\t\t$setting_id        = $this->get_setting_id( $widget_id );\n\t\t\t\t$id_base           = $wp_registered_widget_controls[ $widget_id ]['id_base'];\n\n\t\t\t\t$control = new WP_Widget_Form_Customize_Control(\n\t\t\t\t\t$this->manager,\n\t\t\t\t\t$setting_id,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'label'          => $registered_widget['name'],\n\t\t\t\t\t\t'section'        => $section_id,\n\t\t\t\t\t\t'sidebar_id'     => $sidebar_id,\n\t\t\t\t\t\t'widget_id'      => $widget_id,\n\t\t\t\t\t\t'widget_id_base' => $id_base,\n\t\t\t\t\t\t'priority'       => $i,\n\t\t\t\t\t\t'width'          => $wp_registered_widget_controls[ $widget_id ]['width'],\n\t\t\t\t\t\t'height'         => $wp_registered_widget_controls[ $widget_id ]['height'],\n\t\t\t\t\t\t'is_wide'        => $this->is_wide_widget( $widget_id ),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$this->manager->add_control( $control );\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->manager->settings_previewed() ) {\n\t\t\tforeach ( $new_setting_ids as $new_setting_id ) {\n\t\t\t\t$this->manager->get_setting( $new_setting_id )->preview();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Determines whether the widgets panel is active, based on whether there are sidebars registered.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @see WP_Customize_Panel::$active_callback\n\t *\n\t * @global array $wp_registered_sidebars\n\t * @return bool Active.\n\t */\n\tpublic function is_panel_active() {\n\t\tglobal $wp_registered_sidebars;\n\t\treturn ! empty( $wp_registered_sidebars );\n\t}\n\n\t/**\n\t * Converts a widget_id into its corresponding Customizer setting ID (option name).\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param string $widget_id Widget ID.\n\t * @return string Maybe-parsed widget ID.\n\t */\n\tpublic function get_setting_id( $widget_id ) {\n\t\t$parsed_widget_id = $this->parse_widget_id( $widget_id );\n\t\t$setting_id       = sprintf( 'widget_%s', $parsed_widget_id['id_base'] );\n\n\t\tif ( ! is_null( $parsed_widget_id['number'] ) ) {\n\t\t\t$setting_id .= sprintf( '[%d]', $parsed_widget_id['number'] );\n\t\t}\n\t\treturn $setting_id;\n\t}\n\n\t/**\n\t * Determines whether the widget is considered \"wide\".\n\t *\n\t * Core widgets which may have controls wider than 250, but can still be shown\n\t * in the narrow Customizer panel. The RSS and Text widgets in Core, for example,\n\t * have widths of 400 and yet they still render fine in the Customizer panel.\n\t *\n\t * This method will return all Core widgets as being not wide, but this can be\n\t * overridden with the {@see 'is_wide_widget_in_customizer'} filter.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @global array $wp_registered_widget_controls\n\t *\n\t * @param string $widget_id Widget ID.\n\t * @return bool Whether or not the widget is a \"wide\" widget.\n\t */\n\tpublic function is_wide_widget( $widget_id ) {\n\t\tglobal $wp_registered_widget_controls;\n\n\t\t$parsed_widget_id = $this->parse_widget_id( $widget_id );\n\t\t$width            = $wp_registered_widget_controls[ $widget_id ]['width'];\n\t\t$is_core          = in_array( $parsed_widget_id['id_base'], $this->core_widget_id_bases, true );\n\t\t$is_wide          = ( $width > 250 && ! $is_core );\n\n\t\t/**\n\t\t * Filters whether the given widget is considered \"wide\".\n\t\t *\n\t\t * @since 3.9.0\n\t\t *\n\t\t * @param bool   $is_wide   Whether the widget is wide, Default false.\n\t\t * @param string $widget_id Widget ID.\n\t\t */\n\t\treturn apply_filters( 'is_wide_widget_in_customizer', $is_wide, $widget_id );\n\t}\n\n\t/**\n\t * Converts a widget ID into its id_base and number components.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param string $widget_id Widget ID.\n\t * @return array Array containing a widget's id_base and number components.\n\t */\n\tpublic function parse_widget_id( $widget_id ) {\n\t\t$parsed = array(\n\t\t\t'number'  => null,\n\t\t\t'id_base' => null,\n\t\t);\n\n\t\tif ( preg_match( '/^(.+)-(\\d+)$/', $widget_id, $matches ) ) {\n\t\t\t$parsed['id_base'] = $matches[1];\n\t\t\t$parsed['number']  = intval( $matches[2] );\n\t\t} else {\n\t\t\t// Likely an old single widget.\n\t\t\t$parsed['id_base'] = $widget_id;\n\t\t}\n\t\treturn $parsed;\n\t}\n\n\t/**\n\t * Converts a widget setting ID (option path) to its id_base and number components.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param string $setting_id Widget setting ID.\n\t * @return array|WP_Error Array containing a widget's id_base and number components,\n\t *                        or a WP_Error object.\n\t */\n\tpublic function parse_widget_setting_id( $setting_id ) {\n\t\tif ( ! preg_match( '/^(widget_(.+?))(?:\\[(\\d+)\\])?$/', $setting_id, $matches ) ) {\n\t\t\treturn new WP_Error( 'widget_setting_invalid_id' );\n\t\t}\n\n\t\t$id_base = $matches[2];\n\t\t$number  = isset( $matches[3] ) ? intval( $matches[3] ) : null;\n\n\t\treturn compact( 'id_base', 'number' );\n\t}\n\n\t/**\n\t * Calls admin_print_styles-widgets.php and admin_print_styles hooks to\n\t * allow custom styles from plugins.\n\t *\n\t * @since 3.9.0\n\t */\n\tpublic function print_styles() {\n\t\t/** This action is documented in wp-admin/admin-header.php */\n\t\tdo_action( 'admin_print_styles-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\t/** This action is documented in wp-admin/admin-header.php */\n\t\tdo_action( 'admin_print_styles' );\n\t}\n\n\t/**\n\t * Calls admin_print_scripts-widgets.php and admin_print_scripts hooks to\n\t * allow custom scripts from plugins.\n\t *\n\t * @since 3.9.0\n\t */\n\tpublic function print_scripts() {\n\t\t/** This action is documented in wp-admin/admin-header.php */\n\t\tdo_action( 'admin_print_scripts-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\t/** This action is documented in wp-admin/admin-header.php */\n\t\tdo_action( 'admin_print_scripts' );\n\t}\n\n\t/**\n\t * Enqueues scripts and styles for Customizer panel and export data to JavaScript.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @global WP_Scripts $wp_scripts\n\t * @global array $wp_registered_sidebars\n\t * @global array $wp_registered_widgets\n\t */\n\tpublic function enqueue_scripts() {\n\t\tglobal $wp_scripts, $wp_registered_sidebars, $wp_registered_widgets;\n\n\t\twp_enqueue_style( 'customize-widgets' );\n\t\twp_enqueue_script( 'customize-widgets' );\n\n\t\t/** This action is documented in wp-admin/admin-header.php */\n\t\tdo_action( 'admin_enqueue_scripts', 'widgets.php' );\n\n\t\t/*\n\t\t * Export available widgets with control_tpl removed from model\n\t\t * since plugins need templates to be in the DOM.\n\t\t */\n\t\t$available_widgets = array();\n\n\t\tforeach ( $this->get_available_widgets() as $available_widget ) {\n\t\t\tunset( $available_widget['control_tpl'] );\n\t\t\t$available_widgets[] = $available_widget;\n\t\t}\n\n\t\t$widget_reorder_nav_tpl = sprintf(\n\t\t\t'<div class=\"widget-reorder-nav\"><span class=\"move-widget\" tabindex=\"0\">%1$s</span><span class=\"move-widget-down\" tabindex=\"0\">%2$s</span><span class=\"move-widget-up\" tabindex=\"0\">%3$s</span></div>',\n\t\t\t__( 'Move to another area&hellip;' ),\n\t\t\t__( 'Move down' ),\n\t\t\t__( 'Move up' )\n\t\t);\n\n\t\t$move_widget_area_tpl = str_replace(\n\t\t\tarray( '{description}', '{btn}' ),\n\t\t\tarray(\n\t\t\t\t__( 'Select an area to move this widget into:' ),\n\t\t\t\t_x( 'Move', 'Move widget' ),\n\t\t\t),\n\t\t\t'<div class=\"move-widget-area\">\n\t\t\t\t<p class=\"description\">{description}</p>\n\t\t\t\t<ul class=\"widget-area-select\">\n\t\t\t\t\t<% _.each( sidebars, function ( sidebar ){ %>\n\t\t\t\t\t\t<li class=\"\" data-id=\"<%- sidebar.id %>\" title=\"<%- sidebar.description %>\" tabindex=\"0\"><%- sidebar.name %></li>\n\t\t\t\t\t<% }); %>\n\t\t\t\t</ul>\n\t\t\t\t<div class=\"move-widget-actions\">\n\t\t\t\t\t<button class=\"move-widget-btn button\" type=\"button\">{btn}</button>\n\t\t\t\t</div>\n\t\t\t</div>'\n\t\t);\n\n\t\t/*\n\t\t * Gather all strings in PHP that may be needed by JS on the client.\n\t\t * Once JS i18n is implemented (in #20491), this can be removed.\n\t\t */\n\t\t$some_non_rendered_areas_messages    = array();\n\t\t$some_non_rendered_areas_messages[1] = html_entity_decode(\n\t\t\t__( 'Your theme has 1 other widget area, but this particular page doesn&#8217;t display it.' ),\n\t\t\tENT_QUOTES,\n\t\t\tget_bloginfo( 'charset' )\n\t\t);\n\t\t$registered_sidebar_count            = count( $wp_registered_sidebars );\n\t\tfor ( $non_rendered_count = 2; $non_rendered_count < $registered_sidebar_count; $non_rendered_count++ ) {\n\t\t\t$some_non_rendered_areas_messages[ $non_rendered_count ] = html_entity_decode(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: The number of other widget areas registered but not rendered. */\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'Your theme has %s other widget area, but this particular page doesn&#8217;t display it.',\n\t\t\t\t\t\t'Your theme has %s other widget areas, but this particular page doesn&#8217;t display them.',\n\t\t\t\t\t\t$non_rendered_count\n\t\t\t\t\t),\n\t\t\t\t\tnumber_format_i18n( $non_rendered_count )\n\t\t\t\t),\n\t\t\t\tENT_QUOTES,\n\t\t\t\tget_bloginfo( 'charset' )\n\t\t\t);\n\t\t}\n\n\t\tif ( 1 === $registered_sidebar_count ) {\n\t\t\t$no_areas_shown_message = html_entity_decode(\n\t\t\t\tsprintf(\n\t\t\t\t\t__( 'Your theme has 1 widget area, but this particular page doesn&#8217;t display it.' )\n\t\t\t\t),\n\t\t\t\tENT_QUOTES,\n\t\t\t\tget_bloginfo( 'charset' )\n\t\t\t);\n\t\t} else {\n\t\t\t$no_areas_shown_message = html_entity_decode(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: The total number of widget areas registered. */\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'Your theme has %s widget area, but this particular page doesn&#8217;t display it.',\n\t\t\t\t\t\t'Your theme has %s widget areas, but this particular page doesn&#8217;t display them.',\n\t\t\t\t\t\t$registered_sidebar_count\n\t\t\t\t\t),\n\t\t\t\t\tnumber_format_i18n( $registered_sidebar_count )\n\t\t\t\t),\n\t\t\t\tENT_QUOTES,\n\t\t\t\tget_bloginfo( 'charset' )\n\t\t\t);\n\t\t}\n\n\t\t$settings = array(\n\t\t\t'registeredSidebars'          => array_values( $wp_registered_sidebars ),\n\t\t\t'registeredWidgets'           => $wp_registered_widgets,\n\t\t\t'availableWidgets'            => $available_widgets, // @todo Merge this with registered_widgets.\n\t\t\t'l10n'                        => array(\n\t\t\t\t'saveBtnLabel'     => __( 'Apply' ),\n\t\t\t\t'saveBtnTooltip'   => __( 'Save and preview changes before publishing them.' ),\n\t\t\t\t'removeBtnLabel'   => __( 'Remove' ),\n\t\t\t\t'removeBtnTooltip' => __( 'Keep widget settings and move it to the inactive widgets' ),\n\t\t\t\t'error'            => __( 'An error has occurred. Please reload the page and try again.' ),\n\t\t\t\t'widgetMovedUp'    => __( 'Widget moved up' ),\n\t\t\t\t'widgetMovedDown'  => __( 'Widget moved down' ),\n\t\t\t\t'navigatePreview'  => __( 'You can navigate to other pages on your site while using the Customizer to view and edit the widgets displayed on those pages.' ),\n\t\t\t\t'someAreasShown'   => $some_non_rendered_areas_messages,\n\t\t\t\t'noAreasShown'     => $no_areas_shown_message,\n\t\t\t\t'reorderModeOn'    => __( 'Reorder mode enabled' ),\n\t\t\t\t'reorderModeOff'   => __( 'Reorder mode closed' ),\n\t\t\t\t'reorderLabelOn'   => esc_attr__( 'Reorder widgets' ),\n\t\t\t\t/* translators: %d: The number of widgets found. */\n\t\t\t\t'widgetsFound'     => __( 'Number of widgets found: %d' ),\n\t\t\t\t'noWidgetsFound'   => __( 'No widgets found.' ),\n\t\t\t),\n\t\t\t'tpl'                         => array(\n\t\t\t\t'widgetReorderNav' => $widget_reorder_nav_tpl,\n\t\t\t\t'moveWidgetArea'   => $move_widget_area_tpl,\n\t\t\t),\n\t\t\t'selectiveRefreshableWidgets' => $this->get_selective_refreshable_widgets(),\n\t\t);\n\n\t\tforeach ( $settings['registeredWidgets'] as &$registered_widget ) {\n\t\t\tunset( $registered_widget['callback'] ); // May not be JSON-serializeable.\n\t\t}\n\n\t\t$wp_scripts->add_data(\n\t\t\t'customize-widgets',\n\t\t\t'data',\n\t\t\tsprintf( 'var _wpCustomizeWidgetsSettings = %s;', wp_json_encode( $settings ) )\n\t\t);\n\t}\n\n\t/**\n\t * Renders the widget form control templates into the DOM.\n\t *\n\t * @since 3.9.0\n\t */\n\tpublic function output_widget_control_templates() {\n\t\t?>\n\t\t<div id=\"widgets-left\"><!-- compatibility with JS which looks for widget templates here -->\n\t\t<div id=\"available-widgets\">\n\t\t\t<div class=\"customize-section-title\">\n\t\t\t\t<button class=\"customize-section-back\" tabindex=\"-1\">\n\t\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Back' ); ?></span>\n\t\t\t\t</button>\n\t\t\t\t<h3>\n\t\t\t\t\t<span class=\"customize-action\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t/* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */\n\t\t\t\t\t\tprintf( __( 'Customizing &#9656; %s' ), esc_html( $this->manager->get_panel( 'widgets' )->title ) );\n\t\t\t\t\t?>\n\t\t\t\t\t</span>\n\t\t\t\t\t<?php _e( 'Add a Widget' ); ?>\n\t\t\t\t</h3>\n\t\t\t</div>\n\t\t\t<div id=\"available-widgets-filter\">\n\t\t\t\t<label class=\"screen-reader-text\" for=\"widgets-search\"><?php _e( 'Search Widgets' ); ?></label>\n\t\t\t\t<input type=\"text\" id=\"widgets-search\" placeholder=\"<?php esc_attr_e( 'Search widgets&hellip;' ); ?>\" aria-describedby=\"widgets-search-desc\" />\n\t\t\t\t<div class=\"search-icon\" aria-hidden=\"true\"></div>\n\t\t\t\t<button type=\"button\" class=\"clear-results\"><span class=\"screen-reader-text\"><?php _e( 'Clear Results' ); ?></span></button>\n\t\t\t\t<p class=\"screen-reader-text\" id=\"widgets-search-desc\"><?php _e( 'The search results will be updated as you type.' ); ?></p>\n\t\t\t</div>\n\t\t\t<div id=\"available-widgets-list\">\n\t\t\t<?php foreach ( $this->get_available_widgets() as $available_widget ) : ?>\n\t\t\t\t<div id=\"widget-tpl-<?php echo esc_attr( $available_widget['id'] ); ?>\" data-widget-id=\"<?php echo esc_attr( $available_widget['id'] ); ?>\" class=\"widget-tpl <?php echo esc_attr( $available_widget['id'] ); ?>\" tabindex=\"0\">\n\t\t\t\t\t<?php echo $available_widget['control_tpl']; ?>\n\t\t\t\t</div>\n\t\t\t<?php endforeach; ?>\n\t\t\t<p class=\"no-widgets-found-message\"><?php _e( 'No widgets found.' ); ?></p>\n\t\t\t</div><!-- #available-widgets-list -->\n\t\t</div><!-- #available-widgets -->\n\t\t</div><!-- #widgets-left -->\n\t\t<?php\n\t}\n\n\t/**\n\t * Calls admin_print_footer_scripts and admin_print_scripts hooks to\n\t * allow custom scripts from plugins.\n\t *\n\t * @since 3.9.0\n\t */\n\tpublic function print_footer_scripts() {\n\t\t/** This action is documented in wp-admin/admin-footer.php */\n\t\tdo_action( 'admin_print_footer_scripts-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\t/** This action is documented in wp-admin/admin-footer.php */\n\t\tdo_action( 'admin_print_footer_scripts' );\n\n\t\t/** This action is documented in wp-admin/admin-footer.php */\n\t\tdo_action( 'admin_footer-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t}\n\n\t/**\n\t * Retrieves common arguments to supply when constructing a Customizer setting.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param string $id        Widget setting ID.\n\t * @param array  $overrides Array of setting overrides.\n\t * @return array Possibly modified setting arguments.\n\t */\n\tpublic function get_setting_args( $id, $overrides = array() ) {\n\t\t$args = array(\n\t\t\t'type'       => 'option',\n\t\t\t'capability' => 'edit_theme_options',\n\t\t\t'default'    => array(),\n\t\t);\n\n\t\tif ( preg_match( $this->setting_id_patterns['sidebar_widgets'], $id, $matches ) ) {\n\t\t\t$args['sanitize_callback']    = array( $this, 'sanitize_sidebar_widgets' );\n\t\t\t$args['sanitize_js_callback'] = array( $this, 'sanitize_sidebar_widgets_js_instance' );\n\t\t\t$args['transport']            = current_theme_supports( 'customize-selective-refresh-widgets' ) ? 'postMessage' : 'refresh';\n\t\t} elseif ( preg_match( $this->setting_id_patterns['widget_instance'], $id, $matches ) ) {\n\t\t\t$args['sanitize_callback']    = array( $this, 'sanitize_widget_instance' );\n\t\t\t$args['sanitize_js_callback'] = array( $this, 'sanitize_widget_js_instance' );\n\t\t\t$args['transport']            = $this->is_widget_selective_refreshable( $matches['id_base'] ) ? 'postMessage' : 'refresh';\n\t\t}\n\n\t\t$args = array_merge( $args, $overrides );\n\n\t\t/**\n\t\t * Filters the common arguments supplied when constructing a Customizer setting.\n\t\t *\n\t\t * @since 3.9.0\n\t\t *\n\t\t * @see WP_Customize_Setting\n\t\t *\n\t\t * @param array  $args Array of Customizer setting arguments.\n\t\t * @param string $id   Widget setting ID.\n\t\t */\n\t\treturn apply_filters( 'widget_customizer_setting_args', $args, $id );\n\t}\n\n\t/**\n\t * Ensures sidebar widget arrays only ever contain widget IDS.\n\t *\n\t * Used as the 'sanitize_callback' for each $sidebars_widgets setting.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param string[] $widget_ids Array of widget IDs.\n\t * @return string[] Array of sanitized widget IDs.\n\t */\n\tpublic function sanitize_sidebar_widgets( $widget_ids ) {\n\t\t$widget_ids           = array_map( 'strval', (array) $widget_ids );\n\t\t$sanitized_widget_ids = array();\n\t\tforeach ( $widget_ids as $widget_id ) {\n\t\t\t$sanitized_widget_ids[] = preg_replace( '/[^a-z0-9_\\-]/', '', $widget_id );\n\t\t}\n\t\treturn $sanitized_widget_ids;\n\t}\n\n\t/**\n\t * Builds up an index of all available widgets for use in Backbone models.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @global array $wp_registered_widgets\n\t * @global array $wp_registered_widget_controls\n\t *\n\t * @see wp_list_widgets()\n\t *\n\t * @return array List of available widgets.\n\t */\n\tpublic function get_available_widgets() {\n\t\tstatic $available_widgets = array();\n\t\tif ( ! empty( $available_widgets ) ) {\n\t\t\treturn $available_widgets;\n\t\t}\n\n\t\tglobal $wp_registered_widgets, $wp_registered_widget_controls;\n\t\trequire_once ABSPATH . 'wp-admin/includes/widgets.php'; // For next_widget_id_number().\n\n\t\t$sort = $wp_registered_widgets;\n\t\tusort( $sort, array( $this, '_sort_name_callback' ) );\n\t\t$done = array();\n\n\t\tforeach ( $sort as $widget ) {\n\t\t\tif ( in_array( $widget['callback'], $done, true ) ) { // We already showed this multi-widget.\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$sidebar = is_active_widget( $widget['callback'], $widget['id'], false, false );\n\t\t\t$done[]  = $widget['callback'];\n\n\t\t\tif ( ! isset( $widget['params'][0] ) ) {\n\t\t\t\t$widget['params'][0] = array();\n\t\t\t}\n\n\t\t\t$available_widget = $widget;\n\t\t\tunset( $available_widget['callback'] ); // Not serializable to JSON.\n\n\t\t\t$args = array(\n\t\t\t\t'widget_id'   => $widget['id'],\n\t\t\t\t'widget_name' => $widget['name'],\n\t\t\t\t'_display'    => 'template',\n\t\t\t);\n\n\t\t\t$is_disabled     = false;\n\t\t\t$is_multi_widget = ( isset( $wp_registered_widget_controls[ $widget['id'] ]['id_base'] ) && isset( $widget['params'][0]['number'] ) );\n\t\t\tif ( $is_multi_widget ) {\n\t\t\t\t$id_base            = $wp_registered_widget_controls[ $widget['id'] ]['id_base'];\n\t\t\t\t$args['_temp_id']   = \"$id_base-__i__\";\n\t\t\t\t$args['_multi_num'] = next_widget_id_number( $id_base );\n\t\t\t\t$args['_add']       = 'multi';\n\t\t\t} else {\n\t\t\t\t$args['_add'] = 'single';\n\n\t\t\t\tif ( $sidebar && 'wp_inactive_widgets' !== $sidebar ) {\n\t\t\t\t\t$is_disabled = true;\n\t\t\t\t}\n\t\t\t\t$id_base = $widget['id'];\n\t\t\t}\n\n\t\t\t$list_widget_controls_args = wp_list_widget_controls_dynamic_sidebar(\n\t\t\t\tarray(\n\t\t\t\t\t0 => $args,\n\t\t\t\t\t1 => $widget['params'][0],\n\t\t\t\t)\n\t\t\t);\n\t\t\t$control_tpl               = $this->get_widget_control( $list_widget_controls_args );\n\n\t\t\t// The properties here are mapped to the Backbone Widget model.\n\t\t\t$available_widget = array_merge(\n\t\t\t\t$available_widget,\n\t\t\t\tarray(\n\t\t\t\t\t'temp_id'      => isset( $args['_temp_id'] ) ? $args['_temp_id'] : null,\n\t\t\t\t\t'is_multi'     => $is_multi_widget,\n\t\t\t\t\t'control_tpl'  => $control_tpl,\n\t\t\t\t\t'multi_number' => ( 'multi' === $args['_add'] ) ? $args['_multi_num'] : false,\n\t\t\t\t\t'is_disabled'  => $is_disabled,\n\t\t\t\t\t'id_base'      => $id_base,\n\t\t\t\t\t'transport'    => $this->is_widget_selective_refreshable( $id_base ) ? 'postMessage' : 'refresh',\n\t\t\t\t\t'width'        => $wp_registered_widget_controls[ $widget['id'] ]['width'],\n\t\t\t\t\t'height'       => $wp_registered_widget_controls[ $widget['id'] ]['height'],\n\t\t\t\t\t'is_wide'      => $this->is_wide_widget( $widget['id'] ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$available_widgets[] = $available_widget;\n\t\t}\n\n\t\treturn $available_widgets;\n\t}\n\n\t/**\n\t * Naturally orders available widgets by name.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param array $widget_a The first widget to compare.\n\t * @param array $widget_b The second widget to compare.\n\t * @return int Reorder position for the current widget comparison.\n\t */\n\tprotected function _sort_name_callback( $widget_a, $widget_b ) {\n\t\treturn strnatcasecmp( $widget_a['name'], $widget_b['name'] );\n\t}\n\n\t/**\n\t * Retrieves the widget control markup.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param array $args Widget control arguments.\n\t * @return string Widget control form HTML markup.\n\t */\n\tpublic function get_widget_control( $args ) {\n\t\t$args[0]['before_form']           = '<div class=\"form\">';\n\t\t$args[0]['after_form']            = '</div><!-- .form -->';\n\t\t$args[0]['before_widget_content'] = '<div class=\"widget-content\">';\n\t\t$args[0]['after_widget_content']  = '</div><!-- .widget-content -->';\n\t\tob_start();\n\t\twp_widget_control( ...$args );\n\t\t$control_tpl = ob_get_clean();\n\t\treturn $control_tpl;\n\t}\n\n\t/**\n\t * Retrieves the widget control markup parts.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $args Widget control arguments.\n\t * @return array {\n\t *     @type string $control Markup for widget control wrapping form.\n\t *     @type string $content The contents of the widget form itself.\n\t * }\n\t */\n\tpublic function get_widget_control_parts( $args ) {\n\t\t$args[0]['before_widget_content'] = '<div class=\"widget-content\">';\n\t\t$args[0]['after_widget_content']  = '</div><!-- .widget-content -->';\n\t\t$control_markup                   = $this->get_widget_control( $args );\n\n\t\t$content_start_pos = strpos( $control_markup, $args[0]['before_widget_content'] );\n\t\t$content_end_pos   = strrpos( $control_markup, $args[0]['after_widget_content'] );\n\n\t\t$control  = substr( $control_markup, 0, $content_start_pos + strlen( $args[0]['before_widget_content'] ) );\n\t\t$control .= substr( $control_markup, $content_end_pos );\n\t\t$content  = trim(\n\t\t\tsubstr(\n\t\t\t\t$control_markup,\n\t\t\t\t$content_start_pos + strlen( $args[0]['before_widget_content'] ),\n\t\t\t\t$content_end_pos - $content_start_pos - strlen( $args[0]['before_widget_content'] )\n\t\t\t)\n\t\t);\n\n\t\treturn compact( 'control', 'content' );\n\t}\n\n\t/**\n\t * Adds hooks for the Customizer preview.\n\t *\n\t * @since 3.9.0\n\t */\n\tpublic function customize_preview_init() {\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'customize_preview_enqueue' ) );\n\t\tadd_action( 'wp_print_styles', array( $this, 'print_preview_css' ), 1 );\n\t\tadd_action( 'wp_footer', array( $this, 'export_preview_data' ), 20 );\n\t}\n\n\t/**\n\t * Refreshes the nonce for widget updates.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param array $nonces Array of nonces.\n\t * @return array Array of nonces.\n\t */\n\tpublic function refresh_nonces( $nonces ) {\n\t\t$nonces['update-widget'] = wp_create_nonce( 'update-widget' );\n\t\treturn $nonces;\n\t}\n\n\t/**\n\t * When previewing, ensures the proper previewing widgets are used.\n\t *\n\t * Because wp_get_sidebars_widgets() gets called early at {@see 'init' } (via\n\t * wp_convert_widget_settings()) and can set global variable `$_wp_sidebars_widgets`\n\t * to the value of `get_option( 'sidebars_widgets' )` before the Customizer preview\n\t * filter is added, it has to be reset after the filter has been added.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param array $sidebars_widgets List of widgets for the current sidebar.\n\t * @return array\n\t */\n\tpublic function preview_sidebars_widgets( $sidebars_widgets ) {\n\t\t$sidebars_widgets = get_option( 'sidebars_widgets', array() );\n\n\t\tunset( $sidebars_widgets['array_version'] );\n\t\treturn $sidebars_widgets;\n\t}\n\n\t/**\n\t * Enqueues scripts for the Customizer preview.\n\t *\n\t * @since 3.9.0\n\t */\n\tpublic function customize_preview_enqueue() {\n\t\twp_enqueue_script( 'customize-preview-widgets' );\n\t}\n\n\t/**\n\t * Inserts default style for highlighted widget at early point so theme\n\t * stylesheet can override.\n\t *\n\t * @since 3.9.0\n\t */\n\tpublic function print_preview_css() {\n\t\t?>\n\t\t<style>\n\t\t.widget-customizer-highlighted-widget {\n\t\t\toutline: none;\n\t\t\t-webkit-box-shadow: 0 0 2px rgba(30, 140, 190, 0.8);\n\t\t\tbox-shadow: 0 0 2px rgba(30, 140, 190, 0.8);\n\t\t\tposition: relative;\n\t\t\tz-index: 1;\n\t\t}\n\t\t</style>\n\t\t<?php\n\t}\n\n\t/**\n\t * Communicates the sidebars that appeared on the page at the very end of the page,\n\t * and at the very end of the wp_footer,\n\t *\n\t * @since 3.9.0\n\t *\n\t * @global array $wp_registered_sidebars\n\t * @global array $wp_registered_widgets\n\t */\n\tpublic function export_preview_data() {\n\t\tglobal $wp_registered_sidebars, $wp_registered_widgets;\n\n\t\t$switched_locale = switch_to_locale( get_user_locale() );\n\n\t\t$l10n = array(\n\t\t\t'widgetTooltip' => __( 'Shift-click to edit this widget.' ),\n\t\t);\n\n\t\tif ( $switched_locale ) {\n\t\t\trestore_previous_locale();\n\t\t}\n\n\t\t$rendered_sidebars = array_filter( $this->rendered_sidebars );\n\t\t$rendered_widgets  = array_filter( $this->rendered_widgets );\n\n\t\t// Prepare Customizer settings to pass to JavaScript.\n\t\t$settings = array(\n\t\t\t'renderedSidebars'            => array_fill_keys( array_keys( $rendered_sidebars ), true ),\n\t\t\t'renderedWidgets'             => array_fill_keys( array_keys( $rendered_widgets ), true ),\n\t\t\t'registeredSidebars'          => array_values( $wp_registered_sidebars ),\n\t\t\t'registeredWidgets'           => $wp_registered_widgets,\n\t\t\t'l10n'                        => $l10n,\n\t\t\t'selectiveRefreshableWidgets' => $this->get_selective_refreshable_widgets(),\n\t\t);\n\n\t\tforeach ( $settings['registeredWidgets'] as &$registered_widget ) {\n\t\t\tunset( $registered_widget['callback'] ); // May not be JSON-serializeable.\n\t\t}\n\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t\tvar _wpWidgetCustomizerPreviewSettings = <?php echo wp_json_encode( $settings ); ?>;\n\t\t</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * Tracks the widgets that were rendered.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param array $widget Rendered widget to tally.\n\t */\n\tpublic function tally_rendered_widgets( $widget ) {\n\t\t$this->rendered_widgets[ $widget['id'] ] = true;\n\t}\n\n\t/**\n\t * Determine if a widget is rendered on the page.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $widget_id Widget ID to check.\n\t * @return bool Whether the widget is rendered.\n\t */\n\tpublic function is_widget_rendered( $widget_id ) {\n\t\treturn ! empty( $this->rendered_widgets[ $widget_id ] );\n\t}\n\n\t/**\n\t * Determines if a sidebar is rendered on the page.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $sidebar_id Sidebar ID to check.\n\t * @return bool Whether the sidebar is rendered.\n\t */\n\tpublic function is_sidebar_rendered( $sidebar_id ) {\n\t\treturn ! empty( $this->rendered_sidebars[ $sidebar_id ] );\n\t}\n\n\t/**\n\t * Tallies the sidebars rendered via is_active_sidebar().\n\t *\n\t * Keep track of the times that is_active_sidebar() is called in the template,\n\t * and assume that this means that the sidebar would be rendered on the template\n\t * if there were widgets populating it.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param bool   $is_active  Whether the sidebar is active.\n\t * @param string $sidebar_id Sidebar ID.\n\t * @return bool Whether the sidebar is active.\n\t */\n\tpublic function tally_sidebars_via_is_active_sidebar_calls( $is_active, $sidebar_id ) {\n\t\tif ( is_registered_sidebar( $sidebar_id ) ) {\n\t\t\t$this->rendered_sidebars[ $sidebar_id ] = true;\n\t\t}\n\n\t\t/*\n\t\t * We may need to force this to true, and also force-true the value\n\t\t * for 'dynamic_sidebar_has_widgets' if we want to ensure that there\n\t\t * is an area to drop widgets into, if the sidebar is empty.\n\t\t */\n\t\treturn $is_active;\n\t}\n\n\t/**\n\t * Tallies the sidebars rendered via dynamic_sidebar().\n\t *\n\t * Keep track of the times that dynamic_sidebar() is called in the template,\n\t * and assume this means the sidebar would be rendered on the template if\n\t * there were widgets populating it.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param bool   $has_widgets Whether the current sidebar has widgets.\n\t * @param string $sidebar_id  Sidebar ID.\n\t * @return bool Whether the current sidebar has widgets.\n\t */\n\tpublic function tally_sidebars_via_dynamic_sidebar_calls( $has_widgets, $sidebar_id ) {\n\t\tif ( is_registered_sidebar( $sidebar_id ) ) {\n\t\t\t$this->rendered_sidebars[ $sidebar_id ] = true;\n\t\t}\n\n\t\t/*\n\t\t * We may need to force this to true, and also force-true the value\n\t\t * for 'is_active_sidebar' if we want to ensure there is an area to\n\t\t * drop widgets into, if the sidebar is empty.\n\t\t */\n\t\treturn $has_widgets;\n\t}\n\n\t/**\n\t * Retrieves MAC for a serialized widget instance string.\n\t *\n\t * Allows values posted back from JS to be rejected if any tampering of the\n\t * data has occurred.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param string $serialized_instance Widget instance.\n\t * @return string MAC for serialized widget instance.\n\t */\n\tprotected function get_instance_hash_key( $serialized_instance ) {\n\t\treturn wp_hash( $serialized_instance );\n\t}\n\n\t/**\n\t * Sanitizes a widget instance.\n\t *\n\t * Unserialize the JS-instance for storing in the options. It's important that this filter\n\t * only get applied to an instance *once*.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param array $value Widget instance to sanitize.\n\t * @return array|void Sanitized widget instance.\n\t */\n\tpublic function sanitize_widget_instance( $value ) {\n\t\tif ( array() === $value ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\tif ( empty( $value['is_widget_customizer_js_value'] )\n\t\t\t|| empty( $value['instance_hash_key'] )\n\t\t\t|| empty( $value['encoded_serialized_instance'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$decoded = base64_decode( $value['encoded_serialized_instance'], true );\n\t\tif ( false === $decoded ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! hash_equals( $this->get_instance_hash_key( $decoded ), $value['instance_hash_key'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$instance = unserialize( $decoded );\n\t\tif ( false === $instance ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn $instance;\n\t}\n\n\t/**\n\t * Converts a widget instance into JSON-representable format.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param array $value Widget instance to convert to JSON.\n\t * @return array JSON-converted widget instance.\n\t */\n\tpublic function sanitize_widget_js_instance( $value ) {\n\t\tif ( empty( $value['is_widget_customizer_js_value'] ) ) {\n\t\t\t$serialized = serialize( $value );\n\n\t\t\t$value = array(\n\t\t\t\t'encoded_serialized_instance'   => base64_encode( $serialized ),\n\t\t\t\t'title'                         => empty( $value['title'] ) ? '' : $value['title'],\n\t\t\t\t'is_widget_customizer_js_value' => true,\n\t\t\t\t'instance_hash_key'             => $this->get_instance_hash_key( $serialized ),\n\t\t\t);\n\t\t}\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Strips out widget IDs for widgets which are no longer registered.\n\t *\n\t * One example where this might happen is when a plugin orphans a widget\n\t * in a sidebar upon deactivation.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @global array $wp_registered_widgets\n\t *\n\t * @param array $widget_ids List of widget IDs.\n\t * @return array Parsed list of widget IDs.\n\t */\n\tpublic function sanitize_sidebar_widgets_js_instance( $widget_ids ) {\n\t\tglobal $wp_registered_widgets;\n\t\t$widget_ids = array_values( array_intersect( $widget_ids, array_keys( $wp_registered_widgets ) ) );\n\t\treturn $widget_ids;\n\t}\n\n\t/**\n\t * Finds and invokes the widget update and control callbacks.\n\t *\n\t * Requires that `$_POST` be populated with the instance data.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @global array $wp_registered_widget_updates\n\t * @global array $wp_registered_widget_controls\n\t *\n\t * @param string $widget_id Widget ID.\n\t * @return array|WP_Error Array containing the updated widget information.\n\t *                        A WP_Error object, otherwise.\n\t */\n\tpublic function call_widget_update( $widget_id ) {\n\t\tglobal $wp_registered_widget_updates, $wp_registered_widget_controls;\n\n\t\t$setting_id = $this->get_setting_id( $widget_id );\n\n\t\t/*\n\t\t * Make sure that other setting changes have previewed since this widget\n\t\t * may depend on them (e.g. Menus being present for Navigation Menu widget).\n\t\t */\n\t\tif ( ! did_action( 'customize_preview_init' ) ) {\n\t\t\tforeach ( $this->manager->settings() as $setting ) {\n\t\t\t\tif ( $setting->id !== $setting_id ) {\n\t\t\t\t\t$setting->preview();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->start_capturing_option_updates();\n\t\t$parsed_id   = $this->parse_widget_id( $widget_id );\n\t\t$option_name = 'widget_' . $parsed_id['id_base'];\n\n\t\t/*\n\t\t * If a previously-sanitized instance is provided, populate the input vars\n\t\t * with its values so that the widget update callback will read this instance\n\t\t */\n\t\t$added_input_vars = array();\n\t\tif ( ! empty( $_POST['sanitized_widget_setting'] ) ) {\n\t\t\t$sanitized_widget_setting = json_decode( $this->get_post_value( 'sanitized_widget_setting' ), true );\n\t\t\tif ( false === $sanitized_widget_setting ) {\n\t\t\t\t$this->stop_capturing_option_updates();\n\t\t\t\treturn new WP_Error( 'widget_setting_malformed' );\n\t\t\t}\n\n\t\t\t$instance = $this->sanitize_widget_instance( $sanitized_widget_setting );\n\t\t\tif ( is_null( $instance ) ) {\n\t\t\t\t$this->stop_capturing_option_updates();\n\t\t\t\treturn new WP_Error( 'widget_setting_unsanitized' );\n\t\t\t}\n\n\t\t\tif ( ! is_null( $parsed_id['number'] ) ) {\n\t\t\t\t$value                         = array();\n\t\t\t\t$value[ $parsed_id['number'] ] = $instance;\n\t\t\t\t$key                           = 'widget-' . $parsed_id['id_base'];\n\t\t\t\t$_REQUEST[ $key ]              = wp_slash( $value );\n\t\t\t\t$_POST[ $key ]                 = $_REQUEST[ $key ];\n\t\t\t\t$added_input_vars[]            = $key;\n\t\t\t} else {\n\t\t\t\tforeach ( $instance as $key => $value ) {\n\t\t\t\t\t$_REQUEST[ $key ]   = wp_slash( $value );\n\t\t\t\t\t$_POST[ $key ]      = $_REQUEST[ $key ];\n\t\t\t\t\t$added_input_vars[] = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Invoke the widget update callback.\n\t\tforeach ( (array) $wp_registered_widget_updates as $name => $control ) {\n\t\t\tif ( $name === $parsed_id['id_base'] && is_callable( $control['callback'] ) ) {\n\t\t\t\tob_start();\n\t\t\t\tcall_user_func_array( $control['callback'], $control['params'] );\n\t\t\t\tob_end_clean();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Clean up any input vars that were manually added.\n\t\tforeach ( $added_input_vars as $key ) {\n\t\t\tunset( $_POST[ $key ] );\n\t\t\tunset( $_REQUEST[ $key ] );\n\t\t}\n\n\t\t// Make sure the expected option was updated.\n\t\tif ( 0 !== $this->count_captured_options() ) {\n\t\t\tif ( $this->count_captured_options() > 1 ) {\n\t\t\t\t$this->stop_capturing_option_updates();\n\t\t\t\treturn new WP_Error( 'widget_setting_too_many_options' );\n\t\t\t}\n\n\t\t\t$updated_option_name = key( $this->get_captured_options() );\n\t\t\tif ( $updated_option_name !== $option_name ) {\n\t\t\t\t$this->stop_capturing_option_updates();\n\t\t\t\treturn new WP_Error( 'widget_setting_unexpected_option' );\n\t\t\t}\n\t\t}\n\n\t\t// Obtain the widget instance.\n\t\t$option = $this->get_captured_option( $option_name );\n\t\tif ( null !== $parsed_id['number'] ) {\n\t\t\t$instance = $option[ $parsed_id['number'] ];\n\t\t} else {\n\t\t\t$instance = $option;\n\t\t}\n\n\t\t/*\n\t\t * Override the incoming $_POST['customized'] for a newly-created widget's\n\t\t * setting with the new $instance so that the preview filter currently\n\t\t * in place from WP_Customize_Setting::preview() will use this value\n\t\t * instead of the default widget instance value (an empty array).\n\t\t */\n\t\t$this->manager->set_post_value( $setting_id, $this->sanitize_widget_js_instance( $instance ) );\n\n\t\t// Obtain the widget control with the updated instance in place.\n\t\tob_start();\n\t\t$form = $wp_registered_widget_controls[ $widget_id ];\n\t\tif ( $form ) {\n\t\t\tcall_user_func_array( $form['callback'], $form['params'] );\n\t\t}\n\t\t$form = ob_get_clean();\n\n\t\t$this->stop_capturing_option_updates();\n\n\t\treturn compact( 'instance', 'form' );\n\t}\n\n\t/**\n\t * Updates widget settings asynchronously.\n\t *\n\t * Allows the Customizer to update a widget using its form, but return the new\n\t * instance info via Ajax instead of saving it to the options table.\n\t *\n\t * Most code here copied from wp_ajax_save_widget().\n\t *\n\t * @since 3.9.0\n\t *\n\t * @see wp_ajax_save_widget()\n\t */\n\tpublic function wp_ajax_update_widget() {\n\n\t\tif ( ! is_user_logged_in() ) {\n\t\t\twp_die( 0 );\n\t\t}\n\n\t\tcheck_ajax_referer( 'update-widget', 'nonce' );\n\n\t\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\t\twp_die( -1 );\n\t\t}\n\n\t\tif ( empty( $_POST['widget-id'] ) ) {\n\t\t\twp_send_json_error( 'missing_widget-id' );\n\t\t}\n\n\t\t/** This action is documented in wp-admin/includes/ajax-actions.php */\n\t\tdo_action( 'load-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\t/** This action is documented in wp-admin/includes/ajax-actions.php */\n\t\tdo_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\t/** This action is documented in wp-admin/widgets.php */\n\t\tdo_action( 'sidebar_admin_setup' );\n\n\t\t$widget_id = $this->get_post_value( 'widget-id' );\n\t\t$parsed_id = $this->parse_widget_id( $widget_id );\n\t\t$id_base   = $parsed_id['id_base'];\n\n\t\t$is_updating_widget_template = (\n\t\t\tisset( $_POST[ 'widget-' . $id_base ] )\n\t\t\t&&\n\t\t\tis_array( $_POST[ 'widget-' . $id_base ] )\n\t\t\t&&\n\t\t\tpreg_match( '/__i__|%i%/', key( $_POST[ 'widget-' . $id_base ] ) )\n\t\t);\n\t\tif ( $is_updating_widget_template ) {\n\t\t\twp_send_json_error( 'template_widget_not_updatable' );\n\t\t}\n\n\t\t$updated_widget = $this->call_widget_update( $widget_id ); // => {instance,form}\n\t\tif ( is_wp_error( $updated_widget ) ) {\n\t\t\twp_send_json_error( $updated_widget->get_error_code() );\n\t\t}\n\n\t\t$form     = $updated_widget['form'];\n\t\t$instance = $this->sanitize_widget_js_instance( $updated_widget['instance'] );\n\n\t\twp_send_json_success( compact( 'form', 'instance' ) );\n\t}\n\n\t/*\n\t * Selective Refresh Methods\n\t */\n\n\t/**\n\t * Filters arguments for dynamic widget partials.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param array|false $partial_args Partial arguments.\n\t * @param string      $partial_id   Partial ID.\n\t * @return array (Maybe) modified partial arguments.\n\t */\n\tpublic function customize_dynamic_partial_args( $partial_args, $partial_id ) {\n\t\tif ( ! current_theme_supports( 'customize-selective-refresh-widgets' ) ) {\n\t\t\treturn $partial_args;\n\t\t}\n\n\t\tif ( preg_match( '/^widget\\[(?P<widget_id>.+)\\]$/', $partial_id, $matches ) ) {\n\t\t\tif ( false === $partial_args ) {\n\t\t\t\t$partial_args = array();\n\t\t\t}\n\t\t\t$partial_args = array_merge(\n\t\t\t\t$partial_args,\n\t\t\t\tarray(\n\t\t\t\t\t'type'                => 'widget',\n\t\t\t\t\t'render_callback'     => array( $this, 'render_widget_partial' ),\n\t\t\t\t\t'container_inclusive' => true,\n\t\t\t\t\t'settings'            => array( $this->get_setting_id( $matches['widget_id'] ) ),\n\t\t\t\t\t'capability'          => 'edit_theme_options',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn $partial_args;\n\t}\n\n\t/**\n\t * Adds hooks for selective refresh.\n\t *\n\t * @since 4.5.0\n\t */\n\tpublic function selective_refresh_init() {\n\t\tif ( ! current_theme_supports( 'customize-selective-refresh-widgets' ) ) {\n\t\t\treturn;\n\t\t}\n\t\tadd_filter( 'dynamic_sidebar_params', array( $this, 'filter_dynamic_sidebar_params' ) );\n\t\tadd_filter( 'wp_kses_allowed_html', array( $this, 'filter_wp_kses_allowed_data_attributes' ) );\n\t\tadd_action( 'dynamic_sidebar_before', array( $this, 'start_dynamic_sidebar' ) );\n\t\tadd_action( 'dynamic_sidebar_after', array( $this, 'end_dynamic_sidebar' ) );\n\t}\n\n\t/**\n\t * Inject selective refresh data attributes into widget container elements.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param array $params {\n\t *     Dynamic sidebar params.\n\t *\n\t *     @type array $args        Sidebar args.\n\t *     @type array $widget_args Widget args.\n\t * }\n\t * @see WP_Customize_Nav_Menus::filter_wp_nav_menu_args()\n\t *\n\t * @return array Params.\n\t */\n\tpublic function filter_dynamic_sidebar_params( $params ) {\n\t\t$sidebar_args = array_merge(\n\t\t\tarray(\n\t\t\t\t'before_widget' => '',\n\t\t\t\t'after_widget'  => '',\n\t\t\t),\n\t\t\t$params[0]\n\t\t);\n\n\t\t// Skip widgets not in a registered sidebar or ones which lack a proper wrapper element to attach the data-* attributes to.\n\t\t$matches  = array();\n\t\t$is_valid = (\n\t\t\tisset( $sidebar_args['id'] )\n\t\t\t&&\n\t\t\tis_registered_sidebar( $sidebar_args['id'] )\n\t\t\t&&\n\t\t\t( isset( $this->current_dynamic_sidebar_id_stack[0] ) && $this->current_dynamic_sidebar_id_stack[0] === $sidebar_args['id'] )\n\t\t\t&&\n\t\t\tpreg_match( '#^<(?P<tag_name>\\w+)#', $sidebar_args['before_widget'], $matches )\n\t\t);\n\t\tif ( ! $is_valid ) {\n\t\t\treturn $params;\n\t\t}\n\t\t$this->before_widget_tags_seen[ $matches['tag_name'] ] = true;\n\n\t\t$context = array(\n\t\t\t'sidebar_id' => $sidebar_args['id'],\n\t\t);\n\t\tif ( isset( $this->context_sidebar_instance_number ) ) {\n\t\t\t$context['sidebar_instance_number'] = $this->context_sidebar_instance_number;\n\t\t} elseif ( isset( $sidebar_args['id'] ) && isset( $this->sidebar_instance_count[ $sidebar_args['id'] ] ) ) {\n\t\t\t$context['sidebar_instance_number'] = $this->sidebar_instance_count[ $sidebar_args['id'] ];\n\t\t}\n\n\t\t$attributes                    = sprintf( ' data-customize-partial-id=\"%s\"', esc_attr( 'widget[' . $sidebar_args['widget_id'] . ']' ) );\n\t\t$attributes                   .= ' data-customize-partial-type=\"widget\"';\n\t\t$attributes                   .= sprintf( ' data-customize-partial-placement-context=\"%s\"', esc_attr( wp_json_encode( $context ) ) );\n\t\t$attributes                   .= sprintf( ' data-customize-widget-id=\"%s\"', esc_attr( $sidebar_args['widget_id'] ) );\n\t\t$sidebar_args['before_widget'] = preg_replace( '#^(<\\w+)#', '$1 ' . $attributes, $sidebar_args['before_widget'] );\n\n\t\t$params[0] = $sidebar_args;\n\t\treturn $params;\n\t}\n\n\t/**\n\t * List of the tag names seen for before_widget strings.\n\t *\n\t * This is used in the {@see 'filter_wp_kses_allowed_html'} filter to ensure that the\n\t * data-* attributes can be allowed.\n\t *\n\t * @since 4.5.0\n\t * @var array\n\t */\n\tprotected $before_widget_tags_seen = array();\n\n\t/**\n\t * Ensures the HTML data-* attributes for selective refresh are allowed by kses.\n\t *\n\t * This is needed in case the `$before_widget` is run through wp_kses() when printed.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param array $allowed_html Allowed HTML.\n\t * @return array (Maybe) modified allowed HTML.\n\t */\n\tpublic function filter_wp_kses_allowed_data_attributes( $allowed_html ) {\n\t\tforeach ( array_keys( $this->before_widget_tags_seen ) as $tag_name ) {\n\t\t\tif ( ! isset( $allowed_html[ $tag_name ] ) ) {\n\t\t\t\t$allowed_html[ $tag_name ] = array();\n\t\t\t}\n\t\t\t$allowed_html[ $tag_name ] = array_merge(\n\t\t\t\t$allowed_html[ $tag_name ],\n\t\t\t\tarray_fill_keys(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'data-customize-partial-id',\n\t\t\t\t\t\t'data-customize-partial-type',\n\t\t\t\t\t\t'data-customize-partial-placement-context',\n\t\t\t\t\t\t'data-customize-partial-widget-id',\n\t\t\t\t\t\t'data-customize-partial-options',\n\t\t\t\t\t),\n\t\t\t\t\ttrue\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn $allowed_html;\n\t}\n\n\t/**\n\t * Keep track of the number of times that dynamic_sidebar() was called for a given sidebar index.\n\t *\n\t * This helps facilitate the uncommon scenario where a single sidebar is rendered multiple times on a template.\n\t *\n\t * @since 4.5.0\n\t * @var array\n\t */\n\tprotected $sidebar_instance_count = array();\n\n\t/**\n\t * The current request's sidebar_instance_number context.\n\t *\n\t * @since 4.5.0\n\t * @var int|null\n\t */\n\tprotected $context_sidebar_instance_number;\n\n\t/**\n\t * Current sidebar ID being rendered.\n\t *\n\t * @since 4.5.0\n\t * @var array\n\t */\n\tprotected $current_dynamic_sidebar_id_stack = array();\n\n\t/**\n\t * Begins keeping track of the current sidebar being rendered.\n\t *\n\t * Insert marker before widgets are rendered in a dynamic sidebar.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param int|string $index Index, name, or ID of the dynamic sidebar.\n\t */\n\tpublic function start_dynamic_sidebar( $index ) {\n\t\tarray_unshift( $this->current_dynamic_sidebar_id_stack, $index );\n\t\tif ( ! isset( $this->sidebar_instance_count[ $index ] ) ) {\n\t\t\t$this->sidebar_instance_count[ $index ] = 0;\n\t\t}\n\t\t$this->sidebar_instance_count[ $index ] += 1;\n\t\tif ( ! $this->manager->selective_refresh->is_render_partials_request() ) {\n\t\t\tprintf( \"\\n<!--dynamic_sidebar_before:%s:%d-->\\n\", esc_html( $index ), intval( $this->sidebar_instance_count[ $index ] ) );\n\t\t}\n\t}\n\n\t/**\n\t * Finishes keeping track of the current sidebar being rendered.\n\t *\n\t * Inserts a marker after widgets are rendered in a dynamic sidebar.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param int|string $index Index, name, or ID of the dynamic sidebar.\n\t */\n\tpublic function end_dynamic_sidebar( $index ) {\n\t\tarray_shift( $this->current_dynamic_sidebar_id_stack );\n\t\tif ( ! $this->manager->selective_refresh->is_render_partials_request() ) {\n\t\t\tprintf( \"\\n<!--dynamic_sidebar_after:%s:%d-->\\n\", esc_html( $index ), intval( $this->sidebar_instance_count[ $index ] ) );\n\t\t}\n\t}\n\n\t/**\n\t * Current sidebar being rendered.\n\t *\n\t * @since 4.5.0\n\t * @var string|null\n\t */\n\tprotected $rendering_widget_id;\n\n\t/**\n\t * Current widget being rendered.\n\t *\n\t * @since 4.5.0\n\t * @var string|null\n\t */\n\tprotected $rendering_sidebar_id;\n\n\t/**\n\t * Filters sidebars_widgets to ensure the currently-rendered widget is the only widget in the current sidebar.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param array $sidebars_widgets Sidebars widgets.\n\t * @return array Filtered sidebars widgets.\n\t */\n\tpublic function filter_sidebars_widgets_for_rendering_widget( $sidebars_widgets ) {\n\t\t$sidebars_widgets[ $this->rendering_sidebar_id ] = array( $this->rendering_widget_id );\n\t\treturn $sidebars_widgets;\n\t}\n\n\t/**\n\t * Renders a specific widget using the supplied sidebar arguments.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @see dynamic_sidebar()\n\t *\n\t * @param WP_Customize_Partial $partial Partial.\n\t * @param array                $context {\n\t *     Sidebar args supplied as container context.\n\t *\n\t *     @type string $sidebar_id              ID for sidebar for widget to render into.\n\t *     @type int    $sidebar_instance_number Disambiguating instance number.\n\t * }\n\t * @return string|false\n\t */\n\tpublic function render_widget_partial( $partial, $context ) {\n\t\t$id_data   = $partial->id_data();\n\t\t$widget_id = array_shift( $id_data['keys'] );\n\n\t\tif ( ! is_array( $context )\n\t\t\t|| empty( $context['sidebar_id'] )\n\t\t\t|| ! is_registered_sidebar( $context['sidebar_id'] )\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->rendering_sidebar_id = $context['sidebar_id'];\n\n\t\tif ( isset( $context['sidebar_instance_number'] ) ) {\n\t\t\t$this->context_sidebar_instance_number = intval( $context['sidebar_instance_number'] );\n\t\t}\n\n\t\t// Filter sidebars_widgets so that only the queried widget is in the sidebar.\n\t\t$this->rendering_widget_id = $widget_id;\n\n\t\t$filter_callback = array( $this, 'filter_sidebars_widgets_for_rendering_widget' );\n\t\tadd_filter( 'sidebars_widgets', $filter_callback, 1000 );\n\n\t\t// Render the widget.\n\t\tob_start();\n\t\t$this->rendering_sidebar_id = $context['sidebar_id'];\n\t\tdynamic_sidebar( $this->rendering_sidebar_id );\n\t\t$container = ob_get_clean();\n\n\t\t// Reset variables for next partial render.\n\t\tremove_filter( 'sidebars_widgets', $filter_callback, 1000 );\n\n\t\t$this->context_sidebar_instance_number = null;\n\t\t$this->rendering_sidebar_id            = null;\n\t\t$this->rendering_widget_id             = null;\n\n\t\treturn $container;\n\t}\n\n\t//\n\t// Option Update Capturing.\n\t//\n\n\t/**\n\t * List of captured widget option updates.\n\t *\n\t * @since 3.9.0\n\t * @var array $_captured_options Values updated while option capture is happening.\n\t */\n\tprotected $_captured_options = array();\n\n\t/**\n\t * Whether option capture is currently happening.\n\t *\n\t * @since 3.9.0\n\t * @var bool $_is_current Whether option capture is currently happening or not.\n\t */\n\tprotected $_is_capturing_option_updates = false;\n\n\t/**\n\t * Determines whether the captured option update should be ignored.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param string $option_name Option name.\n\t * @return bool Whether the option capture is ignored.\n\t */\n\tprotected function is_option_capture_ignored( $option_name ) {\n\t\treturn ( 0 === strpos( $option_name, '_transient_' ) );\n\t}\n\n\t/**\n\t * Retrieves captured widget option updates.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @return array Array of captured options.\n\t */\n\tprotected function get_captured_options() {\n\t\treturn $this->_captured_options;\n\t}\n\n\t/**\n\t * Retrieves the option that was captured from being saved.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param string $option_name Option name.\n\t * @param mixed  $default     Optional. Default value to return if the option does not exist. Default false.\n\t * @return mixed Value set for the option.\n\t */\n\tprotected function get_captured_option( $option_name, $default = false ) {\n\t\tif ( array_key_exists( $option_name, $this->_captured_options ) ) {\n\t\t\t$value = $this->_captured_options[ $option_name ];\n\t\t} else {\n\t\t\t$value = $default;\n\t\t}\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Retrieves the number of captured widget option updates.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @return int Number of updated options.\n\t */\n\tprotected function count_captured_options() {\n\t\treturn count( $this->_captured_options );\n\t}\n\n\t/**\n\t * Begins keeping track of changes to widget options, caching new values.\n\t *\n\t * @since 3.9.0\n\t */\n\tprotected function start_capturing_option_updates() {\n\t\tif ( $this->_is_capturing_option_updates ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->_is_capturing_option_updates = true;\n\n\t\tadd_filter( 'pre_update_option', array( $this, 'capture_filter_pre_update_option' ), 10, 3 );\n\t}\n\n\t/**\n\t * Pre-filters captured option values before updating.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param mixed  $new_value   The new option value.\n\t * @param string $option_name Name of the option.\n\t * @param mixed  $old_value   The old option value.\n\t * @return mixed Filtered option value.\n\t */\n\tpublic function capture_filter_pre_update_option( $new_value, $option_name, $old_value ) {\n\t\tif ( $this->is_option_capture_ignored( $option_name ) ) {\n\t\t\treturn $new_value;\n\t\t}\n\n\t\tif ( ! isset( $this->_captured_options[ $option_name ] ) ) {\n\t\t\tadd_filter( \"pre_option_{$option_name}\", array( $this, 'capture_filter_pre_get_option' ) );\n\t\t}\n\n\t\t$this->_captured_options[ $option_name ] = $new_value;\n\n\t\treturn $old_value;\n\t}\n\n\t/**\n\t * Pre-filters captured option values before retrieving.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param mixed $value Value to return instead of the option value.\n\t * @return mixed Filtered option value.\n\t */\n\tpublic function capture_filter_pre_get_option( $value ) {\n\t\t$option_name = preg_replace( '/^pre_option_/', '', current_filter() );\n\n\t\tif ( isset( $this->_captured_options[ $option_name ] ) ) {\n\t\t\t$value = $this->_captured_options[ $option_name ];\n\n\t\t\t/** This filter is documented in wp-includes/option.php */\n\t\t\t$value = apply_filters( 'option_' . $option_name, $value, $option_name );\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Undoes any changes to the options since options capture began.\n\t *\n\t * @since 3.9.0\n\t */\n\tprotected function stop_capturing_option_updates() {\n\t\tif ( ! $this->_is_capturing_option_updates ) {\n\t\t\treturn;\n\t\t}\n\n\t\tremove_filter( 'pre_update_option', array( $this, 'capture_filter_pre_update_option' ), 10 );\n\n\t\tforeach ( array_keys( $this->_captured_options ) as $option_name ) {\n\t\t\tremove_filter( \"pre_option_{$option_name}\", array( $this, 'capture_filter_pre_get_option' ) );\n\t\t}\n\n\t\t$this->_captured_options            = array();\n\t\t$this->_is_capturing_option_updates = false;\n\t}\n\n\t/**\n\t * {@internal Missing Summary}\n\t *\n\t * See the {@see 'customize_dynamic_setting_args'} filter.\n\t *\n\t * @since 3.9.0\n\t * @deprecated 4.2.0 Deprecated in favor of the {@see 'customize_dynamic_setting_args'} filter.\n\t */\n\tpublic function setup_widget_addition_previews() {\n\t\t_deprecated_function( __METHOD__, '4.2.0', 'customize_dynamic_setting_args' );\n\t}\n\n\t/**\n\t * {@internal Missing Summary}\n\t *\n\t * See the {@see 'customize_dynamic_setting_args'} filter.\n\t *\n\t * @since 3.9.0\n\t * @deprecated 4.2.0 Deprecated in favor of the {@see 'customize_dynamic_setting_args'} filter.\n\t */\n\tpublic function prepreview_added_sidebars_widgets() {\n\t\t_deprecated_function( __METHOD__, '4.2.0', 'customize_dynamic_setting_args' );\n\t}\n\n\t/**\n\t * {@internal Missing Summary}\n\t *\n\t * See the {@see 'customize_dynamic_setting_args'} filter.\n\t *\n\t * @since 3.9.0\n\t * @deprecated 4.2.0 Deprecated in favor of the {@see 'customize_dynamic_setting_args'} filter.\n\t */\n\tpublic function prepreview_added_widget_instance() {\n\t\t_deprecated_function( __METHOD__, '4.2.0', 'customize_dynamic_setting_args' );\n\t}\n\n\t/**\n\t * {@internal Missing Summary}\n\t *\n\t * See the {@see 'customize_dynamic_setting_args'} filter.\n\t *\n\t * @since 3.9.0\n\t * @deprecated 4.2.0 Deprecated in favor of the {@see 'customize_dynamic_setting_args'} filter.\n\t */\n\tpublic function remove_prepreview_filters() {\n\t\t_deprecated_function( __METHOD__, '4.2.0', 'customize_dynamic_setting_args' );\n\t}\n}\n", "num_lines": 2079}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Class for generating SQL clauses that filter a primary query according to date.\n *\n * WP_Date_Query is a helper that allows primary query classes, such as WP_Query, to filter\n * their results by date columns, by generating `WHERE` subclauses to be attached to the\n * primary SQL query string.\n *\n * Attempting to filter by an invalid date value (eg month=13) will generate SQL that will\n * return no results. In these cases, a _doing_it_wrong() error notice is also thrown.\n * See WP_Date_Query::validate_date_values().\n *\n * @link https://developer.wordpress.org/reference/classes/wp_query/\n *\n * @since 3.7.0\n */\nclass WP_Date_Query {\n\t/**\n\t * Array of date queries.\n\t *\n\t * See WP_Date_Query::__construct() for information on date query arguments.\n\t *\n\t * @since 3.7.0\n\t * @var array\n\t */\n\tpublic $queries = array();\n\n\t/**\n\t * The default relation between top-level queries. Can be either 'AND' or 'OR'.\n\t *\n\t * @since 3.7.0\n\t * @var string\n\t */\n\tpublic $relation = 'AND';\n\n\t/**\n\t * The column to query against. Can be changed via the query arguments.\n\t *\n\t * @since 3.7.0\n\t * @var string\n\t */\n\tpublic $column = 'post_date';\n\n\t/**\n\t * The value comparison operator. Can be changed via the query arguments.\n\t *\n\t * @since 3.7.0\n\t * @var string\n\t */\n\tpublic $compare = '=';\n\n\t/**\n\t * Supported time-related parameter keys.\n\t *\n\t * @since 4.1.0\n\t * @var array\n\t */\n\tpublic $time_keys = array( 'after', 'before', 'year', 'month', 'monthnum', 'week', 'w', 'dayofyear', 'day', 'dayofweek', 'dayofweek_iso', 'hour', 'minute', 'second' );\n\n\t/**\n\t * Constructor.\n\t *\n\t * Time-related parameters that normally require integer values ('year', 'month', 'week', 'dayofyear', 'day',\n\t * 'dayofweek', 'dayofweek_iso', 'hour', 'minute', 'second') accept arrays of integers for some values of\n\t * 'compare'. When 'compare' is 'IN' or 'NOT IN', arrays are accepted; when 'compare' is 'BETWEEN' or 'NOT\n\t * BETWEEN', arrays of two valid values are required. See individual argument descriptions for accepted values.\n\t *\n\t * @since 3.7.0\n\t * @since 4.0.0 The $inclusive logic was updated to include all times within the date range.\n\t * @since 4.1.0 Introduced 'dayofweek_iso' time type parameter.\n\t *\n\t * @param array  $date_query {\n\t *     Array of date query clauses.\n\t *\n\t *     @type array ...$0 {\n\t *         @type string $column   Optional. The column to query against. If undefined, inherits the value of\n\t *                                the `$default_column` parameter. Accepts 'post_date', 'post_date_gmt',\n\t *                                'post_modified','post_modified_gmt', 'comment_date', 'comment_date_gmt'.\n\t *                                Default 'post_date'.\n\t *         @type string $compare  Optional. The comparison operator. Accepts '=', '!=', '>', '>=', '<', '<=',\n\t *                                'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'. Default '='.\n\t *         @type string $relation Optional. The boolean relationship between the date queries. Accepts 'OR' or 'AND'.\n\t *                                Default 'OR'.\n\t *         @type array  ...$0 {\n\t *             Optional. An array of first-order clause parameters, or another fully-formed date query.\n\t *\n\t *             @type string|array $before {\n\t *                 Optional. Date to retrieve posts before. Accepts `strtotime()`-compatible string,\n\t *                 or array of 'year', 'month', 'day' values.\n\t *\n\t *                 @type string $year  The four-digit year. Default empty. Accepts any four-digit year.\n\t *                 @type string $month Optional when passing array.The month of the year.\n\t *                                     Default (string:empty)|(array:1). Accepts numbers 1-12.\n\t *                 @type string $day   Optional when passing array.The day of the month.\n\t *                                     Default (string:empty)|(array:1). Accepts numbers 1-31.\n\t *             }\n\t *             @type string|array $after {\n\t *                 Optional. Date to retrieve posts after. Accepts `strtotime()`-compatible string,\n\t *                 or array of 'year', 'month', 'day' values.\n\t *\n\t *                 @type string $year  The four-digit year. Accepts any four-digit year. Default empty.\n\t *                 @type string $month Optional when passing array. The month of the year. Accepts numbers 1-12.\n\t *                                     Default (string:empty)|(array:12).\n\t *                 @type string $day   Optional when passing array.The day of the month. Accepts numbers 1-31.\n\t *                                     Default (string:empty)|(array:last day of month).\n\t *             }\n\t *             @type string       $column        Optional. Used to add a clause comparing a column other than the\n\t *                                               column specified in the top-level `$column` parameter. Accepts\n\t *                                               'post_date', 'post_date_gmt', 'post_modified', 'post_modified_gmt',\n\t *                                               'comment_date', 'comment_date_gmt'. Default is the value of\n\t *                                               top-level `$column`.\n\t *             @type string       $compare       Optional. The comparison operator. Accepts '=', '!=', '>', '>=',\n\t *                                               '<', '<=', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'. 'IN',\n\t *                                               'NOT IN', 'BETWEEN', and 'NOT BETWEEN'. Comparisons support\n\t *                                               arrays in some time-related parameters. Default '='.\n\t *             @type bool         $inclusive     Optional. Include results from dates specified in 'before' or\n\t *                                               'after'. Default false.\n\t *             @type int|array    $year          Optional. The four-digit year number. Accepts any four-digit year\n\t *                                               or an array of years if `$compare` supports it. Default empty.\n\t *             @type int|array    $month         Optional. The two-digit month number. Accepts numbers 1-12 or an\n\t *                                               array of valid numbers if `$compare` supports it. Default empty.\n\t *             @type int|array    $week          Optional. The week number of the year. Accepts numbers 0-53 or an\n\t *                                               array of valid numbers if `$compare` supports it. Default empty.\n\t *             @type int|array    $dayofyear     Optional. The day number of the year. Accepts numbers 1-366 or an\n\t *                                               array of valid numbers if `$compare` supports it.\n\t *             @type int|array    $day           Optional. The day of the month. Accepts numbers 1-31 or an array\n\t *                                               of valid numbers if `$compare` supports it. Default empty.\n\t *             @type int|array    $dayofweek     Optional. The day number of the week. Accepts numbers 1-7 (1 is\n\t *                                               Sunday) or an array of valid numbers if `$compare` supports it.\n\t *                                               Default empty.\n\t *             @type int|array    $dayofweek_iso Optional. The day number of the week (ISO). Accepts numbers 1-7\n\t *                                               (1 is Monday) or an array of valid numbers if `$compare` supports it.\n\t *                                               Default empty.\n\t *             @type int|array    $hour          Optional. The hour of the day. Accepts numbers 0-23 or an array\n\t *                                               of valid numbers if `$compare` supports it. Default empty.\n\t *             @type int|array    $minute        Optional. The minute of the hour. Accepts numbers 0-60 or an array\n\t *                                               of valid numbers if `$compare` supports it. Default empty.\n\t *             @type int|array    $second        Optional. The second of the minute. Accepts numbers 0-60 or an\n\t *                                               array of valid numbers if `$compare` supports it. Default empty.\n\t *         }\n\t *     }\n\t * }\n\t * @param string $default_column Optional. Default column to query against. Default 'post_date'.\n\t *                               Accepts 'post_date', 'post_date_gmt', 'post_modified', 'post_modified_gmt',\n\t *                               'comment_date', 'comment_date_gmt'.\n\t */\n\tpublic function __construct( $date_query, $default_column = 'post_date' ) {\n\t\tif ( empty( $date_query ) || ! is_array( $date_query ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( $date_query['relation'] ) && 'OR' === strtoupper( $date_query['relation'] ) ) {\n\t\t\t$this->relation = 'OR';\n\t\t} else {\n\t\t\t$this->relation = 'AND';\n\t\t}\n\n\t\t// Support for passing time-based keys in the top level of the $date_query array.\n\t\tif ( ! isset( $date_query[0] ) ) {\n\t\t\t$date_query = array( $date_query );\n\t\t}\n\n\t\tif ( ! empty( $date_query['column'] ) ) {\n\t\t\t$date_query['column'] = esc_sql( $date_query['column'] );\n\t\t} else {\n\t\t\t$date_query['column'] = esc_sql( $default_column );\n\t\t}\n\n\t\t$this->column = $this->validate_column( $this->column );\n\n\t\t$this->compare = $this->get_compare( $date_query );\n\n\t\t$this->queries = $this->sanitize_query( $date_query );\n\t}\n\n\t/**\n\t * Recursive-friendly query sanitizer.\n\t *\n\t * Ensures that each query-level clause has a 'relation' key, and that\n\t * each first-order clause contains all the necessary keys from `$defaults`.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param array $queries\n\t * @param array $parent_query\n\t * @return array Sanitized queries.\n\t */\n\tpublic function sanitize_query( $queries, $parent_query = null ) {\n\t\t$cleaned_query = array();\n\n\t\t$defaults = array(\n\t\t\t'column'   => 'post_date',\n\t\t\t'compare'  => '=',\n\t\t\t'relation' => 'AND',\n\t\t);\n\n\t\t// Numeric keys should always have array values.\n\t\tforeach ( $queries as $qkey => $qvalue ) {\n\t\t\tif ( is_numeric( $qkey ) && ! is_array( $qvalue ) ) {\n\t\t\t\tunset( $queries[ $qkey ] );\n\t\t\t}\n\t\t}\n\n\t\t// Each query should have a value for each default key. Inherit from the parent when possible.\n\t\tforeach ( $defaults as $dkey => $dvalue ) {\n\t\t\tif ( isset( $queries[ $dkey ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( isset( $parent_query[ $dkey ] ) ) {\n\t\t\t\t$queries[ $dkey ] = $parent_query[ $dkey ];\n\t\t\t} else {\n\t\t\t\t$queries[ $dkey ] = $dvalue;\n\t\t\t}\n\t\t}\n\n\t\t// Validate the dates passed in the query.\n\t\tif ( $this->is_first_order_clause( $queries ) ) {\n\t\t\t$this->validate_date_values( $queries );\n\t\t}\n\n\t\tforeach ( $queries as $key => $q ) {\n\t\t\tif ( ! is_array( $q ) || in_array( $key, $this->time_keys, true ) ) {\n\t\t\t\t// This is a first-order query. Trust the values and sanitize when building SQL.\n\t\t\t\t$cleaned_query[ $key ] = $q;\n\t\t\t} else {\n\t\t\t\t// Any array without a time key is another query, so we recurse.\n\t\t\t\t$cleaned_query[] = $this->sanitize_query( $q, $queries );\n\t\t\t}\n\t\t}\n\n\t\treturn $cleaned_query;\n\t}\n\n\t/**\n\t * Determine whether this is a first-order clause.\n\t *\n\t * Checks to see if the current clause has any time-related keys.\n\t * If so, it's first-order.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param array $query Query clause.\n\t * @return bool True if this is a first-order clause.\n\t */\n\tprotected function is_first_order_clause( $query ) {\n\t\t$time_keys = array_intersect( $this->time_keys, array_keys( $query ) );\n\t\treturn ! empty( $time_keys );\n\t}\n\n\t/**\n\t * Determines and validates what comparison operator to use.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param array $query A date query or a date subquery.\n\t * @return string The comparison operator.\n\t */\n\tpublic function get_compare( $query ) {\n\t\tif ( ! empty( $query['compare'] )\n\t\t\t&& in_array( $query['compare'], array( '=', '!=', '>', '>=', '<', '<=', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ), true )\n\t\t) {\n\t\t\treturn strtoupper( $query['compare'] );\n\t\t}\n\n\t\treturn $this->compare;\n\t}\n\n\t/**\n\t * Validates the given date_query values and triggers errors if something is not valid.\n\t *\n\t * Note that date queries with invalid date ranges are allowed to\n\t * continue (though of course no items will be found for impossible dates).\n\t * This method only generates debug notices for these cases.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param array $date_query The date_query array.\n\t * @return bool  True if all values in the query are valid, false if one or more fail.\n\t */\n\tpublic function validate_date_values( $date_query = array() ) {\n\t\tif ( empty( $date_query ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$valid = true;\n\n\t\t/*\n\t\t * Validate 'before' and 'after' up front, then let the\n\t\t * validation routine continue to be sure that all invalid\n\t\t * values generate errors too.\n\t\t */\n\t\tif ( array_key_exists( 'before', $date_query ) && is_array( $date_query['before'] ) ) {\n\t\t\t$valid = $this->validate_date_values( $date_query['before'] );\n\t\t}\n\n\t\tif ( array_key_exists( 'after', $date_query ) && is_array( $date_query['after'] ) ) {\n\t\t\t$valid = $this->validate_date_values( $date_query['after'] );\n\t\t}\n\n\t\t// Array containing all min-max checks.\n\t\t$min_max_checks = array();\n\n\t\t// Days per year.\n\t\tif ( array_key_exists( 'year', $date_query ) ) {\n\t\t\t/*\n\t\t\t * If a year exists in the date query, we can use it to get the days.\n\t\t\t * If multiple years are provided (as in a BETWEEN), use the first one.\n\t\t\t */\n\t\t\tif ( is_array( $date_query['year'] ) ) {\n\t\t\t\t$_year = reset( $date_query['year'] );\n\t\t\t} else {\n\t\t\t\t$_year = $date_query['year'];\n\t\t\t}\n\n\t\t\t$max_days_of_year = gmdate( 'z', mktime( 0, 0, 0, 12, 31, $_year ) ) + 1;\n\t\t} else {\n\t\t\t// Otherwise we use the max of 366 (leap-year).\n\t\t\t$max_days_of_year = 366;\n\t\t}\n\n\t\t$min_max_checks['dayofyear'] = array(\n\t\t\t'min' => 1,\n\t\t\t'max' => $max_days_of_year,\n\t\t);\n\n\t\t// Days per week.\n\t\t$min_max_checks['dayofweek'] = array(\n\t\t\t'min' => 1,\n\t\t\t'max' => 7,\n\t\t);\n\n\t\t// Days per week.\n\t\t$min_max_checks['dayofweek_iso'] = array(\n\t\t\t'min' => 1,\n\t\t\t'max' => 7,\n\t\t);\n\n\t\t// Months per year.\n\t\t$min_max_checks['month'] = array(\n\t\t\t'min' => 1,\n\t\t\t'max' => 12,\n\t\t);\n\n\t\t// Weeks per year.\n\t\tif ( isset( $_year ) ) {\n\t\t\t/*\n\t\t\t * If we have a specific year, use it to calculate number of weeks.\n\t\t\t * Note: the number of weeks in a year is the date in which Dec 28 appears.\n\t\t\t */\n\t\t\t$week_count = gmdate( 'W', mktime( 0, 0, 0, 12, 28, $_year ) );\n\n\t\t} else {\n\t\t\t// Otherwise set the week-count to a maximum of 53.\n\t\t\t$week_count = 53;\n\t\t}\n\n\t\t$min_max_checks['week'] = array(\n\t\t\t'min' => 1,\n\t\t\t'max' => $week_count,\n\t\t);\n\n\t\t// Days per month.\n\t\t$min_max_checks['day'] = array(\n\t\t\t'min' => 1,\n\t\t\t'max' => 31,\n\t\t);\n\n\t\t// Hours per day.\n\t\t$min_max_checks['hour'] = array(\n\t\t\t'min' => 0,\n\t\t\t'max' => 23,\n\t\t);\n\n\t\t// Minutes per hour.\n\t\t$min_max_checks['minute'] = array(\n\t\t\t'min' => 0,\n\t\t\t'max' => 59,\n\t\t);\n\n\t\t// Seconds per minute.\n\t\t$min_max_checks['second'] = array(\n\t\t\t'min' => 0,\n\t\t\t'max' => 59,\n\t\t);\n\n\t\t// Concatenate and throw a notice for each invalid value.\n\t\tforeach ( $min_max_checks as $key => $check ) {\n\t\t\tif ( ! array_key_exists( $key, $date_query ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Throw a notice for each failing value.\n\t\t\tforeach ( (array) $date_query[ $key ] as $_value ) {\n\t\t\t\t$is_between = $_value >= $check['min'] && $_value <= $check['max'];\n\n\t\t\t\tif ( ! is_numeric( $_value ) || ! $is_between ) {\n\t\t\t\t\t$error = sprintf(\n\t\t\t\t\t\t/* translators: Date query invalid date message. 1: Invalid value, 2: Type of value, 3: Minimum valid value, 4: Maximum valid value. */\n\t\t\t\t\t\t__( 'Invalid value %1$s for %2$s. Expected value should be between %3$s and %4$s.' ),\n\t\t\t\t\t\t'<code>' . esc_html( $_value ) . '</code>',\n\t\t\t\t\t\t'<code>' . esc_html( $key ) . '</code>',\n\t\t\t\t\t\t'<code>' . esc_html( $check['min'] ) . '</code>',\n\t\t\t\t\t\t'<code>' . esc_html( $check['max'] ) . '</code>'\n\t\t\t\t\t);\n\n\t\t\t\t\t_doing_it_wrong( __CLASS__, $error, '4.1.0' );\n\n\t\t\t\t\t$valid = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If we already have invalid date messages, don't bother running through checkdate().\n\t\tif ( ! $valid ) {\n\t\t\treturn $valid;\n\t\t}\n\n\t\t$day_month_year_error_msg = '';\n\n\t\t$day_exists   = array_key_exists( 'day', $date_query ) && is_numeric( $date_query['day'] );\n\t\t$month_exists = array_key_exists( 'month', $date_query ) && is_numeric( $date_query['month'] );\n\t\t$year_exists  = array_key_exists( 'year', $date_query ) && is_numeric( $date_query['year'] );\n\n\t\tif ( $day_exists && $month_exists && $year_exists ) {\n\t\t\t// 1. Checking day, month, year combination.\n\t\t\tif ( ! wp_checkdate( $date_query['month'], $date_query['day'], $date_query['year'], sprintf( '%s-%s-%s', $date_query['year'], $date_query['month'], $date_query['day'] ) ) ) {\n\t\t\t\t$day_month_year_error_msg = sprintf(\n\t\t\t\t\t/* translators: 1: Year, 2: Month, 3: Day of month. */\n\t\t\t\t\t__( 'The following values do not describe a valid date: year %1$s, month %2$s, day %3$s.' ),\n\t\t\t\t\t'<code>' . esc_html( $date_query['year'] ) . '</code>',\n\t\t\t\t\t'<code>' . esc_html( $date_query['month'] ) . '</code>',\n\t\t\t\t\t'<code>' . esc_html( $date_query['day'] ) . '</code>'\n\t\t\t\t);\n\n\t\t\t\t$valid = false;\n\t\t\t}\n\t\t} elseif ( $day_exists && $month_exists ) {\n\t\t\t/*\n\t\t\t * 2. checking day, month combination\n\t\t\t * We use 2012 because, as a leap year, it's the most permissive.\n\t\t\t */\n\t\t\tif ( ! wp_checkdate( $date_query['month'], $date_query['day'], 2012, sprintf( '2012-%s-%s', $date_query['month'], $date_query['day'] ) ) ) {\n\t\t\t\t$day_month_year_error_msg = sprintf(\n\t\t\t\t\t/* translators: 1: Month, 2: Day of month. */\n\t\t\t\t\t__( 'The following values do not describe a valid date: month %1$s, day %2$s.' ),\n\t\t\t\t\t'<code>' . esc_html( $date_query['month'] ) . '</code>',\n\t\t\t\t\t'<code>' . esc_html( $date_query['day'] ) . '</code>'\n\t\t\t\t);\n\n\t\t\t\t$valid = false;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $day_month_year_error_msg ) ) {\n\t\t\t_doing_it_wrong( __CLASS__, $day_month_year_error_msg, '4.1.0' );\n\t\t}\n\n\t\treturn $valid;\n\t}\n\n\t/**\n\t * Validates a column name parameter.\n\t *\n\t * Column names without a table prefix (like 'post_date') are checked against a list of\n\t * allowed and known tables, and then, if found, have a table prefix (such as 'wp_posts.')\n\t * prepended. Prefixed column names (such as 'wp_posts.post_date') bypass this allowed\n\t * check, and are only sanitized to remove illegal characters.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param string $column The user-supplied column name.\n\t * @return string A validated column name value.\n\t */\n\tpublic function validate_column( $column ) {\n\t\tglobal $wpdb;\n\n\t\t$valid_columns = array(\n\t\t\t'post_date',\n\t\t\t'post_date_gmt',\n\t\t\t'post_modified',\n\t\t\t'post_modified_gmt',\n\t\t\t'comment_date',\n\t\t\t'comment_date_gmt',\n\t\t\t'user_registered',\n\t\t\t'registered',\n\t\t\t'last_updated',\n\t\t);\n\n\t\t// Attempt to detect a table prefix.\n\t\tif ( false === strpos( $column, '.' ) ) {\n\t\t\t/**\n\t\t\t * Filters the list of valid date query columns.\n\t\t\t *\n\t\t\t * @since 3.7.0\n\t\t\t * @since 4.1.0 Added 'user_registered' to the default recognized columns.\n\t\t\t *\n\t\t\t * @param string[] $valid_columns An array of valid date query columns. Defaults\n\t\t\t *                                are 'post_date', 'post_date_gmt', 'post_modified',\n\t\t\t *                                'post_modified_gmt', 'comment_date', 'comment_date_gmt',\n\t\t\t *                                'user_registered'\n\t\t\t */\n\t\t\tif ( ! in_array( $column, apply_filters( 'date_query_valid_columns', $valid_columns ), true ) ) {\n\t\t\t\t$column = 'post_date';\n\t\t\t}\n\n\t\t\t$known_columns = array(\n\t\t\t\t$wpdb->posts    => array(\n\t\t\t\t\t'post_date',\n\t\t\t\t\t'post_date_gmt',\n\t\t\t\t\t'post_modified',\n\t\t\t\t\t'post_modified_gmt',\n\t\t\t\t),\n\t\t\t\t$wpdb->comments => array(\n\t\t\t\t\t'comment_date',\n\t\t\t\t\t'comment_date_gmt',\n\t\t\t\t),\n\t\t\t\t$wpdb->users    => array(\n\t\t\t\t\t'user_registered',\n\t\t\t\t),\n\t\t\t\t$wpdb->blogs    => array(\n\t\t\t\t\t'registered',\n\t\t\t\t\t'last_updated',\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t// If it's a known column name, add the appropriate table prefix.\n\t\t\tforeach ( $known_columns as $table_name => $table_columns ) {\n\t\t\t\tif ( in_array( $column, $table_columns, true ) ) {\n\t\t\t\t\t$column = $table_name . '.' . $column;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove unsafe characters.\n\t\treturn preg_replace( '/[^a-zA-Z0-9_$\\.]/', '', $column );\n\t}\n\n\t/**\n\t * Generate WHERE clause to be appended to a main query.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return string MySQL WHERE clause.\n\t */\n\tpublic function get_sql() {\n\t\t$sql = $this->get_sql_clauses();\n\n\t\t$where = $sql['where'];\n\n\t\t/**\n\t\t * Filters the date query WHERE clause.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param string        $where WHERE clause of the date query.\n\t\t * @param WP_Date_Query $this  The WP_Date_Query instance.\n\t\t */\n\t\treturn apply_filters( 'get_date_sql', $where, $this );\n\t}\n\n\t/**\n\t * Generate SQL clauses to be appended to a main query.\n\t *\n\t * Called by the public WP_Date_Query::get_sql(), this method is abstracted\n\t * out to maintain parity with the other Query classes.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @return array {\n\t *     Array containing JOIN and WHERE SQL clauses to append to the main query.\n\t *\n\t *     @type string $join  SQL fragment to append to the main JOIN clause.\n\t *     @type string $where SQL fragment to append to the main WHERE clause.\n\t * }\n\t */\n\tprotected function get_sql_clauses() {\n\t\t$sql = $this->get_sql_for_query( $this->queries );\n\n\t\tif ( ! empty( $sql['where'] ) ) {\n\t\t\t$sql['where'] = ' AND ' . $sql['where'];\n\t\t}\n\n\t\treturn $sql;\n\t}\n\n\t/**\n\t * Generate SQL clauses for a single query array.\n\t *\n\t * If nested subqueries are found, this method recurses the tree to\n\t * produce the properly nested SQL.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param array $query Query to parse.\n\t * @param int   $depth Optional. Number of tree levels deep we currently are.\n\t *                     Used to calculate indentation. Default 0.\n\t * @return array {\n\t *     Array containing JOIN and WHERE SQL clauses to append to a single query array.\n\t *\n\t *     @type string $join  SQL fragment to append to the main JOIN clause.\n\t *     @type string $where SQL fragment to append to the main WHERE clause.\n\t * }\n\t */\n\tprotected function get_sql_for_query( $query, $depth = 0 ) {\n\t\t$sql_chunks = array(\n\t\t\t'join'  => array(),\n\t\t\t'where' => array(),\n\t\t);\n\n\t\t$sql = array(\n\t\t\t'join'  => '',\n\t\t\t'where' => '',\n\t\t);\n\n\t\t$indent = '';\n\t\tfor ( $i = 0; $i < $depth; $i++ ) {\n\t\t\t$indent .= '  ';\n\t\t}\n\n\t\tforeach ( $query as $key => $clause ) {\n\t\t\tif ( 'relation' === $key ) {\n\t\t\t\t$relation = $query['relation'];\n\t\t\t} elseif ( is_array( $clause ) ) {\n\n\t\t\t\t// This is a first-order clause.\n\t\t\t\tif ( $this->is_first_order_clause( $clause ) ) {\n\t\t\t\t\t$clause_sql = $this->get_sql_for_clause( $clause, $query );\n\n\t\t\t\t\t$where_count = count( $clause_sql['where'] );\n\t\t\t\t\tif ( ! $where_count ) {\n\t\t\t\t\t\t$sql_chunks['where'][] = '';\n\t\t\t\t\t} elseif ( 1 === $where_count ) {\n\t\t\t\t\t\t$sql_chunks['where'][] = $clause_sql['where'][0];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )';\n\t\t\t\t\t}\n\n\t\t\t\t\t$sql_chunks['join'] = array_merge( $sql_chunks['join'], $clause_sql['join'] );\n\t\t\t\t\t// This is a subquery, so we recurse.\n\t\t\t\t} else {\n\t\t\t\t\t$clause_sql = $this->get_sql_for_query( $clause, $depth + 1 );\n\n\t\t\t\t\t$sql_chunks['where'][] = $clause_sql['where'];\n\t\t\t\t\t$sql_chunks['join'][]  = $clause_sql['join'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Filter to remove empties.\n\t\t$sql_chunks['join']  = array_filter( $sql_chunks['join'] );\n\t\t$sql_chunks['where'] = array_filter( $sql_chunks['where'] );\n\n\t\tif ( empty( $relation ) ) {\n\t\t\t$relation = 'AND';\n\t\t}\n\n\t\t// Filter duplicate JOIN clauses and combine into a single string.\n\t\tif ( ! empty( $sql_chunks['join'] ) ) {\n\t\t\t$sql['join'] = implode( ' ', array_unique( $sql_chunks['join'] ) );\n\t\t}\n\n\t\t// Generate a single WHERE clause with proper brackets and indentation.\n\t\tif ( ! empty( $sql_chunks['where'] ) ) {\n\t\t\t$sql['where'] = '( ' . \"\\n  \" . $indent . implode( ' ' . \"\\n  \" . $indent . $relation . ' ' . \"\\n  \" . $indent, $sql_chunks['where'] ) . \"\\n\" . $indent . ')';\n\t\t}\n\n\t\treturn $sql;\n\t}\n\n\t/**\n\t * Turns a single date clause into pieces for a WHERE clause.\n\t *\n\t * A wrapper for get_sql_for_clause(), included here for backward\n\t * compatibility while retaining the naming convention across Query classes.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param array $query Date query arguments.\n\t * @return array {\n\t *     Array containing JOIN and WHERE SQL clauses to append to the main query.\n\t *\n\t *     @type string $join  SQL fragment to append to the main JOIN clause.\n\t *     @type string $where SQL fragment to append to the main WHERE clause.\n\t * }\n\t */\n\tprotected function get_sql_for_subquery( $query ) {\n\t\treturn $this->get_sql_for_clause( $query, '' );\n\t}\n\n\t/**\n\t * Turns a first-order date query into SQL for a WHERE clause.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param array $query        Date query clause.\n\t * @param array $parent_query Parent query of the current date query.\n\t * @return array {\n\t *     Array containing JOIN and WHERE SQL clauses to append to the main query.\n\t *\n\t *     @type string $join  SQL fragment to append to the main JOIN clause.\n\t *     @type string $where SQL fragment to append to the main WHERE clause.\n\t * }\n\t */\n\tprotected function get_sql_for_clause( $query, $parent_query ) {\n\t\tglobal $wpdb;\n\n\t\t// The sub-parts of a $where part.\n\t\t$where_parts = array();\n\n\t\t$column = ( ! empty( $query['column'] ) ) ? esc_sql( $query['column'] ) : $this->column;\n\n\t\t$column = $this->validate_column( $column );\n\n\t\t$compare = $this->get_compare( $query );\n\n\t\t$inclusive = ! empty( $query['inclusive'] );\n\n\t\t// Assign greater- and less-than values.\n\t\t$lt = '<';\n\t\t$gt = '>';\n\n\t\tif ( $inclusive ) {\n\t\t\t$lt .= '=';\n\t\t\t$gt .= '=';\n\t\t}\n\n\t\t// Range queries.\n\t\tif ( ! empty( $query['after'] ) ) {\n\t\t\t$where_parts[] = $wpdb->prepare( \"$column $gt %s\", $this->build_mysql_datetime( $query['after'], ! $inclusive ) );\n\t\t}\n\t\tif ( ! empty( $query['before'] ) ) {\n\t\t\t$where_parts[] = $wpdb->prepare( \"$column $lt %s\", $this->build_mysql_datetime( $query['before'], $inclusive ) );\n\t\t}\n\t\t// Specific value queries.\n\n\t\t$date_units = array(\n\t\t\t'YEAR'           => array( 'year' ),\n\t\t\t'MONTH'          => array( 'month', 'monthnum' ),\n\t\t\t'_wp_mysql_week' => array( 'week', 'w' ),\n\t\t\t'DAYOFYEAR'      => array( 'dayofyear' ),\n\t\t\t'DAYOFMONTH'     => array( 'day' ),\n\t\t\t'DAYOFWEEK'      => array( 'dayofweek' ),\n\t\t\t'WEEKDAY'        => array( 'dayofweek_iso' ),\n\t\t);\n\n\t\t// Check of the possible date units and add them to the query.\n\t\tforeach ( $date_units as $sql_part => $query_parts ) {\n\t\t\tforeach ( $query_parts as $query_part ) {\n\t\t\t\tif ( isset( $query[ $query_part ] ) ) {\n\t\t\t\t\t$value = $this->build_value( $compare, $query[ $query_part ] );\n\t\t\t\t\tif ( $value ) {\n\t\t\t\t\t\tswitch ( $sql_part ) {\n\t\t\t\t\t\t\tcase '_wp_mysql_week':\n\t\t\t\t\t\t\t\t$where_parts[] = _wp_mysql_week( $column ) . \" $compare $value\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'WEEKDAY':\n\t\t\t\t\t\t\t\t$where_parts[] = \"$sql_part( $column ) + 1 $compare $value\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$where_parts[] = \"$sql_part( $column ) $compare $value\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $query['hour'] ) || isset( $query['minute'] ) || isset( $query['second'] ) ) {\n\t\t\t// Avoid notices.\n\t\t\tforeach ( array( 'hour', 'minute', 'second' ) as $unit ) {\n\t\t\t\tif ( ! isset( $query[ $unit ] ) ) {\n\t\t\t\t\t$query[ $unit ] = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$time_query = $this->build_time_query( $column, $compare, $query['hour'], $query['minute'], $query['second'] );\n\t\t\tif ( $time_query ) {\n\t\t\t\t$where_parts[] = $time_query;\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Return an array of 'join' and 'where' for compatibility\n\t\t * with other query classes.\n\t\t */\n\t\treturn array(\n\t\t\t'where' => $where_parts,\n\t\t\t'join'  => array(),\n\t\t);\n\t}\n\n\t/**\n\t * Builds and validates a value string based on the comparison operator.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param string       $compare The compare operator to use.\n\t * @param string|array $value   The value.\n\t * @return string|false|int The value to be used in SQL or false on error.\n\t */\n\tpublic function build_value( $compare, $value ) {\n\t\tif ( ! isset( $value ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch ( $compare ) {\n\t\t\tcase 'IN':\n\t\t\tcase 'NOT IN':\n\t\t\t\t$value = (array) $value;\n\n\t\t\t\t// Remove non-numeric values.\n\t\t\t\t$value = array_filter( $value, 'is_numeric' );\n\n\t\t\t\tif ( empty( $value ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn '(' . implode( ',', array_map( 'intval', $value ) ) . ')';\n\n\t\t\tcase 'BETWEEN':\n\t\t\tcase 'NOT BETWEEN':\n\t\t\t\tif ( ! is_array( $value ) || 2 !== count( $value ) ) {\n\t\t\t\t\t$value = array( $value, $value );\n\t\t\t\t} else {\n\t\t\t\t\t$value = array_values( $value );\n\t\t\t\t}\n\n\t\t\t\t// If either value is non-numeric, bail.\n\t\t\t\tforeach ( $value as $v ) {\n\t\t\t\t\tif ( ! is_numeric( $v ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$value = array_map( 'intval', $value );\n\n\t\t\t\treturn $value[0] . ' AND ' . $value[1];\n\n\t\t\tdefault:\n\t\t\t\tif ( ! is_numeric( $value ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn (int) $value;\n\t\t}\n\t}\n\n\t/**\n\t * Builds a MySQL format date/time based on some query parameters.\n\t *\n\t * You can pass an array of values (year, month, etc.) with missing parameter values being defaulted to\n\t * either the maximum or minimum values (controlled by the $default_to parameter). Alternatively you can\n\t * pass a string that will be passed to date_create().\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param string|array $datetime       An array of parameters or a strotime() string\n\t * @param bool         $default_to_max Whether to round up incomplete dates. Supported by values\n\t *                                     of $datetime that are arrays, or string values that are a\n\t *                                     subset of MySQL date format ('Y', 'Y-m', 'Y-m-d', 'Y-m-d H:i').\n\t *                                     Default: false.\n\t * @return string|false A MySQL format date/time or false on failure\n\t */\n\tpublic function build_mysql_datetime( $datetime, $default_to_max = false ) {\n\t\tif ( ! is_array( $datetime ) ) {\n\n\t\t\t/*\n\t\t\t * Try to parse some common date formats, so we can detect\n\t\t\t * the level of precision and support the 'inclusive' parameter.\n\t\t\t */\n\t\t\tif ( preg_match( '/^(\\d{4})$/', $datetime, $matches ) ) {\n\t\t\t\t// Y\n\t\t\t\t$datetime = array(\n\t\t\t\t\t'year' => intval( $matches[1] ),\n\t\t\t\t);\n\n\t\t\t} elseif ( preg_match( '/^(\\d{4})\\-(\\d{2})$/', $datetime, $matches ) ) {\n\t\t\t\t// Y-m\n\t\t\t\t$datetime = array(\n\t\t\t\t\t'year'  => intval( $matches[1] ),\n\t\t\t\t\t'month' => intval( $matches[2] ),\n\t\t\t\t);\n\n\t\t\t} elseif ( preg_match( '/^(\\d{4})\\-(\\d{2})\\-(\\d{2})$/', $datetime, $matches ) ) {\n\t\t\t\t// Y-m-d\n\t\t\t\t$datetime = array(\n\t\t\t\t\t'year'  => intval( $matches[1] ),\n\t\t\t\t\t'month' => intval( $matches[2] ),\n\t\t\t\t\t'day'   => intval( $matches[3] ),\n\t\t\t\t);\n\n\t\t\t} elseif ( preg_match( '/^(\\d{4})\\-(\\d{2})\\-(\\d{2}) (\\d{2}):(\\d{2})$/', $datetime, $matches ) ) {\n\t\t\t\t// Y-m-d H:i\n\t\t\t\t$datetime = array(\n\t\t\t\t\t'year'   => intval( $matches[1] ),\n\t\t\t\t\t'month'  => intval( $matches[2] ),\n\t\t\t\t\t'day'    => intval( $matches[3] ),\n\t\t\t\t\t'hour'   => intval( $matches[4] ),\n\t\t\t\t\t'minute' => intval( $matches[5] ),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// If no match is found, we don't support default_to_max.\n\t\t\tif ( ! is_array( $datetime ) ) {\n\t\t\t\t$wp_timezone = wp_timezone();\n\n\t\t\t\t// Assume local timezone if not provided.\n\t\t\t\t$dt = date_create( $datetime, $wp_timezone );\n\n\t\t\t\tif ( false === $dt ) {\n\t\t\t\t\treturn gmdate( 'Y-m-d H:i:s', false );\n\t\t\t\t}\n\n\t\t\t\treturn $dt->setTimezone( $wp_timezone )->format( 'Y-m-d H:i:s' );\n\t\t\t}\n\t\t}\n\n\t\t$datetime = array_map( 'absint', $datetime );\n\n\t\tif ( ! isset( $datetime['year'] ) ) {\n\t\t\t$datetime['year'] = current_time( 'Y' );\n\t\t}\n\n\t\tif ( ! isset( $datetime['month'] ) ) {\n\t\t\t$datetime['month'] = ( $default_to_max ) ? 12 : 1;\n\t\t}\n\n\t\tif ( ! isset( $datetime['day'] ) ) {\n\t\t\t$datetime['day'] = ( $default_to_max ) ? (int) gmdate( 't', mktime( 0, 0, 0, $datetime['month'], 1, $datetime['year'] ) ) : 1;\n\t\t}\n\n\t\tif ( ! isset( $datetime['hour'] ) ) {\n\t\t\t$datetime['hour'] = ( $default_to_max ) ? 23 : 0;\n\t\t}\n\n\t\tif ( ! isset( $datetime['minute'] ) ) {\n\t\t\t$datetime['minute'] = ( $default_to_max ) ? 59 : 0;\n\t\t}\n\n\t\tif ( ! isset( $datetime['second'] ) ) {\n\t\t\t$datetime['second'] = ( $default_to_max ) ? 59 : 0;\n\t\t}\n\n\t\treturn sprintf( '%04d-%02d-%02d %02d:%02d:%02d', $datetime['year'], $datetime['month'], $datetime['day'], $datetime['hour'], $datetime['minute'], $datetime['second'] );\n\t}\n\n\t/**\n\t * Builds a query string for comparing time values (hour, minute, second).\n\t *\n\t * If just hour, minute, or second is set than a normal comparison will be done.\n\t * However if multiple values are passed, a pseudo-decimal time will be created\n\t * in order to be able to accurately compare against.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param string   $column  The column to query against. Needs to be pre-validated!\n\t * @param string   $compare The comparison operator. Needs to be pre-validated!\n\t * @param int|null $hour    Optional. An hour value (0-23).\n\t * @param int|null $minute  Optional. A minute value (0-59).\n\t * @param int|null $second  Optional. A second value (0-59).\n\t * @return string|false A query part or false on failure.\n\t */\n\tpublic function build_time_query( $column, $compare, $hour = null, $minute = null, $second = null ) {\n\t\tglobal $wpdb;\n\n\t\t// Have to have at least one.\n\t\tif ( ! isset( $hour ) && ! isset( $minute ) && ! isset( $second ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Complex combined queries aren't supported for multi-value queries.\n\t\tif ( in_array( $compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ), true ) ) {\n\t\t\t$return = array();\n\n\t\t\t$value = $this->build_value( $compare, $hour );\n\t\t\tif ( false !== $value ) {\n\t\t\t\t$return[] = \"HOUR( $column ) $compare $value\";\n\t\t\t}\n\n\t\t\t$value = $this->build_value( $compare, $minute );\n\t\t\tif ( false !== $value ) {\n\t\t\t\t$return[] = \"MINUTE( $column ) $compare $value\";\n\t\t\t}\n\n\t\t\t$value = $this->build_value( $compare, $second );\n\t\t\tif ( false !== $value ) {\n\t\t\t\t$return[] = \"SECOND( $column ) $compare $value\";\n\t\t\t}\n\n\t\t\treturn implode( ' AND ', $return );\n\t\t}\n\n\t\t// Cases where just one unit is set.\n\t\tif ( isset( $hour ) && ! isset( $minute ) && ! isset( $second ) ) {\n\t\t\t$value = $this->build_value( $compare, $hour );\n\t\t\tif ( false !== $value ) {\n\t\t\t\treturn \"HOUR( $column ) $compare $value\";\n\t\t\t}\n\t\t} elseif ( ! isset( $hour ) && isset( $minute ) && ! isset( $second ) ) {\n\t\t\t$value = $this->build_value( $compare, $minute );\n\t\t\tif ( false !== $value ) {\n\t\t\t\treturn \"MINUTE( $column ) $compare $value\";\n\t\t\t}\n\t\t} elseif ( ! isset( $hour ) && ! isset( $minute ) && isset( $second ) ) {\n\t\t\t$value = $this->build_value( $compare, $second );\n\t\t\tif ( false !== $value ) {\n\t\t\t\treturn \"SECOND( $column ) $compare $value\";\n\t\t\t}\n\t\t}\n\n\t\t// Single units were already handled. Since hour & second isn't allowed, minute must to be set.\n\t\tif ( ! isset( $minute ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$format = '';\n\t\t$time   = '';\n\n\t\t// Hour.\n\t\tif ( null !== $hour ) {\n\t\t\t$format .= '%H.';\n\t\t\t$time   .= sprintf( '%02d', $hour ) . '.';\n\t\t} else {\n\t\t\t$format .= '0.';\n\t\t\t$time   .= '0.';\n\t\t}\n\n\t\t// Minute.\n\t\t$format .= '%i';\n\t\t$time   .= sprintf( '%02d', $minute );\n\n\t\tif ( isset( $second ) ) {\n\t\t\t$format .= '%s';\n\t\t\t$time   .= sprintf( '%02d', $second );\n\t\t}\n\n\t\treturn $wpdb->prepare( \"DATE_FORMAT( $column, %s ) $compare %f\", $format, $time );\n\t}\n}\n", "num_lines": 1043}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Dependencies API: _WP_Dependency class\n *\n * @since 4.7.0\n *\n * @package WordPress\n * @subpackage Dependencies\n */\n\n/**\n * Class _WP_Dependency\n *\n * Helper class to register a handle and associated data.\n *\n * @access private\n * @since 2.6.0\n */\nclass _WP_Dependency {\n\t/**\n\t * The handle name.\n\t *\n\t * @since 2.6.0\n\t * @var string\n\t */\n\tpublic $handle;\n\n\t/**\n\t * The handle source.\n\t *\n\t * @since 2.6.0\n\t * @var string\n\t */\n\tpublic $src;\n\n\t/**\n\t * An array of handle dependencies.\n\t *\n\t * @since 2.6.0\n\t * @var string[]\n\t */\n\tpublic $deps = array();\n\n\t/**\n\t * The handle version.\n\t *\n\t * Used for cache-busting.\n\t *\n\t * @since 2.6.0\n\t * @var bool|string\n\t */\n\tpublic $ver = false;\n\n\t/**\n\t * Additional arguments for the handle.\n\t *\n\t * @since 2.6.0\n\t * @var array\n\t */\n\tpublic $args = null;  // Custom property, such as $in_footer or $media.\n\n\t/**\n\t * Extra data to supply to the handle.\n\t *\n\t * @since 2.6.0\n\t * @var array\n\t */\n\tpublic $extra = array();\n\n\t/**\n\t * Translation textdomain set for this dependency.\n\t *\n\t * @since 5.0.0\n\t * @var string\n\t */\n\tpublic $textdomain;\n\n\t/**\n\t * Translation path set for this dependency.\n\t *\n\t * @since 5.0.0\n\t * @var string\n\t */\n\tpublic $translations_path;\n\n\t/**\n\t * Setup dependencies.\n\t *\n\t * @since 2.6.0\n\t * @since 5.3.0 Formalized the existing `...$args` parameter by adding it\n\t *              to the function signature.\n\t *\n\t * @param mixed ...$args Dependency information.\n\t */\n\tpublic function __construct( ...$args ) {\n\t\tlist( $this->handle, $this->src, $this->deps, $this->ver, $this->args ) = $args;\n\t\tif ( ! is_array( $this->deps ) ) {\n\t\t\t$this->deps = array();\n\t\t}\n\t}\n\n\t/**\n\t * Add handle data.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param string $name The data key to add.\n\t * @param mixed  $data The data value to add.\n\t * @return bool False if not scalar, true otherwise.\n\t */\n\tpublic function add_data( $name, $data ) {\n\t\tif ( ! is_scalar( $name ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t$this->extra[ $name ] = $data;\n\t\treturn true;\n\t}\n\n\t/**\n\t * Sets the translation domain for this dependency.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param string $domain The translation textdomain.\n\t * @param string $path   Optional. The full file path to the directory containing translation files.\n\t * @return bool False if $domain is not a string, true otherwise.\n\t */\n\tpublic function set_translations( $domain, $path = null ) {\n\t\tif ( ! is_string( $domain ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t$this->textdomain        = $domain;\n\t\t$this->translations_path = $path;\n\t\treturn true;\n\t}\n}\n", "num_lines": 137}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Facilitates adding of the WordPress editor as used on the Write and Edit screens.\n *\n * @package WordPress\n * @since 3.3.0\n *\n * Private, not included by default. See wp_editor() in wp-includes/general-template.php.\n */\n\nfinal class _WP_Editors {\n\tpublic static $mce_locale;\n\n\tprivate static $mce_settings = array();\n\tprivate static $qt_settings  = array();\n\tprivate static $plugins      = array();\n\tprivate static $qt_buttons   = array();\n\tprivate static $ext_plugins;\n\tprivate static $baseurl;\n\tprivate static $first_init;\n\tprivate static $this_tinymce       = false;\n\tprivate static $this_quicktags     = false;\n\tprivate static $has_tinymce        = false;\n\tprivate static $has_quicktags      = false;\n\tprivate static $has_medialib       = false;\n\tprivate static $editor_buttons_css = true;\n\tprivate static $drag_drop_upload   = false;\n\tprivate static $translation;\n\tprivate static $tinymce_scripts_printed = false;\n\tprivate static $link_dialog_printed     = false;\n\n\tprivate function __construct() {}\n\n\t/**\n\t * Parse default arguments for the editor instance.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $editor_id HTML ID for the textarea and TinyMCE and Quicktags instances.\n\t *                          Should not contain square brackets.\n\t * @param array  $settings {\n\t *     Array of editor arguments.\n\t *\n\t *     @type bool       $wpautop           Whether to use wpautop(). Default true.\n\t *     @type bool       $media_buttons     Whether to show the Add Media/other media buttons.\n\t *     @type string     $default_editor    When both TinyMCE and Quicktags are used, set which\n\t *                                         editor is shown on page load. Default empty.\n\t *     @type bool       $drag_drop_upload  Whether to enable drag & drop on the editor uploading. Default false.\n\t *                                         Requires the media modal.\n\t *     @type string     $textarea_name     Give the textarea a unique name here. Square brackets\n\t *                                         can be used here. Default $editor_id.\n\t *     @type int        $textarea_rows     Number rows in the editor textarea. Default 20.\n\t *     @type string|int $tabindex          Tabindex value to use. Default empty.\n\t *     @type string     $tabfocus_elements The previous and next element ID to move the focus to\n\t *                                         when pressing the Tab key in TinyMCE. Default ':prev,:next'.\n\t *     @type string     $editor_css        Intended for extra styles for both Visual and Text editors.\n\t *                                         Should include `<style>` tags, and can use \"scoped\". Default empty.\n\t *     @type string     $editor_class      Extra classes to add to the editor textarea element. Default empty.\n\t *     @type bool       $teeny             Whether to output the minimal editor config. Examples include\n\t *                                         Press This and the Comment editor. Default false.\n\t *     @type bool       $dfw               Deprecated in 4.1. Unused.\n\t *     @type bool|array $tinymce           Whether to load TinyMCE. Can be used to pass settings directly to\n\t *                                         TinyMCE using an array. Default true.\n\t *     @type bool|array $quicktags         Whether to load Quicktags. Can be used to pass settings directly to\n\t *                                         Quicktags using an array. Default true.\n\t * }\n\t * @return array Parsed arguments array.\n\t */\n\tpublic static function parse_settings( $editor_id, $settings ) {\n\n\t\t/**\n\t\t * Filters the wp_editor() settings.\n\t\t *\n\t\t * @since 4.0.0\n\t\t *\n\t\t * @see _WP_Editors::parse_settings()\n\t\t *\n\t\t * @param array  $settings  Array of editor arguments.\n\t\t * @param string $editor_id Unique editor identifier, e.g. 'content'. Accepts 'classic-block'\n\t\t *                          when called from block editor's Classic block.\n\t\t */\n\t\t$settings = apply_filters( 'wp_editor_settings', $settings, $editor_id );\n\n\t\t$set = wp_parse_args(\n\t\t\t$settings,\n\t\t\tarray(\n\t\t\t\t// Disable autop if the current post has blocks in it.\n\t\t\t\t'wpautop'             => ! has_blocks(),\n\t\t\t\t'media_buttons'       => true,\n\t\t\t\t'default_editor'      => '',\n\t\t\t\t'drag_drop_upload'    => false,\n\t\t\t\t'textarea_name'       => $editor_id,\n\t\t\t\t'textarea_rows'       => 20,\n\t\t\t\t'tabindex'            => '',\n\t\t\t\t'tabfocus_elements'   => ':prev,:next',\n\t\t\t\t'editor_css'          => '',\n\t\t\t\t'editor_class'        => '',\n\t\t\t\t'teeny'               => false,\n\t\t\t\t'_content_editor_dfw' => false,\n\t\t\t\t'tinymce'             => true,\n\t\t\t\t'quicktags'           => true,\n\t\t\t)\n\t\t);\n\n\t\tself::$this_tinymce = ( $set['tinymce'] && user_can_richedit() );\n\n\t\tif ( self::$this_tinymce ) {\n\t\t\tif ( false !== strpos( $editor_id, '[' ) ) {\n\t\t\t\tself::$this_tinymce = false;\n\t\t\t\t_deprecated_argument( 'wp_editor()', '3.9.0', 'TinyMCE editor IDs cannot have brackets.' );\n\t\t\t}\n\t\t}\n\n\t\tself::$this_quicktags = (bool) $set['quicktags'];\n\n\t\tif ( self::$this_tinymce ) {\n\t\t\tself::$has_tinymce = true;\n\t\t}\n\n\t\tif ( self::$this_quicktags ) {\n\t\t\tself::$has_quicktags = true;\n\t\t}\n\n\t\tif ( empty( $set['editor_height'] ) ) {\n\t\t\treturn $set;\n\t\t}\n\n\t\tif ( 'content' === $editor_id && empty( $set['tinymce']['wp_autoresize_on'] ) ) {\n\t\t\t// A cookie (set when a user resizes the editor) overrides the height.\n\t\t\t$cookie = (int) get_user_setting( 'ed_size' );\n\n\t\t\tif ( $cookie ) {\n\t\t\t\t$set['editor_height'] = $cookie;\n\t\t\t}\n\t\t}\n\n\t\tif ( $set['editor_height'] < 50 ) {\n\t\t\t$set['editor_height'] = 50;\n\t\t} elseif ( $set['editor_height'] > 5000 ) {\n\t\t\t$set['editor_height'] = 5000;\n\t\t}\n\n\t\treturn $set;\n\t}\n\n\t/**\n\t * Outputs the HTML for a single instance of the editor.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $content   Initial content for the editor.\n\t * @param string $editor_id HTML ID for the textarea and TinyMCE and Quicktags instances.\n\t *                          Should not contain square brackets.\n\t * @param array  $settings  See _WP_Editors::parse_settings() for description.\n\t */\n\tpublic static function editor( $content, $editor_id, $settings = array() ) {\n\t\t$set            = self::parse_settings( $editor_id, $settings );\n\t\t$editor_class   = ' class=\"' . trim( esc_attr( $set['editor_class'] ) . ' wp-editor-area' ) . '\"';\n\t\t$tabindex       = $set['tabindex'] ? ' tabindex=\"' . (int) $set['tabindex'] . '\"' : '';\n\t\t$default_editor = 'html';\n\t\t$buttons        = '';\n\t\t$autocomplete   = '';\n\t\t$editor_id_attr = esc_attr( $editor_id );\n\n\t\tif ( $set['drag_drop_upload'] ) {\n\t\t\tself::$drag_drop_upload = true;\n\t\t}\n\n\t\tif ( ! empty( $set['editor_height'] ) ) {\n\t\t\t$height = ' style=\"height: ' . (int) $set['editor_height'] . 'px\"';\n\t\t} else {\n\t\t\t$height = ' rows=\"' . (int) $set['textarea_rows'] . '\"';\n\t\t}\n\n\t\tif ( ! current_user_can( 'upload_files' ) ) {\n\t\t\t$set['media_buttons'] = false;\n\t\t}\n\n\t\tif ( self::$this_tinymce ) {\n\t\t\t$autocomplete = ' autocomplete=\"off\"';\n\n\t\t\tif ( self::$this_quicktags ) {\n\t\t\t\t$default_editor = $set['default_editor'] ? $set['default_editor'] : wp_default_editor();\n\t\t\t\t// 'html' is used for the \"Text\" editor tab.\n\t\t\t\tif ( 'html' !== $default_editor ) {\n\t\t\t\t\t$default_editor = 'tinymce';\n\t\t\t\t}\n\n\t\t\t\t$buttons .= '<button type=\"button\" id=\"' . $editor_id_attr . '-tmce\" class=\"wp-switch-editor switch-tmce\"' .\n\t\t\t\t\t' data-wp-editor-id=\"' . $editor_id_attr . '\">' . _x( 'Visual', 'Name for the Visual editor tab' ) . \"</button>\\n\";\n\t\t\t\t$buttons .= '<button type=\"button\" id=\"' . $editor_id_attr . '-html\" class=\"wp-switch-editor switch-html\"' .\n\t\t\t\t\t' data-wp-editor-id=\"' . $editor_id_attr . '\">' . _x( 'Text', 'Name for the Text editor tab (formerly HTML)' ) . \"</button>\\n\";\n\t\t\t} else {\n\t\t\t\t$default_editor = 'tinymce';\n\t\t\t}\n\t\t}\n\n\t\t$switch_class = 'html' === $default_editor ? 'html-active' : 'tmce-active';\n\t\t$wrap_class   = 'wp-core-ui wp-editor-wrap ' . $switch_class;\n\n\t\tif ( $set['_content_editor_dfw'] ) {\n\t\t\t$wrap_class .= ' has-dfw';\n\t\t}\n\n\t\techo '<div id=\"wp-' . $editor_id_attr . '-wrap\" class=\"' . $wrap_class . '\">';\n\n\t\tif ( self::$editor_buttons_css ) {\n\t\t\twp_print_styles( 'editor-buttons' );\n\t\t\tself::$editor_buttons_css = false;\n\t\t}\n\n\t\tif ( ! empty( $set['editor_css'] ) ) {\n\t\t\techo $set['editor_css'] . \"\\n\";\n\t\t}\n\n\t\tif ( ! empty( $buttons ) || $set['media_buttons'] ) {\n\t\t\techo '<div id=\"wp-' . $editor_id_attr . '-editor-tools\" class=\"wp-editor-tools hide-if-no-js\">';\n\n\t\t\tif ( $set['media_buttons'] ) {\n\t\t\t\tself::$has_medialib = true;\n\n\t\t\t\tif ( ! function_exists( 'media_buttons' ) ) {\n\t\t\t\t\trequire ABSPATH . 'wp-admin/includes/media.php';\n\t\t\t\t}\n\n\t\t\t\techo '<div id=\"wp-' . $editor_id_attr . '-media-buttons\" class=\"wp-media-buttons\">';\n\n\t\t\t\t/**\n\t\t\t\t * Fires after the default media button(s) are displayed.\n\t\t\t\t *\n\t\t\t\t * @since 2.5.0\n\t\t\t\t *\n\t\t\t\t * @param string $editor_id Unique editor identifier, e.g. 'content'.\n\t\t\t\t */\n\t\t\t\tdo_action( 'media_buttons', $editor_id );\n\t\t\t\techo \"</div>\\n\";\n\t\t\t}\n\n\t\t\techo '<div class=\"wp-editor-tabs\">' . $buttons . \"</div>\\n\";\n\t\t\techo \"</div>\\n\";\n\t\t}\n\n\t\t$quicktags_toolbar = '';\n\n\t\tif ( self::$this_quicktags ) {\n\t\t\tif ( 'content' === $editor_id && ! empty( $GLOBALS['current_screen'] ) && 'post' === $GLOBALS['current_screen']->base ) {\n\t\t\t\t$toolbar_id = 'ed_toolbar';\n\t\t\t} else {\n\t\t\t\t$toolbar_id = 'qt_' . $editor_id_attr . '_toolbar';\n\t\t\t}\n\n\t\t\t$quicktags_toolbar = '<div id=\"' . $toolbar_id . '\" class=\"quicktags-toolbar\"></div>';\n\t\t}\n\n\t\t/**\n\t\t * Filters the HTML markup output that displays the editor.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param string $output Editor's HTML markup.\n\t\t */\n\t\t$the_editor = apply_filters(\n\t\t\t'the_editor',\n\t\t\t'<div id=\"wp-' . $editor_id_attr . '-editor-container\" class=\"wp-editor-container\">' .\n\t\t\t$quicktags_toolbar .\n\t\t\t'<textarea' . $editor_class . $height . $tabindex . $autocomplete . ' cols=\"40\" name=\"' . esc_attr( $set['textarea_name'] ) . '\" ' .\n\t\t\t'id=\"' . $editor_id_attr . '\">%s</textarea></div>'\n\t\t);\n\n\t\t// Prepare the content for the Visual or Text editor, only when TinyMCE is used (back-compat).\n\t\tif ( self::$this_tinymce ) {\n\t\t\tadd_filter( 'the_editor_content', 'format_for_editor', 10, 2 );\n\t\t}\n\n\t\t/**\n\t\t * Filters the default editor content.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param string $content        Default editor content.\n\t\t * @param string $default_editor The default editor for the current user.\n\t\t *                               Either 'html' or 'tinymce'.\n\t\t */\n\t\t$content = apply_filters( 'the_editor_content', $content, $default_editor );\n\n\t\t// Remove the filter as the next editor on the same page may not need it.\n\t\tif ( self::$this_tinymce ) {\n\t\t\tremove_filter( 'the_editor_content', 'format_for_editor' );\n\t\t}\n\n\t\t// Back-compat for the `htmledit_pre` and `richedit_pre` filters.\n\t\tif ( 'html' === $default_editor && has_filter( 'htmledit_pre' ) ) {\n\t\t\t/** This filter is documented in wp-includes/deprecated.php */\n\t\t\t$content = apply_filters_deprecated( 'htmledit_pre', array( $content ), '4.3.0', 'format_for_editor' );\n\t\t} elseif ( 'tinymce' === $default_editor && has_filter( 'richedit_pre' ) ) {\n\t\t\t/** This filter is documented in wp-includes/deprecated.php */\n\t\t\t$content = apply_filters_deprecated( 'richedit_pre', array( $content ), '4.3.0', 'format_for_editor' );\n\t\t}\n\n\t\tif ( false !== stripos( $content, 'textarea' ) ) {\n\t\t\t$content = preg_replace( '%</textarea%i', '&lt;/textarea', $content );\n\t\t}\n\n\t\tprintf( $the_editor, $content );\n\t\techo \"\\n</div>\\n\\n\";\n\n\t\tself::editor_settings( $editor_id, $set );\n\t}\n\n\t/**\n\t * @since 3.3.0\n\t *\n\t * @param string $editor_id Unique editor identifier, e.g. 'content'.\n\t * @param array  $set       Array of editor arguments.\n\t */\n\tpublic static function editor_settings( $editor_id, $set ) {\n\t\tif ( empty( self::$first_init ) ) {\n\t\t\tif ( is_admin() ) {\n\t\t\t\tadd_action( 'admin_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 );\n\t\t\t\tadd_action( 'admin_print_footer_scripts', array( __CLASS__, 'force_uncompressed_tinymce' ), 1 );\n\t\t\t\tadd_action( 'admin_print_footer_scripts', array( __CLASS__, 'enqueue_scripts' ), 1 );\n\t\t\t} else {\n\t\t\t\tadd_action( 'wp_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 );\n\t\t\t\tadd_action( 'wp_print_footer_scripts', array( __CLASS__, 'force_uncompressed_tinymce' ), 1 );\n\t\t\t\tadd_action( 'wp_print_footer_scripts', array( __CLASS__, 'enqueue_scripts' ), 1 );\n\t\t\t}\n\t\t}\n\n\t\tif ( self::$this_quicktags ) {\n\n\t\t\t$qtInit = array(\n\t\t\t\t'id'      => $editor_id,\n\t\t\t\t'buttons' => '',\n\t\t\t);\n\n\t\t\tif ( is_array( $set['quicktags'] ) ) {\n\t\t\t\t$qtInit = array_merge( $qtInit, $set['quicktags'] );\n\t\t\t}\n\n\t\t\tif ( empty( $qtInit['buttons'] ) ) {\n\t\t\t\t$qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close';\n\t\t\t}\n\n\t\t\tif ( $set['_content_editor_dfw'] ) {\n\t\t\t\t$qtInit['buttons'] .= ',dfw';\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the Quicktags settings.\n\t\t\t *\n\t\t\t * @since 3.3.0\n\t\t\t *\n\t\t\t * @param array  $qtInit    Quicktags settings.\n\t\t\t * @param string $editor_id Unique editor identifier, e.g. 'content'.\n\t\t\t */\n\t\t\t$qtInit = apply_filters( 'quicktags_settings', $qtInit, $editor_id );\n\n\t\t\tself::$qt_settings[ $editor_id ] = $qtInit;\n\n\t\t\tself::$qt_buttons = array_merge( self::$qt_buttons, explode( ',', $qtInit['buttons'] ) );\n\t\t}\n\n\t\tif ( self::$this_tinymce ) {\n\n\t\t\tif ( empty( self::$first_init ) ) {\n\t\t\t\t$baseurl     = self::get_baseurl();\n\t\t\t\t$mce_locale  = self::get_mce_locale();\n\t\t\t\t$ext_plugins = '';\n\n\t\t\t\tif ( $set['teeny'] ) {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters the list of teenyMCE plugins.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 2.7.0\n\t\t\t\t\t * @since 3.3.0 The `$editor_id` parameter was added.\n\t\t\t\t\t *\n\t\t\t\t\t * @param array  $plugins   An array of teenyMCE plugins.\n\t\t\t\t\t * @param string $editor_id Unique editor identifier, e.g. 'content'.\n\t\t\t\t\t */\n\t\t\t\t\t$plugins = apply_filters(\n\t\t\t\t\t\t'teeny_mce_plugins',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'colorpicker',\n\t\t\t\t\t\t\t'lists',\n\t\t\t\t\t\t\t'fullscreen',\n\t\t\t\t\t\t\t'image',\n\t\t\t\t\t\t\t'wordpress',\n\t\t\t\t\t\t\t'wpeditimage',\n\t\t\t\t\t\t\t'wplink',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t$editor_id\n\t\t\t\t\t);\n\t\t\t\t} else {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters the list of TinyMCE external plugins.\n\t\t\t\t\t *\n\t\t\t\t\t * The filter takes an associative array of external plugins for\n\t\t\t\t\t * TinyMCE in the form 'plugin_name' => 'url'.\n\t\t\t\t\t *\n\t\t\t\t\t * The url should be absolute, and should include the js filename\n\t\t\t\t\t * to be loaded. For example:\n\t\t\t\t\t * 'myplugin' => 'http://mysite.com/wp-content/plugins/myfolder/mce_plugin.js'.\n\t\t\t\t\t *\n\t\t\t\t\t * If the external plugin adds a button, it should be added with\n\t\t\t\t\t * one of the 'mce_buttons' filters.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 2.5.0\n\t\t\t\t\t * @since 5.3.0 The `$editor_id` parameter was added.\n\t\t\t\t\t *\n\t\t\t\t\t * @param array  $external_plugins An array of external TinyMCE plugins.\n\t\t\t\t\t * @param string $editor_id        Unique editor identifier, e.g. 'content'. Accepts 'classic-block'\n\t\t\t\t\t *                                 when called from block editor's Classic block.\n\t\t\t\t\t */\n\t\t\t\t\t$mce_external_plugins = apply_filters( 'mce_external_plugins', array(), $editor_id );\n\n\t\t\t\t\t$plugins = array(\n\t\t\t\t\t\t'charmap',\n\t\t\t\t\t\t'colorpicker',\n\t\t\t\t\t\t'hr',\n\t\t\t\t\t\t'lists',\n\t\t\t\t\t\t'media',\n\t\t\t\t\t\t'paste',\n\t\t\t\t\t\t'tabfocus',\n\t\t\t\t\t\t'textcolor',\n\t\t\t\t\t\t'fullscreen',\n\t\t\t\t\t\t'wordpress',\n\t\t\t\t\t\t'wpautoresize',\n\t\t\t\t\t\t'wpeditimage',\n\t\t\t\t\t\t'wpemoji',\n\t\t\t\t\t\t'wpgallery',\n\t\t\t\t\t\t'wplink',\n\t\t\t\t\t\t'wpdialogs',\n\t\t\t\t\t\t'wptextpattern',\n\t\t\t\t\t\t'wpview',\n\t\t\t\t\t);\n\n\t\t\t\t\tif ( ! self::$has_medialib ) {\n\t\t\t\t\t\t$plugins[] = 'image';\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters the list of default TinyMCE plugins.\n\t\t\t\t\t *\n\t\t\t\t\t * The filter specifies which of the default plugins included\n\t\t\t\t\t * in WordPress should be added to the TinyMCE instance.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 3.3.0\n\t\t\t\t\t * @since 5.3.0 The `$editor_id` parameter was added.\n\t\t\t\t\t *\n\t\t\t\t\t * @param array  $plugins   An array of default TinyMCE plugins.\n\t\t\t\t\t * @param string $editor_id Unique editor identifier, e.g. 'content'. Accepts 'classic-block'\n\t\t\t\t\t *                          when called from block editor's Classic block.\n\t\t\t\t\t */\n\t\t\t\t\t$plugins = array_unique( apply_filters( 'tiny_mce_plugins', $plugins, $editor_id ) );\n\n\t\t\t\t\t$key = array_search( 'spellchecker', $plugins, true );\n\t\t\t\t\tif ( false !== $key ) {\n\t\t\t\t\t\t// Remove 'spellchecker' from the internal plugins if added with 'tiny_mce_plugins' filter to prevent errors.\n\t\t\t\t\t\t// It can be added with 'mce_external_plugins'.\n\t\t\t\t\t\tunset( $plugins[ $key ] );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $mce_external_plugins ) ) {\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Filters the translations loaded for external TinyMCE 3.x plugins.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * The filter takes an associative array ('plugin_name' => 'path')\n\t\t\t\t\t\t * where 'path' is the include path to the file.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * The language file should follow the same format as wp_mce_translation(),\n\t\t\t\t\t\t * and should define a variable ($strings) that holds all translated strings.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @since 2.5.0\n\t\t\t\t\t\t * @since 5.3.0 The `$editor_id` parameter was added.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @param array  $translations Translations for external TinyMCE plugins.\n\t\t\t\t\t\t * @param string $editor_id    Unique editor identifier, e.g. 'content'.\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$mce_external_languages = apply_filters( 'mce_external_languages', array(), $editor_id );\n\n\t\t\t\t\t\t$loaded_langs = array();\n\t\t\t\t\t\t$strings      = '';\n\n\t\t\t\t\t\tif ( ! empty( $mce_external_languages ) ) {\n\t\t\t\t\t\t\tforeach ( $mce_external_languages as $name => $path ) {\n\t\t\t\t\t\t\t\tif ( @is_file( $path ) && @is_readable( $path ) ) {\n\t\t\t\t\t\t\t\t\tinclude_once $path;\n\t\t\t\t\t\t\t\t\t$ext_plugins   .= $strings . \"\\n\";\n\t\t\t\t\t\t\t\t\t$loaded_langs[] = $name;\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\n\t\t\t\t\t\tforeach ( $mce_external_plugins as $name => $url ) {\n\t\t\t\t\t\t\tif ( in_array( $name, $plugins, true ) ) {\n\t\t\t\t\t\t\t\tunset( $mce_external_plugins[ $name ] );\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$url                           = set_url_scheme( $url );\n\t\t\t\t\t\t\t$mce_external_plugins[ $name ] = $url;\n\t\t\t\t\t\t\t$plugurl                       = dirname( $url );\n\t\t\t\t\t\t\t$strings                       = '';\n\n\t\t\t\t\t\t\t// Try to load langs/[locale].js and langs/[locale]_dlg.js.\n\t\t\t\t\t\t\tif ( ! in_array( $name, $loaded_langs, true ) ) {\n\t\t\t\t\t\t\t\t$path = str_replace( content_url(), '', $plugurl );\n\t\t\t\t\t\t\t\t$path = WP_CONTENT_DIR . $path . '/langs/';\n\n\t\t\t\t\t\t\t\t$path = trailingslashit( realpath( $path ) );\n\n\t\t\t\t\t\t\t\tif ( @is_file( $path . $mce_locale . '.js' ) ) {\n\t\t\t\t\t\t\t\t\t$strings .= @file_get_contents( $path . $mce_locale . '.js' ) . \"\\n\";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( @is_file( $path . $mce_locale . '_dlg.js' ) ) {\n\t\t\t\t\t\t\t\t\t$strings .= @file_get_contents( $path . $mce_locale . '_dlg.js' ) . \"\\n\";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( 'en' !== $mce_locale && empty( $strings ) ) {\n\t\t\t\t\t\t\t\t\tif ( @is_file( $path . 'en.js' ) ) {\n\t\t\t\t\t\t\t\t\t\t$str1     = @file_get_contents( $path . 'en.js' );\n\t\t\t\t\t\t\t\t\t\t$strings .= preg_replace( '/([\\'\"])en\\./', '$1' . $mce_locale . '.', $str1, 1 ) . \"\\n\";\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif ( @is_file( $path . 'en_dlg.js' ) ) {\n\t\t\t\t\t\t\t\t\t\t$str2     = @file_get_contents( $path . 'en_dlg.js' );\n\t\t\t\t\t\t\t\t\t\t$strings .= preg_replace( '/([\\'\"])en\\./', '$1' . $mce_locale . '.', $str2, 1 ) . \"\\n\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( ! empty( $strings ) ) {\n\t\t\t\t\t\t\t\t\t$ext_plugins .= \"\\n\" . $strings . \"\\n\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$ext_plugins .= 'tinyMCEPreInit.load_ext(\"' . $plugurl . '\", \"' . $mce_locale . '\");' . \"\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tself::$plugins     = $plugins;\n\t\t\t\tself::$ext_plugins = $ext_plugins;\n\n\t\t\t\t$settings            = self::default_settings();\n\t\t\t\t$settings['plugins'] = implode( ',', $plugins );\n\n\t\t\t\tif ( ! empty( $mce_external_plugins ) ) {\n\t\t\t\t\t$settings['external_plugins'] = wp_json_encode( $mce_external_plugins );\n\t\t\t\t}\n\n\t\t\t\t/** This filter is documented in wp-admin/includes/media.php */\n\t\t\t\tif ( apply_filters( 'disable_captions', '' ) ) {\n\t\t\t\t\t$settings['wpeditimage_disable_captions'] = true;\n\t\t\t\t}\n\n\t\t\t\t$mce_css = $settings['content_css'];\n\n\t\t\t\t/*\n\t\t\t\t * The `editor-style.css` added by the theme is generally intended for the editor instance on the Edit Post screen.\n\t\t\t\t * Plugins that use wp_editor() on the front-end can decide whether to add the theme stylesheet\n\t\t\t\t * by using `get_editor_stylesheets()` and the `mce_css` or `tiny_mce_before_init` filters, see below.\n\t\t\t\t */\n\t\t\t\tif ( is_admin() ) {\n\t\t\t\t\t$editor_styles = get_editor_stylesheets();\n\n\t\t\t\t\tif ( ! empty( $editor_styles ) ) {\n\t\t\t\t\t\t// Force urlencoding of commas.\n\t\t\t\t\t\tforeach ( $editor_styles as $key => $url ) {\n\t\t\t\t\t\t\tif ( strpos( $url, ',' ) !== false ) {\n\t\t\t\t\t\t\t\t$editor_styles[ $key ] = str_replace( ',', '%2C', $url );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$mce_css .= ',' . implode( ',', $editor_styles );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Filters the comma-delimited list of stylesheets to load in TinyMCE.\n\t\t\t\t *\n\t\t\t\t * @since 2.1.0\n\t\t\t\t *\n\t\t\t\t * @param string $stylesheets Comma-delimited list of stylesheets.\n\t\t\t\t */\n\t\t\t\t$mce_css = trim( apply_filters( 'mce_css', $mce_css ), ' ,' );\n\n\t\t\t\tif ( ! empty( $mce_css ) ) {\n\t\t\t\t\t$settings['content_css'] = $mce_css;\n\t\t\t\t} else {\n\t\t\t\t\tunset( $settings['content_css'] );\n\t\t\t\t}\n\n\t\t\t\tself::$first_init = $settings;\n\t\t\t}\n\n\t\t\tif ( $set['teeny'] ) {\n\t\t\t\t$mce_buttons = array(\n\t\t\t\t\t'bold',\n\t\t\t\t\t'italic',\n\t\t\t\t\t'underline',\n\t\t\t\t\t'blockquote',\n\t\t\t\t\t'strikethrough',\n\t\t\t\t\t'bullist',\n\t\t\t\t\t'numlist',\n\t\t\t\t\t'alignleft',\n\t\t\t\t\t'aligncenter',\n\t\t\t\t\t'alignright',\n\t\t\t\t\t'undo',\n\t\t\t\t\t'redo',\n\t\t\t\t\t'link',\n\t\t\t\t\t'fullscreen',\n\t\t\t\t);\n\n\t\t\t\t/**\n\t\t\t\t * Filters the list of teenyMCE buttons (Text tab).\n\t\t\t\t *\n\t\t\t\t * @since 2.7.0\n\t\t\t\t * @since 3.3.0 The `$editor_id` parameter was added.\n\t\t\t\t *\n\t\t\t\t * @param array  $mce_buttons An array of teenyMCE buttons.\n\t\t\t\t * @param string $editor_id   Unique editor identifier, e.g. 'content'.\n\t\t\t\t */\n\t\t\t\t$mce_buttons   = apply_filters( 'teeny_mce_buttons', $mce_buttons, $editor_id );\n\t\t\t\t$mce_buttons_2 = array();\n\t\t\t\t$mce_buttons_3 = array();\n\t\t\t\t$mce_buttons_4 = array();\n\t\t\t} else {\n\t\t\t\t$mce_buttons = array(\n\t\t\t\t\t'formatselect',\n\t\t\t\t\t'bold',\n\t\t\t\t\t'italic',\n\t\t\t\t\t'bullist',\n\t\t\t\t\t'numlist',\n\t\t\t\t\t'blockquote',\n\t\t\t\t\t'alignleft',\n\t\t\t\t\t'aligncenter',\n\t\t\t\t\t'alignright',\n\t\t\t\t\t'link',\n\t\t\t\t\t'wp_more',\n\t\t\t\t\t'spellchecker',\n\t\t\t\t);\n\n\t\t\t\tif ( ! wp_is_mobile() ) {\n\t\t\t\t\tif ( $set['_content_editor_dfw'] ) {\n\t\t\t\t\t\t$mce_buttons[] = 'wp_adv';\n\t\t\t\t\t\t$mce_buttons[] = 'dfw';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$mce_buttons[] = 'fullscreen';\n\t\t\t\t\t\t$mce_buttons[] = 'wp_adv';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$mce_buttons[] = 'wp_adv';\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Filters the first-row list of TinyMCE buttons (Visual tab).\n\t\t\t\t *\n\t\t\t\t * @since 2.0.0\n\t\t\t\t * @since 3.3.0 The `$editor_id` parameter was added.\n\t\t\t\t *\n\t\t\t\t * @param array  $mce_buttons First-row list of buttons.\n\t\t\t\t * @param string $editor_id   Unique editor identifier, e.g. 'content'. Accepts 'classic-block'\n\t\t\t\t *                            when called from block editor's Classic block.\n\t\t\t\t */\n\t\t\t\t$mce_buttons = apply_filters( 'mce_buttons', $mce_buttons, $editor_id );\n\n\t\t\t\t$mce_buttons_2 = array(\n\t\t\t\t\t'strikethrough',\n\t\t\t\t\t'hr',\n\t\t\t\t\t'forecolor',\n\t\t\t\t\t'pastetext',\n\t\t\t\t\t'removeformat',\n\t\t\t\t\t'charmap',\n\t\t\t\t\t'outdent',\n\t\t\t\t\t'indent',\n\t\t\t\t\t'undo',\n\t\t\t\t\t'redo',\n\t\t\t\t);\n\n\t\t\t\tif ( ! wp_is_mobile() ) {\n\t\t\t\t\t$mce_buttons_2[] = 'wp_help';\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Filters the second-row list of TinyMCE buttons (Visual tab).\n\t\t\t\t *\n\t\t\t\t * @since 2.0.0\n\t\t\t\t * @since 3.3.0 The `$editor_id` parameter was added.\n\t\t\t\t *\n\t\t\t\t * @param array  $mce_buttons_2 Second-row list of buttons.\n\t\t\t\t * @param string $editor_id     Unique editor identifier, e.g. 'content'. Accepts 'classic-block'\n\t\t\t\t *                              when called from block editor's Classic block.\n\t\t\t\t */\n\t\t\t\t$mce_buttons_2 = apply_filters( 'mce_buttons_2', $mce_buttons_2, $editor_id );\n\n\t\t\t\t/**\n\t\t\t\t * Filters the third-row list of TinyMCE buttons (Visual tab).\n\t\t\t\t *\n\t\t\t\t * @since 2.0.0\n\t\t\t\t * @since 3.3.0 The `$editor_id` parameter was added.\n\t\t\t\t *\n\t\t\t\t * @param array  $mce_buttons_3 Third-row list of buttons.\n\t\t\t\t * @param string $editor_id     Unique editor identifier, e.g. 'content'. Accepts 'classic-block'\n\t\t\t\t *                              when called from block editor's Classic block.\n\t\t\t\t */\n\t\t\t\t$mce_buttons_3 = apply_filters( 'mce_buttons_3', array(), $editor_id );\n\n\t\t\t\t/**\n\t\t\t\t * Filters the fourth-row list of TinyMCE buttons (Visual tab).\n\t\t\t\t *\n\t\t\t\t * @since 2.5.0\n\t\t\t\t * @since 3.3.0 The `$editor_id` parameter was added.\n\t\t\t\t *\n\t\t\t\t * @param array  $mce_buttons_4 Fourth-row list of buttons.\n\t\t\t\t * @param string $editor_id     Unique editor identifier, e.g. 'content'. Accepts 'classic-block'\n\t\t\t\t *                              when called from block editor's Classic block.\n\t\t\t\t */\n\t\t\t\t$mce_buttons_4 = apply_filters( 'mce_buttons_4', array(), $editor_id );\n\t\t\t}\n\n\t\t\t$body_class = $editor_id;\n\n\t\t\t$post = get_post();\n\t\t\tif ( $post ) {\n\t\t\t\t$body_class .= ' post-type-' . sanitize_html_class( $post->post_type ) . ' post-status-' . sanitize_html_class( $post->post_status );\n\n\t\t\t\tif ( post_type_supports( $post->post_type, 'post-formats' ) ) {\n\t\t\t\t\t$post_format = get_post_format( $post );\n\t\t\t\t\tif ( $post_format && ! is_wp_error( $post_format ) ) {\n\t\t\t\t\t\t$body_class .= ' post-format-' . sanitize_html_class( $post_format );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$body_class .= ' post-format-standard';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$page_template = get_page_template_slug( $post );\n\n\t\t\t\tif ( false !== $page_template ) {\n\t\t\t\t\t$page_template = empty( $page_template ) ? 'default' : str_replace( '.', '-', basename( $page_template, '.php' ) );\n\t\t\t\t\t$body_class   .= ' page-template-' . sanitize_html_class( $page_template );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );\n\n\t\t\tif ( ! empty( $set['tinymce']['body_class'] ) ) {\n\t\t\t\t$body_class .= ' ' . $set['tinymce']['body_class'];\n\t\t\t\tunset( $set['tinymce']['body_class'] );\n\t\t\t}\n\n\t\t\t$mceInit = array(\n\t\t\t\t'selector'          => \"#$editor_id\",\n\t\t\t\t'wpautop'           => (bool) $set['wpautop'],\n\t\t\t\t'indent'            => ! $set['wpautop'],\n\t\t\t\t'toolbar1'          => implode( ',', $mce_buttons ),\n\t\t\t\t'toolbar2'          => implode( ',', $mce_buttons_2 ),\n\t\t\t\t'toolbar3'          => implode( ',', $mce_buttons_3 ),\n\t\t\t\t'toolbar4'          => implode( ',', $mce_buttons_4 ),\n\t\t\t\t'tabfocus_elements' => $set['tabfocus_elements'],\n\t\t\t\t'body_class'        => $body_class,\n\t\t\t);\n\n\t\t\t// Merge with the first part of the init array.\n\t\t\t$mceInit = array_merge( self::$first_init, $mceInit );\n\n\t\t\tif ( is_array( $set['tinymce'] ) ) {\n\t\t\t\t$mceInit = array_merge( $mceInit, $set['tinymce'] );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * For people who really REALLY know what they're doing with TinyMCE\n\t\t\t * You can modify $mceInit to add, remove, change elements of the config\n\t\t\t * before tinyMCE.init. Setting \"valid_elements\", \"invalid_elements\"\n\t\t\t * and \"extended_valid_elements\" can be done through this filter. Best\n\t\t\t * is to use the default cleanup by not specifying valid_elements,\n\t\t\t * as TinyMCE checks against the full set of HTML 5.0 elements and attributes.\n\t\t\t */\n\t\t\tif ( $set['teeny'] ) {\n\n\t\t\t\t/**\n\t\t\t\t * Filters the teenyMCE config before init.\n\t\t\t\t *\n\t\t\t\t * @since 2.7.0\n\t\t\t\t * @since 3.3.0 The `$editor_id` parameter was added.\n\t\t\t\t *\n\t\t\t\t * @param array  $mceInit   An array with teenyMCE config.\n\t\t\t\t * @param string $editor_id Unique editor identifier, e.g. 'content'.\n\t\t\t\t */\n\t\t\t\t$mceInit = apply_filters( 'teeny_mce_before_init', $mceInit, $editor_id );\n\t\t\t} else {\n\n\t\t\t\t/**\n\t\t\t\t * Filters the TinyMCE config before init.\n\t\t\t\t *\n\t\t\t\t * @since 2.5.0\n\t\t\t\t * @since 3.3.0 The `$editor_id` parameter was added.\n\t\t\t\t *\n\t\t\t\t * @param array  $mceInit   An array with TinyMCE config.\n\t\t\t\t * @param string $editor_id Unique editor identifier, e.g. 'content'. Accepts 'classic-block'\n\t\t\t\t *                          when called from block editor's Classic block.\n\t\t\t\t */\n\t\t\t\t$mceInit = apply_filters( 'tiny_mce_before_init', $mceInit, $editor_id );\n\t\t\t}\n\n\t\t\tif ( empty( $mceInit['toolbar3'] ) && ! empty( $mceInit['toolbar4'] ) ) {\n\t\t\t\t$mceInit['toolbar3'] = $mceInit['toolbar4'];\n\t\t\t\t$mceInit['toolbar4'] = '';\n\t\t\t}\n\n\t\t\tself::$mce_settings[ $editor_id ] = $mceInit;\n\t\t} // End if self::$this_tinymce.\n\t}\n\n\t/**\n\t * @since 3.3.0\n\t *\n\t * @param array $init\n\t * @return string\n\t */\n\tprivate static function _parse_init( $init ) {\n\t\t$options = '';\n\n\t\tforeach ( $init as $key => $value ) {\n\t\t\tif ( is_bool( $value ) ) {\n\t\t\t\t$val      = $value ? 'true' : 'false';\n\t\t\t\t$options .= $key . ':' . $val . ',';\n\t\t\t\tcontinue;\n\t\t\t} elseif ( ! empty( $value ) && is_string( $value ) && (\n\t\t\t\t( '{' === $value[0] && '}' === $value[ strlen( $value ) - 1 ] ) ||\n\t\t\t\t( '[' === $value[0] && ']' === $value[ strlen( $value ) - 1 ] ) ||\n\t\t\t\tpreg_match( '/^\\(?function ?\\(/', $value ) ) ) {\n\n\t\t\t\t$options .= $key . ':' . $value . ',';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$options .= $key . ':\"' . $value . '\",';\n\t\t}\n\n\t\treturn '{' . trim( $options, ' ,' ) . '}';\n\t}\n\n\t/**\n\t * @since 3.3.0\n\t *\n\t * @param bool $default_scripts Optional. Whether default scripts should be enqueued. Default false.\n\t */\n\tpublic static function enqueue_scripts( $default_scripts = false ) {\n\t\tif ( $default_scripts || self::$has_tinymce ) {\n\t\t\twp_enqueue_script( 'editor' );\n\t\t}\n\n\t\tif ( $default_scripts || self::$has_quicktags ) {\n\t\t\twp_enqueue_script( 'quicktags' );\n\t\t\twp_enqueue_style( 'buttons' );\n\t\t}\n\n\t\tif ( $default_scripts || in_array( 'wplink', self::$plugins, true ) || in_array( 'link', self::$qt_buttons, true ) ) {\n\t\t\twp_enqueue_script( 'wplink' );\n\t\t\twp_enqueue_script( 'jquery-ui-autocomplete' );\n\t\t}\n\n\t\tif ( self::$has_medialib ) {\n\t\t\tadd_thickbox();\n\t\t\twp_enqueue_script( 'media-upload' );\n\t\t\twp_enqueue_script( 'wp-embed' );\n\t\t} elseif ( $default_scripts ) {\n\t\t\twp_enqueue_script( 'media-upload' );\n\t\t}\n\n\t\t/**\n\t\t * Fires when scripts and styles are enqueued for the editor.\n\t\t *\n\t\t * @since 3.9.0\n\t\t *\n\t\t * @param array $to_load An array containing boolean values whether TinyMCE\n\t\t *                       and Quicktags are being loaded.\n\t\t */\n\t\tdo_action(\n\t\t\t'wp_enqueue_editor',\n\t\t\tarray(\n\t\t\t\t'tinymce'   => ( $default_scripts || self::$has_tinymce ),\n\t\t\t\t'quicktags' => ( $default_scripts || self::$has_quicktags ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Enqueue all editor scripts.\n\t * For use when the editor is going to be initialized after page load.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic static function enqueue_default_editor() {\n\t\t// We are past the point where scripts can be enqueued properly.\n\t\tif ( did_action( 'wp_enqueue_editor' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::enqueue_scripts( true );\n\n\t\t// Also add wp-includes/css/editor.css.\n\t\twp_enqueue_style( 'editor-buttons' );\n\n\t\tif ( is_admin() ) {\n\t\t\tadd_action( 'admin_print_footer_scripts', array( __CLASS__, 'force_uncompressed_tinymce' ), 1 );\n\t\t\tadd_action( 'admin_print_footer_scripts', array( __CLASS__, 'print_default_editor_scripts' ), 45 );\n\t\t} else {\n\t\t\tadd_action( 'wp_print_footer_scripts', array( __CLASS__, 'force_uncompressed_tinymce' ), 1 );\n\t\t\tadd_action( 'wp_print_footer_scripts', array( __CLASS__, 'print_default_editor_scripts' ), 45 );\n\t\t}\n\t}\n\n\t/**\n\t * Print (output) all editor scripts and default settings.\n\t * For use when the editor is going to be initialized after page load.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic static function print_default_editor_scripts() {\n\t\t$user_can_richedit = user_can_richedit();\n\n\t\tif ( $user_can_richedit ) {\n\t\t\t$settings = self::default_settings();\n\n\t\t\t$settings['toolbar1']    = 'bold,italic,bullist,numlist,link';\n\t\t\t$settings['wpautop']     = false;\n\t\t\t$settings['indent']      = true;\n\t\t\t$settings['elementpath'] = false;\n\n\t\t\tif ( is_rtl() ) {\n\t\t\t\t$settings['directionality'] = 'rtl';\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * In production all plugins are loaded (they are in wp-editor.js.gz).\n\t\t\t * The 'wpview', 'wpdialogs', and 'media' TinyMCE plugins are not initialized by default.\n\t\t\t * Can be added from js by using the 'wp-before-tinymce-init' event.\n\t\t\t */\n\t\t\t$settings['plugins'] = implode(\n\t\t\t\t',',\n\t\t\t\tarray(\n\t\t\t\t\t'charmap',\n\t\t\t\t\t'colorpicker',\n\t\t\t\t\t'hr',\n\t\t\t\t\t'lists',\n\t\t\t\t\t'paste',\n\t\t\t\t\t'tabfocus',\n\t\t\t\t\t'textcolor',\n\t\t\t\t\t'fullscreen',\n\t\t\t\t\t'wordpress',\n\t\t\t\t\t'wpautoresize',\n\t\t\t\t\t'wpeditimage',\n\t\t\t\t\t'wpemoji',\n\t\t\t\t\t'wpgallery',\n\t\t\t\t\t'wplink',\n\t\t\t\t\t'wptextpattern',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$settings = self::_parse_init( $settings );\n\t\t} else {\n\t\t\t$settings = '{}';\n\t\t}\n\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\twindow.wp = window.wp || {};\n\t\twindow.wp.editor = window.wp.editor || {};\n\t\twindow.wp.editor.getDefaultSettings = function() {\n\t\t\treturn {\n\t\t\t\ttinymce: <?php echo $settings; ?>,\n\t\t\t\tquicktags: {\n\t\t\t\t\tbuttons: 'strong,em,link,ul,ol,li,code'\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\n\t\t<?php\n\n\t\tif ( $user_can_richedit ) {\n\t\t\t$suffix  = SCRIPT_DEBUG ? '' : '.min';\n\t\t\t$baseurl = self::get_baseurl();\n\n\t\t\t?>\n\t\t\tvar tinyMCEPreInit = {\n\t\t\t\tbaseURL: \"<?php echo $baseurl; ?>\",\n\t\t\t\tsuffix: \"<?php echo $suffix; ?>\",\n\t\t\t\tmceInit: {},\n\t\t\t\tqtInit: {},\n\t\t\t\tload_ext: function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');}\n\t\t\t};\n\t\t\t<?php\n\t\t}\n\t\t?>\n\t\t</script>\n\t\t<?php\n\n\t\tif ( $user_can_richedit ) {\n\t\t\tself::print_tinymce_scripts();\n\t\t}\n\n\t\t/**\n\t\t * Fires when the editor scripts are loaded for later initialization,\n\t\t * after all scripts and settings are printed.\n\t\t *\n\t\t * @since 4.8.0\n\t\t */\n\t\tdo_action( 'print_default_editor_scripts' );\n\n\t\tself::wp_link_dialog();\n\t}\n\n\t/**\n\t * Returns the TinyMCE locale.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @return string\n\t */\n\tpublic static function get_mce_locale() {\n\t\tif ( empty( self::$mce_locale ) ) {\n\t\t\t$mce_locale       = get_user_locale();\n\t\t\tself::$mce_locale = empty( $mce_locale ) ? 'en' : strtolower( substr( $mce_locale, 0, 2 ) ); // ISO 639-1.\n\t\t}\n\n\t\treturn self::$mce_locale;\n\t}\n\n\t/**\n\t * Returns the TinyMCE base URL.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @return string\n\t */\n\tpublic static function get_baseurl() {\n\t\tif ( empty( self::$baseurl ) ) {\n\t\t\tself::$baseurl = includes_url( 'js/tinymce' );\n\t\t}\n\n\t\treturn self::$baseurl;\n\t}\n\n\t/**\n\t * Returns the default TinyMCE settings.\n\t * Doesn't include plugins, buttons, editor selector.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @global string $tinymce_version\n\t *\n\t * @return array\n\t */\n\tprivate static function default_settings() {\n\t\tglobal $tinymce_version;\n\n\t\t$shortcut_labels = array();\n\n\t\tforeach ( self::get_translation() as $name => $value ) {\n\t\t\tif ( is_array( $value ) ) {\n\t\t\t\t$shortcut_labels[ $name ] = $value[1];\n\t\t\t}\n\t\t}\n\n\t\t$settings = array(\n\t\t\t'theme'                        => 'modern',\n\t\t\t'skin'                         => 'lightgray',\n\t\t\t'language'                     => self::get_mce_locale(),\n\t\t\t'formats'                      => '{' .\n\t\t\t\t'alignleft: [' .\n\t\t\t\t\t'{selector: \"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li\", styles: {textAlign:\"left\"}},' .\n\t\t\t\t\t'{selector: \"img,table,dl.wp-caption\", classes: \"alignleft\"}' .\n\t\t\t\t'],' .\n\t\t\t\t'aligncenter: [' .\n\t\t\t\t\t'{selector: \"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li\", styles: {textAlign:\"center\"}},' .\n\t\t\t\t\t'{selector: \"img,table,dl.wp-caption\", classes: \"aligncenter\"}' .\n\t\t\t\t'],' .\n\t\t\t\t'alignright: [' .\n\t\t\t\t\t'{selector: \"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li\", styles: {textAlign:\"right\"}},' .\n\t\t\t\t\t'{selector: \"img,table,dl.wp-caption\", classes: \"alignright\"}' .\n\t\t\t\t'],' .\n\t\t\t\t'strikethrough: {inline: \"del\"}' .\n\t\t\t'}',\n\t\t\t'relative_urls'                => false,\n\t\t\t'remove_script_host'           => false,\n\t\t\t'convert_urls'                 => false,\n\t\t\t'browser_spellcheck'           => true,\n\t\t\t'fix_list_elements'            => true,\n\t\t\t'entities'                     => '38,amp,60,lt,62,gt',\n\t\t\t'entity_encoding'              => 'raw',\n\t\t\t'keep_styles'                  => false,\n\t\t\t'cache_suffix'                 => 'wp-mce-' . $tinymce_version,\n\t\t\t'resize'                       => 'vertical',\n\t\t\t'menubar'                      => false,\n\t\t\t'branding'                     => false,\n\n\t\t\t// Limit the preview styles in the menu/toolbar.\n\t\t\t'preview_styles'               => 'font-family font-size font-weight font-style text-decoration text-transform',\n\n\t\t\t'end_container_on_empty_block' => true,\n\t\t\t'wpeditimage_html5_captions'   => true,\n\t\t\t'wp_lang_attr'                 => get_bloginfo( 'language' ),\n\t\t\t'wp_keep_scroll_position'      => false,\n\t\t\t'wp_shortcut_labels'           => wp_json_encode( $shortcut_labels ),\n\t\t);\n\n\t\t$suffix  = SCRIPT_DEBUG ? '' : '.min';\n\t\t$version = 'ver=' . get_bloginfo( 'version' );\n\n\t\t// Default stylesheets.\n\t\t$settings['content_css'] = includes_url( \"css/dashicons$suffix.css?$version\" ) . ',' .\n\t\t\tincludes_url( \"js/tinymce/skins/wordpress/wp-content.css?$version\" );\n\n\t\treturn $settings;\n\t}\n\n\t/**\n\t * @since 4.7.0\n\t *\n\t * @return array\n\t */\n\tprivate static function get_translation() {\n\t\tif ( empty( self::$translation ) ) {\n\t\t\tself::$translation = array(\n\t\t\t\t// Default TinyMCE strings.\n\t\t\t\t'New document'                         => __( 'New document' ),\n\t\t\t\t'Formats'                              => _x( 'Formats', 'TinyMCE' ),\n\n\t\t\t\t'Headings'                             => _x( 'Headings', 'TinyMCE' ),\n\t\t\t\t'Heading 1'                            => array( __( 'Heading 1' ), 'access1' ),\n\t\t\t\t'Heading 2'                            => array( __( 'Heading 2' ), 'access2' ),\n\t\t\t\t'Heading 3'                            => array( __( 'Heading 3' ), 'access3' ),\n\t\t\t\t'Heading 4'                            => array( __( 'Heading 4' ), 'access4' ),\n\t\t\t\t'Heading 5'                            => array( __( 'Heading 5' ), 'access5' ),\n\t\t\t\t'Heading 6'                            => array( __( 'Heading 6' ), 'access6' ),\n\n\t\t\t\t/* translators: Block tags. */\n\t\t\t\t'Blocks'                               => _x( 'Blocks', 'TinyMCE' ),\n\t\t\t\t'Paragraph'                            => array( __( 'Paragraph' ), 'access7' ),\n\t\t\t\t'Blockquote'                           => array( __( 'Blockquote' ), 'accessQ' ),\n\t\t\t\t'Div'                                  => _x( 'Div', 'HTML tag' ),\n\t\t\t\t'Pre'                                  => _x( 'Pre', 'HTML tag' ),\n\t\t\t\t'Preformatted'                         => _x( 'Preformatted', 'HTML tag' ),\n\t\t\t\t'Address'                              => _x( 'Address', 'HTML tag' ),\n\n\t\t\t\t'Inline'                               => _x( 'Inline', 'HTML elements' ),\n\t\t\t\t'Underline'                            => array( __( 'Underline' ), 'metaU' ),\n\t\t\t\t'Strikethrough'                        => array( __( 'Strikethrough' ), 'accessD' ),\n\t\t\t\t'Subscript'                            => __( 'Subscript' ),\n\t\t\t\t'Superscript'                          => __( 'Superscript' ),\n\t\t\t\t'Clear formatting'                     => __( 'Clear formatting' ),\n\t\t\t\t'Bold'                                 => array( __( 'Bold' ), 'metaB' ),\n\t\t\t\t'Italic'                               => array( __( 'Italic' ), 'metaI' ),\n\t\t\t\t'Code'                                 => array( __( 'Code' ), 'accessX' ),\n\t\t\t\t'Source code'                          => __( 'Source code' ),\n\t\t\t\t'Font Family'                          => __( 'Font Family' ),\n\t\t\t\t'Font Sizes'                           => __( 'Font Sizes' ),\n\n\t\t\t\t'Align center'                         => array( __( 'Align center' ), 'accessC' ),\n\t\t\t\t'Align right'                          => array( __( 'Align right' ), 'accessR' ),\n\t\t\t\t'Align left'                           => array( __( 'Align left' ), 'accessL' ),\n\t\t\t\t'Justify'                              => array( __( 'Justify' ), 'accessJ' ),\n\t\t\t\t'Increase indent'                      => __( 'Increase indent' ),\n\t\t\t\t'Decrease indent'                      => __( 'Decrease indent' ),\n\n\t\t\t\t'Cut'                                  => array( __( 'Cut' ), 'metaX' ),\n\t\t\t\t'Copy'                                 => array( __( 'Copy' ), 'metaC' ),\n\t\t\t\t'Paste'                                => array( __( 'Paste' ), 'metaV' ),\n\t\t\t\t'Select all'                           => array( __( 'Select all' ), 'metaA' ),\n\t\t\t\t'Undo'                                 => array( __( 'Undo' ), 'metaZ' ),\n\t\t\t\t'Redo'                                 => array( __( 'Redo' ), 'metaY' ),\n\n\t\t\t\t'Ok'                                   => __( 'OK' ),\n\t\t\t\t'Cancel'                               => __( 'Cancel' ),\n\t\t\t\t'Close'                                => __( 'Close' ),\n\t\t\t\t'Visual aids'                          => __( 'Visual aids' ),\n\n\t\t\t\t'Bullet list'                          => array( __( 'Bulleted list' ), 'accessU' ),\n\t\t\t\t'Numbered list'                        => array( __( 'Numbered list' ), 'accessO' ),\n\t\t\t\t'Square'                               => _x( 'Square', 'list style' ),\n\t\t\t\t'Default'                              => _x( 'Default', 'list style' ),\n\t\t\t\t'Circle'                               => _x( 'Circle', 'list style' ),\n\t\t\t\t'Disc'                                 => _x( 'Disc', 'list style' ),\n\t\t\t\t'Lower Greek'                          => _x( 'Lower Greek', 'list style' ),\n\t\t\t\t'Lower Alpha'                          => _x( 'Lower Alpha', 'list style' ),\n\t\t\t\t'Upper Alpha'                          => _x( 'Upper Alpha', 'list style' ),\n\t\t\t\t'Upper Roman'                          => _x( 'Upper Roman', 'list style' ),\n\t\t\t\t'Lower Roman'                          => _x( 'Lower Roman', 'list style' ),\n\n\t\t\t\t// Anchor plugin.\n\t\t\t\t'Name'                                 => _x( 'Name', 'Name of link anchor (TinyMCE)' ),\n\t\t\t\t'Anchor'                               => _x( 'Anchor', 'Link anchor (TinyMCE)' ),\n\t\t\t\t'Anchors'                              => _x( 'Anchors', 'Link anchors (TinyMCE)' ),\n\t\t\t\t'Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.' =>\n\t\t\t\t\t__( 'Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.' ),\n\t\t\t\t'Id'                                   => _x( 'Id', 'Id for link anchor (TinyMCE)' ),\n\n\t\t\t\t// Fullpage plugin.\n\t\t\t\t'Document properties'                  => __( 'Document properties' ),\n\t\t\t\t'Robots'                               => __( 'Robots' ),\n\t\t\t\t'Title'                                => __( 'Title' ),\n\t\t\t\t'Keywords'                             => __( 'Keywords' ),\n\t\t\t\t'Encoding'                             => __( 'Encoding' ),\n\t\t\t\t'Description'                          => __( 'Description' ),\n\t\t\t\t'Author'                               => __( 'Author' ),\n\n\t\t\t\t// Media, image plugins.\n\t\t\t\t'Image'                                => __( 'Image' ),\n\t\t\t\t'Insert/edit image'                    => array( __( 'Insert/edit image' ), 'accessM' ),\n\t\t\t\t'General'                              => __( 'General' ),\n\t\t\t\t'Advanced'                             => __( 'Advanced' ),\n\t\t\t\t'Source'                               => __( 'Source' ),\n\t\t\t\t'Border'                               => __( 'Border' ),\n\t\t\t\t'Constrain proportions'                => __( 'Constrain proportions' ),\n\t\t\t\t'Vertical space'                       => __( 'Vertical space' ),\n\t\t\t\t'Image description'                    => __( 'Image description' ),\n\t\t\t\t'Style'                                => __( 'Style' ),\n\t\t\t\t'Dimensions'                           => __( 'Dimensions' ),\n\t\t\t\t'Insert image'                         => __( 'Insert image' ),\n\t\t\t\t'Date/time'                            => __( 'Date/time' ),\n\t\t\t\t'Insert date/time'                     => __( 'Insert date/time' ),\n\t\t\t\t'Table of Contents'                    => __( 'Table of Contents' ),\n\t\t\t\t'Insert/Edit code sample'              => __( 'Insert/edit code sample' ),\n\t\t\t\t'Language'                             => __( 'Language' ),\n\t\t\t\t'Media'                                => __( 'Media' ),\n\t\t\t\t'Insert/edit media'                    => __( 'Insert/edit media' ),\n\t\t\t\t'Poster'                               => __( 'Poster' ),\n\t\t\t\t'Alternative source'                   => __( 'Alternative source' ),\n\t\t\t\t'Paste your embed code below:'         => __( 'Paste your embed code below:' ),\n\t\t\t\t'Insert video'                         => __( 'Insert video' ),\n\t\t\t\t'Embed'                                => __( 'Embed' ),\n\n\t\t\t\t// Each of these have a corresponding plugin.\n\t\t\t\t'Special character'                    => __( 'Special character' ),\n\t\t\t\t'Right to left'                        => _x( 'Right to left', 'editor button' ),\n\t\t\t\t'Left to right'                        => _x( 'Left to right', 'editor button' ),\n\t\t\t\t'Emoticons'                            => __( 'Emoticons' ),\n\t\t\t\t'Nonbreaking space'                    => __( 'Nonbreaking space' ),\n\t\t\t\t'Page break'                           => __( 'Page break' ),\n\t\t\t\t'Paste as text'                        => __( 'Paste as text' ),\n\t\t\t\t'Preview'                              => __( 'Preview' ),\n\t\t\t\t'Print'                                => __( 'Print' ),\n\t\t\t\t'Save'                                 => __( 'Save' ),\n\t\t\t\t'Fullscreen'                           => __( 'Fullscreen' ),\n\t\t\t\t'Horizontal line'                      => __( 'Horizontal line' ),\n\t\t\t\t'Horizontal space'                     => __( 'Horizontal space' ),\n\t\t\t\t'Restore last draft'                   => __( 'Restore last draft' ),\n\t\t\t\t'Insert/edit link'                     => array( __( 'Insert/edit link' ), 'metaK' ),\n\t\t\t\t'Remove link'                          => array( __( 'Remove link' ), 'accessS' ),\n\n\t\t\t\t// Link plugin.\n\t\t\t\t'Link'                                 => __( 'Link' ),\n\t\t\t\t'Insert link'                          => __( 'Insert link' ),\n\t\t\t\t'Target'                               => __( 'Target' ),\n\t\t\t\t'New window'                           => __( 'New window' ),\n\t\t\t\t'Text to display'                      => __( 'Text to display' ),\n\t\t\t\t'Url'                                  => __( 'URL' ),\n\t\t\t\t'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?' =>\n\t\t\t\t\t__( 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?' ),\n\t\t\t\t'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?' =>\n\t\t\t\t\t__( 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?' ),\n\n\t\t\t\t'Color'                                => __( 'Color' ),\n\t\t\t\t'Custom color'                         => __( 'Custom color' ),\n\t\t\t\t'Custom...'                            => _x( 'Custom...', 'label for custom color' ), // No ellipsis.\n\t\t\t\t'No color'                             => __( 'No color' ),\n\t\t\t\t'R'                                    => _x( 'R', 'Short for red in RGB' ),\n\t\t\t\t'G'                                    => _x( 'G', 'Short for green in RGB' ),\n\t\t\t\t'B'                                    => _x( 'B', 'Short for blue in RGB' ),\n\n\t\t\t\t// Spelling, search/replace plugins.\n\t\t\t\t'Could not find the specified string.' => __( 'Could not find the specified string.' ),\n\t\t\t\t'Replace'                              => _x( 'Replace', 'find/replace' ),\n\t\t\t\t'Next'                                 => _x( 'Next', 'find/replace' ),\n\t\t\t\t/* translators: Previous. */\n\t\t\t\t'Prev'                                 => _x( 'Prev', 'find/replace' ),\n\t\t\t\t'Whole words'                          => _x( 'Whole words', 'find/replace' ),\n\t\t\t\t'Find and replace'                     => __( 'Find and replace' ),\n\t\t\t\t'Replace with'                         => _x( 'Replace with', 'find/replace' ),\n\t\t\t\t'Find'                                 => _x( 'Find', 'find/replace' ),\n\t\t\t\t'Replace all'                          => _x( 'Replace all', 'find/replace' ),\n\t\t\t\t'Match case'                           => __( 'Match case' ),\n\t\t\t\t'Spellcheck'                           => __( 'Check Spelling' ),\n\t\t\t\t'Finish'                               => _x( 'Finish', 'spellcheck' ),\n\t\t\t\t'Ignore all'                           => _x( 'Ignore all', 'spellcheck' ),\n\t\t\t\t'Ignore'                               => _x( 'Ignore', 'spellcheck' ),\n\t\t\t\t'Add to Dictionary'                    => __( 'Add to Dictionary' ),\n\n\t\t\t\t// TinyMCE tables.\n\t\t\t\t'Insert table'                         => __( 'Insert table' ),\n\t\t\t\t'Delete table'                         => __( 'Delete table' ),\n\t\t\t\t'Table properties'                     => __( 'Table properties' ),\n\t\t\t\t'Row properties'                       => __( 'Table row properties' ),\n\t\t\t\t'Cell properties'                      => __( 'Table cell properties' ),\n\t\t\t\t'Border color'                         => __( 'Border color' ),\n\n\t\t\t\t'Row'                                  => __( 'Row' ),\n\t\t\t\t'Rows'                                 => __( 'Rows' ),\n\t\t\t\t'Column'                               => _x( 'Column', 'table column' ),\n\t\t\t\t'Cols'                                 => _x( 'Cols', 'table columns' ),\n\t\t\t\t'Cell'                                 => _x( 'Cell', 'table cell' ),\n\t\t\t\t'Header cell'                          => __( 'Header cell' ),\n\t\t\t\t'Header'                               => _x( 'Header', 'table header' ),\n\t\t\t\t'Body'                                 => _x( 'Body', 'table body' ),\n\t\t\t\t'Footer'                               => _x( 'Footer', 'table footer' ),\n\n\t\t\t\t'Insert row before'                    => __( 'Insert row before' ),\n\t\t\t\t'Insert row after'                     => __( 'Insert row after' ),\n\t\t\t\t'Insert column before'                 => __( 'Insert column before' ),\n\t\t\t\t'Insert column after'                  => __( 'Insert column after' ),\n\t\t\t\t'Paste row before'                     => __( 'Paste table row before' ),\n\t\t\t\t'Paste row after'                      => __( 'Paste table row after' ),\n\t\t\t\t'Delete row'                           => __( 'Delete row' ),\n\t\t\t\t'Delete column'                        => __( 'Delete column' ),\n\t\t\t\t'Cut row'                              => __( 'Cut table row' ),\n\t\t\t\t'Copy row'                             => __( 'Copy table row' ),\n\t\t\t\t'Merge cells'                          => __( 'Merge table cells' ),\n\t\t\t\t'Split cell'                           => __( 'Split table cell' ),\n\n\t\t\t\t'Height'                               => __( 'Height' ),\n\t\t\t\t'Width'                                => __( 'Width' ),\n\t\t\t\t'Caption'                              => __( 'Caption' ),\n\t\t\t\t'Alignment'                            => __( 'Alignment' ),\n\t\t\t\t'H Align'                              => _x( 'H Align', 'horizontal table cell alignment' ),\n\t\t\t\t'Left'                                 => __( 'Left' ),\n\t\t\t\t'Center'                               => __( 'Center' ),\n\t\t\t\t'Right'                                => __( 'Right' ),\n\t\t\t\t'None'                                 => _x( 'None', 'table cell alignment attribute' ),\n\t\t\t\t'V Align'                              => _x( 'V Align', 'vertical table cell alignment' ),\n\t\t\t\t'Top'                                  => __( 'Top' ),\n\t\t\t\t'Middle'                               => __( 'Middle' ),\n\t\t\t\t'Bottom'                               => __( 'Bottom' ),\n\n\t\t\t\t'Row group'                            => __( 'Row group' ),\n\t\t\t\t'Column group'                         => __( 'Column group' ),\n\t\t\t\t'Row type'                             => __( 'Row type' ),\n\t\t\t\t'Cell type'                            => __( 'Cell type' ),\n\t\t\t\t'Cell padding'                         => __( 'Cell padding' ),\n\t\t\t\t'Cell spacing'                         => __( 'Cell spacing' ),\n\t\t\t\t'Scope'                                => _x( 'Scope', 'table cell scope attribute' ),\n\n\t\t\t\t'Insert template'                      => _x( 'Insert template', 'TinyMCE' ),\n\t\t\t\t'Templates'                            => _x( 'Templates', 'TinyMCE' ),\n\n\t\t\t\t'Background color'                     => __( 'Background color' ),\n\t\t\t\t'Text color'                           => __( 'Text color' ),\n\t\t\t\t'Show blocks'                          => _x( 'Show blocks', 'editor button' ),\n\t\t\t\t'Show invisible characters'            => __( 'Show invisible characters' ),\n\n\t\t\t\t/* translators: Word count. */\n\t\t\t\t'Words: {0}'                           => sprintf( __( 'Words: %s' ), '{0}' ),\n\t\t\t\t'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' =>\n\t\t\t\t\t__( 'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' ) . \"\\n\\n\" .\n\t\t\t\t\t__( 'If you&#8217;re looking to paste rich content from Microsoft Word, try turning this option off. The editor will clean up text pasted from Word automatically.' ),\n\t\t\t\t'Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help' =>\n\t\t\t\t\t__( 'Rich Text Area. Press Alt-Shift-H for help.' ),\n\t\t\t\t'Rich Text Area. Press Control-Option-H for help.' => __( 'Rich Text Area. Press Control-Option-H for help.' ),\n\t\t\t\t'You have unsaved changes are you sure you want to navigate away?' =>\n\t\t\t\t\t__( 'The changes you made will be lost if you navigate away from this page.' ),\n\t\t\t\t'Your browser doesn\\'t support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.' =>\n\t\t\t\t\t__( 'Your browser does not support direct access to the clipboard. Please use keyboard shortcuts or your browser&#8217;s edit menu instead.' ),\n\n\t\t\t\t// TinyMCE menus.\n\t\t\t\t'Insert'                               => _x( 'Insert', 'TinyMCE menu' ),\n\t\t\t\t'File'                                 => _x( 'File', 'TinyMCE menu' ),\n\t\t\t\t'Edit'                                 => _x( 'Edit', 'TinyMCE menu' ),\n\t\t\t\t'Tools'                                => _x( 'Tools', 'TinyMCE menu' ),\n\t\t\t\t'View'                                 => _x( 'View', 'TinyMCE menu' ),\n\t\t\t\t'Table'                                => _x( 'Table', 'TinyMCE menu' ),\n\t\t\t\t'Format'                               => _x( 'Format', 'TinyMCE menu' ),\n\n\t\t\t\t// WordPress strings.\n\t\t\t\t'Toolbar Toggle'                       => array( __( 'Toolbar Toggle' ), 'accessZ' ),\n\t\t\t\t'Insert Read More tag'                 => array( __( 'Insert Read More tag' ), 'accessT' ),\n\t\t\t\t'Insert Page Break tag'                => array( __( 'Insert Page Break tag' ), 'accessP' ),\n\t\t\t\t'Read more...'                         => __( 'Read more...' ), // Title on the placeholder inside the editor (no ellipsis).\n\t\t\t\t'Distraction-free writing mode'        => array( __( 'Distraction-free writing mode' ), 'accessW' ),\n\t\t\t\t'No alignment'                         => __( 'No alignment' ), // Tooltip for the 'alignnone' button in the image toolbar.\n\t\t\t\t'Remove'                               => __( 'Remove' ),       // Tooltip for the 'remove' button in the image toolbar.\n\t\t\t\t'Edit|button'                          => __( 'Edit' ),         // Tooltip for the 'edit' button in the image toolbar.\n\t\t\t\t'Paste URL or type to search'          => __( 'Paste URL or type to search' ), // Placeholder for the inline link dialog.\n\t\t\t\t'Apply'                                => __( 'Apply' ),        // Tooltip for the 'apply' button in the inline link dialog.\n\t\t\t\t'Link options'                         => __( 'Link options' ), // Tooltip for the 'link options' button in the inline link dialog.\n\t\t\t\t'Visual'                               => _x( 'Visual', 'Name for the Visual editor tab' ),             // Editor switch tab label.\n\t\t\t\t'Text'                                 => _x( 'Text', 'Name for the Text editor tab (formerly HTML)' ), // Editor switch tab label.\n\t\t\t\t'Add Media'                            => array( __( 'Add Media' ), 'accessM' ), // Tooltip for the 'Add Media' button in the block editor Classic block.\n\n\t\t\t\t// Shortcuts help modal.\n\t\t\t\t'Keyboard Shortcuts'                   => array( __( 'Keyboard Shortcuts' ), 'accessH' ),\n\t\t\t\t'Classic Block Keyboard Shortcuts'     => __( 'Classic Block Keyboard Shortcuts' ),\n\t\t\t\t'Default shortcuts,'                   => __( 'Default shortcuts,' ),\n\t\t\t\t'Additional shortcuts,'                => __( 'Additional shortcuts,' ),\n\t\t\t\t'Focus shortcuts:'                     => __( 'Focus shortcuts:' ),\n\t\t\t\t'Inline toolbar (when an image, link or preview is selected)' => __( 'Inline toolbar (when an image, link or preview is selected)' ),\n\t\t\t\t'Editor menu (when enabled)'           => __( 'Editor menu (when enabled)' ),\n\t\t\t\t'Editor toolbar'                       => __( 'Editor toolbar' ),\n\t\t\t\t'Elements path'                        => __( 'Elements path' ),\n\t\t\t\t'Ctrl + Alt + letter:'                 => __( 'Ctrl + Alt + letter:' ),\n\t\t\t\t'Shift + Alt + letter:'                => __( 'Shift + Alt + letter:' ),\n\t\t\t\t'Cmd + letter:'                        => __( 'Cmd + letter:' ),\n\t\t\t\t'Ctrl + letter:'                       => __( 'Ctrl + letter:' ),\n\t\t\t\t'Letter'                               => __( 'Letter' ),\n\t\t\t\t'Action'                               => __( 'Action' ),\n\t\t\t\t'Warning: the link has been inserted but may have errors. Please test it.' => __( 'Warning: the link has been inserted but may have errors. Please test it.' ),\n\t\t\t\t'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' =>\n\t\t\t\t\t__( 'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' ),\n\t\t\t\t'When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' =>\n\t\t\t\t\t__( 'When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' ),\n\t\t\t\t'The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.' =>\n\t\t\t\t\t__( 'The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.' ),\n\t\t\t\t'The next group of formatting shortcuts are applied as you type or when you insert them around plain text in the same paragraph. Press Escape or the Undo button to undo.' =>\n\t\t\t\t\t__( 'The next group of formatting shortcuts are applied as you type or when you insert them around plain text in the same paragraph. Press Escape or the Undo button to undo.' ),\n\t\t\t);\n\t\t}\n\n\t\t/*\n\t\tImagetools plugin (not included):\n\t\t\t'Edit image' => __( 'Edit image' ),\n\t\t\t'Image options' => __( 'Image options' ),\n\t\t\t'Back' => __( 'Back' ),\n\t\t\t'Invert' => __( 'Invert' ),\n\t\t\t'Flip horizontally' => __( 'Flip horizontal' ),\n\t\t\t'Flip vertically' => __( 'Flip vertical' ),\n\t\t\t'Crop' => __( 'Crop' ),\n\t\t\t'Orientation' => __( 'Orientation' ),\n\t\t\t'Resize' => __( 'Resize' ),\n\t\t\t'Rotate clockwise' => __( 'Rotate right' ),\n\t\t\t'Rotate counterclockwise' => __( 'Rotate left' ),\n\t\t\t'Sharpen' => __( 'Sharpen' ),\n\t\t\t'Brightness' => __( 'Brightness' ),\n\t\t\t'Color levels' => __( 'Color levels' ),\n\t\t\t'Contrast' => __( 'Contrast' ),\n\t\t\t'Gamma' => __( 'Gamma' ),\n\t\t\t'Zoom in' => __( 'Zoom in' ),\n\t\t\t'Zoom out' => __( 'Zoom out' ),\n\t\t*/\n\n\t\treturn self::$translation;\n\t}\n\n\t/**\n\t * Translates the default TinyMCE strings and returns them as JSON encoded object ready to be loaded with tinymce.addI18n(),\n\t * or as JS snippet that should run after tinymce.js is loaded.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param string $mce_locale The locale used for the editor.\n\t * @param bool   $json_only  Optional. Whether to include the JavaScript calls to tinymce.addI18n() and\n\t *                           tinymce.ScriptLoader.markDone().\n\t * @return string Translation object, JSON encoded.\n\t */\n\tpublic static function wp_mce_translation( $mce_locale = '', $json_only = false ) {\n\t\tif ( ! $mce_locale ) {\n\t\t\t$mce_locale = self::get_mce_locale();\n\t\t}\n\n\t\t$mce_translation = self::get_translation();\n\n\t\tforeach ( $mce_translation as $name => $value ) {\n\t\t\tif ( is_array( $value ) ) {\n\t\t\t\t$mce_translation[ $name ] = $value[0];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters translated strings prepared for TinyMCE.\n\t\t *\n\t\t * @since 3.9.0\n\t\t *\n\t\t * @param array  $mce_translation Key/value pairs of strings.\n\t\t * @param string $mce_locale      Locale.\n\t\t */\n\t\t$mce_translation = apply_filters( 'wp_mce_translation', $mce_translation, $mce_locale );\n\n\t\tforeach ( $mce_translation as $key => $value ) {\n\t\t\t// Remove strings that are not translated.\n\t\t\tif ( $key === $value ) {\n\t\t\t\tunset( $mce_translation[ $key ] );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( false !== strpos( $value, '&' ) ) {\n\t\t\t\t$mce_translation[ $key ] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8' );\n\t\t\t}\n\t\t}\n\n\t\t// Set direction.\n\t\tif ( is_rtl() ) {\n\t\t\t$mce_translation['_dir'] = 'rtl';\n\t\t}\n\n\t\tif ( $json_only ) {\n\t\t\treturn wp_json_encode( $mce_translation );\n\t\t}\n\n\t\t$baseurl = self::get_baseurl();\n\n\t\treturn \"tinymce.addI18n( '$mce_locale', \" . wp_json_encode( $mce_translation ) . \");\\n\" .\n\t\t\t\"tinymce.ScriptLoader.markDone( '$baseurl/langs/$mce_locale.js' );\\n\";\n\t}\n\n\t/**\n\t * Force uncompressed TinyMCE when a custom theme has been defined.\n\t *\n\t * The compressed TinyMCE file cannot deal with custom themes, so this makes\n\t * sure that we use the uncompressed TinyMCE file if a theme is defined.\n\t * Even if we are on a production environment.\n\t *\n\t * @since 5.0.0\n\t */\n\tpublic static function force_uncompressed_tinymce() {\n\t\t$has_custom_theme = false;\n\t\tforeach ( self::$mce_settings as $init ) {\n\t\t\tif ( ! empty( $init['theme_url'] ) ) {\n\t\t\t\t$has_custom_theme = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $has_custom_theme ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$wp_scripts = wp_scripts();\n\n\t\t$wp_scripts->remove( 'wp-tinymce' );\n\t\twp_register_tinymce_scripts( $wp_scripts, true );\n\t}\n\n\t/**\n\t * Print (output) the main TinyMCE scripts.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @global bool $concatenate_scripts\n\t */\n\tpublic static function print_tinymce_scripts() {\n\t\tglobal $concatenate_scripts;\n\n\t\tif ( self::$tinymce_scripts_printed ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::$tinymce_scripts_printed = true;\n\n\t\tif ( ! isset( $concatenate_scripts ) ) {\n\t\t\tscript_concat_settings();\n\t\t}\n\n\t\twp_print_scripts( array( 'wp-tinymce' ) );\n\n\t\techo \"<script type='text/javascript'>\\n\" . self::wp_mce_translation() . \"</script>\\n\";\n\t}\n\n\t/**\n\t * Print (output) the TinyMCE configuration and initialization scripts.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @global string $tinymce_version\n\t */\n\tpublic static function editor_js() {\n\t\tglobal $tinymce_version;\n\n\t\t$tmce_on = ! empty( self::$mce_settings );\n\t\t$mceInit = '';\n\t\t$qtInit  = '';\n\n\t\tif ( $tmce_on ) {\n\t\t\tforeach ( self::$mce_settings as $editor_id => $init ) {\n\t\t\t\t$options  = self::_parse_init( $init );\n\t\t\t\t$mceInit .= \"'$editor_id':{$options},\";\n\t\t\t}\n\t\t\t$mceInit = '{' . trim( $mceInit, ',' ) . '}';\n\t\t} else {\n\t\t\t$mceInit = '{}';\n\t\t}\n\n\t\tif ( ! empty( self::$qt_settings ) ) {\n\t\t\tforeach ( self::$qt_settings as $editor_id => $init ) {\n\t\t\t\t$options = self::_parse_init( $init );\n\t\t\t\t$qtInit .= \"'$editor_id':{$options},\";\n\t\t\t}\n\t\t\t$qtInit = '{' . trim( $qtInit, ',' ) . '}';\n\t\t} else {\n\t\t\t$qtInit = '{}';\n\t\t}\n\n\t\t$ref = array(\n\t\t\t'plugins'  => implode( ',', self::$plugins ),\n\t\t\t'theme'    => 'modern',\n\t\t\t'language' => self::$mce_locale,\n\t\t);\n\n\t\t$suffix  = SCRIPT_DEBUG ? '' : '.min';\n\t\t$baseurl = self::get_baseurl();\n\t\t$version = 'ver=' . $tinymce_version;\n\n\t\t/**\n\t\t * Fires immediately before the TinyMCE settings are printed.\n\t\t *\n\t\t * @since 3.2.0\n\t\t *\n\t\t * @param array $mce_settings TinyMCE settings array.\n\t\t */\n\t\tdo_action( 'before_wp_tiny_mce', self::$mce_settings );\n\t\t?>\n\n\t\t<script type=\"text/javascript\">\n\t\ttinyMCEPreInit = {\n\t\t\tbaseURL: \"<?php echo $baseurl; ?>\",\n\t\t\tsuffix: \"<?php echo $suffix; ?>\",\n\t\t\t<?php\n\n\t\t\tif ( self::$drag_drop_upload ) {\n\t\t\t\techo 'dragDropUpload: true,';\n\t\t\t}\n\n\t\t\t?>\n\t\t\tmceInit: <?php echo $mceInit; ?>,\n\t\t\tqtInit: <?php echo $qtInit; ?>,\n\t\t\tref: <?php echo self::_parse_init( $ref ); ?>,\n\t\t\tload_ext: function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');}\n\t\t};\n\t\t</script>\n\t\t<?php\n\n\t\tif ( $tmce_on ) {\n\t\t\tself::print_tinymce_scripts();\n\n\t\t\tif ( self::$ext_plugins ) {\n\t\t\t\t// Load the old-format English strings to prevent unsightly labels in old style popups.\n\t\t\t\techo \"<script type='text/javascript' src='{$baseurl}/langs/wp-langs-en.js?$version'></script>\\n\";\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Fires after tinymce.js is loaded, but before any TinyMCE editor\n\t\t * instances are created.\n\t\t *\n\t\t * @since 3.9.0\n\t\t *\n\t\t * @param array $mce_settings TinyMCE settings array.\n\t\t */\n\t\tdo_action( 'wp_tiny_mce_init', self::$mce_settings );\n\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t<?php\n\n\t\tif ( self::$ext_plugins ) {\n\t\t\techo self::$ext_plugins . \"\\n\";\n\t\t}\n\n\t\tif ( ! is_admin() ) {\n\t\t\techo 'var ajaxurl = \"' . admin_url( 'admin-ajax.php', 'relative' ) . '\";';\n\t\t}\n\n\t\t?>\n\n\t\t( function() {\n\t\t\tvar init, id, $wrap;\n\n\t\t\tif ( typeof tinymce !== 'undefined' ) {\n\t\t\t\tif ( tinymce.Env.ie && tinymce.Env.ie < 11 ) {\n\t\t\t\t\ttinymce.$( '.wp-editor-wrap ' ).removeClass( 'tmce-active' ).addClass( 'html-active' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor ( id in tinyMCEPreInit.mceInit ) {\n\t\t\t\t\tinit = tinyMCEPreInit.mceInit[id];\n\t\t\t\t\t$wrap = tinymce.$( '#wp-' + id + '-wrap' );\n\n\t\t\t\t\tif ( ( $wrap.hasClass( 'tmce-active' ) || ! tinyMCEPreInit.qtInit.hasOwnProperty( id ) ) && ! init.wp_skip_init ) {\n\t\t\t\t\t\ttinymce.init( init );\n\n\t\t\t\t\t\tif ( ! window.wpActiveEditor ) {\n\t\t\t\t\t\t\twindow.wpActiveEditor = id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( typeof quicktags !== 'undefined' ) {\n\t\t\t\tfor ( id in tinyMCEPreInit.qtInit ) {\n\t\t\t\t\tquicktags( tinyMCEPreInit.qtInit[id] );\n\n\t\t\t\t\tif ( ! window.wpActiveEditor ) {\n\t\t\t\t\t\twindow.wpActiveEditor = id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}());\n\t\t</script>\n\t\t<?php\n\n\t\tif ( in_array( 'wplink', self::$plugins, true ) || in_array( 'link', self::$qt_buttons, true ) ) {\n\t\t\tself::wp_link_dialog();\n\t\t}\n\n\t\t/**\n\t\t * Fires after any core TinyMCE editor instances are created.\n\t\t *\n\t\t * @since 3.2.0\n\t\t *\n\t\t * @param array $mce_settings TinyMCE settings array.\n\t\t */\n\t\tdo_action( 'after_wp_tiny_mce', self::$mce_settings );\n\t}\n\n\t/**\n\t * Outputs the HTML for distraction-free writing mode.\n\t *\n\t * @since 3.2.0\n\t * @deprecated 4.3.0\n\t */\n\tpublic static function wp_fullscreen_html() {\n\t\t_deprecated_function( __FUNCTION__, '4.3.0' );\n\t}\n\n\t/**\n\t * Performs post queries for internal linking.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param array $args Optional. Accepts 'pagenum' and 's' (search) arguments.\n\t * @return array|false Results.\n\t */\n\tpublic static function wp_link_query( $args = array() ) {\n\t\t$pts      = get_post_types( array( 'public' => true ), 'objects' );\n\t\t$pt_names = array_keys( $pts );\n\n\t\t$query = array(\n\t\t\t'post_type'              => $pt_names,\n\t\t\t'suppress_filters'       => true,\n\t\t\t'update_post_term_cache' => false,\n\t\t\t'update_post_meta_cache' => false,\n\t\t\t'post_status'            => 'publish',\n\t\t\t'posts_per_page'         => 20,\n\t\t);\n\n\t\t$args['pagenum'] = isset( $args['pagenum'] ) ? absint( $args['pagenum'] ) : 1;\n\n\t\tif ( isset( $args['s'] ) ) {\n\t\t\t$query['s'] = $args['s'];\n\t\t}\n\n\t\t$query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0;\n\n\t\t/**\n\t\t * Filters the link query arguments.\n\t\t *\n\t\t * Allows modification of the link query arguments before querying.\n\t\t *\n\t\t * @see WP_Query for a full list of arguments\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param array $query An array of WP_Query arguments.\n\t\t */\n\t\t$query = apply_filters( 'wp_link_query_args', $query );\n\n\t\t// Do main query.\n\t\t$get_posts = new WP_Query;\n\t\t$posts     = $get_posts->query( $query );\n\n\t\t// Build results.\n\t\t$results = array();\n\t\tforeach ( $posts as $post ) {\n\t\t\tif ( 'post' === $post->post_type ) {\n\t\t\t\t$info = mysql2date( __( 'Y/m/d' ), $post->post_date );\n\t\t\t} else {\n\t\t\t\t$info = $pts[ $post->post_type ]->labels->singular_name;\n\t\t\t}\n\n\t\t\t$results[] = array(\n\t\t\t\t'ID'        => $post->ID,\n\t\t\t\t'title'     => trim( esc_html( strip_tags( get_the_title( $post ) ) ) ),\n\t\t\t\t'permalink' => get_permalink( $post->ID ),\n\t\t\t\t'info'      => $info,\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Filters the link query results.\n\t\t *\n\t\t * Allows modification of the returned link query results.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @see 'wp_link_query_args' filter\n\t\t *\n\t\t * @param array $results {\n\t\t *     An array of associative arrays of query results.\n\t\t *\n\t\t *     @type array ...$0 {\n\t\t *         @type int    $ID        Post ID.\n\t\t *         @type string $title     The trimmed, escaped post title.\n\t\t *         @type string $permalink Post permalink.\n\t\t *         @type string $info      A 'Y/m/d'-formatted date for 'post' post type,\n\t\t *                                 the 'singular_name' post type label otherwise.\n\t\t *     }\n\t\t * }\n\t\t * @param array $query  An array of WP_Query arguments.\n\t\t */\n\t\t$results = apply_filters( 'wp_link_query', $results, $query );\n\n\t\treturn ! empty( $results ) ? $results : false;\n\t}\n\n\t/**\n\t * Dialog for internal linking.\n\t *\n\t * @since 3.1.0\n\t */\n\tpublic static function wp_link_dialog() {\n\t\t// Run once.\n\t\tif ( self::$link_dialog_printed ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::$link_dialog_printed = true;\n\n\t\t// `display: none` is required here, see #WP27605.\n\t\t?>\n\t\t<div id=\"wp-link-backdrop\" style=\"display: none\"></div>\n\t\t<div id=\"wp-link-wrap\" class=\"wp-core-ui\" style=\"display: none\" role=\"dialog\" aria-labelledby=\"link-modal-title\">\n\t\t<form id=\"wp-link\" tabindex=\"-1\">\n\t\t<?php wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false ); ?>\n\t\t<h1 id=\"link-modal-title\"><?php _e( 'Insert/edit link' ); ?></h1>\n\t\t<button type=\"button\" id=\"wp-link-close\"><span class=\"screen-reader-text\"><?php _e( 'Close' ); ?></span></button>\n\t\t<div id=\"link-selector\">\n\t\t\t<div id=\"link-options\">\n\t\t\t\t<p class=\"howto\" id=\"wplink-enter-url\"><?php _e( 'Enter the destination URL' ); ?></p>\n\t\t\t\t<div>\n\t\t\t\t\t<label><span><?php _e( 'URL' ); ?></span>\n\t\t\t\t\t<input id=\"wp-link-url\" type=\"text\" aria-describedby=\"wplink-enter-url\" /></label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"wp-link-text-field\">\n\t\t\t\t\t<label><span><?php _e( 'Link Text' ); ?></span>\n\t\t\t\t\t<input id=\"wp-link-text\" type=\"text\" /></label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"link-target\">\n\t\t\t\t\t<label><span></span>\n\t\t\t\t\t<input type=\"checkbox\" id=\"wp-link-target\" /> <?php _e( 'Open link in a new tab' ); ?></label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<p class=\"howto\" id=\"wplink-link-existing-content\"><?php _e( 'Or link to existing content' ); ?></p>\n\t\t\t<div id=\"search-panel\">\n\t\t\t\t<div class=\"link-search-wrapper\">\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<span class=\"search-label\"><?php _e( 'Search' ); ?></span>\n\t\t\t\t\t\t<input type=\"search\" id=\"wp-link-search\" class=\"link-search-field\" autocomplete=\"off\" aria-describedby=\"wplink-link-existing-content\" />\n\t\t\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div id=\"search-results\" class=\"query-results\" tabindex=\"0\">\n\t\t\t\t\t<ul></ul>\n\t\t\t\t\t<div class=\"river-waiting\">\n\t\t\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div id=\"most-recent-results\" class=\"query-results\" tabindex=\"0\">\n\t\t\t\t\t<div class=\"query-notice\" id=\"query-notice-message\">\n\t\t\t\t\t\t<em class=\"query-notice-default\"><?php _e( 'No search term specified. Showing recent items.' ); ?></em>\n\t\t\t\t\t\t<em class=\"query-notice-hint screen-reader-text\"><?php _e( 'Search or use up and down arrow keys to select an item.' ); ?></em>\n\t\t\t\t\t</div>\n\t\t\t\t\t<ul></ul>\n\t\t\t\t\t<div class=\"river-waiting\">\n\t\t\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"submitbox\">\n\t\t\t<div id=\"wp-link-cancel\">\n\t\t\t\t<button type=\"button\" class=\"button\"><?php _e( 'Cancel' ); ?></button>\n\t\t\t</div>\n\t\t\t<div id=\"wp-link-update\">\n\t\t\t\t<input type=\"submit\" value=\"<?php esc_attr_e( 'Add Link' ); ?>\" class=\"button button-primary\" id=\"wp-link-submit\" name=\"wp-link-submit\">\n\t\t\t</div>\n\t\t</div>\n\t\t</form>\n\t\t</div>\n\t\t<?php\n\t}\n}\n", "num_lines": 1892}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * API for easily embedding rich media such as videos and images into content.\n *\n * @package WordPress\n * @subpackage Embed\n * @since 2.9.0\n */\nclass WP_Embed {\n\tpublic $handlers = array();\n\tpublic $post_ID;\n\tpublic $usecache      = true;\n\tpublic $linkifunknown = true;\n\tpublic $last_attr     = array();\n\tpublic $last_url      = '';\n\n\t/**\n\t * When a URL cannot be embedded, return false instead of returning a link\n\t * or the URL.\n\t *\n\t * Bypasses the {@see 'embed_maybe_make_link'} filter.\n\t *\n\t * @var bool\n\t */\n\tpublic $return_false_on_fail = false;\n\n\t/**\n\t * Constructor\n\t */\n\tpublic function __construct() {\n\t\t// Hack to get the [embed] shortcode to run before wpautop().\n\t\tadd_filter( 'the_content', array( $this, 'run_shortcode' ), 8 );\n\t\tadd_filter( 'widget_text_content', array( $this, 'run_shortcode' ), 8 );\n\n\t\t// Shortcode placeholder for strip_shortcodes().\n\t\tadd_shortcode( 'embed', '__return_false' );\n\n\t\t// Attempts to embed all URLs in a post.\n\t\tadd_filter( 'the_content', array( $this, 'autoembed' ), 8 );\n\t\tadd_filter( 'widget_text_content', array( $this, 'autoembed' ), 8 );\n\n\t\t// After a post is saved, cache oEmbed items via Ajax.\n\t\tadd_action( 'edit_form_advanced', array( $this, 'maybe_run_ajax_cache' ) );\n\t\tadd_action( 'edit_page_form', array( $this, 'maybe_run_ajax_cache' ) );\n\t}\n\n\t/**\n\t * Process the [embed] shortcode.\n\t *\n\t * Since the [embed] shortcode needs to be run earlier than other shortcodes,\n\t * this function removes all existing shortcodes, registers the [embed] shortcode,\n\t * calls do_shortcode(), and then re-registers the old shortcodes.\n\t *\n\t * @global array $shortcode_tags\n\t *\n\t * @param string $content Content to parse\n\t * @return string Content with shortcode parsed\n\t */\n\tpublic function run_shortcode( $content ) {\n\t\tglobal $shortcode_tags;\n\n\t\t// Back up current registered shortcodes and clear them all out.\n\t\t$orig_shortcode_tags = $shortcode_tags;\n\t\tremove_all_shortcodes();\n\n\t\tadd_shortcode( 'embed', array( $this, 'shortcode' ) );\n\n\t\t// Do the shortcode (only the [embed] one is registered).\n\t\t$content = do_shortcode( $content, true );\n\n\t\t// Put the original shortcodes back.\n\t\t$shortcode_tags = $orig_shortcode_tags;\n\n\t\treturn $content;\n\t}\n\n\t/**\n\t * If a post/page was saved, then output JavaScript to make\n\t * an Ajax request that will call WP_Embed::cache_oembed().\n\t */\n\tpublic function maybe_run_ajax_cache() {\n\t\t$post = get_post();\n\n\t\tif ( ! $post || empty( $_GET['message'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t?>\n<script type=\"text/javascript\">\n\tjQuery(document).ready(function($){\n\t\t$.get(\"<?php echo admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post->ID, 'relative' ); ?>\");\n\t});\n</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * Registers an embed handler.\n\t *\n\t * Do not use this function directly, use wp_embed_register_handler() instead.\n\t *\n\t * This function should probably also only be used for sites that do not support oEmbed.\n\t *\n\t * @param string   $id       An internal ID/name for the handler. Needs to be unique.\n\t * @param string   $regex    The regex that will be used to see if this handler should be used for a URL.\n\t * @param callable $callback The callback function that will be called if the regex is matched.\n\t * @param int      $priority Optional. Used to specify the order in which the registered handlers will be tested.\n\t *                           Lower numbers correspond with earlier testing, and handlers with the same priority are\n\t *                           tested in the order in which they were added to the action. Default 10.\n\t */\n\tpublic function register_handler( $id, $regex, $callback, $priority = 10 ) {\n\t\t$this->handlers[ $priority ][ $id ] = array(\n\t\t\t'regex'    => $regex,\n\t\t\t'callback' => $callback,\n\t\t);\n\t}\n\n\t/**\n\t * Unregisters a previously-registered embed handler.\n\t *\n\t * Do not use this function directly, use wp_embed_unregister_handler() instead.\n\t *\n\t * @param string $id       The handler ID that should be removed.\n\t * @param int    $priority Optional. The priority of the handler to be removed (default: 10).\n\t */\n\tpublic function unregister_handler( $id, $priority = 10 ) {\n\t\tunset( $this->handlers[ $priority ][ $id ] );\n\t}\n\n\t/**\n\t * Returns embed HTML for a given URL from embed handlers.\n\t *\n\t * Attempts to convert a URL into embed HTML by checking the URL\n\t * against the regex of the registered embed handlers.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param array  $attr {\n\t *     Shortcode attributes. Optional.\n\t *\n\t *     @type int $width  Width of the embed in pixels.\n\t *     @type int $height Height of the embed in pixels.\n\t * }\n\t * @param string $url The URL attempting to be embedded.\n\t * @return string|false The embed HTML on success, false otherwise.\n\t */\n\tpublic function get_embed_handler_html( $attr, $url ) {\n\t\t$rawattr = $attr;\n\t\t$attr    = wp_parse_args( $attr, wp_embed_defaults( $url ) );\n\n\t\tksort( $this->handlers );\n\t\tforeach ( $this->handlers as $priority => $handlers ) {\n\t\t\tforeach ( $handlers as $id => $handler ) {\n\t\t\t\tif ( preg_match( $handler['regex'], $url, $matches ) && is_callable( $handler['callback'] ) ) {\n\t\t\t\t\t$return = call_user_func( $handler['callback'], $matches, $attr, $url, $rawattr );\n\t\t\t\t\tif ( false !== $return ) {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Filters the returned embed HTML.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @since 2.9.0\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @see WP_Embed::shortcode()\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @param string|false $return The HTML result of the shortcode, or false on failure.\n\t\t\t\t\t\t * @param string       $url    The embed URL.\n\t\t\t\t\t\t * @param array        $attr   An array of shortcode attributes.\n\t\t\t\t\t\t */\n\t\t\t\t\t\treturn apply_filters( 'embed_handler_html', $return, $url, $attr );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * The do_shortcode() callback function.\n\t *\n\t * Attempts to convert a URL into embed HTML. Starts by checking the URL against the regex of\n\t * the registered embed handlers. If none of the regex matches and it's enabled, then the URL\n\t * will be given to the WP_oEmbed class.\n\t *\n\t * @param array  $attr {\n\t *     Shortcode attributes. Optional.\n\t *\n\t *     @type int $width  Width of the embed in pixels.\n\t *     @type int $height Height of the embed in pixels.\n\t * }\n\t * @param string $url The URL attempting to be embedded.\n\t * @return string|false The embed HTML on success, otherwise the original URL.\n\t *                      `->maybe_make_link()` can return false on failure.\n\t */\n\tpublic function shortcode( $attr, $url = '' ) {\n\t\t$post = get_post();\n\n\t\tif ( empty( $url ) && ! empty( $attr['src'] ) ) {\n\t\t\t$url = $attr['src'];\n\t\t}\n\n\t\t$this->last_url = $url;\n\n\t\tif ( empty( $url ) ) {\n\t\t\t$this->last_attr = $attr;\n\t\t\treturn '';\n\t\t}\n\n\t\t$rawattr = $attr;\n\t\t$attr    = wp_parse_args( $attr, wp_embed_defaults( $url ) );\n\n\t\t$this->last_attr = $attr;\n\n\t\t// KSES converts & into &amp; and we need to undo this.\n\t\t// See https://core.trac.wordpress.org/ticket/11311\n\t\t$url = str_replace( '&amp;', '&', $url );\n\n\t\t// Look for known internal handlers.\n\t\t$embed_handler_html = $this->get_embed_handler_html( $rawattr, $url );\n\t\tif ( false !== $embed_handler_html ) {\n\t\t\treturn $embed_handler_html;\n\t\t}\n\n\t\t$post_ID = ( ! empty( $post->ID ) ) ? $post->ID : null;\n\n\t\t// Potentially set by WP_Embed::cache_oembed().\n\t\tif ( ! empty( $this->post_ID ) ) {\n\t\t\t$post_ID = $this->post_ID;\n\t\t}\n\n\t\t// Check for a cached result (stored as custom post or in the post meta).\n\t\t$key_suffix    = md5( $url . serialize( $attr ) );\n\t\t$cachekey      = '_oembed_' . $key_suffix;\n\t\t$cachekey_time = '_oembed_time_' . $key_suffix;\n\n\t\t/**\n\t\t * Filters the oEmbed TTL value (time to live).\n\t\t *\n\t\t * @since 4.0.0\n\t\t *\n\t\t * @param int    $time    Time to live (in seconds).\n\t\t * @param string $url     The attempted embed URL.\n\t\t * @param array  $attr    An array of shortcode attributes.\n\t\t * @param int    $post_ID Post ID.\n\t\t */\n\t\t$ttl = apply_filters( 'oembed_ttl', DAY_IN_SECONDS, $url, $attr, $post_ID );\n\n\t\t$cache      = '';\n\t\t$cache_time = 0;\n\n\t\t$cached_post_id = $this->find_oembed_post_id( $key_suffix );\n\n\t\tif ( $post_ID ) {\n\t\t\t$cache      = get_post_meta( $post_ID, $cachekey, true );\n\t\t\t$cache_time = get_post_meta( $post_ID, $cachekey_time, true );\n\n\t\t\tif ( ! $cache_time ) {\n\t\t\t\t$cache_time = 0;\n\t\t\t}\n\t\t} elseif ( $cached_post_id ) {\n\t\t\t$cached_post = get_post( $cached_post_id );\n\n\t\t\t$cache      = $cached_post->post_content;\n\t\t\t$cache_time = strtotime( $cached_post->post_modified_gmt );\n\t\t}\n\n\t\t$cached_recently = ( time() - $cache_time ) < $ttl;\n\n\t\tif ( $this->usecache || $cached_recently ) {\n\t\t\t// Failures are cached. Serve one if we're using the cache.\n\t\t\tif ( '{{unknown}}' === $cache ) {\n\t\t\t\treturn $this->maybe_make_link( $url );\n\t\t\t}\n\n\t\t\tif ( ! empty( $cache ) ) {\n\t\t\t\t/**\n\t\t\t\t * Filters the cached oEmbed HTML.\n\t\t\t\t *\n\t\t\t\t * @since 2.9.0\n\t\t\t\t *\n\t\t\t\t * @see WP_Embed::shortcode()\n\t\t\t\t *\n\t\t\t\t * @param string|false $cache   The cached HTML result, stored in post meta.\n\t\t\t\t * @param string       $url     The attempted embed URL.\n\t\t\t\t * @param array        $attr    An array of shortcode attributes.\n\t\t\t\t * @param int          $post_ID Post ID.\n\t\t\t\t */\n\t\t\t\treturn apply_filters( 'embed_oembed_html', $cache, $url, $attr, $post_ID );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters whether to inspect the given URL for discoverable link tags.\n\t\t *\n\t\t * @since 2.9.0\n\t\t * @since 4.4.0 The default value changed to true.\n\t\t *\n\t\t * @see WP_oEmbed::discover()\n\t\t *\n\t\t * @param bool $enable Whether to enable `<link>` tag discovery. Default true.\n\t\t */\n\t\t$attr['discover'] = apply_filters( 'embed_oembed_discover', true );\n\n\t\t// Use oEmbed to get the HTML.\n\t\t$html = wp_oembed_get( $url, $attr );\n\n\t\tif ( $post_ID ) {\n\t\t\tif ( $html ) {\n\t\t\t\tupdate_post_meta( $post_ID, $cachekey, $html );\n\t\t\t\tupdate_post_meta( $post_ID, $cachekey_time, time() );\n\t\t\t} elseif ( ! $cache ) {\n\t\t\t\tupdate_post_meta( $post_ID, $cachekey, '{{unknown}}' );\n\t\t\t}\n\t\t} else {\n\t\t\t$has_kses = false !== has_filter( 'content_save_pre', 'wp_filter_post_kses' );\n\n\t\t\tif ( $has_kses ) {\n\t\t\t\t// Prevent KSES from corrupting JSON in post_content.\n\t\t\t\tkses_remove_filters();\n\t\t\t}\n\n\t\t\t$insert_post_args = array(\n\t\t\t\t'post_name'   => $key_suffix,\n\t\t\t\t'post_status' => 'publish',\n\t\t\t\t'post_type'   => 'oembed_cache',\n\t\t\t);\n\n\t\t\tif ( $html ) {\n\t\t\t\tif ( $cached_post_id ) {\n\t\t\t\t\twp_update_post(\n\t\t\t\t\t\twp_slash(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID'           => $cached_post_id,\n\t\t\t\t\t\t\t\t'post_content' => $html,\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} else {\n\t\t\t\t\twp_insert_post(\n\t\t\t\t\t\twp_slash(\n\t\t\t\t\t\t\tarray_merge(\n\t\t\t\t\t\t\t\t$insert_post_args,\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'post_content' => $html,\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\t\t\t} elseif ( ! $cache ) {\n\t\t\t\twp_insert_post(\n\t\t\t\t\twp_slash(\n\t\t\t\t\t\tarray_merge(\n\t\t\t\t\t\t\t$insert_post_args,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'post_content' => '{{unknown}}',\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\t\t\t}\n\n\t\t\tif ( $has_kses ) {\n\t\t\t\tkses_init_filters();\n\t\t\t}\n\t\t}\n\n\t\t// If there was a result, return it.\n\t\tif ( $html ) {\n\t\t\t/** This filter is documented in wp-includes/class-wp-embed.php */\n\t\t\treturn apply_filters( 'embed_oembed_html', $html, $url, $attr, $post_ID );\n\t\t}\n\n\t\t// Still unknown.\n\t\treturn $this->maybe_make_link( $url );\n\t}\n\n\t/**\n\t * Delete all oEmbed caches. Unused by core as of 4.0.0.\n\t *\n\t * @param int $post_ID Post ID to delete the caches for.\n\t */\n\tpublic function delete_oembed_caches( $post_ID ) {\n\t\t$post_metas = get_post_custom_keys( $post_ID );\n\t\tif ( empty( $post_metas ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $post_metas as $post_meta_key ) {\n\t\t\tif ( '_oembed_' === substr( $post_meta_key, 0, 8 ) ) {\n\t\t\t\tdelete_post_meta( $post_ID, $post_meta_key );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Triggers a caching of all oEmbed results.\n\t *\n\t * @param int $post_ID Post ID to do the caching for.\n\t */\n\tpublic function cache_oembed( $post_ID ) {\n\t\t$post = get_post( $post_ID );\n\n\t\t$post_types = get_post_types( array( 'show_ui' => true ) );\n\n\t\t/**\n\t\t * Filters the array of post types to cache oEmbed results for.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param string[] $post_types Array of post type names to cache oEmbed results for. Defaults to post types with `show_ui` set to true.\n\t\t */\n\t\t$cache_oembed_types = apply_filters( 'embed_cache_oembed_types', $post_types );\n\n\t\tif ( empty( $post->ID ) || ! in_array( $post->post_type, $cache_oembed_types, true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Trigger a caching.\n\t\tif ( ! empty( $post->post_content ) ) {\n\t\t\t$this->post_ID  = $post->ID;\n\t\t\t$this->usecache = false;\n\n\t\t\t$content = $this->run_shortcode( $post->post_content );\n\t\t\t$this->autoembed( $content );\n\n\t\t\t$this->usecache = true;\n\t\t}\n\t}\n\n\t/**\n\t * Passes any unlinked URLs that are on their own line to WP_Embed::shortcode() for potential embedding.\n\t *\n\t * @see WP_Embed::autoembed_callback()\n\t *\n\t * @param string $content The content to be searched.\n\t * @return string Potentially modified $content.\n\t */\n\tpublic function autoembed( $content ) {\n\t\t// Replace line breaks from all HTML elements with placeholders.\n\t\t$content = wp_replace_in_html_tags( $content, array( \"\\n\" => '<!-- wp-line-break -->' ) );\n\n\t\tif ( preg_match( '#(^|\\s|>)https?://#i', $content ) ) {\n\t\t\t// Find URLs on their own line.\n\t\t\t$content = preg_replace_callback( '|^(\\s*)(https?://[^\\s<>\"]+)(\\s*)$|im', array( $this, 'autoembed_callback' ), $content );\n\t\t\t// Find URLs in their own paragraph.\n\t\t\t$content = preg_replace_callback( '|(<p(?: [^>]*)?>\\s*)(https?://[^\\s<>\"]+)(\\s*<\\/p>)|i', array( $this, 'autoembed_callback' ), $content );\n\t\t}\n\n\t\t// Put the line breaks back.\n\t\treturn str_replace( '<!-- wp-line-break -->', \"\\n\", $content );\n\t}\n\n\t/**\n\t * Callback function for WP_Embed::autoembed().\n\t *\n\t * @param array $match A regex match array.\n\t * @return string The embed HTML on success, otherwise the original URL.\n\t */\n\tpublic function autoembed_callback( $match ) {\n\t\t$oldval              = $this->linkifunknown;\n\t\t$this->linkifunknown = false;\n\t\t$return              = $this->shortcode( array(), $match[2] );\n\t\t$this->linkifunknown = $oldval;\n\n\t\treturn $match[1] . $return . $match[3];\n\t}\n\n\t/**\n\t * Conditionally makes a hyperlink based on an internal class variable.\n\t *\n\t * @param string $url URL to potentially be linked.\n\t * @return string|false Linked URL or the original URL. False if 'return_false_on_fail' is true.\n\t */\n\tpublic function maybe_make_link( $url ) {\n\t\tif ( $this->return_false_on_fail ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$output = ( $this->linkifunknown ) ? '<a href=\"' . esc_url( $url ) . '\">' . esc_html( $url ) . '</a>' : $url;\n\n\t\t/**\n\t\t * Filters the returned, maybe-linked embed URL.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param string $output The linked or original URL.\n\t\t * @param string $url    The original URL.\n\t\t */\n\t\treturn apply_filters( 'embed_maybe_make_link', $output, $url );\n\t}\n\n\t/**\n\t * Find the oEmbed cache post ID for a given cache key.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param string $cache_key oEmbed cache key.\n\t * @return int|null Post ID on success, null on failure.\n\t */\n\tpublic function find_oembed_post_id( $cache_key ) {\n\t\t$cache_group    = 'oembed_cache_post';\n\t\t$oembed_post_id = wp_cache_get( $cache_key, $cache_group );\n\n\t\tif ( $oembed_post_id && 'oembed_cache' === get_post_type( $oembed_post_id ) ) {\n\t\t\treturn $oembed_post_id;\n\t\t}\n\n\t\t$oembed_post_query = new WP_Query(\n\t\t\tarray(\n\t\t\t\t'post_type'              => 'oembed_cache',\n\t\t\t\t'post_status'            => 'publish',\n\t\t\t\t'name'                   => $cache_key,\n\t\t\t\t'posts_per_page'         => 1,\n\t\t\t\t'no_found_rows'          => true,\n\t\t\t\t'cache_results'          => true,\n\t\t\t\t'update_post_meta_cache' => false,\n\t\t\t\t'update_post_term_cache' => false,\n\t\t\t\t'lazy_load_term_meta'    => false,\n\t\t\t)\n\t\t);\n\n\t\tif ( ! empty( $oembed_post_query->posts ) ) {\n\t\t\t// Note: 'fields' => 'ids' is not being used in order to cache the post object as it will be needed.\n\t\t\t$oembed_post_id = $oembed_post_query->posts[0]->ID;\n\t\t\twp_cache_set( $cache_key, $oembed_post_id, $cache_group );\n\n\t\t\treturn $oembed_post_id;\n\t\t}\n\n\t\treturn null;\n\t}\n}\n", "num_lines": 533}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Error API.\n *\n * Contains the WP_Error class and the is_wp_error() function.\n *\n * @package WordPress\n */\n\n/**\n * WordPress Error class.\n *\n * Container for checking for WordPress errors and error messages. Return\n * WP_Error and use is_wp_error() to check if this class is returned. Many\n * core WordPress functions pass this class in the event of an error and\n * if not handled properly will result in code errors.\n *\n * @since 2.1.0\n */\nclass WP_Error {\n\t/**\n\t * Stores the list of errors.\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t */\n\tpublic $errors = array();\n\n\t/**\n\t * Stores the list of data for error codes.\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t */\n\tpublic $error_data = array();\n\n\t/**\n\t * Initialize the error.\n\t *\n\t * If `$code` is empty, the other parameters will be ignored.\n\t * When `$code` is not empty, `$message` will be used even if\n\t * it is empty. The `$data` parameter will be used only if it\n\t * is not empty.\n\t *\n\t * Though the class is constructed with a single error code and\n\t * message, multiple codes can be added using the `add()` method.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string|int $code    Error code.\n\t * @param string     $message Error message.\n\t * @param mixed      $data    Optional. Error data.\n\t */\n\tpublic function __construct( $code = '', $message = '', $data = '' ) {\n\t\tif ( empty( $code ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->errors[ $code ][] = $message;\n\n\t\tif ( ! empty( $data ) ) {\n\t\t\t$this->error_data[ $code ] = $data;\n\t\t}\n\t}\n\n\t/**\n\t * Retrieve all error codes.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @return array List of error codes, if available.\n\t */\n\tpublic function get_error_codes() {\n\t\tif ( ! $this->has_errors() ) {\n\t\t\treturn array();\n\t\t}\n\n\t\treturn array_keys( $this->errors );\n\t}\n\n\t/**\n\t * Retrieve first error code available.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @return string|int Empty string, if no error codes.\n\t */\n\tpublic function get_error_code() {\n\t\t$codes = $this->get_error_codes();\n\n\t\tif ( empty( $codes ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $codes[0];\n\t}\n\n\t/**\n\t * Retrieve all error messages or error messages matching code.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string|int $code Optional. Retrieve messages matching code, if exists.\n\t * @return array Error strings on success, or empty array on failure (if using code parameter).\n\t */\n\tpublic function get_error_messages( $code = '' ) {\n\t\t// Return all messages if no code specified.\n\t\tif ( empty( $code ) ) {\n\t\t\t$all_messages = array();\n\t\t\tforeach ( (array) $this->errors as $code => $messages ) {\n\t\t\t\t$all_messages = array_merge( $all_messages, $messages );\n\t\t\t}\n\n\t\t\treturn $all_messages;\n\t\t}\n\n\t\tif ( isset( $this->errors[ $code ] ) ) {\n\t\t\treturn $this->errors[ $code ];\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t}\n\n\t/**\n\t * Get single error message.\n\t *\n\t * This will get the first message available for the code. If no code is\n\t * given then the first code available will be used.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string|int $code Optional. Error code to retrieve message.\n\t * @return string\n\t */\n\tpublic function get_error_message( $code = '' ) {\n\t\tif ( empty( $code ) ) {\n\t\t\t$code = $this->get_error_code();\n\t\t}\n\t\t$messages = $this->get_error_messages( $code );\n\t\tif ( empty( $messages ) ) {\n\t\t\treturn '';\n\t\t}\n\t\treturn $messages[0];\n\t}\n\n\t/**\n\t * Retrieve error data for error code.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string|int $code Optional. Error code.\n\t * @return mixed Error data, if it exists.\n\t */\n\tpublic function get_error_data( $code = '' ) {\n\t\tif ( empty( $code ) ) {\n\t\t\t$code = $this->get_error_code();\n\t\t}\n\n\t\tif ( isset( $this->error_data[ $code ] ) ) {\n\t\t\treturn $this->error_data[ $code ];\n\t\t}\n\t}\n\n\t/**\n\t * Verify if the instance contains errors.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @return bool\n\t */\n\tpublic function has_errors() {\n\t\tif ( ! empty( $this->errors ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Add an error or append additional message to an existing error.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string|int $code    Error code.\n\t * @param string     $message Error message.\n\t * @param mixed      $data    Optional. Error data.\n\t */\n\tpublic function add( $code, $message, $data = '' ) {\n\t\t$this->errors[ $code ][] = $message;\n\t\tif ( ! empty( $data ) ) {\n\t\t\t$this->error_data[ $code ] = $data;\n\t\t}\n\t}\n\n\t/**\n\t * Add data for error code.\n\t *\n\t * The error code can only contain one error data.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param mixed      $data Error data.\n\t * @param string|int $code Error code.\n\t */\n\tpublic function add_data( $data, $code = '' ) {\n\t\tif ( empty( $code ) ) {\n\t\t\t$code = $this->get_error_code();\n\t\t}\n\n\t\t$this->error_data[ $code ] = $data;\n\t}\n\n\t/**\n\t * Removes the specified error.\n\t *\n\t * This function removes all error messages associated with the specified\n\t * error code, along with any error data for that code.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param string|int $code Error code.\n\t */\n\tpublic function remove( $code ) {\n\t\tunset( $this->errors[ $code ] );\n\t\tunset( $this->error_data[ $code ] );\n\t}\n}\n", "num_lines": 227}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Error Protection API: WP_Fatal_Error_Handler class\n *\n * @package WordPress\n * @since 5.2.0\n */\n\n/**\n * Core class used as the default shutdown handler for fatal errors.\n *\n * A drop-in 'fatal-error-handler.php' can be used to override the instance of this class and use a custom\n * implementation for the fatal error handler that WordPress registers. The custom class should extend this class and\n * can override its methods individually as necessary. The file must return the instance of the class that should be\n * registered.\n *\n * @since 5.2.0\n */\nclass WP_Fatal_Error_Handler {\n\n\t/**\n\t * Runs the shutdown handler.\n\t *\n\t * This method is registered via `register_shutdown_function()`.\n\t *\n\t * @since 5.2.0\n\t */\n\tpublic function handle() {\n\t\tif ( defined( 'WP_SANDBOX_SCRAPING' ) && WP_SANDBOX_SCRAPING ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Do not trigger the fatal error handler while updates are being installed.\n\t\tif ( wp_is_maintenance_mode() ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\t// Bail if no error found.\n\t\t\t$error = $this->detect_error();\n\t\t\tif ( ! $error ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! isset( $GLOBALS['wp_locale'] ) && function_exists( 'load_default_textdomain' ) ) {\n\t\t\t\tload_default_textdomain();\n\t\t\t}\n\n\t\t\t$handled = false;\n\n\t\t\tif ( ! is_multisite() && wp_recovery_mode()->is_initialized() ) {\n\t\t\t\t$handled = wp_recovery_mode()->handle_error( $error );\n\t\t\t}\n\n\t\t\t// Display the PHP error template if headers not sent.\n\t\t\tif ( is_admin() || ! headers_sent() ) {\n\t\t\t\t$this->display_error_template( $error, $handled );\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\t// Catch exceptions and remain silent.\n\t\t}\n\t}\n\n\t/**\n\t * Detects the error causing the crash if it should be handled.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array|null Error that was triggered, or null if no error received or if the error should not be handled.\n\t */\n\tprotected function detect_error() {\n\t\t$error = error_get_last();\n\n\t\t// No error, just skip the error handling code.\n\t\tif ( null === $error ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Bail if this error should not be handled.\n\t\tif ( ! $this->should_handle_error( $error ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $error;\n\t}\n\n\t/**\n\t * Determines whether we are dealing with an error that WordPress should handle\n\t * in order to protect the admin backend against WSODs.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param array $error Error information retrieved from error_get_last().\n\t * @return bool Whether WordPress should handle this error.\n\t */\n\tprotected function should_handle_error( $error ) {\n\t\t$error_types_to_handle = array(\n\t\t\tE_ERROR,\n\t\t\tE_PARSE,\n\t\t\tE_USER_ERROR,\n\t\t\tE_COMPILE_ERROR,\n\t\t\tE_RECOVERABLE_ERROR,\n\t\t);\n\n\t\tif ( isset( $error['type'] ) && in_array( $error['type'], $error_types_to_handle, true ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * Filters whether a given thrown error should be handled by the fatal error handler.\n\t\t *\n\t\t * This filter is only fired if the error is not already configured to be handled by WordPress core. As such,\n\t\t * it exclusively allows adding further rules for which errors should be handled, but not removing existing\n\t\t * ones.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param bool  $should_handle_error Whether the error should be handled by the fatal error handler.\n\t\t * @param array $error               Error information retrieved from error_get_last().\n\t\t */\n\t\treturn (bool) apply_filters( 'wp_should_handle_php_error', false, $error );\n\t}\n\n\t/**\n\t * Displays the PHP error template and sends the HTTP status code, typically 500.\n\t *\n\t * A drop-in 'php-error.php' can be used as a custom template. This drop-in should control the HTTP status code and\n\t * print the HTML markup indicating that a PHP error occurred. Note that this drop-in may potentially be executed\n\t * very early in the WordPress bootstrap process, so any core functions used that are not part of\n\t * `wp-includes/load.php` should be checked for before being called.\n\t *\n\t * If no such drop-in is available, this will call {@see WP_Fatal_Error_Handler::display_default_error_template()}.\n\t *\n\t * @since 5.2.0\n\t * @since 5.3.0 The `$handled` parameter was added.\n\t *\n\t * @param array         $error   Error information retrieved from `error_get_last()`.\n\t * @param true|WP_Error $handled Whether Recovery Mode handled the fatal error.\n\t */\n\tprotected function display_error_template( $error, $handled ) {\n\t\tif ( defined( 'WP_CONTENT_DIR' ) ) {\n\t\t\t// Load custom PHP error template, if present.\n\t\t\t$php_error_pluggable = WP_CONTENT_DIR . '/php-error.php';\n\t\t\tif ( is_readable( $php_error_pluggable ) ) {\n\t\t\t\trequire_once $php_error_pluggable;\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Otherwise, display the default error template.\n\t\t$this->display_default_error_template( $error, $handled );\n\t}\n\n\t/**\n\t * Displays the default PHP error template.\n\t *\n\t * This method is called conditionally if no 'php-error.php' drop-in is available.\n\t *\n\t * It calls {@see wp_die()} with a message indicating that the site is experiencing technical difficulties and a\n\t * login link to the admin backend. The {@see 'wp_php_error_message'} and {@see 'wp_php_error_args'} filters can\n\t * be used to modify these parameters.\n\t *\n\t * @since 5.2.0\n\t * @since 5.3.0 The `$handled` parameter was added.\n\t *\n\t * @param array         $error   Error information retrieved from `error_get_last()`.\n\t * @param true|WP_Error $handled Whether Recovery Mode handled the fatal error.\n\t */\n\tprotected function display_default_error_template( $error, $handled ) {\n\t\tif ( ! function_exists( '__' ) ) {\n\t\t\twp_load_translations_early();\n\t\t}\n\n\t\tif ( ! function_exists( 'wp_die' ) ) {\n\t\t\trequire_once ABSPATH . WPINC . '/functions.php';\n\t\t}\n\n\t\tif ( ! class_exists( 'WP_Error' ) ) {\n\t\t\trequire_once ABSPATH . WPINC . '/class-wp-error.php';\n\t\t}\n\n\t\tif ( true === $handled && wp_is_recovery_mode() ) {\n\t\t\t$message = __( 'There has been a critical error on your website, putting it in recovery mode. Please check the Themes and Plugins screens for more details. If you just installed or updated a theme or plugin, check the relevant page for that first.' );\n\t\t} elseif ( is_protected_endpoint() ) {\n\t\t\t$message = __( 'There has been a critical error on your website. Please check your site admin email inbox for instructions.' );\n\t\t} else {\n\t\t\t$message = __( 'There has been a critical error on your website.' );\n\t\t}\n\n\t\t$message = sprintf(\n\t\t\t'<p>%s</p><p><a href=\"%s\">%s</a></p>',\n\t\t\t$message,\n\t\t\t/* translators: Documentation explaining debugging in WordPress. */\n\t\t\t__( 'https://wordpress.org/support/article/debugging-in-wordpress/' ),\n\t\t\t__( 'Learn more about debugging in WordPress.' )\n\t\t);\n\n\t\t$args = array(\n\t\t\t'response' => 500,\n\t\t\t'exit'     => false,\n\t\t);\n\n\t\t/**\n\t\t * Filters the message that the default PHP error template displays.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param string $message HTML error message to display.\n\t\t * @param array  $error   Error information retrieved from `error_get_last()`.\n\t\t */\n\t\t$message = apply_filters( 'wp_php_error_message', $message, $error );\n\n\t\t/**\n\t\t * Filters the arguments passed to {@see wp_die()} for the default PHP error template.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param array $args Associative array of arguments passed to `wp_die()`. By default these contain a\n\t\t *                    'response' key, and optionally 'link_url' and 'link_text' keys.\n\t\t * @param array $error Error information retrieved from `error_get_last()`.\n\t\t */\n\t\t$args = apply_filters( 'wp_php_error_args', $args, $error );\n\n\t\t$wp_error = new WP_Error(\n\t\t\t'internal_server_error',\n\t\t\t$message,\n\t\t\tarray(\n\t\t\t\t'error' => $error,\n\t\t\t)\n\t\t);\n\n\t\twp_die( $wp_error, '', $args );\n\t}\n}\n", "num_lines": 236}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Feed API: WP_Feed_Cache_Transient class\n *\n * @package WordPress\n * @subpackage Feed\n * @since 4.7.0\n */\n\n/**\n * Core class used to implement feed cache transients.\n *\n * @since 2.8.0\n */\nclass WP_Feed_Cache_Transient {\n\n\t/**\n\t * Holds the transient name.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $name;\n\n\t/**\n\t * Holds the transient mod name.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $mod_name;\n\n\t/**\n\t * Holds the cache duration in seconds.\n\t *\n\t * Defaults to 43200 seconds (12 hours).\n\t *\n\t * @since 2.8.0\n\t * @var int\n\t */\n\tpublic $lifetime = 43200;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 2.8.0\n\t * @since 3.2.0 Updated to use a PHP5 constructor.\n\t *\n\t * @param string $location  URL location (scheme is used to determine handler).\n\t * @param string $filename  Unique identifier for cache object.\n\t * @param string $extension 'spi' or 'spc'.\n\t */\n\tpublic function __construct( $location, $filename, $extension ) {\n\t\t$this->name     = 'feed_' . $filename;\n\t\t$this->mod_name = 'feed_mod_' . $filename;\n\n\t\t$lifetime = $this->lifetime;\n\t\t/**\n\t\t * Filters the transient lifetime of the feed cache.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param int    $lifetime Cache duration in seconds. Default is 43200 seconds (12 hours).\n\t\t * @param string $filename Unique identifier for the cache object.\n\t\t */\n\t\t$this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $filename );\n\t}\n\n\t/**\n\t * Sets the transient.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param SimplePie $data Data to save.\n\t * @return true Always true.\n\t */\n\tpublic function save( $data ) {\n\t\tif ( $data instanceof SimplePie ) {\n\t\t\t$data = $data->data;\n\t\t}\n\n\t\tset_transient( $this->name, $data, $this->lifetime );\n\t\tset_transient( $this->mod_name, time(), $this->lifetime );\n\t\treturn true;\n\t}\n\n\t/**\n\t * Gets the transient.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return mixed Transient value.\n\t */\n\tpublic function load() {\n\t\treturn get_transient( $this->name );\n\t}\n\n\t/**\n\t * Gets mod transient.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return mixed Transient value.\n\t */\n\tpublic function mtime() {\n\t\treturn get_transient( $this->mod_name );\n\t}\n\n\t/**\n\t * Sets mod transient.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return bool False if value was not set and true if value was set.\n\t */\n\tpublic function touch() {\n\t\treturn set_transient( $this->mod_name, time(), $this->lifetime );\n\t}\n\n\t/**\n\t * Deletes transients.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return true Always true.\n\t */\n\tpublic function unlink() {\n\t\tdelete_transient( $this->name );\n\t\tdelete_transient( $this->mod_name );\n\t\treturn true;\n\t}\n}\n", "num_lines": 133}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Feed API: WP_Feed_Cache class\n *\n * @package WordPress\n * @subpackage Feed\n * @since 4.7.0\n */\n\n/**\n * Core class used to implement a feed cache.\n *\n * @since 2.8.0\n *\n * @see SimplePie_Cache\n */\nclass WP_Feed_Cache extends SimplePie_Cache {\n\n\t/**\n\t * Creates a new SimplePie_Cache object.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $location  URL location (scheme is used to determine handler).\n\t * @param string $filename  Unique identifier for cache object.\n\t * @param string $extension 'spi' or 'spc'.\n\t * @return WP_Feed_Cache_Transient Feed cache handler object that uses transients.\n\t */\n\tpublic function create( $location, $filename, $extension ) {\n\t\treturn new WP_Feed_Cache_Transient( $location, $filename, $extension );\n\t}\n}\n", "num_lines": 33}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Plugin API: WP_Hook class\n *\n * @package WordPress\n * @subpackage Plugin\n * @since 4.7.0\n */\n\n/**\n * Core class used to implement action and filter hook functionality.\n *\n * @since 4.7.0\n *\n * @see Iterator\n * @see ArrayAccess\n */\nfinal class WP_Hook implements Iterator, ArrayAccess {\n\n\t/**\n\t * Hook callbacks.\n\t *\n\t * @since 4.7.0\n\t * @var array\n\t */\n\tpublic $callbacks = array();\n\n\t/**\n\t * The priority keys of actively running iterations of a hook.\n\t *\n\t * @since 4.7.0\n\t * @var array\n\t */\n\tprivate $iterations = array();\n\n\t/**\n\t * The current priority of actively running iterations of a hook.\n\t *\n\t * @since 4.7.0\n\t * @var array\n\t */\n\tprivate $current_priority = array();\n\n\t/**\n\t * Number of levels this hook can be recursively called.\n\t *\n\t * @since 4.7.0\n\t * @var int\n\t */\n\tprivate $nesting_level = 0;\n\n\t/**\n\t * Flag for if we're current doing an action, rather than a filter.\n\t *\n\t * @since 4.7.0\n\t * @var bool\n\t */\n\tprivate $doing_action = false;\n\n\t/**\n\t * Hooks a function or method to a specific filter action.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string   $tag             The name of the filter to hook the $function_to_add callback to.\n\t * @param callable $function_to_add The callback to be run when the filter is applied.\n\t * @param int      $priority        The order in which the functions associated with a particular action\n\t *                                  are executed. Lower numbers correspond with earlier execution,\n\t *                                  and functions with the same priority are executed in the order\n\t *                                  in which they were added to the action.\n\t * @param int      $accepted_args   The number of arguments the function accepts.\n\t */\n\tpublic function add_filter( $tag, $function_to_add, $priority, $accepted_args ) {\n\t\t$idx = _wp_filter_build_unique_id( $tag, $function_to_add, $priority );\n\n\t\t$priority_existed = isset( $this->callbacks[ $priority ] );\n\n\t\t$this->callbacks[ $priority ][ $idx ] = array(\n\t\t\t'function'      => $function_to_add,\n\t\t\t'accepted_args' => $accepted_args,\n\t\t);\n\n\t\t// If we're adding a new priority to the list, put them back in sorted order.\n\t\tif ( ! $priority_existed && count( $this->callbacks ) > 1 ) {\n\t\t\tksort( $this->callbacks, SORT_NUMERIC );\n\t\t}\n\n\t\tif ( $this->nesting_level > 0 ) {\n\t\t\t$this->resort_active_iterations( $priority, $priority_existed );\n\t\t}\n\t}\n\n\t/**\n\t * Handles resetting callback priority keys mid-iteration.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param bool|int $new_priority     Optional. The priority of the new filter being added. Default false,\n\t *                                   for no priority being added.\n\t * @param bool     $priority_existed Optional. Flag for whether the priority already existed before the new\n\t *                                   filter was added. Default false.\n\t */\n\tprivate function resort_active_iterations( $new_priority = false, $priority_existed = false ) {\n\t\t$new_priorities = array_keys( $this->callbacks );\n\n\t\t// If there are no remaining hooks, clear out all running iterations.\n\t\tif ( ! $new_priorities ) {\n\t\t\tforeach ( $this->iterations as $index => $iteration ) {\n\t\t\t\t$this->iterations[ $index ] = $new_priorities;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t$min = min( $new_priorities );\n\t\tforeach ( $this->iterations as $index => &$iteration ) {\n\t\t\t$current = current( $iteration );\n\t\t\t// If we're already at the end of this iteration, just leave the array pointer where it is.\n\t\t\tif ( false === $current ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$iteration = $new_priorities;\n\n\t\t\tif ( $current < $min ) {\n\t\t\t\tarray_unshift( $iteration, $current );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\twhile ( current( $iteration ) < $current ) {\n\t\t\t\tif ( false === next( $iteration ) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we have a new priority that didn't exist, but ::apply_filters() or ::do_action() thinks it's the current priority...\n\t\t\tif ( $new_priority === $this->current_priority[ $index ] && ! $priority_existed ) {\n\t\t\t\t/*\n\t\t\t\t * ...and the new priority is the same as what $this->iterations thinks is the previous\n\t\t\t\t * priority, we need to move back to it.\n\t\t\t\t */\n\n\t\t\t\tif ( false === current( $iteration ) ) {\n\t\t\t\t\t// If we've already moved off the end of the array, go back to the last element.\n\t\t\t\t\t$prev = end( $iteration );\n\t\t\t\t} else {\n\t\t\t\t\t// Otherwise, just go back to the previous element.\n\t\t\t\t\t$prev = prev( $iteration );\n\t\t\t\t}\n\t\t\t\tif ( false === $prev ) {\n\t\t\t\t\t// Start of the array. Reset, and go about our day.\n\t\t\t\t\treset( $iteration );\n\t\t\t\t} elseif ( $new_priority !== $prev ) {\n\t\t\t\t\t// Previous wasn't the same. Move forward again.\n\t\t\t\t\tnext( $iteration );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tunset( $iteration );\n\t}\n\n\t/**\n\t * Unhooks a function or method from a specific filter action.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string   $tag                The filter hook to which the function to be removed is hooked.\n\t * @param callable $function_to_remove The callback to be removed from running when the filter is applied.\n\t * @param int      $priority           The exact priority used when adding the original filter callback.\n\t * @return bool Whether the callback existed before it was removed.\n\t */\n\tpublic function remove_filter( $tag, $function_to_remove, $priority ) {\n\t\t$function_key = _wp_filter_build_unique_id( $tag, $function_to_remove, $priority );\n\n\t\t$exists = isset( $this->callbacks[ $priority ][ $function_key ] );\n\t\tif ( $exists ) {\n\t\t\tunset( $this->callbacks[ $priority ][ $function_key ] );\n\t\t\tif ( ! $this->callbacks[ $priority ] ) {\n\t\t\t\tunset( $this->callbacks[ $priority ] );\n\t\t\t\tif ( $this->nesting_level > 0 ) {\n\t\t\t\t\t$this->resort_active_iterations();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $exists;\n\t}\n\n\t/**\n\t * Checks if a specific action has been registered for this hook.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string        $tag               Optional. The name of the filter hook. Default empty.\n\t * @param callable|bool $function_to_check Optional. The callback to check for. Default false.\n\t * @return bool|int The priority of that hook is returned, or false if the function is not attached.\n\t */\n\tpublic function has_filter( $tag = '', $function_to_check = false ) {\n\t\tif ( false === $function_to_check ) {\n\t\t\treturn $this->has_filters();\n\t\t}\n\n\t\t$function_key = _wp_filter_build_unique_id( $tag, $function_to_check, false );\n\t\tif ( ! $function_key ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ( $this->callbacks as $priority => $callbacks ) {\n\t\t\tif ( isset( $callbacks[ $function_key ] ) ) {\n\t\t\t\treturn $priority;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks if any callbacks have been registered for this hook.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return bool True if callbacks have been registered for the current hook, otherwise false.\n\t */\n\tpublic function has_filters() {\n\t\tforeach ( $this->callbacks as $callbacks ) {\n\t\t\tif ( $callbacks ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Removes all callbacks from the current filter.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param int|bool $priority Optional. The priority number to remove. Default false.\n\t */\n\tpublic function remove_all_filters( $priority = false ) {\n\t\tif ( ! $this->callbacks ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( false === $priority ) {\n\t\t\t$this->callbacks = array();\n\t\t} elseif ( isset( $this->callbacks[ $priority ] ) ) {\n\t\t\tunset( $this->callbacks[ $priority ] );\n\t\t}\n\n\t\tif ( $this->nesting_level > 0 ) {\n\t\t\t$this->resort_active_iterations();\n\t\t}\n\t}\n\n\t/**\n\t * Calls the callback functions that have been added to a filter hook.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param mixed $value The value to filter.\n\t * @param array $args  Additional parameters to pass to the callback functions.\n\t *                     This array is expected to include $value at index 0.\n\t * @return mixed The filtered value after all hooked functions are applied to it.\n\t */\n\tpublic function apply_filters( $value, $args ) {\n\t\tif ( ! $this->callbacks ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\t$nesting_level = $this->nesting_level++;\n\n\t\t$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );\n\t\t$num_args                           = count( $args );\n\n\t\tdo {\n\t\t\t$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );\n\t\t\t$priority                                 = $this->current_priority[ $nesting_level ];\n\n\t\t\tforeach ( $this->callbacks[ $priority ] as $the_ ) {\n\t\t\t\tif ( ! $this->doing_action ) {\n\t\t\t\t\t$args[0] = $value;\n\t\t\t\t}\n\n\t\t\t\t// Avoid the array_slice() if possible.\n\t\t\t\tif ( 0 == $the_['accepted_args'] ) {\n\t\t\t\t\t$value = call_user_func( $the_['function'] );\n\t\t\t\t} elseif ( $the_['accepted_args'] >= $num_args ) {\n\t\t\t\t\t$value = call_user_func_array( $the_['function'], $args );\n\t\t\t\t} else {\n\t\t\t\t\t$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );\n\t\t\t\t}\n\t\t\t}\n\t\t} while ( false !== next( $this->iterations[ $nesting_level ] ) );\n\n\t\tunset( $this->iterations[ $nesting_level ] );\n\t\tunset( $this->current_priority[ $nesting_level ] );\n\n\t\t$this->nesting_level--;\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Calls the callback functions that have been added to an action hook.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $args Parameters to pass to the callback functions.\n\t */\n\tpublic function do_action( $args ) {\n\t\t$this->doing_action = true;\n\t\t$this->apply_filters( '', $args );\n\n\t\t// If there are recursive calls to the current action, we haven't finished it until we get to the last one.\n\t\tif ( ! $this->nesting_level ) {\n\t\t\t$this->doing_action = false;\n\t\t}\n\t}\n\n\t/**\n\t * Processes the functions hooked into the 'all' hook.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $args Arguments to pass to the hook callbacks. Passed by reference.\n\t */\n\tpublic function do_all_hook( &$args ) {\n\t\t$nesting_level                      = $this->nesting_level++;\n\t\t$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );\n\n\t\tdo {\n\t\t\t$priority = current( $this->iterations[ $nesting_level ] );\n\t\t\tforeach ( $this->callbacks[ $priority ] as $the_ ) {\n\t\t\t\tcall_user_func_array( $the_['function'], $args );\n\t\t\t}\n\t\t} while ( false !== next( $this->iterations[ $nesting_level ] ) );\n\n\t\tunset( $this->iterations[ $nesting_level ] );\n\t\t$this->nesting_level--;\n\t}\n\n\t/**\n\t * Return the current priority level of the currently running iteration of the hook.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return int|false If the hook is running, return the current priority level. If it isn't running, return false.\n\t */\n\tpublic function current_priority() {\n\t\tif ( false === current( $this->iterations ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn current( current( $this->iterations ) );\n\t}\n\n\t/**\n\t * Normalizes filters set up before WordPress has initialized to WP_Hook objects.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $filters Filters to normalize.\n\t * @return WP_Hook[] Array of normalized filters.\n\t */\n\tpublic static function build_preinitialized_hooks( $filters ) {\n\t\t/** @var WP_Hook[] $normalized */\n\t\t$normalized = array();\n\n\t\tforeach ( $filters as $tag => $callback_groups ) {\n\t\t\tif ( is_object( $callback_groups ) && $callback_groups instanceof WP_Hook ) {\n\t\t\t\t$normalized[ $tag ] = $callback_groups;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$hook = new WP_Hook();\n\n\t\t\t// Loop through callback groups.\n\t\t\tforeach ( $callback_groups as $priority => $callbacks ) {\n\n\t\t\t\t// Loop through callbacks.\n\t\t\t\tforeach ( $callbacks as $cb ) {\n\t\t\t\t\t$hook->add_filter( $tag, $cb['function'], $priority, $cb['accepted_args'] );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$normalized[ $tag ] = $hook;\n\t\t}\n\t\treturn $normalized;\n\t}\n\n\t/**\n\t * Determines whether an offset value exists.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @link https://www.php.net/manual/en/arrayaccess.offsetexists.php\n\t *\n\t * @param mixed $offset An offset to check for.\n\t * @return bool True if the offset exists, false otherwise.\n\t */\n\tpublic function offsetExists( $offset ) {\n\t\treturn isset( $this->callbacks[ $offset ] );\n\t}\n\n\t/**\n\t * Retrieves a value at a specified offset.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @link https://www.php.net/manual/en/arrayaccess.offsetget.php\n\t *\n\t * @param mixed $offset The offset to retrieve.\n\t * @return mixed If set, the value at the specified offset, null otherwise.\n\t */\n\tpublic function offsetGet( $offset ) {\n\t\treturn isset( $this->callbacks[ $offset ] ) ? $this->callbacks[ $offset ] : null;\n\t}\n\n\t/**\n\t * Sets a value at a specified offset.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @link https://www.php.net/manual/en/arrayaccess.offsetset.php\n\t *\n\t * @param mixed $offset The offset to assign the value to.\n\t * @param mixed $value The value to set.\n\t */\n\tpublic function offsetSet( $offset, $value ) {\n\t\tif ( is_null( $offset ) ) {\n\t\t\t$this->callbacks[] = $value;\n\t\t} else {\n\t\t\t$this->callbacks[ $offset ] = $value;\n\t\t}\n\t}\n\n\t/**\n\t * Unsets a specified offset.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @link https://www.php.net/manual/en/arrayaccess.offsetunset.php\n\t *\n\t * @param mixed $offset The offset to unset.\n\t */\n\tpublic function offsetUnset( $offset ) {\n\t\tunset( $this->callbacks[ $offset ] );\n\t}\n\n\t/**\n\t * Returns the current element.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @link https://www.php.net/manual/en/iterator.current.php\n\t *\n\t * @return array Of callbacks at current priority.\n\t */\n\tpublic function current() {\n\t\treturn current( $this->callbacks );\n\t}\n\n\t/**\n\t * Moves forward to the next element.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @link https://www.php.net/manual/en/iterator.next.php\n\t *\n\t * @return array Of callbacks at next priority.\n\t */\n\tpublic function next() {\n\t\treturn next( $this->callbacks );\n\t}\n\n\t/**\n\t * Returns the key of the current element.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @link https://www.php.net/manual/en/iterator.key.php\n\t *\n\t * @return mixed Returns current priority on success, or NULL on failure\n\t */\n\tpublic function key() {\n\t\treturn key( $this->callbacks );\n\t}\n\n\t/**\n\t * Checks if current position is valid.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @link https://www.php.net/manual/en/iterator.valid.php\n\t *\n\t * @return boolean\n\t */\n\tpublic function valid() {\n\t\treturn key( $this->callbacks ) !== null;\n\t}\n\n\t/**\n\t * Rewinds the Iterator to the first element.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @link https://www.php.net/manual/en/iterator.rewind.php\n\t */\n\tpublic function rewind() {\n\t\treset( $this->callbacks );\n\t}\n\n}\n", "num_lines": 511}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * HTTP API: WP_Http_Cookie class\n *\n * @package WordPress\n * @subpackage HTTP\n * @since 4.4.0\n */\n\n/**\n * Core class used to encapsulate a single cookie object for internal use.\n *\n * Returned cookies are represented using this class, and when cookies are set, if they are not\n * already a WP_Http_Cookie() object, then they are turned into one.\n *\n * @todo The WordPress convention is to use underscores instead of camelCase for function and method\n * names. Need to switch to use underscores instead for the methods.\n *\n * @since 2.8.0\n */\nclass WP_Http_Cookie {\n\n\t/**\n\t * Cookie name.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $name;\n\n\t/**\n\t * Cookie value.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $value;\n\n\t/**\n\t * When the cookie expires. Unix timestamp or formatted date.\n\t *\n\t * @since 2.8.0\n\t * @var string|int|null\n\t */\n\tpublic $expires;\n\n\t/**\n\t * Cookie URL path.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $path;\n\n\t/**\n\t * Cookie Domain.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $domain;\n\n\t/**\n\t * host-only flag.\n\t *\n\t * @since 5.2.0\n\t * @var bool\n\t */\n\tpublic $host_only;\n\n\t/**\n\t * Sets up this cookie object.\n\t *\n\t * The parameter $data should be either an associative array containing the indices names below\n\t * or a header string detailing it.\n\t *\n\t * @since 2.8.0\n\t * @since 5.2.0 Added `host_only` to the `$data` parameter.\n\t *\n\t * @param string|array $data {\n\t *     Raw cookie data as header string or data array.\n\t *\n\t *     @type string          $name      Cookie name.\n\t *     @type mixed           $value     Value. Should NOT already be urlencoded.\n\t *     @type string|int|null $expires   Optional. Unix timestamp or formatted date. Default null.\n\t *     @type string          $path      Optional. Path. Default '/'.\n\t *     @type string          $domain    Optional. Domain. Default host of parsed $requested_url.\n\t *     @type int             $port      Optional. Port. Default null.\n\t *     @type bool            $host_only Optional. host-only storage flag. Default true.\n\t * }\n\t * @param string       $requested_url The URL which the cookie was set on, used for default $domain\n\t *                                    and $port values.\n\t */\n\tpublic function __construct( $data, $requested_url = '' ) {\n\t\tif ( $requested_url ) {\n\t\t\t$arrURL = parse_url( $requested_url );\n\t\t}\n\t\tif ( isset( $arrURL['host'] ) ) {\n\t\t\t$this->domain = $arrURL['host'];\n\t\t}\n\t\t$this->path = isset( $arrURL['path'] ) ? $arrURL['path'] : '/';\n\t\tif ( '/' !== substr( $this->path, -1 ) ) {\n\t\t\t$this->path = dirname( $this->path ) . '/';\n\t\t}\n\n\t\tif ( is_string( $data ) ) {\n\t\t\t// Assume it's a header string direct from a previous request.\n\t\t\t$pairs = explode( ';', $data );\n\n\t\t\t// Special handling for first pair; name=value. Also be careful of \"=\" in value.\n\t\t\t$name        = trim( substr( $pairs[0], 0, strpos( $pairs[0], '=' ) ) );\n\t\t\t$value       = substr( $pairs[0], strpos( $pairs[0], '=' ) + 1 );\n\t\t\t$this->name  = $name;\n\t\t\t$this->value = urldecode( $value );\n\n\t\t\t// Removes name=value from items.\n\t\t\tarray_shift( $pairs );\n\n\t\t\t// Set everything else as a property.\n\t\t\tforeach ( $pairs as $pair ) {\n\t\t\t\t$pair = rtrim( $pair );\n\n\t\t\t\t// Handle the cookie ending in ; which results in a empty final pair.\n\t\t\t\tif ( empty( $pair ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tlist( $key, $val ) = strpos( $pair, '=' ) ? explode( '=', $pair ) : array( $pair, '' );\n\t\t\t\t$key               = strtolower( trim( $key ) );\n\t\t\t\tif ( 'expires' === $key ) {\n\t\t\t\t\t$val = strtotime( $val );\n\t\t\t\t}\n\t\t\t\t$this->$key = $val;\n\t\t\t}\n\t\t} else {\n\t\t\tif ( ! isset( $data['name'] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set properties based directly on parameters.\n\t\t\tforeach ( array( 'name', 'value', 'path', 'domain', 'port', 'host_only' ) as $field ) {\n\t\t\t\tif ( isset( $data[ $field ] ) ) {\n\t\t\t\t\t$this->$field = $data[ $field ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( isset( $data['expires'] ) ) {\n\t\t\t\t$this->expires = is_int( $data['expires'] ) ? $data['expires'] : strtotime( $data['expires'] );\n\t\t\t} else {\n\t\t\t\t$this->expires = null;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Confirms that it's OK to send this cookie to the URL checked against.\n\t *\n\t * Decision is based on RFC 2109/2965, so look there for details on validity.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $url URL you intend to send this cookie to\n\t * @return bool true if allowed, false otherwise.\n\t */\n\tpublic function test( $url ) {\n\t\tif ( is_null( $this->name ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Expires - if expired then nothing else matters.\n\t\tif ( isset( $this->expires ) && time() > $this->expires ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get details on the URL we're thinking about sending to.\n\t\t$url         = parse_url( $url );\n\t\t$url['port'] = isset( $url['port'] ) ? $url['port'] : ( 'https' === $url['scheme'] ? 443 : 80 );\n\t\t$url['path'] = isset( $url['path'] ) ? $url['path'] : '/';\n\n\t\t// Values to use for comparison against the URL.\n\t\t$path   = isset( $this->path ) ? $this->path : '/';\n\t\t$port   = isset( $this->port ) ? $this->port : null;\n\t\t$domain = isset( $this->domain ) ? strtolower( $this->domain ) : strtolower( $url['host'] );\n\t\tif ( false === stripos( $domain, '.' ) ) {\n\t\t\t$domain .= '.local';\n\t\t}\n\n\t\t// Host - very basic check that the request URL ends with the domain restriction (minus leading dot).\n\t\t$domain = ( '.' === substr( $domain, 0, 1 ) ) ? substr( $domain, 1 ) : $domain;\n\t\tif ( substr( $url['host'], -strlen( $domain ) ) != $domain ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Port - supports \"port-lists\" in the format: \"80,8000,8080\".\n\t\tif ( ! empty( $port ) && ! in_array( $url['port'], array_map( 'intval', explode( ',', $port ) ), true ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Path - request path must start with path restriction.\n\t\tif ( substr( $url['path'], 0, strlen( $path ) ) != $path ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Convert cookie name and value back to header string.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return string Header encoded cookie name and value.\n\t */\n\tpublic function getHeaderValue() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid\n\t\tif ( ! isset( $this->name ) || ! isset( $this->value ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t/**\n\t\t * Filters the header-encoded cookie value.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param string $value The cookie value.\n\t\t * @param string $name  The cookie name.\n\t\t */\n\t\treturn $this->name . '=' . apply_filters( 'wp_http_cookie_value', $this->value, $this->name );\n\t}\n\n\t/**\n\t * Retrieve cookie header for usage in the rest of the WordPress HTTP API.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return string\n\t */\n\tpublic function getFullHeader() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid\n\t\treturn 'Cookie: ' . $this->getHeaderValue();\n\t}\n\n\t/**\n\t * Retrieves cookie attributes.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @return array {\n\t *     List of attributes.\n\t *\n\t *     @type string|int|null $expires When the cookie expires. Unix timestamp or formatted date.\n\t *     @type string          $path    Cookie URL path.\n\t *     @type string          $domain  Cookie domain.\n\t * }\n\t */\n\tpublic function get_attributes() {\n\t\treturn array(\n\t\t\t'expires' => $this->expires,\n\t\t\t'path'    => $this->path,\n\t\t\t'domain'  => $this->domain,\n\t\t);\n\t}\n}\n", "num_lines": 262}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * HTTP API: WP_Http_Curl class\n *\n * @package WordPress\n * @subpackage HTTP\n * @since 4.4.0\n */\n\n/**\n * Core class used to integrate Curl as an HTTP transport.\n *\n * HTTP request method uses Curl extension to retrieve the url.\n *\n * Requires the Curl extension to be installed.\n *\n * @since 2.7.0\n */\nclass WP_Http_Curl {\n\n\t/**\n\t * Temporary header storage for during requests.\n\t *\n\t * @since 3.2.0\n\t * @var string\n\t */\n\tprivate $headers = '';\n\n\t/**\n\t * Temporary body storage for during requests.\n\t *\n\t * @since 3.6.0\n\t * @var string\n\t */\n\tprivate $body = '';\n\n\t/**\n\t * The maximum amount of data to receive from the remote server.\n\t *\n\t * @since 3.6.0\n\t * @var int|false\n\t */\n\tprivate $max_body_length = false;\n\n\t/**\n\t * The file resource used for streaming to file.\n\t *\n\t * @since 3.6.0\n\t * @var resource|false\n\t */\n\tprivate $stream_handle = false;\n\n\t/**\n\t * The total bytes written in the current request.\n\t *\n\t * @since 4.1.0\n\t * @var int\n\t */\n\tprivate $bytes_written_total = 0;\n\n\t/**\n\t * Send a HTTP request to a URI using cURL extension.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string       $url  The request URL.\n\t * @param string|array $args Optional. Override the defaults.\n\t * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error\n\t */\n\tpublic function request( $url, $args = array() ) {\n\t\t$defaults = array(\n\t\t\t'method'      => 'GET',\n\t\t\t'timeout'     => 5,\n\t\t\t'redirection' => 5,\n\t\t\t'httpversion' => '1.0',\n\t\t\t'blocking'    => true,\n\t\t\t'headers'     => array(),\n\t\t\t'body'        => null,\n\t\t\t'cookies'     => array(),\n\t\t);\n\n\t\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t\tif ( isset( $parsed_args['headers']['User-Agent'] ) ) {\n\t\t\t$parsed_args['user-agent'] = $parsed_args['headers']['User-Agent'];\n\t\t\tunset( $parsed_args['headers']['User-Agent'] );\n\t\t} elseif ( isset( $parsed_args['headers']['user-agent'] ) ) {\n\t\t\t$parsed_args['user-agent'] = $parsed_args['headers']['user-agent'];\n\t\t\tunset( $parsed_args['headers']['user-agent'] );\n\t\t}\n\n\t\t// Construct Cookie: header if any cookies are set.\n\t\tWP_Http::buildCookieHeader( $parsed_args );\n\n\t\t$handle = curl_init();\n\n\t\t// cURL offers really easy proxy support.\n\t\t$proxy = new WP_HTTP_Proxy();\n\n\t\tif ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {\n\n\t\t\tcurl_setopt( $handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP );\n\t\t\tcurl_setopt( $handle, CURLOPT_PROXY, $proxy->host() );\n\t\t\tcurl_setopt( $handle, CURLOPT_PROXYPORT, $proxy->port() );\n\n\t\t\tif ( $proxy->use_authentication() ) {\n\t\t\t\tcurl_setopt( $handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY );\n\t\t\t\tcurl_setopt( $handle, CURLOPT_PROXYUSERPWD, $proxy->authentication() );\n\t\t\t}\n\t\t}\n\n\t\t$is_local   = isset( $parsed_args['local'] ) && $parsed_args['local'];\n\t\t$ssl_verify = isset( $parsed_args['sslverify'] ) && $parsed_args['sslverify'];\n\t\tif ( $is_local ) {\n\t\t\t/** This filter is documented in wp-includes/class-wp-http-streams.php */\n\t\t\t$ssl_verify = apply_filters( 'https_local_ssl_verify', $ssl_verify, $url );\n\t\t} elseif ( ! $is_local ) {\n\t\t\t/** This filter is documented in wp-includes/class-http.php */\n\t\t\t$ssl_verify = apply_filters( 'https_ssl_verify', $ssl_verify, $url );\n\t\t}\n\n\t\t/*\n\t\t * CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT expect integers. Have to use ceil since.\n\t\t * a value of 0 will allow an unlimited timeout.\n\t\t */\n\t\t$timeout = (int) ceil( $parsed_args['timeout'] );\n\t\tcurl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $timeout );\n\t\tcurl_setopt( $handle, CURLOPT_TIMEOUT, $timeout );\n\n\t\tcurl_setopt( $handle, CURLOPT_URL, $url );\n\t\tcurl_setopt( $handle, CURLOPT_RETURNTRANSFER, true );\n\t\tcurl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, ( true === $ssl_verify ) ? 2 : false );\n\t\tcurl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, $ssl_verify );\n\n\t\tif ( $ssl_verify ) {\n\t\t\tcurl_setopt( $handle, CURLOPT_CAINFO, $parsed_args['sslcertificates'] );\n\t\t}\n\n\t\tcurl_setopt( $handle, CURLOPT_USERAGENT, $parsed_args['user-agent'] );\n\n\t\t/*\n\t\t * The option doesn't work with safe mode or when open_basedir is set, and there's\n\t\t * a bug #17490 with redirected POST requests, so handle redirections outside Curl.\n\t\t */\n\t\tcurl_setopt( $handle, CURLOPT_FOLLOWLOCATION, false );\n\t\tcurl_setopt( $handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS );\n\n\t\tswitch ( $parsed_args['method'] ) {\n\t\t\tcase 'HEAD':\n\t\t\t\tcurl_setopt( $handle, CURLOPT_NOBODY, true );\n\t\t\t\tbreak;\n\t\t\tcase 'POST':\n\t\t\t\tcurl_setopt( $handle, CURLOPT_POST, true );\n\t\t\t\tcurl_setopt( $handle, CURLOPT_POSTFIELDS, $parsed_args['body'] );\n\t\t\t\tbreak;\n\t\t\tcase 'PUT':\n\t\t\t\tcurl_setopt( $handle, CURLOPT_CUSTOMREQUEST, 'PUT' );\n\t\t\t\tcurl_setopt( $handle, CURLOPT_POSTFIELDS, $parsed_args['body'] );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcurl_setopt( $handle, CURLOPT_CUSTOMREQUEST, $parsed_args['method'] );\n\t\t\t\tif ( ! is_null( $parsed_args['body'] ) ) {\n\t\t\t\t\tcurl_setopt( $handle, CURLOPT_POSTFIELDS, $parsed_args['body'] );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( true === $parsed_args['blocking'] ) {\n\t\t\tcurl_setopt( $handle, CURLOPT_HEADERFUNCTION, array( $this, 'stream_headers' ) );\n\t\t\tcurl_setopt( $handle, CURLOPT_WRITEFUNCTION, array( $this, 'stream_body' ) );\n\t\t}\n\n\t\tcurl_setopt( $handle, CURLOPT_HEADER, false );\n\n\t\tif ( isset( $parsed_args['limit_response_size'] ) ) {\n\t\t\t$this->max_body_length = intval( $parsed_args['limit_response_size'] );\n\t\t} else {\n\t\t\t$this->max_body_length = false;\n\t\t}\n\n\t\t// If streaming to a file open a file handle, and setup our curl streaming handler.\n\t\tif ( $parsed_args['stream'] ) {\n\t\t\tif ( ! WP_DEBUG ) {\n\t\t\t\t$this->stream_handle = @fopen( $parsed_args['filename'], 'w+' );\n\t\t\t} else {\n\t\t\t\t$this->stream_handle = fopen( $parsed_args['filename'], 'w+' );\n\t\t\t}\n\t\t\tif ( ! $this->stream_handle ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'http_request_failed',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1: fopen(), 2: File name. */\n\t\t\t\t\t\t__( 'Could not open handle for %1$s to %2$s.' ),\n\t\t\t\t\t\t'fopen()',\n\t\t\t\t\t\t$parsed_args['filename']\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\t$this->stream_handle = false;\n\t\t}\n\n\t\tif ( ! empty( $parsed_args['headers'] ) ) {\n\t\t\t// cURL expects full header strings in each element.\n\t\t\t$headers = array();\n\t\t\tforeach ( $parsed_args['headers'] as $name => $value ) {\n\t\t\t\t$headers[] = \"{$name}: $value\";\n\t\t\t}\n\t\t\tcurl_setopt( $handle, CURLOPT_HTTPHEADER, $headers );\n\t\t}\n\n\t\tif ( '1.0' === $parsed_args['httpversion'] ) {\n\t\t\tcurl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0 );\n\t\t} else {\n\t\t\tcurl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 );\n\t\t}\n\n\t\t/**\n\t\t * Fires before the cURL request is executed.\n\t\t *\n\t\t * Cookies are not currently handled by the HTTP API. This action allows\n\t\t * plugins to handle cookies themselves.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param resource $handle      The cURL handle returned by curl_init() (passed by reference).\n\t\t * @param array    $parsed_args The HTTP request arguments.\n\t\t * @param string   $url         The request URL.\n\t\t */\n\t\tdo_action_ref_array( 'http_api_curl', array( &$handle, $parsed_args, $url ) );\n\n\t\t// We don't need to return the body, so don't. Just execute request and return.\n\t\tif ( ! $parsed_args['blocking'] ) {\n\t\t\tcurl_exec( $handle );\n\n\t\t\t$curl_error = curl_error( $handle );\n\t\t\tif ( $curl_error ) {\n\t\t\t\tcurl_close( $handle );\n\t\t\t\treturn new WP_Error( 'http_request_failed', $curl_error );\n\t\t\t}\n\t\t\tif ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ), true ) ) {\n\t\t\t\tcurl_close( $handle );\n\t\t\t\treturn new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );\n\t\t\t}\n\n\t\t\tcurl_close( $handle );\n\t\t\treturn array(\n\t\t\t\t'headers'  => array(),\n\t\t\t\t'body'     => '',\n\t\t\t\t'response' => array(\n\t\t\t\t\t'code'    => false,\n\t\t\t\t\t'message' => false,\n\t\t\t\t),\n\t\t\t\t'cookies'  => array(),\n\t\t\t);\n\t\t}\n\n\t\tcurl_exec( $handle );\n\t\t$theHeaders          = WP_Http::processHeaders( $this->headers, $url );\n\t\t$theBody             = $this->body;\n\t\t$bytes_written_total = $this->bytes_written_total;\n\n\t\t$this->headers             = '';\n\t\t$this->body                = '';\n\t\t$this->bytes_written_total = 0;\n\n\t\t$curl_error = curl_errno( $handle );\n\n\t\t// If an error occurred, or, no response.\n\t\tif ( $curl_error || ( 0 == strlen( $theBody ) && empty( $theHeaders['headers'] ) ) ) {\n\t\t\tif ( CURLE_WRITE_ERROR /* 23 */ == $curl_error ) {\n\t\t\t\tif ( ! $this->max_body_length || $this->max_body_length != $bytes_written_total ) {\n\t\t\t\t\tif ( $parsed_args['stream'] ) {\n\t\t\t\t\t\tcurl_close( $handle );\n\t\t\t\t\t\tfclose( $this->stream_handle );\n\t\t\t\t\t\treturn new WP_Error( 'http_request_failed', __( 'Failed to write request to temporary file.' ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurl_close( $handle );\n\t\t\t\t\t\treturn new WP_Error( 'http_request_failed', curl_error( $handle ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$curl_error = curl_error( $handle );\n\t\t\t\tif ( $curl_error ) {\n\t\t\t\t\tcurl_close( $handle );\n\t\t\t\t\treturn new WP_Error( 'http_request_failed', $curl_error );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ), true ) ) {\n\t\t\t\tcurl_close( $handle );\n\t\t\t\treturn new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );\n\t\t\t}\n\t\t}\n\n\t\tcurl_close( $handle );\n\n\t\tif ( $parsed_args['stream'] ) {\n\t\t\tfclose( $this->stream_handle );\n\t\t}\n\n\t\t$response = array(\n\t\t\t'headers'  => $theHeaders['headers'],\n\t\t\t'body'     => null,\n\t\t\t'response' => $theHeaders['response'],\n\t\t\t'cookies'  => $theHeaders['cookies'],\n\t\t\t'filename' => $parsed_args['filename'],\n\t\t);\n\n\t\t// Handle redirects.\n\t\t$redirect_response = WP_HTTP::handle_redirects( $url, $parsed_args, $response );\n\t\tif ( false !== $redirect_response ) {\n\t\t\treturn $redirect_response;\n\t\t}\n\n\t\tif ( true === $parsed_args['decompress'] && true === WP_Http_Encoding::should_decode( $theHeaders['headers'] ) ) {\n\t\t\t$theBody = WP_Http_Encoding::decompress( $theBody );\n\t\t}\n\n\t\t$response['body'] = $theBody;\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Grabs the headers of the cURL request.\n\t *\n\t * Each header is sent individually to this callback, so we append to the `$header` property\n\t * for temporary storage\n\t *\n\t * @since 3.2.0\n\t *\n\t * @param resource $handle  cURL handle.\n\t * @param string   $headers cURL request headers.\n\t * @return int Length of the request headers.\n\t */\n\tprivate function stream_headers( $handle, $headers ) {\n\t\t$this->headers .= $headers;\n\t\treturn strlen( $headers );\n\t}\n\n\t/**\n\t * Grabs the body of the cURL request.\n\t *\n\t * The contents of the document are passed in chunks, so we append to the `$body`\n\t * property for temporary storage. Returning a length shorter than the length of\n\t * `$data` passed in will cause cURL to abort the request with `CURLE_WRITE_ERROR`.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param resource $handle  cURL handle.\n\t * @param string   $data    cURL request body.\n\t * @return int Total bytes of data written.\n\t */\n\tprivate function stream_body( $handle, $data ) {\n\t\t$data_length = strlen( $data );\n\n\t\tif ( $this->max_body_length && ( $this->bytes_written_total + $data_length ) > $this->max_body_length ) {\n\t\t\t$data_length = ( $this->max_body_length - $this->bytes_written_total );\n\t\t\t$data        = substr( $data, 0, $data_length );\n\t\t}\n\n\t\tif ( $this->stream_handle ) {\n\t\t\t$bytes_written = fwrite( $this->stream_handle, $data );\n\t\t} else {\n\t\t\t$this->body   .= $data;\n\t\t\t$bytes_written = $data_length;\n\t\t}\n\n\t\t$this->bytes_written_total += $bytes_written;\n\n\t\t// Upon event of this function returning less than strlen( $data ) curl will error with CURLE_WRITE_ERROR.\n\t\treturn $bytes_written;\n\t}\n\n\t/**\n\t * Determines whether this class can be used for retrieving a URL.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param array $args Optional. Array of request arguments. Default empty array.\n\t * @return bool False means this class can not be used, true means it can.\n\t */\n\tpublic static function test( $args = array() ) {\n\t\tif ( ! function_exists( 'curl_init' ) || ! function_exists( 'curl_exec' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$is_ssl = isset( $args['ssl'] ) && $args['ssl'];\n\n\t\tif ( $is_ssl ) {\n\t\t\t$curl_version = curl_version();\n\t\t\t// Check whether this cURL version support SSL requests.\n\t\t\tif ( ! ( CURL_VERSION_SSL & $curl_version['features'] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters whether cURL can be used as a transport for retrieving a URL.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param bool  $use_class Whether the class can be used. Default true.\n\t\t * @param array $args      An array of request arguments.\n\t\t */\n\t\treturn apply_filters( 'use_curl_transport', true, $args );\n\t}\n}\n", "num_lines": 409}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * HTTP API: WP_Http_Encoding class\n *\n * @package WordPress\n * @subpackage HTTP\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement deflate and gzip transfer encoding support for HTTP requests.\n *\n * Includes RFC 1950, RFC 1951, and RFC 1952.\n *\n * @since 2.8.0\n */\nclass WP_Http_Encoding {\n\n\t/**\n\t * Compress raw string using the deflate format.\n\t *\n\t * Supports the RFC 1951 standard.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $raw      String to compress.\n\t * @param int    $level    Optional. Compression level, 9 is highest. Default 9.\n\t * @param string $supports Optional, not used. When implemented it will choose\n\t *                         the right compression based on what the server supports.\n\t * @return string|false False on failure.\n\t */\n\tpublic static function compress( $raw, $level = 9, $supports = null ) {\n\t\treturn gzdeflate( $raw, $level );\n\t}\n\n\t/**\n\t * Decompression of deflated string.\n\t *\n\t * Will attempt to decompress using the RFC 1950 standard, and if that fails\n\t * then the RFC 1951 standard deflate will be attempted. Finally, the RFC\n\t * 1952 standard gzip decode will be attempted. If all fail, then the\n\t * original compressed string will be returned.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $compressed String to decompress.\n\t * @param int    $length     The optional length of the compressed data.\n\t * @return string|bool False on failure.\n\t */\n\tpublic static function decompress( $compressed, $length = null ) {\n\n\t\tif ( empty( $compressed ) ) {\n\t\t\treturn $compressed;\n\t\t}\n\n\t\t$decompressed = @gzinflate( $compressed );\n\t\tif ( false !== $decompressed ) {\n\t\t\treturn $decompressed;\n\t\t}\n\n\t\t$decompressed = self::compatible_gzinflate( $compressed );\n\t\tif ( false !== $decompressed ) {\n\t\t\treturn $decompressed;\n\t\t}\n\n\t\t$decompressed = @gzuncompress( $compressed );\n\t\tif ( false !== $decompressed ) {\n\t\t\treturn $decompressed;\n\t\t}\n\n\t\tif ( function_exists( 'gzdecode' ) ) {\n\t\t\t$decompressed = @gzdecode( $compressed );\n\n\t\t\tif ( false !== $decompressed ) {\n\t\t\t\treturn $decompressed;\n\t\t\t}\n\t\t}\n\n\t\treturn $compressed;\n\t}\n\n\t/**\n\t * Decompression of deflated string while staying compatible with the majority of servers.\n\t *\n\t * Certain Servers will return deflated data with headers which PHP's gzinflate()\n\t * function cannot handle out of the box. The following function has been created from\n\t * various snippets on the gzinflate() PHP documentation.\n\t *\n\t * Warning: Magic numbers within. Due to the potential different formats that the compressed\n\t * data may be returned in, some \"magic offsets\" are needed to ensure proper decompression\n\t * takes place. For a simple progmatic way to determine the magic offset in use, see:\n\t * https://core.trac.wordpress.org/ticket/18273\n\t *\n\t * @since 2.8.1\n\t *\n\t * @link https://core.trac.wordpress.org/ticket/18273\n\t * @link https://www.php.net/manual/en/function.gzinflate.php#70875\n\t * @link https://www.php.net/manual/en/function.gzinflate.php#77336\n\t *\n\t * @param string $gzData String to decompress.\n\t * @return string|bool False on failure.\n\t */\n\tpublic static function compatible_gzinflate( $gzData ) {\n\n\t\t// Compressed data might contain a full header, if so strip it for gzinflate().\n\t\tif ( \"\\x1f\\x8b\\x08\" === substr( $gzData, 0, 3 ) ) {\n\t\t\t$i   = 10;\n\t\t\t$flg = ord( substr( $gzData, 3, 1 ) );\n\t\t\tif ( $flg > 0 ) {\n\t\t\t\tif ( $flg & 4 ) {\n\t\t\t\t\tlist($xlen) = unpack( 'v', substr( $gzData, $i, 2 ) );\n\t\t\t\t\t$i          = $i + 2 + $xlen;\n\t\t\t\t}\n\t\t\t\tif ( $flg & 8 ) {\n\t\t\t\t\t$i = strpos( $gzData, \"\\0\", $i ) + 1;\n\t\t\t\t}\n\t\t\t\tif ( $flg & 16 ) {\n\t\t\t\t\t$i = strpos( $gzData, \"\\0\", $i ) + 1;\n\t\t\t\t}\n\t\t\t\tif ( $flg & 2 ) {\n\t\t\t\t\t$i = $i + 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$decompressed = @gzinflate( substr( $gzData, $i, -8 ) );\n\t\t\tif ( false !== $decompressed ) {\n\t\t\t\treturn $decompressed;\n\t\t\t}\n\t\t}\n\n\t\t// Compressed data from java.util.zip.Deflater amongst others.\n\t\t$decompressed = @gzinflate( substr( $gzData, 2 ) );\n\t\tif ( false !== $decompressed ) {\n\t\t\treturn $decompressed;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * What encoding types to accept and their priority values.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $url\n\t * @param array  $args\n\t * @return string Types of encoding to accept.\n\t */\n\tpublic static function accept_encoding( $url, $args ) {\n\t\t$type                = array();\n\t\t$compression_enabled = self::is_available();\n\n\t\tif ( ! $args['decompress'] ) { // Decompression specifically disabled.\n\t\t\t$compression_enabled = false;\n\t\t} elseif ( $args['stream'] ) { // Disable when streaming to file.\n\t\t\t$compression_enabled = false;\n\t\t} elseif ( isset( $args['limit_response_size'] ) ) { // If only partial content is being requested, we won't be able to decompress it.\n\t\t\t$compression_enabled = false;\n\t\t}\n\n\t\tif ( $compression_enabled ) {\n\t\t\tif ( function_exists( 'gzinflate' ) ) {\n\t\t\t\t$type[] = 'deflate;q=1.0';\n\t\t\t}\n\n\t\t\tif ( function_exists( 'gzuncompress' ) ) {\n\t\t\t\t$type[] = 'compress;q=0.5';\n\t\t\t}\n\n\t\t\tif ( function_exists( 'gzdecode' ) ) {\n\t\t\t\t$type[] = 'gzip;q=0.5';\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the allowed encoding types.\n\t\t *\n\t\t * @since 3.6.0\n\t\t *\n\t\t * @param string[] $type Array of what encoding types to accept and their priority values.\n\t\t * @param string   $url  URL of the HTTP request.\n\t\t * @param array    $args HTTP request arguments.\n\t\t */\n\t\t$type = apply_filters( 'wp_http_accept_encoding', $type, $url, $args );\n\n\t\treturn implode( ', ', $type );\n\t}\n\n\t/**\n\t * What encoding the content used when it was compressed to send in the headers.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return string Content-Encoding string to send in the header.\n\t */\n\tpublic static function content_encoding() {\n\t\treturn 'deflate';\n\t}\n\n\t/**\n\t * Whether the content be decoded based on the headers.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array|string $headers All of the available headers.\n\t * @return bool\n\t */\n\tpublic static function should_decode( $headers ) {\n\t\tif ( is_array( $headers ) ) {\n\t\t\tif ( array_key_exists( 'content-encoding', $headers ) && ! empty( $headers['content-encoding'] ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} elseif ( is_string( $headers ) ) {\n\t\t\treturn ( stripos( $headers, 'content-encoding:' ) !== false );\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Whether decompression and compression are supported by the PHP version.\n\t *\n\t * Each function is tested instead of checking for the zlib extension, to\n\t * ensure that the functions all exist in the PHP version and aren't\n\t * disabled.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return bool\n\t */\n\tpublic static function is_available() {\n\t\treturn ( function_exists( 'gzuncompress' ) || function_exists( 'gzdeflate' ) || function_exists( 'gzinflate' ) );\n\t}\n}\n", "num_lines": 234}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WP_HTTP_IXR_Client\n *\n * @package WordPress\n * @since 3.1.0\n */\nclass WP_HTTP_IXR_Client extends IXR_Client {\n\tpublic $scheme;\n\t/**\n\t * @var IXR_Error\n\t */\n\tpublic $error;\n\n\t/**\n\t * @param string      $server\n\t * @param string|bool $path\n\t * @param int|bool    $port\n\t * @param int         $timeout\n\t */\n\tpublic function __construct( $server, $path = false, $port = false, $timeout = 15 ) {\n\t\tif ( ! $path ) {\n\t\t\t// Assume we have been given a URL instead.\n\t\t\t$bits         = parse_url( $server );\n\t\t\t$this->scheme = $bits['scheme'];\n\t\t\t$this->server = $bits['host'];\n\t\t\t$this->port   = isset( $bits['port'] ) ? $bits['port'] : $port;\n\t\t\t$this->path   = ! empty( $bits['path'] ) ? $bits['path'] : '/';\n\n\t\t\t// Make absolutely sure we have a path.\n\t\t\tif ( ! $this->path ) {\n\t\t\t\t$this->path = '/';\n\t\t\t}\n\n\t\t\tif ( ! empty( $bits['query'] ) ) {\n\t\t\t\t$this->path .= '?' . $bits['query'];\n\t\t\t}\n\t\t} else {\n\t\t\t$this->scheme = 'http';\n\t\t\t$this->server = $server;\n\t\t\t$this->path   = $path;\n\t\t\t$this->port   = $port;\n\t\t}\n\t\t$this->useragent = 'The Incutio XML-RPC PHP Library';\n\t\t$this->timeout   = $timeout;\n\t}\n\n\t/**\n\t * @since 3.1.0\n\t * @since 5.5.0 Formalized the existing `...$args` parameter by adding it\n\t *              to the function signature.\n\t *\n\t * @return bool\n\t */\n\tpublic function query( ...$args ) {\n\t\t$method  = array_shift( $args );\n\t\t$request = new IXR_Request( $method, $args );\n\t\t$xml     = $request->getXml();\n\n\t\t$port = $this->port ? \":$this->port\" : '';\n\t\t$url  = $this->scheme . '://' . $this->server . $port . $this->path;\n\t\t$args = array(\n\t\t\t'headers'    => array( 'Content-Type' => 'text/xml' ),\n\t\t\t'user-agent' => $this->useragent,\n\t\t\t'body'       => $xml,\n\t\t);\n\n\t\t// Merge Custom headers ala #8145.\n\t\tforeach ( $this->headers as $header => $value ) {\n\t\t\t$args['headers'][ $header ] = $value;\n\t\t}\n\n\t\t/**\n\t\t * Filters the headers collection to be sent to the XML-RPC server.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string[] $headers Associative array of headers to be sent.\n\t\t */\n\t\t$args['headers'] = apply_filters( 'wp_http_ixr_client_headers', $args['headers'] );\n\n\t\tif ( false !== $this->timeout ) {\n\t\t\t$args['timeout'] = $this->timeout;\n\t\t}\n\n\t\t// Now send the request.\n\t\tif ( $this->debug ) {\n\t\t\techo '<pre class=\"ixr_request\">' . htmlspecialchars( $xml ) . \"\\n</pre>\\n\\n\";\n\t\t}\n\n\t\t$response = wp_remote_post( $url, $args );\n\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\t$errno       = $response->get_error_code();\n\t\t\t$errorstr    = $response->get_error_message();\n\t\t\t$this->error = new IXR_Error( -32300, \"transport error: $errno $errorstr\" );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( 200 != wp_remote_retrieve_response_code( $response ) ) {\n\t\t\t$this->error = new IXR_Error( -32301, 'transport error - HTTP status code was not 200 (' . wp_remote_retrieve_response_code( $response ) . ')' );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $this->debug ) {\n\t\t\techo '<pre class=\"ixr_response\">' . htmlspecialchars( wp_remote_retrieve_body( $response ) ) . \"\\n</pre>\\n\\n\";\n\t\t}\n\n\t\t// Now parse what we've got back.\n\t\t$this->message = new IXR_Message( wp_remote_retrieve_body( $response ) );\n\t\tif ( ! $this->message->parse() ) {\n\t\t\t// XML error.\n\t\t\t$this->error = new IXR_Error( -32700, 'parse error. not well formed' );\n\t\t\treturn false;\n\t\t}\n\n\t\t// Is the message a fault?\n\t\tif ( 'fault' === $this->message->messageType ) {\n\t\t\t$this->error = new IXR_Error( $this->message->faultCode, $this->message->faultString );\n\t\t\treturn false;\n\t\t}\n\n\t\t// Message must be OK.\n\t\treturn true;\n\t}\n}\n", "num_lines": 127}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * HTTP API: WP_HTTP_Proxy class\n *\n * @package WordPress\n * @subpackage HTTP\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement HTTP API proxy support.\n *\n * There are caveats to proxy support. It requires that defines be made in the wp-config.php file to\n * enable proxy support. There are also a few filters that plugins can hook into for some of the\n * constants.\n *\n * Please note that only BASIC authentication is supported by most transports.\n * cURL MAY support more methods (such as NTLM authentication) depending on your environment.\n *\n * The constants are as follows:\n * <ol>\n * <li>WP_PROXY_HOST - Enable proxy support and host for connecting.</li>\n * <li>WP_PROXY_PORT - Proxy port for connection. No default, must be defined.</li>\n * <li>WP_PROXY_USERNAME - Proxy username, if it requires authentication.</li>\n * <li>WP_PROXY_PASSWORD - Proxy password, if it requires authentication.</li>\n * <li>WP_PROXY_BYPASS_HOSTS - Will prevent the hosts in this list from going through the proxy.\n * You do not need to have localhost and the site host in this list, because they will not be passed\n * through the proxy. The list should be presented in a comma separated list, wildcards using * are supported, eg. *.wordpress.org</li>\n * </ol>\n *\n * An example can be as seen below.\n *\n *     define('WP_PROXY_HOST', '192.168.84.101');\n *     define('WP_PROXY_PORT', '8080');\n *     define('WP_PROXY_BYPASS_HOSTS', 'localhost, www.example.com, *.wordpress.org');\n *\n * @link https://core.trac.wordpress.org/ticket/4011 Proxy support ticket in WordPress.\n * @link https://core.trac.wordpress.org/ticket/14636 Allow wildcard domains in WP_PROXY_BYPASS_HOSTS\n *\n * @since 2.8.0\n */\nclass WP_HTTP_Proxy {\n\n\t/**\n\t * Whether proxy connection should be used.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @use WP_PROXY_HOST\n\t * @use WP_PROXY_PORT\n\t *\n\t * @return bool\n\t */\n\tpublic function is_enabled() {\n\t\treturn defined( 'WP_PROXY_HOST' ) && defined( 'WP_PROXY_PORT' );\n\t}\n\n\t/**\n\t * Whether authentication should be used.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @use WP_PROXY_USERNAME\n\t * @use WP_PROXY_PASSWORD\n\t *\n\t * @return bool\n\t */\n\tpublic function use_authentication() {\n\t\treturn defined( 'WP_PROXY_USERNAME' ) && defined( 'WP_PROXY_PASSWORD' );\n\t}\n\n\t/**\n\t * Retrieve the host for the proxy server.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return string\n\t */\n\tpublic function host() {\n\t\tif ( defined( 'WP_PROXY_HOST' ) ) {\n\t\t\treturn WP_PROXY_HOST;\n\t\t}\n\n\t\treturn '';\n\t}\n\n\t/**\n\t * Retrieve the port for the proxy server.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return string\n\t */\n\tpublic function port() {\n\t\tif ( defined( 'WP_PROXY_PORT' ) ) {\n\t\t\treturn WP_PROXY_PORT;\n\t\t}\n\n\t\treturn '';\n\t}\n\n\t/**\n\t * Retrieve the username for proxy authentication.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return string\n\t */\n\tpublic function username() {\n\t\tif ( defined( 'WP_PROXY_USERNAME' ) ) {\n\t\t\treturn WP_PROXY_USERNAME;\n\t\t}\n\n\t\treturn '';\n\t}\n\n\t/**\n\t * Retrieve the password for proxy authentication.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return string\n\t */\n\tpublic function password() {\n\t\tif ( defined( 'WP_PROXY_PASSWORD' ) ) {\n\t\t\treturn WP_PROXY_PASSWORD;\n\t\t}\n\n\t\treturn '';\n\t}\n\n\t/**\n\t * Retrieve authentication string for proxy authentication.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return string\n\t */\n\tpublic function authentication() {\n\t\treturn $this->username() . ':' . $this->password();\n\t}\n\n\t/**\n\t * Retrieve header string for proxy authentication.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return string\n\t */\n\tpublic function authentication_header() {\n\t\treturn 'Proxy-Authorization: Basic ' . base64_encode( $this->authentication() );\n\t}\n\n\t/**\n\t * Determines whether the request should be sent through a proxy.\n\t *\n\t * We want to keep localhost and the site URL from being sent through the proxy, because\n\t * some proxies can not handle this. We also have the constant available for defining other\n\t * hosts that won't be sent through the proxy.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $uri URL of the request.\n\t * @return bool Whether to send the request through the proxy.\n\t */\n\tpublic function send_through_proxy( $uri ) {\n\t\t$check = parse_url( $uri );\n\n\t\t// Malformed URL, can not process, but this could mean ssl, so let through anyway.\n\t\tif ( false === $check ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$home = parse_url( get_option( 'siteurl' ) );\n\n\t\t/**\n\t\t * Filters whether to preempt sending the request through the proxy.\n\t\t *\n\t\t * Returning false will bypass the proxy; returning true will send\n\t\t * the request through the proxy. Returning null bypasses the filter.\n\t\t *\n\t\t * @since 3.5.0\n\t\t *\n\t\t * @param bool|null $override Whether to send the request through the proxy. Default null.\n\t\t * @param string    $uri      URL of the request.\n\t\t * @param array     $check    Associative array result of parsing the request URL with `parse_url()`.\n\t\t * @param array     $home     Associative array result of parsing the site URL with `parse_url()`.\n\t\t */\n\t\t$result = apply_filters( 'pre_http_send_through_proxy', null, $uri, $check, $home );\n\t\tif ( ! is_null( $result ) ) {\n\t\t\treturn $result;\n\t\t}\n\n\t\tif ( 'localhost' === $check['host'] || ( isset( $home['host'] ) && $home['host'] === $check['host'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! defined( 'WP_PROXY_BYPASS_HOSTS' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tstatic $bypass_hosts   = null;\n\t\tstatic $wildcard_regex = array();\n\t\tif ( null === $bypass_hosts ) {\n\t\t\t$bypass_hosts = preg_split( '|,\\s*|', WP_PROXY_BYPASS_HOSTS );\n\n\t\t\tif ( false !== strpos( WP_PROXY_BYPASS_HOSTS, '*' ) ) {\n\t\t\t\t$wildcard_regex = array();\n\t\t\t\tforeach ( $bypass_hosts as $host ) {\n\t\t\t\t\t$wildcard_regex[] = str_replace( '\\*', '.+', preg_quote( $host, '/' ) );\n\t\t\t\t}\n\t\t\t\t$wildcard_regex = '/^(' . implode( '|', $wildcard_regex ) . ')$/i';\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $wildcard_regex ) ) {\n\t\t\treturn ! preg_match( $wildcard_regex, $check['host'] );\n\t\t} else {\n\t\t\treturn ! in_array( $check['host'], $bypass_hosts, true );\n\t\t}\n\t}\n}\n", "num_lines": 223}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * HTTP API: Requests hook bridge class\n *\n * @package WordPress\n * @subpackage HTTP\n * @since 4.7.0\n */\n\n/**\n * Bridge to connect Requests internal hooks to WordPress actions.\n *\n * @since 4.7.0\n *\n * @see Requests_Hooks\n */\nclass WP_HTTP_Requests_Hooks extends Requests_Hooks {\n\t/**\n\t * Requested URL.\n\t *\n\t * @var string Requested URL.\n\t */\n\tprotected $url;\n\n\t/**\n\t * WordPress WP_HTTP request data.\n\t *\n\t * @var array Request data in WP_Http format.\n\t */\n\tprotected $request = array();\n\n\t/**\n\t * Constructor.\n\t *\n\t * @param string $url     URL to request.\n\t * @param array  $request Request data in WP_Http format.\n\t */\n\tpublic function __construct( $url, $request ) {\n\t\t$this->url     = $url;\n\t\t$this->request = $request;\n\t}\n\n\t/**\n\t * Dispatch a Requests hook to a native WordPress action.\n\t *\n\t * @param string $hook       Hook name.\n\t * @param array  $parameters Parameters to pass to callbacks.\n\t * @return boolean True if hooks were run, false if nothing was hooked.\n\t */\n\tpublic function dispatch( $hook, $parameters = array() ) {\n\t\t$result = parent::dispatch( $hook, $parameters );\n\n\t\t// Handle back-compat actions.\n\t\tswitch ( $hook ) {\n\t\t\tcase 'curl.before_send':\n\t\t\t\t/** This action is documented in wp-includes/class-wp-http-curl.php */\n\t\t\t\tdo_action_ref_array( 'http_api_curl', array( &$parameters[0], $this->request, $this->url ) );\n\t\t\t\tbreak;\n\t\t}\n\n\t\t/**\n\t\t * Transforms a native Request hook to a WordPress actions.\n\t\t *\n\t\t * This action maps Requests internal hook to a native WordPress action.\n\t\t *\n\t\t * @see https://github.com/rmccue/Requests/blob/master/docs/hooks.md\n\t\t *\n\t\t * @param array $parameters Parameters from Requests internal hook.\n\t\t * @param array $request Request data in WP_Http format.\n\t\t * @param string $url URL to request.\n\t\t */\n\t\tdo_action_ref_array( \"requests-{$hook}\", $parameters, $this->request, $this->url ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\treturn $result;\n\t}\n}\n", "num_lines": 77}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * HTTP API: WP_HTTP_Requests_Response class\n *\n * @package WordPress\n * @subpackage HTTP\n * @since 4.6.0\n */\n\n/**\n * Core wrapper object for a Requests_Response for standardisation.\n *\n * @since 4.6.0\n *\n * @see WP_HTTP_Response\n */\nclass WP_HTTP_Requests_Response extends WP_HTTP_Response {\n\t/**\n\t * Requests Response object.\n\t *\n\t * @since 4.6.0\n\t * @var Requests_Response\n\t */\n\tprotected $response;\n\n\t/**\n\t * Filename the response was saved to.\n\t *\n\t * @since 4.6.0\n\t * @var string|null\n\t */\n\tprotected $filename;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param Requests_Response $response HTTP response.\n\t * @param string            $filename Optional. File name. Default empty.\n\t */\n\tpublic function __construct( Requests_Response $response, $filename = '' ) {\n\t\t$this->response = $response;\n\t\t$this->filename = $filename;\n\t}\n\n\t/**\n\t * Retrieves the response object for the request.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @return Requests_Response HTTP response.\n\t */\n\tpublic function get_response_object() {\n\t\treturn $this->response;\n\t}\n\n\t/**\n\t * Retrieves headers associated with the response.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @return \\Requests_Utility_CaseInsensitiveDictionary Map of header name to header value.\n\t */\n\tpublic function get_headers() {\n\t\t// Ensure headers remain case-insensitive.\n\t\t$converted = new Requests_Utility_CaseInsensitiveDictionary();\n\n\t\tforeach ( $this->response->headers->getAll() as $key => $value ) {\n\t\t\tif ( count( $value ) === 1 ) {\n\t\t\t\t$converted[ $key ] = $value[0];\n\t\t\t} else {\n\t\t\t\t$converted[ $key ] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $converted;\n\t}\n\n\t/**\n\t * Sets all header values.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param array $headers Map of header name to header value.\n\t */\n\tpublic function set_headers( $headers ) {\n\t\t$this->response->headers = new Requests_Response_Headers( $headers );\n\t}\n\n\t/**\n\t * Sets a single HTTP header.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string $key     Header name.\n\t * @param string $value   Header value.\n\t * @param bool   $replace Optional. Whether to replace an existing header of the same name.\n\t *                        Default true.\n\t */\n\tpublic function header( $key, $value, $replace = true ) {\n\t\tif ( $replace ) {\n\t\t\tunset( $this->response->headers[ $key ] );\n\t\t}\n\n\t\t$this->response->headers[ $key ] = $value;\n\t}\n\n\t/**\n\t * Retrieves the HTTP return code for the response.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @return int The 3-digit HTTP status code.\n\t */\n\tpublic function get_status() {\n\t\treturn $this->response->status_code;\n\t}\n\n\t/**\n\t * Sets the 3-digit HTTP status code.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param int $code HTTP status.\n\t */\n\tpublic function set_status( $code ) {\n\t\t$this->response->status_code = absint( $code );\n\t}\n\n\t/**\n\t * Retrieves the response data.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @return string Response data.\n\t */\n\tpublic function get_data() {\n\t\treturn $this->response->body;\n\t}\n\n\t/**\n\t * Sets the response data.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string $data Response data.\n\t */\n\tpublic function set_data( $data ) {\n\t\t$this->response->body = $data;\n\t}\n\n\t/**\n\t * Retrieves cookies from the response.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @return WP_HTTP_Cookie[] List of cookie objects.\n\t */\n\tpublic function get_cookies() {\n\t\t$cookies = array();\n\t\tforeach ( $this->response->cookies as $cookie ) {\n\t\t\t$cookies[] = new WP_Http_Cookie(\n\t\t\t\tarray(\n\t\t\t\t\t'name'      => $cookie->name,\n\t\t\t\t\t'value'     => urldecode( $cookie->value ),\n\t\t\t\t\t'expires'   => isset( $cookie->attributes['expires'] ) ? $cookie->attributes['expires'] : null,\n\t\t\t\t\t'path'      => isset( $cookie->attributes['path'] ) ? $cookie->attributes['path'] : null,\n\t\t\t\t\t'domain'    => isset( $cookie->attributes['domain'] ) ? $cookie->attributes['domain'] : null,\n\t\t\t\t\t'host_only' => isset( $cookie->flags['host-only'] ) ? $cookie->flags['host-only'] : null,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn $cookies;\n\t}\n\n\t/**\n\t * Converts the object to a WP_Http response array.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @return array WP_Http response array, per WP_Http::request().\n\t */\n\tpublic function to_array() {\n\t\treturn array(\n\t\t\t'headers'  => $this->get_headers(),\n\t\t\t'body'     => $this->get_data(),\n\t\t\t'response' => array(\n\t\t\t\t'code'    => $this->get_status(),\n\t\t\t\t'message' => get_status_header_desc( $this->get_status() ),\n\t\t\t),\n\t\t\t'cookies'  => $this->get_cookies(),\n\t\t\t'filename' => $this->filename,\n\t\t);\n\t}\n}\n", "num_lines": 198}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * HTTP API: WP_HTTP_Response class\n *\n * @package WordPress\n * @subpackage HTTP\n * @since 4.4.0\n */\n\n/**\n * Core class used to prepare HTTP responses.\n *\n * @since 4.4.0\n */\nclass WP_HTTP_Response {\n\n\t/**\n\t * Response data.\n\t *\n\t * @since 4.4.0\n\t * @var mixed\n\t */\n\tpublic $data;\n\n\t/**\n\t * Response headers.\n\t *\n\t * @since 4.4.0\n\t * @var array\n\t */\n\tpublic $headers;\n\n\t/**\n\t * Response status.\n\t *\n\t * @since 4.4.0\n\t * @var int\n\t */\n\tpublic $status;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param mixed $data    Response data. Default null.\n\t * @param int   $status  Optional. HTTP status code. Default 200.\n\t * @param array $headers Optional. HTTP header map. Default empty array.\n\t */\n\tpublic function __construct( $data = null, $status = 200, $headers = array() ) {\n\t\t$this->set_data( $data );\n\t\t$this->set_status( $status );\n\t\t$this->set_headers( $headers );\n\t}\n\n\t/**\n\t * Retrieves headers associated with the response.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return array Map of header name to header value.\n\t */\n\tpublic function get_headers() {\n\t\treturn $this->headers;\n\t}\n\n\t/**\n\t * Sets all header values.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $headers Map of header name to header value.\n\t */\n\tpublic function set_headers( $headers ) {\n\t\t$this->headers = $headers;\n\t}\n\n\t/**\n\t * Sets a single HTTP header.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $key     Header name.\n\t * @param string $value   Header value.\n\t * @param bool   $replace Optional. Whether to replace an existing header of the same name.\n\t *                        Default true.\n\t */\n\tpublic function header( $key, $value, $replace = true ) {\n\t\tif ( $replace || ! isset( $this->headers[ $key ] ) ) {\n\t\t\t$this->headers[ $key ] = $value;\n\t\t} else {\n\t\t\t$this->headers[ $key ] .= ', ' . $value;\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the HTTP return code for the response.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return int The 3-digit HTTP status code.\n\t */\n\tpublic function get_status() {\n\t\treturn $this->status;\n\t}\n\n\t/**\n\t * Sets the 3-digit HTTP status code.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param int $code HTTP status.\n\t */\n\tpublic function set_status( $code ) {\n\t\t$this->status = absint( $code );\n\t}\n\n\t/**\n\t * Retrieves the response data.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return mixed Response data.\n\t */\n\tpublic function get_data() {\n\t\treturn $this->data;\n\t}\n\n\t/**\n\t * Sets the response data.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param mixed $data Response data.\n\t */\n\tpublic function set_data( $data ) {\n\t\t$this->data = $data;\n\t}\n\n\t/**\n\t * Retrieves the response data for JSON serialization.\n\t *\n\t * It is expected that in most implementations, this will return the same as get_data(),\n\t * however this may be different if you want to do custom JSON data handling.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return mixed Any JSON-serializable value.\n\t */\n\tpublic function jsonSerialize() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid\n\t\treturn $this->get_data();\n\t}\n}\n", "num_lines": 154}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * HTTP API: WP_Http_Streams class\n *\n * @package WordPress\n * @subpackage HTTP\n * @since 4.4.0\n */\n\n/**\n * Core class used to integrate PHP Streams as an HTTP transport.\n *\n * @since 2.7.0\n * @since 3.7.0 Combined with the fsockopen transport and switched to `stream_socket_client()`.\n */\nclass WP_Http_Streams {\n\t/**\n\t * Send a HTTP request to a URI using PHP Streams.\n\t *\n\t * @see WP_Http::request For default options descriptions.\n\t *\n\t * @since 2.7.0\n\t * @since 3.7.0 Combined with the fsockopen transport and switched to stream_socket_client().\n\t *\n\t * @param string       $url  The request URL.\n\t * @param string|array $args Optional. Override the defaults.\n\t * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error\n\t */\n\tpublic function request( $url, $args = array() ) {\n\t\t$defaults = array(\n\t\t\t'method'      => 'GET',\n\t\t\t'timeout'     => 5,\n\t\t\t'redirection' => 5,\n\t\t\t'httpversion' => '1.0',\n\t\t\t'blocking'    => true,\n\t\t\t'headers'     => array(),\n\t\t\t'body'        => null,\n\t\t\t'cookies'     => array(),\n\t\t);\n\n\t\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t\tif ( isset( $parsed_args['headers']['User-Agent'] ) ) {\n\t\t\t$parsed_args['user-agent'] = $parsed_args['headers']['User-Agent'];\n\t\t\tunset( $parsed_args['headers']['User-Agent'] );\n\t\t} elseif ( isset( $parsed_args['headers']['user-agent'] ) ) {\n\t\t\t$parsed_args['user-agent'] = $parsed_args['headers']['user-agent'];\n\t\t\tunset( $parsed_args['headers']['user-agent'] );\n\t\t}\n\n\t\t// Construct Cookie: header if any cookies are set.\n\t\tWP_Http::buildCookieHeader( $parsed_args );\n\n\t\t$arrURL = parse_url( $url );\n\n\t\t$connect_host = $arrURL['host'];\n\n\t\t$secure_transport = ( 'ssl' === $arrURL['scheme'] || 'https' === $arrURL['scheme'] );\n\t\tif ( ! isset( $arrURL['port'] ) ) {\n\t\t\tif ( 'ssl' === $arrURL['scheme'] || 'https' === $arrURL['scheme'] ) {\n\t\t\t\t$arrURL['port']   = 443;\n\t\t\t\t$secure_transport = true;\n\t\t\t} else {\n\t\t\t\t$arrURL['port'] = 80;\n\t\t\t}\n\t\t}\n\n\t\t// Always pass a path, defaulting to the root in cases such as http://example.com.\n\t\tif ( ! isset( $arrURL['path'] ) ) {\n\t\t\t$arrURL['path'] = '/';\n\t\t}\n\n\t\tif ( isset( $parsed_args['headers']['Host'] ) || isset( $parsed_args['headers']['host'] ) ) {\n\t\t\tif ( isset( $parsed_args['headers']['Host'] ) ) {\n\t\t\t\t$arrURL['host'] = $parsed_args['headers']['Host'];\n\t\t\t} else {\n\t\t\t\t$arrURL['host'] = $parsed_args['headers']['host'];\n\t\t\t}\n\t\t\tunset( $parsed_args['headers']['Host'], $parsed_args['headers']['host'] );\n\t\t}\n\n\t\t/*\n\t\t * Certain versions of PHP have issues with 'localhost' and IPv6, It attempts to connect\n\t\t * to ::1, which fails when the server is not set up for it. For compatibility, always\n\t\t * connect to the IPv4 address.\n\t\t */\n\t\tif ( 'localhost' === strtolower( $connect_host ) ) {\n\t\t\t$connect_host = '127.0.0.1';\n\t\t}\n\n\t\t$connect_host = $secure_transport ? 'ssl://' . $connect_host : 'tcp://' . $connect_host;\n\n\t\t$is_local   = isset( $parsed_args['local'] ) && $parsed_args['local'];\n\t\t$ssl_verify = isset( $parsed_args['sslverify'] ) && $parsed_args['sslverify'];\n\t\tif ( $is_local ) {\n\t\t\t/**\n\t\t\t * Filters whether SSL should be verified for local requests.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t * @since 5.1.0 The `$url` parameter was added.\n\t\t\t *\n\t\t\t * @param bool   $ssl_verify Whether to verify the SSL connection. Default true.\n\t\t\t * @param string $url        The request URL.\n\t\t\t */\n\t\t\t$ssl_verify = apply_filters( 'https_local_ssl_verify', $ssl_verify, $url );\n\t\t} elseif ( ! $is_local ) {\n\t\t\t/** This filter is documented in wp-includes/class-http.php */\n\t\t\t$ssl_verify = apply_filters( 'https_ssl_verify', $ssl_verify, $url );\n\t\t}\n\n\t\t$proxy = new WP_HTTP_Proxy();\n\n\t\t$context = stream_context_create(\n\t\t\tarray(\n\t\t\t\t'ssl' => array(\n\t\t\t\t\t'verify_peer'       => $ssl_verify,\n\t\t\t\t\t// 'CN_match' => $arrURL['host'], // This is handled by self::verify_ssl_certificate().\n\t\t\t\t\t'capture_peer_cert' => $ssl_verify,\n\t\t\t\t\t'SNI_enabled'       => true,\n\t\t\t\t\t'cafile'            => $parsed_args['sslcertificates'],\n\t\t\t\t\t'allow_self_signed' => ! $ssl_verify,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$timeout         = (int) floor( $parsed_args['timeout'] );\n\t\t$utimeout        = $timeout == $parsed_args['timeout'] ? 0 : 1000000 * $parsed_args['timeout'] % 1000000;\n\t\t$connect_timeout = max( $timeout, 1 );\n\n\t\t// Store error number.\n\t\t$connection_error = null;\n\n\t\t// Store error string.\n\t\t$connection_error_str = null;\n\n\t\tif ( ! WP_DEBUG ) {\n\t\t\t// In the event that the SSL connection fails, silence the many PHP warnings.\n\t\t\tif ( $secure_transport ) {\n\t\t\t\t$error_reporting = error_reporting( 0 );\n\t\t\t}\n\n\t\t\tif ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {\n\t\t\t\t// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged\n\t\t\t\t$handle = @stream_socket_client( 'tcp://' . $proxy->host() . ':' . $proxy->port(), $connection_error, $connection_error_str, $connect_timeout, STREAM_CLIENT_CONNECT, $context );\n\t\t\t} else {\n\t\t\t\t// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged\n\t\t\t\t$handle = @stream_socket_client( $connect_host . ':' . $arrURL['port'], $connection_error, $connection_error_str, $connect_timeout, STREAM_CLIENT_CONNECT, $context );\n\t\t\t}\n\n\t\t\tif ( $secure_transport ) {\n\t\t\t\terror_reporting( $error_reporting );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {\n\t\t\t\t$handle = stream_socket_client( 'tcp://' . $proxy->host() . ':' . $proxy->port(), $connection_error, $connection_error_str, $connect_timeout, STREAM_CLIENT_CONNECT, $context );\n\t\t\t} else {\n\t\t\t\t$handle = stream_socket_client( $connect_host . ':' . $arrURL['port'], $connection_error, $connection_error_str, $connect_timeout, STREAM_CLIENT_CONNECT, $context );\n\t\t\t}\n\t\t}\n\n\t\tif ( false === $handle ) {\n\t\t\t// SSL connection failed due to expired/invalid cert, or, OpenSSL configuration is broken.\n\t\t\tif ( $secure_transport && 0 === $connection_error && '' === $connection_error_str ) {\n\t\t\t\treturn new WP_Error( 'http_request_failed', __( 'The SSL certificate for the host could not be verified.' ) );\n\t\t\t}\n\n\t\t\treturn new WP_Error( 'http_request_failed', $connection_error . ': ' . $connection_error_str );\n\t\t}\n\n\t\t// Verify that the SSL certificate is valid for this request.\n\t\tif ( $secure_transport && $ssl_verify && ! $proxy->is_enabled() ) {\n\t\t\tif ( ! self::verify_ssl_certificate( $handle, $arrURL['host'] ) ) {\n\t\t\t\treturn new WP_Error( 'http_request_failed', __( 'The SSL certificate for the host could not be verified.' ) );\n\t\t\t}\n\t\t}\n\n\t\tstream_set_timeout( $handle, $timeout, $utimeout );\n\n\t\tif ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { // Some proxies require full URL in this field.\n\t\t\t$requestPath = $url;\n\t\t} else {\n\t\t\t$requestPath = $arrURL['path'] . ( isset( $arrURL['query'] ) ? '?' . $arrURL['query'] : '' );\n\t\t}\n\n\t\t$strHeaders = strtoupper( $parsed_args['method'] ) . ' ' . $requestPath . ' HTTP/' . $parsed_args['httpversion'] . \"\\r\\n\";\n\n\t\t$include_port_in_host_header = (\n\t\t\t( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) ||\n\t\t\t( 'http' === $arrURL['scheme'] && 80 != $arrURL['port'] ) ||\n\t\t\t( 'https' === $arrURL['scheme'] && 443 != $arrURL['port'] )\n\t\t);\n\n\t\tif ( $include_port_in_host_header ) {\n\t\t\t$strHeaders .= 'Host: ' . $arrURL['host'] . ':' . $arrURL['port'] . \"\\r\\n\";\n\t\t} else {\n\t\t\t$strHeaders .= 'Host: ' . $arrURL['host'] . \"\\r\\n\";\n\t\t}\n\n\t\tif ( isset( $parsed_args['user-agent'] ) ) {\n\t\t\t$strHeaders .= 'User-agent: ' . $parsed_args['user-agent'] . \"\\r\\n\";\n\t\t}\n\n\t\tif ( is_array( $parsed_args['headers'] ) ) {\n\t\t\tforeach ( (array) $parsed_args['headers'] as $header => $headerValue ) {\n\t\t\t\t$strHeaders .= $header . ': ' . $headerValue . \"\\r\\n\";\n\t\t\t}\n\t\t} else {\n\t\t\t$strHeaders .= $parsed_args['headers'];\n\t\t}\n\n\t\tif ( $proxy->use_authentication() ) {\n\t\t\t$strHeaders .= $proxy->authentication_header() . \"\\r\\n\";\n\t\t}\n\n\t\t$strHeaders .= \"\\r\\n\";\n\n\t\tif ( ! is_null( $parsed_args['body'] ) ) {\n\t\t\t$strHeaders .= $parsed_args['body'];\n\t\t}\n\n\t\tfwrite( $handle, $strHeaders );\n\n\t\tif ( ! $parsed_args['blocking'] ) {\n\t\t\tstream_set_blocking( $handle, 0 );\n\t\t\tfclose( $handle );\n\t\t\treturn array(\n\t\t\t\t'headers'  => array(),\n\t\t\t\t'body'     => '',\n\t\t\t\t'response' => array(\n\t\t\t\t\t'code'    => false,\n\t\t\t\t\t'message' => false,\n\t\t\t\t),\n\t\t\t\t'cookies'  => array(),\n\t\t\t);\n\t\t}\n\n\t\t$strResponse  = '';\n\t\t$bodyStarted  = false;\n\t\t$keep_reading = true;\n\t\t$block_size   = 4096;\n\t\tif ( isset( $parsed_args['limit_response_size'] ) ) {\n\t\t\t$block_size = min( $block_size, $parsed_args['limit_response_size'] );\n\t\t}\n\n\t\t// If streaming to a file setup the file handle.\n\t\tif ( $parsed_args['stream'] ) {\n\t\t\tif ( ! WP_DEBUG ) {\n\t\t\t\t$stream_handle = @fopen( $parsed_args['filename'], 'w+' );\n\t\t\t} else {\n\t\t\t\t$stream_handle = fopen( $parsed_args['filename'], 'w+' );\n\t\t\t}\n\t\t\tif ( ! $stream_handle ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'http_request_failed',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1: fopen(), 2: File name. */\n\t\t\t\t\t\t__( 'Could not open handle for %1$s to %2$s.' ),\n\t\t\t\t\t\t'fopen()',\n\t\t\t\t\t\t$parsed_args['filename']\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$bytes_written = 0;\n\t\t\twhile ( ! feof( $handle ) && $keep_reading ) {\n\t\t\t\t$block = fread( $handle, $block_size );\n\t\t\t\tif ( ! $bodyStarted ) {\n\t\t\t\t\t$strResponse .= $block;\n\t\t\t\t\tif ( strpos( $strResponse, \"\\r\\n\\r\\n\" ) ) {\n\t\t\t\t\t\t$process     = WP_Http::processResponse( $strResponse );\n\t\t\t\t\t\t$bodyStarted = true;\n\t\t\t\t\t\t$block       = $process['body'];\n\t\t\t\t\t\tunset( $strResponse );\n\t\t\t\t\t\t$process['body'] = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this_block_size = strlen( $block );\n\n\t\t\t\tif ( isset( $parsed_args['limit_response_size'] ) && ( $bytes_written + $this_block_size ) > $parsed_args['limit_response_size'] ) {\n\t\t\t\t\t$this_block_size = ( $parsed_args['limit_response_size'] - $bytes_written );\n\t\t\t\t\t$block           = substr( $block, 0, $this_block_size );\n\t\t\t\t}\n\n\t\t\t\t$bytes_written_to_file = fwrite( $stream_handle, $block );\n\n\t\t\t\tif ( $bytes_written_to_file != $this_block_size ) {\n\t\t\t\t\tfclose( $handle );\n\t\t\t\t\tfclose( $stream_handle );\n\t\t\t\t\treturn new WP_Error( 'http_request_failed', __( 'Failed to write request to temporary file.' ) );\n\t\t\t\t}\n\n\t\t\t\t$bytes_written += $bytes_written_to_file;\n\n\t\t\t\t$keep_reading = ! isset( $parsed_args['limit_response_size'] ) || $bytes_written < $parsed_args['limit_response_size'];\n\t\t\t}\n\n\t\t\tfclose( $stream_handle );\n\n\t\t} else {\n\t\t\t$header_length = 0;\n\t\t\twhile ( ! feof( $handle ) && $keep_reading ) {\n\t\t\t\t$block        = fread( $handle, $block_size );\n\t\t\t\t$strResponse .= $block;\n\t\t\t\tif ( ! $bodyStarted && strpos( $strResponse, \"\\r\\n\\r\\n\" ) ) {\n\t\t\t\t\t$header_length = strpos( $strResponse, \"\\r\\n\\r\\n\" ) + 4;\n\t\t\t\t\t$bodyStarted   = true;\n\t\t\t\t}\n\t\t\t\t$keep_reading = ( ! $bodyStarted || ! isset( $parsed_args['limit_response_size'] ) || strlen( $strResponse ) < ( $header_length + $parsed_args['limit_response_size'] ) );\n\t\t\t}\n\n\t\t\t$process = WP_Http::processResponse( $strResponse );\n\t\t\tunset( $strResponse );\n\n\t\t}\n\n\t\tfclose( $handle );\n\n\t\t$arrHeaders = WP_Http::processHeaders( $process['headers'], $url );\n\n\t\t$response = array(\n\t\t\t'headers'  => $arrHeaders['headers'],\n\t\t\t// Not yet processed.\n\t\t\t'body'     => null,\n\t\t\t'response' => $arrHeaders['response'],\n\t\t\t'cookies'  => $arrHeaders['cookies'],\n\t\t\t'filename' => $parsed_args['filename'],\n\t\t);\n\n\t\t// Handle redirects.\n\t\t$redirect_response = WP_Http::handle_redirects( $url, $parsed_args, $response );\n\t\tif ( false !== $redirect_response ) {\n\t\t\treturn $redirect_response;\n\t\t}\n\n\t\t// If the body was chunk encoded, then decode it.\n\t\tif ( ! empty( $process['body'] ) && isset( $arrHeaders['headers']['transfer-encoding'] )\n\t\t\t&& 'chunked' === $arrHeaders['headers']['transfer-encoding']\n\t\t) {\n\t\t\t$process['body'] = WP_Http::chunkTransferDecode( $process['body'] );\n\t\t}\n\n\t\tif ( true === $parsed_args['decompress'] && true === WP_Http_Encoding::should_decode( $arrHeaders['headers'] ) ) {\n\t\t\t$process['body'] = WP_Http_Encoding::decompress( $process['body'] );\n\t\t}\n\n\t\tif ( isset( $parsed_args['limit_response_size'] ) && strlen( $process['body'] ) > $parsed_args['limit_response_size'] ) {\n\t\t\t$process['body'] = substr( $process['body'], 0, $parsed_args['limit_response_size'] );\n\t\t}\n\n\t\t$response['body'] = $process['body'];\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Verifies the received SSL certificate against its Common Names and subjectAltName fields.\n\t *\n\t * PHP's SSL verifications only verify that it's a valid Certificate, it doesn't verify if\n\t * the certificate is valid for the hostname which was requested.\n\t * This function verifies the requested hostname against certificate's subjectAltName field,\n\t * if that is empty, or contains no DNS entries, a fallback to the Common Name field is used.\n\t *\n\t * IP Address support is included if the request is being made to an IP address.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param stream $stream The PHP Stream which the SSL request is being made over\n\t * @param string $host The hostname being requested\n\t * @return bool If the cerficiate presented in $stream is valid for $host\n\t */\n\tpublic static function verify_ssl_certificate( $stream, $host ) {\n\t\t$context_options = stream_context_get_options( $stream );\n\n\t\tif ( empty( $context_options['ssl']['peer_certificate'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$cert = openssl_x509_parse( $context_options['ssl']['peer_certificate'] );\n\t\tif ( ! $cert ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\t * If the request is being made to an IP address, we'll validate against IP fields\n\t\t * in the cert (if they exist)\n\t\t */\n\t\t$host_type = ( WP_Http::is_ip_address( $host ) ? 'ip' : 'dns' );\n\n\t\t$certificate_hostnames = array();\n\t\tif ( ! empty( $cert['extensions']['subjectAltName'] ) ) {\n\t\t\t$match_against = preg_split( '/,\\s*/', $cert['extensions']['subjectAltName'] );\n\t\t\tforeach ( $match_against as $match ) {\n\t\t\t\tlist( $match_type, $match_host ) = explode( ':', $match );\n\t\t\t\tif ( strtolower( trim( $match_type ) ) === $host_type ) { // IP: or DNS:\n\t\t\t\t\t$certificate_hostnames[] = strtolower( trim( $match_host ) );\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( ! empty( $cert['subject']['CN'] ) ) {\n\t\t\t// Only use the CN when the certificate includes no subjectAltName extension.\n\t\t\t$certificate_hostnames[] = strtolower( $cert['subject']['CN'] );\n\t\t}\n\n\t\t// Exact hostname/IP matches.\n\t\tif ( in_array( strtolower( $host ), $certificate_hostnames, true ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// IP's can't be wildcards, Stop processing.\n\t\tif ( 'ip' === $host_type ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Test to see if the domain is at least 2 deep for wildcard support.\n\t\tif ( substr_count( $host, '.' ) < 2 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Wildcard subdomains certs (*.example.com) are valid for a.example.com but not a.b.example.com.\n\t\t$wildcard_host = preg_replace( '/^[^.]+\\./', '*.', $host );\n\n\t\treturn in_array( strtolower( $wildcard_host ), $certificate_hostnames, true );\n\t}\n\n\t/**\n\t * Determines whether this class can be used for retrieving a URL.\n\t *\n\t * @since 2.7.0\n\t * @since 3.7.0 Combined with the fsockopen transport and switched to stream_socket_client().\n\t *\n\t * @param array $args Optional. Array of request arguments. Default empty array.\n\t * @return bool False means this class can not be used, true means it can.\n\t */\n\tpublic static function test( $args = array() ) {\n\t\tif ( ! function_exists( 'stream_socket_client' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$is_ssl = isset( $args['ssl'] ) && $args['ssl'];\n\n\t\tif ( $is_ssl ) {\n\t\t\tif ( ! extension_loaded( 'openssl' ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ( ! function_exists( 'openssl_x509_parse' ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters whether streams can be used as a transport for retrieving a URL.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param bool  $use_class Whether the class can be used. Default true.\n\t\t * @param array $args      Request arguments.\n\t\t */\n\t\treturn apply_filters( 'use_streams_transport', true, $args );\n\t}\n}\n\n/**\n * Deprecated HTTP Transport method which used fsockopen.\n *\n * This class is not used, and is included for backward compatibility only.\n * All code should make use of WP_Http directly through its API.\n *\n * @see WP_HTTP::request\n *\n * @since 2.7.0\n * @deprecated 3.7.0 Please use WP_HTTP::request() directly\n */\nclass WP_HTTP_Fsockopen extends WP_HTTP_Streams {\n\t// For backward compatibility for users who are using the class directly.\n}\n", "num_lines": 476}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress GD Image Editor\n *\n * @package WordPress\n * @subpackage Image_Editor\n */\n\n/**\n * WordPress Image Editor Class for Image Manipulation through GD\n *\n * @since 3.5.0\n *\n * @see WP_Image_Editor\n */\nclass WP_Image_Editor_GD extends WP_Image_Editor {\n\t/**\n\t * GD Resource.\n\t *\n\t * @var resource\n\t */\n\tprotected $image;\n\n\tpublic function __destruct() {\n\t\tif ( $this->image ) {\n\t\t\t// We don't need the original in memory anymore.\n\t\t\timagedestroy( $this->image );\n\t\t}\n\t}\n\n\t/**\n\t * Checks to see if current environment supports GD.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param array $args\n\t * @return bool\n\t */\n\tpublic static function test( $args = array() ) {\n\t\tif ( ! extension_loaded( 'gd' ) || ! function_exists( 'gd_info' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// On some setups GD library does not provide imagerotate() - Ticket #11536.\n\t\tif ( isset( $args['methods'] ) &&\n\t\t\tin_array( 'rotate', $args['methods'], true ) &&\n\t\t\t! function_exists( 'imagerotate' ) ) {\n\n\t\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks to see if editor supports the mime-type specified.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $mime_type\n\t * @return bool\n\t */\n\tpublic static function supports_mime_type( $mime_type ) {\n\t\t$image_types = imagetypes();\n\t\tswitch ( $mime_type ) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\treturn ( $image_types & IMG_JPG ) != 0;\n\t\t\tcase 'image/png':\n\t\t\t\treturn ( $image_types & IMG_PNG ) != 0;\n\t\t\tcase 'image/gif':\n\t\t\t\treturn ( $image_types & IMG_GIF ) != 0;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Loads image from $this->file into new GD Resource.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @return bool|WP_Error True if loaded successfully; WP_Error on failure.\n\t */\n\tpublic function load() {\n\t\tif ( $this->image ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) ) {\n\t\t\treturn new WP_Error( 'error_loading_image', __( 'File doesn&#8217;t exist?' ), $this->file );\n\t\t}\n\n\t\t// Set artificially high because GD uses uncompressed images in memory.\n\t\twp_raise_memory_limit( 'image' );\n\n\t\t$this->image = @imagecreatefromstring( file_get_contents( $this->file ) );\n\n\t\tif ( ! is_resource( $this->image ) ) {\n\t\t\treturn new WP_Error( 'invalid_image', __( 'File is not an image.' ), $this->file );\n\t\t}\n\n\t\t$size = @getimagesize( $this->file );\n\t\tif ( ! $size ) {\n\t\t\treturn new WP_Error( 'invalid_image', __( 'Could not read image size.' ), $this->file );\n\t\t}\n\n\t\tif ( function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' ) ) {\n\t\t\timagealphablending( $this->image, false );\n\t\t\timagesavealpha( $this->image, true );\n\t\t}\n\n\t\t$this->update_size( $size[0], $size[1] );\n\t\t$this->mime_type = $size['mime'];\n\n\t\treturn $this->set_quality();\n\t}\n\n\t/**\n\t * Sets or updates current image size.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param int $width\n\t * @param int $height\n\t * @return true\n\t */\n\tprotected function update_size( $width = false, $height = false ) {\n\t\tif ( ! $width ) {\n\t\t\t$width = imagesx( $this->image );\n\t\t}\n\n\t\tif ( ! $height ) {\n\t\t\t$height = imagesy( $this->image );\n\t\t}\n\n\t\treturn parent::update_size( $width, $height );\n\t}\n\n\t/**\n\t * Resizes current image.\n\t * Wraps _resize, since _resize returns a GD Resource.\n\t *\n\t * At minimum, either a height or width must be provided.\n\t * If one of the two is set to null, the resize will\n\t * maintain aspect ratio according to the provided dimension.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param int|null $max_w Image width.\n\t * @param int|null $max_h Image height.\n\t * @param bool     $crop\n\t * @return true|WP_Error\n\t */\n\tpublic function resize( $max_w, $max_h, $crop = false ) {\n\t\tif ( ( $this->size['width'] == $max_w ) && ( $this->size['height'] == $max_h ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$resized = $this->_resize( $max_w, $max_h, $crop );\n\n\t\tif ( is_resource( $resized ) ) {\n\t\t\timagedestroy( $this->image );\n\t\t\t$this->image = $resized;\n\t\t\treturn true;\n\n\t\t} elseif ( is_wp_error( $resized ) ) {\n\t\t\treturn $resized;\n\t\t}\n\n\t\treturn new WP_Error( 'image_resize_error', __( 'Image resize failed.' ), $this->file );\n\t}\n\n\t/**\n\t * @param int        $max_w\n\t * @param int        $max_h\n\t * @param bool|array $crop\n\t * @return resource|WP_Error\n\t */\n\tprotected function _resize( $max_w, $max_h, $crop = false ) {\n\t\t$dims = image_resize_dimensions( $this->size['width'], $this->size['height'], $max_w, $max_h, $crop );\n\n\t\tif ( ! $dims ) {\n\t\t\treturn new WP_Error( 'error_getting_dimensions', __( 'Could not calculate resized image dimensions' ), $this->file );\n\t\t}\n\n\t\tlist( $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h ) = $dims;\n\n\t\t$resized = wp_imagecreatetruecolor( $dst_w, $dst_h );\n\t\timagecopyresampled( $resized, $this->image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h );\n\n\t\tif ( is_resource( $resized ) ) {\n\t\t\t$this->update_size( $dst_w, $dst_h );\n\t\t\treturn $resized;\n\t\t}\n\n\t\treturn new WP_Error( 'image_resize_error', __( 'Image resize failed.' ), $this->file );\n\t}\n\n\t/**\n\t * Create multiple smaller images from a single source.\n\t *\n\t * Attempts to create all sub-sizes and returns the meta data at the end. This\n\t * may result in the server running out of resources. When it fails there may be few\n\t * \"orphaned\" images left over as the meta data is never returned and saved.\n\t *\n\t * As of 5.3.0 the preferred way to do this is with `make_subsize()`. It creates\n\t * the new images one at a time and allows for the meta data to be saved after\n\t * each new image is created.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param array $sizes {\n\t *     An array of image size data arrays.\n\t *\n\t *     Either a height or width must be provided.\n\t *     If one of the two is set to null, the resize will\n\t *     maintain aspect ratio according to the source image.\n\t *\n\t *     @type array $size {\n\t *         Array of height, width values, and whether to crop.\n\t *\n\t *         @type int  $width  Image width. Optional if `$height` is specified.\n\t *         @type int  $height Image height. Optional if `$width` is specified.\n\t *         @type bool $crop   Optional. Whether to crop the image. Default false.\n\t *     }\n\t * }\n\t * @return array An array of resized images' metadata by size.\n\t */\n\tpublic function multi_resize( $sizes ) {\n\t\t$metadata = array();\n\n\t\tforeach ( $sizes as $size => $size_data ) {\n\t\t\t$meta = $this->make_subsize( $size_data );\n\n\t\t\tif ( ! is_wp_error( $meta ) ) {\n\t\t\t\t$metadata[ $size ] = $meta;\n\t\t\t}\n\t\t}\n\n\t\treturn $metadata;\n\t}\n\n\t/**\n\t * Create an image sub-size and return the image meta data value for it.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param array $size_data {\n\t *     Array of size data.\n\t *\n\t *     @type int  $width  The maximum width in pixels.\n\t *     @type int  $height The maximum height in pixels.\n\t *     @type bool $crop   Whether to crop the image to exact dimensions.\n\t * }\n\t * @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta,\n\t *                        WP_Error object on error.\n\t */\n\tpublic function make_subsize( $size_data ) {\n\t\tif ( ! isset( $size_data['width'] ) && ! isset( $size_data['height'] ) ) {\n\t\t\treturn new WP_Error( 'image_subsize_create_error', __( 'Cannot resize the image. Both width and height are not set.' ) );\n\t\t}\n\n\t\t$orig_size = $this->size;\n\n\t\tif ( ! isset( $size_data['width'] ) ) {\n\t\t\t$size_data['width'] = null;\n\t\t}\n\n\t\tif ( ! isset( $size_data['height'] ) ) {\n\t\t\t$size_data['height'] = null;\n\t\t}\n\n\t\tif ( ! isset( $size_data['crop'] ) ) {\n\t\t\t$size_data['crop'] = false;\n\t\t}\n\n\t\t$resized = $this->_resize( $size_data['width'], $size_data['height'], $size_data['crop'] );\n\n\t\tif ( is_wp_error( $resized ) ) {\n\t\t\t$saved = $resized;\n\t\t} else {\n\t\t\t$saved = $this->_save( $resized );\n\t\t\timagedestroy( $resized );\n\t\t}\n\n\t\t$this->size = $orig_size;\n\n\t\tif ( ! is_wp_error( $saved ) ) {\n\t\t\tunset( $saved['path'] );\n\t\t}\n\n\t\treturn $saved;\n\t}\n\n\t/**\n\t * Crops Image.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param int  $src_x   The start x position to crop from.\n\t * @param int  $src_y   The start y position to crop from.\n\t * @param int  $src_w   The width to crop.\n\t * @param int  $src_h   The height to crop.\n\t * @param int  $dst_w   Optional. The destination width.\n\t * @param int  $dst_h   Optional. The destination height.\n\t * @param bool $src_abs Optional. If the source crop points are absolute.\n\t * @return bool|WP_Error\n\t */\n\tpublic function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) {\n\t\t// If destination width/height isn't specified,\n\t\t// use same as width/height from source.\n\t\tif ( ! $dst_w ) {\n\t\t\t$dst_w = $src_w;\n\t\t}\n\t\tif ( ! $dst_h ) {\n\t\t\t$dst_h = $src_h;\n\t\t}\n\n\t\t$dst = wp_imagecreatetruecolor( $dst_w, $dst_h );\n\n\t\tif ( $src_abs ) {\n\t\t\t$src_w -= $src_x;\n\t\t\t$src_h -= $src_y;\n\t\t}\n\n\t\tif ( function_exists( 'imageantialias' ) ) {\n\t\t\timageantialias( $dst, true );\n\t\t}\n\n\t\timagecopyresampled( $dst, $this->image, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h );\n\n\t\tif ( is_resource( $dst ) ) {\n\t\t\timagedestroy( $this->image );\n\t\t\t$this->image = $dst;\n\t\t\t$this->update_size();\n\t\t\treturn true;\n\t\t}\n\n\t\treturn new WP_Error( 'image_crop_error', __( 'Image crop failed.' ), $this->file );\n\t}\n\n\t/**\n\t * Rotates current image counter-clockwise by $angle.\n\t * Ported from image-edit.php\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param float $angle\n\t * @return true|WP_Error\n\t */\n\tpublic function rotate( $angle ) {\n\t\tif ( function_exists( 'imagerotate' ) ) {\n\t\t\t$transparency = imagecolorallocatealpha( $this->image, 255, 255, 255, 127 );\n\t\t\t$rotated      = imagerotate( $this->image, $angle, $transparency );\n\n\t\t\tif ( is_resource( $rotated ) ) {\n\t\t\t\timagealphablending( $rotated, true );\n\t\t\t\timagesavealpha( $rotated, true );\n\t\t\t\timagedestroy( $this->image );\n\t\t\t\t$this->image = $rotated;\n\t\t\t\t$this->update_size();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn new WP_Error( 'image_rotate_error', __( 'Image rotate failed.' ), $this->file );\n\t}\n\n\t/**\n\t * Flips current image.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param bool $horz Flip along Horizontal Axis.\n\t * @param bool $vert Flip along Vertical Axis.\n\t * @return true|WP_Error\n\t */\n\tpublic function flip( $horz, $vert ) {\n\t\t$w   = $this->size['width'];\n\t\t$h   = $this->size['height'];\n\t\t$dst = wp_imagecreatetruecolor( $w, $h );\n\n\t\tif ( is_resource( $dst ) ) {\n\t\t\t$sx = $vert ? ( $w - 1 ) : 0;\n\t\t\t$sy = $horz ? ( $h - 1 ) : 0;\n\t\t\t$sw = $vert ? -$w : $w;\n\t\t\t$sh = $horz ? -$h : $h;\n\n\t\t\tif ( imagecopyresampled( $dst, $this->image, 0, 0, $sx, $sy, $w, $h, $sw, $sh ) ) {\n\t\t\t\timagedestroy( $this->image );\n\t\t\t\t$this->image = $dst;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn new WP_Error( 'image_flip_error', __( 'Image flip failed.' ), $this->file );\n\t}\n\n\t/**\n\t * Saves current in-memory image to file.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string|null $filename\n\t * @param string|null $mime_type\n\t * @return array|WP_Error {'path'=>string, 'file'=>string, 'width'=>int, 'height'=>int, 'mime-type'=>string}\n\t */\n\tpublic function save( $filename = null, $mime_type = null ) {\n\t\t$saved = $this->_save( $this->image, $filename, $mime_type );\n\n\t\tif ( ! is_wp_error( $saved ) ) {\n\t\t\t$this->file      = $saved['path'];\n\t\t\t$this->mime_type = $saved['mime-type'];\n\t\t}\n\n\t\treturn $saved;\n\t}\n\n\t/**\n\t * @param resource    $image\n\t * @param string|null $filename\n\t * @param string|null $mime_type\n\t * @return array|WP_Error\n\t */\n\tprotected function _save( $image, $filename = null, $mime_type = null ) {\n\t\tlist( $filename, $extension, $mime_type ) = $this->get_output_format( $filename, $mime_type );\n\n\t\tif ( ! $filename ) {\n\t\t\t$filename = $this->generate_filename( null, null, $extension );\n\t\t}\n\n\t\tif ( 'image/gif' === $mime_type ) {\n\t\t\tif ( ! $this->make_image( $filename, 'imagegif', array( $image, $filename ) ) ) {\n\t\t\t\treturn new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) );\n\t\t\t}\n\t\t} elseif ( 'image/png' === $mime_type ) {\n\t\t\t// Convert from full colors to index colors, like original PNG.\n\t\t\tif ( function_exists( 'imageistruecolor' ) && ! imageistruecolor( $image ) ) {\n\t\t\t\timagetruecolortopalette( $image, false, imagecolorstotal( $image ) );\n\t\t\t}\n\n\t\t\tif ( ! $this->make_image( $filename, 'imagepng', array( $image, $filename ) ) ) {\n\t\t\t\treturn new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) );\n\t\t\t}\n\t\t} elseif ( 'image/jpeg' === $mime_type ) {\n\t\t\tif ( ! $this->make_image( $filename, 'imagejpeg', array( $image, $filename, $this->get_quality() ) ) ) {\n\t\t\t\treturn new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) );\n\t\t\t}\n\t\t} else {\n\t\t\treturn new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) );\n\t\t}\n\n\t\t// Set correct file permissions.\n\t\t$stat  = stat( dirname( $filename ) );\n\t\t$perms = $stat['mode'] & 0000666; // Same permissions as parent folder, strip off the executable bits.\n\t\tchmod( $filename, $perms );\n\n\t\treturn array(\n\t\t\t'path'      => $filename,\n\t\t\t/**\n\t\t\t * Filters the name of the saved image file.\n\t\t\t *\n\t\t\t * @since 2.6.0\n\t\t\t *\n\t\t\t * @param string $filename Name of the file.\n\t\t\t */\n\t\t\t'file'      => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ),\n\t\t\t'width'     => $this->size['width'],\n\t\t\t'height'    => $this->size['height'],\n\t\t\t'mime-type' => $mime_type,\n\t\t);\n\t}\n\n\t/**\n\t * Returns stream of current image.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $mime_type The mime type of the image.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function stream( $mime_type = null ) {\n\t\tlist( $filename, $extension, $mime_type ) = $this->get_output_format( null, $mime_type );\n\n\t\tswitch ( $mime_type ) {\n\t\t\tcase 'image/png':\n\t\t\t\theader( 'Content-Type: image/png' );\n\t\t\t\treturn imagepng( $this->image );\n\t\t\tcase 'image/gif':\n\t\t\t\theader( 'Content-Type: image/gif' );\n\t\t\t\treturn imagegif( $this->image );\n\t\t\tdefault:\n\t\t\t\theader( 'Content-Type: image/jpeg' );\n\t\t\t\treturn imagejpeg( $this->image, null, $this->get_quality() );\n\t\t}\n\t}\n\n\t/**\n\t * Either calls editor's save function or handles file as a stream.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string|stream $filename\n\t * @param callable      $function\n\t * @param array         $arguments\n\t * @return bool\n\t */\n\tprotected function make_image( $filename, $function, $arguments ) {\n\t\tif ( wp_is_stream( $filename ) ) {\n\t\t\t$arguments[1] = null;\n\t\t}\n\n\t\treturn parent::make_image( $filename, $function, $arguments );\n\t}\n}\n", "num_lines": 514}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Imagick Image Editor\n *\n * @package WordPress\n * @subpackage Image_Editor\n */\n\n/**\n * WordPress Image Editor Class for Image Manipulation through Imagick PHP Module\n *\n * @since 3.5.0\n *\n * @see WP_Image_Editor\n */\nclass WP_Image_Editor_Imagick extends WP_Image_Editor {\n\t/**\n\t * Imagick object.\n\t *\n\t * @var Imagick\n\t */\n\tprotected $image;\n\n\tpublic function __destruct() {\n\t\tif ( $this->image instanceof Imagick ) {\n\t\t\t// We don't need the original in memory anymore.\n\t\t\t$this->image->clear();\n\t\t\t$this->image->destroy();\n\t\t}\n\t}\n\n\t/**\n\t * Checks to see if current environment supports Imagick.\n\t *\n\t * We require Imagick 2.2.0 or greater, based on whether the queryFormats()\n\t * method can be called statically.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param array $args\n\t * @return bool\n\t */\n\tpublic static function test( $args = array() ) {\n\n\t\t// First, test Imagick's extension and classes.\n\t\tif ( ! extension_loaded( 'imagick' ) || ! class_exists( 'Imagick', false ) || ! class_exists( 'ImagickPixel', false ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( version_compare( phpversion( 'imagick' ), '2.2.0', '<' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$required_methods = array(\n\t\t\t'clear',\n\t\t\t'destroy',\n\t\t\t'valid',\n\t\t\t'getimage',\n\t\t\t'writeimage',\n\t\t\t'getimageblob',\n\t\t\t'getimagegeometry',\n\t\t\t'getimageformat',\n\t\t\t'setimageformat',\n\t\t\t'setimagecompression',\n\t\t\t'setimagecompressionquality',\n\t\t\t'setimagepage',\n\t\t\t'setoption',\n\t\t\t'scaleimage',\n\t\t\t'cropimage',\n\t\t\t'rotateimage',\n\t\t\t'flipimage',\n\t\t\t'flopimage',\n\t\t\t'readimage',\n\t\t);\n\n\t\t// Now, test for deep requirements within Imagick.\n\t\tif ( ! defined( 'imagick::COMPRESSION_JPEG' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$class_methods = array_map( 'strtolower', get_class_methods( 'Imagick' ) );\n\t\tif ( array_diff( $required_methods, $class_methods ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks to see if editor supports the mime-type specified.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $mime_type\n\t * @return bool\n\t */\n\tpublic static function supports_mime_type( $mime_type ) {\n\t\t$imagick_extension = strtoupper( self::get_extension( $mime_type ) );\n\n\t\tif ( ! $imagick_extension ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// setIteratorIndex is optional unless mime is an animated format.\n\t\t// Here, we just say no if you are missing it and aren't loading a jpeg.\n\t\tif ( ! method_exists( 'Imagick', 'setIteratorIndex' ) && 'image/jpeg' !== $mime_type ) {\n\t\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged\n\t\t\treturn ( (bool) @Imagick::queryFormats( $imagick_extension ) );\n\t\t} catch ( Exception $e ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Loads image from $this->file into new Imagick Object.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @return true|WP_Error True if loaded; WP_Error on failure.\n\t */\n\tpublic function load() {\n\t\tif ( $this->image instanceof Imagick ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) ) {\n\t\t\treturn new WP_Error( 'error_loading_image', __( 'File doesn&#8217;t exist?' ), $this->file );\n\t\t}\n\n\t\t/*\n\t\t * Even though Imagick uses less PHP memory than GD, set higher limit\n\t\t * for users that have low PHP.ini limits.\n\t\t */\n\t\twp_raise_memory_limit( 'image' );\n\n\t\ttry {\n\t\t\t$this->image    = new Imagick();\n\t\t\t$file_extension = strtolower( pathinfo( $this->file, PATHINFO_EXTENSION ) );\n\t\t\t$filename       = $this->file;\n\n\t\t\tif ( 'pdf' === $file_extension ) {\n\t\t\t\t$filename = $this->pdf_setup();\n\t\t\t}\n\n\t\t\t// Reading image after Imagick instantiation because `setResolution`\n\t\t\t// only applies correctly before the image is read.\n\t\t\t$this->image->readImage( $filename );\n\n\t\t\tif ( ! $this->image->valid() ) {\n\t\t\t\treturn new WP_Error( 'invalid_image', __( 'File is not an image.' ), $this->file );\n\t\t\t}\n\n\t\t\t// Select the first frame to handle animated images properly.\n\t\t\tif ( is_callable( array( $this->image, 'setIteratorIndex' ) ) ) {\n\t\t\t\t$this->image->setIteratorIndex( 0 );\n\t\t\t}\n\n\t\t\t$this->mime_type = $this->get_mime_type( $this->image->getImageFormat() );\n\t\t} catch ( Exception $e ) {\n\t\t\treturn new WP_Error( 'invalid_image', $e->getMessage(), $this->file );\n\t\t}\n\n\t\t$updated_size = $this->update_size();\n\t\tif ( is_wp_error( $updated_size ) ) {\n\t\t\treturn $updated_size;\n\t\t}\n\n\t\treturn $this->set_quality();\n\t}\n\n\t/**\n\t * Sets Image Compression quality on a 1-100% scale.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param int $quality Compression Quality. Range: [1,100]\n\t * @return true|WP_Error True if set successfully; WP_Error on failure.\n\t */\n\tpublic function set_quality( $quality = null ) {\n\t\t$quality_result = parent::set_quality( $quality );\n\t\tif ( is_wp_error( $quality_result ) ) {\n\t\t\treturn $quality_result;\n\t\t} else {\n\t\t\t$quality = $this->get_quality();\n\t\t}\n\n\t\ttry {\n\t\t\tif ( 'image/jpeg' === $this->mime_type ) {\n\t\t\t\t$this->image->setImageCompressionQuality( $quality );\n\t\t\t\t$this->image->setImageCompression( imagick::COMPRESSION_JPEG );\n\t\t\t} else {\n\t\t\t\t$this->image->setImageCompressionQuality( $quality );\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\treturn new WP_Error( 'image_quality_error', $e->getMessage() );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Sets or updates current image size.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param int $width\n\t * @param int $height\n\t * @return true|WP_Error\n\t */\n\tprotected function update_size( $width = null, $height = null ) {\n\t\t$size = null;\n\t\tif ( ! $width || ! $height ) {\n\t\t\ttry {\n\t\t\t\t$size = $this->image->getImageGeometry();\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\treturn new WP_Error( 'invalid_image', __( 'Could not read image size.' ), $this->file );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $width ) {\n\t\t\t$width = $size['width'];\n\t\t}\n\n\t\tif ( ! $height ) {\n\t\t\t$height = $size['height'];\n\t\t}\n\n\t\treturn parent::update_size( $width, $height );\n\t}\n\n\t/**\n\t * Resizes current image.\n\t *\n\t * At minimum, either a height or width must be provided.\n\t * If one of the two is set to null, the resize will\n\t * maintain aspect ratio according to the provided dimension.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param int|null $max_w Image width.\n\t * @param int|null $max_h Image height.\n\t * @param bool     $crop\n\t * @return bool|WP_Error\n\t */\n\tpublic function resize( $max_w, $max_h, $crop = false ) {\n\t\tif ( ( $this->size['width'] == $max_w ) && ( $this->size['height'] == $max_h ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$dims = image_resize_dimensions( $this->size['width'], $this->size['height'], $max_w, $max_h, $crop );\n\t\tif ( ! $dims ) {\n\t\t\treturn new WP_Error( 'error_getting_dimensions', __( 'Could not calculate resized image dimensions' ) );\n\t\t}\n\n\t\tlist( $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h ) = $dims;\n\n\t\tif ( $crop ) {\n\t\t\treturn $this->crop( $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h );\n\t\t}\n\n\t\t// Execute the resize.\n\t\t$thumb_result = $this->thumbnail_image( $dst_w, $dst_h );\n\t\tif ( is_wp_error( $thumb_result ) ) {\n\t\t\treturn $thumb_result;\n\t\t}\n\n\t\treturn $this->update_size( $dst_w, $dst_h );\n\t}\n\n\t/**\n\t * Efficiently resize the current image\n\t *\n\t * This is a WordPress specific implementation of Imagick::thumbnailImage(),\n\t * which resizes an image to given dimensions and removes any associated profiles.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param int    $dst_w       The destination width.\n\t * @param int    $dst_h       The destination height.\n\t * @param string $filter_name Optional. The Imagick filter to use when resizing. Default 'FILTER_TRIANGLE'.\n\t * @param bool   $strip_meta  Optional. Strip all profiles, excluding color profiles, from the image. Default true.\n\t * @return bool|WP_Error\n\t */\n\tprotected function thumbnail_image( $dst_w, $dst_h, $filter_name = 'FILTER_TRIANGLE', $strip_meta = true ) {\n\t\t$allowed_filters = array(\n\t\t\t'FILTER_POINT',\n\t\t\t'FILTER_BOX',\n\t\t\t'FILTER_TRIANGLE',\n\t\t\t'FILTER_HERMITE',\n\t\t\t'FILTER_HANNING',\n\t\t\t'FILTER_HAMMING',\n\t\t\t'FILTER_BLACKMAN',\n\t\t\t'FILTER_GAUSSIAN',\n\t\t\t'FILTER_QUADRATIC',\n\t\t\t'FILTER_CUBIC',\n\t\t\t'FILTER_CATROM',\n\t\t\t'FILTER_MITCHELL',\n\t\t\t'FILTER_LANCZOS',\n\t\t\t'FILTER_BESSEL',\n\t\t\t'FILTER_SINC',\n\t\t);\n\n\t\t/**\n\t\t * Set the filter value if '$filter_name' name is in the allowed list and the related\n\t\t * Imagick constant is defined or fall back to the default filter.\n\t\t */\n\t\tif ( in_array( $filter_name, $allowed_filters, true ) && defined( 'Imagick::' . $filter_name ) ) {\n\t\t\t$filter = constant( 'Imagick::' . $filter_name );\n\t\t} else {\n\t\t\t$filter = defined( 'Imagick::FILTER_TRIANGLE' ) ? Imagick::FILTER_TRIANGLE : false;\n\t\t}\n\n\t\t/**\n\t\t * Filters whether to strip metadata from images when they're resized.\n\t\t *\n\t\t * This filter only applies when resizing using the Imagick editor since GD\n\t\t * always strips profiles by default.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @param bool $strip_meta Whether to strip image metadata during resizing. Default true.\n\t\t */\n\t\tif ( apply_filters( 'image_strip_meta', $strip_meta ) ) {\n\t\t\t$this->strip_meta(); // Fail silently if not supported.\n\t\t}\n\n\t\ttry {\n\t\t\t/*\n\t\t\t * To be more efficient, resample large images to 5x the destination size before resizing\n\t\t\t * whenever the output size is less that 1/3 of the original image size (1/3^2 ~= .111),\n\t\t\t * unless we would be resampling to a scale smaller than 128x128.\n\t\t\t */\n\t\t\tif ( is_callable( array( $this->image, 'sampleImage' ) ) ) {\n\t\t\t\t$resize_ratio  = ( $dst_w / $this->size['width'] ) * ( $dst_h / $this->size['height'] );\n\t\t\t\t$sample_factor = 5;\n\n\t\t\t\tif ( $resize_ratio < .111 && ( $dst_w * $sample_factor > 128 && $dst_h * $sample_factor > 128 ) ) {\n\t\t\t\t\t$this->image->sampleImage( $dst_w * $sample_factor, $dst_h * $sample_factor );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Use resizeImage() when it's available and a valid filter value is set.\n\t\t\t * Otherwise, fall back to the scaleImage() method for resizing, which\n\t\t\t * results in better image quality over resizeImage() with default filter\n\t\t\t * settings and retains backward compatibility with pre 4.5 functionality.\n\t\t\t */\n\t\t\tif ( is_callable( array( $this->image, 'resizeImage' ) ) && $filter ) {\n\t\t\t\t$this->image->setOption( 'filter:support', '2.0' );\n\t\t\t\t$this->image->resizeImage( $dst_w, $dst_h, $filter, 1 );\n\t\t\t} else {\n\t\t\t\t$this->image->scaleImage( $dst_w, $dst_h );\n\t\t\t}\n\n\t\t\t// Set appropriate quality settings after resizing.\n\t\t\tif ( 'image/jpeg' === $this->mime_type ) {\n\t\t\t\tif ( is_callable( array( $this->image, 'unsharpMaskImage' ) ) ) {\n\t\t\t\t\t$this->image->unsharpMaskImage( 0.25, 0.25, 8, 0.065 );\n\t\t\t\t}\n\n\t\t\t\t$this->image->setOption( 'jpeg:fancy-upsampling', 'off' );\n\t\t\t}\n\n\t\t\tif ( 'image/png' === $this->mime_type ) {\n\t\t\t\t$this->image->setOption( 'png:compression-filter', '5' );\n\t\t\t\t$this->image->setOption( 'png:compression-level', '9' );\n\t\t\t\t$this->image->setOption( 'png:compression-strategy', '1' );\n\t\t\t\t$this->image->setOption( 'png:exclude-chunk', 'all' );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * If alpha channel is not defined, set it opaque.\n\t\t\t *\n\t\t\t * Note that Imagick::getImageAlphaChannel() is only available if Imagick\n\t\t\t * has been compiled against ImageMagick version 6.4.0 or newer.\n\t\t\t */\n\t\t\tif ( is_callable( array( $this->image, 'getImageAlphaChannel' ) )\n\t\t\t\t&& is_callable( array( $this->image, 'setImageAlphaChannel' ) )\n\t\t\t\t&& defined( 'Imagick::ALPHACHANNEL_UNDEFINED' )\n\t\t\t\t&& defined( 'Imagick::ALPHACHANNEL_OPAQUE' )\n\t\t\t) {\n\t\t\t\tif ( $this->image->getImageAlphaChannel() === Imagick::ALPHACHANNEL_UNDEFINED ) {\n\t\t\t\t\t$this->image->setImageAlphaChannel( Imagick::ALPHACHANNEL_OPAQUE );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Limit the bit depth of resized images to 8 bits per channel.\n\t\t\tif ( is_callable( array( $this->image, 'getImageDepth' ) ) && is_callable( array( $this->image, 'setImageDepth' ) ) ) {\n\t\t\t\tif ( 8 < $this->image->getImageDepth() ) {\n\t\t\t\t\t$this->image->setImageDepth( 8 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( is_callable( array( $this->image, 'setInterlaceScheme' ) ) && defined( 'Imagick::INTERLACE_NO' ) ) {\n\t\t\t\t$this->image->setInterlaceScheme( Imagick::INTERLACE_NO );\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\treturn new WP_Error( 'image_resize_error', $e->getMessage() );\n\t\t}\n\t}\n\n\t/**\n\t * Create multiple smaller images from a single source.\n\t *\n\t * Attempts to create all sub-sizes and returns the meta data at the end. This\n\t * may result in the server running out of resources. When it fails there may be few\n\t * \"orphaned\" images left over as the meta data is never returned and saved.\n\t *\n\t * As of 5.3.0 the preferred way to do this is with `make_subsize()`. It creates\n\t * the new images one at a time and allows for the meta data to be saved after\n\t * each new image is created.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param array $sizes {\n\t *     An array of image size data arrays.\n\t *\n\t *     Either a height or width must be provided.\n\t *     If one of the two is set to null, the resize will\n\t *     maintain aspect ratio according to the provided dimension.\n\t *\n\t *     @type array $size {\n\t *         Array of height, width values, and whether to crop.\n\t *\n\t *         @type int  $width  Image width. Optional if `$height` is specified.\n\t *         @type int  $height Image height. Optional if `$width` is specified.\n\t *         @type bool $crop   Optional. Whether to crop the image. Default false.\n\t *     }\n\t * }\n\t * @return array An array of resized images' metadata by size.\n\t */\n\tpublic function multi_resize( $sizes ) {\n\t\t$metadata = array();\n\n\t\tforeach ( $sizes as $size => $size_data ) {\n\t\t\t$meta = $this->make_subsize( $size_data );\n\n\t\t\tif ( ! is_wp_error( $meta ) ) {\n\t\t\t\t$metadata[ $size ] = $meta;\n\t\t\t}\n\t\t}\n\n\t\treturn $metadata;\n\t}\n\n\t/**\n\t * Create an image sub-size and return the image meta data value for it.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param array $size_data {\n\t *     Array of size data.\n\t *\n\t *     @type int  $width  The maximum width in pixels.\n\t *     @type int  $height The maximum height in pixels.\n\t *     @type bool $crop   Whether to crop the image to exact dimensions.\n\t * }\n\t * @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta,\n\t *                        WP_Error object on error.\n\t */\n\tpublic function make_subsize( $size_data ) {\n\t\tif ( ! isset( $size_data['width'] ) && ! isset( $size_data['height'] ) ) {\n\t\t\treturn new WP_Error( 'image_subsize_create_error', __( 'Cannot resize the image. Both width and height are not set.' ) );\n\t\t}\n\n\t\t$orig_size  = $this->size;\n\t\t$orig_image = $this->image->getImage();\n\n\t\tif ( ! isset( $size_data['width'] ) ) {\n\t\t\t$size_data['width'] = null;\n\t\t}\n\n\t\tif ( ! isset( $size_data['height'] ) ) {\n\t\t\t$size_data['height'] = null;\n\t\t}\n\n\t\tif ( ! isset( $size_data['crop'] ) ) {\n\t\t\t$size_data['crop'] = false;\n\t\t}\n\n\t\t$resized = $this->resize( $size_data['width'], $size_data['height'], $size_data['crop'] );\n\n\t\tif ( is_wp_error( $resized ) ) {\n\t\t\t$saved = $resized;\n\t\t} else {\n\t\t\t$saved = $this->_save( $this->image );\n\n\t\t\t$this->image->clear();\n\t\t\t$this->image->destroy();\n\t\t\t$this->image = null;\n\t\t}\n\n\t\t$this->size  = $orig_size;\n\t\t$this->image = $orig_image;\n\n\t\tif ( ! is_wp_error( $saved ) ) {\n\t\t\tunset( $saved['path'] );\n\t\t}\n\n\t\treturn $saved;\n\t}\n\n\t/**\n\t * Crops Image.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param int  $src_x   The start x position to crop from.\n\t * @param int  $src_y   The start y position to crop from.\n\t * @param int  $src_w   The width to crop.\n\t * @param int  $src_h   The height to crop.\n\t * @param int  $dst_w   Optional. The destination width.\n\t * @param int  $dst_h   Optional. The destination height.\n\t * @param bool $src_abs Optional. If the source crop points are absolute.\n\t * @return bool|WP_Error\n\t */\n\tpublic function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) {\n\t\tif ( $src_abs ) {\n\t\t\t$src_w -= $src_x;\n\t\t\t$src_h -= $src_y;\n\t\t}\n\n\t\ttry {\n\t\t\t$this->image->cropImage( $src_w, $src_h, $src_x, $src_y );\n\t\t\t$this->image->setImagePage( $src_w, $src_h, 0, 0 );\n\n\t\t\tif ( $dst_w || $dst_h ) {\n\t\t\t\t// If destination width/height isn't specified,\n\t\t\t\t// use same as width/height from source.\n\t\t\t\tif ( ! $dst_w ) {\n\t\t\t\t\t$dst_w = $src_w;\n\t\t\t\t}\n\t\t\t\tif ( ! $dst_h ) {\n\t\t\t\t\t$dst_h = $src_h;\n\t\t\t\t}\n\n\t\t\t\t$thumb_result = $this->thumbnail_image( $dst_w, $dst_h );\n\t\t\t\tif ( is_wp_error( $thumb_result ) ) {\n\t\t\t\t\treturn $thumb_result;\n\t\t\t\t}\n\n\t\t\t\treturn $this->update_size();\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\treturn new WP_Error( 'image_crop_error', $e->getMessage() );\n\t\t}\n\t\treturn $this->update_size();\n\t}\n\n\t/**\n\t * Rotates current image counter-clockwise by $angle.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param float $angle\n\t * @return true|WP_Error\n\t */\n\tpublic function rotate( $angle ) {\n\t\t/**\n\t\t * $angle is 360-$angle because Imagick rotates clockwise\n\t\t * (GD rotates counter-clockwise)\n\t\t */\n\t\ttry {\n\t\t\t$this->image->rotateImage( new ImagickPixel( 'none' ), 360 - $angle );\n\n\t\t\t// Normalise EXIF orientation data so that display is consistent across devices.\n\t\t\tif ( is_callable( array( $this->image, 'setImageOrientation' ) ) && defined( 'Imagick::ORIENTATION_TOPLEFT' ) ) {\n\t\t\t\t$this->image->setImageOrientation( Imagick::ORIENTATION_TOPLEFT );\n\t\t\t}\n\n\t\t\t// Since this changes the dimensions of the image, update the size.\n\t\t\t$result = $this->update_size();\n\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\treturn $result;\n\t\t\t}\n\n\t\t\t$this->image->setImagePage( $this->size['width'], $this->size['height'], 0, 0 );\n\t\t} catch ( Exception $e ) {\n\t\t\treturn new WP_Error( 'image_rotate_error', $e->getMessage() );\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Flips current image.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param bool $horz Flip along Horizontal Axis\n\t * @param bool $vert Flip along Vertical Axis\n\t * @return true|WP_Error\n\t */\n\tpublic function flip( $horz, $vert ) {\n\t\ttry {\n\t\t\tif ( $horz ) {\n\t\t\t\t$this->image->flipImage();\n\t\t\t}\n\n\t\t\tif ( $vert ) {\n\t\t\t\t$this->image->flopImage();\n\t\t\t}\n\n\t\t\t// Normalise EXIF orientation data so that display is consistent across devices.\n\t\t\tif ( is_callable( array( $this->image, 'setImageOrientation' ) ) && defined( 'Imagick::ORIENTATION_TOPLEFT' ) ) {\n\t\t\t\t$this->image->setImageOrientation( Imagick::ORIENTATION_TOPLEFT );\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\treturn new WP_Error( 'image_flip_error', $e->getMessage() );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Check if a JPEG image has EXIF Orientation tag and rotate it if needed.\n\t *\n\t * As ImageMagick copies the EXIF data to the flipped/rotated image, proceed only\n\t * if EXIF Orientation can be reset afterwards.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @return bool|WP_Error True if the image was rotated. False if no EXIF data or if the image doesn't need rotation.\n\t *                       WP_Error if error while rotating.\n\t */\n\tpublic function maybe_exif_rotate() {\n\t\tif ( is_callable( array( $this->image, 'setImageOrientation' ) ) && defined( 'Imagick::ORIENTATION_TOPLEFT' ) ) {\n\t\t\treturn parent::maybe_exif_rotate();\n\t\t} else {\n\t\t\treturn new WP_Error( 'write_exif_error', __( 'The image cannot be rotated because the embedded meta data cannot be updated.' ) );\n\t\t}\n\t}\n\n\t/**\n\t * Saves current image to file.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $destfilename\n\t * @param string $mime_type\n\t * @return array|WP_Error {'path'=>string, 'file'=>string, 'width'=>int, 'height'=>int, 'mime-type'=>string}\n\t */\n\tpublic function save( $destfilename = null, $mime_type = null ) {\n\t\t$saved = $this->_save( $this->image, $destfilename, $mime_type );\n\n\t\tif ( ! is_wp_error( $saved ) ) {\n\t\t\t$this->file      = $saved['path'];\n\t\t\t$this->mime_type = $saved['mime-type'];\n\n\t\t\ttry {\n\t\t\t\t$this->image->setImageFormat( strtoupper( $this->get_extension( $this->mime_type ) ) );\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\treturn new WP_Error( 'image_save_error', $e->getMessage(), $this->file );\n\t\t\t}\n\t\t}\n\n\t\treturn $saved;\n\t}\n\n\t/**\n\t * @param Imagick $image\n\t * @param string  $filename\n\t * @param string  $mime_type\n\t * @return array|WP_Error\n\t */\n\tprotected function _save( $image, $filename = null, $mime_type = null ) {\n\t\tlist( $filename, $extension, $mime_type ) = $this->get_output_format( $filename, $mime_type );\n\n\t\tif ( ! $filename ) {\n\t\t\t$filename = $this->generate_filename( null, null, $extension );\n\t\t}\n\n\t\ttry {\n\t\t\t// Store initial format.\n\t\t\t$orig_format = $this->image->getImageFormat();\n\n\t\t\t$this->image->setImageFormat( strtoupper( $this->get_extension( $mime_type ) ) );\n\t\t\t$this->make_image( $filename, array( $image, 'writeImage' ), array( $filename ) );\n\n\t\t\t// Reset original format.\n\t\t\t$this->image->setImageFormat( $orig_format );\n\t\t} catch ( Exception $e ) {\n\t\t\treturn new WP_Error( 'image_save_error', $e->getMessage(), $filename );\n\t\t}\n\n\t\t// Set correct file permissions.\n\t\t$stat  = stat( dirname( $filename ) );\n\t\t$perms = $stat['mode'] & 0000666; // Same permissions as parent folder, strip off the executable bits.\n\t\tchmod( $filename, $perms );\n\n\t\treturn array(\n\t\t\t'path'      => $filename,\n\t\t\t/** This filter is documented in wp-includes/class-wp-image-editor-gd.php */\n\t\t\t'file'      => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ),\n\t\t\t'width'     => $this->size['width'],\n\t\t\t'height'    => $this->size['height'],\n\t\t\t'mime-type' => $mime_type,\n\t\t);\n\t}\n\n\t/**\n\t * Streams current image to browser.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $mime_type The mime type of the image.\n\t * @return bool|WP_Error True on success, WP_Error object on failure.\n\t */\n\tpublic function stream( $mime_type = null ) {\n\t\tlist( $filename, $extension, $mime_type ) = $this->get_output_format( null, $mime_type );\n\n\t\ttry {\n\t\t\t// Temporarily change format for stream.\n\t\t\t$this->image->setImageFormat( strtoupper( $extension ) );\n\n\t\t\t// Output stream of image content.\n\t\t\theader( \"Content-Type: $mime_type\" );\n\t\t\tprint $this->image->getImageBlob();\n\n\t\t\t// Reset image to original format.\n\t\t\t$this->image->setImageFormat( $this->get_extension( $this->mime_type ) );\n\t\t} catch ( Exception $e ) {\n\t\t\treturn new WP_Error( 'image_stream_error', $e->getMessage() );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Strips all image meta except color profiles from an image.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @return true|WP_Error True if stripping metadata was successful. WP_Error object on error.\n\t */\n\tprotected function strip_meta() {\n\n\t\tif ( ! is_callable( array( $this->image, 'getImageProfiles' ) ) ) {\n\t\t\t/* translators: %s: ImageMagick method name. */\n\t\t\treturn new WP_Error( 'image_strip_meta_error', sprintf( __( '%s is required to strip image meta.' ), '<code>Imagick::getImageProfiles()</code>' ) );\n\t\t}\n\n\t\tif ( ! is_callable( array( $this->image, 'removeImageProfile' ) ) ) {\n\t\t\t/* translators: %s: ImageMagick method name. */\n\t\t\treturn new WP_Error( 'image_strip_meta_error', sprintf( __( '%s is required to strip image meta.' ), '<code>Imagick::removeImageProfile()</code>' ) );\n\t\t}\n\n\t\t/*\n\t\t * Protect a few profiles from being stripped for the following reasons:\n\t\t *\n\t\t * - icc:  Color profile information\n\t\t * - icm:  Color profile information\n\t\t * - iptc: Copyright data\n\t\t * - exif: Orientation data\n\t\t * - xmp:  Rights usage data\n\t\t */\n\t\t$protected_profiles = array(\n\t\t\t'icc',\n\t\t\t'icm',\n\t\t\t'iptc',\n\t\t\t'exif',\n\t\t\t'xmp',\n\t\t);\n\n\t\ttry {\n\t\t\t// Strip profiles.\n\t\t\tforeach ( $this->image->getImageProfiles( '*', true ) as $key => $value ) {\n\t\t\t\tif ( ! in_array( $key, $protected_profiles, true ) ) {\n\t\t\t\t\t$this->image->removeImageProfile( $key );\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\treturn new WP_Error( 'image_strip_meta_error', $e->getMessage() );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Sets up Imagick for PDF processing.\n\t * Increases rendering DPI and only loads first page.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return string|WP_Error File to load or WP_Error on failure.\n\t */\n\tprotected function pdf_setup() {\n\t\ttry {\n\t\t\t// By default, PDFs are rendered in a very low resolution.\n\t\t\t// We want the thumbnail to be readable, so increase the rendering DPI.\n\t\t\t$this->image->setResolution( 128, 128 );\n\n\t\t\t// When generating thumbnails from cropped PDF pages, Imagemagick uses the uncropped\n\t\t\t// area (resulting in unnecessary whitespace) unless the following option is set.\n\t\t\t$this->image->setOption( 'pdf:use-cropbox', true );\n\n\t\t\t// Only load the first page.\n\t\t\treturn $this->file . '[0]';\n\t\t} catch ( Exception $e ) {\n\t\t\treturn new WP_Error( 'pdf_setup_failed', $e->getMessage(), $this->file );\n\t\t}\n\t}\n\n}\n", "num_lines": 808}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Base WordPress Image Editor\n *\n * @package WordPress\n * @subpackage Image_Editor\n */\n\n/**\n * Base image editor class from which implementations extend\n *\n * @since 3.5.0\n */\nabstract class WP_Image_Editor {\n\tprotected $file              = null;\n\tprotected $size              = null;\n\tprotected $mime_type         = null;\n\tprotected $default_mime_type = 'image/jpeg';\n\tprotected $quality           = false;\n\tprotected $default_quality   = 82;\n\n\t/**\n\t * Each instance handles a single file.\n\t *\n\t * @param string $file Path to the file to load.\n\t */\n\tpublic function __construct( $file ) {\n\t\t$this->file = $file;\n\t}\n\n\t/**\n\t * Checks to see if current environment supports the editor chosen.\n\t * Must be overridden in a subclass.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @abstract\n\t *\n\t * @param array $args\n\t * @return bool\n\t */\n\tpublic static function test( $args = array() ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks to see if editor supports the mime-type specified.\n\t * Must be overridden in a subclass.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @abstract\n\t *\n\t * @param string $mime_type\n\t * @return bool\n\t */\n\tpublic static function supports_mime_type( $mime_type ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Loads image from $this->file into editor.\n\t *\n\t * @since 3.5.0\n\t * @abstract\n\t *\n\t * @return bool|WP_Error True if loaded; WP_Error on failure.\n\t */\n\tabstract public function load();\n\n\t/**\n\t * Saves current image to file.\n\t *\n\t * @since 3.5.0\n\t * @abstract\n\t *\n\t * @param string $destfilename\n\t * @param string $mime_type\n\t * @return array|WP_Error {'path'=>string, 'file'=>string, 'width'=>int, 'height'=>int, 'mime-type'=>string}\n\t */\n\tabstract public function save( $destfilename = null, $mime_type = null );\n\n\t/**\n\t * Resizes current image.\n\t *\n\t * At minimum, either a height or width must be provided.\n\t * If one of the two is set to null, the resize will\n\t * maintain aspect ratio according to the provided dimension.\n\t *\n\t * @since 3.5.0\n\t * @abstract\n\t *\n\t * @param int|null $max_w Image width.\n\t * @param int|null $max_h Image height.\n\t * @param bool     $crop\n\t * @return bool|WP_Error\n\t */\n\tabstract public function resize( $max_w, $max_h, $crop = false );\n\n\t/**\n\t * Resize multiple images from a single source.\n\t *\n\t * @since 3.5.0\n\t * @abstract\n\t *\n\t * @param array $sizes {\n\t *     An array of image size arrays. Default sizes are 'small', 'medium', 'large'.\n\t *\n\t *     @type array $size {\n\t *         @type int  $width  Image width.\n\t *         @type int  $height Image height.\n\t *         @type bool $crop   Optional. Whether to crop the image. Default false.\n\t *     }\n\t * }\n\t * @return array An array of resized images metadata by size.\n\t */\n\tabstract public function multi_resize( $sizes );\n\n\t/**\n\t * Crops Image.\n\t *\n\t * @since 3.5.0\n\t * @abstract\n\t *\n\t * @param int  $src_x   The start x position to crop from.\n\t * @param int  $src_y   The start y position to crop from.\n\t * @param int  $src_w   The width to crop.\n\t * @param int  $src_h   The height to crop.\n\t * @param int  $dst_w   Optional. The destination width.\n\t * @param int  $dst_h   Optional. The destination height.\n\t * @param bool $src_abs Optional. If the source crop points are absolute.\n\t * @return bool|WP_Error\n\t */\n\tabstract public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false );\n\n\t/**\n\t * Rotates current image counter-clockwise by $angle.\n\t *\n\t * @since 3.5.0\n\t * @abstract\n\t *\n\t * @param float $angle\n\t * @return bool|WP_Error\n\t */\n\tabstract public function rotate( $angle );\n\n\t/**\n\t * Flips current image.\n\t *\n\t * @since 3.5.0\n\t * @abstract\n\t *\n\t * @param bool $horz Flip along Horizontal Axis\n\t * @param bool $vert Flip along Vertical Axis\n\t * @return bool|WP_Error\n\t */\n\tabstract public function flip( $horz, $vert );\n\n\t/**\n\t * Streams current image to browser.\n\t *\n\t * @since 3.5.0\n\t * @abstract\n\t *\n\t * @param string $mime_type The mime type of the image.\n\t * @return bool|WP_Error True on success, WP_Error object or false on failure.\n\t */\n\tabstract public function stream( $mime_type = null );\n\n\t/**\n\t * Gets dimensions of image.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @return array {\n\t *     Dimensions of the image.\n\t *\n\t *     @type int $width  The image width.\n\t *     @type int $height The image height.\n\t * }\n\t */\n\tpublic function get_size() {\n\t\treturn $this->size;\n\t}\n\n\t/**\n\t * Sets current image size.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param int $width\n\t * @param int $height\n\t * @return true\n\t */\n\tprotected function update_size( $width = null, $height = null ) {\n\t\t$this->size = array(\n\t\t\t'width'  => (int) $width,\n\t\t\t'height' => (int) $height,\n\t\t);\n\t\treturn true;\n\t}\n\n\t/**\n\t * Gets the Image Compression quality on a 1-100% scale.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @return int Compression Quality. Range: [1,100]\n\t */\n\tpublic function get_quality() {\n\t\tif ( ! $this->quality ) {\n\t\t\t$this->set_quality();\n\t\t}\n\n\t\treturn $this->quality;\n\t}\n\n\t/**\n\t * Sets Image Compression quality on a 1-100% scale.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param int $quality Compression Quality. Range: [1,100]\n\t * @return true|WP_Error True if set successfully; WP_Error on failure.\n\t */\n\tpublic function set_quality( $quality = null ) {\n\t\tif ( null === $quality ) {\n\t\t\t/**\n\t\t\t * Filters the default image compression quality setting.\n\t\t\t *\n\t\t\t * Applies only during initial editor instantiation, or when set_quality() is run\n\t\t\t * manually without the `$quality` argument.\n\t\t\t *\n\t\t\t * The WP_Image_Editor::set_quality() method has priority over the filter.\n\t\t\t *\n\t\t\t * @since 3.5.0\n\t\t\t *\n\t\t\t * @param int    $quality   Quality level between 1 (low) and 100 (high).\n\t\t\t * @param string $mime_type Image mime type.\n\t\t\t */\n\t\t\t$quality = apply_filters( 'wp_editor_set_quality', $this->default_quality, $this->mime_type );\n\n\t\t\tif ( 'image/jpeg' === $this->mime_type ) {\n\t\t\t\t/**\n\t\t\t\t * Filters the JPEG compression quality for backward-compatibility.\n\t\t\t\t *\n\t\t\t\t * Applies only during initial editor instantiation, or when set_quality() is run\n\t\t\t\t * manually without the `$quality` argument.\n\t\t\t\t *\n\t\t\t\t * The WP_Image_Editor::set_quality() method has priority over the filter.\n\t\t\t\t *\n\t\t\t\t * The filter is evaluated under two contexts: 'image_resize', and 'edit_image',\n\t\t\t\t * (when a JPEG image is saved to file).\n\t\t\t\t *\n\t\t\t\t * @since 2.5.0\n\t\t\t\t *\n\t\t\t\t * @param int    $quality Quality level between 0 (low) and 100 (high) of the JPEG.\n\t\t\t\t * @param string $context Context of the filter.\n\t\t\t\t */\n\t\t\t\t$quality = apply_filters( 'jpeg_quality', $quality, 'image_resize' );\n\t\t\t}\n\n\t\t\tif ( $quality < 0 || $quality > 100 ) {\n\t\t\t\t$quality = $this->default_quality;\n\t\t\t}\n\t\t}\n\n\t\t// Allow 0, but squash to 1 due to identical images in GD, and for backward compatibility.\n\t\tif ( 0 === $quality ) {\n\t\t\t$quality = 1;\n\t\t}\n\n\t\tif ( ( $quality >= 1 ) && ( $quality <= 100 ) ) {\n\t\t\t$this->quality = $quality;\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn new WP_Error( 'invalid_image_quality', __( 'Attempted to set image quality outside of the range [1,100].' ) );\n\t\t}\n\t}\n\n\t/**\n\t * Returns preferred mime-type and extension based on provided\n\t * file's extension and mime, or current file's extension and mime.\n\t *\n\t * Will default to $this->default_mime_type if requested is not supported.\n\t *\n\t * Provides corrected filename only if filename is provided.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $filename\n\t * @param string $mime_type\n\t * @return array { filename|null, extension, mime-type }\n\t */\n\tprotected function get_output_format( $filename = null, $mime_type = null ) {\n\t\t$new_ext = null;\n\n\t\t// By default, assume specified type takes priority.\n\t\tif ( $mime_type ) {\n\t\t\t$new_ext = $this->get_extension( $mime_type );\n\t\t}\n\n\t\tif ( $filename ) {\n\t\t\t$file_ext  = strtolower( pathinfo( $filename, PATHINFO_EXTENSION ) );\n\t\t\t$file_mime = $this->get_mime_type( $file_ext );\n\t\t} else {\n\t\t\t// If no file specified, grab editor's current extension and mime-type.\n\t\t\t$file_ext  = strtolower( pathinfo( $this->file, PATHINFO_EXTENSION ) );\n\t\t\t$file_mime = $this->mime_type;\n\t\t}\n\n\t\t// Check to see if specified mime-type is the same as type implied by\n\t\t// file extension. If so, prefer extension from file.\n\t\tif ( ! $mime_type || ( $file_mime == $mime_type ) ) {\n\t\t\t$mime_type = $file_mime;\n\t\t\t$new_ext   = $file_ext;\n\t\t}\n\n\t\t// Double-check that the mime-type selected is supported by the editor.\n\t\t// If not, choose a default instead.\n\t\tif ( ! $this->supports_mime_type( $mime_type ) ) {\n\t\t\t/**\n\t\t\t * Filters default mime type prior to getting the file extension.\n\t\t\t *\n\t\t\t * @see wp_get_mime_types()\n\t\t\t *\n\t\t\t * @since 3.5.0\n\t\t\t *\n\t\t\t * @param string $mime_type Mime type string.\n\t\t\t */\n\t\t\t$mime_type = apply_filters( 'image_editor_default_mime_type', $this->default_mime_type );\n\t\t\t$new_ext   = $this->get_extension( $mime_type );\n\t\t}\n\n\t\tif ( $filename ) {\n\t\t\t$dir = pathinfo( $filename, PATHINFO_DIRNAME );\n\t\t\t$ext = pathinfo( $filename, PATHINFO_EXTENSION );\n\n\t\t\t$filename = trailingslashit( $dir ) . wp_basename( $filename, \".$ext\" ) . \".{$new_ext}\";\n\t\t}\n\n\t\treturn array( $filename, $new_ext, $mime_type );\n\t}\n\n\t/**\n\t * Builds an output filename based on current file, and adding proper suffix\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $suffix\n\t * @param string $dest_path\n\t * @param string $extension\n\t * @return string filename\n\t */\n\tpublic function generate_filename( $suffix = null, $dest_path = null, $extension = null ) {\n\t\t// $suffix will be appended to the destination filename, just before the extension.\n\t\tif ( ! $suffix ) {\n\t\t\t$suffix = $this->get_suffix();\n\t\t}\n\n\t\t$dir = pathinfo( $this->file, PATHINFO_DIRNAME );\n\t\t$ext = pathinfo( $this->file, PATHINFO_EXTENSION );\n\n\t\t$name    = wp_basename( $this->file, \".$ext\" );\n\t\t$new_ext = strtolower( $extension ? $extension : $ext );\n\n\t\tif ( ! is_null( $dest_path ) ) {\n\t\t\t$_dest_path = realpath( $dest_path );\n\t\t\tif ( $_dest_path ) {\n\t\t\t\t$dir = $_dest_path;\n\t\t\t}\n\t\t}\n\n\t\treturn trailingslashit( $dir ) . \"{$name}-{$suffix}.{$new_ext}\";\n\t}\n\n\t/**\n\t * Builds and returns proper suffix for file based on height and width.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @return string|false suffix\n\t */\n\tpublic function get_suffix() {\n\t\tif ( ! $this->get_size() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn \"{$this->size['width']}x{$this->size['height']}\";\n\t}\n\n\t/**\n\t * Check if a JPEG image has EXIF Orientation tag and rotate it if needed.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @return bool|WP_Error True if the image was rotated. False if not rotated (no EXIF data or the image doesn't need to be rotated).\n\t *                       WP_Error if error while rotating.\n\t */\n\tpublic function maybe_exif_rotate() {\n\t\t$orientation = null;\n\n\t\tif ( is_callable( 'exif_read_data' ) && 'image/jpeg' === $this->mime_type ) {\n\t\t\t$exif_data = @exif_read_data( $this->file );\n\n\t\t\tif ( ! empty( $exif_data['Orientation'] ) ) {\n\t\t\t\t$orientation = (int) $exif_data['Orientation'];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the `$orientation` value to correct it before rotating or to prevemnt rotating the image.\n\t\t *\n\t\t * @since 5.3.0\n\t\t *\n\t\t * @param int    $orientation EXIF Orientation value as retrieved from the image file.\n\t\t * @param string $file        Path to the image file.\n\t\t */\n\t\t$orientation = apply_filters( 'wp_image_maybe_exif_rotate', $orientation, $this->file );\n\n\t\tif ( ! $orientation || 1 === $orientation ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch ( $orientation ) {\n\t\t\tcase 2:\n\t\t\t\t// Flip horizontally.\n\t\t\t\t$result = $this->flip( true, false );\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t// Rotate 180 degrees or flip horizontally and vertically.\n\t\t\t\t// Flipping seems faster and uses less resources.\n\t\t\t\t$result = $this->flip( true, true );\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t// Flip vertically.\n\t\t\t\t$result = $this->flip( false, true );\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t// Rotate 90 degrees counter-clockwise and flip vertically.\n\t\t\t\t$result = $this->rotate( 90 );\n\n\t\t\t\tif ( ! is_wp_error( $result ) ) {\n\t\t\t\t\t$result = $this->flip( false, true );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\t// Rotate 90 degrees clockwise (270 counter-clockwise).\n\t\t\t\t$result = $this->rotate( 270 );\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\t// Rotate 90 degrees counter-clockwise and flip horizontally.\n\t\t\t\t$result = $this->rotate( 90 );\n\n\t\t\t\tif ( ! is_wp_error( $result ) ) {\n\t\t\t\t\t$result = $this->flip( true, false );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t// Rotate 90 degrees counter-clockwise.\n\t\t\t\t$result = $this->rotate( 90 );\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Either calls editor's save function or handles file as a stream.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string|stream $filename\n\t * @param callable      $function\n\t * @param array         $arguments\n\t * @return bool\n\t */\n\tprotected function make_image( $filename, $function, $arguments ) {\n\t\t$stream = wp_is_stream( $filename );\n\t\tif ( $stream ) {\n\t\t\tob_start();\n\t\t} else {\n\t\t\t// The directory containing the original file may no longer exist when using a replication plugin.\n\t\t\twp_mkdir_p( dirname( $filename ) );\n\t\t}\n\n\t\t$result = call_user_func_array( $function, $arguments );\n\n\t\tif ( $result && $stream ) {\n\t\t\t$contents = ob_get_contents();\n\n\t\t\t$fp = fopen( $filename, 'w' );\n\n\t\t\tif ( ! $fp ) {\n\t\t\t\tob_end_clean();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tfwrite( $fp, $contents );\n\t\t\tfclose( $fp );\n\t\t}\n\n\t\tif ( $stream ) {\n\t\t\tob_end_clean();\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Returns first matched mime-type from extension,\n\t * as mapped from wp_get_mime_types()\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $extension\n\t * @return string|false\n\t */\n\tprotected static function get_mime_type( $extension = null ) {\n\t\tif ( ! $extension ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$mime_types = wp_get_mime_types();\n\t\t$extensions = array_keys( $mime_types );\n\n\t\tforeach ( $extensions as $_extension ) {\n\t\t\tif ( preg_match( \"/{$extension}/i\", $_extension ) ) {\n\t\t\t\treturn $mime_types[ $_extension ];\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Returns first matched extension from Mime-type,\n\t * as mapped from wp_get_mime_types()\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $mime_type\n\t * @return string|false\n\t */\n\tprotected static function get_extension( $mime_type = null ) {\n\t\t$extensions = explode( '|', array_search( $mime_type, wp_get_mime_types(), true ) );\n\n\t\tif ( empty( $extensions[0] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $extensions[0];\n\t}\n}\n\n", "num_lines": 558}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress List utility class\n *\n * @package WordPress\n * @since 4.7.0\n */\n\n/**\n * List utility.\n *\n * Utility class to handle operations on an array of objects.\n *\n * @since 4.7.0\n */\nclass WP_List_Util {\n\t/**\n\t * The input array.\n\t *\n\t * @since 4.7.0\n\t * @var array\n\t */\n\tprivate $input = array();\n\n\t/**\n\t * The output array.\n\t *\n\t * @since 4.7.0\n\t * @var array\n\t */\n\tprivate $output = array();\n\n\t/**\n\t * Temporary arguments for sorting.\n\t *\n\t * @since 4.7.0\n\t * @var array\n\t */\n\tprivate $orderby = array();\n\n\t/**\n\t * Constructor.\n\t *\n\t * Sets the input array.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $input Array to perform operations on.\n\t */\n\tpublic function __construct( $input ) {\n\t\t$this->output = $input;\n\t\t$this->input  = $input;\n\t}\n\n\t/**\n\t * Returns the original input array.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array The input array.\n\t */\n\tpublic function get_input() {\n\t\treturn $this->input;\n\t}\n\n\t/**\n\t * Returns the output array.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array The output array.\n\t */\n\tpublic function get_output() {\n\t\treturn $this->output;\n\t}\n\n\t/**\n\t * Filters the list, based on a set of key => value arguments.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array  $args     Optional. An array of key => value arguments to match\n\t *                         against each object. Default empty array.\n\t * @param string $operator Optional. The logical operation to perform. 'AND' means\n\t *                         all elements from the array must match. 'OR' means only\n\t *                         one element needs to match. 'NOT' means no elements may\n\t *                         match. Default 'AND'.\n\t * @return array Array of found values.\n\t */\n\tpublic function filter( $args = array(), $operator = 'AND' ) {\n\t\tif ( empty( $args ) ) {\n\t\t\treturn $this->output;\n\t\t}\n\n\t\t$operator = strtoupper( $operator );\n\n\t\tif ( ! in_array( $operator, array( 'AND', 'OR', 'NOT' ), true ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$count    = count( $args );\n\t\t$filtered = array();\n\n\t\tforeach ( $this->output as $key => $obj ) {\n\t\t\t$matched = 0;\n\n\t\t\tforeach ( $args as $m_key => $m_value ) {\n\t\t\t\tif ( is_array( $obj ) ) {\n\t\t\t\t\t// Treat object as an array.\n\t\t\t\t\tif ( array_key_exists( $m_key, $obj ) && ( $m_value == $obj[ $m_key ] ) ) {\n\t\t\t\t\t\t$matched++;\n\t\t\t\t\t}\n\t\t\t\t} elseif ( is_object( $obj ) ) {\n\t\t\t\t\t// Treat object as an object.\n\t\t\t\t\tif ( isset( $obj->{$m_key} ) && ( $m_value == $obj->{$m_key} ) ) {\n\t\t\t\t\t\t$matched++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ( 'AND' === $operator && $matched === $count )\n\t\t\t\t|| ( 'OR' === $operator && $matched > 0 )\n\t\t\t\t|| ( 'NOT' === $operator && 0 === $matched )\n\t\t\t) {\n\t\t\t\t$filtered[ $key ] = $obj;\n\t\t\t}\n\t\t}\n\n\t\t$this->output = $filtered;\n\n\t\treturn $this->output;\n\t}\n\n\t/**\n\t * Plucks a certain field out of each object in the list.\n\t *\n\t * This has the same functionality and prototype of\n\t * array_column() (PHP 5.5) but also supports objects.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param int|string $field     Field from the object to place instead of the entire object\n\t * @param int|string $index_key Optional. Field from the object to use as keys for the new array.\n\t *                              Default null.\n\t * @return array Array of found values. If `$index_key` is set, an array of found values with keys\n\t *               corresponding to `$index_key`. If `$index_key` is null, array keys from the original\n\t *               `$list` will be preserved in the results.\n\t */\n\tpublic function pluck( $field, $index_key = null ) {\n\t\t$newlist = array();\n\n\t\tif ( ! $index_key ) {\n\t\t\t/*\n\t\t\t * This is simple. Could at some point wrap array_column()\n\t\t\t * if we knew we had an array of arrays.\n\t\t\t */\n\t\t\tforeach ( $this->output as $key => $value ) {\n\t\t\t\tif ( is_object( $value ) ) {\n\t\t\t\t\t$newlist[ $key ] = $value->$field;\n\t\t\t\t} else {\n\t\t\t\t\t$newlist[ $key ] = $value[ $field ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->output = $newlist;\n\n\t\t\treturn $this->output;\n\t\t}\n\n\t\t/*\n\t\t * When index_key is not set for a particular item, push the value\n\t\t * to the end of the stack. This is how array_column() behaves.\n\t\t */\n\t\tforeach ( $this->output as $value ) {\n\t\t\tif ( is_object( $value ) ) {\n\t\t\t\tif ( isset( $value->$index_key ) ) {\n\t\t\t\t\t$newlist[ $value->$index_key ] = $value->$field;\n\t\t\t\t} else {\n\t\t\t\t\t$newlist[] = $value->$field;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isset( $value[ $index_key ] ) ) {\n\t\t\t\t\t$newlist[ $value[ $index_key ] ] = $value[ $field ];\n\t\t\t\t} else {\n\t\t\t\t\t$newlist[] = $value[ $field ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->output = $newlist;\n\n\t\treturn $this->output;\n\t}\n\n\t/**\n\t * Sorts the list, based on one or more orderby arguments.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string|array $orderby       Optional. Either the field name to order by or an array\n\t *                                    of multiple orderby fields as $orderby => $order.\n\t * @param string       $order         Optional. Either 'ASC' or 'DESC'. Only used if $orderby\n\t *                                    is a string.\n\t * @param bool         $preserve_keys Optional. Whether to preserve keys. Default false.\n\t * @return array The sorted array.\n\t */\n\tpublic function sort( $orderby = array(), $order = 'ASC', $preserve_keys = false ) {\n\t\tif ( empty( $orderby ) ) {\n\t\t\treturn $this->output;\n\t\t}\n\n\t\tif ( is_string( $orderby ) ) {\n\t\t\t$orderby = array( $orderby => $order );\n\t\t}\n\n\t\tforeach ( $orderby as $field => $direction ) {\n\t\t\t$orderby[ $field ] = 'DESC' === strtoupper( $direction ) ? 'DESC' : 'ASC';\n\t\t}\n\n\t\t$this->orderby = $orderby;\n\n\t\tif ( $preserve_keys ) {\n\t\t\tuasort( $this->output, array( $this, 'sort_callback' ) );\n\t\t} else {\n\t\t\tusort( $this->output, array( $this, 'sort_callback' ) );\n\t\t}\n\n\t\t$this->orderby = array();\n\n\t\treturn $this->output;\n\t}\n\n\t/**\n\t * Callback to sort the list by specific fields.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see WP_List_Util::sort()\n\t *\n\t * @param object|array $a One object to compare.\n\t * @param object|array $b The other object to compare.\n\t * @return int 0 if both objects equal. -1 if second object should come first, 1 otherwise.\n\t */\n\tprivate function sort_callback( $a, $b ) {\n\t\tif ( empty( $this->orderby ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$a = (array) $a;\n\t\t$b = (array) $b;\n\n\t\tforeach ( $this->orderby as $field => $direction ) {\n\t\t\tif ( ! isset( $a[ $field ] ) || ! isset( $b[ $field ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $a[ $field ] == $b[ $field ] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$results = 'DESC' === $direction ? array( 1, -1 ) : array( -1, 1 );\n\n\t\t\tif ( is_numeric( $a[ $field ] ) && is_numeric( $b[ $field ] ) ) {\n\t\t\t\treturn ( $a[ $field ] < $b[ $field ] ) ? $results[0] : $results[1];\n\t\t\t}\n\n\t\t\treturn 0 > strcmp( $a[ $field ], $b[ $field ] ) ? $results[0] : $results[1];\n\t\t}\n\n\t\treturn 0;\n\t}\n}\n", "num_lines": 273}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Locale API: WP_Locale_Switcher class\n *\n * @package WordPress\n * @subpackage i18n\n * @since 4.7.0\n */\n\n/**\n * Core class used for switching locales.\n *\n * @since 4.7.0\n */\nclass WP_Locale_Switcher {\n\t/**\n\t * Locale stack.\n\t *\n\t * @since 4.7.0\n\t * @var string[]\n\t */\n\tprivate $locales = array();\n\n\t/**\n\t * Original locale.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tprivate $original_locale;\n\n\t/**\n\t * Holds all available languages.\n\t *\n\t * @since 4.7.0\n\t * @var array An array of language codes (file names without the .mo extension).\n\t */\n\tprivate $available_languages = array();\n\n\t/**\n\t * Constructor.\n\t *\n\t * Stores the original locale as well as a list of all available languages.\n\t *\n\t * @since 4.7.0\n\t */\n\tpublic function __construct() {\n\t\t$this->original_locale     = determine_locale();\n\t\t$this->available_languages = array_merge( array( 'en_US' ), get_available_languages() );\n\t}\n\n\t/**\n\t * Initializes the locale switcher.\n\t *\n\t * Hooks into the {@see 'locale'} filter to change the locale on the fly.\n\t *\n\t * @since 4.7.0\n\t */\n\tpublic function init() {\n\t\tadd_filter( 'locale', array( $this, 'filter_locale' ) );\n\t}\n\n\t/**\n\t * Switches the translations according to the given locale.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $locale The locale to switch to.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function switch_to_locale( $locale ) {\n\t\t$current_locale = determine_locale();\n\t\tif ( $current_locale === $locale ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! in_array( $locale, $this->available_languages, true ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->locales[] = $locale;\n\n\t\t$this->change_locale( $locale );\n\n\t\t/**\n\t\t * Fires when the locale is switched.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param string $locale The new locale.\n\t\t */\n\t\tdo_action( 'switch_locale', $locale );\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Restores the translations according to the previous locale.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return string|false Locale on success, false on failure.\n\t */\n\tpublic function restore_previous_locale() {\n\t\t$previous_locale = array_pop( $this->locales );\n\n\t\tif ( null === $previous_locale ) {\n\t\t\t// The stack is empty, bail.\n\t\t\treturn false;\n\t\t}\n\n\t\t$locale = end( $this->locales );\n\n\t\tif ( ! $locale ) {\n\t\t\t// There's nothing left in the stack: go back to the original locale.\n\t\t\t$locale = $this->original_locale;\n\t\t}\n\n\t\t$this->change_locale( $locale );\n\n\t\t/**\n\t\t * Fires when the locale is restored to the previous one.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param string $locale          The new locale.\n\t\t * @param string $previous_locale The previous locale.\n\t\t */\n\t\tdo_action( 'restore_previous_locale', $locale, $previous_locale );\n\n\t\treturn $locale;\n\t}\n\n\t/**\n\t * Restores the translations according to the original locale.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return string|false Locale on success, false on failure.\n\t */\n\tpublic function restore_current_locale() {\n\t\tif ( empty( $this->locales ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->locales = array( $this->original_locale );\n\n\t\treturn $this->restore_previous_locale();\n\t}\n\n\t/**\n\t * Whether switch_to_locale() is in effect.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return bool True if the locale has been switched, false otherwise.\n\t */\n\tpublic function is_switched() {\n\t\treturn ! empty( $this->locales );\n\t}\n\n\t/**\n\t * Filters the locale of the WordPress installation.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $locale The locale of the WordPress installation.\n\t * @return string The locale currently being switched to.\n\t */\n\tpublic function filter_locale( $locale ) {\n\t\t$switched_locale = end( $this->locales );\n\n\t\tif ( $switched_locale ) {\n\t\t\treturn $switched_locale;\n\t\t}\n\n\t\treturn $locale;\n\t}\n\n\t/**\n\t * Load translations for a given locale.\n\t *\n\t * When switching to a locale, translations for this locale must be loaded from scratch.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @global Mo[] $l10n An array of all currently loaded text domains.\n\t *\n\t * @param string $locale The locale to load translations for.\n\t */\n\tprivate function load_translations( $locale ) {\n\t\tglobal $l10n;\n\n\t\t$domains = $l10n ? array_keys( $l10n ) : array();\n\n\t\tload_default_textdomain( $locale );\n\n\t\tforeach ( $domains as $domain ) {\n\t\t\tif ( 'default' === $domain ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tunload_textdomain( $domain );\n\t\t\tget_translations_for_domain( $domain );\n\t\t}\n\t}\n\n\t/**\n\t * Changes the site's locale to the given one.\n\t *\n\t * Loads the translations, changes the global `$wp_locale` object and updates\n\t * all post type labels.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @global WP_Locale $wp_locale WordPress date and time locale object.\n\t *\n\t * @param string $locale The locale to change to.\n\t */\n\tprivate function change_locale( $locale ) {\n\t\t// Reset translation availability information.\n\t\t_get_path_to_translation( null, true );\n\n\t\t$this->load_translations( $locale );\n\n\t\t$GLOBALS['wp_locale'] = new WP_Locale();\n\n\t\t/**\n\t\t * Fires when the locale is switched to or restored.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param string $locale The new locale.\n\t\t */\n\t\tdo_action( 'change_locale', $locale );\n\t}\n}\n", "num_lines": 238}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Locale API: WP_Locale class\n *\n * @package WordPress\n * @subpackage i18n\n * @since 4.6.0\n */\n\n/**\n * Core class used to store translated data for a locale.\n *\n * @since 2.1.0\n * @since 4.6.0 Moved to its own file from wp-includes/locale.php.\n */\nclass WP_Locale {\n\t/**\n\t * Stores the translated strings for the full weekday names.\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t */\n\tpublic $weekday;\n\n\t/**\n\t * Stores the translated strings for the one character weekday names.\n\t *\n\t * There is a hack to make sure that Tuesday and Thursday, as well\n\t * as Sunday and Saturday, don't conflict. See init() method for more.\n\t *\n\t * @see WP_Locale::init() for how to handle the hack.\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t */\n\tpublic $weekday_initial;\n\n\t/**\n\t * Stores the translated strings for the abbreviated weekday names.\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t */\n\tpublic $weekday_abbrev;\n\n\t/**\n\t * Stores the translated strings for the full month names.\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t */\n\tpublic $month;\n\n\t/**\n\t * Stores the translated strings for the month names in genitive case, if the locale specifies.\n\t *\n\t * @since 4.4.0\n\t * @var array\n\t */\n\tpublic $month_genitive;\n\n\t/**\n\t * Stores the translated strings for the abbreviated month names.\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t */\n\tpublic $month_abbrev;\n\n\t/**\n\t * Stores the translated strings for 'am' and 'pm'.\n\t *\n\t * Also the capitalized versions.\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t */\n\tpublic $meridiem;\n\n\t/**\n\t * The text direction of the locale language.\n\t *\n\t * Default is left to right 'ltr'.\n\t *\n\t * @since 2.1.0\n\t * @var string\n\t */\n\tpublic $text_direction = 'ltr';\n\n\t/**\n\t * The thousands separator and decimal point values used for localizing numbers.\n\t *\n\t * @since 2.3.0\n\t * @var array\n\t */\n\tpublic $number_format;\n\n\t/**\n\t * Constructor which calls helper methods to set up object variables.\n\t *\n\t * @since 2.1.0\n\t */\n\tpublic function __construct() {\n\t\t$this->init();\n\t\t$this->register_globals();\n\t}\n\n\t/**\n\t * Sets up the translated strings and object properties.\n\t *\n\t * The method creates the translatable strings for various\n\t * calendar elements. Which allows for specifying locale\n\t * specific calendar names and text direction.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @global string $text_direction\n\t * @global string $wp_version     The WordPress version string.\n\t */\n\tpublic function init() {\n\t\t// The weekdays.\n\t\t$this->weekday[0] = /* translators: Weekday. */ __( 'Sunday' );\n\t\t$this->weekday[1] = /* translators: Weekday. */ __( 'Monday' );\n\t\t$this->weekday[2] = /* translators: Weekday. */ __( 'Tuesday' );\n\t\t$this->weekday[3] = /* translators: Weekday. */ __( 'Wednesday' );\n\t\t$this->weekday[4] = /* translators: Weekday. */ __( 'Thursday' );\n\t\t$this->weekday[5] = /* translators: Weekday. */ __( 'Friday' );\n\t\t$this->weekday[6] = /* translators: Weekday. */ __( 'Saturday' );\n\n\t\t// The first letter of each day.\n\t\t$this->weekday_initial[ __( 'Sunday' ) ]    = /* translators: One-letter abbreviation of the weekday. */ _x( 'S', 'Sunday initial' );\n\t\t$this->weekday_initial[ __( 'Monday' ) ]    = /* translators: One-letter abbreviation of the weekday. */ _x( 'M', 'Monday initial' );\n\t\t$this->weekday_initial[ __( 'Tuesday' ) ]   = /* translators: One-letter abbreviation of the weekday. */ _x( 'T', 'Tuesday initial' );\n\t\t$this->weekday_initial[ __( 'Wednesday' ) ] = /* translators: One-letter abbreviation of the weekday. */ _x( 'W', 'Wednesday initial' );\n\t\t$this->weekday_initial[ __( 'Thursday' ) ]  = /* translators: One-letter abbreviation of the weekday. */ _x( 'T', 'Thursday initial' );\n\t\t$this->weekday_initial[ __( 'Friday' ) ]    = /* translators: One-letter abbreviation of the weekday. */ _x( 'F', 'Friday initial' );\n\t\t$this->weekday_initial[ __( 'Saturday' ) ]  = /* translators: One-letter abbreviation of the weekday. */ _x( 'S', 'Saturday initial' );\n\n\t\t// Abbreviations for each day.\n\t\t$this->weekday_abbrev[ __( 'Sunday' ) ]    = /* translators: Three-letter abbreviation of the weekday. */ __( 'Sun' );\n\t\t$this->weekday_abbrev[ __( 'Monday' ) ]    = /* translators: Ttree-letter abbreviation of the weekday. */ __( 'Mon' );\n\t\t$this->weekday_abbrev[ __( 'Tuesday' ) ]   = /* translators: Three-letter abbreviation of the weekday. */ __( 'Tue' );\n\t\t$this->weekday_abbrev[ __( 'Wednesday' ) ] = /* translators: Three-letter abbreviation of the weekday. */ __( 'Wed' );\n\t\t$this->weekday_abbrev[ __( 'Thursday' ) ]  = /* translators: Three-letter abbreviation of the weekday. */ __( 'Thu' );\n\t\t$this->weekday_abbrev[ __( 'Friday' ) ]    = /* translators: Three-letter abbreviation of the weekday. */ __( 'Fri' );\n\t\t$this->weekday_abbrev[ __( 'Saturday' ) ]  = /* translators: Three-letter abbreviation of the weekday. */ __( 'Sat' );\n\n\t\t// The months.\n\t\t$this->month['01'] = /* translators: Month name. */ __( 'January' );\n\t\t$this->month['02'] = /* translators: Month name. */ __( 'February' );\n\t\t$this->month['03'] = /* translators: Month name. */ __( 'March' );\n\t\t$this->month['04'] = /* translators: Month name. */ __( 'April' );\n\t\t$this->month['05'] = /* translators: Month name. */ __( 'May' );\n\t\t$this->month['06'] = /* translators: Month name. */ __( 'June' );\n\t\t$this->month['07'] = /* translators: Month name. */ __( 'July' );\n\t\t$this->month['08'] = /* translators: Month name. */ __( 'August' );\n\t\t$this->month['09'] = /* translators: Month name. */ __( 'September' );\n\t\t$this->month['10'] = /* translators: Month name. */ __( 'October' );\n\t\t$this->month['11'] = /* translators: Month name. */ __( 'November' );\n\t\t$this->month['12'] = /* translators: Month name. */ __( 'December' );\n\n\t\t// The months, genitive.\n\t\t$this->month_genitive['01'] = /* translators: Month name, genitive. */ _x( 'January', 'genitive' );\n\t\t$this->month_genitive['02'] = /* translators: Month name, genitive. */ _x( 'February', 'genitive' );\n\t\t$this->month_genitive['03'] = /* translators: Month name, genitive. */ _x( 'March', 'genitive' );\n\t\t$this->month_genitive['04'] = /* translators: Month name, genitive. */ _x( 'April', 'genitive' );\n\t\t$this->month_genitive['05'] = /* translators: Month name, genitive. */ _x( 'May', 'genitive' );\n\t\t$this->month_genitive['06'] = /* translators: Month name, genitive. */ _x( 'June', 'genitive' );\n\t\t$this->month_genitive['07'] = /* translators: Month name, genitive. */ _x( 'July', 'genitive' );\n\t\t$this->month_genitive['08'] = /* translators: Month name, genitive. */ _x( 'August', 'genitive' );\n\t\t$this->month_genitive['09'] = /* translators: Month name, genitive. */ _x( 'September', 'genitive' );\n\t\t$this->month_genitive['10'] = /* translators: Month name, genitive. */ _x( 'October', 'genitive' );\n\t\t$this->month_genitive['11'] = /* translators: Month name, genitive. */ _x( 'November', 'genitive' );\n\t\t$this->month_genitive['12'] = /* translators: Month name, genitive. */ _x( 'December', 'genitive' );\n\n\t\t// Abbreviations for each month.\n\t\t$this->month_abbrev[ __( 'January' ) ]   = /* translators: Three-letter abbreviation of the month. */ _x( 'Jan', 'January abbreviation' );\n\t\t$this->month_abbrev[ __( 'February' ) ]  = /* translators: Three-letter abbreviation of the month. */ _x( 'Feb', 'February abbreviation' );\n\t\t$this->month_abbrev[ __( 'March' ) ]     = /* translators: Three-letter abbreviation of the month. */ _x( 'Mar', 'March abbreviation' );\n\t\t$this->month_abbrev[ __( 'April' ) ]     = /* translators: Three-letter abbreviation of the month. */ _x( 'Apr', 'April abbreviation' );\n\t\t$this->month_abbrev[ __( 'May' ) ]       = /* translators: Three-letter abbreviation of the month. */ _x( 'May', 'May abbreviation' );\n\t\t$this->month_abbrev[ __( 'June' ) ]      = /* translators: Three-letter abbreviation of the month. */ _x( 'Jun', 'June abbreviation' );\n\t\t$this->month_abbrev[ __( 'July' ) ]      = /* translators: Three-letter abbreviation of the month. */ _x( 'Jul', 'July abbreviation' );\n\t\t$this->month_abbrev[ __( 'August' ) ]    = /* translators: Three-letter abbreviation of the month. */ _x( 'Aug', 'August abbreviation' );\n\t\t$this->month_abbrev[ __( 'September' ) ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Sep', 'September abbreviation' );\n\t\t$this->month_abbrev[ __( 'October' ) ]   = /* translators: Three-letter abbreviation of the month. */ _x( 'Oct', 'October abbreviation' );\n\t\t$this->month_abbrev[ __( 'November' ) ]  = /* translators: Three-letter abbreviation of the month. */ _x( 'Nov', 'November abbreviation' );\n\t\t$this->month_abbrev[ __( 'December' ) ]  = /* translators: Three-letter abbreviation of the month. */ _x( 'Dec', 'December abbreviation' );\n\n\t\t// The meridiems.\n\t\t$this->meridiem['am'] = __( 'am' );\n\t\t$this->meridiem['pm'] = __( 'pm' );\n\t\t$this->meridiem['AM'] = __( 'AM' );\n\t\t$this->meridiem['PM'] = __( 'PM' );\n\n\t\t// Numbers formatting.\n\t\t// See https://www.php.net/number_format\n\n\t\t/* translators: $thousands_sep argument for https://www.php.net/number_format, default is ',' */\n\t\t$thousands_sep = __( 'number_format_thousands_sep' );\n\n\t\t// Replace space with a non-breaking space to avoid wrapping.\n\t\t$thousands_sep = str_replace( ' ', '&nbsp;', $thousands_sep );\n\n\t\t$this->number_format['thousands_sep'] = ( 'number_format_thousands_sep' === $thousands_sep ) ? ',' : $thousands_sep;\n\n\t\t/* translators: $dec_point argument for https://www.php.net/number_format, default is '.' */\n\t\t$decimal_point = __( 'number_format_decimal_point' );\n\n\t\t$this->number_format['decimal_point'] = ( 'number_format_decimal_point' === $decimal_point ) ? '.' : $decimal_point;\n\n\t\t// Set text direction.\n\t\tif ( isset( $GLOBALS['text_direction'] ) ) {\n\t\t\t$this->text_direction = $GLOBALS['text_direction'];\n\n\t\t\t/* translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. */\n\t\t} elseif ( 'rtl' === _x( 'ltr', 'text direction' ) ) {\n\t\t\t$this->text_direction = 'rtl';\n\t\t}\n\t}\n\n\t/**\n\t * Retrieve the full translated weekday word.\n\t *\n\t * Week starts on translated Sunday and can be fetched\n\t * by using 0 (zero). So the week starts with 0 (zero)\n\t * and ends on Saturday with is fetched by using 6 (six).\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param int $weekday_number 0 for Sunday through 6 Saturday.\n\t * @return string Full translated weekday.\n\t */\n\tpublic function get_weekday( $weekday_number ) {\n\t\treturn $this->weekday[ $weekday_number ];\n\t}\n\n\t/**\n\t * Retrieve the translated weekday initial.\n\t *\n\t * The weekday initial is retrieved by the translated\n\t * full weekday word. When translating the weekday initial\n\t * pay attention to make sure that the starting letter does\n\t * not conflict.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $weekday_name Full translated weekday word.\n\t * @return string Translated weekday initial.\n\t */\n\tpublic function get_weekday_initial( $weekday_name ) {\n\t\treturn $this->weekday_initial[ $weekday_name ];\n\t}\n\n\t/**\n\t * Retrieve the translated weekday abbreviation.\n\t *\n\t * The weekday abbreviation is retrieved by the translated\n\t * full weekday word.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $weekday_name Full translated weekday word.\n\t * @return string Translated weekday abbreviation.\n\t */\n\tpublic function get_weekday_abbrev( $weekday_name ) {\n\t\treturn $this->weekday_abbrev[ $weekday_name ];\n\t}\n\n\t/**\n\t * Retrieve the full translated month by month number.\n\t *\n\t * The $month_number parameter has to be a string\n\t * because it must have the '0' in front of any number\n\t * that is less than 10. Starts from '01' and ends at\n\t * '12'.\n\t *\n\t * You can use an integer instead and it will add the\n\t * '0' before the numbers less than 10 for you.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string|int $month_number '01' through '12'.\n\t * @return string Translated full month name.\n\t */\n\tpublic function get_month( $month_number ) {\n\t\treturn $this->month[ zeroise( $month_number, 2 ) ];\n\t}\n\n\t/**\n\t * Retrieve translated version of month abbreviation string.\n\t *\n\t * The $month_name parameter is expected to be the translated or\n\t * translatable version of the month.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $month_name Translated month to get abbreviated version.\n\t * @return string Translated abbreviated month.\n\t */\n\tpublic function get_month_abbrev( $month_name ) {\n\t\treturn $this->month_abbrev[ $month_name ];\n\t}\n\n\t/**\n\t * Retrieve translated version of meridiem string.\n\t *\n\t * The $meridiem parameter is expected to not be translated.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $meridiem Either 'am', 'pm', 'AM', or 'PM'. Not translated version.\n\t * @return string Translated version\n\t */\n\tpublic function get_meridiem( $meridiem ) {\n\t\treturn $this->meridiem[ $meridiem ];\n\t}\n\n\t/**\n\t * Global variables are deprecated.\n\t *\n\t * For backward compatibility only.\n\t *\n\t * @deprecated For backward compatibility only.\n\t *\n\t * @global array $weekday\n\t * @global array $weekday_initial\n\t * @global array $weekday_abbrev\n\t * @global array $month\n\t * @global array $month_abbrev\n\t *\n\t * @since 2.1.0\n\t */\n\tpublic function register_globals() {\n\t\t$GLOBALS['weekday']         = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev']  = $this->weekday_abbrev;\n\t\t$GLOBALS['month']           = $this->month;\n\t\t$GLOBALS['month_abbrev']    = $this->month_abbrev;\n\t}\n\n\t/**\n\t * Checks if current locale is RTL.\n\t *\n\t * @since 3.0.0\n\t * @return bool Whether locale is RTL.\n\t */\n\tpublic function is_rtl() {\n\t\treturn 'rtl' === $this->text_direction;\n\t}\n\n\t/**\n\t * Register date/time format strings for general POT.\n\t *\n\t * Private, unused method to add some date/time formats translated\n\t * on wp-admin/options-general.php to the general POT that would\n\t * otherwise be added to the admin POT.\n\t *\n\t * @since 3.6.0\n\t */\n\tpublic function _strings_for_pot() {\n\t\t/* translators: Localized date format, see https://www.php.net/date */\n\t\t__( 'F j, Y' );\n\t\t/* translators: Localized time format, see https://www.php.net/date */\n\t\t__( 'g:i a' );\n\t\t/* translators: Localized date and time format, see https://www.php.net/date */\n\t\t__( 'F j, Y g:i a' );\n\t}\n}\n", "num_lines": 370}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WP_MatchesMapRegex helper class\n *\n * @package WordPress\n * @since 4.7.0\n */\n\n/**\n * Helper class to remove the need to use eval to replace $matches[] in query strings.\n *\n * @since 2.9.0\n */\nclass WP_MatchesMapRegex {\n\t/**\n\t * store for matches\n\t *\n\t * @var array\n\t */\n\tprivate $_matches;\n\n\t/**\n\t * store for mapping result\n\t *\n\t * @var string\n\t */\n\tpublic $output;\n\n\t/**\n\t * subject to perform mapping on (query string containing $matches[] references\n\t *\n\t * @var string\n\t */\n\tprivate $_subject;\n\n\t/**\n\t * regexp pattern to match $matches[] references\n\t *\n\t * @var string\n\t */\n\tpublic $_pattern = '(\\$matches\\[[1-9]+[0-9]*\\])'; // Magic number.\n\n\t/**\n\t * constructor\n\t *\n\t * @param string $subject subject if regex\n\t * @param array  $matches data to use in map\n\t */\n\tpublic function __construct( $subject, $matches ) {\n\t\t$this->_subject = $subject;\n\t\t$this->_matches = $matches;\n\t\t$this->output   = $this->_map();\n\t}\n\n\t/**\n\t * Substitute substring matches in subject.\n\t *\n\t * static helper function to ease use\n\t *\n\t * @param string $subject subject\n\t * @param array  $matches data used for substitution\n\t * @return string\n\t */\n\tpublic static function apply( $subject, $matches ) {\n\t\t$oSelf = new WP_MatchesMapRegex( $subject, $matches );\n\t\treturn $oSelf->output;\n\t}\n\n\t/**\n\t * do the actual mapping\n\t *\n\t * @return string\n\t */\n\tprivate function _map() {\n\t\t$callback = array( $this, 'callback' );\n\t\treturn preg_replace_callback( $this->_pattern, $callback, $this->_subject );\n\t}\n\n\t/**\n\t * preg_replace_callback hook\n\t *\n\t * @param array $matches preg_replace regexp matches\n\t * @return string\n\t */\n\tpublic function callback( $matches ) {\n\t\t$index = intval( substr( $matches[0], 9, -1 ) );\n\t\treturn ( isset( $this->_matches[ $index ] ) ? urlencode( $this->_matches[ $index ] ) : '' );\n\t}\n}\n", "num_lines": 90}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Meta API: WP_Meta_Query class\n *\n * @package WordPress\n * @subpackage Meta\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement meta queries for the Meta API.\n *\n * Used for generating SQL clauses that filter a primary query according to metadata keys and values.\n *\n * WP_Meta_Query is a helper that allows primary query classes, such as WP_Query and WP_User_Query,\n *\n * to filter their results by object metadata, by generating `JOIN` and `WHERE` subclauses to be attached\n * to the primary SQL query string.\n *\n * @since 3.2.0\n */\nclass WP_Meta_Query {\n\t/**\n\t * Array of metadata queries.\n\t *\n\t * See WP_Meta_Query::__construct() for information on meta query arguments.\n\t *\n\t * @since 3.2.0\n\t * @var array\n\t */\n\tpublic $queries = array();\n\n\t/**\n\t * The relation between the queries. Can be one of 'AND' or 'OR'.\n\t *\n\t * @since 3.2.0\n\t * @var string\n\t */\n\tpublic $relation;\n\n\t/**\n\t * Database table to query for the metadata.\n\t *\n\t * @since 4.1.0\n\t * @var string\n\t */\n\tpublic $meta_table;\n\n\t/**\n\t * Column in meta_table that represents the ID of the object the metadata belongs to.\n\t *\n\t * @since 4.1.0\n\t * @var string\n\t */\n\tpublic $meta_id_column;\n\n\t/**\n\t * Database table that where the metadata's objects are stored (eg $wpdb->users).\n\t *\n\t * @since 4.1.0\n\t * @var string\n\t */\n\tpublic $primary_table;\n\n\t/**\n\t * Column in primary_table that represents the ID of the object.\n\t *\n\t * @since 4.1.0\n\t * @var string\n\t */\n\tpublic $primary_id_column;\n\n\t/**\n\t * A flat list of table aliases used in JOIN clauses.\n\t *\n\t * @since 4.1.0\n\t * @var array\n\t */\n\tprotected $table_aliases = array();\n\n\t/**\n\t * A flat list of clauses, keyed by clause 'name'.\n\t *\n\t * @since 4.2.0\n\t * @var array\n\t */\n\tprotected $clauses = array();\n\n\t/**\n\t * Whether the query contains any OR relations.\n\t *\n\t * @since 4.3.0\n\t * @var bool\n\t */\n\tprotected $has_or_relation = false;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.2.0\n\t * @since 4.2.0 Introduced support for naming query clauses by associative array keys.\n\t * @since 5.1.0 Introduced $compare_key clause parameter, which enables LIKE key matches.\n\t * @since 5.3.0 Increased the number of operators available to $compare_key. Introduced $type_key,\n\t *              which enables the $key to be cast to a new data type for comparisons.\n\t *\n\t * @param array $meta_query {\n\t *     Array of meta query clauses. When first-order clauses or sub-clauses use strings as\n\t *     their array keys, they may be referenced in the 'orderby' parameter of the parent query.\n\t *\n\t *     @type string $relation Optional. The MySQL keyword used to join\n\t *                            the clauses of the query. Accepts 'AND', or 'OR'. Default 'AND'.\n\t *     @type array  ...$0 {\n\t *         Optional. An array of first-order clause parameters, or another fully-formed meta query.\n\t *\n\t *         @type string $key         Meta key to filter by.\n\t *         @type string $compare_key MySQL operator used for comparing the $key. Accepts '=', '!='\n\t *                                   'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'REGEXP', 'NOT REGEXP', 'RLIKE',\n\t *                                   'EXISTS' (alias of '=') or 'NOT EXISTS' (alias of '!=').\n\t *                                   Default is 'IN' when `$key` is an array, '=' otherwise.\n\t *         @type string $type_key    MySQL data type that the meta_key column will be CAST to for\n\t *                                   comparisons. Accepts 'BINARY' for case-sensitive regular expression\n\t *                                   comparisons. Default is ''.\n\t *         @type string $value       Meta value to filter by.\n\t *         @type string $compare     MySQL operator used for comparing the $value. Accepts '=',\n\t *                                   '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE',\n\t *                                   'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN', 'REGEXP',\n\t *                                   'NOT REGEXP', 'RLIKE', 'EXISTS' or 'NOT EXISTS'.\n\t *                                   Default is 'IN' when `$value` is an array, '=' otherwise.\n\t *         @type string $type        MySQL data type that the meta_value column will be CAST to for\n\t *                                   comparisons. Accepts 'NUMERIC', 'BINARY', 'CHAR', 'DATE',\n\t *                                   'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', or 'UNSIGNED'.\n\t *                                   Default is 'CHAR'.\n\t *     }\n\t * }\n\t */\n\tpublic function __construct( $meta_query = false ) {\n\t\tif ( ! $meta_query ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( $meta_query['relation'] ) && 'OR' === strtoupper( $meta_query['relation'] ) ) {\n\t\t\t$this->relation = 'OR';\n\t\t} else {\n\t\t\t$this->relation = 'AND';\n\t\t}\n\n\t\t$this->queries = $this->sanitize_query( $meta_query );\n\t}\n\n\t/**\n\t * Ensure the 'meta_query' argument passed to the class constructor is well-formed.\n\t *\n\t * Eliminates empty items and ensures that a 'relation' is set.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param array $queries Array of query clauses.\n\t * @return array Sanitized array of query clauses.\n\t */\n\tpublic function sanitize_query( $queries ) {\n\t\t$clean_queries = array();\n\n\t\tif ( ! is_array( $queries ) ) {\n\t\t\treturn $clean_queries;\n\t\t}\n\n\t\tforeach ( $queries as $key => $query ) {\n\t\t\tif ( 'relation' === $key ) {\n\t\t\t\t$relation = $query;\n\n\t\t\t} elseif ( ! is_array( $query ) ) {\n\t\t\t\tcontinue;\n\n\t\t\t\t// First-order clause.\n\t\t\t} elseif ( $this->is_first_order_clause( $query ) ) {\n\t\t\t\tif ( isset( $query['value'] ) && array() === $query['value'] ) {\n\t\t\t\t\tunset( $query['value'] );\n\t\t\t\t}\n\n\t\t\t\t$clean_queries[ $key ] = $query;\n\n\t\t\t\t// Otherwise, it's a nested query, so we recurse.\n\t\t\t} else {\n\t\t\t\t$cleaned_query = $this->sanitize_query( $query );\n\n\t\t\t\tif ( ! empty( $cleaned_query ) ) {\n\t\t\t\t\t$clean_queries[ $key ] = $cleaned_query;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $clean_queries ) ) {\n\t\t\treturn $clean_queries;\n\t\t}\n\n\t\t// Sanitize the 'relation' key provided in the query.\n\t\tif ( isset( $relation ) && 'OR' === strtoupper( $relation ) ) {\n\t\t\t$clean_queries['relation'] = 'OR';\n\t\t\t$this->has_or_relation     = true;\n\n\t\t\t/*\n\t\t\t* If there is only a single clause, call the relation 'OR'.\n\t\t\t* This value will not actually be used to join clauses, but it\n\t\t\t* simplifies the logic around combining key-only queries.\n\t\t\t*/\n\t\t} elseif ( 1 === count( $clean_queries ) ) {\n\t\t\t$clean_queries['relation'] = 'OR';\n\n\t\t\t// Default to AND.\n\t\t} else {\n\t\t\t$clean_queries['relation'] = 'AND';\n\t\t}\n\n\t\treturn $clean_queries;\n\t}\n\n\t/**\n\t * Determine whether a query clause is first-order.\n\t *\n\t * A first-order meta query clause is one that has either a 'key' or\n\t * a 'value' array key.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param array $query Meta query arguments.\n\t * @return bool Whether the query clause is a first-order clause.\n\t */\n\tprotected function is_first_order_clause( $query ) {\n\t\treturn isset( $query['key'] ) || isset( $query['value'] );\n\t}\n\n\t/**\n\t * Constructs a meta query based on 'meta_*' query vars\n\t *\n\t * @since 3.2.0\n\t *\n\t * @param array $qv The query variables\n\t */\n\tpublic function parse_query_vars( $qv ) {\n\t\t$meta_query = array();\n\n\t\t/*\n\t\t * For orderby=meta_value to work correctly, simple query needs to be\n\t\t * first (so that its table join is against an unaliased meta table) and\n\t\t * needs to be its own clause (so it doesn't interfere with the logic of\n\t\t * the rest of the meta_query).\n\t\t */\n\t\t$primary_meta_query = array();\n\t\tforeach ( array( 'key', 'compare', 'type', 'compare_key', 'type_key' ) as $key ) {\n\t\t\tif ( ! empty( $qv[ \"meta_$key\" ] ) ) {\n\t\t\t\t$primary_meta_query[ $key ] = $qv[ \"meta_$key\" ];\n\t\t\t}\n\t\t}\n\n\t\t// WP_Query sets 'meta_value' = '' by default.\n\t\tif ( isset( $qv['meta_value'] ) && '' !== $qv['meta_value'] && ( ! is_array( $qv['meta_value'] ) || $qv['meta_value'] ) ) {\n\t\t\t$primary_meta_query['value'] = $qv['meta_value'];\n\t\t}\n\n\t\t$existing_meta_query = isset( $qv['meta_query'] ) && is_array( $qv['meta_query'] ) ? $qv['meta_query'] : array();\n\n\t\tif ( ! empty( $primary_meta_query ) && ! empty( $existing_meta_query ) ) {\n\t\t\t$meta_query = array(\n\t\t\t\t'relation' => 'AND',\n\t\t\t\t$primary_meta_query,\n\t\t\t\t$existing_meta_query,\n\t\t\t);\n\t\t} elseif ( ! empty( $primary_meta_query ) ) {\n\t\t\t$meta_query = array(\n\t\t\t\t$primary_meta_query,\n\t\t\t);\n\t\t} elseif ( ! empty( $existing_meta_query ) ) {\n\t\t\t$meta_query = $existing_meta_query;\n\t\t}\n\n\t\t$this->__construct( $meta_query );\n\t}\n\n\t/**\n\t * Return the appropriate alias for the given meta type if applicable.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param string $type MySQL type to cast meta_value.\n\t * @return string MySQL type.\n\t */\n\tpublic function get_cast_for_type( $type = '' ) {\n\t\tif ( empty( $type ) ) {\n\t\t\treturn 'CHAR';\n\t\t}\n\n\t\t$meta_type = strtoupper( $type );\n\n\t\tif ( ! preg_match( '/^(?:BINARY|CHAR|DATE|DATETIME|SIGNED|UNSIGNED|TIME|NUMERIC(?:\\(\\d+(?:,\\s?\\d+)?\\))?|DECIMAL(?:\\(\\d+(?:,\\s?\\d+)?\\))?)$/', $meta_type ) ) {\n\t\t\treturn 'CHAR';\n\t\t}\n\n\t\tif ( 'NUMERIC' === $meta_type ) {\n\t\t\t$meta_type = 'SIGNED';\n\t\t}\n\n\t\treturn $meta_type;\n\t}\n\n\t/**\n\t * Generates SQL clauses to be appended to a main query.\n\t *\n\t * @since 3.2.0\n\t *\n\t * @param string $type              Type of meta, eg 'user', 'post'.\n\t * @param string $primary_table     Database table where the object being filtered is stored (eg wp_users).\n\t * @param string $primary_id_column ID column for the filtered object in $primary_table.\n\t * @param object $context           Optional. The main query object.\n\t * @return array|false {\n\t *     Array containing JOIN and WHERE SQL clauses to append to the main query.\n\t *\n\t *     @type string $join  SQL fragment to append to the main JOIN clause.\n\t *     @type string $where SQL fragment to append to the main WHERE clause.\n\t * }\n\t */\n\tpublic function get_sql( $type, $primary_table, $primary_id_column, $context = null ) {\n\t\t$meta_table = _get_meta_table( $type );\n\t\tif ( ! $meta_table ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->table_aliases = array();\n\n\t\t$this->meta_table     = $meta_table;\n\t\t$this->meta_id_column = sanitize_key( $type . '_id' );\n\n\t\t$this->primary_table     = $primary_table;\n\t\t$this->primary_id_column = $primary_id_column;\n\n\t\t$sql = $this->get_sql_clauses();\n\n\t\t/*\n\t\t * If any JOINs are LEFT JOINs (as in the case of NOT EXISTS), then all JOINs should\n\t\t * be LEFT. Otherwise posts with no metadata will be excluded from results.\n\t\t */\n\t\tif ( false !== strpos( $sql['join'], 'LEFT JOIN' ) ) {\n\t\t\t$sql['join'] = str_replace( 'INNER JOIN', 'LEFT JOIN', $sql['join'] );\n\t\t}\n\n\t\t/**\n\t\t * Filters the meta query's generated SQL.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param array  $sql               Array containing the query's JOIN and WHERE clauses.\n\t\t * @param array  $queries           Array of meta queries.\n\t\t * @param string $type              Type of meta.\n\t\t * @param string $primary_table     Primary table.\n\t\t * @param string $primary_id_column Primary column ID.\n\t\t * @param object $context           The main query object.\n\t\t */\n\t\treturn apply_filters_ref_array( 'get_meta_sql', array( $sql, $this->queries, $type, $primary_table, $primary_id_column, $context ) );\n\t}\n\n\t/**\n\t * Generate SQL clauses to be appended to a main query.\n\t *\n\t * Called by the public WP_Meta_Query::get_sql(), this method is abstracted\n\t * out to maintain parity with the other Query classes.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @return array {\n\t *     Array containing JOIN and WHERE SQL clauses to append to the main query.\n\t *\n\t *     @type string $join  SQL fragment to append to the main JOIN clause.\n\t *     @type string $where SQL fragment to append to the main WHERE clause.\n\t * }\n\t */\n\tprotected function get_sql_clauses() {\n\t\t/*\n\t\t * $queries are passed by reference to get_sql_for_query() for recursion.\n\t\t * To keep $this->queries unaltered, pass a copy.\n\t\t */\n\t\t$queries = $this->queries;\n\t\t$sql     = $this->get_sql_for_query( $queries );\n\n\t\tif ( ! empty( $sql['where'] ) ) {\n\t\t\t$sql['where'] = ' AND ' . $sql['where'];\n\t\t}\n\n\t\treturn $sql;\n\t}\n\n\t/**\n\t * Generate SQL clauses for a single query array.\n\t *\n\t * If nested subqueries are found, this method recurses the tree to\n\t * produce the properly nested SQL.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param array $query Query to parse (passed by reference).\n\t * @param int   $depth Optional. Number of tree levels deep we currently are.\n\t *                     Used to calculate indentation. Default 0.\n\t * @return array {\n\t *     Array containing JOIN and WHERE SQL clauses to append to a single query array.\n\t *\n\t *     @type string $join  SQL fragment to append to the main JOIN clause.\n\t *     @type string $where SQL fragment to append to the main WHERE clause.\n\t * }\n\t */\n\tprotected function get_sql_for_query( &$query, $depth = 0 ) {\n\t\t$sql_chunks = array(\n\t\t\t'join'  => array(),\n\t\t\t'where' => array(),\n\t\t);\n\n\t\t$sql = array(\n\t\t\t'join'  => '',\n\t\t\t'where' => '',\n\t\t);\n\n\t\t$indent = '';\n\t\tfor ( $i = 0; $i < $depth; $i++ ) {\n\t\t\t$indent .= '  ';\n\t\t}\n\n\t\tforeach ( $query as $key => &$clause ) {\n\t\t\tif ( 'relation' === $key ) {\n\t\t\t\t$relation = $query['relation'];\n\t\t\t} elseif ( is_array( $clause ) ) {\n\n\t\t\t\t// This is a first-order clause.\n\t\t\t\tif ( $this->is_first_order_clause( $clause ) ) {\n\t\t\t\t\t$clause_sql = $this->get_sql_for_clause( $clause, $query, $key );\n\n\t\t\t\t\t$where_count = count( $clause_sql['where'] );\n\t\t\t\t\tif ( ! $where_count ) {\n\t\t\t\t\t\t$sql_chunks['where'][] = '';\n\t\t\t\t\t} elseif ( 1 === $where_count ) {\n\t\t\t\t\t\t$sql_chunks['where'][] = $clause_sql['where'][0];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )';\n\t\t\t\t\t}\n\n\t\t\t\t\t$sql_chunks['join'] = array_merge( $sql_chunks['join'], $clause_sql['join'] );\n\t\t\t\t\t// This is a subquery, so we recurse.\n\t\t\t\t} else {\n\t\t\t\t\t$clause_sql = $this->get_sql_for_query( $clause, $depth + 1 );\n\n\t\t\t\t\t$sql_chunks['where'][] = $clause_sql['where'];\n\t\t\t\t\t$sql_chunks['join'][]  = $clause_sql['join'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Filter to remove empties.\n\t\t$sql_chunks['join']  = array_filter( $sql_chunks['join'] );\n\t\t$sql_chunks['where'] = array_filter( $sql_chunks['where'] );\n\n\t\tif ( empty( $relation ) ) {\n\t\t\t$relation = 'AND';\n\t\t}\n\n\t\t// Filter duplicate JOIN clauses and combine into a single string.\n\t\tif ( ! empty( $sql_chunks['join'] ) ) {\n\t\t\t$sql['join'] = implode( ' ', array_unique( $sql_chunks['join'] ) );\n\t\t}\n\n\t\t// Generate a single WHERE clause with proper brackets and indentation.\n\t\tif ( ! empty( $sql_chunks['where'] ) ) {\n\t\t\t$sql['where'] = '( ' . \"\\n  \" . $indent . implode( ' ' . \"\\n  \" . $indent . $relation . ' ' . \"\\n  \" . $indent, $sql_chunks['where'] ) . \"\\n\" . $indent . ')';\n\t\t}\n\n\t\treturn $sql;\n\t}\n\n\t/**\n\t * Generate SQL JOIN and WHERE clauses for a first-order query clause.\n\t *\n\t * \"First-order\" means that it's an array with a 'key' or 'value'.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param array  $clause       Query clause (passed by reference).\n\t * @param array  $parent_query Parent query array.\n\t * @param string $clause_key   Optional. The array key used to name the clause in the original `$meta_query`\n\t *                             parameters. If not provided, a key will be generated automatically.\n\t * @return array {\n\t *     Array containing JOIN and WHERE SQL clauses to append to a first-order query.\n\t *\n\t *     @type string $join  SQL fragment to append to the main JOIN clause.\n\t *     @type string $where SQL fragment to append to the main WHERE clause.\n\t * }\n\t */\n\tpublic function get_sql_for_clause( &$clause, $parent_query, $clause_key = '' ) {\n\t\tglobal $wpdb;\n\n\t\t$sql_chunks = array(\n\t\t\t'where' => array(),\n\t\t\t'join'  => array(),\n\t\t);\n\n\t\tif ( isset( $clause['compare'] ) ) {\n\t\t\t$clause['compare'] = strtoupper( $clause['compare'] );\n\t\t} else {\n\t\t\t$clause['compare'] = isset( $clause['value'] ) && is_array( $clause['value'] ) ? 'IN' : '=';\n\t\t}\n\n\t\t$non_numeric_operators = array(\n\t\t\t'=',\n\t\t\t'!=',\n\t\t\t'LIKE',\n\t\t\t'NOT LIKE',\n\t\t\t'IN',\n\t\t\t'NOT IN',\n\t\t\t'EXISTS',\n\t\t\t'NOT EXISTS',\n\t\t\t'RLIKE',\n\t\t\t'REGEXP',\n\t\t\t'NOT REGEXP',\n\t\t);\n\n\t\t$numeric_operators = array(\n\t\t\t'>',\n\t\t\t'>=',\n\t\t\t'<',\n\t\t\t'<=',\n\t\t\t'BETWEEN',\n\t\t\t'NOT BETWEEN',\n\t\t);\n\n\t\tif ( ! in_array( $clause['compare'], $non_numeric_operators, true ) && ! in_array( $clause['compare'], $numeric_operators, true ) ) {\n\t\t\t$clause['compare'] = '=';\n\t\t}\n\n\t\tif ( isset( $clause['compare_key'] ) ) {\n\t\t\t$clause['compare_key'] = strtoupper( $clause['compare_key'] );\n\t\t} else {\n\t\t\t$clause['compare_key'] = isset( $clause['key'] ) && is_array( $clause['key'] ) ? 'IN' : '=';\n\t\t}\n\n\t\tif ( ! in_array( $clause['compare_key'], $non_numeric_operators, true ) ) {\n\t\t\t$clause['compare_key'] = '=';\n\t\t}\n\n\t\t$meta_compare     = $clause['compare'];\n\t\t$meta_compare_key = $clause['compare_key'];\n\n\t\t// First build the JOIN clause, if one is required.\n\t\t$join = '';\n\n\t\t// We prefer to avoid joins if possible. Look for an existing join compatible with this clause.\n\t\t$alias = $this->find_compatible_table_alias( $clause, $parent_query );\n\t\tif ( false === $alias ) {\n\t\t\t$i     = count( $this->table_aliases );\n\t\t\t$alias = $i ? 'mt' . $i : $this->meta_table;\n\n\t\t\t// JOIN clauses for NOT EXISTS have their own syntax.\n\t\t\tif ( 'NOT EXISTS' === $meta_compare ) {\n\t\t\t\t$join .= \" LEFT JOIN $this->meta_table\";\n\t\t\t\t$join .= $i ? \" AS $alias\" : '';\n\n\t\t\t\tif ( 'LIKE' === $meta_compare_key ) {\n\t\t\t\t\t$join .= $wpdb->prepare( \" ON ($this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column AND $alias.meta_key LIKE %s )\", '%' . $wpdb->esc_like( $clause['key'] ) . '%' );\n\t\t\t\t} else {\n\t\t\t\t\t$join .= $wpdb->prepare( \" ON ($this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column AND $alias.meta_key = %s )\", $clause['key'] );\n\t\t\t\t}\n\n\t\t\t\t// All other JOIN clauses.\n\t\t\t} else {\n\t\t\t\t$join .= \" INNER JOIN $this->meta_table\";\n\t\t\t\t$join .= $i ? \" AS $alias\" : '';\n\t\t\t\t$join .= \" ON ( $this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column )\";\n\t\t\t}\n\n\t\t\t$this->table_aliases[] = $alias;\n\t\t\t$sql_chunks['join'][]  = $join;\n\t\t}\n\n\t\t// Save the alias to this clause, for future siblings to find.\n\t\t$clause['alias'] = $alias;\n\n\t\t// Determine the data type.\n\t\t$_meta_type     = isset( $clause['type'] ) ? $clause['type'] : '';\n\t\t$meta_type      = $this->get_cast_for_type( $_meta_type );\n\t\t$clause['cast'] = $meta_type;\n\n\t\t// Fallback for clause keys is the table alias. Key must be a string.\n\t\tif ( is_int( $clause_key ) || ! $clause_key ) {\n\t\t\t$clause_key = $clause['alias'];\n\t\t}\n\n\t\t// Ensure unique clause keys, so none are overwritten.\n\t\t$iterator        = 1;\n\t\t$clause_key_base = $clause_key;\n\t\twhile ( isset( $this->clauses[ $clause_key ] ) ) {\n\t\t\t$clause_key = $clause_key_base . '-' . $iterator;\n\t\t\t$iterator++;\n\t\t}\n\n\t\t// Store the clause in our flat array.\n\t\t$this->clauses[ $clause_key ] =& $clause;\n\n\t\t// Next, build the WHERE clause.\n\n\t\t// meta_key.\n\t\tif ( array_key_exists( 'key', $clause ) ) {\n\t\t\tif ( 'NOT EXISTS' === $meta_compare ) {\n\t\t\t\t$sql_chunks['where'][] = $alias . '.' . $this->meta_id_column . ' IS NULL';\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * In joined clauses negative operators have to be nested into a\n\t\t\t\t * NOT EXISTS clause and flipped, to avoid returning records with\n\t\t\t\t * matching post IDs but different meta keys. Here we prepare the\n\t\t\t\t * nested clause.\n\t\t\t\t */\n\t\t\t\tif ( in_array( $meta_compare_key, array( '!=', 'NOT IN', 'NOT LIKE', 'NOT EXISTS', 'NOT REGEXP' ), true ) ) {\n\t\t\t\t\t// Negative clauses may be reused.\n\t\t\t\t\t$i                     = count( $this->table_aliases );\n\t\t\t\t\t$subquery_alias        = $i ? 'mt' . $i : $this->meta_table;\n\t\t\t\t\t$this->table_aliases[] = $subquery_alias;\n\n\t\t\t\t\t$meta_compare_string_start  = 'NOT EXISTS (';\n\t\t\t\t\t$meta_compare_string_start .= \"SELECT 1 FROM $wpdb->postmeta $subquery_alias \";\n\t\t\t\t\t$meta_compare_string_start .= \"WHERE $subquery_alias.post_ID = $alias.post_ID \";\n\t\t\t\t\t$meta_compare_string_end    = 'LIMIT 1';\n\t\t\t\t\t$meta_compare_string_end   .= ')';\n\t\t\t\t}\n\n\t\t\t\tswitch ( $meta_compare_key ) {\n\t\t\t\t\tcase '=':\n\t\t\t\t\tcase 'EXISTS':\n\t\t\t\t\t\t$where = $wpdb->prepare( \"$alias.meta_key = %s\", trim( $clause['key'] ) ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'LIKE':\n\t\t\t\t\t\t$meta_compare_value = '%' . $wpdb->esc_like( trim( $clause['key'] ) ) . '%';\n\t\t\t\t\t\t$where              = $wpdb->prepare( \"$alias.meta_key LIKE %s\", $meta_compare_value ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'IN':\n\t\t\t\t\t\t$meta_compare_string = \"$alias.meta_key IN (\" . substr( str_repeat( ',%s', count( $clause['key'] ) ), 1 ) . ')';\n\t\t\t\t\t\t$where               = $wpdb->prepare( $meta_compare_string, $clause['key'] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'RLIKE':\n\t\t\t\t\tcase 'REGEXP':\n\t\t\t\t\t\t$operator = $meta_compare_key;\n\t\t\t\t\t\tif ( isset( $clause['type_key'] ) && 'BINARY' === strtoupper( $clause['type_key'] ) ) {\n\t\t\t\t\t\t\t$cast = 'BINARY';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$cast = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$where = $wpdb->prepare( \"$alias.meta_key $operator $cast %s\", trim( $clause['key'] ) ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '!=':\n\t\t\t\t\tcase 'NOT EXISTS':\n\t\t\t\t\t\t$meta_compare_string = $meta_compare_string_start . \"AND $subquery_alias.meta_key = %s \" . $meta_compare_string_end;\n\t\t\t\t\t\t$where               = $wpdb->prepare( $meta_compare_string, $clause['key'] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'NOT LIKE':\n\t\t\t\t\t\t$meta_compare_string = $meta_compare_string_start . \"AND $subquery_alias.meta_key LIKE %s \" . $meta_compare_string_end;\n\n\t\t\t\t\t\t$meta_compare_value = '%' . $wpdb->esc_like( trim( $clause['key'] ) ) . '%';\n\t\t\t\t\t\t$where              = $wpdb->prepare( $meta_compare_string, $meta_compare_value ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'NOT IN':\n\t\t\t\t\t\t$array_subclause     = '(' . substr( str_repeat( ',%s', count( $clause['key'] ) ), 1 ) . ') ';\n\t\t\t\t\t\t$meta_compare_string = $meta_compare_string_start . \"AND $subquery_alias.meta_key IN \" . $array_subclause . $meta_compare_string_end;\n\t\t\t\t\t\t$where               = $wpdb->prepare( $meta_compare_string, $clause['key'] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'NOT REGEXP':\n\t\t\t\t\t\t$operator = $meta_compare_key;\n\t\t\t\t\t\tif ( isset( $clause['type_key'] ) && 'BINARY' === strtoupper( $clause['type_key'] ) ) {\n\t\t\t\t\t\t\t$cast = 'BINARY';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$cast = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$meta_compare_string = $meta_compare_string_start . \"AND $subquery_alias.meta_key REGEXP $cast %s \" . $meta_compare_string_end;\n\t\t\t\t\t\t$where               = $wpdb->prepare( $meta_compare_string, $clause['key'] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$sql_chunks['where'][] = $where;\n\t\t\t}\n\t\t}\n\n\t\t// meta_value.\n\t\tif ( array_key_exists( 'value', $clause ) ) {\n\t\t\t$meta_value = $clause['value'];\n\n\t\t\tif ( in_array( $meta_compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ), true ) ) {\n\t\t\t\tif ( ! is_array( $meta_value ) ) {\n\t\t\t\t\t$meta_value = preg_split( '/[,\\s]+/', $meta_value );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$meta_value = trim( $meta_value );\n\t\t\t}\n\n\t\t\tswitch ( $meta_compare ) {\n\t\t\t\tcase 'IN':\n\t\t\t\tcase 'NOT IN':\n\t\t\t\t\t$meta_compare_string = '(' . substr( str_repeat( ',%s', count( $meta_value ) ), 1 ) . ')';\n\t\t\t\t\t$where               = $wpdb->prepare( $meta_compare_string, $meta_value );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'BETWEEN':\n\t\t\t\tcase 'NOT BETWEEN':\n\t\t\t\t\t$where = $wpdb->prepare( '%s AND %s', $meta_value[0], $meta_value[1] );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'LIKE':\n\t\t\t\tcase 'NOT LIKE':\n\t\t\t\t\t$meta_value = '%' . $wpdb->esc_like( $meta_value ) . '%';\n\t\t\t\t\t$where      = $wpdb->prepare( '%s', $meta_value );\n\t\t\t\t\tbreak;\n\n\t\t\t\t// EXISTS with a value is interpreted as '='.\n\t\t\t\tcase 'EXISTS':\n\t\t\t\t\t$meta_compare = '=';\n\t\t\t\t\t$where        = $wpdb->prepare( '%s', $meta_value );\n\t\t\t\t\tbreak;\n\n\t\t\t\t// 'value' is ignored for NOT EXISTS.\n\t\t\t\tcase 'NOT EXISTS':\n\t\t\t\t\t$where = '';\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$where = $wpdb->prepare( '%s', $meta_value );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tif ( $where ) {\n\t\t\t\tif ( 'CHAR' === $meta_type ) {\n\t\t\t\t\t$sql_chunks['where'][] = \"$alias.meta_value {$meta_compare} {$where}\";\n\t\t\t\t} else {\n\t\t\t\t\t$sql_chunks['where'][] = \"CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$where}\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Multiple WHERE clauses (for meta_key and meta_value) should\n\t\t * be joined in parentheses.\n\t\t */\n\t\tif ( 1 < count( $sql_chunks['where'] ) ) {\n\t\t\t$sql_chunks['where'] = array( '( ' . implode( ' AND ', $sql_chunks['where'] ) . ' )' );\n\t\t}\n\n\t\treturn $sql_chunks;\n\t}\n\n\t/**\n\t * Get a flattened list of sanitized meta clauses.\n\t *\n\t * This array should be used for clause lookup, as when the table alias and CAST type must be determined for\n\t * a value of 'orderby' corresponding to a meta clause.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @return array Meta clauses.\n\t */\n\tpublic function get_clauses() {\n\t\treturn $this->clauses;\n\t}\n\n\t/**\n\t * Identify an existing table alias that is compatible with the current\n\t * query clause.\n\t *\n\t * We avoid unnecessary table joins by allowing each clause to look for\n\t * an existing table alias that is compatible with the query that it\n\t * needs to perform.\n\t *\n\t * An existing alias is compatible if (a) it is a sibling of `$clause`\n\t * (ie, it's under the scope of the same relation), and (b) the combination\n\t * of operator and relation between the clauses allows for a shared table join.\n\t * In the case of WP_Meta_Query, this only applies to 'IN' clauses that are\n\t * connected by the relation 'OR'.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param array $clause       Query clause.\n\t * @param array $parent_query Parent query of $clause.\n\t * @return string|false Table alias if found, otherwise false.\n\t */\n\tprotected function find_compatible_table_alias( $clause, $parent_query ) {\n\t\t$alias = false;\n\n\t\tforeach ( $parent_query as $sibling ) {\n\t\t\t// If the sibling has no alias yet, there's nothing to check.\n\t\t\tif ( empty( $sibling['alias'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// We're only interested in siblings that are first-order clauses.\n\t\t\tif ( ! is_array( $sibling ) || ! $this->is_first_order_clause( $sibling ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$compatible_compares = array();\n\n\t\t\t// Clauses connected by OR can share joins as long as they have \"positive\" operators.\n\t\t\tif ( 'OR' === $parent_query['relation'] ) {\n\t\t\t\t$compatible_compares = array( '=', 'IN', 'BETWEEN', 'LIKE', 'REGEXP', 'RLIKE', '>', '>=', '<', '<=' );\n\n\t\t\t\t// Clauses joined by AND with \"negative\" operators share a join only if they also share a key.\n\t\t\t} elseif ( isset( $sibling['key'] ) && isset( $clause['key'] ) && $sibling['key'] === $clause['key'] ) {\n\t\t\t\t$compatible_compares = array( '!=', 'NOT IN', 'NOT LIKE' );\n\t\t\t}\n\n\t\t\t$clause_compare  = strtoupper( $clause['compare'] );\n\t\t\t$sibling_compare = strtoupper( $sibling['compare'] );\n\t\t\tif ( in_array( $clause_compare, $compatible_compares, true ) && in_array( $sibling_compare, $compatible_compares, true ) ) {\n\t\t\t\t$alias = $sibling['alias'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the table alias identified as compatible with the current clause.\n\t\t *\n\t\t * @since 4.1.0\n\t\t *\n\t\t * @param string|bool   $alias        Table alias, or false if none was found.\n\t\t * @param array         $clause       First-order query clause.\n\t\t * @param array         $parent_query Parent of $clause.\n\t\t * @param WP_Meta_Query $this         WP_Meta_Query object.\n\t\t */\n\t\treturn apply_filters( 'meta_query_find_compatible_table_alias', $alias, $clause, $parent_query, $this );\n\t}\n\n\t/**\n\t * Checks whether the current query has any OR relations.\n\t *\n\t * In some cases, the presence of an OR relation somewhere in the query will require\n\t * the use of a `DISTINCT` or `GROUP BY` keyword in the `SELECT` clause. The current\n\t * method can be used in these cases to determine whether such a clause is necessary.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @return bool True if the query contains any `OR` relations, otherwise false.\n\t */\n\tpublic function has_or_relation() {\n\t\treturn $this->has_or_relation;\n\t}\n}\n", "num_lines": 848}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Meta API: WP_Metadata_Lazyloader class\n *\n * @package WordPress\n * @subpackage Meta\n * @since 4.5.0\n */\n\n/**\n * Core class used for lazy-loading object metadata.\n *\n * When loading many objects of a given type, such as posts in a WP_Query loop, it often makes\n * sense to prime various metadata caches at the beginning of the loop. This means fetching all\n * relevant metadata with a single database query, a technique that has the potential to improve\n * performance dramatically in some cases.\n *\n * In cases where the given metadata may not even be used in the loop, we can improve performance\n * even more by only priming the metadata cache for affected items the first time a piece of metadata\n * is requested - ie, by lazy-loading it. So, for example, comment meta may not be loaded into the\n * cache in the comments section of a post until the first time get_comment_meta() is called in the\n * context of the comment loop.\n *\n * WP uses the WP_Metadata_Lazyloader class to queue objects for metadata cache priming. The class\n * then detects the relevant get_*_meta() function call, and queries the metadata of all queued objects.\n *\n * Do not access this class directly. Use the wp_metadata_lazyloader() function.\n *\n * @since 4.5.0\n */\nclass WP_Metadata_Lazyloader {\n\t/**\n\t * Pending objects queue.\n\t *\n\t * @since 4.5.0\n\t * @var array\n\t */\n\tprotected $pending_objects;\n\n\t/**\n\t * Settings for supported object types.\n\t *\n\t * @since 4.5.0\n\t * @var array\n\t */\n\tprotected $settings = array();\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.5.0\n\t */\n\tpublic function __construct() {\n\t\t$this->settings = array(\n\t\t\t'term'    => array(\n\t\t\t\t'filter'   => 'get_term_metadata',\n\t\t\t\t'callback' => array( $this, 'lazyload_term_meta' ),\n\t\t\t),\n\t\t\t'comment' => array(\n\t\t\t\t'filter'   => 'get_comment_metadata',\n\t\t\t\t'callback' => array( $this, 'lazyload_comment_meta' ),\n\t\t\t),\n\t\t);\n\t}\n\n\t/**\n\t * Adds objects to the metadata lazy-load queue.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param string $object_type Type of object whose meta is to be lazy-loaded. Accepts 'term' or 'comment'.\n\t * @param array  $object_ids  Array of object IDs.\n\t * @return bool|WP_Error True on success, WP_Error on failure.\n\t */\n\tpublic function queue_objects( $object_type, $object_ids ) {\n\t\tif ( ! isset( $this->settings[ $object_type ] ) ) {\n\t\t\treturn new WP_Error( 'invalid_object_type', __( 'Invalid object type.' ) );\n\t\t}\n\n\t\t$type_settings = $this->settings[ $object_type ];\n\n\t\tif ( ! isset( $this->pending_objects[ $object_type ] ) ) {\n\t\t\t$this->pending_objects[ $object_type ] = array();\n\t\t}\n\n\t\tforeach ( $object_ids as $object_id ) {\n\t\t\t// Keyed by ID for faster lookup.\n\t\t\tif ( ! isset( $this->pending_objects[ $object_type ][ $object_id ] ) ) {\n\t\t\t\t$this->pending_objects[ $object_type ][ $object_id ] = 1;\n\t\t\t}\n\t\t}\n\n\t\tadd_filter( $type_settings['filter'], $type_settings['callback'] );\n\n\t\t/**\n\t\t * Fires after objects are added to the metadata lazy-load queue.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @param array                  $object_ids  Array of object IDs.\n\t\t * @param string                 $object_type Type of object being queued.\n\t\t * @param WP_Metadata_Lazyloader $lazyloader  The lazy-loader object.\n\t\t */\n\t\tdo_action( 'metadata_lazyloader_queued_objects', $object_ids, $object_type, $this );\n\t}\n\n\t/**\n\t * Resets lazy-load queue for a given object type.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param string $object_type Object type. Accepts 'comment' or 'term'.\n\t * @return bool|WP_Error True on success, WP_Error on failure.\n\t */\n\tpublic function reset_queue( $object_type ) {\n\t\tif ( ! isset( $this->settings[ $object_type ] ) ) {\n\t\t\treturn new WP_Error( 'invalid_object_type', __( 'Invalid object type.' ) );\n\t\t}\n\n\t\t$type_settings = $this->settings[ $object_type ];\n\n\t\t$this->pending_objects[ $object_type ] = array();\n\t\tremove_filter( $type_settings['filter'], $type_settings['callback'] );\n\t}\n\n\t/**\n\t * Lazy-loads term meta for queued terms.\n\t *\n\t * This method is public so that it can be used as a filter callback. As a rule, there\n\t * is no need to invoke it directly.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param mixed $check The `$check` param passed from the 'get_term_metadata' hook.\n\t * @return mixed In order not to short-circuit `get_metadata()`. Generally, this is `null`, but it could be\n\t *               another value if filtered by a plugin.\n\t */\n\tpublic function lazyload_term_meta( $check ) {\n\t\tif ( ! empty( $this->pending_objects['term'] ) ) {\n\t\t\tupdate_termmeta_cache( array_keys( $this->pending_objects['term'] ) );\n\n\t\t\t// No need to run again for this set of terms.\n\t\t\t$this->reset_queue( 'term' );\n\t\t}\n\n\t\treturn $check;\n\t}\n\n\t/**\n\t * Lazy-loads comment meta for queued comments.\n\t *\n\t * This method is public so that it can be used as a filter callback. As a rule, there is no need to invoke it\n\t * directly, from either inside or outside the `WP_Query` object.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param mixed $check The `$check` param passed from the {@see 'get_comment_metadata'} hook.\n\t * @return mixed The original value of `$check`, so as not to short-circuit `get_comment_metadata()`.\n\t */\n\tpublic function lazyload_comment_meta( $check ) {\n\t\tif ( ! empty( $this->pending_objects['comment'] ) ) {\n\t\t\tupdate_meta_cache( 'comment', array_keys( $this->pending_objects['comment'] ) );\n\n\t\t\t// No need to run again for this set of comments.\n\t\t\t$this->reset_queue( 'comment' );\n\t\t}\n\n\t\treturn $check;\n\t}\n}\n", "num_lines": 171}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Network API: WP_Network_Query class\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 4.6.0\n */\n\n/**\n * Core class used for querying networks.\n *\n * @since 4.6.0\n *\n * @see WP_Network_Query::__construct() for accepted arguments.\n */\nclass WP_Network_Query {\n\n\t/**\n\t * SQL for database query.\n\t *\n\t * @since 4.6.0\n\t * @var string\n\t */\n\tpublic $request;\n\n\t/**\n\t * SQL query clauses.\n\t *\n\t * @since 4.6.0\n\t * @var array\n\t */\n\tprotected $sql_clauses = array(\n\t\t'select'  => '',\n\t\t'from'    => '',\n\t\t'where'   => array(),\n\t\t'groupby' => '',\n\t\t'orderby' => '',\n\t\t'limits'  => '',\n\t);\n\n\t/**\n\t * Query vars set by the user.\n\t *\n\t * @since 4.6.0\n\t * @var array\n\t */\n\tpublic $query_vars;\n\n\t/**\n\t * Default values for query vars.\n\t *\n\t * @since 4.6.0\n\t * @var array\n\t */\n\tpublic $query_var_defaults;\n\n\t/**\n\t * List of networks located by the query.\n\t *\n\t * @since 4.6.0\n\t * @var array\n\t */\n\tpublic $networks;\n\n\t/**\n\t * The amount of found networks for the current query.\n\t *\n\t * @since 4.6.0\n\t * @var int\n\t */\n\tpublic $found_networks = 0;\n\n\t/**\n\t * The number of pages.\n\t *\n\t * @since 4.6.0\n\t * @var int\n\t */\n\tpublic $max_num_pages = 0;\n\n\t/**\n\t * Constructor.\n\t *\n\t * Sets up the network query, based on the query vars passed.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string|array $query {\n\t *     Optional. Array or query string of network query parameters. Default empty.\n\t *\n\t *     @type array        $network__in          Array of network IDs to include. Default empty.\n\t *     @type array        $network__not_in      Array of network IDs to exclude. Default empty.\n\t *     @type bool         $count                Whether to return a network count (true) or array of network objects.\n\t *                                              Default false.\n\t *     @type string       $fields               Network fields to return. Accepts 'ids' (returns an array of network IDs)\n\t *                                              or empty (returns an array of complete network objects). Default empty.\n\t *     @type int          $number               Maximum number of networks to retrieve. Default empty (no limit).\n\t *     @type int          $offset               Number of networks to offset the query. Used to build LIMIT clause.\n\t *                                              Default 0.\n\t *     @type bool         $no_found_rows        Whether to disable the `SQL_CALC_FOUND_ROWS` query. Default true.\n\t *     @type string|array $orderby              Network status or array of statuses. Accepts 'id', 'domain', 'path',\n\t *                                              'domain_length', 'path_length' and 'network__in'. Also accepts false,\n\t *                                              an empty array, or 'none' to disable `ORDER BY` clause. Default 'id'.\n\t *     @type string       $order                How to order retrieved networks. Accepts 'ASC', 'DESC'. Default 'ASC'.\n\t *     @type string       $domain               Limit results to those affiliated with a given domain. Default empty.\n\t *     @type array        $domain__in           Array of domains to include affiliated networks for. Default empty.\n\t *     @type array        $domain__not_in       Array of domains to exclude affiliated networks for. Default empty.\n\t *     @type string       $path                 Limit results to those affiliated with a given path. Default empty.\n\t *     @type array        $path__in             Array of paths to include affiliated networks for. Default empty.\n\t *     @type array        $path__not_in         Array of paths to exclude affiliated networks for. Default empty.\n\t *     @type string       $search               Search term(s) to retrieve matching networks for. Default empty.\n\t *     @type bool         $update_network_cache Whether to prime the cache for found networks. Default true.\n\t * }\n\t */\n\tpublic function __construct( $query = '' ) {\n\t\t$this->query_var_defaults = array(\n\t\t\t'network__in'          => '',\n\t\t\t'network__not_in'      => '',\n\t\t\t'count'                => false,\n\t\t\t'fields'               => '',\n\t\t\t'number'               => '',\n\t\t\t'offset'               => '',\n\t\t\t'no_found_rows'        => true,\n\t\t\t'orderby'              => 'id',\n\t\t\t'order'                => 'ASC',\n\t\t\t'domain'               => '',\n\t\t\t'domain__in'           => '',\n\t\t\t'domain__not_in'       => '',\n\t\t\t'path'                 => '',\n\t\t\t'path__in'             => '',\n\t\t\t'path__not_in'         => '',\n\t\t\t'search'               => '',\n\t\t\t'update_network_cache' => true,\n\t\t);\n\n\t\tif ( ! empty( $query ) ) {\n\t\t\t$this->query( $query );\n\t\t}\n\t}\n\n\t/**\n\t * Parses arguments passed to the network query with default query parameters.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string|array $query WP_Network_Query arguments. See WP_Network_Query::__construct()\n\t */\n\tpublic function parse_query( $query = '' ) {\n\t\tif ( empty( $query ) ) {\n\t\t\t$query = $this->query_vars;\n\t\t}\n\n\t\t$this->query_vars = wp_parse_args( $query, $this->query_var_defaults );\n\n\t\t/**\n\t\t * Fires after the network query vars have been parsed.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param WP_Network_Query $this The WP_Network_Query instance (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'parse_network_query', array( &$this ) );\n\t}\n\n\t/**\n\t * Sets up the WordPress query for retrieving networks.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string|array $query Array or URL query string of parameters.\n\t * @return array|int List of WP_Network objects, a list of network IDs when 'fields' is set to 'ids',\n\t *                   or the number of networks when 'count' is passed as a query var.\n\t */\n\tpublic function query( $query ) {\n\t\t$this->query_vars = wp_parse_args( $query );\n\t\treturn $this->get_networks();\n\t}\n\n\t/**\n\t * Gets a list of networks matching the query vars.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @return array|int List of WP_Network objects, a list of network IDs when 'fields' is set to 'ids',\n\t *                   or the number of networks when 'count' is passed as a query var.\n\t */\n\tpublic function get_networks() {\n\t\t$this->parse_query();\n\n\t\t/**\n\t\t * Fires before networks are retrieved.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param WP_Network_Query $this Current instance of WP_Network_Query (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'pre_get_networks', array( &$this ) );\n\n\t\t$network_data = null;\n\n\t\t/**\n\t\t * Filter the network data before the query takes place.\n\t\t *\n\t\t * Return a non-null value to bypass WordPress's default network queries.\n\t\t *\n\t\t * The expected return type from this filter depends on the value passed in the request query_vars.\n\t\t * When `$this->query_vars['count']` is set, the filter should return the network count as an int.\n\t\t * When `'ids' === $this->query_vars['fields']`, the filter should return an array of network IDs.\n\t\t * Otherwise the filter should return an array of WP_Network objects.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param array|null       $network_data Return an array of network data to short-circuit WP's network query,\n\t\t *                                       the network count as an integer if `$this->query_vars['count']` is set,\n\t\t *                                       or null to allow WP to run its normal queries.\n\t\t * @param WP_Network_Query $this         The WP_Network_Query instance, passed by reference.\n\t\t */\n\t\t$network_data = apply_filters_ref_array( 'networks_pre_query', array( $network_data, &$this ) );\n\n\t\tif ( null !== $network_data ) {\n\t\t\treturn $network_data;\n\t\t}\n\n\t\t// $args can include anything. Only use the args defined in the query_var_defaults to compute the key.\n\t\t$_args = wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) );\n\n\t\t// Ignore the $fields argument as the queried result will be the same regardless.\n\t\tunset( $_args['fields'] );\n\n\t\t$key          = md5( serialize( $_args ) );\n\t\t$last_changed = wp_cache_get_last_changed( 'networks' );\n\n\t\t$cache_key   = \"get_network_ids:$key:$last_changed\";\n\t\t$cache_value = wp_cache_get( $cache_key, 'networks' );\n\n\t\tif ( false === $cache_value ) {\n\t\t\t$network_ids = $this->get_network_ids();\n\t\t\tif ( $network_ids ) {\n\t\t\t\t$this->set_found_networks();\n\t\t\t}\n\n\t\t\t$cache_value = array(\n\t\t\t\t'network_ids'    => $network_ids,\n\t\t\t\t'found_networks' => $this->found_networks,\n\t\t\t);\n\t\t\twp_cache_add( $cache_key, $cache_value, 'networks' );\n\t\t} else {\n\t\t\t$network_ids          = $cache_value['network_ids'];\n\t\t\t$this->found_networks = $cache_value['found_networks'];\n\t\t}\n\n\t\tif ( $this->found_networks && $this->query_vars['number'] ) {\n\t\t\t$this->max_num_pages = ceil( $this->found_networks / $this->query_vars['number'] );\n\t\t}\n\n\t\t// If querying for a count only, there's nothing more to do.\n\t\tif ( $this->query_vars['count'] ) {\n\t\t\t// $network_ids is actually a count in this case.\n\t\t\treturn intval( $network_ids );\n\t\t}\n\n\t\t$network_ids = array_map( 'intval', $network_ids );\n\n\t\tif ( 'ids' === $this->query_vars['fields'] ) {\n\t\t\t$this->networks = $network_ids;\n\t\t\treturn $this->networks;\n\t\t}\n\n\t\tif ( $this->query_vars['update_network_cache'] ) {\n\t\t\t_prime_network_caches( $network_ids );\n\t\t}\n\n\t\t// Fetch full network objects from the primed cache.\n\t\t$_networks = array();\n\t\tforeach ( $network_ids as $network_id ) {\n\t\t\t$_network = get_network( $network_id );\n\t\t\tif ( $_network ) {\n\t\t\t\t$_networks[] = $_network;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the network query results.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param WP_Network[]     $_networks An array of WP_Network objects.\n\t\t * @param WP_Network_Query $this      Current instance of WP_Network_Query (passed by reference).\n\t\t */\n\t\t$_networks = apply_filters_ref_array( 'the_networks', array( $_networks, &$this ) );\n\n\t\t// Convert to WP_Network instances.\n\t\t$this->networks = array_map( 'get_network', $_networks );\n\n\t\treturn $this->networks;\n\t}\n\n\t/**\n\t * Used internally to get a list of network IDs matching the query vars.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @return int|array A single count of network IDs if a count query. An array of network IDs if a full query.\n\t */\n\tprotected function get_network_ids() {\n\t\tglobal $wpdb;\n\n\t\t$order = $this->parse_order( $this->query_vars['order'] );\n\n\t\t// Disable ORDER BY with 'none', an empty array, or boolean false.\n\t\tif ( in_array( $this->query_vars['orderby'], array( 'none', array(), false ), true ) ) {\n\t\t\t$orderby = '';\n\t\t} elseif ( ! empty( $this->query_vars['orderby'] ) ) {\n\t\t\t$ordersby = is_array( $this->query_vars['orderby'] ) ?\n\t\t\t\t$this->query_vars['orderby'] :\n\t\t\t\tpreg_split( '/[,\\s]/', $this->query_vars['orderby'] );\n\n\t\t\t$orderby_array = array();\n\t\t\tforeach ( $ordersby as $_key => $_value ) {\n\t\t\t\tif ( ! $_value ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( is_int( $_key ) ) {\n\t\t\t\t\t$_orderby = $_value;\n\t\t\t\t\t$_order   = $order;\n\t\t\t\t} else {\n\t\t\t\t\t$_orderby = $_key;\n\t\t\t\t\t$_order   = $_value;\n\t\t\t\t}\n\n\t\t\t\t$parsed = $this->parse_orderby( $_orderby );\n\n\t\t\t\tif ( ! $parsed ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( 'network__in' === $_orderby ) {\n\t\t\t\t\t$orderby_array[] = $parsed;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$orderby_array[] = $parsed . ' ' . $this->parse_order( $_order );\n\t\t\t}\n\n\t\t\t$orderby = implode( ', ', $orderby_array );\n\t\t} else {\n\t\t\t$orderby = \"$wpdb->site.id $order\";\n\t\t}\n\n\t\t$number = absint( $this->query_vars['number'] );\n\t\t$offset = absint( $this->query_vars['offset'] );\n\t\t$limits = '';\n\n\t\tif ( ! empty( $number ) ) {\n\t\t\tif ( $offset ) {\n\t\t\t\t$limits = 'LIMIT ' . $offset . ',' . $number;\n\t\t\t} else {\n\t\t\t\t$limits = 'LIMIT ' . $number;\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->query_vars['count'] ) {\n\t\t\t$fields = 'COUNT(*)';\n\t\t} else {\n\t\t\t$fields = \"$wpdb->site.id\";\n\t\t}\n\n\t\t// Parse network IDs for an IN clause.\n\t\tif ( ! empty( $this->query_vars['network__in'] ) ) {\n\t\t\t$this->sql_clauses['where']['network__in'] = \"$wpdb->site.id IN ( \" . implode( ',', wp_parse_id_list( $this->query_vars['network__in'] ) ) . ' )';\n\t\t}\n\n\t\t// Parse network IDs for a NOT IN clause.\n\t\tif ( ! empty( $this->query_vars['network__not_in'] ) ) {\n\t\t\t$this->sql_clauses['where']['network__not_in'] = \"$wpdb->site.id NOT IN ( \" . implode( ',', wp_parse_id_list( $this->query_vars['network__not_in'] ) ) . ' )';\n\t\t}\n\n\t\tif ( ! empty( $this->query_vars['domain'] ) ) {\n\t\t\t$this->sql_clauses['where']['domain'] = $wpdb->prepare( \"$wpdb->site.domain = %s\", $this->query_vars['domain'] );\n\t\t}\n\n\t\t// Parse network domain for an IN clause.\n\t\tif ( is_array( $this->query_vars['domain__in'] ) ) {\n\t\t\t$this->sql_clauses['where']['domain__in'] = \"$wpdb->site.domain IN ( '\" . implode( \"', '\", $wpdb->_escape( $this->query_vars['domain__in'] ) ) . \"' )\";\n\t\t}\n\n\t\t// Parse network domain for a NOT IN clause.\n\t\tif ( is_array( $this->query_vars['domain__not_in'] ) ) {\n\t\t\t$this->sql_clauses['where']['domain__not_in'] = \"$wpdb->site.domain NOT IN ( '\" . implode( \"', '\", $wpdb->_escape( $this->query_vars['domain__not_in'] ) ) . \"' )\";\n\t\t}\n\n\t\tif ( ! empty( $this->query_vars['path'] ) ) {\n\t\t\t$this->sql_clauses['where']['path'] = $wpdb->prepare( \"$wpdb->site.path = %s\", $this->query_vars['path'] );\n\t\t}\n\n\t\t// Parse network path for an IN clause.\n\t\tif ( is_array( $this->query_vars['path__in'] ) ) {\n\t\t\t$this->sql_clauses['where']['path__in'] = \"$wpdb->site.path IN ( '\" . implode( \"', '\", $wpdb->_escape( $this->query_vars['path__in'] ) ) . \"' )\";\n\t\t}\n\n\t\t// Parse network path for a NOT IN clause.\n\t\tif ( is_array( $this->query_vars['path__not_in'] ) ) {\n\t\t\t$this->sql_clauses['where']['path__not_in'] = \"$wpdb->site.path NOT IN ( '\" . implode( \"', '\", $wpdb->_escape( $this->query_vars['path__not_in'] ) ) . \"' )\";\n\t\t}\n\n\t\t// Falsey search strings are ignored.\n\t\tif ( strlen( $this->query_vars['search'] ) ) {\n\t\t\t$this->sql_clauses['where']['search'] = $this->get_search_sql(\n\t\t\t\t$this->query_vars['search'],\n\t\t\t\tarray( \"$wpdb->site.domain\", \"$wpdb->site.path\" )\n\t\t\t);\n\t\t}\n\n\t\t$join = '';\n\n\t\t$where = implode( ' AND ', $this->sql_clauses['where'] );\n\n\t\t$groupby = '';\n\n\t\t$pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );\n\n\t\t/**\n\t\t * Filters the network query clauses.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param string[]         $pieces An associative array of network query clauses.\n\t\t * @param WP_Network_Query $this   Current instance of WP_Network_Query (passed by reference).\n\t\t */\n\t\t$clauses = apply_filters_ref_array( 'networks_clauses', array( compact( $pieces ), &$this ) );\n\n\t\t$fields  = isset( $clauses['fields'] ) ? $clauses['fields'] : '';\n\t\t$join    = isset( $clauses['join'] ) ? $clauses['join'] : '';\n\t\t$where   = isset( $clauses['where'] ) ? $clauses['where'] : '';\n\t\t$orderby = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';\n\t\t$limits  = isset( $clauses['limits'] ) ? $clauses['limits'] : '';\n\t\t$groupby = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';\n\n\t\tif ( $where ) {\n\t\t\t$where = 'WHERE ' . $where;\n\t\t}\n\n\t\tif ( $groupby ) {\n\t\t\t$groupby = 'GROUP BY ' . $groupby;\n\t\t}\n\n\t\tif ( $orderby ) {\n\t\t\t$orderby = \"ORDER BY $orderby\";\n\t\t}\n\n\t\t$found_rows = '';\n\t\tif ( ! $this->query_vars['no_found_rows'] ) {\n\t\t\t$found_rows = 'SQL_CALC_FOUND_ROWS';\n\t\t}\n\n\t\t$this->sql_clauses['select']  = \"SELECT $found_rows $fields\";\n\t\t$this->sql_clauses['from']    = \"FROM $wpdb->site $join\";\n\t\t$this->sql_clauses['groupby'] = $groupby;\n\t\t$this->sql_clauses['orderby'] = $orderby;\n\t\t$this->sql_clauses['limits']  = $limits;\n\n\t\t$this->request = \"{$this->sql_clauses['select']} {$this->sql_clauses['from']} {$where} {$this->sql_clauses['groupby']} {$this->sql_clauses['orderby']} {$this->sql_clauses['limits']}\";\n\n\t\tif ( $this->query_vars['count'] ) {\n\t\t\treturn intval( $wpdb->get_var( $this->request ) );\n\t\t}\n\n\t\t$network_ids = $wpdb->get_col( $this->request );\n\n\t\treturn array_map( 'intval', $network_ids );\n\t}\n\n\t/**\n\t * Populates found_networks and max_num_pages properties for the current query\n\t * if the limit clause was used.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t */\n\tprivate function set_found_networks() {\n\t\tglobal $wpdb;\n\n\t\tif ( $this->query_vars['number'] && ! $this->query_vars['no_found_rows'] ) {\n\t\t\t/**\n\t\t\t * Filters the query used to retrieve found network count.\n\t\t\t *\n\t\t\t * @since 4.6.0\n\t\t\t *\n\t\t\t * @param string           $found_networks_query SQL query. Default 'SELECT FOUND_ROWS()'.\n\t\t\t * @param WP_Network_Query $network_query        The `WP_Network_Query` instance.\n\t\t\t */\n\t\t\t$found_networks_query = apply_filters( 'found_networks_query', 'SELECT FOUND_ROWS()', $this );\n\n\t\t\t$this->found_networks = (int) $wpdb->get_var( $found_networks_query );\n\t\t}\n\t}\n\n\t/**\n\t * Used internally to generate an SQL string for searching across multiple columns.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string   $string  Search string.\n\t * @param string[] $columns Array of columns to search.\n\t * @return string Search SQL.\n\t */\n\tprotected function get_search_sql( $string, $columns ) {\n\t\tglobal $wpdb;\n\n\t\t$like = '%' . $wpdb->esc_like( $string ) . '%';\n\n\t\t$searches = array();\n\t\tforeach ( $columns as $column ) {\n\t\t\t$searches[] = $wpdb->prepare( \"$column LIKE %s\", $like );\n\t\t}\n\n\t\treturn '(' . implode( ' OR ', $searches ) . ')';\n\t}\n\n\t/**\n\t * Parses and sanitizes 'orderby' keys passed to the network query.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $orderby Alias for the field to order by.\n\t * @return string|false Value to used in the ORDER clause. False otherwise.\n\t */\n\tprotected function parse_orderby( $orderby ) {\n\t\tglobal $wpdb;\n\n\t\t$allowed_keys = array(\n\t\t\t'id',\n\t\t\t'domain',\n\t\t\t'path',\n\t\t);\n\n\t\t$parsed = false;\n\t\tif ( 'network__in' === $orderby ) {\n\t\t\t$network__in = implode( ',', array_map( 'absint', $this->query_vars['network__in'] ) );\n\t\t\t$parsed      = \"FIELD( {$wpdb->site}.id, $network__in )\";\n\t\t} elseif ( 'domain_length' === $orderby || 'path_length' === $orderby ) {\n\t\t\t$field  = substr( $orderby, 0, -7 );\n\t\t\t$parsed = \"CHAR_LENGTH($wpdb->site.$field)\";\n\t\t} elseif ( in_array( $orderby, $allowed_keys, true ) ) {\n\t\t\t$parsed = \"$wpdb->site.$orderby\";\n\t\t}\n\n\t\treturn $parsed;\n\t}\n\n\t/**\n\t * Parses an 'order' query variable and cast it to 'ASC' or 'DESC' as necessary.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string $order The 'order' query variable.\n\t * @return string The sanitized 'order' query variable.\n\t */\n\tprotected function parse_order( $order ) {\n\t\tif ( ! is_string( $order ) || empty( $order ) ) {\n\t\t\treturn 'ASC';\n\t\t}\n\n\t\tif ( 'ASC' === strtoupper( $order ) ) {\n\t\t\treturn 'ASC';\n\t\t} else {\n\t\t\treturn 'DESC';\n\t\t}\n\t}\n}\n", "num_lines": 580}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Network API: WP_Network class\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 4.4.0\n */\n\n/**\n * Core class used for interacting with a multisite network.\n *\n * This class is used during load to populate the `$current_site` global and\n * setup the current network.\n *\n * This class is most useful in WordPress multi-network installations where the\n * ability to interact with any network of sites is required.\n *\n * @since 4.4.0\n *\n * @property int $id\n * @property int $site_id\n */\nclass WP_Network {\n\n\t/**\n\t * Network ID.\n\t *\n\t * @since 4.4.0\n\t * @since 4.6.0 Converted from public to private to explicitly enable more intuitive\n\t *              access via magic methods. As part of the access change, the type was\n\t *              also changed from `string` to `int`.\n\t * @var int\n\t */\n\tprivate $id;\n\n\t/**\n\t * Domain of the network.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $domain = '';\n\n\t/**\n\t * Path of the network.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $path = '';\n\n\t/**\n\t * The ID of the network's main site.\n\t *\n\t * Named \"blog\" vs. \"site\" for legacy reasons. A main site is mapped to\n\t * the network when the network is created.\n\t *\n\t * A numeric string, for compatibility reasons.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tprivate $blog_id = '0';\n\n\t/**\n\t * Domain used to set cookies for this network.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $cookie_domain = '';\n\n\t/**\n\t * Name of this network.\n\t *\n\t * Named \"site\" vs. \"network\" for legacy reasons.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $site_name = '';\n\n\t/**\n\t * Retrieve a network from the database by its ID.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param int $network_id The ID of the network to retrieve.\n\t * @return WP_Network|bool The network's object if found. False if not.\n\t */\n\tpublic static function get_instance( $network_id ) {\n\t\tglobal $wpdb;\n\n\t\t$network_id = (int) $network_id;\n\t\tif ( ! $network_id ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$_network = wp_cache_get( $network_id, 'networks' );\n\n\t\tif ( false === $_network ) {\n\t\t\t$_network = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->site} WHERE id = %d LIMIT 1\", $network_id ) );\n\n\t\t\tif ( empty( $_network ) || is_wp_error( $_network ) ) {\n\t\t\t\t$_network = -1;\n\t\t\t}\n\n\t\t\twp_cache_add( $network_id, $_network, 'networks' );\n\t\t}\n\n\t\tif ( is_numeric( $_network ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn new WP_Network( $_network );\n\t}\n\n\t/**\n\t * Create a new WP_Network object.\n\t *\n\t * Will populate object properties from the object provided and assign other\n\t * default properties based on that information.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param WP_Network|object $network A network object.\n\t */\n\tpublic function __construct( $network ) {\n\t\tforeach ( get_object_vars( $network ) as $key => $value ) {\n\t\t\t$this->$key = $value;\n\t\t}\n\n\t\t$this->_set_site_name();\n\t\t$this->_set_cookie_domain();\n\t}\n\n\t/**\n\t * Getter.\n\t *\n\t * Allows current multisite naming conventions when getting properties.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string $key Property to get.\n\t * @return mixed Value of the property. Null if not available.\n\t */\n\tpublic function __get( $key ) {\n\t\tswitch ( $key ) {\n\t\t\tcase 'id':\n\t\t\t\treturn (int) $this->id;\n\t\t\tcase 'blog_id':\n\t\t\t\treturn (string) $this->get_main_site_id();\n\t\t\tcase 'site_id':\n\t\t\t\treturn $this->get_main_site_id();\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Isset-er.\n\t *\n\t * Allows current multisite naming conventions when checking for properties.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string $key Property to check if set.\n\t * @return bool Whether the property is set.\n\t */\n\tpublic function __isset( $key ) {\n\t\tswitch ( $key ) {\n\t\t\tcase 'id':\n\t\t\tcase 'blog_id':\n\t\t\tcase 'site_id':\n\t\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Setter.\n\t *\n\t * Allows current multisite naming conventions while setting properties.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string $key   Property to set.\n\t * @param mixed  $value Value to assign to the property.\n\t */\n\tpublic function __set( $key, $value ) {\n\t\tswitch ( $key ) {\n\t\t\tcase 'id':\n\t\t\t\t$this->id = (int) $value;\n\t\t\t\tbreak;\n\t\t\tcase 'blog_id':\n\t\t\tcase 'site_id':\n\t\t\t\t$this->blog_id = (string) $value;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->$key = $value;\n\t\t}\n\t}\n\n\t/**\n\t * Returns the main site ID for the network.\n\t *\n\t * Internal method used by the magic getter for the 'blog_id' and 'site_id'\n\t * properties.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @return int The ID of the main site.\n\t */\n\tprivate function get_main_site_id() {\n\t\t/**\n\t\t * Filters the main site ID.\n\t\t *\n\t\t * Returning a positive integer will effectively short-circuit the function.\n\t\t *\n\t\t * @since 4.9.0\n\t\t *\n\t\t * @param int|null   $main_site_id If a positive integer is returned, it is interpreted as the main site ID.\n\t\t * @param WP_Network $network      The network object for which the main site was detected.\n\t\t */\n\t\t$main_site_id = (int) apply_filters( 'pre_get_main_site_id', null, $this );\n\t\tif ( 0 < $main_site_id ) {\n\t\t\treturn $main_site_id;\n\t\t}\n\n\t\tif ( 0 < (int) $this->blog_id ) {\n\t\t\treturn (int) $this->blog_id;\n\t\t}\n\n\t\tif ( ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' ) && DOMAIN_CURRENT_SITE === $this->domain && PATH_CURRENT_SITE === $this->path )\n\t\t\t|| ( defined( 'SITE_ID_CURRENT_SITE' ) && SITE_ID_CURRENT_SITE == $this->id ) ) {\n\t\t\tif ( defined( 'BLOG_ID_CURRENT_SITE' ) ) {\n\t\t\t\t$this->blog_id = (string) BLOG_ID_CURRENT_SITE;\n\n\t\t\t\treturn (int) $this->blog_id;\n\t\t\t}\n\n\t\t\tif ( defined( 'BLOGID_CURRENT_SITE' ) ) { // Deprecated.\n\t\t\t\t$this->blog_id = (string) BLOGID_CURRENT_SITE;\n\n\t\t\t\treturn (int) $this->blog_id;\n\t\t\t}\n\t\t}\n\n\t\t$site = get_site();\n\t\tif ( $site->domain === $this->domain && $site->path === $this->path ) {\n\t\t\t$main_site_id = (int) $site->id;\n\t\t} else {\n\t\t\t$cache_key = 'network:' . $this->id . ':main_site';\n\n\t\t\t$main_site_id = wp_cache_get( $cache_key, 'site-options' );\n\t\t\tif ( false === $main_site_id ) {\n\t\t\t\t$_sites       = get_sites(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'fields'     => 'ids',\n\t\t\t\t\t\t'number'     => 1,\n\t\t\t\t\t\t'domain'     => $this->domain,\n\t\t\t\t\t\t'path'       => $this->path,\n\t\t\t\t\t\t'network_id' => $this->id,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$main_site_id = ! empty( $_sites ) ? array_shift( $_sites ) : 0;\n\n\t\t\t\twp_cache_add( $cache_key, $main_site_id, 'site-options' );\n\t\t\t}\n\t\t}\n\n\t\t$this->blog_id = (string) $main_site_id;\n\n\t\treturn (int) $this->blog_id;\n\t}\n\n\t/**\n\t * Set the site name assigned to the network if one has not been populated.\n\t *\n\t * @since 4.4.0\n\t */\n\tprivate function _set_site_name() {\n\t\tif ( ! empty( $this->site_name ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$default         = ucfirst( $this->domain );\n\t\t$this->site_name = get_network_option( $this->id, 'site_name', $default );\n\t}\n\n\t/**\n\t * Set the cookie domain based on the network domain if one has\n\t * not been populated.\n\t *\n\t * @todo What if the domain of the network doesn't match the current site?\n\t *\n\t * @since 4.4.0\n\t */\n\tprivate function _set_cookie_domain() {\n\t\tif ( ! empty( $this->cookie_domain ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->cookie_domain = $this->domain;\n\t\tif ( 'www.' === substr( $this->cookie_domain, 0, 4 ) ) {\n\t\t\t$this->cookie_domain = substr( $this->cookie_domain, 4 );\n\t\t}\n\t}\n\n\t/**\n\t * Retrieve the closest matching network for a domain and path.\n\t *\n\t * This will not necessarily return an exact match for a domain and path. Instead, it\n\t * breaks the domain and path into pieces that are then used to match the closest\n\t * possibility from a query.\n\t *\n\t * The intent of this method is to match a network during bootstrap for a\n\t * requested site address.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string   $domain   Domain to check.\n\t * @param string   $path     Path to check.\n\t * @param int|null $segments Path segments to use. Defaults to null, or the full path.\n\t * @return WP_Network|bool Network object if successful. False when no network is found.\n\t */\n\tpublic static function get_by_path( $domain = '', $path = '', $segments = null ) {\n\t\t$domains = array( $domain );\n\t\t$pieces  = explode( '.', $domain );\n\n\t\t/*\n\t\t * It's possible one domain to search is 'com', but it might as well\n\t\t * be 'localhost' or some other locally mapped domain.\n\t\t */\n\t\twhile ( array_shift( $pieces ) ) {\n\t\t\tif ( ! empty( $pieces ) ) {\n\t\t\t\t$domains[] = implode( '.', $pieces );\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * If we've gotten to this function during normal execution, there is\n\t\t * more than one network installed. At this point, who knows how many\n\t\t * we have. Attempt to optimize for the situation where networks are\n\t\t * only domains, thus meaning paths never need to be considered.\n\t\t *\n\t\t * This is a very basic optimization; anything further could have\n\t\t * drawbacks depending on the setup, so this is best done per-installation.\n\t\t */\n\t\t$using_paths = true;\n\t\tif ( wp_using_ext_object_cache() ) {\n\t\t\t$using_paths = wp_cache_get( 'networks_have_paths', 'site-options' );\n\t\t\tif ( false === $using_paths ) {\n\t\t\t\t$using_paths = get_networks(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'number'       => 1,\n\t\t\t\t\t\t'count'        => true,\n\t\t\t\t\t\t'path__not_in' => '/',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\twp_cache_add( 'networks_have_paths', $using_paths, 'site-options' );\n\t\t\t}\n\t\t}\n\n\t\t$paths = array();\n\t\tif ( $using_paths ) {\n\t\t\t$path_segments = array_filter( explode( '/', trim( $path, '/' ) ) );\n\n\t\t\t/**\n\t\t\t * Filters the number of path segments to consider when searching for a site.\n\t\t\t *\n\t\t\t * @since 3.9.0\n\t\t\t *\n\t\t\t * @param int|null $segments The number of path segments to consider. WordPress by default looks at\n\t\t\t *                           one path segment. The function default of null only makes sense when you\n\t\t\t *                           know the requested path should match a network.\n\t\t\t * @param string   $domain   The requested domain.\n\t\t\t * @param string   $path     The requested path, in full.\n\t\t\t */\n\t\t\t$segments = apply_filters( 'network_by_path_segments_count', $segments, $domain, $path );\n\n\t\t\tif ( ( null !== $segments ) && count( $path_segments ) > $segments ) {\n\t\t\t\t$path_segments = array_slice( $path_segments, 0, $segments );\n\t\t\t}\n\n\t\t\twhile ( count( $path_segments ) ) {\n\t\t\t\t$paths[] = '/' . implode( '/', $path_segments ) . '/';\n\t\t\t\tarray_pop( $path_segments );\n\t\t\t}\n\n\t\t\t$paths[] = '/';\n\t\t}\n\n\t\t/**\n\t\t * Determine a network by its domain and path.\n\t\t *\n\t\t * This allows one to short-circuit the default logic, perhaps by\n\t\t * replacing it with a routine that is more optimal for your setup.\n\t\t *\n\t\t * Return null to avoid the short-circuit. Return false if no network\n\t\t * can be found at the requested domain and path. Otherwise, return\n\t\t * an object from wp_get_network().\n\t\t *\n\t\t * @since 3.9.0\n\t\t *\n\t\t * @param null|bool|WP_Network $network  Network value to return by path. Default null\n\t\t *                                       to continue retrieving the network.\n\t\t * @param string               $domain   The requested domain.\n\t\t * @param string               $path     The requested path, in full.\n\t\t * @param int|null             $segments The suggested number of paths to consult.\n\t\t *                                       Default null, meaning the entire path was to be consulted.\n\t\t * @param string[]             $paths    Array of paths to search for, based on `$path` and `$segments`.\n\t\t */\n\t\t$pre = apply_filters( 'pre_get_network_by_path', null, $domain, $path, $segments, $paths );\n\t\tif ( null !== $pre ) {\n\t\t\treturn $pre;\n\t\t}\n\n\t\tif ( ! $using_paths ) {\n\t\t\t$networks = get_networks(\n\t\t\t\tarray(\n\t\t\t\t\t'number'     => 1,\n\t\t\t\t\t'orderby'    => array(\n\t\t\t\t\t\t'domain_length' => 'DESC',\n\t\t\t\t\t),\n\t\t\t\t\t'domain__in' => $domains,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( ! empty( $networks ) ) {\n\t\t\t\treturn array_shift( $networks );\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$networks = get_networks(\n\t\t\tarray(\n\t\t\t\t'orderby'    => array(\n\t\t\t\t\t'domain_length' => 'DESC',\n\t\t\t\t\t'path_length'   => 'DESC',\n\t\t\t\t),\n\t\t\t\t'domain__in' => $domains,\n\t\t\t\t'path__in'   => $paths,\n\t\t\t)\n\t\t);\n\n\t\t/*\n\t\t * Domains are sorted by length of domain, then by length of path.\n\t\t * The domain must match for the path to be considered. Otherwise,\n\t\t * a network with the path of / will suffice.\n\t\t */\n\t\t$found = false;\n\t\tforeach ( $networks as $network ) {\n\t\t\tif ( ( $network->domain === $domain ) || ( \"www.{$network->domain}\" === $domain ) ) {\n\t\t\t\tif ( in_array( $network->path, $paths, true ) ) {\n\t\t\t\t\t$found = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( '/' === $network->path ) {\n\t\t\t\t$found = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( true === $found ) {\n\t\t\treturn $network;\n\t\t}\n\n\t\treturn false;\n\t}\n}\n", "num_lines": 478}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Object Cache API: WP_Object_Cache class\n *\n * @package WordPress\n * @subpackage Cache\n * @since 5.4.0\n */\n\n/**\n * Core class that implements an object cache.\n *\n * The WordPress Object Cache is used to save on trips to the database. The\n * Object Cache stores all of the cache data to memory and makes the cache\n * contents available by using a key, which is used to name and later retrieve\n * the cache contents.\n *\n * The Object Cache can be replaced by other caching mechanisms by placing files\n * in the wp-content folder which is looked at in wp-settings. If that file\n * exists, then this file will not be included.\n *\n * @since 2.0.0\n */\nclass WP_Object_Cache {\n\n\t/**\n\t * Holds the cached objects.\n\t *\n\t * @since 2.0.0\n\t * @var array\n\t */\n\tprivate $cache = array();\n\n\t/**\n\t * The amount of times the cache data was already stored in the cache.\n\t *\n\t * @since 2.5.0\n\t * @var int\n\t */\n\tpublic $cache_hits = 0;\n\n\t/**\n\t * Amount of times the cache did not have the request in cache.\n\t *\n\t * @since 2.0.0\n\t * @var int\n\t */\n\tpublic $cache_misses = 0;\n\n\t/**\n\t * List of global cache groups.\n\t *\n\t * @since 3.0.0\n\t * @var array\n\t */\n\tprotected $global_groups = array();\n\n\t/**\n\t * The blog prefix to prepend to keys in non-global groups.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tprivate $blog_prefix;\n\n\t/**\n\t * Holds the value of is_multisite().\n\t *\n\t * @since 3.5.0\n\t * @var bool\n\t */\n\tprivate $multisite;\n\n\t/**\n\t * Sets up object properties; PHP 5 style constructor.\n\t *\n\t * @since 2.0.8\n\t */\n\tpublic function __construct() {\n\t\t$this->multisite   = is_multisite();\n\t\t$this->blog_prefix = $this->multisite ? get_current_blog_id() . ':' : '';\n\t}\n\n\t/**\n\t * Makes private properties readable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name Property to get.\n\t * @return mixed Property.\n\t */\n\tpublic function __get( $name ) {\n\t\treturn $this->$name;\n\t}\n\n\t/**\n\t * Makes private properties settable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name  Property to set.\n\t * @param mixed  $value Property value.\n\t * @return mixed Newly-set property.\n\t */\n\tpublic function __set( $name, $value ) {\n\t\treturn $this->$name = $value;\n\t}\n\n\t/**\n\t * Makes private properties checkable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name Property to check if set.\n\t * @return bool Whether the property is set.\n\t */\n\tpublic function __isset( $name ) {\n\t\treturn isset( $this->$name );\n\t}\n\n\t/**\n\t * Makes private properties un-settable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name Property to unset.\n\t */\n\tpublic function __unset( $name ) {\n\t\tunset( $this->$name );\n\t}\n\n\t/**\n\t * Adds data to the cache if it doesn't already exist.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @uses WP_Object_Cache::_exists() Checks to see if the cache already has data.\n\t * @uses WP_Object_Cache::set()     Sets the data after the checking the cache\n\t *                                  contents existence.\n\t *\n\t * @param int|string $key    What to call the contents in the cache.\n\t * @param mixed      $data   The contents to store in the cache.\n\t * @param string     $group  Optional. Where to group the cache contents. Default 'default'.\n\t * @param int        $expire Optional. When to expire the cache contents. Default 0 (no expiration).\n\t * @return bool True on success, false if cache key and group already exist.\n\t */\n\tpublic function add( $key, $data, $group = 'default', $expire = 0 ) {\n\t\tif ( wp_suspend_cache_addition() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( empty( $group ) ) {\n\t\t\t$group = 'default';\n\t\t}\n\n\t\t$id = $key;\n\t\tif ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {\n\t\t\t$id = $this->blog_prefix . $key;\n\t\t}\n\n\t\tif ( $this->_exists( $id, $group ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->set( $key, $data, $group, (int) $expire );\n\t}\n\n\t/**\n\t * Sets the list of global cache groups.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param array $groups List of groups that are global.\n\t */\n\tpublic function add_global_groups( $groups ) {\n\t\t$groups = (array) $groups;\n\n\t\t$groups              = array_fill_keys( $groups, true );\n\t\t$this->global_groups = array_merge( $this->global_groups, $groups );\n\t}\n\n\t/**\n\t * Decrements numeric cache item's value.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param int|string $key    The cache key to decrement.\n\t * @param int        $offset Optional. The amount by which to decrement the item's value. Default 1.\n\t * @param string     $group  Optional. The group the key is in. Default 'default'.\n\t * @return int|false The item's new value on success, false on failure.\n\t */\n\tpublic function decr( $key, $offset = 1, $group = 'default' ) {\n\t\tif ( empty( $group ) ) {\n\t\t\t$group = 'default';\n\t\t}\n\n\t\tif ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {\n\t\t\t$key = $this->blog_prefix . $key;\n\t\t}\n\n\t\tif ( ! $this->_exists( $key, $group ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! is_numeric( $this->cache[ $group ][ $key ] ) ) {\n\t\t\t$this->cache[ $group ][ $key ] = 0;\n\t\t}\n\n\t\t$offset = (int) $offset;\n\n\t\t$this->cache[ $group ][ $key ] -= $offset;\n\n\t\tif ( $this->cache[ $group ][ $key ] < 0 ) {\n\t\t\t$this->cache[ $group ][ $key ] = 0;\n\t\t}\n\n\t\treturn $this->cache[ $group ][ $key ];\n\t}\n\n\t/**\n\t * Removes the contents of the cache key in the group.\n\t *\n\t * If the cache key does not exist in the group, then nothing will happen.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param int|string $key        What the contents in the cache are called.\n\t * @param string     $group      Optional. Where the cache contents are grouped. Default 'default'.\n\t * @param bool       $deprecated Optional. Unused. Default false.\n\t * @return bool False if the contents weren't deleted and true on success.\n\t */\n\tpublic function delete( $key, $group = 'default', $deprecated = false ) {\n\t\tif ( empty( $group ) ) {\n\t\t\t$group = 'default';\n\t\t}\n\n\t\tif ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {\n\t\t\t$key = $this->blog_prefix . $key;\n\t\t}\n\n\t\tif ( ! $this->_exists( $key, $group ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tunset( $this->cache[ $group ][ $key ] );\n\t\treturn true;\n\t}\n\n\t/**\n\t * Clears the object cache of all data.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @return true Always returns true.\n\t */\n\tpublic function flush() {\n\t\t$this->cache = array();\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves the cache contents, if it exists.\n\t *\n\t * The contents will be first attempted to be retrieved by searching by the\n\t * key in the cache group. If the cache is hit (success) then the contents\n\t * are returned.\n\t *\n\t * On failure, the number of cache misses will be incremented.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param int|string $key   The key under which the cache contents are stored.\n\t * @param string     $group Optional. Where the cache contents are grouped. Default 'default'.\n\t * @param bool       $force Optional. Unused. Whether to force an update of the local cache\n\t *                          from the persistent cache. Default false.\n\t * @param bool       $found Optional. Whether the key was found in the cache (passed by reference).\n\t *                          Disambiguates a return of false, a storable value. Default null.\n\t * @return mixed|false The cache contents on success, false on failure to retrieve contents.\n\t */\n\tpublic function get( $key, $group = 'default', $force = false, &$found = null ) {\n\t\tif ( empty( $group ) ) {\n\t\t\t$group = 'default';\n\t\t}\n\n\t\tif ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {\n\t\t\t$key = $this->blog_prefix . $key;\n\t\t}\n\n\t\tif ( $this->_exists( $key, $group ) ) {\n\t\t\t$found             = true;\n\t\t\t$this->cache_hits += 1;\n\t\t\tif ( is_object( $this->cache[ $group ][ $key ] ) ) {\n\t\t\t\treturn clone $this->cache[ $group ][ $key ];\n\t\t\t} else {\n\t\t\t\treturn $this->cache[ $group ][ $key ];\n\t\t\t}\n\t\t}\n\n\t\t$found               = false;\n\t\t$this->cache_misses += 1;\n\t\treturn false;\n\t}\n\n\t/**\n\t * Retrieves multiple values from the cache in one call.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param array  $keys  Array of keys under which the cache contents are stored.\n\t * @param string $group Optional. Where the cache contents are grouped. Default 'default'.\n\t * @param bool   $force Optional. Whether to force an update of the local cache\n\t *                      from the persistent cache. Default false.\n\t * @return array Array of values organized into groups.\n\t */\n\tpublic function get_multiple( $keys, $group = 'default', $force = false ) {\n\t\t$values = array();\n\n\t\tforeach ( $keys as $key ) {\n\t\t\t$values[ $key ] = $this->get( $key, $group, $force );\n\t\t}\n\n\t\treturn $values;\n\t}\n\n\t/**\n\t * Increments numeric cache item's value.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param int|string $key    The cache key to increment\n\t * @param int        $offset Optional. The amount by which to increment the item's value. Default 1.\n\t * @param string     $group  Optional. The group the key is in. Default 'default'.\n\t * @return int|false The item's new value on success, false on failure.\n\t */\n\tpublic function incr( $key, $offset = 1, $group = 'default' ) {\n\t\tif ( empty( $group ) ) {\n\t\t\t$group = 'default';\n\t\t}\n\n\t\tif ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {\n\t\t\t$key = $this->blog_prefix . $key;\n\t\t}\n\n\t\tif ( ! $this->_exists( $key, $group ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! is_numeric( $this->cache[ $group ][ $key ] ) ) {\n\t\t\t$this->cache[ $group ][ $key ] = 0;\n\t\t}\n\n\t\t$offset = (int) $offset;\n\n\t\t$this->cache[ $group ][ $key ] += $offset;\n\n\t\tif ( $this->cache[ $group ][ $key ] < 0 ) {\n\t\t\t$this->cache[ $group ][ $key ] = 0;\n\t\t}\n\n\t\treturn $this->cache[ $group ][ $key ];\n\t}\n\n\t/**\n\t * Replaces the contents in the cache, if contents already exist.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @see WP_Object_Cache::set()\n\t *\n\t * @param int|string $key    What to call the contents in the cache.\n\t * @param mixed      $data   The contents to store in the cache.\n\t * @param string     $group  Optional. Where to group the cache contents. Default 'default'.\n\t * @param int        $expire Optional. When to expire the cache contents. Default 0 (no expiration).\n\t * @return bool False if not exists, true if contents were replaced.\n\t */\n\tpublic function replace( $key, $data, $group = 'default', $expire = 0 ) {\n\t\tif ( empty( $group ) ) {\n\t\t\t$group = 'default';\n\t\t}\n\n\t\t$id = $key;\n\t\tif ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {\n\t\t\t$id = $this->blog_prefix . $key;\n\t\t}\n\n\t\tif ( ! $this->_exists( $id, $group ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->set( $key, $data, $group, (int) $expire );\n\t}\n\n\t/**\n\t * Resets cache keys.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @deprecated 3.5.0 Use switch_to_blog()\n\t * @see switch_to_blog()\n\t */\n\tpublic function reset() {\n\t\t_deprecated_function( __FUNCTION__, '3.5.0', 'switch_to_blog()' );\n\n\t\t// Clear out non-global caches since the blog ID has changed.\n\t\tforeach ( array_keys( $this->cache ) as $group ) {\n\t\t\tif ( ! isset( $this->global_groups[ $group ] ) ) {\n\t\t\t\tunset( $this->cache[ $group ] );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Sets the data contents into the cache.\n\t *\n\t * The cache contents are grouped by the $group parameter followed by the\n\t * $key. This allows for duplicate IDs in unique groups. Therefore, naming of\n\t * the group should be used with care and should follow normal function\n\t * naming guidelines outside of core WordPress usage.\n\t *\n\t * The $expire parameter is not used, because the cache will automatically\n\t * expire for each time a page is accessed and PHP finishes. The method is\n\t * more for cache plugins which use files.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param int|string $key    What to call the contents in the cache.\n\t * @param mixed      $data   The contents to store in the cache.\n\t * @param string     $group  Optional. Where to group the cache contents. Default 'default'.\n\t * @param int        $expire Not Used.\n\t * @return true Always returns true.\n\t */\n\tpublic function set( $key, $data, $group = 'default', $expire = 0 ) {\n\t\tif ( empty( $group ) ) {\n\t\t\t$group = 'default';\n\t\t}\n\n\t\tif ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {\n\t\t\t$key = $this->blog_prefix . $key;\n\t\t}\n\n\t\tif ( is_object( $data ) ) {\n\t\t\t$data = clone $data;\n\t\t}\n\n\t\t$this->cache[ $group ][ $key ] = $data;\n\t\treturn true;\n\t}\n\n\t/**\n\t * Echoes the stats of the caching.\n\t *\n\t * Gives the cache hits, and cache misses. Also prints every cached group,\n\t * key and the data.\n\t *\n\t * @since 2.0.0\n\t */\n\tpublic function stats() {\n\t\techo '<p>';\n\t\techo \"<strong>Cache Hits:</strong> {$this->cache_hits}<br />\";\n\t\techo \"<strong>Cache Misses:</strong> {$this->cache_misses}<br />\";\n\t\techo '</p>';\n\t\techo '<ul>';\n\t\tforeach ( $this->cache as $group => $cache ) {\n\t\t\techo '<li><strong>Group:</strong> ' . esc_html( $group ) . ' - ( ' . number_format( strlen( serialize( $cache ) ) / KB_IN_BYTES, 2 ) . 'k )</li>';\n\t\t}\n\t\techo '</ul>';\n\t}\n\n\t/**\n\t * Switches the internal blog ID.\n\t *\n\t * This changes the blog ID used to create keys in blog specific groups.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param int $blog_id Blog ID.\n\t */\n\tpublic function switch_to_blog( $blog_id ) {\n\t\t$blog_id           = (int) $blog_id;\n\t\t$this->blog_prefix = $this->multisite ? $blog_id . ':' : '';\n\t}\n\n\t/**\n\t * Serves as a utility function to determine whether a key exists in the cache.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param int|string $key   Cache key to check for existence.\n\t * @param string     $group Cache group for the key existence check.\n\t * @return bool Whether the key exists in the cache for the given group.\n\t */\n\tprotected function _exists( $key, $group ) {\n\t\treturn isset( $this->cache[ $group ] ) && ( isset( $this->cache[ $group ][ $key ] ) || array_key_exists( $key, $this->cache[ $group ] ) );\n\t}\n}\n", "num_lines": 497}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WP_oEmbed_Controller class, used to provide an oEmbed endpoint.\n *\n * @package WordPress\n * @subpackage Embeds\n * @since 4.4.0\n */\n\n/**\n * oEmbed API endpoint controller.\n *\n * Registers the API route and delivers the response data.\n * The output format (XML or JSON) is handled by the REST API.\n *\n * @since 4.4.0\n */\nfinal class WP_oEmbed_Controller {\n\t/**\n\t * Register the oEmbed REST API route.\n\t *\n\t * @since 4.4.0\n\t */\n\tpublic function register_routes() {\n\t\t/**\n\t\t * Filters the maxwidth oEmbed parameter.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param int $maxwidth Maximum allowed width. Default 600.\n\t\t */\n\t\t$maxwidth = apply_filters( 'oembed_default_width', 600 );\n\n\t\tregister_rest_route(\n\t\t\t'oembed/1.0',\n\t\t\t'/embed',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_item' ),\n\t\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'url'      => array(\n\t\t\t\t\t\t\t'description' => __( 'The URL of the resource for which to fetch oEmbed data.' ),\n\t\t\t\t\t\t\t'required'    => true,\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'format'   => array(\n\t\t\t\t\t\t\t'default'           => 'json',\n\t\t\t\t\t\t\t'sanitize_callback' => 'wp_oembed_ensure_format',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'maxwidth' => array(\n\t\t\t\t\t\t\t'default'           => $maxwidth,\n\t\t\t\t\t\t\t'sanitize_callback' => 'absint',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\tregister_rest_route(\n\t\t\t'oembed/1.0',\n\t\t\t'/proxy',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_proxy_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_proxy_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'url'       => array(\n\t\t\t\t\t\t\t'description' => __( 'The URL of the resource for which to fetch oEmbed data.' ),\n\t\t\t\t\t\t\t'required'    => true,\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'format'    => array(\n\t\t\t\t\t\t\t'description' => __( 'The oEmbed format to use.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t'default'     => 'json',\n\t\t\t\t\t\t\t'enum'        => array(\n\t\t\t\t\t\t\t\t'json',\n\t\t\t\t\t\t\t\t'xml',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'maxwidth'  => array(\n\t\t\t\t\t\t\t'description'       => __( 'The maximum width of the embed frame in pixels.' ),\n\t\t\t\t\t\t\t'type'              => 'integer',\n\t\t\t\t\t\t\t'default'           => $maxwidth,\n\t\t\t\t\t\t\t'sanitize_callback' => 'absint',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'maxheight' => array(\n\t\t\t\t\t\t\t'description'       => __( 'The maximum height of the embed frame in pixels.' ),\n\t\t\t\t\t\t\t'type'              => 'integer',\n\t\t\t\t\t\t\t'sanitize_callback' => 'absint',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'discover'  => array(\n\t\t\t\t\t\t\t'description' => __( 'Whether to perform an oEmbed discovery request for unsanctioned providers.' ),\n\t\t\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t\t\t'default'     => true,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Callback for the embed API endpoint.\n\t *\n\t * Returns the JSON object for the post.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param WP_REST_Request $request Full data about the request.\n\t * @return array|WP_Error oEmbed response data or WP_Error on failure.\n\t */\n\tpublic function get_item( $request ) {\n\t\t$post_id = url_to_postid( $request['url'] );\n\n\t\t/**\n\t\t * Filters the determined post ID.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param int    $post_id The post ID.\n\t\t * @param string $url     The requested URL.\n\t\t */\n\t\t$post_id = apply_filters( 'oembed_request_post_id', $post_id, $request['url'] );\n\n\t\t$data = get_oembed_response_data( $post_id, $request['maxwidth'] );\n\n\t\tif ( ! $data ) {\n\t\t\treturn new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array( 'status' => 404 ) );\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Checks if current user can make a proxy oEmbed request.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @return true|WP_Error True if the request has read access, WP_Error object otherwise.\n\t */\n\tpublic function get_proxy_item_permissions_check() {\n\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\treturn new WP_Error( 'rest_forbidden', __( 'Sorry, you are not allowed to make proxied oEmbed requests.' ), array( 'status' => rest_authorization_required_code() ) );\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Callback for the proxy API endpoint.\n\t *\n\t * Returns the JSON object for the proxied item.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @see WP_oEmbed::get_html()\n\t * @param WP_REST_Request $request Full data about the request.\n\t * @return object|WP_Error oEmbed response data or WP_Error on failure.\n\t */\n\tpublic function get_proxy_item( $request ) {\n\t\t$args = $request->get_params();\n\n\t\t// Serve oEmbed data from cache if set.\n\t\tunset( $args['_wpnonce'] );\n\t\t$cache_key = 'oembed_' . md5( serialize( $args ) );\n\t\t$data      = get_transient( $cache_key );\n\t\tif ( ! empty( $data ) ) {\n\t\t\treturn $data;\n\t\t}\n\n\t\t$url = $request['url'];\n\t\tunset( $args['url'] );\n\n\t\t// Copy maxwidth/maxheight to width/height since WP_oEmbed::fetch() uses these arg names.\n\t\tif ( isset( $args['maxwidth'] ) ) {\n\t\t\t$args['width'] = $args['maxwidth'];\n\t\t}\n\t\tif ( isset( $args['maxheight'] ) ) {\n\t\t\t$args['height'] = $args['maxheight'];\n\t\t}\n\n\t\t// Short-circuit process for URLs belonging to the current site.\n\t\t$data = get_oembed_response_data_for_url( $url, $args );\n\n\t\tif ( $data ) {\n\t\t\treturn $data;\n\t\t}\n\n\t\t$data = _wp_oembed_get_object()->get_data( $url, $args );\n\n\t\tif ( false === $data ) {\n\t\t\t// Try using a classic embed, instead.\n\t\t\tglobal $wp_embed;\n\n\t\t\t/* @var WP_Embed $wp_embed */\n\t\t\t$html = $wp_embed->get_embed_handler_html( $args, $url );\n\n\t\t\tif ( $html ) {\n\t\t\t\tglobal $wp_scripts;\n\t\t\t\t// Check if any scripts were enqueued by the shortcode, and include them in the response.\n\t\t\t\t$enqueued_scripts = array();\n\n\t\t\t\tforeach ( $wp_scripts->queue as $script ) {\n\t\t\t\t\t$enqueued_scripts[] = $wp_scripts->registered[ $script ]->src;\n\t\t\t\t}\n\n\t\t\t\treturn (object) array(\n\t\t\t\t\t'provider_name' => __( 'Embed Handler' ),\n\t\t\t\t\t'html'          => $html,\n\t\t\t\t\t'scripts'       => $enqueued_scripts,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array( 'status' => 404 ) );\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/class-wp-oembed.php */\n\t\t$data->html = apply_filters( 'oembed_result', _wp_oembed_get_object()->data2html( (object) $data, $url ), $url, $args );\n\n\t\t/**\n\t\t * Filters the oEmbed TTL value (time to live).\n\t\t *\n\t\t * Similar to the {@see 'oembed_ttl'} filter, but for the REST API\n\t\t * oEmbed proxy endpoint.\n\t\t *\n\t\t * @since 4.8.0\n\t\t *\n\t\t * @param int    $time    Time to live (in seconds).\n\t\t * @param string $url     The attempted embed URL.\n\t\t * @param array  $args    An array of embed request arguments.\n\t\t */\n\t\t$ttl = apply_filters( 'rest_oembed_ttl', DAY_IN_SECONDS, $url, $args );\n\n\t\tset_transient( $cache_key, $data, $ttl );\n\n\t\treturn $data;\n\t}\n}\n", "num_lines": 244}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * API for fetching the HTML to embed remote content based on a provided URL\n *\n * Used internally by the WP_Embed class, but is designed to be generic.\n *\n * @link https://wordpress.org/support/article/embeds/\n * @link http://oembed.com/\n *\n * @package WordPress\n * @subpackage oEmbed\n */\n\n/**\n * Core class used to implement oEmbed functionality.\n *\n * @since 2.9.0\n */\nclass WP_oEmbed {\n\n\t/**\n\t * A list of oEmbed providers.\n\t *\n\t * @since 2.9.0\n\t * @var array\n\t */\n\tpublic $providers = array();\n\n\t/**\n\t * A list of an early oEmbed providers.\n\t *\n\t * @since 4.0.0\n\t * @var array\n\t */\n\tpublic static $early_providers = array();\n\n\t/**\n\t * A list of private/protected methods, used for backward compatibility.\n\t *\n\t * @since 4.2.0\n\t * @var array\n\t */\n\tprivate $compat_methods = array( '_fetch_with_format', '_parse_json', '_parse_xml', '_parse_xml_body' );\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 2.9.0\n\t */\n\tpublic function __construct() {\n\t\t$host      = urlencode( home_url() );\n\t\t$providers = array(\n\t\t\t'#https?://((m|www)\\.)?youtube\\.com/watch.*#i' => array( 'https://www.youtube.com/oembed', true ),\n\t\t\t'#https?://((m|www)\\.)?youtube\\.com/playlist.*#i' => array( 'https://www.youtube.com/oembed', true ),\n\t\t\t'#https?://youtu\\.be/.*#i'                     => array( 'https://www.youtube.com/oembed', true ),\n\t\t\t'#https?://(.+\\.)?vimeo\\.com/.*#i'             => array( 'https://vimeo.com/api/oembed.{format}', true ),\n\t\t\t'#https?://(www\\.)?dailymotion\\.com/.*#i'      => array( 'https://www.dailymotion.com/services/oembed', true ),\n\t\t\t'#https?://dai\\.ly/.*#i'                       => array( 'https://www.dailymotion.com/services/oembed', true ),\n\t\t\t'#https?://(www\\.)?flickr\\.com/.*#i'           => array( 'https://www.flickr.com/services/oembed/', true ),\n\t\t\t'#https?://flic\\.kr/.*#i'                      => array( 'https://www.flickr.com/services/oembed/', true ),\n\t\t\t'#https?://(.+\\.)?smugmug\\.com/.*#i'           => array( 'https://api.smugmug.com/services/oembed/', true ),\n\t\t\t'#https?://(www\\.)?scribd\\.com/(doc|document)/.*#i' => array( 'https://www.scribd.com/services/oembed', true ),\n\t\t\t'#https?://wordpress\\.tv/.*#i'                 => array( 'https://wordpress.tv/oembed/', true ),\n\t\t\t'#https?://(.+\\.)?polldaddy\\.com/.*#i'         => array( 'https://api.crowdsignal.com/oembed', true ),\n\t\t\t'#https?://poll\\.fm/.*#i'                      => array( 'https://api.crowdsignal.com/oembed', true ),\n\t\t\t'#https?://(.+\\.)?survey\\.fm/.*#i'             => array( 'https://api.crowdsignal.com/oembed', true ),\n\t\t\t'#https?://(www\\.)?twitter\\.com/\\w{1,15}/status(es)?/.*#i' => array( 'https://publish.twitter.com/oembed', true ),\n\t\t\t'#https?://(www\\.)?twitter\\.com/\\w{1,15}$#i'   => array( 'https://publish.twitter.com/oembed', true ),\n\t\t\t'#https?://(www\\.)?twitter\\.com/\\w{1,15}/likes$#i' => array( 'https://publish.twitter.com/oembed', true ),\n\t\t\t'#https?://(www\\.)?twitter\\.com/\\w{1,15}/lists/.*#i' => array( 'https://publish.twitter.com/oembed', true ),\n\t\t\t'#https?://(www\\.)?twitter\\.com/\\w{1,15}/timelines/.*#i' => array( 'https://publish.twitter.com/oembed', true ),\n\t\t\t'#https?://(www\\.)?twitter\\.com/i/moments/.*#i' => array( 'https://publish.twitter.com/oembed', true ),\n\t\t\t'#https?://(www\\.)?soundcloud\\.com/.*#i'       => array( 'https://soundcloud.com/oembed', true ),\n\t\t\t'#https?://(.+?\\.)?slideshare\\.net/.*#i'       => array( 'https://www.slideshare.net/api/oembed/2', true ),\n\t\t\t'#https?://(open|play)\\.spotify\\.com/.*#i'     => array( 'https://embed.spotify.com/oembed/', true ),\n\t\t\t'#https?://(.+\\.)?imgur\\.com/.*#i'             => array( 'https://api.imgur.com/oembed', true ),\n\t\t\t'#https?://(www\\.)?meetu(\\.ps|p\\.com)/.*#i'    => array( 'https://api.meetup.com/oembed', true ),\n\t\t\t'#https?://(www\\.)?issuu\\.com/.+/docs/.+#i'    => array( 'https://issuu.com/oembed_wp', true ),\n\t\t\t'#https?://(www\\.)?mixcloud\\.com/.*#i'         => array( 'https://www.mixcloud.com/oembed', true ),\n\t\t\t'#https?://(www\\.|embed\\.)?ted\\.com/talks/.*#i' => array( 'https://www.ted.com/services/v1/oembed.{format}', true ),\n\t\t\t'#https?://(www\\.)?(animoto|video214)\\.com/play/.*#i' => array( 'https://animoto.com/oembeds/create', true ),\n\t\t\t'#https?://(.+)\\.tumblr\\.com/post/.*#i'        => array( 'https://www.tumblr.com/oembed/1.0', true ),\n\t\t\t'#https?://(www\\.)?kickstarter\\.com/projects/.*#i' => array( 'https://www.kickstarter.com/services/oembed', true ),\n\t\t\t'#https?://kck\\.st/.*#i'                       => array( 'https://www.kickstarter.com/services/oembed', true ),\n\t\t\t'#https?://cloudup\\.com/.*#i'                  => array( 'https://cloudup.com/oembed', true ),\n\t\t\t'#https?://(www\\.)?reverbnation\\.com/.*#i'     => array( 'https://www.reverbnation.com/oembed', true ),\n\t\t\t'#https?://videopress\\.com/v/.*#'              => array( 'https://public-api.wordpress.com/oembed/?for=' . $host, true ),\n\t\t\t'#https?://(www\\.)?reddit\\.com/r/[^/]+/comments/.*#i' => array( 'https://www.reddit.com/oembed', true ),\n\t\t\t'#https?://(www\\.)?speakerdeck\\.com/.*#i'      => array( 'https://speakerdeck.com/oembed.{format}', true ),\n\t\t\t'#https?://(www\\.)?screencast\\.com/.*#i'       => array( 'https://api.screencast.com/external/oembed', true ),\n\t\t\t'#https?://([a-z0-9-]+\\.)?amazon\\.(com|com\\.mx|com\\.br|ca)/.*#i' => array( 'https://read.amazon.com/kp/api/oembed', true ),\n\t\t\t'#https?://([a-z0-9-]+\\.)?amazon\\.(co\\.uk|de|fr|it|es|in|nl|ru)/.*#i' => array( 'https://read.amazon.co.uk/kp/api/oembed', true ),\n\t\t\t'#https?://([a-z0-9-]+\\.)?amazon\\.(co\\.jp|com\\.au)/.*#i' => array( 'https://read.amazon.com.au/kp/api/oembed', true ),\n\t\t\t'#https?://([a-z0-9-]+\\.)?amazon\\.cn/.*#i'     => array( 'https://read.amazon.cn/kp/api/oembed', true ),\n\t\t\t'#https?://(www\\.)?a\\.co/.*#i'                 => array( 'https://read.amazon.com/kp/api/oembed', true ),\n\t\t\t'#https?://(www\\.)?amzn\\.to/.*#i'              => array( 'https://read.amazon.com/kp/api/oembed', true ),\n\t\t\t'#https?://(www\\.)?amzn\\.eu/.*#i'              => array( 'https://read.amazon.co.uk/kp/api/oembed', true ),\n\t\t\t'#https?://(www\\.)?amzn\\.in/.*#i'              => array( 'https://read.amazon.in/kp/api/oembed', true ),\n\t\t\t'#https?://(www\\.)?amzn\\.asia/.*#i'            => array( 'https://read.amazon.com.au/kp/api/oembed', true ),\n\t\t\t'#https?://(www\\.)?z\\.cn/.*#i'                 => array( 'https://read.amazon.cn/kp/api/oembed', true ),\n\t\t\t'#https?://www\\.someecards\\.com/.+-cards/.+#i' => array( 'https://www.someecards.com/v2/oembed/', true ),\n\t\t\t'#https?://www\\.someecards\\.com/usercards/viewcard/.+#i' => array( 'https://www.someecards.com/v2/oembed/', true ),\n\t\t\t'#https?://some\\.ly\\/.+#i'                     => array( 'https://www.someecards.com/v2/oembed/', true ),\n\t\t\t'#https?://(www\\.)?tiktok\\.com/.*/video/.*#i'  => array( 'https://www.tiktok.com/oembed', true ),\n\t\t);\n\n\t\tif ( ! empty( self::$early_providers['add'] ) ) {\n\t\t\tforeach ( self::$early_providers['add'] as $format => $data ) {\n\t\t\t\t$providers[ $format ] = $data;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( self::$early_providers['remove'] ) ) {\n\t\t\tforeach ( self::$early_providers['remove'] as $format ) {\n\t\t\t\tunset( $providers[ $format ] );\n\t\t\t}\n\t\t}\n\n\t\tself::$early_providers = array();\n\n\t\t/**\n\t\t * Filters the list of sanctioned oEmbed providers.\n\t\t *\n\t\t * Since WordPress 4.4, oEmbed discovery is enabled for all users and allows embedding of sanitized\n\t\t * iframes. The providers in this list are sanctioned, meaning they are trusted and allowed to\n\t\t * embed any content, such as iframes, videos, JavaScript, and arbitrary HTML.\n\t\t *\n\t\t * Supported providers:\n\t\t *\n\t\t * |   Provider   |                     Flavor                |  Since  |\n\t\t * | ------------ | ----------------------------------------- | ------- |\n\t\t * | Dailymotion  | dailymotion.com                           | 2.9.0   |\n\t\t * | Flickr       | flickr.com                                | 2.9.0   |\n\t\t * | Scribd       | scribd.com                                | 2.9.0   |\n\t\t * | Vimeo        | vimeo.com                                 | 2.9.0   |\n\t\t * | WordPress.tv | wordpress.tv                              | 2.9.0   |\n\t\t * | YouTube      | youtube.com/watch                         | 2.9.0   |\n\t\t * | Crowdsignal  | polldaddy.com                             | 3.0.0   |\n\t\t * | SmugMug      | smugmug.com                               | 3.0.0   |\n\t\t * | YouTube      | youtu.be                                  | 3.0.0   |\n\t\t * | Twitter      | twitter.com                               | 3.4.0   |\n\t\t * | Slideshare   | slideshare.net                            | 3.5.0   |\n\t\t * | SoundCloud   | soundcloud.com                            | 3.5.0   |\n\t\t * | Dailymotion  | dai.ly                                    | 3.6.0   |\n\t\t * | Flickr       | flic.kr                                   | 3.6.0   |\n\t\t * | Spotify      | spotify.com                               | 3.6.0   |\n\t\t * | Imgur        | imgur.com                                 | 3.9.0   |\n\t\t * | Meetup.com   | meetup.com                                | 3.9.0   |\n\t\t * | Meetup.com   | meetu.ps                                  | 3.9.0   |\n\t\t * | Animoto      | animoto.com                               | 4.0.0   |\n\t\t * | Animoto      | video214.com                              | 4.0.0   |\n\t\t * | Issuu        | issuu.com                                 | 4.0.0   |\n\t\t * | Mixcloud     | mixcloud.com                              | 4.0.0   |\n\t\t * | Crowdsignal  | poll.fm                                   | 4.0.0   |\n\t\t * | TED          | ted.com                                   | 4.0.0   |\n\t\t * | YouTube      | youtube.com/playlist                      | 4.0.0   |\n\t\t * | Tumblr       | tumblr.com                                | 4.2.0   |\n\t\t * | Kickstarter  | kickstarter.com                           | 4.2.0   |\n\t\t * | Kickstarter  | kck.st                                    | 4.2.0   |\n\t\t * | Cloudup      | cloudup.com                               | 4.3.0   |\n\t\t * | ReverbNation | reverbnation.com                          | 4.4.0   |\n\t\t * | VideoPress   | videopress.com                            | 4.4.0   |\n\t\t * | Reddit       | reddit.com                                | 4.4.0   |\n\t\t * | Speaker Deck | speakerdeck.com                           | 4.4.0   |\n\t\t * | Twitter      | twitter.com/timelines                     | 4.5.0   |\n\t\t * | Twitter      | twitter.com/moments                       | 4.5.0   |\n\t\t * | Twitter      | twitter.com/user                          | 4.7.0   |\n\t\t * | Twitter      | twitter.com/likes                         | 4.7.0   |\n\t\t * | Twitter      | twitter.com/lists                         | 4.7.0   |\n\t\t * | Screencast   | screencast.com                            | 4.8.0   |\n\t\t * | Amazon       | amazon.com (com.mx, com.br, ca)           | 4.9.0   |\n\t\t * | Amazon       | amazon.de (fr, it, es, in, nl, ru, co.uk) | 4.9.0   |\n\t\t * | Amazon       | amazon.co.jp (com.au)                     | 4.9.0   |\n\t\t * | Amazon       | amazon.cn                                 | 4.9.0   |\n\t\t * | Amazon       | a.co                                      | 4.9.0   |\n\t\t * | Amazon       | amzn.to (eu, in, asia)                    | 4.9.0   |\n\t\t * | Amazon       | z.cn                                      | 4.9.0   |\n\t\t * | Someecards   | someecards.com                            | 4.9.0   |\n\t\t * | Someecards   | some.ly                                   | 4.9.0   |\n\t\t * | Crowdsignal  | survey.fm                                 | 5.1.0   |\n\t\t * | TikTok       | tiktok.com                                | 5.4.0   |\n\t\t *\n\t\t * No longer supported providers:\n\t\t *\n\t\t * |   Provider   |        Flavor        |   Since   |  Removed  |\n\t\t * | ------------ | -------------------- | --------- | --------- |\n\t\t * | Qik          | qik.com              | 2.9.0     | 3.9.0     |\n\t\t * | Viddler      | viddler.com          | 2.9.0     | 4.0.0     |\n\t\t * | Revision3    | revision3.com        | 2.9.0     | 4.2.0     |\n\t\t * | Blip         | blip.tv              | 2.9.0     | 4.4.0     |\n\t\t * | Rdio         | rdio.com             | 3.6.0     | 4.4.1     |\n\t\t * | Rdio         | rd.io                | 3.6.0     | 4.4.1     |\n\t\t * | Vine         | vine.co              | 4.1.0     | 4.9.0     |\n\t\t * | Photobucket  | photobucket.com      | 2.9.0     | 5.1.0     |\n\t\t * | Funny or Die | funnyordie.com       | 3.0.0     | 5.1.0     |\n\t\t * | CollegeHumor | collegehumor.com     | 4.0.0     | 5.3.1     |\n\t\t * | Hulu         | hulu.com             | 2.9.0     | 5.5.0     |\n\t\t * | Instagram    | instagram.com        | 3.5.0     | 5.5.2     |\n\t\t * | Instagram    | instagr.am           | 3.5.0     | 5.5.2     |\n\t\t * | Instagram TV | instagram.com        | 5.1.0     | 5.5.2     |\n\t\t * | Instagram TV | instagr.am           | 5.1.0     | 5.5.2     |\n\t\t * | Facebook     | facebook.com         | 4.7.0     | 5.5.2     |\n\t\t *\n\t\t * @see wp_oembed_add_provider()\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param array[] $providers An array of arrays containing data about popular oEmbed providers.\n\t\t */\n\t\t$this->providers = apply_filters( 'oembed_providers', $providers );\n\n\t\t// Fix any embeds that contain new lines in the middle of the HTML which breaks wpautop().\n\t\tadd_filter( 'oembed_dataparse', array( $this, '_strip_newlines' ), 10, 3 );\n\t}\n\n\t/**\n\t * Exposes private/protected methods for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name      Method to call.\n\t * @param array  $arguments Arguments to pass when calling.\n\t * @return mixed|bool Return value of the callback, false otherwise.\n\t */\n\tpublic function __call( $name, $arguments ) {\n\t\tif ( in_array( $name, $this->compat_methods, true ) ) {\n\t\t\treturn $this->$name( ...$arguments );\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Takes a URL and returns the corresponding oEmbed provider's URL, if there is one.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @see WP_oEmbed::discover()\n\t *\n\t * @param string       $url  The URL to the content.\n\t * @param string|array $args Optional provider arguments.\n\t * @return string|false The oEmbed provider URL on success, false on failure.\n\t */\n\tpublic function get_provider( $url, $args = '' ) {\n\t\t$args = wp_parse_args( $args );\n\n\t\t$provider = false;\n\n\t\tif ( ! isset( $args['discover'] ) ) {\n\t\t\t$args['discover'] = true;\n\t\t}\n\n\t\tforeach ( $this->providers as $matchmask => $data ) {\n\t\t\tlist( $providerurl, $regex ) = $data;\n\n\t\t\t// Turn the asterisk-type provider URLs into regex.\n\t\t\tif ( ! $regex ) {\n\t\t\t\t$matchmask = '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $matchmask ), '#' ) ) . '#i';\n\t\t\t\t$matchmask = preg_replace( '|^#http\\\\\\://|', '#https?\\://', $matchmask );\n\t\t\t}\n\n\t\t\tif ( preg_match( $matchmask, $url ) ) {\n\t\t\t\t$provider = str_replace( '{format}', 'json', $providerurl ); // JSON is easier to deal with than XML.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $provider && $args['discover'] ) {\n\t\t\t$provider = $this->discover( $url );\n\t\t}\n\n\t\treturn $provider;\n\t}\n\n\t/**\n\t * Adds an oEmbed provider.\n\t *\n\t * The provider is added just-in-time when wp_oembed_add_provider() is called before\n\t * the {@see 'plugins_loaded'} hook.\n\t *\n\t * The just-in-time addition is for the benefit of the {@see 'oembed_providers'} filter.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @see wp_oembed_add_provider()\n\t *\n\t * @param string $format   Format of URL that this provider can handle. You can use\n\t *                         asterisks as wildcards.\n\t * @param string $provider The URL to the oEmbed provider..\n\t * @param bool   $regex    Optional. Whether the $format parameter is in a regex format.\n\t *                         Default false.\n\t */\n\tpublic static function _add_provider_early( $format, $provider, $regex = false ) {\n\t\tif ( empty( self::$early_providers['add'] ) ) {\n\t\t\tself::$early_providers['add'] = array();\n\t\t}\n\n\t\tself::$early_providers['add'][ $format ] = array( $provider, $regex );\n\t}\n\n\t/**\n\t * Removes an oEmbed provider.\n\t *\n\t * The provider is removed just-in-time when wp_oembed_remove_provider() is called before\n\t * the {@see 'plugins_loaded'} hook.\n\t *\n\t * The just-in-time removal is for the benefit of the {@see 'oembed_providers'} filter.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @see wp_oembed_remove_provider()\n\t *\n\t * @param string $format The format of URL that this provider can handle. You can use\n\t *                       asterisks as wildcards.\n\t */\n\tpublic static function _remove_provider_early( $format ) {\n\t\tif ( empty( self::$early_providers['remove'] ) ) {\n\t\t\tself::$early_providers['remove'] = array();\n\t\t}\n\n\t\tself::$early_providers['remove'][] = $format;\n\t}\n\n\t/**\n\t * Takes a URL and attempts to return the oEmbed data.\n\t *\n\t * @see WP_oEmbed::fetch()\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param string       $url  The URL to the content that should be attempted to be embedded.\n\t * @param array|string $args Optional. Arguments, usually passed from a shortcode. Default empty.\n\t * @return object|false The result in the form of an object on success, false on failure.\n\t */\n\tpublic function get_data( $url, $args = '' ) {\n\t\t$args = wp_parse_args( $args );\n\n\t\t$provider = $this->get_provider( $url, $args );\n\n\t\tif ( ! $provider ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$data = $this->fetch( $provider, $url, $args );\n\n\t\tif ( false === $data ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * The do-it-all function that takes a URL and attempts to return the HTML.\n\t *\n\t * @see WP_oEmbed::fetch()\n\t * @see WP_oEmbed::data2html()\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string       $url  The URL to the content that should be attempted to be embedded.\n\t * @param array|string $args Optional. Arguments, usually passed from a shortcode. Default empty.\n\t * @return string|false The UNSANITIZED (and potentially unsafe) HTML that should be used to embed on success,\n\t *                      false on failure.\n\t */\n\tpublic function get_html( $url, $args = '' ) {\n\t\t/**\n\t\t * Filters the oEmbed result before any HTTP requests are made.\n\t\t *\n\t\t * This allows one to short-circuit the default logic, perhaps by\n\t\t * replacing it with a routine that is more optimal for your setup.\n\t\t *\n\t\t * Returning a non-null value from the filter will effectively short-circuit retrieval\n\t\t * and return the passed value instead.\n\t\t *\n\t\t * @since 4.5.3\n\t\t *\n\t\t * @param null|string $result The UNSANITIZED (and potentially unsafe) HTML that should be used to embed.\n\t\t *                            Default null to continue retrieving the result.\n\t\t * @param string      $url    The URL to the content that should be attempted to be embedded.\n\t\t * @param array       $args   Optional. Arguments, usually passed from a shortcode. Default empty.\n\t\t */\n\t\t$pre = apply_filters( 'pre_oembed_result', null, $url, $args );\n\n\t\tif ( null !== $pre ) {\n\t\t\treturn $pre;\n\t\t}\n\n\t\t$data = $this->get_data( $url, $args );\n\n\t\tif ( false === $data ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * Filters the HTML returned by the oEmbed provider.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param string|false $data The returned oEmbed HTML (false if unsafe).\n\t\t * @param string       $url  URL of the content to be embedded.\n\t\t * @param array        $args Optional arguments, usually passed from a shortcode.\n\t\t */\n\t\treturn apply_filters( 'oembed_result', $this->data2html( $data, $url ), $url, $args );\n\t}\n\n\t/**\n\t * Attempts to discover link tags at the given URL for an oEmbed provider.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string $url The URL that should be inspected for discovery `<link>` tags.\n\t * @return string|false The oEmbed provider URL on success, false on failure.\n\t */\n\tpublic function discover( $url ) {\n\t\t$providers = array();\n\t\t$args      = array(\n\t\t\t'limit_response_size' => 153600, // 150 KB\n\t\t);\n\n\t\t/**\n\t\t * Filters oEmbed remote get arguments.\n\t\t *\n\t\t * @since 4.0.0\n\t\t *\n\t\t * @see WP_Http::request()\n\t\t *\n\t\t * @param array  $args oEmbed remote get arguments.\n\t\t * @param string $url  URL to be inspected.\n\t\t */\n\t\t$args = apply_filters( 'oembed_remote_get_args', $args, $url );\n\n\t\t// Fetch URL content.\n\t\t$request = wp_safe_remote_get( $url, $args );\n\t\t$html    = wp_remote_retrieve_body( $request );\n\t\tif ( $html ) {\n\n\t\t\t/**\n\t\t\t * Filters the link types that contain oEmbed provider URLs.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t *\n\t\t\t * @param string[] $format Array of oEmbed link types. Accepts 'application/json+oembed',\n\t\t\t *                         'text/xml+oembed', and 'application/xml+oembed' (incorrect,\n\t\t\t *                         used by at least Vimeo).\n\t\t\t */\n\t\t\t$linktypes = apply_filters(\n\t\t\t\t'oembed_linktypes',\n\t\t\t\tarray(\n\t\t\t\t\t'application/json+oembed' => 'json',\n\t\t\t\t\t'text/xml+oembed'         => 'xml',\n\t\t\t\t\t'application/xml+oembed'  => 'xml',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Strip <body>.\n\t\t\t$html_head_end = stripos( $html, '</head>' );\n\t\t\tif ( $html_head_end ) {\n\t\t\t\t$html = substr( $html, 0, $html_head_end );\n\t\t\t}\n\n\t\t\t// Do a quick check.\n\t\t\t$tagfound = false;\n\t\t\tforeach ( $linktypes as $linktype => $format ) {\n\t\t\t\tif ( stripos( $html, $linktype ) ) {\n\t\t\t\t\t$tagfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $tagfound && preg_match_all( '#<link([^<>]+)/?>#iU', $html, $links ) ) {\n\t\t\t\tforeach ( $links[1] as $link ) {\n\t\t\t\t\t$atts = shortcode_parse_atts( $link );\n\n\t\t\t\t\tif ( ! empty( $atts['type'] ) && ! empty( $linktypes[ $atts['type'] ] ) && ! empty( $atts['href'] ) ) {\n\t\t\t\t\t\t$providers[ $linktypes[ $atts['type'] ] ] = htmlspecialchars_decode( $atts['href'] );\n\n\t\t\t\t\t\t// Stop here if it's JSON (that's all we need).\n\t\t\t\t\t\tif ( 'json' === $linktypes[ $atts['type'] ] ) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// JSON is preferred to XML.\n\t\tif ( ! empty( $providers['json'] ) ) {\n\t\t\treturn $providers['json'];\n\t\t} elseif ( ! empty( $providers['xml'] ) ) {\n\t\t\treturn $providers['xml'];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Connects to a oEmbed provider and returns the result.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string       $provider The URL to the oEmbed provider.\n\t * @param string       $url      The URL to the content that is desired to be embedded.\n\t * @param array|string $args     Optional. Arguments, usually passed from a shortcode. Default empty.\n\t * @return object|false The result in the form of an object on success, false on failure.\n\t */\n\tpublic function fetch( $provider, $url, $args = '' ) {\n\t\t$args = wp_parse_args( $args, wp_embed_defaults( $url ) );\n\n\t\t$provider = add_query_arg( 'maxwidth', (int) $args['width'], $provider );\n\t\t$provider = add_query_arg( 'maxheight', (int) $args['height'], $provider );\n\t\t$provider = add_query_arg( 'url', urlencode( $url ), $provider );\n\t\t$provider = add_query_arg( 'dnt', 1, $provider );\n\n\t\t/**\n\t\t * Filters the oEmbed URL to be fetched.\n\t\t *\n\t\t * @since 2.9.0\n\t\t * @since 4.9.0 The `dnt` (Do Not Track) query parameter was added to all oEmbed provider URLs.\n\t\t *\n\t\t * @param string $provider URL of the oEmbed provider.\n\t\t * @param string $url      URL of the content to be embedded.\n\t\t * @param array  $args     Optional arguments, usually passed from a shortcode.\n\t\t */\n\t\t$provider = apply_filters( 'oembed_fetch_url', $provider, $url, $args );\n\n\t\tforeach ( array( 'json', 'xml' ) as $format ) {\n\t\t\t$result = $this->_fetch_with_format( $provider, $format );\n\t\t\tif ( is_wp_error( $result ) && 'not-implemented' === $result->get_error_code() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn ( $result && ! is_wp_error( $result ) ) ? $result : false;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Fetches result from an oEmbed provider for a specific format and complete provider URL\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $provider_url_with_args URL to the provider with full arguments list (url, maxheight, etc.)\n\t * @param string $format                 Format to use.\n\t * @return object|false|WP_Error The result in the form of an object on success, false on failure.\n\t */\n\tprivate function _fetch_with_format( $provider_url_with_args, $format ) {\n\t\t$provider_url_with_args = add_query_arg( 'format', $format, $provider_url_with_args );\n\n\t\t/** This filter is documented in wp-includes/class-wp-oembed.php */\n\t\t$args = apply_filters( 'oembed_remote_get_args', array(), $provider_url_with_args );\n\n\t\t$response = wp_safe_remote_get( $provider_url_with_args, $args );\n\t\tif ( 501 == wp_remote_retrieve_response_code( $response ) ) {\n\t\t\treturn new WP_Error( 'not-implemented' );\n\t\t}\n\t\t$body = wp_remote_retrieve_body( $response );\n\t\tif ( ! $body ) {\n\t\t\treturn false;\n\t\t}\n\t\t$parse_method = \"_parse_$format\";\n\t\treturn $this->$parse_method( $body );\n\t}\n\n\t/**\n\t * Parses a json response body.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $response_body\n\t * @return object|false\n\t */\n\tprivate function _parse_json( $response_body ) {\n\t\t$data = json_decode( trim( $response_body ) );\n\t\treturn ( $data && is_object( $data ) ) ? $data : false;\n\t}\n\n\t/**\n\t * Parses an XML response body.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $response_body\n\t * @return object|false\n\t */\n\tprivate function _parse_xml( $response_body ) {\n\t\tif ( ! function_exists( 'libxml_disable_entity_loader' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$loader = libxml_disable_entity_loader( true );\n\t\t$errors = libxml_use_internal_errors( true );\n\n\t\t$return = $this->_parse_xml_body( $response_body );\n\n\t\tlibxml_use_internal_errors( $errors );\n\t\tlibxml_disable_entity_loader( $loader );\n\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Serves as a helper function for parsing an XML response body.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param string $response_body\n\t * @return stdClass|false\n\t */\n\tprivate function _parse_xml_body( $response_body ) {\n\t\tif ( ! function_exists( 'simplexml_import_dom' ) || ! class_exists( 'DOMDocument', false ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$dom     = new DOMDocument;\n\t\t$success = $dom->loadXML( $response_body );\n\t\tif ( ! $success ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( isset( $dom->doctype ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ( $dom->childNodes as $child ) {\n\t\t\tif ( XML_DOCUMENT_TYPE_NODE === $child->nodeType ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$xml = simplexml_import_dom( $dom );\n\t\tif ( ! $xml ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$return = new stdClass;\n\t\tforeach ( $xml as $key => $value ) {\n\t\t\t$return->$key = (string) $value;\n\t\t}\n\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Converts a data object from WP_oEmbed::fetch() and returns the HTML.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param object $data A data object result from an oEmbed provider.\n\t * @param string $url  The URL to the content that is desired to be embedded.\n\t * @return string|false The HTML needed to embed on success, false on failure.\n\t */\n\tpublic function data2html( $data, $url ) {\n\t\tif ( ! is_object( $data ) || empty( $data->type ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$return = false;\n\n\t\tswitch ( $data->type ) {\n\t\t\tcase 'photo':\n\t\t\t\tif ( empty( $data->url ) || empty( $data->width ) || empty( $data->height ) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( ! is_string( $data->url ) || ! is_numeric( $data->width ) || ! is_numeric( $data->height ) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$title  = ! empty( $data->title ) && is_string( $data->title ) ? $data->title : '';\n\t\t\t\t$return = '<a href=\"' . esc_url( $url ) . '\"><img src=\"' . esc_url( $data->url ) . '\" alt=\"' . esc_attr( $title ) . '\" width=\"' . esc_attr( $data->width ) . '\" height=\"' . esc_attr( $data->height ) . '\" /></a>';\n\t\t\t\tbreak;\n\n\t\t\tcase 'video':\n\t\t\tcase 'rich':\n\t\t\t\tif ( ! empty( $data->html ) && is_string( $data->html ) ) {\n\t\t\t\t\t$return = $data->html;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'link':\n\t\t\t\tif ( ! empty( $data->title ) && is_string( $data->title ) ) {\n\t\t\t\t\t$return = '<a href=\"' . esc_url( $url ) . '\">' . esc_html( $data->title ) . '</a>';\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$return = false;\n\t\t}\n\n\t\t/**\n\t\t * Filters the returned oEmbed HTML.\n\t\t *\n\t\t * Use this filter to add support for custom data types, or to filter the result.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param string $return The returned oEmbed HTML.\n\t\t * @param object $data   A data object result from an oEmbed provider.\n\t\t * @param string $url    The URL of the content to be embedded.\n\t\t */\n\t\treturn apply_filters( 'oembed_dataparse', $return, $data, $url );\n\t}\n\n\t/**\n\t * Strips any new lines from the HTML.\n\t *\n\t * @since 2.9.0 as strip_scribd_newlines()\n\t * @since 3.0.0\n\t *\n\t * @param string $html Existing HTML.\n\t * @param object $data Data object from WP_oEmbed::data2html()\n\t * @param string $url The original URL passed to oEmbed.\n\t * @return string Possibly modified $html\n\t */\n\tpublic function _strip_newlines( $html, $data, $url ) {\n\t\tif ( false === strpos( $html, \"\\n\" ) ) {\n\t\t\treturn $html;\n\t\t}\n\n\t\t$count     = 1;\n\t\t$found     = array();\n\t\t$token     = '__PRE__';\n\t\t$search    = array( \"\\t\", \"\\n\", \"\\r\", ' ' );\n\t\t$replace   = array( '__TAB__', '__NL__', '__CR__', '__SPACE__' );\n\t\t$tokenized = str_replace( $search, $replace, $html );\n\n\t\tpreg_match_all( '#(<pre[^>]*>.+?</pre>)#i', $tokenized, $matches, PREG_SET_ORDER );\n\t\tforeach ( $matches as $i => $match ) {\n\t\t\t$tag_html  = str_replace( $replace, $search, $match[0] );\n\t\t\t$tag_token = $token . $i;\n\n\t\t\t$found[ $tag_token ] = $tag_html;\n\t\t\t$html                = str_replace( $tag_html, $tag_token, $html, $count );\n\t\t}\n\n\t\t$replaced = str_replace( $replace, $search, $html );\n\t\t$stripped = str_replace( array( \"\\r\\n\", \"\\n\" ), '', $replaced );\n\t\t$pre      = array_values( $found );\n\t\t$tokens   = array_keys( $found );\n\n\t\treturn str_replace( $tokens, $pre, $stripped );\n\t}\n}\n", "num_lines": 742}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Error Protection API: WP_Paused_Extensions_Storage class\n *\n * @package WordPress\n * @since 5.2.0\n */\n\n/**\n * Core class used for storing paused extensions.\n *\n * @since 5.2.0\n */\nclass WP_Paused_Extensions_Storage {\n\n\t/**\n\t * Type of extension. Used to key extension storage.\n\t *\n\t * @since 5.2.0\n\t * @var string\n\t */\n\tprotected $type;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string $extension_type Extension type. Either 'plugin' or 'theme'.\n\t */\n\tpublic function __construct( $extension_type ) {\n\t\t$this->type = $extension_type;\n\t}\n\n\t/**\n\t * Records an extension error.\n\t *\n\t * Only one error is stored per extension, with subsequent errors for the same extension overriding the\n\t * previously stored error.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string $extension Plugin or theme directory name.\n\t * @param array  $error     {\n\t *     Error that was triggered.\n\t *\n\t *     @type string $type    The error type.\n\t *     @type string $file    The name of the file in which the error occurred.\n\t *     @type string $line    The line number in which the error occurred.\n\t *     @type string $message The error message.\n\t * }\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function set( $extension, $error ) {\n\t\tif ( ! $this->is_api_loaded() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$option_name = $this->get_option_name();\n\n\t\tif ( ! $option_name ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$paused_extensions = (array) get_option( $option_name, array() );\n\n\t\t// Do not update if the error is already stored.\n\t\tif ( isset( $paused_extensions[ $this->type ][ $extension ] ) && $paused_extensions[ $this->type ][ $extension ] === $error ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$paused_extensions[ $this->type ][ $extension ] = $error;\n\n\t\treturn update_option( $option_name, $paused_extensions );\n\t}\n\n\t/**\n\t * Forgets a previously recorded extension error.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string $extension Plugin or theme directory name.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function delete( $extension ) {\n\t\tif ( ! $this->is_api_loaded() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$option_name = $this->get_option_name();\n\n\t\tif ( ! $option_name ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$paused_extensions = (array) get_option( $option_name, array() );\n\n\t\t// Do not delete if no error is stored.\n\t\tif ( ! isset( $paused_extensions[ $this->type ][ $extension ] ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tunset( $paused_extensions[ $this->type ][ $extension ] );\n\n\t\tif ( empty( $paused_extensions[ $this->type ] ) ) {\n\t\t\tunset( $paused_extensions[ $this->type ] );\n\t\t}\n\n\t\t// Clean up the entire option if we're removing the only error.\n\t\tif ( ! $paused_extensions ) {\n\t\t\treturn delete_option( $option_name );\n\t\t}\n\n\t\treturn update_option( $option_name, $paused_extensions );\n\t}\n\n\t/**\n\t * Gets the error for an extension, if paused.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string $extension Plugin or theme directory name.\n\t * @return array|null Error that is stored, or null if the extension is not paused.\n\t */\n\tpublic function get( $extension ) {\n\t\tif ( ! $this->is_api_loaded() ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$paused_extensions = $this->get_all();\n\n\t\tif ( ! isset( $paused_extensions[ $extension ] ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $paused_extensions[ $extension ];\n\t}\n\n\t/**\n\t * Gets the paused extensions with their errors.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array Associative array of extension slugs to the error recorded.\n\t */\n\tpublic function get_all() {\n\t\tif ( ! $this->is_api_loaded() ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$option_name = $this->get_option_name();\n\n\t\tif ( ! $option_name ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$paused_extensions = (array) get_option( $option_name, array() );\n\n\t\treturn isset( $paused_extensions[ $this->type ] ) ? $paused_extensions[ $this->type ] : array();\n\t}\n\n\t/**\n\t * Remove all paused extensions.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return bool\n\t */\n\tpublic function delete_all() {\n\t\tif ( ! $this->is_api_loaded() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$option_name = $this->get_option_name();\n\n\t\tif ( ! $option_name ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$paused_extensions = (array) get_option( $option_name, array() );\n\n\t\tunset( $paused_extensions[ $this->type ] );\n\n\t\tif ( ! $paused_extensions ) {\n\t\t\treturn delete_option( $option_name );\n\t\t}\n\n\t\treturn update_option( $option_name, $paused_extensions );\n\t}\n\n\t/**\n\t * Checks whether the underlying API to store paused extensions is loaded.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return bool True if the API is loaded, false otherwise.\n\t */\n\tprotected function is_api_loaded() {\n\t\treturn function_exists( 'get_option' );\n\t}\n\n\t/**\n\t * Get the option name for storing paused extensions.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return string\n\t */\n\tprotected function get_option_name() {\n\t\tif ( ! wp_recovery_mode()->is_active() ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$session_id = wp_recovery_mode()->get_session_id();\n\t\tif ( empty( $session_id ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn \"{$session_id}_paused_extensions\";\n\t}\n}\n", "num_lines": 222}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Post API: WP_Post_Type class\n *\n * @package WordPress\n * @subpackage Post\n * @since 4.6.0\n */\n\n/**\n * Core class used for interacting with post types.\n *\n * @since 4.6.0\n *\n * @see register_post_type()\n */\nfinal class WP_Post_Type {\n\t/**\n\t * Post type key.\n\t *\n\t * @since 4.6.0\n\t * @var string $name\n\t */\n\tpublic $name;\n\n\t/**\n\t * Name of the post type shown in the menu. Usually plural.\n\t *\n\t * @since 4.6.0\n\t * @var string $label\n\t */\n\tpublic $label;\n\n\t/**\n\t * Labels object for this post type.\n\t *\n\t * If not set, post labels are inherited for non-hierarchical types\n\t * and page labels for hierarchical ones.\n\t *\n\t * @see get_post_type_labels()\n\t *\n\t * @since 4.6.0\n\t * @var object $labels\n\t */\n\tpublic $labels;\n\n\t/**\n\t * A short descriptive summary of what the post type is.\n\t *\n\t * Default empty.\n\t *\n\t * @since 4.6.0\n\t * @var string $description\n\t */\n\tpublic $description = '';\n\n\t/**\n\t * Whether a post type is intended for use publicly either via the admin interface or by front-end users.\n\t *\n\t * While the default settings of $exclude_from_search, $publicly_queryable, $show_ui, and $show_in_nav_menus\n\t * are inherited from public, each does not rely on this relationship and controls a very specific intention.\n\t *\n\t * Default false.\n\t *\n\t * @since 4.6.0\n\t * @var bool $public\n\t */\n\tpublic $public = false;\n\n\t/**\n\t * Whether the post type is hierarchical (e.g. page).\n\t *\n\t * Default false.\n\t *\n\t * @since 4.6.0\n\t * @var bool $hierarchical\n\t */\n\tpublic $hierarchical = false;\n\n\t/**\n\t * Whether to exclude posts with this post type from front end search\n\t * results.\n\t *\n\t * Default is the opposite value of $public.\n\t *\n\t * @since 4.6.0\n\t * @var bool $exclude_from_search\n\t */\n\tpublic $exclude_from_search = null;\n\n\t/**\n\t * Whether queries can be performed on the front end for the post type as part of `parse_request()`.\n\t *\n\t * Endpoints would include:\n\t * - `?post_type={post_type_key}`\n\t * - `?{post_type_key}={single_post_slug}`\n\t * - `?{post_type_query_var}={single_post_slug}`\n\t *\n\t * Default is the value of $public.\n\t *\n\t * @since 4.6.0\n\t * @var bool $publicly_queryable\n\t */\n\tpublic $publicly_queryable = null;\n\n\t/**\n\t * Whether to generate and allow a UI for managing this post type in the admin.\n\t *\n\t * Default is the value of $public.\n\t *\n\t * @since 4.6.0\n\t * @var bool $show_ui\n\t */\n\tpublic $show_ui = null;\n\n\t/**\n\t * Where to show the post type in the admin menu.\n\t *\n\t * To work, $show_ui must be true. If true, the post type is shown in its own top level menu. If false, no menu is\n\t * shown. If a string of an existing top level menu (eg. 'tools.php' or 'edit.php?post_type=page'), the post type\n\t * will be placed as a sub-menu of that.\n\t *\n\t * Default is the value of $show_ui.\n\t *\n\t * @since 4.6.0\n\t * @var bool $show_in_menu\n\t */\n\tpublic $show_in_menu = null;\n\n\t/**\n\t * Makes this post type available for selection in navigation menus.\n\t *\n\t * Default is the value $public.\n\t *\n\t * @since 4.6.0\n\t * @var bool $show_in_nav_menus\n\t */\n\tpublic $show_in_nav_menus = null;\n\n\t/**\n\t * Makes this post type available via the admin bar.\n\t *\n\t * Default is the value of $show_in_menu.\n\t *\n\t * @since 4.6.0\n\t * @var bool $show_in_admin_bar\n\t */\n\tpublic $show_in_admin_bar = null;\n\n\t/**\n\t * The position in the menu order the post type should appear.\n\t *\n\t * To work, $show_in_menu must be true. Default null (at the bottom).\n\t *\n\t * @since 4.6.0\n\t * @var int $menu_position\n\t */\n\tpublic $menu_position = null;\n\n\t/**\n\t * The URL to the icon to be used for this menu.\n\t *\n\t * Pass a base64-encoded SVG using a data URI, which will be colored to match the color scheme.\n\t * This should begin with 'data:image/svg+xml;base64,'. Pass the name of a Dashicons helper class\n\t * to use a font icon, e.g. 'dashicons-chart-pie'. Pass 'none' to leave div.wp-menu-image empty\n\t * so an icon can be added via CSS.\n\t *\n\t * Defaults to use the posts icon.\n\t *\n\t * @since 4.6.0\n\t * @var string $menu_icon\n\t */\n\tpublic $menu_icon = null;\n\n\t/**\n\t * The string to use to build the read, edit, and delete capabilities.\n\t *\n\t * May be passed as an array to allow for alternative plurals when using\n\t * this argument as a base to construct the capabilities, e.g.\n\t * array( 'story', 'stories' ). Default 'post'.\n\t *\n\t * @since 4.6.0\n\t * @var string $capability_type\n\t */\n\tpublic $capability_type = 'post';\n\n\t/**\n\t * Whether to use the internal default meta capability handling.\n\t *\n\t * Default false.\n\t *\n\t * @since 4.6.0\n\t * @var bool $map_meta_cap\n\t */\n\tpublic $map_meta_cap = false;\n\n\t/**\n\t * Provide a callback function that sets up the meta boxes for the edit form.\n\t *\n\t * Do `remove_meta_box()` and `add_meta_box()` calls in the callback. Default null.\n\t *\n\t * @since 4.6.0\n\t * @var callable $register_meta_box_cb\n\t */\n\tpublic $register_meta_box_cb = null;\n\n\t/**\n\t * An array of taxonomy identifiers that will be registered for the post type.\n\t *\n\t * Taxonomies can be registered later with `register_taxonomy()` or `register_taxonomy_for_object_type()`.\n\t *\n\t * Default empty array.\n\t *\n\t * @since 4.6.0\n\t * @var array $taxonomies\n\t */\n\tpublic $taxonomies = array();\n\n\t/**\n\t * Whether there should be post type archives, or if a string, the archive slug to use.\n\t *\n\t * Will generate the proper rewrite rules if $rewrite is enabled. Default false.\n\t *\n\t * @since 4.6.0\n\t * @var bool|string $has_archive\n\t */\n\tpublic $has_archive = false;\n\n\t/**\n\t * Sets the query_var key for this post type.\n\t *\n\t * Defaults to $post_type key. If false, a post type cannot be loaded at `?{query_var}={post_slug}`.\n\t * If specified as a string, the query `?{query_var_string}={post_slug}` will be valid.\n\t *\n\t * @since 4.6.0\n\t * @var string|bool $query_var\n\t */\n\tpublic $query_var;\n\n\t/**\n\t * Whether to allow this post type to be exported.\n\t *\n\t * Default true.\n\t *\n\t * @since 4.6.0\n\t * @var bool $can_export\n\t */\n\tpublic $can_export = true;\n\n\t/**\n\t * Whether to delete posts of this type when deleting a user.\n\t *\n\t * If true, posts of this type belonging to the user will be moved to Trash when then user is deleted.\n\t * If false, posts of this type belonging to the user will *not* be trashed or deleted.\n\t * If not set (the default), posts are trashed if post_type_supports( 'author' ).\n\t * Otherwise posts are not trashed or deleted. Default null.\n\t *\n\t * @since 4.6.0\n\t * @var bool $delete_with_user\n\t */\n\tpublic $delete_with_user = null;\n\n\t/**\n\t * Whether this post type is a native or \"built-in\" post_type.\n\t *\n\t * Default false.\n\t *\n\t * @since 4.6.0\n\t * @var bool $_builtin\n\t */\n\tpublic $_builtin = false;\n\n\t/**\n\t * URL segment to use for edit link of this post type.\n\t *\n\t * Default 'post.php?post=%d'.\n\t *\n\t * @since 4.6.0\n\t * @var string $_edit_link\n\t */\n\tpublic $_edit_link = 'post.php?post=%d';\n\n\t/**\n\t * Post type capabilities.\n\t *\n\t * @since 4.6.0\n\t * @var object $cap\n\t */\n\tpublic $cap;\n\n\t/**\n\t * Triggers the handling of rewrites for this post type.\n\t *\n\t * Defaults to true, using $post_type as slug.\n\t *\n\t * @since 4.6.0\n\t * @var array|false $rewrite\n\t */\n\tpublic $rewrite;\n\n\t/**\n\t * The features supported by the post type.\n\t *\n\t * @since 4.6.0\n\t * @var array|bool $supports\n\t */\n\tpublic $supports;\n\n\t/**\n\t * Whether this post type should appear in the REST API.\n\t *\n\t * Default false. If true, standard endpoints will be registered with\n\t * respect to $rest_base and $rest_controller_class.\n\t *\n\t * @since 4.7.4\n\t * @var bool $show_in_rest\n\t */\n\tpublic $show_in_rest;\n\n\t/**\n\t * The base path for this post type's REST API endpoints.\n\t *\n\t * @since 4.7.4\n\t * @var string|bool $rest_base\n\t */\n\tpublic $rest_base;\n\n\t/**\n\t * The controller for this post type's REST API endpoints.\n\t *\n\t * Custom controllers must extend WP_REST_Controller.\n\t *\n\t * @since 4.7.4\n\t * @var string|bool $rest_controller_class\n\t */\n\tpublic $rest_controller_class;\n\n\t/**\n\t * The controller instance for this post type's REST API endpoints.\n\t *\n\t * Lazily computed. Should be accessed using {@see WP_Post_Type::get_rest_controller()}.\n\t *\n\t * @since 5.3.0\n\t * @var WP_REST_Controller $rest_controller\n\t */\n\tpublic $rest_controller;\n\n\t/**\n\t * Constructor.\n\t *\n\t * Will populate object properties from the provided arguments and assign other\n\t * default properties based on that information.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @see register_post_type()\n\t *\n\t * @param string       $post_type Post type key.\n\t * @param array|string $args      Optional. Array or string of arguments for registering a post type.\n\t *                                Default empty array.\n\t */\n\tpublic function __construct( $post_type, $args = array() ) {\n\t\t$this->name = $post_type;\n\n\t\t$this->set_props( $args );\n\t}\n\n\t/**\n\t * Sets post type properties.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param array|string $args Array or string of arguments for registering a post type.\n\t */\n\tpublic function set_props( $args ) {\n\t\t$args = wp_parse_args( $args );\n\n\t\t/**\n\t\t * Filters the arguments for registering a post type.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param array  $args      Array of arguments for registering a post type.\n\t\t * @param string $post_type Post type key.\n\t\t */\n\t\t$args = apply_filters( 'register_post_type_args', $args, $this->name );\n\n\t\t$has_edit_link = ! empty( $args['_edit_link'] );\n\n\t\t// Args prefixed with an underscore are reserved for internal use.\n\t\t$defaults = array(\n\t\t\t'labels'                => array(),\n\t\t\t'description'           => '',\n\t\t\t'public'                => false,\n\t\t\t'hierarchical'          => false,\n\t\t\t'exclude_from_search'   => null,\n\t\t\t'publicly_queryable'    => null,\n\t\t\t'show_ui'               => null,\n\t\t\t'show_in_menu'          => null,\n\t\t\t'show_in_nav_menus'     => null,\n\t\t\t'show_in_admin_bar'     => null,\n\t\t\t'menu_position'         => null,\n\t\t\t'menu_icon'             => null,\n\t\t\t'capability_type'       => 'post',\n\t\t\t'capabilities'          => array(),\n\t\t\t'map_meta_cap'          => null,\n\t\t\t'supports'              => array(),\n\t\t\t'register_meta_box_cb'  => null,\n\t\t\t'taxonomies'            => array(),\n\t\t\t'has_archive'           => false,\n\t\t\t'rewrite'               => true,\n\t\t\t'query_var'             => true,\n\t\t\t'can_export'            => true,\n\t\t\t'delete_with_user'      => null,\n\t\t\t'show_in_rest'          => false,\n\t\t\t'rest_base'             => false,\n\t\t\t'rest_controller_class' => false,\n\t\t\t'_builtin'              => false,\n\t\t\t'_edit_link'            => 'post.php?post=%d',\n\t\t);\n\n\t\t$args = array_merge( $defaults, $args );\n\n\t\t$args['name'] = $this->name;\n\n\t\t// If not set, default to the setting for 'public'.\n\t\tif ( null === $args['publicly_queryable'] ) {\n\t\t\t$args['publicly_queryable'] = $args['public'];\n\t\t}\n\n\t\t// If not set, default to the setting for 'public'.\n\t\tif ( null === $args['show_ui'] ) {\n\t\t\t$args['show_ui'] = $args['public'];\n\t\t}\n\n\t\t// If not set, default to the setting for 'show_ui'.\n\t\tif ( null === $args['show_in_menu'] || ! $args['show_ui'] ) {\n\t\t\t$args['show_in_menu'] = $args['show_ui'];\n\t\t}\n\n\t\t// If not set, default to the setting for 'show_in_menu'.\n\t\tif ( null === $args['show_in_admin_bar'] ) {\n\t\t\t$args['show_in_admin_bar'] = (bool) $args['show_in_menu'];\n\t\t}\n\n\t\t// If not set, default to the setting for 'public'.\n\t\tif ( null === $args['show_in_nav_menus'] ) {\n\t\t\t$args['show_in_nav_menus'] = $args['public'];\n\t\t}\n\n\t\t// If not set, default to true if not public, false if public.\n\t\tif ( null === $args['exclude_from_search'] ) {\n\t\t\t$args['exclude_from_search'] = ! $args['public'];\n\t\t}\n\n\t\t// Back compat with quirky handling in version 3.0. #14122.\n\t\tif ( empty( $args['capabilities'] )\n\t\t\t&& null === $args['map_meta_cap'] && in_array( $args['capability_type'], array( 'post', 'page' ), true )\n\t\t) {\n\t\t\t$args['map_meta_cap'] = true;\n\t\t}\n\n\t\t// If not set, default to false.\n\t\tif ( null === $args['map_meta_cap'] ) {\n\t\t\t$args['map_meta_cap'] = false;\n\t\t}\n\n\t\t// If there's no specified edit link and no UI, remove the edit link.\n\t\tif ( ! $args['show_ui'] && ! $has_edit_link ) {\n\t\t\t$args['_edit_link'] = '';\n\t\t}\n\n\t\t$this->cap = get_post_type_capabilities( (object) $args );\n\t\tunset( $args['capabilities'] );\n\n\t\tif ( is_array( $args['capability_type'] ) ) {\n\t\t\t$args['capability_type'] = $args['capability_type'][0];\n\t\t}\n\n\t\tif ( false !== $args['query_var'] ) {\n\t\t\tif ( true === $args['query_var'] ) {\n\t\t\t\t$args['query_var'] = $this->name;\n\t\t\t} else {\n\t\t\t\t$args['query_var'] = sanitize_title_with_dashes( $args['query_var'] );\n\t\t\t}\n\t\t}\n\n\t\tif ( false !== $args['rewrite'] && ( is_admin() || get_option( 'permalink_structure' ) ) ) {\n\t\t\tif ( ! is_array( $args['rewrite'] ) ) {\n\t\t\t\t$args['rewrite'] = array();\n\t\t\t}\n\t\t\tif ( empty( $args['rewrite']['slug'] ) ) {\n\t\t\t\t$args['rewrite']['slug'] = $this->name;\n\t\t\t}\n\t\t\tif ( ! isset( $args['rewrite']['with_front'] ) ) {\n\t\t\t\t$args['rewrite']['with_front'] = true;\n\t\t\t}\n\t\t\tif ( ! isset( $args['rewrite']['pages'] ) ) {\n\t\t\t\t$args['rewrite']['pages'] = true;\n\t\t\t}\n\t\t\tif ( ! isset( $args['rewrite']['feeds'] ) || ! $args['has_archive'] ) {\n\t\t\t\t$args['rewrite']['feeds'] = (bool) $args['has_archive'];\n\t\t\t}\n\t\t\tif ( ! isset( $args['rewrite']['ep_mask'] ) ) {\n\t\t\t\tif ( isset( $args['permalink_epmask'] ) ) {\n\t\t\t\t\t$args['rewrite']['ep_mask'] = $args['permalink_epmask'];\n\t\t\t\t} else {\n\t\t\t\t\t$args['rewrite']['ep_mask'] = EP_PERMALINK;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $args as $property_name => $property_value ) {\n\t\t\t$this->$property_name = $property_value;\n\t\t}\n\n\t\t$this->labels = get_post_type_labels( $this );\n\t\t$this->label  = $this->labels->name;\n\t}\n\n\t/**\n\t * Sets the features support for the post type.\n\t *\n\t * @since 4.6.0\n\t */\n\tpublic function add_supports() {\n\t\tif ( ! empty( $this->supports ) ) {\n\t\t\tforeach ( $this->supports as $feature => $args ) {\n\t\t\t\tif ( is_array( $args ) ) {\n\t\t\t\t\tadd_post_type_support( $this->name, $feature, $args );\n\t\t\t\t} else {\n\t\t\t\t\tadd_post_type_support( $this->name, $args );\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset( $this->supports );\n\t\t} elseif ( false !== $this->supports ) {\n\t\t\t// Add default features.\n\t\t\tadd_post_type_support( $this->name, array( 'title', 'editor' ) );\n\t\t}\n\t}\n\n\t/**\n\t * Adds the necessary rewrite rules for the post type.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n\t * @global WP         $wp         Current WordPress environment instance.\n\t */\n\tpublic function add_rewrite_rules() {\n\t\tglobal $wp_rewrite, $wp;\n\n\t\tif ( false !== $this->query_var && $wp && is_post_type_viewable( $this ) ) {\n\t\t\t$wp->add_query_var( $this->query_var );\n\t\t}\n\n\t\tif ( false !== $this->rewrite && ( is_admin() || get_option( 'permalink_structure' ) ) ) {\n\t\t\tif ( $this->hierarchical ) {\n\t\t\t\tadd_rewrite_tag( \"%$this->name%\", '(.+?)', $this->query_var ? \"{$this->query_var}=\" : \"post_type=$this->name&pagename=\" );\n\t\t\t} else {\n\t\t\t\tadd_rewrite_tag( \"%$this->name%\", '([^/]+)', $this->query_var ? \"{$this->query_var}=\" : \"post_type=$this->name&name=\" );\n\t\t\t}\n\n\t\t\tif ( $this->has_archive ) {\n\t\t\t\t$archive_slug = true === $this->has_archive ? $this->rewrite['slug'] : $this->has_archive;\n\t\t\t\tif ( $this->rewrite['with_front'] ) {\n\t\t\t\t\t$archive_slug = substr( $wp_rewrite->front, 1 ) . $archive_slug;\n\t\t\t\t} else {\n\t\t\t\t\t$archive_slug = $wp_rewrite->root . $archive_slug;\n\t\t\t\t}\n\n\t\t\t\tadd_rewrite_rule( \"{$archive_slug}/?$\", \"index.php?post_type=$this->name\", 'top' );\n\t\t\t\tif ( $this->rewrite['feeds'] && $wp_rewrite->feeds ) {\n\t\t\t\t\t$feeds = '(' . trim( implode( '|', $wp_rewrite->feeds ) ) . ')';\n\t\t\t\t\tadd_rewrite_rule( \"{$archive_slug}/feed/$feeds/?$\", \"index.php?post_type=$this->name\" . '&feed=$matches[1]', 'top' );\n\t\t\t\t\tadd_rewrite_rule( \"{$archive_slug}/$feeds/?$\", \"index.php?post_type=$this->name\" . '&feed=$matches[1]', 'top' );\n\t\t\t\t}\n\t\t\t\tif ( $this->rewrite['pages'] ) {\n\t\t\t\t\tadd_rewrite_rule( \"{$archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$\", \"index.php?post_type=$this->name\" . '&paged=$matches[1]', 'top' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$permastruct_args         = $this->rewrite;\n\t\t\t$permastruct_args['feed'] = $permastruct_args['feeds'];\n\t\t\tadd_permastruct( $this->name, \"{$this->rewrite['slug']}/%$this->name%\", $permastruct_args );\n\t\t}\n\t}\n\n\t/**\n\t * Registers the post type meta box if a custom callback was specified.\n\t *\n\t * @since 4.6.0\n\t */\n\tpublic function register_meta_boxes() {\n\t\tif ( $this->register_meta_box_cb ) {\n\t\t\tadd_action( 'add_meta_boxes_' . $this->name, $this->register_meta_box_cb, 10, 1 );\n\t\t}\n\t}\n\n\t/**\n\t * Adds the future post hook action for the post type.\n\t *\n\t * @since 4.6.0\n\t */\n\tpublic function add_hooks() {\n\t\tadd_action( 'future_' . $this->name, '_future_post_hook', 5, 2 );\n\t}\n\n\t/**\n\t * Registers the taxonomies for the post type.\n\t *\n\t * @since 4.6.0\n\t */\n\tpublic function register_taxonomies() {\n\t\tforeach ( $this->taxonomies as $taxonomy ) {\n\t\t\tregister_taxonomy_for_object_type( $taxonomy, $this->name );\n\t\t}\n\t}\n\n\t/**\n\t * Removes the features support for the post type.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global array $_wp_post_type_features Post type features.\n\t */\n\tpublic function remove_supports() {\n\t\tglobal $_wp_post_type_features;\n\n\t\tunset( $_wp_post_type_features[ $this->name ] );\n\t}\n\n\t/**\n\t * Removes any rewrite rules, permastructs, and rules for the post type.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global WP_Rewrite $wp_rewrite          WordPress rewrite component.\n\t * @global WP         $wp                  Current WordPress environment instance.\n\t * @global array      $post_type_meta_caps Used to remove meta capabilities.\n\t */\n\tpublic function remove_rewrite_rules() {\n\t\tglobal $wp, $wp_rewrite, $post_type_meta_caps;\n\n\t\t// Remove query var.\n\t\tif ( false !== $this->query_var ) {\n\t\t\t$wp->remove_query_var( $this->query_var );\n\t\t}\n\n\t\t// Remove any rewrite rules, permastructs, and rules.\n\t\tif ( false !== $this->rewrite ) {\n\t\t\tremove_rewrite_tag( \"%$this->name%\" );\n\t\t\tremove_permastruct( $this->name );\n\t\t\tforeach ( $wp_rewrite->extra_rules_top as $regex => $query ) {\n\t\t\t\tif ( false !== strpos( $query, \"index.php?post_type=$this->name\" ) ) {\n\t\t\t\t\tunset( $wp_rewrite->extra_rules_top[ $regex ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove registered custom meta capabilities.\n\t\tforeach ( $this->cap as $cap ) {\n\t\t\tunset( $post_type_meta_caps[ $cap ] );\n\t\t}\n\t}\n\n\t/**\n\t * Unregisters the post type meta box if a custom callback was specified.\n\t *\n\t * @since 4.6.0\n\t */\n\tpublic function unregister_meta_boxes() {\n\t\tif ( $this->register_meta_box_cb ) {\n\t\t\tremove_action( 'add_meta_boxes_' . $this->name, $this->register_meta_box_cb, 10 );\n\t\t}\n\t}\n\n\t/**\n\t * Removes the post type from all taxonomies.\n\t *\n\t * @since 4.6.0\n\t */\n\tpublic function unregister_taxonomies() {\n\t\tforeach ( get_object_taxonomies( $this->name ) as $taxonomy ) {\n\t\t\tunregister_taxonomy_for_object_type( $taxonomy, $this->name );\n\t\t}\n\t}\n\n\t/**\n\t * Removes the future post hook action for the post type.\n\t *\n\t * @since 4.6.0\n\t */\n\tpublic function remove_hooks() {\n\t\tremove_action( 'future_' . $this->name, '_future_post_hook', 5 );\n\t}\n\n\t/**\n\t * Gets the REST API controller for this post type.\n\t *\n\t * Will only instantiate the controller class once per request.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @return WP_REST_Controller|null The controller instance, or null if the post type\n\t *                                 is set not to show in rest.\n\t */\n\tpublic function get_rest_controller() {\n\t\tif ( ! $this->show_in_rest ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$class = $this->rest_controller_class ? $this->rest_controller_class : WP_REST_Posts_Controller::class;\n\n\t\tif ( ! class_exists( $class ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( ! is_subclass_of( $class, WP_REST_Controller::class ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( ! $this->rest_controller ) {\n\t\t\t$this->rest_controller = new $class( $this->name );\n\t\t}\n\n\t\tif ( ! ( $this->rest_controller instanceof $class ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->rest_controller;\n\t}\n}\n", "num_lines": 734}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Post API: WP_Post class\n *\n * @package WordPress\n * @subpackage Post\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement the WP_Post object.\n *\n * @since 3.5.0\n *\n * @property string $page_template\n *\n * @property-read array  $ancestors\n * @property-read int    $post_category\n * @property-read string $tag_input\n */\nfinal class WP_Post {\n\n\t/**\n\t * Post ID.\n\t *\n\t * @since 3.5.0\n\t * @var int\n\t */\n\tpublic $ID;\n\n\t/**\n\t * ID of post author.\n\t *\n\t * A numeric string, for compatibility reasons.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $post_author = 0;\n\n\t/**\n\t * The post's local publication time.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $post_date = '0000-00-00 00:00:00';\n\n\t/**\n\t * The post's GMT publication time.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $post_date_gmt = '0000-00-00 00:00:00';\n\n\t/**\n\t * The post's content.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $post_content = '';\n\n\t/**\n\t * The post's title.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $post_title = '';\n\n\t/**\n\t * The post's excerpt.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $post_excerpt = '';\n\n\t/**\n\t * The post's status.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $post_status = 'publish';\n\n\t/**\n\t * Whether comments are allowed.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $comment_status = 'open';\n\n\t/**\n\t * Whether pings are allowed.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $ping_status = 'open';\n\n\t/**\n\t * The post's password in plain text.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $post_password = '';\n\n\t/**\n\t * The post's slug.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $post_name = '';\n\n\t/**\n\t * URLs queued to be pinged.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $to_ping = '';\n\n\t/**\n\t * URLs that have been pinged.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $pinged = '';\n\n\t/**\n\t * The post's local modified time.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $post_modified = '0000-00-00 00:00:00';\n\n\t/**\n\t * The post's GMT modified time.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $post_modified_gmt = '0000-00-00 00:00:00';\n\n\t/**\n\t * A utility DB field for post content.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $post_content_filtered = '';\n\n\t/**\n\t * ID of a post's parent post.\n\t *\n\t * @since 3.5.0\n\t * @var int\n\t */\n\tpublic $post_parent = 0;\n\n\t/**\n\t * The unique identifier for a post, not necessarily a URL, used as the feed GUID.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $guid = '';\n\n\t/**\n\t * A field used for ordering posts.\n\t *\n\t * @since 3.5.0\n\t * @var int\n\t */\n\tpublic $menu_order = 0;\n\n\t/**\n\t * The post's type, like post or page.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $post_type = 'post';\n\n\t/**\n\t * An attachment's mime type.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $post_mime_type = '';\n\n\t/**\n\t * Cached comment count.\n\t *\n\t * A numeric string, for compatibility reasons.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $comment_count = 0;\n\n\t/**\n\t * Stores the post object's sanitization level.\n\t *\n\t * Does not correspond to a DB field.\n\t *\n\t * @since 3.5.0\n\t * @var string\n\t */\n\tpublic $filter;\n\n\t/**\n\t * Retrieve WP_Post instance.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param int $post_id Post ID.\n\t * @return WP_Post|false Post object, false otherwise.\n\t */\n\tpublic static function get_instance( $post_id ) {\n\t\tglobal $wpdb;\n\n\t\t$post_id = (int) $post_id;\n\t\tif ( ! $post_id ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$_post = wp_cache_get( $post_id, 'posts' );\n\n\t\tif ( ! $_post ) {\n\t\t\t$_post = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $wpdb->posts WHERE ID = %d LIMIT 1\", $post_id ) );\n\n\t\t\tif ( ! $_post ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$_post = sanitize_post( $_post, 'raw' );\n\t\t\twp_cache_add( $_post->ID, $_post, 'posts' );\n\t\t} elseif ( empty( $_post->filter ) ) {\n\t\t\t$_post = sanitize_post( $_post, 'raw' );\n\t\t}\n\n\t\treturn new WP_Post( $_post );\n\t}\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param WP_Post|object $post Post object.\n\t */\n\tpublic function __construct( $post ) {\n\t\tforeach ( get_object_vars( $post ) as $key => $value ) {\n\t\t\t$this->$key = $value;\n\t\t}\n\t}\n\n\t/**\n\t * Isset-er.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $key Property to check if set.\n\t * @return bool\n\t */\n\tpublic function __isset( $key ) {\n\t\tif ( 'ancestors' === $key ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( 'page_template' === $key ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( 'post_category' === $key ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( 'tags_input' === $key ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn metadata_exists( 'post', $this->ID, $key );\n\t}\n\n\t/**\n\t * Getter.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $key Key to get.\n\t * @return mixed\n\t */\n\tpublic function __get( $key ) {\n\t\tif ( 'page_template' === $key && $this->__isset( $key ) ) {\n\t\t\treturn get_post_meta( $this->ID, '_wp_page_template', true );\n\t\t}\n\n\t\tif ( 'post_category' === $key ) {\n\t\t\tif ( is_object_in_taxonomy( $this->post_type, 'category' ) ) {\n\t\t\t\t$terms = get_the_terms( $this, 'category' );\n\t\t\t}\n\n\t\t\tif ( empty( $terms ) ) {\n\t\t\t\treturn array();\n\t\t\t}\n\n\t\t\treturn wp_list_pluck( $terms, 'term_id' );\n\t\t}\n\n\t\tif ( 'tags_input' === $key ) {\n\t\t\tif ( is_object_in_taxonomy( $this->post_type, 'post_tag' ) ) {\n\t\t\t\t$terms = get_the_terms( $this, 'post_tag' );\n\t\t\t}\n\n\t\t\tif ( empty( $terms ) ) {\n\t\t\t\treturn array();\n\t\t\t}\n\n\t\t\treturn wp_list_pluck( $terms, 'name' );\n\t\t}\n\n\t\t// Rest of the values need filtering.\n\t\tif ( 'ancestors' === $key ) {\n\t\t\t$value = get_post_ancestors( $this );\n\t\t} else {\n\t\t\t$value = get_post_meta( $this->ID, $key, true );\n\t\t}\n\n\t\tif ( $this->filter ) {\n\t\t\t$value = sanitize_post_field( $key, $value, $this->ID, $this->filter );\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * {@Missing Summary}\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $filter Filter.\n\t * @return array|bool|object|WP_Post\n\t */\n\tpublic function filter( $filter ) {\n\t\tif ( $this->filter === $filter ) {\n\t\t\treturn $this;\n\t\t}\n\n\t\tif ( 'raw' === $filter ) {\n\t\t\treturn self::get_instance( $this->ID );\n\t\t}\n\n\t\treturn sanitize_post( $this, $filter );\n\t}\n\n\t/**\n\t * Convert object to array.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @return array Object as array.\n\t */\n\tpublic function to_array() {\n\t\t$post = get_object_vars( $this );\n\n\t\tforeach ( array( 'ancestors', 'page_template', 'post_category', 'tags_input' ) as $key ) {\n\t\t\tif ( $this->__isset( $key ) ) {\n\t\t\t\t$post[ $key ] = $this->__get( $key );\n\t\t\t}\n\t\t}\n\n\t\treturn $post;\n\t}\n}\n", "num_lines": 388}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Query API: WP_Query class\n *\n * @package WordPress\n * @subpackage Query\n * @since 4.7.0\n */\n\n/**\n * The WordPress Query class.\n *\n * @link https://developer.wordpress.org/reference/classes/wp_query/\n *\n * @since 1.5.0\n * @since 4.5.0 Removed the `$comments_popup` property.\n */\nclass WP_Query {\n\n\t/**\n\t * Query vars set by the user\n\t *\n\t * @since 1.5.0\n\t * @var array\n\t */\n\tpublic $query;\n\n\t/**\n\t * Query vars, after parsing\n\t *\n\t * @since 1.5.0\n\t * @var array\n\t */\n\tpublic $query_vars = array();\n\n\t/**\n\t * Taxonomy query, as passed to get_tax_sql()\n\t *\n\t * @since 3.1.0\n\t * @var WP_Tax_Query A taxonomy query instance.\n\t */\n\tpublic $tax_query;\n\n\t/**\n\t * Metadata query container\n\t *\n\t * @since 3.2.0\n\t * @var WP_Meta_Query A meta query instance.\n\t */\n\tpublic $meta_query = false;\n\n\t/**\n\t * Date query container\n\t *\n\t * @since 3.7.0\n\t * @var WP_Date_Query A date query instance.\n\t */\n\tpublic $date_query = false;\n\n\t/**\n\t * Holds the data for a single object that is queried.\n\t *\n\t * Holds the contents of a post, page, category, attachment.\n\t *\n\t * @since 1.5.0\n\t * @var object|array\n\t */\n\tpublic $queried_object;\n\n\t/**\n\t * The ID of the queried object.\n\t *\n\t * @since 1.5.0\n\t * @var int\n\t */\n\tpublic $queried_object_id;\n\n\t/**\n\t * Get post database query.\n\t *\n\t * @since 2.0.1\n\t * @var string\n\t */\n\tpublic $request;\n\n\t/**\n\t * List of posts.\n\t *\n\t * @since 1.5.0\n\t * @var array\n\t */\n\tpublic $posts;\n\n\t/**\n\t * The amount of posts for the current query.\n\t *\n\t * @since 1.5.0\n\t * @var int\n\t */\n\tpublic $post_count = 0;\n\n\t/**\n\t * Index of the current item in the loop.\n\t *\n\t * @since 1.5.0\n\t * @var int\n\t */\n\tpublic $current_post = -1;\n\n\t/**\n\t * Whether the loop has started and the caller is in the loop.\n\t *\n\t * @since 2.0.0\n\t * @var bool\n\t */\n\tpublic $in_the_loop = false;\n\n\t/**\n\t * The current post.\n\t *\n\t * @since 1.5.0\n\t * @var WP_Post\n\t */\n\tpublic $post;\n\n\t/**\n\t * The list of comments for current post.\n\t *\n\t * @since 2.2.0\n\t * @var array\n\t */\n\tpublic $comments;\n\n\t/**\n\t * The amount of comments for the posts.\n\t *\n\t * @since 2.2.0\n\t * @var int\n\t */\n\tpublic $comment_count = 0;\n\n\t/**\n\t * The index of the comment in the comment loop.\n\t *\n\t * @since 2.2.0\n\t * @var int\n\t */\n\tpublic $current_comment = -1;\n\n\t/**\n\t * Current comment ID.\n\t *\n\t * @since 2.2.0\n\t * @var int\n\t */\n\tpublic $comment;\n\n\t/**\n\t * The amount of found posts for the current query.\n\t *\n\t * If limit clause was not used, equals $post_count.\n\t *\n\t * @since 2.1.0\n\t * @var int\n\t */\n\tpublic $found_posts = 0;\n\n\t/**\n\t * The amount of pages.\n\t *\n\t * @since 2.1.0\n\t * @var int\n\t */\n\tpublic $max_num_pages = 0;\n\n\t/**\n\t * The amount of comment pages.\n\t *\n\t * @since 2.7.0\n\t * @var int\n\t */\n\tpublic $max_num_comment_pages = 0;\n\n\t/**\n\t * Signifies whether the current query is for a single post.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_single = false;\n\n\t/**\n\t * Signifies whether the current query is for a preview.\n\t *\n\t * @since 2.0.0\n\t * @var bool\n\t */\n\tpublic $is_preview = false;\n\n\t/**\n\t * Signifies whether the current query is for a page.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_page = false;\n\n\t/**\n\t * Signifies whether the current query is for an archive.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_archive = false;\n\n\t/**\n\t * Signifies whether the current query is for a date archive.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_date = false;\n\n\t/**\n\t * Signifies whether the current query is for a year archive.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_year = false;\n\n\t/**\n\t * Signifies whether the current query is for a month archive.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_month = false;\n\n\t/**\n\t * Signifies whether the current query is for a day archive.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_day = false;\n\n\t/**\n\t * Signifies whether the current query is for a specific time.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_time = false;\n\n\t/**\n\t * Signifies whether the current query is for an author archive.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_author = false;\n\n\t/**\n\t * Signifies whether the current query is for a category archive.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_category = false;\n\n\t/**\n\t * Signifies whether the current query is for a tag archive.\n\t *\n\t * @since 2.3.0\n\t * @var bool\n\t */\n\tpublic $is_tag = false;\n\n\t/**\n\t * Signifies whether the current query is for a taxonomy archive.\n\t *\n\t * @since 2.5.0\n\t * @var bool\n\t */\n\tpublic $is_tax = false;\n\n\t/**\n\t * Signifies whether the current query is for a search.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_search = false;\n\n\t/**\n\t * Signifies whether the current query is for a feed.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_feed = false;\n\n\t/**\n\t * Signifies whether the current query is for a comment feed.\n\t *\n\t * @since 2.2.0\n\t * @var bool\n\t */\n\tpublic $is_comment_feed = false;\n\n\t/**\n\t * Signifies whether the current query is for trackback endpoint call.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_trackback = false;\n\n\t/**\n\t * Signifies whether the current query is for the site homepage.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_home = false;\n\n\t/**\n\t * Signifies whether the current query is for the Privacy Policy page.\n\t *\n\t * @since 5.2.0\n\t * @var bool\n\t */\n\tpublic $is_privacy_policy = false;\n\n\t/**\n\t * Signifies whether the current query couldn't find anything.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_404 = false;\n\n\t/**\n\t * Signifies whether the current query is for an embed.\n\t *\n\t * @since 4.4.0\n\t * @var bool\n\t */\n\tpublic $is_embed = false;\n\n\t/**\n\t * Signifies whether the current query is for a paged result and not for the first page.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_paged = false;\n\n\t/**\n\t * Signifies whether the current query is for an administrative interface page.\n\t *\n\t * @since 1.5.0\n\t * @var bool\n\t */\n\tpublic $is_admin = false;\n\n\t/**\n\t * Signifies whether the current query is for an attachment page.\n\t *\n\t * @since 2.0.0\n\t * @var bool\n\t */\n\tpublic $is_attachment = false;\n\n\t/**\n\t * Signifies whether the current query is for an existing single post of any post type\n\t * (post, attachment, page, custom post types).\n\t *\n\t * @since 2.1.0\n\t * @var bool\n\t */\n\tpublic $is_singular = false;\n\n\t/**\n\t * Signifies whether the current query is for the robots.txt file.\n\t *\n\t * @since 2.1.0\n\t * @var bool\n\t */\n\tpublic $is_robots = false;\n\n\t/**\n\t * Signifies whether the current query is for the favicon.ico file.\n\t *\n\t * @since 5.4.0\n\t * @var bool\n\t */\n\tpublic $is_favicon = false;\n\n\t/**\n\t * Signifies whether the current query is for the page_for_posts page.\n\t *\n\t * Basically, the homepage if the option isn't set for the static homepage.\n\t *\n\t * @since 2.1.0\n\t * @var bool\n\t */\n\tpublic $is_posts_page = false;\n\n\t/**\n\t * Signifies whether the current query is for a post type archive.\n\t *\n\t * @since 3.1.0\n\t * @var bool\n\t */\n\tpublic $is_post_type_archive = false;\n\n\t/**\n\t * Stores the ->query_vars state like md5(serialize( $this->query_vars ) ) so we know\n\t * whether we have to re-parse because something has changed\n\t *\n\t * @since 3.1.0\n\t * @var bool|string\n\t */\n\tprivate $query_vars_hash = false;\n\n\t/**\n\t * Whether query vars have changed since the initial parse_query() call. Used to catch modifications to query vars made\n\t * via pre_get_posts hooks.\n\t *\n\t * @since 3.1.1\n\t */\n\tprivate $query_vars_changed = true;\n\n\t/**\n\t * Set if post thumbnails are cached\n\t *\n\t * @since 3.2.0\n\t * @var bool\n\t */\n\tpublic $thumbnails_cached = false;\n\n\t/**\n\t * Cached list of search stopwords.\n\t *\n\t * @since 3.7.0\n\t * @var array\n\t */\n\tprivate $stopwords;\n\n\tprivate $compat_fields = array( 'query_vars_hash', 'query_vars_changed' );\n\n\tprivate $compat_methods = array( 'init_query_flags', 'parse_tax_query' );\n\n\t/**\n\t * Resets query flags to false.\n\t *\n\t * The query flags are what page info WordPress was able to figure out.\n\t *\n\t * @since 2.0.0\n\t */\n\tprivate function init_query_flags() {\n\t\t$this->is_single            = false;\n\t\t$this->is_preview           = false;\n\t\t$this->is_page              = false;\n\t\t$this->is_archive           = false;\n\t\t$this->is_date              = false;\n\t\t$this->is_year              = false;\n\t\t$this->is_month             = false;\n\t\t$this->is_day               = false;\n\t\t$this->is_time              = false;\n\t\t$this->is_author            = false;\n\t\t$this->is_category          = false;\n\t\t$this->is_tag               = false;\n\t\t$this->is_tax               = false;\n\t\t$this->is_search            = false;\n\t\t$this->is_feed              = false;\n\t\t$this->is_comment_feed      = false;\n\t\t$this->is_trackback         = false;\n\t\t$this->is_home              = false;\n\t\t$this->is_privacy_policy    = false;\n\t\t$this->is_404               = false;\n\t\t$this->is_paged             = false;\n\t\t$this->is_admin             = false;\n\t\t$this->is_attachment        = false;\n\t\t$this->is_singular          = false;\n\t\t$this->is_robots            = false;\n\t\t$this->is_favicon           = false;\n\t\t$this->is_posts_page        = false;\n\t\t$this->is_post_type_archive = false;\n\t}\n\n\t/**\n\t * Initiates object properties and sets default values.\n\t *\n\t * @since 1.5.0\n\t */\n\tpublic function init() {\n\t\tunset( $this->posts );\n\t\tunset( $this->query );\n\t\t$this->query_vars = array();\n\t\tunset( $this->queried_object );\n\t\tunset( $this->queried_object_id );\n\t\t$this->post_count   = 0;\n\t\t$this->current_post = -1;\n\t\t$this->in_the_loop  = false;\n\t\tunset( $this->request );\n\t\tunset( $this->post );\n\t\tunset( $this->comments );\n\t\tunset( $this->comment );\n\t\t$this->comment_count         = 0;\n\t\t$this->current_comment       = -1;\n\t\t$this->found_posts           = 0;\n\t\t$this->max_num_pages         = 0;\n\t\t$this->max_num_comment_pages = 0;\n\n\t\t$this->init_query_flags();\n\t}\n\n\t/**\n\t * Reparse the query vars.\n\t *\n\t * @since 1.5.0\n\t */\n\tpublic function parse_query_vars() {\n\t\t$this->parse_query();\n\t}\n\n\t/**\n\t * Fills in the query variables, which do not exist within the parameter.\n\t *\n\t * @since 2.1.0\n\t * @since 4.5.0 Removed the `comments_popup` public query variable.\n\t *\n\t * @param array $array Defined query variables.\n\t * @return array Complete query variables with undefined ones filled in empty.\n\t */\n\tpublic function fill_query_vars( $array ) {\n\t\t$keys = array(\n\t\t\t'error',\n\t\t\t'm',\n\t\t\t'p',\n\t\t\t'post_parent',\n\t\t\t'subpost',\n\t\t\t'subpost_id',\n\t\t\t'attachment',\n\t\t\t'attachment_id',\n\t\t\t'name',\n\t\t\t'pagename',\n\t\t\t'page_id',\n\t\t\t'second',\n\t\t\t'minute',\n\t\t\t'hour',\n\t\t\t'day',\n\t\t\t'monthnum',\n\t\t\t'year',\n\t\t\t'w',\n\t\t\t'category_name',\n\t\t\t'tag',\n\t\t\t'cat',\n\t\t\t'tag_id',\n\t\t\t'author',\n\t\t\t'author_name',\n\t\t\t'feed',\n\t\t\t'tb',\n\t\t\t'paged',\n\t\t\t'meta_key',\n\t\t\t'meta_value',\n\t\t\t'preview',\n\t\t\t's',\n\t\t\t'sentence',\n\t\t\t'title',\n\t\t\t'fields',\n\t\t\t'menu_order',\n\t\t\t'embed',\n\t\t);\n\n\t\tforeach ( $keys as $key ) {\n\t\t\tif ( ! isset( $array[ $key ] ) ) {\n\t\t\t\t$array[ $key ] = '';\n\t\t\t}\n\t\t}\n\n\t\t$array_keys = array(\n\t\t\t'category__in',\n\t\t\t'category__not_in',\n\t\t\t'category__and',\n\t\t\t'post__in',\n\t\t\t'post__not_in',\n\t\t\t'post_name__in',\n\t\t\t'tag__in',\n\t\t\t'tag__not_in',\n\t\t\t'tag__and',\n\t\t\t'tag_slug__in',\n\t\t\t'tag_slug__and',\n\t\t\t'post_parent__in',\n\t\t\t'post_parent__not_in',\n\t\t\t'author__in',\n\t\t\t'author__not_in',\n\t\t);\n\n\t\tforeach ( $array_keys as $key ) {\n\t\t\tif ( ! isset( $array[ $key ] ) ) {\n\t\t\t\t$array[ $key ] = array();\n\t\t\t}\n\t\t}\n\t\treturn $array;\n\t}\n\n\t/**\n\t * Parse a query string and set query type booleans.\n\t *\n\t * @since 1.5.0\n\t * @since 4.2.0 Introduced the ability to order by specific clauses of a `$meta_query`, by passing the clause's\n\t *              array key to `$orderby`.\n\t * @since 4.4.0 Introduced `$post_name__in` and `$title` parameters. `$s` was updated to support excluded\n\t *              search terms, by prepending a hyphen.\n\t * @since 4.5.0 Removed the `$comments_popup` parameter.\n\t *              Introduced the `$comment_status` and `$ping_status` parameters.\n\t *              Introduced `RAND(x)` syntax for `$orderby`, which allows an integer seed value to random sorts.\n\t * @since 4.6.0 Added 'post_name__in' support for `$orderby`. Introduced the `$lazy_load_term_meta` argument.\n\t * @since 4.9.0 Introduced the `$comment_count` parameter.\n\t * @since 5.1.0 Introduced the `$meta_compare_key` parameter.\n\t * @since 5.3.0 Introduced the `$meta_type_key` parameter.\n\t *\n\t * @param string|array $query {\n\t *     Optional. Array or string of Query parameters.\n\t *\n\t *     @type int          $attachment_id           Attachment post ID. Used for 'attachment' post_type.\n\t *     @type int|string   $author                  Author ID, or comma-separated list of IDs.\n\t *     @type string       $author_name             User 'user_nicename'.\n\t *     @type array        $author__in              An array of author IDs to query from.\n\t *     @type array        $author__not_in          An array of author IDs not to query from.\n\t *     @type bool         $cache_results           Whether to cache post information. Default true.\n\t *     @type int|string   $cat                     Category ID or comma-separated list of IDs (this or any children).\n\t *     @type array        $category__and           An array of category IDs (AND in).\n\t *     @type array        $category__in            An array of category IDs (OR in, no children).\n\t *     @type array        $category__not_in        An array of category IDs (NOT in).\n\t *     @type string       $category_name           Use category slug (not name, this or any children).\n\t *     @type array|int    $comment_count           Filter results by comment count. Provide an integer to match\n\t *                                                 comment count exactly. Provide an array with integer 'value'\n\t *                                                 and 'compare' operator ('=', '!=', '>', '>=', '<', '<=' ) to\n\t *                                                 compare against comment_count in a specific way.\n\t *     @type string       $comment_status          Comment status.\n\t *     @type int          $comments_per_page       The number of comments to return per page.\n\t *                                                 Default 'comments_per_page' option.\n\t *     @type array        $date_query              An associative array of WP_Date_Query arguments.\n\t *                                                 See WP_Date_Query::__construct().\n\t *     @type int          $day                     Day of the month. Default empty. Accepts numbers 1-31.\n\t *     @type bool         $exact                   Whether to search by exact keyword. Default false.\n\t *     @type string       $fields                  Post fields to query for. Accepts:\n\t *                                                 - '' Returns an array of complete post objects (`WP_Post[]`).\n\t *                                                 - 'ids' Returns an array of post IDs (`int[]`).\n\t *                                                 - 'id=>parent' Returns an associative array of parent post IDs,\n\t *                                                   keyed by post ID (`int[]`).\n\t *                                                 Default ''.\n\t *     @type int          $hour                    Hour of the day. Default empty. Accepts numbers 0-23.\n\t *     @type int|bool     $ignore_sticky_posts     Whether to ignore sticky posts or not. Setting this to false\n\t *                                                 excludes stickies from 'post__in'. Accepts 1|true, 0|false.\n\t *                                                 Default false.\n\t *     @type int          $m                       Combination YearMonth. Accepts any four-digit year and month\n\t *                                                 numbers 1-12. Default empty.\n\t *     @type string       $meta_compare            Comparison operator to test the 'meta_value'.\n\t *     @type string       $meta_compare_key        Comparison operator to test the 'meta_key'.\n\t *     @type string       $meta_key                Custom field key.\n\t *     @type array        $meta_query              An associative array of WP_Meta_Query arguments. See WP_Meta_Query.\n\t *     @type string       $meta_value              Custom field value.\n\t *     @type int          $meta_value_num          Custom field value number.\n\t *     @type string       $meta_type_key           Cast for 'meta_key'. See WP_Meta_Query::construct().\n\t *     @type int          $menu_order              The menu order of the posts.\n\t *     @type int          $monthnum                The two-digit month. Default empty. Accepts numbers 1-12.\n\t *     @type string       $name                    Post slug.\n\t *     @type bool         $nopaging                Show all posts (true) or paginate (false). Default false.\n\t *     @type bool         $no_found_rows           Whether to skip counting the total rows found. Enabling can improve\n\t *                                                 performance. Default false.\n\t *     @type int          $offset                  The number of posts to offset before retrieval.\n\t *     @type string       $order                   Designates ascending or descending order of posts. Default 'DESC'.\n\t *                                                 Accepts 'ASC', 'DESC'.\n\t *     @type string|array $orderby                 Sort retrieved posts by parameter. One or more options may be\n\t *                                                 passed. To use 'meta_value', or 'meta_value_num',\n\t *                                                 'meta_key=keyname' must be also be defined. To sort by a\n\t *                                                 specific `$meta_query` clause, use that clause's array key.\n\t *                                                 Accepts 'none', 'name', 'author', 'date', 'title',\n\t *                                                 'modified', 'menu_order', 'parent', 'ID', 'rand',\n\t *                                                 'relevance', 'RAND(x)' (where 'x' is an integer seed value),\n\t *                                                 'comment_count', 'meta_value', 'meta_value_num', 'post__in',\n\t *                                                 'post_name__in', 'post_parent__in', and the array keys\n\t *                                                 of `$meta_query`. Default is 'date', except when a search\n\t *                                                 is being performed, when the default is 'relevance'.\n\t *     @type int          $p                       Post ID.\n\t *     @type int          $page                    Show the number of posts that would show up on page X of a\n\t *                                                 static front page.\n\t *     @type int          $paged                   The number of the current page.\n\t *     @type int          $page_id                 Page ID.\n\t *     @type string       $pagename                Page slug.\n\t *     @type string       $perm                    Show posts if user has the appropriate capability.\n\t *     @type string       $ping_status             Ping status.\n\t *     @type array        $post__in                An array of post IDs to retrieve, sticky posts will be included.\n\t *     @type array        $post__not_in            An array of post IDs not to retrieve. Note: a string of comma-\n\t *                                                 separated IDs will NOT work.\n\t *     @type string       $post_mime_type          The mime type of the post. Used for 'attachment' post_type.\n\t *     @type array        $post_name__in           An array of post slugs that results must match.\n\t *     @type int          $post_parent             Page ID to retrieve child pages for. Use 0 to only retrieve\n\t *                                                 top-level pages.\n\t *     @type array        $post_parent__in         An array containing parent page IDs to query child pages from.\n\t *     @type array        $post_parent__not_in     An array containing parent page IDs not to query child pages from.\n\t *     @type string|array $post_type               A post type slug (string) or array of post type slugs.\n\t *                                                 Default 'any' if using 'tax_query'.\n\t *     @type string|array $post_status             A post status (string) or array of post statuses.\n\t *     @type int          $posts_per_page          The number of posts to query for. Use -1 to request all posts.\n\t *     @type int          $posts_per_archive_page  The number of posts to query for by archive page. Overrides\n\t *                                                 'posts_per_page' when is_archive(), or is_search() are true.\n\t *     @type string       $s                       Search keyword(s). Prepending a term with a hyphen will\n\t *                                                 exclude posts matching that term. Eg, 'pillow -sofa' will\n\t *                                                 return posts containing 'pillow' but not 'sofa'. The\n\t *                                                 character used for exclusion can be modified using the\n\t *                                                 the 'wp_query_search_exclusion_prefix' filter.\n\t *     @type int          $second                  Second of the minute. Default empty. Accepts numbers 0-60.\n\t *     @type bool         $sentence                Whether to search by phrase. Default false.\n\t *     @type bool         $suppress_filters        Whether to suppress filters. Default false.\n\t *     @type string       $tag                     Tag slug. Comma-separated (either), Plus-separated (all).\n\t *     @type array        $tag__and                An array of tag IDs (AND in).\n\t *     @type array        $tag__in                 An array of tag IDs (OR in).\n\t *     @type array        $tag__not_in             An array of tag IDs (NOT in).\n\t *     @type int          $tag_id                  Tag id or comma-separated list of IDs.\n\t *     @type array        $tag_slug__and           An array of tag slugs (AND in).\n\t *     @type array        $tag_slug__in            An array of tag slugs (OR in). unless 'ignore_sticky_posts' is\n\t *                                                 true. Note: a string of comma-separated IDs will NOT work.\n\t *     @type array        $tax_query               An associative array of WP_Tax_Query arguments.\n\t *                                                 See WP_Tax_Query->queries.\n\t *     @type string       $title                   Post title.\n\t *     @type bool         $update_post_meta_cache  Whether to update the post meta cache. Default true.\n\t *     @type bool         $update_post_term_cache  Whether to update the post term cache. Default true.\n\t *     @type bool         $lazy_load_term_meta     Whether to lazy-load term meta. Setting to false will\n\t *                                                 disable cache priming for term meta, so that each\n\t *                                                 get_term_meta() call will hit the database.\n\t *                                                 Defaults to the value of `$update_post_term_cache`.\n\t *     @type int          $w                       The week number of the year. Default empty. Accepts numbers 0-53.\n\t *     @type int          $year                    The four-digit year. Default empty. Accepts any four-digit year.\n\t * }\n\t */\n\tpublic function parse_query( $query = '' ) {\n\t\tif ( ! empty( $query ) ) {\n\t\t\t$this->init();\n\t\t\t$this->query      = wp_parse_args( $query );\n\t\t\t$this->query_vars = $this->query;\n\t\t} elseif ( ! isset( $this->query ) ) {\n\t\t\t$this->query = $this->query_vars;\n\t\t}\n\n\t\t$this->query_vars         = $this->fill_query_vars( $this->query_vars );\n\t\t$qv                       = &$this->query_vars;\n\t\t$this->query_vars_changed = true;\n\n\t\tif ( ! empty( $qv['robots'] ) ) {\n\t\t\t$this->is_robots = true;\n\t\t} elseif ( ! empty( $qv['favicon'] ) ) {\n\t\t\t$this->is_favicon = true;\n\t\t}\n\n\t\tif ( ! is_scalar( $qv['p'] ) || $qv['p'] < 0 ) {\n\t\t\t$qv['p']     = 0;\n\t\t\t$qv['error'] = '404';\n\t\t} else {\n\t\t\t$qv['p'] = intval( $qv['p'] );\n\t\t}\n\n\t\t$qv['page_id']  = absint( $qv['page_id'] );\n\t\t$qv['year']     = absint( $qv['year'] );\n\t\t$qv['monthnum'] = absint( $qv['monthnum'] );\n\t\t$qv['day']      = absint( $qv['day'] );\n\t\t$qv['w']        = absint( $qv['w'] );\n\t\t$qv['m']        = is_scalar( $qv['m'] ) ? preg_replace( '|[^0-9]|', '', $qv['m'] ) : '';\n\t\t$qv['paged']    = absint( $qv['paged'] );\n\t\t$qv['cat']      = preg_replace( '|[^0-9,-]|', '', $qv['cat'] );    // Comma-separated list of positive or negative integers.\n\t\t$qv['author']   = preg_replace( '|[^0-9,-]|', '', $qv['author'] ); // Comma-separated list of positive or negative integers.\n\t\t$qv['pagename'] = trim( $qv['pagename'] );\n\t\t$qv['name']     = trim( $qv['name'] );\n\t\t$qv['title']    = trim( $qv['title'] );\n\t\tif ( '' !== $qv['hour'] ) {\n\t\t\t$qv['hour'] = absint( $qv['hour'] );\n\t\t}\n\t\tif ( '' !== $qv['minute'] ) {\n\t\t\t$qv['minute'] = absint( $qv['minute'] );\n\t\t}\n\t\tif ( '' !== $qv['second'] ) {\n\t\t\t$qv['second'] = absint( $qv['second'] );\n\t\t}\n\t\tif ( '' !== $qv['menu_order'] ) {\n\t\t\t$qv['menu_order'] = absint( $qv['menu_order'] );\n\t\t}\n\n\t\t// Fairly insane upper bound for search string lengths.\n\t\tif ( ! is_scalar( $qv['s'] ) || ( ! empty( $qv['s'] ) && strlen( $qv['s'] ) > 1600 ) ) {\n\t\t\t$qv['s'] = '';\n\t\t}\n\n\t\t// Compat. Map subpost to attachment.\n\t\tif ( '' != $qv['subpost'] ) {\n\t\t\t$qv['attachment'] = $qv['subpost'];\n\t\t}\n\t\tif ( '' != $qv['subpost_id'] ) {\n\t\t\t$qv['attachment_id'] = $qv['subpost_id'];\n\t\t}\n\n\t\t$qv['attachment_id'] = absint( $qv['attachment_id'] );\n\n\t\tif ( ( '' !== $qv['attachment'] ) || ! empty( $qv['attachment_id'] ) ) {\n\t\t\t$this->is_single     = true;\n\t\t\t$this->is_attachment = true;\n\t\t} elseif ( '' !== $qv['name'] ) {\n\t\t\t$this->is_single = true;\n\t\t} elseif ( $qv['p'] ) {\n\t\t\t$this->is_single = true;\n\t\t} elseif ( '' !== $qv['pagename'] || ! empty( $qv['page_id'] ) ) {\n\t\t\t$this->is_page   = true;\n\t\t\t$this->is_single = false;\n\t\t} else {\n\t\t\t// Look for archive queries. Dates, categories, authors, search, post type archives.\n\n\t\t\tif ( isset( $this->query['s'] ) ) {\n\t\t\t\t$this->is_search = true;\n\t\t\t}\n\n\t\t\tif ( '' !== $qv['second'] ) {\n\t\t\t\t$this->is_time = true;\n\t\t\t\t$this->is_date = true;\n\t\t\t}\n\n\t\t\tif ( '' !== $qv['minute'] ) {\n\t\t\t\t$this->is_time = true;\n\t\t\t\t$this->is_date = true;\n\t\t\t}\n\n\t\t\tif ( '' !== $qv['hour'] ) {\n\t\t\t\t$this->is_time = true;\n\t\t\t\t$this->is_date = true;\n\t\t\t}\n\n\t\t\tif ( $qv['day'] ) {\n\t\t\t\tif ( ! $this->is_date ) {\n\t\t\t\t\t$date = sprintf( '%04d-%02d-%02d', $qv['year'], $qv['monthnum'], $qv['day'] );\n\t\t\t\t\tif ( $qv['monthnum'] && $qv['year'] && ! wp_checkdate( $qv['monthnum'], $qv['day'], $qv['year'], $date ) ) {\n\t\t\t\t\t\t$qv['error'] = '404';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->is_day  = true;\n\t\t\t\t\t\t$this->is_date = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $qv['monthnum'] ) {\n\t\t\t\tif ( ! $this->is_date ) {\n\t\t\t\t\tif ( 12 < $qv['monthnum'] ) {\n\t\t\t\t\t\t$qv['error'] = '404';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->is_month = true;\n\t\t\t\t\t\t$this->is_date  = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $qv['year'] ) {\n\t\t\t\tif ( ! $this->is_date ) {\n\t\t\t\t\t$this->is_year = true;\n\t\t\t\t\t$this->is_date = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $qv['m'] ) {\n\t\t\t\t$this->is_date = true;\n\t\t\t\tif ( strlen( $qv['m'] ) > 9 ) {\n\t\t\t\t\t$this->is_time = true;\n\t\t\t\t} elseif ( strlen( $qv['m'] ) > 7 ) {\n\t\t\t\t\t$this->is_day = true;\n\t\t\t\t} elseif ( strlen( $qv['m'] ) > 5 ) {\n\t\t\t\t\t$this->is_month = true;\n\t\t\t\t} else {\n\t\t\t\t\t$this->is_year = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $qv['w'] ) {\n\t\t\t\t$this->is_date = true;\n\t\t\t}\n\n\t\t\t$this->query_vars_hash = false;\n\t\t\t$this->parse_tax_query( $qv );\n\n\t\t\tforeach ( $this->tax_query->queries as $tax_query ) {\n\t\t\t\tif ( ! is_array( $tax_query ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( isset( $tax_query['operator'] ) && 'NOT IN' !== $tax_query['operator'] ) {\n\t\t\t\t\tswitch ( $tax_query['taxonomy'] ) {\n\t\t\t\t\t\tcase 'category':\n\t\t\t\t\t\t\t$this->is_category = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'post_tag':\n\t\t\t\t\t\t\t$this->is_tag = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$this->is_tax = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset( $tax_query );\n\n\t\t\tif ( empty( $qv['author'] ) || ( '0' == $qv['author'] ) ) {\n\t\t\t\t$this->is_author = false;\n\t\t\t} else {\n\t\t\t\t$this->is_author = true;\n\t\t\t}\n\n\t\t\tif ( '' !== $qv['author_name'] ) {\n\t\t\t\t$this->is_author = true;\n\t\t\t}\n\n\t\t\tif ( ! empty( $qv['post_type'] ) && ! is_array( $qv['post_type'] ) ) {\n\t\t\t\t$post_type_obj = get_post_type_object( $qv['post_type'] );\n\t\t\t\tif ( ! empty( $post_type_obj->has_archive ) ) {\n\t\t\t\t\t$this->is_post_type_archive = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $this->is_post_type_archive || $this->is_date || $this->is_author || $this->is_category || $this->is_tag || $this->is_tax ) {\n\t\t\t\t$this->is_archive = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( '' != $qv['feed'] ) {\n\t\t\t$this->is_feed = true;\n\t\t}\n\n\t\tif ( '' != $qv['embed'] ) {\n\t\t\t$this->is_embed = true;\n\t\t}\n\n\t\tif ( '' != $qv['tb'] ) {\n\t\t\t$this->is_trackback = true;\n\t\t}\n\n\t\tif ( '' != $qv['paged'] && ( intval( $qv['paged'] ) > 1 ) ) {\n\t\t\t$this->is_paged = true;\n\t\t}\n\n\t\t// If we're previewing inside the write screen.\n\t\tif ( '' != $qv['preview'] ) {\n\t\t\t$this->is_preview = true;\n\t\t}\n\n\t\tif ( is_admin() ) {\n\t\t\t$this->is_admin = true;\n\t\t}\n\n\t\tif ( false !== strpos( $qv['feed'], 'comments-' ) ) {\n\t\t\t$qv['feed']         = str_replace( 'comments-', '', $qv['feed'] );\n\t\t\t$qv['withcomments'] = 1;\n\t\t}\n\n\t\t$this->is_singular = $this->is_single || $this->is_page || $this->is_attachment;\n\n\t\tif ( $this->is_feed && ( ! empty( $qv['withcomments'] ) || ( empty( $qv['withoutcomments'] ) && $this->is_singular ) ) ) {\n\t\t\t$this->is_comment_feed = true;\n\t\t}\n\n\t\tif ( ! ( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed\n\t\t\t\t|| ( defined( 'REST_REQUEST' ) && REST_REQUEST && $this->is_main_query() )\n\t\t\t\t|| $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_robots || $this->is_favicon ) ) {\n\t\t\t$this->is_home = true;\n\t\t}\n\n\t\t// Correct `is_*` for 'page_on_front' and 'page_for_posts'.\n\t\tif ( $this->is_home && 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) ) {\n\t\t\t$_query = wp_parse_args( $this->query );\n\t\t\t// 'pagename' can be set and empty depending on matched rewrite rules. Ignore an empty 'pagename'.\n\t\t\tif ( isset( $_query['pagename'] ) && '' === $_query['pagename'] ) {\n\t\t\t\tunset( $_query['pagename'] );\n\t\t\t}\n\n\t\t\tunset( $_query['embed'] );\n\n\t\t\tif ( empty( $_query ) || ! array_diff( array_keys( $_query ), array( 'preview', 'page', 'paged', 'cpage' ) ) ) {\n\t\t\t\t$this->is_page = true;\n\t\t\t\t$this->is_home = false;\n\t\t\t\t$qv['page_id'] = get_option( 'page_on_front' );\n\t\t\t\t// Correct <!--nextpage--> for 'page_on_front'.\n\t\t\t\tif ( ! empty( $qv['paged'] ) ) {\n\t\t\t\t\t$qv['page'] = $qv['paged'];\n\t\t\t\t\tunset( $qv['paged'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( '' !== $qv['pagename'] ) {\n\t\t\t$this->queried_object = get_page_by_path( $qv['pagename'] );\n\n\t\t\tif ( $this->queried_object && 'attachment' === $this->queried_object->post_type ) {\n\t\t\t\tif ( preg_match( '/^[^%]*%(?:postname)%/', get_option( 'permalink_structure' ) ) ) {\n\t\t\t\t\t// See if we also have a post with the same slug.\n\t\t\t\t\t$post = get_page_by_path( $qv['pagename'], OBJECT, 'post' );\n\t\t\t\t\tif ( $post ) {\n\t\t\t\t\t\t$this->queried_object = $post;\n\t\t\t\t\t\t$this->is_page        = false;\n\t\t\t\t\t\t$this->is_single      = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty( $this->queried_object ) ) {\n\t\t\t\t$this->queried_object_id = (int) $this->queried_object->ID;\n\t\t\t} else {\n\t\t\t\tunset( $this->queried_object );\n\t\t\t}\n\n\t\t\tif ( 'page' === get_option( 'show_on_front' ) && isset( $this->queried_object_id ) && get_option( 'page_for_posts' ) == $this->queried_object_id ) {\n\t\t\t\t$this->is_page       = false;\n\t\t\t\t$this->is_home       = true;\n\t\t\t\t$this->is_posts_page = true;\n\t\t\t}\n\n\t\t\tif ( isset( $this->queried_object_id ) && get_option( 'wp_page_for_privacy_policy' ) == $this->queried_object_id ) {\n\t\t\t\t$this->is_privacy_policy = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( $qv['page_id'] ) {\n\t\t\tif ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) == $qv['page_id'] ) {\n\t\t\t\t$this->is_page       = false;\n\t\t\t\t$this->is_home       = true;\n\t\t\t\t$this->is_posts_page = true;\n\t\t\t}\n\n\t\t\tif ( get_option( 'wp_page_for_privacy_policy' ) == $qv['page_id'] ) {\n\t\t\t\t$this->is_privacy_policy = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $qv['post_type'] ) ) {\n\t\t\tif ( is_array( $qv['post_type'] ) ) {\n\t\t\t\t$qv['post_type'] = array_map( 'sanitize_key', $qv['post_type'] );\n\t\t\t} else {\n\t\t\t\t$qv['post_type'] = sanitize_key( $qv['post_type'] );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $qv['post_status'] ) ) {\n\t\t\tif ( is_array( $qv['post_status'] ) ) {\n\t\t\t\t$qv['post_status'] = array_map( 'sanitize_key', $qv['post_status'] );\n\t\t\t} else {\n\t\t\t\t$qv['post_status'] = preg_replace( '|[^a-z0-9_,-]|', '', $qv['post_status'] );\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->is_posts_page && ( ! isset( $qv['withcomments'] ) || ! $qv['withcomments'] ) ) {\n\t\t\t$this->is_comment_feed = false;\n\t\t}\n\n\t\t$this->is_singular = $this->is_single || $this->is_page || $this->is_attachment;\n\t\t// Done correcting `is_*` for 'page_on_front' and 'page_for_posts'.\n\n\t\tif ( '404' == $qv['error'] ) {\n\t\t\t$this->set_404();\n\t\t}\n\n\t\t$this->is_embed = $this->is_embed && ( $this->is_singular || $this->is_404 );\n\n\t\t$this->query_vars_hash    = md5( serialize( $this->query_vars ) );\n\t\t$this->query_vars_changed = false;\n\n\t\t/**\n\t\t * Fires after the main query vars have been parsed.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param WP_Query $this The WP_Query instance (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'parse_query', array( &$this ) );\n\t}\n\n\t/**\n\t * Parses various taxonomy related query vars.\n\t *\n\t * For BC, this method is not marked as protected. See [28987].\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param array $q The query variables. Passed by reference.\n\t */\n\tpublic function parse_tax_query( &$q ) {\n\t\tif ( ! empty( $q['tax_query'] ) && is_array( $q['tax_query'] ) ) {\n\t\t\t$tax_query = $q['tax_query'];\n\t\t} else {\n\t\t\t$tax_query = array();\n\t\t}\n\n\t\tif ( ! empty( $q['taxonomy'] ) && ! empty( $q['term'] ) ) {\n\t\t\t$tax_query[] = array(\n\t\t\t\t'taxonomy' => $q['taxonomy'],\n\t\t\t\t'terms'    => array( $q['term'] ),\n\t\t\t\t'field'    => 'slug',\n\t\t\t);\n\t\t}\n\n\t\tforeach ( get_taxonomies( array(), 'objects' ) as $taxonomy => $t ) {\n\t\t\tif ( 'post_tag' === $taxonomy ) {\n\t\t\t\tcontinue; // Handled further down in the $q['tag'] block.\n\t\t\t}\n\n\t\t\tif ( $t->query_var && ! empty( $q[ $t->query_var ] ) ) {\n\t\t\t\t$tax_query_defaults = array(\n\t\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t\t'field'    => 'slug',\n\t\t\t\t);\n\n\t\t\t\tif ( isset( $t->rewrite['hierarchical'] ) && $t->rewrite['hierarchical'] ) {\n\t\t\t\t\t$q[ $t->query_var ] = wp_basename( $q[ $t->query_var ] );\n\t\t\t\t}\n\n\t\t\t\t$term = $q[ $t->query_var ];\n\n\t\t\t\tif ( is_array( $term ) ) {\n\t\t\t\t\t$term = implode( ',', $term );\n\t\t\t\t}\n\n\t\t\t\tif ( strpos( $term, '+' ) !== false ) {\n\t\t\t\t\t$terms = preg_split( '/[+]+/', $term );\n\t\t\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t\t\t$tax_query[] = array_merge(\n\t\t\t\t\t\t\t$tax_query_defaults,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'terms' => array( $term ),\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} else {\n\t\t\t\t\t$tax_query[] = array_merge(\n\t\t\t\t\t\t$tax_query_defaults,\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'terms' => preg_split( '/[,]+/', $term ),\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If query string 'cat' is an array, implode it.\n\t\tif ( is_array( $q['cat'] ) ) {\n\t\t\t$q['cat'] = implode( ',', $q['cat'] );\n\t\t}\n\n\t\t// Category stuff.\n\n\t\tif ( ! empty( $q['cat'] ) && ! $this->is_singular ) {\n\t\t\t$cat_in     = array();\n\t\t\t$cat_not_in = array();\n\n\t\t\t$cat_array = preg_split( '/[,\\s]+/', urldecode( $q['cat'] ) );\n\t\t\t$cat_array = array_map( 'intval', $cat_array );\n\t\t\t$q['cat']  = implode( ',', $cat_array );\n\n\t\t\tforeach ( $cat_array as $cat ) {\n\t\t\t\tif ( $cat > 0 ) {\n\t\t\t\t\t$cat_in[] = $cat;\n\t\t\t\t} elseif ( $cat < 0 ) {\n\t\t\t\t\t$cat_not_in[] = abs( $cat );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty( $cat_in ) ) {\n\t\t\t\t$tax_query[] = array(\n\t\t\t\t\t'taxonomy'         => 'category',\n\t\t\t\t\t'terms'            => $cat_in,\n\t\t\t\t\t'field'            => 'term_id',\n\t\t\t\t\t'include_children' => true,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( ! empty( $cat_not_in ) ) {\n\t\t\t\t$tax_query[] = array(\n\t\t\t\t\t'taxonomy'         => 'category',\n\t\t\t\t\t'terms'            => $cat_not_in,\n\t\t\t\t\t'field'            => 'term_id',\n\t\t\t\t\t'operator'         => 'NOT IN',\n\t\t\t\t\t'include_children' => true,\n\t\t\t\t);\n\t\t\t}\n\t\t\tunset( $cat_array, $cat_in, $cat_not_in );\n\t\t}\n\n\t\tif ( ! empty( $q['category__and'] ) && 1 === count( (array) $q['category__and'] ) ) {\n\t\t\t$q['category__and'] = (array) $q['category__and'];\n\t\t\tif ( ! isset( $q['category__in'] ) ) {\n\t\t\t\t$q['category__in'] = array();\n\t\t\t}\n\t\t\t$q['category__in'][] = absint( reset( $q['category__and'] ) );\n\t\t\tunset( $q['category__and'] );\n\t\t}\n\n\t\tif ( ! empty( $q['category__in'] ) ) {\n\t\t\t$q['category__in'] = array_map( 'absint', array_unique( (array) $q['category__in'] ) );\n\t\t\t$tax_query[]       = array(\n\t\t\t\t'taxonomy'         => 'category',\n\t\t\t\t'terms'            => $q['category__in'],\n\t\t\t\t'field'            => 'term_id',\n\t\t\t\t'include_children' => false,\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $q['category__not_in'] ) ) {\n\t\t\t$q['category__not_in'] = array_map( 'absint', array_unique( (array) $q['category__not_in'] ) );\n\t\t\t$tax_query[]           = array(\n\t\t\t\t'taxonomy'         => 'category',\n\t\t\t\t'terms'            => $q['category__not_in'],\n\t\t\t\t'operator'         => 'NOT IN',\n\t\t\t\t'include_children' => false,\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $q['category__and'] ) ) {\n\t\t\t$q['category__and'] = array_map( 'absint', array_unique( (array) $q['category__and'] ) );\n\t\t\t$tax_query[]        = array(\n\t\t\t\t'taxonomy'         => 'category',\n\t\t\t\t'terms'            => $q['category__and'],\n\t\t\t\t'field'            => 'term_id',\n\t\t\t\t'operator'         => 'AND',\n\t\t\t\t'include_children' => false,\n\t\t\t);\n\t\t}\n\n\t\t// If query string 'tag' is array, implode it.\n\t\tif ( is_array( $q['tag'] ) ) {\n\t\t\t$q['tag'] = implode( ',', $q['tag'] );\n\t\t}\n\n\t\t// Tag stuff.\n\n\t\tif ( '' !== $q['tag'] && ! $this->is_singular && $this->query_vars_changed ) {\n\t\t\tif ( strpos( $q['tag'], ',' ) !== false ) {\n\t\t\t\t$tags = preg_split( '/[,\\r\\n\\t ]+/', $q['tag'] );\n\t\t\t\tforeach ( (array) $tags as $tag ) {\n\t\t\t\t\t$tag                 = sanitize_term_field( 'slug', $tag, 0, 'post_tag', 'db' );\n\t\t\t\t\t$q['tag_slug__in'][] = $tag;\n\t\t\t\t}\n\t\t\t} elseif ( preg_match( '/[+\\r\\n\\t ]+/', $q['tag'] ) || ! empty( $q['cat'] ) ) {\n\t\t\t\t$tags = preg_split( '/[+\\r\\n\\t ]+/', $q['tag'] );\n\t\t\t\tforeach ( (array) $tags as $tag ) {\n\t\t\t\t\t$tag                  = sanitize_term_field( 'slug', $tag, 0, 'post_tag', 'db' );\n\t\t\t\t\t$q['tag_slug__and'][] = $tag;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$q['tag']            = sanitize_term_field( 'slug', $q['tag'], 0, 'post_tag', 'db' );\n\t\t\t\t$q['tag_slug__in'][] = $q['tag'];\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $q['tag_id'] ) ) {\n\t\t\t$q['tag_id'] = absint( $q['tag_id'] );\n\t\t\t$tax_query[] = array(\n\t\t\t\t'taxonomy' => 'post_tag',\n\t\t\t\t'terms'    => $q['tag_id'],\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $q['tag__in'] ) ) {\n\t\t\t$q['tag__in'] = array_map( 'absint', array_unique( (array) $q['tag__in'] ) );\n\t\t\t$tax_query[]  = array(\n\t\t\t\t'taxonomy' => 'post_tag',\n\t\t\t\t'terms'    => $q['tag__in'],\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $q['tag__not_in'] ) ) {\n\t\t\t$q['tag__not_in'] = array_map( 'absint', array_unique( (array) $q['tag__not_in'] ) );\n\t\t\t$tax_query[]      = array(\n\t\t\t\t'taxonomy' => 'post_tag',\n\t\t\t\t'terms'    => $q['tag__not_in'],\n\t\t\t\t'operator' => 'NOT IN',\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $q['tag__and'] ) ) {\n\t\t\t$q['tag__and'] = array_map( 'absint', array_unique( (array) $q['tag__and'] ) );\n\t\t\t$tax_query[]   = array(\n\t\t\t\t'taxonomy' => 'post_tag',\n\t\t\t\t'terms'    => $q['tag__and'],\n\t\t\t\t'operator' => 'AND',\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $q['tag_slug__in'] ) ) {\n\t\t\t$q['tag_slug__in'] = array_map( 'sanitize_title_for_query', array_unique( (array) $q['tag_slug__in'] ) );\n\t\t\t$tax_query[]       = array(\n\t\t\t\t'taxonomy' => 'post_tag',\n\t\t\t\t'terms'    => $q['tag_slug__in'],\n\t\t\t\t'field'    => 'slug',\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $q['tag_slug__and'] ) ) {\n\t\t\t$q['tag_slug__and'] = array_map( 'sanitize_title_for_query', array_unique( (array) $q['tag_slug__and'] ) );\n\t\t\t$tax_query[]        = array(\n\t\t\t\t'taxonomy' => 'post_tag',\n\t\t\t\t'terms'    => $q['tag_slug__and'],\n\t\t\t\t'field'    => 'slug',\n\t\t\t\t'operator' => 'AND',\n\t\t\t);\n\t\t}\n\n\t\t$this->tax_query = new WP_Tax_Query( $tax_query );\n\n\t\t/**\n\t\t * Fires after taxonomy-related query vars have been parsed.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param WP_Query $this The WP_Query instance.\n\t\t */\n\t\tdo_action( 'parse_tax_query', $this );\n\t}\n\n\t/**\n\t * Generates SQL for the WHERE clause based on passed search terms.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param array $q Query variables.\n\t * @return string WHERE clause.\n\t */\n\tprotected function parse_search( &$q ) {\n\t\tglobal $wpdb;\n\n\t\t$search = '';\n\n\t\t// Added slashes screw with quote grouping when done early, so done later.\n\t\t$q['s'] = stripslashes( $q['s'] );\n\t\tif ( empty( $_GET['s'] ) && $this->is_main_query() ) {\n\t\t\t$q['s'] = urldecode( $q['s'] );\n\t\t}\n\t\t// There are no line breaks in <input /> fields.\n\t\t$q['s']                  = str_replace( array( \"\\r\", \"\\n\" ), '', $q['s'] );\n\t\t$q['search_terms_count'] = 1;\n\t\tif ( ! empty( $q['sentence'] ) ) {\n\t\t\t$q['search_terms'] = array( $q['s'] );\n\t\t} else {\n\t\t\tif ( preg_match_all( '/\".*?(\"|$)|((?<=[\\t \",+])|^)[^\\t \",+]+/', $q['s'], $matches ) ) {\n\t\t\t\t$q['search_terms_count'] = count( $matches[0] );\n\t\t\t\t$q['search_terms']       = $this->parse_search_terms( $matches[0] );\n\t\t\t\t// If the search string has only short terms or stopwords, or is 10+ terms long, match it as sentence.\n\t\t\t\tif ( empty( $q['search_terms'] ) || count( $q['search_terms'] ) > 9 ) {\n\t\t\t\t\t$q['search_terms'] = array( $q['s'] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$q['search_terms'] = array( $q['s'] );\n\t\t\t}\n\t\t}\n\n\t\t$n                         = ! empty( $q['exact'] ) ? '' : '%';\n\t\t$searchand                 = '';\n\t\t$q['search_orderby_title'] = array();\n\n\t\t/**\n\t\t * Filters the prefix that indicates that a search term should be excluded from results.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param string $exclusion_prefix The prefix. Default '-'. Returning\n\t\t *                                 an empty value disables exclusions.\n\t\t */\n\t\t$exclusion_prefix = apply_filters( 'wp_query_search_exclusion_prefix', '-' );\n\n\t\tforeach ( $q['search_terms'] as $term ) {\n\t\t\t// If there is an $exclusion_prefix, terms prefixed with it should be excluded.\n\t\t\t$exclude = $exclusion_prefix && ( substr( $term, 0, 1 ) === $exclusion_prefix );\n\t\t\tif ( $exclude ) {\n\t\t\t\t$like_op  = 'NOT LIKE';\n\t\t\t\t$andor_op = 'AND';\n\t\t\t\t$term     = substr( $term, 1 );\n\t\t\t} else {\n\t\t\t\t$like_op  = 'LIKE';\n\t\t\t\t$andor_op = 'OR';\n\t\t\t}\n\n\t\t\tif ( $n && ! $exclude ) {\n\t\t\t\t$like                        = '%' . $wpdb->esc_like( $term ) . '%';\n\t\t\t\t$q['search_orderby_title'][] = $wpdb->prepare( \"{$wpdb->posts}.post_title LIKE %s\", $like );\n\t\t\t}\n\n\t\t\t$like      = $n . $wpdb->esc_like( $term ) . $n;\n\t\t\t$search   .= $wpdb->prepare( \"{$searchand}(({$wpdb->posts}.post_title $like_op %s) $andor_op ({$wpdb->posts}.post_excerpt $like_op %s) $andor_op ({$wpdb->posts}.post_content $like_op %s))\", $like, $like, $like );\n\t\t\t$searchand = ' AND ';\n\t\t}\n\n\t\tif ( ! empty( $search ) ) {\n\t\t\t$search = \" AND ({$search}) \";\n\t\t\tif ( ! is_user_logged_in() ) {\n\t\t\t\t$search .= \" AND ({$wpdb->posts}.post_password = '') \";\n\t\t\t}\n\t\t}\n\n\t\treturn $search;\n\t}\n\n\t/**\n\t * Check if the terms are suitable for searching.\n\t *\n\t * Uses an array of stopwords (terms) that are excluded from the separate\n\t * term matching when searching for posts. The list of English stopwords is\n\t * the approximate search engines list, and is translatable.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param string[] $terms Array of terms to check.\n\t * @return string[] Terms that are not stopwords.\n\t */\n\tprotected function parse_search_terms( $terms ) {\n\t\t$strtolower = function_exists( 'mb_strtolower' ) ? 'mb_strtolower' : 'strtolower';\n\t\t$checked    = array();\n\n\t\t$stopwords = $this->get_search_stopwords();\n\n\t\tforeach ( $terms as $term ) {\n\t\t\t// Keep before/after spaces when term is for exact match.\n\t\t\tif ( preg_match( '/^\".+\"$/', $term ) ) {\n\t\t\t\t$term = trim( $term, \"\\\"'\" );\n\t\t\t} else {\n\t\t\t\t$term = trim( $term, \"\\\"' \" );\n\t\t\t}\n\n\t\t\t// Avoid single A-Z and single dashes.\n\t\t\tif ( ! $term || ( 1 === strlen( $term ) && preg_match( '/^[a-z\\-]$/i', $term ) ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( in_array( call_user_func( $strtolower, $term ), $stopwords, true ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$checked[] = $term;\n\t\t}\n\n\t\treturn $checked;\n\t}\n\n\t/**\n\t * Retrieve stopwords used when parsing search terms.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @return string[] Stopwords.\n\t */\n\tprotected function get_search_stopwords() {\n\t\tif ( isset( $this->stopwords ) ) {\n\t\t\treturn $this->stopwords;\n\t\t}\n\n\t\t/*\n\t\t * translators: This is a comma-separated list of very common words that should be excluded from a search,\n\t\t * like a, an, and the. These are usually called \"stopwords\". You should not simply translate these individual\n\t\t * words into your language. Instead, look for and provide commonly accepted stopwords in your language.\n\t\t */\n\t\t$words = explode(\n\t\t\t',',\n\t\t\t_x(\n\t\t\t\t'about,an,are,as,at,be,by,com,for,from,how,in,is,it,of,on,or,that,the,this,to,was,what,when,where,who,will,with,www',\n\t\t\t\t'Comma-separated list of search stopwords in your language'\n\t\t\t)\n\t\t);\n\n\t\t$stopwords = array();\n\t\tforeach ( $words as $word ) {\n\t\t\t$word = trim( $word, \"\\r\\n\\t \" );\n\t\t\tif ( $word ) {\n\t\t\t\t$stopwords[] = $word;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters stopwords used when parsing search terms.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param string[] $stopwords Array of stopwords.\n\t\t */\n\t\t$this->stopwords = apply_filters( 'wp_search_stopwords', $stopwords );\n\t\treturn $this->stopwords;\n\t}\n\n\t/**\n\t * Generates SQL for the ORDER BY condition based on passed search terms.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param array $q Query variables.\n\t * @return string ORDER BY clause.\n\t */\n\tprotected function parse_search_order( &$q ) {\n\t\tglobal $wpdb;\n\n\t\tif ( $q['search_terms_count'] > 1 ) {\n\t\t\t$num_terms = count( $q['search_orderby_title'] );\n\n\t\t\t// If the search terms contain negative queries, don't bother ordering by sentence matches.\n\t\t\t$like = '';\n\t\t\tif ( ! preg_match( '/(?:\\s|^)\\-/', $q['s'] ) ) {\n\t\t\t\t$like = '%' . $wpdb->esc_like( $q['s'] ) . '%';\n\t\t\t}\n\n\t\t\t$search_orderby = '';\n\n\t\t\t// Sentence match in 'post_title'.\n\t\t\tif ( $like ) {\n\t\t\t\t$search_orderby .= $wpdb->prepare( \"WHEN {$wpdb->posts}.post_title LIKE %s THEN 1 \", $like );\n\t\t\t}\n\n\t\t\t// Sanity limit, sort as sentence when more than 6 terms\n\t\t\t// (few searches are longer than 6 terms and most titles are not).\n\t\t\tif ( $num_terms < 7 ) {\n\t\t\t\t// All words in title.\n\t\t\t\t$search_orderby .= 'WHEN ' . implode( ' AND ', $q['search_orderby_title'] ) . ' THEN 2 ';\n\t\t\t\t// Any word in title, not needed when $num_terms == 1.\n\t\t\t\tif ( $num_terms > 1 ) {\n\t\t\t\t\t$search_orderby .= 'WHEN ' . implode( ' OR ', $q['search_orderby_title'] ) . ' THEN 3 ';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Sentence match in 'post_content' and 'post_excerpt'.\n\t\t\tif ( $like ) {\n\t\t\t\t$search_orderby .= $wpdb->prepare( \"WHEN {$wpdb->posts}.post_excerpt LIKE %s THEN 4 \", $like );\n\t\t\t\t$search_orderby .= $wpdb->prepare( \"WHEN {$wpdb->posts}.post_content LIKE %s THEN 5 \", $like );\n\t\t\t}\n\n\t\t\tif ( $search_orderby ) {\n\t\t\t\t$search_orderby = '(CASE ' . $search_orderby . 'ELSE 6 END)';\n\t\t\t}\n\t\t} else {\n\t\t\t// Single word or sentence search.\n\t\t\t$search_orderby = reset( $q['search_orderby_title'] ) . ' DESC';\n\t\t}\n\n\t\treturn $search_orderby;\n\t}\n\n\t/**\n\t * Converts the given orderby alias (if allowed) to a properly-prefixed value.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $orderby Alias for the field to order by.\n\t * @return string|false Table-prefixed value to used in the ORDER clause. False otherwise.\n\t */\n\tprotected function parse_orderby( $orderby ) {\n\t\tglobal $wpdb;\n\n\t\t// Used to filter values.\n\t\t$allowed_keys = array(\n\t\t\t'post_name',\n\t\t\t'post_author',\n\t\t\t'post_date',\n\t\t\t'post_title',\n\t\t\t'post_modified',\n\t\t\t'post_parent',\n\t\t\t'post_type',\n\t\t\t'name',\n\t\t\t'author',\n\t\t\t'date',\n\t\t\t'title',\n\t\t\t'modified',\n\t\t\t'parent',\n\t\t\t'type',\n\t\t\t'ID',\n\t\t\t'menu_order',\n\t\t\t'comment_count',\n\t\t\t'rand',\n\t\t\t'post__in',\n\t\t\t'post_parent__in',\n\t\t\t'post_name__in',\n\t\t);\n\n\t\t$primary_meta_key   = '';\n\t\t$primary_meta_query = false;\n\t\t$meta_clauses       = $this->meta_query->get_clauses();\n\t\tif ( ! empty( $meta_clauses ) ) {\n\t\t\t$primary_meta_query = reset( $meta_clauses );\n\n\t\t\tif ( ! empty( $primary_meta_query['key'] ) ) {\n\t\t\t\t$primary_meta_key = $primary_meta_query['key'];\n\t\t\t\t$allowed_keys[]   = $primary_meta_key;\n\t\t\t}\n\n\t\t\t$allowed_keys[] = 'meta_value';\n\t\t\t$allowed_keys[] = 'meta_value_num';\n\t\t\t$allowed_keys   = array_merge( $allowed_keys, array_keys( $meta_clauses ) );\n\t\t}\n\n\t\t// If RAND() contains a seed value, sanitize and add to allowed keys.\n\t\t$rand_with_seed = false;\n\t\tif ( preg_match( '/RAND\\(([0-9]+)\\)/i', $orderby, $matches ) ) {\n\t\t\t$orderby        = sprintf( 'RAND(%s)', intval( $matches[1] ) );\n\t\t\t$allowed_keys[] = $orderby;\n\t\t\t$rand_with_seed = true;\n\t\t}\n\n\t\tif ( ! in_array( $orderby, $allowed_keys, true ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$orderby_clause = '';\n\n\t\tswitch ( $orderby ) {\n\t\t\tcase 'post_name':\n\t\t\tcase 'post_author':\n\t\t\tcase 'post_date':\n\t\t\tcase 'post_title':\n\t\t\tcase 'post_modified':\n\t\t\tcase 'post_parent':\n\t\t\tcase 'post_type':\n\t\t\tcase 'ID':\n\t\t\tcase 'menu_order':\n\t\t\tcase 'comment_count':\n\t\t\t\t$orderby_clause = \"{$wpdb->posts}.{$orderby}\";\n\t\t\t\tbreak;\n\t\t\tcase 'rand':\n\t\t\t\t$orderby_clause = 'RAND()';\n\t\t\t\tbreak;\n\t\t\tcase $primary_meta_key:\n\t\t\tcase 'meta_value':\n\t\t\t\tif ( ! empty( $primary_meta_query['type'] ) ) {\n\t\t\t\t\t$orderby_clause = \"CAST({$primary_meta_query['alias']}.meta_value AS {$primary_meta_query['cast']})\";\n\t\t\t\t} else {\n\t\t\t\t\t$orderby_clause = \"{$primary_meta_query['alias']}.meta_value\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'meta_value_num':\n\t\t\t\t$orderby_clause = \"{$primary_meta_query['alias']}.meta_value+0\";\n\t\t\t\tbreak;\n\t\t\tcase 'post__in':\n\t\t\t\tif ( ! empty( $this->query_vars['post__in'] ) ) {\n\t\t\t\t\t$orderby_clause = \"FIELD({$wpdb->posts}.ID,\" . implode( ',', array_map( 'absint', $this->query_vars['post__in'] ) ) . ')';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'post_parent__in':\n\t\t\t\tif ( ! empty( $this->query_vars['post_parent__in'] ) ) {\n\t\t\t\t\t$orderby_clause = \"FIELD( {$wpdb->posts}.post_parent,\" . implode( ', ', array_map( 'absint', $this->query_vars['post_parent__in'] ) ) . ' )';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'post_name__in':\n\t\t\t\tif ( ! empty( $this->query_vars['post_name__in'] ) ) {\n\t\t\t\t\t$post_name__in        = array_map( 'sanitize_title_for_query', $this->query_vars['post_name__in'] );\n\t\t\t\t\t$post_name__in_string = \"'\" . implode( \"','\", $post_name__in ) . \"'\";\n\t\t\t\t\t$orderby_clause       = \"FIELD( {$wpdb->posts}.post_name,\" . $post_name__in_string . ' )';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif ( array_key_exists( $orderby, $meta_clauses ) ) {\n\t\t\t\t\t// $orderby corresponds to a meta_query clause.\n\t\t\t\t\t$meta_clause    = $meta_clauses[ $orderby ];\n\t\t\t\t\t$orderby_clause = \"CAST({$meta_clause['alias']}.meta_value AS {$meta_clause['cast']})\";\n\t\t\t\t} elseif ( $rand_with_seed ) {\n\t\t\t\t\t$orderby_clause = $orderby;\n\t\t\t\t} else {\n\t\t\t\t\t// Default: order by post field.\n\t\t\t\t\t$orderby_clause = \"{$wpdb->posts}.post_\" . sanitize_key( $orderby );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $orderby_clause;\n\t}\n\n\t/**\n\t * Parse an 'order' query variable and cast it to ASC or DESC as necessary.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $order The 'order' query variable.\n\t * @return string The sanitized 'order' query variable.\n\t */\n\tprotected function parse_order( $order ) {\n\t\tif ( ! is_string( $order ) || empty( $order ) ) {\n\t\t\treturn 'DESC';\n\t\t}\n\n\t\tif ( 'ASC' === strtoupper( $order ) ) {\n\t\t\treturn 'ASC';\n\t\t} else {\n\t\t\treturn 'DESC';\n\t\t}\n\t}\n\n\t/**\n\t * Sets the 404 property and saves whether query is feed.\n\t *\n\t * @since 2.0.0\n\t */\n\tpublic function set_404() {\n\t\t$is_feed = $this->is_feed;\n\n\t\t$this->init_query_flags();\n\t\t$this->is_404 = true;\n\n\t\t$this->is_feed = $is_feed;\n\n\t\t/**\n\t\t * Fires after a 404 is triggered.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param WP_Query $this The WP_Query instance (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'set_404', array( $this ) );\n\t}\n\n\t/**\n\t * Retrieve query variable.\n\t *\n\t * @since 1.5.0\n\t * @since 3.9.0 The `$default` argument was introduced.\n\t *\n\t * @param string $query_var Query variable key.\n\t * @param mixed  $default   Optional. Value to return if the query variable is not set. Default empty.\n\t * @return mixed Contents of the query variable.\n\t */\n\tpublic function get( $query_var, $default = '' ) {\n\t\tif ( isset( $this->query_vars[ $query_var ] ) ) {\n\t\t\treturn $this->query_vars[ $query_var ];\n\t\t}\n\n\t\treturn $default;\n\t}\n\n\t/**\n\t * Set query variable.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $query_var Query variable key.\n\t * @param mixed  $value     Query variable value.\n\t */\n\tpublic function set( $query_var, $value ) {\n\t\t$this->query_vars[ $query_var ] = $value;\n\t}\n\n\t/**\n\t * Retrieves an array of posts based on query variables.\n\t *\n\t * There are a few filters and actions that can be used to modify the post\n\t * database query.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return WP_Post[]|int[] Array of post objects or post IDs.\n\t */\n\tpublic function get_posts() {\n\t\tglobal $wpdb;\n\n\t\t$this->parse_query();\n\n\t\t/**\n\t\t * Fires after the query variable object is created, but before the actual query is run.\n\t\t *\n\t\t * Note: If using conditional tags, use the method versions within the passed instance\n\t\t * (e.g. $this->is_main_query() instead of is_main_query()). This is because the functions\n\t\t * like is_main_query() test against the global $wp_query instance, not the passed one.\n\t\t *\n\t\t * @since 2.0.0\n\t\t *\n\t\t * @param WP_Query $this The WP_Query instance (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'pre_get_posts', array( &$this ) );\n\n\t\t// Shorthand.\n\t\t$q = &$this->query_vars;\n\n\t\t// Fill again in case 'pre_get_posts' unset some vars.\n\t\t$q = $this->fill_query_vars( $q );\n\n\t\t// Parse meta query.\n\t\t$this->meta_query = new WP_Meta_Query();\n\t\t$this->meta_query->parse_query_vars( $q );\n\n\t\t// Set a flag if a 'pre_get_posts' hook changed the query vars.\n\t\t$hash = md5( serialize( $this->query_vars ) );\n\t\tif ( $hash != $this->query_vars_hash ) {\n\t\t\t$this->query_vars_changed = true;\n\t\t\t$this->query_vars_hash    = $hash;\n\t\t}\n\t\tunset( $hash );\n\n\t\t// First let's clear some variables.\n\t\t$distinct         = '';\n\t\t$whichauthor      = '';\n\t\t$whichmimetype    = '';\n\t\t$where            = '';\n\t\t$limits           = '';\n\t\t$join             = '';\n\t\t$search           = '';\n\t\t$groupby          = '';\n\t\t$post_status_join = false;\n\t\t$page             = 1;\n\n\t\tif ( isset( $q['caller_get_posts'] ) ) {\n\t\t\t_deprecated_argument(\n\t\t\t\t'WP_Query',\n\t\t\t\t'3.1.0',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: caller_get_posts, 2: ignore_sticky_posts */\n\t\t\t\t\t__( '%1$s is deprecated. Use %2$s instead.' ),\n\t\t\t\t\t'<code>caller_get_posts</code>',\n\t\t\t\t\t'<code>ignore_sticky_posts</code>'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( ! isset( $q['ignore_sticky_posts'] ) ) {\n\t\t\t\t$q['ignore_sticky_posts'] = $q['caller_get_posts'];\n\t\t\t}\n\t\t}\n\n\t\tif ( ! isset( $q['ignore_sticky_posts'] ) ) {\n\t\t\t$q['ignore_sticky_posts'] = false;\n\t\t}\n\n\t\tif ( ! isset( $q['suppress_filters'] ) ) {\n\t\t\t$q['suppress_filters'] = false;\n\t\t}\n\n\t\tif ( ! isset( $q['cache_results'] ) ) {\n\t\t\tif ( wp_using_ext_object_cache() ) {\n\t\t\t\t$q['cache_results'] = false;\n\t\t\t} else {\n\t\t\t\t$q['cache_results'] = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! isset( $q['update_post_term_cache'] ) ) {\n\t\t\t$q['update_post_term_cache'] = true;\n\t\t}\n\n\t\tif ( ! isset( $q['lazy_load_term_meta'] ) ) {\n\t\t\t$q['lazy_load_term_meta'] = $q['update_post_term_cache'];\n\t\t}\n\n\t\tif ( ! isset( $q['update_post_meta_cache'] ) ) {\n\t\t\t$q['update_post_meta_cache'] = true;\n\t\t}\n\n\t\tif ( ! isset( $q['post_type'] ) ) {\n\t\t\tif ( $this->is_search ) {\n\t\t\t\t$q['post_type'] = 'any';\n\t\t\t} else {\n\t\t\t\t$q['post_type'] = '';\n\t\t\t}\n\t\t}\n\t\t$post_type = $q['post_type'];\n\t\tif ( empty( $q['posts_per_page'] ) ) {\n\t\t\t$q['posts_per_page'] = get_option( 'posts_per_page' );\n\t\t}\n\t\tif ( isset( $q['showposts'] ) && $q['showposts'] ) {\n\t\t\t$q['showposts']      = (int) $q['showposts'];\n\t\t\t$q['posts_per_page'] = $q['showposts'];\n\t\t}\n\t\tif ( ( isset( $q['posts_per_archive_page'] ) && 0 != $q['posts_per_archive_page'] ) && ( $this->is_archive || $this->is_search ) ) {\n\t\t\t$q['posts_per_page'] = $q['posts_per_archive_page'];\n\t\t}\n\t\tif ( ! isset( $q['nopaging'] ) ) {\n\t\t\tif ( -1 == $q['posts_per_page'] ) {\n\t\t\t\t$q['nopaging'] = true;\n\t\t\t} else {\n\t\t\t\t$q['nopaging'] = false;\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->is_feed ) {\n\t\t\t// This overrides 'posts_per_page'.\n\t\t\tif ( ! empty( $q['posts_per_rss'] ) ) {\n\t\t\t\t$q['posts_per_page'] = $q['posts_per_rss'];\n\t\t\t} else {\n\t\t\t\t$q['posts_per_page'] = get_option( 'posts_per_rss' );\n\t\t\t}\n\t\t\t$q['nopaging'] = false;\n\t\t}\n\t\t$q['posts_per_page'] = (int) $q['posts_per_page'];\n\t\tif ( $q['posts_per_page'] < -1 ) {\n\t\t\t$q['posts_per_page'] = abs( $q['posts_per_page'] );\n\t\t} elseif ( 0 == $q['posts_per_page'] ) {\n\t\t\t$q['posts_per_page'] = 1;\n\t\t}\n\n\t\tif ( ! isset( $q['comments_per_page'] ) || 0 == $q['comments_per_page'] ) {\n\t\t\t$q['comments_per_page'] = get_option( 'comments_per_page' );\n\t\t}\n\n\t\tif ( $this->is_home && ( empty( $this->query ) || 'true' === $q['preview'] ) && ( 'page' === get_option( 'show_on_front' ) ) && get_option( 'page_on_front' ) ) {\n\t\t\t$this->is_page = true;\n\t\t\t$this->is_home = false;\n\t\t\t$q['page_id']  = get_option( 'page_on_front' );\n\t\t}\n\n\t\tif ( isset( $q['page'] ) ) {\n\t\t\t$q['page'] = trim( $q['page'], '/' );\n\t\t\t$q['page'] = absint( $q['page'] );\n\t\t}\n\n\t\t// If true, forcibly turns off SQL_CALC_FOUND_ROWS even when limits are present.\n\t\tif ( isset( $q['no_found_rows'] ) ) {\n\t\t\t$q['no_found_rows'] = (bool) $q['no_found_rows'];\n\t\t} else {\n\t\t\t$q['no_found_rows'] = false;\n\t\t}\n\n\t\tswitch ( $q['fields'] ) {\n\t\t\tcase 'ids':\n\t\t\t\t$fields = \"{$wpdb->posts}.ID\";\n\t\t\t\tbreak;\n\t\t\tcase 'id=>parent':\n\t\t\t\t$fields = \"{$wpdb->posts}.ID, {$wpdb->posts}.post_parent\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$fields = \"{$wpdb->posts}.*\";\n\t\t}\n\n\t\tif ( '' !== $q['menu_order'] ) {\n\t\t\t$where .= \" AND {$wpdb->posts}.menu_order = \" . $q['menu_order'];\n\t\t}\n\t\t// The \"m\" parameter is meant for months but accepts datetimes of varying specificity.\n\t\tif ( $q['m'] ) {\n\t\t\t$where .= \" AND YEAR({$wpdb->posts}.post_date)=\" . substr( $q['m'], 0, 4 );\n\t\t\tif ( strlen( $q['m'] ) > 5 ) {\n\t\t\t\t$where .= \" AND MONTH({$wpdb->posts}.post_date)=\" . substr( $q['m'], 4, 2 );\n\t\t\t}\n\t\t\tif ( strlen( $q['m'] ) > 7 ) {\n\t\t\t\t$where .= \" AND DAYOFMONTH({$wpdb->posts}.post_date)=\" . substr( $q['m'], 6, 2 );\n\t\t\t}\n\t\t\tif ( strlen( $q['m'] ) > 9 ) {\n\t\t\t\t$where .= \" AND HOUR({$wpdb->posts}.post_date)=\" . substr( $q['m'], 8, 2 );\n\t\t\t}\n\t\t\tif ( strlen( $q['m'] ) > 11 ) {\n\t\t\t\t$where .= \" AND MINUTE({$wpdb->posts}.post_date)=\" . substr( $q['m'], 10, 2 );\n\t\t\t}\n\t\t\tif ( strlen( $q['m'] ) > 13 ) {\n\t\t\t\t$where .= \" AND SECOND({$wpdb->posts}.post_date)=\" . substr( $q['m'], 12, 2 );\n\t\t\t}\n\t\t}\n\n\t\t// Handle the other individual date parameters.\n\t\t$date_parameters = array();\n\n\t\tif ( '' !== $q['hour'] ) {\n\t\t\t$date_parameters['hour'] = $q['hour'];\n\t\t}\n\n\t\tif ( '' !== $q['minute'] ) {\n\t\t\t$date_parameters['minute'] = $q['minute'];\n\t\t}\n\n\t\tif ( '' !== $q['second'] ) {\n\t\t\t$date_parameters['second'] = $q['second'];\n\t\t}\n\n\t\tif ( $q['year'] ) {\n\t\t\t$date_parameters['year'] = $q['year'];\n\t\t}\n\n\t\tif ( $q['monthnum'] ) {\n\t\t\t$date_parameters['monthnum'] = $q['monthnum'];\n\t\t}\n\n\t\tif ( $q['w'] ) {\n\t\t\t$date_parameters['week'] = $q['w'];\n\t\t}\n\n\t\tif ( $q['day'] ) {\n\t\t\t$date_parameters['day'] = $q['day'];\n\t\t}\n\n\t\tif ( $date_parameters ) {\n\t\t\t$date_query = new WP_Date_Query( array( $date_parameters ) );\n\t\t\t$where     .= $date_query->get_sql();\n\t\t}\n\t\tunset( $date_parameters, $date_query );\n\n\t\t// Handle complex date queries.\n\t\tif ( ! empty( $q['date_query'] ) ) {\n\t\t\t$this->date_query = new WP_Date_Query( $q['date_query'] );\n\t\t\t$where           .= $this->date_query->get_sql();\n\t\t}\n\n\t\t// If we've got a post_type AND it's not \"any\" post_type.\n\t\tif ( ! empty( $q['post_type'] ) && 'any' !== $q['post_type'] ) {\n\t\t\tforeach ( (array) $q['post_type'] as $_post_type ) {\n\t\t\t\t$ptype_obj = get_post_type_object( $_post_type );\n\t\t\t\tif ( ! $ptype_obj || ! $ptype_obj->query_var || empty( $q[ $ptype_obj->query_var ] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( ! $ptype_obj->hierarchical ) {\n\t\t\t\t\t// Non-hierarchical post types can directly use 'name'.\n\t\t\t\t\t$q['name'] = $q[ $ptype_obj->query_var ];\n\t\t\t\t} else {\n\t\t\t\t\t// Hierarchical post types will operate through 'pagename'.\n\t\t\t\t\t$q['pagename'] = $q[ $ptype_obj->query_var ];\n\t\t\t\t\t$q['name']     = '';\n\t\t\t\t}\n\n\t\t\t\t// Only one request for a slug is possible, this is why name & pagename are overwritten above.\n\t\t\t\tbreak;\n\t\t\t} // End foreach.\n\t\t\tunset( $ptype_obj );\n\t\t}\n\n\t\tif ( '' !== $q['title'] ) {\n\t\t\t$where .= $wpdb->prepare( \" AND {$wpdb->posts}.post_title = %s\", stripslashes( $q['title'] ) );\n\t\t}\n\n\t\t// Parameters related to 'post_name'.\n\t\tif ( '' !== $q['name'] ) {\n\t\t\t$q['name'] = sanitize_title_for_query( $q['name'] );\n\t\t\t$where    .= \" AND {$wpdb->posts}.post_name = '\" . $q['name'] . \"'\";\n\t\t} elseif ( '' !== $q['pagename'] ) {\n\t\t\tif ( isset( $this->queried_object_id ) ) {\n\t\t\t\t$reqpage = $this->queried_object_id;\n\t\t\t} else {\n\t\t\t\tif ( 'page' !== $q['post_type'] ) {\n\t\t\t\t\tforeach ( (array) $q['post_type'] as $_post_type ) {\n\t\t\t\t\t\t$ptype_obj = get_post_type_object( $_post_type );\n\t\t\t\t\t\tif ( ! $ptype_obj || ! $ptype_obj->hierarchical ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$reqpage = get_page_by_path( $q['pagename'], OBJECT, $_post_type );\n\t\t\t\t\t\tif ( $reqpage ) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tunset( $ptype_obj );\n\t\t\t\t} else {\n\t\t\t\t\t$reqpage = get_page_by_path( $q['pagename'] );\n\t\t\t\t}\n\t\t\t\tif ( ! empty( $reqpage ) ) {\n\t\t\t\t\t$reqpage = $reqpage->ID;\n\t\t\t\t} else {\n\t\t\t\t\t$reqpage = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$page_for_posts = get_option( 'page_for_posts' );\n\t\t\tif ( ( 'page' !== get_option( 'show_on_front' ) ) || empty( $page_for_posts ) || ( $reqpage != $page_for_posts ) ) {\n\t\t\t\t$q['pagename'] = sanitize_title_for_query( wp_basename( $q['pagename'] ) );\n\t\t\t\t$q['name']     = $q['pagename'];\n\t\t\t\t$where        .= \" AND ({$wpdb->posts}.ID = '$reqpage')\";\n\t\t\t\t$reqpage_obj   = get_post( $reqpage );\n\t\t\t\tif ( is_object( $reqpage_obj ) && 'attachment' === $reqpage_obj->post_type ) {\n\t\t\t\t\t$this->is_attachment = true;\n\t\t\t\t\t$post_type           = 'attachment';\n\t\t\t\t\t$q['post_type']      = 'attachment';\n\t\t\t\t\t$this->is_page       = true;\n\t\t\t\t\t$q['attachment_id']  = $reqpage;\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( '' !== $q['attachment'] ) {\n\t\t\t$q['attachment'] = sanitize_title_for_query( wp_basename( $q['attachment'] ) );\n\t\t\t$q['name']       = $q['attachment'];\n\t\t\t$where          .= \" AND {$wpdb->posts}.post_name = '\" . $q['attachment'] . \"'\";\n\t\t} elseif ( is_array( $q['post_name__in'] ) && ! empty( $q['post_name__in'] ) ) {\n\t\t\t$q['post_name__in'] = array_map( 'sanitize_title_for_query', $q['post_name__in'] );\n\t\t\t$post_name__in      = \"'\" . implode( \"','\", $q['post_name__in'] ) . \"'\";\n\t\t\t$where             .= \" AND {$wpdb->posts}.post_name IN ($post_name__in)\";\n\t\t}\n\n\t\t// If an attachment is requested by number, let it supersede any post number.\n\t\tif ( $q['attachment_id'] ) {\n\t\t\t$q['p'] = absint( $q['attachment_id'] );\n\t\t}\n\n\t\t// If a post number is specified, load that post.\n\t\tif ( $q['p'] ) {\n\t\t\t$where .= \" AND {$wpdb->posts}.ID = \" . $q['p'];\n\t\t} elseif ( $q['post__in'] ) {\n\t\t\t$post__in = implode( ',', array_map( 'absint', $q['post__in'] ) );\n\t\t\t$where   .= \" AND {$wpdb->posts}.ID IN ($post__in)\";\n\t\t} elseif ( $q['post__not_in'] ) {\n\t\t\t$post__not_in = implode( ',', array_map( 'absint', $q['post__not_in'] ) );\n\t\t\t$where       .= \" AND {$wpdb->posts}.ID NOT IN ($post__not_in)\";\n\t\t}\n\n\t\tif ( is_numeric( $q['post_parent'] ) ) {\n\t\t\t$where .= $wpdb->prepare( \" AND {$wpdb->posts}.post_parent = %d \", $q['post_parent'] );\n\t\t} elseif ( $q['post_parent__in'] ) {\n\t\t\t$post_parent__in = implode( ',', array_map( 'absint', $q['post_parent__in'] ) );\n\t\t\t$where          .= \" AND {$wpdb->posts}.post_parent IN ($post_parent__in)\";\n\t\t} elseif ( $q['post_parent__not_in'] ) {\n\t\t\t$post_parent__not_in = implode( ',', array_map( 'absint', $q['post_parent__not_in'] ) );\n\t\t\t$where              .= \" AND {$wpdb->posts}.post_parent NOT IN ($post_parent__not_in)\";\n\t\t}\n\n\t\tif ( $q['page_id'] ) {\n\t\t\tif ( ( 'page' !== get_option( 'show_on_front' ) ) || ( get_option( 'page_for_posts' ) != $q['page_id'] ) ) {\n\t\t\t\t$q['p'] = $q['page_id'];\n\t\t\t\t$where  = \" AND {$wpdb->posts}.ID = \" . $q['page_id'];\n\t\t\t}\n\t\t}\n\n\t\t// If a search pattern is specified, load the posts that match.\n\t\tif ( strlen( $q['s'] ) ) {\n\t\t\t$search = $this->parse_search( $q );\n\t\t}\n\n\t\tif ( ! $q['suppress_filters'] ) {\n\t\t\t/**\n\t\t\t * Filters the search SQL that is used in the WHERE clause of WP_Query.\n\t\t\t *\n\t\t\t * @since 3.0.0\n\t\t\t *\n\t\t\t * @param string   $search Search SQL for WHERE clause.\n\t\t\t * @param WP_Query $this   The current WP_Query object.\n\t\t\t */\n\t\t\t$search = apply_filters_ref_array( 'posts_search', array( $search, &$this ) );\n\t\t}\n\n\t\t// Taxonomies.\n\t\tif ( ! $this->is_singular ) {\n\t\t\t$this->parse_tax_query( $q );\n\n\t\t\t$clauses = $this->tax_query->get_sql( $wpdb->posts, 'ID' );\n\n\t\t\t$join  .= $clauses['join'];\n\t\t\t$where .= $clauses['where'];\n\t\t}\n\n\t\tif ( $this->is_tax ) {\n\t\t\tif ( empty( $post_type ) ) {\n\t\t\t\t// Do a fully inclusive search for currently registered post types of queried taxonomies.\n\t\t\t\t$post_type  = array();\n\t\t\t\t$taxonomies = array_keys( $this->tax_query->queried_terms );\n\t\t\t\tforeach ( get_post_types( array( 'exclude_from_search' => false ) ) as $pt ) {\n\t\t\t\t\t$object_taxonomies = 'attachment' === $pt ? get_taxonomies_for_attachments() : get_object_taxonomies( $pt );\n\t\t\t\t\tif ( array_intersect( $taxonomies, $object_taxonomies ) ) {\n\t\t\t\t\t\t$post_type[] = $pt;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( ! $post_type ) {\n\t\t\t\t\t$post_type = 'any';\n\t\t\t\t} elseif ( count( $post_type ) == 1 ) {\n\t\t\t\t\t$post_type = $post_type[0];\n\t\t\t\t}\n\n\t\t\t\t$post_status_join = true;\n\t\t\t} elseif ( in_array( 'attachment', (array) $post_type, true ) ) {\n\t\t\t\t$post_status_join = true;\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Ensure that 'taxonomy', 'term', 'term_id', 'cat', and\n\t\t * 'category_name' vars are set for backward compatibility.\n\t\t */\n\t\tif ( ! empty( $this->tax_query->queried_terms ) ) {\n\n\t\t\t/*\n\t\t\t * Set 'taxonomy', 'term', and 'term_id' to the\n\t\t\t * first taxonomy other than 'post_tag' or 'category'.\n\t\t\t */\n\t\t\tif ( ! isset( $q['taxonomy'] ) ) {\n\t\t\t\tforeach ( $this->tax_query->queried_terms as $queried_taxonomy => $queried_items ) {\n\t\t\t\t\tif ( empty( $queried_items['terms'][0] ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! in_array( $queried_taxonomy, array( 'category', 'post_tag' ), true ) ) {\n\t\t\t\t\t\t$q['taxonomy'] = $queried_taxonomy;\n\n\t\t\t\t\t\tif ( 'slug' === $queried_items['field'] ) {\n\t\t\t\t\t\t\t$q['term'] = $queried_items['terms'][0];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$q['term_id'] = $queried_items['terms'][0];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Take the first one we find.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 'cat', 'category_name', 'tag_id'.\n\t\t\tforeach ( $this->tax_query->queried_terms as $queried_taxonomy => $queried_items ) {\n\t\t\t\tif ( empty( $queried_items['terms'][0] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( 'category' === $queried_taxonomy ) {\n\t\t\t\t\t$the_cat = get_term_by( $queried_items['field'], $queried_items['terms'][0], 'category' );\n\t\t\t\t\tif ( $the_cat ) {\n\t\t\t\t\t\t$this->set( 'cat', $the_cat->term_id );\n\t\t\t\t\t\t$this->set( 'category_name', $the_cat->slug );\n\t\t\t\t\t}\n\t\t\t\t\tunset( $the_cat );\n\t\t\t\t}\n\n\t\t\t\tif ( 'post_tag' === $queried_taxonomy ) {\n\t\t\t\t\t$the_tag = get_term_by( $queried_items['field'], $queried_items['terms'][0], 'post_tag' );\n\t\t\t\t\tif ( $the_tag ) {\n\t\t\t\t\t\t$this->set( 'tag_id', $the_tag->term_id );\n\t\t\t\t\t}\n\t\t\t\t\tunset( $the_tag );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $this->tax_query->queries ) || ! empty( $this->meta_query->queries ) ) {\n\t\t\t$groupby = \"{$wpdb->posts}.ID\";\n\t\t}\n\n\t\t// Author/user stuff.\n\n\t\tif ( ! empty( $q['author'] ) && '0' != $q['author'] ) {\n\t\t\t$q['author'] = addslashes_gpc( '' . urldecode( $q['author'] ) );\n\t\t\t$authors     = array_unique( array_map( 'intval', preg_split( '/[,\\s]+/', $q['author'] ) ) );\n\t\t\tforeach ( $authors as $author ) {\n\t\t\t\t$key         = $author > 0 ? 'author__in' : 'author__not_in';\n\t\t\t\t$q[ $key ][] = abs( $author );\n\t\t\t}\n\t\t\t$q['author'] = implode( ',', $authors );\n\t\t}\n\n\t\tif ( ! empty( $q['author__not_in'] ) ) {\n\t\t\t$author__not_in = implode( ',', array_map( 'absint', array_unique( (array) $q['author__not_in'] ) ) );\n\t\t\t$where         .= \" AND {$wpdb->posts}.post_author NOT IN ($author__not_in) \";\n\t\t} elseif ( ! empty( $q['author__in'] ) ) {\n\t\t\t$author__in = implode( ',', array_map( 'absint', array_unique( (array) $q['author__in'] ) ) );\n\t\t\t$where     .= \" AND {$wpdb->posts}.post_author IN ($author__in) \";\n\t\t}\n\n\t\t// Author stuff for nice URLs.\n\n\t\tif ( '' !== $q['author_name'] ) {\n\t\t\tif ( strpos( $q['author_name'], '/' ) !== false ) {\n\t\t\t\t$q['author_name'] = explode( '/', $q['author_name'] );\n\t\t\t\tif ( $q['author_name'][ count( $q['author_name'] ) - 1 ] ) {\n\t\t\t\t\t$q['author_name'] = $q['author_name'][ count( $q['author_name'] ) - 1 ]; // No trailing slash.\n\t\t\t\t} else {\n\t\t\t\t\t$q['author_name'] = $q['author_name'][ count( $q['author_name'] ) - 2 ]; // There was a trailing slash.\n\t\t\t\t}\n\t\t\t}\n\t\t\t$q['author_name'] = sanitize_title_for_query( $q['author_name'] );\n\t\t\t$q['author']      = get_user_by( 'slug', $q['author_name'] );\n\t\t\tif ( $q['author'] ) {\n\t\t\t\t$q['author'] = $q['author']->ID;\n\t\t\t}\n\t\t\t$whichauthor .= \" AND ({$wpdb->posts}.post_author = \" . absint( $q['author'] ) . ')';\n\t\t}\n\n\t\t// Matching by comment count.\n\t\tif ( isset( $q['comment_count'] ) ) {\n\t\t\t// Numeric comment count is converted to array format.\n\t\t\tif ( is_numeric( $q['comment_count'] ) ) {\n\t\t\t\t$q['comment_count'] = array(\n\t\t\t\t\t'value' => intval( $q['comment_count'] ),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( isset( $q['comment_count']['value'] ) ) {\n\t\t\t\t$q['comment_count'] = array_merge(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'compare' => '=',\n\t\t\t\t\t),\n\t\t\t\t\t$q['comment_count']\n\t\t\t\t);\n\n\t\t\t\t// Fallback for invalid compare operators is '='.\n\t\t\t\t$compare_operators = array( '=', '!=', '>', '>=', '<', '<=' );\n\t\t\t\tif ( ! in_array( $q['comment_count']['compare'], $compare_operators, true ) ) {\n\t\t\t\t\t$q['comment_count']['compare'] = '=';\n\t\t\t\t}\n\n\t\t\t\t$where .= $wpdb->prepare( \" AND {$wpdb->posts}.comment_count {$q['comment_count']['compare']} %d\", $q['comment_count']['value'] );\n\t\t\t}\n\t\t}\n\n\t\t// MIME-Type stuff for attachment browsing.\n\n\t\tif ( isset( $q['post_mime_type'] ) && '' !== $q['post_mime_type'] ) {\n\t\t\t$whichmimetype = wp_post_mime_type_where( $q['post_mime_type'], $wpdb->posts );\n\t\t}\n\t\t$where .= $search . $whichauthor . $whichmimetype;\n\n\t\tif ( ! empty( $this->meta_query->queries ) ) {\n\t\t\t$clauses = $this->meta_query->get_sql( 'post', $wpdb->posts, 'ID', $this );\n\t\t\t$join   .= $clauses['join'];\n\t\t\t$where  .= $clauses['where'];\n\t\t}\n\n\t\t$rand = ( isset( $q['orderby'] ) && 'rand' === $q['orderby'] );\n\t\tif ( ! isset( $q['order'] ) ) {\n\t\t\t$q['order'] = $rand ? '' : 'DESC';\n\t\t} else {\n\t\t\t$q['order'] = $rand ? '' : $this->parse_order( $q['order'] );\n\t\t}\n\n\t\t// These values of orderby should ignore the 'order' parameter.\n\t\t$force_asc = array( 'post__in', 'post_name__in', 'post_parent__in' );\n\t\tif ( isset( $q['orderby'] ) && in_array( $q['orderby'], $force_asc, true ) ) {\n\t\t\t$q['order'] = '';\n\t\t}\n\n\t\t// Order by.\n\t\tif ( empty( $q['orderby'] ) ) {\n\t\t\t/*\n\t\t\t * Boolean false or empty array blanks out ORDER BY,\n\t\t\t * while leaving the value unset or otherwise empty sets the default.\n\t\t\t */\n\t\t\tif ( isset( $q['orderby'] ) && ( is_array( $q['orderby'] ) || false === $q['orderby'] ) ) {\n\t\t\t\t$orderby = '';\n\t\t\t} else {\n\t\t\t\t$orderby = \"{$wpdb->posts}.post_date \" . $q['order'];\n\t\t\t}\n\t\t} elseif ( 'none' === $q['orderby'] ) {\n\t\t\t$orderby = '';\n\t\t} else {\n\t\t\t$orderby_array = array();\n\t\t\tif ( is_array( $q['orderby'] ) ) {\n\t\t\t\tforeach ( $q['orderby'] as $_orderby => $order ) {\n\t\t\t\t\t$orderby = addslashes_gpc( urldecode( $_orderby ) );\n\t\t\t\t\t$parsed  = $this->parse_orderby( $orderby );\n\n\t\t\t\t\tif ( ! $parsed ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$orderby_array[] = $parsed . ' ' . $this->parse_order( $order );\n\t\t\t\t}\n\t\t\t\t$orderby = implode( ', ', $orderby_array );\n\n\t\t\t} else {\n\t\t\t\t$q['orderby'] = urldecode( $q['orderby'] );\n\t\t\t\t$q['orderby'] = addslashes_gpc( $q['orderby'] );\n\n\t\t\t\tforeach ( explode( ' ', $q['orderby'] ) as $i => $orderby ) {\n\t\t\t\t\t$parsed = $this->parse_orderby( $orderby );\n\t\t\t\t\t// Only allow certain values for safety.\n\t\t\t\t\tif ( ! $parsed ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$orderby_array[] = $parsed;\n\t\t\t\t}\n\t\t\t\t$orderby = implode( ' ' . $q['order'] . ', ', $orderby_array );\n\n\t\t\t\tif ( empty( $orderby ) ) {\n\t\t\t\t\t$orderby = \"{$wpdb->posts}.post_date \" . $q['order'];\n\t\t\t\t} elseif ( ! empty( $q['order'] ) ) {\n\t\t\t\t\t$orderby .= \" {$q['order']}\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Order search results by relevance only when another \"orderby\" is not specified in the query.\n\t\tif ( ! empty( $q['s'] ) ) {\n\t\t\t$search_orderby = '';\n\t\t\tif ( ! empty( $q['search_orderby_title'] ) && ( empty( $q['orderby'] ) && ! $this->is_feed ) || ( isset( $q['orderby'] ) && 'relevance' === $q['orderby'] ) ) {\n\t\t\t\t$search_orderby = $this->parse_search_order( $q );\n\t\t\t}\n\n\t\t\tif ( ! $q['suppress_filters'] ) {\n\t\t\t\t/**\n\t\t\t\t * Filters the ORDER BY used when ordering search results.\n\t\t\t\t *\n\t\t\t\t * @since 3.7.0\n\t\t\t\t *\n\t\t\t\t * @param string   $search_orderby The ORDER BY clause.\n\t\t\t\t * @param WP_Query $this           The current WP_Query instance.\n\t\t\t\t */\n\t\t\t\t$search_orderby = apply_filters( 'posts_search_orderby', $search_orderby, $this );\n\t\t\t}\n\n\t\t\tif ( $search_orderby ) {\n\t\t\t\t$orderby = $orderby ? $search_orderby . ', ' . $orderby : $search_orderby;\n\t\t\t}\n\t\t}\n\n\t\tif ( is_array( $post_type ) && count( $post_type ) > 1 ) {\n\t\t\t$post_type_cap = 'multiple_post_type';\n\t\t} else {\n\t\t\tif ( is_array( $post_type ) ) {\n\t\t\t\t$post_type = reset( $post_type );\n\t\t\t}\n\t\t\t$post_type_object = get_post_type_object( $post_type );\n\t\t\tif ( empty( $post_type_object ) ) {\n\t\t\t\t$post_type_cap = $post_type;\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $q['post_password'] ) ) {\n\t\t\t$where .= $wpdb->prepare( \" AND {$wpdb->posts}.post_password = %s\", $q['post_password'] );\n\t\t\tif ( empty( $q['perm'] ) ) {\n\t\t\t\t$q['perm'] = 'readable';\n\t\t\t}\n\t\t} elseif ( isset( $q['has_password'] ) ) {\n\t\t\t$where .= sprintf( \" AND {$wpdb->posts}.post_password %s ''\", $q['has_password'] ? '!=' : '=' );\n\t\t}\n\n\t\tif ( ! empty( $q['comment_status'] ) ) {\n\t\t\t$where .= $wpdb->prepare( \" AND {$wpdb->posts}.comment_status = %s \", $q['comment_status'] );\n\t\t}\n\n\t\tif ( ! empty( $q['ping_status'] ) ) {\n\t\t\t$where .= $wpdb->prepare( \" AND {$wpdb->posts}.ping_status = %s \", $q['ping_status'] );\n\t\t}\n\n\t\tif ( 'any' === $post_type ) {\n\t\t\t$in_search_post_types = get_post_types( array( 'exclude_from_search' => false ) );\n\t\t\tif ( empty( $in_search_post_types ) ) {\n\t\t\t\t$where .= ' AND 1=0 ';\n\t\t\t} else {\n\t\t\t\t$where .= \" AND {$wpdb->posts}.post_type IN ('\" . join( \"', '\", array_map( 'esc_sql', $in_search_post_types ) ) . \"')\";\n\t\t\t}\n\t\t} elseif ( ! empty( $post_type ) && is_array( $post_type ) ) {\n\t\t\t$where .= \" AND {$wpdb->posts}.post_type IN ('\" . join( \"', '\", esc_sql( $post_type ) ) . \"')\";\n\t\t} elseif ( ! empty( $post_type ) ) {\n\t\t\t$where           .= $wpdb->prepare( \" AND {$wpdb->posts}.post_type = %s\", $post_type );\n\t\t\t$post_type_object = get_post_type_object( $post_type );\n\t\t} elseif ( $this->is_attachment ) {\n\t\t\t$where           .= \" AND {$wpdb->posts}.post_type = 'attachment'\";\n\t\t\t$post_type_object = get_post_type_object( 'attachment' );\n\t\t} elseif ( $this->is_page ) {\n\t\t\t$where           .= \" AND {$wpdb->posts}.post_type = 'page'\";\n\t\t\t$post_type_object = get_post_type_object( 'page' );\n\t\t} else {\n\t\t\t$where           .= \" AND {$wpdb->posts}.post_type = 'post'\";\n\t\t\t$post_type_object = get_post_type_object( 'post' );\n\t\t}\n\n\t\t$edit_cap = 'edit_post';\n\t\t$read_cap = 'read_post';\n\n\t\tif ( ! empty( $post_type_object ) ) {\n\t\t\t$edit_others_cap  = $post_type_object->cap->edit_others_posts;\n\t\t\t$read_private_cap = $post_type_object->cap->read_private_posts;\n\t\t} else {\n\t\t\t$edit_others_cap  = 'edit_others_' . $post_type_cap . 's';\n\t\t\t$read_private_cap = 'read_private_' . $post_type_cap . 's';\n\t\t}\n\n\t\t$user_id = get_current_user_id();\n\n\t\t$q_status = array();\n\t\tif ( ! empty( $q['post_status'] ) ) {\n\t\t\t$statuswheres = array();\n\t\t\t$q_status     = $q['post_status'];\n\t\t\tif ( ! is_array( $q_status ) ) {\n\t\t\t\t$q_status = explode( ',', $q_status );\n\t\t\t}\n\t\t\t$r_status = array();\n\t\t\t$p_status = array();\n\t\t\t$e_status = array();\n\t\t\tif ( in_array( 'any', $q_status, true ) ) {\n\t\t\t\tforeach ( get_post_stati( array( 'exclude_from_search' => true ) ) as $status ) {\n\t\t\t\t\tif ( ! in_array( $status, $q_status, true ) ) {\n\t\t\t\t\t\t$e_status[] = \"{$wpdb->posts}.post_status <> '$status'\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tforeach ( get_post_stati() as $status ) {\n\t\t\t\t\tif ( in_array( $status, $q_status, true ) ) {\n\t\t\t\t\t\tif ( 'private' === $status ) {\n\t\t\t\t\t\t\t$p_status[] = \"{$wpdb->posts}.post_status = '$status'\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$r_status[] = \"{$wpdb->posts}.post_status = '$status'\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( empty( $q['perm'] ) || 'readable' !== $q['perm'] ) {\n\t\t\t\t$r_status = array_merge( $r_status, $p_status );\n\t\t\t\tunset( $p_status );\n\t\t\t}\n\n\t\t\tif ( ! empty( $e_status ) ) {\n\t\t\t\t$statuswheres[] = '(' . join( ' AND ', $e_status ) . ')';\n\t\t\t}\n\t\t\tif ( ! empty( $r_status ) ) {\n\t\t\t\tif ( ! empty( $q['perm'] ) && 'editable' === $q['perm'] && ! current_user_can( $edit_others_cap ) ) {\n\t\t\t\t\t$statuswheres[] = \"({$wpdb->posts}.post_author = $user_id \" . 'AND (' . join( ' OR ', $r_status ) . '))';\n\t\t\t\t} else {\n\t\t\t\t\t$statuswheres[] = '(' . join( ' OR ', $r_status ) . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! empty( $p_status ) ) {\n\t\t\t\tif ( ! empty( $q['perm'] ) && 'readable' === $q['perm'] && ! current_user_can( $read_private_cap ) ) {\n\t\t\t\t\t$statuswheres[] = \"({$wpdb->posts}.post_author = $user_id \" . 'AND (' . join( ' OR ', $p_status ) . '))';\n\t\t\t\t} else {\n\t\t\t\t\t$statuswheres[] = '(' . join( ' OR ', $p_status ) . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( $post_status_join ) {\n\t\t\t\t$join .= \" LEFT JOIN {$wpdb->posts} AS p2 ON ({$wpdb->posts}.post_parent = p2.ID) \";\n\t\t\t\tforeach ( $statuswheres as $index => $statuswhere ) {\n\t\t\t\t\t$statuswheres[ $index ] = \"($statuswhere OR ({$wpdb->posts}.post_status = 'inherit' AND \" . str_replace( $wpdb->posts, 'p2', $statuswhere ) . '))';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$where_status = implode( ' OR ', $statuswheres );\n\t\t\tif ( ! empty( $where_status ) ) {\n\t\t\t\t$where .= \" AND ($where_status)\";\n\t\t\t}\n\t\t} elseif ( ! $this->is_singular ) {\n\t\t\t$where .= \" AND ({$wpdb->posts}.post_status = 'publish'\";\n\n\t\t\t// Add public states.\n\t\t\t$public_states = get_post_stati( array( 'public' => true ) );\n\t\t\tforeach ( (array) $public_states as $state ) {\n\t\t\t\tif ( 'publish' === $state ) { // Publish is hard-coded above.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$where .= \" OR {$wpdb->posts}.post_status = '$state'\";\n\t\t\t}\n\n\t\t\tif ( $this->is_admin ) {\n\t\t\t\t// Add protected states that should show in the admin all list.\n\t\t\t\t$admin_all_states = get_post_stati(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'protected'              => true,\n\t\t\t\t\t\t'show_in_admin_all_list' => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tforeach ( (array) $admin_all_states as $state ) {\n\t\t\t\t\t$where .= \" OR {$wpdb->posts}.post_status = '$state'\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( is_user_logged_in() ) {\n\t\t\t\t// Add private states that are limited to viewing by the author of a post or someone who has caps to read private states.\n\t\t\t\t$private_states = get_post_stati( array( 'private' => true ) );\n\t\t\t\tforeach ( (array) $private_states as $state ) {\n\t\t\t\t\t$where .= current_user_can( $read_private_cap ) ? \" OR {$wpdb->posts}.post_status = '$state'\" : \" OR {$wpdb->posts}.post_author = $user_id AND {$wpdb->posts}.post_status = '$state'\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$where .= ')';\n\t\t}\n\n\t\t/*\n\t\t * Apply filters on where and join prior to paging so that any\n\t\t * manipulations to them are reflected in the paging by day queries.\n\t\t */\n\t\tif ( ! $q['suppress_filters'] ) {\n\t\t\t/**\n\t\t\t * Filters the WHERE clause of the query.\n\t\t\t *\n\t\t\t * @since 1.5.0\n\t\t\t *\n\t\t\t * @param string   $where The WHERE clause of the query.\n\t\t\t * @param WP_Query $this The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$where = apply_filters_ref_array( 'posts_where', array( $where, &$this ) );\n\n\t\t\t/**\n\t\t\t * Filters the JOIN clause of the query.\n\t\t\t *\n\t\t\t * @since 1.5.0\n\t\t\t *\n\t\t\t * @param string   $join  The JOIN clause of the query.\n\t\t\t * @param WP_Query $this The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$join = apply_filters_ref_array( 'posts_join', array( $join, &$this ) );\n\t\t}\n\n\t\t// Paging.\n\t\tif ( empty( $q['nopaging'] ) && ! $this->is_singular ) {\n\t\t\t$page = absint( $q['paged'] );\n\t\t\tif ( ! $page ) {\n\t\t\t\t$page = 1;\n\t\t\t}\n\n\t\t\t// If 'offset' is provided, it takes precedence over 'paged'.\n\t\t\tif ( isset( $q['offset'] ) && is_numeric( $q['offset'] ) ) {\n\t\t\t\t$q['offset'] = absint( $q['offset'] );\n\t\t\t\t$pgstrt      = $q['offset'] . ', ';\n\t\t\t} else {\n\t\t\t\t$pgstrt = absint( ( $page - 1 ) * $q['posts_per_page'] ) . ', ';\n\t\t\t}\n\t\t\t$limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];\n\t\t}\n\n\t\t// Comments feeds.\n\t\tif ( $this->is_comment_feed && ! $this->is_singular ) {\n\t\t\tif ( $this->is_archive || $this->is_search ) {\n\t\t\t\t$cjoin    = \"JOIN {$wpdb->posts} ON ({$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID) $join \";\n\t\t\t\t$cwhere   = \"WHERE comment_approved = '1' $where\";\n\t\t\t\t$cgroupby = \"{$wpdb->comments}.comment_id\";\n\t\t\t} else { // Other non-singular, e.g. front.\n\t\t\t\t$cjoin    = \"JOIN {$wpdb->posts} ON ( {$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID )\";\n\t\t\t\t$cwhere   = \"WHERE ( post_status = 'publish' OR ( post_status = 'inherit' AND post_type = 'attachment' ) ) AND comment_approved = '1'\";\n\t\t\t\t$cgroupby = '';\n\t\t\t}\n\n\t\t\tif ( ! $q['suppress_filters'] ) {\n\t\t\t\t/**\n\t\t\t\t * Filters the JOIN clause of the comments feed query before sending.\n\t\t\t\t *\n\t\t\t\t * @since 2.2.0\n\t\t\t\t *\n\t\t\t\t * @param string   $cjoin The JOIN clause of the query.\n\t\t\t\t * @param WP_Query $this The WP_Query instance (passed by reference).\n\t\t\t\t */\n\t\t\t\t$cjoin = apply_filters_ref_array( 'comment_feed_join', array( $cjoin, &$this ) );\n\n\t\t\t\t/**\n\t\t\t\t * Filters the WHERE clause of the comments feed query before sending.\n\t\t\t\t *\n\t\t\t\t * @since 2.2.0\n\t\t\t\t *\n\t\t\t\t * @param string   $cwhere The WHERE clause of the query.\n\t\t\t\t * @param WP_Query $this   The WP_Query instance (passed by reference).\n\t\t\t\t */\n\t\t\t\t$cwhere = apply_filters_ref_array( 'comment_feed_where', array( $cwhere, &$this ) );\n\n\t\t\t\t/**\n\t\t\t\t * Filters the GROUP BY clause of the comments feed query before sending.\n\t\t\t\t *\n\t\t\t\t * @since 2.2.0\n\t\t\t\t *\n\t\t\t\t * @param string   $cgroupby The GROUP BY clause of the query.\n\t\t\t\t * @param WP_Query $this     The WP_Query instance (passed by reference).\n\t\t\t\t */\n\t\t\t\t$cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( $cgroupby, &$this ) );\n\n\t\t\t\t/**\n\t\t\t\t * Filters the ORDER BY clause of the comments feed query before sending.\n\t\t\t\t *\n\t\t\t\t * @since 2.8.0\n\t\t\t\t *\n\t\t\t\t * @param string   $corderby The ORDER BY clause of the query.\n\t\t\t\t * @param WP_Query $this     The WP_Query instance (passed by reference).\n\t\t\t\t */\n\t\t\t\t$corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );\n\n\t\t\t\t/**\n\t\t\t\t * Filters the LIMIT clause of the comments feed query before sending.\n\t\t\t\t *\n\t\t\t\t * @since 2.8.0\n\t\t\t\t *\n\t\t\t\t * @param string   $climits The JOIN clause of the query.\n\t\t\t\t * @param WP_Query $this    The WP_Query instance (passed by reference).\n\t\t\t\t */\n\t\t\t\t$climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option( 'posts_per_rss' ), &$this ) );\n\t\t\t}\n\n\t\t\t$cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';\n\t\t\t$corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';\n\t\t\t$climits  = ( ! empty( $climits ) ) ? $climits : '';\n\n\t\t\t$comments = (array) $wpdb->get_results( \"SELECT $distinct {$wpdb->comments}.* FROM {$wpdb->comments} $cjoin $cwhere $cgroupby $corderby $climits\" );\n\t\t\t// Convert to WP_Comment.\n\t\t\t$this->comments      = array_map( 'get_comment', $comments );\n\t\t\t$this->comment_count = count( $this->comments );\n\n\t\t\t$post_ids = array();\n\n\t\t\tforeach ( $this->comments as $comment ) {\n\t\t\t\t$post_ids[] = (int) $comment->comment_post_ID;\n\t\t\t}\n\n\t\t\t$post_ids = join( ',', $post_ids );\n\t\t\t$join     = '';\n\t\t\tif ( $post_ids ) {\n\t\t\t\t$where = \"AND {$wpdb->posts}.ID IN ($post_ids) \";\n\t\t\t} else {\n\t\t\t\t$where = 'AND 0';\n\t\t\t}\n\t\t}\n\n\t\t$pieces = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );\n\n\t\t/*\n\t\t * Apply post-paging filters on where and join. Only plugins that\n\t\t * manipulate paging queries should use these hooks.\n\t\t */\n\t\tif ( ! $q['suppress_filters'] ) {\n\t\t\t/**\n\t\t\t * Filters the WHERE clause of the query.\n\t\t\t *\n\t\t\t * Specifically for manipulating paging queries.\n\t\t\t *\n\t\t\t * @since 1.5.0\n\t\t\t *\n\t\t\t * @param string   $where The WHERE clause of the query.\n\t\t\t * @param WP_Query $this The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$where = apply_filters_ref_array( 'posts_where_paged', array( $where, &$this ) );\n\n\t\t\t/**\n\t\t\t * Filters the GROUP BY clause of the query.\n\t\t\t *\n\t\t\t * @since 2.0.0\n\t\t\t *\n\t\t\t * @param string   $groupby The GROUP BY clause of the query.\n\t\t\t * @param WP_Query $this    The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$groupby = apply_filters_ref_array( 'posts_groupby', array( $groupby, &$this ) );\n\n\t\t\t/**\n\t\t\t * Filters the JOIN clause of the query.\n\t\t\t *\n\t\t\t * Specifically for manipulating paging queries.\n\t\t\t *\n\t\t\t * @since 1.5.0\n\t\t\t *\n\t\t\t * @param string   $join  The JOIN clause of the query.\n\t\t\t * @param WP_Query $this The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$join = apply_filters_ref_array( 'posts_join_paged', array( $join, &$this ) );\n\n\t\t\t/**\n\t\t\t * Filters the ORDER BY clause of the query.\n\t\t\t *\n\t\t\t * @since 1.5.1\n\t\t\t *\n\t\t\t * @param string   $orderby The ORDER BY clause of the query.\n\t\t\t * @param WP_Query $this    The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$orderby = apply_filters_ref_array( 'posts_orderby', array( $orderby, &$this ) );\n\n\t\t\t/**\n\t\t\t * Filters the DISTINCT clause of the query.\n\t\t\t *\n\t\t\t * @since 2.1.0\n\t\t\t *\n\t\t\t * @param string   $distinct The DISTINCT clause of the query.\n\t\t\t * @param WP_Query $this     The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$distinct = apply_filters_ref_array( 'posts_distinct', array( $distinct, &$this ) );\n\n\t\t\t/**\n\t\t\t * Filters the LIMIT clause of the query.\n\t\t\t *\n\t\t\t * @since 2.1.0\n\t\t\t *\n\t\t\t * @param string   $limits The LIMIT clause of the query.\n\t\t\t * @param WP_Query $this   The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$limits = apply_filters_ref_array( 'post_limits', array( $limits, &$this ) );\n\n\t\t\t/**\n\t\t\t * Filters the SELECT clause of the query.\n\t\t\t *\n\t\t\t * @since 2.1.0\n\t\t\t *\n\t\t\t * @param string   $fields The SELECT clause of the query.\n\t\t\t * @param WP_Query $this   The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$fields = apply_filters_ref_array( 'posts_fields', array( $fields, &$this ) );\n\n\t\t\t/**\n\t\t\t * Filters all query clauses at once, for convenience.\n\t\t\t *\n\t\t\t * Covers the WHERE, GROUP BY, JOIN, ORDER BY, DISTINCT,\n\t\t\t * fields (SELECT), and LIMITS clauses.\n\t\t\t *\n\t\t\t * @since 3.1.0\n\t\t\t *\n\t\t\t * @param string[] $clauses Associative array of the clauses for the query.\n\t\t\t * @param WP_Query $this    The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) );\n\n\t\t\t$where    = isset( $clauses['where'] ) ? $clauses['where'] : '';\n\t\t\t$groupby  = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';\n\t\t\t$join     = isset( $clauses['join'] ) ? $clauses['join'] : '';\n\t\t\t$orderby  = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';\n\t\t\t$distinct = isset( $clauses['distinct'] ) ? $clauses['distinct'] : '';\n\t\t\t$fields   = isset( $clauses['fields'] ) ? $clauses['fields'] : '';\n\t\t\t$limits   = isset( $clauses['limits'] ) ? $clauses['limits'] : '';\n\t\t}\n\n\t\t/**\n\t\t * Fires to announce the query's current selection parameters.\n\t\t *\n\t\t * For use by caching plugins.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param string $selection The assembled selection query.\n\t\t */\n\t\tdo_action( 'posts_selection', $where . $groupby . $orderby . $limits . $join );\n\n\t\t/*\n\t\t * Filters again for the benefit of caching plugins.\n\t\t * Regular plugins should use the hooks above.\n\t\t */\n\t\tif ( ! $q['suppress_filters'] ) {\n\t\t\t/**\n\t\t\t * Filters the WHERE clause of the query.\n\t\t\t *\n\t\t\t * For use by caching plugins.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t *\n\t\t\t * @param string   $where The WHERE clause of the query.\n\t\t\t * @param WP_Query $this The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$where = apply_filters_ref_array( 'posts_where_request', array( $where, &$this ) );\n\n\t\t\t/**\n\t\t\t * Filters the GROUP BY clause of the query.\n\t\t\t *\n\t\t\t * For use by caching plugins.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t *\n\t\t\t * @param string   $groupby The GROUP BY clause of the query.\n\t\t\t * @param WP_Query $this    The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$groupby = apply_filters_ref_array( 'posts_groupby_request', array( $groupby, &$this ) );\n\n\t\t\t/**\n\t\t\t * Filters the JOIN clause of the query.\n\t\t\t *\n\t\t\t * For use by caching plugins.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t *\n\t\t\t * @param string   $join  The JOIN clause of the query.\n\t\t\t * @param WP_Query $this The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$join = apply_filters_ref_array( 'posts_join_request', array( $join, &$this ) );\n\n\t\t\t/**\n\t\t\t * Filters the ORDER BY clause of the query.\n\t\t\t *\n\t\t\t * For use by caching plugins.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t *\n\t\t\t * @param string   $orderby The ORDER BY clause of the query.\n\t\t\t * @param WP_Query $this    The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$orderby = apply_filters_ref_array( 'posts_orderby_request', array( $orderby, &$this ) );\n\n\t\t\t/**\n\t\t\t * Filters the DISTINCT clause of the query.\n\t\t\t *\n\t\t\t * For use by caching plugins.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t *\n\t\t\t * @param string   $distinct The DISTINCT clause of the query.\n\t\t\t * @param WP_Query $this     The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$distinct = apply_filters_ref_array( 'posts_distinct_request', array( $distinct, &$this ) );\n\n\t\t\t/**\n\t\t\t * Filters the SELECT clause of the query.\n\t\t\t *\n\t\t\t * For use by caching plugins.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t *\n\t\t\t * @param string   $fields The SELECT clause of the query.\n\t\t\t * @param WP_Query $this   The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$fields = apply_filters_ref_array( 'posts_fields_request', array( $fields, &$this ) );\n\n\t\t\t/**\n\t\t\t * Filters the LIMIT clause of the query.\n\t\t\t *\n\t\t\t * For use by caching plugins.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t *\n\t\t\t * @param string   $limits The LIMIT clause of the query.\n\t\t\t * @param WP_Query $this   The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$limits = apply_filters_ref_array( 'post_limits_request', array( $limits, &$this ) );\n\n\t\t\t/**\n\t\t\t * Filters all query clauses at once, for convenience.\n\t\t\t *\n\t\t\t * For use by caching plugins.\n\t\t\t *\n\t\t\t * Covers the WHERE, GROUP BY, JOIN, ORDER BY, DISTINCT,\n\t\t\t * fields (SELECT), and LIMITS clauses.\n\t\t\t *\n\t\t\t * @since 3.1.0\n\t\t\t *\n\t\t\t * @param string[] $pieces Associative array of the pieces of the query.\n\t\t\t * @param WP_Query $this   The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $pieces ), &$this ) );\n\n\t\t\t$where    = isset( $clauses['where'] ) ? $clauses['where'] : '';\n\t\t\t$groupby  = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';\n\t\t\t$join     = isset( $clauses['join'] ) ? $clauses['join'] : '';\n\t\t\t$orderby  = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';\n\t\t\t$distinct = isset( $clauses['distinct'] ) ? $clauses['distinct'] : '';\n\t\t\t$fields   = isset( $clauses['fields'] ) ? $clauses['fields'] : '';\n\t\t\t$limits   = isset( $clauses['limits'] ) ? $clauses['limits'] : '';\n\t\t}\n\n\t\tif ( ! empty( $groupby ) ) {\n\t\t\t$groupby = 'GROUP BY ' . $groupby;\n\t\t}\n\t\tif ( ! empty( $orderby ) ) {\n\t\t\t$orderby = 'ORDER BY ' . $orderby;\n\t\t}\n\n\t\t$found_rows = '';\n\t\tif ( ! $q['no_found_rows'] && ! empty( $limits ) ) {\n\t\t\t$found_rows = 'SQL_CALC_FOUND_ROWS';\n\t\t}\n\n\t\t$old_request   = \"SELECT $found_rows $distinct $fields FROM {$wpdb->posts} $join WHERE 1=1 $where $groupby $orderby $limits\";\n\t\t$this->request = $old_request;\n\n\t\tif ( ! $q['suppress_filters'] ) {\n\t\t\t/**\n\t\t\t * Filters the completed SQL query before sending.\n\t\t\t *\n\t\t\t * @since 2.0.0\n\t\t\t *\n\t\t\t * @param string   $request The complete SQL query.\n\t\t\t * @param WP_Query $this    The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$this->request = apply_filters_ref_array( 'posts_request', array( $this->request, &$this ) );\n\t\t}\n\n\t\t/**\n\t\t * Filters the posts array before the query takes place.\n\t\t *\n\t\t * Return a non-null value to bypass WordPress's default post queries.\n\t\t *\n\t\t * Filtering functions that require pagination information are encouraged to set\n\t\t * the `found_posts` and `max_num_pages` properties of the WP_Query object,\n\t\t * passed to the filter by reference. If WP_Query does not perform a database\n\t\t * query, it will not have enough information to generate these values itself.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param array|null $posts Return an array of post data to short-circuit WP's query,\n\t\t *                          or null to allow WP to run its normal queries.\n\t\t * @param WP_Query   $this  The WP_Query instance (passed by reference).\n\t\t */\n\t\t$this->posts = apply_filters_ref_array( 'posts_pre_query', array( null, &$this ) );\n\n\t\tif ( 'ids' === $q['fields'] ) {\n\t\t\tif ( null === $this->posts ) {\n\t\t\t\t$this->posts = $wpdb->get_col( $this->request );\n\t\t\t}\n\n\t\t\t$this->posts      = array_map( 'intval', $this->posts );\n\t\t\t$this->post_count = count( $this->posts );\n\t\t\t$this->set_found_posts( $q, $limits );\n\n\t\t\treturn $this->posts;\n\t\t}\n\n\t\tif ( 'id=>parent' === $q['fields'] ) {\n\t\t\tif ( null === $this->posts ) {\n\t\t\t\t$this->posts = $wpdb->get_results( $this->request );\n\t\t\t}\n\n\t\t\t$this->post_count = count( $this->posts );\n\t\t\t$this->set_found_posts( $q, $limits );\n\n\t\t\t$r = array();\n\t\t\tforeach ( $this->posts as $key => $post ) {\n\t\t\t\t$this->posts[ $key ]->ID          = (int) $post->ID;\n\t\t\t\t$this->posts[ $key ]->post_parent = (int) $post->post_parent;\n\n\t\t\t\t$r[ (int) $post->ID ] = (int) $post->post_parent;\n\t\t\t}\n\n\t\t\treturn $r;\n\t\t}\n\n\t\tif ( null === $this->posts ) {\n\t\t\t$split_the_query = ( $old_request == $this->request && \"{$wpdb->posts}.*\" === $fields && ! empty( $limits ) && $q['posts_per_page'] < 500 );\n\n\t\t\t/**\n\t\t\t * Filters whether to split the query.\n\t\t\t *\n\t\t\t * Splitting the query will cause it to fetch just the IDs of the found posts\n\t\t\t * (and then individually fetch each post by ID), rather than fetching every\n\t\t\t * complete row at once. One massive result vs. many small results.\n\t\t\t *\n\t\t\t * @since 3.4.0\n\t\t\t *\n\t\t\t * @param bool     $split_the_query Whether or not to split the query.\n\t\t\t * @param WP_Query $this            The WP_Query instance.\n\t\t\t */\n\t\t\t$split_the_query = apply_filters( 'split_the_query', $split_the_query, $this );\n\n\t\t\tif ( $split_the_query ) {\n\t\t\t\t// First get the IDs and then fill in the objects.\n\n\t\t\t\t$this->request = \"SELECT $found_rows $distinct {$wpdb->posts}.ID FROM {$wpdb->posts} $join WHERE 1=1 $where $groupby $orderby $limits\";\n\n\t\t\t\t/**\n\t\t\t\t * Filters the Post IDs SQL request before sending.\n\t\t\t\t *\n\t\t\t\t * @since 3.4.0\n\t\t\t\t *\n\t\t\t\t * @param string   $request The post ID request.\n\t\t\t\t * @param WP_Query $this    The WP_Query instance.\n\t\t\t\t */\n\t\t\t\t$this->request = apply_filters( 'posts_request_ids', $this->request, $this );\n\n\t\t\t\t$ids = $wpdb->get_col( $this->request );\n\n\t\t\t\tif ( $ids ) {\n\t\t\t\t\t$this->posts = $ids;\n\t\t\t\t\t$this->set_found_posts( $q, $limits );\n\t\t\t\t\t_prime_post_caches( $ids, $q['update_post_term_cache'], $q['update_post_meta_cache'] );\n\t\t\t\t} else {\n\t\t\t\t\t$this->posts = array();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->posts = $wpdb->get_results( $this->request );\n\t\t\t\t$this->set_found_posts( $q, $limits );\n\t\t\t}\n\t\t}\n\n\t\t// Convert to WP_Post objects.\n\t\tif ( $this->posts ) {\n\t\t\t$this->posts = array_map( 'get_post', $this->posts );\n\t\t}\n\n\t\tif ( ! $q['suppress_filters'] ) {\n\t\t\t/**\n\t\t\t * Filters the raw post results array, prior to status checks.\n\t\t\t *\n\t\t\t * @since 2.3.0\n\t\t\t *\n\t\t\t * @param WP_Post[] $posts Array of post objects.\n\t\t\t * @param WP_Query  $this  The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$this->posts = apply_filters_ref_array( 'posts_results', array( $this->posts, &$this ) );\n\t\t}\n\n\t\tif ( ! empty( $this->posts ) && $this->is_comment_feed && $this->is_singular ) {\n\t\t\t/** This filter is documented in wp-includes/query.php */\n\t\t\t$cjoin = apply_filters_ref_array( 'comment_feed_join', array( '', &$this ) );\n\n\t\t\t/** This filter is documented in wp-includes/query.php */\n\t\t\t$cwhere = apply_filters_ref_array( 'comment_feed_where', array( \"WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'\", &$this ) );\n\n\t\t\t/** This filter is documented in wp-includes/query.php */\n\t\t\t$cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( '', &$this ) );\n\t\t\t$cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';\n\n\t\t\t/** This filter is documented in wp-includes/query.php */\n\t\t\t$corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );\n\t\t\t$corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';\n\n\t\t\t/** This filter is documented in wp-includes/query.php */\n\t\t\t$climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option( 'posts_per_rss' ), &$this ) );\n\n\t\t\t$comments_request = \"SELECT {$wpdb->comments}.* FROM {$wpdb->comments} $cjoin $cwhere $cgroupby $corderby $climits\";\n\t\t\t$comments         = $wpdb->get_results( $comments_request );\n\t\t\t// Convert to WP_Comment.\n\t\t\t$this->comments      = array_map( 'get_comment', $comments );\n\t\t\t$this->comment_count = count( $this->comments );\n\t\t}\n\n\t\t// Check post status to determine if post should be displayed.\n\t\tif ( ! empty( $this->posts ) && ( $this->is_single || $this->is_page ) ) {\n\t\t\t$status = get_post_status( $this->posts[0] );\n\n\t\t\tif ( 'attachment' === $this->posts[0]->post_type && 0 === (int) $this->posts[0]->post_parent ) {\n\t\t\t\t$this->is_page       = false;\n\t\t\t\t$this->is_single     = true;\n\t\t\t\t$this->is_attachment = true;\n\t\t\t}\n\n\t\t\t// If the post_status was specifically requested, let it pass through.\n\t\t\tif ( ! in_array( $status, $q_status, true ) ) {\n\t\t\t\t$post_status_obj = get_post_status_object( $status );\n\n\t\t\t\tif ( $post_status_obj && ! $post_status_obj->public ) {\n\t\t\t\t\tif ( ! is_user_logged_in() ) {\n\t\t\t\t\t\t// User must be logged in to view unpublished posts.\n\t\t\t\t\t\t$this->posts = array();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( $post_status_obj->protected ) {\n\t\t\t\t\t\t\t// User must have edit permissions on the draft to preview.\n\t\t\t\t\t\t\tif ( ! current_user_can( $edit_cap, $this->posts[0]->ID ) ) {\n\t\t\t\t\t\t\t\t$this->posts = array();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->is_preview = true;\n\t\t\t\t\t\t\t\tif ( 'future' !== $status ) {\n\t\t\t\t\t\t\t\t\t$this->posts[0]->post_date = current_time( 'mysql' );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif ( $post_status_obj->private ) {\n\t\t\t\t\t\t\tif ( ! current_user_can( $read_cap, $this->posts[0]->ID ) ) {\n\t\t\t\t\t\t\t\t$this->posts = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->posts = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} elseif ( ! $post_status_obj ) {\n\t\t\t\t\t// Post status is not registered, assume it's not public.\n\t\t\t\t\tif ( ! current_user_can( $edit_cap, $this->posts[0]->ID ) ) {\n\t\t\t\t\t\t$this->posts = array();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) ) {\n\t\t\t\t/**\n\t\t\t\t * Filters the single post for preview mode.\n\t\t\t\t *\n\t\t\t\t * @since 2.7.0\n\t\t\t\t *\n\t\t\t\t * @param WP_Post  $post_preview  The Post object.\n\t\t\t\t * @param WP_Query $this          The WP_Query instance (passed by reference).\n\t\t\t\t */\n\t\t\t\t$this->posts[0] = get_post( apply_filters_ref_array( 'the_preview', array( $this->posts[0], &$this ) ) );\n\t\t\t}\n\t\t}\n\n\t\t// Put sticky posts at the top of the posts array.\n\t\t$sticky_posts = get_option( 'sticky_posts' );\n\t\tif ( $this->is_home && $page <= 1 && is_array( $sticky_posts ) && ! empty( $sticky_posts ) && ! $q['ignore_sticky_posts'] ) {\n\t\t\t$num_posts     = count( $this->posts );\n\t\t\t$sticky_offset = 0;\n\t\t\t// Loop over posts and relocate stickies to the front.\n\t\t\tfor ( $i = 0; $i < $num_posts; $i++ ) {\n\t\t\t\tif ( in_array( $this->posts[ $i ]->ID, $sticky_posts, true ) ) {\n\t\t\t\t\t$sticky_post = $this->posts[ $i ];\n\t\t\t\t\t// Remove sticky from current position.\n\t\t\t\t\tarray_splice( $this->posts, $i, 1 );\n\t\t\t\t\t// Move to front, after other stickies.\n\t\t\t\t\tarray_splice( $this->posts, $sticky_offset, 0, array( $sticky_post ) );\n\t\t\t\t\t// Increment the sticky offset. The next sticky will be placed at this offset.\n\t\t\t\t\t$sticky_offset++;\n\t\t\t\t\t// Remove post from sticky posts array.\n\t\t\t\t\t$offset = array_search( $sticky_post->ID, $sticky_posts, true );\n\t\t\t\t\tunset( $sticky_posts[ $offset ] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If any posts have been excluded specifically, Ignore those that are sticky.\n\t\t\tif ( ! empty( $sticky_posts ) && ! empty( $q['post__not_in'] ) ) {\n\t\t\t\t$sticky_posts = array_diff( $sticky_posts, $q['post__not_in'] );\n\t\t\t}\n\n\t\t\t// Fetch sticky posts that weren't in the query results.\n\t\t\tif ( ! empty( $sticky_posts ) ) {\n\t\t\t\t$stickies = get_posts(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post__in'    => $sticky_posts,\n\t\t\t\t\t\t'post_type'   => $post_type,\n\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t'nopaging'    => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tforeach ( $stickies as $sticky_post ) {\n\t\t\t\t\tarray_splice( $this->posts, $sticky_offset, 0, array( $sticky_post ) );\n\t\t\t\t\t$sticky_offset++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If comments have been fetched as part of the query, make sure comment meta lazy-loading is set up.\n\t\tif ( ! empty( $this->comments ) ) {\n\t\t\twp_queue_comments_for_comment_meta_lazyload( $this->comments );\n\t\t}\n\n\t\tif ( ! $q['suppress_filters'] ) {\n\t\t\t/**\n\t\t\t * Filters the array of retrieved posts after they've been fetched and\n\t\t\t * internally processed.\n\t\t\t *\n\t\t\t * @since 1.5.0\n\t\t\t *\n\t\t\t * @param WP_Post[] $posts Array of post objects.\n\t\t\t * @param WP_Query  $this The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$this->posts = apply_filters_ref_array( 'the_posts', array( $this->posts, &$this ) );\n\t\t}\n\n\t\t// Ensure that any posts added/modified via one of the filters above are\n\t\t// of the type WP_Post and are filtered.\n\t\tif ( $this->posts ) {\n\t\t\t$this->post_count = count( $this->posts );\n\n\t\t\t$this->posts = array_map( 'get_post', $this->posts );\n\n\t\t\tif ( $q['cache_results'] ) {\n\t\t\t\tupdate_post_caches( $this->posts, $post_type, $q['update_post_term_cache'], $q['update_post_meta_cache'] );\n\t\t\t}\n\n\t\t\t$this->post = reset( $this->posts );\n\t\t} else {\n\t\t\t$this->post_count = 0;\n\t\t\t$this->posts      = array();\n\t\t}\n\n\t\tif ( $q['lazy_load_term_meta'] ) {\n\t\t\twp_queue_posts_for_term_meta_lazyload( $this->posts );\n\t\t}\n\n\t\treturn $this->posts;\n\t}\n\n\t/**\n\t * Set up the amount of found posts and the number of pages (if limit clause was used)\n\t * for the current query.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param array  $q      Query variables.\n\t * @param string $limits LIMIT clauses of the query.\n\t */\n\tprivate function set_found_posts( $q, $limits ) {\n\t\tglobal $wpdb;\n\t\t// Bail if posts is an empty array. Continue if posts is an empty string,\n\t\t// null, or false to accommodate caching plugins that fill posts later.\n\t\tif ( $q['no_found_rows'] || ( is_array( $this->posts ) && ! $this->posts ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! empty( $limits ) ) {\n\t\t\t/**\n\t\t\t * Filters the query to run for retrieving the found posts.\n\t\t\t *\n\t\t\t * @since 2.1.0\n\t\t\t *\n\t\t\t * @param string   $found_posts_query The query to run to find the found posts.\n\t\t\t * @param WP_Query $this              The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\t$found_posts_query = apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) );\n\n\t\t\t$this->found_posts = (int) $wpdb->get_var( $found_posts_query );\n\t\t} else {\n\t\t\tif ( is_array( $this->posts ) ) {\n\t\t\t\t$this->found_posts = count( $this->posts );\n\t\t\t} else {\n\t\t\t\tif ( null === $this->posts ) {\n\t\t\t\t\t$this->found_posts = 0;\n\t\t\t\t} else {\n\t\t\t\t\t$this->found_posts = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the number of found posts for the query.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param int      $found_posts The number of posts found.\n\t\t * @param WP_Query $this        The WP_Query instance (passed by reference).\n\t\t */\n\t\t$this->found_posts = (int) apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) );\n\n\t\tif ( ! empty( $limits ) ) {\n\t\t\t$this->max_num_pages = ceil( $this->found_posts / $q['posts_per_page'] );\n\t\t}\n\t}\n\n\t/**\n\t * Set up the next post and iterate current post index.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return WP_Post Next post.\n\t */\n\tpublic function next_post() {\n\n\t\t$this->current_post++;\n\n\t\t$this->post = $this->posts[ $this->current_post ];\n\t\treturn $this->post;\n\t}\n\n\t/**\n\t * Sets up the current post.\n\t *\n\t * Retrieves the next post, sets up the post, sets the 'in the loop'\n\t * property to true.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @global WP_Post $post Global post object.\n\t */\n\tpublic function the_post() {\n\t\tglobal $post;\n\t\t$this->in_the_loop = true;\n\n\t\tif ( -1 == $this->current_post ) { // Loop has just started.\n\t\t\t/**\n\t\t\t * Fires once the loop is started.\n\t\t\t *\n\t\t\t * @since 2.0.0\n\t\t\t *\n\t\t\t * @param WP_Query $this The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\tdo_action_ref_array( 'loop_start', array( &$this ) );\n\t\t}\n\n\t\t$post = $this->next_post();\n\t\t$this->setup_postdata( $post );\n\t}\n\n\t/**\n\t * Determines whether there are more posts available in the loop.\n\t *\n\t * Calls the {@see 'loop_end'} action when the loop is complete.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return bool True if posts are available, false if end of the loop.\n\t */\n\tpublic function have_posts() {\n\t\tif ( $this->current_post + 1 < $this->post_count ) {\n\t\t\treturn true;\n\t\t} elseif ( $this->current_post + 1 == $this->post_count && $this->post_count > 0 ) {\n\t\t\t/**\n\t\t\t * Fires once the loop has ended.\n\t\t\t *\n\t\t\t * @since 2.0.0\n\t\t\t *\n\t\t\t * @param WP_Query $this The WP_Query instance (passed by reference).\n\t\t\t */\n\t\t\tdo_action_ref_array( 'loop_end', array( &$this ) );\n\t\t\t// Do some cleaning up after the loop.\n\t\t\t$this->rewind_posts();\n\t\t} elseif ( 0 === $this->post_count ) {\n\t\t\t/**\n\t\t\t * Fires if no results are found in a post query.\n\t\t\t *\n\t\t\t * @since 4.9.0\n\t\t\t *\n\t\t\t * @param WP_Query $this The WP_Query instance.\n\t\t\t */\n\t\t\tdo_action( 'loop_no_results', $this );\n\t\t}\n\n\t\t$this->in_the_loop = false;\n\t\treturn false;\n\t}\n\n\t/**\n\t * Rewind the posts and reset post index.\n\t *\n\t * @since 1.5.0\n\t */\n\tpublic function rewind_posts() {\n\t\t$this->current_post = -1;\n\t\tif ( $this->post_count > 0 ) {\n\t\t\t$this->post = $this->posts[0];\n\t\t}\n\t}\n\n\t/**\n\t * Iterate current comment index and return WP_Comment object.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @return WP_Comment Comment object.\n\t */\n\tpublic function next_comment() {\n\t\t$this->current_comment++;\n\n\t\t$this->comment = $this->comments[ $this->current_comment ];\n\t\treturn $this->comment;\n\t}\n\n\t/**\n\t * Sets up the current comment.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @global WP_Comment $comment Global comment object.\n\t */\n\tpublic function the_comment() {\n\t\tglobal $comment;\n\n\t\t$comment = $this->next_comment();\n\n\t\tif ( 0 == $this->current_comment ) {\n\t\t\t/**\n\t\t\t * Fires once the comment loop is started.\n\t\t\t *\n\t\t\t * @since 2.2.0\n\t\t\t */\n\t\t\tdo_action( 'comment_loop_start' );\n\t\t}\n\t}\n\n\t/**\n\t * Whether there are more comments available.\n\t *\n\t * Automatically rewinds comments when finished.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @return bool True if comments are available, false if no more comments.\n\t */\n\tpublic function have_comments() {\n\t\tif ( $this->current_comment + 1 < $this->comment_count ) {\n\t\t\treturn true;\n\t\t} elseif ( $this->current_comment + 1 == $this->comment_count ) {\n\t\t\t$this->rewind_comments();\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Rewind the comments, resets the comment index and comment to first.\n\t *\n\t * @since 2.2.0\n\t */\n\tpublic function rewind_comments() {\n\t\t$this->current_comment = -1;\n\t\tif ( $this->comment_count > 0 ) {\n\t\t\t$this->comment = $this->comments[0];\n\t\t}\n\t}\n\n\t/**\n\t * Sets up the WordPress query by parsing query string.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @see WP_Query::parse_query() for all available arguments.\n\t *\n\t * @param string|array $query URL query string or array of query arguments.\n\t * @return WP_Post[]|int[] Array of post objects or post IDs.\n\t */\n\tpublic function query( $query ) {\n\t\t$this->init();\n\t\t$this->query      = wp_parse_args( $query );\n\t\t$this->query_vars = $this->query;\n\t\treturn $this->get_posts();\n\t}\n\n\t/**\n\t * Retrieve queried object.\n\t *\n\t * If queried object is not set, then the queried object will be set from\n\t * the category, tag, taxonomy, posts page, single post, page, or author\n\t * query variable. After it is set up, it will be returned.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return object\n\t */\n\tpublic function get_queried_object() {\n\t\tif ( isset( $this->queried_object ) ) {\n\t\t\treturn $this->queried_object;\n\t\t}\n\n\t\t$this->queried_object    = null;\n\t\t$this->queried_object_id = null;\n\n\t\tif ( $this->is_category || $this->is_tag || $this->is_tax ) {\n\t\t\tif ( $this->is_category ) {\n\t\t\t\tif ( $this->get( 'cat' ) ) {\n\t\t\t\t\t$term = get_term( $this->get( 'cat' ), 'category' );\n\t\t\t\t} elseif ( $this->get( 'category_name' ) ) {\n\t\t\t\t\t$term = get_term_by( 'slug', $this->get( 'category_name' ), 'category' );\n\t\t\t\t}\n\t\t\t} elseif ( $this->is_tag ) {\n\t\t\t\tif ( $this->get( 'tag_id' ) ) {\n\t\t\t\t\t$term = get_term( $this->get( 'tag_id' ), 'post_tag' );\n\t\t\t\t} elseif ( $this->get( 'tag' ) ) {\n\t\t\t\t\t$term = get_term_by( 'slug', $this->get( 'tag' ), 'post_tag' );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// For other tax queries, grab the first term from the first clause.\n\t\t\t\tif ( ! empty( $this->tax_query->queried_terms ) ) {\n\t\t\t\t\t$queried_taxonomies = array_keys( $this->tax_query->queried_terms );\n\t\t\t\t\t$matched_taxonomy   = reset( $queried_taxonomies );\n\t\t\t\t\t$query              = $this->tax_query->queried_terms[ $matched_taxonomy ];\n\n\t\t\t\t\tif ( ! empty( $query['terms'] ) ) {\n\t\t\t\t\t\tif ( 'term_id' === $query['field'] ) {\n\t\t\t\t\t\t\t$term = get_term( reset( $query['terms'] ), $matched_taxonomy );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$term = get_term_by( $query['field'], reset( $query['terms'] ), $matched_taxonomy );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty( $term ) && ! is_wp_error( $term ) ) {\n\t\t\t\t$this->queried_object    = $term;\n\t\t\t\t$this->queried_object_id = (int) $term->term_id;\n\n\t\t\t\tif ( $this->is_category && 'category' === $this->queried_object->taxonomy ) {\n\t\t\t\t\t_make_cat_compat( $this->queried_object );\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( $this->is_post_type_archive ) {\n\t\t\t$post_type = $this->get( 'post_type' );\n\t\t\tif ( is_array( $post_type ) ) {\n\t\t\t\t$post_type = reset( $post_type );\n\t\t\t}\n\t\t\t$this->queried_object = get_post_type_object( $post_type );\n\t\t} elseif ( $this->is_posts_page ) {\n\t\t\t$page_for_posts          = get_option( 'page_for_posts' );\n\t\t\t$this->queried_object    = get_post( $page_for_posts );\n\t\t\t$this->queried_object_id = (int) $this->queried_object->ID;\n\t\t} elseif ( $this->is_singular && ! empty( $this->post ) ) {\n\t\t\t$this->queried_object    = $this->post;\n\t\t\t$this->queried_object_id = (int) $this->post->ID;\n\t\t} elseif ( $this->is_author ) {\n\t\t\t$this->queried_object_id = (int) $this->get( 'author' );\n\t\t\t$this->queried_object    = get_userdata( $this->queried_object_id );\n\t\t}\n\n\t\treturn $this->queried_object;\n\t}\n\n\t/**\n\t * Retrieve ID of the current queried object.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return int\n\t */\n\tpublic function get_queried_object_id() {\n\t\t$this->get_queried_object();\n\n\t\tif ( isset( $this->queried_object_id ) ) {\n\t\t\treturn $this->queried_object_id;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\t/**\n\t * Constructor.\n\t *\n\t * Sets up the WordPress query, if parameter is not empty.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @see WP_Query::parse_query() for all available arguments.\n\t *\n\t * @param string|array $query URL query string or array of vars.\n\t */\n\tpublic function __construct( $query = '' ) {\n\t\tif ( ! empty( $query ) ) {\n\t\t\t$this->query( $query );\n\t\t}\n\t}\n\n\t/**\n\t * Make private properties readable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name Property to get.\n\t * @return mixed Property.\n\t */\n\tpublic function __get( $name ) {\n\t\tif ( in_array( $name, $this->compat_fields, true ) ) {\n\t\t\treturn $this->$name;\n\t\t}\n\t}\n\n\t/**\n\t * Make private properties checkable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name Property to check if set.\n\t * @return bool Whether the property is set.\n\t */\n\tpublic function __isset( $name ) {\n\t\tif ( in_array( $name, $this->compat_fields, true ) ) {\n\t\t\treturn isset( $this->$name );\n\t\t}\n\t}\n\n\t/**\n\t * Make private/protected methods readable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name      Method to call.\n\t * @param array  $arguments Arguments to pass when calling.\n\t * @return mixed|false Return value of the callback, false otherwise.\n\t */\n\tpublic function __call( $name, $arguments ) {\n\t\tif ( in_array( $name, $this->compat_methods, true ) ) {\n\t\t\treturn $this->$name( ...$arguments );\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Is the query for an existing archive page?\n\t *\n\t * Month, Year, Category, Author, Post Type archive...\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool Whether the query is for an existing archive page.\n\t */\n\tpublic function is_archive() {\n\t\treturn (bool) $this->is_archive;\n\t}\n\n\t/**\n\t * Is the query for an existing post type archive page?\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string|string[] $post_types Optional. Post type or array of posts types\n\t *                                    to check against. Default empty.\n\t * @return bool Whether the query is for an existing post type archive page.\n\t */\n\tpublic function is_post_type_archive( $post_types = '' ) {\n\t\tif ( empty( $post_types ) || ! $this->is_post_type_archive ) {\n\t\t\treturn (bool) $this->is_post_type_archive;\n\t\t}\n\n\t\t$post_type = $this->get( 'post_type' );\n\t\tif ( is_array( $post_type ) ) {\n\t\t\t$post_type = reset( $post_type );\n\t\t}\n\t\t$post_type_object = get_post_type_object( $post_type );\n\n\t\treturn in_array( $post_type_object->name, (array) $post_types, true );\n\t}\n\n\t/**\n\t * Is the query for an existing attachment page?\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param int|string|int[]|string[] $attachment Optional. Attachment ID, title, slug, or array of such\n\t *                                              to check against. Default empty.\n\t * @return bool Whether the query is for an existing attachment page.\n\t */\n\tpublic function is_attachment( $attachment = '' ) {\n\t\tif ( ! $this->is_attachment ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( empty( $attachment ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$attachment = array_map( 'strval', (array) $attachment );\n\n\t\t$post_obj = $this->get_queried_object();\n\n\t\tif ( in_array( (string) $post_obj->ID, $attachment, true ) ) {\n\t\t\treturn true;\n\t\t} elseif ( in_array( $post_obj->post_title, $attachment, true ) ) {\n\t\t\treturn true;\n\t\t} elseif ( in_array( $post_obj->post_name, $attachment, true ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Is the query for an existing author archive page?\n\t *\n\t * If the $author parameter is specified, this function will additionally\n\t * check if the query is for one of the authors specified.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param int|string|int[]|string[] $author Optional. User ID, nickname, nicename, or array of such\n\t *                                          to check against. Default empty.\n\t * @return bool Whether the query is for an existing author archive page.\n\t */\n\tpublic function is_author( $author = '' ) {\n\t\tif ( ! $this->is_author ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( empty( $author ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$author_obj = $this->get_queried_object();\n\n\t\t$author = array_map( 'strval', (array) $author );\n\n\t\tif ( in_array( (string) $author_obj->ID, $author, true ) ) {\n\t\t\treturn true;\n\t\t} elseif ( in_array( $author_obj->nickname, $author, true ) ) {\n\t\t\treturn true;\n\t\t} elseif ( in_array( $author_obj->user_nicename, $author, true ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Is the query for an existing category archive page?\n\t *\n\t * If the $category parameter is specified, this function will additionally\n\t * check if the query is for one of the categories specified.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param int|string|int[]|string[] $category Optional. Category ID, name, slug, or array of such\n\t *                                            to check against. Default empty.\n\t * @return bool Whether the query is for an existing category archive page.\n\t */\n\tpublic function is_category( $category = '' ) {\n\t\tif ( ! $this->is_category ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( empty( $category ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$cat_obj = $this->get_queried_object();\n\n\t\t$category = array_map( 'strval', (array) $category );\n\n\t\tif ( in_array( (string) $cat_obj->term_id, $category, true ) ) {\n\t\t\treturn true;\n\t\t} elseif ( in_array( $cat_obj->name, $category, true ) ) {\n\t\t\treturn true;\n\t\t} elseif ( in_array( $cat_obj->slug, $category, true ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Is the query for an existing tag archive page?\n\t *\n\t * If the $tag parameter is specified, this function will additionally\n\t * check if the query is for one of the tags specified.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param int|string|int[]|string[] $tag Optional. Tag ID, name, slug, or array of such\n\t *                                       to check against. Default empty.\n\t * @return bool Whether the query is for an existing tag archive page.\n\t */\n\tpublic function is_tag( $tag = '' ) {\n\t\tif ( ! $this->is_tag ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( empty( $tag ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$tag_obj = $this->get_queried_object();\n\n\t\t$tag = array_map( 'strval', (array) $tag );\n\n\t\tif ( in_array( (string) $tag_obj->term_id, $tag, true ) ) {\n\t\t\treturn true;\n\t\t} elseif ( in_array( $tag_obj->name, $tag, true ) ) {\n\t\t\treturn true;\n\t\t} elseif ( in_array( $tag_obj->slug, $tag, true ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Is the query for an existing custom taxonomy archive page?\n\t *\n\t * If the $taxonomy parameter is specified, this function will additionally\n\t * check if the query is for that specific $taxonomy.\n\t *\n\t * If the $term parameter is specified in addition to the $taxonomy parameter,\n\t * this function will additionally check if the query is for one of the terms\n\t * specified.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @global array $wp_taxonomies\n\t *\n\t * @param string|string[]           $taxonomy Optional. Taxonomy slug or slugs to check against.\n\t *                                            Default empty.\n\t * @param int|string|int[]|string[] $term     Optional. Term ID, name, slug, or array of such\n\t *                                            to check against. Default empty.\n\t * @return bool Whether the query is for an existing custom taxonomy archive page.\n\t *              True for custom taxonomy archive pages, false for built-in taxonomies\n\t *              (category and tag archives).\n\t */\n\tpublic function is_tax( $taxonomy = '', $term = '' ) {\n\t\tglobal $wp_taxonomies;\n\n\t\tif ( ! $this->is_tax ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( empty( $taxonomy ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$queried_object = $this->get_queried_object();\n\t\t$tax_array      = array_intersect( array_keys( $wp_taxonomies ), (array) $taxonomy );\n\t\t$term_array     = (array) $term;\n\n\t\t// Check that the taxonomy matches.\n\t\tif ( ! ( isset( $queried_object->taxonomy ) && count( $tax_array ) && in_array( $queried_object->taxonomy, $tax_array, true ) ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only a taxonomy provided.\n\t\tif ( empty( $term ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn isset( $queried_object->term_id ) &&\n\t\t\tcount(\n\t\t\t\tarray_intersect(\n\t\t\t\t\tarray( $queried_object->term_id, $queried_object->name, $queried_object->slug ),\n\t\t\t\t\t$term_array\n\t\t\t\t)\n\t\t\t);\n\t}\n\n\t/**\n\t * Whether the current URL is within the comments popup window.\n\t *\n\t * @since 3.1.0\n\t * @deprecated 4.5.0\n\t *\n\t * @return false Always returns false.\n\t */\n\tpublic function is_comments_popup() {\n\t\t_deprecated_function( __FUNCTION__, '4.5.0' );\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Is the query for an existing date archive?\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool Whether the query is for an existing date archive.\n\t */\n\tpublic function is_date() {\n\t\treturn (bool) $this->is_date;\n\t}\n\n\t/**\n\t * Is the query for an existing day archive?\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool Whether the query is for an existing day archive.\n\t */\n\tpublic function is_day() {\n\t\treturn (bool) $this->is_day;\n\t}\n\n\t/**\n\t * Is the query for a feed?\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string|string[] $feeds Optional. Feed type or array of feed types\n\t *                                         to check against. Default empty.\n\t * @return bool Whether the query is for a feed.\n\t */\n\tpublic function is_feed( $feeds = '' ) {\n\t\tif ( empty( $feeds ) || ! $this->is_feed ) {\n\t\t\treturn (bool) $this->is_feed;\n\t\t}\n\n\t\t$qv = $this->get( 'feed' );\n\t\tif ( 'feed' === $qv ) {\n\t\t\t$qv = get_default_feed();\n\t\t}\n\n\t\treturn in_array( $qv, (array) $feeds, true );\n\t}\n\n\t/**\n\t * Is the query for a comments feed?\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool Whether the query is for a comments feed.\n\t */\n\tpublic function is_comment_feed() {\n\t\treturn (bool) $this->is_comment_feed;\n\t}\n\n\t/**\n\t * Is the query for the front page of the site?\n\t *\n\t * This is for what is displayed at your site's main URL.\n\t *\n\t * Depends on the site's \"Front page displays\" Reading Settings 'show_on_front' and 'page_on_front'.\n\t *\n\t * If you set a static page for the front page of your site, this function will return\n\t * true when viewing that page.\n\t *\n\t * Otherwise the same as @see WP_Query::is_home()\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool Whether the query is for the front page of the site.\n\t */\n\tpublic function is_front_page() {\n\t\t// Most likely case.\n\t\tif ( 'posts' === get_option( 'show_on_front' ) && $this->is_home() ) {\n\t\t\treturn true;\n\t\t} elseif ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' )\n\t\t\t&& $this->is_page( get_option( 'page_on_front' ) )\n\t\t) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Is the query for the blog homepage?\n\t *\n\t * This is the page which shows the time based blog content of your site.\n\t *\n\t * Depends on the site's \"Front page displays\" Reading Settings 'show_on_front' and 'page_for_posts'.\n\t *\n\t * If you set a static page for the front page of your site, this function will return\n\t * true only on the page you set as the \"Posts page\".\n\t *\n\t * @see WP_Query::is_front_page()\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool Whether the query is for the blog homepage.\n\t */\n\tpublic function is_home() {\n\t\treturn (bool) $this->is_home;\n\t}\n\n\t/**\n\t * Is the query for the Privacy Policy page?\n\t *\n\t * This is the page which shows the Privacy Policy content of your site.\n\t *\n\t * Depends on the site's \"Change your Privacy Policy page\" Privacy Settings 'wp_page_for_privacy_policy'.\n\t *\n\t * This function will return true only on the page you set as the \"Privacy Policy page\".\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return bool Whether the query is for the Privacy Policy page.\n\t */\n\tpublic function is_privacy_policy() {\n\t\tif ( get_option( 'wp_page_for_privacy_policy' )\n\t\t\t&& $this->is_page( get_option( 'wp_page_for_privacy_policy' ) )\n\t\t) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Is the query for an existing month archive?\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool Whether the query is for an existing month archive.\n\t */\n\tpublic function is_month() {\n\t\treturn (bool) $this->is_month;\n\t}\n\n\t/**\n\t * Is the query for an existing single page?\n\t *\n\t * If the $page parameter is specified, this function will additionally\n\t * check if the query is for one of the pages specified.\n\t *\n\t * @see WP_Query::is_single()\n\t * @see WP_Query::is_singular()\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param int|string|int[]|string[] $page Optional. Page ID, title, slug, path, or array of such\n\t *                                        to check against. Default empty.\n\t * @return bool Whether the query is for an existing single page.\n\t */\n\tpublic function is_page( $page = '' ) {\n\t\tif ( ! $this->is_page ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( empty( $page ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$page_obj = $this->get_queried_object();\n\n\t\t$page = array_map( 'strval', (array) $page );\n\n\t\tif ( in_array( (string) $page_obj->ID, $page, true ) ) {\n\t\t\treturn true;\n\t\t} elseif ( in_array( $page_obj->post_title, $page, true ) ) {\n\t\t\treturn true;\n\t\t} elseif ( in_array( $page_obj->post_name, $page, true ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tforeach ( $page as $pagepath ) {\n\t\t\t\tif ( ! strpos( $pagepath, '/' ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$pagepath_obj = get_page_by_path( $pagepath );\n\n\t\t\t\tif ( $pagepath_obj && ( $pagepath_obj->ID == $page_obj->ID ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Is the query for a paged result and not for the first page?\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool Whether the query is for a paged result.\n\t */\n\tpublic function is_paged() {\n\t\treturn (bool) $this->is_paged;\n\t}\n\n\t/**\n\t * Is the query for a post or page preview?\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool Whether the query is for a post or page preview.\n\t */\n\tpublic function is_preview() {\n\t\treturn (bool) $this->is_preview;\n\t}\n\n\t/**\n\t * Is the query for the robots.txt file?\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool Whether the query is for the robots.txt file.\n\t */\n\tpublic function is_robots() {\n\t\treturn (bool) $this->is_robots;\n\t}\n\n\t/**\n\t * Is the query for the favicon.ico file?\n\t *\n\t * @since 5.4.0\n\t *\n\t * @return bool Whether the query is for the favicon.ico file.\n\t */\n\tpublic function is_favicon() {\n\t\treturn (bool) $this->is_favicon;\n\t}\n\n\t/**\n\t * Is the query for a search?\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool Whether the query is for a search.\n\t */\n\tpublic function is_search() {\n\t\treturn (bool) $this->is_search;\n\t}\n\n\t/**\n\t * Is the query for an existing single post?\n\t *\n\t * Works for any post type excluding pages.\n\t *\n\t * If the $post parameter is specified, this function will additionally\n\t * check if the query is for one of the Posts specified.\n\t *\n\t * @see WP_Query::is_page()\n\t * @see WP_Query::is_singular()\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param int|string|int[]|string[] $post Optional. Post ID, title, slug, path, or array of such\n\t *                                        to check against. Default empty.\n\t * @return bool Whether the query is for an existing single post.\n\t */\n\tpublic function is_single( $post = '' ) {\n\t\tif ( ! $this->is_single ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( empty( $post ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$post_obj = $this->get_queried_object();\n\n\t\t$post = array_map( 'strval', (array) $post );\n\n\t\tif ( in_array( (string) $post_obj->ID, $post, true ) ) {\n\t\t\treturn true;\n\t\t} elseif ( in_array( $post_obj->post_title, $post, true ) ) {\n\t\t\treturn true;\n\t\t} elseif ( in_array( $post_obj->post_name, $post, true ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tforeach ( $post as $postpath ) {\n\t\t\t\tif ( ! strpos( $postpath, '/' ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$postpath_obj = get_page_by_path( $postpath, OBJECT, $post_obj->post_type );\n\n\t\t\t\tif ( $postpath_obj && ( $postpath_obj->ID == $post_obj->ID ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Is the query for an existing single post of any post type (post, attachment, page,\n\t * custom post types)?\n\t *\n\t * If the $post_types parameter is specified, this function will additionally\n\t * check if the query is for one of the Posts Types specified.\n\t *\n\t * @see WP_Query::is_page()\n\t * @see WP_Query::is_single()\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string|string[] $post_types Optional. Post type or array of post types\n\t *                                    to check against. Default empty.\n\t * @return bool Whether the query is for an existing single post\n\t *              or any of the given post types.\n\t */\n\tpublic function is_singular( $post_types = '' ) {\n\t\tif ( empty( $post_types ) || ! $this->is_singular ) {\n\t\t\treturn (bool) $this->is_singular;\n\t\t}\n\n\t\t$post_obj = $this->get_queried_object();\n\n\t\treturn in_array( $post_obj->post_type, (array) $post_types, true );\n\t}\n\n\t/**\n\t * Is the query for a specific time?\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool Whether the query is for a specific time.\n\t */\n\tpublic function is_time() {\n\t\treturn (bool) $this->is_time;\n\t}\n\n\t/**\n\t * Is the query for a trackback endpoint call?\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool Whether the query is for a trackback endpoint call.\n\t */\n\tpublic function is_trackback() {\n\t\treturn (bool) $this->is_trackback;\n\t}\n\n\t/**\n\t * Is the query for an existing year archive?\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool Whether the query is for an existing year archive.\n\t */\n\tpublic function is_year() {\n\t\treturn (bool) $this->is_year;\n\t}\n\n\t/**\n\t * Is the query a 404 (returns no results)?\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return bool Whether the query is a 404 error.\n\t */\n\tpublic function is_404() {\n\t\treturn (bool) $this->is_404;\n\t}\n\n\t/**\n\t * Is the query for an embedded post?\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return bool Whether the query is for an embedded post.\n\t */\n\tpublic function is_embed() {\n\t\treturn (bool) $this->is_embed;\n\t}\n\n\t/**\n\t * Is the query the main query?\n\t *\n\t * @since 3.3.0\n\t *\n\t * @global WP_Query $wp_query WordPress Query object.\n\t *\n\t * @return bool Whether the query is the main query.\n\t */\n\tpublic function is_main_query() {\n\t\tglobal $wp_the_query;\n\t\treturn $wp_the_query === $this;\n\t}\n\n\t/**\n\t * Set up global post data.\n\t *\n\t * @since 4.1.0\n\t * @since 4.4.0 Added the ability to pass a post ID to `$post`.\n\t *\n\t * @global int     $id\n\t * @global WP_User $authordata\n\t * @global string  $currentday\n\t * @global string  $currentmonth\n\t * @global int     $page\n\t * @global array   $pages\n\t * @global int     $multipage\n\t * @global int     $more\n\t * @global int     $numpages\n\t *\n\t * @param WP_Post|object|int $post WP_Post instance or Post ID/object.\n\t * @return true True when finished.\n\t */\n\tpublic function setup_postdata( $post ) {\n\t\tglobal $id, $authordata, $currentday, $currentmonth, $page, $pages, $multipage, $more, $numpages;\n\n\t\tif ( ! ( $post instanceof WP_Post ) ) {\n\t\t\t$post = get_post( $post );\n\t\t}\n\n\t\tif ( ! $post ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$elements = $this->generate_postdata( $post );\n\t\tif ( false === $elements ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$id           = $elements['id'];\n\t\t$authordata   = $elements['authordata'];\n\t\t$currentday   = $elements['currentday'];\n\t\t$currentmonth = $elements['currentmonth'];\n\t\t$page         = $elements['page'];\n\t\t$pages        = $elements['pages'];\n\t\t$multipage    = $elements['multipage'];\n\t\t$more         = $elements['more'];\n\t\t$numpages     = $elements['numpages'];\n\n\t\t/**\n\t\t * Fires once the post data has been set up.\n\t\t *\n\t\t * @since 2.8.0\n\t\t * @since 4.1.0 Introduced `$this` parameter.\n\t\t *\n\t\t * @param WP_Post  $post The Post object (passed by reference).\n\t\t * @param WP_Query $this The current Query object (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'the_post', array( &$post, &$this ) );\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Generate post data.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param WP_Post|object|int $post WP_Post instance or Post ID/object.\n\t * @return array|bool Elements of post or false on failure.\n\t */\n\tpublic function generate_postdata( $post ) {\n\n\t\tif ( ! ( $post instanceof WP_Post ) ) {\n\t\t\t$post = get_post( $post );\n\t\t}\n\n\t\tif ( ! $post ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$id = (int) $post->ID;\n\n\t\t$authordata = get_userdata( $post->post_author );\n\n\t\t$currentday   = mysql2date( 'd.m.y', $post->post_date, false );\n\t\t$currentmonth = mysql2date( 'm', $post->post_date, false );\n\t\t$numpages     = 1;\n\t\t$multipage    = 0;\n\t\t$page         = $this->get( 'page' );\n\t\tif ( ! $page ) {\n\t\t\t$page = 1;\n\t\t}\n\n\t\t/*\n\t\t * Force full post content when viewing the permalink for the $post,\n\t\t * or when on an RSS feed. Otherwise respect the 'more' tag.\n\t\t */\n\t\tif ( get_queried_object_id() === $post->ID && ( $this->is_page() || $this->is_single() ) ) {\n\t\t\t$more = 1;\n\t\t} elseif ( $this->is_feed() ) {\n\t\t\t$more = 1;\n\t\t} else {\n\t\t\t$more = 0;\n\t\t}\n\n\t\t$content = $post->post_content;\n\t\tif ( false !== strpos( $content, '<!--nextpage-->' ) ) {\n\t\t\t$content = str_replace( \"\\n<!--nextpage-->\\n\", '<!--nextpage-->', $content );\n\t\t\t$content = str_replace( \"\\n<!--nextpage-->\", '<!--nextpage-->', $content );\n\t\t\t$content = str_replace( \"<!--nextpage-->\\n\", '<!--nextpage-->', $content );\n\n\t\t\t// Remove the nextpage block delimiters, to avoid invalid block structures in the split content.\n\t\t\t$content = str_replace( '<!-- wp:nextpage -->', '', $content );\n\t\t\t$content = str_replace( '<!-- /wp:nextpage -->', '', $content );\n\n\t\t\t// Ignore nextpage at the beginning of the content.\n\t\t\tif ( 0 === strpos( $content, '<!--nextpage-->' ) ) {\n\t\t\t\t$content = substr( $content, 15 );\n\t\t\t}\n\n\t\t\t$pages = explode( '<!--nextpage-->', $content );\n\t\t} else {\n\t\t\t$pages = array( $post->post_content );\n\t\t}\n\n\t\t/**\n\t\t * Filters the \"pages\" derived from splitting the post content.\n\t\t *\n\t\t * \"Pages\" are determined by splitting the post content based on the presence\n\t\t * of `<!-- nextpage -->` tags.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string[] $pages Array of \"pages\" from the post content split by `<!-- nextpage -->` tags.\n\t\t * @param WP_Post  $post  Current post object.\n\t\t */\n\t\t$pages = apply_filters( 'content_pagination', $pages, $post );\n\n\t\t$numpages = count( $pages );\n\n\t\tif ( $numpages > 1 ) {\n\t\t\tif ( $page > 1 ) {\n\t\t\t\t$more = 1;\n\t\t\t}\n\t\t\t$multipage = 1;\n\t\t} else {\n\t\t\t$multipage = 0;\n\t\t}\n\n\t\t$elements = compact( 'id', 'authordata', 'currentday', 'currentmonth', 'page', 'pages', 'multipage', 'more', 'numpages' );\n\n\t\treturn $elements;\n\t}\n\t/**\n\t * After looping through a nested query, this function\n\t * restores the $post global to the current post in this query.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @global WP_Post $post Global post object.\n\t */\n\tpublic function reset_postdata() {\n\t\tif ( ! empty( $this->post ) ) {\n\t\t\t$GLOBALS['post'] = $this->post;\n\t\t\t$this->setup_postdata( $this->post );\n\t\t}\n\t}\n\n\t/**\n\t * Lazyload term meta for posts in the loop.\n\t *\n\t * @since 4.4.0\n\t * @deprecated 4.5.0 See wp_queue_posts_for_term_meta_lazyload().\n\t *\n\t * @param mixed $check\n\t * @param int   $term_id\n\t * @return mixed\n\t */\n\tpublic function lazyload_term_meta( $check, $term_id ) {\n\t\t_deprecated_function( __METHOD__, '4.5.0' );\n\t\treturn $check;\n\t}\n\n\t/**\n\t * Lazyload comment meta for comments in the loop.\n\t *\n\t * @since 4.4.0\n\t * @deprecated 4.5.0 See wp_queue_comments_for_comment_meta_lazyload().\n\t *\n\t * @param mixed $check\n\t * @param int   $comment_id\n\t * @return mixed\n\t */\n\tpublic function lazyload_comment_meta( $check, $comment_id ) {\n\t\t_deprecated_function( __METHOD__, '4.5.0' );\n\t\treturn $check;\n\t}\n}\n", "num_lines": 4438}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Error Protection API: WP_Recovery_Mode_Cookie_Service class\n *\n * @package WordPress\n * @since 5.2.0\n */\n\n/**\n * Core class used to set, validate, and clear cookies that identify a Recovery Mode session.\n *\n * @since 5.2.0\n */\nfinal class WP_Recovery_Mode_Cookie_Service {\n\n\t/**\n\t * Checks whether the recovery mode cookie is set.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return bool True if the cookie is set, false otherwise.\n\t */\n\tpublic function is_cookie_set() {\n\t\treturn ! empty( $_COOKIE[ RECOVERY_MODE_COOKIE ] );\n\t}\n\n\t/**\n\t * Sets the recovery mode cookie.\n\t *\n\t * This must be immediately followed by exiting the request.\n\t *\n\t * @since 5.2.0\n\t */\n\tpublic function set_cookie() {\n\n\t\t$value = $this->generate_cookie();\n\n\t\t/**\n\t\t * Filter the length of time a Recovery Mode cookie is valid for.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param int $length Length in seconds.\n\t\t */\n\t\t$length = apply_filters( 'recovery_mode_cookie_length', WEEK_IN_SECONDS );\n\t\t$expire = time() + $length;\n\n\t\tsetcookie( RECOVERY_MODE_COOKIE, $value, $expire, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true );\n\n\t\tif ( COOKIEPATH !== SITECOOKIEPATH ) {\n\t\t\tsetcookie( RECOVERY_MODE_COOKIE, $value, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, is_ssl(), true );\n\t\t}\n\t}\n\n\t/**\n\t * Clears the recovery mode cookie.\n\t *\n\t * @since 5.2.0\n\t */\n\tpublic function clear_cookie() {\n\t\tsetcookie( RECOVERY_MODE_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN );\n\t\tsetcookie( RECOVERY_MODE_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );\n\t}\n\n\t/**\n\t * Validates the recovery mode cookie.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string $cookie Optionally specify the cookie string.\n\t *                       If omitted, it will be retrieved from the super global.\n\t * @return true|WP_Error True on success, error object on failure.\n\t */\n\tpublic function validate_cookie( $cookie = '' ) {\n\n\t\tif ( ! $cookie ) {\n\t\t\tif ( empty( $_COOKIE[ RECOVERY_MODE_COOKIE ] ) ) {\n\t\t\t\treturn new WP_Error( 'no_cookie', __( 'No cookie present.' ) );\n\t\t\t}\n\n\t\t\t$cookie = $_COOKIE[ RECOVERY_MODE_COOKIE ];\n\t\t}\n\n\t\t$parts = $this->parse_cookie( $cookie );\n\n\t\tif ( is_wp_error( $parts ) ) {\n\t\t\treturn $parts;\n\t\t}\n\n\t\tlist( , $created_at, $random, $signature ) = $parts;\n\n\t\tif ( ! ctype_digit( $created_at ) ) {\n\t\t\treturn new WP_Error( 'invalid_created_at', __( 'Invalid cookie format.' ) );\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/class-wp-recovery-mode-cookie-service.php */\n\t\t$length = apply_filters( 'recovery_mode_cookie_length', WEEK_IN_SECONDS );\n\n\t\tif ( time() > $created_at + $length ) {\n\t\t\treturn new WP_Error( 'expired', __( 'Cookie expired.' ) );\n\t\t}\n\n\t\t$to_sign = sprintf( 'recovery_mode|%s|%s', $created_at, $random );\n\t\t$hashed  = $this->recovery_mode_hash( $to_sign );\n\n\t\tif ( ! hash_equals( $signature, $hashed ) ) {\n\t\t\treturn new WP_Error( 'signature_mismatch', __( 'Invalid cookie.' ) );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Gets the session identifier from the cookie.\n\t *\n\t * The cookie should be validated before calling this API.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string $cookie Optionally specify the cookie string.\n\t *                       If omitted, it will be retrieved from the super global.\n\t * @return string|WP_Error Session ID on success, or error object on failure.\n\t */\n\tpublic function get_session_id_from_cookie( $cookie = '' ) {\n\t\tif ( ! $cookie ) {\n\t\t\tif ( empty( $_COOKIE[ RECOVERY_MODE_COOKIE ] ) ) {\n\t\t\t\treturn new WP_Error( 'no_cookie', __( 'No cookie present.' ) );\n\t\t\t}\n\n\t\t\t$cookie = $_COOKIE[ RECOVERY_MODE_COOKIE ];\n\t\t}\n\n\t\t$parts = $this->parse_cookie( $cookie );\n\t\tif ( is_wp_error( $parts ) ) {\n\t\t\treturn $parts;\n\t\t}\n\n\t\tlist( , , $random ) = $parts;\n\n\t\treturn sha1( $random );\n\t}\n\n\t/**\n\t * Parses the cookie into its four parts.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string $cookie Cookie content.\n\t * @return array|WP_Error Cookie parts array, or error object on failure.\n\t */\n\tprivate function parse_cookie( $cookie ) {\n\t\t$cookie = base64_decode( $cookie );\n\t\t$parts  = explode( '|', $cookie );\n\n\t\tif ( 4 !== count( $parts ) ) {\n\t\t\treturn new WP_Error( 'invalid_format', __( 'Invalid cookie format.' ) );\n\t\t}\n\n\t\treturn $parts;\n\t}\n\n\t/**\n\t * Generates the recovery mode cookie value.\n\t *\n\t * The cookie is a base64 encoded string with the following format:\n\t *\n\t * recovery_mode|iat|rand|signature\n\t *\n\t * Where \"recovery_mode\" is a constant string,\n\t * iat is the time the cookie was generated at,\n\t * rand is a randomly generated password that is also used as a session identifier\n\t * and signature is an hmac of the preceding 3 parts.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return string Generated cookie content.\n\t */\n\tprivate function generate_cookie() {\n\t\t$to_sign = sprintf( 'recovery_mode|%s|%s', time(), wp_generate_password( 20, false ) );\n\t\t$signed  = $this->recovery_mode_hash( $to_sign );\n\n\t\treturn base64_encode( sprintf( '%s|%s', $to_sign, $signed ) );\n\t}\n\n\t/**\n\t * Gets a form of `wp_hash()` specific to Recovery Mode.\n\t *\n\t * We cannot use `wp_hash()` because it is defined in `pluggable.php` which is not loaded until after plugins are loaded,\n\t * which is too late to verify the recovery mode cookie.\n\t *\n\t * This tries to use the `AUTH` salts first, but if they aren't valid specific salts will be generated and stored.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string $data Data to hash.\n\t * @return string|false The hashed $data, or false on failure.\n\t */\n\tprivate function recovery_mode_hash( $data ) {\n\t\tif ( ! defined( 'AUTH_KEY' ) || AUTH_KEY === 'put your unique phrase here' ) {\n\t\t\t$auth_key = get_site_option( 'recovery_mode_auth_key' );\n\n\t\t\tif ( ! $auth_key ) {\n\t\t\t\tif ( ! function_exists( 'wp_generate_password' ) ) {\n\t\t\t\t\trequire_once ABSPATH . WPINC . '/pluggable.php';\n\t\t\t\t}\n\n\t\t\t\t$auth_key = wp_generate_password( 64, true, true );\n\t\t\t\tupdate_site_option( 'recovery_mode_auth_key', $auth_key );\n\t\t\t}\n\t\t} else {\n\t\t\t$auth_key = AUTH_KEY;\n\t\t}\n\n\t\tif ( ! defined( 'AUTH_SALT' ) || AUTH_SALT === 'put your unique phrase here' || AUTH_SALT === $auth_key ) {\n\t\t\t$auth_salt = get_site_option( 'recovery_mode_auth_salt' );\n\n\t\t\tif ( ! $auth_salt ) {\n\t\t\t\tif ( ! function_exists( 'wp_generate_password' ) ) {\n\t\t\t\t\trequire_once ABSPATH . WPINC . '/pluggable.php';\n\t\t\t\t}\n\n\t\t\t\t$auth_salt = wp_generate_password( 64, true, true );\n\t\t\t\tupdate_site_option( 'recovery_mode_auth_salt', $auth_salt );\n\t\t\t}\n\t\t} else {\n\t\t\t$auth_salt = AUTH_SALT;\n\t\t}\n\n\t\t$secret = $auth_key . $auth_salt;\n\n\t\treturn hash_hmac( 'sha1', $data, $secret );\n\t}\n}\n", "num_lines": 234}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Error Protection API: WP_Recovery_Mode_Email_Link class\n *\n * @package WordPress\n * @since 5.2.0\n */\n\n/**\n * Core class used to send an email with a link to begin Recovery Mode.\n *\n * @since 5.2.0\n */\nfinal class WP_Recovery_Mode_Email_Service {\n\n\tconst RATE_LIMIT_OPTION = 'recovery_mode_email_last_sent';\n\n\t/**\n\t * Service to generate recovery mode URLs.\n\t *\n\t * @since 5.2.0\n\t * @var WP_Recovery_Mode_Link_Service\n\t */\n\tprivate $link_service;\n\n\t/**\n\t * WP_Recovery_Mode_Email_Service constructor.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param WP_Recovery_Mode_Link_Service $link_service\n\t */\n\tpublic function __construct( WP_Recovery_Mode_Link_Service $link_service ) {\n\t\t$this->link_service = $link_service;\n\t}\n\n\t/**\n\t * Sends the recovery mode email if the rate limit has not been sent.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param int   $rate_limit Number of seconds before another email can be sent.\n\t * @param array $error      Error details from {@see error_get_last()}\n\t * @param array $extension {\n\t *     The extension that caused the error.\n\t *\n\t *     @type string $slug The extension slug. The plugin or theme's directory.\n\t *     @type string $type The extension type. Either 'plugin' or 'theme'.\n\t * }\n\t * @return true|WP_Error True if email sent, WP_Error otherwise.\n\t */\n\tpublic function maybe_send_recovery_mode_email( $rate_limit, $error, $extension ) {\n\n\t\t$last_sent = get_option( self::RATE_LIMIT_OPTION );\n\n\t\tif ( ! $last_sent || time() > $last_sent + $rate_limit ) {\n\t\t\tif ( ! update_option( self::RATE_LIMIT_OPTION, time() ) ) {\n\t\t\t\treturn new WP_Error( 'storage_error', __( 'Could not update the email last sent time.' ) );\n\t\t\t}\n\n\t\t\t$sent = $this->send_recovery_mode_email( $rate_limit, $error, $extension );\n\n\t\t\tif ( $sent ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn new WP_Error(\n\t\t\t\t'email_failed',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: mail() */\n\t\t\t\t\t__( 'The email could not be sent. Possible reason: your host may have disabled the %s function.' ),\n\t\t\t\t\t'mail()'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$err_message = sprintf(\n\t\t\t/* translators: 1. Last sent as a human time diff, 2. Wait time as a human time diff. */\n\t\t\t__( 'A recovery link was already sent %1$s ago. Please wait another %2$s before requesting a new email.' ),\n\t\t\thuman_time_diff( $last_sent ),\n\t\t\thuman_time_diff( $last_sent + $rate_limit )\n\t\t);\n\n\t\treturn new WP_Error( 'email_sent_already', $err_message );\n\t}\n\n\t/**\n\t * Clears the rate limit, allowing a new recovery mode email to be sent immediately.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function clear_rate_limit() {\n\t\treturn delete_option( self::RATE_LIMIT_OPTION );\n\t}\n\n\t/**\n\t * Sends the Recovery Mode email to the site admin email address.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param int   $rate_limit Number of seconds before another email can be sent.\n\t * @param array $error      Error details from {@see error_get_last()}\n\t * @param array $extension  Extension that caused the error.\n\t * @return bool Whether the email was sent successfully.\n\t */\n\tprivate function send_recovery_mode_email( $rate_limit, $error, $extension ) {\n\n\t\t$url      = $this->link_service->generate_url();\n\t\t$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );\n\n\t\t$switched_locale = false;\n\n\t\t// The switch_to_locale() function is loaded before it can actually be used.\n\t\tif ( function_exists( 'switch_to_locale' ) && isset( $GLOBALS['wp_locale_switcher'] ) ) {\n\t\t\t$switched_locale = switch_to_locale( get_locale() );\n\t\t}\n\n\t\tif ( $extension ) {\n\t\t\t$cause   = $this->get_cause( $extension );\n\t\t\t$details = wp_strip_all_tags( wp_get_extension_error_description( $error ) );\n\n\t\t\tif ( $details ) {\n\t\t\t\t$header  = __( 'Error Details' );\n\t\t\t\t$details = \"\\n\\n\" . $header . \"\\n\" . str_pad( '', strlen( $header ), '=' ) . \"\\n\" . $details;\n\t\t\t}\n\t\t} else {\n\t\t\t$cause   = '';\n\t\t\t$details = '';\n\t\t}\n\n\t\t/**\n\t\t * Filters the support message sent with the the fatal error protection email.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param string $message The Message to include in the email.\n\t\t */\n\t\t$support = apply_filters( 'recovery_email_support_info', __( 'Please contact your host for assistance with investigating this issue further.' ) );\n\n\t\t/**\n\t\t * Filters the debug information included in the fatal error protection email.\n\t\t *\n\t\t * @since 5.3.0\n\t\t *\n\t\t * @param array $message An associative array of debug information.\n\t\t */\n\t\t$debug = apply_filters( 'recovery_email_debug_info', $this->get_debug( $extension ) );\n\n\t\t/* translators: Do not translate LINK, EXPIRES, CAUSE, DETAILS, SITEURL, PAGEURL, SUPPORT. DEBUG: those are placeholders. */\n\t\t$message = __(\n\t\t\t'Howdy!\n\nSince WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.\n###CAUSE###\nFirst, visit your website (###SITEURL###) and check for any visible issues. Next, visit the page where the error was caught (###PAGEURL###) and check for any visible issues.\n\n###SUPPORT###\n\nIf your site appears broken and you can\\'t access your dashboard normally, WordPress now has a special \"recovery mode\". This lets you safely login to your dashboard and investigate further.\n\n###LINK###\n\nTo keep your site safe, this link will expire in ###EXPIRES###. Don\\'t worry about that, though: a new link will be emailed to you if the error occurs again after it expires.\n\nWhen seeking help with this issue, you may be asked for some of the following information:\n###DEBUG###\n\n###DETAILS###'\n\t\t);\n\t\t$message = str_replace(\n\t\t\tarray(\n\t\t\t\t'###LINK###',\n\t\t\t\t'###EXPIRES###',\n\t\t\t\t'###CAUSE###',\n\t\t\t\t'###DETAILS###',\n\t\t\t\t'###SITEURL###',\n\t\t\t\t'###PAGEURL###',\n\t\t\t\t'###SUPPORT###',\n\t\t\t\t'###DEBUG###',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t$url,\n\t\t\t\thuman_time_diff( time() + $rate_limit ),\n\t\t\t\t$cause ? \"\\n{$cause}\\n\" : \"\\n\",\n\t\t\t\t$details,\n\t\t\t\thome_url( '/' ),\n\t\t\t\thome_url( $_SERVER['REQUEST_URI'] ),\n\t\t\t\t$support,\n\t\t\t\timplode( \"\\r\\n\", $debug ),\n\t\t\t),\n\t\t\t$message\n\t\t);\n\n\t\t$email = array(\n\t\t\t'to'      => $this->get_recovery_mode_email_address(),\n\t\t\t/* translators: %s: Site title. */\n\t\t\t'subject' => __( '[%s] Your Site is Experiencing a Technical Issue' ),\n\t\t\t'message' => $message,\n\t\t\t'headers' => '',\n\t\t);\n\n\t\t/**\n\t\t * Filter the contents of the Recovery Mode email.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param array  $email Used to build wp_mail().\n\t\t * @param string $url   URL to enter recovery mode.\n\t\t */\n\t\t$email = apply_filters( 'recovery_mode_email', $email, $url );\n\n\t\t$sent = wp_mail(\n\t\t\t$email['to'],\n\t\t\twp_specialchars_decode( sprintf( $email['subject'], $blogname ) ),\n\t\t\t$email['message'],\n\t\t\t$email['headers']\n\t\t);\n\n\t\tif ( $switched_locale ) {\n\t\t\trestore_previous_locale();\n\t\t}\n\n\t\treturn $sent;\n\t}\n\n\t/**\n\t * Gets the email address to send the recovery mode link to.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return string Email address to send recovery mode link to.\n\t */\n\tprivate function get_recovery_mode_email_address() {\n\t\tif ( defined( 'RECOVERY_MODE_EMAIL' ) && is_email( RECOVERY_MODE_EMAIL ) ) {\n\t\t\treturn RECOVERY_MODE_EMAIL;\n\t\t}\n\n\t\treturn get_option( 'admin_email' );\n\t}\n\n\t/**\n\t * Gets the description indicating the possible cause for the error.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param array $extension The extension that caused the error.\n\t * @return string Message about which extension caused the error.\n\t */\n\tprivate function get_cause( $extension ) {\n\n\t\tif ( 'plugin' === $extension['type'] ) {\n\t\t\t$plugin = $this->get_plugin( $extension );\n\n\t\t\tif ( false === $plugin ) {\n\t\t\t\t$name = $extension['slug'];\n\t\t\t} else {\n\t\t\t\t$name = $plugin['Name'];\n\t\t\t}\n\n\t\t\t/* translators: %s: Plugin name. */\n\t\t\t$cause = sprintf( __( 'In this case, WordPress caught an error with one of your plugins, %s.' ), $name );\n\t\t} else {\n\t\t\t$theme = wp_get_theme( $extension['slug'] );\n\t\t\t$name  = $theme->exists() ? $theme->display( 'Name' ) : $extension['slug'];\n\n\t\t\t/* translators: %s: Theme name. */\n\t\t\t$cause = sprintf( __( 'In this case, WordPress caught an error with your theme, %s.' ), $name );\n\t\t}\n\n\t\treturn $cause;\n\t}\n\n\t/**\n\t * Return the details for a single plugin based on the extension data from an error.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param array $extension The extension that caused the error.\n\t * @return bool|array A plugin array {@see get_plugins()} or `false` if no plugin was found.\n\t */\n\tprivate function get_plugin( $extension ) {\n\t\tif ( ! function_exists( 'get_plugins' ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\t\t}\n\n\t\t$plugins = get_plugins();\n\n\t\t// Assume plugin main file name first since it is a common convention.\n\t\tif ( isset( $plugins[ \"{$extension['slug']}/{$extension['slug']}.php\" ] ) ) {\n\t\t\treturn $plugins[ \"{$extension['slug']}/{$extension['slug']}.php\" ];\n\t\t} else {\n\t\t\tforeach ( $plugins as $file => $plugin_data ) {\n\t\t\t\tif ( 0 === strpos( $file, \"{$extension['slug']}/\" ) || $file === $extension['slug'] ) {\n\t\t\t\t\treturn $plugin_data;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Return debug information in an easy to manipulate format.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param array $extension The extension that caused the error.\n\t * @return array An associative array of debug information.\n\t */\n\tprivate function get_debug( $extension ) {\n\t\t$theme      = wp_get_theme();\n\t\t$wp_version = get_bloginfo( 'version' );\n\n\t\tif ( $extension ) {\n\t\t\t$plugin = $this->get_plugin( $extension );\n\t\t} else {\n\t\t\t$plugin = null;\n\t\t}\n\n\t\t$debug = array(\n\t\t\t/* translators: %s: Current WordPress version number. */\n\t\t\t'wp'    => sprintf(\n\t\t\t\t__( 'WordPress version %s' ),\n\t\t\t\t$wp_version\n\t\t\t),\n\t\t\t'theme' => sprintf(\n\t\t\t\t/* translators: 1: Current active theme name. 2: Current active theme version. */\n\t\t\t\t__( 'Current theme: %1$s (version %2$s)' ),\n\t\t\t\t$theme->get( 'Name' ),\n\t\t\t\t$theme->get( 'Version' )\n\t\t\t),\n\t\t);\n\n\t\tif ( null !== $plugin ) {\n\t\t\t$debug['plugin'] = sprintf(\n\t\t\t\t/* translators: 1: The failing plugins name. 2: The failing plugins version. */\n\t\t\t\t__( 'Current plugin: %1$s (version %2$s)' ),\n\t\t\t\t$plugin['Name'],\n\t\t\t\t$plugin['Version']\n\t\t\t);\n\t\t}\n\n\t\t$debug['php'] = sprintf(\n\t\t\t/* translators: %s: The currently used PHP version. */\n\t\t\t__( 'PHP version %s' ),\n\t\t\tPHP_VERSION\n\t\t);\n\n\t\treturn $debug;\n\t}\n}\n", "num_lines": 354}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Error Protection API: WP_Recovery_Mode_Key_Service class\n *\n * @package WordPress\n * @since 5.2.0\n */\n\n/**\n * Core class used to generate and validate keys used to enter Recovery Mode.\n *\n * @since 5.2.0\n */\nfinal class WP_Recovery_Mode_Key_Service {\n\n\t/**\n\t * The option name used to store the keys.\n\t *\n\t * @since 5.2.0\n\t * @var string\n\t */\n\tprivate $option_name = 'recovery_keys';\n\n\t/**\n\t * Creates a recovery mode token.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return string A random string to identify its associated key in storage.\n\t */\n\tpublic function generate_recovery_mode_token() {\n\t\treturn wp_generate_password( 22, false );\n\t}\n\n\t/**\n\t * Creates a recovery mode key.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @global PasswordHash $wp_hasher\n\t *\n\t * @param string $token A token generated by {@see generate_recovery_mode_token()}.\n\t * @return string Recovery mode key.\n\t */\n\tpublic function generate_and_store_recovery_mode_key( $token ) {\n\n\t\tglobal $wp_hasher;\n\n\t\t$key = wp_generate_password( 22, false );\n\n\t\tif ( empty( $wp_hasher ) ) {\n\t\t\trequire_once ABSPATH . WPINC . '/class-phpass.php';\n\t\t\t$wp_hasher = new PasswordHash( 8, true );\n\t\t}\n\n\t\t$hashed = $wp_hasher->HashPassword( $key );\n\n\t\t$records = $this->get_keys();\n\n\t\t$records[ $token ] = array(\n\t\t\t'hashed_key' => $hashed,\n\t\t\t'created_at' => time(),\n\t\t);\n\n\t\t$this->update_keys( $records );\n\n\t\t/**\n\t\t * Fires when a recovery mode key is generated.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param string $token The recovery data token.\n\t\t * @param string $key   The recovery mode key.\n\t\t */\n\t\tdo_action( 'generate_recovery_mode_key', $token, $key );\n\n\t\treturn $key;\n\t}\n\n\t/**\n\t * Verifies if the recovery mode key is correct.\n\t *\n\t * Recovery mode keys can only be used once; the key will be consumed in the process.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string $token The token used when generating the given key.\n\t * @param string $key   The unhashed key.\n\t * @param int    $ttl   Time in seconds for the key to be valid for.\n\t * @return true|WP_Error True on success, error object on failure.\n\t */\n\tpublic function validate_recovery_mode_key( $token, $key, $ttl ) {\n\n\t\t$records = $this->get_keys();\n\n\t\tif ( ! isset( $records[ $token ] ) ) {\n\t\t\treturn new WP_Error( 'token_not_found', __( 'Recovery Mode not initialized.' ) );\n\t\t}\n\n\t\t$record = $records[ $token ];\n\n\t\t$this->remove_key( $token );\n\n\t\tif ( ! is_array( $record ) || ! isset( $record['hashed_key'], $record['created_at'] ) ) {\n\t\t\treturn new WP_Error( 'invalid_recovery_key_format', __( 'Invalid recovery key format.' ) );\n\t\t}\n\n\t\tif ( ! wp_check_password( $key, $record['hashed_key'] ) ) {\n\t\t\treturn new WP_Error( 'hash_mismatch', __( 'Invalid recovery key.' ) );\n\t\t}\n\n\t\tif ( time() > $record['created_at'] + $ttl ) {\n\t\t\treturn new WP_Error( 'key_expired', __( 'Recovery key expired.' ) );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Removes expired recovery mode keys.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param int $ttl Time in seconds for the keys to be valid for.\n\t */\n\tpublic function clean_expired_keys( $ttl ) {\n\n\t\t$records = $this->get_keys();\n\n\t\tforeach ( $records as $key => $record ) {\n\t\t\tif ( ! isset( $record['created_at'] ) || time() > $record['created_at'] + $ttl ) {\n\t\t\t\tunset( $records[ $key ] );\n\t\t\t}\n\t\t}\n\n\t\t$this->update_keys( $records );\n\t}\n\n\t/**\n\t * Removes a used recovery key.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string $token The token used when generating a recovery mode key.\n\t */\n\tprivate function remove_key( $token ) {\n\n\t\t$records = $this->get_keys();\n\n\t\tif ( ! isset( $records[ $token ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tunset( $records[ $token ] );\n\n\t\t$this->update_keys( $records );\n\t}\n\n\t/**\n\t * Gets the recovery key records.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return array Associative array of $token => $data pairs, where $data has keys 'hashed_key'\n\t *               and 'created_at'.\n\t */\n\tprivate function get_keys() {\n\t\treturn (array) get_option( $this->option_name, array() );\n\t}\n\n\t/**\n\t * Updates the recovery key records.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param array $keys Associative array of $token => $data pairs, where $data has keys 'hashed_key'\n\t *                    and 'created_at'.\n\t * @return bool True on success, false on failure.\n\t */\n\tprivate function update_keys( array $keys ) {\n\t\treturn update_option( $this->option_name, $keys );\n\t}\n}\n", "num_lines": 184}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Error Protection API: WP_Recovery_Mode_Link_Handler class\n *\n * @package WordPress\n * @since 5.2.0\n */\n\n/**\n * Core class used to generate and handle recovery mode links.\n *\n * @since 5.2.0\n */\nclass WP_Recovery_Mode_Link_Service {\n\tconst LOGIN_ACTION_ENTER   = 'enter_recovery_mode';\n\tconst LOGIN_ACTION_ENTERED = 'entered_recovery_mode';\n\n\t/**\n\t * Service to generate and validate recovery mode keys.\n\t *\n\t * @since 5.2.0\n\t * @var WP_Recovery_Mode_Key_Service\n\t */\n\tprivate $key_service;\n\n\t/**\n\t * Service to handle cookies.\n\t *\n\t * @since 5.2.0\n\t * @var WP_Recovery_Mode_Cookie_Service\n\t */\n\tprivate $cookie_service;\n\n\t/**\n\t * WP_Recovery_Mode_Link_Service constructor.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param WP_Recovery_Mode_Cookie_Service $cookie_service Service to handle setting the recovery mode cookie.\n\t * @param WP_Recovery_Mode_Key_Service    $key_service    Service to handle generating recovery mode keys.\n\t */\n\tpublic function __construct( WP_Recovery_Mode_Cookie_Service $cookie_service, WP_Recovery_Mode_Key_Service $key_service ) {\n\t\t$this->cookie_service = $cookie_service;\n\t\t$this->key_service    = $key_service;\n\t}\n\n\t/**\n\t * Generates a URL to begin recovery mode.\n\t *\n\t * Only one recovery mode URL can may be valid at the same time.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return string Generated URL.\n\t */\n\tpublic function generate_url() {\n\t\t$token = $this->key_service->generate_recovery_mode_token();\n\t\t$key   = $this->key_service->generate_and_store_recovery_mode_key( $token );\n\n\t\treturn $this->get_recovery_mode_begin_url( $token, $key );\n\t}\n\n\t/**\n\t * Enters recovery mode when the user hits wp-login.php with a valid recovery mode link.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param int $ttl Number of seconds the link should be valid for.\n\t */\n\tpublic function handle_begin_link( $ttl ) {\n\t\tif ( ! isset( $GLOBALS['pagenow'] ) || 'wp-login.php' !== $GLOBALS['pagenow'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! isset( $_GET['action'], $_GET['rm_token'], $_GET['rm_key'] ) || self::LOGIN_ACTION_ENTER !== $_GET['action'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! function_exists( 'wp_generate_password' ) ) {\n\t\t\trequire_once ABSPATH . WPINC . '/pluggable.php';\n\t\t}\n\n\t\t$validated = $this->key_service->validate_recovery_mode_key( $_GET['rm_token'], $_GET['rm_key'], $ttl );\n\n\t\tif ( is_wp_error( $validated ) ) {\n\t\t\twp_die( $validated, '' );\n\t\t}\n\n\t\t$this->cookie_service->set_cookie();\n\n\t\t$url = add_query_arg( 'action', self::LOGIN_ACTION_ENTERED, wp_login_url() );\n\t\twp_redirect( $url );\n\t\tdie;\n\t}\n\n\t/**\n\t * Gets a URL to begin recovery mode.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string $token Recovery Mode token created by {@see generate_recovery_mode_token()}.\n\t * @param string $key   Recovery Mode key created by {@see generate_and_store_recovery_mode_key()}.\n\t * @return string Recovery mode begin URL.\n\t */\n\tprivate function get_recovery_mode_begin_url( $token, $key ) {\n\n\t\t$url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'action'   => self::LOGIN_ACTION_ENTER,\n\t\t\t\t'rm_token' => $token,\n\t\t\t\t'rm_key'   => $key,\n\t\t\t),\n\t\t\twp_login_url()\n\t\t);\n\n\t\t/**\n\t\t * Filter the URL to begin recovery mode.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param string $url   The generated recovery mode begin URL.\n\t\t * @param string $token The token used to identify the key.\n\t\t * @param string $key   The recovery mode key.\n\t\t */\n\t\treturn apply_filters( 'recovery_mode_begin_url', $url, $token, $key );\n\t}\n}\n", "num_lines": 128}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Error Protection API: WP_Recovery_Mode class\n *\n * @package WordPress\n * @since 5.2.0\n */\n\n/**\n * Core class used to implement Recovery Mode.\n *\n * @since 5.2.0\n */\nclass WP_Recovery_Mode {\n\n\tconst EXIT_ACTION = 'exit_recovery_mode';\n\n\t/**\n\t * Service to handle cookies.\n\t *\n\t * @since 5.2.0\n\t * @var WP_Recovery_Mode_Cookie_Service\n\t */\n\tprivate $cookie_service;\n\n\t/**\n\t * Service to generate a recovery mode key.\n\t *\n\t * @since 5.2.0\n\t * @var WP_Recovery_Mode_Key_Service\n\t */\n\tprivate $key_service;\n\n\t/**\n\t * Service to generate and validate recovery mode links.\n\t *\n\t * @since 5.2.0\n\t * @var WP_Recovery_Mode_Link_Service\n\t */\n\tprivate $link_service;\n\n\t/**\n\t * Service to handle sending an email with a recovery mode link.\n\t *\n\t * @since 5.2.0\n\t * @var WP_Recovery_Mode_Email_Service\n\t */\n\tprivate $email_service;\n\n\t/**\n\t * Is recovery mode initialized.\n\t *\n\t * @since 5.2.0\n\t * @var bool\n\t */\n\tprivate $is_initialized = false;\n\n\t/**\n\t * Is recovery mode active in this session.\n\t *\n\t * @since 5.2.0\n\t * @var bool\n\t */\n\tprivate $is_active = false;\n\n\t/**\n\t * Get an ID representing the current recovery mode session.\n\t *\n\t * @since 5.2.0\n\t * @var string\n\t */\n\tprivate $session_id = '';\n\n\t/**\n\t * WP_Recovery_Mode constructor.\n\t *\n\t * @since 5.2.0\n\t */\n\tpublic function __construct() {\n\t\t$this->cookie_service = new WP_Recovery_Mode_Cookie_Service();\n\t\t$this->key_service    = new WP_Recovery_Mode_Key_Service();\n\t\t$this->link_service   = new WP_Recovery_Mode_Link_Service( $this->cookie_service, $this->key_service );\n\t\t$this->email_service  = new WP_Recovery_Mode_Email_Service( $this->link_service );\n\t}\n\n\t/**\n\t * Initialize recovery mode for the current request.\n\t *\n\t * @since 5.2.0\n\t */\n\tpublic function initialize() {\n\t\t$this->is_initialized = true;\n\n\t\tadd_action( 'wp_logout', array( $this, 'exit_recovery_mode' ) );\n\t\tadd_action( 'login_form_' . self::EXIT_ACTION, array( $this, 'handle_exit_recovery_mode' ) );\n\t\tadd_action( 'recovery_mode_clean_expired_keys', array( $this, 'clean_expired_keys' ) );\n\n\t\tif ( ! wp_next_scheduled( 'recovery_mode_clean_expired_keys' ) && ! wp_installing() ) {\n\t\t\twp_schedule_event( time(), 'daily', 'recovery_mode_clean_expired_keys' );\n\t\t}\n\n\t\tif ( defined( 'WP_RECOVERY_MODE_SESSION_ID' ) ) {\n\t\t\t$this->is_active  = true;\n\t\t\t$this->session_id = WP_RECOVERY_MODE_SESSION_ID;\n\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $this->cookie_service->is_cookie_set() ) {\n\t\t\t$this->handle_cookie();\n\n\t\t\treturn;\n\t\t}\n\n\t\t$this->link_service->handle_begin_link( $this->get_link_ttl() );\n\t}\n\n\t/**\n\t * Checks whether recovery mode is active.\n\t *\n\t * This will not change after recovery mode has been initialized. {@see WP_Recovery_Mode::run()}.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return bool True if recovery mode is active, false otherwise.\n\t */\n\tpublic function is_active() {\n\t\treturn $this->is_active;\n\t}\n\n\t/**\n\t * Gets the recovery mode session ID.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return string The session ID if recovery mode is active, empty string otherwise.\n\t */\n\tpublic function get_session_id() {\n\t\treturn $this->session_id;\n\t}\n\n\t/**\n\t * Checks whether recovery mode has been initialized.\n\t *\n\t * Recovery mode should not be used until this point. Initialization happens immediately before loading plugins.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return bool\n\t */\n\tpublic function is_initialized() {\n\t\treturn $this->is_initialized;\n\t}\n\n\t/**\n\t * Handles a fatal error occurring.\n\t *\n\t * The calling API should immediately die() after calling this function.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param array $error Error details from {@see error_get_last()}\n\t * @return true|WP_Error True if the error was handled and headers have already been sent.\n\t *                       Or the request will exit to try and catch multiple errors at once.\n\t *                       WP_Error if an error occurred preventing it from being handled.\n\t */\n\tpublic function handle_error( array $error ) {\n\n\t\t$extension = $this->get_extension_for_error( $error );\n\n\t\tif ( ! $extension || $this->is_network_plugin( $extension ) ) {\n\t\t\treturn new WP_Error( 'invalid_source', __( 'Error not caused by a plugin or theme.' ) );\n\t\t}\n\n\t\tif ( ! $this->is_active() ) {\n\t\t\tif ( ! is_protected_endpoint() ) {\n\t\t\t\treturn new WP_Error( 'non_protected_endpoint', __( 'Error occurred on a non-protected endpoint.' ) );\n\t\t\t}\n\n\t\t\tif ( ! function_exists( 'wp_generate_password' ) ) {\n\t\t\t\trequire_once ABSPATH . WPINC . '/pluggable.php';\n\t\t\t}\n\n\t\t\treturn $this->email_service->maybe_send_recovery_mode_email( $this->get_email_rate_limit(), $error, $extension );\n\t\t}\n\n\t\tif ( ! $this->store_error( $error ) ) {\n\t\t\treturn new WP_Error( 'storage_error', __( 'Failed to store the error.' ) );\n\t\t}\n\n\t\tif ( headers_sent() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->redirect_protected();\n\t}\n\n\t/**\n\t * Ends the current recovery mode session.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function exit_recovery_mode() {\n\t\tif ( ! $this->is_active() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->email_service->clear_rate_limit();\n\t\t$this->cookie_service->clear_cookie();\n\n\t\twp_paused_plugins()->delete_all();\n\t\twp_paused_themes()->delete_all();\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Handles a request to exit Recovery Mode.\n\t *\n\t * @since 5.2.0\n\t */\n\tpublic function handle_exit_recovery_mode() {\n\t\t$redirect_to = wp_get_referer();\n\n\t\t// Safety check in case referrer returns false.\n\t\tif ( ! $redirect_to ) {\n\t\t\t$redirect_to = is_user_logged_in() ? admin_url() : home_url();\n\t\t}\n\n\t\tif ( ! $this->is_active() ) {\n\t\t\twp_safe_redirect( $redirect_to );\n\t\t\tdie;\n\t\t}\n\n\t\tif ( ! isset( $_GET['action'] ) || self::EXIT_ACTION !== $_GET['action'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], self::EXIT_ACTION ) ) {\n\t\t\twp_die( __( 'Exit recovery mode link expired.' ), 403 );\n\t\t}\n\n\t\tif ( ! $this->exit_recovery_mode() ) {\n\t\t\twp_die( __( 'Failed to exit recovery mode. Please try again later.' ) );\n\t\t}\n\n\t\twp_safe_redirect( $redirect_to );\n\t\tdie;\n\t}\n\n\t/**\n\t * Cleans any recovery mode keys that have expired according to the link TTL.\n\t *\n\t * Executes on a daily cron schedule.\n\t *\n\t * @since 5.2.0\n\t */\n\tpublic function clean_expired_keys() {\n\t\t$this->key_service->clean_expired_keys( $this->get_link_ttl() );\n\t}\n\n\t/**\n\t * Handles checking for the recovery mode cookie and validating it.\n\t *\n\t * @since 5.2.0\n\t */\n\tprotected function handle_cookie() {\n\t\t$validated = $this->cookie_service->validate_cookie();\n\n\t\tif ( is_wp_error( $validated ) ) {\n\t\t\t$this->cookie_service->clear_cookie();\n\n\t\t\t$validated->add_data( array( 'status' => 403 ) );\n\t\t\twp_die( $validated );\n\t\t}\n\n\t\t$session_id = $this->cookie_service->get_session_id_from_cookie();\n\t\tif ( is_wp_error( $session_id ) ) {\n\t\t\t$this->cookie_service->clear_cookie();\n\n\t\t\t$session_id->add_data( array( 'status' => 403 ) );\n\t\t\twp_die( $session_id );\n\t\t}\n\n\t\t$this->is_active  = true;\n\t\t$this->session_id = $session_id;\n\t}\n\n\t/**\n\t * Gets the rate limit between sending new recovery mode email links.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return int Rate limit in seconds.\n\t */\n\tprotected function get_email_rate_limit() {\n\t\t/**\n\t\t * Filter the rate limit between sending new recovery mode email links.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param int $rate_limit Time to wait in seconds. Defaults to 1 day.\n\t\t */\n\t\treturn apply_filters( 'recovery_mode_email_rate_limit', DAY_IN_SECONDS );\n\t}\n\n\t/**\n\t * Gets the number of seconds the recovery mode link is valid for.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @return int Interval in seconds.\n\t */\n\tprotected function get_link_ttl() {\n\n\t\t$rate_limit = $this->get_email_rate_limit();\n\t\t$valid_for  = $rate_limit;\n\n\t\t/**\n\t\t * Filter the amount of time the recovery mode email link is valid for.\n\t\t *\n\t\t * The ttl must be at least as long as the email rate limit.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param int $valid_for The number of seconds the link is valid for.\n\t\t */\n\t\t$valid_for = apply_filters( 'recovery_mode_email_link_ttl', $valid_for );\n\n\t\treturn max( $valid_for, $rate_limit );\n\t}\n\n\t/**\n\t * Gets the extension that the error occurred in.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @global array $wp_theme_directories\n\t *\n\t * @param array $error Error that was triggered.\n\t * @return array|false {\n\t *     Extension details.\n\t *\n\t *     @type string $slug The extension slug. This is the plugin or theme's directory.\n\t *     @type string $type The extension type. Either 'plugin' or 'theme'.\n\t * }\n\t */\n\tprotected function get_extension_for_error( $error ) {\n\t\tglobal $wp_theme_directories;\n\n\t\tif ( ! isset( $error['file'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! defined( 'WP_PLUGIN_DIR' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$error_file    = wp_normalize_path( $error['file'] );\n\t\t$wp_plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );\n\n\t\tif ( 0 === strpos( $error_file, $wp_plugin_dir ) ) {\n\t\t\t$path  = str_replace( $wp_plugin_dir . '/', '', $error_file );\n\t\t\t$parts = explode( '/', $path );\n\n\t\t\treturn array(\n\t\t\t\t'type' => 'plugin',\n\t\t\t\t'slug' => $parts[0],\n\t\t\t);\n\t\t}\n\n\t\tif ( empty( $wp_theme_directories ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ( $wp_theme_directories as $theme_directory ) {\n\t\t\t$theme_directory = wp_normalize_path( $theme_directory );\n\n\t\t\tif ( 0 === strpos( $error_file, $theme_directory ) ) {\n\t\t\t\t$path  = str_replace( $theme_directory . '/', '', $error_file );\n\t\t\t\t$parts = explode( '/', $path );\n\n\t\t\t\treturn array(\n\t\t\t\t\t'type' => 'theme',\n\t\t\t\t\t'slug' => $parts[0],\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks whether the given extension a network activated plugin.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param array $extension Extension data.\n\t * @return bool True if network plugin, false otherwise.\n\t */\n\tprotected function is_network_plugin( $extension ) {\n\t\tif ( 'plugin' !== $extension['type'] ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! is_multisite() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$network_plugins = wp_get_active_network_plugins();\n\n\t\tforeach ( $network_plugins as $plugin ) {\n\t\t\tif ( 0 === strpos( $plugin, $extension['slug'] . '/' ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Stores the given error so that the extension causing it is paused.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param array $error Error that was triggered.\n\t * @return bool True if the error was stored successfully, false otherwise.\n\t */\n\tprotected function store_error( $error ) {\n\t\t$extension = $this->get_extension_for_error( $error );\n\n\t\tif ( ! $extension ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch ( $extension['type'] ) {\n\t\t\tcase 'plugin':\n\t\t\t\treturn wp_paused_plugins()->set( $extension['slug'], $error );\n\t\t\tcase 'theme':\n\t\t\t\treturn wp_paused_themes()->set( $extension['slug'], $error );\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Redirects the current request to allow recovering multiple errors in one go.\n\t *\n\t * The redirection will only happen when on a protected endpoint.\n\t *\n\t * It must be ensured that this method is only called when an error actually occurred and will not occur on the\n\t * next request again. Otherwise it will create a redirect loop.\n\t *\n\t * @since 5.2.0\n\t */\n\tprotected function redirect_protected() {\n\t\t// Pluggable is usually loaded after plugins, so we manually include it here for redirection functionality.\n\t\tif ( ! function_exists( 'wp_safe_redirect' ) ) {\n\t\t\trequire_once ABSPATH . WPINC . '/pluggable.php';\n\t\t}\n\n\t\t$scheme = is_ssl() ? 'https://' : 'http://';\n\n\t\t$url = \"{$scheme}{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}\";\n\t\twp_safe_redirect( $url );\n\t\texit;\n\t}\n}\n", "num_lines": 471}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Rewrite API: WP_Rewrite class\n *\n * @package WordPress\n * @subpackage Rewrite\n * @since 1.5.0\n */\n\n/**\n * Core class used to implement a rewrite component API.\n *\n * The WordPress Rewrite class writes the rewrite module rules to the .htaccess\n * file. It also handles parsing the request to get the correct setup for the\n * WordPress Query class.\n *\n * The Rewrite along with WP class function as a front controller for WordPress.\n * You can add rules to trigger your page view and processing using this\n * component. The full functionality of a front controller does not exist,\n * meaning you can't define how the template files load based on the rewrite\n * rules.\n *\n * @since 1.5.0\n */\nclass WP_Rewrite {\n\t/**\n\t * Permalink structure for posts.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tpublic $permalink_structure;\n\n\t/**\n\t * Whether to add trailing slashes.\n\t *\n\t * @since 2.2.0\n\t * @var bool\n\t */\n\tpublic $use_trailing_slashes;\n\n\t/**\n\t * Base for the author permalink structure (example.com/$author_base/authorname).\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tvar $author_base = 'author';\n\n\t/**\n\t * Permalink structure for author archives.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tvar $author_structure;\n\n\t/**\n\t * Permalink structure for date archives.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tvar $date_structure;\n\n\t/**\n\t * Permalink structure for pages.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tvar $page_structure;\n\n\t/**\n\t * Base of the search permalink structure (example.com/$search_base/query).\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tvar $search_base = 'search';\n\n\t/**\n\t * Permalink structure for searches.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tvar $search_structure;\n\n\t/**\n\t * Comments permalink base.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tvar $comments_base = 'comments';\n\n\t/**\n\t * Pagination permalink base.\n\t *\n\t * @since 3.1.0\n\t * @var string\n\t */\n\tpublic $pagination_base = 'page';\n\n\t/**\n\t * Comments pagination permalink base.\n\t *\n\t * @since 4.2.0\n\t * @var string\n\t */\n\tvar $comments_pagination_base = 'comment-page';\n\n\t/**\n\t * Feed permalink base.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tvar $feed_base = 'feed';\n\n\t/**\n\t * Comments feed permalink structure.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tvar $comment_feed_structure;\n\n\t/**\n\t * Feed request permalink structure.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tvar $feed_structure;\n\n\t/**\n\t * The static portion of the post permalink structure.\n\t *\n\t * If the permalink structure is \"/archive/%post_id%\" then the front\n\t * is \"/archive/\". If the permalink structure is \"/%year%/%postname%/\"\n\t * then the front is \"/\".\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t *\n\t * @see WP_Rewrite::init()\n\t */\n\tpublic $front;\n\n\t/**\n\t * The prefix for all permalink structures.\n\t *\n\t * If PATHINFO/index permalinks are in use then the root is the value of\n\t * `WP_Rewrite::$index` with a trailing slash appended. Otherwise the root\n\t * will be empty.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t *\n\t * @see WP_Rewrite::init()\n\t * @see WP_Rewrite::using_index_permalinks()\n\t */\n\tpublic $root = '';\n\n\t/**\n\t * The name of the index file which is the entry point to all requests.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tpublic $index = 'index.php';\n\n\t/**\n\t * Variable name to use for regex matches in the rewritten query.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tvar $matches = '';\n\n\t/**\n\t * Rewrite rules to match against the request to find the redirect or query.\n\t *\n\t * @since 1.5.0\n\t * @var array\n\t */\n\tvar $rules;\n\n\t/**\n\t * Additional rules added external to the rewrite class.\n\t *\n\t * Those not generated by the class, see add_rewrite_rule().\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t */\n\tvar $extra_rules = array();\n\n\t/**\n\t * Additional rules that belong at the beginning to match first.\n\t *\n\t * Those not generated by the class, see add_rewrite_rule().\n\t *\n\t * @since 2.3.0\n\t * @var array\n\t */\n\tvar $extra_rules_top = array();\n\n\t/**\n\t * Rules that don't redirect to WordPress' index.php.\n\t *\n\t * These rules are written to the mod_rewrite portion of the .htaccess,\n\t * and are added by add_external_rule().\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t */\n\tvar $non_wp_rules = array();\n\n\t/**\n\t * Extra permalink structures, e.g. categories, added by add_permastruct().\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t */\n\tvar $extra_permastructs = array();\n\n\t/**\n\t * Endpoints (like /trackback/) added by add_rewrite_endpoint().\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t */\n\tvar $endpoints;\n\n\t/**\n\t * Whether to write every mod_rewrite rule for WordPress into the .htaccess file.\n\t *\n\t * This is off by default, turning it on might print a lot of rewrite rules\n\t * to the .htaccess file.\n\t *\n\t * @since 2.0.0\n\t * @var bool\n\t *\n\t * @see WP_Rewrite::mod_rewrite_rules()\n\t */\n\tpublic $use_verbose_rules = false;\n\n\t/**\n\t * Could post permalinks be confused with those of pages?\n\t *\n\t * If the first rewrite tag in the post permalink structure is one that could\n\t * also match a page name (e.g. %postname% or %author%) then this flag is\n\t * set to true. Prior to WordPress 3.3 this flag indicated that every page\n\t * would have a set of rules added to the top of the rewrite rules array.\n\t * Now it tells WP::parse_request() to check if a URL matching the page\n\t * permastruct is actually a page before accepting it.\n\t *\n\t * @since 2.5.0\n\t * @var bool\n\t *\n\t * @see WP_Rewrite::init()\n\t */\n\tpublic $use_verbose_page_rules = true;\n\n\t/**\n\t * Rewrite tags that can be used in permalink structures.\n\t *\n\t * These are translated into the regular expressions stored in\n\t * `WP_Rewrite::$rewritereplace` and are rewritten to the query\n\t * variables listed in WP_Rewrite::$queryreplace.\n\t *\n\t * Additional tags can be added with add_rewrite_tag().\n\t *\n\t * @since 1.5.0\n\t * @var array\n\t */\n\tvar $rewritecode = array(\n\t\t'%year%',\n\t\t'%monthnum%',\n\t\t'%day%',\n\t\t'%hour%',\n\t\t'%minute%',\n\t\t'%second%',\n\t\t'%postname%',\n\t\t'%post_id%',\n\t\t'%author%',\n\t\t'%pagename%',\n\t\t'%search%',\n\t);\n\n\t/**\n\t * Regular expressions to be substituted into rewrite rules in place\n\t * of rewrite tags, see WP_Rewrite::$rewritecode.\n\t *\n\t * @since 1.5.0\n\t * @var array\n\t */\n\tvar $rewritereplace = array(\n\t\t'([0-9]{4})',\n\t\t'([0-9]{1,2})',\n\t\t'([0-9]{1,2})',\n\t\t'([0-9]{1,2})',\n\t\t'([0-9]{1,2})',\n\t\t'([0-9]{1,2})',\n\t\t'([^/]+)',\n\t\t'([0-9]+)',\n\t\t'([^/]+)',\n\t\t'([^/]+?)',\n\t\t'(.+)',\n\t);\n\n\t/**\n\t * Query variables that rewrite tags map to, see WP_Rewrite::$rewritecode.\n\t *\n\t * @since 1.5.0\n\t * @var array\n\t */\n\tvar $queryreplace = array(\n\t\t'year=',\n\t\t'monthnum=',\n\t\t'day=',\n\t\t'hour=',\n\t\t'minute=',\n\t\t'second=',\n\t\t'name=',\n\t\t'p=',\n\t\t'author_name=',\n\t\t'pagename=',\n\t\t's=',\n\t);\n\n\t/**\n\t * Supported default feeds.\n\t *\n\t * @since 1.5.0\n\t * @var array\n\t */\n\tpublic $feeds = array( 'feed', 'rdf', 'rss', 'rss2', 'atom' );\n\n\t/**\n\t * Determines whether permalinks are being used.\n\t *\n\t * This can be either rewrite module or permalink in the HTTP query string.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return bool True, if permalinks are enabled.\n\t */\n\tpublic function using_permalinks() {\n\t\treturn ! empty( $this->permalink_structure );\n\t}\n\n\t/**\n\t * Determines whether permalinks are being used and rewrite module is not enabled.\n\t *\n\t * Means that permalink links are enabled and index.php is in the URL.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return bool Whether permalink links are enabled and index.php is in the URL.\n\t */\n\tpublic function using_index_permalinks() {\n\t\tif ( empty( $this->permalink_structure ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If the index is not in the permalink, we're using mod_rewrite.\n\t\treturn preg_match( '#^/*' . $this->index . '#', $this->permalink_structure );\n\t}\n\n\t/**\n\t * Determines whether permalinks are being used and rewrite module is enabled.\n\t *\n\t * Using permalinks and index.php is not in the URL.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return bool Whether permalink links are enabled and index.php is NOT in the URL.\n\t */\n\tpublic function using_mod_rewrite_permalinks() {\n\t\treturn $this->using_permalinks() && ! $this->using_index_permalinks();\n\t}\n\n\t/**\n\t * Indexes for matches for usage in preg_*() functions.\n\t *\n\t * The format of the string is, with empty matches property value, '$NUM'.\n\t * The 'NUM' will be replaced with the value in the $number parameter. With\n\t * the matches property not empty, the value of the returned string will\n\t * contain that value of the matches property. The format then will be\n\t * '$MATCHES[NUM]', with MATCHES as the value in the property and NUM the\n\t * value of the $number parameter.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param int $number Index number.\n\t * @return string\n\t */\n\tpublic function preg_index( $number ) {\n\t\t$match_prefix = '$';\n\t\t$match_suffix = '';\n\n\t\tif ( ! empty( $this->matches ) ) {\n\t\t\t$match_prefix = '$' . $this->matches . '[';\n\t\t\t$match_suffix = ']';\n\t\t}\n\n\t\treturn \"$match_prefix$number$match_suffix\";\n\t}\n\n\t/**\n\t * Retrieves all page and attachments for pages URIs.\n\t *\n\t * The attachments are for those that have pages as parents and will be\n\t * retrieved.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @return array Array of page URIs as first element and attachment URIs as second element.\n\t */\n\tpublic function page_uri_index() {\n\t\tglobal $wpdb;\n\n\t\t// Get pages in order of hierarchy, i.e. children after parents.\n\t\t$pages = $wpdb->get_results( \"SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_type = 'page' AND post_status != 'auto-draft'\" );\n\t\t$posts = get_page_hierarchy( $pages );\n\n\t\t// If we have no pages get out quick.\n\t\tif ( ! $posts ) {\n\t\t\treturn array( array(), array() );\n\t\t}\n\n\t\t// Now reverse it, because we need parents after children for rewrite rules to work properly.\n\t\t$posts = array_reverse( $posts, true );\n\n\t\t$page_uris            = array();\n\t\t$page_attachment_uris = array();\n\n\t\tforeach ( $posts as $id => $post ) {\n\t\t\t// URL => page name.\n\t\t\t$uri         = get_page_uri( $id );\n\t\t\t$attachments = $wpdb->get_results( $wpdb->prepare( \"SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent = %d\", $id ) );\n\t\t\tif ( ! empty( $attachments ) ) {\n\t\t\t\tforeach ( $attachments as $attachment ) {\n\t\t\t\t\t$attach_uri                          = get_page_uri( $attachment->ID );\n\t\t\t\t\t$page_attachment_uris[ $attach_uri ] = $attachment->ID;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$page_uris[ $uri ] = $id;\n\t\t}\n\n\t\treturn array( $page_uris, $page_attachment_uris );\n\t}\n\n\t/**\n\t * Retrieves all of the rewrite rules for pages.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return string[] Page rewrite rules.\n\t */\n\tpublic function page_rewrite_rules() {\n\t\t// The extra .? at the beginning prevents clashes with other regular expressions in the rules array.\n\t\t$this->add_rewrite_tag( '%pagename%', '(.?.+?)', 'pagename=' );\n\n\t\treturn $this->generate_rewrite_rules( $this->get_page_permastruct(), EP_PAGES, true, true, false, false );\n\t}\n\n\t/**\n\t * Retrieves date permalink structure, with year, month, and day.\n\t *\n\t * The permalink structure for the date, if not set already depends on the\n\t * permalink structure. It can be one of three formats. The first is year,\n\t * month, day; the second is day, month, year; and the last format is month,\n\t * day, year. These are matched against the permalink structure for which\n\t * one is used. If none matches, then the default will be used, which is\n\t * year, month, day.\n\t *\n\t * Prevents post ID and date permalinks from overlapping. In the case of\n\t * post_id, the date permalink will be prepended with front permalink with\n\t * 'date/' before the actual permalink to form the complete date permalink\n\t * structure.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return string|false Date permalink structure on success, false on failure.\n\t */\n\tpublic function get_date_permastruct() {\n\t\tif ( isset( $this->date_structure ) ) {\n\t\t\treturn $this->date_structure;\n\t\t}\n\n\t\tif ( empty( $this->permalink_structure ) ) {\n\t\t\t$this->date_structure = '';\n\t\t\treturn false;\n\t\t}\n\n\t\t// The date permalink must have year, month, and day separated by slashes.\n\t\t$endians = array( '%year%/%monthnum%/%day%', '%day%/%monthnum%/%year%', '%monthnum%/%day%/%year%' );\n\n\t\t$this->date_structure = '';\n\t\t$date_endian          = '';\n\n\t\tforeach ( $endians as $endian ) {\n\t\t\tif ( false !== strpos( $this->permalink_structure, $endian ) ) {\n\t\t\t\t$date_endian = $endian;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $date_endian ) ) {\n\t\t\t$date_endian = '%year%/%monthnum%/%day%';\n\t\t}\n\n\t\t/*\n\t\t * Do not allow the date tags and %post_id% to overlap in the permalink\n\t\t * structure. If they do, move the date tags to $front/date/.\n\t\t */\n\t\t$front = $this->front;\n\t\tpreg_match_all( '/%.+?%/', $this->permalink_structure, $tokens );\n\t\t$tok_index = 1;\n\t\tforeach ( (array) $tokens[0] as $token ) {\n\t\t\tif ( '%post_id%' === $token && ( $tok_index <= 3 ) ) {\n\t\t\t\t$front = $front . 'date/';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$tok_index++;\n\t\t}\n\n\t\t$this->date_structure = $front . $date_endian;\n\n\t\treturn $this->date_structure;\n\t}\n\n\t/**\n\t * Retrieves the year permalink structure without month and day.\n\t *\n\t * Gets the date permalink structure and strips out the month and day\n\t * permalink structures.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return string|false Year permalink structure on success, false on failure.\n\t */\n\tpublic function get_year_permastruct() {\n\t\t$structure = $this->get_date_permastruct();\n\n\t\tif ( empty( $structure ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$structure = str_replace( '%monthnum%', '', $structure );\n\t\t$structure = str_replace( '%day%', '', $structure );\n\t\t$structure = preg_replace( '#/+#', '/', $structure );\n\n\t\treturn $structure;\n\t}\n\n\t/**\n\t * Retrieves the month permalink structure without day and with year.\n\t *\n\t * Gets the date permalink structure and strips out the day permalink\n\t * structures. Keeps the year permalink structure.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return string|false Year/Month permalink structure on success, false on failure.\n\t */\n\tpublic function get_month_permastruct() {\n\t\t$structure = $this->get_date_permastruct();\n\n\t\tif ( empty( $structure ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$structure = str_replace( '%day%', '', $structure );\n\t\t$structure = preg_replace( '#/+#', '/', $structure );\n\n\t\treturn $structure;\n\t}\n\n\t/**\n\t * Retrieves the day permalink structure with month and year.\n\t *\n\t * Keeps date permalink structure with all year, month, and day.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return string|false Year/Month/Day permalink structure on success, false on failure.\n\t */\n\tpublic function get_day_permastruct() {\n\t\treturn $this->get_date_permastruct();\n\t}\n\n\t/**\n\t * Retrieves the permalink structure for categories.\n\t *\n\t * If the category_base property has no value, then the category structure\n\t * will have the front property value, followed by 'category', and finally\n\t * '%category%'. If it does, then the root property will be used, along with\n\t * the category_base property value.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return string|false Category permalink structure on success, false on failure.\n\t */\n\tpublic function get_category_permastruct() {\n\t\treturn $this->get_extra_permastruct( 'category' );\n\t}\n\n\t/**\n\t * Retrieve the permalink structure for tags.\n\t *\n\t * If the tag_base property has no value, then the tag structure will have\n\t * the front property value, followed by 'tag', and finally '%tag%'. If it\n\t * does, then the root property will be used, along with the tag_base\n\t * property value.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @return string|false Tag permalink structure on success, false on failure.\n\t */\n\tpublic function get_tag_permastruct() {\n\t\treturn $this->get_extra_permastruct( 'post_tag' );\n\t}\n\n\t/**\n\t * Retrieves an extra permalink structure by name.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $name Permalink structure name.\n\t * @return string|false Permalink structure string on success, false on failure.\n\t */\n\tpublic function get_extra_permastruct( $name ) {\n\t\tif ( empty( $this->permalink_structure ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( isset( $this->extra_permastructs[ $name ] ) ) {\n\t\t\treturn $this->extra_permastructs[ $name ]['struct'];\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Retrieves the author permalink structure.\n\t *\n\t * The permalink structure is front property, author base, and finally\n\t * '/%author%'. Will set the author_structure property and then return it\n\t * without attempting to set the value again.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return string|false Author permalink structure on success, false on failure.\n\t */\n\tpublic function get_author_permastruct() {\n\t\tif ( isset( $this->author_structure ) ) {\n\t\t\treturn $this->author_structure;\n\t\t}\n\n\t\tif ( empty( $this->permalink_structure ) ) {\n\t\t\t$this->author_structure = '';\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->author_structure = $this->front . $this->author_base . '/%author%';\n\n\t\treturn $this->author_structure;\n\t}\n\n\t/**\n\t * Retrieves the search permalink structure.\n\t *\n\t * The permalink structure is root property, search base, and finally\n\t * '/%search%'. Will set the search_structure property and then return it\n\t * without attempting to set the value again.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return string|false Search permalink structure on success, false on failure.\n\t */\n\tpublic function get_search_permastruct() {\n\t\tif ( isset( $this->search_structure ) ) {\n\t\t\treturn $this->search_structure;\n\t\t}\n\n\t\tif ( empty( $this->permalink_structure ) ) {\n\t\t\t$this->search_structure = '';\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->search_structure = $this->root . $this->search_base . '/%search%';\n\n\t\treturn $this->search_structure;\n\t}\n\n\t/**\n\t * Retrieves the page permalink structure.\n\t *\n\t * The permalink structure is root property, and '%pagename%'. Will set the\n\t * page_structure property and then return it without attempting to set the\n\t * value again.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return string|false Page permalink structure on success, false on failure.\n\t */\n\tpublic function get_page_permastruct() {\n\t\tif ( isset( $this->page_structure ) ) {\n\t\t\treturn $this->page_structure;\n\t\t}\n\n\t\tif ( empty( $this->permalink_structure ) ) {\n\t\t\t$this->page_structure = '';\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->page_structure = $this->root . '%pagename%';\n\n\t\treturn $this->page_structure;\n\t}\n\n\t/**\n\t * Retrieves the feed permalink structure.\n\t *\n\t * The permalink structure is root property, feed base, and finally\n\t * '/%feed%'. Will set the feed_structure property and then return it\n\t * without attempting to set the value again.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return string|false Feed permalink structure on success, false on failure.\n\t */\n\tpublic function get_feed_permastruct() {\n\t\tif ( isset( $this->feed_structure ) ) {\n\t\t\treturn $this->feed_structure;\n\t\t}\n\n\t\tif ( empty( $this->permalink_structure ) ) {\n\t\t\t$this->feed_structure = '';\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->feed_structure = $this->root . $this->feed_base . '/%feed%';\n\n\t\treturn $this->feed_structure;\n\t}\n\n\t/**\n\t * Retrieves the comment feed permalink structure.\n\t *\n\t * The permalink structure is root property, comment base property, feed\n\t * base and finally '/%feed%'. Will set the comment_feed_structure property\n\t * and then return it without attempting to set the value again.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return string|false Comment feed permalink structure on success, false on failure.\n\t */\n\tpublic function get_comment_feed_permastruct() {\n\t\tif ( isset( $this->comment_feed_structure ) ) {\n\t\t\treturn $this->comment_feed_structure;\n\t\t}\n\n\t\tif ( empty( $this->permalink_structure ) ) {\n\t\t\t$this->comment_feed_structure = '';\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->comment_feed_structure = $this->root . $this->comments_base . '/' . $this->feed_base . '/%feed%';\n\n\t\treturn $this->comment_feed_structure;\n\t}\n\n\t/**\n\t * Adds or updates existing rewrite tags (e.g. %postname%).\n\t *\n\t * If the tag already exists, replace the existing pattern and query for\n\t * that tag, otherwise add the new tag.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @see WP_Rewrite::$rewritecode\n\t * @see WP_Rewrite::$rewritereplace\n\t * @see WP_Rewrite::$queryreplace\n\t *\n\t * @param string $tag   Name of the rewrite tag to add or update.\n\t * @param string $regex Regular expression to substitute the tag for in rewrite rules.\n\t * @param string $query String to append to the rewritten query. Must end in '='.\n\t */\n\tpublic function add_rewrite_tag( $tag, $regex, $query ) {\n\t\t$position = array_search( $tag, $this->rewritecode, true );\n\t\tif ( false !== $position && null !== $position ) {\n\t\t\t$this->rewritereplace[ $position ] = $regex;\n\t\t\t$this->queryreplace[ $position ]   = $query;\n\t\t} else {\n\t\t\t$this->rewritecode[]    = $tag;\n\t\t\t$this->rewritereplace[] = $regex;\n\t\t\t$this->queryreplace[]   = $query;\n\t\t}\n\t}\n\n\n\t/**\n\t * Removes an existing rewrite tag.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @see WP_Rewrite::$rewritecode\n\t * @see WP_Rewrite::$rewritereplace\n\t * @see WP_Rewrite::$queryreplace\n\t *\n\t * @param string $tag Name of the rewrite tag to remove.\n\t */\n\tpublic function remove_rewrite_tag( $tag ) {\n\t\t$position = array_search( $tag, $this->rewritecode, true );\n\t\tif ( false !== $position && null !== $position ) {\n\t\t\tunset( $this->rewritecode[ $position ] );\n\t\t\tunset( $this->rewritereplace[ $position ] );\n\t\t\tunset( $this->queryreplace[ $position ] );\n\t\t}\n\t}\n\n\t/**\n\t * Generates rewrite rules from a permalink structure.\n\t *\n\t * The main WP_Rewrite function for building the rewrite rule list. The\n\t * contents of the function is a mix of black magic and regular expressions,\n\t * so best just ignore the contents and move to the parameters.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $permalink_structure The permalink structure.\n\t * @param int    $ep_mask             Optional. Endpoint mask defining what endpoints are added to the structure.\n\t *                                    Accepts `EP_NONE`, `EP_PERMALINK`, `EP_ATTACHMENT`, `EP_DATE`, `EP_YEAR`,\n\t *                                    `EP_MONTH`, `EP_DAY`, `EP_ROOT`, `EP_COMMENTS`, `EP_SEARCH`, `EP_CATEGORIES`,\n\t *                                    `EP_TAGS`, `EP_AUTHORS`, `EP_PAGES`, `EP_ALL_ARCHIVES`, and `EP_ALL`.\n\t *                                    Default `EP_NONE`.\n\t * @param bool   $paged               Optional. Whether archive pagination rules should be added for the structure.\n\t *                                    Default true.\n\t * @param bool   $feed                Optional Whether feed rewrite rules should be added for the structure.\n\t *                                    Default true.\n\t * @param bool   $forcomments         Optional. Whether the feed rules should be a query for a comments feed.\n\t *                                    Default false.\n\t * @param bool   $walk_dirs           Optional. Whether the 'directories' making up the structure should be walked\n\t *                                    over and rewrite rules built for each in-turn. Default true.\n\t * @param bool   $endpoints           Optional. Whether endpoints should be applied to the generated rewrite rules.\n\t *                                    Default true.\n\t * @return string[] Array of rewrite rules keyed by their regex pattern.\n\t */\n\tpublic function generate_rewrite_rules( $permalink_structure, $ep_mask = EP_NONE, $paged = true, $feed = true, $forcomments = false, $walk_dirs = true, $endpoints = true ) {\n\t\t// Build a regex to match the feed section of URLs, something like (feed|atom|rss|rss2)/?\n\t\t$feedregex2 = '';\n\t\tforeach ( (array) $this->feeds as $feed_name ) {\n\t\t\t$feedregex2 .= $feed_name . '|';\n\t\t}\n\t\t$feedregex2 = '(' . trim( $feedregex2, '|' ) . ')/?$';\n\n\t\t/*\n\t\t * $feedregex is identical but with /feed/ added on as well, so URLs like <permalink>/feed/atom\n\t\t * and <permalink>/atom are both possible\n\t\t */\n\t\t$feedregex = $this->feed_base . '/' . $feedregex2;\n\n\t\t// Build a regex to match the trackback and page/xx parts of URLs.\n\t\t$trackbackregex = 'trackback/?$';\n\t\t$pageregex      = $this->pagination_base . '/?([0-9]{1,})/?$';\n\t\t$commentregex   = $this->comments_pagination_base . '-([0-9]{1,})/?$';\n\t\t$embedregex     = 'embed/?$';\n\n\t\t// Build up an array of endpoint regexes to append => queries to append.\n\t\tif ( $endpoints ) {\n\t\t\t$ep_query_append = array();\n\t\t\tforeach ( (array) $this->endpoints as $endpoint ) {\n\t\t\t\t// Match everything after the endpoint name, but allow for nothing to appear there.\n\t\t\t\t$epmatch = $endpoint[1] . '(/(.*))?/?$';\n\n\t\t\t\t// This will be appended on to the rest of the query for each dir.\n\t\t\t\t$epquery                     = '&' . $endpoint[2] . '=';\n\t\t\t\t$ep_query_append[ $epmatch ] = array( $endpoint[0], $epquery );\n\t\t\t}\n\t\t}\n\n\t\t// Get everything up to the first rewrite tag.\n\t\t$front = substr( $permalink_structure, 0, strpos( $permalink_structure, '%' ) );\n\n\t\t// Build an array of the tags (note that said array ends up being in $tokens[0]).\n\t\tpreg_match_all( '/%.+?%/', $permalink_structure, $tokens );\n\n\t\t$num_tokens = count( $tokens[0] );\n\n\t\t$index          = $this->index; // Probably 'index.php'.\n\t\t$feedindex      = $index;\n\t\t$trackbackindex = $index;\n\t\t$embedindex     = $index;\n\n\t\t/*\n\t\t * Build a list from the rewritecode and queryreplace arrays, that will look something\n\t\t * like tagname=$matches[i] where i is the current $i.\n\t\t */\n\t\t$queries = array();\n\t\tfor ( $i = 0; $i < $num_tokens; ++$i ) {\n\t\t\tif ( 0 < $i ) {\n\t\t\t\t$queries[ $i ] = $queries[ $i - 1 ] . '&';\n\t\t\t} else {\n\t\t\t\t$queries[ $i ] = '';\n\t\t\t}\n\n\t\t\t$query_token    = str_replace( $this->rewritecode, $this->queryreplace, $tokens[0][ $i ] ) . $this->preg_index( $i + 1 );\n\t\t\t$queries[ $i ] .= $query_token;\n\t\t}\n\n\t\t// Get the structure, minus any cruft (stuff that isn't tags) at the front.\n\t\t$structure = $permalink_structure;\n\t\tif ( '/' !== $front ) {\n\t\t\t$structure = str_replace( $front, '', $structure );\n\t\t}\n\n\t\t/*\n\t\t * Create a list of dirs to walk over, making rewrite rules for each level\n\t\t * so for example, a $structure of /%year%/%monthnum%/%postname% would create\n\t\t * rewrite rules for /%year%/, /%year%/%monthnum%/ and /%year%/%monthnum%/%postname%\n\t\t */\n\t\t$structure = trim( $structure, '/' );\n\t\t$dirs      = $walk_dirs ? explode( '/', $structure ) : array( $structure );\n\t\t$num_dirs  = count( $dirs );\n\n\t\t// Strip slashes from the front of $front.\n\t\t$front = preg_replace( '|^/+|', '', $front );\n\n\t\t// The main workhorse loop.\n\t\t$post_rewrite = array();\n\t\t$struct       = $front;\n\t\tfor ( $j = 0; $j < $num_dirs; ++$j ) {\n\t\t\t// Get the struct for this dir, and trim slashes off the front.\n\t\t\t$struct .= $dirs[ $j ] . '/'; // Accumulate. see comment near explode('/', $structure) above.\n\t\t\t$struct  = ltrim( $struct, '/' );\n\n\t\t\t// Replace tags with regexes.\n\t\t\t$match = str_replace( $this->rewritecode, $this->rewritereplace, $struct );\n\n\t\t\t// Make a list of tags, and store how many there are in $num_toks.\n\t\t\t$num_toks = preg_match_all( '/%.+?%/', $struct, $toks );\n\n\t\t\t// Get the 'tagname=$matches[i]'.\n\t\t\t$query = ( ! empty( $num_toks ) && isset( $queries[ $num_toks - 1 ] ) ) ? $queries[ $num_toks - 1 ] : '';\n\n\t\t\t// Set up $ep_mask_specific which is used to match more specific URL types.\n\t\t\tswitch ( $dirs[ $j ] ) {\n\t\t\t\tcase '%year%':\n\t\t\t\t\t$ep_mask_specific = EP_YEAR;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '%monthnum%':\n\t\t\t\t\t$ep_mask_specific = EP_MONTH;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '%day%':\n\t\t\t\t\t$ep_mask_specific = EP_DAY;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$ep_mask_specific = EP_NONE;\n\t\t\t}\n\n\t\t\t// Create query for /page/xx.\n\t\t\t$pagematch = $match . $pageregex;\n\t\t\t$pagequery = $index . '?' . $query . '&paged=' . $this->preg_index( $num_toks + 1 );\n\n\t\t\t// Create query for /comment-page-xx.\n\t\t\t$commentmatch = $match . $commentregex;\n\t\t\t$commentquery = $index . '?' . $query . '&cpage=' . $this->preg_index( $num_toks + 1 );\n\n\t\t\tif ( get_option( 'page_on_front' ) ) {\n\t\t\t\t// Create query for Root /comment-page-xx.\n\t\t\t\t$rootcommentmatch = $match . $commentregex;\n\t\t\t\t$rootcommentquery = $index . '?' . $query . '&page_id=' . get_option( 'page_on_front' ) . '&cpage=' . $this->preg_index( $num_toks + 1 );\n\t\t\t}\n\n\t\t\t// Create query for /feed/(feed|atom|rss|rss2|rdf).\n\t\t\t$feedmatch = $match . $feedregex;\n\t\t\t$feedquery = $feedindex . '?' . $query . '&feed=' . $this->preg_index( $num_toks + 1 );\n\n\t\t\t// Create query for /(feed|atom|rss|rss2|rdf) (see comment near creation of $feedregex).\n\t\t\t$feedmatch2 = $match . $feedregex2;\n\t\t\t$feedquery2 = $feedindex . '?' . $query . '&feed=' . $this->preg_index( $num_toks + 1 );\n\n\t\t\t// Create query and regex for embeds.\n\t\t\t$embedmatch = $match . $embedregex;\n\t\t\t$embedquery = $embedindex . '?' . $query . '&embed=true';\n\n\t\t\t// If asked to, turn the feed queries into comment feed ones.\n\t\t\tif ( $forcomments ) {\n\t\t\t\t$feedquery  .= '&withcomments=1';\n\t\t\t\t$feedquery2 .= '&withcomments=1';\n\t\t\t}\n\n\t\t\t// Start creating the array of rewrites for this dir.\n\t\t\t$rewrite = array();\n\n\t\t\t// ...adding on /feed/ regexes => queries.\n\t\t\tif ( $feed ) {\n\t\t\t\t$rewrite = array(\n\t\t\t\t\t$feedmatch  => $feedquery,\n\t\t\t\t\t$feedmatch2 => $feedquery2,\n\t\t\t\t\t$embedmatch => $embedquery,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// ...and /page/xx ones.\n\t\t\tif ( $paged ) {\n\t\t\t\t$rewrite = array_merge( $rewrite, array( $pagematch => $pagequery ) );\n\t\t\t}\n\n\t\t\t// Only on pages with comments add ../comment-page-xx/.\n\t\t\tif ( EP_PAGES & $ep_mask || EP_PERMALINK & $ep_mask ) {\n\t\t\t\t$rewrite = array_merge( $rewrite, array( $commentmatch => $commentquery ) );\n\t\t\t} elseif ( EP_ROOT & $ep_mask && get_option( 'page_on_front' ) ) {\n\t\t\t\t$rewrite = array_merge( $rewrite, array( $rootcommentmatch => $rootcommentquery ) );\n\t\t\t}\n\n\t\t\t// Do endpoints.\n\t\t\tif ( $endpoints ) {\n\t\t\t\tforeach ( (array) $ep_query_append as $regex => $ep ) {\n\t\t\t\t\t// Add the endpoints on if the mask fits.\n\t\t\t\t\tif ( $ep[0] & $ep_mask || $ep[0] & $ep_mask_specific ) {\n\t\t\t\t\t\t$rewrite[ $match . $regex ] = $index . '?' . $query . $ep[1] . $this->preg_index( $num_toks + 2 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we've got some tags in this dir.\n\t\t\tif ( $num_toks ) {\n\t\t\t\t$post = false;\n\t\t\t\t$page = false;\n\n\t\t\t\t/*\n\t\t\t\t * Check to see if this dir is permalink-level: i.e. the structure specifies an\n\t\t\t\t * individual post. Do this by checking it contains at least one of 1) post name,\n\t\t\t\t * 2) post ID, 3) page name, 4) timestamp (year, month, day, hour, second and\n\t\t\t\t * minute all present). Set these flags now as we need them for the endpoints.\n\t\t\t\t */\n\t\t\t\tif ( strpos( $struct, '%postname%' ) !== false\n\t\t\t\t\t\t|| strpos( $struct, '%post_id%' ) !== false\n\t\t\t\t\t\t|| strpos( $struct, '%pagename%' ) !== false\n\t\t\t\t\t\t|| ( strpos( $struct, '%year%' ) !== false && strpos( $struct, '%monthnum%' ) !== false && strpos( $struct, '%day%' ) !== false && strpos( $struct, '%hour%' ) !== false && strpos( $struct, '%minute%' ) !== false && strpos( $struct, '%second%' ) !== false )\n\t\t\t\t\t\t) {\n\t\t\t\t\t$post = true;\n\t\t\t\t\tif ( strpos( $struct, '%pagename%' ) !== false ) {\n\t\t\t\t\t\t$page = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( ! $post ) {\n\t\t\t\t\t// For custom post types, we need to add on endpoints as well.\n\t\t\t\t\tforeach ( get_post_types( array( '_builtin' => false ) ) as $ptype ) {\n\t\t\t\t\t\tif ( strpos( $struct, \"%$ptype%\" ) !== false ) {\n\t\t\t\t\t\t\t$post = true;\n\n\t\t\t\t\t\t\t// This is for page style attachment URLs.\n\t\t\t\t\t\t\t$page = is_post_type_hierarchical( $ptype );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If creating rules for a permalink, do all the endpoints like attachments etc.\n\t\t\t\tif ( $post ) {\n\t\t\t\t\t// Create query and regex for trackback.\n\t\t\t\t\t$trackbackmatch = $match . $trackbackregex;\n\t\t\t\t\t$trackbackquery = $trackbackindex . '?' . $query . '&tb=1';\n\n\t\t\t\t\t// Create query and regex for embeds.\n\t\t\t\t\t$embedmatch = $match . $embedregex;\n\t\t\t\t\t$embedquery = $embedindex . '?' . $query . '&embed=true';\n\n\t\t\t\t\t// Trim slashes from the end of the regex for this dir.\n\t\t\t\t\t$match = rtrim( $match, '/' );\n\n\t\t\t\t\t// Get rid of brackets.\n\t\t\t\t\t$submatchbase = str_replace( array( '(', ')' ), '', $match );\n\n\t\t\t\t\t// Add a rule for at attachments, which take the form of <permalink>/some-text.\n\t\t\t\t\t$sub1 = $submatchbase . '/([^/]+)/';\n\n\t\t\t\t\t// Add trackback regex <permalink>/trackback/...\n\t\t\t\t\t$sub1tb = $sub1 . $trackbackregex;\n\n\t\t\t\t\t// And <permalink>/feed/(atom|...)\n\t\t\t\t\t$sub1feed = $sub1 . $feedregex;\n\n\t\t\t\t\t// And <permalink>/(feed|atom...)\n\t\t\t\t\t$sub1feed2 = $sub1 . $feedregex2;\n\n\t\t\t\t\t// And <permalink>/comment-page-xx\n\t\t\t\t\t$sub1comment = $sub1 . $commentregex;\n\n\t\t\t\t\t// And <permalink>/embed/...\n\t\t\t\t\t$sub1embed = $sub1 . $embedregex;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Add another rule to match attachments in the explicit form:\n\t\t\t\t\t * <permalink>/attachment/some-text\n\t\t\t\t\t */\n\t\t\t\t\t$sub2 = $submatchbase . '/attachment/([^/]+)/';\n\n\t\t\t\t\t// And add trackbacks <permalink>/attachment/trackback.\n\t\t\t\t\t$sub2tb = $sub2 . $trackbackregex;\n\n\t\t\t\t\t// Feeds, <permalink>/attachment/feed/(atom|...)\n\t\t\t\t\t$sub2feed = $sub2 . $feedregex;\n\n\t\t\t\t\t// And feeds again on to this <permalink>/attachment/(feed|atom...)\n\t\t\t\t\t$sub2feed2 = $sub2 . $feedregex2;\n\n\t\t\t\t\t// And <permalink>/comment-page-xx\n\t\t\t\t\t$sub2comment = $sub2 . $commentregex;\n\n\t\t\t\t\t// And <permalink>/embed/...\n\t\t\t\t\t$sub2embed = $sub2 . $embedregex;\n\n\t\t\t\t\t// Create queries for these extra tag-ons we've just dealt with.\n\t\t\t\t\t$subquery        = $index . '?attachment=' . $this->preg_index( 1 );\n\t\t\t\t\t$subtbquery      = $subquery . '&tb=1';\n\t\t\t\t\t$subfeedquery    = $subquery . '&feed=' . $this->preg_index( 2 );\n\t\t\t\t\t$subcommentquery = $subquery . '&cpage=' . $this->preg_index( 2 );\n\t\t\t\t\t$subembedquery   = $subquery . '&embed=true';\n\n\t\t\t\t\t// Do endpoints for attachments.\n\t\t\t\t\tif ( ! empty( $endpoints ) ) {\n\t\t\t\t\t\tforeach ( (array) $ep_query_append as $regex => $ep ) {\n\t\t\t\t\t\t\tif ( $ep[0] & EP_ATTACHMENT ) {\n\t\t\t\t\t\t\t\t$rewrite[ $sub1 . $regex ] = $subquery . $ep[1] . $this->preg_index( 3 );\n\t\t\t\t\t\t\t\t$rewrite[ $sub2 . $regex ] = $subquery . $ep[1] . $this->preg_index( 3 );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Now we've finished with endpoints, finish off the $sub1 and $sub2 matches\n\t\t\t\t\t * add a ? as we don't have to match that last slash, and finally a $ so we\n\t\t\t\t\t * match to the end of the URL\n\t\t\t\t\t */\n\t\t\t\t\t$sub1 .= '?$';\n\t\t\t\t\t$sub2 .= '?$';\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Post pagination, e.g. <permalink>/2/\n\t\t\t\t\t * Previously: '(/[0-9]+)?/?$', which produced '/2' for page.\n\t\t\t\t\t * When cast to int, returned 0.\n\t\t\t\t\t */\n\t\t\t\t\t$match = $match . '(?:/([0-9]+))?/?$';\n\t\t\t\t\t$query = $index . '?' . $query . '&page=' . $this->preg_index( $num_toks + 1 );\n\n\t\t\t\t\t// Not matching a permalink so this is a lot simpler.\n\t\t\t\t} else {\n\t\t\t\t\t// Close the match and finalise the query.\n\t\t\t\t\t$match .= '?$';\n\t\t\t\t\t$query  = $index . '?' . $query;\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * Create the final array for this dir by joining the $rewrite array (which currently\n\t\t\t\t * only contains rules/queries for trackback, pages etc) to the main regex/query for\n\t\t\t\t * this dir\n\t\t\t\t */\n\t\t\t\t$rewrite = array_merge( $rewrite, array( $match => $query ) );\n\n\t\t\t\t// If we're matching a permalink, add those extras (attachments etc) on.\n\t\t\t\tif ( $post ) {\n\t\t\t\t\t// Add trackback.\n\t\t\t\t\t$rewrite = array_merge( array( $trackbackmatch => $trackbackquery ), $rewrite );\n\n\t\t\t\t\t// Add embed.\n\t\t\t\t\t$rewrite = array_merge( array( $embedmatch => $embedquery ), $rewrite );\n\n\t\t\t\t\t// Add regexes/queries for attachments, attachment trackbacks and so on.\n\t\t\t\t\tif ( ! $page ) {\n\t\t\t\t\t\t// Require <permalink>/attachment/stuff form for pages because of confusion with subpages.\n\t\t\t\t\t\t$rewrite = array_merge(\n\t\t\t\t\t\t\t$rewrite,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t$sub1        => $subquery,\n\t\t\t\t\t\t\t\t$sub1tb      => $subtbquery,\n\t\t\t\t\t\t\t\t$sub1feed    => $subfeedquery,\n\t\t\t\t\t\t\t\t$sub1feed2   => $subfeedquery,\n\t\t\t\t\t\t\t\t$sub1comment => $subcommentquery,\n\t\t\t\t\t\t\t\t$sub1embed   => $subembedquery,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$rewrite = array_merge(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t$sub2        => $subquery,\n\t\t\t\t\t\t\t$sub2tb      => $subtbquery,\n\t\t\t\t\t\t\t$sub2feed    => $subfeedquery,\n\t\t\t\t\t\t\t$sub2feed2   => $subfeedquery,\n\t\t\t\t\t\t\t$sub2comment => $subcommentquery,\n\t\t\t\t\t\t\t$sub2embed   => $subembedquery,\n\t\t\t\t\t\t),\n\t\t\t\t\t\t$rewrite\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Add the rules for this dir to the accumulating $post_rewrite.\n\t\t\t$post_rewrite = array_merge( $rewrite, $post_rewrite );\n\t\t}\n\n\t\t// The finished rules. phew!\n\t\treturn $post_rewrite;\n\t}\n\n\t/**\n\t * Generates rewrite rules with permalink structure and walking directory only.\n\t *\n\t * Shorten version of WP_Rewrite::generate_rewrite_rules() that allows for shorter\n\t * list of parameters. See the method for longer description of what generating\n\t * rewrite rules does.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @see WP_Rewrite::generate_rewrite_rules() See for long description and rest of parameters.\n\t *\n\t * @param string $permalink_structure The permalink structure to generate rules.\n\t * @param bool   $walk_dirs           Optional. Whether to create list of directories to walk over.\n\t *                                    Default false.\n\t * @return array\n\t */\n\tpublic function generate_rewrite_rule( $permalink_structure, $walk_dirs = false ) {\n\t\treturn $this->generate_rewrite_rules( $permalink_structure, EP_NONE, false, false, false, $walk_dirs );\n\t}\n\n\t/**\n\t * Constructs rewrite matches and queries from permalink structure.\n\t *\n\t * Runs the action {@see 'generate_rewrite_rules'} with the parameter that is an\n\t * reference to the current WP_Rewrite instance to further manipulate the\n\t * permalink structures and rewrite rules. Runs the {@see 'rewrite_rules_array'}\n\t * filter on the full rewrite rule array.\n\t *\n\t * There are two ways to manipulate the rewrite rules, one by hooking into\n\t * the {@see 'generate_rewrite_rules'} action and gaining full control of the\n\t * object or just manipulating the rewrite rule array before it is passed\n\t * from the function.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return string[] An associative array of matches and queries.\n\t */\n\tpublic function rewrite_rules() {\n\t\t$rewrite = array();\n\n\t\tif ( empty( $this->permalink_structure ) ) {\n\t\t\treturn $rewrite;\n\t\t}\n\n\t\t// robots.txt -- only if installed at the root.\n\t\t$home_path      = parse_url( home_url() );\n\t\t$robots_rewrite = ( empty( $home_path['path'] ) || '/' === $home_path['path'] ) ? array( 'robots\\.txt$' => $this->index . '?robots=1' ) : array();\n\n\t\t// favicon.ico -- only if installed at the root.\n\t\t$favicon_rewrite = ( empty( $home_path['path'] ) || '/' === $home_path['path'] ) ? array( 'favicon\\.ico$' => $this->index . '?favicon=1' ) : array();\n\n\t\t// Old feed and service files.\n\t\t$deprecated_files = array(\n\t\t\t'.*wp-(atom|rdf|rss|rss2|feed|commentsrss2)\\.php$' => $this->index . '?feed=old',\n\t\t\t'.*wp-app\\.php(/.*)?$' => $this->index . '?error=403',\n\t\t);\n\n\t\t// Registration rules.\n\t\t$registration_pages = array();\n\t\tif ( is_multisite() && is_main_site() ) {\n\t\t\t$registration_pages['.*wp-signup.php$']   = $this->index . '?signup=true';\n\t\t\t$registration_pages['.*wp-activate.php$'] = $this->index . '?activate=true';\n\t\t}\n\n\t\t// Deprecated.\n\t\t$registration_pages['.*wp-register.php$'] = $this->index . '?register=true';\n\n\t\t// Post rewrite rules.\n\t\t$post_rewrite = $this->generate_rewrite_rules( $this->permalink_structure, EP_PERMALINK );\n\n\t\t/**\n\t\t * Filters rewrite rules used for \"post\" archives.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param string[] $post_rewrite Array of rewrite rules for posts, keyed by their regex pattern.\n\t\t */\n\t\t$post_rewrite = apply_filters( 'post_rewrite_rules', $post_rewrite );\n\n\t\t// Date rewrite rules.\n\t\t$date_rewrite = $this->generate_rewrite_rules( $this->get_date_permastruct(), EP_DATE );\n\n\t\t/**\n\t\t * Filters rewrite rules used for date archives.\n\t\t *\n\t\t * Likely date archives would include /yyyy/, /yyyy/mm/, and /yyyy/mm/dd/.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param string[] $date_rewrite Array of rewrite rules for date archives, keyed by their regex pattern.\n\t\t */\n\t\t$date_rewrite = apply_filters( 'date_rewrite_rules', $date_rewrite );\n\n\t\t// Root-level rewrite rules.\n\t\t$root_rewrite = $this->generate_rewrite_rules( $this->root . '/', EP_ROOT );\n\n\t\t/**\n\t\t * Filters rewrite rules used for root-level archives.\n\t\t *\n\t\t * Likely root-level archives would include pagination rules for the homepage\n\t\t * as well as site-wide post feeds (e.g. /feed/, and /feed/atom/).\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param string[] $root_rewrite Array of root-level rewrite rules, keyed by their regex pattern.\n\t\t */\n\t\t$root_rewrite = apply_filters( 'root_rewrite_rules', $root_rewrite );\n\n\t\t// Comments rewrite rules.\n\t\t$comments_rewrite = $this->generate_rewrite_rules( $this->root . $this->comments_base, EP_COMMENTS, false, true, true, false );\n\n\t\t/**\n\t\t * Filters rewrite rules used for comment feed archives.\n\t\t *\n\t\t * Likely comments feed archives include /comments/feed/, and /comments/feed/atom/.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param string[] $comments_rewrite Array of rewrite rules for the site-wide comments feeds, keyed by their regex pattern.\n\t\t */\n\t\t$comments_rewrite = apply_filters( 'comments_rewrite_rules', $comments_rewrite );\n\n\t\t// Search rewrite rules.\n\t\t$search_structure = $this->get_search_permastruct();\n\t\t$search_rewrite   = $this->generate_rewrite_rules( $search_structure, EP_SEARCH );\n\n\t\t/**\n\t\t * Filters rewrite rules used for search archives.\n\t\t *\n\t\t * Likely search-related archives include /search/search+query/ as well as\n\t\t * pagination and feed paths for a search.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param string[] $search_rewrite Array of rewrite rules for search queries, keyed by their regex pattern.\n\t\t */\n\t\t$search_rewrite = apply_filters( 'search_rewrite_rules', $search_rewrite );\n\n\t\t// Author rewrite rules.\n\t\t$author_rewrite = $this->generate_rewrite_rules( $this->get_author_permastruct(), EP_AUTHORS );\n\n\t\t/**\n\t\t * Filters rewrite rules used for author archives.\n\t\t *\n\t\t * Likely author archives would include /author/author-name/, as well as\n\t\t * pagination and feed paths for author archives.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param string[] $author_rewrite Array of rewrite rules for author archives, keyed by their regex pattern.\n\t\t */\n\t\t$author_rewrite = apply_filters( 'author_rewrite_rules', $author_rewrite );\n\n\t\t// Pages rewrite rules.\n\t\t$page_rewrite = $this->page_rewrite_rules();\n\n\t\t/**\n\t\t * Filters rewrite rules used for \"page\" post type archives.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param string[] $page_rewrite Array of rewrite rules for the \"page\" post type, keyed by their regex pattern.\n\t\t */\n\t\t$page_rewrite = apply_filters( 'page_rewrite_rules', $page_rewrite );\n\n\t\t// Extra permastructs.\n\t\tforeach ( $this->extra_permastructs as $permastructname => $struct ) {\n\t\t\tif ( is_array( $struct ) ) {\n\t\t\t\tif ( count( $struct ) == 2 ) {\n\t\t\t\t\t$rules = $this->generate_rewrite_rules( $struct[0], $struct[1] );\n\t\t\t\t} else {\n\t\t\t\t\t$rules = $this->generate_rewrite_rules( $struct['struct'], $struct['ep_mask'], $struct['paged'], $struct['feed'], $struct['forcomments'], $struct['walk_dirs'], $struct['endpoints'] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$rules = $this->generate_rewrite_rules( $struct );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters rewrite rules used for individual permastructs.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$permastructname`, refers\n\t\t\t * to the name of the registered permastruct, e.g. 'post_tag' (tags),\n\t\t\t * 'category' (categories), etc.\n\t\t\t *\n\t\t\t * @since 3.1.0\n\t\t\t *\n\t\t\t * @param string[] $rules Array of rewrite rules generated for the current permastruct, keyed by their regex pattern.\n\t\t\t */\n\t\t\t$rules = apply_filters( \"{$permastructname}_rewrite_rules\", $rules );\n\n\t\t\tif ( 'post_tag' === $permastructname ) {\n\n\t\t\t\t/**\n\t\t\t\t * Filters rewrite rules used specifically for Tags.\n\t\t\t\t *\n\t\t\t\t * @since 2.3.0\n\t\t\t\t * @deprecated 3.1.0 Use {@see 'post_tag_rewrite_rules'} instead.\n\t\t\t\t *\n\t\t\t\t * @param string[] $rules Array of rewrite rules generated for tags, keyed by their regex pattern.\n\t\t\t\t */\n\t\t\t\t$rules = apply_filters_deprecated( 'tag_rewrite_rules', array( $rules ), '3.1.0', 'post_tag_rewrite_rules' );\n\t\t\t}\n\n\t\t\t$this->extra_rules_top = array_merge( $this->extra_rules_top, $rules );\n\t\t}\n\n\t\t// Put them together.\n\t\tif ( $this->use_verbose_page_rules ) {\n\t\t\t$this->rules = array_merge( $this->extra_rules_top, $robots_rewrite, $favicon_rewrite, $deprecated_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $page_rewrite, $post_rewrite, $this->extra_rules );\n\t\t} else {\n\t\t\t$this->rules = array_merge( $this->extra_rules_top, $robots_rewrite, $favicon_rewrite, $deprecated_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules );\n\t\t}\n\n\t\t/**\n\t\t * Fires after the rewrite rules are generated.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param WP_Rewrite $this Current WP_Rewrite instance (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'generate_rewrite_rules', array( &$this ) );\n\n\t\t/**\n\t\t * Filters the full set of generated rewrite rules.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param string[] $rules The compiled array of rewrite rules, keyed by their regex pattern.\n\t\t */\n\t\t$this->rules = apply_filters( 'rewrite_rules_array', $this->rules );\n\n\t\treturn $this->rules;\n\t}\n\n\t/**\n\t * Retrieves the rewrite rules.\n\t *\n\t * The difference between this method and WP_Rewrite::rewrite_rules() is that\n\t * this method stores the rewrite rules in the 'rewrite_rules' option and retrieves\n\t * it. This prevents having to process all of the permalinks to get the rewrite rules\n\t * in the form of caching.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return string[] Array of rewrite rules keyed by their regex pattern.\n\t */\n\tpublic function wp_rewrite_rules() {\n\t\t$this->rules = get_option( 'rewrite_rules' );\n\t\tif ( empty( $this->rules ) ) {\n\t\t\t$this->matches = 'matches';\n\t\t\t$this->rewrite_rules();\n\t\t\tif ( ! did_action( 'wp_loaded' ) ) {\n\t\t\t\tadd_action( 'wp_loaded', array( $this, 'flush_rules' ) );\n\t\t\t\treturn $this->rules;\n\t\t\t}\n\t\t\tupdate_option( 'rewrite_rules', $this->rules );\n\t\t}\n\n\t\treturn $this->rules;\n\t}\n\n\t/**\n\t * Retrieves mod_rewrite-formatted rewrite rules to write to .htaccess.\n\t *\n\t * Does not actually write to the .htaccess file, but creates the rules for\n\t * the process that will.\n\t *\n\t * Will add the non_wp_rules property rules to the .htaccess file before\n\t * the WordPress rewrite rules one.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return string\n\t */\n\tpublic function mod_rewrite_rules() {\n\t\tif ( ! $this->using_permalinks() ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$site_root = parse_url( site_url() );\n\t\tif ( isset( $site_root['path'] ) ) {\n\t\t\t$site_root = trailingslashit( $site_root['path'] );\n\t\t}\n\n\t\t$home_root = parse_url( home_url() );\n\t\tif ( isset( $home_root['path'] ) ) {\n\t\t\t$home_root = trailingslashit( $home_root['path'] );\n\t\t} else {\n\t\t\t$home_root = '/';\n\t\t}\n\n\t\t$rules  = \"<IfModule mod_rewrite.c>\\n\";\n\t\t$rules .= \"RewriteEngine On\\n\";\n\t\t$rules .= \"RewriteBase $home_root\\n\";\n\n\t\t// Prevent -f checks on index.php.\n\t\t$rules .= \"RewriteRule ^index\\.php$ - [L]\\n\";\n\n\t\t// Add in the rules that don't redirect to WP's index.php (and thus shouldn't be handled by WP at all).\n\t\tforeach ( (array) $this->non_wp_rules as $match => $query ) {\n\t\t\t// Apache 1.3 does not support the reluctant (non-greedy) modifier.\n\t\t\t$match = str_replace( '.+?', '.+', $match );\n\n\t\t\t$rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . \" [QSA,L]\\n\";\n\t\t}\n\n\t\tif ( $this->use_verbose_rules ) {\n\t\t\t$this->matches = '';\n\t\t\t$rewrite       = $this->rewrite_rules();\n\t\t\t$num_rules     = count( $rewrite );\n\t\t\t$rules        .= \"RewriteCond %{REQUEST_FILENAME} -f [OR]\\n\" .\n\t\t\t\t\"RewriteCond %{REQUEST_FILENAME} -d\\n\" .\n\t\t\t\t\"RewriteRule ^.*$ - [S=$num_rules]\\n\";\n\n\t\t\tforeach ( (array) $rewrite as $match => $query ) {\n\t\t\t\t// Apache 1.3 does not support the reluctant (non-greedy) modifier.\n\t\t\t\t$match = str_replace( '.+?', '.+', $match );\n\n\t\t\t\tif ( strpos( $query, $this->index ) !== false ) {\n\t\t\t\t\t$rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . \" [QSA,L]\\n\";\n\t\t\t\t} else {\n\t\t\t\t\t$rules .= 'RewriteRule ^' . $match . ' ' . $site_root . $query . \" [QSA,L]\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$rules .= \"RewriteCond %{REQUEST_FILENAME} !-f\\n\" .\n\t\t\t\t\"RewriteCond %{REQUEST_FILENAME} !-d\\n\" .\n\t\t\t\t\"RewriteRule . {$home_root}{$this->index} [L]\\n\";\n\t\t}\n\n\t\t$rules .= \"</IfModule>\\n\";\n\n\t\t/**\n\t\t * Filters the list of rewrite rules formatted for output to an .htaccess file.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param string $rules mod_rewrite Rewrite rules formatted for .htaccess.\n\t\t */\n\t\t$rules = apply_filters( 'mod_rewrite_rules', $rules );\n\n\t\t/**\n\t\t * Filters the list of rewrite rules formatted for output to an .htaccess file.\n\t\t *\n\t\t * @since 1.5.0\n\t\t * @deprecated 1.5.0 Use the {@see 'mod_rewrite_rules'} filter instead.\n\t\t *\n\t\t * @param string $rules mod_rewrite Rewrite rules formatted for .htaccess.\n\t\t */\n\t\treturn apply_filters_deprecated( 'rewrite_rules', array( $rules ), '1.5.0', 'mod_rewrite_rules' );\n\t}\n\n\t/**\n\t * Retrieves IIS7 URL Rewrite formatted rewrite rules to write to web.config file.\n\t *\n\t * Does not actually write to the web.config file, but creates the rules for\n\t * the process that will.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param bool $add_parent_tags Optional. Whether to add parent tags to the rewrite rule sets.\n\t *                              Default false.\n\t * @return string IIS7 URL rewrite rule sets.\n\t */\n\tpublic function iis7_url_rewrite_rules( $add_parent_tags = false ) {\n\t\tif ( ! $this->using_permalinks() ) {\n\t\t\treturn '';\n\t\t}\n\t\t$rules = '';\n\t\tif ( $add_parent_tags ) {\n\t\t\t$rules .= '<configuration>\n\t<system.webServer>\n\t\t<rewrite>\n\t\t\t<rules>';\n\t\t}\n\n\t\t$rules .= '\n\t\t\t<rule name=\"WordPress: ' . esc_attr( home_url() ) . '\" patternSyntax=\"Wildcard\">\n\t\t\t\t<match url=\"*\" />\n\t\t\t\t\t<conditions>\n\t\t\t\t\t\t<add input=\"{REQUEST_FILENAME}\" matchType=\"IsFile\" negate=\"true\" />\n\t\t\t\t\t\t<add input=\"{REQUEST_FILENAME}\" matchType=\"IsDirectory\" negate=\"true\" />\n\t\t\t\t\t</conditions>\n\t\t\t\t<action type=\"Rewrite\" url=\"index.php\" />\n\t\t\t</rule>';\n\n\t\tif ( $add_parent_tags ) {\n\t\t\t$rules .= '\n\t\t\t</rules>\n\t\t</rewrite>\n\t</system.webServer>\n</configuration>';\n\t\t}\n\n\t\t/**\n\t\t * Filters the list of rewrite rules formatted for output to a web.config.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string $rules Rewrite rules formatted for IIS web.config.\n\t\t */\n\t\treturn apply_filters( 'iis7_url_rewrite_rules', $rules );\n\t}\n\n\t/**\n\t * Adds a rewrite rule that transforms a URL structure to a set of query vars.\n\t *\n\t * Any value in the $after parameter that isn't 'bottom' will result in the rule\n\t * being placed at the top of the rewrite rules.\n\t *\n\t * @since 2.1.0\n\t * @since 4.4.0 Array support was added to the `$query` parameter.\n\t *\n\t * @param string       $regex Regular expression to match request against.\n\t * @param string|array $query The corresponding query vars for this rewrite rule.\n\t * @param string       $after Optional. Priority of the new rule. Accepts 'top'\n\t *                            or 'bottom'. Default 'bottom'.\n\t */\n\tpublic function add_rule( $regex, $query, $after = 'bottom' ) {\n\t\tif ( is_array( $query ) ) {\n\t\t\t$external = false;\n\t\t\t$query    = add_query_arg( $query, 'index.php' );\n\t\t} else {\n\t\t\t$index = false === strpos( $query, '?' ) ? strlen( $query ) : strpos( $query, '?' );\n\t\t\t$front = substr( $query, 0, $index );\n\n\t\t\t$external = $front != $this->index;\n\t\t}\n\n\t\t// \"external\" = it doesn't correspond to index.php.\n\t\tif ( $external ) {\n\t\t\t$this->add_external_rule( $regex, $query );\n\t\t} else {\n\t\t\tif ( 'bottom' === $after ) {\n\t\t\t\t$this->extra_rules = array_merge( $this->extra_rules, array( $regex => $query ) );\n\t\t\t} else {\n\t\t\t\t$this->extra_rules_top = array_merge( $this->extra_rules_top, array( $regex => $query ) );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Adds a rewrite rule that doesn't correspond to index.php.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $regex Regular expression to match request against.\n\t * @param string $query The corresponding query vars for this rewrite rule.\n\t */\n\tpublic function add_external_rule( $regex, $query ) {\n\t\t$this->non_wp_rules[ $regex ] = $query;\n\t}\n\n\t/**\n\t * Adds an endpoint, like /trackback/.\n\t *\n\t * @since 2.1.0\n\t * @since 3.9.0 $query_var parameter added.\n\t * @since 4.3.0 Added support for skipping query var registration by passing `false` to `$query_var`.\n\t *\n\t * @see add_rewrite_endpoint() for full documentation.\n\t * @global WP $wp Current WordPress environment instance.\n\t *\n\t * @param string      $name      Name of the endpoint.\n\t * @param int         $places    Endpoint mask describing the places the endpoint should be added.\n\t * @param string|bool $query_var Optional. Name of the corresponding query variable. Pass `false` to\n\t *                               skip registering a query_var for this endpoint. Defaults to the\n\t *                               value of `$name`.\n\t */\n\tpublic function add_endpoint( $name, $places, $query_var = true ) {\n\t\tglobal $wp;\n\n\t\t// For backward compatibility, if null has explicitly been passed as `$query_var`, assume `true`.\n\t\tif ( true === $query_var || null === $query_var ) {\n\t\t\t$query_var = $name;\n\t\t}\n\t\t$this->endpoints[] = array( $places, $name, $query_var );\n\n\t\tif ( $query_var ) {\n\t\t\t$wp->add_query_var( $query_var );\n\t\t}\n\t}\n\n\t/**\n\t * Adds a new permalink structure.\n\t *\n\t * A permalink structure (permastruct) is an abstract definition of a set of rewrite rules;\n\t * it is an easy way of expressing a set of regular expressions that rewrite to a set of\n\t * query strings. The new permastruct is added to the WP_Rewrite::$extra_permastructs array.\n\t *\n\t * When the rewrite rules are built by WP_Rewrite::rewrite_rules(), all of these extra\n\t * permastructs are passed to WP_Rewrite::generate_rewrite_rules() which transforms them\n\t * into the regular expressions that many love to hate.\n\t *\n\t * The `$args` parameter gives you control over how WP_Rewrite::generate_rewrite_rules()\n\t * works on the new permastruct.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $name   Name for permalink structure.\n\t * @param string $struct Permalink structure (e.g. category/%category%)\n\t * @param array  $args   {\n\t *     Optional. Arguments for building rewrite rules based on the permalink structure.\n\t *     Default empty array.\n\t *\n\t *     @type bool $with_front  Whether the structure should be prepended with `WP_Rewrite::$front`.\n\t *                             Default true.\n\t *     @type int  $ep_mask     The endpoint mask defining which endpoints are added to the structure.\n\t *                             Accepts `EP_NONE`, `EP_PERMALINK`, `EP_ATTACHMENT`, `EP_DATE`, `EP_YEAR`,\n\t *                             `EP_MONTH`, `EP_DAY`, `EP_ROOT`, `EP_COMMENTS`, `EP_SEARCH`, `EP_CATEGORIES`,\n\t *                             `EP_TAGS`, `EP_AUTHORS`, `EP_PAGES`, `EP_ALL_ARCHIVES`, and `EP_ALL`.\n\t *                             Default `EP_NONE`.\n\t *     @type bool $paged       Whether archive pagination rules should be added for the structure.\n\t *                             Default true.\n\t *     @type bool $feed        Whether feed rewrite rules should be added for the structure. Default true.\n\t *     @type bool $forcomments Whether the feed rules should be a query for a comments feed. Default false.\n\t *     @type bool $walk_dirs   Whether the 'directories' making up the structure should be walked over\n\t *                             and rewrite rules built for each in-turn. Default true.\n\t *     @type bool $endpoints   Whether endpoints should be applied to the generated rules. Default true.\n\t * }\n\t */\n\tpublic function add_permastruct( $name, $struct, $args = array() ) {\n\t\t// Back-compat for the old parameters: $with_front and $ep_mask.\n\t\tif ( ! is_array( $args ) ) {\n\t\t\t$args = array( 'with_front' => $args );\n\t\t}\n\t\tif ( func_num_args() == 4 ) {\n\t\t\t$args['ep_mask'] = func_get_arg( 3 );\n\t\t}\n\n\t\t$defaults = array(\n\t\t\t'with_front'  => true,\n\t\t\t'ep_mask'     => EP_NONE,\n\t\t\t'paged'       => true,\n\t\t\t'feed'        => true,\n\t\t\t'forcomments' => false,\n\t\t\t'walk_dirs'   => true,\n\t\t\t'endpoints'   => true,\n\t\t);\n\t\t$args     = array_intersect_key( $args, $defaults );\n\t\t$args     = wp_parse_args( $args, $defaults );\n\n\t\tif ( $args['with_front'] ) {\n\t\t\t$struct = $this->front . $struct;\n\t\t} else {\n\t\t\t$struct = $this->root . $struct;\n\t\t}\n\t\t$args['struct'] = $struct;\n\n\t\t$this->extra_permastructs[ $name ] = $args;\n\t}\n\n\t/**\n\t * Removes a permalink structure.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param string $name Name for permalink structure.\n\t */\n\tpublic function remove_permastruct( $name ) {\n\t\tunset( $this->extra_permastructs[ $name ] );\n\t}\n\n\t/**\n\t * Removes rewrite rules and then recreate rewrite rules.\n\t *\n\t * Calls WP_Rewrite::wp_rewrite_rules() after removing the 'rewrite_rules' option.\n\t * If the function named 'save_mod_rewrite_rules' exists, it will be called.\n\t *\n\t * @since 2.0.1\n\t *\n\t * @param bool $hard Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard).\n\t */\n\tpublic function flush_rules( $hard = true ) {\n\t\tstatic $do_hard_later = null;\n\n\t\t// Prevent this action from running before everyone has registered their rewrites.\n\t\tif ( ! did_action( 'wp_loaded' ) ) {\n\t\t\tadd_action( 'wp_loaded', array( $this, 'flush_rules' ) );\n\t\t\t$do_hard_later = ( isset( $do_hard_later ) ) ? $do_hard_later || $hard : $hard;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( $do_hard_later ) ) {\n\t\t\t$hard = $do_hard_later;\n\t\t\tunset( $do_hard_later );\n\t\t}\n\n\t\tupdate_option( 'rewrite_rules', '' );\n\t\t$this->wp_rewrite_rules();\n\n\t\t/**\n\t\t * Filters whether a \"hard\" rewrite rule flush should be performed when requested.\n\t\t *\n\t\t * A \"hard\" flush updates .htaccess (Apache) or web.config (IIS).\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param bool $hard Whether to flush rewrite rules \"hard\". Default true.\n\t\t */\n\t\tif ( ! $hard || ! apply_filters( 'flush_rewrite_rules_hard', true ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( function_exists( 'save_mod_rewrite_rules' ) ) {\n\t\t\tsave_mod_rewrite_rules();\n\t\t}\n\t\tif ( function_exists( 'iis7_save_url_rewrite_rules' ) ) {\n\t\t\tiis7_save_url_rewrite_rules();\n\t\t}\n\t}\n\n\t/**\n\t * Sets up the object's properties.\n\t *\n\t * The 'use_verbose_page_rules' object property will be set to true if the\n\t * permalink structure begins with one of the following: '%postname%', '%category%',\n\t * '%tag%', or '%author%'.\n\t *\n\t * @since 1.5.0\n\t */\n\tpublic function init() {\n\t\t$this->extra_rules         = array();\n\t\t$this->non_wp_rules        = array();\n\t\t$this->endpoints           = array();\n\t\t$this->permalink_structure = get_option( 'permalink_structure' );\n\t\t$this->front               = substr( $this->permalink_structure, 0, strpos( $this->permalink_structure, '%' ) );\n\t\t$this->root                = '';\n\n\t\tif ( $this->using_index_permalinks() ) {\n\t\t\t$this->root = $this->index . '/';\n\t\t}\n\n\t\tunset( $this->author_structure );\n\t\tunset( $this->date_structure );\n\t\tunset( $this->page_structure );\n\t\tunset( $this->search_structure );\n\t\tunset( $this->feed_structure );\n\t\tunset( $this->comment_feed_structure );\n\n\t\t$this->use_trailing_slashes = ( '/' === substr( $this->permalink_structure, -1, 1 ) );\n\n\t\t// Enable generic rules for pages if permalink structure doesn't begin with a wildcard.\n\t\tif ( preg_match( '/^[^%]*%(?:postname|category|tag|author)%/', $this->permalink_structure ) ) {\n\t\t\t$this->use_verbose_page_rules = true;\n\t\t} else {\n\t\t\t$this->use_verbose_page_rules = false;\n\t\t}\n\t}\n\n\t/**\n\t * Sets the main permalink structure for the site.\n\t *\n\t * Will update the 'permalink_structure' option, if there is a difference\n\t * between the current permalink structure and the parameter value. Calls\n\t * WP_Rewrite::init() after the option is updated.\n\t *\n\t * Fires the {@see 'permalink_structure_changed'} action once the init call has\n\t * processed passing the old and new values\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $permalink_structure Permalink structure.\n\t */\n\tpublic function set_permalink_structure( $permalink_structure ) {\n\t\tif ( $permalink_structure != $this->permalink_structure ) {\n\t\t\t$old_permalink_structure = $this->permalink_structure;\n\t\t\tupdate_option( 'permalink_structure', $permalink_structure );\n\n\t\t\t$this->init();\n\n\t\t\t/**\n\t\t\t * Fires after the permalink structure is updated.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t *\n\t\t\t * @param string $old_permalink_structure The previous permalink structure.\n\t\t\t * @param string $permalink_structure     The new permalink structure.\n\t\t\t */\n\t\t\tdo_action( 'permalink_structure_changed', $old_permalink_structure, $permalink_structure );\n\t\t}\n\t}\n\n\t/**\n\t * Sets the category base for the category permalink.\n\t *\n\t * Will update the 'category_base' option, if there is a difference between\n\t * the current category base and the parameter value. Calls WP_Rewrite::init()\n\t * after the option is updated.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $category_base Category permalink structure base.\n\t */\n\tpublic function set_category_base( $category_base ) {\n\t\tif ( get_option( 'category_base' ) !== $category_base ) {\n\t\t\tupdate_option( 'category_base', $category_base );\n\t\t\t$this->init();\n\t\t}\n\t}\n\n\t/**\n\t * Sets the tag base for the tag permalink.\n\t *\n\t * Will update the 'tag_base' option, if there is a difference between the\n\t * current tag base and the parameter value. Calls WP_Rewrite::init() after\n\t * the option is updated.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string $tag_base Tag permalink structure base.\n\t */\n\tpublic function set_tag_base( $tag_base ) {\n\t\tif ( get_option( 'tag_base' ) !== $tag_base ) {\n\t\t\tupdate_option( 'tag_base', $tag_base );\n\t\t\t$this->init();\n\t\t}\n\t}\n\n\t/**\n\t * Constructor - Calls init(), which runs setup.\n\t *\n\t * @since 1.5.0\n\t */\n\tpublic function __construct() {\n\t\t$this->init();\n\t}\n}\n", "num_lines": 1946}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * User API: WP_Role class\n *\n * @package WordPress\n * @subpackage Users\n * @since 4.4.0\n */\n\n/**\n * Core class used to extend the user roles API.\n *\n * @since 2.0.0\n */\nclass WP_Role {\n\t/**\n\t * Role name.\n\t *\n\t * @since 2.0.0\n\t * @var string\n\t */\n\tpublic $name;\n\n\t/**\n\t * List of capabilities the role contains.\n\t *\n\t * @since 2.0.0\n\t * @var bool[] Array of key/value pairs where keys represent a capability name and boolean values\n\t *             represent whether the role has that capability.\n\t */\n\tpublic $capabilities;\n\n\t/**\n\t * Constructor - Set up object properties.\n\t *\n\t * The list of capabilities must have the key as the name of the capability\n\t * and the value a boolean of whether it is granted to the role.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $role         Role name.\n\t * @param bool[] $capabilities Array of key/value pairs where keys represent a capability name and boolean values\n\t *                             represent whether the role has that capability.\n\t */\n\tpublic function __construct( $role, $capabilities ) {\n\t\t$this->name         = $role;\n\t\t$this->capabilities = $capabilities;\n\t}\n\n\t/**\n\t * Assign role a capability.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $cap   Capability name.\n\t * @param bool   $grant Whether role has capability privilege.\n\t */\n\tpublic function add_cap( $cap, $grant = true ) {\n\t\t$this->capabilities[ $cap ] = $grant;\n\t\twp_roles()->add_cap( $this->name, $cap, $grant );\n\t}\n\n\t/**\n\t * Removes a capability from a role.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $cap Capability name.\n\t */\n\tpublic function remove_cap( $cap ) {\n\t\tunset( $this->capabilities[ $cap ] );\n\t\twp_roles()->remove_cap( $this->name, $cap );\n\t}\n\n\t/**\n\t * Determines whether the role has the given capability.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $cap Capability name.\n\t * @return bool Whether the role has the given capability.\n\t */\n\tpublic function has_cap( $cap ) {\n\t\t/**\n\t\t * Filters which capabilities a role has.\n\t\t *\n\t\t * @since 2.0.0\n\t\t *\n\t\t * @param bool[] $capabilities Array of key/value pairs where keys represent a capability name and boolean values\n\t\t *                             represent whether the role has that capability.\n\t\t * @param string $cap          Capability name.\n\t\t * @param string $name         Role name.\n\t\t */\n\t\t$capabilities = apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name );\n\n\t\tif ( ! empty( $capabilities[ $cap ] ) ) {\n\t\t\treturn $capabilities[ $cap ];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n}\n", "num_lines": 104}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * User API: WP_Roles class\n *\n * @package WordPress\n * @subpackage Users\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement a user roles API.\n *\n * The role option is simple, the structure is organized by role name that store\n * the name in value of the 'name' key. The capabilities are stored as an array\n * in the value of the 'capability' key.\n *\n *     array (\n *          'rolename' => array (\n *              'name' => 'rolename',\n *              'capabilities' => array()\n *          )\n *     )\n *\n * @since 2.0.0\n */\nclass WP_Roles {\n\t/**\n\t * List of roles and capabilities.\n\t *\n\t * @since 2.0.0\n\t * @var array[]\n\t */\n\tpublic $roles;\n\n\t/**\n\t * List of the role objects.\n\t *\n\t * @since 2.0.0\n\t * @var WP_Role[]\n\t */\n\tpublic $role_objects = array();\n\n\t/**\n\t * List of role names.\n\t *\n\t * @since 2.0.0\n\t * @var string[]\n\t */\n\tpublic $role_names = array();\n\n\t/**\n\t * Option name for storing role list.\n\t *\n\t * @since 2.0.0\n\t * @var string\n\t */\n\tpublic $role_key;\n\n\t/**\n\t * Whether to use the database for retrieval and storage.\n\t *\n\t * @since 2.1.0\n\t * @var bool\n\t */\n\tpublic $use_db = true;\n\n\t/**\n\t * The site ID the roles are initialized for.\n\t *\n\t * @since 4.9.0\n\t * @var int\n\t */\n\tprotected $site_id = 0;\n\n\t/**\n\t * Constructor\n\t *\n\t * @since 2.0.0\n\t * @since 4.9.0 The `$site_id` argument was added.\n\t *\n\t * @global array $wp_user_roles Used to set the 'roles' property value.\n\t *\n\t * @param int $site_id Site ID to initialize roles for. Default is the current site.\n\t */\n\tpublic function __construct( $site_id = null ) {\n\t\tglobal $wp_user_roles;\n\n\t\t$this->use_db = empty( $wp_user_roles );\n\n\t\t$this->for_site( $site_id );\n\t}\n\n\t/**\n\t * Make private/protected methods readable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name      Method to call.\n\t * @param array  $arguments Arguments to pass when calling.\n\t * @return mixed|false Return value of the callback, false otherwise.\n\t */\n\tpublic function __call( $name, $arguments ) {\n\t\tif ( '_init' === $name ) {\n\t\t\treturn $this->_init( ...$arguments );\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Set up the object properties.\n\t *\n\t * The role key is set to the current prefix for the $wpdb object with\n\t * 'user_roles' appended. If the $wp_user_roles global is set, then it will\n\t * be used and the role option will not be updated or used.\n\t *\n\t * @since 2.1.0\n\t * @deprecated 4.9.0 Use WP_Roles::for_site()\n\t */\n\tprotected function _init() {\n\t\t_deprecated_function( __METHOD__, '4.9.0', 'WP_Roles::for_site()' );\n\n\t\t$this->for_site();\n\t}\n\n\t/**\n\t * Reinitialize the object\n\t *\n\t * Recreates the role objects. This is typically called only by switch_to_blog()\n\t * after switching wpdb to a new site ID.\n\t *\n\t * @since 3.5.0\n\t * @deprecated 4.7.0 Use WP_Roles::for_site()\n\t */\n\tpublic function reinit() {\n\t\t_deprecated_function( __METHOD__, '4.7.0', 'WP_Roles::for_site()' );\n\n\t\t$this->for_site();\n\t}\n\n\t/**\n\t * Add role name with capabilities to list.\n\t *\n\t * Updates the list of roles, if the role doesn't already exist.\n\t *\n\t * The capabilities are defined in the following format `array( 'read' => true );`\n\t * To explicitly deny a role a capability you set the value for that capability to false.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $role         Role name.\n\t * @param string $display_name Role display name.\n\t * @param bool[] $capabilities List of capabilities keyed by the capability name,\n\t *                             e.g. array( 'edit_posts' => true, 'delete_posts' => false ).\n\t * @return WP_Role|void WP_Role object, if role is added.\n\t */\n\tpublic function add_role( $role, $display_name, $capabilities = array() ) {\n\t\tif ( empty( $role ) || isset( $this->roles[ $role ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->roles[ $role ] = array(\n\t\t\t'name'         => $display_name,\n\t\t\t'capabilities' => $capabilities,\n\t\t);\n\t\tif ( $this->use_db ) {\n\t\t\tupdate_option( $this->role_key, $this->roles );\n\t\t}\n\t\t$this->role_objects[ $role ] = new WP_Role( $role, $capabilities );\n\t\t$this->role_names[ $role ]   = $display_name;\n\t\treturn $this->role_objects[ $role ];\n\t}\n\n\t/**\n\t * Remove role by name.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $role Role name.\n\t */\n\tpublic function remove_role( $role ) {\n\t\tif ( ! isset( $this->role_objects[ $role ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tunset( $this->role_objects[ $role ] );\n\t\tunset( $this->role_names[ $role ] );\n\t\tunset( $this->roles[ $role ] );\n\n\t\tif ( $this->use_db ) {\n\t\t\tupdate_option( $this->role_key, $this->roles );\n\t\t}\n\n\t\tif ( get_option( 'default_role' ) == $role ) {\n\t\t\tupdate_option( 'default_role', 'subscriber' );\n\t\t}\n\t}\n\n\t/**\n\t * Add capability to role.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $role  Role name.\n\t * @param string $cap   Capability name.\n\t * @param bool   $grant Optional. Whether role is capable of performing capability.\n\t *                      Default true.\n\t */\n\tpublic function add_cap( $role, $cap, $grant = true ) {\n\t\tif ( ! isset( $this->roles[ $role ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->roles[ $role ]['capabilities'][ $cap ] = $grant;\n\t\tif ( $this->use_db ) {\n\t\t\tupdate_option( $this->role_key, $this->roles );\n\t\t}\n\t}\n\n\t/**\n\t * Remove capability from role.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $role Role name.\n\t * @param string $cap  Capability name.\n\t */\n\tpublic function remove_cap( $role, $cap ) {\n\t\tif ( ! isset( $this->roles[ $role ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tunset( $this->roles[ $role ]['capabilities'][ $cap ] );\n\t\tif ( $this->use_db ) {\n\t\t\tupdate_option( $this->role_key, $this->roles );\n\t\t}\n\t}\n\n\t/**\n\t * Retrieve role object by name.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $role Role name.\n\t * @return WP_Role|null WP_Role object if found, null if the role does not exist.\n\t */\n\tpublic function get_role( $role ) {\n\t\tif ( isset( $this->role_objects[ $role ] ) ) {\n\t\t\treturn $this->role_objects[ $role ];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t/**\n\t * Retrieve list of role names.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @return string[] List of role names.\n\t */\n\tpublic function get_names() {\n\t\treturn $this->role_names;\n\t}\n\n\t/**\n\t * Whether role name is currently in the list of available roles.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $role Role name to look up.\n\t * @return bool\n\t */\n\tpublic function is_role( $role ) {\n\t\treturn isset( $this->role_names[ $role ] );\n\t}\n\n\t/**\n\t * Initializes all of the available roles.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic function init_roles() {\n\t\tif ( empty( $this->roles ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->role_objects = array();\n\t\t$this->role_names   = array();\n\t\tforeach ( array_keys( $this->roles ) as $role ) {\n\t\t\t$this->role_objects[ $role ] = new WP_Role( $role, $this->roles[ $role ]['capabilities'] );\n\t\t\t$this->role_names[ $role ]   = $this->roles[ $role ]['name'];\n\t\t}\n\n\t\t/**\n\t\t * After the roles have been initialized, allow plugins to add their own roles.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_Roles $this A reference to the WP_Roles object.\n\t\t */\n\t\tdo_action( 'wp_roles_init', $this );\n\t}\n\n\t/**\n\t * Sets the site to operate on. Defaults to the current site.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param int $site_id Site ID to initialize roles for. Default is the current site.\n\t */\n\tpublic function for_site( $site_id = null ) {\n\t\tglobal $wpdb;\n\n\t\tif ( ! empty( $site_id ) ) {\n\t\t\t$this->site_id = absint( $site_id );\n\t\t} else {\n\t\t\t$this->site_id = get_current_blog_id();\n\t\t}\n\n\t\t$this->role_key = $wpdb->get_blog_prefix( $this->site_id ) . 'user_roles';\n\n\t\tif ( ! empty( $this->roles ) && ! $this->use_db ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->roles = $this->get_roles_data();\n\n\t\t$this->init_roles();\n\t}\n\n\t/**\n\t * Gets the ID of the site for which roles are currently initialized.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @return int Site ID.\n\t */\n\tpublic function get_site_id() {\n\t\treturn $this->site_id;\n\t}\n\n\t/**\n\t * Gets the available roles data.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @global array $wp_user_roles Used to set the 'roles' property value.\n\t *\n\t * @return array Roles array.\n\t */\n\tprotected function get_roles_data() {\n\t\tglobal $wp_user_roles;\n\n\t\tif ( ! empty( $wp_user_roles ) ) {\n\t\t\treturn $wp_user_roles;\n\t\t}\n\n\t\tif ( is_multisite() && get_current_blog_id() != $this->site_id ) {\n\t\t\tremove_action( 'switch_blog', 'wp_switch_roles_and_user', 1 );\n\n\t\t\t$roles = get_blog_option( $this->site_id, $this->role_key, array() );\n\n\t\t\tadd_action( 'switch_blog', 'wp_switch_roles_and_user', 1, 2 );\n\n\t\t\treturn $roles;\n\t\t}\n\n\t\treturn get_option( $this->role_key, array() );\n\t}\n}\n", "num_lines": 373}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Session API: WP_Session_Tokens class\n *\n * @package WordPress\n * @subpackage Session\n * @since 4.7.0\n */\n\n/**\n * Abstract class for managing user session tokens.\n *\n * @since 4.0.0\n */\nabstract class WP_Session_Tokens {\n\n\t/**\n\t * User ID.\n\t *\n\t * @since 4.0.0\n\t * @var int User ID.\n\t */\n\tprotected $user_id;\n\n\t/**\n\t * Protected constructor. Use the `get_instance()` method to get the instance.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param int $user_id User whose session to manage.\n\t */\n\tprotected function __construct( $user_id ) {\n\t\t$this->user_id = $user_id;\n\t}\n\n\t/**\n\t * Retrieves a session manager instance for a user.\n\t *\n\t * This method contains a {@see 'session_token_manager'} filter, allowing a plugin to swap out\n\t * the session manager for a subclass of `WP_Session_Tokens`.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param int $user_id User whose session to manage.\n\t * @return WP_Session_Tokens The session object, which is by default an instance of\n\t *                           the `WP_User_Meta_Session_Tokens` class.\n\t */\n\tfinal public static function get_instance( $user_id ) {\n\t\t/**\n\t\t * Filters the class name for the session token manager.\n\t\t *\n\t\t * @since 4.0.0\n\t\t *\n\t\t * @param string $session Name of class to use as the manager.\n\t\t *                        Default 'WP_User_Meta_Session_Tokens'.\n\t\t */\n\t\t$manager = apply_filters( 'session_token_manager', 'WP_User_Meta_Session_Tokens' );\n\t\treturn new $manager( $user_id );\n\t}\n\n\t/**\n\t * Hashes the given session token for storage.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $token Session token to hash.\n\t * @return string A hash of the session token (a verifier).\n\t */\n\tfinal private function hash_token( $token ) {\n\t\t// If ext/hash is not present, use sha1() instead.\n\t\tif ( function_exists( 'hash' ) ) {\n\t\t\treturn hash( 'sha256', $token );\n\t\t} else {\n\t\t\treturn sha1( $token );\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves a user's session for the given token.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $token Session token.\n\t * @return array|null The session, or null if it does not exist.\n\t */\n\tfinal public function get( $token ) {\n\t\t$verifier = $this->hash_token( $token );\n\t\treturn $this->get_session( $verifier );\n\t}\n\n\t/**\n\t * Validates the given session token for authenticity and validity.\n\t *\n\t * Checks that the given token is present and hasn't expired.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $token Token to verify.\n\t * @return bool Whether the token is valid for the user.\n\t */\n\tfinal public function verify( $token ) {\n\t\t$verifier = $this->hash_token( $token );\n\t\treturn (bool) $this->get_session( $verifier );\n\t}\n\n\t/**\n\t * Generates a session token and attaches session information to it.\n\t *\n\t * A session token is a long, random string. It is used in a cookie\n\t * to link that cookie to an expiration time and to ensure the cookie\n\t * becomes invalidated when the user logs out.\n\t *\n\t * This function generates a token and stores it with the associated\n\t * expiration time (and potentially other session information via the\n\t * {@see 'attach_session_information'} filter).\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param int $expiration Session expiration timestamp.\n\t * @return string Session token.\n\t */\n\tfinal public function create( $expiration ) {\n\t\t/**\n\t\t * Filters the information attached to the newly created session.\n\t\t *\n\t\t * Can be used to attach further information to a session.\n\t\t *\n\t\t * @since 4.0.0\n\t\t *\n\t\t * @param array $session Array of extra data.\n\t\t * @param int   $user_id User ID.\n\t\t */\n\t\t$session               = apply_filters( 'attach_session_information', array(), $this->user_id );\n\t\t$session['expiration'] = $expiration;\n\n\t\t// IP address.\n\t\tif ( ! empty( $_SERVER['REMOTE_ADDR'] ) ) {\n\t\t\t$session['ip'] = $_SERVER['REMOTE_ADDR'];\n\t\t}\n\n\t\t// User-agent.\n\t\tif ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) {\n\t\t\t$session['ua'] = wp_unslash( $_SERVER['HTTP_USER_AGENT'] );\n\t\t}\n\n\t\t// Timestamp.\n\t\t$session['login'] = time();\n\n\t\t$token = wp_generate_password( 43, false, false );\n\n\t\t$this->update( $token, $session );\n\n\t\treturn $token;\n\t}\n\n\t/**\n\t * Updates the data for the session with the given token.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $token Session token to update.\n\t * @param array  $session Session information.\n\t */\n\tfinal public function update( $token, $session ) {\n\t\t$verifier = $this->hash_token( $token );\n\t\t$this->update_session( $verifier, $session );\n\t}\n\n\t/**\n\t * Destroys the session with the given token.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $token Session token to destroy.\n\t */\n\tfinal public function destroy( $token ) {\n\t\t$verifier = $this->hash_token( $token );\n\t\t$this->update_session( $verifier, null );\n\t}\n\n\t/**\n\t * Destroys all sessions for this user except the one with the given token (presumably the one in use).\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $token_to_keep Session token to keep.\n\t */\n\tfinal public function destroy_others( $token_to_keep ) {\n\t\t$verifier = $this->hash_token( $token_to_keep );\n\t\t$session  = $this->get_session( $verifier );\n\t\tif ( $session ) {\n\t\t\t$this->destroy_other_sessions( $verifier );\n\t\t} else {\n\t\t\t$this->destroy_all_sessions();\n\t\t}\n\t}\n\n\t/**\n\t * Determines whether a session is still valid, based on its expiration timestamp.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param array $session Session to check.\n\t * @return bool Whether session is valid.\n\t */\n\tfinal protected function is_still_valid( $session ) {\n\t\treturn $session['expiration'] >= time();\n\t}\n\n\t/**\n\t * Destroys all sessions for a user.\n\t *\n\t * @since 4.0.0\n\t */\n\tfinal public function destroy_all() {\n\t\t$this->destroy_all_sessions();\n\t}\n\n\t/**\n\t * Destroys all sessions for all users.\n\t *\n\t * @since 4.0.0\n\t */\n\tfinal public static function destroy_all_for_all_users() {\n\t\t/** This filter is documented in wp-includes/class-wp-session-tokens.php */\n\t\t$manager = apply_filters( 'session_token_manager', 'WP_User_Meta_Session_Tokens' );\n\t\tcall_user_func( array( $manager, 'drop_sessions' ) );\n\t}\n\n\t/**\n\t * Retrieves all sessions for a user.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @return array Sessions for a user.\n\t */\n\tfinal public function get_all() {\n\t\treturn array_values( $this->get_sessions() );\n\t}\n\n\t/**\n\t * Retrieves all sessions of the user.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @return array Sessions of the user.\n\t */\n\tabstract protected function get_sessions();\n\n\t/**\n\t * Retrieves a session based on its verifier (token hash).\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $verifier Verifier for the session to retrieve.\n\t * @return array|null The session, or null if it does not exist.\n\t */\n\tabstract protected function get_session( $verifier );\n\n\t/**\n\t * Updates a session based on its verifier (token hash).\n\t *\n\t * Omitting the second argument destroys the session.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $verifier Verifier for the session to update.\n\t * @param array  $session  Optional. Session. Omitting this argument destroys the session.\n\t */\n\tabstract protected function update_session( $verifier, $session = null );\n\n\t/**\n\t * Destroys all sessions for this user, except the single session with the given verifier.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $verifier Verifier of the session to keep.\n\t */\n\tabstract protected function destroy_other_sessions( $verifier );\n\n\t/**\n\t * Destroys all sessions for the user.\n\t *\n\t * @since 4.0.0\n\t */\n\tabstract protected function destroy_all_sessions();\n\n\t/**\n\t * Destroys all sessions for all users.\n\t *\n\t * @since 4.0.0\n\t */\n\tpublic static function drop_sessions() {}\n}\n", "num_lines": 295}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Feed API: WP_SimplePie_File class\n *\n * @package WordPress\n * @subpackage Feed\n * @since 4.7.0\n */\n\n/**\n * Core class for fetching remote files and reading local files with SimplePie.\n *\n * @since 2.8.0\n *\n * @see SimplePie_File\n */\nclass WP_SimplePie_File extends SimplePie_File {\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 2.8.0\n\t * @since 3.2.0 Updated to use a PHP5 constructor.\n\t *\n\t * @param string       $url             Remote file URL.\n\t * @param integer      $timeout         Optional. How long the connection should stay open in seconds.\n\t *                                      Default 10.\n\t * @param integer      $redirects       Optional. The number of allowed redirects. Default 5.\n\t * @param string|array $headers         Optional. Array or string of headers to send with the request.\n\t *                                      Default null.\n\t * @param string       $useragent       Optional. User-agent value sent. Default null.\n\t * @param boolean      $force_fsockopen Optional. Whether to force opening internet or unix domain socket\n\t *                                      connection or not. Default false.\n\t */\n\tpublic function __construct( $url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false ) {\n\t\t$this->url       = $url;\n\t\t$this->timeout   = $timeout;\n\t\t$this->redirects = $redirects;\n\t\t$this->headers   = $headers;\n\t\t$this->useragent = $useragent;\n\n\t\t$this->method = SIMPLEPIE_FILE_SOURCE_REMOTE;\n\n\t\tif ( preg_match( '/^http(s)?:\\/\\//i', $url ) ) {\n\t\t\t$args = array(\n\t\t\t\t'timeout'     => $this->timeout,\n\t\t\t\t'redirection' => $this->redirects,\n\t\t\t);\n\n\t\t\tif ( ! empty( $this->headers ) ) {\n\t\t\t\t$args['headers'] = $this->headers;\n\t\t\t}\n\n\t\t\tif ( SIMPLEPIE_USERAGENT != $this->useragent ) { // Use default WP user agent unless custom has been specified.\n\t\t\t\t$args['user-agent'] = $this->useragent;\n\t\t\t}\n\n\t\t\t$res = wp_safe_remote_request( $url, $args );\n\n\t\t\tif ( is_wp_error( $res ) ) {\n\t\t\t\t$this->error   = 'WP HTTP Error: ' . $res->get_error_message();\n\t\t\t\t$this->success = false;\n\t\t\t} else {\n\t\t\t\t$this->headers     = wp_remote_retrieve_headers( $res );\n\t\t\t\t$this->body        = wp_remote_retrieve_body( $res );\n\t\t\t\t$this->status_code = wp_remote_retrieve_response_code( $res );\n\t\t\t}\n\t\t} else {\n\t\t\t$this->error   = '';\n\t\t\t$this->success = false;\n\t\t}\n\t}\n}\n", "num_lines": 74}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Feed API: WP_SimplePie_Sanitize_KSES class\n *\n * @package WordPress\n * @subpackage Feed\n * @since 4.7.0\n */\n\n/**\n * Core class used to implement SimpliePie feed sanitization.\n *\n * Extends the SimplePie_Sanitize class to use KSES, because\n * we cannot universally count on DOMDocument being available.\n *\n * @since 3.5.0\n *\n * @see SimplePie_Sanitize\n */\nclass WP_SimplePie_Sanitize_KSES extends SimplePie_Sanitize {\n\n\t/**\n\t * WordPress SimplePie sanitization using KSES.\n\t *\n\t * Sanitizes the incoming data, to ensure that it matches the type of data expected, using KSES.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param mixed   $data The data that needs to be sanitized.\n\t * @param integer $type The type of data that it's supposed to be.\n\t * @param string  $base Optional. The `xml:base` value to use when converting relative\n\t *                      URLs to absolute ones. Default empty.\n\t * @return mixed Sanitized data.\n\t */\n\tpublic function sanitize( $data, $type, $base = '' ) {\n\t\t$data = trim( $data );\n\t\tif ( $type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML ) {\n\t\t\tif ( preg_match( '/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\\/[A-Za-z][^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x2F\\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data ) ) {\n\t\t\t\t$type |= SIMPLEPIE_CONSTRUCT_HTML;\n\t\t\t} else {\n\t\t\t\t$type |= SIMPLEPIE_CONSTRUCT_TEXT;\n\t\t\t}\n\t\t}\n\t\tif ( $type & SIMPLEPIE_CONSTRUCT_BASE64 ) {\n\t\t\t$data = base64_decode( $data );\n\t\t}\n\t\tif ( $type & ( SIMPLEPIE_CONSTRUCT_HTML | SIMPLEPIE_CONSTRUCT_XHTML ) ) {\n\t\t\t$data = wp_kses_post( $data );\n\t\t\tif ( 'UTF-8' !== $this->output_encoding ) {\n\t\t\t\t$data = $this->registry->call( 'Misc', 'change_encoding', array( $data, 'UTF-8', $this->output_encoding ) );\n\t\t\t}\n\t\t\treturn $data;\n\t\t} else {\n\t\t\treturn parent::sanitize( $data, $type, $base );\n\t\t}\n\t}\n}\n", "num_lines": 58}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Site API: WP_Site_Query class\n *\n * @package WordPress\n * @subpackage Sites\n * @since 4.6.0\n */\n\n/**\n * Core class used for querying sites.\n *\n * @since 4.6.0\n *\n * @see WP_Site_Query::__construct() for accepted arguments.\n */\nclass WP_Site_Query {\n\n\t/**\n\t * SQL for database query.\n\t *\n\t * @since 4.6.0\n\t * @var string\n\t */\n\tpublic $request;\n\n\t/**\n\t * SQL query clauses.\n\t *\n\t * @since 4.6.0\n\t * @var array\n\t */\n\tprotected $sql_clauses = array(\n\t\t'select'  => '',\n\t\t'from'    => '',\n\t\t'where'   => array(),\n\t\t'groupby' => '',\n\t\t'orderby' => '',\n\t\t'limits'  => '',\n\t);\n\n\t/**\n\t * Metadata query container.\n\t *\n\t * @since 5.1.0\n\t * @var WP_Meta_Query\n\t */\n\tpublic $meta_query = false;\n\n\t/**\n\t * Metadata query clauses.\n\t *\n\t * @since 5.1.0\n\t * @var array\n\t */\n\tprotected $meta_query_clauses;\n\n\t/**\n\t * Date query container.\n\t *\n\t * @since 4.6.0\n\t * @var WP_Date_Query A date query instance.\n\t */\n\tpublic $date_query = false;\n\n\t/**\n\t * Query vars set by the user.\n\t *\n\t * @since 4.6.0\n\t * @var array\n\t */\n\tpublic $query_vars;\n\n\t/**\n\t * Default values for query vars.\n\t *\n\t * @since 4.6.0\n\t * @var array\n\t */\n\tpublic $query_var_defaults;\n\n\t/**\n\t * List of sites located by the query.\n\t *\n\t * @since 4.6.0\n\t * @var array\n\t */\n\tpublic $sites;\n\n\t/**\n\t * The amount of found sites for the current query.\n\t *\n\t * @since 4.6.0\n\t * @var int\n\t */\n\tpublic $found_sites = 0;\n\n\t/**\n\t * The number of pages.\n\t *\n\t * @since 4.6.0\n\t * @var int\n\t */\n\tpublic $max_num_pages = 0;\n\n\t/**\n\t * Sets up the site query, based on the query vars passed.\n\t *\n\t * @since 4.6.0\n\t * @since 4.8.0 Introduced the 'lang_id', 'lang__in', and 'lang__not_in' parameters.\n\t * @since 5.1.0 Introduced the 'update_site_meta_cache', 'meta_query', 'meta_key',\n\t *              'meta_value', 'meta_type' and 'meta_compare' parameters.\n\t *\n\t * @param string|array $query {\n\t *     Optional. Array or query string of site query parameters. Default empty.\n\t *\n\t *     @type array        $site__in               Array of site IDs to include. Default empty.\n\t *     @type array        $site__not_in           Array of site IDs to exclude. Default empty.\n\t *     @type bool         $count                  Whether to return a site count (true) or array of site objects.\n\t *                                                Default false.\n\t *     @type array        $date_query             Date query clauses to limit sites by. See WP_Date_Query.\n\t *                                                Default null.\n\t *     @type string       $fields                 Site fields to return. Accepts 'ids' (returns an array of site IDs)\n\t *                                                or empty (returns an array of complete site objects). Default empty.\n\t *     @type int          $ID                     A site ID to only return that site. Default empty.\n\t *     @type int          $number                 Maximum number of sites to retrieve. Default 100.\n\t *     @type int          $offset                 Number of sites to offset the query. Used to build LIMIT clause.\n\t *                                                Default 0.\n\t *     @type bool         $no_found_rows          Whether to disable the `SQL_CALC_FOUND_ROWS` query. Default true.\n\t *     @type string|array $orderby                Site status or array of statuses. Accepts 'id', 'domain', 'path',\n\t *                                                'network_id', 'last_updated', 'registered', 'domain_length',\n\t *                                                'path_length', 'site__in' and 'network__in'. Also accepts false,\n\t *                                                an empty array, or 'none' to disable `ORDER BY` clause.\n\t *                                                Default 'id'.\n\t *     @type string       $order                  How to order retrieved sites. Accepts 'ASC', 'DESC'. Default 'ASC'.\n\t *     @type int          $network_id             Limit results to those affiliated with a given network ID. If 0,\n\t *                                                include all networks. Default 0.\n\t *     @type array        $network__in            Array of network IDs to include affiliated sites for. Default empty.\n\t *     @type array        $network__not_in        Array of network IDs to exclude affiliated sites for. Default empty.\n\t *     @type string       $domain                 Limit results to those affiliated with a given domain. Default empty.\n\t *     @type array        $domain__in             Array of domains to include affiliated sites for. Default empty.\n\t *     @type array        $domain__not_in         Array of domains to exclude affiliated sites for. Default empty.\n\t *     @type string       $path                   Limit results to those affiliated with a given path. Default empty.\n\t *     @type array        $path__in               Array of paths to include affiliated sites for. Default empty.\n\t *     @type array        $path__not_in           Array of paths to exclude affiliated sites for. Default empty.\n\t *     @type int          $public                 Limit results to public sites. Accepts '1' or '0'. Default empty.\n\t *     @type int          $archived               Limit results to archived sites. Accepts '1' or '0'. Default empty.\n\t *     @type int          $mature                 Limit results to mature sites. Accepts '1' or '0'. Default empty.\n\t *     @type int          $spam                   Limit results to spam sites. Accepts '1' or '0'. Default empty.\n\t *     @type int          $deleted                Limit results to deleted sites. Accepts '1' or '0'. Default empty.\n\t *     @type int          $lang_id                Limit results to a language ID. Default empty.\n\t *     @type array        $lang__in               Array of language IDs to include affiliated sites for. Default empty.\n\t *     @type array        $lang__not_in           Array of language IDs to exclude affiliated sites for. Default empty.\n\t *     @type string       $search                 Search term(s) to retrieve matching sites for. Default empty.\n\t *     @type array        $search_columns         Array of column names to be searched. Accepts 'domain' and 'path'.\n\t *                                                Default empty array.\n\t *     @type bool         $update_site_cache      Whether to prime the cache for found sites. Default true.\n\t *     @type bool         $update_site_meta_cache Whether to prime the metadata cache for found sites. Default true.\n\t *     @type array        $meta_query             Meta query clauses to limit retrieved sites by. See `WP_Meta_Query`.\n\t *                                                Default empty.\n\t *     @type string       $meta_key               Limit sites to those matching a specific metadata key.\n\t *                                                Can be used in conjunction with `$meta_value`. Default empty.\n\t *     @type string       $meta_value             Limit sites to those matching a specific metadata value.\n\t *                                                Usually used in conjunction with `$meta_key`. Default empty.\n\t *     @type string       $meta_type              Data type that the `$meta_value` column will be CAST to for\n\t *                                                comparisons. Default empty.\n\t *     @type string       $meta_compare           Comparison operator to test the `$meta_value`. Default empty.\n\t * }\n\t */\n\tpublic function __construct( $query = '' ) {\n\t\t$this->query_var_defaults = array(\n\t\t\t'fields'                 => '',\n\t\t\t'ID'                     => '',\n\t\t\t'site__in'               => '',\n\t\t\t'site__not_in'           => '',\n\t\t\t'number'                 => 100,\n\t\t\t'offset'                 => '',\n\t\t\t'no_found_rows'          => true,\n\t\t\t'orderby'                => 'id',\n\t\t\t'order'                  => 'ASC',\n\t\t\t'network_id'             => 0,\n\t\t\t'network__in'            => '',\n\t\t\t'network__not_in'        => '',\n\t\t\t'domain'                 => '',\n\t\t\t'domain__in'             => '',\n\t\t\t'domain__not_in'         => '',\n\t\t\t'path'                   => '',\n\t\t\t'path__in'               => '',\n\t\t\t'path__not_in'           => '',\n\t\t\t'public'                 => null,\n\t\t\t'archived'               => null,\n\t\t\t'mature'                 => null,\n\t\t\t'spam'                   => null,\n\t\t\t'deleted'                => null,\n\t\t\t'lang_id'                => null,\n\t\t\t'lang__in'               => '',\n\t\t\t'lang__not_in'           => '',\n\t\t\t'search'                 => '',\n\t\t\t'search_columns'         => array(),\n\t\t\t'count'                  => false,\n\t\t\t'date_query'             => null, // See WP_Date_Query.\n\t\t\t'update_site_cache'      => true,\n\t\t\t'update_site_meta_cache' => true,\n\t\t\t'meta_query'             => '',\n\t\t\t'meta_key'               => '',\n\t\t\t'meta_value'             => '',\n\t\t\t'meta_type'              => '',\n\t\t\t'meta_compare'           => '',\n\t\t);\n\n\t\tif ( ! empty( $query ) ) {\n\t\t\t$this->query( $query );\n\t\t}\n\t}\n\n\t/**\n\t * Parses arguments passed to the site query with default query parameters.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @see WP_Site_Query::__construct()\n\t *\n\t * @param string|array $query Array or string of WP_Site_Query arguments. See WP_Site_Query::__construct().\n\t */\n\tpublic function parse_query( $query = '' ) {\n\t\tif ( empty( $query ) ) {\n\t\t\t$query = $this->query_vars;\n\t\t}\n\n\t\t$this->query_vars = wp_parse_args( $query, $this->query_var_defaults );\n\n\t\t/**\n\t\t * Fires after the site query vars have been parsed.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param WP_Site_Query $this The WP_Site_Query instance (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'parse_site_query', array( &$this ) );\n\t}\n\n\t/**\n\t * Sets up the WordPress query for retrieving sites.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string|array $query Array or URL query string of parameters.\n\t * @return array|int List of WP_Site objects, a list of site IDs when 'fields' is set to 'ids',\n\t *                   or the number of sites when 'count' is passed as a query var.\n\t */\n\tpublic function query( $query ) {\n\t\t$this->query_vars = wp_parse_args( $query );\n\n\t\treturn $this->get_sites();\n\t}\n\n\t/**\n\t * Retrieves a list of sites matching the query vars.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @return array|int List of WP_Site objects, a list of site IDs when 'fields' is set to 'ids',\n\t *                   or the number of sites when 'count' is passed as a query var.\n\t */\n\tpublic function get_sites() {\n\t\tglobal $wpdb;\n\n\t\t$this->parse_query();\n\n\t\t// Parse meta query.\n\t\t$this->meta_query = new WP_Meta_Query();\n\t\t$this->meta_query->parse_query_vars( $this->query_vars );\n\n\t\t/**\n\t\t * Fires before sites are retrieved.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param WP_Site_Query $this Current instance of WP_Site_Query (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'pre_get_sites', array( &$this ) );\n\n\t\t// Reparse query vars, in case they were modified in a 'pre_get_sites' callback.\n\t\t$this->meta_query->parse_query_vars( $this->query_vars );\n\t\tif ( ! empty( $this->meta_query->queries ) ) {\n\t\t\t$this->meta_query_clauses = $this->meta_query->get_sql( 'blog', $wpdb->blogs, 'blog_id', $this );\n\t\t}\n\n\t\t$site_data = null;\n\n\t\t/**\n\t\t * Filter the site data before the get_sites query takes place.\n\t\t *\n\t\t * Return a non-null value to bypass WordPress's default site queries.\n\t\t *\n\t\t * The expected return type from this filter depends on the value passed in the request query_vars:\n\t\t * When `$this->query_vars['count']` is set, the filter should return the site count as an int.\n\t\t * When `'ids' === $this->query_vars['fields']`, the filter should return an array of site IDs.\n\t\t * Otherwise the filter should return an array of WP_Site objects.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param array|int|null $site_data Return an array of site data to short-circuit WP's site query,\n\t\t *                                  the site count as an integer if `$this->query_vars['count']` is set,\n\t\t *                                  or null to run the normal queries.\n\t\t * @param WP_Site_Query  $this      The WP_Site_Query instance, passed by reference.\n\t\t */\n\t\t$site_data = apply_filters_ref_array( 'sites_pre_query', array( $site_data, &$this ) );\n\n\t\tif ( null !== $site_data ) {\n\t\t\treturn $site_data;\n\t\t}\n\n\t\t// $args can include anything. Only use the args defined in the query_var_defaults to compute the key.\n\t\t$_args = wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) );\n\n\t\t// Ignore the $fields argument as the queried result will be the same regardless.\n\t\tunset( $_args['fields'] );\n\n\t\t$key          = md5( serialize( $_args ) );\n\t\t$last_changed = wp_cache_get_last_changed( 'sites' );\n\n\t\t$cache_key   = \"get_sites:$key:$last_changed\";\n\t\t$cache_value = wp_cache_get( $cache_key, 'sites' );\n\n\t\tif ( false === $cache_value ) {\n\t\t\t$site_ids = $this->get_site_ids();\n\t\t\tif ( $site_ids ) {\n\t\t\t\t$this->set_found_sites();\n\t\t\t}\n\n\t\t\t$cache_value = array(\n\t\t\t\t'site_ids'    => $site_ids,\n\t\t\t\t'found_sites' => $this->found_sites,\n\t\t\t);\n\t\t\twp_cache_add( $cache_key, $cache_value, 'sites' );\n\t\t} else {\n\t\t\t$site_ids          = $cache_value['site_ids'];\n\t\t\t$this->found_sites = $cache_value['found_sites'];\n\t\t}\n\n\t\tif ( $this->found_sites && $this->query_vars['number'] ) {\n\t\t\t$this->max_num_pages = ceil( $this->found_sites / $this->query_vars['number'] );\n\t\t}\n\n\t\t// If querying for a count only, there's nothing more to do.\n\t\tif ( $this->query_vars['count'] ) {\n\t\t\t// $site_ids is actually a count in this case.\n\t\t\treturn intval( $site_ids );\n\t\t}\n\n\t\t$site_ids = array_map( 'intval', $site_ids );\n\n\t\tif ( 'ids' === $this->query_vars['fields'] ) {\n\t\t\t$this->sites = $site_ids;\n\n\t\t\treturn $this->sites;\n\t\t}\n\n\t\t// Prime site network caches.\n\t\tif ( $this->query_vars['update_site_cache'] ) {\n\t\t\t_prime_site_caches( $site_ids, $this->query_vars['update_site_meta_cache'] );\n\t\t}\n\n\t\t// Fetch full site objects from the primed cache.\n\t\t$_sites = array();\n\t\tforeach ( $site_ids as $site_id ) {\n\t\t\t$_site = get_site( $site_id );\n\t\t\tif ( $_site ) {\n\t\t\t\t$_sites[] = $_site;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the site query results.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param WP_Site[]     $_sites An array of WP_Site objects.\n\t\t * @param WP_Site_Query $this   Current instance of WP_Site_Query (passed by reference).\n\t\t */\n\t\t$_sites = apply_filters_ref_array( 'the_sites', array( $_sites, &$this ) );\n\n\t\t// Convert to WP_Site instances.\n\t\t$this->sites = array_map( 'get_site', $_sites );\n\n\t\treturn $this->sites;\n\t}\n\n\t/**\n\t * Used internally to get a list of site IDs matching the query vars.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @return int|array A single count of site IDs if a count query. An array of site IDs if a full query.\n\t */\n\tprotected function get_site_ids() {\n\t\tglobal $wpdb;\n\n\t\t$order = $this->parse_order( $this->query_vars['order'] );\n\n\t\t// Disable ORDER BY with 'none', an empty array, or boolean false.\n\t\tif ( in_array( $this->query_vars['orderby'], array( 'none', array(), false ), true ) ) {\n\t\t\t$orderby = '';\n\t\t} elseif ( ! empty( $this->query_vars['orderby'] ) ) {\n\t\t\t$ordersby = is_array( $this->query_vars['orderby'] ) ?\n\t\t\t\t$this->query_vars['orderby'] :\n\t\t\t\tpreg_split( '/[,\\s]/', $this->query_vars['orderby'] );\n\n\t\t\t$orderby_array = array();\n\t\t\tforeach ( $ordersby as $_key => $_value ) {\n\t\t\t\tif ( ! $_value ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( is_int( $_key ) ) {\n\t\t\t\t\t$_orderby = $_value;\n\t\t\t\t\t$_order   = $order;\n\t\t\t\t} else {\n\t\t\t\t\t$_orderby = $_key;\n\t\t\t\t\t$_order   = $_value;\n\t\t\t\t}\n\n\t\t\t\t$parsed = $this->parse_orderby( $_orderby );\n\n\t\t\t\tif ( ! $parsed ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( 'site__in' === $_orderby || 'network__in' === $_orderby ) {\n\t\t\t\t\t$orderby_array[] = $parsed;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$orderby_array[] = $parsed . ' ' . $this->parse_order( $_order );\n\t\t\t}\n\n\t\t\t$orderby = implode( ', ', $orderby_array );\n\t\t} else {\n\t\t\t$orderby = \"{$wpdb->blogs}.blog_id $order\";\n\t\t}\n\n\t\t$number = absint( $this->query_vars['number'] );\n\t\t$offset = absint( $this->query_vars['offset'] );\n\t\t$limits = '';\n\n\t\tif ( ! empty( $number ) ) {\n\t\t\tif ( $offset ) {\n\t\t\t\t$limits = 'LIMIT ' . $offset . ',' . $number;\n\t\t\t} else {\n\t\t\t\t$limits = 'LIMIT ' . $number;\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->query_vars['count'] ) {\n\t\t\t$fields = 'COUNT(*)';\n\t\t} else {\n\t\t\t$fields = \"{$wpdb->blogs}.blog_id\";\n\t\t}\n\n\t\t// Parse site IDs for an IN clause.\n\t\t$site_id = absint( $this->query_vars['ID'] );\n\t\tif ( ! empty( $site_id ) ) {\n\t\t\t$this->sql_clauses['where']['ID'] = $wpdb->prepare( \"{$wpdb->blogs}.blog_id = %d\", $site_id );\n\t\t}\n\n\t\t// Parse site IDs for an IN clause.\n\t\tif ( ! empty( $this->query_vars['site__in'] ) ) {\n\t\t\t$this->sql_clauses['where']['site__in'] = \"{$wpdb->blogs}.blog_id IN ( \" . implode( ',', wp_parse_id_list( $this->query_vars['site__in'] ) ) . ' )';\n\t\t}\n\n\t\t// Parse site IDs for a NOT IN clause.\n\t\tif ( ! empty( $this->query_vars['site__not_in'] ) ) {\n\t\t\t$this->sql_clauses['where']['site__not_in'] = \"{$wpdb->blogs}.blog_id NOT IN ( \" . implode( ',', wp_parse_id_list( $this->query_vars['site__not_in'] ) ) . ' )';\n\t\t}\n\n\t\t$network_id = absint( $this->query_vars['network_id'] );\n\n\t\tif ( ! empty( $network_id ) ) {\n\t\t\t$this->sql_clauses['where']['network_id'] = $wpdb->prepare( 'site_id = %d', $network_id );\n\t\t}\n\n\t\t// Parse site network IDs for an IN clause.\n\t\tif ( ! empty( $this->query_vars['network__in'] ) ) {\n\t\t\t$this->sql_clauses['where']['network__in'] = 'site_id IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['network__in'] ) ) . ' )';\n\t\t}\n\n\t\t// Parse site network IDs for a NOT IN clause.\n\t\tif ( ! empty( $this->query_vars['network__not_in'] ) ) {\n\t\t\t$this->sql_clauses['where']['network__not_in'] = 'site_id NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['network__not_in'] ) ) . ' )';\n\t\t}\n\n\t\tif ( ! empty( $this->query_vars['domain'] ) ) {\n\t\t\t$this->sql_clauses['where']['domain'] = $wpdb->prepare( 'domain = %s', $this->query_vars['domain'] );\n\t\t}\n\n\t\t// Parse site domain for an IN clause.\n\t\tif ( is_array( $this->query_vars['domain__in'] ) ) {\n\t\t\t$this->sql_clauses['where']['domain__in'] = \"domain IN ( '\" . implode( \"', '\", $wpdb->_escape( $this->query_vars['domain__in'] ) ) . \"' )\";\n\t\t}\n\n\t\t// Parse site domain for a NOT IN clause.\n\t\tif ( is_array( $this->query_vars['domain__not_in'] ) ) {\n\t\t\t$this->sql_clauses['where']['domain__not_in'] = \"domain NOT IN ( '\" . implode( \"', '\", $wpdb->_escape( $this->query_vars['domain__not_in'] ) ) . \"' )\";\n\t\t}\n\n\t\tif ( ! empty( $this->query_vars['path'] ) ) {\n\t\t\t$this->sql_clauses['where']['path'] = $wpdb->prepare( 'path = %s', $this->query_vars['path'] );\n\t\t}\n\n\t\t// Parse site path for an IN clause.\n\t\tif ( is_array( $this->query_vars['path__in'] ) ) {\n\t\t\t$this->sql_clauses['where']['path__in'] = \"path IN ( '\" . implode( \"', '\", $wpdb->_escape( $this->query_vars['path__in'] ) ) . \"' )\";\n\t\t}\n\n\t\t// Parse site path for a NOT IN clause.\n\t\tif ( is_array( $this->query_vars['path__not_in'] ) ) {\n\t\t\t$this->sql_clauses['where']['path__not_in'] = \"path NOT IN ( '\" . implode( \"', '\", $wpdb->_escape( $this->query_vars['path__not_in'] ) ) . \"' )\";\n\t\t}\n\n\t\tif ( is_numeric( $this->query_vars['archived'] ) ) {\n\t\t\t$archived                               = absint( $this->query_vars['archived'] );\n\t\t\t$this->sql_clauses['where']['archived'] = $wpdb->prepare( 'archived = %s ', absint( $archived ) );\n\t\t}\n\n\t\tif ( is_numeric( $this->query_vars['mature'] ) ) {\n\t\t\t$mature                               = absint( $this->query_vars['mature'] );\n\t\t\t$this->sql_clauses['where']['mature'] = $wpdb->prepare( 'mature = %d ', $mature );\n\t\t}\n\n\t\tif ( is_numeric( $this->query_vars['spam'] ) ) {\n\t\t\t$spam                               = absint( $this->query_vars['spam'] );\n\t\t\t$this->sql_clauses['where']['spam'] = $wpdb->prepare( 'spam = %d ', $spam );\n\t\t}\n\n\t\tif ( is_numeric( $this->query_vars['deleted'] ) ) {\n\t\t\t$deleted                               = absint( $this->query_vars['deleted'] );\n\t\t\t$this->sql_clauses['where']['deleted'] = $wpdb->prepare( 'deleted = %d ', $deleted );\n\t\t}\n\n\t\tif ( is_numeric( $this->query_vars['public'] ) ) {\n\t\t\t$public                               = absint( $this->query_vars['public'] );\n\t\t\t$this->sql_clauses['where']['public'] = $wpdb->prepare( 'public = %d ', $public );\n\t\t}\n\n\t\tif ( is_numeric( $this->query_vars['lang_id'] ) ) {\n\t\t\t$lang_id                               = absint( $this->query_vars['lang_id'] );\n\t\t\t$this->sql_clauses['where']['lang_id'] = $wpdb->prepare( 'lang_id = %d ', $lang_id );\n\t\t}\n\n\t\t// Parse site language IDs for an IN clause.\n\t\tif ( ! empty( $this->query_vars['lang__in'] ) ) {\n\t\t\t$this->sql_clauses['where']['lang__in'] = 'lang_id IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['lang__in'] ) ) . ' )';\n\t\t}\n\n\t\t// Parse site language IDs for a NOT IN clause.\n\t\tif ( ! empty( $this->query_vars['lang__not_in'] ) ) {\n\t\t\t$this->sql_clauses['where']['lang__not_in'] = 'lang_id NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['lang__not_in'] ) ) . ' )';\n\t\t}\n\n\t\t// Falsey search strings are ignored.\n\t\tif ( strlen( $this->query_vars['search'] ) ) {\n\t\t\t$search_columns = array();\n\n\t\t\tif ( $this->query_vars['search_columns'] ) {\n\t\t\t\t$search_columns = array_intersect( $this->query_vars['search_columns'], array( 'domain', 'path' ) );\n\t\t\t}\n\n\t\t\tif ( ! $search_columns ) {\n\t\t\t\t$search_columns = array( 'domain', 'path' );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the columns to search in a WP_Site_Query search.\n\t\t\t *\n\t\t\t * The default columns include 'domain' and 'path.\n\t\t\t *\n\t\t\t * @since 4.6.0\n\t\t\t *\n\t\t\t * @param string[]      $search_columns Array of column names to be searched.\n\t\t\t * @param string        $search         Text being searched.\n\t\t\t * @param WP_Site_Query $this           The current WP_Site_Query instance.\n\t\t\t */\n\t\t\t$search_columns = apply_filters( 'site_search_columns', $search_columns, $this->query_vars['search'], $this );\n\n\t\t\t$this->sql_clauses['where']['search'] = $this->get_search_sql( $this->query_vars['search'], $search_columns );\n\t\t}\n\n\t\t$date_query = $this->query_vars['date_query'];\n\t\tif ( ! empty( $date_query ) && is_array( $date_query ) ) {\n\t\t\t$this->date_query                         = new WP_Date_Query( $date_query, 'registered' );\n\t\t\t$this->sql_clauses['where']['date_query'] = preg_replace( '/^\\s*AND\\s*/', '', $this->date_query->get_sql() );\n\t\t}\n\n\t\t$join    = '';\n\t\t$groupby = '';\n\n\t\tif ( ! empty( $this->meta_query_clauses ) ) {\n\t\t\t$join .= $this->meta_query_clauses['join'];\n\n\t\t\t// Strip leading 'AND'.\n\t\t\t$this->sql_clauses['where']['meta_query'] = preg_replace( '/^\\s*AND\\s*/', '', $this->meta_query_clauses['where'] );\n\n\t\t\tif ( ! $this->query_vars['count'] ) {\n\t\t\t\t$groupby = \"{$wpdb->blogs}.blog_id\";\n\t\t\t}\n\t\t}\n\n\t\t$where = implode( ' AND ', $this->sql_clauses['where'] );\n\n\t\t$pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );\n\n\t\t/**\n\t\t * Filters the site query clauses.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param string[]      $pieces An associative array of site query clauses.\n\t\t * @param WP_Site_Query $this   Current instance of WP_Site_Query (passed by reference).\n\t\t */\n\t\t$clauses = apply_filters_ref_array( 'sites_clauses', array( compact( $pieces ), &$this ) );\n\n\t\t$fields  = isset( $clauses['fields'] ) ? $clauses['fields'] : '';\n\t\t$join    = isset( $clauses['join'] ) ? $clauses['join'] : '';\n\t\t$where   = isset( $clauses['where'] ) ? $clauses['where'] : '';\n\t\t$orderby = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';\n\t\t$limits  = isset( $clauses['limits'] ) ? $clauses['limits'] : '';\n\t\t$groupby = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';\n\n\t\tif ( $where ) {\n\t\t\t$where = 'WHERE ' . $where;\n\t\t}\n\n\t\tif ( $groupby ) {\n\t\t\t$groupby = 'GROUP BY ' . $groupby;\n\t\t}\n\n\t\tif ( $orderby ) {\n\t\t\t$orderby = \"ORDER BY $orderby\";\n\t\t}\n\n\t\t$found_rows = '';\n\t\tif ( ! $this->query_vars['no_found_rows'] ) {\n\t\t\t$found_rows = 'SQL_CALC_FOUND_ROWS';\n\t\t}\n\n\t\t$this->sql_clauses['select']  = \"SELECT $found_rows $fields\";\n\t\t$this->sql_clauses['from']    = \"FROM $wpdb->blogs $join\";\n\t\t$this->sql_clauses['groupby'] = $groupby;\n\t\t$this->sql_clauses['orderby'] = $orderby;\n\t\t$this->sql_clauses['limits']  = $limits;\n\n\t\t$this->request = \"{$this->sql_clauses['select']} {$this->sql_clauses['from']} {$where} {$this->sql_clauses['groupby']} {$this->sql_clauses['orderby']} {$this->sql_clauses['limits']}\";\n\n\t\tif ( $this->query_vars['count'] ) {\n\t\t\treturn intval( $wpdb->get_var( $this->request ) );\n\t\t}\n\n\t\t$site_ids = $wpdb->get_col( $this->request );\n\n\t\treturn array_map( 'intval', $site_ids );\n\t}\n\n\t/**\n\t * Populates found_sites and max_num_pages properties for the current query\n\t * if the limit clause was used.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t */\n\tprivate function set_found_sites() {\n\t\tglobal $wpdb;\n\n\t\tif ( $this->query_vars['number'] && ! $this->query_vars['no_found_rows'] ) {\n\t\t\t/**\n\t\t\t * Filters the query used to retrieve found site count.\n\t\t\t *\n\t\t\t * @since 4.6.0\n\t\t\t *\n\t\t\t * @param string        $found_sites_query SQL query. Default 'SELECT FOUND_ROWS()'.\n\t\t\t * @param WP_Site_Query $site_query        The `WP_Site_Query` instance.\n\t\t\t */\n\t\t\t$found_sites_query = apply_filters( 'found_sites_query', 'SELECT FOUND_ROWS()', $this );\n\n\t\t\t$this->found_sites = (int) $wpdb->get_var( $found_sites_query );\n\t\t}\n\t}\n\n\t/**\n\t * Used internally to generate an SQL string for searching across multiple columns.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string   $string  Search string.\n\t * @param string[] $columns Array of columns to search.\n\t * @return string Search SQL.\n\t */\n\tprotected function get_search_sql( $string, $columns ) {\n\t\tglobal $wpdb;\n\n\t\tif ( false !== strpos( $string, '*' ) ) {\n\t\t\t$like = '%' . implode( '%', array_map( array( $wpdb, 'esc_like' ), explode( '*', $string ) ) ) . '%';\n\t\t} else {\n\t\t\t$like = '%' . $wpdb->esc_like( $string ) . '%';\n\t\t}\n\n\t\t$searches = array();\n\t\tforeach ( $columns as $column ) {\n\t\t\t$searches[] = $wpdb->prepare( \"$column LIKE %s\", $like );\n\t\t}\n\n\t\treturn '(' . implode( ' OR ', $searches ) . ')';\n\t}\n\n\t/**\n\t * Parses and sanitizes 'orderby' keys passed to the site query.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $orderby Alias for the field to order by.\n\t * @return string|false Value to used in the ORDER clause. False otherwise.\n\t */\n\tprotected function parse_orderby( $orderby ) {\n\t\tglobal $wpdb;\n\n\t\t$parsed = false;\n\n\t\tswitch ( $orderby ) {\n\t\t\tcase 'site__in':\n\t\t\t\t$site__in = implode( ',', array_map( 'absint', $this->query_vars['site__in'] ) );\n\t\t\t\t$parsed   = \"FIELD( {$wpdb->blogs}.blog_id, $site__in )\";\n\t\t\t\tbreak;\n\t\t\tcase 'network__in':\n\t\t\t\t$network__in = implode( ',', array_map( 'absint', $this->query_vars['network__in'] ) );\n\t\t\t\t$parsed      = \"FIELD( {$wpdb->blogs}.site_id, $network__in )\";\n\t\t\t\tbreak;\n\t\t\tcase 'domain':\n\t\t\tcase 'last_updated':\n\t\t\tcase 'path':\n\t\t\tcase 'registered':\n\t\t\t\t$parsed = $orderby;\n\t\t\t\tbreak;\n\t\t\tcase 'network_id':\n\t\t\t\t$parsed = 'site_id';\n\t\t\t\tbreak;\n\t\t\tcase 'domain_length':\n\t\t\t\t$parsed = 'CHAR_LENGTH(domain)';\n\t\t\t\tbreak;\n\t\t\tcase 'path_length':\n\t\t\t\t$parsed = 'CHAR_LENGTH(path)';\n\t\t\t\tbreak;\n\t\t\tcase 'id':\n\t\t\t\t$parsed = \"{$wpdb->blogs}.blog_id\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( ! empty( $parsed ) || empty( $this->meta_query_clauses ) ) {\n\t\t\treturn $parsed;\n\t\t}\n\n\t\t$meta_clauses = $this->meta_query->get_clauses();\n\t\tif ( empty( $meta_clauses ) ) {\n\t\t\treturn $parsed;\n\t\t}\n\n\t\t$primary_meta_query = reset( $meta_clauses );\n\t\tif ( ! empty( $primary_meta_query['key'] ) && $primary_meta_query['key'] === $orderby ) {\n\t\t\t$orderby = 'meta_value';\n\t\t}\n\n\t\tswitch ( $orderby ) {\n\t\t\tcase 'meta_value':\n\t\t\t\tif ( ! empty( $primary_meta_query['type'] ) ) {\n\t\t\t\t\t$parsed = \"CAST({$primary_meta_query['alias']}.meta_value AS {$primary_meta_query['cast']})\";\n\t\t\t\t} else {\n\t\t\t\t\t$parsed = \"{$primary_meta_query['alias']}.meta_value\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'meta_value_num':\n\t\t\t\t$parsed = \"{$primary_meta_query['alias']}.meta_value+0\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif ( isset( $meta_clauses[ $orderby ] ) ) {\n\t\t\t\t\t$meta_clause = $meta_clauses[ $orderby ];\n\t\t\t\t\t$parsed      = \"CAST({$meta_clause['alias']}.meta_value AS {$meta_clause['cast']})\";\n\t\t\t\t}\n\t\t}\n\n\t\treturn $parsed;\n\t}\n\n\t/**\n\t * Parses an 'order' query variable and cast it to 'ASC' or 'DESC' as necessary.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string $order The 'order' query variable.\n\t * @return string The sanitized 'order' query variable.\n\t */\n\tprotected function parse_order( $order ) {\n\t\tif ( ! is_string( $order ) || empty( $order ) ) {\n\t\t\treturn 'ASC';\n\t\t}\n\n\t\tif ( 'ASC' === strtoupper( $order ) ) {\n\t\t\treturn 'ASC';\n\t\t} else {\n\t\t\treturn 'DESC';\n\t\t}\n\t}\n}\n", "num_lines": 821}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Site API: WP_Site class\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 4.5.0\n */\n\n/**\n * Core class used for interacting with a multisite site.\n *\n * This class is used during load to populate the `$current_blog` global and\n * setup the current site.\n *\n * @since 4.5.0\n *\n * @property int    $id\n * @property int    $network_id\n * @property string $blogname\n * @property string $siteurl\n * @property int    $post_count\n * @property string $home\n */\nfinal class WP_Site {\n\n\t/**\n\t * Site ID.\n\t *\n\t * A numeric string, for compatibility reasons.\n\t *\n\t * @since 4.5.0\n\t * @var string\n\t */\n\tpublic $blog_id;\n\n\t/**\n\t * Domain of the site.\n\t *\n\t * @since 4.5.0\n\t * @var string\n\t */\n\tpublic $domain = '';\n\n\t/**\n\t * Path of the site.\n\t *\n\t * @since 4.5.0\n\t * @var string\n\t */\n\tpublic $path = '';\n\n\t/**\n\t * The ID of the site's parent network.\n\t *\n\t * Named \"site\" vs. \"network\" for legacy reasons. An individual site's \"site\" is\n\t * its network.\n\t *\n\t * A numeric string, for compatibility reasons.\n\t *\n\t * @since 4.5.0\n\t * @var string\n\t */\n\tpublic $site_id = '0';\n\n\t/**\n\t * The date on which the site was created or registered.\n\t *\n\t * @since 4.5.0\n\t * @var string Date in MySQL's datetime format.\n\t */\n\tpublic $registered = '0000-00-00 00:00:00';\n\n\t/**\n\t * The date and time on which site settings were last updated.\n\t *\n\t * @since 4.5.0\n\t * @var string Date in MySQL's datetime format.\n\t */\n\tpublic $last_updated = '0000-00-00 00:00:00';\n\n\t/**\n\t * Whether the site should be treated as public.\n\t *\n\t * A numeric string, for compatibility reasons.\n\t *\n\t * @since 4.5.0\n\t * @var string\n\t */\n\tpublic $public = '1';\n\n\t/**\n\t * Whether the site should be treated as archived.\n\t *\n\t * A numeric string, for compatibility reasons.\n\t *\n\t * @since 4.5.0\n\t * @var string\n\t */\n\tpublic $archived = '0';\n\n\t/**\n\t * Whether the site should be treated as mature.\n\t *\n\t * Handling for this does not exist throughout WordPress core, but custom\n\t * implementations exist that require the property to be present.\n\t *\n\t * A numeric string, for compatibility reasons.\n\t *\n\t * @since 4.5.0\n\t * @var string\n\t */\n\tpublic $mature = '0';\n\n\t/**\n\t * Whether the site should be treated as spam.\n\t *\n\t * A numeric string, for compatibility reasons.\n\t *\n\t * @since 4.5.0\n\t * @var string\n\t */\n\tpublic $spam = '0';\n\n\t/**\n\t * Whether the site should be treated as deleted.\n\t *\n\t * A numeric string, for compatibility reasons.\n\t *\n\t * @since 4.5.0\n\t * @var string\n\t */\n\tpublic $deleted = '0';\n\n\t/**\n\t * The language pack associated with this site.\n\t *\n\t * A numeric string, for compatibility reasons.\n\t *\n\t * @since 4.5.0\n\t * @var string\n\t */\n\tpublic $lang_id = '0';\n\n\t/**\n\t * Retrieves a site from the database by its ID.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param int $site_id The ID of the site to retrieve.\n\t * @return WP_Site|false The site's object if found. False if not.\n\t */\n\tpublic static function get_instance( $site_id ) {\n\t\tglobal $wpdb;\n\n\t\t$site_id = (int) $site_id;\n\t\tif ( ! $site_id ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$_site = wp_cache_get( $site_id, 'sites' );\n\n\t\tif ( false === $_site ) {\n\t\t\t$_site = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->blogs} WHERE blog_id = %d LIMIT 1\", $site_id ) );\n\n\t\t\tif ( empty( $_site ) || is_wp_error( $_site ) ) {\n\t\t\t\t$_site = -1;\n\t\t\t}\n\n\t\t\twp_cache_add( $site_id, $_site, 'sites' );\n\t\t}\n\n\t\tif ( is_numeric( $_site ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn new WP_Site( $_site );\n\t}\n\n\t/**\n\t * Creates a new WP_Site object.\n\t *\n\t * Will populate object properties from the object provided and assign other\n\t * default properties based on that information.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param WP_Site|object $site A site object.\n\t */\n\tpublic function __construct( $site ) {\n\t\tforeach ( get_object_vars( $site ) as $key => $value ) {\n\t\t\t$this->$key = $value;\n\t\t}\n\t}\n\n\t/**\n\t * Converts an object to array.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @return array Object as array.\n\t */\n\tpublic function to_array() {\n\t\treturn get_object_vars( $this );\n\t}\n\n\t/**\n\t * Getter.\n\t *\n\t * Allows current multisite naming conventions when getting properties.\n\t * Allows access to extended site properties.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string $key Property to get.\n\t * @return mixed Value of the property. Null if not available.\n\t */\n\tpublic function __get( $key ) {\n\t\tswitch ( $key ) {\n\t\t\tcase 'id':\n\t\t\t\treturn (int) $this->blog_id;\n\t\t\tcase 'network_id':\n\t\t\t\treturn (int) $this->site_id;\n\t\t\tcase 'blogname':\n\t\t\tcase 'siteurl':\n\t\t\tcase 'post_count':\n\t\t\tcase 'home':\n\t\t\tdefault: // Custom properties added by 'site_details' filter.\n\t\t\t\tif ( ! did_action( 'ms_loaded' ) ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t$details = $this->get_details();\n\t\t\t\tif ( isset( $details->$key ) ) {\n\t\t\t\t\treturn $details->$key;\n\t\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Isset-er.\n\t *\n\t * Allows current multisite naming conventions when checking for properties.\n\t * Checks for extended site properties.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string $key Property to check if set.\n\t * @return bool Whether the property is set.\n\t */\n\tpublic function __isset( $key ) {\n\t\tswitch ( $key ) {\n\t\t\tcase 'id':\n\t\t\tcase 'network_id':\n\t\t\t\treturn true;\n\t\t\tcase 'blogname':\n\t\t\tcase 'siteurl':\n\t\t\tcase 'post_count':\n\t\t\tcase 'home':\n\t\t\t\tif ( ! did_action( 'ms_loaded' ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\tdefault: // Custom properties added by 'site_details' filter.\n\t\t\t\tif ( ! did_action( 'ms_loaded' ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t$details = $this->get_details();\n\t\t\t\tif ( isset( $details->$key ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Setter.\n\t *\n\t * Allows current multisite naming conventions while setting properties.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string $key   Property to set.\n\t * @param mixed  $value Value to assign to the property.\n\t */\n\tpublic function __set( $key, $value ) {\n\t\tswitch ( $key ) {\n\t\t\tcase 'id':\n\t\t\t\t$this->blog_id = (string) $value;\n\t\t\t\tbreak;\n\t\t\tcase 'network_id':\n\t\t\t\t$this->site_id = (string) $value;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->$key = $value;\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the details for this site.\n\t *\n\t * This method is used internally to lazy-load the extended properties of a site.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @see WP_Site::__get()\n\t *\n\t * @return stdClass A raw site object with all details included.\n\t */\n\tprivate function get_details() {\n\t\t$details = wp_cache_get( $this->blog_id, 'site-details' );\n\n\t\tif ( false === $details ) {\n\n\t\t\tswitch_to_blog( $this->blog_id );\n\t\t\t// Create a raw copy of the object for backward compatibility with the filter below.\n\t\t\t$details = new stdClass();\n\t\t\tforeach ( get_object_vars( $this ) as $key => $value ) {\n\t\t\t\t$details->$key = $value;\n\t\t\t}\n\t\t\t$details->blogname   = get_option( 'blogname' );\n\t\t\t$details->siteurl    = get_option( 'siteurl' );\n\t\t\t$details->post_count = get_option( 'post_count' );\n\t\t\t$details->home       = get_option( 'home' );\n\t\t\trestore_current_blog();\n\n\t\t\twp_cache_set( $this->blog_id, $details, 'site-details' );\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/ms-blogs.php */\n\t\t$details = apply_filters_deprecated( 'blog_details', array( $details ), '4.7.0', 'site_details' );\n\n\t\t/**\n\t\t * Filters a site's extended properties.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param stdClass $details The site details.\n\t\t */\n\t\t$details = apply_filters( 'site_details', $details );\n\n\t\treturn $details;\n\t}\n}\n", "num_lines": 351}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Taxonomy API: WP_Tax_Query class\n *\n * @package WordPress\n * @subpackage Taxonomy\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement taxonomy queries for the Taxonomy API.\n *\n * Used for generating SQL clauses that filter a primary query according to object\n * taxonomy terms.\n *\n * WP_Tax_Query is a helper that allows primary query classes, such as WP_Query, to filter\n * their results by object metadata, by generating `JOIN` and `WHERE` subclauses to be\n * attached to the primary SQL query string.\n *\n * @since 3.1.0\n */\nclass WP_Tax_Query {\n\n\t/**\n\t * Array of taxonomy queries.\n\t *\n\t * See WP_Tax_Query::__construct() for information on tax query arguments.\n\t *\n\t * @since 3.1.0\n\t * @var array\n\t */\n\tpublic $queries = array();\n\n\t/**\n\t * The relation between the queries. Can be one of 'AND' or 'OR'.\n\t *\n\t * @since 3.1.0\n\t * @var string\n\t */\n\tpublic $relation;\n\n\t/**\n\t * Standard response when the query should not return any rows.\n\t *\n\t * @since 3.2.0\n\t * @var string\n\t */\n\tprivate static $no_results = array(\n\t\t'join'  => array( '' ),\n\t\t'where' => array( '0 = 1' ),\n\t);\n\n\t/**\n\t * A flat list of table aliases used in the JOIN clauses.\n\t *\n\t * @since 4.1.0\n\t * @var array\n\t */\n\tprotected $table_aliases = array();\n\n\t/**\n\t * Terms and taxonomies fetched by this query.\n\t *\n\t * We store this data in a flat array because they are referenced in a\n\t * number of places by WP_Query.\n\t *\n\t * @since 4.1.0\n\t * @var array\n\t */\n\tpublic $queried_terms = array();\n\n\t/**\n\t * Database table that where the metadata's objects are stored (eg $wpdb->users).\n\t *\n\t * @since 4.1.0\n\t * @var string\n\t */\n\tpublic $primary_table;\n\n\t/**\n\t * Column in 'primary_table' that represents the ID of the object.\n\t *\n\t * @since 4.1.0\n\t * @var string\n\t */\n\tpublic $primary_id_column;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.1.0\n\t * @since 4.1.0 Added support for `$operator` 'NOT EXISTS' and 'EXISTS' values.\n\t *\n\t * @param array $tax_query {\n\t *     Array of taxonomy query clauses.\n\t *\n\t *     @type string $relation Optional. The MySQL keyword used to join\n\t *                            the clauses of the query. Accepts 'AND', or 'OR'. Default 'AND'.\n\t *     @type array  ...$0 {\n\t *         An array of first-order clause parameters, or another fully-formed tax query.\n\t *\n\t *         @type string           $taxonomy         Taxonomy being queried. Optional when field=term_taxonomy_id.\n\t *         @type string|int|array $terms            Term or terms to filter by.\n\t *         @type string           $field            Field to match $terms against. Accepts 'term_id', 'slug',\n\t *                                                 'name', or 'term_taxonomy_id'. Default: 'term_id'.\n\t *         @type string           $operator         MySQL operator to be used with $terms in the WHERE clause.\n\t *                                                  Accepts 'AND', 'IN', 'NOT IN', 'EXISTS', 'NOT EXISTS'.\n\t *                                                  Default: 'IN'.\n\t *         @type bool             $include_children Optional. Whether to include child terms.\n\t *                                                  Requires a $taxonomy. Default: true.\n\t *     }\n\t * }\n\t */\n\tpublic function __construct( $tax_query ) {\n\t\tif ( isset( $tax_query['relation'] ) ) {\n\t\t\t$this->relation = $this->sanitize_relation( $tax_query['relation'] );\n\t\t} else {\n\t\t\t$this->relation = 'AND';\n\t\t}\n\n\t\t$this->queries = $this->sanitize_query( $tax_query );\n\t}\n\n\t/**\n\t * Ensure the 'tax_query' argument passed to the class constructor is well-formed.\n\t *\n\t * Ensures that each query-level clause has a 'relation' key, and that\n\t * each first-order clause contains all the necessary keys from `$defaults`.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param array $queries Array of queries clauses.\n\t * @return array Sanitized array of query clauses.\n\t */\n\tpublic function sanitize_query( $queries ) {\n\t\t$cleaned_query = array();\n\n\t\t$defaults = array(\n\t\t\t'taxonomy'         => '',\n\t\t\t'terms'            => array(),\n\t\t\t'field'            => 'term_id',\n\t\t\t'operator'         => 'IN',\n\t\t\t'include_children' => true,\n\t\t);\n\n\t\tforeach ( $queries as $key => $query ) {\n\t\t\tif ( 'relation' === $key ) {\n\t\t\t\t$cleaned_query['relation'] = $this->sanitize_relation( $query );\n\n\t\t\t\t// First-order clause.\n\t\t\t} elseif ( self::is_first_order_clause( $query ) ) {\n\n\t\t\t\t$cleaned_clause          = array_merge( $defaults, $query );\n\t\t\t\t$cleaned_clause['terms'] = (array) $cleaned_clause['terms'];\n\t\t\t\t$cleaned_query[]         = $cleaned_clause;\n\n\t\t\t\t/*\n\t\t\t\t * Keep a copy of the clause in the flate\n\t\t\t\t * $queried_terms array, for use in WP_Query.\n\t\t\t\t */\n\t\t\t\tif ( ! empty( $cleaned_clause['taxonomy'] ) && 'NOT IN' !== $cleaned_clause['operator'] ) {\n\t\t\t\t\t$taxonomy = $cleaned_clause['taxonomy'];\n\t\t\t\t\tif ( ! isset( $this->queried_terms[ $taxonomy ] ) ) {\n\t\t\t\t\t\t$this->queried_terms[ $taxonomy ] = array();\n\t\t\t\t\t}\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Backward compatibility: Only store the first\n\t\t\t\t\t * 'terms' and 'field' found for a given taxonomy.\n\t\t\t\t\t */\n\t\t\t\t\tif ( ! empty( $cleaned_clause['terms'] ) && ! isset( $this->queried_terms[ $taxonomy ]['terms'] ) ) {\n\t\t\t\t\t\t$this->queried_terms[ $taxonomy ]['terms'] = $cleaned_clause['terms'];\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $cleaned_clause['field'] ) && ! isset( $this->queried_terms[ $taxonomy ]['field'] ) ) {\n\t\t\t\t\t\t$this->queried_terms[ $taxonomy ]['field'] = $cleaned_clause['field'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Otherwise, it's a nested query, so we recurse.\n\t\t\t} elseif ( is_array( $query ) ) {\n\t\t\t\t$cleaned_subquery = $this->sanitize_query( $query );\n\n\t\t\t\tif ( ! empty( $cleaned_subquery ) ) {\n\t\t\t\t\t// All queries with children must have a relation.\n\t\t\t\t\tif ( ! isset( $cleaned_subquery['relation'] ) ) {\n\t\t\t\t\t\t$cleaned_subquery['relation'] = 'AND';\n\t\t\t\t\t}\n\n\t\t\t\t\t$cleaned_query[] = $cleaned_subquery;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $cleaned_query;\n\t}\n\n\t/**\n\t * Sanitize a 'relation' operator.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param string $relation Raw relation key from the query argument.\n\t * @return string Sanitized relation ('AND' or 'OR').\n\t */\n\tpublic function sanitize_relation( $relation ) {\n\t\tif ( 'OR' === strtoupper( $relation ) ) {\n\t\t\treturn 'OR';\n\t\t} else {\n\t\t\treturn 'AND';\n\t\t}\n\t}\n\n\t/**\n\t * Determine whether a clause is first-order.\n\t *\n\t * A \"first-order\" clause is one that contains any of the first-order\n\t * clause keys ('terms', 'taxonomy', 'include_children', 'field',\n\t * 'operator'). An empty clause also counts as a first-order clause,\n\t * for backward compatibility. Any clause that doesn't meet this is\n\t * determined, by process of elimination, to be a higher-order query.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param array $query Tax query arguments.\n\t * @return bool Whether the query clause is a first-order clause.\n\t */\n\tprotected static function is_first_order_clause( $query ) {\n\t\treturn is_array( $query ) && ( empty( $query ) || array_key_exists( 'terms', $query ) || array_key_exists( 'taxonomy', $query ) || array_key_exists( 'include_children', $query ) || array_key_exists( 'field', $query ) || array_key_exists( 'operator', $query ) );\n\t}\n\n\t/**\n\t * Generates SQL clauses to be appended to a main query.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $primary_table     Database table where the object being filtered is stored (eg wp_users).\n\t * @param string $primary_id_column ID column for the filtered object in $primary_table.\n\t * @return array {\n\t *     Array containing JOIN and WHERE SQL clauses to append to the main query.\n\t *\n\t *     @type string $join  SQL fragment to append to the main JOIN clause.\n\t *     @type string $where SQL fragment to append to the main WHERE clause.\n\t * }\n\t */\n\tpublic function get_sql( $primary_table, $primary_id_column ) {\n\t\t$this->primary_table     = $primary_table;\n\t\t$this->primary_id_column = $primary_id_column;\n\n\t\treturn $this->get_sql_clauses();\n\t}\n\n\t/**\n\t * Generate SQL clauses to be appended to a main query.\n\t *\n\t * Called by the public WP_Tax_Query::get_sql(), this method\n\t * is abstracted out to maintain parity with the other Query classes.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @return array {\n\t *     Array containing JOIN and WHERE SQL clauses to append to the main query.\n\t *\n\t *     @type string $join  SQL fragment to append to the main JOIN clause.\n\t *     @type string $where SQL fragment to append to the main WHERE clause.\n\t * }\n\t */\n\tprotected function get_sql_clauses() {\n\t\t/*\n\t\t * $queries are passed by reference to get_sql_for_query() for recursion.\n\t\t * To keep $this->queries unaltered, pass a copy.\n\t\t */\n\t\t$queries = $this->queries;\n\t\t$sql     = $this->get_sql_for_query( $queries );\n\n\t\tif ( ! empty( $sql['where'] ) ) {\n\t\t\t$sql['where'] = ' AND ' . $sql['where'];\n\t\t}\n\n\t\treturn $sql;\n\t}\n\n\t/**\n\t * Generate SQL clauses for a single query array.\n\t *\n\t * If nested subqueries are found, this method recurses the tree to\n\t * produce the properly nested SQL.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param array $query Query to parse (passed by reference).\n\t * @param int   $depth Optional. Number of tree levels deep we currently are.\n\t *                     Used to calculate indentation. Default 0.\n\t * @return array {\n\t *     Array containing JOIN and WHERE SQL clauses to append to a single query array.\n\t *\n\t *     @type string $join  SQL fragment to append to the main JOIN clause.\n\t *     @type string $where SQL fragment to append to the main WHERE clause.\n\t * }\n\t */\n\tprotected function get_sql_for_query( &$query, $depth = 0 ) {\n\t\t$sql_chunks = array(\n\t\t\t'join'  => array(),\n\t\t\t'where' => array(),\n\t\t);\n\n\t\t$sql = array(\n\t\t\t'join'  => '',\n\t\t\t'where' => '',\n\t\t);\n\n\t\t$indent = '';\n\t\tfor ( $i = 0; $i < $depth; $i++ ) {\n\t\t\t$indent .= '  ';\n\t\t}\n\n\t\tforeach ( $query as $key => &$clause ) {\n\t\t\tif ( 'relation' === $key ) {\n\t\t\t\t$relation = $query['relation'];\n\t\t\t} elseif ( is_array( $clause ) ) {\n\n\t\t\t\t// This is a first-order clause.\n\t\t\t\tif ( $this->is_first_order_clause( $clause ) ) {\n\t\t\t\t\t$clause_sql = $this->get_sql_for_clause( $clause, $query );\n\n\t\t\t\t\t$where_count = count( $clause_sql['where'] );\n\t\t\t\t\tif ( ! $where_count ) {\n\t\t\t\t\t\t$sql_chunks['where'][] = '';\n\t\t\t\t\t} elseif ( 1 === $where_count ) {\n\t\t\t\t\t\t$sql_chunks['where'][] = $clause_sql['where'][0];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )';\n\t\t\t\t\t}\n\n\t\t\t\t\t$sql_chunks['join'] = array_merge( $sql_chunks['join'], $clause_sql['join'] );\n\t\t\t\t\t// This is a subquery, so we recurse.\n\t\t\t\t} else {\n\t\t\t\t\t$clause_sql = $this->get_sql_for_query( $clause, $depth + 1 );\n\n\t\t\t\t\t$sql_chunks['where'][] = $clause_sql['where'];\n\t\t\t\t\t$sql_chunks['join'][]  = $clause_sql['join'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Filter to remove empties.\n\t\t$sql_chunks['join']  = array_filter( $sql_chunks['join'] );\n\t\t$sql_chunks['where'] = array_filter( $sql_chunks['where'] );\n\n\t\tif ( empty( $relation ) ) {\n\t\t\t$relation = 'AND';\n\t\t}\n\n\t\t// Filter duplicate JOIN clauses and combine into a single string.\n\t\tif ( ! empty( $sql_chunks['join'] ) ) {\n\t\t\t$sql['join'] = implode( ' ', array_unique( $sql_chunks['join'] ) );\n\t\t}\n\n\t\t// Generate a single WHERE clause with proper brackets and indentation.\n\t\tif ( ! empty( $sql_chunks['where'] ) ) {\n\t\t\t$sql['where'] = '( ' . \"\\n  \" . $indent . implode( ' ' . \"\\n  \" . $indent . $relation . ' ' . \"\\n  \" . $indent, $sql_chunks['where'] ) . \"\\n\" . $indent . ')';\n\t\t}\n\n\t\treturn $sql;\n\t}\n\n\t/**\n\t * Generate SQL JOIN and WHERE clauses for a \"first-order\" query clause.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @global wpdb $wpdb The WordPress database abstraction object.\n\t *\n\t * @param array $clause       Query clause (passed by reference).\n\t * @param array $parent_query Parent query array.\n\t * @return array {\n\t *     Array containing JOIN and WHERE SQL clauses to append to a first-order query.\n\t *\n\t *     @type string $join  SQL fragment to append to the main JOIN clause.\n\t *     @type string $where SQL fragment to append to the main WHERE clause.\n\t * }\n\t */\n\tpublic function get_sql_for_clause( &$clause, $parent_query ) {\n\t\tglobal $wpdb;\n\n\t\t$sql = array(\n\t\t\t'where' => array(),\n\t\t\t'join'  => array(),\n\t\t);\n\n\t\t$join  = '';\n\t\t$where = '';\n\n\t\t$this->clean_query( $clause );\n\n\t\tif ( is_wp_error( $clause ) ) {\n\t\t\treturn self::$no_results;\n\t\t}\n\n\t\t$terms    = $clause['terms'];\n\t\t$operator = strtoupper( $clause['operator'] );\n\n\t\tif ( 'IN' === $operator ) {\n\n\t\t\tif ( empty( $terms ) ) {\n\t\t\t\treturn self::$no_results;\n\t\t\t}\n\n\t\t\t$terms = implode( ',', $terms );\n\n\t\t\t/*\n\t\t\t * Before creating another table join, see if this clause has a\n\t\t\t * sibling with an existing join that can be shared.\n\t\t\t */\n\t\t\t$alias = $this->find_compatible_table_alias( $clause, $parent_query );\n\t\t\tif ( false === $alias ) {\n\t\t\t\t$i     = count( $this->table_aliases );\n\t\t\t\t$alias = $i ? 'tt' . $i : $wpdb->term_relationships;\n\n\t\t\t\t// Store the alias as part of a flat array to build future iterators.\n\t\t\t\t$this->table_aliases[] = $alias;\n\n\t\t\t\t// Store the alias with this clause, so later siblings can use it.\n\t\t\t\t$clause['alias'] = $alias;\n\n\t\t\t\t$join .= \" LEFT JOIN $wpdb->term_relationships\";\n\t\t\t\t$join .= $i ? \" AS $alias\" : '';\n\t\t\t\t$join .= \" ON ($this->primary_table.$this->primary_id_column = $alias.object_id)\";\n\t\t\t}\n\n\t\t\t$where = \"$alias.term_taxonomy_id $operator ($terms)\";\n\n\t\t} elseif ( 'NOT IN' === $operator ) {\n\n\t\t\tif ( empty( $terms ) ) {\n\t\t\t\treturn $sql;\n\t\t\t}\n\n\t\t\t$terms = implode( ',', $terms );\n\n\t\t\t$where = \"$this->primary_table.$this->primary_id_column NOT IN (\n\t\t\t\tSELECT object_id\n\t\t\t\tFROM $wpdb->term_relationships\n\t\t\t\tWHERE term_taxonomy_id IN ($terms)\n\t\t\t)\";\n\n\t\t} elseif ( 'AND' === $operator ) {\n\n\t\t\tif ( empty( $terms ) ) {\n\t\t\t\treturn $sql;\n\t\t\t}\n\n\t\t\t$num_terms = count( $terms );\n\n\t\t\t$terms = implode( ',', $terms );\n\n\t\t\t$where = \"(\n\t\t\t\tSELECT COUNT(1)\n\t\t\t\tFROM $wpdb->term_relationships\n\t\t\t\tWHERE term_taxonomy_id IN ($terms)\n\t\t\t\tAND object_id = $this->primary_table.$this->primary_id_column\n\t\t\t) = $num_terms\";\n\n\t\t} elseif ( 'NOT EXISTS' === $operator || 'EXISTS' === $operator ) {\n\n\t\t\t$where = $wpdb->prepare(\n\t\t\t\t\"$operator (\n\t\t\t\tSELECT 1\n\t\t\t\tFROM $wpdb->term_relationships\n\t\t\t\tINNER JOIN $wpdb->term_taxonomy\n\t\t\t\tON $wpdb->term_taxonomy.term_taxonomy_id = $wpdb->term_relationships.term_taxonomy_id\n\t\t\t\tWHERE $wpdb->term_taxonomy.taxonomy = %s\n\t\t\t\tAND $wpdb->term_relationships.object_id = $this->primary_table.$this->primary_id_column\n\t\t\t)\",\n\t\t\t\t$clause['taxonomy']\n\t\t\t);\n\n\t\t}\n\n\t\t$sql['join'][]  = $join;\n\t\t$sql['where'][] = $where;\n\t\treturn $sql;\n\t}\n\n\t/**\n\t * Identify an existing table alias that is compatible with the current query clause.\n\t *\n\t * We avoid unnecessary table joins by allowing each clause to look for\n\t * an existing table alias that is compatible with the query that it\n\t * needs to perform.\n\t *\n\t * An existing alias is compatible if (a) it is a sibling of `$clause`\n\t * (ie, it's under the scope of the same relation), and (b) the combination\n\t * of operator and relation between the clauses allows for a shared table\n\t * join. In the case of WP_Tax_Query, this only applies to 'IN'\n\t * clauses that are connected by the relation 'OR'.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param array $clause       Query clause.\n\t * @param array $parent_query Parent query of $clause.\n\t * @return string|false Table alias if found, otherwise false.\n\t */\n\tprotected function find_compatible_table_alias( $clause, $parent_query ) {\n\t\t$alias = false;\n\n\t\t// Sanity check. Only IN queries use the JOIN syntax.\n\t\tif ( ! isset( $clause['operator'] ) || 'IN' !== $clause['operator'] ) {\n\t\t\treturn $alias;\n\t\t}\n\n\t\t// Since we're only checking IN queries, we're only concerned with OR relations.\n\t\tif ( ! isset( $parent_query['relation'] ) || 'OR' !== $parent_query['relation'] ) {\n\t\t\treturn $alias;\n\t\t}\n\n\t\t$compatible_operators = array( 'IN' );\n\n\t\tforeach ( $parent_query as $sibling ) {\n\t\t\tif ( ! is_array( $sibling ) || ! $this->is_first_order_clause( $sibling ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( empty( $sibling['alias'] ) || empty( $sibling['operator'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// The sibling must both have compatible operator to share its alias.\n\t\t\tif ( in_array( strtoupper( $sibling['operator'] ), $compatible_operators, true ) ) {\n\t\t\t\t$alias = $sibling['alias'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $alias;\n\t}\n\n\t/**\n\t * Validates a single query.\n\t *\n\t * @since 3.2.0\n\t *\n\t * @param array $query The single query. Passed by reference.\n\t */\n\tprivate function clean_query( &$query ) {\n\t\tif ( empty( $query['taxonomy'] ) ) {\n\t\t\tif ( 'term_taxonomy_id' !== $query['field'] ) {\n\t\t\t\t$query = new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// So long as there are shared terms, 'include_children' requires that a taxonomy is set.\n\t\t\t$query['include_children'] = false;\n\t\t} elseif ( ! taxonomy_exists( $query['taxonomy'] ) ) {\n\t\t\t$query = new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );\n\t\t\treturn;\n\t\t}\n\n\t\t$query['terms'] = array_unique( (array) $query['terms'] );\n\n\t\tif ( is_taxonomy_hierarchical( $query['taxonomy'] ) && $query['include_children'] ) {\n\t\t\t$this->transform_query( $query, 'term_id' );\n\n\t\t\tif ( is_wp_error( $query ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$children = array();\n\t\t\tforeach ( $query['terms'] as $term ) {\n\t\t\t\t$children   = array_merge( $children, get_term_children( $term, $query['taxonomy'] ) );\n\t\t\t\t$children[] = $term;\n\t\t\t}\n\t\t\t$query['terms'] = $children;\n\t\t}\n\n\t\t$this->transform_query( $query, 'term_taxonomy_id' );\n\t}\n\n\t/**\n\t * Transforms a single query, from one field to another.\n\t *\n\t * Operates on the `$query` object by reference. In the case of error,\n\t * `$query` is converted to a WP_Error object.\n\t *\n\t * @since 3.2.0\n\t *\n\t * @global wpdb $wpdb The WordPress database abstraction object.\n\t *\n\t * @param array  $query           The single query. Passed by reference.\n\t * @param string $resulting_field The resulting field. Accepts 'slug', 'name', 'term_taxonomy_id',\n\t *                                or 'term_id'. Default 'term_id'.\n\t */\n\tpublic function transform_query( &$query, $resulting_field ) {\n\t\tif ( empty( $query['terms'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $query['field'] == $resulting_field ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$resulting_field = sanitize_key( $resulting_field );\n\n\t\t// Empty 'terms' always results in a null transformation.\n\t\t$terms = array_filter( $query['terms'] );\n\t\tif ( empty( $terms ) ) {\n\t\t\t$query['terms'] = array();\n\t\t\t$query['field'] = $resulting_field;\n\t\t\treturn;\n\t\t}\n\n\t\t$args = array(\n\t\t\t'get'                    => 'all',\n\t\t\t'number'                 => 0,\n\t\t\t'taxonomy'               => $query['taxonomy'],\n\t\t\t'update_term_meta_cache' => false,\n\t\t\t'orderby'                => 'none',\n\t\t);\n\n\t\t// Term query parameter name depends on the 'field' being searched on.\n\t\tswitch ( $query['field'] ) {\n\t\t\tcase 'slug':\n\t\t\t\t$args['slug'] = $terms;\n\t\t\t\tbreak;\n\t\t\tcase 'name':\n\t\t\t\t$args['name'] = $terms;\n\t\t\t\tbreak;\n\t\t\tcase 'term_taxonomy_id':\n\t\t\t\t$args['term_taxonomy_id'] = $terms;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$args['include'] = wp_parse_id_list( $terms );\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$term_query = new WP_Term_Query();\n\t\t$term_list  = $term_query->query( $args );\n\n\t\tif ( is_wp_error( $term_list ) ) {\n\t\t\t$query = $term_list;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'AND' === $query['operator'] && count( $term_list ) < count( $query['terms'] ) ) {\n\t\t\t$query = new WP_Error( 'inexistent_terms', __( 'Inexistent terms.' ) );\n\t\t\treturn;\n\t\t}\n\n\t\t$query['terms'] = wp_list_pluck( $term_list, $resulting_field );\n\t\t$query['field'] = $resulting_field;\n\t}\n}\n", "num_lines": 653}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Taxonomy API: WP_Taxonomy class\n *\n * @package WordPress\n * @subpackage Taxonomy\n * @since 4.7.0\n */\n\n/**\n * Core class used for interacting with taxonomies.\n *\n * @since 4.7.0\n */\nfinal class WP_Taxonomy {\n\t/**\n\t * Taxonomy key.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tpublic $name;\n\n\t/**\n\t * Name of the taxonomy shown in the menu. Usually plural.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tpublic $label;\n\n\t/**\n\t * Labels object for this taxonomy.\n\t *\n\t * If not set, tag labels are inherited for non-hierarchical types\n\t * and category labels for hierarchical ones.\n\t *\n\t * @see get_taxonomy_labels()\n\t *\n\t * @since 4.7.0\n\t * @var object\n\t */\n\tpublic $labels;\n\n\t/**\n\t * A short descriptive summary of what the taxonomy is for.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tpublic $description = '';\n\n\t/**\n\t * Whether a taxonomy is intended for use publicly either via the admin interface or by front-end users.\n\t *\n\t * @since 4.7.0\n\t * @var bool\n\t */\n\tpublic $public = true;\n\n\t/**\n\t * Whether the taxonomy is publicly queryable.\n\t *\n\t * @since 4.7.0\n\t * @var bool\n\t */\n\tpublic $publicly_queryable = true;\n\n\t/**\n\t * Whether the taxonomy is hierarchical.\n\t *\n\t * @since 4.7.0\n\t * @var bool\n\t */\n\tpublic $hierarchical = false;\n\n\t/**\n\t * Whether to generate and allow a UI for managing terms in this taxonomy in the admin.\n\t *\n\t * @since 4.7.0\n\t * @var bool\n\t */\n\tpublic $show_ui = true;\n\n\t/**\n\t * Whether to show the taxonomy in the admin menu.\n\t *\n\t * If true, the taxonomy is shown as a submenu of the object type menu. If false, no menu is shown.\n\t *\n\t * @since 4.7.0\n\t * @var bool\n\t */\n\tpublic $show_in_menu = true;\n\n\t/**\n\t * Whether the taxonomy is available for selection in navigation menus.\n\t *\n\t * @since 4.7.0\n\t * @var bool\n\t */\n\tpublic $show_in_nav_menus = true;\n\n\t/**\n\t * Whether to list the taxonomy in the tag cloud widget controls.\n\t *\n\t * @since 4.7.0\n\t * @var bool\n\t */\n\tpublic $show_tagcloud = true;\n\n\t/**\n\t * Whether to show the taxonomy in the quick/bulk edit panel.\n\t *\n\t * @since 4.7.0\n\t * @var bool\n\t */\n\tpublic $show_in_quick_edit = true;\n\n\t/**\n\t * Whether to display a column for the taxonomy on its post type listing screens.\n\t *\n\t * @since 4.7.0\n\t * @var bool\n\t */\n\tpublic $show_admin_column = false;\n\n\t/**\n\t * The callback function for the meta box display.\n\t *\n\t * @since 4.7.0\n\t * @var bool|callable\n\t */\n\tpublic $meta_box_cb = null;\n\n\t/**\n\t * The callback function for sanitizing taxonomy data saved from a meta box.\n\t *\n\t * @since 5.1.0\n\t * @var callable\n\t */\n\tpublic $meta_box_sanitize_cb = null;\n\n\t/**\n\t * An array of object types this taxonomy is registered for.\n\t *\n\t * @since 4.7.0\n\t * @var array\n\t */\n\tpublic $object_type = null;\n\n\t/**\n\t * Capabilities for this taxonomy.\n\t *\n\t * @since 4.7.0\n\t * @var object\n\t */\n\tpublic $cap;\n\n\t/**\n\t * Rewrites information for this taxonomy.\n\t *\n\t * @since 4.7.0\n\t * @var array|false\n\t */\n\tpublic $rewrite;\n\n\t/**\n\t * Query var string for this taxonomy.\n\t *\n\t * @since 4.7.0\n\t * @var string|false\n\t */\n\tpublic $query_var;\n\n\t/**\n\t * Function that will be called when the count is updated.\n\t *\n\t * @since 4.7.0\n\t * @var callable\n\t */\n\tpublic $update_count_callback;\n\n\t/**\n\t * Whether this taxonomy should appear in the REST API.\n\t *\n\t * Default false. If true, standard endpoints will be registered with\n\t * respect to $rest_base and $rest_controller_class.\n\t *\n\t * @since 4.7.4\n\t * @var bool $show_in_rest\n\t */\n\tpublic $show_in_rest;\n\n\t/**\n\t * The base path for this taxonomy's REST API endpoints.\n\t *\n\t * @since 4.7.4\n\t * @var string|bool $rest_base\n\t */\n\tpublic $rest_base;\n\n\t/**\n\t * The controller for this taxonomy's REST API endpoints.\n\t *\n\t * Custom controllers must extend WP_REST_Controller.\n\t *\n\t * @since 4.7.4\n\t * @var string|bool $rest_controller_class\n\t */\n\tpublic $rest_controller_class;\n\n\t/**\n\t * The default term name for this taxonomy. If you pass an array you have\n\t * to set 'name' and optionally 'slug' and 'description'.\n\t *\n\t * @since 5.5.0\n\t * @var array|string\n\t */\n\tpublic $default_term;\n\n\t/**\n\t * The controller instance for this taxonomy's REST API endpoints.\n\t *\n\t * Lazily computed. Should be accessed using {@see WP_Taxonomy::get_rest_controller()}.\n\t *\n\t * @since 5.5.0\n\t * @var WP_REST_Controller $rest_controller\n\t */\n\tpublic $rest_controller;\n\n\t/**\n\t * Whether it is a built-in taxonomy.\n\t *\n\t * @since 4.7.0\n\t * @var bool\n\t */\n\tpublic $_builtin;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @global WP $wp Current WordPress environment instance.\n\t *\n\t * @param string       $taxonomy    Taxonomy key, must not exceed 32 characters.\n\t * @param array|string $object_type Name of the object type for the taxonomy object.\n\t * @param array|string $args        Optional. Array or query string of arguments for registering a taxonomy.\n\t *                                  Default empty array.\n\t */\n\tpublic function __construct( $taxonomy, $object_type, $args = array() ) {\n\t\t$this->name = $taxonomy;\n\n\t\t$this->set_props( $object_type, $args );\n\t}\n\n\t/**\n\t * Sets taxonomy properties.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array|string $object_type Name of the object type for the taxonomy object.\n\t * @param array|string $args        Array or query string of arguments for registering a taxonomy.\n\t */\n\tpublic function set_props( $object_type, $args ) {\n\t\t$args = wp_parse_args( $args );\n\n\t\t/**\n\t\t * Filters the arguments for registering a taxonomy.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param array    $args        Array of arguments for registering a taxonomy.\n\t\t * @param string   $taxonomy    Taxonomy key.\n\t\t * @param string[] $object_type Array of names of object types for the taxonomy.\n\t\t */\n\t\t$args = apply_filters( 'register_taxonomy_args', $args, $this->name, (array) $object_type );\n\n\t\t$defaults = array(\n\t\t\t'labels'                => array(),\n\t\t\t'description'           => '',\n\t\t\t'public'                => true,\n\t\t\t'publicly_queryable'    => null,\n\t\t\t'hierarchical'          => false,\n\t\t\t'show_ui'               => null,\n\t\t\t'show_in_menu'          => null,\n\t\t\t'show_in_nav_menus'     => null,\n\t\t\t'show_tagcloud'         => null,\n\t\t\t'show_in_quick_edit'    => null,\n\t\t\t'show_admin_column'     => false,\n\t\t\t'meta_box_cb'           => null,\n\t\t\t'meta_box_sanitize_cb'  => null,\n\t\t\t'capabilities'          => array(),\n\t\t\t'rewrite'               => true,\n\t\t\t'query_var'             => $this->name,\n\t\t\t'update_count_callback' => '',\n\t\t\t'show_in_rest'          => false,\n\t\t\t'rest_base'             => false,\n\t\t\t'rest_controller_class' => false,\n\t\t\t'default_term'          => null,\n\t\t\t'_builtin'              => false,\n\t\t);\n\n\t\t$args = array_merge( $defaults, $args );\n\n\t\t// If not set, default to the setting for 'public'.\n\t\tif ( null === $args['publicly_queryable'] ) {\n\t\t\t$args['publicly_queryable'] = $args['public'];\n\t\t}\n\n\t\tif ( false !== $args['query_var'] && ( is_admin() || false !== $args['publicly_queryable'] ) ) {\n\t\t\tif ( true === $args['query_var'] ) {\n\t\t\t\t$args['query_var'] = $this->name;\n\t\t\t} else {\n\t\t\t\t$args['query_var'] = sanitize_title_with_dashes( $args['query_var'] );\n\t\t\t}\n\t\t} else {\n\t\t\t// Force 'query_var' to false for non-public taxonomies.\n\t\t\t$args['query_var'] = false;\n\t\t}\n\n\t\tif ( false !== $args['rewrite'] && ( is_admin() || get_option( 'permalink_structure' ) ) ) {\n\t\t\t$args['rewrite'] = wp_parse_args(\n\t\t\t\t$args['rewrite'],\n\t\t\t\tarray(\n\t\t\t\t\t'with_front'   => true,\n\t\t\t\t\t'hierarchical' => false,\n\t\t\t\t\t'ep_mask'      => EP_NONE,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( empty( $args['rewrite']['slug'] ) ) {\n\t\t\t\t$args['rewrite']['slug'] = sanitize_title_with_dashes( $this->name );\n\t\t\t}\n\t\t}\n\n\t\t// If not set, default to the setting for 'public'.\n\t\tif ( null === $args['show_ui'] ) {\n\t\t\t$args['show_ui'] = $args['public'];\n\t\t}\n\n\t\t// If not set, default to the setting for 'show_ui'.\n\t\tif ( null === $args['show_in_menu'] || ! $args['show_ui'] ) {\n\t\t\t$args['show_in_menu'] = $args['show_ui'];\n\t\t}\n\n\t\t// If not set, default to the setting for 'public'.\n\t\tif ( null === $args['show_in_nav_menus'] ) {\n\t\t\t$args['show_in_nav_menus'] = $args['public'];\n\t\t}\n\n\t\t// If not set, default to the setting for 'show_ui'.\n\t\tif ( null === $args['show_tagcloud'] ) {\n\t\t\t$args['show_tagcloud'] = $args['show_ui'];\n\t\t}\n\n\t\t// If not set, default to the setting for 'show_ui'.\n\t\tif ( null === $args['show_in_quick_edit'] ) {\n\t\t\t$args['show_in_quick_edit'] = $args['show_ui'];\n\t\t}\n\n\t\t$default_caps = array(\n\t\t\t'manage_terms' => 'manage_categories',\n\t\t\t'edit_terms'   => 'manage_categories',\n\t\t\t'delete_terms' => 'manage_categories',\n\t\t\t'assign_terms' => 'edit_posts',\n\t\t);\n\n\t\t$args['cap'] = (object) array_merge( $default_caps, $args['capabilities'] );\n\t\tunset( $args['capabilities'] );\n\n\t\t$args['object_type'] = array_unique( (array) $object_type );\n\n\t\t// If not set, use the default meta box.\n\t\tif ( null === $args['meta_box_cb'] ) {\n\t\t\tif ( $args['hierarchical'] ) {\n\t\t\t\t$args['meta_box_cb'] = 'post_categories_meta_box';\n\t\t\t} else {\n\t\t\t\t$args['meta_box_cb'] = 'post_tags_meta_box';\n\t\t\t}\n\t\t}\n\n\t\t$args['name'] = $this->name;\n\n\t\t// Default meta box sanitization callback depends on the value of 'meta_box_cb'.\n\t\tif ( null === $args['meta_box_sanitize_cb'] ) {\n\t\t\tswitch ( $args['meta_box_cb'] ) {\n\t\t\t\tcase 'post_categories_meta_box':\n\t\t\t\t\t$args['meta_box_sanitize_cb'] = 'taxonomy_meta_box_sanitize_cb_checkboxes';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'post_tags_meta_box':\n\t\t\t\tdefault:\n\t\t\t\t\t$args['meta_box_sanitize_cb'] = 'taxonomy_meta_box_sanitize_cb_input';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Default taxonomy term.\n\t\tif ( ! empty( $args['default_term'] ) ) {\n\t\t\tif ( ! is_array( $args['default_term'] ) ) {\n\t\t\t\t$args['default_term'] = array( 'name' => $args['default_term'] );\n\t\t\t}\n\t\t\t$args['default_term'] = wp_parse_args(\n\t\t\t\t$args['default_term'],\n\t\t\t\tarray(\n\t\t\t\t\t'name'        => '',\n\t\t\t\t\t'slug'        => '',\n\t\t\t\t\t'description' => '',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tforeach ( $args as $property_name => $property_value ) {\n\t\t\t$this->$property_name = $property_value;\n\t\t}\n\n\t\t$this->labels = get_taxonomy_labels( $this );\n\t\t$this->label  = $this->labels->name;\n\t}\n\n\t/**\n\t * Adds the necessary rewrite rules for the taxonomy.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @global WP $wp Current WordPress environment instance.\n\t */\n\tpublic function add_rewrite_rules() {\n\t\t/* @var WP $wp */\n\t\tglobal $wp;\n\n\t\t// Non-publicly queryable taxonomies should not register query vars, except in the admin.\n\t\tif ( false !== $this->query_var && $wp ) {\n\t\t\t$wp->add_query_var( $this->query_var );\n\t\t}\n\n\t\tif ( false !== $this->rewrite && ( is_admin() || get_option( 'permalink_structure' ) ) ) {\n\t\t\tif ( $this->hierarchical && $this->rewrite['hierarchical'] ) {\n\t\t\t\t$tag = '(.+?)';\n\t\t\t} else {\n\t\t\t\t$tag = '([^/]+)';\n\t\t\t}\n\n\t\t\tadd_rewrite_tag( \"%$this->name%\", $tag, $this->query_var ? \"{$this->query_var}=\" : \"taxonomy=$this->name&term=\" );\n\t\t\tadd_permastruct( $this->name, \"{$this->rewrite['slug']}/%$this->name%\", $this->rewrite );\n\t\t}\n\t}\n\n\t/**\n\t * Removes any rewrite rules, permastructs, and rules for the taxonomy.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @global WP $wp Current WordPress environment instance.\n\t */\n\tpublic function remove_rewrite_rules() {\n\t\t/* @var WP $wp */\n\t\tglobal $wp;\n\n\t\t// Remove query var.\n\t\tif ( false !== $this->query_var ) {\n\t\t\t$wp->remove_query_var( $this->query_var );\n\t\t}\n\n\t\t// Remove rewrite tags and permastructs.\n\t\tif ( false !== $this->rewrite ) {\n\t\t\tremove_rewrite_tag( \"%$this->name%\" );\n\t\t\tremove_permastruct( $this->name );\n\t\t}\n\t}\n\n\t/**\n\t * Registers the ajax callback for the meta box.\n\t *\n\t * @since 4.7.0\n\t */\n\tpublic function add_hooks() {\n\t\tadd_filter( 'wp_ajax_add-' . $this->name, '_wp_ajax_add_hierarchical_term' );\n\t}\n\n\t/**\n\t * Removes the ajax callback for the meta box.\n\t *\n\t * @since 4.7.0\n\t */\n\tpublic function remove_hooks() {\n\t\tremove_filter( 'wp_ajax_add-' . $this->name, '_wp_ajax_add_hierarchical_term' );\n\t}\n\n\t/**\n\t * Gets the REST API controller for this taxonomy.\n\t *\n\t * Will only instantiate the controller class once per request.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return WP_REST_Controller|null The controller instance, or null if the taxonomy\n\t *                                 is set not to show in rest.\n\t */\n\tpublic function get_rest_controller() {\n\t\tif ( ! $this->show_in_rest ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$class = $this->rest_controller_class ? $this->rest_controller_class : WP_REST_Terms_Controller::class;\n\n\t\tif ( ! class_exists( $class ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( ! is_subclass_of( $class, WP_REST_Controller::class ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( ! $this->rest_controller ) {\n\t\t\t$this->rest_controller = new $class( $this->name );\n\t\t}\n\n\t\tif ( ! ( $this->rest_controller instanceof $class ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->rest_controller;\n\t}\n}\n", "num_lines": 527}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * Taxonomy API: WP_Term_Query class.\n *\n * @package WordPress\n * @subpackage Taxonomy\n * @since 4.6.0\n */\n\n/**\n * Class used for querying terms.\n *\n * @since 4.6.0\n *\n * @see WP_Term_Query::__construct() for accepted arguments.\n */\nclass WP_Term_Query {\n\n\t/**\n\t * SQL string used to perform database query.\n\t *\n\t * @since 4.6.0\n\t * @var string\n\t */\n\tpublic $request;\n\n\t/**\n\t * Metadata query container.\n\t *\n\t * @since 4.6.0\n\t * @var WP_Meta_Query A meta query instance.\n\t */\n\tpublic $meta_query = false;\n\n\t/**\n\t * Metadata query clauses.\n\t *\n\t * @since 4.6.0\n\t * @var array\n\t */\n\tprotected $meta_query_clauses;\n\n\t/**\n\t * SQL query clauses.\n\t *\n\t * @since 4.6.0\n\t * @var array\n\t */\n\tprotected $sql_clauses = array(\n\t\t'select'  => '',\n\t\t'from'    => '',\n\t\t'where'   => array(),\n\t\t'orderby' => '',\n\t\t'limits'  => '',\n\t);\n\n\t/**\n\t * Query vars set by the user.\n\t *\n\t * @since 4.6.0\n\t * @var array\n\t */\n\tpublic $query_vars;\n\n\t/**\n\t * Default values for query vars.\n\t *\n\t * @since 4.6.0\n\t * @var array\n\t */\n\tpublic $query_var_defaults;\n\n\t/**\n\t * List of terms located by the query.\n\t *\n\t * @since 4.6.0\n\t * @var array\n\t */\n\tpublic $terms;\n\n\t/**\n\t * Constructor.\n\t *\n\t * Sets up the term query, based on the query vars passed.\n\t *\n\t * @since 4.6.0\n\t * @since 4.6.0 Introduced 'term_taxonomy_id' parameter.\n\t * @since 4.7.0 Introduced 'object_ids' parameter.\n\t * @since 4.9.0 Added 'slug__in' support for 'orderby'.\n\t *\n\t * @param string|array $query {\n\t *     Optional. Array or query string of term query parameters. Default empty.\n\t *\n\t *     @type string|array $taxonomy               Taxonomy name, or array of taxonomies, to which results should\n\t *                                                be limited.\n\t *     @type int|array    $object_ids             Optional. Object ID, or array of object IDs. Results will be\n\t *                                                limited to terms associated with these objects.\n\t *     @type string       $orderby                Field(s) to order terms by. Accepts:\n\t *                                                - term fields ('name', 'slug', 'term_group', 'term_id', 'id',\n\t *                                                  'description', 'parent', 'term_order'). Unless `$object_ids`\n\t *                                                  is not empty, 'term_order' is treated the same as 'term_id'.\n\t *                                                - 'count' for term taxonomy count.\n\t *                                                - 'include' to match the 'order' of the $include param.\n\t *                                                - 'slug__in' to match the 'order' of the $slug param.\n\t *                                                - 'meta_value', 'meta_value_num'.\n\t *                                                - the value of `$meta_key`.\n\t *                                                - the array keys of `$meta_query`.\n\t *                                                - 'none' to omit the ORDER BY clause.\n\t *                                                Defaults to 'name'.\n\t *     @type string       $order                  Whether to order terms in ascending or descending order.\n\t *                                                Accepts 'ASC' (ascending) or 'DESC' (descending).\n\t *                                                Default 'ASC'.\n\t *     @type bool|int     $hide_empty             Whether to hide terms not assigned to any posts. Accepts\n\t *                                                1|true or 0|false. Default 1|true.\n\t *     @type array|string $include                Array or comma/space-separated string of term IDs to include.\n\t *                                                Default empty array.\n\t *     @type array|string $exclude                Array or comma/space-separated string of term IDs to exclude.\n\t *                                                If $include is non-empty, $exclude is ignored.\n\t *                                                Default empty array.\n\t *     @type array|string $exclude_tree           Array or comma/space-separated string of term IDs to exclude\n\t *                                                along with all of their descendant terms. If $include is\n\t *                                                non-empty, $exclude_tree is ignored. Default empty array.\n\t *     @type int|string   $number                 Maximum number of terms to return. Accepts ''|0 (all) or any\n\t *                                                positive number. Default ''|0 (all). Note that $number may\n\t *                                                not return accurate results when coupled with $object_ids.\n\t *                                                See #41796 for details.\n\t *     @type int          $offset                 The number by which to offset the terms query. Default empty.\n\t *     @type string       $fields                 Term fields to query for. Accepts:\n\t *                                                - 'all' Returns an array of complete term objects (`WP_Term[]`).\n\t *                                                - 'all_with_object_id' Returns an array of term objects\n\t *                                                  with the 'object_id' param (`WP_Term[]`). Works only\n\t *                                                  when the `$object_ids` parameter is populated.\n\t *                                                - 'ids' Returns an array of term IDs (`int[]`).\n\t *                                                - 'tt_ids' Returns an array of term taxonomy IDs (`int[]`).\n\t *                                                - 'names' Returns an array of term names (`string[]`).\n\t *                                                - 'slugs' Returns an array of term slugs (`string[]`).\n\t *                                                - 'count' Returns the number of matching terms (`int`).\n\t *                                                - 'id=>parent' Returns an associative array of parent term IDs,\n\t *                                                   keyed by term ID (`int[]`).\n\t *                                                - 'id=>name' Returns an associative array of term names,\n\t *                                                   keyed by term ID (`string[]`).\n\t *                                                - 'id=>slug' Returns an associative array of term slugs,\n\t *                                                   keyed by term ID (`string[]`).\n\t *                                                Default 'all'.\n\t *     @type bool         $count                  Whether to return a term count. If true, will take precedence\n\t *                                                over `$fields`. Default false.\n\t *     @type string|array $name                   Optional. Name or array of names to return term(s) for.\n\t *                                                Default empty.\n\t *     @type string|array $slug                   Optional. Slug or array of slugs to return term(s) for.\n\t *                                                Default empty.\n\t *     @type int|array    $term_taxonomy_id       Optional. Term taxonomy ID, or array of term taxonomy IDs,\n\t *                                                to match when querying terms.\n\t *     @type bool         $hierarchical           Whether to include terms that have non-empty descendants\n\t *                                                (even if $hide_empty is set to true). Default true.\n\t *     @type string       $search                 Search criteria to match terms. Will be SQL-formatted with\n\t *                                                wildcards before and after. Default empty.\n\t *     @type string       $name__like             Retrieve terms with criteria by which a term is LIKE\n\t *                                                `$name__like`. Default empty.\n\t *     @type string       $description__like      Retrieve terms where the description is LIKE\n\t *                                                `$description__like`. Default empty.\n\t *     @type bool         $pad_counts             Whether to pad the quantity of a term's children in the\n\t *                                                quantity of each term's \"count\" object variable.\n\t *                                                Default false.\n\t *     @type string       $get                    Whether to return terms regardless of ancestry or whether the\n\t *                                                terms are empty. Accepts 'all' or empty (disabled).\n\t *                                                Default empty.\n\t *     @type int          $child_of               Term ID to retrieve child terms of. If multiple taxonomies\n\t *                                                are passed, $child_of is ignored. Default 0.\n\t *     @type int|string   $parent                 Parent term ID to retrieve direct-child terms of.\n\t *                                                Default empty.\n\t *     @type bool         $childless              True to limit results to terms that have no children.\n\t *                                                This parameter has no effect on non-hierarchical taxonomies.\n\t *                                                Default false.\n\t *     @type string       $cache_domain           Unique cache key to be produced when this query is stored in\n\t *                                                an object cache. Default is 'core'.\n\t *     @type bool         $update_term_meta_cache Whether to prime meta caches for matched terms. Default true.\n\t *     @type array        $meta_query             Optional. Meta query clauses to limit retrieved terms by.\n\t *                                                See `WP_Meta_Query`. Default empty.\n\t *     @type string       $meta_key               Limit terms to those matching a specific metadata key.\n\t *                                                Can be used in conjunction with `$meta_value`. Default empty.\n\t *     @type string       $meta_value             Limit terms to those matching a specific metadata value.\n\t *                                                Usually used in conjunction with `$meta_key`. Default empty.\n\t *     @type string       $meta_type              MySQL data type that the `$meta_value` will be CAST to for\n\t *                                                comparisons. Default empty.\n\t *     @type string       $meta_compare           Comparison operator to test the 'meta_value'. Default empty.\n\t * }\n\t */\n\tpublic function __construct( $query = '' ) {\n\t\t$this->query_var_defaults = array(\n\t\t\t'taxonomy'               => null,\n\t\t\t'object_ids'             => null,\n\t\t\t'orderby'                => 'name',\n\t\t\t'order'                  => 'ASC',\n\t\t\t'hide_empty'             => true,\n\t\t\t'include'                => array(),\n\t\t\t'exclude'                => array(),\n\t\t\t'exclude_tree'           => array(),\n\t\t\t'number'                 => '',\n\t\t\t'offset'                 => '',\n\t\t\t'fields'                 => 'all',\n\t\t\t'count'                  => false,\n\t\t\t'name'                   => '',\n\t\t\t'slug'                   => '',\n\t\t\t'term_taxonomy_id'       => '',\n\t\t\t'hierarchical'           => true,\n\t\t\t'search'                 => '',\n\t\t\t'name__like'             => '',\n\t\t\t'description__like'      => '',\n\t\t\t'pad_counts'             => false,\n\t\t\t'get'                    => '',\n\t\t\t'child_of'               => 0,\n\t\t\t'parent'                 => '',\n\t\t\t'childless'              => false,\n\t\t\t'cache_domain'           => 'core',\n\t\t\t'update_term_meta_cache' => true,\n\t\t\t'meta_query'             => '',\n\t\t\t'meta_key'               => '',\n\t\t\t'meta_value'             => '',\n\t\t\t'meta_type'              => '',\n\t\t\t'meta_compare'           => '',\n\t\t);\n\n\t\tif ( ! empty( $query ) ) {\n\t\t\t$this->query( $query );\n\t\t}\n\t}\n\n\t/**\n\t * Parse arguments passed to the term query with default query parameters.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string|array $query WP_Term_Query arguments. See WP_Term_Query::__construct()\n\t */\n\tpublic function parse_query( $query = '' ) {\n\t\tif ( empty( $query ) ) {\n\t\t\t$query = $this->query_vars;\n\t\t}\n\n\t\t$taxonomies = isset( $query['taxonomy'] ) ? (array) $query['taxonomy'] : null;\n\n\t\t/**\n\t\t * Filters the terms query default arguments.\n\t\t *\n\t\t * Use {@see 'get_terms_args'} to filter the passed arguments.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param array    $defaults   An array of default get_terms() arguments.\n\t\t * @param string[] $taxonomies An array of taxonomy names.\n\t\t */\n\t\t$this->query_var_defaults = apply_filters( 'get_terms_defaults', $this->query_var_defaults, $taxonomies );\n\n\t\t$query = wp_parse_args( $query, $this->query_var_defaults );\n\n\t\t$query['number'] = absint( $query['number'] );\n\t\t$query['offset'] = absint( $query['offset'] );\n\n\t\t// 'parent' overrides 'child_of'.\n\t\tif ( 0 < intval( $query['parent'] ) ) {\n\t\t\t$query['child_of'] = false;\n\t\t}\n\n\t\tif ( 'all' === $query['get'] ) {\n\t\t\t$query['childless']    = false;\n\t\t\t$query['child_of']     = 0;\n\t\t\t$query['hide_empty']   = 0;\n\t\t\t$query['hierarchical'] = false;\n\t\t\t$query['pad_counts']   = false;\n\t\t}\n\n\t\t$query['taxonomy'] = $taxonomies;\n\n\t\t$this->query_vars = $query;\n\n\t\t/**\n\t\t * Fires after term query vars have been parsed.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param WP_Term_Query $this Current instance of WP_Term_Query.\n\t\t */\n\t\tdo_action( 'parse_term_query', $this );\n\t}\n\n\t/**\n\t * Sets up the query for retrieving terms.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string|array $query Array or URL query string of parameters.\n\t * @return array|int List of terms, or number of terms when 'count' is passed as a query var.\n\t */\n\tpublic function query( $query ) {\n\t\t$this->query_vars = wp_parse_args( $query );\n\t\treturn $this->get_terms();\n\t}\n\n\t/**\n\t * Get terms, based on query_vars.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @return array List of terms.\n\t */\n\tpublic function get_terms() {\n\t\tglobal $wpdb;\n\n\t\t$this->parse_query( $this->query_vars );\n\t\t$args = &$this->query_vars;\n\n\t\t// Set up meta_query so it's available to 'pre_get_terms'.\n\t\t$this->meta_query = new WP_Meta_Query();\n\t\t$this->meta_query->parse_query_vars( $args );\n\n\t\t/**\n\t\t * Fires before terms are retrieved.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param WP_Term_Query $this Current instance of WP_Term_Query.\n\t\t */\n\t\tdo_action( 'pre_get_terms', $this );\n\n\t\t$taxonomies = (array) $args['taxonomy'];\n\n\t\t// Save queries by not crawling the tree in the case of multiple taxes or a flat tax.\n\t\t$has_hierarchical_tax = false;\n\t\tif ( $taxonomies ) {\n\t\t\tforeach ( $taxonomies as $_tax ) {\n\t\t\t\tif ( is_taxonomy_hierarchical( $_tax ) ) {\n\t\t\t\t\t$has_hierarchical_tax = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// When no taxonomies are provided, assume we have to descend the tree.\n\t\t\t$has_hierarchical_tax = true;\n\t\t}\n\n\t\tif ( ! $has_hierarchical_tax ) {\n\t\t\t$args['hierarchical'] = false;\n\t\t\t$args['pad_counts']   = false;\n\t\t}\n\n\t\t// 'parent' overrides 'child_of'.\n\t\tif ( 0 < intval( $args['parent'] ) ) {\n\t\t\t$args['child_of'] = false;\n\t\t}\n\n\t\tif ( 'all' === $args['get'] ) {\n\t\t\t$args['childless']    = false;\n\t\t\t$args['child_of']     = 0;\n\t\t\t$args['hide_empty']   = 0;\n\t\t\t$args['hierarchical'] = false;\n\t\t\t$args['pad_counts']   = false;\n\t\t}\n\n\t\t/**\n\t\t * Filters the terms query arguments.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param array    $args       An array of get_terms() arguments.\n\t\t * @param string[] $taxonomies An array of taxonomy names.\n\t\t */\n\t\t$args = apply_filters( 'get_terms_args', $args, $taxonomies );\n\n\t\t// Avoid the query if the queried parent/child_of term has no descendants.\n\t\t$child_of = $args['child_of'];\n\t\t$parent   = $args['parent'];\n\n\t\tif ( $child_of ) {\n\t\t\t$_parent = $child_of;\n\t\t} elseif ( $parent ) {\n\t\t\t$_parent = $parent;\n\t\t} else {\n\t\t\t$_parent = false;\n\t\t}\n\n\t\tif ( $_parent ) {\n\t\t\t$in_hierarchy = false;\n\t\t\tforeach ( $taxonomies as $_tax ) {\n\t\t\t\t$hierarchy = _get_term_hierarchy( $_tax );\n\n\t\t\t\tif ( isset( $hierarchy[ $_parent ] ) ) {\n\t\t\t\t\t$in_hierarchy = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! $in_hierarchy ) {\n\t\t\t\tif ( 'count' === $args['fields'] ) {\n\t\t\t\t\treturn 0;\n\t\t\t\t} else {\n\t\t\t\t\t$this->terms = array();\n\t\t\t\t\treturn $this->terms;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// 'term_order' is a legal sort order only when joining the relationship table.\n\t\t$_orderby = $this->query_vars['orderby'];\n\t\tif ( 'term_order' === $_orderby && empty( $this->query_vars['object_ids'] ) ) {\n\t\t\t$_orderby = 'term_id';\n\t\t}\n\n\t\t$orderby = $this->parse_orderby( $_orderby );\n\n\t\tif ( $orderby ) {\n\t\t\t$orderby = \"ORDER BY $orderby\";\n\t\t}\n\n\t\t$order = $this->parse_order( $this->query_vars['order'] );\n\n\t\tif ( $taxonomies ) {\n\t\t\t$this->sql_clauses['where']['taxonomy'] = \"tt.taxonomy IN ('\" . implode( \"', '\", array_map( 'esc_sql', $taxonomies ) ) . \"')\";\n\t\t}\n\n\t\t$exclude      = $args['exclude'];\n\t\t$exclude_tree = $args['exclude_tree'];\n\t\t$include      = $args['include'];\n\n\t\t$inclusions = '';\n\t\tif ( ! empty( $include ) ) {\n\t\t\t$exclude      = '';\n\t\t\t$exclude_tree = '';\n\t\t\t$inclusions   = implode( ',', wp_parse_id_list( $include ) );\n\t\t}\n\n\t\tif ( ! empty( $inclusions ) ) {\n\t\t\t$this->sql_clauses['where']['inclusions'] = 't.term_id IN ( ' . $inclusions . ' )';\n\t\t}\n\n\t\t$exclusions = array();\n\t\tif ( ! empty( $exclude_tree ) ) {\n\t\t\t$exclude_tree      = wp_parse_id_list( $exclude_tree );\n\t\t\t$excluded_children = $exclude_tree;\n\t\t\tforeach ( $exclude_tree as $extrunk ) {\n\t\t\t\t$excluded_children = array_merge(\n\t\t\t\t\t$excluded_children,\n\t\t\t\t\t(array) get_terms(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'taxonomy'   => reset( $taxonomies ),\n\t\t\t\t\t\t\t'child_of'   => intval( $extrunk ),\n\t\t\t\t\t\t\t'fields'     => 'ids',\n\t\t\t\t\t\t\t'hide_empty' => 0,\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t$exclusions = array_merge( $excluded_children, $exclusions );\n\t\t}\n\n\t\tif ( ! empty( $exclude ) ) {\n\t\t\t$exclusions = array_merge( wp_parse_id_list( $exclude ), $exclusions );\n\t\t}\n\n\t\t// 'childless' terms are those without an entry in the flattened term hierarchy.\n\t\t$childless = (bool) $args['childless'];\n\t\tif ( $childless ) {\n\t\t\tforeach ( $taxonomies as $_tax ) {\n\t\t\t\t$term_hierarchy = _get_term_hierarchy( $_tax );\n\t\t\t\t$exclusions     = array_merge( array_keys( $term_hierarchy ), $exclusions );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $exclusions ) ) {\n\t\t\t$exclusions = 't.term_id NOT IN (' . implode( ',', array_map( 'intval', $exclusions ) ) . ')';\n\t\t} else {\n\t\t\t$exclusions = '';\n\t\t}\n\n\t\t/**\n\t\t * Filters the terms to exclude from the terms query.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param string   $exclusions `NOT IN` clause of the terms query.\n\t\t * @param array    $args       An array of terms query arguments.\n\t\t * @param string[] $taxonomies An array of taxonomy names.\n\t\t */\n\t\t$exclusions = apply_filters( 'list_terms_exclusions', $exclusions, $args, $taxonomies );\n\n\t\tif ( ! empty( $exclusions ) ) {\n\t\t\t// Must do string manipulation here for backward compatibility with filter.\n\t\t\t$this->sql_clauses['where']['exclusions'] = preg_replace( '/^\\s*AND\\s*/', '', $exclusions );\n\t\t}\n\n\t\tif (\n\t\t\t( ! empty( $args['name'] ) ) ||\n\t\t\t( is_string( $args['name'] ) && 0 !== strlen( $args['name'] ) )\n\t\t) {\n\t\t\t$names = (array) $args['name'];\n\t\t\tforeach ( $names as &$_name ) {\n\t\t\t\t// `sanitize_term_field()` returns slashed data.\n\t\t\t\t$_name = stripslashes( sanitize_term_field( 'name', $_name, 0, reset( $taxonomies ), 'db' ) );\n\t\t\t}\n\n\t\t\t$this->sql_clauses['where']['name'] = \"t.name IN ('\" . implode( \"', '\", array_map( 'esc_sql', $names ) ) . \"')\";\n\t\t}\n\n\t\tif (\n\t\t\t( ! empty( $args['slug'] ) ) ||\n\t\t\t( is_string( $args['slug'] ) && 0 !== strlen( $args['slug'] ) )\n\t\t) {\n\t\t\tif ( is_array( $args['slug'] ) ) {\n\t\t\t\t$slug                               = array_map( 'sanitize_title', $args['slug'] );\n\t\t\t\t$this->sql_clauses['where']['slug'] = \"t.slug IN ('\" . implode( \"', '\", $slug ) . \"')\";\n\t\t\t} else {\n\t\t\t\t$slug                               = sanitize_title( $args['slug'] );\n\t\t\t\t$this->sql_clauses['where']['slug'] = \"t.slug = '$slug'\";\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $args['term_taxonomy_id'] ) ) {\n\t\t\tif ( is_array( $args['term_taxonomy_id'] ) ) {\n\t\t\t\t$tt_ids = implode( ',', array_map( 'intval', $args['term_taxonomy_id'] ) );\n\t\t\t\t$this->sql_clauses['where']['term_taxonomy_id'] = \"tt.term_taxonomy_id IN ({$tt_ids})\";\n\t\t\t} else {\n\t\t\t\t$this->sql_clauses['where']['term_taxonomy_id'] = $wpdb->prepare( 'tt.term_taxonomy_id = %d', $args['term_taxonomy_id'] );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $args['name__like'] ) ) {\n\t\t\t$this->sql_clauses['where']['name__like'] = $wpdb->prepare( 't.name LIKE %s', '%' . $wpdb->esc_like( $args['name__like'] ) . '%' );\n\t\t}\n\n\t\tif ( ! empty( $args['description__like'] ) ) {\n\t\t\t$this->sql_clauses['where']['description__like'] = $wpdb->prepare( 'tt.description LIKE %s', '%' . $wpdb->esc_like( $args['description__like'] ) . '%' );\n\t\t}\n\n\t\tif ( ! empty( $args['object_ids'] ) ) {\n\t\t\t$object_ids = $args['object_ids'];\n\t\t\tif ( ! is_array( $object_ids ) ) {\n\t\t\t\t$object_ids = array( $object_ids );\n\t\t\t}\n\n\t\t\t$object_ids                               = implode( ', ', array_map( 'intval', $object_ids ) );\n\t\t\t$this->sql_clauses['where']['object_ids'] = \"tr.object_id IN ($object_ids)\";\n\t\t}\n\n\t\t/*\n\t\t * When querying for object relationships, the 'count > 0' check\n\t\t * added by 'hide_empty' is superfluous.\n\t\t */\n\t\tif ( ! empty( $args['object_ids'] ) ) {\n\t\t\t$args['hide_empty'] = false;\n\t\t}\n\n\t\tif ( '' !== $parent ) {\n\t\t\t$parent                               = (int) $parent;\n\t\t\t$this->sql_clauses['where']['parent'] = \"tt.parent = '$parent'\";\n\t\t}\n\n\t\t$hierarchical = $args['hierarchical'];\n\t\tif ( 'count' === $args['fields'] ) {\n\t\t\t$hierarchical = false;\n\t\t}\n\t\tif ( $args['hide_empty'] && ! $hierarchical ) {\n\t\t\t$this->sql_clauses['where']['count'] = 'tt.count > 0';\n\t\t}\n\n\t\t$number = $args['number'];\n\t\t$offset = $args['offset'];\n\n\t\t// Don't limit the query results when we have to descend the family tree.\n\t\tif ( $number && ! $hierarchical && ! $child_of && '' === $parent ) {\n\t\t\tif ( $offset ) {\n\t\t\t\t$limits = 'LIMIT ' . $offset . ',' . $number;\n\t\t\t} else {\n\t\t\t\t$limits = 'LIMIT ' . $number;\n\t\t\t}\n\t\t} else {\n\t\t\t$limits = '';\n\t\t}\n\n\t\tif ( ! empty( $args['search'] ) ) {\n\t\t\t$this->sql_clauses['where']['search'] = $this->get_search_sql( $args['search'] );\n\t\t}\n\n\t\t// Meta query support.\n\t\t$join     = '';\n\t\t$distinct = '';\n\n\t\t// Reparse meta_query query_vars, in case they were modified in a 'pre_get_terms' callback.\n\t\t$this->meta_query->parse_query_vars( $this->query_vars );\n\t\t$mq_sql       = $this->meta_query->get_sql( 'term', 't', 'term_id' );\n\t\t$meta_clauses = $this->meta_query->get_clauses();\n\n\t\tif ( ! empty( $meta_clauses ) ) {\n\t\t\t$join                                    .= $mq_sql['join'];\n\t\t\t$this->sql_clauses['where']['meta_query'] = preg_replace( '/^\\s*AND\\s*/', '', $mq_sql['where'] );\n\t\t\t$distinct                                .= 'DISTINCT';\n\n\t\t}\n\n\t\t$selects = array();\n\t\tswitch ( $args['fields'] ) {\n\t\t\tcase 'all':\n\t\t\tcase 'all_with_object_id':\n\t\t\tcase 'tt_ids':\n\t\t\tcase 'slugs':\n\t\t\t\t$selects = array( 't.*', 'tt.*' );\n\t\t\t\tif ( 'all_with_object_id' === $args['fields'] && ! empty( $args['object_ids'] ) ) {\n\t\t\t\t\t$selects[] = 'tr.object_id';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ids':\n\t\t\tcase 'id=>parent':\n\t\t\t\t$selects = array( 't.term_id', 'tt.parent', 'tt.count', 'tt.taxonomy' );\n\t\t\t\tbreak;\n\t\t\tcase 'names':\n\t\t\t\t$selects = array( 't.term_id', 'tt.parent', 'tt.count', 't.name', 'tt.taxonomy' );\n\t\t\t\tbreak;\n\t\t\tcase 'count':\n\t\t\t\t$orderby = '';\n\t\t\t\t$order   = '';\n\t\t\t\t$selects = array( 'COUNT(*)' );\n\t\t\t\tbreak;\n\t\t\tcase 'id=>name':\n\t\t\t\t$selects = array( 't.term_id', 't.name', 'tt.parent', 'tt.count', 'tt.taxonomy' );\n\t\t\t\tbreak;\n\t\t\tcase 'id=>slug':\n\t\t\t\t$selects = array( 't.term_id', 't.slug', 'tt.parent', 'tt.count', 'tt.taxonomy' );\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$_fields = $args['fields'];\n\n\t\t/**\n\t\t * Filters the fields to select in the terms query.\n\t\t *\n\t\t * Field lists modified using this filter will only modify the term fields returned\n\t\t * by the function when the `$fields` parameter set to 'count' or 'all'. In all other\n\t\t * cases, the term fields in the results array will be determined by the `$fields`\n\t\t * parameter alone.\n\t\t *\n\t\t * Use of this filter can result in unpredictable behavior, and is not recommended.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string[] $selects    An array of fields to select for the terms query.\n\t\t * @param array    $args       An array of term query arguments.\n\t\t * @param string[] $taxonomies An array of taxonomy names.\n\t\t */\n\t\t$fields = implode( ', ', apply_filters( 'get_terms_fields', $selects, $args, $taxonomies ) );\n\n\t\t$join .= \" INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id\";\n\n\t\tif ( ! empty( $this->query_vars['object_ids'] ) ) {\n\t\t\t$join .= \" INNER JOIN {$wpdb->term_relationships} AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id\";\n\t\t}\n\n\t\t$where = implode( ' AND ', $this->sql_clauses['where'] );\n\n\t\t/**\n\t\t * Filters the terms query SQL clauses.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string[] $pieces     Array of query SQL clauses.\n\t\t * @param string[] $taxonomies An array of taxonomy names.\n\t\t * @param array    $args       An array of term query arguments.\n\t\t */\n\t\t$clauses = apply_filters( 'terms_clauses', compact( 'fields', 'join', 'where', 'distinct', 'orderby', 'order', 'limits' ), $taxonomies, $args );\n\n\t\t$fields   = isset( $clauses['fields'] ) ? $clauses['fields'] : '';\n\t\t$join     = isset( $clauses['join'] ) ? $clauses['join'] : '';\n\t\t$where    = isset( $clauses['where'] ) ? $clauses['where'] : '';\n\t\t$distinct = isset( $clauses['distinct'] ) ? $clauses['distinct'] : '';\n\t\t$orderby  = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';\n\t\t$order    = isset( $clauses['order'] ) ? $clauses['order'] : '';\n\t\t$limits   = isset( $clauses['limits'] ) ? $clauses['limits'] : '';\n\n\t\tif ( $where ) {\n\t\t\t$where = \"WHERE $where\";\n\t\t}\n\n\t\t$this->sql_clauses['select']  = \"SELECT $distinct $fields\";\n\t\t$this->sql_clauses['from']    = \"FROM $wpdb->terms AS t $join\";\n\t\t$this->sql_clauses['orderby'] = $orderby ? \"$orderby $order\" : '';\n\t\t$this->sql_clauses['limits']  = $limits;\n\n\t\t$this->request = \"{$this->sql_clauses['select']} {$this->sql_clauses['from']} {$where} {$this->sql_clauses['orderby']} {$this->sql_clauses['limits']}\";\n\n\t\t$this->terms = null;\n\n\t\t/**\n\t\t * Filter the terms array before the query takes place.\n\t\t *\n\t\t * Return a non-null value to bypass WordPress's default term queries.\n\t\t *\n\t\t * @since 5.3.0\n\t\t *\n\t\t * @param array|null    $terms Return an array of term data to short-circuit WP's term query,\n\t\t *                             or null to allow WP queries to run normally.\n\t\t * @param WP_Term_Query $this  The WP_Term_Query instance, passed by reference.\n\t\t */\n\t\t$this->terms = apply_filters_ref_array( 'terms_pre_query', array( $this->terms, &$this ) );\n\n\t\tif ( null !== $this->terms ) {\n\t\t\treturn $this->terms;\n\t\t}\n\n\t\t// $args can be anything. Only use the args defined in defaults to compute the key.\n\t\t$key          = md5( serialize( wp_array_slice_assoc( $args, array_keys( $this->query_var_defaults ) ) ) . serialize( $taxonomies ) . $this->request );\n\t\t$last_changed = wp_cache_get_last_changed( 'terms' );\n\t\t$cache_key    = \"get_terms:$key:$last_changed\";\n\t\t$cache        = wp_cache_get( $cache_key, 'terms' );\n\t\tif ( false !== $cache ) {\n\t\t\tif ( 'all' === $_fields || 'all_with_object_id' === $_fields ) {\n\t\t\t\t$cache = $this->populate_terms( $cache );\n\t\t\t}\n\n\t\t\t$this->terms = $cache;\n\t\t\treturn $this->terms;\n\t\t}\n\n\t\tif ( 'count' === $_fields ) {\n\t\t\t$count = $wpdb->get_var( $this->request );\n\t\t\twp_cache_set( $cache_key, $count, 'terms' );\n\t\t\treturn $count;\n\t\t}\n\n\t\t$terms = $wpdb->get_results( $this->request );\n\n\t\tif ( 'all' === $_fields || 'all_with_object_id' === $_fields ) {\n\t\t\tupdate_term_cache( $terms );\n\t\t}\n\n\t\t// Prime termmeta cache.\n\t\tif ( $args['update_term_meta_cache'] ) {\n\t\t\t$term_ids = wp_list_pluck( $terms, 'term_id' );\n\t\t\tupdate_termmeta_cache( $term_ids );\n\t\t}\n\n\t\tif ( empty( $terms ) ) {\n\t\t\twp_cache_add( $cache_key, array(), 'terms', DAY_IN_SECONDS );\n\t\t\treturn array();\n\t\t}\n\n\t\tif ( $child_of ) {\n\t\t\tforeach ( $taxonomies as $_tax ) {\n\t\t\t\t$children = _get_term_hierarchy( $_tax );\n\t\t\t\tif ( ! empty( $children ) ) {\n\t\t\t\t\t$terms = _get_term_children( $child_of, $terms, $_tax );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update term counts to include children.\n\t\tif ( $args['pad_counts'] && 'all' === $_fields ) {\n\t\t\tforeach ( $taxonomies as $_tax ) {\n\t\t\t\t_pad_term_counts( $terms, $_tax );\n\t\t\t}\n\t\t}\n\n\t\t// Make sure we show empty categories that have children.\n\t\tif ( $hierarchical && $args['hide_empty'] && is_array( $terms ) ) {\n\t\t\tforeach ( $terms as $k => $term ) {\n\t\t\t\tif ( ! $term->count ) {\n\t\t\t\t\t$children = get_term_children( $term->term_id, $term->taxonomy );\n\t\t\t\t\tif ( is_array( $children ) ) {\n\t\t\t\t\t\tforeach ( $children as $child_id ) {\n\t\t\t\t\t\t\t$child = get_term( $child_id, $term->taxonomy );\n\t\t\t\t\t\t\tif ( $child->count ) {\n\t\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// It really is empty.\n\t\t\t\t\tunset( $terms[ $k ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * When querying for terms connected to objects, we may get\n\t\t * duplicate results. The duplicates should be preserved if\n\t\t * `$fields` is 'all_with_object_id', but should otherwise be\n\t\t * removed.\n\t\t */\n\t\tif ( ! empty( $args['object_ids'] ) && 'all_with_object_id' !== $_fields ) {\n\t\t\t$_tt_ids = array();\n\t\t\t$_terms  = array();\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\tif ( isset( $_tt_ids[ $term->term_id ] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$_tt_ids[ $term->term_id ] = 1;\n\t\t\t\t$_terms[]                  = $term;\n\t\t\t}\n\n\t\t\t$terms = $_terms;\n\t\t}\n\n\t\t$_terms = array();\n\t\tif ( 'id=>parent' === $_fields ) {\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$_terms[ $term->term_id ] = $term->parent;\n\t\t\t}\n\t\t} elseif ( 'ids' === $_fields ) {\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$_terms[] = (int) $term->term_id;\n\t\t\t}\n\t\t} elseif ( 'tt_ids' === $_fields ) {\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$_terms[] = (int) $term->term_taxonomy_id;\n\t\t\t}\n\t\t} elseif ( 'names' === $_fields ) {\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$_terms[] = $term->name;\n\t\t\t}\n\t\t} elseif ( 'slugs' === $_fields ) {\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$_terms[] = $term->slug;\n\t\t\t}\n\t\t} elseif ( 'id=>name' === $_fields ) {\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$_terms[ $term->term_id ] = $term->name;\n\t\t\t}\n\t\t} elseif ( 'id=>slug' === $_fields ) {\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$_terms[ $term->term_id ] = $term->slug;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $_terms ) ) {\n\t\t\t$terms = $_terms;\n\t\t}\n\n\t\t// Hierarchical queries are not limited, so 'offset' and 'number' must be handled now.\n\t\tif ( $hierarchical && $number && is_array( $terms ) ) {\n\t\t\tif ( $offset >= count( $terms ) ) {\n\t\t\t\t$terms = array();\n\t\t\t} else {\n\t\t\t\t$terms = array_slice( $terms, $offset, $number, true );\n\t\t\t}\n\t\t}\n\n\t\twp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS );\n\n\t\tif ( 'all' === $_fields || 'all_with_object_id' === $_fields ) {\n\t\t\t$terms = $this->populate_terms( $terms );\n\t\t}\n\n\t\t$this->terms = $terms;\n\t\treturn $this->terms;\n\t}\n\n\t/**\n\t * Parse and sanitize 'orderby' keys passed to the term query.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $orderby_raw Alias for the field to order by.\n\t * @return string|false Value to used in the ORDER clause. False otherwise.\n\t */\n\tprotected function parse_orderby( $orderby_raw ) {\n\t\t$_orderby           = strtolower( $orderby_raw );\n\t\t$maybe_orderby_meta = false;\n\n\t\tif ( in_array( $_orderby, array( 'term_id', 'name', 'slug', 'term_group' ), true ) ) {\n\t\t\t$orderby = \"t.$_orderby\";\n\t\t} elseif ( in_array( $_orderby, array( 'count', 'parent', 'taxonomy', 'term_taxonomy_id', 'description' ), true ) ) {\n\t\t\t$orderby = \"tt.$_orderby\";\n\t\t} elseif ( 'term_order' === $_orderby ) {\n\t\t\t$orderby = 'tr.term_order';\n\t\t} elseif ( 'include' === $_orderby && ! empty( $this->query_vars['include'] ) ) {\n\t\t\t$include = implode( ',', wp_parse_id_list( $this->query_vars['include'] ) );\n\t\t\t$orderby = \"FIELD( t.term_id, $include )\";\n\t\t} elseif ( 'slug__in' === $_orderby && ! empty( $this->query_vars['slug'] ) && is_array( $this->query_vars['slug'] ) ) {\n\t\t\t$slugs   = implode( \"', '\", array_map( 'sanitize_title_for_query', $this->query_vars['slug'] ) );\n\t\t\t$orderby = \"FIELD( t.slug, '\" . $slugs . \"')\";\n\t\t} elseif ( 'none' === $_orderby ) {\n\t\t\t$orderby = '';\n\t\t} elseif ( empty( $_orderby ) || 'id' === $_orderby || 'term_id' === $_orderby ) {\n\t\t\t$orderby = 't.term_id';\n\t\t} else {\n\t\t\t$orderby = 't.name';\n\n\t\t\t// This may be a value of orderby related to meta.\n\t\t\t$maybe_orderby_meta = true;\n\t\t}\n\n\t\t/**\n\t\t * Filters the ORDERBY clause of the terms query.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string   $orderby    `ORDERBY` clause of the terms query.\n\t\t * @param array    $args       An array of term query arguments.\n\t\t * @param string[] $taxonomies An array of taxonomy names.\n\t\t */\n\t\t$orderby = apply_filters( 'get_terms_orderby', $orderby, $this->query_vars, $this->query_vars['taxonomy'] );\n\n\t\t// Run after the 'get_terms_orderby' filter for backward compatibility.\n\t\tif ( $maybe_orderby_meta ) {\n\t\t\t$maybe_orderby_meta = $this->parse_orderby_meta( $_orderby );\n\t\t\tif ( $maybe_orderby_meta ) {\n\t\t\t\t$orderby = $maybe_orderby_meta;\n\t\t\t}\n\t\t}\n\n\t\treturn $orderby;\n\t}\n\n\t/**\n\t * Generate the ORDER BY clause for an 'orderby' param that is potentially related to a meta query.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string $orderby_raw Raw 'orderby' value passed to WP_Term_Query.\n\t * @return string ORDER BY clause.\n\t */\n\tprotected function parse_orderby_meta( $orderby_raw ) {\n\t\t$orderby = '';\n\n\t\t// Tell the meta query to generate its SQL, so we have access to table aliases.\n\t\t$this->meta_query->get_sql( 'term', 't', 'term_id' );\n\t\t$meta_clauses = $this->meta_query->get_clauses();\n\t\tif ( ! $meta_clauses || ! $orderby_raw ) {\n\t\t\treturn $orderby;\n\t\t}\n\n\t\t$allowed_keys       = array();\n\t\t$primary_meta_key   = null;\n\t\t$primary_meta_query = reset( $meta_clauses );\n\t\tif ( ! empty( $primary_meta_query['key'] ) ) {\n\t\t\t$primary_meta_key = $primary_meta_query['key'];\n\t\t\t$allowed_keys[]   = $primary_meta_key;\n\t\t}\n\t\t$allowed_keys[] = 'meta_value';\n\t\t$allowed_keys[] = 'meta_value_num';\n\t\t$allowed_keys   = array_merge( $allowed_keys, array_keys( $meta_clauses ) );\n\n\t\tif ( ! in_array( $orderby_raw, $allowed_keys, true ) ) {\n\t\t\treturn $orderby;\n\t\t}\n\n\t\tswitch ( $orderby_raw ) {\n\t\t\tcase $primary_meta_key:\n\t\t\tcase 'meta_value':\n\t\t\t\tif ( ! empty( $primary_meta_query['type'] ) ) {\n\t\t\t\t\t$orderby = \"CAST({$primary_meta_query['alias']}.meta_value AS {$primary_meta_query['cast']})\";\n\t\t\t\t} else {\n\t\t\t\t\t$orderby = \"{$primary_meta_query['alias']}.meta_value\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'meta_value_num':\n\t\t\t\t$orderby = \"{$primary_meta_query['alias']}.meta_value+0\";\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tif ( array_key_exists( $orderby_raw, $meta_clauses ) ) {\n\t\t\t\t\t// $orderby corresponds to a meta_query clause.\n\t\t\t\t\t$meta_clause = $meta_clauses[ $orderby_raw ];\n\t\t\t\t\t$orderby     = \"CAST({$meta_clause['alias']}.meta_value AS {$meta_clause['cast']})\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $orderby;\n\t}\n\n\t/**\n\t * Parse an 'order' query variable and cast it to ASC or DESC as necessary.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string $order The 'order' query variable.\n\t * @return string The sanitized 'order' query variable.\n\t */\n\tprotected function parse_order( $order ) {\n\t\tif ( ! is_string( $order ) || empty( $order ) ) {\n\t\t\treturn 'DESC';\n\t\t}\n\n\t\tif ( 'ASC' === strtoupper( $order ) ) {\n\t\t\treturn 'ASC';\n\t\t} else {\n\t\t\treturn 'DESC';\n\t\t}\n\t}\n\n\t/**\n\t * Used internally to generate a SQL string related to the 'search' parameter.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $string\n\t * @return string\n\t */\n\tprotected function get_search_sql( $string ) {\n\t\tglobal $wpdb;\n\n\t\t$like = '%' . $wpdb->esc_like( $string ) . '%';\n\n\t\treturn $wpdb->prepare( '((t.name LIKE %s) OR (t.slug LIKE %s))', $like, $like );\n\t}\n\n\t/**\n\t * Creates an array of term objects from an array of term IDs.\n\t *\n\t * Also discards invalid term objects.\n\t *\n\t * @since 4.9.8\n\t *\n\t * @param array $term_ids Term IDs.\n\t * @return array\n\t */\n\tprotected function populate_terms( $term_ids ) {\n\t\t$terms = array();\n\n\t\tif ( ! is_array( $term_ids ) ) {\n\t\t\treturn $terms;\n\t\t}\n\n\t\tforeach ( $term_ids as $key => $term_id ) {\n\t\t\t$term = get_term( $term_id );\n\t\t\tif ( $term instanceof WP_Term ) {\n\t\t\t\t$terms[ $key ] = $term;\n\t\t\t}\n\t\t}\n\n\t\treturn $terms;\n\t}\n}\n", "num_lines": 1038}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Taxonomy API: WP_Term class\n *\n * @package WordPress\n * @subpackage Taxonomy\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement the WP_Term object.\n *\n * @since 4.4.0\n *\n * @property-read object $data Sanitized term data.\n */\nfinal class WP_Term {\n\n\t/**\n\t * Term ID.\n\t *\n\t * @since 4.4.0\n\t * @var int\n\t */\n\tpublic $term_id;\n\n\t/**\n\t * The term's name.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $name = '';\n\n\t/**\n\t * The term's slug.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $slug = '';\n\n\t/**\n\t * The term's term_group.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $term_group = '';\n\n\t/**\n\t * Term Taxonomy ID.\n\t *\n\t * @since 4.4.0\n\t * @var int\n\t */\n\tpublic $term_taxonomy_id = 0;\n\n\t/**\n\t * The term's taxonomy name.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $taxonomy = '';\n\n\t/**\n\t * The term's description.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $description = '';\n\n\t/**\n\t * ID of a term's parent term.\n\t *\n\t * @since 4.4.0\n\t * @var int\n\t */\n\tpublic $parent = 0;\n\n\t/**\n\t * Cached object count for this term.\n\t *\n\t * @since 4.4.0\n\t * @var int\n\t */\n\tpublic $count = 0;\n\n\t/**\n\t * Stores the term object's sanitization level.\n\t *\n\t * Does not correspond to a database field.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $filter = 'raw';\n\n\t/**\n\t * Retrieve WP_Term instance.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param int    $term_id  Term ID.\n\t * @param string $taxonomy Optional. Limit matched terms to those matching `$taxonomy`. Only used for\n\t *                         disambiguating potentially shared terms.\n\t * @return WP_Term|WP_Error|false Term object, if found. WP_Error if `$term_id` is shared between taxonomies and\n\t *                                there's insufficient data to distinguish which term is intended.\n\t *                                False for other failures.\n\t */\n\tpublic static function get_instance( $term_id, $taxonomy = null ) {\n\t\tglobal $wpdb;\n\n\t\t$term_id = (int) $term_id;\n\t\tif ( ! $term_id ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$_term = wp_cache_get( $term_id, 'terms' );\n\n\t\t// If there isn't a cached version, hit the database.\n\t\tif ( ! $_term || ( $taxonomy && $taxonomy !== $_term->taxonomy ) ) {\n\t\t\t// Any term found in the cache is not a match, so don't use it.\n\t\t\t$_term = false;\n\n\t\t\t// Grab all matching terms, in case any are shared between taxonomies.\n\t\t\t$terms = $wpdb->get_results( $wpdb->prepare( \"SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE t.term_id = %d\", $term_id ) );\n\t\t\tif ( ! $terms ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// If a taxonomy was specified, find a match.\n\t\t\tif ( $taxonomy ) {\n\t\t\t\tforeach ( $terms as $match ) {\n\t\t\t\t\tif ( $taxonomy === $match->taxonomy ) {\n\t\t\t\t\t\t$_term = $match;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If only one match was found, it's the one we want.\n\t\t\t} elseif ( 1 === count( $terms ) ) {\n\t\t\t\t$_term = reset( $terms );\n\n\t\t\t\t// Otherwise, the term must be shared between taxonomies.\n\t\t\t} else {\n\t\t\t\t// If the term is shared only with invalid taxonomies, return the one valid term.\n\t\t\t\tforeach ( $terms as $t ) {\n\t\t\t\t\tif ( ! taxonomy_exists( $t->taxonomy ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only hit if we've already identified a term in a valid taxonomy.\n\t\t\t\t\tif ( $_term ) {\n\t\t\t\t\t\treturn new WP_Error( 'ambiguous_term_id', __( 'Term ID is shared between multiple taxonomies' ), $term_id );\n\t\t\t\t\t}\n\n\t\t\t\t\t$_term = $t;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! $_term ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Don't return terms from invalid taxonomies.\n\t\t\tif ( ! taxonomy_exists( $_term->taxonomy ) ) {\n\t\t\t\treturn new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );\n\t\t\t}\n\n\t\t\t$_term = sanitize_term( $_term, $_term->taxonomy, 'raw' );\n\n\t\t\t// Don't cache terms that are shared between taxonomies.\n\t\t\tif ( 1 === count( $terms ) ) {\n\t\t\t\twp_cache_add( $term_id, $_term, 'terms' );\n\t\t\t}\n\t\t}\n\n\t\t$term_obj = new WP_Term( $_term );\n\t\t$term_obj->filter( $term_obj->filter );\n\n\t\treturn $term_obj;\n\t}\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param WP_Term|object $term Term object.\n\t */\n\tpublic function __construct( $term ) {\n\t\tforeach ( get_object_vars( $term ) as $key => $value ) {\n\t\t\t$this->$key = $value;\n\t\t}\n\t}\n\n\t/**\n\t * Sanitizes term fields, according to the filter type provided.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $filter Filter context. Accepts 'edit', 'db', 'display', 'attribute', 'js', 'raw'.\n\t */\n\tpublic function filter( $filter ) {\n\t\tsanitize_term( $this, $this->taxonomy, $filter );\n\t}\n\n\t/**\n\t * Converts an object to array.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return array Object as array.\n\t */\n\tpublic function to_array() {\n\t\treturn get_object_vars( $this );\n\t}\n\n\t/**\n\t * Getter.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $key Property to get.\n\t * @return mixed Property value.\n\t */\n\tpublic function __get( $key ) {\n\t\tswitch ( $key ) {\n\t\t\tcase 'data':\n\t\t\t\t$data    = new stdClass();\n\t\t\t\t$columns = array( 'term_id', 'name', 'slug', 'term_group', 'term_taxonomy_id', 'taxonomy', 'description', 'parent', 'count' );\n\t\t\t\tforeach ( $columns as $column ) {\n\t\t\t\t\t$data->{$column} = isset( $this->{$column} ) ? $this->{$column} : null;\n\t\t\t\t}\n\n\t\t\t\treturn sanitize_term( $data, $data->taxonomy, 'raw' );\n\t\t}\n\t}\n}\n", "num_lines": 245}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Diff API: WP_Text_Diff_Renderer_inline class\n *\n * @package WordPress\n * @subpackage Diff\n * @since 4.7.0\n */\n\n/**\n * Better word splitting than the PEAR package provides.\n *\n * @since 2.6.0\n * @uses Text_Diff_Renderer_inline Extends\n */\nclass WP_Text_Diff_Renderer_inline extends Text_Diff_Renderer_inline {\n\n\t/**\n\t * @ignore\n\t * @since 2.6.0\n\t *\n\t * @param string $string\n\t * @param string $newlineEscape\n\t * @return string\n\t */\n\tpublic function _splitOnWords( $string, $newlineEscape = \"\\n\" ) {\n\t\t$string = str_replace( \"\\0\", '', $string );\n\t\t$words  = preg_split( '/([^\\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE );\n\t\t$words  = str_replace( \"\\n\", $newlineEscape, $words );\n\t\treturn $words;\n\t}\n\n}\n", "num_lines": 34}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Diff API: WP_Text_Diff_Renderer_Table class\n *\n * @package WordPress\n * @subpackage Diff\n * @since 4.7.0\n */\n\n/**\n * Table renderer to display the diff lines.\n *\n * @since 2.6.0\n * @uses Text_Diff_Renderer Extends\n */\nclass WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {\n\n\t/**\n\t * @see Text_Diff_Renderer::_leading_context_lines\n\t * @var int\n\t * @since 2.6.0\n\t */\n\tpublic $_leading_context_lines = 10000;\n\n\t/**\n\t * @see Text_Diff_Renderer::_trailing_context_lines\n\t * @var int\n\t * @since 2.6.0\n\t */\n\tpublic $_trailing_context_lines = 10000;\n\n\t/**\n\t * Threshold for when a diff should be saved or omitted.\n\t *\n\t * @var float\n\t * @since 2.6.0\n\t */\n\tprotected $_diff_threshold = 0.6;\n\n\t/**\n\t * Inline display helper object name.\n\t *\n\t * @var string\n\t * @since 2.6.0\n\t */\n\tprotected $inline_diff_renderer = 'WP_Text_Diff_Renderer_inline';\n\n\t/**\n\t * Should we show the split view or not\n\t *\n\t * @var string\n\t * @since 3.6.0\n\t */\n\tprotected $_show_split_view = true;\n\n\tprotected $compat_fields = array( '_show_split_view', 'inline_diff_renderer', '_diff_threshold' );\n\n\t/**\n\t * Caches the output of count_chars() in compute_string_distance()\n\t *\n\t * @var array\n\t * @since 5.0.0\n\t */\n\tprotected $count_cache = array();\n\n\t/**\n\t * Caches the difference calculation in compute_string_distance()\n\t *\n\t * @var array\n\t * @since 5.0.0\n\t */\n\tprotected $difference_cache = array();\n\n\t/**\n\t * Constructor - Call parent constructor with params array.\n\t *\n\t * This will set class properties based on the key value pairs in the array.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param array $params\n\t */\n\tpublic function __construct( $params = array() ) {\n\t\tparent::__construct( $params );\n\t\tif ( isset( $params['show_split_view'] ) ) {\n\t\t\t$this->_show_split_view = $params['show_split_view'];\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t *\n\t * @param string $header\n\t * @return string\n\t */\n\tpublic function _startBlock( $header ) {\n\t\treturn '';\n\t}\n\n\t/**\n\t * @ignore\n\t *\n\t * @param array  $lines\n\t * @param string $prefix\n\t */\n\tpublic function _lines( $lines, $prefix = ' ' ) {\n\t}\n\n\t/**\n\t * @ignore\n\t *\n\t * @param string $line HTML-escape the value.\n\t * @return string\n\t */\n\tpublic function addedLine( $line ) {\n\t\treturn \"<td class='diff-addedline'><span aria-hidden='true' class='dashicons dashicons-plus'></span><span class='screen-reader-text'>\" . __( 'Added:' ) . \" </span>{$line}</td>\";\n\n\t}\n\n\t/**\n\t * @ignore\n\t *\n\t * @param string $line HTML-escape the value.\n\t * @return string\n\t */\n\tpublic function deletedLine( $line ) {\n\t\treturn \"<td class='diff-deletedline'><span aria-hidden='true' class='dashicons dashicons-minus'></span><span class='screen-reader-text'>\" . __( 'Deleted:' ) . \" </span>{$line}</td>\";\n\t}\n\n\t/**\n\t * @ignore\n\t *\n\t * @param string $line HTML-escape the value.\n\t * @return string\n\t */\n\tpublic function contextLine( $line ) {\n\t\treturn \"<td class='diff-context'><span class='screen-reader-text'>\" . __( 'Unchanged:' ) . \" </span>{$line}</td>\";\n\t}\n\n\t/**\n\t * @ignore\n\t *\n\t * @return string\n\t */\n\tpublic function emptyLine() {\n\t\treturn '<td>&nbsp;</td>';\n\t}\n\n\t/**\n\t * @ignore\n\t *\n\t * @param array $lines\n\t * @param bool  $encode\n\t * @return string\n\t */\n\tpublic function _added( $lines, $encode = true ) {\n\t\t$r = '';\n\t\tforeach ( $lines as $line ) {\n\t\t\tif ( $encode ) {\n\t\t\t\t$processed_line = htmlspecialchars( $line );\n\n\t\t\t\t/**\n\t\t\t\t * Contextually filters a diffed line.\n\t\t\t\t *\n\t\t\t\t * Filters TextDiff processing of diffed line. By default, diffs are processed with\n\t\t\t\t * htmlspecialchars. Use this filter to remove or change the processing. Passes a context\n\t\t\t\t * indicating if the line is added, deleted or unchanged.\n\t\t\t\t *\n\t\t\t\t * @since 4.1.0\n\t\t\t\t *\n\t\t\t\t * @param string $processed_line The processed diffed line.\n\t\t\t\t * @param string $line           The unprocessed diffed line.\n\t\t\t\t * @param string $context        The line context. Values are 'added', 'deleted' or 'unchanged'.\n\t\t\t\t */\n\t\t\t\t$line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'added' );\n\t\t\t}\n\n\t\t\tif ( $this->_show_split_view ) {\n\t\t\t\t$r .= '<tr>' . $this->emptyLine() . $this->emptyLine() . $this->addedLine( $line ) . \"</tr>\\n\";\n\t\t\t} else {\n\t\t\t\t$r .= '<tr>' . $this->addedLine( $line ) . \"</tr>\\n\";\n\t\t\t}\n\t\t}\n\t\treturn $r;\n\t}\n\n\t/**\n\t * @ignore\n\t *\n\t * @param array $lines\n\t * @param bool  $encode\n\t * @return string\n\t */\n\tpublic function _deleted( $lines, $encode = true ) {\n\t\t$r = '';\n\t\tforeach ( $lines as $line ) {\n\t\t\tif ( $encode ) {\n\t\t\t\t$processed_line = htmlspecialchars( $line );\n\n\t\t\t\t/** This filter is documented in wp-includes/wp-diff.php */\n\t\t\t\t$line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'deleted' );\n\t\t\t}\n\t\t\tif ( $this->_show_split_view ) {\n\t\t\t\t$r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() . $this->emptyLine() . \"</tr>\\n\";\n\t\t\t} else {\n\t\t\t\t$r .= '<tr>' . $this->deletedLine( $line ) . \"</tr>\\n\";\n\t\t\t}\n\t\t}\n\t\treturn $r;\n\t}\n\n\t/**\n\t * @ignore\n\t *\n\t * @param array $lines\n\t * @param bool  $encode\n\t * @return string\n\t */\n\tpublic function _context( $lines, $encode = true ) {\n\t\t$r = '';\n\t\tforeach ( $lines as $line ) {\n\t\t\tif ( $encode ) {\n\t\t\t\t$processed_line = htmlspecialchars( $line );\n\n\t\t\t\t/** This filter is documented in wp-includes/wp-diff.php */\n\t\t\t\t$line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'unchanged' );\n\t\t\t}\n\t\t\tif ( $this->_show_split_view ) {\n\t\t\t\t$r .= '<tr>' . $this->contextLine( $line ) . $this->emptyLine() . $this->contextLine( $line ) . \"</tr>\\n\";\n\t\t\t} else {\n\t\t\t\t$r .= '<tr>' . $this->contextLine( $line ) . \"</tr>\\n\";\n\t\t\t}\n\t\t}\n\t\treturn $r;\n\t}\n\n\t/**\n\t * Process changed lines to do word-by-word diffs for extra highlighting.\n\t *\n\t * (TRAC style) sometimes these lines can actually be deleted or added rows.\n\t * We do additional processing to figure that out\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param array $orig\n\t * @param array $final\n\t * @return string\n\t */\n\tpublic function _changed( $orig, $final ) {\n\t\t$r = '';\n\n\t\t/*\n\t\t * Does the aforementioned additional processing:\n\t\t * *_matches tell what rows are \"the same\" in orig and final. Those pairs will be diffed to get word changes.\n\t\t * - match is numeric: an index in other column.\n\t\t * - match is 'X': no match. It is a new row.\n\t\t * *_rows are column vectors for the orig column and the final column.\n\t\t * - row >= 0: an indix of the $orig or $final array.\n\t\t * - row < 0: a blank row for that column.\n\t\t */\n\t\tlist($orig_matches, $final_matches, $orig_rows, $final_rows) = $this->interleave_changed_lines( $orig, $final );\n\n\t\t// These will hold the word changes as determined by an inline diff.\n\t\t$orig_diffs  = array();\n\t\t$final_diffs = array();\n\n\t\t// Compute word diffs for each matched pair using the inline diff.\n\t\tforeach ( $orig_matches as $o => $f ) {\n\t\t\tif ( is_numeric( $o ) && is_numeric( $f ) ) {\n\t\t\t\t$text_diff = new Text_Diff( 'auto', array( array( $orig[ $o ] ), array( $final[ $f ] ) ) );\n\t\t\t\t$renderer  = new $this->inline_diff_renderer;\n\t\t\t\t$diff      = $renderer->render( $text_diff );\n\n\t\t\t\t// If they're too different, don't include any <ins> or <del>'s.\n\t\t\t\tif ( preg_match_all( '!(<ins>.*?</ins>|<del>.*?</del>)!', $diff, $diff_matches ) ) {\n\t\t\t\t\t// Length of all text between <ins> or <del>.\n\t\t\t\t\t$stripped_matches = strlen( strip_tags( join( ' ', $diff_matches[0] ) ) );\n\t\t\t\t\t// Since we count length of text between <ins> or <del> (instead of picking just one),\n\t\t\t\t\t// we double the length of chars not in those tags.\n\t\t\t\t\t$stripped_diff = strlen( strip_tags( $diff ) ) * 2 - $stripped_matches;\n\t\t\t\t\t$diff_ratio    = $stripped_matches / $stripped_diff;\n\t\t\t\t\tif ( $diff_ratio > $this->_diff_threshold ) {\n\t\t\t\t\t\tcontinue; // Too different. Don't save diffs.\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Un-inline the diffs by removing <del> or <ins>.\n\t\t\t\t$orig_diffs[ $o ]  = preg_replace( '|<ins>.*?</ins>|', '', $diff );\n\t\t\t\t$final_diffs[ $f ] = preg_replace( '|<del>.*?</del>|', '', $diff );\n\t\t\t}\n\t\t}\n\n\t\tforeach ( array_keys( $orig_rows ) as $row ) {\n\t\t\t// Both columns have blanks. Ignore them.\n\t\t\tif ( $orig_rows[ $row ] < 0 && $final_rows[ $row ] < 0 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If we have a word based diff, use it. Otherwise, use the normal line.\n\t\t\tif ( isset( $orig_diffs[ $orig_rows[ $row ] ] ) ) {\n\t\t\t\t$orig_line = $orig_diffs[ $orig_rows[ $row ] ];\n\t\t\t} elseif ( isset( $orig[ $orig_rows[ $row ] ] ) ) {\n\t\t\t\t$orig_line = htmlspecialchars( $orig[ $orig_rows[ $row ] ] );\n\t\t\t} else {\n\t\t\t\t$orig_line = '';\n\t\t\t}\n\n\t\t\tif ( isset( $final_diffs[ $final_rows[ $row ] ] ) ) {\n\t\t\t\t$final_line = $final_diffs[ $final_rows[ $row ] ];\n\t\t\t} elseif ( isset( $final[ $final_rows[ $row ] ] ) ) {\n\t\t\t\t$final_line = htmlspecialchars( $final[ $final_rows[ $row ] ] );\n\t\t\t} else {\n\t\t\t\t$final_line = '';\n\t\t\t}\n\n\t\t\tif ( $orig_rows[ $row ] < 0 ) { // Orig is blank. This is really an added row.\n\t\t\t\t$r .= $this->_added( array( $final_line ), false );\n\t\t\t} elseif ( $final_rows[ $row ] < 0 ) { // Final is blank. This is really a deleted row.\n\t\t\t\t$r .= $this->_deleted( array( $orig_line ), false );\n\t\t\t} else { // A true changed row.\n\t\t\t\tif ( $this->_show_split_view ) {\n\t\t\t\t\t$r .= '<tr>' . $this->deletedLine( $orig_line ) . $this->emptyLine() . $this->addedLine( $final_line ) . \"</tr>\\n\";\n\t\t\t\t} else {\n\t\t\t\t\t$r .= '<tr>' . $this->deletedLine( $orig_line ) . '</tr><tr>' . $this->addedLine( $final_line ) . \"</tr>\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $r;\n\t}\n\n\t/**\n\t * Takes changed blocks and matches which rows in orig turned into which rows in final.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param array $orig  Lines of the original version of the text.\n\t * @param array $final Lines of the final version of the text.\n\t * @return array {\n\t *     Array containing results of comparing the original text to the final text.\n\t *\n\t *     @type array $orig_matches  Associative array of original matches. Index == row\n\t *                                number of `$orig`, value == corresponding row number\n\t *                                of that same line in `$final` or 'x' if there is no\n\t *                                corresponding row (indicating it is a deleted line).\n\t *     @type array $final_matches Associative array of final matches. Index == row\n\t *                                number of `$final`, value == corresponding row number\n\t *                                of that same line in `$orig` or 'x' if there is no\n\t *                                corresponding row (indicating it is a new line).\n\t *     @type array $orig_rows     Associative array of interleaved rows of `$orig` with\n\t *                                blanks to keep matches aligned with side-by-side diff\n\t *                                of `$final`. A value >= 0 corresponds to index of `$orig`.\n\t *                                Value < 0 indicates a blank row.\n\t *     @type array $final_rows    Associative array of interleaved rows of `$final` with\n\t *                                blanks to keep matches aligned with side-by-side diff\n\t *                                of `$orig`. A value >= 0 corresponds to index of `$final`.\n\t *                                Value < 0 indicates a blank row.\n\t * }\n\t */\n\tpublic function interleave_changed_lines( $orig, $final ) {\n\n\t\t// Contains all pairwise string comparisons. Keys are such that this need only be a one dimensional array.\n\t\t$matches = array();\n\t\tforeach ( array_keys( $orig ) as $o ) {\n\t\t\tforeach ( array_keys( $final ) as $f ) {\n\t\t\t\t$matches[ \"$o,$f\" ] = $this->compute_string_distance( $orig[ $o ], $final[ $f ] );\n\t\t\t}\n\t\t}\n\t\tasort( $matches ); // Order by string distance.\n\n\t\t$orig_matches  = array();\n\t\t$final_matches = array();\n\n\t\tforeach ( $matches as $keys => $difference ) {\n\t\t\tlist($o, $f) = explode( ',', $keys );\n\t\t\t$o           = (int) $o;\n\t\t\t$f           = (int) $f;\n\n\t\t\t// Already have better matches for these guys.\n\t\t\tif ( isset( $orig_matches[ $o ] ) && isset( $final_matches[ $f ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// First match for these guys. Must be best match.\n\t\t\tif ( ! isset( $orig_matches[ $o ] ) && ! isset( $final_matches[ $f ] ) ) {\n\t\t\t\t$orig_matches[ $o ]  = $f;\n\t\t\t\t$final_matches[ $f ] = $o;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Best match of this final is already taken? Must mean this final is a new row.\n\t\t\tif ( isset( $orig_matches[ $o ] ) ) {\n\t\t\t\t$final_matches[ $f ] = 'x';\n\t\t\t} elseif ( isset( $final_matches[ $f ] ) ) {\n\t\t\t\t// Best match of this orig is already taken? Must mean this orig is a deleted row.\n\t\t\t\t$orig_matches[ $o ] = 'x';\n\t\t\t}\n\t\t}\n\n\t\t// We read the text in this order.\n\t\tksort( $orig_matches );\n\t\tksort( $final_matches );\n\n\t\t// Stores rows and blanks for each column.\n\t\t$orig_rows      = array_keys( $orig_matches );\n\t\t$orig_rows_copy = $orig_rows;\n\t\t$final_rows     = array_keys( $final_matches );\n\n\t\t// Interleaves rows with blanks to keep matches aligned.\n\t\t// We may end up with some extraneous blank rows, but we'll just ignore them later.\n\t\tforeach ( $orig_rows_copy as $orig_row ) {\n\t\t\t$final_pos = array_search( $orig_matches[ $orig_row ], $final_rows, true );\n\t\t\t$orig_pos  = (int) array_search( $orig_row, $orig_rows, true );\n\n\t\t\tif ( false === $final_pos ) { // This orig is paired with a blank final.\n\t\t\t\tarray_splice( $final_rows, $orig_pos, 0, -1 );\n\t\t\t} elseif ( $final_pos < $orig_pos ) { // This orig's match is up a ways. Pad final with blank rows.\n\t\t\t\t$diff_array = range( -1, $final_pos - $orig_pos );\n\t\t\t\tarray_splice( $final_rows, $orig_pos, 0, $diff_array );\n\t\t\t} elseif ( $final_pos > $orig_pos ) { // This orig's match is down a ways. Pad orig with blank rows.\n\t\t\t\t$diff_array = range( -1, $orig_pos - $final_pos );\n\t\t\t\tarray_splice( $orig_rows, $orig_pos, 0, $diff_array );\n\t\t\t}\n\t\t}\n\n\t\t// Pad the ends with blank rows if the columns aren't the same length.\n\t\t$diff_count = count( $orig_rows ) - count( $final_rows );\n\t\tif ( $diff_count < 0 ) {\n\t\t\twhile ( $diff_count < 0 ) {\n\t\t\t\tarray_push( $orig_rows, $diff_count++ );\n\t\t\t}\n\t\t} elseif ( $diff_count > 0 ) {\n\t\t\t$diff_count = -1 * $diff_count;\n\t\t\twhile ( $diff_count < 0 ) {\n\t\t\t\tarray_push( $final_rows, $diff_count++ );\n\t\t\t}\n\t\t}\n\n\t\treturn array( $orig_matches, $final_matches, $orig_rows, $final_rows );\n\t}\n\n\t/**\n\t * Computes a number that is intended to reflect the \"distance\" between two strings.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param string $string1\n\t * @param string $string2\n\t * @return int\n\t */\n\tpublic function compute_string_distance( $string1, $string2 ) {\n\t\t// Use an md5 hash of the strings for a count cache, as it's fast to generate, and collisions aren't a concern.\n\t\t$count_key1 = md5( $string1 );\n\t\t$count_key2 = md5( $string2 );\n\n\t\t// Cache vectors containing character frequency for all chars in each string.\n\t\tif ( ! isset( $this->count_cache[ $count_key1 ] ) ) {\n\t\t\t$this->count_cache[ $count_key1 ] = count_chars( $string1 );\n\t\t}\n\t\tif ( ! isset( $this->count_cache[ $count_key2 ] ) ) {\n\t\t\t$this->count_cache[ $count_key2 ] = count_chars( $string2 );\n\t\t}\n\n\t\t$chars1 = $this->count_cache[ $count_key1 ];\n\t\t$chars2 = $this->count_cache[ $count_key2 ];\n\n\t\t$difference_key = md5( implode( ',', $chars1 ) . ':' . implode( ',', $chars2 ) );\n\t\tif ( ! isset( $this->difference_cache[ $difference_key ] ) ) {\n\t\t\t// L1-norm of difference vector.\n\t\t\t$this->difference_cache[ $difference_key ] = array_sum( array_map( array( $this, 'difference' ), $chars1, $chars2 ) );\n\t\t}\n\n\t\t$difference = $this->difference_cache[ $difference_key ];\n\n\t\t// $string1 has zero length? Odd. Give huge penalty by not dividing.\n\t\tif ( ! $string1 ) {\n\t\t\treturn $difference;\n\t\t}\n\n\t\t// Return distance per character (of string1).\n\t\treturn $difference / strlen( $string1 );\n\t}\n\n\t/**\n\t * @ignore\n\t * @since 2.6.0\n\t *\n\t * @param int $a\n\t * @param int $b\n\t * @return int\n\t */\n\tpublic function difference( $a, $b ) {\n\t\treturn abs( $a - $b );\n\t}\n\n\t/**\n\t * Make private properties readable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name Property to get.\n\t * @return mixed Property.\n\t */\n\tpublic function __get( $name ) {\n\t\tif ( in_array( $name, $this->compat_fields, true ) ) {\n\t\t\treturn $this->$name;\n\t\t}\n\t}\n\n\t/**\n\t * Make private properties settable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name  Property to check if set.\n\t * @param mixed  $value Property value.\n\t * @return mixed Newly-set property.\n\t */\n\tpublic function __set( $name, $value ) {\n\t\tif ( in_array( $name, $this->compat_fields, true ) ) {\n\t\t\treturn $this->$name = $value;\n\t\t}\n\t}\n\n\t/**\n\t * Make private properties checkable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name Property to check if set.\n\t * @return bool Whether the property is set.\n\t */\n\tpublic function __isset( $name ) {\n\t\tif ( in_array( $name, $this->compat_fields, true ) ) {\n\t\t\treturn isset( $this->$name );\n\t\t}\n\t}\n\n\t/**\n\t * Make private properties un-settable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name Property to unset.\n\t */\n\tpublic function __unset( $name ) {\n\t\tif ( in_array( $name, $this->compat_fields, true ) ) {\n\t\t\tunset( $this->$name );\n\t\t}\n\t}\n}\n", "num_lines": 552}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WP_Theme Class\n *\n * @package WordPress\n * @subpackage Theme\n * @since 3.4.0\n */\nfinal class WP_Theme implements ArrayAccess {\n\n\t/**\n\t * Whether the theme has been marked as updateable.\n\t *\n\t * @since 4.4.0\n\t * @var bool\n\t *\n\t * @see WP_MS_Themes_List_Table\n\t */\n\tpublic $update = false;\n\n\t/**\n\t * Headers for style.css files.\n\t *\n\t * @since 3.4.0\n\t * @since 5.4.0 Added `Requires at least` and `Requires PHP` headers.\n\t * @var array\n\t */\n\tprivate static $file_headers = array(\n\t\t'Name'        => 'Theme Name',\n\t\t'ThemeURI'    => 'Theme URI',\n\t\t'Description' => 'Description',\n\t\t'Author'      => 'Author',\n\t\t'AuthorURI'   => 'Author URI',\n\t\t'Version'     => 'Version',\n\t\t'Template'    => 'Template',\n\t\t'Status'      => 'Status',\n\t\t'Tags'        => 'Tags',\n\t\t'TextDomain'  => 'Text Domain',\n\t\t'DomainPath'  => 'Domain Path',\n\t\t'RequiresWP'  => 'Requires at least',\n\t\t'RequiresPHP' => 'Requires PHP',\n\t);\n\n\t/**\n\t * Default themes.\n\t *\n\t * @var array\n\t */\n\tprivate static $default_themes = array(\n\t\t'classic'         => 'WordPress Classic',\n\t\t'default'         => 'WordPress Default',\n\t\t'twentyten'       => 'Twenty Ten',\n\t\t'twentyeleven'    => 'Twenty Eleven',\n\t\t'twentytwelve'    => 'Twenty Twelve',\n\t\t'twentythirteen'  => 'Twenty Thirteen',\n\t\t'twentyfourteen'  => 'Twenty Fourteen',\n\t\t'twentyfifteen'   => 'Twenty Fifteen',\n\t\t'twentysixteen'   => 'Twenty Sixteen',\n\t\t'twentyseventeen' => 'Twenty Seventeen',\n\t\t'twentynineteen'  => 'Twenty Nineteen',\n\t\t'twentytwenty'    => 'Twenty Twenty',\n\t);\n\n\t/**\n\t * Renamed theme tags.\n\t *\n\t * @var array\n\t */\n\tprivate static $tag_map = array(\n\t\t'fixed-width'    => 'fixed-layout',\n\t\t'flexible-width' => 'fluid-layout',\n\t);\n\n\t/**\n\t * Absolute path to the theme root, usually wp-content/themes\n\t *\n\t * @var string\n\t */\n\tprivate $theme_root;\n\n\t/**\n\t * Header data from the theme's style.css file.\n\t *\n\t * @var array\n\t */\n\tprivate $headers = array();\n\n\t/**\n\t * Header data from the theme's style.css file after being sanitized.\n\t *\n\t * @var array\n\t */\n\tprivate $headers_sanitized;\n\n\t/**\n\t * Header name from the theme's style.css after being translated.\n\t *\n\t * Cached due to sorting functions running over the translated name.\n\t *\n\t * @var string\n\t */\n\tprivate $name_translated;\n\n\t/**\n\t * Errors encountered when initializing the theme.\n\t *\n\t * @var WP_Error\n\t */\n\tprivate $errors;\n\n\t/**\n\t * The directory name of the theme's files, inside the theme root.\n\t *\n\t * In the case of a child theme, this is directory name of the child theme.\n\t * Otherwise, 'stylesheet' is the same as 'template'.\n\t *\n\t * @var string\n\t */\n\tprivate $stylesheet;\n\n\t/**\n\t * The directory name of the theme's files, inside the theme root.\n\t *\n\t * In the case of a child theme, this is the directory name of the parent theme.\n\t * Otherwise, 'template' is the same as 'stylesheet'.\n\t *\n\t * @var string\n\t */\n\tprivate $template;\n\n\t/**\n\t * A reference to the parent theme, in the case of a child theme.\n\t *\n\t * @var WP_Theme\n\t */\n\tprivate $parent;\n\n\t/**\n\t * URL to the theme root, usually an absolute URL to wp-content/themes\n\t *\n\t * @var string\n\t */\n\tprivate $theme_root_uri;\n\n\t/**\n\t * Flag for whether the theme's textdomain is loaded.\n\t *\n\t * @var bool\n\t */\n\tprivate $textdomain_loaded;\n\n\t/**\n\t * Stores an md5 hash of the theme root, to function as the cache key.\n\t *\n\t * @var string\n\t */\n\tprivate $cache_hash;\n\n\t/**\n\t * Flag for whether the themes cache bucket should be persistently cached.\n\t *\n\t * Default is false. Can be set with the {@see 'wp_cache_themes_persistently'} filter.\n\t *\n\t * @var bool\n\t */\n\tprivate static $persistently_cache;\n\n\t/**\n\t * Expiration time for the themes cache bucket.\n\t *\n\t * By default the bucket is not cached, so this value is useless.\n\t *\n\t * @var bool\n\t */\n\tprivate static $cache_expiration = 1800;\n\n\t/**\n\t * Constructor for WP_Theme.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @global array $wp_theme_directories\n\t *\n\t * @param string        $theme_dir  Directory of the theme within the theme_root.\n\t * @param string        $theme_root Theme root.\n\t * @param WP_Theme|null $_child If this theme is a parent theme, the child may be passed for validation purposes.\n\t */\n\tpublic function __construct( $theme_dir, $theme_root, $_child = null ) {\n\t\tglobal $wp_theme_directories;\n\n\t\t// Initialize caching on first run.\n\t\tif ( ! isset( self::$persistently_cache ) ) {\n\t\t\t/** This action is documented in wp-includes/theme.php */\n\t\t\tself::$persistently_cache = apply_filters( 'wp_cache_themes_persistently', false, 'WP_Theme' );\n\t\t\tif ( self::$persistently_cache ) {\n\t\t\t\twp_cache_add_global_groups( 'themes' );\n\t\t\t\tif ( is_int( self::$persistently_cache ) ) {\n\t\t\t\t\tself::$cache_expiration = self::$persistently_cache;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twp_cache_add_non_persistent_groups( 'themes' );\n\t\t\t}\n\t\t}\n\n\t\t$this->theme_root = $theme_root;\n\t\t$this->stylesheet = $theme_dir;\n\n\t\t// Correct a situation where the theme is 'some-directory/some-theme' but 'some-directory' was passed in as part of the theme root instead.\n\t\tif ( ! in_array( $theme_root, (array) $wp_theme_directories, true )\n\t\t\t&& in_array( dirname( $theme_root ), (array) $wp_theme_directories, true )\n\t\t) {\n\t\t\t$this->stylesheet = basename( $this->theme_root ) . '/' . $this->stylesheet;\n\t\t\t$this->theme_root = dirname( $theme_root );\n\t\t}\n\n\t\t$this->cache_hash = md5( $this->theme_root . '/' . $this->stylesheet );\n\t\t$theme_file       = $this->stylesheet . '/style.css';\n\n\t\t$cache = $this->cache_get( 'theme' );\n\n\t\tif ( is_array( $cache ) ) {\n\t\t\tforeach ( array( 'errors', 'headers', 'template' ) as $key ) {\n\t\t\t\tif ( isset( $cache[ $key ] ) ) {\n\t\t\t\t\t$this->$key = $cache[ $key ];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( $this->errors ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( isset( $cache['theme_root_template'] ) ) {\n\t\t\t\t$theme_root_template = $cache['theme_root_template'];\n\t\t\t}\n\t\t} elseif ( ! file_exists( $this->theme_root . '/' . $theme_file ) ) {\n\t\t\t$this->headers['Name'] = $this->stylesheet;\n\t\t\tif ( ! file_exists( $this->theme_root . '/' . $this->stylesheet ) ) {\n\t\t\t\t$this->errors = new WP_Error(\n\t\t\t\t\t'theme_not_found',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: Theme directory name. */\n\t\t\t\t\t\t__( 'The theme directory \"%s\" does not exist.' ),\n\t\t\t\t\t\tesc_html( $this->stylesheet )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$this->errors = new WP_Error( 'theme_no_stylesheet', __( 'Stylesheet is missing.' ) );\n\t\t\t}\n\t\t\t$this->template = $this->stylesheet;\n\t\t\t$this->cache_add(\n\t\t\t\t'theme',\n\t\t\t\tarray(\n\t\t\t\t\t'headers'    => $this->headers,\n\t\t\t\t\t'errors'     => $this->errors,\n\t\t\t\t\t'stylesheet' => $this->stylesheet,\n\t\t\t\t\t'template'   => $this->template,\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ( ! file_exists( $this->theme_root ) ) { // Don't cache this one.\n\t\t\t\t$this->errors->add( 'theme_root_missing', __( 'Error: The themes directory is either empty or doesn&#8217;t exist. Please check your installation.' ) );\n\t\t\t}\n\t\t\treturn;\n\t\t} elseif ( ! is_readable( $this->theme_root . '/' . $theme_file ) ) {\n\t\t\t$this->headers['Name'] = $this->stylesheet;\n\t\t\t$this->errors          = new WP_Error( 'theme_stylesheet_not_readable', __( 'Stylesheet is not readable.' ) );\n\t\t\t$this->template        = $this->stylesheet;\n\t\t\t$this->cache_add(\n\t\t\t\t'theme',\n\t\t\t\tarray(\n\t\t\t\t\t'headers'    => $this->headers,\n\t\t\t\t\t'errors'     => $this->errors,\n\t\t\t\t\t'stylesheet' => $this->stylesheet,\n\t\t\t\t\t'template'   => $this->template,\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn;\n\t\t} else {\n\t\t\t$this->headers = get_file_data( $this->theme_root . '/' . $theme_file, self::$file_headers, 'theme' );\n\t\t\t// Default themes always trump their pretenders.\n\t\t\t// Properly identify default themes that are inside a directory within wp-content/themes.\n\t\t\t$default_theme_slug = array_search( $this->headers['Name'], self::$default_themes, true );\n\t\t\tif ( $default_theme_slug ) {\n\t\t\t\tif ( basename( $this->stylesheet ) != $default_theme_slug ) {\n\t\t\t\t\t$this->headers['Name'] .= '/' . $this->stylesheet;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $this->template && $this->stylesheet === $this->headers['Template'] ) {\n\t\t\t$this->errors = new WP_Error(\n\t\t\t\t'theme_child_invalid',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Template. */\n\t\t\t\t\t__( 'The theme defines itself as its parent theme. Please check the %s header.' ),\n\t\t\t\t\t'<code>Template</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->cache_add(\n\t\t\t\t'theme',\n\t\t\t\tarray(\n\t\t\t\t\t'headers'    => $this->headers,\n\t\t\t\t\t'errors'     => $this->errors,\n\t\t\t\t\t'stylesheet' => $this->stylesheet,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\t// (If template is set from cache [and there are no errors], we know it's good.)\n\t\tif ( ! $this->template ) {\n\t\t\t$this->template = $this->headers['Template'];\n\t\t}\n\n\t\tif ( ! $this->template ) {\n\t\t\t$this->template = $this->stylesheet;\n\t\t\tif ( ! file_exists( $this->theme_root . '/' . $this->stylesheet . '/index.php' ) ) {\n\t\t\t\t$error_message = sprintf(\n\t\t\t\t\t/* translators: 1: index.php, 2: Documentation URL, 3: style.css */\n\t\t\t\t\t__( 'Template is missing. Standalone themes need to have a %1$s template file. <a href=\"%2$s\">Child themes</a> need to have a Template header in the %3$s stylesheet.' ),\n\t\t\t\t\t'<code>index.php</code>',\n\t\t\t\t\t__( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ),\n\t\t\t\t\t'<code>style.css</code>'\n\t\t\t\t);\n\t\t\t\t$this->errors = new WP_Error( 'theme_no_index', $error_message );\n\t\t\t\t$this->cache_add(\n\t\t\t\t\t'theme',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'headers'    => $this->headers,\n\t\t\t\t\t\t'errors'     => $this->errors,\n\t\t\t\t\t\t'stylesheet' => $this->stylesheet,\n\t\t\t\t\t\t'template'   => $this->template,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// If we got our data from cache, we can assume that 'template' is pointing to the right place.\n\t\tif ( ! is_array( $cache ) && $this->template != $this->stylesheet && ! file_exists( $this->theme_root . '/' . $this->template . '/index.php' ) ) {\n\t\t\t// If we're in a directory of themes inside /themes, look for the parent nearby.\n\t\t\t// wp-content/themes/directory-of-themes/*\n\t\t\t$parent_dir  = dirname( $this->stylesheet );\n\t\t\t$directories = search_theme_directories();\n\n\t\t\tif ( '.' !== $parent_dir && file_exists( $this->theme_root . '/' . $parent_dir . '/' . $this->template . '/index.php' ) ) {\n\t\t\t\t$this->template = $parent_dir . '/' . $this->template;\n\t\t\t} elseif ( $directories && isset( $directories[ $this->template ] ) ) {\n\t\t\t\t// Look for the template in the search_theme_directories() results, in case it is in another theme root.\n\t\t\t\t// We don't look into directories of themes, just the theme root.\n\t\t\t\t$theme_root_template = $directories[ $this->template ]['theme_root'];\n\t\t\t} else {\n\t\t\t\t// Parent theme is missing.\n\t\t\t\t$this->errors = new WP_Error(\n\t\t\t\t\t'theme_no_parent',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: Theme directory name. */\n\t\t\t\t\t\t__( 'The parent theme is missing. Please install the \"%s\" parent theme.' ),\n\t\t\t\t\t\tesc_html( $this->template )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$this->cache_add(\n\t\t\t\t\t'theme',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'headers'    => $this->headers,\n\t\t\t\t\t\t'errors'     => $this->errors,\n\t\t\t\t\t\t'stylesheet' => $this->stylesheet,\n\t\t\t\t\t\t'template'   => $this->template,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$this->parent = new WP_Theme( $this->template, $this->theme_root, $this );\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Set the parent, if we're a child theme.\n\t\tif ( $this->template != $this->stylesheet ) {\n\t\t\t// If we are a parent, then there is a problem. Only two generations allowed! Cancel things out.\n\t\t\tif ( $_child instanceof WP_Theme && $_child->template == $this->stylesheet ) {\n\t\t\t\t$_child->parent = null;\n\t\t\t\t$_child->errors = new WP_Error(\n\t\t\t\t\t'theme_parent_invalid',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: Theme directory name. */\n\t\t\t\t\t\t__( 'The \"%s\" theme is not a valid parent theme.' ),\n\t\t\t\t\t\tesc_html( $_child->template )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$_child->cache_add(\n\t\t\t\t\t'theme',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'headers'    => $_child->headers,\n\t\t\t\t\t\t'errors'     => $_child->errors,\n\t\t\t\t\t\t'stylesheet' => $_child->stylesheet,\n\t\t\t\t\t\t'template'   => $_child->template,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t// The two themes actually reference each other with the Template header.\n\t\t\t\tif ( $_child->stylesheet == $this->template ) {\n\t\t\t\t\t$this->errors = new WP_Error(\n\t\t\t\t\t\t'theme_parent_invalid',\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: Theme directory name. */\n\t\t\t\t\t\t\t__( 'The \"%s\" theme is not a valid parent theme.' ),\n\t\t\t\t\t\t\tesc_html( $this->template )\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t$this->cache_add(\n\t\t\t\t\t\t'theme',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'headers'    => $this->headers,\n\t\t\t\t\t\t\t'errors'     => $this->errors,\n\t\t\t\t\t\t\t'stylesheet' => $this->stylesheet,\n\t\t\t\t\t\t\t'template'   => $this->template,\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Set the parent. Pass the current instance so we can do the crazy checks above and assess errors.\n\t\t\t$this->parent = new WP_Theme( $this->template, isset( $theme_root_template ) ? $theme_root_template : $this->theme_root, $this );\n\t\t}\n\n\t\tif ( wp_paused_themes()->get( $this->stylesheet ) && ( ! is_wp_error( $this->errors ) || ! isset( $this->errors->errors['theme_paused'] ) ) ) {\n\t\t\t$this->errors = new WP_Error( 'theme_paused', __( 'This theme failed to load properly and was paused within the admin backend.' ) );\n\t\t}\n\n\t\t// We're good. If we didn't retrieve from cache, set it.\n\t\tif ( ! is_array( $cache ) ) {\n\t\t\t$cache = array(\n\t\t\t\t'headers'    => $this->headers,\n\t\t\t\t'errors'     => $this->errors,\n\t\t\t\t'stylesheet' => $this->stylesheet,\n\t\t\t\t'template'   => $this->template,\n\t\t\t);\n\t\t\t// If the parent theme is in another root, we'll want to cache this. Avoids an entire branch of filesystem calls above.\n\t\t\tif ( isset( $theme_root_template ) ) {\n\t\t\t\t$cache['theme_root_template'] = $theme_root_template;\n\t\t\t}\n\t\t\t$this->cache_add( 'theme', $cache );\n\t\t}\n\t}\n\n\t/**\n\t * When converting the object to a string, the theme name is returned.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return string Theme name, ready for display (translated)\n\t */\n\tpublic function __toString() {\n\t\treturn (string) $this->display( 'Name' );\n\t}\n\n\t/**\n\t * __isset() magic method for properties formerly returned by current_theme_info()\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $offset Property to check if set.\n\t * @return bool Whether the given property is set.\n\t */\n\tpublic function __isset( $offset ) {\n\t\tstatic $properties = array(\n\t\t\t'name',\n\t\t\t'title',\n\t\t\t'version',\n\t\t\t'parent_theme',\n\t\t\t'template_dir',\n\t\t\t'stylesheet_dir',\n\t\t\t'template',\n\t\t\t'stylesheet',\n\t\t\t'screenshot',\n\t\t\t'description',\n\t\t\t'author',\n\t\t\t'tags',\n\t\t\t'theme_root',\n\t\t\t'theme_root_uri',\n\t\t);\n\n\t\treturn in_array( $offset, $properties, true );\n\t}\n\n\t/**\n\t * __get() magic method for properties formerly returned by current_theme_info()\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $offset Property to get.\n\t * @return mixed Property value.\n\t */\n\tpublic function __get( $offset ) {\n\t\tswitch ( $offset ) {\n\t\t\tcase 'name':\n\t\t\tcase 'title':\n\t\t\t\treturn $this->get( 'Name' );\n\t\t\tcase 'version':\n\t\t\t\treturn $this->get( 'Version' );\n\t\t\tcase 'parent_theme':\n\t\t\t\treturn $this->parent() ? $this->parent()->get( 'Name' ) : '';\n\t\t\tcase 'template_dir':\n\t\t\t\treturn $this->get_template_directory();\n\t\t\tcase 'stylesheet_dir':\n\t\t\t\treturn $this->get_stylesheet_directory();\n\t\t\tcase 'template':\n\t\t\t\treturn $this->get_template();\n\t\t\tcase 'stylesheet':\n\t\t\t\treturn $this->get_stylesheet();\n\t\t\tcase 'screenshot':\n\t\t\t\treturn $this->get_screenshot( 'relative' );\n\t\t\t// 'author' and 'description' did not previously return translated data.\n\t\t\tcase 'description':\n\t\t\t\treturn $this->display( 'Description' );\n\t\t\tcase 'author':\n\t\t\t\treturn $this->display( 'Author' );\n\t\t\tcase 'tags':\n\t\t\t\treturn $this->get( 'Tags' );\n\t\t\tcase 'theme_root':\n\t\t\t\treturn $this->get_theme_root();\n\t\t\tcase 'theme_root_uri':\n\t\t\t\treturn $this->get_theme_root_uri();\n\t\t\t// For cases where the array was converted to an object.\n\t\t\tdefault:\n\t\t\t\treturn $this->offsetGet( $offset );\n\t\t}\n\t}\n\n\t/**\n\t * Method to implement ArrayAccess for keys formerly returned by get_themes()\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param mixed $offset\n\t * @param mixed $value\n\t */\n\tpublic function offsetSet( $offset, $value ) {}\n\n\t/**\n\t * Method to implement ArrayAccess for keys formerly returned by get_themes()\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param mixed $offset\n\t */\n\tpublic function offsetUnset( $offset ) {}\n\n\t/**\n\t * Method to implement ArrayAccess for keys formerly returned by get_themes()\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param mixed $offset\n\t * @return bool\n\t */\n\tpublic function offsetExists( $offset ) {\n\t\tstatic $keys = array(\n\t\t\t'Name',\n\t\t\t'Version',\n\t\t\t'Status',\n\t\t\t'Title',\n\t\t\t'Author',\n\t\t\t'Author Name',\n\t\t\t'Author URI',\n\t\t\t'Description',\n\t\t\t'Template',\n\t\t\t'Stylesheet',\n\t\t\t'Template Files',\n\t\t\t'Stylesheet Files',\n\t\t\t'Template Dir',\n\t\t\t'Stylesheet Dir',\n\t\t\t'Screenshot',\n\t\t\t'Tags',\n\t\t\t'Theme Root',\n\t\t\t'Theme Root URI',\n\t\t\t'Parent Theme',\n\t\t);\n\n\t\treturn in_array( $offset, $keys, true );\n\t}\n\n\t/**\n\t * Method to implement ArrayAccess for keys formerly returned by get_themes().\n\t *\n\t * Author, Author Name, Author URI, and Description did not previously return\n\t * translated data. We are doing so now as it is safe to do. However, as\n\t * Name and Title could have been used as the key for get_themes(), both remain\n\t * untranslated for back compatibility. This means that ['Name'] is not ideal,\n\t * and care should be taken to use `$theme::display( 'Name' )` to get a properly\n\t * translated header.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param mixed $offset\n\t * @return mixed\n\t */\n\tpublic function offsetGet( $offset ) {\n\t\tswitch ( $offset ) {\n\t\t\tcase 'Name':\n\t\t\tcase 'Title':\n\t\t\t\t/*\n\t\t\t\t * See note above about using translated data. get() is not ideal.\n\t\t\t\t * It is only for backward compatibility. Use display().\n\t\t\t\t */\n\t\t\t\treturn $this->get( 'Name' );\n\t\t\tcase 'Author':\n\t\t\t\treturn $this->display( 'Author' );\n\t\t\tcase 'Author Name':\n\t\t\t\treturn $this->display( 'Author', false );\n\t\t\tcase 'Author URI':\n\t\t\t\treturn $this->display( 'AuthorURI' );\n\t\t\tcase 'Description':\n\t\t\t\treturn $this->display( 'Description' );\n\t\t\tcase 'Version':\n\t\t\tcase 'Status':\n\t\t\t\treturn $this->get( $offset );\n\t\t\tcase 'Template':\n\t\t\t\treturn $this->get_template();\n\t\t\tcase 'Stylesheet':\n\t\t\t\treturn $this->get_stylesheet();\n\t\t\tcase 'Template Files':\n\t\t\t\treturn $this->get_files( 'php', 1, true );\n\t\t\tcase 'Stylesheet Files':\n\t\t\t\treturn $this->get_files( 'css', 0, false );\n\t\t\tcase 'Template Dir':\n\t\t\t\treturn $this->get_template_directory();\n\t\t\tcase 'Stylesheet Dir':\n\t\t\t\treturn $this->get_stylesheet_directory();\n\t\t\tcase 'Screenshot':\n\t\t\t\treturn $this->get_screenshot( 'relative' );\n\t\t\tcase 'Tags':\n\t\t\t\treturn $this->get( 'Tags' );\n\t\t\tcase 'Theme Root':\n\t\t\t\treturn $this->get_theme_root();\n\t\t\tcase 'Theme Root URI':\n\t\t\t\treturn $this->get_theme_root_uri();\n\t\t\tcase 'Parent Theme':\n\t\t\t\treturn $this->parent() ? $this->parent()->get( 'Name' ) : '';\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\t}\n\n\t/**\n\t * Returns errors property.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return WP_Error|false WP_Error if there are errors, or false.\n\t */\n\tpublic function errors() {\n\t\treturn is_wp_error( $this->errors ) ? $this->errors : false;\n\t}\n\n\t/**\n\t * Whether the theme exists.\n\t *\n\t * A theme with errors exists. A theme with the error of 'theme_not_found',\n\t * meaning that the theme's directory was not found, does not exist.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return bool Whether the theme exists.\n\t */\n\tpublic function exists() {\n\t\treturn ! ( $this->errors() && in_array( 'theme_not_found', $this->errors()->get_error_codes(), true ) );\n\t}\n\n\t/**\n\t * Returns reference to the parent theme.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return WP_Theme|false Parent theme, or false if the current theme is not a child theme.\n\t */\n\tpublic function parent() {\n\t\treturn isset( $this->parent ) ? $this->parent : false;\n\t}\n\n\t/**\n\t * Adds theme data to cache.\n\t *\n\t * Cache entries keyed by the theme and the type of data.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string       $key  Type of data to store (theme, screenshot, headers, post_templates)\n\t * @param array|string $data Data to store\n\t * @return bool Return value from wp_cache_add()\n\t */\n\tprivate function cache_add( $key, $data ) {\n\t\treturn wp_cache_add( $key . '-' . $this->cache_hash, $data, 'themes', self::$cache_expiration );\n\t}\n\n\t/**\n\t * Gets theme data from cache.\n\t *\n\t * Cache entries are keyed by the theme and the type of data.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $key Type of data to retrieve (theme, screenshot, headers, post_templates)\n\t * @return mixed Retrieved data\n\t */\n\tprivate function cache_get( $key ) {\n\t\treturn wp_cache_get( $key . '-' . $this->cache_hash, 'themes' );\n\t}\n\n\t/**\n\t * Clears the cache for the theme.\n\t *\n\t * @since 3.4.0\n\t */\n\tpublic function cache_delete() {\n\t\tforeach ( array( 'theme', 'screenshot', 'headers', 'post_templates' ) as $key ) {\n\t\t\twp_cache_delete( $key . '-' . $this->cache_hash, 'themes' );\n\t\t}\n\t\t$this->template          = null;\n\t\t$this->textdomain_loaded = null;\n\t\t$this->theme_root_uri    = null;\n\t\t$this->parent            = null;\n\t\t$this->errors            = null;\n\t\t$this->headers_sanitized = null;\n\t\t$this->name_translated   = null;\n\t\t$this->headers           = array();\n\t\t$this->__construct( $this->stylesheet, $this->theme_root );\n\t}\n\n\t/**\n\t * Get a raw, unformatted theme header.\n\t *\n\t * The header is sanitized, but is not translated, and is not marked up for display.\n\t * To get a theme header for display, use the display() method.\n\t *\n\t * Use the get_template() method, not the 'Template' header, for finding the template.\n\t * The 'Template' header is only good for what was written in the style.css, while\n\t * get_template() takes into account where WordPress actually located the theme and\n\t * whether it is actually valid.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.\n\t * @return string|array|false String or array (for Tags header) on success, false on failure.\n\t */\n\tpublic function get( $header ) {\n\t\tif ( ! isset( $this->headers[ $header ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! isset( $this->headers_sanitized ) ) {\n\t\t\t$this->headers_sanitized = $this->cache_get( 'headers' );\n\t\t\tif ( ! is_array( $this->headers_sanitized ) ) {\n\t\t\t\t$this->headers_sanitized = array();\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $this->headers_sanitized[ $header ] ) ) {\n\t\t\treturn $this->headers_sanitized[ $header ];\n\t\t}\n\n\t\t// If themes are a persistent group, sanitize everything and cache it. One cache add is better than many cache sets.\n\t\tif ( self::$persistently_cache ) {\n\t\t\tforeach ( array_keys( $this->headers ) as $_header ) {\n\t\t\t\t$this->headers_sanitized[ $_header ] = $this->sanitize_header( $_header, $this->headers[ $_header ] );\n\t\t\t}\n\t\t\t$this->cache_add( 'headers', $this->headers_sanitized );\n\t\t} else {\n\t\t\t$this->headers_sanitized[ $header ] = $this->sanitize_header( $header, $this->headers[ $header ] );\n\t\t}\n\n\t\treturn $this->headers_sanitized[ $header ];\n\t}\n\n\t/**\n\t * Gets a theme header, formatted and translated for display.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $header    Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.\n\t * @param bool   $markup    Optional. Whether to mark up the header. Defaults to true.\n\t * @param bool   $translate Optional. Whether to translate the header. Defaults to true.\n\t * @return string|array|false Processed header. An array for Tags if `$markup` is false, string otherwise.\n\t *                            False on failure.\n\t */\n\tpublic function display( $header, $markup = true, $translate = true ) {\n\t\t$value = $this->get( $header );\n\t\tif ( false === $value ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $translate && ( empty( $value ) || ! $this->load_textdomain() ) ) {\n\t\t\t$translate = false;\n\t\t}\n\n\t\tif ( $translate ) {\n\t\t\t$value = $this->translate_header( $header, $value );\n\t\t}\n\n\t\tif ( $markup ) {\n\t\t\t$value = $this->markup_header( $header, $value, $translate );\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Sanitize a theme header.\n\t *\n\t * @since 3.4.0\n\t * @since 5.4.0 Added support for `Requires at least` and `Requires PHP` headers.\n\t *\n\t * @param string $header Theme header. Accepts 'Name', 'Description', 'Author', 'Version',\n\t *                       'ThemeURI', 'AuthorURI', 'Status', 'Tags', 'RequiresWP', 'RequiresPHP'.\n\t * @param string $value  Value to sanitize.\n\t * @return string|array An array for Tags header, string otherwise.\n\t */\n\tprivate function sanitize_header( $header, $value ) {\n\t\tswitch ( $header ) {\n\t\t\tcase 'Status':\n\t\t\t\tif ( ! $value ) {\n\t\t\t\t\t$value = 'publish';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// Fall through otherwise.\n\t\t\tcase 'Name':\n\t\t\t\tstatic $header_tags = array(\n\t\t\t\t\t'abbr'    => array( 'title' => true ),\n\t\t\t\t\t'acronym' => array( 'title' => true ),\n\t\t\t\t\t'code'    => true,\n\t\t\t\t\t'em'      => true,\n\t\t\t\t\t'strong'  => true,\n\t\t\t\t);\n\n\t\t\t\t$value = wp_kses( $value, $header_tags );\n\t\t\t\tbreak;\n\t\t\tcase 'Author':\n\t\t\t\t// There shouldn't be anchor tags in Author, but some themes like to be challenging.\n\t\t\tcase 'Description':\n\t\t\t\tstatic $header_tags_with_a = array(\n\t\t\t\t\t'a'       => array(\n\t\t\t\t\t\t'href'  => true,\n\t\t\t\t\t\t'title' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'abbr'    => array( 'title' => true ),\n\t\t\t\t\t'acronym' => array( 'title' => true ),\n\t\t\t\t\t'code'    => true,\n\t\t\t\t\t'em'      => true,\n\t\t\t\t\t'strong'  => true,\n\t\t\t\t);\n\n\t\t\t\t$value = wp_kses( $value, $header_tags_with_a );\n\t\t\t\tbreak;\n\t\t\tcase 'ThemeURI':\n\t\t\tcase 'AuthorURI':\n\t\t\t\t$value = esc_url_raw( $value );\n\t\t\t\tbreak;\n\t\t\tcase 'Tags':\n\t\t\t\t$value = array_filter( array_map( 'trim', explode( ',', strip_tags( $value ) ) ) );\n\t\t\t\tbreak;\n\t\t\tcase 'Version':\n\t\t\tcase 'RequiresWP':\n\t\t\tcase 'RequiresPHP':\n\t\t\t\t$value = strip_tags( $value );\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Mark up a theme header.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string       $header    Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.\n\t * @param string|array $value     Value to mark up. An array for Tags header, string otherwise.\n\t * @param string       $translate Whether the header has been translated.\n\t * @return string Value, marked up.\n\t */\n\tprivate function markup_header( $header, $value, $translate ) {\n\t\tswitch ( $header ) {\n\t\t\tcase 'Name':\n\t\t\t\tif ( empty( $value ) ) {\n\t\t\t\t\t$value = esc_html( $this->get_stylesheet() );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Description':\n\t\t\t\t$value = wptexturize( $value );\n\t\t\t\tbreak;\n\t\t\tcase 'Author':\n\t\t\t\tif ( $this->get( 'AuthorURI' ) ) {\n\t\t\t\t\t$value = sprintf( '<a href=\"%1$s\">%2$s</a>', $this->display( 'AuthorURI', true, $translate ), $value );\n\t\t\t\t} elseif ( ! $value ) {\n\t\t\t\t\t$value = __( 'Anonymous' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Tags':\n\t\t\t\tstatic $comma = null;\n\t\t\t\tif ( ! isset( $comma ) ) {\n\t\t\t\t\t/* translators: Used between list items, there is a space after the comma. */\n\t\t\t\t\t$comma = __( ', ' );\n\t\t\t\t}\n\t\t\t\t$value = implode( $comma, $value );\n\t\t\t\tbreak;\n\t\t\tcase 'ThemeURI':\n\t\t\tcase 'AuthorURI':\n\t\t\t\t$value = esc_url( $value );\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Translate a theme header.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string       $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.\n\t * @param string|array $value  Value to translate. An array for Tags header, string otherwise.\n\t * @return string|array Translated value. An array for Tags header, string otherwise.\n\t */\n\tprivate function translate_header( $header, $value ) {\n\t\tswitch ( $header ) {\n\t\t\tcase 'Name':\n\t\t\t\t// Cached for sorting reasons.\n\t\t\t\tif ( isset( $this->name_translated ) ) {\n\t\t\t\t\treturn $this->name_translated;\n\t\t\t\t}\n\n\t\t\t\t// phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText,WordPress.WP.I18n.NonSingularStringLiteralDomain\n\t\t\t\t$this->name_translated = translate( $value, $this->get( 'TextDomain' ) );\n\n\t\t\t\treturn $this->name_translated;\n\t\t\tcase 'Tags':\n\t\t\t\tif ( empty( $value ) || ! function_exists( 'get_theme_feature_list' ) ) {\n\t\t\t\t\treturn $value;\n\t\t\t\t}\n\n\t\t\t\tstatic $tags_list;\n\t\t\t\tif ( ! isset( $tags_list ) ) {\n\t\t\t\t\t$tags_list = array(\n\t\t\t\t\t\t// As of 4.6, deprecated tags which are only used to provide translation for older themes.\n\t\t\t\t\t\t'black'             => __( 'Black' ),\n\t\t\t\t\t\t'blue'              => __( 'Blue' ),\n\t\t\t\t\t\t'brown'             => __( 'Brown' ),\n\t\t\t\t\t\t'gray'              => __( 'Gray' ),\n\t\t\t\t\t\t'green'             => __( 'Green' ),\n\t\t\t\t\t\t'orange'            => __( 'Orange' ),\n\t\t\t\t\t\t'pink'              => __( 'Pink' ),\n\t\t\t\t\t\t'purple'            => __( 'Purple' ),\n\t\t\t\t\t\t'red'               => __( 'Red' ),\n\t\t\t\t\t\t'silver'            => __( 'Silver' ),\n\t\t\t\t\t\t'tan'               => __( 'Tan' ),\n\t\t\t\t\t\t'white'             => __( 'White' ),\n\t\t\t\t\t\t'yellow'            => __( 'Yellow' ),\n\t\t\t\t\t\t'dark'              => __( 'Dark' ),\n\t\t\t\t\t\t'light'             => __( 'Light' ),\n\t\t\t\t\t\t'fixed-layout'      => __( 'Fixed Layout' ),\n\t\t\t\t\t\t'fluid-layout'      => __( 'Fluid Layout' ),\n\t\t\t\t\t\t'responsive-layout' => __( 'Responsive Layout' ),\n\t\t\t\t\t\t'blavatar'          => __( 'Blavatar' ),\n\t\t\t\t\t\t'photoblogging'     => __( 'Photoblogging' ),\n\t\t\t\t\t\t'seasonal'          => __( 'Seasonal' ),\n\t\t\t\t\t);\n\n\t\t\t\t\t$feature_list = get_theme_feature_list( false ); // No API.\n\n\t\t\t\t\tforeach ( $feature_list as $tags ) {\n\t\t\t\t\t\t$tags_list += $tags;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tforeach ( $value as &$tag ) {\n\t\t\t\t\tif ( isset( $tags_list[ $tag ] ) ) {\n\t\t\t\t\t\t$tag = $tags_list[ $tag ];\n\t\t\t\t\t} elseif ( isset( self::$tag_map[ $tag ] ) ) {\n\t\t\t\t\t\t$tag = $tags_list[ self::$tag_map[ $tag ] ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn $value;\n\n\t\t\tdefault:\n\t\t\t\t// phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText,WordPress.WP.I18n.NonSingularStringLiteralDomain\n\t\t\t\t$value = translate( $value, $this->get( 'TextDomain' ) );\n\t\t}\n\t\treturn $value;\n\t}\n\n\t/**\n\t * The directory name of the theme's \"stylesheet\" files, inside the theme root.\n\t *\n\t * In the case of a child theme, this is directory name of the child theme.\n\t * Otherwise, get_stylesheet() is the same as get_template().\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return string Stylesheet\n\t */\n\tpublic function get_stylesheet() {\n\t\treturn $this->stylesheet;\n\t}\n\n\t/**\n\t * The directory name of the theme's \"template\" files, inside the theme root.\n\t *\n\t * In the case of a child theme, this is the directory name of the parent theme.\n\t * Otherwise, the get_template() is the same as get_stylesheet().\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return string Template\n\t */\n\tpublic function get_template() {\n\t\treturn $this->template;\n\t}\n\n\t/**\n\t * Returns the absolute path to the directory of a theme's \"stylesheet\" files.\n\t *\n\t * In the case of a child theme, this is the absolute path to the directory\n\t * of the child theme's files.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return string Absolute path of the stylesheet directory.\n\t */\n\tpublic function get_stylesheet_directory() {\n\t\tif ( $this->errors() && in_array( 'theme_root_missing', $this->errors()->get_error_codes(), true ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $this->theme_root . '/' . $this->stylesheet;\n\t}\n\n\t/**\n\t * Returns the absolute path to the directory of a theme's \"template\" files.\n\t *\n\t * In the case of a child theme, this is the absolute path to the directory\n\t * of the parent theme's files.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return string Absolute path of the template directory.\n\t */\n\tpublic function get_template_directory() {\n\t\tif ( $this->parent() ) {\n\t\t\t$theme_root = $this->parent()->theme_root;\n\t\t} else {\n\t\t\t$theme_root = $this->theme_root;\n\t\t}\n\n\t\treturn $theme_root . '/' . $this->template;\n\t}\n\n\t/**\n\t * Returns the URL to the directory of a theme's \"stylesheet\" files.\n\t *\n\t * In the case of a child theme, this is the URL to the directory of the\n\t * child theme's files.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return string URL to the stylesheet directory.\n\t */\n\tpublic function get_stylesheet_directory_uri() {\n\t\treturn $this->get_theme_root_uri() . '/' . str_replace( '%2F', '/', rawurlencode( $this->stylesheet ) );\n\t}\n\n\t/**\n\t * Returns the URL to the directory of a theme's \"template\" files.\n\t *\n\t * In the case of a child theme, this is the URL to the directory of the\n\t * parent theme's files.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return string URL to the template directory.\n\t */\n\tpublic function get_template_directory_uri() {\n\t\tif ( $this->parent() ) {\n\t\t\t$theme_root_uri = $this->parent()->get_theme_root_uri();\n\t\t} else {\n\t\t\t$theme_root_uri = $this->get_theme_root_uri();\n\t\t}\n\n\t\treturn $theme_root_uri . '/' . str_replace( '%2F', '/', rawurlencode( $this->template ) );\n\t}\n\n\t/**\n\t * The absolute path to the directory of the theme root.\n\t *\n\t * This is typically the absolute path to wp-content/themes.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return string Theme root.\n\t */\n\tpublic function get_theme_root() {\n\t\treturn $this->theme_root;\n\t}\n\n\t/**\n\t * Returns the URL to the directory of the theme root.\n\t *\n\t * This is typically the absolute URL to wp-content/themes. This forms the basis\n\t * for all other URLs returned by WP_Theme, so we pass it to the public function\n\t * get_theme_root_uri() and allow it to run the {@see 'theme_root_uri'} filter.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return string Theme root URI.\n\t */\n\tpublic function get_theme_root_uri() {\n\t\tif ( ! isset( $this->theme_root_uri ) ) {\n\t\t\t$this->theme_root_uri = get_theme_root_uri( $this->stylesheet, $this->theme_root );\n\t\t}\n\t\treturn $this->theme_root_uri;\n\t}\n\n\t/**\n\t * Returns the main screenshot file for the theme.\n\t *\n\t * The main screenshot is called screenshot.png. gif and jpg extensions are also allowed.\n\t *\n\t * Screenshots for a theme must be in the stylesheet directory. (In the case of child\n\t * themes, parent theme screenshots are not inherited.)\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $uri Type of URL to return, either 'relative' or an absolute URI. Defaults to absolute URI.\n\t * @return string|false Screenshot file. False if the theme does not have a screenshot.\n\t */\n\tpublic function get_screenshot( $uri = 'uri' ) {\n\t\t$screenshot = $this->cache_get( 'screenshot' );\n\t\tif ( $screenshot ) {\n\t\t\tif ( 'relative' === $uri ) {\n\t\t\t\treturn $screenshot;\n\t\t\t}\n\t\t\treturn $this->get_stylesheet_directory_uri() . '/' . $screenshot;\n\t\t} elseif ( 0 === $screenshot ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ( array( 'png', 'gif', 'jpg', 'jpeg' ) as $ext ) {\n\t\t\tif ( file_exists( $this->get_stylesheet_directory() . \"/screenshot.$ext\" ) ) {\n\t\t\t\t$this->cache_add( 'screenshot', 'screenshot.' . $ext );\n\t\t\t\tif ( 'relative' === $uri ) {\n\t\t\t\t\treturn 'screenshot.' . $ext;\n\t\t\t\t}\n\t\t\t\treturn $this->get_stylesheet_directory_uri() . '/' . 'screenshot.' . $ext;\n\t\t\t}\n\t\t}\n\n\t\t$this->cache_add( 'screenshot', 0 );\n\t\treturn false;\n\t}\n\n\t/**\n\t * Return files in the theme's directory.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string[]|string $type          Optional. Array of extensions to find, string of a single extension,\n\t *                                       or null for all extensions. Default null.\n\t * @param int             $depth         Optional. How deep to search for files. Defaults to a flat scan (0 depth).\n\t *                                       -1 depth is infinite.\n\t * @param bool            $search_parent Optional. Whether to return parent files. Default false.\n\t * @return string[] Array of files, keyed by the path to the file relative to the theme's directory, with the values\n\t *                  being absolute paths.\n\t */\n\tpublic function get_files( $type = null, $depth = 0, $search_parent = false ) {\n\t\t$files = (array) self::scandir( $this->get_stylesheet_directory(), $type, $depth );\n\n\t\tif ( $search_parent && $this->parent() ) {\n\t\t\t$files += (array) self::scandir( $this->get_template_directory(), $type, $depth );\n\t\t}\n\n\t\treturn $files;\n\t}\n\n\t/**\n\t * Returns the theme's post templates.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return string[] Array of page templates, keyed by filename and post type,\n\t *                  with the value of the translated header name.\n\t */\n\tpublic function get_post_templates() {\n\t\t// If you screw up your current theme and we invalidate your parent, most things still work. Let it slide.\n\t\tif ( $this->errors() && $this->errors()->get_error_codes() !== array( 'theme_parent_invalid' ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$post_templates = $this->cache_get( 'post_templates' );\n\n\t\tif ( ! is_array( $post_templates ) ) {\n\t\t\t$post_templates = array();\n\n\t\t\t$files = (array) $this->get_files( 'php', 1, true );\n\n\t\t\tforeach ( $files as $file => $full_path ) {\n\t\t\t\tif ( ! preg_match( '|Template Name:(.*)$|mi', file_get_contents( $full_path ), $header ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$types = array( 'page' );\n\t\t\t\tif ( preg_match( '|Template Post Type:(.*)$|mi', file_get_contents( $full_path ), $type ) ) {\n\t\t\t\t\t$types = explode( ',', _cleanup_header_comment( $type[1] ) );\n\t\t\t\t}\n\n\t\t\t\tforeach ( $types as $type ) {\n\t\t\t\t\t$type = sanitize_key( $type );\n\t\t\t\t\tif ( ! isset( $post_templates[ $type ] ) ) {\n\t\t\t\t\t\t$post_templates[ $type ] = array();\n\t\t\t\t\t}\n\n\t\t\t\t\t$post_templates[ $type ][ $file ] = _cleanup_header_comment( $header[1] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->cache_add( 'post_templates', $post_templates );\n\t\t}\n\n\t\tif ( $this->load_textdomain() ) {\n\t\t\tforeach ( $post_templates as &$post_type ) {\n\t\t\t\tforeach ( $post_type as &$post_template ) {\n\t\t\t\t\t$post_template = $this->translate_header( 'Template Name', $post_template );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $post_templates;\n\t}\n\n\t/**\n\t * Returns the theme's post templates for a given post type.\n\t *\n\t * @since 3.4.0\n\t * @since 4.7.0 Added the `$post_type` parameter.\n\t *\n\t * @param WP_Post|null $post      Optional. The post being edited, provided for context.\n\t * @param string       $post_type Optional. Post type to get the templates for. Default 'page'.\n\t *                                If a post is provided, its post type is used.\n\t * @return string[] Array of template header names keyed by the template file name.\n\t */\n\tpublic function get_page_templates( $post = null, $post_type = 'page' ) {\n\t\tif ( $post ) {\n\t\t\t$post_type = get_post_type( $post );\n\t\t}\n\n\t\t$post_templates = $this->get_post_templates();\n\t\t$post_templates = isset( $post_templates[ $post_type ] ) ? $post_templates[ $post_type ] : array();\n\n\t\t/**\n\t\t * Filters list of page templates for a theme.\n\t\t *\n\t\t * @since 4.9.6\n\t\t *\n\t\t * @param string[]     $post_templates Array of template header names keyed by the template file name.\n\t\t * @param WP_Theme     $this           The theme object.\n\t\t * @param WP_Post|null $post           The post being edited, provided for context, or null.\n\t\t * @param string       $post_type      Post type to get the templates for.\n\t\t */\n\t\t$post_templates = (array) apply_filters( 'theme_templates', $post_templates, $this, $post, $post_type );\n\n\t\t/**\n\t\t * Filters list of page templates for a theme.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$post_type`, refers to the post type.\n\t\t *\n\t\t * @since 3.9.0\n\t\t * @since 4.4.0 Converted to allow complete control over the `$page_templates` array.\n\t\t * @since 4.7.0 Added the `$post_type` parameter.\n\t\t *\n\t\t * @param string[]     $post_templates Array of template header names keyed by the template file name.\n\t\t * @param WP_Theme     $this           The theme object.\n\t\t * @param WP_Post|null $post           The post being edited, provided for context, or null.\n\t\t * @param string       $post_type      Post type to get the templates for.\n\t\t */\n\t\t$post_templates = (array) apply_filters( \"theme_{$post_type}_templates\", $post_templates, $this, $post, $post_type );\n\n\t\treturn $post_templates;\n\t}\n\n\t/**\n\t * Scans a directory for files of a certain extension.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string            $path          Absolute path to search.\n\t * @param array|string|null $extensions    Optional. Array of extensions to find, string of a single extension,\n\t *                                         or null for all extensions. Default null.\n\t * @param int               $depth         Optional. How many levels deep to search for files. Accepts 0, 1+, or\n\t *                                         -1 (infinite depth). Default 0.\n\t * @param string            $relative_path Optional. The basename of the absolute path. Used to control the\n\t *                                         returned path for the found files, particularly when this function\n\t *                                         recurses to lower depths. Default empty.\n\t * @return string[]|false Array of files, keyed by the path to the file relative to the `$path` directory prepended\n\t *                        with `$relative_path`, with the values being absolute paths. False otherwise.\n\t */\n\tprivate static function scandir( $path, $extensions = null, $depth = 0, $relative_path = '' ) {\n\t\tif ( ! is_dir( $path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $extensions ) {\n\t\t\t$extensions  = (array) $extensions;\n\t\t\t$_extensions = implode( '|', $extensions );\n\t\t}\n\n\t\t$relative_path = trailingslashit( $relative_path );\n\t\tif ( '/' === $relative_path ) {\n\t\t\t$relative_path = '';\n\t\t}\n\n\t\t$results = scandir( $path );\n\t\t$files   = array();\n\n\t\t/**\n\t\t * Filters the array of excluded directories and files while scanning theme folder.\n\t\t *\n\t\t * @since 4.7.4\n\t\t *\n\t\t * @param string[] $exclusions Array of excluded directories and files.\n\t\t */\n\t\t$exclusions = (array) apply_filters( 'theme_scandir_exclusions', array( 'CVS', 'node_modules', 'vendor', 'bower_components' ) );\n\n\t\tforeach ( $results as $result ) {\n\t\t\tif ( '.' === $result[0] || in_array( $result, $exclusions, true ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( is_dir( $path . '/' . $result ) ) {\n\t\t\t\tif ( ! $depth ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$found = self::scandir( $path . '/' . $result, $extensions, $depth - 1, $relative_path . $result );\n\t\t\t\t$files = array_merge_recursive( $files, $found );\n\t\t\t} elseif ( ! $extensions || preg_match( '~\\.(' . $_extensions . ')$~', $result ) ) {\n\t\t\t\t$files[ $relative_path . $result ] = $path . '/' . $result;\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}\n\n\t/**\n\t * Loads the theme's textdomain.\n\t *\n\t * Translation files are not inherited from the parent theme. TODO: If this fails for the\n\t * child theme, it should probably try to load the parent theme's translations.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return bool True if the textdomain was successfully loaded or has already been loaded.\n\t *  False if no textdomain was specified in the file headers, or if the domain could not be loaded.\n\t */\n\tpublic function load_textdomain() {\n\t\tif ( isset( $this->textdomain_loaded ) ) {\n\t\t\treturn $this->textdomain_loaded;\n\t\t}\n\n\t\t$textdomain = $this->get( 'TextDomain' );\n\t\tif ( ! $textdomain ) {\n\t\t\t$this->textdomain_loaded = false;\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( is_textdomain_loaded( $textdomain ) ) {\n\t\t\t$this->textdomain_loaded = true;\n\t\t\treturn true;\n\t\t}\n\n\t\t$path       = $this->get_stylesheet_directory();\n\t\t$domainpath = $this->get( 'DomainPath' );\n\t\tif ( $domainpath ) {\n\t\t\t$path .= $domainpath;\n\t\t} else {\n\t\t\t$path .= '/languages';\n\t\t}\n\n\t\t$this->textdomain_loaded = load_theme_textdomain( $textdomain, $path );\n\t\treturn $this->textdomain_loaded;\n\t}\n\n\t/**\n\t * Whether the theme is allowed (multisite only).\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $check   Optional. Whether to check only the 'network'-wide settings, the 'site'\n\t *                        settings, or 'both'. Defaults to 'both'.\n\t * @param int    $blog_id Optional. Ignored if only network-wide settings are checked. Defaults to current site.\n\t * @return bool Whether the theme is allowed for the network. Returns true in single-site.\n\t */\n\tpublic function is_allowed( $check = 'both', $blog_id = null ) {\n\t\tif ( ! is_multisite() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( 'both' === $check || 'network' === $check ) {\n\t\t\t$allowed = self::get_allowed_on_network();\n\t\t\tif ( ! empty( $allowed[ $this->get_stylesheet() ] ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ( 'both' === $check || 'site' === $check ) {\n\t\t\t$allowed = self::get_allowed_on_site( $blog_id );\n\t\t\tif ( ! empty( $allowed[ $this->get_stylesheet() ] ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Determines the latest WordPress default theme that is installed.\n\t *\n\t * This hits the filesystem.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return WP_Theme|false Object, or false if no theme is installed, which would be bad.\n\t */\n\tpublic static function get_core_default_theme() {\n\t\tforeach ( array_reverse( self::$default_themes ) as $slug => $name ) {\n\t\t\t$theme = wp_get_theme( $slug );\n\t\t\tif ( $theme->exists() ) {\n\t\t\t\treturn $theme;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Returns array of stylesheet names of themes allowed on the site or network.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param int $blog_id Optional. ID of the site. Defaults to the current site.\n\t * @return string[] Array of stylesheet names.\n\t */\n\tpublic static function get_allowed( $blog_id = null ) {\n\t\t/**\n\t\t * Filters the array of themes allowed on the network.\n\t\t *\n\t\t * Site is provided as context so that a list of network allowed themes can\n\t\t * be filtered further.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @param string[] $allowed_themes An array of theme stylesheet names.\n\t\t * @param int      $blog_id        ID of the site.\n\t\t */\n\t\t$network = (array) apply_filters( 'network_allowed_themes', self::get_allowed_on_network(), $blog_id );\n\t\treturn $network + self::get_allowed_on_site( $blog_id );\n\t}\n\n\t/**\n\t * Returns array of stylesheet names of themes allowed on the network.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return string[] Array of stylesheet names.\n\t */\n\tpublic static function get_allowed_on_network() {\n\t\tstatic $allowed_themes;\n\t\tif ( ! isset( $allowed_themes ) ) {\n\t\t\t$allowed_themes = (array) get_site_option( 'allowedthemes' );\n\t\t}\n\n\t\t/**\n\t\t * Filters the array of themes allowed on the network.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t *\n\t\t * @param string[] $allowed_themes An array of theme stylesheet names.\n\t\t */\n\t\t$allowed_themes = apply_filters( 'allowed_themes', $allowed_themes );\n\n\t\treturn $allowed_themes;\n\t}\n\n\t/**\n\t * Returns array of stylesheet names of themes allowed on the site.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param int $blog_id Optional. ID of the site. Defaults to the current site.\n\t * @return string[] Array of stylesheet names.\n\t */\n\tpublic static function get_allowed_on_site( $blog_id = null ) {\n\t\tstatic $allowed_themes = array();\n\n\t\tif ( ! $blog_id || ! is_multisite() ) {\n\t\t\t$blog_id = get_current_blog_id();\n\t\t}\n\n\t\tif ( isset( $allowed_themes[ $blog_id ] ) ) {\n\t\t\t/**\n\t\t\t * Filters the array of themes allowed on the site.\n\t\t\t *\n\t\t\t * @since 4.5.0\n\t\t\t *\n\t\t\t * @param string[] $allowed_themes An array of theme stylesheet names.\n\t\t\t * @param int      $blog_id        ID of the site. Defaults to current site.\n\t\t\t */\n\t\t\treturn (array) apply_filters( 'site_allowed_themes', $allowed_themes[ $blog_id ], $blog_id );\n\t\t}\n\n\t\t$current = get_current_blog_id() == $blog_id;\n\n\t\tif ( $current ) {\n\t\t\t$allowed_themes[ $blog_id ] = get_option( 'allowedthemes' );\n\t\t} else {\n\t\t\tswitch_to_blog( $blog_id );\n\t\t\t$allowed_themes[ $blog_id ] = get_option( 'allowedthemes' );\n\t\t\trestore_current_blog();\n\t\t}\n\n\t\t// This is all super old MU back compat joy.\n\t\t// 'allowedthemes' keys things by stylesheet. 'allowed_themes' keyed things by name.\n\t\tif ( false === $allowed_themes[ $blog_id ] ) {\n\t\t\tif ( $current ) {\n\t\t\t\t$allowed_themes[ $blog_id ] = get_option( 'allowed_themes' );\n\t\t\t} else {\n\t\t\t\tswitch_to_blog( $blog_id );\n\t\t\t\t$allowed_themes[ $blog_id ] = get_option( 'allowed_themes' );\n\t\t\t\trestore_current_blog();\n\t\t\t}\n\n\t\t\tif ( ! is_array( $allowed_themes[ $blog_id ] ) || empty( $allowed_themes[ $blog_id ] ) ) {\n\t\t\t\t$allowed_themes[ $blog_id ] = array();\n\t\t\t} else {\n\t\t\t\t$converted = array();\n\t\t\t\t$themes    = wp_get_themes();\n\t\t\t\tforeach ( $themes as $stylesheet => $theme_data ) {\n\t\t\t\t\tif ( isset( $allowed_themes[ $blog_id ][ $theme_data->get( 'Name' ) ] ) ) {\n\t\t\t\t\t\t$converted[ $stylesheet ] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$allowed_themes[ $blog_id ] = $converted;\n\t\t\t}\n\t\t\t// Set the option so we never have to go through this pain again.\n\t\t\tif ( is_admin() && $allowed_themes[ $blog_id ] ) {\n\t\t\t\tif ( $current ) {\n\t\t\t\t\tupdate_option( 'allowedthemes', $allowed_themes[ $blog_id ] );\n\t\t\t\t\tdelete_option( 'allowed_themes' );\n\t\t\t\t} else {\n\t\t\t\t\tswitch_to_blog( $blog_id );\n\t\t\t\t\tupdate_option( 'allowedthemes', $allowed_themes[ $blog_id ] );\n\t\t\t\t\tdelete_option( 'allowed_themes' );\n\t\t\t\t\trestore_current_blog();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/class-wp-theme.php */\n\t\treturn (array) apply_filters( 'site_allowed_themes', $allowed_themes[ $blog_id ], $blog_id );\n\t}\n\n\t/**\n\t * Enables a theme for all sites on the current network.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string|string[] $stylesheets Stylesheet name or array of stylesheet names.\n\t */\n\tpublic static function network_enable_theme( $stylesheets ) {\n\t\tif ( ! is_multisite() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! is_array( $stylesheets ) ) {\n\t\t\t$stylesheets = array( $stylesheets );\n\t\t}\n\n\t\t$allowed_themes = get_site_option( 'allowedthemes' );\n\t\tforeach ( $stylesheets as $stylesheet ) {\n\t\t\t$allowed_themes[ $stylesheet ] = true;\n\t\t}\n\n\t\tupdate_site_option( 'allowedthemes', $allowed_themes );\n\t}\n\n\t/**\n\t * Disables a theme for all sites on the current network.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string|string[] $stylesheets Stylesheet name or array of stylesheet names.\n\t */\n\tpublic static function network_disable_theme( $stylesheets ) {\n\t\tif ( ! is_multisite() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! is_array( $stylesheets ) ) {\n\t\t\t$stylesheets = array( $stylesheets );\n\t\t}\n\n\t\t$allowed_themes = get_site_option( 'allowedthemes' );\n\t\tforeach ( $stylesheets as $stylesheet ) {\n\t\t\tif ( isset( $allowed_themes[ $stylesheet ] ) ) {\n\t\t\t\tunset( $allowed_themes[ $stylesheet ] );\n\t\t\t}\n\t\t}\n\n\t\tupdate_site_option( 'allowedthemes', $allowed_themes );\n\t}\n\n\t/**\n\t * Sorts themes by name.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param WP_Theme[] $themes Array of theme objects to sort (passed by reference).\n\t */\n\tpublic static function sort_by_name( &$themes ) {\n\t\tif ( 0 === strpos( get_user_locale(), 'en_' ) ) {\n\t\t\tuasort( $themes, array( 'WP_Theme', '_name_sort' ) );\n\t\t} else {\n\t\t\tforeach ( $themes as $key => $theme ) {\n\t\t\t\t$theme->translate_header( 'Name', $theme->headers['Name'] );\n\t\t\t}\n\t\t\tuasort( $themes, array( 'WP_Theme', '_name_sort_i18n' ) );\n\t\t}\n\t}\n\n\t/**\n\t * Callback function for usort() to naturally sort themes by name.\n\t *\n\t * Accesses the Name header directly from the class for maximum speed.\n\t * Would choke on HTML but we don't care enough to slow it down with strip_tags().\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param WP_Theme $a First theme.\n\t * @param WP_Theme $b Second theme.\n\t * @return int Negative if `$a` falls lower in the natural order than `$b`. Zero if they fall equally.\n\t *             Greater than 0 if `$a` falls higher in the natural order than `$b`. Used with usort().\n\t */\n\tprivate static function _name_sort( $a, $b ) {\n\t\treturn strnatcasecmp( $a->headers['Name'], $b->headers['Name'] );\n\t}\n\n\t/**\n\t * Callback function for usort() to naturally sort themes by translated name.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param WP_Theme $a First theme.\n\t * @param WP_Theme $b Second theme.\n\t * @return int Negative if `$a` falls lower in the natural order than `$b`. Zero if they fall equally.\n\t *             Greater than 0 if `$a` falls higher in the natural order than `$b`. Used with usort().\n\t */\n\tprivate static function _name_sort_i18n( $a, $b ) {\n\t\treturn strnatcasecmp( $a->name_translated, $b->name_translated );\n\t}\n}\n", "num_lines": 1662}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Session API: WP_User_Meta_Session_Tokens class\n *\n * @package WordPress\n * @subpackage Session\n * @since 4.7.0\n */\n\n/**\n * Meta-based user sessions token manager.\n *\n * @since 4.0.0\n *\n * @see WP_Session_Tokens\n */\nclass WP_User_Meta_Session_Tokens extends WP_Session_Tokens {\n\n\t/**\n\t * Retrieves all sessions of the user.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @return array Sessions of the user.\n\t */\n\tprotected function get_sessions() {\n\t\t$sessions = get_user_meta( $this->user_id, 'session_tokens', true );\n\n\t\tif ( ! is_array( $sessions ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$sessions = array_map( array( $this, 'prepare_session' ), $sessions );\n\t\treturn array_filter( $sessions, array( $this, 'is_still_valid' ) );\n\t}\n\n\t/**\n\t * Converts an expiration to an array of session information.\n\t *\n\t * @param mixed $session Session or expiration.\n\t * @return array Session.\n\t */\n\tprotected function prepare_session( $session ) {\n\t\tif ( is_int( $session ) ) {\n\t\t\treturn array( 'expiration' => $session );\n\t\t}\n\n\t\treturn $session;\n\t}\n\n\t/**\n\t * Retrieves a session based on its verifier (token hash).\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $verifier Verifier for the session to retrieve.\n\t * @return array|null The session, or null if it does not exist\n\t */\n\tprotected function get_session( $verifier ) {\n\t\t$sessions = $this->get_sessions();\n\n\t\tif ( isset( $sessions[ $verifier ] ) ) {\n\t\t\treturn $sessions[ $verifier ];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Updates a session based on its verifier (token hash).\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $verifier Verifier for the session to update.\n\t * @param array  $session  Optional. Session. Omitting this argument destroys the session.\n\t */\n\tprotected function update_session( $verifier, $session = null ) {\n\t\t$sessions = $this->get_sessions();\n\n\t\tif ( $session ) {\n\t\t\t$sessions[ $verifier ] = $session;\n\t\t} else {\n\t\t\tunset( $sessions[ $verifier ] );\n\t\t}\n\n\t\t$this->update_sessions( $sessions );\n\t}\n\n\t/**\n\t * Updates the user's sessions in the usermeta table.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param array $sessions Sessions.\n\t */\n\tprotected function update_sessions( $sessions ) {\n\t\tif ( $sessions ) {\n\t\t\tupdate_user_meta( $this->user_id, 'session_tokens', $sessions );\n\t\t} else {\n\t\t\tdelete_user_meta( $this->user_id, 'session_tokens' );\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all sessions for this user, except the single session with the given verifier.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $verifier Verifier of the session to keep.\n\t */\n\tprotected function destroy_other_sessions( $verifier ) {\n\t\t$session = $this->get_session( $verifier );\n\t\t$this->update_sessions( array( $verifier => $session ) );\n\t}\n\n\t/**\n\t * Destroys all session tokens for the user.\n\t *\n\t * @since 4.0.0\n\t */\n\tprotected function destroy_all_sessions() {\n\t\t$this->update_sessions( array() );\n\t}\n\n\t/**\n\t * Destroys all sessions for all users.\n\t *\n\t * @since 4.0.0\n\t */\n\tpublic static function drop_sessions() {\n\t\tdelete_metadata( 'user', 0, 'session_tokens', false, true );\n\t}\n}\n", "num_lines": 134}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * User API: WP_User_Query class\n *\n * @package WordPress\n * @subpackage Users\n * @since 4.4.0\n */\n\n/**\n * Core class used for querying users.\n *\n * @since 3.1.0\n *\n * @see WP_User_Query::prepare_query() for information on accepted arguments.\n */\nclass WP_User_Query {\n\n\t/**\n\t * Query vars, after parsing\n\t *\n\t * @since 3.5.0\n\t * @var array\n\t */\n\tpublic $query_vars = array();\n\n\t/**\n\t * List of found user IDs.\n\t *\n\t * @since 3.1.0\n\t * @var array\n\t */\n\tprivate $results;\n\n\t/**\n\t * Total number of found users for the current query\n\t *\n\t * @since 3.1.0\n\t * @var int\n\t */\n\tprivate $total_users = 0;\n\n\t/**\n\t * Metadata query container.\n\t *\n\t * @since 4.2.0\n\t * @var WP_Meta_Query\n\t */\n\tpublic $meta_query = false;\n\n\t/**\n\t * The SQL query used to fetch matching users.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $request;\n\n\tprivate $compat_fields = array( 'results', 'total_users' );\n\n\t// SQL clauses.\n\tpublic $query_fields;\n\tpublic $query_from;\n\tpublic $query_where;\n\tpublic $query_orderby;\n\tpublic $query_limit;\n\n\t/**\n\t * PHP5 constructor.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param null|string|array $query Optional. The query variables.\n\t */\n\tpublic function __construct( $query = null ) {\n\t\tif ( ! empty( $query ) ) {\n\t\t\t$this->prepare_query( $query );\n\t\t\t$this->query();\n\t\t}\n\t}\n\n\t/**\n\t * Fills in missing query variables with default values.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $args Query vars, as passed to `WP_User_Query`.\n\t * @return array Complete query variables with undefined ones filled in with defaults.\n\t */\n\tpublic static function fill_query_vars( $args ) {\n\t\t$defaults = array(\n\t\t\t'blog_id'             => get_current_blog_id(),\n\t\t\t'role'                => '',\n\t\t\t'role__in'            => array(),\n\t\t\t'role__not_in'        => array(),\n\t\t\t'meta_key'            => '',\n\t\t\t'meta_value'          => '',\n\t\t\t'meta_compare'        => '',\n\t\t\t'include'             => array(),\n\t\t\t'exclude'             => array(),\n\t\t\t'search'              => '',\n\t\t\t'search_columns'      => array(),\n\t\t\t'orderby'             => 'login',\n\t\t\t'order'               => 'ASC',\n\t\t\t'offset'              => '',\n\t\t\t'number'              => '',\n\t\t\t'paged'               => 1,\n\t\t\t'count_total'         => true,\n\t\t\t'fields'              => 'all',\n\t\t\t'who'                 => '',\n\t\t\t'has_published_posts' => null,\n\t\t\t'nicename'            => '',\n\t\t\t'nicename__in'        => array(),\n\t\t\t'nicename__not_in'    => array(),\n\t\t\t'login'               => '',\n\t\t\t'login__in'           => array(),\n\t\t\t'login__not_in'       => array(),\n\t\t);\n\n\t\treturn wp_parse_args( $args, $defaults );\n\t}\n\n\t/**\n\t * Prepare the query variables.\n\t *\n\t * @since 3.1.0\n\t * @since 4.1.0 Added the ability to order by the `include` value.\n\t * @since 4.2.0 Added 'meta_value_num' support for `$orderby` parameter. Added multi-dimensional array syntax\n\t *              for `$orderby` parameter.\n\t * @since 4.3.0 Added 'has_published_posts' parameter.\n\t * @since 4.4.0 Added 'paged', 'role__in', and 'role__not_in' parameters. The 'role' parameter was updated to\n\t *              permit an array or comma-separated list of values. The 'number' parameter was updated to support\n\t *              querying for all users with using -1.\n\t * @since 4.7.0 Added 'nicename', 'nicename__in', 'nicename__not_in', 'login', 'login__in',\n\t *              and 'login__not_in' parameters.\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t * @global int  $blog_id\n\t *\n\t * @param string|array $query {\n\t *     Optional. Array or string of Query parameters.\n\t *\n\t *     @type int          $blog_id             The site ID. Default is the current site.\n\t *     @type string|array $role                An array or a comma-separated list of role names that users must match\n\t *                                             to be included in results. Note that this is an inclusive list: users\n\t *                                             must match *each* role. Default empty.\n\t *     @type array        $role__in            An array of role names. Matched users must have at least one of these\n\t *                                             roles. Default empty array.\n\t *     @type array        $role__not_in        An array of role names to exclude. Users matching one or more of these\n\t *                                             roles will not be included in results. Default empty array.\n\t *     @type string       $meta_key            User meta key. Default empty.\n\t *     @type string       $meta_value          User meta value. Default empty.\n\t *     @type string       $meta_compare        Comparison operator to test the `$meta_value`. Accepts '=', '!=',\n\t *                                             '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN',\n\t *                                             'BETWEEN', 'NOT BETWEEN', 'EXISTS', 'NOT EXISTS', 'REGEXP',\n\t *                                             'NOT REGEXP', or 'RLIKE'. Default '='.\n\t *     @type array        $include             An array of user IDs to include. Default empty array.\n\t *     @type array        $exclude             An array of user IDs to exclude. Default empty array.\n\t *     @type string       $search              Search keyword. Searches for possible string matches on columns.\n\t *                                             When `$search_columns` is left empty, it tries to determine which\n\t *                                             column to search in based on search string. Default empty.\n\t *     @type array        $search_columns      Array of column names to be searched. Accepts 'ID', 'user_login',\n\t *                                             'user_email', 'user_url', 'user_nicename', 'display_name'.\n\t *                                             Default empty array.\n\t *     @type string|array $orderby             Field(s) to sort the retrieved users by. May be a single value,\n\t *                                             an array of values, or a multi-dimensional array with fields as\n\t *                                             keys and orders ('ASC' or 'DESC') as values. Accepted values are\n\t *                                             'ID', 'display_name' (or 'name'), 'include', 'user_login'\n\t *                                             (or 'login'), 'login__in', 'user_nicename' (or 'nicename'),\n\t *                                             'nicename__in', 'user_email (or 'email'), 'user_url' (or 'url'),\n\t *                                             'user_registered' (or 'registered'), 'post_count', 'meta_value',\n\t *                                             'meta_value_num', the value of `$meta_key`, or an array key of\n\t *                                             `$meta_query`. To use 'meta_value' or 'meta_value_num', `$meta_key`\n\t *                                             must be also be defined. Default 'user_login'.\n\t *     @type string       $order               Designates ascending or descending order of users. Order values\n\t *                                             passed as part of an `$orderby` array take precedence over this\n\t *                                             parameter. Accepts 'ASC', 'DESC'. Default 'ASC'.\n\t *     @type int          $offset              Number of users to offset in retrieved results. Can be used in\n\t *                                             conjunction with pagination. Default 0.\n\t *     @type int          $number              Number of users to limit the query for. Can be used in\n\t *                                             conjunction with pagination. Value -1 (all) is supported, but\n\t *                                             should be used with caution on larger sites.\n\t *                                             Default -1 (all users).\n\t *     @type int          $paged               When used with number, defines the page of results to return.\n\t *                                             Default 1.\n\t *     @type bool         $count_total         Whether to count the total number of users found. If pagination\n\t *                                             is not needed, setting this to false can improve performance.\n\t *                                             Default true.\n\t *     @type string|array $fields              Which fields to return. Single or all fields (string), or array\n\t *                                             of fields. Accepts 'ID', 'display_name', 'user_login',\n\t *                                             'user_nicename', 'user_email', 'user_url', 'user_registered'.\n\t *                                             Use 'all' for all fields and 'all_with_meta' to include\n\t *                                             meta fields. Default 'all'.\n\t *     @type string       $who                 Type of users to query. Accepts 'authors'.\n\t *                                             Default empty (all users).\n\t *     @type bool|array   $has_published_posts Pass an array of post types to filter results to users who have\n\t *                                             published posts in those post types. `true` is an alias for all\n\t *                                             public post types.\n\t *     @type string       $nicename            The user nicename. Default empty.\n\t *     @type array        $nicename__in        An array of nicenames to include. Users matching one of these\n\t *                                             nicenames will be included in results. Default empty array.\n\t *     @type array        $nicename__not_in    An array of nicenames to exclude. Users matching one of these\n\t *                                             nicenames will not be included in results. Default empty array.\n\t *     @type string       $login               The user login. Default empty.\n\t *     @type array        $login__in           An array of logins to include. Users matching one of these\n\t *                                             logins will be included in results. Default empty array.\n\t *     @type array        $login__not_in       An array of logins to exclude. Users matching one of these\n\t *                                             logins will not be included in results. Default empty array.\n\t * }\n\t */\n\tpublic function prepare_query( $query = array() ) {\n\t\tglobal $wpdb;\n\n\t\tif ( empty( $this->query_vars ) || ! empty( $query ) ) {\n\t\t\t$this->query_limit = null;\n\t\t\t$this->query_vars  = $this->fill_query_vars( $query );\n\t\t}\n\n\t\t/**\n\t\t * Fires before the WP_User_Query has been parsed.\n\t\t *\n\t\t * The passed WP_User_Query object contains the query variables, not\n\t\t * yet passed into SQL.\n\t\t *\n\t\t * @since 4.0.0\n\t\t *\n\t\t * @param WP_User_Query $this The current WP_User_Query instance,\n\t\t *                            passed by reference.\n\t\t */\n\t\tdo_action( 'pre_get_users', $this );\n\n\t\t// Ensure that query vars are filled after 'pre_get_users'.\n\t\t$qv =& $this->query_vars;\n\t\t$qv = $this->fill_query_vars( $qv );\n\n\t\tif ( is_array( $qv['fields'] ) ) {\n\t\t\t$qv['fields'] = array_unique( $qv['fields'] );\n\n\t\t\t$this->query_fields = array();\n\t\t\tforeach ( $qv['fields'] as $field ) {\n\t\t\t\t$field                = 'ID' === $field ? 'ID' : sanitize_key( $field );\n\t\t\t\t$this->query_fields[] = \"$wpdb->users.$field\";\n\t\t\t}\n\t\t\t$this->query_fields = implode( ',', $this->query_fields );\n\t\t} elseif ( 'all' === $qv['fields'] ) {\n\t\t\t$this->query_fields = \"$wpdb->users.*\";\n\t\t} else {\n\t\t\t$this->query_fields = \"$wpdb->users.ID\";\n\t\t}\n\n\t\tif ( isset( $qv['count_total'] ) && $qv['count_total'] ) {\n\t\t\t$this->query_fields = 'SQL_CALC_FOUND_ROWS ' . $this->query_fields;\n\t\t}\n\n\t\t$this->query_from  = \"FROM $wpdb->users\";\n\t\t$this->query_where = 'WHERE 1=1';\n\n\t\t// Parse and sanitize 'include', for use by 'orderby' as well as 'include' below.\n\t\tif ( ! empty( $qv['include'] ) ) {\n\t\t\t$include = wp_parse_id_list( $qv['include'] );\n\t\t} else {\n\t\t\t$include = false;\n\t\t}\n\n\t\t$blog_id = 0;\n\t\tif ( isset( $qv['blog_id'] ) ) {\n\t\t\t$blog_id = absint( $qv['blog_id'] );\n\t\t}\n\n\t\tif ( $qv['has_published_posts'] && $blog_id ) {\n\t\t\tif ( true === $qv['has_published_posts'] ) {\n\t\t\t\t$post_types = get_post_types( array( 'public' => true ) );\n\t\t\t} else {\n\t\t\t\t$post_types = (array) $qv['has_published_posts'];\n\t\t\t}\n\n\t\t\tforeach ( $post_types as &$post_type ) {\n\t\t\t\t$post_type = $wpdb->prepare( '%s', $post_type );\n\t\t\t}\n\n\t\t\t$posts_table        = $wpdb->get_blog_prefix( $blog_id ) . 'posts';\n\t\t\t$this->query_where .= \" AND $wpdb->users.ID IN ( SELECT DISTINCT $posts_table.post_author FROM $posts_table WHERE $posts_table.post_status = 'publish' AND $posts_table.post_type IN ( \" . join( ', ', $post_types ) . ' ) )';\n\t\t}\n\n\t\t// nicename\n\t\tif ( '' !== $qv['nicename'] ) {\n\t\t\t$this->query_where .= $wpdb->prepare( ' AND user_nicename = %s', $qv['nicename'] );\n\t\t}\n\n\t\tif ( ! empty( $qv['nicename__in'] ) ) {\n\t\t\t$sanitized_nicename__in = array_map( 'esc_sql', $qv['nicename__in'] );\n\t\t\t$nicename__in           = implode( \"','\", $sanitized_nicename__in );\n\t\t\t$this->query_where     .= \" AND user_nicename IN ( '$nicename__in' )\";\n\t\t}\n\n\t\tif ( ! empty( $qv['nicename__not_in'] ) ) {\n\t\t\t$sanitized_nicename__not_in = array_map( 'esc_sql', $qv['nicename__not_in'] );\n\t\t\t$nicename__not_in           = implode( \"','\", $sanitized_nicename__not_in );\n\t\t\t$this->query_where         .= \" AND user_nicename NOT IN ( '$nicename__not_in' )\";\n\t\t}\n\n\t\t// login\n\t\tif ( '' !== $qv['login'] ) {\n\t\t\t$this->query_where .= $wpdb->prepare( ' AND user_login = %s', $qv['login'] );\n\t\t}\n\n\t\tif ( ! empty( $qv['login__in'] ) ) {\n\t\t\t$sanitized_login__in = array_map( 'esc_sql', $qv['login__in'] );\n\t\t\t$login__in           = implode( \"','\", $sanitized_login__in );\n\t\t\t$this->query_where  .= \" AND user_login IN ( '$login__in' )\";\n\t\t}\n\n\t\tif ( ! empty( $qv['login__not_in'] ) ) {\n\t\t\t$sanitized_login__not_in = array_map( 'esc_sql', $qv['login__not_in'] );\n\t\t\t$login__not_in           = implode( \"','\", $sanitized_login__not_in );\n\t\t\t$this->query_where      .= \" AND user_login NOT IN ( '$login__not_in' )\";\n\t\t}\n\n\t\t// Meta query.\n\t\t$this->meta_query = new WP_Meta_Query();\n\t\t$this->meta_query->parse_query_vars( $qv );\n\n\t\tif ( isset( $qv['who'] ) && 'authors' === $qv['who'] && $blog_id ) {\n\t\t\t$who_query = array(\n\t\t\t\t'key'     => $wpdb->get_blog_prefix( $blog_id ) . 'user_level',\n\t\t\t\t'value'   => 0,\n\t\t\t\t'compare' => '!=',\n\t\t\t);\n\n\t\t\t// Prevent extra meta query.\n\t\t\t$qv['blog_id'] = 0;\n\t\t\t$blog_id       = 0;\n\n\t\t\tif ( empty( $this->meta_query->queries ) ) {\n\t\t\t\t$this->meta_query->queries = array( $who_query );\n\t\t\t} else {\n\t\t\t\t// Append the cap query to the original queries and reparse the query.\n\t\t\t\t$this->meta_query->queries = array(\n\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t\tarray( $this->meta_query->queries, $who_query ),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$this->meta_query->parse_query_vars( $this->meta_query->queries );\n\t\t}\n\n\t\t$roles = array();\n\t\tif ( isset( $qv['role'] ) ) {\n\t\t\tif ( is_array( $qv['role'] ) ) {\n\t\t\t\t$roles = $qv['role'];\n\t\t\t} elseif ( is_string( $qv['role'] ) && ! empty( $qv['role'] ) ) {\n\t\t\t\t$roles = array_map( 'trim', explode( ',', $qv['role'] ) );\n\t\t\t}\n\t\t}\n\n\t\t$role__in = array();\n\t\tif ( isset( $qv['role__in'] ) ) {\n\t\t\t$role__in = (array) $qv['role__in'];\n\t\t}\n\n\t\t$role__not_in = array();\n\t\tif ( isset( $qv['role__not_in'] ) ) {\n\t\t\t$role__not_in = (array) $qv['role__not_in'];\n\t\t}\n\n\t\tif ( $blog_id && ( ! empty( $roles ) || ! empty( $role__in ) || ! empty( $role__not_in ) || is_multisite() ) ) {\n\t\t\t$role_queries = array();\n\n\t\t\t$roles_clauses = array( 'relation' => 'AND' );\n\t\t\tif ( ! empty( $roles ) ) {\n\t\t\t\tforeach ( $roles as $role ) {\n\t\t\t\t\t$roles_clauses[] = array(\n\t\t\t\t\t\t'key'     => $wpdb->get_blog_prefix( $blog_id ) . 'capabilities',\n\t\t\t\t\t\t'value'   => '\"' . $role . '\"',\n\t\t\t\t\t\t'compare' => 'LIKE',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$role_queries[] = $roles_clauses;\n\t\t\t}\n\n\t\t\t$role__in_clauses = array( 'relation' => 'OR' );\n\t\t\tif ( ! empty( $role__in ) ) {\n\t\t\t\tforeach ( $role__in as $role ) {\n\t\t\t\t\t$role__in_clauses[] = array(\n\t\t\t\t\t\t'key'     => $wpdb->get_blog_prefix( $blog_id ) . 'capabilities',\n\t\t\t\t\t\t'value'   => '\"' . $role . '\"',\n\t\t\t\t\t\t'compare' => 'LIKE',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$role_queries[] = $role__in_clauses;\n\t\t\t}\n\n\t\t\t$role__not_in_clauses = array( 'relation' => 'AND' );\n\t\t\tif ( ! empty( $role__not_in ) ) {\n\t\t\t\tforeach ( $role__not_in as $role ) {\n\t\t\t\t\t$role__not_in_clauses[] = array(\n\t\t\t\t\t\t'key'     => $wpdb->get_blog_prefix( $blog_id ) . 'capabilities',\n\t\t\t\t\t\t'value'   => '\"' . $role . '\"',\n\t\t\t\t\t\t'compare' => 'NOT LIKE',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$role_queries[] = $role__not_in_clauses;\n\t\t\t}\n\n\t\t\t// If there are no specific roles named, make sure the user is a member of the site.\n\t\t\tif ( empty( $role_queries ) ) {\n\t\t\t\t$role_queries[] = array(\n\t\t\t\t\t'key'     => $wpdb->get_blog_prefix( $blog_id ) . 'capabilities',\n\t\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Specify that role queries should be joined with AND.\n\t\t\t$role_queries['relation'] = 'AND';\n\n\t\t\tif ( empty( $this->meta_query->queries ) ) {\n\t\t\t\t$this->meta_query->queries = $role_queries;\n\t\t\t} else {\n\t\t\t\t// Append the cap query to the original queries and reparse the query.\n\t\t\t\t$this->meta_query->queries = array(\n\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t\tarray( $this->meta_query->queries, $role_queries ),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$this->meta_query->parse_query_vars( $this->meta_query->queries );\n\t\t}\n\n\t\tif ( ! empty( $this->meta_query->queries ) ) {\n\t\t\t$clauses            = $this->meta_query->get_sql( 'user', $wpdb->users, 'ID', $this );\n\t\t\t$this->query_from  .= $clauses['join'];\n\t\t\t$this->query_where .= $clauses['where'];\n\n\t\t\tif ( $this->meta_query->has_or_relation() ) {\n\t\t\t\t$this->query_fields = 'DISTINCT ' . $this->query_fields;\n\t\t\t}\n\t\t}\n\n\t\t// Sorting.\n\t\t$qv['order'] = isset( $qv['order'] ) ? strtoupper( $qv['order'] ) : '';\n\t\t$order       = $this->parse_order( $qv['order'] );\n\n\t\tif ( empty( $qv['orderby'] ) ) {\n\t\t\t// Default order is by 'user_login'.\n\t\t\t$ordersby = array( 'user_login' => $order );\n\t\t} elseif ( is_array( $qv['orderby'] ) ) {\n\t\t\t$ordersby = $qv['orderby'];\n\t\t} else {\n\t\t\t// 'orderby' values may be a comma- or space-separated list.\n\t\t\t$ordersby = preg_split( '/[,\\s]+/', $qv['orderby'] );\n\t\t}\n\n\t\t$orderby_array = array();\n\t\tforeach ( $ordersby as $_key => $_value ) {\n\t\t\tif ( ! $_value ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( is_int( $_key ) ) {\n\t\t\t\t// Integer key means this is a flat array of 'orderby' fields.\n\t\t\t\t$_orderby = $_value;\n\t\t\t\t$_order   = $order;\n\t\t\t} else {\n\t\t\t\t// Non-integer key means this the key is the field and the value is ASC/DESC.\n\t\t\t\t$_orderby = $_key;\n\t\t\t\t$_order   = $_value;\n\t\t\t}\n\n\t\t\t$parsed = $this->parse_orderby( $_orderby );\n\n\t\t\tif ( ! $parsed ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( 'nicename__in' === $_orderby || 'login__in' === $_orderby ) {\n\t\t\t\t$orderby_array[] = $parsed;\n\t\t\t} else {\n\t\t\t\t$orderby_array[] = $parsed . ' ' . $this->parse_order( $_order );\n\t\t\t}\n\t\t}\n\n\t\t// If no valid clauses were found, order by user_login.\n\t\tif ( empty( $orderby_array ) ) {\n\t\t\t$orderby_array[] = \"user_login $order\";\n\t\t}\n\n\t\t$this->query_orderby = 'ORDER BY ' . implode( ', ', $orderby_array );\n\n\t\t// Limit.\n\t\tif ( isset( $qv['number'] ) && $qv['number'] > 0 ) {\n\t\t\tif ( $qv['offset'] ) {\n\t\t\t\t$this->query_limit = $wpdb->prepare( 'LIMIT %d, %d', $qv['offset'], $qv['number'] );\n\t\t\t} else {\n\t\t\t\t$this->query_limit = $wpdb->prepare( 'LIMIT %d, %d', $qv['number'] * ( $qv['paged'] - 1 ), $qv['number'] );\n\t\t\t}\n\t\t}\n\n\t\t$search = '';\n\t\tif ( isset( $qv['search'] ) ) {\n\t\t\t$search = trim( $qv['search'] );\n\t\t}\n\n\t\tif ( $search ) {\n\t\t\t$leading_wild  = ( ltrim( $search, '*' ) != $search );\n\t\t\t$trailing_wild = ( rtrim( $search, '*' ) != $search );\n\t\t\tif ( $leading_wild && $trailing_wild ) {\n\t\t\t\t$wild = 'both';\n\t\t\t} elseif ( $leading_wild ) {\n\t\t\t\t$wild = 'leading';\n\t\t\t} elseif ( $trailing_wild ) {\n\t\t\t\t$wild = 'trailing';\n\t\t\t} else {\n\t\t\t\t$wild = false;\n\t\t\t}\n\t\t\tif ( $wild ) {\n\t\t\t\t$search = trim( $search, '*' );\n\t\t\t}\n\n\t\t\t$search_columns = array();\n\t\t\tif ( $qv['search_columns'] ) {\n\t\t\t\t$search_columns = array_intersect( $qv['search_columns'], array( 'ID', 'user_login', 'user_email', 'user_url', 'user_nicename', 'display_name' ) );\n\t\t\t}\n\t\t\tif ( ! $search_columns ) {\n\t\t\t\tif ( false !== strpos( $search, '@' ) ) {\n\t\t\t\t\t$search_columns = array( 'user_email' );\n\t\t\t\t} elseif ( is_numeric( $search ) ) {\n\t\t\t\t\t$search_columns = array( 'user_login', 'ID' );\n\t\t\t\t} elseif ( preg_match( '|^https?://|', $search ) && ! ( is_multisite() && wp_is_large_network( 'users' ) ) ) {\n\t\t\t\t\t$search_columns = array( 'user_url' );\n\t\t\t\t} else {\n\t\t\t\t\t$search_columns = array( 'user_login', 'user_url', 'user_email', 'user_nicename', 'display_name' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the columns to search in a WP_User_Query search.\n\t\t\t *\n\t\t\t * The default columns depend on the search term, and include 'ID', 'user_login',\n\t\t\t * 'user_email', 'user_url', 'user_nicename', and 'display_name'.\n\t\t\t *\n\t\t\t * @since 3.6.0\n\t\t\t *\n\t\t\t * @param string[]      $search_columns Array of column names to be searched.\n\t\t\t * @param string        $search         Text being searched.\n\t\t\t * @param WP_User_Query $this           The current WP_User_Query instance.\n\t\t\t */\n\t\t\t$search_columns = apply_filters( 'user_search_columns', $search_columns, $search, $this );\n\n\t\t\t$this->query_where .= $this->get_search_sql( $search, $search_columns, $wild );\n\t\t}\n\n\t\tif ( ! empty( $include ) ) {\n\t\t\t// Sanitized earlier.\n\t\t\t$ids                = implode( ',', $include );\n\t\t\t$this->query_where .= \" AND $wpdb->users.ID IN ($ids)\";\n\t\t} elseif ( ! empty( $qv['exclude'] ) ) {\n\t\t\t$ids                = implode( ',', wp_parse_id_list( $qv['exclude'] ) );\n\t\t\t$this->query_where .= \" AND $wpdb->users.ID NOT IN ($ids)\";\n\t\t}\n\n\t\t// Date queries are allowed for the user_registered field.\n\t\tif ( ! empty( $qv['date_query'] ) && is_array( $qv['date_query'] ) ) {\n\t\t\t$date_query         = new WP_Date_Query( $qv['date_query'], 'user_registered' );\n\t\t\t$this->query_where .= $date_query->get_sql();\n\t\t}\n\n\t\t/**\n\t\t * Fires after the WP_User_Query has been parsed, and before\n\t\t * the query is executed.\n\t\t *\n\t\t * The passed WP_User_Query object contains SQL parts formed\n\t\t * from parsing the given query.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param WP_User_Query $this The current WP_User_Query instance,\n\t\t *                            passed by reference.\n\t\t */\n\t\tdo_action_ref_array( 'pre_user_query', array( &$this ) );\n\t}\n\n\t/**\n\t * Execute the query, with the current variables.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t */\n\tpublic function query() {\n\t\tglobal $wpdb;\n\n\t\t$qv =& $this->query_vars;\n\n\t\t/**\n\t\t * Filters the users array before the query takes place.\n\t\t *\n\t\t * Return a non-null value to bypass WordPress's default user queries.\n\t\t * Filtering functions that require pagination information are encouraged to set\n\t\t * the `total_users` property of the WP_User_Query object, passed to the filter\n\t\t * by reference. If WP_User_Query does not perform a database query, it will not\n\t\t * have enough information to generate these values itself.\n\t\t *\n\t\t * @since 5.1.0\n\t\t *\n\t\t * @param array|null $results Return an array of user data to short-circuit WP's user query\n\t\t *                            or null to allow WP to run its normal queries.\n\t\t * @param WP_User_Query $this The WP_User_Query instance (passed by reference).\n\t\t */\n\t\t$this->results = apply_filters_ref_array( 'users_pre_query', array( null, &$this ) );\n\n\t\tif ( null === $this->results ) {\n\t\t\t$this->request = \"SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit\";\n\n\t\t\tif ( is_array( $qv['fields'] ) || 'all' === $qv['fields'] ) {\n\t\t\t\t$this->results = $wpdb->get_results( $this->request );\n\t\t\t} else {\n\t\t\t\t$this->results = $wpdb->get_col( $this->request );\n\t\t\t}\n\n\t\t\tif ( isset( $qv['count_total'] ) && $qv['count_total'] ) {\n\t\t\t\t/**\n\t\t\t\t * Filters SELECT FOUND_ROWS() query for the current WP_User_Query instance.\n\t\t\t\t *\n\t\t\t\t * @since 3.2.0\n\t\t\t\t * @since 5.1.0 Added the `$this` parameter.\n\t\t\t\t *\n\t\t\t\t * @global wpdb $wpdb WordPress database abstraction object.\n\t\t\t\t *\n\t\t\t\t * @param string $sql         The SELECT FOUND_ROWS() query for the current WP_User_Query.\n\t\t\t\t * @param WP_User_Query $this The current WP_User_Query instance.\n\t\t\t\t */\n\t\t\t\t$found_users_query = apply_filters( 'found_users_query', 'SELECT FOUND_ROWS()', $this );\n\n\t\t\t\t$this->total_users = (int) $wpdb->get_var( $found_users_query );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $this->results ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'all_with_meta' === $qv['fields'] ) {\n\t\t\tcache_users( $this->results );\n\n\t\t\t$r = array();\n\t\t\tforeach ( $this->results as $userid ) {\n\t\t\t\t$r[ $userid ] = new WP_User( $userid, '', $qv['blog_id'] );\n\t\t\t}\n\n\t\t\t$this->results = $r;\n\t\t} elseif ( 'all' === $qv['fields'] ) {\n\t\t\tforeach ( $this->results as $key => $user ) {\n\t\t\t\t$this->results[ $key ] = new WP_User( $user, '', $qv['blog_id'] );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Retrieve query variable.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $query_var Query variable key.\n\t * @return mixed\n\t */\n\tpublic function get( $query_var ) {\n\t\tif ( isset( $this->query_vars[ $query_var ] ) ) {\n\t\t\treturn $this->query_vars[ $query_var ];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Set query variable.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $query_var Query variable key.\n\t * @param mixed  $value     Query variable value.\n\t */\n\tpublic function set( $query_var, $value ) {\n\t\t$this->query_vars[ $query_var ] = $value;\n\t}\n\n\t/**\n\t * Used internally to generate an SQL string for searching across multiple columns\n\t *\n\t * @since 3.1.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $string\n\t * @param array  $cols\n\t * @param bool   $wild   Whether to allow wildcard searches. Default is false for Network Admin, true for single site.\n\t *                       Single site allows leading and trailing wildcards, Network Admin only trailing.\n\t * @return string\n\t */\n\tprotected function get_search_sql( $string, $cols, $wild = false ) {\n\t\tglobal $wpdb;\n\n\t\t$searches      = array();\n\t\t$leading_wild  = ( 'leading' === $wild || 'both' === $wild ) ? '%' : '';\n\t\t$trailing_wild = ( 'trailing' === $wild || 'both' === $wild ) ? '%' : '';\n\t\t$like          = $leading_wild . $wpdb->esc_like( $string ) . $trailing_wild;\n\n\t\tforeach ( $cols as $col ) {\n\t\t\tif ( 'ID' === $col ) {\n\t\t\t\t$searches[] = $wpdb->prepare( \"$col = %s\", $string );\n\t\t\t} else {\n\t\t\t\t$searches[] = $wpdb->prepare( \"$col LIKE %s\", $like );\n\t\t\t}\n\t\t}\n\n\t\treturn ' AND (' . implode( ' OR ', $searches ) . ')';\n\t}\n\n\t/**\n\t * Return the list of users.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return array Array of results.\n\t */\n\tpublic function get_results() {\n\t\treturn $this->results;\n\t}\n\n\t/**\n\t * Return the total number of users for the current query.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @return int Number of total users.\n\t */\n\tpublic function get_total() {\n\t\treturn $this->total_users;\n\t}\n\n\t/**\n\t * Parse and sanitize 'orderby' keys passed to the user query.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $orderby Alias for the field to order by.\n\t * @return string Value to used in the ORDER clause, if `$orderby` is valid.\n\t */\n\tprotected function parse_orderby( $orderby ) {\n\t\tglobal $wpdb;\n\n\t\t$meta_query_clauses = $this->meta_query->get_clauses();\n\n\t\t$_orderby = '';\n\t\tif ( in_array( $orderby, array( 'login', 'nicename', 'email', 'url', 'registered' ), true ) ) {\n\t\t\t$_orderby = 'user_' . $orderby;\n\t\t} elseif ( in_array( $orderby, array( 'user_login', 'user_nicename', 'user_email', 'user_url', 'user_registered' ), true ) ) {\n\t\t\t$_orderby = $orderby;\n\t\t} elseif ( 'name' === $orderby || 'display_name' === $orderby ) {\n\t\t\t$_orderby = 'display_name';\n\t\t} elseif ( 'post_count' === $orderby ) {\n\t\t\t// @todo Avoid the JOIN.\n\t\t\t$where             = get_posts_by_author_sql( 'post' );\n\t\t\t$this->query_from .= \" LEFT OUTER JOIN (\n\t\t\t\tSELECT post_author, COUNT(*) as post_count\n\t\t\t\tFROM $wpdb->posts\n\t\t\t\t$where\n\t\t\t\tGROUP BY post_author\n\t\t\t) p ON ({$wpdb->users}.ID = p.post_author)\n\t\t\t\";\n\t\t\t$_orderby          = 'post_count';\n\t\t} elseif ( 'ID' === $orderby || 'id' === $orderby ) {\n\t\t\t$_orderby = 'ID';\n\t\t} elseif ( 'meta_value' === $orderby || $this->get( 'meta_key' ) == $orderby ) {\n\t\t\t$_orderby = \"$wpdb->usermeta.meta_value\";\n\t\t} elseif ( 'meta_value_num' === $orderby ) {\n\t\t\t$_orderby = \"$wpdb->usermeta.meta_value+0\";\n\t\t} elseif ( 'include' === $orderby && ! empty( $this->query_vars['include'] ) ) {\n\t\t\t$include     = wp_parse_id_list( $this->query_vars['include'] );\n\t\t\t$include_sql = implode( ',', $include );\n\t\t\t$_orderby    = \"FIELD( $wpdb->users.ID, $include_sql )\";\n\t\t} elseif ( 'nicename__in' === $orderby ) {\n\t\t\t$sanitized_nicename__in = array_map( 'esc_sql', $this->query_vars['nicename__in'] );\n\t\t\t$nicename__in           = implode( \"','\", $sanitized_nicename__in );\n\t\t\t$_orderby               = \"FIELD( user_nicename, '$nicename__in' )\";\n\t\t} elseif ( 'login__in' === $orderby ) {\n\t\t\t$sanitized_login__in = array_map( 'esc_sql', $this->query_vars['login__in'] );\n\t\t\t$login__in           = implode( \"','\", $sanitized_login__in );\n\t\t\t$_orderby            = \"FIELD( user_login, '$login__in' )\";\n\t\t} elseif ( isset( $meta_query_clauses[ $orderby ] ) ) {\n\t\t\t$meta_clause = $meta_query_clauses[ $orderby ];\n\t\t\t$_orderby    = sprintf( 'CAST(%s.meta_value AS %s)', esc_sql( $meta_clause['alias'] ), esc_sql( $meta_clause['cast'] ) );\n\t\t}\n\n\t\treturn $_orderby;\n\t}\n\n\t/**\n\t * Parse an 'order' query variable and cast it to ASC or DESC as necessary.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param string $order The 'order' query variable.\n\t * @return string The sanitized 'order' query variable.\n\t */\n\tprotected function parse_order( $order ) {\n\t\tif ( ! is_string( $order ) || empty( $order ) ) {\n\t\t\treturn 'DESC';\n\t\t}\n\n\t\tif ( 'ASC' === strtoupper( $order ) ) {\n\t\t\treturn 'ASC';\n\t\t} else {\n\t\t\treturn 'DESC';\n\t\t}\n\t}\n\n\t/**\n\t * Make private properties readable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name Property to get.\n\t * @return mixed Property.\n\t */\n\tpublic function __get( $name ) {\n\t\tif ( in_array( $name, $this->compat_fields, true ) ) {\n\t\t\treturn $this->$name;\n\t\t}\n\t}\n\n\t/**\n\t * Make private properties settable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name  Property to check if set.\n\t * @param mixed  $value Property value.\n\t * @return mixed Newly-set property.\n\t */\n\tpublic function __set( $name, $value ) {\n\t\tif ( in_array( $name, $this->compat_fields, true ) ) {\n\t\t\treturn $this->$name = $value;\n\t\t}\n\t}\n\n\t/**\n\t * Make private properties checkable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name Property to check if set.\n\t * @return bool Whether the property is set.\n\t */\n\tpublic function __isset( $name ) {\n\t\tif ( in_array( $name, $this->compat_fields, true ) ) {\n\t\t\treturn isset( $this->$name );\n\t\t}\n\t}\n\n\t/**\n\t * Make private properties un-settable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name Property to unset.\n\t */\n\tpublic function __unset( $name ) {\n\t\tif ( in_array( $name, $this->compat_fields, true ) ) {\n\t\t\tunset( $this->$name );\n\t\t}\n\t}\n\n\t/**\n\t * Make private/protected methods readable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name      Method to call.\n\t * @param array  $arguments Arguments to pass when calling.\n\t * @return mixed Return value of the callback, false otherwise.\n\t */\n\tpublic function __call( $name, $arguments ) {\n\t\tif ( 'get_search_sql' === $name ) {\n\t\t\treturn $this->get_search_sql( ...$arguments );\n\t\t}\n\t\treturn false;\n\t}\n}\n", "num_lines": 894}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WP_User_Request class.\n *\n * Represents user request data loaded from a WP_Post object.\n *\n * @since 4.9.6\n */\nfinal class WP_User_Request {\n\t/**\n\t * Request ID.\n\t *\n\t * @since 4.9.6\n\t * @var int\n\t */\n\tpublic $ID = 0;\n\n\t/**\n\t * User ID.\n\t *\n\t * @since 4.9.6\n\t * @var int\n\t */\n\tpublic $user_id = 0;\n\n\t/**\n\t * User email.\n\t *\n\t * @since 4.9.6\n\t * @var string\n\t */\n\tpublic $email = '';\n\n\t/**\n\t * Action name.\n\t *\n\t * @since 4.9.6\n\t * @var string\n\t */\n\tpublic $action_name = '';\n\n\t/**\n\t * Current status.\n\t *\n\t * @since 4.9.6\n\t * @var string\n\t */\n\tpublic $status = '';\n\n\t/**\n\t * Timestamp this request was created.\n\t *\n\t * @since 4.9.6\n\t * @var int|null\n\t */\n\tpublic $created_timestamp = null;\n\n\t/**\n\t * Timestamp this request was last modified.\n\t *\n\t * @since 4.9.6\n\t * @var int|null\n\t */\n\tpublic $modified_timestamp = null;\n\n\t/**\n\t * Timestamp this request was confirmed.\n\t *\n\t * @since 4.9.6\n\t * @var int|null\n\t */\n\tpublic $confirmed_timestamp = null;\n\n\t/**\n\t * Timestamp this request was completed.\n\t *\n\t * @since 4.9.6\n\t * @var int|null\n\t */\n\tpublic $completed_timestamp = null;\n\n\t/**\n\t * Misc data assigned to this request.\n\t *\n\t * @since 4.9.6\n\t * @var array\n\t */\n\tpublic $request_data = array();\n\n\t/**\n\t * Key used to confirm this request.\n\t *\n\t * @since 4.9.6\n\t * @var string\n\t */\n\tpublic $confirm_key = '';\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param WP_Post|object $post Post object.\n\t */\n\tpublic function __construct( $post ) {\n\t\t$this->ID                  = $post->ID;\n\t\t$this->user_id             = $post->post_author;\n\t\t$this->email               = $post->post_title;\n\t\t$this->action_name         = $post->post_name;\n\t\t$this->status              = $post->post_status;\n\t\t$this->created_timestamp   = strtotime( $post->post_date_gmt );\n\t\t$this->modified_timestamp  = strtotime( $post->post_modified_gmt );\n\t\t$this->confirmed_timestamp = (int) get_post_meta( $post->ID, '_wp_user_request_confirmed_timestamp', true );\n\t\t$this->completed_timestamp = (int) get_post_meta( $post->ID, '_wp_user_request_completed_timestamp', true );\n\t\t$this->request_data        = json_decode( $post->post_content, true );\n\t\t$this->confirm_key         = $post->post_password;\n\t}\n}\n", "num_lines": 119}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * User API: WP_User class\n *\n * @package WordPress\n * @subpackage Users\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement the WP_User object.\n *\n * @since 2.0.0\n *\n * @property string $nickname\n * @property string $description\n * @property string $user_description\n * @property string $first_name\n * @property string $user_firstname\n * @property string $last_name\n * @property string $user_lastname\n * @property string $user_login\n * @property string $user_pass\n * @property string $user_nicename\n * @property string $user_email\n * @property string $user_url\n * @property string $user_registered\n * @property string $user_activation_key\n * @property string $user_status\n * @property int    $user_level\n * @property string $display_name\n * @property string $spam\n * @property string $deleted\n * @property string $locale\n * @property string $rich_editing\n * @property string $syntax_highlighting\n */\nclass WP_User {\n\t/**\n\t * User data container.\n\t *\n\t * @since 2.0.0\n\t * @var object\n\t */\n\tpublic $data;\n\n\t/**\n\t * The user's ID.\n\t *\n\t * @since 2.1.0\n\t * @var int\n\t */\n\tpublic $ID = 0;\n\n\t/**\n\t * Capabilities that the individual user has been granted outside of those inherited from their role.\n\t *\n\t * @since 2.0.0\n\t * @var bool[] Array of key/value pairs where keys represent a capability name\n\t *             and boolean values represent whether the user has that capability.\n\t */\n\tpublic $caps = array();\n\n\t/**\n\t * User metadata option name.\n\t *\n\t * @since 2.0.0\n\t * @var string\n\t */\n\tpublic $cap_key;\n\n\t/**\n\t * The roles the user is part of.\n\t *\n\t * @since 2.0.0\n\t * @var string[]\n\t */\n\tpublic $roles = array();\n\n\t/**\n\t * All capabilities the user has, including individual and role based.\n\t *\n\t * @since 2.0.0\n\t * @var bool[] Array of key/value pairs where keys represent a capability name\n\t *             and boolean values represent whether the user has that capability.\n\t */\n\tpublic $allcaps = array();\n\n\t/**\n\t * The filter context applied to user data fields.\n\t *\n\t * @since 2.9.0\n\t * @var string\n\t */\n\tpublic $filter = null;\n\n\t/**\n\t * The site ID the capabilities of this user are initialized for.\n\t *\n\t * @since 4.9.0\n\t * @var int\n\t */\n\tprivate $site_id = 0;\n\n\t/**\n\t * @since 3.3.0\n\t * @var array\n\t */\n\tprivate static $back_compat_keys;\n\n\t/**\n\t * Constructor.\n\t *\n\t * Retrieves the userdata and passes it to WP_User::init().\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param int|string|stdClass|WP_User $id      User's ID, a WP_User object, or a user object from the DB.\n\t * @param string                      $name    Optional. User's username\n\t * @param int                         $site_id Optional Site ID, defaults to current site.\n\t */\n\tpublic function __construct( $id = 0, $name = '', $site_id = '' ) {\n\t\tif ( ! isset( self::$back_compat_keys ) ) {\n\t\t\t$prefix                 = $GLOBALS['wpdb']->prefix;\n\t\t\tself::$back_compat_keys = array(\n\t\t\t\t'user_firstname'             => 'first_name',\n\t\t\t\t'user_lastname'              => 'last_name',\n\t\t\t\t'user_description'           => 'description',\n\t\t\t\t'user_level'                 => $prefix . 'user_level',\n\t\t\t\t$prefix . 'usersettings'     => $prefix . 'user-settings',\n\t\t\t\t$prefix . 'usersettingstime' => $prefix . 'user-settings-time',\n\t\t\t);\n\t\t}\n\n\t\tif ( $id instanceof WP_User ) {\n\t\t\t$this->init( $id->data, $site_id );\n\t\t\treturn;\n\t\t} elseif ( is_object( $id ) ) {\n\t\t\t$this->init( $id, $site_id );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! empty( $id ) && ! is_numeric( $id ) ) {\n\t\t\t$name = $id;\n\t\t\t$id   = 0;\n\t\t}\n\n\t\tif ( $id ) {\n\t\t\t$data = self::get_data_by( 'id', $id );\n\t\t} else {\n\t\t\t$data = self::get_data_by( 'login', $name );\n\t\t}\n\n\t\tif ( $data ) {\n\t\t\t$this->init( $data, $site_id );\n\t\t} else {\n\t\t\t$this->data = new stdClass;\n\t\t}\n\t}\n\n\t/**\n\t * Sets up object properties, including capabilities.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param object $data    User DB row object.\n\t * @param int    $site_id Optional. The site ID to initialize for.\n\t */\n\tpublic function init( $data, $site_id = '' ) {\n\t\t$this->data = $data;\n\t\t$this->ID   = (int) $data->ID;\n\n\t\t$this->for_site( $site_id );\n\t}\n\n\t/**\n\t * Return only the main user fields\n\t *\n\t * @since 3.3.0\n\t * @since 4.4.0 Added 'ID' as an alias of 'id' for the `$field` parameter.\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string     $field The field to query against: 'id', 'ID', 'slug', 'email' or 'login'.\n\t * @param string|int $value The field value\n\t * @return object|false Raw user object\n\t */\n\tpublic static function get_data_by( $field, $value ) {\n\t\tglobal $wpdb;\n\n\t\t// 'ID' is an alias of 'id'.\n\t\tif ( 'ID' === $field ) {\n\t\t\t$field = 'id';\n\t\t}\n\n\t\tif ( 'id' === $field ) {\n\t\t\t// Make sure the value is numeric to avoid casting objects, for example,\n\t\t\t// to int 1.\n\t\t\tif ( ! is_numeric( $value ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$value = intval( $value );\n\t\t\tif ( $value < 1 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\t$value = trim( $value );\n\t\t}\n\n\t\tif ( ! $value ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch ( $field ) {\n\t\t\tcase 'id':\n\t\t\t\t$user_id  = $value;\n\t\t\t\t$db_field = 'ID';\n\t\t\t\tbreak;\n\t\t\tcase 'slug':\n\t\t\t\t$user_id  = wp_cache_get( $value, 'userslugs' );\n\t\t\t\t$db_field = 'user_nicename';\n\t\t\t\tbreak;\n\t\t\tcase 'email':\n\t\t\t\t$user_id  = wp_cache_get( $value, 'useremail' );\n\t\t\t\t$db_field = 'user_email';\n\t\t\t\tbreak;\n\t\t\tcase 'login':\n\t\t\t\t$value    = sanitize_user( $value );\n\t\t\t\t$user_id  = wp_cache_get( $value, 'userlogins' );\n\t\t\t\t$db_field = 'user_login';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\n\t\tif ( false !== $user_id ) {\n\t\t\t$user = wp_cache_get( $user_id, 'users' );\n\t\t\tif ( $user ) {\n\t\t\t\treturn $user;\n\t\t\t}\n\t\t}\n\n\t\t$user = $wpdb->get_row(\n\t\t\t$wpdb->prepare(\n\t\t\t\t\"SELECT * FROM $wpdb->users WHERE $db_field = %s LIMIT 1\",\n\t\t\t\t$value\n\t\t\t)\n\t\t);\n\t\tif ( ! $user ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tupdate_user_caches( $user );\n\n\t\treturn $user;\n\t}\n\n\t/**\n\t * Magic method for checking the existence of a certain custom field.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $key User meta key to check if set.\n\t * @return bool Whether the given user meta key is set.\n\t */\n\tpublic function __isset( $key ) {\n\t\tif ( 'id' === $key ) {\n\t\t\t_deprecated_argument(\n\t\t\t\t'WP_User->id',\n\t\t\t\t'2.1.0',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: WP_User->ID */\n\t\t\t\t\t__( 'Use %s instead.' ),\n\t\t\t\t\t'<code>WP_User->ID</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t\t$key = 'ID';\n\t\t}\n\n\t\tif ( isset( $this->data->$key ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( isset( self::$back_compat_keys[ $key ] ) ) {\n\t\t\t$key = self::$back_compat_keys[ $key ];\n\t\t}\n\n\t\treturn metadata_exists( 'user', $this->ID, $key );\n\t}\n\n\t/**\n\t * Magic method for accessing custom fields.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $key User meta key to retrieve.\n\t * @return mixed Value of the given user meta key (if set). If `$key` is 'id', the user ID.\n\t */\n\tpublic function __get( $key ) {\n\t\tif ( 'id' === $key ) {\n\t\t\t_deprecated_argument(\n\t\t\t\t'WP_User->id',\n\t\t\t\t'2.1.0',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: WP_User->ID */\n\t\t\t\t\t__( 'Use %s instead.' ),\n\t\t\t\t\t'<code>WP_User->ID</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn $this->ID;\n\t\t}\n\n\t\tif ( isset( $this->data->$key ) ) {\n\t\t\t$value = $this->data->$key;\n\t\t} else {\n\t\t\tif ( isset( self::$back_compat_keys[ $key ] ) ) {\n\t\t\t\t$key = self::$back_compat_keys[ $key ];\n\t\t\t}\n\t\t\t$value = get_user_meta( $this->ID, $key, true );\n\t\t}\n\n\t\tif ( $this->filter ) {\n\t\t\t$value = sanitize_user_field( $key, $value, $this->ID, $this->filter );\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Magic method for setting custom user fields.\n\t *\n\t * This method does not update custom fields in the database. It only stores\n\t * the value on the WP_User instance.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $key   User meta key.\n\t * @param mixed  $value User meta value.\n\t */\n\tpublic function __set( $key, $value ) {\n\t\tif ( 'id' === $key ) {\n\t\t\t_deprecated_argument(\n\t\t\t\t'WP_User->id',\n\t\t\t\t'2.1.0',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: WP_User->ID */\n\t\t\t\t\t__( 'Use %s instead.' ),\n\t\t\t\t\t'<code>WP_User->ID</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->ID = $value;\n\t\t\treturn;\n\t\t}\n\n\t\t$this->data->$key = $value;\n\t}\n\n\t/**\n\t * Magic method for unsetting a certain custom field.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $key User meta key to unset.\n\t */\n\tpublic function __unset( $key ) {\n\t\tif ( 'id' === $key ) {\n\t\t\t_deprecated_argument(\n\t\t\t\t'WP_User->id',\n\t\t\t\t'2.1.0',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: WP_User->ID */\n\t\t\t\t\t__( 'Use %s instead.' ),\n\t\t\t\t\t'<code>WP_User->ID</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( isset( $this->data->$key ) ) {\n\t\t\tunset( $this->data->$key );\n\t\t}\n\n\t\tif ( isset( self::$back_compat_keys[ $key ] ) ) {\n\t\t\tunset( self::$back_compat_keys[ $key ] );\n\t\t}\n\t}\n\n\t/**\n\t * Determine whether the user exists in the database.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @return bool True if user exists in the database, false if not.\n\t */\n\tpublic function exists() {\n\t\treturn ! empty( $this->ID );\n\t}\n\n\t/**\n\t * Retrieve the value of a property or meta key.\n\t *\n\t * Retrieves from the users and usermeta table.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $key Property\n\t * @return mixed\n\t */\n\tpublic function get( $key ) {\n\t\treturn $this->__get( $key );\n\t}\n\n\t/**\n\t * Determine whether a property or meta key is set\n\t *\n\t * Consults the users and usermeta tables.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $key Property\n\t * @return bool\n\t */\n\tpublic function has_prop( $key ) {\n\t\treturn $this->__isset( $key );\n\t}\n\n\t/**\n\t * Return an array representation.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @return array Array representation.\n\t */\n\tpublic function to_array() {\n\t\treturn get_object_vars( $this->data );\n\t}\n\n\t/**\n\t * Makes private/protected methods readable for backward compatibility.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param string $name      Method to call.\n\t * @param array  $arguments Arguments to pass when calling.\n\t * @return mixed|false Return value of the callback, false otherwise.\n\t */\n\tpublic function __call( $name, $arguments ) {\n\t\tif ( '_init_caps' === $name ) {\n\t\t\treturn $this->_init_caps( ...$arguments );\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Set up capability object properties.\n\t *\n\t * Will set the value for the 'cap_key' property to current database table\n\t * prefix, followed by 'capabilities'. Will then check to see if the\n\t * property matching the 'cap_key' exists and is an array. If so, it will be\n\t * used.\n\t *\n\t * @since 2.1.0\n\t * @deprecated 4.9.0 Use WP_User::for_site()\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $cap_key Optional capability key\n\t */\n\tprotected function _init_caps( $cap_key = '' ) {\n\t\tglobal $wpdb;\n\n\t\t_deprecated_function( __METHOD__, '4.9.0', 'WP_User::for_site()' );\n\n\t\tif ( empty( $cap_key ) ) {\n\t\t\t$this->cap_key = $wpdb->get_blog_prefix( $this->site_id ) . 'capabilities';\n\t\t} else {\n\t\t\t$this->cap_key = $cap_key;\n\t\t}\n\n\t\t$this->caps = $this->get_caps_data();\n\n\t\t$this->get_role_caps();\n\t}\n\n\t/**\n\t * Retrieves all of the capabilities of the user's roles, and merges them with\n\t * individual user capabilities.\n\t *\n\t * All of the capabilities of the user's roles are merged with the user's individual\n\t * capabilities. This means that the user can be denied specific capabilities that\n\t * their role might have, but the user is specifically denied.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @return bool[] Array of key/value pairs where keys represent a capability name\n\t *                and boolean values represent whether the user has that capability.\n\t */\n\tpublic function get_role_caps() {\n\t\t$switch_site = false;\n\t\tif ( is_multisite() && get_current_blog_id() != $this->site_id ) {\n\t\t\t$switch_site = true;\n\n\t\t\tswitch_to_blog( $this->site_id );\n\t\t}\n\n\t\t$wp_roles = wp_roles();\n\n\t\t// Filter out caps that are not role names and assign to $this->roles.\n\t\tif ( is_array( $this->caps ) ) {\n\t\t\t$this->roles = array_filter( array_keys( $this->caps ), array( $wp_roles, 'is_role' ) );\n\t\t}\n\n\t\t// Build $allcaps from role caps, overlay user's $caps.\n\t\t$this->allcaps = array();\n\t\tforeach ( (array) $this->roles as $role ) {\n\t\t\t$the_role      = $wp_roles->get_role( $role );\n\t\t\t$this->allcaps = array_merge( (array) $this->allcaps, (array) $the_role->capabilities );\n\t\t}\n\t\t$this->allcaps = array_merge( (array) $this->allcaps, (array) $this->caps );\n\n\t\tif ( $switch_site ) {\n\t\t\trestore_current_blog();\n\t\t}\n\n\t\treturn $this->allcaps;\n\t}\n\n\t/**\n\t * Add role to user.\n\t *\n\t * Updates the user's meta data option with capabilities and roles.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $role Role name.\n\t */\n\tpublic function add_role( $role ) {\n\t\tif ( empty( $role ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->caps[ $role ] = true;\n\t\tupdate_user_meta( $this->ID, $this->cap_key, $this->caps );\n\t\t$this->get_role_caps();\n\t\t$this->update_user_level_from_caps();\n\n\t\t/**\n\t\t * Fires immediately after the user has been given a new role.\n\t\t *\n\t\t * @since 4.3.0\n\t\t *\n\t\t * @param int    $user_id The user ID.\n\t\t * @param string $role    The new role.\n\t\t */\n\t\tdo_action( 'add_user_role', $this->ID, $role );\n\t}\n\n\t/**\n\t * Remove role from user.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $role Role name.\n\t */\n\tpublic function remove_role( $role ) {\n\t\tif ( ! in_array( $role, $this->roles, true ) ) {\n\t\t\treturn;\n\t\t}\n\t\tunset( $this->caps[ $role ] );\n\t\tupdate_user_meta( $this->ID, $this->cap_key, $this->caps );\n\t\t$this->get_role_caps();\n\t\t$this->update_user_level_from_caps();\n\n\t\t/**\n\t\t * Fires immediately after a role as been removed from a user.\n\t\t *\n\t\t * @since 4.3.0\n\t\t *\n\t\t * @param int    $user_id The user ID.\n\t\t * @param string $role    The removed role.\n\t\t */\n\t\tdo_action( 'remove_user_role', $this->ID, $role );\n\t}\n\n\t/**\n\t * Set the role of the user.\n\t *\n\t * This will remove the previous roles of the user and assign the user the\n\t * new one. You can set the role to an empty string and it will remove all\n\t * of the roles from the user.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $role Role name.\n\t */\n\tpublic function set_role( $role ) {\n\t\tif ( 1 === count( $this->roles ) && current( $this->roles ) == $role ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( (array) $this->roles as $oldrole ) {\n\t\t\tunset( $this->caps[ $oldrole ] );\n\t\t}\n\n\t\t$old_roles = $this->roles;\n\t\tif ( ! empty( $role ) ) {\n\t\t\t$this->caps[ $role ] = true;\n\t\t\t$this->roles         = array( $role => true );\n\t\t} else {\n\t\t\t$this->roles = false;\n\t\t}\n\t\tupdate_user_meta( $this->ID, $this->cap_key, $this->caps );\n\t\t$this->get_role_caps();\n\t\t$this->update_user_level_from_caps();\n\n\t\t/**\n\t\t * Fires after the user's role has changed.\n\t\t *\n\t\t * @since 2.9.0\n\t\t * @since 3.6.0 Added $old_roles to include an array of the user's previous roles.\n\t\t *\n\t\t * @param int      $user_id   The user ID.\n\t\t * @param string   $role      The new role.\n\t\t * @param string[] $old_roles An array of the user's previous roles.\n\t\t */\n\t\tdo_action( 'set_user_role', $this->ID, $role, $old_roles );\n\t}\n\n\t/**\n\t * Choose the maximum level the user has.\n\t *\n\t * Will compare the level from the $item parameter against the $max\n\t * parameter. If the item is incorrect, then just the $max parameter value\n\t * will be returned.\n\t *\n\t * Used to get the max level based on the capabilities the user has. This\n\t * is also based on roles, so if the user is assigned the Administrator role\n\t * then the capability 'level_10' will exist and the user will get that\n\t * value.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param int    $max  Max level of user.\n\t * @param string $item Level capability name.\n\t * @return int Max Level.\n\t */\n\tpublic function level_reduction( $max, $item ) {\n\t\tif ( preg_match( '/^level_(10|[0-9])$/i', $item, $matches ) ) {\n\t\t\t$level = intval( $matches[1] );\n\t\t\treturn max( $max, $level );\n\t\t} else {\n\t\t\treturn $max;\n\t\t}\n\t}\n\n\t/**\n\t * Update the maximum user level for the user.\n\t *\n\t * Updates the 'user_level' user metadata (includes prefix that is the\n\t * database table prefix) with the maximum user level. Gets the value from\n\t * the all of the capabilities that the user has.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t */\n\tpublic function update_user_level_from_caps() {\n\t\tglobal $wpdb;\n\t\t$this->user_level = array_reduce( array_keys( $this->allcaps ), array( $this, 'level_reduction' ), 0 );\n\t\tupdate_user_meta( $this->ID, $wpdb->get_blog_prefix() . 'user_level', $this->user_level );\n\t}\n\n\t/**\n\t * Add capability and grant or deny access to capability.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $cap   Capability name.\n\t * @param bool   $grant Whether to grant capability to user.\n\t */\n\tpublic function add_cap( $cap, $grant = true ) {\n\t\t$this->caps[ $cap ] = $grant;\n\t\tupdate_user_meta( $this->ID, $this->cap_key, $this->caps );\n\t\t$this->get_role_caps();\n\t\t$this->update_user_level_from_caps();\n\t}\n\n\t/**\n\t * Remove capability from user.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $cap Capability name.\n\t */\n\tpublic function remove_cap( $cap ) {\n\t\tif ( ! isset( $this->caps[ $cap ] ) ) {\n\t\t\treturn;\n\t\t}\n\t\tunset( $this->caps[ $cap ] );\n\t\tupdate_user_meta( $this->ID, $this->cap_key, $this->caps );\n\t\t$this->get_role_caps();\n\t\t$this->update_user_level_from_caps();\n\t}\n\n\t/**\n\t * Remove all of the capabilities of the user.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t */\n\tpublic function remove_all_caps() {\n\t\tglobal $wpdb;\n\t\t$this->caps = array();\n\t\tdelete_user_meta( $this->ID, $this->cap_key );\n\t\tdelete_user_meta( $this->ID, $wpdb->get_blog_prefix() . 'user_level' );\n\t\t$this->get_role_caps();\n\t}\n\n\t/**\n\t * Returns whether the user has the specified capability.\n\t *\n\t * This function also accepts an ID of an object to check against if the capability is a meta capability. Meta\n\t * capabilities such as `edit_post` and `edit_user` are capabilities used by the `map_meta_cap()` function to\n\t * map to primitive capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`.\n\t *\n\t * Example usage:\n\t *\n\t *     $user->has_cap( 'edit_posts' );\n\t *     $user->has_cap( 'edit_post', $post->ID );\n\t *     $user->has_cap( 'edit_post_meta', $post->ID, $meta_key );\n\t *\n\t * While checking against a role in place of a capability is supported in part, this practice is discouraged as it\n\t * may produce unreliable results.\n\t *\n\t * @since 2.0.0\n\t * @since 5.3.0 Formalized the existing and already documented `...$args` parameter\n\t *              by adding it to the function signature.\n\t *\n\t * @see map_meta_cap()\n\t *\n\t * @param string $cap     Capability name.\n\t * @param mixed  ...$args Optional further parameters, typically starting with an object ID.\n\t * @return bool Whether the user has the given capability, or, if an object ID is passed, whether the user has\n\t *              the given capability for that object.\n\t */\n\tpublic function has_cap( $cap, ...$args ) {\n\t\tif ( is_numeric( $cap ) ) {\n\t\t\t_deprecated_argument( __FUNCTION__, '2.0.0', __( 'Usage of user levels is deprecated. Use capabilities instead.' ) );\n\t\t\t$cap = $this->translate_level_to_cap( $cap );\n\t\t}\n\n\t\t$caps = map_meta_cap( $cap, $this->ID, ...$args );\n\n\t\t// Multisite super admin has all caps by definition, Unless specifically denied.\n\t\tif ( is_multisite() && is_super_admin( $this->ID ) ) {\n\t\t\tif ( in_array( 'do_not_allow', $caps, true ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t// Maintain BC for the argument passed to the \"user_has_cap\" filter.\n\t\t$args = array_merge( array( $cap, $this->ID ), $args );\n\n\t\t/**\n\t\t * Dynamically filter a user's capabilities.\n\t\t *\n\t\t * @since 2.0.0\n\t\t * @since 3.7.0 Added the `$user` parameter.\n\t\t *\n\t\t * @param bool[]   $allcaps Array of key/value pairs where keys represent a capability name\n\t\t *                          and boolean values represent whether the user has that capability.\n\t\t * @param string[] $caps    Required primitive capabilities for the requested capability.\n\t\t * @param array    $args {\n\t\t *     Arguments that accompany the requested capability check.\n\t\t *\n\t\t *     @type string    $0 Requested capability.\n\t\t *     @type int       $1 Concerned user ID.\n\t\t *     @type mixed  ...$2 Optional second and further parameters, typically object ID.\n\t\t * }\n\t\t * @param WP_User  $user    The user object.\n\t\t */\n\t\t$capabilities = apply_filters( 'user_has_cap', $this->allcaps, $caps, $args, $this );\n\n\t\t// Everyone is allowed to exist.\n\t\t$capabilities['exist'] = true;\n\n\t\t// Nobody is allowed to do things they are not allowed to do.\n\t\tunset( $capabilities['do_not_allow'] );\n\n\t\t// Must have ALL requested caps.\n\t\tforeach ( (array) $caps as $cap ) {\n\t\t\tif ( empty( $capabilities[ $cap ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Convert numeric level to level capability name.\n\t *\n\t * Prepends 'level_' to level number.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param int $level Level number, 1 to 10.\n\t * @return string\n\t */\n\tpublic function translate_level_to_cap( $level ) {\n\t\treturn 'level_' . $level;\n\t}\n\n\t/**\n\t * Set the site to operate on. Defaults to the current site.\n\t *\n\t * @since 3.0.0\n\t * @deprecated 4.9.0 Use WP_User::for_site()\n\t *\n\t * @param int $blog_id Optional. Site ID, defaults to current site.\n\t */\n\tpublic function for_blog( $blog_id = '' ) {\n\t\t_deprecated_function( __METHOD__, '4.9.0', 'WP_User::for_site()' );\n\n\t\t$this->for_site( $blog_id );\n\t}\n\n\t/**\n\t * Sets the site to operate on. Defaults to the current site.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param int $site_id Site ID to initialize user capabilities for. Default is the current site.\n\t */\n\tpublic function for_site( $site_id = '' ) {\n\t\tglobal $wpdb;\n\n\t\tif ( ! empty( $site_id ) ) {\n\t\t\t$this->site_id = absint( $site_id );\n\t\t} else {\n\t\t\t$this->site_id = get_current_blog_id();\n\t\t}\n\n\t\t$this->cap_key = $wpdb->get_blog_prefix( $this->site_id ) . 'capabilities';\n\n\t\t$this->caps = $this->get_caps_data();\n\n\t\t$this->get_role_caps();\n\t}\n\n\t/**\n\t * Gets the ID of the site for which the user's capabilities are currently initialized.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @return int Site ID.\n\t */\n\tpublic function get_site_id() {\n\t\treturn $this->site_id;\n\t}\n\n\t/**\n\t * Gets the available user capabilities data.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @return bool[] List of capabilities keyed by the capability name,\n\t *                e.g. array( 'edit_posts' => true, 'delete_posts' => false ).\n\t */\n\tprivate function get_caps_data() {\n\t\t$caps = get_user_meta( $this->ID, $this->cap_key, true );\n\n\t\tif ( ! is_array( $caps ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\treturn $caps;\n\t}\n}\n", "num_lines": 883}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * A class for displaying various tree-like structures.\n *\n * Extend the Walker class to use it, see examples below. Child classes\n * do not need to implement all of the abstract methods in the class. The child\n * only needs to implement the methods that are needed.\n *\n * @since 2.1.0\n *\n * @package WordPress\n * @abstract\n */\nclass Walker {\n\t/**\n\t * What the class handles.\n\t *\n\t * @since 2.1.0\n\t * @var string\n\t */\n\tpublic $tree_type;\n\n\t/**\n\t * DB fields to use.\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t */\n\tpublic $db_fields;\n\n\t/**\n\t * Max number of pages walked by the paged walker\n\t *\n\t * @since 2.7.0\n\t * @var int\n\t */\n\tpublic $max_pages = 1;\n\n\t/**\n\t * Whether the current element has children or not.\n\t *\n\t * To be used in start_el().\n\t *\n\t * @since 4.0.0\n\t * @var bool\n\t */\n\tpublic $has_children;\n\n\t/**\n\t * Starts the list before the elements are added.\n\t *\n\t * The $args parameter holds additional values that may be used with the child\n\t * class methods. This method is called at the start of the output list.\n\t *\n\t * @since 2.1.0\n\t * @abstract\n\t *\n\t * @param string $output Used to append additional content (passed by reference).\n\t * @param int    $depth  Depth of the item.\n\t * @param array  $args   An array of additional arguments.\n\t */\n\tpublic function start_lvl( &$output, $depth = 0, $args = array() ) {}\n\n\t/**\n\t * Ends the list of after the elements are added.\n\t *\n\t * The $args parameter holds additional values that may be used with the child\n\t * class methods. This method finishes the list at the end of output of the elements.\n\t *\n\t * @since 2.1.0\n\t * @abstract\n\t *\n\t * @param string $output Used to append additional content (passed by reference).\n\t * @param int    $depth  Depth of the item.\n\t * @param array  $args   An array of additional arguments.\n\t */\n\tpublic function end_lvl( &$output, $depth = 0, $args = array() ) {}\n\n\t/**\n\t * Start the element output.\n\t *\n\t * The $args parameter holds additional values that may be used with the child\n\t * class methods. Includes the element output also.\n\t *\n\t * @since 2.1.0\n\t * @abstract\n\t *\n\t * @param string $output            Used to append additional content (passed by reference).\n\t * @param object $object            The data object.\n\t * @param int    $depth             Depth of the item.\n\t * @param array  $args              An array of additional arguments.\n\t * @param int    $current_object_id ID of the current item.\n\t */\n\tpublic function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {}\n\n\t/**\n\t * Ends the element output, if needed.\n\t *\n\t * The $args parameter holds additional values that may be used with the child class methods.\n\t *\n\t * @since 2.1.0\n\t * @abstract\n\t *\n\t * @param string $output Used to append additional content (passed by reference).\n\t * @param object $object The data object.\n\t * @param int    $depth  Depth of the item.\n\t * @param array  $args   An array of additional arguments.\n\t */\n\tpublic function end_el( &$output, $object, $depth = 0, $args = array() ) {}\n\n\t/**\n\t * Traverse elements to create list from elements.\n\t *\n\t * Display one element if the element doesn't have any children otherwise,\n\t * display the element and its children. Will only traverse up to the max\n\t * depth and no ignore elements under that depth. It is possible to set the\n\t * max depth to include all depths, see walk() method.\n\t *\n\t * This method should not be called directly, use the walk() method instead.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param object $element           Data object.\n\t * @param array  $children_elements List of elements to continue traversing (passed by reference).\n\t * @param int    $max_depth         Max depth to traverse.\n\t * @param int    $depth             Depth of current element.\n\t * @param array  $args              An array of arguments.\n\t * @param string $output            Used to append additional content (passed by reference).\n\t */\n\tpublic function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {\n\t\tif ( ! $element ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$id_field = $this->db_fields['id'];\n\t\t$id       = $element->$id_field;\n\n\t\t// Display this element.\n\t\t$this->has_children = ! empty( $children_elements[ $id ] );\n\t\tif ( isset( $args[0] ) && is_array( $args[0] ) ) {\n\t\t\t$args[0]['has_children'] = $this->has_children; // Back-compat.\n\t\t}\n\n\t\t$this->start_el( $output, $element, $depth, ...array_values( $args ) );\n\n\t\t// Descend only when the depth is right and there are childrens for this element.\n\t\tif ( ( 0 == $max_depth || $max_depth > $depth + 1 ) && isset( $children_elements[ $id ] ) ) {\n\n\t\t\tforeach ( $children_elements[ $id ] as $child ) {\n\n\t\t\t\tif ( ! isset( $newlevel ) ) {\n\t\t\t\t\t$newlevel = true;\n\t\t\t\t\t// Start the child delimiter.\n\t\t\t\t\t$this->start_lvl( $output, $depth, ...array_values( $args ) );\n\t\t\t\t}\n\t\t\t\t$this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output );\n\t\t\t}\n\t\t\tunset( $children_elements[ $id ] );\n\t\t}\n\n\t\tif ( isset( $newlevel ) && $newlevel ) {\n\t\t\t// End the child delimiter.\n\t\t\t$this->end_lvl( $output, $depth, ...array_values( $args ) );\n\t\t}\n\n\t\t// End this element.\n\t\t$this->end_el( $output, $element, $depth, ...array_values( $args ) );\n\t}\n\n\t/**\n\t * Display array of elements hierarchically.\n\t *\n\t * Does not assume any existing order of elements.\n\t *\n\t * $max_depth = -1 means flatly display every element.\n\t * $max_depth = 0 means display all levels.\n\t * $max_depth > 0 specifies the number of display levels.\n\t *\n\t * @since 2.1.0\n\t * @since 5.3.0 Formalized the existing `...$args` parameter by adding it\n\t *              to the function signature.\n\t *\n\t * @param array $elements  An array of elements.\n\t * @param int   $max_depth The maximum hierarchical depth.\n\t * @param mixed ...$args   Optional additional arguments.\n\t * @return string The hierarchical item output.\n\t */\n\tpublic function walk( $elements, $max_depth, ...$args ) {\n\t\t$output = '';\n\n\t\t// Invalid parameter or nothing to walk.\n\t\tif ( $max_depth < -1 || empty( $elements ) ) {\n\t\t\treturn $output;\n\t\t}\n\n\t\t$parent_field = $this->db_fields['parent'];\n\n\t\t// Flat display.\n\t\tif ( -1 == $max_depth ) {\n\t\t\t$empty_array = array();\n\t\t\tforeach ( $elements as $e ) {\n\t\t\t\t$this->display_element( $e, $empty_array, 1, 0, $args, $output );\n\t\t\t}\n\t\t\treturn $output;\n\t\t}\n\n\t\t/*\n\t\t * Need to display in hierarchical order.\n\t\t * Separate elements into two buckets: top level and children elements.\n\t\t * Children_elements is two dimensional array, eg.\n\t\t * Children_elements[10][] contains all sub-elements whose parent is 10.\n\t\t */\n\t\t$top_level_elements = array();\n\t\t$children_elements  = array();\n\t\tforeach ( $elements as $e ) {\n\t\t\tif ( empty( $e->$parent_field ) ) {\n\t\t\t\t$top_level_elements[] = $e;\n\t\t\t} else {\n\t\t\t\t$children_elements[ $e->$parent_field ][] = $e;\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * When none of the elements is top level.\n\t\t * Assume the first one must be root of the sub elements.\n\t\t */\n\t\tif ( empty( $top_level_elements ) ) {\n\n\t\t\t$first = array_slice( $elements, 0, 1 );\n\t\t\t$root  = $first[0];\n\n\t\t\t$top_level_elements = array();\n\t\t\t$children_elements  = array();\n\t\t\tforeach ( $elements as $e ) {\n\t\t\t\tif ( $root->$parent_field == $e->$parent_field ) {\n\t\t\t\t\t$top_level_elements[] = $e;\n\t\t\t\t} else {\n\t\t\t\t\t$children_elements[ $e->$parent_field ][] = $e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $top_level_elements as $e ) {\n\t\t\t$this->display_element( $e, $children_elements, $max_depth, 0, $args, $output );\n\t\t}\n\n\t\t/*\n\t\t * If we are displaying all levels, and remaining children_elements is not empty,\n\t\t * then we got orphans, which should be displayed regardless.\n\t\t */\n\t\tif ( ( 0 == $max_depth ) && count( $children_elements ) > 0 ) {\n\t\t\t$empty_array = array();\n\t\t\tforeach ( $children_elements as $orphans ) {\n\t\t\t\tforeach ( $orphans as $op ) {\n\t\t\t\t\t$this->display_element( $op, $empty_array, 1, 0, $args, $output );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}\n\n\t/**\n\t * paged_walk() - produce a page of nested elements\n\t *\n\t * Given an array of hierarchical elements, the maximum depth, a specific page number,\n\t * and number of elements per page, this function first determines all top level root elements\n\t * belonging to that page, then lists them and all of their children in hierarchical order.\n\t *\n\t * $max_depth = 0 means display all levels.\n\t * $max_depth > 0 specifies the number of display levels.\n\t *\n\t * @since 2.7.0\n\t * @since 5.3.0 Formalized the existing `...$args` parameter by adding it\n\t *              to the function signature.\n\t *\n\t * @param array $elements\n\t * @param int   $max_depth The maximum hierarchical depth.\n\t * @param int   $page_num  The specific page number, beginning with 1.\n\t * @param int   $per_page\n\t * @param mixed ...$args   Optional additional arguments.\n\t * @return string XHTML of the specified page of elements\n\t */\n\tpublic function paged_walk( $elements, $max_depth, $page_num, $per_page, ...$args ) {\n\t\tif ( empty( $elements ) || $max_depth < -1 ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$output = '';\n\n\t\t$parent_field = $this->db_fields['parent'];\n\n\t\t$count = -1;\n\t\tif ( -1 == $max_depth ) {\n\t\t\t$total_top = count( $elements );\n\t\t}\n\t\tif ( $page_num < 1 || $per_page < 0 ) {\n\t\t\t// No paging.\n\t\t\t$paging = false;\n\t\t\t$start  = 0;\n\t\t\tif ( -1 == $max_depth ) {\n\t\t\t\t$end = $total_top;\n\t\t\t}\n\t\t\t$this->max_pages = 1;\n\t\t} else {\n\t\t\t$paging = true;\n\t\t\t$start  = ( (int) $page_num - 1 ) * (int) $per_page;\n\t\t\t$end    = $start + $per_page;\n\t\t\tif ( -1 == $max_depth ) {\n\t\t\t\t$this->max_pages = ceil( $total_top / $per_page );\n\t\t\t}\n\t\t}\n\n\t\t// Flat display.\n\t\tif ( -1 == $max_depth ) {\n\t\t\tif ( ! empty( $args[0]['reverse_top_level'] ) ) {\n\t\t\t\t$elements = array_reverse( $elements );\n\t\t\t\t$oldstart = $start;\n\t\t\t\t$start    = $total_top - $end;\n\t\t\t\t$end      = $total_top - $oldstart;\n\t\t\t}\n\n\t\t\t$empty_array = array();\n\t\t\tforeach ( $elements as $e ) {\n\t\t\t\t$count++;\n\t\t\t\tif ( $count < $start ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( $count >= $end ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$this->display_element( $e, $empty_array, 1, 0, $args, $output );\n\t\t\t}\n\t\t\treturn $output;\n\t\t}\n\n\t\t/*\n\t\t * Separate elements into two buckets: top level and children elements.\n\t\t * Children_elements is two dimensional array, e.g.\n\t\t * $children_elements[10][] contains all sub-elements whose parent is 10.\n\t\t */\n\t\t$top_level_elements = array();\n\t\t$children_elements  = array();\n\t\tforeach ( $elements as $e ) {\n\t\t\tif ( 0 == $e->$parent_field ) {\n\t\t\t\t$top_level_elements[] = $e;\n\t\t\t} else {\n\t\t\t\t$children_elements[ $e->$parent_field ][] = $e;\n\t\t\t}\n\t\t}\n\n\t\t$total_top = count( $top_level_elements );\n\t\tif ( $paging ) {\n\t\t\t$this->max_pages = ceil( $total_top / $per_page );\n\t\t} else {\n\t\t\t$end = $total_top;\n\t\t}\n\n\t\tif ( ! empty( $args[0]['reverse_top_level'] ) ) {\n\t\t\t$top_level_elements = array_reverse( $top_level_elements );\n\t\t\t$oldstart           = $start;\n\t\t\t$start              = $total_top - $end;\n\t\t\t$end                = $total_top - $oldstart;\n\t\t}\n\t\tif ( ! empty( $args[0]['reverse_children'] ) ) {\n\t\t\tforeach ( $children_elements as $parent => $children ) {\n\t\t\t\t$children_elements[ $parent ] = array_reverse( $children );\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $top_level_elements as $e ) {\n\t\t\t$count++;\n\n\t\t\t// For the last page, need to unset earlier children in order to keep track of orphans.\n\t\t\tif ( $end >= $total_top && $count < $start ) {\n\t\t\t\t\t$this->unset_children( $e, $children_elements );\n\t\t\t}\n\n\t\t\tif ( $count < $start ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $count >= $end ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$this->display_element( $e, $children_elements, $max_depth, 0, $args, $output );\n\t\t}\n\n\t\tif ( $end >= $total_top && count( $children_elements ) > 0 ) {\n\t\t\t$empty_array = array();\n\t\t\tforeach ( $children_elements as $orphans ) {\n\t\t\t\tforeach ( $orphans as $op ) {\n\t\t\t\t\t$this->display_element( $op, $empty_array, 1, 0, $args, $output );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}\n\n\t/**\n\t * Calculates the total number of root elements.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param array $elements Elements to list.\n\t * @return int Number of root elements.\n\t */\n\tpublic function get_number_of_root_elements( $elements ) {\n\t\t$num          = 0;\n\t\t$parent_field = $this->db_fields['parent'];\n\n\t\tforeach ( $elements as $e ) {\n\t\t\tif ( 0 == $e->$parent_field ) {\n\t\t\t\t$num++;\n\t\t\t}\n\t\t}\n\t\treturn $num;\n\t}\n\n\t/**\n\t * Unset all the children for a given top level element.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param object $e\n\t * @param array  $children_elements\n\t */\n\tpublic function unset_children( $e, &$children_elements ) {\n\t\tif ( ! $e || ! $children_elements ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$id_field = $this->db_fields['id'];\n\t\t$id       = $e->$id_field;\n\n\t\tif ( ! empty( $children_elements[ $id ] ) && is_array( $children_elements[ $id ] ) ) {\n\t\t\tforeach ( (array) $children_elements[ $id ] as $child ) {\n\t\t\t\t$this->unset_children( $child, $children_elements );\n\t\t\t}\n\t\t}\n\n\t\tunset( $children_elements[ $id ] );\n\t}\n\n}\n", "num_lines": 448}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Factory class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.4.0\n */\n\n/**\n * Singleton that registers and instantiates WP_Widget classes.\n *\n * @since 2.8.0\n * @since 4.4.0 Moved to its own file from wp-includes/widgets.php\n */\nclass WP_Widget_Factory {\n\n\t/**\n\t * Widgets array.\n\t *\n\t * @since 2.8.0\n\t * @var array\n\t */\n\tpublic $widgets = array();\n\n\t/**\n\t * PHP5 constructor.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function __construct() {\n\t\tadd_action( 'widgets_init', array( $this, '_register_widgets' ), 100 );\n\t}\n\n\t/**\n\t * PHP4 constructor.\n\t *\n\t * @since 2.8.0\n\t * @deprecated 4.3.0 Use __construct() instead.\n\t *\n\t * @see WP_Widget_Factory::__construct()\n\t */\n\tpublic function WP_Widget_Factory() {\n\t\t_deprecated_constructor( 'WP_Widget_Factory', '4.3.0' );\n\t\tself::__construct();\n\t}\n\n\t/**\n\t * Registers a widget subclass.\n\t *\n\t * @since 2.8.0\n\t * @since 4.6.0 Updated the `$widget` parameter to also accept a WP_Widget instance object\n\t *              instead of simply a `WP_Widget` subclass name.\n\t *\n\t * @param string|WP_Widget $widget Either the name of a `WP_Widget` subclass or an instance of a `WP_Widget` subclass.\n\t */\n\tpublic function register( $widget ) {\n\t\tif ( $widget instanceof WP_Widget ) {\n\t\t\t$this->widgets[ spl_object_hash( $widget ) ] = $widget;\n\t\t} else {\n\t\t\t$this->widgets[ $widget ] = new $widget();\n\t\t}\n\t}\n\n\t/**\n\t * Un-registers a widget subclass.\n\t *\n\t * @since 2.8.0\n\t * @since 4.6.0 Updated the `$widget` parameter to also accept a WP_Widget instance object\n\t *              instead of simply a `WP_Widget` subclass name.\n\t *\n\t * @param string|WP_Widget $widget Either the name of a `WP_Widget` subclass or an instance of a `WP_Widget` subclass.\n\t */\n\tpublic function unregister( $widget ) {\n\t\tif ( $widget instanceof WP_Widget ) {\n\t\t\tunset( $this->widgets[ spl_object_hash( $widget ) ] );\n\t\t} else {\n\t\t\tunset( $this->widgets[ $widget ] );\n\t\t}\n\t}\n\n\t/**\n\t * Serves as a utility method for adding widgets to the registered widgets global.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @global array $wp_registered_widgets\n\t */\n\tpublic function _register_widgets() {\n\t\tglobal $wp_registered_widgets;\n\t\t$keys       = array_keys( $this->widgets );\n\t\t$registered = array_keys( $wp_registered_widgets );\n\t\t$registered = array_map( '_get_widget_id_base', $registered );\n\n\t\tforeach ( $keys as $key ) {\n\t\t\t// Don't register new widget if old widget with the same id is already registered.\n\t\t\tif ( in_array( $this->widgets[ $key ]->id_base, $registered, true ) ) {\n\t\t\t\tunset( $this->widgets[ $key ] );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->widgets[ $key ]->_register();\n\t\t}\n\t}\n}\n", "num_lines": 106}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget base class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.4.0\n */\n\n/**\n * Core base class extended to register widgets.\n *\n * This class must be extended for each widget, and WP_Widget::widget() must be overridden.\n *\n * If adding widget options, WP_Widget::update() and WP_Widget::form() should also be overridden.\n *\n * @since 2.8.0\n * @since 4.4.0 Moved to its own file from wp-includes/widgets.php\n */\nclass WP_Widget {\n\n\t/**\n\t * Root ID for all widgets of this type.\n\t *\n\t * @since 2.8.0\n\t * @var mixed|string\n\t */\n\tpublic $id_base;\n\n\t/**\n\t * Name for this widget type.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $name;\n\n\t/**\n\t * Option name for this widget type.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $option_name;\n\n\t/**\n\t * Alt option name for this widget type.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $alt_option_name;\n\n\t/**\n\t * Option array passed to wp_register_sidebar_widget().\n\t *\n\t * @since 2.8.0\n\t * @var array\n\t */\n\tpublic $widget_options;\n\n\t/**\n\t * Option array passed to wp_register_widget_control().\n\t *\n\t * @since 2.8.0\n\t * @var array\n\t */\n\tpublic $control_options;\n\n\t/**\n\t * Unique ID number of the current instance.\n\t *\n\t * @since 2.8.0\n\t * @var bool|int\n\t */\n\tpublic $number = false;\n\n\t/**\n\t * Unique ID string of the current instance (id_base-number).\n\t *\n\t * @since 2.8.0\n\t * @var bool|string\n\t */\n\tpublic $id = false;\n\n\t/**\n\t * Whether the widget data has been updated.\n\t *\n\t * Set to true when the data is updated after a POST submit - ensures it does\n\t * not happen twice.\n\t *\n\t * @since 2.8.0\n\t * @var bool\n\t */\n\tpublic $updated = false;\n\n\t//\n\t// Member functions that must be overridden by subclasses.\n\t//\n\n\t/**\n\t * Echoes the widget content.\n\t *\n\t * Subclasses should override this function to generate their widget code.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $args     Display arguments including 'before_title', 'after_title',\n\t *                        'before_widget', and 'after_widget'.\n\t * @param array $instance The settings for the particular instance of the widget.\n\t */\n\tpublic function widget( $args, $instance ) {\n\t\tdie( 'function WP_Widget::widget() must be overridden in a subclass.' );\n\t}\n\n\t/**\n\t * Updates a particular instance of a widget.\n\t *\n\t * This function should check that `$new_instance` is set correctly. The newly-calculated\n\t * value of `$instance` should be returned. If false is returned, the instance won't be\n\t * saved/updated.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $new_instance New settings for this instance as input by the user via\n\t *                            WP_Widget::form().\n\t * @param array $old_instance Old settings for this instance.\n\t * @return array Settings to save or bool false to cancel saving.\n\t */\n\tpublic function update( $new_instance, $old_instance ) {\n\t\treturn $new_instance;\n\t}\n\n\t/**\n\t * Outputs the settings update form.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $instance Current settings.\n\t * @return string Default return is 'noform'.\n\t */\n\tpublic function form( $instance ) {\n\t\techo '<p class=\"no-options-widget\">' . __( 'There are no options for this widget.' ) . '</p>';\n\t\treturn 'noform';\n\t}\n\n\t// Functions you'll need to call.\n\n\t/**\n\t * PHP5 constructor.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $id_base         Optional. Base ID for the widget, lowercase and unique. If left empty,\n\t *                                a portion of the widget's class name will be used. Has to be unique.\n\t * @param string $name            Name for the widget displayed on the configuration page.\n\t * @param array  $widget_options  Optional. Widget options. See wp_register_sidebar_widget() for\n\t *                                information on accepted arguments. Default empty array.\n\t * @param array  $control_options Optional. Widget control options. See wp_register_widget_control() for\n\t *                                information on accepted arguments. Default empty array.\n\t */\n\tpublic function __construct( $id_base, $name, $widget_options = array(), $control_options = array() ) {\n\t\t$this->id_base         = empty( $id_base ) ? preg_replace( '/(wp_)?widget_/', '', strtolower( get_class( $this ) ) ) : strtolower( $id_base );\n\t\t$this->name            = $name;\n\t\t$this->option_name     = 'widget_' . $this->id_base;\n\t\t$this->widget_options  = wp_parse_args(\n\t\t\t$widget_options,\n\t\t\tarray(\n\t\t\t\t'classname'                   => $this->option_name,\n\t\t\t\t'customize_selective_refresh' => false,\n\t\t\t)\n\t\t);\n\t\t$this->control_options = wp_parse_args( $control_options, array( 'id_base' => $this->id_base ) );\n\t}\n\n\t/**\n\t * PHP4 constructor.\n\t *\n\t * @since 2.8.0\n\t * @deprecated 4.3.0 Use __construct() instead.\n\t *\n\t * @see WP_Widget::__construct()\n\t *\n\t * @param string $id_base         Optional. Base ID for the widget, lowercase and unique. If left empty,\n\t *                                a portion of the widget's class name will be used. Has to be unique.\n\t * @param string $name            Name for the widget displayed on the configuration page.\n\t * @param array  $widget_options  Optional. Widget options. See wp_register_sidebar_widget() for\n\t *                                information on accepted arguments. Default empty array.\n\t * @param array  $control_options Optional. Widget control options. See wp_register_widget_control() for\n\t *                                information on accepted arguments. Default empty array.\n\t */\n\tpublic function WP_Widget( $id_base, $name, $widget_options = array(), $control_options = array() ) {\n\t\t_deprecated_constructor( 'WP_Widget', '4.3.0', get_class( $this ) );\n\t\tWP_Widget::__construct( $id_base, $name, $widget_options, $control_options );\n\t}\n\n\t/**\n\t * Constructs name attributes for use in form() fields\n\t *\n\t * This function should be used in form() methods to create name attributes for fields\n\t * to be saved by update()\n\t *\n\t * @since 2.8.0\n\t * @since 4.4.0 Array format field names are now accepted.\n\t *\n\t * @param string $field_name Field name\n\t * @return string Name attribute for $field_name\n\t */\n\tpublic function get_field_name( $field_name ) {\n\t\t$pos = strpos( $field_name, '[' );\n\t\tif ( false === $pos ) {\n\t\t\treturn 'widget-' . $this->id_base . '[' . $this->number . '][' . $field_name . ']';\n\t\t} else {\n\t\t\treturn 'widget-' . $this->id_base . '[' . $this->number . '][' . substr_replace( $field_name, '][', $pos, strlen( '[' ) );\n\t\t}\n\t}\n\n\t/**\n\t * Constructs id attributes for use in WP_Widget::form() fields.\n\t *\n\t * This function should be used in form() methods to create id attributes\n\t * for fields to be saved by WP_Widget::update().\n\t *\n\t * @since 2.8.0\n\t * @since 4.4.0 Array format field IDs are now accepted.\n\t *\n\t * @param string $field_name Field name.\n\t * @return string ID attribute for `$field_name`.\n\t */\n\tpublic function get_field_id( $field_name ) {\n\t\treturn 'widget-' . $this->id_base . '-' . $this->number . '-' . trim( str_replace( array( '[]', '[', ']' ), array( '', '-', '' ), $field_name ), '-' );\n\t}\n\n\t/**\n\t * Register all widget instances of this widget class.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function _register() {\n\t\t$settings = $this->get_settings();\n\t\t$empty    = true;\n\n\t\t// When $settings is an array-like object, get an intrinsic array for use with array_keys().\n\t\tif ( $settings instanceof ArrayObject || $settings instanceof ArrayIterator ) {\n\t\t\t$settings = $settings->getArrayCopy();\n\t\t}\n\n\t\tif ( is_array( $settings ) ) {\n\t\t\tforeach ( array_keys( $settings ) as $number ) {\n\t\t\t\tif ( is_numeric( $number ) ) {\n\t\t\t\t\t$this->_set( $number );\n\t\t\t\t\t$this->_register_one( $number );\n\t\t\t\t\t$empty = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( $empty ) {\n\t\t\t// If there are none, we register the widget's existence with a generic template.\n\t\t\t$this->_set( 1 );\n\t\t\t$this->_register_one();\n\t\t}\n\t}\n\n\t/**\n\t * Sets the internal order number for the widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param int $number The unique order number of this widget instance compared to other\n\t *                    instances of the same class.\n\t */\n\tpublic function _set( $number ) {\n\t\t$this->number = $number;\n\t\t$this->id     = $this->id_base . '-' . $number;\n\t}\n\n\t/**\n\t * Retrieves the widget display callback.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return callable Display callback.\n\t */\n\tpublic function _get_display_callback() {\n\t\treturn array( $this, 'display_callback' );\n\t}\n\n\t/**\n\t * Retrieves the widget update callback.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return callable Update callback.\n\t */\n\tpublic function _get_update_callback() {\n\t\treturn array( $this, 'update_callback' );\n\t}\n\n\t/**\n\t * Retrieves the form callback.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return callable Form callback.\n\t */\n\tpublic function _get_form_callback() {\n\t\treturn array( $this, 'form_callback' );\n\t}\n\n\t/**\n\t * Determines whether the current request is inside the Customizer preview.\n\t *\n\t * If true -- the current request is inside the Customizer preview, then\n\t * the object cache gets suspended and widgets should check this to decide\n\t * whether they should store anything persistently to the object cache,\n\t * to transients, or anywhere else.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @global WP_Customize_Manager $wp_customize\n\t *\n\t * @return bool True if within the Customizer preview, false if not.\n\t */\n\tpublic function is_preview() {\n\t\tglobal $wp_customize;\n\t\treturn ( isset( $wp_customize ) && $wp_customize->is_preview() );\n\t}\n\n\t/**\n\t * Generates the actual widget content (Do NOT override).\n\t *\n\t * Finds the instance and calls WP_Widget::widget().\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array     $args        Display arguments. See WP_Widget::widget() for information\n\t *                               on accepted arguments.\n\t * @param int|array $widget_args {\n\t *     Optional. Internal order number of the widget instance, or array of multi-widget arguments.\n\t *     Default 1.\n\t *\n\t *     @type int $number Number increment used for multiples of the same widget.\n\t * }\n\t */\n\tpublic function display_callback( $args, $widget_args = 1 ) {\n\t\tif ( is_numeric( $widget_args ) ) {\n\t\t\t$widget_args = array( 'number' => $widget_args );\n\t\t}\n\n\t\t$widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) );\n\t\t$this->_set( $widget_args['number'] );\n\t\t$instances = $this->get_settings();\n\n\t\tif ( array_key_exists( $this->number, $instances ) ) {\n\t\t\t$instance = $instances[ $this->number ];\n\n\t\t\t/**\n\t\t\t * Filters the settings for a particular widget instance.\n\t\t\t *\n\t\t\t * Returning false will effectively short-circuit display of the widget.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t *\n\t\t\t * @param array     $instance The current widget instance's settings.\n\t\t\t * @param WP_Widget $this     The current widget instance.\n\t\t\t * @param array     $args     An array of default widget arguments.\n\t\t\t */\n\t\t\t$instance = apply_filters( 'widget_display_callback', $instance, $this, $args );\n\n\t\t\tif ( false === $instance ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$was_cache_addition_suspended = wp_suspend_cache_addition();\n\t\t\tif ( $this->is_preview() && ! $was_cache_addition_suspended ) {\n\t\t\t\twp_suspend_cache_addition( true );\n\t\t\t}\n\n\t\t\t$this->widget( $args, $instance );\n\n\t\t\tif ( $this->is_preview() ) {\n\t\t\t\twp_suspend_cache_addition( $was_cache_addition_suspended );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Handles changed settings (Do NOT override).\n\t *\n\t * @since 2.8.0\n\t *\n\t * @global array $wp_registered_widgets\n\t *\n\t * @param int $deprecated Not used.\n\t */\n\tpublic function update_callback( $deprecated = 1 ) {\n\t\tglobal $wp_registered_widgets;\n\n\t\t$all_instances = $this->get_settings();\n\n\t\t// We need to update the data.\n\t\tif ( $this->updated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( $_POST['delete_widget'] ) && $_POST['delete_widget'] ) {\n\t\t\t// Delete the settings for this instance of the widget.\n\t\t\tif ( isset( $_POST['the-widget-id'] ) ) {\n\t\t\t\t$del_id = $_POST['the-widget-id'];\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( isset( $wp_registered_widgets[ $del_id ]['params'][0]['number'] ) ) {\n\t\t\t\t$number = $wp_registered_widgets[ $del_id ]['params'][0]['number'];\n\n\t\t\t\tif ( $this->id_base . '-' . $number == $del_id ) {\n\t\t\t\t\tunset( $all_instances[ $number ] );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif ( isset( $_POST[ 'widget-' . $this->id_base ] ) && is_array( $_POST[ 'widget-' . $this->id_base ] ) ) {\n\t\t\t\t$settings = $_POST[ 'widget-' . $this->id_base ];\n\t\t\t} elseif ( isset( $_POST['id_base'] ) && $_POST['id_base'] == $this->id_base ) {\n\t\t\t\t$num      = $_POST['multi_number'] ? (int) $_POST['multi_number'] : (int) $_POST['widget_number'];\n\t\t\t\t$settings = array( $num => array() );\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tforeach ( $settings as $number => $new_instance ) {\n\t\t\t\t$new_instance = stripslashes_deep( $new_instance );\n\t\t\t\t$this->_set( $number );\n\n\t\t\t\t$old_instance = isset( $all_instances[ $number ] ) ? $all_instances[ $number ] : array();\n\n\t\t\t\t$was_cache_addition_suspended = wp_suspend_cache_addition();\n\t\t\t\tif ( $this->is_preview() && ! $was_cache_addition_suspended ) {\n\t\t\t\t\twp_suspend_cache_addition( true );\n\t\t\t\t}\n\n\t\t\t\t$instance = $this->update( $new_instance, $old_instance );\n\n\t\t\t\tif ( $this->is_preview() ) {\n\t\t\t\t\twp_suspend_cache_addition( $was_cache_addition_suspended );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Filters a widget's settings before saving.\n\t\t\t\t *\n\t\t\t\t * Returning false will effectively short-circuit the widget's ability\n\t\t\t\t * to update settings.\n\t\t\t\t *\n\t\t\t\t * @since 2.8.0\n\t\t\t\t *\n\t\t\t\t * @param array     $instance     The current widget instance's settings.\n\t\t\t\t * @param array     $new_instance Array of new widget settings.\n\t\t\t\t * @param array     $old_instance Array of old widget settings.\n\t\t\t\t * @param WP_Widget $this         The current widget instance.\n\t\t\t\t */\n\t\t\t\t$instance = apply_filters( 'widget_update_callback', $instance, $new_instance, $old_instance, $this );\n\t\t\t\tif ( false !== $instance ) {\n\t\t\t\t\t$all_instances[ $number ] = $instance;\n\t\t\t\t}\n\n\t\t\t\tbreak; // Run only once.\n\t\t\t}\n\t\t}\n\n\t\t$this->save_settings( $all_instances );\n\t\t$this->updated = true;\n\t}\n\n\t/**\n\t * Generates the widget control form (Do NOT override).\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param int|array $widget_args {\n\t *     Optional. Internal order number of the widget instance, or array of multi-widget arguments.\n\t *     Default 1.\n\t *\n\t *     @type int $number Number increment used for multiples of the same widget.\n\t * }\n\t * @return string|null\n\t */\n\tpublic function form_callback( $widget_args = 1 ) {\n\t\tif ( is_numeric( $widget_args ) ) {\n\t\t\t$widget_args = array( 'number' => $widget_args );\n\t\t}\n\n\t\t$widget_args   = wp_parse_args( $widget_args, array( 'number' => -1 ) );\n\t\t$all_instances = $this->get_settings();\n\n\t\tif ( -1 == $widget_args['number'] ) {\n\t\t\t// We echo out a form where 'number' can be set later.\n\t\t\t$this->_set( '__i__' );\n\t\t\t$instance = array();\n\t\t} else {\n\t\t\t$this->_set( $widget_args['number'] );\n\t\t\t$instance = $all_instances[ $widget_args['number'] ];\n\t\t}\n\n\t\t/**\n\t\t * Filters the widget instance's settings before displaying the control form.\n\t\t *\n\t\t * Returning false effectively short-circuits display of the control form.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param array     $instance The current widget instance's settings.\n\t\t * @param WP_Widget $this     The current widget instance.\n\t\t */\n\t\t$instance = apply_filters( 'widget_form_callback', $instance, $this );\n\n\t\t$return = null;\n\t\tif ( false !== $instance ) {\n\t\t\t$return = $this->form( $instance );\n\n\t\t\t/**\n\t\t\t * Fires at the end of the widget control form.\n\t\t\t *\n\t\t\t * Use this hook to add extra fields to the widget form. The hook\n\t\t\t * is only fired if the value passed to the 'widget_form_callback'\n\t\t\t * hook is not false.\n\t\t\t *\n\t\t\t * Note: If the widget has no form, the text echoed from the default\n\t\t\t * form method can be hidden using CSS.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t *\n\t\t\t * @param WP_Widget $this     The widget instance (passed by reference).\n\t\t\t * @param null      $return   Return null if new fields are added.\n\t\t\t * @param array     $instance An array of the widget's settings.\n\t\t\t */\n\t\t\tdo_action_ref_array( 'in_widget_form', array( &$this, &$return, $instance ) );\n\t\t}\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Registers an instance of the widget class.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param integer $number Optional. The unique order number of this widget instance\n\t *                        compared to other instances of the same class. Default -1.\n\t */\n\tpublic function _register_one( $number = -1 ) {\n\t\twp_register_sidebar_widget( $this->id, $this->name, $this->_get_display_callback(), $this->widget_options, array( 'number' => $number ) );\n\t\t_register_widget_update_callback( $this->id_base, $this->_get_update_callback(), $this->control_options, array( 'number' => -1 ) );\n\t\t_register_widget_form_callback( $this->id, $this->name, $this->_get_form_callback(), $this->control_options, array( 'number' => $number ) );\n\t}\n\n\t/**\n\t * Saves the settings for all instances of the widget class.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $settings Multi-dimensional array of widget instance settings.\n\t */\n\tpublic function save_settings( $settings ) {\n\t\t$settings['_multiwidget'] = 1;\n\t\tupdate_option( $this->option_name, $settings );\n\t}\n\n\t/**\n\t * Retrieves the settings for all instances of the widget class.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @return array Multi-dimensional array of widget instance settings.\n\t */\n\tpublic function get_settings() {\n\n\t\t$settings = get_option( $this->option_name );\n\n\t\tif ( false === $settings ) {\n\t\t\tif ( isset( $this->alt_option_name ) ) {\n\t\t\t\t$settings = get_option( $this->alt_option_name );\n\t\t\t} else {\n\t\t\t\t// Save an option so it can be autoloaded next time.\n\t\t\t\t$this->save_settings( array() );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! is_array( $settings ) && ! ( $settings instanceof ArrayObject || $settings instanceof ArrayIterator ) ) {\n\t\t\t$settings = array();\n\t\t}\n\n\t\tif ( ! empty( $settings ) && ! isset( $settings['_multiwidget'] ) ) {\n\t\t\t// Old format, convert if single widget.\n\t\t\t$settings = wp_convert_widget_settings( $this->id_base, $this->option_name, $settings );\n\t\t}\n\n\t\tunset( $settings['_multiwidget'], $settings['__i__'] );\n\t\treturn $settings;\n\t}\n}\n", "num_lines": 601}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * XML-RPC protocol support for WordPress\n *\n * @package WordPress\n * @subpackage Publishing\n */\n\n/**\n * WordPress XMLRPC server implementation.\n *\n * Implements compatibility for Blogger API, MetaWeblog API, MovableType, and\n * pingback. Additional WordPress API for managing comments, pages, posts,\n * options, etc.\n *\n * As of WordPress 3.5.0, XML-RPC is enabled by default. It can be disabled\n * via the {@see 'xmlrpc_enabled'} filter found in wp_xmlrpc_server::login().\n *\n * @since 1.5.0\n *\n * @see IXR_Server\n */\nclass wp_xmlrpc_server extends IXR_Server {\n\t/**\n\t * Methods.\n\t *\n\t * @var array\n\t */\n\tpublic $methods;\n\n\t/**\n\t * Blog options.\n\t *\n\t * @var array\n\t */\n\tpublic $blog_options;\n\n\t/**\n\t * IXR_Error instance.\n\t *\n\t * @var IXR_Error\n\t */\n\tpublic $error;\n\n\t/**\n\t * Flags that the user authentication has failed in this instance of wp_xmlrpc_server.\n\t *\n\t * @var bool\n\t */\n\tprotected $auth_failed = false;\n\n\t/**\n\t * Registers all of the XMLRPC methods that XMLRPC server understands.\n\t *\n\t * Sets up server and method property. Passes XMLRPC\n\t * methods through the {@see 'xmlrpc_methods'} filter to allow plugins to extend\n\t * or replace XML-RPC methods.\n\t *\n\t * @since 1.5.0\n\t */\n\tpublic function __construct() {\n\t\t$this->methods = array(\n\t\t\t// WordPress API.\n\t\t\t'wp.getUsersBlogs'                 => 'this:wp_getUsersBlogs',\n\t\t\t'wp.newPost'                       => 'this:wp_newPost',\n\t\t\t'wp.editPost'                      => 'this:wp_editPost',\n\t\t\t'wp.deletePost'                    => 'this:wp_deletePost',\n\t\t\t'wp.getPost'                       => 'this:wp_getPost',\n\t\t\t'wp.getPosts'                      => 'this:wp_getPosts',\n\t\t\t'wp.newTerm'                       => 'this:wp_newTerm',\n\t\t\t'wp.editTerm'                      => 'this:wp_editTerm',\n\t\t\t'wp.deleteTerm'                    => 'this:wp_deleteTerm',\n\t\t\t'wp.getTerm'                       => 'this:wp_getTerm',\n\t\t\t'wp.getTerms'                      => 'this:wp_getTerms',\n\t\t\t'wp.getTaxonomy'                   => 'this:wp_getTaxonomy',\n\t\t\t'wp.getTaxonomies'                 => 'this:wp_getTaxonomies',\n\t\t\t'wp.getUser'                       => 'this:wp_getUser',\n\t\t\t'wp.getUsers'                      => 'this:wp_getUsers',\n\t\t\t'wp.getProfile'                    => 'this:wp_getProfile',\n\t\t\t'wp.editProfile'                   => 'this:wp_editProfile',\n\t\t\t'wp.getPage'                       => 'this:wp_getPage',\n\t\t\t'wp.getPages'                      => 'this:wp_getPages',\n\t\t\t'wp.newPage'                       => 'this:wp_newPage',\n\t\t\t'wp.deletePage'                    => 'this:wp_deletePage',\n\t\t\t'wp.editPage'                      => 'this:wp_editPage',\n\t\t\t'wp.getPageList'                   => 'this:wp_getPageList',\n\t\t\t'wp.getAuthors'                    => 'this:wp_getAuthors',\n\t\t\t'wp.getCategories'                 => 'this:mw_getCategories',     // Alias.\n\t\t\t'wp.getTags'                       => 'this:wp_getTags',\n\t\t\t'wp.newCategory'                   => 'this:wp_newCategory',\n\t\t\t'wp.deleteCategory'                => 'this:wp_deleteCategory',\n\t\t\t'wp.suggestCategories'             => 'this:wp_suggestCategories',\n\t\t\t'wp.uploadFile'                    => 'this:mw_newMediaObject',    // Alias.\n\t\t\t'wp.deleteFile'                    => 'this:wp_deletePost',        // Alias.\n\t\t\t'wp.getCommentCount'               => 'this:wp_getCommentCount',\n\t\t\t'wp.getPostStatusList'             => 'this:wp_getPostStatusList',\n\t\t\t'wp.getPageStatusList'             => 'this:wp_getPageStatusList',\n\t\t\t'wp.getPageTemplates'              => 'this:wp_getPageTemplates',\n\t\t\t'wp.getOptions'                    => 'this:wp_getOptions',\n\t\t\t'wp.setOptions'                    => 'this:wp_setOptions',\n\t\t\t'wp.getComment'                    => 'this:wp_getComment',\n\t\t\t'wp.getComments'                   => 'this:wp_getComments',\n\t\t\t'wp.deleteComment'                 => 'this:wp_deleteComment',\n\t\t\t'wp.editComment'                   => 'this:wp_editComment',\n\t\t\t'wp.newComment'                    => 'this:wp_newComment',\n\t\t\t'wp.getCommentStatusList'          => 'this:wp_getCommentStatusList',\n\t\t\t'wp.getMediaItem'                  => 'this:wp_getMediaItem',\n\t\t\t'wp.getMediaLibrary'               => 'this:wp_getMediaLibrary',\n\t\t\t'wp.getPostFormats'                => 'this:wp_getPostFormats',\n\t\t\t'wp.getPostType'                   => 'this:wp_getPostType',\n\t\t\t'wp.getPostTypes'                  => 'this:wp_getPostTypes',\n\t\t\t'wp.getRevisions'                  => 'this:wp_getRevisions',\n\t\t\t'wp.restoreRevision'               => 'this:wp_restoreRevision',\n\n\t\t\t// Blogger API.\n\t\t\t'blogger.getUsersBlogs'            => 'this:blogger_getUsersBlogs',\n\t\t\t'blogger.getUserInfo'              => 'this:blogger_getUserInfo',\n\t\t\t'blogger.getPost'                  => 'this:blogger_getPost',\n\t\t\t'blogger.getRecentPosts'           => 'this:blogger_getRecentPosts',\n\t\t\t'blogger.newPost'                  => 'this:blogger_newPost',\n\t\t\t'blogger.editPost'                 => 'this:blogger_editPost',\n\t\t\t'blogger.deletePost'               => 'this:blogger_deletePost',\n\n\t\t\t// MetaWeblog API (with MT extensions to structs).\n\t\t\t'metaWeblog.newPost'               => 'this:mw_newPost',\n\t\t\t'metaWeblog.editPost'              => 'this:mw_editPost',\n\t\t\t'metaWeblog.getPost'               => 'this:mw_getPost',\n\t\t\t'metaWeblog.getRecentPosts'        => 'this:mw_getRecentPosts',\n\t\t\t'metaWeblog.getCategories'         => 'this:mw_getCategories',\n\t\t\t'metaWeblog.newMediaObject'        => 'this:mw_newMediaObject',\n\n\t\t\t// MetaWeblog API aliases for Blogger API.\n\t\t\t// See http://www.xmlrpc.com/stories/storyReader$2460\n\t\t\t'metaWeblog.deletePost'            => 'this:blogger_deletePost',\n\t\t\t'metaWeblog.getUsersBlogs'         => 'this:blogger_getUsersBlogs',\n\n\t\t\t// MovableType API.\n\t\t\t'mt.getCategoryList'               => 'this:mt_getCategoryList',\n\t\t\t'mt.getRecentPostTitles'           => 'this:mt_getRecentPostTitles',\n\t\t\t'mt.getPostCategories'             => 'this:mt_getPostCategories',\n\t\t\t'mt.setPostCategories'             => 'this:mt_setPostCategories',\n\t\t\t'mt.supportedMethods'              => 'this:mt_supportedMethods',\n\t\t\t'mt.supportedTextFilters'          => 'this:mt_supportedTextFilters',\n\t\t\t'mt.getTrackbackPings'             => 'this:mt_getTrackbackPings',\n\t\t\t'mt.publishPost'                   => 'this:mt_publishPost',\n\n\t\t\t// Pingback.\n\t\t\t'pingback.ping'                    => 'this:pingback_ping',\n\t\t\t'pingback.extensions.getPingbacks' => 'this:pingback_extensions_getPingbacks',\n\n\t\t\t'demo.sayHello'                    => 'this:sayHello',\n\t\t\t'demo.addTwoNumbers'               => 'this:addTwoNumbers',\n\t\t);\n\n\t\t$this->initialise_blog_option_info();\n\n\t\t/**\n\t\t * Filters the methods exposed by the XML-RPC server.\n\t\t *\n\t\t * This filter can be used to add new methods, and remove built-in methods.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param string[] $methods An array of XML-RPC methods, keyed by their methodName.\n\t\t */\n\t\t$this->methods = apply_filters( 'xmlrpc_methods', $this->methods );\n\t}\n\n\t/**\n\t * Make private/protected methods readable for backward compatibility.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $name      Method to call.\n\t * @param array  $arguments Arguments to pass when calling.\n\t * @return array|IXR_Error|false Return value of the callback, false otherwise.\n\t */\n\tpublic function __call( $name, $arguments ) {\n\t\tif ( '_multisite_getUsersBlogs' === $name ) {\n\t\t\treturn $this->_multisite_getUsersBlogs( ...$arguments );\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Serves the XML-RPC request.\n\t *\n\t * @since 2.9.0\n\t */\n\tpublic function serve_request() {\n\t\t$this->IXR_Server( $this->methods );\n\t}\n\n\t/**\n\t * Test XMLRPC API by saying, \"Hello!\" to client.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return string Hello string response.\n\t */\n\tpublic function sayHello() {\n\t\treturn 'Hello!';\n\t}\n\n\t/**\n\t * Test XMLRPC API by adding two numbers for client.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int $number1 A number to add.\n\t *     @type int $number2 A second number to add.\n\t * }\n\t * @return int Sum of the two given numbers.\n\t */\n\tpublic function addTwoNumbers( $args ) {\n\t\t$number1 = $args[0];\n\t\t$number2 = $args[1];\n\t\treturn $number1 + $number2;\n\t}\n\n\t/**\n\t * Log user in.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $username User's username.\n\t * @param string $password User's password.\n\t * @return WP_User|bool WP_User object if authentication passed, false otherwise\n\t */\n\tpublic function login( $username, $password ) {\n\t\t/*\n\t\t * Respect old get_option() filters left for back-compat when the 'enable_xmlrpc'\n\t\t * option was deprecated in 3.5.0. Use the 'xmlrpc_enabled' hook instead.\n\t\t */\n\t\t$enabled = apply_filters( 'pre_option_enable_xmlrpc', false );\n\t\tif ( false === $enabled ) {\n\t\t\t$enabled = apply_filters( 'option_enable_xmlrpc', true );\n\t\t}\n\n\t\t/**\n\t\t * Filters whether XML-RPC methods requiring authentication are enabled.\n\t\t *\n\t\t * Contrary to the way it's named, this filter does not control whether XML-RPC is *fully*\n\t\t * enabled, rather, it only controls whether XML-RPC methods requiring authentication - such\n\t\t * as for publishing purposes - are enabled.\n\t\t *\n\t\t * Further, the filter does not control whether pingbacks or other custom endpoints that don't\n\t\t * require authentication are enabled. This behavior is expected, and due to how parity was matched\n\t\t * with the `enable_xmlrpc` UI option the filter replaced when it was introduced in 3.5.\n\t\t *\n\t\t * To disable XML-RPC methods that require authentication, use:\n\t\t *\n\t\t *     add_filter( 'xmlrpc_enabled', '__return_false' );\n\t\t *\n\t\t * For more granular control over all XML-RPC methods and requests, see the {@see 'xmlrpc_methods'}\n\t\t * and {@see 'xmlrpc_element_limit'} hooks.\n\t\t *\n\t\t * @since 3.5.0\n\t\t *\n\t\t * @param bool $enabled Whether XML-RPC is enabled. Default true.\n\t\t */\n\t\t$enabled = apply_filters( 'xmlrpc_enabled', $enabled );\n\n\t\tif ( ! $enabled ) {\n\t\t\t$this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site.' ) ) );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $this->auth_failed ) {\n\t\t\t$user = new WP_Error( 'login_prevented' );\n\t\t} else {\n\t\t\t$user = wp_authenticate( $username, $password );\n\t\t}\n\n\t\tif ( is_wp_error( $user ) ) {\n\t\t\t$this->error = new IXR_Error( 403, __( 'Incorrect username or password.' ) );\n\n\t\t\t// Flag that authentication has failed once on this wp_xmlrpc_server instance.\n\t\t\t$this->auth_failed = true;\n\n\t\t\t/**\n\t\t\t * Filters the XML-RPC user login error message.\n\t\t\t *\n\t\t\t * @since 3.5.0\n\t\t\t *\n\t\t\t * @param string   $error The XML-RPC error message.\n\t\t\t * @param WP_Error $user  WP_Error object.\n\t\t\t */\n\t\t\t$this->error = apply_filters( 'xmlrpc_login_error', $this->error, $user );\n\t\t\treturn false;\n\t\t}\n\n\t\twp_set_current_user( $user->ID );\n\t\treturn $user;\n\t}\n\n\t/**\n\t * Check user's credentials. Deprecated.\n\t *\n\t * @since 1.5.0\n\t * @deprecated 2.8.0 Use wp_xmlrpc_server::login()\n\t * @see wp_xmlrpc_server::login()\n\t *\n\t * @param string $username User's username.\n\t * @param string $password User's password.\n\t * @return bool Whether authentication passed.\n\t */\n\tpublic function login_pass_ok( $username, $password ) {\n\t\treturn (bool) $this->login( $username, $password );\n\t}\n\n\t/**\n\t * Escape string or array of strings for database.\n\t *\n\t * @since 1.5.2\n\t *\n\t * @param string|array $data Escape single string or array of strings.\n\t * @return string|void Returns with string is passed, alters by-reference\n\t *                     when array is passed.\n\t */\n\tpublic function escape( &$data ) {\n\t\tif ( ! is_array( $data ) ) {\n\t\t\treturn wp_slash( $data );\n\t\t}\n\n\t\tforeach ( $data as &$v ) {\n\t\t\tif ( is_array( $v ) ) {\n\t\t\t\t$this->escape( $v );\n\t\t\t} elseif ( ! is_object( $v ) ) {\n\t\t\t\t$v = wp_slash( $v );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Retrieve custom fields for post.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param int $post_id Post ID.\n\t * @return array Custom fields, if exist.\n\t */\n\tpublic function get_custom_fields( $post_id ) {\n\t\t$post_id = (int) $post_id;\n\n\t\t$custom_fields = array();\n\n\t\tforeach ( (array) has_meta( $post_id ) as $meta ) {\n\t\t\t// Don't expose protected fields.\n\t\t\tif ( ! current_user_can( 'edit_post_meta', $post_id, $meta['meta_key'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$custom_fields[] = array(\n\t\t\t\t'id'    => $meta['meta_id'],\n\t\t\t\t'key'   => $meta['meta_key'],\n\t\t\t\t'value' => $meta['meta_value'],\n\t\t\t);\n\t\t}\n\n\t\treturn $custom_fields;\n\t}\n\n\t/**\n\t * Set custom fields for post.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param int   $post_id Post ID.\n\t * @param array $fields  Custom fields.\n\t */\n\tpublic function set_custom_fields( $post_id, $fields ) {\n\t\t$post_id = (int) $post_id;\n\n\t\tforeach ( (array) $fields as $meta ) {\n\t\t\tif ( isset( $meta['id'] ) ) {\n\t\t\t\t$meta['id'] = (int) $meta['id'];\n\t\t\t\t$pmeta      = get_metadata_by_mid( 'post', $meta['id'] );\n\n\t\t\t\tif ( ! $pmeta || $pmeta->post_id != $post_id ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( isset( $meta['key'] ) ) {\n\t\t\t\t\t$meta['key'] = wp_unslash( $meta['key'] );\n\t\t\t\t\tif ( $meta['key'] !== $pmeta->meta_key ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$meta['value'] = wp_unslash( $meta['value'] );\n\t\t\t\t\tif ( current_user_can( 'edit_post_meta', $post_id, $meta['key'] ) ) {\n\t\t\t\t\t\tupdate_metadata_by_mid( 'post', $meta['id'], $meta['value'] );\n\t\t\t\t\t}\n\t\t\t\t} elseif ( current_user_can( 'delete_post_meta', $post_id, $pmeta->meta_key ) ) {\n\t\t\t\t\tdelete_metadata_by_mid( 'post', $meta['id'] );\n\t\t\t\t}\n\t\t\t} elseif ( current_user_can( 'add_post_meta', $post_id, wp_unslash( $meta['key'] ) ) ) {\n\t\t\t\tadd_post_meta( $post_id, $meta['key'], $meta['value'] );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Retrieve custom fields for a term.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param int $term_id Term ID.\n\t * @return array Array of custom fields, if they exist.\n\t */\n\tpublic function get_term_custom_fields( $term_id ) {\n\t\t$term_id = (int) $term_id;\n\n\t\t$custom_fields = array();\n\n\t\tforeach ( (array) has_term_meta( $term_id ) as $meta ) {\n\n\t\t\tif ( ! current_user_can( 'edit_term_meta', $term_id ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$custom_fields[] = array(\n\t\t\t\t'id'    => $meta['meta_id'],\n\t\t\t\t'key'   => $meta['meta_key'],\n\t\t\t\t'value' => $meta['meta_value'],\n\t\t\t);\n\t\t}\n\n\t\treturn $custom_fields;\n\t}\n\n\t/**\n\t * Set custom fields for a term.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param int   $term_id Term ID.\n\t * @param array $fields  Custom fields.\n\t */\n\tpublic function set_term_custom_fields( $term_id, $fields ) {\n\t\t$term_id = (int) $term_id;\n\n\t\tforeach ( (array) $fields as $meta ) {\n\t\t\tif ( isset( $meta['id'] ) ) {\n\t\t\t\t$meta['id'] = (int) $meta['id'];\n\t\t\t\t$pmeta      = get_metadata_by_mid( 'term', $meta['id'] );\n\t\t\t\tif ( isset( $meta['key'] ) ) {\n\t\t\t\t\t$meta['key'] = wp_unslash( $meta['key'] );\n\t\t\t\t\tif ( $meta['key'] !== $pmeta->meta_key ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$meta['value'] = wp_unslash( $meta['value'] );\n\t\t\t\t\tif ( current_user_can( 'edit_term_meta', $term_id ) ) {\n\t\t\t\t\t\tupdate_metadata_by_mid( 'term', $meta['id'], $meta['value'] );\n\t\t\t\t\t}\n\t\t\t\t} elseif ( current_user_can( 'delete_term_meta', $term_id ) ) {\n\t\t\t\t\tdelete_metadata_by_mid( 'term', $meta['id'] );\n\t\t\t\t}\n\t\t\t} elseif ( current_user_can( 'add_term_meta', $term_id ) ) {\n\t\t\t\tadd_term_meta( $term_id, $meta['key'], $meta['value'] );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Set up blog options property.\n\t *\n\t * Passes property through {@see 'xmlrpc_blog_options'} filter.\n\t *\n\t * @since 2.6.0\n\t */\n\tpublic function initialise_blog_option_info() {\n\t\t$this->blog_options = array(\n\t\t\t// Read-only options.\n\t\t\t'software_name'           => array(\n\t\t\t\t'desc'     => __( 'Software Name' ),\n\t\t\t\t'readonly' => true,\n\t\t\t\t'value'    => 'WordPress',\n\t\t\t),\n\t\t\t'software_version'        => array(\n\t\t\t\t'desc'     => __( 'Software Version' ),\n\t\t\t\t'readonly' => true,\n\t\t\t\t'value'    => get_bloginfo( 'version' ),\n\t\t\t),\n\t\t\t'blog_url'                => array(\n\t\t\t\t'desc'     => __( 'WordPress Address (URL)' ),\n\t\t\t\t'readonly' => true,\n\t\t\t\t'option'   => 'siteurl',\n\t\t\t),\n\t\t\t'home_url'                => array(\n\t\t\t\t'desc'     => __( 'Site Address (URL)' ),\n\t\t\t\t'readonly' => true,\n\t\t\t\t'option'   => 'home',\n\t\t\t),\n\t\t\t'login_url'               => array(\n\t\t\t\t'desc'     => __( 'Login Address (URL)' ),\n\t\t\t\t'readonly' => true,\n\t\t\t\t'value'    => wp_login_url(),\n\t\t\t),\n\t\t\t'admin_url'               => array(\n\t\t\t\t'desc'     => __( 'The URL to the admin area' ),\n\t\t\t\t'readonly' => true,\n\t\t\t\t'value'    => get_admin_url(),\n\t\t\t),\n\t\t\t'image_default_link_type' => array(\n\t\t\t\t'desc'     => __( 'Image default link type' ),\n\t\t\t\t'readonly' => true,\n\t\t\t\t'option'   => 'image_default_link_type',\n\t\t\t),\n\t\t\t'image_default_size'      => array(\n\t\t\t\t'desc'     => __( 'Image default size' ),\n\t\t\t\t'readonly' => true,\n\t\t\t\t'option'   => 'image_default_size',\n\t\t\t),\n\t\t\t'image_default_align'     => array(\n\t\t\t\t'desc'     => __( 'Image default align' ),\n\t\t\t\t'readonly' => true,\n\t\t\t\t'option'   => 'image_default_align',\n\t\t\t),\n\t\t\t'template'                => array(\n\t\t\t\t'desc'     => __( 'Template' ),\n\t\t\t\t'readonly' => true,\n\t\t\t\t'option'   => 'template',\n\t\t\t),\n\t\t\t'stylesheet'              => array(\n\t\t\t\t'desc'     => __( 'Stylesheet' ),\n\t\t\t\t'readonly' => true,\n\t\t\t\t'option'   => 'stylesheet',\n\t\t\t),\n\t\t\t'post_thumbnail'          => array(\n\t\t\t\t'desc'     => __( 'Post Thumbnail' ),\n\t\t\t\t'readonly' => true,\n\t\t\t\t'value'    => current_theme_supports( 'post-thumbnails' ),\n\t\t\t),\n\n\t\t\t// Updatable options.\n\t\t\t'time_zone'               => array(\n\t\t\t\t'desc'     => __( 'Time Zone' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'gmt_offset',\n\t\t\t),\n\t\t\t'blog_title'              => array(\n\t\t\t\t'desc'     => __( 'Site Title' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'blogname',\n\t\t\t),\n\t\t\t'blog_tagline'            => array(\n\t\t\t\t'desc'     => __( 'Site Tagline' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'blogdescription',\n\t\t\t),\n\t\t\t'date_format'             => array(\n\t\t\t\t'desc'     => __( 'Date Format' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'date_format',\n\t\t\t),\n\t\t\t'time_format'             => array(\n\t\t\t\t'desc'     => __( 'Time Format' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'time_format',\n\t\t\t),\n\t\t\t'users_can_register'      => array(\n\t\t\t\t'desc'     => __( 'Allow new users to sign up' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'users_can_register',\n\t\t\t),\n\t\t\t'thumbnail_size_w'        => array(\n\t\t\t\t'desc'     => __( 'Thumbnail Width' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'thumbnail_size_w',\n\t\t\t),\n\t\t\t'thumbnail_size_h'        => array(\n\t\t\t\t'desc'     => __( 'Thumbnail Height' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'thumbnail_size_h',\n\t\t\t),\n\t\t\t'thumbnail_crop'          => array(\n\t\t\t\t'desc'     => __( 'Crop thumbnail to exact dimensions' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'thumbnail_crop',\n\t\t\t),\n\t\t\t'medium_size_w'           => array(\n\t\t\t\t'desc'     => __( 'Medium size image width' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'medium_size_w',\n\t\t\t),\n\t\t\t'medium_size_h'           => array(\n\t\t\t\t'desc'     => __( 'Medium size image height' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'medium_size_h',\n\t\t\t),\n\t\t\t'medium_large_size_w'     => array(\n\t\t\t\t'desc'     => __( 'Medium-Large size image width' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'medium_large_size_w',\n\t\t\t),\n\t\t\t'medium_large_size_h'     => array(\n\t\t\t\t'desc'     => __( 'Medium-Large size image height' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'medium_large_size_h',\n\t\t\t),\n\t\t\t'large_size_w'            => array(\n\t\t\t\t'desc'     => __( 'Large size image width' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'large_size_w',\n\t\t\t),\n\t\t\t'large_size_h'            => array(\n\t\t\t\t'desc'     => __( 'Large size image height' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'large_size_h',\n\t\t\t),\n\t\t\t'default_comment_status'  => array(\n\t\t\t\t'desc'     => __( 'Allow people to submit comments on new posts.' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'default_comment_status',\n\t\t\t),\n\t\t\t'default_ping_status'     => array(\n\t\t\t\t'desc'     => __( 'Allow link notifications from other blogs (pingbacks and trackbacks) on new posts.' ),\n\t\t\t\t'readonly' => false,\n\t\t\t\t'option'   => 'default_ping_status',\n\t\t\t),\n\t\t);\n\n\t\t/**\n\t\t * Filters the XML-RPC blog options property.\n\t\t *\n\t\t * @since 2.6.0\n\t\t *\n\t\t * @param array $blog_options An array of XML-RPC blog options.\n\t\t */\n\t\t$this->blog_options = apply_filters( 'xmlrpc_blog_options', $this->blog_options );\n\t}\n\n\t/**\n\t * Retrieve the blogs of the user.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type string $username Username.\n\t *     @type string $password Password.\n\t * }\n\t * @return array|IXR_Error Array contains:\n\t *  - 'isAdmin'\n\t *  - 'isPrimary' - whether the blog is the user's primary blog\n\t *  - 'url'\n\t *  - 'blogid'\n\t *  - 'blogName'\n\t *  - 'xmlrpc' - url of xmlrpc endpoint\n\t */\n\tpublic function wp_getUsersBlogs( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 2 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t// If this isn't on WPMU then just use blogger_getUsersBlogs().\n\t\tif ( ! is_multisite() ) {\n\t\t\tarray_unshift( $args, 1 );\n\t\t\treturn $this->blogger_getUsersBlogs( $args );\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username = $args[0];\n\t\t$password = $args[1];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/**\n\t\t * Fires after the XML-RPC user has been authenticated but before the rest of\n\t\t * the method logic begins.\n\t\t *\n\t\t * All built-in XML-RPC methods use the action xmlrpc_call, with a parameter\n\t\t * equal to the method's name, e.g., wp.getUsersBlogs, wp.newPost, etc.\n\t\t *\n\t\t * @since 2.5.0\n\t\t *\n\t\t * @param string $name The method name.\n\t\t */\n\t\tdo_action( 'xmlrpc_call', 'wp.getUsersBlogs' );\n\n\t\t$blogs           = (array) get_blogs_of_user( $user->ID );\n\t\t$struct          = array();\n\t\t$primary_blog_id = 0;\n\t\t$active_blog     = get_active_blog_for_user( $user->ID );\n\t\tif ( $active_blog ) {\n\t\t\t$primary_blog_id = (int) $active_blog->blog_id;\n\t\t}\n\n\t\tforeach ( $blogs as $blog ) {\n\t\t\t// Don't include blogs that aren't hosted at this site.\n\t\t\tif ( get_current_network_id() != $blog->site_id ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$blog_id = $blog->userblog_id;\n\n\t\t\tswitch_to_blog( $blog_id );\n\n\t\t\t$is_admin   = current_user_can( 'manage_options' );\n\t\t\t$is_primary = ( (int) $blog_id === $primary_blog_id );\n\n\t\t\t$struct[] = array(\n\t\t\t\t'isAdmin'   => $is_admin,\n\t\t\t\t'isPrimary' => $is_primary,\n\t\t\t\t'url'       => home_url( '/' ),\n\t\t\t\t'blogid'    => (string) $blog_id,\n\t\t\t\t'blogName'  => get_option( 'blogname' ),\n\t\t\t\t'xmlrpc'    => site_url( 'xmlrpc.php', 'rpc' ),\n\t\t\t);\n\n\t\t\trestore_current_blog();\n\t\t}\n\n\t\treturn $struct;\n\t}\n\n\t/**\n\t * Checks if the method received at least the minimum number of arguments.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param array $args  An array of arguments to check.\n\t * @param int   $count Minimum number of arguments.\n\t * @return bool True if `$args` contains at least `$count` arguments, false otherwise.\n\t */\n\tprotected function minimum_args( $args, $count ) {\n\t\tif ( ! is_array( $args ) || count( $args ) < $count ) {\n\t\t\t$this->error = new IXR_Error( 400, __( 'Insufficient arguments passed to this XML-RPC method.' ) );\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Prepares taxonomy data for return in an XML-RPC object.\n\t *\n\t * @param object $taxonomy The unprepared taxonomy data.\n\t * @param array  $fields   The subset of taxonomy fields to return.\n\t * @return array The prepared taxonomy data.\n\t */\n\tprotected function _prepare_taxonomy( $taxonomy, $fields ) {\n\t\t$_taxonomy = array(\n\t\t\t'name'         => $taxonomy->name,\n\t\t\t'label'        => $taxonomy->label,\n\t\t\t'hierarchical' => (bool) $taxonomy->hierarchical,\n\t\t\t'public'       => (bool) $taxonomy->public,\n\t\t\t'show_ui'      => (bool) $taxonomy->show_ui,\n\t\t\t'_builtin'     => (bool) $taxonomy->_builtin,\n\t\t);\n\n\t\tif ( in_array( 'labels', $fields, true ) ) {\n\t\t\t$_taxonomy['labels'] = (array) $taxonomy->labels;\n\t\t}\n\n\t\tif ( in_array( 'cap', $fields, true ) ) {\n\t\t\t$_taxonomy['cap'] = (array) $taxonomy->cap;\n\t\t}\n\n\t\tif ( in_array( 'menu', $fields, true ) ) {\n\t\t\t$_taxonomy['show_in_menu'] = (bool) $_taxonomy->show_in_menu;\n\t\t}\n\n\t\tif ( in_array( 'object_type', $fields, true ) ) {\n\t\t\t$_taxonomy['object_type'] = array_unique( (array) $taxonomy->object_type );\n\t\t}\n\n\t\t/**\n\t\t * Filters XML-RPC-prepared data for the given taxonomy.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param array       $_taxonomy An array of taxonomy data.\n\t\t * @param WP_Taxonomy $taxonomy  Taxonomy object.\n\t\t * @param array       $fields    The subset of taxonomy fields to return.\n\t\t */\n\t\treturn apply_filters( 'xmlrpc_prepare_taxonomy', $_taxonomy, $taxonomy, $fields );\n\t}\n\n\t/**\n\t * Prepares term data for return in an XML-RPC object.\n\t *\n\t * @param array|object $term The unprepared term data.\n\t * @return array The prepared term data.\n\t */\n\tprotected function _prepare_term( $term ) {\n\t\t$_term = $term;\n\t\tif ( ! is_array( $_term ) ) {\n\t\t\t$_term = get_object_vars( $_term );\n\t\t}\n\n\t\t// For integers which may be larger than XML-RPC supports ensure we return strings.\n\t\t$_term['term_id']          = strval( $_term['term_id'] );\n\t\t$_term['term_group']       = strval( $_term['term_group'] );\n\t\t$_term['term_taxonomy_id'] = strval( $_term['term_taxonomy_id'] );\n\t\t$_term['parent']           = strval( $_term['parent'] );\n\n\t\t// Count we are happy to return as an integer because people really shouldn't use terms that much.\n\t\t$_term['count'] = intval( $_term['count'] );\n\n\t\t// Get term meta.\n\t\t$_term['custom_fields'] = $this->get_term_custom_fields( $_term['term_id'] );\n\n\t\t/**\n\t\t * Filters XML-RPC-prepared data for the given term.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param array        $_term An array of term data.\n\t\t * @param array|object $term  Term object or array.\n\t\t */\n\t\treturn apply_filters( 'xmlrpc_prepare_term', $_term, $term );\n\t}\n\n\t/**\n\t * Convert a WordPress date string to an IXR_Date object.\n\t *\n\t * @param string $date Date string to convert.\n\t * @return IXR_Date IXR_Date object.\n\t */\n\tprotected function _convert_date( $date ) {\n\t\tif ( '0000-00-00 00:00:00' === $date ) {\n\t\t\treturn new IXR_Date( '00000000T00:00:00Z' );\n\t\t}\n\t\treturn new IXR_Date( mysql2date( 'Ymd\\TH:i:s', $date, false ) );\n\t}\n\n\t/**\n\t * Convert a WordPress GMT date string to an IXR_Date object.\n\t *\n\t * @param string $date_gmt WordPress GMT date string.\n\t * @param string $date     Date string.\n\t * @return IXR_Date IXR_Date object.\n\t */\n\tprotected function _convert_date_gmt( $date_gmt, $date ) {\n\t\tif ( '0000-00-00 00:00:00' !== $date && '0000-00-00 00:00:00' === $date_gmt ) {\n\t\t\treturn new IXR_Date( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $date, false ), 'Ymd\\TH:i:s' ) );\n\t\t}\n\t\treturn $this->_convert_date( $date_gmt );\n\t}\n\n\t/**\n\t * Prepares post data for return in an XML-RPC object.\n\t *\n\t * @param array $post   The unprepared post data.\n\t * @param array $fields The subset of post type fields to return.\n\t * @return array The prepared post data.\n\t */\n\tprotected function _prepare_post( $post, $fields ) {\n\t\t// Holds the data for this post. built up based on $fields.\n\t\t$_post = array( 'post_id' => strval( $post['ID'] ) );\n\n\t\t// Prepare common post fields.\n\t\t$post_fields = array(\n\t\t\t'post_title'        => $post['post_title'],\n\t\t\t'post_date'         => $this->_convert_date( $post['post_date'] ),\n\t\t\t'post_date_gmt'     => $this->_convert_date_gmt( $post['post_date_gmt'], $post['post_date'] ),\n\t\t\t'post_modified'     => $this->_convert_date( $post['post_modified'] ),\n\t\t\t'post_modified_gmt' => $this->_convert_date_gmt( $post['post_modified_gmt'], $post['post_modified'] ),\n\t\t\t'post_status'       => $post['post_status'],\n\t\t\t'post_type'         => $post['post_type'],\n\t\t\t'post_name'         => $post['post_name'],\n\t\t\t'post_author'       => $post['post_author'],\n\t\t\t'post_password'     => $post['post_password'],\n\t\t\t'post_excerpt'      => $post['post_excerpt'],\n\t\t\t'post_content'      => $post['post_content'],\n\t\t\t'post_parent'       => strval( $post['post_parent'] ),\n\t\t\t'post_mime_type'    => $post['post_mime_type'],\n\t\t\t'link'              => get_permalink( $post['ID'] ),\n\t\t\t'guid'              => $post['guid'],\n\t\t\t'menu_order'        => intval( $post['menu_order'] ),\n\t\t\t'comment_status'    => $post['comment_status'],\n\t\t\t'ping_status'       => $post['ping_status'],\n\t\t\t'sticky'            => ( 'post' === $post['post_type'] && is_sticky( $post['ID'] ) ),\n\t\t);\n\n\t\t// Thumbnail.\n\t\t$post_fields['post_thumbnail'] = array();\n\t\t$thumbnail_id                  = get_post_thumbnail_id( $post['ID'] );\n\t\tif ( $thumbnail_id ) {\n\t\t\t$thumbnail_size                = current_theme_supports( 'post-thumbnail' ) ? 'post-thumbnail' : 'thumbnail';\n\t\t\t$post_fields['post_thumbnail'] = $this->_prepare_media_item( get_post( $thumbnail_id ), $thumbnail_size );\n\t\t}\n\n\t\t// Consider future posts as published.\n\t\tif ( 'future' === $post_fields['post_status'] ) {\n\t\t\t$post_fields['post_status'] = 'publish';\n\t\t}\n\n\t\t// Fill in blank post format.\n\t\t$post_fields['post_format'] = get_post_format( $post['ID'] );\n\t\tif ( empty( $post_fields['post_format'] ) ) {\n\t\t\t$post_fields['post_format'] = 'standard';\n\t\t}\n\n\t\t// Merge requested $post_fields fields into $_post.\n\t\tif ( in_array( 'post', $fields, true ) ) {\n\t\t\t$_post = array_merge( $_post, $post_fields );\n\t\t} else {\n\t\t\t$requested_fields = array_intersect_key( $post_fields, array_flip( $fields ) );\n\t\t\t$_post            = array_merge( $_post, $requested_fields );\n\t\t}\n\n\t\t$all_taxonomy_fields = in_array( 'taxonomies', $fields, true );\n\n\t\tif ( $all_taxonomy_fields || in_array( 'terms', $fields, true ) ) {\n\t\t\t$post_type_taxonomies = get_object_taxonomies( $post['post_type'], 'names' );\n\t\t\t$terms                = wp_get_object_terms( $post['ID'], $post_type_taxonomies );\n\t\t\t$_post['terms']       = array();\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$_post['terms'][] = $this->_prepare_term( $term );\n\t\t\t}\n\t\t}\n\n\t\tif ( in_array( 'custom_fields', $fields, true ) ) {\n\t\t\t$_post['custom_fields'] = $this->get_custom_fields( $post['ID'] );\n\t\t}\n\n\t\tif ( in_array( 'enclosure', $fields, true ) ) {\n\t\t\t$_post['enclosure'] = array();\n\t\t\t$enclosures         = (array) get_post_meta( $post['ID'], 'enclosure' );\n\t\t\tif ( ! empty( $enclosures ) ) {\n\t\t\t\t$encdata                      = explode( \"\\n\", $enclosures[0] );\n\t\t\t\t$_post['enclosure']['url']    = trim( htmlspecialchars( $encdata[0] ) );\n\t\t\t\t$_post['enclosure']['length'] = (int) trim( $encdata[1] );\n\t\t\t\t$_post['enclosure']['type']   = trim( $encdata[2] );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters XML-RPC-prepared date for the given post.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param array $_post  An array of modified post data.\n\t\t * @param array $post   An array of post data.\n\t\t * @param array $fields An array of post fields.\n\t\t */\n\t\treturn apply_filters( 'xmlrpc_prepare_post', $_post, $post, $fields );\n\t}\n\n\t/**\n\t * Prepares post data for return in an XML-RPC object.\n\t *\n\t * @since 3.4.0\n\t * @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object.\n\t *\n\t * @param WP_Post_Type $post_type Post type object.\n\t * @param array        $fields    The subset of post fields to return.\n\t * @return array The prepared post type data.\n\t */\n\tprotected function _prepare_post_type( $post_type, $fields ) {\n\t\t$_post_type = array(\n\t\t\t'name'         => $post_type->name,\n\t\t\t'label'        => $post_type->label,\n\t\t\t'hierarchical' => (bool) $post_type->hierarchical,\n\t\t\t'public'       => (bool) $post_type->public,\n\t\t\t'show_ui'      => (bool) $post_type->show_ui,\n\t\t\t'_builtin'     => (bool) $post_type->_builtin,\n\t\t\t'has_archive'  => (bool) $post_type->has_archive,\n\t\t\t'supports'     => get_all_post_type_supports( $post_type->name ),\n\t\t);\n\n\t\tif ( in_array( 'labels', $fields, true ) ) {\n\t\t\t$_post_type['labels'] = (array) $post_type->labels;\n\t\t}\n\n\t\tif ( in_array( 'cap', $fields, true ) ) {\n\t\t\t$_post_type['cap']          = (array) $post_type->cap;\n\t\t\t$_post_type['map_meta_cap'] = (bool) $post_type->map_meta_cap;\n\t\t}\n\n\t\tif ( in_array( 'menu', $fields, true ) ) {\n\t\t\t$_post_type['menu_position'] = (int) $post_type->menu_position;\n\t\t\t$_post_type['menu_icon']     = $post_type->menu_icon;\n\t\t\t$_post_type['show_in_menu']  = (bool) $post_type->show_in_menu;\n\t\t}\n\n\t\tif ( in_array( 'taxonomies', $fields, true ) ) {\n\t\t\t$_post_type['taxonomies'] = get_object_taxonomies( $post_type->name, 'names' );\n\t\t}\n\n\t\t/**\n\t\t * Filters XML-RPC-prepared date for the given post type.\n\t\t *\n\t\t * @since 3.4.0\n\t\t * @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object.\n\t\t *\n\t\t * @param array        $_post_type An array of post type data.\n\t\t * @param WP_Post_Type $post_type  Post type object.\n\t\t */\n\t\treturn apply_filters( 'xmlrpc_prepare_post_type', $_post_type, $post_type );\n\t}\n\n\t/**\n\t * Prepares media item data for return in an XML-RPC object.\n\t *\n\t * @param object $media_item     The unprepared media item data.\n\t * @param string $thumbnail_size The image size to use for the thumbnail URL.\n\t * @return array The prepared media item data.\n\t */\n\tprotected function _prepare_media_item( $media_item, $thumbnail_size = 'thumbnail' ) {\n\t\t$_media_item = array(\n\t\t\t'attachment_id'    => strval( $media_item->ID ),\n\t\t\t'date_created_gmt' => $this->_convert_date_gmt( $media_item->post_date_gmt, $media_item->post_date ),\n\t\t\t'parent'           => $media_item->post_parent,\n\t\t\t'link'             => wp_get_attachment_url( $media_item->ID ),\n\t\t\t'title'            => $media_item->post_title,\n\t\t\t'caption'          => $media_item->post_excerpt,\n\t\t\t'description'      => $media_item->post_content,\n\t\t\t'metadata'         => wp_get_attachment_metadata( $media_item->ID ),\n\t\t\t'type'             => $media_item->post_mime_type,\n\t\t);\n\n\t\t$thumbnail_src = image_downsize( $media_item->ID, $thumbnail_size );\n\t\tif ( $thumbnail_src ) {\n\t\t\t$_media_item['thumbnail'] = $thumbnail_src[0];\n\t\t} else {\n\t\t\t$_media_item['thumbnail'] = $_media_item['link'];\n\t\t}\n\n\t\t/**\n\t\t * Filters XML-RPC-prepared data for the given media item.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param array  $_media_item    An array of media item data.\n\t\t * @param object $media_item     Media item object.\n\t\t * @param string $thumbnail_size Image size.\n\t\t */\n\t\treturn apply_filters( 'xmlrpc_prepare_media_item', $_media_item, $media_item, $thumbnail_size );\n\t}\n\n\t/**\n\t * Prepares page data for return in an XML-RPC object.\n\t *\n\t * @param object $page The unprepared page data.\n\t * @return array The prepared page data.\n\t */\n\tprotected function _prepare_page( $page ) {\n\t\t// Get all of the page content and link.\n\t\t$full_page = get_extended( $page->post_content );\n\t\t$link      = get_permalink( $page->ID );\n\n\t\t// Get info the page parent if there is one.\n\t\t$parent_title = '';\n\t\tif ( ! empty( $page->post_parent ) ) {\n\t\t\t$parent       = get_post( $page->post_parent );\n\t\t\t$parent_title = $parent->post_title;\n\t\t}\n\n\t\t// Determine comment and ping settings.\n\t\t$allow_comments = comments_open( $page->ID ) ? 1 : 0;\n\t\t$allow_pings    = pings_open( $page->ID ) ? 1 : 0;\n\n\t\t// Format page date.\n\t\t$page_date     = $this->_convert_date( $page->post_date );\n\t\t$page_date_gmt = $this->_convert_date_gmt( $page->post_date_gmt, $page->post_date );\n\n\t\t// Pull the categories info together.\n\t\t$categories = array();\n\t\tif ( is_object_in_taxonomy( 'page', 'category' ) ) {\n\t\t\tforeach ( wp_get_post_categories( $page->ID ) as $cat_id ) {\n\t\t\t\t$categories[] = get_cat_name( $cat_id );\n\t\t\t}\n\t\t}\n\n\t\t// Get the author info.\n\t\t$author = get_userdata( $page->post_author );\n\n\t\t$page_template = get_page_template_slug( $page->ID );\n\t\tif ( empty( $page_template ) ) {\n\t\t\t$page_template = 'default';\n\t\t}\n\n\t\t$_page = array(\n\t\t\t'dateCreated'            => $page_date,\n\t\t\t'userid'                 => $page->post_author,\n\t\t\t'page_id'                => $page->ID,\n\t\t\t'page_status'            => $page->post_status,\n\t\t\t'description'            => $full_page['main'],\n\t\t\t'title'                  => $page->post_title,\n\t\t\t'link'                   => $link,\n\t\t\t'permaLink'              => $link,\n\t\t\t'categories'             => $categories,\n\t\t\t'excerpt'                => $page->post_excerpt,\n\t\t\t'text_more'              => $full_page['extended'],\n\t\t\t'mt_allow_comments'      => $allow_comments,\n\t\t\t'mt_allow_pings'         => $allow_pings,\n\t\t\t'wp_slug'                => $page->post_name,\n\t\t\t'wp_password'            => $page->post_password,\n\t\t\t'wp_author'              => $author->display_name,\n\t\t\t'wp_page_parent_id'      => $page->post_parent,\n\t\t\t'wp_page_parent_title'   => $parent_title,\n\t\t\t'wp_page_order'          => $page->menu_order,\n\t\t\t'wp_author_id'           => (string) $author->ID,\n\t\t\t'wp_author_display_name' => $author->display_name,\n\t\t\t'date_created_gmt'       => $page_date_gmt,\n\t\t\t'custom_fields'          => $this->get_custom_fields( $page->ID ),\n\t\t\t'wp_page_template'       => $page_template,\n\t\t);\n\n\t\t/**\n\t\t * Filters XML-RPC-prepared data for the given page.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param array   $_page An array of page data.\n\t\t * @param WP_Post $page  Page object.\n\t\t */\n\t\treturn apply_filters( 'xmlrpc_prepare_page', $_page, $page );\n\t}\n\n\t/**\n\t * Prepares comment data for return in an XML-RPC object.\n\t *\n\t * @param object $comment The unprepared comment data.\n\t * @return array The prepared comment data.\n\t */\n\tprotected function _prepare_comment( $comment ) {\n\t\t// Format page date.\n\t\t$comment_date_gmt = $this->_convert_date_gmt( $comment->comment_date_gmt, $comment->comment_date );\n\n\t\tif ( '0' == $comment->comment_approved ) {\n\t\t\t$comment_status = 'hold';\n\t\t} elseif ( 'spam' === $comment->comment_approved ) {\n\t\t\t$comment_status = 'spam';\n\t\t} elseif ( '1' == $comment->comment_approved ) {\n\t\t\t$comment_status = 'approve';\n\t\t} else {\n\t\t\t$comment_status = $comment->comment_approved;\n\t\t}\n\t\t$_comment = array(\n\t\t\t'date_created_gmt' => $comment_date_gmt,\n\t\t\t'user_id'          => $comment->user_id,\n\t\t\t'comment_id'       => $comment->comment_ID,\n\t\t\t'parent'           => $comment->comment_parent,\n\t\t\t'status'           => $comment_status,\n\t\t\t'content'          => $comment->comment_content,\n\t\t\t'link'             => get_comment_link( $comment ),\n\t\t\t'post_id'          => $comment->comment_post_ID,\n\t\t\t'post_title'       => get_the_title( $comment->comment_post_ID ),\n\t\t\t'author'           => $comment->comment_author,\n\t\t\t'author_url'       => $comment->comment_author_url,\n\t\t\t'author_email'     => $comment->comment_author_email,\n\t\t\t'author_ip'        => $comment->comment_author_IP,\n\t\t\t'type'             => $comment->comment_type,\n\t\t);\n\n\t\t/**\n\t\t * Filters XML-RPC-prepared data for the given comment.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param array      $_comment An array of prepared comment data.\n\t\t * @param WP_Comment $comment  Comment object.\n\t\t */\n\t\treturn apply_filters( 'xmlrpc_prepare_comment', $_comment, $comment );\n\t}\n\n\t/**\n\t * Prepares user data for return in an XML-RPC object.\n\t *\n\t * @param WP_User $user   The unprepared user object.\n\t * @param array   $fields The subset of user fields to return.\n\t * @return array The prepared user data.\n\t */\n\tprotected function _prepare_user( $user, $fields ) {\n\t\t$_user = array( 'user_id' => strval( $user->ID ) );\n\n\t\t$user_fields = array(\n\t\t\t'username'     => $user->user_login,\n\t\t\t'first_name'   => $user->user_firstname,\n\t\t\t'last_name'    => $user->user_lastname,\n\t\t\t'registered'   => $this->_convert_date( $user->user_registered ),\n\t\t\t'bio'          => $user->user_description,\n\t\t\t'email'        => $user->user_email,\n\t\t\t'nickname'     => $user->nickname,\n\t\t\t'nicename'     => $user->user_nicename,\n\t\t\t'url'          => $user->user_url,\n\t\t\t'display_name' => $user->display_name,\n\t\t\t'roles'        => $user->roles,\n\t\t);\n\n\t\tif ( in_array( 'all', $fields, true ) ) {\n\t\t\t$_user = array_merge( $_user, $user_fields );\n\t\t} else {\n\t\t\tif ( in_array( 'basic', $fields, true ) ) {\n\t\t\t\t$basic_fields = array( 'username', 'email', 'registered', 'display_name', 'nicename' );\n\t\t\t\t$fields       = array_merge( $fields, $basic_fields );\n\t\t\t}\n\t\t\t$requested_fields = array_intersect_key( $user_fields, array_flip( $fields ) );\n\t\t\t$_user            = array_merge( $_user, $requested_fields );\n\t\t}\n\n\t\t/**\n\t\t * Filters XML-RPC-prepared data for the given user.\n\t\t *\n\t\t * @since 3.5.0\n\t\t *\n\t\t * @param array   $_user  An array of user data.\n\t\t * @param WP_User $user   User object.\n\t\t * @param array   $fields An array of user fields.\n\t\t */\n\t\treturn apply_filters( 'xmlrpc_prepare_user', $_user, $user, $fields );\n\t}\n\n\t/**\n\t * Create a new post for any registered post type.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @link https://en.wikipedia.org/wiki/RSS_enclosure for information on RSS enclosures.\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: top-level arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id        Blog ID (unused).\n\t *     @type string $username       Username.\n\t *     @type string $password       Password.\n\t *     @type array  $content_struct {\n\t *         Content struct for adding a new post. See wp_insert_post() for information on\n\t *         additional post fields\n\t *\n\t *         @type string $post_type      Post type. Default 'post'.\n\t *         @type string $post_status    Post status. Default 'draft'\n\t *         @type string $post_title     Post title.\n\t *         @type int    $post_author    Post author ID.\n\t *         @type string $post_excerpt   Post excerpt.\n\t *         @type string $post_content   Post content.\n\t *         @type string $post_date_gmt  Post date in GMT.\n\t *         @type string $post_date      Post date.\n\t *         @type string $post_password  Post password (20-character limit).\n\t *         @type string $comment_status Post comment enabled status. Accepts 'open' or 'closed'.\n\t *         @type string $ping_status    Post ping status. Accepts 'open' or 'closed'.\n\t *         @type bool   $sticky         Whether the post should be sticky. Automatically false if\n\t *                                      `$post_status` is 'private'.\n\t *         @type int    $post_thumbnail ID of an image to use as the post thumbnail/featured image.\n\t *         @type array  $custom_fields  Array of meta key/value pairs to add to the post.\n\t *         @type array  $terms          Associative array with taxonomy names as keys and arrays\n\t *                                      of term IDs as values.\n\t *         @type array  $terms_names    Associative array with taxonomy names as keys and arrays\n\t *                                      of term names as values.\n\t *         @type array  $enclosure      {\n\t *             Array of feed enclosure data to add to post meta.\n\t *\n\t *             @type string $url    URL for the feed enclosure.\n\t *             @type int    $length Size in bytes of the enclosure.\n\t *             @type string $type   Mime-type for the enclosure.\n\t *         }\n\t *     }\n\t * }\n\t * @return int|IXR_Error Post ID on success, IXR_Error instance otherwise.\n\t */\n\tpublic function wp_newPost( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 4 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username       = $args[1];\n\t\t$password       = $args[2];\n\t\t$content_struct = $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t// Convert the date field back to IXR form.\n\t\tif ( isset( $content_struct['post_date'] ) && ! ( $content_struct['post_date'] instanceof IXR_Date ) ) {\n\t\t\t$content_struct['post_date'] = $this->_convert_date( $content_struct['post_date'] );\n\t\t}\n\n\t\t/*\n\t\t * Ignore the existing GMT date if it is empty or a non-GMT date was supplied in $content_struct,\n\t\t * since _insert_post() will ignore the non-GMT date if the GMT date is set.\n\t\t */\n\t\tif ( isset( $content_struct['post_date_gmt'] ) && ! ( $content_struct['post_date_gmt'] instanceof IXR_Date ) ) {\n\t\t\tif ( '0000-00-00 00:00:00' === $content_struct['post_date_gmt'] || isset( $content_struct['post_date'] ) ) {\n\t\t\t\tunset( $content_struct['post_date_gmt'] );\n\t\t\t} else {\n\t\t\t\t$content_struct['post_date_gmt'] = $this->_convert_date( $content_struct['post_date_gmt'] );\n\t\t\t}\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.newPost' );\n\n\t\tunset( $content_struct['ID'] );\n\n\t\treturn $this->_insert_post( $user, $content_struct );\n\t}\n\n\t/**\n\t * Helper method for filtering out elements from an array.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param int $count Number to compare to one.\n\t */\n\tprivate function _is_greater_than_one( $count ) {\n\t\treturn $count > 1;\n\t}\n\n\t/**\n\t * Encapsulate the logic for sticking a post\n\t * and determining if the user has permission to do so\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param array $post_data\n\t * @param bool  $update\n\t * @return void|IXR_Error\n\t */\n\tprivate function _toggle_sticky( $post_data, $update = false ) {\n\t\t$post_type = get_post_type_object( $post_data['post_type'] );\n\n\t\t// Private and password-protected posts cannot be stickied.\n\t\tif ( 'private' === $post_data['post_status'] || ! empty( $post_data['post_password'] ) ) {\n\t\t\t// Error if the client tried to stick the post, otherwise, silently unstick.\n\t\t\tif ( ! empty( $post_data['sticky'] ) ) {\n\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you cannot stick a private post.' ) );\n\t\t\t}\n\n\t\t\tif ( $update ) {\n\t\t\t\tunstick_post( $post_data['ID'] );\n\t\t\t}\n\t\t} elseif ( isset( $post_data['sticky'] ) ) {\n\t\t\tif ( ! current_user_can( $post_type->cap->edit_others_posts ) ) {\n\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to make posts sticky.' ) );\n\t\t\t}\n\n\t\t\t$sticky = wp_validate_boolean( $post_data['sticky'] );\n\t\t\tif ( $sticky ) {\n\t\t\t\tstick_post( $post_data['ID'] );\n\t\t\t} else {\n\t\t\t\tunstick_post( $post_data['ID'] );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Helper method for wp_newPost() and wp_editPost(), containing shared logic.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @see wp_insert_post()\n\t *\n\t * @param WP_User         $user           The post author if post_author isn't set in $content_struct.\n\t * @param array|IXR_Error $content_struct Post data to insert.\n\t * @return IXR_Error|string\n\t */\n\tprotected function _insert_post( $user, $content_struct ) {\n\t\t$defaults = array(\n\t\t\t'post_status'    => 'draft',\n\t\t\t'post_type'      => 'post',\n\t\t\t'post_author'    => null,\n\t\t\t'post_password'  => null,\n\t\t\t'post_excerpt'   => null,\n\t\t\t'post_content'   => null,\n\t\t\t'post_title'     => null,\n\t\t\t'post_date'      => null,\n\t\t\t'post_date_gmt'  => null,\n\t\t\t'post_format'    => null,\n\t\t\t'post_name'      => null,\n\t\t\t'post_thumbnail' => null,\n\t\t\t'post_parent'    => null,\n\t\t\t'ping_status'    => null,\n\t\t\t'comment_status' => null,\n\t\t\t'custom_fields'  => null,\n\t\t\t'terms_names'    => null,\n\t\t\t'terms'          => null,\n\t\t\t'sticky'         => null,\n\t\t\t'enclosure'      => null,\n\t\t\t'ID'             => null,\n\t\t);\n\n\t\t$post_data = wp_parse_args( array_intersect_key( $content_struct, $defaults ), $defaults );\n\n\t\t$post_type = get_post_type_object( $post_data['post_type'] );\n\t\tif ( ! $post_type ) {\n\t\t\treturn new IXR_Error( 403, __( 'Invalid post type.' ) );\n\t\t}\n\n\t\t$update = ! empty( $post_data['ID'] );\n\n\t\tif ( $update ) {\n\t\t\tif ( ! get_post( $post_data['ID'] ) ) {\n\t\t\t\treturn new IXR_Error( 401, __( 'Invalid post ID.' ) );\n\t\t\t}\n\t\t\tif ( ! current_user_can( 'edit_post', $post_data['ID'] ) ) {\n\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );\n\t\t\t}\n\t\t\tif ( get_post_type( $post_data['ID'] ) !== $post_data['post_type'] ) {\n\t\t\t\treturn new IXR_Error( 401, __( 'The post type may not be changed.' ) );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( ! current_user_can( $post_type->cap->create_posts ) || ! current_user_can( $post_type->cap->edit_posts ) ) {\n\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to post on this site.' ) );\n\t\t\t}\n\t\t}\n\n\t\tswitch ( $post_data['post_status'] ) {\n\t\t\tcase 'draft':\n\t\t\tcase 'pending':\n\t\t\t\tbreak;\n\t\t\tcase 'private':\n\t\t\t\tif ( ! current_user_can( $post_type->cap->publish_posts ) ) {\n\t\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to create private posts in this post type.' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'publish':\n\t\t\tcase 'future':\n\t\t\t\tif ( ! current_user_can( $post_type->cap->publish_posts ) ) {\n\t\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to publish posts in this post type.' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif ( ! get_post_status_object( $post_data['post_status'] ) ) {\n\t\t\t\t\t$post_data['post_status'] = 'draft';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( ! empty( $post_data['post_password'] ) && ! current_user_can( $post_type->cap->publish_posts ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to create password protected posts in this post type.' ) );\n\t\t}\n\n\t\t$post_data['post_author'] = absint( $post_data['post_author'] );\n\t\tif ( ! empty( $post_data['post_author'] ) && $post_data['post_author'] != $user->ID ) {\n\t\t\tif ( ! current_user_can( $post_type->cap->edit_others_posts ) ) {\n\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to create posts as this user.' ) );\n\t\t\t}\n\n\t\t\t$author = get_userdata( $post_data['post_author'] );\n\n\t\t\tif ( ! $author ) {\n\t\t\t\treturn new IXR_Error( 404, __( 'Invalid author ID.' ) );\n\t\t\t}\n\t\t} else {\n\t\t\t$post_data['post_author'] = $user->ID;\n\t\t}\n\n\t\tif ( isset( $post_data['comment_status'] ) && 'open' !== $post_data['comment_status'] && 'closed' !== $post_data['comment_status'] ) {\n\t\t\tunset( $post_data['comment_status'] );\n\t\t}\n\n\t\tif ( isset( $post_data['ping_status'] ) && 'open' !== $post_data['ping_status'] && 'closed' !== $post_data['ping_status'] ) {\n\t\t\tunset( $post_data['ping_status'] );\n\t\t}\n\n\t\t// Do some timestamp voodoo.\n\t\tif ( ! empty( $post_data['post_date_gmt'] ) ) {\n\t\t\t// We know this is supposed to be GMT, so we're going to slap that Z on there by force.\n\t\t\t$dateCreated = rtrim( $post_data['post_date_gmt']->getIso(), 'Z' ) . 'Z';\n\t\t} elseif ( ! empty( $post_data['post_date'] ) ) {\n\t\t\t$dateCreated = $post_data['post_date']->getIso();\n\t\t}\n\n\t\t// Default to not flagging the post date to be edited unless it's intentional.\n\t\t$post_data['edit_date'] = false;\n\n\t\tif ( ! empty( $dateCreated ) ) {\n\t\t\t$post_data['post_date']     = iso8601_to_datetime( $dateCreated );\n\t\t\t$post_data['post_date_gmt'] = iso8601_to_datetime( $dateCreated, 'gmt' );\n\n\t\t\t// Flag the post date to be edited.\n\t\t\t$post_data['edit_date'] = true;\n\t\t}\n\n\t\tif ( ! isset( $post_data['ID'] ) ) {\n\t\t\t$post_data['ID'] = get_default_post_to_edit( $post_data['post_type'], true )->ID;\n\t\t}\n\t\t$post_ID = $post_data['ID'];\n\n\t\tif ( 'post' === $post_data['post_type'] ) {\n\t\t\t$error = $this->_toggle_sticky( $post_data, $update );\n\t\t\tif ( $error ) {\n\t\t\t\treturn $error;\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $post_data['post_thumbnail'] ) ) {\n\t\t\t// Empty value deletes, non-empty value adds/updates.\n\t\t\tif ( ! $post_data['post_thumbnail'] ) {\n\t\t\t\tdelete_post_thumbnail( $post_ID );\n\t\t\t} elseif ( ! get_post( absint( $post_data['post_thumbnail'] ) ) ) {\n\t\t\t\treturn new IXR_Error( 404, __( 'Invalid attachment ID.' ) );\n\t\t\t}\n\t\t\tset_post_thumbnail( $post_ID, $post_data['post_thumbnail'] );\n\t\t\tunset( $content_struct['post_thumbnail'] );\n\t\t}\n\n\t\tif ( isset( $post_data['custom_fields'] ) ) {\n\t\t\t$this->set_custom_fields( $post_ID, $post_data['custom_fields'] );\n\t\t}\n\n\t\tif ( isset( $post_data['terms'] ) || isset( $post_data['terms_names'] ) ) {\n\t\t\t$post_type_taxonomies = get_object_taxonomies( $post_data['post_type'], 'objects' );\n\n\t\t\t// Accumulate term IDs from terms and terms_names.\n\t\t\t$terms = array();\n\n\t\t\t// First validate the terms specified by ID.\n\t\t\tif ( isset( $post_data['terms'] ) && is_array( $post_data['terms'] ) ) {\n\t\t\t\t$taxonomies = array_keys( $post_data['terms'] );\n\n\t\t\t\t// Validating term IDs.\n\t\t\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t\t\tif ( ! array_key_exists( $taxonomy, $post_type_taxonomies ) ) {\n\t\t\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, one of the given taxonomies is not supported by the post type.' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! current_user_can( $post_type_taxonomies[ $taxonomy ]->cap->assign_terms ) ) {\n\t\t\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to assign a term to one of the given taxonomies.' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t$term_ids           = $post_data['terms'][ $taxonomy ];\n\t\t\t\t\t$terms[ $taxonomy ] = array();\n\t\t\t\t\tforeach ( $term_ids as $term_id ) {\n\t\t\t\t\t\t$term = get_term_by( 'id', $term_id, $taxonomy );\n\n\t\t\t\t\t\tif ( ! $term ) {\n\t\t\t\t\t\t\treturn new IXR_Error( 403, __( 'Invalid term ID.' ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$terms[ $taxonomy ][] = (int) $term_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Now validate terms specified by name.\n\t\t\tif ( isset( $post_data['terms_names'] ) && is_array( $post_data['terms_names'] ) ) {\n\t\t\t\t$taxonomies = array_keys( $post_data['terms_names'] );\n\n\t\t\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t\t\tif ( ! array_key_exists( $taxonomy, $post_type_taxonomies ) ) {\n\t\t\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, one of the given taxonomies is not supported by the post type.' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! current_user_can( $post_type_taxonomies[ $taxonomy ]->cap->assign_terms ) ) {\n\t\t\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to assign a term to one of the given taxonomies.' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t/*\n\t\t\t\t\t * For hierarchical taxonomies, we can't assign a term when multiple terms\n\t\t\t\t\t * in the hierarchy share the same name.\n\t\t\t\t\t */\n\t\t\t\t\t$ambiguous_terms = array();\n\t\t\t\t\tif ( is_taxonomy_hierarchical( $taxonomy ) ) {\n\t\t\t\t\t\t$tax_term_names = get_terms(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'taxonomy'   => $taxonomy,\n\t\t\t\t\t\t\t\t'fields'     => 'names',\n\t\t\t\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Count the number of terms with the same name.\n\t\t\t\t\t\t$tax_term_names_count = array_count_values( $tax_term_names );\n\n\t\t\t\t\t\t// Filter out non-ambiguous term names.\n\t\t\t\t\t\t$ambiguous_tax_term_counts = array_filter( $tax_term_names_count, array( $this, '_is_greater_than_one' ) );\n\n\t\t\t\t\t\t$ambiguous_terms = array_keys( $ambiguous_tax_term_counts );\n\t\t\t\t\t}\n\n\t\t\t\t\t$term_names = $post_data['terms_names'][ $taxonomy ];\n\t\t\t\t\tforeach ( $term_names as $term_name ) {\n\t\t\t\t\t\tif ( in_array( $term_name, $ambiguous_terms, true ) ) {\n\t\t\t\t\t\t\treturn new IXR_Error( 401, __( 'Ambiguous term name used in a hierarchical taxonomy. Please use term ID instead.' ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$term = get_term_by( 'name', $term_name, $taxonomy );\n\n\t\t\t\t\t\tif ( ! $term ) {\n\t\t\t\t\t\t\t// Term doesn't exist, so check that the user is allowed to create new terms.\n\t\t\t\t\t\t\tif ( ! current_user_can( $post_type_taxonomies[ $taxonomy ]->cap->edit_terms ) ) {\n\t\t\t\t\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to add a term to one of the given taxonomies.' ) );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Create the new term.\n\t\t\t\t\t\t\t$term_info = wp_insert_term( $term_name, $taxonomy );\n\t\t\t\t\t\t\tif ( is_wp_error( $term_info ) ) {\n\t\t\t\t\t\t\t\treturn new IXR_Error( 500, $term_info->get_error_message() );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$terms[ $taxonomy ][] = (int) $term_info['term_id'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$terms[ $taxonomy ][] = (int) $term->term_id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$post_data['tax_input'] = $terms;\n\t\t\tunset( $post_data['terms'], $post_data['terms_names'] );\n\t\t}\n\n\t\tif ( isset( $post_data['post_format'] ) ) {\n\t\t\t$format = set_post_format( $post_ID, $post_data['post_format'] );\n\n\t\t\tif ( is_wp_error( $format ) ) {\n\t\t\t\treturn new IXR_Error( 500, $format->get_error_message() );\n\t\t\t}\n\n\t\t\tunset( $post_data['post_format'] );\n\t\t}\n\n\t\t// Handle enclosures.\n\t\t$enclosure = isset( $post_data['enclosure'] ) ? $post_data['enclosure'] : null;\n\t\t$this->add_enclosure_if_new( $post_ID, $enclosure );\n\n\t\t$this->attach_uploads( $post_ID, $post_data['post_content'] );\n\n\t\t/**\n\t\t * Filters post data array to be inserted via XML-RPC.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param array $post_data      Parsed array of post data.\n\t\t * @param array $content_struct Post data array.\n\t\t */\n\t\t$post_data = apply_filters( 'xmlrpc_wp_insert_post_data', $post_data, $content_struct );\n\n\t\t$post_ID = $update ? wp_update_post( $post_data, true ) : wp_insert_post( $post_data, true );\n\t\tif ( is_wp_error( $post_ID ) ) {\n\t\t\treturn new IXR_Error( 500, $post_ID->get_error_message() );\n\t\t}\n\n\t\tif ( ! $post_ID ) {\n\t\t\tif ( $update ) {\n\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, the post could not be updated.' ) );\n\t\t\t} else {\n\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, the post could not be created.' ) );\n\t\t\t}\n\t\t}\n\n\t\treturn strval( $post_ID );\n\t}\n\n\t/**\n\t * Edit a post for any registered post type.\n\t *\n\t * The $content_struct parameter only needs to contain fields that\n\t * should be changed. All other fields will retain their existing values.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id        Blog ID (unused).\n\t *     @type string $username       Username.\n\t *     @type string $password       Password.\n\t *     @type int    $post_id        Post ID.\n\t *     @type array  $content_struct Extra content arguments.\n\t * }\n\t * @return true|IXR_Error True on success, IXR_Error on failure.\n\t */\n\tpublic function wp_editPost( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 5 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username       = $args[1];\n\t\t$password       = $args[2];\n\t\t$post_id        = (int) $args[3];\n\t\t$content_struct = $args[4];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.editPost' );\n\n\t\t$post = get_post( $post_id, ARRAY_A );\n\n\t\tif ( empty( $post['ID'] ) ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\tif ( isset( $content_struct['if_not_modified_since'] ) ) {\n\t\t\t// If the post has been modified since the date provided, return an error.\n\t\t\tif ( mysql2date( 'U', $post['post_modified_gmt'] ) > $content_struct['if_not_modified_since']->getTimestamp() ) {\n\t\t\t\treturn new IXR_Error( 409, __( 'There is a revision of this post that is more recent.' ) );\n\t\t\t}\n\t\t}\n\n\t\t// Convert the date field back to IXR form.\n\t\t$post['post_date'] = $this->_convert_date( $post['post_date'] );\n\n\t\t/*\n\t\t * Ignore the existing GMT date if it is empty or a non-GMT date was supplied in $content_struct,\n\t\t * since _insert_post() will ignore the non-GMT date if the GMT date is set.\n\t\t */\n\t\tif ( '0000-00-00 00:00:00' === $post['post_date_gmt'] || isset( $content_struct['post_date'] ) ) {\n\t\t\tunset( $post['post_date_gmt'] );\n\t\t} else {\n\t\t\t$post['post_date_gmt'] = $this->_convert_date( $post['post_date_gmt'] );\n\t\t}\n\n\t\t/*\n\t\t * If the API client did not provide 'post_date', then we must not perpetuate the value that\n\t\t * was stored in the database, or it will appear to be an intentional edit. Conveying it here\n\t\t * as if it was coming from the API client will cause an otherwise zeroed out 'post_date_gmt'\n\t\t * to get set with the value that was originally stored in the database when the draft was created.\n\t\t */\n\t\tif ( ! isset( $content_struct['post_date'] ) ) {\n\t\t\tunset( $post['post_date'] );\n\t\t}\n\n\t\t$this->escape( $post );\n\t\t$merged_content_struct = array_merge( $post, $content_struct );\n\n\t\t$retval = $this->_insert_post( $user, $merged_content_struct );\n\t\tif ( $retval instanceof IXR_Error ) {\n\t\t\treturn $retval;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Delete a post for any registered post type.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @see wp_delete_post()\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id  Blog ID (unused).\n\t *     @type string $username Username.\n\t *     @type string $password Password.\n\t *     @type int    $post_id  Post ID.\n\t * }\n\t * @return true|IXR_Error True on success, IXR_Error instance on failure.\n\t */\n\tpublic function wp_deletePost( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 4 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$post_id  = (int) $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.deletePost' );\n\n\t\t$post = get_post( $post_id, ARRAY_A );\n\t\tif ( empty( $post['ID'] ) ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'delete_post', $post_id ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this post.' ) );\n\t\t}\n\n\t\t$result = wp_delete_post( $post_id );\n\n\t\tif ( ! $result ) {\n\t\t\treturn new IXR_Error( 500, __( 'Sorry, the post could not be deleted.' ) );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieve a post.\n\t *\n\t * @since 3.4.0\n\t *\n\t * The optional $fields parameter specifies what fields will be included\n\t * in the response array. This should be a list of field names. 'post_id' will\n\t * always be included in the response regardless of the value of $fields.\n\t *\n\t * Instead of, or in addition to, individual field names, conceptual group\n\t * names can be used to specify multiple fields. The available conceptual\n\t * groups are 'post' (all basic fields), 'taxonomies', 'custom_fields',\n\t * and 'enclosure'.\n\t *\n\t * @see get_post()\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id  Blog ID (unused).\n\t *     @type string $username Username.\n\t *     @type string $password Password.\n\t *     @type int    $post_id  Post ID.\n\t *     @type array  $fields   The subset of post type fields to return.\n\t * }\n\t * @return array|IXR_Error Array contains (based on $fields parameter):\n\t *  - 'post_id'\n\t *  - 'post_title'\n\t *  - 'post_date'\n\t *  - 'post_date_gmt'\n\t *  - 'post_modified'\n\t *  - 'post_modified_gmt'\n\t *  - 'post_status'\n\t *  - 'post_type'\n\t *  - 'post_name'\n\t *  - 'post_author'\n\t *  - 'post_password'\n\t *  - 'post_excerpt'\n\t *  - 'post_content'\n\t *  - 'link'\n\t *  - 'comment_status'\n\t *  - 'ping_status'\n\t *  - 'sticky'\n\t *  - 'custom_fields'\n\t *  - 'terms'\n\t *  - 'categories'\n\t *  - 'tags'\n\t *  - 'enclosure'\n\t */\n\tpublic function wp_getPost( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 4 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$post_id  = (int) $args[3];\n\n\t\tif ( isset( $args[4] ) ) {\n\t\t\t$fields = $args[4];\n\t\t} else {\n\t\t\t/**\n\t\t\t * Filters the list of post query fields used by the given XML-RPC method.\n\t\t\t *\n\t\t\t * @since 3.4.0\n\t\t\t *\n\t\t\t * @param array  $fields Array of post fields. Default array contains 'post', 'terms', and 'custom_fields'.\n\t\t\t * @param string $method Method name.\n\t\t\t */\n\t\t\t$fields = apply_filters( 'xmlrpc_default_post_fields', array( 'post', 'terms', 'custom_fields' ), 'wp.getPost' );\n\t\t}\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getPost' );\n\n\t\t$post = get_post( $post_id, ARRAY_A );\n\n\t\tif ( empty( $post['ID'] ) ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );\n\t\t}\n\n\t\treturn $this->_prepare_post( $post, $fields );\n\t}\n\n\t/**\n\t * Retrieve posts.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @see wp_get_recent_posts()\n\t * @see wp_getPost() for more on `$fields`\n\t * @see get_posts() for more on `$filter` values\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id  Blog ID (unused).\n\t *     @type string $username Username.\n\t *     @type string $password Password.\n\t *     @type array  $filter   Optional. Modifies the query used to retrieve posts. Accepts 'post_type',\n\t *                            'post_status', 'number', 'offset', 'orderby', 's', and 'order'.\n\t *                            Default empty array.\n\t *     @type array  $fields   Optional. The subset of post type fields to return in the response array.\n\t * }\n\t * @return array|IXR_Error Array contains a collection of posts.\n\t */\n\tpublic function wp_getPosts( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 3 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$filter   = isset( $args[3] ) ? $args[3] : array();\n\n\t\tif ( isset( $args[4] ) ) {\n\t\t\t$fields = $args[4];\n\t\t} else {\n\t\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\t\t$fields = apply_filters( 'xmlrpc_default_post_fields', array( 'post', 'terms', 'custom_fields' ), 'wp.getPosts' );\n\t\t}\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getPosts' );\n\n\t\t$query = array();\n\n\t\tif ( isset( $filter['post_type'] ) ) {\n\t\t\t$post_type = get_post_type_object( $filter['post_type'] );\n\t\t\tif ( ! ( (bool) $post_type ) ) {\n\t\t\t\treturn new IXR_Error( 403, __( 'Invalid post type.' ) );\n\t\t\t}\n\t\t} else {\n\t\t\t$post_type = get_post_type_object( 'post' );\n\t\t}\n\n\t\tif ( ! current_user_can( $post_type->cap->edit_posts ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type.' ) );\n\t\t}\n\n\t\t$query['post_type'] = $post_type->name;\n\n\t\tif ( isset( $filter['post_status'] ) ) {\n\t\t\t$query['post_status'] = $filter['post_status'];\n\t\t}\n\n\t\tif ( isset( $filter['number'] ) ) {\n\t\t\t$query['numberposts'] = absint( $filter['number'] );\n\t\t}\n\n\t\tif ( isset( $filter['offset'] ) ) {\n\t\t\t$query['offset'] = absint( $filter['offset'] );\n\t\t}\n\n\t\tif ( isset( $filter['orderby'] ) ) {\n\t\t\t$query['orderby'] = $filter['orderby'];\n\n\t\t\tif ( isset( $filter['order'] ) ) {\n\t\t\t\t$query['order'] = $filter['order'];\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $filter['s'] ) ) {\n\t\t\t$query['s'] = $filter['s'];\n\t\t}\n\n\t\t$posts_list = wp_get_recent_posts( $query );\n\n\t\tif ( ! $posts_list ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t// Holds all the posts data.\n\t\t$struct = array();\n\n\t\tforeach ( $posts_list as $post ) {\n\t\t\tif ( ! current_user_can( 'edit_post', $post['ID'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$struct[] = $this->_prepare_post( $post, $fields );\n\t\t}\n\n\t\treturn $struct;\n\t}\n\n\t/**\n\t * Create a new term.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @see wp_insert_term()\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id        Blog ID (unused).\n\t *     @type string $username       Username.\n\t *     @type string $password       Password.\n\t *     @type array  $content_struct Content struct for adding a new term. The struct must contain\n\t *                                  the term 'name' and 'taxonomy'. Optional accepted values include\n\t *                                  'parent', 'description', and 'slug'.\n\t * }\n\t * @return int|IXR_Error The term ID on success, or an IXR_Error object on failure.\n\t */\n\tpublic function wp_newTerm( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 4 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username       = $args[1];\n\t\t$password       = $args[2];\n\t\t$content_struct = $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.newTerm' );\n\n\t\tif ( ! taxonomy_exists( $content_struct['taxonomy'] ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Invalid taxonomy.' ) );\n\t\t}\n\n\t\t$taxonomy = get_taxonomy( $content_struct['taxonomy'] );\n\n\t\tif ( ! current_user_can( $taxonomy->cap->edit_terms ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to create terms in this taxonomy.' ) );\n\t\t}\n\n\t\t$taxonomy = (array) $taxonomy;\n\n\t\t// Hold the data of the term.\n\t\t$term_data = array();\n\n\t\t$term_data['name'] = trim( $content_struct['name'] );\n\t\tif ( empty( $term_data['name'] ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'The term name cannot be empty.' ) );\n\t\t}\n\n\t\tif ( isset( $content_struct['parent'] ) ) {\n\t\t\tif ( ! $taxonomy['hierarchical'] ) {\n\t\t\t\treturn new IXR_Error( 403, __( 'This taxonomy is not hierarchical.' ) );\n\t\t\t}\n\n\t\t\t$parent_term_id = (int) $content_struct['parent'];\n\t\t\t$parent_term    = get_term( $parent_term_id, $taxonomy['name'] );\n\n\t\t\tif ( is_wp_error( $parent_term ) ) {\n\t\t\t\treturn new IXR_Error( 500, $parent_term->get_error_message() );\n\t\t\t}\n\n\t\t\tif ( ! $parent_term ) {\n\t\t\t\treturn new IXR_Error( 403, __( 'Parent term does not exist.' ) );\n\t\t\t}\n\n\t\t\t$term_data['parent'] = $content_struct['parent'];\n\t\t}\n\n\t\tif ( isset( $content_struct['description'] ) ) {\n\t\t\t$term_data['description'] = $content_struct['description'];\n\t\t}\n\n\t\tif ( isset( $content_struct['slug'] ) ) {\n\t\t\t$term_data['slug'] = $content_struct['slug'];\n\t\t}\n\n\t\t$term = wp_insert_term( $term_data['name'], $taxonomy['name'], $term_data );\n\n\t\tif ( is_wp_error( $term ) ) {\n\t\t\treturn new IXR_Error( 500, $term->get_error_message() );\n\t\t}\n\n\t\tif ( ! $term ) {\n\t\t\treturn new IXR_Error( 500, __( 'Sorry, the term could not be created.' ) );\n\t\t}\n\n\t\t// Add term meta.\n\t\tif ( isset( $content_struct['custom_fields'] ) ) {\n\t\t\t$this->set_term_custom_fields( $term['term_id'], $content_struct['custom_fields'] );\n\t\t}\n\n\t\treturn strval( $term['term_id'] );\n\t}\n\n\t/**\n\t * Edit a term.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @see wp_update_term()\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id        Blog ID (unused).\n\t *     @type string $username       Username.\n\t *     @type string $password       Password.\n\t *     @type int    $term_id        Term ID.\n\t *     @type array  $content_struct Content struct for editing a term. The struct must contain the\n\t *                                  term ''taxonomy'. Optional accepted values include 'name', 'parent',\n\t *                                  'description', and 'slug'.\n\t * }\n\t * @return true|IXR_Error True on success, IXR_Error instance on failure.\n\t */\n\tpublic function wp_editTerm( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 5 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username       = $args[1];\n\t\t$password       = $args[2];\n\t\t$term_id        = (int) $args[3];\n\t\t$content_struct = $args[4];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.editTerm' );\n\n\t\tif ( ! taxonomy_exists( $content_struct['taxonomy'] ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Invalid taxonomy.' ) );\n\t\t}\n\n\t\t$taxonomy = get_taxonomy( $content_struct['taxonomy'] );\n\n\t\t$taxonomy = (array) $taxonomy;\n\n\t\t// Hold the data of the term.\n\t\t$term_data = array();\n\n\t\t$term = get_term( $term_id, $content_struct['taxonomy'] );\n\n\t\tif ( is_wp_error( $term ) ) {\n\t\t\treturn new IXR_Error( 500, $term->get_error_message() );\n\t\t}\n\n\t\tif ( ! $term ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid term ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_term', $term_id ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this term.' ) );\n\t\t}\n\n\t\tif ( isset( $content_struct['name'] ) ) {\n\t\t\t$term_data['name'] = trim( $content_struct['name'] );\n\n\t\t\tif ( empty( $term_data['name'] ) ) {\n\t\t\t\treturn new IXR_Error( 403, __( 'The term name cannot be empty.' ) );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $content_struct['parent'] ) ) {\n\t\t\tif ( ! $taxonomy['hierarchical'] ) {\n\t\t\t\treturn new IXR_Error( 403, __( 'Cannot set parent term, taxonomy is not hierarchical.' ) );\n\t\t\t}\n\n\t\t\t$parent_term_id = (int) $content_struct['parent'];\n\t\t\t$parent_term    = get_term( $parent_term_id, $taxonomy['name'] );\n\n\t\t\tif ( is_wp_error( $parent_term ) ) {\n\t\t\t\treturn new IXR_Error( 500, $parent_term->get_error_message() );\n\t\t\t}\n\n\t\t\tif ( ! $parent_term ) {\n\t\t\t\treturn new IXR_Error( 403, __( 'Parent term does not exist.' ) );\n\t\t\t}\n\n\t\t\t$term_data['parent'] = $content_struct['parent'];\n\t\t}\n\n\t\tif ( isset( $content_struct['description'] ) ) {\n\t\t\t$term_data['description'] = $content_struct['description'];\n\t\t}\n\n\t\tif ( isset( $content_struct['slug'] ) ) {\n\t\t\t$term_data['slug'] = $content_struct['slug'];\n\t\t}\n\n\t\t$term = wp_update_term( $term_id, $taxonomy['name'], $term_data );\n\n\t\tif ( is_wp_error( $term ) ) {\n\t\t\treturn new IXR_Error( 500, $term->get_error_message() );\n\t\t}\n\n\t\tif ( ! $term ) {\n\t\t\treturn new IXR_Error( 500, __( 'Sorry, editing the term failed.' ) );\n\t\t}\n\n\t\t// Update term meta.\n\t\tif ( isset( $content_struct['custom_fields'] ) ) {\n\t\t\t$this->set_term_custom_fields( $term_id, $content_struct['custom_fields'] );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Delete a term.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @see wp_delete_term()\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id      Blog ID (unused).\n\t *     @type string $username     Username.\n\t *     @type string $password     Password.\n\t *     @type string $taxnomy_name Taxonomy name.\n\t *     @type int    $term_id      Term ID.\n\t * }\n\t * @return bool|IXR_Error True on success, IXR_Error instance on failure.\n\t */\n\tpublic function wp_deleteTerm( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 5 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$taxonomy = $args[3];\n\t\t$term_id  = (int) $args[4];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.deleteTerm' );\n\n\t\tif ( ! taxonomy_exists( $taxonomy ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Invalid taxonomy.' ) );\n\t\t}\n\n\t\t$taxonomy = get_taxonomy( $taxonomy );\n\t\t$term     = get_term( $term_id, $taxonomy->name );\n\n\t\tif ( is_wp_error( $term ) ) {\n\t\t\treturn new IXR_Error( 500, $term->get_error_message() );\n\t\t}\n\n\t\tif ( ! $term ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid term ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'delete_term', $term_id ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this term.' ) );\n\t\t}\n\n\t\t$result = wp_delete_term( $term_id, $taxonomy->name );\n\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\treturn new IXR_Error( 500, $term->get_error_message() );\n\t\t}\n\n\t\tif ( ! $result ) {\n\t\t\treturn new IXR_Error( 500, __( 'Sorry, deleting the term failed.' ) );\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Retrieve a term.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @see get_term()\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id  Blog ID (unused).\n\t *     @type string $username Username.\n\t *     @type string $password Password.\n\t *     @type string $taxnomy  Taxonomy name.\n\t *     @type string $term_id  Term ID.\n\t * }\n\t * @return array|IXR_Error IXR_Error on failure, array on success, containing:\n\t *  - 'term_id'\n\t *  - 'name'\n\t *  - 'slug'\n\t *  - 'term_group'\n\t *  - 'term_taxonomy_id'\n\t *  - 'taxonomy'\n\t *  - 'description'\n\t *  - 'parent'\n\t *  - 'count'\n\t */\n\tpublic function wp_getTerm( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 5 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$taxonomy = $args[3];\n\t\t$term_id  = (int) $args[4];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getTerm' );\n\n\t\tif ( ! taxonomy_exists( $taxonomy ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Invalid taxonomy.' ) );\n\t\t}\n\n\t\t$taxonomy = get_taxonomy( $taxonomy );\n\n\t\t$term = get_term( $term_id, $taxonomy->name, ARRAY_A );\n\n\t\tif ( is_wp_error( $term ) ) {\n\t\t\treturn new IXR_Error( 500, $term->get_error_message() );\n\t\t}\n\n\t\tif ( ! $term ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid term ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'assign_term', $term_id ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to assign this term.' ) );\n\t\t}\n\n\t\treturn $this->_prepare_term( $term );\n\t}\n\n\t/**\n\t * Retrieve all terms for a taxonomy.\n\t *\n\t * @since 3.4.0\n\t *\n\t * The optional $filter parameter modifies the query used to retrieve terms.\n\t * Accepted keys are 'number', 'offset', 'orderby', 'order', 'hide_empty', and 'search'.\n\t *\n\t * @see get_terms()\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id  Blog ID (unused).\n\t *     @type string $username Username.\n\t *     @type string $password Password.\n\t *     @type string $taxnomy  Taxonomy name.\n\t *     @type array  $filter   Optional. Modifies the query used to retrieve posts. Accepts 'number',\n\t *                            'offset', 'orderby', 'order', 'hide_empty', and 'search'. Default empty array.\n\t * }\n\t * @return array|IXR_Error An associative array of terms data on success, IXR_Error instance otherwise.\n\t */\n\tpublic function wp_getTerms( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 4 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$taxonomy = $args[3];\n\t\t$filter   = isset( $args[4] ) ? $args[4] : array();\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getTerms' );\n\n\t\tif ( ! taxonomy_exists( $taxonomy ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Invalid taxonomy.' ) );\n\t\t}\n\n\t\t$taxonomy = get_taxonomy( $taxonomy );\n\n\t\tif ( ! current_user_can( $taxonomy->cap->assign_terms ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ) );\n\t\t}\n\n\t\t$query = array( 'taxonomy' => $taxonomy->name );\n\n\t\tif ( isset( $filter['number'] ) ) {\n\t\t\t$query['number'] = absint( $filter['number'] );\n\t\t}\n\n\t\tif ( isset( $filter['offset'] ) ) {\n\t\t\t$query['offset'] = absint( $filter['offset'] );\n\t\t}\n\n\t\tif ( isset( $filter['orderby'] ) ) {\n\t\t\t$query['orderby'] = $filter['orderby'];\n\n\t\t\tif ( isset( $filter['order'] ) ) {\n\t\t\t\t$query['order'] = $filter['order'];\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $filter['hide_empty'] ) ) {\n\t\t\t$query['hide_empty'] = $filter['hide_empty'];\n\t\t} else {\n\t\t\t$query['get'] = 'all';\n\t\t}\n\n\t\tif ( isset( $filter['search'] ) ) {\n\t\t\t$query['search'] = $filter['search'];\n\t\t}\n\n\t\t$terms = get_terms( $query );\n\n\t\tif ( is_wp_error( $terms ) ) {\n\t\t\treturn new IXR_Error( 500, $terms->get_error_message() );\n\t\t}\n\n\t\t$struct = array();\n\n\t\tforeach ( $terms as $term ) {\n\t\t\t$struct[] = $this->_prepare_term( $term );\n\t\t}\n\n\t\treturn $struct;\n\t}\n\n\t/**\n\t * Retrieve a taxonomy.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @see get_taxonomy()\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id  Blog ID (unused).\n\t *     @type string $username Username.\n\t *     @type string $password Password.\n\t *     @type string $taxnomy  Taxonomy name.\n\t *     @type array  $fields   Optional. Array of taxonomy fields to limit to in the return.\n\t *                            Accepts 'labels', 'cap', 'menu', and 'object_type'.\n\t *                            Default empty array.\n\t * }\n\t * @return array|IXR_Error An array of taxonomy data on success, IXR_Error instance otherwise.\n\t */\n\tpublic function wp_getTaxonomy( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 4 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$taxonomy = $args[3];\n\n\t\tif ( isset( $args[4] ) ) {\n\t\t\t$fields = $args[4];\n\t\t} else {\n\t\t\t/**\n\t\t\t * Filters the taxonomy query fields used by the given XML-RPC method.\n\t\t\t *\n\t\t\t * @since 3.4.0\n\t\t\t *\n\t\t\t * @param array  $fields An array of taxonomy fields to retrieve.\n\t\t\t * @param string $method The method name.\n\t\t\t */\n\t\t\t$fields = apply_filters( 'xmlrpc_default_taxonomy_fields', array( 'labels', 'cap', 'object_type' ), 'wp.getTaxonomy' );\n\t\t}\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getTaxonomy' );\n\n\t\tif ( ! taxonomy_exists( $taxonomy ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Invalid taxonomy.' ) );\n\t\t}\n\n\t\t$taxonomy = get_taxonomy( $taxonomy );\n\n\t\tif ( ! current_user_can( $taxonomy->cap->assign_terms ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ) );\n\t\t}\n\n\t\treturn $this->_prepare_taxonomy( $taxonomy, $fields );\n\t}\n\n\t/**\n\t * Retrieve all taxonomies.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @see get_taxonomies()\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id  Blog ID (unused).\n\t *     @type string $username Username.\n\t *     @type string $password Password.\n\t *     @type array  $filter   Optional. An array of arguments for retrieving taxonomies.\n\t *     @type array  $fields   Optional. The subset of taxonomy fields to return.\n\t * }\n\t * @return array|IXR_Error An associative array of taxonomy data with returned fields determined\n\t *                         by `$fields`, or an IXR_Error instance on failure.\n\t */\n\tpublic function wp_getTaxonomies( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 3 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$filter   = isset( $args[3] ) ? $args[3] : array( 'public' => true );\n\n\t\tif ( isset( $args[4] ) ) {\n\t\t\t$fields = $args[4];\n\t\t} else {\n\t\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\t\t$fields = apply_filters( 'xmlrpc_default_taxonomy_fields', array( 'labels', 'cap', 'object_type' ), 'wp.getTaxonomies' );\n\t\t}\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getTaxonomies' );\n\n\t\t$taxonomies = get_taxonomies( $filter, 'objects' );\n\n\t\t// Holds all the taxonomy data.\n\t\t$struct = array();\n\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t// Capability check for post types.\n\t\t\tif ( ! current_user_can( $taxonomy->cap->assign_terms ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$struct[] = $this->_prepare_taxonomy( $taxonomy, $fields );\n\t\t}\n\n\t\treturn $struct;\n\t}\n\n\t/**\n\t * Retrieve a user.\n\t *\n\t * The optional $fields parameter specifies what fields will be included\n\t * in the response array. This should be a list of field names. 'user_id' will\n\t * always be included in the response regardless of the value of $fields.\n\t *\n\t * Instead of, or in addition to, individual field names, conceptual group\n\t * names can be used to specify multiple fields. The available conceptual\n\t * groups are 'basic' and 'all'.\n\t *\n\t * @uses get_userdata()\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type int    $user_id\n\t *     @type array  $fields (optional)\n\t * }\n\t * @return array|IXR_Error Array contains (based on $fields parameter):\n\t *  - 'user_id'\n\t *  - 'username'\n\t *  - 'first_name'\n\t *  - 'last_name'\n\t *  - 'registered'\n\t *  - 'bio'\n\t *  - 'email'\n\t *  - 'nickname'\n\t *  - 'nicename'\n\t *  - 'url'\n\t *  - 'display_name'\n\t *  - 'roles'\n\t */\n\tpublic function wp_getUser( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 4 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$user_id  = (int) $args[3];\n\n\t\tif ( isset( $args[4] ) ) {\n\t\t\t$fields = $args[4];\n\t\t} else {\n\t\t\t/**\n\t\t\t * Filters the default user query fields used by the given XML-RPC method.\n\t\t\t *\n\t\t\t * @since 3.5.0\n\t\t\t *\n\t\t\t * @param array  $fields User query fields for given method. Default 'all'.\n\t\t\t * @param string $method The method name.\n\t\t\t */\n\t\t\t$fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUser' );\n\t\t}\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getUser' );\n\n\t\tif ( ! current_user_can( 'edit_user', $user_id ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this user.' ) );\n\t\t}\n\n\t\t$user_data = get_userdata( $user_id );\n\n\t\tif ( ! $user_data ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid user ID.' ) );\n\t\t}\n\n\t\treturn $this->_prepare_user( $user_data, $fields );\n\t}\n\n\t/**\n\t * Retrieve users.\n\t *\n\t * The optional $filter parameter modifies the query used to retrieve users.\n\t * Accepted keys are 'number' (default: 50), 'offset' (default: 0), 'role',\n\t * 'who', 'orderby', and 'order'.\n\t *\n\t * The optional $fields parameter specifies what fields will be included\n\t * in the response array.\n\t *\n\t * @uses get_users()\n\t * @see wp_getUser() for more on $fields and return values\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type array  $filter (optional)\n\t *     @type array  $fields (optional)\n\t * }\n\t * @return array|IXR_Error users data\n\t */\n\tpublic function wp_getUsers( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 3 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$filter   = isset( $args[3] ) ? $args[3] : array();\n\n\t\tif ( isset( $args[4] ) ) {\n\t\t\t$fields = $args[4];\n\t\t} else {\n\t\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\t\t$fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUsers' );\n\t\t}\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getUsers' );\n\n\t\tif ( ! current_user_can( 'list_users' ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to list users.' ) );\n\t\t}\n\n\t\t$query = array( 'fields' => 'all_with_meta' );\n\n\t\t$query['number'] = ( isset( $filter['number'] ) ) ? absint( $filter['number'] ) : 50;\n\t\t$query['offset'] = ( isset( $filter['offset'] ) ) ? absint( $filter['offset'] ) : 0;\n\n\t\tif ( isset( $filter['orderby'] ) ) {\n\t\t\t$query['orderby'] = $filter['orderby'];\n\n\t\t\tif ( isset( $filter['order'] ) ) {\n\t\t\t\t$query['order'] = $filter['order'];\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $filter['role'] ) ) {\n\t\t\tif ( get_role( $filter['role'] ) === null ) {\n\t\t\t\treturn new IXR_Error( 403, __( 'Invalid role.' ) );\n\t\t\t}\n\n\t\t\t$query['role'] = $filter['role'];\n\t\t}\n\n\t\tif ( isset( $filter['who'] ) ) {\n\t\t\t$query['who'] = $filter['who'];\n\t\t}\n\n\t\t$users = get_users( $query );\n\n\t\t$_users = array();\n\t\tforeach ( $users as $user_data ) {\n\t\t\tif ( current_user_can( 'edit_user', $user_data->ID ) ) {\n\t\t\t\t$_users[] = $this->_prepare_user( $user_data, $fields );\n\t\t\t}\n\t\t}\n\t\treturn $_users;\n\t}\n\n\t/**\n\t * Retrieve information about the requesting user.\n\t *\n\t * @uses get_userdata()\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type array  $fields (optional)\n\t * }\n\t * @return array|IXR_Error (@see wp_getUser)\n\t */\n\tpublic function wp_getProfile( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 3 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\n\t\tif ( isset( $args[3] ) ) {\n\t\t\t$fields = $args[3];\n\t\t} else {\n\t\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\t\t$fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getProfile' );\n\t\t}\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getProfile' );\n\n\t\tif ( ! current_user_can( 'edit_user', $user->ID ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit your profile.' ) );\n\t\t}\n\n\t\t$user_data = get_userdata( $user->ID );\n\n\t\treturn $this->_prepare_user( $user_data, $fields );\n\t}\n\n\t/**\n\t * Edit user's profile.\n\t *\n\t * @uses wp_update_user()\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type array  $content_struct It can optionally contain:\n\t *      - 'first_name'\n\t *      - 'last_name'\n\t *      - 'website'\n\t *      - 'display_name'\n\t *      - 'nickname'\n\t *      - 'nicename'\n\t *      - 'bio'\n\t * }\n\t * @return true|IXR_Error True, on success.\n\t */\n\tpublic function wp_editProfile( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 4 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username       = $args[1];\n\t\t$password       = $args[2];\n\t\t$content_struct = $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.editProfile' );\n\n\t\tif ( ! current_user_can( 'edit_user', $user->ID ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit your profile.' ) );\n\t\t}\n\n\t\t// Holds data of the user.\n\t\t$user_data       = array();\n\t\t$user_data['ID'] = $user->ID;\n\n\t\t// Only set the user details if they were given.\n\t\tif ( isset( $content_struct['first_name'] ) ) {\n\t\t\t$user_data['first_name'] = $content_struct['first_name'];\n\t\t}\n\n\t\tif ( isset( $content_struct['last_name'] ) ) {\n\t\t\t$user_data['last_name'] = $content_struct['last_name'];\n\t\t}\n\n\t\tif ( isset( $content_struct['url'] ) ) {\n\t\t\t$user_data['user_url'] = $content_struct['url'];\n\t\t}\n\n\t\tif ( isset( $content_struct['display_name'] ) ) {\n\t\t\t$user_data['display_name'] = $content_struct['display_name'];\n\t\t}\n\n\t\tif ( isset( $content_struct['nickname'] ) ) {\n\t\t\t$user_data['nickname'] = $content_struct['nickname'];\n\t\t}\n\n\t\tif ( isset( $content_struct['nicename'] ) ) {\n\t\t\t$user_data['user_nicename'] = $content_struct['nicename'];\n\t\t}\n\n\t\tif ( isset( $content_struct['bio'] ) ) {\n\t\t\t$user_data['description'] = $content_struct['bio'];\n\t\t}\n\n\t\t$result = wp_update_user( $user_data );\n\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\treturn new IXR_Error( 500, $result->get_error_message() );\n\t\t}\n\n\t\tif ( ! $result ) {\n\t\t\treturn new IXR_Error( 500, __( 'Sorry, the user could not be updated.' ) );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieve page.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type int    $page_id\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function wp_getPage( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$page_id  = (int) $args[1];\n\t\t$username = $args[2];\n\t\t$password = $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$page = get_post( $page_id );\n\t\tif ( ! $page ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_page', $page_id ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this page.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getPage' );\n\n\t\t// If we found the page then format the data.\n\t\tif ( $page->ID && ( 'page' === $page->post_type ) ) {\n\t\t\treturn $this->_prepare_page( $page );\n\t\t} else {\n\t\t\t// If the page doesn't exist, indicate that.\n\t\t\treturn new IXR_Error( 404, __( 'Sorry, no such page.' ) );\n\t\t}\n\t}\n\n\t/**\n\t * Retrieve Pages.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type int    $num_pages\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function wp_getPages( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username  = $args[1];\n\t\t$password  = $args[2];\n\t\t$num_pages = isset( $args[3] ) ? (int) $args[3] : 10;\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_pages' ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit pages.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getPages' );\n\n\t\t$pages     = get_posts(\n\t\t\tarray(\n\t\t\t\t'post_type'   => 'page',\n\t\t\t\t'post_status' => 'any',\n\t\t\t\t'numberposts' => $num_pages,\n\t\t\t)\n\t\t);\n\t\t$num_pages = count( $pages );\n\n\t\t// If we have pages, put together their info.\n\t\tif ( $num_pages >= 1 ) {\n\t\t\t$pages_struct = array();\n\n\t\t\tforeach ( $pages as $page ) {\n\t\t\t\tif ( current_user_can( 'edit_page', $page->ID ) ) {\n\t\t\t\t\t$pages_struct[] = $this->_prepare_page( $page );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $pages_struct;\n\t\t}\n\n\t\treturn array();\n\t}\n\n\t/**\n\t * Create new page.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @see wp_xmlrpc_server::mw_newPost()\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type array  $content_struct\n\t * }\n\t * @return int|IXR_Error\n\t */\n\tpublic function wp_newPage( $args ) {\n\t\t// Items not escaped here will be escaped in wp_newPost().\n\t\t$username = $this->escape( $args[1] );\n\t\t$password = $this->escape( $args[2] );\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.newPage' );\n\n\t\t// Mark this as content for a page.\n\t\t$args[3]['post_type'] = 'page';\n\n\t\t// Let mw_newPost() do all of the heavy lifting.\n\t\treturn $this->mw_newPost( $args );\n\t}\n\n\t/**\n\t * Delete page.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type int    $page_id\n\t * }\n\t * @return true|IXR_Error True, if success.\n\t */\n\tpublic function wp_deletePage( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$page_id  = (int) $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.deletePage' );\n\n\t\t// Get the current page based on the 'page_id' and\n\t\t// make sure it is a page and not a post.\n\t\t$actual_page = get_post( $page_id, ARRAY_A );\n\t\tif ( ! $actual_page || ( 'page' !== $actual_page['post_type'] ) ) {\n\t\t\treturn new IXR_Error( 404, __( 'Sorry, no such page.' ) );\n\t\t}\n\n\t\t// Make sure the user can delete pages.\n\t\tif ( ! current_user_can( 'delete_page', $page_id ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this page.' ) );\n\t\t}\n\n\t\t// Attempt to delete the page.\n\t\t$result = wp_delete_post( $page_id );\n\t\tif ( ! $result ) {\n\t\t\treturn new IXR_Error( 500, __( 'Failed to delete the page.' ) );\n\t\t}\n\n\t\t/**\n\t\t * Fires after a page has been successfully deleted via XML-RPC.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param int   $page_id ID of the deleted page.\n\t\t * @param array $args    An array of arguments to delete the page.\n\t\t */\n\t\tdo_action( 'xmlrpc_call_success_wp_deletePage', $page_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Edit page.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type int    $page_id\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type string $content\n\t *     @type string $publish\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function wp_editPage( $args ) {\n\t\t// Items will be escaped in mw_editPost().\n\t\t$page_id  = (int) $args[1];\n\t\t$username = $args[2];\n\t\t$password = $args[3];\n\t\t$content  = $args[4];\n\t\t$publish  = $args[5];\n\n\t\t$escaped_username = $this->escape( $username );\n\t\t$escaped_password = $this->escape( $password );\n\n\t\t$user = $this->login( $escaped_username, $escaped_password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.editPage' );\n\n\t\t// Get the page data and make sure it is a page.\n\t\t$actual_page = get_post( $page_id, ARRAY_A );\n\t\tif ( ! $actual_page || ( 'page' !== $actual_page['post_type'] ) ) {\n\t\t\treturn new IXR_Error( 404, __( 'Sorry, no such page.' ) );\n\t\t}\n\n\t\t// Make sure the user is allowed to edit pages.\n\t\tif ( ! current_user_can( 'edit_page', $page_id ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this page.' ) );\n\t\t}\n\n\t\t// Mark this as content for a page.\n\t\t$content['post_type'] = 'page';\n\n\t\t// Arrange args in the way mw_editPost() understands.\n\t\t$args = array(\n\t\t\t$page_id,\n\t\t\t$username,\n\t\t\t$password,\n\t\t\t$content,\n\t\t\t$publish,\n\t\t);\n\n\t\t// Let mw_editPost() do all of the heavy lifting.\n\t\treturn $this->mw_editPost( $args );\n\t}\n\n\t/**\n\t * Retrieve page list.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function wp_getPageList( $args ) {\n\t\tglobal $wpdb;\n\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_pages' ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit pages.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getPageList' );\n\n\t\t// Get list of page IDs and titles.\n\t\t$page_list = $wpdb->get_results(\n\t\t\t\"\n\t\t\tSELECT ID page_id,\n\t\t\t\tpost_title page_title,\n\t\t\t\tpost_parent page_parent_id,\n\t\t\t\tpost_date_gmt,\n\t\t\t\tpost_date,\n\t\t\t\tpost_status\n\t\t\tFROM {$wpdb->posts}\n\t\t\tWHERE post_type = 'page'\n\t\t\tORDER BY ID\n\t\t\"\n\t\t);\n\n\t\t// The date needs to be formatted properly.\n\t\t$num_pages = count( $page_list );\n\t\tfor ( $i = 0; $i < $num_pages; $i++ ) {\n\t\t\t$page_list[ $i ]->dateCreated      = $this->_convert_date( $page_list[ $i ]->post_date );\n\t\t\t$page_list[ $i ]->date_created_gmt = $this->_convert_date_gmt( $page_list[ $i ]->post_date_gmt, $page_list[ $i ]->post_date );\n\n\t\t\tunset( $page_list[ $i ]->post_date_gmt );\n\t\t\tunset( $page_list[ $i ]->post_date );\n\t\t\tunset( $page_list[ $i ]->post_status );\n\t\t}\n\n\t\treturn $page_list;\n\t}\n\n\t/**\n\t * Retrieve authors list.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function wp_getAuthors( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getAuthors' );\n\n\t\t$authors = array();\n\t\tforeach ( get_users( array( 'fields' => array( 'ID', 'user_login', 'display_name' ) ) ) as $user ) {\n\t\t\t$authors[] = array(\n\t\t\t\t'user_id'      => $user->ID,\n\t\t\t\t'user_login'   => $user->user_login,\n\t\t\t\t'display_name' => $user->display_name,\n\t\t\t);\n\t\t}\n\n\t\treturn $authors;\n\t}\n\n\t/**\n\t * Get list of all tags\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function wp_getTags( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view tags.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getKeywords' );\n\n\t\t$tags = array();\n\n\t\t$all_tags = get_tags();\n\t\tif ( $all_tags ) {\n\t\t\tforeach ( (array) $all_tags as $tag ) {\n\t\t\t\t$struct             = array();\n\t\t\t\t$struct['tag_id']   = $tag->term_id;\n\t\t\t\t$struct['name']     = $tag->name;\n\t\t\t\t$struct['count']    = $tag->count;\n\t\t\t\t$struct['slug']     = $tag->slug;\n\t\t\t\t$struct['html_url'] = esc_html( get_tag_link( $tag->term_id ) );\n\t\t\t\t$struct['rss_url']  = esc_html( get_tag_feed_link( $tag->term_id ) );\n\n\t\t\t\t$tags[] = $struct;\n\t\t\t}\n\t\t}\n\n\t\treturn $tags;\n\t}\n\n\t/**\n\t * Create new category.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type array  $category\n\t * }\n\t * @return int|IXR_Error Category ID.\n\t */\n\tpublic function wp_newCategory( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$category = $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.newCategory' );\n\n\t\t// Make sure the user is allowed to add a category.\n\t\tif ( ! current_user_can( 'manage_categories' ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to add a category.' ) );\n\t\t}\n\n\t\t// If no slug was provided, make it empty\n\t\t// so that WordPress will generate one.\n\t\tif ( empty( $category['slug'] ) ) {\n\t\t\t$category['slug'] = '';\n\t\t}\n\n\t\t// If no parent_id was provided, make it empty\n\t\t// so that it will be a top-level page (no parent).\n\t\tif ( ! isset( $category['parent_id'] ) ) {\n\t\t\t$category['parent_id'] = '';\n\t\t}\n\n\t\t// If no description was provided, make it empty.\n\t\tif ( empty( $category['description'] ) ) {\n\t\t\t$category['description'] = '';\n\t\t}\n\n\t\t$new_category = array(\n\t\t\t'cat_name'             => $category['name'],\n\t\t\t'category_nicename'    => $category['slug'],\n\t\t\t'category_parent'      => $category['parent_id'],\n\t\t\t'category_description' => $category['description'],\n\t\t);\n\n\t\t$cat_id = wp_insert_category( $new_category, true );\n\t\tif ( is_wp_error( $cat_id ) ) {\n\t\t\tif ( 'term_exists' === $cat_id->get_error_code() ) {\n\t\t\t\treturn (int) $cat_id->get_error_data();\n\t\t\t} else {\n\t\t\t\treturn new IXR_Error( 500, __( 'Sorry, the category could not be created.' ) );\n\t\t\t}\n\t\t} elseif ( ! $cat_id ) {\n\t\t\treturn new IXR_Error( 500, __( 'Sorry, the category could not be created.' ) );\n\t\t}\n\n\t\t/**\n\t\t * Fires after a new category has been successfully created via XML-RPC.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param int   $cat_id ID of the new category.\n\t\t * @param array $args   An array of new category arguments.\n\t\t */\n\t\tdo_action( 'xmlrpc_call_success_wp_newCategory', $cat_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase\n\n\t\treturn $cat_id;\n\t}\n\n\t/**\n\t * Remove category.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type int    $category_id\n\t * }\n\t * @return bool|IXR_Error See wp_delete_term() for return info.\n\t */\n\tpublic function wp_deleteCategory( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username    = $args[1];\n\t\t$password    = $args[2];\n\t\t$category_id = (int) $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.deleteCategory' );\n\n\t\tif ( ! current_user_can( 'delete_term', $category_id ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this category.' ) );\n\t\t}\n\n\t\t$status = wp_delete_term( $category_id, 'category' );\n\n\t\tif ( true == $status ) {\n\t\t\t/**\n\t\t\t * Fires after a category has been successfully deleted via XML-RPC.\n\t\t\t *\n\t\t\t * @since 3.4.0\n\t\t\t *\n\t\t\t * @param int   $category_id ID of the deleted category.\n\t\t\t * @param array $args        An array of arguments to delete the category.\n\t\t\t */\n\t\t\tdo_action( 'xmlrpc_call_success_wp_deleteCategory', $category_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase\n\t\t}\n\n\t\treturn $status;\n\t}\n\n\t/**\n\t * Retrieve category list.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type array  $category\n\t *     @type int    $max_results\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function wp_suggestCategories( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username    = $args[1];\n\t\t$password    = $args[2];\n\t\t$category    = $args[3];\n\t\t$max_results = (int) $args[4];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view categories.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.suggestCategories' );\n\n\t\t$category_suggestions = array();\n\t\t$args                 = array(\n\t\t\t'get'        => 'all',\n\t\t\t'number'     => $max_results,\n\t\t\t'name__like' => $category,\n\t\t);\n\t\tforeach ( (array) get_categories( $args ) as $cat ) {\n\t\t\t$category_suggestions[] = array(\n\t\t\t\t'category_id'   => $cat->term_id,\n\t\t\t\t'category_name' => $cat->name,\n\t\t\t);\n\t\t}\n\n\t\treturn $category_suggestions;\n\t}\n\n\t/**\n\t * Retrieve comment.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type int    $comment_id\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function wp_getComment( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username   = $args[1];\n\t\t$password   = $args[2];\n\t\t$comment_id = (int) $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getComment' );\n\n\t\t$comment = get_comment( $comment_id );\n\t\tif ( ! $comment ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid comment ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_comment', $comment_id ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Sorry, you are not allowed to moderate or edit this comment.' ) );\n\t\t}\n\n\t\treturn $this->_prepare_comment( $comment );\n\t}\n\n\t/**\n\t * Retrieve comments.\n\t *\n\t * Besides the common blog_id (unused), username, and password arguments, it takes a filter\n\t * array as last argument.\n\t *\n\t * Accepted 'filter' keys are 'status', 'post_id', 'offset', and 'number'.\n\t *\n\t * The defaults are as follows:\n\t * - 'status' - Default is ''. Filter by status (e.g., 'approve', 'hold')\n\t * - 'post_id' - Default is ''. The post where the comment is posted. Empty string shows all comments.\n\t * - 'number' - Default is 10. Total number of media items to retrieve.\n\t * - 'offset' - Default is 0. See WP_Query::query() for more.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type array  $struct\n\t * }\n\t * @return array|IXR_Error Contains a collection of comments. See wp_xmlrpc_server::wp_getComment() for a description of each item contents\n\t */\n\tpublic function wp_getComments( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$struct   = isset( $args[3] ) ? $args[3] : array();\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getComments' );\n\n\t\tif ( isset( $struct['status'] ) ) {\n\t\t\t$status = $struct['status'];\n\t\t} else {\n\t\t\t$status = '';\n\t\t}\n\n\t\tif ( ! current_user_can( 'moderate_comments' ) && 'approve' !== $status ) {\n\t\t\treturn new IXR_Error( 401, __( 'Invalid comment status.' ) );\n\t\t}\n\n\t\t$post_id = '';\n\t\tif ( isset( $struct['post_id'] ) ) {\n\t\t\t$post_id = absint( $struct['post_id'] );\n\t\t}\n\n\t\t$post_type = '';\n\t\tif ( isset( $struct['post_type'] ) ) {\n\t\t\t$post_type_object = get_post_type_object( $struct['post_type'] );\n\t\t\tif ( ! $post_type_object || ! post_type_supports( $post_type_object->name, 'comments' ) ) {\n\t\t\t\treturn new IXR_Error( 404, __( 'Invalid post type.' ) );\n\t\t\t}\n\t\t\t$post_type = $struct['post_type'];\n\t\t}\n\n\t\t$offset = 0;\n\t\tif ( isset( $struct['offset'] ) ) {\n\t\t\t$offset = absint( $struct['offset'] );\n\t\t}\n\n\t\t$number = 10;\n\t\tif ( isset( $struct['number'] ) ) {\n\t\t\t$number = absint( $struct['number'] );\n\t\t}\n\n\t\t$comments = get_comments(\n\t\t\tarray(\n\t\t\t\t'status'    => $status,\n\t\t\t\t'post_id'   => $post_id,\n\t\t\t\t'offset'    => $offset,\n\t\t\t\t'number'    => $number,\n\t\t\t\t'post_type' => $post_type,\n\t\t\t)\n\t\t);\n\n\t\t$comments_struct = array();\n\t\tif ( is_array( $comments ) ) {\n\t\t\tforeach ( $comments as $comment ) {\n\t\t\t\t$comments_struct[] = $this->_prepare_comment( $comment );\n\t\t\t}\n\t\t}\n\n\t\treturn $comments_struct;\n\t}\n\n\t/**\n\t * Delete a comment.\n\t *\n\t * By default, the comment will be moved to the Trash instead of deleted.\n\t * See wp_delete_comment() for more information on this behavior.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type int    $comment_ID\n\t * }\n\t * @return bool|IXR_Error See wp_delete_comment().\n\t */\n\tpublic function wp_deleteComment( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username   = $args[1];\n\t\t$password   = $args[2];\n\t\t$comment_ID = (int) $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! get_comment( $comment_ID ) ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid comment ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_comment', $comment_ID ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Sorry, you are not allowed to delete this comment.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.deleteComment' );\n\n\t\t$status = wp_delete_comment( $comment_ID );\n\n\t\tif ( $status ) {\n\t\t\t/**\n\t\t\t * Fires after a comment has been successfully deleted via XML-RPC.\n\t\t\t *\n\t\t\t * @since 3.4.0\n\t\t\t *\n\t\t\t * @param int   $comment_ID ID of the deleted comment.\n\t\t\t * @param array $args       An array of arguments to delete the comment.\n\t\t\t */\n\t\t\tdo_action( 'xmlrpc_call_success_wp_deleteComment', $comment_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase\n\t\t}\n\n\t\treturn $status;\n\t}\n\n\t/**\n\t * Edit comment.\n\t *\n\t * Besides the common blog_id (unused), username, and password arguments, it takes a\n\t * comment_id integer and a content_struct array as last argument.\n\t *\n\t * The allowed keys in the content_struct array are:\n\t *  - 'author'\n\t *  - 'author_url'\n\t *  - 'author_email'\n\t *  - 'content'\n\t *  - 'date_created_gmt'\n\t *  - 'status'. Common statuses are 'approve', 'hold', 'spam'. See get_comment_statuses() for more details\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type int    $comment_ID\n\t *     @type array  $content_struct\n\t * }\n\t * @return true|IXR_Error True, on success.\n\t */\n\tpublic function wp_editComment( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username       = $args[1];\n\t\t$password       = $args[2];\n\t\t$comment_ID     = (int) $args[3];\n\t\t$content_struct = $args[4];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! get_comment( $comment_ID ) ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid comment ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_comment', $comment_ID ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Sorry, you are not allowed to moderate or edit this comment.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.editComment' );\n\t\t$comment = array(\n\t\t\t'comment_ID' => $comment_ID,\n\t\t);\n\n\t\tif ( isset( $content_struct['status'] ) ) {\n\t\t\t$statuses = get_comment_statuses();\n\t\t\t$statuses = array_keys( $statuses );\n\n\t\t\tif ( ! in_array( $content_struct['status'], $statuses, true ) ) {\n\t\t\t\treturn new IXR_Error( 401, __( 'Invalid comment status.' ) );\n\t\t\t}\n\n\t\t\t$comment['comment_approved'] = $content_struct['status'];\n\t\t}\n\n\t\t// Do some timestamp voodoo.\n\t\tif ( ! empty( $content_struct['date_created_gmt'] ) ) {\n\t\t\t// We know this is supposed to be GMT, so we're going to slap that Z on there by force.\n\t\t\t$dateCreated                 = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';\n\t\t\t$comment['comment_date']     = get_date_from_gmt( $dateCreated );\n\t\t\t$comment['comment_date_gmt'] = iso8601_to_datetime( $dateCreated, 'gmt' );\n\t\t}\n\n\t\tif ( isset( $content_struct['content'] ) ) {\n\t\t\t$comment['comment_content'] = $content_struct['content'];\n\t\t}\n\n\t\tif ( isset( $content_struct['author'] ) ) {\n\t\t\t$comment['comment_author'] = $content_struct['author'];\n\t\t}\n\n\t\tif ( isset( $content_struct['author_url'] ) ) {\n\t\t\t$comment['comment_author_url'] = $content_struct['author_url'];\n\t\t}\n\n\t\tif ( isset( $content_struct['author_email'] ) ) {\n\t\t\t$comment['comment_author_email'] = $content_struct['author_email'];\n\t\t}\n\n\t\t$result = wp_update_comment( $comment, true );\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\treturn new IXR_Error( 500, $result->get_error_message() );\n\t\t}\n\n\t\tif ( ! $result ) {\n\t\t\treturn new IXR_Error( 500, __( 'Sorry, the comment could not be updated.' ) );\n\t\t}\n\n\t\t/**\n\t\t * Fires after a comment has been successfully updated via XML-RPC.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param int   $comment_ID ID of the updated comment.\n\t\t * @param array $args       An array of arguments to update the comment.\n\t\t */\n\t\tdo_action( 'xmlrpc_call_success_wp_editComment', $comment_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Create new comment.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int        $blog_id (unused)\n\t *     @type string     $username\n\t *     @type string     $password\n\t *     @type string|int $post\n\t *     @type array      $content_struct\n\t * }\n\t * @return int|IXR_Error See wp_new_comment().\n\t */\n\tpublic function wp_newComment( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username       = $args[1];\n\t\t$password       = $args[2];\n\t\t$post           = $args[3];\n\t\t$content_struct = $args[4];\n\n\t\t/**\n\t\t * Filters whether to allow anonymous comments over XML-RPC.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param bool $allow Whether to allow anonymous commenting via XML-RPC.\n\t\t *                    Default false.\n\t\t */\n\t\t$allow_anon = apply_filters( 'xmlrpc_allow_anonymous_comments', false );\n\n\t\t$user = $this->login( $username, $password );\n\n\t\tif ( ! $user ) {\n\t\t\t$logged_in = false;\n\t\t\tif ( $allow_anon && get_option( 'comment_registration' ) ) {\n\t\t\t\treturn new IXR_Error( 403, __( 'Sorry, you must be logged in to comment.' ) );\n\t\t\t} elseif ( ! $allow_anon ) {\n\t\t\t\treturn $this->error;\n\t\t\t}\n\t\t} else {\n\t\t\t$logged_in = true;\n\t\t}\n\n\t\tif ( is_numeric( $post ) ) {\n\t\t\t$post_id = absint( $post );\n\t\t} else {\n\t\t\t$post_id = url_to_postid( $post );\n\t\t}\n\n\t\tif ( ! $post_id ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\tif ( ! get_post( $post_id ) ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\tif ( ! comments_open( $post_id ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Sorry, comments are closed for this item.' ) );\n\t\t}\n\n\t\tif (\n\t\t\t'publish' === get_post_status( $post_id ) &&\n\t\t\t! current_user_can( 'edit_post', $post_id ) &&\n\t\t\tpost_password_required( $post_id )\n\t\t) {\n\t\t\treturn new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) );\n\t\t}\n\n\t\tif (\n\t\t\t'private' === get_post_status( $post_id ) &&\n\t\t\t! current_user_can( 'read_post', $post_id )\n\t\t) {\n\t\t\treturn new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) );\n\t\t}\n\n\t\tif ( empty( $content_struct['content'] ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Comment is required.' ) );\n\t\t}\n\n\t\t$comment = array(\n\t\t\t'comment_post_ID' => $post_id,\n\t\t\t'comment_content' => $content_struct['content'],\n\t\t);\n\n\t\tif ( $logged_in ) {\n\t\t\t$display_name = $user->display_name;\n\t\t\t$user_email   = $user->user_email;\n\t\t\t$user_url     = $user->user_url;\n\n\t\t\t$comment['comment_author']       = $this->escape( $display_name );\n\t\t\t$comment['comment_author_email'] = $this->escape( $user_email );\n\t\t\t$comment['comment_author_url']   = $this->escape( $user_url );\n\t\t\t$comment['user_ID']              = $user->ID;\n\t\t} else {\n\t\t\t$comment['comment_author'] = '';\n\t\t\tif ( isset( $content_struct['author'] ) ) {\n\t\t\t\t$comment['comment_author'] = $content_struct['author'];\n\t\t\t}\n\n\t\t\t$comment['comment_author_email'] = '';\n\t\t\tif ( isset( $content_struct['author_email'] ) ) {\n\t\t\t\t$comment['comment_author_email'] = $content_struct['author_email'];\n\t\t\t}\n\n\t\t\t$comment['comment_author_url'] = '';\n\t\t\tif ( isset( $content_struct['author_url'] ) ) {\n\t\t\t\t$comment['comment_author_url'] = $content_struct['author_url'];\n\t\t\t}\n\n\t\t\t$comment['user_ID'] = 0;\n\n\t\t\tif ( get_option( 'require_name_email' ) ) {\n\t\t\t\tif ( strlen( $comment['comment_author_email'] ) < 6 || '' === $comment['comment_author'] ) {\n\t\t\t\t\treturn new IXR_Error( 403, __( 'Comment author name and email are required.' ) );\n\t\t\t\t} elseif ( ! is_email( $comment['comment_author_email'] ) ) {\n\t\t\t\t\treturn new IXR_Error( 403, __( 'A valid email address is required.' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$comment['comment_parent'] = isset( $content_struct['comment_parent'] ) ? absint( $content_struct['comment_parent'] ) : 0;\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.newComment' );\n\n\t\t$comment_ID = wp_new_comment( $comment, true );\n\t\tif ( is_wp_error( $comment_ID ) ) {\n\t\t\treturn new IXR_Error( 403, $comment_ID->get_error_message() );\n\t\t}\n\n\t\tif ( ! $comment_ID ) {\n\t\t\treturn new IXR_Error( 403, __( 'Something went wrong.' ) );\n\t\t}\n\n\t\t/**\n\t\t * Fires after a new comment has been successfully created via XML-RPC.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param int   $comment_ID ID of the new comment.\n\t\t * @param array $args       An array of new comment arguments.\n\t\t */\n\t\tdo_action( 'xmlrpc_call_success_wp_newComment', $comment_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase\n\n\t\treturn $comment_ID;\n\t}\n\n\t/**\n\t * Retrieve all of the comment status.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function wp_getCommentStatusList( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'publish_posts' ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Sorry, you are not allowed to access details about this site.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getCommentStatusList' );\n\n\t\treturn get_comment_statuses();\n\t}\n\n\t/**\n\t * Retrieve comment count.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type int    $post_id\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function wp_getCommentCount( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$post_id  = (int) $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$post = get_post( $post_id, ARRAY_A );\n\t\tif ( empty( $post['ID'] ) ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Sorry, you are not allowed to access details of this post.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getCommentCount' );\n\n\t\t$count = wp_count_comments( $post_id );\n\n\t\treturn array(\n\t\t\t'approved'            => $count->approved,\n\t\t\t'awaiting_moderation' => $count->moderated,\n\t\t\t'spam'                => $count->spam,\n\t\t\t'total_comments'      => $count->total_comments,\n\t\t);\n\t}\n\n\t/**\n\t * Retrieve post statuses.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function wp_getPostStatusList( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Sorry, you are not allowed to access details about this site.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getPostStatusList' );\n\n\t\treturn get_post_statuses();\n\t}\n\n\t/**\n\t * Retrieve page statuses.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function wp_getPageStatusList( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_pages' ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Sorry, you are not allowed to access details about this site.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getPageStatusList' );\n\n\t\treturn get_page_statuses();\n\t}\n\n\t/**\n\t * Retrieve page templates.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function wp_getPageTemplates( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_pages' ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Sorry, you are not allowed to access details about this site.' ) );\n\t\t}\n\n\t\t$templates            = get_page_templates();\n\t\t$templates['Default'] = 'default';\n\n\t\treturn $templates;\n\t}\n\n\t/**\n\t * Retrieve blog options.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type array  $options\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function wp_getOptions( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$options  = isset( $args[3] ) ? (array) $args[3] : array();\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t// If no specific options where asked for, return all of them.\n\t\tif ( count( $options ) == 0 ) {\n\t\t\t$options = array_keys( $this->blog_options );\n\t\t}\n\n\t\treturn $this->_getOptions( $options );\n\t}\n\n\t/**\n\t * Retrieve blog options value from list.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param array $options Options to retrieve.\n\t * @return array\n\t */\n\tpublic function _getOptions( $options ) {\n\t\t$data       = array();\n\t\t$can_manage = current_user_can( 'manage_options' );\n\t\tforeach ( $options as $option ) {\n\t\t\tif ( array_key_exists( $option, $this->blog_options ) ) {\n\t\t\t\t$data[ $option ] = $this->blog_options[ $option ];\n\t\t\t\t// Is the value static or dynamic?\n\t\t\t\tif ( isset( $data[ $option ]['option'] ) ) {\n\t\t\t\t\t$data[ $option ]['value'] = get_option( $data[ $option ]['option'] );\n\t\t\t\t\tunset( $data[ $option ]['option'] );\n\t\t\t\t}\n\n\t\t\t\tif ( ! $can_manage ) {\n\t\t\t\t\t$data[ $option ]['readonly'] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Update blog options.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type array  $options\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function wp_setOptions( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$options  = (array) $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Sorry, you are not allowed to update options.' ) );\n\t\t}\n\n\t\t$option_names = array();\n\t\tforeach ( $options as $o_name => $o_value ) {\n\t\t\t$option_names[] = $o_name;\n\t\t\tif ( ! array_key_exists( $o_name, $this->blog_options ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( true == $this->blog_options[ $o_name ]['readonly'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tupdate_option( $this->blog_options[ $o_name ]['option'], wp_unslash( $o_value ) );\n\t\t}\n\n\t\t// Now return the updated values.\n\t\treturn $this->_getOptions( $option_names );\n\t}\n\n\t/**\n\t * Retrieve a media item by ID\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type int    $attachment_id\n\t * }\n\t * @return array|IXR_Error Associative array contains:\n\t *  - 'date_created_gmt'\n\t *  - 'parent'\n\t *  - 'link'\n\t *  - 'thumbnail'\n\t *  - 'title'\n\t *  - 'caption'\n\t *  - 'description'\n\t *  - 'metadata'\n\t */\n\tpublic function wp_getMediaItem( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username      = $args[1];\n\t\t$password      = $args[2];\n\t\t$attachment_id = (int) $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'upload_files' ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Sorry, you are not allowed to upload files.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getMediaItem' );\n\n\t\t$attachment = get_post( $attachment_id );\n\t\tif ( ! $attachment || 'attachment' !== $attachment->post_type ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid attachment ID.' ) );\n\t\t}\n\n\t\treturn $this->_prepare_media_item( $attachment );\n\t}\n\n\t/**\n\t * Retrieves a collection of media library items (or attachments)\n\t *\n\t * Besides the common blog_id (unused), username, and password arguments, it takes a filter\n\t * array as last argument.\n\t *\n\t * Accepted 'filter' keys are 'parent_id', 'mime_type', 'offset', and 'number'.\n\t *\n\t * The defaults are as follows:\n\t * - 'number' - Default is 5. Total number of media items to retrieve.\n\t * - 'offset' - Default is 0. See WP_Query::query() for more.\n\t * - 'parent_id' - Default is ''. The post where the media item is attached. Empty string shows all media items. 0 shows unattached media items.\n\t * - 'mime_type' - Default is ''. Filter by mime type (e.g., 'image/jpeg', 'application/pdf')\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type array  $struct\n\t * }\n\t * @return array|IXR_Error Contains a collection of media items. See wp_xmlrpc_server::wp_getMediaItem() for a description of each item contents\n\t */\n\tpublic function wp_getMediaLibrary( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$struct   = isset( $args[3] ) ? $args[3] : array();\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'upload_files' ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to upload files.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getMediaLibrary' );\n\n\t\t$parent_id = ( isset( $struct['parent_id'] ) ) ? absint( $struct['parent_id'] ) : '';\n\t\t$mime_type = ( isset( $struct['mime_type'] ) ) ? $struct['mime_type'] : '';\n\t\t$offset    = ( isset( $struct['offset'] ) ) ? absint( $struct['offset'] ) : 0;\n\t\t$number    = ( isset( $struct['number'] ) ) ? absint( $struct['number'] ) : -1;\n\n\t\t$attachments = get_posts(\n\t\t\tarray(\n\t\t\t\t'post_type'      => 'attachment',\n\t\t\t\t'post_parent'    => $parent_id,\n\t\t\t\t'offset'         => $offset,\n\t\t\t\t'numberposts'    => $number,\n\t\t\t\t'post_mime_type' => $mime_type,\n\t\t\t)\n\t\t);\n\n\t\t$attachments_struct = array();\n\n\t\tforeach ( $attachments as $attachment ) {\n\t\t\t$attachments_struct[] = $this->_prepare_media_item( $attachment );\n\t\t}\n\n\t\treturn $attachments_struct;\n\t}\n\n\t/**\n\t * Retrieves a list of post formats used by the site.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return array|IXR_Error List of post formats, otherwise IXR_Error object.\n\t */\n\tpublic function wp_getPostFormats( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Sorry, you are not allowed to access details about this site.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getPostFormats' );\n\n\t\t$formats = get_post_format_strings();\n\n\t\t// Find out if they want a list of currently supports formats.\n\t\tif ( isset( $args[3] ) && is_array( $args[3] ) ) {\n\t\t\tif ( $args[3]['show-supported'] ) {\n\t\t\t\tif ( current_theme_supports( 'post-formats' ) ) {\n\t\t\t\t\t$supported = get_theme_support( 'post-formats' );\n\n\t\t\t\t\t$data              = array();\n\t\t\t\t\t$data['all']       = $formats;\n\t\t\t\t\t$data['supported'] = $supported[0];\n\n\t\t\t\t\t$formats = $data;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $formats;\n\t}\n\n\t/**\n\t * Retrieves a post type\n\t *\n\t * @since 3.4.0\n\t *\n\t * @see get_post_type_object()\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type string $post_type_name\n\t *     @type array  $fields (optional)\n\t * }\n\t * @return array|IXR_Error Array contains:\n\t *  - 'labels'\n\t *  - 'description'\n\t *  - 'capability_type'\n\t *  - 'cap'\n\t *  - 'map_meta_cap'\n\t *  - 'hierarchical'\n\t *  - 'menu_position'\n\t *  - 'taxonomies'\n\t *  - 'supports'\n\t */\n\tpublic function wp_getPostType( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 4 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username       = $args[1];\n\t\t$password       = $args[2];\n\t\t$post_type_name = $args[3];\n\n\t\tif ( isset( $args[4] ) ) {\n\t\t\t$fields = $args[4];\n\t\t} else {\n\t\t\t/**\n\t\t\t * Filters the default query fields used by the given XML-RPC method.\n\t\t\t *\n\t\t\t * @since 3.4.0\n\t\t\t *\n\t\t\t * @param array  $fields An array of post type query fields for the given method.\n\t\t\t * @param string $method The method name.\n\t\t\t */\n\t\t\t$fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostType' );\n\t\t}\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getPostType' );\n\n\t\tif ( ! post_type_exists( $post_type_name ) ) {\n\t\t\treturn new IXR_Error( 403, __( 'Invalid post type.' ) );\n\t\t}\n\n\t\t$post_type = get_post_type_object( $post_type_name );\n\n\t\tif ( ! current_user_can( $post_type->cap->edit_posts ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type.' ) );\n\t\t}\n\n\t\treturn $this->_prepare_post_type( $post_type, $fields );\n\t}\n\n\t/**\n\t * Retrieves a post types\n\t *\n\t * @since 3.4.0\n\t *\n\t * @see get_post_types()\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type array  $filter (optional)\n\t *     @type array  $fields (optional)\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function wp_getPostTypes( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 3 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$filter   = isset( $args[3] ) ? $args[3] : array( 'public' => true );\n\n\t\tif ( isset( $args[4] ) ) {\n\t\t\t$fields = $args[4];\n\t\t} else {\n\t\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\t\t$fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostTypes' );\n\t\t}\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getPostTypes' );\n\n\t\t$post_types = get_post_types( $filter, 'objects' );\n\n\t\t$struct = array();\n\n\t\tforeach ( $post_types as $post_type ) {\n\t\t\tif ( ! current_user_can( $post_type->cap->edit_posts ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$struct[ $post_type->name ] = $this->_prepare_post_type( $post_type, $fields );\n\t\t}\n\n\t\treturn $struct;\n\t}\n\n\t/**\n\t * Retrieve revisions for a specific post.\n\t *\n\t * @since 3.5.0\n\t *\n\t * The optional $fields parameter specifies what fields will be included\n\t * in the response array.\n\t *\n\t * @uses wp_get_post_revisions()\n\t * @see wp_getPost() for more on $fields\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type int    $post_id\n\t *     @type array  $fields (optional)\n\t * }\n\t * @return array|IXR_Error contains a collection of posts.\n\t */\n\tpublic function wp_getRevisions( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 4 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\t$post_id  = (int) $args[3];\n\n\t\tif ( isset( $args[4] ) ) {\n\t\t\t$fields = $args[4];\n\t\t} else {\n\t\t\t/**\n\t\t\t * Filters the default revision query fields used by the given XML-RPC method.\n\t\t\t *\n\t\t\t * @since 3.5.0\n\t\t\t *\n\t\t\t * @param array  $field  An array of revision query fields.\n\t\t\t * @param string $method The method name.\n\t\t\t */\n\t\t\t$fields = apply_filters( 'xmlrpc_default_revision_fields', array( 'post_date', 'post_date_gmt' ), 'wp.getRevisions' );\n\t\t}\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.getRevisions' );\n\n\t\t$post = get_post( $post_id );\n\t\tif ( ! $post ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) );\n\t\t}\n\n\t\t// Check if revisions are enabled.\n\t\tif ( ! wp_revisions_enabled( $post ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, revisions are disabled.' ) );\n\t\t}\n\n\t\t$revisions = wp_get_post_revisions( $post_id );\n\n\t\tif ( ! $revisions ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$struct = array();\n\n\t\tforeach ( $revisions as $revision ) {\n\t\t\tif ( ! current_user_can( 'read_post', $revision->ID ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip autosaves.\n\t\t\tif ( wp_is_post_autosave( $revision ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$struct[] = $this->_prepare_post( get_object_vars( $revision ), $fields );\n\t\t}\n\n\t\treturn $struct;\n\t}\n\n\t/**\n\t * Restore a post revision\n\t *\n\t * @since 3.5.0\n\t *\n\t * @uses wp_restore_post_revision()\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type int    $revision_id\n\t * }\n\t * @return bool|IXR_Error false if there was an error restoring, true if success.\n\t */\n\tpublic function wp_restoreRevision( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 3 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username    = $args[1];\n\t\t$password    = $args[2];\n\t\t$revision_id = (int) $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'wp.restoreRevision' );\n\n\t\t$revision = wp_get_post_revision( $revision_id );\n\t\tif ( ! $revision ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\tif ( wp_is_post_autosave( $revision ) ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\t$post = get_post( $revision->post_parent );\n\t\tif ( ! $post ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $revision->post_parent ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );\n\t\t}\n\n\t\t// Check if revisions are disabled.\n\t\tif ( ! wp_revisions_enabled( $post ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, revisions are disabled.' ) );\n\t\t}\n\n\t\t$post = wp_restore_post_revision( $revision_id );\n\n\t\treturn (bool) $post;\n\t}\n\n\t/*\n\t * Blogger API functions.\n\t * Specs on http://plant.blogger.com/api and https://groups.yahoo.com/group/bloggerDev/\n\t */\n\n\t/**\n\t * Retrieve blogs that user owns.\n\t *\n\t * Will make more sense once we support multiple blogs.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function blogger_getUsersBlogs( $args ) {\n\t\tif ( ! $this->minimum_args( $args, 3 ) ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( is_multisite() ) {\n\t\t\treturn $this->_multisite_getUsersBlogs( $args );\n\t\t}\n\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'blogger.getUsersBlogs' );\n\n\t\t$is_admin = current_user_can( 'manage_options' );\n\n\t\t$struct = array(\n\t\t\t'isAdmin'  => $is_admin,\n\t\t\t'url'      => get_option( 'home' ) . '/',\n\t\t\t'blogid'   => '1',\n\t\t\t'blogName' => get_option( 'blogname' ),\n\t\t\t'xmlrpc'   => site_url( 'xmlrpc.php', 'rpc' ),\n\t\t);\n\n\t\treturn array( $struct );\n\t}\n\n\t/**\n\t * Private function for retrieving a users blogs for multisite setups\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type string $username Username.\n\t *     @type string $password Password.\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tprotected function _multisite_getUsersBlogs( $args ) {\n\t\t$current_blog = get_site();\n\n\t\t$domain = $current_blog->domain;\n\t\t$path   = $current_blog->path . 'xmlrpc.php';\n\n\t\t$rpc = new IXR_Client( set_url_scheme( \"http://{$domain}{$path}\" ) );\n\t\t$rpc->query( 'wp.getUsersBlogs', $args[1], $args[2] );\n\t\t$blogs = $rpc->getResponse();\n\n\t\tif ( isset( $blogs['faultCode'] ) ) {\n\t\t\treturn new IXR_Error( $blogs['faultCode'], $blogs['faultString'] );\n\t\t}\n\n\t\tif ( $_SERVER['HTTP_HOST'] == $domain && $_SERVER['REQUEST_URI'] == $path ) {\n\t\t\treturn $blogs;\n\t\t} else {\n\t\t\tforeach ( (array) $blogs as $blog ) {\n\t\t\t\tif ( strpos( $blog['url'], $_SERVER['HTTP_HOST'] ) ) {\n\t\t\t\t\treturn array( $blog );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn array();\n\t\t}\n\t}\n\n\t/**\n\t * Retrieve user's data.\n\t *\n\t * Gives your client some info about you, so you don't have to.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function blogger_getUserInfo( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to access user data on this site.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'blogger.getUserInfo' );\n\n\t\t$struct = array(\n\t\t\t'nickname'  => $user->nickname,\n\t\t\t'userid'    => $user->ID,\n\t\t\t'url'       => $user->user_url,\n\t\t\t'lastname'  => $user->last_name,\n\t\t\t'firstname' => $user->first_name,\n\t\t);\n\n\t\treturn $struct;\n\t}\n\n\t/**\n\t * Retrieve post.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type int    $post_ID\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function blogger_getPost( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$post_ID  = (int) $args[1];\n\t\t$username = $args[2];\n\t\t$password = $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$post_data = get_post( $post_ID, ARRAY_A );\n\t\tif ( ! $post_data ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $post_ID ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'blogger.getPost' );\n\n\t\t$categories = implode( ',', wp_get_post_categories( $post_ID ) );\n\n\t\t$content  = '<title>' . wp_unslash( $post_data['post_title'] ) . '</title>';\n\t\t$content .= '<category>' . $categories . '</category>';\n\t\t$content .= wp_unslash( $post_data['post_content'] );\n\n\t\t$struct = array(\n\t\t\t'userid'      => $post_data['post_author'],\n\t\t\t'dateCreated' => $this->_convert_date( $post_data['post_date'] ),\n\t\t\t'content'     => $content,\n\t\t\t'postid'      => (string) $post_data['ID'],\n\t\t);\n\n\t\treturn $struct;\n\t}\n\n\t/**\n\t * Retrieve list of recent posts.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type string $appkey (unused)\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type int    $numberposts (optional)\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function blogger_getRecentPosts( $args ) {\n\n\t\t$this->escape( $args );\n\n\t\t// $args[0] = appkey - ignored.\n\t\t$username = $args[2];\n\t\t$password = $args[3];\n\t\tif ( isset( $args[4] ) ) {\n\t\t\t$query = array( 'numberposts' => absint( $args[4] ) );\n\t\t} else {\n\t\t\t$query = array();\n\t\t}\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'blogger.getRecentPosts' );\n\n\t\t$posts_list = wp_get_recent_posts( $query );\n\n\t\tif ( ! $posts_list ) {\n\t\t\t$this->error = new IXR_Error( 500, __( 'Either there are no posts, or something went wrong.' ) );\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$recent_posts = array();\n\t\tforeach ( $posts_list as $entry ) {\n\t\t\tif ( ! current_user_can( 'edit_post', $entry['ID'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$post_date  = $this->_convert_date( $entry['post_date'] );\n\t\t\t$categories = implode( ',', wp_get_post_categories( $entry['ID'] ) );\n\n\t\t\t$content  = '<title>' . wp_unslash( $entry['post_title'] ) . '</title>';\n\t\t\t$content .= '<category>' . $categories . '</category>';\n\t\t\t$content .= wp_unslash( $entry['post_content'] );\n\n\t\t\t$recent_posts[] = array(\n\t\t\t\t'userid'      => $entry['post_author'],\n\t\t\t\t'dateCreated' => $post_date,\n\t\t\t\t'content'     => $content,\n\t\t\t\t'postid'      => (string) $entry['ID'],\n\t\t\t);\n\t\t}\n\n\t\treturn $recent_posts;\n\t}\n\n\t/**\n\t * Deprecated.\n\t *\n\t * @since 1.5.0\n\t * @deprecated 3.5.0\n\t *\n\t * @param array $args Unused.\n\t * @return IXR_Error Error object.\n\t */\n\tpublic function blogger_getTemplate( $args ) {\n\t\treturn new IXR_Error( 403, __( 'Sorry, this method is not supported.' ) );\n\t}\n\n\t/**\n\t * Deprecated.\n\t *\n\t * @since 1.5.0\n\t * @deprecated 3.5.0\n\t *\n\t * @param array $args Unused.\n\t * @return IXR_Error Error object.\n\t */\n\tpublic function blogger_setTemplate( $args ) {\n\t\treturn new IXR_Error( 403, __( 'Sorry, this method is not supported.' ) );\n\t}\n\n\t/**\n\t * Creates new post.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type string $appkey (unused)\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type string $content\n\t *     @type string $publish\n\t * }\n\t * @return int|IXR_Error\n\t */\n\tpublic function blogger_newPost( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[2];\n\t\t$password = $args[3];\n\t\t$content  = $args[4];\n\t\t$publish  = $args[5];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'blogger.newPost' );\n\n\t\t$cap = ( $publish ) ? 'publish_posts' : 'edit_posts';\n\t\tif ( ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) || ! current_user_can( $cap ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to post on this site.' ) );\n\t\t}\n\n\t\t$post_status = ( $publish ) ? 'publish' : 'draft';\n\n\t\t$post_author = $user->ID;\n\n\t\t$post_title    = xmlrpc_getposttitle( $content );\n\t\t$post_category = xmlrpc_getpostcategory( $content );\n\t\t$post_content  = xmlrpc_removepostdata( $content );\n\n\t\t$post_date     = current_time( 'mysql' );\n\t\t$post_date_gmt = current_time( 'mysql', 1 );\n\n\t\t$post_data = compact( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status' );\n\n\t\t$post_ID = wp_insert_post( $post_data );\n\t\tif ( is_wp_error( $post_ID ) ) {\n\t\t\treturn new IXR_Error( 500, $post_ID->get_error_message() );\n\t\t}\n\n\t\tif ( ! $post_ID ) {\n\t\t\treturn new IXR_Error( 500, __( 'Sorry, the post could not be created.' ) );\n\t\t}\n\n\t\t$this->attach_uploads( $post_ID, $post_content );\n\n\t\t/**\n\t\t * Fires after a new post has been successfully created via the XML-RPC Blogger API.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param int   $post_ID ID of the new post.\n\t\t * @param array $args    An array of new post arguments.\n\t\t */\n\t\tdo_action( 'xmlrpc_call_success_blogger_newPost', $post_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase\n\n\t\treturn $post_ID;\n\t}\n\n\t/**\n\t * Edit a post.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type int    $post_ID\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type string $content\n\t *     @type bool   $publish\n\t * }\n\t * @return true|IXR_Error true when done.\n\t */\n\tpublic function blogger_editPost( $args ) {\n\n\t\t$this->escape( $args );\n\n\t\t$post_ID  = (int) $args[1];\n\t\t$username = $args[2];\n\t\t$password = $args[3];\n\t\t$content  = $args[4];\n\t\t$publish  = $args[5];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'blogger.editPost' );\n\n\t\t$actual_post = get_post( $post_ID, ARRAY_A );\n\n\t\tif ( ! $actual_post || 'post' !== $actual_post['post_type'] ) {\n\t\t\treturn new IXR_Error( 404, __( 'Sorry, no such post.' ) );\n\t\t}\n\n\t\t$this->escape( $actual_post );\n\n\t\tif ( ! current_user_can( 'edit_post', $post_ID ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );\n\t\t}\n\t\tif ( 'publish' === $actual_post['post_status'] && ! current_user_can( 'publish_posts' ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this post.' ) );\n\t\t}\n\n\t\t$postdata                  = array();\n\t\t$postdata['ID']            = $actual_post['ID'];\n\t\t$postdata['post_content']  = xmlrpc_removepostdata( $content );\n\t\t$postdata['post_title']    = xmlrpc_getposttitle( $content );\n\t\t$postdata['post_category'] = xmlrpc_getpostcategory( $content );\n\t\t$postdata['post_status']   = $actual_post['post_status'];\n\t\t$postdata['post_excerpt']  = $actual_post['post_excerpt'];\n\t\t$postdata['post_status']   = $publish ? 'publish' : 'draft';\n\n\t\t$result = wp_update_post( $postdata );\n\n\t\tif ( ! $result ) {\n\t\t\treturn new IXR_Error( 500, __( 'Sorry, the post could not be updated.' ) );\n\t\t}\n\t\t$this->attach_uploads( $actual_post['ID'], $postdata['post_content'] );\n\n\t\t/**\n\t\t * Fires after a post has been successfully updated via the XML-RPC Blogger API.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param int   $post_ID ID of the updated post.\n\t\t * @param array $args    An array of arguments for the post to edit.\n\t\t */\n\t\tdo_action( 'xmlrpc_call_success_blogger_editPost', $post_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Remove a post.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type int    $post_ID\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return true|IXR_Error True when post is deleted.\n\t */\n\tpublic function blogger_deletePost( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$post_ID  = (int) $args[1];\n\t\t$username = $args[2];\n\t\t$password = $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'blogger.deletePost' );\n\n\t\t$actual_post = get_post( $post_ID, ARRAY_A );\n\n\t\tif ( ! $actual_post || 'post' !== $actual_post['post_type'] ) {\n\t\t\treturn new IXR_Error( 404, __( 'Sorry, no such post.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'delete_post', $post_ID ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this post.' ) );\n\t\t}\n\n\t\t$result = wp_delete_post( $post_ID );\n\n\t\tif ( ! $result ) {\n\t\t\treturn new IXR_Error( 500, __( 'Sorry, the post could not be deleted.' ) );\n\t\t}\n\n\t\t/**\n\t\t * Fires after a post has been successfully deleted via the XML-RPC Blogger API.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param int   $post_ID ID of the deleted post.\n\t\t * @param array $args    An array of arguments to delete the post.\n\t\t */\n\t\tdo_action( 'xmlrpc_call_success_blogger_deletePost', $post_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase\n\n\t\treturn true;\n\t}\n\n\t/*\n\t * MetaWeblog API functions.\n\t * Specs on wherever Dave Winer wants them to be.\n\t */\n\n\t/**\n\t * Create a new post.\n\t *\n\t * The 'content_struct' argument must contain:\n\t *  - title\n\t *  - description\n\t *  - mt_excerpt\n\t *  - mt_text_more\n\t *  - mt_keywords\n\t *  - mt_tb_ping_urls\n\t *  - categories\n\t *\n\t * Also, it can optionally contain:\n\t *  - wp_slug\n\t *  - wp_password\n\t *  - wp_page_parent_id\n\t *  - wp_page_order\n\t *  - wp_author_id\n\t *  - post_status | page_status - can be 'draft', 'private', 'publish', or 'pending'\n\t *  - mt_allow_comments - can be 'open' or 'closed'\n\t *  - mt_allow_pings - can be 'open' or 'closed'\n\t *  - date_created_gmt\n\t *  - dateCreated\n\t *  - wp_post_thumbnail\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type array  $content_struct\n\t *     @type int    $publish\n\t * }\n\t * @return int|IXR_Error\n\t */\n\tpublic function mw_newPost( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username       = $args[1];\n\t\t$password       = $args[2];\n\t\t$content_struct = $args[3];\n\t\t$publish        = isset( $args[4] ) ? $args[4] : 0;\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'metaWeblog.newPost' );\n\n\t\t$page_template = '';\n\t\tif ( ! empty( $content_struct['post_type'] ) ) {\n\t\t\tif ( 'page' === $content_struct['post_type'] ) {\n\t\t\t\tif ( $publish ) {\n\t\t\t\t\t$cap = 'publish_pages';\n\t\t\t\t} elseif ( isset( $content_struct['page_status'] ) && 'publish' === $content_struct['page_status'] ) {\n\t\t\t\t\t$cap = 'publish_pages';\n\t\t\t\t} else {\n\t\t\t\t\t$cap = 'edit_pages';\n\t\t\t\t}\n\t\t\t\t$error_message = __( 'Sorry, you are not allowed to publish pages on this site.' );\n\t\t\t\t$post_type     = 'page';\n\t\t\t\tif ( ! empty( $content_struct['wp_page_template'] ) ) {\n\t\t\t\t\t$page_template = $content_struct['wp_page_template'];\n\t\t\t\t}\n\t\t\t} elseif ( 'post' === $content_struct['post_type'] ) {\n\t\t\t\tif ( $publish ) {\n\t\t\t\t\t$cap = 'publish_posts';\n\t\t\t\t} elseif ( isset( $content_struct['post_status'] ) && 'publish' === $content_struct['post_status'] ) {\n\t\t\t\t\t$cap = 'publish_posts';\n\t\t\t\t} else {\n\t\t\t\t\t$cap = 'edit_posts';\n\t\t\t\t}\n\t\t\t\t$error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );\n\t\t\t\t$post_type     = 'post';\n\t\t\t} else {\n\t\t\t\t// No other 'post_type' values are allowed here.\n\t\t\t\treturn new IXR_Error( 401, __( 'Invalid post type.' ) );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( $publish ) {\n\t\t\t\t$cap = 'publish_posts';\n\t\t\t} elseif ( isset( $content_struct['post_status'] ) && 'publish' === $content_struct['post_status'] ) {\n\t\t\t\t$cap = 'publish_posts';\n\t\t\t} else {\n\t\t\t\t$cap = 'edit_posts';\n\t\t\t}\n\t\t\t$error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );\n\t\t\t$post_type     = 'post';\n\t\t}\n\n\t\tif ( ! current_user_can( get_post_type_object( $post_type )->cap->create_posts ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to publish posts on this site.' ) );\n\t\t}\n\t\tif ( ! current_user_can( $cap ) ) {\n\t\t\treturn new IXR_Error( 401, $error_message );\n\t\t}\n\n\t\t// Check for a valid post format if one was given.\n\t\tif ( isset( $content_struct['wp_post_format'] ) ) {\n\t\t\t$content_struct['wp_post_format'] = sanitize_key( $content_struct['wp_post_format'] );\n\t\t\tif ( ! array_key_exists( $content_struct['wp_post_format'], get_post_format_strings() ) ) {\n\t\t\t\treturn new IXR_Error( 404, __( 'Invalid post format.' ) );\n\t\t\t}\n\t\t}\n\n\t\t// Let WordPress generate the 'post_name' (slug) unless\n\t\t// one has been provided.\n\t\t$post_name = '';\n\t\tif ( isset( $content_struct['wp_slug'] ) ) {\n\t\t\t$post_name = $content_struct['wp_slug'];\n\t\t}\n\n\t\t// Only use a password if one was given.\n\t\tif ( isset( $content_struct['wp_password'] ) ) {\n\t\t\t$post_password = $content_struct['wp_password'];\n\t\t} else {\n\t\t\t$post_password = '';\n\t\t}\n\n\t\t// Only set a post parent if one was given.\n\t\tif ( isset( $content_struct['wp_page_parent_id'] ) ) {\n\t\t\t$post_parent = $content_struct['wp_page_parent_id'];\n\t\t} else {\n\t\t\t$post_parent = 0;\n\t\t}\n\n\t\t// Only set the 'menu_order' if it was given.\n\t\tif ( isset( $content_struct['wp_page_order'] ) ) {\n\t\t\t$menu_order = $content_struct['wp_page_order'];\n\t\t} else {\n\t\t\t$menu_order = 0;\n\t\t}\n\n\t\t$post_author = $user->ID;\n\n\t\t// If an author id was provided then use it instead.\n\t\tif ( isset( $content_struct['wp_author_id'] ) && ( $user->ID != $content_struct['wp_author_id'] ) ) {\n\t\t\tswitch ( $post_type ) {\n\t\t\t\tcase 'post':\n\t\t\t\t\tif ( ! current_user_can( 'edit_others_posts' ) ) {\n\t\t\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to create posts as this user.' ) );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'page':\n\t\t\t\t\tif ( ! current_user_can( 'edit_others_pages' ) ) {\n\t\t\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to create pages as this user.' ) );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn new IXR_Error( 401, __( 'Invalid post type.' ) );\n\t\t\t}\n\t\t\t$author = get_userdata( $content_struct['wp_author_id'] );\n\t\t\tif ( ! $author ) {\n\t\t\t\treturn new IXR_Error( 404, __( 'Invalid author ID.' ) );\n\t\t\t}\n\t\t\t$post_author = $content_struct['wp_author_id'];\n\t\t}\n\n\t\t$post_title   = isset( $content_struct['title'] ) ? $content_struct['title'] : null;\n\t\t$post_content = isset( $content_struct['description'] ) ? $content_struct['description'] : null;\n\n\t\t$post_status = $publish ? 'publish' : 'draft';\n\n\t\tif ( isset( $content_struct[ \"{$post_type}_status\" ] ) ) {\n\t\t\tswitch ( $content_struct[ \"{$post_type}_status\" ] ) {\n\t\t\t\tcase 'draft':\n\t\t\t\tcase 'pending':\n\t\t\t\tcase 'private':\n\t\t\t\tcase 'publish':\n\t\t\t\t\t$post_status = $content_struct[ \"{$post_type}_status\" ];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$post_status = $publish ? 'publish' : 'draft';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$post_excerpt = isset( $content_struct['mt_excerpt'] ) ? $content_struct['mt_excerpt'] : null;\n\t\t$post_more    = isset( $content_struct['mt_text_more'] ) ? $content_struct['mt_text_more'] : null;\n\n\t\t$tags_input = isset( $content_struct['mt_keywords'] ) ? $content_struct['mt_keywords'] : null;\n\n\t\tif ( isset( $content_struct['mt_allow_comments'] ) ) {\n\t\t\tif ( ! is_numeric( $content_struct['mt_allow_comments'] ) ) {\n\t\t\t\tswitch ( $content_struct['mt_allow_comments'] ) {\n\t\t\t\t\tcase 'closed':\n\t\t\t\t\t\t$comment_status = 'closed';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'open':\n\t\t\t\t\t\t$comment_status = 'open';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$comment_status = get_default_comment_status( $post_type );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch ( (int) $content_struct['mt_allow_comments'] ) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\t$comment_status = 'closed';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t$comment_status = 'open';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$comment_status = get_default_comment_status( $post_type );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$comment_status = get_default_comment_status( $post_type );\n\t\t}\n\n\t\tif ( isset( $content_struct['mt_allow_pings'] ) ) {\n\t\t\tif ( ! is_numeric( $content_struct['mt_allow_pings'] ) ) {\n\t\t\t\tswitch ( $content_struct['mt_allow_pings'] ) {\n\t\t\t\t\tcase 'closed':\n\t\t\t\t\t\t$ping_status = 'closed';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'open':\n\t\t\t\t\t\t$ping_status = 'open';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$ping_status = get_default_comment_status( $post_type, 'pingback' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch ( (int) $content_struct['mt_allow_pings'] ) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\t$ping_status = 'closed';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t$ping_status = 'open';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$ping_status = get_default_comment_status( $post_type, 'pingback' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$ping_status = get_default_comment_status( $post_type, 'pingback' );\n\t\t}\n\n\t\tif ( $post_more ) {\n\t\t\t$post_content = $post_content . '<!--more-->' . $post_more;\n\t\t}\n\n\t\t$to_ping = null;\n\t\tif ( isset( $content_struct['mt_tb_ping_urls'] ) ) {\n\t\t\t$to_ping = $content_struct['mt_tb_ping_urls'];\n\t\t\tif ( is_array( $to_ping ) ) {\n\t\t\t\t$to_ping = implode( ' ', $to_ping );\n\t\t\t}\n\t\t}\n\n\t\t// Do some timestamp voodoo.\n\t\tif ( ! empty( $content_struct['date_created_gmt'] ) ) {\n\t\t\t// We know this is supposed to be GMT, so we're going to slap that Z on there by force.\n\t\t\t$dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';\n\t\t} elseif ( ! empty( $content_struct['dateCreated'] ) ) {\n\t\t\t$dateCreated = $content_struct['dateCreated']->getIso();\n\t\t}\n\n\t\tif ( ! empty( $dateCreated ) ) {\n\t\t\t$post_date     = iso8601_to_datetime( $dateCreated );\n\t\t\t$post_date_gmt = iso8601_to_datetime( $dateCreated, 'gmt' );\n\t\t} else {\n\t\t\t$post_date     = '';\n\t\t\t$post_date_gmt = '';\n\t\t}\n\n\t\t$post_category = array();\n\t\tif ( isset( $content_struct['categories'] ) ) {\n\t\t\t$catnames = $content_struct['categories'];\n\n\t\t\tif ( is_array( $catnames ) ) {\n\t\t\t\tforeach ( $catnames as $cat ) {\n\t\t\t\t\t$post_category[] = get_cat_ID( $cat );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$postdata = compact( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order', 'tags_input', 'page_template' );\n\n\t\t$post_ID        = get_default_post_to_edit( $post_type, true )->ID;\n\t\t$postdata['ID'] = $post_ID;\n\n\t\t// Only posts can be sticky.\n\t\tif ( 'post' === $post_type && isset( $content_struct['sticky'] ) ) {\n\t\t\t$data           = $postdata;\n\t\t\t$data['sticky'] = $content_struct['sticky'];\n\t\t\t$error          = $this->_toggle_sticky( $data );\n\t\t\tif ( $error ) {\n\t\t\t\treturn $error;\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $content_struct['custom_fields'] ) ) {\n\t\t\t$this->set_custom_fields( $post_ID, $content_struct['custom_fields'] );\n\t\t}\n\n\t\tif ( isset( $content_struct['wp_post_thumbnail'] ) ) {\n\t\t\tif ( set_post_thumbnail( $post_ID, $content_struct['wp_post_thumbnail'] ) === false ) {\n\t\t\t\treturn new IXR_Error( 404, __( 'Invalid attachment ID.' ) );\n\t\t\t}\n\n\t\t\tunset( $content_struct['wp_post_thumbnail'] );\n\t\t}\n\n\t\t// Handle enclosures.\n\t\t$thisEnclosure = isset( $content_struct['enclosure'] ) ? $content_struct['enclosure'] : null;\n\t\t$this->add_enclosure_if_new( $post_ID, $thisEnclosure );\n\n\t\t$this->attach_uploads( $post_ID, $post_content );\n\n\t\t// Handle post formats if assigned, value is validated earlier\n\t\t// in this function.\n\t\tif ( isset( $content_struct['wp_post_format'] ) ) {\n\t\t\tset_post_format( $post_ID, $content_struct['wp_post_format'] );\n\t\t}\n\n\t\t$post_ID = wp_insert_post( $postdata, true );\n\t\tif ( is_wp_error( $post_ID ) ) {\n\t\t\treturn new IXR_Error( 500, $post_ID->get_error_message() );\n\t\t}\n\n\t\tif ( ! $post_ID ) {\n\t\t\treturn new IXR_Error( 500, __( 'Sorry, the post could not be created.' ) );\n\t\t}\n\n\t\t/**\n\t\t * Fires after a new post has been successfully created via the XML-RPC MovableType API.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param int   $post_ID ID of the new post.\n\t\t * @param array $args    An array of arguments to create the new post.\n\t\t */\n\t\tdo_action( 'xmlrpc_call_success_mw_newPost', $post_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase\n\n\t\treturn strval( $post_ID );\n\t}\n\n\t/**\n\t * Adds an enclosure to a post if it's new.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param integer $post_ID   Post ID.\n\t * @param array   $enclosure Enclosure data.\n\t */\n\tpublic function add_enclosure_if_new( $post_ID, $enclosure ) {\n\t\tif ( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) {\n\t\t\t$encstring  = $enclosure['url'] . \"\\n\" . $enclosure['length'] . \"\\n\" . $enclosure['type'] . \"\\n\";\n\t\t\t$found      = false;\n\t\t\t$enclosures = get_post_meta( $post_ID, 'enclosure' );\n\t\t\tif ( $enclosures ) {\n\t\t\t\tforeach ( $enclosures as $enc ) {\n\t\t\t\t\t// This method used to omit the trailing new line. #23219\n\t\t\t\t\tif ( rtrim( $enc, \"\\n\" ) == rtrim( $encstring, \"\\n\" ) ) {\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! $found ) {\n\t\t\t\tadd_post_meta( $post_ID, 'enclosure', $encstring );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Attach upload to a post.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param int    $post_ID      Post ID.\n\t * @param string $post_content Post Content for attachment.\n\t */\n\tpublic function attach_uploads( $post_ID, $post_content ) {\n\t\tglobal $wpdb;\n\n\t\t// Find any unattached files.\n\t\t$attachments = $wpdb->get_results( \"SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '0' AND post_type = 'attachment'\" );\n\t\tif ( is_array( $attachments ) ) {\n\t\t\tforeach ( $attachments as $file ) {\n\t\t\t\tif ( ! empty( $file->guid ) && strpos( $post_content, $file->guid ) !== false ) {\n\t\t\t\t\t$wpdb->update( $wpdb->posts, array( 'post_parent' => $post_ID ), array( 'ID' => $file->ID ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Edit a post.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type array  $content_struct\n\t *     @type int    $publish\n\t * }\n\t * @return bool|IXR_Error True on success.\n\t */\n\tpublic function mw_editPost( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$post_ID        = (int) $args[0];\n\t\t$username       = $args[1];\n\t\t$password       = $args[2];\n\t\t$content_struct = $args[3];\n\t\t$publish        = isset( $args[4] ) ? $args[4] : 0;\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'metaWeblog.editPost' );\n\n\t\t$postdata = get_post( $post_ID, ARRAY_A );\n\n\t\t/*\n\t\t * If there is no post data for the give post ID, stop now and return an error.\n\t\t * Otherwise a new post will be created (which was the old behavior).\n\t\t */\n\t\tif ( ! $postdata || empty( $postdata['ID'] ) ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $post_ID ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );\n\t\t}\n\n\t\t// Use wp.editPost to edit post types other than post and page.\n\t\tif ( ! in_array( $postdata['post_type'], array( 'post', 'page' ), true ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Invalid post type.' ) );\n\t\t}\n\n\t\t// Thwart attempt to change the post type.\n\t\tif ( ! empty( $content_struct['post_type'] ) && ( $content_struct['post_type'] != $postdata['post_type'] ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'The post type may not be changed.' ) );\n\t\t}\n\n\t\t// Check for a valid post format if one was given.\n\t\tif ( isset( $content_struct['wp_post_format'] ) ) {\n\t\t\t$content_struct['wp_post_format'] = sanitize_key( $content_struct['wp_post_format'] );\n\t\t\tif ( ! array_key_exists( $content_struct['wp_post_format'], get_post_format_strings() ) ) {\n\t\t\t\treturn new IXR_Error( 404, __( 'Invalid post format.' ) );\n\t\t\t}\n\t\t}\n\n\t\t$this->escape( $postdata );\n\n\t\t$ID             = $postdata['ID'];\n\t\t$post_content   = $postdata['post_content'];\n\t\t$post_title     = $postdata['post_title'];\n\t\t$post_excerpt   = $postdata['post_excerpt'];\n\t\t$post_password  = $postdata['post_password'];\n\t\t$post_parent    = $postdata['post_parent'];\n\t\t$post_type      = $postdata['post_type'];\n\t\t$menu_order     = $postdata['menu_order'];\n\t\t$ping_status    = $postdata['ping_status'];\n\t\t$comment_status = $postdata['comment_status'];\n\n\t\t// Let WordPress manage slug if none was provided.\n\t\t$post_name = $postdata['post_name'];\n\t\tif ( isset( $content_struct['wp_slug'] ) ) {\n\t\t\t$post_name = $content_struct['wp_slug'];\n\t\t}\n\n\t\t// Only use a password if one was given.\n\t\tif ( isset( $content_struct['wp_password'] ) ) {\n\t\t\t$post_password = $content_struct['wp_password'];\n\t\t}\n\n\t\t// Only set a post parent if one was given.\n\t\tif ( isset( $content_struct['wp_page_parent_id'] ) ) {\n\t\t\t$post_parent = $content_struct['wp_page_parent_id'];\n\t\t}\n\n\t\t// Only set the 'menu_order' if it was given.\n\t\tif ( isset( $content_struct['wp_page_order'] ) ) {\n\t\t\t$menu_order = $content_struct['wp_page_order'];\n\t\t}\n\n\t\t$page_template = null;\n\t\tif ( ! empty( $content_struct['wp_page_template'] ) && 'page' === $post_type ) {\n\t\t\t$page_template = $content_struct['wp_page_template'];\n\t\t}\n\n\t\t$post_author = $postdata['post_author'];\n\n\t\t// If an author id was provided then use it instead.\n\t\tif ( isset( $content_struct['wp_author_id'] ) ) {\n\t\t\t// Check permissions if attempting to switch author to or from another user.\n\t\t\tif ( $user->ID != $content_struct['wp_author_id'] || $user->ID != $post_author ) {\n\t\t\t\tswitch ( $post_type ) {\n\t\t\t\t\tcase 'post':\n\t\t\t\t\t\tif ( ! current_user_can( 'edit_others_posts' ) ) {\n\t\t\t\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to change the post author as this user.' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'page':\n\t\t\t\t\t\tif ( ! current_user_can( 'edit_others_pages' ) ) {\n\t\t\t\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to change the page author as this user.' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn new IXR_Error( 401, __( 'Invalid post type.' ) );\n\t\t\t\t}\n\t\t\t\t$post_author = $content_struct['wp_author_id'];\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $content_struct['mt_allow_comments'] ) ) {\n\t\t\tif ( ! is_numeric( $content_struct['mt_allow_comments'] ) ) {\n\t\t\t\tswitch ( $content_struct['mt_allow_comments'] ) {\n\t\t\t\t\tcase 'closed':\n\t\t\t\t\t\t$comment_status = 'closed';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'open':\n\t\t\t\t\t\t$comment_status = 'open';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$comment_status = get_default_comment_status( $post_type );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch ( (int) $content_struct['mt_allow_comments'] ) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\t$comment_status = 'closed';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t$comment_status = 'open';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$comment_status = get_default_comment_status( $post_type );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $content_struct['mt_allow_pings'] ) ) {\n\t\t\tif ( ! is_numeric( $content_struct['mt_allow_pings'] ) ) {\n\t\t\t\tswitch ( $content_struct['mt_allow_pings'] ) {\n\t\t\t\t\tcase 'closed':\n\t\t\t\t\t\t$ping_status = 'closed';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'open':\n\t\t\t\t\t\t$ping_status = 'open';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$ping_status = get_default_comment_status( $post_type, 'pingback' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch ( (int) $content_struct['mt_allow_pings'] ) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\t$ping_status = 'closed';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t$ping_status = 'open';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$ping_status = get_default_comment_status( $post_type, 'pingback' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $content_struct['title'] ) ) {\n\t\t\t$post_title = $content_struct['title'];\n\t\t}\n\n\t\tif ( isset( $content_struct['description'] ) ) {\n\t\t\t$post_content = $content_struct['description'];\n\t\t}\n\n\t\t$post_category = array();\n\t\tif ( isset( $content_struct['categories'] ) ) {\n\t\t\t$catnames = $content_struct['categories'];\n\t\t\tif ( is_array( $catnames ) ) {\n\t\t\t\tforeach ( $catnames as $cat ) {\n\t\t\t\t\t$post_category[] = get_cat_ID( $cat );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $content_struct['mt_excerpt'] ) ) {\n\t\t\t$post_excerpt = $content_struct['mt_excerpt'];\n\t\t}\n\n\t\t$post_more = isset( $content_struct['mt_text_more'] ) ? $content_struct['mt_text_more'] : null;\n\n\t\t$post_status = $publish ? 'publish' : 'draft';\n\t\tif ( isset( $content_struct[ \"{$post_type}_status\" ] ) ) {\n\t\t\tswitch ( $content_struct[ \"{$post_type}_status\" ] ) {\n\t\t\t\tcase 'draft':\n\t\t\t\tcase 'pending':\n\t\t\t\tcase 'private':\n\t\t\t\tcase 'publish':\n\t\t\t\t\t$post_status = $content_struct[ \"{$post_type}_status\" ];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$post_status = $publish ? 'publish' : 'draft';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$tags_input = isset( $content_struct['mt_keywords'] ) ? $content_struct['mt_keywords'] : null;\n\n\t\tif ( 'publish' === $post_status || 'private' === $post_status ) {\n\t\t\tif ( 'page' === $post_type && ! current_user_can( 'publish_pages' ) ) {\n\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this page.' ) );\n\t\t\t} elseif ( ! current_user_can( 'publish_posts' ) ) {\n\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this post.' ) );\n\t\t\t}\n\t\t}\n\n\t\tif ( $post_more ) {\n\t\t\t$post_content = $post_content . '<!--more-->' . $post_more;\n\t\t}\n\n\t\t$to_ping = null;\n\t\tif ( isset( $content_struct['mt_tb_ping_urls'] ) ) {\n\t\t\t$to_ping = $content_struct['mt_tb_ping_urls'];\n\t\t\tif ( is_array( $to_ping ) ) {\n\t\t\t\t$to_ping = implode( ' ', $to_ping );\n\t\t\t}\n\t\t}\n\n\t\t// Do some timestamp voodoo.\n\t\tif ( ! empty( $content_struct['date_created_gmt'] ) ) {\n\t\t\t// We know this is supposed to be GMT, so we're going to slap that Z on there by force.\n\t\t\t$dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';\n\t\t} elseif ( ! empty( $content_struct['dateCreated'] ) ) {\n\t\t\t$dateCreated = $content_struct['dateCreated']->getIso();\n\t\t}\n\n\t\t// Default to not flagging the post date to be edited unless it's intentional.\n\t\t$edit_date = false;\n\n\t\tif ( ! empty( $dateCreated ) ) {\n\t\t\t$post_date     = iso8601_to_datetime( $dateCreated );\n\t\t\t$post_date_gmt = iso8601_to_datetime( $dateCreated, 'gmt' );\n\n\t\t\t// Flag the post date to be edited.\n\t\t\t$edit_date = true;\n\t\t} else {\n\t\t\t$post_date     = $postdata['post_date'];\n\t\t\t$post_date_gmt = $postdata['post_date_gmt'];\n\t\t}\n\n\t\t// We've got all the data -- post it.\n\t\t$newpost = compact( 'ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'edit_date', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author', 'tags_input', 'page_template' );\n\n\t\t$result = wp_update_post( $newpost, true );\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\treturn new IXR_Error( 500, $result->get_error_message() );\n\t\t}\n\n\t\tif ( ! $result ) {\n\t\t\treturn new IXR_Error( 500, __( 'Sorry, the post could not be updated.' ) );\n\t\t}\n\n\t\t// Only posts can be sticky.\n\t\tif ( 'post' === $post_type && isset( $content_struct['sticky'] ) ) {\n\t\t\t$data              = $newpost;\n\t\t\t$data['sticky']    = $content_struct['sticky'];\n\t\t\t$data['post_type'] = 'post';\n\t\t\t$error             = $this->_toggle_sticky( $data, true );\n\t\t\tif ( $error ) {\n\t\t\t\treturn $error;\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $content_struct['custom_fields'] ) ) {\n\t\t\t$this->set_custom_fields( $post_ID, $content_struct['custom_fields'] );\n\t\t}\n\n\t\tif ( isset( $content_struct['wp_post_thumbnail'] ) ) {\n\n\t\t\t// Empty value deletes, non-empty value adds/updates.\n\t\t\tif ( empty( $content_struct['wp_post_thumbnail'] ) ) {\n\t\t\t\tdelete_post_thumbnail( $post_ID );\n\t\t\t} else {\n\t\t\t\tif ( set_post_thumbnail( $post_ID, $content_struct['wp_post_thumbnail'] ) === false ) {\n\t\t\t\t\treturn new IXR_Error( 404, __( 'Invalid attachment ID.' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset( $content_struct['wp_post_thumbnail'] );\n\t\t}\n\n\t\t// Handle enclosures.\n\t\t$thisEnclosure = isset( $content_struct['enclosure'] ) ? $content_struct['enclosure'] : null;\n\t\t$this->add_enclosure_if_new( $post_ID, $thisEnclosure );\n\n\t\t$this->attach_uploads( $ID, $post_content );\n\n\t\t// Handle post formats if assigned, validation is handled earlier in this function.\n\t\tif ( isset( $content_struct['wp_post_format'] ) ) {\n\t\t\tset_post_format( $post_ID, $content_struct['wp_post_format'] );\n\t\t}\n\n\t\t/**\n\t\t * Fires after a post has been successfully updated via the XML-RPC MovableType API.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param int   $post_ID ID of the updated post.\n\t\t * @param array $args    An array of arguments to update the post.\n\t\t */\n\t\tdo_action( 'xmlrpc_call_success_mw_editPost', $post_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieve post.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type int    $post_ID\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function mw_getPost( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$post_ID  = (int) $args[0];\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$postdata = get_post( $post_ID, ARRAY_A );\n\t\tif ( ! $postdata ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $post_ID ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'metaWeblog.getPost' );\n\n\t\tif ( '' !== $postdata['post_date'] ) {\n\t\t\t$post_date         = $this->_convert_date( $postdata['post_date'] );\n\t\t\t$post_date_gmt     = $this->_convert_date_gmt( $postdata['post_date_gmt'], $postdata['post_date'] );\n\t\t\t$post_modified     = $this->_convert_date( $postdata['post_modified'] );\n\t\t\t$post_modified_gmt = $this->_convert_date_gmt( $postdata['post_modified_gmt'], $postdata['post_modified'] );\n\n\t\t\t$categories = array();\n\t\t\t$catids     = wp_get_post_categories( $post_ID );\n\t\t\tforeach ( $catids as $catid ) {\n\t\t\t\t$categories[] = get_cat_name( $catid );\n\t\t\t}\n\n\t\t\t$tagnames = array();\n\t\t\t$tags     = wp_get_post_tags( $post_ID );\n\t\t\tif ( ! empty( $tags ) ) {\n\t\t\t\tforeach ( $tags as $tag ) {\n\t\t\t\t\t$tagnames[] = $tag->name;\n\t\t\t\t}\n\t\t\t\t$tagnames = implode( ', ', $tagnames );\n\t\t\t} else {\n\t\t\t\t$tagnames = '';\n\t\t\t}\n\n\t\t\t$post = get_extended( $postdata['post_content'] );\n\t\t\t$link = get_permalink( $postdata['ID'] );\n\n\t\t\t// Get the author info.\n\t\t\t$author = get_userdata( $postdata['post_author'] );\n\n\t\t\t$allow_comments = ( 'open' === $postdata['comment_status'] ) ? 1 : 0;\n\t\t\t$allow_pings    = ( 'open' === $postdata['ping_status'] ) ? 1 : 0;\n\n\t\t\t// Consider future posts as published.\n\t\t\tif ( 'future' === $postdata['post_status'] ) {\n\t\t\t\t$postdata['post_status'] = 'publish';\n\t\t\t}\n\n\t\t\t// Get post format.\n\t\t\t$post_format = get_post_format( $post_ID );\n\t\t\tif ( empty( $post_format ) ) {\n\t\t\t\t$post_format = 'standard';\n\t\t\t}\n\n\t\t\t$sticky = false;\n\t\t\tif ( is_sticky( $post_ID ) ) {\n\t\t\t\t$sticky = true;\n\t\t\t}\n\n\t\t\t$enclosure = array();\n\t\t\tforeach ( (array) get_post_custom( $post_ID ) as $key => $val ) {\n\t\t\t\tif ( 'enclosure' === $key ) {\n\t\t\t\t\tforeach ( (array) $val as $enc ) {\n\t\t\t\t\t\t$encdata             = explode( \"\\n\", $enc );\n\t\t\t\t\t\t$enclosure['url']    = trim( htmlspecialchars( $encdata[0] ) );\n\t\t\t\t\t\t$enclosure['length'] = (int) trim( $encdata[1] );\n\t\t\t\t\t\t$enclosure['type']   = trim( $encdata[2] );\n\t\t\t\t\t\tbreak 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$resp = array(\n\t\t\t\t'dateCreated'            => $post_date,\n\t\t\t\t'userid'                 => $postdata['post_author'],\n\t\t\t\t'postid'                 => $postdata['ID'],\n\t\t\t\t'description'            => $post['main'],\n\t\t\t\t'title'                  => $postdata['post_title'],\n\t\t\t\t'link'                   => $link,\n\t\t\t\t'permaLink'              => $link,\n\t\t\t\t// Commented out because no other tool seems to use this.\n\t\t\t\t// 'content' => $entry['post_content'],\n\t\t\t\t'categories'             => $categories,\n\t\t\t\t'mt_excerpt'             => $postdata['post_excerpt'],\n\t\t\t\t'mt_text_more'           => $post['extended'],\n\t\t\t\t'wp_more_text'           => $post['more_text'],\n\t\t\t\t'mt_allow_comments'      => $allow_comments,\n\t\t\t\t'mt_allow_pings'         => $allow_pings,\n\t\t\t\t'mt_keywords'            => $tagnames,\n\t\t\t\t'wp_slug'                => $postdata['post_name'],\n\t\t\t\t'wp_password'            => $postdata['post_password'],\n\t\t\t\t'wp_author_id'           => (string) $author->ID,\n\t\t\t\t'wp_author_display_name' => $author->display_name,\n\t\t\t\t'date_created_gmt'       => $post_date_gmt,\n\t\t\t\t'post_status'            => $postdata['post_status'],\n\t\t\t\t'custom_fields'          => $this->get_custom_fields( $post_ID ),\n\t\t\t\t'wp_post_format'         => $post_format,\n\t\t\t\t'sticky'                 => $sticky,\n\t\t\t\t'date_modified'          => $post_modified,\n\t\t\t\t'date_modified_gmt'      => $post_modified_gmt,\n\t\t\t);\n\n\t\t\tif ( ! empty( $enclosure ) ) {\n\t\t\t\t$resp['enclosure'] = $enclosure;\n\t\t\t}\n\n\t\t\t$resp['wp_post_thumbnail'] = get_post_thumbnail_id( $postdata['ID'] );\n\n\t\t\treturn $resp;\n\t\t} else {\n\t\t\treturn new IXR_Error( 404, __( 'Sorry, no such post.' ) );\n\t\t}\n\t}\n\n\t/**\n\t * Retrieve list of recent posts.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type int    $numberposts\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function mw_getRecentPosts( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\tif ( isset( $args[3] ) ) {\n\t\t\t$query = array( 'numberposts' => absint( $args[3] ) );\n\t\t} else {\n\t\t\t$query = array();\n\t\t}\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'metaWeblog.getRecentPosts' );\n\n\t\t$posts_list = wp_get_recent_posts( $query );\n\n\t\tif ( ! $posts_list ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$recent_posts = array();\n\t\tforeach ( $posts_list as $entry ) {\n\t\t\tif ( ! current_user_can( 'edit_post', $entry['ID'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$post_date         = $this->_convert_date( $entry['post_date'] );\n\t\t\t$post_date_gmt     = $this->_convert_date_gmt( $entry['post_date_gmt'], $entry['post_date'] );\n\t\t\t$post_modified     = $this->_convert_date( $entry['post_modified'] );\n\t\t\t$post_modified_gmt = $this->_convert_date_gmt( $entry['post_modified_gmt'], $entry['post_modified'] );\n\n\t\t\t$categories = array();\n\t\t\t$catids     = wp_get_post_categories( $entry['ID'] );\n\t\t\tforeach ( $catids as $catid ) {\n\t\t\t\t$categories[] = get_cat_name( $catid );\n\t\t\t}\n\n\t\t\t$tagnames = array();\n\t\t\t$tags     = wp_get_post_tags( $entry['ID'] );\n\t\t\tif ( ! empty( $tags ) ) {\n\t\t\t\tforeach ( $tags as $tag ) {\n\t\t\t\t\t$tagnames[] = $tag->name;\n\t\t\t\t}\n\t\t\t\t$tagnames = implode( ', ', $tagnames );\n\t\t\t} else {\n\t\t\t\t$tagnames = '';\n\t\t\t}\n\n\t\t\t$post = get_extended( $entry['post_content'] );\n\t\t\t$link = get_permalink( $entry['ID'] );\n\n\t\t\t// Get the post author info.\n\t\t\t$author = get_userdata( $entry['post_author'] );\n\n\t\t\t$allow_comments = ( 'open' === $entry['comment_status'] ) ? 1 : 0;\n\t\t\t$allow_pings    = ( 'open' === $entry['ping_status'] ) ? 1 : 0;\n\n\t\t\t// Consider future posts as published.\n\t\t\tif ( 'future' === $entry['post_status'] ) {\n\t\t\t\t$entry['post_status'] = 'publish';\n\t\t\t}\n\n\t\t\t// Get post format.\n\t\t\t$post_format = get_post_format( $entry['ID'] );\n\t\t\tif ( empty( $post_format ) ) {\n\t\t\t\t$post_format = 'standard';\n\t\t\t}\n\n\t\t\t$recent_posts[] = array(\n\t\t\t\t'dateCreated'            => $post_date,\n\t\t\t\t'userid'                 => $entry['post_author'],\n\t\t\t\t'postid'                 => (string) $entry['ID'],\n\t\t\t\t'description'            => $post['main'],\n\t\t\t\t'title'                  => $entry['post_title'],\n\t\t\t\t'link'                   => $link,\n\t\t\t\t'permaLink'              => $link,\n\t\t\t\t// Commented out because no other tool seems to use this.\n\t\t\t\t// 'content' => $entry['post_content'],\n\t\t\t\t'categories'             => $categories,\n\t\t\t\t'mt_excerpt'             => $entry['post_excerpt'],\n\t\t\t\t'mt_text_more'           => $post['extended'],\n\t\t\t\t'wp_more_text'           => $post['more_text'],\n\t\t\t\t'mt_allow_comments'      => $allow_comments,\n\t\t\t\t'mt_allow_pings'         => $allow_pings,\n\t\t\t\t'mt_keywords'            => $tagnames,\n\t\t\t\t'wp_slug'                => $entry['post_name'],\n\t\t\t\t'wp_password'            => $entry['post_password'],\n\t\t\t\t'wp_author_id'           => (string) $author->ID,\n\t\t\t\t'wp_author_display_name' => $author->display_name,\n\t\t\t\t'date_created_gmt'       => $post_date_gmt,\n\t\t\t\t'post_status'            => $entry['post_status'],\n\t\t\t\t'custom_fields'          => $this->get_custom_fields( $entry['ID'] ),\n\t\t\t\t'wp_post_format'         => $post_format,\n\t\t\t\t'date_modified'          => $post_modified,\n\t\t\t\t'date_modified_gmt'      => $post_modified_gmt,\n\t\t\t\t'sticky'                 => ( 'post' === $entry['post_type'] && is_sticky( $entry['ID'] ) ),\n\t\t\t\t'wp_post_thumbnail'      => get_post_thumbnail_id( $entry['ID'] ),\n\t\t\t);\n\t\t}\n\n\t\treturn $recent_posts;\n\t}\n\n\t/**\n\t * Retrieve the list of categories on a given blog.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function mw_getCategories( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view categories.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'metaWeblog.getCategories' );\n\n\t\t$categories_struct = array();\n\n\t\t$cats = get_categories( array( 'get' => 'all' ) );\n\t\tif ( $cats ) {\n\t\t\tforeach ( $cats as $cat ) {\n\t\t\t\t$struct                        = array();\n\t\t\t\t$struct['categoryId']          = $cat->term_id;\n\t\t\t\t$struct['parentId']            = $cat->parent;\n\t\t\t\t$struct['description']         = $cat->name;\n\t\t\t\t$struct['categoryDescription'] = $cat->description;\n\t\t\t\t$struct['categoryName']        = $cat->name;\n\t\t\t\t$struct['htmlUrl']             = esc_html( get_category_link( $cat->term_id ) );\n\t\t\t\t$struct['rssUrl']              = esc_html( get_category_feed_link( $cat->term_id, 'rss2' ) );\n\n\t\t\t\t$categories_struct[] = $struct;\n\t\t\t}\n\t\t}\n\n\t\treturn $categories_struct;\n\t}\n\n\t/**\n\t * Uploads a file, following your settings.\n\t *\n\t * Adapted from a patch by Johann Richard.\n\t *\n\t * @link http://mycvs.org/archives/2004/06/30/file-upload-to-wordpress-in-ecto/\n\t *\n\t * @since 1.5.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type array  $data\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function mw_newMediaObject( $args ) {\n\t\tglobal $wpdb;\n\n\t\t$username = $this->escape( $args[1] );\n\t\t$password = $this->escape( $args[2] );\n\t\t$data     = $args[3];\n\n\t\t$name = sanitize_file_name( $data['name'] );\n\t\t$type = $data['type'];\n\t\t$bits = $data['bits'];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'metaWeblog.newMediaObject' );\n\n\t\tif ( ! current_user_can( 'upload_files' ) ) {\n\t\t\t$this->error = new IXR_Error( 401, __( 'Sorry, you are not allowed to upload files.' ) );\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( is_multisite() && upload_is_user_over_quota( false ) ) {\n\t\t\t$this->error = new IXR_Error(\n\t\t\t\t401,\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Allowed space allocation. */\n\t\t\t\t\t__( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.' ),\n\t\t\t\t\tsize_format( get_space_allowed() * MB_IN_BYTES )\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/**\n\t\t * Filters whether to preempt the XML-RPC media upload.\n\t\t *\n\t\t * Passing a truthy value will effectively short-circuit the media upload,\n\t\t * returning that value as a 500 error instead.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param bool $error Whether to pre-empt the media upload. Default false.\n\t\t */\n\t\t$upload_err = apply_filters( 'pre_upload_error', false );\n\t\tif ( $upload_err ) {\n\t\t\treturn new IXR_Error( 500, $upload_err );\n\t\t}\n\n\t\t$upload = wp_upload_bits( $name, null, $bits );\n\t\tif ( ! empty( $upload['error'] ) ) {\n\t\t\t/* translators: 1: File name, 2: Error message. */\n\t\t\t$errorString = sprintf( __( 'Could not write file %1$s (%2$s).' ), $name, $upload['error'] );\n\t\t\treturn new IXR_Error( 500, $errorString );\n\t\t}\n\t\t// Construct the attachment array.\n\t\t$post_id = 0;\n\t\tif ( ! empty( $data['post_id'] ) ) {\n\t\t\t$post_id = (int) $data['post_id'];\n\n\t\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );\n\t\t\t}\n\t\t}\n\t\t$attachment = array(\n\t\t\t'post_title'     => $name,\n\t\t\t'post_content'   => '',\n\t\t\t'post_type'      => 'attachment',\n\t\t\t'post_parent'    => $post_id,\n\t\t\t'post_mime_type' => $type,\n\t\t\t'guid'           => $upload['url'],\n\t\t);\n\n\t\t// Save the data.\n\t\t$id = wp_insert_attachment( $attachment, $upload['file'], $post_id );\n\t\twp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) );\n\n\t\t/**\n\t\t * Fires after a new attachment has been added via the XML-RPC MovableType API.\n\t\t *\n\t\t * @since 3.4.0\n\t\t *\n\t\t * @param int   $id   ID of the new attachment.\n\t\t * @param array $args An array of arguments to add the attachment.\n\t\t */\n\t\tdo_action( 'xmlrpc_call_success_mw_newMediaObject', $id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase\n\n\t\t$struct = $this->_prepare_media_item( get_post( $id ) );\n\n\t\t// Deprecated values.\n\t\t$struct['id']   = $struct['attachment_id'];\n\t\t$struct['file'] = $struct['title'];\n\t\t$struct['url']  = $struct['link'];\n\n\t\treturn $struct;\n\t}\n\n\t/*\n\t * MovableType API functions.\n\t * Specs on http://www.movabletype.org/docs/mtmanual_programmatic.html\n\t */\n\n\t/**\n\t * Retrieve the post titles of recent posts.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type int    $numberposts\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function mt_getRecentPostTitles( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\t\tif ( isset( $args[3] ) ) {\n\t\t\t$query = array( 'numberposts' => absint( $args[3] ) );\n\t\t} else {\n\t\t\t$query = array();\n\t\t}\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'mt.getRecentPostTitles' );\n\n\t\t$posts_list = wp_get_recent_posts( $query );\n\n\t\tif ( ! $posts_list ) {\n\t\t\t$this->error = new IXR_Error( 500, __( 'Either there are no posts, or something went wrong.' ) );\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t$recent_posts = array();\n\n\t\tforeach ( $posts_list as $entry ) {\n\t\t\tif ( ! current_user_can( 'edit_post', $entry['ID'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$post_date     = $this->_convert_date( $entry['post_date'] );\n\t\t\t$post_date_gmt = $this->_convert_date_gmt( $entry['post_date_gmt'], $entry['post_date'] );\n\n\t\t\t$recent_posts[] = array(\n\t\t\t\t'dateCreated'      => $post_date,\n\t\t\t\t'userid'           => $entry['post_author'],\n\t\t\t\t'postid'           => (string) $entry['ID'],\n\t\t\t\t'title'            => $entry['post_title'],\n\t\t\t\t'post_status'      => $entry['post_status'],\n\t\t\t\t'date_created_gmt' => $post_date_gmt,\n\t\t\t);\n\t\t}\n\n\t\treturn $recent_posts;\n\t}\n\n\t/**\n\t * Retrieve list of all categories on blog.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $blog_id (unused)\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function mt_getCategoryList( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view categories.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'mt.getCategoryList' );\n\n\t\t$categories_struct = array();\n\n\t\t$cats = get_categories(\n\t\t\tarray(\n\t\t\t\t'hide_empty'   => 0,\n\t\t\t\t'hierarchical' => 0,\n\t\t\t)\n\t\t);\n\t\tif ( $cats ) {\n\t\t\tforeach ( $cats as $cat ) {\n\t\t\t\t$struct                 = array();\n\t\t\t\t$struct['categoryId']   = $cat->term_id;\n\t\t\t\t$struct['categoryName'] = $cat->name;\n\n\t\t\t\t$categories_struct[] = $struct;\n\t\t\t}\n\t\t}\n\n\t\treturn $categories_struct;\n\t}\n\n\t/**\n\t * Retrieve post categories.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $post_ID\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return array|IXR_Error\n\t */\n\tpublic function mt_getPostCategories( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$post_ID  = (int) $args[0];\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\tif ( ! get_post( $post_ID ) ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $post_ID ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'mt.getPostCategories' );\n\n\t\t$categories = array();\n\t\t$catids     = wp_get_post_categories( intval( $post_ID ) );\n\t\t// First listed category will be the primary category.\n\t\t$isPrimary = true;\n\t\tforeach ( $catids as $catid ) {\n\t\t\t$categories[] = array(\n\t\t\t\t'categoryName' => get_cat_name( $catid ),\n\t\t\t\t'categoryId'   => (string) $catid,\n\t\t\t\t'isPrimary'    => $isPrimary,\n\t\t\t);\n\t\t\t$isPrimary    = false;\n\t\t}\n\n\t\treturn $categories;\n\t}\n\n\t/**\n\t * Sets categories for a post.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $post_ID\n\t *     @type string $username\n\t *     @type string $password\n\t *     @type array  $categories\n\t * }\n\t * @return true|IXR_Error True on success.\n\t */\n\tpublic function mt_setPostCategories( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$post_ID    = (int) $args[0];\n\t\t$username   = $args[1];\n\t\t$password   = $args[2];\n\t\t$categories = $args[3];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'mt.setPostCategories' );\n\n\t\tif ( ! get_post( $post_ID ) ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $post_ID ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );\n\t\t}\n\n\t\t$catids = array();\n\t\tforeach ( $categories as $cat ) {\n\t\t\t$catids[] = $cat['categoryId'];\n\t\t}\n\n\t\twp_set_post_categories( $post_ID, $catids );\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieve an array of methods supported by this server.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return array\n\t */\n\tpublic function mt_supportedMethods() {\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'mt.supportedMethods' );\n\n\t\treturn array_keys( $this->methods );\n\t}\n\n\t/**\n\t * Retrieve an empty array because we don't support per-post text filters.\n\t *\n\t * @since 1.5.0\n\t */\n\tpublic function mt_supportedTextFilters() {\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'mt.supportedTextFilters' );\n\n\t\t/**\n\t\t * Filters the MoveableType text filters list for XML-RPC.\n\t\t *\n\t\t * @since 2.2.0\n\t\t *\n\t\t * @param array $filters An array of text filters.\n\t\t */\n\t\treturn apply_filters( 'xmlrpc_text_filters', array() );\n\t}\n\n\t/**\n\t * Retrieve trackbacks sent to a given post.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param int $post_ID\n\t * @return array|IXR_Error\n\t */\n\tpublic function mt_getTrackbackPings( $post_ID ) {\n\t\tglobal $wpdb;\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'mt.getTrackbackPings' );\n\n\t\t$actual_post = get_post( $post_ID, ARRAY_A );\n\n\t\tif ( ! $actual_post ) {\n\t\t\treturn new IXR_Error( 404, __( 'Sorry, no such post.' ) );\n\t\t}\n\n\t\t$comments = $wpdb->get_results( $wpdb->prepare( \"SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d\", $post_ID ) );\n\n\t\tif ( ! $comments ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$trackback_pings = array();\n\t\tforeach ( $comments as $comment ) {\n\t\t\tif ( 'trackback' === $comment->comment_type ) {\n\t\t\t\t$content           = $comment->comment_content;\n\t\t\t\t$title             = substr( $content, 8, ( strpos( $content, '</strong>' ) - 8 ) );\n\t\t\t\t$trackback_pings[] = array(\n\t\t\t\t\t'pingTitle' => $title,\n\t\t\t\t\t'pingURL'   => $comment->comment_author_url,\n\t\t\t\t\t'pingIP'    => $comment->comment_author_IP,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $trackback_pings;\n\t}\n\n\t/**\n\t * Sets a post's publish status to 'publish'.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type int    $post_ID\n\t *     @type string $username\n\t *     @type string $password\n\t * }\n\t * @return int|IXR_Error\n\t */\n\tpublic function mt_publishPost( $args ) {\n\t\t$this->escape( $args );\n\n\t\t$post_ID  = (int) $args[0];\n\t\t$username = $args[1];\n\t\t$password = $args[2];\n\n\t\t$user = $this->login( $username, $password );\n\t\tif ( ! $user ) {\n\t\t\treturn $this->error;\n\t\t}\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'mt.publishPost' );\n\n\t\t$postdata = get_post( $post_ID, ARRAY_A );\n\t\tif ( ! $postdata ) {\n\t\t\treturn new IXR_Error( 404, __( 'Invalid post ID.' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( 'publish_posts' ) || ! current_user_can( 'edit_post', $post_ID ) ) {\n\t\t\treturn new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this post.' ) );\n\t\t}\n\n\t\t$postdata['post_status'] = 'publish';\n\n\t\t// Retain old categories.\n\t\t$postdata['post_category'] = wp_get_post_categories( $post_ID );\n\t\t$this->escape( $postdata );\n\n\t\treturn wp_update_post( $postdata );\n\t}\n\n\t/*\n\t * Pingback functions.\n\t * Specs on www.hixie.ch/specs/pingback/pingback\n\t */\n\n\t/**\n\t * Retrieves a pingback and registers it.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $args {\n\t *     Method arguments. Note: arguments must be ordered as documented.\n\t *\n\t *     @type string $pagelinkedfrom\n\t *     @type string $pagelinkedto\n\t * }\n\t * @return string|IXR_Error\n\t */\n\tpublic function pingback_ping( $args ) {\n\t\tglobal $wpdb;\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'pingback.ping' );\n\n\t\t$this->escape( $args );\n\n\t\t$pagelinkedfrom = str_replace( '&amp;', '&', $args[0] );\n\t\t$pagelinkedto   = str_replace( '&amp;', '&', $args[1] );\n\t\t$pagelinkedto   = str_replace( '&', '&amp;', $pagelinkedto );\n\n\t\t/**\n\t\t * Filters the pingback source URI.\n\t\t *\n\t\t * @since 3.6.0\n\t\t *\n\t\t * @param string $pagelinkedfrom URI of the page linked from.\n\t\t * @param string $pagelinkedto   URI of the page linked to.\n\t\t */\n\t\t$pagelinkedfrom = apply_filters( 'pingback_ping_source_uri', $pagelinkedfrom, $pagelinkedto );\n\n\t\tif ( ! $pagelinkedfrom ) {\n\t\t\treturn $this->pingback_error( 0, __( 'A valid URL was not provided.' ) );\n\t\t}\n\n\t\t// Check if the page linked to is on our site.\n\t\t$pos1 = strpos( $pagelinkedto, str_replace( array( 'http://www.', 'http://', 'https://www.', 'https://' ), '', get_option( 'home' ) ) );\n\t\tif ( ! $pos1 ) {\n\t\t\treturn $this->pingback_error( 0, __( 'Is there no link to us?' ) );\n\t\t}\n\n\t\t/*\n\t\t * Let's find which post is linked to.\n\t\t * FIXME: Does url_to_postid() cover all these cases already?\n\t\t * If so, then let's use it and drop the old code.\n\t\t */\n\t\t$urltest = parse_url( $pagelinkedto );\n\t\t$post_ID = url_to_postid( $pagelinkedto );\n\t\tif ( $post_ID ) {\n\t\t\t// $way\n\t\t} elseif ( isset( $urltest['path'] ) && preg_match( '#p/[0-9]{1,}#', $urltest['path'], $match ) ) {\n\t\t\t// The path defines the post_ID (archives/p/XXXX).\n\t\t\t$blah    = explode( '/', $match[0] );\n\t\t\t$post_ID = (int) $blah[1];\n\t\t} elseif ( isset( $urltest['query'] ) && preg_match( '#p=[0-9]{1,}#', $urltest['query'], $match ) ) {\n\t\t\t// The query string defines the post_ID (?p=XXXX).\n\t\t\t$blah    = explode( '=', $match[0] );\n\t\t\t$post_ID = (int) $blah[1];\n\t\t} elseif ( isset( $urltest['fragment'] ) ) {\n\t\t\t// An #anchor is there, it's either...\n\t\t\tif ( intval( $urltest['fragment'] ) ) {\n\t\t\t\t// ...an integer #XXXX (simplest case),\n\t\t\t\t$post_ID = (int) $urltest['fragment'];\n\t\t\t} elseif ( preg_match( '/post-[0-9]+/', $urltest['fragment'] ) ) {\n\t\t\t\t// ...a post ID in the form 'post-###',\n\t\t\t\t$post_ID = preg_replace( '/[^0-9]+/', '', $urltest['fragment'] );\n\t\t\t} elseif ( is_string( $urltest['fragment'] ) ) {\n\t\t\t\t// ...or a string #title, a little more complicated.\n\t\t\t\t$title   = preg_replace( '/[^a-z0-9]/i', '.', $urltest['fragment'] );\n\t\t\t\t$sql     = $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE post_title RLIKE %s\", $title );\n\t\t\t\t$post_ID = $wpdb->get_var( $sql );\n\t\t\t\tif ( ! $post_ID ) {\n\t\t\t\t\t// Returning unknown error '0' is better than die()'ing.\n\t\t\t\t\treturn $this->pingback_error( 0, '' );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// TODO: Attempt to extract a post ID from the given URL.\n\t\t\treturn $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either doesn&#8217;t exist, or it is not a pingback-enabled resource.' ) );\n\t\t}\n\t\t$post_ID = (int) $post_ID;\n\n\t\t$post = get_post( $post_ID );\n\n\t\tif ( ! $post ) { // Post not found.\n\t\t\treturn $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either doesn&#8217;t exist, or it is not a pingback-enabled resource.' ) );\n\t\t}\n\n\t\tif ( url_to_postid( $pagelinkedfrom ) == $post_ID ) {\n\t\t\treturn $this->pingback_error( 0, __( 'The source URL and the target URL cannot both point to the same resource.' ) );\n\t\t}\n\n\t\t// Check if pings are on.\n\t\tif ( ! pings_open( $post ) ) {\n\t\t\treturn $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either doesn&#8217;t exist, or it is not a pingback-enabled resource.' ) );\n\t\t}\n\n\t\t// Let's check that the remote site didn't already pingback this entry.\n\t\tif ( $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s\", $post_ID, $pagelinkedfrom ) ) ) {\n\t\t\treturn $this->pingback_error( 48, __( 'The pingback has already been registered.' ) );\n\t\t}\n\n\t\t// Very stupid, but gives time to the 'from' server to publish!\n\t\tsleep( 1 );\n\n\t\t$remote_ip = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] );\n\n\t\t/** This filter is documented in wp-includes/class-http.php */\n\t\t$user_agent = apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ), $pagelinkedfrom );\n\n\t\t// Let's check the remote site.\n\t\t$http_api_args = array(\n\t\t\t'timeout'             => 10,\n\t\t\t'redirection'         => 0,\n\t\t\t'limit_response_size' => 153600, // 150 KB\n\t\t\t'user-agent'          => \"$user_agent; verifying pingback from $remote_ip\",\n\t\t\t'headers'             => array(\n\t\t\t\t'X-Pingback-Forwarded-For' => $remote_ip,\n\t\t\t),\n\t\t);\n\n\t\t$request                = wp_safe_remote_get( $pagelinkedfrom, $http_api_args );\n\t\t$remote_source          = wp_remote_retrieve_body( $request );\n\t\t$remote_source_original = $remote_source;\n\n\t\tif ( ! $remote_source ) {\n\t\t\treturn $this->pingback_error( 16, __( 'The source URL does not exist.' ) );\n\t\t}\n\n\t\t/**\n\t\t * Filters the pingback remote source.\n\t\t *\n\t\t * @since 2.5.0\n\t\t *\n\t\t * @param string $remote_source Response source for the page linked from.\n\t\t * @param string $pagelinkedto  URL of the page linked to.\n\t\t */\n\t\t$remote_source = apply_filters( 'pre_remote_source', $remote_source, $pagelinkedto );\n\n\t\t// Work around bug in strip_tags():\n\t\t$remote_source = str_replace( '<!DOC', '<DOC', $remote_source );\n\t\t$remote_source = preg_replace( '/[\\r\\n\\t ]+/', ' ', $remote_source ); // normalize spaces\n\t\t$remote_source = preg_replace( '/<\\/*(h1|h2|h3|h4|h5|h6|p|th|td|li|dt|dd|pre|caption|input|textarea|button|body)[^>]*>/', \"\\n\\n\", $remote_source );\n\n\t\tpreg_match( '|<title>([^<]*?)</title>|is', $remote_source, $matchtitle );\n\t\t$title = isset( $matchtitle[1] ) ? $matchtitle[1] : '';\n\t\tif ( empty( $title ) ) {\n\t\t\treturn $this->pingback_error( 32, __( 'We cannot find a title on that page.' ) );\n\t\t}\n\n\t\t// Remove all script and style tags including their content.\n\t\t$remote_source = preg_replace( '@<(script|style)[^>]*?>.*?</\\\\1>@si', '', $remote_source );\n\t\t// Just keep the tag we need.\n\t\t$remote_source = strip_tags( $remote_source, '<a>' );\n\n\t\t$p = explode( \"\\n\\n\", $remote_source );\n\n\t\t$preg_target = preg_quote( $pagelinkedto, '|' );\n\n\t\tforeach ( $p as $para ) {\n\t\t\tif ( strpos( $para, $pagelinkedto ) !== false ) { // It exists, but is it a link?\n\t\t\t\tpreg_match( '|<a[^>]+?' . $preg_target . '[^>]*>([^>]+?)</a>|', $para, $context );\n\n\t\t\t\t// If the URL isn't in a link context, keep looking.\n\t\t\t\tif ( empty( $context ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// We're going to use this fake tag to mark the context in a bit.\n\t\t\t\t// The marker is needed in case the link text appears more than once in the paragraph.\n\t\t\t\t$excerpt = preg_replace( '|\\</?wpcontext\\>|', '', $para );\n\n\t\t\t\t// prevent really long link text\n\t\t\t\tif ( strlen( $context[1] ) > 100 ) {\n\t\t\t\t\t$context[1] = substr( $context[1], 0, 100 ) . '&#8230;';\n\t\t\t\t}\n\n\t\t\t\t$marker      = '<wpcontext>' . $context[1] . '</wpcontext>';  // Set up our marker.\n\t\t\t\t$excerpt     = str_replace( $context[0], $marker, $excerpt ); // Swap out the link for our marker.\n\t\t\t\t$excerpt     = strip_tags( $excerpt, '<wpcontext>' );         // Strip all tags but our context marker.\n\t\t\t\t$excerpt     = trim( $excerpt );\n\t\t\t\t$preg_marker = preg_quote( $marker, '|' );\n\t\t\t\t$excerpt     = preg_replace( \"|.*?\\s(.{0,100}$preg_marker.{0,100})\\s.*|s\", '$1', $excerpt );\n\t\t\t\t$excerpt     = strip_tags( $excerpt ); // YES, again, to remove the marker wrapper.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $context ) ) { // Link to target not found.\n\t\t\treturn $this->pingback_error( 17, __( 'The source URL does not contain a link to the target URL, and so cannot be used as a source.' ) );\n\t\t}\n\n\t\t$pagelinkedfrom = str_replace( '&', '&amp;', $pagelinkedfrom );\n\n\t\t$context        = '[&#8230;] ' . esc_html( $excerpt ) . ' [&#8230;]';\n\t\t$pagelinkedfrom = $this->escape( $pagelinkedfrom );\n\n\t\t$comment_post_ID      = (int) $post_ID;\n\t\t$comment_author       = $title;\n\t\t$comment_author_email = '';\n\t\t$this->escape( $comment_author );\n\t\t$comment_author_url = $pagelinkedfrom;\n\t\t$comment_content    = $context;\n\t\t$this->escape( $comment_content );\n\t\t$comment_type = 'pingback';\n\n\t\t$commentdata = compact(\n\t\t\t'comment_post_ID',\n\t\t\t'comment_author',\n\t\t\t'comment_author_url',\n\t\t\t'comment_author_email',\n\t\t\t'comment_content',\n\t\t\t'comment_type',\n\t\t\t'remote_source',\n\t\t\t'remote_source_original'\n\t\t);\n\n\t\t$comment_ID = wp_new_comment( $commentdata );\n\n\t\tif ( is_wp_error( $comment_ID ) ) {\n\t\t\treturn $this->pingback_error( 0, $comment_ID->get_error_message() );\n\t\t}\n\n\t\t/**\n\t\t * Fires after a post pingback has been sent.\n\t\t *\n\t\t * @since 0.71\n\t\t *\n\t\t * @param int $comment_ID Comment ID.\n\t\t */\n\t\tdo_action( 'pingback_post', $comment_ID );\n\n\t\t/* translators: 1: URL of the page linked from, 2: URL of the page linked to. */\n\t\treturn sprintf( __( 'Pingback from %1$s to %2$s registered. Keep the web talking! :-)' ), $pagelinkedfrom, $pagelinkedto );\n\t}\n\n\t/**\n\t * Retrieve array of URLs that pingbacked the given URL.\n\t *\n\t * Specs on http://www.aquarionics.com/misc/archives/blogite/0198.html\n\t *\n\t * @since 1.5.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $url\n\t * @return array|IXR_Error\n\t */\n\tpublic function pingback_extensions_getPingbacks( $url ) {\n\t\tglobal $wpdb;\n\n\t\t/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */\n\t\tdo_action( 'xmlrpc_call', 'pingback.extensions.getPingbacks' );\n\n\t\t$url = $this->escape( $url );\n\n\t\t$post_ID = url_to_postid( $url );\n\t\tif ( ! $post_ID ) {\n\t\t\t// We aren't sure that the resource is available and/or pingback enabled.\n\t\t\treturn $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either doesn&#8217;t exist, or it is not a pingback-enabled resource.' ) );\n\t\t}\n\n\t\t$actual_post = get_post( $post_ID, ARRAY_A );\n\n\t\tif ( ! $actual_post ) {\n\t\t\t// No such post = resource not found.\n\t\t\treturn $this->pingback_error( 32, __( 'The specified target URL does not exist.' ) );\n\t\t}\n\n\t\t$comments = $wpdb->get_results( $wpdb->prepare( \"SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d\", $post_ID ) );\n\n\t\tif ( ! $comments ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$pingbacks = array();\n\t\tforeach ( $comments as $comment ) {\n\t\t\tif ( 'pingback' === $comment->comment_type ) {\n\t\t\t\t$pingbacks[] = $comment->comment_author_url;\n\t\t\t}\n\t\t}\n\n\t\treturn $pingbacks;\n\t}\n\n\t/**\n\t * Sends a pingback error based on the given error code and message.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param int    $code    Error code.\n\t * @param string $message Error message.\n\t * @return IXR_Error Error object.\n\t */\n\tprotected function pingback_error( $code, $message ) {\n\t\t/**\n\t\t * Filters the XML-RPC pingback error return.\n\t\t *\n\t\t * @since 3.5.1\n\t\t *\n\t\t * @param IXR_Error $error An IXR_Error object containing the error code and message.\n\t\t */\n\t\treturn apply_filters( 'xmlrpc_pingback_error', new IXR_Error( $code, $message ) );\n\t}\n}\n", "num_lines": 7074}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress environment setup class.\n *\n * @package WordPress\n * @since 2.0.0\n */\nclass WP {\n\t/**\n\t * Public query variables.\n\t *\n\t * Long list of public query variables.\n\t *\n\t * @since 2.0.0\n\t * @var string[]\n\t */\n\tpublic $public_query_vars = array( 'm', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'pagename', 'page_id', 'error', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'favicon', 'taxonomy', 'term', 'cpage', 'post_type', 'embed' );\n\n\t/**\n\t * Private query variables.\n\t *\n\t * Long list of private query variables.\n\t *\n\t * @since 2.0.0\n\t * @var string[]\n\t */\n\tpublic $private_query_vars = array( 'offset', 'posts_per_page', 'posts_per_archive_page', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page', 'post__in', 'post__not_in', 'post_parent', 'post_parent__in', 'post_parent__not_in', 'title', 'fields' );\n\n\t/**\n\t * Extra query variables set by the user.\n\t *\n\t * @since 2.1.0\n\t * @var array\n\t */\n\tpublic $extra_query_vars = array();\n\n\t/**\n\t * Query variables for setting up the WordPress Query Loop.\n\t *\n\t * @since 2.0.0\n\t * @var array\n\t */\n\tpublic $query_vars;\n\n\t/**\n\t * String parsed to set the query variables.\n\t *\n\t * @since 2.0.0\n\t * @var string\n\t */\n\tpublic $query_string;\n\n\t/**\n\t * The request path, e.g. 2015/05/06.\n\t *\n\t * @since 2.0.0\n\t * @var string\n\t */\n\tpublic $request;\n\n\t/**\n\t * Rewrite rule the request matched.\n\t *\n\t * @since 2.0.0\n\t * @var string\n\t */\n\tpublic $matched_rule;\n\n\t/**\n\t * Rewrite query the request matched.\n\t *\n\t * @since 2.0.0\n\t * @var string\n\t */\n\tpublic $matched_query;\n\n\t/**\n\t * Whether already did the permalink.\n\t *\n\t * @since 2.0.0\n\t * @var bool\n\t */\n\tpublic $did_permalink = false;\n\n\t/**\n\t * Add name to list of public query variables.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $qv Query variable name.\n\t */\n\tpublic function add_query_var( $qv ) {\n\t\tif ( ! in_array( $qv, $this->public_query_vars, true ) ) {\n\t\t\t$this->public_query_vars[] = $qv;\n\t\t}\n\t}\n\n\t/**\n\t * Removes a query variable from a list of public query variables.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param string $name Query variable name.\n\t */\n\tpublic function remove_query_var( $name ) {\n\t\t$this->public_query_vars = array_diff( $this->public_query_vars, array( $name ) );\n\t}\n\n\t/**\n\t * Set the value of a query variable.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string $key   Query variable name.\n\t * @param mixed  $value Query variable value.\n\t */\n\tpublic function set_query_var( $key, $value ) {\n\t\t$this->query_vars[ $key ] = $value;\n\t}\n\n\t/**\n\t * Parse request to find correct WordPress query.\n\t *\n\t * Sets up the query variables based on the request. There are also many\n\t * filters and actions that can be used to further manipulate the result.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n\t *\n\t * @param array|string $extra_query_vars Set the extra query variables.\n\t */\n\tpublic function parse_request( $extra_query_vars = '' ) {\n\t\tglobal $wp_rewrite;\n\n\t\t/**\n\t\t * Filters whether to parse the request.\n\t\t *\n\t\t * @since 3.5.0\n\t\t *\n\t\t * @param bool         $bool             Whether or not to parse the request. Default true.\n\t\t * @param WP           $this             Current WordPress environment instance.\n\t\t * @param array|string $extra_query_vars Extra passed query variables.\n\t\t */\n\t\tif ( ! apply_filters( 'do_parse_request', true, $this, $extra_query_vars ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->query_vars     = array();\n\t\t$post_type_query_vars = array();\n\n\t\tif ( is_array( $extra_query_vars ) ) {\n\t\t\t$this->extra_query_vars = & $extra_query_vars;\n\t\t} elseif ( ! empty( $extra_query_vars ) ) {\n\t\t\tparse_str( $extra_query_vars, $this->extra_query_vars );\n\t\t}\n\t\t// Process PATH_INFO, REQUEST_URI, and 404 for permalinks.\n\n\t\t// Fetch the rewrite rules.\n\t\t$rewrite = $wp_rewrite->wp_rewrite_rules();\n\n\t\tif ( ! empty( $rewrite ) ) {\n\t\t\t// If we match a rewrite rule, this will be cleared.\n\t\t\t$error               = '404';\n\t\t\t$this->did_permalink = true;\n\n\t\t\t$pathinfo         = isset( $_SERVER['PATH_INFO'] ) ? $_SERVER['PATH_INFO'] : '';\n\t\t\tlist( $pathinfo ) = explode( '?', $pathinfo );\n\t\t\t$pathinfo         = str_replace( '%', '%25', $pathinfo );\n\n\t\t\tlist( $req_uri ) = explode( '?', $_SERVER['REQUEST_URI'] );\n\t\t\t$self            = $_SERVER['PHP_SELF'];\n\t\t\t$home_path       = trim( parse_url( home_url(), PHP_URL_PATH ), '/' );\n\t\t\t$home_path_regex = sprintf( '|^%s|i', preg_quote( $home_path, '|' ) );\n\n\t\t\t/*\n\t\t\t * Trim path info from the end and the leading home path from the front.\n\t\t\t * For path info requests, this leaves us with the requesting filename, if any.\n\t\t\t * For 404 requests, this leaves us with the requested permalink.\n\t\t\t */\n\t\t\t$req_uri  = str_replace( $pathinfo, '', $req_uri );\n\t\t\t$req_uri  = trim( $req_uri, '/' );\n\t\t\t$req_uri  = preg_replace( $home_path_regex, '', $req_uri );\n\t\t\t$req_uri  = trim( $req_uri, '/' );\n\t\t\t$pathinfo = trim( $pathinfo, '/' );\n\t\t\t$pathinfo = preg_replace( $home_path_regex, '', $pathinfo );\n\t\t\t$pathinfo = trim( $pathinfo, '/' );\n\t\t\t$self     = trim( $self, '/' );\n\t\t\t$self     = preg_replace( $home_path_regex, '', $self );\n\t\t\t$self     = trim( $self, '/' );\n\n\t\t\t// The requested permalink is in $pathinfo for path info requests and\n\t\t\t// $req_uri for other requests.\n\t\t\tif ( ! empty( $pathinfo ) && ! preg_match( '|^.*' . $wp_rewrite->index . '$|', $pathinfo ) ) {\n\t\t\t\t$requested_path = $pathinfo;\n\t\t\t} else {\n\t\t\t\t// If the request uri is the index, blank it out so that we don't try to match it against a rule.\n\t\t\t\tif ( $req_uri == $wp_rewrite->index ) {\n\t\t\t\t\t$req_uri = '';\n\t\t\t\t}\n\t\t\t\t$requested_path = $req_uri;\n\t\t\t}\n\t\t\t$requested_file = $req_uri;\n\n\t\t\t$this->request = $requested_path;\n\n\t\t\t// Look for matches.\n\t\t\t$request_match = $requested_path;\n\t\t\tif ( empty( $request_match ) ) {\n\t\t\t\t// An empty request could only match against ^$ regex.\n\t\t\t\tif ( isset( $rewrite['$'] ) ) {\n\t\t\t\t\t$this->matched_rule = '$';\n\t\t\t\t\t$query              = $rewrite['$'];\n\t\t\t\t\t$matches            = array( '' );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tforeach ( (array) $rewrite as $match => $query ) {\n\t\t\t\t\t// If the requested file is the anchor of the match, prepend it to the path info.\n\t\t\t\t\tif ( ! empty( $requested_file ) && strpos( $match, $requested_file ) === 0 && $requested_file != $requested_path ) {\n\t\t\t\t\t\t$request_match = $requested_file . '/' . $requested_path;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( preg_match( \"#^$match#\", $request_match, $matches ) ||\n\t\t\t\t\t\tpreg_match( \"#^$match#\", urldecode( $request_match ), $matches ) ) {\n\n\t\t\t\t\t\tif ( $wp_rewrite->use_verbose_page_rules && preg_match( '/pagename=\\$matches\\[([0-9]+)\\]/', $query, $varmatch ) ) {\n\t\t\t\t\t\t\t// This is a verbose page match, let's check to be sure about it.\n\t\t\t\t\t\t\t$page = get_page_by_path( $matches[ $varmatch[1] ] );\n\t\t\t\t\t\t\tif ( ! $page ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$post_status_obj = get_post_status_object( $page->post_status );\n\t\t\t\t\t\t\tif ( ! $post_status_obj->public && ! $post_status_obj->protected\n\t\t\t\t\t\t\t\t&& ! $post_status_obj->private && $post_status_obj->exclude_from_search ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Got a match.\n\t\t\t\t\t\t$this->matched_rule = $match;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( isset( $this->matched_rule ) ) {\n\t\t\t\t// Trim the query of everything up to the '?'.\n\t\t\t\t$query = preg_replace( '!^.+\\?!', '', $query );\n\n\t\t\t\t// Substitute the substring matches into the query.\n\t\t\t\t$query = addslashes( WP_MatchesMapRegex::apply( $query, $matches ) );\n\n\t\t\t\t$this->matched_query = $query;\n\n\t\t\t\t// Parse the query.\n\t\t\t\tparse_str( $query, $perma_query_vars );\n\n\t\t\t\t// If we're processing a 404 request, clear the error var since we found something.\n\t\t\t\tif ( '404' == $error ) {\n\t\t\t\t\tunset( $error, $_GET['error'] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If req_uri is empty or if it is a request for ourself, unset error.\n\t\t\tif ( empty( $requested_path ) || $requested_file == $self || strpos( $_SERVER['PHP_SELF'], 'wp-admin/' ) !== false ) {\n\t\t\t\tunset( $error, $_GET['error'] );\n\n\t\t\t\tif ( isset( $perma_query_vars ) && strpos( $_SERVER['PHP_SELF'], 'wp-admin/' ) !== false ) {\n\t\t\t\t\tunset( $perma_query_vars );\n\t\t\t\t}\n\n\t\t\t\t$this->did_permalink = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the query variables allowed before processing.\n\t\t *\n\t\t * Allows (publicly allowed) query vars to be added, removed, or changed prior\n\t\t * to executing the query. Needed to allow custom rewrite rules using your own arguments\n\t\t * to work, or any other custom query variables you want to be publicly available.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param string[] $public_query_vars The array of allowed query variable names.\n\t\t */\n\t\t$this->public_query_vars = apply_filters( 'query_vars', $this->public_query_vars );\n\n\t\tforeach ( get_post_types( array(), 'objects' ) as $post_type => $t ) {\n\t\t\tif ( is_post_type_viewable( $t ) && $t->query_var ) {\n\t\t\t\t$post_type_query_vars[ $t->query_var ] = $post_type;\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $this->public_query_vars as $wpvar ) {\n\t\t\tif ( isset( $this->extra_query_vars[ $wpvar ] ) ) {\n\t\t\t\t$this->query_vars[ $wpvar ] = $this->extra_query_vars[ $wpvar ];\n\t\t\t} elseif ( isset( $_GET[ $wpvar ] ) && isset( $_POST[ $wpvar ] ) && $_GET[ $wpvar ] !== $_POST[ $wpvar ] ) {\n\t\t\t\twp_die( __( 'A variable mismatch has been detected.' ), __( 'Sorry, you are not allowed to view this item.' ), 400 );\n\t\t\t} elseif ( isset( $_POST[ $wpvar ] ) ) {\n\t\t\t\t$this->query_vars[ $wpvar ] = $_POST[ $wpvar ];\n\t\t\t} elseif ( isset( $_GET[ $wpvar ] ) ) {\n\t\t\t\t$this->query_vars[ $wpvar ] = $_GET[ $wpvar ];\n\t\t\t} elseif ( isset( $perma_query_vars[ $wpvar ] ) ) {\n\t\t\t\t$this->query_vars[ $wpvar ] = $perma_query_vars[ $wpvar ];\n\t\t\t}\n\n\t\t\tif ( ! empty( $this->query_vars[ $wpvar ] ) ) {\n\t\t\t\tif ( ! is_array( $this->query_vars[ $wpvar ] ) ) {\n\t\t\t\t\t$this->query_vars[ $wpvar ] = (string) $this->query_vars[ $wpvar ];\n\t\t\t\t} else {\n\t\t\t\t\tforeach ( $this->query_vars[ $wpvar ] as $vkey => $v ) {\n\t\t\t\t\t\tif ( is_scalar( $v ) ) {\n\t\t\t\t\t\t\t$this->query_vars[ $wpvar ][ $vkey ] = (string) $v;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( isset( $post_type_query_vars[ $wpvar ] ) ) {\n\t\t\t\t\t$this->query_vars['post_type'] = $post_type_query_vars[ $wpvar ];\n\t\t\t\t\t$this->query_vars['name']      = $this->query_vars[ $wpvar ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Convert urldecoded spaces back into '+'.\n\t\tforeach ( get_taxonomies( array(), 'objects' ) as $taxonomy => $t ) {\n\t\t\tif ( $t->query_var && isset( $this->query_vars[ $t->query_var ] ) ) {\n\t\t\t\t$this->query_vars[ $t->query_var ] = str_replace( ' ', '+', $this->query_vars[ $t->query_var ] );\n\t\t\t}\n\t\t}\n\n\t\t// Don't allow non-publicly queryable taxonomies to be queried from the front end.\n\t\tif ( ! is_admin() ) {\n\t\t\tforeach ( get_taxonomies( array( 'publicly_queryable' => false ), 'objects' ) as $taxonomy => $t ) {\n\t\t\t\t/*\n\t\t\t\t * Disallow when set to the 'taxonomy' query var.\n\t\t\t\t * Non-publicly queryable taxonomies cannot register custom query vars. See register_taxonomy().\n\t\t\t\t */\n\t\t\t\tif ( isset( $this->query_vars['taxonomy'] ) && $taxonomy === $this->query_vars['taxonomy'] ) {\n\t\t\t\t\tunset( $this->query_vars['taxonomy'], $this->query_vars['term'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Limit publicly queried post_types to those that are 'publicly_queryable'.\n\t\tif ( isset( $this->query_vars['post_type'] ) ) {\n\t\t\t$queryable_post_types = get_post_types( array( 'publicly_queryable' => true ) );\n\t\t\tif ( ! is_array( $this->query_vars['post_type'] ) ) {\n\t\t\t\tif ( ! in_array( $this->query_vars['post_type'], $queryable_post_types, true ) ) {\n\t\t\t\t\tunset( $this->query_vars['post_type'] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->query_vars['post_type'] = array_intersect( $this->query_vars['post_type'], $queryable_post_types );\n\t\t\t}\n\t\t}\n\n\t\t// Resolve conflicts between posts with numeric slugs and date archive queries.\n\t\t$this->query_vars = wp_resolve_numeric_slug_conflicts( $this->query_vars );\n\n\t\tforeach ( (array) $this->private_query_vars as $var ) {\n\t\t\tif ( isset( $this->extra_query_vars[ $var ] ) ) {\n\t\t\t\t$this->query_vars[ $var ] = $this->extra_query_vars[ $var ];\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $error ) ) {\n\t\t\t$this->query_vars['error'] = $error;\n\t\t}\n\n\t\t/**\n\t\t * Filters the array of parsed query variables.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param array $query_vars The array of requested query variables.\n\t\t */\n\t\t$this->query_vars = apply_filters( 'request', $this->query_vars );\n\n\t\t/**\n\t\t * Fires once all query variables for the current request have been parsed.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param WP $this Current WordPress environment instance (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'parse_request', array( &$this ) );\n\t}\n\n\t/**\n\t * Sends additional HTTP headers for caching, content type, etc.\n\t *\n\t * Sets the Content-Type header. Sets the 'error' status (if passed) and optionally exits.\n\t * If showing a feed, it will also send Last-Modified, ETag, and 304 status if needed.\n\t *\n\t * @since 2.0.0\n\t * @since 4.4.0 `X-Pingback` header is added conditionally after posts have been queried in handle_404().\n\t */\n\tpublic function send_headers() {\n\t\t$headers       = array();\n\t\t$status        = null;\n\t\t$exit_required = false;\n\n\t\tif ( is_user_logged_in() ) {\n\t\t\t$headers = array_merge( $headers, wp_get_nocache_headers() );\n\t\t} elseif ( ! empty( $_GET['unapproved'] ) && ! empty( $_GET['moderation-hash'] ) ) {\n\t\t\t// Unmoderated comments are only visible for one minute via the moderation hash.\n\t\t\t$headers['Expires']       = gmdate( 'D, d M Y H:i:s', time() + MINUTE_IN_SECONDS );\n\t\t\t$headers['Cache-Control'] = 'max-age=60, must-revalidate';\n\t\t}\n\t\tif ( ! empty( $this->query_vars['error'] ) ) {\n\t\t\t$status = (int) $this->query_vars['error'];\n\t\t\tif ( 404 === $status ) {\n\t\t\t\tif ( ! is_user_logged_in() ) {\n\t\t\t\t\t$headers = array_merge( $headers, wp_get_nocache_headers() );\n\t\t\t\t}\n\t\t\t\t$headers['Content-Type'] = get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' );\n\t\t\t} elseif ( in_array( $status, array( 403, 500, 502, 503 ), true ) ) {\n\t\t\t\t$exit_required = true;\n\t\t\t}\n\t\t} elseif ( empty( $this->query_vars['feed'] ) ) {\n\t\t\t$headers['Content-Type'] = get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' );\n\t\t} else {\n\t\t\t// Set the correct content type for feeds.\n\t\t\t$type = $this->query_vars['feed'];\n\t\t\tif ( 'feed' === $this->query_vars['feed'] ) {\n\t\t\t\t$type = get_default_feed();\n\t\t\t}\n\t\t\t$headers['Content-Type'] = feed_content_type( $type ) . '; charset=' . get_option( 'blog_charset' );\n\n\t\t\t// We're showing a feed, so WP is indeed the only thing that last changed.\n\t\t\tif ( ! empty( $this->query_vars['withcomments'] )\n\t\t\t\t|| false !== strpos( $this->query_vars['feed'], 'comments-' )\n\t\t\t\t|| ( empty( $this->query_vars['withoutcomments'] )\n\t\t\t\t\t&& ( ! empty( $this->query_vars['p'] )\n\t\t\t\t\t\t|| ! empty( $this->query_vars['name'] )\n\t\t\t\t\t\t|| ! empty( $this->query_vars['page_id'] )\n\t\t\t\t\t\t|| ! empty( $this->query_vars['pagename'] )\n\t\t\t\t\t\t|| ! empty( $this->query_vars['attachment'] )\n\t\t\t\t\t\t|| ! empty( $this->query_vars['attachment_id'] )\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t$wp_last_modified = mysql2date( 'D, d M Y H:i:s', get_lastcommentmodified( 'GMT' ), false );\n\t\t\t} else {\n\t\t\t\t$wp_last_modified = mysql2date( 'D, d M Y H:i:s', get_lastpostmodified( 'GMT' ), false );\n\t\t\t}\n\n\t\t\tif ( ! $wp_last_modified ) {\n\t\t\t\t$wp_last_modified = gmdate( 'D, d M Y H:i:s' );\n\t\t\t}\n\n\t\t\t$wp_last_modified .= ' GMT';\n\n\t\t\t$wp_etag                  = '\"' . md5( $wp_last_modified ) . '\"';\n\t\t\t$headers['Last-Modified'] = $wp_last_modified;\n\t\t\t$headers['ETag']          = $wp_etag;\n\n\t\t\t// Support for conditional GET.\n\t\t\tif ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ) {\n\t\t\t\t$client_etag = wp_unslash( $_SERVER['HTTP_IF_NONE_MATCH'] );\n\t\t\t} else {\n\t\t\t\t$client_etag = false;\n\t\t\t}\n\n\t\t\t$client_last_modified = empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ? '' : trim( $_SERVER['HTTP_IF_MODIFIED_SINCE'] );\n\t\t\t// If string is empty, return 0. If not, attempt to parse into a timestamp.\n\t\t\t$client_modified_timestamp = $client_last_modified ? strtotime( $client_last_modified ) : 0;\n\n\t\t\t// Make a timestamp for our most recent modification..\n\t\t\t$wp_modified_timestamp = strtotime( $wp_last_modified );\n\n\t\t\tif ( ( $client_last_modified && $client_etag ) ?\n\t\t\t\t\t( ( $client_modified_timestamp >= $wp_modified_timestamp ) && ( $client_etag == $wp_etag ) ) :\n\t\t\t\t\t( ( $client_modified_timestamp >= $wp_modified_timestamp ) || ( $client_etag == $wp_etag ) ) ) {\n\t\t\t\t$status        = 304;\n\t\t\t\t$exit_required = true;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the HTTP headers before they're sent to the browser.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string[] $headers Associative array of headers to be sent.\n\t\t * @param WP       $this    Current WordPress environment instance.\n\t\t */\n\t\t$headers = apply_filters( 'wp_headers', $headers, $this );\n\n\t\tif ( ! empty( $status ) ) {\n\t\t\tstatus_header( $status );\n\t\t}\n\n\t\t// If Last-Modified is set to false, it should not be sent (no-cache situation).\n\t\tif ( isset( $headers['Last-Modified'] ) && false === $headers['Last-Modified'] ) {\n\t\t\tunset( $headers['Last-Modified'] );\n\n\t\t\tif ( ! headers_sent() ) {\n\t\t\t\theader_remove( 'Last-Modified' );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! headers_sent() ) {\n\t\t\tforeach ( (array) $headers as $name => $field_value ) {\n\t\t\t\theader( \"{$name}: {$field_value}\" );\n\t\t\t}\n\t\t}\n\n\t\tif ( $exit_required ) {\n\t\t\texit;\n\t\t}\n\n\t\t/**\n\t\t * Fires once the requested HTTP headers for caching, content type, etc. have been sent.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param WP $this Current WordPress environment instance (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'send_headers', array( &$this ) );\n\t}\n\n\t/**\n\t * Sets the query string property based off of the query variable property.\n\t *\n\t * The {@see 'query_string'} filter is deprecated, but still works. Plugins should\n\t * use the {@see 'request'} filter instead.\n\t *\n\t * @since 2.0.0\n\t */\n\tpublic function build_query_string() {\n\t\t$this->query_string = '';\n\t\tforeach ( (array) array_keys( $this->query_vars ) as $wpvar ) {\n\t\t\tif ( '' != $this->query_vars[ $wpvar ] ) {\n\t\t\t\t$this->query_string .= ( strlen( $this->query_string ) < 1 ) ? '' : '&';\n\t\t\t\tif ( ! is_scalar( $this->query_vars[ $wpvar ] ) ) { // Discard non-scalars.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$this->query_string .= $wpvar . '=' . rawurlencode( $this->query_vars[ $wpvar ] );\n\t\t\t}\n\t\t}\n\n\t\tif ( has_filter( 'query_string' ) ) {  // Don't bother filtering and parsing if no plugins are hooked in.\n\t\t\t/**\n\t\t\t * Filters the query string before parsing.\n\t\t\t *\n\t\t\t * @since 1.5.0\n\t\t\t * @deprecated 2.1.0 Use {@see 'query_vars'} or {@see 'request'} filters instead.\n\t\t\t *\n\t\t\t * @param string $query_string The query string to modify.\n\t\t\t */\n\t\t\t$this->query_string = apply_filters_deprecated(\n\t\t\t\t'query_string',\n\t\t\t\tarray( $this->query_string ),\n\t\t\t\t'2.1.0',\n\t\t\t\t'query_vars, request'\n\t\t\t);\n\t\t\tparse_str( $this->query_string, $this->query_vars );\n\t\t}\n\t}\n\n\t/**\n\t * Set up the WordPress Globals.\n\t *\n\t * The query_vars property will be extracted to the GLOBALS. So care should\n\t * be taken when naming global variables that might interfere with the\n\t * WordPress environment.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @global WP_Query     $wp_query     WordPress Query object.\n\t * @global string       $query_string Query string for the loop.\n\t * @global array        $posts        The found posts.\n\t * @global WP_Post|null $post         The current post, if available.\n\t * @global string       $request      The SQL statement for the request.\n\t * @global int          $more         Only set, if single page or post.\n\t * @global int          $single       If single page or post. Only set, if single page or post.\n\t * @global WP_User      $authordata   Only set, if author archive.\n\t */\n\tpublic function register_globals() {\n\t\tglobal $wp_query;\n\n\t\t// Extract updated query vars back into global namespace.\n\t\tforeach ( (array) $wp_query->query_vars as $key => $value ) {\n\t\t\t$GLOBALS[ $key ] = $value;\n\t\t}\n\n\t\t$GLOBALS['query_string'] = $this->query_string;\n\t\t$GLOBALS['posts']        = & $wp_query->posts;\n\t\t$GLOBALS['post']         = isset( $wp_query->post ) ? $wp_query->post : null;\n\t\t$GLOBALS['request']      = $wp_query->request;\n\n\t\tif ( $wp_query->is_single() || $wp_query->is_page() ) {\n\t\t\t$GLOBALS['more']   = 1;\n\t\t\t$GLOBALS['single'] = 1;\n\t\t}\n\n\t\tif ( $wp_query->is_author() && isset( $wp_query->post ) ) {\n\t\t\t$GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author );\n\t\t}\n\t}\n\n\t/**\n\t * Set up the current user.\n\t *\n\t * @since 2.0.0\n\t */\n\tpublic function init() {\n\t\twp_get_current_user();\n\t}\n\n\t/**\n\t * Set up the Loop based on the query variables.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @global WP_Query $wp_the_query WordPress Query object.\n\t */\n\tpublic function query_posts() {\n\t\tglobal $wp_the_query;\n\t\t$this->build_query_string();\n\t\t$wp_the_query->query( $this->query_vars );\n\t}\n\n\t/**\n\t * Set the Headers for 404, if nothing is found for requested URL.\n\t *\n\t * Issue a 404 if a request doesn't match any posts and doesn't match any object\n\t * (e.g. an existing-but-empty category, tag, author) and a 404 was not already issued,\n\t * and if the request was not a search or the homepage.\n\t *\n\t * Otherwise, issue a 200.\n\t *\n\t * This sets headers after posts have been queried. handle_404() really means \"handle status\".\n\t * By inspecting the result of querying posts, seemingly successful requests can be switched to\n\t * a 404 so that canonical redirection logic can kick in.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @global WP_Query $wp_query WordPress Query object.\n\t */\n\tpublic function handle_404() {\n\t\tglobal $wp_query;\n\n\t\t/**\n\t\t * Filters whether to short-circuit default header status handling.\n\t\t *\n\t\t * Returning a non-false value from the filter will short-circuit the handling\n\t\t * and return early.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @param bool     $preempt  Whether to short-circuit default header status handling. Default false.\n\t\t * @param WP_Query $wp_query WordPress Query object.\n\t\t */\n\t\tif ( false !== apply_filters( 'pre_handle_404', false, $wp_query ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If we've already issued a 404, bail.\n\t\tif ( is_404() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$set_404 = true;\n\n\t\t// Never 404 for the admin, robots, or favicon.\n\t\tif ( is_admin() || is_robots() || is_favicon() ) {\n\t\t\t$set_404 = false;\n\n\t\t\t// If posts were found, check for paged content.\n\t\t} elseif ( $wp_query->posts ) {\n\t\t\t$content_found = true;\n\n\t\t\tif ( is_singular() ) {\n\t\t\t\t$post = isset( $wp_query->post ) ? $wp_query->post : null;\n\n\t\t\t\t// Only set X-Pingback for single posts that allow pings.\n\t\t\t\tif ( $post && pings_open( $post ) && ! headers_sent() ) {\n\t\t\t\t\theader( 'X-Pingback: ' . get_bloginfo( 'pingback_url', 'display' ) );\n\t\t\t\t}\n\n\t\t\t\t// Check for paged content that exceeds the max number of pages.\n\t\t\t\t$next = '<!--nextpage-->';\n\t\t\t\tif ( $post && ! empty( $this->query_vars['page'] ) ) {\n\t\t\t\t\t// Check if content is actually intended to be paged.\n\t\t\t\t\tif ( false !== strpos( $post->post_content, $next ) ) {\n\t\t\t\t\t\t$page          = trim( $this->query_vars['page'], '/' );\n\t\t\t\t\t\t$content_found = (int) $page <= ( substr_count( $post->post_content, $next ) + 1 );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$content_found = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// The posts page does not support the <!--nextpage--> pagination.\n\t\t\tif ( $wp_query->is_posts_page && ! empty( $this->query_vars['page'] ) ) {\n\t\t\t\t$content_found = false;\n\t\t\t}\n\n\t\t\tif ( $content_found ) {\n\t\t\t\t$set_404 = false;\n\t\t\t}\n\n\t\t\t// We will 404 for paged queries, as no posts were found.\n\t\t} elseif ( ! is_paged() ) {\n\t\t\t$author = get_query_var( 'author' );\n\n\t\t\t// Don't 404 for authors without posts as long as they matched an author on this site.\n\t\t\tif ( is_author() && is_numeric( $author ) && $author > 0 && is_user_member_of_blog( $author )\n\t\t\t\t// Don't 404 for these queries if they matched an object.\n\t\t\t\t|| ( is_tag() || is_category() || is_tax() || is_post_type_archive() ) && get_queried_object()\n\t\t\t\t// Don't 404 for these queries either.\n\t\t\t\t|| is_home() || is_search() || is_feed()\n\t\t\t) {\n\t\t\t\t$set_404 = false;\n\t\t\t}\n\t\t}\n\n\t\tif ( $set_404 ) {\n\t\t\t// Guess it's time to 404.\n\t\t\t$wp_query->set_404();\n\t\t\tstatus_header( 404 );\n\t\t\tnocache_headers();\n\t\t} else {\n\t\t\tstatus_header( 200 );\n\t\t}\n\t}\n\n\t/**\n\t * Sets up all of the variables required by the WordPress environment.\n\t *\n\t * The action {@see 'wp'} has one parameter that references the WP object. It\n\t * allows for accessing the properties and methods to further manipulate the\n\t * object.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string|array $query_args Passed to parse_request().\n\t */\n\tpublic function main( $query_args = '' ) {\n\t\t$this->init();\n\t\t$this->parse_request( $query_args );\n\t\t$this->send_headers();\n\t\t$this->query_posts();\n\t\t$this->handle_404();\n\t\t$this->register_globals();\n\n\t\t/**\n\t\t * Fires once the WordPress environment has been set up.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param WP $this Current WordPress environment instance (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'wp', array( &$this ) );\n\t}\n}\n", "num_lines": 761}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Dependencies API: WP_Dependencies base class\n *\n * @since 2.6.0\n *\n * @package WordPress\n * @subpackage Dependencies\n */\n\n/**\n * Core base class extended to register items.\n *\n * @since 2.6.0\n *\n * @see _WP_Dependency\n */\nclass WP_Dependencies {\n\t/**\n\t * An array of registered handle objects.\n\t *\n\t * @since 2.6.8\n\t * @var array\n\t */\n\tpublic $registered = array();\n\n\t/**\n\t * An array of handles of queued objects.\n\t *\n\t * @since 2.6.8\n\t * @var string[]\n\t */\n\tpublic $queue = array();\n\n\t/**\n\t * An array of handles of objects to queue.\n\t *\n\t * @since 2.6.0\n\t * @var string[]\n\t */\n\tpublic $to_do = array();\n\n\t/**\n\t * An array of handles of objects already queued.\n\t *\n\t * @since 2.6.0\n\t * @var string[]\n\t */\n\tpublic $done = array();\n\n\t/**\n\t * An array of additional arguments passed when a handle is registered.\n\t *\n\t * Arguments are appended to the item query string.\n\t *\n\t * @since 2.6.0\n\t * @var array\n\t */\n\tpublic $args = array();\n\n\t/**\n\t * An array of handle groups to enqueue.\n\t *\n\t * @since 2.8.0\n\t * @var array\n\t */\n\tpublic $groups = array();\n\n\t/**\n\t * A handle group to enqueue.\n\t *\n\t * @since 2.8.0\n\t * @deprecated 4.5.0\n\t * @var int\n\t */\n\tpublic $group = 0;\n\n\t/**\n\t * Cached lookup array of flattened queued items and dependencies.\n\t *\n\t * @since 5.4.0\n\t * @var array\n\t */\n\tprivate $all_queued_deps;\n\n\t/**\n\t * Processes the items and dependencies.\n\t *\n\t * Processes the items passed to it or the queue, and their dependencies.\n\t *\n\t * @since 2.6.0\n\t * @since 2.8.0 Added the `$group` parameter.\n\t *\n\t * @param string|string[]|false $handles Optional. Items to be processed: queue (false),\n\t *                                       single item (string), or multiple items (array of strings).\n\t *                                       Default false.\n\t * @param int|false             $group   Optional. Group level: level (int), no groups (false).\n\t * @return string[] Array of handles of items that have been processed.\n\t */\n\tpublic function do_items( $handles = false, $group = false ) {\n\t\t/*\n\t\t * If nothing is passed, print the queue. If a string is passed,\n\t\t * print that item. If an array is passed, print those items.\n\t\t */\n\t\t$handles = false === $handles ? $this->queue : (array) $handles;\n\t\t$this->all_deps( $handles );\n\n\t\tforeach ( $this->to_do as $key => $handle ) {\n\t\t\tif ( ! in_array( $handle, $this->done, true ) && isset( $this->registered[ $handle ] ) ) {\n\t\t\t\t/*\n\t\t\t\t * Attempt to process the item. If successful,\n\t\t\t\t * add the handle to the done array.\n\t\t\t\t *\n\t\t\t\t * Unset the item from the to_do array.\n\t\t\t\t */\n\t\t\t\tif ( $this->do_item( $handle, $group ) ) {\n\t\t\t\t\t$this->done[] = $handle;\n\t\t\t\t}\n\n\t\t\t\tunset( $this->to_do[ $key ] );\n\t\t\t}\n\t\t}\n\n\t\treturn $this->done;\n\t}\n\n\t/**\n\t * Processes a dependency.\n\t *\n\t * @since 2.6.0\n\t * @since 5.5.0 Added the `$group` parameter.\n\t *\n\t * @param string    $handle Name of the item. Should be unique.\n\t * @param int|false $group  Optional. Group level: level (int), no groups (false).\n\t *                          Default false.\n\t * @return bool True on success, false if not set.\n\t */\n\tpublic function do_item( $handle, $group = false ) {\n\t\treturn isset( $this->registered[ $handle ] );\n\t}\n\n\t/**\n\t * Determines dependencies.\n\t *\n\t * Recursively builds an array of items to process taking\n\t * dependencies into account. Does NOT catch infinite loops.\n\t *\n\t * @since 2.1.0\n\t * @since 2.6.0 Moved from `WP_Scripts`.\n\t * @since 2.8.0 Added the `$group` parameter.\n\t *\n\t * @param string|string[] $handles   Item handle (string) or item handles (array of strings).\n\t * @param bool            $recursion Optional. Internal flag that function is calling itself.\n\t *                                   Default false.\n\t * @param int|false       $group     Optional. Group level: level (int), no groups (false).\n\t *                                   Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function all_deps( $handles, $recursion = false, $group = false ) {\n\t\t$handles = (array) $handles;\n\t\tif ( ! $handles ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ( $handles as $handle ) {\n\t\t\t$handle_parts = explode( '?', $handle );\n\t\t\t$handle       = $handle_parts[0];\n\t\t\t$queued       = in_array( $handle, $this->to_do, true );\n\n\t\t\tif ( in_array( $handle, $this->done, true ) ) { // Already done.\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$moved     = $this->set_group( $handle, $recursion, $group );\n\t\t\t$new_group = $this->groups[ $handle ];\n\n\t\t\tif ( $queued && ! $moved ) { // Already queued and in the right group.\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$keep_going = true;\n\t\t\tif ( ! isset( $this->registered[ $handle ] ) ) {\n\t\t\t\t$keep_going = false; // Item doesn't exist.\n\t\t\t} elseif ( $this->registered[ $handle ]->deps && array_diff( $this->registered[ $handle ]->deps, array_keys( $this->registered ) ) ) {\n\t\t\t\t$keep_going = false; // Item requires dependencies that don't exist.\n\t\t\t} elseif ( $this->registered[ $handle ]->deps && ! $this->all_deps( $this->registered[ $handle ]->deps, true, $new_group ) ) {\n\t\t\t\t$keep_going = false; // Item requires dependencies that don't exist.\n\t\t\t}\n\n\t\t\tif ( ! $keep_going ) { // Either item or its dependencies don't exist.\n\t\t\t\tif ( $recursion ) {\n\t\t\t\t\treturn false; // Abort this branch.\n\t\t\t\t} else {\n\t\t\t\t\tcontinue; // We're at the top level. Move on to the next one.\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $queued ) { // Already grabbed it and its dependencies.\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( isset( $handle_parts[1] ) ) {\n\t\t\t\t$this->args[ $handle ] = $handle_parts[1];\n\t\t\t}\n\n\t\t\t$this->to_do[] = $handle;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Register an item.\n\t *\n\t * Registers the item if no item of that name already exists.\n\t *\n\t * @since 2.1.0\n\t * @since 2.6.0 Moved from `WP_Scripts`.\n\t *\n\t * @param string           $handle Name of the item. Should be unique.\n\t * @param string|bool      $src    Full URL of the item, or path of the item relative\n\t *                                 to the WordPress root directory. If source is set to false,\n\t *                                 item is an alias of other items it depends on.\n\t * @param string[]         $deps   Optional. An array of registered item handles this item depends on.\n\t *                                 Default empty array.\n\t * @param string|bool|null $ver    Optional. String specifying item version number, if it has one,\n\t *                                 which is added to the URL as a query string for cache busting purposes.\n\t *                                 If version is set to false, a version number is automatically added\n\t *                                 equal to current installed WordPress version.\n\t *                                 If set to null, no version is added.\n\t * @param mixed            $args   Optional. Custom property of the item. NOT the class property $args.\n\t *                                 Examples: $media, $in_footer.\n\t * @return bool Whether the item has been registered. True on success, false on failure.\n\t */\n\tpublic function add( $handle, $src, $deps = array(), $ver = false, $args = null ) {\n\t\tif ( isset( $this->registered[ $handle ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t$this->registered[ $handle ] = new _WP_Dependency( $handle, $src, $deps, $ver, $args );\n\t\treturn true;\n\t}\n\n\t/**\n\t * Add extra item data.\n\t *\n\t * Adds data to a registered item.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param string $handle Name of the item. Should be unique.\n\t * @param string $key    The data key.\n\t * @param mixed  $value  The data value.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function add_data( $handle, $key, $value ) {\n\t\tif ( ! isset( $this->registered[ $handle ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->registered[ $handle ]->add_data( $key, $value );\n\t}\n\n\t/**\n\t * Get extra item data.\n\t *\n\t * Gets data associated with a registered item.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $handle Name of the item. Should be unique.\n\t * @param string $key    The data key.\n\t * @return mixed Extra item data (string), false otherwise.\n\t */\n\tpublic function get_data( $handle, $key ) {\n\t\tif ( ! isset( $this->registered[ $handle ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! isset( $this->registered[ $handle ]->extra[ $key ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->registered[ $handle ]->extra[ $key ];\n\t}\n\n\t/**\n\t * Un-register an item or items.\n\t *\n\t * @since 2.1.0\n\t * @since 2.6.0 Moved from `WP_Scripts`.\n\t *\n\t * @param string|string[] $handles Item handle (string) or item handles (array of strings).\n\t */\n\tpublic function remove( $handles ) {\n\t\tforeach ( (array) $handles as $handle ) {\n\t\t\tunset( $this->registered[ $handle ] );\n\t\t}\n\t}\n\n\t/**\n\t * Queue an item or items.\n\t *\n\t * Decodes handles and arguments, then queues handles and stores\n\t * arguments in the class property $args. For example in extending\n\t * classes, $args is appended to the item url as a query string.\n\t * Note $args is NOT the $args property of items in the $registered array.\n\t *\n\t * @since 2.1.0\n\t * @since 2.6.0 Moved from `WP_Scripts`.\n\t *\n\t * @param string|string[] $handles Item handle (string) or item handles (array of strings).\n\t */\n\tpublic function enqueue( $handles ) {\n\t\tforeach ( (array) $handles as $handle ) {\n\t\t\t$handle = explode( '?', $handle );\n\n\t\t\tif ( ! in_array( $handle[0], $this->queue, true ) && isset( $this->registered[ $handle[0] ] ) ) {\n\t\t\t\t$this->queue[] = $handle[0];\n\n\t\t\t\t// Reset all dependencies so they must be recalculated in recurse_deps().\n\t\t\t\t$this->all_queued_deps = null;\n\n\t\t\t\tif ( isset( $handle[1] ) ) {\n\t\t\t\t\t$this->args[ $handle[0] ] = $handle[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Dequeue an item or items.\n\t *\n\t * Decodes handles and arguments, then dequeues handles\n\t * and removes arguments from the class property $args.\n\t *\n\t * @since 2.1.0\n\t * @since 2.6.0 Moved from `WP_Scripts`.\n\t *\n\t * @param string|string[] $handles Item handle (string) or item handles (array of strings).\n\t */\n\tpublic function dequeue( $handles ) {\n\t\tforeach ( (array) $handles as $handle ) {\n\t\t\t$handle = explode( '?', $handle );\n\t\t\t$key    = array_search( $handle[0], $this->queue, true );\n\n\t\t\tif ( false !== $key ) {\n\t\t\t\t// Reset all dependencies so they must be recalculated in recurse_deps().\n\t\t\t\t$this->all_queued_deps = null;\n\n\t\t\t\tunset( $this->queue[ $key ] );\n\t\t\t\tunset( $this->args[ $handle[0] ] );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Recursively search the passed dependency tree for $handle.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string[] $queue  An array of queued _WP_Dependency handles.\n\t * @param string   $handle Name of the item. Should be unique.\n\t * @return bool Whether the handle is found after recursively searching the dependency tree.\n\t */\n\tprotected function recurse_deps( $queue, $handle ) {\n\t\tif ( isset( $this->all_queued_deps ) ) {\n\t\t\treturn isset( $this->all_queued_deps[ $handle ] );\n\t\t}\n\n\t\t$all_deps = array_fill_keys( $queue, true );\n\t\t$queues   = array();\n\t\t$done     = array();\n\n\t\twhile ( $queue ) {\n\t\t\tforeach ( $queue as $queued ) {\n\t\t\t\tif ( ! isset( $done[ $queued ] ) && isset( $this->registered[ $queued ] ) ) {\n\t\t\t\t\t$deps = $this->registered[ $queued ]->deps;\n\t\t\t\t\tif ( $deps ) {\n\t\t\t\t\t\t$all_deps += array_fill_keys( $deps, true );\n\t\t\t\t\t\tarray_push( $queues, $deps );\n\t\t\t\t\t}\n\t\t\t\t\t$done[ $queued ] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$queue = array_pop( $queues );\n\t\t}\n\n\t\t$this->all_queued_deps = $all_deps;\n\n\t\treturn isset( $this->all_queued_deps[ $handle ] );\n\t}\n\n\t/**\n\t * Query list for an item.\n\t *\n\t * @since 2.1.0\n\t * @since 2.6.0 Moved from `WP_Scripts`.\n\t *\n\t * @param string $handle Name of the item. Should be unique.\n\t * @param string $list   Optional. Property name of list array. Default 'registered'.\n\t * @return bool|_WP_Dependency Found, or object Item data.\n\t */\n\tpublic function query( $handle, $list = 'registered' ) {\n\t\tswitch ( $list ) {\n\t\t\tcase 'registered':\n\t\t\tcase 'scripts': // Back compat.\n\t\t\t\tif ( isset( $this->registered[ $handle ] ) ) {\n\t\t\t\t\treturn $this->registered[ $handle ];\n\t\t\t\t}\n\t\t\t\treturn false;\n\n\t\t\tcase 'enqueued':\n\t\t\tcase 'queue':\n\t\t\t\tif ( in_array( $handle, $this->queue, true ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn $this->recurse_deps( $this->queue, $handle );\n\n\t\t\tcase 'to_do':\n\t\t\tcase 'to_print': // Back compat.\n\t\t\t\treturn in_array( $handle, $this->to_do, true );\n\n\t\t\tcase 'done':\n\t\t\tcase 'printed': // Back compat.\n\t\t\t\treturn in_array( $handle, $this->done, true );\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Set item group, unless already in a lower group.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string    $handle    Name of the item. Should be unique.\n\t * @param bool      $recursion Internal flag that calling function was called recursively.\n\t * @param int|false $group     Group level: level (int), no groups (false).\n\t * @return bool Not already in the group or a lower group.\n\t */\n\tpublic function set_group( $handle, $recursion, $group ) {\n\t\t$group = (int) $group;\n\n\t\tif ( isset( $this->groups[ $handle ] ) && $this->groups[ $handle ] <= $group ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->groups[ $handle ] = $group;\n\n\t\treturn true;\n\t}\n\n}\n", "num_lines": 453}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Dependencies API: WP_Scripts class\n *\n * @since 2.6.0\n *\n * @package WordPress\n * @subpackage Dependencies\n */\n\n/**\n * Core class used to register scripts.\n *\n * @since 2.1.0\n *\n * @see WP_Dependencies\n */\nclass WP_Scripts extends WP_Dependencies {\n\t/**\n\t * Base URL for scripts.\n\t *\n\t * Full URL with trailing slash.\n\t *\n\t * @since 2.6.0\n\t * @var string\n\t */\n\tpublic $base_url;\n\n\t/**\n\t * URL of the content directory.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $content_url;\n\n\t/**\n\t * Default version string for scripts.\n\t *\n\t * @since 2.6.0\n\t * @var string\n\t */\n\tpublic $default_version;\n\n\t/**\n\t * Holds handles of scripts which are enqueued in footer.\n\t *\n\t * @since 2.8.0\n\t * @var array\n\t */\n\tpublic $in_footer = array();\n\n\t/**\n\t * Holds a list of script handles which will be concatenated.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $concat = '';\n\n\t/**\n\t * Holds a string which contains script handles and their version.\n\t *\n\t * @since 2.8.0\n\t * @deprecated 3.4.0\n\t * @var string\n\t */\n\tpublic $concat_version = '';\n\n\t/**\n\t * Whether to perform concatenation.\n\t *\n\t * @since 2.8.0\n\t * @var bool\n\t */\n\tpublic $do_concat = false;\n\n\t/**\n\t * Holds HTML markup of scripts and additional data if concatenation\n\t * is enabled.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $print_html = '';\n\n\t/**\n\t * Holds inline code if concatenation is enabled.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $print_code = '';\n\n\t/**\n\t * Holds a list of script handles which are not in the default directory\n\t * if concatenation is enabled.\n\t *\n\t * Unused in core.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $ext_handles = '';\n\n\t/**\n\t * Holds a string which contains handles and versions of scripts which\n\t * are not in the default directory if concatenation is enabled.\n\t *\n\t * Unused in core.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $ext_version = '';\n\n\t/**\n\t * List of default directories.\n\t *\n\t * @since 2.8.0\n\t * @var array\n\t */\n\tpublic $default_dirs;\n\n\t/**\n\t * Holds a string which contains the type attribute for script tag.\n\t *\n\t * If the current theme does not declare HTML5 support for 'script',\n\t * then it initializes as `type='text/javascript'`.\n\t *\n\t * @since 5.3.0\n\t * @var string\n\t */\n\tprivate $type_attr = '';\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 2.6.0\n\t */\n\tpublic function __construct() {\n\t\t$this->init();\n\t\tadd_action( 'init', array( $this, 'init' ), 0 );\n\t}\n\n\t/**\n\t * Initialize the class.\n\t *\n\t * @since 3.4.0\n\t */\n\tpublic function init() {\n\t\tif (\n\t\t\tfunction_exists( 'is_admin' ) && ! is_admin()\n\t\t&&\n\t\t\tfunction_exists( 'current_theme_supports' ) && ! current_theme_supports( 'html5', 'script' )\n\t\t) {\n\t\t\t$this->type_attr = \" type='text/javascript'\";\n\t\t}\n\n\t\t/**\n\t\t * Fires when the WP_Scripts instance is initialized.\n\t\t *\n\t\t * @since 2.6.0\n\t\t *\n\t\t * @param WP_Scripts $this WP_Scripts instance (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'wp_default_scripts', array( &$this ) );\n\t}\n\n\t/**\n\t * Prints scripts.\n\t *\n\t * Prints the scripts passed to it or the print queue. Also prints all necessary dependencies.\n\t *\n\t * @since 2.1.0\n\t * @since 2.8.0 Added the `$group` parameter.\n\t *\n\t * @param string|string[]|false $handles Optional. Scripts to be printed: queue (false),\n\t *                                       single script (string), or multiple scripts (array of strings).\n\t *                                       Default false.\n\t * @param int|false             $group   Optional. Group level: level (int), no groups (false).\n\t *                                       Default false.\n\t * @return string[] Handles of scripts that have been printed.\n\t */\n\tpublic function print_scripts( $handles = false, $group = false ) {\n\t\treturn $this->do_items( $handles, $group );\n\t}\n\n\t/**\n\t * Prints extra scripts of a registered script.\n\t *\n\t * @since 2.1.0\n\t * @since 2.8.0 Added the `$echo` parameter.\n\t * @deprecated 3.3.0\n\t *\n\t * @see print_extra_script()\n\t *\n\t * @param string $handle The script's registered handle.\n\t * @param bool   $echo   Optional. Whether to echo the extra script\n\t *                       instead of just returning it. Default true.\n\t * @return bool|string|void Void if no data exists, extra scripts if `$echo` is true,\n\t *                          true otherwise.\n\t */\n\tpublic function print_scripts_l10n( $handle, $echo = true ) {\n\t\t_deprecated_function( __FUNCTION__, '3.3.0', 'WP_Scripts::print_extra_script()' );\n\t\treturn $this->print_extra_script( $handle, $echo );\n\t}\n\n\t/**\n\t * Prints extra scripts of a registered script.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $handle The script's registered handle.\n\t * @param bool   $echo   Optional. Whether to echo the extra script\n\t *                       instead of just returning it. Default true.\n\t * @return bool|string|void Void if no data exists, extra scripts if `$echo` is true,\n\t *                          true otherwise.\n\t */\n\tpublic function print_extra_script( $handle, $echo = true ) {\n\t\t$output = $this->get_data( $handle, 'data' );\n\t\tif ( ! $output ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $echo ) {\n\t\t\treturn $output;\n\t\t}\n\n\t\tprintf( \"<script%s id='%s-js-extra'>\\n\", $this->type_attr, esc_attr( $handle ) );\n\n\t\t// CDATA is not needed for HTML 5.\n\t\tif ( $this->type_attr ) {\n\t\t\techo \"/* <![CDATA[ */\\n\";\n\t\t}\n\n\t\techo \"$output\\n\";\n\n\t\tif ( $this->type_attr ) {\n\t\t\techo \"/* ]]> */\\n\";\n\t\t}\n\n\t\techo \"</script>\\n\";\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Processes a script dependency.\n\t *\n\t * @since 2.6.0\n\t * @since 2.8.0 Added the `$group` parameter.\n\t *\n\t * @see WP_Dependencies::do_item()\n\t *\n\t * @param string    $handle The script's registered handle.\n\t * @param int|false $group  Optional. Group level: level (int), no groups (false).\n\t *                          Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function do_item( $handle, $group = false ) {\n\t\tif ( ! parent::do_item( $handle ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( 0 === $group && $this->groups[ $handle ] > 0 ) {\n\t\t\t$this->in_footer[] = $handle;\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( false === $group && in_array( $handle, $this->in_footer, true ) ) {\n\t\t\t$this->in_footer = array_diff( $this->in_footer, (array) $handle );\n\t\t}\n\n\t\t$obj = $this->registered[ $handle ];\n\n\t\tif ( null === $obj->ver ) {\n\t\t\t$ver = '';\n\t\t} else {\n\t\t\t$ver = $obj->ver ? $obj->ver : $this->default_version;\n\t\t}\n\n\t\tif ( isset( $this->args[ $handle ] ) ) {\n\t\t\t$ver = $ver ? $ver . '&amp;' . $this->args[ $handle ] : $this->args[ $handle ];\n\t\t}\n\n\t\t$src         = $obj->src;\n\t\t$cond_before = '';\n\t\t$cond_after  = '';\n\t\t$conditional = isset( $obj->extra['conditional'] ) ? $obj->extra['conditional'] : '';\n\n\t\tif ( $conditional ) {\n\t\t\t$cond_before = \"<!--[if {$conditional}]>\\n\";\n\t\t\t$cond_after  = \"<![endif]-->\\n\";\n\t\t}\n\n\t\t$before_handle = $this->print_inline_script( $handle, 'before', false );\n\t\t$after_handle  = $this->print_inline_script( $handle, 'after', false );\n\n\t\tif ( $before_handle ) {\n\t\t\t$before_handle = sprintf( \"<script%s id='%s-js-before'>\\n%s\\n</script>\\n\", $this->type_attr, esc_attr( $handle ), $before_handle );\n\t\t}\n\n\t\tif ( $after_handle ) {\n\t\t\t$after_handle = sprintf( \"<script%s id='%s-js-after'>\\n%s\\n</script>\\n\", $this->type_attr, esc_attr( $handle ), $after_handle );\n\t\t}\n\n\t\tif ( $before_handle || $after_handle ) {\n\t\t\t$inline_script_tag = $cond_before . $before_handle . $after_handle . $cond_after;\n\t\t} else {\n\t\t\t$inline_script_tag = '';\n\t\t}\n\n\t\t$translations = $this->print_translations( $handle, false );\n\t\tif ( $translations ) {\n\t\t\t$translations = sprintf( \"<script%s id='%s-js-translations'>\\n%s\\n</script>\\n\", $this->type_attr, esc_attr( $handle ), $translations );\n\t\t}\n\n\t\tif ( $this->do_concat ) {\n\t\t\t/**\n\t\t\t * Filters the script loader source.\n\t\t\t *\n\t\t\t * @since 2.2.0\n\t\t\t *\n\t\t\t * @param string $src    Script loader source path.\n\t\t\t * @param string $handle Script handle.\n\t\t\t */\n\t\t\t$srce = apply_filters( 'script_loader_src', $src, $handle );\n\n\t\t\tif ( $this->in_default_dir( $srce ) && ( $before_handle || $after_handle || $translations ) ) {\n\t\t\t\t$this->do_concat = false;\n\n\t\t\t\t// Have to print the so-far concatenated scripts right away to maintain the right order.\n\t\t\t\t_print_scripts();\n\t\t\t\t$this->reset();\n\t\t\t} elseif ( $this->in_default_dir( $srce ) && ! $conditional ) {\n\t\t\t\t$this->print_code     .= $this->print_extra_script( $handle, false );\n\t\t\t\t$this->concat         .= \"$handle,\";\n\t\t\t\t$this->concat_version .= \"$handle$ver\";\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$this->ext_handles .= \"$handle,\";\n\t\t\t\t$this->ext_version .= \"$handle$ver\";\n\t\t\t}\n\t\t}\n\n\t\t$has_conditional_data = $conditional && $this->get_data( $handle, 'data' );\n\n\t\tif ( $has_conditional_data ) {\n\t\t\techo $cond_before;\n\t\t}\n\n\t\t$this->print_extra_script( $handle );\n\n\t\tif ( $has_conditional_data ) {\n\t\t\techo $cond_after;\n\t\t}\n\n\t\t// A single item may alias a set of items, by having dependencies, but no source.\n\t\tif ( ! $src ) {\n\t\t\tif ( $inline_script_tag ) {\n\t\t\t\tif ( $this->do_concat ) {\n\t\t\t\t\t$this->print_html .= $inline_script_tag;\n\t\t\t\t} else {\n\t\t\t\t\techo $inline_script_tag;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) {\n\t\t\t$src = $this->base_url . $src;\n\t\t}\n\n\t\tif ( ! empty( $ver ) ) {\n\t\t\t$src = add_query_arg( 'ver', $ver, $src );\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/class.wp-scripts.php */\n\t\t$src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) );\n\n\t\tif ( ! $src ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$tag  = $translations . $cond_before . $before_handle;\n\t\t$tag .= sprintf( \"<script%s src='%s' id='%s-js'></script>\\n\", $this->type_attr, $src, esc_attr( $handle ) );\n\t\t$tag .= $after_handle . $cond_after;\n\n\t\t/**\n\t\t * Filters the HTML script tag of an enqueued script.\n\t\t *\n\t\t * @since 4.1.0\n\t\t *\n\t\t * @param string $tag    The `<script>` tag for the enqueued script.\n\t\t * @param string $handle The script's registered handle.\n\t\t * @param string $src    The script's source URL.\n\t\t */\n\t\t$tag = apply_filters( 'script_loader_tag', $tag, $handle, $src );\n\n\t\tif ( $this->do_concat ) {\n\t\t\t$this->print_html .= $tag;\n\t\t} else {\n\t\t\techo $tag;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Adds extra code to a registered script.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param string $handle   Name of the script to add the inline script to.\n\t *                         Must be lowercase.\n\t * @param string $data     String containing the javascript to be added.\n\t * @param string $position Optional. Whether to add the inline script\n\t *                         before the handle or after. Default 'after'.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function add_inline_script( $handle, $data, $position = 'after' ) {\n\t\tif ( ! $data ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( 'after' !== $position ) {\n\t\t\t$position = 'before';\n\t\t}\n\n\t\t$script   = (array) $this->get_data( $handle, $position );\n\t\t$script[] = $data;\n\n\t\treturn $this->add_data( $handle, $position, $script );\n\t}\n\n\t/**\n\t * Prints inline scripts registered for a specific handle.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param string $handle   Name of the script to add the inline script to.\n\t *                         Must be lowercase.\n\t * @param string $position Optional. Whether to add the inline script\n\t *                         before the handle or after. Default 'after'.\n\t * @param bool   $echo     Optional. Whether to echo the script\n\t *                         instead of just returning it. Default true.\n\t * @return string|false Script on success, false otherwise.\n\t */\n\tpublic function print_inline_script( $handle, $position = 'after', $echo = true ) {\n\t\t$output = $this->get_data( $handle, $position );\n\n\t\tif ( empty( $output ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$output = trim( implode( \"\\n\", $output ), \"\\n\" );\n\n\t\tif ( $echo ) {\n\t\t\tprintf( \"<script%s id='%s-js-%s'>\\n%s\\n</script>\\n\", $this->type_attr, esc_attr( $handle ), esc_attr( $position ), $output );\n\t\t}\n\n\t\treturn $output;\n\t}\n\n\t/**\n\t * Localizes a script, only if the script has already been added.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $handle      Name of the script to attach data to.\n\t * @param string $object_name Name of the variable that will contain the data.\n\t * @param array  $l10n        Array of data to localize.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function localize( $handle, $object_name, $l10n ) {\n\t\tif ( 'jquery' === $handle ) {\n\t\t\t$handle = 'jquery-core';\n\t\t}\n\n\t\tif ( is_array( $l10n ) && isset( $l10n['l10n_print_after'] ) ) { // back compat, preserve the code in 'l10n_print_after' if present.\n\t\t\t$after = $l10n['l10n_print_after'];\n\t\t\tunset( $l10n['l10n_print_after'] );\n\t\t}\n\n\t\tforeach ( (array) $l10n as $key => $value ) {\n\t\t\tif ( ! is_scalar( $value ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$l10n[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' );\n\t\t}\n\n\t\t$script = \"var $object_name = \" . wp_json_encode( $l10n ) . ';';\n\n\t\tif ( ! empty( $after ) ) {\n\t\t\t$script .= \"\\n$after;\";\n\t\t}\n\n\t\t$data = $this->get_data( $handle, 'data' );\n\n\t\tif ( ! empty( $data ) ) {\n\t\t\t$script = \"$data\\n$script\";\n\t\t}\n\n\t\treturn $this->add_data( $handle, 'data', $script );\n\t}\n\n\t/**\n\t * Sets handle group.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @see WP_Dependencies::set_group()\n\t *\n\t * @param string    $handle    Name of the item. Should be unique.\n\t * @param bool      $recursion Internal flag that calling function was called recursively.\n\t * @param int|false $group     Optional. Group level: level (int), no groups (false).\n\t *                             Default false.\n\t * @return bool Not already in the group or a lower group.\n\t */\n\tpublic function set_group( $handle, $recursion, $group = false ) {\n\t\tif ( isset( $this->registered[ $handle ]->args ) && 1 === $this->registered[ $handle ]->args ) {\n\t\t\t$grp = 1;\n\t\t} else {\n\t\t\t$grp = (int) $this->get_data( $handle, 'group' );\n\t\t}\n\n\t\tif ( false !== $group && $grp > $group ) {\n\t\t\t$grp = $group;\n\t\t}\n\n\t\treturn parent::set_group( $handle, $recursion, $grp );\n\t}\n\n\t/**\n\t * Sets a translation textdomain.\n\t *\n\t * @since 5.0.0\n\t * @since 5.1.0 The `$domain` parameter was made optional.\n\t *\n\t * @param string $handle Name of the script to register a translation domain to.\n\t * @param string $domain Optional. Text domain. Default 'default'.\n\t * @param string $path   Optional. The full file path to the directory containing translation files.\n\t * @return bool True if the text domain was registered, false if not.\n\t */\n\tpublic function set_translations( $handle, $domain = 'default', $path = null ) {\n\t\tif ( ! isset( $this->registered[ $handle ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/** @var \\_WP_Dependency $obj */\n\t\t$obj = $this->registered[ $handle ];\n\n\t\tif ( ! in_array( 'wp-i18n', $obj->deps, true ) ) {\n\t\t\t$obj->deps[] = 'wp-i18n';\n\t\t}\n\n\t\treturn $obj->set_translations( $domain, $path );\n\t}\n\n\t/**\n\t * Prints translations set for a specific handle.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param string $handle Name of the script to add the inline script to.\n\t *                       Must be lowercase.\n\t * @param bool   $echo   Optional. Whether to echo the script\n\t *                       instead of just returning it. Default true.\n\t * @return string|false Script on success, false otherwise.\n\t */\n\tpublic function print_translations( $handle, $echo = true ) {\n\t\tif ( ! isset( $this->registered[ $handle ] ) || empty( $this->registered[ $handle ]->textdomain ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$domain = $this->registered[ $handle ]->textdomain;\n\t\t$path   = $this->registered[ $handle ]->translations_path;\n\n\t\t$json_translations = load_script_textdomain( $handle, $domain, $path );\n\n\t\tif ( ! $json_translations ) {\n\t\t\t// Register empty locale data object to ensure the domain still exists.\n\t\t\t$json_translations = '{ \"locale_data\": { \"messages\": { \"\": {} } } }';\n\t\t}\n\n\t\t$output = <<<JS\n( function( domain, translations ) {\n\tvar localeData = translations.locale_data[ domain ] || translations.locale_data.messages;\n\tlocaleData[\"\"].domain = domain;\n\twp.i18n.setLocaleData( localeData, domain );\n} )( \"{$domain}\", {$json_translations} );\nJS;\n\n\t\tif ( $echo ) {\n\t\t\tprintf( \"<script%s id='%s-js-translations'>\\n%s\\n</script>\\n\", $this->type_attr, esc_attr( $handle ), $output );\n\t\t}\n\n\t\treturn $output;\n\t}\n\n\t/**\n\t * Determines script dependencies.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @see WP_Dependencies::all_deps()\n\t *\n\t * @param string|string[] $handles   Item handle (string) or item handles (array of strings).\n\t * @param bool            $recursion Optional. Internal flag that function is calling itself.\n\t *                                   Default false.\n\t * @param int|false       $group     Optional. Group level: level (int), no groups (false).\n\t *                                   Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function all_deps( $handles, $recursion = false, $group = false ) {\n\t\t$r = parent::all_deps( $handles, $recursion, $group );\n\t\tif ( ! $recursion ) {\n\t\t\t/**\n\t\t\t * Filters the list of script dependencies left to print.\n\t\t\t *\n\t\t\t * @since 2.3.0\n\t\t\t *\n\t\t\t * @param string[] $to_do An array of script dependency handles.\n\t\t\t */\n\t\t\t$this->to_do = apply_filters( 'print_scripts_array', $this->to_do );\n\t\t}\n\t\treturn $r;\n\t}\n\n\t/**\n\t * Processes items and dependencies for the head group.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @see WP_Dependencies::do_items()\n\t *\n\t * @return string[] Handles of items that have been processed.\n\t */\n\tpublic function do_head_items() {\n\t\t$this->do_items( false, 0 );\n\t\treturn $this->done;\n\t}\n\n\t/**\n\t * Processes items and dependencies for the footer group.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @see WP_Dependencies::do_items()\n\t *\n\t * @return string[] Handles of items that have been processed.\n\t */\n\tpublic function do_footer_items() {\n\t\t$this->do_items( false, 1 );\n\t\treturn $this->done;\n\t}\n\n\t/**\n\t * Whether a handle's source is in a default directory.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $src The source of the enqueued script.\n\t * @return bool True if found, false if not.\n\t */\n\tpublic function in_default_dir( $src ) {\n\t\tif ( ! $this->default_dirs ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( 0 === strpos( $src, '/' . WPINC . '/js/l10n' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ( (array) $this->default_dirs as $test ) {\n\t\t\tif ( 0 === strpos( $src, $test ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Resets class properties.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function reset() {\n\t\t$this->do_concat      = false;\n\t\t$this->print_code     = '';\n\t\t$this->concat         = '';\n\t\t$this->concat_version = '';\n\t\t$this->print_html     = '';\n\t\t$this->ext_version    = '';\n\t\t$this->ext_handles    = '';\n\t}\n}\n", "num_lines": 701}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Dependencies API: WP_Styles class\n *\n * @since 2.6.0\n *\n * @package WordPress\n * @subpackage Dependencies\n */\n\n/**\n * Core class used to register styles.\n *\n * @since 2.6.0\n *\n * @see WP_Dependencies\n */\nclass WP_Styles extends WP_Dependencies {\n\t/**\n\t * Base URL for styles.\n\t *\n\t * Full URL with trailing slash.\n\t *\n\t * @since 2.6.0\n\t * @var string\n\t */\n\tpublic $base_url;\n\n\t/**\n\t * URL of the content directory.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $content_url;\n\n\t/**\n\t * Default version string for stylesheets.\n\t *\n\t * @since 2.6.0\n\t * @var string\n\t */\n\tpublic $default_version;\n\n\t/**\n\t * The current text direction.\n\t *\n\t * @since 2.6.0\n\t * @var string\n\t */\n\tpublic $text_direction = 'ltr';\n\n\t/**\n\t * Holds a list of style handles which will be concatenated.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $concat = '';\n\n\t/**\n\t * Holds a string which contains style handles and their version.\n\t *\n\t * @since 2.8.0\n\t * @deprecated 3.4.0\n\t * @var string\n\t */\n\tpublic $concat_version = '';\n\n\t/**\n\t * Whether to perform concatenation.\n\t *\n\t * @since 2.8.0\n\t * @var bool\n\t */\n\tpublic $do_concat = false;\n\n\t/**\n\t * Holds HTML markup of styles and additional data if concatenation\n\t * is enabled.\n\t *\n\t * @since 2.8.0\n\t * @var string\n\t */\n\tpublic $print_html = '';\n\n\t/**\n\t * Holds inline styles if concatenation is enabled.\n\t *\n\t * @since 3.3.0\n\t * @var string\n\t */\n\tpublic $print_code = '';\n\n\t/**\n\t * List of default directories.\n\t *\n\t * @since 2.8.0\n\t * @var array\n\t */\n\tpublic $default_dirs;\n\n\t/**\n\t * Holds a string which contains the type attribute for style tag.\n\t *\n\t * If the current theme does not declare HTML5 support for 'style',\n\t * then it initializes as `type='text/css'`.\n\t *\n\t * @since 5.3.0\n\t * @var string\n\t */\n\tprivate $type_attr = '';\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 2.6.0\n\t */\n\tpublic function __construct() {\n\t\tif (\n\t\t\tfunction_exists( 'is_admin' ) && ! is_admin()\n\t\t&&\n\t\t\tfunction_exists( 'current_theme_supports' ) && ! current_theme_supports( 'html5', 'style' )\n\t\t) {\n\t\t\t$this->type_attr = \" type='text/css'\";\n\t\t}\n\n\t\t/**\n\t\t * Fires when the WP_Styles instance is initialized.\n\t\t *\n\t\t * @since 2.6.0\n\t\t *\n\t\t * @param WP_Styles $this WP_Styles instance (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'wp_default_styles', array( &$this ) );\n\t}\n\n\t/**\n\t * Processes a style dependency.\n\t *\n\t * @since 2.6.0\n\t * @since 5.5.0 Added the `$group` parameter.\n\t *\n\t * @see WP_Dependencies::do_item()\n\t *\n\t * @param string    $handle The style's registered handle.\n\t * @param int|false $group  Optional. Group level: level (int), no groups (false).\n\t *                          Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function do_item( $handle, $group = false ) {\n\t\tif ( ! parent::do_item( $handle ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$obj = $this->registered[ $handle ];\n\n\t\tif ( null === $obj->ver ) {\n\t\t\t$ver = '';\n\t\t} else {\n\t\t\t$ver = $obj->ver ? $obj->ver : $this->default_version;\n\t\t}\n\n\t\tif ( isset( $this->args[ $handle ] ) ) {\n\t\t\t$ver = $ver ? $ver . '&amp;' . $this->args[ $handle ] : $this->args[ $handle ];\n\t\t}\n\n\t\t$src         = $obj->src;\n\t\t$cond_before = '';\n\t\t$cond_after  = '';\n\t\t$conditional = isset( $obj->extra['conditional'] ) ? $obj->extra['conditional'] : '';\n\n\t\tif ( $conditional ) {\n\t\t\t$cond_before = \"<!--[if {$conditional}]>\\n\";\n\t\t\t$cond_after  = \"<![endif]-->\\n\";\n\t\t}\n\n\t\t$inline_style = $this->print_inline_style( $handle, false );\n\n\t\tif ( $inline_style ) {\n\t\t\t$inline_style_tag = sprintf(\n\t\t\t\t\"<style id='%s-inline-css'%s>\\n%s\\n</style>\\n\",\n\t\t\t\tesc_attr( $handle ),\n\t\t\t\t$this->type_attr,\n\t\t\t\t$inline_style\n\t\t\t);\n\t\t} else {\n\t\t\t$inline_style_tag = '';\n\t\t}\n\n\t\tif ( $this->do_concat ) {\n\t\t\tif ( $this->in_default_dir( $src ) && ! $conditional && ! isset( $obj->extra['alt'] ) ) {\n\t\t\t\t$this->concat         .= \"$handle,\";\n\t\t\t\t$this->concat_version .= \"$handle$ver\";\n\n\t\t\t\t$this->print_code .= $inline_style;\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $obj->args ) ) {\n\t\t\t$media = esc_attr( $obj->args );\n\t\t} else {\n\t\t\t$media = 'all';\n\t\t}\n\n\t\t// A single item may alias a set of items, by having dependencies, but no source.\n\t\tif ( ! $src ) {\n\t\t\tif ( $inline_style_tag ) {\n\t\t\t\tif ( $this->do_concat ) {\n\t\t\t\t\t$this->print_html .= $inline_style_tag;\n\t\t\t\t} else {\n\t\t\t\t\techo $inline_style_tag;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t$href = $this->_css_href( $src, $ver, $handle );\n\t\tif ( ! $href ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$rel   = isset( $obj->extra['alt'] ) && $obj->extra['alt'] ? 'alternate stylesheet' : 'stylesheet';\n\t\t$title = isset( $obj->extra['title'] ) ? sprintf( \"title='%s'\", esc_attr( $obj->extra['title'] ) ) : '';\n\n\t\t$tag = sprintf(\n\t\t\t\"<link rel='%s' id='%s-css' %s href='%s'%s media='%s' />\\n\",\n\t\t\t$rel,\n\t\t\t$handle,\n\t\t\t$title,\n\t\t\t$href,\n\t\t\t$this->type_attr,\n\t\t\t$media\n\t\t);\n\n\t\t/**\n\t\t * Filters the HTML link tag of an enqueued style.\n\t\t *\n\t\t * @since 2.6.0\n\t\t * @since 4.3.0 Introduced the `$href` parameter.\n\t\t * @since 4.5.0 Introduced the `$media` parameter.\n\t\t *\n\t\t * @param string $html   The link tag for the enqueued style.\n\t\t * @param string $handle The style's registered handle.\n\t\t * @param string $href   The stylesheet's source URL.\n\t\t * @param string $media  The stylesheet's media attribute.\n\t\t */\n\t\t$tag = apply_filters( 'style_loader_tag', $tag, $handle, $href, $media );\n\n\t\tif ( 'rtl' === $this->text_direction && isset( $obj->extra['rtl'] ) && $obj->extra['rtl'] ) {\n\t\t\tif ( is_bool( $obj->extra['rtl'] ) || 'replace' === $obj->extra['rtl'] ) {\n\t\t\t\t$suffix   = isset( $obj->extra['suffix'] ) ? $obj->extra['suffix'] : '';\n\t\t\t\t$rtl_href = str_replace( \"{$suffix}.css\", \"-rtl{$suffix}.css\", $this->_css_href( $src, $ver, \"$handle-rtl\" ) );\n\t\t\t} else {\n\t\t\t\t$rtl_href = $this->_css_href( $obj->extra['rtl'], $ver, \"$handle-rtl\" );\n\t\t\t}\n\n\t\t\t$rtl_tag = sprintf(\n\t\t\t\t\"<link rel='%s' id='%s-rtl-css' %s href='%s'%s media='%s' />\\n\",\n\t\t\t\t$rel,\n\t\t\t\t$handle,\n\t\t\t\t$title,\n\t\t\t\t$rtl_href,\n\t\t\t\t$this->type_attr,\n\t\t\t\t$media\n\t\t\t);\n\n\t\t\t/** This filter is documented in wp-includes/class.wp-styles.php */\n\t\t\t$rtl_tag = apply_filters( 'style_loader_tag', $rtl_tag, $handle, $rtl_href, $media );\n\n\t\t\tif ( 'replace' === $obj->extra['rtl'] ) {\n\t\t\t\t$tag = $rtl_tag;\n\t\t\t} else {\n\t\t\t\t$tag .= $rtl_tag;\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->do_concat ) {\n\t\t\t$this->print_html .= $cond_before;\n\t\t\t$this->print_html .= $tag;\n\t\t\tif ( $inline_style_tag ) {\n\t\t\t\t$this->print_html .= $inline_style_tag;\n\t\t\t}\n\t\t\t$this->print_html .= $cond_after;\n\t\t} else {\n\t\t\techo $cond_before;\n\t\t\techo $tag;\n\t\t\t$this->print_inline_style( $handle );\n\t\t\techo $cond_after;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Adds extra CSS styles to a registered stylesheet.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $handle The style's registered handle.\n\t * @param string $code   String containing the CSS styles to be added.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function add_inline_style( $handle, $code ) {\n\t\tif ( ! $code ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$after = $this->get_data( $handle, 'after' );\n\t\tif ( ! $after ) {\n\t\t\t$after = array();\n\t\t}\n\n\t\t$after[] = $code;\n\n\t\treturn $this->add_data( $handle, 'after', $after );\n\t}\n\n\t/**\n\t * Prints extra CSS styles of a registered stylesheet.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $handle The style's registered handle.\n\t * @param bool   $echo   Optional. Whether to echo the inline style\n\t *                       instead of just returning it. Default true.\n\t * @return string|bool False if no data exists, inline styles if `$echo` is true,\n\t *                     true otherwise.\n\t */\n\tpublic function print_inline_style( $handle, $echo = true ) {\n\t\t$output = $this->get_data( $handle, 'after' );\n\n\t\tif ( empty( $output ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$output = implode( \"\\n\", $output );\n\n\t\tif ( ! $echo ) {\n\t\t\treturn $output;\n\t\t}\n\n\t\tprintf(\n\t\t\t\"<style id='%s-inline-css'%s>\\n%s\\n</style>\\n\",\n\t\t\tesc_attr( $handle ),\n\t\t\t$this->type_attr,\n\t\t\t$output\n\t\t);\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Determines style dependencies.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @see WP_Dependencies::all_deps()\n\t *\n\t * @param string|string[] $handles   Item handle (string) or item handles (array of strings).\n\t * @param bool            $recursion Optional. Internal flag that function is calling itself.\n\t *                                   Default false.\n\t * @param int|false       $group     Optional. Group level: level (int), no groups (false).\n\t *                                   Default false.\n\t * @return bool True on success, false on failure.\n\t */\n\tpublic function all_deps( $handles, $recursion = false, $group = false ) {\n\t\t$r = parent::all_deps( $handles, $recursion, $group );\n\t\tif ( ! $recursion ) {\n\t\t\t/**\n\t\t\t * Filters the array of enqueued styles before processing for output.\n\t\t\t *\n\t\t\t * @since 2.6.0\n\t\t\t *\n\t\t\t * @param string[] $to_do The list of enqueued style handles about to be processed.\n\t\t\t */\n\t\t\t$this->to_do = apply_filters( 'print_styles_array', $this->to_do );\n\t\t}\n\t\treturn $r;\n\t}\n\n\t/**\n\t * Generates an enqueued style's fully-qualified URL.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param string $src    The source of the enqueued style.\n\t * @param string $ver    The version of the enqueued style.\n\t * @param string $handle The style's registered handle.\n\t * @return string Style's fully-qualified URL.\n\t */\n\tpublic function _css_href( $src, $ver, $handle ) {\n\t\tif ( ! is_bool( $src ) && ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) {\n\t\t\t$src = $this->base_url . $src;\n\t\t}\n\n\t\tif ( ! empty( $ver ) ) {\n\t\t\t$src = add_query_arg( 'ver', $ver, $src );\n\t\t}\n\n\t\t/**\n\t\t * Filters an enqueued style's fully-qualified URL.\n\t\t *\n\t\t * @since 2.6.0\n\t\t *\n\t\t * @param string $src    The source URL of the enqueued style.\n\t\t * @param string $handle The style's registered handle.\n\t\t */\n\t\t$src = apply_filters( 'style_loader_src', $src, $handle );\n\t\treturn esc_url( $src );\n\t}\n\n\t/**\n\t * Whether a handle's source is in a default directory.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $src The source of the enqueued style.\n\t * @return bool True if found, false if not.\n\t */\n\tpublic function in_default_dir( $src ) {\n\t\tif ( ! $this->default_dirs ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tforeach ( (array) $this->default_dirs as $test ) {\n\t\t\tif ( 0 === strpos( $src, $test ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Processes items and dependencies for the footer group.\n\t *\n\t * HTML 5 allows styles in the body, grab late enqueued items and output them in the footer.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @see WP_Dependencies::do_items()\n\t *\n\t * @return string[] Handles of items that have been processed.\n\t */\n\tpublic function do_footer_items() {\n\t\t$this->do_items( false, 1 );\n\t\treturn $this->done;\n\t}\n\n\t/**\n\t * Resets class properties.\n\t *\n\t * @since 3.3.0\n\t */\n\tpublic function reset() {\n\t\t$this->do_concat      = false;\n\t\t$this->concat         = '';\n\t\t$this->concat_version = '';\n\t\t$this->print_html     = '';\n\t}\n}\n", "num_lines": 465}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Comment template functions\n *\n * These functions are meant to live inside of the WordPress loop.\n *\n * @package WordPress\n * @subpackage Template\n */\n\n/**\n * Retrieves the author of the current comment.\n *\n * If the comment has an empty comment_author field, then 'Anonymous' person is\n * assumed.\n *\n * @since 1.5.0\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n *\n * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to retrieve the author.\n *                                   Default current comment.\n * @return string The comment author\n */\nfunction get_comment_author( $comment_ID = 0 ) {\n\t$comment = get_comment( $comment_ID );\n\n\tif ( empty( $comment->comment_author ) ) {\n\t\t$user = $comment->user_id ? get_userdata( $comment->user_id ) : false;\n\t\tif ( $user ) {\n\t\t\t$author = $user->display_name;\n\t\t} else {\n\t\t\t$author = __( 'Anonymous' );\n\t\t}\n\t} else {\n\t\t$author = $comment->comment_author;\n\t}\n\n\t/**\n\t * Filters the returned comment author name.\n\t *\n\t * @since 1.5.0\n\t * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.\n\t *\n\t * @param string     $author     The comment author's username.\n\t * @param int        $comment_ID The comment ID.\n\t * @param WP_Comment $comment    The comment object.\n\t */\n\treturn apply_filters( 'get_comment_author', $author, $comment->comment_ID, $comment );\n}\n\n/**\n * Displays the author of the current comment.\n *\n * @since 0.71\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n *\n * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author.\n *                                   Default current comment.\n */\nfunction comment_author( $comment_ID = 0 ) {\n\t$comment = get_comment( $comment_ID );\n\t$author  = get_comment_author( $comment );\n\n\t/**\n\t * Filters the comment author's name for display.\n\t *\n\t * @since 1.2.0\n\t * @since 4.1.0 The `$comment_ID` parameter was added.\n\t *\n\t * @param string $author     The comment author's username.\n\t * @param int    $comment_ID The comment ID.\n\t */\n\techo apply_filters( 'comment_author', $author, $comment->comment_ID );\n}\n\n/**\n * Retrieves the email of the author of the current comment.\n *\n * @since 1.5.0\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n *\n * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's email.\n *                                   Default current comment.\n * @return string The current comment author's email\n */\nfunction get_comment_author_email( $comment_ID = 0 ) {\n\t$comment = get_comment( $comment_ID );\n\n\t/**\n\t * Filters the comment author's returned email address.\n\t *\n\t * @since 1.5.0\n\t * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.\n\t *\n\t * @param string     $comment_author_email The comment author's email address.\n\t * @param int        $comment_ID           The comment ID.\n\t * @param WP_Comment $comment              The comment object.\n\t */\n\treturn apply_filters( 'get_comment_author_email', $comment->comment_author_email, $comment->comment_ID, $comment );\n}\n\n/**\n * Displays the email of the author of the current global $comment.\n *\n * Care should be taken to protect the email address and assure that email\n * harvesters do not capture your commenter's email address. Most assume that\n * their email address will not appear in raw form on the site. Doing so will\n * enable anyone, including those that people don't want to get the email\n * address and use it for their own means good and bad.\n *\n * @since 0.71\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n *\n * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's email.\n *                                   Default current comment.\n */\nfunction comment_author_email( $comment_ID = 0 ) {\n\t$comment      = get_comment( $comment_ID );\n\t$author_email = get_comment_author_email( $comment );\n\n\t/**\n\t * Filters the comment author's email for display.\n\t *\n\t * @since 1.2.0\n\t * @since 4.1.0 The `$comment_ID` parameter was added.\n\t *\n\t * @param string $author_email The comment author's email address.\n\t * @param int    $comment_ID   The comment ID.\n\t */\n\techo apply_filters( 'author_email', $author_email, $comment->comment_ID );\n}\n\n/**\n * Displays the HTML email link to the author of the current comment.\n *\n * Care should be taken to protect the email address and assure that email\n * harvesters do not capture your commenter's email address. Most assume that\n * their email address will not appear in raw form on the site. Doing so will\n * enable anyone, including those that people don't want to get the email\n * address and use it for their own means good and bad.\n *\n * @since 0.71\n * @since 4.6.0 Added the `$comment` parameter.\n *\n * @param string         $linktext Optional. Text to display instead of the comment author's email address.\n *                                 Default empty.\n * @param string         $before   Optional. Text or HTML to display before the email link. Default empty.\n * @param string         $after    Optional. Text or HTML to display after the email link. Default empty.\n * @param int|WP_Comment $comment  Optional. Comment ID or WP_Comment object. Default is the current comment.\n */\nfunction comment_author_email_link( $linktext = '', $before = '', $after = '', $comment = null ) {\n\t$link = get_comment_author_email_link( $linktext, $before, $after, $comment );\n\tif ( $link ) {\n\t\techo $link;\n\t}\n}\n\n/**\n * Returns the HTML email link to the author of the current comment.\n *\n * Care should be taken to protect the email address and assure that email\n * harvesters do not capture your commenter's email address. Most assume that\n * their email address will not appear in raw form on the site. Doing so will\n * enable anyone, including those that people don't want to get the email\n * address and use it for their own means good and bad.\n *\n * @since 2.7.0\n * @since 4.6.0 Added the `$comment` parameter.\n *\n * @param string         $linktext Optional. Text to display instead of the comment author's email address.\n *                                 Default empty.\n * @param string         $before   Optional. Text or HTML to display before the email link. Default empty.\n * @param string         $after    Optional. Text or HTML to display after the email link. Default empty.\n * @param int|WP_Comment $comment  Optional. Comment ID or WP_Comment object. Default is the current comment.\n * @return string HTML markup for the comment author email link. By default, the email address is obfuscated\n *                via the {@see 'comment_email'} filter with antispambot().\n */\nfunction get_comment_author_email_link( $linktext = '', $before = '', $after = '', $comment = null ) {\n\t$comment = get_comment( $comment );\n\n\t/**\n\t * Filters the comment author's email for display.\n\t *\n\t * Care should be taken to protect the email address and assure that email\n\t * harvesters do not capture your commenter's email address.\n\t *\n\t * @since 1.2.0\n\t * @since 4.1.0 The `$comment` parameter was added.\n\t *\n\t * @param string     $comment_author_email The comment author's email address.\n\t * @param WP_Comment $comment              The comment object.\n\t */\n\t$email = apply_filters( 'comment_email', $comment->comment_author_email, $comment );\n\n\tif ( ( ! empty( $email ) ) && ( '@' !== $email ) ) {\n\t\t$display = ( '' !== $linktext ) ? $linktext : $email;\n\t\t$return  = $before;\n\t\t$return .= sprintf( '<a href=\"%1$s\">%2$s</a>', esc_url( 'mailto:' . $email ), esc_html( $display ) );\n\t\t$return .= $after;\n\t\treturn $return;\n\t} else {\n\t\treturn '';\n\t}\n}\n\n/**\n * Retrieves the HTML link to the URL of the author of the current comment.\n *\n * Both get_comment_author_url() and get_comment_author() rely on get_comment(),\n * which falls back to the global comment variable if the $comment_ID argument is empty.\n *\n * @since 1.5.0\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n *\n * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's link.\n *                                   Default current comment.\n * @return string The comment author name or HTML link for author's URL.\n */\nfunction get_comment_author_link( $comment_ID = 0 ) {\n\t$comment = get_comment( $comment_ID );\n\t$url     = get_comment_author_url( $comment );\n\t$author  = get_comment_author( $comment );\n\n\tif ( empty( $url ) || 'http://' === $url ) {\n\t\t$return = $author;\n\t} else {\n\t\t$return = \"<a href='$url' rel='external nofollow ugc' class='url'>$author</a>\";\n\t}\n\n\t/**\n\t * Filters the comment author's link for display.\n\t *\n\t * @since 1.5.0\n\t * @since 4.1.0 The `$author` and `$comment_ID` parameters were added.\n\t *\n\t * @param string $return     The HTML-formatted comment author link.\n\t *                           Empty for an invalid URL.\n\t * @param string $author     The comment author's username.\n\t * @param int    $comment_ID The comment ID.\n\t */\n\treturn apply_filters( 'get_comment_author_link', $return, $author, $comment->comment_ID );\n}\n\n/**\n * Displays the HTML link to the URL of the author of the current comment.\n *\n * @since 0.71\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n *\n * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's link.\n *                                   Default current comment.\n */\nfunction comment_author_link( $comment_ID = 0 ) {\n\techo get_comment_author_link( $comment_ID );\n}\n\n/**\n * Retrieve the IP address of the author of the current comment.\n *\n * @since 1.5.0\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n *\n * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's IP address.\n *                                   Default current comment.\n * @return string Comment author's IP address.\n */\nfunction get_comment_author_IP( $comment_ID = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid\n\t$comment = get_comment( $comment_ID );\n\n\t/**\n\t * Filters the comment author's returned IP address.\n\t *\n\t * @since 1.5.0\n\t * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.\n\t *\n\t * @param string     $comment_author_IP The comment author's IP address.\n\t * @param int        $comment_ID        The comment ID.\n\t * @param WP_Comment $comment           The comment object.\n\t */\n\treturn apply_filters( 'get_comment_author_IP', $comment->comment_author_IP, $comment->comment_ID, $comment );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase\n}\n\n/**\n * Displays the IP address of the author of the current comment.\n *\n * @since 0.71\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n *\n * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's IP address.\n *                                   Default current comment.\n */\nfunction comment_author_IP( $comment_ID = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid\n\techo esc_html( get_comment_author_IP( $comment_ID ) );\n}\n\n/**\n * Retrieves the URL of the author of the current comment, not linked.\n *\n * @since 1.5.0\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n *\n * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's URL.\n *                                   Default current comment.\n * @return string Comment author URL, if provided, an empty string otherwise.\n */\nfunction get_comment_author_url( $comment_ID = 0 ) {\n\t$comment = get_comment( $comment_ID );\n\t$url     = '';\n\t$id      = 0;\n\n\tif ( ! empty( $comment ) ) {\n\t\t$author_url = ( 'http://' === $comment->comment_author_url ) ? '' : $comment->comment_author_url;\n\t\t$url        = esc_url( $author_url, array( 'http', 'https' ) );\n\t\t$id         = $comment->comment_ID;\n\t}\n\n\t/**\n\t * Filters the comment author's URL.\n\t *\n\t * @since 1.5.0\n\t * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.\n\t *\n\t * @param string     $url        The comment author's URL.\n\t * @param int        $comment_ID The comment ID.\n\t * @param WP_Comment $comment    The comment object.\n\t */\n\treturn apply_filters( 'get_comment_author_url', $url, $id, $comment );\n}\n\n/**\n * Displays the URL of the author of the current comment, not linked.\n *\n * @since 0.71\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n *\n * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's URL.\n *                                   Default current comment.\n */\nfunction comment_author_url( $comment_ID = 0 ) {\n\t$comment    = get_comment( $comment_ID );\n\t$author_url = get_comment_author_url( $comment );\n\n\t/**\n\t * Filters the comment author's URL for display.\n\t *\n\t * @since 1.2.0\n\t * @since 4.1.0 The `$comment_ID` parameter was added.\n\t *\n\t * @param string $author_url The comment author's URL.\n\t * @param int    $comment_ID The comment ID.\n\t */\n\techo apply_filters( 'comment_url', $author_url, $comment->comment_ID );\n}\n\n/**\n * Retrieves the HTML link of the URL of the author of the current comment.\n *\n * $linktext parameter is only used if the URL does not exist for the comment\n * author. If the URL does exist then the URL will be used and the $linktext\n * will be ignored.\n *\n * Encapsulate the HTML link between the $before and $after. So it will appear\n * in the order of $before, link, and finally $after.\n *\n * @since 1.5.0\n * @since 4.6.0 Added the `$comment` parameter.\n *\n * @param string         $linktext Optional. The text to display instead of the comment\n *                                 author's email address. Default empty.\n * @param string         $before   Optional. The text or HTML to display before the email link.\n *                                 Default empty.\n * @param string         $after    Optional. The text or HTML to display after the email link.\n *                                 Default empty.\n * @param int|WP_Comment $comment  Optional. Comment ID or WP_Comment object.\n *                                 Default is the current comment.\n * @return string The HTML link between the $before and $after parameters.\n */\nfunction get_comment_author_url_link( $linktext = '', $before = '', $after = '', $comment = 0 ) {\n\t$url     = get_comment_author_url( $comment );\n\t$display = ( '' !== $linktext ) ? $linktext : $url;\n\t$display = str_replace( 'http://www.', '', $display );\n\t$display = str_replace( 'http://', '', $display );\n\n\tif ( '/' === substr( $display, -1 ) ) {\n\t\t$display = substr( $display, 0, -1 );\n\t}\n\n\t$return = \"$before<a href='$url' rel='external'>$display</a>$after\";\n\n\t/**\n\t * Filters the comment author's returned URL link.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $return The HTML-formatted comment author URL link.\n\t */\n\treturn apply_filters( 'get_comment_author_url_link', $return );\n}\n\n/**\n * Displays the HTML link of the URL of the author of the current comment.\n *\n * @since 0.71\n * @since 4.6.0 Added the `$comment` parameter.\n *\n * @param string         $linktext Optional. Text to display instead of the comment author's\n *                                 email address. Default empty.\n * @param string         $before   Optional. Text or HTML to display before the email link.\n *                                 Default empty.\n * @param string         $after    Optional. Text or HTML to display after the email link.\n *                                 Default empty.\n * @param int|WP_Comment $comment  Optional. Comment ID or WP_Comment object.\n *                                 Default is the current comment.\n */\nfunction comment_author_url_link( $linktext = '', $before = '', $after = '', $comment = 0 ) {\n\techo get_comment_author_url_link( $linktext, $before, $after, $comment );\n}\n\n/**\n * Generates semantic classes for each comment element.\n *\n * @since 2.7.0\n * @since 4.4.0 Added the ability for `$comment` to also accept a WP_Comment object.\n *\n * @param string|array   $class    Optional. One or more classes to add to the class list.\n *                                 Default empty.\n * @param int|WP_Comment $comment  Comment ID or WP_Comment object. Default current comment.\n * @param int|WP_Post    $post_id  Post ID or WP_Post object. Default current post.\n * @param bool           $echo     Optional. Whether to echo or return the output.\n *                                 Default true.\n * @return void|string Void if `$echo` argument is true, comment classes if `$echo` is false.\n */\nfunction comment_class( $class = '', $comment = null, $post_id = null, $echo = true ) {\n\t// Separates classes with a single space, collates classes for comment DIV.\n\t$class = 'class=\"' . join( ' ', get_comment_class( $class, $comment, $post_id ) ) . '\"';\n\n\tif ( $echo ) {\n\t\techo $class;\n\t} else {\n\t\treturn $class;\n\t}\n}\n\n/**\n * Returns the classes for the comment div as an array.\n *\n * @since 2.7.0\n * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.\n *\n * @global int $comment_alt\n * @global int $comment_depth\n * @global int $comment_thread_alt\n *\n * @param string|array   $class      Optional. One or more classes to add to the class list. Default empty.\n * @param int|WP_Comment $comment_id Comment ID or WP_Comment object. Default current comment.\n * @param int|WP_Post    $post_id    Post ID or WP_Post object. Default current post.\n * @return string[] An array of classes.\n */\nfunction get_comment_class( $class = '', $comment_id = null, $post_id = null ) {\n\tglobal $comment_alt, $comment_depth, $comment_thread_alt;\n\n\t$classes = array();\n\n\t$comment = get_comment( $comment_id );\n\tif ( ! $comment ) {\n\t\treturn $classes;\n\t}\n\n\t// Get the comment type (comment, trackback).\n\t$classes[] = ( empty( $comment->comment_type ) ) ? 'comment' : $comment->comment_type;\n\n\t// Add classes for comment authors that are registered users.\n\t$user = $comment->user_id ? get_userdata( $comment->user_id ) : false;\n\tif ( $user ) {\n\t\t$classes[] = 'byuser';\n\t\t$classes[] = 'comment-author-' . sanitize_html_class( $user->user_nicename, $comment->user_id );\n\t\t// For comment authors who are the author of the post.\n\t\t$post = get_post( $post_id );\n\t\tif ( $post ) {\n\t\t\tif ( $comment->user_id === $post->post_author ) {\n\t\t\t\t$classes[] = 'bypostauthor';\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( empty( $comment_alt ) ) {\n\t\t$comment_alt = 0;\n\t}\n\tif ( empty( $comment_depth ) ) {\n\t\t$comment_depth = 1;\n\t}\n\tif ( empty( $comment_thread_alt ) ) {\n\t\t$comment_thread_alt = 0;\n\t}\n\n\tif ( $comment_alt % 2 ) {\n\t\t$classes[] = 'odd';\n\t\t$classes[] = 'alt';\n\t} else {\n\t\t$classes[] = 'even';\n\t}\n\n\t$comment_alt++;\n\n\t// Alt for top-level comments.\n\tif ( 1 == $comment_depth ) {\n\t\tif ( $comment_thread_alt % 2 ) {\n\t\t\t$classes[] = 'thread-odd';\n\t\t\t$classes[] = 'thread-alt';\n\t\t} else {\n\t\t\t$classes[] = 'thread-even';\n\t\t}\n\t\t$comment_thread_alt++;\n\t}\n\n\t$classes[] = \"depth-$comment_depth\";\n\n\tif ( ! empty( $class ) ) {\n\t\tif ( ! is_array( $class ) ) {\n\t\t\t$class = preg_split( '#\\s+#', $class );\n\t\t}\n\t\t$classes = array_merge( $classes, $class );\n\t}\n\n\t$classes = array_map( 'esc_attr', $classes );\n\n\t/**\n\t * Filters the returned CSS classes for the current comment.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string[]    $classes    An array of comment classes.\n\t * @param string      $class      A comma-separated list of additional classes added to the list.\n\t * @param int         $comment_id The comment ID.\n\t * @param WP_Comment  $comment    The comment object.\n\t * @param int|WP_Post $post_id    The post ID or WP_Post object.\n\t */\n\treturn apply_filters( 'comment_class', $classes, $class, $comment->comment_ID, $comment, $post_id );\n}\n\n/**\n * Retrieves the comment date of the current comment.\n *\n * @since 1.5.0\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n *\n * @param string         $format     Optional. The format of the date. Default user's setting.\n * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to get the date.\n *                                   Default current comment.\n * @return string The comment's date.\n */\nfunction get_comment_date( $format = '', $comment_ID = 0 ) {\n\t$comment = get_comment( $comment_ID );\n\n\t$_format = ! empty( $format ) ? $format : get_option( 'date_format' );\n\n\t$date = mysql2date( $_format, $comment->comment_date );\n\n\t/**\n\t * Filters the returned comment date.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string|int $date    Formatted date string or Unix timestamp.\n\t * @param string     $format  The format of the date.\n\t * @param WP_Comment $comment The comment object.\n\t */\n\treturn apply_filters( 'get_comment_date', $date, $format, $comment );\n}\n\n/**\n * Displays the comment date of the current comment.\n *\n * @since 0.71\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n *\n * @param string         $format     Optional. The format of the date. Default user's settings.\n * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to print the date.\n *                                   Default current comment.\n */\nfunction comment_date( $format = '', $comment_ID = 0 ) {\n\techo get_comment_date( $format, $comment_ID );\n}\n\n/**\n * Retrieves the excerpt of the given comment.\n *\n * Returns a maximum of 20 words with an ellipsis appended if necessary.\n *\n * @since 1.5.0\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n *\n * @param int|WP_Comment $comment_ID  WP_Comment or ID of the comment for which to get the excerpt.\n *                                    Default current comment.\n * @return string The possibly truncated comment excerpt.\n */\nfunction get_comment_excerpt( $comment_ID = 0 ) {\n\t$comment = get_comment( $comment_ID );\n\n\tif ( ! post_password_required( $comment->comment_post_ID ) ) {\n\t\t$comment_text = strip_tags( str_replace( array( \"\\n\", \"\\r\" ), ' ', $comment->comment_content ) );\n\t} else {\n\t\t$comment_text = __( 'Password protected' );\n\t}\n\n\t/* translators: Maximum number of words used in a comment excerpt. */\n\t$comment_excerpt_length = intval( _x( '20', 'comment_excerpt_length' ) );\n\n\t/**\n\t * Filters the maximum number of words used in the comment excerpt.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param int $comment_excerpt_length The amount of words you want to display in the comment excerpt.\n\t */\n\t$comment_excerpt_length = apply_filters( 'comment_excerpt_length', $comment_excerpt_length );\n\n\t$excerpt = wp_trim_words( $comment_text, $comment_excerpt_length, '&hellip;' );\n\n\t/**\n\t * Filters the retrieved comment excerpt.\n\t *\n\t * @since 1.5.0\n\t * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.\n\t *\n\t * @param string     $excerpt    The comment excerpt text.\n\t * @param int        $comment_ID The comment ID.\n\t * @param WP_Comment $comment    The comment object.\n\t */\n\treturn apply_filters( 'get_comment_excerpt', $excerpt, $comment->comment_ID, $comment );\n}\n\n/**\n * Displays the excerpt of the current comment.\n *\n * @since 1.2.0\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n *\n * @param int|WP_Comment $comment_ID  WP_Comment or ID of the comment for which to print the excerpt.\n *                                    Default current comment.\n */\nfunction comment_excerpt( $comment_ID = 0 ) {\n\t$comment         = get_comment( $comment_ID );\n\t$comment_excerpt = get_comment_excerpt( $comment );\n\n\t/**\n\t * Filters the comment excerpt for display.\n\t *\n\t * @since 1.2.0\n\t * @since 4.1.0 The `$comment_ID` parameter was added.\n\t *\n\t * @param string $comment_excerpt The comment excerpt text.\n\t * @param int    $comment_ID      The comment ID.\n\t */\n\techo apply_filters( 'comment_excerpt', $comment_excerpt, $comment->comment_ID );\n}\n\n/**\n * Retrieves the comment ID of the current comment.\n *\n * @since 1.5.0\n *\n * @return int The comment ID.\n */\nfunction get_comment_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid\n\t$comment = get_comment();\n\n\t/**\n\t * Filters the returned comment ID.\n\t *\n\t * @since 1.5.0\n\t * @since 4.1.0 The `$comment_ID` parameter was added.\n\t *\n\t * @param int        $comment_ID The current comment ID.\n\t * @param WP_Comment $comment    The comment object.\n\t */\n\treturn apply_filters( 'get_comment_ID', $comment->comment_ID, $comment );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase\n}\n\n/**\n * Displays the comment ID of the current comment.\n *\n * @since 0.71\n */\nfunction comment_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid\n\techo get_comment_ID();\n}\n\n/**\n * Retrieves the link to a given comment.\n *\n * @since 1.5.0\n * @since 4.4.0 Added the ability for `$comment` to also accept a WP_Comment object. Added `$cpage` argument.\n *\n * @see get_page_of_comment()\n *\n * @global WP_Rewrite $wp_rewrite      WordPress rewrite component.\n * @global bool       $in_comment_loop\n *\n * @param WP_Comment|int|null $comment Comment to retrieve. Default current comment.\n * @param array               $args {\n *     An array of optional arguments to override the defaults.\n *\n *     @type string     $type      Passed to get_page_of_comment().\n *     @type int        $page      Current page of comments, for calculating comment pagination.\n *     @type int        $per_page  Per-page value for comment pagination.\n *     @type int        $max_depth Passed to get_page_of_comment().\n *     @type int|string $cpage     Value to use for the comment's \"comment-page\" or \"cpage\" value.\n *                                 If provided, this value overrides any value calculated from `$page`\n *                                 and `$per_page`.\n * }\n * @return string The permalink to the given comment.\n */\nfunction get_comment_link( $comment = null, $args = array() ) {\n\tglobal $wp_rewrite, $in_comment_loop;\n\n\t$comment = get_comment( $comment );\n\n\t// Back-compat.\n\tif ( ! is_array( $args ) ) {\n\t\t$args = array( 'page' => $args );\n\t}\n\n\t$defaults = array(\n\t\t'type'      => 'all',\n\t\t'page'      => '',\n\t\t'per_page'  => '',\n\t\t'max_depth' => '',\n\t\t'cpage'     => null,\n\t);\n\t$args     = wp_parse_args( $args, $defaults );\n\n\t$link = get_permalink( $comment->comment_post_ID );\n\n\t// The 'cpage' param takes precedence.\n\tif ( ! is_null( $args['cpage'] ) ) {\n\t\t$cpage = $args['cpage'];\n\n\t\t// No 'cpage' is provided, so we calculate one.\n\t} else {\n\t\tif ( '' === $args['per_page'] && get_option( 'page_comments' ) ) {\n\t\t\t$args['per_page'] = get_option( 'comments_per_page' );\n\t\t}\n\n\t\tif ( empty( $args['per_page'] ) ) {\n\t\t\t$args['per_page'] = 0;\n\t\t\t$args['page']     = 0;\n\t\t}\n\n\t\t$cpage = $args['page'];\n\n\t\tif ( '' == $cpage ) {\n\t\t\tif ( ! empty( $in_comment_loop ) ) {\n\t\t\t\t$cpage = get_query_var( 'cpage' );\n\t\t\t} else {\n\t\t\t\t// Requires a database hit, so we only do it when we can't figure out from context.\n\t\t\t\t$cpage = get_page_of_comment( $comment->comment_ID, $args );\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * If the default page displays the oldest comments, the permalinks for comments on the default page\n\t\t * do not need a 'cpage' query var.\n\t\t */\n\t\tif ( 'oldest' === get_option( 'default_comments_page' ) && 1 === $cpage ) {\n\t\t\t$cpage = '';\n\t\t}\n\t}\n\n\tif ( $cpage && get_option( 'page_comments' ) ) {\n\t\tif ( $wp_rewrite->using_permalinks() ) {\n\t\t\tif ( $cpage ) {\n\t\t\t\t$link = trailingslashit( $link ) . $wp_rewrite->comments_pagination_base . '-' . $cpage;\n\t\t\t}\n\n\t\t\t$link = user_trailingslashit( $link, 'comment' );\n\t\t} elseif ( $cpage ) {\n\t\t\t$link = add_query_arg( 'cpage', $cpage, $link );\n\t\t}\n\t}\n\n\tif ( $wp_rewrite->using_permalinks() ) {\n\t\t$link = user_trailingslashit( $link, 'comment' );\n\t}\n\n\t$link = $link . '#comment-' . $comment->comment_ID;\n\n\t/**\n\t * Filters the returned single comment permalink.\n\t *\n\t * @since 2.8.0\n\t * @since 4.4.0 Added the `$cpage` parameter.\n\t *\n\t * @see get_page_of_comment()\n\t *\n\t * @param string     $link    The comment permalink with '#comment-$id' appended.\n\t * @param WP_Comment $comment The current comment object.\n\t * @param array      $args    An array of arguments to override the defaults.\n\t * @param int        $cpage   The calculated 'cpage' value.\n\t */\n\treturn apply_filters( 'get_comment_link', $link, $comment, $args, $cpage );\n}\n\n/**\n * Retrieves the link to the current post comments.\n *\n * @since 1.5.0\n *\n * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.\n * @return string The link to the comments.\n */\nfunction get_comments_link( $post_id = 0 ) {\n\t$hash          = get_comments_number( $post_id ) ? '#comments' : '#respond';\n\t$comments_link = get_permalink( $post_id ) . $hash;\n\n\t/**\n\t * Filters the returned post comments permalink.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param string      $comments_link Post comments permalink with '#comments' appended.\n\t * @param int|WP_Post $post_id       Post ID or WP_Post object.\n\t */\n\treturn apply_filters( 'get_comments_link', $comments_link, $post_id );\n}\n\n/**\n * Displays the link to the current post comments.\n *\n * @since 0.71\n *\n * @param string $deprecated   Not Used.\n * @param string $deprecated_2 Not Used.\n */\nfunction comments_link( $deprecated = '', $deprecated_2 = '' ) {\n\tif ( ! empty( $deprecated ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '0.72' );\n\t}\n\tif ( ! empty( $deprecated_2 ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '1.3.0' );\n\t}\n\techo esc_url( get_comments_link() );\n}\n\n/**\n * Retrieves the amount of comments a post has.\n *\n * @since 1.5.0\n *\n * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is the global `$post`.\n * @return string|int If the post exists, a numeric string representing the number of comments\n *                    the post has, otherwise 0.\n */\nfunction get_comments_number( $post_id = 0 ) {\n\t$post = get_post( $post_id );\n\n\tif ( ! $post ) {\n\t\t$count = 0;\n\t} else {\n\t\t$count   = $post->comment_count;\n\t\t$post_id = $post->ID;\n\t}\n\n\t/**\n\t * Filters the returned comment count for a post.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string|int $count   A string representing the number of comments a post has, otherwise 0.\n\t * @param int        $post_id Post ID.\n\t */\n\treturn apply_filters( 'get_comments_number', $count, $post_id );\n}\n\n/**\n * Displays the language string for the number of comments the current post has.\n *\n * @since 0.71\n * @since 5.4.0 The `$deprecated` parameter was changed to `$post_id`.\n *\n * @param string      $zero       Optional. Text for no comments. Default false.\n * @param string      $one        Optional. Text for one comment. Default false.\n * @param string      $more       Optional. Text for more than one comment. Default false.\n * @param int|WP_Post $post_id    Optional. Post ID or WP_Post object. Default is the global `$post`.\n */\nfunction comments_number( $zero = false, $one = false, $more = false, $post_id = 0 ) {\n\techo get_comments_number_text( $zero, $one, $more, $post_id );\n}\n\n/**\n * Displays the language string for the number of comments the current post has.\n *\n * @since 4.0.0\n * @since 5.4.0 Added the `$post_id` parameter to allow using the function outside of the loop.\n *\n * @param string      $zero    Optional. Text for no comments. Default false.\n * @param string      $one     Optional. Text for one comment. Default false.\n * @param string      $more    Optional. Text for more than one comment. Default false.\n * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is the global `$post`.\n * @return string Language string for the number of comments a post has.\n */\nfunction get_comments_number_text( $zero = false, $one = false, $more = false, $post_id = 0 ) {\n\t$number = get_comments_number( $post_id );\n\n\tif ( $number > 1 ) {\n\t\tif ( false === $more ) {\n\t\t\t/* translators: %s: Number of comments. */\n\t\t\t$output = sprintf( _n( '%s Comment', '%s Comments', $number ), number_format_i18n( $number ) );\n\t\t} else {\n\t\t\t// % Comments\n\t\t\t/*\n\t\t\t * translators: If comment number in your language requires declension,\n\t\t\t * translate this to 'on'. Do not translate into your own language.\n\t\t\t */\n\t\t\tif ( 'on' === _x( 'off', 'Comment number declension: on or off' ) ) {\n\t\t\t\t$text = preg_replace( '#<span class=\"screen-reader-text\">.+?</span>#', '', $more );\n\t\t\t\t$text = preg_replace( '/&.+?;/', '', $text ); // Kill entities.\n\t\t\t\t$text = trim( strip_tags( $text ), '% ' );\n\n\t\t\t\t// Replace '% Comments' with a proper plural form.\n\t\t\t\tif ( $text && ! preg_match( '/[0-9]+/', $text ) && false !== strpos( $more, '%' ) ) {\n\t\t\t\t\t/* translators: %s: Number of comments. */\n\t\t\t\t\t$new_text = _n( '%s Comment', '%s Comments', $number );\n\t\t\t\t\t$new_text = trim( sprintf( $new_text, '' ) );\n\n\t\t\t\t\t$more = str_replace( $text, $new_text, $more );\n\t\t\t\t\tif ( false === strpos( $more, '%' ) ) {\n\t\t\t\t\t\t$more = '% ' . $more;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$output = str_replace( '%', number_format_i18n( $number ), $more );\n\t\t}\n\t} elseif ( 0 == $number ) {\n\t\t$output = ( false === $zero ) ? __( 'No Comments' ) : $zero;\n\t} else { // Must be one.\n\t\t$output = ( false === $one ) ? __( '1 Comment' ) : $one;\n\t}\n\t/**\n\t * Filters the comments count for display.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @see _n()\n\t *\n\t * @param string $output A translatable string formatted based on whether the count\n\t *                       is equal to 0, 1, or 1+.\n\t * @param int    $number The number of post comments.\n\t */\n\treturn apply_filters( 'comments_number', $output, $number );\n}\n\n/**\n * Retrieves the text of the current comment.\n *\n * @since 1.5.0\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n * @since 5.4.0 Added 'In reply to %s.' prefix to child comments in comments feed.\n *\n * @see Walker_Comment::comment()\n *\n * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to get the text.\n *                                   Default current comment.\n * @param array          $args       Optional. An array of arguments. Default empty array.\n * @return string The comment content.\n */\nfunction get_comment_text( $comment_ID = 0, $args = array() ) {\n\t$comment = get_comment( $comment_ID );\n\n\t$comment_content = $comment->comment_content;\n\n\tif ( is_comment_feed() && $comment->comment_parent ) {\n\t\t$parent = get_comment( $comment->comment_parent );\n\t\tif ( $parent ) {\n\t\t\t$parent_link = esc_url( get_comment_link( $parent ) );\n\t\t\t$name        = get_comment_author( $parent );\n\n\t\t\t$comment_content = sprintf(\n\t\t\t\t/* translators: %s: Comment link. */\n\t\t\t\tent2ncr( __( 'In reply to %s.' ) ),\n\t\t\t\t'<a href=\"' . $parent_link . '\">' . $name . '</a>'\n\t\t\t) . \"\\n\\n\" . $comment_content;\n\t\t}\n\t}\n\n\t/**\n\t * Filters the text of a comment.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @see Walker_Comment::comment()\n\t *\n\t * @param string     $comment_content Text of the comment.\n\t * @param WP_Comment $comment         The comment object.\n\t * @param array      $args            An array of arguments.\n\t */\n\treturn apply_filters( 'get_comment_text', $comment_content, $comment, $args );\n}\n\n/**\n * Displays the text of the current comment.\n *\n * @since 0.71\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n *\n * @see Walker_Comment::comment()\n *\n * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to print the text.\n *                                   Default current comment.\n * @param array          $args       Optional. An array of arguments. Default empty array.\n */\nfunction comment_text( $comment_ID = 0, $args = array() ) {\n\t$comment = get_comment( $comment_ID );\n\n\t$comment_text = get_comment_text( $comment, $args );\n\t/**\n\t * Filters the text of a comment to be displayed.\n\t *\n\t * @since 1.2.0\n\t *\n\t * @see Walker_Comment::comment()\n\t *\n\t * @param string          $comment_text Text of the current comment.\n\t * @param WP_Comment|null $comment      The comment object. Null if not found.\n\t * @param array           $args         An array of arguments.\n\t */\n\techo apply_filters( 'comment_text', $comment_text, $comment, $args );\n}\n\n/**\n * Retrieves the comment time of the current comment.\n *\n * @since 1.5.0\n *\n * @param string $format    Optional. The format of the time. Default user's settings.\n * @param bool   $gmt       Optional. Whether to use the GMT date. Default false.\n * @param bool   $translate Optional. Whether to translate the time (for use in feeds).\n *                          Default true.\n * @return string The formatted time.\n */\nfunction get_comment_time( $format = '', $gmt = false, $translate = true ) {\n\t$comment = get_comment();\n\n\t$comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date;\n\n\t$_format = ! empty( $format ) ? $format : get_option( 'time_format' );\n\n\t$date = mysql2date( $_format, $comment_date, $translate );\n\n\t/**\n\t * Filters the returned comment time.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string|int $date      The comment time, formatted as a date string or Unix timestamp.\n\t * @param string     $format    Date format.\n\t * @param bool       $gmt       Whether the GMT date is in use.\n\t * @param bool       $translate Whether the time is translated.\n\t * @param WP_Comment $comment   The comment object.\n\t */\n\treturn apply_filters( 'get_comment_time', $date, $format, $gmt, $translate, $comment );\n}\n\n/**\n * Displays the comment time of the current comment.\n *\n * @since 0.71\n *\n * @param string $format Optional. The format of the time. Default user's settings.\n */\nfunction comment_time( $format = '' ) {\n\techo get_comment_time( $format );\n}\n\n/**\n * Retrieves the comment type of the current comment.\n *\n * @since 1.5.0\n * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.\n *\n * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the type.\n *                                   Default current comment.\n * @return string The comment type.\n */\nfunction get_comment_type( $comment_ID = 0 ) {\n\t$comment = get_comment( $comment_ID );\n\n\tif ( '' === $comment->comment_type ) {\n\t\t$comment->comment_type = 'comment';\n\t}\n\n\t/**\n\t * Filters the returned comment type.\n\t *\n\t * @since 1.5.0\n\t * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.\n\t *\n\t * @param string     $comment_type The type of comment, such as 'comment', 'pingback', or 'trackback'.\n\t * @param int        $comment_ID   The comment ID.\n\t * @param WP_Comment $comment      The comment object.\n\t */\n\treturn apply_filters( 'get_comment_type', $comment->comment_type, $comment->comment_ID, $comment );\n}\n\n/**\n * Displays the comment type of the current comment.\n *\n * @since 0.71\n *\n * @param string $commenttxt   Optional. String to display for comment type. Default false.\n * @param string $trackbacktxt Optional. String to display for trackback type. Default false.\n * @param string $pingbacktxt  Optional. String to display for pingback type. Default false.\n */\nfunction comment_type( $commenttxt = false, $trackbacktxt = false, $pingbacktxt = false ) {\n\tif ( false === $commenttxt ) {\n\t\t$commenttxt = _x( 'Comment', 'noun' );\n\t}\n\tif ( false === $trackbacktxt ) {\n\t\t$trackbacktxt = __( 'Trackback' );\n\t}\n\tif ( false === $pingbacktxt ) {\n\t\t$pingbacktxt = __( 'Pingback' );\n\t}\n\t$type = get_comment_type();\n\tswitch ( $type ) {\n\t\tcase 'trackback':\n\t\t\techo $trackbacktxt;\n\t\t\tbreak;\n\t\tcase 'pingback':\n\t\t\techo $pingbacktxt;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\techo $commenttxt;\n\t}\n}\n\n/**\n * Retrieves the current post's trackback URL.\n *\n * There is a check to see if permalink's have been enabled and if so, will\n * retrieve the pretty path. If permalinks weren't enabled, the ID of the\n * current post is used and appended to the correct page to go to.\n *\n * @since 1.5.0\n *\n * @return string The trackback URL after being filtered.\n */\nfunction get_trackback_url() {\n\tif ( get_option( 'permalink_structure' ) ) {\n\t\t$tb_url = trailingslashit( get_permalink() ) . user_trailingslashit( 'trackback', 'single_trackback' );\n\t} else {\n\t\t$tb_url = get_option( 'siteurl' ) . '/wp-trackback.php?p=' . get_the_ID();\n\t}\n\n\t/**\n\t * Filters the returned trackback URL.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @param string $tb_url The trackback URL.\n\t */\n\treturn apply_filters( 'trackback_url', $tb_url );\n}\n\n/**\n * Displays the current post's trackback URL.\n *\n * @since 0.71\n *\n * @param bool $deprecated_echo Not used.\n * @return void|string Should only be used to echo the trackback URL, use get_trackback_url()\n *                     for the result instead.\n */\nfunction trackback_url( $deprecated_echo = true ) {\n\tif ( true !== $deprecated_echo ) {\n\t\t_deprecated_argument(\n\t\t\t__FUNCTION__,\n\t\t\t'2.5.0',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: get_trackback_url() */\n\t\t\t\t__( 'Use %s instead if you do not want the value echoed.' ),\n\t\t\t\t'<code>get_trackback_url()</code>'\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( $deprecated_echo ) {\n\t\techo get_trackback_url();\n\t} else {\n\t\treturn get_trackback_url();\n\t}\n}\n\n/**\n * Generates and displays the RDF for the trackback information of current post.\n *\n * Deprecated in 3.0.0, and restored in 3.0.1.\n *\n * @since 0.71\n *\n * @param int $deprecated Not used (Was $timezone = 0).\n */\nfunction trackback_rdf( $deprecated = '' ) {\n\tif ( ! empty( $deprecated ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '2.5.0' );\n\t}\n\n\tif ( isset( $_SERVER['HTTP_USER_AGENT'] ) && false !== stripos( $_SERVER['HTTP_USER_AGENT'], 'W3C_Validator' ) ) {\n\t\treturn;\n\t}\n\n\techo '<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n\t\t\txmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n\t\t\txmlns:trackback=\"http://madskills.com/public/xml/rss/module/trackback/\">\n\t\t<rdf:Description rdf:about=\"';\n\tthe_permalink();\n\techo '\"' . \"\\n\";\n\techo '    dc:identifier=\"';\n\tthe_permalink();\n\techo '\"' . \"\\n\";\n\techo '    dc:title=\"' . str_replace( '--', '&#x2d;&#x2d;', wptexturize( strip_tags( get_the_title() ) ) ) . '\"' . \"\\n\";\n\techo '    trackback:ping=\"' . get_trackback_url() . '\"' . \" />\\n\";\n\techo '</rdf:RDF>';\n}\n\n/**\n * Determines whether the current post is open for comments.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n *\n * @param int|WP_Post $post_id Post ID or WP_Post object. Default current post.\n * @return bool True if the comments are open.\n */\nfunction comments_open( $post_id = null ) {\n\n\t$_post = get_post( $post_id );\n\n\t$post_id = $_post ? $_post->ID : 0;\n\t$open    = ( 'open' === $_post->comment_status );\n\n\t/**\n\t * Filters whether the current post is open for comments.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param bool $open    Whether the current post is open for comments.\n\t * @param int  $post_id The post ID.\n\t */\n\treturn apply_filters( 'comments_open', $open, $post_id );\n}\n\n/**\n * Determines whether the current post is open for pings.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n *\n * @param int|WP_Post $post_id Post ID or WP_Post object. Default current post.\n * @return bool True if pings are accepted\n */\nfunction pings_open( $post_id = null ) {\n\n\t$_post = get_post( $post_id );\n\n\t$post_id = $_post ? $_post->ID : 0;\n\t$open    = ( 'open' === $_post->ping_status );\n\n\t/**\n\t * Filters whether the current post is open for pings.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param bool $open    Whether the current post is open for pings.\n\t * @param int  $post_id The post ID.\n\t */\n\treturn apply_filters( 'pings_open', $open, $post_id );\n}\n\n/**\n * Displays form token for unfiltered comments.\n *\n * Will only display nonce token if the current user has permissions for\n * unfiltered html. Won't display the token for other users.\n *\n * The function was backported to 2.0.10 and was added to versions 2.1.3 and\n * above. Does not exist in versions prior to 2.0.10 in the 2.0 branch and in\n * the 2.1 branch, prior to 2.1.3. Technically added in 2.2.0.\n *\n * Backported to 2.0.10.\n *\n * @since 2.1.3\n */\nfunction wp_comment_form_unfiltered_html_nonce() {\n\t$post    = get_post();\n\t$post_id = $post ? $post->ID : 0;\n\n\tif ( current_user_can( 'unfiltered_html' ) ) {\n\t\twp_nonce_field( 'unfiltered-html-comment_' . $post_id, '_wp_unfiltered_html_comment_disabled', false );\n\t\techo \"<script>(function(){if(window===window.parent){document.getElementById('_wp_unfiltered_html_comment_disabled').name='_wp_unfiltered_html_comment';}})();</script>\\n\";\n\t}\n}\n\n/**\n * Loads the comment template specified in $file.\n *\n * Will not display the comments template if not on single post or page, or if\n * the post does not have comments.\n *\n * Uses the WordPress database object to query for the comments. The comments\n * are passed through the {@see 'comments_array'} filter hook with the list of comments\n * and the post ID respectively.\n *\n * The `$file` path is passed through a filter hook called {@see 'comments_template'},\n * which includes the TEMPLATEPATH and $file combined. Tries the $filtered path\n * first and if it fails it will require the default comment template from the\n * default theme. If either does not exist, then the WordPress process will be\n * halted. It is advised for that reason, that the default theme is not deleted.\n *\n * Will not try to get the comments if the post has none.\n *\n * @since 1.5.0\n *\n * @global WP_Query   $wp_query         WordPress Query object.\n * @global WP_Post    $post             Global post object.\n * @global wpdb       $wpdb             WordPress database abstraction object.\n * @global int        $id\n * @global WP_Comment $comment          Global comment object.\n * @global string     $user_login\n * @global string     $user_identity\n * @global bool       $overridden_cpage\n * @global bool       $withcomments\n *\n * @param string $file              Optional. The file to load. Default '/comments.php'.\n * @param bool   $separate_comments Optional. Whether to separate the comments by comment type.\n *                                  Default false.\n */\nfunction comments_template( $file = '/comments.php', $separate_comments = false ) {\n\tglobal $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_identity, $overridden_cpage;\n\n\tif ( ! ( is_single() || is_page() || $withcomments ) || empty( $post ) ) {\n\t\treturn;\n\t}\n\n\tif ( empty( $file ) ) {\n\t\t$file = '/comments.php';\n\t}\n\n\t$req = get_option( 'require_name_email' );\n\n\t/*\n\t * Comment author information fetched from the comment cookies.\n\t */\n\t$commenter = wp_get_current_commenter();\n\n\t/*\n\t * The name of the current comment author escaped for use in attributes.\n\t * Escaped by sanitize_comment_cookies().\n\t */\n\t$comment_author = $commenter['comment_author'];\n\n\t/*\n\t * The email address of the current comment author escaped for use in attributes.\n\t * Escaped by sanitize_comment_cookies().\n\t */\n\t$comment_author_email = $commenter['comment_author_email'];\n\n\t/*\n\t * The URL of the current comment author escaped for use in attributes.\n\t */\n\t$comment_author_url = esc_url( $commenter['comment_author_url'] );\n\n\t$comment_args = array(\n\t\t'orderby'                   => 'comment_date_gmt',\n\t\t'order'                     => 'ASC',\n\t\t'status'                    => 'approve',\n\t\t'post_id'                   => $post->ID,\n\t\t'no_found_rows'             => false,\n\t\t'update_comment_meta_cache' => false, // We lazy-load comment meta for performance.\n\t);\n\n\tif ( get_option( 'thread_comments' ) ) {\n\t\t$comment_args['hierarchical'] = 'threaded';\n\t} else {\n\t\t$comment_args['hierarchical'] = false;\n\t}\n\n\tif ( is_user_logged_in() ) {\n\t\t$comment_args['include_unapproved'] = array( get_current_user_id() );\n\t} else {\n\t\t$unapproved_email = wp_get_unapproved_comment_author_email();\n\n\t\tif ( $unapproved_email ) {\n\t\t\t$comment_args['include_unapproved'] = array( $unapproved_email );\n\t\t}\n\t}\n\n\t$per_page = 0;\n\tif ( get_option( 'page_comments' ) ) {\n\t\t$per_page = (int) get_query_var( 'comments_per_page' );\n\t\tif ( 0 === $per_page ) {\n\t\t\t$per_page = (int) get_option( 'comments_per_page' );\n\t\t}\n\n\t\t$comment_args['number'] = $per_page;\n\t\t$page                   = (int) get_query_var( 'cpage' );\n\n\t\tif ( $page ) {\n\t\t\t$comment_args['offset'] = ( $page - 1 ) * $per_page;\n\t\t} elseif ( 'oldest' === get_option( 'default_comments_page' ) ) {\n\t\t\t$comment_args['offset'] = 0;\n\t\t} else {\n\t\t\t// If fetching the first page of 'newest', we need a top-level comment count.\n\t\t\t$top_level_query = new WP_Comment_Query();\n\t\t\t$top_level_args  = array(\n\t\t\t\t'count'   => true,\n\t\t\t\t'orderby' => false,\n\t\t\t\t'post_id' => $post->ID,\n\t\t\t\t'status'  => 'approve',\n\t\t\t);\n\n\t\t\tif ( $comment_args['hierarchical'] ) {\n\t\t\t\t$top_level_args['parent'] = 0;\n\t\t\t}\n\n\t\t\tif ( isset( $comment_args['include_unapproved'] ) ) {\n\t\t\t\t$top_level_args['include_unapproved'] = $comment_args['include_unapproved'];\n\t\t\t}\n\n\t\t\t$top_level_count = $top_level_query->query( $top_level_args );\n\n\t\t\t$comment_args['offset'] = ( ceil( $top_level_count / $per_page ) - 1 ) * $per_page;\n\t\t}\n\t}\n\n\t/**\n\t * Filters the arguments used to query comments in comments_template().\n\t *\n\t * @since 4.5.0\n\t *\n\t * @see WP_Comment_Query::__construct()\n\t *\n\t * @param array $comment_args {\n\t *     Array of WP_Comment_Query arguments.\n\t *\n\t *     @type string|array $orderby                   Field(s) to order by.\n\t *     @type string       $order                     Order of results. Accepts 'ASC' or 'DESC'.\n\t *     @type string       $status                    Comment status.\n\t *     @type array        $include_unapproved        Array of IDs or email addresses whose unapproved comments\n\t *                                                   will be included in results.\n\t *     @type int          $post_id                   ID of the post.\n\t *     @type bool         $no_found_rows             Whether to refrain from querying for found rows.\n\t *     @type bool         $update_comment_meta_cache Whether to prime cache for comment meta.\n\t *     @type bool|string  $hierarchical              Whether to query for comments hierarchically.\n\t *     @type int          $offset                    Comment offset.\n\t *     @type int          $number                    Number of comments to fetch.\n\t * }\n\t */\n\t$comment_args  = apply_filters( 'comments_template_query_args', $comment_args );\n\t$comment_query = new WP_Comment_Query( $comment_args );\n\t$_comments     = $comment_query->comments;\n\n\t// Trees must be flattened before they're passed to the walker.\n\tif ( $comment_args['hierarchical'] ) {\n\t\t$comments_flat = array();\n\t\tforeach ( $_comments as $_comment ) {\n\t\t\t$comments_flat[]  = $_comment;\n\t\t\t$comment_children = $_comment->get_children(\n\t\t\t\tarray(\n\t\t\t\t\t'format'  => 'flat',\n\t\t\t\t\t'status'  => $comment_args['status'],\n\t\t\t\t\t'orderby' => $comment_args['orderby'],\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tforeach ( $comment_children as $comment_child ) {\n\t\t\t\t$comments_flat[] = $comment_child;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$comments_flat = $_comments;\n\t}\n\n\t/**\n\t * Filters the comments array.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param array $comments Array of comments supplied to the comments template.\n\t * @param int   $post_ID  Post ID.\n\t */\n\t$wp_query->comments = apply_filters( 'comments_array', $comments_flat, $post->ID );\n\n\t$comments                        = &$wp_query->comments;\n\t$wp_query->comment_count         = count( $wp_query->comments );\n\t$wp_query->max_num_comment_pages = $comment_query->max_num_pages;\n\n\tif ( $separate_comments ) {\n\t\t$wp_query->comments_by_type = separate_comments( $comments );\n\t\t$comments_by_type           = &$wp_query->comments_by_type;\n\t} else {\n\t\t$wp_query->comments_by_type = array();\n\t}\n\n\t$overridden_cpage = false;\n\n\tif ( '' == get_query_var( 'cpage' ) && $wp_query->max_num_comment_pages > 1 ) {\n\t\tset_query_var( 'cpage', 'newest' === get_option( 'default_comments_page' ) ? get_comment_pages_count() : 1 );\n\t\t$overridden_cpage = true;\n\t}\n\n\tif ( ! defined( 'COMMENTS_TEMPLATE' ) ) {\n\t\tdefine( 'COMMENTS_TEMPLATE', true );\n\t}\n\n\t$theme_template = STYLESHEETPATH . $file;\n\n\t/**\n\t * Filters the path to the theme template file used for the comments template.\n\t *\n\t * @since 1.5.1\n\t *\n\t * @param string $theme_template The path to the theme template file.\n\t */\n\t$include = apply_filters( 'comments_template', $theme_template );\n\n\tif ( file_exists( $include ) ) {\n\t\trequire $include;\n\t} elseif ( file_exists( TEMPLATEPATH . $file ) ) {\n\t\trequire TEMPLATEPATH . $file;\n\t} else { // Backward compat code will be removed in a future release.\n\t\trequire ABSPATH . WPINC . '/theme-compat/comments.php';\n\t}\n}\n\n/**\n * Displays the link to the comments for the current post ID.\n *\n * @since 0.71\n *\n * @param false|string $zero      Optional. String to display when no comments. Default false.\n * @param false|string $one       Optional. String to display when only one comment is available. Default false.\n * @param false|string $more      Optional. String to display when there are more than one comment. Default false.\n * @param string       $css_class Optional. CSS class to use for comments. Default empty.\n * @param false|string $none      Optional. String to display when comments have been turned off. Default false.\n */\nfunction comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) {\n\t$post_id    = get_the_ID();\n\t$post_title = get_the_title();\n\t$number     = get_comments_number( $post_id );\n\n\tif ( false === $zero ) {\n\t\t/* translators: %s: Post title. */\n\t\t$zero = sprintf( __( 'No Comments<span class=\"screen-reader-text\"> on %s</span>' ), $post_title );\n\t}\n\n\tif ( false === $one ) {\n\t\t/* translators: %s: Post title. */\n\t\t$one = sprintf( __( '1 Comment<span class=\"screen-reader-text\"> on %s</span>' ), $post_title );\n\t}\n\n\tif ( false === $more ) {\n\t\t/* translators: 1: Number of comments, 2: Post title. */\n\t\t$more = _n( '%1$s Comment<span class=\"screen-reader-text\"> on %2$s</span>', '%1$s Comments<span class=\"screen-reader-text\"> on %2$s</span>', $number );\n\t\t$more = sprintf( $more, number_format_i18n( $number ), $post_title );\n\t}\n\n\tif ( false === $none ) {\n\t\t/* translators: %s: Post title. */\n\t\t$none = sprintf( __( 'Comments Off<span class=\"screen-reader-text\"> on %s</span>' ), $post_title );\n\t}\n\n\tif ( 0 == $number && ! comments_open() && ! pings_open() ) {\n\t\techo '<span' . ( ( ! empty( $css_class ) ) ? ' class=\"' . esc_attr( $css_class ) . '\"' : '' ) . '>' . $none . '</span>';\n\t\treturn;\n\t}\n\n\tif ( post_password_required() ) {\n\t\t_e( 'Enter your password to view comments.' );\n\t\treturn;\n\t}\n\n\techo '<a href=\"';\n\tif ( 0 == $number ) {\n\t\t$respond_link = get_permalink() . '#respond';\n\t\t/**\n\t\t * Filters the respond link when a post has no comments.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string $respond_link The default response link.\n\t\t * @param int    $post_id      The post ID.\n\t\t */\n\t\techo apply_filters( 'respond_link', $respond_link, $post_id );\n\t} else {\n\t\tcomments_link();\n\t}\n\techo '\"';\n\n\tif ( ! empty( $css_class ) ) {\n\t\techo ' class=\"' . $css_class . '\" ';\n\t}\n\n\t$attributes = '';\n\t/**\n\t * Filters the comments link attributes for display.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $attributes The comments link attributes. Default empty.\n\t */\n\techo apply_filters( 'comments_popup_link_attributes', $attributes );\n\n\techo '>';\n\tcomments_number( $zero, $one, $more );\n\techo '</a>';\n}\n\n/**\n * Retrieves HTML content for reply to comment link.\n *\n * @since 2.7.0\n * @since 4.4.0 Added the ability for `$comment` to also accept a WP_Comment object.\n *\n * @param array          $args {\n *     Optional. Override default arguments.\n *\n *     @type string $add_below  The first part of the selector used to identify the comment to respond below.\n *                              The resulting value is passed as the first parameter to addComment.moveForm(),\n *                              concatenated as $add_below-$comment->comment_ID. Default 'comment'.\n *     @type string $respond_id The selector identifying the responding comment. Passed as the third parameter\n *                              to addComment.moveForm(), and appended to the link URL as a hash value.\n *                              Default 'respond'.\n *     @type string $reply_text The text of the Reply link. Default 'Reply'.\n *     @type string $login_text The text of the link to reply if logged out. Default 'Log in to Reply'.\n *     @type int    $max_depth  The max depth of the comment tree. Default 0.\n *     @type int    $depth      The depth of the new comment. Must be greater than 0 and less than the value\n *                              of the 'thread_comments_depth' option set in Settings > Discussion. Default 0.\n *     @type string $before     The text or HTML to add before the reply link. Default empty.\n *     @type string $after      The text or HTML to add after the reply link. Default empty.\n * }\n * @param int|WP_Comment $comment Comment being replied to. Default current comment.\n * @param int|WP_Post    $post    Post ID or WP_Post object the comment is going to be displayed on.\n *                                Default current post.\n * @return string|false|null Link to show comment form, if successful. False, if comments are closed.\n */\nfunction get_comment_reply_link( $args = array(), $comment = null, $post = null ) {\n\t$defaults = array(\n\t\t'add_below'     => 'comment',\n\t\t'respond_id'    => 'respond',\n\t\t'reply_text'    => __( 'Reply' ),\n\t\t/* translators: Comment reply button text. %s: Comment author name. */\n\t\t'reply_to_text' => __( 'Reply to %s' ),\n\t\t'login_text'    => __( 'Log in to Reply' ),\n\t\t'max_depth'     => 0,\n\t\t'depth'         => 0,\n\t\t'before'        => '',\n\t\t'after'         => '',\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\tif ( 0 == $args['depth'] || $args['max_depth'] <= $args['depth'] ) {\n\t\treturn;\n\t}\n\n\t$comment = get_comment( $comment );\n\n\tif ( empty( $comment ) ) {\n\t\treturn;\n\t}\n\n\tif ( empty( $post ) ) {\n\t\t$post = $comment->comment_post_ID;\n\t}\n\n\t$post = get_post( $post );\n\n\tif ( ! comments_open( $post->ID ) ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Filters the comment reply link arguments.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param array      $args    Comment reply link arguments. See get_comment_reply_link()\n\t *                            for more information on accepted arguments.\n\t * @param WP_Comment $comment The object of the comment being replied to.\n\t * @param WP_Post    $post    The WP_Post object.\n\t */\n\t$args = apply_filters( 'comment_reply_link_args', $args, $comment, $post );\n\n\tif ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) {\n\t\t$link = sprintf(\n\t\t\t'<a rel=\"nofollow\" class=\"comment-reply-login\" href=\"%s\">%s</a>',\n\t\t\tesc_url( wp_login_url( get_permalink() ) ),\n\t\t\t$args['login_text']\n\t\t);\n\t} else {\n\t\t$data_attributes = array(\n\t\t\t'commentid'      => $comment->comment_ID,\n\t\t\t'postid'         => $post->ID,\n\t\t\t'belowelement'   => $args['add_below'] . '-' . $comment->comment_ID,\n\t\t\t'respondelement' => $args['respond_id'],\n\t\t\t'replyto'        => sprintf( $args['reply_to_text'], $comment->comment_author ),\n\t\t);\n\n\t\t$data_attribute_string = '';\n\n\t\tforeach ( $data_attributes as $name => $value ) {\n\t\t\t$data_attribute_string .= \" data-${name}=\\\"\" . esc_attr( $value ) . '\"';\n\t\t}\n\n\t\t$data_attribute_string = trim( $data_attribute_string );\n\n\t\t$link = sprintf(\n\t\t\t\"<a rel='nofollow' class='comment-reply-link' href='%s' %s aria-label='%s'>%s</a>\",\n\t\t\tesc_url(\n\t\t\t\tadd_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'replytocom'      => $comment->comment_ID,\n\t\t\t\t\t\t'unapproved'      => false,\n\t\t\t\t\t\t'moderation-hash' => false,\n\t\t\t\t\t),\n\t\t\t\t\tget_permalink( $post->ID )\n\t\t\t\t)\n\t\t\t) . '#' . $args['respond_id'],\n\t\t\t$data_attribute_string,\n\t\t\tesc_attr( sprintf( $args['reply_to_text'], $comment->comment_author ) ),\n\t\t\t$args['reply_text']\n\t\t);\n\t}\n\n\t/**\n\t * Filters the comment reply link.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string     $link    The HTML markup for the comment reply link.\n\t * @param array      $args    An array of arguments overriding the defaults.\n\t * @param WP_Comment $comment The object of the comment being replied.\n\t * @param WP_Post    $post    The WP_Post object.\n\t */\n\treturn apply_filters( 'comment_reply_link', $args['before'] . $link . $args['after'], $args, $comment, $post );\n}\n\n/**\n * Displays the HTML content for reply to comment link.\n *\n * @since 2.7.0\n *\n * @see get_comment_reply_link()\n *\n * @param array          $args    Optional. Override default options. Default empty array.\n * @param int|WP_Comment $comment Comment being replied to. Default current comment.\n * @param int|WP_Post    $post    Post ID or WP_Post object the comment is going to be displayed on.\n *                                Default current post.\n */\nfunction comment_reply_link( $args = array(), $comment = null, $post = null ) {\n\techo get_comment_reply_link( $args, $comment, $post );\n}\n\n/**\n * Retrieves HTML content for reply to post link.\n *\n * @since 2.7.0\n *\n * @param array       $args {\n *     Optional. Override default arguments.\n *\n *     @type string $add_below  The first part of the selector used to identify the comment to respond below.\n *                              The resulting value is passed as the first parameter to addComment.moveForm(),\n *                              concatenated as $add_below-$comment->comment_ID. Default is 'post'.\n *     @type string $respond_id The selector identifying the responding comment. Passed as the third parameter\n *                              to addComment.moveForm(), and appended to the link URL as a hash value.\n *                              Default 'respond'.\n *     @type string $reply_text Text of the Reply link. Default is 'Leave a Comment'.\n *     @type string $login_text Text of the link to reply if logged out. Default is 'Log in to leave a Comment'.\n *     @type string $before     Text or HTML to add before the reply link. Default empty.\n *     @type string $after      Text or HTML to add after the reply link. Default empty.\n * }\n * @param int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on.\n *                             Default current post.\n * @return string|false|null Link to show comment form, if successful. False, if comments are closed.\n */\nfunction get_post_reply_link( $args = array(), $post = null ) {\n\t$defaults = array(\n\t\t'add_below'  => 'post',\n\t\t'respond_id' => 'respond',\n\t\t'reply_text' => __( 'Leave a Comment' ),\n\t\t'login_text' => __( 'Log in to leave a Comment' ),\n\t\t'before'     => '',\n\t\t'after'      => '',\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\t$post = get_post( $post );\n\n\tif ( ! comments_open( $post->ID ) ) {\n\t\treturn false;\n\t}\n\n\tif ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) {\n\t\t$link = sprintf(\n\t\t\t'<a rel=\"nofollow\" class=\"comment-reply-login\" href=\"%s\">%s</a>',\n\t\t\twp_login_url( get_permalink() ),\n\t\t\t$args['login_text']\n\t\t);\n\t} else {\n\t\t$onclick = sprintf(\n\t\t\t'return addComment.moveForm( \"%1$s-%2$s\", \"0\", \"%3$s\", \"%2$s\" )',\n\t\t\t$args['add_below'],\n\t\t\t$post->ID,\n\t\t\t$args['respond_id']\n\t\t);\n\n\t\t$link = sprintf(\n\t\t\t\"<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s'>%s</a>\",\n\t\t\tget_permalink( $post->ID ) . '#' . $args['respond_id'],\n\t\t\t$onclick,\n\t\t\t$args['reply_text']\n\t\t);\n\t}\n\t$formatted_link = $args['before'] . $link . $args['after'];\n\n\t/**\n\t * Filters the formatted post comments link HTML.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string      $formatted The HTML-formatted post comments link.\n\t * @param int|WP_Post $post      The post ID or WP_Post object.\n\t */\n\treturn apply_filters( 'post_comments_link', $formatted_link, $post );\n}\n\n/**\n * Displays the HTML content for reply to post link.\n *\n * @since 2.7.0\n *\n * @see get_post_reply_link()\n *\n * @param array       $args Optional. Override default options. Default empty array.\n * @param int|WP_Post $post Post ID or WP_Post object the comment is going to be displayed on.\n *                          Default current post.\n */\nfunction post_reply_link( $args = array(), $post = null ) {\n\techo get_post_reply_link( $args, $post );\n}\n\n/**\n * Retrieves HTML content for cancel comment reply link.\n *\n * @since 2.7.0\n *\n * @param string $text Optional. Text to display for cancel reply link. If empty,\n *                     defaults to 'Click here to cancel reply'. Default empty.\n * @return string\n */\nfunction get_cancel_comment_reply_link( $text = '' ) {\n\tif ( empty( $text ) ) {\n\t\t$text = __( 'Click here to cancel reply.' );\n\t}\n\n\t$style = isset( $_GET['replytocom'] ) ? '' : ' style=\"display:none;\"';\n\t$link  = esc_html( remove_query_arg( array( 'replytocom', 'unapproved', 'moderation-hash' ) ) ) . '#respond';\n\n\t$formatted_link = '<a rel=\"nofollow\" id=\"cancel-comment-reply-link\" href=\"' . $link . '\"' . $style . '>' . $text . '</a>';\n\n\t/**\n\t * Filters the cancel comment reply link HTML.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $formatted_link The HTML-formatted cancel comment reply link.\n\t * @param string $link           Cancel comment reply link URL.\n\t * @param string $text           Cancel comment reply link text.\n\t */\n\treturn apply_filters( 'cancel_comment_reply_link', $formatted_link, $link, $text );\n}\n\n/**\n * Displays HTML content for cancel comment reply link.\n *\n * @since 2.7.0\n *\n * @param string $text Optional. Text to display for cancel reply link. If empty,\n *                     defaults to 'Click here to cancel reply'. Default empty.\n */\nfunction cancel_comment_reply_link( $text = '' ) {\n\techo get_cancel_comment_reply_link( $text );\n}\n\n/**\n * Retrieves hidden input HTML for replying to comments.\n *\n * @since 3.0.0\n *\n * @param int $post_id Optional. Post ID. Defaults to the current post ID.\n * @return string Hidden input HTML for replying to comments.\n */\nfunction get_comment_id_fields( $post_id = 0 ) {\n\tif ( empty( $post_id ) ) {\n\t\t$post_id = get_the_ID();\n\t}\n\n\t$reply_to_id = isset( $_GET['replytocom'] ) ? (int) $_GET['replytocom'] : 0;\n\t$result      = \"<input type='hidden' name='comment_post_ID' value='$post_id' id='comment_post_ID' />\\n\";\n\t$result     .= \"<input type='hidden' name='comment_parent' id='comment_parent' value='$reply_to_id' />\\n\";\n\n\t/**\n\t * Filters the returned comment ID fields.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $result      The HTML-formatted hidden ID field comment elements.\n\t * @param int    $post_id     The post ID.\n\t * @param int    $reply_to_id The ID of the comment being replied to.\n\t */\n\treturn apply_filters( 'comment_id_fields', $result, $post_id, $reply_to_id );\n}\n\n/**\n * Outputs hidden input HTML for replying to comments.\n *\n * Adds two hidden inputs to the comment form to identify the `comment_post_ID`\n * and `comment_parent` values for threaded comments.\n *\n * This tag must be within the `<form>` section of the `comments.php` template.\n *\n * @since 2.7.0\n *\n * @see get_comment_id_fields()\n *\n * @param int $post_id Optional. Post ID. Defaults to the current post ID.\n */\nfunction comment_id_fields( $post_id = 0 ) {\n\techo get_comment_id_fields( $post_id );\n}\n\n/**\n * Displays text based on comment reply status.\n *\n * Only affects users with JavaScript disabled.\n *\n * @internal The $comment global must be present to allow template tags access to the current\n *           comment. See https://core.trac.wordpress.org/changeset/36512.\n *\n * @since 2.7.0\n *\n * @global WP_Comment $comment Global comment object.\n *\n * @param string $no_reply_text  Optional. Text to display when not replying to a comment.\n *                               Default false.\n * @param string $reply_text     Optional. Text to display when replying to a comment.\n *                               Default false. Accepts \"%s\" for the author of the comment\n *                               being replied to.\n * @param string $link_to_parent Optional. Boolean to control making the author's name a link\n *                               to their comment. Default true.\n */\nfunction comment_form_title( $no_reply_text = false, $reply_text = false, $link_to_parent = true ) {\n\tglobal $comment;\n\n\tif ( false === $no_reply_text ) {\n\t\t$no_reply_text = __( 'Leave a Reply' );\n\t}\n\n\tif ( false === $reply_text ) {\n\t\t/* translators: %s: Author of the comment being replied to. */\n\t\t$reply_text = __( 'Leave a Reply to %s' );\n\t}\n\n\t$reply_to_id = isset( $_GET['replytocom'] ) ? (int) $_GET['replytocom'] : 0;\n\n\tif ( 0 == $reply_to_id ) {\n\t\techo $no_reply_text;\n\t} else {\n\t\t// Sets the global so that template tags can be used in the comment form.\n\t\t$comment = get_comment( $reply_to_id );\n\n\t\tif ( $link_to_parent ) {\n\t\t\t$author = '<a href=\"#comment-' . get_comment_ID() . '\">' . get_comment_author( $comment ) . '</a>';\n\t\t} else {\n\t\t\t$author = get_comment_author( $comment );\n\t\t}\n\n\t\tprintf( $reply_text, $author );\n\t}\n}\n\n/**\n * Displays a list of comments.\n *\n * Used in the comments.php template to list comments for a particular post.\n *\n * @since 2.7.0\n *\n * @see WP_Query->comments\n *\n * @global WP_Query $wp_query           WordPress Query object.\n * @global int      $comment_alt\n * @global int      $comment_depth\n * @global int      $comment_thread_alt\n * @global bool     $overridden_cpage\n * @global bool     $in_comment_loop\n *\n * @param string|array $args {\n *     Optional. Formatting options.\n *\n *     @type object   $walker            Instance of a Walker class to list comments. Default null.\n *     @type int      $max_depth         The maximum comments depth. Default empty.\n *     @type string   $style             The style of list ordering. Accepts 'ul', 'ol', or 'div'.\n *                                       'div' will result in no additional list markup. Default 'ul'.\n *     @type callable $callback          Callback function to use. Default null.\n *     @type callable $end-callback      Callback function to use at the end. Default null.\n *     @type string   $type              Type of comments to list. Accepts 'all', 'comment',\n *                                       'pingback', 'trackback', 'pings'. Default 'all'.\n *     @type int      $page              Page ID to list comments for. Default empty.\n *     @type int      $per_page          Number of comments to list per page. Default empty.\n *     @type int      $avatar_size       Height and width dimensions of the avatar size. Default 32.\n *     @type bool     $reverse_top_level Ordering of the listed comments. If true, will display\n *                                       newest comments first. Default null.\n *     @type bool     $reverse_children  Whether to reverse child comments in the list. Default null.\n *     @type string   $format            How to format the comments list. Accepts 'html5', 'xhtml'.\n *                                       Default 'html5' if the theme supports it.\n *     @type bool     $short_ping        Whether to output short pings. Default false.\n *     @type bool     $echo              Whether to echo the output or return it. Default true.\n * }\n * @param WP_Comment[] $comments Optional. Array of WP_Comment objects.\n * @return void|string Void if 'echo' argument is true, or no comments to list.\n *                     Otherwise, HTML list of comments.\n */\nfunction wp_list_comments( $args = array(), $comments = null ) {\n\tglobal $wp_query, $comment_alt, $comment_depth, $comment_thread_alt, $overridden_cpage, $in_comment_loop;\n\n\t$in_comment_loop = true;\n\n\t$comment_alt        = 0;\n\t$comment_thread_alt = 0;\n\t$comment_depth      = 1;\n\n\t$defaults = array(\n\t\t'walker'            => null,\n\t\t'max_depth'         => '',\n\t\t'style'             => 'ul',\n\t\t'callback'          => null,\n\t\t'end-callback'      => null,\n\t\t'type'              => 'all',\n\t\t'page'              => '',\n\t\t'per_page'          => '',\n\t\t'avatar_size'       => 32,\n\t\t'reverse_top_level' => null,\n\t\t'reverse_children'  => '',\n\t\t'format'            => current_theme_supports( 'html5', 'comment-list' ) ? 'html5' : 'xhtml',\n\t\t'short_ping'        => false,\n\t\t'echo'              => true,\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t/**\n\t * Filters the arguments used in retrieving the comment list.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @see wp_list_comments()\n\t *\n\t * @param array $parsed_args An array of arguments for displaying comments.\n\t */\n\t$parsed_args = apply_filters( 'wp_list_comments_args', $parsed_args );\n\n\t// Figure out what comments we'll be looping through ($_comments).\n\tif ( null !== $comments ) {\n\t\t$comments = (array) $comments;\n\t\tif ( empty( $comments ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( 'all' !== $parsed_args['type'] ) {\n\t\t\t$comments_by_type = separate_comments( $comments );\n\t\t\tif ( empty( $comments_by_type[ $parsed_args['type'] ] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$_comments = $comments_by_type[ $parsed_args['type'] ];\n\t\t} else {\n\t\t\t$_comments = $comments;\n\t\t}\n\t} else {\n\t\t/*\n\t\t * If 'page' or 'per_page' has been passed, and does not match what's in $wp_query,\n\t\t * perform a separate comment query and allow Walker_Comment to paginate.\n\t\t */\n\t\tif ( $parsed_args['page'] || $parsed_args['per_page'] ) {\n\t\t\t$current_cpage = get_query_var( 'cpage' );\n\t\t\tif ( ! $current_cpage ) {\n\t\t\t\t$current_cpage = 'newest' === get_option( 'default_comments_page' ) ? 1 : $wp_query->max_num_comment_pages;\n\t\t\t}\n\n\t\t\t$current_per_page = get_query_var( 'comments_per_page' );\n\t\t\tif ( $parsed_args['page'] != $current_cpage || $parsed_args['per_page'] != $current_per_page ) {\n\t\t\t\t$comment_args = array(\n\t\t\t\t\t'post_id' => get_the_ID(),\n\t\t\t\t\t'orderby' => 'comment_date_gmt',\n\t\t\t\t\t'order'   => 'ASC',\n\t\t\t\t\t'status'  => 'approve',\n\t\t\t\t);\n\n\t\t\t\tif ( is_user_logged_in() ) {\n\t\t\t\t\t$comment_args['include_unapproved'] = array( get_current_user_id() );\n\t\t\t\t} else {\n\t\t\t\t\t$unapproved_email = wp_get_unapproved_comment_author_email();\n\n\t\t\t\t\tif ( $unapproved_email ) {\n\t\t\t\t\t\t$comment_args['include_unapproved'] = array( $unapproved_email );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$comments = get_comments( $comment_args );\n\n\t\t\t\tif ( 'all' !== $parsed_args['type'] ) {\n\t\t\t\t\t$comments_by_type = separate_comments( $comments );\n\t\t\t\t\tif ( empty( $comments_by_type[ $parsed_args['type'] ] ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t$_comments = $comments_by_type[ $parsed_args['type'] ];\n\t\t\t\t} else {\n\t\t\t\t\t$_comments = $comments;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Otherwise, fall back on the comments from `$wp_query->comments`.\n\t\t} else {\n\t\t\tif ( empty( $wp_query->comments ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( 'all' !== $parsed_args['type'] ) {\n\t\t\t\tif ( empty( $wp_query->comments_by_type ) ) {\n\t\t\t\t\t$wp_query->comments_by_type = separate_comments( $wp_query->comments );\n\t\t\t\t}\n\t\t\t\tif ( empty( $wp_query->comments_by_type[ $parsed_args['type'] ] ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$_comments = $wp_query->comments_by_type[ $parsed_args['type'] ];\n\t\t\t} else {\n\t\t\t\t$_comments = $wp_query->comments;\n\t\t\t}\n\n\t\t\tif ( $wp_query->max_num_comment_pages ) {\n\t\t\t\t$default_comments_page = get_option( 'default_comments_page' );\n\t\t\t\t$cpage                 = get_query_var( 'cpage' );\n\t\t\t\tif ( 'newest' === $default_comments_page ) {\n\t\t\t\t\t$parsed_args['cpage'] = $cpage;\n\n\t\t\t\t\t/*\n\t\t\t\t\t* When first page shows oldest comments, post permalink is the same as\n\t\t\t\t\t* the comment permalink.\n\t\t\t\t\t*/\n\t\t\t\t} elseif ( 1 == $cpage ) {\n\t\t\t\t\t$parsed_args['cpage'] = '';\n\t\t\t\t} else {\n\t\t\t\t\t$parsed_args['cpage'] = $cpage;\n\t\t\t\t}\n\n\t\t\t\t$parsed_args['page']     = 0;\n\t\t\t\t$parsed_args['per_page'] = 0;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( '' === $parsed_args['per_page'] && get_option( 'page_comments' ) ) {\n\t\t$parsed_args['per_page'] = get_query_var( 'comments_per_page' );\n\t}\n\n\tif ( empty( $parsed_args['per_page'] ) ) {\n\t\t$parsed_args['per_page'] = 0;\n\t\t$parsed_args['page']     = 0;\n\t}\n\n\tif ( '' === $parsed_args['max_depth'] ) {\n\t\tif ( get_option( 'thread_comments' ) ) {\n\t\t\t$parsed_args['max_depth'] = get_option( 'thread_comments_depth' );\n\t\t} else {\n\t\t\t$parsed_args['max_depth'] = -1;\n\t\t}\n\t}\n\n\tif ( '' === $parsed_args['page'] ) {\n\t\tif ( empty( $overridden_cpage ) ) {\n\t\t\t$parsed_args['page'] = get_query_var( 'cpage' );\n\t\t} else {\n\t\t\t$threaded            = ( -1 != $parsed_args['max_depth'] );\n\t\t\t$parsed_args['page'] = ( 'newest' === get_option( 'default_comments_page' ) ) ? get_comment_pages_count( $_comments, $parsed_args['per_page'], $threaded ) : 1;\n\t\t\tset_query_var( 'cpage', $parsed_args['page'] );\n\t\t}\n\t}\n\t// Validation check.\n\t$parsed_args['page'] = intval( $parsed_args['page'] );\n\tif ( 0 == $parsed_args['page'] && 0 != $parsed_args['per_page'] ) {\n\t\t$parsed_args['page'] = 1;\n\t}\n\n\tif ( null === $parsed_args['reverse_top_level'] ) {\n\t\t$parsed_args['reverse_top_level'] = ( 'desc' === get_option( 'comment_order' ) );\n\t}\n\n\twp_queue_comments_for_comment_meta_lazyload( $_comments );\n\n\tif ( empty( $parsed_args['walker'] ) ) {\n\t\t$walker = new Walker_Comment;\n\t} else {\n\t\t$walker = $parsed_args['walker'];\n\t}\n\n\t$output = $walker->paged_walk( $_comments, $parsed_args['max_depth'], $parsed_args['page'], $parsed_args['per_page'], $parsed_args );\n\n\t$in_comment_loop = false;\n\n\tif ( $parsed_args['echo'] ) {\n\t\techo $output;\n\t} else {\n\t\treturn $output;\n\t}\n}\n\n/**\n * Outputs a complete commenting form for use within a template.\n *\n * Most strings and form fields may be controlled through the $args array passed\n * into the function, while you may also choose to use the {@see 'comment_form_default_fields'}\n * filter to modify the array of default fields if you'd just like to add a new\n * one or remove a single field. All fields are also individually passed through\n * a filter of the {@see 'comment_form_field_$name'} where $name is the key used\n * in the array of fields.\n *\n * @since 3.0.0\n * @since 4.1.0 Introduced the 'class_submit' argument.\n * @since 4.2.0 Introduced the 'submit_button' and 'submit_fields' arguments.\n * @since 4.4.0 Introduced the 'class_form', 'title_reply_before', 'title_reply_after',\n *              'cancel_reply_before', and 'cancel_reply_after' arguments.\n * @since 4.5.0 The 'author', 'email', and 'url' form fields are limited to 245, 100,\n *              and 200 characters, respectively.\n * @since 4.6.0 Introduced the 'action' argument.\n * @since 4.9.6 Introduced the 'cookies' default comment field.\n * @since 5.5.0 Introduced the 'class_container' argument.\n *\n * @param array       $args {\n *     Optional. Default arguments and form fields to override.\n *\n *     @type array $fields {\n *         Default comment fields, filterable by default via the {@see 'comment_form_default_fields'} hook.\n *\n *         @type string $author  Comment author field HTML.\n *         @type string $email   Comment author email field HTML.\n *         @type string $url     Comment author URL field HTML.\n *         @type string $cookies Comment cookie opt-in field HTML.\n *     }\n *     @type string $comment_field        The comment textarea field HTML.\n *     @type string $must_log_in          HTML element for a 'must be logged in to comment' message.\n *     @type string $logged_in_as         HTML element for a 'logged in as [user]' message.\n *     @type string $comment_notes_before HTML element for a message displayed before the comment fields\n *                                        if the user is not logged in.\n *                                        Default 'Your email address will not be published.'.\n *     @type string $comment_notes_after  HTML element for a message displayed after the textarea field.\n *     @type string $action               The comment form element action attribute. Default '/wp-comments-post.php'.\n *     @type string $id_form              The comment form element id attribute. Default 'commentform'.\n *     @type string $id_submit            The comment submit element id attribute. Default 'submit'.\n *     @type string $class_container      The comment form container class attribute. Default 'comment-respond'.\n *     @type string $class_form           The comment form element class attribute. Default 'comment-form'.\n *     @type string $class_submit         The comment submit element class attribute. Default 'submit'.\n *     @type string $name_submit          The comment submit element name attribute. Default 'submit'.\n *     @type string $title_reply          The translatable 'reply' button label. Default 'Leave a Reply'.\n *     @type string $title_reply_to       The translatable 'reply-to' button label. Default 'Leave a Reply to %s',\n *                                        where %s is the author of the comment being replied to.\n *     @type string $title_reply_before   HTML displayed before the comment form title.\n *                                        Default: '<h3 id=\"reply-title\" class=\"comment-reply-title\">'.\n *     @type string $title_reply_after    HTML displayed after the comment form title.\n *                                        Default: '</h3>'.\n *     @type string $cancel_reply_before  HTML displayed before the cancel reply link.\n *     @type string $cancel_reply_after   HTML displayed after the cancel reply link.\n *     @type string $cancel_reply_link    The translatable 'cancel reply' button label. Default 'Cancel reply'.\n *     @type string $label_submit         The translatable 'submit' button label. Default 'Post a comment'.\n *     @type string $submit_button        HTML format for the Submit button.\n *                                        Default: '<input name=\"%1$s\" type=\"submit\" id=\"%2$s\" class=\"%3$s\" value=\"%4$s\" />'.\n *     @type string $submit_field         HTML format for the markup surrounding the Submit button and comment hidden\n *                                        fields. Default: '<p class=\"form-submit\">%1$s %2$s</p>', where %1$s is the\n *                                        submit button markup and %2$s is the comment hidden fields.\n *     @type string $format               The comment form format. Default 'xhtml'. Accepts 'xhtml', 'html5'.\n * }\n * @param int|WP_Post $post_id Post ID or WP_Post object to generate the form for. Default current post.\n */\nfunction comment_form( $args = array(), $post_id = null ) {\n\tif ( null === $post_id ) {\n\t\t$post_id = get_the_ID();\n\t}\n\n\t// Exit the function when comments for the post are closed.\n\tif ( ! comments_open( $post_id ) ) {\n\t\t/**\n\t\t * Fires after the comment form if comments are closed.\n\t\t *\n\t\t * @since 3.0.0\n\t\t */\n\t\tdo_action( 'comment_form_comments_closed' );\n\n\t\treturn;\n\t}\n\n\t$commenter     = wp_get_current_commenter();\n\t$user          = wp_get_current_user();\n\t$user_identity = $user->exists() ? $user->display_name : '';\n\n\t$args = wp_parse_args( $args );\n\tif ( ! isset( $args['format'] ) ) {\n\t\t$args['format'] = current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml';\n\t}\n\n\t$req      = get_option( 'require_name_email' );\n\t$html_req = ( $req ? \" required='required'\" : '' );\n\t$html5    = 'html5' === $args['format'];\n\n\t$fields = array(\n\t\t'author' => sprintf(\n\t\t\t'<p class=\"comment-form-author\">%s %s</p>',\n\t\t\tsprintf(\n\t\t\t\t'<label for=\"author\">%s%s</label>',\n\t\t\t\t__( 'Name' ),\n\t\t\t\t( $req ? ' <span class=\"required\">*</span>' : '' )\n\t\t\t),\n\t\t\tsprintf(\n\t\t\t\t'<input id=\"author\" name=\"author\" type=\"text\" value=\"%s\" size=\"30\" maxlength=\"245\"%s />',\n\t\t\t\tesc_attr( $commenter['comment_author'] ),\n\t\t\t\t$html_req\n\t\t\t)\n\t\t),\n\t\t'email'  => sprintf(\n\t\t\t'<p class=\"comment-form-email\">%s %s</p>',\n\t\t\tsprintf(\n\t\t\t\t'<label for=\"email\">%s%s</label>',\n\t\t\t\t__( 'Email' ),\n\t\t\t\t( $req ? ' <span class=\"required\">*</span>' : '' )\n\t\t\t),\n\t\t\tsprintf(\n\t\t\t\t'<input id=\"email\" name=\"email\" %s value=\"%s\" size=\"30\" maxlength=\"100\" aria-describedby=\"email-notes\"%s />',\n\t\t\t\t( $html5 ? 'type=\"email\"' : 'type=\"text\"' ),\n\t\t\t\tesc_attr( $commenter['comment_author_email'] ),\n\t\t\t\t$html_req\n\t\t\t)\n\t\t),\n\t\t'url'    => sprintf(\n\t\t\t'<p class=\"comment-form-url\">%s %s</p>',\n\t\t\tsprintf(\n\t\t\t\t'<label for=\"url\">%s</label>',\n\t\t\t\t__( 'Website' )\n\t\t\t),\n\t\t\tsprintf(\n\t\t\t\t'<input id=\"url\" name=\"url\" %s value=\"%s\" size=\"30\" maxlength=\"200\" />',\n\t\t\t\t( $html5 ? 'type=\"url\"' : 'type=\"text\"' ),\n\t\t\t\tesc_attr( $commenter['comment_author_url'] )\n\t\t\t)\n\t\t),\n\t);\n\n\tif ( has_action( 'set_comment_cookies', 'wp_set_comment_cookies' ) && get_option( 'show_comments_cookies_opt_in' ) ) {\n\t\t$consent = empty( $commenter['comment_author_email'] ) ? '' : ' checked=\"checked\"';\n\n\t\t$fields['cookies'] = sprintf(\n\t\t\t'<p class=\"comment-form-cookies-consent\">%s %s</p>',\n\t\t\tsprintf(\n\t\t\t\t'<input id=\"wp-comment-cookies-consent\" name=\"wp-comment-cookies-consent\" type=\"checkbox\" value=\"yes\"%s />',\n\t\t\t\t$consent\n\t\t\t),\n\t\t\tsprintf(\n\t\t\t\t'<label for=\"wp-comment-cookies-consent\">%s</label>',\n\t\t\t\t__( 'Save my name, email, and website in this browser for the next time I comment.' )\n\t\t\t)\n\t\t);\n\n\t\t// Ensure that the passed fields include cookies consent.\n\t\tif ( isset( $args['fields'] ) && ! isset( $args['fields']['cookies'] ) ) {\n\t\t\t$args['fields']['cookies'] = $fields['cookies'];\n\t\t}\n\t}\n\n\t$required_text = sprintf(\n\t\t/* translators: %s: Asterisk symbol (*). */\n\t\t' ' . __( 'Required fields are marked %s' ),\n\t\t'<span class=\"required\">*</span>'\n\t);\n\n\t/**\n\t * Filters the default comment form fields.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string[] $fields Array of the default comment fields.\n\t */\n\t$fields = apply_filters( 'comment_form_default_fields', $fields );\n\n\t$defaults = array(\n\t\t'fields'               => $fields,\n\t\t'comment_field'        => sprintf(\n\t\t\t'<p class=\"comment-form-comment\">%s %s</p>',\n\t\t\tsprintf(\n\t\t\t\t'<label for=\"comment\">%s</label>',\n\t\t\t\t_x( 'Comment', 'noun' )\n\t\t\t),\n\t\t\t'<textarea id=\"comment\" name=\"comment\" cols=\"45\" rows=\"8\" maxlength=\"65525\" required=\"required\"></textarea>'\n\t\t),\n\t\t'must_log_in'          => sprintf(\n\t\t\t'<p class=\"must-log-in\">%s</p>',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Login URL. */\n\t\t\t\t__( 'You must be <a href=\"%s\">logged in</a> to post a comment.' ),\n\t\t\t\t/** This filter is documented in wp-includes/link-template.php */\n\t\t\t\twp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) )\n\t\t\t)\n\t\t),\n\t\t'logged_in_as'         => sprintf(\n\t\t\t'<p class=\"logged-in-as\">%s</p>',\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: Edit user link, 2: Accessibility text, 3: User name, 4: Logout URL. */\n\t\t\t\t__( '<a href=\"%1$s\" aria-label=\"%2$s\">Logged in as %3$s</a>. <a href=\"%4$s\">Log out?</a>' ),\n\t\t\t\tget_edit_user_link(),\n\t\t\t\t/* translators: %s: User name. */\n\t\t\t\tesc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ),\n\t\t\t\t$user_identity,\n\t\t\t\t/** This filter is documented in wp-includes/link-template.php */\n\t\t\t\twp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) )\n\t\t\t)\n\t\t),\n\t\t'comment_notes_before' => sprintf(\n\t\t\t'<p class=\"comment-notes\">%s%s</p>',\n\t\t\tsprintf(\n\t\t\t\t'<span id=\"email-notes\">%s</span>',\n\t\t\t\t__( 'Your email address will not be published.' )\n\t\t\t),\n\t\t\t( $req ? $required_text : '' )\n\t\t),\n\t\t'comment_notes_after'  => '',\n\t\t'action'               => site_url( '/wp-comments-post.php' ),\n\t\t'id_form'              => 'commentform',\n\t\t'id_submit'            => 'submit',\n\t\t'class_container'      => 'comment-respond',\n\t\t'class_form'           => 'comment-form',\n\t\t'class_submit'         => 'submit',\n\t\t'name_submit'          => 'submit',\n\t\t'title_reply'          => __( 'Leave a Reply' ),\n\t\t/* translators: %s: Author of the comment being replied to. */\n\t\t'title_reply_to'       => __( 'Leave a Reply to %s' ),\n\t\t'title_reply_before'   => '<h3 id=\"reply-title\" class=\"comment-reply-title\">',\n\t\t'title_reply_after'    => '</h3>',\n\t\t'cancel_reply_before'  => ' <small>',\n\t\t'cancel_reply_after'   => '</small>',\n\t\t'cancel_reply_link'    => __( 'Cancel reply' ),\n\t\t'label_submit'         => __( 'Post Comment' ),\n\t\t'submit_button'        => '<input name=\"%1$s\" type=\"submit\" id=\"%2$s\" class=\"%3$s\" value=\"%4$s\" />',\n\t\t'submit_field'         => '<p class=\"form-submit\">%1$s %2$s</p>',\n\t\t'format'               => 'xhtml',\n\t);\n\n\t/**\n\t * Filters the comment form default arguments.\n\t *\n\t * Use {@see 'comment_form_default_fields'} to filter the comment fields.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param array $defaults The default comment form arguments.\n\t */\n\t$args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );\n\n\t// Ensure that the filtered arguments contain all required default values.\n\t$args = array_merge( $defaults, $args );\n\n\t// Remove `aria-describedby` from the email field if there's no associated description.\n\tif ( isset( $args['fields']['email'] ) && false === strpos( $args['comment_notes_before'], 'id=\"email-notes\"' ) ) {\n\t\t$args['fields']['email'] = str_replace(\n\t\t\t' aria-describedby=\"email-notes\"',\n\t\t\t'',\n\t\t\t$args['fields']['email']\n\t\t);\n\t}\n\n\t/**\n\t * Fires before the comment form.\n\t *\n\t * @since 3.0.0\n\t */\n\tdo_action( 'comment_form_before' );\n\t?>\n\t<div id=\"respond\" class=\"<?php echo esc_attr( $args['class_container'] ); ?>\">\n\t\t<?php\n\t\techo $args['title_reply_before'];\n\n\t\tcomment_form_title( $args['title_reply'], $args['title_reply_to'] );\n\n\t\techo $args['cancel_reply_before'];\n\n\t\tcancel_comment_reply_link( $args['cancel_reply_link'] );\n\n\t\techo $args['cancel_reply_after'];\n\n\t\techo $args['title_reply_after'];\n\n\t\tif ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) :\n\n\t\t\techo $args['must_log_in'];\n\t\t\t/**\n\t\t\t * Fires after the HTML-formatted 'must log in after' message in the comment form.\n\t\t\t *\n\t\t\t * @since 3.0.0\n\t\t\t */\n\t\t\tdo_action( 'comment_form_must_log_in_after' );\n\n\t\telse :\n\n\t\t\tprintf(\n\t\t\t\t'<form action=\"%s\" method=\"post\" id=\"%s\" class=\"%s\"%s>',\n\t\t\t\tesc_url( $args['action'] ),\n\t\t\t\tesc_attr( $args['id_form'] ),\n\t\t\t\tesc_attr( $args['class_form'] ),\n\t\t\t\t( $html5 ? ' novalidate' : '' )\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Fires at the top of the comment form, inside the form tag.\n\t\t\t *\n\t\t\t * @since 3.0.0\n\t\t\t */\n\t\t\tdo_action( 'comment_form_top' );\n\n\t\t\tif ( is_user_logged_in() ) :\n\n\t\t\t\t/**\n\t\t\t\t * Filters the 'logged in' message for the comment form for display.\n\t\t\t\t *\n\t\t\t\t * @since 3.0.0\n\t\t\t\t *\n\t\t\t\t * @param string $args_logged_in The logged-in-as HTML-formatted message.\n\t\t\t\t * @param array  $commenter      An array containing the comment author's\n\t\t\t\t *                               username, email, and URL.\n\t\t\t\t * @param string $user_identity  If the commenter is a registered user,\n\t\t\t\t *                               the display name, blank otherwise.\n\t\t\t\t */\n\t\t\t\techo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity );\n\n\t\t\t\t/**\n\t\t\t\t * Fires after the is_user_logged_in() check in the comment form.\n\t\t\t\t *\n\t\t\t\t * @since 3.0.0\n\t\t\t\t *\n\t\t\t\t * @param array  $commenter     An array containing the comment author's\n\t\t\t\t *                              username, email, and URL.\n\t\t\t\t * @param string $user_identity If the commenter is a registered user,\n\t\t\t\t *                              the display name, blank otherwise.\n\t\t\t\t */\n\t\t\t\tdo_action( 'comment_form_logged_in_after', $commenter, $user_identity );\n\n\t\t\telse :\n\n\t\t\t\techo $args['comment_notes_before'];\n\n\t\t\tendif;\n\n\t\t\t// Prepare an array of all fields, including the textarea.\n\t\t\t$comment_fields = array( 'comment' => $args['comment_field'] ) + (array) $args['fields'];\n\n\t\t\t/**\n\t\t\t * Filters the comment form fields, including the textarea.\n\t\t\t *\n\t\t\t * @since 4.4.0\n\t\t\t *\n\t\t\t * @param array $comment_fields The comment fields.\n\t\t\t */\n\t\t\t$comment_fields = apply_filters( 'comment_form_fields', $comment_fields );\n\n\t\t\t// Get an array of field names, excluding the textarea.\n\t\t\t$comment_field_keys = array_diff( array_keys( $comment_fields ), array( 'comment' ) );\n\n\t\t\t// Get the first and the last field name, excluding the textarea.\n\t\t\t$first_field = reset( $comment_field_keys );\n\t\t\t$last_field  = end( $comment_field_keys );\n\n\t\t\tforeach ( $comment_fields as $name => $field ) {\n\n\t\t\t\tif ( 'comment' === $name ) {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters the content of the comment textarea field for display.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 3.0.0\n\t\t\t\t\t *\n\t\t\t\t\t * @param string $args_comment_field The content of the comment textarea field.\n\t\t\t\t\t */\n\t\t\t\t\techo apply_filters( 'comment_form_field_comment', $field );\n\n\t\t\t\t\techo $args['comment_notes_after'];\n\n\t\t\t\t} elseif ( ! is_user_logged_in() ) {\n\n\t\t\t\t\tif ( $first_field === $name ) {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Fires before the comment fields in the comment form, excluding the textarea.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @since 3.0.0\n\t\t\t\t\t\t */\n\t\t\t\t\t\tdo_action( 'comment_form_before_fields' );\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters a comment form field for display.\n\t\t\t\t\t *\n\t\t\t\t\t * The dynamic portion of the filter hook, `$name`, refers to the name\n\t\t\t\t\t * of the comment form field. Such as 'author', 'email', or 'url'.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 3.0.0\n\t\t\t\t\t *\n\t\t\t\t\t * @param string $field The HTML-formatted output of the comment form field.\n\t\t\t\t\t */\n\t\t\t\t\techo apply_filters( \"comment_form_field_{$name}\", $field ) . \"\\n\";\n\n\t\t\t\t\tif ( $last_field === $name ) {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Fires after the comment fields in the comment form, excluding the textarea.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @since 3.0.0\n\t\t\t\t\t\t */\n\t\t\t\t\t\tdo_action( 'comment_form_after_fields' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$submit_button = sprintf(\n\t\t\t\t$args['submit_button'],\n\t\t\t\tesc_attr( $args['name_submit'] ),\n\t\t\t\tesc_attr( $args['id_submit'] ),\n\t\t\t\tesc_attr( $args['class_submit'] ),\n\t\t\t\tesc_attr( $args['label_submit'] )\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Filters the submit button for the comment form to display.\n\t\t\t *\n\t\t\t * @since 4.2.0\n\t\t\t *\n\t\t\t * @param string $submit_button HTML markup for the submit button.\n\t\t\t * @param array  $args          Arguments passed to comment_form().\n\t\t\t */\n\t\t\t$submit_button = apply_filters( 'comment_form_submit_button', $submit_button, $args );\n\n\t\t\t$submit_field = sprintf(\n\t\t\t\t$args['submit_field'],\n\t\t\t\t$submit_button,\n\t\t\t\tget_comment_id_fields( $post_id )\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Filters the submit field for the comment form to display.\n\t\t\t *\n\t\t\t * The submit field includes the submit button, hidden fields for the\n\t\t\t * comment form, and any wrapper markup.\n\t\t\t *\n\t\t\t * @since 4.2.0\n\t\t\t *\n\t\t\t * @param string $submit_field HTML markup for the submit field.\n\t\t\t * @param array  $args         Arguments passed to comment_form().\n\t\t\t */\n\t\t\techo apply_filters( 'comment_form_submit_field', $submit_field, $args );\n\n\t\t\t/**\n\t\t\t * Fires at the bottom of the comment form, inside the closing form tag.\n\t\t\t *\n\t\t\t * @since 1.5.0\n\t\t\t *\n\t\t\t * @param int $post_id The post ID.\n\t\t\t */\n\t\t\tdo_action( 'comment_form', $post_id );\n\n\t\t\techo '</form>';\n\n\t\tendif;\n\t\t?>\n\t</div><!-- #respond -->\n\t<?php\n\n\t/**\n\t * Fires after the comment form.\n\t *\n\t * @since 3.0.0\n\t */\n\tdo_action( 'comment_form_after' );\n}\n", "num_lines": 2704}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Core Comment API\n *\n * @package WordPress\n * @subpackage Comment\n */\n\n/**\n * Check whether a comment passes internal checks to be allowed to add.\n *\n * If manual comment moderation is set in the administration, then all checks,\n * regardless of their type and substance, will fail and the function will\n * return false.\n *\n * If the number of links exceeds the amount in the administration, then the\n * check fails. If any of the parameter contents contain any disallowed words,\n * then the check fails.\n *\n * If the comment author was approved before, then the comment is automatically\n * approved.\n *\n * If all checks pass, the function will return true.\n *\n * @since 1.2.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $author       Comment author name.\n * @param string $email        Comment author email.\n * @param string $url          Comment author URL.\n * @param string $comment      Content of the comment.\n * @param string $user_ip      Comment author IP address.\n * @param string $user_agent   Comment author User-Agent.\n * @param string $comment_type Comment type, either user-submitted comment,\n *                             trackback, or pingback.\n * @return bool If all checks pass, true, otherwise false.\n */\nfunction check_comment( $author, $email, $url, $comment, $user_ip, $user_agent, $comment_type ) {\n\tglobal $wpdb;\n\n\t// If manual moderation is enabled, skip all checks and return false.\n\tif ( 1 == get_option( 'comment_moderation' ) ) {\n\t\treturn false;\n\t}\n\n\t/** This filter is documented in wp-includes/comment-template.php */\n\t$comment = apply_filters( 'comment_text', $comment, null, array() );\n\n\t// Check for the number of external links if a max allowed number is set.\n\t$max_links = get_option( 'comment_max_links' );\n\tif ( $max_links ) {\n\t\t$num_links = preg_match_all( '/<a [^>]*href/i', $comment, $out );\n\n\t\t/**\n\t\t * Filters the number of links found in a comment.\n\t\t *\n\t\t * @since 3.0.0\n\t\t * @since 4.7.0 Added the `$comment` parameter.\n\t\t *\n\t\t * @param int    $num_links The number of links found.\n\t\t * @param string $url       Comment author's URL. Included in allowed links total.\n\t\t * @param string $comment   Content of the comment.\n\t\t */\n\t\t$num_links = apply_filters( 'comment_max_links_url', $num_links, $url, $comment );\n\n\t\t/*\n\t\t * If the number of links in the comment exceeds the allowed amount,\n\t\t * fail the check by returning false.\n\t\t */\n\t\tif ( $num_links >= $max_links ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t$mod_keys = trim( get_option( 'moderation_keys' ) );\n\n\t// If moderation 'keys' (keywords) are set, process them.\n\tif ( ! empty( $mod_keys ) ) {\n\t\t$words = explode( \"\\n\", $mod_keys );\n\n\t\tforeach ( (array) $words as $word ) {\n\t\t\t$word = trim( $word );\n\n\t\t\t// Skip empty lines.\n\t\t\tif ( empty( $word ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Do some escaping magic so that '#' (number of) characters in the spam\n\t\t\t * words don't break things:\n\t\t\t */\n\t\t\t$word = preg_quote( $word, '#' );\n\n\t\t\t/*\n\t\t\t * Check the comment fields for moderation keywords. If any are found,\n\t\t\t * fail the check for the given field by returning false.\n\t\t\t */\n\t\t\t$pattern = \"#$word#i\";\n\t\t\tif ( preg_match( $pattern, $author ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ( preg_match( $pattern, $email ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ( preg_match( $pattern, $url ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ( preg_match( $pattern, $comment ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ( preg_match( $pattern, $user_ip ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ( preg_match( $pattern, $user_agent ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t * Check if the option to approve comments by previously-approved authors is enabled.\n\t *\n\t * If it is enabled, check whether the comment author has a previously-approved comment,\n\t * as well as whether there are any moderation keywords (if set) present in the author\n\t * email address. If both checks pass, return true. Otherwise, return false.\n\t */\n\tif ( 1 == get_option( 'comment_previously_approved' ) ) {\n\t\tif ( 'trackback' !== $comment_type && 'pingback' !== $comment_type && '' !== $author && '' !== $email ) {\n\t\t\t$comment_user = get_user_by( 'email', wp_unslash( $email ) );\n\t\t\tif ( ! empty( $comment_user->ID ) ) {\n\t\t\t\t$ok_to_comment = $wpdb->get_var( $wpdb->prepare( \"SELECT comment_approved FROM $wpdb->comments WHERE user_id = %d AND comment_approved = '1' LIMIT 1\", $comment_user->ID ) );\n\t\t\t} else {\n\t\t\t\t// expected_slashed ($author, $email)\n\t\t\t\t$ok_to_comment = $wpdb->get_var( $wpdb->prepare( \"SELECT comment_approved FROM $wpdb->comments WHERE comment_author = %s AND comment_author_email = %s and comment_approved = '1' LIMIT 1\", $author, $email ) );\n\t\t\t}\n\t\t\tif ( ( 1 == $ok_to_comment ) &&\n\t\t\t\t( empty( $mod_keys ) || false === strpos( $email, $mod_keys ) ) ) {\n\t\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * Retrieve the approved comments for post $post_id.\n *\n * @since 2.0.0\n * @since 4.1.0 Refactored to leverage WP_Comment_Query over a direct query.\n *\n * @param int   $post_id The ID of the post.\n * @param array $args    Optional. See WP_Comment_Query::__construct() for information on accepted arguments.\n * @return int|array The approved comments, or number of comments if `$count`\n *                   argument is true.\n */\nfunction get_approved_comments( $post_id, $args = array() ) {\n\tif ( ! $post_id ) {\n\t\treturn array();\n\t}\n\n\t$defaults    = array(\n\t\t'status'  => 1,\n\t\t'post_id' => $post_id,\n\t\t'order'   => 'ASC',\n\t);\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t$query = new WP_Comment_Query;\n\treturn $query->query( $parsed_args );\n}\n\n/**\n * Retrieves comment data given a comment ID or comment object.\n *\n * If an object is passed then the comment data will be cached and then returned\n * after being passed through a filter. If the comment is empty, then the global\n * comment variable will be used, if it is set.\n *\n * @since 2.0.0\n *\n * @global WP_Comment $comment Global comment object.\n *\n * @param WP_Comment|string|int $comment Comment to retrieve.\n * @param string                $output  Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which\n *                                       correspond to a WP_Comment object, an associative array, or a numeric array,\n *                                       respectively. Default OBJECT.\n * @return WP_Comment|array|null Depends on $output value.\n */\nfunction get_comment( &$comment = null, $output = OBJECT ) {\n\tif ( empty( $comment ) && isset( $GLOBALS['comment'] ) ) {\n\t\t$comment = $GLOBALS['comment'];\n\t}\n\n\tif ( $comment instanceof WP_Comment ) {\n\t\t$_comment = $comment;\n\t} elseif ( is_object( $comment ) ) {\n\t\t$_comment = new WP_Comment( $comment );\n\t} else {\n\t\t$_comment = WP_Comment::get_instance( $comment );\n\t}\n\n\tif ( ! $_comment ) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Fires after a comment is retrieved.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param WP_Comment $_comment Comment data.\n\t */\n\t$_comment = apply_filters( 'get_comment', $_comment );\n\n\tif ( OBJECT == $output ) {\n\t\treturn $_comment;\n\t} elseif ( ARRAY_A == $output ) {\n\t\treturn $_comment->to_array();\n\t} elseif ( ARRAY_N == $output ) {\n\t\treturn array_values( $_comment->to_array() );\n\t}\n\treturn $_comment;\n}\n\n/**\n * Retrieve a list of comments.\n *\n * The comment list can be for the blog as a whole or for an individual post.\n *\n * @since 2.7.0\n *\n * @param string|array $args Optional. Array or string of arguments. See WP_Comment_Query::__construct()\n *                           for information on accepted arguments. Default empty.\n * @return int|array List of comments or number of found comments if `$count` argument is true.\n */\nfunction get_comments( $args = '' ) {\n\t$query = new WP_Comment_Query;\n\treturn $query->query( $args );\n}\n\n/**\n * Retrieve all of the WordPress supported comment statuses.\n *\n * Comments have a limited set of valid status values, this provides the comment\n * status values and descriptions.\n *\n * @since 2.7.0\n *\n * @return string[] List of comment status labels keyed by status.\n */\nfunction get_comment_statuses() {\n\t$status = array(\n\t\t'hold'    => __( 'Unapproved' ),\n\t\t'approve' => _x( 'Approved', 'comment status' ),\n\t\t'spam'    => _x( 'Spam', 'comment status' ),\n\t\t'trash'   => _x( 'Trash', 'comment status' ),\n\t);\n\n\treturn $status;\n}\n\n/**\n * Gets the default comment status for a post type.\n *\n * @since 4.3.0\n *\n * @param string $post_type    Optional. Post type. Default 'post'.\n * @param string $comment_type Optional. Comment type. Default 'comment'.\n * @return string Expected return value is 'open' or 'closed'.\n */\nfunction get_default_comment_status( $post_type = 'post', $comment_type = 'comment' ) {\n\tswitch ( $comment_type ) {\n\t\tcase 'pingback':\n\t\tcase 'trackback':\n\t\t\t$supports = 'trackbacks';\n\t\t\t$option   = 'ping';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$supports = 'comments';\n\t\t\t$option   = 'comment';\n\t\t\tbreak;\n\t}\n\n\t// Set the status.\n\tif ( 'page' === $post_type ) {\n\t\t$status = 'closed';\n\t} elseif ( post_type_supports( $post_type, $supports ) ) {\n\t\t$status = get_option( \"default_{$option}_status\" );\n\t} else {\n\t\t$status = 'closed';\n\t}\n\n\t/**\n\t * Filters the default comment status for the given post type.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param string $status       Default status for the given post type,\n\t *                             either 'open' or 'closed'.\n\t * @param string $post_type    Post type. Default is `post`.\n\t * @param string $comment_type Type of comment. Default is `comment`.\n\t */\n\treturn apply_filters( 'get_default_comment_status', $status, $post_type, $comment_type );\n}\n\n/**\n * The date the last comment was modified.\n *\n * @since 1.5.0\n * @since 4.7.0 Replaced caching the modified date in a local static variable\n *              with the Object Cache API.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $timezone Which timezone to use in reference to 'gmt', 'blog', or 'server' locations.\n * @return string|false Last comment modified date on success, false on failure.\n */\nfunction get_lastcommentmodified( $timezone = 'server' ) {\n\tglobal $wpdb;\n\n\t$timezone = strtolower( $timezone );\n\t$key      = \"lastcommentmodified:$timezone\";\n\n\t$comment_modified_date = wp_cache_get( $key, 'timeinfo' );\n\tif ( false !== $comment_modified_date ) {\n\t\treturn $comment_modified_date;\n\t}\n\n\tswitch ( $timezone ) {\n\t\tcase 'gmt':\n\t\t\t$comment_modified_date = $wpdb->get_var( \"SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1\" );\n\t\t\tbreak;\n\t\tcase 'blog':\n\t\t\t$comment_modified_date = $wpdb->get_var( \"SELECT comment_date FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1\" );\n\t\t\tbreak;\n\t\tcase 'server':\n\t\t\t$add_seconds_server = gmdate( 'Z' );\n\n\t\t\t$comment_modified_date = $wpdb->get_var( $wpdb->prepare( \"SELECT DATE_ADD(comment_date_gmt, INTERVAL %s SECOND) FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1\", $add_seconds_server ) );\n\t\t\tbreak;\n\t}\n\n\tif ( $comment_modified_date ) {\n\t\twp_cache_set( $key, $comment_modified_date, 'timeinfo' );\n\n\t\treturn $comment_modified_date;\n\t}\n\n\treturn false;\n}\n\n/**\n * Retrieves the total comment counts for the whole site or a single post.\n *\n * Unlike wp_count_comments(), this function always returns the live comment counts without caching.\n *\n * @since 2.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int $post_id Optional. Restrict the comment counts to the given post. Default 0, which indicates that\n *                     comment counts for the whole site will be retrieved.\n * @return array() {\n *     The number of comments keyed by their status.\n *\n *     @type int $approved            The number of approved comments.\n *     @type int $awaiting_moderation The number of comments awaiting moderation (a.k.a. pending).\n *     @type int $spam                The number of spam comments.\n *     @type int $trash               The number of trashed comments.\n *     @type int $post-trashed        The number of comments for posts that are in the trash.\n *     @type int $total_comments      The total number of non-trashed comments, including spam.\n *     @type int $all                 The total number of pending or approved comments.\n * }\n */\nfunction get_comment_count( $post_id = 0 ) {\n\tglobal $wpdb;\n\n\t$post_id = (int) $post_id;\n\n\t$where = '';\n\tif ( $post_id > 0 ) {\n\t\t$where = $wpdb->prepare( 'WHERE comment_post_ID = %d', $post_id );\n\t}\n\n\t$totals = (array) $wpdb->get_results(\n\t\t\"\n\t\tSELECT comment_approved, COUNT( * ) AS total\n\t\tFROM {$wpdb->comments}\n\t\t{$where}\n\t\tGROUP BY comment_approved\n\t\",\n\t\tARRAY_A\n\t);\n\n\t$comment_count = array(\n\t\t'approved'            => 0,\n\t\t'awaiting_moderation' => 0,\n\t\t'spam'                => 0,\n\t\t'trash'               => 0,\n\t\t'post-trashed'        => 0,\n\t\t'total_comments'      => 0,\n\t\t'all'                 => 0,\n\t);\n\n\tforeach ( $totals as $row ) {\n\t\tswitch ( $row['comment_approved'] ) {\n\t\t\tcase 'trash':\n\t\t\t\t$comment_count['trash'] = $row['total'];\n\t\t\t\tbreak;\n\t\t\tcase 'post-trashed':\n\t\t\t\t$comment_count['post-trashed'] = $row['total'];\n\t\t\t\tbreak;\n\t\t\tcase 'spam':\n\t\t\t\t$comment_count['spam']            = $row['total'];\n\t\t\t\t$comment_count['total_comments'] += $row['total'];\n\t\t\t\tbreak;\n\t\t\tcase '1':\n\t\t\t\t$comment_count['approved']        = $row['total'];\n\t\t\t\t$comment_count['total_comments'] += $row['total'];\n\t\t\t\t$comment_count['all']            += $row['total'];\n\t\t\t\tbreak;\n\t\t\tcase '0':\n\t\t\t\t$comment_count['awaiting_moderation'] = $row['total'];\n\t\t\t\t$comment_count['total_comments']     += $row['total'];\n\t\t\t\t$comment_count['all']                += $row['total'];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn array_map( 'intval', $comment_count );\n}\n\n//\n// Comment meta functions.\n//\n\n/**\n * Add meta data field to a comment.\n *\n * @since 2.9.0\n *\n * @link https://developer.wordpress.org/reference/functions/add_comment_meta/\n *\n * @param int    $comment_id Comment ID.\n * @param string $meta_key   Metadata name.\n * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.\n * @param bool   $unique     Optional. Whether the same key should not be added.\n *                           Default false.\n * @return int|bool Meta ID on success, false on failure.\n */\nfunction add_comment_meta( $comment_id, $meta_key, $meta_value, $unique = false ) {\n\treturn add_metadata( 'comment', $comment_id, $meta_key, $meta_value, $unique );\n}\n\n/**\n * Remove metadata matching criteria from a comment.\n *\n * You can match based on the key, or key and value. Removing based on key and\n * value, will keep from removing duplicate metadata with the same key. It also\n * allows removing all metadata matching key, if needed.\n *\n * @since 2.9.0\n *\n * @link https://developer.wordpress.org/reference/functions/delete_comment_meta/\n *\n * @param int    $comment_id Comment ID.\n * @param string $meta_key   Metadata name.\n * @param mixed  $meta_value Optional. Metadata value. If provided,\n *                           rows will only be removed that match the value.\n *                           Must be serializable if non-scalar. Default empty.\n * @return bool True on success, false on failure.\n */\nfunction delete_comment_meta( $comment_id, $meta_key, $meta_value = '' ) {\n\treturn delete_metadata( 'comment', $comment_id, $meta_key, $meta_value );\n}\n\n/**\n * Retrieve comment meta field for a comment.\n *\n * @since 2.9.0\n *\n * @link https://developer.wordpress.org/reference/functions/get_comment_meta/\n *\n * @param int    $comment_id Comment ID.\n * @param string $key        Optional. The meta key to retrieve. By default,\n *                           returns data for all keys.\n * @param bool   $single     Optional. Whether to return a single value.\n *                           This parameter has no effect if $key is not specified.\n *                           Default false.\n * @return mixed An array if $single is false. The value of meta data field\n *               if $single is true. False for an invalid $comment_id.\n */\nfunction get_comment_meta( $comment_id, $key = '', $single = false ) {\n\treturn get_metadata( 'comment', $comment_id, $key, $single );\n}\n\n/**\n * Update comment meta field based on comment ID.\n *\n * Use the $prev_value parameter to differentiate between meta fields with the\n * same key and comment ID.\n *\n * If the meta field for the comment does not exist, it will be added.\n *\n * @since 2.9.0\n *\n * @link https://developer.wordpress.org/reference/functions/update_comment_meta/\n *\n * @param int    $comment_id Comment ID.\n * @param string $meta_key   Metadata key.\n * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.\n * @param mixed  $prev_value Optional. Previous value to check before updating.\n *                           If specified, only update existing metadata entries with\n *                           this value. Otherwise, update all entries. Default empty.\n * @return int|bool Meta ID if the key didn't exist, true on successful update,\n *                  false on failure or if the value passed to the function\n *                  is the same as the one that is already in the database.\n */\nfunction update_comment_meta( $comment_id, $meta_key, $meta_value, $prev_value = '' ) {\n\treturn update_metadata( 'comment', $comment_id, $meta_key, $meta_value, $prev_value );\n}\n\n/**\n * Queues comments for metadata lazy-loading.\n *\n * @since 4.5.0\n *\n * @param WP_Comment[] $comments Array of comment objects.\n */\nfunction wp_queue_comments_for_comment_meta_lazyload( $comments ) {\n\t// Don't use `wp_list_pluck()` to avoid by-reference manipulation.\n\t$comment_ids = array();\n\tif ( is_array( $comments ) ) {\n\t\tforeach ( $comments as $comment ) {\n\t\t\tif ( $comment instanceof WP_Comment ) {\n\t\t\t\t$comment_ids[] = $comment->comment_ID;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( $comment_ids ) {\n\t\t$lazyloader = wp_metadata_lazyloader();\n\t\t$lazyloader->queue_objects( 'comment', $comment_ids );\n\t}\n}\n\n/**\n * Sets the cookies used to store an unauthenticated commentator's identity. Typically used\n * to recall previous comments by this commentator that are still held in moderation.\n *\n * @since 3.4.0\n * @since 4.9.6 The `$cookies_consent` parameter was added.\n *\n * @param WP_Comment $comment         Comment object.\n * @param WP_User    $user            Comment author's user object. The user may not exist.\n * @param bool       $cookies_consent Optional. Comment author's consent to store cookies. Default true.\n */\nfunction wp_set_comment_cookies( $comment, $user, $cookies_consent = true ) {\n\t// If the user already exists, or the user opted out of cookies, don't set cookies.\n\tif ( $user->exists() ) {\n\t\treturn;\n\t}\n\n\tif ( false === $cookies_consent ) {\n\t\t// Remove any existing cookies.\n\t\t$past = time() - YEAR_IN_SECONDS;\n\t\tsetcookie( 'comment_author_' . COOKIEHASH, ' ', $past, COOKIEPATH, COOKIE_DOMAIN );\n\t\tsetcookie( 'comment_author_email_' . COOKIEHASH, ' ', $past, COOKIEPATH, COOKIE_DOMAIN );\n\t\tsetcookie( 'comment_author_url_' . COOKIEHASH, ' ', $past, COOKIEPATH, COOKIE_DOMAIN );\n\n\t\treturn;\n\t}\n\n\t/**\n\t * Filters the lifetime of the comment cookie in seconds.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param int $seconds Comment cookie lifetime. Default 30000000.\n\t */\n\t$comment_cookie_lifetime = time() + apply_filters( 'comment_cookie_lifetime', 30000000 );\n\n\t$secure = ( 'https' === parse_url( home_url(), PHP_URL_SCHEME ) );\n\n\tsetcookie( 'comment_author_' . COOKIEHASH, $comment->comment_author, $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN, $secure );\n\tsetcookie( 'comment_author_email_' . COOKIEHASH, $comment->comment_author_email, $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN, $secure );\n\tsetcookie( 'comment_author_url_' . COOKIEHASH, esc_url( $comment->comment_author_url ), $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN, $secure );\n}\n\n/**\n * Sanitizes the cookies sent to the user already.\n *\n * Will only do anything if the cookies have already been created for the user.\n * Mostly used after cookies had been sent to use elsewhere.\n *\n * @since 2.0.4\n */\nfunction sanitize_comment_cookies() {\n\tif ( isset( $_COOKIE[ 'comment_author_' . COOKIEHASH ] ) ) {\n\t\t/**\n\t\t * Filters the comment author's name cookie before it is set.\n\t\t *\n\t\t * When this filter hook is evaluated in wp_filter_comment(),\n\t\t * the comment author's name string is passed.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param string $author_cookie The comment author name cookie.\n\t\t */\n\t\t$comment_author                            = apply_filters( 'pre_comment_author_name', $_COOKIE[ 'comment_author_' . COOKIEHASH ] );\n\t\t$comment_author                            = wp_unslash( $comment_author );\n\t\t$comment_author                            = esc_attr( $comment_author );\n\t\t$_COOKIE[ 'comment_author_' . COOKIEHASH ] = $comment_author;\n\t}\n\n\tif ( isset( $_COOKIE[ 'comment_author_email_' . COOKIEHASH ] ) ) {\n\t\t/**\n\t\t * Filters the comment author's email cookie before it is set.\n\t\t *\n\t\t * When this filter hook is evaluated in wp_filter_comment(),\n\t\t * the comment author's email string is passed.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param string $author_email_cookie The comment author email cookie.\n\t\t */\n\t\t$comment_author_email                            = apply_filters( 'pre_comment_author_email', $_COOKIE[ 'comment_author_email_' . COOKIEHASH ] );\n\t\t$comment_author_email                            = wp_unslash( $comment_author_email );\n\t\t$comment_author_email                            = esc_attr( $comment_author_email );\n\t\t$_COOKIE[ 'comment_author_email_' . COOKIEHASH ] = $comment_author_email;\n\t}\n\n\tif ( isset( $_COOKIE[ 'comment_author_url_' . COOKIEHASH ] ) ) {\n\t\t/**\n\t\t * Filters the comment author's URL cookie before it is set.\n\t\t *\n\t\t * When this filter hook is evaluated in wp_filter_comment(),\n\t\t * the comment author's URL string is passed.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param string $author_url_cookie The comment author URL cookie.\n\t\t */\n\t\t$comment_author_url                            = apply_filters( 'pre_comment_author_url', $_COOKIE[ 'comment_author_url_' . COOKIEHASH ] );\n\t\t$comment_author_url                            = wp_unslash( $comment_author_url );\n\t\t$_COOKIE[ 'comment_author_url_' . COOKIEHASH ] = $comment_author_url;\n\t}\n}\n\n/**\n * Validates whether this comment is allowed to be made.\n *\n * @since 2.0.0\n * @since 4.7.0 The `$avoid_die` parameter was added, allowing the function\n *              to return a WP_Error object instead of dying.\n * @since 5.5.0 The `$avoid_die` parameter was renamed to `$wp_error`.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param array $commentdata Contains information on the comment.\n * @param bool  $wp_error    When true, a disallowed comment will result in the function\n *                           returning a WP_Error object, rather than executing wp_die().\n *                           Default false.\n * @return int|string|WP_Error Allowed comments return the approval status (0|1|'spam'|'trash').\n *                             If `$wp_error` is true, disallowed comments return a WP_Error.\n */\nfunction wp_allow_comment( $commentdata, $wp_error = false ) {\n\tglobal $wpdb;\n\n\t// Simple duplicate check.\n\t// expected_slashed ($comment_post_ID, $comment_author, $comment_author_email, $comment_content)\n\t$dupe = $wpdb->prepare(\n\t\t\"SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = %s AND comment_approved != 'trash' AND ( comment_author = %s \",\n\t\twp_unslash( $commentdata['comment_post_ID'] ),\n\t\twp_unslash( $commentdata['comment_parent'] ),\n\t\twp_unslash( $commentdata['comment_author'] )\n\t);\n\tif ( $commentdata['comment_author_email'] ) {\n\t\t$dupe .= $wpdb->prepare(\n\t\t\t'AND comment_author_email = %s ',\n\t\t\twp_unslash( $commentdata['comment_author_email'] )\n\t\t);\n\t}\n\t$dupe .= $wpdb->prepare(\n\t\t') AND comment_content = %s LIMIT 1',\n\t\twp_unslash( $commentdata['comment_content'] )\n\t);\n\n\t$dupe_id = $wpdb->get_var( $dupe );\n\n\t/**\n\t * Filters the ID, if any, of the duplicate comment found when creating a new comment.\n\t *\n\t * Return an empty value from this filter to allow what WP considers a duplicate comment.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param int   $dupe_id     ID of the comment identified as a duplicate.\n\t * @param array $commentdata Data for the comment being created.\n\t */\n\t$dupe_id = apply_filters( 'duplicate_comment_id', $dupe_id, $commentdata );\n\n\tif ( $dupe_id ) {\n\t\t/**\n\t\t * Fires immediately after a duplicate comment is detected.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param array $commentdata Comment data.\n\t\t */\n\t\tdo_action( 'comment_duplicate_trigger', $commentdata );\n\n\t\t/**\n\t\t * Filters duplicate comment error message.\n\t\t *\n\t\t * @since 5.2.0\n\t\t *\n\t\t * @param string $comment_duplicate_message Duplicate comment error message.\n\t\t */\n\t\t$comment_duplicate_message = apply_filters( 'comment_duplicate_message', __( 'Duplicate comment detected; it looks as though you&#8217;ve already said that!' ) );\n\n\t\tif ( $wp_error ) {\n\t\t\treturn new WP_Error( 'comment_duplicate', $comment_duplicate_message, 409 );\n\t\t} else {\n\t\t\tif ( wp_doing_ajax() ) {\n\t\t\t\tdie( $comment_duplicate_message );\n\t\t\t}\n\n\t\t\twp_die( $comment_duplicate_message, 409 );\n\t\t}\n\t}\n\n\t/**\n\t * Fires immediately before a comment is marked approved.\n\t *\n\t * Allows checking for comment flooding.\n\t *\n\t * @since 2.3.0\n\t * @since 4.7.0 The `$avoid_die` parameter was added.\n\t * @since 5.5.0 The `$avoid_die` parameter was renamed to `$wp_error`.\n\t *\n\t * @param string $comment_author_IP    Comment author's IP address.\n\t * @param string $comment_author_email Comment author's email.\n\t * @param string $comment_date_gmt     GMT date the comment was posted.\n\t * @param bool   $wp_error             Whether to return a WP_Error object instead of executing\n\t *                                     wp_die() or die() if a comment flood is occurring.\n\t */\n\tdo_action(\n\t\t'check_comment_flood',\n\t\t$commentdata['comment_author_IP'],\n\t\t$commentdata['comment_author_email'],\n\t\t$commentdata['comment_date_gmt'],\n\t\t$wp_error\n\t);\n\n\t/**\n\t * Filters whether a comment is part of a comment flood.\n\t *\n\t * The default check is wp_check_comment_flood(). See check_comment_flood_db().\n\t *\n\t * @since 4.7.0\n\t * @since 5.5.0 The `$avoid_die` parameter was renamed to `$wp_error`.\n\t *\n\t * @param bool   $is_flood             Is a comment flooding occurring? Default false.\n\t * @param string $comment_author_IP    Comment author's IP address.\n\t * @param string $comment_author_email Comment author's email.\n\t * @param string $comment_date_gmt     GMT date the comment was posted.\n\t * @param bool   $wp_error             Whether to return a WP_Error object instead of executing\n\t *                                     wp_die() or die() if a comment flood is occurring.\n\t */\n\t$is_flood = apply_filters(\n\t\t'wp_is_comment_flood',\n\t\tfalse,\n\t\t$commentdata['comment_author_IP'],\n\t\t$commentdata['comment_author_email'],\n\t\t$commentdata['comment_date_gmt'],\n\t\t$wp_error\n\t);\n\n\tif ( $is_flood ) {\n\t\t/** This filter is documented in wp-includes/comment-template.php */\n\t\t$comment_flood_message = apply_filters( 'comment_flood_message', __( 'You are posting comments too quickly. Slow down.' ) );\n\n\t\treturn new WP_Error( 'comment_flood', $comment_flood_message, 429 );\n\t}\n\n\tif ( ! empty( $commentdata['user_id'] ) ) {\n\t\t$user        = get_userdata( $commentdata['user_id'] );\n\t\t$post_author = $wpdb->get_var(\n\t\t\t$wpdb->prepare(\n\t\t\t\t\"SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1\",\n\t\t\t\t$commentdata['comment_post_ID']\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( isset( $user ) && ( $commentdata['user_id'] == $post_author || $user->has_cap( 'moderate_comments' ) ) ) {\n\t\t// The author and the admins get respect.\n\t\t$approved = 1;\n\t} else {\n\t\t// Everyone else's comments will be checked.\n\t\tif ( check_comment(\n\t\t\t$commentdata['comment_author'],\n\t\t\t$commentdata['comment_author_email'],\n\t\t\t$commentdata['comment_author_url'],\n\t\t\t$commentdata['comment_content'],\n\t\t\t$commentdata['comment_author_IP'],\n\t\t\t$commentdata['comment_agent'],\n\t\t\t$commentdata['comment_type']\n\t\t) ) {\n\t\t\t$approved = 1;\n\t\t} else {\n\t\t\t$approved = 0;\n\t\t}\n\n\t\tif ( wp_check_comment_disallowed_list(\n\t\t\t$commentdata['comment_author'],\n\t\t\t$commentdata['comment_author_email'],\n\t\t\t$commentdata['comment_author_url'],\n\t\t\t$commentdata['comment_content'],\n\t\t\t$commentdata['comment_author_IP'],\n\t\t\t$commentdata['comment_agent']\n\t\t) ) {\n\t\t\t$approved = EMPTY_TRASH_DAYS ? 'trash' : 'spam';\n\t\t}\n\t}\n\n\t/**\n\t * Filters a comment's approval status before it is set.\n\t *\n\t * @since 2.1.0\n\t * @since 4.9.0 Returning a WP_Error value from the filter will short-circuit comment insertion\n\t *              and allow skipping further processing.\n\t *\n\t * @param int|string|WP_Error $approved    The approval status. Accepts 1, 0, 'spam', 'trash',\n\t *                                         or WP_Error.\n\t * @param array               $commentdata Comment data.\n\t */\n\treturn apply_filters( 'pre_comment_approved', $approved, $commentdata );\n}\n\n/**\n * Hooks WP's native database-based comment-flood check.\n *\n * This wrapper maintains backward compatibility with plugins that expect to\n * be able to unhook the legacy check_comment_flood_db() function from\n * 'check_comment_flood' using remove_action().\n *\n * @since 2.3.0\n * @since 4.7.0 Converted to be an add_filter() wrapper.\n */\nfunction check_comment_flood_db() {\n\tadd_filter( 'wp_is_comment_flood', 'wp_check_comment_flood', 10, 5 );\n}\n\n/**\n * Checks whether comment flooding is occurring.\n *\n * Won't run, if current user can manage options, so to not block\n * administrators.\n *\n * @since 4.7.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param bool   $is_flood  Is a comment flooding occurring?\n * @param string $ip        Comment author's IP address.\n * @param string $email     Comment author's email address.\n * @param string $date      MySQL time string.\n * @param bool   $avoid_die When true, a disallowed comment will result in the function\n *                          returning without executing wp_die() or die(). Default false.\n * @return bool Whether comment flooding is occurring.\n */\nfunction wp_check_comment_flood( $is_flood, $ip, $email, $date, $avoid_die = false ) {\n\n\tglobal $wpdb;\n\n\t// Another callback has declared a flood. Trust it.\n\tif ( true === $is_flood ) {\n\t\treturn $is_flood;\n\t}\n\n\t// Don't throttle admins or moderators.\n\tif ( current_user_can( 'manage_options' ) || current_user_can( 'moderate_comments' ) ) {\n\t\treturn false;\n\t}\n\n\t$hour_ago = gmdate( 'Y-m-d H:i:s', time() - HOUR_IN_SECONDS );\n\n\tif ( is_user_logged_in() ) {\n\t\t$user         = get_current_user_id();\n\t\t$check_column = '`user_id`';\n\t} else {\n\t\t$user         = $ip;\n\t\t$check_column = '`comment_author_IP`';\n\t}\n\n\t$sql = $wpdb->prepare(\n\t\t\"SELECT `comment_date_gmt` FROM `$wpdb->comments` WHERE `comment_date_gmt` >= %s AND ( $check_column = %s OR `comment_author_email` = %s ) ORDER BY `comment_date_gmt` DESC LIMIT 1\",\n\t\t$hour_ago,\n\t\t$user,\n\t\t$email\n\t);\n\n\t$lasttime = $wpdb->get_var( $sql );\n\n\tif ( $lasttime ) {\n\t\t$time_lastcomment = mysql2date( 'U', $lasttime, false );\n\t\t$time_newcomment  = mysql2date( 'U', $date, false );\n\n\t\t/**\n\t\t * Filters the comment flood status.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param bool $bool             Whether a comment flood is occurring. Default false.\n\t\t * @param int  $time_lastcomment Timestamp of when the last comment was posted.\n\t\t * @param int  $time_newcomment  Timestamp of when the new comment was posted.\n\t\t */\n\t\t$flood_die = apply_filters( 'comment_flood_filter', false, $time_lastcomment, $time_newcomment );\n\n\t\tif ( $flood_die ) {\n\t\t\t/**\n\t\t\t * Fires before the comment flood message is triggered.\n\t\t\t *\n\t\t\t * @since 1.5.0\n\t\t\t *\n\t\t\t * @param int $time_lastcomment Timestamp of when the last comment was posted.\n\t\t\t * @param int $time_newcomment  Timestamp of when the new comment was posted.\n\t\t\t */\n\t\t\tdo_action( 'comment_flood_trigger', $time_lastcomment, $time_newcomment );\n\n\t\t\tif ( $avoid_die ) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * Filters the comment flood error message.\n\t\t\t\t *\n\t\t\t\t * @since 5.2.0\n\t\t\t\t *\n\t\t\t\t * @param string $comment_flood_message Comment flood error message.\n\t\t\t\t */\n\t\t\t\t$comment_flood_message = apply_filters( 'comment_flood_message', __( 'You are posting comments too quickly. Slow down.' ) );\n\n\t\t\t\tif ( wp_doing_ajax() ) {\n\t\t\t\t\tdie( $comment_flood_message );\n\t\t\t\t}\n\n\t\t\t\twp_die( $comment_flood_message, 429 );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Separates an array of comments into an array keyed by comment_type.\n *\n * @since 2.7.0\n *\n * @param WP_Comment[] $comments Array of comments\n * @return WP_Comment[] Array of comments keyed by comment_type.\n */\nfunction separate_comments( &$comments ) {\n\t$comments_by_type = array(\n\t\t'comment'   => array(),\n\t\t'trackback' => array(),\n\t\t'pingback'  => array(),\n\t\t'pings'     => array(),\n\t);\n\n\t$count = count( $comments );\n\n\tfor ( $i = 0; $i < $count; $i++ ) {\n\t\t$type = $comments[ $i ]->comment_type;\n\n\t\tif ( empty( $type ) ) {\n\t\t\t$type = 'comment';\n\t\t}\n\n\t\t$comments_by_type[ $type ][] = &$comments[ $i ];\n\n\t\tif ( 'trackback' === $type || 'pingback' === $type ) {\n\t\t\t$comments_by_type['pings'][] = &$comments[ $i ];\n\t\t}\n\t}\n\n\treturn $comments_by_type;\n}\n\n/**\n * Calculate the total number of comment pages.\n *\n * @since 2.7.0\n *\n * @uses Walker_Comment\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param WP_Comment[] $comments Optional. Array of WP_Comment objects. Defaults to `$wp_query->comments`.\n * @param int          $per_page Optional. Comments per page.\n * @param bool         $threaded Optional. Control over flat or threaded comments.\n * @return int Number of comment pages.\n */\nfunction get_comment_pages_count( $comments = null, $per_page = null, $threaded = null ) {\n\tglobal $wp_query;\n\n\tif ( null === $comments && null === $per_page && null === $threaded && ! empty( $wp_query->max_num_comment_pages ) ) {\n\t\treturn $wp_query->max_num_comment_pages;\n\t}\n\n\tif ( ( ! $comments || ! is_array( $comments ) ) && ! empty( $wp_query->comments ) ) {\n\t\t$comments = $wp_query->comments;\n\t}\n\n\tif ( empty( $comments ) ) {\n\t\treturn 0;\n\t}\n\n\tif ( ! get_option( 'page_comments' ) ) {\n\t\treturn 1;\n\t}\n\n\tif ( ! isset( $per_page ) ) {\n\t\t$per_page = (int) get_query_var( 'comments_per_page' );\n\t}\n\tif ( 0 === $per_page ) {\n\t\t$per_page = (int) get_option( 'comments_per_page' );\n\t}\n\tif ( 0 === $per_page ) {\n\t\treturn 1;\n\t}\n\n\tif ( ! isset( $threaded ) ) {\n\t\t$threaded = get_option( 'thread_comments' );\n\t}\n\n\tif ( $threaded ) {\n\t\t$walker = new Walker_Comment;\n\t\t$count  = ceil( $walker->get_number_of_root_elements( $comments ) / $per_page );\n\t} else {\n\t\t$count = ceil( count( $comments ) / $per_page );\n\t}\n\n\treturn $count;\n}\n\n/**\n * Calculate what page number a comment will appear on for comment paging.\n *\n * @since 2.7.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int   $comment_ID Comment ID.\n * @param array $args {\n *     Array of optional arguments.\n *\n *     @type string     $type      Limit paginated comments to those matching a given type.\n *                                 Accepts 'comment', 'trackback', 'pingback', 'pings'\n *                                 (trackbacks and pingbacks), or 'all'. Default 'all'.\n *     @type int        $per_page  Per-page count to use when calculating pagination.\n *                                 Defaults to the value of the 'comments_per_page' option.\n *     @type int|string $max_depth If greater than 1, comment page will be determined\n *                                 for the top-level parent `$comment_ID`.\n *                                 Defaults to the value of the 'thread_comments_depth' option.\n * } *\n * @return int|null Comment page number or null on error.\n */\nfunction get_page_of_comment( $comment_ID, $args = array() ) {\n\tglobal $wpdb;\n\n\t$page = null;\n\n\t$comment = get_comment( $comment_ID );\n\tif ( ! $comment ) {\n\t\treturn;\n\t}\n\n\t$defaults      = array(\n\t\t'type'      => 'all',\n\t\t'page'      => '',\n\t\t'per_page'  => '',\n\t\t'max_depth' => '',\n\t);\n\t$args          = wp_parse_args( $args, $defaults );\n\t$original_args = $args;\n\n\t// Order of precedence: 1. `$args['per_page']`, 2. 'comments_per_page' query_var, 3. 'comments_per_page' option.\n\tif ( get_option( 'page_comments' ) ) {\n\t\tif ( '' === $args['per_page'] ) {\n\t\t\t$args['per_page'] = get_query_var( 'comments_per_page' );\n\t\t}\n\n\t\tif ( '' === $args['per_page'] ) {\n\t\t\t$args['per_page'] = get_option( 'comments_per_page' );\n\t\t}\n\t}\n\n\tif ( empty( $args['per_page'] ) ) {\n\t\t$args['per_page'] = 0;\n\t\t$args['page']     = 0;\n\t}\n\n\tif ( $args['per_page'] < 1 ) {\n\t\t$page = 1;\n\t}\n\n\tif ( null === $page ) {\n\t\tif ( '' === $args['max_depth'] ) {\n\t\t\tif ( get_option( 'thread_comments' ) ) {\n\t\t\t\t$args['max_depth'] = get_option( 'thread_comments_depth' );\n\t\t\t} else {\n\t\t\t\t$args['max_depth'] = -1;\n\t\t\t}\n\t\t}\n\n\t\t// Find this comment's top-level parent if threading is enabled.\n\t\tif ( $args['max_depth'] > 1 && 0 != $comment->comment_parent ) {\n\t\t\treturn get_page_of_comment( $comment->comment_parent, $args );\n\t\t}\n\n\t\t$comment_args = array(\n\t\t\t'type'       => $args['type'],\n\t\t\t'post_id'    => $comment->comment_post_ID,\n\t\t\t'fields'     => 'ids',\n\t\t\t'count'      => true,\n\t\t\t'status'     => 'approve',\n\t\t\t'parent'     => 0,\n\t\t\t'date_query' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'column' => \"$wpdb->comments.comment_date_gmt\",\n\t\t\t\t\t'before' => $comment->comment_date_gmt,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\tif ( is_user_logged_in() ) {\n\t\t\t$comment_args['include_unapproved'] = array( get_current_user_id() );\n\t\t} else {\n\t\t\t$unapproved_email = wp_get_unapproved_comment_author_email();\n\n\t\t\tif ( $unapproved_email ) {\n\t\t\t\t$comment_args['include_unapproved'] = array( $unapproved_email );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the arguments used to query comments in get_page_of_comment().\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @see WP_Comment_Query::__construct()\n\t\t *\n\t\t * @param array $comment_args {\n\t\t *     Array of WP_Comment_Query arguments.\n\t\t *\n\t\t *     @type string $type               Limit paginated comments to those matching a given type.\n\t\t *                                      Accepts 'comment', 'trackback', 'pingback', 'pings'\n\t\t *                                      (trackbacks and pingbacks), or 'all'. Default 'all'.\n\t\t *     @type int    $post_id            ID of the post.\n\t\t *     @type string $fields             Comment fields to return.\n\t\t *     @type bool   $count              Whether to return a comment count (true) or array\n\t\t *                                      of comment objects (false).\n\t\t *     @type string $status             Comment status.\n\t\t *     @type int    $parent             Parent ID of comment to retrieve children of.\n\t\t *     @type array  $date_query         Date query clauses to limit comments by. See WP_Date_Query.\n\t\t *     @type array  $include_unapproved Array of IDs or email addresses whose unapproved comments\n\t\t *                                      will be included in paginated comments.\n\t\t * }\n\t\t */\n\t\t$comment_args = apply_filters( 'get_page_of_comment_query_args', $comment_args );\n\n\t\t$comment_query       = new WP_Comment_Query();\n\t\t$older_comment_count = $comment_query->query( $comment_args );\n\n\t\t// No older comments? Then it's page #1.\n\t\tif ( 0 == $older_comment_count ) {\n\t\t\t$page = 1;\n\n\t\t\t// Divide comments older than this one by comments per page to get this comment's page number.\n\t\t} else {\n\t\t\t$page = ceil( ( $older_comment_count + 1 ) / $args['per_page'] );\n\t\t}\n\t}\n\n\t/**\n\t * Filters the calculated page on which a comment appears.\n\t *\n\t * @since 4.4.0\n\t * @since 4.7.0 Introduced the `$comment_ID` parameter.\n\t *\n\t * @param int   $page          Comment page.\n\t * @param array $args {\n\t *     Arguments used to calculate pagination. These include arguments auto-detected by the function,\n\t *     based on query vars, system settings, etc. For pristine arguments passed to the function,\n\t *     see `$original_args`.\n\t *\n\t *     @type string $type      Type of comments to count.\n\t *     @type int    $page      Calculated current page.\n\t *     @type int    $per_page  Calculated number of comments per page.\n\t *     @type int    $max_depth Maximum comment threading depth allowed.\n\t * }\n\t * @param array $original_args {\n\t *     Array of arguments passed to the function. Some or all of these may not be set.\n\t *\n\t *     @type string $type      Type of comments to count.\n\t *     @type int    $page      Current comment page.\n\t *     @type int    $per_page  Number of comments per page.\n\t *     @type int    $max_depth Maximum comment threading depth allowed.\n\t * }\n\t * @param int $comment_ID ID of the comment.\n\t */\n\treturn apply_filters( 'get_page_of_comment', (int) $page, $args, $original_args, $comment_ID );\n}\n\n/**\n * Retrieves the maximum character lengths for the comment form fields.\n *\n * @since 4.5.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @return int[] Array of maximum lengths keyed by field name.\n */\nfunction wp_get_comment_fields_max_lengths() {\n\tglobal $wpdb;\n\n\t$lengths = array(\n\t\t'comment_author'       => 245,\n\t\t'comment_author_email' => 100,\n\t\t'comment_author_url'   => 200,\n\t\t'comment_content'      => 65525,\n\t);\n\n\tif ( $wpdb->is_mysql ) {\n\t\tforeach ( $lengths as $column => $length ) {\n\t\t\t$col_length = $wpdb->get_col_length( $wpdb->comments, $column );\n\t\t\t$max_length = 0;\n\n\t\t\t// No point if we can't get the DB column lengths.\n\t\t\tif ( is_wp_error( $col_length ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( ! is_array( $col_length ) && (int) $col_length > 0 ) {\n\t\t\t\t$max_length = (int) $col_length;\n\t\t\t} elseif ( is_array( $col_length ) && isset( $col_length['length'] ) && intval( $col_length['length'] ) > 0 ) {\n\t\t\t\t$max_length = (int) $col_length['length'];\n\n\t\t\t\tif ( ! empty( $col_length['type'] ) && 'byte' === $col_length['type'] ) {\n\t\t\t\t\t$max_length = $max_length - 10;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $max_length > 0 ) {\n\t\t\t\t$lengths[ $column ] = $max_length;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filters the lengths for the comment form fields.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param int[] $lengths Array of maximum lengths keyed by field name.\n\t */\n\treturn apply_filters( 'wp_get_comment_fields_max_lengths', $lengths );\n}\n\n/**\n * Compares the lengths of comment data against the maximum character limits.\n *\n * @since 4.7.0\n *\n * @param array $comment_data Array of arguments for inserting a comment.\n * @return WP_Error|true WP_Error when a comment field exceeds the limit,\n *                       otherwise true.\n */\nfunction wp_check_comment_data_max_lengths( $comment_data ) {\n\t$max_lengths = wp_get_comment_fields_max_lengths();\n\n\tif ( isset( $comment_data['comment_author'] ) && mb_strlen( $comment_data['comment_author'], '8bit' ) > $max_lengths['comment_author'] ) {\n\t\treturn new WP_Error( 'comment_author_column_length', __( '<strong>Error</strong>: Your name is too long.' ), 200 );\n\t}\n\n\tif ( isset( $comment_data['comment_author_email'] ) && strlen( $comment_data['comment_author_email'] ) > $max_lengths['comment_author_email'] ) {\n\t\treturn new WP_Error( 'comment_author_email_column_length', __( '<strong>Error</strong>: Your email address is too long.' ), 200 );\n\t}\n\n\tif ( isset( $comment_data['comment_author_url'] ) && strlen( $comment_data['comment_author_url'] ) > $max_lengths['comment_author_url'] ) {\n\t\treturn new WP_Error( 'comment_author_url_column_length', __( '<strong>Error</strong>: Your URL is too long.' ), 200 );\n\t}\n\n\tif ( isset( $comment_data['comment_content'] ) && mb_strlen( $comment_data['comment_content'], '8bit' ) > $max_lengths['comment_content'] ) {\n\t\treturn new WP_Error( 'comment_content_column_length', __( '<strong>Error</strong>: Your comment is too long.' ), 200 );\n\t}\n\n\treturn true;\n}\n\n/**\n * Checks if a comment contains disallowed characters or words.\n *\n * @since 5.5.0\n *\n * @param string $author The author of the comment\n * @param string $email The email of the comment\n * @param string $url The url used in the comment\n * @param string $comment The comment content\n * @param string $user_ip The comment author's IP address\n * @param string $user_agent The author's browser user agent\n * @return bool True if comment contains disallowed content, false if comment does not\n */\nfunction wp_check_comment_disallowed_list( $author, $email, $url, $comment, $user_ip, $user_agent ) {\n\t/**\n\t * Fires before the comment is tested for disallowed characters or words.\n\t *\n\t * @since 1.5.0\n\t * @deprecated 5.5.0 Use {@see 'wp_check_comment_disallowed_list'} instead.\n\t *\n\t * @param string $author     Comment author.\n\t * @param string $email      Comment author's email.\n\t * @param string $url        Comment author's URL.\n\t * @param string $comment    Comment content.\n\t * @param string $user_ip    Comment author's IP address.\n\t * @param string $user_agent Comment author's browser user agent.\n\t */\n\tdo_action_deprecated(\n\t\t'wp_blacklist_check',\n\t\tarray( $author, $email, $url, $comment, $user_ip, $user_agent ),\n\t\t'5.5.0',\n\t\t'wp_check_comment_disallowed_list',\n\t\t__( 'Please consider writing more inclusive code.' )\n\t);\n\n\t/**\n\t * Fires before the comment is tested for disallowed characters or words.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $author     Comment author.\n\t * @param string $email      Comment author's email.\n\t * @param string $url        Comment author's URL.\n\t * @param string $comment    Comment content.\n\t * @param string $user_ip    Comment author's IP address.\n\t * @param string $user_agent Comment author's browser user agent.\n\t */\n\tdo_action( 'wp_check_comment_disallowed_list', $author, $email, $url, $comment, $user_ip, $user_agent );\n\n\t$mod_keys = trim( get_option( 'disallowed_keys' ) );\n\tif ( '' === $mod_keys ) {\n\t\treturn false; // If moderation keys are empty.\n\t}\n\n\t// Ensure HTML tags are not being used to bypass the list of disallowed characters and words.\n\t$comment_without_html = wp_strip_all_tags( $comment );\n\n\t$words = explode( \"\\n\", $mod_keys );\n\n\tforeach ( (array) $words as $word ) {\n\t\t$word = trim( $word );\n\n\t\t// Skip empty lines.\n\t\tif ( empty( $word ) ) {\n\t\t\tcontinue; }\n\n\t\t// Do some escaping magic so that '#' chars\n\t\t// in the spam words don't break things:\n\t\t$word = preg_quote( $word, '#' );\n\n\t\t$pattern = \"#$word#i\";\n\t\tif ( preg_match( $pattern, $author )\n\t\t\t|| preg_match( $pattern, $email )\n\t\t\t|| preg_match( $pattern, $url )\n\t\t\t|| preg_match( $pattern, $comment )\n\t\t\t|| preg_match( $pattern, $comment_without_html )\n\t\t\t|| preg_match( $pattern, $user_ip )\n\t\t\t|| preg_match( $pattern, $user_agent )\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Retrieves the total comment counts for the whole site or a single post.\n *\n * The comment stats are cached and then retrieved, if they already exist in the\n * cache.\n *\n * @see get_comment_count() Which handles fetching the live comment counts.\n *\n * @since 2.5.0\n *\n * @param int $post_id Optional. Restrict the comment counts to the given post. Default 0, which indicates that\n *                     comment counts for the whole site will be retrieved.\n * @return stdClass {\n *     The number of comments keyed by their status.\n *\n *     @type int $approved       The number of approved comments.\n *     @type int $moderated      The number of comments awaiting moderation (a.k.a. pending).\n *     @type int $spam           The number of spam comments.\n *     @type int $trash          The number of trashed comments.\n *     @type int $post-trashed   The number of comments for posts that are in the trash.\n *     @type int $total_comments The total number of non-trashed comments, including spam.\n *     @type int $all            The total number of pending or approved comments.\n * }\n */\nfunction wp_count_comments( $post_id = 0 ) {\n\t$post_id = (int) $post_id;\n\n\t/**\n\t * Filters the comments count for a given post or the whole site.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param array|stdClass $count   An empty array or an object containing comment counts.\n\t * @param int            $post_id The post ID. Can be 0 to represent the whole site.\n\t */\n\t$filtered = apply_filters( 'wp_count_comments', array(), $post_id );\n\tif ( ! empty( $filtered ) ) {\n\t\treturn $filtered;\n\t}\n\n\t$count = wp_cache_get( \"comments-{$post_id}\", 'counts' );\n\tif ( false !== $count ) {\n\t\treturn $count;\n\t}\n\n\t$stats              = get_comment_count( $post_id );\n\t$stats['moderated'] = $stats['awaiting_moderation'];\n\tunset( $stats['awaiting_moderation'] );\n\n\t$stats_object = (object) $stats;\n\twp_cache_set( \"comments-{$post_id}\", $stats_object, 'counts' );\n\n\treturn $stats_object;\n}\n\n/**\n * Trashes or deletes a comment.\n *\n * The comment is moved to Trash instead of permanently deleted unless Trash is\n * disabled, item is already in the Trash, or $force_delete is true.\n *\n * The post comment count will be updated if the comment was approved and has a\n * post ID available.\n *\n * @since 2.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int|WP_Comment $comment_id   Comment ID or WP_Comment object.\n * @param bool           $force_delete Whether to bypass Trash and force deletion. Default false.\n * @return bool True on success, false on failure.\n */\nfunction wp_delete_comment( $comment_id, $force_delete = false ) {\n\tglobal $wpdb;\n\t$comment = get_comment( $comment_id );\n\tif ( ! $comment ) {\n\t\treturn false;\n\t}\n\n\tif ( ! $force_delete && EMPTY_TRASH_DAYS && ! in_array( wp_get_comment_status( $comment ), array( 'trash', 'spam' ), true ) ) {\n\t\treturn wp_trash_comment( $comment_id );\n\t}\n\n\t/**\n\t * Fires immediately before a comment is deleted from the database.\n\t *\n\t * @since 1.2.0\n\t * @since 4.9.0 Added the `$comment` parameter.\n\t *\n\t * @param int        $comment_id The comment ID.\n\t * @param WP_Comment $comment    The comment to be deleted.\n\t */\n\tdo_action( 'delete_comment', $comment->comment_ID, $comment );\n\n\t// Move children up a level.\n\t$children = $wpdb->get_col( $wpdb->prepare( \"SELECT comment_ID FROM $wpdb->comments WHERE comment_parent = %d\", $comment->comment_ID ) );\n\tif ( ! empty( $children ) ) {\n\t\t$wpdb->update( $wpdb->comments, array( 'comment_parent' => $comment->comment_parent ), array( 'comment_parent' => $comment->comment_ID ) );\n\t\tclean_comment_cache( $children );\n\t}\n\n\t// Delete metadata.\n\t$meta_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT meta_id FROM $wpdb->commentmeta WHERE comment_id = %d\", $comment->comment_ID ) );\n\tforeach ( $meta_ids as $mid ) {\n\t\tdelete_metadata_by_mid( 'comment', $mid );\n\t}\n\n\tif ( ! $wpdb->delete( $wpdb->comments, array( 'comment_ID' => $comment->comment_ID ) ) ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Fires immediately after a comment is deleted from the database.\n\t *\n\t * @since 2.9.0\n\t * @since 4.9.0 Added the `$comment` parameter.\n\t *\n\t * @param int        $comment_id The comment ID.\n\t * @param WP_Comment $comment    The deleted comment.\n\t */\n\tdo_action( 'deleted_comment', $comment->comment_ID, $comment );\n\n\t$post_id = $comment->comment_post_ID;\n\tif ( $post_id && 1 == $comment->comment_approved ) {\n\t\twp_update_comment_count( $post_id );\n\t}\n\n\tclean_comment_cache( $comment->comment_ID );\n\n\t/** This action is documented in wp-includes/comment.php */\n\tdo_action( 'wp_set_comment_status', $comment->comment_ID, 'delete' );\n\n\twp_transition_comment_status( 'delete', $comment->comment_approved, $comment );\n\n\treturn true;\n}\n\n/**\n * Moves a comment to the Trash\n *\n * If Trash is disabled, comment is permanently deleted.\n *\n * @since 2.9.0\n *\n * @param int|WP_Comment $comment_id Comment ID or WP_Comment object.\n * @return bool True on success, false on failure.\n */\nfunction wp_trash_comment( $comment_id ) {\n\tif ( ! EMPTY_TRASH_DAYS ) {\n\t\treturn wp_delete_comment( $comment_id, true );\n\t}\n\n\t$comment = get_comment( $comment_id );\n\tif ( ! $comment ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Fires immediately before a comment is sent to the Trash.\n\t *\n\t * @since 2.9.0\n\t * @since 4.9.0 Added the `$comment` parameter.\n\t *\n\t * @param int        $comment_id The comment ID.\n\t * @param WP_Comment $comment    The comment to be trashed.\n\t */\n\tdo_action( 'trash_comment', $comment->comment_ID, $comment );\n\n\tif ( wp_set_comment_status( $comment, 'trash' ) ) {\n\t\tdelete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' );\n\t\tdelete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' );\n\t\tadd_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', $comment->comment_approved );\n\t\tadd_comment_meta( $comment->comment_ID, '_wp_trash_meta_time', time() );\n\n\t\t/**\n\t\t * Fires immediately after a comment is sent to Trash.\n\t\t *\n\t\t * @since 2.9.0\n\t\t * @since 4.9.0 Added the `$comment` parameter.\n\t\t *\n\t\t * @param int        $comment_id The comment ID.\n\t\t * @param WP_Comment $comment    The trashed comment.\n\t\t */\n\t\tdo_action( 'trashed_comment', $comment->comment_ID, $comment );\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Removes a comment from the Trash\n *\n * @since 2.9.0\n *\n * @param int|WP_Comment $comment_id Comment ID or WP_Comment object.\n * @return bool True on success, false on failure.\n */\nfunction wp_untrash_comment( $comment_id ) {\n\t$comment = get_comment( $comment_id );\n\tif ( ! $comment ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Fires immediately before a comment is restored from the Trash.\n\t *\n\t * @since 2.9.0\n\t * @since 4.9.0 Added the `$comment` parameter.\n\t *\n\t * @param int        $comment_id The comment ID.\n\t * @param WP_Comment $comment    The comment to be untrashed.\n\t */\n\tdo_action( 'untrash_comment', $comment->comment_ID, $comment );\n\n\t$status = (string) get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true );\n\tif ( empty( $status ) ) {\n\t\t$status = '0';\n\t}\n\n\tif ( wp_set_comment_status( $comment, $status ) ) {\n\t\tdelete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' );\n\t\tdelete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' );\n\n\t\t/**\n\t\t * Fires immediately after a comment is restored from the Trash.\n\t\t *\n\t\t * @since 2.9.0\n\t\t * @since 4.9.0 Added the `$comment` parameter.\n\t\t *\n\t\t * @param int        $comment_id The comment ID.\n\t\t * @param WP_Comment $comment    The untrashed comment.\n\t\t */\n\t\tdo_action( 'untrashed_comment', $comment->comment_ID, $comment );\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Marks a comment as Spam\n *\n * @since 2.9.0\n *\n * @param int|WP_Comment $comment_id Comment ID or WP_Comment object.\n * @return bool True on success, false on failure.\n */\nfunction wp_spam_comment( $comment_id ) {\n\t$comment = get_comment( $comment_id );\n\tif ( ! $comment ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Fires immediately before a comment is marked as Spam.\n\t *\n\t * @since 2.9.0\n\t * @since 4.9.0 Added the `$comment` parameter.\n\t *\n\t * @param int        $comment_id The comment ID.\n\t * @param WP_Comment $comment    The comment to be marked as spam.\n\t */\n\tdo_action( 'spam_comment', $comment->comment_ID, $comment );\n\n\tif ( wp_set_comment_status( $comment, 'spam' ) ) {\n\t\tdelete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' );\n\t\tdelete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' );\n\t\tadd_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', $comment->comment_approved );\n\t\tadd_comment_meta( $comment->comment_ID, '_wp_trash_meta_time', time() );\n\n\t\t/**\n\t\t * Fires immediately after a comment is marked as Spam.\n\t\t *\n\t\t * @since 2.9.0\n\t\t * @since 4.9.0 Added the `$comment` parameter.\n\t\t *\n\t\t * @param int        $comment_id The comment ID.\n\t\t * @param WP_Comment $comment    The comment marked as spam.\n\t\t */\n\t\tdo_action( 'spammed_comment', $comment->comment_ID, $comment );\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Removes a comment from the Spam\n *\n * @since 2.9.0\n *\n * @param int|WP_Comment $comment_id Comment ID or WP_Comment object.\n * @return bool True on success, false on failure.\n */\nfunction wp_unspam_comment( $comment_id ) {\n\t$comment = get_comment( $comment_id );\n\tif ( ! $comment ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Fires immediately before a comment is unmarked as Spam.\n\t *\n\t * @since 2.9.0\n\t * @since 4.9.0 Added the `$comment` parameter.\n\t *\n\t * @param int        $comment_id The comment ID.\n\t * @param WP_Comment $comment    The comment to be unmarked as spam.\n\t */\n\tdo_action( 'unspam_comment', $comment->comment_ID, $comment );\n\n\t$status = (string) get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true );\n\tif ( empty( $status ) ) {\n\t\t$status = '0';\n\t}\n\n\tif ( wp_set_comment_status( $comment, $status ) ) {\n\t\tdelete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' );\n\t\tdelete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' );\n\n\t\t/**\n\t\t * Fires immediately after a comment is unmarked as Spam.\n\t\t *\n\t\t * @since 2.9.0\n\t\t * @since 4.9.0 Added the `$comment` parameter.\n\t\t *\n\t\t * @param int        $comment_id The comment ID.\n\t\t * @param WP_Comment $comment    The comment unmarked as spam.\n\t\t */\n\t\tdo_action( 'unspammed_comment', $comment->comment_ID, $comment );\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * The status of a comment by ID.\n *\n * @since 1.0.0\n *\n * @param int|WP_Comment $comment_id Comment ID or WP_Comment object\n * @return string|false Status might be 'trash', 'approved', 'unapproved', 'spam'. False on failure.\n */\nfunction wp_get_comment_status( $comment_id ) {\n\t$comment = get_comment( $comment_id );\n\tif ( ! $comment ) {\n\t\treturn false;\n\t}\n\n\t$approved = $comment->comment_approved;\n\n\tif ( null == $approved ) {\n\t\treturn false;\n\t} elseif ( '1' == $approved ) {\n\t\treturn 'approved';\n\t} elseif ( '0' == $approved ) {\n\t\treturn 'unapproved';\n\t} elseif ( 'spam' === $approved ) {\n\t\treturn 'spam';\n\t} elseif ( 'trash' === $approved ) {\n\t\treturn 'trash';\n\t} else {\n\t\treturn false;\n\t}\n}\n\n/**\n * Call hooks for when a comment status transition occurs.\n *\n * Calls hooks for comment status transitions. If the new comment status is not the same\n * as the previous comment status, then two hooks will be ran, the first is\n * {@see 'transition_comment_status'} with new status, old status, and comment data.\n * The next action called is {@see 'comment_$old_status_to_$new_status'}. It has\n * the comment data.\n *\n * The final action will run whether or not the comment statuses are the same.\n * The action is named {@see 'comment_$new_status_$comment->comment_type'}.\n *\n * @since 2.7.0\n *\n * @param string     $new_status New comment status.\n * @param string     $old_status Previous comment status.\n * @param WP_Comment $comment    Comment object.\n */\nfunction wp_transition_comment_status( $new_status, $old_status, $comment ) {\n\t/*\n\t * Translate raw statuses to human-readable formats for the hooks.\n\t * This is not a complete list of comment status, it's only the ones\n\t * that need to be renamed.\n\t */\n\t$comment_statuses = array(\n\t\t0         => 'unapproved',\n\t\t'hold'    => 'unapproved', // wp_set_comment_status() uses \"hold\".\n\t\t1         => 'approved',\n\t\t'approve' => 'approved',   // wp_set_comment_status() uses \"approve\".\n\t);\n\tif ( isset( $comment_statuses[ $new_status ] ) ) {\n\t\t$new_status = $comment_statuses[ $new_status ];\n\t}\n\tif ( isset( $comment_statuses[ $old_status ] ) ) {\n\t\t$old_status = $comment_statuses[ $old_status ];\n\t}\n\n\t// Call the hooks.\n\tif ( $new_status != $old_status ) {\n\t\t/**\n\t\t * Fires when the comment status is in transition.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param int|string $new_status The new comment status.\n\t\t * @param int|string $old_status The old comment status.\n\t\t * @param WP_Comment $comment    Comment object.\n\t\t */\n\t\tdo_action( 'transition_comment_status', $new_status, $old_status, $comment );\n\t\t/**\n\t\t * Fires when the comment status is in transition from one specific status to another.\n\t\t *\n\t\t * The dynamic portions of the hook name, `$old_status`, and `$new_status`,\n\t\t * refer to the old and new comment statuses, respectively.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param WP_Comment $comment Comment object.\n\t\t */\n\t\tdo_action( \"comment_{$old_status}_to_{$new_status}\", $comment );\n\t}\n\t/**\n\t * Fires when the status of a specific comment type is in transition.\n\t *\n\t * The dynamic portions of the hook name, `$new_status`, and `$comment->comment_type`,\n\t * refer to the new comment status, and the type of comment, respectively.\n\t *\n\t * Typical comment types include an empty string (standard comment), 'pingback',\n\t * or 'trackback'.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param int        $comment_ID The comment ID.\n\t * @param WP_Comment $comment    Comment object.\n\t */\n\tdo_action( \"comment_{$new_status}_{$comment->comment_type}\", $comment->comment_ID, $comment );\n}\n\n/**\n * Clear the lastcommentmodified cached value when a comment status is changed.\n *\n * Deletes the lastcommentmodified cache key when a comment enters or leaves\n * 'approved' status.\n *\n * @since 4.7.0\n * @access private\n *\n * @param string $new_status The new comment status.\n * @param string $old_status The old comment status.\n */\nfunction _clear_modified_cache_on_transition_comment_status( $new_status, $old_status ) {\n\tif ( 'approved' === $new_status || 'approved' === $old_status ) {\n\t\tforeach ( array( 'server', 'gmt', 'blog' ) as $timezone ) {\n\t\t\twp_cache_delete( \"lastcommentmodified:$timezone\", 'timeinfo' );\n\t\t}\n\t}\n}\n\n/**\n * Get current commenter's name, email, and URL.\n *\n * Expects cookies content to already be sanitized. User of this function might\n * wish to recheck the returned array for validity.\n *\n * @see sanitize_comment_cookies() Use to sanitize cookies\n *\n * @since 2.0.4\n *\n * @return array {\n *     An array of current commenter variables.\n *\n *     @type string $comment_author       The name of the current commenter, or an empty string.\n *     @type string $comment_author_email The email address of the current commenter, or an empty string.\n *     @type string $comment_author_url   The URL address of the current commenter, or an empty string.\n * }\n */\nfunction wp_get_current_commenter() {\n\t// Cookies should already be sanitized.\n\n\t$comment_author = '';\n\tif ( isset( $_COOKIE[ 'comment_author_' . COOKIEHASH ] ) ) {\n\t\t$comment_author = $_COOKIE[ 'comment_author_' . COOKIEHASH ];\n\t}\n\n\t$comment_author_email = '';\n\tif ( isset( $_COOKIE[ 'comment_author_email_' . COOKIEHASH ] ) ) {\n\t\t$comment_author_email = $_COOKIE[ 'comment_author_email_' . COOKIEHASH ];\n\t}\n\n\t$comment_author_url = '';\n\tif ( isset( $_COOKIE[ 'comment_author_url_' . COOKIEHASH ] ) ) {\n\t\t$comment_author_url = $_COOKIE[ 'comment_author_url_' . COOKIEHASH ];\n\t}\n\n\t/**\n\t * Filters the current commenter's name, email, and URL.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param array $comment_author_data {\n\t *     An array of current commenter variables.\n\t *\n\t *     @type string $comment_author       The name of the current commenter, or an empty string.\n\t *     @type string $comment_author_email The email address of the current commenter, or an empty string.\n\t *     @type string $comment_author_url   The URL address of the current commenter, or an empty string.\n\t * }\n\t */\n\treturn apply_filters( 'wp_get_current_commenter', compact( 'comment_author', 'comment_author_email', 'comment_author_url' ) );\n}\n\n/**\n * Get unapproved comment author's email.\n *\n * Used to allow the commenter to see their pending comment.\n *\n * @since 5.1.0\n *\n * @return string The unapproved comment author's email (when supplied).\n */\nfunction wp_get_unapproved_comment_author_email() {\n\t$commenter_email = '';\n\n\tif ( ! empty( $_GET['unapproved'] ) && ! empty( $_GET['moderation-hash'] ) ) {\n\t\t$comment_id = (int) $_GET['unapproved'];\n\t\t$comment    = get_comment( $comment_id );\n\n\t\tif ( $comment && hash_equals( $_GET['moderation-hash'], wp_hash( $comment->comment_date_gmt ) ) ) {\n\t\t\t// The comment will only be viewable by the comment author for 1 minute.\n\t\t\t$comment_preview_expires = strtotime( $comment->comment_date_gmt . '+1 minute' );\n\n\t\t\tif ( time() < $comment_preview_expires ) {\n\t\t\t\t$commenter_email = $comment->comment_author_email;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! $commenter_email ) {\n\t\t$commenter       = wp_get_current_commenter();\n\t\t$commenter_email = $commenter['comment_author_email'];\n\t}\n\n\treturn $commenter_email;\n}\n\n/**\n * Inserts a comment into the database.\n *\n * @since 2.0.0\n * @since 4.4.0 Introduced the `$comment_meta` argument.\n * @since 5.5.0 Default value for `$comment_type` argument changed to `comment`.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param array $commentdata {\n *     Array of arguments for inserting a new comment.\n *\n *     @type string     $comment_agent        The HTTP user agent of the `$comment_author` when\n *                                            the comment was submitted. Default empty.\n *     @type int|string $comment_approved     Whether the comment has been approved. Default 1.\n *     @type string     $comment_author       The name of the author of the comment. Default empty.\n *     @type string     $comment_author_email The email address of the `$comment_author`. Default empty.\n *     @type string     $comment_author_IP    The IP address of the `$comment_author`. Default empty.\n *     @type string     $comment_author_url   The URL address of the `$comment_author`. Default empty.\n *     @type string     $comment_content      The content of the comment. Default empty.\n *     @type string     $comment_date         The date the comment was submitted. To set the date\n *                                            manually, `$comment_date_gmt` must also be specified.\n *                                            Default is the current time.\n *     @type string     $comment_date_gmt     The date the comment was submitted in the GMT timezone.\n *                                            Default is `$comment_date` in the site's GMT timezone.\n *     @type int        $comment_karma        The karma of the comment. Default 0.\n *     @type int        $comment_parent       ID of this comment's parent, if any. Default 0.\n *     @type int        $comment_post_ID      ID of the post that relates to the comment, if any.\n *                                            Default 0.\n *     @type string     $comment_type         Comment type. Default 'comment'.\n *     @type array      $comment_meta         Optional. Array of key/value pairs to be stored in commentmeta for the\n *                                            new comment.\n *     @type int        $user_id              ID of the user who submitted the comment. Default 0.\n * }\n * @return int|false The new comment's ID on success, false on failure.\n */\nfunction wp_insert_comment( $commentdata ) {\n\tglobal $wpdb;\n\t$data = wp_unslash( $commentdata );\n\n\t$comment_author       = ! isset( $data['comment_author'] ) ? '' : $data['comment_author'];\n\t$comment_author_email = ! isset( $data['comment_author_email'] ) ? '' : $data['comment_author_email'];\n\t$comment_author_url   = ! isset( $data['comment_author_url'] ) ? '' : $data['comment_author_url'];\n\t$comment_author_IP    = ! isset( $data['comment_author_IP'] ) ? '' : $data['comment_author_IP'];\n\n\t$comment_date     = ! isset( $data['comment_date'] ) ? current_time( 'mysql' ) : $data['comment_date'];\n\t$comment_date_gmt = ! isset( $data['comment_date_gmt'] ) ? get_gmt_from_date( $comment_date ) : $data['comment_date_gmt'];\n\n\t$comment_post_ID  = ! isset( $data['comment_post_ID'] ) ? 0 : $data['comment_post_ID'];\n\t$comment_content  = ! isset( $data['comment_content'] ) ? '' : $data['comment_content'];\n\t$comment_karma    = ! isset( $data['comment_karma'] ) ? 0 : $data['comment_karma'];\n\t$comment_approved = ! isset( $data['comment_approved'] ) ? 1 : $data['comment_approved'];\n\t$comment_agent    = ! isset( $data['comment_agent'] ) ? '' : $data['comment_agent'];\n\t$comment_type     = empty( $data['comment_type'] ) ? 'comment' : $data['comment_type'];\n\t$comment_parent   = ! isset( $data['comment_parent'] ) ? 0 : $data['comment_parent'];\n\n\t$user_id = ! isset( $data['user_id'] ) ? 0 : $data['user_id'];\n\n\t$compacted = compact( 'comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_date', 'comment_date_gmt', 'comment_content', 'comment_karma', 'comment_approved', 'comment_agent', 'comment_type', 'comment_parent', 'user_id' );\n\tif ( ! $wpdb->insert( $wpdb->comments, $compacted ) ) {\n\t\treturn false;\n\t}\n\n\t$id = (int) $wpdb->insert_id;\n\n\tif ( 1 == $comment_approved ) {\n\t\twp_update_comment_count( $comment_post_ID );\n\n\t\tforeach ( array( 'server', 'gmt', 'blog' ) as $timezone ) {\n\t\t\twp_cache_delete( \"lastcommentmodified:$timezone\", 'timeinfo' );\n\t\t}\n\t}\n\n\tclean_comment_cache( $id );\n\n\t$comment = get_comment( $id );\n\n\t// If metadata is provided, store it.\n\tif ( isset( $commentdata['comment_meta'] ) && is_array( $commentdata['comment_meta'] ) ) {\n\t\tforeach ( $commentdata['comment_meta'] as $meta_key => $meta_value ) {\n\t\t\tadd_comment_meta( $comment->comment_ID, $meta_key, $meta_value, true );\n\t\t}\n\t}\n\n\t/**\n\t * Fires immediately after a comment is inserted into the database.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param int        $id      The comment ID.\n\t * @param WP_Comment $comment Comment object.\n\t */\n\tdo_action( 'wp_insert_comment', $id, $comment );\n\n\treturn $id;\n}\n\n/**\n * Filters and sanitizes comment data.\n *\n * Sets the comment data 'filtered' field to true when finished. This can be\n * checked as to whether the comment should be filtered and to keep from\n * filtering the same comment more than once.\n *\n * @since 2.0.0\n *\n * @param array $commentdata Contains information on the comment.\n * @return array Parsed comment information.\n */\nfunction wp_filter_comment( $commentdata ) {\n\tif ( isset( $commentdata['user_ID'] ) ) {\n\t\t/**\n\t\t * Filters the comment author's user ID before it is set.\n\t\t *\n\t\t * The first time this filter is evaluated, 'user_ID' is checked\n\t\t * (for back-compat), followed by the standard 'user_id' value.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param int $user_ID The comment author's user ID.\n\t\t */\n\t\t$commentdata['user_id'] = apply_filters( 'pre_user_id', $commentdata['user_ID'] );\n\t} elseif ( isset( $commentdata['user_id'] ) ) {\n\t\t/** This filter is documented in wp-includes/comment.php */\n\t\t$commentdata['user_id'] = apply_filters( 'pre_user_id', $commentdata['user_id'] );\n\t}\n\n\t/**\n\t * Filters the comment author's browser user agent before it is set.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $comment_agent The comment author's browser user agent.\n\t */\n\t$commentdata['comment_agent'] = apply_filters( 'pre_comment_user_agent', ( isset( $commentdata['comment_agent'] ) ? $commentdata['comment_agent'] : '' ) );\n\t/** This filter is documented in wp-includes/comment.php */\n\t$commentdata['comment_author'] = apply_filters( 'pre_comment_author_name', $commentdata['comment_author'] );\n\t/**\n\t * Filters the comment content before it is set.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $comment_content The comment content.\n\t */\n\t$commentdata['comment_content'] = apply_filters( 'pre_comment_content', $commentdata['comment_content'] );\n\t/**\n\t * Filters the comment author's IP address before it is set.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $comment_author_ip The comment author's IP address.\n\t */\n\t$commentdata['comment_author_IP'] = apply_filters( 'pre_comment_user_ip', $commentdata['comment_author_IP'] );\n\t/** This filter is documented in wp-includes/comment.php */\n\t$commentdata['comment_author_url'] = apply_filters( 'pre_comment_author_url', $commentdata['comment_author_url'] );\n\t/** This filter is documented in wp-includes/comment.php */\n\t$commentdata['comment_author_email'] = apply_filters( 'pre_comment_author_email', $commentdata['comment_author_email'] );\n\t$commentdata['filtered']             = true;\n\treturn $commentdata;\n}\n\n/**\n * Whether a comment should be blocked because of comment flood.\n *\n * @since 2.1.0\n *\n * @param bool $block            Whether plugin has already blocked comment.\n * @param int  $time_lastcomment Timestamp for last comment.\n * @param int  $time_newcomment  Timestamp for new comment.\n * @return bool Whether comment should be blocked.\n */\nfunction wp_throttle_comment_flood( $block, $time_lastcomment, $time_newcomment ) {\n\tif ( $block ) { // A plugin has already blocked... we'll let that decision stand.\n\t\treturn $block;\n\t}\n\tif ( ( $time_newcomment - $time_lastcomment ) < 15 ) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Adds a new comment to the database.\n *\n * Filters new comment to ensure that the fields are sanitized and valid before\n * inserting comment into database. Calls {@see 'comment_post'} action with comment ID\n * and whether comment is approved by WordPress. Also has {@see 'preprocess_comment'}\n * filter for processing the comment data before the function handles it.\n *\n * We use `REMOTE_ADDR` here directly. If you are behind a proxy, you should ensure\n * that it is properly set, such as in wp-config.php, for your environment.\n *\n * See {@link https://core.trac.wordpress.org/ticket/9235}\n *\n * @since 1.5.0\n * @since 4.3.0 Introduced the `comment_agent` and `comment_author_IP` arguments.\n * @since 4.7.0 The `$avoid_die` parameter was added, allowing the function\n *              to return a WP_Error object instead of dying.\n * @since 5.5.0 The `$avoid_die` parameter was renamed to `$wp_error`.\n * @since 5.5.0 Introduced the `comment_type` argument.\n *\n * @see wp_insert_comment()\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param array $commentdata {\n *     Comment data.\n *\n *     @type string $comment_author       The name of the comment author.\n *     @type string $comment_author_email The comment author email address.\n *     @type string $comment_author_url   The comment author URL.\n *     @type string $comment_content      The content of the comment.\n *     @type string $comment_date         The date the comment was submitted. Default is the current time.\n *     @type string $comment_date_gmt     The date the comment was submitted in the GMT timezone.\n *                                        Default is `$comment_date` in the GMT timezone.\n *     @type string $comment_type         Comment type. Default 'comment'.\n *     @type int    $comment_parent       The ID of this comment's parent, if any. Default 0.\n *     @type int    $comment_post_ID      The ID of the post that relates to the comment.\n *     @type int    $user_id              The ID of the user who submitted the comment. Default 0.\n *     @type int    $user_ID              Kept for backward-compatibility. Use `$user_id` instead.\n *     @type string $comment_agent        Comment author user agent. Default is the value of 'HTTP_USER_AGENT'\n *                                        in the `$_SERVER` superglobal sent in the original request.\n *     @type string $comment_author_IP    Comment author IP address in IPv4 format. Default is the value of\n *                                        'REMOTE_ADDR' in the `$_SERVER` superglobal sent in the original request.\n * }\n * @param bool  $wp_error Should errors be returned as WP_Error objects instead of\n *                        executing wp_die()? Default false.\n * @return int|false|WP_Error The ID of the comment on success, false or WP_Error on failure.\n */\nfunction wp_new_comment( $commentdata, $wp_error = false ) {\n\tglobal $wpdb;\n\n\tif ( isset( $commentdata['user_ID'] ) ) {\n\t\t$commentdata['user_ID'] = (int) $commentdata['user_ID'];\n\t\t$commentdata['user_id'] = $commentdata['user_ID'];\n\t}\n\n\t$prefiltered_user_id = ( isset( $commentdata['user_id'] ) ) ? (int) $commentdata['user_id'] : 0;\n\n\t/**\n\t * Filters a comment's data before it is sanitized and inserted into the database.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param array $commentdata Comment data.\n\t */\n\t$commentdata = apply_filters( 'preprocess_comment', $commentdata );\n\n\t$commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID'];\n\tif ( isset( $commentdata['user_ID'] ) && $prefiltered_user_id !== (int) $commentdata['user_ID'] ) {\n\t\t$commentdata['user_ID'] = (int) $commentdata['user_ID'];\n\t\t$commentdata['user_id'] = $commentdata['user_ID'];\n\t} elseif ( isset( $commentdata['user_id'] ) ) {\n\t\t$commentdata['user_id'] = (int) $commentdata['user_id'];\n\t}\n\n\t$commentdata['comment_parent'] = isset( $commentdata['comment_parent'] ) ? absint( $commentdata['comment_parent'] ) : 0;\n\n\t$parent_status = ( $commentdata['comment_parent'] > 0 ) ? wp_get_comment_status( $commentdata['comment_parent'] ) : '';\n\n\t$commentdata['comment_parent'] = ( 'approved' === $parent_status || 'unapproved' === $parent_status ) ? $commentdata['comment_parent'] : 0;\n\n\tif ( ! isset( $commentdata['comment_author_IP'] ) ) {\n\t\t$commentdata['comment_author_IP'] = $_SERVER['REMOTE_ADDR'];\n\t}\n\t$commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '', $commentdata['comment_author_IP'] );\n\n\tif ( ! isset( $commentdata['comment_agent'] ) ) {\n\t\t$commentdata['comment_agent'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '';\n\t}\n\t$commentdata['comment_agent'] = substr( $commentdata['comment_agent'], 0, 254 );\n\n\tif ( empty( $commentdata['comment_date'] ) ) {\n\t\t$commentdata['comment_date'] = current_time( 'mysql' );\n\t}\n\n\tif ( empty( $commentdata['comment_date_gmt'] ) ) {\n\t\t$commentdata['comment_date_gmt'] = current_time( 'mysql', 1 );\n\t}\n\n\tif ( empty( $commentdata['comment_type'] ) ) {\n\t\t$commentdata['comment_type'] = 'comment';\n\t}\n\n\t$commentdata = wp_filter_comment( $commentdata );\n\n\t$commentdata['comment_approved'] = wp_allow_comment( $commentdata, $wp_error );\n\tif ( is_wp_error( $commentdata['comment_approved'] ) ) {\n\t\treturn $commentdata['comment_approved'];\n\t}\n\n\t$comment_ID = wp_insert_comment( $commentdata );\n\tif ( ! $comment_ID ) {\n\t\t$fields = array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content' );\n\n\t\tforeach ( $fields as $field ) {\n\t\t\tif ( isset( $commentdata[ $field ] ) ) {\n\t\t\t\t$commentdata[ $field ] = $wpdb->strip_invalid_text_for_column( $wpdb->comments, $field, $commentdata[ $field ] );\n\t\t\t}\n\t\t}\n\n\t\t$commentdata = wp_filter_comment( $commentdata );\n\n\t\t$commentdata['comment_approved'] = wp_allow_comment( $commentdata, $wp_error );\n\t\tif ( is_wp_error( $commentdata['comment_approved'] ) ) {\n\t\t\treturn $commentdata['comment_approved'];\n\t\t}\n\n\t\t$comment_ID = wp_insert_comment( $commentdata );\n\t\tif ( ! $comment_ID ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Fires immediately after a comment is inserted into the database.\n\t *\n\t * @since 1.2.0\n\t * @since 4.5.0 The `$commentdata` parameter was added.\n\t *\n\t * @param int        $comment_ID       The comment ID.\n\t * @param int|string $comment_approved 1 if the comment is approved, 0 if not, 'spam' if spam.\n\t * @param array      $commentdata      Comment data.\n\t */\n\tdo_action( 'comment_post', $comment_ID, $commentdata['comment_approved'], $commentdata );\n\n\treturn $comment_ID;\n}\n\n/**\n * Send a comment moderation notification to the comment moderator.\n *\n * @since 4.4.0\n *\n * @param int $comment_ID ID of the comment.\n * @return bool True on success, false on failure.\n */\nfunction wp_new_comment_notify_moderator( $comment_ID ) {\n\t$comment = get_comment( $comment_ID );\n\n\t// Only send notifications for pending comments.\n\t$maybe_notify = ( '0' == $comment->comment_approved );\n\n\t/** This filter is documented in wp-includes/comment.php */\n\t$maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_ID );\n\n\tif ( ! $maybe_notify ) {\n\t\treturn false;\n\t}\n\n\treturn wp_notify_moderator( $comment_ID );\n}\n\n/**\n * Send a notification of a new comment to the post author.\n *\n * @since 4.4.0\n *\n * Uses the {@see 'notify_post_author'} filter to determine whether the post author\n * should be notified when a new comment is added, overriding site setting.\n *\n * @param int $comment_ID Comment ID.\n * @return bool True on success, false on failure.\n */\nfunction wp_new_comment_notify_postauthor( $comment_ID ) {\n\t$comment = get_comment( $comment_ID );\n\n\t$maybe_notify = get_option( 'comments_notify' );\n\n\t/**\n\t * Filters whether to send the post author new comment notification emails,\n\t * overriding the site setting.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param bool $maybe_notify Whether to notify the post author about the new comment.\n\t * @param int  $comment_ID   The ID of the comment for the notification.\n\t */\n\t$maybe_notify = apply_filters( 'notify_post_author', $maybe_notify, $comment_ID );\n\n\t/*\n\t * wp_notify_postauthor() checks if notifying the author of their own comment.\n\t * By default, it won't, but filters can override this.\n\t */\n\tif ( ! $maybe_notify ) {\n\t\treturn false;\n\t}\n\n\t// Only send notifications for approved comments.\n\tif ( ! isset( $comment->comment_approved ) || '1' != $comment->comment_approved ) {\n\t\treturn false;\n\t}\n\n\treturn wp_notify_postauthor( $comment_ID );\n}\n\n/**\n * Sets the status of a comment.\n *\n * The {@see 'wp_set_comment_status'} action is called after the comment is handled.\n * If the comment status is not in the list, then false is returned.\n *\n * @since 1.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int|WP_Comment $comment_id     Comment ID or WP_Comment object.\n * @param string         $comment_status New comment status, either 'hold', 'approve', 'spam', or 'trash'.\n * @param bool           $wp_error       Whether to return a WP_Error object if there is a failure. Default false.\n * @return bool|WP_Error True on success, false or WP_Error on failure.\n */\nfunction wp_set_comment_status( $comment_id, $comment_status, $wp_error = false ) {\n\tglobal $wpdb;\n\n\tswitch ( $comment_status ) {\n\t\tcase 'hold':\n\t\tcase '0':\n\t\t\t$status = '0';\n\t\t\tbreak;\n\t\tcase 'approve':\n\t\tcase '1':\n\t\t\t$status = '1';\n\t\t\tadd_action( 'wp_set_comment_status', 'wp_new_comment_notify_postauthor' );\n\t\t\tbreak;\n\t\tcase 'spam':\n\t\t\t$status = 'spam';\n\t\t\tbreak;\n\t\tcase 'trash':\n\t\t\t$status = 'trash';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n\n\t$comment_old = clone get_comment( $comment_id );\n\n\tif ( ! $wpdb->update( $wpdb->comments, array( 'comment_approved' => $status ), array( 'comment_ID' => $comment_old->comment_ID ) ) ) {\n\t\tif ( $wp_error ) {\n\t\t\treturn new WP_Error( 'db_update_error', __( 'Could not update comment status.' ), $wpdb->last_error );\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclean_comment_cache( $comment_old->comment_ID );\n\n\t$comment = get_comment( $comment_old->comment_ID );\n\n\t/**\n\t * Fires immediately before transitioning a comment's status from one to another\n\t * in the database.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param int         $comment_id     Comment ID.\n\t * @param string|bool $comment_status Current comment status. Possible values include\n\t *                                    'hold', 'approve', 'spam', 'trash', or false.\n\t */\n\tdo_action( 'wp_set_comment_status', $comment->comment_ID, $comment_status );\n\n\twp_transition_comment_status( $comment_status, $comment_old->comment_approved, $comment );\n\n\twp_update_comment_count( $comment->comment_post_ID );\n\n\treturn true;\n}\n\n/**\n * Updates an existing comment in the database.\n *\n * Filters the comment and makes sure certain fields are valid before updating.\n *\n * @since 2.0.0\n * @since 4.9.0 Add updating comment meta during comment update.\n * @since 5.5.0 The `$wp_error` parameter was added.\n * @since 5.5.0 The return values for an invalid comment or post ID\n *              were changed to false instead of 0.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param array $commentarr Contains information on the comment.\n * @param bool  $wp_error   Optional. Whether to return a WP_Error on failure. Default false.\n * @return int|false|WP_Error The value 1 if the comment was updated, 0 if not updated.\n *                            False or a WP_Error object on failure.\n */\nfunction wp_update_comment( $commentarr, $wp_error = false ) {\n\tglobal $wpdb;\n\n\t// First, get all of the original fields.\n\t$comment = get_comment( $commentarr['comment_ID'], ARRAY_A );\n\tif ( empty( $comment ) ) {\n\t\tif ( $wp_error ) {\n\t\t\treturn new WP_Error( 'invalid_comment_id', __( 'Invalid comment ID.' ) );\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Make sure that the comment post ID is valid (if specified).\n\tif ( ! empty( $commentarr['comment_post_ID'] ) && ! get_post( $commentarr['comment_post_ID'] ) ) {\n\t\tif ( $wp_error ) {\n\t\t\treturn new WP_Error( 'invalid_post_id', __( 'Invalid post ID.' ) );\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Escape data pulled from DB.\n\t$comment = wp_slash( $comment );\n\n\t$old_status = $comment['comment_approved'];\n\n\t// Merge old and new fields with new fields overwriting old ones.\n\t$commentarr = array_merge( $comment, $commentarr );\n\n\t$commentarr = wp_filter_comment( $commentarr );\n\n\t// Now extract the merged array.\n\t$data = wp_unslash( $commentarr );\n\n\t/**\n\t * Filters the comment content before it is updated in the database.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $comment_content The comment data.\n\t */\n\t$data['comment_content'] = apply_filters( 'comment_save_pre', $data['comment_content'] );\n\n\t$data['comment_date_gmt'] = get_gmt_from_date( $data['comment_date'] );\n\n\tif ( ! isset( $data['comment_approved'] ) ) {\n\t\t$data['comment_approved'] = 1;\n\t} elseif ( 'hold' === $data['comment_approved'] ) {\n\t\t$data['comment_approved'] = 0;\n\t} elseif ( 'approve' === $data['comment_approved'] ) {\n\t\t$data['comment_approved'] = 1;\n\t}\n\n\t$comment_ID      = $data['comment_ID'];\n\t$comment_post_ID = $data['comment_post_ID'];\n\n\t/**\n\t * Filters the comment data immediately before it is updated in the database.\n\t *\n\t * Note: data being passed to the filter is already unslashed.\n\t *\n\t * @since 4.7.0\n\t * @since 5.5.0 Returning a WP_Error value from the filter will short-circuit comment update\n\t *              and allow skipping further processing.\n\t *\n\t * @param array|WP_Error $data       The new, processed comment data, or WP_Error.\n\t * @param array          $comment    The old, unslashed comment data.\n\t * @param array          $commentarr The new, raw comment data.\n\t */\n\t$data = apply_filters( 'wp_update_comment_data', $data, $comment, $commentarr );\n\n\t// Do not carry on on failure.\n\tif ( is_wp_error( $data ) ) {\n\t\tif ( $wp_error ) {\n\t\t\treturn $data;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t$keys = array( 'comment_post_ID', 'comment_content', 'comment_author', 'comment_author_email', 'comment_approved', 'comment_karma', 'comment_author_url', 'comment_date', 'comment_date_gmt', 'comment_type', 'comment_parent', 'user_id', 'comment_agent', 'comment_author_IP' );\n\t$data = wp_array_slice_assoc( $data, $keys );\n\n\t$rval = $wpdb->update( $wpdb->comments, $data, compact( 'comment_ID' ) );\n\n\tif ( false === $rval ) {\n\t\tif ( $wp_error ) {\n\t\t\treturn new WP_Error( 'db_update_error', __( 'Could not update comment in the database.' ), $wpdb->last_error );\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// If metadata is provided, store it.\n\tif ( isset( $commentarr['comment_meta'] ) && is_array( $commentarr['comment_meta'] ) ) {\n\t\tforeach ( $commentarr['comment_meta'] as $meta_key => $meta_value ) {\n\t\t\tupdate_comment_meta( $comment_ID, $meta_key, $meta_value );\n\t\t}\n\t}\n\n\tclean_comment_cache( $comment_ID );\n\twp_update_comment_count( $comment_post_ID );\n\n\t/**\n\t * Fires immediately after a comment is updated in the database.\n\t *\n\t * The hook also fires immediately before comment status transition hooks are fired.\n\t *\n\t * @since 1.2.0\n\t * @since 4.6.0 Added the `$data` parameter.\n\t *\n\t * @param int   $comment_ID The comment ID.\n\t * @param array $data       Comment data.\n\t */\n\tdo_action( 'edit_comment', $comment_ID, $data );\n\n\t$comment = get_comment( $comment_ID );\n\n\twp_transition_comment_status( $comment->comment_approved, $old_status, $comment );\n\n\treturn $rval;\n}\n\n/**\n * Whether to defer comment counting.\n *\n * When setting $defer to true, all post comment counts will not be updated\n * until $defer is set to false. When $defer is set to false, then all\n * previously deferred updated post comment counts will then be automatically\n * updated without having to call wp_update_comment_count() after.\n *\n * @since 2.5.0\n *\n * @param bool $defer\n * @return bool\n */\nfunction wp_defer_comment_counting( $defer = null ) {\n\tstatic $_defer = false;\n\n\tif ( is_bool( $defer ) ) {\n\t\t$_defer = $defer;\n\t\t// Flush any deferred counts.\n\t\tif ( ! $defer ) {\n\t\t\twp_update_comment_count( null, true );\n\t\t}\n\t}\n\n\treturn $_defer;\n}\n\n/**\n * Updates the comment count for post(s).\n *\n * When $do_deferred is false (is by default) and the comments have been set to\n * be deferred, the post_id will be added to a queue, which will be updated at a\n * later date and only updated once per post ID.\n *\n * If the comments have not be set up to be deferred, then the post will be\n * updated. When $do_deferred is set to true, then all previous deferred post\n * IDs will be updated along with the current $post_id.\n *\n * @since 2.1.0\n *\n * @see wp_update_comment_count_now() For what could cause a false return value\n *\n * @param int|null $post_id     Post ID.\n * @param bool     $do_deferred Optional. Whether to process previously deferred\n *                              post comment counts. Default false.\n * @return bool|void True on success, false on failure or if post with ID does\n *                   not exist.\n */\nfunction wp_update_comment_count( $post_id, $do_deferred = false ) {\n\tstatic $_deferred = array();\n\n\tif ( empty( $post_id ) && ! $do_deferred ) {\n\t\treturn false;\n\t}\n\n\tif ( $do_deferred ) {\n\t\t$_deferred = array_unique( $_deferred );\n\t\tforeach ( $_deferred as $i => $_post_id ) {\n\t\t\twp_update_comment_count_now( $_post_id );\n\t\t\tunset( $_deferred[ $i ] );\n\t\t\t/** @todo Move this outside of the foreach and reset $_deferred to an array instead */\n\t\t}\n\t}\n\n\tif ( wp_defer_comment_counting() ) {\n\t\t$_deferred[] = $post_id;\n\t\treturn true;\n\t} elseif ( $post_id ) {\n\t\treturn wp_update_comment_count_now( $post_id );\n\t}\n\n}\n\n/**\n * Updates the comment count for the post.\n *\n * @since 2.5.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int $post_id Post ID\n * @return bool True on success, false if the post does not exist.\n */\nfunction wp_update_comment_count_now( $post_id ) {\n\tglobal $wpdb;\n\t$post_id = (int) $post_id;\n\tif ( ! $post_id ) {\n\t\treturn false;\n\t}\n\n\twp_cache_delete( 'comments-0', 'counts' );\n\twp_cache_delete( \"comments-{$post_id}\", 'counts' );\n\n\t$post = get_post( $post_id );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$old = (int) $post->comment_count;\n\n\t/**\n\t * Filters a post's comment count before it is updated in the database.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param int|null $new     The new comment count. Default null.\n\t * @param int      $old     The old comment count.\n\t * @param int      $post_id Post ID.\n\t */\n\t$new = apply_filters( 'pre_wp_update_comment_count_now', null, $old, $post_id );\n\n\tif ( is_null( $new ) ) {\n\t\t$new = (int) $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1'\", $post_id ) );\n\t} else {\n\t\t$new = (int) $new;\n\t}\n\n\t$wpdb->update( $wpdb->posts, array( 'comment_count' => $new ), array( 'ID' => $post_id ) );\n\n\tclean_post_cache( $post );\n\n\t/**\n\t * Fires immediately after a post's comment count is updated in the database.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param int $post_id Post ID.\n\t * @param int $new     The new comment count.\n\t * @param int $old     The old comment count.\n\t */\n\tdo_action( 'wp_update_comment_count', $post_id, $new, $old );\n\n\t/** This action is documented in wp-includes/post.php */\n\tdo_action( \"edit_post_{$post->post_type}\", $post_id, $post );\n\n\t/** This action is documented in wp-includes/post.php */\n\tdo_action( 'edit_post', $post_id, $post );\n\n\treturn true;\n}\n\n//\n// Ping and trackback functions.\n//\n\n/**\n * Finds a pingback server URI based on the given URL.\n *\n * Checks the HTML for the rel=\"pingback\" link and x-pingback headers. It does\n * a check for the x-pingback headers first and returns that, if available. The\n * check for the rel=\"pingback\" has more overhead than just the header.\n *\n * @since 1.5.0\n *\n * @param string $url        URL to ping.\n * @param int    $deprecated Not Used.\n * @return string|false String containing URI on success, false on failure.\n */\nfunction discover_pingback_server_uri( $url, $deprecated = '' ) {\n\tif ( ! empty( $deprecated ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '2.7.0' );\n\t}\n\n\t$pingback_str_dquote = 'rel=\"pingback\"';\n\t$pingback_str_squote = 'rel=\\'pingback\\'';\n\n\t/** @todo Should use Filter Extension or custom preg_match instead. */\n\t$parsed_url = parse_url( $url );\n\n\tif ( ! isset( $parsed_url['host'] ) ) { // Not a URL. This should never happen.\n\t\treturn false;\n\t}\n\n\t// Do not search for a pingback server on our own uploads.\n\t$uploads_dir = wp_get_upload_dir();\n\tif ( 0 === strpos( $url, $uploads_dir['baseurl'] ) ) {\n\t\treturn false;\n\t}\n\n\t$response = wp_safe_remote_head(\n\t\t$url,\n\t\tarray(\n\t\t\t'timeout'     => 2,\n\t\t\t'httpversion' => '1.0',\n\t\t)\n\t);\n\n\tif ( is_wp_error( $response ) ) {\n\t\treturn false;\n\t}\n\n\tif ( wp_remote_retrieve_header( $response, 'x-pingback' ) ) {\n\t\treturn wp_remote_retrieve_header( $response, 'x-pingback' );\n\t}\n\n\t// Not an (x)html, sgml, or xml page, no use going further.\n\tif ( preg_match( '#(image|audio|video|model)/#is', wp_remote_retrieve_header( $response, 'content-type' ) ) ) {\n\t\treturn false;\n\t}\n\n\t// Now do a GET since we're going to look in the HTML headers (and we're sure it's not a binary file).\n\t$response = wp_safe_remote_get(\n\t\t$url,\n\t\tarray(\n\t\t\t'timeout'     => 2,\n\t\t\t'httpversion' => '1.0',\n\t\t)\n\t);\n\n\tif ( is_wp_error( $response ) ) {\n\t\treturn false;\n\t}\n\n\t$contents = wp_remote_retrieve_body( $response );\n\n\t$pingback_link_offset_dquote = strpos( $contents, $pingback_str_dquote );\n\t$pingback_link_offset_squote = strpos( $contents, $pingback_str_squote );\n\tif ( $pingback_link_offset_dquote || $pingback_link_offset_squote ) {\n\t\t$quote                   = ( $pingback_link_offset_dquote ) ? '\"' : '\\'';\n\t\t$pingback_link_offset    = ( '\"' === $quote ) ? $pingback_link_offset_dquote : $pingback_link_offset_squote;\n\t\t$pingback_href_pos       = strpos( $contents, 'href=', $pingback_link_offset );\n\t\t$pingback_href_start     = $pingback_href_pos + 6;\n\t\t$pingback_href_end       = strpos( $contents, $quote, $pingback_href_start );\n\t\t$pingback_server_url_len = $pingback_href_end - $pingback_href_start;\n\t\t$pingback_server_url     = substr( $contents, $pingback_href_start, $pingback_server_url_len );\n\n\t\t// We may find rel=\"pingback\" but an incomplete pingback URL.\n\t\tif ( $pingback_server_url_len > 0 ) { // We got it!\n\t\t\treturn $pingback_server_url;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Perform all pingbacks, enclosures, trackbacks, and send to pingback services.\n *\n * @since 2.1.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction do_all_pings() {\n\tglobal $wpdb;\n\n\t// Do pingbacks.\n\t$pings = get_posts(\n\t\tarray(\n\t\t\t'post_type'        => get_post_types(),\n\t\t\t'suppress_filters' => false,\n\t\t\t'nopaging'         => true,\n\t\t\t'meta_key'         => '_pingme',\n\t\t\t'fields'           => 'ids',\n\t\t)\n\t);\n\n\tforeach ( $pings as $ping ) {\n\t\tdelete_post_meta( $ping, '_pingme' );\n\t\tpingback( null, $ping );\n\t}\n\n\t// Do enclosures.\n\t$enclosures = get_posts(\n\t\tarray(\n\t\t\t'post_type'        => get_post_types(),\n\t\t\t'suppress_filters' => false,\n\t\t\t'nopaging'         => true,\n\t\t\t'meta_key'         => '_encloseme',\n\t\t\t'fields'           => 'ids',\n\t\t)\n\t);\n\n\tforeach ( $enclosures as $enclosure ) {\n\t\tdelete_post_meta( $enclosure, '_encloseme' );\n\t\tdo_enclose( null, $enclosure );\n\t}\n\n\t// Do trackbacks.\n\t$trackbacks = get_posts(\n\t\tarray(\n\t\t\t'post_type'        => get_post_types(),\n\t\t\t'suppress_filters' => false,\n\t\t\t'nopaging'         => true,\n\t\t\t'meta_key'         => '_trackbackme',\n\t\t\t'fields'           => 'ids',\n\t\t)\n\t);\n\n\tforeach ( $trackbacks as $trackback ) {\n\t\tdelete_post_meta( $trackback, '_trackbackme' );\n\t\tdo_trackbacks( $trackback );\n\t}\n\n\t// Do Update Services/Generic Pings.\n\tgeneric_ping();\n}\n\n/**\n * Perform trackbacks.\n *\n * @since 1.5.0\n * @since 4.7.0 `$post_id` can be a WP_Post object.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int|WP_Post $post_id Post object or ID to do trackbacks on.\n */\nfunction do_trackbacks( $post_id ) {\n\tglobal $wpdb;\n\t$post = get_post( $post_id );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$to_ping = get_to_ping( $post );\n\t$pinged  = get_pung( $post );\n\tif ( empty( $to_ping ) ) {\n\t\t$wpdb->update( $wpdb->posts, array( 'to_ping' => '' ), array( 'ID' => $post->ID ) );\n\t\treturn;\n\t}\n\n\tif ( empty( $post->post_excerpt ) ) {\n\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t$excerpt = apply_filters( 'the_content', $post->post_content, $post->ID );\n\t} else {\n\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t$excerpt = apply_filters( 'the_excerpt', $post->post_excerpt );\n\t}\n\n\t$excerpt = str_replace( ']]>', ']]&gt;', $excerpt );\n\t$excerpt = wp_html_excerpt( $excerpt, 252, '&#8230;' );\n\n\t/** This filter is documented in wp-includes/post-template.php */\n\t$post_title = apply_filters( 'the_title', $post->post_title, $post->ID );\n\t$post_title = strip_tags( $post_title );\n\n\tif ( $to_ping ) {\n\t\tforeach ( (array) $to_ping as $tb_ping ) {\n\t\t\t$tb_ping = trim( $tb_ping );\n\t\t\tif ( ! in_array( $tb_ping, $pinged, true ) ) {\n\t\t\t\ttrackback( $tb_ping, $post_title, $excerpt, $post->ID );\n\t\t\t\t$pinged[] = $tb_ping;\n\t\t\t} else {\n\t\t\t\t$wpdb->query(\n\t\t\t\t\t$wpdb->prepare(\n\t\t\t\t\t\t\"UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s,\n\t\t\t\t\t'')) WHERE ID = %d\",\n\t\t\t\t\t\t$tb_ping,\n\t\t\t\t\t\t$post->ID\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Sends pings to all of the ping site services.\n *\n * @since 1.2.0\n *\n * @param int $post_id Post ID.\n * @return int Same as Post ID from parameter\n */\nfunction generic_ping( $post_id = 0 ) {\n\t$services = get_option( 'ping_sites' );\n\n\t$services = explode( \"\\n\", $services );\n\tforeach ( (array) $services as $service ) {\n\t\t$service = trim( $service );\n\t\tif ( '' !== $service ) {\n\t\t\tweblog_ping( $service );\n\t\t}\n\t}\n\n\treturn $post_id;\n}\n\n/**\n * Pings back the links found in a post.\n *\n * @since 0.71\n * @since 4.7.0 `$post_id` can be a WP_Post object.\n *\n * @param string      $content Post content to check for links. If empty will retrieve from post.\n * @param int|WP_Post $post_id Post Object or ID.\n */\nfunction pingback( $content, $post_id ) {\n\tinclude_once ABSPATH . WPINC . '/class-IXR.php';\n\tinclude_once ABSPATH . WPINC . '/class-wp-http-ixr-client.php';\n\n\t// Original code by Mort (http://mort.mine.nu:8080).\n\t$post_links = array();\n\n\t$post = get_post( $post_id );\n\tif ( ! $post ) {\n\t\treturn;\n\t}\n\n\t$pung = get_pung( $post );\n\n\tif ( empty( $content ) ) {\n\t\t$content = $post->post_content;\n\t}\n\n\t/*\n\t * Step 1.\n\t * Parsing the post, external links (if any) are stored in the $post_links array.\n\t */\n\t$post_links_temp = wp_extract_urls( $content );\n\n\t/*\n\t * Step 2.\n\t * Walking through the links array.\n\t * First we get rid of links pointing to sites, not to specific files.\n\t * Example:\n\t * http://dummy-weblog.org\n\t * http://dummy-weblog.org/\n\t * http://dummy-weblog.org/post.php\n\t * We don't wanna ping first and second types, even if they have a valid <link/>.\n\t */\n\tforeach ( (array) $post_links_temp as $link_test ) {\n\t\t// If we haven't pung it already and it isn't a link to itself.\n\t\tif ( ! in_array( $link_test, $pung, true ) && ( url_to_postid( $link_test ) != $post->ID )\n\t\t\t// Also, let's never ping local attachments.\n\t\t\t&& ! is_local_attachment( $link_test )\n\t\t) {\n\t\t\t$test = parse_url( $link_test );\n\t\t\tif ( $test ) {\n\t\t\t\tif ( isset( $test['query'] ) ) {\n\t\t\t\t\t$post_links[] = $link_test;\n\t\t\t\t} elseif ( isset( $test['path'] ) && ( '/' !== $test['path'] ) && ( '' !== $test['path'] ) ) {\n\t\t\t\t\t$post_links[] = $link_test;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t$post_links = array_unique( $post_links );\n\n\t/**\n\t * Fires just before pinging back links found in a post.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string[] $post_links Array of link URLs to be checked (passed by reference).\n\t * @param string[] $pung       Array of link URLs already pinged (passed by reference).\n\t * @param int      $post_ID    The post ID.\n\t */\n\tdo_action_ref_array( 'pre_ping', array( &$post_links, &$pung, $post->ID ) );\n\n\tforeach ( (array) $post_links as $pagelinkedto ) {\n\t\t$pingback_server_url = discover_pingback_server_uri( $pagelinkedto );\n\n\t\tif ( $pingback_server_url ) {\n\t\t\tset_time_limit( 60 );\n\t\t\t// Now, the RPC call.\n\t\t\t$pagelinkedfrom = get_permalink( $post );\n\n\t\t\t// Using a timeout of 3 seconds should be enough to cover slow servers.\n\t\t\t$client          = new WP_HTTP_IXR_Client( $pingback_server_url );\n\t\t\t$client->timeout = 3;\n\t\t\t/**\n\t\t\t * Filters the user agent sent when pinging-back a URL.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t *\n\t\t\t * @param string $concat_useragent    The user agent concatenated with ' -- WordPress/'\n\t\t\t *                                    and the WordPress version.\n\t\t\t * @param string $useragent           The useragent.\n\t\t\t * @param string $pingback_server_url The server URL being linked to.\n\t\t\t * @param string $pagelinkedto        URL of page linked to.\n\t\t\t * @param string $pagelinkedfrom      URL of page linked from.\n\t\t\t */\n\t\t\t$client->useragent = apply_filters( 'pingback_useragent', $client->useragent . ' -- WordPress/' . get_bloginfo( 'version' ), $client->useragent, $pingback_server_url, $pagelinkedto, $pagelinkedfrom );\n\t\t\t// When set to true, this outputs debug messages by itself.\n\t\t\t$client->debug = false;\n\n\t\t\tif ( $client->query( 'pingback.ping', $pagelinkedfrom, $pagelinkedto ) || ( isset( $client->error->code ) && 48 == $client->error->code ) ) { // Already registered.\n\t\t\t\tadd_ping( $post, $pagelinkedto );\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Check whether blog is public before returning sites.\n *\n * @since 2.1.0\n *\n * @param mixed $sites Will return if blog is public, will not return if not public.\n * @return mixed Empty string if blog is not public, returns $sites, if site is public.\n */\nfunction privacy_ping_filter( $sites ) {\n\tif ( '0' != get_option( 'blog_public' ) ) {\n\t\treturn $sites;\n\t} else {\n\t\treturn '';\n\t}\n}\n\n/**\n * Send a Trackback.\n *\n * Updates database when sending trackback to prevent duplicates.\n *\n * @since 0.71\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $trackback_url URL to send trackbacks.\n * @param string $title         Title of post.\n * @param string $excerpt       Excerpt of post.\n * @param int    $ID            Post ID.\n * @return int|false|void Database query from update.\n */\nfunction trackback( $trackback_url, $title, $excerpt, $ID ) {\n\tglobal $wpdb;\n\n\tif ( empty( $trackback_url ) ) {\n\t\treturn;\n\t}\n\n\t$options            = array();\n\t$options['timeout'] = 10;\n\t$options['body']    = array(\n\t\t'title'     => $title,\n\t\t'url'       => get_permalink( $ID ),\n\t\t'blog_name' => get_option( 'blogname' ),\n\t\t'excerpt'   => $excerpt,\n\t);\n\n\t$response = wp_safe_remote_post( $trackback_url, $options );\n\n\tif ( is_wp_error( $response ) ) {\n\t\treturn;\n\t}\n\n\t$wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\\n', %s) WHERE ID = %d\", $trackback_url, $ID ) );\n\treturn $wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d\", $trackback_url, $ID ) );\n}\n\n/**\n * Send a pingback.\n *\n * @since 1.2.0\n *\n * @param string $server Host of blog to connect to.\n * @param string $path Path to send the ping.\n */\nfunction weblog_ping( $server = '', $path = '' ) {\n\tinclude_once ABSPATH . WPINC . '/class-IXR.php';\n\tinclude_once ABSPATH . WPINC . '/class-wp-http-ixr-client.php';\n\n\t// Using a timeout of 3 seconds should be enough to cover slow servers.\n\t$client             = new WP_HTTP_IXR_Client( $server, ( ( ! strlen( trim( $path ) ) || ( '/' === $path ) ) ? false : $path ) );\n\t$client->timeout    = 3;\n\t$client->useragent .= ' -- WordPress/' . get_bloginfo( 'version' );\n\n\t// When set to true, this outputs debug messages by itself.\n\t$client->debug = false;\n\t$home          = trailingslashit( home_url() );\n\tif ( ! $client->query( 'weblogUpdates.extendedPing', get_option( 'blogname' ), $home, get_bloginfo( 'rss2_url' ) ) ) { // Then try a normal ping.\n\t\t$client->query( 'weblogUpdates.ping', get_option( 'blogname' ), $home );\n\t}\n}\n\n/**\n * Default filter attached to pingback_ping_source_uri to validate the pingback's Source URI\n *\n * @since 3.5.1\n *\n * @see wp_http_validate_url()\n *\n * @param string $source_uri\n * @return string\n */\nfunction pingback_ping_source_uri( $source_uri ) {\n\treturn (string) wp_http_validate_url( $source_uri );\n}\n\n/**\n * Default filter attached to xmlrpc_pingback_error.\n *\n * Returns a generic pingback error code unless the error code is 48,\n * which reports that the pingback is already registered.\n *\n * @since 3.5.1\n *\n * @link https://www.hixie.ch/specs/pingback/pingback#TOC3\n *\n * @param IXR_Error $ixr_error\n * @return IXR_Error\n */\nfunction xmlrpc_pingback_error( $ixr_error ) {\n\tif ( 48 === $ixr_error->code ) {\n\t\treturn $ixr_error;\n\t}\n\treturn new IXR_Error( 0, '' );\n}\n\n//\n// Cache.\n//\n\n/**\n * Removes a comment from the object cache.\n *\n * @since 2.3.0\n *\n * @param int|array $ids Comment ID or an array of comment IDs to remove from cache.\n */\nfunction clean_comment_cache( $ids ) {\n\tforeach ( (array) $ids as $id ) {\n\t\twp_cache_delete( $id, 'comment' );\n\n\t\t/**\n\t\t * Fires immediately after a comment has been removed from the object cache.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @param int $id Comment ID.\n\t\t */\n\t\tdo_action( 'clean_comment_cache', $id );\n\t}\n\n\twp_cache_set( 'last_changed', microtime(), 'comment' );\n}\n\n/**\n * Updates the comment cache of given comments.\n *\n * Will add the comments in $comments to the cache. If comment ID already exists\n * in the comment cache then it will not be updated. The comment is added to the\n * cache using the comment group with the key using the ID of the comments.\n *\n * @since 2.3.0\n * @since 4.4.0 Introduced the `$update_meta_cache` parameter.\n *\n * @param WP_Comment[] $comments          Array of comment objects\n * @param bool         $update_meta_cache Whether to update commentmeta cache. Default true.\n */\nfunction update_comment_cache( $comments, $update_meta_cache = true ) {\n\tforeach ( (array) $comments as $comment ) {\n\t\twp_cache_add( $comment->comment_ID, $comment, 'comment' );\n\t}\n\n\tif ( $update_meta_cache ) {\n\t\t// Avoid `wp_list_pluck()` in case `$comments` is passed by reference.\n\t\t$comment_ids = array();\n\t\tforeach ( $comments as $comment ) {\n\t\t\t$comment_ids[] = $comment->comment_ID;\n\t\t}\n\t\tupdate_meta_cache( 'comment', $comment_ids );\n\t}\n}\n\n/**\n * Adds any comments from the given IDs to the cache that do not already exist in cache.\n *\n * @since 4.4.0\n * @access private\n *\n * @see update_comment_cache()\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int[] $comment_ids       Array of comment IDs.\n * @param bool  $update_meta_cache Optional. Whether to update the meta cache. Default true.\n */\nfunction _prime_comment_caches( $comment_ids, $update_meta_cache = true ) {\n\tglobal $wpdb;\n\n\t$non_cached_ids = _get_non_cached_ids( $comment_ids, 'comment' );\n\tif ( ! empty( $non_cached_ids ) ) {\n\t\t$fresh_comments = $wpdb->get_results( sprintf( \"SELECT $wpdb->comments.* FROM $wpdb->comments WHERE comment_ID IN (%s)\", join( ',', array_map( 'intval', $non_cached_ids ) ) ) );\n\n\t\tupdate_comment_cache( $fresh_comments, $update_meta_cache );\n\t}\n}\n\n//\n// Internal.\n//\n\n/**\n * Close comments on old posts on the fly, without any extra DB queries. Hooked to the_posts.\n *\n * @since 2.7.0\n * @access private\n *\n * @param WP_Post  $posts Post data object.\n * @param WP_Query $query Query object.\n * @return array\n */\nfunction _close_comments_for_old_posts( $posts, $query ) {\n\tif ( empty( $posts ) || ! $query->is_singular() || ! get_option( 'close_comments_for_old_posts' ) ) {\n\t\treturn $posts;\n\t}\n\n\t/**\n\t * Filters the list of post types to automatically close comments for.\n\t *\n\t * @since 3.2.0\n\t *\n\t * @param string[] $post_types An array of post type names.\n\t */\n\t$post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) );\n\tif ( ! in_array( $posts[0]->post_type, $post_types, true ) ) {\n\t\treturn $posts;\n\t}\n\n\t$days_old = (int) get_option( 'close_comments_days_old' );\n\tif ( ! $days_old ) {\n\t\treturn $posts;\n\t}\n\n\tif ( time() - strtotime( $posts[0]->post_date_gmt ) > ( $days_old * DAY_IN_SECONDS ) ) {\n\t\t$posts[0]->comment_status = 'closed';\n\t\t$posts[0]->ping_status    = 'closed';\n\t}\n\n\treturn $posts;\n}\n\n/**\n * Close comments on an old post. Hooked to comments_open and pings_open.\n *\n * @since 2.7.0\n * @access private\n *\n * @param bool $open    Comments open or closed.\n * @param int  $post_id Post ID.\n * @return bool $open\n */\nfunction _close_comments_for_old_post( $open, $post_id ) {\n\tif ( ! $open ) {\n\t\treturn $open;\n\t}\n\n\tif ( ! get_option( 'close_comments_for_old_posts' ) ) {\n\t\treturn $open;\n\t}\n\n\t$days_old = (int) get_option( 'close_comments_days_old' );\n\tif ( ! $days_old ) {\n\t\treturn $open;\n\t}\n\n\t$post = get_post( $post_id );\n\n\t/** This filter is documented in wp-includes/comment.php */\n\t$post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) );\n\tif ( ! in_array( $post->post_type, $post_types, true ) ) {\n\t\treturn $open;\n\t}\n\n\t// Undated drafts should not show up as comments closed.\n\tif ( '0000-00-00 00:00:00' === $post->post_date_gmt ) {\n\t\treturn $open;\n\t}\n\n\tif ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * DAY_IN_SECONDS ) ) {\n\t\treturn false;\n\t}\n\n\treturn $open;\n}\n\n/**\n * Handles the submission of a comment, usually posted to wp-comments-post.php via a comment form.\n *\n * This function expects unslashed data, as opposed to functions such as `wp_new_comment()` which\n * expect slashed data.\n *\n * @since 4.4.0\n *\n * @param array $comment_data {\n *     Comment data.\n *\n *     @type string|int $comment_post_ID             The ID of the post that relates to the comment.\n *     @type string     $author                      The name of the comment author.\n *     @type string     $email                       The comment author email address.\n *     @type string     $url                         The comment author URL.\n *     @type string     $comment                     The content of the comment.\n *     @type string|int $comment_parent              The ID of this comment's parent, if any. Default 0.\n *     @type string     $_wp_unfiltered_html_comment The nonce value for allowing unfiltered HTML.\n * }\n * @return WP_Comment|WP_Error A WP_Comment object on success, a WP_Error object on failure.\n */\nfunction wp_handle_comment_submission( $comment_data ) {\n\n\t$comment_post_ID      = 0;\n\t$comment_parent       = 0;\n\t$user_ID              = 0;\n\t$comment_author       = null;\n\t$comment_author_email = null;\n\t$comment_author_url   = null;\n\t$comment_content      = null;\n\n\tif ( isset( $comment_data['comment_post_ID'] ) ) {\n\t\t$comment_post_ID = (int) $comment_data['comment_post_ID'];\n\t}\n\tif ( isset( $comment_data['author'] ) && is_string( $comment_data['author'] ) ) {\n\t\t$comment_author = trim( strip_tags( $comment_data['author'] ) );\n\t}\n\tif ( isset( $comment_data['email'] ) && is_string( $comment_data['email'] ) ) {\n\t\t$comment_author_email = trim( $comment_data['email'] );\n\t}\n\tif ( isset( $comment_data['url'] ) && is_string( $comment_data['url'] ) ) {\n\t\t$comment_author_url = trim( $comment_data['url'] );\n\t}\n\tif ( isset( $comment_data['comment'] ) && is_string( $comment_data['comment'] ) ) {\n\t\t$comment_content = trim( $comment_data['comment'] );\n\t}\n\tif ( isset( $comment_data['comment_parent'] ) ) {\n\t\t$comment_parent = absint( $comment_data['comment_parent'] );\n\t}\n\n\t$post = get_post( $comment_post_ID );\n\n\tif ( empty( $post->comment_status ) ) {\n\n\t\t/**\n\t\t * Fires when a comment is attempted on a post that does not exist.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param int $comment_post_ID Post ID.\n\t\t */\n\t\tdo_action( 'comment_id_not_found', $comment_post_ID );\n\n\t\treturn new WP_Error( 'comment_id_not_found' );\n\n\t}\n\n\t// get_post_status() will get the parent status for attachments.\n\t$status = get_post_status( $post );\n\n\tif ( ( 'private' === $status ) && ! current_user_can( 'read_post', $comment_post_ID ) ) {\n\t\treturn new WP_Error( 'comment_id_not_found' );\n\t}\n\n\t$status_obj = get_post_status_object( $status );\n\n\tif ( ! comments_open( $comment_post_ID ) ) {\n\n\t\t/**\n\t\t * Fires when a comment is attempted on a post that has comments closed.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param int $comment_post_ID Post ID.\n\t\t */\n\t\tdo_action( 'comment_closed', $comment_post_ID );\n\n\t\treturn new WP_Error( 'comment_closed', __( 'Sorry, comments are closed for this item.' ), 403 );\n\n\t} elseif ( 'trash' === $status ) {\n\n\t\t/**\n\t\t * Fires when a comment is attempted on a trashed post.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param int $comment_post_ID Post ID.\n\t\t */\n\t\tdo_action( 'comment_on_trash', $comment_post_ID );\n\n\t\treturn new WP_Error( 'comment_on_trash' );\n\n\t} elseif ( ! $status_obj->public && ! $status_obj->private ) {\n\n\t\t/**\n\t\t * Fires when a comment is attempted on a post in draft mode.\n\t\t *\n\t\t * @since 1.5.1\n\t\t *\n\t\t * @param int $comment_post_ID Post ID.\n\t\t */\n\t\tdo_action( 'comment_on_draft', $comment_post_ID );\n\n\t\tif ( current_user_can( 'read_post', $comment_post_ID ) ) {\n\t\t\treturn new WP_Error( 'comment_on_draft', __( 'Sorry, comments are not allowed for this item.' ), 403 );\n\t\t} else {\n\t\t\treturn new WP_Error( 'comment_on_draft' );\n\t\t}\n\t} elseif ( post_password_required( $comment_post_ID ) ) {\n\n\t\t/**\n\t\t * Fires when a comment is attempted on a password-protected post.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param int $comment_post_ID Post ID.\n\t\t */\n\t\tdo_action( 'comment_on_password_protected', $comment_post_ID );\n\n\t\treturn new WP_Error( 'comment_on_password_protected' );\n\n\t} else {\n\n\t\t/**\n\t\t * Fires before a comment is posted.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param int $comment_post_ID Post ID.\n\t\t */\n\t\tdo_action( 'pre_comment_on_post', $comment_post_ID );\n\n\t}\n\n\t// If the user is logged in.\n\t$user = wp_get_current_user();\n\tif ( $user->exists() ) {\n\t\tif ( empty( $user->display_name ) ) {\n\t\t\t$user->display_name = $user->user_login;\n\t\t}\n\t\t$comment_author       = $user->display_name;\n\t\t$comment_author_email = $user->user_email;\n\t\t$comment_author_url   = $user->user_url;\n\t\t$user_ID              = $user->ID;\n\t\tif ( current_user_can( 'unfiltered_html' ) ) {\n\t\t\tif ( ! isset( $comment_data['_wp_unfiltered_html_comment'] )\n\t\t\t\t|| ! wp_verify_nonce( $comment_data['_wp_unfiltered_html_comment'], 'unfiltered-html-comment_' . $comment_post_ID )\n\t\t\t) {\n\t\t\t\tkses_remove_filters(); // Start with a clean slate.\n\t\t\t\tkses_init_filters();   // Set up the filters.\n\t\t\t\tremove_filter( 'pre_comment_content', 'wp_filter_post_kses' );\n\t\t\t\tadd_filter( 'pre_comment_content', 'wp_filter_kses' );\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ( get_option( 'comment_registration' ) ) {\n\t\t\treturn new WP_Error( 'not_logged_in', __( 'Sorry, you must be logged in to comment.' ), 403 );\n\t\t}\n\t}\n\n\t$comment_type = 'comment';\n\n\tif ( get_option( 'require_name_email' ) && ! $user->exists() ) {\n\t\tif ( '' == $comment_author_email || '' == $comment_author ) {\n\t\t\treturn new WP_Error( 'require_name_email', __( '<strong>Error</strong>: Please fill the required fields (name, email).' ), 200 );\n\t\t} elseif ( ! is_email( $comment_author_email ) ) {\n\t\t\treturn new WP_Error( 'require_valid_email', __( '<strong>Error</strong>: Please enter a valid email address.' ), 200 );\n\t\t}\n\t}\n\n\t$commentdata = compact(\n\t\t'comment_post_ID',\n\t\t'comment_author',\n\t\t'comment_author_email',\n\t\t'comment_author_url',\n\t\t'comment_content',\n\t\t'comment_type',\n\t\t'comment_parent',\n\t\t'user_ID'\n\t);\n\n\t/**\n\t * Filters whether an empty comment should be allowed.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param bool  $allow_empty_comment Whether to allow empty comments. Default false.\n\t * @param array $commentdata         Array of comment data to be sent to wp_insert_comment().\n\t */\n\t$allow_empty_comment = apply_filters( 'allow_empty_comment', false, $commentdata );\n\tif ( '' === $comment_content && ! $allow_empty_comment ) {\n\t\treturn new WP_Error( 'require_valid_comment', __( '<strong>Error</strong>: Please type your comment text.' ), 200 );\n\t}\n\n\t$check_max_lengths = wp_check_comment_data_max_lengths( $commentdata );\n\tif ( is_wp_error( $check_max_lengths ) ) {\n\t\treturn $check_max_lengths;\n\t}\n\n\t$comment_id = wp_new_comment( wp_slash( $commentdata ), true );\n\tif ( is_wp_error( $comment_id ) ) {\n\t\treturn $comment_id;\n\t}\n\n\tif ( ! $comment_id ) {\n\t\treturn new WP_Error( 'comment_save_error', __( '<strong>Error</strong>: The comment could not be saved. Please try again later.' ), 500 );\n\t}\n\n\treturn get_comment( $comment_id );\n}\n\n/**\n * Registers the personal data exporter for comments.\n *\n * @since 4.9.6\n *\n * @param array $exporters An array of personal data exporters.\n * @return array An array of personal data exporters.\n */\nfunction wp_register_comment_personal_data_exporter( $exporters ) {\n\t$exporters['wordpress-comments'] = array(\n\t\t'exporter_friendly_name' => __( 'WordPress Comments' ),\n\t\t'callback'               => 'wp_comments_personal_data_exporter',\n\t);\n\n\treturn $exporters;\n}\n\n/**\n * Finds and exports personal data associated with an email address from the comments table.\n *\n * @since 4.9.6\n *\n * @param string $email_address The comment author email address.\n * @param int    $page          Comment page.\n * @return array An array of personal data.\n */\nfunction wp_comments_personal_data_exporter( $email_address, $page = 1 ) {\n\t// Limit us to 500 comments at a time to avoid timing out.\n\t$number = 500;\n\t$page   = (int) $page;\n\n\t$data_to_export = array();\n\n\t$comments = get_comments(\n\t\tarray(\n\t\t\t'author_email'              => $email_address,\n\t\t\t'number'                    => $number,\n\t\t\t'paged'                     => $page,\n\t\t\t'order_by'                  => 'comment_ID',\n\t\t\t'order'                     => 'ASC',\n\t\t\t'update_comment_meta_cache' => false,\n\t\t)\n\t);\n\n\t$comment_prop_to_export = array(\n\t\t'comment_author'       => __( 'Comment Author' ),\n\t\t'comment_author_email' => __( 'Comment Author Email' ),\n\t\t'comment_author_url'   => __( 'Comment Author URL' ),\n\t\t'comment_author_IP'    => __( 'Comment Author IP' ),\n\t\t'comment_agent'        => __( 'Comment Author User Agent' ),\n\t\t'comment_date'         => __( 'Comment Date' ),\n\t\t'comment_content'      => __( 'Comment Content' ),\n\t\t'comment_link'         => __( 'Comment URL' ),\n\t);\n\n\tforeach ( (array) $comments as $comment ) {\n\t\t$comment_data_to_export = array();\n\n\t\tforeach ( $comment_prop_to_export as $key => $name ) {\n\t\t\t$value = '';\n\n\t\t\tswitch ( $key ) {\n\t\t\t\tcase 'comment_author':\n\t\t\t\tcase 'comment_author_email':\n\t\t\t\tcase 'comment_author_url':\n\t\t\t\tcase 'comment_author_IP':\n\t\t\t\tcase 'comment_agent':\n\t\t\t\tcase 'comment_date':\n\t\t\t\t\t$value = $comment->{$key};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'comment_content':\n\t\t\t\t\t$value = get_comment_text( $comment->comment_ID );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'comment_link':\n\t\t\t\t\t$value = get_comment_link( $comment->comment_ID );\n\t\t\t\t\t$value = sprintf(\n\t\t\t\t\t\t'<a href=\"%s\" target=\"_blank\" rel=\"noreferrer noopener\">%s</a>',\n\t\t\t\t\t\tesc_url( $value ),\n\t\t\t\t\t\tesc_html( $value )\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( ! empty( $value ) ) {\n\t\t\t\t$comment_data_to_export[] = array(\n\t\t\t\t\t'name'  => $name,\n\t\t\t\t\t'value' => $value,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$data_to_export[] = array(\n\t\t\t'group_id'          => 'comments',\n\t\t\t'group_label'       => __( 'Comments' ),\n\t\t\t'group_description' => __( 'User&#8217;s comment data.' ),\n\t\t\t'item_id'           => \"comment-{$comment->comment_ID}\",\n\t\t\t'data'              => $comment_data_to_export,\n\t\t);\n\t}\n\n\t$done = count( $comments ) < $number;\n\n\treturn array(\n\t\t'data' => $data_to_export,\n\t\t'done' => $done,\n\t);\n}\n\n/**\n * Registers the personal data eraser for comments.\n *\n * @since 4.9.6\n *\n * @param array $erasers An array of personal data erasers.\n * @return array An array of personal data erasers.\n */\nfunction wp_register_comment_personal_data_eraser( $erasers ) {\n\t$erasers['wordpress-comments'] = array(\n\t\t'eraser_friendly_name' => __( 'WordPress Comments' ),\n\t\t'callback'             => 'wp_comments_personal_data_eraser',\n\t);\n\n\treturn $erasers;\n}\n\n/**\n * Erases personal data associated with an email address from the comments table.\n *\n * @since 4.9.6\n *\n * @param string $email_address The comment author email address.\n * @param int    $page          Comment page.\n * @return array\n */\nfunction wp_comments_personal_data_eraser( $email_address, $page = 1 ) {\n\tglobal $wpdb;\n\n\tif ( empty( $email_address ) ) {\n\t\treturn array(\n\t\t\t'items_removed'  => false,\n\t\t\t'items_retained' => false,\n\t\t\t'messages'       => array(),\n\t\t\t'done'           => true,\n\t\t);\n\t}\n\n\t// Limit us to 500 comments at a time to avoid timing out.\n\t$number         = 500;\n\t$page           = (int) $page;\n\t$items_removed  = false;\n\t$items_retained = false;\n\n\t$comments = get_comments(\n\t\tarray(\n\t\t\t'author_email'       => $email_address,\n\t\t\t'number'             => $number,\n\t\t\t'paged'              => $page,\n\t\t\t'order_by'           => 'comment_ID',\n\t\t\t'order'              => 'ASC',\n\t\t\t'include_unapproved' => true,\n\t\t)\n\t);\n\n\t/* translators: Name of a comment's author after being anonymized. */\n\t$anon_author = __( 'Anonymous' );\n\t$messages    = array();\n\n\tforeach ( (array) $comments as $comment ) {\n\t\t$anonymized_comment                         = array();\n\t\t$anonymized_comment['comment_agent']        = '';\n\t\t$anonymized_comment['comment_author']       = $anon_author;\n\t\t$anonymized_comment['comment_author_email'] = '';\n\t\t$anonymized_comment['comment_author_IP']    = wp_privacy_anonymize_data( 'ip', $comment->comment_author_IP );\n\t\t$anonymized_comment['comment_author_url']   = '';\n\t\t$anonymized_comment['user_id']              = 0;\n\n\t\t$comment_id = (int) $comment->comment_ID;\n\n\t\t/**\n\t\t * Filters whether to anonymize the comment.\n\t\t *\n\t\t * @since 4.9.6\n\t\t *\n\t\t * @param bool|string $anon_message       Whether to apply the comment anonymization (bool) or a custom\n\t\t *                                        message (string). Default true.\n\t\t * @param WP_Comment  $comment            WP_Comment object.\n\t\t * @param array       $anonymized_comment Anonymized comment data.\n\t\t */\n\t\t$anon_message = apply_filters( 'wp_anonymize_comment', true, $comment, $anonymized_comment );\n\n\t\tif ( true !== $anon_message ) {\n\t\t\tif ( $anon_message && is_string( $anon_message ) ) {\n\t\t\t\t$messages[] = esc_html( $anon_message );\n\t\t\t} else {\n\t\t\t\t/* translators: %d: Comment ID. */\n\t\t\t\t$messages[] = sprintf( __( 'Comment %d contains personal data but could not be anonymized.' ), $comment_id );\n\t\t\t}\n\n\t\t\t$items_retained = true;\n\n\t\t\tcontinue;\n\t\t}\n\n\t\t$args = array(\n\t\t\t'comment_ID' => $comment_id,\n\t\t);\n\n\t\t$updated = $wpdb->update( $wpdb->comments, $anonymized_comment, $args );\n\n\t\tif ( $updated ) {\n\t\t\t$items_removed = true;\n\t\t\tclean_comment_cache( $comment_id );\n\t\t} else {\n\t\t\t$items_retained = true;\n\t\t}\n\t}\n\n\t$done = count( $comments ) < $number;\n\n\treturn array(\n\t\t'items_removed'  => $items_removed,\n\t\t'items_retained' => $items_retained,\n\t\t'messages'       => $messages,\n\t\t'done'           => $done,\n\t);\n}\n\n/**\n * Sets the last changed time for the 'comment' cache group.\n *\n * @since 5.0.0\n */\nfunction wp_cache_set_comments_last_changed() {\n\twp_cache_set( 'last_changed', microtime(), 'comment' );\n}\n\n/**\n * Updates the comment type for a batch of comments.\n *\n * @since 5.5.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction _wp_batch_update_comment_type() {\n\tglobal $wpdb;\n\n\t$lock_name = 'update_comment_type.lock';\n\n\t// Try to lock.\n\t$lock_result = $wpdb->query( $wpdb->prepare( \"INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'no') /* LOCK */\", $lock_name, time() ) );\n\n\tif ( ! $lock_result ) {\n\t\t$lock_result = get_option( $lock_name );\n\n\t\t// Bail if we were unable to create a lock, or if the existing lock is still valid.\n\t\tif ( ! $lock_result || ( $lock_result > ( time() - HOUR_IN_SECONDS ) ) ) {\n\t\t\twp_schedule_single_event( time() + ( 5 * MINUTE_IN_SECONDS ), 'wp_update_comment_type_batch' );\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// Update the lock, as by this point we've definitely got a lock, just need to fire the actions.\n\tupdate_option( $lock_name, time() );\n\n\t// Check if there's still an empty comment type.\n\t$empty_comment_type = $wpdb->get_var(\n\t\t\"SELECT comment_ID FROM $wpdb->comments\n\t\tWHERE comment_type = ''\n\t\tLIMIT 1\"\n\t);\n\n\t// No empty comment type, we're done here.\n\tif ( ! $empty_comment_type ) {\n\t\tupdate_option( 'finished_updating_comment_type', true );\n\t\tdelete_option( $lock_name );\n\t\treturn;\n\t}\n\n\t// Empty comment type found? We'll need to run this script again.\n\twp_schedule_single_event( time() + ( 2 * MINUTE_IN_SECONDS ), 'wp_update_comment_type_batch' );\n\n\t/**\n\t * Filters the comment batch size for updating the comment type.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param int $comment_batch_size The comment batch size. Default 100.\n\t */\n\t$comment_batch_size = (int) apply_filters( 'wp_update_comment_type_batch_size', 100 );\n\n\t// Get the IDs of the comments to update.\n\t$comment_ids = $wpdb->get_col(\n\t\t$wpdb->prepare(\n\t\t\t\"SELECT comment_ID\n\t\t\tFROM {$wpdb->comments}\n\t\t\tWHERE comment_type = ''\n\t\t\tORDER BY comment_ID DESC\n\t\t\tLIMIT %d\",\n\t\t\t$comment_batch_size\n\t\t)\n\t);\n\n\tif ( $comment_ids ) {\n\t\t$comment_id_list = implode( ',', $comment_ids );\n\n\t\t// Update the `comment_type` field value to be `comment` for the next batch of comments.\n\t\t$wpdb->query(\n\t\t\t\"UPDATE {$wpdb->comments}\n\t\t\tSET comment_type = 'comment'\n\t\t\tWHERE comment_type = ''\n\t\t\tAND comment_ID IN ({$comment_id_list})\" // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared\n\t\t);\n\n\t\t// Make sure to clean the comment cache.\n\t\tclean_comment_cache( $comment_ids );\n\t}\n\n\tdelete_option( $lock_name );\n}\n\n/**\n * In order to avoid the _wp_batch_update_comment_type() job being accidentally removed,\n * check that it's still scheduled while we haven't finished updating comment types.\n *\n * @ignore\n * @since 5.5.0\n */\nfunction _wp_check_for_scheduled_update_comment_type() {\n\tif ( ! get_option( 'finished_updating_comment_type' ) && ! wp_next_scheduled( 'wp_update_comment_type_batch' ) ) {\n\t\twp_schedule_single_event( time() + MINUTE_IN_SECONDS, 'wp_update_comment_type_batch' );\n\t}\n}\n", "num_lines": 3884}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress implementation for PHP functions either missing from older PHP versions or not included by default.\n *\n * @package PHP\n * @access private\n */\n\n// If gettext isn't available.\nif ( ! function_exists( '_' ) ) {\n\tfunction _( $string ) {\n\t\treturn $string;\n\t}\n}\n\n/**\n * Returns whether PCRE/u (PCRE_UTF8 modifier) is available for use.\n *\n * @ignore\n * @since 4.2.2\n * @access private\n *\n * @param bool $set - Used for testing only\n *             null   : default - get PCRE/u capability\n *             false  : Used for testing - return false for future calls to this function\n *             'reset': Used for testing - restore default behavior of this function\n */\nfunction _wp_can_use_pcre_u( $set = null ) {\n\tstatic $utf8_pcre = 'reset';\n\n\tif ( null !== $set ) {\n\t\t$utf8_pcre = $set;\n\t}\n\n\tif ( 'reset' === $utf8_pcre ) {\n\t\t// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged -- intentional error generated to detect PCRE/u support.\n\t\t$utf8_pcre = @preg_match( '/^./u', 'a' );\n\t}\n\n\treturn $utf8_pcre;\n}\n\nif ( ! function_exists( 'mb_substr' ) ) :\n\t/**\n\t * Compat function to mimic mb_substr().\n\t *\n\t * @ignore\n\t * @since 3.2.0\n\t *\n\t * @see _mb_substr()\n\t *\n\t * @param string      $str      The string to extract the substring from.\n\t * @param int         $start    Position to being extraction from in `$str`.\n\t * @param int|null    $length   Optional. Maximum number of characters to extract from `$str`.\n\t *                              Default null.\n\t * @param string|null $encoding Optional. Character encoding to use. Default null.\n\t * @return string Extracted substring.\n\t */\n\tfunction mb_substr( $str, $start, $length = null, $encoding = null ) {\n\t\treturn _mb_substr( $str, $start, $length, $encoding );\n\t}\nendif;\n\n/**\n * Internal compat function to mimic mb_substr().\n *\n * Only understands UTF-8 and 8bit.  All other character sets will be treated as 8bit.\n * For $encoding === UTF-8, the $str input is expected to be a valid UTF-8 byte sequence.\n * The behavior of this function for invalid inputs is undefined.\n *\n * @ignore\n * @since 3.2.0\n *\n * @param string      $str      The string to extract the substring from.\n * @param int         $start    Position to being extraction from in `$str`.\n * @param int|null    $length   Optional. Maximum number of characters to extract from `$str`.\n *                              Default null.\n * @param string|null $encoding Optional. Character encoding to use. Default null.\n * @return string Extracted substring.\n */\nfunction _mb_substr( $str, $start, $length = null, $encoding = null ) {\n\tif ( null === $encoding ) {\n\t\t$encoding = get_option( 'blog_charset' );\n\t}\n\n\t/*\n\t * The solution below works only for UTF-8, so in case of a different\n\t * charset just use built-in substr().\n\t */\n\tif ( ! in_array( $encoding, array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ), true ) ) {\n\t\treturn is_null( $length ) ? substr( $str, $start ) : substr( $str, $start, $length );\n\t}\n\n\tif ( _wp_can_use_pcre_u() ) {\n\t\t// Use the regex unicode support to separate the UTF-8 characters into an array.\n\t\tpreg_match_all( '/./us', $str, $match );\n\t\t$chars = is_null( $length ) ? array_slice( $match[0], $start ) : array_slice( $match[0], $start, $length );\n\t\treturn implode( '', $chars );\n\t}\n\n\t$regex = '/(\n\t\t[\\x00-\\x7F]                  # single-byte sequences   0xxxxxxx\n\t\t| [\\xC2-\\xDF][\\x80-\\xBF]       # double-byte sequences   110xxxxx 10xxxxxx\n\t\t| \\xE0[\\xA0-\\xBF][\\x80-\\xBF]   # triple-byte sequences   1110xxxx 10xxxxxx * 2\n\t\t| [\\xE1-\\xEC][\\x80-\\xBF]{2}\n\t\t| \\xED[\\x80-\\x9F][\\x80-\\xBF]\n\t\t| [\\xEE-\\xEF][\\x80-\\xBF]{2}\n\t\t| \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # four-byte sequences   11110xxx 10xxxxxx * 3\n\t\t| [\\xF1-\\xF3][\\x80-\\xBF]{3}\n\t\t| \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2}\n\t)/x';\n\n\t// Start with 1 element instead of 0 since the first thing we do is pop.\n\t$chars = array( '' );\n\tdo {\n\t\t// We had some string left over from the last round, but we counted it in that last round.\n\t\tarray_pop( $chars );\n\n\t\t/*\n\t\t * Split by UTF-8 character, limit to 1000 characters (last array element will contain\n\t\t * the rest of the string).\n\t\t */\n\t\t$pieces = preg_split( $regex, $str, 1000, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY );\n\n\t\t$chars = array_merge( $chars, $pieces );\n\n\t\t// If there's anything left over, repeat the loop.\n\t} while ( count( $pieces ) > 1 && $str = array_pop( $pieces ) );\n\n\treturn join( '', array_slice( $chars, $start, $length ) );\n}\n\nif ( ! function_exists( 'mb_strlen' ) ) :\n\t/**\n\t * Compat function to mimic mb_strlen().\n\t *\n\t * @ignore\n\t * @since 4.2.0\n\t *\n\t * @see _mb_strlen()\n\t *\n\t * @param string      $str      The string to retrieve the character length from.\n\t * @param string|null $encoding Optional. Character encoding to use. Default null.\n\t * @return int String length of `$str`.\n\t */\n\tfunction mb_strlen( $str, $encoding = null ) {\n\t\treturn _mb_strlen( $str, $encoding );\n\t}\nendif;\n\n/**\n * Internal compat function to mimic mb_strlen().\n *\n * Only understands UTF-8 and 8bit.  All other character sets will be treated as 8bit.\n * For $encoding === UTF-8, the `$str` input is expected to be a valid UTF-8 byte\n * sequence. The behavior of this function for invalid inputs is undefined.\n *\n * @ignore\n * @since 4.2.0\n *\n * @param string      $str      The string to retrieve the character length from.\n * @param string|null $encoding Optional. Character encoding to use. Default null.\n * @return int String length of `$str`.\n */\nfunction _mb_strlen( $str, $encoding = null ) {\n\tif ( null === $encoding ) {\n\t\t$encoding = get_option( 'blog_charset' );\n\t}\n\n\t/*\n\t * The solution below works only for UTF-8, so in case of a different charset\n\t * just use built-in strlen().\n\t */\n\tif ( ! in_array( $encoding, array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ), true ) ) {\n\t\treturn strlen( $str );\n\t}\n\n\tif ( _wp_can_use_pcre_u() ) {\n\t\t// Use the regex unicode support to separate the UTF-8 characters into an array.\n\t\tpreg_match_all( '/./us', $str, $match );\n\t\treturn count( $match[0] );\n\t}\n\n\t$regex = '/(?:\n\t\t[\\x00-\\x7F]                  # single-byte sequences   0xxxxxxx\n\t\t| [\\xC2-\\xDF][\\x80-\\xBF]       # double-byte sequences   110xxxxx 10xxxxxx\n\t\t| \\xE0[\\xA0-\\xBF][\\x80-\\xBF]   # triple-byte sequences   1110xxxx 10xxxxxx * 2\n\t\t| [\\xE1-\\xEC][\\x80-\\xBF]{2}\n\t\t| \\xED[\\x80-\\x9F][\\x80-\\xBF]\n\t\t| [\\xEE-\\xEF][\\x80-\\xBF]{2}\n\t\t| \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # four-byte sequences   11110xxx 10xxxxxx * 3\n\t\t| [\\xF1-\\xF3][\\x80-\\xBF]{3}\n\t\t| \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2}\n\t)/x';\n\n\t// Start at 1 instead of 0 since the first thing we do is decrement.\n\t$count = 1;\n\tdo {\n\t\t// We had some string left over from the last round, but we counted it in that last round.\n\t\t$count--;\n\n\t\t/*\n\t\t * Split by UTF-8 character, limit to 1000 characters (last array element will contain\n\t\t * the rest of the string).\n\t\t */\n\t\t$pieces = preg_split( $regex, $str, 1000 );\n\n\t\t// Increment.\n\t\t$count += count( $pieces );\n\n\t\t// If there's anything left over, repeat the loop.\n\t} while ( $str = array_pop( $pieces ) );\n\n\t// Fencepost: preg_split() always returns one extra item in the array.\n\treturn --$count;\n}\n\nif ( ! function_exists( 'hash_hmac' ) ) :\n\t/**\n\t * Compat function to mimic hash_hmac().\n\t *\n\t * The Hash extension is bundled with PHP by default since PHP 5.1.2.\n\t * However, the extension may be explicitly disabled on select servers.\n\t * As of PHP 7.4.0, the Hash extension is a core PHP extension and can no\n\t * longer be disabled.\n\t * I.e. when PHP 7.4.0 becomes the minimum requirement, this polyfill\n\t * and the associated `_hash_hmac()` function can be safely removed.\n\t *\n\t * @ignore\n\t * @since 3.2.0\n\t *\n\t * @see _hash_hmac()\n\t *\n\t * @param string $algo       Hash algorithm. Accepts 'md5' or 'sha1'.\n\t * @param string $data       Data to be hashed.\n\t * @param string $key        Secret key to use for generating the hash.\n\t * @param bool   $raw_output Optional. Whether to output raw binary data (true),\n\t *                           or lowercase hexits (false). Default false.\n\t * @return string|false The hash in output determined by `$raw_output`. False if `$algo`\n\t *                      is unknown or invalid.\n\t */\n\tfunction hash_hmac( $algo, $data, $key, $raw_output = false ) {\n\t\treturn _hash_hmac( $algo, $data, $key, $raw_output );\n\t}\nendif;\n\n/**\n * Internal compat function to mimic hash_hmac().\n *\n * @ignore\n * @since 3.2.0\n *\n * @param string $algo       Hash algorithm. Accepts 'md5' or 'sha1'.\n * @param string $data       Data to be hashed.\n * @param string $key        Secret key to use for generating the hash.\n * @param bool   $raw_output Optional. Whether to output raw binary data (true),\n *                           or lowercase hexits (false). Default false.\n * @return string|false The hash in output determined by `$raw_output`. False if `$algo`\n *                      is unknown or invalid.\n */\nfunction _hash_hmac( $algo, $data, $key, $raw_output = false ) {\n\t$packs = array(\n\t\t'md5'  => 'H32',\n\t\t'sha1' => 'H40',\n\t);\n\n\tif ( ! isset( $packs[ $algo ] ) ) {\n\t\treturn false;\n\t}\n\n\t$pack = $packs[ $algo ];\n\n\tif ( strlen( $key ) > 64 ) {\n\t\t$key = pack( $pack, $algo( $key ) );\n\t}\n\n\t$key = str_pad( $key, 64, chr( 0 ) );\n\n\t$ipad = ( substr( $key, 0, 64 ) ^ str_repeat( chr( 0x36 ), 64 ) );\n\t$opad = ( substr( $key, 0, 64 ) ^ str_repeat( chr( 0x5C ), 64 ) );\n\n\t$hmac = $algo( $opad . pack( $pack, $algo( $ipad . $data ) ) );\n\n\tif ( $raw_output ) {\n\t\treturn pack( $pack, $hmac );\n\t}\n\treturn $hmac;\n}\n\nif ( ! function_exists( 'hash_equals' ) ) :\n\t/**\n\t * Timing attack safe string comparison\n\t *\n\t * Compares two strings using the same time whether they're equal or not.\n\t *\n\t * Note: It can leak the length of a string when arguments of differing length are supplied.\n\t *\n\t * This function was added in PHP 5.6.\n\t * However, the Hash extension may be explicitly disabled on select servers.\n\t * As of PHP 7.4.0, the Hash extension is a core PHP extension and can no\n\t * longer be disabled.\n\t * I.e. when PHP 7.4.0 becomes the minimum requirement, this polyfill\n\t * can be safely removed.\n\t *\n\t * @since 3.9.2\n\t *\n\t * @param string $a Expected string.\n\t * @param string $b Actual, user supplied, string.\n\t * @return bool Whether strings are equal.\n\t */\n\tfunction hash_equals( $a, $b ) {\n\t\t$a_length = strlen( $a );\n\t\tif ( strlen( $b ) !== $a_length ) {\n\t\t\treturn false;\n\t\t}\n\t\t$result = 0;\n\n\t\t// Do not attempt to \"optimize\" this.\n\t\tfor ( $i = 0; $i < $a_length; $i++ ) {\n\t\t\t$result |= ord( $a[ $i ] ) ^ ord( $b[ $i ] );\n\t\t}\n\n\t\treturn 0 === $result;\n\t}\nendif;\n\n// random_int() was introduced in PHP 7.0.\nif ( ! function_exists( 'random_int' ) ) {\n\trequire ABSPATH . WPINC . '/random_compat/random.php';\n}\n// sodium_crypto_box() was introduced in PHP 7.2.\nif ( ! function_exists( 'sodium_crypto_box' ) ) {\n\trequire ABSPATH . WPINC . '/sodium_compat/autoload.php';\n}\n\nif ( ! function_exists( 'is_countable' ) ) {\n\t/**\n\t * Polyfill for is_countable() function added in PHP 7.3.\n\t *\n\t * Verify that the content of a variable is an array or an object\n\t * implementing the Countable interface.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param mixed $var The value to check.\n\t * @return bool True if `$var` is countable, false otherwise.\n\t */\n\tfunction is_countable( $var ) {\n\t\treturn ( is_array( $var )\n\t\t\t|| $var instanceof Countable\n\t\t\t|| $var instanceof SimpleXMLElement\n\t\t\t|| $var instanceof ResourceBundle\n\t\t);\n\t}\n}\n\nif ( ! function_exists( 'is_iterable' ) ) {\n\t/**\n\t * Polyfill for is_iterable() function added in PHP 7.1.\n\t *\n\t * Verify that the content of a variable is an array or an object\n\t * implementing the Traversable interface.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param mixed $var The value to check.\n\t * @return bool True if `$var` is iterable, false otherwise.\n\t */\n\tfunction is_iterable( $var ) {\n\t\treturn ( is_array( $var ) || $var instanceof Traversable );\n\t}\n}\n", "num_lines": 373}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Cron API\n *\n * @package WordPress\n */\n\n/**\n * Schedules an event to run only once.\n *\n * Schedules a hook which will be triggered by WordPress at the specified time.\n * The action will trigger when someone visits your WordPress site if the scheduled\n * time has passed.\n *\n * Note that scheduling an event to occur within 10 minutes of an existing event\n * with the same action hook will be ignored unless you pass unique `$args` values\n * for each scheduled event.\n *\n * Use wp_next_scheduled() to prevent duplicate events.\n *\n * Use wp_schedule_event() to schedule a recurring event.\n *\n * @since 2.1.0\n * @since 5.1.0 Return value modified to boolean indicating success or failure,\n *              {@see 'pre_schedule_event'} filter added to short-circuit the function.\n *\n * @link https://developer.wordpress.org/reference/functions/wp_schedule_single_event/\n *\n * @param int    $timestamp  Unix timestamp (UTC) for when to next run the event.\n * @param string $hook       Action hook to execute when the event is run.\n * @param array  $args       Optional. Array containing each separate argument to pass to the hook's callback function.\n * @return bool True if event successfully scheduled. False for failure.\n */\nfunction wp_schedule_single_event( $timestamp, $hook, $args = array() ) {\n\t// Make sure timestamp is a positive integer.\n\tif ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) {\n\t\treturn false;\n\t}\n\n\t$event = (object) array(\n\t\t'hook'      => $hook,\n\t\t'timestamp' => $timestamp,\n\t\t'schedule'  => false,\n\t\t'args'      => $args,\n\t);\n\n\t/**\n\t * Filter to preflight or hijack scheduling an event.\n\t *\n\t * Returning a non-null value will short-circuit adding the event to the\n\t * cron array, causing the function to return the filtered value instead.\n\t *\n\t * Both single events and recurring events are passed through this filter;\n\t * single events have `$event->schedule` as false, whereas recurring events\n\t * have this set to a recurrence from wp_get_schedules(). Recurring\n\t * events also have the integer recurrence interval set as `$event->interval`.\n\t *\n\t * For plugins replacing wp-cron, it is recommended you check for an\n\t * identical event within ten minutes and apply the {@see 'schedule_event'}\n\t * filter to check if another plugin has disallowed the event before scheduling.\n\t *\n\t * Return true if the event was scheduled, false if not.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param null|bool $pre   Value to return instead. Default null to continue adding the event.\n\t * @param stdClass  $event {\n\t *     An object containing an event's data.\n\t *\n\t *     @type string       $hook      Action hook to execute when the event is run.\n\t *     @type int          $timestamp Unix timestamp (UTC) for when to next run the event.\n\t *     @type string|false $schedule  How often the event should subsequently recur.\n\t *     @type array        $args      Array containing each separate argument to pass to the hook's callback function.\n\t *     @type int          $interval  The interval time in seconds for the schedule. Only present for recurring events.\n\t * }\n\t */\n\t$pre = apply_filters( 'pre_schedule_event', null, $event );\n\tif ( null !== $pre ) {\n\t\treturn $pre;\n\t}\n\n\t/*\n\t * Check for a duplicated event.\n\t *\n\t * Don't schedule an event if there's already an identical event\n\t * within 10 minutes.\n\t *\n\t * When scheduling events within ten minutes of the current time,\n\t * all past identical events are considered duplicates.\n\t *\n\t * When scheduling an event with a past timestamp (ie, before the\n\t * current time) all events scheduled within the next ten minutes\n\t * are considered duplicates.\n\t */\n\t$crons     = (array) _get_cron_array();\n\t$key       = md5( serialize( $event->args ) );\n\t$duplicate = false;\n\n\tif ( $event->timestamp < time() + 10 * MINUTE_IN_SECONDS ) {\n\t\t$min_timestamp = 0;\n\t} else {\n\t\t$min_timestamp = $event->timestamp - 10 * MINUTE_IN_SECONDS;\n\t}\n\n\tif ( $event->timestamp < time() ) {\n\t\t$max_timestamp = time() + 10 * MINUTE_IN_SECONDS;\n\t} else {\n\t\t$max_timestamp = $event->timestamp + 10 * MINUTE_IN_SECONDS;\n\t}\n\n\tforeach ( $crons as $event_timestamp => $cron ) {\n\t\tif ( $event_timestamp < $min_timestamp ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( $event_timestamp > $max_timestamp ) {\n\t\t\tbreak;\n\t\t}\n\t\tif ( isset( $cron[ $event->hook ][ $key ] ) ) {\n\t\t\t$duplicate = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ( $duplicate ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Modify an event before it is scheduled.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param stdClass|false $event {\n\t *     An object containing an event's data, or boolean false to prevent the event from being scheduled.\n\t *\n\t *     @type string       $hook      Action hook to execute when the event is run.\n\t *     @type int          $timestamp Unix timestamp (UTC) for when to next run the event.\n\t *     @type string|false $schedule  How often the event should subsequently recur.\n\t *     @type array        $args      Array containing each separate argument to pass to the hook's callback function.\n\t *     @type int          $interval  The interval time in seconds for the schedule. Only present for recurring events.\n\t * }\n\t */\n\t$event = apply_filters( 'schedule_event', $event );\n\n\t// A plugin disallowed this event.\n\tif ( ! $event ) {\n\t\treturn false;\n\t}\n\n\t$crons[ $event->timestamp ][ $event->hook ][ $key ] = array(\n\t\t'schedule' => $event->schedule,\n\t\t'args'     => $event->args,\n\t);\n\tuksort( $crons, 'strnatcasecmp' );\n\treturn _set_cron_array( $crons );\n}\n\n/**\n * Schedules a recurring event.\n *\n * Schedules a hook which will be triggered by WordPress at the specified interval.\n * The action will trigger when someone visits your WordPress site if the scheduled\n * time has passed.\n *\n * Valid values for the recurrence are 'hourly', 'daily', and 'twicedaily'. These can\n * be extended using the {@see 'cron_schedules'} filter in wp_get_schedules().\n *\n * Note that scheduling an event to occur within 10 minutes of an existing event\n * with the same action hook will be ignored unless you pass unique `$args` values\n * for each scheduled event.\n *\n * Use wp_next_scheduled() to prevent duplicate events.\n *\n * Use wp_schedule_single_event() to schedule a non-recurring event.\n *\n * @since 2.1.0\n * @since 5.1.0 Return value modified to boolean indicating success or failure,\n *              {@see 'pre_schedule_event'} filter added to short-circuit the function.\n *\n * @link https://developer.wordpress.org/reference/functions/wp_schedule_event/\n *\n * @param int    $timestamp  Unix timestamp (UTC) for when to next run the event.\n * @param string $recurrence How often the event should subsequently recur. See wp_get_schedules() for accepted values.\n * @param string $hook       Action hook to execute when the event is run.\n * @param array  $args       Optional. Array containing each separate argument to pass to the hook's callback function.\n * @return bool True if event successfully scheduled. False for failure.\n */\nfunction wp_schedule_event( $timestamp, $recurrence, $hook, $args = array() ) {\n\t// Make sure timestamp is a positive integer.\n\tif ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) {\n\t\treturn false;\n\t}\n\n\t$schedules = wp_get_schedules();\n\n\tif ( ! isset( $schedules[ $recurrence ] ) ) {\n\t\treturn false;\n\t}\n\n\t$event = (object) array(\n\t\t'hook'      => $hook,\n\t\t'timestamp' => $timestamp,\n\t\t'schedule'  => $recurrence,\n\t\t'args'      => $args,\n\t\t'interval'  => $schedules[ $recurrence ]['interval'],\n\t);\n\n\t/** This filter is documented in wp-includes/cron.php */\n\t$pre = apply_filters( 'pre_schedule_event', null, $event );\n\tif ( null !== $pre ) {\n\t\treturn $pre;\n\t}\n\n\t/** This filter is documented in wp-includes/cron.php */\n\t$event = apply_filters( 'schedule_event', $event );\n\n\t// A plugin disallowed this event.\n\tif ( ! $event ) {\n\t\treturn false;\n\t}\n\n\t$key = md5( serialize( $event->args ) );\n\n\t$crons = _get_cron_array();\n\t$crons[ $event->timestamp ][ $event->hook ][ $key ] = array(\n\t\t'schedule' => $event->schedule,\n\t\t'args'     => $event->args,\n\t\t'interval' => $event->interval,\n\t);\n\tuksort( $crons, 'strnatcasecmp' );\n\treturn _set_cron_array( $crons );\n}\n\n/**\n * Reschedules a recurring event.\n *\n * Mainly for internal use, this takes the time stamp of a previously run\n * recurring event and reschedules it for its next run.\n *\n * To change upcoming scheduled events, use wp_schedule_event() to\n * change the recurrence frequency.\n *\n * @since 2.1.0\n * @since 5.1.0 Return value modified to boolean indicating success or failure,\n *              {@see 'pre_reschedule_event'} filter added to short-circuit the function.\n *\n * @param int    $timestamp  Unix timestamp (UTC) for when the event was scheduled.\n * @param string $recurrence How often the event should subsequently recur. See wp_get_schedules() for accepted values.\n * @param string $hook       Action hook to execute when the event is run.\n * @param array  $args       Optional. Array containing each separate argument to pass to the hook's callback function.\n * @return bool True if event successfully rescheduled. False for failure.\n */\nfunction wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array() ) {\n\t// Make sure timestamp is a positive integer.\n\tif ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) {\n\t\treturn false;\n\t}\n\n\t$schedules = wp_get_schedules();\n\t$interval  = 0;\n\n\t// First we try to get the interval from the schedule.\n\tif ( isset( $schedules[ $recurrence ] ) ) {\n\t\t$interval = $schedules[ $recurrence ]['interval'];\n\t}\n\n\t// Now we try to get it from the saved interval in case the schedule disappears.\n\tif ( 0 === $interval ) {\n\t\t$scheduled_event = wp_get_scheduled_event( $hook, $args, $timestamp );\n\t\tif ( $scheduled_event && isset( $scheduled_event->interval ) ) {\n\t\t\t$interval = $scheduled_event->interval;\n\t\t}\n\t}\n\n\t$event = (object) array(\n\t\t'hook'      => $hook,\n\t\t'timestamp' => $timestamp,\n\t\t'schedule'  => $recurrence,\n\t\t'args'      => $args,\n\t\t'interval'  => $interval,\n\t);\n\n\t/**\n\t * Filter to preflight or hijack rescheduling of events.\n\t *\n\t * Returning a non-null value will short-circuit the normal rescheduling\n\t * process, causing the function to return the filtered value instead.\n\t *\n\t * For plugins replacing wp-cron, return true if the event was successfully\n\t * rescheduled, false if not.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param null|bool $pre   Value to return instead. Default null to continue adding the event.\n\t * @param stdClass  $event {\n\t *     An object containing an event's data.\n\t *\n\t *     @type string       $hook      Action hook to execute when the event is run.\n\t *     @type int          $timestamp Unix timestamp (UTC) for when to next run the event.\n\t *     @type string|false $schedule  How often the event should subsequently recur.\n\t *     @type array        $args      Array containing each separate argument to pass to the hook's callback function.\n\t *     @type int          $interval  The interval time in seconds for the schedule. Only present for recurring events.\n\t * }\n\t */\n\t$pre = apply_filters( 'pre_reschedule_event', null, $event );\n\tif ( null !== $pre ) {\n\t\treturn $pre;\n\t}\n\n\t// Now we assume something is wrong and fail to schedule.\n\tif ( 0 == $interval ) {\n\t\treturn false;\n\t}\n\n\t$now = time();\n\n\tif ( $timestamp >= $now ) {\n\t\t$timestamp = $now + $interval;\n\t} else {\n\t\t$timestamp = $now + ( $interval - ( ( $now - $timestamp ) % $interval ) );\n\t}\n\n\treturn wp_schedule_event( $timestamp, $recurrence, $hook, $args );\n}\n\n/**\n * Unschedule a previously scheduled event.\n *\n * The $timestamp and $hook parameters are required so that the event can be\n * identified.\n *\n * @since 2.1.0\n * @since 5.1.0 Return value modified to boolean indicating success or failure,\n *              {@see 'pre_unschedule_event'} filter added to short-circuit the function.\n *\n * @param int    $timestamp Unix timestamp (UTC) of the event.\n * @param string $hook      Action hook of the event.\n * @param array  $args      Optional. Array containing each separate argument to pass to the hook's callback function.\n *                          Although not passed to a callback, these arguments are used to uniquely identify the\n *                          event, so they should be the same as those used when originally scheduling the event.\n * @return bool True if event successfully unscheduled. False for failure.\n */\nfunction wp_unschedule_event( $timestamp, $hook, $args = array() ) {\n\t// Make sure timestamp is a positive integer.\n\tif ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Filter to preflight or hijack unscheduling of events.\n\t *\n\t * Returning a non-null value will short-circuit the normal unscheduling\n\t * process, causing the function to return the filtered value instead.\n\t *\n\t * For plugins replacing wp-cron, return true if the event was successfully\n\t * unscheduled, false if not.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param null|bool $pre       Value to return instead. Default null to continue unscheduling the event.\n\t * @param int       $timestamp Timestamp for when to run the event.\n\t * @param string    $hook      Action hook, the execution of which will be unscheduled.\n\t * @param array     $args      Arguments to pass to the hook's callback function.\n\t */\n\t$pre = apply_filters( 'pre_unschedule_event', null, $timestamp, $hook, $args );\n\tif ( null !== $pre ) {\n\t\treturn $pre;\n\t}\n\n\t$crons = _get_cron_array();\n\t$key   = md5( serialize( $args ) );\n\tunset( $crons[ $timestamp ][ $hook ][ $key ] );\n\tif ( empty( $crons[ $timestamp ][ $hook ] ) ) {\n\t\tunset( $crons[ $timestamp ][ $hook ] );\n\t}\n\tif ( empty( $crons[ $timestamp ] ) ) {\n\t\tunset( $crons[ $timestamp ] );\n\t}\n\treturn _set_cron_array( $crons );\n}\n\n/**\n * Unschedules all events attached to the hook with the specified arguments.\n *\n * Warning: This function may return Boolean FALSE, but may also return a non-Boolean\n * value which evaluates to FALSE. For information about casting to booleans see the\n * {@link https://www.php.net/manual/en/language.types.boolean.php PHP documentation}. Use\n * the `===` operator for testing the return value of this function.\n *\n * @since 2.1.0\n * @since 5.1.0 Return value modified to indicate success or failure,\n *              {@see 'pre_clear_scheduled_hook'} filter added to short-circuit the function.\n *\n * @param string $hook Action hook, the execution of which will be unscheduled.\n * @param array  $args Optional. Arguments that were to be passed to the hook's callback function.\n * @return int|false On success an integer indicating number of events unscheduled (0 indicates no\n *                   events were registered with the hook and arguments combination), false if\n *                   unscheduling one or more events fail.\n */\nfunction wp_clear_scheduled_hook( $hook, $args = array() ) {\n\t// Backward compatibility.\n\t// Previously, this function took the arguments as discrete vars rather than an array like the rest of the API.\n\tif ( ! is_array( $args ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '3.0.0', __( 'This argument has changed to an array to match the behavior of the other cron functions.' ) );\n\t\t$args = array_slice( func_get_args(), 1 ); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection\n\t}\n\n\t/**\n\t * Filter to preflight or hijack clearing a scheduled hook.\n\t *\n\t * Returning a non-null value will short-circuit the normal unscheduling\n\t * process, causing the function to return the filtered value instead.\n\t *\n\t * For plugins replacing wp-cron, return the number of events successfully\n\t * unscheduled (zero if no events were registered with the hook) or false\n\t * if unscheduling one or more events fails.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param null|int|false $pre  Value to return instead. Default null to continue unscheduling the event.\n\t * @param string         $hook Action hook, the execution of which will be unscheduled.\n\t * @param array          $args Arguments to pass to the hook's callback function.\n\t */\n\t$pre = apply_filters( 'pre_clear_scheduled_hook', null, $hook, $args );\n\tif ( null !== $pre ) {\n\t\treturn $pre;\n\t}\n\n\t/*\n\t * This logic duplicates wp_next_scheduled().\n\t * It's required due to a scenario where wp_unschedule_event() fails due to update_option() failing,\n\t * and, wp_next_scheduled() returns the same schedule in an infinite loop.\n\t */\n\t$crons = _get_cron_array();\n\tif ( empty( $crons ) ) {\n\t\treturn 0;\n\t}\n\n\t$results = array();\n\t$key     = md5( serialize( $args ) );\n\tforeach ( $crons as $timestamp => $cron ) {\n\t\tif ( isset( $cron[ $hook ][ $key ] ) ) {\n\t\t\t$results[] = wp_unschedule_event( $timestamp, $hook, $args );\n\t\t}\n\t}\n\tif ( in_array( false, $results, true ) ) {\n\t\treturn false;\n\t}\n\treturn count( $results );\n}\n\n/**\n * Unschedules all events attached to the hook.\n *\n * Can be useful for plugins when deactivating to clean up the cron queue.\n *\n * Warning: This function may return Boolean FALSE, but may also return a non-Boolean\n * value which evaluates to FALSE. For information about casting to booleans see the\n * {@link https://www.php.net/manual/en/language.types.boolean.php PHP documentation}. Use\n * the `===` operator for testing the return value of this function.\n *\n * @since 4.9.0\n * @since 5.1.0 Return value added to indicate success or failure.\n *\n * @param string $hook Action hook, the execution of which will be unscheduled.\n * @return int|false On success an integer indicating number of events unscheduled (0 indicates no\n *                   events were registered on the hook), false if unscheduling fails.\n */\nfunction wp_unschedule_hook( $hook ) {\n\t/**\n\t * Filter to preflight or hijack clearing all events attached to the hook.\n\t *\n\t * Returning a non-null value will short-circuit the normal unscheduling\n\t * process, causing the function to return the filtered value instead.\n\t *\n\t * For plugins replacing wp-cron, return the number of events successfully\n\t * unscheduled (zero if no events were registered with the hook) or false\n\t * if unscheduling one or more events fails.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param null|int|false $pre  Value to return instead. Default null to continue unscheduling the hook.\n\t * @param string         $hook Action hook, the execution of which will be unscheduled.\n\t */\n\t$pre = apply_filters( 'pre_unschedule_hook', null, $hook );\n\tif ( null !== $pre ) {\n\t\treturn $pre;\n\t}\n\n\t$crons = _get_cron_array();\n\tif ( empty( $crons ) ) {\n\t\treturn 0;\n\t}\n\n\t$results = array();\n\tforeach ( $crons as $timestamp => $args ) {\n\t\tif ( ! empty( $crons[ $timestamp ][ $hook ] ) ) {\n\t\t\t$results[] = count( $crons[ $timestamp ][ $hook ] );\n\t\t}\n\t\tunset( $crons[ $timestamp ][ $hook ] );\n\n\t\tif ( empty( $crons[ $timestamp ] ) ) {\n\t\t\tunset( $crons[ $timestamp ] );\n\t\t}\n\t}\n\n\t/*\n\t * If the results are empty (zero events to unschedule), no attempt\n\t * to update the cron array is required.\n\t */\n\tif ( empty( $results ) ) {\n\t\treturn 0;\n\t}\n\tif ( _set_cron_array( $crons ) ) {\n\t\treturn array_sum( $results );\n\t}\n\treturn false;\n}\n\n/**\n * Retrieve a scheduled event.\n *\n * Retrieve the full event object for a given event, if no timestamp is specified the next\n * scheduled event is returned.\n *\n * @since 5.1.0\n *\n * @param string   $hook      Action hook of the event.\n * @param array    $args      Optional. Array containing each separate argument to pass to the hook's callback function.\n *                            Although not passed to a callback, these arguments are used to uniquely identify the\n *                            event, so they should be the same as those used when originally scheduling the event.\n * @param int|null $timestamp Optional. Unix timestamp (UTC) of the event. If not specified, the next scheduled event is returned.\n * @return object|false The event object. False if the event does not exist.\n */\nfunction wp_get_scheduled_event( $hook, $args = array(), $timestamp = null ) {\n\t/**\n\t * Filter to preflight or hijack retrieving a scheduled event.\n\t *\n\t * Returning a non-null value will short-circuit the normal process,\n\t * returning the filtered value instead.\n\t *\n\t * Return false if the event does not exist, otherwise an event object\n\t * should be returned.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param null|false|object $pre  Value to return instead. Default null to continue retrieving the event.\n\t * @param string            $hook Action hook of the event.\n\t * @param array             $args Array containing each separate argument to pass to the hook's callback function.\n\t *                                Although not passed to a callback, these arguments are used to uniquely identify\n\t *                                the event.\n\t * @param int|null  $timestamp Unix timestamp (UTC) of the event. Null to retrieve next scheduled event.\n\t */\n\t$pre = apply_filters( 'pre_get_scheduled_event', null, $hook, $args, $timestamp );\n\tif ( null !== $pre ) {\n\t\treturn $pre;\n\t}\n\n\tif ( null !== $timestamp && ! is_numeric( $timestamp ) ) {\n\t\treturn false;\n\t}\n\n\t$crons = _get_cron_array();\n\tif ( empty( $crons ) ) {\n\t\treturn false;\n\t}\n\n\t$key = md5( serialize( $args ) );\n\n\tif ( ! $timestamp ) {\n\t\t// Get next event.\n\t\t$next = false;\n\t\tforeach ( $crons as $timestamp => $cron ) {\n\t\t\tif ( isset( $cron[ $hook ][ $key ] ) ) {\n\t\t\t\t$next = $timestamp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ( ! $next ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$timestamp = $next;\n\t} elseif ( ! isset( $crons[ $timestamp ][ $hook ][ $key ] ) ) {\n\t\treturn false;\n\t}\n\n\t$event = (object) array(\n\t\t'hook'      => $hook,\n\t\t'timestamp' => $timestamp,\n\t\t'schedule'  => $crons[ $timestamp ][ $hook ][ $key ]['schedule'],\n\t\t'args'      => $args,\n\t);\n\n\tif ( isset( $crons[ $timestamp ][ $hook ][ $key ]['interval'] ) ) {\n\t\t$event->interval = $crons[ $timestamp ][ $hook ][ $key ]['interval'];\n\t}\n\n\treturn $event;\n}\n\n/**\n * Retrieve the next timestamp for an event.\n *\n * @since 2.1.0\n *\n * @param string $hook Action hook of the event.\n * @param array  $args Optional. Array containing each separate argument to pass to the hook's callback function.\n *                     Although not passed to a callback, these arguments are used to uniquely identify the\n *                     event, so they should be the same as those used when originally scheduling the event.\n * @return int|false The Unix timestamp of the next time the event will occur. False if the event doesn't exist.\n */\nfunction wp_next_scheduled( $hook, $args = array() ) {\n\t$next_event = wp_get_scheduled_event( $hook, $args );\n\tif ( ! $next_event ) {\n\t\treturn false;\n\t}\n\n\treturn $next_event->timestamp;\n}\n\n/**\n * Sends a request to run cron through HTTP request that doesn't halt page loading.\n *\n * @since 2.1.0\n * @since 5.1.0 Return values added.\n *\n * @param int $gmt_time Optional. Unix timestamp (UTC). Default 0 (current time is used).\n * @return bool True if spawned, false if no events spawned.\n */\nfunction spawn_cron( $gmt_time = 0 ) {\n\tif ( ! $gmt_time ) {\n\t\t$gmt_time = microtime( true );\n\t}\n\n\tif ( defined( 'DOING_CRON' ) || isset( $_GET['doing_wp_cron'] ) ) {\n\t\treturn false;\n\t}\n\n\t/*\n\t * Get the cron lock, which is a Unix timestamp of when the last cron was spawned\n\t * and has not finished running.\n\t *\n\t * Multiple processes on multiple web servers can run this code concurrently,\n\t * this lock attempts to make spawning as atomic as possible.\n\t */\n\t$lock = get_transient( 'doing_cron' );\n\n\tif ( $lock > $gmt_time + 10 * MINUTE_IN_SECONDS ) {\n\t\t$lock = 0;\n\t}\n\n\t// Don't run if another process is currently running it or more than once every 60 sec.\n\tif ( $lock + WP_CRON_LOCK_TIMEOUT > $gmt_time ) {\n\t\treturn false;\n\t}\n\n\t// Sanity check.\n\t$crons = wp_get_ready_cron_jobs();\n\tif ( empty( $crons ) ) {\n\t\treturn false;\n\t}\n\n\t$keys = array_keys( $crons );\n\tif ( isset( $keys[0] ) && $keys[0] > $gmt_time ) {\n\t\treturn false;\n\t}\n\n\tif ( defined( 'ALTERNATE_WP_CRON' ) && ALTERNATE_WP_CRON ) {\n\t\tif ( 'GET' !== $_SERVER['REQUEST_METHOD'] || defined( 'DOING_AJAX' ) || defined( 'XMLRPC_REQUEST' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$doing_wp_cron = sprintf( '%.22F', $gmt_time );\n\t\tset_transient( 'doing_cron', $doing_wp_cron );\n\n\t\tob_start();\n\t\twp_redirect( add_query_arg( 'doing_wp_cron', $doing_wp_cron, wp_unslash( $_SERVER['REQUEST_URI'] ) ) );\n\t\techo ' ';\n\n\t\t// Flush any buffers and send the headers.\n\t\twp_ob_end_flush_all();\n\t\tflush();\n\n\t\tinclude_once ABSPATH . 'wp-cron.php';\n\t\treturn true;\n\t}\n\n\t// Set the cron lock with the current unix timestamp, when the cron is being spawned.\n\t$doing_wp_cron = sprintf( '%.22F', $gmt_time );\n\tset_transient( 'doing_cron', $doing_wp_cron );\n\n\t/**\n\t * Filters the cron request arguments.\n\t *\n\t * @since 3.5.0\n\t * @since 4.5.0 The `$doing_wp_cron` parameter was added.\n\t *\n\t * @param array $cron_request_array {\n\t *     An array of cron request URL arguments.\n\t *\n\t *     @type string $url  The cron request URL.\n\t *     @type int    $key  The 22 digit GMT microtime.\n\t *     @type array  $args {\n\t *         An array of cron request arguments.\n\t *\n\t *         @type int  $timeout   The request timeout in seconds. Default .01 seconds.\n\t *         @type bool $blocking  Whether to set blocking for the request. Default false.\n\t *         @type bool $sslverify Whether SSL should be verified for the request. Default false.\n\t *     }\n\t * }\n\t * @param string $doing_wp_cron The unix timestamp of the cron lock.\n\t */\n\t$cron_request = apply_filters(\n\t\t'cron_request',\n\t\tarray(\n\t\t\t'url'  => add_query_arg( 'doing_wp_cron', $doing_wp_cron, site_url( 'wp-cron.php' ) ),\n\t\t\t'key'  => $doing_wp_cron,\n\t\t\t'args' => array(\n\t\t\t\t'timeout'   => 0.01,\n\t\t\t\t'blocking'  => false,\n\t\t\t\t/** This filter is documented in wp-includes/class-wp-http-streams.php */\n\t\t\t\t'sslverify' => apply_filters( 'https_local_ssl_verify', false ),\n\t\t\t),\n\t\t),\n\t\t$doing_wp_cron\n\t);\n\n\t$result = wp_remote_post( $cron_request['url'], $cron_request['args'] );\n\treturn ! is_wp_error( $result );\n}\n\n/**\n * Run scheduled callbacks or spawn cron for all scheduled events.\n *\n * Warning: This function may return Boolean FALSE, but may also return a non-Boolean\n * value which evaluates to FALSE. For information about casting to booleans see the\n * {@link https://www.php.net/manual/en/language.types.boolean.php PHP documentation}. Use\n * the `===` operator for testing the return value of this function.\n *\n * @since 2.1.0\n * @since 5.1.0 Return value added to indicate success or failure.\n *\n * @return bool|int On success an integer indicating number of events spawned (0 indicates no\n *                  events needed to be spawned), false if spawning fails for one or more events.\n */\nfunction wp_cron() {\n\t// Prevent infinite loops caused by lack of wp-cron.php.\n\tif ( strpos( $_SERVER['REQUEST_URI'], '/wp-cron.php' ) !== false || ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) ) {\n\t\treturn 0;\n\t}\n\n\t$crons = wp_get_ready_cron_jobs();\n\tif ( empty( $crons ) ) {\n\t\treturn 0;\n\t}\n\n\t$gmt_time = microtime( true );\n\t$keys     = array_keys( $crons );\n\tif ( isset( $keys[0] ) && $keys[0] > $gmt_time ) {\n\t\treturn 0;\n\t}\n\n\t$schedules = wp_get_schedules();\n\t$results   = array();\n\tforeach ( $crons as $timestamp => $cronhooks ) {\n\t\tif ( $timestamp > $gmt_time ) {\n\t\t\tbreak;\n\t\t}\n\t\tforeach ( (array) $cronhooks as $hook => $args ) {\n\t\t\tif ( isset( $schedules[ $hook ]['callback'] ) && ! call_user_func( $schedules[ $hook ]['callback'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$results[] = spawn_cron( $gmt_time );\n\t\t\tbreak 2;\n\t\t}\n\t}\n\n\tif ( in_array( false, $results, true ) ) {\n\t\treturn false;\n\t}\n\treturn count( $results );\n}\n\n/**\n * Retrieve supported event recurrence schedules.\n *\n * The default supported recurrences are 'hourly', 'twicedaily', 'daily', and 'weekly'.\n * A plugin may add more by hooking into the {@see 'cron_schedules'} filter.\n * The filter accepts an array of arrays. The outer array has a key that is the name\n * of the schedule, for example 'monthly'. The value is an array with two keys,\n * one is 'interval' and the other is 'display'.\n *\n * The 'interval' is a number in seconds of when the cron job should run.\n * So for 'hourly' the time is `HOUR_IN_SECONDS` (60 * 60 or 3600). For 'monthly',\n * the value would be `MONTH_IN_SECONDS` (30 * 24 * 60 * 60 or 2592000).\n *\n * The 'display' is the description. For the 'monthly' key, the 'display'\n * would be `__( 'Once Monthly' )`.\n *\n * For your plugin, you will be passed an array. You can easily add your\n * schedule by doing the following.\n *\n *     // Filter parameter variable name is 'array'.\n *     $array['monthly'] = array(\n *         'interval' => MONTH_IN_SECONDS,\n *         'display'  => __( 'Once Monthly' )\n *     );\n *\n * @since 2.1.0\n * @since 5.4.0 The 'weekly' schedule was added.\n *\n * @return array\n */\nfunction wp_get_schedules() {\n\t$schedules = array(\n\t\t'hourly'     => array(\n\t\t\t'interval' => HOUR_IN_SECONDS,\n\t\t\t'display'  => __( 'Once Hourly' ),\n\t\t),\n\t\t'twicedaily' => array(\n\t\t\t'interval' => 12 * HOUR_IN_SECONDS,\n\t\t\t'display'  => __( 'Twice Daily' ),\n\t\t),\n\t\t'daily'      => array(\n\t\t\t'interval' => DAY_IN_SECONDS,\n\t\t\t'display'  => __( 'Once Daily' ),\n\t\t),\n\t\t'weekly'     => array(\n\t\t\t'interval' => WEEK_IN_SECONDS,\n\t\t\t'display'  => __( 'Once Weekly' ),\n\t\t),\n\t);\n\n\t/**\n\t * Filters the non-default cron schedules.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param array $new_schedules An array of non-default cron schedules. Default empty.\n\t */\n\treturn array_merge( apply_filters( 'cron_schedules', array() ), $schedules );\n}\n\n/**\n * Retrieve the recurrence schedule for an event.\n *\n * @see wp_get_schedules() for available schedules.\n *\n * @since 2.1.0\n * @since 5.1.0 {@see 'get_schedule'} filter added.\n *\n * @param string $hook Action hook to identify the event.\n * @param array  $args Optional. Arguments passed to the event's callback function.\n * @return string|false False, if no schedule. Schedule name on success.\n */\nfunction wp_get_schedule( $hook, $args = array() ) {\n\t$schedule = false;\n\t$event    = wp_get_scheduled_event( $hook, $args );\n\n\tif ( $event ) {\n\t\t$schedule = $event->schedule;\n\t}\n\n\t/**\n\t * Filter the schedule for a hook.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param string|bool $schedule Schedule for the hook. False if not found.\n\t * @param string      $hook     Action hook to execute when cron is run.\n\t * @param array       $args     Optional. Arguments to pass to the hook's callback function.\n\t */\n\treturn apply_filters( 'get_schedule', $schedule, $hook, $args );\n}\n\n/**\n * Retrieve cron jobs ready to be run.\n *\n * Returns the results of _get_cron_array() limited to events ready to be run,\n * ie, with a timestamp in the past.\n *\n * @since 5.1.0\n *\n * @return array Cron jobs ready to be run.\n */\nfunction wp_get_ready_cron_jobs() {\n\t/**\n\t * Filter to preflight or hijack retrieving ready cron jobs.\n\t *\n\t * Returning an array will short-circuit the normal retrieval of ready\n\t * cron jobs, causing the function to return the filtered value instead.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param null|array $pre Array of ready cron tasks to return instead. Default null\n\t *                        to continue using results from _get_cron_array().\n\t */\n\t$pre = apply_filters( 'pre_get_ready_cron_jobs', null );\n\tif ( null !== $pre ) {\n\t\treturn $pre;\n\t}\n\n\t$crons = _get_cron_array();\n\n\tif ( false === $crons ) {\n\t\treturn array();\n\t}\n\n\t$gmt_time = microtime( true );\n\t$keys     = array_keys( $crons );\n\tif ( isset( $keys[0] ) && $keys[0] > $gmt_time ) {\n\t\treturn array();\n\t}\n\n\t$results = array();\n\tforeach ( $crons as $timestamp => $cronhooks ) {\n\t\tif ( $timestamp > $gmt_time ) {\n\t\t\tbreak;\n\t\t}\n\t\t$results[ $timestamp ] = $cronhooks;\n\t}\n\n\treturn $results;\n}\n\n//\n// Private functions.\n//\n\n/**\n * Retrieve cron info array option.\n *\n * @since 2.1.0\n * @access private\n *\n * @return array|false CRON info array.\n */\nfunction _get_cron_array() {\n\t$cron = get_option( 'cron' );\n\tif ( ! is_array( $cron ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! isset( $cron['version'] ) ) {\n\t\t$cron = _upgrade_cron_array( $cron );\n\t}\n\n\tunset( $cron['version'] );\n\n\treturn $cron;\n}\n\n/**\n * Updates the CRON option with the new CRON array.\n *\n * @since 2.1.0\n * @since 5.1.0 Return value modified to outcome of update_option().\n *\n * @access private\n *\n * @param array $cron Cron info array from _get_cron_array().\n * @return bool True if cron array updated, false on failure.\n */\nfunction _set_cron_array( $cron ) {\n\t$cron['version'] = 2;\n\treturn update_option( 'cron', $cron );\n}\n\n/**\n * Upgrade a Cron info array.\n *\n * This function upgrades the Cron info array to version 2.\n *\n * @since 2.1.0\n * @access private\n *\n * @param array $cron Cron info array from _get_cron_array().\n * @return array An upgraded Cron info array.\n */\nfunction _upgrade_cron_array( $cron ) {\n\tif ( isset( $cron['version'] ) && 2 == $cron['version'] ) {\n\t\treturn $cron;\n\t}\n\n\t$new_cron = array();\n\n\tforeach ( (array) $cron as $timestamp => $hooks ) {\n\t\tforeach ( (array) $hooks as $hook => $args ) {\n\t\t\t$key                                     = md5( serialize( $args['args'] ) );\n\t\t\t$new_cron[ $timestamp ][ $hook ][ $key ] = $args;\n\t\t}\n\t}\n\n\t$new_cron['version'] = 2;\n\tupdate_option( 'cron', $new_cron );\n\treturn $new_cron;\n}\n", "num_lines": 999}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Class for generating SQL clauses that filter a primary query according to date.\n *\n * This file is deprecated, use 'wp-includes/class-wp-date-query.php' instead.\n *\n * @deprecated 5.3.0\n * @package WordPress\n */\n\n_deprecated_file( basename( __FILE__ ), '5.3.0', 'wp-includes/class-wp-date-query.php' );\n\n/** WP_Date_Query class */\nrequire_once ABSPATH . 'wp-includes/class-wp-date-query.php';\n", "num_lines": 15}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Defines constants and global variables that can be overridden, generally in wp-config.php.\n *\n * @package WordPress\n */\n\n/**\n * Defines initial WordPress constants.\n *\n * @see wp_debug_mode()\n *\n * @since 3.0.0\n *\n * @global int    $blog_id    The current site ID.\n * @global string $wp_version The WordPress version string.\n */\nfunction wp_initial_constants() {\n\tglobal $blog_id;\n\n\t/**#@+\n\t * Constants for expressing human-readable data sizes in their respective number of bytes.\n\t *\n\t * @since 4.4.0\n\t */\n\tdefine( 'KB_IN_BYTES', 1024 );\n\tdefine( 'MB_IN_BYTES', 1024 * KB_IN_BYTES );\n\tdefine( 'GB_IN_BYTES', 1024 * MB_IN_BYTES );\n\tdefine( 'TB_IN_BYTES', 1024 * GB_IN_BYTES );\n\t/**#@-*/\n\n\t// Start of run timestamp.\n\tif ( ! defined( 'WP_START_TIMESTAMP' ) ) {\n\t\tdefine( 'WP_START_TIMESTAMP', microtime( true ) );\n\t}\n\n\t$current_limit     = ini_get( 'memory_limit' );\n\t$current_limit_int = wp_convert_hr_to_bytes( $current_limit );\n\n\t// Define memory limits.\n\tif ( ! defined( 'WP_MEMORY_LIMIT' ) ) {\n\t\tif ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) {\n\t\t\tdefine( 'WP_MEMORY_LIMIT', $current_limit );\n\t\t} elseif ( is_multisite() ) {\n\t\t\tdefine( 'WP_MEMORY_LIMIT', '64M' );\n\t\t} else {\n\t\t\tdefine( 'WP_MEMORY_LIMIT', '40M' );\n\t\t}\n\t}\n\n\tif ( ! defined( 'WP_MAX_MEMORY_LIMIT' ) ) {\n\t\tif ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) {\n\t\t\tdefine( 'WP_MAX_MEMORY_LIMIT', $current_limit );\n\t\t} elseif ( -1 === $current_limit_int || $current_limit_int > 268435456 /* = 256M */ ) {\n\t\t\tdefine( 'WP_MAX_MEMORY_LIMIT', $current_limit );\n\t\t} else {\n\t\t\tdefine( 'WP_MAX_MEMORY_LIMIT', '256M' );\n\t\t}\n\t}\n\n\t// Set memory limits.\n\t$wp_limit_int = wp_convert_hr_to_bytes( WP_MEMORY_LIMIT );\n\tif ( -1 !== $current_limit_int && ( -1 === $wp_limit_int || $wp_limit_int > $current_limit_int ) ) {\n\t\tini_set( 'memory_limit', WP_MEMORY_LIMIT );\n\t}\n\n\tif ( ! isset( $blog_id ) ) {\n\t\t$blog_id = 1;\n\t}\n\n\tif ( ! defined( 'WP_CONTENT_DIR' ) ) {\n\t\tdefine( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // No trailing slash, full paths only - WP_CONTENT_URL is defined further down.\n\t}\n\n\t// Add define( 'WP_DEBUG', true ); to wp-config.php to enable display of notices during development.\n\tif ( ! defined( 'WP_DEBUG' ) ) {\n\t\tif ( 'development' === wp_get_environment_type() ) {\n\t\t\tdefine( 'WP_DEBUG', true );\n\t\t} else {\n\t\t\tdefine( 'WP_DEBUG', false );\n\t\t}\n\t}\n\n\t// Add define( 'WP_DEBUG_DISPLAY', null ); to wp-config.php to use the globally configured setting\n\t// for 'display_errors' and not force errors to be displayed. Use false to force 'display_errors' off.\n\tif ( ! defined( 'WP_DEBUG_DISPLAY' ) ) {\n\t\tdefine( 'WP_DEBUG_DISPLAY', true );\n\t}\n\n\t// Add define( 'WP_DEBUG_LOG', true ); to enable error logging to wp-content/debug.log.\n\tif ( ! defined( 'WP_DEBUG_LOG' ) ) {\n\t\tdefine( 'WP_DEBUG_LOG', false );\n\t}\n\n\tif ( ! defined( 'WP_CACHE' ) ) {\n\t\tdefine( 'WP_CACHE', false );\n\t}\n\n\t// Add define( 'SCRIPT_DEBUG', true ); to wp-config.php to enable loading of non-minified,\n\t// non-concatenated scripts and stylesheets.\n\tif ( ! defined( 'SCRIPT_DEBUG' ) ) {\n\t\tif ( ! empty( $GLOBALS['wp_version'] ) ) {\n\t\t\t$develop_src = false !== strpos( $GLOBALS['wp_version'], '-src' );\n\t\t} else {\n\t\t\t$develop_src = false;\n\t\t}\n\n\t\tdefine( 'SCRIPT_DEBUG', $develop_src );\n\t}\n\n\t/**\n\t * Private\n\t */\n\tif ( ! defined( 'MEDIA_TRASH' ) ) {\n\t\tdefine( 'MEDIA_TRASH', false );\n\t}\n\n\tif ( ! defined( 'SHORTINIT' ) ) {\n\t\tdefine( 'SHORTINIT', false );\n\t}\n\n\t// Constants for features added to WP that should short-circuit their plugin implementations.\n\tdefine( 'WP_FEATURE_BETTER_PASSWORDS', true );\n\n\t/**#@+\n\t * Constants for expressing human-readable intervals\n\t * in their respective number of seconds.\n\t *\n\t * Please note that these values are approximate and are provided for convenience.\n\t * For example, MONTH_IN_SECONDS wrongly assumes every month has 30 days and\n\t * YEAR_IN_SECONDS does not take leap years into account.\n\t *\n\t * If you need more accuracy please consider using the DateTime class (https://www.php.net/manual/en/class.datetime.php).\n\t *\n\t * @since 3.5.0\n\t * @since 4.4.0 Introduced `MONTH_IN_SECONDS`.\n\t */\n\tdefine( 'MINUTE_IN_SECONDS', 60 );\n\tdefine( 'HOUR_IN_SECONDS', 60 * MINUTE_IN_SECONDS );\n\tdefine( 'DAY_IN_SECONDS', 24 * HOUR_IN_SECONDS );\n\tdefine( 'WEEK_IN_SECONDS', 7 * DAY_IN_SECONDS );\n\tdefine( 'MONTH_IN_SECONDS', 30 * DAY_IN_SECONDS );\n\tdefine( 'YEAR_IN_SECONDS', 365 * DAY_IN_SECONDS );\n\t/**#@-*/\n}\n\n/**\n * Defines plugin directory WordPress constants.\n *\n * Defines must-use plugin directory constants, which may be overridden in the sunrise.php drop-in.\n *\n * @since 3.0.0\n */\nfunction wp_plugin_directory_constants() {\n\tif ( ! defined( 'WP_CONTENT_URL' ) ) {\n\t\tdefine( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' ); // Full URL - WP_CONTENT_DIR is defined further up.\n\t}\n\n\t/**\n\t * Allows for the plugins directory to be moved from the default location.\n\t *\n\t * @since 2.6.0\n\t */\n\tif ( ! defined( 'WP_PLUGIN_DIR' ) ) {\n\t\tdefine( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // Full path, no trailing slash.\n\t}\n\n\t/**\n\t * Allows for the plugins directory to be moved from the default location.\n\t *\n\t * @since 2.6.0\n\t */\n\tif ( ! defined( 'WP_PLUGIN_URL' ) ) {\n\t\tdefine( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // Full URL, no trailing slash.\n\t}\n\n\t/**\n\t * Allows for the plugins directory to be moved from the default location.\n\t *\n\t * @since 2.1.0\n\t * @deprecated\n\t */\n\tif ( ! defined( 'PLUGINDIR' ) ) {\n\t\tdefine( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat.\n\t}\n\n\t/**\n\t * Allows for the mu-plugins directory to be moved from the default location.\n\t *\n\t * @since 2.8.0\n\t */\n\tif ( ! defined( 'WPMU_PLUGIN_DIR' ) ) {\n\t\tdefine( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // Full path, no trailing slash.\n\t}\n\n\t/**\n\t * Allows for the mu-plugins directory to be moved from the default location.\n\t *\n\t * @since 2.8.0\n\t */\n\tif ( ! defined( 'WPMU_PLUGIN_URL' ) ) {\n\t\tdefine( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // Full URL, no trailing slash.\n\t}\n\n\t/**\n\t * Allows for the mu-plugins directory to be moved from the default location.\n\t *\n\t * @since 2.8.0\n\t * @deprecated\n\t */\n\tif ( ! defined( 'MUPLUGINDIR' ) ) {\n\t\tdefine( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat.\n\t}\n}\n\n/**\n * Defines cookie-related WordPress constants.\n *\n * Defines constants after multisite is loaded.\n *\n * @since 3.0.0\n */\nfunction wp_cookie_constants() {\n\t/**\n\t * Used to guarantee unique hash cookies.\n\t *\n\t * @since 1.5.0\n\t */\n\tif ( ! defined( 'COOKIEHASH' ) ) {\n\t\t$siteurl = get_site_option( 'siteurl' );\n\t\tif ( $siteurl ) {\n\t\t\tdefine( 'COOKIEHASH', md5( $siteurl ) );\n\t\t} else {\n\t\t\tdefine( 'COOKIEHASH', '' );\n\t\t}\n\t}\n\n\t/**\n\t * @since 2.0.0\n\t */\n\tif ( ! defined( 'USER_COOKIE' ) ) {\n\t\tdefine( 'USER_COOKIE', 'wordpressuser_' . COOKIEHASH );\n\t}\n\n\t/**\n\t * @since 2.0.0\n\t */\n\tif ( ! defined( 'PASS_COOKIE' ) ) {\n\t\tdefine( 'PASS_COOKIE', 'wordpresspass_' . COOKIEHASH );\n\t}\n\n\t/**\n\t * @since 2.5.0\n\t */\n\tif ( ! defined( 'AUTH_COOKIE' ) ) {\n\t\tdefine( 'AUTH_COOKIE', 'wordpress_' . COOKIEHASH );\n\t}\n\n\t/**\n\t * @since 2.6.0\n\t */\n\tif ( ! defined( 'SECURE_AUTH_COOKIE' ) ) {\n\t\tdefine( 'SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH );\n\t}\n\n\t/**\n\t * @since 2.6.0\n\t */\n\tif ( ! defined( 'LOGGED_IN_COOKIE' ) ) {\n\t\tdefine( 'LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH );\n\t}\n\n\t/**\n\t * @since 2.3.0\n\t */\n\tif ( ! defined( 'TEST_COOKIE' ) ) {\n\t\tdefine( 'TEST_COOKIE', 'wordpress_test_cookie' );\n\t}\n\n\t/**\n\t * @since 1.2.0\n\t */\n\tif ( ! defined( 'COOKIEPATH' ) ) {\n\t\tdefine( 'COOKIEPATH', preg_replace( '|https?://[^/]+|i', '', get_option( 'home' ) . '/' ) );\n\t}\n\n\t/**\n\t * @since 1.5.0\n\t */\n\tif ( ! defined( 'SITECOOKIEPATH' ) ) {\n\t\tdefine( 'SITECOOKIEPATH', preg_replace( '|https?://[^/]+|i', '', get_option( 'siteurl' ) . '/' ) );\n\t}\n\n\t/**\n\t * @since 2.6.0\n\t */\n\tif ( ! defined( 'ADMIN_COOKIE_PATH' ) ) {\n\t\tdefine( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );\n\t}\n\n\t/**\n\t * @since 2.6.0\n\t */\n\tif ( ! defined( 'PLUGINS_COOKIE_PATH' ) ) {\n\t\tdefine( 'PLUGINS_COOKIE_PATH', preg_replace( '|https?://[^/]+|i', '', WP_PLUGIN_URL ) );\n\t}\n\n\t/**\n\t * @since 2.0.0\n\t */\n\tif ( ! defined( 'COOKIE_DOMAIN' ) ) {\n\t\tdefine( 'COOKIE_DOMAIN', false );\n\t}\n\n\tif ( ! defined( 'RECOVERY_MODE_COOKIE' ) ) {\n\t\t/**\n\t\t * @since 5.2.0\n\t\t */\n\t\tdefine( 'RECOVERY_MODE_COOKIE', 'wordpress_rec_' . COOKIEHASH );\n\t}\n}\n\n/**\n * Defines SSL-related WordPress constants.\n *\n * @since 3.0.0\n */\nfunction wp_ssl_constants() {\n\t/**\n\t * @since 2.6.0\n\t */\n\tif ( ! defined( 'FORCE_SSL_ADMIN' ) ) {\n\t\tif ( 'https' === parse_url( get_option( 'siteurl' ), PHP_URL_SCHEME ) ) {\n\t\t\tdefine( 'FORCE_SSL_ADMIN', true );\n\t\t} else {\n\t\t\tdefine( 'FORCE_SSL_ADMIN', false );\n\t\t}\n\t}\n\tforce_ssl_admin( FORCE_SSL_ADMIN );\n\n\t/**\n\t * @since 2.6.0\n\t * @deprecated 4.0.0\n\t */\n\tif ( defined( 'FORCE_SSL_LOGIN' ) && FORCE_SSL_LOGIN ) {\n\t\tforce_ssl_admin( true );\n\t}\n}\n\n/**\n * Defines functionality-related WordPress constants.\n *\n * @since 3.0.0\n */\nfunction wp_functionality_constants() {\n\t/**\n\t * @since 2.5.0\n\t */\n\tif ( ! defined( 'AUTOSAVE_INTERVAL' ) ) {\n\t\tdefine( 'AUTOSAVE_INTERVAL', MINUTE_IN_SECONDS );\n\t}\n\n\t/**\n\t * @since 2.9.0\n\t */\n\tif ( ! defined( 'EMPTY_TRASH_DAYS' ) ) {\n\t\tdefine( 'EMPTY_TRASH_DAYS', 30 );\n\t}\n\n\tif ( ! defined( 'WP_POST_REVISIONS' ) ) {\n\t\tdefine( 'WP_POST_REVISIONS', true );\n\t}\n\n\t/**\n\t * @since 3.3.0\n\t */\n\tif ( ! defined( 'WP_CRON_LOCK_TIMEOUT' ) ) {\n\t\tdefine( 'WP_CRON_LOCK_TIMEOUT', MINUTE_IN_SECONDS );\n\t}\n}\n\n/**\n * Defines templating-related WordPress constants.\n *\n * @since 3.0.0\n */\nfunction wp_templating_constants() {\n\t/**\n\t * Filesystem path to the current active template directory.\n\t *\n\t * @since 1.5.0\n\t */\n\tdefine( 'TEMPLATEPATH', get_template_directory() );\n\n\t/**\n\t * Filesystem path to the current active template stylesheet directory.\n\t *\n\t * @since 2.1.0\n\t */\n\tdefine( 'STYLESHEETPATH', get_stylesheet_directory() );\n\n\t/**\n\t * Slug of the default theme for this installation.\n\t * Used as the default theme when installing new sites.\n\t * It will be used as the fallback if the current theme doesn't exist.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @see WP_Theme::get_core_default_theme()\n\t */\n\tif ( ! defined( 'WP_DEFAULT_THEME' ) ) {\n\t\tdefine( 'WP_DEFAULT_THEME', 'twentytwenty' );\n\t}\n\n}\n", "num_lines": 416}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Sets up the default filters and actions for most\n * of the WordPress hooks.\n *\n * If you need to remove a default hook, this file will\n * give you the priority for which to use to remove the\n * hook.\n *\n * Not all of the default hooks are found in default-filters.php\n *\n * @package WordPress\n */\n\n// Strip, trim, kses, special chars for string saves.\nforeach ( array( 'pre_term_name', 'pre_comment_author_name', 'pre_link_name', 'pre_link_target', 'pre_link_rel', 'pre_user_display_name', 'pre_user_first_name', 'pre_user_last_name', 'pre_user_nickname' ) as $filter ) {\n\tadd_filter( $filter, 'sanitize_text_field' );\n\tadd_filter( $filter, 'wp_filter_kses' );\n\tadd_filter( $filter, '_wp_specialchars', 30 );\n}\n\n// Strip, kses, special chars for string display.\nforeach ( array( 'term_name', 'comment_author_name', 'link_name', 'link_target', 'link_rel', 'user_display_name', 'user_first_name', 'user_last_name', 'user_nickname' ) as $filter ) {\n\tif ( is_admin() ) {\n\t\t// These are expensive. Run only on admin pages for defense in depth.\n\t\tadd_filter( $filter, 'sanitize_text_field' );\n\t\tadd_filter( $filter, 'wp_kses_data' );\n\t}\n\tadd_filter( $filter, '_wp_specialchars', 30 );\n}\n\n// Kses only for textarea saves.\nforeach ( array( 'pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description' ) as $filter ) {\n\tadd_filter( $filter, 'wp_filter_kses' );\n}\n\n// Kses only for textarea admin displays.\nif ( is_admin() ) {\n\tforeach ( array( 'term_description', 'link_description', 'link_notes', 'user_description' ) as $filter ) {\n\t\tadd_filter( $filter, 'wp_kses_data' );\n\t}\n\tadd_filter( 'comment_text', 'wp_kses_post' );\n}\n\n// Email saves.\nforeach ( array( 'pre_comment_author_email', 'pre_user_email' ) as $filter ) {\n\tadd_filter( $filter, 'trim' );\n\tadd_filter( $filter, 'sanitize_email' );\n\tadd_filter( $filter, 'wp_filter_kses' );\n}\n\n// Email admin display.\nforeach ( array( 'comment_author_email', 'user_email' ) as $filter ) {\n\tadd_filter( $filter, 'sanitize_email' );\n\tif ( is_admin() ) {\n\t\tadd_filter( $filter, 'wp_kses_data' );\n\t}\n}\n\n// Save URL.\nforeach ( array(\n\t'pre_comment_author_url',\n\t'pre_user_url',\n\t'pre_link_url',\n\t'pre_link_image',\n\t'pre_link_rss',\n\t'pre_post_guid',\n) as $filter ) {\n\tadd_filter( $filter, 'wp_strip_all_tags' );\n\tadd_filter( $filter, 'esc_url_raw' );\n\tadd_filter( $filter, 'wp_filter_kses' );\n}\n\n// Display URL.\nforeach ( array( 'user_url', 'link_url', 'link_image', 'link_rss', 'comment_url', 'post_guid' ) as $filter ) {\n\tif ( is_admin() ) {\n\t\tadd_filter( $filter, 'wp_strip_all_tags' );\n\t}\n\tadd_filter( $filter, 'esc_url' );\n\tif ( is_admin() ) {\n\t\tadd_filter( $filter, 'wp_kses_data' );\n\t}\n}\n\n// Slugs.\nadd_filter( 'pre_term_slug', 'sanitize_title' );\nadd_filter( 'wp_insert_post_data', '_wp_customize_changeset_filter_insert_post_data', 10, 2 );\n\n// Keys.\nforeach ( array( 'pre_post_type', 'pre_post_status', 'pre_post_comment_status', 'pre_post_ping_status' ) as $filter ) {\n\tadd_filter( $filter, 'sanitize_key' );\n}\n\n// Mime types.\nadd_filter( 'pre_post_mime_type', 'sanitize_mime_type' );\nadd_filter( 'post_mime_type', 'sanitize_mime_type' );\n\n// Meta.\nadd_filter( 'register_meta_args', '_wp_register_meta_args_allowed_list', 10, 2 );\n\n// Post meta.\nadd_action( 'added_post_meta', 'wp_cache_set_posts_last_changed' );\nadd_action( 'updated_post_meta', 'wp_cache_set_posts_last_changed' );\nadd_action( 'deleted_post_meta', 'wp_cache_set_posts_last_changed' );\n\n// Term meta.\nadd_action( 'added_term_meta', 'wp_cache_set_terms_last_changed' );\nadd_action( 'updated_term_meta', 'wp_cache_set_terms_last_changed' );\nadd_action( 'deleted_term_meta', 'wp_cache_set_terms_last_changed' );\nadd_filter( 'get_term_metadata', 'wp_check_term_meta_support_prefilter' );\nadd_filter( 'add_term_metadata', 'wp_check_term_meta_support_prefilter' );\nadd_filter( 'update_term_metadata', 'wp_check_term_meta_support_prefilter' );\nadd_filter( 'delete_term_metadata', 'wp_check_term_meta_support_prefilter' );\nadd_filter( 'get_term_metadata_by_mid', 'wp_check_term_meta_support_prefilter' );\nadd_filter( 'update_term_metadata_by_mid', 'wp_check_term_meta_support_prefilter' );\nadd_filter( 'delete_term_metadata_by_mid', 'wp_check_term_meta_support_prefilter' );\nadd_filter( 'update_term_metadata_cache', 'wp_check_term_meta_support_prefilter' );\n\n// Comment meta.\nadd_action( 'added_comment_meta', 'wp_cache_set_comments_last_changed' );\nadd_action( 'updated_comment_meta', 'wp_cache_set_comments_last_changed' );\nadd_action( 'deleted_comment_meta', 'wp_cache_set_comments_last_changed' );\n\n// Places to balance tags on input.\nforeach ( array( 'content_save_pre', 'excerpt_save_pre', 'comment_save_pre', 'pre_comment_content' ) as $filter ) {\n\tadd_filter( $filter, 'convert_invalid_entities' );\n\tadd_filter( $filter, 'balanceTags', 50 );\n}\n\n// Add proper rel values for links with target.\nadd_action( 'init', 'wp_init_targeted_link_rel_filters' );\n\n// Format strings for display.\nforeach ( array( 'comment_author', 'term_name', 'link_name', 'link_description', 'link_notes', 'bloginfo', 'wp_title', 'widget_title' ) as $filter ) {\n\tadd_filter( $filter, 'wptexturize' );\n\tadd_filter( $filter, 'convert_chars' );\n\tadd_filter( $filter, 'esc_html' );\n}\n\n// Format WordPress.\nforeach ( array( 'the_content', 'the_title', 'wp_title' ) as $filter ) {\n\tadd_filter( $filter, 'capital_P_dangit', 11 );\n}\nadd_filter( 'comment_text', 'capital_P_dangit', 31 );\n\n// Format titles.\nforeach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title', 'nav_menu_attr_title', 'nav_menu_description' ) as $filter ) {\n\tadd_filter( $filter, 'wptexturize' );\n\tadd_filter( $filter, 'strip_tags' );\n}\n\n// Format text area for display.\nforeach ( array( 'term_description', 'get_the_post_type_description' ) as $filter ) {\n\tadd_filter( $filter, 'wptexturize' );\n\tadd_filter( $filter, 'convert_chars' );\n\tadd_filter( $filter, 'wpautop' );\n\tadd_filter( $filter, 'shortcode_unautop' );\n}\n\n// Format for RSS.\nadd_filter( 'term_name_rss', 'convert_chars' );\n\n// Pre save hierarchy.\nadd_filter( 'wp_insert_post_parent', 'wp_check_post_hierarchy_for_loops', 10, 2 );\nadd_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3 );\n\n// Display filters.\nadd_filter( 'the_title', 'wptexturize' );\nadd_filter( 'the_title', 'convert_chars' );\nadd_filter( 'the_title', 'trim' );\n\nadd_filter( 'the_content', 'do_blocks', 9 );\nadd_filter( 'the_content', 'wptexturize' );\nadd_filter( 'the_content', 'convert_smilies', 20 );\nadd_filter( 'the_content', 'wpautop' );\nadd_filter( 'the_content', 'shortcode_unautop' );\nadd_filter( 'the_content', 'prepend_attachment' );\nadd_filter( 'the_content', 'wp_filter_content_tags' );\n\nadd_filter( 'the_excerpt', 'wptexturize' );\nadd_filter( 'the_excerpt', 'convert_smilies' );\nadd_filter( 'the_excerpt', 'convert_chars' );\nadd_filter( 'the_excerpt', 'wpautop' );\nadd_filter( 'the_excerpt', 'shortcode_unautop' );\nadd_filter( 'the_excerpt', 'wp_filter_content_tags' );\nadd_filter( 'get_the_excerpt', 'wp_trim_excerpt', 10, 2 );\n\nadd_filter( 'the_post_thumbnail_caption', 'wptexturize' );\nadd_filter( 'the_post_thumbnail_caption', 'convert_smilies' );\nadd_filter( 'the_post_thumbnail_caption', 'convert_chars' );\n\nadd_filter( 'comment_text', 'wptexturize' );\nadd_filter( 'comment_text', 'convert_chars' );\nadd_filter( 'comment_text', 'make_clickable', 9 );\nadd_filter( 'comment_text', 'force_balance_tags', 25 );\nadd_filter( 'comment_text', 'convert_smilies', 20 );\nadd_filter( 'comment_text', 'wpautop', 30 );\n\nadd_filter( 'comment_excerpt', 'convert_chars' );\n\nadd_filter( 'list_cats', 'wptexturize' );\n\nadd_filter( 'wp_sprintf', 'wp_sprintf_l', 10, 2 );\n\nadd_filter( 'widget_text', 'balanceTags' );\nadd_filter( 'widget_text_content', 'capital_P_dangit', 11 );\nadd_filter( 'widget_text_content', 'wptexturize' );\nadd_filter( 'widget_text_content', 'convert_smilies', 20 );\nadd_filter( 'widget_text_content', 'wpautop' );\nadd_filter( 'widget_text_content', 'shortcode_unautop' );\nadd_filter( 'widget_text_content', 'wp_filter_content_tags' );\nadd_filter( 'widget_text_content', 'do_shortcode', 11 ); // Runs after wpautop(); note that $post global will be null when shortcodes run.\n\n// RSS filters.\nadd_filter( 'the_title_rss', 'strip_tags' );\nadd_filter( 'the_title_rss', 'ent2ncr', 8 );\nadd_filter( 'the_title_rss', 'esc_html' );\nadd_filter( 'the_content_rss', 'ent2ncr', 8 );\nadd_filter( 'the_content_feed', 'wp_staticize_emoji' );\nadd_filter( 'the_content_feed', '_oembed_filter_feed_content' );\nadd_filter( 'the_excerpt_rss', 'convert_chars' );\nadd_filter( 'the_excerpt_rss', 'ent2ncr', 8 );\nadd_filter( 'comment_author_rss', 'ent2ncr', 8 );\nadd_filter( 'comment_text_rss', 'ent2ncr', 8 );\nadd_filter( 'comment_text_rss', 'esc_html' );\nadd_filter( 'comment_text_rss', 'wp_staticize_emoji' );\nadd_filter( 'bloginfo_rss', 'ent2ncr', 8 );\nadd_filter( 'the_author', 'ent2ncr', 8 );\nadd_filter( 'the_guid', 'esc_url' );\n\n// Email filters.\nadd_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );\n\n// Mark site as no longer fresh.\nforeach ( array( 'publish_post', 'publish_page', 'wp_ajax_save-widget', 'wp_ajax_widgets-order', 'customize_save_after' ) as $action ) {\n\tadd_action( $action, '_delete_option_fresh_site', 0 );\n}\n\n// Misc filters.\nadd_filter( 'option_ping_sites', 'privacy_ping_filter' );\nadd_filter( 'option_blog_charset', '_wp_specialchars' ); // IMPORTANT: This must not be wp_specialchars() or esc_html() or it'll cause an infinite loop.\nadd_filter( 'option_blog_charset', '_canonical_charset' );\nadd_filter( 'option_home', '_config_wp_home' );\nadd_filter( 'option_siteurl', '_config_wp_siteurl' );\nadd_filter( 'tiny_mce_before_init', '_mce_set_direction' );\nadd_filter( 'teeny_mce_before_init', '_mce_set_direction' );\nadd_filter( 'pre_kses', 'wp_pre_kses_less_than' );\nadd_filter( 'pre_kses', 'wp_pre_kses_block_attributes', 10, 3 );\nadd_filter( 'sanitize_title', 'sanitize_title_with_dashes', 10, 3 );\nadd_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 );\nadd_filter( 'comment_flood_filter', 'wp_throttle_comment_flood', 10, 3 );\nadd_filter( 'pre_comment_content', 'wp_rel_ugc', 15 );\nadd_filter( 'comment_email', 'antispambot' );\nadd_filter( 'option_tag_base', '_wp_filter_taxonomy_base' );\nadd_filter( 'option_category_base', '_wp_filter_taxonomy_base' );\nadd_filter( 'the_posts', '_close_comments_for_old_posts', 10, 2 );\nadd_filter( 'comments_open', '_close_comments_for_old_post', 10, 2 );\nadd_filter( 'pings_open', '_close_comments_for_old_post', 10, 2 );\nadd_filter( 'editable_slug', 'urldecode' );\nadd_filter( 'editable_slug', 'esc_textarea' );\nadd_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object' );\nadd_filter( 'pingback_ping_source_uri', 'pingback_ping_source_uri' );\nadd_filter( 'xmlrpc_pingback_error', 'xmlrpc_pingback_error' );\nadd_filter( 'title_save_pre', 'trim' );\n\nadd_action( 'transition_comment_status', '_clear_modified_cache_on_transition_comment_status', 10, 2 );\n\nadd_filter( 'http_request_host_is_external', 'allowed_http_request_hosts', 10, 2 );\n\n// REST API filters.\nadd_action( 'xmlrpc_rsd_apis', 'rest_output_rsd' );\nadd_action( 'wp_head', 'rest_output_link_wp_head', 10, 0 );\nadd_action( 'template_redirect', 'rest_output_link_header', 11, 0 );\nadd_action( 'auth_cookie_malformed', 'rest_cookie_collect_status' );\nadd_action( 'auth_cookie_expired', 'rest_cookie_collect_status' );\nadd_action( 'auth_cookie_bad_username', 'rest_cookie_collect_status' );\nadd_action( 'auth_cookie_bad_hash', 'rest_cookie_collect_status' );\nadd_action( 'auth_cookie_valid', 'rest_cookie_collect_status' );\nadd_filter( 'rest_authentication_errors', 'rest_cookie_check_errors', 100 );\n\n// Actions.\nadd_action( 'wp_head', '_wp_render_title_tag', 1 );\nadd_action( 'wp_head', 'wp_enqueue_scripts', 1 );\nadd_action( 'wp_head', 'wp_resource_hints', 2 );\nadd_action( 'wp_head', 'feed_links', 2 );\nadd_action( 'wp_head', 'feed_links_extra', 3 );\nadd_action( 'wp_head', 'rsd_link' );\nadd_action( 'wp_head', 'wlwmanifest_link' );\nadd_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\nadd_action( 'wp_head', 'locale_stylesheet' );\nadd_action( 'publish_future_post', 'check_and_publish_future_post', 10, 1 );\nadd_action( 'wp_head', 'noindex', 1 );\nadd_action( 'wp_head', 'print_emoji_detection_script', 7 );\nadd_action( 'wp_head', 'wp_print_styles', 8 );\nadd_action( 'wp_head', 'wp_print_head_scripts', 9 );\nadd_action( 'wp_head', 'wp_generator' );\nadd_action( 'wp_head', 'rel_canonical' );\nadd_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );\nadd_action( 'wp_head', 'wp_custom_css_cb', 101 );\nadd_action( 'wp_head', 'wp_site_icon', 99 );\nadd_action( 'wp_footer', 'wp_print_footer_scripts', 20 );\nadd_action( 'template_redirect', 'wp_shortlink_header', 11, 0 );\nadd_action( 'wp_print_footer_scripts', '_wp_footer_scripts' );\nadd_action( 'init', '_register_core_block_patterns_and_categories' );\nadd_action( 'init', 'check_theme_switched', 99 );\nadd_action( 'after_switch_theme', '_wp_menus_changed' );\nadd_action( 'after_switch_theme', '_wp_sidebars_changed' );\nadd_action( 'wp_print_styles', 'print_emoji_styles' );\n\nif ( isset( $_GET['replytocom'] ) ) {\n\tadd_action( 'wp_head', 'wp_no_robots' );\n}\n\n// Login actions.\nadd_filter( 'login_head', 'wp_resource_hints', 8 );\nadd_action( 'login_head', 'wp_print_head_scripts', 9 );\nadd_action( 'login_head', 'print_admin_styles', 9 );\nadd_action( 'login_head', 'wp_site_icon', 99 );\nadd_action( 'login_footer', 'wp_print_footer_scripts', 20 );\nadd_action( 'login_init', 'send_frame_options_header', 10, 0 );\n\n// Feed generator tags.\nforeach ( array( 'rss2_head', 'commentsrss2_head', 'rss_head', 'rdf_header', 'atom_head', 'comments_atom_head', 'opml_head', 'app_head' ) as $action ) {\n\tadd_action( $action, 'the_generator' );\n}\n\n// Feed Site Icon.\nadd_action( 'atom_head', 'atom_site_icon' );\nadd_action( 'rss2_head', 'rss2_site_icon' );\n\n\n// WP Cron.\nif ( ! defined( 'DOING_CRON' ) ) {\n\tadd_action( 'init', 'wp_cron' );\n}\n\n// 2 Actions 2 Furious.\nadd_action( 'do_feed_rdf', 'do_feed_rdf', 10, 0 );\nadd_action( 'do_feed_rss', 'do_feed_rss', 10, 0 );\nadd_action( 'do_feed_rss2', 'do_feed_rss2', 10, 1 );\nadd_action( 'do_feed_atom', 'do_feed_atom', 10, 1 );\nadd_action( 'do_pings', 'do_all_pings', 10, 0 );\nadd_action( 'do_robots', 'do_robots' );\nadd_action( 'do_favicon', 'do_favicon' );\nadd_action( 'set_comment_cookies', 'wp_set_comment_cookies', 10, 3 );\nadd_action( 'sanitize_comment_cookies', 'sanitize_comment_cookies' );\nadd_action( 'admin_print_scripts', 'print_emoji_detection_script' );\nadd_action( 'admin_print_scripts', 'print_head_scripts', 20 );\nadd_action( 'admin_print_footer_scripts', '_wp_footer_scripts' );\nadd_action( 'admin_print_styles', 'print_emoji_styles' );\nadd_action( 'admin_print_styles', 'print_admin_styles', 20 );\nadd_action( 'init', 'smilies_init', 5 );\nadd_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 );\nadd_action( 'plugins_loaded', 'wp_maybe_load_embeds', 0 );\nadd_action( 'shutdown', 'wp_ob_end_flush_all', 1 );\n// Create a revision whenever a post is updated.\nadd_action( 'post_updated', 'wp_save_post_revision', 10, 1 );\nadd_action( 'publish_post', '_publish_post_hook', 5, 1 );\nadd_action( 'transition_post_status', '_transition_post_status', 5, 3 );\nadd_action( 'transition_post_status', '_update_term_count_on_transition_post_status', 10, 3 );\nadd_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' );\nadd_action( 'admin_init', 'send_frame_options_header', 10, 0 );\nadd_action( 'welcome_panel', 'wp_welcome_panel' );\n\n// Privacy.\nadd_action( 'user_request_action_confirmed', '_wp_privacy_account_request_confirmed' );\nadd_action( 'user_request_action_confirmed', '_wp_privacy_send_request_confirmation_notification', 12 ); // After request marked as completed.\nadd_filter( 'wp_privacy_personal_data_exporters', 'wp_register_comment_personal_data_exporter' );\nadd_filter( 'wp_privacy_personal_data_exporters', 'wp_register_media_personal_data_exporter' );\nadd_filter( 'wp_privacy_personal_data_exporters', 'wp_register_user_personal_data_exporter', 1 );\nadd_filter( 'wp_privacy_personal_data_erasers', 'wp_register_comment_personal_data_eraser' );\nadd_action( 'init', 'wp_schedule_delete_old_privacy_export_files' );\nadd_action( 'wp_privacy_delete_old_export_files', 'wp_privacy_delete_old_export_files' );\n\n// Cron tasks.\nadd_action( 'wp_scheduled_delete', 'wp_scheduled_delete' );\nadd_action( 'wp_scheduled_auto_draft_delete', 'wp_delete_auto_drafts' );\nadd_action( 'importer_scheduled_cleanup', 'wp_delete_attachment' );\nadd_action( 'upgrader_scheduled_cleanup', 'wp_delete_attachment' );\nadd_action( 'delete_expired_transients', 'delete_expired_transients' );\n\n// Navigation menu actions.\nadd_action( 'delete_post', '_wp_delete_post_menu_item' );\nadd_action( 'delete_term', '_wp_delete_tax_menu_item', 10, 3 );\nadd_action( 'transition_post_status', '_wp_auto_add_pages_to_menu', 10, 3 );\nadd_action( 'delete_post', '_wp_delete_customize_changeset_dependent_auto_drafts' );\n\n// Post Thumbnail CSS class filtering.\nadd_action( 'begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_add' );\nadd_action( 'end_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_remove' );\n\n// Redirect old slugs.\nadd_action( 'template_redirect', 'wp_old_slug_redirect' );\nadd_action( 'post_updated', 'wp_check_for_changed_slugs', 12, 3 );\nadd_action( 'attachment_updated', 'wp_check_for_changed_slugs', 12, 3 );\n\n// Redirect old dates.\nadd_action( 'post_updated', 'wp_check_for_changed_dates', 12, 3 );\nadd_action( 'attachment_updated', 'wp_check_for_changed_dates', 12, 3 );\n\n// Nonce check for post previews.\nadd_action( 'init', '_show_post_preview' );\n\n// Output JS to reset window.name for previews.\nadd_action( 'wp_head', 'wp_post_preview_js', 1 );\n\n// Timezone.\nadd_filter( 'pre_option_gmt_offset', 'wp_timezone_override_offset' );\n\n// Admin color schemes.\nadd_action( 'admin_init', 'register_admin_color_schemes', 1 );\nadd_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );\n\n// If the upgrade hasn't run yet, assume link manager is used.\nadd_filter( 'default_option_link_manager_enabled', '__return_true' );\n\n// This option no longer exists; tell plugins we always support auto-embedding.\nadd_filter( 'pre_option_embed_autourls', '__return_true' );\n\n// Default settings for heartbeat.\nadd_filter( 'heartbeat_settings', 'wp_heartbeat_settings' );\n\n// Check if the user is logged out.\nadd_action( 'admin_enqueue_scripts', 'wp_auth_check_load' );\nadd_filter( 'heartbeat_send', 'wp_auth_check' );\nadd_filter( 'heartbeat_nopriv_send', 'wp_auth_check' );\n\n// Default authentication filters.\nadd_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 );\nadd_filter( 'authenticate', 'wp_authenticate_email_password', 20, 3 );\nadd_filter( 'authenticate', 'wp_authenticate_spam_check', 99 );\nadd_filter( 'determine_current_user', 'wp_validate_auth_cookie' );\nadd_filter( 'determine_current_user', 'wp_validate_logged_in_cookie', 20 );\n\n// Split term updates.\nadd_action( 'admin_init', '_wp_check_for_scheduled_split_terms' );\nadd_action( 'split_shared_term', '_wp_check_split_default_terms', 10, 4 );\nadd_action( 'split_shared_term', '_wp_check_split_terms_in_menus', 10, 4 );\nadd_action( 'split_shared_term', '_wp_check_split_nav_menu_terms', 10, 4 );\nadd_action( 'wp_split_shared_term_batch', '_wp_batch_split_terms' );\n\n// Comment type updates.\nadd_action( 'admin_init', '_wp_check_for_scheduled_update_comment_type' );\nadd_action( 'wp_update_comment_type_batch', '_wp_batch_update_comment_type' );\n\n// Email notifications.\nadd_action( 'comment_post', 'wp_new_comment_notify_moderator' );\nadd_action( 'comment_post', 'wp_new_comment_notify_postauthor' );\nadd_action( 'after_password_reset', 'wp_password_change_notification' );\nadd_action( 'register_new_user', 'wp_send_new_user_notifications' );\nadd_action( 'edit_user_created_user', 'wp_send_new_user_notifications', 10, 2 );\n\n// REST API actions.\nadd_action( 'init', 'rest_api_init' );\nadd_action( 'rest_api_init', 'rest_api_default_filters', 10, 1 );\nadd_action( 'rest_api_init', 'register_initial_settings', 10 );\nadd_action( 'rest_api_init', 'create_initial_rest_routes', 99 );\nadd_action( 'parse_request', 'rest_api_loaded' );\n\n// Sitemaps actions.\nadd_action( 'init', 'wp_sitemaps_get_server' );\n\n/**\n * Filters formerly mixed into wp-includes.\n */\n// Theme.\nadd_action( 'setup_theme', 'create_initial_theme_features', 0 );\nadd_action( 'wp_loaded', '_custom_header_background_just_in_time' );\nadd_action( 'wp_head', '_custom_logo_header_styles' );\nadd_action( 'plugins_loaded', '_wp_customize_include' );\nadd_action( 'transition_post_status', '_wp_customize_publish_changeset', 10, 3 );\nadd_action( 'admin_enqueue_scripts', '_wp_customize_loader_settings' );\nadd_action( 'delete_attachment', '_delete_attachment_theme_mod' );\nadd_action( 'transition_post_status', '_wp_keep_alive_customize_changeset_dependent_auto_drafts', 20, 3 );\n\n// Calendar widget cache.\nadd_action( 'save_post', 'delete_get_calendar_cache' );\nadd_action( 'delete_post', 'delete_get_calendar_cache' );\nadd_action( 'update_option_start_of_week', 'delete_get_calendar_cache' );\nadd_action( 'update_option_gmt_offset', 'delete_get_calendar_cache' );\n\n// Author.\nadd_action( 'transition_post_status', '__clear_multi_author_cache' );\n\n// Post.\nadd_action( 'init', 'create_initial_post_types', 0 ); // Highest priority.\nadd_action( 'admin_menu', '_add_post_type_submenus' );\nadd_action( 'before_delete_post', '_reset_front_page_settings_for_post' );\nadd_action( 'wp_trash_post', '_reset_front_page_settings_for_post' );\nadd_action( 'change_locale', 'create_initial_post_types' );\n\n// Post Formats.\nadd_filter( 'request', '_post_format_request' );\nadd_filter( 'term_link', '_post_format_link', 10, 3 );\nadd_filter( 'get_post_format', '_post_format_get_term' );\nadd_filter( 'get_terms', '_post_format_get_terms', 10, 3 );\nadd_filter( 'wp_get_object_terms', '_post_format_wp_get_object_terms' );\n\n// KSES.\nadd_action( 'init', 'kses_init' );\nadd_action( 'set_current_user', 'kses_init' );\n\n// Script Loader.\nadd_action( 'wp_default_scripts', 'wp_default_scripts' );\nadd_action( 'wp_default_scripts', 'wp_default_packages' );\n\nadd_action( 'wp_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 );\nadd_action( 'admin_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 );\nadd_action( 'wp_enqueue_scripts', 'wp_common_block_scripts_and_styles' );\nadd_action( 'admin_enqueue_scripts', 'wp_common_block_scripts_and_styles' );\nadd_action( 'enqueue_block_assets', 'wp_enqueue_registered_block_scripts_and_styles' );\nadd_action( 'enqueue_block_editor_assets', 'wp_enqueue_registered_block_scripts_and_styles' );\nadd_action( 'admin_print_scripts-index.php', 'wp_localize_community_events' );\nadd_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' );\nadd_filter( 'print_scripts_array', 'wp_prototype_before_jquery' );\nadd_filter( 'customize_controls_print_styles', 'wp_resource_hints', 1 );\nadd_action( 'enqueue_block_assets', 'enqueue_block_styles_assets', 30 );\nadd_action( 'enqueue_block_editor_assets', 'enqueue_editor_block_styles_assets' );\nadd_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' );\n\nadd_action( 'wp_default_styles', 'wp_default_styles' );\nadd_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 );\n\n// Taxonomy.\nadd_action( 'init', 'create_initial_taxonomies', 0 ); // Highest priority.\nadd_action( 'change_locale', 'create_initial_taxonomies' );\n\n// Canonical.\nadd_action( 'template_redirect', 'redirect_canonical' );\nadd_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );\n\n// Shortcodes.\nadd_filter( 'the_content', 'do_shortcode', 11 ); // AFTER wpautop().\n\n// Media.\nadd_action( 'wp_playlist_scripts', 'wp_playlist_scripts' );\nadd_action( 'customize_controls_enqueue_scripts', 'wp_plupload_default_settings' );\nadd_action( 'plugins_loaded', '_wp_add_additional_image_sizes', 0 );\nadd_filter( 'plupload_default_settings', 'wp_show_heic_upload_error' );\n\n// Nav menu.\nadd_filter( 'nav_menu_item_id', '_nav_menu_item_id_use_once', 10, 2 );\n\n// Widgets.\nadd_action( 'init', 'wp_widgets_init', 1 );\n\n// Admin Bar.\n// Don't remove. Wrong way to disable.\nadd_action( 'template_redirect', '_wp_admin_bar_init', 0 );\nadd_action( 'admin_init', '_wp_admin_bar_init' );\nadd_action( 'before_signup_header', '_wp_admin_bar_init' );\nadd_action( 'activate_header', '_wp_admin_bar_init' );\nadd_action( 'wp_body_open', 'wp_admin_bar_render', 0 );\nadd_action( 'wp_footer', 'wp_admin_bar_render', 1000 ); // Back-compat for themes not using `wp_body_open`.\nadd_action( 'in_admin_header', 'wp_admin_bar_render', 0 );\n\n// Former admin filters that can also be hooked on the front end.\nadd_action( 'media_buttons', 'media_buttons' );\nadd_filter( 'image_send_to_editor', 'image_add_caption', 20, 8 );\nadd_filter( 'media_send_to_editor', 'image_media_send_to_editor', 10, 3 );\n\n// Embeds.\nadd_action( 'rest_api_init', 'wp_oembed_register_route' );\nadd_filter( 'rest_pre_serve_request', '_oembed_rest_pre_serve_request', 10, 4 );\n\nadd_action( 'wp_head', 'wp_oembed_add_discovery_links' );\nadd_action( 'wp_head', 'wp_oembed_add_host_js' );\n\nadd_action( 'embed_head', 'enqueue_embed_scripts', 1 );\nadd_action( 'embed_head', 'print_emoji_detection_script' );\nadd_action( 'embed_head', 'print_embed_styles' );\nadd_action( 'embed_head', 'wp_print_head_scripts', 20 );\nadd_action( 'embed_head', 'wp_print_styles', 20 );\nadd_action( 'embed_head', 'wp_no_robots' );\nadd_action( 'embed_head', 'rel_canonical' );\nadd_action( 'embed_head', 'locale_stylesheet', 30 );\n\nadd_action( 'embed_content_meta', 'print_embed_comments_button' );\nadd_action( 'embed_content_meta', 'print_embed_sharing_button' );\n\nadd_action( 'embed_footer', 'print_embed_sharing_dialog' );\nadd_action( 'embed_footer', 'print_embed_scripts' );\nadd_action( 'embed_footer', 'wp_print_footer_scripts', 20 );\n\nadd_filter( 'excerpt_more', 'wp_embed_excerpt_more', 20 );\nadd_filter( 'the_excerpt_embed', 'wptexturize' );\nadd_filter( 'the_excerpt_embed', 'convert_chars' );\nadd_filter( 'the_excerpt_embed', 'wpautop' );\nadd_filter( 'the_excerpt_embed', 'shortcode_unautop' );\nadd_filter( 'the_excerpt_embed', 'wp_embed_excerpt_attachment' );\n\nadd_filter( 'oembed_dataparse', 'wp_filter_oembed_iframe_title_attribute', 5, 3 );\nadd_filter( 'oembed_dataparse', 'wp_filter_oembed_result', 10, 3 );\nadd_filter( 'oembed_response_data', 'get_oembed_response_data_rich', 10, 4 );\nadd_filter( 'pre_oembed_result', 'wp_filter_pre_oembed_result', 10, 3 );\n\n// Capabilities.\nadd_filter( 'user_has_cap', 'wp_maybe_grant_install_languages_cap', 1 );\nadd_filter( 'user_has_cap', 'wp_maybe_grant_resume_extensions_caps', 1 );\nadd_filter( 'user_has_cap', 'wp_maybe_grant_site_health_caps', 1, 4 );\n\nunset( $filter, $action );\n", "num_lines": 603}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: Default core widgets\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 2.8.0\n */\n\n/** WP_Widget_Pages class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-pages.php';\n\n/** WP_Widget_Links class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-links.php';\n\n/** WP_Widget_Search class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-search.php';\n\n/** WP_Widget_Archives class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-archives.php';\n\n/** WP_Widget_Media class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-media.php';\n\n/** WP_Widget_Media_Audio class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-media-audio.php';\n\n/** WP_Widget_Media_Image class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-media-image.php';\n\n/** WP_Widget_Media_Video class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-media-video.php';\n\n/** WP_Widget_Media_Gallery class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-media-gallery.php';\n\n/** WP_Widget_Meta class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-meta.php';\n\n/** WP_Widget_Calendar class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-calendar.php';\n\n/** WP_Widget_Text class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-text.php';\n\n/** WP_Widget_Categories class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-categories.php';\n\n/** WP_Widget_Recent_Posts class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-recent-posts.php';\n\n/** WP_Widget_Recent_Comments class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-recent-comments.php';\n\n/** WP_Widget_RSS class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-rss.php';\n\n/** WP_Widget_Tag_Cloud class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-tag-cloud.php';\n\n/** WP_Nav_Menu_Widget class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-nav-menu-widget.php';\n\n/** WP_Widget_Custom_HTML class */\nrequire_once ABSPATH . WPINC . '/widgets/class-wp-widget-custom-html.php';\n", "num_lines": 66}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Deprecated functions from past WordPress versions. You shouldn't use these\n * functions and look for the alternatives instead. The functions will be\n * removed in a later version.\n *\n * @package WordPress\n * @subpackage Deprecated\n */\n\n/*\n * Deprecated functions come here to die.\n */\n\n/**\n * Retrieves all post data for a given post.\n *\n * @since 0.71\n * @deprecated 1.5.1 Use get_post()\n * @see get_post()\n *\n * @param int $postid Post ID.\n * @return array Post data.\n */\nfunction get_postdata($postid) {\n\t_deprecated_function( __FUNCTION__, '1.5.1', 'get_post()' );\n\n\t$post = get_post($postid);\n\n\t$postdata = array (\n\t\t'ID' => $post->ID,\n\t\t'Author_ID' => $post->post_author,\n\t\t'Date' => $post->post_date,\n\t\t'Content' => $post->post_content,\n\t\t'Excerpt' => $post->post_excerpt,\n\t\t'Title' => $post->post_title,\n\t\t'Category' => $post->post_category,\n\t\t'post_status' => $post->post_status,\n\t\t'comment_status' => $post->comment_status,\n\t\t'ping_status' => $post->ping_status,\n\t\t'post_password' => $post->post_password,\n\t\t'to_ping' => $post->to_ping,\n\t\t'pinged' => $post->pinged,\n\t\t'post_type' => $post->post_type,\n\t\t'post_name' => $post->post_name\n\t);\n\n\treturn $postdata;\n}\n\n/**\n * Sets up the WordPress Loop.\n *\n * Use The Loop instead.\n *\n * @link https://developer.wordpress.org/themes/basics/the-loop/\n *\n * @since 1.0.1\n * @deprecated 1.5.0\n */\nfunction start_wp() {\n\tglobal $wp_query;\n\n\t_deprecated_function( __FUNCTION__, '1.5.0', __('new WordPress Loop') );\n\n\t// Since the old style loop is being used, advance the query iterator here.\n\t$wp_query->next_post();\n\n\tsetup_postdata( get_post() );\n}\n\n/**\n * Returns or prints a category ID.\n *\n * @since 0.71\n * @deprecated 0.71 Use get_the_category()\n * @see get_the_category()\n *\n * @param bool $echo Optional. Whether to echo the output. Default true.\n * @return int Category ID.\n */\nfunction the_category_ID($echo = true) {\n\t_deprecated_function( __FUNCTION__, '0.71', 'get_the_category()' );\n\n\t// Grab the first cat in the list.\n\t$categories = get_the_category();\n\t$cat = $categories[0]->term_id;\n\n\tif ( $echo )\n\t\techo $cat;\n\n\treturn $cat;\n}\n\n/**\n * Prints a category with optional text before and after.\n *\n * @since 0.71\n * @deprecated 0.71 Use get_the_category_by_ID()\n * @see get_the_category_by_ID()\n *\n * @param string $before Optional. Text to display before the category. Default empty.\n * @param string $after  Optional. Text to display after the category. Default empty.\n */\nfunction the_category_head( $before = '', $after = '' ) {\n\tglobal $currentcat, $previouscat;\n\n\t_deprecated_function( __FUNCTION__, '0.71', 'get_the_category_by_ID()' );\n\n\t// Grab the first cat in the list.\n\t$categories = get_the_category();\n\t$currentcat = $categories[0]->category_id;\n\tif ( $currentcat != $previouscat ) {\n\t\techo $before;\n\t\techo get_the_category_by_ID($currentcat);\n\t\techo $after;\n\t\t$previouscat = $currentcat;\n\t}\n}\n\n/**\n * Prints a link to the previous post.\n *\n * @since 1.5.0\n * @deprecated 2.0.0 Use previous_post_link()\n * @see previous_post_link()\n *\n * @param string $format\n * @param string $previous\n * @param string $title\n * @param string $in_same_cat\n * @param int    $limitprev\n * @param string $excluded_categories\n */\nfunction previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') {\n\n\t_deprecated_function( __FUNCTION__, '2.0.0', 'previous_post_link()' );\n\n\tif ( empty($in_same_cat) || 'no' == $in_same_cat )\n\t\t$in_same_cat = false;\n\telse\n\t\t$in_same_cat = true;\n\n\t$post = get_previous_post($in_same_cat, $excluded_categories);\n\n\tif ( !$post )\n\t\treturn;\n\n\t$string = '<a href=\"'.get_permalink($post->ID).'\">'.$previous;\n\tif ( 'yes' == $title )\n\t\t$string .= apply_filters('the_title', $post->post_title, $post->ID);\n\t$string .= '</a>';\n\t$format = str_replace('%', $string, $format);\n\techo $format;\n}\n\n/**\n * Prints link to the next post.\n *\n * @since 0.71\n * @deprecated 2.0.0 Use next_post_link()\n * @see next_post_link()\n *\n * @param string $format\n * @param string $next\n * @param string $title\n * @param string $in_same_cat\n * @param int $limitnext\n * @param string $excluded_categories\n */\nfunction next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {\n\t_deprecated_function( __FUNCTION__, '2.0.0', 'next_post_link()' );\n\n\tif ( empty($in_same_cat) || 'no' == $in_same_cat )\n\t\t$in_same_cat = false;\n\telse\n\t\t$in_same_cat = true;\n\n\t$post = get_next_post($in_same_cat, $excluded_categories);\n\n\tif ( !$post\t)\n\t\treturn;\n\n\t$string = '<a href=\"'.get_permalink($post->ID).'\">'.$next;\n\tif ( 'yes' == $title )\n\t\t$string .= apply_filters('the_title', $post->post_title, $post->ID);\n\t$string .= '</a>';\n\t$format = str_replace('%', $string, $format);\n\techo $format;\n}\n\n/**\n * Whether user can create a post.\n *\n * @since 1.5.0\n * @deprecated 2.0.0 Use current_user_can()\n * @see current_user_can()\n *\n * @param int $user_id\n * @param int $blog_id Not Used\n * @param int $category_id Not Used\n * @return bool\n */\nfunction user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') {\n\t_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );\n\n\t$author_data = get_userdata($user_id);\n\treturn ($author_data->user_level > 1);\n}\n\n/**\n * Whether user can create a post.\n *\n * @since 1.5.0\n * @deprecated 2.0.0 Use current_user_can()\n * @see current_user_can()\n *\n * @param int $user_id\n * @param int $blog_id Not Used\n * @param int $category_id Not Used\n * @return bool\n */\nfunction user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') {\n\t_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );\n\n\t$author_data = get_userdata($user_id);\n\treturn ($author_data->user_level >= 1);\n}\n\n/**\n * Whether user can edit a post.\n *\n * @since 1.5.0\n * @deprecated 2.0.0 Use current_user_can()\n * @see current_user_can()\n *\n * @param int $user_id\n * @param int $post_id\n * @param int $blog_id Not Used\n * @return bool\n */\nfunction user_can_edit_post($user_id, $post_id, $blog_id = 1) {\n\t_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );\n\n\t$author_data = get_userdata($user_id);\n\t$post = get_post($post_id);\n\t$post_author_data = get_userdata($post->post_author);\n\n\tif ( (($user_id == $post_author_data->ID) && !($post->post_status == 'publish' && $author_data->user_level < 2))\n\t\t\t|| ($author_data->user_level > $post_author_data->user_level)\n\t\t\t|| ($author_data->user_level >= 10) ) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}\n\n/**\n * Whether user can delete a post.\n *\n * @since 1.5.0\n * @deprecated 2.0.0 Use current_user_can()\n * @see current_user_can()\n *\n * @param int $user_id\n * @param int $post_id\n * @param int $blog_id Not Used\n * @return bool\n */\nfunction user_can_delete_post($user_id, $post_id, $blog_id = 1) {\n\t_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );\n\n\t// Right now if one can edit, one can delete.\n\treturn user_can_edit_post($user_id, $post_id, $blog_id);\n}\n\n/**\n * Whether user can set new posts' dates.\n *\n * @since 1.5.0\n * @deprecated 2.0.0 Use current_user_can()\n * @see current_user_can()\n *\n * @param int $user_id\n * @param int $blog_id Not Used\n * @param int $category_id Not Used\n * @return bool\n */\nfunction user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') {\n\t_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );\n\n\t$author_data = get_userdata($user_id);\n\treturn (($author_data->user_level > 4) && user_can_create_post($user_id, $blog_id, $category_id));\n}\n\n/**\n * Whether user can delete a post.\n *\n * @since 1.5.0\n * @deprecated 2.0.0 Use current_user_can()\n * @see current_user_can()\n *\n * @param int $user_id\n * @param int $post_id\n * @param int $blog_id Not Used\n * @return bool returns true if $user_id can edit $post_id's date\n */\nfunction user_can_edit_post_date($user_id, $post_id, $blog_id = 1) {\n\t_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );\n\n\t$author_data = get_userdata($user_id);\n\treturn (($author_data->user_level > 4) && user_can_edit_post($user_id, $post_id, $blog_id));\n}\n\n/**\n * Whether user can delete a post.\n *\n * @since 1.5.0\n * @deprecated 2.0.0 Use current_user_can()\n * @see current_user_can()\n *\n * @param int $user_id\n * @param int $post_id\n * @param int $blog_id Not Used\n * @return bool returns true if $user_id can edit $post_id's comments\n */\nfunction user_can_edit_post_comments($user_id, $post_id, $blog_id = 1) {\n\t_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );\n\n\t// Right now if one can edit a post, one can edit comments made on it.\n\treturn user_can_edit_post($user_id, $post_id, $blog_id);\n}\n\n/**\n * Whether user can delete a post.\n *\n * @since 1.5.0\n * @deprecated 2.0.0 Use current_user_can()\n * @see current_user_can()\n *\n * @param int $user_id\n * @param int $post_id\n * @param int $blog_id Not Used\n * @return bool returns true if $user_id can delete $post_id's comments\n */\nfunction user_can_delete_post_comments($user_id, $post_id, $blog_id = 1) {\n\t_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );\n\n\t// Right now if one can edit comments, one can delete comments.\n\treturn user_can_edit_post_comments($user_id, $post_id, $blog_id);\n}\n\n/**\n * Can user can edit other user.\n *\n * @since 1.5.0\n * @deprecated 2.0.0 Use current_user_can()\n * @see current_user_can()\n *\n * @param int $user_id\n * @param int $other_user\n * @return bool\n */\nfunction user_can_edit_user($user_id, $other_user) {\n\t_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );\n\n\t$user  = get_userdata($user_id);\n\t$other = get_userdata($other_user);\n\tif ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID )\n\t\treturn true;\n\telse\n\t\treturn false;\n}\n\n/**\n * Gets the links associated with category $cat_name.\n *\n * @since 0.71\n * @deprecated 2.1.0 Use get_bookmarks()\n * @see get_bookmarks()\n *\n * @param string $cat_name         Optional. The category name to use. If no match is found, uses all.\n *                                 Default 'noname'.\n * @param string $before           Optional. The HTML to output before the link. Default empty.\n * @param string $after            Optional. The HTML to output after the link. Default '<br />'.\n * @param string $between          Optional. The HTML to output between the link/image and its description.\n *                                 Not used if no image or $show_images is true. Default ' '.\n * @param bool   $show_images      Optional. Whether to show images (if defined). Default true.\n * @param string $orderby          Optional. The order to output the links. E.g. 'id', 'name', 'url',\n *                                 'description', 'rating', or 'owner'. Default 'id'.\n *                                 If you start the name with an underscore, the order will be reversed.\n *                                 Specifying 'rand' as the order will return links in a random order.\n * @param bool   $show_description Optional. Whether to show the description if show_images=false/not defined.\n *                                 Default true.\n * @param bool   $show_rating      Optional. Show rating stars/chars. Default false.\n * @param int    $limit            Optional. Limit to X entries. If not specified, all entries are shown.\n *                                 Default -1.\n * @param int    $show_updated     Optional. Whether to show last updated timestamp. Default 0.\n */\nfunction get_linksbyname($cat_name = \"noname\", $before = '', $after = '<br />', $between = \" \", $show_images = true, $orderby = 'id',\n\t\t\t\t\t\t$show_description = true, $show_rating = false,\n\t\t\t\t\t\t$limit = -1, $show_updated = 0) {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );\n\n\t$cat_id = -1;\n\t$cat = get_term_by('name', $cat_name, 'link_category');\n\tif ( $cat )\n\t\t$cat_id = $cat->term_id;\n\n\tget_links($cat_id, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated);\n}\n\n/**\n * Gets the links associated with the named category.\n *\n * @since 1.0.1\n * @deprecated 2.1.0 Use wp_list_bookmarks()\n * @see wp_list_bookmarks()\n *\n * @param string $category The category to use.\n * @param string $args\n * @return string|null\n */\nfunction wp_get_linksbyname($category, $args = '') {\n\t_deprecated_function(__FUNCTION__, '2.1.0', 'wp_list_bookmarks()');\n\n\t$defaults = array(\n\t\t'after' => '<br />',\n\t\t'before' => '',\n\t\t'categorize' => 0,\n\t\t'category_after' => '',\n\t\t'category_before' => '',\n\t\t'category_name' => $category,\n\t\t'show_description' => 1,\n\t\t'title_li' => '',\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\treturn wp_list_bookmarks($parsed_args);\n}\n\n/**\n * Gets an array of link objects associated with category $cat_name.\n *\n *     $links = get_linkobjectsbyname( 'fred' );\n *     foreach ( $links as $link ) {\n *      \techo '<li>' . $link->link_name . '</li>';\n *     }\n *\n * @since 1.0.1\n * @deprecated 2.1.0 Use get_bookmarks()\n * @see get_bookmarks()\n *\n * @param string $cat_name Optional. The category name to use. If no match is found, uses all.\n *                         Default 'noname'.\n * @param string $orderby  Optional. The order to output the links. E.g. 'id', 'name', 'url',\n *                         'description', 'rating', or 'owner'. Default 'name'.\n *                         If you start the name with an underscore, the order will be reversed.\n *                         Specifying 'rand' as the order will return links in a random order.\n * @param int    $limit    Optional. Limit to X entries. If not specified, all entries are shown.\n *                         Default -1.\n * @return array\n */\nfunction get_linkobjectsbyname($cat_name = \"noname\" , $orderby = 'name', $limit = -1) {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );\n\n\t$cat_id = -1;\n\t$cat = get_term_by('name', $cat_name, 'link_category');\n\tif ( $cat )\n\t\t$cat_id = $cat->term_id;\n\n\treturn get_linkobjects($cat_id, $orderby, $limit);\n}\n\n/**\n * Gets an array of link objects associated with category n.\n *\n * Usage:\n *\n *     $links = get_linkobjects(1);\n *     if ($links) {\n *     \tforeach ($links as $link) {\n *     \t\techo '<li>'.$link->link_name.'<br />'.$link->link_description.'</li>';\n *     \t}\n *     }\n *\n * Fields are:\n *\n * - link_id\n * - link_url\n * - link_name\n * - link_image\n * - link_target\n * - link_category\n * - link_description\n * - link_visible\n * - link_owner\n * - link_rating\n * - link_updated\n * - link_rel\n * - link_notes\n *\n * @since 1.0.1\n * @deprecated 2.1.0 Use get_bookmarks()\n * @see get_bookmarks()\n *\n * @param int    $category Optional. The category to use. If no category supplied, uses all.\n *                         Default 0.\n * @param string $orderby  Optional. The order to output the links. E.g. 'id', 'name', 'url',\n *                         'description', 'rating', or 'owner'. Default 'name'.\n *                         If you start the name with an underscore, the order will be reversed.\n *                         Specifying 'rand' as the order will return links in a random order.\n * @param int    $limit    Optional. Limit to X entries. If not specified, all entries are shown.\n *                         Default 0.\n * @return array\n */\nfunction get_linkobjects($category = 0, $orderby = 'name', $limit = 0) {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );\n\n\t$links = get_bookmarks( array( 'category' => $category, 'orderby' => $orderby, 'limit' => $limit ) ) ;\n\n\t$links_array = array();\n\tforeach ($links as $link)\n\t\t$links_array[] = $link;\n\n\treturn $links_array;\n}\n\n/**\n * Gets the links associated with category 'cat_name' and display rating stars/chars.\n *\n * @since 0.71\n * @deprecated 2.1.0 Use get_bookmarks()\n * @see get_bookmarks()\n *\n * @param string $cat_name         Optional. The category name to use. If no match is found, uses all.\n *                                 Default 'noname'.\n * @param string $before           Optional. The HTML to output before the link. Default empty.\n * @param string $after            Optional. The HTML to output after the link. Default '<br />'.\n * @param string $between          Optional. The HTML to output between the link/image and its description.\n *                                 Not used if no image or $show_images is true. Default ' '.\n * @param bool   $show_images      Optional. Whether to show images (if defined). Default true.\n * @param string $orderby          Optional. The order to output the links. E.g. 'id', 'name', 'url',\n *                                 'description', 'rating', or 'owner'. Default 'id'.\n *                                 If you start the name with an underscore, the order will be reversed.\n *                                 Specifying 'rand' as the order will return links in a random order.\n * @param bool   $show_description Optional. Whether to show the description if show_images=false/not defined.\n *                                 Default true.\n * @param int    $limit\t\t       Optional. Limit to X entries. If not specified, all entries are shown.\n *                                 Default -1.\n * @param int    $show_updated     Optional. Whether to show last updated timestamp. Default 0.\n */\nfunction get_linksbyname_withrating($cat_name = \"noname\", $before = '', $after = '<br />', $between = \" \",\n\t\t\t\t\t\t\t\t\t$show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );\n\n\tget_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated);\n}\n\n/**\n * Gets the links associated with category n and display rating stars/chars.\n *\n * @since 0.71\n * @deprecated 2.1.0 Use get_bookmarks()\n * @see get_bookmarks()\n *\n * @param int    $category         Optional. The category to use. If no category supplied, uses all.\n *                                 Default 0.\n * @param string $before           Optional. The HTML to output before the link. Default empty.\n * @param string $after            Optional. The HTML to output after the link. Default '<br />'.\n * @param string $between          Optional. The HTML to output between the link/image and its description.\n *                                 Not used if no image or $show_images is true. Default ' '.\n * @param bool   $show_images      Optional. Whether to show images (if defined). Default true.\n * @param string $orderby          Optional. The order to output the links. E.g. 'id', 'name', 'url',\n *                                 'description', 'rating', or 'owner'. Default 'id'.\n *                                 If you start the name with an underscore, the order will be reversed.\n *                                 Specifying 'rand' as the order will return links in a random order.\n * @param bool   $show_description Optional. Whether to show the description if show_images=false/not defined.\n *                                 Default true.\n * @param int    $limit\t\t       Optional. Limit to X entries. If not specified, all entries are shown.\n *                                 Default -1.\n * @param int    $show_updated     Optional. Whether to show last updated timestamp. Default 0.\n */\nfunction get_links_withrating($category = -1, $before = '', $after = '<br />', $between = \" \", $show_images = true,\n\t\t\t\t\t\t\t$orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );\n\n\tget_links($category, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated);\n}\n\n/**\n * Gets the auto_toggle setting.\n *\n * @since 0.71\n * @deprecated 2.1.0\n *\n * @param int $id The category to get. If no category supplied uses 0\n * @return int Only returns 0.\n */\nfunction get_autotoggle($id = 0) {\n\t_deprecated_function( __FUNCTION__, '2.1.0' );\n\treturn 0;\n}\n\n/**\n * Lists categories.\n *\n * @since 0.71\n * @deprecated 2.1.0 Use wp_list_categories()\n * @see wp_list_categories()\n *\n * @param int $optionall\n * @param string $all\n * @param string $sort_column\n * @param string $sort_order\n * @param string $file\n * @param bool $list\n * @param int $optiondates\n * @param int $optioncount\n * @param int $hide_empty\n * @param int $use_desc_for_title\n * @param bool $children\n * @param int $child_of\n * @param int $categories\n * @param int $recurse\n * @param string $feed\n * @param string $feed_image\n * @param string $exclude\n * @param bool $hierarchical\n * @return null|false\n */\nfunction list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0,\n\t\t\t\t$optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0,\n\t\t\t\t$recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=false) {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_categories()' );\n\n\t$query = compact('optionall', 'all', 'sort_column', 'sort_order', 'file', 'list', 'optiondates', 'optioncount', 'hide_empty', 'use_desc_for_title', 'children',\n\t\t'child_of', 'categories', 'recurse', 'feed', 'feed_image', 'exclude', 'hierarchical');\n\treturn wp_list_cats($query);\n}\n\n/**\n * Lists categories.\n *\n * @since 1.2.0\n * @deprecated 2.1.0 Use wp_list_categories()\n * @see wp_list_categories()\n *\n * @param string|array $args\n * @return null|string|false\n */\nfunction wp_list_cats($args = '') {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_categories()' );\n\n\t$parsed_args = wp_parse_args( $args );\n\n\t// Map to new names.\n\tif ( isset($parsed_args['optionall']) && isset($parsed_args['all']))\n\t\t$parsed_args['show_option_all'] = $parsed_args['all'];\n\tif ( isset($parsed_args['sort_column']) )\n\t\t$parsed_args['orderby'] = $parsed_args['sort_column'];\n\tif ( isset($parsed_args['sort_order']) )\n\t\t$parsed_args['order'] = $parsed_args['sort_order'];\n\tif ( isset($parsed_args['optiondates']) )\n\t\t$parsed_args['show_last_update'] = $parsed_args['optiondates'];\n\tif ( isset($parsed_args['optioncount']) )\n\t\t$parsed_args['show_count'] = $parsed_args['optioncount'];\n\tif ( isset($parsed_args['list']) )\n\t\t$parsed_args['style'] = $parsed_args['list'] ? 'list' : 'break';\n\t$parsed_args['title_li'] = '';\n\n\treturn wp_list_categories($parsed_args);\n}\n\n/**\n * Deprecated method for generating a drop-down of categories.\n *\n * @since 0.71\n * @deprecated 2.1.0 Use wp_dropdown_categories()\n * @see wp_dropdown_categories()\n *\n * @param int $optionall\n * @param string $all\n * @param string $orderby\n * @param string $order\n * @param int $show_last_update\n * @param int $show_count\n * @param int $hide_empty\n * @param bool $optionnone\n * @param int $selected\n * @param int $exclude\n * @return string\n */\nfunction dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc',\n\t\t$show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = false,\n\t\t$selected = 0, $exclude = 0) {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'wp_dropdown_categories()' );\n\n\t$show_option_all = '';\n\tif ( $optionall )\n\t\t$show_option_all = $all;\n\n\t$show_option_none = '';\n\tif ( $optionnone )\n\t\t$show_option_none = __('None');\n\n\t$vars = compact('show_option_all', 'show_option_none', 'orderby', 'order',\n\t\t\t\t\t'show_last_update', 'show_count', 'hide_empty', 'selected', 'exclude');\n\t$query = add_query_arg($vars, '');\n\treturn wp_dropdown_categories($query);\n}\n\n/**\n * Lists authors.\n *\n * @since 1.2.0\n * @deprecated 2.1.0 Use wp_list_authors()\n * @see wp_list_authors()\n *\n * @param bool $optioncount\n * @param bool $exclude_admin\n * @param bool $show_fullname\n * @param bool $hide_empty\n * @param string $feed\n * @param string $feed_image\n * @return null|string\n */\nfunction list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_authors()' );\n\n\t$args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image');\n\treturn wp_list_authors($args);\n}\n\n/**\n * Retrieves a list of post categories.\n *\n * @since 1.0.1\n * @deprecated 2.1.0 Use wp_get_post_categories()\n * @see wp_get_post_categories()\n *\n * @param int $blogid Not Used\n * @param int $post_ID\n * @return array\n */\nfunction wp_get_post_cats($blogid = '1', $post_ID = 0) {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'wp_get_post_categories()' );\n\treturn wp_get_post_categories($post_ID);\n}\n\n/**\n * Sets the categories that the post ID belongs to.\n *\n * @since 1.0.1\n * @deprecated 2.1.0\n * @deprecated Use wp_set_post_categories()\n * @see wp_set_post_categories()\n *\n * @param int $blogid Not used\n * @param int $post_ID\n * @param array $post_categories\n * @return bool|mixed\n */\nfunction wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'wp_set_post_categories()' );\n\treturn wp_set_post_categories($post_ID, $post_categories);\n}\n\n/**\n * Retrieves a list of archives.\n *\n * @since 0.71\n * @deprecated 2.1.0 Use wp_get_archives()\n * @see wp_get_archives()\n *\n * @param string $type\n * @param string $limit\n * @param string $format\n * @param string $before\n * @param string $after\n * @param bool $show_post_count\n * @return string|null\n */\nfunction get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'wp_get_archives()' );\n\t$args = compact('type', 'limit', 'format', 'before', 'after', 'show_post_count');\n\treturn wp_get_archives($args);\n}\n\n/**\n * Returns or Prints link to the author's posts.\n *\n * @since 1.2.0\n * @deprecated 2.1.0 Use get_author_posts_url()\n * @see get_author_posts_url()\n *\n * @param bool $echo\n * @param int $author_id\n * @param string $author_nicename Optional.\n * @return string|null\n */\nfunction get_author_link($echo, $author_id, $author_nicename = '') {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'get_author_posts_url()' );\n\n\t$link = get_author_posts_url($author_id, $author_nicename);\n\n\tif ( $echo )\n\t\techo $link;\n\treturn $link;\n}\n\n/**\n * Print list of pages based on arguments.\n *\n * @since 0.71\n * @deprecated 2.1.0 Use wp_link_pages()\n * @see wp_link_pages()\n *\n * @param string $before\n * @param string $after\n * @param string $next_or_number\n * @param string $nextpagelink\n * @param string $previouspagelink\n * @param string $pagelink\n * @param string $more_file\n * @return string\n */\nfunction link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page',\n\t\t\t\t\t$pagelink='%', $more_file='') {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'wp_link_pages()' );\n\n\t$args = compact('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file');\n\treturn wp_link_pages($args);\n}\n\n/**\n * Get value based on option.\n *\n * @since 0.71\n * @deprecated 2.1.0 Use get_option()\n * @see get_option()\n *\n * @param string $option\n * @return string\n */\nfunction get_settings($option) {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'get_option()' );\n\n\treturn get_option($option);\n}\n\n/**\n * Print the permalink of the current post in the loop.\n *\n * @since 0.71\n * @deprecated 1.2.0 Use the_permalink()\n * @see the_permalink()\n */\nfunction permalink_link() {\n\t_deprecated_function( __FUNCTION__, '1.2.0', 'the_permalink()' );\n\tthe_permalink();\n}\n\n/**\n * Print the permalink to the RSS feed.\n *\n * @since 0.71\n * @deprecated 2.3.0 Use the_permalink_rss()\n * @see the_permalink_rss()\n *\n * @param string $deprecated\n */\nfunction permalink_single_rss($deprecated = '') {\n\t_deprecated_function( __FUNCTION__, '2.3.0', 'the_permalink_rss()' );\n\tthe_permalink_rss();\n}\n\n/**\n * Gets the links associated with category.\n *\n * @since 1.0.1\n * @deprecated 2.1.0 Use wp_list_bookmarks()\n * @see wp_list_bookmarks()\n *\n * @param string $args a query string\n * @return null|string\n */\nfunction wp_get_links($args = '') {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_bookmarks()' );\n\n\tif ( strpos( $args, '=' ) === false ) {\n\t\t$cat_id = $args;\n\t\t$args = add_query_arg( 'category', $cat_id, $args );\n\t}\n\n\t$defaults = array(\n\t\t'after' => '<br />',\n\t\t'before' => '',\n\t\t'between' => ' ',\n\t\t'categorize' => 0,\n\t\t'category' => '',\n\t\t'echo' => true,\n\t\t'limit' => -1,\n\t\t'orderby' => 'name',\n\t\t'show_description' => true,\n\t\t'show_images' => true,\n\t\t'show_rating' => false,\n\t\t'show_updated' => true,\n\t\t'title_li' => '',\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\treturn wp_list_bookmarks($parsed_args);\n}\n\n/**\n * Gets the links associated with category by ID.\n *\n * @since 0.71\n * @deprecated 2.1.0 Use get_bookmarks()\n * @see get_bookmarks()\n *\n * @param int    $category         Optional. The category to use. If no category supplied uses all.\n *                                 Default 0.\n * @param string $before           Optional. The HTML to output before the link. Default empty.\n * @param string $after            Optional. The HTML to output after the link. Default '<br />'.\n * @param string $between          Optional. The HTML to output between the link/image and its description.\n *                                 Not used if no image or $show_images is true. Default ' '.\n * @param bool   $show_images      Optional. Whether to show images (if defined). Default true.\n * @param string $orderby          Optional. The order to output the links. E.g. 'id', 'name', 'url',\n *                                 'description', 'rating', or 'owner'. Default 'name'.\n *                                 If you start the name with an underscore, the order will be reversed.\n *                                 Specifying 'rand' as the order will return links in a random order.\n * @param bool   $show_description Optional. Whether to show the description if show_images=false/not defined.\n *                                 Default true.\n * @param bool   $show_rating      Optional. Show rating stars/chars. Default false.\n * @param int    $limit            Optional. Limit to X entries. If not specified, all entries are shown.\n *                                 Default -1.\n * @param int    $show_updated     Optional. Whether to show last updated timestamp. Default 1.\n * @param bool   $echo             Whether to echo the results, or return them instead.\n * @return null|string\n */\nfunction get_links($category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'name',\n\t\t\t$show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );\n\n\t$order = 'ASC';\n\tif ( substr($orderby, 0, 1) == '_' ) {\n\t\t$order = 'DESC';\n\t\t$orderby = substr($orderby, 1);\n\t}\n\n\tif ( $category == -1 ) // get_bookmarks() uses '' to signify all categories.\n\t\t$category = '';\n\n\t$results = get_bookmarks(array('category' => $category, 'orderby' => $orderby, 'order' => $order, 'show_updated' => $show_updated, 'limit' => $limit));\n\n\tif ( !$results )\n\t\treturn;\n\n\t$output = '';\n\n\tforeach ( (array) $results as $row ) {\n\t\tif ( !isset($row->recently_updated) )\n\t\t\t$row->recently_updated = false;\n\t\t$output .= $before;\n\t\tif ( $show_updated && $row->recently_updated )\n\t\t\t$output .= get_option('links_recently_updated_prepend');\n\t\t$the_link = '#';\n\t\tif ( !empty($row->link_url) )\n\t\t\t$the_link = esc_url($row->link_url);\n\t\t$rel = $row->link_rel;\n\t\tif ( '' != $rel )\n\t\t\t$rel = ' rel=\"' . $rel . '\"';\n\n\t\t$desc = esc_attr(sanitize_bookmark_field('link_description', $row->link_description, $row->link_id, 'display'));\n\t\t$name = esc_attr(sanitize_bookmark_field('link_name', $row->link_name, $row->link_id, 'display'));\n\t\t$title = $desc;\n\n\t\tif ( $show_updated )\n\t\t\tif (substr($row->link_updated_f, 0, 2) != '00')\n\t\t\t\t$title .= ' ('.__('Last updated') . ' ' . gmdate(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * HOUR_IN_SECONDS)) . ')';\n\n\t\tif ( '' != $title )\n\t\t\t$title = ' title=\"' . $title . '\"';\n\n\t\t$alt = ' alt=\"' . $name . '\"';\n\n\t\t$target = $row->link_target;\n\t\tif ( '' != $target )\n\t\t\t$target = ' target=\"' . $target . '\"';\n\n\t\t$output .= '<a href=\"' . $the_link . '\"' . $rel . $title . $target. '>';\n\n\t\tif ( $row->link_image != null && $show_images ) {\n\t\t\tif ( strpos($row->link_image, 'http') !== false )\n\t\t\t\t$output .= \"<img src=\\\"$row->link_image\\\" $alt $title />\";\n\t\t\telse // If it's a relative path.\n\t\t\t\t$output .= \"<img src=\\\"\" . get_option('siteurl') . \"$row->link_image\\\" $alt $title />\";\n\t\t} else {\n\t\t\t$output .= $name;\n\t\t}\n\n\t\t$output .= '</a>';\n\n\t\tif ( $show_updated && $row->recently_updated )\n\t\t\t$output .= get_option('links_recently_updated_append');\n\n\t\tif ( $show_description && '' != $desc )\n\t\t\t$output .= $between . $desc;\n\n\t\tif ($show_rating) {\n\t\t\t$output .= $between . get_linkrating($row);\n\t\t}\n\n\t\t$output .= \"$after\\n\";\n\t} // End while.\n\n\tif ( !$echo )\n\t\treturn $output;\n\techo $output;\n}\n\n/**\n * Output entire list of links by category.\n *\n * Output a list of all links, listed by category, using the settings in\n * $wpdb->linkcategories and output it as a nested HTML unordered list.\n *\n * @since 1.0.1\n * @deprecated 2.1.0 Use wp_list_bookmarks()\n * @see wp_list_bookmarks()\n *\n * @param string $order Sort link categories by 'name' or 'id'\n */\nfunction get_links_list($order = 'name') {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_bookmarks()' );\n\n\t$order = strtolower($order);\n\n\t// Handle link category sorting.\n\t$direction = 'ASC';\n\tif ( '_' == substr($order,0,1) ) {\n\t\t$direction = 'DESC';\n\t\t$order = substr($order,1);\n\t}\n\n\tif ( !isset($direction) )\n\t\t$direction = '';\n\n\t$cats = get_categories(array('type' => 'link', 'orderby' => $order, 'order' => $direction, 'hierarchical' => 0));\n\n\t// Display each category.\n\tif ( $cats ) {\n\t\tforeach ( (array) $cats as $cat ) {\n\t\t\t// Handle each category.\n\n\t\t\t// Display the category name.\n\t\t\techo '  <li id=\"linkcat-' . $cat->term_id . '\" class=\"linkcat\"><h2>' . apply_filters('link_category', $cat->name ) . \"</h2>\\n\\t<ul>\\n\";\n\t\t\t// Call get_links() with all the appropriate params.\n\t\t\tget_links($cat->term_id, '<li>', \"</li>\", \"\\n\", true, 'name', false);\n\n\t\t\t// Close the last category.\n\t\t\techo \"\\n\\t</ul>\\n</li>\\n\";\n\t\t}\n\t}\n}\n\n/**\n * Show the link to the links popup and the number of links.\n *\n * @since 0.71\n * @deprecated 2.1.0\n *\n * @param string $text the text of the link\n * @param int $width the width of the popup window\n * @param int $height the height of the popup window\n * @param string $file the page to open in the popup window\n * @param bool $count the number of links in the db\n */\nfunction links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) {\n\t_deprecated_function( __FUNCTION__, '2.1.0' );\n}\n\n/**\n * Legacy function that retrieved the value of a link's link_rating field.\n *\n * @since 1.0.1\n * @deprecated 2.1.0 Use sanitize_bookmark_field()\n * @see sanitize_bookmark_field()\n *\n * @param object $link Link object.\n * @return mixed Value of the 'link_rating' field, false otherwise.\n */\nfunction get_linkrating( $link ) {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'sanitize_bookmark_field()' );\n\treturn sanitize_bookmark_field('link_rating', $link->link_rating, $link->link_id, 'display');\n}\n\n/**\n * Gets the name of category by ID.\n *\n * @since 0.71\n * @deprecated 2.1.0 Use get_category()\n * @see get_category()\n *\n * @param int $id The category to get. If no category supplied uses 0\n * @return string\n */\nfunction get_linkcatname($id = 0) {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'get_category()' );\n\n\t$id = (int) $id;\n\n\tif ( empty($id) )\n\t\treturn '';\n\n\t$cats = wp_get_link_cats($id);\n\n\tif ( empty($cats) || ! is_array($cats) )\n\t\treturn '';\n\n\t$cat_id = (int) $cats[0]; // Take the first cat.\n\n\t$cat = get_category($cat_id);\n\treturn $cat->name;\n}\n\n/**\n * Print RSS comment feed link.\n *\n * @since 1.0.1\n * @deprecated 2.5.0 Use post_comments_feed_link()\n * @see post_comments_feed_link()\n *\n * @param string $link_text\n */\nfunction comments_rss_link($link_text = 'Comments RSS') {\n\t_deprecated_function( __FUNCTION__, '2.5.0', 'post_comments_feed_link()' );\n\tpost_comments_feed_link($link_text);\n}\n\n/**\n * Print/Return link to category RSS2 feed.\n *\n * @since 1.2.0\n * @deprecated 2.5.0 Use get_category_feed_link()\n * @see get_category_feed_link()\n *\n * @param bool $echo\n * @param int $cat_ID\n * @return string\n */\nfunction get_category_rss_link($echo = false, $cat_ID = 1) {\n\t_deprecated_function( __FUNCTION__, '2.5.0', 'get_category_feed_link()' );\n\n\t$link = get_category_feed_link($cat_ID, 'rss2');\n\n\tif ( $echo )\n\t\techo $link;\n\treturn $link;\n}\n\n/**\n * Print/Return link to author RSS feed.\n *\n * @since 1.2.0\n * @deprecated 2.5.0 Use get_author_feed_link()\n * @see get_author_feed_link()\n *\n * @param bool $echo\n * @param int $author_id\n * @return string\n */\nfunction get_author_rss_link($echo = false, $author_id = 1) {\n\t_deprecated_function( __FUNCTION__, '2.5.0', 'get_author_feed_link()' );\n\n\t$link = get_author_feed_link($author_id);\n\tif ( $echo )\n\t\techo $link;\n\treturn $link;\n}\n\n/**\n * Return link to the post RSS feed.\n *\n * @since 1.5.0\n * @deprecated 2.2.0 Use get_post_comments_feed_link()\n * @see get_post_comments_feed_link()\n *\n * @return string\n */\nfunction comments_rss() {\n\t_deprecated_function( __FUNCTION__, '2.2.0', 'get_post_comments_feed_link()' );\n\treturn esc_url( get_post_comments_feed_link() );\n}\n\n/**\n * An alias of wp_create_user().\n *\n * @since 2.0.0\n * @deprecated 2.0.0 Use wp_create_user()\n * @see wp_create_user()\n *\n * @param string $username The user's username.\n * @param string $password The user's password.\n * @param string $email    The user's email.\n * @return int The new user's ID.\n */\nfunction create_user($username, $password, $email) {\n\t_deprecated_function( __FUNCTION__, '2.0.0', 'wp_create_user()' );\n\treturn wp_create_user($username, $password, $email);\n}\n\n/**\n * Unused function.\n *\n * @deprecated 2.5.0\n */\nfunction gzip_compression() {\n\t_deprecated_function( __FUNCTION__, '2.5.0' );\n\treturn false;\n}\n\n/**\n * Retrieve an array of comment data about comment $comment_ID.\n *\n * @since 0.71\n * @deprecated 2.7.0 Use get_comment()\n * @see get_comment()\n *\n * @param int $comment_ID The ID of the comment\n * @param int $no_cache Whether to use the cache (cast to bool)\n * @param bool $include_unapproved Whether to include unapproved comments\n * @return array The comment data\n */\nfunction get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) {\n\t_deprecated_function( __FUNCTION__, '2.7.0', 'get_comment()' );\n\treturn get_comment($comment_ID, ARRAY_A);\n}\n\n/**\n * Retrieve the category name by the category ID.\n *\n * @since 0.71\n * @deprecated 2.8.0 Use get_cat_name()\n * @see get_cat_name()\n *\n * @param int $cat_ID Category ID\n * @return string category name\n */\nfunction get_catname( $cat_ID ) {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'get_cat_name()' );\n\treturn get_cat_name( $cat_ID );\n}\n\n/**\n * Retrieve category children list separated before and after the term IDs.\n *\n * @since 1.2.0\n * @deprecated 2.8.0 Use get_term_children()\n * @see get_term_children()\n *\n * @param int    $id      Category ID to retrieve children.\n * @param string $before  Optional. Prepend before category term ID. Default '/'.\n * @param string $after   Optional. Append after category term ID. Default empty string.\n * @param array  $visited Optional. Category Term IDs that have already been added.\n *                        Default empty array.\n * @return string\n */\nfunction get_category_children( $id, $before = '/', $after = '', $visited = array() ) {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'get_term_children()' );\n\tif ( 0 == $id )\n\t\treturn '';\n\n\t$chain = '';\n\t/** TODO: Consult hierarchy */\n\t$cat_ids = get_all_category_ids();\n\tforeach ( (array) $cat_ids as $cat_id ) {\n\t\tif ( $cat_id == $id )\n\t\t\tcontinue;\n\n\t\t$category = get_category( $cat_id );\n\t\tif ( is_wp_error( $category ) )\n\t\t\treturn $category;\n\t\tif ( $category->parent == $id && !in_array( $category->term_id, $visited ) ) {\n\t\t\t$visited[] = $category->term_id;\n\t\t\t$chain .= $before.$category->term_id.$after;\n\t\t\t$chain .= get_category_children( $category->term_id, $before, $after );\n\t\t}\n\t}\n\treturn $chain;\n}\n\n/**\n * Retrieves all category IDs.\n *\n * @since 2.0.0\n * @deprecated 4.0.0 Use get_terms()\n * @see get_terms()\n *\n * @link https://developer.wordpress.org/reference/functions/get_all_category_ids/\n *\n * @return object List of all of the category IDs.\n */\nfunction get_all_category_ids() {\n\t_deprecated_function( __FUNCTION__, '4.0.0', 'get_terms()' );\n\n\t$cat_ids = get_terms(\n\t\tarray(\n\t\t\t'taxonomy' => 'category',\n\t\t\t'fields'   => 'ids',\n\t\t\t'get'      => 'all',\n\t\t)\n\t);\n\n\treturn $cat_ids;\n}\n\n/**\n * Retrieve the description of the author of the current post.\n *\n * @since 1.5.0\n * @deprecated 2.8.0 Use get_the_author_meta()\n * @see get_the_author_meta()\n *\n * @return string The author's description.\n */\nfunction get_the_author_description() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\\'description\\')' );\n\treturn get_the_author_meta('description');\n}\n\n/**\n * Display the description of the author of the current post.\n *\n * @since 1.0.0\n * @deprecated 2.8.0 Use the_author_meta()\n * @see the_author_meta()\n */\nfunction the_author_description() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\\'description\\')' );\n\tthe_author_meta('description');\n}\n\n/**\n * Retrieve the login name of the author of the current post.\n *\n * @since 1.5.0\n * @deprecated 2.8.0 Use get_the_author_meta()\n * @see get_the_author_meta()\n *\n * @return string The author's login name (username).\n */\nfunction get_the_author_login() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\\'login\\')' );\n\treturn get_the_author_meta('login');\n}\n\n/**\n * Display the login name of the author of the current post.\n *\n * @since 0.71\n * @deprecated 2.8.0 Use the_author_meta()\n * @see the_author_meta()\n */\nfunction the_author_login() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\\'login\\')' );\n\tthe_author_meta('login');\n}\n\n/**\n * Retrieve the first name of the author of the current post.\n *\n * @since 1.5.0\n * @deprecated 2.8.0 Use get_the_author_meta()\n * @see get_the_author_meta()\n *\n * @return string The author's first name.\n */\nfunction get_the_author_firstname() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\\'first_name\\')' );\n\treturn get_the_author_meta('first_name');\n}\n\n/**\n * Display the first name of the author of the current post.\n *\n * @since 0.71\n * @deprecated 2.8.0 Use the_author_meta()\n * @see the_author_meta()\n */\nfunction the_author_firstname() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\\'first_name\\')' );\n\tthe_author_meta('first_name');\n}\n\n/**\n * Retrieve the last name of the author of the current post.\n *\n * @since 1.5.0\n * @deprecated 2.8.0 Use get_the_author_meta()\n * @see get_the_author_meta()\n *\n * @return string The author's last name.\n */\nfunction get_the_author_lastname() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\\'last_name\\')' );\n\treturn get_the_author_meta('last_name');\n}\n\n/**\n * Display the last name of the author of the current post.\n *\n * @since 0.71\n * @deprecated 2.8.0 Use the_author_meta()\n * @see the_author_meta()\n */\nfunction the_author_lastname() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\\'last_name\\')' );\n\tthe_author_meta('last_name');\n}\n\n/**\n * Retrieve the nickname of the author of the current post.\n *\n * @since 1.5.0\n * @deprecated 2.8.0 Use get_the_author_meta()\n * @see get_the_author_meta()\n *\n * @return string The author's nickname.\n */\nfunction get_the_author_nickname() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\\'nickname\\')' );\n\treturn get_the_author_meta('nickname');\n}\n\n/**\n * Display the nickname of the author of the current post.\n *\n * @since 0.71\n * @deprecated 2.8.0 Use the_author_meta()\n * @see the_author_meta()\n */\nfunction the_author_nickname() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\\'nickname\\')' );\n\tthe_author_meta('nickname');\n}\n\n/**\n * Retrieve the email of the author of the current post.\n *\n * @since 1.5.0\n * @deprecated 2.8.0 Use get_the_author_meta()\n * @see get_the_author_meta()\n *\n * @return string The author's username.\n */\nfunction get_the_author_email() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\\'email\\')' );\n\treturn get_the_author_meta('email');\n}\n\n/**\n * Display the email of the author of the current post.\n *\n * @since 0.71\n * @deprecated 2.8.0 Use the_author_meta()\n * @see the_author_meta()\n */\nfunction the_author_email() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\\'email\\')' );\n\tthe_author_meta('email');\n}\n\n/**\n * Retrieve the ICQ number of the author of the current post.\n *\n * @since 1.5.0\n * @deprecated 2.8.0 Use get_the_author_meta()\n * @see get_the_author_meta()\n *\n * @return string The author's ICQ number.\n */\nfunction get_the_author_icq() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\\'icq\\')' );\n\treturn get_the_author_meta('icq');\n}\n\n/**\n * Display the ICQ number of the author of the current post.\n *\n * @since 0.71\n * @deprecated 2.8.0 Use the_author_meta()\n * @see the_author_meta()\n */\nfunction the_author_icq() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\\'icq\\')' );\n\tthe_author_meta('icq');\n}\n\n/**\n * Retrieve the Yahoo! IM name of the author of the current post.\n *\n * @since 1.5.0\n * @deprecated 2.8.0 Use get_the_author_meta()\n * @see get_the_author_meta()\n *\n * @return string The author's Yahoo! IM name.\n */\nfunction get_the_author_yim() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\\'yim\\')' );\n\treturn get_the_author_meta('yim');\n}\n\n/**\n * Display the Yahoo! IM name of the author of the current post.\n *\n * @since 0.71\n * @deprecated 2.8.0 Use the_author_meta()\n * @see the_author_meta()\n */\nfunction the_author_yim() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\\'yim\\')' );\n\tthe_author_meta('yim');\n}\n\n/**\n * Retrieve the MSN address of the author of the current post.\n *\n * @since 1.5.0\n * @deprecated 2.8.0 Use get_the_author_meta()\n * @see get_the_author_meta()\n *\n * @return string The author's MSN address.\n */\nfunction get_the_author_msn() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\\'msn\\')' );\n\treturn get_the_author_meta('msn');\n}\n\n/**\n * Display the MSN address of the author of the current post.\n *\n * @since 0.71\n * @deprecated 2.8.0 Use the_author_meta()\n * @see the_author_meta()\n */\nfunction the_author_msn() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\\'msn\\')' );\n\tthe_author_meta('msn');\n}\n\n/**\n * Retrieve the AIM address of the author of the current post.\n *\n * @since 1.5.0\n * @deprecated 2.8.0 Use get_the_author_meta()\n * @see get_the_author_meta()\n *\n * @return string The author's AIM address.\n */\nfunction get_the_author_aim() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\\'aim\\')' );\n\treturn get_the_author_meta('aim');\n}\n\n/**\n * Display the AIM address of the author of the current post.\n *\n * @since 0.71\n * @deprecated 2.8.0 Use the_author_meta('aim')\n * @see the_author_meta()\n */\nfunction the_author_aim() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\\'aim\\')' );\n\tthe_author_meta('aim');\n}\n\n/**\n * Retrieve the specified author's preferred display name.\n *\n * @since 1.0.0\n * @deprecated 2.8.0 Use get_the_author_meta()\n * @see get_the_author_meta()\n *\n * @param int $auth_id The ID of the author.\n * @return string The author's display name.\n */\nfunction get_author_name( $auth_id = false ) {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\\'display_name\\')' );\n\treturn get_the_author_meta('display_name', $auth_id);\n}\n\n/**\n * Retrieve the URL to the home page of the author of the current post.\n *\n * @since 1.5.0\n * @deprecated 2.8.0 Use get_the_author_meta()\n * @see get_the_author_meta()\n *\n * @return string The URL to the author's page.\n */\nfunction get_the_author_url() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\\'url\\')' );\n\treturn get_the_author_meta('url');\n}\n\n/**\n * Display the URL to the home page of the author of the current post.\n *\n * @since 0.71\n * @deprecated 2.8.0 Use the_author_meta()\n * @see the_author_meta()\n */\nfunction the_author_url() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\\'url\\')' );\n\tthe_author_meta('url');\n}\n\n/**\n * Retrieve the ID of the author of the current post.\n *\n * @since 1.5.0\n * @deprecated 2.8.0 Use get_the_author_meta()\n * @see get_the_author_meta()\n *\n * @return string|int The author's ID.\n */\nfunction get_the_author_ID() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\\'ID\\')' );\n\treturn get_the_author_meta('ID');\n}\n\n/**\n * Display the ID of the author of the current post.\n *\n * @since 0.71\n * @deprecated 2.8.0 Use the_author_meta()\n * @see the_author_meta()\n */\nfunction the_author_ID() {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\\'ID\\')' );\n\tthe_author_meta('ID');\n}\n\n/**\n * Display the post content for the feed.\n *\n * For encoding the HTML or the $encode_html parameter, there are three possible values:\n * - '0' will make urls footnotes and use make_url_footnote().\n * - '1' will encode special characters and automatically display all of the content.\n * - '2' will strip all HTML tags from the content.\n *\n * Also note that you cannot set the amount of words and not set the HTML encoding.\n * If that is the case, then the HTML encoding will default to 2, which will strip\n * all HTML tags.\n *\n * To restrict the amount of words of the content, you can use the cut parameter.\n * If the content is less than the amount, then there won't be any dots added to the end.\n * If there is content left over, then dots will be added and the rest of the content\n * will be removed.\n *\n * @since 0.71\n *\n * @deprecated 2.9.0 Use the_content_feed()\n * @see the_content_feed()\n *\n * @param string $more_link_text Optional. Text to display when more content is available\n *                               but not displayed. Default '(more...)'.\n * @param int    $stripteaser    Optional. Default 0.\n * @param string $more_file      Optional.\n * @param int    $cut            Optional. Amount of words to keep for the content.\n * @param int    $encode_html    Optional. How to encode the content.\n */\nfunction the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {\n\t_deprecated_function( __FUNCTION__, '2.9.0', 'the_content_feed()' );\n\t$content = get_the_content($more_link_text, $stripteaser);\n\n\t/**\n\t * Filters the post content in the context of an RSS feed.\n\t *\n\t * @since 0.71\n\t *\n\t * @param string $content Content of the current post.\n\t */\n\t$content = apply_filters('the_content_rss', $content);\n\tif ( $cut && !$encode_html )\n\t\t$encode_html = 2;\n\tif ( 1== $encode_html ) {\n\t\t$content = esc_html($content);\n\t\t$cut = 0;\n\t} elseif ( 0 == $encode_html ) {\n\t\t$content = make_url_footnote($content);\n\t} elseif ( 2 == $encode_html ) {\n\t\t$content = strip_tags($content);\n\t}\n\tif ( $cut ) {\n\t\t$blah = explode(' ', $content);\n\t\tif ( count($blah) > $cut ) {\n\t\t\t$k = $cut;\n\t\t\t$use_dotdotdot = 1;\n\t\t} else {\n\t\t\t$k = count($blah);\n\t\t\t$use_dotdotdot = 0;\n\t\t}\n\n\t\t/** @todo Check performance, might be faster to use array slice instead. */\n\t\tfor ( $i=0; $i<$k; $i++ )\n\t\t\t$excerpt .= $blah[$i].' ';\n\t\t$excerpt .= ($use_dotdotdot) ? '...' : '';\n\t\t$content = $excerpt;\n\t}\n\t$content = str_replace(']]>', ']]&gt;', $content);\n\techo $content;\n}\n\n/**\n * Strip HTML and put links at the bottom of stripped content.\n *\n * Searches for all of the links, strips them out of the content, and places\n * them at the bottom of the content with numbers.\n *\n * @since 0.71\n * @deprecated 2.9.0\n *\n * @param string $content Content to get links.\n * @return string HTML stripped out of content with links at the bottom.\n */\nfunction make_url_footnote( $content ) {\n\t_deprecated_function( __FUNCTION__, '2.9.0', '' );\n\tpreg_match_all( '/<a(.+?)href=\\\"(.+?)\\\"(.*?)>(.+?)<\\/a>/', $content, $matches );\n\t$links_summary = \"\\n\";\n\tfor ( $i = 0, $c = count( $matches[0] ); $i < $c; $i++ ) {\n\t\t$link_match = $matches[0][$i];\n\t\t$link_number = '['.($i+1).']';\n\t\t$link_url = $matches[2][$i];\n\t\t$link_text = $matches[4][$i];\n\t\t$content = str_replace( $link_match, $link_text . ' ' . $link_number, $content );\n\t\t$link_url = ( ( strtolower( substr( $link_url, 0, 7 ) ) != 'http://' ) && ( strtolower( substr( $link_url, 0, 8 ) ) != 'https://' ) ) ? get_option( 'home' ) . $link_url : $link_url;\n\t\t$links_summary .= \"\\n\" . $link_number . ' ' . $link_url;\n\t}\n\t$content  = strip_tags( $content );\n\t$content .= $links_summary;\n\treturn $content;\n}\n\n/**\n * Retrieve translated string with vertical bar context\n *\n * Quite a few times, there will be collisions with similar translatable text\n * found in more than two places but with different translated context.\n *\n * In order to use the separate contexts, the _c() function is used and the\n * translatable string uses a pipe ('|') which has the context the string is in.\n *\n * When the translated string is returned, it is everything before the pipe, not\n * including the pipe character. If there is no pipe in the translated text then\n * everything is returned.\n *\n * @since 2.2.0\n * @deprecated 2.9.0 Use _x()\n * @see _x()\n *\n * @param string $text Text to translate.\n * @param string $domain Optional. Domain to retrieve the translated text.\n * @return string Translated context string without pipe.\n */\nfunction _c( $text, $domain = 'default' ) {\n\t_deprecated_function( __FUNCTION__, '2.9.0', '_x()' );\n\treturn before_last_bar( translate( $text, $domain ) );\n}\n\n/**\n * Translates $text like translate(), but assumes that the text\n * contains a context after its last vertical bar.\n *\n * @since 2.5.0\n * @deprecated 3.0.0 Use _x()\n * @see _x()\n *\n * @param string $text Text to translate.\n * @param string $domain Domain to retrieve the translated text.\n * @return string Translated text.\n */\nfunction translate_with_context( $text, $domain = 'default' ) {\n\t_deprecated_function( __FUNCTION__, '2.9.0', '_x()' );\n\treturn before_last_bar( translate( $text, $domain ) );\n}\n\n/**\n * Legacy version of _n(), which supports contexts.\n *\n * Strips everything from the translation after the last bar.\n *\n * @since 2.7.0\n * @deprecated 3.0.0 Use _nx()\n * @see _nx()\n *\n * @param string $single The text to be used if the number is singular.\n * @param string $plural The text to be used if the number is plural.\n * @param int    $number The number to compare against to use either the singular or plural form.\n * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.\n *                       Default 'default'.\n * @return string The translated singular or plural form.\n */\nfunction _nc( $single, $plural, $number, $domain = 'default' ) {\n\t_deprecated_function( __FUNCTION__, '2.9.0', '_nx()' );\n\treturn before_last_bar( _n( $single, $plural, $number, $domain ) );\n}\n\n/**\n * Retrieve the plural or single form based on the amount.\n *\n * @since 1.2.0\n * @deprecated 2.8.0 Use _n()\n * @see _n()\n */\nfunction __ngettext( ...$args ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore\n\t_deprecated_function( __FUNCTION__, '2.8.0', '_n()' );\n\treturn _n( ...$args );\n}\n\n/**\n * Register plural strings in POT file, but don't translate them.\n *\n * @since 2.5.0\n * @deprecated 2.8.0 Use _n_noop()\n * @see _n_noop()\n */\nfunction __ngettext_noop( ...$args ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore\n\t_deprecated_function( __FUNCTION__, '2.8.0', '_n_noop()' );\n\treturn _n_noop( ...$args );\n\n}\n\n/**\n * Retrieve all autoload options, or all options if no autoloaded ones exist.\n *\n * @since 1.0.0\n * @deprecated 3.0.0 Use wp_load_alloptions())\n * @see wp_load_alloptions()\n *\n * @return array List of all options.\n */\nfunction get_alloptions() {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'wp_load_alloptions()' );\n\treturn wp_load_alloptions();\n}\n\n/**\n * Retrieve HTML content of attachment image with link.\n *\n * @since 2.0.0\n * @deprecated 2.5.0 Use wp_get_attachment_link()\n * @see wp_get_attachment_link()\n *\n * @param int   $id       Optional. Post ID.\n * @param bool  $fullsize Optional. Whether to use full size image. Default false.\n * @param array $max_dims Optional. Max image dimensions.\n * @param bool $permalink Optional. Whether to include permalink to image. Default false.\n * @return string\n */\nfunction get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) {\n\t_deprecated_function( __FUNCTION__, '2.5.0', 'wp_get_attachment_link()' );\n\t$id = (int) $id;\n\t$_post = get_post($id);\n\n\tif ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) )\n\t\treturn __('Missing Attachment');\n\n\tif ( $permalink )\n\t\t$url = get_attachment_link($_post->ID);\n\n\t$post_title = esc_attr($_post->post_title);\n\n\t$innerHTML = get_attachment_innerHTML($_post->ID, $fullsize, $max_dims);\n\treturn \"<a href='$url' title='$post_title'>$innerHTML</a>\";\n}\n\n/**\n * Retrieve icon URL and Path.\n *\n * @since 2.1.0\n * @deprecated 2.5.0 Use wp_get_attachment_image_src()\n * @see wp_get_attachment_image_src()\n *\n * @param int  $id       Optional. Post ID.\n * @param bool $fullsize Optional. Whether to have full image. Default false.\n * @return array Icon URL and full path to file, respectively.\n */\nfunction get_attachment_icon_src( $id = 0, $fullsize = false ) {\n\t_deprecated_function( __FUNCTION__, '2.5.0', 'wp_get_attachment_image_src()' );\n\t$id = (int) $id;\n\tif ( !$post = get_post($id) )\n\t\treturn false;\n\n\t$file = get_attached_file( $post->ID );\n\n\tif ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) {\n\t\t// We have a thumbnail desired, specified and existing.\n\n\t\t$src_file = wp_basename($src);\n\t} elseif ( wp_attachment_is_image( $post->ID ) ) {\n\t\t// We have an image without a thumbnail.\n\n\t\t$src = wp_get_attachment_url( $post->ID );\n\t\t$src_file = & $file;\n\t} elseif ( $src = wp_mime_type_icon( $post->ID ) ) {\n\t\t// No thumb, no image. We'll look for a mime-related icon instead.\n\n\t\t$icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' );\n\t\t$src_file = $icon_dir . '/' . wp_basename($src);\n\t}\n\n\tif ( !isset($src) || !$src )\n\t\treturn false;\n\n\treturn array($src, $src_file);\n}\n\n/**\n * Retrieve HTML content of icon attachment image element.\n *\n * @since 2.0.0\n * @deprecated 2.5.0 Use wp_get_attachment_image()\n * @see wp_get_attachment_image()\n *\n * @param int   $id       Optional. Post ID.\n * @param bool  $fullsize Optional. Whether to have full size image. Default false.\n * @param array $max_dims Optional. Dimensions of image.\n * @return string|false HTML content.\n */\nfunction get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {\n\t_deprecated_function( __FUNCTION__, '2.5.0', 'wp_get_attachment_image()' );\n\t$id = (int) $id;\n\tif ( !$post = get_post($id) )\n\t\treturn false;\n\n\tif ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) )\n\t\treturn false;\n\n\tlist($src, $src_file) = $src;\n\n\t// Do we need to constrain the image?\n\tif ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) {\n\n\t\t$imagesize = @getimagesize($src_file);\n\n\t\tif (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) {\n\t\t\t$actual_aspect = $imagesize[0] / $imagesize[1];\n\t\t\t$desired_aspect = $max_dims[0] / $max_dims[1];\n\n\t\t\tif ( $actual_aspect >= $desired_aspect ) {\n\t\t\t\t$height = $actual_aspect * $max_dims[0];\n\t\t\t\t$constraint = \"width='{$max_dims[0]}' \";\n\t\t\t\t$post->iconsize = array($max_dims[0], $height);\n\t\t\t} else {\n\t\t\t\t$width = $max_dims[1] / $actual_aspect;\n\t\t\t\t$constraint = \"height='{$max_dims[1]}' \";\n\t\t\t\t$post->iconsize = array($width, $max_dims[1]);\n\t\t\t}\n\t\t} else {\n\t\t\t$post->iconsize = array($imagesize[0], $imagesize[1]);\n\t\t\t$constraint = '';\n\t\t}\n\t} else {\n\t\t$constraint = '';\n\t}\n\n\t$post_title = esc_attr($post->post_title);\n\n\t$icon = \"<img src='$src' title='$post_title' alt='$post_title' $constraint/>\";\n\n\treturn apply_filters( 'attachment_icon', $icon, $post->ID );\n}\n\n/**\n * Retrieve HTML content of image element.\n *\n * @since 2.0.0\n * @deprecated 2.5.0 Use wp_get_attachment_image()\n * @see wp_get_attachment_image()\n *\n * @param int   $id       Optional. Post ID.\n * @param bool  $fullsize Optional. Whether to have full size image. Default false.\n * @param array $max_dims Optional. Dimensions of image.\n * @return string|false\n */\nfunction get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) {\n\t_deprecated_function( __FUNCTION__, '2.5.0', 'wp_get_attachment_image()' );\n\t$id = (int) $id;\n\tif ( !$post = get_post($id) )\n\t\treturn false;\n\n\tif ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims))\n\t\treturn $innerHTML;\n\n\t$innerHTML = esc_attr($post->post_title);\n\n\treturn apply_filters('attachment_innerHTML', $innerHTML, $post->ID);\n}\n\n/**\n * Retrieves bookmark data based on ID.\n *\n * @since 2.0.0\n * @deprecated 2.1.0 Use get_bookmark()\n * @see get_bookmark()\n *\n * @param int    $bookmark_id ID of link\n * @param string $output      Optional. Type of output. Accepts OBJECT, ARRAY_N, or ARRAY_A.\n *                            Default OBJECT.\n * @param string $filter      Optional. How to filter the link for output. Accepts 'raw', 'edit',\n *                            'attribute', 'js', 'db', or 'display'. Default 'raw'.\n * @return object|array Bookmark object or array, depending on the type specified by `$output`.\n */\nfunction get_link( $bookmark_id, $output = OBJECT, $filter = 'raw' ) {\n\t_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmark()' );\n\treturn get_bookmark($bookmark_id, $output, $filter);\n}\n\n/**\n * Performs esc_url() for database or redirect usage.\n *\n * @since 2.3.1\n * @deprecated 2.8.0 Use esc_url_raw()\n * @see esc_url_raw()\n *\n * @param string $url The URL to be cleaned.\n * @param array $protocols An array of acceptable protocols.\n * @return string The cleaned URL.\n */\nfunction sanitize_url( $url, $protocols = null ) {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'esc_url_raw()' );\n\treturn esc_url_raw( $url, $protocols );\n}\n\n/**\n * Checks and cleans a URL.\n *\n * A number of characters are removed from the URL. If the URL is for displaying\n * (the default behaviour) ampersands are also replaced. The 'clean_url' filter\n * is applied to the returned cleaned URL.\n *\n * @since 1.2.0\n * @deprecated 3.0.0 Use esc_url()\n * @see esc_url()\n *\n * @param string $url The URL to be cleaned.\n * @param array $protocols Optional. An array of acceptable protocols.\n * @param string $context Optional. How the URL will be used. Default is 'display'.\n * @return string The cleaned $url after the {@see 'clean_url'} filter is applied.\n */\nfunction clean_url( $url, $protocols = null, $context = 'display' ) {\n\tif ( $context == 'db' )\n\t\t_deprecated_function( 'clean_url( $context = \\'db\\' )', '3.0.0', 'esc_url_raw()' );\n\telse\n\t\t_deprecated_function( __FUNCTION__, '3.0.0', 'esc_url()' );\n\treturn esc_url( $url, $protocols, $context );\n}\n\n/**\n * Escape single quotes, specialchar double quotes, and fix line endings.\n *\n * The filter {@see 'js_escape'} is also applied by esc_js().\n *\n * @since 2.0.4\n * @deprecated 2.8.0 Use esc_js()\n * @see esc_js()\n *\n * @param string $text The text to be escaped.\n * @return string Escaped text.\n */\nfunction js_escape( $text ) {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'esc_js()' );\n\treturn esc_js( $text );\n}\n\n/**\n * Legacy escaping for HTML blocks.\n *\n * @deprecated 2.8.0 Use esc_html()\n * @see esc_html()\n *\n * @param string       $string        String to escape.\n * @param string       $quote_style   Unused.\n * @param false|string $charset       Unused.\n * @param false        $double_encode Whether to double encode. Unused.\n * @return string Escaped `$string`.\n */\nfunction wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'esc_html()' );\n\tif ( func_num_args() > 1 ) { // Maintain back-compat for people passing additional arguments.\n\t\treturn _wp_specialchars( $string, $quote_style, $charset, $double_encode );\n\t} else {\n\t\treturn esc_html( $string );\n\t}\n}\n\n/**\n * Escaping for HTML attributes.\n *\n * @since 2.0.6\n * @deprecated 2.8.0 Use esc_attr()\n * @see esc_attr()\n *\n * @param string $text\n * @return string\n */\nfunction attribute_escape( $text ) {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'esc_attr()' );\n\treturn esc_attr( $text );\n}\n\n/**\n * Register widget for sidebar with backward compatibility.\n *\n * Allows $name to be an array that accepts either three elements to grab the\n * first element and the third for the name or just uses the first element of\n * the array for the name.\n *\n * Passes to wp_register_sidebar_widget() after argument list and backward\n * compatibility is complete.\n *\n * @since 2.2.0\n * @deprecated 2.8.0 Use wp_register_sidebar_widget()\n * @see wp_register_sidebar_widget()\n *\n * @param string|int $name            Widget ID.\n * @param callable   $output_callback Run when widget is called.\n * @param string     $classname       Optional. Classname widget option. Default empty.\n * @param mixed      ...$params       Widget parameters.\n */\nfunction register_sidebar_widget($name, $output_callback, $classname = '', ...$params) {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'wp_register_sidebar_widget()' );\n\t// Compat.\n\tif ( is_array( $name ) ) {\n\t\tif ( count( $name ) === 3 ) {\n\t\t\t$name = sprintf( $name[0], $name[2] );\n\t\t} else {\n\t\t\t$name = $name[0];\n\t\t}\n\t}\n\n\t$id      = sanitize_title( $name );\n\t$options = array();\n\tif ( ! empty( $classname ) && is_string( $classname ) ) {\n\t\t$options['classname'] = $classname;\n\t}\n\n\twp_register_sidebar_widget( $id, $name, $output_callback, $options, ...$params );\n}\n\n/**\n * Serves as an alias of wp_unregister_sidebar_widget().\n *\n * @since 2.2.0\n * @deprecated 2.8.0 Use wp_unregister_sidebar_widget()\n * @see wp_unregister_sidebar_widget()\n *\n * @param int|string $id Widget ID.\n */\nfunction unregister_sidebar_widget($id) {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'wp_unregister_sidebar_widget()' );\n\treturn wp_unregister_sidebar_widget($id);\n}\n\n/**\n * Registers widget control callback for customizing options.\n *\n * Allows $name to be an array that accepts either three elements to grab the\n * first element and the third for the name or just uses the first element of\n * the array for the name.\n *\n * Passes to wp_register_widget_control() after the argument list has\n * been compiled.\n *\n * @since 2.2.0\n * @deprecated 2.8.0 Use wp_register_widget_control()\n * @see wp_register_widget_control()\n *\n * @param int|string $name             Sidebar ID.\n * @param callable   $control_callback Widget control callback to display and process form.\n * @param int        $width            Widget width.\n * @param int        $height           Widget height.\n * @param mixed      ...$params        Widget parameters.\n */\nfunction register_widget_control($name, $control_callback, $width = '', $height = '', ...$params) {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'wp_register_widget_control()' );\n\t// Compat.\n\tif ( is_array( $name ) ) {\n\t\tif ( count( $name ) === 3 ) {\n\t\t\t$name = sprintf( $name[0], $name[2] );\n\t\t} else {\n\t\t\t$name = $name[0];\n\t\t}\n\t}\n\n\t$id      = sanitize_title( $name );\n\t$options = array();\n\tif ( ! empty( $width ) ) {\n\t\t$options['width'] = $width;\n\t}\n\tif ( ! empty( $height ) ) {\n\t\t$options['height'] = $height;\n\t}\n\n\twp_register_widget_control( $id, $name, $control_callback, $options, ...$params );\n}\n\n/**\n * Alias of wp_unregister_widget_control().\n *\n * @since 2.2.0\n * @deprecated 2.8.0 Use wp_unregister_widget_control()\n * @see wp_unregister_widget_control()\n *\n * @param int|string $id Widget ID.\n */\nfunction unregister_widget_control($id) {\n\t_deprecated_function( __FUNCTION__, '2.8.0', 'wp_unregister_widget_control()' );\n\treturn wp_unregister_widget_control($id);\n}\n\n/**\n * Remove user meta data.\n *\n * @since 2.0.0\n * @deprecated 3.0.0 Use delete_user_meta()\n * @see delete_user_meta()\n *\n * @param int $user_id User ID.\n * @param string $meta_key Metadata key.\n * @param mixed $meta_value Optional. Metadata value. Default empty.\n * @return bool True deletion completed and false if user_id is not a number.\n */\nfunction delete_usermeta( $user_id, $meta_key, $meta_value = '' ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'delete_user_meta()' );\n\tglobal $wpdb;\n\tif ( !is_numeric( $user_id ) )\n\t\treturn false;\n\t$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);\n\n\tif ( is_array($meta_value) || is_object($meta_value) )\n\t\t$meta_value = serialize($meta_value);\n\t$meta_value = trim( $meta_value );\n\n\t$cur = $wpdb->get_row( $wpdb->prepare(\"SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s\", $user_id, $meta_key) );\n\n\tif ( $cur && $cur->umeta_id )\n\t\tdo_action( 'delete_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );\n\n\tif ( ! empty($meta_value) )\n\t\t$wpdb->query( $wpdb->prepare(\"DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s\", $user_id, $meta_key, $meta_value) );\n\telse\n\t\t$wpdb->query( $wpdb->prepare(\"DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s\", $user_id, $meta_key) );\n\n\tclean_user_cache( $user_id );\n\twp_cache_delete( $user_id, 'user_meta' );\n\n\tif ( $cur && $cur->umeta_id )\n\t\tdo_action( 'deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );\n\n\treturn true;\n}\n\n/**\n * Retrieve user metadata.\n *\n * If $user_id is not a number, then the function will fail over with a 'false'\n * boolean return value. Other returned values depend on whether there is only\n * one item to be returned, which be that single item type. If there is more\n * than one metadata value, then it will be list of metadata values.\n *\n * @since 2.0.0\n * @deprecated 3.0.0 Use get_user_meta()\n * @see get_user_meta()\n *\n * @param int $user_id User ID\n * @param string $meta_key Optional. Metadata key. Default empty.\n * @return mixed\n */\nfunction get_usermeta( $user_id, $meta_key = '' ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'get_user_meta()' );\n\tglobal $wpdb;\n\t$user_id = (int) $user_id;\n\n\tif ( !$user_id )\n\t\treturn false;\n\n\tif ( !empty($meta_key) ) {\n\t\t$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);\n\t\t$user = wp_cache_get($user_id, 'users');\n\t\t// Check the cached user object.\n\t\tif ( false !== $user && isset($user->$meta_key) )\n\t\t\t$metas = array($user->$meta_key);\n\t\telse\n\t\t\t$metas = $wpdb->get_col( $wpdb->prepare(\"SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s\", $user_id, $meta_key) );\n\t} else {\n\t\t$metas = $wpdb->get_col( $wpdb->prepare(\"SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d\", $user_id) );\n\t}\n\n\tif ( empty($metas) ) {\n\t\tif ( empty($meta_key) )\n\t\t\treturn array();\n\t\telse\n\t\t\treturn '';\n\t}\n\n\t$metas = array_map('maybe_unserialize', $metas);\n\n\tif ( count($metas) == 1 )\n\t\treturn $metas[0];\n\telse\n\t\treturn $metas;\n}\n\n/**\n * Update metadata of user.\n *\n * There is no need to serialize values, they will be serialized if it is\n * needed. The metadata key can only be a string with underscores. All else will\n * be removed.\n *\n * Will remove the metadata, if the meta value is empty.\n *\n * @since 2.0.0\n * @deprecated 3.0.0 Use update_user_meta()\n * @see update_user_meta()\n *\n * @param int $user_id User ID\n * @param string $meta_key Metadata key.\n * @param mixed $meta_value Metadata value.\n * @return bool True on successful update, false on failure.\n */\nfunction update_usermeta( $user_id, $meta_key, $meta_value ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'update_user_meta()' );\n\tglobal $wpdb;\n\tif ( !is_numeric( $user_id ) )\n\t\treturn false;\n\t$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);\n\n\t/** @todo Might need fix because usermeta data is assumed to be already escaped */\n\tif ( is_string($meta_value) )\n\t\t$meta_value = stripslashes($meta_value);\n\t$meta_value = maybe_serialize($meta_value);\n\n\tif (empty($meta_value)) {\n\t\treturn delete_usermeta($user_id, $meta_key);\n\t}\n\n\t$cur = $wpdb->get_row( $wpdb->prepare(\"SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s\", $user_id, $meta_key) );\n\n\tif ( $cur )\n\t\tdo_action( 'update_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );\n\n\tif ( !$cur )\n\t\t$wpdb->insert($wpdb->usermeta, compact('user_id', 'meta_key', 'meta_value') );\n\telseif ( $cur->meta_value != $meta_value )\n\t\t$wpdb->update($wpdb->usermeta, compact('meta_value'), compact('user_id', 'meta_key') );\n\telse\n\t\treturn false;\n\n\tclean_user_cache( $user_id );\n\twp_cache_delete( $user_id, 'user_meta' );\n\n\tif ( !$cur )\n\t\tdo_action( 'added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value );\n\telse\n\t\tdo_action( 'updated_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );\n\n\treturn true;\n}\n\n/**\n * Get users for the site.\n *\n * For setups that use the multisite feature. Can be used outside of the\n * multisite feature.\n *\n * @since 2.2.0\n * @deprecated 3.1.0 Use get_users()\n * @see get_users()\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int $id Site ID.\n * @return array List of users that are part of that site ID\n */\nfunction get_users_of_blog( $id = '' ) {\n\t_deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );\n\n\tglobal $wpdb;\n\tif ( empty( $id ) ) {\n\t\t$id = get_current_blog_id();\n\t}\n\t$blog_prefix = $wpdb->get_blog_prefix($id);\n\t$users = $wpdb->get_results( \"SELECT user_id, user_id AS ID, user_login, display_name, user_email, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE {$wpdb->users}.ID = {$wpdb->usermeta}.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY {$wpdb->usermeta}.user_id\" );\n\treturn $users;\n}\n\n/**\n * Enable/disable automatic general feed link outputting.\n *\n * @since 2.8.0\n * @deprecated 3.0.0 Use add_theme_support()\n * @see add_theme_support()\n *\n * @param bool $add Optional. Add or remove links. Default true.\n */\nfunction automatic_feed_links( $add = true ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', \"add_theme_support( 'automatic-feed-links' )\" );\n\n\tif ( $add )\n\t\tadd_theme_support( 'automatic-feed-links' );\n\telse\n\t\tremove_action( 'wp_head', 'feed_links_extra', 3 ); // Just do this yourself in 3.0+.\n}\n\n/**\n * Retrieve user data based on field.\n *\n * @since 1.5.0\n * @deprecated 3.0.0 Use get_the_author_meta()\n * @see get_the_author_meta()\n *\n * @param string    $field User meta field.\n * @param false|int $user  Optional. User ID to retrieve the field for. Default false (current user).\n * @return string The author's field from the current author's DB object.\n */\nfunction get_profile( $field, $user = false ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'get_the_author_meta()' );\n\tif ( $user ) {\n\t\t$user = get_user_by( 'login', $user );\n\t\t$user = $user->ID;\n\t}\n\treturn get_the_author_meta( $field, $user );\n}\n\n/**\n * Retrieves the number of posts a user has written.\n *\n * @since 0.71\n * @deprecated 3.0.0 Use count_user_posts()\n * @see count_user_posts()\n *\n * @param int $userid User to count posts for.\n * @return int Number of posts the given user has written.\n */\nfunction get_usernumposts( $userid ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'count_user_posts()' );\n\treturn count_user_posts( $userid );\n}\n\n/**\n * Callback used to change %uXXXX to &#YYY; syntax\n *\n * @since 2.8.0\n * @access private\n * @deprecated 3.0.0\n *\n * @param array $matches Single Match\n * @return string An HTML entity\n */\nfunction funky_javascript_callback($matches) {\n\treturn \"&#\".base_convert($matches[1],16,10).\";\";\n}\n\n/**\n * Fixes JavaScript bugs in browsers.\n *\n * Converts unicode characters to HTML numbered entities.\n *\n * @since 1.5.0\n * @deprecated 3.0.0\n *\n * @global $is_macIE\n * @global $is_winIE\n *\n * @param string $text Text to be made safe.\n * @return string Fixed text.\n */\nfunction funky_javascript_fix($text) {\n\t_deprecated_function( __FUNCTION__, '3.0.0' );\n\t// Fixes for browsers' JavaScript bugs.\n\tglobal $is_macIE, $is_winIE;\n\n\tif ( $is_winIE || $is_macIE )\n\t\t$text =  preg_replace_callback(\"/\\%u([0-9A-F]{4,4})/\",\n\t\t\t\t\t\"funky_javascript_callback\",\n\t\t\t\t\t$text);\n\n\treturn $text;\n}\n\n/**\n * Checks that the taxonomy name exists.\n *\n * @since 2.3.0\n * @deprecated 3.0.0 Use taxonomy_exists()\n * @see taxonomy_exists()\n *\n * @param string $taxonomy Name of taxonomy object\n * @return bool Whether the taxonomy exists.\n */\nfunction is_taxonomy( $taxonomy ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'taxonomy_exists()' );\n\treturn taxonomy_exists( $taxonomy );\n}\n\n/**\n * Check if Term exists.\n *\n * @since 2.3.0\n * @deprecated 3.0.0 Use term_exists()\n * @see term_exists()\n *\n * @param int|string $term The term to check\n * @param string $taxonomy The taxonomy name to use\n * @param int $parent ID of parent term under which to confine the exists search.\n * @return mixed Get the term ID or term object, if exists.\n */\nfunction is_term( $term, $taxonomy = '', $parent = 0 ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'term_exists()' );\n\treturn term_exists( $term, $taxonomy, $parent );\n}\n\n/**\n * Determines whether the current admin page is generated by a plugin.\n *\n * Use global $plugin_page and/or get_plugin_page_hookname() hooks.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n * @deprecated 3.1.0\n *\n * @global $plugin_page\n *\n * @return bool\n */\nfunction is_plugin_page() {\n\t_deprecated_function( __FUNCTION__, '3.1.0'  );\n\n\tglobal $plugin_page;\n\n\tif ( isset($plugin_page) )\n\t\treturn true;\n\n\treturn false;\n}\n\n/**\n * Update the categories cache.\n *\n * This function does not appear to be used anymore or does not appear to be\n * needed. It might be a legacy function left over from when there was a need\n * for updating the category cache.\n *\n * @since 1.5.0\n * @deprecated 3.1.0\n *\n * @return bool Always return True\n */\nfunction update_category_cache() {\n\t_deprecated_function( __FUNCTION__, '3.1.0'  );\n\n\treturn true;\n}\n\n/**\n * Check for PHP timezone support\n *\n * @since 2.9.0\n * @deprecated 3.2.0\n *\n * @return bool\n */\nfunction wp_timezone_supported() {\n\t_deprecated_function( __FUNCTION__, '3.2.0' );\n\n\treturn true;\n}\n\n/**\n * Displays an editor: TinyMCE, HTML, or both.\n *\n * @since 2.1.0\n * @deprecated 3.3.0 Use wp_editor()\n * @see wp_editor()\n *\n * @param string $content       Textarea content.\n * @param string $id            Optional. HTML ID attribute value. Default 'content'.\n * @param string $prev_id       Optional. Unused.\n * @param bool   $media_buttons Optional. Whether to display media buttons. Default true.\n * @param int    $tab_index     Optional. Unused.\n * @param bool   $extended      Optional. Unused.\n */\nfunction the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2, $extended = true) {\n\t_deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );\n\n\twp_editor( $content, $id, array( 'media_buttons' => $media_buttons ) );\n}\n\n/**\n * Perform the query to get the $metavalues array(s) needed by _fill_user and _fill_many_users\n *\n * @since 3.0.0\n * @deprecated 3.3.0\n *\n * @param array $ids User ID numbers list.\n * @return array of arrays. The array is indexed by user_id, containing $metavalues object arrays.\n */\nfunction get_user_metavalues($ids) {\n\t_deprecated_function( __FUNCTION__, '3.3.0' );\n\n\t$objects = array();\n\n\t$ids = array_map('intval', $ids);\n\tforeach ( $ids as $id )\n\t\t$objects[$id] = array();\n\n\t$metas = update_meta_cache('user', $ids);\n\n\tforeach ( $metas as $id => $meta ) {\n\t\tforeach ( $meta as $key => $metavalues ) {\n\t\t\tforeach ( $metavalues as $value ) {\n\t\t\t\t$objects[$id][] = (object)array( 'user_id' => $id, 'meta_key' => $key, 'meta_value' => $value);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $objects;\n}\n\n/**\n * Sanitize every user field.\n *\n * If the context is 'raw', then the user object or array will get minimal santization of the int fields.\n *\n * @since 2.3.0\n * @deprecated 3.3.0\n *\n * @param object|array $user    The user object or array.\n * @param string       $context Optional. How to sanitize user fields. Default 'display'.\n * @return object|array The now sanitized user object or array (will be the same type as $user).\n */\nfunction sanitize_user_object($user, $context = 'display') {\n\t_deprecated_function( __FUNCTION__, '3.3.0' );\n\n\tif ( is_object($user) ) {\n\t\tif ( !isset($user->ID) )\n\t\t\t$user->ID = 0;\n\t\tif ( ! ( $user instanceof WP_User ) ) {\n\t\t\t$vars = get_object_vars($user);\n\t\t\tforeach ( array_keys($vars) as $field ) {\n\t\t\t\tif ( is_string($user->$field) || is_numeric($user->$field) )\n\t\t\t\t\t$user->$field = sanitize_user_field($field, $user->$field, $user->ID, $context);\n\t\t\t}\n\t\t}\n\t\t$user->filter = $context;\n\t} else {\n\t\tif ( !isset($user['ID']) )\n\t\t\t$user['ID'] = 0;\n\t\tforeach ( array_keys($user) as $field )\n\t\t\t$user[$field] = sanitize_user_field($field, $user[$field], $user['ID'], $context);\n\t\t$user['filter'] = $context;\n\t}\n\n\treturn $user;\n}\n\n/**\n * Get boundary post relational link.\n *\n * Can either be start or end post relational link.\n *\n * @since 2.8.0\n * @deprecated 3.3.0\n *\n * @param string $title               Optional. Link title format. Default '%title'.\n * @param bool   $in_same_cat         Optional. Whether link should be in a same category.\n *                                    Default false.\n * @param string $excluded_categories Optional. Excluded categories IDs. Default empty.\n * @param bool   $start               Optional. Whether to display link to first or last post.\n *                                    Default true.\n * @return string\n */\nfunction get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) {\n\t_deprecated_function( __FUNCTION__, '3.3.0' );\n\n\t$posts = get_boundary_post($in_same_cat, $excluded_categories, $start);\n\t// If there is no post, stop.\n\tif ( empty($posts) )\n\t\treturn;\n\n\t// Even though we limited get_posts() to return only 1 item it still returns an array of objects.\n\t$post = $posts[0];\n\n\tif ( empty($post->post_title) )\n\t\t$post->post_title = $start ? __('First Post') : __('Last Post');\n\n\t$date = mysql2date(get_option('date_format'), $post->post_date);\n\n\t$title = str_replace('%title', $post->post_title, $title);\n\t$title = str_replace('%date', $date, $title);\n\t$title = apply_filters('the_title', $title, $post->ID);\n\n\t$link = $start ? \"<link rel='start' title='\" : \"<link rel='end' title='\";\n\t$link .= esc_attr($title);\n\t$link .= \"' href='\" . get_permalink($post) . \"' />\\n\";\n\n\t$boundary = $start ? 'start' : 'end';\n\treturn apply_filters( \"{$boundary}_post_rel_link\", $link );\n}\n\n/**\n * Display relational link for the first post.\n *\n * @since 2.8.0\n * @deprecated 3.3.0\n *\n * @param string $title Optional. Link title format.\n * @param bool $in_same_cat Optional. Whether link should be in a same category.\n * @param string $excluded_categories Optional. Excluded categories IDs.\n */\nfunction start_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '') {\n\t_deprecated_function( __FUNCTION__, '3.3.0' );\n\n\techo get_boundary_post_rel_link($title, $in_same_cat, $excluded_categories, true);\n}\n\n/**\n * Get site index relational link.\n *\n * @since 2.8.0\n * @deprecated 3.3.0\n *\n * @return string\n */\nfunction get_index_rel_link() {\n\t_deprecated_function( __FUNCTION__, '3.3.0' );\n\n\t$link = \"<link rel='index' title='\" . esc_attr( get_bloginfo( 'name', 'display' ) ) . \"' href='\" . esc_url( user_trailingslashit( get_bloginfo( 'url', 'display' ) ) ) . \"' />\\n\";\n\treturn apply_filters( \"index_rel_link\", $link );\n}\n\n/**\n * Display relational link for the site index.\n *\n * @since 2.8.0\n * @deprecated 3.3.0\n */\nfunction index_rel_link() {\n\t_deprecated_function( __FUNCTION__, '3.3.0' );\n\n\techo get_index_rel_link();\n}\n\n/**\n * Get parent post relational link.\n *\n * @since 2.8.0\n * @deprecated 3.3.0\n *\n * @param string $title Optional. Link title format. Default '%title'.\n * @return string\n */\nfunction get_parent_post_rel_link( $title = '%title' ) {\n\t_deprecated_function( __FUNCTION__, '3.3.0' );\n\n\tif ( ! empty( $GLOBALS['post'] ) && ! empty( $GLOBALS['post']->post_parent ) )\n\t\t$post = get_post($GLOBALS['post']->post_parent);\n\n\tif ( empty($post) )\n\t\treturn;\n\n\t$date = mysql2date(get_option('date_format'), $post->post_date);\n\n\t$title = str_replace('%title', $post->post_title, $title);\n\t$title = str_replace('%date', $date, $title);\n\t$title = apply_filters('the_title', $title, $post->ID);\n\n\t$link = \"<link rel='up' title='\";\n\t$link .= esc_attr( $title );\n\t$link .= \"' href='\" . get_permalink($post) . \"' />\\n\";\n\n\treturn apply_filters( \"parent_post_rel_link\", $link );\n}\n\n/**\n * Display relational link for parent item\n *\n * @since 2.8.0\n * @deprecated 3.3.0\n *\n * @param string $title Optional. Link title format. Default '%title'.\n */\nfunction parent_post_rel_link( $title = '%title' ) {\n\t_deprecated_function( __FUNCTION__, '3.3.0' );\n\n\techo get_parent_post_rel_link($title);\n}\n\n/**\n * Add the \"Dashboard\"/\"Visit Site\" menu.\n *\n * @since 3.2.0\n * @deprecated 3.3.0\n *\n * @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance.\n */\nfunction wp_admin_bar_dashboard_view_site_menu( $wp_admin_bar ) {\n\t_deprecated_function( __FUNCTION__, '3.3.0' );\n\n\t$user_id = get_current_user_id();\n\n\tif ( 0 != $user_id ) {\n\t\tif ( is_admin() )\n\t\t\t$wp_admin_bar->add_menu( array( 'id' => 'view-site', 'title' => __( 'Visit Site' ), 'href' => home_url() ) );\n\t\telseif ( is_multisite() )\n\t\t\t$wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( $user_id ) ) );\n\t\telse\n\t\t\t$wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => admin_url() ) );\n\t}\n}\n\n/**\n * Checks if the current user belong to a given site.\n *\n * @since MU (3.0.0)\n * @deprecated 3.3.0 Use is_user_member_of_blog()\n * @see is_user_member_of_blog()\n *\n * @param int $blog_id Site ID\n * @return bool True if the current users belong to $blog_id, false if not.\n */\nfunction is_blog_user( $blog_id = 0 ) {\n\t_deprecated_function( __FUNCTION__, '3.3.0', 'is_user_member_of_blog()' );\n\n\treturn is_user_member_of_blog( get_current_user_id(), $blog_id );\n}\n\n/**\n * Open the file handle for debugging.\n *\n * @since 0.71\n * @deprecated 3.4.0 Use error_log()\n * @see error_log()\n *\n * @link https://www.php.net/manual/en/function.error-log.php\n *\n * @param string $filename File name.\n * @param string $mode     Type of access you required to the stream.\n * @return false Always false.\n */\nfunction debug_fopen( $filename, $mode ) {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'error_log()' );\n\treturn false;\n}\n\n/**\n * Write contents to the file used for debugging.\n *\n * @since 0.71\n * @deprecated 3.4.0 Use error_log()\n * @see error_log()\n *\n * @link https://www.php.net/manual/en/function.error-log.php\n *\n * @param mixed  $fp     Unused.\n * @param string $string Message to log.\n */\nfunction debug_fwrite( $fp, $string ) {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'error_log()' );\n\tif ( ! empty( $GLOBALS['debug'] ) )\n\t\terror_log( $string );\n}\n\n/**\n * Close the debugging file handle.\n *\n * @since 0.71\n * @deprecated 3.4.0 Use error_log()\n * @see error_log()\n *\n * @link https://www.php.net/manual/en/function.error-log.php\n *\n * @param mixed $fp Unused.\n */\nfunction debug_fclose( $fp ) {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'error_log()' );\n}\n\n/**\n * Retrieve list of themes with theme data in theme directory.\n *\n * The theme is broken, if it doesn't have a parent theme and is missing either\n * style.css and, or index.php. If the theme has a parent theme then it is\n * broken, if it is missing style.css; index.php is optional.\n *\n * @since 1.5.0\n * @deprecated 3.4.0 Use wp_get_themes()\n * @see wp_get_themes()\n *\n * @return array Theme list with theme data.\n */\nfunction get_themes() {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_themes()' );\n\n\tglobal $wp_themes;\n\tif ( isset( $wp_themes ) )\n\t\treturn $wp_themes;\n\n\t$themes = wp_get_themes();\n\t$wp_themes = array();\n\n\tforeach ( $themes as $theme ) {\n\t\t$name = $theme->get('Name');\n\t\tif ( isset( $wp_themes[ $name ] ) )\n\t\t\t$wp_themes[ $name . '/' . $theme->get_stylesheet() ] = $theme;\n\t\telse\n\t\t\t$wp_themes[ $name ] = $theme;\n\t}\n\n\treturn $wp_themes;\n}\n\n/**\n * Retrieve theme data.\n *\n * @since 1.5.0\n * @deprecated 3.4.0 Use wp_get_theme()\n * @see wp_get_theme()\n *\n * @param string $theme Theme name.\n * @return array|null Null, if theme name does not exist. Theme data, if exists.\n */\nfunction get_theme( $theme ) {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme( $stylesheet )' );\n\n\t$themes = get_themes();\n\tif ( is_array( $themes ) && array_key_exists( $theme, $themes ) )\n\t\treturn $themes[ $theme ];\n\treturn null;\n}\n\n/**\n * Retrieve current theme name.\n *\n * @since 1.5.0\n * @deprecated 3.4.0 Use wp_get_theme()\n * @see wp_get_theme()\n *\n * @return string\n */\nfunction get_current_theme() {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme()' );\n\n\tif ( $theme = get_option( 'current_theme' ) )\n\t\treturn $theme;\n\n\treturn wp_get_theme()->get('Name');\n}\n\n/**\n * Accepts matches array from preg_replace_callback in wpautop() or a string.\n *\n * Ensures that the contents of a `<pre>...</pre>` HTML block are not\n * converted into paragraphs or line breaks.\n *\n * @since 1.2.0\n * @deprecated 3.4.0\n *\n * @param array|string $matches The array or string\n * @return string The pre block without paragraph/line break conversion.\n */\nfunction clean_pre($matches) {\n\t_deprecated_function( __FUNCTION__, '3.4.0' );\n\n\tif ( is_array($matches) )\n\t\t$text = $matches[1] . $matches[2] . \"</pre>\";\n\telse\n\t\t$text = $matches;\n\n\t$text = str_replace(array('<br />', '<br/>', '<br>'), array('', '', ''), $text);\n\t$text = str_replace('<p>', \"\\n\", $text);\n\t$text = str_replace('</p>', '', $text);\n\n\treturn $text;\n}\n\n\n/**\n * Add callbacks for image header display.\n *\n * @since 2.1.0\n * @deprecated 3.4.0 Use add_theme_support()\n * @see add_theme_support()\n *\n * @param callable $wp_head_callback Call on the {@see 'wp_head'} action.\n * @param callable $admin_head_callback Call on custom header administration screen.\n * @param callable $admin_preview_callback Output a custom header image div on the custom header administration screen. Optional.\n */\nfunction add_custom_image_header( $wp_head_callback, $admin_head_callback, $admin_preview_callback = '' ) {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'add_theme_support( \\'custom-header\\', $args )' );\n\t$args = array(\n\t\t'wp-head-callback'    => $wp_head_callback,\n\t\t'admin-head-callback' => $admin_head_callback,\n\t);\n\tif ( $admin_preview_callback )\n\t\t$args['admin-preview-callback'] = $admin_preview_callback;\n\treturn add_theme_support( 'custom-header', $args );\n}\n\n/**\n * Remove image header support.\n *\n * @since 3.1.0\n * @deprecated 3.4.0 Use remove_theme_support()\n * @see remove_theme_support()\n *\n * @return null|bool Whether support was removed.\n */\nfunction remove_custom_image_header() {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'remove_theme_support( \\'custom-header\\' )' );\n\treturn remove_theme_support( 'custom-header' );\n}\n\n/**\n * Add callbacks for background image display.\n *\n * @since 3.0.0\n * @deprecated 3.4.0 Use add_theme_support()\n * @see add_theme_support()\n *\n * @param callable $wp_head_callback Call on the {@see 'wp_head'} action.\n * @param callable $admin_head_callback Call on custom background administration screen.\n * @param callable $admin_preview_callback Output a custom background image div on the custom background administration screen. Optional.\n */\nfunction add_custom_background( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'add_theme_support( \\'custom-background\\', $args )' );\n\t$args = array();\n\tif ( $wp_head_callback )\n\t\t$args['wp-head-callback'] = $wp_head_callback;\n\tif ( $admin_head_callback )\n\t\t$args['admin-head-callback'] = $admin_head_callback;\n\tif ( $admin_preview_callback )\n\t\t$args['admin-preview-callback'] = $admin_preview_callback;\n\treturn add_theme_support( 'custom-background', $args );\n}\n\n/**\n * Remove custom background support.\n *\n * @since 3.1.0\n * @deprecated 3.4.0 Use add_custom_background()\n * @see add_custom_background()\n *\n * @return null|bool Whether support was removed.\n */\nfunction remove_custom_background() {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'remove_theme_support( \\'custom-background\\' )' );\n\treturn remove_theme_support( 'custom-background' );\n}\n\n/**\n * Retrieve theme data from parsed theme file.\n *\n * @since 1.5.0\n * @deprecated 3.4.0 Use wp_get_theme()\n * @see wp_get_theme()\n *\n * @param string $theme_file Theme file path.\n * @return array Theme data.\n */\nfunction get_theme_data( $theme_file ) {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme()' );\n\t$theme = new WP_Theme( wp_basename( dirname( $theme_file ) ), dirname( dirname( $theme_file ) ) );\n\n\t$theme_data = array(\n\t\t'Name' => $theme->get('Name'),\n\t\t'URI' => $theme->display('ThemeURI', true, false),\n\t\t'Description' => $theme->display('Description', true, false),\n\t\t'Author' => $theme->display('Author', true, false),\n\t\t'AuthorURI' => $theme->display('AuthorURI', true, false),\n\t\t'Version' => $theme->get('Version'),\n\t\t'Template' => $theme->get('Template'),\n\t\t'Status' => $theme->get('Status'),\n\t\t'Tags' => $theme->get('Tags'),\n\t\t'Title' => $theme->get('Name'),\n\t\t'AuthorName' => $theme->get('Author'),\n\t);\n\n\tforeach ( apply_filters( 'extra_theme_headers', array() ) as $extra_header ) {\n\t\tif ( ! isset( $theme_data[ $extra_header ] ) )\n\t\t\t$theme_data[ $extra_header ] = $theme->get( $extra_header );\n\t}\n\n\treturn $theme_data;\n}\n\n/**\n * Alias of update_post_cache().\n *\n * @see update_post_cache() Posts and pages are the same, alias is intentional\n *\n * @since 1.5.1\n * @deprecated 3.4.0 Use update_post_cache()\n * @see update_post_cache()\n *\n * @param array $pages list of page objects\n */\nfunction update_page_cache( &$pages ) {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'update_post_cache()' );\n\n\tupdate_post_cache( $pages );\n}\n\n/**\n * Will clean the page in the cache.\n *\n * Clean (read: delete) page from cache that matches $id. Will also clean cache\n * associated with 'all_page_ids' and 'get_pages'.\n *\n * @since 2.0.0\n * @deprecated 3.4.0 Use clean_post_cache\n * @see clean_post_cache()\n *\n * @param int $id Page ID to clean\n */\nfunction clean_page_cache( $id ) {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'clean_post_cache()' );\n\n\tclean_post_cache( $id );\n}\n\n/**\n * Retrieve nonce action \"Are you sure\" message.\n *\n * Deprecated in 3.4.1 and 3.5.0. Backported to 3.3.3.\n *\n * @since 2.0.4\n * @deprecated 3.4.1 Use wp_nonce_ays()\n * @see wp_nonce_ays()\n *\n * @param string $action Nonce action.\n * @return string Are you sure message.\n */\nfunction wp_explain_nonce( $action ) {\n\t_deprecated_function( __FUNCTION__, '3.4.1', 'wp_nonce_ays()' );\n\treturn __( 'Are you sure you want to do this?' );\n}\n\n/**\n * Display \"sticky\" CSS class, if a post is sticky.\n *\n * @since 2.7.0\n * @deprecated 3.5.0 Use post_class()\n * @see post_class()\n *\n * @param int $post_id An optional post ID.\n */\nfunction sticky_class( $post_id = null ) {\n\t_deprecated_function( __FUNCTION__, '3.5.0', 'post_class()' );\n\tif ( is_sticky( $post_id ) )\n\t\techo ' sticky';\n}\n\n/**\n * Retrieve post ancestors.\n *\n * This is no longer needed as WP_Post lazy-loads the ancestors\n * property with get_post_ancestors().\n *\n * @since 2.3.4\n * @deprecated 3.5.0 Use get_post_ancestors()\n * @see get_post_ancestors()\n *\n * @param WP_Post $post Post object, passed by reference (unused).\n */\nfunction _get_post_ancestors( &$post ) {\n\t_deprecated_function( __FUNCTION__, '3.5.0' );\n}\n\n/**\n * Load an image from a string, if PHP supports it.\n *\n * @since 2.1.0\n * @deprecated 3.5.0 Use wp_get_image_editor()\n * @see wp_get_image_editor()\n *\n * @param string $file Filename of the image to load.\n * @return resource The resulting image resource on success, Error string on failure.\n */\nfunction wp_load_image( $file ) {\n\t_deprecated_function( __FUNCTION__, '3.5.0', 'wp_get_image_editor()' );\n\n\tif ( is_numeric( $file ) )\n\t\t$file = get_attached_file( $file );\n\n\tif ( ! is_file( $file ) ) {\n\t\t/* translators: %s: File name. */\n\t\treturn sprintf( __( 'File &#8220;%s&#8221; doesn&#8217;t exist?' ), $file );\n\t}\n\n\tif ( ! function_exists('imagecreatefromstring') )\n\t\treturn __('The GD image library is not installed.');\n\n\t// Set artificially high because GD uses uncompressed images in memory.\n\twp_raise_memory_limit( 'image' );\n\n\t$image = imagecreatefromstring( file_get_contents( $file ) );\n\n\tif ( ! is_resource( $image ) ) {\n\t\t/* translators: %s: File name. */\n\t\treturn sprintf( __( 'File &#8220;%s&#8221; is not an image.' ), $file );\n\t}\n\n\treturn $image;\n}\n\n/**\n * Scale down an image to fit a particular size and save a new copy of the image.\n *\n * The PNG transparency will be preserved using the function, as well as the\n * image type. If the file going in is PNG, then the resized image is going to\n * be PNG. The only supported image types are PNG, GIF, and JPEG.\n *\n * Some functionality requires API to exist, so some PHP version may lose out\n * support. This is not the fault of WordPress (where functionality is\n * downgraded, not actual defects), but of your PHP version.\n *\n * @since 2.5.0\n * @deprecated 3.5.0 Use wp_get_image_editor()\n * @see wp_get_image_editor()\n *\n * @param string $file         Image file path.\n * @param int    $max_w        Maximum width to resize to.\n * @param int    $max_h        Maximum height to resize to.\n * @param bool   $crop         Optional. Whether to crop image or resize. Default false.\n * @param string $suffix       Optional. File suffix. Default null.\n * @param string $dest_path    Optional. New image file path. Default null.\n * @param int    $jpeg_quality Optional. Image quality percentage. Default 90.\n * @return mixed WP_Error on failure. String with new destination path.\n */\nfunction image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 90 ) {\n\t_deprecated_function( __FUNCTION__, '3.5.0', 'wp_get_image_editor()' );\n\n\t$editor = wp_get_image_editor( $file );\n\tif ( is_wp_error( $editor ) )\n\t\treturn $editor;\n\t$editor->set_quality( $jpeg_quality );\n\n\t$resized = $editor->resize( $max_w, $max_h, $crop );\n\tif ( is_wp_error( $resized ) )\n\t\treturn $resized;\n\n\t$dest_file = $editor->generate_filename( $suffix, $dest_path );\n\t$saved = $editor->save( $dest_file );\n\n\tif ( is_wp_error( $saved ) )\n\t\treturn $saved;\n\n\treturn $dest_file;\n}\n\n/**\n * Retrieve a single post, based on post ID.\n *\n * Has categories in 'post_category' property or key. Has tags in 'tags_input'\n * property or key.\n *\n * @since 1.0.0\n * @deprecated 3.5.0 Use get_post()\n * @see get_post()\n *\n * @param int $postid Post ID.\n * @param string $mode How to return result, either OBJECT, ARRAY_N, or ARRAY_A.\n * @return WP_Post|null Post object or array holding post contents and information\n */\nfunction wp_get_single_post( $postid = 0, $mode = OBJECT ) {\n\t_deprecated_function( __FUNCTION__, '3.5.0', 'get_post()' );\n\treturn get_post( $postid, $mode );\n}\n\n/**\n * Check that the user login name and password is correct.\n *\n * @since 0.71\n * @deprecated 3.5.0 Use wp_authenticate()\n * @see wp_authenticate()\n *\n * @param string $user_login User name.\n * @param string $user_pass User password.\n * @return bool False if does not authenticate, true if username and password authenticates.\n */\nfunction user_pass_ok($user_login, $user_pass) {\n\t_deprecated_function( __FUNCTION__, '3.5.0', 'wp_authenticate()' );\n\t$user = wp_authenticate( $user_login, $user_pass );\n\tif ( is_wp_error( $user ) )\n\t\treturn false;\n\n\treturn true;\n}\n\n/**\n * Callback formerly fired on the save_post hook. No longer needed.\n *\n * @since 2.3.0\n * @deprecated 3.5.0\n */\nfunction _save_post_hook() {}\n\n/**\n * Check if the installed version of GD supports particular image type\n *\n * @since 2.9.0\n * @deprecated 3.5.0 Use wp_image_editor_supports()\n * @see wp_image_editor_supports()\n *\n * @param string $mime_type\n * @return bool\n */\nfunction gd_edit_image_support($mime_type) {\n\t_deprecated_function( __FUNCTION__, '3.5.0', 'wp_image_editor_supports()' );\n\n\tif ( function_exists('imagetypes') ) {\n\t\tswitch( $mime_type ) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\treturn (imagetypes() & IMG_JPG) != 0;\n\t\t\tcase 'image/png':\n\t\t\t\treturn (imagetypes() & IMG_PNG) != 0;\n\t\t\tcase 'image/gif':\n\t\t\t\treturn (imagetypes() & IMG_GIF) != 0;\n\t\t}\n\t} else {\n\t\tswitch( $mime_type ) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\treturn function_exists('imagecreatefromjpeg');\n\t\t\tcase 'image/png':\n\t\t\t\treturn function_exists('imagecreatefrompng');\n\t\t\tcase 'image/gif':\n\t\t\t\treturn function_exists('imagecreatefromgif');\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Converts an integer byte value to a shorthand byte value.\n *\n * @since 2.3.0\n * @deprecated 3.6.0 Use size_format()\n * @see size_format()\n *\n * @param int $bytes An integer byte value.\n * @return string A shorthand byte value.\n */\nfunction wp_convert_bytes_to_hr( $bytes ) {\n\t_deprecated_function( __FUNCTION__, '3.6.0', 'size_format()' );\n\n\t$units = array( 0 => 'B', 1 => 'KB', 2 => 'MB', 3 => 'GB', 4 => 'TB' );\n\t$log   = log( $bytes, KB_IN_BYTES );\n\t$power = (int) $log;\n\t$size  = KB_IN_BYTES ** ( $log - $power );\n\n\tif ( ! is_nan( $size ) && array_key_exists( $power, $units ) ) {\n\t\t$unit = $units[ $power ];\n\t} else {\n\t\t$size = $bytes;\n\t\t$unit = $units[0];\n\t}\n\n\treturn $size . $unit;\n}\n\n/**\n * Formerly used internally to tidy up the search terms.\n *\n * @since 2.9.0\n * @access private\n * @deprecated 3.7.0\n *\n * @param string $t Search terms to \"tidy\", e.g. trim.\n * @return string Trimmed search terms.\n */\nfunction _search_terms_tidy( $t ) {\n\t_deprecated_function( __FUNCTION__, '3.7.0' );\n\treturn trim( $t, \"\\\"'\\n\\r \" );\n}\n\n/**\n * Determine if TinyMCE is available.\n *\n * Checks to see if the user has deleted the tinymce files to slim down\n * their WordPress installation.\n *\n * @since 2.1.0\n * @deprecated 3.9.0\n *\n * @return bool Whether TinyMCE exists.\n */\nfunction rich_edit_exists() {\n\tglobal $wp_rich_edit_exists;\n\t_deprecated_function( __FUNCTION__, '3.9.0' );\n\n\tif ( ! isset( $wp_rich_edit_exists ) )\n\t\t$wp_rich_edit_exists = file_exists( ABSPATH . WPINC . '/js/tinymce/tinymce.js' );\n\n\treturn $wp_rich_edit_exists;\n}\n\n/**\n * Old callback for tag link tooltips.\n *\n * @since 2.7.0\n * @access private\n * @deprecated 3.9.0\n *\n * @param int $count Number of topics.\n * @return int Number of topics.\n */\nfunction default_topic_count_text( $count ) {\n\treturn $count;\n}\n\n/**\n * Formerly used to escape strings before inserting into the DB.\n *\n * Has not performed this function for many, many years. Use wpdb::prepare() instead.\n *\n * @since 0.71\n * @deprecated 3.9.0\n *\n * @param string $content The text to format.\n * @return string The very same text.\n */\nfunction format_to_post( $content ) {\n\t_deprecated_function( __FUNCTION__, '3.9.0' );\n\treturn $content;\n}\n\n/**\n * Formerly used to escape strings before searching the DB. It was poorly documented and never worked as described.\n *\n * @since 2.5.0\n * @deprecated 4.0.0 Use wpdb::esc_like()\n * @see wpdb::esc_like()\n *\n * @param string $text The text to be escaped.\n * @return string text, safe for inclusion in LIKE query.\n */\nfunction like_escape($text) {\n\t_deprecated_function( __FUNCTION__, '4.0.0', 'wpdb::esc_like()' );\n\treturn str_replace( array( \"%\", \"_\" ), array( \"\\\\%\", \"\\\\_\" ), $text );\n}\n\n/**\n * Determines if the URL can be accessed over SSL.\n *\n * Determines if the URL can be accessed over SSL by using the WordPress HTTP API to access\n * the URL using https as the scheme.\n *\n * @since 2.5.0\n * @deprecated 4.0.0\n *\n * @param string $url The URL to test.\n * @return bool Whether SSL access is available.\n */\nfunction url_is_accessable_via_ssl( $url ) {\n\t_deprecated_function( __FUNCTION__, '4.0.0' );\n\n\t$response = wp_remote_get( set_url_scheme( $url, 'https' ) );\n\n\tif ( !is_wp_error( $response ) ) {\n\t\t$status = wp_remote_retrieve_response_code( $response );\n\t\tif ( 200 == $status || 401 == $status ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Start preview theme output buffer.\n *\n * Will only perform task if the user has permissions and template and preview\n * query variables exist.\n *\n * @since 2.6.0\n * @deprecated 4.3.0\n */\nfunction preview_theme() {\n\t_deprecated_function( __FUNCTION__, '4.3.0' );\n}\n\n/**\n * Private function to modify the current template when previewing a theme\n *\n * @since 2.9.0\n * @deprecated 4.3.0\n * @access private\n *\n * @return string\n */\nfunction _preview_theme_template_filter() {\n\t_deprecated_function( __FUNCTION__, '4.3.0' );\n\treturn '';\n}\n\n/**\n * Private function to modify the current stylesheet when previewing a theme\n *\n * @since 2.9.0\n * @deprecated 4.3.0\n * @access private\n *\n * @return string\n */\nfunction _preview_theme_stylesheet_filter() {\n\t_deprecated_function( __FUNCTION__, '4.3.0' );\n\treturn '';\n}\n\n/**\n * Callback function for ob_start() to capture all links in the theme.\n *\n * @since 2.6.0\n * @deprecated 4.3.0\n * @access private\n *\n * @param string $content\n * @return string\n */\nfunction preview_theme_ob_filter( $content ) {\n\t_deprecated_function( __FUNCTION__, '4.3.0' );\n\treturn $content;\n}\n\n/**\n * Manipulates preview theme links in order to control and maintain location.\n *\n * Callback function for preg_replace_callback() to accept and filter matches.\n *\n * @since 2.6.0\n * @deprecated 4.3.0\n * @access private\n *\n * @param array $matches\n * @return string\n */\nfunction preview_theme_ob_filter_callback( $matches ) {\n\t_deprecated_function( __FUNCTION__, '4.3.0' );\n\treturn '';\n}\n\n/**\n * Formats text for the rich text editor.\n *\n * The {@see 'richedit_pre'} filter is applied here. If $text is empty the filter will\n * be applied to an empty string.\n *\n * @since 2.0.0\n * @deprecated 4.3.0 Use format_for_editor()\n * @see format_for_editor()\n *\n * @param string $text The text to be formatted.\n * @return string The formatted text after filter is applied.\n */\nfunction wp_richedit_pre($text) {\n\t_deprecated_function( __FUNCTION__, '4.3.0', 'format_for_editor()' );\n\n\tif ( empty( $text ) ) {\n\t\t/**\n\t\t * Filters text returned for the rich text editor.\n\t\t *\n\t\t * This filter is first evaluated, and the value returned, if an empty string\n\t\t * is passed to wp_richedit_pre(). If an empty string is passed, it results\n\t\t * in a break tag and line feed.\n\t\t *\n\t\t * If a non-empty string is passed, the filter is evaluated on the wp_richedit_pre()\n\t\t * return after being formatted.\n\t\t *\n\t\t * @since 2.0.0\n\t\t * @deprecated 4.3.0\n\t\t *\n\t\t * @param string $output Text for the rich text editor.\n\t\t */\n\t\treturn apply_filters( 'richedit_pre', '' );\n\t}\n\n\t$output = convert_chars($text);\n\t$output = wpautop($output);\n\t$output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) );\n\n\t/** This filter is documented in wp-includes/deprecated.php */\n\treturn apply_filters( 'richedit_pre', $output );\n}\n\n/**\n * Formats text for the HTML editor.\n *\n * Unless $output is empty it will pass through htmlspecialchars before the\n * {@see 'htmledit_pre'} filter is applied.\n *\n * @since 2.5.0\n * @deprecated 4.3.0 Use format_for_editor()\n * @see format_for_editor()\n *\n * @param string $output The text to be formatted.\n * @return string Formatted text after filter applied.\n */\nfunction wp_htmledit_pre($output) {\n\t_deprecated_function( __FUNCTION__, '4.3.0', 'format_for_editor()' );\n\n\tif ( !empty($output) )\n\t\t$output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // Convert only '< > &'.\n\n\t/**\n\t * Filters the text before it is formatted for the HTML editor.\n\t *\n\t * @since 2.5.0\n\t * @deprecated 4.3.0\n\t *\n\t * @param string $output The HTML-formatted text.\n\t */\n\treturn apply_filters( 'htmledit_pre', $output );\n}\n\n/**\n * Retrieve permalink from post ID.\n *\n * @since 1.0.0\n * @deprecated 4.4.0 Use get_permalink()\n * @see get_permalink()\n *\n * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.\n * @return string|false\n */\nfunction post_permalink( $post_id = 0 ) {\n\t_deprecated_function( __FUNCTION__, '4.4.0', 'get_permalink()' );\n\n\treturn get_permalink( $post_id );\n}\n\n/**\n * Perform a HTTP HEAD or GET request.\n *\n * If $file_path is a writable filename, this will do a GET request and write\n * the file to that path.\n *\n * @since 2.5.0\n * @deprecated 4.4.0 Use WP_Http\n * @see WP_Http\n *\n * @param string      $url       URL to fetch.\n * @param string|bool $file_path Optional. File path to write request to. Default false.\n * @param int         $red       Optional. The number of Redirects followed, Upon 5 being hit,\n *                               returns false. Default 1.\n * @return bool|string False on failure and string of headers if HEAD request.\n */\nfunction wp_get_http( $url, $file_path = false, $red = 1 ) {\n\t_deprecated_function( __FUNCTION__, '4.4.0', 'WP_Http' );\n\n\t@set_time_limit( 60 );\n\n\tif ( $red > 5 )\n\t\treturn false;\n\n\t$options = array();\n\t$options['redirection'] = 5;\n\n\tif ( false == $file_path )\n\t\t$options['method'] = 'HEAD';\n\telse\n\t\t$options['method'] = 'GET';\n\n\t$response = wp_safe_remote_request( $url, $options );\n\n\tif ( is_wp_error( $response ) )\n\t\treturn false;\n\n\t$headers = wp_remote_retrieve_headers( $response );\n\t$headers['response'] = wp_remote_retrieve_response_code( $response );\n\n\t// WP_HTTP no longer follows redirects for HEAD requests.\n\tif ( 'HEAD' == $options['method'] && in_array($headers['response'], array(301, 302)) && isset( $headers['location'] ) ) {\n\t\treturn wp_get_http( $headers['location'], $file_path, ++$red );\n\t}\n\n\tif ( false == $file_path )\n\t\treturn $headers;\n\n\t// GET request - write it to the supplied filename.\n\t$out_fp = fopen($file_path, 'w');\n\tif ( !$out_fp )\n\t\treturn $headers;\n\n\tfwrite( $out_fp,  wp_remote_retrieve_body( $response ) );\n\tfclose($out_fp);\n\tclearstatcache();\n\n\treturn $headers;\n}\n\n/**\n * Whether SSL login should be forced.\n *\n * @since 2.6.0\n * @deprecated 4.4.0 Use force_ssl_admin()\n * @see force_ssl_admin()\n *\n * @param string|bool $force Optional Whether to force SSL login. Default null.\n * @return bool True if forced, false if not forced.\n */\nfunction force_ssl_login( $force = null ) {\n\t_deprecated_function( __FUNCTION__, '4.4.0', 'force_ssl_admin()' );\n\treturn force_ssl_admin( $force );\n}\n\n/**\n * Retrieve path of comment popup template in current or parent template.\n *\n * @since 1.5.0\n * @deprecated 4.5.0\n *\n * @return string Full path to comments popup template file.\n */\nfunction get_comments_popup_template() {\n\t_deprecated_function( __FUNCTION__, '4.5.0' );\n\n\treturn '';\n}\n\n/**\n * Determines whether the current URL is within the comments popup window.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n * @deprecated 4.5.0\n *\n * @return false Always returns false.\n */\nfunction is_comments_popup() {\n\t_deprecated_function( __FUNCTION__, '4.5.0' );\n\n\treturn false;\n}\n\n/**\n * Display the JS popup script to show a comment.\n *\n * @since 0.71\n * @deprecated 4.5.0\n */\nfunction comments_popup_script() {\n\t_deprecated_function( __FUNCTION__, '4.5.0' );\n}\n\n/**\n * Adds element attributes to open links in new tabs.\n *\n * @since 0.71\n * @deprecated 4.5.0\n *\n * @param string $text Content to replace links to open in a new tab.\n * @return string Content that has filtered links.\n */\nfunction popuplinks( $text ) {\n\t_deprecated_function( __FUNCTION__, '4.5.0' );\n\t$text = preg_replace('/<a (.+?)>/i', \"<a $1 target='_blank' rel='external'>\", $text);\n\treturn $text;\n}\n\n/**\n * The Google Video embed handler callback.\n *\n * Deprecated function that previously assisted in turning Google Video URLs\n * into embeds but that service has since been shut down.\n *\n * @since 2.9.0\n * @deprecated 4.6.0\n *\n * @return string An empty string.\n */\nfunction wp_embed_handler_googlevideo( $matches, $attr, $url, $rawattr ) {\n\t_deprecated_function( __FUNCTION__, '4.6.0' );\n\n\treturn '';\n}\n\n/**\n * Retrieve path of paged template in current or parent template.\n *\n * @since 1.5.0\n * @deprecated 4.7.0 The paged.php template is no longer part of the theme template hierarchy.\n *\n * @return string Full path to paged template file.\n */\nfunction get_paged_template() {\n\t_deprecated_function( __FUNCTION__, '4.7.0' );\n\n\treturn get_query_template( 'paged' );\n}\n\n/**\n * Removes the HTML JavaScript entities found in early versions of Netscape 4.\n *\n * Previously, this function was pulled in from the original\n * import of kses and removed a specific vulnerability only\n * existent in early version of Netscape 4. However, this\n * vulnerability never affected any other browsers and can\n * be considered safe for the modern web.\n *\n * The regular expression which sanitized this vulnerability\n * has been removed in consideration of the performance and\n * energy demands it placed, now merely passing through its\n * input to the return.\n *\n * @since 1.0.0\n * @deprecated 4.7.0 Officially dropped security support for Netscape 4.\n *\n * @param string $string\n * @return string\n */\nfunction wp_kses_js_entities( $string ) {\n\t_deprecated_function( __FUNCTION__, '4.7.0' );\n\n\treturn preg_replace( '%&\\s*\\{[^}]*(\\}\\s*;?|$)%', '', $string );\n}\n\n/**\n * Sort categories by ID.\n *\n * Used by usort() as a callback, should not be used directly. Can actually be\n * used to sort any term object.\n *\n * @since 2.3.0\n * @deprecated 4.7.0 Use wp_list_sort()\n * @access private\n *\n * @param object $a\n * @param object $b\n * @return int\n */\nfunction _usort_terms_by_ID( $a, $b ) {\n\t_deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort()' );\n\n\tif ( $a->term_id > $b->term_id )\n\t\treturn 1;\n\telseif ( $a->term_id < $b->term_id )\n\t\treturn -1;\n\telse\n\t\treturn 0;\n}\n\n/**\n * Sort categories by name.\n *\n * Used by usort() as a callback, should not be used directly. Can actually be\n * used to sort any term object.\n *\n * @since 2.3.0\n * @deprecated 4.7.0 Use wp_list_sort()\n * @access private\n *\n * @param object $a\n * @param object $b\n * @return int\n */\nfunction _usort_terms_by_name( $a, $b ) {\n\t_deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort()' );\n\n\treturn strcmp( $a->name, $b->name );\n}\n\n/**\n * Sort menu items by the desired key.\n *\n * @since 3.0.0\n * @deprecated 4.7.0 Use wp_list_sort()\n * @access private\n *\n * @global string $_menu_item_sort_prop\n *\n * @param object $a The first object to compare\n * @param object $b The second object to compare\n * @return int -1, 0, or 1 if $a is considered to be respectively less than, equal to, or greater than $b.\n */\nfunction _sort_nav_menu_items( $a, $b ) {\n\tglobal $_menu_item_sort_prop;\n\n\t_deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort()' );\n\n\tif ( empty( $_menu_item_sort_prop ) )\n\t\treturn 0;\n\n\tif ( ! isset( $a->$_menu_item_sort_prop ) || ! isset( $b->$_menu_item_sort_prop ) )\n\t\treturn 0;\n\n\t$_a = (int) $a->$_menu_item_sort_prop;\n\t$_b = (int) $b->$_menu_item_sort_prop;\n\n\tif ( $a->$_menu_item_sort_prop == $b->$_menu_item_sort_prop )\n\t\treturn 0;\n\telseif ( $_a == $a->$_menu_item_sort_prop && $_b == $b->$_menu_item_sort_prop )\n\t\treturn $_a < $_b ? -1 : 1;\n\telse\n\t\treturn strcmp( $a->$_menu_item_sort_prop, $b->$_menu_item_sort_prop );\n}\n\n/**\n * Retrieves the Press This bookmarklet link.\n *\n * @since 2.6.0\n * @deprecated 4.9.0\n *\n */\nfunction get_shortcut_link() {\n\t_deprecated_function( __FUNCTION__, '4.9.0' );\n\n\t$link = '';\n\n\t/**\n\t * Filters the Press This bookmarklet link.\n\t *\n\t * @since 2.6.0\n\t * @deprecated 4.9.0\n\t *\n\t * @param string $link The Press This bookmarklet link.\n\t */\n\treturn apply_filters( 'shortcut_link', $link );\n}\n\n/**\n* Ajax handler for saving a post from Press This.\n*\n* @since 4.2.0\n* @deprecated 4.9.0\n*/\nfunction wp_ajax_press_this_save_post() {\n\t_deprecated_function( __FUNCTION__, '4.9.0' );\n\tif ( is_plugin_active( 'press-this/press-this-plugin.php' ) ) {\n\t\tinclude WP_PLUGIN_DIR . '/press-this/class-wp-press-this-plugin.php';\n\t\t$wp_press_this = new WP_Press_This_Plugin();\n\t\t$wp_press_this->save_post();\n\t} else {\n\t\twp_send_json_error( array( 'errorMessage' => __( 'The Press This plugin is required.' ) ) );\n\t}\n}\n\n/**\n* Ajax handler for creating new category from Press This.\n*\n* @since 4.2.0\n* @deprecated 4.9.0\n*/\nfunction wp_ajax_press_this_add_category() {\n\t_deprecated_function( __FUNCTION__, '4.9.0' );\n\tif ( is_plugin_active( 'press-this/press-this-plugin.php' ) ) {\n\t\tinclude WP_PLUGIN_DIR . '/press-this/class-wp-press-this-plugin.php';\n\t\t$wp_press_this = new WP_Press_This_Plugin();\n\t\t$wp_press_this->add_category();\n\t} else {\n\t\twp_send_json_error( array( 'errorMessage' => __( 'The Press This plugin is required.' ) ) );\n\t}\n}\n\n/**\n * Return the user request object for the specified request ID.\n *\n * @since 4.9.6\n * @deprecated 5.4.0 Use wp_get_user_request()\n * @see wp_get_user_request()\n *\n * @param int $request_id The ID of the user request.\n * @return WP_User_Request|false\n */\nfunction wp_get_user_request_data( $request_id ) {\n\t_deprecated_function( __FUNCTION__, '5.4.0', 'wp_get_user_request()' );\n\treturn wp_get_user_request( $request_id );\n}\n\n/**\n * Filters 'img' elements in post content to add 'srcset' and 'sizes' attributes.\n *\n * @since 4.4.0\n * @deprecated 5.5.0\n *\n * @see wp_image_add_srcset_and_sizes()\n *\n * @param string $content The raw post content to be filtered.\n * @return string Converted content with 'srcset' and 'sizes' attributes added to images.\n */\nfunction wp_make_content_images_responsive( $content ) {\n\t_deprecated_function( __FUNCTION__, '5.5.0', 'wp_filter_content_tags()' );\n\n\t// This will also add the `loading` attribute to `img` tags, if enabled.\n\treturn wp_filter_content_tags( $content );\n}\n\n/**\n * Turn register globals off.\n *\n * @since 2.1.0\n * @access private\n * @deprecated 5.5.0\n */\nfunction wp_unregister_GLOBALS() {  // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid\n\t// register_globals was deprecated in PHP 5.3 and removed entirely in PHP 5.4.\n\t_deprecated_function( __FUNCTION__, '5.5.0' );\n}\n\n/**\n * Does comment contain disallowed characters or words.\n *\n * @since 1.5.0\n * @deprecated 5.5.0 Use wp_check_comment_disallowed_list() instead.\n *                   Please consider writing more inclusive code.\n *\n * @param string $author The author of the comment\n * @param string $email The email of the comment\n * @param string $url The url used in the comment\n * @param string $comment The comment content\n * @param string $user_ip The comment author's IP address\n * @param string $user_agent The author's browser user agent\n * @return bool True if comment contains disallowed content, false if comment does not\n */\nfunction wp_blacklist_check( $author, $email, $url, $comment, $user_ip, $user_agent ) {\n\t_deprecated_function( __FUNCTION__, '5.5.0', 'wp_check_comment_disallowed_list()' );\n\n\treturn wp_check_comment_disallowed_list( $author, $email, $url, $comment, $user_ip, $user_agent );\n}\n\n/**\n * Filters out `register_meta()` args based on an allowed list.\n *\n * `register_meta()` args may change over time, so requiring the allowed list\n * to be explicitly turned off is a warranty seal of sorts.\n *\n * @access private\n * @since 4.6.0\n * @deprecated 5.5.0 Use _wp_register_meta_args_allowed_list() instead.\n *                   Please consider writing more inclusive code.\n *\n * @param array $args         Arguments from `register_meta()`.\n * @param array $default_args Default arguments for `register_meta()`.\n * @return array Filtered arguments.\n */\nfunction _wp_register_meta_args_whitelist( $args, $default_args ) {\n\t_deprecated_function( __FUNCTION__, '5.5.0', '_wp_register_meta_args_allowed_list()' );\n\n\treturn _wp_register_meta_args_allowed_list( $args, $default_args );\n}\n\n/**\n * Adds an array of options to the list of allowed options.\n *\n * @since 2.7.0\n * @deprecated 5.5.0 Use add_allowed_options() instead.\n *                   Please consider writing more inclusive code.\n *\n * @global array $allowed_options\n *\n * @param array        $new_options\n * @param string|array $options\n * @return array\n */\nfunction add_option_whitelist( $new_options, $options = '' ) {\n\t_deprecated_function( __FUNCTION__, '5.5.0', 'add_allowed_options()' );\n\n\treturn add_allowed_options( $new_options, $options );\n}\n\n/**\n * Removes a list of options from the allowed options list.\n *\n * @since 2.7.0\n * @deprecated 5.5.0 Use remove_allowed_options() instead.\n *                   Please consider writing more inclusive code.\n *\n * @global array $allowed_options\n *\n * @param array        $del_options\n * @param string|array $options\n * @return array\n */\nfunction remove_option_whitelist( $del_options, $options = '' ) {\n\t_deprecated_function( __FUNCTION__, '5.5.0', 'remove_allowed_options()' );\n\n\treturn remove_allowed_options( $del_options, $options );\n}\n", "num_lines": 4103}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Back-compat placeholder for the base embed template\n *\n * @package WordPress\n * @subpackage oEmbed\n * @since 4.4.0\n * @deprecated 4.5.0 Moved to wp-includes/theme-compat/embed.php\n */\n\n_deprecated_file( basename( __FILE__ ), '4.5.0', 'wp-includes/theme-compat/embed.php' );\n\nrequire ABSPATH . WPINC . '/theme-compat/embed.php';\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * oEmbed API: Top-level oEmbed functionality\n *\n * @package WordPress\n * @subpackage oEmbed\n * @since 4.4.0\n */\n\n/**\n * Registers an embed handler.\n *\n * Should probably only be used for sites that do not support oEmbed.\n *\n * @since 2.9.0\n *\n * @global WP_Embed $wp_embed\n *\n * @param string   $id       An internal ID/name for the handler. Needs to be unique.\n * @param string   $regex    The regex that will be used to see if this handler should be used for a URL.\n * @param callable $callback The callback function that will be called if the regex is matched.\n * @param int      $priority Optional. Used to specify the order in which the registered handlers will\n *                           be tested. Default 10.\n */\nfunction wp_embed_register_handler( $id, $regex, $callback, $priority = 10 ) {\n\tglobal $wp_embed;\n\t$wp_embed->register_handler( $id, $regex, $callback, $priority );\n}\n\n/**\n * Unregisters a previously-registered embed handler.\n *\n * @since 2.9.0\n *\n * @global WP_Embed $wp_embed\n *\n * @param string $id       The handler ID that should be removed.\n * @param int    $priority Optional. The priority of the handler to be removed. Default 10.\n */\nfunction wp_embed_unregister_handler( $id, $priority = 10 ) {\n\tglobal $wp_embed;\n\t$wp_embed->unregister_handler( $id, $priority );\n}\n\n/**\n * Creates default array of embed parameters.\n *\n * The width defaults to the content width as specified by the theme. If the\n * theme does not specify a content width, then 500px is used.\n *\n * The default height is 1.5 times the width, or 1000px, whichever is smaller.\n *\n * The {@see 'embed_defaults'} filter can be used to adjust either of these values.\n *\n * @since 2.9.0\n *\n * @global int $content_width\n *\n * @param string $url Optional. The URL that should be embedded. Default empty.\n * @return array {\n *     Indexed array of the embed width and height in pixels.\n *\n *     @type int $0 The embed width.\n *     @type int $1 The embed height.\n * }\n */\nfunction wp_embed_defaults( $url = '' ) {\n\tif ( ! empty( $GLOBALS['content_width'] ) ) {\n\t\t$width = (int) $GLOBALS['content_width'];\n\t}\n\n\tif ( empty( $width ) ) {\n\t\t$width = 500;\n\t}\n\n\t$height = min( ceil( $width * 1.5 ), 1000 );\n\n\t/**\n\t * Filters the default array of embed dimensions.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param array  $size {\n\t *     Indexed array of the embed width and height in pixels.\n\t *\n\t *     @type int $0 The embed width.\n\t *     @type int $1 The embed height.\n\t * }\n\t * @param string $url  The URL that should be embedded.\n\t */\n\treturn apply_filters( 'embed_defaults', compact( 'width', 'height' ), $url );\n}\n\n/**\n * Attempts to fetch the embed HTML for a provided URL using oEmbed.\n *\n * @since 2.9.0\n *\n * @see WP_oEmbed\n *\n * @param string $url  The URL that should be embedded.\n * @param array  $args Optional. Additional arguments and parameters for retrieving embed HTML.\n *                     Default empty.\n * @return string|false The embed HTML on success, false on failure.\n */\nfunction wp_oembed_get( $url, $args = '' ) {\n\t$oembed = _wp_oembed_get_object();\n\treturn $oembed->get_html( $url, $args );\n}\n\n/**\n * Returns the initialized WP_oEmbed object.\n *\n * @since 2.9.0\n * @access private\n *\n * @return WP_oEmbed object.\n */\nfunction _wp_oembed_get_object() {\n\tstatic $wp_oembed = null;\n\n\tif ( is_null( $wp_oembed ) ) {\n\t\t$wp_oembed = new WP_oEmbed();\n\t}\n\treturn $wp_oembed;\n}\n\n/**\n * Adds a URL format and oEmbed provider URL pair.\n *\n * @since 2.9.0\n *\n * @see WP_oEmbed\n *\n * @param string $format   The format of URL that this provider can handle. You can use asterisks\n *                         as wildcards.\n * @param string $provider The URL to the oEmbed provider.\n * @param bool   $regex    Optional. Whether the `$format` parameter is in a RegEx format. Default false.\n */\nfunction wp_oembed_add_provider( $format, $provider, $regex = false ) {\n\tif ( did_action( 'plugins_loaded' ) ) {\n\t\t$oembed                       = _wp_oembed_get_object();\n\t\t$oembed->providers[ $format ] = array( $provider, $regex );\n\t} else {\n\t\tWP_oEmbed::_add_provider_early( $format, $provider, $regex );\n\t}\n}\n\n/**\n * Removes an oEmbed provider.\n *\n * @since 3.5.0\n *\n * @see WP_oEmbed\n *\n * @param string $format The URL format for the oEmbed provider to remove.\n * @return bool Was the provider removed successfully?\n */\nfunction wp_oembed_remove_provider( $format ) {\n\tif ( did_action( 'plugins_loaded' ) ) {\n\t\t$oembed = _wp_oembed_get_object();\n\n\t\tif ( isset( $oembed->providers[ $format ] ) ) {\n\t\t\tunset( $oembed->providers[ $format ] );\n\t\t\treturn true;\n\t\t}\n\t} else {\n\t\tWP_oEmbed::_remove_provider_early( $format );\n\t}\n\n\treturn false;\n}\n\n/**\n * Determines if default embed handlers should be loaded.\n *\n * Checks to make sure that the embeds library hasn't already been loaded. If\n * it hasn't, then it will load the embeds library.\n *\n * @since 2.9.0\n *\n * @see wp_embed_register_handler()\n */\nfunction wp_maybe_load_embeds() {\n\t/**\n\t * Filters whether to load the default embed handlers.\n\t *\n\t * Returning a falsey value will prevent loading the default embed handlers.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param bool $maybe_load_embeds Whether to load the embeds library. Default true.\n\t */\n\tif ( ! apply_filters( 'load_default_embeds', true ) ) {\n\t\treturn;\n\t}\n\n\twp_embed_register_handler( 'youtube_embed_url', '#https?://(www.)?youtube\\.com/(?:v|embed)/([^/]+)#i', 'wp_embed_handler_youtube' );\n\n\t/**\n\t * Filters the audio embed handler callback.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param callable $handler Audio embed handler callback function.\n\t */\n\twp_embed_register_handler( 'audio', '#^https?://.+?\\.(' . join( '|', wp_get_audio_extensions() ) . ')$#i', apply_filters( 'wp_audio_embed_handler', 'wp_embed_handler_audio' ), 9999 );\n\n\t/**\n\t * Filters the video embed handler callback.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param callable $handler Video embed handler callback function.\n\t */\n\twp_embed_register_handler( 'video', '#^https?://.+?\\.(' . join( '|', wp_get_video_extensions() ) . ')$#i', apply_filters( 'wp_video_embed_handler', 'wp_embed_handler_video' ), 9999 );\n}\n\n/**\n * YouTube iframe embed handler callback.\n *\n * Catches YouTube iframe embed URLs that are not parsable by oEmbed but can be translated into a URL that is.\n *\n * @since 4.0.0\n *\n * @global WP_Embed $wp_embed\n *\n * @param array  $matches The RegEx matches from the provided regex when calling\n *                        wp_embed_register_handler().\n * @param array  $attr    Embed attributes.\n * @param string $url     The original URL that was matched by the regex.\n * @param array  $rawattr The original unmodified attributes.\n * @return string The embed HTML.\n */\nfunction wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) {\n\tglobal $wp_embed;\n\t$embed = $wp_embed->autoembed( sprintf( 'https://youtube.com/watch?v=%s', urlencode( $matches[2] ) ) );\n\n\t/**\n\t * Filters the YoutTube embed output.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @see wp_embed_handler_youtube()\n\t *\n\t * @param string $embed   YouTube embed output.\n\t * @param array  $attr    An array of embed attributes.\n\t * @param string $url     The original URL that was matched by the regex.\n\t * @param array  $rawattr The original unmodified attributes.\n\t */\n\treturn apply_filters( 'wp_embed_handler_youtube', $embed, $attr, $url, $rawattr );\n}\n\n/**\n * Audio embed handler callback.\n *\n * @since 3.6.0\n *\n * @param array  $matches The RegEx matches from the provided regex when calling wp_embed_register_handler().\n * @param array  $attr Embed attributes.\n * @param string $url The original URL that was matched by the regex.\n * @param array  $rawattr The original unmodified attributes.\n * @return string The embed HTML.\n */\nfunction wp_embed_handler_audio( $matches, $attr, $url, $rawattr ) {\n\t$audio = sprintf( '[audio src=\"%s\" /]', esc_url( $url ) );\n\n\t/**\n\t * Filters the audio embed output.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param string $audio   Audio embed output.\n\t * @param array  $attr    An array of embed attributes.\n\t * @param string $url     The original URL that was matched by the regex.\n\t * @param array  $rawattr The original unmodified attributes.\n\t */\n\treturn apply_filters( 'wp_embed_handler_audio', $audio, $attr, $url, $rawattr );\n}\n\n/**\n * Video embed handler callback.\n *\n * @since 3.6.0\n *\n * @param array  $matches The RegEx matches from the provided regex when calling wp_embed_register_handler().\n * @param array  $attr    Embed attributes.\n * @param string $url     The original URL that was matched by the regex.\n * @param array  $rawattr The original unmodified attributes.\n * @return string The embed HTML.\n */\nfunction wp_embed_handler_video( $matches, $attr, $url, $rawattr ) {\n\t$dimensions = '';\n\tif ( ! empty( $rawattr['width'] ) && ! empty( $rawattr['height'] ) ) {\n\t\t$dimensions .= sprintf( 'width=\"%d\" ', (int) $rawattr['width'] );\n\t\t$dimensions .= sprintf( 'height=\"%d\" ', (int) $rawattr['height'] );\n\t}\n\t$video = sprintf( '[video %s src=\"%s\" /]', $dimensions, esc_url( $url ) );\n\n\t/**\n\t * Filters the video embed output.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param string $video   Video embed output.\n\t * @param array  $attr    An array of embed attributes.\n\t * @param string $url     The original URL that was matched by the regex.\n\t * @param array  $rawattr The original unmodified attributes.\n\t */\n\treturn apply_filters( 'wp_embed_handler_video', $video, $attr, $url, $rawattr );\n}\n\n/**\n * Registers the oEmbed REST API route.\n *\n * @since 4.4.0\n */\nfunction wp_oembed_register_route() {\n\t$controller = new WP_oEmbed_Controller();\n\t$controller->register_routes();\n}\n\n/**\n * Adds oEmbed discovery links in the website <head>.\n *\n * @since 4.4.0\n */\nfunction wp_oembed_add_discovery_links() {\n\t$output = '';\n\n\tif ( is_singular() ) {\n\t\t$output .= '<link rel=\"alternate\" type=\"application/json+oembed\" href=\"' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '\" />' . \"\\n\";\n\n\t\tif ( class_exists( 'SimpleXMLElement' ) ) {\n\t\t\t$output .= '<link rel=\"alternate\" type=\"text/xml+oembed\" href=\"' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '\" />' . \"\\n\";\n\t\t}\n\t}\n\n\t/**\n\t * Filters the oEmbed discovery links HTML.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $output HTML of the discovery links.\n\t */\n\techo apply_filters( 'oembed_discovery_links', $output );\n}\n\n/**\n * Adds the necessary JavaScript to communicate with the embedded iframes.\n *\n * @since 4.4.0\n */\nfunction wp_oembed_add_host_js() {\n\twp_enqueue_script( 'wp-embed' );\n}\n\n/**\n * Retrieves the URL to embed a specific post in an iframe.\n *\n * @since 4.4.0\n *\n * @param int|WP_Post $post Optional. Post ID or object. Defaults to the current post.\n * @return string|false The post embed URL on success, false if the post doesn't exist.\n */\nfunction get_post_embed_url( $post = null ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$embed_url     = trailingslashit( get_permalink( $post ) ) . user_trailingslashit( 'embed' );\n\t$path_conflict = get_page_by_path( str_replace( home_url(), '', $embed_url ), OBJECT, get_post_types( array( 'public' => true ) ) );\n\n\tif ( ! get_option( 'permalink_structure' ) || $path_conflict ) {\n\t\t$embed_url = add_query_arg( array( 'embed' => 'true' ), get_permalink( $post ) );\n\t}\n\n\t/**\n\t * Filters the URL to embed a specific post.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string  $embed_url The post embed URL.\n\t * @param WP_Post $post      The corresponding post object.\n\t */\n\treturn esc_url_raw( apply_filters( 'post_embed_url', $embed_url, $post ) );\n}\n\n/**\n * Retrieves the oEmbed endpoint URL for a given permalink.\n *\n * Pass an empty string as the first argument to get the endpoint base URL.\n *\n * @since 4.4.0\n *\n * @param string $permalink Optional. The permalink used for the `url` query arg. Default empty.\n * @param string $format    Optional. The requested response format. Default 'json'.\n * @return string The oEmbed endpoint URL.\n */\nfunction get_oembed_endpoint_url( $permalink = '', $format = 'json' ) {\n\t$url = rest_url( 'oembed/1.0/embed' );\n\n\tif ( '' !== $permalink ) {\n\t\t$url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'url'    => urlencode( $permalink ),\n\t\t\t\t'format' => ( 'json' !== $format ) ? $format : false,\n\t\t\t),\n\t\t\t$url\n\t\t);\n\t}\n\n\t/**\n\t * Filters the oEmbed endpoint URL.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $url       The URL to the oEmbed endpoint.\n\t * @param string $permalink The permalink used for the `url` query arg.\n\t * @param string $format    The requested response format.\n\t */\n\treturn apply_filters( 'oembed_endpoint_url', $url, $permalink, $format );\n}\n\n/**\n * Retrieves the embed code for a specific post.\n *\n * @since 4.4.0\n *\n * @param int         $width  The width for the response.\n * @param int         $height The height for the response.\n * @param int|WP_Post $post   Optional. Post ID or object. Default is global `$post`.\n * @return string|false Embed code on success, false if post doesn't exist.\n */\nfunction get_post_embed_html( $width, $height, $post = null ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$embed_url = get_post_embed_url( $post );\n\n\t$output = '<blockquote class=\"wp-embedded-content\"><a href=\"' . esc_url( get_permalink( $post ) ) . '\">' . get_the_title( $post ) . \"</a></blockquote>\\n\";\n\n\t$output .= \"<script type='text/javascript'>\\n\";\n\t$output .= \"<!--//--><![CDATA[//><!--\\n\";\n\tif ( SCRIPT_DEBUG ) {\n\t\t$output .= file_get_contents( ABSPATH . WPINC . '/js/wp-embed.js' );\n\t} else {\n\t\t/*\n\t\t * If you're looking at a src version of this file, you'll see an \"include\"\n\t\t * statement below. This is used by the `npm run build` process to directly\n\t\t * include a minified version of wp-embed.js, instead of using the\n\t\t * file_get_contents() method from above.\n\t\t *\n\t\t * If you're looking at a build version of this file, you'll see a string of\n\t\t * minified JavaScript. If you need to debug it, please turn on SCRIPT_DEBUG\n\t\t * and edit wp-embed.js directly.\n\t\t */\n\t\t$output .= <<<JS\n\t\t/*! This file is auto-generated */\n\t\t!function(d,l){\"use strict\";var e=!1,o=!1;if(l.querySelector)if(d.addEventListener)e=!0;if(d.wp=d.wp||{},!d.wp.receiveEmbedMessage)if(d.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){var r,a,i,s,n,o=l.querySelectorAll('iframe[data-secret=\"'+t.secret+'\"]'),c=l.querySelectorAll('blockquote[data-secret=\"'+t.secret+'\"]');for(r=0;r<c.length;r++)c[r].style.display=\"none\";for(r=0;r<o.length;r++)if(a=o[r],e.source===a.contentWindow){if(a.removeAttribute(\"style\"),\"height\"===t.message){if(1e3<(i=parseInt(t.value,10)))i=1e3;else if(~~i<200)i=200;a.height=i}if(\"link\"===t.message)if(s=l.createElement(\"a\"),n=l.createElement(\"a\"),s.href=a.getAttribute(\"src\"),n.href=t.value,n.host===s.host)if(l.activeElement===a)d.top.location.href=t.value}}},e)d.addEventListener(\"message\",d.wp.receiveEmbedMessage,!1),l.addEventListener(\"DOMContentLoaded\",t,!1),d.addEventListener(\"load\",t,!1);function t(){if(!o){o=!0;var e,t,r,a,i=-1!==navigator.appVersion.indexOf(\"MSIE 10\"),s=!!navigator.userAgent.match(/Trident.*rv:11\\./),n=l.querySelectorAll(\"iframe.wp-embedded-content\");for(t=0;t<n.length;t++){if(!(r=n[t]).getAttribute(\"data-secret\"))a=Math.random().toString(36).substr(2,10),r.src+=\"#?secret=\"+a,r.setAttribute(\"data-secret\",a);if(i||s)(e=r.cloneNode(!0)).removeAttribute(\"security\"),r.parentNode.replaceChild(e,r)}}}}(window,document);\nJS;\n\t}\n\t$output .= \"\\n//--><!]]>\";\n\t$output .= \"\\n</script>\";\n\n\t$output .= sprintf(\n\t\t'<iframe sandbox=\"allow-scripts\" security=\"restricted\" src=\"%1$s\" width=\"%2$d\" height=\"%3$d\" title=\"%4$s\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" class=\"wp-embedded-content\"></iframe>',\n\t\tesc_url( $embed_url ),\n\t\tabsint( $width ),\n\t\tabsint( $height ),\n\t\tesc_attr(\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: Post title, 2: Site title. */\n\t\t\t\t__( '&#8220;%1$s&#8221; &#8212; %2$s' ),\n\t\t\t\tget_the_title( $post ),\n\t\t\t\tget_bloginfo( 'name' )\n\t\t\t)\n\t\t)\n\t);\n\n\t/**\n\t * Filters the embed HTML output for a given post.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string  $output The default iframe tag to display embedded content.\n\t * @param WP_Post $post   Current post object.\n\t * @param int     $width  Width of the response.\n\t * @param int     $height Height of the response.\n\t */\n\treturn apply_filters( 'embed_html', $output, $post, $width, $height );\n}\n\n/**\n * Retrieves the oEmbed response data for a given post.\n *\n * @since 4.4.0\n *\n * @param WP_Post|int $post  Post object or ID.\n * @param int         $width The requested width.\n * @return array|false Response data on success, false if post doesn't exist.\n */\nfunction get_oembed_response_data( $post, $width ) {\n\t$post  = get_post( $post );\n\t$width = absint( $width );\n\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\tif ( 'publish' !== get_post_status( $post ) ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Filters the allowed minimum and maximum widths for the oEmbed response.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $min_max_width {\n\t *     Minimum and maximum widths for the oEmbed response.\n\t *\n\t *     @type int $min Minimum width. Default 200.\n\t *     @type int $max Maximum width. Default 600.\n\t * }\n\t */\n\t$min_max_width = apply_filters(\n\t\t'oembed_min_max_width',\n\t\tarray(\n\t\t\t'min' => 200,\n\t\t\t'max' => 600,\n\t\t)\n\t);\n\n\t$width  = min( max( $min_max_width['min'], $width ), $min_max_width['max'] );\n\t$height = max( ceil( $width / 16 * 9 ), 200 );\n\n\t$data = array(\n\t\t'version'       => '1.0',\n\t\t'provider_name' => get_bloginfo( 'name' ),\n\t\t'provider_url'  => get_home_url(),\n\t\t'author_name'   => get_bloginfo( 'name' ),\n\t\t'author_url'    => get_home_url(),\n\t\t'title'         => get_the_title( $post ),\n\t\t'type'          => 'link',\n\t);\n\n\t$author = get_userdata( $post->post_author );\n\n\tif ( $author ) {\n\t\t$data['author_name'] = $author->display_name;\n\t\t$data['author_url']  = get_author_posts_url( $author->ID );\n\t}\n\n\t/**\n\t * Filters the oEmbed response data.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array   $data   The response data.\n\t * @param WP_Post $post   The post object.\n\t * @param int     $width  The requested width.\n\t * @param int     $height The calculated height.\n\t */\n\treturn apply_filters( 'oembed_response_data', $data, $post, $width, $height );\n}\n\n\n/**\n * Retrieves the oEmbed response data for a given URL.\n *\n * @since 5.0.0\n *\n * @param string $url  The URL that should be inspected for discovery `<link>` tags.\n * @param array  $args oEmbed remote get arguments.\n * @return object|false oEmbed response data if the URL does belong to the current site. False otherwise.\n */\nfunction get_oembed_response_data_for_url( $url, $args ) {\n\t$switched_blog = false;\n\n\tif ( is_multisite() ) {\n\t\t$url_parts = wp_parse_args(\n\t\t\twp_parse_url( $url ),\n\t\t\tarray(\n\t\t\t\t'host' => '',\n\t\t\t\t'path' => '/',\n\t\t\t)\n\t\t);\n\n\t\t$qv = array(\n\t\t\t'domain'                 => $url_parts['host'],\n\t\t\t'path'                   => '/',\n\t\t\t'update_site_meta_cache' => false,\n\t\t);\n\n\t\t// In case of subdirectory configs, set the path.\n\t\tif ( ! is_subdomain_install() ) {\n\t\t\t$path = explode( '/', ltrim( $url_parts['path'], '/' ) );\n\t\t\t$path = reset( $path );\n\n\t\t\tif ( $path ) {\n\t\t\t\t$qv['path'] = get_network()->path . $path . '/';\n\t\t\t}\n\t\t}\n\n\t\t$sites = get_sites( $qv );\n\t\t$site  = reset( $sites );\n\n\t\t// Do not allow embeds for deleted/archived/spam sites.\n\t\tif ( ! empty( $site->deleted ) || ! empty( $site->spam ) || ! empty( $site->archived ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $site && get_current_blog_id() !== (int) $site->blog_id ) {\n\t\t\tswitch_to_blog( $site->blog_id );\n\t\t\t$switched_blog = true;\n\t\t}\n\t}\n\n\t$post_id = url_to_postid( $url );\n\n\t/** This filter is documented in wp-includes/class-wp-oembed-controller.php */\n\t$post_id = apply_filters( 'oembed_request_post_id', $post_id, $url );\n\n\tif ( ! $post_id ) {\n\t\tif ( $switched_blog ) {\n\t\t\trestore_current_blog();\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t$width = isset( $args['width'] ) ? $args['width'] : 0;\n\n\t$data = get_oembed_response_data( $post_id, $width );\n\n\tif ( $switched_blog ) {\n\t\trestore_current_blog();\n\t}\n\n\treturn $data ? (object) $data : false;\n}\n\n\n/**\n * Filters the oEmbed response data to return an iframe embed code.\n *\n * @since 4.4.0\n *\n * @param array   $data   The response data.\n * @param WP_Post $post   The post object.\n * @param int     $width  The requested width.\n * @param int     $height The calculated height.\n * @return array The modified response data.\n */\nfunction get_oembed_response_data_rich( $data, $post, $width, $height ) {\n\t$data['width']  = absint( $width );\n\t$data['height'] = absint( $height );\n\t$data['type']   = 'rich';\n\t$data['html']   = get_post_embed_html( $width, $height, $post );\n\n\t// Add post thumbnail to response if available.\n\t$thumbnail_id = false;\n\n\tif ( has_post_thumbnail( $post->ID ) ) {\n\t\t$thumbnail_id = get_post_thumbnail_id( $post->ID );\n\t}\n\n\tif ( 'attachment' === get_post_type( $post ) ) {\n\t\tif ( wp_attachment_is_image( $post ) ) {\n\t\t\t$thumbnail_id = $post->ID;\n\t\t} elseif ( wp_attachment_is( 'video', $post ) ) {\n\t\t\t$thumbnail_id = get_post_thumbnail_id( $post );\n\t\t\t$data['type'] = 'video';\n\t\t}\n\t}\n\n\tif ( $thumbnail_id ) {\n\t\tlist( $thumbnail_url, $thumbnail_width, $thumbnail_height ) = wp_get_attachment_image_src( $thumbnail_id, array( $width, 99999 ) );\n\t\t$data['thumbnail_url']                                      = $thumbnail_url;\n\t\t$data['thumbnail_width']                                    = $thumbnail_width;\n\t\t$data['thumbnail_height']                                   = $thumbnail_height;\n\t}\n\n\treturn $data;\n}\n\n/**\n * Ensures that the specified format is either 'json' or 'xml'.\n *\n * @since 4.4.0\n *\n * @param string $format The oEmbed response format. Accepts 'json' or 'xml'.\n * @return string The format, either 'xml' or 'json'. Default 'json'.\n */\nfunction wp_oembed_ensure_format( $format ) {\n\tif ( ! in_array( $format, array( 'json', 'xml' ), true ) ) {\n\t\treturn 'json';\n\t}\n\n\treturn $format;\n}\n\n/**\n * Hooks into the REST API output to print XML instead of JSON.\n *\n * This is only done for the oEmbed API endpoint,\n * which supports both formats.\n *\n * @access private\n * @since 4.4.0\n *\n * @param bool                      $served  Whether the request has already been served.\n * @param WP_HTTP_ResponseInterface $result  Result to send to the client. Usually a WP_REST_Response.\n * @param WP_REST_Request           $request Request used to generate the response.\n * @param WP_REST_Server            $server  Server instance.\n * @return true\n */\nfunction _oembed_rest_pre_serve_request( $served, $result, $request, $server ) {\n\t$params = $request->get_params();\n\n\tif ( '/oembed/1.0/embed' !== $request->get_route() || 'GET' !== $request->get_method() ) {\n\t\treturn $served;\n\t}\n\n\tif ( ! isset( $params['format'] ) || 'xml' !== $params['format'] ) {\n\t\treturn $served;\n\t}\n\n\t// Embed links inside the request.\n\t$data = $server->response_to_data( $result, false );\n\n\tif ( ! class_exists( 'SimpleXMLElement' ) ) {\n\t\tstatus_header( 501 );\n\t\tdie( get_status_header_desc( 501 ) );\n\t}\n\n\t$result = _oembed_create_xml( $data );\n\n\t// Bail if there's no XML.\n\tif ( ! $result ) {\n\t\tstatus_header( 501 );\n\t\treturn get_status_header_desc( 501 );\n\t}\n\n\tif ( ! headers_sent() ) {\n\t\t$server->send_header( 'Content-Type', 'text/xml; charset=' . get_option( 'blog_charset' ) );\n\t}\n\n\techo $result;\n\n\treturn true;\n}\n\n/**\n * Creates an XML string from a given array.\n *\n * @since 4.4.0\n * @access private\n *\n * @param array            $data The original oEmbed response data.\n * @param SimpleXMLElement $node Optional. XML node to append the result to recursively.\n * @return string|false XML string on success, false on error.\n */\nfunction _oembed_create_xml( $data, $node = null ) {\n\tif ( ! is_array( $data ) || empty( $data ) ) {\n\t\treturn false;\n\t}\n\n\tif ( null === $node ) {\n\t\t$node = new SimpleXMLElement( '<oembed></oembed>' );\n\t}\n\n\tforeach ( $data as $key => $value ) {\n\t\tif ( is_numeric( $key ) ) {\n\t\t\t$key = 'oembed';\n\t\t}\n\n\t\tif ( is_array( $value ) ) {\n\t\t\t$item = $node->addChild( $key );\n\t\t\t_oembed_create_xml( $value, $item );\n\t\t} else {\n\t\t\t$node->addChild( $key, esc_html( $value ) );\n\t\t}\n\t}\n\n\treturn $node->asXML();\n}\n\n/**\n * Filters the given oEmbed HTML to make sure iframes have a title attribute.\n *\n * @since 5.2.0\n *\n * @param string $result The oEmbed HTML result.\n * @param object $data   A data object result from an oEmbed provider.\n * @param string $url    The URL of the content to be embedded.\n * @return string The filtered oEmbed result.\n */\nfunction wp_filter_oembed_iframe_title_attribute( $result, $data, $url ) {\n\tif ( false === $result || ! in_array( $data->type, array( 'rich', 'video' ), true ) ) {\n\t\treturn $result;\n\t}\n\n\t$title = ! empty( $data->title ) ? $data->title : '';\n\n\t$pattern = '`<iframe([^>]*)>`i';\n\tif ( preg_match( $pattern, $result, $matches ) ) {\n\t\t$attrs = wp_kses_hair( $matches[1], wp_allowed_protocols() );\n\n\t\tforeach ( $attrs as $attr => $item ) {\n\t\t\t$lower_attr = strtolower( $attr );\n\t\t\tif ( $lower_attr === $attr ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( ! isset( $attrs[ $lower_attr ] ) ) {\n\t\t\t\t$attrs[ $lower_attr ] = $item;\n\t\t\t\tunset( $attrs[ $attr ] );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! empty( $attrs['title']['value'] ) ) {\n\t\t$title = $attrs['title']['value'];\n\t}\n\n\t/**\n\t * Filters the title attribute of the given oEmbed HTML iframe.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string $title  The title attribute.\n\t * @param string $result The oEmbed HTML result.\n\t * @param object $data   A data object result from an oEmbed provider.\n\t * @param string $url    The URL of the content to be embedded.\n\t */\n\t$title = apply_filters( 'oembed_iframe_title_attribute', $title, $result, $data, $url );\n\n\tif ( '' === $title ) {\n\t\treturn $result;\n\t}\n\n\tif ( isset( $attrs['title'] ) ) {\n\t\tunset( $attrs['title'] );\n\t\t$attr_string = join( ' ', wp_list_pluck( $attrs, 'whole' ) );\n\t\t$result      = str_replace( $matches[0], '<iframe ' . trim( $attr_string ) . '>', $result );\n\t}\n\treturn str_ireplace( '<iframe ', sprintf( '<iframe title=\"%s\" ', esc_attr( $title ) ), $result );\n}\n\n\n/**\n * Filters the given oEmbed HTML.\n *\n * If the `$url` isn't on the trusted providers list,\n * we need to filter the HTML heavily for security.\n *\n * Only filters 'rich' and 'video' response types.\n *\n * @since 4.4.0\n *\n * @param string $result The oEmbed HTML result.\n * @param object $data   A data object result from an oEmbed provider.\n * @param string $url    The URL of the content to be embedded.\n * @return string The filtered and sanitized oEmbed result.\n */\nfunction wp_filter_oembed_result( $result, $data, $url ) {\n\tif ( false === $result || ! in_array( $data->type, array( 'rich', 'video' ), true ) ) {\n\t\treturn $result;\n\t}\n\n\t$wp_oembed = _wp_oembed_get_object();\n\n\t// Don't modify the HTML for trusted providers.\n\tif ( false !== $wp_oembed->get_provider( $url, array( 'discover' => false ) ) ) {\n\t\treturn $result;\n\t}\n\n\t$allowed_html = array(\n\t\t'a'          => array(\n\t\t\t'href' => true,\n\t\t),\n\t\t'blockquote' => array(),\n\t\t'iframe'     => array(\n\t\t\t'src'          => true,\n\t\t\t'width'        => true,\n\t\t\t'height'       => true,\n\t\t\t'frameborder'  => true,\n\t\t\t'marginwidth'  => true,\n\t\t\t'marginheight' => true,\n\t\t\t'scrolling'    => true,\n\t\t\t'title'        => true,\n\t\t),\n\t);\n\n\t$html = wp_kses( $result, $allowed_html );\n\n\tpreg_match( '|(<blockquote>.*?</blockquote>)?.*(<iframe.*?></iframe>)|ms', $html, $content );\n\t// We require at least the iframe to exist.\n\tif ( empty( $content[2] ) ) {\n\t\treturn false;\n\t}\n\t$html = $content[1] . $content[2];\n\n\tpreg_match( '/ src=([\\'\"])(.*?)\\1/', $html, $results );\n\n\tif ( ! empty( $results ) ) {\n\t\t$secret = wp_generate_password( 10, false );\n\n\t\t$url = esc_url( \"{$results[2]}#?secret=$secret\" );\n\t\t$q   = $results[1];\n\n\t\t$html = str_replace( $results[0], ' src=' . $q . $url . $q . ' data-secret=' . $q . $secret . $q, $html );\n\t\t$html = str_replace( '<blockquote', \"<blockquote data-secret=\\\"$secret\\\"\", $html );\n\t}\n\n\t$allowed_html['blockquote']['data-secret'] = true;\n\t$allowed_html['iframe']['data-secret']     = true;\n\n\t$html = wp_kses( $html, $allowed_html );\n\n\tif ( ! empty( $content[1] ) ) {\n\t\t// We have a blockquote to fall back on. Hide the iframe by default.\n\t\t$html = str_replace( '<iframe', '<iframe style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\"', $html );\n\t\t$html = str_replace( '<blockquote', '<blockquote class=\"wp-embedded-content\"', $html );\n\t}\n\n\t$html = str_ireplace( '<iframe', '<iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\"', $html );\n\n\treturn $html;\n}\n\n/**\n * Filters the string in the 'more' link displayed after a trimmed excerpt.\n *\n * Replaces '[...]' (appended to automatically generated excerpts) with an\n * ellipsis and a \"Continue reading\" link in the embed template.\n *\n * @since 4.4.0\n *\n * @param string $more_string Default 'more' string.\n * @return string 'Continue reading' link prepended with an ellipsis.\n */\nfunction wp_embed_excerpt_more( $more_string ) {\n\tif ( ! is_embed() ) {\n\t\treturn $more_string;\n\t}\n\n\t$link = sprintf(\n\t\t'<a href=\"%1$s\" class=\"wp-embed-more\" target=\"_top\">%2$s</a>',\n\t\tesc_url( get_permalink() ),\n\t\t/* translators: %s: Post title. */\n\t\tsprintf( __( 'Continue reading %s' ), '<span class=\"screen-reader-text\">' . get_the_title() . '</span>' )\n\t);\n\treturn ' &hellip; ' . $link;\n}\n\n/**\n * Displays the post excerpt for the embed template.\n *\n * Intended to be used in 'The Loop'.\n *\n * @since 4.4.0\n */\nfunction the_excerpt_embed() {\n\t$output = get_the_excerpt();\n\n\t/**\n\t * Filters the post excerpt for the embed template.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $output The current post excerpt.\n\t */\n\techo apply_filters( 'the_excerpt_embed', $output );\n}\n\n/**\n * Filters the post excerpt for the embed template.\n *\n * Shows players for video and audio attachments.\n *\n * @since 4.4.0\n *\n * @param string $content The current post excerpt.\n * @return string The modified post excerpt.\n */\nfunction wp_embed_excerpt_attachment( $content ) {\n\tif ( is_attachment() ) {\n\t\treturn prepend_attachment( '' );\n\t}\n\n\treturn $content;\n}\n\n/**\n * Enqueue embed iframe default CSS and JS & fire do_action('enqueue_embed_scripts')\n *\n * Enqueue PNG fallback CSS for embed iframe for legacy versions of IE.\n *\n * Allows plugins to queue scripts for the embed iframe end using wp_enqueue_script().\n * Runs first in oembed_head().\n *\n * @since 4.4.0\n */\nfunction enqueue_embed_scripts() {\n\twp_enqueue_style( 'wp-embed-template-ie' );\n\n\t/**\n\t * Fires when scripts and styles are enqueued for the embed iframe.\n\t *\n\t * @since 4.4.0\n\t */\n\tdo_action( 'enqueue_embed_scripts' );\n}\n\n/**\n * Prints the CSS in the embed iframe header.\n *\n * @since 4.4.0\n */\nfunction print_embed_styles() {\n\t$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type=\"text/css\"';\n\t?>\n\t<style<?php echo $type_attr; ?>>\n\t<?php\n\tif ( SCRIPT_DEBUG ) {\n\t\treadfile( ABSPATH . WPINC . '/css/wp-embed-template.css' );\n\t} else {\n\t\t/*\n\t\t * If you're looking at a src version of this file, you'll see an \"include\"\n\t\t * statement below. This is used by the `npm run build` process to directly\n\t\t * include a minified version of wp-oembed-embed.css, instead of using the\n\t\t * readfile() method from above.\n\t\t *\n\t\t * If you're looking at a build version of this file, you'll see a string of\n\t\t * minified CSS. If you need to debug it, please turn on SCRIPT_DEBUG\n\t\t * and edit wp-embed-template.css directly.\n\t\t */\n\t\t?>\n\t\t\t/*! This file is auto-generated */\n\t\t\tbody,html{padding:0;margin:0}body{font-family:sans-serif}.screen-reader-text{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.dashicons{display:inline-block;width:20px;height:20px;background-color:transparent;background-repeat:no-repeat;background-size:20px;background-position:center;transition:background .1s ease-in;position:relative;top:5px}.dashicons-no{background-image:url(\"data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M15.55%2013.7l-2.19%202.06-3.42-3.65-3.64%203.43-2.06-2.18%203.64-3.43-3.42-3.64%202.18-2.06%203.43%203.64%203.64-3.42%202.05%202.18-3.64%203.43z%27%20fill%3D%27%23fff%27%2F%3E%3C%2Fsvg%3E\")}.dashicons-admin-comments{background-image:url(\"data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M5%202h9q.82%200%201.41.59T16%204v7q0%20.82-.59%201.41T14%2013h-2l-5%205v-5H5q-.82%200-1.41-.59T3%2011V4q0-.82.59-1.41T5%202z%27%20fill%3D%27%2382878c%27%2F%3E%3C%2Fsvg%3E\")}.wp-embed-comments a:hover .dashicons-admin-comments{background-image:url(\"data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M5%202h9q.82%200%201.41.59T16%204v7q0%20.82-.59%201.41T14%2013h-2l-5%205v-5H5q-.82%200-1.41-.59T3%2011V4q0-.82.59-1.41T5%202z%27%20fill%3D%27%230073aa%27%2F%3E%3C%2Fsvg%3E\")}.dashicons-share{background-image:url(\"data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.5%2012q1.24%200%202.12.88T17.5%2015t-.88%202.12-2.12.88-2.12-.88T11.5%2015q0-.34.09-.69l-4.38-2.3Q6.32%2013%205%2013q-1.24%200-2.12-.88T2%2010t.88-2.12T5%207q1.3%200%202.21.99l4.38-2.3q-.09-.35-.09-.69%200-1.24.88-2.12T14.5%202t2.12.88T17.5%205t-.88%202.12T14.5%208q-1.3%200-2.21-.99l-4.38%202.3Q8%209.66%208%2010t-.09.69l4.38%202.3q.89-.99%202.21-.99z%27%20fill%3D%27%2382878c%27%2F%3E%3C%2Fsvg%3E\");display:none}.js .dashicons-share{display:inline-block}.wp-embed-share-dialog-open:hover .dashicons-share{background-image:url(\"data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.5%2012q1.24%200%202.12.88T17.5%2015t-.88%202.12-2.12.88-2.12-.88T11.5%2015q0-.34.09-.69l-4.38-2.3Q6.32%2013%205%2013q-1.24%200-2.12-.88T2%2010t.88-2.12T5%207q1.3%200%202.21.99l4.38-2.3q-.09-.35-.09-.69%200-1.24.88-2.12T14.5%202t2.12.88T17.5%205t-.88%202.12T14.5%208q-1.3%200-2.21-.99l-4.38%202.3Q8%209.66%208%2010t-.09.69l4.38%202.3q.89-.99%202.21-.99z%27%20fill%3D%27%230073aa%27%2F%3E%3C%2Fsvg%3E\")}.wp-embed{padding:25px;font-size:14px;font-weight:400;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif;line-height:1.5;color:#82878c;background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.05);overflow:auto;zoom:1}.wp-embed a{color:#82878c;text-decoration:none}.wp-embed a:hover{text-decoration:underline}.wp-embed-featured-image{margin-bottom:20px}.wp-embed-featured-image img{width:100%;height:auto;border:none}.wp-embed-featured-image.square{float:left;max-width:160px;margin-right:20px}.wp-embed p{margin:0}p.wp-embed-heading{margin:0 0 15px;font-weight:600;font-size:22px;line-height:1.3}.wp-embed-heading a{color:#32373c}.wp-embed .wp-embed-more{color:#b4b9be}.wp-embed-footer{display:table;width:100%;margin-top:30px}.wp-embed-site-icon{position:absolute;top:50%;left:0;transform:translateY(-50%);height:25px;width:25px;border:0}.wp-embed-site-title{font-weight:600;line-height:1.78571428}.wp-embed-site-title a{position:relative;display:inline-block;padding-left:35px}.wp-embed-meta,.wp-embed-site-title{display:table-cell}.wp-embed-meta{text-align:right;white-space:nowrap;vertical-align:middle}.wp-embed-comments,.wp-embed-share{display:inline}.wp-embed-meta a:hover{text-decoration:none;color:#0073aa}.wp-embed-comments a{line-height:1.78571428;display:inline-block}.wp-embed-comments+.wp-embed-share{margin-left:10px}.wp-embed-share-dialog{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#222;background-color:rgba(10,10,10,.9);color:#fff;opacity:1;transition:opacity .25s ease-in-out}.wp-embed-share-dialog.hidden{opacity:0;visibility:hidden}.wp-embed-share-dialog-close,.wp-embed-share-dialog-open{margin:-8px 0 0;padding:0;background:0 0;border:none;cursor:pointer;outline:0}.wp-embed-share-dialog-close .dashicons,.wp-embed-share-dialog-open .dashicons{padding:4px}.wp-embed-share-dialog-open .dashicons{top:8px}.wp-embed-share-dialog-close:focus .dashicons,.wp-embed-share-dialog-open:focus .dashicons{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);border-radius:100%}.wp-embed-share-dialog-close{position:absolute;top:20px;right:20px;font-size:22px}.wp-embed-share-dialog-close:hover{text-decoration:none}.wp-embed-share-dialog-close .dashicons{height:24px;width:24px;background-size:24px}.wp-embed-share-dialog-content{height:100%;transform-style:preserve-3d;overflow:hidden}.wp-embed-share-dialog-text{margin-top:25px;padding:20px}.wp-embed-share-tabs{margin:0 0 20px;padding:0;list-style:none}.wp-embed-share-tab-button{display:inline-block}.wp-embed-share-tab-button button{margin:0;padding:0;border:none;background:0 0;font-size:16px;line-height:1.3;color:#aaa;cursor:pointer;transition:color .1s ease-in}.wp-embed-share-tab-button [aria-selected=true]{color:#fff}.wp-embed-share-tab-button button:hover{color:#fff}.wp-embed-share-tab-button+.wp-embed-share-tab-button{margin:0 0 0 10px;padding:0 0 0 11px;border-left:1px solid #aaa}.wp-embed-share-tab[aria-hidden=true]{display:none}p.wp-embed-share-description{margin:0;font-size:14px;line-height:1;font-style:italic;color:#aaa}.wp-embed-share-input{box-sizing:border-box;width:100%;border:none;height:28px;margin:0 0 10px 0;padding:0 5px;font-size:14px;font-weight:400;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif;line-height:1.5;resize:none;cursor:text}textarea.wp-embed-share-input{height:72px}html[dir=rtl] .wp-embed-featured-image.square{float:right;margin-right:0;margin-left:20px}html[dir=rtl] .wp-embed-site-title a{padding-left:0;padding-right:35px}html[dir=rtl] .wp-embed-site-icon{margin-right:0;margin-left:10px;left:auto;right:0}html[dir=rtl] .wp-embed-meta{text-align:left}html[dir=rtl] .wp-embed-share{margin-left:0;margin-right:10px}html[dir=rtl] .wp-embed-share-dialog-close{right:auto;left:20px}html[dir=rtl] .wp-embed-share-tab-button+.wp-embed-share-tab-button{margin:0 10px 0 0;padding:0 11px 0 0;border-left:none;border-right:1px solid #aaa}\n\t\t<?php\n\t}\n\t?>\n\t</style>\n\t<?php\n}\n\n/**\n * Prints the JavaScript in the embed iframe header.\n *\n * @since 4.4.0\n */\nfunction print_embed_scripts() {\n\t$type_attr = current_theme_supports( 'html5', 'script' ) ? '' : ' type=\"text/javascript\"';\n\t?>\n\t<script<?php echo $type_attr; ?>>\n\t<?php\n\tif ( SCRIPT_DEBUG ) {\n\t\treadfile( ABSPATH . WPINC . '/js/wp-embed-template.js' );\n\t} else {\n\t\t/*\n\t\t * If you're looking at a src version of this file, you'll see an \"include\"\n\t\t * statement below. This is used by the `npm run build` process to directly\n\t\t * include a minified version of wp-embed-template.js, instead of using the\n\t\t * readfile() method from above.\n\t\t *\n\t\t * If you're looking at a build version of this file, you'll see a string of\n\t\t * minified JavaScript. If you need to debug it, please turn on SCRIPT_DEBUG\n\t\t * and edit wp-embed-template.js directly.\n\t\t */\n\t\t?>\n\t\t\t/*! This file is auto-generated */\n\t\t\t!function(u,c){\"use strict\";var r,t,e,i=c.querySelector&&u.addEventListener,b=!1;function f(e,t){u.parent.postMessage({message:e,value:t,secret:r},\"*\")}function n(){if(!b){b=!0;var e,t=c.querySelector(\".wp-embed-share-dialog\"),r=c.querySelector(\".wp-embed-share-dialog-open\"),i=c.querySelector(\".wp-embed-share-dialog-close\"),n=c.querySelectorAll(\".wp-embed-share-input\"),a=c.querySelectorAll(\".wp-embed-share-tab-button button\"),o=c.querySelector(\".wp-embed-featured-image img\");if(n)for(e=0;e<n.length;e++)n[e].addEventListener(\"click\",function(e){e.target.select()});if(r&&r.addEventListener(\"click\",function(){t.className=t.className.replace(\"hidden\",\"\"),c.querySelector('.wp-embed-share-tab-button [aria-selected=\"true\"]').focus()}),i&&i.addEventListener(\"click\",function(){l()}),a)for(e=0;e<a.length;e++)a[e].addEventListener(\"click\",s),a[e].addEventListener(\"keydown\",d);c.addEventListener(\"keydown\",function(e){27===e.keyCode&&-1===t.className.indexOf(\"hidden\")?l():9===e.keyCode&&function(e){var t=c.querySelector('.wp-embed-share-tab-button [aria-selected=\"true\"]');i!==e.target||e.shiftKey?t===e.target&&e.shiftKey&&(i.focus(),e.preventDefault()):(t.focus(),e.preventDefault())}(e)},!1),u.self!==u.top&&(f(\"height\",Math.ceil(c.body.getBoundingClientRect().height)),o&&o.addEventListener(\"load\",function(){f(\"height\",Math.ceil(c.body.getBoundingClientRect().height))}),c.addEventListener(\"click\",function(e){var t,r=e.target;(t=r.hasAttribute(\"href\")?r.getAttribute(\"href\"):r.parentElement.getAttribute(\"href\"))&&(f(\"link\",t),e.preventDefault())}))}function l(){t.className+=\" hidden\",c.querySelector(\".wp-embed-share-dialog-open\").focus()}function s(e){var t=c.querySelector('.wp-embed-share-tab-button [aria-selected=\"true\"]');t.setAttribute(\"aria-selected\",\"false\"),c.querySelector(\"#\"+t.getAttribute(\"aria-controls\")).setAttribute(\"aria-hidden\",\"true\"),e.target.setAttribute(\"aria-selected\",\"true\"),c.querySelector(\"#\"+e.target.getAttribute(\"aria-controls\")).setAttribute(\"aria-hidden\",\"false\")}function d(e){var t,r,i=e.target,n=i.parentElement.previousElementSibling,a=i.parentElement.nextElementSibling;if(37===e.keyCode)t=n;else{if(39!==e.keyCode)return!1;t=a}\"rtl\"===c.documentElement.getAttribute(\"dir\")&&(t=t===n?a:n),t&&(r=t.firstElementChild,i.setAttribute(\"tabindex\",\"-1\"),i.setAttribute(\"aria-selected\",!1),c.querySelector(\"#\"+i.getAttribute(\"aria-controls\")).setAttribute(\"aria-hidden\",\"true\"),r.setAttribute(\"tabindex\",\"0\"),r.setAttribute(\"aria-selected\",\"true\"),r.focus(),c.querySelector(\"#\"+r.getAttribute(\"aria-controls\")).setAttribute(\"aria-hidden\",\"false\"))}}i&&(!function e(){u.self===u.top||r||(r=u.location.hash.replace(/.*secret=([\\d\\w]{10}).*/,\"$1\"),clearTimeout(t),t=setTimeout(function(){e()},100))}(),c.documentElement.className=c.documentElement.className.replace(/\\bno-js\\b/,\"\")+\" js\",c.addEventListener(\"DOMContentLoaded\",n,!1),u.addEventListener(\"load\",n,!1),u.addEventListener(\"resize\",function(){u.self!==u.top&&(clearTimeout(e),e=setTimeout(function(){f(\"height\",Math.ceil(c.body.getBoundingClientRect().height))},100))},!1))}(window,document);\n\t\t<?php\n\t}\n\t?>\n\t</script>\n\t<?php\n}\n\n/**\n * Prepare the oembed HTML to be displayed in an RSS feed.\n *\n * @since 4.4.0\n * @access private\n *\n * @param string $content The content to filter.\n * @return string The filtered content.\n */\nfunction _oembed_filter_feed_content( $content ) {\n\treturn str_replace( '<iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\"', '<iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\"', $content );\n}\n\n/**\n * Prints the necessary markup for the embed comments button.\n *\n * @since 4.4.0\n */\nfunction print_embed_comments_button() {\n\tif ( is_404() || ! ( get_comments_number() || comments_open() ) ) {\n\t\treturn;\n\t}\n\t?>\n\t<div class=\"wp-embed-comments\">\n\t\t<a href=\"<?php comments_link(); ?>\" target=\"_top\">\n\t\t\t<span class=\"dashicons dashicons-admin-comments\"></span>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: Number of comments. */\n\t\t\t\t_n(\n\t\t\t\t\t'%s <span class=\"screen-reader-text\">Comment</span>',\n\t\t\t\t\t'%s <span class=\"screen-reader-text\">Comments</span>',\n\t\t\t\t\tget_comments_number()\n\t\t\t\t),\n\t\t\t\tnumber_format_i18n( get_comments_number() )\n\t\t\t);\n\t\t\t?>\n\t\t</a>\n\t</div>\n\t<?php\n}\n\n/**\n * Prints the necessary markup for the embed sharing button.\n *\n * @since 4.4.0\n */\nfunction print_embed_sharing_button() {\n\tif ( is_404() ) {\n\t\treturn;\n\t}\n\t?>\n\t<div class=\"wp-embed-share\">\n\t\t<button type=\"button\" class=\"wp-embed-share-dialog-open\" aria-label=\"<?php esc_attr_e( 'Open sharing dialog' ); ?>\">\n\t\t\t<span class=\"dashicons dashicons-share\"></span>\n\t\t</button>\n\t</div>\n\t<?php\n}\n\n/**\n * Prints the necessary markup for the embed sharing dialog.\n *\n * @since 4.4.0\n */\nfunction print_embed_sharing_dialog() {\n\tif ( is_404() ) {\n\t\treturn;\n\t}\n\t?>\n\t<div class=\"wp-embed-share-dialog hidden\" role=\"dialog\" aria-label=\"<?php esc_attr_e( 'Sharing options' ); ?>\">\n\t\t<div class=\"wp-embed-share-dialog-content\">\n\t\t\t<div class=\"wp-embed-share-dialog-text\">\n\t\t\t\t<ul class=\"wp-embed-share-tabs\" role=\"tablist\">\n\t\t\t\t\t<li class=\"wp-embed-share-tab-button wp-embed-share-tab-button-wordpress\" role=\"presentation\">\n\t\t\t\t\t\t<button type=\"button\" role=\"tab\" aria-controls=\"wp-embed-share-tab-wordpress\" aria-selected=\"true\" tabindex=\"0\"><?php esc_html_e( 'WordPress Embed' ); ?></button>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class=\"wp-embed-share-tab-button wp-embed-share-tab-button-html\" role=\"presentation\">\n\t\t\t\t\t\t<button type=\"button\" role=\"tab\" aria-controls=\"wp-embed-share-tab-html\" aria-selected=\"false\" tabindex=\"-1\"><?php esc_html_e( 'HTML Embed' ); ?></button>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t\t<div id=\"wp-embed-share-tab-wordpress\" class=\"wp-embed-share-tab\" role=\"tabpanel\" aria-hidden=\"false\">\n\t\t\t\t\t<input type=\"text\" value=\"<?php the_permalink(); ?>\" class=\"wp-embed-share-input\" aria-describedby=\"wp-embed-share-description-wordpress\" tabindex=\"0\" readonly/>\n\n\t\t\t\t\t<p class=\"wp-embed-share-description\" id=\"wp-embed-share-description-wordpress\">\n\t\t\t\t\t\t<?php _e( 'Copy and paste this URL into your WordPress site to embed' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<div id=\"wp-embed-share-tab-html\" class=\"wp-embed-share-tab\" role=\"tabpanel\" aria-hidden=\"true\">\n\t\t\t\t\t<textarea class=\"wp-embed-share-input\" aria-describedby=\"wp-embed-share-description-html\" tabindex=\"0\" readonly><?php echo esc_textarea( get_post_embed_html( 600, 400 ) ); ?></textarea>\n\n\t\t\t\t\t<p class=\"wp-embed-share-description\" id=\"wp-embed-share-description-html\">\n\t\t\t\t\t\t<?php _e( 'Copy and paste this code into your site to embed' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<button type=\"button\" class=\"wp-embed-share-dialog-close\" aria-label=\"<?php esc_attr_e( 'Close sharing dialog' ); ?>\">\n\t\t\t\t<span class=\"dashicons dashicons-no\"></span>\n\t\t\t</button>\n\t\t</div>\n\t</div>\n\t<?php\n}\n\n/**\n * Prints the necessary markup for the site title in an embed template.\n *\n * @since 4.5.0\n */\nfunction the_embed_site_title() {\n\t$site_title = sprintf(\n\t\t'<a href=\"%s\" target=\"_top\"><img src=\"%s\" srcset=\"%s 2x\" width=\"32\" height=\"32\" alt=\"\" class=\"wp-embed-site-icon\"/><span>%s</span></a>',\n\t\tesc_url( home_url() ),\n\t\tesc_url( get_site_icon_url( 32, includes_url( 'images/w-logo-blue.png' ) ) ),\n\t\tesc_url( get_site_icon_url( 64, includes_url( 'images/w-logo-blue.png' ) ) ),\n\t\tesc_html( get_bloginfo( 'name' ) )\n\t);\n\n\t$site_title = '<div class=\"wp-embed-site-title\">' . $site_title . '</div>';\n\n\t/**\n\t * Filters the site title HTML in the embed footer.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $site_title The site title HTML.\n\t */\n\techo apply_filters( 'embed_site_title_html', $site_title );\n}\n\n/**\n * Filters the oEmbed result before any HTTP requests are made.\n *\n * If the URL belongs to the current site, the result is fetched directly instead of\n * going through the oEmbed discovery process.\n *\n * @since 4.5.3\n *\n * @param null|string $result The UNSANITIZED (and potentially unsafe) HTML that should be used to embed. Default null.\n * @param string      $url    The URL that should be inspected for discovery `<link>` tags.\n * @param array       $args   oEmbed remote get arguments.\n * @return null|string The UNSANITIZED (and potentially unsafe) HTML that should be used to embed.\n *                     Null if the URL does not belong to the current site.\n */\nfunction wp_filter_pre_oembed_result( $result, $url, $args ) {\n\t$data = get_oembed_response_data_for_url( $url, $args );\n\n\tif ( $data ) {\n\t\treturn _wp_oembed_get_object()->data2html( $data, $url );\n\t}\n\n\treturn $result;\n}\n", "num_lines": 1242}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Error Protection API: Functions\n *\n * @package WordPress\n * @since 5.2.0\n */\n\n/**\n * Get the instance for storing paused plugins.\n *\n * @return WP_Paused_Extensions_Storage\n */\nfunction wp_paused_plugins() {\n\tstatic $storage = null;\n\n\tif ( null === $storage ) {\n\t\t$storage = new WP_Paused_Extensions_Storage( 'plugin' );\n\t}\n\n\treturn $storage;\n}\n\n/**\n * Get the instance for storing paused extensions.\n *\n * @return WP_Paused_Extensions_Storage\n */\nfunction wp_paused_themes() {\n\tstatic $storage = null;\n\n\tif ( null === $storage ) {\n\t\t$storage = new WP_Paused_Extensions_Storage( 'theme' );\n\t}\n\n\treturn $storage;\n}\n\n/**\n * Get a human readable description of an extension's error.\n *\n * @since 5.2.0\n *\n * @param array $error Error details {@see error_get_last()}\n * @return string Formatted error description.\n */\nfunction wp_get_extension_error_description( $error ) {\n\t$constants   = get_defined_constants( true );\n\t$constants   = isset( $constants['Core'] ) ? $constants['Core'] : $constants['internal'];\n\t$core_errors = array();\n\n\tforeach ( $constants as $constant => $value ) {\n\t\tif ( 0 === strpos( $constant, 'E_' ) ) {\n\t\t\t$core_errors[ $value ] = $constant;\n\t\t}\n\t}\n\n\tif ( isset( $core_errors[ $error['type'] ] ) ) {\n\t\t$error['type'] = $core_errors[ $error['type'] ];\n\t}\n\n\t/* translators: 1: Error type, 2: Error line number, 3: Error file name, 4: Error message. */\n\t$error_message = __( 'An error of type %1$s was caused in line %2$s of the file %3$s. Error message: %4$s' );\n\n\treturn sprintf(\n\t\t$error_message,\n\t\t\"<code>{$error['type']}</code>\",\n\t\t\"<code>{$error['line']}</code>\",\n\t\t\"<code>{$error['file']}</code>\",\n\t\t\"<code>{$error['message']}</code>\"\n\t);\n}\n\n/**\n * Registers the shutdown handler for fatal errors.\n *\n * The handler will only be registered if {@see wp_is_fatal_error_handler_enabled()} returns true.\n *\n * @since 5.2.0\n */\nfunction wp_register_fatal_error_handler() {\n\tif ( ! wp_is_fatal_error_handler_enabled() ) {\n\t\treturn;\n\t}\n\n\t$handler = null;\n\tif ( defined( 'WP_CONTENT_DIR' ) && is_readable( WP_CONTENT_DIR . '/fatal-error-handler.php' ) ) {\n\t\t$handler = include WP_CONTENT_DIR . '/fatal-error-handler.php';\n\t}\n\n\tif ( ! is_object( $handler ) || ! is_callable( array( $handler, 'handle' ) ) ) {\n\t\t$handler = new WP_Fatal_Error_Handler();\n\t}\n\n\tregister_shutdown_function( array( $handler, 'handle' ) );\n}\n\n/**\n * Checks whether the fatal error handler is enabled.\n *\n * A constant `WP_DISABLE_FATAL_ERROR_HANDLER` can be set in `wp-config.php` to disable it, or alternatively the\n * {@see 'wp_fatal_error_handler_enabled'} filter can be used to modify the return value.\n *\n * @since 5.2.0\n *\n * @return bool True if the fatal error handler is enabled, false otherwise.\n */\nfunction wp_is_fatal_error_handler_enabled() {\n\t$enabled = ! defined( 'WP_DISABLE_FATAL_ERROR_HANDLER' ) || ! WP_DISABLE_FATAL_ERROR_HANDLER;\n\n\t/**\n\t * Filters whether the fatal error handler is enabled.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param bool $enabled True if the fatal error handler is enabled, false otherwise.\n\t */\n\treturn apply_filters( 'wp_fatal_error_handler_enabled', $enabled );\n}\n\n/**\n * Access the WordPress Recovery Mode instance.\n *\n * @since 5.2.0\n *\n * @return WP_Recovery_Mode\n */\nfunction wp_recovery_mode() {\n\tstatic $wp_recovery_mode;\n\n\tif ( ! $wp_recovery_mode ) {\n\t\t$wp_recovery_mode = new WP_Recovery_Mode();\n\t}\n\n\treturn $wp_recovery_mode;\n}\n", "num_lines": 137}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Atom Feed Template for displaying Atom Comments feed.\n *\n * @package WordPress\n */\n\nheader( 'Content-Type: ' . feed_content_type( 'atom' ) . '; charset=' . get_option( 'blog_charset' ), true );\necho '<?xml version=\"1.0\" encoding=\"' . get_option( 'blog_charset' ) . '\" ?' . '>';\n\n/** This action is documented in wp-includes/feed-rss2.php */\ndo_action( 'rss_tag_pre', 'atom-comments' );\n?>\n<feed\n\txmlns=\"http://www.w3.org/2005/Atom\"\n\txml:lang=\"<?php bloginfo_rss( 'language' ); ?>\"\n\txmlns:thr=\"http://purl.org/syndication/thread/1.0\"\n\t<?php\n\t\t/** This action is documented in wp-includes/feed-atom.php */\n\t\tdo_action( 'atom_ns' );\n\n\t\t/**\n\t\t * Fires inside the feed tag in the Atom comment feed.\n\t\t *\n\t\t * @since 2.8.0\n\t\t */\n\t\tdo_action( 'atom_comments_ns' );\n\t?>\n>\n\t<title type=\"text\">\n\t<?php\n\tif ( is_singular() ) {\n\t\t/* translators: Comments feed title. %s: Post title. */\n\t\tprintf( ent2ncr( __( 'Comments on %s' ) ), get_the_title_rss() );\n\t} elseif ( is_search() ) {\n\t\t/* translators: Comments feed title. 1: Site title, 2: Search query. */\n\t\tprintf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );\n\t} else {\n\t\t/* translators: Comments feed title. %s: Site title. */\n\t\tprintf( ent2ncr( __( 'Comments for %s' ) ), get_wp_title_rss() );\n\t}\n\t?>\n\t</title>\n\t<subtitle type=\"text\"><?php bloginfo_rss( 'description' ); ?></subtitle>\n\n\t<updated><?php echo get_feed_build_date( 'Y-m-d\\TH:i:s\\Z' ); ?></updated>\n\n<?php if ( is_singular() ) : ?>\n\t<link rel=\"alternate\" type=\"<?php bloginfo_rss( 'html_type' ); ?>\" href=\"<?php comments_link_feed(); ?>\" />\n\t<link rel=\"self\" type=\"application/atom+xml\" href=\"<?php echo esc_url( get_post_comments_feed_link( '', 'atom' ) ); ?>\" />\n\t<id><?php echo esc_url( get_post_comments_feed_link( '', 'atom' ) ); ?></id>\n<?php elseif ( is_search() ) : ?>\n\t<link rel=\"alternate\" type=\"<?php bloginfo_rss( 'html_type' ); ?>\" href=\"<?php echo home_url() . '?s=' . get_search_query(); ?>\" />\n\t<link rel=\"self\" type=\"application/atom+xml\" href=\"<?php echo get_search_comments_feed_link( '', 'atom' ); ?>\" />\n\t<id><?php echo get_search_comments_feed_link( '', 'atom' ); ?></id>\n<?php else : ?>\n\t<link rel=\"alternate\" type=\"<?php bloginfo_rss( 'html_type' ); ?>\" href=\"<?php bloginfo_rss( 'url' ); ?>\" />\n\t<link rel=\"self\" type=\"application/atom+xml\" href=\"<?php bloginfo_rss( 'comments_atom_url' ); ?>\" />\n\t<id><?php bloginfo_rss( 'comments_atom_url' ); ?></id>\n<?php endif; ?>\n<?php\n\t/**\n\t * Fires at the end of the Atom comment feed header.\n\t *\n\t * @since 2.8.0\n\t */\n\tdo_action( 'comments_atom_head' );\n?>\n<?php\nwhile ( have_comments() ) :\n\tthe_comment();\n\t$comment_post    = get_post( $comment->comment_post_ID );\n\t$GLOBALS['post'] = $comment_post;\n\t?>\n\t<entry>\n\t\t<title>\n\t\t<?php\n\t\tif ( ! is_singular() ) {\n\t\t\t$title = get_the_title( $comment_post->ID );\n\t\t\t/** This filter is documented in wp-includes/feed.php */\n\t\t\t$title = apply_filters( 'the_title_rss', $title );\n\t\t\t/* translators: Individual comment title. 1: Post title, 2: Comment author name. */\n\t\t\tprintf( ent2ncr( __( 'Comment on %1$s by %2$s' ) ), $title, get_comment_author_rss() );\n\t\t} else {\n\t\t\t/* translators: Comment author title. %s: Comment author name. */\n\t\t\tprintf( ent2ncr( __( 'By: %s' ) ), get_comment_author_rss() );\n\t\t}\n\t\t?>\n\t\t</title>\n\t\t<link rel=\"alternate\" href=\"<?php comment_link(); ?>\" type=\"<?php bloginfo_rss( 'html_type' ); ?>\" />\n\n\t\t<author>\n\t\t\t<name><?php comment_author_rss(); ?></name>\n\t\t\t<?php\n\t\t\tif ( get_comment_author_url() ) {\n\t\t\t\techo '<uri>' . get_comment_author_url() . '</uri>';}\n\t\t\t?>\n\n\t\t</author>\n\n\t\t<id><?php comment_guid(); ?></id>\n\t\t<updated><?php echo mysql2date( 'Y-m-d\\TH:i:s\\Z', get_comment_time( 'Y-m-d H:i:s', true, false ), false ); ?></updated>\n\t\t<published><?php echo mysql2date( 'Y-m-d\\TH:i:s\\Z', get_comment_time( 'Y-m-d H:i:s', true, false ), false ); ?></published>\n\n\t\t<?php if ( post_password_required( $comment_post ) ) : ?>\n\t\t\t<content type=\"html\" xml:base=\"<?php comment_link(); ?>\"><![CDATA[<?php echo get_the_password_form(); ?>]]></content>\n\t\t<?php else : ?>\n\t\t\t<content type=\"html\" xml:base=\"<?php comment_link(); ?>\"><![CDATA[<?php comment_text(); ?>]]></content>\n\t\t<?php endif; // End if post_password_required(). ?>\n\n\t\t<?php\n\t\t// Return comment threading information (https://www.ietf.org/rfc/rfc4685.txt).\n\t\tif ( 0 == $comment->comment_parent ) : // This comment is top-level.\n\t\t\t?>\n\t\t\t<thr:in-reply-to ref=\"<?php the_guid(); ?>\" href=\"<?php the_permalink_rss(); ?>\" type=\"<?php bloginfo_rss( 'html_type' ); ?>\" />\n\t\t\t<?php\n\t\telse : // This comment is in reply to another comment.\n\t\t\t$parent_comment = get_comment( $comment->comment_parent );\n\t\t\t/*\n\t\t\t * The rel attribute below and the id tag above should be GUIDs,\n\t\t\t * but WP doesn't create them for comments (unlike posts).\n\t\t\t * Either way, it's more important that they both use the same system.\n\t\t\t */\n\t\t\t?>\n\t\t\t<thr:in-reply-to ref=\"<?php comment_guid( $parent_comment ); ?>\" href=\"<?php echo get_comment_link( $parent_comment ); ?>\" type=\"<?php bloginfo_rss( 'html_type' ); ?>\" />\n\t\t\t<?php\n\t\tendif;\n\n\t\t/**\n\t\t * Fires at the end of each Atom comment feed item.\n\t\t *\n\t\t * @since 2.2.0\n\t\t *\n\t\t * @param int $comment_id      ID of the current comment.\n\t\t * @param int $comment_post_id ID of the post the current comment is connected to.\n\t\t */\n\t\tdo_action( 'comment_atom_entry', $comment->comment_ID, $comment_post->ID );\n\t\t?>\n\t</entry>\n\t<?php\nendwhile;\n?>\n</feed>\n", "num_lines": 144}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Atom Feed Template for displaying Atom Posts feed.\n *\n * @package WordPress\n */\n\nheader( 'Content-Type: ' . feed_content_type( 'atom' ) . '; charset=' . get_option( 'blog_charset' ), true );\n$more = 1;\n\necho '<?xml version=\"1.0\" encoding=\"' . get_option( 'blog_charset' ) . '\"?' . '>';\n\n/** This action is documented in wp-includes/feed-rss2.php */\ndo_action( 'rss_tag_pre', 'atom' );\n?>\n<feed\n\txmlns=\"http://www.w3.org/2005/Atom\"\n\txmlns:thr=\"http://purl.org/syndication/thread/1.0\"\n\txml:lang=\"<?php bloginfo_rss( 'language' ); ?>\"\n\txml:base=\"<?php bloginfo_rss( 'url' ); ?>/wp-atom.php\"\n\t<?php\n\t/**\n\t * Fires at end of the Atom feed root to add namespaces.\n\t *\n\t * @since 2.0.0\n\t */\n\tdo_action( 'atom_ns' );\n\t?>\n>\n\t<title type=\"text\"><?php wp_title_rss(); ?></title>\n\t<subtitle type=\"text\"><?php bloginfo_rss( 'description' ); ?></subtitle>\n\n\t<updated><?php echo get_feed_build_date( 'Y-m-d\\TH:i:s\\Z' ); ?></updated>\n\n\t<link rel=\"alternate\" type=\"<?php bloginfo_rss( 'html_type' ); ?>\" href=\"<?php bloginfo_rss( 'url' ); ?>\" />\n\t<id><?php bloginfo( 'atom_url' ); ?></id>\n\t<link rel=\"self\" type=\"application/atom+xml\" href=\"<?php self_link(); ?>\" />\n\n\t<?php\n\t/**\n\t * Fires just before the first Atom feed entry.\n\t *\n\t * @since 2.0.0\n\t */\n\tdo_action( 'atom_head' );\n\n\twhile ( have_posts() ) :\n\t\tthe_post();\n\t\t?>\n\t<entry>\n\t\t<author>\n\t\t\t<name><?php the_author(); ?></name>\n\t\t\t<?php\n\t\t\t$author_url = get_the_author_meta( 'url' );\n\t\t\tif ( ! empty( $author_url ) ) :\n\t\t\t\t?>\n\t\t\t\t<uri><?php the_author_meta( 'url' ); ?></uri>\n\t\t\t\t<?php\n\t\t\tendif;\n\n\t\t\t/**\n\t\t\t * Fires at the end of each Atom feed author entry.\n\t\t\t *\n\t\t\t * @since 3.2.0\n\t\t\t */\n\t\t\tdo_action( 'atom_author' );\n\t\t\t?>\n\t\t</author>\n\n\t\t<title type=\"<?php html_type_rss(); ?>\"><![CDATA[<?php the_title_rss(); ?>]]></title>\n\t\t<link rel=\"alternate\" type=\"<?php bloginfo_rss( 'html_type' ); ?>\" href=\"<?php the_permalink_rss(); ?>\" />\n\n\t\t<id><?php the_guid(); ?></id>\n\t\t<updated><?php echo get_post_modified_time( 'Y-m-d\\TH:i:s\\Z', true ); ?></updated>\n\t\t<published><?php echo get_post_time( 'Y-m-d\\TH:i:s\\Z', true ); ?></published>\n\t\t<?php the_category_rss( 'atom' ); ?>\n\n\t\t<summary type=\"<?php html_type_rss(); ?>\"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>\n\n\t\t<?php if ( ! get_option( 'rss_use_excerpt' ) ) : ?>\n\t\t\t<content type=\"<?php html_type_rss(); ?>\" xml:base=\"<?php the_permalink_rss(); ?>\"><![CDATA[<?php the_content_feed( 'atom' ); ?>]]></content>\n\t\t<?php endif; ?>\n\n\t\t<?php\n\t\tatom_enclosure();\n\n\t\t/**\n\t\t * Fires at the end of each Atom feed item.\n\t\t *\n\t\t * @since 2.0.0\n\t\t */\n\t\tdo_action( 'atom_entry' );\n\n\t\tif ( get_comments_number() || comments_open() ) :\n\t\t\t?>\n\t\t\t<link rel=\"replies\" type=\"<?php bloginfo_rss( 'html_type' ); ?>\" href=\"<?php the_permalink_rss(); ?>#comments\" thr:count=\"<?php echo get_comments_number(); ?>\"/>\n\t\t\t<link rel=\"replies\" type=\"application/atom+xml\" href=\"<?php echo esc_url( get_post_comments_feed_link( 0, 'atom' ) ); ?>\" thr:count=\"<?php echo get_comments_number(); ?>\"/>\n\t\t\t<thr:total><?php echo get_comments_number(); ?></thr:total>\n\t\t<?php endif; ?>\n\t</entry>\n\t<?php endwhile; ?>\n</feed>\n", "num_lines": 103}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * RSS 1 RDF Feed Template for displaying RSS 1 Posts feed.\n *\n * @package WordPress\n */\n\nheader( 'Content-Type: ' . feed_content_type( 'rdf' ) . '; charset=' . get_option( 'blog_charset' ), true );\n$more = 1;\n\necho '<?xml version=\"1.0\" encoding=\"' . get_option( 'blog_charset' ) . '\"?' . '>';\n\n/** This action is documented in wp-includes/feed-rss2.php */\ndo_action( 'rss_tag_pre', 'rdf' );\n?>\n<rdf:RDF\n\txmlns=\"http://purl.org/rss/1.0/\"\n\txmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n\txmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n\txmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\"\n\txmlns:admin=\"http://webns.net/mvcb/\"\n\txmlns:content=\"http://purl.org/rss/1.0/modules/content/\"\n\t<?php\n\t/**\n\t * Fires at the end of the feed root to add namespaces.\n\t *\n\t * @since 2.0.0\n\t */\n\tdo_action( 'rdf_ns' );\n\t?>\n>\n<channel rdf:about=\"<?php bloginfo_rss( 'url' ); ?>\">\n\t<title><?php wp_title_rss(); ?></title>\n\t<link><?php bloginfo_rss( 'url' ); ?></link>\n\t<description><?php bloginfo_rss( 'description' ); ?></description>\n\t<dc:date><?php echo get_feed_build_date( 'Y-m-d\\TH:i:s\\Z' ); ?>\t</dc:date>\n\t<sy:updatePeriod>\n\t<?php\n\t\t/** This filter is documented in wp-includes/feed-rss2.php */\n\t\techo apply_filters( 'rss_update_period', 'hourly' );\n\t?>\n\t</sy:updatePeriod>\n\t<sy:updateFrequency>\n\t<?php\n\t\t/** This filter is documented in wp-includes/feed-rss2.php */\n\t\techo apply_filters( 'rss_update_frequency', '1' );\n\t?>\n\t</sy:updateFrequency>\n\t<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>\n\t<?php\n\t/**\n\t * Fires at the end of the RDF feed header.\n\t *\n\t * @since 2.0.0\n\t */\n\tdo_action( 'rdf_header' );\n\t?>\n\t<items>\n\t\t<rdf:Seq>\n\t\t<?php\n\t\twhile ( have_posts() ) :\n\t\t\tthe_post();\n\t\t\t?>\n\t\t\t<rdf:li rdf:resource=\"<?php the_permalink_rss(); ?>\"/>\n\t\t<?php endwhile; ?>\n\t\t</rdf:Seq>\n\t</items>\n</channel>\n<?php\nrewind_posts();\nwhile ( have_posts() ) :\n\tthe_post();\n\t?>\n<item rdf:about=\"<?php the_permalink_rss(); ?>\">\n\t<title><?php the_title_rss(); ?></title>\n\t<link><?php the_permalink_rss(); ?></link>\n\n\t<dc:creator><![CDATA[<?php the_author(); ?>]]></dc:creator>\n\t<dc:date><?php echo mysql2date( 'Y-m-d\\TH:i:s\\Z', $post->post_date_gmt, false ); ?></dc:date>\n\t<?php the_category_rss( 'rdf' ); ?>\n\n\t<?php if ( get_option( 'rss_use_excerpt' ) ) : ?>\n\t\t<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>\n\t<?php else : ?>\n\t\t<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>\n\t\t<content:encoded><![CDATA[<?php the_content_feed( 'rdf' ); ?>]]></content:encoded>\n\t<?php endif; ?>\n\n\t<?php\n\t/**\n\t * Fires at the end of each RDF feed item.\n\t *\n\t * @since 2.0.0\n\t */\n\tdo_action( 'rdf_item' );\n\t?>\n</item>\n<?php endwhile; ?>\n</rdf:RDF>\n", "num_lines": 100}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * RSS 0.92 Feed Template for displaying RSS 0.92 Posts feed.\n *\n * @package WordPress\n */\n\nheader( 'Content-Type: ' . feed_content_type( 'rss' ) . '; charset=' . get_option( 'blog_charset' ), true );\n$more = 1;\n\necho '<?xml version=\"1.0\" encoding=\"' . get_option( 'blog_charset' ) . '\"?' . '>'; ?>\n<rss version=\"0.92\">\n<channel>\n\t<title><?php wp_title_rss(); ?></title>\n\t<link><?php bloginfo_rss( 'url' ); ?></link>\n\t<description><?php bloginfo_rss( 'description' ); ?></description>\n\t<lastBuildDate><?php echo get_feed_build_date( 'D, d M Y H:i:s +0000' ); ?></lastBuildDate>\n\t<docs>http://backend.userland.com/rss092</docs>\n\t<language><?php bloginfo_rss( 'language' ); ?></language>\n\t<?php\n\t/**\n\t * Fires at the end of the RSS Feed Header.\n\t *\n\t * @since 2.0.0\n\t */\n\tdo_action( 'rss_head' );\n\t?>\n\n<?php\nwhile ( have_posts() ) :\n\tthe_post();\n\t?>\n\t<item>\n\t\t<title><?php the_title_rss(); ?></title>\n\t\t<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>\n\t\t<link><?php the_permalink_rss(); ?></link>\n\t\t<?php\n\t\t/**\n\t\t * Fires at the end of each RSS feed item.\n\t\t *\n\t\t * @since 2.0.0\n\t\t */\n\t\tdo_action( 'rss_item' );\n\t\t?>\n\t</item>\n<?php endwhile; ?>\n</channel>\n</rss>\n", "num_lines": 49}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * RSS2 Feed Template for displaying RSS2 Comments feed.\n *\n * @package WordPress\n */\n\nheader( 'Content-Type: ' . feed_content_type( 'rss2' ) . '; charset=' . get_option( 'blog_charset' ), true );\n\necho '<?xml version=\"1.0\" encoding=\"' . get_option( 'blog_charset' ) . '\"?' . '>';\n\n/** This action is documented in wp-includes/feed-rss2.php */\ndo_action( 'rss_tag_pre', 'rss2-comments' );\n?>\n<rss version=\"2.0\"\n\txmlns:content=\"http://purl.org/rss/1.0/modules/content/\"\n\txmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n\txmlns:atom=\"http://www.w3.org/2005/Atom\"\n\txmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\"\n\t<?php\n\t/** This action is documented in wp-includes/feed-rss2.php */\n\tdo_action( 'rss2_ns' );\n\t?>\n\n\t<?php\n\t/**\n\t * Fires at the end of the RSS root to add namespaces.\n\t *\n\t * @since 2.8.0\n\t */\n\tdo_action( 'rss2_comments_ns' );\n\t?>\n>\n<channel>\n\t<title>\n\t<?php\n\tif ( is_singular() ) {\n\t\t/* translators: Comments feed title. %s: Post title. */\n\t\tprintf( ent2ncr( __( 'Comments on: %s' ) ), get_the_title_rss() );\n\t} elseif ( is_search() ) {\n\t\t/* translators: Comments feed title. 1: Site title, 2: Search query. */\n\t\tprintf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );\n\t} else {\n\t\t/* translators: Comments feed title. %s: Site title. */\n\t\tprintf( ent2ncr( __( 'Comments for %s' ) ), get_wp_title_rss() );\n\t}\n\t?>\n\t</title>\n\t<atom:link href=\"<?php self_link(); ?>\" rel=\"self\" type=\"application/rss+xml\" />\n\t<link><?php ( is_single() ) ? the_permalink_rss() : bloginfo_rss( 'url' ); ?></link>\n\t<description><?php bloginfo_rss( 'description' ); ?></description>\n\t<lastBuildDate><?php echo get_feed_build_date( 'r' ); ?></lastBuildDate>\n\t<sy:updatePeriod>\n\t<?php\n\t\t/** This filter is documented in wp-includes/feed-rss2.php */\n\t\techo apply_filters( 'rss_update_period', 'hourly' );\n\t?>\n\t</sy:updatePeriod>\n\t<sy:updateFrequency>\n\t<?php\n\t\t/** This filter is documented in wp-includes/feed-rss2.php */\n\t\techo apply_filters( 'rss_update_frequency', '1' );\n\t?>\n\t</sy:updateFrequency>\n\t<?php\n\t/**\n\t * Fires at the end of the RSS2 comment feed header.\n\t *\n\t * @since 2.3.0\n\t */\n\tdo_action( 'commentsrss2_head' );\n\n\twhile ( have_comments() ) :\n\t\tthe_comment();\n\t\t$comment_post    = get_post( $comment->comment_post_ID );\n\t\t$GLOBALS['post'] = $comment_post;\n\t\t?>\n\t<item>\n\t\t<title>\n\t\t<?php\n\t\tif ( ! is_singular() ) {\n\t\t\t$title = get_the_title( $comment_post->ID );\n\t\t\t/** This filter is documented in wp-includes/feed.php */\n\t\t\t$title = apply_filters( 'the_title_rss', $title );\n\t\t\t/* translators: Individual comment title. 1: Post title, 2: Comment author name. */\n\t\t\tprintf( ent2ncr( __( 'Comment on %1$s by %2$s' ) ), $title, get_comment_author_rss() );\n\t\t} else {\n\t\t\t/* translators: Comment author title. %s: Comment author name. */\n\t\t\tprintf( ent2ncr( __( 'By: %s' ) ), get_comment_author_rss() );\n\t\t}\n\t\t?>\n\t\t</title>\n\t\t<link><?php comment_link(); ?></link>\n\n\t\t<dc:creator><![CDATA[<?php echo get_comment_author_rss(); ?>]]></dc:creator>\n\t\t<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_comment_time( 'Y-m-d H:i:s', true, false ), false ); ?></pubDate>\n\t\t<guid isPermaLink=\"false\"><?php comment_guid(); ?></guid>\n\n\t\t<?php if ( post_password_required( $comment_post ) ) : ?>\n\t\t\t<description><?php echo ent2ncr( __( 'Protected Comments: Please enter your password to view comments.' ) ); ?></description>\n\t\t\t<content:encoded><![CDATA[<?php echo get_the_password_form(); ?>]]></content:encoded>\n\t\t<?php else : ?>\n\t\t\t<description><![CDATA[<?php comment_text_rss(); ?>]]></description>\n\t\t\t<content:encoded><![CDATA[<?php comment_text(); ?>]]></content:encoded>\n\t\t<?php endif; // End if post_password_required(). ?>\n\n\t\t<?php\n\t\t/**\n\t\t * Fires at the end of each RSS2 comment feed item.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param int $comment_ID The ID of the comment being displayed.\n\t\t * @param int $ID         The ID of the post the comment is connected to.\n\t\t */\n\t\tdo_action( 'commentrss2_item', $comment->comment_ID, $comment_post->ID );\n\t\t?>\n\t</item>\n\t<?php endwhile; ?>\n</channel>\n</rss>\n", "num_lines": 122}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * RSS2 Feed Template for displaying RSS2 Posts feed.\n *\n * @package WordPress\n */\n\nheader( 'Content-Type: ' . feed_content_type( 'rss2' ) . '; charset=' . get_option( 'blog_charset' ), true );\n$more = 1;\n\necho '<?xml version=\"1.0\" encoding=\"' . get_option( 'blog_charset' ) . '\"?' . '>';\n\n/**\n * Fires between the xml and rss tags in a feed.\n *\n * @since 4.0.0\n *\n * @param string $context Type of feed. Possible values include 'rss2', 'rss2-comments',\n *                        'rdf', 'atom', and 'atom-comments'.\n */\ndo_action( 'rss_tag_pre', 'rss2' );\n?>\n<rss version=\"2.0\"\n\txmlns:content=\"http://purl.org/rss/1.0/modules/content/\"\n\txmlns:wfw=\"http://wellformedweb.org/CommentAPI/\"\n\txmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n\txmlns:atom=\"http://www.w3.org/2005/Atom\"\n\txmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\"\n\txmlns:slash=\"http://purl.org/rss/1.0/modules/slash/\"\n\t<?php\n\t/**\n\t * Fires at the end of the RSS root to add namespaces.\n\t *\n\t * @since 2.0.0\n\t */\n\tdo_action( 'rss2_ns' );\n\t?>\n>\n\n<channel>\n\t<title><?php wp_title_rss(); ?></title>\n\t<atom:link href=\"<?php self_link(); ?>\" rel=\"self\" type=\"application/rss+xml\" />\n\t<link><?php bloginfo_rss( 'url' ); ?></link>\n\t<description><?php bloginfo_rss( 'description' ); ?></description>\n\t<lastBuildDate><?php echo get_feed_build_date( 'r' ); ?></lastBuildDate>\n\t<language><?php bloginfo_rss( 'language' ); ?></language>\n\t<sy:updatePeriod>\n\t<?php\n\t\t$duration = 'hourly';\n\n\t\t/**\n\t\t * Filters how often to update the RSS feed.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param string $duration The update period. Accepts 'hourly', 'daily', 'weekly', 'monthly',\n\t\t *                         'yearly'. Default 'hourly'.\n\t\t */\n\t\techo apply_filters( 'rss_update_period', $duration );\n\t?>\n\t</sy:updatePeriod>\n\t<sy:updateFrequency>\n\t<?php\n\t\t$frequency = '1';\n\n\t\t/**\n\t\t * Filters the RSS update frequency.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param string $frequency An integer passed as a string representing the frequency\n\t\t *                          of RSS updates within the update period. Default '1'.\n\t\t */\n\t\techo apply_filters( 'rss_update_frequency', $frequency );\n\t?>\n\t</sy:updateFrequency>\n\t<?php\n\t/**\n\t * Fires at the end of the RSS2 Feed Header.\n\t *\n\t * @since 2.0.0\n\t */\n\tdo_action( 'rss2_head' );\n\n\twhile ( have_posts() ) :\n\t\tthe_post();\n\t\t?>\n\t<item>\n\t\t<title><?php the_title_rss(); ?></title>\n\t\t<link><?php the_permalink_rss(); ?></link>\n\t\t<?php if ( get_comments_number() || comments_open() ) : ?>\n\t\t\t<comments><?php comments_link_feed(); ?></comments>\n\t\t<?php endif; ?>\n\n\t\t<dc:creator><![CDATA[<?php the_author(); ?>]]></dc:creator>\n\t\t<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>\n\t\t<?php the_category_rss( 'rss2' ); ?>\n\t\t<guid isPermaLink=\"false\"><?php the_guid(); ?></guid>\n\n\t\t<?php if ( get_option( 'rss_use_excerpt' ) ) : ?>\n\t\t\t<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>\n\t\t<?php else : ?>\n\t\t\t<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>\n\t\t\t<?php $content = get_the_content_feed( 'rss2' ); ?>\n\t\t\t<?php if ( strlen( $content ) > 0 ) : ?>\n\t\t\t\t<content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>\n\t\t\t<?php else : ?>\n\t\t\t\t<content:encoded><![CDATA[<?php the_excerpt_rss(); ?>]]></content:encoded>\n\t\t\t<?php endif; ?>\n\t\t<?php endif; ?>\n\n\t\t<?php if ( get_comments_number() || comments_open() ) : ?>\n\t\t\t<wfw:commentRss><?php echo esc_url( get_post_comments_feed_link( null, 'rss2' ) ); ?></wfw:commentRss>\n\t\t\t<slash:comments><?php echo get_comments_number(); ?></slash:comments>\n\t\t<?php endif; ?>\n\n\t\t<?php rss_enclosure(); ?>\n\n\t\t<?php\n\t\t/**\n\t\t * Fires at the end of each RSS2 feed item.\n\t\t *\n\t\t * @since 2.0.0\n\t\t */\n\t\tdo_action( 'rss2_item' );\n\t\t?>\n\t</item>\n\t<?php endwhile; ?>\n</channel>\n</rss>\n", "num_lines": 131}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Feed API\n *\n * Many of the functions used in here belong in The Loop, or The Loop for the\n * Feeds.\n *\n * @package WordPress\n * @subpackage Feed\n * @since 2.1.0\n */\n\n/**\n * RSS container for the bloginfo function.\n *\n * You can retrieve anything that you can using the get_bloginfo() function.\n * Everything will be stripped of tags and characters converted, when the values\n * are retrieved for use in the feeds.\n *\n * @since 1.5.1\n *\n * @see get_bloginfo() For the list of possible values to display.\n *\n * @param string $show See get_bloginfo() for possible values.\n * @return string\n */\nfunction get_bloginfo_rss( $show = '' ) {\n\t$info = strip_tags( get_bloginfo( $show ) );\n\t/**\n\t * Filters the bloginfo for use in RSS feeds.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @see convert_chars()\n\t * @see get_bloginfo()\n\t *\n\t * @param string $info Converted string value of the blog information.\n\t * @param string $show The type of blog information to retrieve.\n\t */\n\treturn apply_filters( 'get_bloginfo_rss', convert_chars( $info ), $show );\n}\n\n/**\n * Display RSS container for the bloginfo function.\n *\n * You can retrieve anything that you can using the get_bloginfo() function.\n * Everything will be stripped of tags and characters converted, when the values\n * are retrieved for use in the feeds.\n *\n * @since 0.71\n *\n * @see get_bloginfo() For the list of possible values to display.\n *\n * @param string $show See get_bloginfo() for possible values.\n */\nfunction bloginfo_rss( $show = '' ) {\n\t/**\n\t * Filters the bloginfo for display in RSS feeds.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @see get_bloginfo()\n\t *\n\t * @param string $rss_container RSS container for the blog information.\n\t * @param string $show          The type of blog information to retrieve.\n\t */\n\techo apply_filters( 'bloginfo_rss', get_bloginfo_rss( $show ), $show );\n}\n\n/**\n * Retrieve the default feed.\n *\n * The default feed is 'rss2', unless a plugin changes it through the\n * {@see 'default_feed'} filter.\n *\n * @since 2.5.0\n *\n * @return string Default feed, or for example 'rss2', 'atom', etc.\n */\nfunction get_default_feed() {\n\t/**\n\t * Filters the default feed type.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $feed_type Type of default feed. Possible values include 'rss2', 'atom'.\n\t *                          Default 'rss2'.\n\t */\n\t$default_feed = apply_filters( 'default_feed', 'rss2' );\n\n\treturn ( 'rss' === $default_feed ) ? 'rss2' : $default_feed;\n}\n\n/**\n * Retrieve the blog title for the feed title.\n *\n * @since 2.2.0\n * @since 4.4.0 The optional `$sep` parameter was deprecated and renamed to `$deprecated`.\n *\n * @param string $deprecated Unused..\n * @return string The document title.\n */\nfunction get_wp_title_rss( $deprecated = '&#8211;' ) {\n\tif ( '&#8211;' !== $deprecated ) {\n\t\t/* translators: %s: 'document_title_separator' filter name. */\n\t\t_deprecated_argument( __FUNCTION__, '4.4.0', sprintf( __( 'Use the %s filter instead.' ), '<code>document_title_separator</code>' ) );\n\t}\n\n\t/**\n\t * Filters the blog title for use as the feed title.\n\t *\n\t * @since 2.2.0\n\t * @since 4.4.0 The `$sep` parameter was deprecated and renamed to `$deprecated`.\n\t *\n\t * @param string $title      The current blog title.\n\t * @param string $deprecated Unused.\n\t */\n\treturn apply_filters( 'get_wp_title_rss', wp_get_document_title(), $deprecated );\n}\n\n/**\n * Display the blog title for display of the feed title.\n *\n * @since 2.2.0\n * @since 4.4.0 The optional `$sep` parameter was deprecated and renamed to `$deprecated`.\n *\n * @param string $deprecated Unused.\n */\nfunction wp_title_rss( $deprecated = '&#8211;' ) {\n\tif ( '&#8211;' !== $deprecated ) {\n\t\t/* translators: %s: 'document_title_separator' filter name. */\n\t\t_deprecated_argument( __FUNCTION__, '4.4.0', sprintf( __( 'Use the %s filter instead.' ), '<code>document_title_separator</code>' ) );\n\t}\n\n\t/**\n\t * Filters the blog title for display of the feed title.\n\t *\n\t * @since 2.2.0\n\t * @since 4.4.0 The `$sep` parameter was deprecated and renamed to `$deprecated`.\n\t *\n\t * @see get_wp_title_rss()\n\t *\n\t * @param string $wp_title_rss The current blog title.\n\t * @param string $deprecated   Unused.\n\t */\n\techo apply_filters( 'wp_title_rss', get_wp_title_rss(), $deprecated );\n}\n\n/**\n * Retrieve the current post title for the feed.\n *\n * @since 2.0.0\n *\n * @return string Current post title.\n */\nfunction get_the_title_rss() {\n\t$title = get_the_title();\n\n\t/**\n\t * Filters the post title for use in a feed.\n\t *\n\t * @since 1.2.0\n\t *\n\t * @param string $title The current post title.\n\t */\n\treturn apply_filters( 'the_title_rss', $title );\n}\n\n/**\n * Display the post title in the feed.\n *\n * @since 0.71\n */\nfunction the_title_rss() {\n\techo get_the_title_rss();\n}\n\n/**\n * Retrieve the post content for feeds.\n *\n * @since 2.9.0\n *\n * @see get_the_content()\n *\n * @param string $feed_type The type of feed. rss2 | atom | rss | rdf\n * @return string The filtered content.\n */\nfunction get_the_content_feed( $feed_type = null ) {\n\tif ( ! $feed_type ) {\n\t\t$feed_type = get_default_feed();\n\t}\n\n\t/** This filter is documented in wp-includes/post-template.php */\n\t$content = apply_filters( 'the_content', get_the_content() );\n\t$content = str_replace( ']]>', ']]&gt;', $content );\n\n\t/**\n\t * Filters the post content for use in feeds.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string $content   The current post content.\n\t * @param string $feed_type Type of feed. Possible values include 'rss2', 'atom'.\n\t *                          Default 'rss2'.\n\t */\n\treturn apply_filters( 'the_content_feed', $content, $feed_type );\n}\n\n/**\n * Display the post content for feeds.\n *\n * @since 2.9.0\n *\n * @param string $feed_type The type of feed. rss2 | atom | rss | rdf\n */\nfunction the_content_feed( $feed_type = null ) {\n\techo get_the_content_feed( $feed_type );\n}\n\n/**\n * Display the post excerpt for the feed.\n *\n * @since 0.71\n */\nfunction the_excerpt_rss() {\n\t$output = get_the_excerpt();\n\t/**\n\t * Filters the post excerpt for a feed.\n\t *\n\t * @since 1.2.0\n\t *\n\t * @param string $output The current post excerpt.\n\t */\n\techo apply_filters( 'the_excerpt_rss', $output );\n}\n\n/**\n * Display the permalink to the post for use in feeds.\n *\n * @since 2.3.0\n */\nfunction the_permalink_rss() {\n\t/**\n\t * Filters the permalink to the post for use in feeds.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string $post_permalink The current post permalink.\n\t */\n\techo esc_url( apply_filters( 'the_permalink_rss', get_permalink() ) );\n}\n\n/**\n * Outputs the link to the comments for the current post in an xml safe way\n *\n * @since 3.0.0\n */\nfunction comments_link_feed() {\n\t/**\n\t * Filters the comments permalink for the current post.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param string $comment_permalink The current comment permalink with\n\t *                                  '#comments' appended.\n\t */\n\techo esc_url( apply_filters( 'comments_link_feed', get_comments_link() ) );\n}\n\n/**\n * Display the feed GUID for the current comment.\n *\n * @since 2.5.0\n *\n * @param int|WP_Comment $comment_id Optional comment object or ID. Defaults to global comment object.\n */\nfunction comment_guid( $comment_id = null ) {\n\techo esc_url( get_comment_guid( $comment_id ) );\n}\n\n/**\n * Retrieve the feed GUID for the current comment.\n *\n * @since 2.5.0\n *\n * @param int|WP_Comment $comment_id Optional comment object or ID. Defaults to global comment object.\n * @return string|false GUID for comment on success, false on failure.\n */\nfunction get_comment_guid( $comment_id = null ) {\n\t$comment = get_comment( $comment_id );\n\n\tif ( ! is_object( $comment ) ) {\n\t\treturn false;\n\t}\n\n\treturn get_the_guid( $comment->comment_post_ID ) . '#comment-' . $comment->comment_ID;\n}\n\n/**\n * Display the link to the comments.\n *\n * @since 1.5.0\n * @since 4.4.0 Introduced the `$comment` argument.\n *\n * @param int|WP_Comment $comment Optional. Comment object or ID. Defaults to global comment object.\n */\nfunction comment_link( $comment = null ) {\n\t/**\n\t * Filters the current comment's permalink.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @see get_comment_link()\n\t *\n\t * @param string $comment_permalink The current comment permalink.\n\t */\n\techo esc_url( apply_filters( 'comment_link', get_comment_link( $comment ) ) );\n}\n\n/**\n * Retrieve the current comment author for use in the feeds.\n *\n * @since 2.0.0\n *\n * @return string Comment Author\n */\nfunction get_comment_author_rss() {\n\t/**\n\t * Filters the current comment author for use in a feed.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @see get_comment_author()\n\t *\n\t * @param string $comment_author The current comment author.\n\t */\n\treturn apply_filters( 'comment_author_rss', get_comment_author() );\n}\n\n/**\n * Display the current comment author in the feed.\n *\n * @since 1.0.0\n */\nfunction comment_author_rss() {\n\techo get_comment_author_rss();\n}\n\n/**\n * Display the current comment content for use in the feeds.\n *\n * @since 1.0.0\n */\nfunction comment_text_rss() {\n\t$comment_text = get_comment_text();\n\t/**\n\t * Filters the current comment content for use in a feed.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $comment_text The content of the current comment.\n\t */\n\t$comment_text = apply_filters( 'comment_text_rss', $comment_text );\n\techo $comment_text;\n}\n\n/**\n * Retrieve all of the post categories, formatted for use in feeds.\n *\n * All of the categories for the current post in the feed loop, will be\n * retrieved and have feed markup added, so that they can easily be added to the\n * RSS2, Atom, or RSS1 and RSS0.91 RDF feeds.\n *\n * @since 2.1.0\n *\n * @param string $type Optional, default is the type returned by get_default_feed().\n * @return string All of the post categories for displaying in the feed.\n */\nfunction get_the_category_rss( $type = null ) {\n\tif ( empty( $type ) ) {\n\t\t$type = get_default_feed();\n\t}\n\t$categories = get_the_category();\n\t$tags       = get_the_tags();\n\t$the_list   = '';\n\t$cat_names  = array();\n\n\t$filter = 'rss';\n\tif ( 'atom' === $type ) {\n\t\t$filter = 'raw';\n\t}\n\n\tif ( ! empty( $categories ) ) {\n\t\tforeach ( (array) $categories as $category ) {\n\t\t\t$cat_names[] = sanitize_term_field( 'name', $category->name, $category->term_id, 'category', $filter );\n\t\t}\n\t}\n\n\tif ( ! empty( $tags ) ) {\n\t\tforeach ( (array) $tags as $tag ) {\n\t\t\t$cat_names[] = sanitize_term_field( 'name', $tag->name, $tag->term_id, 'post_tag', $filter );\n\t\t}\n\t}\n\n\t$cat_names = array_unique( $cat_names );\n\n\tforeach ( $cat_names as $cat_name ) {\n\t\tif ( 'rdf' === $type ) {\n\t\t\t$the_list .= \"\\t\\t<dc:subject><![CDATA[$cat_name]]></dc:subject>\\n\";\n\t\t} elseif ( 'atom' === $type ) {\n\t\t\t$the_list .= sprintf( '<category scheme=\"%1$s\" term=\"%2$s\" />', esc_attr( get_bloginfo_rss( 'url' ) ), esc_attr( $cat_name ) );\n\t\t} else {\n\t\t\t$the_list .= \"\\t\\t<category><![CDATA[\" . html_entity_decode( $cat_name, ENT_COMPAT, get_option( 'blog_charset' ) ) . \"]]></category>\\n\";\n\t\t}\n\t}\n\n\t/**\n\t * Filters all of the post categories for display in a feed.\n\t *\n\t * @since 1.2.0\n\t *\n\t * @param string $the_list All of the RSS post categories.\n\t * @param string $type     Type of feed. Possible values include 'rss2', 'atom'.\n\t *                         Default 'rss2'.\n\t */\n\treturn apply_filters( 'the_category_rss', $the_list, $type );\n}\n\n/**\n * Display the post categories in the feed.\n *\n * @since 0.71\n *\n * @see get_the_category_rss() For better explanation.\n *\n * @param string $type Optional, default is the type returned by get_default_feed().\n */\nfunction the_category_rss( $type = null ) {\n\techo get_the_category_rss( $type );\n}\n\n/**\n * Display the HTML type based on the blog setting.\n *\n * The two possible values are either 'xhtml' or 'html'.\n *\n * @since 2.2.0\n */\nfunction html_type_rss() {\n\t$type = get_bloginfo( 'html_type' );\n\tif ( strpos( $type, 'xhtml' ) !== false ) {\n\t\t$type = 'xhtml';\n\t} else {\n\t\t$type = 'html';\n\t}\n\techo $type;\n}\n\n/**\n * Display the rss enclosure for the current post.\n *\n * Uses the global $post to check whether the post requires a password and if\n * the user has the password for the post. If not then it will return before\n * displaying.\n *\n * Also uses the function get_post_custom() to get the post's 'enclosure'\n * metadata field and parses the value to display the enclosure(s). The\n * enclosure(s) consist of enclosure HTML tag(s) with a URI and other\n * attributes.\n *\n * @since 1.5.0\n */\nfunction rss_enclosure() {\n\tif ( post_password_required() ) {\n\t\treturn;\n\t}\n\n\tforeach ( (array) get_post_custom() as $key => $val ) {\n\t\tif ( 'enclosure' === $key ) {\n\t\t\tforeach ( (array) $val as $enc ) {\n\t\t\t\t$enclosure = explode( \"\\n\", $enc );\n\n\t\t\t\t// Only get the first element, e.g. 'audio/mpeg' from 'audio/mpeg mpga mp2 mp3'.\n\t\t\t\t$t    = preg_split( '/[ \\t]/', trim( $enclosure[2] ) );\n\t\t\t\t$type = $t[0];\n\n\t\t\t\t/**\n\t\t\t\t * Filters the RSS enclosure HTML link tag for the current post.\n\t\t\t\t *\n\t\t\t\t * @since 2.2.0\n\t\t\t\t *\n\t\t\t\t * @param string $html_link_tag The HTML link tag with a URI and other attributes.\n\t\t\t\t */\n\t\t\t\techo apply_filters( 'rss_enclosure', '<enclosure url=\"' . esc_url( trim( $enclosure[0] ) ) . '\" length=\"' . absint( trim( $enclosure[1] ) ) . '\" type=\"' . esc_attr( $type ) . '\" />' . \"\\n\" );\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Display the atom enclosure for the current post.\n *\n * Uses the global $post to check whether the post requires a password and if\n * the user has the password for the post. If not then it will return before\n * displaying.\n *\n * Also uses the function get_post_custom() to get the post's 'enclosure'\n * metadata field and parses the value to display the enclosure(s). The\n * enclosure(s) consist of link HTML tag(s) with a URI and other attributes.\n *\n * @since 2.2.0\n */\nfunction atom_enclosure() {\n\tif ( post_password_required() ) {\n\t\treturn;\n\t}\n\n\tforeach ( (array) get_post_custom() as $key => $val ) {\n\t\tif ( 'enclosure' === $key ) {\n\t\t\tforeach ( (array) $val as $enc ) {\n\t\t\t\t$enclosure = explode( \"\\n\", $enc );\n\n\t\t\t\t$url    = '';\n\t\t\t\t$type   = '';\n\t\t\t\t$length = 0;\n\n\t\t\t\t$mimes = get_allowed_mime_types();\n\n\t\t\t\t// Parse URL.\n\t\t\t\tif ( isset( $enclosure[0] ) && is_string( $enclosure[0] ) ) {\n\t\t\t\t\t$url = trim( $enclosure[0] );\n\t\t\t\t}\n\n\t\t\t\t// Parse length and type.\n\t\t\t\tfor ( $i = 1; $i <= 2; $i++ ) {\n\t\t\t\t\tif ( isset( $enclosure[ $i ] ) ) {\n\t\t\t\t\t\tif ( is_numeric( $enclosure[ $i ] ) ) {\n\t\t\t\t\t\t\t$length = trim( $enclosure[ $i ] );\n\t\t\t\t\t\t} elseif ( in_array( $enclosure[ $i ], $mimes, true ) ) {\n\t\t\t\t\t\t\t$type = trim( $enclosure[ $i ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$html_link_tag = sprintf(\n\t\t\t\t\t\"<link href=\\\"%s\\\" rel=\\\"enclosure\\\" length=\\\"%d\\\" type=\\\"%s\\\" />\\n\",\n\t\t\t\t\tesc_url( $url ),\n\t\t\t\t\tesc_attr( $length ),\n\t\t\t\t\tesc_attr( $type )\n\t\t\t\t);\n\n\t\t\t\t/**\n\t\t\t\t * Filters the atom enclosure HTML link tag for the current post.\n\t\t\t\t *\n\t\t\t\t * @since 2.2.0\n\t\t\t\t *\n\t\t\t\t * @param string $html_link_tag The HTML link tag with a URI and other attributes.\n\t\t\t\t */\n\t\t\t\techo apply_filters( 'atom_enclosure', $html_link_tag );\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Determine the type of a string of data with the data formatted.\n *\n * Tell whether the type is text, HTML, or XHTML, per RFC 4287 section 3.1.\n *\n * In the case of WordPress, text is defined as containing no markup,\n * XHTML is defined as \"well formed\", and HTML as tag soup (i.e., the rest).\n *\n * Container div tags are added to XHTML values, per section 3.1.1.3.\n *\n * @link http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.3.1\n *\n * @since 2.5.0\n *\n * @param string $data Input string\n * @return array array(type, value)\n */\nfunction prep_atom_text_construct( $data ) {\n\tif ( strpos( $data, '<' ) === false && strpos( $data, '&' ) === false ) {\n\t\treturn array( 'text', $data );\n\t}\n\n\tif ( ! function_exists( 'xml_parser_create' ) ) {\n\t\ttrigger_error( __( \"PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension.\" ) );\n\n\t\treturn array( 'html', \"<![CDATA[$data]]>\" );\n\t}\n\n\t$parser = xml_parser_create();\n\txml_parse( $parser, '<div>' . $data . '</div>', true );\n\t$code = xml_get_error_code( $parser );\n\txml_parser_free( $parser );\n\tunset( $parser );\n\n\tif ( ! $code ) {\n\t\tif ( strpos( $data, '<' ) === false ) {\n\t\t\treturn array( 'text', $data );\n\t\t} else {\n\t\t\t$data = \"<div xmlns='http://www.w3.org/1999/xhtml'>$data</div>\";\n\t\t\treturn array( 'xhtml', $data );\n\t\t}\n\t}\n\n\tif ( strpos( $data, ']]>' ) === false ) {\n\t\treturn array( 'html', \"<![CDATA[$data]]>\" );\n\t} else {\n\t\treturn array( 'html', htmlspecialchars( $data ) );\n\t}\n}\n\n/**\n * Displays Site Icon in atom feeds.\n *\n * @since 4.3.0\n *\n * @see get_site_icon_url()\n */\nfunction atom_site_icon() {\n\t$url = get_site_icon_url( 32 );\n\tif ( $url ) {\n\t\techo '<icon>' . convert_chars( $url ) . \"</icon>\\n\";\n\t}\n}\n\n/**\n * Displays Site Icon in RSS2.\n *\n * @since 4.3.0\n */\nfunction rss2_site_icon() {\n\t$rss_title = get_wp_title_rss();\n\tif ( empty( $rss_title ) ) {\n\t\t$rss_title = get_bloginfo_rss( 'name' );\n\t}\n\n\t$url = get_site_icon_url( 32 );\n\tif ( $url ) {\n\t\techo '\n<image>\n\t<url>' . convert_chars( $url ) . '</url>\n\t<title>' . $rss_title . '</title>\n\t<link>' . get_bloginfo_rss( 'url' ) . '</link>\n\t<width>32</width>\n\t<height>32</height>\n</image> ' . \"\\n\";\n\t}\n}\n\n/**\n * Returns the link for the currently displayed feed.\n *\n * @since 5.3.0\n *\n * @return string Correct link for the atom:self element.\n */\nfunction get_self_link() {\n\t$host = parse_url( home_url() );\n\treturn set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) );\n}\n\n/**\n * Display the link for the currently displayed feed in a XSS safe way.\n *\n * Generate a correct link for the atom:self element.\n *\n * @since 2.5.0\n */\nfunction self_link() {\n\t/**\n\t * Filters the current feed URL.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @see set_url_scheme()\n\t * @see wp_unslash()\n\t *\n\t * @param string $feed_link The link for the feed with set URL scheme.\n\t */\n\techo esc_url( apply_filters( 'self_link', get_self_link() ) );\n}\n\n/**\n * Get the UTC time of the most recently modified post from WP_Query.\n *\n * If viewing a comment feed, the time of the most recently modified\n * comment will be returned.\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @since 5.2.0\n *\n * @param string $format Date format string to return the time in.\n * @return string|false The time in requested format, or false on failure.\n */\nfunction get_feed_build_date( $format ) {\n\tglobal $wp_query;\n\n\t$datetime          = false;\n\t$max_modified_time = false;\n\t$utc               = new DateTimeZone( 'UTC' );\n\n\tif ( ! empty( $wp_query ) && $wp_query->have_posts() ) {\n\t\t// Extract the post modified times from the posts.\n\t\t$modified_times = wp_list_pluck( $wp_query->posts, 'post_modified_gmt' );\n\n\t\t// If this is a comment feed, check those objects too.\n\t\tif ( $wp_query->is_comment_feed() && $wp_query->comment_count ) {\n\t\t\t// Extract the comment modified times from the comments.\n\t\t\t$comment_times = wp_list_pluck( $wp_query->comments, 'comment_date_gmt' );\n\n\t\t\t// Add the comment times to the post times for comparison.\n\t\t\t$modified_times = array_merge( $modified_times, $comment_times );\n\t\t}\n\n\t\t// Determine the maximum modified time.\n\t\t$datetime = date_create_immutable_from_format( 'Y-m-d H:i:s', max( $modified_times ), $utc );\n\t}\n\n\tif ( false === $datetime ) {\n\t\t// Fall back to last time any post was modified or published.\n\t\t$datetime = date_create_immutable_from_format( 'Y-m-d H:i:s', get_lastpostmodified( 'GMT' ), $utc );\n\t}\n\n\tif ( false !== $datetime ) {\n\t\t$max_modified_time = $datetime->format( $format );\n\t}\n\n\t/**\n\t * Filters the date the last post or comment in the query was modified.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string|false $max_modified_time Date the last post or comment was modified in the query, in UTC.\n\t *                                        False on failure.\n\t * @param string       $format            The date format requested in get_feed_build_date().\n\t */\n\treturn apply_filters( 'get_feed_build_date', $max_modified_time, $format );\n}\n\n/**\n * Return the content type for specified feed type.\n *\n * @since 2.8.0\n *\n * @param string $type Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.\n */\nfunction feed_content_type( $type = '' ) {\n\tif ( empty( $type ) ) {\n\t\t$type = get_default_feed();\n\t}\n\n\t$types = array(\n\t\t'rss'      => 'application/rss+xml',\n\t\t'rss2'     => 'application/rss+xml',\n\t\t'rss-http' => 'text/xml',\n\t\t'atom'     => 'application/atom+xml',\n\t\t'rdf'      => 'application/rdf+xml',\n\t);\n\n\t$content_type = ( ! empty( $types[ $type ] ) ) ? $types[ $type ] : 'application/octet-stream';\n\n\t/**\n\t * Filters the content type for a specific feed type.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $content_type Content type indicating the type of data that a feed contains.\n\t * @param string $type         Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.\n\t */\n\treturn apply_filters( 'feed_content_type', $content_type, $type );\n}\n\n/**\n * Build SimplePie object based on RSS or Atom feed from URL.\n *\n * @since 2.8.0\n *\n * @param string|string[] $url URL of feed to retrieve. If an array of URLs, the feeds are merged\n *                             using SimplePie's multifeed feature.\n *                             See also {@link http://simplepie.org/wiki/faq/typical_multifeed_gotchas}\n * @return SimplePie|WP_Error SimplePie object on success or WP_Error object on failure.\n */\nfunction fetch_feed( $url ) {\n\tif ( ! class_exists( 'SimplePie', false ) ) {\n\t\trequire_once ABSPATH . WPINC . '/class-simplepie.php';\n\t}\n\n\trequire_once ABSPATH . WPINC . '/class-wp-feed-cache.php';\n\trequire_once ABSPATH . WPINC . '/class-wp-feed-cache-transient.php';\n\trequire_once ABSPATH . WPINC . '/class-wp-simplepie-file.php';\n\trequire_once ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php';\n\n\t$feed = new SimplePie();\n\n\t$feed->set_sanitize_class( 'WP_SimplePie_Sanitize_KSES' );\n\t// We must manually overwrite $feed->sanitize because SimplePie's\n\t// constructor sets it before we have a chance to set the sanitization class.\n\t$feed->sanitize = new WP_SimplePie_Sanitize_KSES();\n\n\t$feed->set_cache_class( 'WP_Feed_Cache' );\n\t$feed->set_file_class( 'WP_SimplePie_File' );\n\n\t$feed->set_feed_url( $url );\n\t/** This filter is documented in wp-includes/class-wp-feed-cache-transient.php */\n\t$feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) );\n\n\t/**\n\t * Fires just before processing the SimplePie feed object.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param SimplePie       $feed SimplePie feed object (passed by reference).\n\t * @param string|string[] $url  URL of feed or array of URLs of feeds to retrieve.\n\t */\n\tdo_action_ref_array( 'wp_feed_options', array( &$feed, $url ) );\n\n\t$feed->init();\n\t$feed->set_output_encoding( get_option( 'blog_charset' ) );\n\n\tif ( $feed->error() ) {\n\t\treturn new WP_Error( 'simplepie-error', $feed->error() );\n\t}\n\n\treturn $feed;\n}\n", "num_lines": 830}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Dependencies API: Scripts functions\n *\n * @since 2.6.0\n *\n * @package WordPress\n * @subpackage Dependencies\n */\n\n/**\n * Initialize $wp_scripts if it has not been set.\n *\n * @global WP_Scripts $wp_scripts\n *\n * @since 4.2.0\n *\n * @return WP_Scripts WP_Scripts instance.\n */\nfunction wp_scripts() {\n\tglobal $wp_scripts;\n\n\tif ( ! ( $wp_scripts instanceof WP_Scripts ) ) {\n\t\t$wp_scripts = new WP_Scripts();\n\t}\n\n\treturn $wp_scripts;\n}\n\n/**\n * Helper function to output a _doing_it_wrong message when applicable.\n *\n * @ignore\n * @since 4.2.0\n * @since 5.5.0 Added the `$handle` parameter.\n *\n * @param string $function Function name.\n * @param string $handle   Optional. Name of the script or stylesheet that was\n *                         registered or enqueued too early. Default empty.\n */\nfunction _wp_scripts_maybe_doing_it_wrong( $function, $handle = '' ) {\n\tif ( did_action( 'init' ) || did_action( 'wp_enqueue_scripts' )\n\t\t|| did_action( 'admin_enqueue_scripts' ) || did_action( 'login_enqueue_scripts' )\n\t) {\n\t\treturn;\n\t}\n\n\t$message = sprintf(\n\t\t/* translators: 1: wp_enqueue_scripts, 2: admin_enqueue_scripts, 3: login_enqueue_scripts */\n\t\t__( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),\n\t\t'<code>wp_enqueue_scripts</code>',\n\t\t'<code>admin_enqueue_scripts</code>',\n\t\t'<code>login_enqueue_scripts</code>'\n\t);\n\n\tif ( $handle ) {\n\t\t$message .= ' ' . sprintf(\n\t\t\t/* translators: %s: Name of the script or stylesheet. */\n\t\t\t__( 'This notice was triggered by the %s handle.' ),\n\t\t\t'<code>' . $handle . '</code>'\n\t\t);\n\t}\n\n\t_doing_it_wrong(\n\t\t$function,\n\t\t$message,\n\t\t'3.3.0'\n\t);\n}\n\n/**\n * Prints scripts in document head that are in the $handles queue.\n *\n * Called by admin-header.php and {@see 'wp_head'} hook. Since it is called by wp_head on every page load,\n * the function does not instantiate the WP_Scripts object unless script names are explicitly passed.\n * Makes use of already-instantiated $wp_scripts global if present. Use provided {@see 'wp_print_scripts'}\n * hook to register/enqueue new scripts.\n *\n * @see WP_Scripts::do_item()\n * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts.\n *\n * @since 2.1.0\n *\n * @param string|bool|array $handles Optional. Scripts to be printed. Default 'false'.\n * @return string[] On success, an array of handles of processed WP_Dependencies items; otherwise, an empty array.\n */\nfunction wp_print_scripts( $handles = false ) {\n\tglobal $wp_scripts;\n\n\t/**\n\t * Fires before scripts in the $handles queue are printed.\n\t *\n\t * @since 2.1.0\n\t */\n\tdo_action( 'wp_print_scripts' );\n\n\tif ( '' === $handles ) { // For 'wp_head'.\n\t\t$handles = false;\n\t}\n\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );\n\n\tif ( ! ( $wp_scripts instanceof WP_Scripts ) ) {\n\t\tif ( ! $handles ) {\n\t\t\treturn array(); // No need to instantiate if nothing is there.\n\t\t}\n\t}\n\n\treturn wp_scripts()->do_items( $handles );\n}\n\n/**\n * Adds extra code to a registered script.\n *\n * Code will only be added if the script is already in the queue.\n * Accepts a string $data containing the Code. If two or more code blocks\n * are added to the same script $handle, they will be printed in the order\n * they were added, i.e. the latter added code can redeclare the previous.\n *\n * @since 4.5.0\n *\n * @see WP_Scripts::add_inline_script()\n *\n * @param string $handle   Name of the script to add the inline script to.\n * @param string $data     String containing the javascript to be added.\n * @param string $position Optional. Whether to add the inline script before the handle\n *                         or after. Default 'after'.\n * @return bool True on success, false on failure.\n */\nfunction wp_add_inline_script( $handle, $data, $position = 'after' ) {\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );\n\n\tif ( false !== stripos( $data, '</script>' ) ) {\n\t\t_doing_it_wrong(\n\t\t\t__FUNCTION__,\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: <script>, 2: wp_add_inline_script() */\n\t\t\t\t__( 'Do not pass %1$s tags to %2$s.' ),\n\t\t\t\t'<code>&lt;script&gt;</code>',\n\t\t\t\t'<code>wp_add_inline_script()</code>'\n\t\t\t),\n\t\t\t'4.5.0'\n\t\t);\n\t\t$data = trim( preg_replace( '#<script[^>]*>(.*)</script>#is', '$1', $data ) );\n\t}\n\n\treturn wp_scripts()->add_inline_script( $handle, $data, $position );\n}\n\n/**\n * Register a new script.\n *\n * Registers a script to be enqueued later using the wp_enqueue_script() function.\n *\n * @see WP_Dependencies::add()\n * @see WP_Dependencies::add_data()\n *\n * @since 2.1.0\n * @since 4.3.0 A return value was added.\n *\n * @param string           $handle    Name of the script. Should be unique.\n * @param string|bool      $src       Full URL of the script, or path of the script relative to the WordPress root directory.\n *                                    If source is set to false, script is an alias of other scripts it depends on.\n * @param string[]         $deps      Optional. An array of registered script handles this script depends on. Default empty array.\n * @param string|bool|null $ver       Optional. String specifying script version number, if it has one, which is added to the URL\n *                                    as a query string for cache busting purposes. If version is set to false, a version\n *                                    number is automatically added equal to current installed WordPress version.\n *                                    If set to null, no version is added.\n * @param bool             $in_footer Optional. Whether to enqueue the script before </body> instead of in the <head>.\n *                                    Default 'false'.\n * @return bool Whether the script has been registered. True on success, false on failure.\n */\nfunction wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );\n\n\t$wp_scripts = wp_scripts();\n\n\t$registered = $wp_scripts->add( $handle, $src, $deps, $ver );\n\tif ( $in_footer ) {\n\t\t$wp_scripts->add_data( $handle, 'group', 1 );\n\t}\n\n\treturn $registered;\n}\n\n/**\n * Localize a script.\n *\n * Works only if the script has already been added.\n *\n * Accepts an associative array $l10n and creates a JavaScript object:\n *\n *     \"$object_name\" = {\n *         key: value,\n *         key: value,\n *         ...\n *     }\n *\n * @see WP_Scripts::localize()\n * @link https://core.trac.wordpress.org/ticket/11520\n * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts.\n *\n * @since 2.2.0\n *\n * @todo Documentation cleanup\n *\n * @param string $handle      Script handle the data will be attached to.\n * @param string $object_name Name for the JavaScript object. Passed directly, so it should be qualified JS variable.\n *                            Example: '/[a-zA-Z0-9_]+/'.\n * @param array  $l10n        The data itself. The data can be either a single or multi-dimensional array.\n * @return bool True if the script was successfully localized, false otherwise.\n */\nfunction wp_localize_script( $handle, $object_name, $l10n ) {\n\tglobal $wp_scripts;\n\n\tif ( ! ( $wp_scripts instanceof WP_Scripts ) ) {\n\t\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );\n\t\treturn false;\n\t}\n\n\treturn $wp_scripts->localize( $handle, $object_name, $l10n );\n}\n\n/**\n * Sets translated strings for a script.\n *\n * Works only if the script has already been added.\n *\n * @see WP_Scripts::set_translations()\n * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts.\n *\n * @since 5.0.0\n * @since 5.1.0 The `$domain` parameter was made optional.\n *\n * @param string $handle Script handle the textdomain will be attached to.\n * @param string $domain Optional. Text domain. Default 'default'.\n * @param string $path   Optional. The full file path to the directory containing translation files.\n * @return bool True if the text domain was successfully localized, false otherwise.\n */\nfunction wp_set_script_translations( $handle, $domain = 'default', $path = null ) {\n\tglobal $wp_scripts;\n\n\tif ( ! ( $wp_scripts instanceof WP_Scripts ) ) {\n\t\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );\n\t\treturn false;\n\t}\n\n\treturn $wp_scripts->set_translations( $handle, $domain, $path );\n}\n\n/**\n * Remove a registered script.\n *\n * Note: there are intentional safeguards in place to prevent critical admin scripts,\n * such as jQuery core, from being unregistered.\n *\n * @see WP_Dependencies::remove()\n *\n * @since 2.1.0\n *\n * @param string $handle Name of the script to be removed.\n */\nfunction wp_deregister_script( $handle ) {\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );\n\n\t/**\n\t * Do not allow accidental or negligent de-registering of critical scripts in the admin.\n\t * Show minimal remorse if the correct hook is used.\n\t */\n\t$current_filter = current_filter();\n\tif ( ( is_admin() && 'admin_enqueue_scripts' !== $current_filter ) ||\n\t\t( 'wp-login.php' === $GLOBALS['pagenow'] && 'login_enqueue_scripts' !== $current_filter )\n\t) {\n\t\t$not_allowed = array(\n\t\t\t'jquery',\n\t\t\t'jquery-core',\n\t\t\t'jquery-migrate',\n\t\t\t'jquery-ui-core',\n\t\t\t'jquery-ui-accordion',\n\t\t\t'jquery-ui-autocomplete',\n\t\t\t'jquery-ui-button',\n\t\t\t'jquery-ui-datepicker',\n\t\t\t'jquery-ui-dialog',\n\t\t\t'jquery-ui-draggable',\n\t\t\t'jquery-ui-droppable',\n\t\t\t'jquery-ui-menu',\n\t\t\t'jquery-ui-mouse',\n\t\t\t'jquery-ui-position',\n\t\t\t'jquery-ui-progressbar',\n\t\t\t'jquery-ui-resizable',\n\t\t\t'jquery-ui-selectable',\n\t\t\t'jquery-ui-slider',\n\t\t\t'jquery-ui-sortable',\n\t\t\t'jquery-ui-spinner',\n\t\t\t'jquery-ui-tabs',\n\t\t\t'jquery-ui-tooltip',\n\t\t\t'jquery-ui-widget',\n\t\t\t'underscore',\n\t\t\t'backbone',\n\t\t);\n\n\t\tif ( in_array( $handle, $not_allowed, true ) ) {\n\t\t\t$message = sprintf(\n\t\t\t\t/* translators: 1: Script name, 2: wp_enqueue_scripts */\n\t\t\t\t__( 'Do not deregister the %1$s script in the administration area. To target the front-end theme, use the %2$s hook.' ),\n\t\t\t\t\"<code>$handle</code>\",\n\t\t\t\t'<code>wp_enqueue_scripts</code>'\n\t\t\t);\n\t\t\t_doing_it_wrong( __FUNCTION__, $message, '3.6.0' );\n\t\t\treturn;\n\t\t}\n\t}\n\n\twp_scripts()->remove( $handle );\n}\n\n/**\n * Enqueue a script.\n *\n * Registers the script if $src provided (does NOT overwrite), and enqueues it.\n *\n * @see WP_Dependencies::add()\n * @see WP_Dependencies::add_data()\n * @see WP_Dependencies::enqueue()\n *\n * @since 2.1.0\n *\n * @param string           $handle    Name of the script. Should be unique.\n * @param string           $src       Full URL of the script, or path of the script relative to the WordPress root directory.\n *                                    Default empty.\n * @param string[]         $deps      Optional. An array of registered script handles this script depends on. Default empty array.\n * @param string|bool|null $ver       Optional. String specifying script version number, if it has one, which is added to the URL\n *                                    as a query string for cache busting purposes. If version is set to false, a version\n *                                    number is automatically added equal to current installed WordPress version.\n *                                    If set to null, no version is added.\n * @param bool             $in_footer Optional. Whether to enqueue the script before </body> instead of in the <head>.\n *                                    Default 'false'.\n */\nfunction wp_enqueue_script( $handle, $src = '', $deps = array(), $ver = false, $in_footer = false ) {\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );\n\n\t$wp_scripts = wp_scripts();\n\n\tif ( $src || $in_footer ) {\n\t\t$_handle = explode( '?', $handle );\n\n\t\tif ( $src ) {\n\t\t\t$wp_scripts->add( $_handle[0], $src, $deps, $ver );\n\t\t}\n\n\t\tif ( $in_footer ) {\n\t\t\t$wp_scripts->add_data( $_handle[0], 'group', 1 );\n\t\t}\n\t}\n\n\t$wp_scripts->enqueue( $handle );\n}\n\n/**\n * Remove a previously enqueued script.\n *\n * @see WP_Dependencies::dequeue()\n *\n * @since 3.1.0\n *\n * @param string $handle Name of the script to be removed.\n */\nfunction wp_dequeue_script( $handle ) {\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );\n\n\twp_scripts()->dequeue( $handle );\n}\n\n/**\n * Determines whether a script has been added to the queue.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.8.0\n * @since 3.5.0 'enqueued' added as an alias of the 'queue' list.\n *\n * @param string $handle Name of the script.\n * @param string $list   Optional. Status of the script to check. Default 'enqueued'.\n *                       Accepts 'enqueued', 'registered', 'queue', 'to_do', and 'done'.\n * @return bool Whether the script is queued.\n */\nfunction wp_script_is( $handle, $list = 'enqueued' ) {\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );\n\n\treturn (bool) wp_scripts()->query( $handle, $list );\n}\n\n/**\n * Add metadata to a script.\n *\n * Works only if the script has already been added.\n *\n * Possible values for $key and $value:\n * 'conditional' string Comments for IE 6, lte IE 7, etc.\n *\n * @since 4.2.0\n *\n * @see WP_Dependencies::add_data()\n *\n * @param string $handle Name of the script.\n * @param string $key    Name of data point for which we're storing a value.\n * @param mixed  $value  String containing the data to be added.\n * @return bool True on success, false on failure.\n */\nfunction wp_script_add_data( $handle, $key, $value ) {\n\treturn wp_scripts()->add_data( $handle, $key, $value );\n}\n", "num_lines": 415}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Dependencies API: Styles functions\n *\n * @since 2.6.0\n *\n * @package WordPress\n * @subpackage Dependencies\n */\n\n/**\n * Initialize $wp_styles if it has not been set.\n *\n * @global WP_Styles $wp_styles\n *\n * @since 4.2.0\n *\n * @return WP_Styles WP_Styles instance.\n */\nfunction wp_styles() {\n\tglobal $wp_styles;\n\n\tif ( ! ( $wp_styles instanceof WP_Styles ) ) {\n\t\t$wp_styles = new WP_Styles();\n\t}\n\n\treturn $wp_styles;\n}\n\n/**\n * Display styles that are in the $handles queue.\n *\n * Passing an empty array to $handles prints the queue,\n * passing an array with one string prints that style,\n * and passing an array of strings prints those styles.\n *\n * @global WP_Styles $wp_styles The WP_Styles object for printing styles.\n *\n * @since 2.6.0\n *\n * @param string|bool|array $handles Styles to be printed. Default 'false'.\n * @return string[] On success, an array of handles of processed WP_Dependencies items; otherwise, an empty array.\n */\nfunction wp_print_styles( $handles = false ) {\n\tglobal $wp_styles;\n\n\tif ( '' === $handles ) { // For 'wp_head'.\n\t\t$handles = false;\n\t}\n\n\tif ( ! $handles ) {\n\t\t/**\n\t\t * Fires before styles in the $handles queue are printed.\n\t\t *\n\t\t * @since 2.6.0\n\t\t */\n\t\tdo_action( 'wp_print_styles' );\n\t}\n\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );\n\n\tif ( ! ( $wp_styles instanceof WP_Styles ) ) {\n\t\tif ( ! $handles ) {\n\t\t\treturn array(); // No need to instantiate if nothing is there.\n\t\t}\n\t}\n\n\treturn wp_styles()->do_items( $handles );\n}\n\n/**\n * Add extra CSS styles to a registered stylesheet.\n *\n * Styles will only be added if the stylesheet is already in the queue.\n * Accepts a string $data containing the CSS. If two or more CSS code blocks\n * are added to the same stylesheet $handle, they will be printed in the order\n * they were added, i.e. the latter added styles can redeclare the previous.\n *\n * @see WP_Styles::add_inline_style()\n *\n * @since 3.3.0\n *\n * @param string $handle Name of the stylesheet to add the extra styles to.\n * @param string $data   String containing the CSS styles to be added.\n * @return bool True on success, false on failure.\n */\nfunction wp_add_inline_style( $handle, $data ) {\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );\n\n\tif ( false !== stripos( $data, '</style>' ) ) {\n\t\t_doing_it_wrong(\n\t\t\t__FUNCTION__,\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: <style>, 2: wp_add_inline_style() */\n\t\t\t\t__( 'Do not pass %1$s tags to %2$s.' ),\n\t\t\t\t'<code>&lt;style&gt;</code>',\n\t\t\t\t'<code>wp_add_inline_style()</code>'\n\t\t\t),\n\t\t\t'3.7.0'\n\t\t);\n\t\t$data = trim( preg_replace( '#<style[^>]*>(.*)</style>#is', '$1', $data ) );\n\t}\n\n\treturn wp_styles()->add_inline_style( $handle, $data );\n}\n\n/**\n * Register a CSS stylesheet.\n *\n * @see WP_Dependencies::add()\n * @link https://www.w3.org/TR/CSS2/media.html#media-types List of CSS media types.\n *\n * @since 2.6.0\n * @since 4.3.0 A return value was added.\n *\n * @param string           $handle Name of the stylesheet. Should be unique.\n * @param string|bool      $src    Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.\n *                                 If source is set to false, stylesheet is an alias of other stylesheets it depends on.\n * @param string[]         $deps   Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array.\n * @param string|bool|null $ver    Optional. String specifying stylesheet version number, if it has one, which is added to the URL\n *                                 as a query string for cache busting purposes. If version is set to false, a version\n *                                 number is automatically added equal to current installed WordPress version.\n *                                 If set to null, no version is added.\n * @param string           $media  Optional. The media for which this stylesheet has been defined.\n *                                 Default 'all'. Accepts media types like 'all', 'print' and 'screen', or media queries like\n *                                 '(orientation: portrait)' and '(max-width: 640px)'.\n * @return bool Whether the style has been registered. True on success, false on failure.\n */\nfunction wp_register_style( $handle, $src, $deps = array(), $ver = false, $media = 'all' ) {\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );\n\n\treturn wp_styles()->add( $handle, $src, $deps, $ver, $media );\n}\n\n/**\n * Remove a registered stylesheet.\n *\n * @see WP_Dependencies::remove()\n *\n * @since 2.1.0\n *\n * @param string $handle Name of the stylesheet to be removed.\n */\nfunction wp_deregister_style( $handle ) {\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );\n\n\twp_styles()->remove( $handle );\n}\n\n/**\n * Enqueue a CSS stylesheet.\n *\n * Registers the style if source provided (does NOT overwrite) and enqueues.\n *\n * @see WP_Dependencies::add()\n * @see WP_Dependencies::enqueue()\n * @link https://www.w3.org/TR/CSS2/media.html#media-types List of CSS media types.\n *\n * @since 2.6.0\n *\n * @param string           $handle Name of the stylesheet. Should be unique.\n * @param string           $src    Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.\n *                                 Default empty.\n * @param string[]         $deps   Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array.\n * @param string|bool|null $ver    Optional. String specifying stylesheet version number, if it has one, which is added to the URL\n *                                 as a query string for cache busting purposes. If version is set to false, a version\n *                                 number is automatically added equal to current installed WordPress version.\n *                                 If set to null, no version is added.\n * @param string           $media  Optional. The media for which this stylesheet has been defined.\n *                                 Default 'all'. Accepts media types like 'all', 'print' and 'screen', or media queries like\n *                                 '(orientation: portrait)' and '(max-width: 640px)'.\n */\nfunction wp_enqueue_style( $handle, $src = '', $deps = array(), $ver = false, $media = 'all' ) {\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );\n\n\t$wp_styles = wp_styles();\n\n\tif ( $src ) {\n\t\t$_handle = explode( '?', $handle );\n\t\t$wp_styles->add( $_handle[0], $src, $deps, $ver, $media );\n\t}\n\n\t$wp_styles->enqueue( $handle );\n}\n\n/**\n * Remove a previously enqueued CSS stylesheet.\n *\n * @see WP_Dependencies::dequeue()\n *\n * @since 3.1.0\n *\n * @param string $handle Name of the stylesheet to be removed.\n */\nfunction wp_dequeue_style( $handle ) {\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );\n\n\twp_styles()->dequeue( $handle );\n}\n\n/**\n * Check whether a CSS stylesheet has been added to the queue.\n *\n * @since 2.8.0\n *\n * @param string $handle Name of the stylesheet.\n * @param string $list   Optional. Status of the stylesheet to check. Default 'enqueued'.\n *                       Accepts 'enqueued', 'registered', 'queue', 'to_do', and 'done'.\n * @return bool Whether style is queued.\n */\nfunction wp_style_is( $handle, $list = 'enqueued' ) {\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );\n\n\treturn (bool) wp_styles()->query( $handle, $list );\n}\n\n/**\n * Add metadata to a CSS stylesheet.\n *\n * Works only if the stylesheet has already been added.\n *\n * Possible values for $key and $value:\n * 'conditional' string      Comments for IE 6, lte IE 7 etc.\n * 'rtl'         bool|string To declare an RTL stylesheet.\n * 'suffix'      string      Optional suffix, used in combination with RTL.\n * 'alt'         bool        For rel=\"alternate stylesheet\".\n * 'title'       string      For preferred/alternate stylesheets.\n *\n * @see WP_Dependencies::add_data()\n *\n * @since 3.6.0\n *\n * @param string $handle Name of the stylesheet.\n * @param string $key    Name of data point for which we're storing a value.\n *                       Accepts 'conditional', 'rtl' and 'suffix', 'alt' and 'title'.\n * @param mixed  $value  String containing the CSS data to be added.\n * @return bool True on success, false on failure.\n */\nfunction wp_style_add_data( $handle, $key, $value ) {\n\treturn wp_styles()->add_data( $handle, $key, $value );\n}\n", "num_lines": 242}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * General template tags that can go anywhere in a template.\n *\n * @package WordPress\n * @subpackage Template\n */\n\n/**\n * Load header template.\n *\n * Includes the header template for a theme or if a name is specified then a\n * specialised header will be included.\n *\n * For the parameter, if the file is called \"header-special.php\" then specify\n * \"special\".\n *\n * @since 1.5.0\n * @since 5.5.0 A return value was added.\n * @since 5.5.0 The `$args` parameter was added.\n *\n * @param string $name The name of the specialised header.\n * @param array  $args Optional. Additional arguments passed to the header template.\n *                     Default empty array.\n * @return void|false Void on success, false if the template does not exist.\n */\nfunction get_header( $name = null, $args = array() ) {\n\t/**\n\t * Fires before the header template file is loaded.\n\t *\n\t * @since 2.1.0\n\t * @since 2.8.0 The `$name` parameter was added.\n\t * @since 5.5.0 The `$args` parameter was added.\n\t *\n\t * @param string|null $name Name of the specific header file to use. Null for the default header.\n\t * @param array       $args Additional arguments passed to the header template.\n\t */\n\tdo_action( 'get_header', $name, $args );\n\n\t$templates = array();\n\t$name      = (string) $name;\n\tif ( '' !== $name ) {\n\t\t$templates[] = \"header-{$name}.php\";\n\t}\n\n\t$templates[] = 'header.php';\n\n\tif ( ! locate_template( $templates, true, true, $args ) ) {\n\t\treturn false;\n\t}\n}\n\n/**\n * Load footer template.\n *\n * Includes the footer template for a theme or if a name is specified then a\n * specialised footer will be included.\n *\n * For the parameter, if the file is called \"footer-special.php\" then specify\n * \"special\".\n *\n * @since 1.5.0\n * @since 5.5.0 A return value was added.\n * @since 5.5.0 The `$args` parameter was added.\n *\n * @param string $name The name of the specialised footer.\n * @param array  $args Optional. Additional arguments passed to the footer template.\n *                     Default empty array.\n * @return void|false Void on success, false if the template does not exist.\n */\nfunction get_footer( $name = null, $args = array() ) {\n\t/**\n\t * Fires before the footer template file is loaded.\n\t *\n\t * @since 2.1.0\n\t * @since 2.8.0 The `$name` parameter was added.\n\t * @since 5.5.0 The `$args` parameter was added.\n\t *\n\t * @param string|null $name Name of the specific footer file to use. Null for the default footer.\n\t * @param array       $args Additional arguments passed to the footer template.\n\t */\n\tdo_action( 'get_footer', $name, $args );\n\n\t$templates = array();\n\t$name      = (string) $name;\n\tif ( '' !== $name ) {\n\t\t$templates[] = \"footer-{$name}.php\";\n\t}\n\n\t$templates[] = 'footer.php';\n\n\tif ( ! locate_template( $templates, true, true, $args ) ) {\n\t\treturn false;\n\t}\n}\n\n/**\n * Load sidebar template.\n *\n * Includes the sidebar template for a theme or if a name is specified then a\n * specialised sidebar will be included.\n *\n * For the parameter, if the file is called \"sidebar-special.php\" then specify\n * \"special\".\n *\n * @since 1.5.0\n * @since 5.5.0 A return value was added.\n * @since 5.5.0 The `$args` parameter was added.\n *\n * @param string $name The name of the specialised sidebar.\n * @param array  $args Optional. Additional arguments passed to the sidebar template.\n *                     Default empty array.\n * @return void|false Void on success, false if the template does not exist.\n */\nfunction get_sidebar( $name = null, $args = array() ) {\n\t/**\n\t * Fires before the sidebar template file is loaded.\n\t *\n\t * @since 2.2.0\n\t * @since 2.8.0 The `$name` parameter was added.\n\t * @since 5.5.0 The `$args` parameter was added.\n\t *\n\t * @param string|null $name Name of the specific sidebar file to use. Null for the default sidebar.\n\t * @param array       $args Additional arguments passed to the sidebar template.\n\t */\n\tdo_action( 'get_sidebar', $name, $args );\n\n\t$templates = array();\n\t$name      = (string) $name;\n\tif ( '' !== $name ) {\n\t\t$templates[] = \"sidebar-{$name}.php\";\n\t}\n\n\t$templates[] = 'sidebar.php';\n\n\tif ( ! locate_template( $templates, true, true, $args ) ) {\n\t\treturn false;\n\t}\n}\n\n/**\n * Loads a template part into a template.\n *\n * Provides a simple mechanism for child themes to overload reusable sections of code\n * in the theme.\n *\n * Includes the named template part for a theme or if a name is specified then a\n * specialised part will be included. If the theme contains no {slug}.php file\n * then no template will be included.\n *\n * The template is included using require, not require_once, so you may include the\n * same template part multiple times.\n *\n * For the $name parameter, if the file is called \"{slug}-special.php\" then specify\n * \"special\".\n *\n * @since 3.0.0\n * @since 5.5.0 A return value was added.\n * @since 5.5.0 The `$args` parameter was added.\n *\n * @param string $slug The slug name for the generic template.\n * @param string $name The name of the specialised template.\n * @param array  $args Optional. Additional arguments passed to the template.\n *                     Default empty array.\n * @return void|false Void on success, false if the template does not exist.\n */\nfunction get_template_part( $slug, $name = null, $args = array() ) {\n\t/**\n\t * Fires before the specified template part file is loaded.\n\t *\n\t * The dynamic portion of the hook name, `$slug`, refers to the slug name\n\t * for the generic template part.\n\t *\n\t * @since 3.0.0\n\t * @since 5.5.0 The `$args` parameter was added.\n\t *\n\t * @param string      $slug The slug name for the generic template.\n\t * @param string|null $name The name of the specialized template.\n\t * @param array       $args Additional arguments passed to the template.\n\t */\n\tdo_action( \"get_template_part_{$slug}\", $slug, $name, $args );\n\n\t$templates = array();\n\t$name      = (string) $name;\n\tif ( '' !== $name ) {\n\t\t$templates[] = \"{$slug}-{$name}.php\";\n\t}\n\n\t$templates[] = \"{$slug}.php\";\n\n\t/**\n\t * Fires before a template part is loaded.\n\t *\n\t * @since 5.2.0\n\t * @since 5.5.0 The `$args` parameter was added.\n\t *\n\t * @param string   $slug      The slug name for the generic template.\n\t * @param string   $name      The name of the specialized template.\n\t * @param string[] $templates Array of template files to search for, in order.\n\t * @param array    $args      Additional arguments passed to the template.\n\t */\n\tdo_action( 'get_template_part', $slug, $name, $templates, $args );\n\n\tif ( ! locate_template( $templates, true, false, $args ) ) {\n\t\treturn false;\n\t}\n}\n\n/**\n * Display search form.\n *\n * Will first attempt to locate the searchform.php file in either the child or\n * the parent, then load it. If it doesn't exist, then the default search form\n * will be displayed. The default search form is HTML, which will be displayed.\n * There is a filter applied to the search form HTML in order to edit or replace\n * it. The filter is {@see 'get_search_form'}.\n *\n * This function is primarily used by themes which want to hardcode the search\n * form into the sidebar and also by the search widget in WordPress.\n *\n * There is also an action that is called whenever the function is run called,\n * {@see 'pre_get_search_form'}. This can be useful for outputting JavaScript that the\n * search relies on or various formatting that applies to the beginning of the\n * search. To give a few examples of what it can be used for.\n *\n * @since 2.7.0\n * @since 5.2.0 The `$args` array parameter was added in place of an `$echo` boolean flag.\n *\n * @param array $args {\n *     Optional. Array of display arguments.\n *\n *     @type bool   $echo       Whether to echo or return the form. Default true.\n *     @type string $aria_label ARIA label for the search form. Useful to distinguish\n *                              multiple search forms on the same page and improve\n *                              accessibility. Default empty.\n * }\n * @return void|string Void if 'echo' argument is true, search form HTML if 'echo' is false.\n */\nfunction get_search_form( $args = array() ) {\n\t/**\n\t * Fires before the search form is retrieved, at the start of get_search_form().\n\t *\n\t * @since 2.7.0 as 'get_search_form' action.\n\t * @since 3.6.0\n\t * @since 5.5.0 The `$args` parameter was added.\n\t *\n\t * @link https://core.trac.wordpress.org/ticket/19321\n\t *\n\t * @param array $args The array of arguments for building the search form.\n\t */\n\tdo_action( 'pre_get_search_form', $args );\n\n\t$echo = true;\n\n\tif ( ! is_array( $args ) ) {\n\t\t/*\n\t\t * Back compat: to ensure previous uses of get_search_form() continue to\n\t\t * function as expected, we handle a value for the boolean $echo param removed\n\t\t * in 5.2.0. Then we deal with the $args array and cast its defaults.\n\t\t */\n\t\t$echo = (bool) $args;\n\n\t\t// Set an empty array and allow default arguments to take over.\n\t\t$args = array();\n\t}\n\n\t// Defaults are to echo and to output no custom label on the form.\n\t$defaults = array(\n\t\t'echo'       => $echo,\n\t\t'aria_label' => '',\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\t/**\n\t * Filters the array of arguments used when generating the search form.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param array $args The array of arguments for building the search form.\n\t */\n\t$args = apply_filters( 'search_form_args', $args );\n\n\t// Ensure that the filtered arguments contain all required default values.\n\t$args = array_merge( $defaults, $args );\n\n\t$format = current_theme_supports( 'html5', 'search-form' ) ? 'html5' : 'xhtml';\n\n\t/**\n\t * Filters the HTML format of the search form.\n\t *\n\t * @since 3.6.0\n\t * @since 5.5.0 The `$args` parameter was added.\n\t *\n\t * @param string $format The type of markup to use in the search form.\n\t *                       Accepts 'html5', 'xhtml'.\n\t * @param array  $args   The array of arguments for building the search form.\n\t */\n\t$format = apply_filters( 'search_form_format', $format, $args );\n\n\t$search_form_template = locate_template( 'searchform.php' );\n\n\tif ( '' !== $search_form_template ) {\n\t\tob_start();\n\t\trequire $search_form_template;\n\t\t$form = ob_get_clean();\n\t} else {\n\t\t// Build a string containing an aria-label to use for the search form.\n\t\tif ( $args['aria_label'] ) {\n\t\t\t$aria_label = 'aria-label=\"' . esc_attr( $args['aria_label'] ) . '\" ';\n\t\t} else {\n\t\t\t/*\n\t\t\t * If there's no custom aria-label, we can set a default here. At the\n\t\t\t * moment it's empty as there's uncertainty about what the default should be.\n\t\t\t */\n\t\t\t$aria_label = '';\n\t\t}\n\n\t\tif ( 'html5' === $format ) {\n\t\t\t$form = '<form role=\"search\" ' . $aria_label . 'method=\"get\" class=\"search-form\" action=\"' . esc_url( home_url( '/' ) ) . '\">\n\t\t\t\t<label>\n\t\t\t\t\t<span class=\"screen-reader-text\">' . _x( 'Search for:', 'label' ) . '</span>\n\t\t\t\t\t<input type=\"search\" class=\"search-field\" placeholder=\"' . esc_attr_x( 'Search &hellip;', 'placeholder' ) . '\" value=\"' . get_search_query() . '\" name=\"s\" />\n\t\t\t\t</label>\n\t\t\t\t<input type=\"submit\" class=\"search-submit\" value=\"' . esc_attr_x( 'Search', 'submit button' ) . '\" />\n\t\t\t</form>';\n\t\t} else {\n\t\t\t$form = '<form role=\"search\" ' . $aria_label . 'method=\"get\" id=\"searchform\" class=\"searchform\" action=\"' . esc_url( home_url( '/' ) ) . '\">\n\t\t\t\t<div>\n\t\t\t\t\t<label class=\"screen-reader-text\" for=\"s\">' . _x( 'Search for:', 'label' ) . '</label>\n\t\t\t\t\t<input type=\"text\" value=\"' . get_search_query() . '\" name=\"s\" id=\"s\" />\n\t\t\t\t\t<input type=\"submit\" id=\"searchsubmit\" value=\"' . esc_attr_x( 'Search', 'submit button' ) . '\" />\n\t\t\t\t</div>\n\t\t\t</form>';\n\t\t}\n\t}\n\n\t/**\n\t * Filters the HTML output of the search form.\n\t *\n\t * @since 2.7.0\n\t * @since 5.5.0 The `$args` parameter was added.\n\t *\n\t * @param string $form The search form HTML output.\n\t * @param array  $args The array of arguments for building the search form.\n\t */\n\t$result = apply_filters( 'get_search_form', $form, $args );\n\n\tif ( null === $result ) {\n\t\t$result = $form;\n\t}\n\n\tif ( $args['echo'] ) {\n\t\techo $result;\n\t} else {\n\t\treturn $result;\n\t}\n}\n\n/**\n * Display the Log In/Out link.\n *\n * Displays a link, which allows users to navigate to the Log In page to log in\n * or log out depending on whether they are currently logged in.\n *\n * @since 1.5.0\n *\n * @param string $redirect Optional path to redirect to on login/logout.\n * @param bool   $echo     Default to echo and not return the link.\n * @return void|string Void if `$echo` argument is true, log in/out link if `$echo` is false.\n */\nfunction wp_loginout( $redirect = '', $echo = true ) {\n\tif ( ! is_user_logged_in() ) {\n\t\t$link = '<a href=\"' . esc_url( wp_login_url( $redirect ) ) . '\">' . __( 'Log in' ) . '</a>';\n\t} else {\n\t\t$link = '<a href=\"' . esc_url( wp_logout_url( $redirect ) ) . '\">' . __( 'Log out' ) . '</a>';\n\t}\n\n\tif ( $echo ) {\n\t\t/**\n\t\t * Filters the HTML output for the Log In/Log Out link.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param string $link The HTML link content.\n\t\t */\n\t\techo apply_filters( 'loginout', $link );\n\t} else {\n\t\t/** This filter is documented in wp-includes/general-template.php */\n\t\treturn apply_filters( 'loginout', $link );\n\t}\n}\n\n/**\n * Retrieves the logout URL.\n *\n * Returns the URL that allows the user to log out of the site.\n *\n * @since 2.7.0\n *\n * @param string $redirect Path to redirect to on logout.\n * @return string The logout URL. Note: HTML-encoded via esc_html() in wp_nonce_url().\n */\nfunction wp_logout_url( $redirect = '' ) {\n\t$args = array();\n\tif ( ! empty( $redirect ) ) {\n\t\t$args['redirect_to'] = urlencode( $redirect );\n\t}\n\n\t$logout_url = add_query_arg( $args, site_url( 'wp-login.php?action=logout', 'login' ) );\n\t$logout_url = wp_nonce_url( $logout_url, 'log-out' );\n\n\t/**\n\t * Filters the logout URL.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $logout_url The HTML-encoded logout URL.\n\t * @param string $redirect   Path to redirect to on logout.\n\t */\n\treturn apply_filters( 'logout_url', $logout_url, $redirect );\n}\n\n/**\n * Retrieves the login URL.\n *\n * @since 2.7.0\n *\n * @param string $redirect     Path to redirect to on log in.\n * @param bool   $force_reauth Whether to force reauthorization, even if a cookie is present.\n *                             Default false.\n * @return string The login URL. Not HTML-encoded.\n */\nfunction wp_login_url( $redirect = '', $force_reauth = false ) {\n\t$login_url = site_url( 'wp-login.php', 'login' );\n\n\tif ( ! empty( $redirect ) ) {\n\t\t$login_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $login_url );\n\t}\n\n\tif ( $force_reauth ) {\n\t\t$login_url = add_query_arg( 'reauth', '1', $login_url );\n\t}\n\n\t/**\n\t * Filters the login URL.\n\t *\n\t * @since 2.8.0\n\t * @since 4.2.0 The `$force_reauth` parameter was added.\n\t *\n\t * @param string $login_url    The login URL. Not HTML-encoded.\n\t * @param string $redirect     The path to redirect to on login, if supplied.\n\t * @param bool   $force_reauth Whether to force reauthorization, even if a cookie is present.\n\t */\n\treturn apply_filters( 'login_url', $login_url, $redirect, $force_reauth );\n}\n\n/**\n * Returns the URL that allows the user to register on the site.\n *\n * @since 3.6.0\n *\n * @return string User registration URL.\n */\nfunction wp_registration_url() {\n\t/**\n\t * Filters the user registration URL.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param string $register The user registration URL.\n\t */\n\treturn apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ) );\n}\n\n/**\n * Provides a simple login form for use anywhere within WordPress.\n *\n * The login form HTML is echoed by default. Pass a false value for `$echo` to return it instead.\n *\n * @since 3.0.0\n *\n * @param array $args {\n *     Optional. Array of options to control the form output. Default empty array.\n *\n *     @type bool   $echo           Whether to display the login form or return the form HTML code.\n *                                  Default true (echo).\n *     @type string $redirect       URL to redirect to. Must be absolute, as in \"https://example.com/mypage/\".\n *                                  Default is to redirect back to the request URI.\n *     @type string $form_id        ID attribute value for the form. Default 'loginform'.\n *     @type string $label_username Label for the username or email address field. Default 'Username or Email Address'.\n *     @type string $label_password Label for the password field. Default 'Password'.\n *     @type string $label_remember Label for the remember field. Default 'Remember Me'.\n *     @type string $label_log_in   Label for the submit button. Default 'Log In'.\n *     @type string $id_username    ID attribute value for the username field. Default 'user_login'.\n *     @type string $id_password    ID attribute value for the password field. Default 'user_pass'.\n *     @type string $id_remember    ID attribute value for the remember field. Default 'rememberme'.\n *     @type string $id_submit      ID attribute value for the submit button. Default 'wp-submit'.\n *     @type bool   $remember       Whether to display the \"rememberme\" checkbox in the form.\n *     @type string $value_username Default value for the username field. Default empty.\n *     @type bool   $value_remember Whether the \"Remember Me\" checkbox should be checked by default.\n *                                  Default false (unchecked).\n *\n * }\n * @return void|string Void if 'echo' argument is true, login form HTML if 'echo' is false.\n */\nfunction wp_login_form( $args = array() ) {\n\t$defaults = array(\n\t\t'echo'           => true,\n\t\t// Default 'redirect' value takes the user back to the request URI.\n\t\t'redirect'       => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],\n\t\t'form_id'        => 'loginform',\n\t\t'label_username' => __( 'Username or Email Address' ),\n\t\t'label_password' => __( 'Password' ),\n\t\t'label_remember' => __( 'Remember Me' ),\n\t\t'label_log_in'   => __( 'Log In' ),\n\t\t'id_username'    => 'user_login',\n\t\t'id_password'    => 'user_pass',\n\t\t'id_remember'    => 'rememberme',\n\t\t'id_submit'      => 'wp-submit',\n\t\t'remember'       => true,\n\t\t'value_username' => '',\n\t\t// Set 'value_remember' to true to default the \"Remember me\" checkbox to checked.\n\t\t'value_remember' => false,\n\t);\n\n\t/**\n\t * Filters the default login form output arguments.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @see wp_login_form()\n\t *\n\t * @param array $defaults An array of default login form arguments.\n\t */\n\t$args = wp_parse_args( $args, apply_filters( 'login_form_defaults', $defaults ) );\n\n\t/**\n\t * Filters content to display at the top of the login form.\n\t *\n\t * The filter evaluates just following the opening form tag element.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $content Content to display. Default empty.\n\t * @param array  $args    Array of login form arguments.\n\t */\n\t$login_form_top = apply_filters( 'login_form_top', '', $args );\n\n\t/**\n\t * Filters content to display in the middle of the login form.\n\t *\n\t * The filter evaluates just following the location where the 'login-password'\n\t * field is displayed.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $content Content to display. Default empty.\n\t * @param array  $args    Array of login form arguments.\n\t */\n\t$login_form_middle = apply_filters( 'login_form_middle', '', $args );\n\n\t/**\n\t * Filters content to display at the bottom of the login form.\n\t *\n\t * The filter evaluates just preceding the closing form tag element.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $content Content to display. Default empty.\n\t * @param array  $args    Array of login form arguments.\n\t */\n\t$login_form_bottom = apply_filters( 'login_form_bottom', '', $args );\n\n\t$form = '\n\t\t<form name=\"' . $args['form_id'] . '\" id=\"' . $args['form_id'] . '\" action=\"' . esc_url( site_url( 'wp-login.php', 'login_post' ) ) . '\" method=\"post\">\n\t\t\t' . $login_form_top . '\n\t\t\t<p class=\"login-username\">\n\t\t\t\t<label for=\"' . esc_attr( $args['id_username'] ) . '\">' . esc_html( $args['label_username'] ) . '</label>\n\t\t\t\t<input type=\"text\" name=\"log\" id=\"' . esc_attr( $args['id_username'] ) . '\" class=\"input\" value=\"' . esc_attr( $args['value_username'] ) . '\" size=\"20\" />\n\t\t\t</p>\n\t\t\t<p class=\"login-password\">\n\t\t\t\t<label for=\"' . esc_attr( $args['id_password'] ) . '\">' . esc_html( $args['label_password'] ) . '</label>\n\t\t\t\t<input type=\"password\" name=\"pwd\" id=\"' . esc_attr( $args['id_password'] ) . '\" class=\"input\" value=\"\" size=\"20\" />\n\t\t\t</p>\n\t\t\t' . $login_form_middle . '\n\t\t\t' . ( $args['remember'] ? '<p class=\"login-remember\"><label><input name=\"rememberme\" type=\"checkbox\" id=\"' . esc_attr( $args['id_remember'] ) . '\" value=\"forever\"' . ( $args['value_remember'] ? ' checked=\"checked\"' : '' ) . ' /> ' . esc_html( $args['label_remember'] ) . '</label></p>' : '' ) . '\n\t\t\t<p class=\"login-submit\">\n\t\t\t\t<input type=\"submit\" name=\"wp-submit\" id=\"' . esc_attr( $args['id_submit'] ) . '\" class=\"button button-primary\" value=\"' . esc_attr( $args['label_log_in'] ) . '\" />\n\t\t\t\t<input type=\"hidden\" name=\"redirect_to\" value=\"' . esc_url( $args['redirect'] ) . '\" />\n\t\t\t</p>\n\t\t\t' . $login_form_bottom . '\n\t\t</form>';\n\n\tif ( $args['echo'] ) {\n\t\techo $form;\n\t} else {\n\t\treturn $form;\n\t}\n}\n\n/**\n * Returns the URL that allows the user to retrieve the lost password\n *\n * @since 2.8.0\n *\n * @param string $redirect Path to redirect to on login.\n * @return string Lost password URL.\n */\nfunction wp_lostpassword_url( $redirect = '' ) {\n\t$args = array(\n\t\t'action' => 'lostpassword',\n\t);\n\n\tif ( ! empty( $redirect ) ) {\n\t\t$args['redirect_to'] = urlencode( $redirect );\n\t}\n\n\tif ( is_multisite() ) {\n\t\t$blog_details  = get_blog_details();\n\t\t$wp_login_path = $blog_details->path . 'wp-login.php';\n\t} else {\n\t\t$wp_login_path = 'wp-login.php';\n\t}\n\n\t$lostpassword_url = add_query_arg( $args, network_site_url( $wp_login_path, 'login' ) );\n\n\t/**\n\t * Filters the Lost Password URL.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $lostpassword_url The lost password page URL.\n\t * @param string $redirect         The path to redirect to on login.\n\t */\n\treturn apply_filters( 'lostpassword_url', $lostpassword_url, $redirect );\n}\n\n/**\n * Display the Registration or Admin link.\n *\n * Display a link which allows the user to navigate to the registration page if\n * not logged in and registration is enabled or to the dashboard if logged in.\n *\n * @since 1.5.0\n *\n * @param string $before Text to output before the link. Default `<li>`.\n * @param string $after  Text to output after the link. Default `</li>`.\n * @param bool   $echo   Default to echo and not return the link.\n * @return void|string Void if `$echo` argument is true, registration or admin link\n *                     if `$echo` is false.\n */\nfunction wp_register( $before = '<li>', $after = '</li>', $echo = true ) {\n\tif ( ! is_user_logged_in() ) {\n\t\tif ( get_option( 'users_can_register' ) ) {\n\t\t\t$link = $before . '<a href=\"' . esc_url( wp_registration_url() ) . '\">' . __( 'Register' ) . '</a>' . $after;\n\t\t} else {\n\t\t\t$link = '';\n\t\t}\n\t} elseif ( current_user_can( 'read' ) ) {\n\t\t$link = $before . '<a href=\"' . admin_url() . '\">' . __( 'Site Admin' ) . '</a>' . $after;\n\t} else {\n\t\t$link = '';\n\t}\n\n\t/**\n\t * Filters the HTML link to the Registration or Admin page.\n\t *\n\t * Users are sent to the admin page if logged-in, or the registration page\n\t * if enabled and logged-out.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $link The HTML code for the link to the Registration or Admin page.\n\t */\n\t$link = apply_filters( 'register', $link );\n\n\tif ( $echo ) {\n\t\techo $link;\n\t} else {\n\t\treturn $link;\n\t}\n}\n\n/**\n * Theme container function for the 'wp_meta' action.\n *\n * The {@see 'wp_meta'} action can have several purposes, depending on how you use it,\n * but one purpose might have been to allow for theme switching.\n *\n * @since 1.5.0\n *\n * @link https://core.trac.wordpress.org/ticket/1458 Explanation of 'wp_meta' action.\n */\nfunction wp_meta() {\n\t/**\n\t * Fires before displaying echoed content in the sidebar.\n\t *\n\t * @since 1.5.0\n\t */\n\tdo_action( 'wp_meta' );\n}\n\n/**\n * Displays information about the current site.\n *\n * @since 0.71\n *\n * @see get_bloginfo() For possible `$show` values\n *\n * @param string $show Optional. Site information to display. Default empty.\n */\nfunction bloginfo( $show = '' ) {\n\techo get_bloginfo( $show, 'display' );\n}\n\n/**\n * Retrieves information about the current site.\n *\n * Possible values for `$show` include:\n *\n * - 'name' - Site title (set in Settings > General)\n * - 'description' - Site tagline (set in Settings > General)\n * - 'wpurl' - The WordPress address (URL) (set in Settings > General)\n * - 'url' - The Site address (URL) (set in Settings > General)\n * - 'admin_email' - Admin email (set in Settings > General)\n * - 'charset' - The \"Encoding for pages and feeds\"  (set in Settings > Reading)\n * - 'version' - The current WordPress version\n * - 'html_type' - The content-type (default: \"text/html\"). Themes and plugins\n *   can override the default value using the {@see 'pre_option_html_type'} filter\n * - 'text_direction' - The text direction determined by the site's language. is_rtl()\n *   should be used instead\n * - 'language' - Language code for the current site\n * - 'stylesheet_url' - URL to the stylesheet for the active theme. An active child theme\n *   will take precedence over this value\n * - 'stylesheet_directory' - Directory path for the active theme.  An active child theme\n *   will take precedence over this value\n * - 'template_url' / 'template_directory' - URL of the active theme's directory. An active\n *   child theme will NOT take precedence over this value\n * - 'pingback_url' - The pingback XML-RPC file URL (xmlrpc.php)\n * - 'atom_url' - The Atom feed URL (/feed/atom)\n * - 'rdf_url' - The RDF/RSS 1.0 feed URL (/feed/rdf)\n * - 'rss_url' - The RSS 0.92 feed URL (/feed/rss)\n * - 'rss2_url' - The RSS 2.0 feed URL (/feed)\n * - 'comments_atom_url' - The comments Atom feed URL (/comments/feed)\n * - 'comments_rss2_url' - The comments RSS 2.0 feed URL (/comments/feed)\n *\n * Some `$show` values are deprecated and will be removed in future versions.\n * These options will trigger the _deprecated_argument() function.\n *\n * Deprecated arguments include:\n *\n * - 'siteurl' - Use 'url' instead\n * - 'home' - Use 'url' instead\n *\n * @since 0.71\n *\n * @global string $wp_version The WordPress version string.\n *\n * @param string $show   Optional. Site info to retrieve. Default empty (site name).\n * @param string $filter Optional. How to filter what is retrieved. Default 'raw'.\n * @return string Mostly string values, might be empty.\n */\nfunction get_bloginfo( $show = '', $filter = 'raw' ) {\n\tswitch ( $show ) {\n\t\tcase 'home':    // Deprecated.\n\t\tcase 'siteurl': // Deprecated.\n\t\t\t_deprecated_argument(\n\t\t\t\t__FUNCTION__,\n\t\t\t\t'2.2.0',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: 'siteurl'/'home' argument, 2: bloginfo() function name, 3: 'url' argument. */\n\t\t\t\t\t__( 'The %1$s option is deprecated for the family of %2$s functions. Use the %3$s option instead.' ),\n\t\t\t\t\t'<code>' . $show . '</code>',\n\t\t\t\t\t'<code>bloginfo()</code>',\n\t\t\t\t\t'<code>url</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t\t// Intentional fall-through to be handled by the 'url' case.\n\t\tcase 'url':\n\t\t\t$output = home_url();\n\t\t\tbreak;\n\t\tcase 'wpurl':\n\t\t\t$output = site_url();\n\t\t\tbreak;\n\t\tcase 'description':\n\t\t\t$output = get_option( 'blogdescription' );\n\t\t\tbreak;\n\t\tcase 'rdf_url':\n\t\t\t$output = get_feed_link( 'rdf' );\n\t\t\tbreak;\n\t\tcase 'rss_url':\n\t\t\t$output = get_feed_link( 'rss' );\n\t\t\tbreak;\n\t\tcase 'rss2_url':\n\t\t\t$output = get_feed_link( 'rss2' );\n\t\t\tbreak;\n\t\tcase 'atom_url':\n\t\t\t$output = get_feed_link( 'atom' );\n\t\t\tbreak;\n\t\tcase 'comments_atom_url':\n\t\t\t$output = get_feed_link( 'comments_atom' );\n\t\t\tbreak;\n\t\tcase 'comments_rss2_url':\n\t\t\t$output = get_feed_link( 'comments_rss2' );\n\t\t\tbreak;\n\t\tcase 'pingback_url':\n\t\t\t$output = site_url( 'xmlrpc.php' );\n\t\t\tbreak;\n\t\tcase 'stylesheet_url':\n\t\t\t$output = get_stylesheet_uri();\n\t\t\tbreak;\n\t\tcase 'stylesheet_directory':\n\t\t\t$output = get_stylesheet_directory_uri();\n\t\t\tbreak;\n\t\tcase 'template_directory':\n\t\tcase 'template_url':\n\t\t\t$output = get_template_directory_uri();\n\t\t\tbreak;\n\t\tcase 'admin_email':\n\t\t\t$output = get_option( 'admin_email' );\n\t\t\tbreak;\n\t\tcase 'charset':\n\t\t\t$output = get_option( 'blog_charset' );\n\t\t\tif ( '' === $output ) {\n\t\t\t\t$output = 'UTF-8';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'html_type':\n\t\t\t$output = get_option( 'html_type' );\n\t\t\tbreak;\n\t\tcase 'version':\n\t\t\tglobal $wp_version;\n\t\t\t$output = $wp_version;\n\t\t\tbreak;\n\t\tcase 'language':\n\t\t\t/*\n\t\t\t * translators: Translate this to the correct language tag for your locale,\n\t\t\t * see https://www.w3.org/International/articles/language-tags/ for reference.\n\t\t\t * Do not translate into your own language.\n\t\t\t */\n\t\t\t$output = __( 'html_lang_attribute' );\n\t\t\tif ( 'html_lang_attribute' === $output || preg_match( '/[^a-zA-Z0-9-]/', $output ) ) {\n\t\t\t\t$output = determine_locale();\n\t\t\t\t$output = str_replace( '_', '-', $output );\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'text_direction':\n\t\t\t_deprecated_argument(\n\t\t\t\t__FUNCTION__,\n\t\t\t\t'2.2.0',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: 'text_direction' argument, 2: bloginfo() function name, 3: is_rtl() function name. */\n\t\t\t\t\t__( 'The %1$s option is deprecated for the family of %2$s functions. Use the %3$s function instead.' ),\n\t\t\t\t\t'<code>' . $show . '</code>',\n\t\t\t\t\t'<code>bloginfo()</code>',\n\t\t\t\t\t'<code>is_rtl()</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ( function_exists( 'is_rtl' ) ) {\n\t\t\t\t$output = is_rtl() ? 'rtl' : 'ltr';\n\t\t\t} else {\n\t\t\t\t$output = 'ltr';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'name':\n\t\tdefault:\n\t\t\t$output = get_option( 'blogname' );\n\t\t\tbreak;\n\t}\n\n\t$url = true;\n\tif ( strpos( $show, 'url' ) === false &&\n\t\tstrpos( $show, 'directory' ) === false &&\n\t\tstrpos( $show, 'home' ) === false ) {\n\t\t$url = false;\n\t}\n\n\tif ( 'display' === $filter ) {\n\t\tif ( $url ) {\n\t\t\t/**\n\t\t\t * Filters the URL returned by get_bloginfo().\n\t\t\t *\n\t\t\t * @since 2.0.5\n\t\t\t *\n\t\t\t * @param string $output The URL returned by bloginfo().\n\t\t\t * @param string $show   Type of information requested.\n\t\t\t */\n\t\t\t$output = apply_filters( 'bloginfo_url', $output, $show );\n\t\t} else {\n\t\t\t/**\n\t\t\t * Filters the site information returned by get_bloginfo().\n\t\t\t *\n\t\t\t * @since 0.71\n\t\t\t *\n\t\t\t * @param mixed  $output The requested non-URL site information.\n\t\t\t * @param string $show   Type of information requested.\n\t\t\t */\n\t\t\t$output = apply_filters( 'bloginfo', $output, $show );\n\t\t}\n\t}\n\n\treturn $output;\n}\n\n/**\n * Returns the Site Icon URL.\n *\n * @since 4.3.0\n *\n * @param int    $size    Optional. Size of the site icon. Default 512 (pixels).\n * @param string $url     Optional. Fallback url if no site icon is found. Default empty.\n * @param int    $blog_id Optional. ID of the blog to get the site icon for. Default current blog.\n * @return string Site Icon URL.\n */\nfunction get_site_icon_url( $size = 512, $url = '', $blog_id = 0 ) {\n\t$switched_blog = false;\n\n\tif ( is_multisite() && ! empty( $blog_id ) && get_current_blog_id() !== (int) $blog_id ) {\n\t\tswitch_to_blog( $blog_id );\n\t\t$switched_blog = true;\n\t}\n\n\t$site_icon_id = get_option( 'site_icon' );\n\n\tif ( $site_icon_id ) {\n\t\tif ( $size >= 512 ) {\n\t\t\t$size_data = 'full';\n\t\t} else {\n\t\t\t$size_data = array( $size, $size );\n\t\t}\n\t\t$url = wp_get_attachment_image_url( $site_icon_id, $size_data );\n\t}\n\n\tif ( $switched_blog ) {\n\t\trestore_current_blog();\n\t}\n\n\t/**\n\t * Filters the site icon URL.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $url     Site icon URL.\n\t * @param int    $size    Size of the site icon.\n\t * @param int    $blog_id ID of the blog to get the site icon for.\n\t */\n\treturn apply_filters( 'get_site_icon_url', $url, $size, $blog_id );\n}\n\n/**\n * Displays the Site Icon URL.\n *\n * @since 4.3.0\n *\n * @param int    $size    Optional. Size of the site icon. Default 512 (pixels).\n * @param string $url     Optional. Fallback url if no site icon is found. Default empty.\n * @param int    $blog_id Optional. ID of the blog to get the site icon for. Default current blog.\n */\nfunction site_icon_url( $size = 512, $url = '', $blog_id = 0 ) {\n\techo esc_url( get_site_icon_url( $size, $url, $blog_id ) );\n}\n\n/**\n * Whether the site has a Site Icon.\n *\n * @since 4.3.0\n *\n * @param int $blog_id Optional. ID of the blog in question. Default current blog.\n * @return bool Whether the site has a site icon or not.\n */\nfunction has_site_icon( $blog_id = 0 ) {\n\treturn (bool) get_site_icon_url( 512, '', $blog_id );\n}\n\n/**\n * Determines whether the site has a custom logo.\n *\n * @since 4.5.0\n *\n * @param int $blog_id Optional. ID of the blog in question. Default is the ID of the current blog.\n * @return bool Whether the site has a custom logo or not.\n */\nfunction has_custom_logo( $blog_id = 0 ) {\n\t$switched_blog = false;\n\n\tif ( is_multisite() && ! empty( $blog_id ) && get_current_blog_id() !== (int) $blog_id ) {\n\t\tswitch_to_blog( $blog_id );\n\t\t$switched_blog = true;\n\t}\n\n\t$custom_logo_id = get_theme_mod( 'custom_logo' );\n\n\tif ( $switched_blog ) {\n\t\trestore_current_blog();\n\t}\n\n\treturn (bool) $custom_logo_id;\n}\n\n/**\n * Returns a custom logo, linked to home unless the theme supports removing the link on the home page.\n *\n * @since 4.5.0\n * @since 5.5.0 Added option to remove the link on the home page with `unlink-homepage-logo` theme support.\n * @since 5.5.1 Disabled lazy-loading by default.\n *\n * @param int $blog_id Optional. ID of the blog in question. Default is the ID of the current blog.\n * @return string Custom logo markup.\n */\nfunction get_custom_logo( $blog_id = 0 ) {\n\t$html          = '';\n\t$switched_blog = false;\n\n\tif ( is_multisite() && ! empty( $blog_id ) && get_current_blog_id() !== (int) $blog_id ) {\n\t\tswitch_to_blog( $blog_id );\n\t\t$switched_blog = true;\n\t}\n\n\t$custom_logo_id = get_theme_mod( 'custom_logo' );\n\n\t// We have a logo. Logo is go.\n\tif ( $custom_logo_id ) {\n\t\t$custom_logo_attr = array(\n\t\t\t'class'   => 'custom-logo',\n\t\t\t'loading' => false,\n\t\t);\n\n\t\t$unlink_homepage_logo = (bool) get_theme_support( 'custom-logo', 'unlink-homepage-logo' );\n\n\t\tif ( $unlink_homepage_logo && is_front_page() && ! is_paged() ) {\n\t\t\t/*\n\t\t\t * If on the home page, set the logo alt attribute to an empty string,\n\t\t\t * as the image is decorative and doesn't need its purpose to be described.\n\t\t\t */\n\t\t\t$custom_logo_attr['alt'] = '';\n\t\t} else {\n\t\t\t/*\n\t\t\t * If the logo alt attribute is empty, get the site title and explicitly pass it\n\t\t\t * to the attributes used by wp_get_attachment_image().\n\t\t\t */\n\t\t\t$image_alt = get_post_meta( $custom_logo_id, '_wp_attachment_image_alt', true );\n\t\t\tif ( empty( $image_alt ) ) {\n\t\t\t\t$custom_logo_attr['alt'] = get_bloginfo( 'name', 'display' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the list of custom logo image attributes.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param array $custom_logo_attr Custom logo image attributes.\n\t\t * @param int   $custom_logo_id   Custom logo attachment ID.\n\t\t * @param int   $blog_id          ID of the blog to get the custom logo for.\n\t\t */\n\t\t$custom_logo_attr = apply_filters( 'get_custom_logo_image_attributes', $custom_logo_attr, $custom_logo_id, $blog_id );\n\n\t\t/*\n\t\t * If the alt attribute is not empty, there's no need to explicitly pass it\n\t\t * because wp_get_attachment_image() already adds the alt attribute.\n\t\t */\n\t\t$image = wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr );\n\n\t\tif ( $unlink_homepage_logo && is_front_page() && ! is_paged() ) {\n\t\t\t// If on the home page, don't link the logo to home.\n\t\t\t$html = sprintf(\n\t\t\t\t'<span class=\"custom-logo-link\">%1$s</span>',\n\t\t\t\t$image\n\t\t\t);\n\t\t} else {\n\t\t\t$aria_current = is_front_page() && ! is_paged() ? ' aria-current=\"page\"' : '';\n\n\t\t\t$html = sprintf(\n\t\t\t\t'<a href=\"%1$s\" class=\"custom-logo-link\" rel=\"home\"%2$s>%3$s</a>',\n\t\t\t\tesc_url( home_url( '/' ) ),\n\t\t\t\t$aria_current,\n\t\t\t\t$image\n\t\t\t);\n\t\t}\n\t} elseif ( is_customize_preview() ) {\n\t\t// If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview).\n\t\t$html = sprintf(\n\t\t\t'<a href=\"%1$s\" class=\"custom-logo-link\" style=\"display:none;\"><img class=\"custom-logo\"/></a>',\n\t\t\tesc_url( home_url( '/' ) )\n\t\t);\n\t}\n\n\tif ( $switched_blog ) {\n\t\trestore_current_blog();\n\t}\n\n\t/**\n\t * Filters the custom logo output.\n\t *\n\t * @since 4.5.0\n\t * @since 4.6.0 Added the `$blog_id` parameter.\n\t *\n\t * @param string $html    Custom logo HTML output.\n\t * @param int    $blog_id ID of the blog to get the custom logo for.\n\t */\n\treturn apply_filters( 'get_custom_logo', $html, $blog_id );\n}\n\n/**\n * Displays a custom logo, linked to home unless the theme supports removing the link on the home page.\n *\n * @since 4.5.0\n *\n * @param int $blog_id Optional. ID of the blog in question. Default is the ID of the current blog.\n */\nfunction the_custom_logo( $blog_id = 0 ) {\n\techo get_custom_logo( $blog_id );\n}\n\n/**\n * Returns document title for the current page.\n *\n * @since 4.4.0\n *\n * @global int $page  Page number of a single post.\n * @global int $paged Page number of a list of posts.\n *\n * @return string Tag with the document title.\n */\nfunction wp_get_document_title() {\n\n\t/**\n\t * Filters the document title before it is generated.\n\t *\n\t * Passing a non-empty value will short-circuit wp_get_document_title(),\n\t * returning that value instead.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $title The document title. Default empty string.\n\t */\n\t$title = apply_filters( 'pre_get_document_title', '' );\n\tif ( ! empty( $title ) ) {\n\t\treturn $title;\n\t}\n\n\tglobal $page, $paged;\n\n\t$title = array(\n\t\t'title' => '',\n\t);\n\n\t// If it's a 404 page, use a \"Page not found\" title.\n\tif ( is_404() ) {\n\t\t$title['title'] = __( 'Page not found' );\n\n\t\t// If it's a search, use a dynamic search results title.\n\t} elseif ( is_search() ) {\n\t\t/* translators: %s: Search query. */\n\t\t$title['title'] = sprintf( __( 'Search Results for &#8220;%s&#8221;' ), get_search_query() );\n\n\t\t// If on the front page, use the site title.\n\t} elseif ( is_front_page() ) {\n\t\t$title['title'] = get_bloginfo( 'name', 'display' );\n\n\t\t// If on a post type archive, use the post type archive title.\n\t} elseif ( is_post_type_archive() ) {\n\t\t$title['title'] = post_type_archive_title( '', false );\n\n\t\t// If on a taxonomy archive, use the term title.\n\t} elseif ( is_tax() ) {\n\t\t$title['title'] = single_term_title( '', false );\n\n\t\t/*\n\t\t* If we're on the blog page that is not the homepage\n\t\t* or a single post of any post type, use the post title.\n\t\t*/\n\t} elseif ( is_home() || is_singular() ) {\n\t\t$title['title'] = single_post_title( '', false );\n\n\t\t// If on a category or tag archive, use the term title.\n\t} elseif ( is_category() || is_tag() ) {\n\t\t$title['title'] = single_term_title( '', false );\n\n\t\t// If on an author archive, use the author's display name.\n\t} elseif ( is_author() && get_queried_object() ) {\n\t\t$author         = get_queried_object();\n\t\t$title['title'] = $author->display_name;\n\n\t\t// If it's a date archive, use the date as the title.\n\t} elseif ( is_year() ) {\n\t\t$title['title'] = get_the_date( _x( 'Y', 'yearly archives date format' ) );\n\n\t} elseif ( is_month() ) {\n\t\t$title['title'] = get_the_date( _x( 'F Y', 'monthly archives date format' ) );\n\n\t} elseif ( is_day() ) {\n\t\t$title['title'] = get_the_date();\n\t}\n\n\t// Add a page number if necessary.\n\tif ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {\n\t\t/* translators: %s: Page number. */\n\t\t$title['page'] = sprintf( __( 'Page %s' ), max( $paged, $page ) );\n\t}\n\n\t// Append the description or site title to give context.\n\tif ( is_front_page() ) {\n\t\t$title['tagline'] = get_bloginfo( 'description', 'display' );\n\t} else {\n\t\t$title['site'] = get_bloginfo( 'name', 'display' );\n\t}\n\n\t/**\n\t * Filters the separator for the document title.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $sep Document title separator. Default '-'.\n\t */\n\t$sep = apply_filters( 'document_title_separator', '-' );\n\n\t/**\n\t * Filters the parts of the document title.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $title {\n\t *     The document title parts.\n\t *\n\t *     @type string $title   Title of the viewed page.\n\t *     @type string $page    Optional. Page number if paginated.\n\t *     @type string $tagline Optional. Site description when on home page.\n\t *     @type string $site    Optional. Site title when not on home page.\n\t * }\n\t */\n\t$title = apply_filters( 'document_title_parts', $title );\n\n\t$title = implode( \" $sep \", array_filter( $title ) );\n\t$title = wptexturize( $title );\n\t$title = convert_chars( $title );\n\t$title = esc_html( $title );\n\t$title = capital_P_dangit( $title );\n\n\treturn $title;\n}\n\n/**\n * Displays title tag with content.\n *\n * @ignore\n * @since 4.1.0\n * @since 4.4.0 Improved title output replaced `wp_title()`.\n * @access private\n */\nfunction _wp_render_title_tag() {\n\tif ( ! current_theme_supports( 'title-tag' ) ) {\n\t\treturn;\n\t}\n\n\techo '<title>' . wp_get_document_title() . '</title>' . \"\\n\";\n}\n\n/**\n * Display or retrieve page title for all areas of blog.\n *\n * By default, the page title will display the separator before the page title,\n * so that the blog title will be before the page title. This is not good for\n * title display, since the blog title shows up on most tabs and not what is\n * important, which is the page that the user is looking at.\n *\n * There are also SEO benefits to having the blog title after or to the 'right'\n * of the page title. However, it is mostly common sense to have the blog title\n * to the right with most browsers supporting tabs. You can achieve this by\n * using the seplocation parameter and setting the value to 'right'. This change\n * was introduced around 2.5.0, in case backward compatibility of themes is\n * important.\n *\n * @since 1.0.0\n *\n * @global WP_Locale $wp_locale WordPress date and time locale object.\n *\n * @param string $sep         Optional. How to separate the various items within the page title.\n *                            Default '&raquo;'.\n * @param bool   $display     Optional. Whether to display or retrieve title. Default true.\n * @param string $seplocation Optional. Location of the separator ('left' or 'right').\n * @return string|null String on retrieve, null when displaying.\n */\nfunction wp_title( $sep = '&raquo;', $display = true, $seplocation = '' ) {\n\tglobal $wp_locale;\n\n\t$m        = get_query_var( 'm' );\n\t$year     = get_query_var( 'year' );\n\t$monthnum = get_query_var( 'monthnum' );\n\t$day      = get_query_var( 'day' );\n\t$search   = get_query_var( 's' );\n\t$title    = '';\n\n\t$t_sep = '%WP_TITLE_SEP%'; // Temporary separator, for accurate flipping, if necessary.\n\n\t// If there is a post.\n\tif ( is_single() || ( is_home() && ! is_front_page() ) || ( is_page() && ! is_front_page() ) ) {\n\t\t$title = single_post_title( '', false );\n\t}\n\n\t// If there's a post type archive.\n\tif ( is_post_type_archive() ) {\n\t\t$post_type = get_query_var( 'post_type' );\n\t\tif ( is_array( $post_type ) ) {\n\t\t\t$post_type = reset( $post_type );\n\t\t}\n\t\t$post_type_object = get_post_type_object( $post_type );\n\t\tif ( ! $post_type_object->has_archive ) {\n\t\t\t$title = post_type_archive_title( '', false );\n\t\t}\n\t}\n\n\t// If there's a category or tag.\n\tif ( is_category() || is_tag() ) {\n\t\t$title = single_term_title( '', false );\n\t}\n\n\t// If there's a taxonomy.\n\tif ( is_tax() ) {\n\t\t$term = get_queried_object();\n\t\tif ( $term ) {\n\t\t\t$tax   = get_taxonomy( $term->taxonomy );\n\t\t\t$title = single_term_title( $tax->labels->name . $t_sep, false );\n\t\t}\n\t}\n\n\t// If there's an author.\n\tif ( is_author() && ! is_post_type_archive() ) {\n\t\t$author = get_queried_object();\n\t\tif ( $author ) {\n\t\t\t$title = $author->display_name;\n\t\t}\n\t}\n\n\t// Post type archives with has_archive should override terms.\n\tif ( is_post_type_archive() && $post_type_object->has_archive ) {\n\t\t$title = post_type_archive_title( '', false );\n\t}\n\n\t// If there's a month.\n\tif ( is_archive() && ! empty( $m ) ) {\n\t\t$my_year  = substr( $m, 0, 4 );\n\t\t$my_month = $wp_locale->get_month( substr( $m, 4, 2 ) );\n\t\t$my_day   = intval( substr( $m, 6, 2 ) );\n\t\t$title    = $my_year . ( $my_month ? $t_sep . $my_month : '' ) . ( $my_day ? $t_sep . $my_day : '' );\n\t}\n\n\t// If there's a year.\n\tif ( is_archive() && ! empty( $year ) ) {\n\t\t$title = $year;\n\t\tif ( ! empty( $monthnum ) ) {\n\t\t\t$title .= $t_sep . $wp_locale->get_month( $monthnum );\n\t\t}\n\t\tif ( ! empty( $day ) ) {\n\t\t\t$title .= $t_sep . zeroise( $day, 2 );\n\t\t}\n\t}\n\n\t// If it's a search.\n\tif ( is_search() ) {\n\t\t/* translators: 1: Separator, 2: Search query. */\n\t\t$title = sprintf( __( 'Search Results %1$s %2$s' ), $t_sep, strip_tags( $search ) );\n\t}\n\n\t// If it's a 404 page.\n\tif ( is_404() ) {\n\t\t$title = __( 'Page not found' );\n\t}\n\n\t$prefix = '';\n\tif ( ! empty( $title ) ) {\n\t\t$prefix = \" $sep \";\n\t}\n\n\t/**\n\t * Filters the parts of the page title.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string[] $title_array Array of parts of the page title.\n\t */\n\t$title_array = apply_filters( 'wp_title_parts', explode( $t_sep, $title ) );\n\n\t// Determines position of the separator and direction of the breadcrumb.\n\tif ( 'right' === $seplocation ) { // Separator on right, so reverse the order.\n\t\t$title_array = array_reverse( $title_array );\n\t\t$title       = implode( \" $sep \", $title_array ) . $prefix;\n\t} else {\n\t\t$title = $prefix . implode( \" $sep \", $title_array );\n\t}\n\n\t/**\n\t * Filters the text of the page title.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $title       Page title.\n\t * @param string $sep         Title separator.\n\t * @param string $seplocation Location of the separator ('left' or 'right').\n\t */\n\t$title = apply_filters( 'wp_title', $title, $sep, $seplocation );\n\n\t// Send it out.\n\tif ( $display ) {\n\t\techo $title;\n\t} else {\n\t\treturn $title;\n\t}\n}\n\n/**\n * Display or retrieve page title for post.\n *\n * This is optimized for single.php template file for displaying the post title.\n *\n * It does not support placing the separator after the title, but by leaving the\n * prefix parameter empty, you can set the title separator manually. The prefix\n * does not automatically place a space between the prefix, so if there should\n * be a space, the parameter value will need to have it at the end.\n *\n * @since 0.71\n *\n * @param string $prefix  Optional. What to display before the title.\n * @param bool   $display Optional. Whether to display or retrieve title. Default true.\n * @return string|void Title when retrieving.\n */\nfunction single_post_title( $prefix = '', $display = true ) {\n\t$_post = get_queried_object();\n\n\tif ( ! isset( $_post->post_title ) ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Filters the page title for a single post.\n\t *\n\t * @since 0.71\n\t *\n\t * @param string  $_post_title The single post page title.\n\t * @param WP_Post $_post       The current post.\n\t */\n\t$title = apply_filters( 'single_post_title', $_post->post_title, $_post );\n\tif ( $display ) {\n\t\techo $prefix . $title;\n\t} else {\n\t\treturn $prefix . $title;\n\t}\n}\n\n/**\n * Display or retrieve title for a post type archive.\n *\n * This is optimized for archive.php and archive-{$post_type}.php template files\n * for displaying the title of the post type.\n *\n * @since 3.1.0\n *\n * @param string $prefix  Optional. What to display before the title.\n * @param bool   $display Optional. Whether to display or retrieve title. Default true.\n * @return string|void Title when retrieving, null when displaying or failure.\n */\nfunction post_type_archive_title( $prefix = '', $display = true ) {\n\tif ( ! is_post_type_archive() ) {\n\t\treturn;\n\t}\n\n\t$post_type = get_query_var( 'post_type' );\n\tif ( is_array( $post_type ) ) {\n\t\t$post_type = reset( $post_type );\n\t}\n\n\t$post_type_obj = get_post_type_object( $post_type );\n\n\t/**\n\t * Filters the post type archive title.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $post_type_name Post type 'name' label.\n\t * @param string $post_type      Post type.\n\t */\n\t$title = apply_filters( 'post_type_archive_title', $post_type_obj->labels->name, $post_type );\n\n\tif ( $display ) {\n\t\techo $prefix . $title;\n\t} else {\n\t\treturn $prefix . $title;\n\t}\n}\n\n/**\n * Display or retrieve page title for category archive.\n *\n * Useful for category template files for displaying the category page title.\n * The prefix does not automatically place a space between the prefix, so if\n * there should be a space, the parameter value will need to have it at the end.\n *\n * @since 0.71\n *\n * @param string $prefix  Optional. What to display before the title.\n * @param bool   $display Optional. Whether to display or retrieve title. Default true.\n * @return string|void Title when retrieving.\n */\nfunction single_cat_title( $prefix = '', $display = true ) {\n\treturn single_term_title( $prefix, $display );\n}\n\n/**\n * Display or retrieve page title for tag post archive.\n *\n * Useful for tag template files for displaying the tag page title. The prefix\n * does not automatically place a space between the prefix, so if there should\n * be a space, the parameter value will need to have it at the end.\n *\n * @since 2.3.0\n *\n * @param string $prefix  Optional. What to display before the title.\n * @param bool   $display Optional. Whether to display or retrieve title. Default true.\n * @return string|void Title when retrieving.\n */\nfunction single_tag_title( $prefix = '', $display = true ) {\n\treturn single_term_title( $prefix, $display );\n}\n\n/**\n * Display or retrieve page title for taxonomy term archive.\n *\n * Useful for taxonomy term template files for displaying the taxonomy term page title.\n * The prefix does not automatically place a space between the prefix, so if there should\n * be a space, the parameter value will need to have it at the end.\n *\n * @since 3.1.0\n *\n * @param string $prefix  Optional. What to display before the title.\n * @param bool   $display Optional. Whether to display or retrieve title. Default true.\n * @return string|void Title when retrieving.\n */\nfunction single_term_title( $prefix = '', $display = true ) {\n\t$term = get_queried_object();\n\n\tif ( ! $term ) {\n\t\treturn;\n\t}\n\n\tif ( is_category() ) {\n\t\t/**\n\t\t * Filters the category archive page title.\n\t\t *\n\t\t * @since 2.0.10\n\t\t *\n\t\t * @param string $term_name Category name for archive being displayed.\n\t\t */\n\t\t$term_name = apply_filters( 'single_cat_title', $term->name );\n\t} elseif ( is_tag() ) {\n\t\t/**\n\t\t * Filters the tag archive page title.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param string $term_name Tag name for archive being displayed.\n\t\t */\n\t\t$term_name = apply_filters( 'single_tag_title', $term->name );\n\t} elseif ( is_tax() ) {\n\t\t/**\n\t\t * Filters the custom taxonomy archive page title.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string $term_name Term name for archive being displayed.\n\t\t */\n\t\t$term_name = apply_filters( 'single_term_title', $term->name );\n\t} else {\n\t\treturn;\n\t}\n\n\tif ( empty( $term_name ) ) {\n\t\treturn;\n\t}\n\n\tif ( $display ) {\n\t\techo $prefix . $term_name;\n\t} else {\n\t\treturn $prefix . $term_name;\n\t}\n}\n\n/**\n * Display or retrieve page title for post archive based on date.\n *\n * Useful for when the template only needs to display the month and year,\n * if either are available. The prefix does not automatically place a space\n * between the prefix, so if there should be a space, the parameter value\n * will need to have it at the end.\n *\n * @since 0.71\n *\n * @global WP_Locale $wp_locale WordPress date and time locale object.\n *\n * @param string $prefix  Optional. What to display before the title.\n * @param bool   $display Optional. Whether to display or retrieve title. Default true.\n * @return string|void Title when retrieving.\n */\nfunction single_month_title( $prefix = '', $display = true ) {\n\tglobal $wp_locale;\n\n\t$m        = get_query_var( 'm' );\n\t$year     = get_query_var( 'year' );\n\t$monthnum = get_query_var( 'monthnum' );\n\n\tif ( ! empty( $monthnum ) && ! empty( $year ) ) {\n\t\t$my_year  = $year;\n\t\t$my_month = $wp_locale->get_month( $monthnum );\n\t} elseif ( ! empty( $m ) ) {\n\t\t$my_year  = substr( $m, 0, 4 );\n\t\t$my_month = $wp_locale->get_month( substr( $m, 4, 2 ) );\n\t}\n\n\tif ( empty( $my_month ) ) {\n\t\treturn false;\n\t}\n\n\t$result = $prefix . $my_month . $prefix . $my_year;\n\n\tif ( ! $display ) {\n\t\treturn $result;\n\t}\n\techo $result;\n}\n\n/**\n * Display the archive title based on the queried object.\n *\n * @since 4.1.0\n *\n * @see get_the_archive_title()\n *\n * @param string $before Optional. Content to prepend to the title. Default empty.\n * @param string $after  Optional. Content to append to the title. Default empty.\n */\nfunction the_archive_title( $before = '', $after = '' ) {\n\t$title = get_the_archive_title();\n\n\tif ( ! empty( $title ) ) {\n\t\techo $before . $title . $after;\n\t}\n}\n\n/**\n * Retrieve the archive title based on the queried object.\n *\n * @since 4.1.0\n * @since 5.5.0 The title part is wrapped in a `<span>` element.\n *\n * @return string Archive title.\n */\nfunction get_the_archive_title() {\n\t$title  = __( 'Archives' );\n\t$prefix = '';\n\n\tif ( is_category() ) {\n\t\t$title  = single_cat_title( '', false );\n\t\t$prefix = _x( 'Category:', 'category archive title prefix' );\n\t} elseif ( is_tag() ) {\n\t\t$title  = single_tag_title( '', false );\n\t\t$prefix = _x( 'Tag:', 'tag archive title prefix' );\n\t} elseif ( is_author() ) {\n\t\t$title  = get_the_author();\n\t\t$prefix = _x( 'Author:', 'author archive title prefix' );\n\t} elseif ( is_year() ) {\n\t\t$title  = get_the_date( _x( 'Y', 'yearly archives date format' ) );\n\t\t$prefix = _x( 'Year:', 'date archive title prefix' );\n\t} elseif ( is_month() ) {\n\t\t$title  = get_the_date( _x( 'F Y', 'monthly archives date format' ) );\n\t\t$prefix = _x( 'Month:', 'date archive title prefix' );\n\t} elseif ( is_day() ) {\n\t\t$title  = get_the_date( _x( 'F j, Y', 'daily archives date format' ) );\n\t\t$prefix = _x( 'Day:', 'date archive title prefix' );\n\t} elseif ( is_tax( 'post_format' ) ) {\n\t\tif ( is_tax( 'post_format', 'post-format-aside' ) ) {\n\t\t\t$title = _x( 'Asides', 'post format archive title' );\n\t\t} elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) {\n\t\t\t$title = _x( 'Galleries', 'post format archive title' );\n\t\t} elseif ( is_tax( 'post_format', 'post-format-image' ) ) {\n\t\t\t$title = _x( 'Images', 'post format archive title' );\n\t\t} elseif ( is_tax( 'post_format', 'post-format-video' ) ) {\n\t\t\t$title = _x( 'Videos', 'post format archive title' );\n\t\t} elseif ( is_tax( 'post_format', 'post-format-quote' ) ) {\n\t\t\t$title = _x( 'Quotes', 'post format archive title' );\n\t\t} elseif ( is_tax( 'post_format', 'post-format-link' ) ) {\n\t\t\t$title = _x( 'Links', 'post format archive title' );\n\t\t} elseif ( is_tax( 'post_format', 'post-format-status' ) ) {\n\t\t\t$title = _x( 'Statuses', 'post format archive title' );\n\t\t} elseif ( is_tax( 'post_format', 'post-format-audio' ) ) {\n\t\t\t$title = _x( 'Audio', 'post format archive title' );\n\t\t} elseif ( is_tax( 'post_format', 'post-format-chat' ) ) {\n\t\t\t$title = _x( 'Chats', 'post format archive title' );\n\t\t}\n\t} elseif ( is_post_type_archive() ) {\n\t\t$title  = post_type_archive_title( '', false );\n\t\t$prefix = _x( 'Archives:', 'post type archive title prefix' );\n\t} elseif ( is_tax() ) {\n\t\t$queried_object = get_queried_object();\n\t\tif ( $queried_object ) {\n\t\t\t$tax    = get_taxonomy( $queried_object->taxonomy );\n\t\t\t$title  = single_term_title( '', false );\n\t\t\t$prefix = sprintf(\n\t\t\t\t/* translators: %s: Taxonomy singular name. */\n\t\t\t\t_x( '%s:', 'taxonomy term archive title prefix' ),\n\t\t\t\t$tax->labels->singular_name\n\t\t\t);\n\t\t}\n\t}\n\n\t$original_title = $title;\n\n\t/**\n\t * Filters the archive title prefix.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $prefix Archive title prefix.\n\t */\n\t$prefix = apply_filters( 'get_the_archive_title_prefix', $prefix );\n\tif ( $prefix ) {\n\t\t$title = sprintf(\n\t\t\t/* translators: 1: Title prefix. 2: Title. */\n\t\t\t_x( '%1$s %2$s', 'archive title' ),\n\t\t\t$prefix,\n\t\t\t'<span>' . $title . '</span>'\n\t\t);\n\t}\n\n\t/**\n\t * Filters the archive title.\n\t *\n\t * @since 4.1.0\n\t * @since 5.5.0 Added the `$prefix` and `$original_title` parameters.\n\t *\n\t * @param string $title          Archive title to be displayed.\n\t * @param string $original_title Archive title without prefix.\n\t * @param string $prefix         Archive title prefix.\n\t */\n\treturn apply_filters( 'get_the_archive_title', $title, $original_title, $prefix );\n}\n\n/**\n * Display category, tag, term, or author description.\n *\n * @since 4.1.0\n *\n * @see get_the_archive_description()\n *\n * @param string $before Optional. Content to prepend to the description. Default empty.\n * @param string $after  Optional. Content to append to the description. Default empty.\n */\nfunction the_archive_description( $before = '', $after = '' ) {\n\t$description = get_the_archive_description();\n\tif ( $description ) {\n\t\techo $before . $description . $after;\n\t}\n}\n\n/**\n * Retrieves the description for an author, post type, or term archive.\n *\n * @since 4.1.0\n * @since 4.7.0 Added support for author archives.\n * @since 4.9.0 Added support for post type archives.\n *\n * @see term_description()\n *\n * @return string Archive description.\n */\nfunction get_the_archive_description() {\n\tif ( is_author() ) {\n\t\t$description = get_the_author_meta( 'description' );\n\t} elseif ( is_post_type_archive() ) {\n\t\t$description = get_the_post_type_description();\n\t} else {\n\t\t$description = term_description();\n\t}\n\n\t/**\n\t * Filters the archive description.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param string $description Archive description to be displayed.\n\t */\n\treturn apply_filters( 'get_the_archive_description', $description );\n}\n\n/**\n * Retrieves the description for a post type archive.\n *\n * @since 4.9.0\n *\n * @return string The post type description.\n */\nfunction get_the_post_type_description() {\n\t$post_type = get_query_var( 'post_type' );\n\n\tif ( is_array( $post_type ) ) {\n\t\t$post_type = reset( $post_type );\n\t}\n\n\t$post_type_obj = get_post_type_object( $post_type );\n\n\t// Check if a description is set.\n\tif ( isset( $post_type_obj->description ) ) {\n\t\t$description = $post_type_obj->description;\n\t} else {\n\t\t$description = '';\n\t}\n\n\t/**\n\t * Filters the description for a post type archive.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param string       $description   The post type description.\n\t * @param WP_Post_Type $post_type_obj The post type object.\n\t */\n\treturn apply_filters( 'get_the_post_type_description', $description, $post_type_obj );\n}\n\n/**\n * Retrieve archive link content based on predefined or custom code.\n *\n * The format can be one of four styles. The 'link' for head element, 'option'\n * for use in the select element, 'html' for use in list (either ol or ul HTML\n * elements). Custom content is also supported using the before and after\n * parameters.\n *\n * The 'link' format uses the `<link>` HTML element with the **archives**\n * relationship. The before and after parameters are not used. The text\n * parameter is used to describe the link.\n *\n * The 'option' format uses the option HTML element for use in select element.\n * The value is the url parameter and the before and after parameters are used\n * between the text description.\n *\n * The 'html' format, which is the default, uses the li HTML element for use in\n * the list HTML elements. The before parameter is before the link and the after\n * parameter is after the closing link.\n *\n * The custom format uses the before parameter before the link ('a' HTML\n * element) and the after parameter after the closing link tag. If the above\n * three values for the format are not used, then custom format is assumed.\n *\n * @since 1.0.0\n * @since 5.2.0 Added the `$selected` parameter.\n *\n * @param string $url      URL to archive.\n * @param string $text     Archive text description.\n * @param string $format   Optional. Can be 'link', 'option', 'html', or custom. Default 'html'.\n * @param string $before   Optional. Content to prepend to the description. Default empty.\n * @param string $after    Optional. Content to append to the description. Default empty.\n * @param bool   $selected Optional. Set to true if the current page is the selected archive page.\n * @return string HTML link content for archive.\n */\nfunction get_archives_link( $url, $text, $format = 'html', $before = '', $after = '', $selected = false ) {\n\t$text         = wptexturize( $text );\n\t$url          = esc_url( $url );\n\t$aria_current = $selected ? ' aria-current=\"page\"' : '';\n\n\tif ( 'link' === $format ) {\n\t\t$link_html = \"\\t<link rel='archives' title='\" . esc_attr( $text ) . \"' href='$url' />\\n\";\n\t} elseif ( 'option' === $format ) {\n\t\t$selected_attr = $selected ? \" selected='selected'\" : '';\n\t\t$link_html     = \"\\t<option value='$url'$selected_attr>$before $text $after</option>\\n\";\n\t} elseif ( 'html' === $format ) {\n\t\t$link_html = \"\\t<li>$before<a href='$url'$aria_current>$text</a>$after</li>\\n\";\n\t} else { // Custom.\n\t\t$link_html = \"\\t$before<a href='$url'$aria_current>$text</a>$after\\n\";\n\t}\n\n\t/**\n\t * Filters the archive link content.\n\t *\n\t * @since 2.6.0\n\t * @since 4.5.0 Added the `$url`, `$text`, `$format`, `$before`, and `$after` parameters.\n\t * @since 5.2.0 Added the `$selected` parameter.\n\t *\n\t * @param string $link_html The archive HTML link content.\n\t * @param string $url       URL to archive.\n\t * @param string $text      Archive text description.\n\t * @param string $format    Link format. Can be 'link', 'option', 'html', or custom.\n\t * @param string $before    Content to prepend to the description.\n\t * @param string $after     Content to append to the description.\n\t * @param bool   $selected  True if the current page is the selected archive.\n\t */\n\treturn apply_filters( 'get_archives_link', $link_html, $url, $text, $format, $before, $after, $selected );\n}\n\n/**\n * Display archive links based on type and format.\n *\n * @since 1.2.0\n * @since 4.4.0 The `$post_type` argument was added.\n * @since 5.2.0 The `$year`, `$monthnum`, `$day`, and `$w` arguments were added.\n *\n * @see get_archives_link()\n *\n * @global wpdb      $wpdb      WordPress database abstraction object.\n * @global WP_Locale $wp_locale WordPress date and time locale object.\n *\n * @param string|array $args {\n *     Default archive links arguments. Optional.\n *\n *     @type string     $type            Type of archive to retrieve. Accepts 'daily', 'weekly', 'monthly',\n *                                       'yearly', 'postbypost', or 'alpha'. Both 'postbypost' and 'alpha'\n *                                       display the same archive link list as well as post titles instead\n *                                       of displaying dates. The difference between the two is that 'alpha'\n *                                       will order by post title and 'postbypost' will order by post date.\n *                                       Default 'monthly'.\n *     @type string|int $limit           Number of links to limit the query to. Default empty (no limit).\n *     @type string     $format          Format each link should take using the $before and $after args.\n *                                       Accepts 'link' (`<link>` tag), 'option' (`<option>` tag), 'html'\n *                                       (`<li>` tag), or a custom format, which generates a link anchor\n *                                       with $before preceding and $after succeeding. Default 'html'.\n *     @type string     $before          Markup to prepend to the beginning of each link. Default empty.\n *     @type string     $after           Markup to append to the end of each link. Default empty.\n *     @type bool       $show_post_count Whether to display the post count alongside the link. Default false.\n *     @type bool|int   $echo            Whether to echo or return the links list. Default 1|true to echo.\n *     @type string     $order           Whether to use ascending or descending order. Accepts 'ASC', or 'DESC'.\n *                                       Default 'DESC'.\n *     @type string     $post_type       Post type. Default 'post'.\n *     @type string     $year            Year. Default current year.\n *     @type string     $monthnum        Month number. Default current month number.\n *     @type string     $day             Day. Default current day.\n *     @type string     $w               Week. Default current week.\n * }\n * @return void|string Void if 'echo' argument is true, archive links if 'echo' is false.\n */\nfunction wp_get_archives( $args = '' ) {\n\tglobal $wpdb, $wp_locale;\n\n\t$defaults = array(\n\t\t'type'            => 'monthly',\n\t\t'limit'           => '',\n\t\t'format'          => 'html',\n\t\t'before'          => '',\n\t\t'after'           => '',\n\t\t'show_post_count' => false,\n\t\t'echo'            => 1,\n\t\t'order'           => 'DESC',\n\t\t'post_type'       => 'post',\n\t\t'year'            => get_query_var( 'year' ),\n\t\t'monthnum'        => get_query_var( 'monthnum' ),\n\t\t'day'             => get_query_var( 'day' ),\n\t\t'w'               => get_query_var( 'w' ),\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t$post_type_object = get_post_type_object( $parsed_args['post_type'] );\n\tif ( ! is_post_type_viewable( $post_type_object ) ) {\n\t\treturn;\n\t}\n\n\t$parsed_args['post_type'] = $post_type_object->name;\n\n\tif ( '' === $parsed_args['type'] ) {\n\t\t$parsed_args['type'] = 'monthly';\n\t}\n\n\tif ( ! empty( $parsed_args['limit'] ) ) {\n\t\t$parsed_args['limit'] = absint( $parsed_args['limit'] );\n\t\t$parsed_args['limit'] = ' LIMIT ' . $parsed_args['limit'];\n\t}\n\n\t$order = strtoupper( $parsed_args['order'] );\n\tif ( 'ASC' !== $order ) {\n\t\t$order = 'DESC';\n\t}\n\n\t// This is what will separate dates on weekly archive links.\n\t$archive_week_separator = '&#8211;';\n\n\t$sql_where = $wpdb->prepare( \"WHERE post_type = %s AND post_status = 'publish'\", $parsed_args['post_type'] );\n\n\t/**\n\t * Filters the SQL WHERE clause for retrieving archives.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @param string $sql_where   Portion of SQL query containing the WHERE clause.\n\t * @param array  $parsed_args An array of default arguments.\n\t */\n\t$where = apply_filters( 'getarchives_where', $sql_where, $parsed_args );\n\n\t/**\n\t * Filters the SQL JOIN clause for retrieving archives.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @param string $sql_join    Portion of SQL query containing JOIN clause.\n\t * @param array  $parsed_args An array of default arguments.\n\t */\n\t$join = apply_filters( 'getarchives_join', '', $parsed_args );\n\n\t$output = '';\n\n\t$last_changed = wp_cache_get_last_changed( 'posts' );\n\n\t$limit = $parsed_args['limit'];\n\n\tif ( 'monthly' === $parsed_args['type'] ) {\n\t\t$query   = \"SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date $order $limit\";\n\t\t$key     = md5( $query );\n\t\t$key     = \"wp_get_archives:$key:$last_changed\";\n\t\t$results = wp_cache_get( $key, 'posts' );\n\t\tif ( ! $results ) {\n\t\t\t$results = $wpdb->get_results( $query );\n\t\t\twp_cache_set( $key, $results, 'posts' );\n\t\t}\n\t\tif ( $results ) {\n\t\t\t$after = $parsed_args['after'];\n\t\t\tforeach ( (array) $results as $result ) {\n\t\t\t\t$url = get_month_link( $result->year, $result->month );\n\t\t\t\tif ( 'post' !== $parsed_args['post_type'] ) {\n\t\t\t\t\t$url = add_query_arg( 'post_type', $parsed_args['post_type'], $url );\n\t\t\t\t}\n\t\t\t\t/* translators: 1: Month name, 2: 4-digit year. */\n\t\t\t\t$text = sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $result->month ), $result->year );\n\t\t\t\tif ( $parsed_args['show_post_count'] ) {\n\t\t\t\t\t$parsed_args['after'] = '&nbsp;(' . $result->posts . ')' . $after;\n\t\t\t\t}\n\t\t\t\t$selected = is_archive() && (string) $parsed_args['year'] === $result->year && (string) $parsed_args['monthnum'] === $result->month;\n\t\t\t\t$output  .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'], $selected );\n\t\t\t}\n\t\t}\n\t} elseif ( 'yearly' === $parsed_args['type'] ) {\n\t\t$query   = \"SELECT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date $order $limit\";\n\t\t$key     = md5( $query );\n\t\t$key     = \"wp_get_archives:$key:$last_changed\";\n\t\t$results = wp_cache_get( $key, 'posts' );\n\t\tif ( ! $results ) {\n\t\t\t$results = $wpdb->get_results( $query );\n\t\t\twp_cache_set( $key, $results, 'posts' );\n\t\t}\n\t\tif ( $results ) {\n\t\t\t$after = $parsed_args['after'];\n\t\t\tforeach ( (array) $results as $result ) {\n\t\t\t\t$url = get_year_link( $result->year );\n\t\t\t\tif ( 'post' !== $parsed_args['post_type'] ) {\n\t\t\t\t\t$url = add_query_arg( 'post_type', $parsed_args['post_type'], $url );\n\t\t\t\t}\n\t\t\t\t$text = sprintf( '%d', $result->year );\n\t\t\t\tif ( $parsed_args['show_post_count'] ) {\n\t\t\t\t\t$parsed_args['after'] = '&nbsp;(' . $result->posts . ')' . $after;\n\t\t\t\t}\n\t\t\t\t$selected = is_archive() && (string) $parsed_args['year'] === $result->year;\n\t\t\t\t$output  .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'], $selected );\n\t\t\t}\n\t\t}\n\t} elseif ( 'daily' === $parsed_args['type'] ) {\n\t\t$query   = \"SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date $order $limit\";\n\t\t$key     = md5( $query );\n\t\t$key     = \"wp_get_archives:$key:$last_changed\";\n\t\t$results = wp_cache_get( $key, 'posts' );\n\t\tif ( ! $results ) {\n\t\t\t$results = $wpdb->get_results( $query );\n\t\t\twp_cache_set( $key, $results, 'posts' );\n\t\t}\n\t\tif ( $results ) {\n\t\t\t$after = $parsed_args['after'];\n\t\t\tforeach ( (array) $results as $result ) {\n\t\t\t\t$url = get_day_link( $result->year, $result->month, $result->dayofmonth );\n\t\t\t\tif ( 'post' !== $parsed_args['post_type'] ) {\n\t\t\t\t\t$url = add_query_arg( 'post_type', $parsed_args['post_type'], $url );\n\t\t\t\t}\n\t\t\t\t$date = sprintf( '%1$d-%2$02d-%3$02d 00:00:00', $result->year, $result->month, $result->dayofmonth );\n\t\t\t\t$text = mysql2date( get_option( 'date_format' ), $date );\n\t\t\t\tif ( $parsed_args['show_post_count'] ) {\n\t\t\t\t\t$parsed_args['after'] = '&nbsp;(' . $result->posts . ')' . $after;\n\t\t\t\t}\n\t\t\t\t$selected = is_archive() && (string) $parsed_args['year'] === $result->year && (string) $parsed_args['monthnum'] === $result->month && (string) $parsed_args['day'] === $result->dayofmonth;\n\t\t\t\t$output  .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'], $selected );\n\t\t\t}\n\t\t}\n\t} elseif ( 'weekly' === $parsed_args['type'] ) {\n\t\t$week    = _wp_mysql_week( '`post_date`' );\n\t\t$query   = \"SELECT DISTINCT $week AS `week`, YEAR( `post_date` ) AS `yr`, DATE_FORMAT( `post_date`, '%Y-%m-%d' ) AS `yyyymmdd`, count( `ID` ) AS `posts` FROM `$wpdb->posts` $join $where GROUP BY $week, YEAR( `post_date` ) ORDER BY `post_date` $order $limit\";\n\t\t$key     = md5( $query );\n\t\t$key     = \"wp_get_archives:$key:$last_changed\";\n\t\t$results = wp_cache_get( $key, 'posts' );\n\t\tif ( ! $results ) {\n\t\t\t$results = $wpdb->get_results( $query );\n\t\t\twp_cache_set( $key, $results, 'posts' );\n\t\t}\n\t\t$arc_w_last = '';\n\t\tif ( $results ) {\n\t\t\t$after = $parsed_args['after'];\n\t\t\tforeach ( (array) $results as $result ) {\n\t\t\t\tif ( $result->week != $arc_w_last ) {\n\t\t\t\t\t$arc_year       = $result->yr;\n\t\t\t\t\t$arc_w_last     = $result->week;\n\t\t\t\t\t$arc_week       = get_weekstartend( $result->yyyymmdd, get_option( 'start_of_week' ) );\n\t\t\t\t\t$arc_week_start = date_i18n( get_option( 'date_format' ), $arc_week['start'] );\n\t\t\t\t\t$arc_week_end   = date_i18n( get_option( 'date_format' ), $arc_week['end'] );\n\t\t\t\t\t$url            = add_query_arg(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'm' => $arc_year,\n\t\t\t\t\t\t\t'w' => $result->week,\n\t\t\t\t\t\t),\n\t\t\t\t\t\thome_url( '/' )\n\t\t\t\t\t);\n\t\t\t\t\tif ( 'post' !== $parsed_args['post_type'] ) {\n\t\t\t\t\t\t$url = add_query_arg( 'post_type', $parsed_args['post_type'], $url );\n\t\t\t\t\t}\n\t\t\t\t\t$text = $arc_week_start . $archive_week_separator . $arc_week_end;\n\t\t\t\t\tif ( $parsed_args['show_post_count'] ) {\n\t\t\t\t\t\t$parsed_args['after'] = '&nbsp;(' . $result->posts . ')' . $after;\n\t\t\t\t\t}\n\t\t\t\t\t$selected = is_archive() && (string) $parsed_args['year'] === $result->yr && (string) $parsed_args['w'] === $result->week;\n\t\t\t\t\t$output  .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'], $selected );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} elseif ( ( 'postbypost' === $parsed_args['type'] ) || ( 'alpha' === $parsed_args['type'] ) ) {\n\t\t$orderby = ( 'alpha' === $parsed_args['type'] ) ? 'post_title ASC ' : 'post_date DESC, ID DESC ';\n\t\t$query   = \"SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit\";\n\t\t$key     = md5( $query );\n\t\t$key     = \"wp_get_archives:$key:$last_changed\";\n\t\t$results = wp_cache_get( $key, 'posts' );\n\t\tif ( ! $results ) {\n\t\t\t$results = $wpdb->get_results( $query );\n\t\t\twp_cache_set( $key, $results, 'posts' );\n\t\t}\n\t\tif ( $results ) {\n\t\t\tforeach ( (array) $results as $result ) {\n\t\t\t\tif ( '0000-00-00 00:00:00' !== $result->post_date ) {\n\t\t\t\t\t$url = get_permalink( $result );\n\t\t\t\t\tif ( $result->post_title ) {\n\t\t\t\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t\t\t\t$text = strip_tags( apply_filters( 'the_title', $result->post_title, $result->ID ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$text = $result->ID;\n\t\t\t\t\t}\n\t\t\t\t\t$selected = get_the_ID() === $result->ID;\n\t\t\t\t\t$output  .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'], $selected );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( $parsed_args['echo'] ) {\n\t\techo $output;\n\t} else {\n\t\treturn $output;\n\t}\n}\n\n/**\n * Get number of days since the start of the week.\n *\n * @since 1.5.0\n *\n * @param int $num Number of day.\n * @return float Days since the start of the week.\n */\nfunction calendar_week_mod( $num ) {\n\t$base = 7;\n\treturn ( $num - $base * floor( $num / $base ) );\n}\n\n/**\n * Display calendar with days that have posts as links.\n *\n * The calendar is cached, which will be retrieved, if it exists. If there are\n * no posts for the month, then it will not be displayed.\n *\n * @since 1.0.0\n *\n * @global wpdb      $wpdb      WordPress database abstraction object.\n * @global int       $m\n * @global int       $monthnum\n * @global int       $year\n * @global WP_Locale $wp_locale WordPress date and time locale object.\n * @global array     $posts\n *\n * @param bool $initial Optional. Whether to use initial calendar names. Default true.\n * @param bool $echo    Optional. Whether to display the calendar output. Default true.\n * @return void|string Void if `$echo` argument is true, calendar HTML if `$echo` is false.\n */\nfunction get_calendar( $initial = true, $echo = true ) {\n\tglobal $wpdb, $m, $monthnum, $year, $wp_locale, $posts;\n\n\t$key   = md5( $m . $monthnum . $year );\n\t$cache = wp_cache_get( 'get_calendar', 'calendar' );\n\n\tif ( $cache && is_array( $cache ) && isset( $cache[ $key ] ) ) {\n\t\t/** This filter is documented in wp-includes/general-template.php */\n\t\t$output = apply_filters( 'get_calendar', $cache[ $key ] );\n\n\t\tif ( $echo ) {\n\t\t\techo $output;\n\t\t\treturn;\n\t\t}\n\n\t\treturn $output;\n\t}\n\n\tif ( ! is_array( $cache ) ) {\n\t\t$cache = array();\n\t}\n\n\t// Quick check. If we have no posts at all, abort!\n\tif ( ! $posts ) {\n\t\t$gotsome = $wpdb->get_var( \"SELECT 1 as test FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1\" );\n\t\tif ( ! $gotsome ) {\n\t\t\t$cache[ $key ] = '';\n\t\t\twp_cache_set( 'get_calendar', $cache, 'calendar' );\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif ( isset( $_GET['w'] ) ) {\n\t\t$w = (int) $_GET['w'];\n\t}\n\t// week_begins = 0 stands for Sunday.\n\t$week_begins = (int) get_option( 'start_of_week' );\n\n\t// Let's figure out when we are.\n\tif ( ! empty( $monthnum ) && ! empty( $year ) ) {\n\t\t$thismonth = zeroise( intval( $monthnum ), 2 );\n\t\t$thisyear  = (int) $year;\n\t} elseif ( ! empty( $w ) ) {\n\t\t// We need to get the month from MySQL.\n\t\t$thisyear = (int) substr( $m, 0, 4 );\n\t\t// It seems MySQL's weeks disagree with PHP's.\n\t\t$d         = ( ( $w - 1 ) * 7 ) + 6;\n\t\t$thismonth = $wpdb->get_var( \"SELECT DATE_FORMAT((DATE_ADD('{$thisyear}0101', INTERVAL $d DAY) ), '%m')\" );\n\t} elseif ( ! empty( $m ) ) {\n\t\t$thisyear = (int) substr( $m, 0, 4 );\n\t\tif ( strlen( $m ) < 6 ) {\n\t\t\t$thismonth = '01';\n\t\t} else {\n\t\t\t$thismonth = zeroise( (int) substr( $m, 4, 2 ), 2 );\n\t\t}\n\t} else {\n\t\t$thisyear  = current_time( 'Y' );\n\t\t$thismonth = current_time( 'm' );\n\t}\n\n\t$unixmonth = mktime( 0, 0, 0, $thismonth, 1, $thisyear );\n\t$last_day  = gmdate( 't', $unixmonth );\n\n\t// Get the next and previous month and year with at least one post.\n\t$previous = $wpdb->get_row(\n\t\t\"SELECT MONTH(post_date) AS month, YEAR(post_date) AS year\n\t\tFROM $wpdb->posts\n\t\tWHERE post_date < '$thisyear-$thismonth-01'\n\t\tAND post_type = 'post' AND post_status = 'publish'\n\t\t\tORDER BY post_date DESC\n\t\t\tLIMIT 1\"\n\t);\n\t$next     = $wpdb->get_row(\n\t\t\"SELECT MONTH(post_date) AS month, YEAR(post_date) AS year\n\t\tFROM $wpdb->posts\n\t\tWHERE post_date > '$thisyear-$thismonth-{$last_day} 23:59:59'\n\t\tAND post_type = 'post' AND post_status = 'publish'\n\t\t\tORDER BY post_date ASC\n\t\t\tLIMIT 1\"\n\t);\n\n\t/* translators: Calendar caption: 1: Month name, 2: 4-digit year. */\n\t$calendar_caption = _x( '%1$s %2$s', 'calendar caption' );\n\t$calendar_output  = '<table id=\"wp-calendar\" class=\"wp-calendar-table\">\n\t<caption>' . sprintf(\n\t\t$calendar_caption,\n\t\t$wp_locale->get_month( $thismonth ),\n\t\tgmdate( 'Y', $unixmonth )\n\t) . '</caption>\n\t<thead>\n\t<tr>';\n\n\t$myweek = array();\n\n\tfor ( $wdcount = 0; $wdcount <= 6; $wdcount++ ) {\n\t\t$myweek[] = $wp_locale->get_weekday( ( $wdcount + $week_begins ) % 7 );\n\t}\n\n\tforeach ( $myweek as $wd ) {\n\t\t$day_name         = $initial ? $wp_locale->get_weekday_initial( $wd ) : $wp_locale->get_weekday_abbrev( $wd );\n\t\t$wd               = esc_attr( $wd );\n\t\t$calendar_output .= \"\\n\\t\\t<th scope=\\\"col\\\" title=\\\"$wd\\\">$day_name</th>\";\n\t}\n\n\t$calendar_output .= '\n\t</tr>\n\t</thead>\n\t<tbody>\n\t<tr>';\n\n\t$daywithpost = array();\n\n\t// Get days with posts.\n\t$dayswithposts = $wpdb->get_results(\n\t\t\"SELECT DISTINCT DAYOFMONTH(post_date)\n\t\tFROM $wpdb->posts WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00'\n\t\tAND post_type = 'post' AND post_status = 'publish'\n\t\tAND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59'\",\n\t\tARRAY_N\n\t);\n\n\tif ( $dayswithposts ) {\n\t\tforeach ( (array) $dayswithposts as $daywith ) {\n\t\t\t$daywithpost[] = (int) $daywith[0];\n\t\t}\n\t}\n\n\t// See how much we should pad in the beginning.\n\t$pad = calendar_week_mod( gmdate( 'w', $unixmonth ) - $week_begins );\n\tif ( 0 != $pad ) {\n\t\t$calendar_output .= \"\\n\\t\\t\" . '<td colspan=\"' . esc_attr( $pad ) . '\" class=\"pad\">&nbsp;</td>';\n\t}\n\n\t$newrow      = false;\n\t$daysinmonth = (int) gmdate( 't', $unixmonth );\n\n\tfor ( $day = 1; $day <= $daysinmonth; ++$day ) {\n\t\tif ( isset( $newrow ) && $newrow ) {\n\t\t\t$calendar_output .= \"\\n\\t</tr>\\n\\t<tr>\\n\\t\\t\";\n\t\t}\n\t\t$newrow = false;\n\n\t\tif ( current_time( 'j' ) == $day &&\n\t\t\tcurrent_time( 'm' ) == $thismonth &&\n\t\t\tcurrent_time( 'Y' ) == $thisyear ) {\n\t\t\t$calendar_output .= '<td id=\"today\">';\n\t\t} else {\n\t\t\t$calendar_output .= '<td>';\n\t\t}\n\n\t\tif ( in_array( $day, $daywithpost, true ) ) {\n\t\t\t// Any posts today?\n\t\t\t$date_format = gmdate( _x( 'F j, Y', 'daily archives date format' ), strtotime( \"{$thisyear}-{$thismonth}-{$day}\" ) );\n\t\t\t/* translators: Post calendar label. %s: Date. */\n\t\t\t$label            = sprintf( __( 'Posts published on %s' ), $date_format );\n\t\t\t$calendar_output .= sprintf(\n\t\t\t\t'<a href=\"%s\" aria-label=\"%s\">%s</a>',\n\t\t\t\tget_day_link( $thisyear, $thismonth, $day ),\n\t\t\t\tesc_attr( $label ),\n\t\t\t\t$day\n\t\t\t);\n\t\t} else {\n\t\t\t$calendar_output .= $day;\n\t\t}\n\n\t\t$calendar_output .= '</td>';\n\n\t\tif ( 6 == calendar_week_mod( gmdate( 'w', mktime( 0, 0, 0, $thismonth, $day, $thisyear ) ) - $week_begins ) ) {\n\t\t\t$newrow = true;\n\t\t}\n\t}\n\n\t$pad = 7 - calendar_week_mod( gmdate( 'w', mktime( 0, 0, 0, $thismonth, $day, $thisyear ) ) - $week_begins );\n\tif ( 0 != $pad && 7 != $pad ) {\n\t\t$calendar_output .= \"\\n\\t\\t\" . '<td class=\"pad\" colspan=\"' . esc_attr( $pad ) . '\">&nbsp;</td>';\n\t}\n\n\t$calendar_output .= \"\\n\\t</tr>\\n\\t</tbody>\";\n\n\t$calendar_output .= \"\\n\\t</table>\";\n\n\t$calendar_output .= '<nav aria-label=\"' . __( 'Previous and next months' ) . '\" class=\"wp-calendar-nav\">';\n\n\tif ( $previous ) {\n\t\t$calendar_output .= \"\\n\\t\\t\" . '<span class=\"wp-calendar-nav-prev\"><a href=\"' . get_month_link( $previous->year, $previous->month ) . '\">&laquo; ' .\n\t\t\t$wp_locale->get_month_abbrev( $wp_locale->get_month( $previous->month ) ) .\n\t\t'</a></span>';\n\t} else {\n\t\t$calendar_output .= \"\\n\\t\\t\" . '<span class=\"wp-calendar-nav-prev\">&nbsp;</span>';\n\t}\n\n\t$calendar_output .= \"\\n\\t\\t\" . '<span class=\"pad\">&nbsp;</span>';\n\n\tif ( $next ) {\n\t\t$calendar_output .= \"\\n\\t\\t\" . '<span class=\"wp-calendar-nav-next\"><a href=\"' . get_month_link( $next->year, $next->month ) . '\">' .\n\t\t\t$wp_locale->get_month_abbrev( $wp_locale->get_month( $next->month ) ) .\n\t\t' &raquo;</a></span>';\n\t} else {\n\t\t$calendar_output .= \"\\n\\t\\t\" . '<span class=\"wp-calendar-nav-next\">&nbsp;</span>';\n\t}\n\n\t$calendar_output .= '\n\t</nav>';\n\n\t$cache[ $key ] = $calendar_output;\n\twp_cache_set( 'get_calendar', $cache, 'calendar' );\n\n\tif ( $echo ) {\n\t\t/**\n\t\t * Filters the HTML calendar output.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string $calendar_output HTML output of the calendar.\n\t\t */\n\t\techo apply_filters( 'get_calendar', $calendar_output );\n\t\treturn;\n\t}\n\t/** This filter is documented in wp-includes/general-template.php */\n\treturn apply_filters( 'get_calendar', $calendar_output );\n}\n\n/**\n * Purge the cached results of get_calendar.\n *\n * @see get_calendar\n * @since 2.1.0\n */\nfunction delete_get_calendar_cache() {\n\twp_cache_delete( 'get_calendar', 'calendar' );\n}\n\n/**\n * Display all of the allowed tags in HTML format with attributes.\n *\n * This is useful for displaying in the comment area, which elements and\n * attributes are supported. As well as any plugins which want to display it.\n *\n * @since 1.0.1\n *\n * @global array $allowedtags\n *\n * @return string HTML allowed tags entity encoded.\n */\nfunction allowed_tags() {\n\tglobal $allowedtags;\n\t$allowed = '';\n\tforeach ( (array) $allowedtags as $tag => $attributes ) {\n\t\t$allowed .= '<' . $tag;\n\t\tif ( 0 < count( $attributes ) ) {\n\t\t\tforeach ( $attributes as $attribute => $limits ) {\n\t\t\t\t$allowed .= ' ' . $attribute . '=\"\"';\n\t\t\t}\n\t\t}\n\t\t$allowed .= '> ';\n\t}\n\treturn htmlentities( $allowed );\n}\n\n/***** Date/Time tags */\n\n/**\n * Outputs the date in iso8601 format for xml files.\n *\n * @since 1.0.0\n */\nfunction the_date_xml() {\n\techo mysql2date( 'Y-m-d', get_post()->post_date, false );\n}\n\n/**\n * Display or Retrieve the date the current post was written (once per date)\n *\n * Will only output the date if the current post's date is different from the\n * previous one output.\n *\n * i.e. Only one date listing will show per day worth of posts shown in the loop, even if the\n * function is called several times for each post.\n *\n * HTML output can be filtered with 'the_date'.\n * Date string output can be filtered with 'get_the_date'.\n *\n * @since 0.71\n *\n * @global string $currentday  The day of the current post in the loop.\n * @global string $previousday The day of the previous post in the loop.\n *\n * @param string $format Optional. PHP date format defaults to the date_format option if not specified.\n * @param string $before Optional. Output before the date.\n * @param string $after  Optional. Output after the date.\n * @param bool   $echo   Optional. Whether to echo the date or return it. Default true.\n * @return string|void String if retrieving.\n */\nfunction the_date( $format = '', $before = '', $after = '', $echo = true ) {\n\tglobal $currentday, $previousday;\n\n\t$the_date = '';\n\n\tif ( is_new_day() ) {\n\t\t$the_date    = $before . get_the_date( $format ) . $after;\n\t\t$previousday = $currentday;\n\t}\n\n\t/**\n\t * Filters the date a post was published for display.\n\t *\n\t * @since 0.71\n\t *\n\t * @param string $the_date The formatted date string.\n\t * @param string $format   PHP date format. Defaults to 'date_format' option\n\t *                         if not specified.\n\t * @param string $before   HTML output before the date.\n\t * @param string $after    HTML output after the date.\n\t */\n\t$the_date = apply_filters( 'the_date', $the_date, $format, $before, $after );\n\n\tif ( $echo ) {\n\t\techo $the_date;\n\t} else {\n\t\treturn $the_date;\n\t}\n}\n\n/**\n * Retrieve the date on which the post was written.\n *\n * Unlike the_date() this function will always return the date.\n * Modify output with the {@see 'get_the_date'} filter.\n *\n * @since 3.0.0\n *\n * @param string      $format Optional. PHP date format defaults to the date_format option if not specified.\n * @param int|WP_Post $post   Optional. Post ID or WP_Post object. Default current post.\n * @return string|false Date the current post was written. False on failure.\n */\nfunction get_the_date( $format = '', $post = null ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$_format = ! empty( $format ) ? $format : get_option( 'date_format' );\n\n\t$the_date = get_post_time( $_format, false, $post, true );\n\n\t/**\n\t * Filters the date a post was published.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string      $the_date The formatted date.\n\t * @param string      $format   PHP date format. Defaults to 'date_format' option\n\t *                              if not specified.\n\t * @param int|WP_Post $post     The post object or ID.\n\t */\n\treturn apply_filters( 'get_the_date', $the_date, $format, $post );\n}\n\n/**\n * Display the date on which the post was last modified.\n *\n * @since 2.1.0\n *\n * @param string $format Optional. PHP date format defaults to the date_format option if not specified.\n * @param string $before Optional. Output before the date.\n * @param string $after  Optional. Output after the date.\n * @param bool   $echo   Optional. Whether to echo the date or return it. Default true.\n * @return string|void String if retrieving.\n */\nfunction the_modified_date( $format = '', $before = '', $after = '', $echo = true ) {\n\t$the_modified_date = $before . get_the_modified_date( $format ) . $after;\n\n\t/**\n\t * Filters the date a post was last modified for display.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $the_modified_date The last modified date.\n\t * @param string $format            PHP date format. Defaults to 'date_format' option\n\t *                                  if not specified.\n\t * @param string $before            HTML output before the date.\n\t * @param string $after             HTML output after the date.\n\t */\n\t$the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $format, $before, $after );\n\n\tif ( $echo ) {\n\t\techo $the_modified_date;\n\t} else {\n\t\treturn $the_modified_date;\n\t}\n\n}\n\n/**\n * Retrieve the date on which the post was last modified.\n *\n * @since 2.1.0\n * @since 4.6.0 Added the `$post` parameter.\n *\n * @param string      $format Optional. PHP date format defaults to the date_format option if not specified.\n * @param int|WP_Post $post   Optional. Post ID or WP_Post object. Default current post.\n * @return string|false Date the current post was modified. False on failure.\n */\nfunction get_the_modified_date( $format = '', $post = null ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\t// For backward compatibility, failures go through the filter below.\n\t\t$the_time = false;\n\t} else {\n\t\t$_format = ! empty( $format ) ? $format : get_option( 'date_format' );\n\n\t\t$the_time = get_post_modified_time( $_format, false, $post, true );\n\t}\n\n\t/**\n\t * Filters the date a post was last modified.\n\t *\n\t * @since 2.1.0\n\t * @since 4.6.0 Added the `$post` parameter.\n\t *\n\t * @param string|bool  $the_time The formatted date or false if no post is found.\n\t * @param string       $format   PHP date format. Defaults to value specified in\n\t *                               'date_format' option.\n\t * @param WP_Post|null $post     WP_Post object or null if no post is found.\n\t */\n\treturn apply_filters( 'get_the_modified_date', $the_time, $format, $post );\n}\n\n/**\n * Display the time at which the post was written.\n *\n * @since 0.71\n *\n * @param string $format Either 'G', 'U', or PHP date format.\n */\nfunction the_time( $format = '' ) {\n\t/**\n\t * Filters the time a post was written for display.\n\t *\n\t * @since 0.71\n\t *\n\t * @param string $get_the_time The formatted time.\n\t * @param string $format       The time format. Accepts 'G', 'U',\n\t *                             or PHP date format.\n\t */\n\techo apply_filters( 'the_time', get_the_time( $format ), $format );\n}\n\n/**\n * Retrieve the time at which the post was written.\n *\n * @since 1.5.0\n *\n * @param string      $format Optional. Format to use for retrieving the time the post\n *                            was written. Either 'G', 'U', or PHP date format defaults\n *                            to the value specified in the time_format option. Default empty.\n * @param int|WP_Post $post   WP_Post object or ID. Default is global `$post` object.\n * @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.\n *                          False on failure.\n */\nfunction get_the_time( $format = '', $post = null ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$_format = ! empty( $format ) ? $format : get_option( 'time_format' );\n\n\t$the_time = get_post_time( $_format, false, $post, true );\n\n\t/**\n\t * Filters the time a post was written.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string      $the_time The formatted time.\n\t * @param string      $format   Format to use for retrieving the time the post was written.\n\t *                              Accepts 'G', 'U', or PHP date format value specified\n\t *                              in 'time_format' option. Default empty.\n\t * @param int|WP_Post $post     WP_Post object or ID.\n\t */\n\treturn apply_filters( 'get_the_time', $the_time, $format, $post );\n}\n\n/**\n * Retrieve the time at which the post was written.\n *\n * @since 2.0.0\n *\n * @param string      $format    Optional. Format to use for retrieving the time the post\n *                               was written. Either 'G', 'U', or PHP date format. Default 'U'.\n * @param bool        $gmt       Optional. Whether to retrieve the GMT time. Default false.\n * @param int|WP_Post $post      WP_Post object or ID. Default is global `$post` object.\n * @param bool        $translate Whether to translate the time string. Default false.\n * @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.\n *                          False on failure.\n */\nfunction get_post_time( $format = 'U', $gmt = false, $post = null, $translate = false ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$source   = ( $gmt ) ? 'gmt' : 'local';\n\t$datetime = get_post_datetime( $post, 'date', $source );\n\n\tif ( false === $datetime ) {\n\t\treturn false;\n\t}\n\n\tif ( 'U' === $format || 'G' === $format ) {\n\t\t$time = $datetime->getTimestamp();\n\n\t\t// Returns a sum of timestamp with timezone offset. Ideally should never be used.\n\t\tif ( ! $gmt ) {\n\t\t\t$time += $datetime->getOffset();\n\t\t}\n\t} elseif ( $translate ) {\n\t\t$time = wp_date( $format, $datetime->getTimestamp(), $gmt ? new DateTimeZone( 'UTC' ) : null );\n\t} else {\n\t\tif ( $gmt ) {\n\t\t\t$datetime = $datetime->setTimezone( new DateTimeZone( 'UTC' ) );\n\t\t}\n\n\t\t$time = $datetime->format( $format );\n\t}\n\n\t/**\n\t * Filters the localized time a post was written.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param string $time   The formatted time.\n\t * @param string $format Format to use for retrieving the time the post was written.\n\t *                       Accepts 'G', 'U', or PHP date format. Default 'U'.\n\t * @param bool   $gmt    Whether to retrieve the GMT time. Default false.\n\t */\n\treturn apply_filters( 'get_post_time', $time, $format, $gmt );\n}\n\n/**\n * Retrieve post published or modified time as a `DateTimeImmutable` object instance.\n *\n * The object will be set to the timezone from WordPress settings.\n *\n * For legacy reasons, this function allows to choose to instantiate from local or UTC time in database.\n * Normally this should make no difference to the result. However, the values might get out of sync in database,\n * typically because of timezone setting changes. The parameter ensures the ability to reproduce backwards\n * compatible behaviors in such cases.\n *\n * @since 5.3.0\n *\n * @param int|WP_Post $post   Optional. WP_Post object or ID. Default is global `$post` object.\n * @param string      $field  Optional. Published or modified time to use from database. Accepts 'date' or 'modified'.\n *                            Default 'date'.\n * @param string      $source Optional. Local or UTC time to use from database. Accepts 'local' or 'gmt'.\n *                            Default 'local'.\n * @return DateTimeImmutable|false Time object on success, false on failure.\n */\nfunction get_post_datetime( $post = null, $field = 'date', $source = 'local' ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$wp_timezone = wp_timezone();\n\n\tif ( 'gmt' === $source ) {\n\t\t$time     = ( 'modified' === $field ) ? $post->post_modified_gmt : $post->post_date_gmt;\n\t\t$timezone = new DateTimeZone( 'UTC' );\n\t} else {\n\t\t$time     = ( 'modified' === $field ) ? $post->post_modified : $post->post_date;\n\t\t$timezone = $wp_timezone;\n\t}\n\n\tif ( empty( $time ) || '0000-00-00 00:00:00' === $time ) {\n\t\treturn false;\n\t}\n\n\t$datetime = date_create_immutable_from_format( 'Y-m-d H:i:s', $time, $timezone );\n\n\tif ( false === $datetime ) {\n\t\treturn false;\n\t}\n\n\treturn $datetime->setTimezone( $wp_timezone );\n}\n\n/**\n * Retrieve post published or modified time as a Unix timestamp.\n *\n * Note that this function returns a true Unix timestamp, not summed with timezone offset\n * like older WP functions.\n *\n * @since 5.3.0\n *\n * @param int|WP_Post $post  Optional. WP_Post object or ID. Default is global `$post` object.\n * @param string      $field Optional. Published or modified time to use from database. Accepts 'date' or 'modified'.\n *                           Default 'date'.\n * @return int|false Unix timestamp on success, false on failure.\n */\nfunction get_post_timestamp( $post = null, $field = 'date' ) {\n\t$datetime = get_post_datetime( $post, $field );\n\n\tif ( false === $datetime ) {\n\t\treturn false;\n\t}\n\n\treturn $datetime->getTimestamp();\n}\n\n/**\n * Display the time at which the post was last modified.\n *\n * @since 2.0.0\n *\n * @param string $format Optional. Either 'G', 'U', or PHP date format defaults\n *                       to the value specified in the time_format option.\n */\nfunction the_modified_time( $format = '' ) {\n\t/**\n\t * Filters the localized time a post was last modified, for display.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $get_the_modified_time The formatted time.\n\t * @param string $format                The time format. Accepts 'G', 'U',\n\t *                                      or PHP date format. Defaults to value\n\t *                                      specified in 'time_format' option.\n\t */\n\techo apply_filters( 'the_modified_time', get_the_modified_time( $format ), $format );\n}\n\n/**\n * Retrieve the time at which the post was last modified.\n *\n * @since 2.0.0\n * @since 4.6.0 Added the `$post` parameter.\n *\n * @param string      $format Optional. Format to use for retrieving the time the post\n *                            was modified. Either 'G', 'U', or PHP date format defaults\n *                            to the value specified in the time_format option. Default empty.\n * @param int|WP_Post $post   Optional. Post ID or WP_Post object. Default current post.\n * @return string|false Formatted date string or Unix timestamp. False on failure.\n */\nfunction get_the_modified_time( $format = '', $post = null ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\t// For backward compatibility, failures go through the filter below.\n\t\t$the_time = false;\n\t} else {\n\t\t$_format = ! empty( $format ) ? $format : get_option( 'time_format' );\n\n\t\t$the_time = get_post_modified_time( $_format, false, $post, true );\n\t}\n\n\t/**\n\t * Filters the localized time a post was last modified.\n\t *\n\t * @since 2.0.0\n\t * @since 4.6.0 Added the `$post` parameter.\n\t *\n\t * @param string|bool  $the_time The formatted time or false if no post is found.\n\t * @param string       $format   Format to use for retrieving the time the post was\n\t *                               written. Accepts 'G', 'U', or PHP date format. Defaults\n\t *                               to value specified in 'time_format' option.\n\t * @param WP_Post|null $post     WP_Post object or null if no post is found.\n\t */\n\treturn apply_filters( 'get_the_modified_time', $the_time, $format, $post );\n}\n\n/**\n * Retrieve the time at which the post was last modified.\n *\n * @since 2.0.0\n *\n * @param string      $format    Optional. Format to use for retrieving the time the post\n *                               was modified. Either 'G', 'U', or PHP date format. Default 'U'.\n * @param bool        $gmt       Optional. Whether to retrieve the GMT time. Default false.\n * @param int|WP_Post $post      WP_Post object or ID. Default is global `$post` object.\n * @param bool        $translate Whether to translate the time string. Default false.\n * @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.\n *                          False on failure.\n */\nfunction get_post_modified_time( $format = 'U', $gmt = false, $post = null, $translate = false ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$source   = ( $gmt ) ? 'gmt' : 'local';\n\t$datetime = get_post_datetime( $post, 'modified', $source );\n\n\tif ( false === $datetime ) {\n\t\treturn false;\n\t}\n\n\tif ( 'U' === $format || 'G' === $format ) {\n\t\t$time = $datetime->getTimestamp();\n\n\t\t// Returns a sum of timestamp with timezone offset. Ideally should never be used.\n\t\tif ( ! $gmt ) {\n\t\t\t$time += $datetime->getOffset();\n\t\t}\n\t} elseif ( $translate ) {\n\t\t$time = wp_date( $format, $datetime->getTimestamp(), $gmt ? new DateTimeZone( 'UTC' ) : null );\n\t} else {\n\t\tif ( $gmt ) {\n\t\t\t$datetime = $datetime->setTimezone( new DateTimeZone( 'UTC' ) );\n\t\t}\n\n\t\t$time = $datetime->format( $format );\n\t}\n\n\t/**\n\t * Filters the localized time a post was last modified.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $time   The formatted time.\n\t * @param string $format Format to use for retrieving the time the post was modified.\n\t *                       Accepts 'G', 'U', or PHP date format. Default 'U'.\n\t * @param bool   $gmt    Whether to retrieve the GMT time. Default false.\n\t */\n\treturn apply_filters( 'get_post_modified_time', $time, $format, $gmt );\n}\n\n/**\n * Display the weekday on which the post was written.\n *\n * @since 0.71\n *\n * @global WP_Locale $wp_locale WordPress date and time locale object.\n */\nfunction the_weekday() {\n\tglobal $wp_locale;\n\n\t$post = get_post();\n\n\tif ( ! $post ) {\n\t\treturn;\n\t}\n\n\t$the_weekday = $wp_locale->get_weekday( get_post_time( 'w', false, $post ) );\n\n\t/**\n\t * Filters the weekday on which the post was written, for display.\n\t *\n\t * @since 0.71\n\t *\n\t * @param string $the_weekday\n\t */\n\techo apply_filters( 'the_weekday', $the_weekday );\n}\n\n/**\n * Display the weekday on which the post was written.\n *\n * Will only output the weekday if the current post's weekday is different from\n * the previous one output.\n *\n * @since 0.71\n *\n * @global WP_Locale $wp_locale       WordPress date and time locale object.\n * @global string    $currentday      The day of the current post in the loop.\n * @global string    $previousweekday The day of the previous post in the loop.\n *\n * @param string $before Optional. Output before the date.\n * @param string $after  Optional. Output after the date.\n */\nfunction the_weekday_date( $before = '', $after = '' ) {\n\tglobal $wp_locale, $currentday, $previousweekday;\n\n\t$post = get_post();\n\n\tif ( ! $post ) {\n\t\treturn;\n\t}\n\n\t$the_weekday_date = '';\n\n\tif ( $currentday !== $previousweekday ) {\n\t\t$the_weekday_date .= $before;\n\t\t$the_weekday_date .= $wp_locale->get_weekday( get_post_time( 'w', false, $post ) );\n\t\t$the_weekday_date .= $after;\n\t\t$previousweekday   = $currentday;\n\t}\n\n\t/**\n\t * Filters the localized date on which the post was written, for display.\n\t *\n\t * @since 0.71\n\t *\n\t * @param string $the_weekday_date The weekday on which the post was written.\n\t * @param string $before           The HTML to output before the date.\n\t * @param string $after            The HTML to output after the date.\n\t */\n\techo apply_filters( 'the_weekday_date', $the_weekday_date, $before, $after );\n}\n\n/**\n * Fire the wp_head action.\n *\n * See {@see 'wp_head'}.\n *\n * @since 1.2.0\n */\nfunction wp_head() {\n\t/**\n\t * Prints scripts or data in the head tag on the front end.\n\t *\n\t * @since 1.5.0\n\t */\n\tdo_action( 'wp_head' );\n}\n\n/**\n * Fire the wp_footer action.\n *\n * See {@see 'wp_footer'}.\n *\n * @since 1.5.1\n */\nfunction wp_footer() {\n\t/**\n\t * Prints scripts or data before the closing body tag on the front end.\n\t *\n\t * @since 1.5.1\n\t */\n\tdo_action( 'wp_footer' );\n}\n\n/**\n * Fire the wp_body_open action.\n *\n * See {@see 'wp_body_open'}.\n *\n * @since 5.2.0\n */\nfunction wp_body_open() {\n\t/**\n\t * Triggered after the opening body tag.\n\t *\n\t * @since 5.2.0\n\t */\n\tdo_action( 'wp_body_open' );\n}\n\n/**\n * Display the links to the general feeds.\n *\n * @since 2.8.0\n *\n * @param array $args Optional arguments.\n */\nfunction feed_links( $args = array() ) {\n\tif ( ! current_theme_supports( 'automatic-feed-links' ) ) {\n\t\treturn;\n\t}\n\n\t$defaults = array(\n\t\t/* translators: Separator between blog name and feed type in feed links. */\n\t\t'separator' => _x( '&raquo;', 'feed link' ),\n\t\t/* translators: 1: Blog title, 2: Separator (raquo). */\n\t\t'feedtitle' => __( '%1$s %2$s Feed' ),\n\t\t/* translators: 1: Blog title, 2: Separator (raquo). */\n\t\t'comstitle' => __( '%1$s %2$s Comments Feed' ),\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\t/**\n\t * Filters whether to display the posts feed link.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param bool $show Whether to display the posts feed link. Default true.\n\t */\n\tif ( apply_filters( 'feed_links_show_posts_feed', true ) ) {\n\t\techo '<link rel=\"alternate\" type=\"' . feed_content_type() . '\" title=\"' . esc_attr( sprintf( $args['feedtitle'], get_bloginfo( 'name' ), $args['separator'] ) ) . '\" href=\"' . esc_url( get_feed_link() ) . \"\\\" />\\n\";\n\t}\n\n\t/**\n\t * Filters whether to display the comments feed link.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param bool $show Whether to display the comments feed link. Default true.\n\t */\n\tif ( apply_filters( 'feed_links_show_comments_feed', true ) ) {\n\t\techo '<link rel=\"alternate\" type=\"' . feed_content_type() . '\" title=\"' . esc_attr( sprintf( $args['comstitle'], get_bloginfo( 'name' ), $args['separator'] ) ) . '\" href=\"' . esc_url( get_feed_link( 'comments_' . get_default_feed() ) ) . \"\\\" />\\n\";\n\t}\n}\n\n/**\n * Display the links to the extra feeds such as category feeds.\n *\n * @since 2.8.0\n *\n * @param array $args Optional arguments.\n */\nfunction feed_links_extra( $args = array() ) {\n\t$defaults = array(\n\t\t/* translators: Separator between blog name and feed type in feed links. */\n\t\t'separator'     => _x( '&raquo;', 'feed link' ),\n\t\t/* translators: 1: Blog name, 2: Separator (raquo), 3: Post title. */\n\t\t'singletitle'   => __( '%1$s %2$s %3$s Comments Feed' ),\n\t\t/* translators: 1: Blog name, 2: Separator (raquo), 3: Category name. */\n\t\t'cattitle'      => __( '%1$s %2$s %3$s Category Feed' ),\n\t\t/* translators: 1: Blog name, 2: Separator (raquo), 3: Tag name. */\n\t\t'tagtitle'      => __( '%1$s %2$s %3$s Tag Feed' ),\n\t\t/* translators: 1: Blog name, 2: Separator (raquo), 3: Term name, 4: Taxonomy singular name. */\n\t\t'taxtitle'      => __( '%1$s %2$s %3$s %4$s Feed' ),\n\t\t/* translators: 1: Blog name, 2: Separator (raquo), 3: Author name. */\n\t\t'authortitle'   => __( '%1$s %2$s Posts by %3$s Feed' ),\n\t\t/* translators: 1: Blog name, 2: Separator (raquo), 3: Search query. */\n\t\t'searchtitle'   => __( '%1$s %2$s Search Results for &#8220;%3$s&#8221; Feed' ),\n\t\t/* translators: 1: Blog name, 2: Separator (raquo), 3: Post type name. */\n\t\t'posttypetitle' => __( '%1$s %2$s %3$s Feed' ),\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\tif ( is_singular() ) {\n\t\t$id   = 0;\n\t\t$post = get_post( $id );\n\n\t\tif ( comments_open() || pings_open() || $post->comment_count > 0 ) {\n\t\t\t$title = sprintf( $args['singletitle'], get_bloginfo( 'name' ), $args['separator'], the_title_attribute( array( 'echo' => false ) ) );\n\t\t\t$href  = get_post_comments_feed_link( $post->ID );\n\t\t}\n\t} elseif ( is_post_type_archive() ) {\n\t\t$post_type = get_query_var( 'post_type' );\n\t\tif ( is_array( $post_type ) ) {\n\t\t\t$post_type = reset( $post_type );\n\t\t}\n\n\t\t$post_type_obj = get_post_type_object( $post_type );\n\t\t$title         = sprintf( $args['posttypetitle'], get_bloginfo( 'name' ), $args['separator'], $post_type_obj->labels->name );\n\t\t$href          = get_post_type_archive_feed_link( $post_type_obj->name );\n\t} elseif ( is_category() ) {\n\t\t$term = get_queried_object();\n\n\t\tif ( $term ) {\n\t\t\t$title = sprintf( $args['cattitle'], get_bloginfo( 'name' ), $args['separator'], $term->name );\n\t\t\t$href  = get_category_feed_link( $term->term_id );\n\t\t}\n\t} elseif ( is_tag() ) {\n\t\t$term = get_queried_object();\n\n\t\tif ( $term ) {\n\t\t\t$title = sprintf( $args['tagtitle'], get_bloginfo( 'name' ), $args['separator'], $term->name );\n\t\t\t$href  = get_tag_feed_link( $term->term_id );\n\t\t}\n\t} elseif ( is_tax() ) {\n\t\t$term = get_queried_object();\n\n\t\tif ( $term ) {\n\t\t\t$tax   = get_taxonomy( $term->taxonomy );\n\t\t\t$title = sprintf( $args['taxtitle'], get_bloginfo( 'name' ), $args['separator'], $term->name, $tax->labels->singular_name );\n\t\t\t$href  = get_term_feed_link( $term->term_id, $term->taxonomy );\n\t\t}\n\t} elseif ( is_author() ) {\n\t\t$author_id = intval( get_query_var( 'author' ) );\n\n\t\t$title = sprintf( $args['authortitle'], get_bloginfo( 'name' ), $args['separator'], get_the_author_meta( 'display_name', $author_id ) );\n\t\t$href  = get_author_feed_link( $author_id );\n\t} elseif ( is_search() ) {\n\t\t$title = sprintf( $args['searchtitle'], get_bloginfo( 'name' ), $args['separator'], get_search_query( false ) );\n\t\t$href  = get_search_feed_link();\n\t}\n\n\tif ( isset( $title ) && isset( $href ) ) {\n\t\techo '<link rel=\"alternate\" type=\"' . feed_content_type() . '\" title=\"' . esc_attr( $title ) . '\" href=\"' . esc_url( $href ) . '\" />' . \"\\n\";\n\t}\n}\n\n/**\n * Display the link to the Really Simple Discovery service endpoint.\n *\n * @link http://archipelago.phrasewise.com/rsd\n * @since 2.0.0\n */\nfunction rsd_link() {\n\techo '<link rel=\"EditURI\" type=\"application/rsd+xml\" title=\"RSD\" href=\"' . esc_url( site_url( 'xmlrpc.php?rsd', 'rpc' ) ) . '\" />' . \"\\n\";\n}\n\n/**\n * Display the link to the Windows Live Writer manifest file.\n *\n * @link https://msdn.microsoft.com/en-us/library/bb463265.aspx\n * @since 2.3.1\n */\nfunction wlwmanifest_link() {\n\techo '<link rel=\"wlwmanifest\" type=\"application/wlwmanifest+xml\" href=\"' . includes_url( 'wlwmanifest.xml' ) . '\" /> ' . \"\\n\";\n}\n\n/**\n * Displays a noindex meta tag if required by the blog configuration.\n *\n * If a blog is marked as not being public then the noindex meta tag will be\n * output to tell web robots not to index the page content. Add this to the\n * {@see 'wp_head'} action.\n *\n * Typical usage is as a {@see 'wp_head'} callback:\n *\n *     add_action( 'wp_head', 'noindex' );\n *\n * @see wp_no_robots\n *\n * @since 2.1.0\n */\nfunction noindex() {\n\t// If the blog is not public, tell robots to go away.\n\tif ( '0' == get_option( 'blog_public' ) ) {\n\t\twp_no_robots();\n\t}\n}\n\n/**\n * Display a noindex meta tag.\n *\n * Outputs a noindex meta tag that tells web robots not to index the page content.\n * Typical usage is as a {@see 'wp_head'} callback. add_action( 'wp_head', 'wp_no_robots' );\n *\n * @since 3.3.0\n * @since 5.3.0 Echo \"noindex,nofollow\" if search engine visibility is discouraged.\n */\nfunction wp_no_robots() {\n\tif ( get_option( 'blog_public' ) ) {\n\t\techo \"<meta name='robots' content='noindex,follow' />\\n\";\n\t\treturn;\n\t}\n\n\techo \"<meta name='robots' content='noindex,nofollow' />\\n\";\n}\n\n/**\n * Display a noindex,noarchive meta tag and referrer origin-when-cross-origin meta tag.\n *\n * Outputs a noindex,noarchive meta tag that tells web robots not to index or cache the page content.\n * Outputs a referrer origin-when-cross-origin meta tag that tells the browser not to send the full\n * url as a referrer to other sites when cross-origin assets are loaded.\n *\n * Typical usage is as a wp_head callback. add_action( 'wp_head', 'wp_sensitive_page_meta' );\n *\n * @since 5.0.1\n */\nfunction wp_sensitive_page_meta() {\n\t?>\n\t<meta name='robots' content='noindex,noarchive' />\n\t<meta name='referrer' content='strict-origin-when-cross-origin' />\n\t<?php\n}\n\n/**\n * Display site icon meta tags.\n *\n * @since 4.3.0\n *\n * @link https://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#rel-icon HTML5 specification link icon.\n */\nfunction wp_site_icon() {\n\tif ( ! has_site_icon() && ! is_customize_preview() ) {\n\t\treturn;\n\t}\n\n\t$meta_tags = array();\n\t$icon_32   = get_site_icon_url( 32 );\n\tif ( empty( $icon_32 ) && is_customize_preview() ) {\n\t\t$icon_32 = '/favicon.ico'; // Serve default favicon URL in customizer so element can be updated for preview.\n\t}\n\tif ( $icon_32 ) {\n\t\t$meta_tags[] = sprintf( '<link rel=\"icon\" href=\"%s\" sizes=\"32x32\" />', esc_url( $icon_32 ) );\n\t}\n\t$icon_192 = get_site_icon_url( 192 );\n\tif ( $icon_192 ) {\n\t\t$meta_tags[] = sprintf( '<link rel=\"icon\" href=\"%s\" sizes=\"192x192\" />', esc_url( $icon_192 ) );\n\t}\n\t$icon_180 = get_site_icon_url( 180 );\n\tif ( $icon_180 ) {\n\t\t$meta_tags[] = sprintf( '<link rel=\"apple-touch-icon\" href=\"%s\" />', esc_url( $icon_180 ) );\n\t}\n\t$icon_270 = get_site_icon_url( 270 );\n\tif ( $icon_270 ) {\n\t\t$meta_tags[] = sprintf( '<meta name=\"msapplication-TileImage\" content=\"%s\" />', esc_url( $icon_270 ) );\n\t}\n\n\t/**\n\t * Filters the site icon meta tags, so plugins can add their own.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param string[] $meta_tags Array of Site Icon meta tags.\n\t */\n\t$meta_tags = apply_filters( 'site_icon_meta_tags', $meta_tags );\n\t$meta_tags = array_filter( $meta_tags );\n\n\tforeach ( $meta_tags as $meta_tag ) {\n\t\techo \"$meta_tag\\n\";\n\t}\n}\n\n/**\n * Prints resource hints to browsers for pre-fetching, pre-rendering\n * and pre-connecting to web sites.\n *\n * Gives hints to browsers to prefetch specific pages or render them\n * in the background, to perform DNS lookups or to begin the connection\n * handshake (DNS, TCP, TLS) in the background.\n *\n * These performance improving indicators work by using `<link rel\"\u00e2\u20ac\u00a6\">`.\n *\n * @since 4.6.0\n */\nfunction wp_resource_hints() {\n\t$hints = array(\n\t\t'dns-prefetch' => wp_dependencies_unique_hosts(),\n\t\t'preconnect'   => array(),\n\t\t'prefetch'     => array(),\n\t\t'prerender'    => array(),\n\t);\n\n\t/*\n\t * Add DNS prefetch for the Emoji CDN.\n\t * The path is removed in the foreach loop below.\n\t */\n\t/** This filter is documented in wp-includes/formatting.php */\n\t$hints['dns-prefetch'][] = apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/13.0.0/svg/' );\n\n\tforeach ( $hints as $relation_type => $urls ) {\n\t\t$unique_urls = array();\n\n\t\t/**\n\t\t * Filters domains and URLs for resource hints of relation type.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param array  $urls          URLs to print for resource hints.\n\t\t * @param string $relation_type The relation type the URLs are printed for, e.g. 'preconnect' or 'prerender'.\n\t\t */\n\t\t$urls = apply_filters( 'wp_resource_hints', $urls, $relation_type );\n\n\t\tforeach ( $urls as $key => $url ) {\n\t\t\t$atts = array();\n\n\t\t\tif ( is_array( $url ) ) {\n\t\t\t\tif ( isset( $url['href'] ) ) {\n\t\t\t\t\t$atts = $url;\n\t\t\t\t\t$url  = $url['href'];\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$url = esc_url( $url, array( 'http', 'https' ) );\n\n\t\t\tif ( ! $url ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( isset( $unique_urls[ $url ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( in_array( $relation_type, array( 'preconnect', 'dns-prefetch' ), true ) ) {\n\t\t\t\t$parsed = wp_parse_url( $url );\n\n\t\t\t\tif ( empty( $parsed['host'] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( 'preconnect' === $relation_type && ! empty( $parsed['scheme'] ) ) {\n\t\t\t\t\t$url = $parsed['scheme'] . '://' . $parsed['host'];\n\t\t\t\t} else {\n\t\t\t\t\t// Use protocol-relative URLs for dns-prefetch or if scheme is missing.\n\t\t\t\t\t$url = '//' . $parsed['host'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$atts['rel']  = $relation_type;\n\t\t\t$atts['href'] = $url;\n\n\t\t\t$unique_urls[ $url ] = $atts;\n\t\t}\n\n\t\tforeach ( $unique_urls as $atts ) {\n\t\t\t$html = '';\n\n\t\t\tforeach ( $atts as $attr => $value ) {\n\t\t\t\tif ( ! is_scalar( $value )\n\t\t\t\t\t|| ( ! in_array( $attr, array( 'as', 'crossorigin', 'href', 'pr', 'rel', 'type' ), true ) && ! is_numeric( $attr ) )\n\t\t\t\t) {\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );\n\n\t\t\t\tif ( ! is_string( $attr ) ) {\n\t\t\t\t\t$html .= \" $value\";\n\t\t\t\t} else {\n\t\t\t\t\t$html .= \" $attr='$value'\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$html = trim( $html );\n\n\t\t\techo \"<link $html />\\n\";\n\t\t}\n\t}\n}\n\n/**\n * Retrieves a list of unique hosts of all enqueued scripts and styles.\n *\n * @since 4.6.0\n *\n * @return string[] A list of unique hosts of enqueued scripts and styles.\n */\nfunction wp_dependencies_unique_hosts() {\n\tglobal $wp_scripts, $wp_styles;\n\n\t$unique_hosts = array();\n\n\tforeach ( array( $wp_scripts, $wp_styles ) as $dependencies ) {\n\t\tif ( $dependencies instanceof WP_Dependencies && ! empty( $dependencies->queue ) ) {\n\t\t\tforeach ( $dependencies->queue as $handle ) {\n\t\t\t\tif ( ! isset( $dependencies->registered[ $handle ] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t/* @var _WP_Dependency $dependency */\n\t\t\t\t$dependency = $dependencies->registered[ $handle ];\n\t\t\t\t$parsed     = wp_parse_url( $dependency->src );\n\n\t\t\t\tif ( ! empty( $parsed['host'] )\n\t\t\t\t\t&& ! in_array( $parsed['host'], $unique_hosts, true ) && $parsed['host'] !== $_SERVER['SERVER_NAME']\n\t\t\t\t) {\n\t\t\t\t\t$unique_hosts[] = $parsed['host'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $unique_hosts;\n}\n\n/**\n * Whether the user can access the visual editor.\n *\n * Checks if the user can access the visual editor and that it's supported by the user's browser.\n *\n * @since 2.0.0\n *\n * @global bool $wp_rich_edit Whether the user can access the visual editor.\n * @global bool $is_gecko     Whether the browser is Gecko-based.\n * @global bool $is_opera     Whether the browser is Opera.\n * @global bool $is_safari    Whether the browser is Safari.\n * @global bool $is_chrome    Whether the browser is Chrome.\n * @global bool $is_IE        Whether the browser is Internet Explorer.\n * @global bool $is_edge      Whether the browser is Microsoft Edge.\n *\n * @return bool True if the user can access the visual editor, false otherwise.\n */\nfunction user_can_richedit() {\n\tglobal $wp_rich_edit, $is_gecko, $is_opera, $is_safari, $is_chrome, $is_IE, $is_edge;\n\n\tif ( ! isset( $wp_rich_edit ) ) {\n\t\t$wp_rich_edit = false;\n\n\t\tif ( 'true' === get_user_option( 'rich_editing' ) || ! is_user_logged_in() ) { // Default to 'true' for logged out users.\n\t\t\tif ( $is_safari ) {\n\t\t\t\t$wp_rich_edit = ! wp_is_mobile() || ( preg_match( '!AppleWebKit/(\\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval( $match[1] ) >= 534 );\n\t\t\t} elseif ( $is_IE ) {\n\t\t\t\t$wp_rich_edit = ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Trident/7.0;' ) !== false );\n\t\t\t} elseif ( $is_gecko || $is_chrome || $is_edge || ( $is_opera && ! wp_is_mobile() ) ) {\n\t\t\t\t$wp_rich_edit = true;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filters whether the user can access the visual editor.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param bool $wp_rich_edit Whether the user can access the visual editor.\n\t */\n\treturn apply_filters( 'user_can_richedit', $wp_rich_edit );\n}\n\n/**\n * Find out which editor should be displayed by default.\n *\n * Works out which of the two editors to display as the current editor for a\n * user. The 'html' setting is for the \"Text\" editor tab.\n *\n * @since 2.5.0\n *\n * @return string Either 'tinymce', or 'html', or 'test'\n */\nfunction wp_default_editor() {\n\t$r = user_can_richedit() ? 'tinymce' : 'html'; // Defaults.\n\tif ( wp_get_current_user() ) { // Look for cookie.\n\t\t$ed = get_user_setting( 'editor', 'tinymce' );\n\t\t$r  = ( in_array( $ed, array( 'tinymce', 'html', 'test' ), true ) ) ? $ed : $r;\n\t}\n\n\t/**\n\t * Filters which editor should be displayed by default.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $r Which editor should be displayed by default. Either 'tinymce', 'html', or 'test'.\n\t */\n\treturn apply_filters( 'wp_default_editor', $r );\n}\n\n/**\n * Renders an editor.\n *\n * Using this function is the proper way to output all needed components for both TinyMCE and Quicktags.\n * _WP_Editors should not be used directly. See https://core.trac.wordpress.org/ticket/17144.\n *\n * NOTE: Once initialized the TinyMCE editor cannot be safely moved in the DOM. For that reason\n * running wp_editor() inside of a meta box is not a good idea unless only Quicktags is used.\n * On the post edit screen several actions can be used to include additional editors\n * containing TinyMCE: 'edit_page_form', 'edit_form_advanced' and 'dbx_post_sidebar'.\n * See https://core.trac.wordpress.org/ticket/19173 for more information.\n *\n * @see _WP_Editors::editor()\n * @see _WP_Editors::parse_settings()\n * @since 3.3.0\n *\n * @param string $content   Initial content for the editor.\n * @param string $editor_id HTML ID attribute value for the textarea and TinyMCE.\n *                          Should not contain square brackets.\n * @param array  $settings  See _WP_Editors::parse_settings() for description.\n */\nfunction wp_editor( $content, $editor_id, $settings = array() ) {\n\tif ( ! class_exists( '_WP_Editors', false ) ) {\n\t\trequire ABSPATH . WPINC . '/class-wp-editor.php';\n\t}\n\t_WP_Editors::editor( $content, $editor_id, $settings );\n}\n\n/**\n * Outputs the editor scripts, stylesheets, and default settings.\n *\n * The editor can be initialized when needed after page load.\n * See wp.editor.initialize() in wp-admin/js/editor.js for initialization options.\n *\n * @uses _WP_Editors\n * @since 4.8.0\n */\nfunction wp_enqueue_editor() {\n\tif ( ! class_exists( '_WP_Editors', false ) ) {\n\t\trequire ABSPATH . WPINC . '/class-wp-editor.php';\n\t}\n\n\t_WP_Editors::enqueue_default_editor();\n}\n\n/**\n * Enqueue assets needed by the code editor for the given settings.\n *\n * @since 4.9.0\n *\n * @see wp_enqueue_editor()\n * @see wp_get_code_editor_settings();\n * @see _WP_Editors::parse_settings()\n *\n * @param array $args {\n *     Args.\n *\n *     @type string   $type       The MIME type of the file to be edited.\n *     @type string   $file       Filename to be edited. Extension is used to sniff the type. Can be supplied as alternative to `$type` param.\n *     @type WP_Theme $theme      Theme being edited when on theme editor.\n *     @type string   $plugin     Plugin being edited when on plugin editor.\n *     @type array    $codemirror Additional CodeMirror setting overrides.\n *     @type array    $csslint    CSSLint rule overrides.\n *     @type array    $jshint     JSHint rule overrides.\n *     @type array    $htmlhint   JSHint rule overrides.\n * }\n * @return array|false Settings for the enqueued code editor, or false if the editor was not enqueued.\n */\nfunction wp_enqueue_code_editor( $args ) {\n\tif ( is_user_logged_in() && 'false' === wp_get_current_user()->syntax_highlighting ) {\n\t\treturn false;\n\t}\n\n\t$settings = wp_get_code_editor_settings( $args );\n\n\tif ( empty( $settings ) || empty( $settings['codemirror'] ) ) {\n\t\treturn false;\n\t}\n\n\twp_enqueue_script( 'code-editor' );\n\twp_enqueue_style( 'code-editor' );\n\n\tif ( isset( $settings['codemirror']['mode'] ) ) {\n\t\t$mode = $settings['codemirror']['mode'];\n\t\tif ( is_string( $mode ) ) {\n\t\t\t$mode = array(\n\t\t\t\t'name' => $mode,\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $settings['codemirror']['lint'] ) ) {\n\t\t\tswitch ( $mode['name'] ) {\n\t\t\t\tcase 'css':\n\t\t\t\tcase 'text/css':\n\t\t\t\tcase 'text/x-scss':\n\t\t\t\tcase 'text/x-less':\n\t\t\t\t\twp_enqueue_script( 'csslint' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'htmlmixed':\n\t\t\t\tcase 'text/html':\n\t\t\t\tcase 'php':\n\t\t\t\tcase 'application/x-httpd-php':\n\t\t\t\tcase 'text/x-php':\n\t\t\t\t\twp_enqueue_script( 'htmlhint' );\n\t\t\t\t\twp_enqueue_script( 'csslint' );\n\t\t\t\t\twp_enqueue_script( 'jshint' );\n\t\t\t\t\tif ( ! current_user_can( 'unfiltered_html' ) ) {\n\t\t\t\t\t\twp_enqueue_script( 'htmlhint-kses' );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'javascript':\n\t\t\t\tcase 'application/ecmascript':\n\t\t\t\tcase 'application/json':\n\t\t\t\tcase 'application/javascript':\n\t\t\t\tcase 'application/ld+json':\n\t\t\t\tcase 'text/typescript':\n\t\t\t\tcase 'application/typescript':\n\t\t\t\t\twp_enqueue_script( 'jshint' );\n\t\t\t\t\twp_enqueue_script( 'jsonlint' );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\twp_add_inline_script( 'code-editor', sprintf( 'jQuery.extend( wp.codeEditor.defaultSettings, %s );', wp_json_encode( $settings ) ) );\n\n\t/**\n\t * Fires when scripts and styles are enqueued for the code editor.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param array $settings Settings for the enqueued code editor.\n\t */\n\tdo_action( 'wp_enqueue_code_editor', $settings );\n\n\treturn $settings;\n}\n\n/**\n * Generate and return code editor settings.\n *\n * @since 5.0.0\n *\n * @see wp_enqueue_code_editor()\n *\n * @param array $args {\n *     Args.\n *\n *     @type string   $type       The MIME type of the file to be edited.\n *     @type string   $file       Filename to be edited. Extension is used to sniff the type. Can be supplied as alternative to `$type` param.\n *     @type WP_Theme $theme      Theme being edited when on theme editor.\n *     @type string   $plugin     Plugin being edited when on plugin editor.\n *     @type array    $codemirror Additional CodeMirror setting overrides.\n *     @type array    $csslint    CSSLint rule overrides.\n *     @type array    $jshint     JSHint rule overrides.\n *     @type array    $htmlhint   JSHint rule overrides.\n * }\n * @return array|false Settings for the code editor.\n */\nfunction wp_get_code_editor_settings( $args ) {\n\t$settings = array(\n\t\t'codemirror' => array(\n\t\t\t'indentUnit'       => 4,\n\t\t\t'indentWithTabs'   => true,\n\t\t\t'inputStyle'       => 'contenteditable',\n\t\t\t'lineNumbers'      => true,\n\t\t\t'lineWrapping'     => true,\n\t\t\t'styleActiveLine'  => true,\n\t\t\t'continueComments' => true,\n\t\t\t'extraKeys'        => array(\n\t\t\t\t'Ctrl-Space' => 'autocomplete',\n\t\t\t\t'Ctrl-/'     => 'toggleComment',\n\t\t\t\t'Cmd-/'      => 'toggleComment',\n\t\t\t\t'Alt-F'      => 'findPersistent',\n\t\t\t\t'Ctrl-F'     => 'findPersistent',\n\t\t\t\t'Cmd-F'      => 'findPersistent',\n\t\t\t),\n\t\t\t'direction'        => 'ltr', // Code is shown in LTR even in RTL languages.\n\t\t\t'gutters'          => array(),\n\t\t),\n\t\t'csslint'    => array(\n\t\t\t'errors'                    => true, // Parsing errors.\n\t\t\t'box-model'                 => true,\n\t\t\t'display-property-grouping' => true,\n\t\t\t'duplicate-properties'      => true,\n\t\t\t'known-properties'          => true,\n\t\t\t'outline-none'              => true,\n\t\t),\n\t\t'jshint'     => array(\n\t\t\t// The following are copied from <https://github.com/WordPress/wordpress-develop/blob/4.8.1/.jshintrc>.\n\t\t\t'boss'     => true,\n\t\t\t'curly'    => true,\n\t\t\t'eqeqeq'   => true,\n\t\t\t'eqnull'   => true,\n\t\t\t'es3'      => true,\n\t\t\t'expr'     => true,\n\t\t\t'immed'    => true,\n\t\t\t'noarg'    => true,\n\t\t\t'nonbsp'   => true,\n\t\t\t'onevar'   => true,\n\t\t\t'quotmark' => 'single',\n\t\t\t'trailing' => true,\n\t\t\t'undef'    => true,\n\t\t\t'unused'   => true,\n\n\t\t\t'browser'  => true,\n\n\t\t\t'globals'  => array(\n\t\t\t\t'_'        => false,\n\t\t\t\t'Backbone' => false,\n\t\t\t\t'jQuery'   => false,\n\t\t\t\t'JSON'     => false,\n\t\t\t\t'wp'       => false,\n\t\t\t),\n\t\t),\n\t\t'htmlhint'   => array(\n\t\t\t'tagname-lowercase'        => true,\n\t\t\t'attr-lowercase'           => true,\n\t\t\t'attr-value-double-quotes' => false,\n\t\t\t'doctype-first'            => false,\n\t\t\t'tag-pair'                 => true,\n\t\t\t'spec-char-escape'         => true,\n\t\t\t'id-unique'                => true,\n\t\t\t'src-not-empty'            => true,\n\t\t\t'attr-no-duplication'      => true,\n\t\t\t'alt-require'              => true,\n\t\t\t'space-tab-mixed-disabled' => 'tab',\n\t\t\t'attr-unsafe-chars'        => true,\n\t\t),\n\t);\n\n\t$type = '';\n\tif ( isset( $args['type'] ) ) {\n\t\t$type = $args['type'];\n\n\t\t// Remap MIME types to ones that CodeMirror modes will recognize.\n\t\tif ( 'application/x-patch' === $type || 'text/x-patch' === $type ) {\n\t\t\t$type = 'text/x-diff';\n\t\t}\n\t} elseif ( isset( $args['file'] ) && false !== strpos( basename( $args['file'] ), '.' ) ) {\n\t\t$extension = strtolower( pathinfo( $args['file'], PATHINFO_EXTENSION ) );\n\t\tforeach ( wp_get_mime_types() as $exts => $mime ) {\n\t\t\tif ( preg_match( '!^(' . $exts . ')$!i', $extension ) ) {\n\t\t\t\t$type = $mime;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Supply any types that are not matched by wp_get_mime_types().\n\t\tif ( empty( $type ) ) {\n\t\t\tswitch ( $extension ) {\n\t\t\t\tcase 'conf':\n\t\t\t\t\t$type = 'text/nginx';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'css':\n\t\t\t\t\t$type = 'text/css';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'diff':\n\t\t\t\tcase 'patch':\n\t\t\t\t\t$type = 'text/x-diff';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'html':\n\t\t\t\tcase 'htm':\n\t\t\t\t\t$type = 'text/html';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'http':\n\t\t\t\t\t$type = 'message/http';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'js':\n\t\t\t\t\t$type = 'text/javascript';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'json':\n\t\t\t\t\t$type = 'application/json';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'jsx':\n\t\t\t\t\t$type = 'text/jsx';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'less':\n\t\t\t\t\t$type = 'text/x-less';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'md':\n\t\t\t\t\t$type = 'text/x-gfm';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'php':\n\t\t\t\tcase 'phtml':\n\t\t\t\tcase 'php3':\n\t\t\t\tcase 'php4':\n\t\t\t\tcase 'php5':\n\t\t\t\tcase 'php7':\n\t\t\t\tcase 'phps':\n\t\t\t\t\t$type = 'application/x-httpd-php';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'scss':\n\t\t\t\t\t$type = 'text/x-scss';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sass':\n\t\t\t\t\t$type = 'text/x-sass';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sh':\n\t\t\t\tcase 'bash':\n\t\t\t\t\t$type = 'text/x-sh';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sql':\n\t\t\t\t\t$type = 'text/x-sql';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'svg':\n\t\t\t\t\t$type = 'application/svg+xml';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'xml':\n\t\t\t\t\t$type = 'text/xml';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'yml':\n\t\t\t\tcase 'yaml':\n\t\t\t\t\t$type = 'text/x-yaml';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'txt':\n\t\t\t\tdefault:\n\t\t\t\t\t$type = 'text/plain';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( in_array( $type, array( 'text/css', 'text/x-scss', 'text/x-less', 'text/x-sass' ), true ) ) {\n\t\t$settings['codemirror'] = array_merge(\n\t\t\t$settings['codemirror'],\n\t\t\tarray(\n\t\t\t\t'mode'              => $type,\n\t\t\t\t'lint'              => false,\n\t\t\t\t'autoCloseBrackets' => true,\n\t\t\t\t'matchBrackets'     => true,\n\t\t\t)\n\t\t);\n\t} elseif ( 'text/x-diff' === $type ) {\n\t\t$settings['codemirror'] = array_merge(\n\t\t\t$settings['codemirror'],\n\t\t\tarray(\n\t\t\t\t'mode' => 'diff',\n\t\t\t)\n\t\t);\n\t} elseif ( 'text/html' === $type ) {\n\t\t$settings['codemirror'] = array_merge(\n\t\t\t$settings['codemirror'],\n\t\t\tarray(\n\t\t\t\t'mode'              => 'htmlmixed',\n\t\t\t\t'lint'              => true,\n\t\t\t\t'autoCloseBrackets' => true,\n\t\t\t\t'autoCloseTags'     => true,\n\t\t\t\t'matchTags'         => array(\n\t\t\t\t\t'bothTags' => true,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\tif ( ! current_user_can( 'unfiltered_html' ) ) {\n\t\t\t$settings['htmlhint']['kses'] = wp_kses_allowed_html( 'post' );\n\t\t}\n\t} elseif ( 'text/x-gfm' === $type ) {\n\t\t$settings['codemirror'] = array_merge(\n\t\t\t$settings['codemirror'],\n\t\t\tarray(\n\t\t\t\t'mode'                => 'gfm',\n\t\t\t\t'highlightFormatting' => true,\n\t\t\t)\n\t\t);\n\t} elseif ( 'application/javascript' === $type || 'text/javascript' === $type ) {\n\t\t$settings['codemirror'] = array_merge(\n\t\t\t$settings['codemirror'],\n\t\t\tarray(\n\t\t\t\t'mode'              => 'javascript',\n\t\t\t\t'lint'              => true,\n\t\t\t\t'autoCloseBrackets' => true,\n\t\t\t\t'matchBrackets'     => true,\n\t\t\t)\n\t\t);\n\t} elseif ( false !== strpos( $type, 'json' ) ) {\n\t\t$settings['codemirror'] = array_merge(\n\t\t\t$settings['codemirror'],\n\t\t\tarray(\n\t\t\t\t'mode'              => array(\n\t\t\t\t\t'name' => 'javascript',\n\t\t\t\t),\n\t\t\t\t'lint'              => true,\n\t\t\t\t'autoCloseBrackets' => true,\n\t\t\t\t'matchBrackets'     => true,\n\t\t\t)\n\t\t);\n\t\tif ( 'application/ld+json' === $type ) {\n\t\t\t$settings['codemirror']['mode']['jsonld'] = true;\n\t\t} else {\n\t\t\t$settings['codemirror']['mode']['json'] = true;\n\t\t}\n\t} elseif ( false !== strpos( $type, 'jsx' ) ) {\n\t\t$settings['codemirror'] = array_merge(\n\t\t\t$settings['codemirror'],\n\t\t\tarray(\n\t\t\t\t'mode'              => 'jsx',\n\t\t\t\t'autoCloseBrackets' => true,\n\t\t\t\t'matchBrackets'     => true,\n\t\t\t)\n\t\t);\n\t} elseif ( 'text/x-markdown' === $type ) {\n\t\t$settings['codemirror'] = array_merge(\n\t\t\t$settings['codemirror'],\n\t\t\tarray(\n\t\t\t\t'mode'                => 'markdown',\n\t\t\t\t'highlightFormatting' => true,\n\t\t\t)\n\t\t);\n\t} elseif ( 'text/nginx' === $type ) {\n\t\t$settings['codemirror'] = array_merge(\n\t\t\t$settings['codemirror'],\n\t\t\tarray(\n\t\t\t\t'mode' => 'nginx',\n\t\t\t)\n\t\t);\n\t} elseif ( 'application/x-httpd-php' === $type ) {\n\t\t$settings['codemirror'] = array_merge(\n\t\t\t$settings['codemirror'],\n\t\t\tarray(\n\t\t\t\t'mode'              => 'php',\n\t\t\t\t'autoCloseBrackets' => true,\n\t\t\t\t'autoCloseTags'     => true,\n\t\t\t\t'matchBrackets'     => true,\n\t\t\t\t'matchTags'         => array(\n\t\t\t\t\t'bothTags' => true,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t} elseif ( 'text/x-sql' === $type || 'text/x-mysql' === $type ) {\n\t\t$settings['codemirror'] = array_merge(\n\t\t\t$settings['codemirror'],\n\t\t\tarray(\n\t\t\t\t'mode'              => 'sql',\n\t\t\t\t'autoCloseBrackets' => true,\n\t\t\t\t'matchBrackets'     => true,\n\t\t\t)\n\t\t);\n\t} elseif ( false !== strpos( $type, 'xml' ) ) {\n\t\t$settings['codemirror'] = array_merge(\n\t\t\t$settings['codemirror'],\n\t\t\tarray(\n\t\t\t\t'mode'              => 'xml',\n\t\t\t\t'autoCloseBrackets' => true,\n\t\t\t\t'autoCloseTags'     => true,\n\t\t\t\t'matchTags'         => array(\n\t\t\t\t\t'bothTags' => true,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t} elseif ( 'text/x-yaml' === $type ) {\n\t\t$settings['codemirror'] = array_merge(\n\t\t\t$settings['codemirror'],\n\t\t\tarray(\n\t\t\t\t'mode' => 'yaml',\n\t\t\t)\n\t\t);\n\t} else {\n\t\t$settings['codemirror']['mode'] = $type;\n\t}\n\n\tif ( ! empty( $settings['codemirror']['lint'] ) ) {\n\t\t$settings['codemirror']['gutters'][] = 'CodeMirror-lint-markers';\n\t}\n\n\t// Let settings supplied via args override any defaults.\n\tforeach ( wp_array_slice_assoc( $args, array( 'codemirror', 'csslint', 'jshint', 'htmlhint' ) ) as $key => $value ) {\n\t\t$settings[ $key ] = array_merge(\n\t\t\t$settings[ $key ],\n\t\t\t$value\n\t\t);\n\t}\n\n\t/**\n\t * Filters settings that are passed into the code editor.\n\t *\n\t * Returning a falsey value will disable the syntax-highlighting code editor.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param array $settings The array of settings passed to the code editor.\n\t *                        A falsey value disables the editor.\n\t * @param array $args {\n\t *     Args passed when calling `get_code_editor_settings()`.\n\t *\n\t *     @type string   $type       The MIME type of the file to be edited.\n\t *     @type string   $file       Filename being edited.\n\t *     @type WP_Theme $theme      Theme being edited when on theme editor.\n\t *     @type string   $plugin     Plugin being edited when on plugin editor.\n\t *     @type array    $codemirror Additional CodeMirror setting overrides.\n\t *     @type array    $csslint    CSSLint rule overrides.\n\t *     @type array    $jshint     JSHint rule overrides.\n\t *     @type array    $htmlhint   JSHint rule overrides.\n\t * }\n\t */\n\treturn apply_filters( 'wp_code_editor_settings', $settings, $args );\n}\n\n/**\n * Retrieves the contents of the search WordPress query variable.\n *\n * The search query string is passed through esc_attr() to ensure that it is safe\n * for placing in an HTML attribute.\n *\n * @since 2.3.0\n *\n * @param bool $escaped Whether the result is escaped. Default true.\n *                      Only use when you are later escaping it. Do not use unescaped.\n * @return string\n */\nfunction get_search_query( $escaped = true ) {\n\t/**\n\t * Filters the contents of the search query variable.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param mixed $search Contents of the search query variable.\n\t */\n\t$query = apply_filters( 'get_search_query', get_query_var( 's' ) );\n\n\tif ( $escaped ) {\n\t\t$query = esc_attr( $query );\n\t}\n\treturn $query;\n}\n\n/**\n * Displays the contents of the search query variable.\n *\n * The search query string is passed through esc_attr() to ensure that it is safe\n * for placing in an HTML attribute.\n *\n * @since 2.1.0\n */\nfunction the_search_query() {\n\t/**\n\t * Filters the contents of the search query variable for display.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param mixed $search Contents of the search query variable.\n\t */\n\techo esc_attr( apply_filters( 'the_search_query', get_search_query( false ) ) );\n}\n\n/**\n * Gets the language attributes for the 'html' tag.\n *\n * Builds up a set of HTML attributes containing the text direction and language\n * information for the page.\n *\n * @since 4.3.0\n *\n * @param string $doctype Optional. The type of HTML document. Accepts 'xhtml' or 'html'. Default 'html'.\n */\nfunction get_language_attributes( $doctype = 'html' ) {\n\t$attributes = array();\n\n\tif ( function_exists( 'is_rtl' ) && is_rtl() ) {\n\t\t$attributes[] = 'dir=\"rtl\"';\n\t}\n\n\t$lang = get_bloginfo( 'language' );\n\tif ( $lang ) {\n\t\tif ( 'text/html' === get_option( 'html_type' ) || 'html' === $doctype ) {\n\t\t\t$attributes[] = 'lang=\"' . esc_attr( $lang ) . '\"';\n\t\t}\n\n\t\tif ( 'text/html' !== get_option( 'html_type' ) || 'xhtml' === $doctype ) {\n\t\t\t$attributes[] = 'xml:lang=\"' . esc_attr( $lang ) . '\"';\n\t\t}\n\t}\n\n\t$output = implode( ' ', $attributes );\n\n\t/**\n\t * Filters the language attributes for display in the 'html' tag.\n\t *\n\t * @since 2.5.0\n\t * @since 4.3.0 Added the `$doctype` parameter.\n\t *\n\t * @param string $output A space-separated list of language attributes.\n\t * @param string $doctype The type of HTML document (xhtml|html).\n\t */\n\treturn apply_filters( 'language_attributes', $output, $doctype );\n}\n\n/**\n * Displays the language attributes for the 'html' tag.\n *\n * Builds up a set of HTML attributes containing the text direction and language\n * information for the page.\n *\n * @since 2.1.0\n * @since 4.3.0 Converted into a wrapper for get_language_attributes().\n *\n * @param string $doctype Optional. The type of HTML document. Accepts 'xhtml' or 'html'. Default 'html'.\n */\nfunction language_attributes( $doctype = 'html' ) {\n\techo get_language_attributes( $doctype );\n}\n\n/**\n * Retrieve paginated link for archive post pages.\n *\n * Technically, the function can be used to create paginated link list for any\n * area. The 'base' argument is used to reference the url, which will be used to\n * create the paginated links. The 'format' argument is then used for replacing\n * the page number. It is however, most likely and by default, to be used on the\n * archive post pages.\n *\n * The 'type' argument controls format of the returned value. The default is\n * 'plain', which is just a string with the links separated by a newline\n * character. The other possible values are either 'array' or 'list'. The\n * 'array' value will return an array of the paginated link list to offer full\n * control of display. The 'list' value will place all of the paginated links in\n * an unordered HTML list.\n *\n * The 'total' argument is the total amount of pages and is an integer. The\n * 'current' argument is the current page number and is also an integer.\n *\n * An example of the 'base' argument is \"http://example.com/all_posts.php%_%\"\n * and the '%_%' is required. The '%_%' will be replaced by the contents of in\n * the 'format' argument. An example for the 'format' argument is \"?page=%#%\"\n * and the '%#%' is also required. The '%#%' will be replaced with the page\n * number.\n *\n * You can include the previous and next links in the list by setting the\n * 'prev_next' argument to true, which it is by default. You can set the\n * previous text, by using the 'prev_text' argument. You can set the next text\n * by setting the 'next_text' argument.\n *\n * If the 'show_all' argument is set to true, then it will show all of the pages\n * instead of a short list of the pages near the current page. By default, the\n * 'show_all' is set to false and controlled by the 'end_size' and 'mid_size'\n * arguments. The 'end_size' argument is how many numbers on either the start\n * and the end list edges, by default is 1. The 'mid_size' argument is how many\n * numbers to either side of current page, but not including current page.\n *\n * It is possible to add query vars to the link by using the 'add_args' argument\n * and see add_query_arg() for more information.\n *\n * The 'before_page_number' and 'after_page_number' arguments allow users to\n * augment the links themselves. Typically this might be to add context to the\n * numbered links so that screen reader users understand what the links are for.\n * The text strings are added before and after the page number - within the\n * anchor tag.\n *\n * @since 2.1.0\n * @since 4.9.0 Added the `aria_current` argument.\n *\n * @global WP_Query   $wp_query   WordPress Query object.\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string|array $args {\n *     Optional. Array or string of arguments for generating paginated links for archives.\n *\n *     @type string $base               Base of the paginated url. Default empty.\n *     @type string $format             Format for the pagination structure. Default empty.\n *     @type int    $total              The total amount of pages. Default is the value WP_Query's\n *                                      `max_num_pages` or 1.\n *     @type int    $current            The current page number. Default is 'paged' query var or 1.\n *     @type string $aria_current       The value for the aria-current attribute. Possible values are 'page',\n *                                      'step', 'location', 'date', 'time', 'true', 'false'. Default is 'page'.\n *     @type bool   $show_all           Whether to show all pages. Default false.\n *     @type int    $end_size           How many numbers on either the start and the end list edges.\n *                                      Default 1.\n *     @type int    $mid_size           How many numbers to either side of the current pages. Default 2.\n *     @type bool   $prev_next          Whether to include the previous and next links in the list. Default true.\n *     @type bool   $prev_text          The previous page text. Default '&laquo; Previous'.\n *     @type bool   $next_text          The next page text. Default 'Next &raquo;'.\n *     @type string $type               Controls format of the returned value. Possible values are 'plain',\n *                                      'array' and 'list'. Default is 'plain'.\n *     @type array  $add_args           An array of query args to add. Default false.\n *     @type string $add_fragment       A string to append to each link. Default empty.\n *     @type string $before_page_number A string to appear before the page number. Default empty.\n *     @type string $after_page_number  A string to append after the page number. Default empty.\n * }\n * @return string|array|void String of page links or array of page links, depending on 'type' argument.\n *                           Void if total number of pages is less than 2.\n */\nfunction paginate_links( $args = '' ) {\n\tglobal $wp_query, $wp_rewrite;\n\n\t// Setting up default values based on the current URL.\n\t$pagenum_link = html_entity_decode( get_pagenum_link() );\n\t$url_parts    = explode( '?', $pagenum_link );\n\n\t// Get max pages and current page out of the current query, if available.\n\t$total   = isset( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1;\n\t$current = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1;\n\n\t// Append the format placeholder to the base URL.\n\t$pagenum_link = trailingslashit( $url_parts[0] ) . '%_%';\n\n\t// URL base depends on permalink settings.\n\t$format  = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : '';\n\t$format .= $wp_rewrite->using_permalinks() ? user_trailingslashit( $wp_rewrite->pagination_base . '/%#%', 'paged' ) : '?paged=%#%';\n\n\t$defaults = array(\n\t\t'base'               => $pagenum_link, // http://example.com/all_posts.php%_% : %_% is replaced by format (below).\n\t\t'format'             => $format, // ?page=%#% : %#% is replaced by the page number.\n\t\t'total'              => $total,\n\t\t'current'            => $current,\n\t\t'aria_current'       => 'page',\n\t\t'show_all'           => false,\n\t\t'prev_next'          => true,\n\t\t'prev_text'          => __( '&laquo; Previous' ),\n\t\t'next_text'          => __( 'Next &raquo;' ),\n\t\t'end_size'           => 1,\n\t\t'mid_size'           => 2,\n\t\t'type'               => 'plain',\n\t\t'add_args'           => array(), // Array of query args to add.\n\t\t'add_fragment'       => '',\n\t\t'before_page_number' => '',\n\t\t'after_page_number'  => '',\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\tif ( ! is_array( $args['add_args'] ) ) {\n\t\t$args['add_args'] = array();\n\t}\n\n\t// Merge additional query vars found in the original URL into 'add_args' array.\n\tif ( isset( $url_parts[1] ) ) {\n\t\t// Find the format argument.\n\t\t$format       = explode( '?', str_replace( '%_%', $args['format'], $args['base'] ) );\n\t\t$format_query = isset( $format[1] ) ? $format[1] : '';\n\t\twp_parse_str( $format_query, $format_args );\n\n\t\t// Find the query args of the requested URL.\n\t\twp_parse_str( $url_parts[1], $url_query_args );\n\n\t\t// Remove the format argument from the array of query arguments, to avoid overwriting custom format.\n\t\tforeach ( $format_args as $format_arg => $format_arg_value ) {\n\t\t\tunset( $url_query_args[ $format_arg ] );\n\t\t}\n\n\t\t$args['add_args'] = array_merge( $args['add_args'], urlencode_deep( $url_query_args ) );\n\t}\n\n\t// Who knows what else people pass in $args.\n\t$total = (int) $args['total'];\n\tif ( $total < 2 ) {\n\t\treturn;\n\t}\n\t$current  = (int) $args['current'];\n\t$end_size = (int) $args['end_size']; // Out of bounds? Make it the default.\n\tif ( $end_size < 1 ) {\n\t\t$end_size = 1;\n\t}\n\t$mid_size = (int) $args['mid_size'];\n\tif ( $mid_size < 0 ) {\n\t\t$mid_size = 2;\n\t}\n\n\t$add_args   = $args['add_args'];\n\t$r          = '';\n\t$page_links = array();\n\t$dots       = false;\n\n\tif ( $args['prev_next'] && $current && 1 < $current ) :\n\t\t$link = str_replace( '%_%', 2 == $current ? '' : $args['format'], $args['base'] );\n\t\t$link = str_replace( '%#%', $current - 1, $link );\n\t\tif ( $add_args ) {\n\t\t\t$link = add_query_arg( $add_args, $link );\n\t\t}\n\t\t$link .= $args['add_fragment'];\n\n\t\t$page_links[] = sprintf(\n\t\t\t'<a class=\"prev page-numbers\" href=\"%s\">%s</a>',\n\t\t\t/**\n\t\t\t * Filters the paginated links for the given archive pages.\n\t\t\t *\n\t\t\t * @since 3.0.0\n\t\t\t *\n\t\t\t * @param string $link The paginated link URL.\n\t\t\t */\n\t\t\tesc_url( apply_filters( 'paginate_links', $link ) ),\n\t\t\t$args['prev_text']\n\t\t);\n\tendif;\n\n\tfor ( $n = 1; $n <= $total; $n++ ) :\n\t\tif ( $n == $current ) :\n\t\t\t$page_links[] = sprintf(\n\t\t\t\t'<span aria-current=\"%s\" class=\"page-numbers current\">%s</span>',\n\t\t\t\tesc_attr( $args['aria_current'] ),\n\t\t\t\t$args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number']\n\t\t\t);\n\n\t\t\t$dots = true;\n\t\telse :\n\t\t\tif ( $args['show_all'] || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) :\n\t\t\t\t$link = str_replace( '%_%', 1 == $n ? '' : $args['format'], $args['base'] );\n\t\t\t\t$link = str_replace( '%#%', $n, $link );\n\t\t\t\tif ( $add_args ) {\n\t\t\t\t\t$link = add_query_arg( $add_args, $link );\n\t\t\t\t}\n\t\t\t\t$link .= $args['add_fragment'];\n\n\t\t\t\t$page_links[] = sprintf(\n\t\t\t\t\t'<a class=\"page-numbers\" href=\"%s\">%s</a>',\n\t\t\t\t\t/** This filter is documented in wp-includes/general-template.php */\n\t\t\t\t\tesc_url( apply_filters( 'paginate_links', $link ) ),\n\t\t\t\t\t$args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number']\n\t\t\t\t);\n\n\t\t\t\t$dots = true;\n\t\t\telseif ( $dots && ! $args['show_all'] ) :\n\t\t\t\t$page_links[] = '<span class=\"page-numbers dots\">' . __( '&hellip;' ) . '</span>';\n\n\t\t\t\t$dots = false;\n\t\t\tendif;\n\t\tendif;\n\tendfor;\n\n\tif ( $args['prev_next'] && $current && $current < $total ) :\n\t\t$link = str_replace( '%_%', $args['format'], $args['base'] );\n\t\t$link = str_replace( '%#%', $current + 1, $link );\n\t\tif ( $add_args ) {\n\t\t\t$link = add_query_arg( $add_args, $link );\n\t\t}\n\t\t$link .= $args['add_fragment'];\n\n\t\t$page_links[] = sprintf(\n\t\t\t'<a class=\"next page-numbers\" href=\"%s\">%s</a>',\n\t\t\t/** This filter is documented in wp-includes/general-template.php */\n\t\t\tesc_url( apply_filters( 'paginate_links', $link ) ),\n\t\t\t$args['next_text']\n\t\t);\n\tendif;\n\n\tswitch ( $args['type'] ) {\n\t\tcase 'array':\n\t\t\treturn $page_links;\n\n\t\tcase 'list':\n\t\t\t$r .= \"<ul class='page-numbers'>\\n\\t<li>\";\n\t\t\t$r .= join( \"</li>\\n\\t<li>\", $page_links );\n\t\t\t$r .= \"</li>\\n</ul>\\n\";\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\t$r = join( \"\\n\", $page_links );\n\t\t\tbreak;\n\t}\n\n\treturn $r;\n}\n\n/**\n * Registers an admin color scheme css file.\n *\n * Allows a plugin to register a new admin color scheme. For example:\n *\n *     wp_admin_css_color( 'classic', __( 'Classic' ), admin_url( \"css/colors-classic.css\" ), array(\n *         '#07273E', '#14568A', '#D54E21', '#2683AE'\n *     ) );\n *\n * @since 2.5.0\n *\n * @global array $_wp_admin_css_colors\n *\n * @param string $key    The unique key for this theme.\n * @param string $name   The name of the theme.\n * @param string $url    The URL of the CSS file containing the color scheme.\n * @param array  $colors Optional. An array of CSS color definition strings which are used\n *                       to give the user a feel for the theme.\n * @param array  $icons {\n *     Optional. CSS color definitions used to color any SVG icons.\n *\n *     @type string $base    SVG icon base color.\n *     @type string $focus   SVG icon color on focus.\n *     @type string $current SVG icon color of current admin menu link.\n * }\n */\nfunction wp_admin_css_color( $key, $name, $url, $colors = array(), $icons = array() ) {\n\tglobal $_wp_admin_css_colors;\n\n\tif ( ! isset( $_wp_admin_css_colors ) ) {\n\t\t$_wp_admin_css_colors = array();\n\t}\n\n\t$_wp_admin_css_colors[ $key ] = (object) array(\n\t\t'name'        => $name,\n\t\t'url'         => $url,\n\t\t'colors'      => $colors,\n\t\t'icon_colors' => $icons,\n\t);\n}\n\n/**\n * Registers the default admin color schemes.\n *\n * Registers the initial set of eight color schemes in the Profile section\n * of the dashboard which allows for styling the admin menu and toolbar.\n *\n * @see wp_admin_css_color()\n *\n * @since 3.0.0\n */\nfunction register_admin_color_schemes() {\n\t$suffix  = is_rtl() ? '-rtl' : '';\n\t$suffix .= SCRIPT_DEBUG ? '' : '.min';\n\n\twp_admin_css_color(\n\t\t'fresh',\n\t\t_x( 'Default', 'admin color scheme' ),\n\t\tfalse,\n\t\tarray( '#222', '#333', '#0073aa', '#00a0d2' ),\n\t\tarray(\n\t\t\t'base'    => '#a0a5aa',\n\t\t\t'focus'   => '#00a0d2',\n\t\t\t'current' => '#fff',\n\t\t)\n\t);\n\n\twp_admin_css_color(\n\t\t'light',\n\t\t_x( 'Light', 'admin color scheme' ),\n\t\tadmin_url( \"css/colors/light/colors$suffix.css\" ),\n\t\tarray( '#e5e5e5', '#999', '#d64e07', '#04a4cc' ),\n\t\tarray(\n\t\t\t'base'    => '#999',\n\t\t\t'focus'   => '#ccc',\n\t\t\t'current' => '#ccc',\n\t\t)\n\t);\n\n\twp_admin_css_color(\n\t\t'modern',\n\t\t_x( 'Modern', 'admin color scheme' ),\n\t\tadmin_url( \"css/colors/modern/colors$suffix.css\" ),\n\t\tarray( '#1e1e1e', '#3858e9', '#33f078' ),\n\t\tarray(\n\t\t\t'base'    => '#f3f1f1',\n\t\t\t'focus'   => '#fff',\n\t\t\t'current' => '#fff',\n\t\t)\n\t);\n\n\twp_admin_css_color(\n\t\t'blue',\n\t\t_x( 'Blue', 'admin color scheme' ),\n\t\tadmin_url( \"css/colors/blue/colors$suffix.css\" ),\n\t\tarray( '#096484', '#4796b3', '#52accc', '#74B6CE' ),\n\t\tarray(\n\t\t\t'base'    => '#e5f8ff',\n\t\t\t'focus'   => '#fff',\n\t\t\t'current' => '#fff',\n\t\t)\n\t);\n\n\twp_admin_css_color(\n\t\t'midnight',\n\t\t_x( 'Midnight', 'admin color scheme' ),\n\t\tadmin_url( \"css/colors/midnight/colors$suffix.css\" ),\n\t\tarray( '#25282b', '#363b3f', '#69a8bb', '#e14d43' ),\n\t\tarray(\n\t\t\t'base'    => '#f1f2f3',\n\t\t\t'focus'   => '#fff',\n\t\t\t'current' => '#fff',\n\t\t)\n\t);\n\n\twp_admin_css_color(\n\t\t'sunrise',\n\t\t_x( 'Sunrise', 'admin color scheme' ),\n\t\tadmin_url( \"css/colors/sunrise/colors$suffix.css\" ),\n\t\tarray( '#b43c38', '#cf4944', '#dd823b', '#ccaf0b' ),\n\t\tarray(\n\t\t\t'base'    => '#f3f1f1',\n\t\t\t'focus'   => '#fff',\n\t\t\t'current' => '#fff',\n\t\t)\n\t);\n\n\twp_admin_css_color(\n\t\t'ectoplasm',\n\t\t_x( 'Ectoplasm', 'admin color scheme' ),\n\t\tadmin_url( \"css/colors/ectoplasm/colors$suffix.css\" ),\n\t\tarray( '#413256', '#523f6d', '#a3b745', '#d46f15' ),\n\t\tarray(\n\t\t\t'base'    => '#ece6f6',\n\t\t\t'focus'   => '#fff',\n\t\t\t'current' => '#fff',\n\t\t)\n\t);\n\n\twp_admin_css_color(\n\t\t'ocean',\n\t\t_x( 'Ocean', 'admin color scheme' ),\n\t\tadmin_url( \"css/colors/ocean/colors$suffix.css\" ),\n\t\tarray( '#627c83', '#738e96', '#9ebaa0', '#aa9d88' ),\n\t\tarray(\n\t\t\t'base'    => '#f2fcff',\n\t\t\t'focus'   => '#fff',\n\t\t\t'current' => '#fff',\n\t\t)\n\t);\n\n\twp_admin_css_color(\n\t\t'coffee',\n\t\t_x( 'Coffee', 'admin color scheme' ),\n\t\tadmin_url( \"css/colors/coffee/colors$suffix.css\" ),\n\t\tarray( '#46403c', '#59524c', '#c7a589', '#9ea476' ),\n\t\tarray(\n\t\t\t'base'    => '#f3f2f1',\n\t\t\t'focus'   => '#fff',\n\t\t\t'current' => '#fff',\n\t\t)\n\t);\n\n}\n\n/**\n * Displays the URL of a WordPress admin CSS file.\n *\n * @see WP_Styles::_css_href and its {@see 'style_loader_src'} filter.\n *\n * @since 2.3.0\n *\n * @param string $file file relative to wp-admin/ without its \".css\" extension.\n * @return string\n */\nfunction wp_admin_css_uri( $file = 'wp-admin' ) {\n\tif ( defined( 'WP_INSTALLING' ) ) {\n\t\t$_file = \"./$file.css\";\n\t} else {\n\t\t$_file = admin_url( \"$file.css\" );\n\t}\n\t$_file = add_query_arg( 'version', get_bloginfo( 'version' ), $_file );\n\n\t/**\n\t * Filters the URI of a WordPress admin CSS file.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string $_file Relative path to the file with query arguments attached.\n\t * @param string $file  Relative path to the file, minus its \".css\" extension.\n\t */\n\treturn apply_filters( 'wp_admin_css_uri', $_file, $file );\n}\n\n/**\n * Enqueues or directly prints a stylesheet link to the specified CSS file.\n *\n * \"Intelligently\" decides to enqueue or to print the CSS file. If the\n * {@see 'wp_print_styles'} action has *not* yet been called, the CSS file will be\n * enqueued. If the {@see 'wp_print_styles'} action has been called, the CSS link will\n * be printed. Printing may be forced by passing true as the $force_echo\n * (second) parameter.\n *\n * For backward compatibility with WordPress 2.3 calling method: If the $file\n * (first) parameter does not correspond to a registered CSS file, we assume\n * $file is a file relative to wp-admin/ without its \".css\" extension. A\n * stylesheet link to that generated URL is printed.\n *\n * @since 2.3.0\n *\n * @param string $file       Optional. Style handle name or file name (without \".css\" extension) relative\n *                           to wp-admin/. Defaults to 'wp-admin'.\n * @param bool   $force_echo Optional. Force the stylesheet link to be printed rather than enqueued.\n */\nfunction wp_admin_css( $file = 'wp-admin', $force_echo = false ) {\n\t// For backward compatibility.\n\t$handle = 0 === strpos( $file, 'css/' ) ? substr( $file, 4 ) : $file;\n\n\tif ( wp_styles()->query( $handle ) ) {\n\t\tif ( $force_echo || did_action( 'wp_print_styles' ) ) {\n\t\t\t// We already printed the style queue. Print this one immediately.\n\t\t\twp_print_styles( $handle );\n\t\t} else {\n\t\t\t// Add to style queue.\n\t\t\twp_enqueue_style( $handle );\n\t\t}\n\t\treturn;\n\t}\n\n\t$stylesheet_link = sprintf(\n\t\t\"<link rel='stylesheet' href='%s' type='text/css' />\\n\",\n\t\tesc_url( wp_admin_css_uri( $file ) )\n\t);\n\n\t/**\n\t * Filters the stylesheet link to the specified CSS file.\n\t *\n\t * If the site is set to display right-to-left, the RTL stylesheet link\n\t * will be used instead.\n\t *\n\t * @since 2.3.0\n\t * @param string $stylesheet_link HTML link element for the stylesheet.\n\t * @param string $file            Style handle name or filename (without \".css\" extension)\n\t *                                relative to wp-admin/. Defaults to 'wp-admin'.\n\t */\n\techo apply_filters( 'wp_admin_css', $stylesheet_link, $file );\n\n\tif ( function_exists( 'is_rtl' ) && is_rtl() ) {\n\t\t$rtl_stylesheet_link = sprintf(\n\t\t\t\"<link rel='stylesheet' href='%s' type='text/css' />\\n\",\n\t\t\tesc_url( wp_admin_css_uri( \"$file-rtl\" ) )\n\t\t);\n\n\t\t/** This filter is documented in wp-includes/general-template.php */\n\t\techo apply_filters( 'wp_admin_css', $rtl_stylesheet_link, \"$file-rtl\" );\n\t}\n}\n\n/**\n * Enqueues the default ThickBox js and css.\n *\n * If any of the settings need to be changed, this can be done with another js\n * file similar to media-upload.js. That file should\n * require array('thickbox') to ensure it is loaded after.\n *\n * @since 2.5.0\n */\nfunction add_thickbox() {\n\twp_enqueue_script( 'thickbox' );\n\twp_enqueue_style( 'thickbox' );\n\n\tif ( is_network_admin() ) {\n\t\tadd_action( 'admin_head', '_thickbox_path_admin_subfolder' );\n\t}\n}\n\n/**\n * Displays the XHTML generator that is generated on the wp_head hook.\n *\n * See {@see 'wp_head'}.\n *\n * @since 2.5.0\n */\nfunction wp_generator() {\n\t/**\n\t * Filters the output of the XHTML generator tag.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $generator_type The XHTML generator.\n\t */\n\tthe_generator( apply_filters( 'wp_generator_type', 'xhtml' ) );\n}\n\n/**\n * Display the generator XML or Comment for RSS, ATOM, etc.\n *\n * Returns the correct generator type for the requested output format. Allows\n * for a plugin to filter generators overall the {@see 'the_generator'} filter.\n *\n * @since 2.5.0\n *\n * @param string $type The type of generator to output - (html|xhtml|atom|rss2|rdf|comment|export).\n */\nfunction the_generator( $type ) {\n\t/**\n\t * Filters the output of the XHTML generator tag for display.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $generator_type The generator output.\n\t * @param string $type           The type of generator to output. Accepts 'html',\n\t *                               'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export'.\n\t */\n\techo apply_filters( 'the_generator', get_the_generator( $type ), $type ) . \"\\n\";\n}\n\n/**\n * Creates the generator XML or Comment for RSS, ATOM, etc.\n *\n * Returns the correct generator type for the requested output format. Allows\n * for a plugin to filter generators on an individual basis using the\n * {@see 'get_the_generator_$type'} filter.\n *\n * @since 2.5.0\n *\n * @param string $type The type of generator to return - (html|xhtml|atom|rss2|rdf|comment|export).\n * @return string|void The HTML content for the generator.\n */\nfunction get_the_generator( $type = '' ) {\n\tif ( empty( $type ) ) {\n\n\t\t$current_filter = current_filter();\n\t\tif ( empty( $current_filter ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ( $current_filter ) {\n\t\t\tcase 'rss2_head':\n\t\t\tcase 'commentsrss2_head':\n\t\t\t\t$type = 'rss2';\n\t\t\t\tbreak;\n\t\t\tcase 'rss_head':\n\t\t\tcase 'opml_head':\n\t\t\t\t$type = 'comment';\n\t\t\t\tbreak;\n\t\t\tcase 'rdf_header':\n\t\t\t\t$type = 'rdf';\n\t\t\t\tbreak;\n\t\t\tcase 'atom_head':\n\t\t\tcase 'comments_atom_head':\n\t\t\tcase 'app_head':\n\t\t\t\t$type = 'atom';\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tswitch ( $type ) {\n\t\tcase 'html':\n\t\t\t$gen = '<meta name=\"generator\" content=\"WordPress ' . esc_attr( get_bloginfo( 'version' ) ) . '\">';\n\t\t\tbreak;\n\t\tcase 'xhtml':\n\t\t\t$gen = '<meta name=\"generator\" content=\"WordPress ' . esc_attr( get_bloginfo( 'version' ) ) . '\" />';\n\t\t\tbreak;\n\t\tcase 'atom':\n\t\t\t$gen = '<generator uri=\"https://wordpress.org/\" version=\"' . esc_attr( get_bloginfo_rss( 'version' ) ) . '\">WordPress</generator>';\n\t\t\tbreak;\n\t\tcase 'rss2':\n\t\t\t$gen = '<generator>' . esc_url_raw( 'https://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) ) . '</generator>';\n\t\t\tbreak;\n\t\tcase 'rdf':\n\t\t\t$gen = '<admin:generatorAgent rdf:resource=\"' . esc_url_raw( 'https://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) ) . '\" />';\n\t\t\tbreak;\n\t\tcase 'comment':\n\t\t\t$gen = '<!-- generator=\"WordPress/' . esc_attr( get_bloginfo( 'version' ) ) . '\" -->';\n\t\t\tbreak;\n\t\tcase 'export':\n\t\t\t$gen = '<!-- generator=\"WordPress/' . esc_attr( get_bloginfo_rss( 'version' ) ) . '\" created=\"' . gmdate( 'Y-m-d H:i' ) . '\" -->';\n\t\t\tbreak;\n\t}\n\n\t/**\n\t * Filters the HTML for the retrieved generator type.\n\t *\n\t * The dynamic portion of the hook name, `$type`, refers to the generator type.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $gen  The HTML markup output to wp_head().\n\t * @param string $type The type of generator. Accepts 'html', 'xhtml', 'atom',\n\t *                     'rss2', 'rdf', 'comment', 'export'.\n\t */\n\treturn apply_filters( \"get_the_generator_{$type}\", $gen, $type );\n}\n\n/**\n * Outputs the HTML checked attribute.\n *\n * Compares the first two arguments and if identical marks as checked\n *\n * @since 1.0.0\n *\n * @param mixed $checked One of the values to compare\n * @param mixed $current (true) The other value to compare if not just true\n * @param bool  $echo    Whether to echo or just return the string\n * @return string HTML attribute or empty string\n */\nfunction checked( $checked, $current = true, $echo = true ) {\n\treturn __checked_selected_helper( $checked, $current, $echo, 'checked' );\n}\n\n/**\n * Outputs the HTML selected attribute.\n *\n * Compares the first two arguments and if identical marks as selected\n *\n * @since 1.0.0\n *\n * @param mixed $selected One of the values to compare\n * @param mixed $current  (true) The other value to compare if not just true\n * @param bool  $echo     Whether to echo or just return the string\n * @return string HTML attribute or empty string\n */\nfunction selected( $selected, $current = true, $echo = true ) {\n\treturn __checked_selected_helper( $selected, $current, $echo, 'selected' );\n}\n\n/**\n * Outputs the HTML disabled attribute.\n *\n * Compares the first two arguments and if identical marks as disabled\n *\n * @since 3.0.0\n *\n * @param mixed $disabled One of the values to compare\n * @param mixed $current  (true) The other value to compare if not just true\n * @param bool  $echo     Whether to echo or just return the string\n * @return string HTML attribute or empty string\n */\nfunction disabled( $disabled, $current = true, $echo = true ) {\n\treturn __checked_selected_helper( $disabled, $current, $echo, 'disabled' );\n}\n\n/**\n * Outputs the HTML readonly attribute.\n *\n * Compares the first two arguments and if identical marks as readonly\n *\n * @since 4.9.0\n *\n * @param mixed $readonly One of the values to compare\n * @param mixed $current  (true) The other value to compare if not just true\n * @param bool  $echo     Whether to echo or just return the string\n * @return string HTML attribute or empty string\n */\nfunction readonly( $readonly, $current = true, $echo = true ) {\n\treturn __checked_selected_helper( $readonly, $current, $echo, 'readonly' );\n}\n\n/**\n * Private helper function for checked, selected, disabled and readonly.\n *\n * Compares the first two arguments and if identical marks as $type\n *\n * @since 2.8.0\n * @access private\n *\n * @param mixed  $helper  One of the values to compare\n * @param mixed  $current (true) The other value to compare if not just true\n * @param bool   $echo    Whether to echo or just return the string\n * @param string $type    The type of checked|selected|disabled|readonly we are doing\n * @return string HTML attribute or empty string\n */\nfunction __checked_selected_helper( $helper, $current, $echo, $type ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore\n\tif ( (string) $helper === (string) $current ) {\n\t\t$result = \" $type='$type'\";\n\t} else {\n\t\t$result = '';\n\t}\n\n\tif ( $echo ) {\n\t\techo $result;\n\t}\n\n\treturn $result;\n}\n\n/**\n * Default settings for heartbeat\n *\n * Outputs the nonce used in the heartbeat XHR\n *\n * @since 3.6.0\n *\n * @param array $settings\n * @return array Heartbeat settings.\n */\nfunction wp_heartbeat_settings( $settings ) {\n\tif ( ! is_admin() ) {\n\t\t$settings['ajaxurl'] = admin_url( 'admin-ajax.php', 'relative' );\n\t}\n\n\tif ( is_user_logged_in() ) {\n\t\t$settings['nonce'] = wp_create_nonce( 'heartbeat-nonce' );\n\t}\n\n\treturn $settings;\n}\n", "num_lines": 4875}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Core HTTP Request API\n *\n * Standardizes the HTTP requests for WordPress. Handles cookies, gzip encoding and decoding, chunk\n * decoding, if HTTP 1.1 and various other difficult HTTP protocol implementations.\n *\n * @package WordPress\n * @subpackage HTTP\n */\n\n/**\n * Returns the initialized WP_Http Object\n *\n * @since 2.7.0\n * @access private\n *\n * @return WP_Http HTTP Transport object.\n */\nfunction _wp_http_get_object() {\n\tstatic $http = null;\n\n\tif ( is_null( $http ) ) {\n\t\t$http = new WP_Http();\n\t}\n\treturn $http;\n}\n\n/**\n * Retrieve the raw response from a safe HTTP request.\n *\n * This function is ideal when the HTTP request is being made to an arbitrary\n * URL. The URL is validated to avoid redirection and request forgery attacks.\n *\n * @since 3.6.0\n *\n * @see wp_remote_request() For more information on the response array format.\n * @see WP_Http::request() For default arguments information.\n *\n * @param string $url  URL to retrieve.\n * @param array  $args Optional. Request arguments. Default empty array.\n * @return array|WP_Error The response or WP_Error on failure.\n */\nfunction wp_safe_remote_request( $url, $args = array() ) {\n\t$args['reject_unsafe_urls'] = true;\n\t$http                       = _wp_http_get_object();\n\treturn $http->request( $url, $args );\n}\n\n/**\n * Retrieve the raw response from a safe HTTP request using the GET method.\n *\n * This function is ideal when the HTTP request is being made to an arbitrary\n * URL. The URL is validated to avoid redirection and request forgery attacks.\n *\n * @since 3.6.0\n *\n * @see wp_remote_request() For more information on the response array format.\n * @see WP_Http::request() For default arguments information.\n *\n * @param string $url  URL to retrieve.\n * @param array  $args Optional. Request arguments. Default empty array.\n * @return array|WP_Error The response or WP_Error on failure.\n */\nfunction wp_safe_remote_get( $url, $args = array() ) {\n\t$args['reject_unsafe_urls'] = true;\n\t$http                       = _wp_http_get_object();\n\treturn $http->get( $url, $args );\n}\n\n/**\n * Retrieve the raw response from a safe HTTP request using the POST method.\n *\n * This function is ideal when the HTTP request is being made to an arbitrary\n * URL. The URL is validated to avoid redirection and request forgery attacks.\n *\n * @since 3.6.0\n *\n * @see wp_remote_request() For more information on the response array format.\n * @see WP_Http::request() For default arguments information.\n *\n * @param string $url  URL to retrieve.\n * @param array  $args Optional. Request arguments. Default empty array.\n * @return array|WP_Error The response or WP_Error on failure.\n */\nfunction wp_safe_remote_post( $url, $args = array() ) {\n\t$args['reject_unsafe_urls'] = true;\n\t$http                       = _wp_http_get_object();\n\treturn $http->post( $url, $args );\n}\n\n/**\n * Retrieve the raw response from a safe HTTP request using the HEAD method.\n *\n * This function is ideal when the HTTP request is being made to an arbitrary\n * URL. The URL is validated to avoid redirection and request forgery attacks.\n *\n * @since 3.6.0\n *\n * @see wp_remote_request() For more information on the response array format.\n * @see WP_Http::request() For default arguments information.\n *\n * @param string $url  URL to retrieve.\n * @param array  $args Optional. Request arguments. Default empty array.\n * @return array|WP_Error The response or WP_Error on failure.\n */\nfunction wp_safe_remote_head( $url, $args = array() ) {\n\t$args['reject_unsafe_urls'] = true;\n\t$http                       = _wp_http_get_object();\n\treturn $http->head( $url, $args );\n}\n\n/**\n * Performs an HTTP request and returns its response.\n *\n * There are other API functions available which abstract away the HTTP method:\n *\n *  - Default 'GET'  for wp_remote_get()\n *  - Default 'POST' for wp_remote_post()\n *  - Default 'HEAD' for wp_remote_head()\n *\n * @since 2.7.0\n *\n * @see WP_Http::request() For information on default arguments.\n *\n * @param string $url  URL to retrieve.\n * @param array  $args Optional. Request arguments. Default empty array.\n * @return array|WP_Error {\n *     The response array or a WP_Error on failure.\n *\n *     @type string[]                       $headers       Array of response headers keyed by their name.\n *     @type string                         $body          Response body.\n *     @type array                          $response      {\n *         Data about the HTTP response.\n *\n *         @type int|false    $code    HTTP response code.\n *         @type string|false $message HTTP response message.\n *     }\n *     @type WP_HTTP_Cookie[]               $cookies       Array of response cookies.\n *     @type WP_HTTP_Requests_Response|null $http_response Raw HTTP response object.\n * }\n */\nfunction wp_remote_request( $url, $args = array() ) {\n\t$http = _wp_http_get_object();\n\treturn $http->request( $url, $args );\n}\n\n/**\n * Performs an HTTP request using the GET method and returns its response.\n *\n * @since 2.7.0\n *\n * @see wp_remote_request() For more information on the response array format.\n * @see WP_Http::request() For default arguments information.\n *\n * @param string $url  URL to retrieve.\n * @param array  $args Optional. Request arguments. Default empty array.\n * @return array|WP_Error The response or WP_Error on failure.\n */\nfunction wp_remote_get( $url, $args = array() ) {\n\t$http = _wp_http_get_object();\n\treturn $http->get( $url, $args );\n}\n\n/**\n * Performs an HTTP request using the POST method and returns its response.\n *\n * @since 2.7.0\n *\n * @see wp_remote_request() For more information on the response array format.\n * @see WP_Http::request() For default arguments information.\n *\n * @param string $url  URL to retrieve.\n * @param array  $args Optional. Request arguments. Default empty array.\n * @return array|WP_Error The response or WP_Error on failure.\n */\nfunction wp_remote_post( $url, $args = array() ) {\n\t$http = _wp_http_get_object();\n\treturn $http->post( $url, $args );\n}\n\n/**\n * Performs an HTTP request using the HEAD method and returns its response.\n *\n * @since 2.7.0\n *\n * @see wp_remote_request() For more information on the response array format.\n * @see WP_Http::request() For default arguments information.\n *\n * @param string $url  URL to retrieve.\n * @param array  $args Optional. Request arguments. Default empty array.\n * @return array|WP_Error The response or WP_Error on failure.\n */\nfunction wp_remote_head( $url, $args = array() ) {\n\t$http = _wp_http_get_object();\n\treturn $http->head( $url, $args );\n}\n\n/**\n * Retrieve only the headers from the raw response.\n *\n * @since 2.7.0\n * @since 4.6.0 Return value changed from an array to an Requests_Utility_CaseInsensitiveDictionary instance.\n *\n * @see \\Requests_Utility_CaseInsensitiveDictionary\n *\n * @param array|WP_Error $response HTTP response.\n * @return array|\\Requests_Utility_CaseInsensitiveDictionary The headers of the response. Empty array if incorrect parameter given.\n */\nfunction wp_remote_retrieve_headers( $response ) {\n\tif ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) {\n\t\treturn array();\n\t}\n\n\treturn $response['headers'];\n}\n\n/**\n * Retrieve a single header by name from the raw response.\n *\n * @since 2.7.0\n *\n * @param array|WP_Error $response HTTP response.\n * @param string         $header   Header name to retrieve value from.\n * @return string The header value. Empty string on if incorrect parameter given, or if the header doesn't exist.\n */\nfunction wp_remote_retrieve_header( $response, $header ) {\n\tif ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) {\n\t\treturn '';\n\t}\n\n\tif ( isset( $response['headers'][ $header ] ) ) {\n\t\treturn $response['headers'][ $header ];\n\t}\n\n\treturn '';\n}\n\n/**\n * Retrieve only the response code from the raw response.\n *\n * Will return an empty array if incorrect parameter value is given.\n *\n * @since 2.7.0\n *\n * @param array|WP_Error $response HTTP response.\n * @return int|string The response code as an integer. Empty string on incorrect parameter given.\n */\nfunction wp_remote_retrieve_response_code( $response ) {\n\tif ( is_wp_error( $response ) || ! isset( $response['response'] ) || ! is_array( $response['response'] ) ) {\n\t\treturn '';\n\t}\n\n\treturn $response['response']['code'];\n}\n\n/**\n * Retrieve only the response message from the raw response.\n *\n * Will return an empty array if incorrect parameter value is given.\n *\n * @since 2.7.0\n *\n * @param array|WP_Error $response HTTP response.\n * @return string The response message. Empty string on incorrect parameter given.\n */\nfunction wp_remote_retrieve_response_message( $response ) {\n\tif ( is_wp_error( $response ) || ! isset( $response['response'] ) || ! is_array( $response['response'] ) ) {\n\t\treturn '';\n\t}\n\n\treturn $response['response']['message'];\n}\n\n/**\n * Retrieve only the body from the raw response.\n *\n * @since 2.7.0\n *\n * @param array|WP_Error $response HTTP response.\n * @return string The body of the response. Empty string if no body or incorrect parameter given.\n */\nfunction wp_remote_retrieve_body( $response ) {\n\tif ( is_wp_error( $response ) || ! isset( $response['body'] ) ) {\n\t\treturn '';\n\t}\n\n\treturn $response['body'];\n}\n\n/**\n * Retrieve only the cookies from the raw response.\n *\n * @since 4.4.0\n *\n * @param array|WP_Error $response HTTP response.\n * @return WP_Http_Cookie[] An array of `WP_Http_Cookie` objects from the response. Empty array if there are none, or the response is a WP_Error.\n */\nfunction wp_remote_retrieve_cookies( $response ) {\n\tif ( is_wp_error( $response ) || empty( $response['cookies'] ) ) {\n\t\treturn array();\n\t}\n\n\treturn $response['cookies'];\n}\n\n/**\n * Retrieve a single cookie by name from the raw response.\n *\n * @since 4.4.0\n *\n * @param array|WP_Error $response HTTP response.\n * @param string         $name     The name of the cookie to retrieve.\n * @return WP_Http_Cookie|string The `WP_Http_Cookie` object. Empty string if the cookie isn't present in the response.\n */\nfunction wp_remote_retrieve_cookie( $response, $name ) {\n\t$cookies = wp_remote_retrieve_cookies( $response );\n\n\tif ( empty( $cookies ) ) {\n\t\treturn '';\n\t}\n\n\tforeach ( $cookies as $cookie ) {\n\t\tif ( $cookie->name === $name ) {\n\t\t\treturn $cookie;\n\t\t}\n\t}\n\n\treturn '';\n}\n\n/**\n * Retrieve a single cookie's value by name from the raw response.\n *\n * @since 4.4.0\n *\n * @param array|WP_Error $response HTTP response.\n * @param string         $name     The name of the cookie to retrieve.\n * @return string The value of the cookie. Empty string if the cookie isn't present in the response.\n */\nfunction wp_remote_retrieve_cookie_value( $response, $name ) {\n\t$cookie = wp_remote_retrieve_cookie( $response, $name );\n\n\tif ( ! is_a( $cookie, 'WP_Http_Cookie' ) ) {\n\t\treturn '';\n\t}\n\n\treturn $cookie->value;\n}\n\n/**\n * Determines if there is an HTTP Transport that can process this request.\n *\n * @since 3.2.0\n *\n * @param array  $capabilities Array of capabilities to test or a wp_remote_request() $args array.\n * @param string $url          Optional. If given, will check if the URL requires SSL and adds\n *                             that requirement to the capabilities array.\n *\n * @return bool\n */\nfunction wp_http_supports( $capabilities = array(), $url = null ) {\n\t$http = _wp_http_get_object();\n\n\t$capabilities = wp_parse_args( $capabilities );\n\n\t$count = count( $capabilities );\n\n\t// If we have a numeric $capabilities array, spoof a wp_remote_request() associative $args array.\n\tif ( $count && count( array_filter( array_keys( $capabilities ), 'is_numeric' ) ) == $count ) {\n\t\t$capabilities = array_combine( array_values( $capabilities ), array_fill( 0, $count, true ) );\n\t}\n\n\tif ( $url && ! isset( $capabilities['ssl'] ) ) {\n\t\t$scheme = parse_url( $url, PHP_URL_SCHEME );\n\t\tif ( 'https' === $scheme || 'ssl' === $scheme ) {\n\t\t\t$capabilities['ssl'] = true;\n\t\t}\n\t}\n\n\treturn (bool) $http->_get_first_available_transport( $capabilities );\n}\n\n/**\n * Get the HTTP Origin of the current request.\n *\n * @since 3.4.0\n *\n * @return string URL of the origin. Empty string if no origin.\n */\nfunction get_http_origin() {\n\t$origin = '';\n\tif ( ! empty( $_SERVER['HTTP_ORIGIN'] ) ) {\n\t\t$origin = $_SERVER['HTTP_ORIGIN'];\n\t}\n\n\t/**\n\t * Change the origin of an HTTP request.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $origin The original origin for the request.\n\t */\n\treturn apply_filters( 'http_origin', $origin );\n}\n\n/**\n * Retrieve list of allowed HTTP origins.\n *\n * @since 3.4.0\n *\n * @return string[] Array of origin URLs.\n */\nfunction get_allowed_http_origins() {\n\t$admin_origin = parse_url( admin_url() );\n\t$home_origin  = parse_url( home_url() );\n\n\t// @todo Preserve port?\n\t$allowed_origins = array_unique(\n\t\tarray(\n\t\t\t'http://' . $admin_origin['host'],\n\t\t\t'https://' . $admin_origin['host'],\n\t\t\t'http://' . $home_origin['host'],\n\t\t\t'https://' . $home_origin['host'],\n\t\t)\n\t);\n\n\t/**\n\t * Change the origin types allowed for HTTP requests.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string[] $allowed_origins {\n\t *     Array of default allowed HTTP origins.\n\t *\n\t *     @type string $0 Non-secure URL for admin origin.\n\t *     @type string $1 Secure URL for admin origin.\n\t *     @type string $2 Non-secure URL for home origin.\n\t *     @type string $3 Secure URL for home origin.\n\t * }\n\t */\n\treturn apply_filters( 'allowed_http_origins', $allowed_origins );\n}\n\n/**\n * Determines if the HTTP origin is an authorized one.\n *\n * @since 3.4.0\n *\n * @param null|string $origin Origin URL. If not provided, the value of get_http_origin() is used.\n * @return string Origin URL if allowed, empty string if not.\n */\nfunction is_allowed_http_origin( $origin = null ) {\n\t$origin_arg = $origin;\n\n\tif ( null === $origin ) {\n\t\t$origin = get_http_origin();\n\t}\n\n\tif ( $origin && ! in_array( $origin, get_allowed_http_origins(), true ) ) {\n\t\t$origin = '';\n\t}\n\n\t/**\n\t * Change the allowed HTTP origin result.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string $origin     Origin URL if allowed, empty string if not.\n\t * @param string $origin_arg Original origin string passed into is_allowed_http_origin function.\n\t */\n\treturn apply_filters( 'allowed_http_origin', $origin, $origin_arg );\n}\n\n/**\n * Send Access-Control-Allow-Origin and related headers if the current request\n * is from an allowed origin.\n *\n * If the request is an OPTIONS request, the script exits with either access\n * control headers sent, or a 403 response if the origin is not allowed. For\n * other request methods, you will receive a return value.\n *\n * @since 3.4.0\n *\n * @return string|false Returns the origin URL if headers are sent. Returns false\n *                      if headers are not sent.\n */\nfunction send_origin_headers() {\n\t$origin = get_http_origin();\n\n\tif ( is_allowed_http_origin( $origin ) ) {\n\t\theader( 'Access-Control-Allow-Origin: ' . $origin );\n\t\theader( 'Access-Control-Allow-Credentials: true' );\n\t\tif ( 'OPTIONS' === $_SERVER['REQUEST_METHOD'] ) {\n\t\t\texit;\n\t\t}\n\t\treturn $origin;\n\t}\n\n\tif ( 'OPTIONS' === $_SERVER['REQUEST_METHOD'] ) {\n\t\tstatus_header( 403 );\n\t\texit;\n\t}\n\n\treturn false;\n}\n\n/**\n * Validate a URL for safe use in the HTTP API.\n *\n * @since 3.5.2\n *\n * @param string $url Request URL.\n * @return string|false URL or false on failure.\n */\nfunction wp_http_validate_url( $url ) {\n\t$original_url = $url;\n\t$url          = wp_kses_bad_protocol( $url, array( 'http', 'https' ) );\n\tif ( ! $url || strtolower( $url ) !== strtolower( $original_url ) ) {\n\t\treturn false;\n\t}\n\n\t$parsed_url = parse_url( $url );\n\tif ( ! $parsed_url || empty( $parsed_url['host'] ) ) {\n\t\treturn false;\n\t}\n\n\tif ( isset( $parsed_url['user'] ) || isset( $parsed_url['pass'] ) ) {\n\t\treturn false;\n\t}\n\n\tif ( false !== strpbrk( $parsed_url['host'], ':#?[]' ) ) {\n\t\treturn false;\n\t}\n\n\t$parsed_home = parse_url( get_option( 'home' ) );\n\n\tif ( isset( $parsed_home['host'] ) ) {\n\t\t$same_host = strtolower( $parsed_home['host'] ) === strtolower( $parsed_url['host'] );\n\t} else {\n\t\t$same_host = false;\n\t}\n\n\tif ( ! $same_host ) {\n\t\t$host = trim( $parsed_url['host'], '.' );\n\t\tif ( preg_match( '#^(([1-9]?\\d|1\\d\\d|25[0-5]|2[0-4]\\d)\\.){3}([1-9]?\\d|1\\d\\d|25[0-5]|2[0-4]\\d)$#', $host ) ) {\n\t\t\t$ip = $host;\n\t\t} else {\n\t\t\t$ip = gethostbyname( $host );\n\t\t\tif ( $ip === $host ) { // Error condition for gethostbyname().\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif ( $ip ) {\n\t\t\t$parts = array_map( 'intval', explode( '.', $ip ) );\n\t\t\tif ( 127 === $parts[0] || 10 === $parts[0] || 0 === $parts[0]\n\t\t\t\t|| ( 172 === $parts[0] && 16 <= $parts[1] && 31 >= $parts[1] )\n\t\t\t\t|| ( 192 === $parts[0] && 168 === $parts[1] )\n\t\t\t) {\n\t\t\t\t// If host appears local, reject unless specifically allowed.\n\t\t\t\t/**\n\t\t\t\t * Check if HTTP request is external or not.\n\t\t\t\t *\n\t\t\t\t * Allows to change and allow external requests for the HTTP request.\n\t\t\t\t *\n\t\t\t\t * @since 3.6.0\n\t\t\t\t *\n\t\t\t\t * @param bool   $external Whether HTTP request is external or not.\n\t\t\t\t * @param string $host     Host name of the requested URL.\n\t\t\t\t * @param string $url      Requested URL.\n\t\t\t\t */\n\t\t\t\tif ( ! apply_filters( 'http_request_host_is_external', false, $host, $url ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( empty( $parsed_url['port'] ) ) {\n\t\treturn $url;\n\t}\n\n\t$port = $parsed_url['port'];\n\tif ( 80 === $port || 443 === $port || 8080 === $port ) {\n\t\treturn $url;\n\t}\n\n\tif ( $parsed_home && $same_host && isset( $parsed_home['port'] ) && $parsed_home['port'] === $port ) {\n\t\treturn $url;\n\t}\n\n\treturn false;\n}\n\n/**\n * Mark allowed redirect hosts safe for HTTP requests as well.\n *\n * Attached to the {@see 'http_request_host_is_external'} filter.\n *\n * @since 3.6.0\n *\n * @param bool   $is_external\n * @param string $host\n * @return bool\n */\nfunction allowed_http_request_hosts( $is_external, $host ) {\n\tif ( ! $is_external && wp_validate_redirect( 'http://' . $host ) ) {\n\t\t$is_external = true;\n\t}\n\treturn $is_external;\n}\n\n/**\n * Adds any domain in a multisite installation for safe HTTP requests to the\n * allowed list.\n *\n * Attached to the {@see 'http_request_host_is_external'} filter.\n *\n * @since 3.6.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param bool   $is_external\n * @param string $host\n * @return bool\n */\nfunction ms_allowed_http_request_hosts( $is_external, $host ) {\n\tglobal $wpdb;\n\tstatic $queried = array();\n\tif ( $is_external ) {\n\t\treturn $is_external;\n\t}\n\tif ( get_network()->domain === $host ) {\n\t\treturn true;\n\t}\n\tif ( isset( $queried[ $host ] ) ) {\n\t\treturn $queried[ $host ];\n\t}\n\t$queried[ $host ] = (bool) $wpdb->get_var( $wpdb->prepare( \"SELECT domain FROM $wpdb->blogs WHERE domain = %s LIMIT 1\", $host ) );\n\treturn $queried[ $host ];\n}\n\n/**\n * A wrapper for PHP's parse_url() function that handles consistency in the return\n * values across PHP versions.\n *\n * PHP 5.4.7 expanded parse_url()'s ability to handle non-absolute url's, including\n * schemeless and relative url's with :// in the path. This function works around\n * those limitations providing a standard output on PHP 5.2~5.4+.\n *\n * Secondly, across various PHP versions, schemeless URLs starting containing a \":\"\n * in the query are being handled inconsistently. This function works around those\n * differences as well.\n *\n * @since 4.4.0\n * @since 4.7.0 The `$component` parameter was added for parity with PHP's `parse_url()`.\n *\n * @link https://www.php.net/manual/en/function.parse-url.php\n *\n * @param string $url       The URL to parse.\n * @param int    $component The specific component to retrieve. Use one of the PHP\n *                          predefined constants to specify which one.\n *                          Defaults to -1 (= return all parts as an array).\n * @return mixed False on parse failure; Array of URL components on success;\n *               When a specific component has been requested: null if the component\n *               doesn't exist in the given URL; a string or - in the case of\n *               PHP_URL_PORT - integer when it does. See parse_url()'s return values.\n */\nfunction wp_parse_url( $url, $component = -1 ) {\n\t$to_unset = array();\n\t$url      = strval( $url );\n\n\tif ( '//' === substr( $url, 0, 2 ) ) {\n\t\t$to_unset[] = 'scheme';\n\t\t$url        = 'placeholder:' . $url;\n\t} elseif ( '/' === substr( $url, 0, 1 ) ) {\n\t\t$to_unset[] = 'scheme';\n\t\t$to_unset[] = 'host';\n\t\t$url        = 'placeholder://placeholder' . $url;\n\t}\n\n\t$parts = parse_url( $url );\n\n\tif ( false === $parts ) {\n\t\t// Parsing failure.\n\t\treturn $parts;\n\t}\n\n\t// Remove the placeholder values.\n\tforeach ( $to_unset as $key ) {\n\t\tunset( $parts[ $key ] );\n\t}\n\n\treturn _get_component_from_parsed_url_array( $parts, $component );\n}\n\n/**\n * Retrieve a specific component from a parsed URL array.\n *\n * @internal\n *\n * @since 4.7.0\n * @access private\n *\n * @link https://www.php.net/manual/en/function.parse-url.php\n *\n * @param array|false $url_parts The parsed URL. Can be false if the URL failed to parse.\n * @param int         $component The specific component to retrieve. Use one of the PHP\n *                               predefined constants to specify which one.\n *                               Defaults to -1 (= return all parts as an array).\n * @return mixed False on parse failure; Array of URL components on success;\n *               When a specific component has been requested: null if the component\n *               doesn't exist in the given URL; a string or - in the case of\n *               PHP_URL_PORT - integer when it does. See parse_url()'s return values.\n */\nfunction _get_component_from_parsed_url_array( $url_parts, $component = -1 ) {\n\tif ( -1 === $component ) {\n\t\treturn $url_parts;\n\t}\n\n\t$key = _wp_translate_php_url_constant_to_key( $component );\n\tif ( false !== $key && is_array( $url_parts ) && isset( $url_parts[ $key ] ) ) {\n\t\treturn $url_parts[ $key ];\n\t} else {\n\t\treturn null;\n\t}\n}\n\n/**\n * Translate a PHP_URL_* constant to the named array keys PHP uses.\n *\n * @internal\n *\n * @since 4.7.0\n * @access private\n *\n * @link https://www.php.net/manual/en/url.constants.php\n *\n * @param int $constant PHP_URL_* constant.\n * @return string|false The named key or false.\n */\nfunction _wp_translate_php_url_constant_to_key( $constant ) {\n\t$translation = array(\n\t\tPHP_URL_SCHEME   => 'scheme',\n\t\tPHP_URL_HOST     => 'host',\n\t\tPHP_URL_PORT     => 'port',\n\t\tPHP_URL_USER     => 'user',\n\t\tPHP_URL_PASS     => 'pass',\n\t\tPHP_URL_PATH     => 'path',\n\t\tPHP_URL_QUERY    => 'query',\n\t\tPHP_URL_FRAGMENT => 'fragment',\n\t);\n\n\tif ( isset( $translation[ $constant ] ) ) {\n\t\treturn $translation[ $constant ];\n\t} else {\n\t\treturn false;\n\t}\n}\n", "num_lines": 760}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * kses 0.2.2 - HTML/XHTML filter that only allows some elements and attributes\n * Copyright (C) 2002, 2003, 2005  Ulf Harnhammar\n *\n * This program is free software and open source software; you can redistribute\n * it and/or modify it under the terms of the GNU General Public License as\n * published by the Free Software Foundation; either version 2 of the License,\n * or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License along\n * with this program; if not, write to the Free Software Foundation, Inc.,\n * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA\n * http://www.gnu.org/licenses/gpl.html\n *\n * [kses strips evil scripts!]\n *\n * Added wp_ prefix to avoid conflicts with existing kses users\n *\n * @version 0.2.2\n * @copyright (C) 2002, 2003, 2005\n * @author Ulf Harnhammar <http://advogato.org/person/metaur/>\n *\n * @package External\n * @subpackage KSES\n */\n\n/**\n * Specifies the default allowable HTML tags.\n *\n * Using `CUSTOM_TAGS` is not recommended and should be considered deprecated. The\n * {@see 'wp_kses_allowed_html'} filter is more powerful and supplies context.\n *\n * @see wp_kses_allowed_html()\n * @since 1.2.0\n *\n * @var array[]|bool Array of default allowable HTML tags, or false to use the defaults.\n */\nif ( ! defined( 'CUSTOM_TAGS' ) ) {\n\tdefine( 'CUSTOM_TAGS', false );\n}\n\n// Ensure that these variables are added to the global namespace\n// (e.g. if using namespaces / autoload in the current PHP environment).\nglobal $allowedposttags, $allowedtags, $allowedentitynames, $allowedxmlentitynames;\n\nif ( ! CUSTOM_TAGS ) {\n\t/**\n\t * KSES global for default allowable HTML tags.\n\t *\n\t * Can be overridden with the `CUSTOM_TAGS` constant.\n\t *\n\t * @var array[] $allowedposttags Array of default allowable HTML tags.\n\t * @since 2.0.0\n\t */\n\t$allowedposttags = array(\n\t\t'address'    => array(),\n\t\t'a'          => array(\n\t\t\t'href'     => true,\n\t\t\t'rel'      => true,\n\t\t\t'rev'      => true,\n\t\t\t'name'     => true,\n\t\t\t'target'   => true,\n\t\t\t'download' => array(\n\t\t\t\t'valueless' => 'y',\n\t\t\t),\n\t\t),\n\t\t'abbr'       => array(),\n\t\t'acronym'    => array(),\n\t\t'area'       => array(\n\t\t\t'alt'    => true,\n\t\t\t'coords' => true,\n\t\t\t'href'   => true,\n\t\t\t'nohref' => true,\n\t\t\t'shape'  => true,\n\t\t\t'target' => true,\n\t\t),\n\t\t'article'    => array(\n\t\t\t'align'    => true,\n\t\t\t'dir'      => true,\n\t\t\t'lang'     => true,\n\t\t\t'xml:lang' => true,\n\t\t),\n\t\t'aside'      => array(\n\t\t\t'align'    => true,\n\t\t\t'dir'      => true,\n\t\t\t'lang'     => true,\n\t\t\t'xml:lang' => true,\n\t\t),\n\t\t'audio'      => array(\n\t\t\t'autoplay' => true,\n\t\t\t'controls' => true,\n\t\t\t'loop'     => true,\n\t\t\t'muted'    => true,\n\t\t\t'preload'  => true,\n\t\t\t'src'      => true,\n\t\t),\n\t\t'b'          => array(),\n\t\t'bdo'        => array(\n\t\t\t'dir' => true,\n\t\t),\n\t\t'big'        => array(),\n\t\t'blockquote' => array(\n\t\t\t'cite'     => true,\n\t\t\t'lang'     => true,\n\t\t\t'xml:lang' => true,\n\t\t),\n\t\t'br'         => array(),\n\t\t'button'     => array(\n\t\t\t'disabled' => true,\n\t\t\t'name'     => true,\n\t\t\t'type'     => true,\n\t\t\t'value'    => true,\n\t\t),\n\t\t'caption'    => array(\n\t\t\t'align' => true,\n\t\t),\n\t\t'cite'       => array(\n\t\t\t'dir'  => true,\n\t\t\t'lang' => true,\n\t\t),\n\t\t'code'       => array(),\n\t\t'col'        => array(\n\t\t\t'align'   => true,\n\t\t\t'char'    => true,\n\t\t\t'charoff' => true,\n\t\t\t'span'    => true,\n\t\t\t'dir'     => true,\n\t\t\t'valign'  => true,\n\t\t\t'width'   => true,\n\t\t),\n\t\t'colgroup'   => array(\n\t\t\t'align'   => true,\n\t\t\t'char'    => true,\n\t\t\t'charoff' => true,\n\t\t\t'span'    => true,\n\t\t\t'valign'  => true,\n\t\t\t'width'   => true,\n\t\t),\n\t\t'del'        => array(\n\t\t\t'datetime' => true,\n\t\t),\n\t\t'dd'         => array(),\n\t\t'dfn'        => array(),\n\t\t'details'    => array(\n\t\t\t'align'    => true,\n\t\t\t'dir'      => true,\n\t\t\t'lang'     => true,\n\t\t\t'open'     => true,\n\t\t\t'xml:lang' => true,\n\t\t),\n\t\t'div'        => array(\n\t\t\t'align'    => true,\n\t\t\t'dir'      => true,\n\t\t\t'lang'     => true,\n\t\t\t'xml:lang' => true,\n\t\t),\n\t\t'dl'         => array(),\n\t\t'dt'         => array(),\n\t\t'em'         => array(),\n\t\t'fieldset'   => array(),\n\t\t'figure'     => array(\n\t\t\t'align'    => true,\n\t\t\t'dir'      => true,\n\t\t\t'lang'     => true,\n\t\t\t'xml:lang' => true,\n\t\t),\n\t\t'figcaption' => array(\n\t\t\t'align'    => true,\n\t\t\t'dir'      => true,\n\t\t\t'lang'     => true,\n\t\t\t'xml:lang' => true,\n\t\t),\n\t\t'font'       => array(\n\t\t\t'color' => true,\n\t\t\t'face'  => true,\n\t\t\t'size'  => true,\n\t\t),\n\t\t'footer'     => array(\n\t\t\t'align'    => true,\n\t\t\t'dir'      => true,\n\t\t\t'lang'     => true,\n\t\t\t'xml:lang' => true,\n\t\t),\n\t\t'h1'         => array(\n\t\t\t'align' => true,\n\t\t),\n\t\t'h2'         => array(\n\t\t\t'align' => true,\n\t\t),\n\t\t'h3'         => array(\n\t\t\t'align' => true,\n\t\t),\n\t\t'h4'         => array(\n\t\t\t'align' => true,\n\t\t),\n\t\t'h5'         => array(\n\t\t\t'align' => true,\n\t\t),\n\t\t'h6'         => array(\n\t\t\t'align' => true,\n\t\t),\n\t\t'header'     => array(\n\t\t\t'align'    => true,\n\t\t\t'dir'      => true,\n\t\t\t'lang'     => true,\n\t\t\t'xml:lang' => true,\n\t\t),\n\t\t'hgroup'     => array(\n\t\t\t'align'    => true,\n\t\t\t'dir'      => true,\n\t\t\t'lang'     => true,\n\t\t\t'xml:lang' => true,\n\t\t),\n\t\t'hr'         => array(\n\t\t\t'align'   => true,\n\t\t\t'noshade' => true,\n\t\t\t'size'    => true,\n\t\t\t'width'   => true,\n\t\t),\n\t\t'i'          => array(),\n\t\t'img'        => array(\n\t\t\t'alt'      => true,\n\t\t\t'align'    => true,\n\t\t\t'border'   => true,\n\t\t\t'height'   => true,\n\t\t\t'hspace'   => true,\n\t\t\t'loading'  => true,\n\t\t\t'longdesc' => true,\n\t\t\t'vspace'   => true,\n\t\t\t'src'      => true,\n\t\t\t'usemap'   => true,\n\t\t\t'width'    => true,\n\t\t),\n\t\t'ins'        => array(\n\t\t\t'datetime' => true,\n\t\t\t'cite'     => true,\n\t\t),\n\t\t'kbd'        => array(),\n\t\t'label'      => array(\n\t\t\t'for' => true,\n\t\t),\n\t\t'legend'     => array(\n\t\t\t'align' => true,\n\t\t),\n\t\t'li'         => array(\n\t\t\t'align' => true,\n\t\t\t'value' => true,\n\t\t),\n\t\t'map'        => array(\n\t\t\t'name' => true,\n\t\t),\n\t\t'mark'       => array(),\n\t\t'menu'       => array(\n\t\t\t'type' => true,\n\t\t),\n\t\t'nav'        => array(\n\t\t\t'align'    => true,\n\t\t\t'dir'      => true,\n\t\t\t'lang'     => true,\n\t\t\t'xml:lang' => true,\n\t\t),\n\t\t'p'          => array(\n\t\t\t'align'    => true,\n\t\t\t'dir'      => true,\n\t\t\t'lang'     => true,\n\t\t\t'xml:lang' => true,\n\t\t),\n\t\t'pre'        => array(\n\t\t\t'width' => true,\n\t\t),\n\t\t'q'          => array(\n\t\t\t'cite' => true,\n\t\t),\n\t\t's'          => array(),\n\t\t'samp'       => array(),\n\t\t'span'       => array(\n\t\t\t'dir'      => true,\n\t\t\t'align'    => true,\n\t\t\t'lang'     => true,\n\t\t\t'xml:lang' => true,\n\t\t),\n\t\t'section'    => array(\n\t\t\t'align'    => true,\n\t\t\t'dir'      => true,\n\t\t\t'lang'     => true,\n\t\t\t'xml:lang' => true,\n\t\t),\n\t\t'small'      => array(),\n\t\t'strike'     => array(),\n\t\t'strong'     => array(),\n\t\t'sub'        => array(),\n\t\t'summary'    => array(\n\t\t\t'align'    => true,\n\t\t\t'dir'      => true,\n\t\t\t'lang'     => true,\n\t\t\t'xml:lang' => true,\n\t\t),\n\t\t'sup'        => array(),\n\t\t'table'      => array(\n\t\t\t'align'       => true,\n\t\t\t'bgcolor'     => true,\n\t\t\t'border'      => true,\n\t\t\t'cellpadding' => true,\n\t\t\t'cellspacing' => true,\n\t\t\t'dir'         => true,\n\t\t\t'rules'       => true,\n\t\t\t'summary'     => true,\n\t\t\t'width'       => true,\n\t\t),\n\t\t'tbody'      => array(\n\t\t\t'align'   => true,\n\t\t\t'char'    => true,\n\t\t\t'charoff' => true,\n\t\t\t'valign'  => true,\n\t\t),\n\t\t'td'         => array(\n\t\t\t'abbr'    => true,\n\t\t\t'align'   => true,\n\t\t\t'axis'    => true,\n\t\t\t'bgcolor' => true,\n\t\t\t'char'    => true,\n\t\t\t'charoff' => true,\n\t\t\t'colspan' => true,\n\t\t\t'dir'     => true,\n\t\t\t'headers' => true,\n\t\t\t'height'  => true,\n\t\t\t'nowrap'  => true,\n\t\t\t'rowspan' => true,\n\t\t\t'scope'   => true,\n\t\t\t'valign'  => true,\n\t\t\t'width'   => true,\n\t\t),\n\t\t'textarea'   => array(\n\t\t\t'cols'     => true,\n\t\t\t'rows'     => true,\n\t\t\t'disabled' => true,\n\t\t\t'name'     => true,\n\t\t\t'readonly' => true,\n\t\t),\n\t\t'tfoot'      => array(\n\t\t\t'align'   => true,\n\t\t\t'char'    => true,\n\t\t\t'charoff' => true,\n\t\t\t'valign'  => true,\n\t\t),\n\t\t'th'         => array(\n\t\t\t'abbr'    => true,\n\t\t\t'align'   => true,\n\t\t\t'axis'    => true,\n\t\t\t'bgcolor' => true,\n\t\t\t'char'    => true,\n\t\t\t'charoff' => true,\n\t\t\t'colspan' => true,\n\t\t\t'headers' => true,\n\t\t\t'height'  => true,\n\t\t\t'nowrap'  => true,\n\t\t\t'rowspan' => true,\n\t\t\t'scope'   => true,\n\t\t\t'valign'  => true,\n\t\t\t'width'   => true,\n\t\t),\n\t\t'thead'      => array(\n\t\t\t'align'   => true,\n\t\t\t'char'    => true,\n\t\t\t'charoff' => true,\n\t\t\t'valign'  => true,\n\t\t),\n\t\t'title'      => array(),\n\t\t'tr'         => array(\n\t\t\t'align'   => true,\n\t\t\t'bgcolor' => true,\n\t\t\t'char'    => true,\n\t\t\t'charoff' => true,\n\t\t\t'valign'  => true,\n\t\t),\n\t\t'track'      => array(\n\t\t\t'default' => true,\n\t\t\t'kind'    => true,\n\t\t\t'label'   => true,\n\t\t\t'src'     => true,\n\t\t\t'srclang' => true,\n\t\t),\n\t\t'tt'         => array(),\n\t\t'u'          => array(),\n\t\t'ul'         => array(\n\t\t\t'type' => true,\n\t\t),\n\t\t'ol'         => array(\n\t\t\t'start'    => true,\n\t\t\t'type'     => true,\n\t\t\t'reversed' => true,\n\t\t),\n\t\t'var'        => array(),\n\t\t'video'      => array(\n\t\t\t'autoplay'    => true,\n\t\t\t'controls'    => true,\n\t\t\t'height'      => true,\n\t\t\t'loop'        => true,\n\t\t\t'muted'       => true,\n\t\t\t'playsinline' => true,\n\t\t\t'poster'      => true,\n\t\t\t'preload'     => true,\n\t\t\t'src'         => true,\n\t\t\t'width'       => true,\n\t\t),\n\t);\n\n\t/**\n\t * @var array[] $allowedtags Array of KSES allowed HTML elements.\n\t * @since 1.0.0\n\t */\n\t$allowedtags = array(\n\t\t'a'          => array(\n\t\t\t'href'  => true,\n\t\t\t'title' => true,\n\t\t),\n\t\t'abbr'       => array(\n\t\t\t'title' => true,\n\t\t),\n\t\t'acronym'    => array(\n\t\t\t'title' => true,\n\t\t),\n\t\t'b'          => array(),\n\t\t'blockquote' => array(\n\t\t\t'cite' => true,\n\t\t),\n\t\t'cite'       => array(),\n\t\t'code'       => array(),\n\t\t'del'        => array(\n\t\t\t'datetime' => true,\n\t\t),\n\t\t'em'         => array(),\n\t\t'i'          => array(),\n\t\t'q'          => array(\n\t\t\t'cite' => true,\n\t\t),\n\t\t's'          => array(),\n\t\t'strike'     => array(),\n\t\t'strong'     => array(),\n\t);\n\n\t/**\n\t * @var string[] $allowedentitynames Array of KSES allowed HTML entitity names.\n\t * @since 1.0.0\n\t */\n\t$allowedentitynames = array(\n\t\t'nbsp',\n\t\t'iexcl',\n\t\t'cent',\n\t\t'pound',\n\t\t'curren',\n\t\t'yen',\n\t\t'brvbar',\n\t\t'sect',\n\t\t'uml',\n\t\t'copy',\n\t\t'ordf',\n\t\t'laquo',\n\t\t'not',\n\t\t'shy',\n\t\t'reg',\n\t\t'macr',\n\t\t'deg',\n\t\t'plusmn',\n\t\t'acute',\n\t\t'micro',\n\t\t'para',\n\t\t'middot',\n\t\t'cedil',\n\t\t'ordm',\n\t\t'raquo',\n\t\t'iquest',\n\t\t'Agrave',\n\t\t'Aacute',\n\t\t'Acirc',\n\t\t'Atilde',\n\t\t'Auml',\n\t\t'Aring',\n\t\t'AElig',\n\t\t'Ccedil',\n\t\t'Egrave',\n\t\t'Eacute',\n\t\t'Ecirc',\n\t\t'Euml',\n\t\t'Igrave',\n\t\t'Iacute',\n\t\t'Icirc',\n\t\t'Iuml',\n\t\t'ETH',\n\t\t'Ntilde',\n\t\t'Ograve',\n\t\t'Oacute',\n\t\t'Ocirc',\n\t\t'Otilde',\n\t\t'Ouml',\n\t\t'times',\n\t\t'Oslash',\n\t\t'Ugrave',\n\t\t'Uacute',\n\t\t'Ucirc',\n\t\t'Uuml',\n\t\t'Yacute',\n\t\t'THORN',\n\t\t'szlig',\n\t\t'agrave',\n\t\t'aacute',\n\t\t'acirc',\n\t\t'atilde',\n\t\t'auml',\n\t\t'aring',\n\t\t'aelig',\n\t\t'ccedil',\n\t\t'egrave',\n\t\t'eacute',\n\t\t'ecirc',\n\t\t'euml',\n\t\t'igrave',\n\t\t'iacute',\n\t\t'icirc',\n\t\t'iuml',\n\t\t'eth',\n\t\t'ntilde',\n\t\t'ograve',\n\t\t'oacute',\n\t\t'ocirc',\n\t\t'otilde',\n\t\t'ouml',\n\t\t'divide',\n\t\t'oslash',\n\t\t'ugrave',\n\t\t'uacute',\n\t\t'ucirc',\n\t\t'uuml',\n\t\t'yacute',\n\t\t'thorn',\n\t\t'yuml',\n\t\t'quot',\n\t\t'amp',\n\t\t'lt',\n\t\t'gt',\n\t\t'apos',\n\t\t'OElig',\n\t\t'oelig',\n\t\t'Scaron',\n\t\t'scaron',\n\t\t'Yuml',\n\t\t'circ',\n\t\t'tilde',\n\t\t'ensp',\n\t\t'emsp',\n\t\t'thinsp',\n\t\t'zwnj',\n\t\t'zwj',\n\t\t'lrm',\n\t\t'rlm',\n\t\t'ndash',\n\t\t'mdash',\n\t\t'lsquo',\n\t\t'rsquo',\n\t\t'sbquo',\n\t\t'ldquo',\n\t\t'rdquo',\n\t\t'bdquo',\n\t\t'dagger',\n\t\t'Dagger',\n\t\t'permil',\n\t\t'lsaquo',\n\t\t'rsaquo',\n\t\t'euro',\n\t\t'fnof',\n\t\t'Alpha',\n\t\t'Beta',\n\t\t'Gamma',\n\t\t'Delta',\n\t\t'Epsilon',\n\t\t'Zeta',\n\t\t'Eta',\n\t\t'Theta',\n\t\t'Iota',\n\t\t'Kappa',\n\t\t'Lambda',\n\t\t'Mu',\n\t\t'Nu',\n\t\t'Xi',\n\t\t'Omicron',\n\t\t'Pi',\n\t\t'Rho',\n\t\t'Sigma',\n\t\t'Tau',\n\t\t'Upsilon',\n\t\t'Phi',\n\t\t'Chi',\n\t\t'Psi',\n\t\t'Omega',\n\t\t'alpha',\n\t\t'beta',\n\t\t'gamma',\n\t\t'delta',\n\t\t'epsilon',\n\t\t'zeta',\n\t\t'eta',\n\t\t'theta',\n\t\t'iota',\n\t\t'kappa',\n\t\t'lambda',\n\t\t'mu',\n\t\t'nu',\n\t\t'xi',\n\t\t'omicron',\n\t\t'pi',\n\t\t'rho',\n\t\t'sigmaf',\n\t\t'sigma',\n\t\t'tau',\n\t\t'upsilon',\n\t\t'phi',\n\t\t'chi',\n\t\t'psi',\n\t\t'omega',\n\t\t'thetasym',\n\t\t'upsih',\n\t\t'piv',\n\t\t'bull',\n\t\t'hellip',\n\t\t'prime',\n\t\t'Prime',\n\t\t'oline',\n\t\t'frasl',\n\t\t'weierp',\n\t\t'image',\n\t\t'real',\n\t\t'trade',\n\t\t'alefsym',\n\t\t'larr',\n\t\t'uarr',\n\t\t'rarr',\n\t\t'darr',\n\t\t'harr',\n\t\t'crarr',\n\t\t'lArr',\n\t\t'uArr',\n\t\t'rArr',\n\t\t'dArr',\n\t\t'hArr',\n\t\t'forall',\n\t\t'part',\n\t\t'exist',\n\t\t'empty',\n\t\t'nabla',\n\t\t'isin',\n\t\t'notin',\n\t\t'ni',\n\t\t'prod',\n\t\t'sum',\n\t\t'minus',\n\t\t'lowast',\n\t\t'radic',\n\t\t'prop',\n\t\t'infin',\n\t\t'ang',\n\t\t'and',\n\t\t'or',\n\t\t'cap',\n\t\t'cup',\n\t\t'int',\n\t\t'sim',\n\t\t'cong',\n\t\t'asymp',\n\t\t'ne',\n\t\t'equiv',\n\t\t'le',\n\t\t'ge',\n\t\t'sub',\n\t\t'sup',\n\t\t'nsub',\n\t\t'sube',\n\t\t'supe',\n\t\t'oplus',\n\t\t'otimes',\n\t\t'perp',\n\t\t'sdot',\n\t\t'lceil',\n\t\t'rceil',\n\t\t'lfloor',\n\t\t'rfloor',\n\t\t'lang',\n\t\t'rang',\n\t\t'loz',\n\t\t'spades',\n\t\t'clubs',\n\t\t'hearts',\n\t\t'diams',\n\t\t'sup1',\n\t\t'sup2',\n\t\t'sup3',\n\t\t'frac14',\n\t\t'frac12',\n\t\t'frac34',\n\t\t'there4',\n\t);\n\n\t/**\n\t * @var string[] $allowedxmlentitynames Array of KSES allowed XML entitity names.\n\t * @since 5.5.0\n\t */\n\t$allowedxmlnamedentities = array(\n\t\t'amp',\n\t\t'lt',\n\t\t'gt',\n\t\t'apos',\n\t\t'quot',\n\t);\n\n\t$allowedposttags = array_map( '_wp_add_global_attributes', $allowedposttags );\n} else {\n\t$allowedtags     = wp_kses_array_lc( $allowedtags );\n\t$allowedposttags = wp_kses_array_lc( $allowedposttags );\n}\n\n/**\n * Filters text content and strips out disallowed HTML.\n *\n * This function makes sure that only the allowed HTML element names, attribute\n * names, attribute values, and HTML entities will occur in the given text string.\n *\n * This function expects unslashed data.\n *\n * @see wp_kses_post() for specifically filtering post content and fields.\n * @see wp_allowed_protocols() for the default allowed protocols in link URLs.\n *\n * @since 1.0.0\n *\n * @param string         $string            Text content to filter.\n * @param array[]|string $allowed_html      An array of allowed HTML elements and attributes,\n *                                          or a context name such as 'post'. See wp_kses_allowed_html()\n *                                          for the list of accepted context names.\n * @param string[]       $allowed_protocols Array of allowed URL protocols.\n * @return string Filtered content containing only the allowed HTML.\n */\nfunction wp_kses( $string, $allowed_html, $allowed_protocols = array() ) {\n\tif ( empty( $allowed_protocols ) ) {\n\t\t$allowed_protocols = wp_allowed_protocols();\n\t}\n\n\t$string = wp_kses_no_null( $string, array( 'slash_zero' => 'keep' ) );\n\t$string = wp_kses_normalize_entities( $string );\n\t$string = wp_kses_hook( $string, $allowed_html, $allowed_protocols );\n\n\treturn wp_kses_split( $string, $allowed_html, $allowed_protocols );\n}\n\n/**\n * Filters one HTML attribute and ensures its value is allowed.\n *\n * This function can escape data in some situations where `wp_kses()` must strip the whole attribute.\n *\n * @since 4.2.3\n *\n * @param string $string  The 'whole' attribute, including name and value.\n * @param string $element The HTML element name to which the attribute belongs.\n * @return string Filtered attribute.\n */\nfunction wp_kses_one_attr( $string, $element ) {\n\t$uris              = wp_kses_uri_attributes();\n\t$allowed_html      = wp_kses_allowed_html( 'post' );\n\t$allowed_protocols = wp_allowed_protocols();\n\t$string            = wp_kses_no_null( $string, array( 'slash_zero' => 'keep' ) );\n\n\t// Preserve leading and trailing whitespace.\n\t$matches = array();\n\tpreg_match( '/^\\s*/', $string, $matches );\n\t$lead = $matches[0];\n\tpreg_match( '/\\s*$/', $string, $matches );\n\t$trail = $matches[0];\n\tif ( empty( $trail ) ) {\n\t\t$string = substr( $string, strlen( $lead ) );\n\t} else {\n\t\t$string = substr( $string, strlen( $lead ), -strlen( $trail ) );\n\t}\n\n\t// Parse attribute name and value from input.\n\t$split = preg_split( '/\\s*=\\s*/', $string, 2 );\n\t$name  = $split[0];\n\tif ( count( $split ) == 2 ) {\n\t\t$value = $split[1];\n\n\t\t// Remove quotes surrounding $value.\n\t\t// Also guarantee correct quoting in $string for this one attribute.\n\t\tif ( '' === $value ) {\n\t\t\t$quote = '';\n\t\t} else {\n\t\t\t$quote = $value[0];\n\t\t}\n\t\tif ( '\"' === $quote || \"'\" === $quote ) {\n\t\t\tif ( substr( $value, -1 ) != $quote ) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\t$value = substr( $value, 1, -1 );\n\t\t} else {\n\t\t\t$quote = '\"';\n\t\t}\n\n\t\t// Sanitize quotes, angle braces, and entities.\n\t\t$value = esc_attr( $value );\n\n\t\t// Sanitize URI values.\n\t\tif ( in_array( strtolower( $name ), $uris, true ) ) {\n\t\t\t$value = wp_kses_bad_protocol( $value, $allowed_protocols );\n\t\t}\n\n\t\t$string = \"$name=$quote$value$quote\";\n\t\t$vless  = 'n';\n\t} else {\n\t\t$value = '';\n\t\t$vless = 'y';\n\t}\n\n\t// Sanitize attribute by name.\n\twp_kses_attr_check( $name, $value, $string, $vless, $element, $allowed_html );\n\n\t// Restore whitespace.\n\treturn $lead . $string . $trail;\n}\n\n/**\n * Returns an array of allowed HTML tags and attributes for a given context.\n *\n * @since 3.5.0\n * @since 5.0.1 `form` removed as allowable HTML tag.\n *\n * @global array $allowedposttags\n * @global array $allowedtags\n * @global array $allowedentitynames\n *\n * @param string|array $context The context for which to retrieve tags. Allowed values are 'post',\n *                              'strip', 'data', 'entities', or the name of a field filter such as\n *                              'pre_user_description'.\n * @return array Array of allowed HTML tags and their allowed attributes.\n */\nfunction wp_kses_allowed_html( $context = '' ) {\n\tglobal $allowedposttags, $allowedtags, $allowedentitynames;\n\n\tif ( is_array( $context ) ) {\n\t\t/**\n\t\t * Filters the HTML that is allowed for a given context.\n\t\t *\n\t\t * @since 3.5.0\n\t\t *\n\t\t * @param array[]|string $context      Context to judge allowed tags by.\n\t\t * @param string         $context_type Context name.\n\t\t */\n\t\treturn apply_filters( 'wp_kses_allowed_html', $context, 'explicit' );\n\t}\n\n\tswitch ( $context ) {\n\t\tcase 'post':\n\t\t\t/** This filter is documented in wp-includes/kses.php */\n\t\t\t$tags = apply_filters( 'wp_kses_allowed_html', $allowedposttags, $context );\n\n\t\t\t// 5.0.1 removed the `<form>` tag, allow it if a filter is allowing it's sub-elements `<input>` or `<select>`.\n\t\t\tif ( ! CUSTOM_TAGS && ! isset( $tags['form'] ) && ( isset( $tags['input'] ) || isset( $tags['select'] ) ) ) {\n\t\t\t\t$tags = $allowedposttags;\n\n\t\t\t\t$tags['form'] = array(\n\t\t\t\t\t'action'         => true,\n\t\t\t\t\t'accept'         => true,\n\t\t\t\t\t'accept-charset' => true,\n\t\t\t\t\t'enctype'        => true,\n\t\t\t\t\t'method'         => true,\n\t\t\t\t\t'name'           => true,\n\t\t\t\t\t'target'         => true,\n\t\t\t\t);\n\n\t\t\t\t/** This filter is documented in wp-includes/kses.php */\n\t\t\t\t$tags = apply_filters( 'wp_kses_allowed_html', $tags, $context );\n\t\t\t}\n\n\t\t\treturn $tags;\n\n\t\tcase 'user_description':\n\t\tcase 'pre_user_description':\n\t\t\t$tags             = $allowedtags;\n\t\t\t$tags['a']['rel'] = true;\n\t\t\t/** This filter is documented in wp-includes/kses.php */\n\t\t\treturn apply_filters( 'wp_kses_allowed_html', $tags, $context );\n\n\t\tcase 'strip':\n\t\t\t/** This filter is documented in wp-includes/kses.php */\n\t\t\treturn apply_filters( 'wp_kses_allowed_html', array(), $context );\n\n\t\tcase 'entities':\n\t\t\t/** This filter is documented in wp-includes/kses.php */\n\t\t\treturn apply_filters( 'wp_kses_allowed_html', $allowedentitynames, $context );\n\n\t\tcase 'data':\n\t\tdefault:\n\t\t\t/** This filter is documented in wp-includes/kses.php */\n\t\t\treturn apply_filters( 'wp_kses_allowed_html', $allowedtags, $context );\n\t}\n}\n\n/**\n * You add any KSES hooks here.\n *\n * There is currently only one KSES WordPress hook, {@see 'pre_kses'}, and it is called here.\n * All parameters are passed to the hooks and expected to receive a string.\n *\n * @since 1.0.0\n *\n * @param string         $string            Content to filter through KSES.\n * @param array[]|string $allowed_html      An array of allowed HTML elements and attributes,\n *                                          or a context name such as 'post'. See wp_kses_allowed_html()\n *                                          for the list of accepted context names.\n * @param string[]       $allowed_protocols Array of allowed URL protocols.\n * @return string Filtered content through {@see 'pre_kses'} hook.\n */\nfunction wp_kses_hook( $string, $allowed_html, $allowed_protocols ) {\n\t/**\n\t * Filters content to be run through KSES.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string         $string            Content to filter through KSES.\n\t * @param array[]|string $allowed_html      An array of allowed HTML elements and attributes,\n\t *                                          or a context name such as 'post'. See wp_kses_allowed_html()\n\t *                                          for the list of accepted context names.\n\t * @param string[]       $allowed_protocols Array of allowed URL protocols.\n\t */\n\treturn apply_filters( 'pre_kses', $string, $allowed_html, $allowed_protocols );\n}\n\n/**\n * Returns the version number of KSES.\n *\n * @since 1.0.0\n *\n * @return string KSES version number.\n */\nfunction wp_kses_version() {\n\treturn '0.2.2';\n}\n\n/**\n * Searches for HTML tags, no matter how malformed.\n *\n * It also matches stray `>` characters.\n *\n * @since 1.0.0\n *\n * @global array[]|string $pass_allowed_html      An array of allowed HTML elements and attributes,\n *                                                or a context name such as 'post'.\n * @global string[]       $pass_allowed_protocols Array of allowed URL protocols.\n *\n * @param string         $string            Content to filter.\n * @param array[]|string $allowed_html      An array of allowed HTML elements and attributes,\n *                                          or a context name such as 'post'. See wp_kses_allowed_html()\n *                                          for the list of accepted context names.\n * @param string[]       $allowed_protocols Array of allowed URL protocols.\n * @return string Content with fixed HTML tags\n */\nfunction wp_kses_split( $string, $allowed_html, $allowed_protocols ) {\n\tglobal $pass_allowed_html, $pass_allowed_protocols;\n\n\t$pass_allowed_html      = $allowed_html;\n\t$pass_allowed_protocols = $allowed_protocols;\n\n\treturn preg_replace_callback( '%(<!--.*?(-->|$))|(<[^>]*(>|$)|>)%', '_wp_kses_split_callback', $string );\n}\n\n/**\n * Returns an array of HTML attribute names whose value contains a URL.\n *\n * This function returns a list of all HTML attributes that must contain\n * a URL according to the HTML specification.\n *\n * This list includes URI attributes both allowed and disallowed by KSES.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes\n *\n * @since 5.0.1\n *\n * @return string[] HTML attribute names whose value contains a URL.\n */\nfunction wp_kses_uri_attributes() {\n\t$uri_attributes = array(\n\t\t'action',\n\t\t'archive',\n\t\t'background',\n\t\t'cite',\n\t\t'classid',\n\t\t'codebase',\n\t\t'data',\n\t\t'formaction',\n\t\t'href',\n\t\t'icon',\n\t\t'longdesc',\n\t\t'manifest',\n\t\t'poster',\n\t\t'profile',\n\t\t'src',\n\t\t'usemap',\n\t\t'xmlns',\n\t);\n\n\t/**\n\t * Filters the list of attributes that are required to contain a URL.\n\t *\n\t * Use this filter to add any `data-` attributes that are required to be\n\t * validated as a URL.\n\t *\n\t * @since 5.0.1\n\t *\n\t * @param string[] $uri_attributes HTML attribute names whose value contains a URL.\n\t */\n\t$uri_attributes = apply_filters( 'wp_kses_uri_attributes', $uri_attributes );\n\n\treturn $uri_attributes;\n}\n\n/**\n * Callback for `wp_kses_split()`.\n *\n * @since 3.1.0\n * @access private\n * @ignore\n *\n * @global array[]|string $pass_allowed_html      An array of allowed HTML elements and attributes,\n *                                                or a context name such as 'post'.\n * @global string[]       $pass_allowed_protocols Array of allowed URL protocols.\n *\n * @param array $matches preg_replace regexp matches\n * @return string\n */\nfunction _wp_kses_split_callback( $match ) {\n\tglobal $pass_allowed_html, $pass_allowed_protocols;\n\n\treturn wp_kses_split2( $match[0], $pass_allowed_html, $pass_allowed_protocols );\n}\n\n/**\n * Callback for `wp_kses_split()` for fixing malformed HTML tags.\n *\n * This function does a lot of work. It rejects some very malformed things like\n * `<:::>`. It returns an empty string, if the element isn't allowed (look ma, no\n * `strip_tags()`!). Otherwise it splits the tag into an element and an attribute\n * list.\n *\n * After the tag is split into an element and an attribute list, it is run\n * through another filter which will remove illegal attributes and once that is\n * completed, will be returned.\n *\n * @access private\n * @ignore\n * @since 1.0.0\n *\n * @param string         $string            Content to filter.\n * @param array[]|string $allowed_html      An array of allowed HTML elements and attributes,\n *                                          or a context name such as 'post'. See wp_kses_allowed_html()\n *                                          for the list of accepted context names.\n * @param string[]       $allowed_protocols Array of allowed URL protocols.\n * @return string Fixed HTML element\n */\nfunction wp_kses_split2( $string, $allowed_html, $allowed_protocols ) {\n\t$string = wp_kses_stripslashes( $string );\n\n\t// It matched a \">\" character.\n\tif ( '<' !== substr( $string, 0, 1 ) ) {\n\t\treturn '&gt;';\n\t}\n\n\t// Allow HTML comments.\n\tif ( '<!--' === substr( $string, 0, 4 ) ) {\n\t\t$string = str_replace( array( '<!--', '-->' ), '', $string );\n\t\twhile ( ( $newstring = wp_kses( $string, $allowed_html, $allowed_protocols ) ) != $string ) {\n\t\t\t$string = $newstring;\n\t\t}\n\t\tif ( '' === $string ) {\n\t\t\treturn '';\n\t\t}\n\t\t// Prevent multiple dashes in comments.\n\t\t$string = preg_replace( '/--+/', '-', $string );\n\t\t// Prevent three dashes closing a comment.\n\t\t$string = preg_replace( '/-$/', '', $string );\n\t\treturn \"<!--{$string}-->\";\n\t}\n\n\t// It's seriously malformed.\n\tif ( ! preg_match( '%^<\\s*(/\\s*)?([a-zA-Z0-9-]+)([^>]*)>?$%', $string, $matches ) ) {\n\t\treturn '';\n\t}\n\n\t$slash    = trim( $matches[1] );\n\t$elem     = $matches[2];\n\t$attrlist = $matches[3];\n\n\tif ( ! is_array( $allowed_html ) ) {\n\t\t$allowed_html = wp_kses_allowed_html( $allowed_html );\n\t}\n\n\t// They are using a not allowed HTML element.\n\tif ( ! isset( $allowed_html[ strtolower( $elem ) ] ) ) {\n\t\treturn '';\n\t}\n\n\t// No attributes are allowed for closing elements.\n\tif ( '' !== $slash ) {\n\t\treturn \"</$elem>\";\n\t}\n\n\treturn wp_kses_attr( $elem, $attrlist, $allowed_html, $allowed_protocols );\n}\n\n/**\n * Removes all attributes, if none are allowed for this element.\n *\n * If some are allowed it calls `wp_kses_hair()` to split them further, and then\n * it builds up new HTML code from the data that `kses_hair()` returns. It also\n * removes `<` and `>` characters, if there are any left. One more thing it does\n * is to check if the tag has a closing XHTML slash, and if it does, it puts one\n * in the returned code as well.\n *\n * @since 1.0.0\n *\n * @param string         $element           HTML element/tag.\n * @param string         $attr              HTML attributes from HTML element to closing HTML element tag.\n * @param array[]|string $allowed_html      An array of allowed HTML elements and attributes,\n *                                          or a context name such as 'post'. See wp_kses_allowed_html()\n *                                          for the list of accepted context names.\n * @param string[]       $allowed_protocols Array of allowed URL protocols.\n * @return string Sanitized HTML element.\n */\nfunction wp_kses_attr( $element, $attr, $allowed_html, $allowed_protocols ) {\n\tif ( ! is_array( $allowed_html ) ) {\n\t\t$allowed_html = wp_kses_allowed_html( $allowed_html );\n\t}\n\n\t// Is there a closing XHTML slash at the end of the attributes?\n\t$xhtml_slash = '';\n\tif ( preg_match( '%\\s*/\\s*$%', $attr ) ) {\n\t\t$xhtml_slash = ' /';\n\t}\n\n\t// Are any attributes allowed at all for this element?\n\t$element_low = strtolower( $element );\n\tif ( empty( $allowed_html[ $element_low ] ) || true === $allowed_html[ $element_low ] ) {\n\t\treturn \"<$element$xhtml_slash>\";\n\t}\n\n\t// Split it.\n\t$attrarr = wp_kses_hair( $attr, $allowed_protocols );\n\n\t// Go through $attrarr, and save the allowed attributes for this element\n\t// in $attr2.\n\t$attr2 = '';\n\tforeach ( $attrarr as $arreach ) {\n\t\tif ( wp_kses_attr_check( $arreach['name'], $arreach['value'], $arreach['whole'], $arreach['vless'], $element, $allowed_html ) ) {\n\t\t\t$attr2 .= ' ' . $arreach['whole'];\n\t\t}\n\t}\n\n\t// Remove any \"<\" or \">\" characters.\n\t$attr2 = preg_replace( '/[<>]/', '', $attr2 );\n\n\treturn \"<$element$attr2$xhtml_slash>\";\n}\n\n/**\n * Determines whether an attribute is allowed.\n *\n * @since 4.2.3\n * @since 5.0.0 Add support for `data-*` wildcard attributes.\n *\n * @param string $name         The attribute name. Passed by reference. Returns empty string when not allowed.\n * @param string $value        The attribute value. Passed by reference. Returns a filtered value.\n * @param string $whole        The `name=value` input. Passed by reference. Returns filtered input.\n * @param string $vless        Whether the attribute is valueless. Use 'y' or 'n'.\n * @param string $element      The name of the element to which this attribute belongs.\n * @param array  $allowed_html The full list of allowed elements and attributes.\n * @return bool Whether or not the attribute is allowed.\n */\nfunction wp_kses_attr_check( &$name, &$value, &$whole, $vless, $element, $allowed_html ) {\n\t$name_low    = strtolower( $name );\n\t$element_low = strtolower( $element );\n\n\tif ( ! isset( $allowed_html[ $element_low ] ) ) {\n\t\t$name  = '';\n\t\t$value = '';\n\t\t$whole = '';\n\t\treturn false;\n\t}\n\n\t$allowed_attr = $allowed_html[ $element_low ];\n\n\tif ( ! isset( $allowed_attr[ $name_low ] ) || '' === $allowed_attr[ $name_low ] ) {\n\t\t/*\n\t\t * Allow `data-*` attributes.\n\t\t *\n\t\t * When specifying `$allowed_html`, the attribute name should be set as\n\t\t * `data-*` (not to be mixed with the HTML 4.0 `data` attribute, see\n\t\t * https://www.w3.org/TR/html40/struct/objects.html#adef-data).\n\t\t *\n\t\t * Note: the attribute name should only contain `A-Za-z0-9_-` chars,\n\t\t * double hyphens `--` are not accepted by WordPress.\n\t\t */\n\t\tif ( strpos( $name_low, 'data-' ) === 0 && ! empty( $allowed_attr['data-*'] ) && preg_match( '/^data(?:-[a-z0-9_]+)+$/', $name_low, $match ) ) {\n\t\t\t/*\n\t\t\t * Add the whole attribute name to the allowed attributes and set any restrictions\n\t\t\t * for the `data-*` attribute values for the current element.\n\t\t\t */\n\t\t\t$allowed_attr[ $match[0] ] = $allowed_attr['data-*'];\n\t\t} else {\n\t\t\t$name  = '';\n\t\t\t$value = '';\n\t\t\t$whole = '';\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif ( 'style' === $name_low ) {\n\t\t$new_value = safecss_filter_attr( $value );\n\n\t\tif ( empty( $new_value ) ) {\n\t\t\t$name  = '';\n\t\t\t$value = '';\n\t\t\t$whole = '';\n\t\t\treturn false;\n\t\t}\n\n\t\t$whole = str_replace( $value, $new_value, $whole );\n\t\t$value = $new_value;\n\t}\n\n\tif ( is_array( $allowed_attr[ $name_low ] ) ) {\n\t\t// There are some checks.\n\t\tforeach ( $allowed_attr[ $name_low ] as $currkey => $currval ) {\n\t\t\tif ( ! wp_kses_check_attr_val( $value, $vless, $currkey, $currval ) ) {\n\t\t\t\t$name  = '';\n\t\t\t\t$value = '';\n\t\t\t\t$whole = '';\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Builds an attribute list from string containing attributes.\n *\n * This function does a lot of work. It parses an attribute list into an array\n * with attribute data, and tries to do the right thing even if it gets weird\n * input. It will add quotes around attribute values that don't have any quotes\n * or apostrophes around them, to make it easier to produce HTML code that will\n * conform to W3C's HTML specification. It will also remove bad URL protocols\n * from attribute values. It also reduces duplicate attributes by using the\n * attribute defined first (`foo='bar' foo='baz'` will result in `foo='bar'`).\n *\n * @since 1.0.0\n *\n * @param string   $attr              Attribute list from HTML element to closing HTML element tag.\n * @param string[] $allowed_protocols Array of allowed URL protocols.\n * @return array[] Array of attribute information after parsing.\n */\nfunction wp_kses_hair( $attr, $allowed_protocols ) {\n\t$attrarr  = array();\n\t$mode     = 0;\n\t$attrname = '';\n\t$uris     = wp_kses_uri_attributes();\n\n\t// Loop through the whole attribute list.\n\n\twhile ( strlen( $attr ) != 0 ) {\n\t\t$working = 0; // Was the last operation successful?\n\n\t\tswitch ( $mode ) {\n\t\t\tcase 0:\n\t\t\t\tif ( preg_match( '/^([_a-zA-Z][-_a-zA-Z0-9:.]*)/', $attr, $match ) ) {\n\t\t\t\t\t$attrname = $match[1];\n\t\t\t\t\t$working  = 1;\n\t\t\t\t\t$mode     = 1;\n\t\t\t\t\t$attr     = preg_replace( '/^[_a-zA-Z][-_a-zA-Z0-9:.]*/', '', $attr );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tif ( preg_match( '/^\\s*=\\s*/', $attr ) ) { // Equals sign.\n\t\t\t\t\t$working = 1;\n\t\t\t\t\t$mode    = 2;\n\t\t\t\t\t$attr    = preg_replace( '/^\\s*=\\s*/', '', $attr );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( preg_match( '/^\\s+/', $attr ) ) { // Valueless.\n\t\t\t\t\t$working = 1;\n\t\t\t\t\t$mode    = 0;\n\t\t\t\t\tif ( false === array_key_exists( $attrname, $attrarr ) ) {\n\t\t\t\t\t\t$attrarr[ $attrname ] = array(\n\t\t\t\t\t\t\t'name'  => $attrname,\n\t\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t\t'whole' => $attrname,\n\t\t\t\t\t\t\t'vless' => 'y',\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t$attr = preg_replace( '/^\\s+/', '', $attr );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tif ( preg_match( '%^\"([^\"]*)\"(\\s+|/?$)%', $attr, $match ) ) {\n\t\t\t\t\t// \"value\"\n\t\t\t\t\t$thisval = $match[1];\n\t\t\t\t\tif ( in_array( strtolower( $attrname ), $uris, true ) ) {\n\t\t\t\t\t\t$thisval = wp_kses_bad_protocol( $thisval, $allowed_protocols );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( false === array_key_exists( $attrname, $attrarr ) ) {\n\t\t\t\t\t\t$attrarr[ $attrname ] = array(\n\t\t\t\t\t\t\t'name'  => $attrname,\n\t\t\t\t\t\t\t'value' => $thisval,\n\t\t\t\t\t\t\t'whole' => \"$attrname=\\\"$thisval\\\"\",\n\t\t\t\t\t\t\t'vless' => 'n',\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t$working = 1;\n\t\t\t\t\t$mode    = 0;\n\t\t\t\t\t$attr    = preg_replace( '/^\"[^\"]*\"(\\s+|$)/', '', $attr );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( preg_match( \"%^'([^']*)'(\\s+|/?$)%\", $attr, $match ) ) {\n\t\t\t\t\t// 'value'\n\t\t\t\t\t$thisval = $match[1];\n\t\t\t\t\tif ( in_array( strtolower( $attrname ), $uris, true ) ) {\n\t\t\t\t\t\t$thisval = wp_kses_bad_protocol( $thisval, $allowed_protocols );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( false === array_key_exists( $attrname, $attrarr ) ) {\n\t\t\t\t\t\t$attrarr[ $attrname ] = array(\n\t\t\t\t\t\t\t'name'  => $attrname,\n\t\t\t\t\t\t\t'value' => $thisval,\n\t\t\t\t\t\t\t'whole' => \"$attrname='$thisval'\",\n\t\t\t\t\t\t\t'vless' => 'n',\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t$working = 1;\n\t\t\t\t\t$mode    = 0;\n\t\t\t\t\t$attr    = preg_replace( \"/^'[^']*'(\\s+|$)/\", '', $attr );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( preg_match( \"%^([^\\s\\\"']+)(\\s+|/?$)%\", $attr, $match ) ) {\n\t\t\t\t\t// value\n\t\t\t\t\t$thisval = $match[1];\n\t\t\t\t\tif ( in_array( strtolower( $attrname ), $uris, true ) ) {\n\t\t\t\t\t\t$thisval = wp_kses_bad_protocol( $thisval, $allowed_protocols );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( false === array_key_exists( $attrname, $attrarr ) ) {\n\t\t\t\t\t\t$attrarr[ $attrname ] = array(\n\t\t\t\t\t\t\t'name'  => $attrname,\n\t\t\t\t\t\t\t'value' => $thisval,\n\t\t\t\t\t\t\t'whole' => \"$attrname=\\\"$thisval\\\"\",\n\t\t\t\t\t\t\t'vless' => 'n',\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// We add quotes to conform to W3C's HTML spec.\n\t\t\t\t\t$working = 1;\n\t\t\t\t\t$mode    = 0;\n\t\t\t\t\t$attr    = preg_replace( \"%^[^\\s\\\"']+(\\s+|$)%\", '', $attr );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t} // End switch.\n\n\t\tif ( 0 == $working ) { // Not well-formed, remove and try again.\n\t\t\t$attr = wp_kses_html_error( $attr );\n\t\t\t$mode = 0;\n\t\t}\n\t} // End while.\n\n\tif ( 1 == $mode && false === array_key_exists( $attrname, $attrarr ) ) {\n\t\t// Special case, for when the attribute list ends with a valueless\n\t\t// attribute like \"selected\".\n\t\t$attrarr[ $attrname ] = array(\n\t\t\t'name'  => $attrname,\n\t\t\t'value' => '',\n\t\t\t'whole' => $attrname,\n\t\t\t'vless' => 'y',\n\t\t);\n\t}\n\n\treturn $attrarr;\n}\n\n/**\n * Finds all attributes of an HTML element.\n *\n * Does not modify input.  May return \"evil\" output.\n *\n * Based on `wp_kses_split2()` and `wp_kses_attr()`.\n *\n * @since 4.2.3\n *\n * @param string $element HTML element.\n * @return array|bool List of attributes found in the element. Returns false on failure.\n */\nfunction wp_kses_attr_parse( $element ) {\n\t$valid = preg_match( '%^(<\\s*)(/\\s*)?([a-zA-Z0-9]+\\s*)([^>]*)(>?)$%', $element, $matches );\n\tif ( 1 !== $valid ) {\n\t\treturn false;\n\t}\n\n\t$begin  = $matches[1];\n\t$slash  = $matches[2];\n\t$elname = $matches[3];\n\t$attr   = $matches[4];\n\t$end    = $matches[5];\n\n\tif ( '' !== $slash ) {\n\t\t// Closing elements do not get parsed.\n\t\treturn false;\n\t}\n\n\t// Is there a closing XHTML slash at the end of the attributes?\n\tif ( 1 === preg_match( '%\\s*/\\s*$%', $attr, $matches ) ) {\n\t\t$xhtml_slash = $matches[0];\n\t\t$attr        = substr( $attr, 0, -strlen( $xhtml_slash ) );\n\t} else {\n\t\t$xhtml_slash = '';\n\t}\n\n\t// Split it.\n\t$attrarr = wp_kses_hair_parse( $attr );\n\tif ( false === $attrarr ) {\n\t\treturn false;\n\t}\n\n\t// Make sure all input is returned by adding front and back matter.\n\tarray_unshift( $attrarr, $begin . $slash . $elname );\n\tarray_push( $attrarr, $xhtml_slash . $end );\n\n\treturn $attrarr;\n}\n\n/**\n * Builds an attribute list from string containing attributes.\n *\n * Does not modify input.  May return \"evil\" output.\n * In case of unexpected input, returns false instead of stripping things.\n *\n * Based on `wp_kses_hair()` but does not return a multi-dimensional array.\n *\n * @since 4.2.3\n *\n * @param string $attr Attribute list from HTML element to closing HTML element tag.\n * @return array|bool List of attributes found in $attr. Returns false on failure.\n */\nfunction wp_kses_hair_parse( $attr ) {\n\tif ( '' === $attr ) {\n\t\treturn array();\n\t}\n\n\t// phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation\n\t$regex =\n\t\t'(?:'\n\t\t.     '[_a-zA-Z][-_a-zA-Z0-9:.]*' // Attribute name.\n\t\t. '|'\n\t\t.     '\\[\\[?[^\\[\\]]+\\]\\]?'        // Shortcode in the name position implies unfiltered_html.\n\t\t. ')'\n\t\t. '(?:'               // Attribute value.\n\t\t.     '\\s*=\\s*'       // All values begin with '='.\n\t\t.     '(?:'\n\t\t.         '\"[^\"]*\"'   // Double-quoted.\n\t\t.     '|'\n\t\t.         \"'[^']*'\"   // Single-quoted.\n\t\t.     '|'\n\t\t.         '[^\\s\"\\']+' // Non-quoted.\n\t\t.         '(?:\\s|$)'  // Must have a space.\n\t\t.     ')'\n\t\t. '|'\n\t\t.     '(?:\\s|$)'      // If attribute has no value, space is required.\n\t\t. ')'\n\t\t. '\\s*';              // Trailing space is optional except as mentioned above.\n\t// phpcs:enable\n\n\t// Although it is possible to reduce this procedure to a single regexp,\n\t// we must run that regexp twice to get exactly the expected result.\n\n\t$validation = \"%^($regex)+$%\";\n\t$extraction = \"%$regex%\";\n\n\tif ( 1 === preg_match( $validation, $attr ) ) {\n\t\tpreg_match_all( $extraction, $attr, $attrarr );\n\t\treturn $attrarr[0];\n\t} else {\n\t\treturn false;\n\t}\n}\n\n/**\n * Performs different checks for attribute values.\n *\n * The currently implemented checks are \"maxlen\", \"minlen\", \"maxval\", \"minval\",\n * and \"valueless\".\n *\n * @since 1.0.0\n *\n * @param string $value      Attribute value.\n * @param string $vless      Whether the attribute is valueless. Use 'y' or 'n'.\n * @param string $checkname  What $checkvalue is checking for.\n * @param mixed  $checkvalue What constraint the value should pass.\n * @return bool Whether check passes.\n */\nfunction wp_kses_check_attr_val( $value, $vless, $checkname, $checkvalue ) {\n\t$ok = true;\n\n\tswitch ( strtolower( $checkname ) ) {\n\t\tcase 'maxlen':\n\t\t\t/*\n\t\t\t * The maxlen check makes sure that the attribute value has a length not\n\t\t\t * greater than the given value. This can be used to avoid Buffer Overflows\n\t\t\t * in WWW clients and various Internet servers.\n\t\t\t */\n\n\t\t\tif ( strlen( $value ) > $checkvalue ) {\n\t\t\t\t$ok = false;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'minlen':\n\t\t\t/*\n\t\t\t * The minlen check makes sure that the attribute value has a length not\n\t\t\t * smaller than the given value.\n\t\t\t */\n\n\t\t\tif ( strlen( $value ) < $checkvalue ) {\n\t\t\t\t$ok = false;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'maxval':\n\t\t\t/*\n\t\t\t * The maxval check does two things: it checks that the attribute value is\n\t\t\t * an integer from 0 and up, without an excessive amount of zeroes or\n\t\t\t * whitespace (to avoid Buffer Overflows). It also checks that the attribute\n\t\t\t * value is not greater than the given value.\n\t\t\t * This check can be used to avoid Denial of Service attacks.\n\t\t\t */\n\n\t\t\tif ( ! preg_match( '/^\\s{0,6}[0-9]{1,6}\\s{0,6}$/', $value ) ) {\n\t\t\t\t$ok = false;\n\t\t\t}\n\t\t\tif ( $value > $checkvalue ) {\n\t\t\t\t$ok = false;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'minval':\n\t\t\t/*\n\t\t\t * The minval check makes sure that the attribute value is a positive integer,\n\t\t\t * and that it is not smaller than the given value.\n\t\t\t */\n\n\t\t\tif ( ! preg_match( '/^\\s{0,6}[0-9]{1,6}\\s{0,6}$/', $value ) ) {\n\t\t\t\t$ok = false;\n\t\t\t}\n\t\t\tif ( $value < $checkvalue ) {\n\t\t\t\t$ok = false;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'valueless':\n\t\t\t/*\n\t\t\t * The valueless check makes sure if the attribute has a value\n\t\t\t * (like `<a href=\"blah\">`) or not (`<option selected>`). If the given value\n\t\t\t * is a \"y\" or a \"Y\", the attribute must not have a value.\n\t\t\t * If the given value is an \"n\" or an \"N\", the attribute must have a value.\n\t\t\t */\n\n\t\t\tif ( strtolower( $checkvalue ) != $vless ) {\n\t\t\t\t$ok = false;\n\t\t\t}\n\t\t\tbreak;\n\t} // End switch.\n\n\treturn $ok;\n}\n\n/**\n * Sanitizes a string and removed disallowed URL protocols.\n *\n * This function removes all non-allowed protocols from the beginning of the\n * string. It ignores whitespace and the case of the letters, and it does\n * understand HTML entities. It does its work recursively, so it won't be\n * fooled by a string like `javascript:javascript:alert(57)`.\n *\n * @since 1.0.0\n *\n * @param string   $string            Content to filter bad protocols from.\n * @param string[] $allowed_protocols Array of allowed URL protocols.\n * @return string Filtered content.\n */\nfunction wp_kses_bad_protocol( $string, $allowed_protocols ) {\n\t$string     = wp_kses_no_null( $string );\n\t$iterations = 0;\n\n\tdo {\n\t\t$original_string = $string;\n\t\t$string          = wp_kses_bad_protocol_once( $string, $allowed_protocols );\n\t} while ( $original_string != $string && ++$iterations < 6 );\n\n\tif ( $original_string != $string ) {\n\t\treturn '';\n\t}\n\n\treturn $string;\n}\n\n/**\n * Removes any invalid control characters in a text string.\n *\n * Also removes any instance of the `\\0` string.\n *\n * @since 1.0.0\n *\n * @param string $string  Content to filter null characters from.\n * @param array  $options Set 'slash_zero' => 'keep' when '\\0' is allowed. Default is 'remove'.\n * @return string Filtered content.\n */\nfunction wp_kses_no_null( $string, $options = null ) {\n\tif ( ! isset( $options['slash_zero'] ) ) {\n\t\t$options = array( 'slash_zero' => 'remove' );\n\t}\n\n\t$string = preg_replace( '/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]/', '', $string );\n\tif ( 'remove' === $options['slash_zero'] ) {\n\t\t$string = preg_replace( '/\\\\\\\\+0+/', '', $string );\n\t}\n\n\treturn $string;\n}\n\n/**\n * Strips slashes from in front of quotes.\n *\n * This function changes the character sequence `\\\"` to just `\"`. It leaves all other\n * slashes alone. The quoting from `preg_replace(//e)` requires this.\n *\n * @since 1.0.0\n *\n * @param string $string String to strip slashes from.\n * @return string Fixed string with quoted slashes.\n */\nfunction wp_kses_stripslashes( $string ) {\n\treturn preg_replace( '%\\\\\\\\\"%', '\"', $string );\n}\n\n/**\n * Converts the keys of an array to lowercase.\n *\n * @since 1.0.0\n *\n * @param array $inarray Unfiltered array.\n * @return array Fixed array with all lowercase keys.\n */\nfunction wp_kses_array_lc( $inarray ) {\n\t$outarray = array();\n\n\tforeach ( (array) $inarray as $inkey => $inval ) {\n\t\t$outkey              = strtolower( $inkey );\n\t\t$outarray[ $outkey ] = array();\n\n\t\tforeach ( (array) $inval as $inkey2 => $inval2 ) {\n\t\t\t$outkey2                         = strtolower( $inkey2 );\n\t\t\t$outarray[ $outkey ][ $outkey2 ] = $inval2;\n\t\t}\n\t}\n\n\treturn $outarray;\n}\n\n/**\n * Handles parsing errors in `wp_kses_hair()`.\n *\n * The general plan is to remove everything to and including some whitespace,\n * but it deals with quotes and apostrophes as well.\n *\n * @since 1.0.0\n *\n * @param string $string\n * @return string\n */\nfunction wp_kses_html_error( $string ) {\n\treturn preg_replace( '/^(\"[^\"]*(\"|$)|\\'[^\\']*(\\'|$)|\\S)*\\s*/', '', $string );\n}\n\n/**\n * Sanitizes content from bad protocols and other characters.\n *\n * This function searches for URL protocols at the beginning of the string, while\n * handling whitespace and HTML entities.\n *\n * @since 1.0.0\n *\n * @param string   $string            Content to check for bad protocols.\n * @param string[] $allowed_protocols Array of allowed URL protocols.\n * @param int      $count             Depth of call recursion to this function.\n * @return string Sanitized content.\n */\nfunction wp_kses_bad_protocol_once( $string, $allowed_protocols, $count = 1 ) {\n\t$string  = preg_replace( '/(&#0*58(?![;0-9])|&#x0*3a(?![;a-f0-9]))/i', '$1;', $string );\n\t$string2 = preg_split( '/:|&#0*58;|&#x0*3a;|&colon;/i', $string, 2 );\n\tif ( isset( $string2[1] ) && ! preg_match( '%/\\?%', $string2[0] ) ) {\n\t\t$string   = trim( $string2[1] );\n\t\t$protocol = wp_kses_bad_protocol_once2( $string2[0], $allowed_protocols );\n\t\tif ( 'feed:' === $protocol ) {\n\t\t\tif ( $count > 2 ) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\t$string = wp_kses_bad_protocol_once( $string, $allowed_protocols, ++$count );\n\t\t\tif ( empty( $string ) ) {\n\t\t\t\treturn $string;\n\t\t\t}\n\t\t}\n\t\t$string = $protocol . $string;\n\t}\n\n\treturn $string;\n}\n\n/**\n * Callback for `wp_kses_bad_protocol_once()` regular expression.\n *\n * This function processes URL protocols, checks to see if they're in the\n * list of allowed protocols or not, and returns different data depending\n * on the answer.\n *\n * @access private\n * @ignore\n * @since 1.0.0\n *\n * @param string   $string            URI scheme to check against the list of allowed protocols.\n * @param string[] $allowed_protocols Array of allowed URL protocols.\n * @return string Sanitized content.\n */\nfunction wp_kses_bad_protocol_once2( $string, $allowed_protocols ) {\n\t$string2 = wp_kses_decode_entities( $string );\n\t$string2 = preg_replace( '/\\s/', '', $string2 );\n\t$string2 = wp_kses_no_null( $string2 );\n\t$string2 = strtolower( $string2 );\n\n\t$allowed = false;\n\tforeach ( (array) $allowed_protocols as $one_protocol ) {\n\t\tif ( strtolower( $one_protocol ) == $string2 ) {\n\t\t\t$allowed = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ( $allowed ) {\n\t\treturn \"$string2:\";\n\t} else {\n\t\treturn '';\n\t}\n}\n\n/**\n * Converts and fixes HTML entities.\n *\n * This function normalizes HTML entities. It will convert `AT&T` to the correct\n * `AT&amp;T`, `&#00058;` to `&#58;`, `&#XYZZY;` to `&amp;#XYZZY;` and so on.\n *\n * When `$context` is set to 'xml', HTML entities are converted to their code points.  For\n * example, `AT&T&hellip;&#XYZZY;` is converted to `AT&amp;T\u00e2\u20ac\u00a6&amp;#XYZZY;`.\n *\n * @since 1.0.0\n * @since 5.5.0 Added `$context` parameter.\n *\n * @param string $string  Content to normalize entities.\n * @param string $context Context for normalization. Can be either 'html' or 'xml'.\n *                        Default 'html'.\n * @return string Content with normalized entities.\n */\nfunction wp_kses_normalize_entities( $string, $context = 'html' ) {\n\t// Disarm all entities by converting & to &amp;\n\t$string = str_replace( '&', '&amp;', $string );\n\n\t// Change back the allowed entities in our list of allowed entities.\n\tif ( 'xml' === $context ) {\n\t\t$string = preg_replace_callback( '/&amp;([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_xml_named_entities', $string );\n\t} else {\n\t\t$string = preg_replace_callback( '/&amp;([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_named_entities', $string );\n\t}\n\t$string = preg_replace_callback( '/&amp;#(0*[0-9]{1,7});/', 'wp_kses_normalize_entities2', $string );\n\t$string = preg_replace_callback( '/&amp;#[Xx](0*[0-9A-Fa-f]{1,6});/', 'wp_kses_normalize_entities3', $string );\n\n\treturn $string;\n}\n\n/**\n * Callback for `wp_kses_normalize_entities()` regular expression.\n *\n * This function only accepts valid named entity references, which are finite,\n * case-sensitive, and highly scrutinized by HTML and XML validators.\n *\n * @since 3.0.0\n *\n * @global array $allowedentitynames\n *\n * @param array $matches preg_replace_callback() matches array.\n * @return string Correctly encoded entity.\n */\nfunction wp_kses_named_entities( $matches ) {\n\tglobal $allowedentitynames;\n\n\tif ( empty( $matches[1] ) ) {\n\t\treturn '';\n\t}\n\n\t$i = $matches[1];\n\treturn ( ! in_array( $i, $allowedentitynames, true ) ) ? \"&amp;$i;\" : \"&$i;\";\n}\n\n/**\n * Callback for `wp_kses_normalize_entities()` regular expression.\n *\n * This function only accepts valid named entity references, which are finite,\n * case-sensitive, and highly scrutinized by XML validators.  HTML named entity\n * references are converted to their code points.\n *\n * @since 5.5.0\n *\n * @global array $allowedentitynames\n * @global array $allowedxmlnamedentities\n *\n * @param array $matches preg_replace_callback() matches array.\n * @return string Correctly encoded entity.\n */\nfunction wp_kses_xml_named_entities( $matches ) {\n\tglobal $allowedentitynames, $allowedxmlnamedentities;\n\n\tif ( empty( $matches[1] ) ) {\n\t\treturn '';\n\t}\n\n\t$i = $matches[1];\n\n\tif ( in_array( $i, $allowedxmlnamedentities, true ) ) {\n\t\treturn \"&$i;\";\n\t} elseif ( in_array( $i, $allowedentitynames, true ) ) {\n\t\treturn html_entity_decode( \"&$i;\", ENT_HTML5 );\n\t}\n\n\treturn \"&amp;$i;\";\n}\n\n/**\n * Callback for `wp_kses_normalize_entities()` regular expression.\n *\n * This function helps `wp_kses_normalize_entities()` to only accept 16-bit\n * values and nothing more for `&#number;` entities.\n *\n * @access private\n * @ignore\n * @since 1.0.0\n *\n * @param array $matches `preg_replace_callback()` matches array.\n * @return string Correctly encoded entity.\n */\nfunction wp_kses_normalize_entities2( $matches ) {\n\tif ( empty( $matches[1] ) ) {\n\t\treturn '';\n\t}\n\n\t$i = $matches[1];\n\tif ( valid_unicode( $i ) ) {\n\t\t$i = str_pad( ltrim( $i, '0' ), 3, '0', STR_PAD_LEFT );\n\t\t$i = \"&#$i;\";\n\t} else {\n\t\t$i = \"&amp;#$i;\";\n\t}\n\n\treturn $i;\n}\n\n/**\n * Callback for `wp_kses_normalize_entities()` for regular expression.\n *\n * This function helps `wp_kses_normalize_entities()` to only accept valid Unicode\n * numeric entities in hex form.\n *\n * @since 2.7.0\n * @access private\n * @ignore\n *\n * @param array $matches `preg_replace_callback()` matches array.\n * @return string Correctly encoded entity.\n */\nfunction wp_kses_normalize_entities3( $matches ) {\n\tif ( empty( $matches[1] ) ) {\n\t\treturn '';\n\t}\n\n\t$hexchars = $matches[1];\n\treturn ( ! valid_unicode( hexdec( $hexchars ) ) ) ? \"&amp;#x$hexchars;\" : '&#x' . ltrim( $hexchars, '0' ) . ';';\n}\n\n/**\n * Determines if a Unicode codepoint is valid.\n *\n * @since 2.7.0\n *\n * @param int $i Unicode codepoint.\n * @return bool Whether or not the codepoint is a valid Unicode codepoint.\n */\nfunction valid_unicode( $i ) {\n\treturn ( 0x9 == $i || 0xa == $i || 0xd == $i ||\n\t\t\t( 0x20 <= $i && $i <= 0xd7ff ) ||\n\t\t\t( 0xe000 <= $i && $i <= 0xfffd ) ||\n\t\t\t( 0x10000 <= $i && $i <= 0x10ffff ) );\n}\n\n/**\n * Converts all numeric HTML entities to their named counterparts.\n *\n * This function decodes numeric HTML entities (`&#65;` and `&#x41;`).\n * It doesn't do anything with named entities like `&auml;`, but we don't\n * need them in the allowed URL protocols system anyway.\n *\n * @since 1.0.0\n *\n * @param string $string Content to change entities.\n * @return string Content after decoded entities.\n */\nfunction wp_kses_decode_entities( $string ) {\n\t$string = preg_replace_callback( '/&#([0-9]+);/', '_wp_kses_decode_entities_chr', $string );\n\t$string = preg_replace_callback( '/&#[Xx]([0-9A-Fa-f]+);/', '_wp_kses_decode_entities_chr_hexdec', $string );\n\n\treturn $string;\n}\n\n/**\n * Regex callback for `wp_kses_decode_entities()`.\n *\n * @since 2.9.0\n * @access private\n * @ignore\n *\n * @param array $match preg match\n * @return string\n */\nfunction _wp_kses_decode_entities_chr( $match ) {\n\treturn chr( $match[1] );\n}\n\n/**\n * Regex callback for `wp_kses_decode_entities()`.\n *\n * @since 2.9.0\n * @access private\n * @ignore\n *\n * @param array $match preg match\n * @return string\n */\nfunction _wp_kses_decode_entities_chr_hexdec( $match ) {\n\treturn chr( hexdec( $match[1] ) );\n}\n\n/**\n * Sanitize content with allowed HTML KSES rules.\n *\n * This function expects slashed data.\n *\n * @since 1.0.0\n *\n * @param string $data Content to filter, expected to be escaped with slashes.\n * @return string Filtered content.\n */\nfunction wp_filter_kses( $data ) {\n\treturn addslashes( wp_kses( stripslashes( $data ), current_filter() ) );\n}\n\n/**\n * Sanitize content with allowed HTML KSES rules.\n *\n * This function expects unslashed data.\n *\n * @since 2.9.0\n *\n * @param string $data Content to filter, expected to not be escaped.\n * @return string Filtered content.\n */\nfunction wp_kses_data( $data ) {\n\treturn wp_kses( $data, current_filter() );\n}\n\n/**\n * Sanitizes content for allowed HTML tags for post content.\n *\n * Post content refers to the page contents of the 'post' type and not `$_POST`\n * data from forms.\n *\n * This function expects slashed data.\n *\n * @since 2.0.0\n *\n * @param string $data Post content to filter, expected to be escaped with slashes.\n * @return string Filtered post content with allowed HTML tags and attributes intact.\n */\nfunction wp_filter_post_kses( $data ) {\n\treturn addslashes( wp_kses( stripslashes( $data ), 'post' ) );\n}\n\n/**\n * Sanitizes content for allowed HTML tags for post content.\n *\n * Post content refers to the page contents of the 'post' type and not `$_POST`\n * data from forms.\n *\n * This function expects unslashed data.\n *\n * @since 2.9.0\n *\n * @param string $data Post content to filter.\n * @return string Filtered post content with allowed HTML tags and attributes intact.\n */\nfunction wp_kses_post( $data ) {\n\treturn wp_kses( $data, 'post' );\n}\n\n/**\n * Navigates through an array, object, or scalar, and sanitizes content for\n * allowed HTML tags for post content.\n *\n * @since 4.4.2\n *\n * @see map_deep()\n *\n * @param mixed $data The array, object, or scalar value to inspect.\n * @return mixed The filtered content.\n */\nfunction wp_kses_post_deep( $data ) {\n\treturn map_deep( $data, 'wp_kses_post' );\n}\n\n/**\n * Strips all HTML from a text string.\n *\n * This function expects slashed data.\n *\n * @since 2.1.0\n *\n * @param string $data Content to strip all HTML from.\n * @return string Filtered content without any HTML.\n */\nfunction wp_filter_nohtml_kses( $data ) {\n\treturn addslashes( wp_kses( stripslashes( $data ), 'strip' ) );\n}\n\n/**\n * Adds all KSES input form content filters.\n *\n * All hooks have default priority. The `wp_filter_kses()` function is added to\n * the 'pre_comment_content' and 'title_save_pre' hooks.\n *\n * The `wp_filter_post_kses()` function is added to the 'content_save_pre',\n * 'excerpt_save_pre', and 'content_filtered_save_pre' hooks.\n *\n * @since 2.0.0\n */\nfunction kses_init_filters() {\n\t// Normal filtering.\n\tadd_filter( 'title_save_pre', 'wp_filter_kses' );\n\n\t// Comment filtering.\n\tif ( current_user_can( 'unfiltered_html' ) ) {\n\t\tadd_filter( 'pre_comment_content', 'wp_filter_post_kses' );\n\t} else {\n\t\tadd_filter( 'pre_comment_content', 'wp_filter_kses' );\n\t}\n\n\t// Post filtering.\n\tadd_filter( 'content_save_pre', 'wp_filter_post_kses' );\n\tadd_filter( 'excerpt_save_pre', 'wp_filter_post_kses' );\n\tadd_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' );\n}\n\n/**\n * Removes all KSES input form content filters.\n *\n * A quick procedural method to removing all of the filters that KSES uses for\n * content in WordPress Loop.\n *\n * Does not remove the `kses_init()` function from {@see 'init'} hook (priority is\n * default). Also does not remove `kses_init()` function from {@see 'set_current_user'}\n * hook (priority is also default).\n *\n * @since 2.0.6\n */\nfunction kses_remove_filters() {\n\t// Normal filtering.\n\tremove_filter( 'title_save_pre', 'wp_filter_kses' );\n\n\t// Comment filtering.\n\tremove_filter( 'pre_comment_content', 'wp_filter_post_kses' );\n\tremove_filter( 'pre_comment_content', 'wp_filter_kses' );\n\n\t// Post filtering.\n\tremove_filter( 'content_save_pre', 'wp_filter_post_kses' );\n\tremove_filter( 'excerpt_save_pre', 'wp_filter_post_kses' );\n\tremove_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' );\n}\n\n/**\n * Sets up most of the KSES filters for input form content.\n *\n * First removes all of the KSES filters in case the current user does not need\n * to have KSES filter the content. If the user does not have `unfiltered_html`\n * capability, then KSES filters are added.\n *\n * @since 2.0.0\n */\nfunction kses_init() {\n\tkses_remove_filters();\n\n\tif ( ! current_user_can( 'unfiltered_html' ) ) {\n\t\tkses_init_filters();\n\t}\n}\n\n/**\n * Filters an inline style attribute and removes disallowed rules.\n *\n * @since 2.8.1\n *\n * @param string $css        A string of CSS rules.\n * @param string $deprecated Not used.\n * @return string Filtered string of CSS rules.\n */\nfunction safecss_filter_attr( $css, $deprecated = '' ) {\n\tif ( ! empty( $deprecated ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '2.8.1' ); // Never implemented.\n\t}\n\n\t$css = wp_kses_no_null( $css );\n\t$css = str_replace( array( \"\\n\", \"\\r\", \"\\t\" ), '', $css );\n\n\t$allowed_protocols = wp_allowed_protocols();\n\n\t$css_array = explode( ';', trim( $css ) );\n\n\t/**\n\t * Filters list of allowed CSS attributes.\n\t *\n\t * @since 2.8.1\n\t * @since 4.4.0 Added support for `min-height`, `max-height`, `min-width`, and `max-width`.\n\t * @since 4.6.0 Added support for `list-style-type`.\n\t * @since 5.0.0 Added support for `background-image`.\n\t * @since 5.1.0 Added support for `text-transform`.\n\t * @since 5.2.0 Added support for `background-position` and `grid-template-columns`.\n\t * @since 5.3.0 Added support for `grid`, `flex` and `column` layout properties.\n\t *              Extend `background-*` support of individual properties.\n\t * @since 5.3.1 Added support for gradient backgrounds.\n\t *\n\t * @param string[] $attr Array of allowed CSS attributes.\n\t */\n\t$allowed_attr = apply_filters(\n\t\t'safe_style_css',\n\t\tarray(\n\t\t\t'background',\n\t\t\t'background-color',\n\t\t\t'background-image',\n\t\t\t'background-position',\n\t\t\t'background-size',\n\t\t\t'background-attachment',\n\t\t\t'background-blend-mode',\n\n\t\t\t'border',\n\t\t\t'border-radius',\n\t\t\t'border-width',\n\t\t\t'border-color',\n\t\t\t'border-style',\n\t\t\t'border-right',\n\t\t\t'border-right-color',\n\t\t\t'border-right-style',\n\t\t\t'border-right-width',\n\t\t\t'border-bottom',\n\t\t\t'border-bottom-color',\n\t\t\t'border-bottom-style',\n\t\t\t'border-bottom-width',\n\t\t\t'border-left',\n\t\t\t'border-left-color',\n\t\t\t'border-left-style',\n\t\t\t'border-left-width',\n\t\t\t'border-top',\n\t\t\t'border-top-color',\n\t\t\t'border-top-style',\n\t\t\t'border-top-width',\n\n\t\t\t'border-spacing',\n\t\t\t'border-collapse',\n\t\t\t'caption-side',\n\n\t\t\t'columns',\n\t\t\t'column-count',\n\t\t\t'column-fill',\n\t\t\t'column-gap',\n\t\t\t'column-rule',\n\t\t\t'column-span',\n\t\t\t'column-width',\n\n\t\t\t'color',\n\t\t\t'font',\n\t\t\t'font-family',\n\t\t\t'font-size',\n\t\t\t'font-style',\n\t\t\t'font-variant',\n\t\t\t'font-weight',\n\t\t\t'letter-spacing',\n\t\t\t'line-height',\n\t\t\t'text-align',\n\t\t\t'text-decoration',\n\t\t\t'text-indent',\n\t\t\t'text-transform',\n\n\t\t\t'height',\n\t\t\t'min-height',\n\t\t\t'max-height',\n\n\t\t\t'width',\n\t\t\t'min-width',\n\t\t\t'max-width',\n\n\t\t\t'margin',\n\t\t\t'margin-right',\n\t\t\t'margin-bottom',\n\t\t\t'margin-left',\n\t\t\t'margin-top',\n\n\t\t\t'padding',\n\t\t\t'padding-right',\n\t\t\t'padding-bottom',\n\t\t\t'padding-left',\n\t\t\t'padding-top',\n\n\t\t\t'flex',\n\t\t\t'flex-basis',\n\t\t\t'flex-direction',\n\t\t\t'flex-flow',\n\t\t\t'flex-grow',\n\t\t\t'flex-shrink',\n\n\t\t\t'grid-template-columns',\n\t\t\t'grid-auto-columns',\n\t\t\t'grid-column-start',\n\t\t\t'grid-column-end',\n\t\t\t'grid-column-gap',\n\t\t\t'grid-template-rows',\n\t\t\t'grid-auto-rows',\n\t\t\t'grid-row-start',\n\t\t\t'grid-row-end',\n\t\t\t'grid-row-gap',\n\t\t\t'grid-gap',\n\n\t\t\t'justify-content',\n\t\t\t'justify-items',\n\t\t\t'justify-self',\n\t\t\t'align-content',\n\t\t\t'align-items',\n\t\t\t'align-self',\n\n\t\t\t'clear',\n\t\t\t'cursor',\n\t\t\t'direction',\n\t\t\t'float',\n\t\t\t'list-style-type',\n\t\t\t'overflow',\n\t\t\t'vertical-align',\n\t\t)\n\t);\n\n\t/*\n\t * CSS attributes that accept URL data types.\n\t *\n\t * This is in accordance to the CSS spec and unrelated to\n\t * the sub-set of supported attributes above.\n\t *\n\t * See: https://developer.mozilla.org/en-US/docs/Web/CSS/url\n\t */\n\t$css_url_data_types = array(\n\t\t'background',\n\t\t'background-image',\n\n\t\t'cursor',\n\n\t\t'list-style',\n\t\t'list-style-image',\n\t);\n\n\t/*\n\t * CSS attributes that accept gradient data types.\n\t *\n\t */\n\t$css_gradient_data_types = array(\n\t\t'background',\n\t\t'background-image',\n\t);\n\n\tif ( empty( $allowed_attr ) ) {\n\t\treturn $css;\n\t}\n\n\t$css = '';\n\tforeach ( $css_array as $css_item ) {\n\t\tif ( '' === $css_item ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$css_item        = trim( $css_item );\n\t\t$css_test_string = $css_item;\n\t\t$found           = false;\n\t\t$url_attr        = false;\n\t\t$gradient_attr   = false;\n\n\t\tif ( strpos( $css_item, ':' ) === false ) {\n\t\t\t$found = true;\n\t\t} else {\n\t\t\t$parts        = explode( ':', $css_item, 2 );\n\t\t\t$css_selector = trim( $parts[0] );\n\n\t\t\tif ( in_array( $css_selector, $allowed_attr, true ) ) {\n\t\t\t\t$found         = true;\n\t\t\t\t$url_attr      = in_array( $css_selector, $css_url_data_types, true );\n\t\t\t\t$gradient_attr = in_array( $css_selector, $css_gradient_data_types, true );\n\t\t\t}\n\t\t}\n\n\t\tif ( $found && $url_attr ) {\n\t\t\t// Simplified: matches the sequence `url(*)`.\n\t\t\tpreg_match_all( '/url\\([^)]+\\)/', $parts[1], $url_matches );\n\n\t\t\tforeach ( $url_matches[0] as $url_match ) {\n\t\t\t\t// Clean up the URL from each of the matches above.\n\t\t\t\tpreg_match( '/^url\\(\\s*([\\'\\\"]?)(.*)(\\g1)\\s*\\)$/', $url_match, $url_pieces );\n\n\t\t\t\tif ( empty( $url_pieces[2] ) ) {\n\t\t\t\t\t$found = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$url = trim( $url_pieces[2] );\n\n\t\t\t\tif ( empty( $url ) || wp_kses_bad_protocol( $url, $allowed_protocols ) !== $url ) {\n\t\t\t\t\t$found = false;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t// Remove the whole `url(*)` bit that was matched above from the CSS.\n\t\t\t\t\t$css_test_string = str_replace( $url_match, '', $css_test_string );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( $found && $gradient_attr ) {\n\t\t\t$css_value = trim( $parts[1] );\n\t\t\tif ( preg_match( '/^(repeating-)?(linear|radial|conic)-gradient\\(([^()]|rgb[a]?\\([^()]*\\))*\\)$/', $css_value ) ) {\n\t\t\t\t// Remove the whole `gradient` bit that was matched above from the CSS.\n\t\t\t\t$css_test_string = str_replace( $css_value, '', $css_test_string );\n\t\t\t}\n\t\t}\n\n\t\tif ( $found ) {\n\t\t\t// Check for any CSS containing \\ ( & } = or comments, except for url() usage checked above.\n\t\t\t$allow_css = ! preg_match( '%[\\\\\\(&=}]|/\\*%', $css_test_string );\n\n\t\t\t/**\n\t\t\t * Filters the check for unsafe CSS in `safecss_filter_attr`.\n\t\t\t *\n\t\t\t * Enables developers to determine whether a section of CSS should be allowed or discarded.\n\t\t\t * By default, the value will be false if the part contains \\ ( & } = or comments.\n\t\t\t * Return true to allow the CSS part to be included in the output.\n\t\t\t *\n\t\t\t * @since 5.5.0\n\t\t\t *\n\t\t\t * @param bool   $allow_css       Whether the CSS in the test string is considered safe.\n\t\t\t * @param string $css_test_string The CSS string to test.\n\t\t\t */\n\t\t\t$allow_css = apply_filters( 'safecss_filter_attr_allow_css', $allow_css, $css_test_string );\n\n\t\t\t // Only add the CSS part if it passes the regex check.\n\t\t\tif ( $allow_css ) {\n\t\t\t\tif ( '' !== $css ) {\n\t\t\t\t\t$css .= ';';\n\t\t\t\t}\n\n\t\t\t\t$css .= $css_item;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $css;\n}\n\n/**\n * Helper function to add global attributes to a tag in the allowed HTML list.\n *\n * @since 3.5.0\n * @since 5.0.0 Add support for `data-*` wildcard attributes.\n * @access private\n * @ignore\n *\n * @param array $value An array of attributes.\n * @return array The array of attributes with global attributes added.\n */\nfunction _wp_add_global_attributes( $value ) {\n\t$global_attributes = array(\n\t\t'aria-describedby' => true,\n\t\t'aria-details'     => true,\n\t\t'aria-label'       => true,\n\t\t'aria-labelledby'  => true,\n\t\t'aria-hidden'      => true,\n\t\t'class'            => true,\n\t\t'id'               => true,\n\t\t'style'            => true,\n\t\t'title'            => true,\n\t\t'role'             => true,\n\t\t'data-*'           => true,\n\t);\n\n\tif ( true === $value ) {\n\t\t$value = array();\n\t}\n\n\tif ( is_array( $value ) ) {\n\t\treturn array_merge( $value, $global_attributes );\n\t}\n\n\treturn $value;\n}\n", "num_lines": 2449}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Core Translation API\n *\n * @package WordPress\n * @subpackage i18n\n * @since 1.2.0\n */\n\n/**\n * Retrieves the current locale.\n *\n * If the locale is set, then it will filter the locale in the {@see 'locale'}\n * filter hook and return the value.\n *\n * If the locale is not set already, then the WPLANG constant is used if it is\n * defined. Then it is filtered through the {@see 'locale'} filter hook and\n * the value for the locale global set and the locale is returned.\n *\n * The process to get the locale should only be done once, but the locale will\n * always be filtered using the {@see 'locale'} hook.\n *\n * @since 1.5.0\n *\n * @global string $locale           The current locale.\n * @global string $wp_local_package Locale code of the package.\n *\n * @return string The locale of the blog or from the {@see 'locale'} hook.\n */\nfunction get_locale() {\n\tglobal $locale, $wp_local_package;\n\n\tif ( isset( $locale ) ) {\n\t\t/**\n\t\t * Filters the locale ID of the WordPress installation.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param string $locale The locale ID.\n\t\t */\n\t\treturn apply_filters( 'locale', $locale );\n\t}\n\n\tif ( isset( $wp_local_package ) ) {\n\t\t$locale = $wp_local_package;\n\t}\n\n\t// WPLANG was defined in wp-config.\n\tif ( defined( 'WPLANG' ) ) {\n\t\t$locale = WPLANG;\n\t}\n\n\t// If multisite, check options.\n\tif ( is_multisite() ) {\n\t\t// Don't check blog option when installing.\n\t\tif ( wp_installing() ) {\n\t\t\t$ms_locale = get_site_option( 'WPLANG' );\n\t\t} else {\n\t\t\t$ms_locale = get_option( 'WPLANG' );\n\t\t\tif ( false === $ms_locale ) {\n\t\t\t\t$ms_locale = get_site_option( 'WPLANG' );\n\t\t\t}\n\t\t}\n\n\t\tif ( false !== $ms_locale ) {\n\t\t\t$locale = $ms_locale;\n\t\t}\n\t} else {\n\t\t$db_locale = get_option( 'WPLANG' );\n\t\tif ( false !== $db_locale ) {\n\t\t\t$locale = $db_locale;\n\t\t}\n\t}\n\n\tif ( empty( $locale ) ) {\n\t\t$locale = 'en_US';\n\t}\n\n\t/** This filter is documented in wp-includes/l10n.php */\n\treturn apply_filters( 'locale', $locale );\n}\n\n/**\n * Retrieves the locale of a user.\n *\n * If the user has a locale set to a non-empty string then it will be\n * returned. Otherwise it returns the locale of get_locale().\n *\n * @since 4.7.0\n *\n * @param int|WP_User $user_id User's ID or a WP_User object. Defaults to current user.\n * @return string The locale of the user.\n */\nfunction get_user_locale( $user_id = 0 ) {\n\t$user = false;\n\tif ( 0 === $user_id && function_exists( 'wp_get_current_user' ) ) {\n\t\t$user = wp_get_current_user();\n\t} elseif ( $user_id instanceof WP_User ) {\n\t\t$user = $user_id;\n\t} elseif ( $user_id && is_numeric( $user_id ) ) {\n\t\t$user = get_user_by( 'id', $user_id );\n\t}\n\n\tif ( ! $user ) {\n\t\treturn get_locale();\n\t}\n\n\t$locale = $user->locale;\n\treturn $locale ? $locale : get_locale();\n}\n\n/**\n * Determine the current locale desired for the request.\n *\n * @since 5.0.0\n *\n * @global string $pagenow\n *\n * @return string The determined locale.\n */\nfunction determine_locale() {\n\t/**\n\t * Filters the locale for the current request prior to the default determination process.\n\t *\n\t * Using this filter allows to override the default logic, effectively short-circuiting the function.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param string|null $locale The locale to return and short-circuit. Default null.\n\t */\n\t$determined_locale = apply_filters( 'pre_determine_locale', null );\n\n\tif ( ! empty( $determined_locale ) && is_string( $determined_locale ) ) {\n\t\treturn $determined_locale;\n\t}\n\n\t$determined_locale = get_locale();\n\n\tif ( is_admin() ) {\n\t\t$determined_locale = get_user_locale();\n\t}\n\n\tif ( isset( $_GET['_locale'] ) && 'user' === $_GET['_locale'] && wp_is_json_request() ) {\n\t\t$determined_locale = get_user_locale();\n\t}\n\n\tif ( ! empty( $_GET['wp_lang'] ) && ! empty( $GLOBALS['pagenow'] ) && 'wp-login.php' === $GLOBALS['pagenow'] ) {\n\t\t$determined_locale = sanitize_text_field( $_GET['wp_lang'] );\n\t}\n\n\t/**\n\t * Filters the locale for the current request.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param string $locale The locale.\n\t */\n\treturn apply_filters( 'determine_locale', $determined_locale );\n}\n\n/**\n * Retrieve the translation of $text.\n *\n * If there is no translation, or the text domain isn't loaded, the original text is returned.\n *\n * *Note:* Don't use translate() directly, use __() or related functions.\n *\n * @since 2.2.0\n * @since 5.5.0 Introduced gettext-{$domain} filter.\n *\n * @param string $text   Text to translate.\n * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.\n *                       Default 'default'.\n * @return string Translated text.\n */\nfunction translate( $text, $domain = 'default' ) {\n\t$translations = get_translations_for_domain( $domain );\n\t$translation  = $translations->translate( $text );\n\n\t/**\n\t * Filters text with its translation.\n\t *\n\t * @since 2.0.11\n\t *\n\t * @param string $translation Translated text.\n\t * @param string $text        Text to translate.\n\t * @param string $domain      Text domain. Unique identifier for retrieving translated strings.\n\t */\n\t$translation = apply_filters( 'gettext', $translation, $text, $domain );\n\n\t/**\n\t * Filters text with its translation for a domain.\n\t *\n\t * The dynamic portion of the hook, `$domain`, refers to the text domain.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $translation Translated text.\n\t * @param string $text        Text to translate.\n\t * @param string $domain      Text domain. Unique identifier for retrieving translated strings.\n\t */\n\t$translation = apply_filters( \"gettext_{$domain}\", $translation, $text, $domain );\n\n\treturn $translation;\n}\n\n/**\n * Remove last item on a pipe-delimited string.\n *\n * Meant for removing the last item in a string, such as 'Role name|User role'. The original\n * string will be returned if no pipe '|' characters are found in the string.\n *\n * @since 2.8.0\n *\n * @param string $string A pipe-delimited string.\n * @return string Either $string or everything before the last pipe.\n */\nfunction before_last_bar( $string ) {\n\t$last_bar = strrpos( $string, '|' );\n\tif ( false === $last_bar ) {\n\t\treturn $string;\n\t} else {\n\t\treturn substr( $string, 0, $last_bar );\n\t}\n}\n\n/**\n * Retrieve the translation of $text in the context defined in $context.\n *\n * If there is no translation, or the text domain isn't loaded, the original text is returned.\n *\n * *Note:* Don't use translate_with_gettext_context() directly, use _x() or related functions.\n *\n * @since 2.8.0\n * @since 5.5.0 Introduced gettext_with_context-{$domain} filter.\n *\n * @param string $text    Text to translate.\n * @param string $context Context information for the translators.\n * @param string $domain  Optional. Text domain. Unique identifier for retrieving translated strings.\n *                        Default 'default'.\n * @return string Translated text on success, original text on failure.\n */\nfunction translate_with_gettext_context( $text, $context, $domain = 'default' ) {\n\t$translations = get_translations_for_domain( $domain );\n\t$translation  = $translations->translate( $text, $context );\n\n\t/**\n\t * Filters text with its translation based on context information.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $translation Translated text.\n\t * @param string $text        Text to translate.\n\t * @param string $context     Context information for the translators.\n\t * @param string $domain      Text domain. Unique identifier for retrieving translated strings.\n\t */\n\t$translation = apply_filters( 'gettext_with_context', $translation, $text, $context, $domain );\n\n\t/**\n\t * Filters text with its translation based on context information for a domain.\n\t *\n\t * The dynamic portion of the hook, `$domain`, refers to the text domain.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $translation Translated text.\n\t * @param string $text        Text to translate.\n\t * @param string $context     Context information for the translators.\n\t * @param string $domain      Text domain. Unique identifier for retrieving translated strings.\n\t */\n\t$translation = apply_filters( \"gettext_with_context_{$domain}\", $translation, $text, $context, $domain );\n\n\treturn $translation;\n}\n\n/**\n * Retrieve the translation of $text.\n *\n * If there is no translation, or the text domain isn't loaded, the original text is returned.\n *\n * @since 2.1.0\n *\n * @param string $text   Text to translate.\n * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.\n *                       Default 'default'.\n * @return string Translated text.\n */\nfunction __( $text, $domain = 'default' ) {\n\treturn translate( $text, $domain );\n}\n\n/**\n * Retrieve the translation of $text and escapes it for safe use in an attribute.\n *\n * If there is no translation, or the text domain isn't loaded, the original text is returned.\n *\n * @since 2.8.0\n *\n * @param string $text   Text to translate.\n * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.\n *                       Default 'default'.\n * @return string Translated text on success, original text on failure.\n */\nfunction esc_attr__( $text, $domain = 'default' ) {\n\treturn esc_attr( translate( $text, $domain ) );\n}\n\n/**\n * Retrieve the translation of $text and escapes it for safe use in HTML output.\n *\n * If there is no translation, or the text domain isn't loaded, the original text\n * is escaped and returned.\n *\n * @since 2.8.0\n *\n * @param string $text   Text to translate.\n * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.\n *                       Default 'default'.\n * @return string Translated text.\n */\nfunction esc_html__( $text, $domain = 'default' ) {\n\treturn esc_html( translate( $text, $domain ) );\n}\n\n/**\n * Display translated text.\n *\n * @since 1.2.0\n *\n * @param string $text   Text to translate.\n * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.\n *                       Default 'default'.\n */\nfunction _e( $text, $domain = 'default' ) {\n\techo translate( $text, $domain );\n}\n\n/**\n * Display translated text that has been escaped for safe use in an attribute.\n *\n * Encodes `< > & \" '` (less than, greater than, ampersand, double quote, single quote).\n * Will never double encode entities.\n *\n * If you need the value for use in PHP, use esc_attr__().\n *\n * @since 2.8.0\n *\n * @param string $text   Text to translate.\n * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.\n *                       Default 'default'.\n */\nfunction esc_attr_e( $text, $domain = 'default' ) {\n\techo esc_attr( translate( $text, $domain ) );\n}\n\n/**\n * Display translated text that has been escaped for safe use in HTML output.\n *\n * If there is no translation, or the text domain isn't loaded, the original text\n * is escaped and displayed.\n *\n * If you need the value for use in PHP, use esc_html__().\n *\n * @since 2.8.0\n *\n * @param string $text   Text to translate.\n * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.\n *                       Default 'default'.\n */\nfunction esc_html_e( $text, $domain = 'default' ) {\n\techo esc_html( translate( $text, $domain ) );\n}\n\n/**\n * Retrieve translated string with gettext context.\n *\n * Quite a few times, there will be collisions with similar translatable text\n * found in more than two places, but with different translated context.\n *\n * By including the context in the pot file, translators can translate the two\n * strings differently.\n *\n * @since 2.8.0\n *\n * @param string $text    Text to translate.\n * @param string $context Context information for the translators.\n * @param string $domain  Optional. Text domain. Unique identifier for retrieving translated strings.\n *                        Default 'default'.\n * @return string Translated context string without pipe.\n */\nfunction _x( $text, $context, $domain = 'default' ) {\n\treturn translate_with_gettext_context( $text, $context, $domain );\n}\n\n/**\n * Display translated string with gettext context.\n *\n * @since 3.0.0\n *\n * @param string $text    Text to translate.\n * @param string $context Context information for the translators.\n * @param string $domain  Optional. Text domain. Unique identifier for retrieving translated strings.\n *                        Default 'default'.\n * @return string Translated context string without pipe.\n */\nfunction _ex( $text, $context, $domain = 'default' ) {\n\techo _x( $text, $context, $domain );\n}\n\n/**\n * Translate string with gettext context, and escapes it for safe use in an attribute.\n *\n * If there is no translation, or the text domain isn't loaded, the original text\n * is escaped and returned.\n *\n * @since 2.8.0\n *\n * @param string $text    Text to translate.\n * @param string $context Context information for the translators.\n * @param string $domain  Optional. Text domain. Unique identifier for retrieving translated strings.\n *                        Default 'default'.\n * @return string Translated text.\n */\nfunction esc_attr_x( $text, $context, $domain = 'default' ) {\n\treturn esc_attr( translate_with_gettext_context( $text, $context, $domain ) );\n}\n\n/**\n * Translate string with gettext context, and escapes it for safe use in HTML output.\n *\n * If there is no translation, or the text domain isn't loaded, the original text\n * is escaped and returned.\n *\n * @since 2.9.0\n *\n * @param string $text    Text to translate.\n * @param string $context Context information for the translators.\n * @param string $domain  Optional. Text domain. Unique identifier for retrieving translated strings.\n *                        Default 'default'.\n * @return string Translated text.\n */\nfunction esc_html_x( $text, $context, $domain = 'default' ) {\n\treturn esc_html( translate_with_gettext_context( $text, $context, $domain ) );\n}\n\n/**\n * Translates and retrieves the singular or plural form based on the supplied number.\n *\n * Used when you want to use the appropriate form of a string based on whether a\n * number is singular or plural.\n *\n * Example:\n *\n *     printf( _n( '%s person', '%s people', $count, 'text-domain' ), number_format_i18n( $count ) );\n *\n * @since 2.8.0\n * @since 5.5.0 Introduced ngettext-{$domain} filter.\n *\n * @param string $single The text to be used if the number is singular.\n * @param string $plural The text to be used if the number is plural.\n * @param int    $number The number to compare against to use either the singular or plural form.\n * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.\n *                       Default 'default'.\n * @return string The translated singular or plural form.\n */\nfunction _n( $single, $plural, $number, $domain = 'default' ) {\n\t$translations = get_translations_for_domain( $domain );\n\t$translation  = $translations->translate_plural( $single, $plural, $number );\n\n\t/**\n\t * Filters the singular or plural form of a string.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @param string $translation Translated text.\n\t * @param string $single      The text to be used if the number is singular.\n\t * @param string $plural      The text to be used if the number is plural.\n\t * @param string $number      The number to compare against to use either the singular or plural form.\n\t * @param string $domain      Text domain. Unique identifier for retrieving translated strings.\n\t */\n\t$translation = apply_filters( 'ngettext', $translation, $single, $plural, $number, $domain );\n\n\t/**\n\t * Filters the singular or plural form of a string for a domain.\n\t *\n\t * The dynamic portion of the hook, `$domain`, refers to the text domain.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $translation Translated text.\n\t * @param string $single      The text to be used if the number is singular.\n\t * @param string $plural      The text to be used if the number is plural.\n\t * @param string $number      The number to compare against to use either the singular or plural form.\n\t * @param string $domain      Text domain. Unique identifier for retrieving translated strings.\n\t */\n\t$translation = apply_filters( \"ngettext_{$domain}\", $translation, $single, $plural, $number, $domain );\n\n\treturn $translation;\n}\n\n/**\n * Translates and retrieves the singular or plural form based on the supplied number, with gettext context.\n *\n * This is a hybrid of _n() and _x(). It supports context and plurals.\n *\n * Used when you want to use the appropriate form of a string with context based on whether a\n * number is singular or plural.\n *\n * Example of a generic phrase which is disambiguated via the context parameter:\n *\n *     printf( _nx( '%s group', '%s groups', $people, 'group of people', 'text-domain' ), number_format_i18n( $people ) );\n *     printf( _nx( '%s group', '%s groups', $animals, 'group of animals', 'text-domain' ), number_format_i18n( $animals ) );\n *\n * @since 2.8.0\n * @since 5.5.0 Introduced ngettext_with_context-{$domain} filter.\n *\n * @param string $single  The text to be used if the number is singular.\n * @param string $plural  The text to be used if the number is plural.\n * @param int    $number  The number to compare against to use either the singular or plural form.\n * @param string $context Context information for the translators.\n * @param string $domain  Optional. Text domain. Unique identifier for retrieving translated strings.\n *                        Default 'default'.\n * @return string The translated singular or plural form.\n */\nfunction _nx( $single, $plural, $number, $context, $domain = 'default' ) {\n\t$translations = get_translations_for_domain( $domain );\n\t$translation  = $translations->translate_plural( $single, $plural, $number, $context );\n\n\t/**\n\t * Filters the singular or plural form of a string with gettext context.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $translation Translated text.\n\t * @param string $single      The text to be used if the number is singular.\n\t * @param string $plural      The text to be used if the number is plural.\n\t * @param string $number      The number to compare against to use either the singular or plural form.\n\t * @param string $context     Context information for the translators.\n\t * @param string $domain      Text domain. Unique identifier for retrieving translated strings.\n\t */\n\t$translation = apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain );\n\n\t/**\n\t * Filters the singular or plural form of a string with gettext context for a domain.\n\t *\n\t * The dynamic portion of the hook, `$domain`, refers to the text domain.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $translation Translated text.\n\t * @param string $single      The text to be used if the number is singular.\n\t * @param string $plural      The text to be used if the number is plural.\n\t * @param string $number      The number to compare against to use either the singular or plural form.\n\t * @param string $context     Context information for the translators.\n\t * @param string $domain      Text domain. Unique identifier for retrieving translated strings.\n\t */\n\t$translation = apply_filters( \"ngettext_with_context_{$domain}\", $translation, $single, $plural, $number, $context, $domain );\n\n\treturn $translation;\n}\n\n/**\n * Registers plural strings in POT file, but does not translate them.\n *\n * Used when you want to keep structures with translatable plural\n * strings and use them later when the number is known.\n *\n * Example:\n *\n *     $message = _n_noop( '%s post', '%s posts', 'text-domain' );\n *     ...\n *     printf( translate_nooped_plural( $message, $count, 'text-domain' ), number_format_i18n( $count ) );\n *\n * @since 2.5.0\n *\n * @param string $singular Singular form to be localized.\n * @param string $plural   Plural form to be localized.\n * @param string $domain   Optional. Text domain. Unique identifier for retrieving translated strings.\n *                         Default null.\n * @return array {\n *     Array of translation information for the strings.\n *\n *     @type string $0        Singular form to be localized. No longer used.\n *     @type string $1        Plural form to be localized. No longer used.\n *     @type string $singular Singular form to be localized.\n *     @type string $plural   Plural form to be localized.\n *     @type null   $context  Context information for the translators.\n *     @type string $domain   Text domain.\n * }\n */\nfunction _n_noop( $singular, $plural, $domain = null ) {\n\treturn array(\n\t\t0          => $singular,\n\t\t1          => $plural,\n\t\t'singular' => $singular,\n\t\t'plural'   => $plural,\n\t\t'context'  => null,\n\t\t'domain'   => $domain,\n\t);\n}\n\n/**\n * Registers plural strings with gettext context in POT file, but does not translate them.\n *\n * Used when you want to keep structures with translatable plural\n * strings and use them later when the number is known.\n *\n * Example of a generic phrase which is disambiguated via the context parameter:\n *\n *     $messages = array(\n *          'people'  => _nx_noop( '%s group', '%s groups', 'people', 'text-domain' ),\n *          'animals' => _nx_noop( '%s group', '%s groups', 'animals', 'text-domain' ),\n *     );\n *     ...\n *     $message = $messages[ $type ];\n *     printf( translate_nooped_plural( $message, $count, 'text-domain' ), number_format_i18n( $count ) );\n *\n * @since 2.8.0\n *\n * @param string $singular Singular form to be localized.\n * @param string $plural   Plural form to be localized.\n * @param string $context  Context information for the translators.\n * @param string $domain   Optional. Text domain. Unique identifier for retrieving translated strings.\n *                         Default null.\n * @return array {\n *     Array of translation information for the strings.\n *\n *     @type string $0        Singular form to be localized. No longer used.\n *     @type string $1        Plural form to be localized. No longer used.\n *     @type string $2        Context information for the translators. No longer used.\n *     @type string $singular Singular form to be localized.\n *     @type string $plural   Plural form to be localized.\n *     @type string $context  Context information for the translators.\n *     @type string $domain   Text domain.\n * }\n */\nfunction _nx_noop( $singular, $plural, $context, $domain = null ) {\n\treturn array(\n\t\t0          => $singular,\n\t\t1          => $plural,\n\t\t2          => $context,\n\t\t'singular' => $singular,\n\t\t'plural'   => $plural,\n\t\t'context'  => $context,\n\t\t'domain'   => $domain,\n\t);\n}\n\n/**\n * Translates and retrieves the singular or plural form of a string that's been registered\n * with _n_noop() or _nx_noop().\n *\n * Used when you want to use a translatable plural string once the number is known.\n *\n * Example:\n *\n *     $message = _n_noop( '%s post', '%s posts', 'text-domain' );\n *     ...\n *     printf( translate_nooped_plural( $message, $count, 'text-domain' ), number_format_i18n( $count ) );\n *\n * @since 3.1.0\n *\n * @param array  $nooped_plural Array with singular, plural, and context keys, usually the result of _n_noop() or _nx_noop().\n * @param int    $count         Number of objects.\n * @param string $domain        Optional. Text domain. Unique identifier for retrieving translated strings. If $nooped_plural contains\n *                              a text domain passed to _n_noop() or _nx_noop(), it will override this value. Default 'default'.\n * @return string Either $single or $plural translated text.\n */\nfunction translate_nooped_plural( $nooped_plural, $count, $domain = 'default' ) {\n\tif ( $nooped_plural['domain'] ) {\n\t\t$domain = $nooped_plural['domain'];\n\t}\n\n\tif ( $nooped_plural['context'] ) {\n\t\treturn _nx( $nooped_plural['singular'], $nooped_plural['plural'], $count, $nooped_plural['context'], $domain );\n\t} else {\n\t\treturn _n( $nooped_plural['singular'], $nooped_plural['plural'], $count, $domain );\n\t}\n}\n\n/**\n * Load a .mo file into the text domain $domain.\n *\n * If the text domain already exists, the translations will be merged. If both\n * sets have the same string, the translation from the original value will be taken.\n *\n * On success, the .mo file will be placed in the $l10n global by $domain\n * and will be a MO object.\n *\n * @since 1.5.0\n *\n * @global MO[] $l10n          An array of all currently loaded text domains.\n * @global MO[] $l10n_unloaded An array of all text domains that have been unloaded again.\n *\n * @param string $domain Text domain. Unique identifier for retrieving translated strings.\n * @param string $mofile Path to the .mo file.\n * @return bool True on success, false on failure.\n */\nfunction load_textdomain( $domain, $mofile ) {\n\tglobal $l10n, $l10n_unloaded;\n\n\t$l10n_unloaded = (array) $l10n_unloaded;\n\n\t/**\n\t * Filters whether to override the .mo file loading.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param bool   $override Whether to override the .mo file loading. Default false.\n\t * @param string $domain   Text domain. Unique identifier for retrieving translated strings.\n\t * @param string $mofile   Path to the MO file.\n\t */\n\t$plugin_override = apply_filters( 'override_load_textdomain', false, $domain, $mofile );\n\n\tif ( true === (bool) $plugin_override ) {\n\t\tunset( $l10n_unloaded[ $domain ] );\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Fires before the MO translation file is loaded.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string $domain Text domain. Unique identifier for retrieving translated strings.\n\t * @param string $mofile Path to the .mo file.\n\t */\n\tdo_action( 'load_textdomain', $domain, $mofile );\n\n\t/**\n\t * Filters MO file path for loading translations for a specific text domain.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string $mofile Path to the MO file.\n\t * @param string $domain Text domain. Unique identifier for retrieving translated strings.\n\t */\n\t$mofile = apply_filters( 'load_textdomain_mofile', $mofile, $domain );\n\n\tif ( ! is_readable( $mofile ) ) {\n\t\treturn false;\n\t}\n\n\t$mo = new MO();\n\tif ( ! $mo->import_from_file( $mofile ) ) {\n\t\treturn false;\n\t}\n\n\tif ( isset( $l10n[ $domain ] ) ) {\n\t\t$mo->merge_with( $l10n[ $domain ] );\n\t}\n\n\tunset( $l10n_unloaded[ $domain ] );\n\n\t$l10n[ $domain ] = &$mo;\n\n\treturn true;\n}\n\n/**\n * Unload translations for a text domain.\n *\n * @since 3.0.0\n *\n * @global MO[] $l10n          An array of all currently loaded text domains.\n * @global MO[] $l10n_unloaded An array of all text domains that have been unloaded again.\n *\n * @param string $domain Text domain. Unique identifier for retrieving translated strings.\n * @return bool Whether textdomain was unloaded.\n */\nfunction unload_textdomain( $domain ) {\n\tglobal $l10n, $l10n_unloaded;\n\n\t$l10n_unloaded = (array) $l10n_unloaded;\n\n\t/**\n\t * Filters whether to override the text domain unloading.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param bool   $override Whether to override the text domain unloading. Default false.\n\t * @param string $domain   Text domain. Unique identifier for retrieving translated strings.\n\t */\n\t$plugin_override = apply_filters( 'override_unload_textdomain', false, $domain );\n\n\tif ( $plugin_override ) {\n\t\t$l10n_unloaded[ $domain ] = true;\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Fires before the text domain is unloaded.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $domain Text domain. Unique identifier for retrieving translated strings.\n\t */\n\tdo_action( 'unload_textdomain', $domain );\n\n\tif ( isset( $l10n[ $domain ] ) ) {\n\t\tunset( $l10n[ $domain ] );\n\n\t\t$l10n_unloaded[ $domain ] = true;\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Load default translated strings based on locale.\n *\n * Loads the .mo file in WP_LANG_DIR constant path from WordPress root.\n * The translated (.mo) file is named based on the locale.\n *\n * @see load_textdomain()\n *\n * @since 1.5.0\n *\n * @param string $locale Optional. Locale to load. Default is the value of get_locale().\n * @return bool Whether the textdomain was loaded.\n */\nfunction load_default_textdomain( $locale = null ) {\n\tif ( null === $locale ) {\n\t\t$locale = determine_locale();\n\t}\n\n\t// Unload previously loaded strings so we can switch translations.\n\tunload_textdomain( 'default' );\n\n\t$return = load_textdomain( 'default', WP_LANG_DIR . \"/$locale.mo\" );\n\n\tif ( ( is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) ) && ! file_exists( WP_LANG_DIR . \"/admin-$locale.mo\" ) ) {\n\t\tload_textdomain( 'default', WP_LANG_DIR . \"/ms-$locale.mo\" );\n\t\treturn $return;\n\t}\n\n\tif ( is_admin() || wp_installing() || ( defined( 'WP_REPAIRING' ) && WP_REPAIRING ) ) {\n\t\tload_textdomain( 'default', WP_LANG_DIR . \"/admin-$locale.mo\" );\n\t}\n\n\tif ( is_network_admin() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) ) {\n\t\tload_textdomain( 'default', WP_LANG_DIR . \"/admin-network-$locale.mo\" );\n\t}\n\n\treturn $return;\n}\n\n/**\n * Loads a plugin's translated strings.\n *\n * If the path is not given then it will be the root of the plugin directory.\n *\n * The .mo file should be named based on the text domain with a dash, and then the locale exactly.\n *\n * @since 1.5.0\n * @since 4.6.0 The function now tries to load the .mo file from the languages directory first.\n *\n * @param string       $domain          Unique identifier for retrieving translated strings\n * @param string|false $deprecated      Optional. Deprecated. Use the $plugin_rel_path parameter instead.\n *                                      Default false.\n * @param string|false $plugin_rel_path Optional. Relative path to WP_PLUGIN_DIR where the .mo file resides.\n *                                      Default false.\n * @return bool True when textdomain is successfully loaded, false otherwise.\n */\nfunction load_plugin_textdomain( $domain, $deprecated = false, $plugin_rel_path = false ) {\n\t/**\n\t * Filters a plugin's locale.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $locale The plugin's current locale.\n\t * @param string $domain Text domain. Unique identifier for retrieving translated strings.\n\t */\n\t$locale = apply_filters( 'plugin_locale', determine_locale(), $domain );\n\n\t$mofile = $domain . '-' . $locale . '.mo';\n\n\t// Try to load from the languages directory first.\n\tif ( load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile ) ) {\n\t\treturn true;\n\t}\n\n\tif ( false !== $plugin_rel_path ) {\n\t\t$path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' );\n\t} elseif ( false !== $deprecated ) {\n\t\t_deprecated_argument( __FUNCTION__, '2.7.0' );\n\t\t$path = ABSPATH . trim( $deprecated, '/' );\n\t} else {\n\t\t$path = WP_PLUGIN_DIR;\n\t}\n\n\treturn load_textdomain( $domain, $path . '/' . $mofile );\n}\n\n/**\n * Load the translated strings for a plugin residing in the mu-plugins directory.\n *\n * @since 3.0.0\n * @since 4.6.0 The function now tries to load the .mo file from the languages directory first.\n *\n * @param string $domain             Text domain. Unique identifier for retrieving translated strings.\n * @param string $mu_plugin_rel_path Optional. Relative to `WPMU_PLUGIN_DIR` directory in which the .mo\n *                                   file resides. Default empty string.\n * @return bool True when textdomain is successfully loaded, false otherwise.\n */\nfunction load_muplugin_textdomain( $domain, $mu_plugin_rel_path = '' ) {\n\t/** This filter is documented in wp-includes/l10n.php */\n\t$locale = apply_filters( 'plugin_locale', determine_locale(), $domain );\n\n\t$mofile = $domain . '-' . $locale . '.mo';\n\n\t// Try to load from the languages directory first.\n\tif ( load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile ) ) {\n\t\treturn true;\n\t}\n\n\t$path = WPMU_PLUGIN_DIR . '/' . ltrim( $mu_plugin_rel_path, '/' );\n\n\treturn load_textdomain( $domain, $path . '/' . $mofile );\n}\n\n/**\n * Load the theme's translated strings.\n *\n * If the current locale exists as a .mo file in the theme's root directory, it\n * will be included in the translated strings by the $domain.\n *\n * The .mo files must be named based on the locale exactly.\n *\n * @since 1.5.0\n * @since 4.6.0 The function now tries to load the .mo file from the languages directory first.\n *\n * @param string $domain Text domain. Unique identifier for retrieving translated strings.\n * @param string $path   Optional. Path to the directory containing the .mo file.\n *                       Default false.\n * @return bool True when textdomain is successfully loaded, false otherwise.\n */\nfunction load_theme_textdomain( $domain, $path = false ) {\n\t/**\n\t * Filters a theme's locale.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $locale The theme's current locale.\n\t * @param string $domain Text domain. Unique identifier for retrieving translated strings.\n\t */\n\t$locale = apply_filters( 'theme_locale', determine_locale(), $domain );\n\n\t$mofile = $domain . '-' . $locale . '.mo';\n\n\t// Try to load from the languages directory first.\n\tif ( load_textdomain( $domain, WP_LANG_DIR . '/themes/' . $mofile ) ) {\n\t\treturn true;\n\t}\n\n\tif ( ! $path ) {\n\t\t$path = get_template_directory();\n\t}\n\n\treturn load_textdomain( $domain, $path . '/' . $locale . '.mo' );\n}\n\n/**\n * Load the child themes translated strings.\n *\n * If the current locale exists as a .mo file in the child themes\n * root directory, it will be included in the translated strings by the $domain.\n *\n * The .mo files must be named based on the locale exactly.\n *\n * @since 2.9.0\n *\n * @param string $domain Text domain. Unique identifier for retrieving translated strings.\n * @param string $path   Optional. Path to the directory containing the .mo file.\n *                       Default false.\n * @return bool True when the theme textdomain is successfully loaded, false otherwise.\n */\nfunction load_child_theme_textdomain( $domain, $path = false ) {\n\tif ( ! $path ) {\n\t\t$path = get_stylesheet_directory();\n\t}\n\treturn load_theme_textdomain( $domain, $path );\n}\n\n/**\n * Loads the script translated strings.\n *\n * @since 5.0.0\n * @since 5.0.2 Uses load_script_translations() to load translation data.\n * @since 5.1.0 The `$domain` parameter was made optional.\n *\n * @see WP_Scripts::set_translations()\n *\n * @param string $handle Name of the script to register a translation domain to.\n * @param string $domain Optional. Text domain. Default 'default'.\n * @param string $path   Optional. The full file path to the directory containing translation files.\n * @return string|false False if the script textdomain could not be loaded, the translated strings\n *                      in JSON encoding otherwise.\n */\nfunction load_script_textdomain( $handle, $domain = 'default', $path = null ) {\n\t$wp_scripts = wp_scripts();\n\n\tif ( ! isset( $wp_scripts->registered[ $handle ] ) ) {\n\t\treturn false;\n\t}\n\n\t$path   = untrailingslashit( $path );\n\t$locale = determine_locale();\n\n\t// If a path was given and the handle file exists simply return it.\n\t$file_base       = 'default' === $domain ? $locale : $domain . '-' . $locale;\n\t$handle_filename = $file_base . '-' . $handle . '.json';\n\n\tif ( $path ) {\n\t\t$translations = load_script_translations( $path . '/' . $handle_filename, $handle, $domain );\n\n\t\tif ( $translations ) {\n\t\t\treturn $translations;\n\t\t}\n\t}\n\n\t$src = $wp_scripts->registered[ $handle ]->src;\n\n\tif ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $wp_scripts->content_url && 0 === strpos( $src, $wp_scripts->content_url ) ) ) {\n\t\t$src = $wp_scripts->base_url . $src;\n\t}\n\n\t$relative       = false;\n\t$languages_path = WP_LANG_DIR;\n\n\t$src_url     = wp_parse_url( $src );\n\t$content_url = wp_parse_url( content_url() );\n\t$plugins_url = wp_parse_url( plugins_url() );\n\t$site_url    = wp_parse_url( site_url() );\n\n\t// If the host is the same or it's a relative URL.\n\tif (\n\t\t( ! isset( $content_url['path'] ) || strpos( $src_url['path'], $content_url['path'] ) === 0 ) &&\n\t\t( ! isset( $src_url['host'] ) || $src_url['host'] === $content_url['host'] )\n\t) {\n\t\t// Make the src relative the specific plugin or theme.\n\t\tif ( isset( $content_url['path'] ) ) {\n\t\t\t$relative = substr( $src_url['path'], strlen( $content_url['path'] ) );\n\t\t} else {\n\t\t\t$relative = $src_url['path'];\n\t\t}\n\t\t$relative = trim( $relative, '/' );\n\t\t$relative = explode( '/', $relative );\n\n\t\t$languages_path = WP_LANG_DIR . '/' . $relative[0];\n\n\t\t$relative = array_slice( $relative, 2 ); // Remove plugins/<plugin name> or themes/<theme name>.\n\t\t$relative = implode( '/', $relative );\n\t} elseif (\n\t\t( ! isset( $plugins_url['path'] ) || strpos( $src_url['path'], $plugins_url['path'] ) === 0 ) &&\n\t\t( ! isset( $src_url['host'] ) || $src_url['host'] === $plugins_url['host'] )\n\t) {\n\t\t// Make the src relative the specific plugin.\n\t\tif ( isset( $plugins_url['path'] ) ) {\n\t\t\t$relative = substr( $src_url['path'], strlen( $plugins_url['path'] ) );\n\t\t} else {\n\t\t\t$relative = $src_url['path'];\n\t\t}\n\t\t$relative = trim( $relative, '/' );\n\t\t$relative = explode( '/', $relative );\n\n\t\t$languages_path = WP_LANG_DIR . '/plugins';\n\n\t\t$relative = array_slice( $relative, 1 ); // Remove <plugin name>.\n\t\t$relative = implode( '/', $relative );\n\t} elseif ( ! isset( $src_url['host'] ) || $src_url['host'] === $site_url['host'] ) {\n\t\tif ( ! isset( $site_url['path'] ) ) {\n\t\t\t$relative = trim( $src_url['path'], '/' );\n\t\t} elseif ( ( strpos( $src_url['path'], trailingslashit( $site_url['path'] ) ) === 0 ) ) {\n\t\t\t// Make the src relative to the WP root.\n\t\t\t$relative = substr( $src_url['path'], strlen( $site_url['path'] ) );\n\t\t\t$relative = trim( $relative, '/' );\n\t\t}\n\t}\n\n\t/**\n\t * Filters the relative path of scripts used for finding translation files.\n\t *\n\t * @since 5.0.2\n\t *\n\t * @param string|false $relative The relative path of the script. False if it could not be determined.\n\t * @param string       $src      The full source URL of the script.\n\t */\n\t$relative = apply_filters( 'load_script_textdomain_relative_path', $relative, $src );\n\n\t// If the source is not from WP.\n\tif ( false === $relative ) {\n\t\treturn load_script_translations( false, $handle, $domain );\n\t}\n\n\t// Translations are always based on the unminified filename.\n\tif ( substr( $relative, -7 ) === '.min.js' ) {\n\t\t$relative = substr( $relative, 0, -7 ) . '.js';\n\t}\n\n\t$md5_filename = $file_base . '-' . md5( $relative ) . '.json';\n\n\tif ( $path ) {\n\t\t$translations = load_script_translations( $path . '/' . $md5_filename, $handle, $domain );\n\n\t\tif ( $translations ) {\n\t\t\treturn $translations;\n\t\t}\n\t}\n\n\t$translations = load_script_translations( $languages_path . '/' . $md5_filename, $handle, $domain );\n\n\tif ( $translations ) {\n\t\treturn $translations;\n\t}\n\n\treturn load_script_translations( false, $handle, $domain );\n}\n\n/**\n * Loads the translation data for the given script handle and text domain.\n *\n * @since 5.0.2\n *\n * @param string|false $file   Path to the translation file to load. False if there isn't one.\n * @param string       $handle Name of the script to register a translation domain to.\n * @param string       $domain The text domain.\n * @return string|false The JSON-encoded translated strings for the given script handle and text domain. False if there are none.\n */\nfunction load_script_translations( $file, $handle, $domain ) {\n\t/**\n\t * Pre-filters script translations for the given file, script handle and text domain.\n\t *\n\t * Returning a non-null value allows to override the default logic, effectively short-circuiting the function.\n\t *\n\t * @since 5.0.2\n\t *\n\t * @param string|false|null $translations JSON-encoded translation data. Default null.\n\t * @param string|false      $file         Path to the translation file to load. False if there isn't one.\n\t * @param string            $handle       Name of the script to register a translation domain to.\n\t * @param string            $domain       The text domain.\n\t */\n\t$translations = apply_filters( 'pre_load_script_translations', null, $file, $handle, $domain );\n\n\tif ( null !== $translations ) {\n\t\treturn $translations;\n\t}\n\n\t/**\n\t * Filters the file path for loading script translations for the given script handle and text domain.\n\t *\n\t * @since 5.0.2\n\t *\n\t * @param string|false $file   Path to the translation file to load. False if there isn't one.\n\t * @param string       $handle Name of the script to register a translation domain to.\n\t * @param string       $domain The text domain.\n\t */\n\t$file = apply_filters( 'load_script_translation_file', $file, $handle, $domain );\n\n\tif ( ! $file || ! is_readable( $file ) ) {\n\t\treturn false;\n\t}\n\n\t$translations = file_get_contents( $file );\n\n\t/**\n\t * Filters script translations for the given file, script handle and text domain.\n\t *\n\t * @since 5.0.2\n\t *\n\t * @param string $translations JSON-encoded translation data.\n\t * @param string $file         Path to the translation file that was loaded.\n\t * @param string $handle       Name of the script to register a translation domain to.\n\t * @param string $domain       The text domain.\n\t */\n\treturn apply_filters( 'load_script_translations', $translations, $file, $handle, $domain );\n}\n\n/**\n * Loads plugin and theme textdomains just-in-time.\n *\n * When a textdomain is encountered for the first time, we try to load\n * the translation file from `wp-content/languages`, removing the need\n * to call load_plugin_texdomain() or load_theme_texdomain().\n *\n * @since 4.6.0\n * @access private\n *\n * @see get_translations_for_domain()\n * @global MO[] $l10n_unloaded An array of all text domains that have been unloaded again.\n *\n * @param string $domain Text domain. Unique identifier for retrieving translated strings.\n * @return bool True when the textdomain is successfully loaded, false otherwise.\n */\nfunction _load_textdomain_just_in_time( $domain ) {\n\tglobal $l10n_unloaded;\n\n\t$l10n_unloaded = (array) $l10n_unloaded;\n\n\t// Short-circuit if domain is 'default' which is reserved for core.\n\tif ( 'default' === $domain || isset( $l10n_unloaded[ $domain ] ) ) {\n\t\treturn false;\n\t}\n\n\t$translation_path = _get_path_to_translation( $domain );\n\tif ( false === $translation_path ) {\n\t\treturn false;\n\t}\n\n\treturn load_textdomain( $domain, $translation_path );\n}\n\n/**\n * Gets the path to a translation file for loading a textdomain just in time.\n *\n * Caches the retrieved results internally.\n *\n * @since 4.7.0\n * @access private\n *\n * @see _load_textdomain_just_in_time()\n *\n * @param string $domain Text domain. Unique identifier for retrieving translated strings.\n * @param bool   $reset  Whether to reset the internal cache. Used by the switch to locale functionality.\n * @return string|false The path to the translation file or false if no translation file was found.\n */\nfunction _get_path_to_translation( $domain, $reset = false ) {\n\tstatic $available_translations = array();\n\n\tif ( true === $reset ) {\n\t\t$available_translations = array();\n\t}\n\n\tif ( ! isset( $available_translations[ $domain ] ) ) {\n\t\t$available_translations[ $domain ] = _get_path_to_translation_from_lang_dir( $domain );\n\t}\n\n\treturn $available_translations[ $domain ];\n}\n\n/**\n * Gets the path to a translation file in the languages directory for the current locale.\n *\n * Holds a cached list of available .mo files to improve performance.\n *\n * @since 4.7.0\n * @access private\n *\n * @see _get_path_to_translation()\n *\n * @param string $domain Text domain. Unique identifier for retrieving translated strings.\n * @return string|false The path to the translation file or false if no translation file was found.\n */\nfunction _get_path_to_translation_from_lang_dir( $domain ) {\n\tstatic $cached_mofiles = null;\n\n\tif ( null === $cached_mofiles ) {\n\t\t$cached_mofiles = array();\n\n\t\t$locations = array(\n\t\t\tWP_LANG_DIR . '/plugins',\n\t\t\tWP_LANG_DIR . '/themes',\n\t\t);\n\n\t\tforeach ( $locations as $location ) {\n\t\t\t$mofiles = glob( $location . '/*.mo' );\n\t\t\tif ( $mofiles ) {\n\t\t\t\t$cached_mofiles = array_merge( $cached_mofiles, $mofiles );\n\t\t\t}\n\t\t}\n\t}\n\n\t$locale = determine_locale();\n\t$mofile = \"{$domain}-{$locale}.mo\";\n\n\t$path = WP_LANG_DIR . '/plugins/' . $mofile;\n\tif ( in_array( $path, $cached_mofiles, true ) ) {\n\t\treturn $path;\n\t}\n\n\t$path = WP_LANG_DIR . '/themes/' . $mofile;\n\tif ( in_array( $path, $cached_mofiles, true ) ) {\n\t\treturn $path;\n\t}\n\n\treturn false;\n}\n\n/**\n * Return the Translations instance for a text domain.\n *\n * If there isn't one, returns empty Translations instance.\n *\n * @since 2.8.0\n *\n * @global MO[] $l10n\n *\n * @param string $domain Text domain. Unique identifier for retrieving translated strings.\n * @return Translations|NOOP_Translations A Translations instance.\n */\nfunction get_translations_for_domain( $domain ) {\n\tglobal $l10n;\n\tif ( isset( $l10n[ $domain ] ) || ( _load_textdomain_just_in_time( $domain ) && isset( $l10n[ $domain ] ) ) ) {\n\t\treturn $l10n[ $domain ];\n\t}\n\n\tstatic $noop_translations = null;\n\tif ( null === $noop_translations ) {\n\t\t$noop_translations = new NOOP_Translations;\n\t}\n\n\treturn $noop_translations;\n}\n\n/**\n * Whether there are translations for the text domain.\n *\n * @since 3.0.0\n *\n * @global MO[] $l10n\n *\n * @param string $domain Text domain. Unique identifier for retrieving translated strings.\n * @return bool Whether there are translations.\n */\nfunction is_textdomain_loaded( $domain ) {\n\tglobal $l10n;\n\treturn isset( $l10n[ $domain ] );\n}\n\n/**\n * Translates role name.\n *\n * Since the role names are in the database and not in the source there\n * are dummy gettext calls to get them into the POT file and this function\n * properly translates them back.\n *\n * The before_last_bar() call is needed, because older installations keep the roles\n * using the old context format: 'Role name|User role' and just skipping the\n * content after the last bar is easier than fixing them in the DB. New installations\n * won't suffer from that problem.\n *\n * @since 2.8.0\n * @since 5.2.0 Added the `$domain` parameter.\n *\n * @param string $name   The role name.\n * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.\n *                       Default 'default'.\n * @return string Translated role name on success, original name on failure.\n */\nfunction translate_user_role( $name, $domain = 'default' ) {\n\treturn translate_with_gettext_context( before_last_bar( $name ), 'User role', $domain );\n}\n\n/**\n * Get all available languages based on the presence of *.mo files in a given directory.\n *\n * The default directory is WP_LANG_DIR.\n *\n * @since 3.0.0\n * @since 4.7.0 The results are now filterable with the {@see 'get_available_languages'} filter.\n *\n * @param string $dir A directory to search for language files.\n *                    Default WP_LANG_DIR.\n * @return string[] An array of language codes or an empty array if no languages are present. Language codes are formed by stripping the .mo extension from the language file names.\n */\nfunction get_available_languages( $dir = null ) {\n\t$languages = array();\n\n\t$lang_files = glob( ( is_null( $dir ) ? WP_LANG_DIR : $dir ) . '/*.mo' );\n\tif ( $lang_files ) {\n\t\tforeach ( $lang_files as $lang_file ) {\n\t\t\t$lang_file = basename( $lang_file, '.mo' );\n\t\t\tif ( 0 !== strpos( $lang_file, 'continents-cities' ) && 0 !== strpos( $lang_file, 'ms-' ) &&\n\t\t\t\t0 !== strpos( $lang_file, 'admin-' ) ) {\n\t\t\t\t$languages[] = $lang_file;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filters the list of available language codes.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string[] $languages An array of available language codes.\n\t * @param string   $dir       The directory where the language files were found.\n\t */\n\treturn apply_filters( 'get_available_languages', $languages, $dir );\n}\n\n/**\n * Get installed translations.\n *\n * Looks in the wp-content/languages directory for translations of\n * plugins or themes.\n *\n * @since 3.7.0\n *\n * @param string $type What to search for. Accepts 'plugins', 'themes', 'core'.\n * @return array Array of language data.\n */\nfunction wp_get_installed_translations( $type ) {\n\tif ( 'themes' !== $type && 'plugins' !== $type && 'core' !== $type ) {\n\t\treturn array();\n\t}\n\n\t$dir = 'core' === $type ? '' : \"/$type\";\n\n\tif ( ! is_dir( WP_LANG_DIR ) ) {\n\t\treturn array();\n\t}\n\n\tif ( $dir && ! is_dir( WP_LANG_DIR . $dir ) ) {\n\t\treturn array();\n\t}\n\n\t$files = scandir( WP_LANG_DIR . $dir );\n\tif ( ! $files ) {\n\t\treturn array();\n\t}\n\n\t$language_data = array();\n\n\tforeach ( $files as $file ) {\n\t\tif ( '.' === $file[0] || is_dir( WP_LANG_DIR . \"$dir/$file\" ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( substr( $file, -3 ) !== '.po' ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( ! preg_match( '/(?:(.+)-)?([a-z]{2,3}(?:_[A-Z]{2})?(?:_[a-z0-9]+)?).po/', $file, $match ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( ! in_array( substr( $file, 0, -3 ) . '.mo', $files, true ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlist( , $textdomain, $language ) = $match;\n\t\tif ( '' === $textdomain ) {\n\t\t\t$textdomain = 'default';\n\t\t}\n\t\t$language_data[ $textdomain ][ $language ] = wp_get_pomo_file_data( WP_LANG_DIR . \"$dir/$file\" );\n\t}\n\treturn $language_data;\n}\n\n/**\n * Extract headers from a PO file.\n *\n * @since 3.7.0\n *\n * @param string $po_file Path to PO file.\n * @return string[] Array of PO file header values keyed by header name.\n */\nfunction wp_get_pomo_file_data( $po_file ) {\n\t$headers = get_file_data(\n\t\t$po_file,\n\t\tarray(\n\t\t\t'POT-Creation-Date'  => '\"POT-Creation-Date',\n\t\t\t'PO-Revision-Date'   => '\"PO-Revision-Date',\n\t\t\t'Project-Id-Version' => '\"Project-Id-Version',\n\t\t\t'X-Generator'        => '\"X-Generator',\n\t\t)\n\t);\n\tforeach ( $headers as $header => $value ) {\n\t\t// Remove possible contextual '\\n' and closing double quote.\n\t\t$headers[ $header ] = preg_replace( '~(\\\\\\n)?\"$~', '', $value );\n\t}\n\treturn $headers;\n}\n\n/**\n * Language selector.\n *\n * @since 4.0.0\n * @since 4.3.0 Introduced the `echo` argument.\n * @since 4.7.0 Introduced the `show_option_site_default` argument.\n * @since 5.1.0 Introduced the `show_option_en_us` argument.\n *\n * @see get_available_languages()\n * @see wp_get_available_translations()\n *\n * @param string|array $args {\n *     Optional. Array or string of arguments for outputting the language selector.\n *\n *     @type string   $id                           ID attribute of the select element. Default 'locale'.\n *     @type string   $name                         Name attribute of the select element. Default 'locale'.\n *     @type array    $languages                    List of installed languages, contain only the locales.\n *                                                  Default empty array.\n *     @type array    $translations                 List of available translations. Default result of\n *                                                  wp_get_available_translations().\n *     @type string   $selected                     Language which should be selected. Default empty.\n *     @type bool|int $echo                         Whether to echo the generated markup. Accepts 0, 1, or their\n *                                                  boolean equivalents. Default 1.\n *     @type bool     $show_available_translations  Whether to show available translations. Default true.\n *     @type bool     $show_option_site_default     Whether to show an option to fall back to the site's locale. Default false.\n *     @type bool     $show_option_en_us            Whether to show an option for English (United States). Default true.\n * }\n * @return string HTML dropdown list of languages.\n */\nfunction wp_dropdown_languages( $args = array() ) {\n\n\t$parsed_args = wp_parse_args(\n\t\t$args,\n\t\tarray(\n\t\t\t'id'                          => 'locale',\n\t\t\t'name'                        => 'locale',\n\t\t\t'languages'                   => array(),\n\t\t\t'translations'                => array(),\n\t\t\t'selected'                    => '',\n\t\t\t'echo'                        => 1,\n\t\t\t'show_available_translations' => true,\n\t\t\t'show_option_site_default'    => false,\n\t\t\t'show_option_en_us'           => true,\n\t\t)\n\t);\n\n\t// Bail if no ID or no name.\n\tif ( ! $parsed_args['id'] || ! $parsed_args['name'] ) {\n\t\treturn;\n\t}\n\n\t// English (United States) uses an empty string for the value attribute.\n\tif ( 'en_US' === $parsed_args['selected'] ) {\n\t\t$parsed_args['selected'] = '';\n\t}\n\n\t$translations = $parsed_args['translations'];\n\tif ( empty( $translations ) ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/translation-install.php';\n\t\t$translations = wp_get_available_translations();\n\t}\n\n\t/*\n\t * $parsed_args['languages'] should only contain the locales. Find the locale in\n\t * $translations to get the native name. Fall back to locale.\n\t */\n\t$languages = array();\n\tforeach ( $parsed_args['languages'] as $locale ) {\n\t\tif ( isset( $translations[ $locale ] ) ) {\n\t\t\t$translation = $translations[ $locale ];\n\t\t\t$languages[] = array(\n\t\t\t\t'language'    => $translation['language'],\n\t\t\t\t'native_name' => $translation['native_name'],\n\t\t\t\t'lang'        => current( $translation['iso'] ),\n\t\t\t);\n\n\t\t\t// Remove installed language from available translations.\n\t\t\tunset( $translations[ $locale ] );\n\t\t} else {\n\t\t\t$languages[] = array(\n\t\t\t\t'language'    => $locale,\n\t\t\t\t'native_name' => $locale,\n\t\t\t\t'lang'        => '',\n\t\t\t);\n\t\t}\n\t}\n\n\t$translations_available = ( ! empty( $translations ) && $parsed_args['show_available_translations'] );\n\n\t// Holds the HTML markup.\n\t$structure = array();\n\n\t// List installed languages.\n\tif ( $translations_available ) {\n\t\t$structure[] = '<optgroup label=\"' . esc_attr_x( 'Installed', 'translations' ) . '\">';\n\t}\n\n\t// Site default.\n\tif ( $parsed_args['show_option_site_default'] ) {\n\t\t$structure[] = sprintf(\n\t\t\t'<option value=\"site-default\" data-installed=\"1\"%s>%s</option>',\n\t\t\tselected( 'site-default', $parsed_args['selected'], false ),\n\t\t\t_x( 'Site Default', 'default site language' )\n\t\t);\n\t}\n\n\tif ( $parsed_args['show_option_en_us'] ) {\n\t\t$structure[] = sprintf(\n\t\t\t'<option value=\"\" lang=\"en\" data-installed=\"1\"%s>English (United States)</option>',\n\t\t\tselected( '', $parsed_args['selected'], false )\n\t\t);\n\t}\n\n\t// List installed languages.\n\tforeach ( $languages as $language ) {\n\t\t$structure[] = sprintf(\n\t\t\t'<option value=\"%s\" lang=\"%s\"%s data-installed=\"1\">%s</option>',\n\t\t\tesc_attr( $language['language'] ),\n\t\t\tesc_attr( $language['lang'] ),\n\t\t\tselected( $language['language'], $parsed_args['selected'], false ),\n\t\t\tesc_html( $language['native_name'] )\n\t\t);\n\t}\n\tif ( $translations_available ) {\n\t\t$structure[] = '</optgroup>';\n\t}\n\n\t// List available translations.\n\tif ( $translations_available ) {\n\t\t$structure[] = '<optgroup label=\"' . esc_attr_x( 'Available', 'translations' ) . '\">';\n\t\tforeach ( $translations as $translation ) {\n\t\t\t$structure[] = sprintf(\n\t\t\t\t'<option value=\"%s\" lang=\"%s\"%s>%s</option>',\n\t\t\t\tesc_attr( $translation['language'] ),\n\t\t\t\tesc_attr( current( $translation['iso'] ) ),\n\t\t\t\tselected( $translation['language'], $parsed_args['selected'], false ),\n\t\t\t\tesc_html( $translation['native_name'] )\n\t\t\t);\n\t\t}\n\t\t$structure[] = '</optgroup>';\n\t}\n\n\t// Combine the output string.\n\t$output  = sprintf( '<select name=\"%s\" id=\"%s\">', esc_attr( $parsed_args['name'] ), esc_attr( $parsed_args['id'] ) );\n\t$output .= join( \"\\n\", $structure );\n\t$output .= '</select>';\n\n\tif ( $parsed_args['echo'] ) {\n\t\techo $output;\n\t}\n\n\treturn $output;\n}\n\n/**\n * Determines whether the current locale is right-to-left (RTL).\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 3.0.0\n *\n * @global WP_Locale $wp_locale WordPress date and time locale object.\n *\n * @return bool Whether locale is RTL.\n */\nfunction is_rtl() {\n\tglobal $wp_locale;\n\tif ( ! ( $wp_locale instanceof WP_Locale ) ) {\n\t\treturn false;\n\t}\n\treturn $wp_locale->is_rtl();\n}\n\n/**\n * Switches the translations according to the given locale.\n *\n * @since 4.7.0\n *\n * @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.\n *\n * @param string $locale The locale.\n * @return bool True on success, false on failure.\n */\nfunction switch_to_locale( $locale ) {\n\t/* @var WP_Locale_Switcher $wp_locale_switcher */\n\tglobal $wp_locale_switcher;\n\n\treturn $wp_locale_switcher->switch_to_locale( $locale );\n}\n\n/**\n * Restores the translations according to the previous locale.\n *\n * @since 4.7.0\n *\n * @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.\n *\n * @return string|false Locale on success, false on error.\n */\nfunction restore_previous_locale() {\n\t/* @var WP_Locale_Switcher $wp_locale_switcher */\n\tglobal $wp_locale_switcher;\n\n\treturn $wp_locale_switcher->restore_previous_locale();\n}\n\n/**\n * Restores the translations according to the original locale.\n *\n * @since 4.7.0\n *\n * @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.\n *\n * @return string|false Locale on success, false on error.\n */\nfunction restore_current_locale() {\n\t/* @var WP_Locale_Switcher $wp_locale_switcher */\n\tglobal $wp_locale_switcher;\n\n\treturn $wp_locale_switcher->restore_current_locale();\n}\n\n/**\n * Whether switch_to_locale() is in effect.\n *\n * @since 4.7.0\n *\n * @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.\n *\n * @return bool True if the locale has been switched, false otherwise.\n */\nfunction is_locale_switched() {\n\t/* @var WP_Locale_Switcher $wp_locale_switcher */\n\tglobal $wp_locale_switcher;\n\n\treturn $wp_locale_switcher->is_switched();\n}\n", "num_lines": 1715}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Link Template Functions\n *\n * @package WordPress\n * @subpackage Template\n */\n\n/**\n * Displays the permalink for the current post.\n *\n * @since 1.2.0\n * @since 4.4.0 Added the `$post` parameter.\n *\n * @param int|WP_Post $post Optional. Post ID or post object. Default is the global `$post`.\n */\nfunction the_permalink( $post = 0 ) {\n\t/**\n\t * Filters the display of the permalink for the current post.\n\t *\n\t * @since 1.5.0\n\t * @since 4.4.0 Added the `$post` parameter.\n\t *\n\t * @param string      $permalink The permalink for the current post.\n\t * @param int|WP_Post $post      Post ID, WP_Post object, or 0. Default 0.\n\t */\n\techo esc_url( apply_filters( 'the_permalink', get_permalink( $post ), $post ) );\n}\n\n/**\n * Retrieves a trailing-slashed string if the site is set for adding trailing slashes.\n *\n * Conditionally adds a trailing slash if the permalink structure has a trailing\n * slash, strips the trailing slash if not. The string is passed through the\n * {@see 'user_trailingslashit'} filter. Will remove trailing slash from string, if\n * site is not set to have them.\n *\n * @since 2.2.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string $string      URL with or without a trailing slash.\n * @param string $type_of_url Optional. The type of URL being considered (e.g. single, category, etc)\n *                            for use in the filter. Default empty string.\n * @return string The URL with the trailing slash appended or stripped.\n */\nfunction user_trailingslashit( $string, $type_of_url = '' ) {\n\tglobal $wp_rewrite;\n\tif ( $wp_rewrite->use_trailing_slashes ) {\n\t\t$string = trailingslashit( $string );\n\t} else {\n\t\t$string = untrailingslashit( $string );\n\t}\n\n\t/**\n\t * Filters the trailing-slashed string, depending on whether the site is set to use trailing slashes.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @param string $string      URL with or without a trailing slash.\n\t * @param string $type_of_url The type of URL being considered. Accepts 'single', 'single_trackback',\n\t *                            'single_feed', 'single_paged', 'commentpaged', 'paged', 'home', 'feed',\n\t *                            'category', 'page', 'year', 'month', 'day', 'post_type_archive'.\n\t */\n\treturn apply_filters( 'user_trailingslashit', $string, $type_of_url );\n}\n\n/**\n * Displays the permalink anchor for the current post.\n *\n * The permalink mode title will use the post title for the 'a' element 'id'\n * attribute. The id mode uses 'post-' with the post ID for the 'id' attribute.\n *\n * @since 0.71\n *\n * @param string $mode Optional. Permalink mode. Accepts 'title' or 'id'. Default 'id'.\n */\nfunction permalink_anchor( $mode = 'id' ) {\n\t$post = get_post();\n\tswitch ( strtolower( $mode ) ) {\n\t\tcase 'title':\n\t\t\t$title = sanitize_title( $post->post_title ) . '-' . $post->ID;\n\t\t\techo '<a id=\"' . $title . '\"></a>';\n\t\t\tbreak;\n\t\tcase 'id':\n\t\tdefault:\n\t\t\techo '<a id=\"post-' . $post->ID . '\"></a>';\n\t\t\tbreak;\n\t}\n}\n\n/**\n * Retrieves the full permalink for the current post or post ID.\n *\n * This function is an alias for get_permalink().\n *\n * @since 3.9.0\n *\n * @see get_permalink()\n *\n * @param int|WP_Post $post      Optional. Post ID or post object. Default is the global `$post`.\n * @param bool        $leavename Optional. Whether to keep post name or page name. Default false.\n * @return string|false The permalink URL or false if post does not exist.\n */\nfunction get_the_permalink( $post = 0, $leavename = false ) {\n\treturn get_permalink( $post, $leavename );\n}\n\n/**\n * Retrieves the full permalink for the current post or post ID.\n *\n * @since 1.0.0\n *\n * @param int|WP_Post $post      Optional. Post ID or post object. Default is the global `$post`.\n * @param bool        $leavename Optional. Whether to keep post name or page name. Default false.\n * @return string|false The permalink URL or false if post does not exist.\n */\nfunction get_permalink( $post = 0, $leavename = false ) {\n\t$rewritecode = array(\n\t\t'%year%',\n\t\t'%monthnum%',\n\t\t'%day%',\n\t\t'%hour%',\n\t\t'%minute%',\n\t\t'%second%',\n\t\t$leavename ? '' : '%postname%',\n\t\t'%post_id%',\n\t\t'%category%',\n\t\t'%author%',\n\t\t$leavename ? '' : '%pagename%',\n\t);\n\n\tif ( is_object( $post ) && isset( $post->filter ) && 'sample' === $post->filter ) {\n\t\t$sample = true;\n\t} else {\n\t\t$post   = get_post( $post );\n\t\t$sample = false;\n\t}\n\n\tif ( empty( $post->ID ) ) {\n\t\treturn false;\n\t}\n\n\tif ( 'page' === $post->post_type ) {\n\t\treturn get_page_link( $post, $leavename, $sample );\n\t} elseif ( 'attachment' === $post->post_type ) {\n\t\treturn get_attachment_link( $post, $leavename );\n\t} elseif ( in_array( $post->post_type, get_post_types( array( '_builtin' => false ) ), true ) ) {\n\t\treturn get_post_permalink( $post, $leavename, $sample );\n\t}\n\n\t$permalink = get_option( 'permalink_structure' );\n\n\t/**\n\t * Filters the permalink structure for a post before token replacement occurs.\n\t *\n\t * Only applies to posts with post_type of 'post'.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string  $permalink The site's permalink structure.\n\t * @param WP_Post $post      The post in question.\n\t * @param bool    $leavename Whether to keep the post name.\n\t */\n\t$permalink = apply_filters( 'pre_post_link', $permalink, $post, $leavename );\n\n\tif ( $permalink && ! in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ), true ) ) {\n\n\t\t$category = '';\n\t\tif ( strpos( $permalink, '%category%' ) !== false ) {\n\t\t\t$cats = get_the_category( $post->ID );\n\t\t\tif ( $cats ) {\n\t\t\t\t$cats = wp_list_sort(\n\t\t\t\t\t$cats,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'term_id' => 'ASC',\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t/**\n\t\t\t\t * Filters the category that gets used in the %category% permalink token.\n\t\t\t\t *\n\t\t\t\t * @since 3.5.0\n\t\t\t\t *\n\t\t\t\t * @param WP_Term  $cat  The category to use in the permalink.\n\t\t\t\t * @param array    $cats Array of all categories (WP_Term objects) associated with the post.\n\t\t\t\t * @param WP_Post  $post The post in question.\n\t\t\t\t */\n\t\t\t\t$category_object = apply_filters( 'post_link_category', $cats[0], $cats, $post );\n\n\t\t\t\t$category_object = get_term( $category_object, 'category' );\n\t\t\t\t$category        = $category_object->slug;\n\t\t\t\tif ( $category_object->parent ) {\n\t\t\t\t\t$category = get_category_parents( $category_object->parent, false, '/', true ) . $category;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Show default category in permalinks,\n\t\t\t// without having to assign it explicitly.\n\t\t\tif ( empty( $category ) ) {\n\t\t\t\t$default_category = get_term( get_option( 'default_category' ), 'category' );\n\t\t\t\tif ( $default_category && ! is_wp_error( $default_category ) ) {\n\t\t\t\t\t$category = $default_category->slug;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$author = '';\n\t\tif ( strpos( $permalink, '%author%' ) !== false ) {\n\t\t\t$authordata = get_userdata( $post->post_author );\n\t\t\t$author     = $authordata->user_nicename;\n\t\t}\n\n\t\t// This is not an API call because the permalink is based on the stored post_date value,\n\t\t// which should be parsed as local time regardless of the default PHP timezone.\n\t\t$date = explode( ' ', str_replace( array( '-', ':' ), ' ', $post->post_date ) );\n\n\t\t$rewritereplace = array(\n\t\t\t$date[0],\n\t\t\t$date[1],\n\t\t\t$date[2],\n\t\t\t$date[3],\n\t\t\t$date[4],\n\t\t\t$date[5],\n\t\t\t$post->post_name,\n\t\t\t$post->ID,\n\t\t\t$category,\n\t\t\t$author,\n\t\t\t$post->post_name,\n\t\t);\n\n\t\t$permalink = home_url( str_replace( $rewritecode, $rewritereplace, $permalink ) );\n\t\t$permalink = user_trailingslashit( $permalink, 'single' );\n\n\t} else { // If they're not using the fancy permalink option.\n\t\t$permalink = home_url( '?p=' . $post->ID );\n\t}\n\n\t/**\n\t * Filters the permalink for a post.\n\t *\n\t * Only applies to posts with post_type of 'post'.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string  $permalink The post's permalink.\n\t * @param WP_Post $post      The post in question.\n\t * @param bool    $leavename Whether to keep the post name.\n\t */\n\treturn apply_filters( 'post_link', $permalink, $post, $leavename );\n}\n\n/**\n * Retrieves the permalink for a post of a custom post type.\n *\n * @since 3.0.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param int|WP_Post $id        Optional. Post ID or post object. Default is the global `$post`.\n * @param bool        $leavename Optional. Whether to keep post name. Default false.\n * @param bool        $sample    Optional. Is it a sample permalink. Default false.\n * @return string|WP_Error The post permalink.\n */\nfunction get_post_permalink( $id = 0, $leavename = false, $sample = false ) {\n\tglobal $wp_rewrite;\n\n\t$post = get_post( $id );\n\n\tif ( is_wp_error( $post ) ) {\n\t\treturn $post;\n\t}\n\n\t$post_link = $wp_rewrite->get_extra_permastruct( $post->post_type );\n\n\t$slug = $post->post_name;\n\n\t$draft_or_pending = get_post_status( $post ) && in_array( get_post_status( $post ), array( 'draft', 'pending', 'auto-draft', 'future' ), true );\n\n\t$post_type = get_post_type_object( $post->post_type );\n\n\tif ( $post_type->hierarchical ) {\n\t\t$slug = get_page_uri( $post );\n\t}\n\n\tif ( ! empty( $post_link ) && ( ! $draft_or_pending || $sample ) ) {\n\t\tif ( ! $leavename ) {\n\t\t\t$post_link = str_replace( \"%$post->post_type%\", $slug, $post_link );\n\t\t}\n\t\t$post_link = home_url( user_trailingslashit( $post_link ) );\n\t} else {\n\t\tif ( $post_type->query_var && ( isset( $post->post_status ) && ! $draft_or_pending ) ) {\n\t\t\t$post_link = add_query_arg( $post_type->query_var, $slug, '' );\n\t\t} else {\n\t\t\t$post_link = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'post_type' => $post->post_type,\n\t\t\t\t\t'p'         => $post->ID,\n\t\t\t\t),\n\t\t\t\t''\n\t\t\t);\n\t\t}\n\t\t$post_link = home_url( $post_link );\n\t}\n\n\t/**\n\t * Filters the permalink for a post of a custom post type.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string  $post_link The post's permalink.\n\t * @param WP_Post $post      The post in question.\n\t * @param bool    $leavename Whether to keep the post name.\n\t * @param bool    $sample    Is it a sample permalink.\n\t */\n\treturn apply_filters( 'post_type_link', $post_link, $post, $leavename, $sample );\n}\n\n/**\n * Retrieves the permalink for the current page or page ID.\n *\n * Respects page_on_front. Use this one.\n *\n * @since 1.5.0\n *\n * @param int|WP_Post $post      Optional. Post ID or object. Default uses the global `$post`.\n * @param bool        $leavename Optional. Whether to keep the page name. Default false.\n * @param bool        $sample    Optional. Whether it should be treated as a sample permalink.\n *                               Default false.\n * @return string The page permalink.\n */\nfunction get_page_link( $post = false, $leavename = false, $sample = false ) {\n\t$post = get_post( $post );\n\n\tif ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post->ID ) {\n\t\t$link = home_url( '/' );\n\t} else {\n\t\t$link = _get_page_link( $post, $leavename, $sample );\n\t}\n\n\t/**\n\t * Filters the permalink for a page.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $link    The page's permalink.\n\t * @param int    $post_id The ID of the page.\n\t * @param bool   $sample  Is it a sample permalink.\n\t */\n\treturn apply_filters( 'page_link', $link, $post->ID, $sample );\n}\n\n/**\n * Retrieves the page permalink.\n *\n * Ignores page_on_front. Internal use only.\n *\n * @since 2.1.0\n * @access private\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param int|WP_Post $post      Optional. Post ID or object. Default uses the global `$post`.\n * @param bool        $leavename Optional. Whether to keep the page name. Default false.\n * @param bool        $sample    Optional. Whether it should be treated as a sample permalink.\n *                               Default false.\n * @return string The page permalink.\n */\nfunction _get_page_link( $post = false, $leavename = false, $sample = false ) {\n\tglobal $wp_rewrite;\n\n\t$post = get_post( $post );\n\n\t$draft_or_pending = in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ), true );\n\n\t$link = $wp_rewrite->get_page_permastruct();\n\n\tif ( ! empty( $link ) && ( ( isset( $post->post_status ) && ! $draft_or_pending ) || $sample ) ) {\n\t\tif ( ! $leavename ) {\n\t\t\t$link = str_replace( '%pagename%', get_page_uri( $post ), $link );\n\t\t}\n\n\t\t$link = home_url( $link );\n\t\t$link = user_trailingslashit( $link, 'page' );\n\t} else {\n\t\t$link = home_url( '?page_id=' . $post->ID );\n\t}\n\n\t/**\n\t * Filters the permalink for a non-page_on_front page.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $link    The page's permalink.\n\t * @param int    $post_id The ID of the page.\n\t */\n\treturn apply_filters( '_get_page_link', $link, $post->ID );\n}\n\n/**\n * Retrieves the permalink for an attachment.\n *\n * This can be used in the WordPress Loop or outside of it.\n *\n * @since 2.0.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param int|object $post      Optional. Post ID or object. Default uses the global `$post`.\n * @param bool       $leavename Optional. Whether to keep the page name. Default false.\n * @return string The attachment permalink.\n */\nfunction get_attachment_link( $post = null, $leavename = false ) {\n\tglobal $wp_rewrite;\n\n\t$link = false;\n\n\t$post   = get_post( $post );\n\t$parent = ( $post->post_parent > 0 && $post->post_parent != $post->ID ) ? get_post( $post->post_parent ) : false;\n\tif ( $parent && ! in_array( $parent->post_type, get_post_types(), true ) ) {\n\t\t$parent = false;\n\t}\n\n\tif ( $wp_rewrite->using_permalinks() && $parent ) {\n\t\tif ( 'page' === $parent->post_type ) {\n\t\t\t$parentlink = _get_page_link( $post->post_parent ); // Ignores page_on_front.\n\t\t} else {\n\t\t\t$parentlink = get_permalink( $post->post_parent );\n\t\t}\n\n\t\tif ( is_numeric( $post->post_name ) || false !== strpos( get_option( 'permalink_structure' ), '%category%' ) ) {\n\t\t\t$name = 'attachment/' . $post->post_name; // <permalink>/<int>/ is paged so we use the explicit attachment marker.\n\t\t} else {\n\t\t\t$name = $post->post_name;\n\t\t}\n\n\t\tif ( strpos( $parentlink, '?' ) === false ) {\n\t\t\t$link = user_trailingslashit( trailingslashit( $parentlink ) . '%postname%' );\n\t\t}\n\n\t\tif ( ! $leavename ) {\n\t\t\t$link = str_replace( '%postname%', $name, $link );\n\t\t}\n\t} elseif ( $wp_rewrite->using_permalinks() && ! $leavename ) {\n\t\t$link = home_url( user_trailingslashit( $post->post_name ) );\n\t}\n\n\tif ( ! $link ) {\n\t\t$link = home_url( '/?attachment_id=' . $post->ID );\n\t}\n\n\t/**\n\t * Filters the permalink for an attachment.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $link    The attachment's permalink.\n\t * @param int    $post_id Attachment ID.\n\t */\n\treturn apply_filters( 'attachment_link', $link, $post->ID );\n}\n\n/**\n * Retrieves the permalink for the year archives.\n *\n * @since 1.5.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param int|false $year Integer of year. False for current year.\n * @return string The permalink for the specified year archive.\n */\nfunction get_year_link( $year ) {\n\tglobal $wp_rewrite;\n\tif ( ! $year ) {\n\t\t$year = current_time( 'Y' );\n\t}\n\t$yearlink = $wp_rewrite->get_year_permastruct();\n\tif ( ! empty( $yearlink ) ) {\n\t\t$yearlink = str_replace( '%year%', $year, $yearlink );\n\t\t$yearlink = home_url( user_trailingslashit( $yearlink, 'year' ) );\n\t} else {\n\t\t$yearlink = home_url( '?m=' . $year );\n\t}\n\n\t/**\n\t * Filters the year archive permalink.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $yearlink Permalink for the year archive.\n\t * @param int    $year     Year for the archive.\n\t */\n\treturn apply_filters( 'year_link', $yearlink, $year );\n}\n\n/**\n * Retrieves the permalink for the month archives with year.\n *\n * @since 1.0.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param int|false $year  Integer of year. False for current year.\n * @param int|false $month Integer of month. False for current month.\n * @return string The permalink for the specified month and year archive.\n */\nfunction get_month_link( $year, $month ) {\n\tglobal $wp_rewrite;\n\tif ( ! $year ) {\n\t\t$year = current_time( 'Y' );\n\t}\n\tif ( ! $month ) {\n\t\t$month = current_time( 'm' );\n\t}\n\t$monthlink = $wp_rewrite->get_month_permastruct();\n\tif ( ! empty( $monthlink ) ) {\n\t\t$monthlink = str_replace( '%year%', $year, $monthlink );\n\t\t$monthlink = str_replace( '%monthnum%', zeroise( intval( $month ), 2 ), $monthlink );\n\t\t$monthlink = home_url( user_trailingslashit( $monthlink, 'month' ) );\n\t} else {\n\t\t$monthlink = home_url( '?m=' . $year . zeroise( $month, 2 ) );\n\t}\n\n\t/**\n\t * Filters the month archive permalink.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $monthlink Permalink for the month archive.\n\t * @param int    $year      Year for the archive.\n\t * @param int    $month     The month for the archive.\n\t */\n\treturn apply_filters( 'month_link', $monthlink, $year, $month );\n}\n\n/**\n * Retrieves the permalink for the day archives with year and month.\n *\n * @since 1.0.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param int|false $year  Integer of year. False for current year.\n * @param int|false $month Integer of month. False for current month.\n * @param int|false $day   Integer of day. False for current day.\n * @return string The permalink for the specified day, month, and year archive.\n */\nfunction get_day_link( $year, $month, $day ) {\n\tglobal $wp_rewrite;\n\tif ( ! $year ) {\n\t\t$year = current_time( 'Y' );\n\t}\n\tif ( ! $month ) {\n\t\t$month = current_time( 'm' );\n\t}\n\tif ( ! $day ) {\n\t\t$day = current_time( 'j' );\n\t}\n\n\t$daylink = $wp_rewrite->get_day_permastruct();\n\tif ( ! empty( $daylink ) ) {\n\t\t$daylink = str_replace( '%year%', $year, $daylink );\n\t\t$daylink = str_replace( '%monthnum%', zeroise( intval( $month ), 2 ), $daylink );\n\t\t$daylink = str_replace( '%day%', zeroise( intval( $day ), 2 ), $daylink );\n\t\t$daylink = home_url( user_trailingslashit( $daylink, 'day' ) );\n\t} else {\n\t\t$daylink = home_url( '?m=' . $year . zeroise( $month, 2 ) . zeroise( $day, 2 ) );\n\t}\n\n\t/**\n\t * Filters the day archive permalink.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $daylink Permalink for the day archive.\n\t * @param int    $year    Year for the archive.\n\t * @param int    $month   Month for the archive.\n\t * @param int    $day     The day for the archive.\n\t */\n\treturn apply_filters( 'day_link', $daylink, $year, $month, $day );\n}\n\n/**\n * Displays the permalink for the feed type.\n *\n * @since 3.0.0\n *\n * @param string $anchor The link's anchor text.\n * @param string $feed   Optional. Feed type. Possible values include 'rss2', 'atom'.\n *                       Default is the value of get_default_feed().\n */\nfunction the_feed_link( $anchor, $feed = '' ) {\n\t$link = '<a href=\"' . esc_url( get_feed_link( $feed ) ) . '\">' . $anchor . '</a>';\n\n\t/**\n\t * Filters the feed link anchor tag.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $link The complete anchor tag for a feed link.\n\t * @param string $feed The feed type. Possible values include 'rss2', 'atom',\n\t *                     or an empty string for the default feed type.\n\t */\n\techo apply_filters( 'the_feed_link', $link, $feed );\n}\n\n/**\n * Retrieves the permalink for the feed type.\n *\n * @since 1.5.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'.\n *                     Default is the value of get_default_feed().\n * @return string The feed permalink.\n */\nfunction get_feed_link( $feed = '' ) {\n\tglobal $wp_rewrite;\n\n\t$permalink = $wp_rewrite->get_feed_permastruct();\n\n\tif ( '' !== $permalink ) {\n\t\tif ( false !== strpos( $feed, 'comments_' ) ) {\n\t\t\t$feed      = str_replace( 'comments_', '', $feed );\n\t\t\t$permalink = $wp_rewrite->get_comment_feed_permastruct();\n\t\t}\n\n\t\tif ( get_default_feed() == $feed ) {\n\t\t\t$feed = '';\n\t\t}\n\n\t\t$permalink = str_replace( '%feed%', $feed, $permalink );\n\t\t$permalink = preg_replace( '#/+#', '/', \"/$permalink\" );\n\t\t$output    = home_url( user_trailingslashit( $permalink, 'feed' ) );\n\t} else {\n\t\tif ( empty( $feed ) ) {\n\t\t\t$feed = get_default_feed();\n\t\t}\n\n\t\tif ( false !== strpos( $feed, 'comments_' ) ) {\n\t\t\t$feed = str_replace( 'comments_', 'comments-', $feed );\n\t\t}\n\n\t\t$output = home_url( \"?feed={$feed}\" );\n\t}\n\n\t/**\n\t * Filters the feed type permalink.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $output The feed permalink.\n\t * @param string $feed   The feed type. Possible values include 'rss2', 'atom',\n\t *                       or an empty string for the default feed type.\n\t */\n\treturn apply_filters( 'feed_link', $output, $feed );\n}\n\n/**\n * Retrieves the permalink for the post comments feed.\n *\n * @since 2.2.0\n *\n * @param int    $post_id Optional. Post ID. Default is the ID of the global `$post`.\n * @param string $feed    Optional. Feed type. Possible values include 'rss2', 'atom'.\n *                        Default is the value of get_default_feed().\n * @return string The permalink for the comments feed for the given post.\n */\nfunction get_post_comments_feed_link( $post_id = 0, $feed = '' ) {\n\t$post_id = absint( $post_id );\n\n\tif ( ! $post_id ) {\n\t\t$post_id = get_the_ID();\n\t}\n\n\tif ( empty( $feed ) ) {\n\t\t$feed = get_default_feed();\n\t}\n\n\t$post       = get_post( $post_id );\n\t$unattached = 'attachment' === $post->post_type && 0 === (int) $post->post_parent;\n\n\tif ( get_option( 'permalink_structure' ) ) {\n\t\tif ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post_id ) {\n\t\t\t$url = _get_page_link( $post_id );\n\t\t} else {\n\t\t\t$url = get_permalink( $post_id );\n\t\t}\n\n\t\tif ( $unattached ) {\n\t\t\t$url = home_url( '/feed/' );\n\t\t\tif ( get_default_feed() !== $feed ) {\n\t\t\t\t$url .= \"$feed/\";\n\t\t\t}\n\t\t\t$url = add_query_arg( 'attachment_id', $post_id, $url );\n\t\t} else {\n\t\t\t$url = trailingslashit( $url ) . 'feed';\n\t\t\tif ( get_default_feed() != $feed ) {\n\t\t\t\t$url .= \"/$feed\";\n\t\t\t}\n\t\t\t$url = user_trailingslashit( $url, 'single_feed' );\n\t\t}\n\t} else {\n\t\tif ( $unattached ) {\n\t\t\t$url = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'feed'          => $feed,\n\t\t\t\t\t'attachment_id' => $post_id,\n\t\t\t\t),\n\t\t\t\thome_url( '/' )\n\t\t\t);\n\t\t} elseif ( 'page' === $post->post_type ) {\n\t\t\t$url = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'feed'    => $feed,\n\t\t\t\t\t'page_id' => $post_id,\n\t\t\t\t),\n\t\t\t\thome_url( '/' )\n\t\t\t);\n\t\t} else {\n\t\t\t$url = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'feed' => $feed,\n\t\t\t\t\t'p'    => $post_id,\n\t\t\t\t),\n\t\t\t\thome_url( '/' )\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Filters the post comments feed permalink.\n\t *\n\t * @since 1.5.1\n\t *\n\t * @param string $url Post comments feed permalink.\n\t */\n\treturn apply_filters( 'post_comments_feed_link', $url );\n}\n\n/**\n * Displays the comment feed link for a post.\n *\n * Prints out the comment feed link for a post. Link text is placed in the\n * anchor. If no link text is specified, default text is used. If no post ID is\n * specified, the current post is used.\n *\n * @since 2.5.0\n *\n * @param string $link_text Optional. Descriptive link text. Default 'Comments Feed'.\n * @param int    $post_id   Optional. Post ID. Default is the ID of the global `$post`.\n * @param string $feed      Optional. Feed type. Possible values include 'rss2', 'atom'.\n *                          Default is the value of get_default_feed().\n */\nfunction post_comments_feed_link( $link_text = '', $post_id = '', $feed = '' ) {\n\t$url = get_post_comments_feed_link( $post_id, $feed );\n\tif ( empty( $link_text ) ) {\n\t\t$link_text = __( 'Comments Feed' );\n\t}\n\n\t$link = '<a href=\"' . esc_url( $url ) . '\">' . $link_text . '</a>';\n\t/**\n\t * Filters the post comment feed link anchor tag.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $link    The complete anchor tag for the comment feed link.\n\t * @param int    $post_id Post ID.\n\t * @param string $feed    The feed type. Possible values include 'rss2', 'atom',\n\t *                        or an empty string for the default feed type.\n\t */\n\techo apply_filters( 'post_comments_feed_link_html', $link, $post_id, $feed );\n}\n\n/**\n * Retrieves the feed link for a given author.\n *\n * Returns a link to the feed for all posts by a given author. A specific feed\n * can be requested or left blank to get the default feed.\n *\n * @since 2.5.0\n *\n * @param int    $author_id Author ID.\n * @param string $feed      Optional. Feed type. Possible values include 'rss2', 'atom'.\n *                          Default is the value of get_default_feed().\n * @return string Link to the feed for the author specified by $author_id.\n */\nfunction get_author_feed_link( $author_id, $feed = '' ) {\n\t$author_id           = (int) $author_id;\n\t$permalink_structure = get_option( 'permalink_structure' );\n\n\tif ( empty( $feed ) ) {\n\t\t$feed = get_default_feed();\n\t}\n\n\tif ( ! $permalink_structure ) {\n\t\t$link = home_url( \"?feed=$feed&amp;author=\" . $author_id );\n\t} else {\n\t\t$link = get_author_posts_url( $author_id );\n\t\tif ( get_default_feed() == $feed ) {\n\t\t\t$feed_link = 'feed';\n\t\t} else {\n\t\t\t$feed_link = \"feed/$feed\";\n\t\t}\n\n\t\t$link = trailingslashit( $link ) . user_trailingslashit( $feed_link, 'feed' );\n\t}\n\n\t/**\n\t * Filters the feed link for a given author.\n\t *\n\t * @since 1.5.1\n\t *\n\t * @param string $link The author feed link.\n\t * @param string $feed Feed type. Possible values include 'rss2', 'atom'.\n\t */\n\t$link = apply_filters( 'author_feed_link', $link, $feed );\n\n\treturn $link;\n}\n\n/**\n * Retrieves the feed link for a category.\n *\n * Returns a link to the feed for all posts in a given category. A specific feed\n * can be requested or left blank to get the default feed.\n *\n * @since 2.5.0\n *\n * @param int    $cat_id Category ID.\n * @param string $feed   Optional. Feed type. Possible values include 'rss2', 'atom'.\n *                       Default is the value of get_default_feed().\n * @return string Link to the feed for the category specified by $cat_id.\n */\nfunction get_category_feed_link( $cat_id, $feed = '' ) {\n\treturn get_term_feed_link( $cat_id, 'category', $feed );\n}\n\n/**\n * Retrieves the feed link for a term.\n *\n * Returns a link to the feed for all posts in a given term. A specific feed\n * can be requested or left blank to get the default feed.\n *\n * @since 3.0.0\n *\n * @param int    $term_id  Term ID.\n * @param string $taxonomy Optional. Taxonomy of `$term_id`. Default 'category'.\n * @param string $feed     Optional. Feed type. Possible values include 'rss2', 'atom'.\n *                         Default is the value of get_default_feed().\n * @return string|false Link to the feed for the term specified by $term_id and $taxonomy.\n */\nfunction get_term_feed_link( $term_id, $taxonomy = 'category', $feed = '' ) {\n\t$term_id = (int) $term_id;\n\n\t$term = get_term( $term_id, $taxonomy );\n\n\tif ( empty( $term ) || is_wp_error( $term ) ) {\n\t\treturn false;\n\t}\n\n\tif ( empty( $feed ) ) {\n\t\t$feed = get_default_feed();\n\t}\n\n\t$permalink_structure = get_option( 'permalink_structure' );\n\n\tif ( ! $permalink_structure ) {\n\t\tif ( 'category' === $taxonomy ) {\n\t\t\t$link = home_url( \"?feed=$feed&amp;cat=$term_id\" );\n\t\t} elseif ( 'post_tag' === $taxonomy ) {\n\t\t\t$link = home_url( \"?feed=$feed&amp;tag=$term->slug\" );\n\t\t} else {\n\t\t\t$t    = get_taxonomy( $taxonomy );\n\t\t\t$link = home_url( \"?feed=$feed&amp;$t->query_var=$term->slug\" );\n\t\t}\n\t} else {\n\t\t$link = get_term_link( $term_id, $term->taxonomy );\n\t\tif ( get_default_feed() == $feed ) {\n\t\t\t$feed_link = 'feed';\n\t\t} else {\n\t\t\t$feed_link = \"feed/$feed\";\n\t\t}\n\n\t\t$link = trailingslashit( $link ) . user_trailingslashit( $feed_link, 'feed' );\n\t}\n\n\tif ( 'category' === $taxonomy ) {\n\t\t/**\n\t\t * Filters the category feed link.\n\t\t *\n\t\t * @since 1.5.1\n\t\t *\n\t\t * @param string $link The category feed link.\n\t\t * @param string $feed Feed type. Possible values include 'rss2', 'atom'.\n\t\t */\n\t\t$link = apply_filters( 'category_feed_link', $link, $feed );\n\t} elseif ( 'post_tag' === $taxonomy ) {\n\t\t/**\n\t\t * Filters the post tag feed link.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param string $link The tag feed link.\n\t\t * @param string $feed Feed type. Possible values include 'rss2', 'atom'.\n\t\t */\n\t\t$link = apply_filters( 'tag_feed_link', $link, $feed );\n\t} else {\n\t\t/**\n\t\t * Filters the feed link for a taxonomy other than 'category' or 'post_tag'.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string $link     The taxonomy feed link.\n\t\t * @param string $feed     Feed type. Possible values include 'rss2', 'atom'.\n\t\t * @param string $taxonomy The taxonomy name.\n\t\t */\n\t\t$link = apply_filters( 'taxonomy_feed_link', $link, $feed, $taxonomy );\n\t}\n\n\treturn $link;\n}\n\n/**\n * Retrieves the permalink for a tag feed.\n *\n * @since 2.3.0\n *\n * @param int    $tag_id Tag ID.\n * @param string $feed   Optional. Feed type. Possible values include 'rss2', 'atom'.\n *                       Default is the value of get_default_feed().\n * @return string The feed permalink for the given tag.\n */\nfunction get_tag_feed_link( $tag_id, $feed = '' ) {\n\treturn get_term_feed_link( $tag_id, 'post_tag', $feed );\n}\n\n/**\n * Retrieves the edit link for a tag.\n *\n * @since 2.7.0\n *\n * @param int    $tag_id   Tag ID.\n * @param string $taxonomy Optional. Taxonomy slug. Default 'post_tag'.\n * @return string The edit tag link URL for the given tag.\n */\nfunction get_edit_tag_link( $tag_id, $taxonomy = 'post_tag' ) {\n\t/**\n\t * Filters the edit link for a tag (or term in another taxonomy).\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $link The term edit link.\n\t */\n\treturn apply_filters( 'get_edit_tag_link', get_edit_term_link( $tag_id, $taxonomy ) );\n}\n\n/**\n * Displays or retrieves the edit link for a tag with formatting.\n *\n * @since 2.7.0\n *\n * @param string  $link   Optional. Anchor text. If empty, default is 'Edit This'. Default empty.\n * @param string  $before Optional. Display before edit link. Default empty.\n * @param string  $after  Optional. Display after edit link. Default empty.\n * @param WP_Term $tag    Optional. Term object. If null, the queried object will be inspected.\n *                        Default null.\n */\nfunction edit_tag_link( $link = '', $before = '', $after = '', $tag = null ) {\n\t$link = edit_term_link( $link, '', '', $tag, false );\n\n\t/**\n\t * Filters the anchor tag for the edit link for a tag (or term in another taxonomy).\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $link The anchor tag for the edit link.\n\t */\n\techo $before . apply_filters( 'edit_tag_link', $link ) . $after;\n}\n\n/**\n * Retrieves the URL for editing a given term.\n *\n * @since 3.1.0\n * @since 4.5.0 The `$taxonomy` parameter was made optional.\n *\n * @param int    $term_id     Term ID.\n * @param string $taxonomy    Optional. Taxonomy. Defaults to the taxonomy of the term identified\n *                            by `$term_id`.\n * @param string $object_type Optional. The object type. Used to highlight the proper post type\n *                            menu on the linked page. Defaults to the first object_type associated\n *                            with the taxonomy.\n * @return string|null The edit term link URL for the given term, or null on failure.\n */\nfunction get_edit_term_link( $term_id, $taxonomy = '', $object_type = '' ) {\n\t$term = get_term( $term_id, $taxonomy );\n\tif ( ! $term || is_wp_error( $term ) ) {\n\t\treturn;\n\t}\n\n\t$tax = get_taxonomy( $term->taxonomy );\n\tif ( ! $tax || ! current_user_can( 'edit_term', $term->term_id ) ) {\n\t\treturn;\n\t}\n\n\t$args = array(\n\t\t'taxonomy' => $taxonomy,\n\t\t'tag_ID'   => $term->term_id,\n\t);\n\n\tif ( $object_type ) {\n\t\t$args['post_type'] = $object_type;\n\t} elseif ( ! empty( $tax->object_type ) ) {\n\t\t$args['post_type'] = reset( $tax->object_type );\n\t}\n\n\tif ( $tax->show_ui ) {\n\t\t$location = add_query_arg( $args, admin_url( 'term.php' ) );\n\t} else {\n\t\t$location = '';\n\t}\n\n\t/**\n\t * Filters the edit link for a term.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $location    The edit link.\n\t * @param int    $term_id     Term ID.\n\t * @param string $taxonomy    Taxonomy name.\n\t * @param string $object_type The object type (eg. the post type).\n\t */\n\treturn apply_filters( 'get_edit_term_link', $location, $term_id, $taxonomy, $object_type );\n}\n\n/**\n * Displays or retrieves the edit term link with formatting.\n *\n * @since 3.1.0\n *\n * @param string  $link   Optional. Anchor text. If empty, default is 'Edit This'. Default empty.\n * @param string  $before Optional. Display before edit link. Default empty.\n * @param string  $after  Optional. Display after edit link. Default empty.\n * @param WP_Term $term   Optional. Term object. If null, the queried object will be inspected. Default null.\n * @param bool    $echo   Optional. Whether or not to echo the return. Default true.\n * @return string|void HTML content.\n */\nfunction edit_term_link( $link = '', $before = '', $after = '', $term = null, $echo = true ) {\n\tif ( is_null( $term ) ) {\n\t\t$term = get_queried_object();\n\t}\n\n\tif ( ! $term ) {\n\t\treturn;\n\t}\n\n\t$tax = get_taxonomy( $term->taxonomy );\n\tif ( ! current_user_can( 'edit_term', $term->term_id ) ) {\n\t\treturn;\n\t}\n\n\tif ( empty( $link ) ) {\n\t\t$link = __( 'Edit This' );\n\t}\n\n\t$link = '<a href=\"' . get_edit_term_link( $term->term_id, $term->taxonomy ) . '\">' . $link . '</a>';\n\n\t/**\n\t * Filters the anchor tag for the edit link of a term.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $link    The anchor tag for the edit link.\n\t * @param int    $term_id Term ID.\n\t */\n\t$link = $before . apply_filters( 'edit_term_link', $link, $term->term_id ) . $after;\n\n\tif ( $echo ) {\n\t\techo $link;\n\t} else {\n\t\treturn $link;\n\t}\n}\n\n/**\n * Retrieves the permalink for a search.\n *\n * @since 3.0.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string $query Optional. The query string to use. If empty the current query is used. Default empty.\n * @return string The search permalink.\n */\nfunction get_search_link( $query = '' ) {\n\tglobal $wp_rewrite;\n\n\tif ( empty( $query ) ) {\n\t\t$search = get_search_query( false );\n\t} else {\n\t\t$search = stripslashes( $query );\n\t}\n\n\t$permastruct = $wp_rewrite->get_search_permastruct();\n\n\tif ( empty( $permastruct ) ) {\n\t\t$link = home_url( '?s=' . urlencode( $search ) );\n\t} else {\n\t\t$search = urlencode( $search );\n\t\t$search = str_replace( '%2F', '/', $search ); // %2F(/) is not valid within a URL, send it un-encoded.\n\t\t$link   = str_replace( '%search%', $search, $permastruct );\n\t\t$link   = home_url( user_trailingslashit( $link, 'search' ) );\n\t}\n\n\t/**\n\t * Filters the search permalink.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $link   Search permalink.\n\t * @param string $search The URL-encoded search term.\n\t */\n\treturn apply_filters( 'search_link', $link, $search );\n}\n\n/**\n * Retrieves the permalink for the search results feed.\n *\n * @since 2.5.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string $search_query Optional. Search query. Default empty.\n * @param string $feed         Optional. Feed type. Possible values include 'rss2', 'atom'.\n *                             Default is the value of get_default_feed().\n * @return string The search results feed permalink.\n */\nfunction get_search_feed_link( $search_query = '', $feed = '' ) {\n\tglobal $wp_rewrite;\n\t$link = get_search_link( $search_query );\n\n\tif ( empty( $feed ) ) {\n\t\t$feed = get_default_feed();\n\t}\n\n\t$permastruct = $wp_rewrite->get_search_permastruct();\n\n\tif ( empty( $permastruct ) ) {\n\t\t$link = add_query_arg( 'feed', $feed, $link );\n\t} else {\n\t\t$link  = trailingslashit( $link );\n\t\t$link .= \"feed/$feed/\";\n\t}\n\n\t/**\n\t * Filters the search feed link.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $link Search feed link.\n\t * @param string $feed Feed type. Possible values include 'rss2', 'atom'.\n\t * @param string $type The search type. One of 'posts' or 'comments'.\n\t */\n\treturn apply_filters( 'search_feed_link', $link, $feed, 'posts' );\n}\n\n/**\n * Retrieves the permalink for the search results comments feed.\n *\n * @since 2.5.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string $search_query Optional. Search query. Default empty.\n * @param string $feed         Optional. Feed type. Possible values include 'rss2', 'atom'.\n *                             Default is the value of get_default_feed().\n * @return string The comments feed search results permalink.\n */\nfunction get_search_comments_feed_link( $search_query = '', $feed = '' ) {\n\tglobal $wp_rewrite;\n\n\tif ( empty( $feed ) ) {\n\t\t$feed = get_default_feed();\n\t}\n\n\t$link = get_search_feed_link( $search_query, $feed );\n\n\t$permastruct = $wp_rewrite->get_search_permastruct();\n\n\tif ( empty( $permastruct ) ) {\n\t\t$link = add_query_arg( 'feed', 'comments-' . $feed, $link );\n\t} else {\n\t\t$link = add_query_arg( 'withcomments', 1, $link );\n\t}\n\n\t/** This filter is documented in wp-includes/link-template.php */\n\treturn apply_filters( 'search_feed_link', $link, $feed, 'comments' );\n}\n\n/**\n * Retrieves the permalink for a post type archive.\n *\n * @since 3.1.0\n * @since 4.5.0 Support for posts was added.\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string $post_type Post type.\n * @return string|false The post type archive permalink.\n */\nfunction get_post_type_archive_link( $post_type ) {\n\tglobal $wp_rewrite;\n\n\t$post_type_obj = get_post_type_object( $post_type );\n\tif ( ! $post_type_obj ) {\n\t\treturn false;\n\t}\n\n\tif ( 'post' === $post_type ) {\n\t\t$show_on_front  = get_option( 'show_on_front' );\n\t\t$page_for_posts = get_option( 'page_for_posts' );\n\n\t\tif ( 'page' === $show_on_front && $page_for_posts ) {\n\t\t\t$link = get_permalink( $page_for_posts );\n\t\t} else {\n\t\t\t$link = get_home_url();\n\t\t}\n\t\t/** This filter is documented in wp-includes/link-template.php */\n\t\treturn apply_filters( 'post_type_archive_link', $link, $post_type );\n\t}\n\n\tif ( ! $post_type_obj->has_archive ) {\n\t\treturn false;\n\t}\n\n\tif ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) ) {\n\t\t$struct = ( true === $post_type_obj->has_archive ) ? $post_type_obj->rewrite['slug'] : $post_type_obj->has_archive;\n\t\tif ( $post_type_obj->rewrite['with_front'] ) {\n\t\t\t$struct = $wp_rewrite->front . $struct;\n\t\t} else {\n\t\t\t$struct = $wp_rewrite->root . $struct;\n\t\t}\n\t\t$link = home_url( user_trailingslashit( $struct, 'post_type_archive' ) );\n\t} else {\n\t\t$link = home_url( '?post_type=' . $post_type );\n\t}\n\n\t/**\n\t * Filters the post type archive permalink.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $link      The post type archive permalink.\n\t * @param string $post_type Post type name.\n\t */\n\treturn apply_filters( 'post_type_archive_link', $link, $post_type );\n}\n\n/**\n * Retrieves the permalink for a post type archive feed.\n *\n * @since 3.1.0\n *\n * @param string $post_type Post type\n * @param string $feed      Optional. Feed type. Possible values include 'rss2', 'atom'.\n *                          Default is the value of get_default_feed().\n * @return string|false The post type feed permalink.\n */\nfunction get_post_type_archive_feed_link( $post_type, $feed = '' ) {\n\t$default_feed = get_default_feed();\n\tif ( empty( $feed ) ) {\n\t\t$feed = $default_feed;\n\t}\n\n\t$link = get_post_type_archive_link( $post_type );\n\tif ( ! $link ) {\n\t\treturn false;\n\t}\n\n\t$post_type_obj = get_post_type_object( $post_type );\n\tif ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) && $post_type_obj->rewrite['feeds'] ) {\n\t\t$link  = trailingslashit( $link );\n\t\t$link .= 'feed/';\n\t\tif ( $feed != $default_feed ) {\n\t\t\t$link .= \"$feed/\";\n\t\t}\n\t} else {\n\t\t$link = add_query_arg( 'feed', $feed, $link );\n\t}\n\n\t/**\n\t * Filters the post type archive feed link.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $link The post type archive feed link.\n\t * @param string $feed Feed type. Possible values include 'rss2', 'atom'.\n\t */\n\treturn apply_filters( 'post_type_archive_feed_link', $link, $feed );\n}\n\n/**\n * Retrieves the URL used for the post preview.\n *\n * Allows additional query args to be appended.\n *\n * @since 4.4.0\n *\n * @param int|WP_Post $post         Optional. Post ID or `WP_Post` object. Defaults to global `$post`.\n * @param array       $query_args   Optional. Array of additional query args to be appended to the link.\n *                                  Default empty array.\n * @param string      $preview_link Optional. Base preview link to be used if it should differ from the\n *                                  post permalink. Default empty.\n * @return string|null URL used for the post preview, or null if the post does not exist.\n */\nfunction get_preview_post_link( $post = null, $query_args = array(), $preview_link = '' ) {\n\t$post = get_post( $post );\n\tif ( ! $post ) {\n\t\treturn;\n\t}\n\n\t$post_type_object = get_post_type_object( $post->post_type );\n\tif ( is_post_type_viewable( $post_type_object ) ) {\n\t\tif ( ! $preview_link ) {\n\t\t\t$preview_link = set_url_scheme( get_permalink( $post ) );\n\t\t}\n\n\t\t$query_args['preview'] = 'true';\n\t\t$preview_link          = add_query_arg( $query_args, $preview_link );\n\t}\n\n\t/**\n\t * Filters the URL used for a post preview.\n\t *\n\t * @since 2.0.5\n\t * @since 4.0.0 Added the `$post` parameter.\n\t *\n\t * @param string  $preview_link URL used for the post preview.\n\t * @param WP_Post $post         Post object.\n\t */\n\treturn apply_filters( 'preview_post_link', $preview_link, $post );\n}\n\n/**\n * Retrieves the edit post link for post.\n *\n * Can be used within the WordPress loop or outside of it. Can be used with\n * pages, posts, attachments, and revisions.\n *\n * @since 2.3.0\n *\n * @param int|WP_Post $id      Optional. Post ID or post object. Default is the global `$post`.\n * @param string      $context Optional. How to output the '&' character. Default '&amp;'.\n * @return string|null The edit post link for the given post. null if the post type is invalid or does\n *                     not allow an editing UI.\n */\nfunction get_edit_post_link( $id = 0, $context = 'display' ) {\n\t$post = get_post( $id );\n\tif ( ! $post ) {\n\t\treturn;\n\t}\n\n\tif ( 'revision' === $post->post_type ) {\n\t\t$action = '';\n\t} elseif ( 'display' === $context ) {\n\t\t$action = '&amp;action=edit';\n\t} else {\n\t\t$action = '&action=edit';\n\t}\n\n\t$post_type_object = get_post_type_object( $post->post_type );\n\tif ( ! $post_type_object ) {\n\t\treturn;\n\t}\n\n\tif ( ! current_user_can( 'edit_post', $post->ID ) ) {\n\t\treturn;\n\t}\n\n\tif ( $post_type_object->_edit_link ) {\n\t\t$link = admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) );\n\t} else {\n\t\t$link = '';\n\t}\n\n\t/**\n\t * Filters the post edit link.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string $link    The edit link.\n\t * @param int    $post_id Post ID.\n\t * @param string $context The link context. If set to 'display' then ampersands\n\t *                        are encoded.\n\t */\n\treturn apply_filters( 'get_edit_post_link', $link, $post->ID, $context );\n}\n\n/**\n * Displays the edit post link for post.\n *\n * @since 1.0.0\n * @since 4.4.0 The `$class` argument was added.\n *\n * @param string      $text   Optional. Anchor text. If null, default is 'Edit This'. Default null.\n * @param string      $before Optional. Display before edit link. Default empty.\n * @param string      $after  Optional. Display after edit link. Default empty.\n * @param int|WP_Post $id     Optional. Post ID or post object. Default is the global `$post`.\n * @param string      $class  Optional. Add custom class to link. Default 'post-edit-link'.\n */\nfunction edit_post_link( $text = null, $before = '', $after = '', $id = 0, $class = 'post-edit-link' ) {\n\t$post = get_post( $id );\n\tif ( ! $post ) {\n\t\treturn;\n\t}\n\n\t$url = get_edit_post_link( $post->ID );\n\tif ( ! $url ) {\n\t\treturn;\n\t}\n\n\tif ( null === $text ) {\n\t\t$text = __( 'Edit This' );\n\t}\n\n\t$link = '<a class=\"' . esc_attr( $class ) . '\" href=\"' . esc_url( $url ) . '\">' . $text . '</a>';\n\n\t/**\n\t * Filters the post edit link anchor tag.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string $link    Anchor tag for the edit link.\n\t * @param int    $post_id Post ID.\n\t * @param string $text    Anchor text.\n\t */\n\techo $before . apply_filters( 'edit_post_link', $link, $post->ID, $text ) . $after;\n}\n\n/**\n * Retrieves the delete posts link for post.\n *\n * Can be used within the WordPress loop or outside of it, with any post type.\n *\n * @since 2.9.0\n *\n * @param int|WP_Post $id           Optional. Post ID or post object. Default is the global `$post`.\n * @param string      $deprecated   Not used.\n * @param bool        $force_delete Optional. Whether to bypass Trash and force deletion. Default false.\n * @return string|void The delete post link URL for the given post.\n */\nfunction get_delete_post_link( $id = 0, $deprecated = '', $force_delete = false ) {\n\tif ( ! empty( $deprecated ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '3.0.0' );\n\t}\n\n\t$post = get_post( $id );\n\tif ( ! $post ) {\n\t\treturn;\n\t}\n\n\t$post_type_object = get_post_type_object( $post->post_type );\n\tif ( ! $post_type_object ) {\n\t\treturn;\n\t}\n\n\tif ( ! current_user_can( 'delete_post', $post->ID ) ) {\n\t\treturn;\n\t}\n\n\t$action = ( $force_delete || ! EMPTY_TRASH_DAYS ) ? 'delete' : 'trash';\n\n\t$delete_link = add_query_arg( 'action', $action, admin_url( sprintf( $post_type_object->_edit_link, $post->ID ) ) );\n\n\t/**\n\t * Filters the post delete link.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string $link         The delete link.\n\t * @param int    $post_id      Post ID.\n\t * @param bool   $force_delete Whether to bypass the Trash and force deletion. Default false.\n\t */\n\treturn apply_filters( 'get_delete_post_link', wp_nonce_url( $delete_link, \"$action-post_{$post->ID}\" ), $post->ID, $force_delete );\n}\n\n/**\n * Retrieves the edit comment link.\n *\n * @since 2.3.0\n *\n * @param int|WP_Comment $comment_id Optional. Comment ID or WP_Comment object.\n * @return string|void The edit comment link URL for the given comment.\n */\nfunction get_edit_comment_link( $comment_id = 0 ) {\n\t$comment = get_comment( $comment_id );\n\n\tif ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {\n\t\treturn;\n\t}\n\n\t$location = admin_url( 'comment.php?action=editcomment&amp;c=' ) . $comment->comment_ID;\n\n\t/**\n\t * Filters the comment edit link.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string $location The edit link.\n\t */\n\treturn apply_filters( 'get_edit_comment_link', $location );\n}\n\n/**\n * Displays the edit comment link with formatting.\n *\n * @since 1.0.0\n *\n * @param string $text   Optional. Anchor text. If null, default is 'Edit This'. Default null.\n * @param string $before Optional. Display before edit link. Default empty.\n * @param string $after  Optional. Display after edit link. Default empty.\n */\nfunction edit_comment_link( $text = null, $before = '', $after = '' ) {\n\t$comment = get_comment();\n\n\tif ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {\n\t\treturn;\n\t}\n\n\tif ( null === $text ) {\n\t\t$text = __( 'Edit This' );\n\t}\n\n\t$link = '<a class=\"comment-edit-link\" href=\"' . esc_url( get_edit_comment_link( $comment ) ) . '\">' . $text . '</a>';\n\n\t/**\n\t * Filters the comment edit link anchor tag.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string $link       Anchor tag for the edit link.\n\t * @param int    $comment_id Comment ID.\n\t * @param string $text       Anchor text.\n\t */\n\techo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID, $text ) . $after;\n}\n\n/**\n * Displays the edit bookmark link.\n *\n * @since 2.7.0\n *\n * @param int|stdClass $link Optional. Bookmark ID. Default is the ID of the current bookmark.\n * @return string|void The edit bookmark link URL.\n */\nfunction get_edit_bookmark_link( $link = 0 ) {\n\t$link = get_bookmark( $link );\n\n\tif ( ! current_user_can( 'manage_links' ) ) {\n\t\treturn;\n\t}\n\n\t$location = admin_url( 'link.php?action=edit&amp;link_id=' ) . $link->link_id;\n\n\t/**\n\t * Filters the bookmark edit link.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $location The edit link.\n\t * @param int    $link_id  Bookmark ID.\n\t */\n\treturn apply_filters( 'get_edit_bookmark_link', $location, $link->link_id );\n}\n\n/**\n * Displays the edit bookmark link anchor content.\n *\n * @since 2.7.0\n *\n * @param string $link     Optional. Anchor text. If empty, default is 'Edit This'. Default empty.\n * @param string $before   Optional. Display before edit link. Default empty.\n * @param string $after    Optional. Display after edit link. Default empty.\n * @param int    $bookmark Optional. Bookmark ID. Default is the current bookmark.\n */\nfunction edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) {\n\t$bookmark = get_bookmark( $bookmark );\n\n\tif ( ! current_user_can( 'manage_links' ) ) {\n\t\treturn;\n\t}\n\n\tif ( empty( $link ) ) {\n\t\t$link = __( 'Edit This' );\n\t}\n\n\t$link = '<a href=\"' . esc_url( get_edit_bookmark_link( $bookmark ) ) . '\">' . $link . '</a>';\n\n\t/**\n\t * Filters the bookmark edit link anchor tag.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $link    Anchor tag for the edit link.\n\t * @param int    $link_id Bookmark ID.\n\t */\n\techo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after;\n}\n\n/**\n * Retrieves the edit user link.\n *\n * @since 3.5.0\n *\n * @param int $user_id Optional. User ID. Defaults to the current user.\n * @return string URL to edit user page or empty string.\n */\nfunction get_edit_user_link( $user_id = null ) {\n\tif ( ! $user_id ) {\n\t\t$user_id = get_current_user_id();\n\t}\n\n\tif ( empty( $user_id ) || ! current_user_can( 'edit_user', $user_id ) ) {\n\t\treturn '';\n\t}\n\n\t$user = get_userdata( $user_id );\n\n\tif ( ! $user ) {\n\t\treturn '';\n\t}\n\n\tif ( get_current_user_id() == $user->ID ) {\n\t\t$link = get_edit_profile_url( $user->ID );\n\t} else {\n\t\t$link = add_query_arg( 'user_id', $user->ID, self_admin_url( 'user-edit.php' ) );\n\t}\n\n\t/**\n\t * Filters the user edit link.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $link    The edit link.\n\t * @param int    $user_id User ID.\n\t */\n\treturn apply_filters( 'get_edit_user_link', $link, $user->ID );\n}\n\n//\n// Navigation links.\n//\n\n/**\n * Retrieves the previous post that is adjacent to the current post.\n *\n * @since 1.5.0\n *\n * @param bool         $in_same_term   Optional. Whether post should be in a same taxonomy term. Default false.\n * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.\n * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.\n * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no\n *                             corresponding post exists.\n */\nfunction get_previous_post( $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {\n\treturn get_adjacent_post( $in_same_term, $excluded_terms, true, $taxonomy );\n}\n\n/**\n * Retrieves the next post that is adjacent to the current post.\n *\n * @since 1.5.0\n *\n * @param bool         $in_same_term   Optional. Whether post should be in a same taxonomy term. Default false.\n * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.\n * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.\n * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no\n *                             corresponding post exists.\n */\nfunction get_next_post( $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {\n\treturn get_adjacent_post( $in_same_term, $excluded_terms, false, $taxonomy );\n}\n\n/**\n * Retrieves the adjacent post.\n *\n * Can either be next or previous post.\n *\n * @since 2.5.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param bool         $in_same_term   Optional. Whether post should be in a same taxonomy term. Default false.\n * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.\n * @param bool         $previous       Optional. Whether to retrieve previous post. Default true\n * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.\n * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no\n *                             corresponding post exists.\n */\nfunction get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {\n\tglobal $wpdb;\n\n\t$post = get_post();\n\tif ( ! $post || ! taxonomy_exists( $taxonomy ) ) {\n\t\treturn null;\n\t}\n\n\t$current_post_date = $post->post_date;\n\n\t$join     = '';\n\t$where    = '';\n\t$adjacent = $previous ? 'previous' : 'next';\n\n\tif ( ! empty( $excluded_terms ) && ! is_array( $excluded_terms ) ) {\n\t\t// Back-compat, $excluded_terms used to be $excluded_categories with IDs separated by \" and \".\n\t\tif ( false !== strpos( $excluded_terms, ' and ' ) ) {\n\t\t\t_deprecated_argument(\n\t\t\t\t__FUNCTION__,\n\t\t\t\t'3.3.0',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: The word 'and'. */\n\t\t\t\t\t__( 'Use commas instead of %s to separate excluded terms.' ),\n\t\t\t\t\t\"'and'\"\n\t\t\t\t)\n\t\t\t);\n\t\t\t$excluded_terms = explode( ' and ', $excluded_terms );\n\t\t} else {\n\t\t\t$excluded_terms = explode( ',', $excluded_terms );\n\t\t}\n\n\t\t$excluded_terms = array_map( 'intval', $excluded_terms );\n\t}\n\n\t/**\n\t * Filters the IDs of terms excluded from adjacent post queries.\n\t *\n\t * The dynamic portion of the hook name, `$adjacent`, refers to the type\n\t * of adjacency, 'next' or 'previous'.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $excluded_terms Array of excluded term IDs.\n\t */\n\t$excluded_terms = apply_filters( \"get_{$adjacent}_post_excluded_terms\", $excluded_terms );\n\n\tif ( $in_same_term || ! empty( $excluded_terms ) ) {\n\t\tif ( $in_same_term ) {\n\t\t\t$join  .= \" INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id\";\n\t\t\t$where .= $wpdb->prepare( 'AND tt.taxonomy = %s', $taxonomy );\n\n\t\t\tif ( ! is_object_in_taxonomy( $post->post_type, $taxonomy ) ) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\t$term_array = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );\n\n\t\t\t// Remove any exclusions from the term array to include.\n\t\t\t$term_array = array_diff( $term_array, (array) $excluded_terms );\n\t\t\t$term_array = array_map( 'intval', $term_array );\n\n\t\t\tif ( ! $term_array || is_wp_error( $term_array ) ) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\t$where .= ' AND tt.term_id IN (' . implode( ',', $term_array ) . ')';\n\t\t}\n\n\t\tif ( ! empty( $excluded_terms ) ) {\n\t\t\t$where .= \" AND p.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships tr LEFT JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) WHERE tt.term_id IN (\" . implode( ',', array_map( 'intval', $excluded_terms ) ) . ') )';\n\t\t}\n\t}\n\n\t// 'post_status' clause depends on the current user.\n\tif ( is_user_logged_in() ) {\n\t\t$user_id = get_current_user_id();\n\n\t\t$post_type_object = get_post_type_object( $post->post_type );\n\t\tif ( empty( $post_type_object ) ) {\n\t\t\t$post_type_cap    = $post->post_type;\n\t\t\t$read_private_cap = 'read_private_' . $post_type_cap . 's';\n\t\t} else {\n\t\t\t$read_private_cap = $post_type_object->cap->read_private_posts;\n\t\t}\n\n\t\t/*\n\t\t * Results should include private posts belonging to the current user, or private posts where the\n\t\t * current user has the 'read_private_posts' cap.\n\t\t */\n\t\t$private_states = get_post_stati( array( 'private' => true ) );\n\t\t$where         .= \" AND ( p.post_status = 'publish'\";\n\t\tforeach ( (array) $private_states as $state ) {\n\t\t\tif ( current_user_can( $read_private_cap ) ) {\n\t\t\t\t$where .= $wpdb->prepare( ' OR p.post_status = %s', $state );\n\t\t\t} else {\n\t\t\t\t$where .= $wpdb->prepare( ' OR (p.post_author = %d AND p.post_status = %s)', $user_id, $state );\n\t\t\t}\n\t\t}\n\t\t$where .= ' )';\n\t} else {\n\t\t$where .= \" AND p.post_status = 'publish'\";\n\t}\n\n\t$op    = $previous ? '<' : '>';\n\t$order = $previous ? 'DESC' : 'ASC';\n\n\t/**\n\t * Filters the JOIN clause in the SQL for an adjacent post query.\n\t *\n\t * The dynamic portion of the hook name, `$adjacent`, refers to the type\n\t * of adjacency, 'next' or 'previous'.\n\t *\n\t * @since 2.5.0\n\t * @since 4.4.0 Added the `$taxonomy` and `$post` parameters.\n\t *\n\t * @param string  $join           The JOIN clause in the SQL.\n\t * @param bool    $in_same_term   Whether post should be in a same taxonomy term.\n\t * @param array   $excluded_terms Array of excluded term IDs.\n\t * @param string  $taxonomy       Taxonomy. Used to identify the term used when `$in_same_term` is true.\n\t * @param WP_Post $post           WP_Post object.\n\t */\n\t$join = apply_filters( \"get_{$adjacent}_post_join\", $join, $in_same_term, $excluded_terms, $taxonomy, $post );\n\n\t/**\n\t * Filters the WHERE clause in the SQL for an adjacent post query.\n\t *\n\t * The dynamic portion of the hook name, `$adjacent`, refers to the type\n\t * of adjacency, 'next' or 'previous'.\n\t *\n\t * @since 2.5.0\n\t * @since 4.4.0 Added the `$taxonomy` and `$post` parameters.\n\t *\n\t * @param string  $where          The `WHERE` clause in the SQL.\n\t * @param bool    $in_same_term   Whether post should be in a same taxonomy term.\n\t * @param array   $excluded_terms Array of excluded term IDs.\n\t * @param string  $taxonomy       Taxonomy. Used to identify the term used when `$in_same_term` is true.\n\t * @param WP_Post $post           WP_Post object.\n\t */\n\t$where = apply_filters( \"get_{$adjacent}_post_where\", $wpdb->prepare( \"WHERE p.post_date $op %s AND p.post_type = %s $where\", $current_post_date, $post->post_type ), $in_same_term, $excluded_terms, $taxonomy, $post );\n\n\t/**\n\t * Filters the ORDER BY clause in the SQL for an adjacent post query.\n\t *\n\t * The dynamic portion of the hook name, `$adjacent`, refers to the type\n\t * of adjacency, 'next' or 'previous'.\n\t *\n\t * @since 2.5.0\n\t * @since 4.4.0 Added the `$post` parameter.\n\t * @since 4.9.0 Added the `$order` parameter.\n\t *\n\t * @param string $order_by The `ORDER BY` clause in the SQL.\n\t * @param WP_Post $post    WP_Post object.\n\t * @param string  $order   Sort order. 'DESC' for previous post, 'ASC' for next.\n\t */\n\t$sort = apply_filters( \"get_{$adjacent}_post_sort\", \"ORDER BY p.post_date $order LIMIT 1\", $post, $order );\n\n\t$query     = \"SELECT p.ID FROM $wpdb->posts AS p $join $where $sort\";\n\t$query_key = 'adjacent_post_' . md5( $query );\n\t$result    = wp_cache_get( $query_key, 'counts' );\n\tif ( false !== $result ) {\n\t\tif ( $result ) {\n\t\t\t$result = get_post( $result );\n\t\t}\n\t\treturn $result;\n\t}\n\n\t$result = $wpdb->get_var( $query );\n\tif ( null === $result ) {\n\t\t$result = '';\n\t}\n\n\twp_cache_set( $query_key, $result, 'counts' );\n\n\tif ( $result ) {\n\t\t$result = get_post( $result );\n\t}\n\n\treturn $result;\n}\n\n/**\n * Retrieves the adjacent post relational link.\n *\n * Can either be next or previous post relational link.\n *\n * @since 2.8.0\n *\n * @param string       $title          Optional. Link title format. Default '%title'.\n * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.\n * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.\n * @param bool         $previous       Optional. Whether to display link to previous or next post. Default true.\n * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.\n * @return string|void The adjacent post relational link URL.\n */\nfunction get_adjacent_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {\n\t$post = get_post();\n\tif ( $previous && is_attachment() && $post ) {\n\t\t$post = get_post( $post->post_parent );\n\t} else {\n\t\t$post = get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy );\n\t}\n\n\tif ( empty( $post ) ) {\n\t\treturn;\n\t}\n\n\t$post_title = the_title_attribute(\n\t\tarray(\n\t\t\t'echo' => false,\n\t\t\t'post' => $post,\n\t\t)\n\t);\n\n\tif ( empty( $post_title ) ) {\n\t\t$post_title = $previous ? __( 'Previous Post' ) : __( 'Next Post' );\n\t}\n\n\t$date = mysql2date( get_option( 'date_format' ), $post->post_date );\n\n\t$title = str_replace( '%title', $post_title, $title );\n\t$title = str_replace( '%date', $date, $title );\n\n\t$link  = $previous ? \"<link rel='prev' title='\" : \"<link rel='next' title='\";\n\t$link .= esc_attr( $title );\n\t$link .= \"' href='\" . get_permalink( $post ) . \"' />\\n\";\n\n\t$adjacent = $previous ? 'previous' : 'next';\n\n\t/**\n\t * Filters the adjacent post relational link.\n\t *\n\t * The dynamic portion of the hook name, `$adjacent`, refers to the type\n\t * of adjacency, 'next' or 'previous'.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $link The relational link.\n\t */\n\treturn apply_filters( \"{$adjacent}_post_rel_link\", $link );\n}\n\n/**\n * Displays the relational links for the posts adjacent to the current post.\n *\n * @since 2.8.0\n *\n * @param string       $title          Optional. Link title format. Default '%title'.\n * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.\n * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.\n * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.\n */\nfunction adjacent_posts_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {\n\techo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, true, $taxonomy );\n\techo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, false, $taxonomy );\n}\n\n/**\n * Displays relational links for the posts adjacent to the current post for single post pages.\n *\n * This is meant to be attached to actions like 'wp_head'. Do not call this directly in plugins\n * or theme templates.\n *\n * @since 3.0.0\n *\n * @see adjacent_posts_rel_link()\n */\nfunction adjacent_posts_rel_link_wp_head() {\n\tif ( ! is_single() || is_attachment() ) {\n\t\treturn;\n\t}\n\tadjacent_posts_rel_link();\n}\n\n/**\n * Displays the relational link for the next post adjacent to the current post.\n *\n * @since 2.8.0\n *\n * @see get_adjacent_post_rel_link()\n *\n * @param string       $title          Optional. Link title format. Default '%title'.\n * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.\n * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.\n * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.\n */\nfunction next_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {\n\techo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, false, $taxonomy );\n}\n\n/**\n * Displays the relational link for the previous post adjacent to the current post.\n *\n * @since 2.8.0\n *\n * @see get_adjacent_post_rel_link()\n *\n * @param string       $title          Optional. Link title format. Default '%title'.\n * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.\n * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default true.\n * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.\n */\nfunction prev_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {\n\techo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, true, $taxonomy );\n}\n\n/**\n * Retrieves the boundary post.\n *\n * Boundary being either the first or last post by publish date within the constraints specified\n * by $in_same_term or $excluded_terms.\n *\n * @since 2.8.0\n *\n * @param bool         $in_same_term   Optional. Whether returned post should be in a same taxonomy term.\n *                                     Default false.\n * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.\n *                                     Default empty.\n * @param bool         $start          Optional. Whether to retrieve first or last post. Default true\n * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.\n * @return null|array Array containing the boundary post object if successful, null otherwise.\n */\nfunction get_boundary_post( $in_same_term = false, $excluded_terms = '', $start = true, $taxonomy = 'category' ) {\n\t$post = get_post();\n\tif ( ! $post || ! is_single() || is_attachment() || ! taxonomy_exists( $taxonomy ) ) {\n\t\treturn null;\n\t}\n\n\t$query_args = array(\n\t\t'posts_per_page'         => 1,\n\t\t'order'                  => $start ? 'ASC' : 'DESC',\n\t\t'update_post_term_cache' => false,\n\t\t'update_post_meta_cache' => false,\n\t);\n\n\t$term_array = array();\n\n\tif ( ! is_array( $excluded_terms ) ) {\n\t\tif ( ! empty( $excluded_terms ) ) {\n\t\t\t$excluded_terms = explode( ',', $excluded_terms );\n\t\t} else {\n\t\t\t$excluded_terms = array();\n\t\t}\n\t}\n\n\tif ( $in_same_term || ! empty( $excluded_terms ) ) {\n\t\tif ( $in_same_term ) {\n\t\t\t$term_array = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );\n\t\t}\n\n\t\tif ( ! empty( $excluded_terms ) ) {\n\t\t\t$excluded_terms = array_map( 'intval', $excluded_terms );\n\t\t\t$excluded_terms = array_diff( $excluded_terms, $term_array );\n\n\t\t\t$inverse_terms = array();\n\t\t\tforeach ( $excluded_terms as $excluded_term ) {\n\t\t\t\t$inverse_terms[] = $excluded_term * -1;\n\t\t\t}\n\t\t\t$excluded_terms = $inverse_terms;\n\t\t}\n\n\t\t$query_args['tax_query'] = array(\n\t\t\tarray(\n\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t'terms'    => array_merge( $term_array, $excluded_terms ),\n\t\t\t),\n\t\t);\n\t}\n\n\treturn get_posts( $query_args );\n}\n\n/**\n * Retrieves the previous post link that is adjacent to the current post.\n *\n * @since 3.7.0\n *\n * @param string       $format         Optional. Link anchor format. Default '&laquo; %link'.\n * @param string       $link           Optional. Link permalink format. Default '%title'.\n * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.\n * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.\n * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.\n * @return string The link URL of the previous post in relation to the current post.\n */\nfunction get_previous_post_link( $format = '&laquo; %link', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {\n\treturn get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, true, $taxonomy );\n}\n\n/**\n * Displays the previous post link that is adjacent to the current post.\n *\n * @since 1.5.0\n *\n * @see get_previous_post_link()\n *\n * @param string       $format         Optional. Link anchor format. Default '&laquo; %link'.\n * @param string       $link           Optional. Link permalink format. Default '%title'.\n * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.\n * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.\n * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.\n */\nfunction previous_post_link( $format = '&laquo; %link', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {\n\techo get_previous_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy );\n}\n\n/**\n * Retrieves the next post link that is adjacent to the current post.\n *\n * @since 3.7.0\n *\n * @param string       $format         Optional. Link anchor format. Default '&laquo; %link'.\n * @param string       $link           Optional. Link permalink format. Default '%title'.\n * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.\n * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.\n * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.\n * @return string The link URL of the next post in relation to the current post.\n */\nfunction get_next_post_link( $format = '%link &raquo;', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {\n\treturn get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, false, $taxonomy );\n}\n\n/**\n * Displays the next post link that is adjacent to the current post.\n *\n * @since 1.5.0\n *\n * @see get_next_post_link()\n *\n * @param string       $format         Optional. Link anchor format. Default '&laquo; %link'.\n * @param string       $link           Optional. Link permalink format. Default '%title'\n * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.\n * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.\n * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.\n */\nfunction next_post_link( $format = '%link &raquo;', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {\n\techo get_next_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy );\n}\n\n/**\n * Retrieves the adjacent post link.\n *\n * Can be either next post link or previous.\n *\n * @since 3.7.0\n *\n * @param string       $format         Link anchor format.\n * @param string       $link           Link permalink format.\n * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.\n * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded terms IDs. Default empty.\n * @param bool         $previous       Optional. Whether to display link to previous or next post. Default true.\n * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.\n * @return string The link URL of the previous or next post in relation to the current post.\n */\nfunction get_adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {\n\tif ( $previous && is_attachment() ) {\n\t\t$post = get_post( get_post()->post_parent );\n\t} else {\n\t\t$post = get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy );\n\t}\n\n\tif ( ! $post ) {\n\t\t$output = '';\n\t} else {\n\t\t$title = $post->post_title;\n\n\t\tif ( empty( $post->post_title ) ) {\n\t\t\t$title = $previous ? __( 'Previous Post' ) : __( 'Next Post' );\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t$title = apply_filters( 'the_title', $title, $post->ID );\n\n\t\t$date = mysql2date( get_option( 'date_format' ), $post->post_date );\n\t\t$rel  = $previous ? 'prev' : 'next';\n\n\t\t$string = '<a href=\"' . get_permalink( $post ) . '\" rel=\"' . $rel . '\">';\n\t\t$inlink = str_replace( '%title', $title, $link );\n\t\t$inlink = str_replace( '%date', $date, $inlink );\n\t\t$inlink = $string . $inlink . '</a>';\n\n\t\t$output = str_replace( '%link', $inlink, $format );\n\t}\n\n\t$adjacent = $previous ? 'previous' : 'next';\n\n\t/**\n\t * Filters the adjacent post link.\n\t *\n\t * The dynamic portion of the hook name, `$adjacent`, refers to the type\n\t * of adjacency, 'next' or 'previous'.\n\t *\n\t * @since 2.6.0\n\t * @since 4.2.0 Added the `$adjacent` parameter.\n\t *\n\t * @param string  $output   The adjacent post link.\n\t * @param string  $format   Link anchor format.\n\t * @param string  $link     Link permalink format.\n\t * @param WP_Post $post     The adjacent post.\n\t * @param string  $adjacent Whether the post is previous or next.\n\t */\n\treturn apply_filters( \"{$adjacent}_post_link\", $output, $format, $link, $post, $adjacent );\n}\n\n/**\n * Displays the adjacent post link.\n *\n * Can be either next post link or previous.\n *\n * @since 2.5.0\n *\n * @param string       $format         Link anchor format.\n * @param string       $link           Link permalink format.\n * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.\n * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded category IDs. Default empty.\n * @param bool         $previous       Optional. Whether to display link to previous or next post. Default true.\n * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.\n */\nfunction adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {\n\techo get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, $previous, $taxonomy );\n}\n\n/**\n * Retrieves the link for a page number.\n *\n * @since 1.5.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param int  $pagenum Optional. Page number. Default 1.\n * @param bool $escape  Optional. Whether to escape the URL for display, with esc_url(). Defaults to true.\n *                      Otherwise, prepares the URL with esc_url_raw().\n * @return string The link URL for the given page number.\n */\nfunction get_pagenum_link( $pagenum = 1, $escape = true ) {\n\tglobal $wp_rewrite;\n\n\t$pagenum = (int) $pagenum;\n\n\t$request = remove_query_arg( 'paged' );\n\n\t$home_root = parse_url( home_url() );\n\t$home_root = ( isset( $home_root['path'] ) ) ? $home_root['path'] : '';\n\t$home_root = preg_quote( $home_root, '|' );\n\n\t$request = preg_replace( '|^' . $home_root . '|i', '', $request );\n\t$request = preg_replace( '|^/+|', '', $request );\n\n\tif ( ! $wp_rewrite->using_permalinks() || is_admin() ) {\n\t\t$base = trailingslashit( get_bloginfo( 'url' ) );\n\n\t\tif ( $pagenum > 1 ) {\n\t\t\t$result = add_query_arg( 'paged', $pagenum, $base . $request );\n\t\t} else {\n\t\t\t$result = $base . $request;\n\t\t}\n\t} else {\n\t\t$qs_regex = '|\\?.*?$|';\n\t\tpreg_match( $qs_regex, $request, $qs_match );\n\n\t\tif ( ! empty( $qs_match[0] ) ) {\n\t\t\t$query_string = $qs_match[0];\n\t\t\t$request      = preg_replace( $qs_regex, '', $request );\n\t\t} else {\n\t\t\t$query_string = '';\n\t\t}\n\n\t\t$request = preg_replace( \"|$wp_rewrite->pagination_base/\\d+/?$|\", '', $request );\n\t\t$request = preg_replace( '|^' . preg_quote( $wp_rewrite->index, '|' ) . '|i', '', $request );\n\t\t$request = ltrim( $request, '/' );\n\n\t\t$base = trailingslashit( get_bloginfo( 'url' ) );\n\n\t\tif ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' !== $request ) ) {\n\t\t\t$base .= $wp_rewrite->index . '/';\n\t\t}\n\n\t\tif ( $pagenum > 1 ) {\n\t\t\t$request = ( ( ! empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . '/' . $pagenum, 'paged' );\n\t\t}\n\n\t\t$result = $base . $request . $query_string;\n\t}\n\n\t/**\n\t * Filters the page number link for the current request.\n\t *\n\t * @since 2.5.0\n\t * @since 5.2.0 Added the `$pagenum` argument.\n\t *\n\t * @param string $result  The page number link.\n\t * @param int    $pagenum The page number.\n\t */\n\t$result = apply_filters( 'get_pagenum_link', $result, $pagenum );\n\n\tif ( $escape ) {\n\t\treturn esc_url( $result );\n\t} else {\n\t\treturn esc_url_raw( $result );\n\t}\n}\n\n/**\n * Retrieves the next posts page link.\n *\n * Backported from 2.1.3 to 2.0.10.\n *\n * @since 2.0.10\n *\n * @global int $paged\n *\n * @param int $max_page Optional. Max pages. Default 0.\n * @return string|void The link URL for next posts page.\n */\nfunction get_next_posts_page_link( $max_page = 0 ) {\n\tglobal $paged;\n\n\tif ( ! is_single() ) {\n\t\tif ( ! $paged ) {\n\t\t\t$paged = 1;\n\t\t}\n\t\t$nextpage = intval( $paged ) + 1;\n\t\tif ( ! $max_page || $max_page >= $nextpage ) {\n\t\t\treturn get_pagenum_link( $nextpage );\n\t\t}\n\t}\n}\n\n/**\n * Displays or retrieves the next posts page link.\n *\n * @since 0.71\n *\n * @param int  $max_page Optional. Max pages. Default 0.\n * @param bool $echo     Optional. Whether to echo the link. Default true.\n * @return string|void The link URL for next posts page if `$echo = false`.\n */\nfunction next_posts( $max_page = 0, $echo = true ) {\n\t$output = esc_url( get_next_posts_page_link( $max_page ) );\n\n\tif ( $echo ) {\n\t\techo $output;\n\t} else {\n\t\treturn $output;\n\t}\n}\n\n/**\n * Retrieves the next posts page link.\n *\n * @since 2.7.0\n *\n * @global int      $paged\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param string $label    Content for link text.\n * @param int    $max_page Optional. Max pages. Default 0.\n * @return string|void HTML-formatted next posts page link.\n */\nfunction get_next_posts_link( $label = null, $max_page = 0 ) {\n\tglobal $paged, $wp_query;\n\n\tif ( ! $max_page ) {\n\t\t$max_page = $wp_query->max_num_pages;\n\t}\n\n\tif ( ! $paged ) {\n\t\t$paged = 1;\n\t}\n\n\t$nextpage = intval( $paged ) + 1;\n\n\tif ( null === $label ) {\n\t\t$label = __( 'Next Page &raquo;' );\n\t}\n\n\tif ( ! is_single() && ( $nextpage <= $max_page ) ) {\n\t\t/**\n\t\t * Filters the anchor tag attributes for the next posts page link.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param string $attributes Attributes for the anchor tag.\n\t\t */\n\t\t$attr = apply_filters( 'next_posts_link_attributes', '' );\n\n\t\treturn '<a href=\"' . next_posts( $max_page, false ) . \"\\\" $attr>\" . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label ) . '</a>';\n\t}\n}\n\n/**\n * Displays the next posts page link.\n *\n * @since 0.71\n *\n * @param string $label    Content for link text.\n * @param int    $max_page Optional. Max pages. Default 0.\n */\nfunction next_posts_link( $label = null, $max_page = 0 ) {\n\techo get_next_posts_link( $label, $max_page );\n}\n\n/**\n * Retrieves the previous posts page link.\n *\n * Will only return string, if not on a single page or post.\n *\n * Backported to 2.0.10 from 2.1.3.\n *\n * @since 2.0.10\n *\n * @global int $paged\n *\n * @return string|void The link for the previous posts page.\n */\nfunction get_previous_posts_page_link() {\n\tglobal $paged;\n\n\tif ( ! is_single() ) {\n\t\t$nextpage = intval( $paged ) - 1;\n\t\tif ( $nextpage < 1 ) {\n\t\t\t$nextpage = 1;\n\t\t}\n\t\treturn get_pagenum_link( $nextpage );\n\t}\n}\n\n/**\n * Displays or retrieves the previous posts page link.\n *\n * @since 0.71\n *\n * @param bool $echo Optional. Whether to echo the link. Default true.\n * @return string|void The previous posts page link if `$echo = false`.\n */\nfunction previous_posts( $echo = true ) {\n\t$output = esc_url( get_previous_posts_page_link() );\n\n\tif ( $echo ) {\n\t\techo $output;\n\t} else {\n\t\treturn $output;\n\t}\n}\n\n/**\n * Retrieves the previous posts page link.\n *\n * @since 2.7.0\n *\n * @global int $paged\n *\n * @param string $label Optional. Previous page link text.\n * @return string|void HTML-formatted previous page link.\n */\nfunction get_previous_posts_link( $label = null ) {\n\tglobal $paged;\n\n\tif ( null === $label ) {\n\t\t$label = __( '&laquo; Previous Page' );\n\t}\n\n\tif ( ! is_single() && $paged > 1 ) {\n\t\t/**\n\t\t * Filters the anchor tag attributes for the previous posts page link.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param string $attributes Attributes for the anchor tag.\n\t\t */\n\t\t$attr = apply_filters( 'previous_posts_link_attributes', '' );\n\t\treturn '<a href=\"' . previous_posts( false ) . \"\\\" $attr>\" . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label ) . '</a>';\n\t}\n}\n\n/**\n * Displays the previous posts page link.\n *\n * @since 0.71\n *\n * @param string $label Optional. Previous page link text.\n */\nfunction previous_posts_link( $label = null ) {\n\techo get_previous_posts_link( $label );\n}\n\n/**\n * Retrieves the post pages link navigation for previous and next pages.\n *\n * @since 2.8.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param string|array $args {\n *     Optional. Arguments to build the post pages link navigation.\n *\n *     @type string $sep      Separator character. Default '&#8212;'.\n *     @type string $prelabel Link text to display for the previous page link.\n *                            Default '&laquo; Previous Page'.\n *     @type string $nxtlabel Link text to display for the next page link.\n *                            Default 'Next Page &raquo;'.\n * }\n * @return string The posts link navigation.\n */\nfunction get_posts_nav_link( $args = array() ) {\n\tglobal $wp_query;\n\n\t$return = '';\n\n\tif ( ! is_singular() ) {\n\t\t$defaults = array(\n\t\t\t'sep'      => ' &#8212; ',\n\t\t\t'prelabel' => __( '&laquo; Previous Page' ),\n\t\t\t'nxtlabel' => __( 'Next Page &raquo;' ),\n\t\t);\n\t\t$args     = wp_parse_args( $args, $defaults );\n\n\t\t$max_num_pages = $wp_query->max_num_pages;\n\t\t$paged         = get_query_var( 'paged' );\n\n\t\t// Only have sep if there's both prev and next results.\n\t\tif ( $paged < 2 || $paged >= $max_num_pages ) {\n\t\t\t$args['sep'] = '';\n\t\t}\n\n\t\tif ( $max_num_pages > 1 ) {\n\t\t\t$return  = get_previous_posts_link( $args['prelabel'] );\n\t\t\t$return .= preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $args['sep'] );\n\t\t\t$return .= get_next_posts_link( $args['nxtlabel'] );\n\t\t}\n\t}\n\treturn $return;\n\n}\n\n/**\n * Displays the post pages link navigation for previous and next pages.\n *\n * @since 0.71\n *\n * @param string $sep      Optional. Separator for posts navigation links. Default empty.\n * @param string $prelabel Optional. Label for previous pages. Default empty.\n * @param string $nxtlabel Optional Label for next pages. Default empty.\n */\nfunction posts_nav_link( $sep = '', $prelabel = '', $nxtlabel = '' ) {\n\t$args = array_filter( compact( 'sep', 'prelabel', 'nxtlabel' ) );\n\techo get_posts_nav_link( $args );\n}\n\n/**\n * Retrieves the navigation to next/previous post, when applicable.\n *\n * @since 4.1.0\n * @since 4.4.0 Introduced the `in_same_term`, `excluded_terms`, and `taxonomy` arguments.\n * @since 5.3.0 Added the `aria_label` parameter.\n * @since 5.5.0 Added the `class` parameter.\n *\n * @param array $args {\n *     Optional. Default post navigation arguments. Default empty array.\n *\n *     @type string       $prev_text          Anchor text to display in the previous post link. Default '%title'.\n *     @type string       $next_text          Anchor text to display in the next post link. Default '%title'.\n *     @type bool         $in_same_term       Whether link should be in a same taxonomy term. Default false.\n *     @type array|string $excluded_terms     Array or comma-separated list of excluded term IDs. Default empty.\n *     @type string       $taxonomy           Taxonomy, if `$in_same_term` is true. Default 'category'.\n *     @type string       $screen_reader_text Screen reader text for the nav element. Default 'Post navigation'.\n *     @type string       $aria_label         ARIA label text for the nav element. Default 'Posts'.\n *     @type string       $class              Custom class for the nav element. Default 'post-navigation'.\n * }\n * @return string Markup for post links.\n */\nfunction get_the_post_navigation( $args = array() ) {\n\t// Make sure the nav element has an aria-label attribute: fallback to the screen reader text.\n\tif ( ! empty( $args['screen_reader_text'] ) && empty( $args['aria_label'] ) ) {\n\t\t$args['aria_label'] = $args['screen_reader_text'];\n\t}\n\n\t$args = wp_parse_args(\n\t\t$args,\n\t\tarray(\n\t\t\t'prev_text'          => '%title',\n\t\t\t'next_text'          => '%title',\n\t\t\t'in_same_term'       => false,\n\t\t\t'excluded_terms'     => '',\n\t\t\t'taxonomy'           => 'category',\n\t\t\t'screen_reader_text' => __( 'Post navigation' ),\n\t\t\t'aria_label'         => __( 'Posts' ),\n\t\t\t'class'              => 'post-navigation',\n\t\t)\n\t);\n\n\t$navigation = '';\n\n\t$previous = get_previous_post_link(\n\t\t'<div class=\"nav-previous\">%link</div>',\n\t\t$args['prev_text'],\n\t\t$args['in_same_term'],\n\t\t$args['excluded_terms'],\n\t\t$args['taxonomy']\n\t);\n\n\t$next = get_next_post_link(\n\t\t'<div class=\"nav-next\">%link</div>',\n\t\t$args['next_text'],\n\t\t$args['in_same_term'],\n\t\t$args['excluded_terms'],\n\t\t$args['taxonomy']\n\t);\n\n\t// Only add markup if there's somewhere to navigate to.\n\tif ( $previous || $next ) {\n\t\t$navigation = _navigation_markup( $previous . $next, $args['class'], $args['screen_reader_text'], $args['aria_label'] );\n\t}\n\n\treturn $navigation;\n}\n\n/**\n * Displays the navigation to next/previous post, when applicable.\n *\n * @since 4.1.0\n *\n * @param array $args Optional. See get_the_post_navigation() for available arguments.\n *                    Default empty array.\n */\nfunction the_post_navigation( $args = array() ) {\n\techo get_the_post_navigation( $args );\n}\n\n/**\n * Returns the navigation to next/previous set of posts, when applicable.\n *\n * @since 4.1.0\n * @since 5.3.0 Added the `aria_label` parameter.\n * @since 5.5.0 Added the `class` parameter.\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param array $args {\n *     Optional. Default posts navigation arguments. Default empty array.\n *\n *     @type string $prev_text          Anchor text to display in the previous posts link.\n *                                      Default 'Older posts'.\n *     @type string $next_text          Anchor text to display in the next posts link.\n *                                      Default 'Newer posts'.\n *     @type string $screen_reader_text Screen reader text for the nav element.\n *                                      Default 'Posts navigation'.\n *     @type string $aria_label         ARIA label text for the nav element. Default 'Posts'.\n *     @type string $class              Custom class for the nav element. Default 'posts-navigation'.\n * }\n * @return string Markup for posts links.\n */\nfunction get_the_posts_navigation( $args = array() ) {\n\t$navigation = '';\n\n\t// Don't print empty markup if there's only one page.\n\tif ( $GLOBALS['wp_query']->max_num_pages > 1 ) {\n\t\t// Make sure the nav element has an aria-label attribute: fallback to the screen reader text.\n\t\tif ( ! empty( $args['screen_reader_text'] ) && empty( $args['aria_label'] ) ) {\n\t\t\t$args['aria_label'] = $args['screen_reader_text'];\n\t\t}\n\n\t\t$args = wp_parse_args(\n\t\t\t$args,\n\t\t\tarray(\n\t\t\t\t'prev_text'          => __( 'Older posts' ),\n\t\t\t\t'next_text'          => __( 'Newer posts' ),\n\t\t\t\t'screen_reader_text' => __( 'Posts navigation' ),\n\t\t\t\t'aria_label'         => __( 'Posts' ),\n\t\t\t\t'class'              => 'posts-navigation',\n\t\t\t)\n\t\t);\n\n\t\t$next_link = get_previous_posts_link( $args['next_text'] );\n\t\t$prev_link = get_next_posts_link( $args['prev_text'] );\n\n\t\tif ( $prev_link ) {\n\t\t\t$navigation .= '<div class=\"nav-previous\">' . $prev_link . '</div>';\n\t\t}\n\n\t\tif ( $next_link ) {\n\t\t\t$navigation .= '<div class=\"nav-next\">' . $next_link . '</div>';\n\t\t}\n\n\t\t$navigation = _navigation_markup( $navigation, $args['class'], $args['screen_reader_text'], $args['aria_label'] );\n\t}\n\n\treturn $navigation;\n}\n\n/**\n * Displays the navigation to next/previous set of posts, when applicable.\n *\n * @since 4.1.0\n *\n * @param array $args Optional. See get_the_posts_navigation() for available arguments.\n *                    Default empty array.\n */\nfunction the_posts_navigation( $args = array() ) {\n\techo get_the_posts_navigation( $args );\n}\n\n/**\n * Retrieves a paginated navigation to next/previous set of posts, when applicable.\n *\n * @since 4.1.0\n * @since 5.3.0 Added the `aria_label` parameter.\n * @since 5.5.0 Added the `class` parameter.\n *\n * @param array $args {\n *     Optional. Default pagination arguments, see paginate_links().\n *\n *     @type string $screen_reader_text Screen reader text for navigation element.\n *                                      Default 'Posts navigation'.\n *     @type string $aria_label         ARIA label text for the nav element. Default 'Posts'.\n *     @type string $class              Custom class for the nav element. Default 'pagination'.\n * }\n * @return string Markup for pagination links.\n */\nfunction get_the_posts_pagination( $args = array() ) {\n\t$navigation = '';\n\n\t// Don't print empty markup if there's only one page.\n\tif ( $GLOBALS['wp_query']->max_num_pages > 1 ) {\n\t\t// Make sure the nav element has an aria-label attribute: fallback to the screen reader text.\n\t\tif ( ! empty( $args['screen_reader_text'] ) && empty( $args['aria_label'] ) ) {\n\t\t\t$args['aria_label'] = $args['screen_reader_text'];\n\t\t}\n\n\t\t$args = wp_parse_args(\n\t\t\t$args,\n\t\t\tarray(\n\t\t\t\t'mid_size'           => 1,\n\t\t\t\t'prev_text'          => _x( 'Previous', 'previous set of posts' ),\n\t\t\t\t'next_text'          => _x( 'Next', 'next set of posts' ),\n\t\t\t\t'screen_reader_text' => __( 'Posts navigation' ),\n\t\t\t\t'aria_label'         => __( 'Posts' ),\n\t\t\t\t'class'              => 'pagination',\n\t\t\t)\n\t\t);\n\n\t\t// Make sure we get a string back. Plain is the next best thing.\n\t\tif ( isset( $args['type'] ) && 'array' === $args['type'] ) {\n\t\t\t$args['type'] = 'plain';\n\t\t}\n\n\t\t// Set up paginated links.\n\t\t$links = paginate_links( $args );\n\n\t\tif ( $links ) {\n\t\t\t$navigation = _navigation_markup( $links, $args['class'], $args['screen_reader_text'], $args['aria_label'] );\n\t\t}\n\t}\n\n\treturn $navigation;\n}\n\n/**\n * Displays a paginated navigation to next/previous set of posts, when applicable.\n *\n * @since 4.1.0\n *\n * @param array $args Optional. See get_the_posts_pagination() for available arguments.\n *                    Default empty array.\n */\nfunction the_posts_pagination( $args = array() ) {\n\techo get_the_posts_pagination( $args );\n}\n\n/**\n * Wraps passed links in navigational markup.\n *\n * @since 4.1.0\n * @since 5.3.0 Added the `aria_label` parameter.\n * @access private\n *\n * @param string $links              Navigational links.\n * @param string $class              Optional. Custom class for the nav element.\n *                                   Default 'posts-navigation'.\n * @param string $screen_reader_text Optional. Screen reader text for the nav element.\n *                                   Default 'Posts navigation'.\n * @param string $aria_label         Optional. ARIA label for the nav element.\n *                                   Defaults to the value of `$screen_reader_text`.\n * @return string Navigation template tag.\n */\nfunction _navigation_markup( $links, $class = 'posts-navigation', $screen_reader_text = '', $aria_label = '' ) {\n\tif ( empty( $screen_reader_text ) ) {\n\t\t$screen_reader_text = __( 'Posts navigation' );\n\t}\n\tif ( empty( $aria_label ) ) {\n\t\t$aria_label = $screen_reader_text;\n\t}\n\n\t$template = '\n\t<nav class=\"navigation %1$s\" role=\"navigation\" aria-label=\"%4$s\">\n\t\t<h2 class=\"screen-reader-text\">%2$s</h2>\n\t\t<div class=\"nav-links\">%3$s</div>\n\t</nav>';\n\n\t/**\n\t * Filters the navigation markup template.\n\t *\n\t * Note: The filtered template HTML must contain specifiers for the navigation\n\t * class (%1$s), the screen-reader-text value (%2$s), placement of the navigation\n\t * links (%3$s), and ARIA label text if screen-reader-text does not fit that (%4$s):\n\t *\n\t *     <nav class=\"navigation %1$s\" role=\"navigation\" aria-label=\"%4$s\">\n\t *         <h2 class=\"screen-reader-text\">%2$s</h2>\n\t *         <div class=\"nav-links\">%3$s</div>\n\t *     </nav>\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $template The default template.\n\t * @param string $class    The class passed by the calling function.\n\t * @return string Navigation template.\n\t */\n\t$template = apply_filters( 'navigation_markup_template', $template, $class );\n\n\treturn sprintf( $template, sanitize_html_class( $class ), esc_html( $screen_reader_text ), $links, esc_html( $aria_label ) );\n}\n\n/**\n * Retrieves the comments page number link.\n *\n * @since 2.7.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param int $pagenum  Optional. Page number. Default 1.\n * @param int $max_page Optional. The maximum number of comment pages. Default 0.\n * @return string The comments page number link URL.\n */\nfunction get_comments_pagenum_link( $pagenum = 1, $max_page = 0 ) {\n\tglobal $wp_rewrite;\n\n\t$pagenum = (int) $pagenum;\n\n\t$result = get_permalink();\n\n\tif ( 'newest' === get_option( 'default_comments_page' ) ) {\n\t\tif ( $pagenum != $max_page ) {\n\t\t\tif ( $wp_rewrite->using_permalinks() ) {\n\t\t\t\t$result = user_trailingslashit( trailingslashit( $result ) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged' );\n\t\t\t} else {\n\t\t\t\t$result = add_query_arg( 'cpage', $pagenum, $result );\n\t\t\t}\n\t\t}\n\t} elseif ( $pagenum > 1 ) {\n\t\tif ( $wp_rewrite->using_permalinks() ) {\n\t\t\t$result = user_trailingslashit( trailingslashit( $result ) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged' );\n\t\t} else {\n\t\t\t$result = add_query_arg( 'cpage', $pagenum, $result );\n\t\t}\n\t}\n\n\t$result .= '#comments';\n\n\t/**\n\t * Filters the comments page number link for the current request.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $result The comments page number link.\n\t */\n\treturn apply_filters( 'get_comments_pagenum_link', $result );\n}\n\n/**\n * Retrieves the link to the next comments page.\n *\n * @since 2.7.1\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param string $label    Optional. Label for link text. Default empty.\n * @param int    $max_page Optional. Max page. Default 0.\n * @return string|void HTML-formatted link for the next page of comments.\n */\nfunction get_next_comments_link( $label = '', $max_page = 0 ) {\n\tglobal $wp_query;\n\n\tif ( ! is_singular() ) {\n\t\treturn;\n\t}\n\n\t$page = get_query_var( 'cpage' );\n\n\tif ( ! $page ) {\n\t\t$page = 1;\n\t}\n\n\t$nextpage = intval( $page ) + 1;\n\n\tif ( empty( $max_page ) ) {\n\t\t$max_page = $wp_query->max_num_comment_pages;\n\t}\n\n\tif ( empty( $max_page ) ) {\n\t\t$max_page = get_comment_pages_count();\n\t}\n\n\tif ( $nextpage > $max_page ) {\n\t\treturn;\n\t}\n\n\tif ( empty( $label ) ) {\n\t\t$label = __( 'Newer Comments &raquo;' );\n\t}\n\n\t/**\n\t * Filters the anchor tag attributes for the next comments page link.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $attributes Attributes for the anchor tag.\n\t */\n\treturn '<a href=\"' . esc_url( get_comments_pagenum_link( $nextpage, $max_page ) ) . '\" ' . apply_filters( 'next_comments_link_attributes', '' ) . '>' . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label ) . '</a>';\n}\n\n/**\n * Displays the link to the next comments page.\n *\n * @since 2.7.0\n *\n * @param string $label    Optional. Label for link text. Default empty.\n * @param int    $max_page Optional. Max page. Default 0.\n */\nfunction next_comments_link( $label = '', $max_page = 0 ) {\n\techo get_next_comments_link( $label, $max_page );\n}\n\n/**\n * Retrieves the link to the previous comments page.\n *\n * @since 2.7.1\n *\n * @param string $label Optional. Label for comments link text. Default empty.\n * @return string|void HTML-formatted link for the previous page of comments.\n */\nfunction get_previous_comments_link( $label = '' ) {\n\tif ( ! is_singular() ) {\n\t\treturn;\n\t}\n\n\t$page = get_query_var( 'cpage' );\n\n\tif ( intval( $page ) <= 1 ) {\n\t\treturn;\n\t}\n\n\t$prevpage = intval( $page ) - 1;\n\n\tif ( empty( $label ) ) {\n\t\t$label = __( '&laquo; Older Comments' );\n\t}\n\n\t/**\n\t * Filters the anchor tag attributes for the previous comments page link.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $attributes Attributes for the anchor tag.\n\t */\n\treturn '<a href=\"' . esc_url( get_comments_pagenum_link( $prevpage ) ) . '\" ' . apply_filters( 'previous_comments_link_attributes', '' ) . '>' . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label ) . '</a>';\n}\n\n/**\n * Displays the link to the previous comments page.\n *\n * @since 2.7.0\n *\n * @param string $label Optional. Label for comments link text. Default empty.\n */\nfunction previous_comments_link( $label = '' ) {\n\techo get_previous_comments_link( $label );\n}\n\n/**\n * Displays or retrieves pagination links for the comments on the current post.\n *\n * @see paginate_links()\n * @since 2.7.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string|array $args Optional args. See paginate_links(). Default empty array.\n * @return void|string|array Void if 'echo' argument is true and 'type' is not an array,\n *                           or if the query is not for an existing single post of any post type.\n *                           Otherwise, markup for comment page links or array of comment page links,\n *                           depending on 'type' argument.\n */\nfunction paginate_comments_links( $args = array() ) {\n\tglobal $wp_rewrite;\n\n\tif ( ! is_singular() ) {\n\t\treturn;\n\t}\n\n\t$page = get_query_var( 'cpage' );\n\tif ( ! $page ) {\n\t\t$page = 1;\n\t}\n\t$max_page = get_comment_pages_count();\n\t$defaults = array(\n\t\t'base'         => add_query_arg( 'cpage', '%#%' ),\n\t\t'format'       => '',\n\t\t'total'        => $max_page,\n\t\t'current'      => $page,\n\t\t'echo'         => true,\n\t\t'type'         => 'plain',\n\t\t'add_fragment' => '#comments',\n\t);\n\tif ( $wp_rewrite->using_permalinks() ) {\n\t\t$defaults['base'] = user_trailingslashit( trailingslashit( get_permalink() ) . $wp_rewrite->comments_pagination_base . '-%#%', 'commentpaged' );\n\t}\n\n\t$args       = wp_parse_args( $args, $defaults );\n\t$page_links = paginate_links( $args );\n\n\tif ( $args['echo'] && 'array' !== $args['type'] ) {\n\t\techo $page_links;\n\t} else {\n\t\treturn $page_links;\n\t}\n}\n\n/**\n * Retrieves navigation to next/previous set of comments, when applicable.\n *\n * @since 4.4.0\n * @since 5.3.0 Added the `aria_label` parameter.\n * @since 5.5.0 Added the `class` parameter.\n *\n * @param array $args {\n *     Optional. Default comments navigation arguments.\n *\n *     @type string $prev_text          Anchor text to display in the previous comments link.\n *                                      Default 'Older comments'.\n *     @type string $next_text          Anchor text to display in the next comments link.\n *                                      Default 'Newer comments'.\n *     @type string $screen_reader_text Screen reader text for the nav element. Default 'Comments navigation'.\n *     @type string $aria_label         ARIA label text for the nav element. Default 'Comments'.\n *     @type string $class              Custom class for the nav element. Default 'comment-navigation'.\n * }\n * @return string Markup for comments links.\n */\nfunction get_the_comments_navigation( $args = array() ) {\n\t$navigation = '';\n\n\t// Are there comments to navigate through?\n\tif ( get_comment_pages_count() > 1 ) {\n\t\t// Make sure the nav element has an aria-label attribute: fallback to the screen reader text.\n\t\tif ( ! empty( $args['screen_reader_text'] ) && empty( $args['aria_label'] ) ) {\n\t\t\t$args['aria_label'] = $args['screen_reader_text'];\n\t\t}\n\n\t\t$args = wp_parse_args(\n\t\t\t$args,\n\t\t\tarray(\n\t\t\t\t'prev_text'          => __( 'Older comments' ),\n\t\t\t\t'next_text'          => __( 'Newer comments' ),\n\t\t\t\t'screen_reader_text' => __( 'Comments navigation' ),\n\t\t\t\t'aria_label'         => __( 'Comments' ),\n\t\t\t\t'class'              => 'comment-navigation',\n\t\t\t)\n\t\t);\n\n\t\t$prev_link = get_previous_comments_link( $args['prev_text'] );\n\t\t$next_link = get_next_comments_link( $args['next_text'] );\n\n\t\tif ( $prev_link ) {\n\t\t\t$navigation .= '<div class=\"nav-previous\">' . $prev_link . '</div>';\n\t\t}\n\n\t\tif ( $next_link ) {\n\t\t\t$navigation .= '<div class=\"nav-next\">' . $next_link . '</div>';\n\t\t}\n\n\t\t$navigation = _navigation_markup( $navigation, $args['class'], $args['screen_reader_text'], $args['aria_label'] );\n\t}\n\n\treturn $navigation;\n}\n\n/**\n * Displays navigation to next/previous set of comments, when applicable.\n *\n * @since 4.4.0\n *\n * @param array $args See get_the_comments_navigation() for available arguments. Default empty array.\n */\nfunction the_comments_navigation( $args = array() ) {\n\techo get_the_comments_navigation( $args );\n}\n\n/**\n * Retrieves a paginated navigation to next/previous set of comments, when applicable.\n *\n * @since 4.4.0\n * @since 5.3.0 Added the `aria_label` parameter.\n * @since 5.5.0 Added the `class` parameter.\n *\n * @see paginate_comments_links()\n *\n * @param array $args {\n *     Optional. Default pagination arguments.\n *\n *     @type string $screen_reader_text Screen reader text for the nav element. Default 'Comments navigation'.\n *     @type string $aria_label         ARIA label text for the nav element. Default 'Comments'.\n *     @type string $class              Custom class for the nav element. Default 'comments-pagination'.\n * }\n * @return string Markup for pagination links.\n */\nfunction get_the_comments_pagination( $args = array() ) {\n\t$navigation = '';\n\n\t// Make sure the nav element has an aria-label attribute: fallback to the screen reader text.\n\tif ( ! empty( $args['screen_reader_text'] ) && empty( $args['aria_label'] ) ) {\n\t\t$args['aria_label'] = $args['screen_reader_text'];\n\t}\n\n\t$args         = wp_parse_args(\n\t\t$args,\n\t\tarray(\n\t\t\t'screen_reader_text' => __( 'Comments navigation' ),\n\t\t\t'aria_label'         => __( 'Comments' ),\n\t\t\t'class'              => 'comments-pagination',\n\t\t)\n\t);\n\t$args['echo'] = false;\n\n\t// Make sure we get a string back. Plain is the next best thing.\n\tif ( isset( $args['type'] ) && 'array' === $args['type'] ) {\n\t\t$args['type'] = 'plain';\n\t}\n\n\t$links = paginate_comments_links( $args );\n\n\tif ( $links ) {\n\t\t$navigation = _navigation_markup( $links, $args['class'], $args['screen_reader_text'], $args['aria_label'] );\n\t}\n\n\treturn $navigation;\n}\n\n/**\n * Displays a paginated navigation to next/previous set of comments, when applicable.\n *\n * @since 4.4.0\n *\n * @param array $args See get_the_comments_pagination() for available arguments. Default empty array.\n */\nfunction the_comments_pagination( $args = array() ) {\n\techo get_the_comments_pagination( $args );\n}\n\n/**\n * Retrieves the URL for the current site where the front end is accessible.\n *\n * Returns the 'home' option with the appropriate protocol. The protocol will be 'https'\n * if is_ssl() evaluates to true; otherwise, it will be the same as the 'home' option.\n * If `$scheme` is 'http' or 'https', is_ssl() is overridden.\n *\n * @since 3.0.0\n *\n * @param string      $path   Optional. Path relative to the home URL. Default empty.\n * @param string|null $scheme Optional. Scheme to give the home URL context. Accepts\n *                            'http', 'https', 'relative', 'rest', or null. Default null.\n * @return string Home URL link with optional path appended.\n */\nfunction home_url( $path = '', $scheme = null ) {\n\treturn get_home_url( null, $path, $scheme );\n}\n\n/**\n * Retrieves the URL for a given site where the front end is accessible.\n *\n * Returns the 'home' option with the appropriate protocol. The protocol will be 'https'\n * if is_ssl() evaluates to true; otherwise, it will be the same as the 'home' option.\n * If `$scheme` is 'http' or 'https', is_ssl() is overridden.\n *\n * @since 3.0.0\n *\n * @global string $pagenow\n *\n * @param int         $blog_id Optional. Site ID. Default null (current site).\n * @param string      $path    Optional. Path relative to the home URL. Default empty.\n * @param string|null $scheme  Optional. Scheme to give the home URL context. Accepts\n *                             'http', 'https', 'relative', 'rest', or null. Default null.\n * @return string Home URL link with optional path appended.\n */\nfunction get_home_url( $blog_id = null, $path = '', $scheme = null ) {\n\tglobal $pagenow;\n\n\t$orig_scheme = $scheme;\n\n\tif ( empty( $blog_id ) || ! is_multisite() ) {\n\t\t$url = get_option( 'home' );\n\t} else {\n\t\tswitch_to_blog( $blog_id );\n\t\t$url = get_option( 'home' );\n\t\trestore_current_blog();\n\t}\n\n\tif ( ! in_array( $scheme, array( 'http', 'https', 'relative' ), true ) ) {\n\t\tif ( is_ssl() && ! is_admin() && 'wp-login.php' !== $pagenow ) {\n\t\t\t$scheme = 'https';\n\t\t} else {\n\t\t\t$scheme = parse_url( $url, PHP_URL_SCHEME );\n\t\t}\n\t}\n\n\t$url = set_url_scheme( $url, $scheme );\n\n\tif ( $path && is_string( $path ) ) {\n\t\t$url .= '/' . ltrim( $path, '/' );\n\t}\n\n\t/**\n\t * Filters the home URL.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string      $url         The complete home URL including scheme and path.\n\t * @param string      $path        Path relative to the home URL. Blank string if no path is specified.\n\t * @param string|null $orig_scheme Scheme to give the home URL context. Accepts 'http', 'https',\n\t *                                 'relative', 'rest', or null.\n\t * @param int|null    $blog_id     Site ID, or null for the current site.\n\t */\n\treturn apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id );\n}\n\n/**\n * Retrieves the URL for the current site where WordPress application files\n * (e.g. wp-blog-header.php or the wp-admin/ folder) are accessible.\n *\n * Returns the 'site_url' option with the appropriate protocol, 'https' if\n * is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is\n * overridden.\n *\n * @since 3.0.0\n *\n * @param string $path   Optional. Path relative to the site URL. Default empty.\n * @param string $scheme Optional. Scheme to give the site URL context. See set_url_scheme().\n * @return string Site URL link with optional path appended.\n */\nfunction site_url( $path = '', $scheme = null ) {\n\treturn get_site_url( null, $path, $scheme );\n}\n\n/**\n * Retrieves the URL for a given site where WordPress application files\n * (e.g. wp-blog-header.php or the wp-admin/ folder) are accessible.\n *\n * Returns the 'site_url' option with the appropriate protocol, 'https' if\n * is_ssl() and 'http' otherwise. If `$scheme` is 'http' or 'https',\n * `is_ssl()` is overridden.\n *\n * @since 3.0.0\n *\n * @param int    $blog_id Optional. Site ID. Default null (current site).\n * @param string $path    Optional. Path relative to the site URL. Default empty.\n * @param string $scheme  Optional. Scheme to give the site URL context. Accepts\n *                        'http', 'https', 'login', 'login_post', 'admin', or\n *                        'relative'. Default null.\n * @return string Site URL link with optional path appended.\n */\nfunction get_site_url( $blog_id = null, $path = '', $scheme = null ) {\n\tif ( empty( $blog_id ) || ! is_multisite() ) {\n\t\t$url = get_option( 'siteurl' );\n\t} else {\n\t\tswitch_to_blog( $blog_id );\n\t\t$url = get_option( 'siteurl' );\n\t\trestore_current_blog();\n\t}\n\n\t$url = set_url_scheme( $url, $scheme );\n\n\tif ( $path && is_string( $path ) ) {\n\t\t$url .= '/' . ltrim( $path, '/' );\n\t}\n\n\t/**\n\t * Filters the site URL.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string      $url     The complete site URL including scheme and path.\n\t * @param string      $path    Path relative to the site URL. Blank string if no path is specified.\n\t * @param string|null $scheme  Scheme to give the site URL context. Accepts 'http', 'https', 'login',\n\t *                             'login_post', 'admin', 'relative' or null.\n\t * @param int|null    $blog_id Site ID, or null for the current site.\n\t */\n\treturn apply_filters( 'site_url', $url, $path, $scheme, $blog_id );\n}\n\n/**\n * Retrieves the URL to the admin area for the current site.\n *\n * @since 2.6.0\n *\n * @param string $path   Optional path relative to the admin URL.\n * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl().\n *                       'http' or 'https' can be passed to force those schemes.\n * @return string Admin URL link with optional path appended.\n */\nfunction admin_url( $path = '', $scheme = 'admin' ) {\n\treturn get_admin_url( null, $path, $scheme );\n}\n\n/**\n * Retrieves the URL to the admin area for a given site.\n *\n * @since 3.0.0\n *\n * @param int    $blog_id Optional. Site ID. Default null (current site).\n * @param string $path    Optional. Path relative to the admin URL. Default empty.\n * @param string $scheme  Optional. The scheme to use. Accepts 'http' or 'https',\n *                        to force those schemes. Default 'admin', which obeys\n *                        force_ssl_admin() and is_ssl().\n * @return string Admin URL link with optional path appended.\n */\nfunction get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) {\n\t$url = get_site_url( $blog_id, 'wp-admin/', $scheme );\n\n\tif ( $path && is_string( $path ) ) {\n\t\t$url .= ltrim( $path, '/' );\n\t}\n\n\t/**\n\t * Filters the admin area URL.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string   $url     The complete admin area URL including scheme and path.\n\t * @param string   $path    Path relative to the admin area URL. Blank string if no path is specified.\n\t * @param int|null $blog_id Site ID, or null for the current site.\n\t */\n\treturn apply_filters( 'admin_url', $url, $path, $blog_id );\n}\n\n/**\n * Retrieves the URL to the includes directory.\n *\n * @since 2.6.0\n *\n * @param string $path   Optional. Path relative to the includes URL. Default empty.\n * @param string $scheme Optional. Scheme to give the includes URL context. Accepts\n *                       'http', 'https', or 'relative'. Default null.\n * @return string Includes URL link with optional path appended.\n */\nfunction includes_url( $path = '', $scheme = null ) {\n\t$url = site_url( '/' . WPINC . '/', $scheme );\n\n\tif ( $path && is_string( $path ) ) {\n\t\t$url .= ltrim( $path, '/' );\n\t}\n\n\t/**\n\t * Filters the URL to the includes directory.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $url  The complete URL to the includes directory including scheme and path.\n\t * @param string $path Path relative to the URL to the wp-includes directory. Blank string\n\t *                     if no path is specified.\n\t */\n\treturn apply_filters( 'includes_url', $url, $path );\n}\n\n/**\n * Retrieves the URL to the content directory.\n *\n * @since 2.6.0\n *\n * @param string $path Optional. Path relative to the content URL. Default empty.\n * @return string Content URL link with optional path appended.\n */\nfunction content_url( $path = '' ) {\n\t$url = set_url_scheme( WP_CONTENT_URL );\n\n\tif ( $path && is_string( $path ) ) {\n\t\t$url .= '/' . ltrim( $path, '/' );\n\t}\n\n\t/**\n\t * Filters the URL to the content directory.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $url  The complete URL to the content directory including scheme and path.\n\t * @param string $path Path relative to the URL to the content directory. Blank string\n\t *                     if no path is specified.\n\t */\n\treturn apply_filters( 'content_url', $url, $path );\n}\n\n/**\n * Retrieves a URL within the plugins or mu-plugins directory.\n *\n * Defaults to the plugins directory URL if no arguments are supplied.\n *\n * @since 2.6.0\n *\n * @param string $path   Optional. Extra path appended to the end of the URL, including\n *                       the relative directory if $plugin is supplied. Default empty.\n * @param string $plugin Optional. A full path to a file inside a plugin or mu-plugin.\n *                       The URL will be relative to its directory. Default empty.\n *                       Typically this is done by passing `__FILE__` as the argument.\n * @return string Plugins URL link with optional paths appended.\n */\nfunction plugins_url( $path = '', $plugin = '' ) {\n\n\t$path          = wp_normalize_path( $path );\n\t$plugin        = wp_normalize_path( $plugin );\n\t$mu_plugin_dir = wp_normalize_path( WPMU_PLUGIN_DIR );\n\n\tif ( ! empty( $plugin ) && 0 === strpos( $plugin, $mu_plugin_dir ) ) {\n\t\t$url = WPMU_PLUGIN_URL;\n\t} else {\n\t\t$url = WP_PLUGIN_URL;\n\t}\n\n\t$url = set_url_scheme( $url );\n\n\tif ( ! empty( $plugin ) && is_string( $plugin ) ) {\n\t\t$folder = dirname( plugin_basename( $plugin ) );\n\t\tif ( '.' !== $folder ) {\n\t\t\t$url .= '/' . ltrim( $folder, '/' );\n\t\t}\n\t}\n\n\tif ( $path && is_string( $path ) ) {\n\t\t$url .= '/' . ltrim( $path, '/' );\n\t}\n\n\t/**\n\t * Filters the URL to the plugins directory.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $url    The complete URL to the plugins directory including scheme and path.\n\t * @param string $path   Path relative to the URL to the plugins directory. Blank string\n\t *                       if no path is specified.\n\t * @param string $plugin The plugin file path to be relative to. Blank string if no plugin\n\t *                       is specified.\n\t */\n\treturn apply_filters( 'plugins_url', $url, $path, $plugin );\n}\n\n/**\n * Retrieves the site URL for the current network.\n *\n * Returns the site URL with the appropriate protocol, 'https' if\n * is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is\n * overridden.\n *\n * @since 3.0.0\n *\n * @see set_url_scheme()\n *\n * @param string $path   Optional. Path relative to the site URL. Default empty.\n * @param string $scheme Optional. Scheme to give the site URL context. Accepts\n *                       'http', 'https', or 'relative'. Default null.\n * @return string Site URL link with optional path appended.\n */\nfunction network_site_url( $path = '', $scheme = null ) {\n\tif ( ! is_multisite() ) {\n\t\treturn site_url( $path, $scheme );\n\t}\n\n\t$current_network = get_network();\n\n\tif ( 'relative' === $scheme ) {\n\t\t$url = $current_network->path;\n\t} else {\n\t\t$url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme );\n\t}\n\n\tif ( $path && is_string( $path ) ) {\n\t\t$url .= ltrim( $path, '/' );\n\t}\n\n\t/**\n\t * Filters the network site URL.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string      $url    The complete network site URL including scheme and path.\n\t * @param string      $path   Path relative to the network site URL. Blank string if\n\t *                            no path is specified.\n\t * @param string|null $scheme Scheme to give the URL context. Accepts 'http', 'https',\n\t *                            'relative' or null.\n\t */\n\treturn apply_filters( 'network_site_url', $url, $path, $scheme );\n}\n\n/**\n * Retrieves the home URL for the current network.\n *\n * Returns the home URL with the appropriate protocol, 'https' is_ssl()\n * and 'http' otherwise. If `$scheme` is 'http' or 'https', `is_ssl()` is\n * overridden.\n *\n * @since 3.0.0\n *\n * @param string $path   Optional. Path relative to the home URL. Default empty.\n * @param string $scheme Optional. Scheme to give the home URL context. Accepts\n *                       'http', 'https', or 'relative'. Default null.\n * @return string Home URL link with optional path appended.\n */\nfunction network_home_url( $path = '', $scheme = null ) {\n\tif ( ! is_multisite() ) {\n\t\treturn home_url( $path, $scheme );\n\t}\n\n\t$current_network = get_network();\n\t$orig_scheme     = $scheme;\n\n\tif ( ! in_array( $scheme, array( 'http', 'https', 'relative' ), true ) ) {\n\t\t$scheme = is_ssl() && ! is_admin() ? 'https' : 'http';\n\t}\n\n\tif ( 'relative' === $scheme ) {\n\t\t$url = $current_network->path;\n\t} else {\n\t\t$url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme );\n\t}\n\n\tif ( $path && is_string( $path ) ) {\n\t\t$url .= ltrim( $path, '/' );\n\t}\n\n\t/**\n\t * Filters the network home URL.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string      $url         The complete network home URL including scheme and path.\n\t * @param string      $path        Path relative to the network home URL. Blank string\n\t *                                 if no path is specified.\n\t * @param string|null $orig_scheme Scheme to give the URL context. Accepts 'http', 'https',\n\t *                                 'relative' or null.\n\t */\n\treturn apply_filters( 'network_home_url', $url, $path, $orig_scheme );\n}\n\n/**\n * Retrieves the URL to the admin area for the network.\n *\n * @since 3.0.0\n *\n * @param string $path   Optional path relative to the admin URL. Default empty.\n * @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin()\n *                       and is_ssl(). 'http' or 'https' can be passed to force those schemes.\n * @return string Admin URL link with optional path appended.\n */\nfunction network_admin_url( $path = '', $scheme = 'admin' ) {\n\tif ( ! is_multisite() ) {\n\t\treturn admin_url( $path, $scheme );\n\t}\n\n\t$url = network_site_url( 'wp-admin/network/', $scheme );\n\n\tif ( $path && is_string( $path ) ) {\n\t\t$url .= ltrim( $path, '/' );\n\t}\n\n\t/**\n\t * Filters the network admin URL.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $url  The complete network admin URL including scheme and path.\n\t * @param string $path Path relative to the network admin URL. Blank string if\n\t *                     no path is specified.\n\t */\n\treturn apply_filters( 'network_admin_url', $url, $path );\n}\n\n/**\n * Retrieves the URL to the admin area for the current user.\n *\n * @since 3.0.0\n *\n * @param string $path   Optional. Path relative to the admin URL. Default empty.\n * @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin()\n *                       and is_ssl(). 'http' or 'https' can be passed to force those schemes.\n * @return string Admin URL link with optional path appended.\n */\nfunction user_admin_url( $path = '', $scheme = 'admin' ) {\n\t$url = network_site_url( 'wp-admin/user/', $scheme );\n\n\tif ( $path && is_string( $path ) ) {\n\t\t$url .= ltrim( $path, '/' );\n\t}\n\n\t/**\n\t * Filters the user admin URL for the current user.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $url  The complete URL including scheme and path.\n\t * @param string $path Path relative to the URL. Blank string if\n\t *                     no path is specified.\n\t */\n\treturn apply_filters( 'user_admin_url', $url, $path );\n}\n\n/**\n * Retrieves the URL to the admin area for either the current site or the network depending on context.\n *\n * @since 3.1.0\n *\n * @param string $path   Optional. Path relative to the admin URL. Default empty.\n * @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin()\n *                       and is_ssl(). 'http' or 'https' can be passed to force those schemes.\n * @return string Admin URL link with optional path appended.\n */\nfunction self_admin_url( $path = '', $scheme = 'admin' ) {\n\tif ( is_network_admin() ) {\n\t\t$url = network_admin_url( $path, $scheme );\n\t} elseif ( is_user_admin() ) {\n\t\t$url = user_admin_url( $path, $scheme );\n\t} else {\n\t\t$url = admin_url( $path, $scheme );\n\t}\n\n\t/**\n\t * Filters the admin URL for the current site or network depending on context.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param string $url    The complete URL including scheme and path.\n\t * @param string $path   Path relative to the URL. Blank string if no path is specified.\n\t * @param string $scheme The scheme to use.\n\t */\n\treturn apply_filters( 'self_admin_url', $url, $path, $scheme );\n}\n\n/**\n * Sets the scheme for a URL.\n *\n * @since 3.4.0\n * @since 4.4.0 The 'rest' scheme was added.\n *\n * @param string      $url    Absolute URL that includes a scheme\n * @param string|null $scheme Optional. Scheme to give $url. Currently 'http', 'https', 'login',\n *                            'login_post', 'admin', 'relative', 'rest', 'rpc', or null. Default null.\n * @return string URL with chosen scheme.\n */\nfunction set_url_scheme( $url, $scheme = null ) {\n\t$orig_scheme = $scheme;\n\n\tif ( ! $scheme ) {\n\t\t$scheme = is_ssl() ? 'https' : 'http';\n\t} elseif ( 'admin' === $scheme || 'login' === $scheme || 'login_post' === $scheme || 'rpc' === $scheme ) {\n\t\t$scheme = is_ssl() || force_ssl_admin() ? 'https' : 'http';\n\t} elseif ( 'http' !== $scheme && 'https' !== $scheme && 'relative' !== $scheme ) {\n\t\t$scheme = is_ssl() ? 'https' : 'http';\n\t}\n\n\t$url = trim( $url );\n\tif ( substr( $url, 0, 2 ) === '//' ) {\n\t\t$url = 'http:' . $url;\n\t}\n\n\tif ( 'relative' === $scheme ) {\n\t\t$url = ltrim( preg_replace( '#^\\w+://[^/]*#', '', $url ) );\n\t\tif ( '' !== $url && '/' === $url[0] ) {\n\t\t\t$url = '/' . ltrim( $url, \"/ \\t\\n\\r\\0\\x0B\" );\n\t\t}\n\t} else {\n\t\t$url = preg_replace( '#^\\w+://#', $scheme . '://', $url );\n\t}\n\n\t/**\n\t * Filters the resulting URL after setting the scheme.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param string      $url         The complete URL including scheme and path.\n\t * @param string      $scheme      Scheme applied to the URL. One of 'http', 'https', or 'relative'.\n\t * @param string|null $orig_scheme Scheme requested for the URL. One of 'http', 'https', 'login',\n\t *                                 'login_post', 'admin', 'relative', 'rest', 'rpc', or null.\n\t */\n\treturn apply_filters( 'set_url_scheme', $url, $scheme, $orig_scheme );\n}\n\n/**\n * Retrieves the URL to the user's dashboard.\n *\n * If a user does not belong to any site, the global user dashboard is used. If the user\n * belongs to the current site, the dashboard for the current site is returned. If the user\n * cannot edit the current site, the dashboard to the user's primary site is returned.\n *\n * @since 3.1.0\n *\n * @param int    $user_id Optional. User ID. Defaults to current user.\n * @param string $path    Optional path relative to the dashboard. Use only paths known to\n *                        both site and user admins. Default empty.\n * @param string $scheme  The scheme to use. Default is 'admin', which obeys force_ssl_admin()\n *                        and is_ssl(). 'http' or 'https' can be passed to force those schemes.\n * @return string Dashboard URL link with optional path appended.\n */\nfunction get_dashboard_url( $user_id = 0, $path = '', $scheme = 'admin' ) {\n\t$user_id = $user_id ? (int) $user_id : get_current_user_id();\n\n\t$blogs = get_blogs_of_user( $user_id );\n\n\tif ( is_multisite() && ! user_can( $user_id, 'manage_network' ) && empty( $blogs ) ) {\n\t\t$url = user_admin_url( $path, $scheme );\n\t} elseif ( ! is_multisite() ) {\n\t\t$url = admin_url( $path, $scheme );\n\t} else {\n\t\t$current_blog = get_current_blog_id();\n\n\t\tif ( $current_blog && ( user_can( $user_id, 'manage_network' ) || in_array( $current_blog, array_keys( $blogs ), true ) ) ) {\n\t\t\t$url = admin_url( $path, $scheme );\n\t\t} else {\n\t\t\t$active = get_active_blog_for_user( $user_id );\n\t\t\tif ( $active ) {\n\t\t\t\t$url = get_admin_url( $active->blog_id, $path, $scheme );\n\t\t\t} else {\n\t\t\t\t$url = user_admin_url( $path, $scheme );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filters the dashboard URL for a user.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $url     The complete URL including scheme and path.\n\t * @param int    $user_id The user ID.\n\t * @param string $path    Path relative to the URL. Blank string if no path is specified.\n\t * @param string $scheme  Scheme to give the URL context. Accepts 'http', 'https', 'login',\n\t *                        'login_post', 'admin', 'relative' or null.\n\t */\n\treturn apply_filters( 'user_dashboard_url', $url, $user_id, $path, $scheme );\n}\n\n/**\n * Retrieves the URL to the user's profile editor.\n *\n * @since 3.1.0\n *\n * @param int    $user_id Optional. User ID. Defaults to current user.\n * @param string $scheme  Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin()\n *                        and is_ssl(). 'http' or 'https' can be passed to force those schemes.\n * @return string Dashboard URL link with optional path appended.\n */\nfunction get_edit_profile_url( $user_id = 0, $scheme = 'admin' ) {\n\t$user_id = $user_id ? (int) $user_id : get_current_user_id();\n\n\tif ( is_user_admin() ) {\n\t\t$url = user_admin_url( 'profile.php', $scheme );\n\t} elseif ( is_network_admin() ) {\n\t\t$url = network_admin_url( 'profile.php', $scheme );\n\t} else {\n\t\t$url = get_dashboard_url( $user_id, 'profile.php', $scheme );\n\t}\n\n\t/**\n\t * Filters the URL for a user's profile editor.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string $url     The complete URL including scheme and path.\n\t * @param int    $user_id The user ID.\n\t * @param string $scheme  Scheme to give the URL context. Accepts 'http', 'https', 'login',\n\t *                        'login_post', 'admin', 'relative' or null.\n\t */\n\treturn apply_filters( 'edit_profile_url', $url, $user_id, $scheme );\n}\n\n/**\n * Returns the canonical URL for a post.\n *\n * When the post is the same as the current requested page the function will handle the\n * pagination arguments too.\n *\n * @since 4.6.0\n *\n * @param int|WP_Post $post Optional. Post ID or object. Default is global `$post`.\n * @return string|false The canonical URL, or false if the post does not exist or has not\n *                      been published yet.\n */\nfunction wp_get_canonical_url( $post = null ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\tif ( 'publish' !== $post->post_status ) {\n\t\treturn false;\n\t}\n\n\t$canonical_url = get_permalink( $post );\n\n\t// If a canonical is being generated for the current page, make sure it has pagination if needed.\n\tif ( get_queried_object_id() === $post->ID ) {\n\t\t$page = get_query_var( 'page', 0 );\n\t\tif ( $page >= 2 ) {\n\t\t\tif ( ! get_option( 'permalink_structure' ) ) {\n\t\t\t\t$canonical_url = add_query_arg( 'page', $page, $canonical_url );\n\t\t\t} else {\n\t\t\t\t$canonical_url = trailingslashit( $canonical_url ) . user_trailingslashit( $page, 'single_paged' );\n\t\t\t}\n\t\t}\n\n\t\t$cpage = get_query_var( 'cpage', 0 );\n\t\tif ( $cpage ) {\n\t\t\t$canonical_url = get_comments_pagenum_link( $cpage );\n\t\t}\n\t}\n\n\t/**\n\t * Filters the canonical URL for a post.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string  $canonical_url The post's canonical URL.\n\t * @param WP_Post $post          Post object.\n\t */\n\treturn apply_filters( 'get_canonical_url', $canonical_url, $post );\n}\n\n/**\n * Outputs rel=canonical for singular queries.\n *\n * @since 2.9.0\n * @since 4.6.0 Adjusted to use `wp_get_canonical_url()`.\n */\nfunction rel_canonical() {\n\tif ( ! is_singular() ) {\n\t\treturn;\n\t}\n\n\t$id = get_queried_object_id();\n\n\tif ( 0 === $id ) {\n\t\treturn;\n\t}\n\n\t$url = wp_get_canonical_url( $id );\n\n\tif ( ! empty( $url ) ) {\n\t\techo '<link rel=\"canonical\" href=\"' . esc_url( $url ) . '\" />' . \"\\n\";\n\t}\n}\n\n/**\n * Returns a shortlink for a post, page, attachment, or site.\n *\n * This function exists to provide a shortlink tag that all themes and plugins can target.\n * A plugin must hook in to provide the actual shortlinks. Default shortlink support is\n * limited to providing ?p= style links for posts. Plugins can short-circuit this function\n * via the {@see 'pre_get_shortlink'} filter or filter the output via the {@see 'get_shortlink'}\n * filter.\n *\n * @since 3.0.0\n *\n * @param int    $id          Optional. A post or site ID. Default is 0, which means the current post or site.\n * @param string $context     Optional. Whether the ID is a 'site' id, 'post' id, or 'media' id. If 'post',\n *                            the post_type of the post is consulted. If 'query', the current query is consulted\n *                            to determine the ID and context. Default 'post'.\n * @param bool   $allow_slugs Optional. Whether to allow post slugs in the shortlink. It is up to the plugin how\n *                            and whether to honor this. Default true.\n * @return string A shortlink or an empty string if no shortlink exists for the requested resource or if shortlinks\n *                are not enabled.\n */\nfunction wp_get_shortlink( $id = 0, $context = 'post', $allow_slugs = true ) {\n\t/**\n\t * Filters whether to preempt generating a shortlink for the given post.\n\t *\n\t * Returning a truthy value from the filter will effectively short-circuit\n\t * the shortlink generation process, returning that value instead.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param false|string $return      Short-circuit return value. Either false or a URL string.\n\t * @param int          $id          Post ID, or 0 for the current post.\n\t * @param string       $context     The context for the link. One of 'post' or 'query',\n\t * @param bool         $allow_slugs Whether to allow post slugs in the shortlink.\n\t */\n\t$shortlink = apply_filters( 'pre_get_shortlink', false, $id, $context, $allow_slugs );\n\n\tif ( false !== $shortlink ) {\n\t\treturn $shortlink;\n\t}\n\n\t$post_id = 0;\n\tif ( 'query' === $context && is_singular() ) {\n\t\t$post_id = get_queried_object_id();\n\t\t$post    = get_post( $post_id );\n\t} elseif ( 'post' === $context ) {\n\t\t$post = get_post( $id );\n\t\tif ( ! empty( $post->ID ) ) {\n\t\t\t$post_id = $post->ID;\n\t\t}\n\t}\n\n\t$shortlink = '';\n\n\t// Return `?p=` link for all public post types.\n\tif ( ! empty( $post_id ) ) {\n\t\t$post_type = get_post_type_object( $post->post_type );\n\n\t\tif ( 'page' === $post->post_type && get_option( 'page_on_front' ) == $post->ID && 'page' === get_option( 'show_on_front' ) ) {\n\t\t\t$shortlink = home_url( '/' );\n\t\t} elseif ( $post_type->public ) {\n\t\t\t$shortlink = home_url( '?p=' . $post_id );\n\t\t}\n\t}\n\n\t/**\n\t * Filters the shortlink for a post.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $shortlink   Shortlink URL.\n\t * @param int    $id          Post ID, or 0 for the current post.\n\t * @param string $context     The context for the link. One of 'post' or 'query',\n\t * @param bool   $allow_slugs Whether to allow post slugs in the shortlink. Not used by default.\n\t */\n\treturn apply_filters( 'get_shortlink', $shortlink, $id, $context, $allow_slugs );\n}\n\n/**\n * Injects rel=shortlink into the head if a shortlink is defined for the current page.\n *\n * Attached to the {@see 'wp_head'} action.\n *\n * @since 3.0.0\n */\nfunction wp_shortlink_wp_head() {\n\t$shortlink = wp_get_shortlink( 0, 'query' );\n\n\tif ( empty( $shortlink ) ) {\n\t\treturn;\n\t}\n\n\techo \"<link rel='shortlink' href='\" . esc_url( $shortlink ) . \"' />\\n\";\n}\n\n/**\n * Sends a Link: rel=shortlink header if a shortlink is defined for the current page.\n *\n * Attached to the {@see 'wp'} action.\n *\n * @since 3.0.0\n */\nfunction wp_shortlink_header() {\n\tif ( headers_sent() ) {\n\t\treturn;\n\t}\n\n\t$shortlink = wp_get_shortlink( 0, 'query' );\n\n\tif ( empty( $shortlink ) ) {\n\t\treturn;\n\t}\n\n\theader( 'Link: <' . $shortlink . '>; rel=shortlink', false );\n}\n\n/**\n * Displays the shortlink for a post.\n *\n * Must be called from inside \"The Loop\"\n *\n * Call like the_shortlink( __( 'Shortlinkage FTW' ) )\n *\n * @since 3.0.0\n *\n * @param string $text   Optional The link text or HTML to be displayed. Defaults to 'This is the short link.'\n * @param string $title  Optional The tooltip for the link. Must be sanitized. Defaults to the sanitized post title.\n * @param string $before Optional HTML to display before the link. Default empty.\n * @param string $after  Optional HTML to display after the link. Default empty.\n */\nfunction the_shortlink( $text = '', $title = '', $before = '', $after = '' ) {\n\t$post = get_post();\n\n\tif ( empty( $text ) ) {\n\t\t$text = __( 'This is the short link.' );\n\t}\n\n\tif ( empty( $title ) ) {\n\t\t$title = the_title_attribute( array( 'echo' => false ) );\n\t}\n\n\t$shortlink = wp_get_shortlink( $post->ID );\n\n\tif ( ! empty( $shortlink ) ) {\n\t\t$link = '<a rel=\"shortlink\" href=\"' . esc_url( $shortlink ) . '\" title=\"' . $title . '\">' . $text . '</a>';\n\n\t\t/**\n\t\t * Filters the short link anchor tag for a post.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string $link      Shortlink anchor tag.\n\t\t * @param string $shortlink Shortlink URL.\n\t\t * @param string $text      Shortlink's text.\n\t\t * @param string $title     Shortlink's title attribute.\n\t\t */\n\t\t$link = apply_filters( 'the_shortlink', $link, $shortlink, $text, $title );\n\t\techo $before, $link, $after;\n\t}\n}\n\n\n/**\n * Retrieves the avatar URL.\n *\n * @since 4.2.0\n *\n * @param mixed $id_or_email The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash,\n *                           user email, WP_User object, WP_Post object, or WP_Comment object.\n * @param array $args {\n *     Optional. Arguments to return instead of the default arguments.\n *\n *     @type int    $size           Height and width of the avatar in pixels. Default 96.\n *     @type string $default        URL for the default image or a default type. Accepts '404' (return\n *                                  a 404 instead of a default image), 'retro' (8bit), 'monsterid' (monster),\n *                                  'wavatar' (cartoon face), 'indenticon' (the \"quilt\"), 'mystery', 'mm',\n *                                  or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF), or\n *                                  'gravatar_default' (the Gravatar logo). Default is the value of the\n *                                  'avatar_default' option, with a fallback of 'mystery'.\n *     @type bool   $force_default  Whether to always show the default image, never the Gravatar. Default false.\n *     @type string $rating         What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are\n *                                  judged in that order. Default is the value of the 'avatar_rating' option.\n *     @type string $scheme         URL scheme to use. See set_url_scheme() for accepted values.\n *                                  Default null.\n *     @type array  $processed_args When the function returns, the value will be the processed/sanitized $args\n *                                  plus a \"found_avatar\" guess. Pass as a reference. Default null.\n * }\n * @return string|false The URL of the avatar on success, false on failure.\n */\nfunction get_avatar_url( $id_or_email, $args = null ) {\n\t$args = get_avatar_data( $id_or_email, $args );\n\treturn $args['url'];\n}\n\n\n/**\n * Check if this comment type allows avatars to be retrieved.\n *\n * @since 5.1.0\n *\n * @param string $comment_type Comment type to check.\n * @return bool Whether the comment type is allowed for retrieving avatars.\n */\nfunction is_avatar_comment_type( $comment_type ) {\n\t/**\n\t * Filters the list of allowed comment types for retrieving avatars.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param array $types An array of content types. Default only contains 'comment'.\n\t */\n\t$allowed_comment_types = apply_filters( 'get_avatar_comment_types', array( 'comment' ) );\n\n\treturn in_array( $comment_type, (array) $allowed_comment_types, true );\n}\n\n\n/**\n * Retrieves default data about the avatar.\n *\n * @since 4.2.0\n *\n * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user ID, Gravatar MD5 hash,\n *                           user email, WP_User object, WP_Post object, or WP_Comment object.\n * @param array $args {\n *     Optional. Arguments to return instead of the default arguments.\n *\n *     @type int    $size           Height and width of the avatar image file in pixels. Default 96.\n *     @type int    $height         Display height of the avatar in pixels. Defaults to $size.\n *     @type int    $width          Display width of the avatar in pixels. Defaults to $size.\n *     @type string $default        URL for the default image or a default type. Accepts '404' (return\n *                                  a 404 instead of a default image), 'retro' (8bit), 'monsterid' (monster),\n *                                  'wavatar' (cartoon face), 'indenticon' (the \"quilt\"), 'mystery', 'mm',\n *                                  or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF), or\n *                                  'gravatar_default' (the Gravatar logo). Default is the value of the\n *                                  'avatar_default' option, with a fallback of 'mystery'.\n *     @type bool   $force_default  Whether to always show the default image, never the Gravatar. Default false.\n *     @type string $rating         What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are\n *                                  judged in that order. Default is the value of the 'avatar_rating' option.\n *     @type string $scheme         URL scheme to use. See set_url_scheme() for accepted values.\n *                                  Default null.\n *     @type array  $processed_args When the function returns, the value will be the processed/sanitized $args\n *                                  plus a \"found_avatar\" guess. Pass as a reference. Default null.\n *     @type string $extra_attr     HTML attributes to insert in the IMG element. Is not sanitized. Default empty.\n * }\n * @return array {\n *     Along with the arguments passed in `$args`, this will contain a couple of extra arguments.\n *\n *     @type bool   $found_avatar True if we were able to find an avatar for this user,\n *                                false or not set if we couldn't.\n *     @type string $url          The URL of the avatar we found.\n * }\n */\nfunction get_avatar_data( $id_or_email, $args = null ) {\n\t$args = wp_parse_args(\n\t\t$args,\n\t\tarray(\n\t\t\t'size'           => 96,\n\t\t\t'height'         => null,\n\t\t\t'width'          => null,\n\t\t\t'default'        => get_option( 'avatar_default', 'mystery' ),\n\t\t\t'force_default'  => false,\n\t\t\t'rating'         => get_option( 'avatar_rating' ),\n\t\t\t'scheme'         => null,\n\t\t\t'processed_args' => null, // If used, should be a reference.\n\t\t\t'extra_attr'     => '',\n\t\t)\n\t);\n\n\tif ( is_numeric( $args['size'] ) ) {\n\t\t$args['size'] = absint( $args['size'] );\n\t\tif ( ! $args['size'] ) {\n\t\t\t$args['size'] = 96;\n\t\t}\n\t} else {\n\t\t$args['size'] = 96;\n\t}\n\n\tif ( is_numeric( $args['height'] ) ) {\n\t\t$args['height'] = absint( $args['height'] );\n\t\tif ( ! $args['height'] ) {\n\t\t\t$args['height'] = $args['size'];\n\t\t}\n\t} else {\n\t\t$args['height'] = $args['size'];\n\t}\n\n\tif ( is_numeric( $args['width'] ) ) {\n\t\t$args['width'] = absint( $args['width'] );\n\t\tif ( ! $args['width'] ) {\n\t\t\t$args['width'] = $args['size'];\n\t\t}\n\t} else {\n\t\t$args['width'] = $args['size'];\n\t}\n\n\tif ( empty( $args['default'] ) ) {\n\t\t$args['default'] = get_option( 'avatar_default', 'mystery' );\n\t}\n\n\tswitch ( $args['default'] ) {\n\t\tcase 'mm':\n\t\tcase 'mystery':\n\t\tcase 'mysteryman':\n\t\t\t$args['default'] = 'mm';\n\t\t\tbreak;\n\t\tcase 'gravatar_default':\n\t\t\t$args['default'] = false;\n\t\t\tbreak;\n\t}\n\n\t$args['force_default'] = (bool) $args['force_default'];\n\n\t$args['rating'] = strtolower( $args['rating'] );\n\n\t$args['found_avatar'] = false;\n\n\t/**\n\t * Filters whether to retrieve the avatar URL early.\n\t *\n\t * Passing a non-null value in the 'url' member of the return array will\n\t * effectively short circuit get_avatar_data(), passing the value through\n\t * the {@see 'get_avatar_data'} filter and returning early.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param array $args        Arguments passed to get_avatar_data(), after processing.\n\t * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user ID, Gravatar MD5 hash,\n\t *                           user email, WP_User object, WP_Post object, or WP_Comment object.\n\t */\n\t$args = apply_filters( 'pre_get_avatar_data', $args, $id_or_email );\n\n\tif ( isset( $args['url'] ) ) {\n\t\t/** This filter is documented in wp-includes/link-template.php */\n\t\treturn apply_filters( 'get_avatar_data', $args, $id_or_email );\n\t}\n\n\t$email_hash = '';\n\t$user       = false;\n\t$email      = false;\n\n\tif ( is_object( $id_or_email ) && isset( $id_or_email->comment_ID ) ) {\n\t\t$id_or_email = get_comment( $id_or_email );\n\t}\n\n\t// Process the user identifier.\n\tif ( is_numeric( $id_or_email ) ) {\n\t\t$user = get_user_by( 'id', absint( $id_or_email ) );\n\t} elseif ( is_string( $id_or_email ) ) {\n\t\tif ( strpos( $id_or_email, '@md5.gravatar.com' ) ) {\n\t\t\t// MD5 hash.\n\t\t\tlist( $email_hash ) = explode( '@', $id_or_email );\n\t\t} else {\n\t\t\t// Email address.\n\t\t\t$email = $id_or_email;\n\t\t}\n\t} elseif ( $id_or_email instanceof WP_User ) {\n\t\t// User object.\n\t\t$user = $id_or_email;\n\t} elseif ( $id_or_email instanceof WP_Post ) {\n\t\t// Post object.\n\t\t$user = get_user_by( 'id', (int) $id_or_email->post_author );\n\t} elseif ( $id_or_email instanceof WP_Comment ) {\n\t\tif ( ! is_avatar_comment_type( get_comment_type( $id_or_email ) ) ) {\n\t\t\t$args['url'] = false;\n\t\t\t/** This filter is documented in wp-includes/link-template.php */\n\t\t\treturn apply_filters( 'get_avatar_data', $args, $id_or_email );\n\t\t}\n\n\t\tif ( ! empty( $id_or_email->user_id ) ) {\n\t\t\t$user = get_user_by( 'id', (int) $id_or_email->user_id );\n\t\t}\n\t\tif ( ( ! $user || is_wp_error( $user ) ) && ! empty( $id_or_email->comment_author_email ) ) {\n\t\t\t$email = $id_or_email->comment_author_email;\n\t\t}\n\t}\n\n\tif ( ! $email_hash ) {\n\t\tif ( $user ) {\n\t\t\t$email = $user->user_email;\n\t\t}\n\n\t\tif ( $email ) {\n\t\t\t$email_hash = md5( strtolower( trim( $email ) ) );\n\t\t}\n\t}\n\n\tif ( $email_hash ) {\n\t\t$args['found_avatar'] = true;\n\t\t$gravatar_server      = hexdec( $email_hash[0] ) % 3;\n\t} else {\n\t\t$gravatar_server = rand( 0, 2 );\n\t}\n\n\t$url_args = array(\n\t\t's' => $args['size'],\n\t\t'd' => $args['default'],\n\t\t'f' => $args['force_default'] ? 'y' : false,\n\t\t'r' => $args['rating'],\n\t);\n\n\tif ( is_ssl() ) {\n\t\t$url = 'https://secure.gravatar.com/avatar/' . $email_hash;\n\t} else {\n\t\t$url = sprintf( 'http://%d.gravatar.com/avatar/%s', $gravatar_server, $email_hash );\n\t}\n\n\t$url = add_query_arg(\n\t\trawurlencode_deep( array_filter( $url_args ) ),\n\t\tset_url_scheme( $url, $args['scheme'] )\n\t);\n\n\t/**\n\t * Filters the avatar URL.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param string $url         The URL of the avatar.\n\t * @param mixed  $id_or_email The Gravatar to retrieve. Accepts a user ID, Gravatar MD5 hash,\n\t *                            user email, WP_User object, WP_Post object, or WP_Comment object.\n\t * @param array  $args        Arguments passed to get_avatar_data(), after processing.\n\t */\n\t$args['url'] = apply_filters( 'get_avatar_url', $url, $id_or_email, $args );\n\n\t/**\n\t * Filters the avatar data.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param array $args        Arguments passed to get_avatar_data(), after processing.\n\t * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user ID, Gravatar MD5 hash,\n\t *                           user email, WP_User object, WP_Post object, or WP_Comment object.\n\t */\n\treturn apply_filters( 'get_avatar_data', $args, $id_or_email );\n}\n\n/**\n * Retrieves the URL of a file in the theme.\n *\n * Searches in the stylesheet directory before the template directory so themes\n * which inherit from a parent theme can just override one file.\n *\n * @since 4.7.0\n *\n * @param string $file Optional. File to search for in the stylesheet directory.\n * @return string The URL of the file.\n */\nfunction get_theme_file_uri( $file = '' ) {\n\t$file = ltrim( $file, '/' );\n\n\tif ( empty( $file ) ) {\n\t\t$url = get_stylesheet_directory_uri();\n\t} elseif ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {\n\t\t$url = get_stylesheet_directory_uri() . '/' . $file;\n\t} else {\n\t\t$url = get_template_directory_uri() . '/' . $file;\n\t}\n\n\t/**\n\t * Filters the URL to a file in the theme.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $url  The file URL.\n\t * @param string $file The requested file to search for.\n\t */\n\treturn apply_filters( 'theme_file_uri', $url, $file );\n}\n\n/**\n * Retrieves the URL of a file in the parent theme.\n *\n * @since 4.7.0\n *\n * @param string $file Optional. File to return the URL for in the template directory.\n * @return string The URL of the file.\n */\nfunction get_parent_theme_file_uri( $file = '' ) {\n\t$file = ltrim( $file, '/' );\n\n\tif ( empty( $file ) ) {\n\t\t$url = get_template_directory_uri();\n\t} else {\n\t\t$url = get_template_directory_uri() . '/' . $file;\n\t}\n\n\t/**\n\t * Filters the URL to a file in the parent theme.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $url  The file URL.\n\t * @param string $file The requested file to search for.\n\t */\n\treturn apply_filters( 'parent_theme_file_uri', $url, $file );\n}\n\n/**\n * Retrieves the path of a file in the theme.\n *\n * Searches in the stylesheet directory before the template directory so themes\n * which inherit from a parent theme can just override one file.\n *\n * @since 4.7.0\n *\n * @param string $file Optional. File to search for in the stylesheet directory.\n * @return string The path of the file.\n */\nfunction get_theme_file_path( $file = '' ) {\n\t$file = ltrim( $file, '/' );\n\n\tif ( empty( $file ) ) {\n\t\t$path = get_stylesheet_directory();\n\t} elseif ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {\n\t\t$path = get_stylesheet_directory() . '/' . $file;\n\t} else {\n\t\t$path = get_template_directory() . '/' . $file;\n\t}\n\n\t/**\n\t * Filters the path to a file in the theme.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $path The file path.\n\t * @param string $file The requested file to search for.\n\t */\n\treturn apply_filters( 'theme_file_path', $path, $file );\n}\n\n/**\n * Retrieves the path of a file in the parent theme.\n *\n * @since 4.7.0\n *\n * @param string $file Optional. File to return the path for in the template directory.\n * @return string The path of the file.\n */\nfunction get_parent_theme_file_path( $file = '' ) {\n\t$file = ltrim( $file, '/' );\n\n\tif ( empty( $file ) ) {\n\t\t$path = get_template_directory();\n\t} else {\n\t\t$path = get_template_directory() . '/' . $file;\n\t}\n\n\t/**\n\t * Filters the path to a file in the parent theme.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $path The file path.\n\t * @param string $file The requested file to search for.\n\t */\n\treturn apply_filters( 'parent_theme_file_path', $path, $file );\n}\n\n/**\n * Retrieves the URL to the privacy policy page.\n *\n * @since 4.9.6\n *\n * @return string The URL to the privacy policy page. Empty string if it doesn't exist.\n */\nfunction get_privacy_policy_url() {\n\t$url            = '';\n\t$policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );\n\n\tif ( ! empty( $policy_page_id ) && get_post_status( $policy_page_id ) === 'publish' ) {\n\t\t$url = (string) get_permalink( $policy_page_id );\n\t}\n\n\t/**\n\t * Filters the URL of the privacy policy page.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param string $url            The URL to the privacy policy page. Empty string\n\t *                               if it doesn't exist.\n\t * @param int    $policy_page_id The ID of privacy policy page.\n\t */\n\treturn apply_filters( 'privacy_policy_url', $url, $policy_page_id );\n}\n\n/**\n * Displays the privacy policy link with formatting, when applicable.\n *\n * @since 4.9.6\n *\n * @param string $before Optional. Display before privacy policy link. Default empty.\n * @param string $after  Optional. Display after privacy policy link. Default empty.\n */\nfunction the_privacy_policy_link( $before = '', $after = '' ) {\n\techo get_the_privacy_policy_link( $before, $after );\n}\n\n/**\n * Returns the privacy policy link with formatting, when applicable.\n *\n * @since 4.9.6\n *\n * @param string $before Optional. Display before privacy policy link. Default empty.\n * @param string $after  Optional. Display after privacy policy link. Default empty.\n * @return string Markup for the link and surrounding elements. Empty string if it\n *                doesn't exist.\n */\nfunction get_the_privacy_policy_link( $before = '', $after = '' ) {\n\t$link               = '';\n\t$privacy_policy_url = get_privacy_policy_url();\n\t$policy_page_id     = (int) get_option( 'wp_page_for_privacy_policy' );\n\t$page_title         = ( $policy_page_id ) ? get_the_title( $policy_page_id ) : '';\n\n\tif ( $privacy_policy_url && $page_title ) {\n\t\t$link = sprintf(\n\t\t\t'<a class=\"privacy-policy-link\" href=\"%s\">%s</a>',\n\t\t\tesc_url( $privacy_policy_url ),\n\t\t\tesc_html( $page_title )\n\t\t);\n\t}\n\n\t/**\n\t * Filters the privacy policy link.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param string $link               The privacy policy link. Empty string if it\n\t *                                   doesn't exist.\n\t * @param string $privacy_policy_url The URL of the privacy policy. Empty string\n\t *                                   if it doesn't exist.\n\t */\n\t$link = apply_filters( 'the_privacy_policy_link', $link, $privacy_policy_url );\n\n\tif ( $link ) {\n\t\treturn $before . $link . $after;\n\t}\n\n\treturn '';\n}\n", "num_lines": 4492}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * These functions are needed to load WordPress.\n *\n * @package WordPress\n */\n\n/**\n * Return the HTTP protocol sent by the server.\n *\n * @since 4.4.0\n *\n * @return string The HTTP protocol. Default: HTTP/1.0.\n */\nfunction wp_get_server_protocol() {\n\t$protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : '';\n\tif ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ), true ) ) {\n\t\t$protocol = 'HTTP/1.0';\n\t}\n\treturn $protocol;\n}\n\n/**\n * Fix `$_SERVER` variables for various setups.\n *\n * @since 3.0.0\n * @access private\n *\n * @global string $PHP_SELF The filename of the currently executing script,\n *                          relative to the document root.\n */\nfunction wp_fix_server_vars() {\n\tglobal $PHP_SELF;\n\n\t$default_server_values = array(\n\t\t'SERVER_SOFTWARE' => '',\n\t\t'REQUEST_URI'     => '',\n\t);\n\n\t$_SERVER = array_merge( $default_server_values, $_SERVER );\n\n\t// Fix for IIS when running with PHP ISAPI.\n\tif ( empty( $_SERVER['REQUEST_URI'] ) || ( 'cgi-fcgi' !== PHP_SAPI && preg_match( '/^Microsoft-IIS\\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) {\n\n\t\tif ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ) {\n\t\t\t// IIS Mod-Rewrite.\n\t\t\t$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];\n\t\t} elseif ( isset( $_SERVER['HTTP_X_REWRITE_URL'] ) ) {\n\t\t\t// IIS Isapi_Rewrite.\n\t\t\t$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];\n\t\t} else {\n\t\t\t// Use ORIG_PATH_INFO if there is no PATH_INFO.\n\t\t\tif ( ! isset( $_SERVER['PATH_INFO'] ) && isset( $_SERVER['ORIG_PATH_INFO'] ) ) {\n\t\t\t\t$_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];\n\t\t\t}\n\n\t\t\t// Some IIS + PHP configurations put the script-name in the path-info (no need to append it twice).\n\t\t\tif ( isset( $_SERVER['PATH_INFO'] ) ) {\n\t\t\t\tif ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] ) {\n\t\t\t\t\t$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];\n\t\t\t\t} else {\n\t\t\t\t\t$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Append the query string if it exists and isn't null.\n\t\t\tif ( ! empty( $_SERVER['QUERY_STRING'] ) ) {\n\t\t\t\t$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];\n\t\t\t}\n\t\t}\n\t}\n\n\t// Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests.\n\tif ( isset( $_SERVER['SCRIPT_FILENAME'] ) && ( strpos( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) == strlen( $_SERVER['SCRIPT_FILENAME'] ) - 7 ) ) {\n\t\t$_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'];\n\t}\n\n\t// Fix for Dreamhost and other PHP as CGI hosts.\n\tif ( strpos( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) !== false ) {\n\t\tunset( $_SERVER['PATH_INFO'] );\n\t}\n\n\t// Fix empty PHP_SELF.\n\t$PHP_SELF = $_SERVER['PHP_SELF'];\n\tif ( empty( $PHP_SELF ) ) {\n\t\t$_SERVER['PHP_SELF'] = preg_replace( '/(\\?.*)?$/', '', $_SERVER['REQUEST_URI'] );\n\t\t$PHP_SELF            = $_SERVER['PHP_SELF'];\n\t}\n}\n\n/**\n * Check for the required PHP version, and the MySQL extension or\n * a database drop-in.\n *\n * Dies if requirements are not met.\n *\n * @since 3.0.0\n * @access private\n *\n * @global string $required_php_version The required PHP version string.\n * @global string $wp_version           The WordPress version string.\n */\nfunction wp_check_php_mysql_versions() {\n\tglobal $required_php_version, $wp_version;\n\t$php_version = phpversion();\n\n\tif ( version_compare( $required_php_version, $php_version, '>' ) ) {\n\t\t$protocol = wp_get_server_protocol();\n\t\theader( sprintf( '%s 500 Internal Server Error', $protocol ), true, 500 );\n\t\theader( 'Content-Type: text/html; charset=utf-8' );\n\t\tprintf( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.', $php_version, $wp_version, $required_php_version );\n\t\texit( 1 );\n\t}\n\n\tif ( ! extension_loaded( 'mysql' ) && ! extension_loaded( 'mysqli' ) && ! extension_loaded( 'mysqlnd' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) {\n\t\trequire_once ABSPATH . WPINC . '/functions.php';\n\t\twp_load_translations_early();\n\t\t$args = array(\n\t\t\t'exit' => false,\n\t\t\t'code' => 'mysql_not_found',\n\t\t);\n\t\twp_die(\n\t\t\t__( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ),\n\t\t\t__( 'Requirements Not Met' ),\n\t\t\t$args\n\t\t);\n\t\texit( 1 );\n\t}\n}\n\n/**\n * Retrieves the current environment type.\n *\n * The type can be set via the `WP_ENVIRONMENT_TYPE` global system variable,\n * or a constant of the same name.\n *\n * Possible values include 'local', 'development', 'staging', 'production'.\n * If not set, the type defaults to 'production'.\n *\n * @since 5.5.0\n * @since 5.5.1 Added the 'local' type.\n * @since 5.5.1 Removed the ability to alter the list of types.\n *\n * @return string The current environment type.\n */\nfunction wp_get_environment_type() {\n\tstatic $current_env = '';\n\n\tif ( $current_env ) {\n\t\treturn $current_env;\n\t}\n\n\t$wp_environments = array(\n\t\t'local',\n\t\t'development',\n\t\t'staging',\n\t\t'production',\n\t);\n\n\t// Add a note about the deprecated WP_ENVIRONMENT_TYPES constant.\n\tif ( defined( 'WP_ENVIRONMENT_TYPES' ) && function_exists( '_deprecated_argument' ) ) {\n\t\tif ( function_exists( '__' ) ) {\n\t\t\t/* translators: %s: WP_ENVIRONMENT_TYPES */\n\t\t\t$message = sprintf( __( 'The %s constant is no longer supported.' ), 'WP_ENVIRONMENT_TYPES' );\n\t\t} else {\n\t\t\t$message = sprintf( 'The %s constant is no longer supported.', 'WP_ENVIRONMENT_TYPES' );\n\t\t}\n\n\t\t_deprecated_argument(\n\t\t\t'define()',\n\t\t\t'5.5.1',\n\t\t\t$message\n\t\t);\n\t}\n\n\t// Check if the environment variable has been set, if `getenv` is available on the system.\n\tif ( function_exists( 'getenv' ) ) {\n\t\t$has_env = getenv( 'WP_ENVIRONMENT_TYPE' );\n\t\tif ( false !== $has_env ) {\n\t\t\t$current_env = $has_env;\n\t\t}\n\t}\n\n\t// Fetch the environment from a constant, this overrides the global system variable.\n\tif ( defined( 'WP_ENVIRONMENT_TYPE' ) ) {\n\t\t$current_env = WP_ENVIRONMENT_TYPE;\n\t}\n\n\t// Make sure the environment is an allowed one, and not accidentally set to an invalid value.\n\tif ( ! in_array( $current_env, $wp_environments, true ) ) {\n\t\t$current_env = 'production';\n\t}\n\n\treturn $current_env;\n}\n\n/**\n * Don't load all of WordPress when handling a favicon.ico request.\n *\n * Instead, send the headers for a zero-length favicon and bail.\n *\n * @since 3.0.0\n * @deprecated 5.4.0 Deprecated in favor of do_favicon().\n */\nfunction wp_favicon_request() {\n\tif ( '/favicon.ico' === $_SERVER['REQUEST_URI'] ) {\n\t\theader( 'Content-Type: image/vnd.microsoft.icon' );\n\t\texit;\n\t}\n}\n\n/**\n * Die with a maintenance message when conditions are met.\n *\n * The default message can be replaced by using a drop-in (maintenance.php in\n * the wp-content directory).\n *\n * @since 3.0.0\n * @access private\n */\nfunction wp_maintenance() {\n\t// Return if maintenance mode is disabled.\n\tif ( ! wp_is_maintenance_mode() ) {\n\t\treturn;\n\t}\n\n\tif ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {\n\t\trequire_once WP_CONTENT_DIR . '/maintenance.php';\n\t\tdie();\n\t}\n\n\trequire_once ABSPATH . WPINC . '/functions.php';\n\twp_load_translations_early();\n\n\theader( 'Retry-After: 600' );\n\n\twp_die(\n\t\t__( 'Briefly unavailable for scheduled maintenance. Check back in a minute.' ),\n\t\t__( 'Maintenance' ),\n\t\t503\n\t);\n}\n\n/**\n * Check if maintenance mode is enabled.\n *\n * Checks for a file in the WordPress root directory named \".maintenance\".\n * This file will contain the variable $upgrading, set to the time the file\n * was created. If the file was created less than 10 minutes ago, WordPress\n * is in maintenance mode.\n *\n * @since 5.5.0\n *\n * @global int $upgrading The Unix timestamp marking when upgrading WordPress began.\n *\n * @return bool True if maintenance mode is enabled, false otherwise.\n */\nfunction wp_is_maintenance_mode() {\n\tglobal $upgrading;\n\n\tif ( ! file_exists( ABSPATH . '.maintenance' ) || wp_installing() ) {\n\t\treturn false;\n\t}\n\n\trequire ABSPATH . '.maintenance';\n\t// If the $upgrading timestamp is older than 10 minutes, consider maintenance over.\n\tif ( ( time() - $upgrading ) >= 10 * MINUTE_IN_SECONDS ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Filters whether to enable maintenance mode.\n\t *\n\t * This filter runs before it can be used by plugins. It is designed for\n\t * non-web runtimes. If this filter returns true, maintenance mode will be\n\t * active and the request will end. If false, the request will be allowed to\n\t * continue processing even if maintenance mode should be active.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param bool $enable_checks Whether to enable maintenance mode. Default true.\n\t * @param int  $upgrading     The timestamp set in the .maintenance file.\n\t */\n\tif ( ! apply_filters( 'enable_maintenance_mode', true, $upgrading ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Start the WordPress micro-timer.\n *\n * @since 0.71\n * @access private\n *\n * @global float $timestart Unix timestamp set at the beginning of the page load.\n * @see timer_stop()\n *\n * @return bool Always returns true.\n */\nfunction timer_start() {\n\tglobal $timestart;\n\t$timestart = microtime( true );\n\treturn true;\n}\n\n/**\n * Retrieve or display the time from the page start to when function is called.\n *\n * @since 0.71\n *\n * @global float   $timestart Seconds from when timer_start() is called.\n * @global float   $timeend   Seconds from when function is called.\n *\n * @param int|bool $display   Whether to echo or return the results. Accepts 0|false for return,\n *                            1|true for echo. Default 0|false.\n * @param int      $precision The number of digits from the right of the decimal to display.\n *                            Default 3.\n * @return string The \"second.microsecond\" finished time calculation. The number is formatted\n *                for human consumption, both localized and rounded.\n */\nfunction timer_stop( $display = 0, $precision = 3 ) {\n\tglobal $timestart, $timeend;\n\t$timeend   = microtime( true );\n\t$timetotal = $timeend - $timestart;\n\t$r         = ( function_exists( 'number_format_i18n' ) ) ? number_format_i18n( $timetotal, $precision ) : number_format( $timetotal, $precision );\n\tif ( $display ) {\n\t\techo $r;\n\t}\n\treturn $r;\n}\n\n/**\n * Set PHP error reporting based on WordPress debug settings.\n *\n * Uses three constants: `WP_DEBUG`, `WP_DEBUG_DISPLAY`, and `WP_DEBUG_LOG`.\n * All three can be defined in wp-config.php. By default, `WP_DEBUG` and\n * `WP_DEBUG_LOG` are set to false, and `WP_DEBUG_DISPLAY` is set to true.\n *\n * When `WP_DEBUG` is true, all PHP notices are reported. WordPress will also\n * display internal notices: when a deprecated WordPress function, function\n * argument, or file is used. Deprecated code may be removed from a later\n * version.\n *\n * It is strongly recommended that plugin and theme developers use `WP_DEBUG`\n * in their development environments.\n *\n * `WP_DEBUG_DISPLAY` and `WP_DEBUG_LOG` perform no function unless `WP_DEBUG`\n * is true.\n *\n * When `WP_DEBUG_DISPLAY` is true, WordPress will force errors to be displayed.\n * `WP_DEBUG_DISPLAY` defaults to true. Defining it as null prevents WordPress\n * from changing the global configuration setting. Defining `WP_DEBUG_DISPLAY`\n * as false will force errors to be hidden.\n *\n * When `WP_DEBUG_LOG` is true, errors will be logged to `wp-content/debug.log`.\n * When `WP_DEBUG_LOG` is a valid path, errors will be logged to the specified file.\n *\n * Errors are never displayed for XML-RPC, REST, and Ajax requests.\n *\n * @since 3.0.0\n * @since 5.1.0 `WP_DEBUG_LOG` can be a file path.\n * @access private\n */\nfunction wp_debug_mode() {\n\t/**\n\t * Filters whether to allow the debug mode check to occur.\n\t *\n\t * This filter runs before it can be used by plugins. It is designed for\n\t * non-web run-times. Returning false causes the `WP_DEBUG` and related\n\t * constants to not be checked and the default PHP values for errors\n\t * will be used unless you take care to update them yourself.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param bool $enable_debug_mode Whether to enable debug mode checks to occur. Default true.\n\t */\n\tif ( ! apply_filters( 'enable_wp_debug_mode_checks', true ) ) {\n\t\treturn;\n\t}\n\n\tif ( WP_DEBUG ) {\n\t\terror_reporting( E_ALL );\n\n\t\tif ( WP_DEBUG_DISPLAY ) {\n\t\t\tini_set( 'display_errors', 1 );\n\t\t} elseif ( null !== WP_DEBUG_DISPLAY ) {\n\t\t\tini_set( 'display_errors', 0 );\n\t\t}\n\n\t\tif ( in_array( strtolower( (string) WP_DEBUG_LOG ), array( 'true', '1' ), true ) ) {\n\t\t\t$log_path = WP_CONTENT_DIR . '/debug.log';\n\t\t} elseif ( is_string( WP_DEBUG_LOG ) ) {\n\t\t\t$log_path = WP_DEBUG_LOG;\n\t\t} else {\n\t\t\t$log_path = false;\n\t\t}\n\n\t\tif ( $log_path ) {\n\t\t\tini_set( 'log_errors', 1 );\n\t\t\tini_set( 'error_log', $log_path );\n\t\t}\n\t} else {\n\t\terror_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );\n\t}\n\n\tif ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) || wp_doing_ajax() || wp_is_json_request() ) {\n\t\tini_set( 'display_errors', 0 );\n\t}\n}\n\n/**\n * Set the location of the language directory.\n *\n * To set directory manually, define the `WP_LANG_DIR` constant\n * in wp-config.php.\n *\n * If the language directory exists within `WP_CONTENT_DIR`, it\n * is used. Otherwise the language directory is assumed to live\n * in `WPINC`.\n *\n * @since 3.0.0\n * @access private\n */\nfunction wp_set_lang_dir() {\n\tif ( ! defined( 'WP_LANG_DIR' ) ) {\n\t\tif ( file_exists( WP_CONTENT_DIR . '/languages' ) && @is_dir( WP_CONTENT_DIR . '/languages' ) || ! @is_dir( ABSPATH . WPINC . '/languages' ) ) {\n\t\t\t/**\n\t\t\t * Server path of the language directory.\n\t\t\t *\n\t\t\t * No leading slash, no trailing slash, full path, not relative to ABSPATH\n\t\t\t *\n\t\t\t * @since 2.1.0\n\t\t\t */\n\t\t\tdefine( 'WP_LANG_DIR', WP_CONTENT_DIR . '/languages' );\n\t\t\tif ( ! defined( 'LANGDIR' ) ) {\n\t\t\t\t// Old static relative path maintained for limited backward compatibility - won't work in some cases.\n\t\t\t\tdefine( 'LANGDIR', 'wp-content/languages' );\n\t\t\t}\n\t\t} else {\n\t\t\t/**\n\t\t\t * Server path of the language directory.\n\t\t\t *\n\t\t\t * No leading slash, no trailing slash, full path, not relative to `ABSPATH`.\n\t\t\t *\n\t\t\t * @since 2.1.0\n\t\t\t */\n\t\t\tdefine( 'WP_LANG_DIR', ABSPATH . WPINC . '/languages' );\n\t\t\tif ( ! defined( 'LANGDIR' ) ) {\n\t\t\t\t// Old relative path maintained for backward compatibility.\n\t\t\t\tdefine( 'LANGDIR', WPINC . '/languages' );\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Load the database class file and instantiate the `$wpdb` global.\n *\n * @since 2.5.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction require_wp_db() {\n\tglobal $wpdb;\n\n\trequire_once ABSPATH . WPINC . '/wp-db.php';\n\tif ( file_exists( WP_CONTENT_DIR . '/db.php' ) ) {\n\t\trequire_once WP_CONTENT_DIR . '/db.php';\n\t}\n\n\tif ( isset( $wpdb ) ) {\n\t\treturn;\n\t}\n\n\t$dbuser     = defined( 'DB_USER' ) ? DB_USER : '';\n\t$dbpassword = defined( 'DB_PASSWORD' ) ? DB_PASSWORD : '';\n\t$dbname     = defined( 'DB_NAME' ) ? DB_NAME : '';\n\t$dbhost     = defined( 'DB_HOST' ) ? DB_HOST : '';\n\n\t$wpdb = new wpdb( $dbuser, $dbpassword, $dbname, $dbhost );\n}\n\n/**\n * Set the database table prefix and the format specifiers for database\n * table columns.\n *\n * Columns not listed here default to `%s`.\n *\n * @since 3.0.0\n * @access private\n *\n * @global wpdb   $wpdb         WordPress database abstraction object.\n * @global string $table_prefix The database table prefix.\n */\nfunction wp_set_wpdb_vars() {\n\tglobal $wpdb, $table_prefix;\n\tif ( ! empty( $wpdb->error ) ) {\n\t\tdead_db();\n\t}\n\n\t$wpdb->field_types = array(\n\t\t'post_author'      => '%d',\n\t\t'post_parent'      => '%d',\n\t\t'menu_order'       => '%d',\n\t\t'term_id'          => '%d',\n\t\t'term_group'       => '%d',\n\t\t'term_taxonomy_id' => '%d',\n\t\t'parent'           => '%d',\n\t\t'count'            => '%d',\n\t\t'object_id'        => '%d',\n\t\t'term_order'       => '%d',\n\t\t'ID'               => '%d',\n\t\t'comment_ID'       => '%d',\n\t\t'comment_post_ID'  => '%d',\n\t\t'comment_parent'   => '%d',\n\t\t'user_id'          => '%d',\n\t\t'link_id'          => '%d',\n\t\t'link_owner'       => '%d',\n\t\t'link_rating'      => '%d',\n\t\t'option_id'        => '%d',\n\t\t'blog_id'          => '%d',\n\t\t'meta_id'          => '%d',\n\t\t'post_id'          => '%d',\n\t\t'user_status'      => '%d',\n\t\t'umeta_id'         => '%d',\n\t\t'comment_karma'    => '%d',\n\t\t'comment_count'    => '%d',\n\t\t// Multisite:\n\t\t'active'           => '%d',\n\t\t'cat_id'           => '%d',\n\t\t'deleted'          => '%d',\n\t\t'lang_id'          => '%d',\n\t\t'mature'           => '%d',\n\t\t'public'           => '%d',\n\t\t'site_id'          => '%d',\n\t\t'spam'             => '%d',\n\t);\n\n\t$prefix = $wpdb->set_prefix( $table_prefix );\n\n\tif ( is_wp_error( $prefix ) ) {\n\t\twp_load_translations_early();\n\t\twp_die(\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: $table_prefix, 2: wp-config.php */\n\t\t\t\t__( '<strong>Error</strong>: %1$s in %2$s can only contain numbers, letters, and underscores.' ),\n\t\t\t\t'<code>$table_prefix</code>',\n\t\t\t\t'<code>wp-config.php</code>'\n\t\t\t)\n\t\t);\n\t}\n}\n\n/**\n * Toggle `$_wp_using_ext_object_cache` on and off without directly\n * touching global.\n *\n * @since 3.7.0\n *\n * @global bool $_wp_using_ext_object_cache\n *\n * @param bool $using Whether external object cache is being used.\n * @return bool The current 'using' setting.\n */\nfunction wp_using_ext_object_cache( $using = null ) {\n\tglobal $_wp_using_ext_object_cache;\n\t$current_using = $_wp_using_ext_object_cache;\n\tif ( null !== $using ) {\n\t\t$_wp_using_ext_object_cache = $using;\n\t}\n\treturn $current_using;\n}\n\n/**\n * Start the WordPress object cache.\n *\n * If an object-cache.php file exists in the wp-content directory,\n * it uses that drop-in as an external object cache.\n *\n * @since 3.0.0\n * @access private\n *\n * @global array $wp_filter Stores all of the filters.\n */\nfunction wp_start_object_cache() {\n\tglobal $wp_filter;\n\tstatic $first_init = true;\n\n\t// Only perform the following checks once.\n\tif ( $first_init ) {\n\t\tif ( ! function_exists( 'wp_cache_init' ) ) {\n\t\t\t/*\n\t\t\t * This is the normal situation. First-run of this function. No\n\t\t\t * caching backend has been loaded.\n\t\t\t *\n\t\t\t * We try to load a custom caching backend, and then, if it\n\t\t\t * results in a wp_cache_init() function existing, we note\n\t\t\t * that an external object cache is being used.\n\t\t\t */\n\t\t\tif ( file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) {\n\t\t\t\trequire_once WP_CONTENT_DIR . '/object-cache.php';\n\t\t\t\tif ( function_exists( 'wp_cache_init' ) ) {\n\t\t\t\t\twp_using_ext_object_cache( true );\n\t\t\t\t}\n\n\t\t\t\t// Re-initialize any hooks added manually by object-cache.php.\n\t\t\t\tif ( $wp_filter ) {\n\t\t\t\t\t$wp_filter = WP_Hook::build_preinitialized_hooks( $wp_filter );\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( ! wp_using_ext_object_cache() && file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) {\n\t\t\t/*\n\t\t\t * Sometimes advanced-cache.php can load object-cache.php before\n\t\t\t * this function is run. This breaks the function_exists() check\n\t\t\t * above and can result in wp_using_ext_object_cache() returning\n\t\t\t * false when actually an external cache is in use.\n\t\t\t */\n\t\t\twp_using_ext_object_cache( true );\n\t\t}\n\t}\n\n\tif ( ! wp_using_ext_object_cache() ) {\n\t\trequire_once ABSPATH . WPINC . '/cache.php';\n\t}\n\n\trequire_once ABSPATH . WPINC . '/cache-compat.php';\n\n\t/*\n\t * If cache supports reset, reset instead of init if already\n\t * initialized. Reset signals to the cache that global IDs\n\t * have changed and it may need to update keys and cleanup caches.\n\t */\n\tif ( ! $first_init && function_exists( 'wp_cache_switch_to_blog' ) ) {\n\t\twp_cache_switch_to_blog( get_current_blog_id() );\n\t} elseif ( function_exists( 'wp_cache_init' ) ) {\n\t\twp_cache_init();\n\t}\n\n\tif ( function_exists( 'wp_cache_add_global_groups' ) ) {\n\t\twp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'blog-lookup', 'blog-details', 'site-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'blog_meta' ) );\n\t\twp_cache_add_non_persistent_groups( array( 'counts', 'plugins' ) );\n\t}\n\n\t$first_init = false;\n}\n\n/**\n * Redirect to the installer if WordPress is not installed.\n *\n * Dies with an error message when Multisite is enabled.\n *\n * @since 3.0.0\n * @access private\n */\nfunction wp_not_installed() {\n\tif ( is_multisite() ) {\n\t\tif ( ! is_blog_installed() && ! wp_installing() ) {\n\t\t\tnocache_headers();\n\n\t\t\twp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) );\n\t\t}\n\t} elseif ( ! is_blog_installed() && ! wp_installing() ) {\n\t\tnocache_headers();\n\n\t\trequire ABSPATH . WPINC . '/kses.php';\n\t\trequire ABSPATH . WPINC . '/pluggable.php';\n\n\t\t$link = wp_guess_url() . '/wp-admin/install.php';\n\n\t\twp_redirect( $link );\n\t\tdie();\n\t}\n}\n\n/**\n * Retrieve an array of must-use plugin files.\n *\n * The default directory is wp-content/mu-plugins. To change the default\n * directory manually, define `WPMU_PLUGIN_DIR` and `WPMU_PLUGIN_URL`\n * in wp-config.php.\n *\n * @since 3.0.0\n * @access private\n *\n * @return string[] Array of absolute paths of files to include.\n */\nfunction wp_get_mu_plugins() {\n\t$mu_plugins = array();\n\tif ( ! is_dir( WPMU_PLUGIN_DIR ) ) {\n\t\treturn $mu_plugins;\n\t}\n\t$dh = opendir( WPMU_PLUGIN_DIR );\n\tif ( ! $dh ) {\n\t\treturn $mu_plugins;\n\t}\n\twhile ( ( $plugin = readdir( $dh ) ) !== false ) {\n\t\tif ( '.php' === substr( $plugin, -4 ) ) {\n\t\t\t$mu_plugins[] = WPMU_PLUGIN_DIR . '/' . $plugin;\n\t\t}\n\t}\n\tclosedir( $dh );\n\tsort( $mu_plugins );\n\n\treturn $mu_plugins;\n}\n\n/**\n * Retrieve an array of active and valid plugin files.\n *\n * While upgrading or installing WordPress, no plugins are returned.\n *\n * The default directory is `wp-content/plugins`. To change the default\n * directory manually, define `WP_PLUGIN_DIR` and `WP_PLUGIN_URL`\n * in `wp-config.php`.\n *\n * @since 3.0.0\n * @access private\n *\n * @return string[] Array of paths to plugin files relative to the plugins directory.\n */\nfunction wp_get_active_and_valid_plugins() {\n\t$plugins        = array();\n\t$active_plugins = (array) get_option( 'active_plugins', array() );\n\n\t// Check for hacks file if the option is enabled.\n\tif ( get_option( 'hack_file' ) && file_exists( ABSPATH . 'my-hacks.php' ) ) {\n\t\t_deprecated_file( 'my-hacks.php', '1.5.0' );\n\t\tarray_unshift( $plugins, ABSPATH . 'my-hacks.php' );\n\t}\n\n\tif ( empty( $active_plugins ) || wp_installing() ) {\n\t\treturn $plugins;\n\t}\n\n\t$network_plugins = is_multisite() ? wp_get_active_network_plugins() : false;\n\n\tforeach ( $active_plugins as $plugin ) {\n\t\tif ( ! validate_file( $plugin )                     // $plugin must validate as file.\n\t\t\t&& '.php' === substr( $plugin, -4 )             // $plugin must end with '.php'.\n\t\t\t&& file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist.\n\t\t\t// Not already included as a network plugin.\n\t\t\t&& ( ! $network_plugins || ! in_array( WP_PLUGIN_DIR . '/' . $plugin, $network_plugins, true ) )\n\t\t\t) {\n\t\t\t$plugins[] = WP_PLUGIN_DIR . '/' . $plugin;\n\t\t}\n\t}\n\n\t/*\n\t * Remove plugins from the list of active plugins when we're on an endpoint\n\t * that should be protected against WSODs and the plugin is paused.\n\t */\n\tif ( wp_is_recovery_mode() ) {\n\t\t$plugins = wp_skip_paused_plugins( $plugins );\n\t}\n\n\treturn $plugins;\n}\n\n/**\n * Filters a given list of plugins, removing any paused plugins from it.\n *\n * @since 5.2.0\n *\n * @param string[] $plugins Array of absolute plugin main file paths.\n * @return string[] Filtered array of plugins, without any paused plugins.\n */\nfunction wp_skip_paused_plugins( array $plugins ) {\n\t$paused_plugins = wp_paused_plugins()->get_all();\n\n\tif ( empty( $paused_plugins ) ) {\n\t\treturn $plugins;\n\t}\n\n\tforeach ( $plugins as $index => $plugin ) {\n\t\tlist( $plugin ) = explode( '/', plugin_basename( $plugin ) );\n\n\t\tif ( array_key_exists( $plugin, $paused_plugins ) ) {\n\t\t\tunset( $plugins[ $index ] );\n\n\t\t\t// Store list of paused plugins for displaying an admin notice.\n\t\t\t$GLOBALS['_paused_plugins'][ $plugin ] = $paused_plugins[ $plugin ];\n\t\t}\n\t}\n\n\treturn $plugins;\n}\n\n/**\n * Retrieves an array of active and valid themes.\n *\n * While upgrading or installing WordPress, no themes are returned.\n *\n * @since 5.1.0\n * @access private\n *\n * @return string[] Array of absolute paths to theme directories.\n */\nfunction wp_get_active_and_valid_themes() {\n\tglobal $pagenow;\n\n\t$themes = array();\n\n\tif ( wp_installing() && 'wp-activate.php' !== $pagenow ) {\n\t\treturn $themes;\n\t}\n\n\tif ( TEMPLATEPATH !== STYLESHEETPATH ) {\n\t\t$themes[] = STYLESHEETPATH;\n\t}\n\n\t$themes[] = TEMPLATEPATH;\n\n\t/*\n\t * Remove themes from the list of active themes when we're on an endpoint\n\t * that should be protected against WSODs and the theme is paused.\n\t */\n\tif ( wp_is_recovery_mode() ) {\n\t\t$themes = wp_skip_paused_themes( $themes );\n\n\t\t// If no active and valid themes exist, skip loading themes.\n\t\tif ( empty( $themes ) ) {\n\t\t\tadd_filter( 'wp_using_themes', '__return_false' );\n\t\t}\n\t}\n\n\treturn $themes;\n}\n\n/**\n * Filters a given list of themes, removing any paused themes from it.\n *\n * @since 5.2.0\n *\n * @param string[] $themes Array of absolute theme directory paths.\n * @return string[] Filtered array of absolute paths to themes, without any paused themes.\n */\nfunction wp_skip_paused_themes( array $themes ) {\n\t$paused_themes = wp_paused_themes()->get_all();\n\n\tif ( empty( $paused_themes ) ) {\n\t\treturn $themes;\n\t}\n\n\tforeach ( $themes as $index => $theme ) {\n\t\t$theme = basename( $theme );\n\n\t\tif ( array_key_exists( $theme, $paused_themes ) ) {\n\t\t\tunset( $themes[ $index ] );\n\n\t\t\t// Store list of paused themes for displaying an admin notice.\n\t\t\t$GLOBALS['_paused_themes'][ $theme ] = $paused_themes[ $theme ];\n\t\t}\n\t}\n\n\treturn $themes;\n}\n\n/**\n * Is WordPress in Recovery Mode.\n *\n * In this mode, plugins or themes that cause WSODs will be paused.\n *\n * @since 5.2.0\n *\n * @return bool\n */\nfunction wp_is_recovery_mode() {\n\treturn wp_recovery_mode()->is_active();\n}\n\n/**\n * Determines whether we are currently on an endpoint that should be protected against WSODs.\n *\n * @since 5.2.0\n *\n * @return bool True if the current endpoint should be protected.\n */\nfunction is_protected_endpoint() {\n\t// Protect login pages.\n\tif ( isset( $GLOBALS['pagenow'] ) && 'wp-login.php' === $GLOBALS['pagenow'] ) {\n\t\treturn true;\n\t}\n\n\t// Protect the admin backend.\n\tif ( is_admin() && ! wp_doing_ajax() ) {\n\t\treturn true;\n\t}\n\n\t// Protect Ajax actions that could help resolve a fatal error should be available.\n\tif ( is_protected_ajax_action() ) {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Filters whether the current request is against a protected endpoint.\n\t *\n\t * This filter is only fired when an endpoint is requested which is not already protected by\n\t * WordPress core. As such, it exclusively allows providing further protected endpoints in\n\t * addition to the admin backend, login pages and protected Ajax actions.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param bool $is_protected_endpoint Whether the currently requested endpoint is protected.\n\t *                                    Default false.\n\t */\n\treturn (bool) apply_filters( 'is_protected_endpoint', false );\n}\n\n/**\n * Determines whether we are currently handling an Ajax action that should be protected against WSODs.\n *\n * @since 5.2.0\n *\n * @return bool True if the current Ajax action should be protected.\n */\nfunction is_protected_ajax_action() {\n\tif ( ! wp_doing_ajax() ) {\n\t\treturn false;\n\t}\n\n\tif ( ! isset( $_REQUEST['action'] ) ) {\n\t\treturn false;\n\t}\n\n\t$actions_to_protect = array(\n\t\t'edit-theme-plugin-file', // Saving changes in the core code editor.\n\t\t'heartbeat',              // Keep the heart beating.\n\t\t'install-plugin',         // Installing a new plugin.\n\t\t'install-theme',          // Installing a new theme.\n\t\t'search-plugins',         // Searching in the list of plugins.\n\t\t'search-install-plugins', // Searching for a plugin in the plugin install screen.\n\t\t'update-plugin',          // Update an existing plugin.\n\t\t'update-theme',           // Update an existing theme.\n\t);\n\n\t/**\n\t * Filters the array of protected Ajax actions.\n\t *\n\t * This filter is only fired when doing Ajax and the Ajax request has an 'action' property.\n\t *\n\t * @since 5.2.0\n\t *\n\t * @param string[] $actions_to_protect Array of strings with Ajax actions to protect.\n\t */\n\t$actions_to_protect = (array) apply_filters( 'wp_protected_ajax_actions', $actions_to_protect );\n\n\tif ( ! in_array( $_REQUEST['action'], $actions_to_protect, true ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Set internal encoding.\n *\n * In most cases the default internal encoding is latin1, which is\n * of no use, since we want to use the `mb_` functions for `utf-8` strings.\n *\n * @since 3.0.0\n * @access private\n */\nfunction wp_set_internal_encoding() {\n\tif ( function_exists( 'mb_internal_encoding' ) ) {\n\t\t$charset = get_option( 'blog_charset' );\n\t\t// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged\n\t\tif ( ! $charset || ! @mb_internal_encoding( $charset ) ) {\n\t\t\tmb_internal_encoding( 'UTF-8' );\n\t\t}\n\t}\n}\n\n/**\n * Add magic quotes to `$_GET`, `$_POST`, `$_COOKIE`, and `$_SERVER`.\n *\n * Also forces `$_REQUEST` to be `$_GET + $_POST`. If `$_SERVER`,\n * `$_COOKIE`, or `$_ENV` are needed, use those superglobals directly.\n *\n * @since 3.0.0\n * @access private\n */\nfunction wp_magic_quotes() {\n\t// Escape with wpdb.\n\t$_GET    = add_magic_quotes( $_GET );\n\t$_POST   = add_magic_quotes( $_POST );\n\t$_COOKIE = add_magic_quotes( $_COOKIE );\n\t$_SERVER = add_magic_quotes( $_SERVER );\n\n\t// Force REQUEST to be GET + POST.\n\t$_REQUEST = array_merge( $_GET, $_POST );\n}\n\n/**\n * Runs just before PHP shuts down execution.\n *\n * @since 1.2.0\n * @access private\n */\nfunction shutdown_action_hook() {\n\t/**\n\t * Fires just before PHP shuts down execution.\n\t *\n\t * @since 1.2.0\n\t */\n\tdo_action( 'shutdown' );\n\n\twp_cache_close();\n}\n\n/**\n * Copy an object.\n *\n * @since 2.7.0\n * @deprecated 3.2.0\n *\n * @param object $object The object to clone.\n * @return object The cloned object.\n */\nfunction wp_clone( $object ) {\n\t// Use parens for clone to accommodate PHP 4. See #17880.\n\treturn clone( $object );\n}\n\n/**\n * Determines whether the current request is for an administrative interface page.\n *\n * Does not check if the user is an administrator; use current_user_can()\n * for checking roles and capabilities.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.1\n *\n * @global WP_Screen $current_screen WordPress current screen object.\n *\n * @return bool True if inside WordPress administration interface, false otherwise.\n */\nfunction is_admin() {\n\tif ( isset( $GLOBALS['current_screen'] ) ) {\n\t\treturn $GLOBALS['current_screen']->in_admin();\n\t} elseif ( defined( 'WP_ADMIN' ) ) {\n\t\treturn WP_ADMIN;\n\t}\n\n\treturn false;\n}\n\n/**\n * Whether the current request is for a site's administrative interface.\n *\n * e.g. `/wp-admin/`\n *\n * Does not check if the user is an administrator; use current_user_can()\n * for checking roles and capabilities.\n *\n * @since 3.1.0\n *\n * @global WP_Screen $current_screen WordPress current screen object.\n *\n * @return bool True if inside WordPress blog administration pages.\n */\nfunction is_blog_admin() {\n\tif ( isset( $GLOBALS['current_screen'] ) ) {\n\t\treturn $GLOBALS['current_screen']->in_admin( 'site' );\n\t} elseif ( defined( 'WP_BLOG_ADMIN' ) ) {\n\t\treturn WP_BLOG_ADMIN;\n\t}\n\n\treturn false;\n}\n\n/**\n * Whether the current request is for the network administrative interface.\n *\n * e.g. `/wp-admin/network/`\n *\n * Does not check if the user is an administrator; use current_user_can()\n * for checking roles and capabilities.\n *\n * Does not check if the site is a Multisite network; use is_multisite()\n * for checking if Multisite is enabled.\n *\n * @since 3.1.0\n *\n * @global WP_Screen $current_screen WordPress current screen object.\n *\n * @return bool True if inside WordPress network administration pages.\n */\nfunction is_network_admin() {\n\tif ( isset( $GLOBALS['current_screen'] ) ) {\n\t\treturn $GLOBALS['current_screen']->in_admin( 'network' );\n\t} elseif ( defined( 'WP_NETWORK_ADMIN' ) ) {\n\t\treturn WP_NETWORK_ADMIN;\n\t}\n\n\treturn false;\n}\n\n/**\n * Whether the current request is for a user admin screen.\n *\n * e.g. `/wp-admin/user/`\n *\n * Does not check if the user is an administrator; use current_user_can()\n * for checking roles and capabilities.\n *\n * @since 3.1.0\n *\n * @global WP_Screen $current_screen WordPress current screen object.\n *\n * @return bool True if inside WordPress user administration pages.\n */\nfunction is_user_admin() {\n\tif ( isset( $GLOBALS['current_screen'] ) ) {\n\t\treturn $GLOBALS['current_screen']->in_admin( 'user' );\n\t} elseif ( defined( 'WP_USER_ADMIN' ) ) {\n\t\treturn WP_USER_ADMIN;\n\t}\n\n\treturn false;\n}\n\n/**\n * If Multisite is enabled.\n *\n * @since 3.0.0\n *\n * @return bool True if Multisite is enabled, false otherwise.\n */\nfunction is_multisite() {\n\tif ( defined( 'MULTISITE' ) ) {\n\t\treturn MULTISITE;\n\t}\n\n\tif ( defined( 'SUBDOMAIN_INSTALL' ) || defined( 'VHOST' ) || defined( 'SUNRISE' ) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Retrieve the current site ID.\n *\n * @since 3.1.0\n *\n * @global int $blog_id\n *\n * @return int Site ID.\n */\nfunction get_current_blog_id() {\n\tglobal $blog_id;\n\treturn absint( $blog_id );\n}\n\n/**\n * Retrieves the current network ID.\n *\n * @since 4.6.0\n *\n * @return int The ID of the current network.\n */\nfunction get_current_network_id() {\n\tif ( ! is_multisite() ) {\n\t\treturn 1;\n\t}\n\n\t$current_network = get_network();\n\n\tif ( ! isset( $current_network->id ) ) {\n\t\treturn get_main_network_id();\n\t}\n\n\treturn absint( $current_network->id );\n}\n\n/**\n * Attempt an early load of translations.\n *\n * Used for errors encountered during the initial loading process, before\n * the locale has been properly detected and loaded.\n *\n * Designed for unusual load sequences (like setup-config.php) or for when\n * the script will then terminate with an error, otherwise there is a risk\n * that a file can be double-included.\n *\n * @since 3.4.0\n * @access private\n *\n * @global WP_Locale $wp_locale WordPress date and time locale object.\n */\nfunction wp_load_translations_early() {\n\tglobal $wp_locale;\n\n\tstatic $loaded = false;\n\tif ( $loaded ) {\n\t\treturn;\n\t}\n\t$loaded = true;\n\n\tif ( function_exists( 'did_action' ) && did_action( 'init' ) ) {\n\t\treturn;\n\t}\n\n\t// We need $wp_local_package.\n\trequire ABSPATH . WPINC . '/version.php';\n\n\t// Translation and localization.\n\trequire_once ABSPATH . WPINC . '/pomo/mo.php';\n\trequire_once ABSPATH . WPINC . '/l10n.php';\n\trequire_once ABSPATH . WPINC . '/class-wp-locale.php';\n\trequire_once ABSPATH . WPINC . '/class-wp-locale-switcher.php';\n\n\t// General libraries.\n\trequire_once ABSPATH . WPINC . '/plugin.php';\n\n\t$locales   = array();\n\t$locations = array();\n\n\twhile ( true ) {\n\t\tif ( defined( 'WPLANG' ) ) {\n\t\t\tif ( '' === WPLANG ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$locales[] = WPLANG;\n\t\t}\n\n\t\tif ( isset( $wp_local_package ) ) {\n\t\t\t$locales[] = $wp_local_package;\n\t\t}\n\n\t\tif ( ! $locales ) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif ( defined( 'WP_LANG_DIR' ) && @is_dir( WP_LANG_DIR ) ) {\n\t\t\t$locations[] = WP_LANG_DIR;\n\t\t}\n\n\t\tif ( defined( 'WP_CONTENT_DIR' ) && @is_dir( WP_CONTENT_DIR . '/languages' ) ) {\n\t\t\t$locations[] = WP_CONTENT_DIR . '/languages';\n\t\t}\n\n\t\tif ( @is_dir( ABSPATH . 'wp-content/languages' ) ) {\n\t\t\t$locations[] = ABSPATH . 'wp-content/languages';\n\t\t}\n\n\t\tif ( @is_dir( ABSPATH . WPINC . '/languages' ) ) {\n\t\t\t$locations[] = ABSPATH . WPINC . '/languages';\n\t\t}\n\n\t\tif ( ! $locations ) {\n\t\t\tbreak;\n\t\t}\n\n\t\t$locations = array_unique( $locations );\n\n\t\tforeach ( $locales as $locale ) {\n\t\t\tforeach ( $locations as $location ) {\n\t\t\t\tif ( file_exists( $location . '/' . $locale . '.mo' ) ) {\n\t\t\t\t\tload_textdomain( 'default', $location . '/' . $locale . '.mo' );\n\t\t\t\t\tif ( defined( 'WP_SETUP_CONFIG' ) && file_exists( $location . '/admin-' . $locale . '.mo' ) ) {\n\t\t\t\t\t\tload_textdomain( 'default', $location . '/admin-' . $locale . '.mo' );\n\t\t\t\t\t}\n\t\t\t\t\tbreak 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbreak;\n\t}\n\n\t$wp_locale = new WP_Locale();\n}\n\n/**\n * Check or set whether WordPress is in \"installation\" mode.\n *\n * If the `WP_INSTALLING` constant is defined during the bootstrap, `wp_installing()` will default to `true`.\n *\n * @since 4.4.0\n *\n * @param bool $is_installing Optional. True to set WP into Installing mode, false to turn Installing mode off.\n *                            Omit this parameter if you only want to fetch the current status.\n * @return bool True if WP is installing, otherwise false. When a `$is_installing` is passed, the function will\n *              report whether WP was in installing mode prior to the change to `$is_installing`.\n */\nfunction wp_installing( $is_installing = null ) {\n\tstatic $installing = null;\n\n\t// Support for the `WP_INSTALLING` constant, defined before WP is loaded.\n\tif ( is_null( $installing ) ) {\n\t\t$installing = defined( 'WP_INSTALLING' ) && WP_INSTALLING;\n\t}\n\n\tif ( ! is_null( $is_installing ) ) {\n\t\t$old_installing = $installing;\n\t\t$installing     = $is_installing;\n\t\treturn (bool) $old_installing;\n\t}\n\n\treturn (bool) $installing;\n}\n\n/**\n * Determines if SSL is used.\n *\n * @since 2.6.0\n * @since 4.6.0 Moved from functions.php to load.php.\n *\n * @return bool True if SSL, otherwise false.\n */\nfunction is_ssl() {\n\tif ( isset( $_SERVER['HTTPS'] ) ) {\n\t\tif ( 'on' === strtolower( $_SERVER['HTTPS'] ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( '1' == $_SERVER['HTTPS'] ) {\n\t\t\treturn true;\n\t\t}\n\t} elseif ( isset( $_SERVER['SERVER_PORT'] ) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Converts a shorthand byte value to an integer byte value.\n *\n * @since 2.3.0\n * @since 4.6.0 Moved from media.php to load.php.\n *\n * @link https://www.php.net/manual/en/function.ini-get.php\n * @link https://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes\n *\n * @param string $value A (PHP ini) byte value, either shorthand or ordinary.\n * @return int An integer byte value.\n */\nfunction wp_convert_hr_to_bytes( $value ) {\n\t$value = strtolower( trim( $value ) );\n\t$bytes = (int) $value;\n\n\tif ( false !== strpos( $value, 'g' ) ) {\n\t\t$bytes *= GB_IN_BYTES;\n\t} elseif ( false !== strpos( $value, 'm' ) ) {\n\t\t$bytes *= MB_IN_BYTES;\n\t} elseif ( false !== strpos( $value, 'k' ) ) {\n\t\t$bytes *= KB_IN_BYTES;\n\t}\n\n\t// Deal with large (float) values which run into the maximum integer size.\n\treturn min( $bytes, PHP_INT_MAX );\n}\n\n/**\n * Determines whether a PHP ini value is changeable at runtime.\n *\n * @since 4.6.0\n *\n * @link https://www.php.net/manual/en/function.ini-get-all.php\n *\n * @param string $setting The name of the ini setting to check.\n * @return bool True if the value is changeable at runtime. False otherwise.\n */\nfunction wp_is_ini_value_changeable( $setting ) {\n\tstatic $ini_all;\n\n\tif ( ! isset( $ini_all ) ) {\n\t\t$ini_all = false;\n\t\t// Sometimes `ini_get_all()` is disabled via the `disable_functions` option for \"security purposes\".\n\t\tif ( function_exists( 'ini_get_all' ) ) {\n\t\t\t$ini_all = ini_get_all();\n\t\t}\n\t}\n\n\t// Bit operator to workaround https://bugs.php.net/bug.php?id=44936 which changes access level to 63 in PHP 5.2.6 - 5.2.17.\n\tif ( isset( $ini_all[ $setting ]['access'] ) && ( INI_ALL === ( $ini_all[ $setting ]['access'] & 7 ) || INI_USER === ( $ini_all[ $setting ]['access'] & 7 ) ) ) {\n\t\treturn true;\n\t}\n\n\t// If we were unable to retrieve the details, fail gracefully to assume it's changeable.\n\tif ( ! is_array( $ini_all ) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Determines whether the current request is a WordPress Ajax request.\n *\n * @since 4.7.0\n *\n * @return bool True if it's a WordPress Ajax request, false otherwise.\n */\nfunction wp_doing_ajax() {\n\t/**\n\t * Filters whether the current request is a WordPress Ajax request.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param bool $wp_doing_ajax Whether the current request is a WordPress Ajax request.\n\t */\n\treturn apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX );\n}\n\n/**\n * Determines whether the current request should use themes.\n *\n * @since 5.1.0\n *\n * @return bool True if themes should be used, false otherwise.\n */\nfunction wp_using_themes() {\n\t/**\n\t * Filters whether the current request should use themes.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param bool $wp_using_themes Whether the current request should use themes.\n\t */\n\treturn apply_filters( 'wp_using_themes', defined( 'WP_USE_THEMES' ) && WP_USE_THEMES );\n}\n\n/**\n * Determines whether the current request is a WordPress cron request.\n *\n * @since 4.8.0\n *\n * @return bool True if it's a WordPress cron request, false otherwise.\n */\nfunction wp_doing_cron() {\n\t/**\n\t * Filters whether the current request is a WordPress cron request.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param bool $wp_doing_cron Whether the current request is a WordPress cron request.\n\t */\n\treturn apply_filters( 'wp_doing_cron', defined( 'DOING_CRON' ) && DOING_CRON );\n}\n\n/**\n * Check whether variable is a WordPress Error.\n *\n * Returns true if $thing is an object of the WP_Error class.\n *\n * @since 2.1.0\n *\n * @param mixed $thing Check if unknown variable is a WP_Error object.\n * @return bool True, if WP_Error. False, if not WP_Error.\n */\nfunction is_wp_error( $thing ) {\n\treturn ( $thing instanceof WP_Error );\n}\n\n/**\n * Determines whether file modifications are allowed.\n *\n * @since 4.8.0\n *\n * @param string $context The usage context.\n * @return bool True if file modification is allowed, false otherwise.\n */\nfunction wp_is_file_mod_allowed( $context ) {\n\t/**\n\t * Filters whether file modifications are allowed.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param bool   $file_mod_allowed Whether file modifications are allowed.\n\t * @param string $context          The usage context.\n\t */\n\treturn apply_filters( 'file_mod_allowed', ! defined( 'DISALLOW_FILE_MODS' ) || ! DISALLOW_FILE_MODS, $context );\n}\n\n/**\n * Start scraping edited file errors.\n *\n * @since 4.9.0\n */\nfunction wp_start_scraping_edited_file_errors() {\n\tif ( ! isset( $_REQUEST['wp_scrape_key'] ) || ! isset( $_REQUEST['wp_scrape_nonce'] ) ) {\n\t\treturn;\n\t}\n\t$key   = substr( sanitize_key( wp_unslash( $_REQUEST['wp_scrape_key'] ) ), 0, 32 );\n\t$nonce = wp_unslash( $_REQUEST['wp_scrape_nonce'] );\n\n\tif ( get_transient( 'scrape_key_' . $key ) !== $nonce ) {\n\t\techo \"###### wp_scraping_result_start:$key ######\";\n\t\techo wp_json_encode(\n\t\t\tarray(\n\t\t\t\t'code'    => 'scrape_nonce_failure',\n\t\t\t\t'message' => __( 'Scrape nonce check failed. Please try again.' ),\n\t\t\t)\n\t\t);\n\t\techo \"###### wp_scraping_result_end:$key ######\";\n\t\tdie();\n\t}\n\tif ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {\n\t\tdefine( 'WP_SANDBOX_SCRAPING', true );\n\t}\n\tregister_shutdown_function( 'wp_finalize_scraping_edited_file_errors', $key );\n}\n\n/**\n * Finalize scraping for edited file errors.\n *\n * @since 4.9.0\n *\n * @param string $scrape_key Scrape key.\n */\nfunction wp_finalize_scraping_edited_file_errors( $scrape_key ) {\n\t$error = error_get_last();\n\techo \"\\n###### wp_scraping_result_start:$scrape_key ######\\n\";\n\tif ( ! empty( $error ) && in_array( $error['type'], array( E_CORE_ERROR, E_COMPILE_ERROR, E_ERROR, E_PARSE, E_USER_ERROR, E_RECOVERABLE_ERROR ), true ) ) {\n\t\t$error = str_replace( ABSPATH, '', $error );\n\t\techo wp_json_encode( $error );\n\t} else {\n\t\techo wp_json_encode( true );\n\t}\n\techo \"\\n###### wp_scraping_result_end:$scrape_key ######\\n\";\n}\n\n/**\n * Checks whether current request is a JSON request, or is expecting a JSON response.\n *\n * @since 5.0.0\n *\n * @return bool True if `Accepts` or `Content-Type` headers contain `application/json`.\n *              False otherwise.\n */\nfunction wp_is_json_request() {\n\n\tif ( isset( $_SERVER['HTTP_ACCEPT'] ) && false !== strpos( $_SERVER['HTTP_ACCEPT'], 'application/json' ) ) {\n\t\treturn true;\n\t}\n\n\tif ( isset( $_SERVER['CONTENT_TYPE'] ) && 'application/json' === $_SERVER['CONTENT_TYPE'] ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n\n}\n\n/**\n * Checks whether current request is a JSONP request, or is expecting a JSONP response.\n *\n * @since 5.2.0\n *\n * @return bool True if JSONP request, false otherwise.\n */\nfunction wp_is_jsonp_request() {\n\tif ( ! isset( $_GET['_jsonp'] ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! function_exists( 'wp_check_jsonp_callback' ) ) {\n\t\trequire_once ABSPATH . WPINC . '/functions.php';\n\t}\n\n\t$jsonp_callback = $_GET['_jsonp'];\n\tif ( ! wp_check_jsonp_callback( $jsonp_callback ) ) {\n\t\treturn false;\n\t}\n\n\t/** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */\n\t$jsonp_enabled = apply_filters( 'rest_jsonp_enabled', true );\n\n\treturn $jsonp_enabled;\n\n}\n\n/**\n * Checks whether current request is an XML request, or is expecting an XML response.\n *\n * @since 5.2.0\n *\n * @return bool True if `Accepts` or `Content-Type` headers contain `text/xml`\n *              or one of the related MIME types. False otherwise.\n */\nfunction wp_is_xml_request() {\n\t$accepted = array(\n\t\t'text/xml',\n\t\t'application/rss+xml',\n\t\t'application/atom+xml',\n\t\t'application/rdf+xml',\n\t\t'text/xml+oembed',\n\t\t'application/xml+oembed',\n\t);\n\n\tif ( isset( $_SERVER['HTTP_ACCEPT'] ) ) {\n\t\tforeach ( $accepted as $type ) {\n\t\t\tif ( false !== strpos( $_SERVER['HTTP_ACCEPT'], $type ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( isset( $_SERVER['CONTENT_TYPE'] ) && in_array( $_SERVER['CONTENT_TYPE'], $accepted, true ) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n", "num_lines": 1612}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Locale API\n *\n * @package WordPress\n * @subpackage i18n\n * @since 1.2.0\n * @deprecated 4.7.0\n */\n\n_deprecated_file( basename( __FILE__ ), '4.7.0' );\n", "num_lines": 12}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress media templates.\n *\n * @package WordPress\n * @subpackage Media\n * @since 3.5.0\n */\n\n/**\n * Output the markup for a audio tag to be used in an Underscore template\n * when data.model is passed.\n *\n * @since 3.9.0\n */\nfunction wp_underscore_audio_template() {\n\t$audio_types = wp_get_audio_extensions();\n\t?>\n<audio style=\"visibility: hidden\"\n\tcontrols\n\tclass=\"wp-audio-shortcode\"\n\twidth=\"{{ _.isUndefined( data.model.width ) ? 400 : data.model.width }}\"\n\tpreload=\"{{ _.isUndefined( data.model.preload ) ? 'none' : data.model.preload }}\"\n\t<#\n\t<?php\n\tforeach ( array( 'autoplay', 'loop' ) as $attr ) :\n\t\t?>\n\tif ( ! _.isUndefined( data.model.<?php echo $attr; ?> ) && data.model.<?php echo $attr; ?> ) {\n\t\t#> <?php echo $attr; ?><#\n\t}\n\t<?php endforeach ?>#>\n>\n\t<# if ( ! _.isEmpty( data.model.src ) ) { #>\n\t<source src=\"{{ data.model.src }}\" type=\"{{ wp.media.view.settings.embedMimes[ data.model.src.split('.').pop() ] }}\" />\n\t<# } #>\n\n\t<?php\n\tforeach ( $audio_types as $type ) :\n\t\t?>\n\t<# if ( ! _.isEmpty( data.model.<?php echo $type; ?> ) ) { #>\n\t<source src=\"{{ data.model.<?php echo $type; ?> }}\" type=\"{{ wp.media.view.settings.embedMimes[ '<?php echo $type; ?>' ] }}\" />\n\t<# } #>\n\t\t<?php\n\tendforeach;\n\t?>\n</audio>\n\t<?php\n}\n\n/**\n * Output the markup for a video tag to be used in an Underscore template\n * when data.model is passed.\n *\n * @since 3.9.0\n */\nfunction wp_underscore_video_template() {\n\t$video_types = wp_get_video_extensions();\n\t?>\n<#  var w_rule = '', classes = [],\n\t\tw, h, settings = wp.media.view.settings,\n\t\tisYouTube = isVimeo = false;\n\n\tif ( ! _.isEmpty( data.model.src ) ) {\n\t\tisYouTube = data.model.src.match(/youtube|youtu\\.be/);\n\t\tisVimeo = -1 !== data.model.src.indexOf('vimeo');\n\t}\n\n\tif ( settings.contentWidth && data.model.width >= settings.contentWidth ) {\n\t\tw = settings.contentWidth;\n\t} else {\n\t\tw = data.model.width;\n\t}\n\n\tif ( w !== data.model.width ) {\n\t\th = Math.ceil( ( data.model.height * w ) / data.model.width );\n\t} else {\n\t\th = data.model.height;\n\t}\n\n\tif ( w ) {\n\t\tw_rule = 'width: ' + w + 'px; ';\n\t}\n\n\tif ( isYouTube ) {\n\t\tclasses.push( 'youtube-video' );\n\t}\n\n\tif ( isVimeo ) {\n\t\tclasses.push( 'vimeo-video' );\n\t}\n\n#>\n<div style=\"{{ w_rule }}\" class=\"wp-video\">\n<video controls\n\tclass=\"wp-video-shortcode {{ classes.join( ' ' ) }}\"\n\t<# if ( w ) { #>width=\"{{ w }}\"<# } #>\n\t<# if ( h ) { #>height=\"{{ h }}\"<# } #>\n\t<?php\n\t$props = array(\n\t\t'poster'  => '',\n\t\t'preload' => 'metadata',\n\t);\n\tforeach ( $props as $key => $value ) :\n\t\tif ( empty( $value ) ) {\n\t\t\t?>\n\t\t<#\n\t\tif ( ! _.isUndefined( data.model.<?php echo $key; ?> ) && data.model.<?php echo $key; ?> ) {\n\t\t\t#> <?php echo $key; ?>=\"{{ data.model.<?php echo $key; ?> }}\"<#\n\t\t} #>\n\t\t\t<?php\n\t\t} else {\n\t\t\techo $key\n\t\t\t?>\n\t\t\t=\"{{ _.isUndefined( data.model.<?php echo $key; ?> ) ? '<?php echo $value; ?>' : data.model.<?php echo $key; ?> }}\"\n\t\t\t<?php\n\t\t}\n\tendforeach;\n\t?>\n\t<#\n\t<?php\n\tforeach ( array( 'autoplay', 'loop' ) as $attr ) :\n\t\t?>\n\tif ( ! _.isUndefined( data.model.<?php echo $attr; ?> ) && data.model.<?php echo $attr; ?> ) {\n\t\t#> <?php echo $attr; ?><#\n\t}\n\t<?php endforeach ?>#>\n>\n\t<# if ( ! _.isEmpty( data.model.src ) ) {\n\t\tif ( isYouTube ) { #>\n\t\t<source src=\"{{ data.model.src }}\" type=\"video/youtube\" />\n\t\t<# } else if ( isVimeo ) { #>\n\t\t<source src=\"{{ data.model.src }}\" type=\"video/vimeo\" />\n\t\t<# } else { #>\n\t\t<source src=\"{{ data.model.src }}\" type=\"{{ settings.embedMimes[ data.model.src.split('.').pop() ] }}\" />\n\t\t<# }\n\t} #>\n\n\t<?php\n\tforeach ( $video_types as $type ) :\n\t\t?>\n\t<# if ( data.model.<?php echo $type; ?> ) { #>\n\t<source src=\"{{ data.model.<?php echo $type; ?> }}\" type=\"{{ settings.embedMimes[ '<?php echo $type; ?>' ] }}\" />\n\t<# } #>\n\t<?php endforeach; ?>\n\t{{{ data.model.content }}}\n</video>\n</div>\n\t<?php\n}\n\n/**\n * Prints the templates used in the media manager.\n *\n * @since 3.5.0\n */\nfunction wp_print_media_templates() {\n\t$class = 'media-modal wp-core-ui';\n\n\t$alt_text_description = sprintf(\n\t\t/* translators: 1: Link to tutorial, 2: Additional link attributes, 3: Accessibility text. */\n\t\t__( '<a href=\"%1$s\" %2$s>Describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),\n\t\tesc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ),\n\t\t'target=\"_blank\" rel=\"noopener noreferrer\"',\n\t\tsprintf(\n\t\t\t'<span class=\"screen-reader-text\"> %s</span>',\n\t\t\t/* translators: Accessibility text. */\n\t\t\t__( '(opens in a new tab)' )\n\t\t)\n\t);\n\t?>\n\n\t<?php // Template for the media frame: used both in the media grid and in the media modal. ?>\n\t<script type=\"text/html\" id=\"tmpl-media-frame\">\n\t\t<div class=\"media-frame-title\" id=\"media-frame-title\"></div>\n\t\t<h2 class=\"media-frame-menu-heading\"><?php _ex( 'Actions', 'media modal menu actions' ); ?></h2>\n\t\t<button type=\"button\" class=\"button button-link media-frame-menu-toggle\" aria-expanded=\"false\">\n\t\t\t<?php _ex( 'Menu', 'media modal menu' ); ?>\n\t\t\t<span class=\"dashicons dashicons-arrow-down\" aria-hidden=\"true\"></span>\n\t\t</button>\n\t\t<div class=\"media-frame-menu\"></div>\n\t\t<div class=\"media-frame-tab-panel\">\n\t\t\t<div class=\"media-frame-router\"></div>\n\t\t\t<div class=\"media-frame-content\"></div>\n\t\t</div>\n\t\t<h2 class=\"media-frame-actions-heading screen-reader-text\">\n\t\t<?php\n\t\t\t/* translators: Accessibility text. */\n\t\t\t_e( 'Selected media actions' );\n\t\t?>\n\t\t</h2>\n\t\t<div class=\"media-frame-toolbar\"></div>\n\t\t<div class=\"media-frame-uploader\"></div>\n\t</script>\n\n\t<?php // Template for the media modal. ?>\n\t<script type=\"text/html\" id=\"tmpl-media-modal\">\n\t\t<div tabindex=\"0\" class=\"<?php echo $class; ?>\" role=\"dialog\" aria-labelledby=\"media-frame-title\">\n\t\t\t<# if ( data.hasCloseButton ) { #>\n\t\t\t\t<button type=\"button\" class=\"media-modal-close\"><span class=\"media-modal-icon\"><span class=\"screen-reader-text\"><?php _e( 'Close dialog' ); ?></span></span></button>\n\t\t\t<# } #>\n\t\t\t<div class=\"media-modal-content\" role=\"document\"></div>\n\t\t</div>\n\t\t<div class=\"media-modal-backdrop\"></div>\n\t</script>\n\n\t<?php // Template for the window uploader, used for example in the media grid. ?>\n\t<script type=\"text/html\" id=\"tmpl-uploader-window\">\n\t\t<div class=\"uploader-window-content\">\n\t\t\t<div class=\"uploader-editor-title\"><?php _e( 'Drop files to upload' ); ?></div>\n\t\t</div>\n\t</script>\n\n\t<?php // Template for the editor uploader. ?>\n\t<script type=\"text/html\" id=\"tmpl-uploader-editor\">\n\t\t<div class=\"uploader-editor-content\">\n\t\t\t<div class=\"uploader-editor-title\"><?php _e( 'Drop files to upload' ); ?></div>\n\t\t</div>\n\t</script>\n\n\t<?php // Template for the inline uploader, used for example in the Media Library admin page - Add New. ?>\n\t<script type=\"text/html\" id=\"tmpl-uploader-inline\">\n\t\t<# var messageClass = data.message ? 'has-upload-message' : 'no-upload-message'; #>\n\t\t<# if ( data.canClose ) { #>\n\t\t<button class=\"close dashicons dashicons-no\"><span class=\"screen-reader-text\"><?php _e( 'Close uploader' ); ?></span></button>\n\t\t<# } #>\n\t\t<div class=\"uploader-inline-content {{ messageClass }}\">\n\t\t<# if ( data.message ) { #>\n\t\t\t<h2 class=\"upload-message\">{{ data.message }}</h2>\n\t\t<# } #>\n\t\t<?php if ( ! _device_can_upload() ) : ?>\n\t\t\t<div class=\"upload-ui\">\n\t\t\t\t<h2 class=\"upload-instructions\"><?php _e( 'Your browser cannot upload files' ); ?></h2>\n\t\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: https://apps.wordpress.org/ */\n\t\t\t\t\t\t__( 'The web browser on your device cannot be used to upload files. You may be able to use the <a href=\"%s\">native app for your device</a> instead.' ),\n\t\t\t\t\t\t'https://apps.wordpress.org/'\n\t\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t<?php elseif ( is_multisite() && ! is_upload_space_available() ) : ?>\n\t\t\t<div class=\"upload-ui\">\n\t\t\t\t<h2 class=\"upload-instructions\"><?php _e( 'Upload Limit Exceeded' ); ?></h2>\n\t\t\t\t<?php\n\t\t\t\t/** This action is documented in wp-admin/includes/media.php */\n\t\t\t\tdo_action( 'upload_ui_over_quota' );\n\t\t\t\t?>\n\t\t\t</div>\n\t\t<?php else : ?>\n\t\t\t<div class=\"upload-ui\">\n\t\t\t\t<h2 class=\"upload-instructions drop-instructions\"><?php _e( 'Drop files to upload' ); ?></h2>\n\t\t\t\t<p class=\"upload-instructions drop-instructions\"><?php _ex( 'or', 'Uploader: Drop files here - or - Select Files' ); ?></p>\n\t\t\t\t<button type=\"button\" class=\"browser button button-hero\"><?php _e( 'Select Files' ); ?></button>\n\t\t\t</div>\n\n\t\t\t<div class=\"upload-inline-status\"></div>\n\n\t\t\t<div class=\"post-upload-ui\">\n\t\t\t\t<?php\n\t\t\t\t/** This action is documented in wp-admin/includes/media.php */\n\t\t\t\tdo_action( 'pre-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t\t\t\t/** This action is documented in wp-admin/includes/media.php */\n\t\t\t\tdo_action( 'pre-plupload-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\n\t\t\t\tif ( 10 === remove_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' ) ) {\n\t\t\t\t\t/** This action is documented in wp-admin/includes/media.php */\n\t\t\t\t\tdo_action( 'post-plupload-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t\t\t\t\tadd_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' );\n\t\t\t\t} else {\n\t\t\t\t\t/** This action is documented in wp-admin/includes/media.php */\n\t\t\t\t\tdo_action( 'post-plupload-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t\t\t\t}\n\n\t\t\t\t$max_upload_size = wp_max_upload_size();\n\t\t\t\tif ( ! $max_upload_size ) {\n\t\t\t\t\t$max_upload_size = 0;\n\t\t\t\t}\n\t\t\t\t?>\n\n\t\t\t\t<p class=\"max-upload-size\">\n\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Maximum allowed file size. */\n\t\t\t\t\t\t__( 'Maximum upload file size: %s.' ),\n\t\t\t\t\t\tesc_html( size_format( $max_upload_size ) )\n\t\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t</p>\n\n\t\t\t\t<# if ( data.suggestedWidth && data.suggestedHeight ) { #>\n\t\t\t\t\t<p class=\"suggested-dimensions\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/* translators: 1: Suggested width number, 2: Suggested height number. */\n\t\t\t\t\t\t\tprintf( __( 'Suggested image dimensions: %1$s by %2$s pixels.' ), '{{data.suggestedWidth}}', '{{data.suggestedHeight}}' );\n\t\t\t\t\t\t?>\n\t\t\t\t\t</p>\n\t\t\t\t<# } #>\n\n\t\t\t\t<?php\n\t\t\t\t/** This action is documented in wp-admin/includes/media.php */\n\t\t\t\tdo_action( 'post-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t\t\t\t?>\n\t\t\t</div>\n\t\t<?php endif; ?>\n\t\t</div>\n\t</script>\n\n\t<?php // Template for the view switchers, used for example in the Media Grid. ?>\n\t<script type=\"text/html\" id=\"tmpl-media-library-view-switcher\">\n\t\t<a href=\"<?php echo esc_url( add_query_arg( 'mode', 'list', $_SERVER['REQUEST_URI'] ) ); ?>\" class=\"view-list\">\n\t\t\t<span class=\"screen-reader-text\"><?php _e( 'List view' ); ?></span>\n\t\t</a>\n\t\t<a href=\"<?php echo esc_url( add_query_arg( 'mode', 'grid', $_SERVER['REQUEST_URI'] ) ); ?>\" class=\"view-grid current\" aria-current=\"page\">\n\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Grid view' ); ?></span>\n\t\t</a>\n\t</script>\n\n\t<?php // Template for the uploading status UI. ?>\n\t<script type=\"text/html\" id=\"tmpl-uploader-status\">\n\t\t<h2><?php _e( 'Uploading' ); ?></h2>\n\t\t<button type=\"button\" class=\"button-link upload-dismiss-errors\"><span class=\"screen-reader-text\"><?php _e( 'Dismiss Errors' ); ?></span></button>\n\n\t\t<div class=\"media-progress-bar\"><div></div></div>\n\t\t<div class=\"upload-details\">\n\t\t\t<span class=\"upload-count\">\n\t\t\t\t<span class=\"upload-index\"></span> / <span class=\"upload-total\"></span>\n\t\t\t</span>\n\t\t\t<span class=\"upload-detail-separator\">&ndash;</span>\n\t\t\t<span class=\"upload-filename\"></span>\n\t\t</div>\n\t\t<div class=\"upload-errors\"></div>\n\t</script>\n\n\t<?php // Template for the uploading status errors. ?>\n\t<script type=\"text/html\" id=\"tmpl-uploader-status-error\">\n\t\t<span class=\"upload-error-filename\">{{{ data.filename }}}</span>\n\t\t<span class=\"upload-error-message\">{{ data.message }}</span>\n\t</script>\n\n\t<?php // Template for the Attachment Details layout in the media browser. ?>\n\t<script type=\"text/html\" id=\"tmpl-edit-attachment-frame\">\n\t\t<div class=\"edit-media-header\">\n\t\t\t<button class=\"left dashicons\"<# if ( ! data.hasPrevious ) { #> disabled<# } #>><span class=\"screen-reader-text\"><?php _e( 'Edit previous media item' ); ?></span></button>\n\t\t\t<button class=\"right dashicons\"<# if ( ! data.hasNext ) { #> disabled<# } #>><span class=\"screen-reader-text\"><?php _e( 'Edit next media item' ); ?></span></button>\n\t\t\t<button type=\"button\" class=\"media-modal-close\"><span class=\"media-modal-icon\"><span class=\"screen-reader-text\"><?php _e( 'Close dialog' ); ?></span></span></button>\n\t\t</div>\n\t\t<div class=\"media-frame-title\"></div>\n\t\t<div class=\"media-frame-content\"></div>\n\t</script>\n\n\t<?php // Template for the Attachment Details two columns layout. ?>\n\t<script type=\"text/html\" id=\"tmpl-attachment-details-two-column\">\n\t\t<div class=\"attachment-media-view {{ data.orientation }}\">\n\t\t\t<h2 class=\"screen-reader-text\"><?php _e( 'Attachment Preview' ); ?></h2>\n\t\t\t<div class=\"thumbnail thumbnail-{{ data.type }}\">\n\t\t\t\t<# if ( data.uploading ) { #>\n\t\t\t\t\t<div class=\"media-progress-bar\"><div></div></div>\n\t\t\t\t<# } else if ( data.sizes && data.sizes.large ) { #>\n\t\t\t\t\t<img class=\"details-image\" src=\"{{ data.sizes.large.url }}\" draggable=\"false\" alt=\"\" />\n\t\t\t\t<# } else if ( data.sizes && data.sizes.full ) { #>\n\t\t\t\t\t<img class=\"details-image\" src=\"{{ data.sizes.full.url }}\" draggable=\"false\" alt=\"\" />\n\t\t\t\t<# } else if ( -1 === jQuery.inArray( data.type, [ 'audio', 'video' ] ) ) { #>\n\t\t\t\t\t<img class=\"details-image icon\" src=\"{{ data.icon }}\" draggable=\"false\" alt=\"\" />\n\t\t\t\t<# } #>\n\n\t\t\t\t<# if ( 'audio' === data.type ) { #>\n\t\t\t\t<div class=\"wp-media-wrapper\">\n\t\t\t\t\t<audio style=\"visibility: hidden\" controls class=\"wp-audio-shortcode\" width=\"100%\" preload=\"none\">\n\t\t\t\t\t\t<source type=\"{{ data.mime }}\" src=\"{{ data.url }}\"/>\n\t\t\t\t\t</audio>\n\t\t\t\t</div>\n\t\t\t\t<# } else if ( 'video' === data.type ) {\n\t\t\t\t\tvar w_rule = '';\n\t\t\t\t\tif ( data.width ) {\n\t\t\t\t\t\tw_rule = 'width: ' + data.width + 'px;';\n\t\t\t\t\t} else if ( wp.media.view.settings.contentWidth ) {\n\t\t\t\t\t\tw_rule = 'width: ' + wp.media.view.settings.contentWidth + 'px;';\n\t\t\t\t\t}\n\t\t\t\t#>\n\t\t\t\t<div style=\"{{ w_rule }}\" class=\"wp-media-wrapper wp-video\">\n\t\t\t\t\t<video controls=\"controls\" class=\"wp-video-shortcode\" preload=\"metadata\"\n\t\t\t\t\t\t<# if ( data.width ) { #>width=\"{{ data.width }}\"<# } #>\n\t\t\t\t\t\t<# if ( data.height ) { #>height=\"{{ data.height }}\"<# } #>\n\t\t\t\t\t\t<# if ( data.image && data.image.src !== data.icon ) { #>poster=\"{{ data.image.src }}\"<# } #>>\n\t\t\t\t\t\t<source type=\"{{ data.mime }}\" src=\"{{ data.url }}\"/>\n\t\t\t\t\t</video>\n\t\t\t\t</div>\n\t\t\t\t<# } #>\n\n\t\t\t\t<div class=\"attachment-actions\">\n\t\t\t\t\t<# if ( 'image' === data.type && ! data.uploading && data.sizes && data.can.save ) { #>\n\t\t\t\t\t<button type=\"button\" class=\"button edit-attachment\"><?php _e( 'Edit Image' ); ?></button>\n\t\t\t\t\t<# } else if ( 'pdf' === data.subtype && data.sizes ) { #>\n\t\t\t\t\t<p><?php _e( 'Document Preview' ); ?></p>\n\t\t\t\t\t<# } #>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"attachment-info\">\n\t\t\t<span class=\"settings-save-status\" role=\"status\">\n\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t\t<span class=\"saved\"><?php esc_html_e( 'Saved.' ); ?></span>\n\t\t\t</span>\n\t\t\t<div class=\"details\">\n\t\t\t\t<h2 class=\"screen-reader-text\"><?php _e( 'Details' ); ?></h2>\n\t\t\t\t<div class=\"filename\"><strong><?php _e( 'File name:' ); ?></strong> {{ data.filename }}</div>\n\t\t\t\t<div class=\"filename\"><strong><?php _e( 'File type:' ); ?></strong> {{ data.mime }}</div>\n\t\t\t\t<div class=\"uploaded\"><strong><?php _e( 'Uploaded on:' ); ?></strong> {{ data.dateFormatted }}</div>\n\n\t\t\t\t<div class=\"file-size\"><strong><?php _e( 'File size:' ); ?></strong> {{ data.filesizeHumanReadable }}</div>\n\t\t\t\t<# if ( 'image' === data.type && ! data.uploading ) { #>\n\t\t\t\t\t<# if ( data.width && data.height ) { #>\n\t\t\t\t\t\t<div class=\"dimensions\"><strong><?php _e( 'Dimensions:' ); ?></strong>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/* translators: 1: A number of pixels wide, 2: A number of pixels tall. */\n\t\t\t\t\t\t\tprintf( __( '%1$s by %2$s pixels' ), '{{ data.width }}', '{{ data.height }}' );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<# } #>\n\n\t\t\t\t\t<# if ( data.originalImageURL && data.originalImageName ) { #>\n\t\t\t\t\t\t<?php _e( 'Original image:' ); ?>\n\t\t\t\t\t\t<a href=\"{{ data.originalImageURL }}\">{{data.originalImageName}}</a>\n\t\t\t\t\t<# } #>\n\t\t\t\t<# } #>\n\n\t\t\t\t<# if ( data.fileLength && data.fileLengthHumanReadable ) { #>\n\t\t\t\t\t<div class=\"file-length\"><strong><?php _e( 'Length:' ); ?></strong>\n\t\t\t\t\t\t<span aria-hidden=\"true\">{{ data.fileLength }}</span>\n\t\t\t\t\t\t<span class=\"screen-reader-text\">{{ data.fileLengthHumanReadable }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t<# } #>\n\n\t\t\t\t<# if ( 'audio' === data.type && data.meta.bitrate ) { #>\n\t\t\t\t\t<div class=\"bitrate\">\n\t\t\t\t\t\t<strong><?php _e( 'Bitrate:' ); ?></strong> {{ Math.round( data.meta.bitrate / 1000 ) }}kb/s\n\t\t\t\t\t\t<# if ( data.meta.bitrate_mode ) { #>\n\t\t\t\t\t\t{{ ' ' + data.meta.bitrate_mode.toUpperCase() }}\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t</div>\n\t\t\t\t<# } #>\n\n\t\t\t\t<div class=\"compat-meta\">\n\t\t\t\t\t<# if ( data.compat && data.compat.meta ) { #>\n\t\t\t\t\t\t{{{ data.compat.meta }}}\n\t\t\t\t\t<# } #>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class=\"settings\">\n\t\t\t\t<# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #>\n\t\t\t\t<# if ( 'image' === data.type ) { #>\n\t\t\t\t\t<span class=\"setting has-description\" data-setting=\"alt\">\n\t\t\t\t\t\t<label for=\"attachment-details-two-column-alt-text\" class=\"name\"><?php _e( 'Alternative Text' ); ?></label>\n\t\t\t\t\t\t<input type=\"text\" id=\"attachment-details-two-column-alt-text\" value=\"{{ data.alt }}\" aria-describedby=\"alt-text-description\" {{ maybeReadOnly }} />\n\t\t\t\t\t</span>\n\t\t\t\t\t<p class=\"description\" id=\"alt-text-description\"><?php echo $alt_text_description; ?></p>\n\t\t\t\t<# } #>\n\t\t\t\t<?php if ( post_type_supports( 'attachment', 'title' ) ) : ?>\n\t\t\t\t<span class=\"setting\" data-setting=\"title\">\n\t\t\t\t\t<label for=\"attachment-details-two-column-title\" class=\"name\"><?php _e( 'Title' ); ?></label>\n\t\t\t\t\t<input type=\"text\" id=\"attachment-details-two-column-title\" value=\"{{ data.title }}\" {{ maybeReadOnly }} />\n\t\t\t\t</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<# if ( 'audio' === data.type ) { #>\n\t\t\t\t<?php\n\t\t\t\tforeach ( array(\n\t\t\t\t\t'artist' => __( 'Artist' ),\n\t\t\t\t\t'album'  => __( 'Album' ),\n\t\t\t\t) as $key => $label ) :\n\t\t\t\t\t?>\n\t\t\t\t<span class=\"setting\" data-setting=\"<?php echo esc_attr( $key ); ?>\">\n\t\t\t\t\t<label for=\"attachment-details-two-column-<?php echo esc_attr( $key ); ?>\" class=\"name\"><?php echo $label; ?></label>\n\t\t\t\t\t<input type=\"text\" id=\"attachment-details-two-column-<?php echo esc_attr( $key ); ?>\" value=\"{{ data.<?php echo $key; ?> || data.meta.<?php echo $key; ?> || '' }}\" />\n\t\t\t\t</span>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t\t<# } #>\n\t\t\t\t<span class=\"setting\" data-setting=\"caption\">\n\t\t\t\t\t<label for=\"attachment-details-two-column-caption\" class=\"name\"><?php _e( 'Caption' ); ?></label>\n\t\t\t\t\t<textarea id=\"attachment-details-two-column-caption\" {{ maybeReadOnly }}>{{ data.caption }}</textarea>\n\t\t\t\t</span>\n\t\t\t\t<span class=\"setting\" data-setting=\"description\">\n\t\t\t\t\t<label for=\"attachment-details-two-column-description\" class=\"name\"><?php _e( 'Description' ); ?></label>\n\t\t\t\t\t<textarea id=\"attachment-details-two-column-description\" {{ maybeReadOnly }}>{{ data.description }}</textarea>\n\t\t\t\t</span>\n\t\t\t\t<span class=\"setting\">\n\t\t\t\t\t<span class=\"name\"><?php _e( 'Uploaded By' ); ?></span>\n\t\t\t\t\t<span class=\"value\">{{ data.authorName }}</span>\n\t\t\t\t</span>\n\t\t\t\t<# if ( data.uploadedToTitle ) { #>\n\t\t\t\t\t<span class=\"setting\">\n\t\t\t\t\t\t<span class=\"name\"><?php _e( 'Uploaded To' ); ?></span>\n\t\t\t\t\t\t<# if ( data.uploadedToLink ) { #>\n\t\t\t\t\t\t\t<span class=\"value\"><a href=\"{{ data.uploadedToLink }}\">{{ data.uploadedToTitle }}</a></span>\n\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t<span class=\"value\">{{ data.uploadedToTitle }}</span>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t</span>\n\t\t\t\t<# } #>\n\t\t\t\t<span class=\"setting\" data-setting=\"url\">\n\t\t\t\t\t<label for=\"attachment-details-two-column-copy-link\" class=\"name\"><?php _e( 'File URL:' ); ?></label>\n\t\t\t\t\t<input type=\"text\" class=\"attachment-details-copy-link\" id=\"attachment-details-two-column-copy-link\" value=\"{{ data.url }}\" readonly />\n\t\t\t\t\t<span class=\"copy-to-clipboard-container\">\n\t\t\t\t\t\t<button type=\"button\" class=\"button button-small copy-attachment-url\" data-clipboard-target=\"#attachment-details-two-column-copy-link\"><?php _e( 'Copy URL' ); ?></button>\n\t\t\t\t\t\t<span class=\"success hidden\" aria-hidden=\"true\"><?php _e( 'Copied!' ); ?></span>\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t\t<div class=\"attachment-compat\"></div>\n\t\t\t</div>\n\n\t\t\t<div class=\"actions\">\n\t\t\t\t<a class=\"view-attachment\" href=\"{{ data.link }}\"><?php _e( 'View attachment page' ); ?></a>\n\t\t\t\t<# if ( data.can.save ) { #> |\n\t\t\t\t\t<a href=\"{{ data.editLink }}\"><?php _e( 'Edit more details' ); ?></a>\n\t\t\t\t<# } #>\n\t\t\t\t<# if ( ! data.uploading && data.can.remove ) { #> |\n\t\t\t\t\t<?php if ( MEDIA_TRASH ) : ?>\n\t\t\t\t\t\t<# if ( 'trash' === data.status ) { #>\n\t\t\t\t\t\t\t<button type=\"button\" class=\"button-link untrash-attachment\"><?php _e( 'Restore from Trash' ); ?></button>\n\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t<button type=\"button\" class=\"button-link trash-attachment\"><?php _e( 'Move to Trash' ); ?></button>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t<button type=\"button\" class=\"button-link delete-attachment\"><?php _e( 'Delete permanently' ); ?></button>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t<# } #>\n\t\t\t</div>\n\t\t</div>\n\t</script>\n\n\t<?php // Template for the Attachment \"thumbnails\" in the Media Grid. ?>\n\t<script type=\"text/html\" id=\"tmpl-attachment\">\n\t\t<div class=\"attachment-preview js--select-attachment type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}\">\n\t\t\t<div class=\"thumbnail\">\n\t\t\t\t<# if ( data.uploading ) { #>\n\t\t\t\t\t<div class=\"media-progress-bar\"><div style=\"width: {{ data.percent }}%\"></div></div>\n\t\t\t\t<# } else if ( 'image' === data.type && data.sizes ) { #>\n\t\t\t\t\t<div class=\"centered\">\n\t\t\t\t\t\t<img src=\"{{ data.size.url }}\" draggable=\"false\" alt=\"\" />\n\t\t\t\t\t</div>\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<div class=\"centered\">\n\t\t\t\t\t\t<# if ( data.image && data.image.src && data.image.src !== data.icon ) { #>\n\t\t\t\t\t\t\t<img src=\"{{ data.image.src }}\" class=\"thumbnail\" draggable=\"false\" alt=\"\" />\n\t\t\t\t\t\t<# } else if ( data.sizes && data.sizes.medium ) { #>\n\t\t\t\t\t\t\t<img src=\"{{ data.sizes.medium.url }}\" class=\"thumbnail\" draggable=\"false\" alt=\"\" />\n\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t<img src=\"{{ data.icon }}\" class=\"icon\" draggable=\"false\" alt=\"\" />\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"filename\">\n\t\t\t\t\t\t<div>{{ data.filename }}</div>\n\t\t\t\t\t</div>\n\t\t\t\t<# } #>\n\t\t\t</div>\n\t\t\t<# if ( data.buttons.close ) { #>\n\t\t\t\t<button type=\"button\" class=\"button-link attachment-close media-modal-icon\"><span class=\"screen-reader-text\"><?php _e( 'Remove' ); ?></span></button>\n\t\t\t<# } #>\n\t\t</div>\n\t\t<# if ( data.buttons.check ) { #>\n\t\t\t<button type=\"button\" class=\"check\" tabindex=\"-1\"><span class=\"media-modal-icon\"></span><span class=\"screen-reader-text\"><?php _e( 'Deselect' ); ?></span></button>\n\t\t<# } #>\n\t\t<#\n\t\tvar maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly';\n\t\tif ( data.describe ) {\n\t\t\tif ( 'image' === data.type ) { #>\n\t\t\t\t<input type=\"text\" value=\"{{ data.caption }}\" class=\"describe\" data-setting=\"caption\"\n\t\t\t\t\taria-label=\"<?php esc_attr_e( 'Caption' ); ?>\"\n\t\t\t\t\tplaceholder=\"<?php esc_attr_e( 'Caption&hellip;' ); ?>\" {{ maybeReadOnly }} />\n\t\t\t<# } else { #>\n\t\t\t\t<input type=\"text\" value=\"{{ data.title }}\" class=\"describe\" data-setting=\"title\"\n\t\t\t\t\t<# if ( 'video' === data.type ) { #>\n\t\t\t\t\t\taria-label=\"<?php esc_attr_e( 'Video title' ); ?>\"\n\t\t\t\t\t\tplaceholder=\"<?php esc_attr_e( 'Video title&hellip;' ); ?>\"\n\t\t\t\t\t<# } else if ( 'audio' === data.type ) { #>\n\t\t\t\t\t\taria-label=\"<?php esc_attr_e( 'Audio title' ); ?>\"\n\t\t\t\t\t\tplaceholder=\"<?php esc_attr_e( 'Audio title&hellip;' ); ?>\"\n\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\taria-label=\"<?php esc_attr_e( 'Media title' ); ?>\"\n\t\t\t\t\t\tplaceholder=\"<?php esc_attr_e( 'Media title&hellip;' ); ?>\"\n\t\t\t\t\t<# } #> {{ maybeReadOnly }} />\n\t\t\t<# }\n\t\t} #>\n\t</script>\n\n\t<?php // Template for the Attachment details, used for example in the sidebar. ?>\n\t<script type=\"text/html\" id=\"tmpl-attachment-details\">\n\t\t<h2>\n\t\t\t<?php _e( 'Attachment Details' ); ?>\n\t\t\t<span class=\"settings-save-status\" role=\"status\">\n\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t\t<span class=\"saved\"><?php esc_html_e( 'Saved.' ); ?></span>\n\t\t\t</span>\n\t\t</h2>\n\t\t<div class=\"attachment-info\">\n\t\t\t<div class=\"thumbnail thumbnail-{{ data.type }}\">\n\t\t\t\t<# if ( data.uploading ) { #>\n\t\t\t\t\t<div class=\"media-progress-bar\"><div></div></div>\n\t\t\t\t<# } else if ( 'image' === data.type && data.sizes ) { #>\n\t\t\t\t\t<img src=\"{{ data.size.url }}\" draggable=\"false\" alt=\"\" />\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<img src=\"{{ data.icon }}\" class=\"icon\" draggable=\"false\" alt=\"\" />\n\t\t\t\t<# } #>\n\t\t\t</div>\n\t\t\t<div class=\"details\">\n\t\t\t\t<div class=\"filename\">{{ data.filename }}</div>\n\t\t\t\t<div class=\"uploaded\">{{ data.dateFormatted }}</div>\n\n\t\t\t\t<div class=\"file-size\">{{ data.filesizeHumanReadable }}</div>\n\t\t\t\t<# if ( 'image' === data.type && ! data.uploading ) { #>\n\t\t\t\t\t<# if ( data.width && data.height ) { #>\n\t\t\t\t\t\t<div class=\"dimensions\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/* translators: 1: A number of pixels wide, 2: A number of pixels tall. */\n\t\t\t\t\t\t\tprintf( __( '%1$s by %2$s pixels' ), '{{ data.width }}', '{{ data.height }}' );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<# } #>\n\n\t\t\t\t\t<# if ( data.originalImageURL && data.originalImageName ) { #>\n\t\t\t\t\t\t<?php _e( 'Original image:' ); ?>\n\t\t\t\t\t\t<a href=\"{{ data.originalImageURL }}\">{{data.originalImageName}}</a>\n\t\t\t\t\t<# } #>\n\n\t\t\t\t\t<# if ( data.can.save && data.sizes ) { #>\n\t\t\t\t\t\t<a class=\"edit-attachment\" href=\"{{ data.editLink }}&amp;image-editor\" target=\"_blank\"><?php _e( 'Edit Image' ); ?></a>\n\t\t\t\t\t<# } #>\n\t\t\t\t<# } #>\n\n\t\t\t\t<# if ( data.fileLength && data.fileLengthHumanReadable ) { #>\n\t\t\t\t\t<div class=\"file-length\"><?php _e( 'Length:' ); ?>\n\t\t\t\t\t\t<span aria-hidden=\"true\">{{ data.fileLength }}</span>\n\t\t\t\t\t\t<span class=\"screen-reader-text\">{{ data.fileLengthHumanReadable }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t<# } #>\n\n\t\t\t\t<# if ( ! data.uploading && data.can.remove ) { #>\n\t\t\t\t\t<?php if ( MEDIA_TRASH ) : ?>\n\t\t\t\t\t<# if ( 'trash' === data.status ) { #>\n\t\t\t\t\t\t<button type=\"button\" class=\"button-link untrash-attachment\"><?php _e( 'Restore from Trash' ); ?></button>\n\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t<button type=\"button\" class=\"button-link trash-attachment\"><?php _e( 'Move to Trash' ); ?></button>\n\t\t\t\t\t<# } #>\n\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t<button type=\"button\" class=\"button-link delete-attachment\"><?php _e( 'Delete permanently' ); ?></button>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t<# } #>\n\n\t\t\t\t<div class=\"compat-meta\">\n\t\t\t\t\t<# if ( data.compat && data.compat.meta ) { #>\n\t\t\t\t\t\t{{{ data.compat.meta }}}\n\t\t\t\t\t<# } #>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #>\n\t\t<# if ( 'image' === data.type ) { #>\n\t\t\t<span class=\"setting has-description\" data-setting=\"alt\">\n\t\t\t\t<label for=\"attachment-details-alt-text\" class=\"name\"><?php _e( 'Alt Text' ); ?></label>\n\t\t\t\t<input type=\"text\" id=\"attachment-details-alt-text\" value=\"{{ data.alt }}\" aria-describedby=\"alt-text-description\" {{ maybeReadOnly }} />\n\t\t\t</span>\n\t\t\t<p class=\"description\" id=\"alt-text-description\"><?php echo $alt_text_description; ?></p>\n\t\t<# } #>\n\t\t<?php if ( post_type_supports( 'attachment', 'title' ) ) : ?>\n\t\t<span class=\"setting\" data-setting=\"title\">\n\t\t\t<label for=\"attachment-details-title\" class=\"name\"><?php _e( 'Title' ); ?></label>\n\t\t\t<input type=\"text\" id=\"attachment-details-title\" value=\"{{ data.title }}\" {{ maybeReadOnly }} />\n\t\t</span>\n\t\t<?php endif; ?>\n\t\t<# if ( 'audio' === data.type ) { #>\n\t\t<?php\n\t\tforeach ( array(\n\t\t\t'artist' => __( 'Artist' ),\n\t\t\t'album'  => __( 'Album' ),\n\t\t) as $key => $label ) :\n\t\t\t?>\n\t\t<span class=\"setting\" data-setting=\"<?php echo esc_attr( $key ); ?>\">\n\t\t\t<label for=\"attachment-details-<?php echo esc_attr( $key ); ?>\" class=\"name\"><?php echo $label; ?></label>\n\t\t\t<input type=\"text\" id=\"attachment-details-<?php echo esc_attr( $key ); ?>\" value=\"{{ data.<?php echo $key; ?> || data.meta.<?php echo $key; ?> || '' }}\" />\n\t\t</span>\n\t\t<?php endforeach; ?>\n\t\t<# } #>\n\t\t<span class=\"setting\" data-setting=\"caption\">\n\t\t\t<label for=\"attachment-details-caption\" class=\"name\"><?php _e( 'Caption' ); ?></label>\n\t\t\t<textarea id=\"attachment-details-caption\" {{ maybeReadOnly }}>{{ data.caption }}</textarea>\n\t\t</span>\n\t\t<span class=\"setting\" data-setting=\"description\">\n\t\t\t<label for=\"attachment-details-description\" class=\"name\"><?php _e( 'Description' ); ?></label>\n\t\t\t<textarea id=\"attachment-details-description\" {{ maybeReadOnly }}>{{ data.description }}</textarea>\n\t\t</span>\n\t\t<span class=\"setting\" data-setting=\"url\">\n\t\t\t<label for=\"attachment-details-copy-link\" class=\"name\"><?php _e( 'File URL:' ); ?></label>\n\t\t\t<input type=\"text\" class=\"attachment-details-copy-link\" id=\"attachment-details-copy-link\" value=\"{{ data.url }}\" readonly />\n\t\t\t<div class=\"copy-to-clipboard-container\">\n\t\t\t\t<button type=\"button\" class=\"button button-small copy-attachment-url\" data-clipboard-target=\"#attachment-details-copy-link\"><?php _e( 'Copy URL' ); ?></button>\n\t\t\t\t<span class=\"success hidden\" aria-hidden=\"true\"><?php _e( 'Copied!' ); ?></span>\n\t\t\t</div>\n\t\t</span>\n\t</script>\n\n\t<?php // Template for the Selection status bar. ?>\n\t<script type=\"text/html\" id=\"tmpl-media-selection\">\n\t\t<div class=\"selection-info\">\n\t\t\t<span class=\"count\"></span>\n\t\t\t<# if ( data.editable ) { #>\n\t\t\t\t<button type=\"button\" class=\"button-link edit-selection\"><?php _e( 'Edit Selection' ); ?></button>\n\t\t\t<# } #>\n\t\t\t<# if ( data.clearable ) { #>\n\t\t\t\t<button type=\"button\" class=\"button-link clear-selection\"><?php _e( 'Clear' ); ?></button>\n\t\t\t<# } #>\n\t\t</div>\n\t\t<div class=\"selection-view\"></div>\n\t</script>\n\n\t<?php // Template for the Attachment display settings, used for example in the sidebar. ?>\n\t<script type=\"text/html\" id=\"tmpl-attachment-display-settings\">\n\t\t<h2><?php _e( 'Attachment Display Settings' ); ?></h2>\n\n\t\t<# if ( 'image' === data.type ) { #>\n\t\t\t<span class=\"setting align\">\n\t\t\t\t<label for=\"attachment-display-settings-alignment\" class=\"name\"><?php _e( 'Alignment' ); ?></label>\n\t\t\t\t<select id=\"attachment-display-settings-alignment\" class=\"alignment\"\n\t\t\t\t\tdata-setting=\"align\"\n\t\t\t\t\t<# if ( data.userSettings ) { #>\n\t\t\t\t\t\tdata-user-setting=\"align\"\n\t\t\t\t\t<# } #>>\n\n\t\t\t\t\t<option value=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Left' ); ?>\n\t\t\t\t\t</option>\n\t\t\t\t\t<option value=\"center\">\n\t\t\t\t\t\t<?php esc_html_e( 'Center' ); ?>\n\t\t\t\t\t</option>\n\t\t\t\t\t<option value=\"right\">\n\t\t\t\t\t\t<?php esc_html_e( 'Right' ); ?>\n\t\t\t\t\t</option>\n\t\t\t\t\t<option value=\"none\" selected>\n\t\t\t\t\t\t<?php esc_html_e( 'None' ); ?>\n\t\t\t\t\t</option>\n\t\t\t\t</select>\n\t\t\t</span>\n\t\t<# } #>\n\n\t\t<span class=\"setting\">\n\t\t\t<label for=\"attachment-display-settings-link-to\" class=\"name\">\n\t\t\t\t<# if ( data.model.canEmbed ) { #>\n\t\t\t\t\t<?php _e( 'Embed or Link' ); ?>\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<?php _e( 'Link To' ); ?>\n\t\t\t\t<# } #>\n\t\t\t</label>\n\t\t\t<select id=\"attachment-display-settings-link-to\" class=\"link-to\"\n\t\t\t\tdata-setting=\"link\"\n\t\t\t\t<# if ( data.userSettings && ! data.model.canEmbed ) { #>\n\t\t\t\t\tdata-user-setting=\"urlbutton\"\n\t\t\t\t<# } #>>\n\n\t\t\t<# if ( data.model.canEmbed ) { #>\n\t\t\t\t<option value=\"embed\" selected>\n\t\t\t\t\t<?php esc_html_e( 'Embed Media Player' ); ?>\n\t\t\t\t</option>\n\t\t\t\t<option value=\"file\">\n\t\t\t<# } else { #>\n\t\t\t\t<option value=\"none\" selected>\n\t\t\t\t\t<?php esc_html_e( 'None' ); ?>\n\t\t\t\t</option>\n\t\t\t\t<option value=\"file\">\n\t\t\t<# } #>\n\t\t\t\t<# if ( data.model.canEmbed ) { #>\n\t\t\t\t\t<?php esc_html_e( 'Link to Media File' ); ?>\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<?php esc_html_e( 'Media File' ); ?>\n\t\t\t\t<# } #>\n\t\t\t\t</option>\n\t\t\t\t<option value=\"post\">\n\t\t\t\t<# if ( data.model.canEmbed ) { #>\n\t\t\t\t\t<?php esc_html_e( 'Link to Attachment Page' ); ?>\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<?php esc_html_e( 'Attachment Page' ); ?>\n\t\t\t\t<# } #>\n\t\t\t\t</option>\n\t\t\t<# if ( 'image' === data.type ) { #>\n\t\t\t\t<option value=\"custom\">\n\t\t\t\t\t<?php esc_html_e( 'Custom URL' ); ?>\n\t\t\t\t</option>\n\t\t\t<# } #>\n\t\t\t</select>\n\t\t</span>\n\t\t<span class=\"setting\">\n\t\t\t<label for=\"attachment-display-settings-link-to-custom\" class=\"name\"><?php _e( 'URL' ); ?></label>\n\t\t\t<input type=\"text\" id=\"attachment-display-settings-link-to-custom\" class=\"link-to-custom\" data-setting=\"linkUrl\" />\n\t\t</span>\n\n\t\t<# if ( 'undefined' !== typeof data.sizes ) { #>\n\t\t\t<span class=\"setting\">\n\t\t\t\t<label for=\"attachment-display-settings-size\" class=\"name\"><?php _e( 'Size' ); ?></label>\n\t\t\t\t<select id=\"attachment-display-settings-size\" class=\"size\" name=\"size\"\n\t\t\t\t\tdata-setting=\"size\"\n\t\t\t\t\t<# if ( data.userSettings ) { #>\n\t\t\t\t\t\tdata-user-setting=\"imgsize\"\n\t\t\t\t\t<# } #>>\n\t\t\t\t\t<?php\n\t\t\t\t\t/** This filter is documented in wp-admin/includes/media.php */\n\t\t\t\t\t$sizes = apply_filters(\n\t\t\t\t\t\t'image_size_names_choose',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'thumbnail' => __( 'Thumbnail' ),\n\t\t\t\t\t\t\t'medium'    => __( 'Medium' ),\n\t\t\t\t\t\t\t'large'     => __( 'Large' ),\n\t\t\t\t\t\t\t'full'      => __( 'Full Size' ),\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach ( $sizes as $value => $name ) :\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<#\n\t\t\t\t\t\tvar size = data.sizes['<?php echo esc_js( $value ); ?>'];\n\t\t\t\t\t\tif ( size ) { #>\n\t\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $value ); ?>\" <?php selected( $value, 'full' ); ?>>\n\t\t\t\t\t\t\t\t<?php echo esc_html( $name ); ?> &ndash; {{ size.width }} &times; {{ size.height }}\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t</select>\n\t\t\t</span>\n\t\t<# } #>\n\t</script>\n\n\t<?php // Template for the Gallery settings, used for example in the sidebar. ?>\n\t<script type=\"text/html\" id=\"tmpl-gallery-settings\">\n\t\t<h2><?php _e( 'Gallery Settings' ); ?></h2>\n\n\t\t<span class=\"setting\">\n\t\t\t<label for=\"gallery-settings-link-to\" class=\"name\"><?php _e( 'Link To' ); ?></label>\n\t\t\t<select id=\"gallery-settings-link-to\" class=\"link-to\"\n\t\t\t\tdata-setting=\"link\"\n\t\t\t\t<# if ( data.userSettings ) { #>\n\t\t\t\t\tdata-user-setting=\"urlbutton\"\n\t\t\t\t<# } #>>\n\n\t\t\t\t<option value=\"post\" <# if ( ! wp.media.galleryDefaults.link || 'post' === wp.media.galleryDefaults.link ) {\n\t\t\t\t\t#>selected=\"selected\"<# }\n\t\t\t\t#>>\n\t\t\t\t\t<?php esc_html_e( 'Attachment Page' ); ?>\n\t\t\t\t</option>\n\t\t\t\t<option value=\"file\" <# if ( 'file' === wp.media.galleryDefaults.link ) { #>selected=\"selected\"<# } #>>\n\t\t\t\t\t<?php esc_html_e( 'Media File' ); ?>\n\t\t\t\t</option>\n\t\t\t\t<option value=\"none\" <# if ( 'none' === wp.media.galleryDefaults.link ) { #>selected=\"selected\"<# } #>>\n\t\t\t\t\t<?php esc_html_e( 'None' ); ?>\n\t\t\t\t</option>\n\t\t\t</select>\n\t\t</span>\n\n\t\t<span class=\"setting\">\n\t\t\t<label for=\"gallery-settings-columns\" class=\"name select-label-inline\"><?php _e( 'Columns' ); ?></label>\n\t\t\t<select id=\"gallery-settings-columns\" class=\"columns\" name=\"columns\"\n\t\t\t\tdata-setting=\"columns\">\n\t\t\t\t<?php for ( $i = 1; $i <= 9; $i++ ) : ?>\n\t\t\t\t\t<option value=\"<?php echo esc_attr( $i ); ?>\" <#\n\t\t\t\t\t\tif ( <?php echo $i; ?> == wp.media.galleryDefaults.columns ) { #>selected=\"selected\"<# }\n\t\t\t\t\t#>>\n\t\t\t\t\t\t<?php echo esc_html( $i ); ?>\n\t\t\t\t\t</option>\n\t\t\t\t<?php endfor; ?>\n\t\t\t</select>\n\t\t</span>\n\n\t\t<span class=\"setting\">\n\t\t\t<input type=\"checkbox\" id=\"gallery-settings-random-order\" data-setting=\"_orderbyRandom\" />\n\t\t\t<label for=\"gallery-settings-random-order\" class=\"checkbox-label-inline\"><?php _e( 'Random Order' ); ?></label>\n\t\t</span>\n\n\t\t<span class=\"setting size\">\n\t\t\t<label for=\"gallery-settings-size\" class=\"name\"><?php _e( 'Size' ); ?></label>\n\t\t\t<select id=\"gallery-settings-size\" class=\"size\" name=\"size\"\n\t\t\t\tdata-setting=\"size\"\n\t\t\t\t<# if ( data.userSettings ) { #>\n\t\t\t\t\tdata-user-setting=\"imgsize\"\n\t\t\t\t<# } #>\n\t\t\t\t>\n\t\t\t\t<?php\n\t\t\t\t/** This filter is documented in wp-admin/includes/media.php */\n\t\t\t\t$size_names = apply_filters(\n\t\t\t\t\t'image_size_names_choose',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'thumbnail' => __( 'Thumbnail' ),\n\t\t\t\t\t\t'medium'    => __( 'Medium' ),\n\t\t\t\t\t\t'large'     => __( 'Large' ),\n\t\t\t\t\t\t'full'      => __( 'Full Size' ),\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tforeach ( $size_names as $size => $label ) :\n\t\t\t\t\t?>\n\t\t\t\t\t<option value=\"<?php echo esc_attr( $size ); ?>\">\n\t\t\t\t\t\t<?php echo esc_html( $label ); ?>\n\t\t\t\t\t</option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</select>\n\t\t</span>\n\t</script>\n\n\t<?php // Template for the Playlists settings, used for example in the sidebar. ?>\n\t<script type=\"text/html\" id=\"tmpl-playlist-settings\">\n\t\t<h2><?php _e( 'Playlist Settings' ); ?></h2>\n\n\t\t<# var emptyModel = _.isEmpty( data.model ),\n\t\t\tisVideo = 'video' === data.controller.get('library').props.get('type'); #>\n\n\t\t<span class=\"setting\">\n\t\t\t<input type=\"checkbox\" id=\"playlist-settings-show-list\" data-setting=\"tracklist\" <# if ( emptyModel ) { #>\n\t\t\t\tchecked=\"checked\"\n\t\t\t<# } #> />\n\t\t\t<label for=\"playlist-settings-show-list\" class=\"checkbox-label-inline\">\n\t\t\t\t<# if ( isVideo ) { #>\n\t\t\t\t<?php _e( 'Show Video List' ); ?>\n\t\t\t\t<# } else { #>\n\t\t\t\t<?php _e( 'Show Tracklist' ); ?>\n\t\t\t\t<# } #>\n\t\t\t</label>\n\t\t</span>\n\n\t\t<# if ( ! isVideo ) { #>\n\t\t<span class=\"setting\">\n\t\t\t<input type=\"checkbox\" id=\"playlist-settings-show-artist\" data-setting=\"artists\" <# if ( emptyModel ) { #>\n\t\t\t\tchecked=\"checked\"\n\t\t\t<# } #> />\n\t\t\t<label for=\"playlist-settings-show-artist\" class=\"checkbox-label-inline\">\n\t\t\t\t<?php _e( 'Show Artist Name in Tracklist' ); ?>\n\t\t\t</label>\n\t\t</span>\n\t\t<# } #>\n\n\t\t<span class=\"setting\">\n\t\t\t<input type=\"checkbox\" id=\"playlist-settings-show-images\" data-setting=\"images\" <# if ( emptyModel ) { #>\n\t\t\t\tchecked=\"checked\"\n\t\t\t<# } #> />\n\t\t\t<label for=\"playlist-settings-show-images\" class=\"checkbox-label-inline\">\n\t\t\t\t<?php _e( 'Show Images' ); ?>\n\t\t\t</label>\n\t\t</span>\n\t</script>\n\n\t<?php // Template for the \"Insert from URL\" layout. ?>\n\t<script type=\"text/html\" id=\"tmpl-embed-link-settings\">\n\t\t<span class=\"setting link-text\">\n\t\t\t<label for=\"embed-link-settings-link-text\" class=\"name\"><?php _e( 'Link Text' ); ?></label>\n\t\t\t<input type=\"text\" id=\"embed-link-settings-link-text\" class=\"alignment\" data-setting=\"linkText\" />\n\t\t</span>\n\t\t<div class=\"embed-container\" style=\"display: none;\">\n\t\t\t<div class=\"embed-preview\"></div>\n\t\t</div>\n\t</script>\n\n\t<?php // Template for the \"Insert from URL\" image preview and details. ?>\n\t<script type=\"text/html\" id=\"tmpl-embed-image-settings\">\n\t\t<div class=\"wp-clearfix\">\n\t\t\t<div class=\"thumbnail\">\n\t\t\t\t<img src=\"{{ data.model.url }}\" draggable=\"false\" alt=\"\" />\n\t\t\t</div>\n\t\t</div>\n\n\t\t<span class=\"setting alt-text has-description\">\n\t\t\t<label for=\"embed-image-settings-alt-text\" class=\"name\"><?php _e( 'Alternative Text' ); ?></label>\n\t\t\t<input type=\"text\" id=\"embed-image-settings-alt-text\" data-setting=\"alt\" aria-describedby=\"alt-text-description\" />\n\t\t</span>\n\t\t<p class=\"description\" id=\"alt-text-description\"><?php echo $alt_text_description; ?></p>\n\n\t\t<?php\n\t\t/** This filter is documented in wp-admin/includes/media.php */\n\t\tif ( ! apply_filters( 'disable_captions', '' ) ) :\n\t\t\t?>\n\t\t\t<span class=\"setting caption\">\n\t\t\t\t<label for=\"embed-image-settings-caption\" class=\"name\"><?php _e( 'Caption' ); ?></label>\n\t\t\t\t<textarea id=\"embed-image-settings-caption\" data-setting=\"caption\" />\n\t\t\t</span>\n\t\t<?php endif; ?>\n\n\t\t<fieldset class=\"setting-group\">\n\t\t\t<legend class=\"name\"><?php _e( 'Align' ); ?></legend>\n\t\t\t<span class=\"setting align\">\n\t\t\t\t<span class=\"button-group button-large\" data-setting=\"align\">\n\t\t\t\t\t<button class=\"button\" value=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Left' ); ?>\n\t\t\t\t\t</button>\n\t\t\t\t\t<button class=\"button\" value=\"center\">\n\t\t\t\t\t\t<?php esc_html_e( 'Center' ); ?>\n\t\t\t\t\t</button>\n\t\t\t\t\t<button class=\"button\" value=\"right\">\n\t\t\t\t\t\t<?php esc_html_e( 'Right' ); ?>\n\t\t\t\t\t</button>\n\t\t\t\t\t<button class=\"button active\" value=\"none\">\n\t\t\t\t\t\t<?php esc_html_e( 'None' ); ?>\n\t\t\t\t\t</button>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t</fieldset>\n\n\t\t<fieldset class=\"setting-group\">\n\t\t\t<legend class=\"name\"><?php _e( 'Link To' ); ?></legend>\n\t\t\t<span class=\"setting link-to\">\n\t\t\t\t<span class=\"button-group button-large\" data-setting=\"link\">\n\t\t\t\t\t<button class=\"button\" value=\"file\">\n\t\t\t\t\t\t<?php esc_html_e( 'Image URL' ); ?>\n\t\t\t\t\t</button>\n\t\t\t\t\t<button class=\"button\" value=\"custom\">\n\t\t\t\t\t\t<?php esc_html_e( 'Custom URL' ); ?>\n\t\t\t\t\t</button>\n\t\t\t\t\t<button class=\"button active\" value=\"none\">\n\t\t\t\t\t\t<?php esc_html_e( 'None' ); ?>\n\t\t\t\t\t</button>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t\t<span class=\"setting\">\n\t\t\t\t<label for=\"embed-image-settings-link-to-custom\" class=\"name\"><?php _e( 'URL' ); ?></label>\n\t\t\t\t<input type=\"text\" id=\"embed-image-settings-link-to-custom\" class=\"link-to-custom\" data-setting=\"linkUrl\" />\n\t\t\t</span>\n\t\t</fieldset>\n\t</script>\n\n\t<?php // Template for the Image details, used for example in the editor. ?>\n\t<script type=\"text/html\" id=\"tmpl-image-details\">\n\t\t<div class=\"media-embed\">\n\t\t\t<div class=\"embed-media-settings\">\n\t\t\t\t<div class=\"column-settings\">\n\t\t\t\t\t<span class=\"setting alt-text has-description\">\n\t\t\t\t\t\t<label for=\"image-details-alt-text\" class=\"name\"><?php _e( 'Alternative Text' ); ?></label>\n\t\t\t\t\t\t<input type=\"text\" id=\"image-details-alt-text\" data-setting=\"alt\" value=\"{{ data.model.alt }}\" aria-describedby=\"alt-text-description\" />\n\t\t\t\t\t</span>\n\t\t\t\t\t<p class=\"description\" id=\"alt-text-description\"><?php echo $alt_text_description; ?></p>\n\n\t\t\t\t\t<?php\n\t\t\t\t\t/** This filter is documented in wp-admin/includes/media.php */\n\t\t\t\t\tif ( ! apply_filters( 'disable_captions', '' ) ) :\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<span class=\"setting caption\">\n\t\t\t\t\t\t\t<label for=\"image-details-caption\" class=\"name\"><?php _e( 'Caption' ); ?></label>\n\t\t\t\t\t\t\t<textarea id=\"image-details-caption\" data-setting=\"caption\">{{ data.model.caption }}</textarea>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t<h2><?php _e( 'Display Settings' ); ?></h2>\n\t\t\t\t\t<fieldset class=\"setting-group\">\n\t\t\t\t\t\t<legend class=\"legend-inline\"><?php _e( 'Align' ); ?></legend>\n\t\t\t\t\t\t<span class=\"setting align\">\n\t\t\t\t\t\t\t<span class=\"button-group button-large\" data-setting=\"align\">\n\t\t\t\t\t\t\t\t<button class=\"button\" value=\"left\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Left' ); ?>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t<button class=\"button\" value=\"center\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Center' ); ?>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t<button class=\"button\" value=\"right\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Right' ); ?>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t<button class=\"button active\" value=\"none\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'None' ); ?>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</fieldset>\n\n\t\t\t\t\t<# if ( data.attachment ) { #>\n\t\t\t\t\t\t<# if ( 'undefined' !== typeof data.attachment.sizes ) { #>\n\t\t\t\t\t\t\t<span class=\"setting size\">\n\t\t\t\t\t\t\t\t<label for=\"image-details-size\" class=\"name\"><?php _e( 'Size' ); ?></label>\n\t\t\t\t\t\t\t\t<select id=\"image-details-size\" class=\"size\" name=\"size\"\n\t\t\t\t\t\t\t\t\tdata-setting=\"size\"\n\t\t\t\t\t\t\t\t\t<# if ( data.userSettings ) { #>\n\t\t\t\t\t\t\t\t\t\tdata-user-setting=\"imgsize\"\n\t\t\t\t\t\t\t\t\t<# } #>>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t/** This filter is documented in wp-admin/includes/media.php */\n\t\t\t\t\t\t\t\t\t$sizes = apply_filters(\n\t\t\t\t\t\t\t\t\t\t'image_size_names_choose',\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'thumbnail' => __( 'Thumbnail' ),\n\t\t\t\t\t\t\t\t\t\t\t'medium'    => __( 'Medium' ),\n\t\t\t\t\t\t\t\t\t\t\t'large'     => __( 'Large' ),\n\t\t\t\t\t\t\t\t\t\t\t'full'      => __( 'Full Size' ),\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tforeach ( $sizes as $value => $name ) :\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<#\n\t\t\t\t\t\t\t\t\t\tvar size = data.sizes['<?php echo esc_js( $value ); ?>'];\n\t\t\t\t\t\t\t\t\t\tif ( size ) { #>\n\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $value ); ?>\">\n\t\t\t\t\t\t\t\t\t\t\t\t<?php echo esc_html( $name ); ?> &ndash; {{ size.width }} &times; {{ size.height }}\n\t\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t\t<# } #>\n\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\t<option value=\"<?php echo esc_attr( 'custom' ); ?>\">\n\t\t\t\t\t\t\t\t\t\t<?php _e( 'Custom Size' ); ?>\n\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t\t\t<div class=\"custom-size wp-clearfix<# if ( data.model.size !== 'custom' ) { #> hidden<# } #>\">\n\t\t\t\t\t\t\t\t<span class=\"custom-size-setting\">\n\t\t\t\t\t\t\t\t\t<label for=\"image-details-size-width\"><?php _e( 'Width' ); ?></label>\n\t\t\t\t\t\t\t\t\t<input type=\"number\" id=\"image-details-size-width\" aria-describedby=\"image-size-desc\" data-setting=\"customWidth\" step=\"1\" value=\"{{ data.model.customWidth }}\" />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span class=\"sep\" aria-hidden=\"true\">&times;</span>\n\t\t\t\t\t\t\t\t<span class=\"custom-size-setting\">\n\t\t\t\t\t\t\t\t\t<label for=\"image-details-size-height\"><?php _e( 'Height' ); ?></label>\n\t\t\t\t\t\t\t\t\t<input type=\"number\" id=\"image-details-size-height\" aria-describedby=\"image-size-desc\" data-setting=\"customHeight\" step=\"1\" value=\"{{ data.model.customHeight }}\" />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<p id=\"image-size-desc\" class=\"description\"><?php _e( 'Image size in pixels' ); ?></p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t<# } #>\n\n\t\t\t\t\t<span class=\"setting link-to\">\n\t\t\t\t\t\t<label for=\"image-details-link-to\" class=\"name\"><?php _e( 'Link To' ); ?></label>\n\t\t\t\t\t\t<select id=\"image-details-link-to\" data-setting=\"link\">\n\t\t\t\t\t\t<# if ( data.attachment ) { #>\n\t\t\t\t\t\t\t<option value=\"file\">\n\t\t\t\t\t\t\t\t<?php esc_html_e( 'Media File' ); ?>\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t<option value=\"post\">\n\t\t\t\t\t\t\t\t<?php esc_html_e( 'Attachment Page' ); ?>\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t<option value=\"file\">\n\t\t\t\t\t\t\t\t<?php esc_html_e( 'Image URL' ); ?>\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t\t\t<option value=\"custom\">\n\t\t\t\t\t\t\t\t<?php esc_html_e( 'Custom URL' ); ?>\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t<option value=\"none\">\n\t\t\t\t\t\t\t\t<?php esc_html_e( 'None' ); ?>\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"setting\">\n\t\t\t\t\t\t<label for=\"image-details-link-to-custom\" class=\"name\"><?php _e( 'URL' ); ?></label>\n\t\t\t\t\t\t<input type=\"text\" id=\"image-details-link-to-custom\" class=\"link-to-custom\" data-setting=\"linkUrl\" />\n\t\t\t\t\t</span>\n\n\t\t\t\t\t<div class=\"advanced-section\">\n\t\t\t\t\t\t<h2><button type=\"button\" class=\"button-link advanced-toggle\"><?php _e( 'Advanced Options' ); ?></button></h2>\n\t\t\t\t\t\t<div class=\"advanced-settings hidden\">\n\t\t\t\t\t\t\t<div class=\"advanced-image\">\n\t\t\t\t\t\t\t\t<span class=\"setting title-text\">\n\t\t\t\t\t\t\t\t\t<label for=\"image-details-title-attribute\" class=\"name\"><?php _e( 'Image Title Attribute' ); ?></label>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" id=\"image-details-title-attribute\" data-setting=\"title\" value=\"{{ data.model.title }}\" />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span class=\"setting extra-classes\">\n\t\t\t\t\t\t\t\t\t<label for=\"image-details-css-class\" class=\"name\"><?php _e( 'Image CSS Class' ); ?></label>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" id=\"image-details-css-class\" data-setting=\"extraClasses\" value=\"{{ data.model.extraClasses }}\" />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"advanced-link\">\n\t\t\t\t\t\t\t\t<span class=\"setting link-target\">\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" id=\"image-details-link-target\" data-setting=\"linkTargetBlank\" value=\"_blank\" <# if ( data.model.linkTargetBlank ) { #>checked=\"checked\"<# } #>>\n\t\t\t\t\t\t\t\t\t<label for=\"image-details-link-target\" class=\"checkbox-label\"><?php _e( 'Open link in a new tab' ); ?></label>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span class=\"setting link-rel\">\n\t\t\t\t\t\t\t\t\t<label for=\"image-details-link-rel\" class=\"name\"><?php _e( 'Link Rel' ); ?></label>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" id=\"image-details-link-rel\" data-setting=\"linkRel\" value=\"{{ data.model.linkRel }}\" />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span class=\"setting link-class-name\">\n\t\t\t\t\t\t\t\t\t<label for=\"image-details-link-css-class\" class=\"name\"><?php _e( 'Link CSS Class' ); ?></label>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" id=\"image-details-link-css-class\" data-setting=\"linkClassName\" value=\"{{ data.model.linkClassName }}\" />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"column-image\">\n\t\t\t\t\t<div class=\"image\">\n\t\t\t\t\t\t<img src=\"{{ data.model.url }}\" draggable=\"false\" alt=\"\" />\n\t\t\t\t\t\t<# if ( data.attachment && window.imageEdit ) { #>\n\t\t\t\t\t\t\t<div class=\"actions\">\n\t\t\t\t\t\t\t\t<input type=\"button\" class=\"edit-attachment button\" value=\"<?php esc_attr_e( 'Edit Original' ); ?>\" />\n\t\t\t\t\t\t\t\t<input type=\"button\" class=\"replace-attachment button\" value=\"<?php esc_attr_e( 'Replace' ); ?>\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</script>\n\n\t<?php // Template for the Image Editor layout. ?>\n\t<script type=\"text/html\" id=\"tmpl-image-editor\">\n\t\t<div id=\"media-head-{{ data.id }}\"></div>\n\t\t<div id=\"image-editor-{{ data.id }}\"></div>\n\t</script>\n\n\t<?php // Template for an embedded Audio details. ?>\n\t<script type=\"text/html\" id=\"tmpl-audio-details\">\n\t\t<# var ext, html5types = {\n\t\t\tmp3: wp.media.view.settings.embedMimes.mp3,\n\t\t\togg: wp.media.view.settings.embedMimes.ogg\n\t\t}; #>\n\n\t\t<?php $audio_types = wp_get_audio_extensions(); ?>\n\t\t<div class=\"media-embed media-embed-details\">\n\t\t\t<div class=\"embed-media-settings embed-audio-settings\">\n\t\t\t\t<?php wp_underscore_audio_template(); ?>\n\n\t\t\t\t<# if ( ! _.isEmpty( data.model.src ) ) {\n\t\t\t\t\text = data.model.src.split('.').pop();\n\t\t\t\t\tif ( html5types[ ext ] ) {\n\t\t\t\t\t\tdelete html5types[ ext ];\n\t\t\t\t\t}\n\t\t\t\t#>\n\t\t\t\t<span class=\"setting\">\n\t\t\t\t\t<label for=\"audio-details-source\" class=\"name\"><?php _e( 'URL' ); ?></label>\n\t\t\t\t\t<input type=\"text\" id=\"audio-details-source\" readonly data-setting=\"src\" value=\"{{ data.model.src }}\" />\n\t\t\t\t\t<button type=\"button\" class=\"button-link remove-setting\"><?php _e( 'Remove audio source' ); ?></button>\n\t\t\t\t</span>\n\t\t\t\t<# } #>\n\t\t\t\t<?php\n\n\t\t\t\tforeach ( $audio_types as $type ) :\n\t\t\t\t\t?>\n\t\t\t\t<# if ( ! _.isEmpty( data.model.<?php echo $type; ?> ) ) {\n\t\t\t\t\tif ( ! _.isUndefined( html5types.<?php echo $type; ?> ) ) {\n\t\t\t\t\t\tdelete html5types.<?php echo $type; ?>;\n\t\t\t\t\t}\n\t\t\t\t#>\n\t\t\t\t<span class=\"setting\">\n\t\t\t\t\t<label for=\"audio-details-<?php echo $type . '-source'; ?>\" class=\"name\"><?php echo strtoupper( $type ); ?></label>\n\t\t\t\t\t<input type=\"text\" id=\"audio-details-<?php echo $type . '-source'; ?>\" readonly data-setting=\"<?php echo $type; ?>\" value=\"{{ data.model.<?php echo $type; ?> }}\" />\n\t\t\t\t\t<button type=\"button\" class=\"button-link remove-setting\"><?php _e( 'Remove audio source' ); ?></button>\n\t\t\t\t</span>\n\t\t\t\t<# } #>\n\t\t\t\t<?php endforeach ?>\n\n\t\t\t\t<# if ( ! _.isEmpty( html5types ) ) { #>\n\t\t\t\t<fieldset class=\"setting-group\">\n\t\t\t\t\t<legend class=\"name\"><?php _e( 'Add alternate sources for maximum HTML5 playback' ); ?></legend>\n\t\t\t\t\t<span class=\"setting\">\n\t\t\t\t\t\t<span class=\"button-large\">\n\t\t\t\t\t\t<# _.each( html5types, function (mime, type) { #>\n\t\t\t\t\t\t\t<button class=\"button add-media-source\" data-mime=\"{{ mime }}\">{{ type }}</button>\n\t\t\t\t\t\t<# } ) #>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\t\t\t\t</fieldset>\n\t\t\t\t<# } #>\n\n\t\t\t\t<fieldset class=\"setting-group\">\n\t\t\t\t\t<legend class=\"name\"><?php _e( 'Preload' ); ?></legend>\n\t\t\t\t\t<span class=\"setting preload\">\n\t\t\t\t\t\t<span class=\"button-group button-large\" data-setting=\"preload\">\n\t\t\t\t\t\t\t<button class=\"button\" value=\"auto\"><?php _ex( 'Auto', 'auto preload' ); ?></button>\n\t\t\t\t\t\t\t<button class=\"button\" value=\"metadata\"><?php _e( 'Metadata' ); ?></button>\n\t\t\t\t\t\t\t<button class=\"button active\" value=\"none\"><?php _e( 'None' ); ?></button>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\t\t\t\t</fieldset>\n\n\t\t\t\t<span class=\"setting-group\">\n\t\t\t\t\t<span class=\"setting checkbox-setting autoplay\">\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"audio-details-autoplay\" data-setting=\"autoplay\" />\n\t\t\t\t\t\t<label for=\"audio-details-autoplay\" class=\"checkbox-label\"><?php _e( 'Autoplay' ); ?></label>\n\t\t\t\t\t</span>\n\n\t\t\t\t\t<span class=\"setting checkbox-setting\">\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"audio-details-loop\" data-setting=\"loop\" />\n\t\t\t\t\t\t<label for=\"audio-details-loop\" class=\"checkbox-label\"><?php _e( 'Loop' ); ?></label>\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</div>\n\t</script>\n\n\t<?php // Template for an embedded Video details. ?>\n\t<script type=\"text/html\" id=\"tmpl-video-details\">\n\t\t<# var ext, html5types = {\n\t\t\tmp4: wp.media.view.settings.embedMimes.mp4,\n\t\t\togv: wp.media.view.settings.embedMimes.ogv,\n\t\t\twebm: wp.media.view.settings.embedMimes.webm\n\t\t}; #>\n\n\t\t<?php $video_types = wp_get_video_extensions(); ?>\n\t\t<div class=\"media-embed media-embed-details\">\n\t\t\t<div class=\"embed-media-settings embed-video-settings\">\n\t\t\t\t<div class=\"wp-video-holder\">\n\t\t\t\t<#\n\t\t\t\tvar w = ! data.model.width || data.model.width > 640 ? 640 : data.model.width,\n\t\t\t\t\th = ! data.model.height ? 360 : data.model.height;\n\n\t\t\t\tif ( data.model.width && w !== data.model.width ) {\n\t\t\t\t\th = Math.ceil( ( h * w ) / data.model.width );\n\t\t\t\t}\n\t\t\t\t#>\n\n\t\t\t\t<?php wp_underscore_video_template(); ?>\n\n\t\t\t\t<# if ( ! _.isEmpty( data.model.src ) ) {\n\t\t\t\t\text = data.model.src.split('.').pop();\n\t\t\t\t\tif ( html5types[ ext ] ) {\n\t\t\t\t\t\tdelete html5types[ ext ];\n\t\t\t\t\t}\n\t\t\t\t#>\n\t\t\t\t<span class=\"setting\">\n\t\t\t\t\t<label for=\"video-details-source\" class=\"name\"><?php _e( 'URL' ); ?></label>\n\t\t\t\t\t<input type=\"text\" id=\"video-details-source\" readonly data-setting=\"src\" value=\"{{ data.model.src }}\" />\n\t\t\t\t\t<button type=\"button\" class=\"button-link remove-setting\"><?php _e( 'Remove video source' ); ?></button>\n\t\t\t\t</span>\n\t\t\t\t<# } #>\n\t\t\t\t<?php\n\t\t\t\tforeach ( $video_types as $type ) :\n\t\t\t\t\t?>\n\t\t\t\t<# if ( ! _.isEmpty( data.model.<?php echo $type; ?> ) ) {\n\t\t\t\t\tif ( ! _.isUndefined( html5types.<?php echo $type; ?> ) ) {\n\t\t\t\t\t\tdelete html5types.<?php echo $type; ?>;\n\t\t\t\t\t}\n\t\t\t\t#>\n\t\t\t\t<span class=\"setting\">\n\t\t\t\t\t<label for=\"video-details-<?php echo $type . '-source'; ?>\" class=\"name\"><?php echo strtoupper( $type ); ?></label>\n\t\t\t\t\t<input type=\"text\" id=\"video-details-<?php echo $type . '-source'; ?>\" readonly data-setting=\"<?php echo $type; ?>\" value=\"{{ data.model.<?php echo $type; ?> }}\" />\n\t\t\t\t\t<button type=\"button\" class=\"button-link remove-setting\"><?php _e( 'Remove video source' ); ?></button>\n\t\t\t\t</span>\n\t\t\t\t<# } #>\n\t\t\t\t<?php endforeach ?>\n\t\t\t\t</div>\n\n\t\t\t\t<# if ( ! _.isEmpty( html5types ) ) { #>\n\t\t\t\t<fieldset class=\"setting-group\">\n\t\t\t\t\t<legend class=\"name\"><?php _e( 'Add alternate sources for maximum HTML5 playback' ); ?></legend>\n\t\t\t\t\t<span class=\"setting\">\n\t\t\t\t\t\t<span class=\"button-large\">\n\t\t\t\t\t\t<# _.each( html5types, function (mime, type) { #>\n\t\t\t\t\t\t\t<button class=\"button add-media-source\" data-mime=\"{{ mime }}\">{{ type }}</button>\n\t\t\t\t\t\t<# } ) #>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\t\t\t\t</fieldset>\n\t\t\t\t<# } #>\n\n\t\t\t\t<# if ( ! _.isEmpty( data.model.poster ) ) { #>\n\t\t\t\t<span class=\"setting\">\n\t\t\t\t\t<label for=\"video-details-poster-image\" class=\"name\"><?php _e( 'Poster Image' ); ?></label>\n\t\t\t\t\t<input type=\"text\" id=\"video-details-poster-image\" readonly data-setting=\"poster\" value=\"{{ data.model.poster }}\" />\n\t\t\t\t\t<button type=\"button\" class=\"button-link remove-setting\"><?php _e( 'Remove poster image' ); ?></button>\n\t\t\t\t</span>\n\t\t\t\t<# } #>\n\n\t\t\t\t<fieldset class=\"setting-group\">\n\t\t\t\t\t<legend class=\"name\"><?php _e( 'Preload' ); ?></legend>\n\t\t\t\t\t<span class=\"setting preload\">\n\t\t\t\t\t\t<span class=\"button-group button-large\" data-setting=\"preload\">\n\t\t\t\t\t\t\t<button class=\"button\" value=\"auto\"><?php _ex( 'Auto', 'auto preload' ); ?></button>\n\t\t\t\t\t\t\t<button class=\"button\" value=\"metadata\"><?php _e( 'Metadata' ); ?></button>\n\t\t\t\t\t\t\t<button class=\"button active\" value=\"none\"><?php _e( 'None' ); ?></button>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\t\t\t\t</fieldset>\n\n\t\t\t\t<span class=\"setting-group\">\n\t\t\t\t\t<span class=\"setting checkbox-setting autoplay\">\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"video-details-autoplay\" data-setting=\"autoplay\" />\n\t\t\t\t\t\t<label for=\"video-details-autoplay\" class=\"checkbox-label\"><?php _e( 'Autoplay' ); ?></label>\n\t\t\t\t\t</span>\n\n\t\t\t\t\t<span class=\"setting checkbox-setting\">\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"video-details-loop\" data-setting=\"loop\" />\n\t\t\t\t\t\t<label for=\"video-details-loop\" class=\"checkbox-label\"><?php _e( 'Loop' ); ?></label>\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\n\t\t\t\t<span class=\"setting\" data-setting=\"content\">\n\t\t\t\t\t<#\n\t\t\t\t\tvar content = '';\n\t\t\t\t\tif ( ! _.isEmpty( data.model.content ) ) {\n\t\t\t\t\t\tvar tracks = jQuery( data.model.content ).filter( 'track' );\n\t\t\t\t\t\t_.each( tracks.toArray(), function( track, index ) {\n\t\t\t\t\t\t\tcontent += track.outerHTML; #>\n\t\t\t\t\t\t<label for=\"video-details-track-{{ index }}\" class=\"name\"><?php _e( 'Tracks (subtitles, captions, descriptions, chapters, or metadata)' ); ?></label>\n\t\t\t\t\t\t<input class=\"content-track\" type=\"text\" id=\"video-details-track-{{ index }}\" aria-describedby=\"video-details-track-desc-{{ index }}\" value=\"{{ track.outerHTML }}\" />\n\t\t\t\t\t\t<span class=\"description\" id=\"video-details-track-desc-{{ index }}\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t/* translators: 1: \"srclang\" HTML attribute, 2: \"label\" HTML attribute, 3: \"kind\" HTML attribute. */\n\t\t\t\t\t\t\t\t__( 'The %1$s, %2$s, and %3$s values can be edited to set the video track language and kind.' ),\n\t\t\t\t\t\t\t\t'srclang',\n\t\t\t\t\t\t\t\t'label',\n\t\t\t\t\t\t\t\t'kind'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<button type=\"button\" class=\"button-link remove-setting remove-track\"><?php _ex( 'Remove video track', 'media' ); ?></button><br/>\n\t\t\t\t\t\t<# } ); #>\n\t\t\t\t\t<# } else { #>\n\t\t\t\t\t<span class=\"name\"><?php _e( 'Tracks (subtitles, captions, descriptions, chapters, or metadata)' ); ?></span><br />\n\t\t\t\t\t<em><?php _e( 'There are no associated subtitles.' ); ?></em>\n\t\t\t\t\t<# } #>\n\t\t\t\t\t<textarea class=\"hidden content-setting\">{{ content }}</textarea>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</div>\n\t</script>\n\n\t<?php // Template for a Gallery within the editor. ?>\n\t<script type=\"text/html\" id=\"tmpl-editor-gallery\">\n\t\t<# if ( data.attachments.length ) { #>\n\t\t\t<div class=\"gallery gallery-columns-{{ data.columns }}\">\n\t\t\t\t<# _.each( data.attachments, function( attachment, index ) { #>\n\t\t\t\t\t<dl class=\"gallery-item\">\n\t\t\t\t\t\t<dt class=\"gallery-icon\">\n\t\t\t\t\t\t\t<# if ( attachment.thumbnail ) { #>\n\t\t\t\t\t\t\t\t<img src=\"{{ attachment.thumbnail.url }}\" width=\"{{ attachment.thumbnail.width }}\" height=\"{{ attachment.thumbnail.height }}\" alt=\"{{ attachment.alt }}\" />\n\t\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t\t<img src=\"{{ attachment.url }}\" alt=\"{{ attachment.alt }}\" />\n\t\t\t\t\t\t\t<# } #>\n\t\t\t\t\t\t</dt>\n\t\t\t\t\t\t<# if ( attachment.caption ) { #>\n\t\t\t\t\t\t\t<dd class=\"wp-caption-text gallery-caption\">\n\t\t\t\t\t\t\t\t{{{ data.verifyHTML( attachment.caption ) }}}\n\t\t\t\t\t\t\t</dd>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t</dl>\n\t\t\t\t\t<# if ( index % data.columns === data.columns - 1 ) { #>\n\t\t\t\t\t\t<br style=\"clear: both;\">\n\t\t\t\t\t<# } #>\n\t\t\t\t<# } ); #>\n\t\t\t</div>\n\t\t<# } else { #>\n\t\t\t<div class=\"wpview-error\">\n\t\t\t\t<div class=\"dashicons dashicons-format-gallery\"></div><p><?php _e( 'No items found.' ); ?></p>\n\t\t\t</div>\n\t\t<# } #>\n\t</script>\n\n\t<?php // Template for the Crop area layout, used for example in the Customizer. ?>\n\t<script type=\"text/html\" id=\"tmpl-crop-content\">\n\t\t<img class=\"crop-image\" src=\"{{ data.url }}\" alt=\"<?php esc_attr_e( 'Image crop area preview. Requires mouse interaction.' ); ?>\">\n\t\t<div class=\"upload-errors\"></div>\n\t</script>\n\n\t<?php // Template for the Site Icon preview, used for example in the Customizer. ?>\n\t<script type=\"text/html\" id=\"tmpl-site-icon-preview\">\n\t\t<h2><?php _e( 'Preview' ); ?></h2>\n\t\t<strong aria-hidden=\"true\"><?php _e( 'As a browser icon' ); ?></strong>\n\t\t<div class=\"favicon-preview\">\n\t\t\t<img src=\"<?php echo esc_url( admin_url( 'images/' . ( is_rtl() ? 'browser-rtl.png' : 'browser.png' ) ) ); ?>\" class=\"browser-preview\" width=\"182\" height=\"\" alt=\"\" />\n\n\t\t\t<div class=\"favicon\">\n\t\t\t\t<img id=\"preview-favicon\" src=\"{{ data.url }}\" alt=\"<?php esc_attr_e( 'Preview as a browser icon' ); ?>\"/>\n\t\t\t</div>\n\t\t\t<span class=\"browser-title\" aria-hidden=\"true\"><# print( '<?php bloginfo( 'name' ); ?>' ) #></span>\n\t\t</div>\n\n\t\t<strong aria-hidden=\"true\"><?php _e( 'As an app icon' ); ?></strong>\n\t\t<div class=\"app-icon-preview\">\n\t\t\t<img id=\"preview-app-icon\" src=\"{{ data.url }}\" alt=\"<?php esc_attr_e( 'Preview as an app icon' ); ?>\"/>\n\t\t</div>\n\t</script>\n\n\t<?php\n\n\t/**\n\t * Fires when the custom Backbone media templates are printed.\n\t *\n\t * @since 3.5.0\n\t */\n\tdo_action( 'print_media_templates' );\n}\n", "num_lines": 1469}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress API for media display.\n *\n * @package WordPress\n * @subpackage Media\n */\n\n/**\n * Retrieve additional image sizes.\n *\n * @since 4.7.0\n *\n * @global array $_wp_additional_image_sizes\n *\n * @return array Additional images size data.\n */\nfunction wp_get_additional_image_sizes() {\n\tglobal $_wp_additional_image_sizes;\n\n\tif ( ! $_wp_additional_image_sizes ) {\n\t\t$_wp_additional_image_sizes = array();\n\t}\n\n\treturn $_wp_additional_image_sizes;\n}\n\n/**\n * Scale down the default size of an image.\n *\n * This is so that the image is a better fit for the editor and theme.\n *\n * The `$size` parameter accepts either an array or a string. The supported string\n * values are 'thumb' or 'thumbnail' for the given thumbnail size or defaults at\n * 128 width and 96 height in pixels. Also supported for the string value is\n * 'medium', 'medium_large' and 'full'. The 'full' isn't actually supported, but any value other\n * than the supported will result in the content_width size or 500 if that is\n * not set.\n *\n * Finally, there is a filter named {@see 'editor_max_image_size'}, that will be\n * called on the calculated array for width and height, respectively.\n *\n * @since 2.5.0\n *\n * @global int   $content_width\n *\n * @param int          $width   Width of the image in pixels.\n * @param int          $height  Height of the image in pixels.\n * @param string|array $size    Optional. Image size. Accepts any valid image size, or an array\n *                              of width and height values in pixels (in that order).\n *                              Default 'medium'.\n * @param string       $context Optional. Could be 'display' (like in a theme) or 'edit'\n *                              (like inserting into an editor). Default null.\n * @return int[] {\n *     An array of width and height values.\n *\n *     @type int $0 The maximum width in pixels.\n *     @type int $1 The maximum height in pixels.\n * }\n */\nfunction image_constrain_size_for_editor( $width, $height, $size = 'medium', $context = null ) {\n\tglobal $content_width;\n\n\t$_wp_additional_image_sizes = wp_get_additional_image_sizes();\n\n\tif ( ! $context ) {\n\t\t$context = is_admin() ? 'edit' : 'display';\n\t}\n\n\tif ( is_array( $size ) ) {\n\t\t$max_width  = $size[0];\n\t\t$max_height = $size[1];\n\t} elseif ( 'thumb' === $size || 'thumbnail' === $size ) {\n\t\t$max_width  = intval( get_option( 'thumbnail_size_w' ) );\n\t\t$max_height = intval( get_option( 'thumbnail_size_h' ) );\n\t\t// Last chance thumbnail size defaults.\n\t\tif ( ! $max_width && ! $max_height ) {\n\t\t\t$max_width  = 128;\n\t\t\t$max_height = 96;\n\t\t}\n\t} elseif ( 'medium' === $size ) {\n\t\t$max_width  = intval( get_option( 'medium_size_w' ) );\n\t\t$max_height = intval( get_option( 'medium_size_h' ) );\n\n\t} elseif ( 'medium_large' === $size ) {\n\t\t$max_width  = intval( get_option( 'medium_large_size_w' ) );\n\t\t$max_height = intval( get_option( 'medium_large_size_h' ) );\n\n\t\tif ( intval( $content_width ) > 0 ) {\n\t\t\t$max_width = min( intval( $content_width ), $max_width );\n\t\t}\n\t} elseif ( 'large' === $size ) {\n\t\t/*\n\t\t * We're inserting a large size image into the editor. If it's a really\n\t\t * big image we'll scale it down to fit reasonably within the editor\n\t\t * itself, and within the theme's content width if it's known. The user\n\t\t * can resize it in the editor if they wish.\n\t\t */\n\t\t$max_width  = intval( get_option( 'large_size_w' ) );\n\t\t$max_height = intval( get_option( 'large_size_h' ) );\n\n\t\tif ( intval( $content_width ) > 0 ) {\n\t\t\t$max_width = min( intval( $content_width ), $max_width );\n\t\t}\n\t} elseif ( ! empty( $_wp_additional_image_sizes ) && in_array( $size, array_keys( $_wp_additional_image_sizes ), true ) ) {\n\t\t$max_width  = intval( $_wp_additional_image_sizes[ $size ]['width'] );\n\t\t$max_height = intval( $_wp_additional_image_sizes[ $size ]['height'] );\n\t\t// Only in admin. Assume that theme authors know what they're doing.\n\t\tif ( intval( $content_width ) > 0 && 'edit' === $context ) {\n\t\t\t$max_width = min( intval( $content_width ), $max_width );\n\t\t}\n\t} else { // $size === 'full' has no constraint.\n\t\t$max_width  = $width;\n\t\t$max_height = $height;\n\t}\n\n\t/**\n\t * Filters the maximum image size dimensions for the editor.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param int[]        $max_image_size {\n\t *     An array of width and height values.\n\t *\n\t *     @type int $0 The maximum width in pixels.\n\t *     @type int $1 The maximum height in pixels.\n\t * }\n\t * @param string|array $size           Size of what the result image should be.\n\t * @param string       $context        The context the image is being resized for.\n\t *                                     Possible values are 'display' (like in a theme)\n\t *                                     or 'edit' (like inserting into an editor).\n\t */\n\tlist( $max_width, $max_height ) = apply_filters( 'editor_max_image_size', array( $max_width, $max_height ), $size, $context );\n\n\treturn wp_constrain_dimensions( $width, $height, $max_width, $max_height );\n}\n\n/**\n * Retrieve width and height attributes using given width and height values.\n *\n * Both attributes are required in the sense that both parameters must have a\n * value, but are optional in that if you set them to false or null, then they\n * will not be added to the returned string.\n *\n * You can set the value using a string, but it will only take numeric values.\n * If you wish to put 'px' after the numbers, then it will be stripped out of\n * the return.\n *\n * @since 2.5.0\n *\n * @param int|string $width  Image width in pixels.\n * @param int|string $height Image height in pixels.\n * @return string HTML attributes for width and, or height.\n */\nfunction image_hwstring( $width, $height ) {\n\t$out = '';\n\tif ( $width ) {\n\t\t$out .= 'width=\"' . intval( $width ) . '\" ';\n\t}\n\tif ( $height ) {\n\t\t$out .= 'height=\"' . intval( $height ) . '\" ';\n\t}\n\treturn $out;\n}\n\n/**\n * Scale an image to fit a particular size (such as 'thumb' or 'medium').\n *\n * The URL might be the original image, or it might be a resized version. This\n * function won't create a new resized copy, it will just return an already\n * resized one if it exists.\n *\n * A plugin may use the {@see 'image_downsize'} filter to hook into and offer image\n * resizing services for images. The hook must return an array with the same\n * elements that are normally returned from the function.\n *\n * @since 2.5.0\n *\n * @param int          $id   Attachment ID for image.\n * @param string|int[] $size Optional. Image size to scale to. Accepts any valid image size name,\n *                           or an array of width and height values in pixels (in that order).\n *                           Default 'medium'.\n * @return array|false {\n *     Array of image data, or boolean false if no image is available.\n *\n *     @type string $0 Image source URL.\n *     @type int    $1 Image width in pixels.\n *     @type int    $2 Image height in pixels.\n *     @type bool   $3 Whether the image is a resized image.\n * }\n */\nfunction image_downsize( $id, $size = 'medium' ) {\n\t$is_image = wp_attachment_is_image( $id );\n\n\t/**\n\t * Filters whether to preempt the output of image_downsize().\n\t *\n\t * Returning a truthy value from the filter will effectively short-circuit\n\t * down-sizing the image, returning that value instead.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param bool|array   $downsize Whether to short-circuit the image downsize.\n\t * @param int          $id       Attachment ID for image.\n\t * @param array|string $size     Requested size of image. Image size name, or array of width\n\t *                               and height values (in that order).\n\t */\n\t$out = apply_filters( 'image_downsize', false, $id, $size );\n\n\tif ( $out ) {\n\t\treturn $out;\n\t}\n\n\t$img_url          = wp_get_attachment_url( $id );\n\t$meta             = wp_get_attachment_metadata( $id );\n\t$width            = 0;\n\t$height           = 0;\n\t$is_intermediate  = false;\n\t$img_url_basename = wp_basename( $img_url );\n\n\t// If the file isn't an image, attempt to replace its URL with a rendered image from its meta.\n\t// Otherwise, a non-image type could be returned.\n\tif ( ! $is_image ) {\n\t\tif ( ! empty( $meta['sizes']['full'] ) ) {\n\t\t\t$img_url          = str_replace( $img_url_basename, $meta['sizes']['full']['file'], $img_url );\n\t\t\t$img_url_basename = $meta['sizes']['full']['file'];\n\t\t\t$width            = $meta['sizes']['full']['width'];\n\t\t\t$height           = $meta['sizes']['full']['height'];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Try for a new style intermediate size.\n\t$intermediate = image_get_intermediate_size( $id, $size );\n\n\tif ( $intermediate ) {\n\t\t$img_url         = str_replace( $img_url_basename, $intermediate['file'], $img_url );\n\t\t$width           = $intermediate['width'];\n\t\t$height          = $intermediate['height'];\n\t\t$is_intermediate = true;\n\t} elseif ( 'thumbnail' === $size ) {\n\t\t// Fall back to the old thumbnail.\n\t\t$thumb_file = wp_get_attachment_thumb_file( $id );\n\t\t$info       = null;\n\n\t\tif ( $thumb_file ) {\n\t\t\t$info = @getimagesize( $thumb_file );\n\t\t}\n\n\t\tif ( $thumb_file && $info ) {\n\t\t\t$img_url         = str_replace( $img_url_basename, wp_basename( $thumb_file ), $img_url );\n\t\t\t$width           = $info[0];\n\t\t\t$height          = $info[1];\n\t\t\t$is_intermediate = true;\n\t\t}\n\t}\n\n\tif ( ! $width && ! $height && isset( $meta['width'], $meta['height'] ) ) {\n\t\t// Any other type: use the real image.\n\t\t$width  = $meta['width'];\n\t\t$height = $meta['height'];\n\t}\n\n\tif ( $img_url ) {\n\t\t// We have the actual image size, but might need to further constrain it if content_width is narrower.\n\t\tlist( $width, $height ) = image_constrain_size_for_editor( $width, $height, $size );\n\n\t\treturn array( $img_url, $width, $height, $is_intermediate );\n\t}\n\n\treturn false;\n}\n\n/**\n * Register a new image size.\n *\n * @since 2.9.0\n *\n * @global array $_wp_additional_image_sizes Associative array of additional image sizes.\n *\n * @param string     $name   Image size identifier.\n * @param int        $width  Optional. Image width in pixels. Default 0.\n * @param int        $height Optional. Image height in pixels. Default 0.\n * @param bool|array $crop   Optional. Image cropping behavior. If false, the image will be scaled (default),\n *                           If true, image will be cropped to the specified dimensions using center positions.\n *                           If an array, the image will be cropped using the array to specify the crop location.\n *                           Array values must be in the format: array( x_crop_position, y_crop_position ) where:\n *                               - x_crop_position accepts: 'left', 'center', or 'right'.\n *                               - y_crop_position accepts: 'top', 'center', or 'bottom'.\n */\nfunction add_image_size( $name, $width = 0, $height = 0, $crop = false ) {\n\tglobal $_wp_additional_image_sizes;\n\n\t$_wp_additional_image_sizes[ $name ] = array(\n\t\t'width'  => absint( $width ),\n\t\t'height' => absint( $height ),\n\t\t'crop'   => $crop,\n\t);\n}\n\n/**\n * Check if an image size exists.\n *\n * @since 3.9.0\n *\n * @param string $name The image size to check.\n * @return bool True if the image size exists, false if not.\n */\nfunction has_image_size( $name ) {\n\t$sizes = wp_get_additional_image_sizes();\n\treturn isset( $sizes[ $name ] );\n}\n\n/**\n * Remove a new image size.\n *\n * @since 3.9.0\n *\n * @global array $_wp_additional_image_sizes\n *\n * @param string $name The image size to remove.\n * @return bool True if the image size was successfully removed, false on failure.\n */\nfunction remove_image_size( $name ) {\n\tglobal $_wp_additional_image_sizes;\n\n\tif ( isset( $_wp_additional_image_sizes[ $name ] ) ) {\n\t\tunset( $_wp_additional_image_sizes[ $name ] );\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Registers an image size for the post thumbnail.\n *\n * @since 2.9.0\n *\n * @see add_image_size() for details on cropping behavior.\n *\n * @param int        $width  Image width in pixels.\n * @param int        $height Image height in pixels.\n * @param bool|array $crop   Optional. Whether to crop images to specified width and height or resize.\n *                           An array can specify positioning of the crop area. Default false.\n */\nfunction set_post_thumbnail_size( $width = 0, $height = 0, $crop = false ) {\n\tadd_image_size( 'post-thumbnail', $width, $height, $crop );\n}\n\n/**\n * Gets an img tag for an image attachment, scaling it down if requested.\n *\n * The {@see 'get_image_tag_class'} filter allows for changing the class name for the\n * image without having to use regular expressions on the HTML content. The\n * parameters are: what WordPress will use for the class, the Attachment ID,\n * image align value, and the size the image should be.\n *\n * The second filter, {@see 'get_image_tag'}, has the HTML content, which can then be\n * further manipulated by a plugin to change all attribute values and even HTML\n * content.\n *\n * @since 2.5.0\n *\n * @param int          $id    Attachment ID.\n * @param string       $alt   Image description for the alt attribute.\n * @param string       $title Image description for the title attribute.\n * @param string       $align Part of the class name for aligning the image.\n * @param string|array $size  Optional. Registered image size to retrieve a tag for. Accepts any\n *                            valid image size, or an array of width and height values in pixels\n *                            (in that order). Default 'medium'.\n * @return string HTML IMG element for given image attachment\n */\nfunction get_image_tag( $id, $alt, $title, $align, $size = 'medium' ) {\n\n\tlist( $img_src, $width, $height ) = image_downsize( $id, $size );\n\t$hwstring                         = image_hwstring( $width, $height );\n\n\t$title = $title ? 'title=\"' . esc_attr( $title ) . '\" ' : '';\n\n\t$class = 'align' . esc_attr( $align ) . ' size-' . esc_attr( $size ) . ' wp-image-' . $id;\n\n\t/**\n\t * Filters the value of the attachment's image tag class attribute.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param string       $class CSS class name or space-separated list of classes.\n\t * @param int          $id    Attachment ID.\n\t * @param string       $align Part of the class name for aligning the image.\n\t * @param string|array $size  Size of image. Image size or array of width and height values (in that order).\n\t *                            Default 'medium'.\n\t */\n\t$class = apply_filters( 'get_image_tag_class', $class, $id, $align, $size );\n\n\t$html = '<img src=\"' . esc_attr( $img_src ) . '\" alt=\"' . esc_attr( $alt ) . '\" ' . $title . $hwstring . 'class=\"' . $class . '\" />';\n\n\t/**\n\t * Filters the HTML content for the image tag.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param string       $html  HTML content for the image.\n\t * @param int          $id    Attachment ID.\n\t * @param string       $alt   Image description for the alt attribute.\n\t * @param string       $title Image description for the title attribute.\n\t * @param string       $align Part of the class name for aligning the image.\n\t * @param string|array $size  Size of image. Image size or array of width and height values (in that order).\n\t *                            Default 'medium'.\n\t */\n\treturn apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size );\n}\n\n/**\n * Calculates the new dimensions for a down-sampled image.\n *\n * If either width or height are empty, no constraint is applied on\n * that dimension.\n *\n * @since 2.5.0\n *\n * @param int $current_width  Current width of the image.\n * @param int $current_height Current height of the image.\n * @param int $max_width      Optional. Max width in pixels to constrain to. Default 0.\n * @param int $max_height     Optional. Max height in pixels to constrain to. Default 0.\n * @return int[] {\n *     An array of width and height values.\n *\n *     @type int $0 The width in pixels.\n *     @type int $1 The height in pixels.\n * }\n */\nfunction wp_constrain_dimensions( $current_width, $current_height, $max_width = 0, $max_height = 0 ) {\n\tif ( ! $max_width && ! $max_height ) {\n\t\treturn array( $current_width, $current_height );\n\t}\n\n\t$width_ratio  = 1.0;\n\t$height_ratio = 1.0;\n\t$did_width    = false;\n\t$did_height   = false;\n\n\tif ( $max_width > 0 && $current_width > 0 && $current_width > $max_width ) {\n\t\t$width_ratio = $max_width / $current_width;\n\t\t$did_width   = true;\n\t}\n\n\tif ( $max_height > 0 && $current_height > 0 && $current_height > $max_height ) {\n\t\t$height_ratio = $max_height / $current_height;\n\t\t$did_height   = true;\n\t}\n\n\t// Calculate the larger/smaller ratios.\n\t$smaller_ratio = min( $width_ratio, $height_ratio );\n\t$larger_ratio  = max( $width_ratio, $height_ratio );\n\n\tif ( (int) round( $current_width * $larger_ratio ) > $max_width || (int) round( $current_height * $larger_ratio ) > $max_height ) {\n\t\t// The larger ratio is too big. It would result in an overflow.\n\t\t$ratio = $smaller_ratio;\n\t} else {\n\t\t// The larger ratio fits, and is likely to be a more \"snug\" fit.\n\t\t$ratio = $larger_ratio;\n\t}\n\n\t// Very small dimensions may result in 0, 1 should be the minimum.\n\t$w = max( 1, (int) round( $current_width * $ratio ) );\n\t$h = max( 1, (int) round( $current_height * $ratio ) );\n\n\t/*\n\t * Sometimes, due to rounding, we'll end up with a result like this:\n\t * 465x700 in a 177x177 box is 117x176... a pixel short.\n\t * We also have issues with recursive calls resulting in an ever-changing result.\n\t * Constraining to the result of a constraint should yield the original result.\n\t * Thus we look for dimensions that are one pixel shy of the max value and bump them up.\n\t */\n\n\t// Note: $did_width means it is possible $smaller_ratio == $width_ratio.\n\tif ( $did_width && $w === $max_width - 1 ) {\n\t\t$w = $max_width; // Round it up.\n\t}\n\n\t// Note: $did_height means it is possible $smaller_ratio == $height_ratio.\n\tif ( $did_height && $h === $max_height - 1 ) {\n\t\t$h = $max_height; // Round it up.\n\t}\n\n\t/**\n\t * Filters dimensions to constrain down-sampled images to.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param int[] $dimensions     {\n\t *     An array of width and height values.\n\t *\n\t *     @type int $0 The width in pixels.\n\t *     @type int $1 The height in pixels.\n\t * }\n\t * @param int   $current_width  The current width of the image.\n\t * @param int   $current_height The current height of the image.\n\t * @param int   $max_width      The maximum width permitted.\n\t * @param int   $max_height     The maximum height permitted.\n\t */\n\treturn apply_filters( 'wp_constrain_dimensions', array( $w, $h ), $current_width, $current_height, $max_width, $max_height );\n}\n\n/**\n * Retrieves calculated resize dimensions for use in WP_Image_Editor.\n *\n * Calculates dimensions and coordinates for a resized image that fits\n * within a specified width and height.\n *\n * Cropping behavior is dependent on the value of $crop:\n * 1. If false (default), images will not be cropped.\n * 2. If an array in the form of array( x_crop_position, y_crop_position ):\n *    - x_crop_position accepts 'left' 'center', or 'right'.\n *    - y_crop_position accepts 'top', 'center', or 'bottom'.\n *    Images will be cropped to the specified dimensions within the defined crop area.\n * 3. If true, images will be cropped to the specified dimensions using center positions.\n *\n * @since 2.5.0\n *\n * @param int        $orig_w Original width in pixels.\n * @param int        $orig_h Original height in pixels.\n * @param int        $dest_w New width in pixels.\n * @param int        $dest_h New height in pixels.\n * @param bool|array $crop   Optional. Whether to crop image to specified width and height or resize.\n *                           An array can specify positioning of the crop area. Default false.\n * @return array|false Returned array matches parameters for `imagecopyresampled()`. False on failure.\n */\nfunction image_resize_dimensions( $orig_w, $orig_h, $dest_w, $dest_h, $crop = false ) {\n\n\tif ( $orig_w <= 0 || $orig_h <= 0 ) {\n\t\treturn false;\n\t}\n\t// At least one of $dest_w or $dest_h must be specific.\n\tif ( $dest_w <= 0 && $dest_h <= 0 ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Filters whether to preempt calculating the image resize dimensions.\n\t *\n\t * Returning a non-null value from the filter will effectively short-circuit\n\t * image_resize_dimensions(), returning that value instead.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param null|mixed $null   Whether to preempt output of the resize dimensions.\n\t * @param int        $orig_w Original width in pixels.\n\t * @param int        $orig_h Original height in pixels.\n\t * @param int        $dest_w New width in pixels.\n\t * @param int        $dest_h New height in pixels.\n\t * @param bool|array $crop   Whether to crop image to specified width and height or resize.\n\t *                           An array can specify positioning of the crop area. Default false.\n\t */\n\t$output = apply_filters( 'image_resize_dimensions', null, $orig_w, $orig_h, $dest_w, $dest_h, $crop );\n\n\tif ( null !== $output ) {\n\t\treturn $output;\n\t}\n\n\t// Stop if the destination size is larger than the original image dimensions.\n\tif ( empty( $dest_h ) ) {\n\t\tif ( $orig_w < $dest_w ) {\n\t\t\treturn false;\n\t\t}\n\t} elseif ( empty( $dest_w ) ) {\n\t\tif ( $orig_h < $dest_h ) {\n\t\t\treturn false;\n\t\t}\n\t} else {\n\t\tif ( $orig_w < $dest_w && $orig_h < $dest_h ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif ( $crop ) {\n\t\t/*\n\t\t * Crop the largest possible portion of the original image that we can size to $dest_w x $dest_h.\n\t\t * Note that the requested crop dimensions are used as a maximum bounding box for the original image.\n\t\t * If the original image's width or height is less than the requested width or height\n\t\t * only the greater one will be cropped.\n\t\t * For example when the original image is 600x300, and the requested crop dimensions are 400x400,\n\t\t * the resulting image will be 400x300.\n\t\t */\n\t\t$aspect_ratio = $orig_w / $orig_h;\n\t\t$new_w        = min( $dest_w, $orig_w );\n\t\t$new_h        = min( $dest_h, $orig_h );\n\n\t\tif ( ! $new_w ) {\n\t\t\t$new_w = (int) round( $new_h * $aspect_ratio );\n\t\t}\n\n\t\tif ( ! $new_h ) {\n\t\t\t$new_h = (int) round( $new_w / $aspect_ratio );\n\t\t}\n\n\t\t$size_ratio = max( $new_w / $orig_w, $new_h / $orig_h );\n\n\t\t$crop_w = round( $new_w / $size_ratio );\n\t\t$crop_h = round( $new_h / $size_ratio );\n\n\t\tif ( ! is_array( $crop ) || count( $crop ) !== 2 ) {\n\t\t\t$crop = array( 'center', 'center' );\n\t\t}\n\n\t\tlist( $x, $y ) = $crop;\n\n\t\tif ( 'left' === $x ) {\n\t\t\t$s_x = 0;\n\t\t} elseif ( 'right' === $x ) {\n\t\t\t$s_x = $orig_w - $crop_w;\n\t\t} else {\n\t\t\t$s_x = floor( ( $orig_w - $crop_w ) / 2 );\n\t\t}\n\n\t\tif ( 'top' === $y ) {\n\t\t\t$s_y = 0;\n\t\t} elseif ( 'bottom' === $y ) {\n\t\t\t$s_y = $orig_h - $crop_h;\n\t\t} else {\n\t\t\t$s_y = floor( ( $orig_h - $crop_h ) / 2 );\n\t\t}\n\t} else {\n\t\t// Resize using $dest_w x $dest_h as a maximum bounding box.\n\t\t$crop_w = $orig_w;\n\t\t$crop_h = $orig_h;\n\n\t\t$s_x = 0;\n\t\t$s_y = 0;\n\n\t\tlist( $new_w, $new_h ) = wp_constrain_dimensions( $orig_w, $orig_h, $dest_w, $dest_h );\n\t}\n\n\tif ( wp_fuzzy_number_match( $new_w, $orig_w ) && wp_fuzzy_number_match( $new_h, $orig_h ) ) {\n\t\t// The new size has virtually the same dimensions as the original image.\n\n\t\t/**\n\t\t * Filters whether to proceed with making an image sub-size with identical dimensions\n\t\t * with the original/source image. Differences of 1px may be due to rounding and are ignored.\n\t\t *\n\t\t * @since 5.3.0\n\t\t *\n\t\t * @param bool $proceed The filtered value.\n\t\t * @param int  $orig_w  Original image width.\n\t\t * @param int  $orig_h  Original image height.\n\t\t */\n\t\t$proceed = (bool) apply_filters( 'wp_image_resize_identical_dimensions', false, $orig_w, $orig_h );\n\n\t\tif ( ! $proceed ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// The return array matches the parameters to imagecopyresampled().\n\t// int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h\n\treturn array( 0, 0, (int) $s_x, (int) $s_y, (int) $new_w, (int) $new_h, (int) $crop_w, (int) $crop_h );\n}\n\n/**\n * Resizes an image to make a thumbnail or intermediate size.\n *\n * The returned array has the file size, the image width, and image height. The\n * {@see 'image_make_intermediate_size'} filter can be used to hook in and change the\n * values of the returned array. The only parameter is the resized file path.\n *\n * @since 2.5.0\n *\n * @param string $file   File path.\n * @param int    $width  Image width.\n * @param int    $height Image height.\n * @param bool   $crop   Optional. Whether to crop image to specified width and height or resize.\n *                       Default false.\n * @return array|false Metadata array on success. False if no image was created.\n */\nfunction image_make_intermediate_size( $file, $width, $height, $crop = false ) {\n\tif ( $width || $height ) {\n\t\t$editor = wp_get_image_editor( $file );\n\n\t\tif ( is_wp_error( $editor ) || is_wp_error( $editor->resize( $width, $height, $crop ) ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$resized_file = $editor->save();\n\n\t\tif ( ! is_wp_error( $resized_file ) && $resized_file ) {\n\t\t\tunset( $resized_file['path'] );\n\t\t\treturn $resized_file;\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Helper function to test if aspect ratios for two images match.\n *\n * @since 4.6.0\n *\n * @param int $source_width  Width of the first image in pixels.\n * @param int $source_height Height of the first image in pixels.\n * @param int $target_width  Width of the second image in pixels.\n * @param int $target_height Height of the second image in pixels.\n * @return bool True if aspect ratios match within 1px. False if not.\n */\nfunction wp_image_matches_ratio( $source_width, $source_height, $target_width, $target_height ) {\n\t/*\n\t * To test for varying crops, we constrain the dimensions of the larger image\n\t * to the dimensions of the smaller image and see if they match.\n\t */\n\tif ( $source_width > $target_width ) {\n\t\t$constrained_size = wp_constrain_dimensions( $source_width, $source_height, $target_width );\n\t\t$expected_size    = array( $target_width, $target_height );\n\t} else {\n\t\t$constrained_size = wp_constrain_dimensions( $target_width, $target_height, $source_width );\n\t\t$expected_size    = array( $source_width, $source_height );\n\t}\n\n\t// If the image dimensions are within 1px of the expected size, we consider it a match.\n\t$matched = ( wp_fuzzy_number_match( $constrained_size[0], $expected_size[0] ) && wp_fuzzy_number_match( $constrained_size[1], $expected_size[1] ) );\n\n\treturn $matched;\n}\n\n/**\n * Retrieves the image's intermediate size (resized) path, width, and height.\n *\n * The $size parameter can be an array with the width and height respectively.\n * If the size matches the 'sizes' metadata array for width and height, then it\n * will be used. If there is no direct match, then the nearest image size larger\n * than the specified size will be used. If nothing is found, then the function\n * will break out and return false.\n *\n * The metadata 'sizes' is used for compatible sizes that can be used for the\n * parameter $size value.\n *\n * The url path will be given, when the $size parameter is a string.\n *\n * If you are passing an array for the $size, you should consider using\n * add_image_size() so that a cropped version is generated. It's much more\n * efficient than having to find the closest-sized image and then having the\n * browser scale down the image.\n *\n * @since 2.5.0\n *\n * @param int          $post_id Attachment ID.\n * @param array|string $size    Optional. Image size. Accepts any valid image size, or an array\n *                              of width and height values in pixels (in that order).\n *                              Default 'thumbnail'.\n * @return array|false {\n *     Array of file relative path, width, and height on success. Additionally includes absolute\n *     path and URL if registered size is passed to $size parameter. False on failure.\n *\n *     @type string $file   Image's path relative to uploads directory\n *     @type int    $width  Width of image\n *     @type int    $height Height of image\n *     @type string $path   Image's absolute filesystem path.\n *     @type string $url    Image's URL.\n * }\n */\nfunction image_get_intermediate_size( $post_id, $size = 'thumbnail' ) {\n\t$imagedata = wp_get_attachment_metadata( $post_id );\n\n\tif ( ! $size || ! is_array( $imagedata ) || empty( $imagedata['sizes'] ) ) {\n\t\treturn false;\n\t}\n\n\t$data = array();\n\n\t// Find the best match when '$size' is an array.\n\tif ( is_array( $size ) ) {\n\t\t$candidates = array();\n\n\t\tif ( ! isset( $imagedata['file'] ) && isset( $imagedata['sizes']['full'] ) ) {\n\t\t\t$imagedata['height'] = $imagedata['sizes']['full']['height'];\n\t\t\t$imagedata['width']  = $imagedata['sizes']['full']['width'];\n\t\t}\n\n\t\tforeach ( $imagedata['sizes'] as $_size => $data ) {\n\t\t\t// If there's an exact match to an existing image size, short circuit.\n\t\t\tif ( intval( $data['width'] ) === intval( $size[0] ) && intval( $data['height'] ) === intval( $size[1] ) ) {\n\t\t\t\t$candidates[ $data['width'] * $data['height'] ] = $data;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// If it's not an exact match, consider larger sizes with the same aspect ratio.\n\t\t\tif ( $data['width'] >= $size[0] && $data['height'] >= $size[1] ) {\n\t\t\t\t// If '0' is passed to either size, we test ratios against the original file.\n\t\t\t\tif ( 0 === $size[0] || 0 === $size[1] ) {\n\t\t\t\t\t$same_ratio = wp_image_matches_ratio( $data['width'], $data['height'], $imagedata['width'], $imagedata['height'] );\n\t\t\t\t} else {\n\t\t\t\t\t$same_ratio = wp_image_matches_ratio( $data['width'], $data['height'], $size[0], $size[1] );\n\t\t\t\t}\n\n\t\t\t\tif ( $same_ratio ) {\n\t\t\t\t\t$candidates[ $data['width'] * $data['height'] ] = $data;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $candidates ) ) {\n\t\t\t// Sort the array by size if we have more than one candidate.\n\t\t\tif ( 1 < count( $candidates ) ) {\n\t\t\t\tksort( $candidates );\n\t\t\t}\n\n\t\t\t$data = array_shift( $candidates );\n\t\t\t/*\n\t\t\t* When the size requested is smaller than the thumbnail dimensions, we\n\t\t\t* fall back to the thumbnail size to maintain backward compatibility with\n\t\t\t* pre 4.6 versions of WordPress.\n\t\t\t*/\n\t\t} elseif ( ! empty( $imagedata['sizes']['thumbnail'] ) && $imagedata['sizes']['thumbnail']['width'] >= $size[0] && $imagedata['sizes']['thumbnail']['width'] >= $size[1] ) {\n\t\t\t$data = $imagedata['sizes']['thumbnail'];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Constrain the width and height attributes to the requested values.\n\t\tlist( $data['width'], $data['height'] ) = image_constrain_size_for_editor( $data['width'], $data['height'], $size );\n\n\t} elseif ( ! empty( $imagedata['sizes'][ $size ] ) ) {\n\t\t$data = $imagedata['sizes'][ $size ];\n\t}\n\n\t// If we still don't have a match at this point, return false.\n\tif ( empty( $data ) ) {\n\t\treturn false;\n\t}\n\n\t// Include the full filesystem path of the intermediate file.\n\tif ( empty( $data['path'] ) && ! empty( $data['file'] ) && ! empty( $imagedata['file'] ) ) {\n\t\t$file_url     = wp_get_attachment_url( $post_id );\n\t\t$data['path'] = path_join( dirname( $imagedata['file'] ), $data['file'] );\n\t\t$data['url']  = path_join( dirname( $file_url ), $data['file'] );\n\t}\n\n\t/**\n\t * Filters the output of image_get_intermediate_size()\n\t *\n\t * @since 4.4.0\n\t *\n\t * @see image_get_intermediate_size()\n\t *\n\t * @param array        $data    Array of file relative path, width, and height on success. May also include\n\t *                              file absolute path and URL.\n\t * @param int          $post_id The post_id of the image attachment\n\t * @param string|array $size    Registered image size or flat array of initially-requested height and width\n\t *                              dimensions (in that order).\n\t */\n\treturn apply_filters( 'image_get_intermediate_size', $data, $post_id, $size );\n}\n\n/**\n * Gets the available intermediate image size names.\n *\n * @since 3.0.0\n *\n * @return string[] An array of image size names.\n */\nfunction get_intermediate_image_sizes() {\n\t$default_sizes    = array( 'thumbnail', 'medium', 'medium_large', 'large' );\n\t$additional_sizes = wp_get_additional_image_sizes();\n\n\tif ( ! empty( $additional_sizes ) ) {\n\t\t$default_sizes = array_merge( $default_sizes, array_keys( $additional_sizes ) );\n\t}\n\n\t/**\n\t * Filters the list of intermediate image sizes.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string[] $default_sizes An array of intermediate image size names. Defaults\n\t *                                are 'thumbnail', 'medium', 'medium_large', 'large'.\n\t */\n\treturn apply_filters( 'intermediate_image_sizes', $default_sizes );\n}\n\n/**\n * Returns a normalized list of all currently registered image sub-sizes.\n *\n * @since 5.3.0\n * @uses wp_get_additional_image_sizes()\n * @uses get_intermediate_image_sizes()\n *\n * @return array Associative array of the registered image sub-sizes.\n */\nfunction wp_get_registered_image_subsizes() {\n\t$additional_sizes = wp_get_additional_image_sizes();\n\t$all_sizes        = array();\n\n\tforeach ( get_intermediate_image_sizes() as $size_name ) {\n\t\t$size_data = array(\n\t\t\t'width'  => 0,\n\t\t\t'height' => 0,\n\t\t\t'crop'   => false,\n\t\t);\n\n\t\tif ( isset( $additional_sizes[ $size_name ]['width'] ) ) {\n\t\t\t// For sizes added by plugins and themes.\n\t\t\t$size_data['width'] = intval( $additional_sizes[ $size_name ]['width'] );\n\t\t} else {\n\t\t\t// For default sizes set in options.\n\t\t\t$size_data['width'] = intval( get_option( \"{$size_name}_size_w\" ) );\n\t\t}\n\n\t\tif ( isset( $additional_sizes[ $size_name ]['height'] ) ) {\n\t\t\t$size_data['height'] = intval( $additional_sizes[ $size_name ]['height'] );\n\t\t} else {\n\t\t\t$size_data['height'] = intval( get_option( \"{$size_name}_size_h\" ) );\n\t\t}\n\n\t\tif ( empty( $size_data['width'] ) && empty( $size_data['height'] ) ) {\n\t\t\t// This size isn't set.\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( isset( $additional_sizes[ $size_name ]['crop'] ) ) {\n\t\t\t$size_data['crop'] = $additional_sizes[ $size_name ]['crop'];\n\t\t} else {\n\t\t\t$size_data['crop'] = get_option( \"{$size_name}_crop\" );\n\t\t}\n\n\t\tif ( ! is_array( $size_data['crop'] ) || empty( $size_data['crop'] ) ) {\n\t\t\t$size_data['crop'] = (bool) $size_data['crop'];\n\t\t}\n\n\t\t$all_sizes[ $size_name ] = $size_data;\n\t}\n\n\treturn $all_sizes;\n}\n\n/**\n * Retrieves an image to represent an attachment.\n *\n * @since 2.5.0\n *\n * @param int          $attachment_id Image attachment ID.\n * @param string|int[] $size          Optional. Image size. Accepts any valid image size name, or an array of width\n *                                    and height values in pixels (in that order). Default 'thumbnail'.\n * @param bool         $icon          Optional. Whether the image should fall back to a mime type icon. Default false.\n * @return array|false {\n *     Array of image data, or boolean false if no image is available.\n *\n *     @type string $0 Image source URL.\n *     @type int    $1 Image width in pixels.\n *     @type int    $2 Image height in pixels.\n *     @type bool   $3 Whether the image is a resized image.\n * }\n */\nfunction wp_get_attachment_image_src( $attachment_id, $size = 'thumbnail', $icon = false ) {\n\t// Get a thumbnail or intermediate image if there is one.\n\t$image = image_downsize( $attachment_id, $size );\n\tif ( ! $image ) {\n\t\t$src = false;\n\n\t\tif ( $icon ) {\n\t\t\t$src = wp_mime_type_icon( $attachment_id );\n\n\t\t\tif ( $src ) {\n\t\t\t\t/** This filter is documented in wp-includes/post.php */\n\t\t\t\t$icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' );\n\n\t\t\t\t$src_file               = $icon_dir . '/' . wp_basename( $src );\n\t\t\t\tlist( $width, $height ) = @getimagesize( $src_file );\n\t\t\t}\n\t\t}\n\n\t\tif ( $src && $width && $height ) {\n\t\t\t$image = array( $src, $width, $height, false );\n\t\t}\n\t}\n\t/**\n\t * Filters the attachment image source result.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param array|false  $image         {\n\t *     Array of image data, or boolean false if no image is available.\n\t *\n\t *     @type string $0 Image source URL.\n\t *     @type int    $1 Image width in pixels.\n\t *     @type int    $2 Image height in pixels.\n\t *     @type bool   $3 Whether the image is a resized image.\n\t * }\n\t * @param int          $attachment_id Image attachment ID.\n\t * @param string|int[] $size          Requested size of image. Image size name, or array of width\n\t *                                    and height values (in that order).\n\t * @param bool         $icon          Whether the image should be treated as an icon.\n\t */\n\treturn apply_filters( 'wp_get_attachment_image_src', $image, $attachment_id, $size, $icon );\n}\n\n/**\n * Get an HTML img element representing an image attachment\n *\n * While `$size` will accept an array, it is better to register a size with\n * add_image_size() so that a cropped version is generated. It's much more\n * efficient than having to find the closest-sized image and then having the\n * browser scale down the image.\n *\n * @since 2.5.0\n * @since 4.4.0 The `$srcset` and `$sizes` attributes were added.\n * @since 5.5.0 The `$loading` attribute was added.\n *\n * @param int          $attachment_id Image attachment ID.\n * @param string|array $size          Optional. Image size. Accepts any valid image size, or an array of width\n *                                    and height values in pixels (in that order). Default 'thumbnail'.\n * @param bool         $icon          Optional. Whether the image should be treated as an icon. Default false.\n * @param string|array $attr {\n *     Optional. Attributes for the image markup.\n *\n *     @type string       $src     Image attachment URL.\n *     @type string       $class   CSS class name or space-separated list of classes.\n *                                 Default `attachment-$size_class size-$size_class`,\n *                                 where `$size_class` is the image size being requested.\n *     @type string       $alt     Image description for the alt attribute.\n *     @type string       $srcset  The 'srcset' attribute value.\n *     @type string       $sizes   The 'sizes' attribute value.\n *     @type string|false $loading The 'loading' attribute value. Passing a value of false\n *                                 will result in the attribute being omitted for the image.\n *                                 Defaults to 'lazy', depending on wp_lazy_loading_enabled().\n * }\n * @return string HTML img element or empty string on failure.\n */\nfunction wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = false, $attr = '' ) {\n\t$html  = '';\n\t$image = wp_get_attachment_image_src( $attachment_id, $size, $icon );\n\n\tif ( $image ) {\n\t\tlist( $src, $width, $height ) = $image;\n\n\t\t$attachment = get_post( $attachment_id );\n\t\t$hwstring   = image_hwstring( $width, $height );\n\t\t$size_class = $size;\n\n\t\tif ( is_array( $size_class ) ) {\n\t\t\t$size_class = join( 'x', $size_class );\n\t\t}\n\n\t\t$default_attr = array(\n\t\t\t'src'   => $src,\n\t\t\t'class' => \"attachment-$size_class size-$size_class\",\n\t\t\t'alt'   => trim( strip_tags( get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) ) ),\n\t\t);\n\n\t\t// Add `loading` attribute.\n\t\tif ( wp_lazy_loading_enabled( 'img', 'wp_get_attachment_image' ) ) {\n\t\t\t$default_attr['loading'] = 'lazy';\n\t\t}\n\n\t\t$attr = wp_parse_args( $attr, $default_attr );\n\n\t\t// If the default value of `lazy` for the `loading` attribute is overridden\n\t\t// to omit the attribute for this image, ensure it is not included.\n\t\tif ( array_key_exists( 'loading', $attr ) && ! $attr['loading'] ) {\n\t\t\tunset( $attr['loading'] );\n\t\t}\n\n\t\t// Generate 'srcset' and 'sizes' if not already present.\n\t\tif ( empty( $attr['srcset'] ) ) {\n\t\t\t$image_meta = wp_get_attachment_metadata( $attachment_id );\n\n\t\t\tif ( is_array( $image_meta ) ) {\n\t\t\t\t$size_array = array( absint( $width ), absint( $height ) );\n\t\t\t\t$srcset     = wp_calculate_image_srcset( $size_array, $src, $image_meta, $attachment_id );\n\t\t\t\t$sizes      = wp_calculate_image_sizes( $size_array, $src, $image_meta, $attachment_id );\n\n\t\t\t\tif ( $srcset && ( $sizes || ! empty( $attr['sizes'] ) ) ) {\n\t\t\t\t\t$attr['srcset'] = $srcset;\n\n\t\t\t\t\tif ( empty( $attr['sizes'] ) ) {\n\t\t\t\t\t\t$attr['sizes'] = $sizes;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the list of attachment image attributes.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param array        $attr       Array of attribute values for the image markup, keyed by attribute name.\n\t\t *                                 See wp_get_attachment_image().\n\t\t * @param WP_Post      $attachment Image attachment post.\n\t\t * @param string|array $size       Requested size. Image size or array of width and height values\n\t\t *                                 (in that order). Default 'thumbnail'.\n\t\t */\n\t\t$attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment, $size );\n\n\t\t$attr = array_map( 'esc_attr', $attr );\n\t\t$html = rtrim( \"<img $hwstring\" );\n\n\t\tforeach ( $attr as $name => $value ) {\n\t\t\t$html .= \" $name=\" . '\"' . $value . '\"';\n\t\t}\n\n\t\t$html .= ' />';\n\t}\n\n\treturn $html;\n}\n\n/**\n * Get the URL of an image attachment.\n *\n * @since 4.4.0\n *\n * @param int          $attachment_id Image attachment ID.\n * @param string|array $size          Optional. Image size to retrieve. Accepts any valid image size, or an array\n *                                    of width and height values in pixels (in that order). Default 'thumbnail'.\n * @param bool         $icon          Optional. Whether the image should be treated as an icon. Default false.\n * @return string|false Attachment URL or false if no image is available.\n */\nfunction wp_get_attachment_image_url( $attachment_id, $size = 'thumbnail', $icon = false ) {\n\t$image = wp_get_attachment_image_src( $attachment_id, $size, $icon );\n\treturn isset( $image['0'] ) ? $image['0'] : false;\n}\n\n/**\n * Get the attachment path relative to the upload directory.\n *\n * @since 4.4.1\n * @access private\n *\n * @param string $file Attachment file name.\n * @return string Attachment path relative to the upload directory.\n */\nfunction _wp_get_attachment_relative_path( $file ) {\n\t$dirname = dirname( $file );\n\n\tif ( '.' === $dirname ) {\n\t\treturn '';\n\t}\n\n\tif ( false !== strpos( $dirname, 'wp-content/uploads' ) ) {\n\t\t// Get the directory name relative to the upload directory (back compat for pre-2.7 uploads).\n\t\t$dirname = substr( $dirname, strpos( $dirname, 'wp-content/uploads' ) + 18 );\n\t\t$dirname = ltrim( $dirname, '/' );\n\t}\n\n\treturn $dirname;\n}\n\n/**\n * Get the image size as array from its meta data.\n *\n * Used for responsive images.\n *\n * @since 4.4.0\n * @access private\n *\n * @param string $size_name  Image size. Accepts any valid image size name ('thumbnail', 'medium', etc.).\n * @param array  $image_meta The image meta data.\n * @return array|bool The image meta data as returned by `wp_get_attachment_metadata()`.\n */\nfunction _wp_get_image_size_from_meta( $size_name, $image_meta ) {\n\tif ( 'full' === $size_name ) {\n\t\treturn array(\n\t\t\tabsint( $image_meta['width'] ),\n\t\t\tabsint( $image_meta['height'] ),\n\t\t);\n\t} elseif ( ! empty( $image_meta['sizes'][ $size_name ] ) ) {\n\t\treturn array(\n\t\t\tabsint( $image_meta['sizes'][ $size_name ]['width'] ),\n\t\t\tabsint( $image_meta['sizes'][ $size_name ]['height'] ),\n\t\t);\n\t}\n\n\treturn false;\n}\n\n/**\n * Retrieves the value for an image attachment's 'srcset' attribute.\n *\n * @since 4.4.0\n *\n * @see wp_calculate_image_srcset()\n *\n * @param int          $attachment_id Image attachment ID.\n * @param array|string $size          Optional. Image size. Accepts any valid image size, or an array of\n *                                    width and height values in pixels (in that order). Default 'medium'.\n * @param array        $image_meta    Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.\n *                                    Default null.\n * @return string|bool A 'srcset' value string or false.\n */\nfunction wp_get_attachment_image_srcset( $attachment_id, $size = 'medium', $image_meta = null ) {\n\t$image = wp_get_attachment_image_src( $attachment_id, $size );\n\n\tif ( ! $image ) {\n\t\treturn false;\n\t}\n\n\tif ( ! is_array( $image_meta ) ) {\n\t\t$image_meta = wp_get_attachment_metadata( $attachment_id );\n\t}\n\n\t$image_src  = $image[0];\n\t$size_array = array(\n\t\tabsint( $image[1] ),\n\t\tabsint( $image[2] ),\n\t);\n\n\treturn wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attachment_id );\n}\n\n/**\n * A helper function to calculate the image sources to include in a 'srcset' attribute.\n *\n * @since 4.4.0\n *\n * @param int[]  $size_array    {\n *     An array of width and height values.\n *\n *     @type int $0 The width in pixels.\n *     @type int $1 The height in pixels.\n * }\n * @param string $image_src     The 'src' of the image.\n * @param array  $image_meta    The image meta data as returned by 'wp_get_attachment_metadata()'.\n * @param int    $attachment_id Optional. The image attachment ID. Default 0.\n * @return string|bool          The 'srcset' attribute value. False on error or when only one source exists.\n */\nfunction wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attachment_id = 0 ) {\n\t/**\n\t * Let plugins pre-filter the image meta to be able to fix inconsistencies in the stored data.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param array  $image_meta    The image meta data as returned by 'wp_get_attachment_metadata()'.\n\t * @param int[]  $size_array    {\n\t *     An array of requested width and height values.\n\t *\n\t *     @type int $0 The width in pixels.\n\t *     @type int $1 The height in pixels.\n\t * }\n\t * @param string $image_src     The 'src' of the image.\n\t * @param int    $attachment_id The image attachment ID or 0 if not supplied.\n\t */\n\t$image_meta = apply_filters( 'wp_calculate_image_srcset_meta', $image_meta, $size_array, $image_src, $attachment_id );\n\n\tif ( empty( $image_meta['sizes'] ) || ! isset( $image_meta['file'] ) || strlen( $image_meta['file'] ) < 4 ) {\n\t\treturn false;\n\t}\n\n\t$image_sizes = $image_meta['sizes'];\n\n\t// Get the width and height of the image.\n\t$image_width  = (int) $size_array[0];\n\t$image_height = (int) $size_array[1];\n\n\t// Bail early if error/no width.\n\tif ( $image_width < 1 ) {\n\t\treturn false;\n\t}\n\n\t$image_basename = wp_basename( $image_meta['file'] );\n\n\t/*\n\t * WordPress flattens animated GIFs into one frame when generating intermediate sizes.\n\t * To avoid hiding animation in user content, if src is a full size GIF, a srcset attribute is not generated.\n\t * If src is an intermediate size GIF, the full size is excluded from srcset to keep a flattened GIF from becoming animated.\n\t */\n\tif ( ! isset( $image_sizes['thumbnail']['mime-type'] ) || 'image/gif' !== $image_sizes['thumbnail']['mime-type'] ) {\n\t\t$image_sizes[] = array(\n\t\t\t'width'  => $image_meta['width'],\n\t\t\t'height' => $image_meta['height'],\n\t\t\t'file'   => $image_basename,\n\t\t);\n\t} elseif ( strpos( $image_src, $image_meta['file'] ) ) {\n\t\treturn false;\n\t}\n\n\t// Retrieve the uploads sub-directory from the full size image.\n\t$dirname = _wp_get_attachment_relative_path( $image_meta['file'] );\n\n\tif ( $dirname ) {\n\t\t$dirname = trailingslashit( $dirname );\n\t}\n\n\t$upload_dir    = wp_get_upload_dir();\n\t$image_baseurl = trailingslashit( $upload_dir['baseurl'] ) . $dirname;\n\n\t/*\n\t * If currently on HTTPS, prefer HTTPS URLs when we know they're supported by the domain\n\t * (which is to say, when they share the domain name of the current request).\n\t */\n\tif ( is_ssl() && 'https' !== substr( $image_baseurl, 0, 5 ) && parse_url( $image_baseurl, PHP_URL_HOST ) === $_SERVER['HTTP_HOST'] ) {\n\t\t$image_baseurl = set_url_scheme( $image_baseurl, 'https' );\n\t}\n\n\t/*\n\t * Images that have been edited in WordPress after being uploaded will\n\t * contain a unique hash. Look for that hash and use it later to filter\n\t * out images that are leftovers from previous versions.\n\t */\n\t$image_edited = preg_match( '/-e[0-9]{13}/', wp_basename( $image_src ), $image_edit_hash );\n\n\t/**\n\t * Filters the maximum image width to be included in a 'srcset' attribute.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param int   $max_width  The maximum image width to be included in the 'srcset'. Default '2048'.\n\t * @param int[] $size_array {\n\t *     An array of requested width and height values.\n\t *\n\t *     @type int $0 The width in pixels.\n\t *     @type int $1 The height in pixels.\n\t * }\n\t */\n\t$max_srcset_image_width = apply_filters( 'max_srcset_image_width', 2048, $size_array );\n\n\t// Array to hold URL candidates.\n\t$sources = array();\n\n\t/**\n\t * To make sure the ID matches our image src, we will check to see if any sizes in our attachment\n\t * meta match our $image_src. If no matches are found we don't return a srcset to avoid serving\n\t * an incorrect image. See #35045.\n\t */\n\t$src_matched = false;\n\n\t/*\n\t * Loop through available images. Only use images that are resized\n\t * versions of the same edit.\n\t */\n\tforeach ( $image_sizes as $image ) {\n\t\t$is_src = false;\n\n\t\t// Check if image meta isn't corrupted.\n\t\tif ( ! is_array( $image ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// If the file name is part of the `src`, we've confirmed a match.\n\t\tif ( ! $src_matched && false !== strpos( $image_src, $dirname . $image['file'] ) ) {\n\t\t\t$src_matched = true;\n\t\t\t$is_src      = true;\n\t\t}\n\n\t\t// Filter out images that are from previous edits.\n\t\tif ( $image_edited && ! strpos( $image['file'], $image_edit_hash[0] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t/*\n\t\t * Filters out images that are wider than '$max_srcset_image_width' unless\n\t\t * that file is in the 'src' attribute.\n\t\t */\n\t\tif ( $max_srcset_image_width && $image['width'] > $max_srcset_image_width && ! $is_src ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// If the image dimensions are within 1px of the expected size, use it.\n\t\tif ( wp_image_matches_ratio( $image_width, $image_height, $image['width'], $image['height'] ) ) {\n\t\t\t// Add the URL, descriptor, and value to the sources array to be returned.\n\t\t\t$source = array(\n\t\t\t\t'url'        => $image_baseurl . $image['file'],\n\t\t\t\t'descriptor' => 'w',\n\t\t\t\t'value'      => $image['width'],\n\t\t\t);\n\n\t\t\t// The 'src' image has to be the first in the 'srcset', because of a bug in iOS8. See #35030.\n\t\t\tif ( $is_src ) {\n\t\t\t\t$sources = array( $image['width'] => $source ) + $sources;\n\t\t\t} else {\n\t\t\t\t$sources[ $image['width'] ] = $source;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filters an image's 'srcset' sources.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array  $sources {\n\t *     One or more arrays of source data to include in the 'srcset'.\n\t *\n\t *     @type array $width {\n\t *         @type string $url        The URL of an image source.\n\t *         @type string $descriptor The descriptor type used in the image candidate string,\n\t *                                  either 'w' or 'x'.\n\t *         @type int    $value      The source width if paired with a 'w' descriptor, or a\n\t *                                  pixel density value if paired with an 'x' descriptor.\n\t *     }\n\t * }\n\t * @param array $size_array     {\n\t *     An array of requested width and height values.\n\t *\n\t *     @type int $0 The width in pixels.\n\t *     @type int $1 The height in pixels.\n\t * }\n\t * @param string $image_src     The 'src' of the image.\n\t * @param array  $image_meta    The image meta data as returned by 'wp_get_attachment_metadata()'.\n\t * @param int    $attachment_id Image attachment ID or 0.\n\t */\n\t$sources = apply_filters( 'wp_calculate_image_srcset', $sources, $size_array, $image_src, $image_meta, $attachment_id );\n\n\t// Only return a 'srcset' value if there is more than one source.\n\tif ( ! $src_matched || ! is_array( $sources ) || count( $sources ) < 2 ) {\n\t\treturn false;\n\t}\n\n\t$srcset = '';\n\n\tforeach ( $sources as $source ) {\n\t\t$srcset .= str_replace( ' ', '%20', $source['url'] ) . ' ' . $source['value'] . $source['descriptor'] . ', ';\n\t}\n\n\treturn rtrim( $srcset, ', ' );\n}\n\n/**\n * Retrieves the value for an image attachment's 'sizes' attribute.\n *\n * @since 4.4.0\n *\n * @see wp_calculate_image_sizes()\n *\n * @param int          $attachment_id Image attachment ID.\n * @param array|string $size          Optional. Image size. Accepts any valid image size, or an array of width\n *                                    and height values in pixels (in that order). Default 'medium'.\n * @param array        $image_meta    Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.\n *                                    Default null.\n * @return string|bool A valid source size value for use in a 'sizes' attribute or false.\n */\nfunction wp_get_attachment_image_sizes( $attachment_id, $size = 'medium', $image_meta = null ) {\n\t$image = wp_get_attachment_image_src( $attachment_id, $size );\n\n\tif ( ! $image ) {\n\t\treturn false;\n\t}\n\n\tif ( ! is_array( $image_meta ) ) {\n\t\t$image_meta = wp_get_attachment_metadata( $attachment_id );\n\t}\n\n\t$image_src  = $image[0];\n\t$size_array = array(\n\t\tabsint( $image[1] ),\n\t\tabsint( $image[2] ),\n\t);\n\n\treturn wp_calculate_image_sizes( $size_array, $image_src, $image_meta, $attachment_id );\n}\n\n/**\n * Creates a 'sizes' attribute value for an image.\n *\n * @since 4.4.0\n *\n * @param array|string $size          Image size to retrieve. Accepts any valid image size, or an array\n *                                    of width and height values in pixels (in that order). Default 'medium'.\n * @param string       $image_src     Optional. The URL to the image file. Default null.\n * @param array        $image_meta    Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.\n *                                    Default null.\n * @param int          $attachment_id Optional. Image attachment ID. Either `$image_meta` or `$attachment_id`\n *                                    is needed when using the image size name as argument for `$size`. Default 0.\n * @return string|bool A valid source size value for use in a 'sizes' attribute or false.\n */\nfunction wp_calculate_image_sizes( $size, $image_src = null, $image_meta = null, $attachment_id = 0 ) {\n\t$width = 0;\n\n\tif ( is_array( $size ) ) {\n\t\t$width = absint( $size[0] );\n\t} elseif ( is_string( $size ) ) {\n\t\tif ( ! $image_meta && $attachment_id ) {\n\t\t\t$image_meta = wp_get_attachment_metadata( $attachment_id );\n\t\t}\n\n\t\tif ( is_array( $image_meta ) ) {\n\t\t\t$size_array = _wp_get_image_size_from_meta( $size, $image_meta );\n\t\t\tif ( $size_array ) {\n\t\t\t\t$width = absint( $size_array[0] );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! $width ) {\n\t\treturn false;\n\t}\n\n\t// Setup the default 'sizes' attribute.\n\t$sizes = sprintf( '(max-width: %1$dpx) 100vw, %1$dpx', $width );\n\n\t/**\n\t * Filters the output of 'wp_calculate_image_sizes()'.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string       $sizes         A source size value for use in a 'sizes' attribute.\n\t * @param array|string $size          Requested size. Image size or array of width and height values\n\t *                                    in pixels (in that order).\n\t * @param string|null  $image_src     The URL to the image file or null.\n\t * @param array|null   $image_meta    The image meta data as returned by wp_get_attachment_metadata() or null.\n\t * @param int          $attachment_id Image attachment ID of the original image or 0.\n\t */\n\treturn apply_filters( 'wp_calculate_image_sizes', $sizes, $size, $image_src, $image_meta, $attachment_id );\n}\n\n/**\n * Determines if the image meta data is for the image source file.\n *\n * The image meta data is retrieved by attachment post ID. In some cases the post IDs may change.\n * For example when the website is exported and imported at another website. Then the\n * attachment post IDs that are in post_content for the exported website may not match\n * the same attachments at the new website.\n *\n * @since 5.5.0\n *\n * @param string $image_location The full path or URI to the image file.\n * @param array  $image_meta     The attachment meta data as returned by 'wp_get_attachment_metadata()'.\n * @param int    $attachment_id  Optional. The image attachment ID. Default 0.\n * @return bool Whether the image meta is for this image file.\n */\nfunction wp_image_file_matches_image_meta( $image_location, $image_meta, $attachment_id = 0 ) {\n\t$match = false;\n\n\t// Ensure the $image_meta is valid.\n\tif ( isset( $image_meta['file'] ) && strlen( $image_meta['file'] ) > 4 ) {\n\t\t// Remove quiery args if image URI.\n\t\tlist( $image_location ) = explode( '?', $image_location );\n\n\t\t// Check if the relative image path from the image meta is at the end of $image_location.\n\t\tif ( strrpos( $image_location, $image_meta['file'] ) === strlen( $image_location ) - strlen( $image_meta['file'] ) ) {\n\t\t\t$match = true;\n\t\t} else {\n\t\t\t// Retrieve the uploads sub-directory from the full size image.\n\t\t\t$dirname = _wp_get_attachment_relative_path( $image_meta['file'] );\n\n\t\t\tif ( $dirname ) {\n\t\t\t\t$dirname = trailingslashit( $dirname );\n\t\t\t}\n\n\t\t\tif ( ! empty( $image_meta['original_image'] ) ) {\n\t\t\t\t$relative_path = $dirname . $image_meta['original_image'];\n\n\t\t\t\tif ( strrpos( $image_location, $relative_path ) === strlen( $image_location ) - strlen( $relative_path ) ) {\n\t\t\t\t\t$match = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! $match && ! empty( $image_meta['sizes'] ) ) {\n\t\t\t\tforeach ( $image_meta['sizes'] as $image_size_data ) {\n\t\t\t\t\t$relative_path = $dirname . $image_size_data['file'];\n\n\t\t\t\t\tif ( strrpos( $image_location, $relative_path ) === strlen( $image_location ) - strlen( $relative_path ) ) {\n\t\t\t\t\t\t$match = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filter whether an image path or URI matches image meta.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param bool   $match          Whether the image relative path from the image meta\n\t *                               matches the end of the URI or path to the image file.\n\t * @param string $image_location Full path or URI to the tested image file.\n\t * @param array  $image_meta     The image meta data as returned by 'wp_get_attachment_metadata()'.\n\t * @param int    $attachment_id  The image attachment ID or 0 if not supplied.\n\t */\n\treturn apply_filters( 'wp_image_file_matches_image_meta', $match, $image_location, $image_meta, $attachment_id );\n}\n\n/**\n * Determines an image's width and height dimensions based on the source file.\n *\n * @since 5.5.0\n *\n * @param string $image_src     The image source file.\n * @param array  $image_meta    The image meta data as returned by 'wp_get_attachment_metadata()'.\n * @param int    $attachment_id Optional. The image attachment ID. Default 0.\n * @return array|false Array with first element being the width and second element being the height,\n *                     or false if dimensions cannot be determined.\n */\nfunction wp_image_src_get_dimensions( $image_src, $image_meta, $attachment_id = 0 ) {\n\tif ( ! wp_image_file_matches_image_meta( $image_src, $image_meta, $attachment_id ) ) {\n\t\treturn false;\n\t}\n\n\t// Is it a full size image?\n\tif ( strpos( $image_src, $image_meta['file'] ) !== false ) {\n\t\treturn array(\n\t\t\t(int) $image_meta['width'],\n\t\t\t(int) $image_meta['height'],\n\t\t);\n\t}\n\n\tif ( ! empty( $image_meta['sizes'] ) ) {\n\t\t$src_filename = wp_basename( $image_src );\n\n\t\tforeach ( $image_meta['sizes'] as $image_size_data ) {\n\t\t\tif ( $src_filename === $image_size_data['file'] ) {\n\t\t\t\treturn array(\n\t\t\t\t\t(int) $image_size_data['width'],\n\t\t\t\t\t(int) $image_size_data['height'],\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Adds 'srcset' and 'sizes' attributes to an existing 'img' element.\n *\n * @since 4.4.0\n *\n * @see wp_calculate_image_srcset()\n * @see wp_calculate_image_sizes()\n *\n * @param string $image         An HTML 'img' element to be filtered.\n * @param array  $image_meta    The image meta data as returned by 'wp_get_attachment_metadata()'.\n * @param int    $attachment_id Image attachment ID.\n * @return string Converted 'img' element with 'srcset' and 'sizes' attributes added.\n */\nfunction wp_image_add_srcset_and_sizes( $image, $image_meta, $attachment_id ) {\n\t// Ensure the image meta exists.\n\tif ( empty( $image_meta['sizes'] ) ) {\n\t\treturn $image;\n\t}\n\n\t$image_src         = preg_match( '/src=\"([^\"]+)\"/', $image, $match_src ) ? $match_src[1] : '';\n\tlist( $image_src ) = explode( '?', $image_src );\n\n\t// Return early if we couldn't get the image source.\n\tif ( ! $image_src ) {\n\t\treturn $image;\n\t}\n\n\t// Bail early if an image has been inserted and later edited.\n\tif ( preg_match( '/-e[0-9]{13}/', $image_meta['file'], $img_edit_hash ) &&\n\t\tstrpos( wp_basename( $image_src ), $img_edit_hash[0] ) === false ) {\n\n\t\treturn $image;\n\t}\n\n\t$width  = preg_match( '/ width=\"([0-9]+)\"/', $image, $match_width ) ? (int) $match_width[1] : 0;\n\t$height = preg_match( '/ height=\"([0-9]+)\"/', $image, $match_height ) ? (int) $match_height[1] : 0;\n\n\tif ( $width && $height ) {\n\t\t$size_array = array( $width, $height );\n\t} else {\n\t\t$size_array = wp_image_src_get_dimensions( $image_src, $image_meta, $attachment_id );\n\t\tif ( ! $size_array ) {\n\t\t\treturn $image;\n\t\t}\n\t}\n\n\t$srcset = wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attachment_id );\n\n\tif ( $srcset ) {\n\t\t// Check if there is already a 'sizes' attribute.\n\t\t$sizes = strpos( $image, ' sizes=' );\n\n\t\tif ( ! $sizes ) {\n\t\t\t$sizes = wp_calculate_image_sizes( $size_array, $image_src, $image_meta, $attachment_id );\n\t\t}\n\t}\n\n\tif ( $srcset && $sizes ) {\n\t\t// Format the 'srcset' and 'sizes' string and escape attributes.\n\t\t$attr = sprintf( ' srcset=\"%s\"', esc_attr( $srcset ) );\n\n\t\tif ( is_string( $sizes ) ) {\n\t\t\t$attr .= sprintf( ' sizes=\"%s\"', esc_attr( $sizes ) );\n\t\t}\n\n\t\t// Add the srcset and sizes attributes to the image markup.\n\t\treturn preg_replace( '/<img ([^>]+?)[\\/ ]*>/', '<img $1' . $attr . ' />', $image );\n\t}\n\n\treturn $image;\n}\n\n/**\n * Determine whether to add the `loading` attribute to the specified tag in the specified context.\n *\n * @since 5.5.0\n *\n * @param string $tag_name The tag name.\n * @param string $context  Additional context, like the current filter name or the function name from where this was called.\n * @return bool Whether to add the attribute.\n */\nfunction wp_lazy_loading_enabled( $tag_name, $context ) {\n\t// By default add to all 'img' tags.\n\t// See https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-loading\n\t$default = ( 'img' === $tag_name );\n\n\t/**\n\t * Filters whether to add the `loading` attribute to the specified tag in the specified context.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param bool   $default  Default value.\n\t * @param string $tag_name The tag name.\n\t * @param string $context  Additional context, like the current filter name or the function name from where this was called.\n\t */\n\treturn (bool) apply_filters( 'wp_lazy_loading_enabled', $default, $tag_name, $context );\n}\n\n/**\n * Filters specific tags in post content and modifies their markup.\n *\n * Modifies HTML tags in post content to include new browser and HTML technologies\n * that may not have existed at the time of post creation. These modifications currently\n * include adding `srcset`, `sizes`, and `loading` attributes to `img` HTML tags.\n * Future similar optimizations should be added/expected here.\n *\n * @since 5.5.0\n *\n * @see wp_img_tag_add_width_and_height_attr()\n * @see wp_img_tag_add_srcset_and_sizes_attr()\n * @see wp_img_tag_add_loading_attr()\n *\n * @param string $content The HTML content to be filtered.\n * @param string $context Optional. Additional context to pass to the filters.\n *                        Defaults to `current_filter()` when not set.\n * @return string Converted content with images modified.\n */\nfunction wp_filter_content_tags( $content, $context = null ) {\n\tif ( null === $context ) {\n\t\t$context = current_filter();\n\t}\n\n\t$add_loading_attr = wp_lazy_loading_enabled( 'img', $context );\n\n\tif ( false === strpos( $content, '<img' ) ) {\n\t\treturn $content;\n\t}\n\n\tif ( ! preg_match_all( '/<img\\s[^>]+>/', $content, $matches ) ) {\n\t\treturn $content;\n\t}\n\n\t// List of the unique `img` tags found in $content.\n\t$images = array();\n\n\tforeach ( $matches[0] as $image ) {\n\t\tif ( preg_match( '/wp-image-([0-9]+)/i', $image, $class_id ) ) {\n\t\t\t$attachment_id = absint( $class_id[1] );\n\n\t\t\tif ( $attachment_id ) {\n\t\t\t\t// If exactly the same image tag is used more than once, overwrite it.\n\t\t\t\t// All identical tags will be replaced later with 'str_replace()'.\n\t\t\t\t$images[ $image ] = $attachment_id;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t$images[ $image ] = 0;\n\t}\n\n\t// Reduce the array to unique attachment IDs.\n\t$attachment_ids = array_unique( array_filter( array_values( $images ) ) );\n\n\tif ( count( $attachment_ids ) > 1 ) {\n\t\t/*\n\t\t * Warm the object cache with post and meta information for all found\n\t\t * images to avoid making individual database calls.\n\t\t */\n\t\t_prime_post_caches( $attachment_ids, false, true );\n\t}\n\n\tforeach ( $images as $image => $attachment_id ) {\n\t\t$filtered_image = $image;\n\n\t\t// Add 'width' and 'height' attributes if applicable.\n\t\tif ( $attachment_id > 0 && false === strpos( $filtered_image, ' width=' ) && false === strpos( $filtered_image, ' height=' ) ) {\n\t\t\t$filtered_image = wp_img_tag_add_width_and_height_attr( $filtered_image, $context, $attachment_id );\n\t\t}\n\n\t\t// Add 'srcset' and 'sizes' attributes if applicable.\n\t\tif ( $attachment_id > 0 && false === strpos( $filtered_image, ' srcset=' ) ) {\n\t\t\t$filtered_image = wp_img_tag_add_srcset_and_sizes_attr( $filtered_image, $context, $attachment_id );\n\t\t}\n\n\t\t// Add 'loading' attribute if applicable.\n\t\tif ( $add_loading_attr && false === strpos( $filtered_image, ' loading=' ) ) {\n\t\t\t$filtered_image = wp_img_tag_add_loading_attr( $filtered_image, $context );\n\t\t}\n\n\t\tif ( $filtered_image !== $image ) {\n\t\t\t$content = str_replace( $image, $filtered_image, $content );\n\t\t}\n\t}\n\n\treturn $content;\n}\n\n/**\n * Adds `loading` attribute to an `img` HTML tag.\n *\n * @since 5.5.0\n *\n * @param string $image   The HTML `img` tag where the attribute should be added.\n * @param string $context Additional context to pass to the filters.\n * @return string Converted `img` tag with `loading` attribute added.\n */\nfunction wp_img_tag_add_loading_attr( $image, $context ) {\n\t/**\n\t * Filters the `loading` attribute value. Default `lazy`.\n\t *\n\t * Returning `false` or an empty string will not add the attribute.\n\t * Returning `true` will add the default value.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string|bool $value   The `loading` attribute value. Returning a falsey value will result in\n\t *                             the attribute being omitted for the image. Default is `lazy`.\n\t * @param string      $image   The HTML `img` tag to be filtered.\n\t * @param string      $context Additional context about how the function was called or where the img tag is.\n\t */\n\t$value = apply_filters( 'wp_img_tag_add_loading_attr', 'lazy', $image, $context );\n\n\tif ( $value ) {\n\t\tif ( ! in_array( $value, array( 'lazy', 'eager' ), true ) ) {\n\t\t\t$value = 'lazy';\n\t\t}\n\n\t\t// Images should have source and dimension attributes for the `loading` attribute to be added.\n\t\tif ( false === strpos( $image, ' src=\"' ) || false === strpos( $image, ' width=\"' ) || false === strpos( $image, ' height=\"' ) ) {\n\t\t\treturn $image;\n\t\t}\n\n\t\treturn str_replace( '<img', '<img loading=\"' . esc_attr( $value ) . '\"', $image );\n\t}\n\n\treturn $image;\n}\n\n/**\n * Adds `width` and `height` attributes to an `img` HTML tag.\n *\n * @since 5.5.0\n *\n * @param string $image         The HTML `img` tag where the attribute should be added.\n * @param string $context       Additional context to pass to the filters.\n * @param int    $attachment_id Image attachment ID.\n * @return string Converted 'img' element with 'width' and 'height' attributes added.\n */\nfunction wp_img_tag_add_width_and_height_attr( $image, $context, $attachment_id ) {\n\t$image_src         = preg_match( '/src=\"([^\"]+)\"/', $image, $match_src ) ? $match_src[1] : '';\n\tlist( $image_src ) = explode( '?', $image_src );\n\n\t// Return early if we couldn't get the image source.\n\tif ( ! $image_src ) {\n\t\treturn $image;\n\t}\n\n\t/**\n\t * Filters whether to add the missing `width` and `height` HTML attributes to the img tag. Default `true`.\n\t *\n\t * Returning anything else than `true` will not add the attributes.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param bool   $value         The filtered value, defaults to `true`.\n\t * @param string $image         The HTML `img` tag where the attribute should be added.\n\t * @param string $context       Additional context about how the function was called or where the img tag is.\n\t * @param int    $attachment_id The image attachment ID.\n\t */\n\t$add = apply_filters( 'wp_img_tag_add_width_and_height_attr', true, $image, $context, $attachment_id );\n\n\tif ( true === $add ) {\n\t\t$image_meta = wp_get_attachment_metadata( $attachment_id );\n\t\t$size_array = wp_image_src_get_dimensions( $image_src, $image_meta, $attachment_id );\n\n\t\tif ( $size_array ) {\n\t\t\t$hw = trim( image_hwstring( $size_array[0], $size_array[1] ) );\n\t\t\treturn str_replace( '<img', \"<img {$hw}\", $image );\n\t\t}\n\t}\n\n\treturn $image;\n}\n\n/**\n * Adds `srcset` and `sizes` attributes to an existing `img` HTML tag.\n *\n * @since 5.5.0\n *\n * @param string $image         The HTML `img` tag where the attribute should be added.\n * @param string $context       Additional context to pass to the filters.\n * @param int    $attachment_id Image attachment ID.\n * @return string Converted 'img' element with 'loading' attribute added.\n */\nfunction wp_img_tag_add_srcset_and_sizes_attr( $image, $context, $attachment_id ) {\n\t/**\n\t * Filters whether to add the `srcset` and `sizes` HTML attributes to the img tag. Default `true`.\n\t *\n\t * Returning anything else than `true` will not add the attributes.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param bool   $value         The filtered value, defaults to `true`.\n\t * @param string $image         The HTML `img` tag where the attribute should be added.\n\t * @param string $context       Additional context about how the function was called or where the img tag is.\n\t * @param int    $attachment_id The image attachment ID.\n\t */\n\t$add = apply_filters( 'wp_img_tag_add_srcset_and_sizes_attr', true, $image, $context, $attachment_id );\n\n\tif ( true === $add ) {\n\t\t$image_meta = wp_get_attachment_metadata( $attachment_id );\n\t\treturn wp_image_add_srcset_and_sizes( $image, $image_meta, $attachment_id );\n\t}\n\n\treturn $image;\n}\n\n/**\n * Adds a 'wp-post-image' class to post thumbnails. Internal use only.\n *\n * Uses the {@see 'begin_fetch_post_thumbnail_html'} and {@see 'end_fetch_post_thumbnail_html'}\n * action hooks to dynamically add/remove itself so as to only filter post thumbnails.\n *\n * @ignore\n * @since 2.9.0\n *\n * @param string[] $attr Array of thumbnail attributes including src, class, alt, title, keyed by attribute name.\n * @return string[] Modified array of attributes including the new 'wp-post-image' class.\n */\nfunction _wp_post_thumbnail_class_filter( $attr ) {\n\t$attr['class'] .= ' wp-post-image';\n\treturn $attr;\n}\n\n/**\n * Adds '_wp_post_thumbnail_class_filter' callback to the 'wp_get_attachment_image_attributes'\n * filter hook. Internal use only.\n *\n * @ignore\n * @since 2.9.0\n *\n * @param string[] $attr Array of thumbnail attributes including src, class, alt, title, keyed by attribute name.\n */\nfunction _wp_post_thumbnail_class_filter_add( $attr ) {\n\tadd_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter' );\n}\n\n/**\n * Removes the '_wp_post_thumbnail_class_filter' callback from the 'wp_get_attachment_image_attributes'\n * filter hook. Internal use only.\n *\n * @ignore\n * @since 2.9.0\n *\n * @param string[] $attr Array of thumbnail attributes including src, class, alt, title, keyed by attribute name.\n */\nfunction _wp_post_thumbnail_class_filter_remove( $attr ) {\n\tremove_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter' );\n}\n\nadd_shortcode( 'wp_caption', 'img_caption_shortcode' );\nadd_shortcode( 'caption', 'img_caption_shortcode' );\n\n/**\n * Builds the Caption shortcode output.\n *\n * Allows a plugin to replace the content that would otherwise be returned. The\n * filter is {@see 'img_caption_shortcode'} and passes an empty string, the attr\n * parameter and the content parameter values.\n *\n * The supported attributes for the shortcode are 'id', 'caption_id', 'align',\n * 'width', 'caption', and 'class'.\n *\n * @since 2.6.0\n * @since 3.9.0 The `class` attribute was added.\n * @since 5.1.0 The `caption_id` attribute was added.\n *\n * @param array  $attr {\n *     Attributes of the caption shortcode.\n *\n *     @type string $id         ID of the image and caption container element, i.e. `<figure>` or `<div>`.\n *     @type string $caption_id ID of the caption element, i.e. `<figcaption>` or `<p>`.\n *     @type string $align      Class name that aligns the caption. Default 'alignnone'. Accepts 'alignleft',\n *                              'aligncenter', alignright', 'alignnone'.\n *     @type int    $width      The width of the caption, in pixels.\n *     @type string $caption    The caption text.\n *     @type string $class      Additional class name(s) added to the caption container.\n * }\n * @param string $content Shortcode content.\n * @return string HTML content to display the caption.\n */\nfunction img_caption_shortcode( $attr, $content = null ) {\n\t// New-style shortcode with the caption inside the shortcode with the link and image tags.\n\tif ( ! isset( $attr['caption'] ) ) {\n\t\tif ( preg_match( '#((?:<a [^>]+>\\s*)?<img [^>]+>(?:\\s*</a>)?)(.*)#is', $content, $matches ) ) {\n\t\t\t$content         = $matches[1];\n\t\t\t$attr['caption'] = trim( $matches[2] );\n\t\t}\n\t} elseif ( strpos( $attr['caption'], '<' ) !== false ) {\n\t\t$attr['caption'] = wp_kses( $attr['caption'], 'post' );\n\t}\n\n\t/**\n\t * Filters the default caption shortcode output.\n\t *\n\t * If the filtered output isn't empty, it will be used instead of generating\n\t * the default caption template.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @see img_caption_shortcode()\n\t *\n\t * @param string $output  The caption output. Default empty.\n\t * @param array  $attr    Attributes of the caption shortcode.\n\t * @param string $content The image element, possibly wrapped in a hyperlink.\n\t */\n\t$output = apply_filters( 'img_caption_shortcode', '', $attr, $content );\n\n\tif ( ! empty( $output ) ) {\n\t\treturn $output;\n\t}\n\n\t$atts = shortcode_atts(\n\t\tarray(\n\t\t\t'id'         => '',\n\t\t\t'caption_id' => '',\n\t\t\t'align'      => 'alignnone',\n\t\t\t'width'      => '',\n\t\t\t'caption'    => '',\n\t\t\t'class'      => '',\n\t\t),\n\t\t$attr,\n\t\t'caption'\n\t);\n\n\t$atts['width'] = (int) $atts['width'];\n\n\tif ( $atts['width'] < 1 || empty( $atts['caption'] ) ) {\n\t\treturn $content;\n\t}\n\n\t$id          = '';\n\t$caption_id  = '';\n\t$describedby = '';\n\n\tif ( $atts['id'] ) {\n\t\t$atts['id'] = sanitize_html_class( $atts['id'] );\n\t\t$id         = 'id=\"' . esc_attr( $atts['id'] ) . '\" ';\n\t}\n\n\tif ( $atts['caption_id'] ) {\n\t\t$atts['caption_id'] = sanitize_html_class( $atts['caption_id'] );\n\t} elseif ( $atts['id'] ) {\n\t\t$atts['caption_id'] = 'caption-' . str_replace( '_', '-', $atts['id'] );\n\t}\n\n\tif ( $atts['caption_id'] ) {\n\t\t$caption_id  = 'id=\"' . esc_attr( $atts['caption_id'] ) . '\" ';\n\t\t$describedby = 'aria-describedby=\"' . esc_attr( $atts['caption_id'] ) . '\" ';\n\t}\n\n\t$class = trim( 'wp-caption ' . $atts['align'] . ' ' . $atts['class'] );\n\n\t$html5 = current_theme_supports( 'html5', 'caption' );\n\t// HTML5 captions never added the extra 10px to the image width.\n\t$width = $html5 ? $atts['width'] : ( 10 + $atts['width'] );\n\n\t/**\n\t * Filters the width of an image's caption.\n\t *\n\t * By default, the caption is 10 pixels greater than the width of the image,\n\t * to prevent post content from running up against a floated image.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @see img_caption_shortcode()\n\t *\n\t * @param int    $width    Width of the caption in pixels. To remove this inline style,\n\t *                         return zero.\n\t * @param array  $atts     Attributes of the caption shortcode.\n\t * @param string $content  The image element, possibly wrapped in a hyperlink.\n\t */\n\t$caption_width = apply_filters( 'img_caption_shortcode_width', $width, $atts, $content );\n\n\t$style = '';\n\n\tif ( $caption_width ) {\n\t\t$style = 'style=\"width: ' . (int) $caption_width . 'px\" ';\n\t}\n\n\tif ( $html5 ) {\n\t\t$html = sprintf(\n\t\t\t'<figure %s%s%sclass=\"%s\">%s%s</figure>',\n\t\t\t$id,\n\t\t\t$describedby,\n\t\t\t$style,\n\t\t\tesc_attr( $class ),\n\t\t\tdo_shortcode( $content ),\n\t\t\tsprintf(\n\t\t\t\t'<figcaption %sclass=\"wp-caption-text\">%s</figcaption>',\n\t\t\t\t$caption_id,\n\t\t\t\t$atts['caption']\n\t\t\t)\n\t\t);\n\t} else {\n\t\t$html = sprintf(\n\t\t\t'<div %s%sclass=\"%s\">%s%s</div>',\n\t\t\t$id,\n\t\t\t$style,\n\t\t\tesc_attr( $class ),\n\t\t\tstr_replace( '<img ', '<img ' . $describedby, do_shortcode( $content ) ),\n\t\t\tsprintf(\n\t\t\t\t'<p %sclass=\"wp-caption-text\">%s</p>',\n\t\t\t\t$caption_id,\n\t\t\t\t$atts['caption']\n\t\t\t)\n\t\t);\n\t}\n\n\treturn $html;\n}\n\nadd_shortcode( 'gallery', 'gallery_shortcode' );\n\n/**\n * Builds the Gallery shortcode output.\n *\n * This implements the functionality of the Gallery Shortcode for displaying\n * WordPress images on a post.\n *\n * @since 2.5.0\n *\n * @param array $attr {\n *     Attributes of the gallery shortcode.\n *\n *     @type string       $order      Order of the images in the gallery. Default 'ASC'. Accepts 'ASC', 'DESC'.\n *     @type string       $orderby    The field to use when ordering the images. Default 'menu_order ID'.\n *                                    Accepts any valid SQL ORDERBY statement.\n *     @type int          $id         Post ID.\n *     @type string       $itemtag    HTML tag to use for each image in the gallery.\n *                                    Default 'dl', or 'figure' when the theme registers HTML5 gallery support.\n *     @type string       $icontag    HTML tag to use for each image's icon.\n *                                    Default 'dt', or 'div' when the theme registers HTML5 gallery support.\n *     @type string       $captiontag HTML tag to use for each image's caption.\n *                                    Default 'dd', or 'figcaption' when the theme registers HTML5 gallery support.\n *     @type int          $columns    Number of columns of images to display. Default 3.\n *     @type string|array $size       Size of the images to display. Accepts any valid image size, or an array of width\n *                                    and height values in pixels (in that order). Default 'thumbnail'.\n *     @type string       $ids        A comma-separated list of IDs of attachments to display. Default empty.\n *     @type string       $include    A comma-separated list of IDs of attachments to include. Default empty.\n *     @type string       $exclude    A comma-separated list of IDs of attachments to exclude. Default empty.\n *     @type string       $link       What to link each image to. Default empty (links to the attachment page).\n *                                    Accepts 'file', 'none'.\n * }\n * @return string HTML content to display gallery.\n */\nfunction gallery_shortcode( $attr ) {\n\t$post = get_post();\n\n\tstatic $instance = 0;\n\t$instance++;\n\n\tif ( ! empty( $attr['ids'] ) ) {\n\t\t// 'ids' is explicitly ordered, unless you specify otherwise.\n\t\tif ( empty( $attr['orderby'] ) ) {\n\t\t\t$attr['orderby'] = 'post__in';\n\t\t}\n\t\t$attr['include'] = $attr['ids'];\n\t}\n\n\t/**\n\t * Filters the default gallery shortcode output.\n\t *\n\t * If the filtered output isn't empty, it will be used instead of generating\n\t * the default gallery template.\n\t *\n\t * @since 2.5.0\n\t * @since 4.2.0 The `$instance` parameter was added.\n\t *\n\t * @see gallery_shortcode()\n\t *\n\t * @param string $output   The gallery output. Default empty.\n\t * @param array  $attr     Attributes of the gallery shortcode.\n\t * @param int    $instance Unique numeric ID of this gallery shortcode instance.\n\t */\n\t$output = apply_filters( 'post_gallery', '', $attr, $instance );\n\n\tif ( ! empty( $output ) ) {\n\t\treturn $output;\n\t}\n\n\t$html5 = current_theme_supports( 'html5', 'gallery' );\n\t$atts  = shortcode_atts(\n\t\tarray(\n\t\t\t'order'      => 'ASC',\n\t\t\t'orderby'    => 'menu_order ID',\n\t\t\t'id'         => $post ? $post->ID : 0,\n\t\t\t'itemtag'    => $html5 ? 'figure' : 'dl',\n\t\t\t'icontag'    => $html5 ? 'div' : 'dt',\n\t\t\t'captiontag' => $html5 ? 'figcaption' : 'dd',\n\t\t\t'columns'    => 3,\n\t\t\t'size'       => 'thumbnail',\n\t\t\t'include'    => '',\n\t\t\t'exclude'    => '',\n\t\t\t'link'       => '',\n\t\t),\n\t\t$attr,\n\t\t'gallery'\n\t);\n\n\t$id = intval( $atts['id'] );\n\n\tif ( ! empty( $atts['include'] ) ) {\n\t\t$_attachments = get_posts(\n\t\t\tarray(\n\t\t\t\t'include'        => $atts['include'],\n\t\t\t\t'post_status'    => 'inherit',\n\t\t\t\t'post_type'      => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order'          => $atts['order'],\n\t\t\t\t'orderby'        => $atts['orderby'],\n\t\t\t)\n\t\t);\n\n\t\t$attachments = array();\n\t\tforeach ( $_attachments as $key => $val ) {\n\t\t\t$attachments[ $val->ID ] = $_attachments[ $key ];\n\t\t}\n\t} elseif ( ! empty( $atts['exclude'] ) ) {\n\t\t$attachments = get_children(\n\t\t\tarray(\n\t\t\t\t'post_parent'    => $id,\n\t\t\t\t'exclude'        => $atts['exclude'],\n\t\t\t\t'post_status'    => 'inherit',\n\t\t\t\t'post_type'      => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order'          => $atts['order'],\n\t\t\t\t'orderby'        => $atts['orderby'],\n\t\t\t)\n\t\t);\n\t} else {\n\t\t$attachments = get_children(\n\t\t\tarray(\n\t\t\t\t'post_parent'    => $id,\n\t\t\t\t'post_status'    => 'inherit',\n\t\t\t\t'post_type'      => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order'          => $atts['order'],\n\t\t\t\t'orderby'        => $atts['orderby'],\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( empty( $attachments ) ) {\n\t\treturn '';\n\t}\n\n\tif ( is_feed() ) {\n\t\t$output = \"\\n\";\n\t\tforeach ( $attachments as $att_id => $attachment ) {\n\t\t\tif ( ! empty( $atts['link'] ) ) {\n\t\t\t\tif ( 'none' === $atts['link'] ) {\n\t\t\t\t\t$output .= wp_get_attachment_image( $att_id, $atts['size'], false, $attr );\n\t\t\t\t} else {\n\t\t\t\t\t$output .= wp_get_attachment_link( $att_id, $atts['size'], false );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$output .= wp_get_attachment_link( $att_id, $atts['size'], true );\n\t\t\t}\n\t\t\t$output .= \"\\n\";\n\t\t}\n\t\treturn $output;\n\t}\n\n\t$itemtag    = tag_escape( $atts['itemtag'] );\n\t$captiontag = tag_escape( $atts['captiontag'] );\n\t$icontag    = tag_escape( $atts['icontag'] );\n\t$valid_tags = wp_kses_allowed_html( 'post' );\n\tif ( ! isset( $valid_tags[ $itemtag ] ) ) {\n\t\t$itemtag = 'dl';\n\t}\n\tif ( ! isset( $valid_tags[ $captiontag ] ) ) {\n\t\t$captiontag = 'dd';\n\t}\n\tif ( ! isset( $valid_tags[ $icontag ] ) ) {\n\t\t$icontag = 'dt';\n\t}\n\n\t$columns   = intval( $atts['columns'] );\n\t$itemwidth = $columns > 0 ? floor( 100 / $columns ) : 100;\n\t$float     = is_rtl() ? 'right' : 'left';\n\n\t$selector = \"gallery-{$instance}\";\n\n\t$gallery_style = '';\n\n\t/**\n\t * Filters whether to print default gallery styles.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param bool $print Whether to print default gallery styles.\n\t *                    Defaults to false if the theme supports HTML5 galleries.\n\t *                    Otherwise, defaults to true.\n\t */\n\tif ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) {\n\t\t$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type=\"text/css\"';\n\n\t\t$gallery_style = \"\n\t\t<style{$type_attr}>\n\t\t\t#{$selector} {\n\t\t\t\tmargin: auto;\n\t\t\t}\n\t\t\t#{$selector} .gallery-item {\n\t\t\t\tfloat: {$float};\n\t\t\t\tmargin-top: 10px;\n\t\t\t\ttext-align: center;\n\t\t\t\twidth: {$itemwidth}%;\n\t\t\t}\n\t\t\t#{$selector} img {\n\t\t\t\tborder: 2px solid #cfcfcf;\n\t\t\t}\n\t\t\t#{$selector} .gallery-caption {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t\t/* see gallery_shortcode() in wp-includes/media.php */\n\t\t</style>\\n\\t\\t\";\n\t}\n\n\t$size_class  = sanitize_html_class( $atts['size'] );\n\t$gallery_div = \"<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>\";\n\n\t/**\n\t * Filters the default gallery shortcode CSS styles.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $gallery_style Default CSS styles and opening HTML div container\n\t *                              for the gallery shortcode output.\n\t */\n\t$output = apply_filters( 'gallery_style', $gallery_style . $gallery_div );\n\n\t$i = 0;\n\n\tforeach ( $attachments as $id => $attachment ) {\n\n\t\t$attr = ( trim( $attachment->post_excerpt ) ) ? array( 'aria-describedby' => \"$selector-$id\" ) : '';\n\n\t\tif ( ! empty( $atts['link'] ) && 'file' === $atts['link'] ) {\n\t\t\t$image_output = wp_get_attachment_link( $id, $atts['size'], false, false, false, $attr );\n\t\t} elseif ( ! empty( $atts['link'] ) && 'none' === $atts['link'] ) {\n\t\t\t$image_output = wp_get_attachment_image( $id, $atts['size'], false, $attr );\n\t\t} else {\n\t\t\t$image_output = wp_get_attachment_link( $id, $atts['size'], true, false, false, $attr );\n\t\t}\n\n\t\t$image_meta = wp_get_attachment_metadata( $id );\n\n\t\t$orientation = '';\n\n\t\tif ( isset( $image_meta['height'], $image_meta['width'] ) ) {\n\t\t\t$orientation = ( $image_meta['height'] > $image_meta['width'] ) ? 'portrait' : 'landscape';\n\t\t}\n\n\t\t$output .= \"<{$itemtag} class='gallery-item'>\";\n\t\t$output .= \"\n\t\t\t<{$icontag} class='gallery-icon {$orientation}'>\n\t\t\t\t$image_output\n\t\t\t</{$icontag}>\";\n\n\t\tif ( $captiontag && trim( $attachment->post_excerpt ) ) {\n\t\t\t$output .= \"\n\t\t\t\t<{$captiontag} class='wp-caption-text gallery-caption' id='$selector-$id'>\n\t\t\t\t\" . wptexturize( $attachment->post_excerpt ) . \"\n\t\t\t\t</{$captiontag}>\";\n\t\t}\n\n\t\t$output .= \"</{$itemtag}>\";\n\n\t\tif ( ! $html5 && $columns > 0 && 0 === ++$i % $columns ) {\n\t\t\t$output .= '<br style=\"clear: both\" />';\n\t\t}\n\t}\n\n\tif ( ! $html5 && $columns > 0 && 0 !== $i % $columns ) {\n\t\t$output .= \"\n\t\t\t<br style='clear: both' />\";\n\t}\n\n\t$output .= \"\n\t\t</div>\\n\";\n\n\treturn $output;\n}\n\n/**\n * Outputs the templates used by playlists.\n *\n * @since 3.9.0\n */\nfunction wp_underscore_playlist_templates() {\n\t?>\n<script type=\"text/html\" id=\"tmpl-wp-playlist-current-item\">\n\t<# if ( data.image ) { #>\n\t<img src=\"{{ data.thumb.src }}\" alt=\"\" />\n\t<# } #>\n\t<div class=\"wp-playlist-caption\">\n\t\t<span class=\"wp-playlist-item-meta wp-playlist-item-title\">\n\t\t<?php\n\t\t\t/* translators: %s: Playlist item title. */\n\t\t\tprintf( _x( '&#8220;%s&#8221;', 'playlist item title' ), '{{ data.title }}' );\n\t\t?>\n\t\t</span>\n\t\t<# if ( data.meta.album ) { #><span class=\"wp-playlist-item-meta wp-playlist-item-album\">{{ data.meta.album }}</span><# } #>\n\t\t<# if ( data.meta.artist ) { #><span class=\"wp-playlist-item-meta wp-playlist-item-artist\">{{ data.meta.artist }}</span><# } #>\n\t</div>\n</script>\n<script type=\"text/html\" id=\"tmpl-wp-playlist-item\">\n\t<div class=\"wp-playlist-item\">\n\t\t<a class=\"wp-playlist-caption\" href=\"{{ data.src }}\">\n\t\t\t{{ data.index ? ( data.index + '. ' ) : '' }}\n\t\t\t<# if ( data.caption ) { #>\n\t\t\t\t{{ data.caption }}\n\t\t\t<# } else { #>\n\t\t\t\t<span class=\"wp-playlist-item-title\">\n\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: Playlist item title. */\n\t\t\t\t\tprintf( _x( '&#8220;%s&#8221;', 'playlist item title' ), '{{{ data.title }}}' );\n\t\t\t\t?>\n\t\t\t\t</span>\n\t\t\t\t<# if ( data.artists && data.meta.artist ) { #>\n\t\t\t\t<span class=\"wp-playlist-item-artist\"> &mdash; {{ data.meta.artist }}</span>\n\t\t\t\t<# } #>\n\t\t\t<# } #>\n\t\t</a>\n\t\t<# if ( data.meta.length_formatted ) { #>\n\t\t<div class=\"wp-playlist-item-length\">{{ data.meta.length_formatted }}</div>\n\t\t<# } #>\n\t</div>\n</script>\n\t<?php\n}\n\n/**\n * Outputs and enqueue default scripts and styles for playlists.\n *\n * @since 3.9.0\n *\n * @param string $type Type of playlist. Accepts 'audio' or 'video'.\n */\nfunction wp_playlist_scripts( $type ) {\n\twp_enqueue_style( 'wp-mediaelement' );\n\twp_enqueue_script( 'wp-playlist' );\n\t?>\n<!--[if lt IE 9]><script>document.createElement('<?php echo esc_js( $type ); ?>');</script><![endif]-->\n\t<?php\n\tadd_action( 'wp_footer', 'wp_underscore_playlist_templates', 0 );\n\tadd_action( 'admin_footer', 'wp_underscore_playlist_templates', 0 );\n}\n\n/**\n * Builds the Playlist shortcode output.\n *\n * This implements the functionality of the playlist shortcode for displaying\n * a collection of WordPress audio or video files in a post.\n *\n * @since 3.9.0\n *\n * @global int $content_width\n *\n * @param array $attr {\n *     Array of default playlist attributes.\n *\n *     @type string  $type         Type of playlist to display. Accepts 'audio' or 'video'. Default 'audio'.\n *     @type string  $order        Designates ascending or descending order of items in the playlist.\n *                                 Accepts 'ASC', 'DESC'. Default 'ASC'.\n *     @type string  $orderby      Any column, or columns, to sort the playlist. If $ids are\n *                                 passed, this defaults to the order of the $ids array ('post__in').\n *                                 Otherwise default is 'menu_order ID'.\n *     @type int     $id           If an explicit $ids array is not present, this parameter\n *                                 will determine which attachments are used for the playlist.\n *                                 Default is the current post ID.\n *     @type array   $ids          Create a playlist out of these explicit attachment IDs. If empty,\n *                                 a playlist will be created from all $type attachments of $id.\n *                                 Default empty.\n *     @type array   $exclude      List of specific attachment IDs to exclude from the playlist. Default empty.\n *     @type string  $style        Playlist style to use. Accepts 'light' or 'dark'. Default 'light'.\n *     @type bool    $tracklist    Whether to show or hide the playlist. Default true.\n *     @type bool    $tracknumbers Whether to show or hide the numbers next to entries in the playlist. Default true.\n *     @type bool    $images       Show or hide the video or audio thumbnail (Featured Image/post\n *                                 thumbnail). Default true.\n *     @type bool    $artists      Whether to show or hide artist name in the playlist. Default true.\n * }\n *\n * @return string Playlist output. Empty string if the passed type is unsupported.\n */\nfunction wp_playlist_shortcode( $attr ) {\n\tglobal $content_width;\n\t$post = get_post();\n\n\tstatic $instance = 0;\n\t$instance++;\n\n\tif ( ! empty( $attr['ids'] ) ) {\n\t\t// 'ids' is explicitly ordered, unless you specify otherwise.\n\t\tif ( empty( $attr['orderby'] ) ) {\n\t\t\t$attr['orderby'] = 'post__in';\n\t\t}\n\t\t$attr['include'] = $attr['ids'];\n\t}\n\n\t/**\n\t * Filters the playlist output.\n\t *\n\t * Returning a non-empty value from the filter will short-circuit generation\n\t * of the default playlist output, returning the passed value instead.\n\t *\n\t * @since 3.9.0\n\t * @since 4.2.0 The `$instance` parameter was added.\n\t *\n\t * @param string $output   Playlist output. Default empty.\n\t * @param array  $attr     An array of shortcode attributes.\n\t * @param int    $instance Unique numeric ID of this playlist shortcode instance.\n\t */\n\t$output = apply_filters( 'post_playlist', '', $attr, $instance );\n\n\tif ( ! empty( $output ) ) {\n\t\treturn $output;\n\t}\n\n\t$atts = shortcode_atts(\n\t\tarray(\n\t\t\t'type'         => 'audio',\n\t\t\t'order'        => 'ASC',\n\t\t\t'orderby'      => 'menu_order ID',\n\t\t\t'id'           => $post ? $post->ID : 0,\n\t\t\t'include'      => '',\n\t\t\t'exclude'      => '',\n\t\t\t'style'        => 'light',\n\t\t\t'tracklist'    => true,\n\t\t\t'tracknumbers' => true,\n\t\t\t'images'       => true,\n\t\t\t'artists'      => true,\n\t\t),\n\t\t$attr,\n\t\t'playlist'\n\t);\n\n\t$id = intval( $atts['id'] );\n\n\tif ( 'audio' !== $atts['type'] ) {\n\t\t$atts['type'] = 'video';\n\t}\n\n\t$args = array(\n\t\t'post_status'    => 'inherit',\n\t\t'post_type'      => 'attachment',\n\t\t'post_mime_type' => $atts['type'],\n\t\t'order'          => $atts['order'],\n\t\t'orderby'        => $atts['orderby'],\n\t);\n\n\tif ( ! empty( $atts['include'] ) ) {\n\t\t$args['include'] = $atts['include'];\n\t\t$_attachments    = get_posts( $args );\n\n\t\t$attachments = array();\n\t\tforeach ( $_attachments as $key => $val ) {\n\t\t\t$attachments[ $val->ID ] = $_attachments[ $key ];\n\t\t}\n\t} elseif ( ! empty( $atts['exclude'] ) ) {\n\t\t$args['post_parent'] = $id;\n\t\t$args['exclude']     = $atts['exclude'];\n\t\t$attachments         = get_children( $args );\n\t} else {\n\t\t$args['post_parent'] = $id;\n\t\t$attachments         = get_children( $args );\n\t}\n\n\tif ( empty( $attachments ) ) {\n\t\treturn '';\n\t}\n\n\tif ( is_feed() ) {\n\t\t$output = \"\\n\";\n\t\tforeach ( $attachments as $att_id => $attachment ) {\n\t\t\t$output .= wp_get_attachment_link( $att_id ) . \"\\n\";\n\t\t}\n\t\treturn $output;\n\t}\n\n\t$outer = 22; // Default padding and border of wrapper.\n\n\t$default_width  = 640;\n\t$default_height = 360;\n\n\t$theme_width  = empty( $content_width ) ? $default_width : ( $content_width - $outer );\n\t$theme_height = empty( $content_width ) ? $default_height : round( ( $default_height * $theme_width ) / $default_width );\n\n\t$data = array(\n\t\t'type'         => $atts['type'],\n\t\t// Don't pass strings to JSON, will be truthy in JS.\n\t\t'tracklist'    => wp_validate_boolean( $atts['tracklist'] ),\n\t\t'tracknumbers' => wp_validate_boolean( $atts['tracknumbers'] ),\n\t\t'images'       => wp_validate_boolean( $atts['images'] ),\n\t\t'artists'      => wp_validate_boolean( $atts['artists'] ),\n\t);\n\n\t$tracks = array();\n\tforeach ( $attachments as $attachment ) {\n\t\t$url   = wp_get_attachment_url( $attachment->ID );\n\t\t$ftype = wp_check_filetype( $url, wp_get_mime_types() );\n\t\t$track = array(\n\t\t\t'src'         => $url,\n\t\t\t'type'        => $ftype['type'],\n\t\t\t'title'       => $attachment->post_title,\n\t\t\t'caption'     => $attachment->post_excerpt,\n\t\t\t'description' => $attachment->post_content,\n\t\t);\n\n\t\t$track['meta'] = array();\n\t\t$meta          = wp_get_attachment_metadata( $attachment->ID );\n\t\tif ( ! empty( $meta ) ) {\n\n\t\t\tforeach ( wp_get_attachment_id3_keys( $attachment ) as $key => $label ) {\n\t\t\t\tif ( ! empty( $meta[ $key ] ) ) {\n\t\t\t\t\t$track['meta'][ $key ] = $meta[ $key ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( 'video' === $atts['type'] ) {\n\t\t\t\tif ( ! empty( $meta['width'] ) && ! empty( $meta['height'] ) ) {\n\t\t\t\t\t$width        = $meta['width'];\n\t\t\t\t\t$height       = $meta['height'];\n\t\t\t\t\t$theme_height = round( ( $height * $theme_width ) / $width );\n\t\t\t\t} else {\n\t\t\t\t\t$width  = $default_width;\n\t\t\t\t\t$height = $default_height;\n\t\t\t\t}\n\n\t\t\t\t$track['dimensions'] = array(\n\t\t\t\t\t'original' => compact( 'width', 'height' ),\n\t\t\t\t\t'resized'  => array(\n\t\t\t\t\t\t'width'  => $theme_width,\n\t\t\t\t\t\t'height' => $theme_height,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( $atts['images'] ) {\n\t\t\t$thumb_id = get_post_thumbnail_id( $attachment->ID );\n\t\t\tif ( ! empty( $thumb_id ) ) {\n\t\t\t\tlist( $src, $width, $height ) = wp_get_attachment_image_src( $thumb_id, 'full' );\n\t\t\t\t$track['image']               = compact( 'src', 'width', 'height' );\n\t\t\t\tlist( $src, $width, $height ) = wp_get_attachment_image_src( $thumb_id, 'thumbnail' );\n\t\t\t\t$track['thumb']               = compact( 'src', 'width', 'height' );\n\t\t\t} else {\n\t\t\t\t$src            = wp_mime_type_icon( $attachment->ID );\n\t\t\t\t$width          = 48;\n\t\t\t\t$height         = 64;\n\t\t\t\t$track['image'] = compact( 'src', 'width', 'height' );\n\t\t\t\t$track['thumb'] = compact( 'src', 'width', 'height' );\n\t\t\t}\n\t\t}\n\n\t\t$tracks[] = $track;\n\t}\n\t$data['tracks'] = $tracks;\n\n\t$safe_type  = esc_attr( $atts['type'] );\n\t$safe_style = esc_attr( $atts['style'] );\n\n\tob_start();\n\n\tif ( 1 === $instance ) {\n\t\t/**\n\t\t * Prints and enqueues playlist scripts, styles, and JavaScript templates.\n\t\t *\n\t\t * @since 3.9.0\n\t\t *\n\t\t * @param string $type  Type of playlist. Possible values are 'audio' or 'video'.\n\t\t * @param string $style The 'theme' for the playlist. Core provides 'light' and 'dark'.\n\t\t */\n\t\tdo_action( 'wp_playlist_scripts', $atts['type'], $atts['style'] );\n\t}\n\t?>\n<div class=\"wp-playlist wp-<?php echo $safe_type; ?>-playlist wp-playlist-<?php echo $safe_style; ?>\">\n\t<?php if ( 'audio' === $atts['type'] ) : ?>\n\t<div class=\"wp-playlist-current-item\"></div>\n\t<?php endif ?>\n\t<<?php echo $safe_type; ?> controls=\"controls\" preload=\"none\" width=\"\n\t\t\t\t<?php\n\t\t\t\techo (int) $theme_width;\n\t\t\t\t?>\n\t\"\n\t<?php\n\tif ( 'video' === $safe_type ) :\n\t\techo ' height=\"', (int) $theme_height, '\"';\n\tendif;\n\t?>\n\t></<?php echo $safe_type; ?>>\n\t<div class=\"wp-playlist-next\"></div>\n\t<div class=\"wp-playlist-prev\"></div>\n\t<noscript>\n\t<ol>\n\t<?php\n\tforeach ( $attachments as $att_id => $attachment ) {\n\t\tprintf( '<li>%s</li>', wp_get_attachment_link( $att_id ) );\n\t}\n\t?>\n\t</ol>\n\t</noscript>\n\t<script type=\"application/json\" class=\"wp-playlist-script\"><?php echo wp_json_encode( $data ); ?></script>\n</div>\n\t<?php\n\treturn ob_get_clean();\n}\nadd_shortcode( 'playlist', 'wp_playlist_shortcode' );\n\n/**\n * Provides a No-JS Flash fallback as a last resort for audio / video.\n *\n * @since 3.6.0\n *\n * @param string $url The media element URL.\n * @return string Fallback HTML.\n */\nfunction wp_mediaelement_fallback( $url ) {\n\t/**\n\t * Filters the Mediaelement fallback output for no-JS.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param string $output Fallback output for no-JS.\n\t * @param string $url    Media file URL.\n\t */\n\treturn apply_filters( 'wp_mediaelement_fallback', sprintf( '<a href=\"%1$s\">%1$s</a>', esc_url( $url ) ), $url );\n}\n\n/**\n * Returns a filtered list of supported audio formats.\n *\n * @since 3.6.0\n *\n * @return string[] Supported audio formats.\n */\nfunction wp_get_audio_extensions() {\n\t/**\n\t * Filters the list of supported audio formats.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param string[] $extensions An array of supported audio formats. Defaults are\n\t *                            'mp3', 'ogg', 'flac', 'm4a', 'wav'.\n\t */\n\treturn apply_filters( 'wp_audio_extensions', array( 'mp3', 'ogg', 'flac', 'm4a', 'wav' ) );\n}\n\n/**\n * Returns useful keys to use to lookup data from an attachment's stored metadata.\n *\n * @since 3.9.0\n *\n * @param WP_Post $attachment The current attachment, provided for context.\n * @param string  $context    Optional. The context. Accepts 'edit', 'display'. Default 'display'.\n * @return string[] Key/value pairs of field keys to labels.\n */\nfunction wp_get_attachment_id3_keys( $attachment, $context = 'display' ) {\n\t$fields = array(\n\t\t'artist' => __( 'Artist' ),\n\t\t'album'  => __( 'Album' ),\n\t);\n\n\tif ( 'display' === $context ) {\n\t\t$fields['genre']            = __( 'Genre' );\n\t\t$fields['year']             = __( 'Year' );\n\t\t$fields['length_formatted'] = _x( 'Length', 'video or audio' );\n\t} elseif ( 'js' === $context ) {\n\t\t$fields['bitrate']      = __( 'Bitrate' );\n\t\t$fields['bitrate_mode'] = __( 'Bitrate Mode' );\n\t}\n\n\t/**\n\t * Filters the editable list of keys to look up data from an attachment's metadata.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param array   $fields     Key/value pairs of field keys to labels.\n\t * @param WP_Post $attachment Attachment object.\n\t * @param string  $context    The context. Accepts 'edit', 'display'. Default 'display'.\n\t */\n\treturn apply_filters( 'wp_get_attachment_id3_keys', $fields, $attachment, $context );\n}\n/**\n * Builds the Audio shortcode output.\n *\n * This implements the functionality of the Audio Shortcode for displaying\n * WordPress mp3s in a post.\n *\n * @since 3.6.0\n *\n * @param array  $attr {\n *     Attributes of the audio shortcode.\n *\n *     @type string $src      URL to the source of the audio file. Default empty.\n *     @type string $loop     The 'loop' attribute for the `<audio>` element. Default empty.\n *     @type string $autoplay The 'autoplay' attribute for the `<audio>` element. Default empty.\n *     @type string $preload  The 'preload' attribute for the `<audio>` element. Default 'none'.\n *     @type string $class    The 'class' attribute for the `<audio>` element. Default 'wp-audio-shortcode'.\n *     @type string $style    The 'style' attribute for the `<audio>` element. Default 'width: 100%;'.\n * }\n * @param string $content Shortcode content.\n * @return string|void HTML content to display audio.\n */\nfunction wp_audio_shortcode( $attr, $content = '' ) {\n\t$post_id = get_post() ? get_the_ID() : 0;\n\n\tstatic $instance = 0;\n\t$instance++;\n\n\t/**\n\t * Filters the default audio shortcode output.\n\t *\n\t * If the filtered output isn't empty, it will be used instead of generating the default audio template.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param string $html     Empty variable to be replaced with shortcode markup.\n\t * @param array  $attr     Attributes of the shortcode. @see wp_audio_shortcode()\n\t * @param string $content  Shortcode content.\n\t * @param int    $instance Unique numeric ID of this audio shortcode instance.\n\t */\n\t$override = apply_filters( 'wp_audio_shortcode_override', '', $attr, $content, $instance );\n\n\tif ( '' !== $override ) {\n\t\treturn $override;\n\t}\n\n\t$audio = null;\n\n\t$default_types = wp_get_audio_extensions();\n\t$defaults_atts = array(\n\t\t'src'      => '',\n\t\t'loop'     => '',\n\t\t'autoplay' => '',\n\t\t'preload'  => 'none',\n\t\t'class'    => 'wp-audio-shortcode',\n\t\t'style'    => 'width: 100%;',\n\t);\n\tforeach ( $default_types as $type ) {\n\t\t$defaults_atts[ $type ] = '';\n\t}\n\n\t$atts = shortcode_atts( $defaults_atts, $attr, 'audio' );\n\n\t$primary = false;\n\tif ( ! empty( $atts['src'] ) ) {\n\t\t$type = wp_check_filetype( $atts['src'], wp_get_mime_types() );\n\n\t\tif ( ! in_array( strtolower( $type['ext'] ), $default_types, true ) ) {\n\t\t\treturn sprintf( '<a class=\"wp-embedded-audio\" href=\"%s\">%s</a>', esc_url( $atts['src'] ), esc_html( $atts['src'] ) );\n\t\t}\n\n\t\t$primary = true;\n\t\tarray_unshift( $default_types, 'src' );\n\t} else {\n\t\tforeach ( $default_types as $ext ) {\n\t\t\tif ( ! empty( $atts[ $ext ] ) ) {\n\t\t\t\t$type = wp_check_filetype( $atts[ $ext ], wp_get_mime_types() );\n\n\t\t\t\tif ( strtolower( $type['ext'] ) === $ext ) {\n\t\t\t\t\t$primary = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! $primary ) {\n\t\t$audios = get_attached_media( 'audio', $post_id );\n\n\t\tif ( empty( $audios ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$audio       = reset( $audios );\n\t\t$atts['src'] = wp_get_attachment_url( $audio->ID );\n\n\t\tif ( empty( $atts['src'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tarray_unshift( $default_types, 'src' );\n\t}\n\n\t/**\n\t * Filters the media library used for the audio shortcode.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param string $library Media library used for the audio shortcode.\n\t */\n\t$library = apply_filters( 'wp_audio_shortcode_library', 'mediaelement' );\n\n\tif ( 'mediaelement' === $library && did_action( 'init' ) ) {\n\t\twp_enqueue_style( 'wp-mediaelement' );\n\t\twp_enqueue_script( 'wp-mediaelement' );\n\t}\n\n\t/**\n\t * Filters the class attribute for the audio shortcode output container.\n\t *\n\t * @since 3.6.0\n\t * @since 4.9.0 The `$atts` parameter was added.\n\t *\n\t * @param string $class CSS class or list of space-separated classes.\n\t * @param array  $atts  Array of audio shortcode attributes.\n\t */\n\t$atts['class'] = apply_filters( 'wp_audio_shortcode_class', $atts['class'], $atts );\n\n\t$html_atts = array(\n\t\t'class'    => $atts['class'],\n\t\t'id'       => sprintf( 'audio-%d-%d', $post_id, $instance ),\n\t\t'loop'     => wp_validate_boolean( $atts['loop'] ),\n\t\t'autoplay' => wp_validate_boolean( $atts['autoplay'] ),\n\t\t'preload'  => $atts['preload'],\n\t\t'style'    => $atts['style'],\n\t);\n\n\t// These ones should just be omitted altogether if they are blank.\n\tforeach ( array( 'loop', 'autoplay', 'preload' ) as $a ) {\n\t\tif ( empty( $html_atts[ $a ] ) ) {\n\t\t\tunset( $html_atts[ $a ] );\n\t\t}\n\t}\n\n\t$attr_strings = array();\n\n\tforeach ( $html_atts as $k => $v ) {\n\t\t$attr_strings[] = $k . '=\"' . esc_attr( $v ) . '\"';\n\t}\n\n\t$html = '';\n\n\tif ( 'mediaelement' === $library && 1 === $instance ) {\n\t\t$html .= \"<!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->\\n\";\n\t}\n\n\t$html .= sprintf( '<audio %s controls=\"controls\">', join( ' ', $attr_strings ) );\n\n\t$fileurl = '';\n\t$source  = '<source type=\"%s\" src=\"%s\" />';\n\n\tforeach ( $default_types as $fallback ) {\n\t\tif ( ! empty( $atts[ $fallback ] ) ) {\n\t\t\tif ( empty( $fileurl ) ) {\n\t\t\t\t$fileurl = $atts[ $fallback ];\n\t\t\t}\n\n\t\t\t$type  = wp_check_filetype( $atts[ $fallback ], wp_get_mime_types() );\n\t\t\t$url   = add_query_arg( '_', $instance, $atts[ $fallback ] );\n\t\t\t$html .= sprintf( $source, $type['type'], esc_url( $url ) );\n\t\t}\n\t}\n\n\tif ( 'mediaelement' === $library ) {\n\t\t$html .= wp_mediaelement_fallback( $fileurl );\n\t}\n\n\t$html .= '</audio>';\n\n\t/**\n\t * Filters the audio shortcode output.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param string $html    Audio shortcode HTML output.\n\t * @param array  $atts    Array of audio shortcode attributes.\n\t * @param string $audio   Audio file.\n\t * @param int    $post_id Post ID.\n\t * @param string $library Media library used for the audio shortcode.\n\t */\n\treturn apply_filters( 'wp_audio_shortcode', $html, $atts, $audio, $post_id, $library );\n}\nadd_shortcode( 'audio', 'wp_audio_shortcode' );\n\n/**\n * Returns a filtered list of supported video formats.\n *\n * @since 3.6.0\n *\n * @return string[] List of supported video formats.\n */\nfunction wp_get_video_extensions() {\n\t/**\n\t * Filters the list of supported video formats.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param string[] $extensions An array of supported video formats. Defaults are\n\t *                             'mp4', 'm4v', 'webm', 'ogv', 'flv'.\n\t */\n\treturn apply_filters( 'wp_video_extensions', array( 'mp4', 'm4v', 'webm', 'ogv', 'flv' ) );\n}\n\n/**\n * Builds the Video shortcode output.\n *\n * This implements the functionality of the Video Shortcode for displaying\n * WordPress mp4s in a post.\n *\n * @since 3.6.0\n *\n * @global int $content_width\n *\n * @param array  $attr {\n *     Attributes of the shortcode.\n *\n *     @type string $src      URL to the source of the video file. Default empty.\n *     @type int    $height   Height of the video embed in pixels. Default 360.\n *     @type int    $width    Width of the video embed in pixels. Default $content_width or 640.\n *     @type string $poster   The 'poster' attribute for the `<video>` element. Default empty.\n *     @type string $loop     The 'loop' attribute for the `<video>` element. Default empty.\n *     @type string $autoplay The 'autoplay' attribute for the `<video>` element. Default empty.\n *     @type string $preload  The 'preload' attribute for the `<video>` element.\n *                            Default 'metadata'.\n *     @type string $class    The 'class' attribute for the `<video>` element.\n *                            Default 'wp-video-shortcode'.\n * }\n * @param string $content Shortcode content.\n * @return string|void HTML content to display video.\n */\nfunction wp_video_shortcode( $attr, $content = '' ) {\n\tglobal $content_width;\n\t$post_id = get_post() ? get_the_ID() : 0;\n\n\tstatic $instance = 0;\n\t$instance++;\n\n\t/**\n\t * Filters the default video shortcode output.\n\t *\n\t * If the filtered output isn't empty, it will be used instead of generating\n\t * the default video template.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @see wp_video_shortcode()\n\t *\n\t * @param string $html     Empty variable to be replaced with shortcode markup.\n\t * @param array  $attr     Attributes of the shortcode. @see wp_video_shortcode()\n\t * @param string $content  Video shortcode content.\n\t * @param int    $instance Unique numeric ID of this video shortcode instance.\n\t */\n\t$override = apply_filters( 'wp_video_shortcode_override', '', $attr, $content, $instance );\n\n\tif ( '' !== $override ) {\n\t\treturn $override;\n\t}\n\n\t$video = null;\n\n\t$default_types = wp_get_video_extensions();\n\t$defaults_atts = array(\n\t\t'src'      => '',\n\t\t'poster'   => '',\n\t\t'loop'     => '',\n\t\t'autoplay' => '',\n\t\t'preload'  => 'metadata',\n\t\t'width'    => 640,\n\t\t'height'   => 360,\n\t\t'class'    => 'wp-video-shortcode',\n\t);\n\n\tforeach ( $default_types as $type ) {\n\t\t$defaults_atts[ $type ] = '';\n\t}\n\n\t$atts = shortcode_atts( $defaults_atts, $attr, 'video' );\n\n\tif ( is_admin() ) {\n\t\t// Shrink the video so it isn't huge in the admin.\n\t\tif ( $atts['width'] > $defaults_atts['width'] ) {\n\t\t\t$atts['height'] = round( ( $atts['height'] * $defaults_atts['width'] ) / $atts['width'] );\n\t\t\t$atts['width']  = $defaults_atts['width'];\n\t\t}\n\t} else {\n\t\t// If the video is bigger than the theme.\n\t\tif ( ! empty( $content_width ) && $atts['width'] > $content_width ) {\n\t\t\t$atts['height'] = round( ( $atts['height'] * $content_width ) / $atts['width'] );\n\t\t\t$atts['width']  = $content_width;\n\t\t}\n\t}\n\n\t$is_vimeo      = false;\n\t$is_youtube    = false;\n\t$yt_pattern    = '#^https?://(?:www\\.)?(?:youtube\\.com/watch|youtu\\.be/)#';\n\t$vimeo_pattern = '#^https?://(.+\\.)?vimeo\\.com/.*#';\n\n\t$primary = false;\n\tif ( ! empty( $atts['src'] ) ) {\n\t\t$is_vimeo   = ( preg_match( $vimeo_pattern, $atts['src'] ) );\n\t\t$is_youtube = ( preg_match( $yt_pattern, $atts['src'] ) );\n\n\t\tif ( ! $is_youtube && ! $is_vimeo ) {\n\t\t\t$type = wp_check_filetype( $atts['src'], wp_get_mime_types() );\n\n\t\t\tif ( ! in_array( strtolower( $type['ext'] ), $default_types, true ) ) {\n\t\t\t\treturn sprintf( '<a class=\"wp-embedded-video\" href=\"%s\">%s</a>', esc_url( $atts['src'] ), esc_html( $atts['src'] ) );\n\t\t\t}\n\t\t}\n\n\t\tif ( $is_vimeo ) {\n\t\t\twp_enqueue_script( 'mediaelement-vimeo' );\n\t\t}\n\n\t\t$primary = true;\n\t\tarray_unshift( $default_types, 'src' );\n\t} else {\n\t\tforeach ( $default_types as $ext ) {\n\t\t\tif ( ! empty( $atts[ $ext ] ) ) {\n\t\t\t\t$type = wp_check_filetype( $atts[ $ext ], wp_get_mime_types() );\n\t\t\t\tif ( strtolower( $type['ext'] ) === $ext ) {\n\t\t\t\t\t$primary = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! $primary ) {\n\t\t$videos = get_attached_media( 'video', $post_id );\n\t\tif ( empty( $videos ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$video       = reset( $videos );\n\t\t$atts['src'] = wp_get_attachment_url( $video->ID );\n\t\tif ( empty( $atts['src'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tarray_unshift( $default_types, 'src' );\n\t}\n\n\t/**\n\t * Filters the media library used for the video shortcode.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param string $library Media library used for the video shortcode.\n\t */\n\t$library = apply_filters( 'wp_video_shortcode_library', 'mediaelement' );\n\tif ( 'mediaelement' === $library && did_action( 'init' ) ) {\n\t\twp_enqueue_style( 'wp-mediaelement' );\n\t\twp_enqueue_script( 'wp-mediaelement' );\n\t\twp_enqueue_script( 'mediaelement-vimeo' );\n\t}\n\n\t// MediaElement.js has issues with some URL formats for Vimeo and YouTube,\n\t// so update the URL to prevent the ME.js player from breaking.\n\tif ( 'mediaelement' === $library ) {\n\t\tif ( $is_youtube ) {\n\t\t\t// Remove `feature` query arg and force SSL - see #40866.\n\t\t\t$atts['src'] = remove_query_arg( 'feature', $atts['src'] );\n\t\t\t$atts['src'] = set_url_scheme( $atts['src'], 'https' );\n\t\t} elseif ( $is_vimeo ) {\n\t\t\t// Remove all query arguments and force SSL - see #40866.\n\t\t\t$parsed_vimeo_url = wp_parse_url( $atts['src'] );\n\t\t\t$vimeo_src        = 'https://' . $parsed_vimeo_url['host'] . $parsed_vimeo_url['path'];\n\n\t\t\t// Add loop param for mejs bug - see #40977, not needed after #39686.\n\t\t\t$loop        = $atts['loop'] ? '1' : '0';\n\t\t\t$atts['src'] = add_query_arg( 'loop', $loop, $vimeo_src );\n\t\t}\n\t}\n\n\t/**\n\t * Filters the class attribute for the video shortcode output container.\n\t *\n\t * @since 3.6.0\n\t * @since 4.9.0 The `$atts` parameter was added.\n\t *\n\t * @param string $class CSS class or list of space-separated classes.\n\t * @param array  $atts  Array of video shortcode attributes.\n\t */\n\t$atts['class'] = apply_filters( 'wp_video_shortcode_class', $atts['class'], $atts );\n\n\t$html_atts = array(\n\t\t'class'    => $atts['class'],\n\t\t'id'       => sprintf( 'video-%d-%d', $post_id, $instance ),\n\t\t'width'    => absint( $atts['width'] ),\n\t\t'height'   => absint( $atts['height'] ),\n\t\t'poster'   => esc_url( $atts['poster'] ),\n\t\t'loop'     => wp_validate_boolean( $atts['loop'] ),\n\t\t'autoplay' => wp_validate_boolean( $atts['autoplay'] ),\n\t\t'preload'  => $atts['preload'],\n\t);\n\n\t// These ones should just be omitted altogether if they are blank.\n\tforeach ( array( 'poster', 'loop', 'autoplay', 'preload' ) as $a ) {\n\t\tif ( empty( $html_atts[ $a ] ) ) {\n\t\t\tunset( $html_atts[ $a ] );\n\t\t}\n\t}\n\n\t$attr_strings = array();\n\tforeach ( $html_atts as $k => $v ) {\n\t\t$attr_strings[] = $k . '=\"' . esc_attr( $v ) . '\"';\n\t}\n\n\t$html = '';\n\tif ( 'mediaelement' === $library && 1 === $instance ) {\n\t\t$html .= \"<!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->\\n\";\n\t}\n\t$html .= sprintf( '<video %s controls=\"controls\">', join( ' ', $attr_strings ) );\n\n\t$fileurl = '';\n\t$source  = '<source type=\"%s\" src=\"%s\" />';\n\tforeach ( $default_types as $fallback ) {\n\t\tif ( ! empty( $atts[ $fallback ] ) ) {\n\t\t\tif ( empty( $fileurl ) ) {\n\t\t\t\t$fileurl = $atts[ $fallback ];\n\t\t\t}\n\t\t\tif ( 'src' === $fallback && $is_youtube ) {\n\t\t\t\t$type = array( 'type' => 'video/youtube' );\n\t\t\t} elseif ( 'src' === $fallback && $is_vimeo ) {\n\t\t\t\t$type = array( 'type' => 'video/vimeo' );\n\t\t\t} else {\n\t\t\t\t$type = wp_check_filetype( $atts[ $fallback ], wp_get_mime_types() );\n\t\t\t}\n\t\t\t$url   = add_query_arg( '_', $instance, $atts[ $fallback ] );\n\t\t\t$html .= sprintf( $source, $type['type'], esc_url( $url ) );\n\t\t}\n\t}\n\n\tif ( ! empty( $content ) ) {\n\t\tif ( false !== strpos( $content, \"\\n\" ) ) {\n\t\t\t$content = str_replace( array( \"\\r\\n\", \"\\n\", \"\\t\" ), '', $content );\n\t\t}\n\t\t$html .= trim( $content );\n\t}\n\n\tif ( 'mediaelement' === $library ) {\n\t\t$html .= wp_mediaelement_fallback( $fileurl );\n\t}\n\t$html .= '</video>';\n\n\t$width_rule = '';\n\tif ( ! empty( $atts['width'] ) ) {\n\t\t$width_rule = sprintf( 'width: %dpx;', $atts['width'] );\n\t}\n\t$output = sprintf( '<div style=\"%s\" class=\"wp-video\">%s</div>', $width_rule, $html );\n\n\t/**\n\t * Filters the output of the video shortcode.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param string $output  Video shortcode HTML output.\n\t * @param array  $atts    Array of video shortcode attributes.\n\t * @param string $video   Video file.\n\t * @param int    $post_id Post ID.\n\t * @param string $library Media library used for the video shortcode.\n\t */\n\treturn apply_filters( 'wp_video_shortcode', $output, $atts, $video, $post_id, $library );\n}\nadd_shortcode( 'video', 'wp_video_shortcode' );\n\n/**\n * Displays previous image link that has the same post parent.\n *\n * @since 2.5.0\n *\n * @see adjacent_image_link()\n *\n * @param string|array $size Optional. Image size. Accepts any valid image size, an array of width and\n *                           height values in pixels (in that order), 0, or 'none'. 0 or 'none' will\n *                           default to 'post_title' or `$text`. Default 'thumbnail'.\n * @param string       $text Optional. Link text. Default false.\n */\nfunction previous_image_link( $size = 'thumbnail', $text = false ) {\n\tadjacent_image_link( true, $size, $text );\n}\n\n/**\n * Displays next image link that has the same post parent.\n *\n * @since 2.5.0\n *\n * @see adjacent_image_link()\n *\n * @param string|array $size Optional. Image size. Accepts any valid image size, an array of width and\n *                           height values in pixels (in that order), 0, or 'none'. 0 or 'none' will\n *                           default to 'post_title' or `$text`. Default 'thumbnail'.\n * @param string       $text Optional. Link text. Default false.\n */\nfunction next_image_link( $size = 'thumbnail', $text = false ) {\n\tadjacent_image_link( false, $size, $text );\n}\n\n/**\n * Displays next or previous image link that has the same post parent.\n *\n * Retrieves the current attachment object from the $post global.\n *\n * @since 2.5.0\n *\n * @param bool         $prev Optional. Whether to display the next (false) or previous (true) link. Default true.\n * @param string|array $size Optional. Image size. Accepts any valid image size, or an array of width and height\n *                           values in pixels (in that order). Default 'thumbnail'.\n * @param bool         $text Optional. Link text. Default false.\n */\nfunction adjacent_image_link( $prev = true, $size = 'thumbnail', $text = false ) {\n\t$post        = get_post();\n\t$attachments = array_values(\n\t\tget_children(\n\t\t\tarray(\n\t\t\t\t'post_parent'    => $post->post_parent,\n\t\t\t\t'post_status'    => 'inherit',\n\t\t\t\t'post_type'      => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order'          => 'ASC',\n\t\t\t\t'orderby'        => 'menu_order ID',\n\t\t\t)\n\t\t)\n\t);\n\n\tforeach ( $attachments as $k => $attachment ) {\n\t\tif ( intval( $attachment->ID ) === intval( $post->ID ) ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$output        = '';\n\t$attachment_id = 0;\n\n\tif ( $attachments ) {\n\t\t$k = $prev ? $k - 1 : $k + 1;\n\n\t\tif ( isset( $attachments[ $k ] ) ) {\n\t\t\t$attachment_id = $attachments[ $k ]->ID;\n\t\t\t$output        = wp_get_attachment_link( $attachment_id, $size, true, false, $text );\n\t\t}\n\t}\n\n\t$adjacent = $prev ? 'previous' : 'next';\n\n\t/**\n\t * Filters the adjacent image link.\n\t *\n\t * The dynamic portion of the hook name, `$adjacent`, refers to the type of adjacency,\n\t * either 'next', or 'previous'.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $output        Adjacent image HTML markup.\n\t * @param int    $attachment_id Attachment ID\n\t * @param string $size          Image size.\n\t * @param string $text          Link text.\n\t */\n\techo apply_filters( \"{$adjacent}_image_link\", $output, $attachment_id, $size, $text );\n}\n\n/**\n * Retrieves taxonomies attached to given the attachment.\n *\n * @since 2.5.0\n * @since 4.7.0 Introduced the `$output` parameter.\n *\n * @param int|array|object $attachment Attachment ID, data array, or data object.\n * @param string           $output     Output type. 'names' to return an array of taxonomy names,\n *                                     or 'objects' to return an array of taxonomy objects.\n *                                     Default is 'names'.\n * @return string[]|WP_Taxonomy[] List of taxonomies or taxonomy names. Empty array on failure.\n */\nfunction get_attachment_taxonomies( $attachment, $output = 'names' ) {\n\tif ( is_int( $attachment ) ) {\n\t\t$attachment = get_post( $attachment );\n\t} elseif ( is_array( $attachment ) ) {\n\t\t$attachment = (object) $attachment;\n\t}\n\n\tif ( ! is_object( $attachment ) ) {\n\t\treturn array();\n\t}\n\n\t$file     = get_attached_file( $attachment->ID );\n\t$filename = wp_basename( $file );\n\n\t$objects = array( 'attachment' );\n\n\tif ( false !== strpos( $filename, '.' ) ) {\n\t\t$objects[] = 'attachment:' . substr( $filename, strrpos( $filename, '.' ) + 1 );\n\t}\n\n\tif ( ! empty( $attachment->post_mime_type ) ) {\n\t\t$objects[] = 'attachment:' . $attachment->post_mime_type;\n\n\t\tif ( false !== strpos( $attachment->post_mime_type, '/' ) ) {\n\t\t\tforeach ( explode( '/', $attachment->post_mime_type ) as $token ) {\n\t\t\t\tif ( ! empty( $token ) ) {\n\t\t\t\t\t$objects[] = \"attachment:$token\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t$taxonomies = array();\n\n\tforeach ( $objects as $object ) {\n\t\t$taxes = get_object_taxonomies( $object, $output );\n\n\t\tif ( $taxes ) {\n\t\t\t$taxonomies = array_merge( $taxonomies, $taxes );\n\t\t}\n\t}\n\n\tif ( 'names' === $output ) {\n\t\t$taxonomies = array_unique( $taxonomies );\n\t}\n\n\treturn $taxonomies;\n}\n\n/**\n * Retrieves all of the taxonomies that are registered for attachments.\n *\n * Handles mime-type-specific taxonomies such as attachment:image and attachment:video.\n *\n * @since 3.5.0\n *\n * @see get_taxonomies()\n *\n * @param string $output Optional. The type of taxonomy output to return. Accepts 'names' or 'objects'.\n *                       Default 'names'.\n * @return string[]|WP_Taxonomy[] Array of names or objects of registered taxonomies for attachments.\n */\nfunction get_taxonomies_for_attachments( $output = 'names' ) {\n\t$taxonomies = array();\n\n\tforeach ( get_taxonomies( array(), 'objects' ) as $taxonomy ) {\n\t\tforeach ( $taxonomy->object_type as $object_type ) {\n\t\t\tif ( 'attachment' === $object_type || 0 === strpos( $object_type, 'attachment:' ) ) {\n\t\t\t\tif ( 'names' === $output ) {\n\t\t\t\t\t$taxonomies[] = $taxonomy->name;\n\t\t\t\t} else {\n\t\t\t\t\t$taxonomies[ $taxonomy->name ] = $taxonomy;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $taxonomies;\n}\n\n/**\n * Create new GD image resource with transparency support\n *\n * @todo Deprecate if possible.\n *\n * @since 2.9.0\n *\n * @param int $width  Image width in pixels.\n * @param int $height Image height in pixels..\n * @return resource The GD image resource.\n */\nfunction wp_imagecreatetruecolor( $width, $height ) {\n\t$img = imagecreatetruecolor( $width, $height );\n\tif ( is_resource( $img ) && function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' ) ) {\n\t\timagealphablending( $img, false );\n\t\timagesavealpha( $img, true );\n\t}\n\treturn $img;\n}\n\n/**\n * Based on a supplied width/height example, return the biggest possible dimensions based on the max width/height.\n *\n * @since 2.9.0\n *\n * @see wp_constrain_dimensions()\n *\n * @param int $example_width  The width of an example embed.\n * @param int $example_height The height of an example embed.\n * @param int $max_width      The maximum allowed width.\n * @param int $max_height     The maximum allowed height.\n * @return int[] {\n *     An array of maximum width and height values.\n *\n *     @type int $0 The maximum width in pixels.\n *     @type int $1 The maximum height in pixels.\n * }\n */\nfunction wp_expand_dimensions( $example_width, $example_height, $max_width, $max_height ) {\n\t$example_width  = (int) $example_width;\n\t$example_height = (int) $example_height;\n\t$max_width      = (int) $max_width;\n\t$max_height     = (int) $max_height;\n\n\treturn wp_constrain_dimensions( $example_width * 1000000, $example_height * 1000000, $max_width, $max_height );\n}\n\n/**\n * Determines the maximum upload size allowed in php.ini.\n *\n * @since 2.5.0\n *\n * @return int Allowed upload size.\n */\nfunction wp_max_upload_size() {\n\t$u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) );\n\t$p_bytes = wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) );\n\n\t/**\n\t * Filters the maximum upload size allowed in php.ini.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param int $size    Max upload size limit in bytes.\n\t * @param int $u_bytes Maximum upload filesize in bytes.\n\t * @param int $p_bytes Maximum size of POST data in bytes.\n\t */\n\treturn apply_filters( 'upload_size_limit', min( $u_bytes, $p_bytes ), $u_bytes, $p_bytes );\n}\n\n/**\n * Returns a WP_Image_Editor instance and loads file into it.\n *\n * @since 3.5.0\n *\n * @param string $path Path to the file to load.\n * @param array  $args Optional. Additional arguments for retrieving the image editor.\n *                     Default empty array.\n * @return WP_Image_Editor|WP_Error The WP_Image_Editor object if successful, an WP_Error\n *                                  object otherwise.\n */\nfunction wp_get_image_editor( $path, $args = array() ) {\n\t$args['path'] = $path;\n\n\tif ( ! isset( $args['mime_type'] ) ) {\n\t\t$file_info = wp_check_filetype( $args['path'] );\n\n\t\t// If $file_info['type'] is false, then we let the editor attempt to\n\t\t// figure out the file type, rather than forcing a failure based on extension.\n\t\tif ( isset( $file_info ) && $file_info['type'] ) {\n\t\t\t$args['mime_type'] = $file_info['type'];\n\t\t}\n\t}\n\n\t$implementation = _wp_image_editor_choose( $args );\n\n\tif ( $implementation ) {\n\t\t$editor = new $implementation( $path );\n\t\t$loaded = $editor->load();\n\n\t\tif ( is_wp_error( $loaded ) ) {\n\t\t\treturn $loaded;\n\t\t}\n\n\t\treturn $editor;\n\t}\n\n\treturn new WP_Error( 'image_no_editor', __( 'No editor could be selected.' ) );\n}\n\n/**\n * Tests whether there is an editor that supports a given mime type or methods.\n *\n * @since 3.5.0\n *\n * @param string|array $args Optional. Array of arguments to retrieve the image editor supports.\n *                           Default empty array.\n * @return bool True if an eligible editor is found; false otherwise.\n */\nfunction wp_image_editor_supports( $args = array() ) {\n\treturn (bool) _wp_image_editor_choose( $args );\n}\n\n/**\n * Tests which editors are capable of supporting the request.\n *\n * @ignore\n * @since 3.5.0\n *\n * @param array $args Optional. Array of arguments for choosing a capable editor. Default empty array.\n * @return string|false Class name for the first editor that claims to support the request. False if no\n *                     editor claims to support the request.\n */\nfunction _wp_image_editor_choose( $args = array() ) {\n\trequire_once ABSPATH . WPINC . '/class-wp-image-editor.php';\n\trequire_once ABSPATH . WPINC . '/class-wp-image-editor-gd.php';\n\trequire_once ABSPATH . WPINC . '/class-wp-image-editor-imagick.php';\n\t/**\n\t * Filters the list of image editing library classes.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string[] $image_editors Array of available image editor class names. Defaults are\n\t *                                'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD'.\n\t */\n\t$implementations = apply_filters( 'wp_image_editors', array( 'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD' ) );\n\n\tforeach ( $implementations as $implementation ) {\n\t\tif ( ! call_user_func( array( $implementation, 'test' ), $args ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( isset( $args['mime_type'] ) &&\n\t\t\t! call_user_func(\n\t\t\t\tarray( $implementation, 'supports_mime_type' ),\n\t\t\t\t$args['mime_type']\n\t\t\t) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( isset( $args['methods'] ) &&\n\t\t\tarray_diff( $args['methods'], get_class_methods( $implementation ) ) ) {\n\n\t\t\tcontinue;\n\t\t}\n\n\t\treturn $implementation;\n\t}\n\n\treturn false;\n}\n\n/**\n * Prints default Plupload arguments.\n *\n * @since 3.4.0\n */\nfunction wp_plupload_default_settings() {\n\t$wp_scripts = wp_scripts();\n\n\t$data = $wp_scripts->get_data( 'wp-plupload', 'data' );\n\tif ( $data && false !== strpos( $data, '_wpPluploadSettings' ) ) {\n\t\treturn;\n\t}\n\n\t$max_upload_size    = wp_max_upload_size();\n\t$allowed_extensions = array_keys( get_allowed_mime_types() );\n\t$extensions         = array();\n\tforeach ( $allowed_extensions as $extension ) {\n\t\t$extensions = array_merge( $extensions, explode( '|', $extension ) );\n\t}\n\n\t/*\n\t * Since 4.9 the `runtimes` setting is hardcoded in our version of Plupload to `html5,html4`,\n\t * and the `flash_swf_url` and `silverlight_xap_url` are not used.\n\t */\n\t$defaults = array(\n\t\t'file_data_name' => 'async-upload', // Key passed to $_FILE.\n\t\t'url'            => admin_url( 'async-upload.php', 'relative' ),\n\t\t'filters'        => array(\n\t\t\t'max_file_size' => $max_upload_size . 'b',\n\t\t\t'mime_types'    => array( array( 'extensions' => implode( ',', $extensions ) ) ),\n\t\t),\n\t);\n\n\t/*\n\t * Currently only iOS Safari supports multiple files uploading,\n\t * but iOS 7.x has a bug that prevents uploading of videos when enabled.\n\t * See #29602.\n\t */\n\tif ( wp_is_mobile() && strpos( $_SERVER['HTTP_USER_AGENT'], 'OS 7_' ) !== false &&\n\t\tstrpos( $_SERVER['HTTP_USER_AGENT'], 'like Mac OS X' ) !== false ) {\n\n\t\t$defaults['multi_selection'] = false;\n\t}\n\n\t/**\n\t * Filters the Plupload default settings.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param array $defaults Default Plupload settings array.\n\t */\n\t$defaults = apply_filters( 'plupload_default_settings', $defaults );\n\n\t$params = array(\n\t\t'action' => 'upload-attachment',\n\t);\n\n\t/**\n\t * Filters the Plupload default parameters.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param array $params Default Plupload parameters array.\n\t */\n\t$params = apply_filters( 'plupload_default_params', $params );\n\n\t$params['_wpnonce'] = wp_create_nonce( 'media-form' );\n\n\t$defaults['multipart_params'] = $params;\n\n\t$settings = array(\n\t\t'defaults'      => $defaults,\n\t\t'browser'       => array(\n\t\t\t'mobile'    => wp_is_mobile(),\n\t\t\t'supported' => _device_can_upload(),\n\t\t),\n\t\t'limitExceeded' => is_multisite() && ! is_upload_space_available(),\n\t);\n\n\t$script = 'var _wpPluploadSettings = ' . wp_json_encode( $settings ) . ';';\n\n\tif ( $data ) {\n\t\t$script = \"$data\\n$script\";\n\t}\n\n\t$wp_scripts->add_data( 'wp-plupload', 'data', $script );\n}\n\n/**\n * Prepares an attachment post object for JS, where it is expected\n * to be JSON-encoded and fit into an Attachment model.\n *\n * @since 3.5.0\n *\n * @param int|WP_Post $attachment Attachment ID or object.\n * @return array|void Array of attachment details.\n */\nfunction wp_prepare_attachment_for_js( $attachment ) {\n\t$attachment = get_post( $attachment );\n\n\tif ( ! $attachment ) {\n\t\treturn;\n\t}\n\n\tif ( 'attachment' !== $attachment->post_type ) {\n\t\treturn;\n\t}\n\n\t$meta = wp_get_attachment_metadata( $attachment->ID );\n\tif ( false !== strpos( $attachment->post_mime_type, '/' ) ) {\n\t\tlist( $type, $subtype ) = explode( '/', $attachment->post_mime_type );\n\t} else {\n\t\tlist( $type, $subtype ) = array( $attachment->post_mime_type, '' );\n\t}\n\n\t$attachment_url = wp_get_attachment_url( $attachment->ID );\n\t$base_url       = str_replace( wp_basename( $attachment_url ), '', $attachment_url );\n\n\t$response = array(\n\t\t'id'            => $attachment->ID,\n\t\t'title'         => $attachment->post_title,\n\t\t'filename'      => wp_basename( get_attached_file( $attachment->ID ) ),\n\t\t'url'           => $attachment_url,\n\t\t'link'          => get_attachment_link( $attachment->ID ),\n\t\t'alt'           => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ),\n\t\t'author'        => $attachment->post_author,\n\t\t'description'   => $attachment->post_content,\n\t\t'caption'       => $attachment->post_excerpt,\n\t\t'name'          => $attachment->post_name,\n\t\t'status'        => $attachment->post_status,\n\t\t'uploadedTo'    => $attachment->post_parent,\n\t\t'date'          => strtotime( $attachment->post_date_gmt ) * 1000,\n\t\t'modified'      => strtotime( $attachment->post_modified_gmt ) * 1000,\n\t\t'menuOrder'     => $attachment->menu_order,\n\t\t'mime'          => $attachment->post_mime_type,\n\t\t'type'          => $type,\n\t\t'subtype'       => $subtype,\n\t\t'icon'          => wp_mime_type_icon( $attachment->ID ),\n\t\t'dateFormatted' => mysql2date( __( 'F j, Y' ), $attachment->post_date ),\n\t\t'nonces'        => array(\n\t\t\t'update' => false,\n\t\t\t'delete' => false,\n\t\t\t'edit'   => false,\n\t\t),\n\t\t'editLink'      => false,\n\t\t'meta'          => false,\n\t);\n\n\t$author = new WP_User( $attachment->post_author );\n\tif ( $author->exists() ) {\n\t\t$response['authorName'] = html_entity_decode( $author->display_name, ENT_QUOTES, get_bloginfo( 'charset' ) );\n\t} else {\n\t\t$response['authorName'] = __( '(no author)' );\n\t}\n\n\tif ( $attachment->post_parent ) {\n\t\t$post_parent = get_post( $attachment->post_parent );\n\t} else {\n\t\t$post_parent = false;\n\t}\n\n\tif ( $post_parent ) {\n\t\t$parent_type = get_post_type_object( $post_parent->post_type );\n\n\t\tif ( $parent_type && $parent_type->show_ui && current_user_can( 'edit_post', $attachment->post_parent ) ) {\n\t\t\t$response['uploadedToLink'] = get_edit_post_link( $attachment->post_parent, 'raw' );\n\t\t}\n\n\t\tif ( $parent_type && current_user_can( 'read_post', $attachment->post_parent ) ) {\n\t\t\t$response['uploadedToTitle'] = $post_parent->post_title ? $post_parent->post_title : __( '(no title)' );\n\t\t}\n\t}\n\n\t$attached_file = get_attached_file( $attachment->ID );\n\n\tif ( isset( $meta['filesize'] ) ) {\n\t\t$bytes = $meta['filesize'];\n\t} elseif ( file_exists( $attached_file ) ) {\n\t\t$bytes = filesize( $attached_file );\n\t} else {\n\t\t$bytes = '';\n\t}\n\n\tif ( $bytes ) {\n\t\t$response['filesizeInBytes']       = $bytes;\n\t\t$response['filesizeHumanReadable'] = size_format( $bytes );\n\t}\n\n\t$context             = get_post_meta( $attachment->ID, '_wp_attachment_context', true );\n\t$response['context'] = ( $context ) ? $context : '';\n\n\tif ( current_user_can( 'edit_post', $attachment->ID ) ) {\n\t\t$response['nonces']['update'] = wp_create_nonce( 'update-post_' . $attachment->ID );\n\t\t$response['nonces']['edit']   = wp_create_nonce( 'image_editor-' . $attachment->ID );\n\t\t$response['editLink']         = get_edit_post_link( $attachment->ID, 'raw' );\n\t}\n\n\tif ( current_user_can( 'delete_post', $attachment->ID ) ) {\n\t\t$response['nonces']['delete'] = wp_create_nonce( 'delete-post_' . $attachment->ID );\n\t}\n\n\tif ( $meta && ( 'image' === $type || ! empty( $meta['sizes'] ) ) ) {\n\t\t$sizes = array();\n\n\t\t/** This filter is documented in wp-admin/includes/media.php */\n\t\t$possible_sizes = apply_filters(\n\t\t\t'image_size_names_choose',\n\t\t\tarray(\n\t\t\t\t'thumbnail' => __( 'Thumbnail' ),\n\t\t\t\t'medium'    => __( 'Medium' ),\n\t\t\t\t'large'     => __( 'Large' ),\n\t\t\t\t'full'      => __( 'Full Size' ),\n\t\t\t)\n\t\t);\n\t\tunset( $possible_sizes['full'] );\n\n\t\t/*\n\t\t * Loop through all potential sizes that may be chosen. Try to do this with some efficiency.\n\t\t * First: run the image_downsize filter. If it returns something, we can use its data.\n\t\t * If the filter does not return something, then image_downsize() is just an expensive way\n\t\t * to check the image metadata, which we do second.\n\t\t */\n\t\tforeach ( $possible_sizes as $size => $label ) {\n\n\t\t\t/** This filter is documented in wp-includes/media.php */\n\t\t\t$downsize = apply_filters( 'image_downsize', false, $attachment->ID, $size );\n\n\t\t\tif ( $downsize ) {\n\t\t\t\tif ( empty( $downsize[3] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$sizes[ $size ] = array(\n\t\t\t\t\t'height'      => $downsize[2],\n\t\t\t\t\t'width'       => $downsize[1],\n\t\t\t\t\t'url'         => $downsize[0],\n\t\t\t\t\t'orientation' => $downsize[2] > $downsize[1] ? 'portrait' : 'landscape',\n\t\t\t\t);\n\t\t\t} elseif ( isset( $meta['sizes'][ $size ] ) ) {\n\t\t\t\t// Nothing from the filter, so consult image metadata if we have it.\n\t\t\t\t$size_meta = $meta['sizes'][ $size ];\n\n\t\t\t\t// We have the actual image size, but might need to further constrain it if content_width is narrower.\n\t\t\t\t// Thumbnail, medium, and full sizes are also checked against the site's height/width options.\n\t\t\t\tlist( $width, $height ) = image_constrain_size_for_editor( $size_meta['width'], $size_meta['height'], $size, 'edit' );\n\n\t\t\t\t$sizes[ $size ] = array(\n\t\t\t\t\t'height'      => $height,\n\t\t\t\t\t'width'       => $width,\n\t\t\t\t\t'url'         => $base_url . $size_meta['file'],\n\t\t\t\t\t'orientation' => $height > $width ? 'portrait' : 'landscape',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( 'image' === $type ) {\n\t\t\tif ( ! empty( $meta['original_image'] ) ) {\n\t\t\t\t$response['originalImageURL']  = wp_get_original_image_url( $attachment->ID );\n\t\t\t\t$response['originalImageName'] = wp_basename( wp_get_original_image_path( $attachment->ID ) );\n\t\t\t}\n\n\t\t\t$sizes['full'] = array( 'url' => $attachment_url );\n\n\t\t\tif ( isset( $meta['height'], $meta['width'] ) ) {\n\t\t\t\t$sizes['full']['height']      = $meta['height'];\n\t\t\t\t$sizes['full']['width']       = $meta['width'];\n\t\t\t\t$sizes['full']['orientation'] = $meta['height'] > $meta['width'] ? 'portrait' : 'landscape';\n\t\t\t}\n\n\t\t\t$response = array_merge( $response, $sizes['full'] );\n\t\t} elseif ( $meta['sizes']['full']['file'] ) {\n\t\t\t$sizes['full'] = array(\n\t\t\t\t'url'         => $base_url . $meta['sizes']['full']['file'],\n\t\t\t\t'height'      => $meta['sizes']['full']['height'],\n\t\t\t\t'width'       => $meta['sizes']['full']['width'],\n\t\t\t\t'orientation' => $meta['sizes']['full']['height'] > $meta['sizes']['full']['width'] ? 'portrait' : 'landscape',\n\t\t\t);\n\t\t}\n\n\t\t$response = array_merge( $response, array( 'sizes' => $sizes ) );\n\t}\n\n\tif ( $meta && 'video' === $type ) {\n\t\tif ( isset( $meta['width'] ) ) {\n\t\t\t$response['width'] = (int) $meta['width'];\n\t\t}\n\t\tif ( isset( $meta['height'] ) ) {\n\t\t\t$response['height'] = (int) $meta['height'];\n\t\t}\n\t}\n\n\tif ( $meta && ( 'audio' === $type || 'video' === $type ) ) {\n\t\tif ( isset( $meta['length_formatted'] ) ) {\n\t\t\t$response['fileLength']              = $meta['length_formatted'];\n\t\t\t$response['fileLengthHumanReadable'] = human_readable_duration( $meta['length_formatted'] );\n\t\t}\n\n\t\t$response['meta'] = array();\n\t\tforeach ( wp_get_attachment_id3_keys( $attachment, 'js' ) as $key => $label ) {\n\t\t\t$response['meta'][ $key ] = false;\n\n\t\t\tif ( ! empty( $meta[ $key ] ) ) {\n\t\t\t\t$response['meta'][ $key ] = $meta[ $key ];\n\t\t\t}\n\t\t}\n\n\t\t$id = get_post_thumbnail_id( $attachment->ID );\n\t\tif ( ! empty( $id ) ) {\n\t\t\tlist( $src, $width, $height ) = wp_get_attachment_image_src( $id, 'full' );\n\t\t\t$response['image']            = compact( 'src', 'width', 'height' );\n\t\t\tlist( $src, $width, $height ) = wp_get_attachment_image_src( $id, 'thumbnail' );\n\t\t\t$response['thumb']            = compact( 'src', 'width', 'height' );\n\t\t} else {\n\t\t\t$src               = wp_mime_type_icon( $attachment->ID );\n\t\t\t$width             = 48;\n\t\t\t$height            = 64;\n\t\t\t$response['image'] = compact( 'src', 'width', 'height' );\n\t\t\t$response['thumb'] = compact( 'src', 'width', 'height' );\n\t\t}\n\t}\n\n\tif ( function_exists( 'get_compat_media_markup' ) ) {\n\t\t$response['compat'] = get_compat_media_markup( $attachment->ID, array( 'in_modal' => true ) );\n\t}\n\n\t/**\n\t * Filters the attachment data prepared for JavaScript.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param array       $response   Array of prepared attachment data.\n\t * @param WP_Post     $attachment Attachment object.\n\t * @param array|false $meta       Array of attachment meta data, or false if there is none.\n\t */\n\treturn apply_filters( 'wp_prepare_attachment_for_js', $response, $attachment, $meta );\n}\n\n/**\n * Enqueues all scripts, styles, settings, and templates necessary to use\n * all media JS APIs.\n *\n * @since 3.5.0\n *\n * @global int       $content_width\n * @global wpdb      $wpdb          WordPress database abstraction object.\n * @global WP_Locale $wp_locale     WordPress date and time locale object.\n *\n * @param array $args {\n *     Arguments for enqueuing media scripts.\n *\n *     @type int|WP_Post A post object or ID.\n * }\n */\nfunction wp_enqueue_media( $args = array() ) {\n\t// Enqueue me just once per page, please.\n\tif ( did_action( 'wp_enqueue_media' ) ) {\n\t\treturn;\n\t}\n\n\tglobal $content_width, $wpdb, $wp_locale;\n\n\t$defaults = array(\n\t\t'post' => null,\n\t);\n\t$args     = wp_parse_args( $args, $defaults );\n\n\t// We're going to pass the old thickbox media tabs to `media_upload_tabs`\n\t// to ensure plugins will work. We will then unset those tabs.\n\t$tabs = array(\n\t\t// handler action suffix => tab label\n\t\t'type'     => '',\n\t\t'type_url' => '',\n\t\t'gallery'  => '',\n\t\t'library'  => '',\n\t);\n\n\t/** This filter is documented in wp-admin/includes/media.php */\n\t$tabs = apply_filters( 'media_upload_tabs', $tabs );\n\tunset( $tabs['type'], $tabs['type_url'], $tabs['gallery'], $tabs['library'] );\n\n\t$props = array(\n\t\t'link'  => get_option( 'image_default_link_type' ), // DB default is 'file'.\n\t\t'align' => get_option( 'image_default_align' ),     // Empty default.\n\t\t'size'  => get_option( 'image_default_size' ),      // Empty default.\n\t);\n\n\t$exts      = array_merge( wp_get_audio_extensions(), wp_get_video_extensions() );\n\t$mimes     = get_allowed_mime_types();\n\t$ext_mimes = array();\n\tforeach ( $exts as $ext ) {\n\t\tforeach ( $mimes as $ext_preg => $mime_match ) {\n\t\t\tif ( preg_match( '#' . $ext . '#i', $ext_preg ) ) {\n\t\t\t\t$ext_mimes[ $ext ] = $mime_match;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Allows showing or hiding the \"Create Audio Playlist\" button in the media library.\n\t *\n\t * By default, the \"Create Audio Playlist\" button will always be shown in\n\t * the media library.  If this filter returns `null`, a query will be run\n\t * to determine whether the media library contains any audio items.  This\n\t * was the default behavior prior to version 4.8.0, but this query is\n\t * expensive for large media libraries.\n\t *\n\t * @since 4.7.4\n\t * @since 4.8.0 The filter's default value is `true` rather than `null`.\n\t *\n\t * @link https://core.trac.wordpress.org/ticket/31071\n\t *\n\t * @param bool|null $show Whether to show the button, or `null` to decide based\n\t *                        on whether any audio files exist in the media library.\n\t */\n\t$show_audio_playlist = apply_filters( 'media_library_show_audio_playlist', true );\n\tif ( null === $show_audio_playlist ) {\n\t\t$show_audio_playlist = $wpdb->get_var(\n\t\t\t\"\n\t\t\tSELECT ID\n\t\t\tFROM $wpdb->posts\n\t\t\tWHERE post_type = 'attachment'\n\t\t\tAND post_mime_type LIKE 'audio%'\n\t\t\tLIMIT 1\n\t\t\"\n\t\t);\n\t}\n\n\t/**\n\t * Allows showing or hiding the \"Create Video Playlist\" button in the media library.\n\t *\n\t * By default, the \"Create Video Playlist\" button will always be shown in\n\t * the media library.  If this filter returns `null`, a query will be run\n\t * to determine whether the media library contains any video items.  This\n\t * was the default behavior prior to version 4.8.0, but this query is\n\t * expensive for large media libraries.\n\t *\n\t * @since 4.7.4\n\t * @since 4.8.0 The filter's default value is `true` rather than `null`.\n\t *\n\t * @link https://core.trac.wordpress.org/ticket/31071\n\t *\n\t * @param bool|null $show Whether to show the button, or `null` to decide based\n\t *                        on whether any video files exist in the media library.\n\t */\n\t$show_video_playlist = apply_filters( 'media_library_show_video_playlist', true );\n\tif ( null === $show_video_playlist ) {\n\t\t$show_video_playlist = $wpdb->get_var(\n\t\t\t\"\n\t\t\tSELECT ID\n\t\t\tFROM $wpdb->posts\n\t\t\tWHERE post_type = 'attachment'\n\t\t\tAND post_mime_type LIKE 'video%'\n\t\t\tLIMIT 1\n\t\t\"\n\t\t);\n\t}\n\n\t/**\n\t * Allows overriding the list of months displayed in the media library.\n\t *\n\t * By default (if this filter does not return an array), a query will be\n\t * run to determine the months that have media items.  This query can be\n\t * expensive for large media libraries, so it may be desirable for sites to\n\t * override this behavior.\n\t *\n\t * @since 4.7.4\n\t *\n\t * @link https://core.trac.wordpress.org/ticket/31071\n\t *\n\t * @param array|null $months An array of objects with `month` and `year`\n\t *                           properties, or `null` (or any other non-array value)\n\t *                           for default behavior.\n\t */\n\t$months = apply_filters( 'media_library_months_with_files', null );\n\tif ( ! is_array( $months ) ) {\n\t\t$months = $wpdb->get_results(\n\t\t\t$wpdb->prepare(\n\t\t\t\t\"\n\t\t\tSELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month\n\t\t\tFROM $wpdb->posts\n\t\t\tWHERE post_type = %s\n\t\t\tORDER BY post_date DESC\n\t\t\",\n\t\t\t\t'attachment'\n\t\t\t)\n\t\t);\n\t}\n\tforeach ( $months as $month_year ) {\n\t\t$month_year->text = sprintf(\n\t\t\t/* translators: 1: Month, 2: Year. */\n\t\t\t__( '%1$s %2$d' ),\n\t\t\t$wp_locale->get_month( $month_year->month ),\n\t\t\t$month_year->year\n\t\t);\n\t}\n\n\t$settings = array(\n\t\t'tabs'             => $tabs,\n\t\t'tabUrl'           => add_query_arg( array( 'chromeless' => true ), admin_url( 'media-upload.php' ) ),\n\t\t'mimeTypes'        => wp_list_pluck( get_post_mime_types(), 0 ),\n\t\t/** This filter is documented in wp-admin/includes/media.php */\n\t\t'captions'         => ! apply_filters( 'disable_captions', '' ),\n\t\t'nonce'            => array(\n\t\t\t'sendToEditor' => wp_create_nonce( 'media-send-to-editor' ),\n\t\t),\n\t\t'post'             => array(\n\t\t\t'id' => 0,\n\t\t),\n\t\t'defaultProps'     => $props,\n\t\t'attachmentCounts' => array(\n\t\t\t'audio' => ( $show_audio_playlist ) ? 1 : 0,\n\t\t\t'video' => ( $show_video_playlist ) ? 1 : 0,\n\t\t),\n\t\t'oEmbedProxyUrl'   => rest_url( 'oembed/1.0/proxy' ),\n\t\t'embedExts'        => $exts,\n\t\t'embedMimes'       => $ext_mimes,\n\t\t'contentWidth'     => $content_width,\n\t\t'months'           => $months,\n\t\t'mediaTrash'       => MEDIA_TRASH ? 1 : 0,\n\t);\n\n\t$post = null;\n\tif ( isset( $args['post'] ) ) {\n\t\t$post             = get_post( $args['post'] );\n\t\t$settings['post'] = array(\n\t\t\t'id'    => $post->ID,\n\t\t\t'nonce' => wp_create_nonce( 'update-post_' . $post->ID ),\n\t\t);\n\n\t\t$thumbnail_support = current_theme_supports( 'post-thumbnails', $post->post_type ) && post_type_supports( $post->post_type, 'thumbnail' );\n\t\tif ( ! $thumbnail_support && 'attachment' === $post->post_type && $post->post_mime_type ) {\n\t\t\tif ( wp_attachment_is( 'audio', $post ) ) {\n\t\t\t\t$thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );\n\t\t\t} elseif ( wp_attachment_is( 'video', $post ) ) {\n\t\t\t\t$thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );\n\t\t\t}\n\t\t}\n\n\t\tif ( $thumbnail_support ) {\n\t\t\t$featured_image_id                   = get_post_meta( $post->ID, '_thumbnail_id', true );\n\t\t\t$settings['post']['featuredImageId'] = $featured_image_id ? $featured_image_id : -1;\n\t\t}\n\t}\n\n\tif ( $post ) {\n\t\t$post_type_object = get_post_type_object( $post->post_type );\n\t} else {\n\t\t$post_type_object = get_post_type_object( 'post' );\n\t}\n\n\t$strings = array(\n\t\t// Generic.\n\t\t'mediaFrameDefaultTitle'      => __( 'Media' ),\n\t\t'url'                         => __( 'URL' ),\n\t\t'addMedia'                    => __( 'Add media' ),\n\t\t'search'                      => __( 'Search' ),\n\t\t'select'                      => __( 'Select' ),\n\t\t'cancel'                      => __( 'Cancel' ),\n\t\t'update'                      => __( 'Update' ),\n\t\t'replace'                     => __( 'Replace' ),\n\t\t'remove'                      => __( 'Remove' ),\n\t\t'back'                        => __( 'Back' ),\n\t\t/*\n\t\t * translators: This is a would-be plural string used in the media manager.\n\t\t * If there is not a word you can use in your language to avoid issues with the\n\t\t * lack of plural support here, turn it into \"selected: %d\" then translate it.\n\t\t */\n\t\t'selected'                    => __( '%d selected' ),\n\t\t'dragInfo'                    => __( 'Drag and drop to reorder media files.' ),\n\n\t\t// Upload.\n\t\t'uploadFilesTitle'            => __( 'Upload files' ),\n\t\t'uploadImagesTitle'           => __( 'Upload images' ),\n\n\t\t// Library.\n\t\t'mediaLibraryTitle'           => __( 'Media Library' ),\n\t\t'insertMediaTitle'            => __( 'Add media' ),\n\t\t'createNewGallery'            => __( 'Create a new gallery' ),\n\t\t'createNewPlaylist'           => __( 'Create a new playlist' ),\n\t\t'createNewVideoPlaylist'      => __( 'Create a new video playlist' ),\n\t\t'returnToLibrary'             => __( '&#8592; Return to library' ),\n\t\t'allMediaItems'               => __( 'All media items' ),\n\t\t'allDates'                    => __( 'All dates' ),\n\t\t'noItemsFound'                => __( 'No items found.' ),\n\t\t'insertIntoPost'              => $post_type_object->labels->insert_into_item,\n\t\t'unattached'                  => __( 'Unattached' ),\n\t\t'mine'                        => _x( 'Mine', 'media items' ),\n\t\t'trash'                       => _x( 'Trash', 'noun' ),\n\t\t'uploadedToThisPost'          => $post_type_object->labels->uploaded_to_this_item,\n\t\t'warnDelete'                  => __( \"You are about to permanently delete this item from your site.\\nThis action cannot be undone.\\n 'Cancel' to stop, 'OK' to delete.\" ),\n\t\t'warnBulkDelete'              => __( \"You are about to permanently delete these items from your site.\\nThis action cannot be undone.\\n 'Cancel' to stop, 'OK' to delete.\" ),\n\t\t'warnBulkTrash'               => __( \"You are about to trash these items.\\n  'Cancel' to stop, 'OK' to delete.\" ),\n\t\t'bulkSelect'                  => __( 'Bulk select' ),\n\t\t'trashSelected'               => __( 'Move to Trash' ),\n\t\t'restoreSelected'             => __( 'Restore from Trash' ),\n\t\t'deletePermanently'           => __( 'Delete permanently' ),\n\t\t'apply'                       => __( 'Apply' ),\n\t\t'filterByDate'                => __( 'Filter by date' ),\n\t\t'filterByType'                => __( 'Filter by type' ),\n\t\t'searchLabel'                 => __( 'Search' ),\n\t\t'searchMediaLabel'            => __( 'Search media' ),          // Backward compatibility pre-5.3.\n\t\t'searchMediaPlaceholder'      => __( 'Search media items...' ), // Placeholder (no ellipsis), backward compatibility pre-5.3.\n\t\t'mediaFound'                  => __( 'Number of media items found: %d' ),\n\t\t'mediaFoundHasMoreResults'    => __( 'Number of media items displayed: %d. Scroll the page for more results.' ),\n\t\t'noMedia'                     => __( 'No media items found.' ),\n\t\t'noMediaTryNewSearch'         => __( 'No media items found. Try a different search.' ),\n\n\t\t// Library Details.\n\t\t'attachmentDetails'           => __( 'Attachment details' ),\n\n\t\t// From URL.\n\t\t'insertFromUrlTitle'          => __( 'Insert from URL' ),\n\n\t\t// Featured Images.\n\t\t'setFeaturedImageTitle'       => $post_type_object->labels->featured_image,\n\t\t'setFeaturedImage'            => $post_type_object->labels->set_featured_image,\n\n\t\t// Gallery.\n\t\t'createGalleryTitle'          => __( 'Create gallery' ),\n\t\t'editGalleryTitle'            => __( 'Edit gallery' ),\n\t\t'cancelGalleryTitle'          => __( '&#8592; Cancel gallery' ),\n\t\t'insertGallery'               => __( 'Insert gallery' ),\n\t\t'updateGallery'               => __( 'Update gallery' ),\n\t\t'addToGallery'                => __( 'Add to gallery' ),\n\t\t'addToGalleryTitle'           => __( 'Add to gallery' ),\n\t\t'reverseOrder'                => __( 'Reverse order' ),\n\n\t\t// Edit Image.\n\t\t'imageDetailsTitle'           => __( 'Image details' ),\n\t\t'imageReplaceTitle'           => __( 'Replace image' ),\n\t\t'imageDetailsCancel'          => __( 'Cancel edit' ),\n\t\t'editImage'                   => __( 'Edit image' ),\n\n\t\t// Crop Image.\n\t\t'chooseImage'                 => __( 'Choose image' ),\n\t\t'selectAndCrop'               => __( 'Select and crop' ),\n\t\t'skipCropping'                => __( 'Skip cropping' ),\n\t\t'cropImage'                   => __( 'Crop image' ),\n\t\t'cropYourImage'               => __( 'Crop your image' ),\n\t\t'cropping'                    => __( 'Cropping&hellip;' ),\n\t\t/* translators: 1: Suggested width number, 2: Suggested height number. */\n\t\t'suggestedDimensions'         => __( 'Suggested image dimensions: %1$s by %2$s pixels.' ),\n\t\t'cropError'                   => __( 'There has been an error cropping your image.' ),\n\n\t\t// Edit Audio.\n\t\t'audioDetailsTitle'           => __( 'Audio details' ),\n\t\t'audioReplaceTitle'           => __( 'Replace audio' ),\n\t\t'audioAddSourceTitle'         => __( 'Add audio source' ),\n\t\t'audioDetailsCancel'          => __( 'Cancel edit' ),\n\n\t\t// Edit Video.\n\t\t'videoDetailsTitle'           => __( 'Video details' ),\n\t\t'videoReplaceTitle'           => __( 'Replace video' ),\n\t\t'videoAddSourceTitle'         => __( 'Add video source' ),\n\t\t'videoDetailsCancel'          => __( 'Cancel edit' ),\n\t\t'videoSelectPosterImageTitle' => __( 'Select poster image' ),\n\t\t'videoAddTrackTitle'          => __( 'Add subtitles' ),\n\n\t\t// Playlist.\n\t\t'playlistDragInfo'            => __( 'Drag and drop to reorder tracks.' ),\n\t\t'createPlaylistTitle'         => __( 'Create audio playlist' ),\n\t\t'editPlaylistTitle'           => __( 'Edit audio playlist' ),\n\t\t'cancelPlaylistTitle'         => __( '&#8592; Cancel audio playlist' ),\n\t\t'insertPlaylist'              => __( 'Insert audio playlist' ),\n\t\t'updatePlaylist'              => __( 'Update audio playlist' ),\n\t\t'addToPlaylist'               => __( 'Add to audio playlist' ),\n\t\t'addToPlaylistTitle'          => __( 'Add to Audio Playlist' ),\n\n\t\t// Video Playlist.\n\t\t'videoPlaylistDragInfo'       => __( 'Drag and drop to reorder videos.' ),\n\t\t'createVideoPlaylistTitle'    => __( 'Create video playlist' ),\n\t\t'editVideoPlaylistTitle'      => __( 'Edit video playlist' ),\n\t\t'cancelVideoPlaylistTitle'    => __( '&#8592; Cancel video playlist' ),\n\t\t'insertVideoPlaylist'         => __( 'Insert video playlist' ),\n\t\t'updateVideoPlaylist'         => __( 'Update video playlist' ),\n\t\t'addToVideoPlaylist'          => __( 'Add to video playlist' ),\n\t\t'addToVideoPlaylistTitle'     => __( 'Add to video Playlist' ),\n\n\t\t// Headings.\n\t\t'filterAttachments'           => __( 'Filter media' ),\n\t\t'attachmentsList'             => __( 'Media list' ),\n\t);\n\n\t/**\n\t * Filters the media view settings.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param array   $settings List of media view settings.\n\t * @param WP_Post $post     Post object.\n\t */\n\t$settings = apply_filters( 'media_view_settings', $settings, $post );\n\n\t/**\n\t * Filters the media view strings.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string[] $strings Array of media view strings keyed by the name they'll be referenced by in JavaScript.\n\t * @param WP_Post  $post    Post object.\n\t */\n\t$strings = apply_filters( 'media_view_strings', $strings, $post );\n\n\t$strings['settings'] = $settings;\n\n\t// Ensure we enqueue media-editor first, that way media-views\n\t// is registered internally before we try to localize it. See #24724.\n\twp_enqueue_script( 'media-editor' );\n\twp_localize_script( 'media-views', '_wpMediaViewsL10n', $strings );\n\n\twp_enqueue_script( 'media-audiovideo' );\n\twp_enqueue_style( 'media-views' );\n\tif ( is_admin() ) {\n\t\twp_enqueue_script( 'mce-view' );\n\t\twp_enqueue_script( 'image-edit' );\n\t}\n\twp_enqueue_style( 'imgareaselect' );\n\twp_plupload_default_settings();\n\n\trequire_once ABSPATH . WPINC . '/media-template.php';\n\tadd_action( 'admin_footer', 'wp_print_media_templates' );\n\tadd_action( 'wp_footer', 'wp_print_media_templates' );\n\tadd_action( 'customize_controls_print_footer_scripts', 'wp_print_media_templates' );\n\n\t/**\n\t * Fires at the conclusion of wp_enqueue_media().\n\t *\n\t * @since 3.5.0\n\t */\n\tdo_action( 'wp_enqueue_media' );\n}\n\n/**\n * Retrieves media attached to the passed post.\n *\n * @since 3.6.0\n *\n * @param string      $type Mime type.\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.\n * @return WP_Post[] Array of media attached to the given post.\n */\nfunction get_attached_media( $type, $post = 0 ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn array();\n\t}\n\n\t$args = array(\n\t\t'post_parent'    => $post->ID,\n\t\t'post_type'      => 'attachment',\n\t\t'post_mime_type' => $type,\n\t\t'posts_per_page' => -1,\n\t\t'orderby'        => 'menu_order',\n\t\t'order'          => 'ASC',\n\t);\n\n\t/**\n\t * Filters arguments used to retrieve media attached to the given post.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param array   $args Post query arguments.\n\t * @param string  $type Mime type of the desired media.\n\t * @param WP_Post $post Post object.\n\t */\n\t$args = apply_filters( 'get_attached_media_args', $args, $type, $post );\n\n\t$children = get_children( $args );\n\n\t/**\n\t * Filters the list of media attached to the given post.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param WP_Post[] $children Array of media attached to the given post.\n\t * @param string    $type     Mime type of the media desired.\n\t * @param WP_Post   $post     Post object.\n\t */\n\treturn (array) apply_filters( 'get_attached_media', $children, $type, $post );\n}\n\n/**\n * Check the content HTML for a audio, video, object, embed, or iframe tags.\n *\n * @since 3.6.0\n *\n * @param string   $content A string of HTML which might contain media elements.\n * @param string[] $types   An array of media types: 'audio', 'video', 'object', 'embed', or 'iframe'.\n * @return string[] Array of found HTML media elements.\n */\nfunction get_media_embedded_in_content( $content, $types = null ) {\n\t$html = array();\n\n\t/**\n\t * Filters the embedded media types that are allowed to be returned from the content blob.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param string[] $allowed_media_types An array of allowed media types. Default media types are\n\t *                                      'audio', 'video', 'object', 'embed', and 'iframe'.\n\t */\n\t$allowed_media_types = apply_filters( 'media_embedded_in_content_allowed_types', array( 'audio', 'video', 'object', 'embed', 'iframe' ) );\n\n\tif ( ! empty( $types ) ) {\n\t\tif ( ! is_array( $types ) ) {\n\t\t\t$types = array( $types );\n\t\t}\n\n\t\t$allowed_media_types = array_intersect( $allowed_media_types, $types );\n\t}\n\n\t$tags = implode( '|', $allowed_media_types );\n\n\tif ( preg_match_all( '#<(?P<tag>' . $tags . ')[^<]*?(?:>[\\s\\S]*?<\\/(?P=tag)>|\\s*\\/>)#', $content, $matches ) ) {\n\t\tforeach ( $matches[0] as $match ) {\n\t\t\t$html[] = $match;\n\t\t}\n\t}\n\n\treturn $html;\n}\n\n/**\n * Retrieves galleries from the passed post's content.\n *\n * @since 3.6.0\n *\n * @param int|WP_Post $post Post ID or object.\n * @param bool        $html Optional. Whether to return HTML or data in the array. Default true.\n * @return array A list of arrays, each containing gallery data and srcs parsed\n *               from the expanded shortcode.\n */\nfunction get_post_galleries( $post, $html = true ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn array();\n\t}\n\n\tif ( ! has_shortcode( $post->post_content, 'gallery' ) ) {\n\t\treturn array();\n\t}\n\n\t$galleries = array();\n\tif ( preg_match_all( '/' . get_shortcode_regex() . '/s', $post->post_content, $matches, PREG_SET_ORDER ) ) {\n\t\tforeach ( $matches as $shortcode ) {\n\t\t\tif ( 'gallery' === $shortcode[2] ) {\n\t\t\t\t$srcs = array();\n\n\t\t\t\t$shortcode_attrs = shortcode_parse_atts( $shortcode[3] );\n\t\t\t\tif ( ! is_array( $shortcode_attrs ) ) {\n\t\t\t\t\t$shortcode_attrs = array();\n\t\t\t\t}\n\n\t\t\t\t// Specify the post ID of the gallery we're viewing if the shortcode doesn't reference another post already.\n\t\t\t\tif ( ! isset( $shortcode_attrs['id'] ) ) {\n\t\t\t\t\t$shortcode[3] .= ' id=\"' . intval( $post->ID ) . '\"';\n\t\t\t\t}\n\n\t\t\t\t$gallery = do_shortcode_tag( $shortcode );\n\t\t\t\tif ( $html ) {\n\t\t\t\t\t$galleries[] = $gallery;\n\t\t\t\t} else {\n\t\t\t\t\tpreg_match_all( '#src=([\\'\"])(.+?)\\1#is', $gallery, $src, PREG_SET_ORDER );\n\t\t\t\t\tif ( ! empty( $src ) ) {\n\t\t\t\t\t\tforeach ( $src as $s ) {\n\t\t\t\t\t\t\t$srcs[] = $s[2];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$galleries[] = array_merge(\n\t\t\t\t\t\t$shortcode_attrs,\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'src' => array_values( array_unique( $srcs ) ),\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filters the list of all found galleries in the given post.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param array   $galleries Associative array of all found post galleries.\n\t * @param WP_Post $post      Post object.\n\t */\n\treturn apply_filters( 'get_post_galleries', $galleries, $post );\n}\n\n/**\n * Check a specified post's content for gallery and, if present, return the first\n *\n * @since 3.6.0\n *\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.\n * @param bool        $html Optional. Whether to return HTML or data. Default is true.\n * @return string|array Gallery data and srcs parsed from the expanded shortcode.\n */\nfunction get_post_gallery( $post = 0, $html = true ) {\n\t$galleries = get_post_galleries( $post, $html );\n\t$gallery   = reset( $galleries );\n\n\t/**\n\t * Filters the first-found post gallery.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param array       $gallery   The first-found post gallery.\n\t * @param int|WP_Post $post      Post ID or object.\n\t * @param array       $galleries Associative array of all found post galleries.\n\t */\n\treturn apply_filters( 'get_post_gallery', $gallery, $post, $galleries );\n}\n\n/**\n * Retrieve the image srcs from galleries from a post's content, if present\n *\n * @since 3.6.0\n *\n * @see get_post_galleries()\n *\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.\n * @return array A list of lists, each containing image srcs parsed.\n *               from an expanded shortcode\n */\nfunction get_post_galleries_images( $post = 0 ) {\n\t$galleries = get_post_galleries( $post, false );\n\treturn wp_list_pluck( $galleries, 'src' );\n}\n\n/**\n * Checks a post's content for galleries and return the image srcs for the first found gallery\n *\n * @since 3.6.0\n *\n * @see get_post_gallery()\n *\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.\n * @return string[] A list of a gallery's image srcs in order.\n */\nfunction get_post_gallery_images( $post = 0 ) {\n\t$gallery = get_post_gallery( $post, false );\n\treturn empty( $gallery['src'] ) ? array() : $gallery['src'];\n}\n\n/**\n * Maybe attempts to generate attachment metadata, if missing.\n *\n * @since 3.9.0\n *\n * @param WP_Post $attachment Attachment object.\n */\nfunction wp_maybe_generate_attachment_metadata( $attachment ) {\n\tif ( empty( $attachment ) || empty( $attachment->ID ) ) {\n\t\treturn;\n\t}\n\n\t$attachment_id = (int) $attachment->ID;\n\t$file          = get_attached_file( $attachment_id );\n\t$meta          = wp_get_attachment_metadata( $attachment_id );\n\n\tif ( empty( $meta ) && file_exists( $file ) ) {\n\t\t$_meta = get_post_meta( $attachment_id );\n\t\t$_lock = 'wp_generating_att_' . $attachment_id;\n\n\t\tif ( ! array_key_exists( '_wp_attachment_metadata', $_meta ) && ! get_transient( $_lock ) ) {\n\t\t\tset_transient( $_lock, $file );\n\t\t\twp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) );\n\t\t\tdelete_transient( $_lock );\n\t\t}\n\t}\n}\n\n/**\n * Tries to convert an attachment URL into a post ID.\n *\n * @since 4.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $url The URL to resolve.\n * @return int The found post ID, or 0 on failure.\n */\nfunction attachment_url_to_postid( $url ) {\n\tglobal $wpdb;\n\n\t$dir  = wp_get_upload_dir();\n\t$path = $url;\n\n\t$site_url   = parse_url( $dir['url'] );\n\t$image_path = parse_url( $path );\n\n\t// Force the protocols to match if needed.\n\tif ( isset( $image_path['scheme'] ) && ( $image_path['scheme'] !== $site_url['scheme'] ) ) {\n\t\t$path = str_replace( $image_path['scheme'], $site_url['scheme'], $path );\n\t}\n\n\tif ( 0 === strpos( $path, $dir['baseurl'] . '/' ) ) {\n\t\t$path = substr( $path, strlen( $dir['baseurl'] . '/' ) );\n\t}\n\n\t$sql = $wpdb->prepare(\n\t\t\"SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = '_wp_attached_file' AND meta_value = %s\",\n\t\t$path\n\t);\n\n\t$results = $wpdb->get_results( $sql );\n\t$post_id = null;\n\n\tif ( $results ) {\n\t\t// Use the first available result, but prefer a case-sensitive match, if exists.\n\t\t$post_id = reset( $results )->post_id;\n\n\t\tif ( count( $results ) > 1 ) {\n\t\t\tforeach ( $results as $result ) {\n\t\t\t\tif ( $path === $result->meta_value ) {\n\t\t\t\t\t$post_id = $result->post_id;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filters an attachment ID found by URL.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param int|null $post_id The post_id (if any) found by the function.\n\t * @param string   $url     The URL being looked up.\n\t */\n\treturn (int) apply_filters( 'attachment_url_to_postid', $post_id, $url );\n}\n\n/**\n * Returns the URLs for CSS files used in an iframe-sandbox'd TinyMCE media view.\n *\n * @since 4.0.0\n *\n * @return string[] The relevant CSS file URLs.\n */\nfunction wpview_media_sandbox_styles() {\n\t$version        = 'ver=' . get_bloginfo( 'version' );\n\t$mediaelement   = includes_url( \"js/mediaelement/mediaelementplayer-legacy.min.css?$version\" );\n\t$wpmediaelement = includes_url( \"js/mediaelement/wp-mediaelement.css?$version\" );\n\n\treturn array( $mediaelement, $wpmediaelement );\n}\n\n/**\n * Registers the personal data exporter for media.\n *\n * @param array[] $exporters An array of personal data exporters, keyed by their ID.\n * @return array[] Updated array of personal data exporters.\n */\nfunction wp_register_media_personal_data_exporter( $exporters ) {\n\t$exporters['wordpress-media'] = array(\n\t\t'exporter_friendly_name' => __( 'WordPress Media' ),\n\t\t'callback'               => 'wp_media_personal_data_exporter',\n\t);\n\n\treturn $exporters;\n}\n\n/**\n * Finds and exports attachments associated with an email address.\n *\n * @since 4.9.6\n *\n * @param string $email_address The attachment owner email address.\n * @param int    $page          Attachment page.\n * @return array An array of personal data.\n */\nfunction wp_media_personal_data_exporter( $email_address, $page = 1 ) {\n\t// Limit us to 50 attachments at a time to avoid timing out.\n\t$number = 50;\n\t$page   = (int) $page;\n\n\t$data_to_export = array();\n\n\t$user = get_user_by( 'email', $email_address );\n\tif ( false === $user ) {\n\t\treturn array(\n\t\t\t'data' => $data_to_export,\n\t\t\t'done' => true,\n\t\t);\n\t}\n\n\t$post_query = new WP_Query(\n\t\tarray(\n\t\t\t'author'         => $user->ID,\n\t\t\t'posts_per_page' => $number,\n\t\t\t'paged'          => $page,\n\t\t\t'post_type'      => 'attachment',\n\t\t\t'post_status'    => 'any',\n\t\t\t'orderby'        => 'ID',\n\t\t\t'order'          => 'ASC',\n\t\t)\n\t);\n\n\tforeach ( (array) $post_query->posts as $post ) {\n\t\t$attachment_url = wp_get_attachment_url( $post->ID );\n\n\t\tif ( $attachment_url ) {\n\t\t\t$post_data_to_export = array(\n\t\t\t\tarray(\n\t\t\t\t\t'name'  => __( 'URL' ),\n\t\t\t\t\t'value' => $attachment_url,\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t$data_to_export[] = array(\n\t\t\t\t'group_id'          => 'media',\n\t\t\t\t'group_label'       => __( 'Media' ),\n\t\t\t\t'group_description' => __( 'User&#8217;s media data.' ),\n\t\t\t\t'item_id'           => \"post-{$post->ID}\",\n\t\t\t\t'data'              => $post_data_to_export,\n\t\t\t);\n\t\t}\n\t}\n\n\t$done = $post_query->max_num_pages <= $page;\n\n\treturn array(\n\t\t'data' => $data_to_export,\n\t\t'done' => $done,\n\t);\n}\n\n/**\n * Add additional default image sub-sizes.\n *\n * These sizes are meant to enhance the way WordPress displays images on the front-end on larger,\n * high-density devices. They make it possible to generate more suitable `srcset` and `sizes` attributes\n * when the users upload large images.\n *\n * The sizes can be changed or removed by themes and plugins but that is not recommended.\n * The size \"names\" reflect the image dimensions, so changing the sizes would be quite misleading.\n *\n * @since 5.3.0\n * @access private\n */\nfunction _wp_add_additional_image_sizes() {\n\t// 2x medium_large size.\n\tadd_image_size( '1536x1536', 1536, 1536 );\n\t// 2x large size.\n\tadd_image_size( '2048x2048', 2048, 2048 );\n}\n\n/**\n * Callback to enable showing of the user error when uploading .heic images.\n *\n * @since 5.5.0\n *\n * @param array[] $plupload_settings The settings for Plupload.js.\n * @return array[] Modified settings for Plupload.js.\n */\nfunction wp_show_heic_upload_error( $plupload_settings ) {\n\t$plupload_settings['heic_upload_error'] = true;\n\treturn $plupload_settings;\n}\n", "num_lines": 4798}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Core Metadata API\n *\n * Functions for retrieving and manipulating metadata of various WordPress object types. Metadata\n * for an object is a represented by a simple key-value pair. Objects may contain multiple\n * metadata entries that share the same key and differ only in their value.\n *\n * @package WordPress\n * @subpackage Meta\n */\n\n/**\n * Adds metadata for the specified object.\n *\n * @since 2.9.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $meta_type  Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                           or any other object type with an associated meta table.\n * @param int    $object_id  ID of the object metadata is for.\n * @param string $meta_key   Metadata key.\n * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.\n * @param bool   $unique     Optional. Whether the specified metadata key should be unique for the object.\n *                           If true, and the object already has a value for the specified metadata key,\n *                           no change will be made. Default false.\n * @return int|false The meta ID on success, false on failure.\n */\nfunction add_metadata( $meta_type, $object_id, $meta_key, $meta_value, $unique = false ) {\n\tglobal $wpdb;\n\n\tif ( ! $meta_type || ! $meta_key || ! is_numeric( $object_id ) ) {\n\t\treturn false;\n\t}\n\n\t$object_id = absint( $object_id );\n\tif ( ! $object_id ) {\n\t\treturn false;\n\t}\n\n\t$table = _get_meta_table( $meta_type );\n\tif ( ! $table ) {\n\t\treturn false;\n\t}\n\n\t$meta_subtype = get_object_subtype( $meta_type, $object_id );\n\n\t$column = sanitize_key( $meta_type . '_id' );\n\n\t// expected_slashed ($meta_key)\n\t$meta_key   = wp_unslash( $meta_key );\n\t$meta_value = wp_unslash( $meta_value );\n\t$meta_value = sanitize_meta( $meta_key, $meta_value, $meta_type, $meta_subtype );\n\n\t/**\n\t * Short-circuits adding metadata of a specific type.\n\t *\n\t * The dynamic portion of the hook, `$meta_type`, refers to the meta object type\n\t * (post, comment, term, user, or any other type with an associated meta table).\n\t * Returning a non-null value will effectively short-circuit the function.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param null|bool $check      Whether to allow adding metadata for the given type.\n\t * @param int       $object_id  ID of the object metadata is for.\n\t * @param string    $meta_key   Metadata key.\n\t * @param mixed     $meta_value Metadata value. Must be serializable if non-scalar.\n\t * @param bool      $unique     Whether the specified meta key should be unique for the object.\n\t */\n\t$check = apply_filters( \"add_{$meta_type}_metadata\", null, $object_id, $meta_key, $meta_value, $unique );\n\tif ( null !== $check ) {\n\t\treturn $check;\n\t}\n\n\tif ( $unique && $wpdb->get_var(\n\t\t$wpdb->prepare(\n\t\t\t\"SELECT COUNT(*) FROM $table WHERE meta_key = %s AND $column = %d\",\n\t\t\t$meta_key,\n\t\t\t$object_id\n\t\t)\n\t) ) {\n\t\treturn false;\n\t}\n\n\t$_meta_value = $meta_value;\n\t$meta_value  = maybe_serialize( $meta_value );\n\n\t/**\n\t * Fires immediately before meta of a specific type is added.\n\t *\n\t * The dynamic portion of the hook, `$meta_type`, refers to the meta object type\n\t * (post, comment, term, user, or any other type with an associated meta table).\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param int    $object_id   ID of the object metadata is for.\n\t * @param string $meta_key    Metadata key.\n\t * @param mixed  $_meta_value Metadata value. Serialized if non-scalar.\n\t */\n\tdo_action( \"add_{$meta_type}_meta\", $object_id, $meta_key, $_meta_value );\n\n\t$result = $wpdb->insert(\n\t\t$table,\n\t\tarray(\n\t\t\t$column      => $object_id,\n\t\t\t'meta_key'   => $meta_key,\n\t\t\t'meta_value' => $meta_value,\n\t\t)\n\t);\n\n\tif ( ! $result ) {\n\t\treturn false;\n\t}\n\n\t$mid = (int) $wpdb->insert_id;\n\n\twp_cache_delete( $object_id, $meta_type . '_meta' );\n\n\t/**\n\t * Fires immediately after meta of a specific type is added.\n\t *\n\t * The dynamic portion of the hook, `$meta_type`, refers to the meta object type\n\t * (post, comment, term, user, or any other type with an associated meta table).\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param int    $mid         The meta ID after successful update.\n\t * @param int    $object_id   ID of the object metadata is for.\n\t * @param string $meta_key    Metadata key.\n\t * @param mixed  $_meta_value Metadata value. Serialized if non-scalar.\n\t */\n\tdo_action( \"added_{$meta_type}_meta\", $mid, $object_id, $meta_key, $_meta_value );\n\n\treturn $mid;\n}\n\n/**\n * Updates metadata for the specified object. If no value already exists for the specified object\n * ID and metadata key, the metadata will be added.\n *\n * @since 2.9.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $meta_type  Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                           or any other object type with an associated meta table.\n * @param int    $object_id  ID of the object metadata is for.\n * @param string $meta_key   Metadata key.\n * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.\n * @param mixed  $prev_value Optional. Previous value to check before updating.\n *                           If specified, only update existing metadata entries with\n *                           this value. Otherwise, update all entries. Default empty.\n * @return int|bool The new meta field ID if a field with the given key didn't exist\n *                  and was therefore added, true on successful update,\n *                  false on failure or if the value passed to the function\n *                  is the same as the one that is already in the database.\n */\nfunction update_metadata( $meta_type, $object_id, $meta_key, $meta_value, $prev_value = '' ) {\n\tglobal $wpdb;\n\n\tif ( ! $meta_type || ! $meta_key || ! is_numeric( $object_id ) ) {\n\t\treturn false;\n\t}\n\n\t$object_id = absint( $object_id );\n\tif ( ! $object_id ) {\n\t\treturn false;\n\t}\n\n\t$table = _get_meta_table( $meta_type );\n\tif ( ! $table ) {\n\t\treturn false;\n\t}\n\n\t$meta_subtype = get_object_subtype( $meta_type, $object_id );\n\n\t$column    = sanitize_key( $meta_type . '_id' );\n\t$id_column = ( 'user' === $meta_type ) ? 'umeta_id' : 'meta_id';\n\n\t// expected_slashed ($meta_key)\n\t$raw_meta_key = $meta_key;\n\t$meta_key     = wp_unslash( $meta_key );\n\t$passed_value = $meta_value;\n\t$meta_value   = wp_unslash( $meta_value );\n\t$meta_value   = sanitize_meta( $meta_key, $meta_value, $meta_type, $meta_subtype );\n\n\t/**\n\t * Short-circuits updating metadata of a specific type.\n\t *\n\t * The dynamic portion of the hook, `$meta_type`, refers to the meta object type\n\t * (post, comment, term, user, or any other type with an associated meta table).\n\t * Returning a non-null value will effectively short-circuit the function.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param null|bool $check      Whether to allow updating metadata for the given type.\n\t * @param int       $object_id  ID of the object metadata is for.\n\t * @param string    $meta_key   Metadata key.\n\t * @param mixed     $meta_value Metadata value. Must be serializable if non-scalar.\n\t * @param mixed     $prev_value Optional. Previous value to check before updating.\n\t *                              If specified, only update existing metadata entries with\n\t *                              this value. Otherwise, update all entries.\n\t */\n\t$check = apply_filters( \"update_{$meta_type}_metadata\", null, $object_id, $meta_key, $meta_value, $prev_value );\n\tif ( null !== $check ) {\n\t\treturn (bool) $check;\n\t}\n\n\t// Compare existing value to new value if no prev value given and the key exists only once.\n\tif ( empty( $prev_value ) ) {\n\t\t$old_value = get_metadata_raw( $meta_type, $object_id, $meta_key );\n\t\tif ( is_countable( $old_value ) && count( $old_value ) === 1 ) {\n\t\t\tif ( $old_value[0] === $meta_value ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\t$meta_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT $id_column FROM $table WHERE meta_key = %s AND $column = %d\", $meta_key, $object_id ) );\n\tif ( empty( $meta_ids ) ) {\n\t\treturn add_metadata( $meta_type, $object_id, $raw_meta_key, $passed_value );\n\t}\n\n\t$_meta_value = $meta_value;\n\t$meta_value  = maybe_serialize( $meta_value );\n\n\t$data  = compact( 'meta_value' );\n\t$where = array(\n\t\t$column    => $object_id,\n\t\t'meta_key' => $meta_key,\n\t);\n\n\tif ( ! empty( $prev_value ) ) {\n\t\t$prev_value          = maybe_serialize( $prev_value );\n\t\t$where['meta_value'] = $prev_value;\n\t}\n\n\tforeach ( $meta_ids as $meta_id ) {\n\t\t/**\n\t\t * Fires immediately before updating metadata of a specific type.\n\t\t *\n\t\t * The dynamic portion of the hook, `$meta_type`, refers to the meta object type\n\t\t * (post, comment, term, user, or any other type with an associated meta table).\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param int    $meta_id     ID of the metadata entry to update.\n\t\t * @param int    $object_id   ID of the object metadata is for.\n\t\t * @param string $meta_key    Metadata key.\n\t\t * @param mixed  $_meta_value Metadata value. Serialized if non-scalar.\n\t\t */\n\t\tdo_action( \"update_{$meta_type}_meta\", $meta_id, $object_id, $meta_key, $_meta_value );\n\n\t\tif ( 'post' === $meta_type ) {\n\t\t\t/**\n\t\t\t * Fires immediately before updating a post's metadata.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t *\n\t\t\t * @param int    $meta_id    ID of metadata entry to update.\n\t\t\t * @param int    $object_id  Post ID.\n\t\t\t * @param string $meta_key   Metadata key.\n\t\t\t * @param mixed  $meta_value Metadata value. This will be a PHP-serialized string representation of the value\n\t\t\t *                           if the value is an array, an object, or itself a PHP-serialized string.\n\t\t\t */\n\t\t\tdo_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $meta_value );\n\t\t}\n\t}\n\n\t$result = $wpdb->update( $table, $data, $where );\n\tif ( ! $result ) {\n\t\treturn false;\n\t}\n\n\twp_cache_delete( $object_id, $meta_type . '_meta' );\n\n\tforeach ( $meta_ids as $meta_id ) {\n\t\t/**\n\t\t * Fires immediately after updating metadata of a specific type.\n\t\t *\n\t\t * The dynamic portion of the hook, `$meta_type`, refers to the meta object type\n\t\t * (post, comment, term, user, or any other type with an associated meta table).\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param int    $meta_id     ID of updated metadata entry.\n\t\t * @param int    $object_id   ID of the object metadata is for.\n\t\t * @param string $meta_key    Metadata key.\n\t\t * @param mixed  $_meta_value Metadata value. Serialized if non-scalar.\n\t\t */\n\t\tdo_action( \"updated_{$meta_type}_meta\", $meta_id, $object_id, $meta_key, $_meta_value );\n\n\t\tif ( 'post' === $meta_type ) {\n\t\t\t/**\n\t\t\t * Fires immediately after updating a post's metadata.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t *\n\t\t\t * @param int    $meta_id    ID of updated metadata entry.\n\t\t\t * @param int    $object_id  Post ID.\n\t\t\t * @param string $meta_key   Metadata key.\n\t\t\t * @param mixed  $meta_value Metadata value. This will be a PHP-serialized string representation of the value\n\t\t\t *                           if the value is an array, an object, or itself a PHP-serialized string.\n\t\t\t */\n\t\t\tdo_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value );\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Deletes metadata for the specified object.\n *\n * @since 2.9.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $meta_type  Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                           or any other object type with an associated meta table.\n * @param int    $object_id  ID of the object metadata is for.\n * @param string $meta_key   Metadata key.\n * @param mixed  $meta_value Optional. Metadata value. Must be serializable if non-scalar.\n *                           If specified, only delete metadata entries with this value.\n *                           Otherwise, delete all entries with the specified meta_key.\n *                           Pass `null`, `false`, or an empty string to skip this check.\n *                           (For backward compatibility, it is not possible to pass an empty string\n *                           to delete those entries with an empty string for a value.)\n * @param bool   $delete_all Optional. If true, delete matching metadata entries for all objects,\n *                           ignoring the specified object_id. Otherwise, only delete\n *                           matching metadata entries for the specified object_id. Default false.\n * @return bool True on successful delete, false on failure.\n */\nfunction delete_metadata( $meta_type, $object_id, $meta_key, $meta_value = '', $delete_all = false ) {\n\tglobal $wpdb;\n\n\tif ( ! $meta_type || ! $meta_key || ! is_numeric( $object_id ) && ! $delete_all ) {\n\t\treturn false;\n\t}\n\n\t$object_id = absint( $object_id );\n\tif ( ! $object_id && ! $delete_all ) {\n\t\treturn false;\n\t}\n\n\t$table = _get_meta_table( $meta_type );\n\tif ( ! $table ) {\n\t\treturn false;\n\t}\n\n\t$type_column = sanitize_key( $meta_type . '_id' );\n\t$id_column   = ( 'user' === $meta_type ) ? 'umeta_id' : 'meta_id';\n\n\t// expected_slashed ($meta_key)\n\t$meta_key   = wp_unslash( $meta_key );\n\t$meta_value = wp_unslash( $meta_value );\n\n\t/**\n\t * Short-circuits deleting metadata of a specific type.\n\t *\n\t * The dynamic portion of the hook, `$meta_type`, refers to the meta object type\n\t * (post, comment, term, user, or any other type with an associated meta table).\n\t * Returning a non-null value will effectively short-circuit the function.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param null|bool $delete     Whether to allow metadata deletion of the given type.\n\t * @param int       $object_id  ID of the object metadata is for.\n\t * @param string    $meta_key   Metadata key.\n\t * @param mixed     $meta_value Metadata value. Must be serializable if non-scalar.\n\t * @param bool      $delete_all Whether to delete the matching metadata entries\n\t *                              for all objects, ignoring the specified $object_id.\n\t *                              Default false.\n\t */\n\t$check = apply_filters( \"delete_{$meta_type}_metadata\", null, $object_id, $meta_key, $meta_value, $delete_all );\n\tif ( null !== $check ) {\n\t\treturn (bool) $check;\n\t}\n\n\t$_meta_value = $meta_value;\n\t$meta_value  = maybe_serialize( $meta_value );\n\n\t$query = $wpdb->prepare( \"SELECT $id_column FROM $table WHERE meta_key = %s\", $meta_key );\n\n\tif ( ! $delete_all ) {\n\t\t$query .= $wpdb->prepare( \" AND $type_column = %d\", $object_id );\n\t}\n\n\tif ( '' !== $meta_value && null !== $meta_value && false !== $meta_value ) {\n\t\t$query .= $wpdb->prepare( ' AND meta_value = %s', $meta_value );\n\t}\n\n\t$meta_ids = $wpdb->get_col( $query );\n\tif ( ! count( $meta_ids ) ) {\n\t\treturn false;\n\t}\n\n\tif ( $delete_all ) {\n\t\tif ( '' !== $meta_value && null !== $meta_value && false !== $meta_value ) {\n\t\t\t$object_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT $type_column FROM $table WHERE meta_key = %s AND meta_value = %s\", $meta_key, $meta_value ) );\n\t\t} else {\n\t\t\t$object_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT $type_column FROM $table WHERE meta_key = %s\", $meta_key ) );\n\t\t}\n\t}\n\n\t/**\n\t * Fires immediately before deleting metadata of a specific type.\n\t *\n\t * The dynamic portion of the hook, `$meta_type`, refers to the meta object type\n\t * (post, comment, term, user, or any other type with an associated meta table).\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param string[] $meta_ids    An array of metadata entry IDs to delete.\n\t * @param int      $object_id   ID of the object metadata is for.\n\t * @param string   $meta_key    Metadata key.\n\t * @param mixed    $_meta_value Metadata value. Serialized if non-scalar.\n\t */\n\tdo_action( \"delete_{$meta_type}_meta\", $meta_ids, $object_id, $meta_key, $_meta_value );\n\n\t// Old-style action.\n\tif ( 'post' === $meta_type ) {\n\t\t/**\n\t\t * Fires immediately before deleting metadata for a post.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param string[] $meta_ids An array of metadata entry IDs to delete.\n\t\t */\n\t\tdo_action( 'delete_postmeta', $meta_ids );\n\t}\n\n\t$query = \"DELETE FROM $table WHERE $id_column IN( \" . implode( ',', $meta_ids ) . ' )';\n\n\t$count = $wpdb->query( $query );\n\n\tif ( ! $count ) {\n\t\treturn false;\n\t}\n\n\tif ( $delete_all ) {\n\t\tforeach ( (array) $object_ids as $o_id ) {\n\t\t\twp_cache_delete( $o_id, $meta_type . '_meta' );\n\t\t}\n\t} else {\n\t\twp_cache_delete( $object_id, $meta_type . '_meta' );\n\t}\n\n\t/**\n\t * Fires immediately after deleting metadata of a specific type.\n\t *\n\t * The dynamic portion of the hook, `$meta_type`, refers to the meta object type\n\t * (post, comment, term, user, or any other type with an associated meta table).\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string[] $meta_ids    An array of metadata entry IDs to delete.\n\t * @param int      $object_id   ID of the object metadata is for.\n\t * @param string   $meta_key    Metadata key.\n\t * @param mixed    $_meta_value Metadata value. Serialized if non-scalar.\n\t */\n\tdo_action( \"deleted_{$meta_type}_meta\", $meta_ids, $object_id, $meta_key, $_meta_value );\n\n\t// Old-style action.\n\tif ( 'post' === $meta_type ) {\n\t\t/**\n\t\t * Fires immediately after deleting metadata for a post.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param string[] $meta_ids An array of metadata entry IDs to delete.\n\t\t */\n\t\tdo_action( 'deleted_postmeta', $meta_ids );\n\t}\n\n\treturn true;\n}\n\n/**\n * Retrieves the value of a metadata field for the specified object type and ID.\n *\n * If the meta field exists, a single value is returned if `$single` is true,\n * or an array of values if it's false.\n *\n * If the meta field does not exist, the result depends on get_metadata_default().\n * By default, an empty string is returned if `$single` is true, or an empty array\n * if it's false.\n *\n * @since 2.9.0\n *\n * @see get_metadata_raw()\n * @see get_metadata_default()\n *\n * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                          or any other object type with an associated meta table.\n * @param int    $object_id ID of the object metadata is for.\n * @param string $meta_key  Optional. Metadata key. If not specified, retrieve all metadata for\n *                          the specified object. Default empty.\n * @param bool   $single    Optional. If true, return only the first value of the specified meta_key.\n *                          This parameter has no effect if meta_key is not specified. Default false.\n * @return mixed Single metadata value, or array of values.\n *               False if there's a problem with the parameters passed to the function.\n */\nfunction get_metadata( $meta_type, $object_id, $meta_key = '', $single = false ) {\n\t$value = get_metadata_raw( $meta_type, $object_id, $meta_key, $single );\n\tif ( ! is_null( $value ) ) {\n\t\treturn $value;\n\t}\n\n\treturn get_metadata_default( $meta_type, $object_id, $meta_key, $single );\n}\n\n/**\n * Retrieves raw metadata value for the specified object.\n *\n * @since 5.5.0\n *\n * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                          or any other object type with an associated meta table.\n * @param int    $object_id ID of the object metadata is for.\n * @param string $meta_key  Optional. Metadata key. If not specified, retrieve all metadata for\n *                          the specified object. Default empty.\n * @param bool   $single    Optional. If true, return only the first value of the specified meta_key.\n *                          This parameter has no effect if meta_key is not specified. Default false.\n * @return mixed Single metadata value, or array of values. Null if the value does not exist.\n *               False if there's a problem with the parameters passed to the function.\n */\nfunction get_metadata_raw( $meta_type, $object_id, $meta_key = '', $single = false ) {\n\tif ( ! $meta_type || ! is_numeric( $object_id ) ) {\n\t\treturn false;\n\t}\n\n\t$object_id = absint( $object_id );\n\tif ( ! $object_id ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Short-circuits the return value of a meta field.\n\t *\n\t * The dynamic portion of the hook, `$meta_type`, refers to the meta object type\n\t * (post, comment, term, user, or any other type with an associated meta table).\n\t * Returning a non-null value will effectively short-circuit the function.\n\t *\n\t * Possible filter names include:\n\t *\n\t *  - `get_post_metadata`\n\t *  - `get_comment_metadata`\n\t *  - `get_term_metadata`\n\t *  - `get_user_metadata`\n\t *\n\t * @since 3.1.0\n\t * @since 5.5.0 Added the `$meta_type` parameter.\n\t *\n\t * @param mixed  $value     The value to return, either a single metadata value or an array\n\t *                          of values depending on the value of `$single`. Default null.\n\t * @param int    $object_id ID of the object metadata is for.\n\t * @param string $meta_key  Metadata key.\n\t * @param bool   $single    Whether to return only the first value of the specified `$meta_key`.\n\t * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n\t *                          or any other object type with an associated meta table.\n\t */\n\t$check = apply_filters( \"get_{$meta_type}_metadata\", null, $object_id, $meta_key, $single, $meta_type );\n\tif ( null !== $check ) {\n\t\tif ( $single && is_array( $check ) ) {\n\t\t\treturn $check[0];\n\t\t} else {\n\t\t\treturn $check;\n\t\t}\n\t}\n\n\t$meta_cache = wp_cache_get( $object_id, $meta_type . '_meta' );\n\n\tif ( ! $meta_cache ) {\n\t\t$meta_cache = update_meta_cache( $meta_type, array( $object_id ) );\n\t\tif ( isset( $meta_cache[ $object_id ] ) ) {\n\t\t\t$meta_cache = $meta_cache[ $object_id ];\n\t\t} else {\n\t\t\t$meta_cache = null;\n\t\t}\n\t}\n\n\tif ( ! $meta_key ) {\n\t\treturn $meta_cache;\n\t}\n\n\tif ( isset( $meta_cache[ $meta_key ] ) ) {\n\t\tif ( $single ) {\n\t\t\treturn maybe_unserialize( $meta_cache[ $meta_key ][0] );\n\t\t} else {\n\t\t\treturn array_map( 'maybe_unserialize', $meta_cache[ $meta_key ] );\n\t\t}\n\t}\n\n\treturn null;\n}\n\n/**\n * Retrieves default metadata value for the specified meta key and object.\n *\n * By default, an empty string is returned if `$single` is true, or an empty array\n * if it's false.\n *\n * @since 5.5.0\n *\n * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                          or any other object type with an associated meta table.\n * @param int    $object_id ID of the object metadata is for.\n * @param string $meta_key  Metadata key.\n * @param bool   $single    Optional. If true, return only the first value of the specified meta_key.\n *                          This parameter has no effect if meta_key is not specified. Default false.\n * @return mixed Single metadata value, or array of values.\n */\nfunction get_metadata_default( $meta_type, $object_id, $meta_key, $single = false ) {\n\tif ( $single ) {\n\t\t$value = '';\n\t} else {\n\t\t$value = array();\n\t}\n\n\t/**\n\t * Filters the default metadata value for a specified meta key and object.\n\t *\n\t * The dynamic portion of the hook, `$meta_type`, refers to the meta object type\n\t * (post, comment, term, user, or any other type with an associated meta table).\n\t *\n\t * Possible filter names include:\n\t *\n\t *  - `default_post_metadata`\n\t *  - `default_comment_metadata`\n\t *  - `default_term_metadata`\n\t *  - `default_user_metadata`\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param mixed  $value     The value to return, either a single metadata value or an array\n\t *                          of values depending on the value of `$single`.\n\t * @param int    $object_id ID of the object metadata is for.\n\t * @param string $meta_key  Metadata key.\n\t * @param bool   $single    Whether to return only the first value of the specified `$meta_key`.\n\t * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n\t *                          or any other object type with an associated meta table.\n\t */\n\t$value = apply_filters( \"default_{$meta_type}_metadata\", $value, $object_id, $meta_key, $single, $meta_type );\n\n\tif ( ! $single && ! wp_is_numeric_array( $value ) ) {\n\t\t$value = array( $value );\n\t}\n\n\treturn $value;\n}\n\n/**\n * Determines if a meta field with the given key exists for the given object ID.\n *\n * @since 3.3.0\n *\n * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                          or any other object type with an associated meta table.\n * @param int    $object_id ID of the object metadata is for.\n * @param string $meta_key  Metadata key.\n * @return bool Whether a meta field with the given key exists.\n */\nfunction metadata_exists( $meta_type, $object_id, $meta_key ) {\n\tif ( ! $meta_type || ! is_numeric( $object_id ) ) {\n\t\treturn false;\n\t}\n\n\t$object_id = absint( $object_id );\n\tif ( ! $object_id ) {\n\t\treturn false;\n\t}\n\n\t/** This filter is documented in wp-includes/meta.php */\n\t$check = apply_filters( \"get_{$meta_type}_metadata\", null, $object_id, $meta_key, true );\n\tif ( null !== $check ) {\n\t\treturn (bool) $check;\n\t}\n\n\t$meta_cache = wp_cache_get( $object_id, $meta_type . '_meta' );\n\n\tif ( ! $meta_cache ) {\n\t\t$meta_cache = update_meta_cache( $meta_type, array( $object_id ) );\n\t\t$meta_cache = $meta_cache[ $object_id ];\n\t}\n\n\tif ( isset( $meta_cache[ $meta_key ] ) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Retrieves metadata by meta ID.\n *\n * @since 3.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                          or any other object type with an associated meta table.\n * @param int    $meta_id   ID for a specific meta row.\n * @return stdClass|false {\n *     Metadata object, or boolean `false` if the metadata doesn't exist.\n *\n *     @type string $meta_key   The meta key.\n *     @type mixed  $meta_value The unserialized meta value.\n *     @type string $meta_id    Optional. The meta ID when the meta type is any value except 'user'.\n *     @type string $umeta_id   Optional. The meta ID when the meta type is 'user'.\n *     @type string $post_id    Optional. The object ID when the meta type is 'post'.\n *     @type string $comment_id Optional. The object ID when the meta type is 'comment'.\n *     @type string $term_id    Optional. The object ID when the meta type is 'term'.\n *     @type string $user_id    Optional. The object ID when the meta type is 'user'.\n * }\n */\nfunction get_metadata_by_mid( $meta_type, $meta_id ) {\n\tglobal $wpdb;\n\n\tif ( ! $meta_type || ! is_numeric( $meta_id ) || floor( $meta_id ) != $meta_id ) {\n\t\treturn false;\n\t}\n\n\t$meta_id = intval( $meta_id );\n\tif ( $meta_id <= 0 ) {\n\t\treturn false;\n\t}\n\n\t$table = _get_meta_table( $meta_type );\n\tif ( ! $table ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Short-circuits the return value when fetching a meta field by meta ID.\n\t *\n\t * The dynamic portion of the hook, `$meta_type`, refers to the meta object type\n\t * (post, comment, term, user, or any other type with an associated meta table).\n\t * Returning a non-null value will effectively short-circuit the function.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param stdClass|null $value   The value to return.\n\t * @param int           $meta_id Meta ID.\n\t */\n\t$check = apply_filters( \"get_{$meta_type}_metadata_by_mid\", null, $meta_id );\n\tif ( null !== $check ) {\n\t\treturn $check;\n\t}\n\n\t$id_column = ( 'user' === $meta_type ) ? 'umeta_id' : 'meta_id';\n\n\t$meta = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $table WHERE $id_column = %d\", $meta_id ) );\n\n\tif ( empty( $meta ) ) {\n\t\treturn false;\n\t}\n\n\tif ( isset( $meta->meta_value ) ) {\n\t\t$meta->meta_value = maybe_unserialize( $meta->meta_value );\n\t}\n\n\treturn $meta;\n}\n\n/**\n * Updates metadata by meta ID.\n *\n * @since 3.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $meta_type  Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                           or any other object type with an associated meta table.\n * @param int    $meta_id    ID for a specific meta row.\n * @param string $meta_value Metadata value. Must be serializable if non-scalar.\n * @param string $meta_key   Optional. You can provide a meta key to update it. Default false.\n * @return bool True on successful update, false on failure.\n */\nfunction update_metadata_by_mid( $meta_type, $meta_id, $meta_value, $meta_key = false ) {\n\tglobal $wpdb;\n\n\t// Make sure everything is valid.\n\tif ( ! $meta_type || ! is_numeric( $meta_id ) || floor( $meta_id ) != $meta_id ) {\n\t\treturn false;\n\t}\n\n\t$meta_id = intval( $meta_id );\n\tif ( $meta_id <= 0 ) {\n\t\treturn false;\n\t}\n\n\t$table = _get_meta_table( $meta_type );\n\tif ( ! $table ) {\n\t\treturn false;\n\t}\n\n\t$column    = sanitize_key( $meta_type . '_id' );\n\t$id_column = ( 'user' === $meta_type ) ? 'umeta_id' : 'meta_id';\n\n\t/**\n\t * Short-circuits updating metadata of a specific type by meta ID.\n\t *\n\t * The dynamic portion of the hook, `$meta_type`, refers to the meta object type\n\t * (post, comment, term, user, or any other type with an associated meta table).\n\t * Returning a non-null value will effectively short-circuit the function.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param null|bool   $check      Whether to allow updating metadata for the given type.\n\t * @param int         $meta_id    Meta ID.\n\t * @param mixed       $meta_value Meta value. Must be serializable if non-scalar.\n\t * @param string|bool $meta_key   Meta key, if provided.\n\t */\n\t$check = apply_filters( \"update_{$meta_type}_metadata_by_mid\", null, $meta_id, $meta_value, $meta_key );\n\tif ( null !== $check ) {\n\t\treturn (bool) $check;\n\t}\n\n\t// Fetch the meta and go on if it's found.\n\t$meta = get_metadata_by_mid( $meta_type, $meta_id );\n\tif ( $meta ) {\n\t\t$original_key = $meta->meta_key;\n\t\t$object_id    = $meta->{$column};\n\n\t\t// If a new meta_key (last parameter) was specified, change the meta key,\n\t\t// otherwise use the original key in the update statement.\n\t\tif ( false === $meta_key ) {\n\t\t\t$meta_key = $original_key;\n\t\t} elseif ( ! is_string( $meta_key ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$meta_subtype = get_object_subtype( $meta_type, $object_id );\n\n\t\t// Sanitize the meta.\n\t\t$_meta_value = $meta_value;\n\t\t$meta_value  = sanitize_meta( $meta_key, $meta_value, $meta_type, $meta_subtype );\n\t\t$meta_value  = maybe_serialize( $meta_value );\n\n\t\t// Format the data query arguments.\n\t\t$data = array(\n\t\t\t'meta_key'   => $meta_key,\n\t\t\t'meta_value' => $meta_value,\n\t\t);\n\n\t\t// Format the where query arguments.\n\t\t$where               = array();\n\t\t$where[ $id_column ] = $meta_id;\n\n\t\t/** This action is documented in wp-includes/meta.php */\n\t\tdo_action( \"update_{$meta_type}_meta\", $meta_id, $object_id, $meta_key, $_meta_value );\n\n\t\tif ( 'post' === $meta_type ) {\n\t\t\t/** This action is documented in wp-includes/meta.php */\n\t\t\tdo_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $meta_value );\n\t\t}\n\n\t\t// Run the update query, all fields in $data are %s, $where is a %d.\n\t\t$result = $wpdb->update( $table, $data, $where, '%s', '%d' );\n\t\tif ( ! $result ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Clear the caches.\n\t\twp_cache_delete( $object_id, $meta_type . '_meta' );\n\n\t\t/** This action is documented in wp-includes/meta.php */\n\t\tdo_action( \"updated_{$meta_type}_meta\", $meta_id, $object_id, $meta_key, $_meta_value );\n\n\t\tif ( 'post' === $meta_type ) {\n\t\t\t/** This action is documented in wp-includes/meta.php */\n\t\t\tdo_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// And if the meta was not found.\n\treturn false;\n}\n\n/**\n * Deletes metadata by meta ID.\n *\n * @since 3.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                          or any other object type with an associated meta table.\n * @param int    $meta_id   ID for a specific meta row.\n * @return bool True on successful delete, false on failure.\n */\nfunction delete_metadata_by_mid( $meta_type, $meta_id ) {\n\tglobal $wpdb;\n\n\t// Make sure everything is valid.\n\tif ( ! $meta_type || ! is_numeric( $meta_id ) || floor( $meta_id ) != $meta_id ) {\n\t\treturn false;\n\t}\n\n\t$meta_id = intval( $meta_id );\n\tif ( $meta_id <= 0 ) {\n\t\treturn false;\n\t}\n\n\t$table = _get_meta_table( $meta_type );\n\tif ( ! $table ) {\n\t\treturn false;\n\t}\n\n\t// Object and ID columns.\n\t$column    = sanitize_key( $meta_type . '_id' );\n\t$id_column = ( 'user' === $meta_type ) ? 'umeta_id' : 'meta_id';\n\n\t/**\n\t * Short-circuits deleting metadata of a specific type by meta ID.\n\t *\n\t * The dynamic portion of the hook, `$meta_type`, refers to the meta object type\n\t * (post, comment, term, user, or any other type with an associated meta table).\n\t * Returning a non-null value will effectively short-circuit the function.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param null|bool $delete  Whether to allow metadata deletion of the given type.\n\t * @param int       $meta_id Meta ID.\n\t */\n\t$check = apply_filters( \"delete_{$meta_type}_metadata_by_mid\", null, $meta_id );\n\tif ( null !== $check ) {\n\t\treturn (bool) $check;\n\t}\n\n\t// Fetch the meta and go on if it's found.\n\t$meta = get_metadata_by_mid( $meta_type, $meta_id );\n\tif ( $meta ) {\n\t\t$object_id = (int) $meta->{$column};\n\n\t\t/** This action is documented in wp-includes/meta.php */\n\t\tdo_action( \"delete_{$meta_type}_meta\", (array) $meta_id, $object_id, $meta->meta_key, $meta->meta_value );\n\n\t\t// Old-style action.\n\t\tif ( 'post' === $meta_type || 'comment' === $meta_type ) {\n\t\t\t/**\n\t\t\t * Fires immediately before deleting post or comment metadata of a specific type.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook, `$meta_type`, refers to the meta\n\t\t\t * object type (post or comment).\n\t\t\t *\n\t\t\t * @since 3.4.0\n\t\t\t *\n\t\t\t * @param int $meta_id ID of the metadata entry to delete.\n\t\t\t */\n\t\t\tdo_action( \"delete_{$meta_type}meta\", $meta_id );\n\t\t}\n\n\t\t// Run the query, will return true if deleted, false otherwise.\n\t\t$result = (bool) $wpdb->delete( $table, array( $id_column => $meta_id ) );\n\n\t\t// Clear the caches.\n\t\twp_cache_delete( $object_id, $meta_type . '_meta' );\n\n\t\t/** This action is documented in wp-includes/meta.php */\n\t\tdo_action( \"deleted_{$meta_type}_meta\", (array) $meta_id, $object_id, $meta->meta_key, $meta->meta_value );\n\n\t\t// Old-style action.\n\t\tif ( 'post' === $meta_type || 'comment' === $meta_type ) {\n\t\t\t/**\n\t\t\t * Fires immediately after deleting post or comment metadata of a specific type.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook, `$meta_type`, refers to the meta\n\t\t\t * object type (post or comment).\n\t\t\t *\n\t\t\t * @since 3.4.0\n\t\t\t *\n\t\t\t * @param int $meta_ids Deleted metadata entry ID.\n\t\t\t */\n\t\t\tdo_action( \"deleted_{$meta_type}meta\", $meta_id );\n\t\t}\n\n\t\treturn $result;\n\n\t}\n\n\t// Meta ID was not found.\n\treturn false;\n}\n\n/**\n * Updates the metadata cache for the specified objects.\n *\n * @since 2.9.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string       $meta_type  Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                                 or any other object type with an associated meta table.\n * @param string|int[] $object_ids Array or comma delimited list of object IDs to update cache for.\n * @return array|false Metadata cache for the specified objects, or false on failure.\n */\nfunction update_meta_cache( $meta_type, $object_ids ) {\n\tglobal $wpdb;\n\n\tif ( ! $meta_type || ! $object_ids ) {\n\t\treturn false;\n\t}\n\n\t$table = _get_meta_table( $meta_type );\n\tif ( ! $table ) {\n\t\treturn false;\n\t}\n\n\t$column = sanitize_key( $meta_type . '_id' );\n\n\tif ( ! is_array( $object_ids ) ) {\n\t\t$object_ids = preg_replace( '|[^0-9,]|', '', $object_ids );\n\t\t$object_ids = explode( ',', $object_ids );\n\t}\n\n\t$object_ids = array_map( 'intval', $object_ids );\n\n\t/**\n\t * Short-circuits updating the metadata cache of a specific type.\n\t *\n\t * The dynamic portion of the hook, `$meta_type`, refers to the meta object type\n\t * (post, comment, term, user, or any other type with an associated meta table).\n\t * Returning a non-null value will effectively short-circuit the function.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param mixed $check      Whether to allow updating the meta cache of the given type.\n\t * @param int[] $object_ids Array of object IDs to update the meta cache for.\n\t */\n\t$check = apply_filters( \"update_{$meta_type}_metadata_cache\", null, $object_ids );\n\tif ( null !== $check ) {\n\t\treturn (bool) $check;\n\t}\n\n\t$cache_key      = $meta_type . '_meta';\n\t$non_cached_ids = array();\n\t$cache          = array();\n\t$cache_values   = wp_cache_get_multiple( $object_ids, $cache_key );\n\n\tforeach ( $cache_values as $id => $cached_object ) {\n\t\tif ( false === $cached_object ) {\n\t\t\t$non_cached_ids[] = $id;\n\t\t} else {\n\t\t\t$cache[ $id ] = $cached_object;\n\t\t}\n\t}\n\n\tif ( empty( $non_cached_ids ) ) {\n\t\treturn $cache;\n\t}\n\n\t// Get meta info.\n\t$id_list   = join( ',', $non_cached_ids );\n\t$id_column = ( 'user' === $meta_type ) ? 'umeta_id' : 'meta_id';\n\n\t$meta_list = $wpdb->get_results( \"SELECT $column, meta_key, meta_value FROM $table WHERE $column IN ($id_list) ORDER BY $id_column ASC\", ARRAY_A );\n\n\tif ( ! empty( $meta_list ) ) {\n\t\tforeach ( $meta_list as $metarow ) {\n\t\t\t$mpid = intval( $metarow[ $column ] );\n\t\t\t$mkey = $metarow['meta_key'];\n\t\t\t$mval = $metarow['meta_value'];\n\n\t\t\t// Force subkeys to be array type.\n\t\t\tif ( ! isset( $cache[ $mpid ] ) || ! is_array( $cache[ $mpid ] ) ) {\n\t\t\t\t$cache[ $mpid ] = array();\n\t\t\t}\n\t\t\tif ( ! isset( $cache[ $mpid ][ $mkey ] ) || ! is_array( $cache[ $mpid ][ $mkey ] ) ) {\n\t\t\t\t$cache[ $mpid ][ $mkey ] = array();\n\t\t\t}\n\n\t\t\t// Add a value to the current pid/key.\n\t\t\t$cache[ $mpid ][ $mkey ][] = $mval;\n\t\t}\n\t}\n\n\tforeach ( $non_cached_ids as $id ) {\n\t\tif ( ! isset( $cache[ $id ] ) ) {\n\t\t\t$cache[ $id ] = array();\n\t\t}\n\t\twp_cache_add( $id, $cache[ $id ], $cache_key );\n\t}\n\n\treturn $cache;\n}\n\n/**\n * Retrieves the queue for lazy-loading metadata.\n *\n * @since 4.5.0\n *\n * @return WP_Metadata_Lazyloader Metadata lazyloader queue.\n */\nfunction wp_metadata_lazyloader() {\n\tstatic $wp_metadata_lazyloader;\n\n\tif ( null === $wp_metadata_lazyloader ) {\n\t\t$wp_metadata_lazyloader = new WP_Metadata_Lazyloader();\n\t}\n\n\treturn $wp_metadata_lazyloader;\n}\n\n/**\n * Given a meta query, generates SQL clauses to be appended to a main query.\n *\n * @since 3.2.0\n *\n * @see WP_Meta_Query\n *\n * @param array  $meta_query        A meta query.\n * @param string $type              Type of meta.\n * @param string $primary_table     Primary database table name.\n * @param string $primary_id_column Primary ID column name.\n * @param object $context           Optional. The main query object\n * @return array Associative array of `JOIN` and `WHERE` SQL.\n */\nfunction get_meta_sql( $meta_query, $type, $primary_table, $primary_id_column, $context = null ) {\n\t$meta_query_obj = new WP_Meta_Query( $meta_query );\n\treturn $meta_query_obj->get_sql( $type, $primary_table, $primary_id_column, $context );\n}\n\n/**\n * Retrieves the name of the metadata table for the specified object type.\n *\n * @since 2.9.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                     or any other object type with an associated meta table.\n * @return string|false Metadata table name, or false if no metadata table exists\n */\nfunction _get_meta_table( $type ) {\n\tglobal $wpdb;\n\n\t$table_name = $type . 'meta';\n\n\tif ( empty( $wpdb->$table_name ) ) {\n\t\treturn false;\n\t}\n\n\treturn $wpdb->$table_name;\n}\n\n/**\n * Determines whether a meta key is considered protected.\n *\n * @since 3.1.3\n *\n * @param string $meta_key  Metadata key.\n * @param string $meta_type Optional. Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                          or any other object type with an associated meta table. Default empty.\n * @return bool Whether the meta key is considered protected.\n */\nfunction is_protected_meta( $meta_key, $meta_type = '' ) {\n\t$sanitized_key = preg_replace( \"/[^\\x20-\\x7E\\p{L}]/\", '', $meta_key );\n\t$protected     = strlen( $sanitized_key ) > 0 && ( '_' === $sanitized_key[0] );\n\n\t/**\n\t * Filters whether a meta key is considered protected.\n\t *\n\t * @since 3.2.0\n\t *\n\t * @param bool   $protected Whether the key is considered protected.\n\t * @param string $meta_key  Metadata key.\n\t * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n\t *                          or any other object type with an associated meta table.\n\t */\n\treturn apply_filters( 'is_protected_meta', $protected, $meta_key, $meta_type );\n}\n\n/**\n * Sanitizes meta value.\n *\n * @since 3.1.3\n * @since 4.9.8 The `$object_subtype` parameter was added.\n *\n * @param string $meta_key       Metadata key.\n * @param mixed  $meta_value     Metadata value to sanitize.\n * @param string $object_type    Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                               or any other object type with an associated meta table.\n * @param string $object_subtype Optional. The subtype of the object type.\n * @return mixed Sanitized $meta_value.\n */\nfunction sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = '' ) {\n\tif ( ! empty( $object_subtype ) && has_filter( \"sanitize_{$object_type}_meta_{$meta_key}_for_{$object_subtype}\" ) ) {\n\n\t\t/**\n\t\t * Filters the sanitization of a specific meta key of a specific meta type and subtype.\n\t\t *\n\t\t * The dynamic portions of the hook name, `$object_type`, `$meta_key`,\n\t\t * and `$object_subtype`, refer to the metadata object type (comment, post, term, or user),\n\t\t * the meta key value, and the object subtype respectively.\n\t\t *\n\t\t * @since 4.9.8\n\t\t *\n\t\t * @param mixed  $meta_value     Metadata value to sanitize.\n\t\t * @param string $meta_key       Metadata key.\n\t\t * @param string $object_type    Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n\t\t *                               or any other object type with an associated meta table.\n\t\t * @param string $object_subtype Object subtype.\n\t\t */\n\t\treturn apply_filters( \"sanitize_{$object_type}_meta_{$meta_key}_for_{$object_subtype}\", $meta_value, $meta_key, $object_type, $object_subtype );\n\t}\n\n\t/**\n\t * Filters the sanitization of a specific meta key of a specific meta type.\n\t *\n\t * The dynamic portions of the hook name, `$meta_type`, and `$meta_key`,\n\t * refer to the metadata object type (comment, post, term, or user) and the meta\n\t * key value, respectively.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param mixed  $meta_value  Metadata value to sanitize.\n\t * @param string $meta_key    Metadata key.\n\t * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n\t *                            or any other object type with an associated meta table.\n\t */\n\treturn apply_filters( \"sanitize_{$object_type}_meta_{$meta_key}\", $meta_value, $meta_key, $object_type );\n}\n\n/**\n * Registers a meta key.\n *\n * It is recommended to register meta keys for a specific combination of object type and object subtype. If passing\n * an object subtype is omitted, the meta key will be registered for the entire object type, however it can be partly\n * overridden in case a more specific meta key of the same name exists for the same object type and a subtype.\n *\n * If an object type does not support any subtypes, such as users or comments, you should commonly call this function\n * without passing a subtype.\n *\n * @since 3.3.0\n * @since 4.6.0 {@link https://core.trac.wordpress.org/ticket/35658 Modified\n *              to support an array of data to attach to registered meta keys}. Previous arguments for\n *              `$sanitize_callback` and `$auth_callback` have been folded into this array.\n * @since 4.9.8 The `$object_subtype` argument was added to the arguments array.\n * @since 5.3.0 Valid meta types expanded to include \"array\" and \"object\".\n * @since 5.5.0 The `$default` argument was added to the arguments array.\n *\n * @param string       $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                                  or any other object type with an associated meta table.\n * @param string       $meta_key    Meta key to register.\n * @param array        $args {\n *     Data used to describe the meta key when registered.\n *\n *     @type string     $object_subtype    A subtype; e.g. if the object type is \"post\", the post type. If left empty,\n *                                         the meta key will be registered on the entire object type. Default empty.\n *     @type string     $type              The type of data associated with this meta key.\n *                                         Valid values are 'string', 'boolean', 'integer', 'number', 'array', and 'object'.\n *     @type string     $description       A description of the data attached to this meta key.\n *     @type bool       $single            Whether the meta key has one value per object, or an array of values per object.\n *     @type mixed      $default           The default value returned from get_metadata() if no value has been set yet.\n *                                         When using a non-single meta key, the default value is for the first entry.\n *                                         In other words, when calling get_metadata() with `$single` set to `false`,\n *                                         the default value given here will be wrapped in an array.\n *     @type callable   $sanitize_callback A function or method to call when sanitizing `$meta_key` data.\n *     @type callable   $auth_callback     Optional. A function or method to call when performing edit_post_meta,\n *                                         add_post_meta, and delete_post_meta capability checks.\n *     @type bool|array $show_in_rest      Whether data associated with this meta key can be considered public and\n *                                         should be accessible via the REST API. A custom post type must also declare\n *                                         support for custom fields for registered meta to be accessible via REST.\n *                                         When registering complex meta values this argument may optionally be an\n *                                         array with 'schema' or 'prepare_callback' keys instead of a boolean.\n * }\n * @param string|array $deprecated Deprecated. Use `$args` instead.\n * @return bool True if the meta key was successfully registered in the global array, false if not.\n *              Registering a meta key with distinct sanitize and auth callbacks will fire those callbacks,\n *              but will not add to the global registry.\n */\nfunction register_meta( $object_type, $meta_key, $args, $deprecated = null ) {\n\tglobal $wp_meta_keys;\n\n\tif ( ! is_array( $wp_meta_keys ) ) {\n\t\t$wp_meta_keys = array();\n\t}\n\n\t$defaults = array(\n\t\t'object_subtype'    => '',\n\t\t'type'              => 'string',\n\t\t'description'       => '',\n\t\t'default'           => '',\n\t\t'single'            => false,\n\t\t'sanitize_callback' => null,\n\t\t'auth_callback'     => null,\n\t\t'show_in_rest'      => false,\n\t);\n\n\t// There used to be individual args for sanitize and auth callbacks.\n\t$has_old_sanitize_cb = false;\n\t$has_old_auth_cb     = false;\n\n\tif ( is_callable( $args ) ) {\n\t\t$args = array(\n\t\t\t'sanitize_callback' => $args,\n\t\t);\n\n\t\t$has_old_sanitize_cb = true;\n\t} else {\n\t\t$args = (array) $args;\n\t}\n\n\tif ( is_callable( $deprecated ) ) {\n\t\t$args['auth_callback'] = $deprecated;\n\t\t$has_old_auth_cb       = true;\n\t}\n\n\t/**\n\t * Filters the registration arguments when registering meta.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param array  $args        Array of meta registration arguments.\n\t * @param array  $defaults    Array of default arguments.\n\t * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n\t *                            or any other object type with an associated meta table.\n\t * @param string $meta_key    Meta key.\n\t */\n\t$args = apply_filters( 'register_meta_args', $args, $defaults, $object_type, $meta_key );\n\tunset( $defaults['default'] );\n\t$args = wp_parse_args( $args, $defaults );\n\n\t// Require an item schema when registering array meta.\n\tif ( false !== $args['show_in_rest'] && 'array' === $args['type'] ) {\n\t\tif ( ! is_array( $args['show_in_rest'] ) || ! isset( $args['show_in_rest']['schema']['items'] ) ) {\n\t\t\t_doing_it_wrong( __FUNCTION__, __( 'When registering an \"array\" meta type to show in the REST API, you must specify the schema for each array item in \"show_in_rest.schema.items\".' ), '5.3.0' );\n\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t$object_subtype = ! empty( $args['object_subtype'] ) ? $args['object_subtype'] : '';\n\n\t// If `auth_callback` is not provided, fall back to `is_protected_meta()`.\n\tif ( empty( $args['auth_callback'] ) ) {\n\t\tif ( is_protected_meta( $meta_key, $object_type ) ) {\n\t\t\t$args['auth_callback'] = '__return_false';\n\t\t} else {\n\t\t\t$args['auth_callback'] = '__return_true';\n\t\t}\n\t}\n\n\t// Back-compat: old sanitize and auth callbacks are applied to all of an object type.\n\tif ( is_callable( $args['sanitize_callback'] ) ) {\n\t\tif ( ! empty( $object_subtype ) ) {\n\t\t\tadd_filter( \"sanitize_{$object_type}_meta_{$meta_key}_for_{$object_subtype}\", $args['sanitize_callback'], 10, 4 );\n\t\t} else {\n\t\t\tadd_filter( \"sanitize_{$object_type}_meta_{$meta_key}\", $args['sanitize_callback'], 10, 3 );\n\t\t}\n\t}\n\n\tif ( is_callable( $args['auth_callback'] ) ) {\n\t\tif ( ! empty( $object_subtype ) ) {\n\t\t\tadd_filter( \"auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}\", $args['auth_callback'], 10, 6 );\n\t\t} else {\n\t\t\tadd_filter( \"auth_{$object_type}_meta_{$meta_key}\", $args['auth_callback'], 10, 6 );\n\t\t}\n\t}\n\n\tif ( array_key_exists( 'default', $args ) ) {\n\t\t$schema = $args;\n\t\tif ( is_array( $args['show_in_rest'] ) && isset( $args['show_in_rest']['schema'] ) ) {\n\t\t\t$schema = array_merge( $schema, $args['show_in_rest']['schema'] );\n\t\t}\n\n\t\t$check = rest_validate_value_from_schema( $args['default'], $schema );\n\t\tif ( is_wp_error( $check ) ) {\n\t\t\t_doing_it_wrong( __FUNCTION__, __( 'When registering a default meta value the data must match the type provided.' ), '5.5.0' );\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! has_filter( \"default_{$object_type}_metadata\", 'filter_default_metadata' ) ) {\n\t\t\tadd_filter( \"default_{$object_type}_metadata\", 'filter_default_metadata', 10, 5 );\n\t\t}\n\t}\n\n\t// Global registry only contains meta keys registered with the array of arguments added in 4.6.0.\n\tif ( ! $has_old_auth_cb && ! $has_old_sanitize_cb ) {\n\t\tunset( $args['object_subtype'] );\n\n\t\t$wp_meta_keys[ $object_type ][ $object_subtype ][ $meta_key ] = $args;\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Filters into default_{$object_type}_metadata and adds in default value.\n *\n * @since 5.5.0\n *\n * @param mixed  $value     Current value passed to filter.\n * @param int    $object_id ID of the object metadata is for.\n * @param string $meta_key  Metadata key.\n * @param bool   $single    If true, return only the first value of the specified meta_key.\n *                          This parameter has no effect if meta_key is not specified.\n * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                          or any other object type with an associated meta table.\n * @return mixed Single metadata default, or array of defaults.\n */\nfunction filter_default_metadata( $value, $object_id, $meta_key, $single, $meta_type ) {\n\tglobal $wp_meta_keys;\n\n\tif ( wp_installing() ) {\n\t\treturn $value;\n\t}\n\n\tif ( ! is_array( $wp_meta_keys ) || ! isset( $wp_meta_keys[ $meta_type ] ) ) {\n\t\treturn $value;\n\t}\n\n\t$defaults = array();\n\tforeach ( $wp_meta_keys[ $meta_type ] as $sub_type => $meta_data ) {\n\t\tforeach ( $meta_data as $_meta_key => $args ) {\n\t\t\tif ( $_meta_key === $meta_key && array_key_exists( 'default', $args ) ) {\n\t\t\t\t$defaults[ $sub_type ] = $args;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! $defaults ) {\n\t\treturn $value;\n\t}\n\n\t// If this meta type does not have subtypes, then the default is keyed as an empty string.\n\tif ( isset( $defaults[''] ) ) {\n\t\t$metadata = $defaults[''];\n\t} else {\n\t\t$sub_type = get_object_subtype( $meta_type, $object_id );\n\t\tif ( ! isset( $defaults[ $sub_type ] ) ) {\n\t\t\treturn $value;\n\t\t}\n\t\t$metadata = $defaults[ $sub_type ];\n\t}\n\n\tif ( $single ) {\n\t\t$value = $metadata['default'];\n\t} else {\n\t\t$value = array( $metadata['default'] );\n\t}\n\n\treturn $value;\n}\n\n/**\n * Checks if a meta key is registered.\n *\n * @since 4.6.0\n * @since 4.9.8 The `$object_subtype` parameter was added.\n *\n * @param string $object_type    Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                               or any other object type with an associated meta table.\n * @param string $meta_key       Metadata key.\n * @param string $object_subtype Optional. The subtype of the object type.\n * @return bool True if the meta key is registered to the object type and, if provided,\n *              the object subtype. False if not.\n */\nfunction registered_meta_key_exists( $object_type, $meta_key, $object_subtype = '' ) {\n\t$meta_keys = get_registered_meta_keys( $object_type, $object_subtype );\n\n\treturn isset( $meta_keys[ $meta_key ] );\n}\n\n/**\n * Unregisters a meta key from the list of registered keys.\n *\n * @since 4.6.0\n * @since 4.9.8 The `$object_subtype` parameter was added.\n *\n * @param string $object_type    Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                               or any other object type with an associated meta table.\n * @param string $meta_key       Metadata key.\n * @param string $object_subtype Optional. The subtype of the object type.\n * @return bool True if successful. False if the meta key was not registered.\n */\nfunction unregister_meta_key( $object_type, $meta_key, $object_subtype = '' ) {\n\tglobal $wp_meta_keys;\n\n\tif ( ! registered_meta_key_exists( $object_type, $meta_key, $object_subtype ) ) {\n\t\treturn false;\n\t}\n\n\t$args = $wp_meta_keys[ $object_type ][ $object_subtype ][ $meta_key ];\n\n\tif ( isset( $args['sanitize_callback'] ) && is_callable( $args['sanitize_callback'] ) ) {\n\t\tif ( ! empty( $object_subtype ) ) {\n\t\t\tremove_filter( \"sanitize_{$object_type}_meta_{$meta_key}_for_{$object_subtype}\", $args['sanitize_callback'] );\n\t\t} else {\n\t\t\tremove_filter( \"sanitize_{$object_type}_meta_{$meta_key}\", $args['sanitize_callback'] );\n\t\t}\n\t}\n\n\tif ( isset( $args['auth_callback'] ) && is_callable( $args['auth_callback'] ) ) {\n\t\tif ( ! empty( $object_subtype ) ) {\n\t\t\tremove_filter( \"auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}\", $args['auth_callback'] );\n\t\t} else {\n\t\t\tremove_filter( \"auth_{$object_type}_meta_{$meta_key}\", $args['auth_callback'] );\n\t\t}\n\t}\n\n\tunset( $wp_meta_keys[ $object_type ][ $object_subtype ][ $meta_key ] );\n\n\t// Do some clean up.\n\tif ( empty( $wp_meta_keys[ $object_type ][ $object_subtype ] ) ) {\n\t\tunset( $wp_meta_keys[ $object_type ][ $object_subtype ] );\n\t}\n\tif ( empty( $wp_meta_keys[ $object_type ] ) ) {\n\t\tunset( $wp_meta_keys[ $object_type ] );\n\t}\n\n\treturn true;\n}\n\n/**\n * Retrieves a list of registered meta keys for an object type.\n *\n * @since 4.6.0\n * @since 4.9.8 The `$object_subtype` parameter was added.\n *\n * @param string $object_type    Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                               or any other object type with an associated meta table.\n * @param string $object_subtype Optional. The subtype of the object type.\n * @return string[] List of registered meta keys.\n */\nfunction get_registered_meta_keys( $object_type, $object_subtype = '' ) {\n\tglobal $wp_meta_keys;\n\n\tif ( ! is_array( $wp_meta_keys ) || ! isset( $wp_meta_keys[ $object_type ] ) || ! isset( $wp_meta_keys[ $object_type ][ $object_subtype ] ) ) {\n\t\treturn array();\n\t}\n\n\treturn $wp_meta_keys[ $object_type ][ $object_subtype ];\n}\n\n/**\n * Retrieves registered metadata for a specified object.\n *\n * The results include both meta that is registered specifically for the\n * object's subtype and meta that is registered for the entire object type.\n *\n * @since 4.6.0\n *\n * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                            or any other object type with an associated meta table.\n * @param int    $object_id   ID of the object the metadata is for.\n * @param string $meta_key    Optional. Registered metadata key. If not specified, retrieve all registered\n *                            metadata for the specified object.\n * @return mixed A single value or array of values for a key if specified. An array of all registered keys\n *               and values for an object ID if not. False if a given $meta_key is not registered.\n */\nfunction get_registered_metadata( $object_type, $object_id, $meta_key = '' ) {\n\t$object_subtype = get_object_subtype( $object_type, $object_id );\n\n\tif ( ! empty( $meta_key ) ) {\n\t\tif ( ! empty( $object_subtype ) && ! registered_meta_key_exists( $object_type, $meta_key, $object_subtype ) ) {\n\t\t\t$object_subtype = '';\n\t\t}\n\n\t\tif ( ! registered_meta_key_exists( $object_type, $meta_key, $object_subtype ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$meta_keys     = get_registered_meta_keys( $object_type, $object_subtype );\n\t\t$meta_key_data = $meta_keys[ $meta_key ];\n\n\t\t$data = get_metadata( $object_type, $object_id, $meta_key, $meta_key_data['single'] );\n\n\t\treturn $data;\n\t}\n\n\t$data = get_metadata( $object_type, $object_id );\n\tif ( ! $data ) {\n\t\treturn array();\n\t}\n\n\t$meta_keys = get_registered_meta_keys( $object_type );\n\tif ( ! empty( $object_subtype ) ) {\n\t\t$meta_keys = array_merge( $meta_keys, get_registered_meta_keys( $object_type, $object_subtype ) );\n\t}\n\n\treturn array_intersect_key( $data, $meta_keys );\n}\n\n/**\n * Filters out `register_meta()` args based on an allowed list.\n *\n * `register_meta()` args may change over time, so requiring the allowed list\n * to be explicitly turned off is a warranty seal of sorts.\n *\n * @access private\n * @since 5.5.0\n *\n * @param array $args         Arguments from `register_meta()`.\n * @param array $default_args Default arguments for `register_meta()`.\n * @return array Filtered arguments.\n */\nfunction _wp_register_meta_args_allowed_list( $args, $default_args ) {\n\treturn array_intersect_key( $args, $default_args );\n}\n\n/**\n * Returns the object subtype for a given object ID of a specific type.\n *\n * @since 4.9.8\n *\n * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',\n *                            or any other object type with an associated meta table.\n * @param int    $object_id   ID of the object to retrieve its subtype.\n * @return string The object subtype or an empty string if unspecified subtype.\n */\nfunction get_object_subtype( $object_type, $object_id ) {\n\t$object_id      = (int) $object_id;\n\t$object_subtype = '';\n\n\tswitch ( $object_type ) {\n\t\tcase 'post':\n\t\t\t$post_type = get_post_type( $object_id );\n\n\t\t\tif ( ! empty( $post_type ) ) {\n\t\t\t\t$object_subtype = $post_type;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'term':\n\t\t\t$term = get_term( $object_id );\n\t\t\tif ( ! $term instanceof WP_Term ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$object_subtype = $term->taxonomy;\n\t\t\tbreak;\n\n\t\tcase 'comment':\n\t\t\t$comment = get_comment( $object_id );\n\t\t\tif ( ! $comment ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$object_subtype = 'comment';\n\t\t\tbreak;\n\n\t\tcase 'user':\n\t\t\t$user = get_user_by( 'id', $object_id );\n\t\t\tif ( ! $user ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$object_subtype = 'user';\n\t\t\tbreak;\n\t}\n\n\t/**\n\t * Filters the object subtype identifier for a non-standard object type.\n\t *\n\t * The dynamic portion of the hook, `$object_type`, refers to the meta object type\n\t * (post, comment, term, user, or any other type with an associated meta table).\n\t *\n\t * @since 4.9.8\n\t *\n\t * @param string $object_subtype Empty string to override.\n\t * @param int    $object_id      ID of the object to get the subtype for.\n\t */\n\treturn apply_filters( \"get_object_subtype_{$object_type}\", $object_subtype, $object_id );\n}\n", "num_lines": 1674}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * Site/blog functions that work with the blogs table and related data.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since MU (3.0.0)\n */\n\nrequire_once ABSPATH . WPINC . '/ms-site.php';\nrequire_once ABSPATH . WPINC . '/ms-network.php';\n\n/**\n * Update the last_updated field for the current site.\n *\n * @since MU (3.0.0)\n */\nfunction wpmu_update_blogs_date() {\n\t$site_id = get_current_blog_id();\n\n\tupdate_blog_details( $site_id, array( 'last_updated' => current_time( 'mysql', true ) ) );\n\t/**\n\t * Fires after the blog details are updated.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param int $blog_id Site ID.\n\t */\n\tdo_action( 'wpmu_blog_updated', $site_id );\n}\n\n/**\n * Get a full blog URL, given a blog ID.\n *\n * @since MU (3.0.0)\n *\n * @param int $blog_id Blog ID.\n * @return string Full URL of the blog if found. Empty string if not.\n */\nfunction get_blogaddress_by_id( $blog_id ) {\n\t$bloginfo = get_site( (int) $blog_id );\n\n\tif ( empty( $bloginfo ) ) {\n\t\treturn '';\n\t}\n\n\t$scheme = parse_url( $bloginfo->home, PHP_URL_SCHEME );\n\t$scheme = empty( $scheme ) ? 'http' : $scheme;\n\n\treturn esc_url( $scheme . '://' . $bloginfo->domain . $bloginfo->path );\n}\n\n/**\n * Get a full blog URL, given a blog name.\n *\n * @since MU (3.0.0)\n *\n * @param string $blogname The (subdomain or directory) name\n * @return string\n */\nfunction get_blogaddress_by_name( $blogname ) {\n\tif ( is_subdomain_install() ) {\n\t\tif ( 'main' === $blogname ) {\n\t\t\t$blogname = 'www';\n\t\t}\n\t\t$url = rtrim( network_home_url(), '/' );\n\t\tif ( ! empty( $blogname ) ) {\n\t\t\t$url = preg_replace( '|^([^\\.]+://)|', '${1}' . $blogname . '.', $url );\n\t\t}\n\t} else {\n\t\t$url = network_home_url( $blogname );\n\t}\n\treturn esc_url( $url . '/' );\n}\n\n/**\n * Retrieves a sites ID given its (subdomain or directory) slug.\n *\n * @since MU (3.0.0)\n * @since 4.7.0 Converted to use `get_sites()`.\n *\n * @param string $slug A site's slug.\n * @return int|null The site ID, or null if no site is found for the given slug.\n */\nfunction get_id_from_blogname( $slug ) {\n\t$current_network = get_network();\n\t$slug            = trim( $slug, '/' );\n\n\tif ( is_subdomain_install() ) {\n\t\t$domain = $slug . '.' . preg_replace( '|^www\\.|', '', $current_network->domain );\n\t\t$path   = $current_network->path;\n\t} else {\n\t\t$domain = $current_network->domain;\n\t\t$path   = $current_network->path . $slug . '/';\n\t}\n\n\t$site_ids = get_sites(\n\t\tarray(\n\t\t\t'number'                 => 1,\n\t\t\t'fields'                 => 'ids',\n\t\t\t'domain'                 => $domain,\n\t\t\t'path'                   => $path,\n\t\t\t'update_site_meta_cache' => false,\n\t\t)\n\t);\n\n\tif ( empty( $site_ids ) ) {\n\t\treturn null;\n\t}\n\n\treturn array_shift( $site_ids );\n}\n\n/**\n * Retrieve the details for a blog from the blogs table and blog options.\n *\n * @since MU (3.0.0)\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int|string|array $fields  Optional. A blog ID, a blog slug, or an array of fields to query against.\n *                                  If not specified the current blog ID is used.\n * @param bool             $get_all Whether to retrieve all details or only the details in the blogs table.\n *                                  Default is true.\n * @return WP_Site|false Blog details on success. False on failure.\n */\nfunction get_blog_details( $fields = null, $get_all = true ) {\n\tglobal $wpdb;\n\n\tif ( is_array( $fields ) ) {\n\t\tif ( isset( $fields['blog_id'] ) ) {\n\t\t\t$blog_id = $fields['blog_id'];\n\t\t} elseif ( isset( $fields['domain'] ) && isset( $fields['path'] ) ) {\n\t\t\t$key  = md5( $fields['domain'] . $fields['path'] );\n\t\t\t$blog = wp_cache_get( $key, 'blog-lookup' );\n\t\t\tif ( false !== $blog ) {\n\t\t\t\treturn $blog;\n\t\t\t}\n\t\t\tif ( 'www.' === substr( $fields['domain'], 0, 4 ) ) {\n\t\t\t\t$nowww = substr( $fields['domain'], 4 );\n\t\t\t\t$blog  = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $wpdb->blogs WHERE domain IN (%s,%s) AND path = %s ORDER BY CHAR_LENGTH(domain) DESC\", $nowww, $fields['domain'], $fields['path'] ) );\n\t\t\t} else {\n\t\t\t\t$blog = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $wpdb->blogs WHERE domain = %s AND path = %s\", $fields['domain'], $fields['path'] ) );\n\t\t\t}\n\t\t\tif ( $blog ) {\n\t\t\t\twp_cache_set( $blog->blog_id . 'short', $blog, 'blog-details' );\n\t\t\t\t$blog_id = $blog->blog_id;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} elseif ( isset( $fields['domain'] ) && is_subdomain_install() ) {\n\t\t\t$key  = md5( $fields['domain'] );\n\t\t\t$blog = wp_cache_get( $key, 'blog-lookup' );\n\t\t\tif ( false !== $blog ) {\n\t\t\t\treturn $blog;\n\t\t\t}\n\t\t\tif ( 'www.' === substr( $fields['domain'], 0, 4 ) ) {\n\t\t\t\t$nowww = substr( $fields['domain'], 4 );\n\t\t\t\t$blog  = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $wpdb->blogs WHERE domain IN (%s,%s) ORDER BY CHAR_LENGTH(domain) DESC\", $nowww, $fields['domain'] ) );\n\t\t\t} else {\n\t\t\t\t$blog = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $wpdb->blogs WHERE domain = %s\", $fields['domain'] ) );\n\t\t\t}\n\t\t\tif ( $blog ) {\n\t\t\t\twp_cache_set( $blog->blog_id . 'short', $blog, 'blog-details' );\n\t\t\t\t$blog_id = $blog->blog_id;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t} else {\n\t\tif ( ! $fields ) {\n\t\t\t$blog_id = get_current_blog_id();\n\t\t} elseif ( ! is_numeric( $fields ) ) {\n\t\t\t$blog_id = get_id_from_blogname( $fields );\n\t\t} else {\n\t\t\t$blog_id = $fields;\n\t\t}\n\t}\n\n\t$blog_id = (int) $blog_id;\n\n\t$all     = $get_all ? '' : 'short';\n\t$details = wp_cache_get( $blog_id . $all, 'blog-details' );\n\n\tif ( $details ) {\n\t\tif ( ! is_object( $details ) ) {\n\t\t\tif ( -1 == $details ) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t// Clear old pre-serialized objects. Cache clients do better with that.\n\t\t\t\twp_cache_delete( $blog_id . $all, 'blog-details' );\n\t\t\t\tunset( $details );\n\t\t\t}\n\t\t} else {\n\t\t\treturn $details;\n\t\t}\n\t}\n\n\t// Try the other cache.\n\tif ( $get_all ) {\n\t\t$details = wp_cache_get( $blog_id . 'short', 'blog-details' );\n\t} else {\n\t\t$details = wp_cache_get( $blog_id, 'blog-details' );\n\t\t// If short was requested and full cache is set, we can return.\n\t\tif ( $details ) {\n\t\t\tif ( ! is_object( $details ) ) {\n\t\t\t\tif ( -1 == $details ) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\t// Clear old pre-serialized objects. Cache clients do better with that.\n\t\t\t\t\twp_cache_delete( $blog_id, 'blog-details' );\n\t\t\t\t\tunset( $details );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn $details;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( empty( $details ) ) {\n\t\t$details = WP_Site::get_instance( $blog_id );\n\t\tif ( ! $details ) {\n\t\t\t// Set the full cache.\n\t\t\twp_cache_set( $blog_id, -1, 'blog-details' );\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif ( ! $details instanceof WP_Site ) {\n\t\t$details = new WP_Site( $details );\n\t}\n\n\tif ( ! $get_all ) {\n\t\twp_cache_set( $blog_id . $all, $details, 'blog-details' );\n\t\treturn $details;\n\t}\n\n\t$switched_blog = false;\n\n\tif ( get_current_blog_id() !== $blog_id ) {\n\t\tswitch_to_blog( $blog_id );\n\t\t$switched_blog = true;\n\t}\n\n\t$details->blogname   = get_option( 'blogname' );\n\t$details->siteurl    = get_option( 'siteurl' );\n\t$details->post_count = get_option( 'post_count' );\n\t$details->home       = get_option( 'home' );\n\n\tif ( $switched_blog ) {\n\t\trestore_current_blog();\n\t}\n\n\t/**\n\t * Filters a blog's details.\n\t *\n\t * @since MU (3.0.0)\n\t * @deprecated 4.7.0 Use {@see 'site_details'} instead.\n\t *\n\t * @param object $details The blog details.\n\t */\n\t$details = apply_filters_deprecated( 'blog_details', array( $details ), '4.7.0', 'site_details' );\n\n\twp_cache_set( $blog_id . $all, $details, 'blog-details' );\n\n\t$key = md5( $details->domain . $details->path );\n\twp_cache_set( $key, $details, 'blog-lookup' );\n\n\treturn $details;\n}\n\n/**\n * Clear the blog details cache.\n *\n * @since MU (3.0.0)\n *\n * @param int $blog_id Optional. Blog ID. Defaults to current blog.\n */\nfunction refresh_blog_details( $blog_id = 0 ) {\n\t$blog_id = (int) $blog_id;\n\tif ( ! $blog_id ) {\n\t\t$blog_id = get_current_blog_id();\n\t}\n\n\tclean_blog_cache( $blog_id );\n}\n\n/**\n * Update the details for a blog. Updates the blogs table for a given blog ID.\n *\n * @since MU (3.0.0)\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int   $blog_id Blog ID.\n * @param array $details Array of details keyed by blogs table field names.\n * @return bool True if update succeeds, false otherwise.\n */\nfunction update_blog_details( $blog_id, $details = array() ) {\n\tglobal $wpdb;\n\n\tif ( empty( $details ) ) {\n\t\treturn false;\n\t}\n\n\tif ( is_object( $details ) ) {\n\t\t$details = get_object_vars( $details );\n\t}\n\n\t$site = wp_update_site( $blog_id, $details );\n\n\tif ( is_wp_error( $site ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Cleans the site details cache for a site.\n *\n * @since 4.7.4\n *\n * @param int $site_id Optional. Site ID. Default is the current site ID.\n */\nfunction clean_site_details_cache( $site_id = 0 ) {\n\t$site_id = (int) $site_id;\n\tif ( ! $site_id ) {\n\t\t$site_id = get_current_blog_id();\n\t}\n\n\twp_cache_delete( $site_id, 'site-details' );\n\twp_cache_delete( $site_id, 'blog-details' );\n}\n\n/**\n * Retrieve option value for a given blog id based on name of option.\n *\n * If the option does not exist or does not have a value, then the return value\n * will be false. This is useful to check whether you need to install an option\n * and is commonly used during installation of plugin options and to test\n * whether upgrading is required.\n *\n * If the option was serialized then it will be unserialized when it is returned.\n *\n * @since MU (3.0.0)\n *\n * @param int    $id      A blog ID. Can be null to refer to the current blog.\n * @param string $option  Name of option to retrieve. Expected to not be SQL-escaped.\n * @param mixed  $default Optional. Default value to return if the option does not exist.\n * @return mixed Value set for the option.\n */\nfunction get_blog_option( $id, $option, $default = false ) {\n\t$id = (int) $id;\n\n\tif ( empty( $id ) ) {\n\t\t$id = get_current_blog_id();\n\t}\n\n\tif ( get_current_blog_id() == $id ) {\n\t\treturn get_option( $option, $default );\n\t}\n\n\tswitch_to_blog( $id );\n\t$value = get_option( $option, $default );\n\trestore_current_blog();\n\n\t/**\n\t * Filters a blog option value.\n\t *\n\t * The dynamic portion of the hook name, `$option`, refers to the blog option name.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string  $value The option value.\n\t * @param int     $id    Blog ID.\n\t */\n\treturn apply_filters( \"blog_option_{$option}\", $value, $id );\n}\n\n/**\n * Add a new option for a given blog ID.\n *\n * You do not need to serialize values. If the value needs to be serialized, then\n * it will be serialized before it is inserted into the database. Remember,\n * resources can not be serialized or added as an option.\n *\n * You can create options without values and then update the values later.\n * Existing options will not be updated and checks are performed to ensure that you\n * aren't adding a protected WordPress option. Care should be taken to not name\n * options the same as the ones which are protected.\n *\n * @since MU (3.0.0)\n *\n * @param int    $id     A blog ID. Can be null to refer to the current blog.\n * @param string $option Name of option to add. Expected to not be SQL-escaped.\n * @param mixed  $value  Optional. Option value, can be anything. Expected to not be SQL-escaped.\n * @return bool True if the option was added, false otherwise.\n */\nfunction add_blog_option( $id, $option, $value ) {\n\t$id = (int) $id;\n\n\tif ( empty( $id ) ) {\n\t\t$id = get_current_blog_id();\n\t}\n\n\tif ( get_current_blog_id() == $id ) {\n\t\treturn add_option( $option, $value );\n\t}\n\n\tswitch_to_blog( $id );\n\t$return = add_option( $option, $value );\n\trestore_current_blog();\n\n\treturn $return;\n}\n\n/**\n * Removes option by name for a given blog ID. Prevents removal of protected WordPress options.\n *\n * @since MU (3.0.0)\n *\n * @param int    $id     A blog ID. Can be null to refer to the current blog.\n * @param string $option Name of option to remove. Expected to not be SQL-escaped.\n * @return bool True if the option was deleted, false otherwise.\n */\nfunction delete_blog_option( $id, $option ) {\n\t$id = (int) $id;\n\n\tif ( empty( $id ) ) {\n\t\t$id = get_current_blog_id();\n\t}\n\n\tif ( get_current_blog_id() == $id ) {\n\t\treturn delete_option( $option );\n\t}\n\n\tswitch_to_blog( $id );\n\t$return = delete_option( $option );\n\trestore_current_blog();\n\n\treturn $return;\n}\n\n/**\n * Update an option for a particular blog.\n *\n * @since MU (3.0.0)\n *\n * @param int    $id         The blog ID.\n * @param string $option     The option key.\n * @param mixed  $value      The option value.\n * @param mixed  $deprecated Not used.\n * @return bool True if the value was updated, false otherwise.\n */\nfunction update_blog_option( $id, $option, $value, $deprecated = null ) {\n\t$id = (int) $id;\n\n\tif ( null !== $deprecated ) {\n\t\t_deprecated_argument( __FUNCTION__, '3.1.0' );\n\t}\n\n\tif ( get_current_blog_id() == $id ) {\n\t\treturn update_option( $option, $value );\n\t}\n\n\tswitch_to_blog( $id );\n\t$return = update_option( $option, $value );\n\trestore_current_blog();\n\n\treturn $return;\n}\n\n/**\n * Switch the current blog.\n *\n * This function is useful if you need to pull posts, or other information,\n * from other blogs. You can switch back afterwards using restore_current_blog().\n *\n * Things that aren't switched:\n *  - plugins. See #14941\n *\n * @see restore_current_blog()\n * @since MU (3.0.0)\n *\n * @global wpdb            $wpdb               WordPress database abstraction object.\n * @global int             $blog_id\n * @global array           $_wp_switched_stack\n * @global bool            $switched\n * @global string          $table_prefix\n * @global WP_Object_Cache $wp_object_cache\n *\n * @param int  $new_blog_id The ID of the blog to switch to. Default: current blog.\n * @param bool $deprecated  Not used.\n * @return true Always returns true.\n */\nfunction switch_to_blog( $new_blog_id, $deprecated = null ) {\n\tglobal $wpdb;\n\n\t$prev_blog_id = get_current_blog_id();\n\tif ( empty( $new_blog_id ) ) {\n\t\t$new_blog_id = $prev_blog_id;\n\t}\n\n\t$GLOBALS['_wp_switched_stack'][] = $prev_blog_id;\n\n\t/*\n\t * If we're switching to the same blog id that we're on,\n\t * set the right vars, do the associated actions, but skip\n\t * the extra unnecessary work\n\t */\n\tif ( $new_blog_id == $prev_blog_id ) {\n\t\t/**\n\t\t * Fires when the blog is switched.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t * @since 5.4.0 The `$context` parameter was added.\n\t\t *\n\t\t * @param int    $new_blog_id  New blog ID.\n\t\t * @param int    $prev_blog_id Previous blog ID.\n\t\t * @param string $context      Additional context. Accepts 'switch' when called from switch_to_blog()\n\t\t *                             or 'restore' when called from restore_current_blog().\n\t\t */\n\t\tdo_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'switch' );\n\n\t\t$GLOBALS['switched'] = true;\n\n\t\treturn true;\n\t}\n\n\t$wpdb->set_blog_id( $new_blog_id );\n\t$GLOBALS['table_prefix'] = $wpdb->get_blog_prefix();\n\t$GLOBALS['blog_id']      = $new_blog_id;\n\n\tif ( function_exists( 'wp_cache_switch_to_blog' ) ) {\n\t\twp_cache_switch_to_blog( $new_blog_id );\n\t} else {\n\t\tglobal $wp_object_cache;\n\n\t\tif ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) {\n\t\t\t$global_groups = $wp_object_cache->global_groups;\n\t\t} else {\n\t\t\t$global_groups = false;\n\t\t}\n\n\t\twp_cache_init();\n\n\t\tif ( function_exists( 'wp_cache_add_global_groups' ) ) {\n\t\t\tif ( is_array( $global_groups ) ) {\n\t\t\t\twp_cache_add_global_groups( $global_groups );\n\t\t\t} else {\n\t\t\t\twp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'site-details', 'blog_meta' ) );\n\t\t\t}\n\n\t\t\twp_cache_add_non_persistent_groups( array( 'counts', 'plugins' ) );\n\t\t}\n\t}\n\n\t/** This filter is documented in wp-includes/ms-blogs.php */\n\tdo_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'switch' );\n\n\t$GLOBALS['switched'] = true;\n\n\treturn true;\n}\n\n/**\n * Restore the current blog, after calling switch_to_blog().\n *\n * @see switch_to_blog()\n * @since MU (3.0.0)\n *\n * @global wpdb            $wpdb               WordPress database abstraction object.\n * @global array           $_wp_switched_stack\n * @global int             $blog_id\n * @global bool            $switched\n * @global string          $table_prefix\n * @global WP_Object_Cache $wp_object_cache\n *\n * @return bool True on success, false if we're already on the current blog.\n */\nfunction restore_current_blog() {\n\tglobal $wpdb;\n\n\tif ( empty( $GLOBALS['_wp_switched_stack'] ) ) {\n\t\treturn false;\n\t}\n\n\t$new_blog_id  = array_pop( $GLOBALS['_wp_switched_stack'] );\n\t$prev_blog_id = get_current_blog_id();\n\n\tif ( $new_blog_id == $prev_blog_id ) {\n\t\t/** This filter is documented in wp-includes/ms-blogs.php */\n\t\tdo_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'restore' );\n\n\t\t// If we still have items in the switched stack, consider ourselves still 'switched'.\n\t\t$GLOBALS['switched'] = ! empty( $GLOBALS['_wp_switched_stack'] );\n\n\t\treturn true;\n\t}\n\n\t$wpdb->set_blog_id( $new_blog_id );\n\t$GLOBALS['blog_id']      = $new_blog_id;\n\t$GLOBALS['table_prefix'] = $wpdb->get_blog_prefix();\n\n\tif ( function_exists( 'wp_cache_switch_to_blog' ) ) {\n\t\twp_cache_switch_to_blog( $new_blog_id );\n\t} else {\n\t\tglobal $wp_object_cache;\n\n\t\tif ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) {\n\t\t\t$global_groups = $wp_object_cache->global_groups;\n\t\t} else {\n\t\t\t$global_groups = false;\n\t\t}\n\n\t\twp_cache_init();\n\n\t\tif ( function_exists( 'wp_cache_add_global_groups' ) ) {\n\t\t\tif ( is_array( $global_groups ) ) {\n\t\t\t\twp_cache_add_global_groups( $global_groups );\n\t\t\t} else {\n\t\t\t\twp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'site-details', 'blog_meta' ) );\n\t\t\t}\n\n\t\t\twp_cache_add_non_persistent_groups( array( 'counts', 'plugins' ) );\n\t\t}\n\t}\n\n\t/** This filter is documented in wp-includes/ms-blogs.php */\n\tdo_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'restore' );\n\n\t// If we still have items in the switched stack, consider ourselves still 'switched'.\n\t$GLOBALS['switched'] = ! empty( $GLOBALS['_wp_switched_stack'] );\n\n\treturn true;\n}\n\n/**\n * Switches the initialized roles and current user capabilities to another site.\n *\n * @since 4.9.0\n *\n * @param int $new_site_id New site ID.\n * @param int $old_site_id Old site ID.\n */\nfunction wp_switch_roles_and_user( $new_site_id, $old_site_id ) {\n\tif ( $new_site_id == $old_site_id ) {\n\t\treturn;\n\t}\n\n\tif ( ! did_action( 'init' ) ) {\n\t\treturn;\n\t}\n\n\twp_roles()->for_site( $new_site_id );\n\twp_get_current_user()->for_site( $new_site_id );\n}\n\n/**\n * Determines if switch_to_blog() is in effect\n *\n * @since 3.5.0\n *\n * @global array $_wp_switched_stack\n *\n * @return bool True if switched, false otherwise.\n */\nfunction ms_is_switched() {\n\treturn ! empty( $GLOBALS['_wp_switched_stack'] );\n}\n\n/**\n * Check if a particular blog is archived.\n *\n * @since MU (3.0.0)\n *\n * @param int $id Blog ID.\n * @return string Whether the blog is archived or not.\n */\nfunction is_archived( $id ) {\n\treturn get_blog_status( $id, 'archived' );\n}\n\n/**\n * Update the 'archived' status of a particular blog.\n *\n * @since MU (3.0.0)\n *\n * @param int    $id       Blog ID.\n * @param string $archived The new status.\n * @return string $archived\n */\nfunction update_archived( $id, $archived ) {\n\tupdate_blog_status( $id, 'archived', $archived );\n\treturn $archived;\n}\n\n/**\n * Update a blog details field.\n *\n * @since MU (3.0.0)\n * @since 5.1.0 Use wp_update_site() internally.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int    $blog_id    Blog ID.\n * @param string $pref       Field name.\n * @param string $value      Field value.\n * @param null   $deprecated Not used.\n * @return string|false $value\n */\nfunction update_blog_status( $blog_id, $pref, $value, $deprecated = null ) {\n\tglobal $wpdb;\n\n\tif ( null !== $deprecated ) {\n\t\t_deprecated_argument( __FUNCTION__, '3.1.0' );\n\t}\n\n\t$allowed_field_names = array( 'site_id', 'domain', 'path', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' );\n\n\tif ( ! in_array( $pref, $allowed_field_names, true ) ) {\n\t\treturn $value;\n\t}\n\n\t$result = wp_update_site(\n\t\t$blog_id,\n\t\tarray(\n\t\t\t$pref => $value,\n\t\t)\n\t);\n\n\tif ( is_wp_error( $result ) ) {\n\t\treturn false;\n\t}\n\n\treturn $value;\n}\n\n/**\n * Get a blog details field.\n *\n * @since MU (3.0.0)\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int    $id   Blog ID.\n * @param string $pref Field name.\n * @return bool|string|null $value\n */\nfunction get_blog_status( $id, $pref ) {\n\tglobal $wpdb;\n\n\t$details = get_site( $id );\n\tif ( $details ) {\n\t\treturn $details->$pref;\n\t}\n\n\treturn $wpdb->get_var( $wpdb->prepare( \"SELECT %s FROM {$wpdb->blogs} WHERE blog_id = %d\", $pref, $id ) );\n}\n\n/**\n * Get a list of most recently updated blogs.\n *\n * @since MU (3.0.0)\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param mixed $deprecated Not used.\n * @param int   $start      Optional. Number of blogs to offset the query. Used to build LIMIT clause.\n *                          Can be used for pagination. Default 0.\n * @param int   $quantity   Optional. The maximum number of blogs to retrieve. Default 40.\n * @return array The list of blogs.\n */\nfunction get_last_updated( $deprecated = '', $start = 0, $quantity = 40 ) {\n\tglobal $wpdb;\n\n\tif ( ! empty( $deprecated ) ) {\n\t\t_deprecated_argument( __FUNCTION__, 'MU' ); // Never used.\n\t}\n\n\treturn $wpdb->get_results( $wpdb->prepare( \"SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND last_updated != '0000-00-00 00:00:00' ORDER BY last_updated DESC limit %d, %d\", get_current_network_id(), $start, $quantity ), ARRAY_A );\n}\n\n/**\n * Handler for updating the site's last updated date when a post is published or\n * an already published post is changed.\n *\n * @since 3.3.0\n *\n * @param string  $new_status The new post status.\n * @param string  $old_status The old post status.\n * @param WP_Post $post       Post object.\n */\nfunction _update_blog_date_on_post_publish( $new_status, $old_status, $post ) {\n\t$post_type_obj = get_post_type_object( $post->post_type );\n\tif ( ! $post_type_obj || ! $post_type_obj->public ) {\n\t\treturn;\n\t}\n\n\tif ( 'publish' !== $new_status && 'publish' !== $old_status ) {\n\t\treturn;\n\t}\n\n\t// Post was freshly published, published post was saved, or published post was unpublished.\n\n\twpmu_update_blogs_date();\n}\n\n/**\n * Handler for updating the current site's last updated date when a published\n * post is deleted.\n *\n * @since 3.4.0\n *\n * @param int $post_id Post ID\n */\nfunction _update_blog_date_on_post_delete( $post_id ) {\n\t$post = get_post( $post_id );\n\n\t$post_type_obj = get_post_type_object( $post->post_type );\n\tif ( ! $post_type_obj || ! $post_type_obj->public ) {\n\t\treturn;\n\t}\n\n\tif ( 'publish' !== $post->post_status ) {\n\t\treturn;\n\t}\n\n\twpmu_update_blogs_date();\n}\n\n/**\n * Handler for updating the current site's posts count when a post is deleted.\n *\n * @since 4.0.0\n *\n * @param int $post_id Post ID.\n */\nfunction _update_posts_count_on_delete( $post_id ) {\n\t$post = get_post( $post_id );\n\n\tif ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {\n\t\treturn;\n\t}\n\n\tupdate_posts_count();\n}\n\n/**\n * Handler for updating the current site's posts count when a post status changes.\n *\n * @since 4.0.0\n * @since 4.9.0 Added the `$post` parameter.\n *\n * @param string  $new_status The status the post is changing to.\n * @param string  $old_status The status the post is changing from.\n * @param WP_Post $post       Post object\n */\nfunction _update_posts_count_on_transition_post_status( $new_status, $old_status, $post = null ) {\n\tif ( $new_status === $old_status ) {\n\t\treturn;\n\t}\n\n\tif ( 'post' !== get_post_type( $post ) ) {\n\t\treturn;\n\t}\n\n\tif ( 'publish' !== $new_status && 'publish' !== $old_status ) {\n\t\treturn;\n\t}\n\n\tupdate_posts_count();\n}\n\n/**\n * Count number of sites grouped by site status.\n *\n * @since 5.3.0\n *\n * @param int $network_id Optional. The network to get counts for. Default is the current network ID.\n * @return int[] {\n *     Numbers of sites grouped by site status.\n *\n *     @type int $all      The total number of sites.\n *     @type int $public   The number of public sites.\n *     @type int $archived The number of archived sites.\n *     @type int $mature   The number of mature sites.\n *     @type int $spam     The number of spam sites.\n *     @type int $deleted  The number of deleted sites.\n * }\n */\nfunction wp_count_sites( $network_id = null ) {\n\tif ( empty( $network_id ) ) {\n\t\t$network_id = get_current_network_id();\n\t}\n\n\t$counts = array();\n\t$args   = array(\n\t\t'network_id'    => $network_id,\n\t\t'number'        => 1,\n\t\t'fields'        => 'ids',\n\t\t'no_found_rows' => false,\n\t);\n\n\t$q             = new WP_Site_Query( $args );\n\t$counts['all'] = $q->found_sites;\n\n\t$_args    = $args;\n\t$statuses = array( 'public', 'archived', 'mature', 'spam', 'deleted' );\n\n\tforeach ( $statuses as $status ) {\n\t\t$_args            = $args;\n\t\t$_args[ $status ] = 1;\n\n\t\t$q                 = new WP_Site_Query( $_args );\n\t\t$counts[ $status ] = $q->found_sites;\n\t}\n\n\treturn $counts;\n}\n", "num_lines": 925}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Defines constants and global variables that can be overridden, generally in wp-config.php.\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\n/**\n * Defines Multisite upload constants.\n *\n * Exists for backward compatibility with legacy file-serving through\n * wp-includes/ms-files.php (wp-content/blogs.php in MU).\n *\n * @since 3.0.0\n */\nfunction ms_upload_constants() {\n\t// This filter is attached in ms-default-filters.php but that file is not included during SHORTINIT.\n\tadd_filter( 'default_site_option_ms_files_rewriting', '__return_true' );\n\n\tif ( ! get_site_option( 'ms_files_rewriting' ) ) {\n\t\treturn;\n\t}\n\n\t// Base uploads dir relative to ABSPATH.\n\tif ( ! defined( 'UPLOADBLOGSDIR' ) ) {\n\t\tdefine( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );\n\t}\n\n\t// Note, the main site in a post-MU network uses wp-content/uploads.\n\t// This is handled in wp_upload_dir() by ignoring UPLOADS for this case.\n\tif ( ! defined( 'UPLOADS' ) ) {\n\t\t$site_id = get_current_blog_id();\n\n\t\tdefine( 'UPLOADS', UPLOADBLOGSDIR . '/' . $site_id . '/files/' );\n\n\t\t// Uploads dir relative to ABSPATH.\n\t\tif ( 'wp-content/blogs.dir' === UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) ) {\n\t\t\tdefine( 'BLOGUPLOADDIR', WP_CONTENT_DIR . '/blogs.dir/' . $site_id . '/files/' );\n\t\t}\n\t}\n}\n\n/**\n * Defines Multisite cookie constants.\n *\n * @since 3.0.0\n */\nfunction ms_cookie_constants() {\n\t$current_network = get_network();\n\n\t/**\n\t * @since 1.2.0\n\t */\n\tif ( ! defined( 'COOKIEPATH' ) ) {\n\t\tdefine( 'COOKIEPATH', $current_network->path );\n\t}\n\n\t/**\n\t * @since 1.5.0\n\t */\n\tif ( ! defined( 'SITECOOKIEPATH' ) ) {\n\t\tdefine( 'SITECOOKIEPATH', $current_network->path );\n\t}\n\n\t/**\n\t * @since 2.6.0\n\t */\n\tif ( ! defined( 'ADMIN_COOKIE_PATH' ) ) {\n\t\tif ( ! is_subdomain_install() || trim( parse_url( get_option( 'siteurl' ), PHP_URL_PATH ), '/' ) ) {\n\t\t\tdefine( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH );\n\t\t} else {\n\t\t\tdefine( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );\n\t\t}\n\t}\n\n\t/**\n\t * @since 2.0.0\n\t */\n\tif ( ! defined( 'COOKIE_DOMAIN' ) && is_subdomain_install() ) {\n\t\tif ( ! empty( $current_network->cookie_domain ) ) {\n\t\t\tdefine( 'COOKIE_DOMAIN', '.' . $current_network->cookie_domain );\n\t\t} else {\n\t\t\tdefine( 'COOKIE_DOMAIN', '.' . $current_network->domain );\n\t\t}\n\t}\n}\n\n/**\n * Defines Multisite file constants.\n *\n * Exists for backward compatibility with legacy file-serving through\n * wp-includes/ms-files.php (wp-content/blogs.php in MU).\n *\n * @since 3.0.0\n */\nfunction ms_file_constants() {\n\t/**\n\t * Optional support for X-Sendfile header\n\t *\n\t * @since 3.0.0\n\t */\n\tif ( ! defined( 'WPMU_SENDFILE' ) ) {\n\t\tdefine( 'WPMU_SENDFILE', false );\n\t}\n\n\t/**\n\t * Optional support for X-Accel-Redirect header\n\t *\n\t * @since 3.0.0\n\t */\n\tif ( ! defined( 'WPMU_ACCEL_REDIRECT' ) ) {\n\t\tdefine( 'WPMU_ACCEL_REDIRECT', false );\n\t}\n}\n\n/**\n * Defines Multisite subdomain constants and handles warnings and notices.\n *\n * VHOST is deprecated in favor of SUBDOMAIN_INSTALL, which is a bool.\n *\n * On first call, the constants are checked and defined. On second call,\n * we will have translations loaded and can trigger warnings easily.\n *\n * @since 3.0.0\n */\nfunction ms_subdomain_constants() {\n\tstatic $subdomain_error      = null;\n\tstatic $subdomain_error_warn = null;\n\n\tif ( false === $subdomain_error ) {\n\t\treturn;\n\t}\n\n\tif ( $subdomain_error ) {\n\t\t$vhost_deprecated = sprintf(\n\t\t\t/* translators: 1: VHOST, 2: SUBDOMAIN_INSTALL, 3: wp-config.php, 4: is_subdomain_install() */\n\t\t\t__( 'The constant %1$s <strong>is deprecated</strong>. Use the boolean constant %2$s in %3$s to enable a subdomain configuration. Use %4$s to check whether a subdomain configuration is enabled.' ),\n\t\t\t'<code>VHOST</code>',\n\t\t\t'<code>SUBDOMAIN_INSTALL</code>',\n\t\t\t'<code>wp-config.php</code>',\n\t\t\t'<code>is_subdomain_install()</code>'\n\t\t);\n\t\tif ( $subdomain_error_warn ) {\n\t\t\ttrigger_error( __( '<strong>Conflicting values for the constants VHOST and SUBDOMAIN_INSTALL.</strong> The value of SUBDOMAIN_INSTALL will be assumed to be your subdomain configuration setting.' ) . ' ' . $vhost_deprecated, E_USER_WARNING );\n\t\t} else {\n\t\t\t_deprecated_argument( 'define()', '3.0.0', $vhost_deprecated );\n\t\t}\n\t\treturn;\n\t}\n\n\tif ( defined( 'SUBDOMAIN_INSTALL' ) && defined( 'VHOST' ) ) {\n\t\t$subdomain_error = true;\n\t\tif ( SUBDOMAIN_INSTALL !== ( 'yes' === VHOST ) ) {\n\t\t\t$subdomain_error_warn = true;\n\t\t}\n\t} elseif ( defined( 'SUBDOMAIN_INSTALL' ) ) {\n\t\t$subdomain_error = false;\n\t\tdefine( 'VHOST', SUBDOMAIN_INSTALL ? 'yes' : 'no' );\n\t} elseif ( defined( 'VHOST' ) ) {\n\t\t$subdomain_error = true;\n\t\tdefine( 'SUBDOMAIN_INSTALL', 'yes' === VHOST );\n\t} else {\n\t\t$subdomain_error = false;\n\t\tdefine( 'SUBDOMAIN_INSTALL', false );\n\t\tdefine( 'VHOST', 'no' );\n\t}\n}\n", "num_lines": 170}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Sets up the default filters and actions for Multisite.\n *\n * If you need to remove a default hook, this file will give you the priority\n * for which to use to remove the hook.\n *\n * Not all of the Multisite default hooks are found in ms-default-filters.php\n *\n * @package WordPress\n * @subpackage Multisite\n * @see default-filters.php\n * @since 3.0.0\n */\n\nadd_action( 'init', 'ms_subdomain_constants' );\n\n// Functions.\nadd_action( 'update_option_blog_public', 'update_blog_public', 10, 2 );\nadd_filter( 'option_users_can_register', 'users_can_register_signup_filter' );\nadd_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' );\n\n// Users.\nadd_filter( 'wpmu_validate_user_signup', 'signup_nonce_check' );\nadd_action( 'init', 'maybe_add_existing_user_to_blog' );\nadd_action( 'wpmu_new_user', 'newuser_notify_siteadmin' );\nadd_action( 'wpmu_activate_user', 'add_new_user_to_blog', 10, 3 );\nadd_action( 'wpmu_activate_user', 'wpmu_welcome_user_notification', 10, 3 );\nadd_action( 'after_signup_user', 'wpmu_signup_user_notification', 10, 4 );\nadd_action( 'network_site_new_created_user', 'wp_send_new_user_notifications' );\nadd_action( 'network_site_users_created_user', 'wp_send_new_user_notifications' );\nadd_action( 'network_user_new_created_user', 'wp_send_new_user_notifications' );\nadd_filter( 'sanitize_user', 'strtolower' );\nadd_action( 'deleted_user', 'wp_delete_signup_on_user_delete', 10, 3 );\n\n// Roles.\nadd_action( 'switch_blog', 'wp_switch_roles_and_user', 1, 2 );\n\n// Blogs.\nadd_filter( 'wpmu_validate_blog_signup', 'signup_nonce_check' );\nadd_action( 'wpmu_activate_blog', 'wpmu_welcome_notification', 10, 5 );\nadd_action( 'after_signup_site', 'wpmu_signup_blog_notification', 10, 7 );\nadd_filter( 'wp_normalize_site_data', 'wp_normalize_site_data', 10, 1 );\nadd_action( 'wp_validate_site_data', 'wp_validate_site_data', 10, 3 );\nadd_action( 'wp_insert_site', 'wp_maybe_update_network_site_counts_on_update', 10, 1 );\nadd_action( 'wp_update_site', 'wp_maybe_update_network_site_counts_on_update', 10, 2 );\nadd_action( 'wp_delete_site', 'wp_maybe_update_network_site_counts_on_update', 10, 1 );\nadd_action( 'wp_insert_site', 'wp_maybe_transition_site_statuses_on_update', 10, 1 );\nadd_action( 'wp_update_site', 'wp_maybe_transition_site_statuses_on_update', 10, 2 );\nadd_action( 'wp_update_site', 'wp_maybe_clean_new_site_cache_on_update', 10, 2 );\nadd_action( 'wp_initialize_site', 'wp_initialize_site', 10, 2 );\nadd_action( 'wp_initialize_site', 'wpmu_log_new_registrations', 100, 2 );\nadd_action( 'wp_initialize_site', 'newblog_notify_siteadmin', 100, 1 );\nadd_action( 'wp_uninitialize_site', 'wp_uninitialize_site', 10, 1 );\nadd_action( 'update_blog_public', 'wp_update_blog_public_option_on_site_update', 1, 2 );\n\n// Site meta.\nadd_action( 'added_blog_meta', 'wp_cache_set_sites_last_changed' );\nadd_action( 'updated_blog_meta', 'wp_cache_set_sites_last_changed' );\nadd_action( 'deleted_blog_meta', 'wp_cache_set_sites_last_changed' );\nadd_filter( 'get_blog_metadata', 'wp_check_site_meta_support_prefilter' );\nadd_filter( 'add_blog_metadata', 'wp_check_site_meta_support_prefilter' );\nadd_filter( 'update_blog_metadata', 'wp_check_site_meta_support_prefilter' );\nadd_filter( 'delete_blog_metadata', 'wp_check_site_meta_support_prefilter' );\nadd_filter( 'get_blog_metadata_by_mid', 'wp_check_site_meta_support_prefilter' );\nadd_filter( 'update_blog_metadata_by_mid', 'wp_check_site_meta_support_prefilter' );\nadd_filter( 'delete_blog_metadata_by_mid', 'wp_check_site_meta_support_prefilter' );\nadd_filter( 'update_blog_metadata_cache', 'wp_check_site_meta_support_prefilter' );\n\n// Register nonce.\nadd_action( 'signup_hidden_fields', 'signup_nonce_fields' );\n\n// Template.\nadd_action( 'template_redirect', 'maybe_redirect_404' );\nadd_filter( 'allowed_redirect_hosts', 'redirect_this_site' );\n\n// Administration.\nadd_filter( 'term_id_filter', 'global_terms', 10, 2 );\nadd_action( 'delete_post', '_update_posts_count_on_delete' );\nadd_action( 'delete_post', '_update_blog_date_on_post_delete' );\nadd_action( 'transition_post_status', '_update_blog_date_on_post_publish', 10, 3 );\nadd_action( 'transition_post_status', '_update_posts_count_on_transition_post_status', 10, 3 );\n\n// Counts.\nadd_action( 'admin_init', 'wp_schedule_update_network_counts' );\nadd_action( 'update_network_counts', 'wp_update_network_counts', 10, 0 );\nforeach ( array( 'user_register', 'deleted_user', 'wpmu_new_user', 'make_spam_user', 'make_ham_user' ) as $action ) {\n\tadd_action( $action, 'wp_maybe_update_network_user_counts', 10, 0 );\n}\nforeach ( array( 'make_spam_blog', 'make_ham_blog', 'archive_blog', 'unarchive_blog', 'make_delete_blog', 'make_undelete_blog' ) as $action ) {\n\tadd_action( $action, 'wp_maybe_update_network_site_counts', 10, 0 );\n}\nunset( $action );\n\n// Files.\nadd_filter( 'wp_upload_bits', 'upload_is_file_too_big' );\nadd_filter( 'import_upload_size_limit', 'fix_import_form_size' );\nadd_filter( 'upload_mimes', 'check_upload_mimes' );\nadd_filter( 'upload_size_limit', 'upload_size_limit_filter' );\nadd_action( 'upload_ui_over_quota', 'multisite_over_quota_message' );\n\n// Mail.\nadd_action( 'phpmailer_init', 'fix_phpmailer_messageid' );\n\n// Disable somethings by default for multisite.\nadd_filter( 'enable_update_services_configuration', '__return_false' );\nif ( ! defined( 'POST_BY_EMAIL' ) || ! POST_BY_EMAIL ) { // Back compat constant.\n\tadd_filter( 'enable_post_by_email_configuration', '__return_false' );\n}\nif ( ! defined( 'EDIT_ANY_USER' ) || ! EDIT_ANY_USER ) { // Back compat constant.\n\tadd_filter( 'enable_edit_any_user_configuration', '__return_false' );\n}\nadd_filter( 'force_filtered_html_on_import', '__return_true' );\n\n// WP_HOME and WP_SITEURL should not have any effect in MS.\nremove_filter( 'option_siteurl', '_config_wp_siteurl' );\nremove_filter( 'option_home', '_config_wp_home' );\n\n// Some options changes should trigger site details refresh.\nadd_action( 'update_option_blogname', 'clean_site_details_cache', 10, 0 );\nadd_action( 'update_option_siteurl', 'clean_site_details_cache', 10, 0 );\nadd_action( 'update_option_post_count', 'clean_site_details_cache', 10, 0 );\nadd_action( 'update_option_home', 'clean_site_details_cache', 10, 0 );\n\n// If the network upgrade hasn't run yet, assume ms-files.php rewriting is used.\nadd_filter( 'default_site_option_ms_files_rewriting', '__return_true' );\n\n// Allow multisite domains for HTTP requests.\nadd_filter( 'http_request_host_is_external', 'ms_allowed_http_request_hosts', 20, 2 );\n", "num_lines": 130}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Deprecated functions from WordPress MU and the multisite feature. You shouldn't\n * use these functions and look for the alternatives instead. The functions will be\n * removed in a later version.\n *\n * @package WordPress\n * @subpackage Deprecated\n * @since 3.0.0\n */\n\n/*\n * Deprecated functions come here to die.\n */\n\n/**\n * Get the \"dashboard blog\", the blog where users without a blog edit their profile data.\n * Dashboard blog functionality was removed in WordPress 3.1, replaced by the user admin.\n *\n * @since MU (3.0.0)\n * @deprecated 3.1.0 Use get_site()\n * @see get_site()\n *\n * @return WP_Site Current site object.\n */\nfunction get_dashboard_blog() {\n    _deprecated_function( __FUNCTION__, '3.1.0', 'get_site()' );\n    if ( $blog = get_site_option( 'dashboard_blog' ) ) {\n\t    return get_site( $blog );\n    }\n\n    return get_site( get_network()->site_id );\n}\n\n/**\n * Generates a random password.\n *\n * @since MU (3.0.0)\n * @deprecated 3.0.0 Use wp_generate_password()\n * @see wp_generate_password()\n *\n * @param int $len Optional. The length of password to generate. Default 8.\n */\nfunction generate_random_password( $len = 8 ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'wp_generate_password()' );\n\treturn wp_generate_password( $len );\n}\n\n/**\n * Determine if user is a site admin.\n *\n * Plugins should use is_multisite() instead of checking if this function exists\n * to determine if multisite is enabled.\n *\n * This function must reside in a file included only if is_multisite() due to\n * legacy function_exists() checks to determine if multisite is enabled.\n *\n * @since MU (3.0.0)\n * @deprecated 3.0.0 Use is_super_admin()\n * @see is_super_admin()\n *\n * @param string $user_login Optional. Username for the user to check. Default empty.\n */\nfunction is_site_admin( $user_login = '' ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'is_super_admin()' );\n\n\tif ( empty( $user_login ) ) {\n\t\t$user_id = get_current_user_id();\n\t\tif ( !$user_id )\n\t\t\treturn false;\n\t} else {\n\t\t$user = get_user_by( 'login', $user_login );\n\t\tif ( ! $user->exists() )\n\t\t\treturn false;\n\t\t$user_id = $user->ID;\n\t}\n\n\treturn is_super_admin( $user_id );\n}\n\nif ( !function_exists( 'graceful_fail' ) ) :\n/**\n * Deprecated functionality to gracefully fail.\n *\n * @since MU (3.0.0)\n * @deprecated 3.0.0 Use wp_die()\n * @see wp_die()\n */\nfunction graceful_fail( $message ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'wp_die()' );\n\t$message = apply_filters( 'graceful_fail', $message );\n\t$message_template = apply_filters( 'graceful_fail_template',\n'<!DOCTYPE html>\n<html><head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n<title>Error!</title>\n<style type=\"text/css\">\nimg {\n\tborder: 0;\n}\nbody {\nline-height: 1.6em; font-family: Georgia, serif; width: 390px; margin: auto;\ntext-align: center;\n}\n.message {\n\tfont-size: 22px;\n\twidth: 350px;\n\tmargin: auto;\n}\n</style>\n</head>\n<body>\n<p class=\"message\">%s</p>\n</body>\n</html>' );\n\tdie( sprintf( $message_template, $message ) );\n}\nendif;\n\n/**\n * Deprecated functionality to retrieve user information.\n *\n * @since MU (3.0.0)\n * @deprecated 3.0.0 Use get_user_by()\n * @see get_user_by()\n *\n * @param string $username Username.\n */\nfunction get_user_details( $username ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'get_user_by()' );\n\treturn get_user_by('login', $username);\n}\n\n/**\n * Deprecated functionality to clear the global post cache.\n *\n * @since MU (3.0.0)\n * @deprecated 3.0.0 Use clean_post_cache()\n * @see clean_post_cache()\n *\n * @param int $post_id Post ID.\n */\nfunction clear_global_post_cache( $post_id ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'clean_post_cache()' );\n}\n\n/**\n * Deprecated functionality to determin if the current site is the main site.\n *\n * @since MU (3.0.0)\n * @deprecated 3.0.0 Use is_main_site()\n * @see is_main_site()\n */\nfunction is_main_blog() {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'is_main_site()' );\n\treturn is_main_site();\n}\n\n/**\n * Deprecated functionality to validate an email address.\n *\n * @since MU (3.0.0)\n * @deprecated 3.0.0 Use is_email()\n * @see is_email()\n *\n * @param string $email        Email address to verify.\n * @param bool   $check_domain Deprecated.\n * @return string|false Valid email address on success, false on failure.\n */\nfunction validate_email( $email, $check_domain = true) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'is_email()' );\n\treturn is_email( $email, $check_domain );\n}\n\n/**\n * Deprecated functionality to retrieve a list of all sites.\n *\n * @since MU (3.0.0)\n * @deprecated 3.0.0 Use wp_get_sites()\n * @see wp_get_sites()\n *\n * @param int    $start      Optional. Offset for retrieving the blog list. Default 0.\n * @param int    $num        Optional. Number of blogs to list. Default 10.\n * @param string $deprecated Unused.\n */\nfunction get_blog_list( $start = 0, $num = 10, $deprecated = '' ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'wp_get_sites()' );\n\n\tglobal $wpdb;\n\t$blogs = $wpdb->get_results( $wpdb->prepare( \"SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC\", get_current_network_id() ), ARRAY_A );\n\n\t$blog_list = array();\n\tforeach ( (array) $blogs as $details ) {\n\t\t$blog_list[ $details['blog_id'] ] = $details;\n\t\t$blog_list[ $details['blog_id'] ]['postcount'] = $wpdb->get_var( \"SELECT COUNT(ID) FROM \" . $wpdb->get_blog_prefix( $details['blog_id'] ). \"posts WHERE post_status='publish' AND post_type='post'\" );\n\t}\n\n\tif ( ! $blog_list ) {\n\t\treturn array();\n\t}\n\n\tif ( 'all' === $num ) {\n\t\treturn array_slice( $blog_list, $start, count( $blog_list ) );\n\t} else {\n\t\treturn array_slice( $blog_list, $start, $num );\n\t}\n}\n\n/**\n * Deprecated functionality to retrieve a list of the most active sites.\n *\n * @since MU (3.0.0)\n * @deprecated 3.0.0\n *\n * @param int  $num     Optional. Number of activate blogs to retrieve. Default 10.\n * @param bool $display Optional. Whether or not to display the most active blogs list. Default true.\n * @return array List of \"most active\" sites.\n */\nfunction get_most_active_blogs( $num = 10, $display = true ) {\n\t_deprecated_function( __FUNCTION__, '3.0.0' );\n\n\t$blogs = get_blog_list( 0, 'all', false ); // $blog_id -> $details\n\tif ( is_array( $blogs ) ) {\n\t\treset( $blogs );\n\t\t$most_active = array();\n\t\t$blog_list = array();\n\t\tforeach ( (array) $blogs as $key => $details ) {\n\t\t\t$most_active[ $details['blog_id'] ] = $details['postcount'];\n\t\t\t$blog_list[ $details['blog_id'] ] = $details; // array_slice() removes keys!\n\t\t}\n\t\tarsort( $most_active );\n\t\treset( $most_active );\n\t\t$t = array();\n\t\tforeach ( (array) $most_active as $key => $details ) {\n\t\t\t$t[ $key ] = $blog_list[ $key ];\n\t\t}\n\t\tunset( $most_active );\n\t\t$most_active = $t;\n\t}\n\n\tif ( $display ) {\n\t\tif ( is_array( $most_active ) ) {\n\t\t\treset( $most_active );\n\t\t\tforeach ( (array) $most_active as $key => $details ) {\n\t\t\t\t$url = esc_url('http://' . $details['domain'] . $details['path']);\n\t\t\t\techo '<li>' . $details['postcount'] . \" <a href='$url'>$url</a></li>\";\n\t\t\t}\n\t\t}\n\t}\n\treturn array_slice( $most_active, 0, $num );\n}\n\n/**\n * Redirect a user based on $_GET or $_POST arguments.\n *\n * The function looks for redirect arguments in the following order:\n * 1) $_GET['ref']\n * 2) $_POST['ref']\n * 3) $_SERVER['HTTP_REFERER']\n * 4) $_GET['redirect']\n * 5) $_POST['redirect']\n * 6) $url\n *\n * @since MU (3.0.0)\n * @deprecated 3.3.0 Use wp_redirect()\n * @see wp_redirect()\n *\n * @param string $url Optional. Redirect URL. Default empty.\n */\nfunction wpmu_admin_do_redirect( $url = '' ) {\n\t_deprecated_function( __FUNCTION__, '3.3.0', 'wp_redirect()' );\n\n\t$ref = '';\n\tif ( isset( $_GET['ref'] ) && isset( $_POST['ref'] ) && $_GET['ref'] !== $_POST['ref'] ) {\n\t\twp_die( __( 'A variable mismatch has been detected.' ), __( 'Sorry, you are not allowed to view this item.' ), 400 );\n\t} elseif ( isset( $_POST['ref'] ) ) {\n\t\t$ref = $_POST['ref'];\n\t} elseif ( isset( $_GET['ref'] ) ) {\n\t\t$ref = $_GET['ref'];\n\t}\n\n\tif ( $ref ) {\n\t\t$ref = wpmu_admin_redirect_add_updated_param( $ref );\n\t\twp_redirect( $ref );\n\t\texit;\n\t}\n\tif ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {\n\t\twp_redirect( $_SERVER['HTTP_REFERER'] );\n\t\texit;\n\t}\n\n\t$url = wpmu_admin_redirect_add_updated_param( $url );\n\tif ( isset( $_GET['redirect'] ) && isset( $_POST['redirect'] ) && $_GET['redirect'] !== $_POST['redirect'] ) {\n\t\twp_die( __( 'A variable mismatch has been detected.' ), __( 'Sorry, you are not allowed to view this item.' ), 400 );\n\t} elseif ( isset( $_GET['redirect'] ) ) {\n\t\tif ( 's_' === substr( $_GET['redirect'], 0, 2 ) )\n\t\t\t$url .= '&action=blogs&s='. esc_html( substr( $_GET['redirect'], 2 ) );\n\t} elseif ( isset( $_POST['redirect'] ) ) {\n\t\t$url = wpmu_admin_redirect_add_updated_param( $_POST['redirect'] );\n\t}\n\twp_redirect( $url );\n\texit;\n}\n\n/**\n * Adds an 'updated=true' argument to a URL.\n *\n * @since MU (3.0.0)\n * @deprecated 3.3.0 Use add_query_arg()\n * @see add_query_arg()\n *\n * @param string $url Optional. Redirect URL. Default empty.\n * @return string\n */\nfunction wpmu_admin_redirect_add_updated_param( $url = '' ) {\n\t_deprecated_function( __FUNCTION__, '3.3.0', 'add_query_arg()' );\n\n\tif ( strpos( $url, 'updated=true' ) === false ) {\n\t\tif ( strpos( $url, '?' ) === false )\n\t\t\treturn $url . '?updated=true';\n\t\telse\n\t\t\treturn $url . '&updated=true';\n\t}\n\treturn $url;\n}\n\n/**\n * Get a numeric user ID from either an email address or a login.\n *\n * A numeric string is considered to be an existing user ID\n * and is simply returned as such.\n *\n * @since MU (3.0.0)\n * @deprecated 3.6.0 Use get_user_by()\n * @see get_user_by()\n *\n * @param string $string Either an email address or a login.\n * @return int\n */\nfunction get_user_id_from_string( $string ) {\n\t_deprecated_function( __FUNCTION__, '3.6.0', 'get_user_by()' );\n\n\tif ( is_email( $string ) )\n\t\t$user = get_user_by( 'email', $string );\n\telseif ( is_numeric( $string ) )\n\t\treturn $string;\n\telse\n\t\t$user = get_user_by( 'login', $string );\n\n\tif ( $user )\n\t\treturn $user->ID;\n\treturn 0;\n}\n\n/**\n * Get a full blog URL, given a domain and a path.\n *\n * @since MU (3.0.0)\n * @deprecated 3.7.0\n *\n * @param string $domain\n * @param string $path\n * @return string\n */\nfunction get_blogaddress_by_domain( $domain, $path ) {\n\t_deprecated_function( __FUNCTION__, '3.7.0' );\n\n\tif ( is_subdomain_install() ) {\n\t\t$url = \"http://\" . $domain.$path;\n\t} else {\n\t\tif ( $domain != $_SERVER['HTTP_HOST'] ) {\n\t\t\t$blogname = substr( $domain, 0, strpos( $domain, '.' ) );\n\t\t\t$url = 'http://' . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path;\n\t\t\t// We're not installing the main blog.\n\t\t\tif ( 'www.' !== $blogname )\n\t\t\t\t$url .= $blogname . '/';\n\t\t} else { // Main blog.\n\t\t\t$url = 'http://' . $domain . $path;\n\t\t}\n\t}\n\treturn esc_url_raw( $url );\n}\n\n/**\n * Create an empty blog.\n *\n * @since MU (3.0.0)\n * @deprecated 4.4.0\n *\n * @param string $domain       The new blog's domain.\n * @param string $path         The new blog's path.\n * @param string $weblog_title The new blog's title.\n * @param int    $site_id      Optional. Defaults to 1.\n * @return string|int The ID of the newly created blog\n */\nfunction create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) {\n\t_deprecated_function( __FUNCTION__, '4.4.0' );\n\n\tif ( empty($path) )\n\t\t$path = '/';\n\n\t// Check if the domain has been used already. We should return an error message.\n\tif ( domain_exists($domain, $path, $site_id) )\n\t\treturn __( '<strong>Error</strong>: Site URL you&#8217;ve entered is already taken.' );\n\n\t/*\n\t * Need to back up wpdb table names, and create a new wp_blogs entry for new blog.\n\t * Need to get blog_id from wp_blogs, and create new table names.\n\t * Must restore table names at the end of function.\n\t */\n\n\tif ( ! $blog_id = insert_blog($domain, $path, $site_id) )\n\t\treturn __( '<strong>Error</strong>: There was a problem creating site entry.' );\n\n\tswitch_to_blog($blog_id);\n\tinstall_blog($blog_id);\n\trestore_current_blog();\n\n\treturn $blog_id;\n}\n\n/**\n * Get the admin for a domain/path combination.\n *\n * @since MU (3.0.0)\n * @deprecated 4.4.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $domain Optional. Network domain.\n * @param string $path   Optional. Network path.\n * @return array|false The network admins.\n */\nfunction get_admin_users_for_domain( $domain = '', $path = '' ) {\n\t_deprecated_function( __FUNCTION__, '4.4.0' );\n\n\tglobal $wpdb;\n\n\tif ( ! $domain ) {\n\t\t$network_id = get_current_network_id();\n\t} else {\n\t\t$_networks  = get_networks( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'number' => 1,\n\t\t\t'domain' => $domain,\n\t\t\t'path'   => $path,\n\t\t) );\n\t\t$network_id = ! empty( $_networks ) ? array_shift( $_networks ) : 0;\n\t}\n\n\tif ( $network_id )\n\t\treturn $wpdb->get_results( $wpdb->prepare( \"SELECT u.ID, u.user_login, u.user_pass FROM $wpdb->users AS u, $wpdb->sitemeta AS sm WHERE sm.meta_key = 'admin_user_id' AND u.ID = sm.meta_value AND sm.site_id = %d\", $network_id ), ARRAY_A );\n\n\treturn false;\n}\n\n/**\n * Return an array of sites for a network or networks.\n *\n * @since 3.7.0\n * @deprecated 4.6.0 Use get_sites()\n * @see get_sites()\n *\n * @param array $args {\n *     Array of default arguments. Optional.\n *\n *     @type int|array $network_id A network ID or array of network IDs. Set to null to retrieve sites\n *                                 from all networks. Defaults to current network ID.\n *     @type int       $public     Retrieve public or non-public sites. Default null, for any.\n *     @type int       $archived   Retrieve archived or non-archived sites. Default null, for any.\n *     @type int       $mature     Retrieve mature or non-mature sites. Default null, for any.\n *     @type int       $spam       Retrieve spam or non-spam sites. Default null, for any.\n *     @type int       $deleted    Retrieve deleted or non-deleted sites. Default null, for any.\n *     @type int       $limit      Number of sites to limit the query to. Default 100.\n *     @type int       $offset     Exclude the first x sites. Used in combination with the $limit parameter. Default 0.\n * }\n * @return array[] An empty array if the installation is considered \"large\" via wp_is_large_network(). Otherwise,\n *                 an associative array of WP_Site data as arrays.\n */\nfunction wp_get_sites( $args = array() ) {\n\t_deprecated_function( __FUNCTION__, '4.6.0', 'get_sites()' );\n\n\tif ( wp_is_large_network() )\n\t\treturn array();\n\n\t$defaults = array(\n\t\t'network_id' => get_current_network_id(),\n\t\t'public'     => null,\n\t\t'archived'   => null,\n\t\t'mature'     => null,\n\t\t'spam'       => null,\n\t\t'deleted'    => null,\n\t\t'limit'      => 100,\n\t\t'offset'     => 0,\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\t// Backward compatibility.\n\tif( is_array( $args['network_id'] ) ){\n\t\t$args['network__in'] = $args['network_id'];\n\t\t$args['network_id'] = null;\n\t}\n\n\tif( is_numeric( $args['limit'] ) ){\n\t\t$args['number'] = $args['limit'];\n\t\t$args['limit'] = null;\n\t} elseif ( ! $args['limit'] ) {\n\t\t$args['number'] = 0;\n\t\t$args['limit'] = null;\n\t}\n\n\t// Make sure count is disabled.\n\t$args['count'] = false;\n\n\t$_sites  = get_sites( $args );\n\n\t$results = array();\n\n\tforeach ( $_sites as $_site ) {\n\t\t$_site = get_site( $_site );\n\t\t$results[] = $_site->to_array();\n\t}\n\n\treturn $results;\n}\n\n/**\n * Check whether a usermeta key has to do with the current blog.\n *\n * @since MU (3.0.0)\n * @deprecated 4.9.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $key\n * @param int    $user_id Optional. Defaults to current user.\n * @param int    $blog_id Optional. Defaults to current blog.\n * @return bool\n */\nfunction is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {\n\tglobal $wpdb;\n\n\t_deprecated_function( __FUNCTION__, '4.9.0' );\n\n\t$current_user = wp_get_current_user();\n\tif ( $blog_id == 0 ) {\n\t\t$blog_id = get_current_blog_id();\n\t}\n\t$local_key = $wpdb->get_blog_prefix( $blog_id ) . $key;\n\n\treturn isset( $current_user->$local_key );\n}\n\n/**\n * Store basic site info in the blogs table.\n *\n * This function creates a row in the wp_blogs table and returns\n * the new blog's ID. It is the first step in creating a new blog.\n *\n * @since MU (3.0.0)\n * @deprecated 5.1.0 Use `wp_insert_site()`\n * @see wp_insert_site()\n *\n * @param string $domain  The domain of the new site.\n * @param string $path    The path of the new site.\n * @param int    $site_id Unless you're running a multi-network install, be sure to set this value to 1.\n * @return int|false The ID of the new row\n */\nfunction insert_blog($domain, $path, $site_id) {\n\t_deprecated_function( __FUNCTION__, '5.1.0', 'wp_insert_site()' );\n\n\t$data = array(\n\t\t'domain'  => $domain,\n\t\t'path'    => $path,\n\t\t'site_id' => $site_id,\n\t);\n\n\t$site_id = wp_insert_site( $data );\n\tif ( is_wp_error( $site_id ) ) {\n\t\treturn false;\n\t}\n\n\tclean_blog_cache( $site_id );\n\n\treturn $site_id;\n}\n\n/**\n * Install an empty blog.\n *\n * Creates the new blog tables and options. If calling this function\n * directly, be sure to use switch_to_blog() first, so that $wpdb\n * points to the new blog.\n *\n * @since MU (3.0.0)\n * @deprecated 5.1.0\n *\n * @global wpdb     $wpdb     WordPress database abstraction object.\n * @global WP_Roles $wp_roles WordPress role management object.\n *\n * @param int    $blog_id    The value returned by wp_insert_site().\n * @param string $blog_title The title of the new site.\n */\nfunction install_blog( $blog_id, $blog_title = '' ) {\n\tglobal $wpdb, $wp_roles;\n\n\t_deprecated_function( __FUNCTION__, '5.1.0' );\n\n\t// Cast for security.\n\t$blog_id = (int) $blog_id;\n\n\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\n\t$suppress = $wpdb->suppress_errors();\n\tif ( $wpdb->get_results( \"DESCRIBE {$wpdb->posts}\" ) ) {\n\t\tdie( '<h1>' . __( 'Already Installed' ) . '</h1><p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p></body></html>' );\n\t}\n\t$wpdb->suppress_errors( $suppress );\n\n\t$url = get_blogaddress_by_id( $blog_id );\n\n\t// Set everything up.\n\tmake_db_current_silent( 'blog' );\n\tpopulate_options();\n\tpopulate_roles();\n\n\t// populate_roles() clears previous role definitions so we start over.\n\t$wp_roles = new WP_Roles();\n\n\t$siteurl = $home = untrailingslashit( $url );\n\n\tif ( ! is_subdomain_install() ) {\n\n\t\tif ( 'https' === parse_url( get_site_option( 'siteurl' ), PHP_URL_SCHEME ) ) {\n\t\t\t$siteurl = set_url_scheme( $siteurl, 'https' );\n\t\t}\n\t\tif ( 'https' === parse_url( get_home_url( get_network()->site_id ), PHP_URL_SCHEME ) ) {\n\t\t\t$home = set_url_scheme( $home, 'https' );\n\t\t}\n\t}\n\n\tupdate_option( 'siteurl', $siteurl );\n\tupdate_option( 'home', $home );\n\n\tif ( get_site_option( 'ms_files_rewriting' ) ) {\n\t\tupdate_option( 'upload_path', UPLOADBLOGSDIR . \"/$blog_id/files\" );\n\t} else {\n\t\tupdate_option( 'upload_path', get_blog_option( get_network()->site_id, 'upload_path' ) );\n\t}\n\n\tupdate_option( 'blogname', wp_unslash( $blog_title ) );\n\tupdate_option( 'admin_email', '' );\n\n\t// Remove all permissions.\n\t$table_prefix = $wpdb->get_blog_prefix();\n\tdelete_metadata( 'user', 0, $table_prefix . 'user_level', null, true );   // Delete all.\n\tdelete_metadata( 'user', 0, $table_prefix . 'capabilities', null, true ); // Delete all.\n}\n\n/**\n * Set blog defaults.\n *\n * This function creates a row in the wp_blogs table.\n *\n * @since MU (3.0.0)\n * @deprecated MU\n * @deprecated Use wp_install_defaults()\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int $blog_id Ignored in this function.\n * @param int $user_id\n */\nfunction install_blog_defaults( $blog_id, $user_id ) {\n\tglobal $wpdb;\n\n\t_deprecated_function( __FUNCTION__, 'MU' );\n\n\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\n\t$suppress = $wpdb->suppress_errors();\n\n\twp_install_defaults( $user_id );\n\n\t$wpdb->suppress_errors( $suppress );\n}\n\n/**\n * Update the status of a user in the database.\n *\n * Previously used in core to mark a user as spam or \"ham\" (not spam) in Multisite.\n *\n * @since 3.0.0\n * @deprecated 5.3.0 Use wp_update_user()\n * @see wp_update_user()\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int    $id         The user ID.\n * @param string $pref       The column in the wp_users table to update the user's status\n *                           in (presumably user_status, spam, or deleted).\n * @param int    $value      The new status for the user.\n * @param null   $deprecated Deprecated as of 3.0.2 and should not be used.\n * @return int   The initially passed $value.\n */\nfunction update_user_status( $id, $pref, $value, $deprecated = null ) {\n\tglobal $wpdb;\n\n\t_deprecated_function( __FUNCTION__, '5.3.0', 'wp_update_user()' );\n\n\tif ( null !== $deprecated ) {\n\t\t_deprecated_argument( __FUNCTION__, '3.0.2' );\n\t}\n\n\t$wpdb->update( $wpdb->users, array( sanitize_key( $pref ) => $value ), array( 'ID' => $id ) );\n\n\t$user = new WP_User( $id );\n\tclean_user_cache( $user );\n\n\tif ( 'spam' === $pref ) {\n\t\tif ( $value == 1 ) {\n\t\t\t/** This filter is documented in wp-includes/user.php */\n\t\t\tdo_action( 'make_spam_user', $id );\n\t\t} else {\n\t\t\t/** This filter is documented in wp-includes/user.php */\n\t\t\tdo_action( 'make_ham_user', $id );\n\t\t}\n\t}\n\n\treturn $value;\n}\n", "num_lines": 733}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite upload handler.\n *\n * @since 3.0.0\n *\n * @package WordPress\n * @subpackage Multisite\n */\n\ndefine( 'SHORTINIT', true );\nrequire_once dirname( __DIR__ ) . '/wp-load.php';\n\nif ( ! is_multisite() ) {\n\tdie( 'Multisite support not enabled' );\n}\n\nms_file_constants();\n\nerror_reporting( 0 );\n\nif ( '1' == $current_blog->archived || '1' == $current_blog->spam || '1' == $current_blog->deleted ) {\n\tstatus_header( 404 );\n\tdie( '404 &#8212; File not found.' );\n}\n\n$file = rtrim( BLOGUPLOADDIR, '/' ) . '/' . str_replace( '..', '', $_GET['file'] );\nif ( ! is_file( $file ) ) {\n\tstatus_header( 404 );\n\tdie( '404 &#8212; File not found.' );\n}\n\n$mime = wp_check_filetype( $file );\nif ( false === $mime['type'] && function_exists( 'mime_content_type' ) ) {\n\t$mime['type'] = mime_content_type( $file );\n}\n\nif ( $mime['type'] ) {\n\t$mimetype = $mime['type'];\n} else {\n\t$mimetype = 'image/' . substr( $file, strrpos( $file, '.' ) + 1 );\n}\n\nheader( 'Content-Type: ' . $mimetype ); // Always send this.\nif ( false === strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) ) {\n\theader( 'Content-Length: ' . filesize( $file ) );\n}\n\n// Optional support for X-Sendfile and X-Accel-Redirect.\nif ( WPMU_ACCEL_REDIRECT ) {\n\theader( 'X-Accel-Redirect: ' . str_replace( WP_CONTENT_DIR, '', $file ) );\n\texit;\n} elseif ( WPMU_SENDFILE ) {\n\theader( 'X-Sendfile: ' . $file );\n\texit;\n}\n\n$last_modified = gmdate( 'D, d M Y H:i:s', filemtime( $file ) );\n$etag          = '\"' . md5( $last_modified ) . '\"';\nheader( \"Last-Modified: $last_modified GMT\" );\nheader( 'ETag: ' . $etag );\nheader( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + 100000000 ) . ' GMT' );\n\n// Support for conditional GET - use stripslashes() to avoid formatting.php dependency.\n$client_etag = isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ? stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) : false;\n\nif ( ! isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) {\n\t$_SERVER['HTTP_IF_MODIFIED_SINCE'] = false;\n}\n\n$client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE'] );\n// If string is empty, return 0. If not, attempt to parse into a timestamp.\n$client_modified_timestamp = $client_last_modified ? strtotime( $client_last_modified ) : 0;\n\n// Make a timestamp for our most recent modification...\n$modified_timestamp = strtotime( $last_modified );\n\nif ( ( $client_last_modified && $client_etag )\n\t? ( ( $client_modified_timestamp >= $modified_timestamp ) && ( $client_etag == $etag ) )\n\t: ( ( $client_modified_timestamp >= $modified_timestamp ) || ( $client_etag == $etag ) )\n\t) {\n\tstatus_header( 304 );\n\texit;\n}\n\n// If we made it this far, just serve the file.\nreadfile( $file );\nflush();\n", "num_lines": 89}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Multisite WordPress API\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\n/**\n * Gets the network's site and user counts.\n *\n * @since MU (3.0.0)\n *\n * @return int[] {\n *     Site and user count for the network.\n *\n *     @type int $blogs Number of sites on the network.\n *     @type int $users Number of users on the network.\n * }\n */\nfunction get_sitestats() {\n\t$stats = array(\n\t\t'blogs' => get_blog_count(),\n\t\t'users' => get_user_count(),\n\t);\n\n\treturn $stats;\n}\n\n/**\n * Get one of a user's active blogs\n *\n * Returns the user's primary blog, if they have one and\n * it is active. If it's inactive, function returns another\n * active blog of the user. If none are found, the user\n * is added as a Subscriber to the Dashboard Blog and that blog\n * is returned.\n *\n * @since MU (3.0.0)\n *\n * @param int $user_id The unique ID of the user\n * @return WP_Site|void The blog object\n */\nfunction get_active_blog_for_user( $user_id ) {\n\t$blogs = get_blogs_of_user( $user_id );\n\tif ( empty( $blogs ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! is_multisite() ) {\n\t\treturn $blogs[ get_current_blog_id() ];\n\t}\n\n\t$primary_blog = get_user_meta( $user_id, 'primary_blog', true );\n\t$first_blog   = current( $blogs );\n\tif ( false !== $primary_blog ) {\n\t\tif ( ! isset( $blogs[ $primary_blog ] ) ) {\n\t\t\tupdate_user_meta( $user_id, 'primary_blog', $first_blog->userblog_id );\n\t\t\t$primary = get_site( $first_blog->userblog_id );\n\t\t} else {\n\t\t\t$primary = get_site( $primary_blog );\n\t\t}\n\t} else {\n\t\t// TODO: Review this call to add_user_to_blog too - to get here the user must have a role on this blog?\n\t\t$result = add_user_to_blog( $first_blog->userblog_id, $user_id, 'subscriber' );\n\n\t\tif ( ! is_wp_error( $result ) ) {\n\t\t\tupdate_user_meta( $user_id, 'primary_blog', $first_blog->userblog_id );\n\t\t\t$primary = $first_blog;\n\t\t}\n\t}\n\n\tif ( ( ! is_object( $primary ) ) || ( 1 == $primary->archived || 1 == $primary->spam || 1 == $primary->deleted ) ) {\n\t\t$blogs = get_blogs_of_user( $user_id, true ); // If a user's primary blog is shut down, check their other blogs.\n\t\t$ret   = false;\n\t\tif ( is_array( $blogs ) && count( $blogs ) > 0 ) {\n\t\t\tforeach ( (array) $blogs as $blog_id => $blog ) {\n\t\t\t\tif ( get_current_network_id() != $blog->site_id ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$details = get_site( $blog_id );\n\t\t\t\tif ( is_object( $details ) && 0 == $details->archived && 0 == $details->spam && 0 == $details->deleted ) {\n\t\t\t\t\t$ret = $details;\n\t\t\t\t\tif ( get_user_meta( $user_id, 'primary_blog', true ) != $blog_id ) {\n\t\t\t\t\t\tupdate_user_meta( $user_id, 'primary_blog', $blog_id );\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! get_user_meta( $user_id, 'source_domain', true ) ) {\n\t\t\t\t\t\tupdate_user_meta( $user_id, 'source_domain', $details->domain );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t\treturn $ret;\n\t} else {\n\t\treturn $primary;\n\t}\n}\n\n/**\n * The number of active users in your installation.\n *\n * The count is cached and updated twice daily. This is not a live count.\n *\n * @since MU (3.0.0)\n * @since 4.8.0 The `$network_id` parameter has been added.\n *\n * @param int|null $network_id ID of the network. Default is the current network.\n * @return int Number of active users on the network.\n */\nfunction get_user_count( $network_id = null ) {\n\treturn get_network_option( $network_id, 'user_count' );\n}\n\n/**\n * The number of active sites on your installation.\n *\n * The count is cached and updated twice daily. This is not a live count.\n *\n * @since MU (3.0.0)\n * @since 3.7.0 The `$network_id` parameter has been deprecated.\n * @since 4.8.0 The `$network_id` parameter is now being used.\n *\n * @param int|null $network_id ID of the network. Default is the current network.\n * @return int Number of active sites on the network.\n */\nfunction get_blog_count( $network_id = null ) {\n\treturn get_network_option( $network_id, 'blog_count' );\n}\n\n/**\n * Gets a blog post from any site on the network.\n *\n * This function is similar to get_post(), except that it can retrieve a post\n * from any site on the network, not just the current site.\n *\n * @since MU (3.0.0)\n *\n * @param int $blog_id ID of the blog.\n * @param int $post_id ID of the post being looked for.\n * @return WP_Post|null WP_Post object on success, null on failure\n */\nfunction get_blog_post( $blog_id, $post_id ) {\n\tswitch_to_blog( $blog_id );\n\t$post = get_post( $post_id );\n\trestore_current_blog();\n\n\treturn $post;\n}\n\n/**\n * Adds a user to a blog, along with specifying the user's role.\n *\n * Use the {@see 'add_user_to_blog'} action to fire an event when users are added to a blog.\n *\n * @since MU (3.0.0)\n *\n * @param int    $blog_id ID of the blog the user is being added to.\n * @param int    $user_id ID of the user being added.\n * @param string $role    The role you want the user to have.\n * @return true|WP_Error True on success or a WP_Error object if the user doesn't exist\n *                       or could not be added.\n */\nfunction add_user_to_blog( $blog_id, $user_id, $role ) {\n\tswitch_to_blog( $blog_id );\n\n\t$user = get_userdata( $user_id );\n\n\tif ( ! $user ) {\n\t\trestore_current_blog();\n\t\treturn new WP_Error( 'user_does_not_exist', __( 'The requested user does not exist.' ) );\n\t}\n\n\t/**\n\t * Filters whether a user should be added to a site.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param true|WP_Error $retval  True if the user should be added to the site, error\n\t *                               object otherwise.\n\t * @param int           $user_id User ID.\n\t * @param string        $role    User role.\n\t * @param int           $blog_id Site ID.\n\t */\n\t$can_add_user = apply_filters( 'can_add_user_to_blog', true, $user_id, $role, $blog_id );\n\n\tif ( true !== $can_add_user ) {\n\t\trestore_current_blog();\n\n\t\tif ( is_wp_error( $can_add_user ) ) {\n\t\t\treturn $can_add_user;\n\t\t}\n\n\t\treturn new WP_Error( 'user_cannot_be_added', __( 'User cannot be added to this site.' ) );\n\t}\n\n\tif ( ! get_user_meta( $user_id, 'primary_blog', true ) ) {\n\t\tupdate_user_meta( $user_id, 'primary_blog', $blog_id );\n\t\t$site = get_site( $blog_id );\n\t\tupdate_user_meta( $user_id, 'source_domain', $site->domain );\n\t}\n\n\t$user->set_role( $role );\n\n\t/**\n\t * Fires immediately after a user is added to a site.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param int    $user_id User ID.\n\t * @param string $role    User role.\n\t * @param int    $blog_id Blog ID.\n\t */\n\tdo_action( 'add_user_to_blog', $user_id, $role, $blog_id );\n\n\tclean_user_cache( $user_id );\n\twp_cache_delete( $blog_id . '_user_count', 'blog-details' );\n\n\trestore_current_blog();\n\n\treturn true;\n}\n\n/**\n * Remove a user from a blog.\n *\n * Use the {@see 'remove_user_from_blog'} action to fire an event when\n * users are removed from a blog.\n *\n * Accepts an optional `$reassign` parameter, if you want to\n * reassign the user's blog posts to another user upon removal.\n *\n * @since MU (3.0.0)\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int $user_id  ID of the user being removed.\n * @param int $blog_id  Optional. ID of the blog the user is being removed from. Default 0.\n * @param int $reassign Optional. ID of the user to whom to reassign posts. Default 0.\n * @return true|WP_Error True on success or a WP_Error object if the user doesn't exist.\n */\nfunction remove_user_from_blog( $user_id, $blog_id = 0, $reassign = 0 ) {\n\tglobal $wpdb;\n\n\tswitch_to_blog( $blog_id );\n\t$user_id = (int) $user_id;\n\n\t/**\n\t * Fires before a user is removed from a site.\n\t *\n\t * @since MU (3.0.0)\n\t * @since 5.4.0 Added the `$reassign` parameter.\n\t *\n\t * @param int $user_id  ID of the user being removed.\n\t * @param int $blog_id  ID of the blog the user is being removed from.\n\t * @param int $reassign ID of the user to whom to reassign posts.\n\t */\n\tdo_action( 'remove_user_from_blog', $user_id, $blog_id, $reassign );\n\n\t// If being removed from the primary blog, set a new primary\n\t// if the user is assigned to multiple blogs.\n\t$primary_blog = get_user_meta( $user_id, 'primary_blog', true );\n\tif ( $primary_blog == $blog_id ) {\n\t\t$new_id     = '';\n\t\t$new_domain = '';\n\t\t$blogs      = get_blogs_of_user( $user_id );\n\t\tforeach ( (array) $blogs as $blog ) {\n\t\t\tif ( $blog->userblog_id == $blog_id ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$new_id     = $blog->userblog_id;\n\t\t\t$new_domain = $blog->domain;\n\t\t\tbreak;\n\t\t}\n\n\t\tupdate_user_meta( $user_id, 'primary_blog', $new_id );\n\t\tupdate_user_meta( $user_id, 'source_domain', $new_domain );\n\t}\n\n\t// wp_revoke_user( $user_id );\n\t$user = get_userdata( $user_id );\n\tif ( ! $user ) {\n\t\trestore_current_blog();\n\t\treturn new WP_Error( 'user_does_not_exist', __( 'That user does not exist.' ) );\n\t}\n\n\t$user->remove_all_caps();\n\n\t$blogs = get_blogs_of_user( $user_id );\n\tif ( count( $blogs ) == 0 ) {\n\t\tupdate_user_meta( $user_id, 'primary_blog', '' );\n\t\tupdate_user_meta( $user_id, 'source_domain', '' );\n\t}\n\n\tif ( $reassign ) {\n\t\t$reassign = (int) $reassign;\n\t\t$post_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE post_author = %d\", $user_id ) );\n\t\t$link_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT link_id FROM $wpdb->links WHERE link_owner = %d\", $user_id ) );\n\n\t\tif ( ! empty( $post_ids ) ) {\n\t\t\t$wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET post_author = %d WHERE post_author = %d\", $reassign, $user_id ) );\n\t\t\tarray_walk( $post_ids, 'clean_post_cache' );\n\t\t}\n\n\t\tif ( ! empty( $link_ids ) ) {\n\t\t\t$wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->links SET link_owner = %d WHERE link_owner = %d\", $reassign, $user_id ) );\n\t\t\tarray_walk( $link_ids, 'clean_bookmark_cache' );\n\t\t}\n\t}\n\n\trestore_current_blog();\n\n\treturn true;\n}\n\n/**\n * Get the permalink for a post on another blog.\n *\n * @since MU (3.0.0) 1.0\n *\n * @param int $blog_id ID of the source blog.\n * @param int $post_id ID of the desired post.\n * @return string The post's permalink\n */\nfunction get_blog_permalink( $blog_id, $post_id ) {\n\tswitch_to_blog( $blog_id );\n\t$link = get_permalink( $post_id );\n\trestore_current_blog();\n\n\treturn $link;\n}\n\n/**\n * Get a blog's numeric ID from its URL.\n *\n * On a subdirectory installation like example.com/blog1/,\n * $domain will be the root 'example.com' and $path the\n * subdirectory '/blog1/'. With subdomains like blog1.example.com,\n * $domain is 'blog1.example.com' and $path is '/'.\n *\n * @since MU (3.0.0)\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $domain\n * @param string $path   Optional. Not required for subdomain installations.\n * @return int 0 if no blog found, otherwise the ID of the matching blog\n */\nfunction get_blog_id_from_url( $domain, $path = '/' ) {\n\t$domain = strtolower( $domain );\n\t$path   = strtolower( $path );\n\t$id     = wp_cache_get( md5( $domain . $path ), 'blog-id-cache' );\n\n\tif ( -1 == $id ) { // Blog does not exist.\n\t\treturn 0;\n\t} elseif ( $id ) {\n\t\treturn (int) $id;\n\t}\n\n\t$args   = array(\n\t\t'domain'                 => $domain,\n\t\t'path'                   => $path,\n\t\t'fields'                 => 'ids',\n\t\t'number'                 => 1,\n\t\t'update_site_meta_cache' => false,\n\t);\n\t$result = get_sites( $args );\n\t$id     = array_shift( $result );\n\n\tif ( ! $id ) {\n\t\twp_cache_set( md5( $domain . $path ), -1, 'blog-id-cache' );\n\t\treturn 0;\n\t}\n\n\twp_cache_set( md5( $domain . $path ), $id, 'blog-id-cache' );\n\n\treturn $id;\n}\n\n//\n// Admin functions.\n//\n\n/**\n * Checks an email address against a list of banned domains.\n *\n * This function checks against the Banned Email Domains list\n * at wp-admin/network/settings.php. The check is only run on\n * self-registrations; user creation at wp-admin/network/users.php\n * bypasses this check.\n *\n * @since MU (3.0.0)\n *\n * @param string $user_email The email provided by the user at registration.\n * @return bool True when the email address is banned, false otherwise.\n */\nfunction is_email_address_unsafe( $user_email ) {\n\t$banned_names = get_site_option( 'banned_email_domains' );\n\tif ( $banned_names && ! is_array( $banned_names ) ) {\n\t\t$banned_names = explode( \"\\n\", $banned_names );\n\t}\n\n\t$is_email_address_unsafe = false;\n\n\tif ( $banned_names && is_array( $banned_names ) && false !== strpos( $user_email, '@', 1 ) ) {\n\t\t$banned_names     = array_map( 'strtolower', $banned_names );\n\t\t$normalized_email = strtolower( $user_email );\n\n\t\tlist( $email_local_part, $email_domain ) = explode( '@', $normalized_email );\n\n\t\tforeach ( $banned_names as $banned_domain ) {\n\t\t\tif ( ! $banned_domain ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $email_domain == $banned_domain ) {\n\t\t\t\t$is_email_address_unsafe = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$dotted_domain = \".$banned_domain\";\n\t\t\tif ( substr( $normalized_email, -strlen( $dotted_domain ) ) === $dotted_domain ) {\n\t\t\t\t$is_email_address_unsafe = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filters whether an email address is unsafe.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param bool   $is_email_address_unsafe Whether the email address is \"unsafe\". Default false.\n\t * @param string $user_email              User email address.\n\t */\n\treturn apply_filters( 'is_email_address_unsafe', $is_email_address_unsafe, $user_email );\n}\n\n/**\n * Sanitize and validate data required for a user sign-up.\n *\n * Verifies the validity and uniqueness of user names and user email addresses,\n * and checks email addresses against allowed and disallowed domains provided by\n * administrators.\n *\n * The {@see 'wpmu_validate_user_signup'} hook provides an easy way to modify the sign-up\n * process. The value $result, which is passed to the hook, contains both the user-provided\n * info and the error messages created by the function. {@see 'wpmu_validate_user_signup'}\n * allows you to process the data in any way you'd like, and unset the relevant errors if\n * necessary.\n *\n * @since MU (3.0.0)\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $user_name  The login name provided by the user.\n * @param string $user_email The email provided by the user.\n * @return array {\n *     The array of user name, email, and the error messages.\n *\n *     @type string   $user_name     Sanitized and unique username.\n *     @type string   $orig_username Original username.\n *     @type string   $user_email    User email address.\n *     @type WP_Error $errors        WP_Error object containing any errors found.\n * }\n */\nfunction wpmu_validate_user_signup( $user_name, $user_email ) {\n\tglobal $wpdb;\n\n\t$errors = new WP_Error();\n\n\t$orig_username = $user_name;\n\t$user_name     = preg_replace( '/\\s+/', '', sanitize_user( $user_name, true ) );\n\n\tif ( $user_name != $orig_username || preg_match( '/[^a-z0-9]/', $user_name ) ) {\n\t\t$errors->add( 'user_name', __( 'Usernames can only contain lowercase letters (a-z) and numbers.' ) );\n\t\t$user_name = $orig_username;\n\t}\n\n\t$user_email = sanitize_email( $user_email );\n\n\tif ( empty( $user_name ) ) {\n\t\t$errors->add( 'user_name', __( 'Please enter a username.' ) );\n\t}\n\n\t$illegal_names = get_site_option( 'illegal_names' );\n\tif ( ! is_array( $illegal_names ) ) {\n\t\t$illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );\n\t\tadd_site_option( 'illegal_names', $illegal_names );\n\t}\n\tif ( in_array( $user_name, $illegal_names, true ) ) {\n\t\t$errors->add( 'user_name', __( 'Sorry, that username is not allowed.' ) );\n\t}\n\n\t/** This filter is documented in wp-includes/user.php */\n\t$illegal_logins = (array) apply_filters( 'illegal_user_logins', array() );\n\n\tif ( in_array( strtolower( $user_name ), array_map( 'strtolower', $illegal_logins ), true ) ) {\n\t\t$errors->add( 'user_name', __( 'Sorry, that username is not allowed.' ) );\n\t}\n\n\tif ( ! is_email( $user_email ) ) {\n\t\t$errors->add( 'user_email', __( 'Please enter a valid email address.' ) );\n\t} elseif ( is_email_address_unsafe( $user_email ) ) {\n\t\t$errors->add( 'user_email', __( 'You cannot use that email address to signup. We are having problems with them blocking some of our email. Please use another email provider.' ) );\n\t}\n\n\tif ( strlen( $user_name ) < 4 ) {\n\t\t$errors->add( 'user_name', __( 'Username must be at least 4 characters.' ) );\n\t}\n\n\tif ( strlen( $user_name ) > 60 ) {\n\t\t$errors->add( 'user_name', __( 'Username may not be longer than 60 characters.' ) );\n\t}\n\n\t// All numeric?\n\tif ( preg_match( '/^[0-9]*$/', $user_name ) ) {\n\t\t$errors->add( 'user_name', __( 'Sorry, usernames must have letters too!' ) );\n\t}\n\n\t$limited_email_domains = get_site_option( 'limited_email_domains' );\n\tif ( is_array( $limited_email_domains ) && ! empty( $limited_email_domains ) ) {\n\t\t$limited_email_domains = array_map( 'strtolower', $limited_email_domains );\n\t\t$emaildomain           = strtolower( substr( $user_email, 1 + strpos( $user_email, '@' ) ) );\n\t\tif ( ! in_array( $emaildomain, $limited_email_domains, true ) ) {\n\t\t\t$errors->add( 'user_email', __( 'Sorry, that email address is not allowed!' ) );\n\t\t}\n\t}\n\n\t// Check if the username has been used already.\n\tif ( username_exists( $user_name ) ) {\n\t\t$errors->add( 'user_name', __( 'Sorry, that username already exists!' ) );\n\t}\n\n\t// Check if the email address has been used already.\n\tif ( email_exists( $user_email ) ) {\n\t\t$errors->add( 'user_email', __( 'Sorry, that email address is already used!' ) );\n\t}\n\n\t// Has someone already signed up for this username?\n\t$signup = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $wpdb->signups WHERE user_login = %s\", $user_name ) );\n\tif ( null != $signup ) {\n\t\t$registered_at = mysql2date( 'U', $signup->registered );\n\t\t$now           = time();\n\t\t$diff          = $now - $registered_at;\n\t\t// If registered more than two days ago, cancel registration and let this signup go through.\n\t\tif ( $diff > 2 * DAY_IN_SECONDS ) {\n\t\t\t$wpdb->delete( $wpdb->signups, array( 'user_login' => $user_name ) );\n\t\t} else {\n\t\t\t$errors->add( 'user_name', __( 'That username is currently reserved but may be available in a couple of days.' ) );\n\t\t}\n\t}\n\n\t$signup = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $wpdb->signups WHERE user_email = %s\", $user_email ) );\n\tif ( null != $signup ) {\n\t\t$diff = time() - mysql2date( 'U', $signup->registered );\n\t\t// If registered more than two days ago, cancel registration and let this signup go through.\n\t\tif ( $diff > 2 * DAY_IN_SECONDS ) {\n\t\t\t$wpdb->delete( $wpdb->signups, array( 'user_email' => $user_email ) );\n\t\t} else {\n\t\t\t$errors->add( 'user_email', __( 'That email address has already been used. Please check your inbox for an activation email. It will become available in a couple of days if you do nothing.' ) );\n\t\t}\n\t}\n\n\t$result = array(\n\t\t'user_name'     => $user_name,\n\t\t'orig_username' => $orig_username,\n\t\t'user_email'    => $user_email,\n\t\t'errors'        => $errors,\n\t);\n\n\t/**\n\t * Filters the validated user registration details.\n\t *\n\t * This does not allow you to override the username or email of the user during\n\t * registration. The values are solely used for validation and error handling.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param array $result {\n\t *     The array of user name, email, and the error messages.\n\t *\n\t *     @type string   $user_name     Sanitized and unique username.\n\t *     @type string   $orig_username Original username.\n\t *     @type string   $user_email    User email address.\n\t *     @type WP_Error $errors        WP_Error object containing any errors found.\n\t * }\n\t */\n\treturn apply_filters( 'wpmu_validate_user_signup', $result );\n}\n\n/**\n * Processes new site registrations.\n *\n * Checks the data provided by the user during blog signup. Verifies\n * the validity and uniqueness of blog paths and domains.\n *\n * This function prevents the current user from registering a new site\n * with a blogname equivalent to another user's login name. Passing the\n * $user parameter to the function, where $user is the other user, is\n * effectively an override of this limitation.\n *\n * Filter {@see 'wpmu_validate_blog_signup'} if you want to modify\n * the way that WordPress validates new site signups.\n *\n * @since MU (3.0.0)\n *\n * @global wpdb   $wpdb   WordPress database abstraction object.\n * @global string $domain\n *\n * @param string         $blogname   The blog name provided by the user. Must be unique.\n * @param string         $blog_title The blog title provided by the user.\n * @param WP_User|string $user       Optional. The user object to check against the new site name.\n * @return array {\n *     Array of domain, path, blog name, blog title, user and error messages.\n *\n *     @type string         $domain     Domain for the site.\n *     @type string         $path       Path for the site. Used in subdirectory installations.\n *     @type string         $blogname   The unique site name (slug).\n *     @type string         $blog_title Blog title.\n *     @type string|WP_User $user       By default, an empty string. A user object if provided.\n *     @type WP_Error       $errors     WP_Error containing any errors found.\n * }\n */\nfunction wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) {\n\tglobal $wpdb, $domain;\n\n\t$current_network = get_network();\n\t$base            = $current_network->path;\n\n\t$blog_title = strip_tags( $blog_title );\n\n\t$errors        = new WP_Error();\n\t$illegal_names = get_site_option( 'illegal_names' );\n\tif ( false == $illegal_names ) {\n\t\t$illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );\n\t\tadd_site_option( 'illegal_names', $illegal_names );\n\t}\n\n\t/*\n\t * On sub dir installations, some names are so illegal, only a filter can\n\t * spring them from jail.\n\t */\n\tif ( ! is_subdomain_install() ) {\n\t\t$illegal_names = array_merge( $illegal_names, get_subdirectory_reserved_names() );\n\t}\n\n\tif ( empty( $blogname ) ) {\n\t\t$errors->add( 'blogname', __( 'Please enter a site name.' ) );\n\t}\n\n\tif ( preg_match( '/[^a-z0-9]+/', $blogname ) ) {\n\t\t$errors->add( 'blogname', __( 'Site names can only contain lowercase letters (a-z) and numbers.' ) );\n\t}\n\n\tif ( in_array( $blogname, $illegal_names, true ) ) {\n\t\t$errors->add( 'blogname', __( 'That name is not allowed.' ) );\n\t}\n\n\t/**\n\t * Filters the minimum site name length required when validating a site signup.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param int $length The minimum site name length. Default 4.\n\t */\n\t$minimum_site_name_length = apply_filters( 'minimum_site_name_length', 4 );\n\n\tif ( strlen( $blogname ) < $minimum_site_name_length ) {\n\t\t/* translators: %s: Minimum site name length. */\n\t\t$errors->add( 'blogname', sprintf( _n( 'Site name must be at least %s character.', 'Site name must be at least %s characters.', $minimum_site_name_length ), number_format_i18n( $minimum_site_name_length ) ) );\n\t}\n\n\t// Do not allow users to create a blog that conflicts with a page on the main blog.\n\tif ( ! is_subdomain_install() && $wpdb->get_var( $wpdb->prepare( 'SELECT post_name FROM ' . $wpdb->get_blog_prefix( $current_network->site_id ) . \"posts WHERE post_type = 'page' AND post_name = %s\", $blogname ) ) ) {\n\t\t$errors->add( 'blogname', __( 'Sorry, you may not use that site name.' ) );\n\t}\n\n\t// All numeric?\n\tif ( preg_match( '/^[0-9]*$/', $blogname ) ) {\n\t\t$errors->add( 'blogname', __( 'Sorry, site names must have letters too!' ) );\n\t}\n\n\t/**\n\t * Filters the new site name during registration.\n\t *\n\t * The name is the site's subdomain or the site's subdirectory\n\t * path depending on the network settings.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param string $blogname Site name.\n\t */\n\t$blogname = apply_filters( 'newblogname', $blogname );\n\n\t$blog_title = wp_unslash( $blog_title );\n\n\tif ( empty( $blog_title ) ) {\n\t\t$errors->add( 'blog_title', __( 'Please enter a site title.' ) );\n\t}\n\n\t// Check if the domain/path has been used already.\n\tif ( is_subdomain_install() ) {\n\t\t$mydomain = $blogname . '.' . preg_replace( '|^www\\.|', '', $domain );\n\t\t$path     = $base;\n\t} else {\n\t\t$mydomain = \"$domain\";\n\t\t$path     = $base . $blogname . '/';\n\t}\n\tif ( domain_exists( $mydomain, $path, $current_network->id ) ) {\n\t\t$errors->add( 'blogname', __( 'Sorry, that site already exists!' ) );\n\t}\n\n\tif ( username_exists( $blogname ) ) {\n\t\tif ( ! is_object( $user ) || ( is_object( $user ) && ( $user->user_login != $blogname ) ) ) {\n\t\t\t$errors->add( 'blogname', __( 'Sorry, that site is reserved!' ) );\n\t\t}\n\t}\n\n\t// Has someone already signed up for this domain?\n\t// TODO: Check email too?\n\t$signup = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $wpdb->signups WHERE domain = %s AND path = %s\", $mydomain, $path ) );\n\tif ( ! empty( $signup ) ) {\n\t\t$diff = time() - mysql2date( 'U', $signup->registered );\n\t\t// If registered more than two days ago, cancel registration and let this signup go through.\n\t\tif ( $diff > 2 * DAY_IN_SECONDS ) {\n\t\t\t$wpdb->delete(\n\t\t\t\t$wpdb->signups,\n\t\t\t\tarray(\n\t\t\t\t\t'domain' => $mydomain,\n\t\t\t\t\t'path'   => $path,\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t$errors->add( 'blogname', __( 'That site is currently reserved but may be available in a couple days.' ) );\n\t\t}\n\t}\n\n\t$result = array(\n\t\t'domain'     => $mydomain,\n\t\t'path'       => $path,\n\t\t'blogname'   => $blogname,\n\t\t'blog_title' => $blog_title,\n\t\t'user'       => $user,\n\t\t'errors'     => $errors,\n\t);\n\n\t/**\n\t * Filters site details and error messages following registration.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param array $result {\n\t *     Array of domain, path, blog name, blog title, user and error messages.\n\t *\n\t *     @type string         $domain     Domain for the site.\n\t *     @type string         $path       Path for the site. Used in subdirectory installations.\n\t *     @type string         $blogname   The unique site name (slug).\n\t *     @type string         $blog_title Blog title.\n\t *     @type string|WP_User $user       By default, an empty string. A user object if provided.\n\t *     @type WP_Error       $errors     WP_Error containing any errors found.\n\t * }\n\t */\n\treturn apply_filters( 'wpmu_validate_blog_signup', $result );\n}\n\n/**\n * Record site signup information for future activation.\n *\n * @since MU (3.0.0)\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $domain     The requested domain.\n * @param string $path       The requested path.\n * @param string $title      The requested site title.\n * @param string $user       The user's requested login name.\n * @param string $user_email The user's email address.\n * @param array  $meta       Optional. Signup meta data. By default, contains the requested privacy setting and lang_id.\n */\nfunction wpmu_signup_blog( $domain, $path, $title, $user, $user_email, $meta = array() ) {\n\tglobal $wpdb;\n\n\t$key = substr( md5( time() . wp_rand() . $domain ), 0, 16 );\n\n\t/**\n\t * Filters the metadata for a site signup.\n\t *\n\t * The metadata will be serialized prior to storing it in the database.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param array  $meta       Signup meta data. Default empty array.\n\t * @param string $domain     The requested domain.\n\t * @param string $path       The requested path.\n\t * @param string $title      The requested site title.\n\t * @param string $user       The user's requested login name.\n\t * @param string $user_email The user's email address.\n\t * @param string $key        The user's activation key.\n\t */\n\t$meta = apply_filters( 'signup_site_meta', $meta, $domain, $path, $title, $user, $user_email, $key );\n\n\t$wpdb->insert(\n\t\t$wpdb->signups,\n\t\tarray(\n\t\t\t'domain'         => $domain,\n\t\t\t'path'           => $path,\n\t\t\t'title'          => $title,\n\t\t\t'user_login'     => $user,\n\t\t\t'user_email'     => $user_email,\n\t\t\t'registered'     => current_time( 'mysql', true ),\n\t\t\t'activation_key' => $key,\n\t\t\t'meta'           => serialize( $meta ),\n\t\t)\n\t);\n\n\t/**\n\t * Fires after site signup information has been written to the database.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $domain     The requested domain.\n\t * @param string $path       The requested path.\n\t * @param string $title      The requested site title.\n\t * @param string $user       The user's requested login name.\n\t * @param string $user_email The user's email address.\n\t * @param string $key        The user's activation key.\n\t * @param array  $meta       Signup meta data. By default, contains the requested privacy setting and lang_id.\n\t */\n\tdo_action( 'after_signup_site', $domain, $path, $title, $user, $user_email, $key, $meta );\n}\n\n/**\n * Record user signup information for future activation.\n *\n * This function is used when user registration is open but\n * new site registration is not.\n *\n * @since MU (3.0.0)\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $user       The user's requested login name.\n * @param string $user_email The user's email address.\n * @param array  $meta       Optional. Signup meta data. Default empty array.\n */\nfunction wpmu_signup_user( $user, $user_email, $meta = array() ) {\n\tglobal $wpdb;\n\n\t// Format data.\n\t$user       = preg_replace( '/\\s+/', '', sanitize_user( $user, true ) );\n\t$user_email = sanitize_email( $user_email );\n\t$key        = substr( md5( time() . wp_rand() . $user_email ), 0, 16 );\n\n\t/**\n\t * Filters the metadata for a user signup.\n\t *\n\t * The metadata will be serialized prior to storing it in the database.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param array  $meta       Signup meta data. Default empty array.\n\t * @param string $user       The user's requested login name.\n\t * @param string $user_email The user's email address.\n\t * @param string $key        The user's activation key.\n\t */\n\t$meta = apply_filters( 'signup_user_meta', $meta, $user, $user_email, $key );\n\n\t$wpdb->insert(\n\t\t$wpdb->signups,\n\t\tarray(\n\t\t\t'domain'         => '',\n\t\t\t'path'           => '',\n\t\t\t'title'          => '',\n\t\t\t'user_login'     => $user,\n\t\t\t'user_email'     => $user_email,\n\t\t\t'registered'     => current_time( 'mysql', true ),\n\t\t\t'activation_key' => $key,\n\t\t\t'meta'           => serialize( $meta ),\n\t\t)\n\t);\n\n\t/**\n\t * Fires after a user's signup information has been written to the database.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $user       The user's requested login name.\n\t * @param string $user_email The user's email address.\n\t * @param string $key        The user's activation key.\n\t * @param array  $meta       Signup meta data. Default empty array.\n\t */\n\tdo_action( 'after_signup_user', $user, $user_email, $key, $meta );\n}\n\n/**\n * Send a confirmation request email to a user when they sign up for a new site. The new site will not become active\n * until the confirmation link is clicked.\n *\n * This is the notification function used when site registration\n * is enabled.\n *\n * Filter {@see 'wpmu_signup_blog_notification'} to bypass this function or\n * replace it with your own notification behavior.\n *\n * Filter {@see 'wpmu_signup_blog_notification_email'} and\n * {@see 'wpmu_signup_blog_notification_subject'} to change the content\n * and subject line of the email sent to newly registered users.\n *\n * @since MU (3.0.0)\n *\n * @param string $domain     The new blog domain.\n * @param string $path       The new blog path.\n * @param string $title      The site title.\n * @param string $user_login The user's login name.\n * @param string $user_email The user's email address.\n * @param string $key        The activation key created in wpmu_signup_blog()\n * @param array  $meta       Optional. Signup meta data. By default, contains the requested privacy setting and lang_id.\n * @return bool\n */\nfunction wpmu_signup_blog_notification( $domain, $path, $title, $user_login, $user_email, $key, $meta = array() ) {\n\t/**\n\t * Filters whether to bypass the new site email notification.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param string|bool $domain     Site domain.\n\t * @param string      $path       Site path.\n\t * @param string      $title      Site title.\n\t * @param string      $user_login User login name.\n\t * @param string      $user_email User email address.\n\t * @param string      $key        Activation key created in wpmu_signup_blog().\n\t * @param array       $meta       Signup meta data. By default, contains the requested privacy setting and lang_id.\n\t */\n\tif ( ! apply_filters( 'wpmu_signup_blog_notification', $domain, $path, $title, $user_login, $user_email, $key, $meta ) ) {\n\t\treturn false;\n\t}\n\n\t// Send email with activation link.\n\tif ( ! is_subdomain_install() || get_current_network_id() != 1 ) {\n\t\t$activate_url = network_site_url( \"wp-activate.php?key=$key\" );\n\t} else {\n\t\t$activate_url = \"http://{$domain}{$path}wp-activate.php?key=$key\"; // @todo Use *_url() API.\n\t}\n\n\t$activate_url = esc_url( $activate_url );\n\n\t$admin_email = get_site_option( 'admin_email' );\n\n\tif ( '' === $admin_email ) {\n\t\t$admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );\n\t}\n\n\t$from_name       = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress';\n\t$message_headers = \"From: \\\"{$from_name}\\\" <{$admin_email}>\\n\" . 'Content-Type: text/plain; charset=\"' . get_option( 'blog_charset' ) . \"\\\"\\n\";\n\n\t$user            = get_user_by( 'login', $user_login );\n\t$switched_locale = switch_to_locale( get_user_locale( $user ) );\n\n\t$message = sprintf(\n\t\t/**\n\t\t * Filters the message content of the new blog notification email.\n\t\t *\n\t\t * Content should be formatted for transmission via wp_mail().\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t *\n\t\t * @param string $content    Content of the notification email.\n\t\t * @param string $domain     Site domain.\n\t\t * @param string $path       Site path.\n\t\t * @param string $title      Site title.\n\t\t * @param string $user_login User login name.\n\t\t * @param string $user_email User email address.\n\t\t * @param string $key        Activation key created in wpmu_signup_blog().\n\t\t * @param array  $meta       Signup meta data. By default, contains the requested privacy setting and lang_id.\n\t\t */\n\t\tapply_filters(\n\t\t\t'wpmu_signup_blog_notification_email',\n\t\t\t/* translators: New site notification email. 1: Activation URL, 2: New site URL. */\n\t\t\t__( \"To activate your blog, please click the following link:\\n\\n%1\\$s\\n\\nAfter you activate, you will receive *another email* with your login.\\n\\nAfter you activate, you can visit your site here:\\n\\n%2\\$s\" ),\n\t\t\t$domain,\n\t\t\t$path,\n\t\t\t$title,\n\t\t\t$user_login,\n\t\t\t$user_email,\n\t\t\t$key,\n\t\t\t$meta\n\t\t),\n\t\t$activate_url,\n\t\tesc_url( \"http://{$domain}{$path}\" ),\n\t\t$key\n\t);\n\n\t$subject = sprintf(\n\t\t/**\n\t\t * Filters the subject of the new blog notification email.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t *\n\t\t * @param string $subject    Subject of the notification email.\n\t\t * @param string $domain     Site domain.\n\t\t * @param string $path       Site path.\n\t\t * @param string $title      Site title.\n\t\t * @param string $user_login User login name.\n\t\t * @param string $user_email User email address.\n\t\t * @param string $key        Activation key created in wpmu_signup_blog().\n\t\t * @param array  $meta       Signup meta data. By default, contains the requested privacy setting and lang_id.\n\t\t */\n\t\tapply_filters(\n\t\t\t'wpmu_signup_blog_notification_subject',\n\t\t\t/* translators: New site notification email subject. 1: Network title, 2: New site URL. */\n\t\t\t_x( '[%1$s] Activate %2$s', 'New site notification email subject' ),\n\t\t\t$domain,\n\t\t\t$path,\n\t\t\t$title,\n\t\t\t$user_login,\n\t\t\t$user_email,\n\t\t\t$key,\n\t\t\t$meta\n\t\t),\n\t\t$from_name,\n\t\tesc_url( 'http://' . $domain . $path )\n\t);\n\n\twp_mail( $user_email, wp_specialchars_decode( $subject ), $message, $message_headers );\n\n\tif ( $switched_locale ) {\n\t\trestore_previous_locale();\n\t}\n\n\treturn true;\n}\n\n/**\n * Send a confirmation request email to a user when they sign up for a new user account (without signing up for a site\n * at the same time). The user account will not become active until the confirmation link is clicked.\n *\n * This is the notification function used when no new site has\n * been requested.\n *\n * Filter {@see 'wpmu_signup_user_notification'} to bypass this function or\n * replace it with your own notification behavior.\n *\n * Filter {@see 'wpmu_signup_user_notification_email'} and\n * {@see 'wpmu_signup_user_notification_subject'} to change the content\n * and subject line of the email sent to newly registered users.\n *\n * @since MU (3.0.0)\n *\n * @param string $user_login The user's login name.\n * @param string $user_email The user's email address.\n * @param string $key        The activation key created in wpmu_signup_user()\n * @param array  $meta       Optional. Signup meta data. Default empty array.\n * @return bool\n */\nfunction wpmu_signup_user_notification( $user_login, $user_email, $key, $meta = array() ) {\n\t/**\n\t * Filters whether to bypass the email notification for new user sign-up.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param string $user_login User login name.\n\t * @param string $user_email User email address.\n\t * @param string $key        Activation key created in wpmu_signup_user().\n\t * @param array  $meta       Signup meta data. Default empty array.\n\t */\n\tif ( ! apply_filters( 'wpmu_signup_user_notification', $user_login, $user_email, $key, $meta ) ) {\n\t\treturn false;\n\t}\n\n\t$user            = get_user_by( 'login', $user_login );\n\t$switched_locale = switch_to_locale( get_user_locale( $user ) );\n\n\t// Send email with activation link.\n\t$admin_email = get_site_option( 'admin_email' );\n\n\tif ( '' === $admin_email ) {\n\t\t$admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );\n\t}\n\n\t$from_name       = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress';\n\t$message_headers = \"From: \\\"{$from_name}\\\" <{$admin_email}>\\n\" . 'Content-Type: text/plain; charset=\"' . get_option( 'blog_charset' ) . \"\\\"\\n\";\n\t$message         = sprintf(\n\t\t/**\n\t\t * Filters the content of the notification email for new user sign-up.\n\t\t *\n\t\t * Content should be formatted for transmission via wp_mail().\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t *\n\t\t * @param string $content    Content of the notification email.\n\t\t * @param string $user_login User login name.\n\t\t * @param string $user_email User email address.\n\t\t * @param string $key        Activation key created in wpmu_signup_user().\n\t\t * @param array  $meta       Signup meta data. Default empty array.\n\t\t */\n\t\tapply_filters(\n\t\t\t'wpmu_signup_user_notification_email',\n\t\t\t/* translators: New user notification email. %s: Activation URL. */\n\t\t\t__( \"To activate your user, please click the following link:\\n\\n%s\\n\\nAfter you activate, you will receive *another email* with your login.\" ),\n\t\t\t$user_login,\n\t\t\t$user_email,\n\t\t\t$key,\n\t\t\t$meta\n\t\t),\n\t\tsite_url( \"wp-activate.php?key=$key\" )\n\t);\n\n\t$subject = sprintf(\n\t\t/**\n\t\t * Filters the subject of the notification email of new user signup.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t *\n\t\t * @param string $subject    Subject of the notification email.\n\t\t * @param string $user_login User login name.\n\t\t * @param string $user_email User email address.\n\t\t * @param string $key        Activation key created in wpmu_signup_user().\n\t\t * @param array  $meta       Signup meta data. Default empty array.\n\t\t */\n\t\tapply_filters(\n\t\t\t'wpmu_signup_user_notification_subject',\n\t\t\t/* translators: New user notification email subject. 1: Network title, 2: New user login. */\n\t\t\t_x( '[%1$s] Activate %2$s', 'New user notification email subject' ),\n\t\t\t$user_login,\n\t\t\t$user_email,\n\t\t\t$key,\n\t\t\t$meta\n\t\t),\n\t\t$from_name,\n\t\t$user_login\n\t);\n\n\twp_mail( $user_email, wp_specialchars_decode( $subject ), $message, $message_headers );\n\n\tif ( $switched_locale ) {\n\t\trestore_previous_locale();\n\t}\n\n\treturn true;\n}\n\n/**\n * Activate a signup.\n *\n * Hook to {@see 'wpmu_activate_user'} or {@see 'wpmu_activate_blog'} for events\n * that should happen only when users or sites are self-created (since\n * those actions are not called when users and sites are created\n * by a Super Admin).\n *\n * @since MU (3.0.0)\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $key The activation key provided to the user.\n * @return array|WP_Error An array containing information about the activated user and/or blog\n */\nfunction wpmu_activate_signup( $key ) {\n\tglobal $wpdb;\n\n\t$signup = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $wpdb->signups WHERE activation_key = %s\", $key ) );\n\n\tif ( empty( $signup ) ) {\n\t\treturn new WP_Error( 'invalid_key', __( 'Invalid activation key.' ) );\n\t}\n\n\tif ( $signup->active ) {\n\t\tif ( empty( $signup->domain ) ) {\n\t\t\treturn new WP_Error( 'already_active', __( 'The user is already active.' ), $signup );\n\t\t} else {\n\t\t\treturn new WP_Error( 'already_active', __( 'The site is already active.' ), $signup );\n\t\t}\n\t}\n\n\t$meta     = maybe_unserialize( $signup->meta );\n\t$password = wp_generate_password( 12, false );\n\n\t$user_id = username_exists( $signup->user_login );\n\n\tif ( ! $user_id ) {\n\t\t$user_id = wpmu_create_user( $signup->user_login, $password, $signup->user_email );\n\t} else {\n\t\t$user_already_exists = true;\n\t}\n\n\tif ( ! $user_id ) {\n\t\treturn new WP_Error( 'create_user', __( 'Could not create user' ), $signup );\n\t}\n\n\t$now = current_time( 'mysql', true );\n\n\tif ( empty( $signup->domain ) ) {\n\t\t$wpdb->update(\n\t\t\t$wpdb->signups,\n\t\t\tarray(\n\t\t\t\t'active'    => 1,\n\t\t\t\t'activated' => $now,\n\t\t\t),\n\t\t\tarray( 'activation_key' => $key )\n\t\t);\n\n\t\tif ( isset( $user_already_exists ) ) {\n\t\t\treturn new WP_Error( 'user_already_exists', __( 'That username is already activated.' ), $signup );\n\t\t}\n\n\t\t/**\n\t\t * Fires immediately after a new user is activated.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t *\n\t\t * @param int    $user_id  User ID.\n\t\t * @param string $password User password.\n\t\t * @param array  $meta     Signup meta data.\n\t\t */\n\t\tdo_action( 'wpmu_activate_user', $user_id, $password, $meta );\n\n\t\treturn array(\n\t\t\t'user_id'  => $user_id,\n\t\t\t'password' => $password,\n\t\t\t'meta'     => $meta,\n\t\t);\n\t}\n\n\t$blog_id = wpmu_create_blog( $signup->domain, $signup->path, $signup->title, $user_id, $meta, get_current_network_id() );\n\n\t// TODO: What to do if we create a user but cannot create a blog?\n\tif ( is_wp_error( $blog_id ) ) {\n\t\t/*\n\t\t * If blog is taken, that means a previous attempt to activate this blog\n\t\t * failed in between creating the blog and setting the activation flag.\n\t\t * Let's just set the active flag and instruct the user to reset their password.\n\t\t */\n\t\tif ( 'blog_taken' === $blog_id->get_error_code() ) {\n\t\t\t$blog_id->add_data( $signup );\n\t\t\t$wpdb->update(\n\t\t\t\t$wpdb->signups,\n\t\t\t\tarray(\n\t\t\t\t\t'active'    => 1,\n\t\t\t\t\t'activated' => $now,\n\t\t\t\t),\n\t\t\t\tarray( 'activation_key' => $key )\n\t\t\t);\n\t\t}\n\t\treturn $blog_id;\n\t}\n\n\t$wpdb->update(\n\t\t$wpdb->signups,\n\t\tarray(\n\t\t\t'active'    => 1,\n\t\t\t'activated' => $now,\n\t\t),\n\t\tarray( 'activation_key' => $key )\n\t);\n\n\t/**\n\t * Fires immediately after a site is activated.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param int    $blog_id       Blog ID.\n\t * @param int    $user_id       User ID.\n\t * @param int    $password      User password.\n\t * @param string $signup_title  Site title.\n\t * @param array  $meta          Signup meta data. By default, contains the requested privacy setting and lang_id.\n\t */\n\tdo_action( 'wpmu_activate_blog', $blog_id, $user_id, $password, $signup->title, $meta );\n\n\treturn array(\n\t\t'blog_id'  => $blog_id,\n\t\t'user_id'  => $user_id,\n\t\t'password' => $password,\n\t\t'title'    => $signup->title,\n\t\t'meta'     => $meta,\n\t);\n}\n\n/**\n * Deletes am associated signup entry when a user is deleted from the database.\n *\n * @since 5.5.0\n *\n * @param int      $id       ID of the user to delete.\n * @param int|null $reassign ID of the user to reassign posts and links to.\n * @param WP_User  $user     User object.\n */\nfunction wp_delete_signup_on_user_delete( $id, $reassign, $user ) {\n\tglobal $wpdb;\n\n\t$wpdb->delete( $wpdb->signups, array( 'user_login' => $user->user_login ) );\n}\n\n/**\n * Create a user.\n *\n * This function runs when a user self-registers as well as when\n * a Super Admin creates a new user. Hook to {@see 'wpmu_new_user'} for events\n * that should affect all new users, but only on Multisite (otherwise\n * use {@see'user_register'}).\n *\n * @since MU (3.0.0)\n *\n * @param string $user_name The new user's login name.\n * @param string $password  The new user's password.\n * @param string $email     The new user's email address.\n * @return int|false Returns false on failure, or int $user_id on success\n */\nfunction wpmu_create_user( $user_name, $password, $email ) {\n\t$user_name = preg_replace( '/\\s+/', '', sanitize_user( $user_name, true ) );\n\n\t$user_id = wp_create_user( $user_name, $password, $email );\n\tif ( is_wp_error( $user_id ) ) {\n\t\treturn false;\n\t}\n\n\t// Newly created users have no roles or caps until they are added to a blog.\n\tdelete_user_option( $user_id, 'capabilities' );\n\tdelete_user_option( $user_id, 'user_level' );\n\n\t/**\n\t * Fires immediately after a new user is created.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param int $user_id User ID.\n\t */\n\tdo_action( 'wpmu_new_user', $user_id );\n\n\treturn $user_id;\n}\n\n/**\n * Create a site.\n *\n * This function runs when a user self-registers a new site as well\n * as when a Super Admin creates a new site. Hook to {@see 'wpmu_new_blog'}\n * for events that should affect all new sites.\n *\n * On subdirectory installations, $domain is the same as the main site's\n * domain, and the path is the subdirectory name (eg 'example.com'\n * and '/blog1/'). On subdomain installations, $domain is the new subdomain +\n * root domain (eg 'blog1.example.com'), and $path is '/'.\n *\n * @since MU (3.0.0)\n *\n * @param string $domain     The new site's domain.\n * @param string $path       The new site's path.\n * @param string $title      The new site's title.\n * @param int    $user_id    The user ID of the new site's admin.\n * @param array  $options    Optional. Array of key=>value pairs used to set initial site options.\n *                           If valid status keys are included ('public', 'archived', 'mature',\n *                           'spam', 'deleted', or 'lang_id') the given site status(es) will be\n *                           updated. Otherwise, keys and values will be used to set options for\n *                           the new site. Default empty array.\n * @param int    $network_id Optional. Network ID. Only relevant on multi-network installations.\n * @return int|WP_Error Returns WP_Error object on failure, the new site ID on success.\n */\nfunction wpmu_create_blog( $domain, $path, $title, $user_id, $options = array(), $network_id = 1 ) {\n\t$defaults = array(\n\t\t'public' => 0,\n\t);\n\t$options  = wp_parse_args( $options, $defaults );\n\n\t$title   = strip_tags( $title );\n\t$user_id = (int) $user_id;\n\n\t// Check if the domain has been used already. We should return an error message.\n\tif ( domain_exists( $domain, $path, $network_id ) ) {\n\t\treturn new WP_Error( 'blog_taken', __( 'Sorry, that site already exists!' ) );\n\t}\n\n\tif ( ! wp_installing() ) {\n\t\twp_installing( true );\n\t}\n\n\t$allowed_data_fields = array( 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' );\n\n\t$site_data = array_merge(\n\t\tarray(\n\t\t\t'domain'     => $domain,\n\t\t\t'path'       => $path,\n\t\t\t'network_id' => $network_id,\n\t\t),\n\t\tarray_intersect_key( $options, array_flip( $allowed_data_fields ) )\n\t);\n\n\t// Data to pass to wp_initialize_site().\n\t$site_initialization_data = array(\n\t\t'title'   => $title,\n\t\t'user_id' => $user_id,\n\t\t'options' => array_diff_key( $options, array_flip( $allowed_data_fields ) ),\n\t);\n\n\t$blog_id = wp_insert_site( array_merge( $site_data, $site_initialization_data ) );\n\n\tif ( is_wp_error( $blog_id ) ) {\n\t\treturn $blog_id;\n\t}\n\n\twp_cache_set( 'last_changed', microtime(), 'sites' );\n\n\treturn $blog_id;\n}\n\n/**\n * Notifies the network admin that a new site has been activated.\n *\n * Filter {@see 'newblog_notify_siteadmin'} to change the content of\n * the notification email.\n *\n * @since MU (3.0.0)\n * @since 5.1.0 $blog_id now supports input from the {@see 'wp_initialize_site'} action.\n *\n * @param WP_Site|int $blog_id    The new site's object or ID.\n * @param string      $deprecated Not used.\n * @return bool\n */\nfunction newblog_notify_siteadmin( $blog_id, $deprecated = '' ) {\n\tif ( is_object( $blog_id ) ) {\n\t\t$blog_id = $blog_id->blog_id;\n\t}\n\n\tif ( 'yes' !== get_site_option( 'registrationnotification' ) ) {\n\t\treturn false;\n\t}\n\n\t$email = get_site_option( 'admin_email' );\n\n\tif ( is_email( $email ) == false ) {\n\t\treturn false;\n\t}\n\n\t$options_site_url = esc_url( network_admin_url( 'settings.php' ) );\n\n\tswitch_to_blog( $blog_id );\n\t$blogname = get_option( 'blogname' );\n\t$siteurl  = site_url();\n\trestore_current_blog();\n\n\t$msg = sprintf(\n\t\t/* translators: New site notification email. 1: Site URL, 2: User IP address, 3: URL to Network Settings screen. */\n\t\t__(\n\t\t\t'New Site: %1$s\nURL: %2$s\nRemote IP address: %3$s\n\nDisable these notifications: %4$s'\n\t\t),\n\t\t$blogname,\n\t\t$siteurl,\n\t\twp_unslash( $_SERVER['REMOTE_ADDR'] ),\n\t\t$options_site_url\n\t);\n\t/**\n\t * Filters the message body of the new site activation email sent\n\t * to the network administrator.\n\t *\n\t * @since MU (3.0.0)\n\t * @since 5.4.0 The `$blog_id` parameter was added.\n\t *\n\t * @param string $msg     Email body.\n\t * @param int    $blog_id The new site's ID.\n\t */\n\t$msg = apply_filters( 'newblog_notify_siteadmin', $msg, $blog_id );\n\n\t/* translators: New site notification email subject. %s: New site URL. */\n\twp_mail( $email, sprintf( __( 'New Site Registration: %s' ), $siteurl ), $msg );\n\n\treturn true;\n}\n\n/**\n * Notifies the network admin that a new user has been activated.\n *\n * Filter {@see 'newuser_notify_siteadmin'} to change the content of\n * the notification email.\n *\n * @since MU (3.0.0)\n *\n * @param int $user_id The new user's ID.\n * @return bool\n */\nfunction newuser_notify_siteadmin( $user_id ) {\n\tif ( 'yes' !== get_site_option( 'registrationnotification' ) ) {\n\t\treturn false;\n\t}\n\n\t$email = get_site_option( 'admin_email' );\n\n\tif ( is_email( $email ) == false ) {\n\t\treturn false;\n\t}\n\n\t$user = get_userdata( $user_id );\n\n\t$options_site_url = esc_url( network_admin_url( 'settings.php' ) );\n\n\t$msg = sprintf(\n\t\t/* translators: New user notification email. 1: User login, 2: User IP address, 3: URL to Network Settings screen. */\n\t\t__(\n\t\t\t'New User: %1$s\nRemote IP address: %2$s\n\nDisable these notifications: %3$s'\n\t\t),\n\t\t$user->user_login,\n\t\twp_unslash( $_SERVER['REMOTE_ADDR'] ),\n\t\t$options_site_url\n\t);\n\n\t/**\n\t * Filters the message body of the new user activation email sent\n\t * to the network administrator.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param string  $msg  Email body.\n\t * @param WP_User $user WP_User instance of the new user.\n\t */\n\t$msg = apply_filters( 'newuser_notify_siteadmin', $msg, $user );\n\n\t/* translators: New user notification email subject. %s: User login. */\n\twp_mail( $email, sprintf( __( 'New User Registration: %s' ), $user->user_login ), $msg );\n\n\treturn true;\n}\n\n/**\n * Checks whether a site name is already taken.\n *\n * The name is the site's subdomain or the site's subdirectory\n * path depending on the network settings.\n *\n * Used during the new site registration process to ensure\n * that each site name is unique.\n *\n * @since MU (3.0.0)\n *\n * @param string $domain     The domain to be checked.\n * @param string $path       The path to be checked.\n * @param int    $network_id Optional. Network ID. Relevant only on multi-network installations.\n * @return int|null The site ID if the site name exists, null otherwise.\n */\nfunction domain_exists( $domain, $path, $network_id = 1 ) {\n\t$path   = trailingslashit( $path );\n\t$args   = array(\n\t\t'network_id'             => $network_id,\n\t\t'domain'                 => $domain,\n\t\t'path'                   => $path,\n\t\t'fields'                 => 'ids',\n\t\t'number'                 => 1,\n\t\t'update_site_meta_cache' => false,\n\t);\n\t$result = get_sites( $args );\n\t$result = array_shift( $result );\n\n\t/**\n\t * Filters whether a site name is taken.\n\t *\n\t * The name is the site's subdomain or the site's subdirectory\n\t * path depending on the network settings.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param int|null $result     The site ID if the site name exists, null otherwise.\n\t * @param string   $domain     Domain to be checked.\n\t * @param string   $path       Path to be checked.\n\t * @param int      $network_id Network ID. Relevant only on multi-network installations.\n\t */\n\treturn apply_filters( 'domain_exists', $result, $domain, $path, $network_id );\n}\n\n/**\n * Notify a user that their blog activation has been successful.\n *\n * Filter {@see 'wpmu_welcome_notification'} to disable or bypass.\n *\n * Filter {@see 'update_welcome_email'} and {@see 'update_welcome_subject'} to\n * modify the content and subject line of the notification email.\n *\n * @since MU (3.0.0)\n *\n * @param int    $blog_id  Blog ID.\n * @param int    $user_id  User ID.\n * @param string $password User password.\n * @param string $title    Site title.\n * @param array  $meta     Optional. Signup meta data. By default, contains the requested privacy setting and lang_id.\n * @return bool\n */\nfunction wpmu_welcome_notification( $blog_id, $user_id, $password, $title, $meta = array() ) {\n\t$current_network = get_network();\n\n\t/**\n\t * Filters whether to bypass the welcome email after site activation.\n\t *\n\t * Returning false disables the welcome email.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param int|bool $blog_id  Blog ID.\n\t * @param int      $user_id  User ID.\n\t * @param string   $password User password.\n\t * @param string   $title    Site title.\n\t * @param array    $meta     Signup meta data. By default, contains the requested privacy setting and lang_id.\n\t */\n\tif ( ! apply_filters( 'wpmu_welcome_notification', $blog_id, $user_id, $password, $title, $meta ) ) {\n\t\treturn false;\n\t}\n\n\t$user = get_userdata( $user_id );\n\n\t$switched_locale = switch_to_locale( get_user_locale( $user ) );\n\n\t$welcome_email = get_site_option( 'welcome_email' );\n\tif ( false == $welcome_email ) {\n\t\t/* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD: those are placeholders. */\n\t\t$welcome_email = __(\n\t\t\t'Howdy USERNAME,\n\nYour new SITE_NAME site has been successfully set up at:\nBLOG_URL\n\nYou can log in to the administrator account with the following information:\n\nUsername: USERNAME\nPassword: PASSWORD\nLog in here: BLOG_URLwp-login.php\n\nWe hope you enjoy your new site. Thanks!\n\n--The Team @ SITE_NAME'\n\t\t);\n\t}\n\n\t$url = get_blogaddress_by_id( $blog_id );\n\n\t$welcome_email = str_replace( 'SITE_NAME', $current_network->site_name, $welcome_email );\n\t$welcome_email = str_replace( 'BLOG_TITLE', $title, $welcome_email );\n\t$welcome_email = str_replace( 'BLOG_URL', $url, $welcome_email );\n\t$welcome_email = str_replace( 'USERNAME', $user->user_login, $welcome_email );\n\t$welcome_email = str_replace( 'PASSWORD', $password, $welcome_email );\n\n\t/**\n\t * Filters the content of the welcome email after site activation.\n\t *\n\t * Content should be formatted for transmission via wp_mail().\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param string $welcome_email Message body of the email.\n\t * @param int    $blog_id       Blog ID.\n\t * @param int    $user_id       User ID.\n\t * @param string $password      User password.\n\t * @param string $title         Site title.\n\t * @param array  $meta          Signup meta data. By default, contains the requested privacy setting and lang_id.\n\t */\n\t$welcome_email = apply_filters( 'update_welcome_email', $welcome_email, $blog_id, $user_id, $password, $title, $meta );\n\n\t$admin_email = get_site_option( 'admin_email' );\n\n\tif ( '' === $admin_email ) {\n\t\t$admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );\n\t}\n\n\t$from_name       = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress';\n\t$message_headers = \"From: \\\"{$from_name}\\\" <{$admin_email}>\\n\" . 'Content-Type: text/plain; charset=\"' . get_option( 'blog_charset' ) . \"\\\"\\n\";\n\t$message         = $welcome_email;\n\n\tif ( empty( $current_network->site_name ) ) {\n\t\t$current_network->site_name = 'WordPress';\n\t}\n\n\t/* translators: New site notification email subject. 1: Network title, 2: New site title. */\n\t$subject = __( 'New %1$s Site: %2$s' );\n\n\t/**\n\t * Filters the subject of the welcome email after site activation.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param string $subject Subject of the email.\n\t */\n\t$subject = apply_filters( 'update_welcome_subject', sprintf( $subject, $current_network->site_name, wp_unslash( $title ) ) );\n\n\twp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers );\n\n\tif ( $switched_locale ) {\n\t\trestore_previous_locale();\n\t}\n\n\treturn true;\n}\n\n/**\n * Notify a user that their account activation has been successful.\n *\n * Filter {@see 'wpmu_welcome_user_notification'} to disable or bypass.\n *\n * Filter {@see 'update_welcome_user_email'} and {@see 'update_welcome_user_subject'} to\n * modify the content and subject line of the notification email.\n *\n * @since MU (3.0.0)\n *\n * @param int    $user_id  User ID.\n * @param string $password User password.\n * @param array  $meta     Optional. Signup meta data. Default empty array.\n * @return bool\n */\nfunction wpmu_welcome_user_notification( $user_id, $password, $meta = array() ) {\n\t$current_network = get_network();\n\n\t/**\n\t * Filters whether to bypass the welcome email after user activation.\n\t *\n\t * Returning false disables the welcome email.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param int    $user_id  User ID.\n\t * @param string $password User password.\n\t * @param array  $meta     Signup meta data. Default empty array.\n\t */\n\tif ( ! apply_filters( 'wpmu_welcome_user_notification', $user_id, $password, $meta ) ) {\n\t\treturn false;\n\t}\n\n\t$welcome_email = get_site_option( 'welcome_user_email' );\n\n\t$user = get_userdata( $user_id );\n\n\t$switched_locale = switch_to_locale( get_user_locale( $user ) );\n\n\t/**\n\t * Filters the content of the welcome email after user activation.\n\t *\n\t * Content should be formatted for transmission via wp_mail().\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param string $welcome_email The message body of the account activation success email.\n\t * @param int    $user_id       User ID.\n\t * @param string $password      User password.\n\t * @param array  $meta          Signup meta data. Default empty array.\n\t */\n\t$welcome_email = apply_filters( 'update_welcome_user_email', $welcome_email, $user_id, $password, $meta );\n\t$welcome_email = str_replace( 'SITE_NAME', $current_network->site_name, $welcome_email );\n\t$welcome_email = str_replace( 'USERNAME', $user->user_login, $welcome_email );\n\t$welcome_email = str_replace( 'PASSWORD', $password, $welcome_email );\n\t$welcome_email = str_replace( 'LOGINLINK', wp_login_url(), $welcome_email );\n\n\t$admin_email = get_site_option( 'admin_email' );\n\n\tif ( '' === $admin_email ) {\n\t\t$admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );\n\t}\n\n\t$from_name       = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress';\n\t$message_headers = \"From: \\\"{$from_name}\\\" <{$admin_email}>\\n\" . 'Content-Type: text/plain; charset=\"' . get_option( 'blog_charset' ) . \"\\\"\\n\";\n\t$message         = $welcome_email;\n\n\tif ( empty( $current_network->site_name ) ) {\n\t\t$current_network->site_name = 'WordPress';\n\t}\n\n\t/* translators: New user notification email subject. 1: Network title, 2: New user login. */\n\t$subject = __( 'New %1$s User: %2$s' );\n\n\t/**\n\t * Filters the subject of the welcome email after user activation.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param string $subject Subject of the email.\n\t */\n\t$subject = apply_filters( 'update_welcome_user_subject', sprintf( $subject, $current_network->site_name, $user->user_login ) );\n\n\twp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers );\n\n\tif ( $switched_locale ) {\n\t\trestore_previous_locale();\n\t}\n\n\treturn true;\n}\n\n/**\n * Get the current network.\n *\n * Returns an object containing the 'id', 'domain', 'path', and 'site_name'\n * properties of the network being viewed.\n *\n * @see wpmu_current_site()\n *\n * @since MU (3.0.0)\n *\n * @global WP_Network $current_site\n *\n * @return WP_Network\n */\nfunction get_current_site() {\n\tglobal $current_site;\n\treturn $current_site;\n}\n\n/**\n * Get a user's most recent post.\n *\n * Walks through each of a user's blogs to find the post with\n * the most recent post_date_gmt.\n *\n * @since MU (3.0.0)\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int $user_id\n * @return array Contains the blog_id, post_id, post_date_gmt, and post_gmt_ts\n */\nfunction get_most_recent_post_of_user( $user_id ) {\n\tglobal $wpdb;\n\n\t$user_blogs       = get_blogs_of_user( (int) $user_id );\n\t$most_recent_post = array();\n\n\t// Walk through each blog and get the most recent post\n\t// published by $user_id.\n\tforeach ( (array) $user_blogs as $blog ) {\n\t\t$prefix      = $wpdb->get_blog_prefix( $blog->userblog_id );\n\t\t$recent_post = $wpdb->get_row( $wpdb->prepare( \"SELECT ID, post_date_gmt FROM {$prefix}posts WHERE post_author = %d AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1\", $user_id ), ARRAY_A );\n\n\t\t// Make sure we found a post.\n\t\tif ( isset( $recent_post['ID'] ) ) {\n\t\t\t$post_gmt_ts = strtotime( $recent_post['post_date_gmt'] );\n\n\t\t\t/*\n\t\t\t * If this is the first post checked\n\t\t\t * or if this post is newer than the current recent post,\n\t\t\t * make it the new most recent post.\n\t\t\t */\n\t\t\tif ( ! isset( $most_recent_post['post_gmt_ts'] ) || ( $post_gmt_ts > $most_recent_post['post_gmt_ts'] ) ) {\n\t\t\t\t$most_recent_post = array(\n\t\t\t\t\t'blog_id'       => $blog->userblog_id,\n\t\t\t\t\t'post_id'       => $recent_post['ID'],\n\t\t\t\t\t'post_date_gmt' => $recent_post['post_date_gmt'],\n\t\t\t\t\t'post_gmt_ts'   => $post_gmt_ts,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $most_recent_post;\n}\n\n//\n// Misc functions.\n//\n\n/**\n * Check an array of MIME types against a list of allowed types.\n *\n * WordPress ships with a set of allowed upload filetypes,\n * which is defined in wp-includes/functions.php in\n * get_allowed_mime_types(). This function is used to filter\n * that list against the filetypes allowed provided by Multisite\n * Super Admins at wp-admin/network/settings.php.\n *\n * @since MU (3.0.0)\n *\n * @param array $mimes\n * @return array\n */\nfunction check_upload_mimes( $mimes ) {\n\t$site_exts  = explode( ' ', get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) );\n\t$site_mimes = array();\n\tforeach ( $site_exts as $ext ) {\n\t\tforeach ( $mimes as $ext_pattern => $mime ) {\n\t\t\tif ( '' !== $ext && false !== strpos( $ext_pattern, $ext ) ) {\n\t\t\t\t$site_mimes[ $ext_pattern ] = $mime;\n\t\t\t}\n\t\t}\n\t}\n\treturn $site_mimes;\n}\n\n/**\n * Update a blog's post count.\n *\n * WordPress MS stores a blog's post count as an option so as\n * to avoid extraneous COUNTs when a blog's details are fetched\n * with get_site(). This function is called when posts are published\n * or unpublished to make sure the count stays current.\n *\n * @since MU (3.0.0)\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $deprecated Not used.\n */\nfunction update_posts_count( $deprecated = '' ) {\n\tglobal $wpdb;\n\tupdate_option( 'post_count', (int) $wpdb->get_var( \"SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_status = 'publish' and post_type = 'post'\" ) );\n}\n\n/**\n * Logs the user email, IP, and registration date of a new site.\n *\n * @since MU (3.0.0)\n * @since 5.1.0 Parameters now support input from the {@see 'wp_initialize_site'} action.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param WP_Site|int $blog_id The new site's object or ID.\n * @param int|array   $user_id User ID, or array of arguments including 'user_id'.\n */\nfunction wpmu_log_new_registrations( $blog_id, $user_id ) {\n\tglobal $wpdb;\n\n\tif ( is_object( $blog_id ) ) {\n\t\t$blog_id = $blog_id->blog_id;\n\t}\n\n\tif ( is_array( $user_id ) ) {\n\t\t$user_id = ! empty( $user_id['user_id'] ) ? $user_id['user_id'] : 0;\n\t}\n\n\t$user = get_userdata( (int) $user_id );\n\tif ( $user ) {\n\t\t$wpdb->insert(\n\t\t\t$wpdb->registration_log,\n\t\t\tarray(\n\t\t\t\t'email'           => $user->user_email,\n\t\t\t\t'IP'              => preg_replace( '/[^0-9., ]/', '', wp_unslash( $_SERVER['REMOTE_ADDR'] ) ),\n\t\t\t\t'blog_id'         => $blog_id,\n\t\t\t\t'date_registered' => current_time( 'mysql' ),\n\t\t\t)\n\t\t);\n\t}\n}\n\n/**\n * Maintains a canonical list of terms by syncing terms created for each blog with the global terms table.\n *\n * @since 3.0.0\n *\n * @see term_id_filter\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int    $term_id    An ID for a term on the current blog.\n * @param string $deprecated Not used.\n * @return int An ID from the global terms table mapped from $term_id.\n */\nfunction global_terms( $term_id, $deprecated = '' ) {\n\tglobal $wpdb;\n\tstatic $global_terms_recurse = null;\n\n\tif ( ! global_terms_enabled() ) {\n\t\treturn $term_id;\n\t}\n\n\t// Prevent a race condition.\n\t$recurse_start = false;\n\tif ( null === $global_terms_recurse ) {\n\t\t$recurse_start        = true;\n\t\t$global_terms_recurse = 1;\n\t} elseif ( 10 < $global_terms_recurse++ ) {\n\t\treturn $term_id;\n\t}\n\n\t$term_id = intval( $term_id );\n\t$c       = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $wpdb->terms WHERE term_id = %d\", $term_id ) );\n\n\t$global_id = $wpdb->get_var( $wpdb->prepare( \"SELECT cat_ID FROM $wpdb->sitecategories WHERE category_nicename = %s\", $c->slug ) );\n\tif ( null == $global_id ) {\n\t\t$used_global_id = $wpdb->get_var( $wpdb->prepare( \"SELECT cat_ID FROM $wpdb->sitecategories WHERE cat_ID = %d\", $c->term_id ) );\n\t\tif ( null == $used_global_id ) {\n\t\t\t$wpdb->insert(\n\t\t\t\t$wpdb->sitecategories,\n\t\t\t\tarray(\n\t\t\t\t\t'cat_ID'            => $term_id,\n\t\t\t\t\t'cat_name'          => $c->name,\n\t\t\t\t\t'category_nicename' => $c->slug,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$global_id = $wpdb->insert_id;\n\t\t\tif ( empty( $global_id ) ) {\n\t\t\t\treturn $term_id;\n\t\t\t}\n\t\t} else {\n\t\t\t$max_global_id = $wpdb->get_var( \"SELECT MAX(cat_ID) FROM $wpdb->sitecategories\" );\n\t\t\t$max_local_id  = $wpdb->get_var( \"SELECT MAX(term_id) FROM $wpdb->terms\" );\n\t\t\t$new_global_id = max( $max_global_id, $max_local_id ) + mt_rand( 100, 400 );\n\t\t\t$wpdb->insert(\n\t\t\t\t$wpdb->sitecategories,\n\t\t\t\tarray(\n\t\t\t\t\t'cat_ID'            => $new_global_id,\n\t\t\t\t\t'cat_name'          => $c->name,\n\t\t\t\t\t'category_nicename' => $c->slug,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$global_id = $wpdb->insert_id;\n\t\t}\n\t} elseif ( $global_id != $term_id ) {\n\t\t$local_id = $wpdb->get_var( $wpdb->prepare( \"SELECT term_id FROM $wpdb->terms WHERE term_id = %d\", $global_id ) );\n\t\tif ( null != $local_id ) {\n\t\t\tglobal_terms( $local_id );\n\t\t\tif ( 10 < $global_terms_recurse ) {\n\t\t\t\t$global_id = $term_id;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( $global_id != $term_id ) {\n\t\tif ( get_option( 'default_category' ) == $term_id ) {\n\t\t\tupdate_option( 'default_category', $global_id );\n\t\t}\n\n\t\t$wpdb->update( $wpdb->terms, array( 'term_id' => $global_id ), array( 'term_id' => $term_id ) );\n\t\t$wpdb->update( $wpdb->term_taxonomy, array( 'term_id' => $global_id ), array( 'term_id' => $term_id ) );\n\t\t$wpdb->update( $wpdb->term_taxonomy, array( 'parent' => $global_id ), array( 'parent' => $term_id ) );\n\n\t\tclean_term_cache( $term_id );\n\t}\n\tif ( $recurse_start ) {\n\t\t$global_terms_recurse = null;\n\t}\n\n\treturn $global_id;\n}\n\n/**\n * Ensure that the current site's domain is listed in the allowed redirect host list.\n *\n * @see wp_validate_redirect()\n * @since MU (3.0.0)\n *\n * @param array|string $deprecated Not used.\n * @return string[] {\n *     An array containing the current site's domain.\n *\n *     @type string $0 The current site's domain.\n * }\n */\nfunction redirect_this_site( $deprecated = '' ) {\n\treturn array( get_network()->domain );\n}\n\n/**\n * Check whether an upload is too big.\n *\n * @since MU (3.0.0)\n *\n * @blessed\n *\n * @param array $upload\n * @return string|array If the upload is under the size limit, $upload is returned. Otherwise returns an error message.\n */\nfunction upload_is_file_too_big( $upload ) {\n\tif ( ! is_array( $upload ) || defined( 'WP_IMPORTING' ) || get_site_option( 'upload_space_check_disabled' ) ) {\n\t\treturn $upload;\n\t}\n\n\tif ( strlen( $upload['bits'] ) > ( KB_IN_BYTES * get_site_option( 'fileupload_maxk', 1500 ) ) ) {\n\t\t/* translators: %s: Maximum allowed file size in kilobytes. */\n\t\treturn sprintf( __( 'This file is too big. Files must be less than %s KB in size.' ) . '<br />', get_site_option( 'fileupload_maxk', 1500 ) );\n\t}\n\n\treturn $upload;\n}\n\n/**\n * Add a nonce field to the signup page.\n *\n * @since MU (3.0.0)\n */\nfunction signup_nonce_fields() {\n\t$id = mt_rand();\n\techo \"<input type='hidden' name='signup_form_id' value='{$id}' />\";\n\twp_nonce_field( 'signup_form_' . $id, '_signup_form', false );\n}\n\n/**\n * Process the signup nonce created in signup_nonce_fields().\n *\n * @since MU (3.0.0)\n *\n * @param array $result\n * @return array\n */\nfunction signup_nonce_check( $result ) {\n\tif ( ! strpos( $_SERVER['PHP_SELF'], 'wp-signup.php' ) ) {\n\t\treturn $result;\n\t}\n\n\tif ( ! wp_verify_nonce( $_POST['_signup_form'], 'signup_form_' . $_POST['signup_form_id'] ) ) {\n\t\t$result['errors']->add( 'invalid_nonce', __( 'Unable to submit this form, please try again.' ) );\n\t}\n\n\treturn $result;\n}\n\n/**\n * Correct 404 redirects when NOBLOGREDIRECT is defined.\n *\n * @since MU (3.0.0)\n */\nfunction maybe_redirect_404() {\n\tif ( is_main_site() && is_404() && defined( 'NOBLOGREDIRECT' ) ) {\n\t\t/**\n\t\t * Filters the redirect URL for 404s on the main site.\n\t\t *\n\t\t * The filter is only evaluated if the NOBLOGREDIRECT constant is defined.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string $no_blog_redirect The redirect URL defined in NOBLOGREDIRECT.\n\t\t */\n\t\t$destination = apply_filters( 'blog_redirect_404', NOBLOGREDIRECT );\n\n\t\tif ( $destination ) {\n\t\t\tif ( '%siteurl%' === $destination ) {\n\t\t\t\t$destination = network_home_url();\n\t\t\t}\n\n\t\t\twp_redirect( $destination );\n\t\t\texit;\n\t\t}\n\t}\n}\n\n/**\n * Add a new user to a blog by visiting /newbloguser/{key}/.\n *\n * This will only work when the user's details are saved as an option\n * keyed as 'new_user_{key}', where '{key}' is a hash generated for the user to be\n * added, as when a user is invited through the regular WP Add User interface.\n *\n * @since MU (3.0.0)\n */\nfunction maybe_add_existing_user_to_blog() {\n\tif ( false === strpos( $_SERVER['REQUEST_URI'], '/newbloguser/' ) ) {\n\t\treturn;\n\t}\n\n\t$parts = explode( '/', $_SERVER['REQUEST_URI'] );\n\t$key   = array_pop( $parts );\n\n\tif ( '' === $key ) {\n\t\t$key = array_pop( $parts );\n\t}\n\n\t$details = get_option( 'new_user_' . $key );\n\tif ( ! empty( $details ) ) {\n\t\tdelete_option( 'new_user_' . $key );\n\t}\n\n\tif ( empty( $details ) || is_wp_error( add_existing_user_to_blog( $details ) ) ) {\n\t\twp_die(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Home URL. */\n\t\t\t\t__( 'An error occurred adding you to this site. Back to the <a href=\"%s\">homepage</a>.' ),\n\t\t\t\thome_url()\n\t\t\t)\n\t\t);\n\t}\n\n\twp_die(\n\t\tsprintf(\n\t\t\t/* translators: 1: Home URL, 2: Admin URL. */\n\t\t\t__( 'You have been added to this site. Please visit the <a href=\"%1$s\">homepage</a> or <a href=\"%2$s\">log in</a> using your username and password.' ),\n\t\t\thome_url(),\n\t\t\tadmin_url()\n\t\t),\n\t\t__( 'WordPress &rsaquo; Success' ),\n\t\tarray( 'response' => 200 )\n\t);\n}\n\n/**\n * Add a user to a blog based on details from maybe_add_existing_user_to_blog().\n *\n * @since MU (3.0.0)\n *\n * @param array $details {\n *     User details. Must at least contain values for the keys listed below.\n *\n *     @type int    $user_id The ID of the user being added to the current blog.\n *     @type string $role    The role to be assigned to the user.\n * }\n * @return true|WP_Error|void True on success or a WP_Error object if the user doesn't exist\n *                            or could not be added. Void if $details array was not provided.\n */\nfunction add_existing_user_to_blog( $details = false ) {\n\tif ( is_array( $details ) ) {\n\t\t$blog_id = get_current_blog_id();\n\t\t$result  = add_user_to_blog( $blog_id, $details['user_id'], $details['role'] );\n\n\t\t/**\n\t\t * Fires immediately after an existing user is added to a site.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t *\n\t\t * @param int           $user_id User ID.\n\t\t * @param true|WP_Error $result  True on success or a WP_Error object if the user doesn't exist\n\t\t *                               or could not be added.\n\t\t */\n\t\tdo_action( 'added_existing_user', $details['user_id'], $result );\n\n\t\treturn $result;\n\t}\n}\n\n/**\n * Adds a newly created user to the appropriate blog\n *\n * To add a user in general, use add_user_to_blog(). This function\n * is specifically hooked into the {@see 'wpmu_activate_user'} action.\n *\n * @since MU (3.0.0)\n *\n * @see add_user_to_blog()\n *\n * @param int    $user_id  User ID.\n * @param string $password User password. Ignored.\n * @param array  $meta     Signup meta data.\n */\nfunction add_new_user_to_blog( $user_id, $password, $meta ) {\n\tif ( ! empty( $meta['add_to_blog'] ) ) {\n\t\t$blog_id = $meta['add_to_blog'];\n\t\t$role    = $meta['new_role'];\n\t\tremove_user_from_blog( $user_id, get_network()->site_id ); // Remove user from main blog.\n\n\t\t$result = add_user_to_blog( $blog_id, $user_id, $role );\n\n\t\tif ( ! is_wp_error( $result ) ) {\n\t\t\tupdate_user_meta( $user_id, 'primary_blog', $blog_id );\n\t\t}\n\t}\n}\n\n/**\n * Correct From host on outgoing mail to match the site domain\n *\n * @since MU (3.0.0)\n *\n * @param PHPMailer $phpmailer The PHPMailer instance (passed by reference).\n */\nfunction fix_phpmailer_messageid( $phpmailer ) {\n\t$phpmailer->Hostname = get_network()->domain;\n}\n\n/**\n * Check to see whether a user is marked as a spammer, based on user login.\n *\n * @since MU (3.0.0)\n *\n * @param string|WP_User $user Optional. Defaults to current user. WP_User object,\n *                             or user login name as a string.\n * @return bool\n */\nfunction is_user_spammy( $user = null ) {\n\tif ( ! ( $user instanceof WP_User ) ) {\n\t\tif ( $user ) {\n\t\t\t$user = get_user_by( 'login', $user );\n\t\t} else {\n\t\t\t$user = wp_get_current_user();\n\t\t}\n\t}\n\n\treturn $user && isset( $user->spam ) && 1 == $user->spam;\n}\n\n/**\n * Update this blog's 'public' setting in the global blogs table.\n *\n * Public blogs have a setting of 1, private blogs are 0.\n *\n * @since MU (3.0.0)\n *\n * @param int $old_value\n * @param int $value     The new public value\n */\nfunction update_blog_public( $old_value, $value ) {\n\tupdate_blog_status( get_current_blog_id(), 'public', (int) $value );\n}\n\n/**\n * Check whether users can self-register, based on Network settings.\n *\n * @since MU (3.0.0)\n *\n * @return bool\n */\nfunction users_can_register_signup_filter() {\n\t$registration = get_site_option( 'registration' );\n\treturn ( 'all' === $registration || 'user' === $registration );\n}\n\n/**\n * Ensure that the welcome message is not empty. Currently unused.\n *\n * @since MU (3.0.0)\n *\n * @param string $text\n * @return string\n */\nfunction welcome_user_msg_filter( $text ) {\n\tif ( ! $text ) {\n\t\tremove_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' );\n\n\t\t/* translators: Do not translate USERNAME, PASSWORD, LOGINLINK, SITE_NAME: those are placeholders. */\n\t\t$text = __(\n\t\t\t'Howdy USERNAME,\n\nYour new account is set up.\n\nYou can log in with the following information:\nUsername: USERNAME\nPassword: PASSWORD\nLOGINLINK\n\nThanks!\n\n--The Team @ SITE_NAME'\n\t\t);\n\t\tupdate_site_option( 'welcome_user_email', $text );\n\t}\n\treturn $text;\n}\n\n/**\n * Whether to force SSL on content.\n *\n * @since 2.8.5\n *\n * @param bool $force\n * @return bool True if forced, false if not forced.\n */\nfunction force_ssl_content( $force = '' ) {\n\tstatic $forced_content = false;\n\n\tif ( ! $force ) {\n\t\t$old_forced     = $forced_content;\n\t\t$forced_content = $force;\n\t\treturn $old_forced;\n\t}\n\n\treturn $forced_content;\n}\n\n/**\n * Formats a URL to use https.\n *\n * Useful as a filter.\n *\n * @since 2.8.5\n *\n * @param string $url URL\n * @return string URL with https as the scheme\n */\nfunction filter_SSL( $url ) {  // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid\n\tif ( ! is_string( $url ) ) {\n\t\treturn get_bloginfo( 'url' ); // Return home blog URL with proper scheme.\n\t}\n\n\tif ( force_ssl_content() && is_ssl() ) {\n\t\t$url = set_url_scheme( $url, 'https' );\n\t}\n\n\treturn $url;\n}\n\n/**\n * Schedule update of the network-wide counts for the current network.\n *\n * @since 3.1.0\n */\nfunction wp_schedule_update_network_counts() {\n\tif ( ! is_main_site() ) {\n\t\treturn;\n\t}\n\n\tif ( ! wp_next_scheduled( 'update_network_counts' ) && ! wp_installing() ) {\n\t\twp_schedule_event( time(), 'twicedaily', 'update_network_counts' );\n\t}\n}\n\n/**\n * Update the network-wide counts for the current network.\n *\n * @since 3.1.0\n * @since 4.8.0 The `$network_id` parameter has been added.\n *\n * @param int|null $network_id ID of the network. Default is the current network.\n */\nfunction wp_update_network_counts( $network_id = null ) {\n\twp_update_network_user_counts( $network_id );\n\twp_update_network_site_counts( $network_id );\n}\n\n/**\n * Update the count of sites for the current network.\n *\n * If enabled through the {@see 'enable_live_network_counts'} filter, update the sites count\n * on a network when a site is created or its status is updated.\n *\n * @since 3.7.0\n * @since 4.8.0 The `$network_id` parameter has been added.\n *\n * @param int|null $network_id ID of the network. Default is the current network.\n */\nfunction wp_maybe_update_network_site_counts( $network_id = null ) {\n\t$is_small_network = ! wp_is_large_network( 'sites', $network_id );\n\n\t/**\n\t * Filters whether to update network site or user counts when a new site is created.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @see wp_is_large_network()\n\t *\n\t * @param bool   $small_network Whether the network is considered small.\n\t * @param string $context       Context. Either 'users' or 'sites'.\n\t */\n\tif ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'sites' ) ) {\n\t\treturn;\n\t}\n\n\twp_update_network_site_counts( $network_id );\n}\n\n/**\n * Update the network-wide users count.\n *\n * If enabled through the {@see 'enable_live_network_counts'} filter, update the users count\n * on a network when a user is created or its status is updated.\n *\n * @since 3.7.0\n * @since 4.8.0 The `$network_id` parameter has been added.\n *\n * @param int|null $network_id ID of the network. Default is the current network.\n */\nfunction wp_maybe_update_network_user_counts( $network_id = null ) {\n\t$is_small_network = ! wp_is_large_network( 'users', $network_id );\n\n\t/** This filter is documented in wp-includes/ms-functions.php */\n\tif ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) ) {\n\t\treturn;\n\t}\n\n\twp_update_network_user_counts( $network_id );\n}\n\n/**\n * Update the network-wide site count.\n *\n * @since 3.7.0\n * @since 4.8.0 The `$network_id` parameter has been added.\n *\n * @param int|null $network_id ID of the network. Default is the current network.\n */\nfunction wp_update_network_site_counts( $network_id = null ) {\n\t$network_id = (int) $network_id;\n\tif ( ! $network_id ) {\n\t\t$network_id = get_current_network_id();\n\t}\n\n\t$count = get_sites(\n\t\tarray(\n\t\t\t'network_id'             => $network_id,\n\t\t\t'spam'                   => 0,\n\t\t\t'deleted'                => 0,\n\t\t\t'archived'               => 0,\n\t\t\t'count'                  => true,\n\t\t\t'update_site_meta_cache' => false,\n\t\t)\n\t);\n\n\tupdate_network_option( $network_id, 'blog_count', $count );\n}\n\n/**\n * Update the network-wide user count.\n *\n * @since 3.7.0\n * @since 4.8.0 The `$network_id` parameter has been added.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int|null $network_id ID of the network. Default is the current network.\n */\nfunction wp_update_network_user_counts( $network_id = null ) {\n\tglobal $wpdb;\n\n\t$count = $wpdb->get_var( \"SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'\" );\n\tupdate_network_option( $network_id, 'user_count', $count );\n}\n\n/**\n * Returns the space used by the current site.\n *\n * @since 3.5.0\n *\n * @return int Used space in megabytes.\n */\nfunction get_space_used() {\n\t/**\n\t * Filters the amount of storage space used by the current site, in megabytes.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param int|false $space_used The amount of used space, in megabytes. Default false.\n\t */\n\t$space_used = apply_filters( 'pre_get_space_used', false );\n\tif ( false === $space_used ) {\n\t\t$upload_dir = wp_upload_dir();\n\t\t$space_used = get_dirsize( $upload_dir['basedir'] ) / MB_IN_BYTES;\n\t}\n\n\treturn $space_used;\n}\n\n/**\n * Returns the upload quota for the current blog.\n *\n * @since MU (3.0.0)\n *\n * @return int Quota in megabytes\n */\nfunction get_space_allowed() {\n\t$space_allowed = get_option( 'blog_upload_space' );\n\n\tif ( ! is_numeric( $space_allowed ) ) {\n\t\t$space_allowed = get_site_option( 'blog_upload_space' );\n\t}\n\n\tif ( ! is_numeric( $space_allowed ) ) {\n\t\t$space_allowed = 100;\n\t}\n\n\t/**\n\t * Filters the upload quota for the current site.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param int $space_allowed Upload quota in megabytes for the current blog.\n\t */\n\treturn apply_filters( 'get_space_allowed', $space_allowed );\n}\n\n/**\n * Determines if there is any upload space left in the current blog's quota.\n *\n * @since 3.0.0\n *\n * @return int of upload space available in bytes\n */\nfunction get_upload_space_available() {\n\t$allowed = get_space_allowed();\n\tif ( $allowed < 0 ) {\n\t\t$allowed = 0;\n\t}\n\t$space_allowed = $allowed * MB_IN_BYTES;\n\tif ( get_site_option( 'upload_space_check_disabled' ) ) {\n\t\treturn $space_allowed;\n\t}\n\n\t$space_used = get_space_used() * MB_IN_BYTES;\n\n\tif ( ( $space_allowed - $space_used ) <= 0 ) {\n\t\treturn 0;\n\t}\n\n\treturn $space_allowed - $space_used;\n}\n\n/**\n * Determines if there is any upload space left in the current blog's quota.\n *\n * @since 3.0.0\n * @return bool True if space is available, false otherwise.\n */\nfunction is_upload_space_available() {\n\tif ( get_site_option( 'upload_space_check_disabled' ) ) {\n\t\treturn true;\n\t}\n\n\treturn (bool) get_upload_space_available();\n}\n\n/**\n * Filters the maximum upload file size allowed, in bytes.\n *\n * @since 3.0.0\n *\n * @param int $size Upload size limit in bytes.\n * @return int Upload size limit in bytes.\n */\nfunction upload_size_limit_filter( $size ) {\n\t$fileupload_maxk = KB_IN_BYTES * get_site_option( 'fileupload_maxk', 1500 );\n\tif ( get_site_option( 'upload_space_check_disabled' ) ) {\n\t\treturn min( $size, $fileupload_maxk );\n\t}\n\n\treturn min( $size, $fileupload_maxk, get_upload_space_available() );\n}\n\n/**\n * Whether or not we have a large network.\n *\n * The default criteria for a large network is either more than 10,000 users or more than 10,000 sites.\n * Plugins can alter this criteria using the {@see 'wp_is_large_network'} filter.\n *\n * @since 3.3.0\n * @since 4.8.0 The `$network_id` parameter has been added.\n *\n * @param string   $using      'sites or 'users'. Default is 'sites'.\n * @param int|null $network_id ID of the network. Default is the current network.\n * @return bool True if the network meets the criteria for large. False otherwise.\n */\nfunction wp_is_large_network( $using = 'sites', $network_id = null ) {\n\t$network_id = (int) $network_id;\n\tif ( ! $network_id ) {\n\t\t$network_id = get_current_network_id();\n\t}\n\n\tif ( 'users' === $using ) {\n\t\t$count = get_user_count( $network_id );\n\t\t/**\n\t\t * Filters whether the network is considered large.\n\t\t *\n\t\t * @since 3.3.0\n\t\t * @since 4.8.0 The `$network_id` parameter has been added.\n\t\t *\n\t\t * @param bool   $is_large_network Whether the network has more than 10000 users or sites.\n\t\t * @param string $component        The component to count. Accepts 'users', or 'sites'.\n\t\t * @param int    $count            The count of items for the component.\n\t\t * @param int    $network_id       The ID of the network being checked.\n\t\t */\n\t\treturn apply_filters( 'wp_is_large_network', $count > 10000, 'users', $count, $network_id );\n\t}\n\n\t$count = get_blog_count( $network_id );\n\n\t/** This filter is documented in wp-includes/ms-functions.php */\n\treturn apply_filters( 'wp_is_large_network', $count > 10000, 'sites', $count, $network_id );\n}\n\n/**\n * Retrieves a list of reserved site on a sub-directory Multisite installation.\n *\n * @since 4.4.0\n *\n * @return string[] Array of reserved names.\n */\nfunction get_subdirectory_reserved_names() {\n\t$names = array(\n\t\t'page',\n\t\t'comments',\n\t\t'blog',\n\t\t'files',\n\t\t'feed',\n\t\t'wp-admin',\n\t\t'wp-content',\n\t\t'wp-includes',\n\t\t'wp-json',\n\t\t'embed',\n\t);\n\n\t/**\n\t * Filters reserved site names on a sub-directory Multisite installation.\n\t *\n\t * @since 3.0.0\n\t * @since 4.4.0 'wp-admin', 'wp-content', 'wp-includes', 'wp-json', and 'embed' were added\n\t *              to the reserved names list.\n\t *\n\t * @param string[] $subdirectory_reserved_names Array of reserved names.\n\t */\n\treturn apply_filters( 'subdirectory_reserved_names', $names );\n}\n\n/**\n * Send a confirmation request email when a change of network admin email address is attempted.\n *\n * The new network admin address will not become active until confirmed.\n *\n * @since 4.9.0\n *\n * @param string $old_value The old network admin email address.\n * @param string $value     The proposed new network admin email address.\n */\nfunction update_network_option_new_admin_email( $old_value, $value ) {\n\tif ( get_site_option( 'admin_email' ) === $value || ! is_email( $value ) ) {\n\t\treturn;\n\t}\n\n\t$hash            = md5( $value . time() . mt_rand() );\n\t$new_admin_email = array(\n\t\t'hash'     => $hash,\n\t\t'newemail' => $value,\n\t);\n\tupdate_site_option( 'network_admin_hash', $new_admin_email );\n\n\t$switched_locale = switch_to_locale( get_user_locale() );\n\n\t/* translators: Do not translate USERNAME, ADMIN_URL, EMAIL, SITENAME, SITEURL: those are placeholders. */\n\t$email_text = __(\n\t\t'Howdy ###USERNAME###,\n\nYou recently requested to have the network admin email address on\nyour network changed.\n\nIf this is correct, please click on the following link to change it:\n###ADMIN_URL###\n\nYou can safely ignore and delete this email if you do not want to\ntake this action.\n\nThis email has been sent to ###EMAIL###\n\nRegards,\nAll at ###SITENAME###\n###SITEURL###'\n\t);\n\n\t/**\n\t * Filters the text of the email sent when a change of network admin email address is attempted.\n\t *\n\t * The following strings have a special meaning and will get replaced dynamically:\n\t * ###USERNAME###  The current user's username.\n\t * ###ADMIN_URL### The link to click on to confirm the email change.\n\t * ###EMAIL###     The proposed new network admin email address.\n\t * ###SITENAME###  The name of the network.\n\t * ###SITEURL###   The URL to the network.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param string $email_text      Text in the email.\n\t * @param array  $new_admin_email {\n\t *     Data relating to the new network admin email address.\n\t *\n\t *     @type string $hash     The secure hash used in the confirmation link URL.\n\t *     @type string $newemail The proposed new network admin email address.\n\t * }\n\t */\n\t$content = apply_filters( 'new_network_admin_email_content', $email_text, $new_admin_email );\n\n\t$current_user = wp_get_current_user();\n\t$content      = str_replace( '###USERNAME###', $current_user->user_login, $content );\n\t$content      = str_replace( '###ADMIN_URL###', esc_url( network_admin_url( 'settings.php?network_admin_hash=' . $hash ) ), $content );\n\t$content      = str_replace( '###EMAIL###', $value, $content );\n\t$content      = str_replace( '###SITENAME###', wp_specialchars_decode( get_site_option( 'site_name' ), ENT_QUOTES ), $content );\n\t$content      = str_replace( '###SITEURL###', network_home_url(), $content );\n\n\twp_mail(\n\t\t$value,\n\t\tsprintf(\n\t\t\t/* translators: Email change notification email subject. %s: Network title. */\n\t\t\t__( '[%s] Network Admin Email Change Request' ),\n\t\t\twp_specialchars_decode( get_site_option( 'site_name' ), ENT_QUOTES )\n\t\t),\n\t\t$content\n\t);\n\n\tif ( $switched_locale ) {\n\t\trestore_previous_locale();\n\t}\n}\n\n/**\n * Send an email to the old network admin email address when the network admin email address changes.\n *\n * @since 4.9.0\n *\n * @param string $option_name The relevant database option name.\n * @param string $new_email   The new network admin email address.\n * @param string $old_email   The old network admin email address.\n * @param int    $network_id  ID of the network.\n */\nfunction wp_network_admin_email_change_notification( $option_name, $new_email, $old_email, $network_id ) {\n\t$send = true;\n\n\t// Don't send the notification to the default 'admin_email' value.\n\tif ( 'you@example.com' === $old_email ) {\n\t\t$send = false;\n\t}\n\n\t/**\n\t * Filters whether to send the network admin email change notification email.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param bool   $send       Whether to send the email notification.\n\t * @param string $old_email  The old network admin email address.\n\t * @param string $new_email  The new network admin email address.\n\t * @param int    $network_id ID of the network.\n\t */\n\t$send = apply_filters( 'send_network_admin_email_change_email', $send, $old_email, $new_email, $network_id );\n\n\tif ( ! $send ) {\n\t\treturn;\n\t}\n\n\t/* translators: Do not translate OLD_EMAIL, NEW_EMAIL, SITENAME, SITEURL: those are placeholders. */\n\t$email_change_text = __(\n\t\t'Hi,\n\nThis notice confirms that the network admin email address was changed on ###SITENAME###.\n\nThe new network admin email address is ###NEW_EMAIL###.\n\nThis email has been sent to ###OLD_EMAIL###\n\nRegards,\nAll at ###SITENAME###\n###SITEURL###'\n\t);\n\n\t$email_change_email = array(\n\t\t'to'      => $old_email,\n\t\t/* translators: Network admin email change notification email subject. %s: Network title. */\n\t\t'subject' => __( '[%s] Network Admin Email Changed' ),\n\t\t'message' => $email_change_text,\n\t\t'headers' => '',\n\t);\n\t// Get network name.\n\t$network_name = wp_specialchars_decode( get_site_option( 'site_name' ), ENT_QUOTES );\n\n\t/**\n\t * Filters the contents of the email notification sent when the network admin email address is changed.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param array $email_change_email {\n\t *            Used to build wp_mail().\n\t *\n\t *            @type string $to      The intended recipient.\n\t *            @type string $subject The subject of the email.\n\t *            @type string $message The content of the email.\n\t *                The following strings have a special meaning and will get replaced dynamically:\n\t *                - ###OLD_EMAIL### The old network admin email address.\n\t *                - ###NEW_EMAIL### The new network admin email address.\n\t *                - ###SITENAME###  The name of the network.\n\t *                - ###SITEURL###   The URL to the site.\n\t *            @type string $headers Headers.\n\t *        }\n\t * @param string $old_email  The old network admin email address.\n\t * @param string $new_email  The new network admin email address.\n\t * @param int    $network_id ID of the network.\n\t */\n\t$email_change_email = apply_filters( 'network_admin_email_change_email', $email_change_email, $old_email, $new_email, $network_id );\n\n\t$email_change_email['message'] = str_replace( '###OLD_EMAIL###', $old_email, $email_change_email['message'] );\n\t$email_change_email['message'] = str_replace( '###NEW_EMAIL###', $new_email, $email_change_email['message'] );\n\t$email_change_email['message'] = str_replace( '###SITENAME###', $network_name, $email_change_email['message'] );\n\t$email_change_email['message'] = str_replace( '###SITEURL###', home_url(), $email_change_email['message'] );\n\n\twp_mail(\n\t\t$email_change_email['to'],\n\t\tsprintf(\n\t\t\t$email_change_email['subject'],\n\t\t\t$network_name\n\t\t),\n\t\t$email_change_email['message'],\n\t\t$email_change_email['headers']\n\t);\n}\n", "num_lines": 2871}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * These functions are needed to load Multisite.\n *\n * @since 3.0.0\n *\n * @package WordPress\n * @subpackage Multisite\n */\n\n/**\n * Whether a subdomain configuration is enabled.\n *\n * @since 3.0.0\n *\n * @return bool True if subdomain configuration is enabled, false otherwise.\n */\nfunction is_subdomain_install() {\n\tif ( defined( 'SUBDOMAIN_INSTALL' ) ) {\n\t\treturn SUBDOMAIN_INSTALL;\n\t}\n\n\treturn ( defined( 'VHOST' ) && 'yes' === VHOST );\n}\n\n/**\n * Returns array of network plugin files to be included in global scope.\n *\n * The default directory is wp-content/plugins. To change the default directory\n * manually, define `WP_PLUGIN_DIR` and `WP_PLUGIN_URL` in `wp-config.php`.\n *\n * @access private\n * @since 3.1.0\n *\n * @return string[] Array of absolute paths to files to include.\n */\nfunction wp_get_active_network_plugins() {\n\t$active_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );\n\tif ( empty( $active_plugins ) ) {\n\t\treturn array();\n\t}\n\n\t$plugins        = array();\n\t$active_plugins = array_keys( $active_plugins );\n\tsort( $active_plugins );\n\n\tforeach ( $active_plugins as $plugin ) {\n\t\tif ( ! validate_file( $plugin )                     // $plugin must validate as file.\n\t\t\t&& '.php' === substr( $plugin, -4 )             // $plugin must end with '.php'.\n\t\t\t&& file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist.\n\t\t\t) {\n\t\t\t$plugins[] = WP_PLUGIN_DIR . '/' . $plugin;\n\t\t}\n\t}\n\n\treturn $plugins;\n}\n\n/**\n * Checks status of current blog.\n *\n * Checks if the blog is deleted, inactive, archived, or spammed.\n *\n * Dies with a default message if the blog does not pass the check.\n *\n * To change the default message when a blog does not pass the check,\n * use the wp-content/blog-deleted.php, blog-inactive.php and\n * blog-suspended.php drop-ins.\n *\n * @since 3.0.0\n *\n * @return true|string Returns true on success, or drop-in file to include.\n */\nfunction ms_site_check() {\n\n\t/**\n\t * Filters checking the status of the current blog.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param bool|null $check Whether to skip the blog status check. Default null.\n\t */\n\t$check = apply_filters( 'ms_site_check', null );\n\tif ( null !== $check ) {\n\t\treturn true;\n\t}\n\n\t// Allow super admins to see blocked sites.\n\tif ( is_super_admin() ) {\n\t\treturn true;\n\t}\n\n\t$blog = get_site();\n\n\tif ( '1' == $blog->deleted ) {\n\t\tif ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) ) {\n\t\t\treturn WP_CONTENT_DIR . '/blog-deleted.php';\n\t\t} else {\n\t\t\twp_die( __( 'This site is no longer available.' ), '', array( 'response' => 410 ) );\n\t\t}\n\t}\n\n\tif ( '2' == $blog->deleted ) {\n\t\tif ( file_exists( WP_CONTENT_DIR . '/blog-inactive.php' ) ) {\n\t\t\treturn WP_CONTENT_DIR . '/blog-inactive.php';\n\t\t} else {\n\t\t\t$admin_email = str_replace( '@', ' AT ', get_site_option( 'admin_email', 'support@' . get_network()->domain ) );\n\t\t\twp_die(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Admin email link. */\n\t\t\t\t\t__( 'This site has not been activated yet. If you are having problems activating your site, please contact %s.' ),\n\t\t\t\t\tsprintf( '<a href=\"mailto:%1$s\">%1$s</a>', $admin_email )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\tif ( '1' == $blog->archived || '1' == $blog->spam ) {\n\t\tif ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) ) {\n\t\t\treturn WP_CONTENT_DIR . '/blog-suspended.php';\n\t\t} else {\n\t\t\twp_die( __( 'This site has been archived or suspended.' ), '', array( 'response' => 410 ) );\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Retrieve the closest matching network for a domain and path.\n *\n * @since 3.9.0\n *\n * @internal In 4.4.0, converted to a wrapper for WP_Network::get_by_path()\n *\n * @param string   $domain   Domain to check.\n * @param string   $path     Path to check.\n * @param int|null $segments Path segments to use. Defaults to null, or the full path.\n * @return WP_Network|false Network object if successful. False when no network is found.\n */\nfunction get_network_by_path( $domain, $path, $segments = null ) {\n\treturn WP_Network::get_by_path( $domain, $path, $segments );\n}\n\n/**\n * Retrieves the closest matching site object by its domain and path.\n *\n * This will not necessarily return an exact match for a domain and path. Instead, it\n * breaks the domain and path into pieces that are then used to match the closest\n * possibility from a query.\n *\n * The intent of this method is to match a site object during bootstrap for a\n * requested site address\n *\n * @since 3.9.0\n * @since 4.7.0 Updated to always return a `WP_Site` object.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string   $domain   Domain to check.\n * @param string   $path     Path to check.\n * @param int|null $segments Path segments to use. Defaults to null, or the full path.\n * @return WP_Site|false Site object if successful. False when no site is found.\n */\nfunction get_site_by_path( $domain, $path, $segments = null ) {\n\t$path_segments = array_filter( explode( '/', trim( $path, '/' ) ) );\n\n\t/**\n\t * Filters the number of path segments to consider when searching for a site.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param int|null $segments The number of path segments to consider. WordPress by default looks at\n\t *                           one path segment following the network path. The function default of\n\t *                           null only makes sense when you know the requested path should match a site.\n\t * @param string   $domain   The requested domain.\n\t * @param string   $path     The requested path, in full.\n\t */\n\t$segments = apply_filters( 'site_by_path_segments_count', $segments, $domain, $path );\n\n\tif ( null !== $segments && count( $path_segments ) > $segments ) {\n\t\t$path_segments = array_slice( $path_segments, 0, $segments );\n\t}\n\n\t$paths = array();\n\n\twhile ( count( $path_segments ) ) {\n\t\t$paths[] = '/' . implode( '/', $path_segments ) . '/';\n\t\tarray_pop( $path_segments );\n\t}\n\n\t$paths[] = '/';\n\n\t/**\n\t * Determine a site by its domain and path.\n\t *\n\t * This allows one to short-circuit the default logic, perhaps by\n\t * replacing it with a routine that is more optimal for your setup.\n\t *\n\t * Return null to avoid the short-circuit. Return false if no site\n\t * can be found at the requested domain and path. Otherwise, return\n\t * a site object.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param null|false|WP_Site $site     Site value to return by path. Default null\n\t *                                     to continue retrieving the site.\n\t * @param string             $domain   The requested domain.\n\t * @param string             $path     The requested path, in full.\n\t * @param int|null           $segments The suggested number of paths to consult.\n\t *                                     Default null, meaning the entire path was to be consulted.\n\t * @param string[]           $paths    The paths to search for, based on $path and $segments.\n\t */\n\t$pre = apply_filters( 'pre_get_site_by_path', null, $domain, $path, $segments, $paths );\n\tif ( null !== $pre ) {\n\t\tif ( false !== $pre && ! $pre instanceof WP_Site ) {\n\t\t\t$pre = new WP_Site( $pre );\n\t\t}\n\t\treturn $pre;\n\t}\n\n\t/*\n\t * @todo\n\t * Caching, etc. Consider alternative optimization routes,\n\t * perhaps as an opt-in for plugins, rather than using the pre_* filter.\n\t * For example: The segments filter can expand or ignore paths.\n\t * If persistent caching is enabled, we could query the DB for a path <> '/'\n\t * then cache whether we can just always ignore paths.\n\t */\n\n\t// Either www or non-www is supported, not both. If a www domain is requested,\n\t// query for both to provide the proper redirect.\n\t$domains = array( $domain );\n\tif ( 'www.' === substr( $domain, 0, 4 ) ) {\n\t\t$domains[] = substr( $domain, 4 );\n\t}\n\n\t$args = array(\n\t\t'number'                 => 1,\n\t\t'update_site_meta_cache' => false,\n\t);\n\n\tif ( count( $domains ) > 1 ) {\n\t\t$args['domain__in']               = $domains;\n\t\t$args['orderby']['domain_length'] = 'DESC';\n\t} else {\n\t\t$args['domain'] = array_shift( $domains );\n\t}\n\n\tif ( count( $paths ) > 1 ) {\n\t\t$args['path__in']               = $paths;\n\t\t$args['orderby']['path_length'] = 'DESC';\n\t} else {\n\t\t$args['path'] = array_shift( $paths );\n\t}\n\n\t$result = get_sites( $args );\n\t$site   = array_shift( $result );\n\n\tif ( $site ) {\n\t\treturn $site;\n\t}\n\n\treturn false;\n}\n\n/**\n * Identifies the network and site of a requested domain and path and populates the\n * corresponding network and site global objects as part of the multisite bootstrap process.\n *\n * Prior to 4.6.0, this was a procedural block in `ms-settings.php`. It was wrapped into\n * a function to facilitate unit tests. It should not be used outside of core.\n *\n * Usually, it's easier to query the site first, which then declares its network.\n * In limited situations, we either can or must find the network first.\n *\n * If a network and site are found, a `true` response will be returned so that the\n * request can continue.\n *\n * If neither a network or site is found, `false` or a URL string will be returned\n * so that either an error can be shown or a redirect can occur.\n *\n * @since 4.6.0\n * @access private\n *\n * @global WP_Network $current_site The current network.\n * @global WP_Site    $current_blog The current site.\n *\n * @param string $domain    The requested domain.\n * @param string $path      The requested path.\n * @param bool   $subdomain Optional. Whether a subdomain (true) or subdirectory (false) configuration.\n *                          Default false.\n * @return bool|string True if bootstrap successfully populated `$current_blog` and `$current_site`.\n *                     False if bootstrap could not be properly completed.\n *                     Redirect URL if parts exist, but the request as a whole can not be fulfilled.\n */\nfunction ms_load_current_site_and_network( $domain, $path, $subdomain = false ) {\n\tglobal $current_site, $current_blog;\n\n\t// If the network is defined in wp-config.php, we can simply use that.\n\tif ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' ) ) {\n\t\t$current_site         = new stdClass;\n\t\t$current_site->id     = defined( 'SITE_ID_CURRENT_SITE' ) ? SITE_ID_CURRENT_SITE : 1;\n\t\t$current_site->domain = DOMAIN_CURRENT_SITE;\n\t\t$current_site->path   = PATH_CURRENT_SITE;\n\t\tif ( defined( 'BLOG_ID_CURRENT_SITE' ) ) {\n\t\t\t$current_site->blog_id = BLOG_ID_CURRENT_SITE;\n\t\t} elseif ( defined( 'BLOGID_CURRENT_SITE' ) ) { // Deprecated.\n\t\t\t$current_site->blog_id = BLOGID_CURRENT_SITE;\n\t\t}\n\n\t\tif ( 0 === strcasecmp( $current_site->domain, $domain ) && 0 === strcasecmp( $current_site->path, $path ) ) {\n\t\t\t$current_blog = get_site_by_path( $domain, $path );\n\t\t} elseif ( '/' !== $current_site->path && 0 === strcasecmp( $current_site->domain, $domain ) && 0 === stripos( $path, $current_site->path ) ) {\n\t\t\t// If the current network has a path and also matches the domain and path of the request,\n\t\t\t// we need to look for a site using the first path segment following the network's path.\n\t\t\t$current_blog = get_site_by_path( $domain, $path, 1 + count( explode( '/', trim( $current_site->path, '/' ) ) ) );\n\t\t} else {\n\t\t\t// Otherwise, use the first path segment (as usual).\n\t\t\t$current_blog = get_site_by_path( $domain, $path, 1 );\n\t\t}\n\t} elseif ( ! $subdomain ) {\n\t\t/*\n\t\t * A \"subdomain\" installation can be re-interpreted to mean \"can support any domain\".\n\t\t * If we're not dealing with one of these installations, then the important part is determining\n\t\t * the network first, because we need the network's path to identify any sites.\n\t\t */\n\t\t$current_site = wp_cache_get( 'current_network', 'site-options' );\n\t\tif ( ! $current_site ) {\n\t\t\t// Are there even two networks installed?\n\t\t\t$networks = get_networks( array( 'number' => 2 ) );\n\t\t\tif ( count( $networks ) === 1 ) {\n\t\t\t\t$current_site = array_shift( $networks );\n\t\t\t\twp_cache_add( 'current_network', $current_site, 'site-options' );\n\t\t\t} elseif ( empty( $networks ) ) {\n\t\t\t\t// A network not found hook should fire here.\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $current_site ) ) {\n\t\t\t$current_site = WP_Network::get_by_path( $domain, $path, 1 );\n\t\t}\n\n\t\tif ( empty( $current_site ) ) {\n\t\t\t/**\n\t\t\t * Fires when a network cannot be found based on the requested domain and path.\n\t\t\t *\n\t\t\t * At the time of this action, the only recourse is to redirect somewhere\n\t\t\t * and exit. If you want to declare a particular network, do so earlier.\n\t\t\t *\n\t\t\t * @since 4.4.0\n\t\t\t *\n\t\t\t * @param string $domain       The domain used to search for a network.\n\t\t\t * @param string $path         The path used to search for a path.\n\t\t\t */\n\t\t\tdo_action( 'ms_network_not_found', $domain, $path );\n\n\t\t\treturn false;\n\t\t} elseif ( $path === $current_site->path ) {\n\t\t\t$current_blog = get_site_by_path( $domain, $path );\n\t\t} else {\n\t\t\t// Search the network path + one more path segment (on top of the network path).\n\t\t\t$current_blog = get_site_by_path( $domain, $path, substr_count( $current_site->path, '/' ) );\n\t\t}\n\t} else {\n\t\t// Find the site by the domain and at most the first path segment.\n\t\t$current_blog = get_site_by_path( $domain, $path, 1 );\n\t\tif ( $current_blog ) {\n\t\t\t$current_site = WP_Network::get_instance( $current_blog->site_id ? $current_blog->site_id : 1 );\n\t\t} else {\n\t\t\t// If you don't have a site with the same domain/path as a network, you're pretty screwed, but:\n\t\t\t$current_site = WP_Network::get_by_path( $domain, $path, 1 );\n\t\t}\n\t}\n\n\t// The network declared by the site trumps any constants.\n\tif ( $current_blog && $current_blog->site_id != $current_site->id ) {\n\t\t$current_site = WP_Network::get_instance( $current_blog->site_id );\n\t}\n\n\t// No network has been found, bail.\n\tif ( empty( $current_site ) ) {\n\t\t/** This action is documented in wp-includes/ms-settings.php */\n\t\tdo_action( 'ms_network_not_found', $domain, $path );\n\n\t\treturn false;\n\t}\n\n\t// During activation of a new subdomain, the requested site does not yet exist.\n\tif ( empty( $current_blog ) && wp_installing() ) {\n\t\t$current_blog          = new stdClass;\n\t\t$current_blog->blog_id = 1;\n\t\t$blog_id               = 1;\n\t\t$current_blog->public  = 1;\n\t}\n\n\t// No site has been found, bail.\n\tif ( empty( $current_blog ) ) {\n\t\t// We're going to redirect to the network URL, with some possible modifications.\n\t\t$scheme      = is_ssl() ? 'https' : 'http';\n\t\t$destination = \"$scheme://{$current_site->domain}{$current_site->path}\";\n\n\t\t/**\n\t\t * Fires when a network can be determined but a site cannot.\n\t\t *\n\t\t * At the time of this action, the only recourse is to redirect somewhere\n\t\t * and exit. If you want to declare a particular site, do so earlier.\n\t\t *\n\t\t * @since 3.9.0\n\t\t *\n\t\t * @param object $current_site The network that had been determined.\n\t\t * @param string $domain       The domain used to search for a site.\n\t\t * @param string $path         The path used to search for a site.\n\t\t */\n\t\tdo_action( 'ms_site_not_found', $current_site, $domain, $path );\n\n\t\tif ( $subdomain && ! defined( 'NOBLOGREDIRECT' ) ) {\n\t\t\t// For a \"subdomain\" installation, redirect to the signup form specifically.\n\t\t\t$destination .= 'wp-signup.php?new=' . str_replace( '.' . $current_site->domain, '', $domain );\n\t\t} elseif ( $subdomain ) {\n\t\t\t/*\n\t\t\t * For a \"subdomain\" installation, the NOBLOGREDIRECT constant\n\t\t\t * can be used to avoid a redirect to the signup form.\n\t\t\t * Using the ms_site_not_found action is preferred to the constant.\n\t\t\t */\n\t\t\tif ( '%siteurl%' !== NOBLOGREDIRECT ) {\n\t\t\t\t$destination = NOBLOGREDIRECT;\n\t\t\t}\n\t\t} elseif ( 0 === strcasecmp( $current_site->domain, $domain ) ) {\n\t\t\t/*\n\t\t\t * If the domain we were searching for matches the network's domain,\n\t\t\t * it's no use redirecting back to ourselves -- it'll cause a loop.\n\t\t\t * As we couldn't find a site, we're simply not installed.\n\t\t\t */\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $destination;\n\t}\n\n\t// Figure out the current network's main site.\n\tif ( empty( $current_site->blog_id ) ) {\n\t\t$current_site->blog_id = get_main_site_id( $current_site->id );\n\t}\n\n\treturn true;\n}\n\n/**\n * Displays a failure message.\n *\n * Used when a blog's tables do not exist. Checks for a missing $wpdb->site table as well.\n *\n * @access private\n * @since 3.0.0\n * @since 4.4.0 The `$domain` and `$path` parameters were added.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $domain The requested domain for the error to reference.\n * @param string $path   The requested path for the error to reference.\n */\nfunction ms_not_installed( $domain, $path ) {\n\tglobal $wpdb;\n\n\tif ( ! is_admin() ) {\n\t\tdead_db();\n\t}\n\n\twp_load_translations_early();\n\n\t$title = __( 'Error establishing a database connection' );\n\n\t$msg   = '<h1>' . $title . '</h1>';\n\t$msg  .= '<p>' . __( 'If your site does not display, please contact the owner of this network.' ) . '';\n\t$msg  .= ' ' . __( 'If you are the owner of this network please check that MySQL is running properly and all tables are error free.' ) . '</p>';\n\t$query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->site ) );\n\tif ( ! $wpdb->get_var( $query ) ) {\n\t\t$msg .= '<p>' . sprintf(\n\t\t\t/* translators: %s: Table name. */\n\t\t\t__( '<strong>Database tables are missing.</strong> This means that MySQL is not running, WordPress was not installed properly, or someone deleted %s. You really should look at your database now.' ),\n\t\t\t'<code>' . $wpdb->site . '</code>'\n\t\t) . '</p>';\n\t} else {\n\t\t$msg .= '<p>' . sprintf(\n\t\t\t/* translators: 1: Site URL, 2: Table name, 3: Database name. */\n\t\t\t__( '<strong>Could not find site %1$s.</strong> Searched for table %2$s in database %3$s. Is that right?' ),\n\t\t\t'<code>' . rtrim( $domain . $path, '/' ) . '</code>',\n\t\t\t'<code>' . $wpdb->blogs . '</code>',\n\t\t\t'<code>' . DB_NAME . '</code>'\n\t\t) . '</p>';\n\t}\n\t$msg .= '<p><strong>' . __( 'What do I do now?' ) . '</strong> ';\n\t$msg .= sprintf(\n\t\t/* translators: %s: Documentation URL. */\n\t\t__( 'Read the <a href=\"%s\" target=\"_blank\">Debugging a WordPress Network</a> article. Some of the suggestions there may help you figure out what went wrong.' ),\n\t\t__( 'https://wordpress.org/support/article/debugging-a-wordpress-network/' )\n\t);\n\t$msg .= ' ' . __( 'If you&#8217;re still stuck with this message, then check that your database contains the following tables:' ) . '</p><ul>';\n\tforeach ( $wpdb->tables( 'global' ) as $t => $table ) {\n\t\tif ( 'sitecategories' === $t ) {\n\t\t\tcontinue;\n\t\t}\n\t\t$msg .= '<li>' . $table . '</li>';\n\t}\n\t$msg .= '</ul>';\n\n\twp_die( $msg, $title, array( 'response' => 500 ) );\n}\n\n/**\n * This deprecated function formerly set the site_name property of the $current_site object.\n *\n * This function simply returns the object, as before.\n * The bootstrap takes care of setting site_name.\n *\n * @access private\n * @since 3.0.0\n * @deprecated 3.9.0 Use get_current_site() instead.\n *\n * @param object $current_site\n * @return object\n */\nfunction get_current_site_name( $current_site ) {\n\t_deprecated_function( __FUNCTION__, '3.9.0', 'get_current_site()' );\n\treturn $current_site;\n}\n\n/**\n * This deprecated function managed much of the site and network loading in multisite.\n *\n * The current bootstrap code is now responsible for parsing the site and network load as\n * well as setting the global $current_site object.\n *\n * @access private\n * @since 3.0.0\n * @deprecated 3.9.0\n *\n * @global object $current_site\n *\n * @return object\n */\nfunction wpmu_current_site() {\n\tglobal $current_site;\n\t_deprecated_function( __FUNCTION__, '3.9.0' );\n\treturn $current_site;\n}\n\n/**\n * Retrieve an object containing information about the requested network.\n *\n * @since 3.9.0\n * @deprecated 4.7.0 Use `get_network()`\n * @see get_network()\n *\n * @internal In 4.6.0, converted to use get_network()\n *\n * @param object|int $network The network's database row or ID.\n * @return WP_Network|false Object containing network information if found, false if not.\n */\nfunction wp_get_network( $network ) {\n\t_deprecated_function( __FUNCTION__, '4.7.0', 'get_network()' );\n\n\t$network = get_network( $network );\n\tif ( null === $network ) {\n\t\treturn false;\n\t}\n\n\treturn $network;\n}\n", "num_lines": 572}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Network API\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 5.1.0\n */\n\n/**\n * Retrieves network data given a network ID or network object.\n *\n * Network data will be cached and returned after being passed through a filter.\n * If the provided network is empty, the current network global will be used.\n *\n * @since 4.6.0\n *\n * @global WP_Network $current_site\n *\n * @param WP_Network|int|null $network Optional. Network to retrieve. Default is the current network.\n * @return WP_Network|null The network object or null if not found.\n */\nfunction get_network( $network = null ) {\n\tglobal $current_site;\n\tif ( empty( $network ) && isset( $current_site ) ) {\n\t\t$network = $current_site;\n\t}\n\n\tif ( $network instanceof WP_Network ) {\n\t\t$_network = $network;\n\t} elseif ( is_object( $network ) ) {\n\t\t$_network = new WP_Network( $network );\n\t} else {\n\t\t$_network = WP_Network::get_instance( $network );\n\t}\n\n\tif ( ! $_network ) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Fires after a network is retrieved.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param WP_Network $_network Network data.\n\t */\n\t$_network = apply_filters( 'get_network', $_network );\n\n\treturn $_network;\n}\n\n/**\n * Retrieves a list of networks.\n *\n * @since 4.6.0\n *\n * @param string|array $args Optional. Array or string of arguments. See WP_Network_Query::parse_query()\n *                           for information on accepted arguments. Default empty array.\n * @return array|int List of WP_Network objects, a list of network IDs when 'fields' is set to 'ids',\n *                   or the number of networks when 'count' is passed as a query var.\n */\nfunction get_networks( $args = array() ) {\n\t$query = new WP_Network_Query();\n\n\treturn $query->query( $args );\n}\n\n/**\n * Removes a network from the object cache.\n *\n * @since 4.6.0\n *\n * @global bool $_wp_suspend_cache_invalidation\n *\n * @param int|array $ids Network ID or an array of network IDs to remove from cache.\n */\nfunction clean_network_cache( $ids ) {\n\tglobal $_wp_suspend_cache_invalidation;\n\n\tif ( ! empty( $_wp_suspend_cache_invalidation ) ) {\n\t\treturn;\n\t}\n\n\tforeach ( (array) $ids as $id ) {\n\t\twp_cache_delete( $id, 'networks' );\n\n\t\t/**\n\t\t * Fires immediately after a network has been removed from the object cache.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param int $id Network ID.\n\t\t */\n\t\tdo_action( 'clean_network_cache', $id );\n\t}\n\n\twp_cache_set( 'last_changed', microtime(), 'networks' );\n}\n\n/**\n * Updates the network cache of given networks.\n *\n * Will add the networks in $networks to the cache. If network ID already exists\n * in the network cache then it will not be updated. The network is added to the\n * cache using the network group with the key using the ID of the networks.\n *\n * @since 4.6.0\n *\n * @param array $networks Array of network row objects.\n */\nfunction update_network_cache( $networks ) {\n\tforeach ( (array) $networks as $network ) {\n\t\twp_cache_add( $network->id, $network, 'networks' );\n\t}\n}\n\n/**\n * Adds any networks from the given IDs to the cache that do not already exist in cache.\n *\n * @since 4.6.0\n * @access private\n *\n * @see update_network_cache()\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param array $network_ids Array of network IDs.\n */\nfunction _prime_network_caches( $network_ids ) {\n\tglobal $wpdb;\n\n\t$non_cached_ids = _get_non_cached_ids( $network_ids, 'networks' );\n\tif ( ! empty( $non_cached_ids ) ) {\n\t\t$fresh_networks = $wpdb->get_results( sprintf( \"SELECT $wpdb->site.* FROM $wpdb->site WHERE id IN (%s)\", join( ',', array_map( 'intval', $non_cached_ids ) ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\n\t\tupdate_network_cache( $fresh_networks );\n\t}\n}\n", "num_lines": 139}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Used to set up and fix common variables and include\n * the Multisite procedural and class library.\n *\n * Allows for some configuration in wp-config.php (see ms-default-constants.php)\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 3.0.0\n */\n\n/**\n * Objects representing the current network and current site.\n *\n * These may be populated through a custom `sunrise.php`. If not, then this\n * file will attempt to populate them based on the current request.\n *\n * @global WP_Network $current_site The current network.\n * @global object     $current_blog The current site.\n * @global string     $domain       Deprecated. The domain of the site found on load.\n *                                  Use `get_site()->domain` instead.\n * @global string     $path         Deprecated. The path of the site found on load.\n *                                  Use `get_site()->path` instead.\n * @global int        $site_id      Deprecated. The ID of the network found on load.\n *                                  Use `get_current_network_id()` instead.\n * @global bool       $public       Deprecated. Whether the site found on load is public.\n *                                  Use `get_site()->public` instead.\n *\n * @since 3.0.0\n */\nglobal $current_site, $current_blog, $domain, $path, $site_id, $public;\n\n/** WP_Network class */\nrequire_once ABSPATH . WPINC . '/class-wp-network.php';\n\n/** WP_Site class */\nrequire_once ABSPATH . WPINC . '/class-wp-site.php';\n\n/** Multisite loader */\nrequire_once ABSPATH . WPINC . '/ms-load.php';\n\n/** Default Multisite constants */\nrequire_once ABSPATH . WPINC . '/ms-default-constants.php';\n\nif ( defined( 'SUNRISE' ) ) {\n\tinclude_once WP_CONTENT_DIR . '/sunrise.php';\n}\n\n/** Check for and define SUBDOMAIN_INSTALL and the deprecated VHOST constant. */\nms_subdomain_constants();\n\n// This block will process a request if the current network or current site objects\n// have not been populated in the global scope through something like `sunrise.php`.\nif ( ! isset( $current_site ) || ! isset( $current_blog ) ) {\n\n\t$domain = strtolower( stripslashes( $_SERVER['HTTP_HOST'] ) );\n\tif ( ':80' === substr( $domain, -3 ) ) {\n\t\t$domain               = substr( $domain, 0, -3 );\n\t\t$_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -3 );\n\t} elseif ( ':443' === substr( $domain, -4 ) ) {\n\t\t$domain               = substr( $domain, 0, -4 );\n\t\t$_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -4 );\n\t}\n\n\t$path = stripslashes( $_SERVER['REQUEST_URI'] );\n\tif ( is_admin() ) {\n\t\t$path = preg_replace( '#(.*)/wp-admin/.*#', '$1/', $path );\n\t}\n\tlist( $path ) = explode( '?', $path );\n\n\t$bootstrap_result = ms_load_current_site_and_network( $domain, $path, is_subdomain_install() );\n\n\tif ( true === $bootstrap_result ) {\n\t\t// `$current_blog` and `$current_site are now populated.\n\t} elseif ( false === $bootstrap_result ) {\n\t\tms_not_installed( $domain, $path );\n\t} else {\n\t\theader( 'Location: ' . $bootstrap_result );\n\t\texit;\n\t}\n\tunset( $bootstrap_result );\n\n\t$blog_id = $current_blog->blog_id;\n\t$public  = $current_blog->public;\n\n\tif ( empty( $current_blog->site_id ) ) {\n\t\t// This dates to [MU134] and shouldn't be relevant anymore,\n\t\t// but it could be possible for arguments passed to insert_blog() etc.\n\t\t$current_blog->site_id = 1;\n\t}\n\n\t$site_id = $current_blog->site_id;\n\twp_load_core_site_options( $site_id );\n}\n\n$wpdb->set_prefix( $table_prefix, false ); // $table_prefix can be set in sunrise.php.\n$wpdb->set_blog_id( $current_blog->blog_id, $current_blog->site_id );\n$table_prefix       = $wpdb->get_blog_prefix();\n$_wp_switched_stack = array();\n$switched           = false;\n\n// Need to init cache again after blog_id is set.\nwp_start_object_cache();\n\nif ( ! $current_site instanceof WP_Network ) {\n\t$current_site = new WP_Network( $current_site );\n}\n\nif ( ! $current_blog instanceof WP_Site ) {\n\t$current_blog = new WP_Site( $current_blog );\n}\n\n// Define upload directory constants.\nms_upload_constants();\n\n/**\n * Fires after the current site and network have been detected and loaded\n * in multisite's bootstrap.\n *\n * @since 4.6.0\n */\ndo_action( 'ms_loaded' );\n", "num_lines": 124}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Site API\n *\n * @package WordPress\n * @subpackage Multisite\n * @since 5.1.0\n */\n\n/**\n * Inserts a new site into the database.\n *\n * @since 5.1.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param array $data {\n *     Data for the new site that should be inserted.\n *\n *     @type string $domain       Site domain. Default empty string.\n *     @type string $path         Site path. Default '/'.\n *     @type int    $network_id   The site's network ID. Default is the current network ID.\n *     @type string $registered   When the site was registered, in SQL datetime format. Default is\n *                                the current time.\n *     @type string $last_updated When the site was last updated, in SQL datetime format. Default is\n *                                the value of $registered.\n *     @type int    $public       Whether the site is public. Default 1.\n *     @type int    $archived     Whether the site is archived. Default 0.\n *     @type int    $mature       Whether the site is mature. Default 0.\n *     @type int    $spam         Whether the site is spam. Default 0.\n *     @type int    $deleted      Whether the site is deleted. Default 0.\n *     @type int    $lang_id      The site's language ID. Currently unused. Default 0.\n *     @type int    $user_id      User ID for the site administrator. Passed to the\n *                                `wp_initialize_site` hook.\n *     @type string $title        Site title. Default is 'Site %d' where %d is the site ID. Passed\n *                                to the `wp_initialize_site` hook.\n *     @type array  $options      Custom option $key => $value pairs to use. Default empty array. Passed\n *                                to the `wp_initialize_site` hook.\n *     @type array  $meta         Custom site metadata $key => $value pairs to use. Default empty array.\n *                                Passed to the `wp_initialize_site` hook.\n * }\n * @return int|WP_Error The new site's ID on success, or error object on failure.\n */\nfunction wp_insert_site( array $data ) {\n\tglobal $wpdb;\n\n\t$now = current_time( 'mysql', true );\n\n\t$defaults = array(\n\t\t'domain'       => '',\n\t\t'path'         => '/',\n\t\t'network_id'   => get_current_network_id(),\n\t\t'registered'   => $now,\n\t\t'last_updated' => $now,\n\t\t'public'       => 1,\n\t\t'archived'     => 0,\n\t\t'mature'       => 0,\n\t\t'spam'         => 0,\n\t\t'deleted'      => 0,\n\t\t'lang_id'      => 0,\n\t);\n\n\t$prepared_data = wp_prepare_site_data( $data, $defaults );\n\tif ( is_wp_error( $prepared_data ) ) {\n\t\treturn $prepared_data;\n\t}\n\n\tif ( false === $wpdb->insert( $wpdb->blogs, $prepared_data ) ) {\n\t\treturn new WP_Error( 'db_insert_error', __( 'Could not insert site into the database.' ), $wpdb->last_error );\n\t}\n\n\t$site_id = (int) $wpdb->insert_id;\n\n\tclean_blog_cache( $site_id );\n\n\t$new_site = get_site( $site_id );\n\n\tif ( ! $new_site ) {\n\t\treturn new WP_Error( 'get_site_error', __( 'Could not retrieve site data.' ) );\n\t}\n\n\t/**\n\t * Fires once a site has been inserted into the database.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param WP_Site $new_site New site object.\n\t */\n\tdo_action( 'wp_insert_site', $new_site );\n\n\t// Extract the passed arguments that may be relevant for site initialization.\n\t$args = array_diff_key( $data, $defaults );\n\tif ( isset( $args['site_id'] ) ) {\n\t\tunset( $args['site_id'] );\n\t}\n\n\t/**\n\t * Fires when a site's initialization routine should be executed.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param WP_Site $new_site New site object.\n\t * @param array   $args     Arguments for the initialization.\n\t */\n\tdo_action( 'wp_initialize_site', $new_site, $args );\n\n\t// Only compute extra hook parameters if the deprecated hook is actually in use.\n\tif ( has_action( 'wpmu_new_blog' ) ) {\n\t\t$user_id = ! empty( $args['user_id'] ) ? $args['user_id'] : 0;\n\t\t$meta    = ! empty( $args['options'] ) ? $args['options'] : array();\n\n\t\t// WPLANG was passed with `$meta` to the `wpmu_new_blog` hook prior to 5.1.0.\n\t\tif ( ! array_key_exists( 'WPLANG', $meta ) ) {\n\t\t\t$meta['WPLANG'] = get_network_option( $new_site->network_id, 'WPLANG' );\n\t\t}\n\n\t\t// Rebuild the data expected by the `wpmu_new_blog` hook prior to 5.1.0 using allowed keys.\n\t\t// The `$allowed_data_fields` matches the one used in `wpmu_create_blog()`.\n\t\t$allowed_data_fields = array( 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' );\n\t\t$meta                = array_merge( array_intersect_key( $data, array_flip( $allowed_data_fields ) ), $meta );\n\n\t\t/**\n\t\t * Fires immediately after a new site is created.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t * @deprecated 5.1.0 Use {@see 'wp_insert_site'} instead.\n\t\t *\n\t\t * @param int    $site_id    Site ID.\n\t\t * @param int    $user_id    User ID.\n\t\t * @param string $domain     Site domain.\n\t\t * @param string $path       Site path.\n\t\t * @param int    $network_id Network ID. Only relevant on multi-network installations.\n\t\t * @param array  $meta       Meta data. Used to set initial site options.\n\t\t */\n\t\tdo_action_deprecated(\n\t\t\t'wpmu_new_blog',\n\t\t\tarray( $new_site->id, $user_id, $new_site->domain, $new_site->path, $new_site->network_id, $meta ),\n\t\t\t'5.1.0',\n\t\t\t'wp_insert_site'\n\t\t);\n\t}\n\n\treturn (int) $new_site->id;\n}\n\n/**\n * Updates a site in the database.\n *\n * @since 5.1.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int   $site_id ID of the site that should be updated.\n * @param array $data    Site data to update. See {@see wp_insert_site()} for the list of supported keys.\n * @return int|WP_Error The updated site's ID on success, or error object on failure.\n */\nfunction wp_update_site( $site_id, array $data ) {\n\tglobal $wpdb;\n\n\tif ( empty( $site_id ) ) {\n\t\treturn new WP_Error( 'site_empty_id', __( 'Site ID must not be empty.' ) );\n\t}\n\n\t$old_site = get_site( $site_id );\n\tif ( ! $old_site ) {\n\t\treturn new WP_Error( 'site_not_exist', __( 'Site does not exist.' ) );\n\t}\n\n\t$defaults                 = $old_site->to_array();\n\t$defaults['network_id']   = (int) $defaults['site_id'];\n\t$defaults['last_updated'] = current_time( 'mysql', true );\n\tunset( $defaults['blog_id'], $defaults['site_id'] );\n\n\t$data = wp_prepare_site_data( $data, $defaults, $old_site );\n\tif ( is_wp_error( $data ) ) {\n\t\treturn $data;\n\t}\n\n\tif ( false === $wpdb->update( $wpdb->blogs, $data, array( 'blog_id' => $old_site->id ) ) ) {\n\t\treturn new WP_Error( 'db_update_error', __( 'Could not update site in the database.' ), $wpdb->last_error );\n\t}\n\n\tclean_blog_cache( $old_site );\n\n\t$new_site = get_site( $old_site->id );\n\n\t/**\n\t * Fires once a site has been updated in the database.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param WP_Site $new_site New site object.\n\t * @param WP_Site $old_site Old site object.\n\t */\n\tdo_action( 'wp_update_site', $new_site, $old_site );\n\n\treturn (int) $new_site->id;\n}\n\n/**\n * Deletes a site from the database.\n *\n * @since 5.1.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int $site_id ID of the site that should be deleted.\n * @return WP_Site|WP_Error The deleted site object on success, or error object on failure.\n */\nfunction wp_delete_site( $site_id ) {\n\tglobal $wpdb;\n\n\tif ( empty( $site_id ) ) {\n\t\treturn new WP_Error( 'site_empty_id', __( 'Site ID must not be empty.' ) );\n\t}\n\n\t$old_site = get_site( $site_id );\n\tif ( ! $old_site ) {\n\t\treturn new WP_Error( 'site_not_exist', __( 'Site does not exist.' ) );\n\t}\n\n\t$errors = new WP_Error();\n\n\t/**\n\t * Fires before a site should be deleted from the database.\n\t *\n\t * Plugins should amend the `$errors` object via its `WP_Error::add()` method. If any errors\n\t * are present, the site will not be deleted.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param WP_Error $errors   Error object to add validation errors to.\n\t * @param WP_Site  $old_site The site object to be deleted.\n\t */\n\tdo_action( 'wp_validate_site_deletion', $errors, $old_site );\n\n\tif ( ! empty( $errors->errors ) ) {\n\t\treturn $errors;\n\t}\n\n\t/**\n\t * Fires before a site is deleted.\n\t *\n\t * @since MU (3.0.0)\n\t * @deprecated 5.1.0\n\t *\n\t * @param int  $site_id The site ID.\n\t * @param bool $drop    True if site's table should be dropped. Default false.\n\t */\n\tdo_action_deprecated( 'delete_blog', array( $old_site->id, true ), '5.1.0' );\n\n\t/**\n\t * Fires when a site's uninitialization routine should be executed.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param WP_Site $old_site Deleted site object.\n\t */\n\tdo_action( 'wp_uninitialize_site', $old_site );\n\n\tif ( is_site_meta_supported() ) {\n\t\t$blog_meta_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT meta_id FROM $wpdb->blogmeta WHERE blog_id = %d \", $old_site->id ) );\n\t\tforeach ( $blog_meta_ids as $mid ) {\n\t\t\tdelete_metadata_by_mid( 'blog', $mid );\n\t\t}\n\t}\n\n\tif ( false === $wpdb->delete( $wpdb->blogs, array( 'blog_id' => $old_site->id ) ) ) {\n\t\treturn new WP_Error( 'db_delete_error', __( 'Could not delete site from the database.' ), $wpdb->last_error );\n\t}\n\n\tclean_blog_cache( $old_site );\n\n\t/**\n\t * Fires once a site has been deleted from the database.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param WP_Site $old_site Deleted site object.\n\t */\n\tdo_action( 'wp_delete_site', $old_site );\n\n\t/**\n\t * Fires after the site is deleted from the network.\n\t *\n\t * @since 4.8.0\n\t * @deprecated 5.1.0\n\t *\n\t * @param int  $site_id The site ID.\n\t * @param bool $drop    True if site's tables should be dropped. Default false.\n\t */\n\tdo_action_deprecated( 'deleted_blog', array( $old_site->id, true ), '5.1.0' );\n\n\treturn $old_site;\n}\n\n/**\n * Retrieves site data given a site ID or site object.\n *\n * Site data will be cached and returned after being passed through a filter.\n * If the provided site is empty, the current site global will be used.\n *\n * @since 4.6.0\n *\n * @param WP_Site|int|null $site Optional. Site to retrieve. Default is the current site.\n * @return WP_Site|null The site object or null if not found.\n */\nfunction get_site( $site = null ) {\n\tif ( empty( $site ) ) {\n\t\t$site = get_current_blog_id();\n\t}\n\n\tif ( $site instanceof WP_Site ) {\n\t\t$_site = $site;\n\t} elseif ( is_object( $site ) ) {\n\t\t$_site = new WP_Site( $site );\n\t} else {\n\t\t$_site = WP_Site::get_instance( $site );\n\t}\n\n\tif ( ! $_site ) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Fires after a site is retrieved.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param WP_Site $_site Site data.\n\t */\n\t$_site = apply_filters( 'get_site', $_site );\n\n\treturn $_site;\n}\n\n/**\n * Adds any sites from the given IDs to the cache that do not already exist in cache.\n *\n * @since 4.6.0\n * @since 5.1.0 Introduced the `$update_meta_cache` parameter.\n * @access private\n *\n * @see update_site_cache()\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param array $ids               ID list.\n * @param bool  $update_meta_cache Optional. Whether to update the meta cache. Default true.\n */\nfunction _prime_site_caches( $ids, $update_meta_cache = true ) {\n\tglobal $wpdb;\n\n\t$non_cached_ids = _get_non_cached_ids( $ids, 'sites' );\n\tif ( ! empty( $non_cached_ids ) ) {\n\t\t$fresh_sites = $wpdb->get_results( sprintf( \"SELECT * FROM $wpdb->blogs WHERE blog_id IN (%s)\", join( ',', array_map( 'intval', $non_cached_ids ) ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\n\t\tupdate_site_cache( $fresh_sites, $update_meta_cache );\n\t}\n}\n\n/**\n * Updates sites in cache.\n *\n * @since 4.6.0\n * @since 5.1.0 Introduced the `$update_meta_cache` parameter.\n *\n * @param array $sites             Array of site objects.\n * @param bool  $update_meta_cache Whether to update site meta cache. Default true.\n */\nfunction update_site_cache( $sites, $update_meta_cache = true ) {\n\tif ( ! $sites ) {\n\t\treturn;\n\t}\n\t$site_ids = array();\n\tforeach ( $sites as $site ) {\n\t\t$site_ids[] = $site->blog_id;\n\t\twp_cache_add( $site->blog_id, $site, 'sites' );\n\t\twp_cache_add( $site->blog_id . 'short', $site, 'blog-details' );\n\t}\n\n\tif ( $update_meta_cache ) {\n\t\tupdate_sitemeta_cache( $site_ids );\n\t}\n}\n\n/**\n * Updates metadata cache for list of site IDs.\n *\n * Performs SQL query to retrieve all metadata for the sites matching `$site_ids` and stores them in the cache.\n * Subsequent calls to `get_site_meta()` will not need to query the database.\n *\n * @since 5.1.0\n *\n * @param array $site_ids List of site IDs.\n * @return array|false An array of metadata on success, false if there is nothing to update.\n */\nfunction update_sitemeta_cache( $site_ids ) {\n\t// Ensure this filter is hooked in even if the function is called early.\n\tif ( ! has_filter( 'update_blog_metadata_cache', 'wp_check_site_meta_support_prefilter' ) ) {\n\t\tadd_filter( 'update_blog_metadata_cache', 'wp_check_site_meta_support_prefilter' );\n\t}\n\treturn update_meta_cache( 'blog', $site_ids );\n}\n\n/**\n * Retrieves a list of sites matching requested arguments.\n *\n * @since 4.6.0\n * @since 4.8.0 Introduced the 'lang_id', 'lang__in', and 'lang__not_in' parameters.\n *\n * @see WP_Site_Query::parse_query()\n *\n * @param string|array $args {\n *     Optional. Array or query string of site query parameters. Default empty.\n *\n *     @type array        $site__in          Array of site IDs to include. Default empty.\n *     @type array        $site__not_in      Array of site IDs to exclude. Default empty.\n *     @type bool         $count             Whether to return a site count (true) or array of site objects.\n *                                           Default false.\n *     @type array        $date_query        Date query clauses to limit sites by. See WP_Date_Query.\n *                                           Default null.\n *     @type string       $fields            Site fields to return. Accepts 'ids' (returns an array of site IDs)\n *                                           or empty (returns an array of complete site objects). Default empty.\n *     @type int          $ID                A site ID to only return that site. Default empty.\n *     @type int          $number            Maximum number of sites to retrieve. Default 100.\n *     @type int          $offset            Number of sites to offset the query. Used to build LIMIT clause.\n *                                           Default 0.\n *     @type bool         $no_found_rows     Whether to disable the `SQL_CALC_FOUND_ROWS` query. Default true.\n *     @type string|array $orderby           Site status or array of statuses. Accepts 'id', 'domain', 'path',\n *                                           'network_id', 'last_updated', 'registered', 'domain_length',\n *                                           'path_length', 'site__in' and 'network__in'. Also accepts false,\n *                                           an empty array, or 'none' to disable `ORDER BY` clause.\n *                                           Default 'id'.\n *     @type string       $order             How to order retrieved sites. Accepts 'ASC', 'DESC'. Default 'ASC'.\n *     @type int          $network_id        Limit results to those affiliated with a given network ID. If 0,\n *                                           include all networks. Default 0.\n *     @type array        $network__in       Array of network IDs to include affiliated sites for. Default empty.\n *     @type array        $network__not_in   Array of network IDs to exclude affiliated sites for. Default empty.\n *     @type string       $domain            Limit results to those affiliated with a given domain. Default empty.\n *     @type array        $domain__in        Array of domains to include affiliated sites for. Default empty.\n *     @type array        $domain__not_in    Array of domains to exclude affiliated sites for. Default empty.\n *     @type string       $path              Limit results to those affiliated with a given path. Default empty.\n *     @type array        $path__in          Array of paths to include affiliated sites for. Default empty.\n *     @type array        $path__not_in      Array of paths to exclude affiliated sites for. Default empty.\n *     @type int          $public            Limit results to public sites. Accepts '1' or '0'. Default empty.\n *     @type int          $archived          Limit results to archived sites. Accepts '1' or '0'. Default empty.\n *     @type int          $mature            Limit results to mature sites. Accepts '1' or '0'. Default empty.\n *     @type int          $spam              Limit results to spam sites. Accepts '1' or '0'. Default empty.\n *     @type int          $deleted           Limit results to deleted sites. Accepts '1' or '0'. Default empty.\n *     @type int          $lang_id           Limit results to a language ID. Default empty.\n *     @type array        $lang__in          Array of language IDs to include affiliated sites for. Default empty.\n *     @type array        $lang__not_in      Array of language IDs to exclude affiliated sites for. Default empty.\n *     @type string       $search            Search term(s) to retrieve matching sites for. Default empty.\n *     @type array        $search_columns    Array of column names to be searched. Accepts 'domain' and 'path'.\n *                                           Default empty array.\n *     @type bool         $update_site_cache Whether to prime the cache for found sites. Default true.\n * }\n * @return array|int List of WP_Site objects, a list of site IDs when 'fields' is set to 'ids',\n *                   or the number of sites when 'count' is passed as a query var.\n */\nfunction get_sites( $args = array() ) {\n\t$query = new WP_Site_Query();\n\n\treturn $query->query( $args );\n}\n\n/**\n * Prepares site data for insertion or update in the database.\n *\n * @since 5.1.0\n *\n * @param array        $data     Associative array of site data passed to the respective function.\n *                               See {@see wp_insert_site()} for the possibly included data.\n * @param array        $defaults Site data defaults to parse $data against.\n * @param WP_Site|null $old_site Optional. Old site object if an update, or null if an insertion.\n *                               Default null.\n * @return array|WP_Error Site data ready for a database transaction, or WP_Error in case a validation\n *                        error occurred.\n */\nfunction wp_prepare_site_data( $data, $defaults, $old_site = null ) {\n\n\t// Maintain backward-compatibility with `$site_id` as network ID.\n\tif ( isset( $data['site_id'] ) ) {\n\t\tif ( ! empty( $data['site_id'] ) && empty( $data['network_id'] ) ) {\n\t\t\t$data['network_id'] = $data['site_id'];\n\t\t}\n\t\tunset( $data['site_id'] );\n\t}\n\n\t/**\n\t * Filters passed site data in order to normalize it.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param array $data Associative array of site data passed to the respective function.\n\t *                    See {@see wp_insert_site()} for the possibly included data.\n\t */\n\t$data = apply_filters( 'wp_normalize_site_data', $data );\n\n\t$allowed_data_fields = array( 'domain', 'path', 'network_id', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' );\n\t$data                = array_intersect_key( wp_parse_args( $data, $defaults ), array_flip( $allowed_data_fields ) );\n\n\t$errors = new WP_Error();\n\n\t/**\n\t * Fires when data should be validated for a site prior to inserting or updating in the database.\n\t *\n\t * Plugins should amend the `$errors` object via its `WP_Error::add()` method.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param WP_Error     $errors   Error object to add validation errors to.\n\t * @param array        $data     Associative array of complete site data. See {@see wp_insert_site()}\n\t *                               for the included data.\n\t * @param WP_Site|null $old_site The old site object if the data belongs to a site being updated,\n\t *                               or null if it is a new site being inserted.\n\t */\n\tdo_action( 'wp_validate_site_data', $errors, $data, $old_site );\n\n\tif ( ! empty( $errors->errors ) ) {\n\t\treturn $errors;\n\t}\n\n\t// Prepare for database.\n\t$data['site_id'] = $data['network_id'];\n\tunset( $data['network_id'] );\n\n\treturn $data;\n}\n\n/**\n * Normalizes data for a site prior to inserting or updating in the database.\n *\n * @since 5.1.0\n *\n * @param array $data Associative array of site data passed to the respective function.\n *                    See {@see wp_insert_site()} for the possibly included data.\n * @return array Normalized site data.\n */\nfunction wp_normalize_site_data( $data ) {\n\t// Sanitize domain if passed.\n\tif ( array_key_exists( 'domain', $data ) ) {\n\t\t$data['domain'] = trim( $data['domain'] );\n\t\t$data['domain'] = preg_replace( '/\\s+/', '', sanitize_user( $data['domain'], true ) );\n\t\tif ( is_subdomain_install() ) {\n\t\t\t$data['domain'] = str_replace( '@', '', $data['domain'] );\n\t\t}\n\t}\n\n\t// Sanitize path if passed.\n\tif ( array_key_exists( 'path', $data ) ) {\n\t\t$data['path'] = trailingslashit( '/' . trim( $data['path'], '/' ) );\n\t}\n\n\t// Sanitize network ID if passed.\n\tif ( array_key_exists( 'network_id', $data ) ) {\n\t\t$data['network_id'] = (int) $data['network_id'];\n\t}\n\n\t// Sanitize status fields if passed.\n\t$status_fields = array( 'public', 'archived', 'mature', 'spam', 'deleted' );\n\tforeach ( $status_fields as $status_field ) {\n\t\tif ( array_key_exists( $status_field, $data ) ) {\n\t\t\t$data[ $status_field ] = (int) $data[ $status_field ];\n\t\t}\n\t}\n\n\t// Strip date fields if empty.\n\t$date_fields = array( 'registered', 'last_updated' );\n\tforeach ( $date_fields as $date_field ) {\n\t\tif ( ! array_key_exists( $date_field, $data ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( empty( $data[ $date_field ] ) || '0000-00-00 00:00:00' === $data[ $date_field ] ) {\n\t\t\tunset( $data[ $date_field ] );\n\t\t}\n\t}\n\n\treturn $data;\n}\n\n/**\n * Validates data for a site prior to inserting or updating in the database.\n *\n * @since 5.1.0\n *\n * @param WP_Error     $errors   Error object, passed by reference. Will contain validation errors if\n *                               any occurred.\n * @param array        $data     Associative array of complete site data. See {@see wp_insert_site()}\n *                               for the included data.\n * @param WP_Site|null $old_site The old site object if the data belongs to a site being updated,\n *                               or null if it is a new site being inserted.\n */\nfunction wp_validate_site_data( $errors, $data, $old_site = null ) {\n\t// A domain must always be present.\n\tif ( empty( $data['domain'] ) ) {\n\t\t$errors->add( 'site_empty_domain', __( 'Site domain must not be empty.' ) );\n\t}\n\n\t// A path must always be present.\n\tif ( empty( $data['path'] ) ) {\n\t\t$errors->add( 'site_empty_path', __( 'Site path must not be empty.' ) );\n\t}\n\n\t// A network ID must always be present.\n\tif ( empty( $data['network_id'] ) ) {\n\t\t$errors->add( 'site_empty_network_id', __( 'Site network ID must be provided.' ) );\n\t}\n\n\t// Both registration and last updated dates must always be present and valid.\n\t$date_fields = array( 'registered', 'last_updated' );\n\tforeach ( $date_fields as $date_field ) {\n\t\tif ( empty( $data[ $date_field ] ) ) {\n\t\t\t$errors->add( 'site_empty_' . $date_field, __( 'Both registration and last updated dates must be provided.' ) );\n\t\t\tbreak;\n\t\t}\n\n\t\t// Allow '0000-00-00 00:00:00', although it be stripped out at this point.\n\t\tif ( '0000-00-00 00:00:00' !== $data[ $date_field ] ) {\n\t\t\t$month      = substr( $data[ $date_field ], 5, 2 );\n\t\t\t$day        = substr( $data[ $date_field ], 8, 2 );\n\t\t\t$year       = substr( $data[ $date_field ], 0, 4 );\n\t\t\t$valid_date = wp_checkdate( $month, $day, $year, $data[ $date_field ] );\n\t\t\tif ( ! $valid_date ) {\n\t\t\t\t$errors->add( 'site_invalid_' . $date_field, __( 'Both registration and last updated dates must be valid dates.' ) );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! empty( $errors->errors ) ) {\n\t\treturn;\n\t}\n\n\t// If a new site, or domain/path/network ID have changed, ensure uniqueness.\n\tif ( ! $old_site\n\t\t|| $data['domain'] !== $old_site->domain\n\t\t|| $data['path'] !== $old_site->path\n\t\t|| $data['network_id'] !== $old_site->network_id\n\t) {\n\t\tif ( domain_exists( $data['domain'], $data['path'], $data['network_id'] ) ) {\n\t\t\t$errors->add( 'site_taken', __( 'Sorry, that site already exists!' ) );\n\t\t}\n\t}\n}\n\n/**\n * Runs the initialization routine for a given site.\n *\n * This process includes creating the site's database tables and\n * populating them with defaults.\n *\n * @since 5.1.0\n *\n * @global wpdb     $wpdb     WordPress database abstraction object.\n * @global WP_Roles $wp_roles WordPress role management object.\n *\n * @param int|WP_Site $site_id Site ID or object.\n * @param array       $args    {\n *     Optional. Arguments to modify the initialization behavior.\n *\n *     @type int    $user_id Required. User ID for the site administrator.\n *     @type string $title   Site title. Default is 'Site %d' where %d is the\n *                           site ID.\n *     @type array  $options Custom option $key => $value pairs to use. Default\n *                           empty array.\n *     @type array  $meta    Custom site metadata $key => $value pairs to use.\n *                           Default empty array.\n * }\n * @return bool|WP_Error True on success, or error object on failure.\n */\nfunction wp_initialize_site( $site_id, array $args = array() ) {\n\tglobal $wpdb, $wp_roles;\n\n\tif ( empty( $site_id ) ) {\n\t\treturn new WP_Error( 'site_empty_id', __( 'Site ID must not be empty.' ) );\n\t}\n\n\t$site = get_site( $site_id );\n\tif ( ! $site ) {\n\t\treturn new WP_Error( 'site_invalid_id', __( 'Site with the ID does not exist.' ) );\n\t}\n\n\tif ( wp_is_site_initialized( $site ) ) {\n\t\treturn new WP_Error( 'site_already_initialized', __( 'The site appears to be already initialized.' ) );\n\t}\n\n\t$network = get_network( $site->network_id );\n\tif ( ! $network ) {\n\t\t$network = get_network();\n\t}\n\n\t$args = wp_parse_args(\n\t\t$args,\n\t\tarray(\n\t\t\t'user_id' => 0,\n\t\t\t/* translators: %d: Site ID. */\n\t\t\t'title'   => sprintf( __( 'Site %d' ), $site->id ),\n\t\t\t'options' => array(),\n\t\t\t'meta'    => array(),\n\t\t)\n\t);\n\n\t/**\n\t * Filters the arguments for initializing a site.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param array      $args    Arguments to modify the initialization behavior.\n\t * @param WP_Site    $site    Site that is being initialized.\n\t * @param WP_Network $network Network that the site belongs to.\n\t */\n\t$args = apply_filters( 'wp_initialize_site_args', $args, $site, $network );\n\n\t$orig_installing = wp_installing();\n\tif ( ! $orig_installing ) {\n\t\twp_installing( true );\n\t}\n\n\t$switch = false;\n\tif ( get_current_blog_id() !== $site->id ) {\n\t\t$switch = true;\n\t\tswitch_to_blog( $site->id );\n\t}\n\n\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\n\t// Set up the database tables.\n\tmake_db_current_silent( 'blog' );\n\n\t$home_scheme    = 'http';\n\t$siteurl_scheme = 'http';\n\tif ( ! is_subdomain_install() ) {\n\t\tif ( 'https' === parse_url( get_home_url( $network->site_id ), PHP_URL_SCHEME ) ) {\n\t\t\t$home_scheme = 'https';\n\t\t}\n\t\tif ( 'https' === parse_url( get_network_option( $network->id, 'siteurl' ), PHP_URL_SCHEME ) ) {\n\t\t\t$siteurl_scheme = 'https';\n\t\t}\n\t}\n\n\t// Populate the site's options.\n\tpopulate_options(\n\t\tarray_merge(\n\t\t\tarray(\n\t\t\t\t'home'        => untrailingslashit( $home_scheme . '://' . $site->domain . $site->path ),\n\t\t\t\t'siteurl'     => untrailingslashit( $siteurl_scheme . '://' . $site->domain . $site->path ),\n\t\t\t\t'blogname'    => wp_unslash( $args['title'] ),\n\t\t\t\t'admin_email' => '',\n\t\t\t\t'upload_path' => get_network_option( $network->id, 'ms_files_rewriting' ) ? UPLOADBLOGSDIR . \"/{$site->id}/files\" : get_blog_option( $network->site_id, 'upload_path' ),\n\t\t\t\t'blog_public' => (int) $site->public,\n\t\t\t\t'WPLANG'      => get_network_option( $network->id, 'WPLANG' ),\n\t\t\t),\n\t\t\t$args['options']\n\t\t)\n\t);\n\n\t// Clean blog cache after populating options.\n\tclean_blog_cache( $site );\n\n\t// Populate the site's roles.\n\tpopulate_roles();\n\t$wp_roles = new WP_Roles();\n\n\t// Populate metadata for the site.\n\tpopulate_site_meta( $site->id, $args['meta'] );\n\n\t// Remove all permissions that may exist for the site.\n\t$table_prefix = $wpdb->get_blog_prefix();\n\tdelete_metadata( 'user', 0, $table_prefix . 'user_level', null, true );   // Delete all.\n\tdelete_metadata( 'user', 0, $table_prefix . 'capabilities', null, true ); // Delete all.\n\n\t// Install default site content.\n\twp_install_defaults( $args['user_id'] );\n\n\t// Set the site administrator.\n\tadd_user_to_blog( $site->id, $args['user_id'], 'administrator' );\n\tif ( ! user_can( $args['user_id'], 'manage_network' ) && ! get_user_meta( $args['user_id'], 'primary_blog', true ) ) {\n\t\tupdate_user_meta( $args['user_id'], 'primary_blog', $site->id );\n\t}\n\n\tif ( $switch ) {\n\t\trestore_current_blog();\n\t}\n\n\twp_installing( $orig_installing );\n\n\treturn true;\n}\n\n/**\n * Runs the uninitialization routine for a given site.\n *\n * This process includes dropping the site's database tables and deleting its uploads directory.\n *\n * @since 5.1.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int|WP_Site $site_id Site ID or object.\n * @return bool|WP_Error True on success, or error object on failure.\n */\nfunction wp_uninitialize_site( $site_id ) {\n\tglobal $wpdb;\n\n\tif ( empty( $site_id ) ) {\n\t\treturn new WP_Error( 'site_empty_id', __( 'Site ID must not be empty.' ) );\n\t}\n\n\t$site = get_site( $site_id );\n\tif ( ! $site ) {\n\t\treturn new WP_Error( 'site_invalid_id', __( 'Site with the ID does not exist.' ) );\n\t}\n\n\tif ( ! wp_is_site_initialized( $site ) ) {\n\t\treturn new WP_Error( 'site_already_uninitialized', __( 'The site appears to be already uninitialized.' ) );\n\t}\n\n\t$users = get_users(\n\t\tarray(\n\t\t\t'blog_id' => $site->id,\n\t\t\t'fields'  => 'ids',\n\t\t)\n\t);\n\n\t// Remove users from the site.\n\tif ( ! empty( $users ) ) {\n\t\tforeach ( $users as $user_id ) {\n\t\t\tremove_user_from_blog( $user_id, $site->id );\n\t\t}\n\t}\n\n\t$switch = false;\n\tif ( get_current_blog_id() !== $site->id ) {\n\t\t$switch = true;\n\t\tswitch_to_blog( $site->id );\n\t}\n\n\t$uploads = wp_get_upload_dir();\n\n\t$tables = $wpdb->tables( 'blog' );\n\n\t/**\n\t * Filters the tables to drop when the site is deleted.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param string[] $tables  Array of names of the site tables to be dropped.\n\t * @param int      $site_id The ID of the site to drop tables for.\n\t */\n\t$drop_tables = apply_filters( 'wpmu_drop_tables', $tables, $site->id );\n\n\tforeach ( (array) $drop_tables as $table ) {\n\t\t$wpdb->query( \"DROP TABLE IF EXISTS `$table`\" ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t}\n\n\t/**\n\t * Filters the upload base directory to delete when the site is deleted.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param string $uploads['basedir'] Uploads path without subdirectory. @see wp_upload_dir()\n\t * @param int    $site_id            The site ID.\n\t */\n\t$dir     = apply_filters( 'wpmu_delete_blog_upload_dir', $uploads['basedir'], $site->id );\n\t$dir     = rtrim( $dir, DIRECTORY_SEPARATOR );\n\t$top_dir = $dir;\n\t$stack   = array( $dir );\n\t$index   = 0;\n\n\twhile ( $index < count( $stack ) ) {\n\t\t// Get indexed directory from stack.\n\t\t$dir = $stack[ $index ];\n\n\t\t// phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged\n\t\t$dh = @opendir( $dir );\n\t\tif ( $dh ) {\n\t\t\t$file = @readdir( $dh );\n\t\t\twhile ( false !== $file ) {\n\t\t\t\tif ( '.' === $file || '..' === $file ) {\n\t\t\t\t\t$file = @readdir( $dh );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( @is_dir( $dir . DIRECTORY_SEPARATOR . $file ) ) {\n\t\t\t\t\t$stack[] = $dir . DIRECTORY_SEPARATOR . $file;\n\t\t\t\t} elseif ( @is_file( $dir . DIRECTORY_SEPARATOR . $file ) ) {\n\t\t\t\t\t@unlink( $dir . DIRECTORY_SEPARATOR . $file );\n\t\t\t\t}\n\n\t\t\t\t$file = @readdir( $dh );\n\t\t\t}\n\t\t\t@closedir( $dh );\n\t\t}\n\t\t$index++;\n\t}\n\n\t$stack = array_reverse( $stack ); // Last added directories are deepest.\n\tforeach ( (array) $stack as $dir ) {\n\t\tif ( $dir != $top_dir ) {\n\t\t\t@rmdir( $dir );\n\t\t}\n\t}\n\n\t// phpcs:enable WordPress.PHP.NoSilencedErrors.Discouraged\n\tif ( $switch ) {\n\t\trestore_current_blog();\n\t}\n\n\treturn true;\n}\n\n/**\n * Checks whether a site is initialized.\n *\n * A site is considered initialized when its database tables are present.\n *\n * @since 5.1.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int|WP_Site $site_id Site ID or object.\n * @return bool True if the site is initialized, false otherwise.\n */\nfunction wp_is_site_initialized( $site_id ) {\n\tglobal $wpdb;\n\n\tif ( is_object( $site_id ) ) {\n\t\t$site_id = $site_id->blog_id;\n\t}\n\t$site_id = (int) $site_id;\n\n\t/**\n\t * Filters the check for whether a site is initialized before the database is accessed.\n\t *\n\t * Returning a non-null value will effectively short-circuit the function, returning\n\t * that value instead.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param bool|null $pre     The value to return instead. Default null\n\t *                           to continue with the check.\n\t * @param int       $site_id The site ID that is being checked.\n\t */\n\t$pre = apply_filters( 'pre_wp_is_site_initialized', null, $site_id );\n\tif ( null !== $pre ) {\n\t\treturn (bool) $pre;\n\t}\n\n\t$switch = false;\n\tif ( get_current_blog_id() !== $site_id ) {\n\t\t$switch = true;\n\t\tremove_action( 'switch_blog', 'wp_switch_roles_and_user', 1 );\n\t\tswitch_to_blog( $site_id );\n\t}\n\n\t$suppress = $wpdb->suppress_errors();\n\t$result   = (bool) $wpdb->get_results( \"DESCRIBE {$wpdb->posts}\" );\n\t$wpdb->suppress_errors( $suppress );\n\n\tif ( $switch ) {\n\t\trestore_current_blog();\n\t\tadd_action( 'switch_blog', 'wp_switch_roles_and_user', 1, 2 );\n\t}\n\n\treturn $result;\n}\n\n/**\n * Clean the blog cache\n *\n * @since 3.5.0\n *\n * @global bool $_wp_suspend_cache_invalidation\n *\n * @param WP_Site|int $blog The site object or ID to be cleared from cache.\n */\nfunction clean_blog_cache( $blog ) {\n\tglobal $_wp_suspend_cache_invalidation;\n\n\tif ( ! empty( $_wp_suspend_cache_invalidation ) ) {\n\t\treturn;\n\t}\n\n\tif ( empty( $blog ) ) {\n\t\treturn;\n\t}\n\n\t$blog_id = $blog;\n\t$blog    = get_site( $blog_id );\n\tif ( ! $blog ) {\n\t\tif ( ! is_numeric( $blog_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure a WP_Site object exists even when the site has been deleted.\n\t\t$blog = new WP_Site(\n\t\t\t(object) array(\n\t\t\t\t'blog_id' => $blog_id,\n\t\t\t\t'domain'  => null,\n\t\t\t\t'path'    => null,\n\t\t\t)\n\t\t);\n\t}\n\n\t$blog_id         = $blog->blog_id;\n\t$domain_path_key = md5( $blog->domain . $blog->path );\n\n\twp_cache_delete( $blog_id, 'sites' );\n\twp_cache_delete( $blog_id, 'site-details' );\n\twp_cache_delete( $blog_id, 'blog-details' );\n\twp_cache_delete( $blog_id . 'short', 'blog-details' );\n\twp_cache_delete( $domain_path_key, 'blog-lookup' );\n\twp_cache_delete( $domain_path_key, 'blog-id-cache' );\n\twp_cache_delete( $blog_id, 'blog_meta' );\n\n\t/**\n\t * Fires immediately after a site has been removed from the object cache.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param int     $id              Blog ID.\n\t * @param WP_Site $blog            Site object.\n\t * @param string  $domain_path_key md5 hash of domain and path.\n\t */\n\tdo_action( 'clean_site_cache', $blog_id, $blog, $domain_path_key );\n\n\twp_cache_set( 'last_changed', microtime(), 'sites' );\n\n\t/**\n\t * Fires after the blog details cache is cleared.\n\t *\n\t * @since 3.4.0\n\t * @deprecated 4.9.0 Use {@see 'clean_site_cache'} instead.\n\t *\n\t * @param int $blog_id Blog ID.\n\t */\n\tdo_action_deprecated( 'refresh_blog_details', array( $blog_id ), '4.9.0', 'clean_site_cache' );\n}\n\n/**\n * Adds metadata to a site.\n *\n * @since 5.1.0\n *\n * @param int    $site_id    Site ID.\n * @param string $meta_key   Metadata name.\n * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.\n * @param bool   $unique     Optional. Whether the same key should not be added.\n *                           Default false.\n * @return int|false Meta ID on success, false on failure.\n */\nfunction add_site_meta( $site_id, $meta_key, $meta_value, $unique = false ) {\n\treturn add_metadata( 'blog', $site_id, $meta_key, $meta_value, $unique );\n}\n\n/**\n * Removes metadata matching criteria from a site.\n *\n * You can match based on the key, or key and value. Removing based on key and\n * value, will keep from removing duplicate metadata with the same key. It also\n * allows removing all metadata matching key, if needed.\n *\n * @since 5.1.0\n *\n * @param int    $site_id    Site ID.\n * @param string $meta_key   Metadata name.\n * @param mixed  $meta_value Optional. Metadata value. If provided,\n *                           rows will only be removed that match the value.\n *                           Must be serializable if non-scalar. Default empty.\n * @return bool True on success, false on failure.\n */\nfunction delete_site_meta( $site_id, $meta_key, $meta_value = '' ) {\n\treturn delete_metadata( 'blog', $site_id, $meta_key, $meta_value );\n}\n\n/**\n * Retrieves metadata for a site.\n *\n * @since 5.1.0\n *\n * @param int    $site_id Site ID.\n * @param string $key     Optional. The meta key to retrieve. By default,\n *                        returns data for all keys. Default empty.\n * @param bool   $single  Optional. Whether to return a single value.\n *                        This parameter has no effect if $key is not specified.\n *                        Default false.\n * @return mixed An array if $single is false. The value of meta data field\n *               if $single is true. False for an invalid $site_id.\n */\nfunction get_site_meta( $site_id, $key = '', $single = false ) {\n\treturn get_metadata( 'blog', $site_id, $key, $single );\n}\n\n/**\n * Updates metadata for a site.\n *\n * Use the $prev_value parameter to differentiate between meta fields with the\n * same key and site ID.\n *\n * If the meta field for the site does not exist, it will be added.\n *\n * @since 5.1.0\n *\n * @param int    $site_id    Site ID.\n * @param string $meta_key   Metadata key.\n * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.\n * @param mixed  $prev_value Optional. Previous value to check before updating.\n *                           If specified, only update existing metadata entries with\n *                           this value. Otherwise, update all entries. Default empty.\n * @return int|bool Meta ID if the key didn't exist, true on successful update,\n *                  false on failure or if the value passed to the function\n *                  is the same as the one that is already in the database.\n */\nfunction update_site_meta( $site_id, $meta_key, $meta_value, $prev_value = '' ) {\n\treturn update_metadata( 'blog', $site_id, $meta_key, $meta_value, $prev_value );\n}\n\n/**\n * Deletes everything from site meta matching meta key.\n *\n * @since 5.1.0\n *\n * @param string $meta_key Metadata key to search for when deleting.\n * @return bool Whether the site meta key was deleted from the database.\n */\nfunction delete_site_meta_by_key( $meta_key ) {\n\treturn delete_metadata( 'blog', null, $meta_key, '', true );\n}\n\n/**\n * Updates the count of sites for a network based on a changed site.\n *\n * @since 5.1.0\n *\n * @param WP_Site      $new_site The site object that has been inserted, updated or deleted.\n * @param WP_Site|null $old_site Optional. If $new_site has been updated, this must be the previous\n *                               state of that site. Default null.\n */\nfunction wp_maybe_update_network_site_counts_on_update( $new_site, $old_site = null ) {\n\tif ( null === $old_site ) {\n\t\twp_maybe_update_network_site_counts( $new_site->network_id );\n\t\treturn;\n\t}\n\n\tif ( $new_site->network_id != $old_site->network_id ) {\n\t\twp_maybe_update_network_site_counts( $new_site->network_id );\n\t\twp_maybe_update_network_site_counts( $old_site->network_id );\n\t}\n}\n\n/**\n * Triggers actions on site status updates.\n *\n * @since 5.1.0\n *\n * @param WP_Site      $new_site The site object after the update.\n * @param WP_Site|null $old_site Optional. If $new_site has been updated, this must be the previous\n *                               state of that site. Default null.\n */\nfunction wp_maybe_transition_site_statuses_on_update( $new_site, $old_site = null ) {\n\t$site_id = $new_site->id;\n\n\t// Use the default values for a site if no previous state is given.\n\tif ( ! $old_site ) {\n\t\t$old_site = new WP_Site( new stdClass() );\n\t}\n\n\tif ( $new_site->spam != $old_site->spam ) {\n\t\tif ( 1 == $new_site->spam ) {\n\n\t\t\t/**\n\t\t\t * Fires when the 'spam' status is added to a site.\n\t\t\t *\n\t\t\t * @since MU (3.0.0)\n\t\t\t *\n\t\t\t * @param int $site_id Site ID.\n\t\t\t */\n\t\t\tdo_action( 'make_spam_blog', $site_id );\n\t\t} else {\n\n\t\t\t/**\n\t\t\t * Fires when the 'spam' status is removed from a site.\n\t\t\t *\n\t\t\t * @since MU (3.0.0)\n\t\t\t *\n\t\t\t * @param int $site_id Site ID.\n\t\t\t */\n\t\t\tdo_action( 'make_ham_blog', $site_id );\n\t\t}\n\t}\n\n\tif ( $new_site->mature != $old_site->mature ) {\n\t\tif ( 1 == $new_site->mature ) {\n\n\t\t\t/**\n\t\t\t * Fires when the 'mature' status is added to a site.\n\t\t\t *\n\t\t\t * @since 3.1.0\n\t\t\t *\n\t\t\t * @param int $site_id Site ID.\n\t\t\t */\n\t\t\tdo_action( 'mature_blog', $site_id );\n\t\t} else {\n\n\t\t\t/**\n\t\t\t * Fires when the 'mature' status is removed from a site.\n\t\t\t *\n\t\t\t * @since 3.1.0\n\t\t\t *\n\t\t\t * @param int $site_id Site ID.\n\t\t\t */\n\t\t\tdo_action( 'unmature_blog', $site_id );\n\t\t}\n\t}\n\n\tif ( $new_site->archived != $old_site->archived ) {\n\t\tif ( 1 == $new_site->archived ) {\n\n\t\t\t/**\n\t\t\t * Fires when the 'archived' status is added to a site.\n\t\t\t *\n\t\t\t * @since MU (3.0.0)\n\t\t\t *\n\t\t\t * @param int $site_id Site ID.\n\t\t\t */\n\t\t\tdo_action( 'archive_blog', $site_id );\n\t\t} else {\n\n\t\t\t/**\n\t\t\t * Fires when the 'archived' status is removed from a site.\n\t\t\t *\n\t\t\t * @since MU (3.0.0)\n\t\t\t *\n\t\t\t * @param int $site_id Site ID.\n\t\t\t */\n\t\t\tdo_action( 'unarchive_blog', $site_id );\n\t\t}\n\t}\n\n\tif ( $new_site->deleted != $old_site->deleted ) {\n\t\tif ( 1 == $new_site->deleted ) {\n\n\t\t\t/**\n\t\t\t * Fires when the 'deleted' status is added to a site.\n\t\t\t *\n\t\t\t * @since 3.5.0\n\t\t\t *\n\t\t\t * @param int $site_id Site ID.\n\t\t\t */\n\t\t\tdo_action( 'make_delete_blog', $site_id );\n\t\t} else {\n\n\t\t\t/**\n\t\t\t * Fires when the 'deleted' status is removed from a site.\n\t\t\t *\n\t\t\t * @since 3.5.0\n\t\t\t *\n\t\t\t * @param int $site_id Site ID.\n\t\t\t */\n\t\t\tdo_action( 'make_undelete_blog', $site_id );\n\t\t}\n\t}\n\n\tif ( $new_site->public != $old_site->public ) {\n\n\t\t/**\n\t\t * Fires after the current blog's 'public' setting is updated.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t *\n\t\t * @param int    $site_id Site ID.\n\t\t * @param string $value   The value of the site status.\n\t\t */\n\t\tdo_action( 'update_blog_public', $site_id, $new_site->public );\n\t}\n}\n\n/**\n * Cleans the necessary caches after specific site data has been updated.\n *\n * @since 5.1.0\n *\n * @param WP_Site $new_site The site object after the update.\n * @param WP_Site $old_site The site obejct prior to the update.\n */\nfunction wp_maybe_clean_new_site_cache_on_update( $new_site, $old_site ) {\n\tif ( $old_site->domain !== $new_site->domain || $old_site->path !== $new_site->path ) {\n\t\tclean_blog_cache( $new_site );\n\t}\n}\n\n/**\n * Updates the `blog_public` option for a given site ID.\n *\n * @since 5.1.0\n *\n * @param int    $site_id Site ID.\n * @param string $public  The value of the site status.\n */\nfunction wp_update_blog_public_option_on_site_update( $site_id, $public ) {\n\n\t// Bail if the site's database tables do not exist (yet).\n\tif ( ! wp_is_site_initialized( $site_id ) ) {\n\t\treturn;\n\t}\n\n\tupdate_blog_option( $site_id, 'blog_public', $public );\n}\n\n/**\n * Sets the last changed time for the 'sites' cache group.\n *\n * @since 5.1.0\n */\nfunction wp_cache_set_sites_last_changed() {\n\twp_cache_set( 'last_changed', microtime(), 'sites' );\n}\n\n/**\n * Aborts calls to site meta if it is not supported.\n *\n * @since 5.1.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param mixed $check Skip-value for whether to proceed site meta function execution.\n * @return mixed Original value of $check, or false if site meta is not supported.\n */\nfunction wp_check_site_meta_support_prefilter( $check ) {\n\tif ( ! is_site_meta_supported() ) {\n\t\t/* translators: %s: Database table name. */\n\t\t_doing_it_wrong( __FUNCTION__, sprintf( __( 'The %s table is not installed. Please run the network database upgrade.' ), $GLOBALS['wpdb']->blogmeta ), '5.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $check;\n}\n", "num_lines": 1340}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Nav Menu API: Template functions\n *\n * @package WordPress\n * @subpackage Nav_Menus\n * @since 3.0.0\n */\n\n/** Walker_Nav_Menu class */\nrequire_once ABSPATH . WPINC . '/class-walker-nav-menu.php';\n\n/**\n * Displays a navigation menu.\n *\n * @since 3.0.0\n * @since 4.7.0 Added the `item_spacing` argument.\n * @since 5.5.0 Added the `container_aria_label` argument.\n *\n * @param array $args {\n *     Optional. Array of nav menu arguments.\n *\n *     @type int|string|WP_Term $menu                 Desired menu. Accepts a menu ID, slug, name, or object.\n *                                                    Default empty.\n *     @type string             $menu_class           CSS class to use for the ul element which forms the menu.\n *                                                    Default 'menu'.\n *     @type string             $menu_id              The ID that is applied to the ul element which forms the menu.\n *                                                    Default is the menu slug, incremented.\n *     @type string             $container            Whether to wrap the ul, and what to wrap it with.\n *                                                    Default 'div'.\n *     @type string             $container_class      Class that is applied to the container.\n *                                                    Default 'menu-{menu slug}-container'.\n *     @type string             $container_id         The ID that is applied to the container. Default empty.\n *     @type string             $container_aria_label The aria-label attribute that is applied to the container\n *                                                    when it's a nav element. Default empty.\n *     @type callable|bool      $fallback_cb          If the menu doesn't exist, a callback function will fire.\n *                                                    Default is 'wp_page_menu'. Set to false for no fallback.\n *     @type string             $before               Text before the link markup. Default empty.\n *     @type string             $after                Text after the link markup. Default empty.\n *     @type string             $link_before          Text before the link text. Default empty.\n *     @type string             $link_after           Text after the link text. Default empty.\n *     @type bool               $echo                 Whether to echo the menu or return it. Default true.\n *     @type int                $depth                How many levels of the hierarchy are to be included.\n *                                                    0 means all. Default 0.\n *                                                    Default 0.\n *     @type object             $walker               Instance of a custom walker class. Default empty.\n *     @type string             $theme_location       Theme location to be used. Must be registered with\n *                                                    register_nav_menu() in order to be selectable by the user.\n *     @type string             $items_wrap           How the list items should be wrapped. Uses printf() format with\n *                                                    numbered placeholders. Default is a ul with an id and class.\n *     @type string             $item_spacing         Whether to preserve whitespace within the menu's HTML.\n *                                                    Accepts 'preserve' or 'discard'. Default 'preserve'.\n * }\n * @return void|string|false Void if 'echo' argument is true, menu output if 'echo' is false.\n *                           False if there are no items or no menu was found.\n */\nfunction wp_nav_menu( $args = array() ) {\n\tstatic $menu_id_slugs = array();\n\n\t$defaults = array(\n\t\t'menu'                 => '',\n\t\t'container'            => 'div',\n\t\t'container_class'      => '',\n\t\t'container_id'         => '',\n\t\t'container_aria_label' => '',\n\t\t'menu_class'           => 'menu',\n\t\t'menu_id'              => '',\n\t\t'echo'                 => true,\n\t\t'fallback_cb'          => 'wp_page_menu',\n\t\t'before'               => '',\n\t\t'after'                => '',\n\t\t'link_before'          => '',\n\t\t'link_after'           => '',\n\t\t'items_wrap'           => '<ul id=\"%1$s\" class=\"%2$s\">%3$s</ul>',\n\t\t'item_spacing'         => 'preserve',\n\t\t'depth'                => 0,\n\t\t'walker'               => '',\n\t\t'theme_location'       => '',\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\tif ( ! in_array( $args['item_spacing'], array( 'preserve', 'discard' ), true ) ) {\n\t\t// Invalid value, fall back to default.\n\t\t$args['item_spacing'] = $defaults['item_spacing'];\n\t}\n\n\t/**\n\t * Filters the arguments used to display a navigation menu.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @see wp_nav_menu()\n\t *\n\t * @param array $args Array of wp_nav_menu() arguments.\n\t */\n\t$args = apply_filters( 'wp_nav_menu_args', $args );\n\t$args = (object) $args;\n\n\t/**\n\t * Filters whether to short-circuit the wp_nav_menu() output.\n\t *\n\t * Returning a non-null value from the filter will short-circuit wp_nav_menu(),\n\t * echoing that value if $args->echo is true, returning that value otherwise.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @see wp_nav_menu()\n\t *\n\t * @param string|null $output Nav menu output to short-circuit with. Default null.\n\t * @param stdClass    $args   An object containing wp_nav_menu() arguments.\n\t */\n\t$nav_menu = apply_filters( 'pre_wp_nav_menu', null, $args );\n\n\tif ( null !== $nav_menu ) {\n\t\tif ( $args->echo ) {\n\t\t\techo $nav_menu;\n\t\t\treturn;\n\t\t}\n\n\t\treturn $nav_menu;\n\t}\n\n\t// Get the nav menu based on the requested menu.\n\t$menu = wp_get_nav_menu_object( $args->menu );\n\n\t// Get the nav menu based on the theme_location.\n\t$locations = get_nav_menu_locations();\n\tif ( ! $menu && $args->theme_location && $locations && isset( $locations[ $args->theme_location ] ) ) {\n\t\t$menu = wp_get_nav_menu_object( $locations[ $args->theme_location ] );\n\t}\n\n\t// Get the first menu that has items if we still can't find a menu.\n\tif ( ! $menu && ! $args->theme_location ) {\n\t\t$menus = wp_get_nav_menus();\n\t\tforeach ( $menus as $menu_maybe ) {\n\t\t\t$menu_items = wp_get_nav_menu_items( $menu_maybe->term_id, array( 'update_post_term_cache' => false ) );\n\t\t\tif ( $menu_items ) {\n\t\t\t\t$menu = $menu_maybe;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( empty( $args->menu ) ) {\n\t\t$args->menu = $menu;\n\t}\n\n\t// If the menu exists, get its items.\n\tif ( $menu && ! is_wp_error( $menu ) && ! isset( $menu_items ) ) {\n\t\t$menu_items = wp_get_nav_menu_items( $menu->term_id, array( 'update_post_term_cache' => false ) );\n\t}\n\n\t/*\n\t * If no menu was found:\n\t *  - Fall back (if one was specified), or bail.\n\t *\n\t * If no menu items were found:\n\t *  - Fall back, but only if no theme location was specified.\n\t *  - Otherwise, bail.\n\t */\n\tif ( ( ! $menu || is_wp_error( $menu ) || ( isset( $menu_items ) && empty( $menu_items ) && ! $args->theme_location ) )\n\t\t&& isset( $args->fallback_cb ) && $args->fallback_cb && is_callable( $args->fallback_cb ) ) {\n\t\t\treturn call_user_func( $args->fallback_cb, (array) $args );\n\t}\n\n\tif ( ! $menu || is_wp_error( $menu ) ) {\n\t\treturn false;\n\t}\n\n\t$nav_menu = '';\n\t$items    = '';\n\n\t$show_container = false;\n\tif ( $args->container ) {\n\t\t/**\n\t\t * Filters the list of HTML tags that are valid for use as menu containers.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string[] $tags The acceptable HTML tags for use as menu containers.\n\t\t *                       Default is array containing 'div' and 'nav'.\n\t\t */\n\t\t$allowed_tags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'nav' ) );\n\n\t\tif ( is_string( $args->container ) && in_array( $args->container, $allowed_tags, true ) ) {\n\t\t\t$show_container = true;\n\t\t\t$class          = $args->container_class ? ' class=\"' . esc_attr( $args->container_class ) . '\"' : ' class=\"menu-' . $menu->slug . '-container\"';\n\t\t\t$id             = $args->container_id ? ' id=\"' . esc_attr( $args->container_id ) . '\"' : '';\n\t\t\t$aria_label     = ( 'nav' === $args->container && $args->container_aria_label ) ? ' aria-label=\"' . esc_attr( $args->container_aria_label ) . '\"' : '';\n\t\t\t$nav_menu      .= '<' . $args->container . $id . $class . $aria_label . '>';\n\t\t}\n\t}\n\n\t// Set up the $menu_item variables.\n\t_wp_menu_item_classes_by_context( $menu_items );\n\n\t$sorted_menu_items        = array();\n\t$menu_items_with_children = array();\n\tforeach ( (array) $menu_items as $menu_item ) {\n\t\t$sorted_menu_items[ $menu_item->menu_order ] = $menu_item;\n\t\tif ( $menu_item->menu_item_parent ) {\n\t\t\t$menu_items_with_children[ $menu_item->menu_item_parent ] = true;\n\t\t}\n\t}\n\n\t// Add the menu-item-has-children class where applicable.\n\tif ( $menu_items_with_children ) {\n\t\tforeach ( $sorted_menu_items as &$menu_item ) {\n\t\t\tif ( isset( $menu_items_with_children[ $menu_item->ID ] ) ) {\n\t\t\t\t$menu_item->classes[] = 'menu-item-has-children';\n\t\t\t}\n\t\t}\n\t}\n\n\tunset( $menu_items, $menu_item );\n\n\t/**\n\t * Filters the sorted list of menu item objects before generating the menu's HTML.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param array    $sorted_menu_items The menu items, sorted by each menu item's menu order.\n\t * @param stdClass $args              An object containing wp_nav_menu() arguments.\n\t */\n\t$sorted_menu_items = apply_filters( 'wp_nav_menu_objects', $sorted_menu_items, $args );\n\n\t$items .= walk_nav_menu_tree( $sorted_menu_items, $args->depth, $args );\n\tunset( $sorted_menu_items );\n\n\t// Attributes.\n\tif ( ! empty( $args->menu_id ) ) {\n\t\t$wrap_id = $args->menu_id;\n\t} else {\n\t\t$wrap_id = 'menu-' . $menu->slug;\n\n\t\twhile ( in_array( $wrap_id, $menu_id_slugs, true ) ) {\n\t\t\tif ( preg_match( '#-(\\d+)$#', $wrap_id, $matches ) ) {\n\t\t\t\t$wrap_id = preg_replace( '#-(\\d+)$#', '-' . ++$matches[1], $wrap_id );\n\t\t\t} else {\n\t\t\t\t$wrap_id = $wrap_id . '-1';\n\t\t\t}\n\t\t}\n\t}\n\t$menu_id_slugs[] = $wrap_id;\n\n\t$wrap_class = $args->menu_class ? $args->menu_class : '';\n\n\t/**\n\t * Filters the HTML list content for navigation menus.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @see wp_nav_menu()\n\t *\n\t * @param string   $items The HTML list content for the menu items.\n\t * @param stdClass $args  An object containing wp_nav_menu() arguments.\n\t */\n\t$items = apply_filters( 'wp_nav_menu_items', $items, $args );\n\t/**\n\t * Filters the HTML list content for a specific navigation menu.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @see wp_nav_menu()\n\t *\n\t * @param string   $items The HTML list content for the menu items.\n\t * @param stdClass $args  An object containing wp_nav_menu() arguments.\n\t */\n\t$items = apply_filters( \"wp_nav_menu_{$menu->slug}_items\", $items, $args );\n\n\t// Don't print any markup if there are no items at this point.\n\tif ( empty( $items ) ) {\n\t\treturn false;\n\t}\n\n\t$nav_menu .= sprintf( $args->items_wrap, esc_attr( $wrap_id ), esc_attr( $wrap_class ), $items );\n\tunset( $items );\n\n\tif ( $show_container ) {\n\t\t$nav_menu .= '</' . $args->container . '>';\n\t}\n\n\t/**\n\t * Filters the HTML content for navigation menus.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @see wp_nav_menu()\n\t *\n\t * @param string   $nav_menu The HTML content for the navigation menu.\n\t * @param stdClass $args     An object containing wp_nav_menu() arguments.\n\t */\n\t$nav_menu = apply_filters( 'wp_nav_menu', $nav_menu, $args );\n\n\tif ( $args->echo ) {\n\t\techo $nav_menu;\n\t} else {\n\t\treturn $nav_menu;\n\t}\n}\n\n/**\n * Adds the class property classes for the current context, if applicable.\n *\n * @access private\n * @since 3.0.0\n *\n * @global WP_Query   $wp_query   WordPress Query object.\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param array $menu_items The current menu item objects to which to add the class property information.\n */\nfunction _wp_menu_item_classes_by_context( &$menu_items ) {\n\tglobal $wp_query, $wp_rewrite;\n\n\t$queried_object    = $wp_query->get_queried_object();\n\t$queried_object_id = (int) $wp_query->queried_object_id;\n\n\t$active_object               = '';\n\t$active_ancestor_item_ids    = array();\n\t$active_parent_item_ids      = array();\n\t$active_parent_object_ids    = array();\n\t$possible_taxonomy_ancestors = array();\n\t$possible_object_parents     = array();\n\t$home_page_id                = (int) get_option( 'page_for_posts' );\n\n\tif ( $wp_query->is_singular && ! empty( $queried_object->post_type ) && ! is_post_type_hierarchical( $queried_object->post_type ) ) {\n\t\tforeach ( (array) get_object_taxonomies( $queried_object->post_type ) as $taxonomy ) {\n\t\t\tif ( is_taxonomy_hierarchical( $taxonomy ) ) {\n\t\t\t\t$term_hierarchy = _get_term_hierarchy( $taxonomy );\n\t\t\t\t$terms          = wp_get_object_terms( $queried_object_id, $taxonomy, array( 'fields' => 'ids' ) );\n\t\t\t\tif ( is_array( $terms ) ) {\n\t\t\t\t\t$possible_object_parents = array_merge( $possible_object_parents, $terms );\n\t\t\t\t\t$term_to_ancestor        = array();\n\t\t\t\t\tforeach ( (array) $term_hierarchy as $anc => $descs ) {\n\t\t\t\t\t\tforeach ( (array) $descs as $desc ) {\n\t\t\t\t\t\t\t$term_to_ancestor[ $desc ] = $anc;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ( $terms as $desc ) {\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t$possible_taxonomy_ancestors[ $taxonomy ][] = $desc;\n\t\t\t\t\t\t\tif ( isset( $term_to_ancestor[ $desc ] ) ) {\n\t\t\t\t\t\t\t\t$_desc = $term_to_ancestor[ $desc ];\n\t\t\t\t\t\t\t\tunset( $term_to_ancestor[ $desc ] );\n\t\t\t\t\t\t\t\t$desc = $_desc;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$desc = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} while ( ! empty( $desc ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} elseif ( ! empty( $queried_object->taxonomy ) && is_taxonomy_hierarchical( $queried_object->taxonomy ) ) {\n\t\t$term_hierarchy   = _get_term_hierarchy( $queried_object->taxonomy );\n\t\t$term_to_ancestor = array();\n\t\tforeach ( (array) $term_hierarchy as $anc => $descs ) {\n\t\t\tforeach ( (array) $descs as $desc ) {\n\t\t\t\t$term_to_ancestor[ $desc ] = $anc;\n\t\t\t}\n\t\t}\n\t\t$desc = $queried_object->term_id;\n\t\tdo {\n\t\t\t$possible_taxonomy_ancestors[ $queried_object->taxonomy ][] = $desc;\n\t\t\tif ( isset( $term_to_ancestor[ $desc ] ) ) {\n\t\t\t\t$_desc = $term_to_ancestor[ $desc ];\n\t\t\t\tunset( $term_to_ancestor[ $desc ] );\n\t\t\t\t$desc = $_desc;\n\t\t\t} else {\n\t\t\t\t$desc = 0;\n\t\t\t}\n\t\t} while ( ! empty( $desc ) );\n\t}\n\n\t$possible_object_parents = array_filter( $possible_object_parents );\n\n\t$front_page_url         = home_url();\n\t$front_page_id          = (int) get_option( 'page_on_front' );\n\t$privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );\n\n\tforeach ( (array) $menu_items as $key => $menu_item ) {\n\n\t\t$menu_items[ $key ]->current = false;\n\n\t\t$classes   = (array) $menu_item->classes;\n\t\t$classes[] = 'menu-item';\n\t\t$classes[] = 'menu-item-type-' . $menu_item->type;\n\t\t$classes[] = 'menu-item-object-' . $menu_item->object;\n\n\t\t// This menu item is set as the 'Front Page'.\n\t\tif ( 'post_type' === $menu_item->type && $front_page_id === (int) $menu_item->object_id ) {\n\t\t\t$classes[] = 'menu-item-home';\n\t\t}\n\n\t\t// This menu item is set as the 'Privacy Policy Page'.\n\t\tif ( 'post_type' === $menu_item->type && $privacy_policy_page_id === (int) $menu_item->object_id ) {\n\t\t\t$classes[] = 'menu-item-privacy-policy';\n\t\t}\n\n\t\t// If the menu item corresponds to a taxonomy term for the currently queried non-hierarchical post object.\n\t\tif ( $wp_query->is_singular && 'taxonomy' === $menu_item->type\n\t\t\t&& in_array( (int) $menu_item->object_id, $possible_object_parents, true )\n\t\t) {\n\t\t\t$active_parent_object_ids[] = (int) $menu_item->object_id;\n\t\t\t$active_parent_item_ids[]   = (int) $menu_item->db_id;\n\t\t\t$active_object              = $queried_object->post_type;\n\n\t\t\t// If the menu item corresponds to the currently queried post or taxonomy object.\n\t\t} elseif (\n\t\t\t$menu_item->object_id == $queried_object_id\n\t\t\t&& (\n\t\t\t\t( ! empty( $home_page_id ) && 'post_type' === $menu_item->type\n\t\t\t\t\t&& $wp_query->is_home && $home_page_id == $menu_item->object_id )\n\t\t\t\t|| ( 'post_type' === $menu_item->type && $wp_query->is_singular )\n\t\t\t\t|| ( 'taxonomy' === $menu_item->type\n\t\t\t\t\t&& ( $wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax )\n\t\t\t\t\t&& $queried_object->taxonomy == $menu_item->object )\n\t\t\t)\n\t\t) {\n\t\t\t$classes[]                   = 'current-menu-item';\n\t\t\t$menu_items[ $key ]->current = true;\n\t\t\t$_anc_id                     = (int) $menu_item->db_id;\n\n\t\t\twhile (\n\t\t\t\t( $_anc_id = (int) get_post_meta( $_anc_id, '_menu_item_menu_item_parent', true ) )\n\t\t\t\t&& ! in_array( $_anc_id, $active_ancestor_item_ids, true )\n\t\t\t) {\n\t\t\t\t$active_ancestor_item_ids[] = $_anc_id;\n\t\t\t}\n\n\t\t\tif ( 'post_type' === $menu_item->type && 'page' === $menu_item->object ) {\n\t\t\t\t// Back compat classes for pages to match wp_page_menu().\n\t\t\t\t$classes[] = 'page_item';\n\t\t\t\t$classes[] = 'page-item-' . $menu_item->object_id;\n\t\t\t\t$classes[] = 'current_page_item';\n\t\t\t}\n\n\t\t\t$active_parent_item_ids[]   = (int) $menu_item->menu_item_parent;\n\t\t\t$active_parent_object_ids[] = (int) $menu_item->post_parent;\n\t\t\t$active_object              = $menu_item->object;\n\n\t\t\t// If the menu item corresponds to the currently queried post type archive.\n\t\t} elseif (\n\t\t\t'post_type_archive' === $menu_item->type\n\t\t\t&& is_post_type_archive( array( $menu_item->object ) )\n\t\t) {\n\t\t\t$classes[]                   = 'current-menu-item';\n\t\t\t$menu_items[ $key ]->current = true;\n\t\t\t$_anc_id                     = (int) $menu_item->db_id;\n\n\t\t\twhile (\n\t\t\t\t( $_anc_id = (int) get_post_meta( $_anc_id, '_menu_item_menu_item_parent', true ) )\n\t\t\t\t&& ! in_array( $_anc_id, $active_ancestor_item_ids, true )\n\t\t\t) {\n\t\t\t\t$active_ancestor_item_ids[] = $_anc_id;\n\t\t\t}\n\n\t\t\t$active_parent_item_ids[] = (int) $menu_item->menu_item_parent;\n\n\t\t\t// If the menu item corresponds to the currently requested URL.\n\t\t} elseif ( 'custom' === $menu_item->object && isset( $_SERVER['HTTP_HOST'] ) ) {\n\t\t\t$_root_relative_current = untrailingslashit( $_SERVER['REQUEST_URI'] );\n\n\t\t\t// If it's the customize page then it will strip the query var off the URL before entering the comparison block.\n\t\t\tif ( is_customize_preview() ) {\n\t\t\t\t$_root_relative_current = strtok( untrailingslashit( $_SERVER['REQUEST_URI'] ), '?' );\n\t\t\t}\n\n\t\t\t$current_url        = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_root_relative_current );\n\t\t\t$raw_item_url       = strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url;\n\t\t\t$item_url           = set_url_scheme( untrailingslashit( $raw_item_url ) );\n\t\t\t$_indexless_current = untrailingslashit( preg_replace( '/' . preg_quote( $wp_rewrite->index, '/' ) . '$/', '', $current_url ) );\n\n\t\t\t$matches = array(\n\t\t\t\t$current_url,\n\t\t\t\turldecode( $current_url ),\n\t\t\t\t$_indexless_current,\n\t\t\t\turldecode( $_indexless_current ),\n\t\t\t\t$_root_relative_current,\n\t\t\t\turldecode( $_root_relative_current ),\n\t\t\t);\n\n\t\t\tif ( $raw_item_url && in_array( $item_url, $matches, true ) ) {\n\t\t\t\t$classes[]                   = 'current-menu-item';\n\t\t\t\t$menu_items[ $key ]->current = true;\n\t\t\t\t$_anc_id                     = (int) $menu_item->db_id;\n\n\t\t\t\twhile (\n\t\t\t\t\t( $_anc_id = (int) get_post_meta( $_anc_id, '_menu_item_menu_item_parent', true ) )\n\t\t\t\t\t&& ! in_array( $_anc_id, $active_ancestor_item_ids, true )\n\t\t\t\t) {\n\t\t\t\t\t$active_ancestor_item_ids[] = $_anc_id;\n\t\t\t\t}\n\n\t\t\t\tif ( in_array( home_url(), array( untrailingslashit( $current_url ), untrailingslashit( $_indexless_current ) ), true ) ) {\n\t\t\t\t\t// Back compat for home link to match wp_page_menu().\n\t\t\t\t\t$classes[] = 'current_page_item';\n\t\t\t\t}\n\t\t\t\t$active_parent_item_ids[]   = (int) $menu_item->menu_item_parent;\n\t\t\t\t$active_parent_object_ids[] = (int) $menu_item->post_parent;\n\t\t\t\t$active_object              = $menu_item->object;\n\n\t\t\t\t// Give front page item the 'current-menu-item' class when extra query arguments are involved.\n\t\t\t} elseif ( $item_url == $front_page_url && is_front_page() ) {\n\t\t\t\t$classes[] = 'current-menu-item';\n\t\t\t}\n\n\t\t\tif ( untrailingslashit( $item_url ) == home_url() ) {\n\t\t\t\t$classes[] = 'menu-item-home';\n\t\t\t}\n\t\t}\n\n\t\t// Back-compat with wp_page_menu(): add \"current_page_parent\" to static home page link for any non-page query.\n\t\tif ( ! empty( $home_page_id ) && 'post_type' === $menu_item->type\n\t\t\t&& empty( $wp_query->is_page ) && $home_page_id == $menu_item->object_id\n\t\t) {\n\t\t\t$classes[] = 'current_page_parent';\n\t\t}\n\n\t\t$menu_items[ $key ]->classes = array_unique( $classes );\n\t}\n\t$active_ancestor_item_ids = array_filter( array_unique( $active_ancestor_item_ids ) );\n\t$active_parent_item_ids   = array_filter( array_unique( $active_parent_item_ids ) );\n\t$active_parent_object_ids = array_filter( array_unique( $active_parent_object_ids ) );\n\n\t// Set parent's class.\n\tforeach ( (array) $menu_items as $key => $parent_item ) {\n\t\t$classes                                   = (array) $parent_item->classes;\n\t\t$menu_items[ $key ]->current_item_ancestor = false;\n\t\t$menu_items[ $key ]->current_item_parent   = false;\n\n\t\tif (\n\t\t\tisset( $parent_item->type )\n\t\t\t&& (\n\t\t\t\t// Ancestral post object.\n\t\t\t\t(\n\t\t\t\t\t'post_type' === $parent_item->type\n\t\t\t\t\t&& ! empty( $queried_object->post_type )\n\t\t\t\t\t&& is_post_type_hierarchical( $queried_object->post_type )\n\t\t\t\t\t&& in_array( (int) $parent_item->object_id, $queried_object->ancestors, true )\n\t\t\t\t\t&& $parent_item->object != $queried_object->ID\n\t\t\t\t) ||\n\n\t\t\t\t// Ancestral term.\n\t\t\t\t(\n\t\t\t\t\t'taxonomy' === $parent_item->type\n\t\t\t\t\t&& isset( $possible_taxonomy_ancestors[ $parent_item->object ] )\n\t\t\t\t\t&& in_array( (int) $parent_item->object_id, $possible_taxonomy_ancestors[ $parent_item->object ], true )\n\t\t\t\t\t&& (\n\t\t\t\t\t\t! isset( $queried_object->term_id ) ||\n\t\t\t\t\t\t$parent_item->object_id != $queried_object->term_id\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t) {\n\t\t\tif ( ! empty( $queried_object->taxonomy ) ) {\n\t\t\t\t$classes[] = 'current-' . $queried_object->taxonomy . '-ancestor';\n\t\t\t} else {\n\t\t\t\t$classes[] = 'current-' . $queried_object->post_type . '-ancestor';\n\t\t\t}\n\t\t}\n\n\t\tif ( in_array( (int) $parent_item->db_id, $active_ancestor_item_ids, true ) ) {\n\t\t\t$classes[] = 'current-menu-ancestor';\n\n\t\t\t$menu_items[ $key ]->current_item_ancestor = true;\n\t\t}\n\t\tif ( in_array( (int) $parent_item->db_id, $active_parent_item_ids, true ) ) {\n\t\t\t$classes[] = 'current-menu-parent';\n\n\t\t\t$menu_items[ $key ]->current_item_parent = true;\n\t\t}\n\t\tif ( in_array( (int) $parent_item->object_id, $active_parent_object_ids, true ) ) {\n\t\t\t$classes[] = 'current-' . $active_object . '-parent';\n\t\t}\n\n\t\tif ( 'post_type' === $parent_item->type && 'page' === $parent_item->object ) {\n\t\t\t// Back compat classes for pages to match wp_page_menu().\n\t\t\tif ( in_array( 'current-menu-parent', $classes, true ) ) {\n\t\t\t\t$classes[] = 'current_page_parent';\n\t\t\t}\n\t\t\tif ( in_array( 'current-menu-ancestor', $classes, true ) ) {\n\t\t\t\t$classes[] = 'current_page_ancestor';\n\t\t\t}\n\t\t}\n\n\t\t$menu_items[ $key ]->classes = array_unique( $classes );\n\t}\n}\n\n/**\n * Retrieves the HTML list content for nav menu items.\n *\n * @uses Walker_Nav_Menu to create HTML list content.\n * @since 3.0.0\n *\n * @param array    $items The menu items, sorted by each menu item's menu order.\n * @param int      $depth Depth of the item in reference to parents.\n * @param stdClass $r     An object containing wp_nav_menu() arguments.\n * @return string The HTML list content for the menu items.\n */\nfunction walk_nav_menu_tree( $items, $depth, $r ) {\n\t$walker = ( empty( $r->walker ) ) ? new Walker_Nav_Menu : $r->walker;\n\n\treturn $walker->walk( $items, $depth, $r );\n}\n\n/**\n * Prevents a menu item ID from being used more than once.\n *\n * @since 3.0.1\n * @access private\n *\n * @param string $id\n * @param object $item\n * @return string\n */\nfunction _nav_menu_item_id_use_once( $id, $item ) {\n\tstatic $_used_ids = array();\n\n\tif ( in_array( $item->ID, $_used_ids, true ) ) {\n\t\treturn '';\n\t}\n\n\t$_used_ids[] = $item->ID;\n\n\treturn $id;\n}\n", "num_lines": 632}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Navigation Menu functions\n *\n * @package WordPress\n * @subpackage Nav_Menus\n * @since 3.0.0\n */\n\n/**\n * Returns a navigation menu object.\n *\n * @since 3.0.0\n *\n * @param int|string|WP_Term $menu Menu ID, slug, name, or object.\n * @return WP_Term|false False if $menu param isn't supplied or term does not exist, menu object if successful.\n */\nfunction wp_get_nav_menu_object( $menu ) {\n\t$menu_obj = false;\n\n\tif ( is_object( $menu ) ) {\n\t\t$menu_obj = $menu;\n\t}\n\n\tif ( $menu && ! $menu_obj ) {\n\t\t$menu_obj = get_term( $menu, 'nav_menu' );\n\n\t\tif ( ! $menu_obj ) {\n\t\t\t$menu_obj = get_term_by( 'slug', $menu, 'nav_menu' );\n\t\t}\n\n\t\tif ( ! $menu_obj ) {\n\t\t\t$menu_obj = get_term_by( 'name', $menu, 'nav_menu' );\n\t\t}\n\t}\n\n\tif ( ! $menu_obj || is_wp_error( $menu_obj ) ) {\n\t\t$menu_obj = false;\n\t}\n\n\t/**\n\t * Filters the nav_menu term retrieved for wp_get_nav_menu_object().\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param WP_Term|false      $menu_obj Term from nav_menu taxonomy, or false if nothing had been found.\n\t * @param int|string|WP_Term $menu     The menu ID, slug, name, or object passed to wp_get_nav_menu_object().\n\t */\n\treturn apply_filters( 'wp_get_nav_menu_object', $menu_obj, $menu );\n}\n\n/**\n * Check if the given ID is a navigation menu.\n *\n * Returns true if it is; false otherwise.\n *\n * @since 3.0.0\n *\n * @param int|string|WP_Term $menu Menu ID, slug, name, or object of menu to check.\n * @return bool Whether the menu exists.\n */\nfunction is_nav_menu( $menu ) {\n\tif ( ! $menu ) {\n\t\treturn false;\n\t}\n\n\t$menu_obj = wp_get_nav_menu_object( $menu );\n\n\tif (\n\t\t$menu_obj &&\n\t\t! is_wp_error( $menu_obj ) &&\n\t\t! empty( $menu_obj->taxonomy ) &&\n\t\t'nav_menu' === $menu_obj->taxonomy\n\t) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Registers navigation menu locations for a theme.\n *\n * @since 3.0.0\n *\n * @global array $_wp_registered_nav_menus\n *\n * @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.\n */\nfunction register_nav_menus( $locations = array() ) {\n\tglobal $_wp_registered_nav_menus;\n\n\tadd_theme_support( 'menus' );\n\n\tforeach ( $locations as $key => $value ) {\n\t\tif ( is_int( $key ) ) {\n\t\t\t_doing_it_wrong( __FUNCTION__, __( 'Nav menu locations must be strings.' ), '5.3.0' );\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$_wp_registered_nav_menus = array_merge( (array) $_wp_registered_nav_menus, $locations );\n}\n\n/**\n * Unregisters a navigation menu location for a theme.\n *\n * @since 3.1.0\n *\n * @global array $_wp_registered_nav_menus\n *\n * @param string $location The menu location identifier.\n * @return bool True on success, false on failure.\n */\nfunction unregister_nav_menu( $location ) {\n\tglobal $_wp_registered_nav_menus;\n\n\tif ( is_array( $_wp_registered_nav_menus ) && isset( $_wp_registered_nav_menus[ $location ] ) ) {\n\t\tunset( $_wp_registered_nav_menus[ $location ] );\n\t\tif ( empty( $_wp_registered_nav_menus ) ) {\n\t\t\t_remove_theme_support( 'menus' );\n\t\t}\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Registers a navigation menu location for a theme.\n *\n * @since 3.0.0\n *\n * @param string $location    Menu location identifier, like a slug.\n * @param string $description Menu location descriptive text.\n */\nfunction register_nav_menu( $location, $description ) {\n\tregister_nav_menus( array( $location => $description ) );\n}\n/**\n * Retrieves all registered navigation menu locations in a theme.\n *\n * @since 3.0.0\n *\n * @global array $_wp_registered_nav_menus\n *\n * @return array Registered navigation menu locations. If none are registered, an empty array.\n */\nfunction get_registered_nav_menus() {\n\tglobal $_wp_registered_nav_menus;\n\tif ( isset( $_wp_registered_nav_menus ) ) {\n\t\treturn $_wp_registered_nav_menus;\n\t}\n\treturn array();\n}\n\n/**\n * Retrieves all registered navigation menu locations and the menus assigned to them.\n *\n * @since 3.0.0\n *\n * @return array Registered navigation menu locations and the menus assigned them.\n *               If none are registered, an empty array.\n */\n\nfunction get_nav_menu_locations() {\n\t$locations = get_theme_mod( 'nav_menu_locations' );\n\treturn ( is_array( $locations ) ) ? $locations : array();\n}\n\n/**\n * Determines whether a registered nav menu location has a menu assigned to it.\n *\n * @since 3.0.0\n *\n * @param string $location Menu location identifier.\n * @return bool Whether location has a menu.\n */\nfunction has_nav_menu( $location ) {\n\t$has_nav_menu = false;\n\n\t$registered_nav_menus = get_registered_nav_menus();\n\tif ( isset( $registered_nav_menus[ $location ] ) ) {\n\t\t$locations    = get_nav_menu_locations();\n\t\t$has_nav_menu = ! empty( $locations[ $location ] );\n\t}\n\n\t/**\n\t * Filters whether a nav menu is assigned to the specified location.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param bool   $has_nav_menu Whether there is a menu assigned to a location.\n\t * @param string $location     Menu location.\n\t */\n\treturn apply_filters( 'has_nav_menu', $has_nav_menu, $location );\n}\n\n/**\n * Returns the name of a navigation menu.\n *\n * @since 4.9.0\n *\n * @param string $location Menu location identifier.\n * @return string Menu name.\n */\nfunction wp_get_nav_menu_name( $location ) {\n\t$menu_name = '';\n\n\t$locations = get_nav_menu_locations();\n\n\tif ( isset( $locations[ $location ] ) ) {\n\t\t$menu = wp_get_nav_menu_object( $locations[ $location ] );\n\n\t\tif ( $menu && $menu->name ) {\n\t\t\t$menu_name = $menu->name;\n\t\t}\n\t}\n\n\t/**\n\t * Filters the navigation menu name being returned.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param string $menu_name Menu name.\n\t * @param string $location  Menu location identifier.\n\t */\n\treturn apply_filters( 'wp_get_nav_menu_name', $menu_name, $location );\n}\n\n/**\n * Determines whether the given ID is a nav menu item.\n *\n * @since 3.0.0\n *\n * @param int $menu_item_id The ID of the potential nav menu item.\n * @return bool Whether the given ID is that of a nav menu item.\n */\nfunction is_nav_menu_item( $menu_item_id = 0 ) {\n\treturn ( ! is_wp_error( $menu_item_id ) && ( 'nav_menu_item' === get_post_type( $menu_item_id ) ) );\n}\n\n/**\n * Creates a navigation menu.\n *\n * Note that `$menu_name` is expected to be pre-slashed.\n *\n * @since 3.0.0\n *\n * @param string $menu_name Menu name.\n * @return int|WP_Error Menu ID on success, WP_Error object on failure.\n */\nfunction wp_create_nav_menu( $menu_name ) {\n\t// expected_slashed ($menu_name)\n\treturn wp_update_nav_menu_object( 0, array( 'menu-name' => $menu_name ) );\n}\n\n/**\n * Delete a Navigation Menu.\n *\n * @since 3.0.0\n *\n * @param int|string|WP_Term $menu Menu ID, slug, name, or object.\n * @return bool|WP_Error True on success, false or WP_Error object on failure.\n */\nfunction wp_delete_nav_menu( $menu ) {\n\t$menu = wp_get_nav_menu_object( $menu );\n\tif ( ! $menu ) {\n\t\treturn false;\n\t}\n\n\t$menu_objects = get_objects_in_term( $menu->term_id, 'nav_menu' );\n\tif ( ! empty( $menu_objects ) ) {\n\t\tforeach ( $menu_objects as $item ) {\n\t\t\twp_delete_post( $item );\n\t\t}\n\t}\n\n\t$result = wp_delete_term( $menu->term_id, 'nav_menu' );\n\n\t// Remove this menu from any locations.\n\t$locations = get_nav_menu_locations();\n\tforeach ( $locations as $location => $menu_id ) {\n\t\tif ( $menu_id == $menu->term_id ) {\n\t\t\t$locations[ $location ] = 0;\n\t\t}\n\t}\n\tset_theme_mod( 'nav_menu_locations', $locations );\n\n\tif ( $result && ! is_wp_error( $result ) ) {\n\n\t\t/**\n\t\t * Fires after a navigation menu has been successfully deleted.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param int $term_id ID of the deleted menu.\n\t\t */\n\t\tdo_action( 'wp_delete_nav_menu', $menu->term_id );\n\t}\n\n\treturn $result;\n}\n\n/**\n * Save the properties of a menu or create a new menu with those properties.\n *\n * Note that `$menu_data` is expected to be pre-slashed.\n *\n * @since 3.0.0\n *\n * @param int   $menu_id   The ID of the menu or \"0\" to create a new menu.\n * @param array $menu_data The array of menu data.\n * @return int|WP_Error Menu ID on success, WP_Error object on failure.\n */\nfunction wp_update_nav_menu_object( $menu_id = 0, $menu_data = array() ) {\n\t// expected_slashed ($menu_data)\n\t$menu_id = (int) $menu_id;\n\n\t$_menu = wp_get_nav_menu_object( $menu_id );\n\n\t$args = array(\n\t\t'description' => ( isset( $menu_data['description'] ) ? $menu_data['description'] : '' ),\n\t\t'name'        => ( isset( $menu_data['menu-name'] ) ? $menu_data['menu-name'] : '' ),\n\t\t'parent'      => ( isset( $menu_data['parent'] ) ? (int) $menu_data['parent'] : 0 ),\n\t\t'slug'        => null,\n\t);\n\n\t// Double-check that we're not going to have one menu take the name of another.\n\t$_possible_existing = get_term_by( 'name', $menu_data['menu-name'], 'nav_menu' );\n\tif (\n\t\t$_possible_existing &&\n\t\t! is_wp_error( $_possible_existing ) &&\n\t\tisset( $_possible_existing->term_id ) &&\n\t\t$_possible_existing->term_id != $menu_id\n\t) {\n\t\treturn new WP_Error(\n\t\t\t'menu_exists',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Menu name. */\n\t\t\t\t__( 'The menu name %s conflicts with another menu name. Please try another.' ),\n\t\t\t\t'<strong>' . esc_html( $menu_data['menu-name'] ) . '</strong>'\n\t\t\t)\n\t\t);\n\t}\n\n\t// Menu doesn't already exist, so create a new menu.\n\tif ( ! $_menu || is_wp_error( $_menu ) ) {\n\t\t$menu_exists = get_term_by( 'name', $menu_data['menu-name'], 'nav_menu' );\n\n\t\tif ( $menu_exists ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'menu_exists',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Menu name. */\n\t\t\t\t\t__( 'The menu name %s conflicts with another menu name. Please try another.' ),\n\t\t\t\t\t'<strong>' . esc_html( $menu_data['menu-name'] ) . '</strong>'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$_menu = wp_insert_term( $menu_data['menu-name'], 'nav_menu', $args );\n\n\t\tif ( is_wp_error( $_menu ) ) {\n\t\t\treturn $_menu;\n\t\t}\n\n\t\t/**\n\t\t * Fires after a navigation menu is successfully created.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param int   $term_id   ID of the new menu.\n\t\t * @param array $menu_data An array of menu data.\n\t\t */\n\t\tdo_action( 'wp_create_nav_menu', $_menu['term_id'], $menu_data );\n\n\t\treturn (int) $_menu['term_id'];\n\t}\n\n\tif ( ! $_menu || ! isset( $_menu->term_id ) ) {\n\t\treturn 0;\n\t}\n\n\t$menu_id = (int) $_menu->term_id;\n\n\t$update_response = wp_update_term( $menu_id, 'nav_menu', $args );\n\n\tif ( is_wp_error( $update_response ) ) {\n\t\treturn $update_response;\n\t}\n\n\t$menu_id = (int) $update_response['term_id'];\n\n\t/**\n\t * Fires after a navigation menu has been successfully updated.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param int   $menu_id   ID of the updated menu.\n\t * @param array $menu_data An array of menu data.\n\t */\n\tdo_action( 'wp_update_nav_menu', $menu_id, $menu_data );\n\treturn $menu_id;\n}\n\n/**\n * Save the properties of a menu item or create a new one.\n *\n * The menu-item-title, menu-item-description, and menu-item-attr-title are expected\n * to be pre-slashed since they are passed directly into `wp_insert_post()`.\n *\n * @since 3.0.0\n *\n * @param int   $menu_id         The ID of the menu. Required. If \"0\", makes the menu item a draft orphan.\n * @param int   $menu_item_db_id The ID of the menu item. If \"0\", creates a new menu item.\n * @param array $menu_item_data  The menu item's data.\n * @return int|WP_Error The menu item's database ID or WP_Error object on failure.\n */\nfunction wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0, $menu_item_data = array() ) {\n\t$menu_id         = (int) $menu_id;\n\t$menu_item_db_id = (int) $menu_item_db_id;\n\n\t// Make sure that we don't convert non-nav_menu_item objects into nav_menu_item objects.\n\tif ( ! empty( $menu_item_db_id ) && ! is_nav_menu_item( $menu_item_db_id ) ) {\n\t\treturn new WP_Error( 'update_nav_menu_item_failed', __( 'The given object ID is not that of a menu item.' ) );\n\t}\n\n\t$menu = wp_get_nav_menu_object( $menu_id );\n\n\tif ( ! $menu && 0 !== $menu_id ) {\n\t\treturn new WP_Error( 'invalid_menu_id', __( 'Invalid menu ID.' ) );\n\t}\n\n\tif ( is_wp_error( $menu ) ) {\n\t\treturn $menu;\n\t}\n\n\t$defaults = array(\n\t\t'menu-item-db-id'       => $menu_item_db_id,\n\t\t'menu-item-object-id'   => 0,\n\t\t'menu-item-object'      => '',\n\t\t'menu-item-parent-id'   => 0,\n\t\t'menu-item-position'    => 0,\n\t\t'menu-item-type'        => 'custom',\n\t\t'menu-item-title'       => '',\n\t\t'menu-item-url'         => '',\n\t\t'menu-item-description' => '',\n\t\t'menu-item-attr-title'  => '',\n\t\t'menu-item-target'      => '',\n\t\t'menu-item-classes'     => '',\n\t\t'menu-item-xfn'         => '',\n\t\t'menu-item-status'      => '',\n\t);\n\n\t$args = wp_parse_args( $menu_item_data, $defaults );\n\n\tif ( 0 == $menu_id ) {\n\t\t$args['menu-item-position'] = 1;\n\t} elseif ( 0 == (int) $args['menu-item-position'] ) {\n\t\t$menu_items                 = 0 == $menu_id ? array() : (array) wp_get_nav_menu_items( $menu_id, array( 'post_status' => 'publish,draft' ) );\n\t\t$last_item                  = array_pop( $menu_items );\n\t\t$args['menu-item-position'] = ( $last_item && isset( $last_item->menu_order ) ) ? 1 + $last_item->menu_order : count( $menu_items );\n\t}\n\n\t$original_parent = 0 < $menu_item_db_id ? get_post_field( 'post_parent', $menu_item_db_id ) : 0;\n\n\tif ( 'custom' === $args['menu-item-type'] ) {\n\t\t// If custom menu item, trim the URL.\n\t\t$args['menu-item-url'] = trim( $args['menu-item-url'] );\n\t} else {\n\t\t/*\n\t\t * If non-custom menu item, then:\n\t\t * - use the original object's URL.\n\t\t * - blank default title to sync with the original object's title.\n\t\t */\n\n\t\t$args['menu-item-url'] = '';\n\n\t\t$original_title = '';\n\t\tif ( 'taxonomy' === $args['menu-item-type'] ) {\n\t\t\t$original_parent = get_term_field( 'parent', $args['menu-item-object-id'], $args['menu-item-object'], 'raw' );\n\t\t\t$original_title  = get_term_field( 'name', $args['menu-item-object-id'], $args['menu-item-object'], 'raw' );\n\t\t} elseif ( 'post_type' === $args['menu-item-type'] ) {\n\n\t\t\t$original_object = get_post( $args['menu-item-object-id'] );\n\t\t\t$original_parent = (int) $original_object->post_parent;\n\t\t\t$original_title  = $original_object->post_title;\n\t\t} elseif ( 'post_type_archive' === $args['menu-item-type'] ) {\n\t\t\t$original_object = get_post_type_object( $args['menu-item-object'] );\n\t\t\tif ( $original_object ) {\n\t\t\t\t$original_title = $original_object->labels->archives;\n\t\t\t}\n\t\t}\n\n\t\tif ( wp_unslash( $args['menu-item-title'] ) === wp_specialchars_decode( $original_title ) ) {\n\t\t\t$args['menu-item-title'] = '';\n\t\t}\n\n\t\t// Hack to get wp to create a post object when too many properties are empty.\n\t\tif ( '' === $args['menu-item-title'] && '' === $args['menu-item-description'] ) {\n\t\t\t$args['menu-item-description'] = ' ';\n\t\t}\n\t}\n\n\t// Populate the menu item object.\n\t$post = array(\n\t\t'menu_order'   => $args['menu-item-position'],\n\t\t'ping_status'  => 0,\n\t\t'post_content' => $args['menu-item-description'],\n\t\t'post_excerpt' => $args['menu-item-attr-title'],\n\t\t'post_parent'  => $original_parent,\n\t\t'post_title'   => $args['menu-item-title'],\n\t\t'post_type'    => 'nav_menu_item',\n\t);\n\n\t$update = 0 != $menu_item_db_id;\n\n\t// New menu item. Default is draft status.\n\tif ( ! $update ) {\n\t\t$post['ID']          = 0;\n\t\t$post['post_status'] = 'publish' === $args['menu-item-status'] ? 'publish' : 'draft';\n\t\t$menu_item_db_id     = wp_insert_post( $post );\n\t\tif ( ! $menu_item_db_id || is_wp_error( $menu_item_db_id ) ) {\n\t\t\treturn $menu_item_db_id;\n\t\t}\n\n\t\t/**\n\t\t * Fires immediately after a new navigation menu item has been added.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @see wp_update_nav_menu_item()\n\t\t *\n\t\t * @param int   $menu_id         ID of the updated menu.\n\t\t * @param int   $menu_item_db_id ID of the new menu item.\n\t\t * @param array $args            An array of arguments used to update/add the menu item.\n\t\t */\n\t\tdo_action( 'wp_add_nav_menu_item', $menu_id, $menu_item_db_id, $args );\n\t}\n\n\t// Associate the menu item with the menu term.\n\t// Only set the menu term if it isn't set to avoid unnecessary wp_get_object_terms().\n\tif ( $menu_id && ( ! $update || ! is_object_in_term( $menu_item_db_id, 'nav_menu', (int) $menu->term_id ) ) ) {\n\t\twp_set_object_terms( $menu_item_db_id, array( $menu->term_id ), 'nav_menu' );\n\t}\n\n\tif ( 'custom' === $args['menu-item-type'] ) {\n\t\t$args['menu-item-object-id'] = $menu_item_db_id;\n\t\t$args['menu-item-object']    = 'custom';\n\t}\n\n\t$menu_item_db_id = (int) $menu_item_db_id;\n\n\tupdate_post_meta( $menu_item_db_id, '_menu_item_type', sanitize_key( $args['menu-item-type'] ) );\n\tupdate_post_meta( $menu_item_db_id, '_menu_item_menu_item_parent', strval( (int) $args['menu-item-parent-id'] ) );\n\tupdate_post_meta( $menu_item_db_id, '_menu_item_object_id', strval( (int) $args['menu-item-object-id'] ) );\n\tupdate_post_meta( $menu_item_db_id, '_menu_item_object', sanitize_key( $args['menu-item-object'] ) );\n\tupdate_post_meta( $menu_item_db_id, '_menu_item_target', sanitize_key( $args['menu-item-target'] ) );\n\n\t$args['menu-item-classes'] = array_map( 'sanitize_html_class', explode( ' ', $args['menu-item-classes'] ) );\n\t$args['menu-item-xfn']     = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args['menu-item-xfn'] ) ) );\n\tupdate_post_meta( $menu_item_db_id, '_menu_item_classes', $args['menu-item-classes'] );\n\tupdate_post_meta( $menu_item_db_id, '_menu_item_xfn', $args['menu-item-xfn'] );\n\tupdate_post_meta( $menu_item_db_id, '_menu_item_url', esc_url_raw( $args['menu-item-url'] ) );\n\n\tif ( 0 == $menu_id ) {\n\t\tupdate_post_meta( $menu_item_db_id, '_menu_item_orphaned', (string) time() );\n\t} elseif ( get_post_meta( $menu_item_db_id, '_menu_item_orphaned' ) ) {\n\t\tdelete_post_meta( $menu_item_db_id, '_menu_item_orphaned' );\n\t}\n\n\t// Update existing menu item. Default is publish status.\n\tif ( $update ) {\n\t\t$post['ID']          = $menu_item_db_id;\n\t\t$post['post_status'] = ( 'draft' === $args['menu-item-status'] ) ? 'draft' : 'publish';\n\t\twp_update_post( $post );\n\t}\n\n\t/**\n\t * Fires after a navigation menu item has been updated.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @see wp_update_nav_menu_item()\n\t *\n\t * @param int   $menu_id         ID of the updated menu.\n\t * @param int   $menu_item_db_id ID of the updated menu item.\n\t * @param array $args            An array of arguments used to update a menu item.\n\t */\n\tdo_action( 'wp_update_nav_menu_item', $menu_id, $menu_item_db_id, $args );\n\n\treturn $menu_item_db_id;\n}\n\n/**\n * Returns all navigation menu objects.\n *\n * @since 3.0.0\n * @since 4.1.0 Default value of the 'orderby' argument was changed from 'none'\n *              to 'name'.\n *\n * @param array $args Optional. Array of arguments passed on to get_terms().\n *                    Default empty array.\n * @return WP_Term[] An array of menu objects.\n */\nfunction wp_get_nav_menus( $args = array() ) {\n\t$defaults = array(\n\t\t'taxonomy'   => 'nav_menu',\n\t\t'hide_empty' => false,\n\t\t'orderby'    => 'name',\n\t);\n\t$args     = wp_parse_args( $args, $defaults );\n\n\t/**\n\t * Filters the navigation menu objects being returned.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @see get_terms()\n\t *\n\t * @param WP_Term[] $menus An array of menu objects.\n\t * @param array     $args  An array of arguments used to retrieve menu objects.\n\t */\n\treturn apply_filters( 'wp_get_nav_menus', get_terms( $args ), $args );\n}\n\n/**\n * Return if a menu item is valid.\n *\n * @link https://core.trac.wordpress.org/ticket/13958\n *\n * @since 3.2.0\n * @access private\n *\n * @param object $item The menu item to check.\n * @return bool False if invalid, otherwise true.\n */\nfunction _is_valid_nav_menu_item( $item ) {\n\treturn empty( $item->_invalid );\n}\n\n/**\n * Retrieves all menu items of a navigation menu.\n *\n * Note: Most arguments passed to the `$args` parameter \u00e2\u20ac\u201c save for 'output_key' \u00e2\u20ac\u201c are\n * specifically for retrieving nav_menu_item posts from get_posts() and may only\n * indirectly affect the ultimate ordering and content of the resulting nav menu\n * items that get returned from this function.\n *\n * @since 3.0.0\n *\n * @param int|string|WP_Term $menu Menu ID, slug, name, or object.\n * @param array              $args {\n *     Optional. Arguments to pass to get_posts().\n *\n *     @type string $order       How to order nav menu items as queried with get_posts(). Will be ignored\n *                               if 'output' is ARRAY_A. Default 'ASC'.\n *     @type string $orderby     Field to order menu items by as retrieved from get_posts(). Supply an orderby\n *                               field via 'output_key' to affect the output order of nav menu items.\n *                               Default 'menu_order'.\n *     @type string $post_type   Menu items post type. Default 'nav_menu_item'.\n *     @type string $post_status Menu items post status. Default 'publish'.\n *     @type string $output      How to order outputted menu items. Default ARRAY_A.\n *     @type string $output_key  Key to use for ordering the actual menu items that get returned. Note that\n *                               that is not a get_posts() argument and will only affect output of menu items\n *                               processed in this function. Default 'menu_order'.\n *     @type bool   $nopaging    Whether to retrieve all menu items (true) or paginate (false). Default true.\n * }\n * @return array|false Array of menu items, otherwise false.\n */\nfunction wp_get_nav_menu_items( $menu, $args = array() ) {\n\t$menu = wp_get_nav_menu_object( $menu );\n\n\tif ( ! $menu ) {\n\t\treturn false;\n\t}\n\n\tstatic $fetched = array();\n\n\t$items = get_objects_in_term( $menu->term_id, 'nav_menu' );\n\tif ( is_wp_error( $items ) ) {\n\t\treturn false;\n\t}\n\n\t$defaults        = array(\n\t\t'order'       => 'ASC',\n\t\t'orderby'     => 'menu_order',\n\t\t'post_type'   => 'nav_menu_item',\n\t\t'post_status' => 'publish',\n\t\t'output'      => ARRAY_A,\n\t\t'output_key'  => 'menu_order',\n\t\t'nopaging'    => true,\n\t);\n\t$args            = wp_parse_args( $args, $defaults );\n\t$args['include'] = $items;\n\n\tif ( ! empty( $items ) ) {\n\t\t$items = get_posts( $args );\n\t} else {\n\t\t$items = array();\n\t}\n\n\t// Get all posts and terms at once to prime the caches.\n\tif ( empty( $fetched[ $menu->term_id ] ) && ! wp_using_ext_object_cache() ) {\n\t\t$fetched[ $menu->term_id ] = true;\n\t\t$posts                     = array();\n\t\t$terms                     = array();\n\t\tforeach ( $items as $item ) {\n\t\t\t$object_id = get_post_meta( $item->ID, '_menu_item_object_id', true );\n\t\t\t$object    = get_post_meta( $item->ID, '_menu_item_object', true );\n\t\t\t$type      = get_post_meta( $item->ID, '_menu_item_type', true );\n\n\t\t\tif ( 'post_type' === $type ) {\n\t\t\t\t$posts[ $object ][] = $object_id;\n\t\t\t} elseif ( 'taxonomy' === $type ) {\n\t\t\t\t$terms[ $object ][] = $object_id;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $posts ) ) {\n\t\t\tforeach ( array_keys( $posts ) as $post_type ) {\n\t\t\t\tget_posts(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post__in'               => $posts[ $post_type ],\n\t\t\t\t\t\t'post_type'              => $post_type,\n\t\t\t\t\t\t'nopaging'               => true,\n\t\t\t\t\t\t'update_post_term_cache' => false,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tunset( $posts );\n\n\t\tif ( ! empty( $terms ) ) {\n\t\t\tforeach ( array_keys( $terms ) as $taxonomy ) {\n\t\t\t\tget_terms(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'taxonomy'     => $taxonomy,\n\t\t\t\t\t\t'include'      => $terms[ $taxonomy ],\n\t\t\t\t\t\t'hierarchical' => false,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tunset( $terms );\n\t}\n\n\t$items = array_map( 'wp_setup_nav_menu_item', $items );\n\n\tif ( ! is_admin() ) { // Remove invalid items only on front end.\n\t\t$items = array_filter( $items, '_is_valid_nav_menu_item' );\n\t}\n\n\tif ( ARRAY_A == $args['output'] ) {\n\t\t$items = wp_list_sort(\n\t\t\t$items,\n\t\t\tarray(\n\t\t\t\t$args['output_key'] => 'ASC',\n\t\t\t)\n\t\t);\n\t\t$i     = 1;\n\t\tforeach ( $items as $k => $item ) {\n\t\t\t$items[ $k ]->{$args['output_key']} = $i++;\n\t\t}\n\t}\n\n\t/**\n\t * Filters the navigation menu items being returned.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param array  $items An array of menu item post objects.\n\t * @param object $menu  The menu object.\n\t * @param array  $args  An array of arguments used to retrieve menu item objects.\n\t */\n\treturn apply_filters( 'wp_get_nav_menu_items', $items, $menu, $args );\n}\n\n/**\n * Decorates a menu item object with the shared navigation menu item properties.\n *\n * Properties:\n * - ID:               The term_id if the menu item represents a taxonomy term.\n * - attr_title:       The title attribute of the link element for this menu item.\n * - classes:          The array of class attribute values for the link element of this menu item.\n * - db_id:            The DB ID of this item as a nav_menu_item object, if it exists (0 if it doesn't exist).\n * - description:      The description of this menu item.\n * - menu_item_parent: The DB ID of the nav_menu_item that is this item's menu parent, if any. 0 otherwise.\n * - object:           The type of object originally represented, such as 'category', 'post', or 'attachment'.\n * - object_id:        The DB ID of the original object this menu item represents, e.g. ID for posts and term_id for categories.\n * - post_parent:      The DB ID of the original object's parent object, if any (0 otherwise).\n * - post_title:       A \"no title\" label if menu item represents a post that lacks a title.\n * - target:           The target attribute of the link element for this menu item.\n * - title:            The title of this menu item.\n * - type:             The family of objects originally represented, such as 'post_type' or 'taxonomy'.\n * - type_label:       The singular label used to describe this type of menu item.\n * - url:              The URL to which this menu item points.\n * - xfn:              The XFN relationship expressed in the link of this menu item.\n * - _invalid:         Whether the menu item represents an object that no longer exists.\n *\n * @since 3.0.0\n *\n * @param object $menu_item The menu item to modify.\n * @return object The menu item with standard menu item properties.\n */\nfunction wp_setup_nav_menu_item( $menu_item ) {\n\tif ( isset( $menu_item->post_type ) ) {\n\t\tif ( 'nav_menu_item' === $menu_item->post_type ) {\n\t\t\t$menu_item->db_id            = (int) $menu_item->ID;\n\t\t\t$menu_item->menu_item_parent = ! isset( $menu_item->menu_item_parent ) ? get_post_meta( $menu_item->ID, '_menu_item_menu_item_parent', true ) : $menu_item->menu_item_parent;\n\t\t\t$menu_item->object_id        = ! isset( $menu_item->object_id ) ? get_post_meta( $menu_item->ID, '_menu_item_object_id', true ) : $menu_item->object_id;\n\t\t\t$menu_item->object           = ! isset( $menu_item->object ) ? get_post_meta( $menu_item->ID, '_menu_item_object', true ) : $menu_item->object;\n\t\t\t$menu_item->type             = ! isset( $menu_item->type ) ? get_post_meta( $menu_item->ID, '_menu_item_type', true ) : $menu_item->type;\n\n\t\t\tif ( 'post_type' === $menu_item->type ) {\n\t\t\t\t$object = get_post_type_object( $menu_item->object );\n\t\t\t\tif ( $object ) {\n\t\t\t\t\t$menu_item->type_label = $object->labels->singular_name;\n\t\t\t\t\t// Denote post states for special pages (only in the admin).\n\t\t\t\t\tif ( function_exists( 'get_post_states' ) ) {\n\t\t\t\t\t\t$menu_post   = get_post( $menu_item->object_id );\n\t\t\t\t\t\t$post_states = get_post_states( $menu_post );\n\t\t\t\t\t\tif ( $post_states ) {\n\t\t\t\t\t\t\t$menu_item->type_label = wp_strip_all_tags( implode( ', ', $post_states ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$menu_item->type_label = $menu_item->object;\n\t\t\t\t\t$menu_item->_invalid   = true;\n\t\t\t\t}\n\n\t\t\t\tif ( 'trash' === get_post_status( $menu_item->object_id ) ) {\n\t\t\t\t\t$menu_item->_invalid = true;\n\t\t\t\t}\n\n\t\t\t\t$original_object = get_post( $menu_item->object_id );\n\n\t\t\t\tif ( $original_object ) {\n\t\t\t\t\t$menu_item->url = get_permalink( $original_object->ID );\n\t\t\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t\t\t$original_title = apply_filters( 'the_title', $original_object->post_title, $original_object->ID );\n\t\t\t\t} else {\n\t\t\t\t\t$menu_item->url      = '';\n\t\t\t\t\t$original_title      = '';\n\t\t\t\t\t$menu_item->_invalid = true;\n\t\t\t\t}\n\n\t\t\t\tif ( '' === $original_title ) {\n\t\t\t\t\t/* translators: %d: ID of a post. */\n\t\t\t\t\t$original_title = sprintf( __( '#%d (no title)' ), $menu_item->object_id );\n\t\t\t\t}\n\n\t\t\t\t$menu_item->title = ( '' === $menu_item->post_title ) ? $original_title : $menu_item->post_title;\n\n\t\t\t} elseif ( 'post_type_archive' === $menu_item->type ) {\n\t\t\t\t$object = get_post_type_object( $menu_item->object );\n\t\t\t\tif ( $object ) {\n\t\t\t\t\t$menu_item->title      = ( '' === $menu_item->post_title ) ? $object->labels->archives : $menu_item->post_title;\n\t\t\t\t\t$post_type_description = $object->description;\n\t\t\t\t} else {\n\t\t\t\t\t$post_type_description = '';\n\t\t\t\t\t$menu_item->_invalid   = true;\n\t\t\t\t}\n\n\t\t\t\t$menu_item->type_label = __( 'Post Type Archive' );\n\t\t\t\t$post_content          = wp_trim_words( $menu_item->post_content, 200 );\n\t\t\t\t$post_type_description = ( '' === $post_content ) ? $post_type_description : $post_content;\n\t\t\t\t$menu_item->url        = get_post_type_archive_link( $menu_item->object );\n\n\t\t\t} elseif ( 'taxonomy' === $menu_item->type ) {\n\t\t\t\t$object = get_taxonomy( $menu_item->object );\n\t\t\t\tif ( $object ) {\n\t\t\t\t\t$menu_item->type_label = $object->labels->singular_name;\n\t\t\t\t} else {\n\t\t\t\t\t$menu_item->type_label = $menu_item->object;\n\t\t\t\t\t$menu_item->_invalid   = true;\n\t\t\t\t}\n\n\t\t\t\t$original_object = get_term( (int) $menu_item->object_id, $menu_item->object );\n\n\t\t\t\tif ( $original_object && ! is_wp_error( $original_object ) ) {\n\t\t\t\t\t$menu_item->url = get_term_link( (int) $menu_item->object_id, $menu_item->object );\n\t\t\t\t\t$original_title = $original_object->name;\n\t\t\t\t} else {\n\t\t\t\t\t$menu_item->url      = '';\n\t\t\t\t\t$original_title      = '';\n\t\t\t\t\t$menu_item->_invalid = true;\n\t\t\t\t}\n\n\t\t\t\tif ( '' === $original_title ) {\n\t\t\t\t\t/* translators: %d: ID of a term. */\n\t\t\t\t\t$original_title = sprintf( __( '#%d (no title)' ), $menu_item->object_id );\n\t\t\t\t}\n\n\t\t\t\t$menu_item->title = ( '' === $menu_item->post_title ) ? $original_title : $menu_item->post_title;\n\n\t\t\t} else {\n\t\t\t\t$menu_item->type_label = __( 'Custom Link' );\n\t\t\t\t$menu_item->title      = $menu_item->post_title;\n\t\t\t\t$menu_item->url        = ! isset( $menu_item->url ) ? get_post_meta( $menu_item->ID, '_menu_item_url', true ) : $menu_item->url;\n\t\t\t}\n\n\t\t\t$menu_item->target = ! isset( $menu_item->target ) ? get_post_meta( $menu_item->ID, '_menu_item_target', true ) : $menu_item->target;\n\n\t\t\t/**\n\t\t\t * Filters a navigation menu item's title attribute.\n\t\t\t *\n\t\t\t * @since 3.0.0\n\t\t\t *\n\t\t\t * @param string $item_title The menu item title attribute.\n\t\t\t */\n\t\t\t$menu_item->attr_title = ! isset( $menu_item->attr_title ) ? apply_filters( 'nav_menu_attr_title', $menu_item->post_excerpt ) : $menu_item->attr_title;\n\n\t\t\tif ( ! isset( $menu_item->description ) ) {\n\t\t\t\t/**\n\t\t\t\t * Filters a navigation menu item's description.\n\t\t\t\t *\n\t\t\t\t * @since 3.0.0\n\t\t\t\t *\n\t\t\t\t * @param string $description The menu item description.\n\t\t\t\t */\n\t\t\t\t$menu_item->description = apply_filters( 'nav_menu_description', wp_trim_words( $menu_item->post_content, 200 ) );\n\t\t\t}\n\n\t\t\t$menu_item->classes = ! isset( $menu_item->classes ) ? (array) get_post_meta( $menu_item->ID, '_menu_item_classes', true ) : $menu_item->classes;\n\t\t\t$menu_item->xfn     = ! isset( $menu_item->xfn ) ? get_post_meta( $menu_item->ID, '_menu_item_xfn', true ) : $menu_item->xfn;\n\t\t} else {\n\t\t\t$menu_item->db_id            = 0;\n\t\t\t$menu_item->menu_item_parent = 0;\n\t\t\t$menu_item->object_id        = (int) $menu_item->ID;\n\t\t\t$menu_item->type             = 'post_type';\n\n\t\t\t$object                = get_post_type_object( $menu_item->post_type );\n\t\t\t$menu_item->object     = $object->name;\n\t\t\t$menu_item->type_label = $object->labels->singular_name;\n\n\t\t\tif ( '' === $menu_item->post_title ) {\n\t\t\t\t/* translators: %d: ID of a post. */\n\t\t\t\t$menu_item->post_title = sprintf( __( '#%d (no title)' ), $menu_item->ID );\n\t\t\t}\n\n\t\t\t$menu_item->title  = $menu_item->post_title;\n\t\t\t$menu_item->url    = get_permalink( $menu_item->ID );\n\t\t\t$menu_item->target = '';\n\n\t\t\t/** This filter is documented in wp-includes/nav-menu.php */\n\t\t\t$menu_item->attr_title = apply_filters( 'nav_menu_attr_title', '' );\n\n\t\t\t/** This filter is documented in wp-includes/nav-menu.php */\n\t\t\t$menu_item->description = apply_filters( 'nav_menu_description', '' );\n\t\t\t$menu_item->classes     = array();\n\t\t\t$menu_item->xfn         = '';\n\t\t}\n\t} elseif ( isset( $menu_item->taxonomy ) ) {\n\t\t$menu_item->ID               = $menu_item->term_id;\n\t\t$menu_item->db_id            = 0;\n\t\t$menu_item->menu_item_parent = 0;\n\t\t$menu_item->object_id        = (int) $menu_item->term_id;\n\t\t$menu_item->post_parent      = (int) $menu_item->parent;\n\t\t$menu_item->type             = 'taxonomy';\n\n\t\t$object                = get_taxonomy( $menu_item->taxonomy );\n\t\t$menu_item->object     = $object->name;\n\t\t$menu_item->type_label = $object->labels->singular_name;\n\n\t\t$menu_item->title       = $menu_item->name;\n\t\t$menu_item->url         = get_term_link( $menu_item, $menu_item->taxonomy );\n\t\t$menu_item->target      = '';\n\t\t$menu_item->attr_title  = '';\n\t\t$menu_item->description = get_term_field( 'description', $menu_item->term_id, $menu_item->taxonomy );\n\t\t$menu_item->classes     = array();\n\t\t$menu_item->xfn         = '';\n\n\t}\n\n\t/**\n\t * Filters a navigation menu item object.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param object $menu_item The menu item object.\n\t */\n\treturn apply_filters( 'wp_setup_nav_menu_item', $menu_item );\n}\n\n/**\n * Get the menu items associated with a particular object.\n *\n * @since 3.0.0\n *\n * @param int    $object_id   The ID of the original object.\n * @param string $object_type The type of object, such as 'taxonomy' or 'post_type'.\n * @param string $taxonomy    If $object_type is 'taxonomy', $taxonomy is the name of the tax\n *                            that $object_id belongs to.\n * @return int[] The array of menu item IDs; empty array if none;\n */\nfunction wp_get_associated_nav_menu_items( $object_id = 0, $object_type = 'post_type', $taxonomy = '' ) {\n\t$object_id     = (int) $object_id;\n\t$menu_item_ids = array();\n\n\t$query      = new WP_Query;\n\t$menu_items = $query->query(\n\t\tarray(\n\t\t\t'meta_key'       => '_menu_item_object_id',\n\t\t\t'meta_value'     => $object_id,\n\t\t\t'post_status'    => 'any',\n\t\t\t'post_type'      => 'nav_menu_item',\n\t\t\t'posts_per_page' => -1,\n\t\t)\n\t);\n\tforeach ( (array) $menu_items as $menu_item ) {\n\t\tif ( isset( $menu_item->ID ) && is_nav_menu_item( $menu_item->ID ) ) {\n\t\t\t$menu_item_type = get_post_meta( $menu_item->ID, '_menu_item_type', true );\n\t\t\tif (\n\t\t\t\t'post_type' === $object_type &&\n\t\t\t\t'post_type' === $menu_item_type\n\t\t\t) {\n\t\t\t\t$menu_item_ids[] = (int) $menu_item->ID;\n\t\t\t} elseif (\n\t\t\t\t'taxonomy' === $object_type &&\n\t\t\t\t'taxonomy' === $menu_item_type &&\n\t\t\t\tget_post_meta( $menu_item->ID, '_menu_item_object', true ) == $taxonomy\n\t\t\t) {\n\t\t\t\t$menu_item_ids[] = (int) $menu_item->ID;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn array_unique( $menu_item_ids );\n}\n\n/**\n * Callback for handling a menu item when its original object is deleted.\n *\n * @since 3.0.0\n * @access private\n *\n * @param int $object_id The ID of the original object being trashed.\n */\nfunction _wp_delete_post_menu_item( $object_id = 0 ) {\n\t$object_id = (int) $object_id;\n\n\t$menu_item_ids = wp_get_associated_nav_menu_items( $object_id, 'post_type' );\n\n\tforeach ( (array) $menu_item_ids as $menu_item_id ) {\n\t\twp_delete_post( $menu_item_id, true );\n\t}\n}\n\n/**\n * Serves as a callback for handling a menu item when its original object is deleted.\n *\n * @since 3.0.0\n * @access private\n *\n * @param int    $object_id Optional. The ID of the original object being trashed. Default 0.\n * @param int    $tt_id     Term taxonomy ID. Unused.\n * @param string $taxonomy  Taxonomy slug.\n */\nfunction _wp_delete_tax_menu_item( $object_id = 0, $tt_id, $taxonomy ) {\n\t$object_id = (int) $object_id;\n\n\t$menu_item_ids = wp_get_associated_nav_menu_items( $object_id, 'taxonomy', $taxonomy );\n\n\tforeach ( (array) $menu_item_ids as $menu_item_id ) {\n\t\twp_delete_post( $menu_item_id, true );\n\t}\n}\n\n/**\n * Automatically add newly published page objects to menus with that as an option.\n *\n * @since 3.0.0\n * @access private\n *\n * @param string  $new_status The new status of the post object.\n * @param string  $old_status The old status of the post object.\n * @param WP_Post $post       The post object being transitioned from one status to another.\n */\nfunction _wp_auto_add_pages_to_menu( $new_status, $old_status, $post ) {\n\tif ( 'publish' !== $new_status || 'publish' === $old_status || 'page' !== $post->post_type ) {\n\t\treturn;\n\t}\n\tif ( ! empty( $post->post_parent ) ) {\n\t\treturn;\n\t}\n\t$auto_add = get_option( 'nav_menu_options' );\n\tif ( empty( $auto_add ) || ! is_array( $auto_add ) || ! isset( $auto_add['auto_add'] ) ) {\n\t\treturn;\n\t}\n\t$auto_add = $auto_add['auto_add'];\n\tif ( empty( $auto_add ) || ! is_array( $auto_add ) ) {\n\t\treturn;\n\t}\n\n\t$args = array(\n\t\t'menu-item-object-id' => $post->ID,\n\t\t'menu-item-object'    => $post->post_type,\n\t\t'menu-item-type'      => 'post_type',\n\t\t'menu-item-status'    => 'publish',\n\t);\n\n\tforeach ( $auto_add as $menu_id ) {\n\t\t$items = wp_get_nav_menu_items( $menu_id, array( 'post_status' => 'publish,draft' ) );\n\t\tif ( ! is_array( $items ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tforeach ( $items as $item ) {\n\t\t\tif ( $post->ID == $item->object_id ) {\n\t\t\t\tcontinue 2;\n\t\t\t}\n\t\t}\n\t\twp_update_nav_menu_item( $menu_id, 0, $args );\n\t}\n}\n\n/**\n * Delete auto-draft posts associated with the supplied changeset.\n *\n * @since 4.8.0\n * @access private\n *\n * @param int $post_id Post ID for the customize_changeset.\n */\nfunction _wp_delete_customize_changeset_dependent_auto_drafts( $post_id ) {\n\t$post = get_post( $post_id );\n\n\tif ( ! $post || 'customize_changeset' !== $post->post_type ) {\n\t\treturn;\n\t}\n\n\t$data = json_decode( $post->post_content, true );\n\tif ( empty( $data['nav_menus_created_posts']['value'] ) ) {\n\t\treturn;\n\t}\n\tremove_action( 'delete_post', '_wp_delete_customize_changeset_dependent_auto_drafts' );\n\tforeach ( $data['nav_menus_created_posts']['value'] as $stub_post_id ) {\n\t\tif ( empty( $stub_post_id ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( 'auto-draft' === get_post_status( $stub_post_id ) ) {\n\t\t\twp_delete_post( $stub_post_id, true );\n\t\t} elseif ( 'draft' === get_post_status( $stub_post_id ) ) {\n\t\t\twp_trash_post( $stub_post_id );\n\t\t\tdelete_post_meta( $stub_post_id, '_customize_changeset_uuid' );\n\t\t}\n\t}\n\tadd_action( 'delete_post', '_wp_delete_customize_changeset_dependent_auto_drafts' );\n}\n\n/**\n * Handle menu config after theme change.\n *\n * @access private\n * @since 4.9.0\n */\nfunction _wp_menus_changed() {\n\t$old_nav_menu_locations    = get_option( 'theme_switch_menu_locations', array() );\n\t$new_nav_menu_locations    = get_nav_menu_locations();\n\t$mapped_nav_menu_locations = wp_map_nav_menu_locations( $new_nav_menu_locations, $old_nav_menu_locations );\n\n\tset_theme_mod( 'nav_menu_locations', $mapped_nav_menu_locations );\n\tdelete_option( 'theme_switch_menu_locations' );\n}\n\n/**\n * Maps nav menu locations according to assignments in previously active theme.\n *\n * @since 4.9.0\n *\n * @param array $new_nav_menu_locations New nav menu locations assignments.\n * @param array $old_nav_menu_locations Old nav menu locations assignments.\n * @return array Nav menus mapped to new nav menu locations.\n */\nfunction wp_map_nav_menu_locations( $new_nav_menu_locations, $old_nav_menu_locations ) {\n\t$registered_nav_menus   = get_registered_nav_menus();\n\t$new_nav_menu_locations = array_intersect_key( $new_nav_menu_locations, $registered_nav_menus );\n\n\t// Short-circuit if there are no old nav menu location assignments to map.\n\tif ( empty( $old_nav_menu_locations ) ) {\n\t\treturn $new_nav_menu_locations;\n\t}\n\n\t// If old and new theme have just one location, map it and we're done.\n\tif ( 1 === count( $old_nav_menu_locations ) && 1 === count( $registered_nav_menus ) ) {\n\t\t$new_nav_menu_locations[ key( $registered_nav_menus ) ] = array_pop( $old_nav_menu_locations );\n\t\treturn $new_nav_menu_locations;\n\t}\n\n\t$old_locations = array_keys( $old_nav_menu_locations );\n\n\t// Map locations with the same slug.\n\tforeach ( $registered_nav_menus as $location => $name ) {\n\t\tif ( in_array( $location, $old_locations, true ) ) {\n\t\t\t$new_nav_menu_locations[ $location ] = $old_nav_menu_locations[ $location ];\n\t\t\tunset( $old_nav_menu_locations[ $location ] );\n\t\t}\n\t}\n\n\t// If there are no old nav menu locations left, then we're done.\n\tif ( empty( $old_nav_menu_locations ) ) {\n\t\treturn $new_nav_menu_locations;\n\t}\n\n\t/*\n\t * If old and new theme both have locations that contain phrases\n\t * from within the same group, make an educated guess and map it.\n\t */\n\t$common_slug_groups = array(\n\t\tarray( 'primary', 'menu-1', 'main', 'header', 'navigation', 'top' ),\n\t\tarray( 'secondary', 'menu-2', 'footer', 'subsidiary', 'bottom' ),\n\t\tarray( 'social' ),\n\t);\n\n\t// Go through each group...\n\tforeach ( $common_slug_groups as $slug_group ) {\n\n\t\t// ...and see if any of these slugs...\n\t\tforeach ( $slug_group as $slug ) {\n\n\t\t\t// ...and any of the new menu locations...\n\t\t\tforeach ( $registered_nav_menus as $new_location => $name ) {\n\n\t\t\t\t// ...actually match!\n\t\t\t\tif ( is_string( $new_location ) && false === stripos( $new_location, $slug ) && false === stripos( $slug, $new_location ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} elseif ( is_numeric( $new_location ) && $new_location !== $slug ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Then see if any of the old locations...\n\t\t\t\tforeach ( $old_nav_menu_locations as $location => $menu_id ) {\n\n\t\t\t\t\t// ...and any slug in the same group...\n\t\t\t\t\tforeach ( $slug_group as $slug ) {\n\n\t\t\t\t\t\t// ... have a match as well.\n\t\t\t\t\t\tif ( is_string( $location ) && false === stripos( $location, $slug ) && false === stripos( $slug, $location ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t} elseif ( is_numeric( $location ) && $location !== $slug ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Make sure this location wasn't mapped and removed previously.\n\t\t\t\t\t\tif ( ! empty( $old_nav_menu_locations[ $location ] ) ) {\n\n\t\t\t\t\t\t\t// We have a match that can be mapped!\n\t\t\t\t\t\t\t$new_nav_menu_locations[ $new_location ] = $old_nav_menu_locations[ $location ];\n\n\t\t\t\t\t\t\t// Remove the mapped location so it can't be mapped again.\n\t\t\t\t\t\t\tunset( $old_nav_menu_locations[ $location ] );\n\n\t\t\t\t\t\t\t// Go back and check the next new menu location.\n\t\t\t\t\t\t\tcontinue 3;\n\t\t\t\t\t\t}\n\t\t\t\t\t} // End foreach ( $slug_group as $slug ).\n\t\t\t\t} // End foreach ( $old_nav_menu_locations as $location => $menu_id ).\n\t\t\t} // End foreach foreach ( $registered_nav_menus as $new_location => $name ).\n\t\t} // End foreach ( $slug_group as $slug ).\n\t} // End foreach ( $common_slug_groups as $slug_group ).\n\n\treturn $new_nav_menu_locations;\n}\n", "num_lines": 1264}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Option API\n *\n * @package WordPress\n * @subpackage Option\n */\n\n/**\n * Retrieves an option value based on an option name.\n *\n * If the option does not exist or does not have a value, then the return value\n * will be false. This is useful to check whether you need to install an option\n * and is commonly used during installation of plugin options and to test\n * whether upgrading is required.\n *\n * If the option was serialized then it will be unserialized when it is returned.\n *\n * Any scalar values will be returned as strings. You may coerce the return type of\n * a given option by registering an {@see 'option_$option'} filter callback.\n *\n * @since 1.5.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $option  Name of the option to retrieve. Expected to not be SQL-escaped.\n * @param mixed  $default Optional. Default value to return if the option does not exist.\n * @return mixed Value set for the option.\n */\nfunction get_option( $option, $default = false ) {\n\tglobal $wpdb;\n\n\t$option = trim( $option );\n\tif ( empty( $option ) ) {\n\t\treturn false;\n\t}\n\n\t/*\n\t * Until a proper _deprecated_option() function can be introduced,\n\t * redirect requests to deprecated keys to the new, correct ones.\n\t */\n\t$deprecated_keys = array(\n\t\t'blacklist_keys'    => 'disallowed_keys',\n\t\t'comment_whitelist' => 'comment_previously_approved',\n\t);\n\n\tif ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) {\n\t\t_deprecated_argument(\n\t\t\t__FUNCTION__,\n\t\t\t'5.5.0',\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: Deprecated option key, 2: New option key. */\n\t\t\t\t__( 'The \"%1$s\" option key has been renamed to \"%2$s\".' ),\n\t\t\t\t$option,\n\t\t\t\t$deprecated_keys[ $option ]\n\t\t\t)\n\t\t);\n\t\treturn get_option( $deprecated_keys[ $option ], $default );\n\t}\n\n\t/**\n\t * Filters the value of an existing option before it is retrieved.\n\t *\n\t * The dynamic portion of the hook name, `$option`, refers to the option name.\n\t *\n\t * Returning a truthy value from the filter will effectively short-circuit retrieval\n\t * and return the passed value instead.\n\t *\n\t * @since 1.5.0\n\t * @since 4.4.0 The `$option` parameter was added.\n\t * @since 4.9.0 The `$default` parameter was added.\n\t *\n\t * @param mixed  $pre_option The value to return instead of the option value. This differs\n\t *                           from `$default`, which is used as the fallback value in the event\n\t *                           the option doesn't exist elsewhere in get_option().\n\t *                           Default false (to skip past the short-circuit).\n\t * @param string $option     Option name.\n\t * @param mixed  $default    The fallback value to return if the option does not exist.\n\t *                           Default false.\n\t */\n\t$pre = apply_filters( \"pre_option_{$option}\", false, $option, $default );\n\n\tif ( false !== $pre ) {\n\t\treturn $pre;\n\t}\n\n\tif ( defined( 'WP_SETUP_CONFIG' ) ) {\n\t\treturn false;\n\t}\n\n\t// Distinguish between `false` as a default, and not passing one.\n\t$passed_default = func_num_args() > 1;\n\n\tif ( ! wp_installing() ) {\n\t\t// Prevent non-existent options from triggering multiple queries.\n\t\t$notoptions = wp_cache_get( 'notoptions', 'options' );\n\n\t\tif ( isset( $notoptions[ $option ] ) ) {\n\t\t\t/**\n\t\t\t * Filters the default value for an option.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$option`, refers to the option name.\n\t\t\t *\n\t\t\t * @since 3.4.0\n\t\t\t * @since 4.4.0 The `$option` parameter was added.\n\t\t\t * @since 4.7.0 The `$passed_default` parameter was added to distinguish between a `false` value and the default parameter value.\n\t\t\t *\n\t\t\t * @param mixed  $default The default value to return if the option does not exist\n\t\t\t *                        in the database.\n\t\t\t * @param string $option  Option name.\n\t\t\t * @param bool   $passed_default Was `get_option()` passed a default value?\n\t\t\t */\n\t\t\treturn apply_filters( \"default_option_{$option}\", $default, $option, $passed_default );\n\t\t}\n\n\t\t$alloptions = wp_load_alloptions();\n\n\t\tif ( isset( $alloptions[ $option ] ) ) {\n\t\t\t$value = $alloptions[ $option ];\n\t\t} else {\n\t\t\t$value = wp_cache_get( $option, 'options' );\n\n\t\t\tif ( false === $value ) {\n\t\t\t\t$row = $wpdb->get_row( $wpdb->prepare( \"SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1\", $option ) );\n\n\t\t\t\t// Has to be get_row() instead of get_var() because of funkiness with 0, false, null values.\n\t\t\t\tif ( is_object( $row ) ) {\n\t\t\t\t\t$value = $row->option_value;\n\t\t\t\t\twp_cache_add( $option, $value, 'options' );\n\t\t\t\t} else { // Option does not exist, so we must cache its non-existence.\n\t\t\t\t\tif ( ! is_array( $notoptions ) ) {\n\t\t\t\t\t\t$notoptions = array();\n\t\t\t\t\t}\n\n\t\t\t\t\t$notoptions[ $option ] = true;\n\t\t\t\t\twp_cache_set( 'notoptions', $notoptions, 'options' );\n\n\t\t\t\t\t/** This filter is documented in wp-includes/option.php */\n\t\t\t\t\treturn apply_filters( \"default_option_{$option}\", $default, $option, $passed_default );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$suppress = $wpdb->suppress_errors();\n\t\t$row      = $wpdb->get_row( $wpdb->prepare( \"SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1\", $option ) );\n\t\t$wpdb->suppress_errors( $suppress );\n\n\t\tif ( is_object( $row ) ) {\n\t\t\t$value = $row->option_value;\n\t\t} else {\n\t\t\t/** This filter is documented in wp-includes/option.php */\n\t\t\treturn apply_filters( \"default_option_{$option}\", $default, $option, $passed_default );\n\t\t}\n\t}\n\n\t// If home is not set, use siteurl.\n\tif ( 'home' === $option && '' === $value ) {\n\t\treturn get_option( 'siteurl' );\n\t}\n\n\tif ( in_array( $option, array( 'siteurl', 'home', 'category_base', 'tag_base' ), true ) ) {\n\t\t$value = untrailingslashit( $value );\n\t}\n\n\t/**\n\t * Filters the value of an existing option.\n\t *\n\t * The dynamic portion of the hook name, `$option`, refers to the option name.\n\t *\n\t * @since 1.5.0 As 'option_' . $setting\n\t * @since 3.0.0\n\t * @since 4.4.0 The `$option` parameter was added.\n\t *\n\t * @param mixed  $value  Value of the option. If stored serialized, it will be\n\t *                       unserialized prior to being returned.\n\t * @param string $option Option name.\n\t */\n\treturn apply_filters( \"option_{$option}\", maybe_unserialize( $value ), $option );\n}\n\n/**\n * Protects WordPress special option from being modified.\n *\n * Will die if $option is in protected list. Protected options are 'alloptions'\n * and 'notoptions' options.\n *\n * @since 2.2.0\n *\n * @param string $option Option name.\n */\nfunction wp_protect_special_option( $option ) {\n\tif ( 'alloptions' === $option || 'notoptions' === $option ) {\n\t\twp_die(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Option name. */\n\t\t\t\t__( '%s is a protected WP option and may not be modified' ),\n\t\t\t\tesc_html( $option )\n\t\t\t)\n\t\t);\n\t}\n}\n\n/**\n * Prints option value after sanitizing for forms.\n *\n * @since 1.5.0\n *\n * @param string $option Option name.\n */\nfunction form_option( $option ) {\n\techo esc_attr( get_option( $option ) );\n}\n\n/**\n * Loads and caches all autoloaded options, if available or all options.\n *\n * @since 2.2.0\n * @since 5.3.1 The `$force_cache` parameter was added.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param bool $force_cache Optional. Whether to force an update of the local cache\n *                          from the persistent cache. Default false.\n * @return array List of all options.\n */\nfunction wp_load_alloptions( $force_cache = false ) {\n\tglobal $wpdb;\n\n\tif ( ! wp_installing() || ! is_multisite() ) {\n\t\t$alloptions = wp_cache_get( 'alloptions', 'options', $force_cache );\n\t} else {\n\t\t$alloptions = false;\n\t}\n\n\tif ( ! $alloptions ) {\n\t\t$suppress      = $wpdb->suppress_errors();\n\t\t$alloptions_db = $wpdb->get_results( \"SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'\" );\n\t\tif ( ! $alloptions_db ) {\n\t\t\t$alloptions_db = $wpdb->get_results( \"SELECT option_name, option_value FROM $wpdb->options\" );\n\t\t}\n\t\t$wpdb->suppress_errors( $suppress );\n\n\t\t$alloptions = array();\n\t\tforeach ( (array) $alloptions_db as $o ) {\n\t\t\t$alloptions[ $o->option_name ] = $o->option_value;\n\t\t}\n\n\t\tif ( ! wp_installing() || ! is_multisite() ) {\n\t\t\t/**\n\t\t\t * Filters all options before caching them.\n\t\t\t *\n\t\t\t * @since 4.9.0\n\t\t\t *\n\t\t\t * @param array $alloptions Array with all options.\n\t\t\t */\n\t\t\t$alloptions = apply_filters( 'pre_cache_alloptions', $alloptions );\n\n\t\t\twp_cache_add( 'alloptions', $alloptions, 'options' );\n\t\t}\n\t}\n\n\t/**\n\t * Filters all options after retrieving them.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param array $alloptions Array with all options.\n\t */\n\treturn apply_filters( 'alloptions', $alloptions );\n}\n\n/**\n * Loads and caches certain often requested site options if is_multisite() and a persistent cache is not being used.\n *\n * @since 3.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int $network_id Optional site ID for which to query the options. Defaults to the current site.\n */\nfunction wp_load_core_site_options( $network_id = null ) {\n\tglobal $wpdb;\n\n\tif ( ! is_multisite() || wp_using_ext_object_cache() || wp_installing() ) {\n\t\treturn;\n\t}\n\n\tif ( empty( $network_id ) ) {\n\t\t$network_id = get_current_network_id();\n\t}\n\n\t$core_options = array( 'site_name', 'siteurl', 'active_sitewide_plugins', '_site_transient_timeout_theme_roots', '_site_transient_theme_roots', 'site_admins', 'can_compress_scripts', 'global_terms_enabled', 'ms_files_rewriting' );\n\n\t$core_options_in = \"'\" . implode( \"', '\", $core_options ) . \"'\";\n\t$options         = $wpdb->get_results( $wpdb->prepare( \"SELECT meta_key, meta_value FROM $wpdb->sitemeta WHERE meta_key IN ($core_options_in) AND site_id = %d\", $network_id ) );\n\n\tforeach ( $options as $option ) {\n\t\t$key                = $option->meta_key;\n\t\t$cache_key          = \"{$network_id}:$key\";\n\t\t$option->meta_value = maybe_unserialize( $option->meta_value );\n\n\t\twp_cache_set( $cache_key, $option->meta_value, 'site-options' );\n\t}\n}\n\n/**\n * Updates the value of an option that was already added.\n *\n * You do not need to serialize values. If the value needs to be serialized,\n * then it will be serialized before it is inserted into the database.\n * Remember, resources cannot be serialized or added as an option.\n *\n * If the option does not exist, it will be created.\n\n * This function is designed to work with or without a logged-in user. In terms of security,\n * plugin developers should check the current user's capabilities before updating any options.\n *\n * @since 1.0.0\n * @since 4.2.0 The `$autoload` parameter was added.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string      $option   Name of the option to update. Expected to not be SQL-escaped.\n * @param mixed       $value    Option value. Must be serializable if non-scalar. Expected to not be SQL-escaped.\n * @param string|bool $autoload Optional. Whether to load the option when WordPress starts up. For existing options,\n *                              `$autoload` can only be updated using `update_option()` if `$value` is also changed.\n *                              Accepts 'yes'|true to enable or 'no'|false to disable. For non-existent options,\n *                              the default value is 'yes'. Default null.\n * @return bool True if the value was updated, false otherwise.\n */\nfunction update_option( $option, $value, $autoload = null ) {\n\tglobal $wpdb;\n\n\t$option = trim( $option );\n\tif ( empty( $option ) ) {\n\t\treturn false;\n\t}\n\n\t/*\n\t * Until a proper _deprecated_option() function can be introduced,\n\t * redirect requests to deprecated keys to the new, correct ones.\n\t */\n\t$deprecated_keys = array(\n\t\t'blacklist_keys'    => 'disallowed_keys',\n\t\t'comment_whitelist' => 'comment_previously_approved',\n\t);\n\n\tif ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) {\n\t\t_deprecated_argument(\n\t\t\t__FUNCTION__,\n\t\t\t'5.5.0',\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: Deprecated option key, 2: New option key. */\n\t\t\t\t__( 'The \"%1$s\" option key has been renamed to \"%2$s\".' ),\n\t\t\t\t$option,\n\t\t\t\t$deprecated_keys[ $option ]\n\t\t\t)\n\t\t);\n\t\treturn update_option( $deprecated_keys[ $option ], $value, $autoload );\n\t}\n\n\twp_protect_special_option( $option );\n\n\tif ( is_object( $value ) ) {\n\t\t$value = clone $value;\n\t}\n\n\t$value     = sanitize_option( $option, $value );\n\t$old_value = get_option( $option );\n\n\t/**\n\t * Filters a specific option before its value is (maybe) serialized and updated.\n\t *\n\t * The dynamic portion of the hook name, `$option`, refers to the option name.\n\t *\n\t * @since 2.6.0\n\t * @since 4.4.0 The `$option` parameter was added.\n\t *\n\t * @param mixed  $value     The new, unserialized option value.\n\t * @param mixed  $old_value The old option value.\n\t * @param string $option    Option name.\n\t */\n\t$value = apply_filters( \"pre_update_option_{$option}\", $value, $old_value, $option );\n\n\t/**\n\t * Filters an option before its value is (maybe) serialized and updated.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param mixed  $value     The new, unserialized option value.\n\t * @param string $option    Name of the option.\n\t * @param mixed  $old_value The old option value.\n\t */\n\t$value = apply_filters( 'pre_update_option', $value, $option, $old_value );\n\n\t/*\n\t * If the new and old values are the same, no need to update.\n\t *\n\t * Unserialized values will be adequate in most cases. If the unserialized\n\t * data differs, the (maybe) serialized data is checked to avoid\n\t * unnecessary database calls for otherwise identical object instances.\n\t *\n\t * See https://core.trac.wordpress.org/ticket/38903\n\t */\n\tif ( $value === $old_value || maybe_serialize( $value ) === maybe_serialize( $old_value ) ) {\n\t\treturn false;\n\t}\n\n\t/** This filter is documented in wp-includes/option.php */\n\tif ( apply_filters( \"default_option_{$option}\", false, $option, false ) === $old_value ) {\n\t\t// Default setting for new options is 'yes'.\n\t\tif ( null === $autoload ) {\n\t\t\t$autoload = 'yes';\n\t\t}\n\n\t\treturn add_option( $option, $value, '', $autoload );\n\t}\n\n\t$serialized_value = maybe_serialize( $value );\n\n\t/**\n\t * Fires immediately before an option value is updated.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string $option    Name of the option to update.\n\t * @param mixed  $old_value The old option value.\n\t * @param mixed  $value     The new option value.\n\t */\n\tdo_action( 'update_option', $option, $old_value, $value );\n\n\t$update_args = array(\n\t\t'option_value' => $serialized_value,\n\t);\n\n\tif ( null !== $autoload ) {\n\t\t$update_args['autoload'] = ( 'no' === $autoload || false === $autoload ) ? 'no' : 'yes';\n\t}\n\n\t$result = $wpdb->update( $wpdb->options, $update_args, array( 'option_name' => $option ) );\n\tif ( ! $result ) {\n\t\treturn false;\n\t}\n\n\t$notoptions = wp_cache_get( 'notoptions', 'options' );\n\n\tif ( is_array( $notoptions ) && isset( $notoptions[ $option ] ) ) {\n\t\tunset( $notoptions[ $option ] );\n\t\twp_cache_set( 'notoptions', $notoptions, 'options' );\n\t}\n\n\tif ( ! wp_installing() ) {\n\t\t$alloptions = wp_load_alloptions( true );\n\t\tif ( isset( $alloptions[ $option ] ) ) {\n\t\t\t$alloptions[ $option ] = $serialized_value;\n\t\t\twp_cache_set( 'alloptions', $alloptions, 'options' );\n\t\t} else {\n\t\t\twp_cache_set( $option, $serialized_value, 'options' );\n\t\t}\n\t}\n\n\t/**\n\t * Fires after the value of a specific option has been successfully updated.\n\t *\n\t * The dynamic portion of the hook name, `$option`, refers to the option name.\n\t *\n\t * @since 2.0.1\n\t * @since 4.4.0 The `$option` parameter was added.\n\t *\n\t * @param mixed  $old_value The old option value.\n\t * @param mixed  $value     The new option value.\n\t * @param string $option    Option name.\n\t */\n\tdo_action( \"update_option_{$option}\", $old_value, $value, $option );\n\n\t/**\n\t * Fires after the value of an option has been successfully updated.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string $option    Name of the updated option.\n\t * @param mixed  $old_value The old option value.\n\t * @param mixed  $value     The new option value.\n\t */\n\tdo_action( 'updated_option', $option, $old_value, $value );\n\n\treturn true;\n}\n\n/**\n * Adds a new option.\n *\n * You do not need to serialize values. If the value needs to be serialized,\n * then it will be serialized before it is inserted into the database.\n * Remember, resources cannot be serialized or added as an option.\n *\n * You can create options without values and then update the values later.\n * Existing options will not be updated and checks are performed to ensure that you\n * aren't adding a protected WordPress option. Care should be taken to not name\n * options the same as the ones which are protected.\n *\n * @since 1.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string      $option     Name of the option to add. Expected to not be SQL-escaped.\n * @param mixed       $value      Optional. Option value. Must be serializable if non-scalar.\n *                                Expected to not be SQL-escaped.\n * @param string      $deprecated Optional. Description. Not used anymore.\n * @param string|bool $autoload   Optional. Whether to load the option when WordPress starts up.\n *                                Default is enabled. Accepts 'no' to disable for legacy reasons.\n * @return bool True if the option was added, false otherwise.\n */\nfunction add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' ) {\n\tglobal $wpdb;\n\n\tif ( ! empty( $deprecated ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '2.3.0' );\n\t}\n\n\t$option = trim( $option );\n\tif ( empty( $option ) ) {\n\t\treturn false;\n\t}\n\n\t/*\n\t * Until a proper _deprecated_option() function can be introduced,\n\t * redirect requests to deprecated keys to the new, correct ones.\n\t */\n\t$deprecated_keys = array(\n\t\t'blacklist_keys'    => 'disallowed_keys',\n\t\t'comment_whitelist' => 'comment_previously_approved',\n\t);\n\n\tif ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) {\n\t\t_deprecated_argument(\n\t\t\t__FUNCTION__,\n\t\t\t'5.5.0',\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: Deprecated option key, 2: New option key. */\n\t\t\t\t__( 'The \"%1$s\" option key has been renamed to \"%2$s\".' ),\n\t\t\t\t$option,\n\t\t\t\t$deprecated_keys[ $option ]\n\t\t\t)\n\t\t);\n\t\treturn add_option( $deprecated_keys[ $option ], $value, $deprecated, $autoload );\n\t}\n\n\twp_protect_special_option( $option );\n\n\tif ( is_object( $value ) ) {\n\t\t$value = clone $value;\n\t}\n\n\t$value = sanitize_option( $option, $value );\n\n\t// Make sure the option doesn't already exist.\n\t// We can check the 'notoptions' cache before we ask for a DB query.\n\t$notoptions = wp_cache_get( 'notoptions', 'options' );\n\n\tif ( ! is_array( $notoptions ) || ! isset( $notoptions[ $option ] ) ) {\n\t\t/** This filter is documented in wp-includes/option.php */\n\t\tif ( apply_filters( \"default_option_{$option}\", false, $option, false ) !== get_option( $option ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t$serialized_value = maybe_serialize( $value );\n\t$autoload         = ( 'no' === $autoload || false === $autoload ) ? 'no' : 'yes';\n\n\t/**\n\t * Fires before an option is added.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string $option Name of the option to add.\n\t * @param mixed  $value  Value of the option.\n\t */\n\tdo_action( 'add_option', $option, $value );\n\n\t$result = $wpdb->query( $wpdb->prepare( \"INSERT INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, %s) ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)\", $option, $serialized_value, $autoload ) );\n\tif ( ! $result ) {\n\t\treturn false;\n\t}\n\n\tif ( ! wp_installing() ) {\n\t\tif ( 'yes' === $autoload ) {\n\t\t\t$alloptions            = wp_load_alloptions( true );\n\t\t\t$alloptions[ $option ] = $serialized_value;\n\t\t\twp_cache_set( 'alloptions', $alloptions, 'options' );\n\t\t} else {\n\t\t\twp_cache_set( $option, $serialized_value, 'options' );\n\t\t}\n\t}\n\n\t// This option exists now.\n\t$notoptions = wp_cache_get( 'notoptions', 'options' ); // Yes, again... we need it to be fresh.\n\n\tif ( is_array( $notoptions ) && isset( $notoptions[ $option ] ) ) {\n\t\tunset( $notoptions[ $option ] );\n\t\twp_cache_set( 'notoptions', $notoptions, 'options' );\n\t}\n\n\t/**\n\t * Fires after a specific option has been added.\n\t *\n\t * The dynamic portion of the hook name, `$option`, refers to the option name.\n\t *\n\t * @since 2.5.0 As \"add_option_{$name}\"\n\t * @since 3.0.0\n\t *\n\t * @param string $option Name of the option to add.\n\t * @param mixed  $value  Value of the option.\n\t */\n\tdo_action( \"add_option_{$option}\", $option, $value );\n\n\t/**\n\t * Fires after an option has been added.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string $option Name of the added option.\n\t * @param mixed  $value  Value of the option.\n\t */\n\tdo_action( 'added_option', $option, $value );\n\n\treturn true;\n}\n\n/**\n * Removes option by name. Prevents removal of protected WordPress options.\n *\n * @since 1.2.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $option Name of the option to delete. Expected to not be SQL-escaped.\n * @return bool True if the option was deleted, false otherwise.\n */\nfunction delete_option( $option ) {\n\tglobal $wpdb;\n\n\t$option = trim( $option );\n\tif ( empty( $option ) ) {\n\t\treturn false;\n\t}\n\n\twp_protect_special_option( $option );\n\n\t// Get the ID, if no ID then return.\n\t$row = $wpdb->get_row( $wpdb->prepare( \"SELECT autoload FROM $wpdb->options WHERE option_name = %s\", $option ) );\n\tif ( is_null( $row ) ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Fires immediately before an option is deleted.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string $option Name of the option to delete.\n\t */\n\tdo_action( 'delete_option', $option );\n\n\t$result = $wpdb->delete( $wpdb->options, array( 'option_name' => $option ) );\n\n\tif ( ! wp_installing() ) {\n\t\tif ( 'yes' === $row->autoload ) {\n\t\t\t$alloptions = wp_load_alloptions( true );\n\t\t\tif ( is_array( $alloptions ) && isset( $alloptions[ $option ] ) ) {\n\t\t\t\tunset( $alloptions[ $option ] );\n\t\t\t\twp_cache_set( 'alloptions', $alloptions, 'options' );\n\t\t\t}\n\t\t} else {\n\t\t\twp_cache_delete( $option, 'options' );\n\t\t}\n\t}\n\n\tif ( $result ) {\n\n\t\t/**\n\t\t * Fires after a specific option has been deleted.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$option`, refers to the option name.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string $option Name of the deleted option.\n\t\t */\n\t\tdo_action( \"delete_option_{$option}\", $option );\n\n\t\t/**\n\t\t * Fires after an option has been deleted.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param string $option Name of the deleted option.\n\t\t */\n\t\tdo_action( 'deleted_option', $option );\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Deletes a transient.\n *\n * @since 2.8.0\n *\n * @param string $transient Transient name. Expected to not be SQL-escaped.\n * @return bool True if the transient was deleted, false otherwise.\n */\nfunction delete_transient( $transient ) {\n\n\t/**\n\t * Fires immediately before a specific transient is deleted.\n\t *\n\t * The dynamic portion of the hook name, `$transient`, refers to the transient name.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $transient Transient name.\n\t */\n\tdo_action( \"delete_transient_{$transient}\", $transient );\n\n\tif ( wp_using_ext_object_cache() ) {\n\t\t$result = wp_cache_delete( $transient, 'transient' );\n\t} else {\n\t\t$option_timeout = '_transient_timeout_' . $transient;\n\t\t$option         = '_transient_' . $transient;\n\t\t$result         = delete_option( $option );\n\n\t\tif ( $result ) {\n\t\t\tdelete_option( $option_timeout );\n\t\t}\n\t}\n\n\tif ( $result ) {\n\n\t\t/**\n\t\t * Fires after a transient is deleted.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string $transient Deleted transient name.\n\t\t */\n\t\tdo_action( 'deleted_transient', $transient );\n\t}\n\n\treturn $result;\n}\n\n/**\n * Retrieves the value of a transient.\n *\n * If the transient does not exist, does not have a value, or has expired,\n * then the return value will be false.\n *\n * @since 2.8.0\n *\n * @param string $transient Transient name. Expected to not be SQL-escaped.\n * @return mixed Value of transient.\n */\nfunction get_transient( $transient ) {\n\n\t/**\n\t * Filters the value of an existing transient before it is retrieved.\n\t *\n\t * The dynamic portion of the hook name, `$transient`, refers to the transient name.\n\t *\n\t * Returning a truthy value from the filter will effectively short-circuit retrieval\n\t * and return the passed value instead.\n\t *\n\t * @since 2.8.0\n\t * @since 4.4.0 The `$transient` parameter was added\n\t *\n\t * @param mixed  $pre_transient The default value to return if the transient does not exist.\n\t *                              Any value other than false will short-circuit the retrieval\n\t *                              of the transient, and return that value.\n\t * @param string $transient     Transient name.\n\t */\n\t$pre = apply_filters( \"pre_transient_{$transient}\", false, $transient );\n\n\tif ( false !== $pre ) {\n\t\treturn $pre;\n\t}\n\n\tif ( wp_using_ext_object_cache() ) {\n\t\t$value = wp_cache_get( $transient, 'transient' );\n\t} else {\n\t\t$transient_option = '_transient_' . $transient;\n\t\tif ( ! wp_installing() ) {\n\t\t\t// If option is not in alloptions, it is not autoloaded and thus has a timeout.\n\t\t\t$alloptions = wp_load_alloptions();\n\t\t\tif ( ! isset( $alloptions[ $transient_option ] ) ) {\n\t\t\t\t$transient_timeout = '_transient_timeout_' . $transient;\n\t\t\t\t$timeout           = get_option( $transient_timeout );\n\t\t\t\tif ( false !== $timeout && $timeout < time() ) {\n\t\t\t\t\tdelete_option( $transient_option );\n\t\t\t\t\tdelete_option( $transient_timeout );\n\t\t\t\t\t$value = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! isset( $value ) ) {\n\t\t\t$value = get_option( $transient_option );\n\t\t}\n\t}\n\n\t/**\n\t * Filters an existing transient's value.\n\t *\n\t * The dynamic portion of the hook name, `$transient`, refers to the transient name.\n\t *\n\t * @since 2.8.0\n\t * @since 4.4.0 The `$transient` parameter was added\n\t *\n\t * @param mixed  $value     Value of transient.\n\t * @param string $transient Transient name.\n\t */\n\treturn apply_filters( \"transient_{$transient}\", $value, $transient );\n}\n\n/**\n * Sets/updates the value of a transient.\n *\n * You do not need to serialize values. If the value needs to be serialized,\n * then it will be serialized before it is set.\n *\n * @since 2.8.0\n *\n * @param string $transient  Transient name. Expected to not be SQL-escaped.\n *                           Must be 172 characters or fewer in length.\n * @param mixed  $value      Transient value. Must be serializable if non-scalar.\n *                           Expected to not be SQL-escaped.\n * @param int    $expiration Optional. Time until expiration in seconds. Default 0 (no expiration).\n * @return bool True if the value was set, false otherwise.\n */\nfunction set_transient( $transient, $value, $expiration = 0 ) {\n\n\t$expiration = (int) $expiration;\n\n\t/**\n\t * Filters a specific transient before its value is set.\n\t *\n\t * The dynamic portion of the hook name, `$transient`, refers to the transient name.\n\t *\n\t * @since 3.0.0\n\t * @since 4.2.0 The `$expiration` parameter was added.\n\t * @since 4.4.0 The `$transient` parameter was added.\n\t *\n\t * @param mixed  $value      New value of transient.\n\t * @param int    $expiration Time until expiration in seconds.\n\t * @param string $transient  Transient name.\n\t */\n\t$value = apply_filters( \"pre_set_transient_{$transient}\", $value, $expiration, $transient );\n\n\t/**\n\t * Filters the expiration for a transient before its value is set.\n\t *\n\t * The dynamic portion of the hook name, `$transient`, refers to the transient name.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param int    $expiration Time until expiration in seconds. Use 0 for no expiration.\n\t * @param mixed  $value      New value of transient.\n\t * @param string $transient  Transient name.\n\t */\n\t$expiration = apply_filters( \"expiration_of_transient_{$transient}\", $expiration, $value, $transient );\n\n\tif ( wp_using_ext_object_cache() ) {\n\t\t$result = wp_cache_set( $transient, $value, 'transient', $expiration );\n\t} else {\n\t\t$transient_timeout = '_transient_timeout_' . $transient;\n\t\t$transient_option  = '_transient_' . $transient;\n\n\t\tif ( false === get_option( $transient_option ) ) {\n\t\t\t$autoload = 'yes';\n\t\t\tif ( $expiration ) {\n\t\t\t\t$autoload = 'no';\n\t\t\t\tadd_option( $transient_timeout, time() + $expiration, '', 'no' );\n\t\t\t}\n\t\t\t$result = add_option( $transient_option, $value, '', $autoload );\n\t\t} else {\n\t\t\t// If expiration is requested, but the transient has no timeout option,\n\t\t\t// delete, then re-create transient rather than update.\n\t\t\t$update = true;\n\n\t\t\tif ( $expiration ) {\n\t\t\t\tif ( false === get_option( $transient_timeout ) ) {\n\t\t\t\t\tdelete_option( $transient_option );\n\t\t\t\t\tadd_option( $transient_timeout, time() + $expiration, '', 'no' );\n\t\t\t\t\t$result = add_option( $transient_option, $value, '', 'no' );\n\t\t\t\t\t$update = false;\n\t\t\t\t} else {\n\t\t\t\t\tupdate_option( $transient_timeout, time() + $expiration );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $update ) {\n\t\t\t\t$result = update_option( $transient_option, $value );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( $result ) {\n\n\t\t/**\n\t\t * Fires after the value for a specific transient has been set.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$transient`, refers to the transient name.\n\t\t *\n\t\t * @since 3.0.0\n\t\t * @since 3.6.0 The `$value` and `$expiration` parameters were added.\n\t\t * @since 4.4.0 The `$transient` parameter was added.\n\t\t *\n\t\t * @param mixed  $value      Transient value.\n\t\t * @param int    $expiration Time until expiration in seconds.\n\t\t * @param string $transient  The name of the transient.\n\t\t */\n\t\tdo_action( \"set_transient_{$transient}\", $value, $expiration, $transient );\n\n\t\t/**\n\t\t * Fires after the value for a transient has been set.\n\t\t *\n\t\t * @since 3.0.0\n\t\t * @since 3.6.0 The `$value` and `$expiration` parameters were added.\n\t\t *\n\t\t * @param string $transient  The name of the transient.\n\t\t * @param mixed  $value      Transient value.\n\t\t * @param int    $expiration Time until expiration in seconds.\n\t\t */\n\t\tdo_action( 'setted_transient', $transient, $value, $expiration );\n\t}\n\n\treturn $result;\n}\n\n/**\n * Deletes all expired transients.\n *\n * The multi-table delete syntax is used to delete the transient record\n * from table a, and the corresponding transient_timeout record from table b.\n *\n * @since 4.9.0\n *\n * @param bool $force_db Optional. Force cleanup to run against the database even when an external object cache is used.\n */\nfunction delete_expired_transients( $force_db = false ) {\n\tglobal $wpdb;\n\n\tif ( ! $force_db && wp_using_ext_object_cache() ) {\n\t\treturn;\n\t}\n\n\t$wpdb->query(\n\t\t$wpdb->prepare(\n\t\t\t\"DELETE a, b FROM {$wpdb->options} a, {$wpdb->options} b\n\t\t\tWHERE a.option_name LIKE %s\n\t\t\tAND a.option_name NOT LIKE %s\n\t\t\tAND b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, 12 ) )\n\t\t\tAND b.option_value < %d\",\n\t\t\t$wpdb->esc_like( '_transient_' ) . '%',\n\t\t\t$wpdb->esc_like( '_transient_timeout_' ) . '%',\n\t\t\ttime()\n\t\t)\n\t);\n\n\tif ( ! is_multisite() ) {\n\t\t// Single site stores site transients in the options table.\n\t\t$wpdb->query(\n\t\t\t$wpdb->prepare(\n\t\t\t\t\"DELETE a, b FROM {$wpdb->options} a, {$wpdb->options} b\n\t\t\t\tWHERE a.option_name LIKE %s\n\t\t\t\tAND a.option_name NOT LIKE %s\n\t\t\t\tAND b.option_name = CONCAT( '_site_transient_timeout_', SUBSTRING( a.option_name, 17 ) )\n\t\t\t\tAND b.option_value < %d\",\n\t\t\t\t$wpdb->esc_like( '_site_transient_' ) . '%',\n\t\t\t\t$wpdb->esc_like( '_site_transient_timeout_' ) . '%',\n\t\t\t\ttime()\n\t\t\t)\n\t\t);\n\t} elseif ( is_multisite() && is_main_site() && is_main_network() ) {\n\t\t// Multisite stores site transients in the sitemeta table.\n\t\t$wpdb->query(\n\t\t\t$wpdb->prepare(\n\t\t\t\t\"DELETE a, b FROM {$wpdb->sitemeta} a, {$wpdb->sitemeta} b\n\t\t\t\tWHERE a.meta_key LIKE %s\n\t\t\t\tAND a.meta_key NOT LIKE %s\n\t\t\t\tAND b.meta_key = CONCAT( '_site_transient_timeout_', SUBSTRING( a.meta_key, 17 ) )\n\t\t\t\tAND b.meta_value < %d\",\n\t\t\t\t$wpdb->esc_like( '_site_transient_' ) . '%',\n\t\t\t\t$wpdb->esc_like( '_site_transient_timeout_' ) . '%',\n\t\t\t\ttime()\n\t\t\t)\n\t\t);\n\t}\n}\n\n/**\n * Saves and restores user interface settings stored in a cookie.\n *\n * Checks if the current user-settings cookie is updated and stores it. When no\n * cookie exists (different browser used), adds the last saved cookie restoring\n * the settings.\n *\n * @since 2.7.0\n */\nfunction wp_user_settings() {\n\n\tif ( ! is_admin() || wp_doing_ajax() ) {\n\t\treturn;\n\t}\n\n\t$user_id = get_current_user_id();\n\tif ( ! $user_id ) {\n\t\treturn;\n\t}\n\n\tif ( ! is_user_member_of_blog() ) {\n\t\treturn;\n\t}\n\n\t$settings = (string) get_user_option( 'user-settings', $user_id );\n\n\tif ( isset( $_COOKIE[ 'wp-settings-' . $user_id ] ) ) {\n\t\t$cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', $_COOKIE[ 'wp-settings-' . $user_id ] );\n\n\t\t// No change or both empty.\n\t\tif ( $cookie == $settings ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$last_saved = (int) get_user_option( 'user-settings-time', $user_id );\n\t\t$current    = isset( $_COOKIE[ 'wp-settings-time-' . $user_id ] ) ? preg_replace( '/[^0-9]/', '', $_COOKIE[ 'wp-settings-time-' . $user_id ] ) : 0;\n\n\t\t// The cookie is newer than the saved value. Update the user_option and leave the cookie as-is.\n\t\tif ( $current > $last_saved ) {\n\t\t\tupdate_user_option( $user_id, 'user-settings', $cookie, false );\n\t\t\tupdate_user_option( $user_id, 'user-settings-time', time() - 5, false );\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// The cookie is not set in the current browser or the saved value is newer.\n\t$secure = ( 'https' === parse_url( admin_url(), PHP_URL_SCHEME ) );\n\tsetcookie( 'wp-settings-' . $user_id, $settings, time() + YEAR_IN_SECONDS, SITECOOKIEPATH, null, $secure );\n\tsetcookie( 'wp-settings-time-' . $user_id, time(), time() + YEAR_IN_SECONDS, SITECOOKIEPATH, null, $secure );\n\t$_COOKIE[ 'wp-settings-' . $user_id ] = $settings;\n}\n\n/**\n * Retrieves user interface setting value based on setting name.\n *\n * @since 2.7.0\n *\n * @param string $name    The name of the setting.\n * @param string $default Optional default value to return when $name is not set.\n * @return mixed The last saved user setting or the default value/false if it doesn't exist.\n */\nfunction get_user_setting( $name, $default = false ) {\n\t$all_user_settings = get_all_user_settings();\n\n\treturn isset( $all_user_settings[ $name ] ) ? $all_user_settings[ $name ] : $default;\n}\n\n/**\n * Adds or updates user interface setting.\n *\n * Both $name and $value can contain only ASCII letters, numbers, hyphens, and underscores.\n *\n * This function has to be used before any output has started as it calls setcookie().\n *\n * @since 2.8.0\n *\n * @param string $name  The name of the setting.\n * @param string $value The value for the setting.\n * @return bool|null True if set successfully, false otherwise.\n *                   Null if the current user is not a member of the site.\n */\nfunction set_user_setting( $name, $value ) {\n\tif ( headers_sent() ) {\n\t\treturn false;\n\t}\n\n\t$all_user_settings          = get_all_user_settings();\n\t$all_user_settings[ $name ] = $value;\n\n\treturn wp_set_all_user_settings( $all_user_settings );\n}\n\n/**\n * Deletes user interface settings.\n *\n * Deleting settings would reset them to the defaults.\n *\n * This function has to be used before any output has started as it calls setcookie().\n *\n * @since 2.7.0\n *\n * @param string $names The name or array of names of the setting to be deleted.\n * @return bool|null True if deleted successfully, false otherwise.\n *                   Null if the current user is not a member of the site.\n */\nfunction delete_user_setting( $names ) {\n\tif ( headers_sent() ) {\n\t\treturn false;\n\t}\n\n\t$all_user_settings = get_all_user_settings();\n\t$names             = (array) $names;\n\t$deleted           = false;\n\n\tforeach ( $names as $name ) {\n\t\tif ( isset( $all_user_settings[ $name ] ) ) {\n\t\t\tunset( $all_user_settings[ $name ] );\n\t\t\t$deleted = true;\n\t\t}\n\t}\n\n\tif ( $deleted ) {\n\t\treturn wp_set_all_user_settings( $all_user_settings );\n\t}\n\n\treturn false;\n}\n\n/**\n * Retrieves all user interface settings.\n *\n * @since 2.7.0\n *\n * @global array $_updated_user_settings\n *\n * @return array The last saved user settings or empty array.\n */\nfunction get_all_user_settings() {\n\tglobal $_updated_user_settings;\n\n\t$user_id = get_current_user_id();\n\tif ( ! $user_id ) {\n\t\treturn array();\n\t}\n\n\tif ( isset( $_updated_user_settings ) && is_array( $_updated_user_settings ) ) {\n\t\treturn $_updated_user_settings;\n\t}\n\n\t$user_settings = array();\n\n\tif ( isset( $_COOKIE[ 'wp-settings-' . $user_id ] ) ) {\n\t\t$cookie = preg_replace( '/[^A-Za-z0-9=&_-]/', '', $_COOKIE[ 'wp-settings-' . $user_id ] );\n\n\t\tif ( strpos( $cookie, '=' ) ) { // '=' cannot be 1st char.\n\t\t\tparse_str( $cookie, $user_settings );\n\t\t}\n\t} else {\n\t\t$option = get_user_option( 'user-settings', $user_id );\n\n\t\tif ( $option && is_string( $option ) ) {\n\t\t\tparse_str( $option, $user_settings );\n\t\t}\n\t}\n\n\t$_updated_user_settings = $user_settings;\n\treturn $user_settings;\n}\n\n/**\n * Private. Sets all user interface settings.\n *\n * @since 2.8.0\n * @access private\n *\n * @global array $_updated_user_settings\n *\n * @param array $user_settings User settings.\n * @return bool|null True if set successfully, false if the current user could not be found.\n *                   Null if the current user is not a member of the site.\n */\nfunction wp_set_all_user_settings( $user_settings ) {\n\tglobal $_updated_user_settings;\n\n\t$user_id = get_current_user_id();\n\tif ( ! $user_id ) {\n\t\treturn false;\n\t}\n\n\tif ( ! is_user_member_of_blog() ) {\n\t\treturn;\n\t}\n\n\t$settings = '';\n\tforeach ( $user_settings as $name => $value ) {\n\t\t$_name  = preg_replace( '/[^A-Za-z0-9_-]+/', '', $name );\n\t\t$_value = preg_replace( '/[^A-Za-z0-9_-]+/', '', $value );\n\n\t\tif ( ! empty( $_name ) ) {\n\t\t\t$settings .= $_name . '=' . $_value . '&';\n\t\t}\n\t}\n\n\t$settings = rtrim( $settings, '&' );\n\tparse_str( $settings, $_updated_user_settings );\n\n\tupdate_user_option( $user_id, 'user-settings', $settings, false );\n\tupdate_user_option( $user_id, 'user-settings-time', time(), false );\n\n\treturn true;\n}\n\n/**\n * Deletes the user settings of the current user.\n *\n * @since 2.7.0\n */\nfunction delete_all_user_settings() {\n\t$user_id = get_current_user_id();\n\tif ( ! $user_id ) {\n\t\treturn;\n\t}\n\n\tupdate_user_option( $user_id, 'user-settings', '', false );\n\tsetcookie( 'wp-settings-' . $user_id, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH );\n}\n\n/**\n * Retrieve an option value for the current network based on name of option.\n *\n * @since 2.8.0\n * @since 4.4.0 The `$use_cache` parameter was deprecated.\n * @since 4.4.0 Modified into wrapper for get_network_option()\n *\n * @see get_network_option()\n *\n * @param string $option     Name of the option to retrieve. Expected to not be SQL-escaped.\n * @param mixed  $default    Optional. Value to return if the option doesn't exist. Default false.\n * @param bool   $deprecated Whether to use cache. Multisite only. Always set to true.\n * @return mixed Value set for the option.\n */\nfunction get_site_option( $option, $default = false, $deprecated = true ) {\n\treturn get_network_option( null, $option, $default );\n}\n\n/**\n * Adds a new option for the current network.\n *\n * Existing options will not be updated. Note that prior to 3.3 this wasn't the case.\n *\n * @since 2.8.0\n * @since 4.4.0 Modified into wrapper for add_network_option()\n *\n * @see add_network_option()\n *\n * @param string $option Name of the option to add. Expected to not be SQL-escaped.\n * @param mixed  $value  Option value, can be anything. Expected to not be SQL-escaped.\n * @return bool True if the option was added, false otherwise.\n */\nfunction add_site_option( $option, $value ) {\n\treturn add_network_option( null, $option, $value );\n}\n\n/**\n * Removes a option by name for the current network.\n *\n * @since 2.8.0\n * @since 4.4.0 Modified into wrapper for delete_network_option()\n *\n * @see delete_network_option()\n *\n * @param string $option Name of the option to delete. Expected to not be SQL-escaped.\n * @return bool True if the option was deleted, false otherwise.\n */\nfunction delete_site_option( $option ) {\n\treturn delete_network_option( null, $option );\n}\n\n/**\n * Updates the value of an option that was already added for the current network.\n *\n * @since 2.8.0\n * @since 4.4.0 Modified into wrapper for update_network_option()\n *\n * @see update_network_option()\n *\n * @param string $option Name of the option. Expected to not be SQL-escaped.\n * @param mixed  $value  Option value. Expected to not be SQL-escaped.\n * @return bool True if the value was updated, false otherwise.\n */\nfunction update_site_option( $option, $value ) {\n\treturn update_network_option( null, $option, $value );\n}\n\n/**\n * Retrieves a network's option value based on the option name.\n *\n * @since 4.4.0\n *\n * @see get_option()\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int    $network_id ID of the network. Can be null to default to the current network ID.\n * @param string $option     Name of the option to retrieve. Expected to not be SQL-escaped.\n * @param mixed  $default    Optional. Value to return if the option doesn't exist. Default false.\n * @return mixed Value set for the option.\n */\nfunction get_network_option( $network_id, $option, $default = false ) {\n\tglobal $wpdb;\n\n\tif ( $network_id && ! is_numeric( $network_id ) ) {\n\t\treturn false;\n\t}\n\n\t$network_id = (int) $network_id;\n\n\t// Fallback to the current network if a network ID is not specified.\n\tif ( ! $network_id ) {\n\t\t$network_id = get_current_network_id();\n\t}\n\n\t/**\n\t * Filters the value of an existing network option before it is retrieved.\n\t *\n\t * The dynamic portion of the hook name, `$option`, refers to the option name.\n\t *\n\t * Returning a truthy value from the filter will effectively short-circuit retrieval\n\t * and return the passed value instead.\n\t *\n\t * @since 2.9.0 As 'pre_site_option_' . $key\n\t * @since 3.0.0\n\t * @since 4.4.0 The `$option` parameter was added.\n\t * @since 4.7.0 The `$network_id` parameter was added.\n\t * @since 4.9.0 The `$default` parameter was added.\n\t *\n\t * @param mixed  $pre_option The value to return instead of the option value. This differs\n\t *                           from `$default`, which is used as the fallback value in the event\n\t *                           the option doesn't exist elsewhere in get_network_option().\n\t *                           Default false (to skip past the short-circuit).\n\t * @param string $option     Option name.\n\t * @param int    $network_id ID of the network.\n\t * @param mixed  $default    The fallback value to return if the option does not exist.\n\t *                           Default false.\n\t */\n\t$pre = apply_filters( \"pre_site_option_{$option}\", false, $option, $network_id, $default );\n\n\tif ( false !== $pre ) {\n\t\treturn $pre;\n\t}\n\n\t// Prevent non-existent options from triggering multiple queries.\n\t$notoptions_key = \"$network_id:notoptions\";\n\t$notoptions     = wp_cache_get( $notoptions_key, 'site-options' );\n\n\tif ( is_array( $notoptions ) && isset( $notoptions[ $option ] ) ) {\n\n\t\t/**\n\t\t * Filters a specific default network option.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$option`, refers to the option name.\n\t\t *\n\t\t * @since 3.4.0\n\t\t * @since 4.4.0 The `$option` parameter was added.\n\t\t * @since 4.7.0 The `$network_id` parameter was added.\n\t\t *\n\t\t * @param mixed  $default    The value to return if the site option does not exist\n\t\t *                           in the database.\n\t\t * @param string $option     Option name.\n\t\t * @param int    $network_id ID of the network.\n\t\t */\n\t\treturn apply_filters( \"default_site_option_{$option}\", $default, $option, $network_id );\n\t}\n\n\tif ( ! is_multisite() ) {\n\t\t/** This filter is documented in wp-includes/option.php */\n\t\t$default = apply_filters( 'default_site_option_' . $option, $default, $option, $network_id );\n\t\t$value   = get_option( $option, $default );\n\t} else {\n\t\t$cache_key = \"$network_id:$option\";\n\t\t$value     = wp_cache_get( $cache_key, 'site-options' );\n\n\t\tif ( ! isset( $value ) || false === $value ) {\n\t\t\t$row = $wpdb->get_row( $wpdb->prepare( \"SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = %s AND site_id = %d\", $option, $network_id ) );\n\n\t\t\t// Has to be get_row() instead of get_var() because of funkiness with 0, false, null values.\n\t\t\tif ( is_object( $row ) ) {\n\t\t\t\t$value = $row->meta_value;\n\t\t\t\t$value = maybe_unserialize( $value );\n\t\t\t\twp_cache_set( $cache_key, $value, 'site-options' );\n\t\t\t} else {\n\t\t\t\tif ( ! is_array( $notoptions ) ) {\n\t\t\t\t\t$notoptions = array();\n\t\t\t\t}\n\n\t\t\t\t$notoptions[ $option ] = true;\n\t\t\t\twp_cache_set( $notoptions_key, $notoptions, 'site-options' );\n\n\t\t\t\t/** This filter is documented in wp-includes/option.php */\n\t\t\t\t$value = apply_filters( 'default_site_option_' . $option, $default, $option, $network_id );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! is_array( $notoptions ) ) {\n\t\t$notoptions = array();\n\t\twp_cache_set( $notoptions_key, $notoptions, 'site-options' );\n\t}\n\n\t/**\n\t * Filters the value of an existing network option.\n\t *\n\t * The dynamic portion of the hook name, `$option`, refers to the option name.\n\t *\n\t * @since 2.9.0 As 'site_option_' . $key\n\t * @since 3.0.0\n\t * @since 4.4.0 The `$option` parameter was added.\n\t * @since 4.7.0 The `$network_id` parameter was added.\n\t *\n\t * @param mixed  $value      Value of network option.\n\t * @param string $option     Option name.\n\t * @param int    $network_id ID of the network.\n\t */\n\treturn apply_filters( \"site_option_{$option}\", $value, $option, $network_id );\n}\n\n/**\n * Adds a new network option.\n *\n * Existing options will not be updated.\n *\n * @since 4.4.0\n *\n * @see add_option()\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int    $network_id ID of the network. Can be null to default to the current network ID.\n * @param string $option     Name of the option to add. Expected to not be SQL-escaped.\n * @param mixed  $value      Option value, can be anything. Expected to not be SQL-escaped.\n * @return bool True if the option was added, false otherwise.\n */\nfunction add_network_option( $network_id, $option, $value ) {\n\tglobal $wpdb;\n\n\tif ( $network_id && ! is_numeric( $network_id ) ) {\n\t\treturn false;\n\t}\n\n\t$network_id = (int) $network_id;\n\n\t// Fallback to the current network if a network ID is not specified.\n\tif ( ! $network_id ) {\n\t\t$network_id = get_current_network_id();\n\t}\n\n\twp_protect_special_option( $option );\n\n\t/**\n\t * Filters the value of a specific network option before it is added.\n\t *\n\t * The dynamic portion of the hook name, `$option`, refers to the option name.\n\t *\n\t * @since 2.9.0 As 'pre_add_site_option_' . $key\n\t * @since 3.0.0\n\t * @since 4.4.0 The `$option` parameter was added.\n\t * @since 4.7.0 The `$network_id` parameter was added.\n\t *\n\t * @param mixed  $value      Value of network option.\n\t * @param string $option     Option name.\n\t * @param int    $network_id ID of the network.\n\t */\n\t$value = apply_filters( \"pre_add_site_option_{$option}\", $value, $option, $network_id );\n\n\t$notoptions_key = \"$network_id:notoptions\";\n\n\tif ( ! is_multisite() ) {\n\t\t$result = add_option( $option, $value, '', 'no' );\n\t} else {\n\t\t$cache_key = \"$network_id:$option\";\n\n\t\t// Make sure the option doesn't already exist.\n\t\t// We can check the 'notoptions' cache before we ask for a DB query.\n\t\t$notoptions = wp_cache_get( $notoptions_key, 'site-options' );\n\n\t\tif ( ! is_array( $notoptions ) || ! isset( $notoptions[ $option ] ) ) {\n\t\t\tif ( false !== get_network_option( $network_id, $option, false ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$value = sanitize_option( $option, $value );\n\n\t\t$serialized_value = maybe_serialize( $value );\n\t\t$result           = $wpdb->insert(\n\t\t\t$wpdb->sitemeta,\n\t\t\tarray(\n\t\t\t\t'site_id'    => $network_id,\n\t\t\t\t'meta_key'   => $option,\n\t\t\t\t'meta_value' => $serialized_value,\n\t\t\t)\n\t\t);\n\n\t\tif ( ! $result ) {\n\t\t\treturn false;\n\t\t}\n\n\t\twp_cache_set( $cache_key, $value, 'site-options' );\n\n\t\t// This option exists now.\n\t\t$notoptions = wp_cache_get( $notoptions_key, 'site-options' ); // Yes, again... we need it to be fresh.\n\n\t\tif ( is_array( $notoptions ) && isset( $notoptions[ $option ] ) ) {\n\t\t\tunset( $notoptions[ $option ] );\n\t\t\twp_cache_set( $notoptions_key, $notoptions, 'site-options' );\n\t\t}\n\t}\n\n\tif ( $result ) {\n\n\t\t/**\n\t\t * Fires after a specific network option has been successfully added.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$option`, refers to the option name.\n\t\t *\n\t\t * @since 2.9.0 As \"add_site_option_{$key}\"\n\t\t * @since 3.0.0\n\t\t * @since 4.7.0 The `$network_id` parameter was added.\n\t\t *\n\t\t * @param string $option     Name of the network option.\n\t\t * @param mixed  $value      Value of the network option.\n\t\t * @param int    $network_id ID of the network.\n\t\t */\n\t\tdo_action( \"add_site_option_{$option}\", $option, $value, $network_id );\n\n\t\t/**\n\t\t * Fires after a network option has been successfully added.\n\t\t *\n\t\t * @since 3.0.0\n\t\t * @since 4.7.0 The `$network_id` parameter was added.\n\t\t *\n\t\t * @param string $option     Name of the network option.\n\t\t * @param mixed  $value      Value of the network option.\n\t\t * @param int    $network_id ID of the network.\n\t\t */\n\t\tdo_action( 'add_site_option', $option, $value, $network_id );\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Removes a network option by name.\n *\n * @since 4.4.0\n *\n * @see delete_option()\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int    $network_id ID of the network. Can be null to default to the current network ID.\n * @param string $option     Name of the option to delete. Expected to not be SQL-escaped.\n * @return bool True if the option was deleted, false otherwise.\n */\nfunction delete_network_option( $network_id, $option ) {\n\tglobal $wpdb;\n\n\tif ( $network_id && ! is_numeric( $network_id ) ) {\n\t\treturn false;\n\t}\n\n\t$network_id = (int) $network_id;\n\n\t// Fallback to the current network if a network ID is not specified.\n\tif ( ! $network_id ) {\n\t\t$network_id = get_current_network_id();\n\t}\n\n\t/**\n\t * Fires immediately before a specific network option is deleted.\n\t *\n\t * The dynamic portion of the hook name, `$option`, refers to the option name.\n\t *\n\t * @since 3.0.0\n\t * @since 4.4.0 The `$option` parameter was added.\n\t * @since 4.7.0 The `$network_id` parameter was added.\n\t *\n\t * @param string $option     Option name.\n\t * @param int    $network_id ID of the network.\n\t */\n\tdo_action( \"pre_delete_site_option_{$option}\", $option, $network_id );\n\n\tif ( ! is_multisite() ) {\n\t\t$result = delete_option( $option );\n\t} else {\n\t\t$row = $wpdb->get_row( $wpdb->prepare( \"SELECT meta_id FROM {$wpdb->sitemeta} WHERE meta_key = %s AND site_id = %d\", $option, $network_id ) );\n\t\tif ( is_null( $row ) || ! $row->meta_id ) {\n\t\t\treturn false;\n\t\t}\n\t\t$cache_key = \"$network_id:$option\";\n\t\twp_cache_delete( $cache_key, 'site-options' );\n\n\t\t$result = $wpdb->delete(\n\t\t\t$wpdb->sitemeta,\n\t\t\tarray(\n\t\t\t\t'meta_key' => $option,\n\t\t\t\t'site_id'  => $network_id,\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( $result ) {\n\n\t\t/**\n\t\t * Fires after a specific network option has been deleted.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$option`, refers to the option name.\n\t\t *\n\t\t * @since 2.9.0 As \"delete_site_option_{$key}\"\n\t\t * @since 3.0.0\n\t\t * @since 4.7.0 The `$network_id` parameter was added.\n\t\t *\n\t\t * @param string $option     Name of the network option.\n\t\t * @param int    $network_id ID of the network.\n\t\t */\n\t\tdo_action( \"delete_site_option_{$option}\", $option, $network_id );\n\n\t\t/**\n\t\t * Fires after a network option has been deleted.\n\t\t *\n\t\t * @since 3.0.0\n\t\t * @since 4.7.0 The `$network_id` parameter was added.\n\t\t *\n\t\t * @param string $option     Name of the network option.\n\t\t * @param int    $network_id ID of the network.\n\t\t */\n\t\tdo_action( 'delete_site_option', $option, $network_id );\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Updates the value of a network option that was already added.\n *\n * @since 4.4.0\n *\n * @see update_option()\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int    $network_id ID of the network. Can be null to default to the current network ID.\n * @param string $option     Name of the option. Expected to not be SQL-escaped.\n * @param mixed  $value      Option value. Expected to not be SQL-escaped.\n * @return bool True if the value was updated, false otherwise.\n */\nfunction update_network_option( $network_id, $option, $value ) {\n\tglobal $wpdb;\n\n\tif ( $network_id && ! is_numeric( $network_id ) ) {\n\t\treturn false;\n\t}\n\n\t$network_id = (int) $network_id;\n\n\t// Fallback to the current network if a network ID is not specified.\n\tif ( ! $network_id ) {\n\t\t$network_id = get_current_network_id();\n\t}\n\n\twp_protect_special_option( $option );\n\n\t$old_value = get_network_option( $network_id, $option, false );\n\n\t/**\n\t * Filters a specific network option before its value is updated.\n\t *\n\t * The dynamic portion of the hook name, `$option`, refers to the option name.\n\t *\n\t * @since 2.9.0 As 'pre_update_site_option_' . $key\n\t * @since 3.0.0\n\t * @since 4.4.0 The `$option` parameter was added.\n\t * @since 4.7.0 The `$network_id` parameter was added.\n\t *\n\t * @param mixed  $value      New value of the network option.\n\t * @param mixed  $old_value  Old value of the network option.\n\t * @param string $option     Option name.\n\t * @param int    $network_id ID of the network.\n\t */\n\t$value = apply_filters( \"pre_update_site_option_{$option}\", $value, $old_value, $option, $network_id );\n\n\t/*\n\t * If the new and old values are the same, no need to update.\n\t *\n\t * Unserialized values will be adequate in most cases. If the unserialized\n\t * data differs, the (maybe) serialized data is checked to avoid\n\t * unnecessary database calls for otherwise identical object instances.\n\t *\n\t * See https://core.trac.wordpress.org/ticket/44956\n\t */\n\tif ( $value === $old_value || maybe_serialize( $value ) === maybe_serialize( $old_value ) ) {\n\t\treturn false;\n\t}\n\n\tif ( false === $old_value ) {\n\t\treturn add_network_option( $network_id, $option, $value );\n\t}\n\n\t$notoptions_key = \"$network_id:notoptions\";\n\t$notoptions     = wp_cache_get( $notoptions_key, 'site-options' );\n\n\tif ( is_array( $notoptions ) && isset( $notoptions[ $option ] ) ) {\n\t\tunset( $notoptions[ $option ] );\n\t\twp_cache_set( $notoptions_key, $notoptions, 'site-options' );\n\t}\n\n\tif ( ! is_multisite() ) {\n\t\t$result = update_option( $option, $value, 'no' );\n\t} else {\n\t\t$value = sanitize_option( $option, $value );\n\n\t\t$serialized_value = maybe_serialize( $value );\n\t\t$result           = $wpdb->update(\n\t\t\t$wpdb->sitemeta,\n\t\t\tarray( 'meta_value' => $serialized_value ),\n\t\t\tarray(\n\t\t\t\t'site_id'  => $network_id,\n\t\t\t\t'meta_key' => $option,\n\t\t\t)\n\t\t);\n\n\t\tif ( $result ) {\n\t\t\t$cache_key = \"$network_id:$option\";\n\t\t\twp_cache_set( $cache_key, $value, 'site-options' );\n\t\t}\n\t}\n\n\tif ( $result ) {\n\n\t\t/**\n\t\t * Fires after the value of a specific network option has been successfully updated.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$option`, refers to the option name.\n\t\t *\n\t\t * @since 2.9.0 As \"update_site_option_{$key}\"\n\t\t * @since 3.0.0\n\t\t * @since 4.7.0 The `$network_id` parameter was added.\n\t\t *\n\t\t * @param string $option     Name of the network option.\n\t\t * @param mixed  $value      Current value of the network option.\n\t\t * @param mixed  $old_value  Old value of the network option.\n\t\t * @param int    $network_id ID of the network.\n\t\t */\n\t\tdo_action( \"update_site_option_{$option}\", $option, $value, $old_value, $network_id );\n\n\t\t/**\n\t\t * Fires after the value of a network option has been successfully updated.\n\t\t *\n\t\t * @since 3.0.0\n\t\t * @since 4.7.0 The `$network_id` parameter was added.\n\t\t *\n\t\t * @param string $option     Name of the network option.\n\t\t * @param mixed  $value      Current value of the network option.\n\t\t * @param mixed  $old_value  Old value of the network option.\n\t\t * @param int    $network_id ID of the network.\n\t\t */\n\t\tdo_action( 'update_site_option', $option, $value, $old_value, $network_id );\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Deletes a site transient.\n *\n * @since 2.9.0\n *\n * @param string $transient Transient name. Expected to not be SQL-escaped.\n * @return bool True if the transient was deleted, false otherwise.\n */\nfunction delete_site_transient( $transient ) {\n\n\t/**\n\t * Fires immediately before a specific site transient is deleted.\n\t *\n\t * The dynamic portion of the hook name, `$transient`, refers to the transient name.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $transient Transient name.\n\t */\n\tdo_action( \"delete_site_transient_{$transient}\", $transient );\n\n\tif ( wp_using_ext_object_cache() ) {\n\t\t$result = wp_cache_delete( $transient, 'site-transient' );\n\t} else {\n\t\t$option_timeout = '_site_transient_timeout_' . $transient;\n\t\t$option         = '_site_transient_' . $transient;\n\t\t$result         = delete_site_option( $option );\n\n\t\tif ( $result ) {\n\t\t\tdelete_site_option( $option_timeout );\n\t\t}\n\t}\n\n\tif ( $result ) {\n\n\t\t/**\n\t\t * Fires after a transient is deleted.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string $transient Deleted transient name.\n\t\t */\n\t\tdo_action( 'deleted_site_transient', $transient );\n\t}\n\n\treturn $result;\n}\n\n/**\n * Retrieves the value of a site transient.\n *\n * If the transient does not exist, does not have a value, or has expired,\n * then the return value will be false.\n *\n * @since 2.9.0\n *\n * @see get_transient()\n *\n * @param string $transient Transient name. Expected to not be SQL-escaped.\n * @return mixed Value of transient.\n */\nfunction get_site_transient( $transient ) {\n\n\t/**\n\t * Filters the value of an existing site transient before it is retrieved.\n\t *\n\t * The dynamic portion of the hook name, `$transient`, refers to the transient name.\n\t *\n\t * Returning a truthy value from the filter will effectively short-circuit retrieval\n\t * and return the passed value instead.\n\t *\n\t * @since 2.9.0\n\t * @since 4.4.0 The `$transient` parameter was added.\n\t *\n\t * @param mixed  $pre_site_transient The default value to return if the site transient does not exist.\n\t *                                   Any value other than false will short-circuit the retrieval\n\t *                                   of the transient, and return that value.\n\t * @param string $transient          Transient name.\n\t */\n\t$pre = apply_filters( \"pre_site_transient_{$transient}\", false, $transient );\n\n\tif ( false !== $pre ) {\n\t\treturn $pre;\n\t}\n\n\tif ( wp_using_ext_object_cache() ) {\n\t\t$value = wp_cache_get( $transient, 'site-transient' );\n\t} else {\n\t\t// Core transients that do not have a timeout. Listed here so querying timeouts can be avoided.\n\t\t$no_timeout       = array( 'update_core', 'update_plugins', 'update_themes' );\n\t\t$transient_option = '_site_transient_' . $transient;\n\t\tif ( ! in_array( $transient, $no_timeout, true ) ) {\n\t\t\t$transient_timeout = '_site_transient_timeout_' . $transient;\n\t\t\t$timeout           = get_site_option( $transient_timeout );\n\t\t\tif ( false !== $timeout && $timeout < time() ) {\n\t\t\t\tdelete_site_option( $transient_option );\n\t\t\t\tdelete_site_option( $transient_timeout );\n\t\t\t\t$value = false;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! isset( $value ) ) {\n\t\t\t$value = get_site_option( $transient_option );\n\t\t}\n\t}\n\n\t/**\n\t * Filters the value of an existing site transient.\n\t *\n\t * The dynamic portion of the hook name, `$transient`, refers to the transient name.\n\t *\n\t * @since 2.9.0\n\t * @since 4.4.0 The `$transient` parameter was added.\n\t *\n\t * @param mixed  $value     Value of site transient.\n\t * @param string $transient Transient name.\n\t */\n\treturn apply_filters( \"site_transient_{$transient}\", $value, $transient );\n}\n\n/**\n * Sets/updates the value of a site transient.\n *\n * You do not need to serialize values. If the value needs to be serialized,\n * then it will be serialized before it is set.\n *\n * @since 2.9.0\n *\n * @see set_transient()\n *\n * @param string $transient  Transient name. Expected to not be SQL-escaped. Must be\n *                           167 characters or fewer in length.\n * @param mixed  $value      Transient value. Expected to not be SQL-escaped.\n * @param int    $expiration Optional. Time until expiration in seconds. Default 0 (no expiration).\n * @return bool True if the value was set, false otherwise.\n */\nfunction set_site_transient( $transient, $value, $expiration = 0 ) {\n\n\t/**\n\t * Filters the value of a specific site transient before it is set.\n\t *\n\t * The dynamic portion of the hook name, `$transient`, refers to the transient name.\n\t *\n\t * @since 3.0.0\n\t * @since 4.4.0 The `$transient` parameter was added.\n\t *\n\t * @param mixed  $value     New value of site transient.\n\t * @param string $transient Transient name.\n\t */\n\t$value = apply_filters( \"pre_set_site_transient_{$transient}\", $value, $transient );\n\n\t$expiration = (int) $expiration;\n\n\t/**\n\t * Filters the expiration for a site transient before its value is set.\n\t *\n\t * The dynamic portion of the hook name, `$transient`, refers to the transient name.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param int    $expiration Time until expiration in seconds. Use 0 for no expiration.\n\t * @param mixed  $value      New value of site transient.\n\t * @param string $transient  Transient name.\n\t */\n\t$expiration = apply_filters( \"expiration_of_site_transient_{$transient}\", $expiration, $value, $transient );\n\n\tif ( wp_using_ext_object_cache() ) {\n\t\t$result = wp_cache_set( $transient, $value, 'site-transient', $expiration );\n\t} else {\n\t\t$transient_timeout = '_site_transient_timeout_' . $transient;\n\t\t$option            = '_site_transient_' . $transient;\n\n\t\tif ( false === get_site_option( $option ) ) {\n\t\t\tif ( $expiration ) {\n\t\t\t\tadd_site_option( $transient_timeout, time() + $expiration );\n\t\t\t}\n\t\t\t$result = add_site_option( $option, $value );\n\t\t} else {\n\t\t\tif ( $expiration ) {\n\t\t\t\tupdate_site_option( $transient_timeout, time() + $expiration );\n\t\t\t}\n\t\t\t$result = update_site_option( $option, $value );\n\t\t}\n\t}\n\n\tif ( $result ) {\n\n\t\t/**\n\t\t * Fires after the value for a specific site transient has been set.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$transient`, refers to the transient name.\n\t\t *\n\t\t * @since 3.0.0\n\t\t * @since 4.4.0 The `$transient` parameter was added\n\t\t *\n\t\t * @param mixed  $value      Site transient value.\n\t\t * @param int    $expiration Time until expiration in seconds.\n\t\t * @param string $transient  Transient name.\n\t\t */\n\t\tdo_action( \"set_site_transient_{$transient}\", $value, $expiration, $transient );\n\n\t\t/**\n\t\t * Fires after the value for a site transient has been set.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string $transient  The name of the site transient.\n\t\t * @param mixed  $value      Site transient value.\n\t\t * @param int    $expiration Time until expiration in seconds.\n\t\t */\n\t\tdo_action( 'setted_site_transient', $transient, $value, $expiration );\n\t}\n\n\treturn $result;\n}\n\n/**\n * Registers default settings available in WordPress.\n *\n * The settings registered here are primarily useful for the REST API, so this\n * does not encompass all settings available in WordPress.\n *\n * @since 4.7.0\n */\nfunction register_initial_settings() {\n\tregister_setting(\n\t\t'general',\n\t\t'blogname',\n\t\tarray(\n\t\t\t'show_in_rest' => array(\n\t\t\t\t'name' => 'title',\n\t\t\t),\n\t\t\t'type'         => 'string',\n\t\t\t'description'  => __( 'Site title.' ),\n\t\t)\n\t);\n\n\tregister_setting(\n\t\t'general',\n\t\t'blogdescription',\n\t\tarray(\n\t\t\t'show_in_rest' => array(\n\t\t\t\t'name' => 'description',\n\t\t\t),\n\t\t\t'type'         => 'string',\n\t\t\t'description'  => __( 'Site tagline.' ),\n\t\t)\n\t);\n\n\tif ( ! is_multisite() ) {\n\t\tregister_setting(\n\t\t\t'general',\n\t\t\t'siteurl',\n\t\t\tarray(\n\t\t\t\t'show_in_rest' => array(\n\t\t\t\t\t'name'   => 'url',\n\t\t\t\t\t'schema' => array(\n\t\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'type'         => 'string',\n\t\t\t\t'description'  => __( 'Site URL.' ),\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( ! is_multisite() ) {\n\t\tregister_setting(\n\t\t\t'general',\n\t\t\t'admin_email',\n\t\t\tarray(\n\t\t\t\t'show_in_rest' => array(\n\t\t\t\t\t'name'   => 'email',\n\t\t\t\t\t'schema' => array(\n\t\t\t\t\t\t'format' => 'email',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'type'         => 'string',\n\t\t\t\t'description'  => __( 'This address is used for admin purposes, like new user notification.' ),\n\t\t\t)\n\t\t);\n\t}\n\n\tregister_setting(\n\t\t'general',\n\t\t'timezone_string',\n\t\tarray(\n\t\t\t'show_in_rest' => array(\n\t\t\t\t'name' => 'timezone',\n\t\t\t),\n\t\t\t'type'         => 'string',\n\t\t\t'description'  => __( 'A city in the same timezone as you.' ),\n\t\t)\n\t);\n\n\tregister_setting(\n\t\t'general',\n\t\t'date_format',\n\t\tarray(\n\t\t\t'show_in_rest' => true,\n\t\t\t'type'         => 'string',\n\t\t\t'description'  => __( 'A date format for all date strings.' ),\n\t\t)\n\t);\n\n\tregister_setting(\n\t\t'general',\n\t\t'time_format',\n\t\tarray(\n\t\t\t'show_in_rest' => true,\n\t\t\t'type'         => 'string',\n\t\t\t'description'  => __( 'A time format for all time strings.' ),\n\t\t)\n\t);\n\n\tregister_setting(\n\t\t'general',\n\t\t'start_of_week',\n\t\tarray(\n\t\t\t'show_in_rest' => true,\n\t\t\t'type'         => 'integer',\n\t\t\t'description'  => __( 'A day number of the week that the week should start on.' ),\n\t\t)\n\t);\n\n\tregister_setting(\n\t\t'general',\n\t\t'WPLANG',\n\t\tarray(\n\t\t\t'show_in_rest' => array(\n\t\t\t\t'name' => 'language',\n\t\t\t),\n\t\t\t'type'         => 'string',\n\t\t\t'description'  => __( 'WordPress locale code.' ),\n\t\t\t'default'      => 'en_US',\n\t\t)\n\t);\n\n\tregister_setting(\n\t\t'writing',\n\t\t'use_smilies',\n\t\tarray(\n\t\t\t'show_in_rest' => true,\n\t\t\t'type'         => 'boolean',\n\t\t\t'description'  => __( 'Convert emoticons like :-) and :-P to graphics on display.' ),\n\t\t\t'default'      => true,\n\t\t)\n\t);\n\n\tregister_setting(\n\t\t'writing',\n\t\t'default_category',\n\t\tarray(\n\t\t\t'show_in_rest' => true,\n\t\t\t'type'         => 'integer',\n\t\t\t'description'  => __( 'Default post category.' ),\n\t\t)\n\t);\n\n\tregister_setting(\n\t\t'writing',\n\t\t'default_post_format',\n\t\tarray(\n\t\t\t'show_in_rest' => true,\n\t\t\t'type'         => 'string',\n\t\t\t'description'  => __( 'Default post format.' ),\n\t\t)\n\t);\n\n\tregister_setting(\n\t\t'reading',\n\t\t'posts_per_page',\n\t\tarray(\n\t\t\t'show_in_rest' => true,\n\t\t\t'type'         => 'integer',\n\t\t\t'description'  => __( 'Blog pages show at most.' ),\n\t\t\t'default'      => 10,\n\t\t)\n\t);\n\n\tregister_setting(\n\t\t'discussion',\n\t\t'default_ping_status',\n\t\tarray(\n\t\t\t'show_in_rest' => array(\n\t\t\t\t'schema' => array(\n\t\t\t\t\t'enum' => array( 'open', 'closed' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'type'         => 'string',\n\t\t\t'description'  => __( 'Allow link notifications from other blogs (pingbacks and trackbacks) on new articles.' ),\n\t\t)\n\t);\n\n\tregister_setting(\n\t\t'discussion',\n\t\t'default_comment_status',\n\t\tarray(\n\t\t\t'show_in_rest' => array(\n\t\t\t\t'schema' => array(\n\t\t\t\t\t'enum' => array( 'open', 'closed' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'type'         => 'string',\n\t\t\t'description'  => __( 'Allow people to submit comments on new posts.' ),\n\t\t)\n\t);\n}\n\n/**\n * Registers a setting and its data.\n *\n * @since 2.7.0\n * @since 4.7.0 `$args` can be passed to set flags on the setting, similar to `register_meta()`.\n * @since 5.5.0 `$new_whitelist_options` was renamed to `$new_allowed_options`.\n *              Please consider writing more inclusive code.\n *\n * @global array $new_allowed_options\n * @global array $wp_registered_settings\n *\n * @param string $option_group A settings group name. Should correspond to an allowed option key name.\n *                             Default allowed option key names include 'general', 'discussion', 'media',\n *                             'reading', 'writing', 'misc', 'options', and 'privacy'.\n * @param string $option_name The name of an option to sanitize and save.\n * @param array  $args {\n *     Data used to describe the setting when registered.\n *\n *     @type string     $type              The type of data associated with this setting.\n *                                         Valid values are 'string', 'boolean', 'integer', 'number', 'array', and 'object'.\n *     @type string     $description       A description of the data attached to this setting.\n *     @type callable   $sanitize_callback A callback function that sanitizes the option's value.\n *     @type bool|array $show_in_rest      Whether data associated with this setting should be included in the REST API.\n *                                         When registering complex settings, this argument may optionally be an\n *                                         array with a 'schema' key.\n *     @type mixed      $default           Default value when calling `get_option()`.\n * }\n */\nfunction register_setting( $option_group, $option_name, $args = array() ) {\n\tglobal $new_allowed_options, $wp_registered_settings;\n\n\t/*\n\t * In 5.5.0, the `$new_whitelist_options` global variable was renamed to `$new_allowed_options`.\n\t * Please consider writing more inclusive code.\n\t */\n\t$GLOBALS['new_whitelist_options'] = &$new_allowed_options;\n\n\t$defaults = array(\n\t\t'type'              => 'string',\n\t\t'group'             => $option_group,\n\t\t'description'       => '',\n\t\t'sanitize_callback' => null,\n\t\t'show_in_rest'      => false,\n\t);\n\n\t// Back-compat: old sanitize callback is added.\n\tif ( is_callable( $args ) ) {\n\t\t$args = array(\n\t\t\t'sanitize_callback' => $args,\n\t\t);\n\t}\n\n\t/**\n\t * Filters the registration arguments when registering a setting.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array  $args         Array of setting registration arguments.\n\t * @param array  $defaults     Array of default arguments.\n\t * @param string $option_group Setting group.\n\t * @param string $option_name  Setting name.\n\t */\n\t$args = apply_filters( 'register_setting_args', $args, $defaults, $option_group, $option_name );\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\t// Require an item schema when registering settings with an array type.\n\tif ( false !== $args['show_in_rest'] && 'array' === $args['type'] && ( ! is_array( $args['show_in_rest'] ) || ! isset( $args['show_in_rest']['schema']['items'] ) ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'When registering an \"array\" setting to show in the REST API, you must specify the schema for each array item in \"show_in_rest.schema.items\".' ), '5.4.0' );\n\t}\n\n\tif ( ! is_array( $wp_registered_settings ) ) {\n\t\t$wp_registered_settings = array();\n\t}\n\n\tif ( 'misc' === $option_group ) {\n\t\t_deprecated_argument(\n\t\t\t__FUNCTION__,\n\t\t\t'3.0.0',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: misc */\n\t\t\t\t__( 'The \"%s\" options group has been removed. Use another settings group.' ),\n\t\t\t\t'misc'\n\t\t\t)\n\t\t);\n\t\t$option_group = 'general';\n\t}\n\n\tif ( 'privacy' === $option_group ) {\n\t\t_deprecated_argument(\n\t\t\t__FUNCTION__,\n\t\t\t'3.5.0',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: privacy */\n\t\t\t\t__( 'The \"%s\" options group has been removed. Use another settings group.' ),\n\t\t\t\t'privacy'\n\t\t\t)\n\t\t);\n\t\t$option_group = 'reading';\n\t}\n\n\t$new_allowed_options[ $option_group ][] = $option_name;\n\n\tif ( ! empty( $args['sanitize_callback'] ) ) {\n\t\tadd_filter( \"sanitize_option_{$option_name}\", $args['sanitize_callback'] );\n\t}\n\tif ( array_key_exists( 'default', $args ) ) {\n\t\tadd_filter( \"default_option_{$option_name}\", 'filter_default_option', 10, 3 );\n\t}\n\n\t/**\n\t * Fires immediately before the setting is registered but after its filters are in place.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $option_group Setting group.\n\t * @param string $option_name  Setting name.\n\t * @param array  $args         Array of setting registration arguments.\n\t */\n\tdo_action( 'register_setting', $option_group, $option_name, $args );\n\n\t$wp_registered_settings[ $option_name ] = $args;\n}\n\n/**\n * Unregisters a setting.\n *\n * @since 2.7.0\n * @since 4.7.0 `$sanitize_callback` was deprecated. The callback from `register_setting()` is now used instead.\n * @since 5.5.0 `$new_whitelist_options` was renamed to `$new_allowed_options`.\n *              Please consider writing more inclusive code.\n *\n * @global array $new_allowed_options\n * @global array $wp_registered_settings\n *\n * @param string   $option_group The settings group name used during registration.\n * @param string   $option_name  The name of the option to unregister.\n * @param callable $deprecated   Deprecated.\n */\nfunction unregister_setting( $option_group, $option_name, $deprecated = '' ) {\n\tglobal $new_allowed_options, $wp_registered_settings;\n\n\t/*\n\t * In 5.5.0, the `$new_whitelist_options` global variable was renamed to `$new_allowed_options`.\n\t * Please consider writing more inclusive code.\n\t */\n\t$GLOBALS['new_whitelist_options'] = &$new_allowed_options;\n\n\tif ( 'misc' === $option_group ) {\n\t\t_deprecated_argument(\n\t\t\t__FUNCTION__,\n\t\t\t'3.0.0',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: misc */\n\t\t\t\t__( 'The \"%s\" options group has been removed. Use another settings group.' ),\n\t\t\t\t'misc'\n\t\t\t)\n\t\t);\n\t\t$option_group = 'general';\n\t}\n\n\tif ( 'privacy' === $option_group ) {\n\t\t_deprecated_argument(\n\t\t\t__FUNCTION__,\n\t\t\t'3.5.0',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: privacy */\n\t\t\t\t__( 'The \"%s\" options group has been removed. Use another settings group.' ),\n\t\t\t\t'privacy'\n\t\t\t)\n\t\t);\n\t\t$option_group = 'reading';\n\t}\n\n\t$pos = array_search( $option_name, (array) $new_allowed_options[ $option_group ], true );\n\n\tif ( false !== $pos ) {\n\t\tunset( $new_allowed_options[ $option_group ][ $pos ] );\n\t}\n\n\tif ( '' !== $deprecated ) {\n\t\t_deprecated_argument(\n\t\t\t__FUNCTION__,\n\t\t\t'4.7.0',\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: $sanitize_callback, 2: register_setting() */\n\t\t\t\t__( '%1$s is deprecated. The callback from %2$s is used instead.' ),\n\t\t\t\t'<code>$sanitize_callback</code>',\n\t\t\t\t'<code>register_setting()</code>'\n\t\t\t)\n\t\t);\n\t\tremove_filter( \"sanitize_option_{$option_name}\", $deprecated );\n\t}\n\n\tif ( isset( $wp_registered_settings[ $option_name ] ) ) {\n\t\t// Remove the sanitize callback if one was set during registration.\n\t\tif ( ! empty( $wp_registered_settings[ $option_name ]['sanitize_callback'] ) ) {\n\t\t\tremove_filter( \"sanitize_option_{$option_name}\", $wp_registered_settings[ $option_name ]['sanitize_callback'] );\n\t\t}\n\n\t\t// Remove the default filter if a default was provided during registration.\n\t\tif ( array_key_exists( 'default', $wp_registered_settings[ $option_name ] ) ) {\n\t\t\tremove_filter( \"default_option_{$option_name}\", 'filter_default_option', 10 );\n\t\t}\n\n\t\t/**\n\t\t * Fires immediately before the setting is unregistered and after its filters have been removed.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param string $option_group Setting group.\n\t\t * @param string $option_name  Setting name.\n\t\t */\n\t\tdo_action( 'unregister_setting', $option_group, $option_name );\n\n\t\tunset( $wp_registered_settings[ $option_name ] );\n\t}\n}\n\n/**\n * Retrieves an array of registered settings.\n *\n * @since 4.7.0\n *\n * @global array $wp_registered_settings\n *\n * @return array List of registered settings, keyed by option name.\n */\nfunction get_registered_settings() {\n\tglobal $wp_registered_settings;\n\n\tif ( ! is_array( $wp_registered_settings ) ) {\n\t\treturn array();\n\t}\n\n\treturn $wp_registered_settings;\n}\n\n/**\n * Filters the default value for the option.\n *\n * For settings which register a default setting in `register_setting()`, this\n * function is added as a filter to `default_option_{$option}`.\n *\n * @since 4.7.0\n *\n * @param mixed  $default        Existing default value to return.\n * @param string $option         Option name.\n * @param bool   $passed_default Was `get_option()` passed a default value?\n * @return mixed Filtered default value.\n */\nfunction filter_default_option( $default, $option, $passed_default ) {\n\tif ( $passed_default ) {\n\t\treturn $default;\n\t}\n\n\t$registered = get_registered_settings();\n\tif ( empty( $registered[ $option ] ) ) {\n\t\treturn $default;\n\t}\n\n\treturn $registered[ $option ]['default'];\n}\n", "num_lines": 2453}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Deprecated pluggable functions from past WordPress versions. You shouldn't use these\n * functions and look for the alternatives instead. The functions will be removed in a\n * later version.\n *\n * Deprecated warnings are also thrown if one of these functions is being defined by a plugin.\n *\n * @package WordPress\n * @subpackage Deprecated\n * @see pluggable.php\n */\n\n/*\n * Deprecated functions come here to die.\n */\n\nif ( !function_exists('set_current_user') ) :\n/**\n * Changes the current user by ID or name.\n *\n * Set $id to null and specify a name if you do not know a user's ID.\n *\n * @since 2.0.1\n * @deprecated 3.0.0 Use wp_set_current_user()\n * @see wp_set_current_user()\n *\n * @param int|null $id User ID.\n * @param string $name Optional. The user's username\n * @return WP_User returns wp_set_current_user()\n */\nfunction set_current_user($id, $name = '') {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'wp_set_current_user()' );\n\treturn wp_set_current_user($id, $name);\n}\nendif;\n\nif ( !function_exists('get_currentuserinfo') ) :\n/**\n * Populate global variables with information about the currently logged in user.\n *\n * @since 0.71\n * @deprecated 4.5.0 Use wp_get_current_user()\n * @see wp_get_current_user()\n *\n * @return bool|WP_User False on XMLRPC Request and invalid auth cookie, WP_User instance otherwise.\n */\nfunction get_currentuserinfo() {\n\t_deprecated_function( __FUNCTION__, '4.5.0', 'wp_get_current_user()' );\n\n\treturn _wp_get_current_user();\n}\nendif;\n\nif ( !function_exists('get_userdatabylogin') ) :\n/**\n * Retrieve user info by login name.\n *\n * @since 0.71\n * @deprecated 3.3.0 Use get_user_by()\n * @see get_user_by()\n *\n * @param string $user_login User's username\n * @return bool|object False on failure, User DB row object\n */\nfunction get_userdatabylogin($user_login) {\n\t_deprecated_function( __FUNCTION__, '3.3.0', \"get_user_by('login')\" );\n\treturn get_user_by('login', $user_login);\n}\nendif;\n\nif ( !function_exists('get_user_by_email') ) :\n/**\n * Retrieve user info by email.\n *\n * @since 2.5.0\n * @deprecated 3.3.0 Use get_user_by()\n * @see get_user_by()\n *\n * @param string $email User's email address\n * @return bool|object False on failure, User DB row object\n */\nfunction get_user_by_email($email) {\n\t_deprecated_function( __FUNCTION__, '3.3.0', \"get_user_by('email')\" );\n\treturn get_user_by('email', $email);\n}\nendif;\n\nif ( !function_exists('wp_setcookie') ) :\n/**\n * Sets a cookie for a user who just logged in. This function is deprecated.\n *\n * @since 1.5.0\n * @deprecated 2.5.0 Use wp_set_auth_cookie()\n * @see wp_set_auth_cookie()\n *\n * @param string $username The user's username\n * @param string $password Optional. The user's password\n * @param bool $already_md5 Optional. Whether the password has already been through MD5\n * @param string $home Optional. Will be used instead of COOKIEPATH if set\n * @param string $siteurl Optional. Will be used instead of SITECOOKIEPATH if set\n * @param bool $remember Optional. Remember that the user is logged in\n */\nfunction wp_setcookie($username, $password = '', $already_md5 = false, $home = '', $siteurl = '', $remember = false) {\n\t_deprecated_function( __FUNCTION__, '2.5.0', 'wp_set_auth_cookie()' );\n\t$user = get_user_by('login', $username);\n\twp_set_auth_cookie($user->ID, $remember);\n}\nelse :\n\t_deprecated_function( 'wp_setcookie', '2.5.0', 'wp_set_auth_cookie()' );\nendif;\n\nif ( !function_exists('wp_clearcookie') ) :\n/**\n * Clears the authentication cookie, logging the user out. This function is deprecated.\n *\n * @since 1.5.0\n * @deprecated 2.5.0 Use wp_clear_auth_cookie()\n * @see wp_clear_auth_cookie()\n */\nfunction wp_clearcookie() {\n\t_deprecated_function( __FUNCTION__, '2.5.0', 'wp_clear_auth_cookie()' );\n\twp_clear_auth_cookie();\n}\nelse :\n\t_deprecated_function( 'wp_clearcookie', '2.5.0', 'wp_clear_auth_cookie()' );\nendif;\n\nif ( !function_exists('wp_get_cookie_login') ):\n/**\n * Gets the user cookie login. This function is deprecated.\n *\n * This function is deprecated and should no longer be extended as it won't be\n * used anywhere in WordPress. Also, plugins shouldn't use it either.\n *\n * @since 2.0.3\n * @deprecated 2.5.0\n *\n * @return bool Always returns false\n */\nfunction wp_get_cookie_login() {\n\t_deprecated_function( __FUNCTION__, '2.5.0' );\n\treturn false;\n}\nelse :\n\t_deprecated_function( 'wp_get_cookie_login', '2.5.0' );\nendif;\n\nif ( !function_exists('wp_login') ) :\n/**\n * Checks a users login information and logs them in if it checks out. This function is deprecated.\n *\n * Use the global $error to get the reason why the login failed. If the username\n * is blank, no error will be set, so assume blank username on that case.\n *\n * Plugins extending this function should also provide the global $error and set\n * what the error is, so that those checking the global for why there was a\n * failure can utilize it later.\n *\n * @since 1.2.2\n * @deprecated 2.5.0 Use wp_signon()\n * @see wp_signon()\n *\n * @global string $error Error when false is returned\n *\n * @param string $username   User's username\n * @param string $password   User's password\n * @param string $deprecated Not used\n * @return bool True on successful check, false on login failure.\n */\nfunction wp_login($username, $password, $deprecated = '') {\n\t_deprecated_function( __FUNCTION__, '2.5.0', 'wp_signon()' );\n\tglobal $error;\n\n\t$user = wp_authenticate($username, $password);\n\n\tif ( ! is_wp_error($user) )\n\t\treturn true;\n\n\t$error = $user->get_error_message();\n\treturn false;\n}\nelse :\n\t_deprecated_function( 'wp_login', '2.5.0', 'wp_signon()' );\nendif;\n\n/**\n * WordPress AtomPub API implementation.\n *\n * Originally stored in wp-app.php, and later wp-includes/class-wp-atom-server.php.\n * It is kept here in case a plugin directly referred to the class.\n *\n * @since 2.2.0\n * @deprecated 3.5.0\n *\n * @link https://wordpress.org/plugins/atom-publishing-protocol/\n */\nif ( ! class_exists( 'wp_atom_server', false ) ) {\n\tclass wp_atom_server {\n\t\tpublic function __call( $name, $arguments ) {\n\t\t\t_deprecated_function( __CLASS__ . '::' . $name, '3.5.0', 'the Atom Publishing Protocol plugin' );\n\t\t}\n\n\t\tpublic static function __callStatic( $name, $arguments ) {\n\t\t\t_deprecated_function( __CLASS__ . '::' . $name, '3.5.0', 'the Atom Publishing Protocol plugin' );\n\t\t}\n\t}\n}\n", "num_lines": 209}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * These functions can be replaced via plugins. If plugins do not redefine these\n * functions, then these will be used instead.\n *\n * @package WordPress\n */\n\nif ( ! function_exists( 'wp_set_current_user' ) ) :\n\t/**\n\t * Changes the current user by ID or name.\n\t *\n\t * Set $id to null and specify a name if you do not know a user's ID.\n\t *\n\t * Some WordPress functionality is based on the current user and not based on\n\t * the signed in user. Therefore, it opens the ability to edit and perform\n\t * actions on users who aren't signed in.\n\t *\n\t * @since 2.0.3\n\t *\n\t * @global WP_User $current_user The current user object which holds the user data.\n\t *\n\t * @param int    $id   User ID\n\t * @param string $name User's username\n\t * @return WP_User Current user User object\n\t */\n\tfunction wp_set_current_user( $id, $name = '' ) {\n\t\tglobal $current_user;\n\n\t\t// If `$id` matches the current user, there is nothing to do.\n\t\tif ( isset( $current_user )\n\t\t&& ( $current_user instanceof WP_User )\n\t\t&& ( $id == $current_user->ID )\n\t\t&& ( null !== $id )\n\t\t) {\n\t\t\treturn $current_user;\n\t\t}\n\n\t\t$current_user = new WP_User( $id, $name );\n\n\t\tsetup_userdata( $current_user->ID );\n\n\t\t/**\n\t\t * Fires after the current user is set.\n\t\t *\n\t\t * @since 2.0.1\n\t\t */\n\t\tdo_action( 'set_current_user' );\n\n\t\treturn $current_user;\n\t}\nendif;\n\nif ( ! function_exists( 'wp_get_current_user' ) ) :\n\t/**\n\t * Retrieve the current user object.\n\t *\n\t * Will set the current user, if the current user is not set. The current user\n\t * will be set to the logged-in person. If no user is logged-in, then it will\n\t * set the current user to 0, which is invalid and won't have any permissions.\n\t *\n\t * @since 2.0.3\n\t *\n\t * @see _wp_get_current_user()\n\t * @global WP_User $current_user Checks if the current user is set.\n\t *\n\t * @return WP_User Current WP_User instance.\n\t */\n\tfunction wp_get_current_user() {\n\t\treturn _wp_get_current_user();\n\t}\nendif;\n\nif ( ! function_exists( 'get_userdata' ) ) :\n\t/**\n\t * Retrieve user info by user ID.\n\t *\n\t * @since 0.71\n\t *\n\t * @param int $user_id User ID\n\t * @return WP_User|false WP_User object on success, false on failure.\n\t */\n\tfunction get_userdata( $user_id ) {\n\t\treturn get_user_by( 'id', $user_id );\n\t}\nendif;\n\nif ( ! function_exists( 'get_user_by' ) ) :\n\t/**\n\t * Retrieve user info by a given field\n\t *\n\t * @since 2.8.0\n\t * @since 4.4.0 Added 'ID' as an alias of 'id' for the `$field` parameter.\n\t *\n\t * @param string     $field The field to retrieve the user with. id | ID | slug | email | login.\n\t * @param int|string $value A value for $field. A user ID, slug, email address, or login name.\n\t * @return WP_User|false WP_User object on success, false on failure.\n\t */\n\tfunction get_user_by( $field, $value ) {\n\t\t$userdata = WP_User::get_data_by( $field, $value );\n\n\t\tif ( ! $userdata ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$user = new WP_User;\n\t\t$user->init( $userdata );\n\n\t\treturn $user;\n\t}\nendif;\n\nif ( ! function_exists( 'cache_users' ) ) :\n\t/**\n\t * Retrieve info for user lists to prevent multiple queries by get_userdata()\n\t *\n\t * @since 3.0.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param array $user_ids User ID numbers list\n\t */\n\tfunction cache_users( $user_ids ) {\n\t\tglobal $wpdb;\n\n\t\t$clean = _get_non_cached_ids( $user_ids, 'users' );\n\n\t\tif ( empty( $clean ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$list = implode( ',', $clean );\n\n\t\t$users = $wpdb->get_results( \"SELECT * FROM $wpdb->users WHERE ID IN ($list)\" );\n\n\t\t$ids = array();\n\t\tforeach ( $users as $user ) {\n\t\t\tupdate_user_caches( $user );\n\t\t\t$ids[] = $user->ID;\n\t\t}\n\t\tupdate_meta_cache( 'user', $ids );\n\t}\nendif;\n\nif ( ! function_exists( 'wp_mail' ) ) :\n\t/**\n\t * Sends an email, similar to PHP's mail function.\n\t *\n\t * A true return value does not automatically mean that the user received the\n\t * email successfully. It just only means that the method used was able to\n\t * process the request without any errors.\n\t *\n\t * The default content type is `text/plain` which does not allow using HTML.\n\t * However, you can set the content type of the email by using the\n\t * {@see 'wp_mail_content_type'} filter.\n\t *\n\t * The default charset is based on the charset used on the blog. The charset can\n\t * be set using the {@see 'wp_mail_charset'} filter.\n\t *\n\t * @since 1.2.1\n\t *\n\t * @global PHPMailer\\PHPMailer\\PHPMailer $phpmailer\n\t *\n\t * @param string|array $to          Array or comma-separated list of email addresses to send message.\n\t * @param string       $subject     Email subject\n\t * @param string       $message     Message contents\n\t * @param string|array $headers     Optional. Additional headers.\n\t * @param string|array $attachments Optional. Files to attach.\n\t * @return bool Whether the email contents were sent successfully.\n\t */\n\tfunction wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) {\n\t\t// Compact the input, apply the filters, and extract them back out.\n\n\t\t/**\n\t\t * Filters the wp_mail() arguments.\n\t\t *\n\t\t * @since 2.2.0\n\t\t *\n\t\t * @param array $args A compacted array of wp_mail() arguments, including the \"to\" email,\n\t\t *                    subject, message, headers, and attachments values.\n\t\t */\n\t\t$atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) );\n\n\t\tif ( isset( $atts['to'] ) ) {\n\t\t\t$to = $atts['to'];\n\t\t}\n\n\t\tif ( ! is_array( $to ) ) {\n\t\t\t$to = explode( ',', $to );\n\t\t}\n\n\t\tif ( isset( $atts['subject'] ) ) {\n\t\t\t$subject = $atts['subject'];\n\t\t}\n\n\t\tif ( isset( $atts['message'] ) ) {\n\t\t\t$message = $atts['message'];\n\t\t}\n\n\t\tif ( isset( $atts['headers'] ) ) {\n\t\t\t$headers = $atts['headers'];\n\t\t}\n\n\t\tif ( isset( $atts['attachments'] ) ) {\n\t\t\t$attachments = $atts['attachments'];\n\t\t}\n\n\t\tif ( ! is_array( $attachments ) ) {\n\t\t\t$attachments = explode( \"\\n\", str_replace( \"\\r\\n\", \"\\n\", $attachments ) );\n\t\t}\n\t\tglobal $phpmailer;\n\n\t\t// (Re)create it, if it's gone missing.\n\t\tif ( ! ( $phpmailer instanceof PHPMailer\\PHPMailer\\PHPMailer ) ) {\n\t\t\trequire_once ABSPATH . WPINC . '/PHPMailer/PHPMailer.php';\n\t\t\trequire_once ABSPATH . WPINC . '/PHPMailer/SMTP.php';\n\t\t\trequire_once ABSPATH . WPINC . '/PHPMailer/Exception.php';\n\t\t\t$phpmailer = new PHPMailer\\PHPMailer\\PHPMailer( true );\n\n\t\t\t$phpmailer::$validator = static function ( $email ) {\n\t\t\t\treturn (bool) is_email( $email );\n\t\t\t};\n\t\t}\n\n\t\t// Headers.\n\t\t$cc       = array();\n\t\t$bcc      = array();\n\t\t$reply_to = array();\n\n\t\tif ( empty( $headers ) ) {\n\t\t\t$headers = array();\n\t\t} else {\n\t\t\tif ( ! is_array( $headers ) ) {\n\t\t\t\t// Explode the headers out, so this function can take\n\t\t\t\t// both string headers and an array of headers.\n\t\t\t\t$tempheaders = explode( \"\\n\", str_replace( \"\\r\\n\", \"\\n\", $headers ) );\n\t\t\t} else {\n\t\t\t\t$tempheaders = $headers;\n\t\t\t}\n\t\t\t$headers = array();\n\n\t\t\t// If it's actually got contents.\n\t\t\tif ( ! empty( $tempheaders ) ) {\n\t\t\t\t// Iterate through the raw headers.\n\t\t\t\tforeach ( (array) $tempheaders as $header ) {\n\t\t\t\t\tif ( strpos( $header, ':' ) === false ) {\n\t\t\t\t\t\tif ( false !== stripos( $header, 'boundary=' ) ) {\n\t\t\t\t\t\t\t$parts    = preg_split( '/boundary=/i', trim( $header ) );\n\t\t\t\t\t\t\t$boundary = trim( str_replace( array( \"'\", '\"' ), '', $parts[1] ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// Explode them out.\n\t\t\t\t\tlist( $name, $content ) = explode( ':', trim( $header ), 2 );\n\n\t\t\t\t\t// Cleanup crew.\n\t\t\t\t\t$name    = trim( $name );\n\t\t\t\t\t$content = trim( $content );\n\n\t\t\t\t\tswitch ( strtolower( $name ) ) {\n\t\t\t\t\t\t// Mainly for legacy -- process a \"From:\" header if it's there.\n\t\t\t\t\t\tcase 'from':\n\t\t\t\t\t\t\t$bracket_pos = strpos( $content, '<' );\n\t\t\t\t\t\t\tif ( false !== $bracket_pos ) {\n\t\t\t\t\t\t\t\t// Text before the bracketed email is the \"From\" name.\n\t\t\t\t\t\t\t\tif ( $bracket_pos > 0 ) {\n\t\t\t\t\t\t\t\t\t$from_name = substr( $content, 0, $bracket_pos - 1 );\n\t\t\t\t\t\t\t\t\t$from_name = str_replace( '\"', '', $from_name );\n\t\t\t\t\t\t\t\t\t$from_name = trim( $from_name );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$from_email = substr( $content, $bracket_pos + 1 );\n\t\t\t\t\t\t\t\t$from_email = str_replace( '>', '', $from_email );\n\t\t\t\t\t\t\t\t$from_email = trim( $from_email );\n\n\t\t\t\t\t\t\t\t// Avoid setting an empty $from_email.\n\t\t\t\t\t\t\t} elseif ( '' !== trim( $content ) ) {\n\t\t\t\t\t\t\t\t$from_email = trim( $content );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'content-type':\n\t\t\t\t\t\t\tif ( strpos( $content, ';' ) !== false ) {\n\t\t\t\t\t\t\t\tlist( $type, $charset_content ) = explode( ';', $content );\n\t\t\t\t\t\t\t\t$content_type                   = trim( $type );\n\t\t\t\t\t\t\t\tif ( false !== stripos( $charset_content, 'charset=' ) ) {\n\t\t\t\t\t\t\t\t\t$charset = trim( str_replace( array( 'charset=', '\"' ), '', $charset_content ) );\n\t\t\t\t\t\t\t\t} elseif ( false !== stripos( $charset_content, 'boundary=' ) ) {\n\t\t\t\t\t\t\t\t\t$boundary = trim( str_replace( array( 'BOUNDARY=', 'boundary=', '\"' ), '', $charset_content ) );\n\t\t\t\t\t\t\t\t\t$charset  = '';\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Avoid setting an empty $content_type.\n\t\t\t\t\t\t\t} elseif ( '' !== trim( $content ) ) {\n\t\t\t\t\t\t\t\t$content_type = trim( $content );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'cc':\n\t\t\t\t\t\t\t$cc = array_merge( (array) $cc, explode( ',', $content ) );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'bcc':\n\t\t\t\t\t\t\t$bcc = array_merge( (array) $bcc, explode( ',', $content ) );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'reply-to':\n\t\t\t\t\t\t\t$reply_to = array_merge( (array) $reply_to, explode( ',', $content ) );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t// Add it to our grand headers array.\n\t\t\t\t\t\t\t$headers[ trim( $name ) ] = trim( $content );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Empty out the values that may be set.\n\t\t$phpmailer->clearAllRecipients();\n\t\t$phpmailer->clearAttachments();\n\t\t$phpmailer->clearCustomHeaders();\n\t\t$phpmailer->clearReplyTos();\n\n\t\t// Set \"From\" name and email.\n\n\t\t// If we don't have a name from the input headers.\n\t\tif ( ! isset( $from_name ) ) {\n\t\t\t$from_name = 'WordPress';\n\t\t}\n\n\t\t/*\n\t\t * If we don't have an email from the input headers, default to wordpress@$sitename\n\t\t * Some hosts will block outgoing mail from this address if it doesn't exist,\n\t\t * but there's no easy alternative. Defaulting to admin_email might appear to be\n\t\t * another option, but some hosts may refuse to relay mail from an unknown domain.\n\t\t * See https://core.trac.wordpress.org/ticket/5007.\n\t\t */\n\t\tif ( ! isset( $from_email ) ) {\n\t\t\t// Get the site domain and get rid of www.\n\t\t\t$sitename = wp_parse_url( network_home_url(), PHP_URL_HOST );\n\t\t\tif ( 'www.' === substr( $sitename, 0, 4 ) ) {\n\t\t\t\t$sitename = substr( $sitename, 4 );\n\t\t\t}\n\n\t\t\t$from_email = 'wordpress@' . $sitename;\n\t\t}\n\n\t\t/**\n\t\t * Filters the email address to send from.\n\t\t *\n\t\t * @since 2.2.0\n\t\t *\n\t\t * @param string $from_email Email address to send from.\n\t\t */\n\t\t$from_email = apply_filters( 'wp_mail_from', $from_email );\n\n\t\t/**\n\t\t * Filters the name to associate with the \"from\" email address.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param string $from_name Name associated with the \"from\" email address.\n\t\t */\n\t\t$from_name = apply_filters( 'wp_mail_from_name', $from_name );\n\n\t\ttry {\n\t\t\t$phpmailer->setFrom( $from_email, $from_name, false );\n\t\t} catch ( PHPMailer\\PHPMailer\\Exception $e ) {\n\t\t\t$mail_error_data                             = compact( 'to', 'subject', 'message', 'headers', 'attachments' );\n\t\t\t$mail_error_data['phpmailer_exception_code'] = $e->getCode();\n\n\t\t\t/** This filter is documented in wp-includes/pluggable.php */\n\t\t\tdo_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_error_data ) );\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Set mail's subject and body.\n\t\t$phpmailer->Subject = $subject;\n\t\t$phpmailer->Body    = $message;\n\n\t\t// Set destination addresses, using appropriate methods for handling addresses.\n\t\t$address_headers = compact( 'to', 'cc', 'bcc', 'reply_to' );\n\n\t\tforeach ( $address_headers as $address_header => $addresses ) {\n\t\t\tif ( empty( $addresses ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ( (array) $addresses as $address ) {\n\t\t\t\ttry {\n\t\t\t\t\t// Break $recipient into name and address parts if in the format \"Foo <bar@baz.com>\".\n\t\t\t\t\t$recipient_name = '';\n\n\t\t\t\t\tif ( preg_match( '/(.*)<(.+)>/', $address, $matches ) ) {\n\t\t\t\t\t\tif ( count( $matches ) == 3 ) {\n\t\t\t\t\t\t\t$recipient_name = $matches[1];\n\t\t\t\t\t\t\t$address        = $matches[2];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch ( $address_header ) {\n\t\t\t\t\t\tcase 'to':\n\t\t\t\t\t\t\t$phpmailer->addAddress( $address, $recipient_name );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'cc':\n\t\t\t\t\t\t\t$phpmailer->addCc( $address, $recipient_name );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'bcc':\n\t\t\t\t\t\t\t$phpmailer->addBcc( $address, $recipient_name );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'reply_to':\n\t\t\t\t\t\t\t$phpmailer->addReplyTo( $address, $recipient_name );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch ( PHPMailer\\PHPMailer\\Exception $e ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Set to use PHP's mail().\n\t\t$phpmailer->isMail();\n\n\t\t// Set Content-Type and charset.\n\n\t\t// If we don't have a content-type from the input headers.\n\t\tif ( ! isset( $content_type ) ) {\n\t\t\t$content_type = 'text/plain';\n\t\t}\n\n\t\t/**\n\t\t * Filters the wp_mail() content type.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param string $content_type Default wp_mail() content type.\n\t\t */\n\t\t$content_type = apply_filters( 'wp_mail_content_type', $content_type );\n\n\t\t$phpmailer->ContentType = $content_type;\n\n\t\t// Set whether it's plaintext, depending on $content_type.\n\t\tif ( 'text/html' === $content_type ) {\n\t\t\t$phpmailer->isHTML( true );\n\t\t}\n\n\t\t// If we don't have a charset from the input headers.\n\t\tif ( ! isset( $charset ) ) {\n\t\t\t$charset = get_bloginfo( 'charset' );\n\t\t}\n\n\t\t/**\n\t\t * Filters the default wp_mail() charset.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param string $charset Default email charset.\n\t\t */\n\t\t$phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset );\n\n\t\t// Set custom headers.\n\t\tif ( ! empty( $headers ) ) {\n\t\t\tforeach ( (array) $headers as $name => $content ) {\n\t\t\t\t// Only add custom headers not added automatically by PHPMailer.\n\t\t\t\tif ( ! in_array( $name, array( 'MIME-Version', 'X-Mailer' ), true ) ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$phpmailer->addCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) );\n\t\t\t\t\t} catch ( PHPMailer\\PHPMailer\\Exception $e ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( false !== stripos( $content_type, 'multipart' ) && ! empty( $boundary ) ) {\n\t\t\t\t$phpmailer->addCustomHeader( sprintf( 'Content-Type: %s; boundary=\"%s\"', $content_type, $boundary ) );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $attachments ) ) {\n\t\t\tforeach ( $attachments as $attachment ) {\n\t\t\t\ttry {\n\t\t\t\t\t$phpmailer->addAttachment( $attachment );\n\t\t\t\t} catch ( PHPMailer\\PHPMailer\\Exception $e ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Fires after PHPMailer is initialized.\n\t\t *\n\t\t * @since 2.2.0\n\t\t *\n\t\t * @param PHPMailer $phpmailer The PHPMailer instance (passed by reference).\n\t\t */\n\t\tdo_action_ref_array( 'phpmailer_init', array( &$phpmailer ) );\n\n\t\t// Send!\n\t\ttry {\n\t\t\treturn $phpmailer->send();\n\t\t} catch ( PHPMailer\\PHPMailer\\Exception $e ) {\n\n\t\t\t$mail_error_data                             = compact( 'to', 'subject', 'message', 'headers', 'attachments' );\n\t\t\t$mail_error_data['phpmailer_exception_code'] = $e->getCode();\n\n\t\t\t/**\n\t\t\t * Fires after a PHPMailer\\PHPMailer\\Exception is caught.\n\t\t\t *\n\t\t\t * @since 4.4.0\n\t\t\t *\n\t\t\t * @param WP_Error $error A WP_Error object with the PHPMailer\\PHPMailer\\Exception message, and an array\n\t\t\t *                        containing the mail recipient, subject, message, headers, and attachments.\n\t\t\t */\n\t\t\tdo_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_error_data ) );\n\n\t\t\treturn false;\n\t\t}\n\t}\nendif;\n\nif ( ! function_exists( 'wp_authenticate' ) ) :\n\t/**\n\t * Authenticate a user, confirming the login credentials are valid.\n\t *\n\t * @since 2.5.0\n\t * @since 4.5.0 `$username` now accepts an email address.\n\t *\n\t * @param string $username User's username or email address.\n\t * @param string $password User's password.\n\t * @return WP_User|WP_Error WP_User object if the credentials are valid,\n\t *                          otherwise WP_Error.\n\t */\n\tfunction wp_authenticate( $username, $password ) {\n\t\t$username = sanitize_user( $username );\n\t\t$password = trim( $password );\n\n\t\t/**\n\t\t * Filters whether a set of user login credentials are valid.\n\t\t *\n\t\t * A WP_User object is returned if the credentials authenticate a user.\n\t\t * WP_Error or null otherwise.\n\t\t *\n\t\t * @since 2.8.0\n\t\t * @since 4.5.0 `$username` now accepts an email address.\n\t\t *\n\t\t * @param null|WP_User|WP_Error $user     WP_User if the user is authenticated.\n\t\t *                                        WP_Error or null otherwise.\n\t\t * @param string                $username Username or email address.\n\t\t * @param string                $password User password\n\t\t */\n\t\t$user = apply_filters( 'authenticate', null, $username, $password );\n\n\t\tif ( null == $user ) {\n\t\t\t// TODO: What should the error message be? (Or would these even happen?)\n\t\t\t// Only needed if all authentication handlers fail to return anything.\n\t\t\t$user = new WP_Error( 'authentication_failed', __( '<strong>Error</strong>: Invalid username, email address or incorrect password.' ) );\n\t\t}\n\n\t\t$ignore_codes = array( 'empty_username', 'empty_password' );\n\n\t\tif ( is_wp_error( $user ) && ! in_array( $user->get_error_code(), $ignore_codes, true ) ) {\n\t\t\t$error = $user;\n\n\t\t\t/**\n\t\t\t * Fires after a user login has failed.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t * @since 4.5.0 The value of `$username` can now be an email address.\n\t\t\t * @since 5.4.0 The `$error` parameter was added.\n\t\t\t *\n\t\t\t * @param string   $username Username or email address.\n\t\t\t * @param WP_Error $error    A WP_Error object with the authentication failure details.\n\t\t\t */\n\t\t\tdo_action( 'wp_login_failed', $username, $error );\n\t\t}\n\n\t\treturn $user;\n\t}\nendif;\n\nif ( ! function_exists( 'wp_logout' ) ) :\n\t/**\n\t * Log the current user out.\n\t *\n\t * @since 2.5.0\n\t */\n\tfunction wp_logout() {\n\t\t$user_id = get_current_user_id();\n\n\t\twp_destroy_current_session();\n\t\twp_clear_auth_cookie();\n\t\twp_set_current_user( 0 );\n\n\t\t/**\n\t\t * Fires after a user is logged out.\n\t\t *\n\t\t * @since 1.5.0\n\t\t * @since 5.5.0 Added the `$user_id` parameter.\n\t\t *\n\t\t * @param int $user_id ID of the user that was logged out.\n\t\t */\n\t\tdo_action( 'wp_logout', $user_id );\n\t}\nendif;\n\nif ( ! function_exists( 'wp_validate_auth_cookie' ) ) :\n\t/**\n\t * Validates authentication cookie.\n\t *\n\t * The checks include making sure that the authentication cookie is set and\n\t * pulling in the contents (if $cookie is not used).\n\t *\n\t * Makes sure the cookie is not expired. Verifies the hash in cookie is what is\n\t * should be and compares the two.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @global int $login_grace_period\n\t *\n\t * @param string $cookie Optional. If used, will validate contents instead of cookie's.\n\t * @param string $scheme Optional. The cookie scheme to use: 'auth', 'secure_auth', or 'logged_in'.\n\t * @return int|false User ID if valid cookie, false if invalid.\n\t */\n\tfunction wp_validate_auth_cookie( $cookie = '', $scheme = '' ) {\n\t\t$cookie_elements = wp_parse_auth_cookie( $cookie, $scheme );\n\t\tif ( ! $cookie_elements ) {\n\t\t\t/**\n\t\t\t * Fires if an authentication cookie is malformed.\n\t\t\t *\n\t\t\t * @since 2.7.0\n\t\t\t *\n\t\t\t * @param string $cookie Malformed auth cookie.\n\t\t\t * @param string $scheme Authentication scheme. Values include 'auth', 'secure_auth',\n\t\t\t *                       or 'logged_in'.\n\t\t\t */\n\t\t\tdo_action( 'auth_cookie_malformed', $cookie, $scheme );\n\t\t\treturn false;\n\t\t}\n\n\t\t$scheme     = $cookie_elements['scheme'];\n\t\t$username   = $cookie_elements['username'];\n\t\t$hmac       = $cookie_elements['hmac'];\n\t\t$token      = $cookie_elements['token'];\n\t\t$expired    = $cookie_elements['expiration'];\n\t\t$expiration = $cookie_elements['expiration'];\n\n\t\t// Allow a grace period for POST and Ajax requests.\n\t\tif ( wp_doing_ajax() || 'POST' === $_SERVER['REQUEST_METHOD'] ) {\n\t\t\t$expired += HOUR_IN_SECONDS;\n\t\t}\n\n\t\t// Quick check to see if an honest cookie has expired.\n\t\tif ( $expired < time() ) {\n\t\t\t/**\n\t\t\t * Fires once an authentication cookie has expired.\n\t\t\t *\n\t\t\t * @since 2.7.0\n\t\t\t *\n\t\t\t * @param string[] $cookie_elements An array of data for the authentication cookie.\n\t\t\t */\n\t\t\tdo_action( 'auth_cookie_expired', $cookie_elements );\n\t\t\treturn false;\n\t\t}\n\n\t\t$user = get_user_by( 'login', $username );\n\t\tif ( ! $user ) {\n\t\t\t/**\n\t\t\t * Fires if a bad username is entered in the user authentication process.\n\t\t\t *\n\t\t\t * @since 2.7.0\n\t\t\t *\n\t\t\t * @param string[] $cookie_elements An array of data for the authentication cookie.\n\t\t\t */\n\t\t\tdo_action( 'auth_cookie_bad_username', $cookie_elements );\n\t\t\treturn false;\n\t\t}\n\n\t\t$pass_frag = substr( $user->user_pass, 8, 4 );\n\n\t\t$key = wp_hash( $username . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme );\n\n\t\t// If ext/hash is not present, compat.php's hash_hmac() does not support sha256.\n\t\t$algo = function_exists( 'hash' ) ? 'sha256' : 'sha1';\n\t\t$hash = hash_hmac( $algo, $username . '|' . $expiration . '|' . $token, $key );\n\n\t\tif ( ! hash_equals( $hash, $hmac ) ) {\n\t\t\t/**\n\t\t\t * Fires if a bad authentication cookie hash is encountered.\n\t\t\t *\n\t\t\t * @since 2.7.0\n\t\t\t *\n\t\t\t * @param string[] $cookie_elements An array of data for the authentication cookie.\n\t\t\t */\n\t\t\tdo_action( 'auth_cookie_bad_hash', $cookie_elements );\n\t\t\treturn false;\n\t\t}\n\n\t\t$manager = WP_Session_Tokens::get_instance( $user->ID );\n\t\tif ( ! $manager->verify( $token ) ) {\n\t\t\t/**\n\t\t\t * Fires if a bad session token is encountered.\n\t\t\t *\n\t\t\t * @since 4.0.0\n\t\t\t *\n\t\t\t * @param string[] $cookie_elements An array of data for the authentication cookie.\n\t\t\t */\n\t\t\tdo_action( 'auth_cookie_bad_session_token', $cookie_elements );\n\t\t\treturn false;\n\t\t}\n\n\t\t// Ajax/POST grace period set above.\n\t\tif ( $expiration < time() ) {\n\t\t\t$GLOBALS['login_grace_period'] = 1;\n\t\t}\n\n\t\t/**\n\t\t * Fires once an authentication cookie has been validated.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param string[] $cookie_elements An array of data for the authentication cookie.\n\t\t * @param WP_User  $user            User object.\n\t\t */\n\t\tdo_action( 'auth_cookie_valid', $cookie_elements, $user );\n\n\t\treturn $user->ID;\n\t}\nendif;\n\nif ( ! function_exists( 'wp_generate_auth_cookie' ) ) :\n\t/**\n\t * Generates authentication cookie contents.\n\t *\n\t * @since 2.5.0\n\t * @since 4.0.0 The `$token` parameter was added.\n\t *\n\t * @param int    $user_id    User ID.\n\t * @param int    $expiration The time the cookie expires as a UNIX timestamp.\n\t * @param string $scheme     Optional. The cookie scheme to use: 'auth', 'secure_auth', or 'logged_in'.\n\t *                           Default 'auth'.\n\t * @param string $token      User's session token to use for this cookie.\n\t * @return string Authentication cookie contents. Empty string if user does not exist.\n\t */\n\tfunction wp_generate_auth_cookie( $user_id, $expiration, $scheme = 'auth', $token = '' ) {\n\t\t$user = get_userdata( $user_id );\n\t\tif ( ! $user ) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif ( ! $token ) {\n\t\t\t$manager = WP_Session_Tokens::get_instance( $user_id );\n\t\t\t$token   = $manager->create( $expiration );\n\t\t}\n\n\t\t$pass_frag = substr( $user->user_pass, 8, 4 );\n\n\t\t$key = wp_hash( $user->user_login . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme );\n\n\t\t// If ext/hash is not present, compat.php's hash_hmac() does not support sha256.\n\t\t$algo = function_exists( 'hash' ) ? 'sha256' : 'sha1';\n\t\t$hash = hash_hmac( $algo, $user->user_login . '|' . $expiration . '|' . $token, $key );\n\n\t\t$cookie = $user->user_login . '|' . $expiration . '|' . $token . '|' . $hash;\n\n\t\t/**\n\t\t * Filters the authentication cookie.\n\t\t *\n\t\t * @since 2.5.0\n\t\t * @since 4.0.0 The `$token` parameter was added.\n\t\t *\n\t\t * @param string $cookie     Authentication cookie.\n\t\t * @param int    $user_id    User ID.\n\t\t * @param int    $expiration The time the cookie expires as a UNIX timestamp.\n\t\t * @param string $scheme     Cookie scheme used. Accepts 'auth', 'secure_auth', or 'logged_in'.\n\t\t * @param string $token      User's session token used.\n\t\t */\n\t\treturn apply_filters( 'auth_cookie', $cookie, $user_id, $expiration, $scheme, $token );\n\t}\nendif;\n\nif ( ! function_exists( 'wp_parse_auth_cookie' ) ) :\n\t/**\n\t * Parses a cookie into its components.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $cookie Authentication cookie.\n\t * @param string $scheme Optional. The cookie scheme to use: 'auth', 'secure_auth', or 'logged_in'.\n\t * @return string[]|false Authentication cookie components.\n\t */\n\tfunction wp_parse_auth_cookie( $cookie = '', $scheme = '' ) {\n\t\tif ( empty( $cookie ) ) {\n\t\t\tswitch ( $scheme ) {\n\t\t\t\tcase 'auth':\n\t\t\t\t\t$cookie_name = AUTH_COOKIE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'secure_auth':\n\t\t\t\t\t$cookie_name = SECURE_AUTH_COOKIE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'logged_in':\n\t\t\t\t\t$cookie_name = LOGGED_IN_COOKIE;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif ( is_ssl() ) {\n\t\t\t\t\t\t$cookie_name = SECURE_AUTH_COOKIE;\n\t\t\t\t\t\t$scheme      = 'secure_auth';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$cookie_name = AUTH_COOKIE;\n\t\t\t\t\t\t$scheme      = 'auth';\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( empty( $_COOKIE[ $cookie_name ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$cookie = $_COOKIE[ $cookie_name ];\n\t\t}\n\n\t\t$cookie_elements = explode( '|', $cookie );\n\t\tif ( count( $cookie_elements ) !== 4 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlist( $username, $expiration, $token, $hmac ) = $cookie_elements;\n\n\t\treturn compact( 'username', 'expiration', 'token', 'hmac', 'scheme' );\n\t}\nendif;\n\nif ( ! function_exists( 'wp_set_auth_cookie' ) ) :\n\t/**\n\t * Sets the authentication cookies based on user ID.\n\t *\n\t * The $remember parameter increases the time that the cookie will be kept. The\n\t * default the cookie is kept without remembering is two days. When $remember is\n\t * set, the cookies will be kept for 14 days or two weeks.\n\t *\n\t * @since 2.5.0\n\t * @since 4.3.0 Added the `$token` parameter.\n\t *\n\t * @param int         $user_id  User ID.\n\t * @param bool        $remember Whether to remember the user.\n\t * @param bool|string $secure   Whether the auth cookie should only be sent over HTTPS. Default is an empty\n\t *                              string which means the value of `is_ssl()` will be used.\n\t * @param string      $token    Optional. User's session token to use for this cookie.\n\t */\n\tfunction wp_set_auth_cookie( $user_id, $remember = false, $secure = '', $token = '' ) {\n\t\tif ( $remember ) {\n\t\t\t/**\n\t\t\t * Filters the duration of the authentication cookie expiration period.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t *\n\t\t\t * @param int  $length   Duration of the expiration period in seconds.\n\t\t\t * @param int  $user_id  User ID.\n\t\t\t * @param bool $remember Whether to remember the user login. Default false.\n\t\t\t */\n\t\t\t$expiration = time() + apply_filters( 'auth_cookie_expiration', 14 * DAY_IN_SECONDS, $user_id, $remember );\n\n\t\t\t/*\n\t\t\t * Ensure the browser will continue to send the cookie after the expiration time is reached.\n\t\t\t * Needed for the login grace period in wp_validate_auth_cookie().\n\t\t\t */\n\t\t\t$expire = $expiration + ( 12 * HOUR_IN_SECONDS );\n\t\t} else {\n\t\t\t/** This filter is documented in wp-includes/pluggable.php */\n\t\t\t$expiration = time() + apply_filters( 'auth_cookie_expiration', 2 * DAY_IN_SECONDS, $user_id, $remember );\n\t\t\t$expire     = 0;\n\t\t}\n\n\t\tif ( '' === $secure ) {\n\t\t\t$secure = is_ssl();\n\t\t}\n\n\t\t// Front-end cookie is secure when the auth cookie is secure and the site's home URL uses HTTPS.\n\t\t$secure_logged_in_cookie = $secure && 'https' === parse_url( get_option( 'home' ), PHP_URL_SCHEME );\n\n\t\t/**\n\t\t * Filters whether the auth cookie should only be sent over HTTPS.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param bool $secure  Whether the cookie should only be sent over HTTPS.\n\t\t * @param int  $user_id User ID.\n\t\t */\n\t\t$secure = apply_filters( 'secure_auth_cookie', $secure, $user_id );\n\n\t\t/**\n\t\t * Filters whether the logged in cookie should only be sent over HTTPS.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param bool $secure_logged_in_cookie Whether the logged in cookie should only be sent over HTTPS.\n\t\t * @param int  $user_id                 User ID.\n\t\t * @param bool $secure                  Whether the auth cookie should only be sent over HTTPS.\n\t\t */\n\t\t$secure_logged_in_cookie = apply_filters( 'secure_logged_in_cookie', $secure_logged_in_cookie, $user_id, $secure );\n\n\t\tif ( $secure ) {\n\t\t\t$auth_cookie_name = SECURE_AUTH_COOKIE;\n\t\t\t$scheme           = 'secure_auth';\n\t\t} else {\n\t\t\t$auth_cookie_name = AUTH_COOKIE;\n\t\t\t$scheme           = 'auth';\n\t\t}\n\n\t\tif ( '' === $token ) {\n\t\t\t$manager = WP_Session_Tokens::get_instance( $user_id );\n\t\t\t$token   = $manager->create( $expiration );\n\t\t}\n\n\t\t$auth_cookie      = wp_generate_auth_cookie( $user_id, $expiration, $scheme, $token );\n\t\t$logged_in_cookie = wp_generate_auth_cookie( $user_id, $expiration, 'logged_in', $token );\n\n\t\t/**\n\t\t * Fires immediately before the authentication cookie is set.\n\t\t *\n\t\t * @since 2.5.0\n\t\t * @since 4.9.0 The `$token` parameter was added.\n\t\t *\n\t\t * @param string $auth_cookie Authentication cookie value.\n\t\t * @param int    $expire      The time the login grace period expires as a UNIX timestamp.\n\t\t *                            Default is 12 hours past the cookie's expiration time.\n\t\t * @param int    $expiration  The time when the authentication cookie expires as a UNIX timestamp.\n\t\t *                            Default is 14 days from now.\n\t\t * @param int    $user_id     User ID.\n\t\t * @param string $scheme      Authentication scheme. Values include 'auth' or 'secure_auth'.\n\t\t * @param string $token       User's session token to use for this cookie.\n\t\t */\n\t\tdo_action( 'set_auth_cookie', $auth_cookie, $expire, $expiration, $user_id, $scheme, $token );\n\n\t\t/**\n\t\t * Fires immediately before the logged-in authentication cookie is set.\n\t\t *\n\t\t * @since 2.6.0\n\t\t * @since 4.9.0 The `$token` parameter was added.\n\t\t *\n\t\t * @param string $logged_in_cookie The logged-in cookie value.\n\t\t * @param int    $expire           The time the login grace period expires as a UNIX timestamp.\n\t\t *                                 Default is 12 hours past the cookie's expiration time.\n\t\t * @param int    $expiration       The time when the logged-in authentication cookie expires as a UNIX timestamp.\n\t\t *                                 Default is 14 days from now.\n\t\t * @param int    $user_id          User ID.\n\t\t * @param string $scheme           Authentication scheme. Default 'logged_in'.\n\t\t * @param string $token            User's session token to use for this cookie.\n\t\t */\n\t\tdo_action( 'set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in', $token );\n\n\t\t/**\n\t\t * Allows preventing auth cookies from actually being sent to the client.\n\t\t *\n\t\t * @since 4.7.4\n\t\t *\n\t\t * @param bool $send Whether to send auth cookies to the client.\n\t\t */\n\t\tif ( ! apply_filters( 'send_auth_cookies', true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetcookie( $auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure, true );\n\t\tsetcookie( $auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true );\n\t\tsetcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true );\n\t\tif ( COOKIEPATH != SITECOOKIEPATH ) {\n\t\t\tsetcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true );\n\t\t}\n\t}\nendif;\n\nif ( ! function_exists( 'wp_clear_auth_cookie' ) ) :\n\t/**\n\t * Removes all of the cookies associated with authentication.\n\t *\n\t * @since 2.5.0\n\t */\n\tfunction wp_clear_auth_cookie() {\n\t\t/**\n\t\t * Fires just before the authentication cookies are cleared.\n\t\t *\n\t\t * @since 2.7.0\n\t\t */\n\t\tdo_action( 'clear_auth_cookie' );\n\n\t\t/** This filter is documented in wp-includes/pluggable.php */\n\t\tif ( ! apply_filters( 'send_auth_cookies', true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Auth cookies.\n\t\tsetcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN );\n\t\tsetcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN );\n\t\tsetcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN );\n\t\tsetcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN );\n\t\tsetcookie( LOGGED_IN_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN );\n\t\tsetcookie( LOGGED_IN_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );\n\n\t\t// Settings cookies.\n\t\tsetcookie( 'wp-settings-' . get_current_user_id(), ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH );\n\t\tsetcookie( 'wp-settings-time-' . get_current_user_id(), ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH );\n\n\t\t// Old cookies.\n\t\tsetcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN );\n\t\tsetcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );\n\t\tsetcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN );\n\t\tsetcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );\n\n\t\t// Even older cookies.\n\t\tsetcookie( USER_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN );\n\t\tsetcookie( PASS_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN );\n\t\tsetcookie( USER_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );\n\t\tsetcookie( PASS_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN );\n\n\t\t// Post password cookie.\n\t\tsetcookie( 'wp-postpass_' . COOKIEHASH, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN );\n\t}\nendif;\n\nif ( ! function_exists( 'is_user_logged_in' ) ) :\n\t/**\n\t * Determines whether the current visitor is a logged in user.\n\t *\n\t * For more information on this and similar theme functions, check out\n\t * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n\t * Conditional Tags} article in the Theme Developer Handbook.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @return bool True if user is logged in, false if not logged in.\n\t */\n\tfunction is_user_logged_in() {\n\t\t$user = wp_get_current_user();\n\n\t\treturn $user->exists();\n\t}\nendif;\n\nif ( ! function_exists( 'auth_redirect' ) ) :\n\t/**\n\t * Checks if a user is logged in, if not it redirects them to the login page.\n\t *\n\t * When this code is called from a page, it checks to see if the user viewing the page is logged in.\n\t * If the user is not logged in, they are redirected to the login page. The user is redirected\n\t * in such a way that, upon logging in, they will be sent directly to the page they were originally\n\t * trying to access.\n\t *\n\t * @since 1.5.0\n\t */\n\tfunction auth_redirect() {\n\t\t$secure = ( is_ssl() || force_ssl_admin() );\n\n\t\t/**\n\t\t * Filters whether to use a secure authentication redirect.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param bool $secure Whether to use a secure authentication redirect. Default false.\n\t\t */\n\t\t$secure = apply_filters( 'secure_auth_redirect', $secure );\n\n\t\t// If https is required and request is http, redirect.\n\t\tif ( $secure && ! is_ssl() && false !== strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) ) {\n\t\t\tif ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {\n\t\t\t\twp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );\n\t\t\t\texit;\n\t\t\t} else {\n\t\t\t\twp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the authentication redirect scheme.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param string $scheme Authentication redirect scheme. Default empty.\n\t\t */\n\t\t$scheme = apply_filters( 'auth_redirect_scheme', '' );\n\n\t\t$user_id = wp_validate_auth_cookie( '', $scheme );\n\t\tif ( $user_id ) {\n\t\t\t/**\n\t\t\t * Fires before the authentication redirect.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t *\n\t\t\t * @param int $user_id User ID.\n\t\t\t */\n\t\t\tdo_action( 'auth_redirect', $user_id );\n\n\t\t\t// If the user wants ssl but the session is not ssl, redirect.\n\t\t\tif ( ! $secure && get_user_option( 'use_ssl', $user_id ) && false !== strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) ) {\n\t\t\t\tif ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {\n\t\t\t\t\twp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );\n\t\t\t\t\texit;\n\t\t\t\t} else {\n\t\t\t\t\twp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn; // The cookie is good, so we're done.\n\t\t}\n\n\t\t// The cookie is no good, so force login.\n\t\tnocache_headers();\n\n\t\t$redirect = ( strpos( $_SERVER['REQUEST_URI'], '/options.php' ) && wp_get_referer() ) ? wp_get_referer() : set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );\n\n\t\t$login_url = wp_login_url( $redirect, true );\n\n\t\twp_redirect( $login_url );\n\t\texit;\n\t}\nendif;\n\nif ( ! function_exists( 'check_admin_referer' ) ) :\n\t/**\n\t * Ensures intent by verifying that a user was referred from another admin page with the correct security nonce.\n\t *\n\t * This function ensures the user intends to perform a given action, which helps protect against clickjacking style\n\t * attacks. It verifies intent, not authorisation, therefore it does not verify the user's capabilities. This should\n\t * be performed with `current_user_can()` or similar.\n\t *\n\t * If the nonce value is invalid, the function will exit with an \"Are You Sure?\" style message.\n\t *\n\t * @since 1.2.0\n\t * @since 2.5.0 The `$query_arg` parameter was added.\n\t *\n\t * @param int|string $action    The nonce action.\n\t * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST`. Default '_wpnonce'.\n\t * @return int|false 1 if the nonce is valid and generated between 0-12 hours ago,\n\t *                   2 if the nonce is valid and generated between 12-24 hours ago.\n\t *                   False if the nonce is invalid.\n\t */\n\tfunction check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) {\n\t\tif ( -1 === $action ) {\n\t\t\t_doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2.0' );\n\t\t}\n\n\t\t$adminurl = strtolower( admin_url() );\n\t\t$referer  = strtolower( wp_get_referer() );\n\t\t$result   = isset( $_REQUEST[ $query_arg ] ) ? wp_verify_nonce( $_REQUEST[ $query_arg ], $action ) : false;\n\n\t\t/**\n\t\t * Fires once the admin request has been validated or not.\n\t\t *\n\t\t * @since 1.5.1\n\t\t *\n\t\t * @param string    $action The nonce action.\n\t\t * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between\n\t\t *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.\n\t\t */\n\t\tdo_action( 'check_admin_referer', $action, $result );\n\n\t\tif ( ! $result && ! ( -1 === $action && strpos( $referer, $adminurl ) === 0 ) ) {\n\t\t\twp_nonce_ays( $action );\n\t\t\tdie();\n\t\t}\n\n\t\treturn $result;\n\t}\nendif;\n\nif ( ! function_exists( 'check_ajax_referer' ) ) :\n\t/**\n\t * Verifies the Ajax request to prevent processing requests external of the blog.\n\t *\n\t * @since 2.0.3\n\t *\n\t * @param int|string   $action    Action nonce.\n\t * @param false|string $query_arg Optional. Key to check for the nonce in `$_REQUEST` (since 2.5). If false,\n\t *                                `$_REQUEST` values will be evaluated for '_ajax_nonce', and '_wpnonce'\n\t *                                (in that order). Default false.\n\t * @param bool         $die       Optional. Whether to die early when the nonce cannot be verified.\n\t *                                Default true.\n\t * @return int|false 1 if the nonce is valid and generated between 0-12 hours ago,\n\t *                   2 if the nonce is valid and generated between 12-24 hours ago.\n\t *                   False if the nonce is invalid.\n\t */\n\tfunction check_ajax_referer( $action = -1, $query_arg = false, $die = true ) {\n\t\tif ( -1 == $action ) {\n\t\t\t_doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '4.7' );\n\t\t}\n\n\t\t$nonce = '';\n\n\t\tif ( $query_arg && isset( $_REQUEST[ $query_arg ] ) ) {\n\t\t\t$nonce = $_REQUEST[ $query_arg ];\n\t\t} elseif ( isset( $_REQUEST['_ajax_nonce'] ) ) {\n\t\t\t$nonce = $_REQUEST['_ajax_nonce'];\n\t\t} elseif ( isset( $_REQUEST['_wpnonce'] ) ) {\n\t\t\t$nonce = $_REQUEST['_wpnonce'];\n\t\t}\n\n\t\t$result = wp_verify_nonce( $nonce, $action );\n\n\t\t/**\n\t\t * Fires once the Ajax request has been validated or not.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param string    $action The Ajax nonce action.\n\t\t * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between\n\t\t *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.\n\t\t */\n\t\tdo_action( 'check_ajax_referer', $action, $result );\n\n\t\tif ( $die && false === $result ) {\n\t\t\tif ( wp_doing_ajax() ) {\n\t\t\t\twp_die( -1, 403 );\n\t\t\t} else {\n\t\t\t\tdie( '-1' );\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}\nendif;\n\nif ( ! function_exists( 'wp_redirect' ) ) :\n\t/**\n\t * Redirects to another page.\n\t *\n\t * Note: wp_redirect() does not exit automatically, and should almost always be\n\t * followed by a call to `exit;`:\n\t *\n\t *     wp_redirect( $url );\n\t *     exit;\n\t *\n\t * Exiting can also be selectively manipulated by using wp_redirect() as a conditional\n\t * in conjunction with the {@see 'wp_redirect'} and {@see 'wp_redirect_location'} filters:\n\t *\n\t *     if ( wp_redirect( $url ) ) {\n\t *         exit;\n\t *     }\n\t *\n\t * @since 1.5.1\n\t * @since 5.1.0 The `$x_redirect_by` parameter was added.\n\t * @since 5.4.0 On invalid status codes, wp_die() is called.\n\t *\n\t * @global bool $is_IIS\n\t *\n\t * @param string $location      The path or URL to redirect to.\n\t * @param int    $status        Optional. HTTP response status code to use. Default '302' (Moved Temporarily).\n\t * @param string $x_redirect_by Optional. The application doing the redirect. Default 'WordPress'.\n\t * @return bool False if the redirect was cancelled, true otherwise.\n\t */\n\tfunction wp_redirect( $location, $status = 302, $x_redirect_by = 'WordPress' ) {\n\t\tglobal $is_IIS;\n\n\t\t/**\n\t\t * Filters the redirect location.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param string $location The path or URL to redirect to.\n\t\t * @param int    $status   The HTTP response status code to use.\n\t\t */\n\t\t$location = apply_filters( 'wp_redirect', $location, $status );\n\n\t\t/**\n\t\t * Filters the redirect HTTP response status code to use.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param int    $status   The HTTP response status code to use.\n\t\t * @param string $location The path or URL to redirect to.\n\t\t */\n\t\t$status = apply_filters( 'wp_redirect_status', $status, $location );\n\n\t\tif ( ! $location ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $status < 300 || 399 < $status ) {\n\t\t\twp_die( __( 'HTTP redirect status code must be a redirection code, 3xx.' ) );\n\t\t}\n\n\t\t$location = wp_sanitize_redirect( $location );\n\n\t\tif ( ! $is_IIS && 'cgi-fcgi' !== PHP_SAPI ) {\n\t\t\tstatus_header( $status ); // This causes problems on IIS and some FastCGI setups.\n\t\t}\n\n\t\t/**\n\t\t * Filters the X-Redirect-By header.\n\t\t *\n\t\t * Allows applications to identify themselves when they're doing a redirect.\n\t\t *\n\t\t * @since 5.1.0\n\t\t *\n\t\t * @param string $x_redirect_by The application doing the redirect.\n\t\t * @param int    $status        Status code to use.\n\t\t * @param string $location      The path to redirect to.\n\t\t */\n\t\t$x_redirect_by = apply_filters( 'x_redirect_by', $x_redirect_by, $status, $location );\n\t\tif ( is_string( $x_redirect_by ) ) {\n\t\t\theader( \"X-Redirect-By: $x_redirect_by\" );\n\t\t}\n\n\t\theader( \"Location: $location\", true, $status );\n\n\t\treturn true;\n\t}\nendif;\n\nif ( ! function_exists( 'wp_sanitize_redirect' ) ) :\n\t/**\n\t * Sanitizes a URL for use in a redirect.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string $location The path to redirect to.\n\t * @return string Redirect-sanitized URL.\n\t */\n\tfunction wp_sanitize_redirect( $location ) {\n\t\t// Encode spaces.\n\t\t$location = str_replace( ' ', '%20', $location );\n\n\t\t$regex    = '/\n\t\t(\n\t\t\t(?: [\\xC2-\\xDF][\\x80-\\xBF]        # double-byte sequences   110xxxxx 10xxxxxx\n\t\t\t|   \\xE0[\\xA0-\\xBF][\\x80-\\xBF]    # triple-byte sequences   1110xxxx 10xxxxxx * 2\n\t\t\t|   [\\xE1-\\xEC][\\x80-\\xBF]{2}\n\t\t\t|   \\xED[\\x80-\\x9F][\\x80-\\xBF]\n\t\t\t|   [\\xEE-\\xEF][\\x80-\\xBF]{2}\n\t\t\t|   \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # four-byte sequences   11110xxx 10xxxxxx * 3\n\t\t\t|   [\\xF1-\\xF3][\\x80-\\xBF]{3}\n\t\t\t|   \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2}\n\t\t){1,40}                              # ...one or more times\n\t\t)/x';\n\t\t$location = preg_replace_callback( $regex, '_wp_sanitize_utf8_in_redirect', $location );\n\t\t$location = preg_replace( '|[^a-z0-9-~+_.?#=&;,/:%!*\\[\\]()@]|i', '', $location );\n\t\t$location = wp_kses_no_null( $location );\n\n\t\t// Remove %0D and %0A from location.\n\t\t$strip = array( '%0d', '%0a', '%0D', '%0A' );\n\t\treturn _deep_replace( $strip, $location );\n\t}\n\n\t/**\n\t * URL encode UTF-8 characters in a URL.\n\t *\n\t * @ignore\n\t * @since 4.2.0\n\t * @access private\n\t *\n\t * @see wp_sanitize_redirect()\n\t *\n\t * @param array $matches RegEx matches against the redirect location.\n\t * @return string URL-encoded version of the first RegEx match.\n\t */\n\tfunction _wp_sanitize_utf8_in_redirect( $matches ) {\n\t\treturn urlencode( $matches[0] );\n\t}\nendif;\n\nif ( ! function_exists( 'wp_safe_redirect' ) ) :\n\t/**\n\t * Performs a safe (local) redirect, using wp_redirect().\n\t *\n\t * Checks whether the $location is using an allowed host, if it has an absolute\n\t * path. A plugin can therefore set or remove allowed host(s) to or from the\n\t * list.\n\t *\n\t * If the host is not allowed, then the redirect defaults to wp-admin on the siteurl\n\t * instead. This prevents malicious redirects which redirect to another host,\n\t * but only used in a few places.\n\t *\n\t * Note: wp_safe_redirect() does not exit automatically, and should almost always be\n\t * followed by a call to `exit;`:\n\t *\n\t *     wp_safe_redirect( $url );\n\t *     exit;\n\t *\n\t * Exiting can also be selectively manipulated by using wp_safe_redirect() as a conditional\n\t * in conjunction with the {@see 'wp_redirect'} and {@see 'wp_redirect_location'} filters:\n\t *\n\t *     if ( wp_safe_redirect( $url ) ) {\n\t *         exit;\n\t *     }\n\t *\n\t * @since 2.3.0\n\t * @since 5.1.0 The return value from wp_redirect() is now passed on, and the `$x_redirect_by` parameter was added.\n\t *\n\t * @param string $location      The path or URL to redirect to.\n\t * @param int    $status        Optional. HTTP response status code to use. Default '302' (Moved Temporarily).\n\t * @param string $x_redirect_by Optional. The application doing the redirect. Default 'WordPress'.\n\t * @return bool False if the redirect was cancelled, true otherwise.\n\t */\n\tfunction wp_safe_redirect( $location, $status = 302, $x_redirect_by = 'WordPress' ) {\n\n\t\t// Need to look at the URL the way it will end up in wp_redirect().\n\t\t$location = wp_sanitize_redirect( $location );\n\n\t\t/**\n\t\t * Filters the redirect fallback URL for when the provided redirect is not safe (local).\n\t\t *\n\t\t * @since 4.3.0\n\t\t *\n\t\t * @param string $fallback_url The fallback URL to use by default.\n\t\t * @param int    $status       The HTTP response status code to use.\n\t\t */\n\t\t$location = wp_validate_redirect( $location, apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status ) );\n\n\t\treturn wp_redirect( $location, $status, $x_redirect_by );\n\t}\nendif;\n\nif ( ! function_exists( 'wp_validate_redirect' ) ) :\n\t/**\n\t * Validates a URL for use in a redirect.\n\t *\n\t * Checks whether the $location is using an allowed host, if it has an absolute\n\t * path. A plugin can therefore set or remove allowed host(s) to or from the\n\t * list.\n\t *\n\t * If the host is not allowed, then the redirect is to $default supplied\n\t *\n\t * @since 2.8.1\n\t *\n\t * @param string $location The redirect to validate\n\t * @param string $default  The value to return if $location is not allowed\n\t * @return string redirect-sanitized URL\n\t */\n\tfunction wp_validate_redirect( $location, $default = '' ) {\n\t\t$location = wp_sanitize_redirect( trim( $location, \" \\t\\n\\r\\0\\x08\\x0B\" ) );\n\t\t// Browsers will assume 'http' is your protocol, and will obey a redirect to a URL starting with '//'.\n\t\tif ( '//' === substr( $location, 0, 2 ) ) {\n\t\t\t$location = 'http:' . $location;\n\t\t}\n\n\t\t// In PHP 5 parse_url() may fail if the URL query part contains 'http://'.\n\t\t// See https://bugs.php.net/bug.php?id=38143\n\t\t$cut  = strpos( $location, '?' );\n\t\t$test = $cut ? substr( $location, 0, $cut ) : $location;\n\n\t\t$lp = parse_url( $test );\n\n\t\t// Give up if malformed URL.\n\t\tif ( false === $lp ) {\n\t\t\treturn $default;\n\t\t}\n\n\t\t// Allow only 'http' and 'https' schemes. No 'data:', etc.\n\t\tif ( isset( $lp['scheme'] ) && ! ( 'http' === $lp['scheme'] || 'https' === $lp['scheme'] ) ) {\n\t\t\treturn $default;\n\t\t}\n\n\t\tif ( ! isset( $lp['host'] ) && ! empty( $lp['path'] ) && '/' !== $lp['path'][0] ) {\n\t\t\t$path = '';\n\t\t\tif ( ! empty( $_SERVER['REQUEST_URI'] ) ) {\n\t\t\t\t$path = dirname( parse_url( 'http://placeholder' . $_SERVER['REQUEST_URI'], PHP_URL_PATH ) . '?' );\n\t\t\t\t$path = wp_normalize_path( $path );\n\t\t\t}\n\t\t\t$location = '/' . ltrim( $path . '/', '/' ) . $location;\n\t\t}\n\n\t\t// Reject if certain components are set but host is not.\n\t\t// This catches URLs like https:host.com for which parse_url() does not set the host field.\n\t\tif ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) {\n\t\t\treturn $default;\n\t\t}\n\n\t\t// Reject malformed components parse_url() can return on odd inputs.\n\t\tforeach ( array( 'user', 'pass', 'host' ) as $component ) {\n\t\t\tif ( isset( $lp[ $component ] ) && strpbrk( $lp[ $component ], ':/?#@' ) ) {\n\t\t\t\treturn $default;\n\t\t\t}\n\t\t}\n\n\t\t$wpp = parse_url( home_url() );\n\n\t\t/**\n\t\t * Filters the list of allowed hosts to redirect to.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param string[] $hosts An array of allowed host names.\n\t\t * @param string   $host  The host name of the redirect destination; empty string if not set.\n\t\t */\n\t\t$allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array( $wpp['host'] ), isset( $lp['host'] ) ? $lp['host'] : '' );\n\n\t\tif ( isset( $lp['host'] ) && ( ! in_array( $lp['host'], $allowed_hosts, true ) && strtolower( $wpp['host'] ) !== $lp['host'] ) ) {\n\t\t\t$location = $default;\n\t\t}\n\n\t\treturn $location;\n\t}\nendif;\n\nif ( ! function_exists( 'wp_notify_postauthor' ) ) :\n\t/**\n\t * Notify an author (and/or others) of a comment/trackback/pingback on a post.\n\t *\n\t * @since 1.0.0\n\t *\n\t * @param int|WP_Comment $comment_id Comment ID or WP_Comment object.\n\t * @param string         $deprecated Not used\n\t * @return bool True on completion. False if no email addresses were specified.\n\t */\n\tfunction wp_notify_postauthor( $comment_id, $deprecated = null ) {\n\t\tif ( null !== $deprecated ) {\n\t\t\t_deprecated_argument( __FUNCTION__, '3.8.0' );\n\t\t}\n\n\t\t$comment = get_comment( $comment_id );\n\t\tif ( empty( $comment ) || empty( $comment->comment_post_ID ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$post   = get_post( $comment->comment_post_ID );\n\t\t$author = get_userdata( $post->post_author );\n\n\t\t// Who to notify? By default, just the post author, but others can be added.\n\t\t$emails = array();\n\t\tif ( $author ) {\n\t\t\t$emails[] = $author->user_email;\n\t\t}\n\n\t\t/**\n\t\t * Filters the list of email addresses to receive a comment notification.\n\t\t *\n\t\t * By default, only post authors are notified of comments. This filter allows\n\t\t * others to be added.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param string[] $emails     An array of email addresses to receive a comment notification.\n\t\t * @param int      $comment_id The comment ID.\n\t\t */\n\t\t$emails = apply_filters( 'comment_notification_recipients', $emails, $comment->comment_ID );\n\t\t$emails = array_filter( $emails );\n\n\t\t// If there are no addresses to send the comment to, bail.\n\t\tif ( ! count( $emails ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Facilitate unsetting below without knowing the keys.\n\t\t$emails = array_flip( $emails );\n\n\t\t/**\n\t\t * Filters whether to notify comment authors of their comments on their own posts.\n\t\t *\n\t\t * By default, comment authors aren't notified of their comments on their own\n\t\t * posts. This filter allows you to override that.\n\t\t *\n\t\t * @since 3.8.0\n\t\t *\n\t\t * @param bool $notify     Whether to notify the post author of their own comment.\n\t\t *                         Default false.\n\t\t * @param int  $comment_id The comment ID.\n\t\t */\n\t\t$notify_author = apply_filters( 'comment_notification_notify_author', false, $comment->comment_ID );\n\n\t\t// The comment was left by the author.\n\t\tif ( $author && ! $notify_author && $comment->user_id == $post->post_author ) {\n\t\t\tunset( $emails[ $author->user_email ] );\n\t\t}\n\n\t\t// The author moderated a comment on their own post.\n\t\tif ( $author && ! $notify_author && get_current_user_id() == $post->post_author ) {\n\t\t\tunset( $emails[ $author->user_email ] );\n\t\t}\n\n\t\t// The post author is no longer a member of the blog.\n\t\tif ( $author && ! $notify_author && ! user_can( $post->post_author, 'read_post', $post->ID ) ) {\n\t\t\tunset( $emails[ $author->user_email ] );\n\t\t}\n\n\t\t// If there's no email to send the comment to, bail, otherwise flip array back around for use below.\n\t\tif ( ! count( $emails ) ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$emails = array_flip( $emails );\n\t\t}\n\n\t\t$switched_locale = switch_to_locale( get_locale() );\n\n\t\t$comment_author_domain = '';\n\t\tif ( WP_Http::is_ip_address( $comment->comment_author_IP ) ) {\n\t\t\t$comment_author_domain = gethostbyaddr( $comment->comment_author_IP );\n\t\t}\n\n\t\t// The blogname option is escaped with esc_html() on the way into the database in sanitize_option().\n\t\t// We want to reverse this for the plain text arena of emails.\n\t\t$blogname        = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );\n\t\t$comment_content = wp_specialchars_decode( $comment->comment_content );\n\n\t\tswitch ( $comment->comment_type ) {\n\t\t\tcase 'trackback':\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t$notify_message = sprintf( __( 'New trackback on your post \"%s\"' ), $post->post_title ) . \"\\r\\n\";\n\t\t\t\t/* translators: 1: Trackback/pingback website name, 2: Website IP address, 3: Website hostname. */\n\t\t\t\t$notify_message .= sprintf( __( 'Website: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . \"\\r\\n\";\n\t\t\t\t/* translators: %s: Trackback/pingback/comment author URL. */\n\t\t\t\t$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . \"\\r\\n\";\n\t\t\t\t/* translators: %s: Comment text. */\n\t\t\t\t$notify_message .= sprintf( __( 'Comment: %s' ), \"\\r\\n\" . $comment_content ) . \"\\r\\n\\r\\n\";\n\t\t\t\t$notify_message .= __( 'You can see all trackbacks on this post here:' ) . \"\\r\\n\";\n\t\t\t\t/* translators: Trackback notification email subject. 1: Site title, 2: Post title. */\n\t\t\t\t$subject = sprintf( __( '[%1$s] Trackback: \"%2$s\"' ), $blogname, $post->post_title );\n\t\t\t\tbreak;\n\n\t\t\tcase 'pingback':\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t$notify_message = sprintf( __( 'New pingback on your post \"%s\"' ), $post->post_title ) . \"\\r\\n\";\n\t\t\t\t/* translators: 1: Trackback/pingback website name, 2: Website IP address, 3: Website hostname. */\n\t\t\t\t$notify_message .= sprintf( __( 'Website: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . \"\\r\\n\";\n\t\t\t\t/* translators: %s: Trackback/pingback/comment author URL. */\n\t\t\t\t$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . \"\\r\\n\";\n\t\t\t\t/* translators: %s: Comment text. */\n\t\t\t\t$notify_message .= sprintf( __( 'Comment: %s' ), \"\\r\\n\" . $comment_content ) . \"\\r\\n\\r\\n\";\n\t\t\t\t$notify_message .= __( 'You can see all pingbacks on this post here:' ) . \"\\r\\n\";\n\t\t\t\t/* translators: Pingback notification email subject. 1: Site title, 2: Post title. */\n\t\t\t\t$subject = sprintf( __( '[%1$s] Pingback: \"%2$s\"' ), $blogname, $post->post_title );\n\t\t\t\tbreak;\n\n\t\t\tdefault: // Comments.\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t$notify_message = sprintf( __( 'New comment on your post \"%s\"' ), $post->post_title ) . \"\\r\\n\";\n\t\t\t\t/* translators: 1: Comment author's name, 2: Comment author's IP address, 3: Comment author's hostname. */\n\t\t\t\t$notify_message .= sprintf( __( 'Author: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . \"\\r\\n\";\n\t\t\t\t/* translators: %s: Comment author email. */\n\t\t\t\t$notify_message .= sprintf( __( 'Email: %s' ), $comment->comment_author_email ) . \"\\r\\n\";\n\t\t\t\t/* translators: %s: Trackback/pingback/comment author URL. */\n\t\t\t\t$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . \"\\r\\n\";\n\n\t\t\t\tif ( $comment->comment_parent && user_can( $post->post_author, 'edit_comment', $comment->comment_parent ) ) {\n\t\t\t\t\t/* translators: Comment moderation. %s: Parent comment edit URL. */\n\t\t\t\t\t$notify_message .= sprintf( __( 'In reply to: %s' ), admin_url( \"comment.php?action=editcomment&c={$comment->comment_parent}#wpbody-content\" ) ) . \"\\r\\n\";\n\t\t\t\t}\n\n\t\t\t\t/* translators: %s: Comment text. */\n\t\t\t\t$notify_message .= sprintf( __( 'Comment: %s' ), \"\\r\\n\" . $comment_content ) . \"\\r\\n\\r\\n\";\n\t\t\t\t$notify_message .= __( 'You can see all comments on this post here:' ) . \"\\r\\n\";\n\t\t\t\t/* translators: Comment notification email subject. 1: Site title, 2: Post title. */\n\t\t\t\t$subject = sprintf( __( '[%1$s] Comment: \"%2$s\"' ), $blogname, $post->post_title );\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$notify_message .= get_permalink( $comment->comment_post_ID ) . \"#comments\\r\\n\\r\\n\";\n\t\t/* translators: %s: Comment URL. */\n\t\t$notify_message .= sprintf( __( 'Permalink: %s' ), get_comment_link( $comment ) ) . \"\\r\\n\";\n\n\t\tif ( user_can( $post->post_author, 'edit_comment', $comment->comment_ID ) ) {\n\t\t\tif ( EMPTY_TRASH_DAYS ) {\n\t\t\t\t/* translators: Comment moderation. %s: Comment action URL. */\n\t\t\t\t$notify_message .= sprintf( __( 'Trash it: %s' ), admin_url( \"comment.php?action=trash&c={$comment->comment_ID}#wpbody-content\" ) ) . \"\\r\\n\";\n\t\t\t} else {\n\t\t\t\t/* translators: Comment moderation. %s: Comment action URL. */\n\t\t\t\t$notify_message .= sprintf( __( 'Delete it: %s' ), admin_url( \"comment.php?action=delete&c={$comment->comment_ID}#wpbody-content\" ) ) . \"\\r\\n\";\n\t\t\t}\n\t\t\t/* translators: Comment moderation. %s: Comment action URL. */\n\t\t\t$notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( \"comment.php?action=spam&c={$comment->comment_ID}#wpbody-content\" ) ) . \"\\r\\n\";\n\t\t}\n\n\t\t$wp_email = 'wordpress@' . preg_replace( '#^www\\.#', '', wp_parse_url( network_home_url(), PHP_URL_HOST ) );\n\n\t\tif ( '' === $comment->comment_author ) {\n\t\t\t$from = \"From: \\\"$blogname\\\" <$wp_email>\";\n\t\t\tif ( '' !== $comment->comment_author_email ) {\n\t\t\t\t$reply_to = \"Reply-To: $comment->comment_author_email\";\n\t\t\t}\n\t\t} else {\n\t\t\t$from = \"From: \\\"$comment->comment_author\\\" <$wp_email>\";\n\t\t\tif ( '' !== $comment->comment_author_email ) {\n\t\t\t\t$reply_to = \"Reply-To: \\\"$comment->comment_author_email\\\" <$comment->comment_author_email>\";\n\t\t\t}\n\t\t}\n\n\t\t$message_headers = \"$from\\n\"\n\t\t. 'Content-Type: text/plain; charset=\"' . get_option( 'blog_charset' ) . \"\\\"\\n\";\n\n\t\tif ( isset( $reply_to ) ) {\n\t\t\t$message_headers .= $reply_to . \"\\n\";\n\t\t}\n\n\t\t/**\n\t\t * Filters the comment notification email text.\n\t\t *\n\t\t * @since 1.5.2\n\t\t *\n\t\t * @param string $notify_message The comment notification email text.\n\t\t * @param int    $comment_id     Comment ID.\n\t\t */\n\t\t$notify_message = apply_filters( 'comment_notification_text', $notify_message, $comment->comment_ID );\n\n\t\t/**\n\t\t * Filters the comment notification email subject.\n\t\t *\n\t\t * @since 1.5.2\n\t\t *\n\t\t * @param string $subject    The comment notification email subject.\n\t\t * @param int    $comment_id Comment ID.\n\t\t */\n\t\t$subject = apply_filters( 'comment_notification_subject', $subject, $comment->comment_ID );\n\n\t\t/**\n\t\t * Filters the comment notification email headers.\n\t\t *\n\t\t * @since 1.5.2\n\t\t *\n\t\t * @param string $message_headers Headers for the comment notification email.\n\t\t * @param int    $comment_id      Comment ID.\n\t\t */\n\t\t$message_headers = apply_filters( 'comment_notification_headers', $message_headers, $comment->comment_ID );\n\n\t\tforeach ( $emails as $email ) {\n\t\t\twp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );\n\t\t}\n\n\t\tif ( $switched_locale ) {\n\t\t\trestore_previous_locale();\n\t\t}\n\n\t\treturn true;\n\t}\nendif;\n\nif ( ! function_exists( 'wp_notify_moderator' ) ) :\n\t/**\n\t * Notifies the moderator of the site about a new comment that is awaiting approval.\n\t *\n\t * @since 1.0.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * Uses the {@see 'notify_moderator'} filter to determine whether the site moderator\n\t * should be notified, overriding the site setting.\n\t *\n\t * @param int $comment_id Comment ID.\n\t * @return true Always returns true.\n\t */\n\tfunction wp_notify_moderator( $comment_id ) {\n\t\tglobal $wpdb;\n\n\t\t$maybe_notify = get_option( 'moderation_notify' );\n\n\t\t/**\n\t\t * Filters whether to send the site moderator email notifications, overriding the site setting.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param bool $maybe_notify Whether to notify blog moderator.\n\t\t * @param int  $comment_ID   The id of the comment for the notification.\n\t\t */\n\t\t$maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_id );\n\n\t\tif ( ! $maybe_notify ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$comment = get_comment( $comment_id );\n\t\t$post    = get_post( $comment->comment_post_ID );\n\t\t$user    = get_userdata( $post->post_author );\n\t\t// Send to the administration and to the post author if the author can modify the comment.\n\t\t$emails = array( get_option( 'admin_email' ) );\n\t\tif ( $user && user_can( $user->ID, 'edit_comment', $comment_id ) && ! empty( $user->user_email ) ) {\n\t\t\tif ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) {\n\t\t\t\t$emails[] = $user->user_email;\n\t\t\t}\n\t\t}\n\n\t\t$switched_locale = switch_to_locale( get_locale() );\n\n\t\t$comment_author_domain = '';\n\t\tif ( WP_Http::is_ip_address( $comment->comment_author_IP ) ) {\n\t\t\t$comment_author_domain = gethostbyaddr( $comment->comment_author_IP );\n\t\t}\n\n\t\t$comments_waiting = $wpdb->get_var( \"SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'\" );\n\n\t\t// The blogname option is escaped with esc_html() on the way into the database in sanitize_option().\n\t\t// We want to reverse this for the plain text arena of emails.\n\t\t$blogname        = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );\n\t\t$comment_content = wp_specialchars_decode( $comment->comment_content );\n\n\t\tswitch ( $comment->comment_type ) {\n\t\t\tcase 'trackback':\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t$notify_message  = sprintf( __( 'A new trackback on the post \"%s\" is waiting for your approval' ), $post->post_title ) . \"\\r\\n\";\n\t\t\t\t$notify_message .= get_permalink( $comment->comment_post_ID ) . \"\\r\\n\\r\\n\";\n\t\t\t\t/* translators: 1: Trackback/pingback website name, 2: Website IP address, 3: Website hostname. */\n\t\t\t\t$notify_message .= sprintf( __( 'Website: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . \"\\r\\n\";\n\t\t\t\t/* translators: %s: Trackback/pingback/comment author URL. */\n\t\t\t\t$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . \"\\r\\n\";\n\t\t\t\t$notify_message .= __( 'Trackback excerpt: ' ) . \"\\r\\n\" . $comment_content . \"\\r\\n\\r\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'pingback':\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t$notify_message  = sprintf( __( 'A new pingback on the post \"%s\" is waiting for your approval' ), $post->post_title ) . \"\\r\\n\";\n\t\t\t\t$notify_message .= get_permalink( $comment->comment_post_ID ) . \"\\r\\n\\r\\n\";\n\t\t\t\t/* translators: 1: Trackback/pingback website name, 2: Website IP address, 3: Website hostname. */\n\t\t\t\t$notify_message .= sprintf( __( 'Website: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . \"\\r\\n\";\n\t\t\t\t/* translators: %s: Trackback/pingback/comment author URL. */\n\t\t\t\t$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . \"\\r\\n\";\n\t\t\t\t$notify_message .= __( 'Pingback excerpt: ' ) . \"\\r\\n\" . $comment_content . \"\\r\\n\\r\\n\";\n\t\t\t\tbreak;\n\n\t\t\tdefault: // Comments.\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t$notify_message  = sprintf( __( 'A new comment on the post \"%s\" is waiting for your approval' ), $post->post_title ) . \"\\r\\n\";\n\t\t\t\t$notify_message .= get_permalink( $comment->comment_post_ID ) . \"\\r\\n\\r\\n\";\n\t\t\t\t/* translators: 1: Comment author's name, 2: Comment author's IP address, 3: Comment author's hostname. */\n\t\t\t\t$notify_message .= sprintf( __( 'Author: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . \"\\r\\n\";\n\t\t\t\t/* translators: %s: Comment author email. */\n\t\t\t\t$notify_message .= sprintf( __( 'Email: %s' ), $comment->comment_author_email ) . \"\\r\\n\";\n\t\t\t\t/* translators: %s: Trackback/pingback/comment author URL. */\n\t\t\t\t$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . \"\\r\\n\";\n\n\t\t\t\tif ( $comment->comment_parent ) {\n\t\t\t\t\t/* translators: Comment moderation. %s: Parent comment edit URL. */\n\t\t\t\t\t$notify_message .= sprintf( __( 'In reply to: %s' ), admin_url( \"comment.php?action=editcomment&c={$comment->comment_parent}#wpbody-content\" ) ) . \"\\r\\n\";\n\t\t\t\t}\n\n\t\t\t\t/* translators: %s: Comment text. */\n\t\t\t\t$notify_message .= sprintf( __( 'Comment: %s' ), \"\\r\\n\" . $comment_content ) . \"\\r\\n\\r\\n\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\t/* translators: Comment moderation. %s: Comment action URL. */\n\t\t$notify_message .= sprintf( __( 'Approve it: %s' ), admin_url( \"comment.php?action=approve&c={$comment_id}#wpbody-content\" ) ) . \"\\r\\n\";\n\n\t\tif ( EMPTY_TRASH_DAYS ) {\n\t\t\t/* translators: Comment moderation. %s: Comment action URL. */\n\t\t\t$notify_message .= sprintf( __( 'Trash it: %s' ), admin_url( \"comment.php?action=trash&c={$comment_id}#wpbody-content\" ) ) . \"\\r\\n\";\n\t\t} else {\n\t\t\t/* translators: Comment moderation. %s: Comment action URL. */\n\t\t\t$notify_message .= sprintf( __( 'Delete it: %s' ), admin_url( \"comment.php?action=delete&c={$comment_id}#wpbody-content\" ) ) . \"\\r\\n\";\n\t\t}\n\n\t\t/* translators: Comment moderation. %s: Comment action URL. */\n\t\t$notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( \"comment.php?action=spam&c={$comment_id}#wpbody-content\" ) ) . \"\\r\\n\";\n\n\t\t$notify_message .= sprintf(\n\t\t\t/* translators: Comment moderation. %s: Number of comments awaiting approval. */\n\t\t\t_n(\n\t\t\t\t'Currently %s comment is waiting for approval. Please visit the moderation panel:',\n\t\t\t\t'Currently %s comments are waiting for approval. Please visit the moderation panel:',\n\t\t\t\t$comments_waiting\n\t\t\t),\n\t\t\tnumber_format_i18n( $comments_waiting )\n\t\t) . \"\\r\\n\";\n\t\t$notify_message .= admin_url( 'edit-comments.php?comment_status=moderated#wpbody-content' ) . \"\\r\\n\";\n\n\t\t/* translators: Comment moderation notification email subject. 1: Site title, 2: Post title. */\n\t\t$subject         = sprintf( __( '[%1$s] Please moderate: \"%2$s\"' ), $blogname, $post->post_title );\n\t\t$message_headers = '';\n\n\t\t/**\n\t\t * Filters the list of recipients for comment moderation emails.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param string[] $emails     List of email addresses to notify for comment moderation.\n\t\t * @param int      $comment_id Comment ID.\n\t\t */\n\t\t$emails = apply_filters( 'comment_moderation_recipients', $emails, $comment_id );\n\n\t\t/**\n\t\t * Filters the comment moderation email text.\n\t\t *\n\t\t * @since 1.5.2\n\t\t *\n\t\t * @param string $notify_message Text of the comment moderation email.\n\t\t * @param int    $comment_id     Comment ID.\n\t\t */\n\t\t$notify_message = apply_filters( 'comment_moderation_text', $notify_message, $comment_id );\n\n\t\t/**\n\t\t * Filters the comment moderation email subject.\n\t\t *\n\t\t * @since 1.5.2\n\t\t *\n\t\t * @param string $subject    Subject of the comment moderation email.\n\t\t * @param int    $comment_id Comment ID.\n\t\t */\n\t\t$subject = apply_filters( 'comment_moderation_subject', $subject, $comment_id );\n\n\t\t/**\n\t\t * Filters the comment moderation email headers.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string $message_headers Headers for the comment moderation email.\n\t\t * @param int    $comment_id      Comment ID.\n\t\t */\n\t\t$message_headers = apply_filters( 'comment_moderation_headers', $message_headers, $comment_id );\n\n\t\tforeach ( $emails as $email ) {\n\t\t\twp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );\n\t\t}\n\n\t\tif ( $switched_locale ) {\n\t\t\trestore_previous_locale();\n\t\t}\n\n\t\treturn true;\n\t}\nendif;\n\nif ( ! function_exists( 'wp_password_change_notification' ) ) :\n\t/**\n\t * Notify the blog admin of a user changing password, normally via email.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param WP_User $user User object.\n\t */\n\tfunction wp_password_change_notification( $user ) {\n\t\t// Send a copy of password change notification to the admin,\n\t\t// but check to see if it's the admin whose password we're changing, and skip this.\n\t\tif ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) {\n\t\t\t/* translators: %s: User name. */\n\t\t\t$message = sprintf( __( 'Password changed for user: %s' ), $user->user_login ) . \"\\r\\n\";\n\t\t\t// The blogname option is escaped with esc_html() on the way into the database in sanitize_option().\n\t\t\t// We want to reverse this for the plain text arena of emails.\n\t\t\t$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );\n\n\t\t\t$wp_password_change_notification_email = array(\n\t\t\t\t'to'      => get_option( 'admin_email' ),\n\t\t\t\t/* translators: Password change notification email subject. %s: Site title. */\n\t\t\t\t'subject' => __( '[%s] Password Changed' ),\n\t\t\t\t'message' => $message,\n\t\t\t\t'headers' => '',\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Filters the contents of the password change notification email sent to the site admin.\n\t\t\t *\n\t\t\t * @since 4.9.0\n\t\t\t *\n\t\t\t * @param array   $wp_password_change_notification_email {\n\t\t\t *     Used to build wp_mail().\n\t\t\t *\n\t\t\t *     @type string $to      The intended recipient - site admin email address.\n\t\t\t *     @type string $subject The subject of the email.\n\t\t\t *     @type string $message The body of the email.\n\t\t\t *     @type string $headers The headers of the email.\n\t\t\t * }\n\t\t\t * @param WP_User $user     User object for user whose password was changed.\n\t\t\t * @param string  $blogname The site title.\n\t\t\t */\n\t\t\t$wp_password_change_notification_email = apply_filters( 'wp_password_change_notification_email', $wp_password_change_notification_email, $user, $blogname );\n\n\t\t\twp_mail(\n\t\t\t\t$wp_password_change_notification_email['to'],\n\t\t\t\twp_specialchars_decode( sprintf( $wp_password_change_notification_email['subject'], $blogname ) ),\n\t\t\t\t$wp_password_change_notification_email['message'],\n\t\t\t\t$wp_password_change_notification_email['headers']\n\t\t\t);\n\t\t}\n\t}\nendif;\n\nif ( ! function_exists( 'wp_new_user_notification' ) ) :\n\t/**\n\t * Email login credentials to a newly-registered user.\n\t *\n\t * A new user registration notification is also sent to admin email.\n\t *\n\t * @since 2.0.0\n\t * @since 4.3.0 The `$plaintext_pass` parameter was changed to `$notify`.\n\t * @since 4.3.1 The `$plaintext_pass` parameter was deprecated. `$notify` added as a third parameter.\n\t * @since 4.6.0 The `$notify` parameter accepts 'user' for sending notification only to the user created.\n\t *\n\t * @param int    $user_id    User ID.\n\t * @param null   $deprecated Not used (argument deprecated).\n\t * @param string $notify     Optional. Type of notification that should happen. Accepts 'admin' or an empty\n\t *                           string (admin only), 'user', or 'both' (admin and user). Default empty.\n\t */\n\tfunction wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ) {\n\t\tif ( null !== $deprecated ) {\n\t\t\t_deprecated_argument( __FUNCTION__, '4.3.1' );\n\t\t}\n\n\t\t// Accepts only 'user', 'admin' , 'both' or default '' as $notify.\n\t\tif ( ! in_array( $notify, array( 'user', 'admin', 'both', '' ), true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$user = get_userdata( $user_id );\n\n\t\t// The blogname option is escaped with esc_html() on the way into the database in sanitize_option().\n\t\t// We want to reverse this for the plain text arena of emails.\n\t\t$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );\n\n\t\tif ( 'user' !== $notify ) {\n\t\t\t$switched_locale = switch_to_locale( get_locale() );\n\n\t\t\t/* translators: %s: Site title. */\n\t\t\t$message = sprintf( __( 'New user registration on your site %s:' ), $blogname ) . \"\\r\\n\\r\\n\";\n\t\t\t/* translators: %s: User login. */\n\t\t\t$message .= sprintf( __( 'Username: %s' ), $user->user_login ) . \"\\r\\n\\r\\n\";\n\t\t\t/* translators: %s: User email address. */\n\t\t\t$message .= sprintf( __( 'Email: %s' ), $user->user_email ) . \"\\r\\n\";\n\n\t\t\t$wp_new_user_notification_email_admin = array(\n\t\t\t\t'to'      => get_option( 'admin_email' ),\n\t\t\t\t/* translators: New user registration notification email subject. %s: Site title. */\n\t\t\t\t'subject' => __( '[%s] New User Registration' ),\n\t\t\t\t'message' => $message,\n\t\t\t\t'headers' => '',\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Filters the contents of the new user notification email sent to the site admin.\n\t\t\t *\n\t\t\t * @since 4.9.0\n\t\t\t *\n\t\t\t * @param array   $wp_new_user_notification_email_admin {\n\t\t\t *     Used to build wp_mail().\n\t\t\t *\n\t\t\t *     @type string $to      The intended recipient - site admin email address.\n\t\t\t *     @type string $subject The subject of the email.\n\t\t\t *     @type string $message The body of the email.\n\t\t\t *     @type string $headers The headers of the email.\n\t\t\t * }\n\t\t\t * @param WP_User $user     User object for new user.\n\t\t\t * @param string  $blogname The site title.\n\t\t\t */\n\t\t\t$wp_new_user_notification_email_admin = apply_filters( 'wp_new_user_notification_email_admin', $wp_new_user_notification_email_admin, $user, $blogname );\n\n\t\t\twp_mail(\n\t\t\t\t$wp_new_user_notification_email_admin['to'],\n\t\t\t\twp_specialchars_decode( sprintf( $wp_new_user_notification_email_admin['subject'], $blogname ) ),\n\t\t\t\t$wp_new_user_notification_email_admin['message'],\n\t\t\t\t$wp_new_user_notification_email_admin['headers']\n\t\t\t);\n\n\t\t\tif ( $switched_locale ) {\n\t\t\t\trestore_previous_locale();\n\t\t\t}\n\t\t}\n\n\t\t// `$deprecated` was pre-4.3 `$plaintext_pass`. An empty `$plaintext_pass` didn't sent a user notification.\n\t\tif ( 'admin' === $notify || ( empty( $deprecated ) && empty( $notify ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$key = get_password_reset_key( $user );\n\t\tif ( is_wp_error( $key ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$switched_locale = switch_to_locale( get_user_locale( $user ) );\n\n\t\t/* translators: %s: User login. */\n\t\t$message  = sprintf( __( 'Username: %s' ), $user->user_login ) . \"\\r\\n\\r\\n\";\n\t\t$message .= __( 'To set your password, visit the following address:' ) . \"\\r\\n\\r\\n\";\n\t\t$message .= network_site_url( \"wp-login.php?action=rp&key=$key&login=\" . rawurlencode( $user->user_login ), 'login' ) . \"\\r\\n\\r\\n\";\n\n\t\t$message .= wp_login_url() . \"\\r\\n\";\n\n\t\t$wp_new_user_notification_email = array(\n\t\t\t'to'      => $user->user_email,\n\t\t\t/* translators: Login details notification email subject. %s: Site title. */\n\t\t\t'subject' => __( '[%s] Login Details' ),\n\t\t\t'message' => $message,\n\t\t\t'headers' => '',\n\t\t);\n\n\t\t/**\n\t\t * Filters the contents of the new user notification email sent to the new user.\n\t\t *\n\t\t * @since 4.9.0\n\t\t *\n\t\t * @param array   $wp_new_user_notification_email {\n\t\t *     Used to build wp_mail().\n\t\t *\n\t\t *     @type string $to      The intended recipient - New user email address.\n\t\t *     @type string $subject The subject of the email.\n\t\t *     @type string $message The body of the email.\n\t\t *     @type string $headers The headers of the email.\n\t\t * }\n\t\t * @param WP_User $user     User object for new user.\n\t\t * @param string  $blogname The site title.\n\t\t */\n\t\t$wp_new_user_notification_email = apply_filters( 'wp_new_user_notification_email', $wp_new_user_notification_email, $user, $blogname );\n\n\t\twp_mail(\n\t\t\t$wp_new_user_notification_email['to'],\n\t\t\twp_specialchars_decode( sprintf( $wp_new_user_notification_email['subject'], $blogname ) ),\n\t\t\t$wp_new_user_notification_email['message'],\n\t\t\t$wp_new_user_notification_email['headers']\n\t\t);\n\n\t\tif ( $switched_locale ) {\n\t\t\trestore_previous_locale();\n\t\t}\n\t}\nendif;\n\nif ( ! function_exists( 'wp_nonce_tick' ) ) :\n\t/**\n\t * Returns the time-dependent variable for nonce creation.\n\t *\n\t * A nonce has a lifespan of two ticks. Nonces in their second tick may be\n\t * updated, e.g. by autosave.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @return float Float value rounded up to the next highest integer.\n\t */\n\tfunction wp_nonce_tick() {\n\t\t/**\n\t\t * Filters the lifespan of nonces in seconds.\n\t\t *\n\t\t * @since 2.5.0\n\t\t *\n\t\t * @param int $lifespan Lifespan of nonces in seconds. Default 86,400 seconds, or one day.\n\t\t */\n\t\t$nonce_life = apply_filters( 'nonce_life', DAY_IN_SECONDS );\n\n\t\treturn ceil( time() / ( $nonce_life / 2 ) );\n\t}\nendif;\n\nif ( ! function_exists( 'wp_verify_nonce' ) ) :\n\t/**\n\t * Verifies that a correct security nonce was used with time limit.\n\t *\n\t * A nonce is valid for 24 hours (by default).\n\t *\n\t * @since 2.0.3\n\t *\n\t * @param string     $nonce  Nonce value that was used for verification, usually via a form field.\n\t * @param string|int $action Should give context to what is taking place and be the same when nonce was created.\n\t * @return int|false 1 if the nonce is valid and generated between 0-12 hours ago,\n\t *                   2 if the nonce is valid and generated between 12-24 hours ago.\n\t *                   False if the nonce is invalid.\n\t */\n\tfunction wp_verify_nonce( $nonce, $action = -1 ) {\n\t\t$nonce = (string) $nonce;\n\t\t$user  = wp_get_current_user();\n\t\t$uid   = (int) $user->ID;\n\t\tif ( ! $uid ) {\n\t\t\t/**\n\t\t\t * Filters whether the user who generated the nonce is logged out.\n\t\t\t *\n\t\t\t * @since 3.5.0\n\t\t\t *\n\t\t\t * @param int    $uid    ID of the nonce-owning user.\n\t\t\t * @param string $action The nonce action.\n\t\t\t */\n\t\t\t$uid = apply_filters( 'nonce_user_logged_out', $uid, $action );\n\t\t}\n\n\t\tif ( empty( $nonce ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$token = wp_get_session_token();\n\t\t$i     = wp_nonce_tick();\n\n\t\t// Nonce generated 0-12 hours ago.\n\t\t$expected = substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );\n\t\tif ( hash_equals( $expected, $nonce ) ) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t// Nonce generated 12-24 hours ago.\n\t\t$expected = substr( wp_hash( ( $i - 1 ) . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );\n\t\tif ( hash_equals( $expected, $nonce ) ) {\n\t\t\treturn 2;\n\t\t}\n\n\t\t/**\n\t\t * Fires when nonce verification fails.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string     $nonce  The invalid nonce.\n\t\t * @param string|int $action The nonce action.\n\t\t * @param WP_User    $user   The current user object.\n\t\t * @param string     $token  The user's session token.\n\t\t */\n\t\tdo_action( 'wp_verify_nonce_failed', $nonce, $action, $user, $token );\n\n\t\t// Invalid nonce.\n\t\treturn false;\n\t}\nendif;\n\nif ( ! function_exists( 'wp_create_nonce' ) ) :\n\t/**\n\t * Creates a cryptographic token tied to a specific action, user, user session,\n\t * and window of time.\n\t *\n\t * @since 2.0.3\n\t * @since 4.0.0 Session tokens were integrated with nonce creation\n\t *\n\t * @param string|int $action Scalar value to add context to the nonce.\n\t * @return string The token.\n\t */\n\tfunction wp_create_nonce( $action = -1 ) {\n\t\t$user = wp_get_current_user();\n\t\t$uid  = (int) $user->ID;\n\t\tif ( ! $uid ) {\n\t\t\t/** This filter is documented in wp-includes/pluggable.php */\n\t\t\t$uid = apply_filters( 'nonce_user_logged_out', $uid, $action );\n\t\t}\n\n\t\t$token = wp_get_session_token();\n\t\t$i     = wp_nonce_tick();\n\n\t\treturn substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );\n\t}\nendif;\n\nif ( ! function_exists( 'wp_salt' ) ) :\n\t/**\n\t * Returns a salt to add to hashes.\n\t *\n\t * Salts are created using secret keys. Secret keys are located in two places:\n\t * in the database and in the wp-config.php file. The secret key in the database\n\t * is randomly generated and will be appended to the secret keys in wp-config.php.\n\t *\n\t * The secret keys in wp-config.php should be updated to strong, random keys to maximize\n\t * security. Below is an example of how the secret key constants are defined.\n\t * Do not paste this example directly into wp-config.php. Instead, have a\n\t * {@link https://api.wordpress.org/secret-key/1.1/salt/ secret key created} just\n\t * for you.\n\t *\n\t *     define('AUTH_KEY',         ' Xakm<o xQy rw4EMsLKM-?!T+,PFF})H4lzcW57AF0U@N@< >M%G4Yt>f`z]MON');\n\t *     define('SECURE_AUTH_KEY',  'LzJ}op]mr|6+![P}Ak:uNdJCJZd>(Hx.-Mh#Tz)pCIU#uGEnfFz|f ;;eU%/U^O~');\n\t *     define('LOGGED_IN_KEY',    '|i|Ux`9<p-h$aFf(qnT:sDO:D1P^wZ$$/Ra@miTJi9G;ddp_<q}6H1)o|a +&JCM');\n\t *     define('NONCE_KEY',        '%:R{[P|,s.KuMltH5}cI;/k<Gx~j!f0I)m_sIyu+&NJZ)-iO>z7X>QYR0Z_XnZ@|');\n\t *     define('AUTH_SALT',        'eZyT)-Naw]F8CwA*VaW#q*|.)g@o}||wf~@C-YSt}(dh_r6EbI#A,y|nU2{B#JBW');\n\t *     define('SECURE_AUTH_SALT', '!=oLUTXh,QW=H `}`L|9/^4-3 STz},T(w}W<I`.JjPi)<Bmf1v,HpGe}T1:Xt7n');\n\t *     define('LOGGED_IN_SALT',   '+XSqHc;@Q*K_b|Z?NC[3H!!EONbh.n<+=uKR:>*c(u`g~EJBf#8u#R{mUEZrozmm');\n\t *     define('NONCE_SALT',       'h`GXHhD>SLWVfg1(1(N{;.V!MoE(SfbA_ksP@&`+AycHcAV$+?@3q+rxV{%^VyKT');\n\t *\n\t * Salting passwords helps against tools which has stored hashed values of\n\t * common dictionary strings. The added values makes it harder to crack.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @link https://api.wordpress.org/secret-key/1.1/salt/ Create secrets for wp-config.php\n\t *\n\t * @param string $scheme Authentication scheme (auth, secure_auth, logged_in, nonce)\n\t * @return string Salt value\n\t */\n\tfunction wp_salt( $scheme = 'auth' ) {\n\t\tstatic $cached_salts = array();\n\t\tif ( isset( $cached_salts[ $scheme ] ) ) {\n\t\t\t/**\n\t\t\t * Filters the WordPress salt.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t *\n\t\t\t * @param string $cached_salt Cached salt for the given scheme.\n\t\t\t * @param string $scheme      Authentication scheme. Values include 'auth',\n\t\t\t *                            'secure_auth', 'logged_in', and 'nonce'.\n\t\t\t */\n\t\t\treturn apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );\n\t\t}\n\n\t\tstatic $duplicated_keys;\n\t\tif ( null === $duplicated_keys ) {\n\t\t\t$duplicated_keys = array( 'put your unique phrase here' => true );\n\t\t\tforeach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {\n\t\t\t\tforeach ( array( 'KEY', 'SALT' ) as $second ) {\n\t\t\t\t\tif ( ! defined( \"{$first}_{$second}\" ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$value                     = constant( \"{$first}_{$second}\" );\n\t\t\t\t\t$duplicated_keys[ $value ] = isset( $duplicated_keys[ $value ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$values = array(\n\t\t\t'key'  => '',\n\t\t\t'salt' => '',\n\t\t);\n\t\tif ( defined( 'SECRET_KEY' ) && SECRET_KEY && empty( $duplicated_keys[ SECRET_KEY ] ) ) {\n\t\t\t$values['key'] = SECRET_KEY;\n\t\t}\n\t\tif ( 'auth' === $scheme && defined( 'SECRET_SALT' ) && SECRET_SALT && empty( $duplicated_keys[ SECRET_SALT ] ) ) {\n\t\t\t$values['salt'] = SECRET_SALT;\n\t\t}\n\n\t\tif ( in_array( $scheme, array( 'auth', 'secure_auth', 'logged_in', 'nonce' ), true ) ) {\n\t\t\tforeach ( array( 'key', 'salt' ) as $type ) {\n\t\t\t\t$const = strtoupper( \"{$scheme}_{$type}\" );\n\t\t\t\tif ( defined( $const ) && constant( $const ) && empty( $duplicated_keys[ constant( $const ) ] ) ) {\n\t\t\t\t\t$values[ $type ] = constant( $const );\n\t\t\t\t} elseif ( ! $values[ $type ] ) {\n\t\t\t\t\t$values[ $type ] = get_site_option( \"{$scheme}_{$type}\" );\n\t\t\t\t\tif ( ! $values[ $type ] ) {\n\t\t\t\t\t\t$values[ $type ] = wp_generate_password( 64, true, true );\n\t\t\t\t\t\tupdate_site_option( \"{$scheme}_{$type}\", $values[ $type ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif ( ! $values['key'] ) {\n\t\t\t\t$values['key'] = get_site_option( 'secret_key' );\n\t\t\t\tif ( ! $values['key'] ) {\n\t\t\t\t\t$values['key'] = wp_generate_password( 64, true, true );\n\t\t\t\t\tupdate_site_option( 'secret_key', $values['key'] );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] );\n\t\t}\n\n\t\t$cached_salts[ $scheme ] = $values['key'] . $values['salt'];\n\n\t\t/** This filter is documented in wp-includes/pluggable.php */\n\t\treturn apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );\n\t}\nendif;\n\nif ( ! function_exists( 'wp_hash' ) ) :\n\t/**\n\t * Get hash of given string.\n\t *\n\t * @since 2.0.3\n\t *\n\t * @param string $data   Plain text to hash\n\t * @param string $scheme Authentication scheme (auth, secure_auth, logged_in, nonce)\n\t * @return string Hash of $data\n\t */\n\tfunction wp_hash( $data, $scheme = 'auth' ) {\n\t\t$salt = wp_salt( $scheme );\n\n\t\treturn hash_hmac( 'md5', $data, $salt );\n\t}\nendif;\n\nif ( ! function_exists( 'wp_hash_password' ) ) :\n\t/**\n\t * Create a hash (encrypt) of a plain text password.\n\t *\n\t * For integration with other applications, this function can be overwritten to\n\t * instead use the other package password checking algorithm.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @global PasswordHash $wp_hasher PHPass object\n\t *\n\t * @param string $password Plain text user password to hash\n\t * @return string The hash string of the password\n\t */\n\tfunction wp_hash_password( $password ) {\n\t\tglobal $wp_hasher;\n\n\t\tif ( empty( $wp_hasher ) ) {\n\t\t\trequire_once ABSPATH . WPINC . '/class-phpass.php';\n\t\t\t// By default, use the portable hash from phpass.\n\t\t\t$wp_hasher = new PasswordHash( 8, true );\n\t\t}\n\n\t\treturn $wp_hasher->HashPassword( trim( $password ) );\n\t}\nendif;\n\nif ( ! function_exists( 'wp_check_password' ) ) :\n\t/**\n\t * Checks the plaintext password against the encrypted Password.\n\t *\n\t * Maintains compatibility between old version and the new cookie authentication\n\t * protocol using PHPass library. The $hash parameter is the encrypted password\n\t * and the function compares the plain text password when encrypted similarly\n\t * against the already encrypted password to see if they match.\n\t *\n\t * For integration with other applications, this function can be overwritten to\n\t * instead use the other package password checking algorithm.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @global PasswordHash $wp_hasher PHPass object used for checking the password\n\t *                                 against the $hash + $password\n\t * @uses PasswordHash::CheckPassword\n\t *\n\t * @param string     $password Plaintext user's password\n\t * @param string     $hash     Hash of the user's password to check against.\n\t * @param string|int $user_id  Optional. User ID.\n\t * @return bool False, if the $password does not match the hashed password\n\t */\n\tfunction wp_check_password( $password, $hash, $user_id = '' ) {\n\t\tglobal $wp_hasher;\n\n\t\t// If the hash is still md5...\n\t\tif ( strlen( $hash ) <= 32 ) {\n\t\t\t$check = hash_equals( $hash, md5( $password ) );\n\t\t\tif ( $check && $user_id ) {\n\t\t\t\t// Rehash using new hash.\n\t\t\t\twp_set_password( $password, $user_id );\n\t\t\t\t$hash = wp_hash_password( $password );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters whether the plaintext password matches the encrypted password.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t *\n\t\t\t * @param bool       $check    Whether the passwords match.\n\t\t\t * @param string     $password The plaintext password.\n\t\t\t * @param string     $hash     The hashed password.\n\t\t\t * @param string|int $user_id  User ID. Can be empty.\n\t\t\t */\n\t\t\treturn apply_filters( 'check_password', $check, $password, $hash, $user_id );\n\t\t}\n\n\t\t// If the stored hash is longer than an MD5,\n\t\t// presume the new style phpass portable hash.\n\t\tif ( empty( $wp_hasher ) ) {\n\t\t\trequire_once ABSPATH . WPINC . '/class-phpass.php';\n\t\t\t// By default, use the portable hash from phpass.\n\t\t\t$wp_hasher = new PasswordHash( 8, true );\n\t\t}\n\n\t\t$check = $wp_hasher->CheckPassword( $password, $hash );\n\n\t\t/** This filter is documented in wp-includes/pluggable.php */\n\t\treturn apply_filters( 'check_password', $check, $password, $hash, $user_id );\n\t}\nendif;\n\nif ( ! function_exists( 'wp_generate_password' ) ) :\n\t/**\n\t * Generates a random password drawn from the defined set of characters.\n\t *\n\t * Uses wp_rand() is used to create passwords with far less predictability\n\t * than similar native PHP functions like `rand()` or `mt_rand()`.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param int  $length              Optional. The length of password to generate. Default 12.\n\t * @param bool $special_chars       Optional. Whether to include standard special characters.\n\t *                                  Default true.\n\t * @param bool $extra_special_chars Optional. Whether to include other special characters.\n\t *                                  Used when generating secret keys and salts. Default false.\n\t * @return string The random password.\n\t */\n\tfunction wp_generate_password( $length = 12, $special_chars = true, $extra_special_chars = false ) {\n\t\t$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n\t\tif ( $special_chars ) {\n\t\t\t$chars .= '!@#$%^&*()';\n\t\t}\n\t\tif ( $extra_special_chars ) {\n\t\t\t$chars .= '-_ []{}<>~`+=,.;:/?|';\n\t\t}\n\n\t\t$password = '';\n\t\tfor ( $i = 0; $i < $length; $i++ ) {\n\t\t\t$password .= substr( $chars, wp_rand( 0, strlen( $chars ) - 1 ), 1 );\n\t\t}\n\n\t\t/**\n\t\t * Filters the randomly-generated password.\n\t\t *\n\t\t * @since 3.0.0\n\t\t * @since 5.3.0 Added the `$length`, `$special_chars`, and `$extra_special_chars` parameters.\n\t\t *\n\t\t * @param string $password            The generated password.\n\t\t * @param int    $length              The length of password to generate.\n\t\t * @param bool   $special_chars       Whether to include standard special characters.\n\t\t * @param bool   $extra_special_chars Whether to include other special characters.\n\t\t */\n\t\treturn apply_filters( 'random_password', $password, $length, $special_chars, $extra_special_chars );\n\t}\nendif;\n\nif ( ! function_exists( 'wp_rand' ) ) :\n\t/**\n\t * Generates a random number.\n\t *\n\t * @since 2.6.2\n\t * @since 4.4.0 Uses PHP7 random_int() or the random_compat library if available.\n\t *\n\t * @global string $rnd_value\n\t *\n\t * @param int $min Lower limit for the generated number\n\t * @param int $max Upper limit for the generated number\n\t * @return int A random number between min and max\n\t */\n\tfunction wp_rand( $min = 0, $max = 0 ) {\n\t\tglobal $rnd_value;\n\n\t\t// Some misconfigured 32-bit environments (Entropy PHP, for example)\n\t\t// truncate integers larger than PHP_INT_MAX to PHP_INT_MAX rather than overflowing them to floats.\n\t\t$max_random_number = 3000000000 === 2147483647 ? (float) '4294967295' : 4294967295; // 4294967295 = 0xffffffff\n\n\t\t// We only handle ints, floats are truncated to their integer value.\n\t\t$min = (int) $min;\n\t\t$max = (int) $max;\n\n\t\t// Use PHP's CSPRNG, or a compatible method.\n\t\tstatic $use_random_int_functionality = true;\n\t\tif ( $use_random_int_functionality ) {\n\t\t\ttry {\n\t\t\t\t$_max = ( 0 != $max ) ? $max : $max_random_number;\n\t\t\t\t// wp_rand() can accept arguments in either order, PHP cannot.\n\t\t\t\t$_max = max( $min, $_max );\n\t\t\t\t$_min = min( $min, $_max );\n\t\t\t\t$val  = random_int( $_min, $_max );\n\t\t\t\tif ( false !== $val ) {\n\t\t\t\t\treturn absint( $val );\n\t\t\t\t} else {\n\t\t\t\t\t$use_random_int_functionality = false;\n\t\t\t\t}\n\t\t\t} catch ( Error $e ) {\n\t\t\t\t$use_random_int_functionality = false;\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\t$use_random_int_functionality = false;\n\t\t\t}\n\t\t}\n\n\t\t// Reset $rnd_value after 14 uses.\n\t\t// 32 (md5) + 40 (sha1) + 40 (sha1) / 8 = 14 random numbers from $rnd_value.\n\t\tif ( strlen( $rnd_value ) < 8 ) {\n\t\t\tif ( defined( 'WP_SETUP_CONFIG' ) ) {\n\t\t\t\tstatic $seed = '';\n\t\t\t} else {\n\t\t\t\t$seed = get_transient( 'random_seed' );\n\t\t\t}\n\t\t\t$rnd_value  = md5( uniqid( microtime() . mt_rand(), true ) . $seed );\n\t\t\t$rnd_value .= sha1( $rnd_value );\n\t\t\t$rnd_value .= sha1( $rnd_value . $seed );\n\t\t\t$seed       = md5( $seed . $rnd_value );\n\t\t\tif ( ! defined( 'WP_SETUP_CONFIG' ) && ! defined( 'WP_INSTALLING' ) ) {\n\t\t\t\tset_transient( 'random_seed', $seed );\n\t\t\t}\n\t\t}\n\n\t\t// Take the first 8 digits for our value.\n\t\t$value = substr( $rnd_value, 0, 8 );\n\n\t\t// Strip the first eight, leaving the remainder for the next call to wp_rand().\n\t\t$rnd_value = substr( $rnd_value, 8 );\n\n\t\t$value = abs( hexdec( $value ) );\n\n\t\t// Reduce the value to be within the min - max range.\n\t\tif ( 0 != $max ) {\n\t\t\t$value = $min + ( $max - $min + 1 ) * $value / ( $max_random_number + 1 );\n\t\t}\n\n\t\treturn abs( intval( $value ) );\n\t}\nendif;\n\nif ( ! function_exists( 'wp_set_password' ) ) :\n\t/**\n\t * Updates the user's password with a new encrypted one.\n\t *\n\t * For integration with other applications, this function can be overwritten to\n\t * instead use the other package password checking algorithm.\n\t *\n\t * Please note: This function should be used sparingly and is really only meant for single-time\n\t * application. Leveraging this improperly in a plugin or theme could result in an endless loop\n\t * of password resets if precautions are not taken to ensure it does not execute on every page load.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @global wpdb $wpdb WordPress database abstraction object.\n\t *\n\t * @param string $password The plaintext new user password\n\t * @param int    $user_id  User ID\n\t */\n\tfunction wp_set_password( $password, $user_id ) {\n\t\tglobal $wpdb;\n\n\t\t$hash = wp_hash_password( $password );\n\t\t$wpdb->update(\n\t\t\t$wpdb->users,\n\t\t\tarray(\n\t\t\t\t'user_pass'           => $hash,\n\t\t\t\t'user_activation_key' => '',\n\t\t\t),\n\t\t\tarray( 'ID' => $user_id )\n\t\t);\n\n\t\tclean_user_cache( $user_id );\n\t}\nendif;\n\nif ( ! function_exists( 'get_avatar' ) ) :\n\t/**\n\t * Retrieve the avatar `<img>` tag for a user, email address, MD5 hash, comment, or post.\n\t *\n\t * @since 2.5.0\n\t * @since 4.2.0 Optional `$args` parameter added.\n\t *\n\t * @param mixed  $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,\n\t *                            user email, WP_User object, WP_Post object, or WP_Comment object.\n\t * @param int    $size        Optional. Height and width of the avatar image file in pixels. Default 96.\n\t * @param string $default     Optional. URL for the default image or a default type. Accepts '404'\n\t *                            (return a 404 instead of a default image), 'retro' (8bit), 'monsterid'\n\t *                            (monster), 'wavatar' (cartoon face), 'indenticon' (the \"quilt\"),\n\t *                            'mystery', 'mm', or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF),\n\t *                            or 'gravatar_default' (the Gravatar logo). Default is the value of the\n\t *                            'avatar_default' option, with a fallback of 'mystery'.\n\t * @param string $alt         Optional. Alternative text to use in img tag. Default empty.\n\t * @param array  $args {\n\t *     Optional. Extra arguments to retrieve the avatar.\n\t *\n\t *     @type int          $height        Display height of the avatar in pixels. Defaults to $size.\n\t *     @type int          $width         Display width of the avatar in pixels. Defaults to $size.\n\t *     @type bool         $force_default Whether to always show the default image, never the Gravatar. Default false.\n\t *     @type string       $rating        What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are\n\t *                                       judged in that order. Default is the value of the 'avatar_rating' option.\n\t *     @type string       $scheme        URL scheme to use. See set_url_scheme() for accepted values.\n\t *                                       Default null.\n\t *     @type array|string $class         Array or string of additional classes to add to the img element.\n\t *                                       Default null.\n\t *     @type bool         $force_display Whether to always show the avatar - ignores the show_avatars option.\n\t *                                       Default false.\n\t *     @type string       $loading       Value for the `loading` attribute.\n\t *                                       Default null.\n\t *     @type string       $extra_attr    HTML attributes to insert in the IMG element. Is not sanitized. Default empty.\n\t * }\n\t * @return string|false `<img>` tag for the user's avatar. False on failure.\n\t */\n\tfunction get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args = null ) {\n\t\t$defaults = array(\n\t\t\t// get_avatar_data() args.\n\t\t\t'size'          => 96,\n\t\t\t'height'        => null,\n\t\t\t'width'         => null,\n\t\t\t'default'       => get_option( 'avatar_default', 'mystery' ),\n\t\t\t'force_default' => false,\n\t\t\t'rating'        => get_option( 'avatar_rating' ),\n\t\t\t'scheme'        => null,\n\t\t\t'alt'           => '',\n\t\t\t'class'         => null,\n\t\t\t'force_display' => false,\n\t\t\t'loading'       => null,\n\t\t\t'extra_attr'    => '',\n\t\t);\n\n\t\tif ( wp_lazy_loading_enabled( 'img', 'get_avatar' ) ) {\n\t\t\t$defaults['loading'] = 'lazy';\n\t\t}\n\n\t\tif ( empty( $args ) ) {\n\t\t\t$args = array();\n\t\t}\n\n\t\t$args['size']    = (int) $size;\n\t\t$args['default'] = $default;\n\t\t$args['alt']     = $alt;\n\n\t\t$args = wp_parse_args( $args, $defaults );\n\n\t\tif ( empty( $args['height'] ) ) {\n\t\t\t$args['height'] = $args['size'];\n\t\t}\n\t\tif ( empty( $args['width'] ) ) {\n\t\t\t$args['width'] = $args['size'];\n\t\t}\n\n\t\tif ( is_object( $id_or_email ) && isset( $id_or_email->comment_ID ) ) {\n\t\t\t$id_or_email = get_comment( $id_or_email );\n\t\t}\n\n\t\t/**\n\t\t * Allows the HTML for a user's avatar to be returned early.\n\t\t *\n\t\t * Passing a non-null value will effectively short-circuit get_avatar(), passing\n\t\t * the value through the {@see 'get_avatar'} filter and returning early.\n\t\t *\n\t\t * @since 4.2.0\n\t\t *\n\t\t * @param string|null $avatar      HTML for the user's avatar. Default null.\n\t\t * @param mixed       $id_or_email The avatar to retrieve. Accepts a user_id, Gravatar MD5 hash,\n\t\t *                                 user email, WP_User object, WP_Post object, or WP_Comment object.\n\t\t * @param array       $args        Arguments passed to get_avatar_url(), after processing.\n\t\t */\n\t\t$avatar = apply_filters( 'pre_get_avatar', null, $id_or_email, $args );\n\n\t\tif ( ! is_null( $avatar ) ) {\n\t\t\t/** This filter is documented in wp-includes/pluggable.php */\n\t\t\treturn apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args );\n\t\t}\n\n\t\tif ( ! $args['force_display'] && ! get_option( 'show_avatars' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$url2x = get_avatar_url( $id_or_email, array_merge( $args, array( 'size' => $args['size'] * 2 ) ) );\n\n\t\t$args = get_avatar_data( $id_or_email, $args );\n\n\t\t$url = $args['url'];\n\n\t\tif ( ! $url || is_wp_error( $url ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$class = array( 'avatar', 'avatar-' . (int) $args['size'], 'photo' );\n\n\t\tif ( ! $args['found_avatar'] || $args['force_default'] ) {\n\t\t\t$class[] = 'avatar-default';\n\t\t}\n\n\t\tif ( $args['class'] ) {\n\t\t\tif ( is_array( $args['class'] ) ) {\n\t\t\t\t$class = array_merge( $class, $args['class'] );\n\t\t\t} else {\n\t\t\t\t$class[] = $args['class'];\n\t\t\t}\n\t\t}\n\n\t\t// Add `loading` attribute.\n\t\t$extra_attr = $args['extra_attr'];\n\t\t$loading    = $args['loading'];\n\n\t\tif ( in_array( $loading, array( 'lazy', 'eager' ), true ) && ! preg_match( '/\\bloading\\s*=/', $extra_attr ) ) {\n\t\t\tif ( ! empty( $extra_attr ) ) {\n\t\t\t\t$extra_attr .= ' ';\n\t\t\t}\n\n\t\t\t$extra_attr .= \"loading='{$loading}'\";\n\t\t}\n\n\t\t$avatar = sprintf(\n\t\t\t\"<img alt='%s' src='%s' srcset='%s' class='%s' height='%d' width='%d' %s/>\",\n\t\t\tesc_attr( $args['alt'] ),\n\t\t\tesc_url( $url ),\n\t\t\tesc_url( $url2x ) . ' 2x',\n\t\t\tesc_attr( join( ' ', $class ) ),\n\t\t\t(int) $args['height'],\n\t\t\t(int) $args['width'],\n\t\t\t$extra_attr\n\t\t);\n\n\t\t/**\n\t\t * Filters the HTML for a user's avatar.\n\t\t *\n\t\t * @since 2.5.0\n\t\t * @since 4.2.0 The `$args` parameter was added.\n\t\t *\n\t\t * @param string $avatar      HTML for the user's avatar.\n\t\t * @param mixed  $id_or_email The avatar to retrieve. Accepts a user_id, Gravatar MD5 hash,\n\t\t *                            user email, WP_User object, WP_Post object, or WP_Comment object.\n\t\t * @param int    $size        Square avatar width and height in pixels to retrieve.\n\t\t * @param string $default     URL for the default image or a default type. Accepts '404', 'retro', 'monsterid',\n\t\t *                            'wavatar', 'indenticon', 'mystery', 'mm', 'mysteryman', 'blank', or 'gravatar_default'.\n\t\t *                            Default is the value of the 'avatar_default' option, with a fallback of 'mystery'.\n\t\t * @param string $alt         Alternative text to use in the avatar image tag. Default empty.\n\t\t * @param array  $args        Arguments passed to get_avatar_data(), after processing.\n\t\t */\n\t\treturn apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args );\n\t}\nendif;\n\nif ( ! function_exists( 'wp_text_diff' ) ) :\n\t/**\n\t * Displays a human readable HTML representation of the difference between two strings.\n\t *\n\t * The Diff is available for getting the changes between versions. The output is\n\t * HTML, so the primary use is for displaying the changes. If the two strings\n\t * are equivalent, then an empty string will be returned.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @see wp_parse_args() Used to change defaults to user defined settings.\n\t * @uses Text_Diff\n\t * @uses WP_Text_Diff_Renderer_Table\n\t *\n\t * @param string       $left_string  \"old\" (left) version of string\n\t * @param string       $right_string \"new\" (right) version of string\n\t * @param string|array $args {\n\t *     Associative array of options to pass to WP_Text_Diff_Renderer_Table().\n\t *\n\t *     @type string $title           Titles the diff in a manner compatible\n\t *                                   with the output. Default empty.\n\t *     @type string $title_left      Change the HTML to the left of the title.\n\t *                                   Default empty.\n\t *     @type string $title_right     Change the HTML to the right of the title.\n\t *                                   Default empty.\n\t *     @type bool   $show_split_view True for split view (two columns), false for\n\t *                                   un-split view (single column). Default true.\n\t * }\n\t * @return string Empty string if strings are equivalent or HTML with differences.\n\t */\n\tfunction wp_text_diff( $left_string, $right_string, $args = null ) {\n\t\t$defaults = array(\n\t\t\t'title'           => '',\n\t\t\t'title_left'      => '',\n\t\t\t'title_right'     => '',\n\t\t\t'show_split_view' => true,\n\t\t);\n\t\t$args     = wp_parse_args( $args, $defaults );\n\n\t\tif ( ! class_exists( 'WP_Text_Diff_Renderer_Table', false ) ) {\n\t\t\trequire ABSPATH . WPINC . '/wp-diff.php';\n\t\t}\n\n\t\t$left_string  = normalize_whitespace( $left_string );\n\t\t$right_string = normalize_whitespace( $right_string );\n\n\t\t$left_lines  = explode( \"\\n\", $left_string );\n\t\t$right_lines = explode( \"\\n\", $right_string );\n\t\t$text_diff   = new Text_Diff( $left_lines, $right_lines );\n\t\t$renderer    = new WP_Text_Diff_Renderer_Table( $args );\n\t\t$diff        = $renderer->render( $text_diff );\n\n\t\tif ( ! $diff ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$r = \"<table class='diff'>\\n\";\n\n\t\tif ( ! empty( $args['show_split_view'] ) ) {\n\t\t\t$r .= \"<col class='content diffsplit left' /><col class='content diffsplit middle' /><col class='content diffsplit right' />\";\n\t\t} else {\n\t\t\t$r .= \"<col class='content' />\";\n\t\t}\n\n\t\tif ( $args['title'] || $args['title_left'] || $args['title_right'] ) {\n\t\t\t$r .= '<thead>';\n\t\t}\n\t\tif ( $args['title'] ) {\n\t\t\t$r .= \"<tr class='diff-title'><th colspan='4'>$args[title]</th></tr>\\n\";\n\t\t}\n\t\tif ( $args['title_left'] || $args['title_right'] ) {\n\t\t\t$r .= \"<tr class='diff-sub-title'>\\n\";\n\t\t\t$r .= \"\\t<td></td><th>$args[title_left]</th>\\n\";\n\t\t\t$r .= \"\\t<td></td><th>$args[title_right]</th>\\n\";\n\t\t\t$r .= \"</tr>\\n\";\n\t\t}\n\t\tif ( $args['title'] || $args['title_left'] || $args['title_right'] ) {\n\t\t\t$r .= \"</thead>\\n\";\n\t\t}\n\n\t\t$r .= \"<tbody>\\n$diff\\n</tbody>\\n\";\n\t\t$r .= '</table>';\n\n\t\treturn $r;\n\t}\nendif;\n", "num_lines": 2838}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * The plugin API is located in this file, which allows for creating actions\n * and filters and hooking functions, and methods. The functions or methods will\n * then be run when the action or filter is called.\n *\n * The API callback examples reference functions, but can be methods of classes.\n * To hook methods, you'll need to pass an array one of two ways.\n *\n * Any of the syntaxes explained in the PHP documentation for the\n * {@link https://www.php.net/manual/en/language.pseudo-types.php#language.types.callback 'callback'}\n * type are valid.\n *\n * Also see the {@link https://developer.wordpress.org/plugins/ Plugin API} for\n * more information and examples on how to use a lot of these functions.\n *\n * This file should have no external dependencies.\n *\n * @package WordPress\n * @subpackage Plugin\n * @since 1.5.0\n */\n\n// Initialize the filter globals.\nrequire __DIR__ . '/class-wp-hook.php';\n\n/** @var WP_Hook[] $wp_filter */\nglobal $wp_filter, $wp_actions, $wp_current_filter;\n\nif ( $wp_filter ) {\n\t$wp_filter = WP_Hook::build_preinitialized_hooks( $wp_filter );\n} else {\n\t$wp_filter = array();\n}\n\nif ( ! isset( $wp_actions ) ) {\n\t$wp_actions = array();\n}\n\nif ( ! isset( $wp_current_filter ) ) {\n\t$wp_current_filter = array();\n}\n\n/**\n * Hook a function or method to a specific filter action.\n *\n * WordPress offers filter hooks to allow plugins to modify\n * various types of internal data at runtime.\n *\n * A plugin can modify data by binding a callback to a filter hook. When the filter\n * is later applied, each bound callback is run in order of priority, and given\n * the opportunity to modify a value by returning a new value.\n *\n * The following example shows how a callback function is bound to a filter hook.\n *\n * Note that `$example` is passed to the callback, (maybe) modified, then returned:\n *\n *     function example_callback( $example ) {\n *         // Maybe modify $example in some way.\n *         return $example;\n *     }\n *     add_filter( 'example_filter', 'example_callback' );\n *\n * Bound callbacks can accept from none to the total number of arguments passed as parameters\n * in the corresponding apply_filters() call.\n *\n * In other words, if an apply_filters() call passes four total arguments, callbacks bound to\n * it can accept none (the same as 1) of the arguments or up to four. The important part is that\n * the `$accepted_args` value must reflect the number of arguments the bound callback *actually*\n * opted to accept. If no arguments were accepted by the callback that is considered to be the\n * same as accepting 1 argument. For example:\n *\n *     // Filter call.\n *     $value = apply_filters( 'hook', $value, $arg2, $arg3 );\n *\n *     // Accepting zero/one arguments.\n *     function example_callback() {\n *         ...\n *         return 'some value';\n *     }\n *     add_filter( 'hook', 'example_callback' ); // Where $priority is default 10, $accepted_args is default 1.\n *\n *     // Accepting two arguments (three possible).\n *     function example_callback( $value, $arg2 ) {\n *         ...\n *         return $maybe_modified_value;\n *     }\n *     add_filter( 'hook', 'example_callback', 10, 2 ); // Where $priority is 10, $accepted_args is 2.\n *\n * *Note:* The function will return true whether or not the callback is valid.\n * It is up to you to take care. This is done for optimization purposes, so\n * everything is as quick as possible.\n *\n * @since 0.71\n *\n * @global array $wp_filter A multidimensional array of all hooks and the callbacks hooked to them.\n *\n * @param string   $tag             The name of the filter to hook the $function_to_add callback to.\n * @param callable $function_to_add The callback to be run when the filter is applied.\n * @param int      $priority        Optional. Used to specify the order in which the functions\n *                                  associated with a particular action are executed.\n *                                  Lower numbers correspond with earlier execution,\n *                                  and functions with the same priority are executed\n *                                  in the order in which they were added to the action. Default 10.\n * @param int      $accepted_args   Optional. The number of arguments the function accepts. Default 1.\n * @return true\n */\nfunction add_filter( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) {\n\tglobal $wp_filter;\n\tif ( ! isset( $wp_filter[ $tag ] ) ) {\n\t\t$wp_filter[ $tag ] = new WP_Hook();\n\t}\n\t$wp_filter[ $tag ]->add_filter( $tag, $function_to_add, $priority, $accepted_args );\n\treturn true;\n}\n\n/**\n * Check if any filter has been registered for a hook.\n *\n * @since 2.5.0\n *\n * @global array $wp_filter Stores all of the filters and actions.\n *\n * @param string        $tag               The name of the filter hook.\n * @param callable|bool $function_to_check Optional. The callback to check for. Default false.\n * @return false|int If $function_to_check is omitted, returns boolean for whether the hook has\n *                   anything registered. When checking a specific function, the priority of that\n *                   hook is returned, or false if the function is not attached. When using the\n *                   $function_to_check argument, this function may return a non-boolean value\n *                   that evaluates to false (e.g.) 0, so use the === operator for testing the\n *                   return value.\n */\nfunction has_filter( $tag, $function_to_check = false ) {\n\tglobal $wp_filter;\n\n\tif ( ! isset( $wp_filter[ $tag ] ) ) {\n\t\treturn false;\n\t}\n\n\treturn $wp_filter[ $tag ]->has_filter( $tag, $function_to_check );\n}\n\n/**\n * Calls the callback functions that have been added to a filter hook.\n *\n * The callback functions attached to the filter hook are invoked by calling\n * this function. This function can be used to create a new filter hook by\n * simply calling this function with the name of the new hook specified using\n * the `$tag` parameter.\n *\n * The function also allows for multiple additional arguments to be passed to hooks.\n *\n * Example usage:\n *\n *     // The filter callback function.\n *     function example_callback( $string, $arg1, $arg2 ) {\n *         // (maybe) modify $string.\n *         return $string;\n *     }\n *     add_filter( 'example_filter', 'example_callback', 10, 3 );\n *\n *     /*\n *      * Apply the filters by calling the 'example_callback()' function\n *      * that's hooked onto `example_filter` above.\n *      *\n *      * - 'example_filter' is the filter hook.\n *      * - 'filter me' is the value being filtered.\n *      * - $arg1 and $arg2 are the additional arguments passed to the callback.\n *     $value = apply_filters( 'example_filter', 'filter me', $arg1, $arg2 );\n *\n * @since 0.71\n *\n * @global array $wp_filter         Stores all of the filters and actions.\n * @global array $wp_current_filter Stores the list of current filters with the current one last.\n *\n * @param string $tag     The name of the filter hook.\n * @param mixed  $value   The value to filter.\n * @param mixed  ...$args Additional parameters to pass to the callback functions.\n * @return mixed The filtered value after all hooked functions are applied to it.\n */\nfunction apply_filters( $tag, $value ) {\n\tglobal $wp_filter, $wp_current_filter;\n\n\t$args = func_get_args();\n\n\t// Do 'all' actions first.\n\tif ( isset( $wp_filter['all'] ) ) {\n\t\t$wp_current_filter[] = $tag;\n\t\t_wp_call_all_hook( $args );\n\t}\n\n\tif ( ! isset( $wp_filter[ $tag ] ) ) {\n\t\tif ( isset( $wp_filter['all'] ) ) {\n\t\t\tarray_pop( $wp_current_filter );\n\t\t}\n\t\treturn $value;\n\t}\n\n\tif ( ! isset( $wp_filter['all'] ) ) {\n\t\t$wp_current_filter[] = $tag;\n\t}\n\n\t// Don't pass the tag name to WP_Hook.\n\tarray_shift( $args );\n\n\t$filtered = $wp_filter[ $tag ]->apply_filters( $value, $args );\n\n\tarray_pop( $wp_current_filter );\n\n\treturn $filtered;\n}\n\n/**\n * Calls the callback functions that have been added to a filter hook, specifying arguments in an array.\n *\n * @since 3.0.0\n *\n * @see apply_filters() This function is identical, but the arguments passed to the\n * functions hooked to `$tag` are supplied using an array.\n *\n * @global array $wp_filter         Stores all of the filters and actions.\n * @global array $wp_current_filter Stores the list of current filters with the current one last.\n *\n * @param string $tag  The name of the filter hook.\n * @param array  $args The arguments supplied to the functions hooked to $tag.\n * @return mixed The filtered value after all hooked functions are applied to it.\n */\nfunction apply_filters_ref_array( $tag, $args ) {\n\tglobal $wp_filter, $wp_current_filter;\n\n\t// Do 'all' actions first.\n\tif ( isset( $wp_filter['all'] ) ) {\n\t\t$wp_current_filter[] = $tag;\n\t\t$all_args            = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection\n\t\t_wp_call_all_hook( $all_args );\n\t}\n\n\tif ( ! isset( $wp_filter[ $tag ] ) ) {\n\t\tif ( isset( $wp_filter['all'] ) ) {\n\t\t\tarray_pop( $wp_current_filter );\n\t\t}\n\t\treturn $args[0];\n\t}\n\n\tif ( ! isset( $wp_filter['all'] ) ) {\n\t\t$wp_current_filter[] = $tag;\n\t}\n\n\t$filtered = $wp_filter[ $tag ]->apply_filters( $args[0], $args );\n\n\tarray_pop( $wp_current_filter );\n\n\treturn $filtered;\n}\n\n/**\n * Removes a function from a specified filter hook.\n *\n * This function removes a function attached to a specified filter hook. This\n * method can be used to remove default functions attached to a specific filter\n * hook and possibly replace them with a substitute.\n *\n * To remove a hook, the $function_to_remove and $priority arguments must match\n * when the hook was added. This goes for both filters and actions. No warning\n * will be given on removal failure.\n *\n * @since 1.2.0\n *\n * @global array $wp_filter Stores all of the filters and actions.\n *\n * @param string   $tag                The filter hook to which the function to be removed is hooked.\n * @param callable $function_to_remove The name of the function which should be removed.\n * @param int      $priority           Optional. The priority of the function. Default 10.\n * @return bool    Whether the function existed before it was removed.\n */\nfunction remove_filter( $tag, $function_to_remove, $priority = 10 ) {\n\tglobal $wp_filter;\n\n\t$r = false;\n\tif ( isset( $wp_filter[ $tag ] ) ) {\n\t\t$r = $wp_filter[ $tag ]->remove_filter( $tag, $function_to_remove, $priority );\n\t\tif ( ! $wp_filter[ $tag ]->callbacks ) {\n\t\t\tunset( $wp_filter[ $tag ] );\n\t\t}\n\t}\n\n\treturn $r;\n}\n\n/**\n * Remove all of the hooks from a filter.\n *\n * @since 2.7.0\n *\n * @global array $wp_filter Stores all of the filters and actions.\n *\n * @param string   $tag      The filter to remove hooks from.\n * @param int|bool $priority Optional. The priority number to remove. Default false.\n * @return true True when finished.\n */\nfunction remove_all_filters( $tag, $priority = false ) {\n\tglobal $wp_filter;\n\n\tif ( isset( $wp_filter[ $tag ] ) ) {\n\t\t$wp_filter[ $tag ]->remove_all_filters( $priority );\n\t\tif ( ! $wp_filter[ $tag ]->has_filters() ) {\n\t\t\tunset( $wp_filter[ $tag ] );\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Retrieve the name of the current filter or action.\n *\n * @since 2.5.0\n *\n * @global array $wp_current_filter Stores the list of current filters with the current one last\n *\n * @return string Hook name of the current filter or action.\n */\nfunction current_filter() {\n\tglobal $wp_current_filter;\n\treturn end( $wp_current_filter );\n}\n\n/**\n * Retrieve the name of the current action.\n *\n * @since 3.9.0\n *\n * @return string Hook name of the current action.\n */\nfunction current_action() {\n\treturn current_filter();\n}\n\n/**\n * Retrieve the name of a filter currently being processed.\n *\n * The function current_filter() only returns the most recent filter or action\n * being executed. did_action() returns true once the action is initially\n * processed.\n *\n * This function allows detection for any filter currently being\n * executed (despite not being the most recent filter to fire, in the case of\n * hooks called from hook callbacks) to be verified.\n *\n * @since 3.9.0\n *\n * @see current_filter()\n * @see did_action()\n * @global array $wp_current_filter Current filter.\n *\n * @param null|string $filter Optional. Filter to check. Defaults to null, which\n *                            checks if any filter is currently being run.\n * @return bool Whether the filter is currently in the stack.\n */\nfunction doing_filter( $filter = null ) {\n\tglobal $wp_current_filter;\n\n\tif ( null === $filter ) {\n\t\treturn ! empty( $wp_current_filter );\n\t}\n\n\treturn in_array( $filter, $wp_current_filter, true );\n}\n\n/**\n * Retrieve the name of an action currently being processed.\n *\n * @since 3.9.0\n *\n * @param string|null $action Optional. Action to check. Defaults to null, which checks\n *                            if any action is currently being run.\n * @return bool Whether the action is currently in the stack.\n */\nfunction doing_action( $action = null ) {\n\treturn doing_filter( $action );\n}\n\n/**\n * Hooks a function on to a specific action.\n *\n * Actions are the hooks that the WordPress core launches at specific points\n * during execution, or when specific events occur. Plugins can specify that\n * one or more of its PHP functions are executed at these points, using the\n * Action API.\n *\n * @since 1.2.0\n *\n * @param string   $tag             The name of the action to which the $function_to_add is hooked.\n * @param callable $function_to_add The name of the function you wish to be called.\n * @param int      $priority        Optional. Used to specify the order in which the functions\n *                                  associated with a particular action are executed. Default 10.\n *                                  Lower numbers correspond with earlier execution,\n *                                  and functions with the same priority are executed\n *                                  in the order in which they were added to the action.\n * @param int      $accepted_args   Optional. The number of arguments the function accepts. Default 1.\n * @return true Will always return true.\n */\nfunction add_action( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) {\n\treturn add_filter( $tag, $function_to_add, $priority, $accepted_args );\n}\n\n/**\n * Execute functions hooked on a specific action hook.\n *\n * This function invokes all functions attached to action hook `$tag`. It is\n * possible to create new action hooks by simply calling this function,\n * specifying the name of the new hook using the `$tag` parameter.\n *\n * You can pass extra arguments to the hooks, much like you can with `apply_filters()`.\n *\n * Example usage:\n *\n *     // The action callback function.\n *     function example_callback( $arg1, $arg2 ) {\n *         // (maybe) do something with the args.\n *     }\n *     add_action( 'example_action', 'example_callback', 10, 2 );\n *\n *     /*\n *      * Trigger the actions by calling the 'example_callback()' function\n *      * that's hooked onto `example_action` above.\n *      *\n *      * - 'example_action' is the action hook.\n *      * - $arg1 and $arg2 are the additional arguments passed to the callback.\n *     $value = do_action( 'example_action', $arg1, $arg2 );\n *\n * @since 1.2.0\n * @since 5.3.0 Formalized the existing and already documented `...$arg` parameter\n *              by adding it to the function signature.\n *\n * @global array $wp_filter         Stores all of the filters and actions.\n * @global array $wp_actions        Increments the amount of times action was triggered.\n * @global array $wp_current_filter Stores the list of current filters with the current one last.\n *\n * @param string $tag    The name of the action to be executed.\n * @param mixed  ...$arg Optional. Additional arguments which are passed on to the\n *                       functions hooked to the action. Default empty.\n */\nfunction do_action( $tag, ...$arg ) {\n\tglobal $wp_filter, $wp_actions, $wp_current_filter;\n\n\tif ( ! isset( $wp_actions[ $tag ] ) ) {\n\t\t$wp_actions[ $tag ] = 1;\n\t} else {\n\t\t++$wp_actions[ $tag ];\n\t}\n\n\t// Do 'all' actions first.\n\tif ( isset( $wp_filter['all'] ) ) {\n\t\t$wp_current_filter[] = $tag;\n\t\t$all_args            = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection\n\t\t_wp_call_all_hook( $all_args );\n\t}\n\n\tif ( ! isset( $wp_filter[ $tag ] ) ) {\n\t\tif ( isset( $wp_filter['all'] ) ) {\n\t\t\tarray_pop( $wp_current_filter );\n\t\t}\n\t\treturn;\n\t}\n\n\tif ( ! isset( $wp_filter['all'] ) ) {\n\t\t$wp_current_filter[] = $tag;\n\t}\n\n\tif ( empty( $arg ) ) {\n\t\t$arg[] = '';\n\t} elseif ( is_array( $arg[0] ) && 1 === count( $arg[0] ) && isset( $arg[0][0] ) && is_object( $arg[0][0] ) ) {\n\t\t// Backward compatibility for PHP4-style passing of `array( &$this )` as action `$arg`.\n\t\t$arg[0] = $arg[0][0];\n\t}\n\n\t$wp_filter[ $tag ]->do_action( $arg );\n\n\tarray_pop( $wp_current_filter );\n}\n\n/**\n * Retrieve the number of times an action is fired.\n *\n * @since 2.1.0\n *\n * @global array $wp_actions Increments the amount of times action was triggered.\n *\n * @param string $tag The name of the action hook.\n * @return int The number of times action hook $tag is fired.\n */\nfunction did_action( $tag ) {\n\tglobal $wp_actions;\n\n\tif ( ! isset( $wp_actions[ $tag ] ) ) {\n\t\treturn 0;\n\t}\n\n\treturn $wp_actions[ $tag ];\n}\n\n/**\n * Calls the callback functions that have been added to an action hook, specifying arguments in an array.\n *\n * @since 2.1.0\n *\n * @see do_action() This function is identical, but the arguments passed to the\n *                  functions hooked to `$tag` are supplied using an array.\n * @global array $wp_filter         Stores all of the filters and actions.\n * @global array $wp_actions        Increments the amount of times action was triggered.\n * @global array $wp_current_filter Stores the list of current filters with the current one last.\n *\n * @param string $tag  The name of the action to be executed.\n * @param array  $args The arguments supplied to the functions hooked to `$tag`.\n */\nfunction do_action_ref_array( $tag, $args ) {\n\tglobal $wp_filter, $wp_actions, $wp_current_filter;\n\n\tif ( ! isset( $wp_actions[ $tag ] ) ) {\n\t\t$wp_actions[ $tag ] = 1;\n\t} else {\n\t\t++$wp_actions[ $tag ];\n\t}\n\n\t// Do 'all' actions first.\n\tif ( isset( $wp_filter['all'] ) ) {\n\t\t$wp_current_filter[] = $tag;\n\t\t$all_args            = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection\n\t\t_wp_call_all_hook( $all_args );\n\t}\n\n\tif ( ! isset( $wp_filter[ $tag ] ) ) {\n\t\tif ( isset( $wp_filter['all'] ) ) {\n\t\t\tarray_pop( $wp_current_filter );\n\t\t}\n\t\treturn;\n\t}\n\n\tif ( ! isset( $wp_filter['all'] ) ) {\n\t\t$wp_current_filter[] = $tag;\n\t}\n\n\t$wp_filter[ $tag ]->do_action( $args );\n\n\tarray_pop( $wp_current_filter );\n}\n\n/**\n * Check if any action has been registered for a hook.\n *\n * @since 2.5.0\n *\n * @see has_filter() has_action() is an alias of has_filter().\n *\n * @param string        $tag               The name of the action hook.\n * @param callable|bool $function_to_check Optional. The callback to check for. Default false.\n * @return bool|int If $function_to_check is omitted, returns boolean for whether the hook has\n *                  anything registered. When checking a specific function, the priority of that\n *                  hook is returned, or false if the function is not attached. When using the\n *                  $function_to_check argument, this function may return a non-boolean value\n *                  that evaluates to false (e.g.) 0, so use the === operator for testing the\n *                  return value.\n */\nfunction has_action( $tag, $function_to_check = false ) {\n\treturn has_filter( $tag, $function_to_check );\n}\n\n/**\n * Removes a function from a specified action hook.\n *\n * This function removes a function attached to a specified action hook. This\n * method can be used to remove default functions attached to a specific filter\n * hook and possibly replace them with a substitute.\n *\n * @since 1.2.0\n *\n * @param string   $tag                The action hook to which the function to be removed is hooked.\n * @param callable $function_to_remove The name of the function which should be removed.\n * @param int      $priority           Optional. The priority of the function. Default 10.\n * @return bool Whether the function is removed.\n */\nfunction remove_action( $tag, $function_to_remove, $priority = 10 ) {\n\treturn remove_filter( $tag, $function_to_remove, $priority );\n}\n\n/**\n * Remove all of the hooks from an action.\n *\n * @since 2.7.0\n *\n * @param string   $tag      The action to remove hooks from.\n * @param int|bool $priority The priority number to remove them from. Default false.\n * @return true True when finished.\n */\nfunction remove_all_actions( $tag, $priority = false ) {\n\treturn remove_all_filters( $tag, $priority );\n}\n\n/**\n * Fires functions attached to a deprecated filter hook.\n *\n * When a filter hook is deprecated, the apply_filters() call is replaced with\n * apply_filters_deprecated(), which triggers a deprecation notice and then fires\n * the original filter hook.\n *\n * Note: the value and extra arguments passed to the original apply_filters() call\n * must be passed here to `$args` as an array. For example:\n *\n *     // Old filter.\n *     return apply_filters( 'wpdocs_filter', $value, $extra_arg );\n *\n *     // Deprecated.\n *     return apply_filters_deprecated( 'wpdocs_filter', array( $value, $extra_arg ), '4.9.0', 'wpdocs_new_filter' );\n *\n * @since 4.6.0\n *\n * @see _deprecated_hook()\n *\n * @param string $tag         The name of the filter hook.\n * @param array  $args        Array of additional function arguments to be passed to apply_filters().\n * @param string $version     The version of WordPress that deprecated the hook.\n * @param string $replacement Optional. The hook that should have been used. Default empty.\n * @param string $message     Optional. A message regarding the change. Default empty.\n */\nfunction apply_filters_deprecated( $tag, $args, $version, $replacement = '', $message = '' ) {\n\tif ( ! has_filter( $tag ) ) {\n\t\treturn $args[0];\n\t}\n\n\t_deprecated_hook( $tag, $version, $replacement, $message );\n\n\treturn apply_filters_ref_array( $tag, $args );\n}\n\n/**\n * Fires functions attached to a deprecated action hook.\n *\n * When an action hook is deprecated, the do_action() call is replaced with\n * do_action_deprecated(), which triggers a deprecation notice and then fires\n * the original hook.\n *\n * @since 4.6.0\n *\n * @see _deprecated_hook()\n *\n * @param string $tag         The name of the action hook.\n * @param array  $args        Array of additional function arguments to be passed to do_action().\n * @param string $version     The version of WordPress that deprecated the hook.\n * @param string $replacement Optional. The hook that should have been used. Default empty.\n * @param string $message     Optional. A message regarding the change. Default empty.\n */\nfunction do_action_deprecated( $tag, $args, $version, $replacement = '', $message = '' ) {\n\tif ( ! has_action( $tag ) ) {\n\t\treturn;\n\t}\n\n\t_deprecated_hook( $tag, $version, $replacement, $message );\n\n\tdo_action_ref_array( $tag, $args );\n}\n\n//\n// Functions for handling plugins.\n//\n\n/**\n * Gets the basename of a plugin.\n *\n * This method extracts the name of a plugin from its filename.\n *\n * @since 1.5.0\n *\n * @global array $wp_plugin_paths\n *\n * @param string $file The filename of plugin.\n * @return string The name of a plugin.\n */\nfunction plugin_basename( $file ) {\n\tglobal $wp_plugin_paths;\n\n\t// $wp_plugin_paths contains normalized paths.\n\t$file = wp_normalize_path( $file );\n\n\tarsort( $wp_plugin_paths );\n\tforeach ( $wp_plugin_paths as $dir => $realdir ) {\n\t\tif ( strpos( $file, $realdir ) === 0 ) {\n\t\t\t$file = $dir . substr( $file, strlen( $realdir ) );\n\t\t}\n\t}\n\n\t$plugin_dir    = wp_normalize_path( WP_PLUGIN_DIR );\n\t$mu_plugin_dir = wp_normalize_path( WPMU_PLUGIN_DIR );\n\n\t// Get relative path from plugins directory.\n\t$file = preg_replace( '#^' . preg_quote( $plugin_dir, '#' ) . '/|^' . preg_quote( $mu_plugin_dir, '#' ) . '/#', '', $file );\n\t$file = trim( $file, '/' );\n\treturn $file;\n}\n\n/**\n * Register a plugin's real path.\n *\n * This is used in plugin_basename() to resolve symlinked paths.\n *\n * @since 3.9.0\n *\n * @see wp_normalize_path()\n *\n * @global array $wp_plugin_paths\n *\n * @param string $file Known path to the file.\n * @return bool Whether the path was able to be registered.\n */\nfunction wp_register_plugin_realpath( $file ) {\n\tglobal $wp_plugin_paths;\n\n\t// Normalize, but store as static to avoid recalculation of a constant value.\n\tstatic $wp_plugin_path = null, $wpmu_plugin_path = null;\n\tif ( ! isset( $wp_plugin_path ) ) {\n\t\t$wp_plugin_path   = wp_normalize_path( WP_PLUGIN_DIR );\n\t\t$wpmu_plugin_path = wp_normalize_path( WPMU_PLUGIN_DIR );\n\t}\n\n\t$plugin_path     = wp_normalize_path( dirname( $file ) );\n\t$plugin_realpath = wp_normalize_path( dirname( realpath( $file ) ) );\n\n\tif ( $plugin_path === $wp_plugin_path || $plugin_path === $wpmu_plugin_path ) {\n\t\treturn false;\n\t}\n\n\tif ( $plugin_path !== $plugin_realpath ) {\n\t\t$wp_plugin_paths[ $plugin_path ] = $plugin_realpath;\n\t}\n\n\treturn true;\n}\n\n/**\n * Get the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in.\n *\n * @since 2.8.0\n *\n * @param string $file The filename of the plugin (__FILE__).\n * @return string the filesystem path of the directory that contains the plugin.\n */\nfunction plugin_dir_path( $file ) {\n\treturn trailingslashit( dirname( $file ) );\n}\n\n/**\n * Get the URL directory path (with trailing slash) for the plugin __FILE__ passed in.\n *\n * @since 2.8.0\n *\n * @param string $file The filename of the plugin (__FILE__).\n * @return string the URL path of the directory that contains the plugin.\n */\nfunction plugin_dir_url( $file ) {\n\treturn trailingslashit( plugins_url( '', $file ) );\n}\n\n/**\n * Set the activation hook for a plugin.\n *\n * When a plugin is activated, the action 'activate_PLUGINNAME' hook is\n * called. In the name of this hook, PLUGINNAME is replaced with the name\n * of the plugin, including the optional subdirectory. For example, when the\n * plugin is located in wp-content/plugins/sampleplugin/sample.php, then\n * the name of this hook will become 'activate_sampleplugin/sample.php'.\n *\n * When the plugin consists of only one file and is (as by default) located at\n * wp-content/plugins/sample.php the name of this hook will be\n * 'activate_sample.php'.\n *\n * @since 2.0.0\n *\n * @param string   $file     The filename of the plugin including the path.\n * @param callable $function The function hooked to the 'activate_PLUGIN' action.\n */\nfunction register_activation_hook( $file, $function ) {\n\t$file = plugin_basename( $file );\n\tadd_action( 'activate_' . $file, $function );\n}\n\n/**\n * Set the deactivation hook for a plugin.\n *\n * When a plugin is deactivated, the action 'deactivate_PLUGINNAME' hook is\n * called. In the name of this hook, PLUGINNAME is replaced with the name\n * of the plugin, including the optional subdirectory. For example, when the\n * plugin is located in wp-content/plugins/sampleplugin/sample.php, then\n * the name of this hook will become 'deactivate_sampleplugin/sample.php'.\n *\n * When the plugin consists of only one file and is (as by default) located at\n * wp-content/plugins/sample.php the name of this hook will be\n * 'deactivate_sample.php'.\n *\n * @since 2.0.0\n *\n * @param string   $file     The filename of the plugin including the path.\n * @param callable $function The function hooked to the 'deactivate_PLUGIN' action.\n */\nfunction register_deactivation_hook( $file, $function ) {\n\t$file = plugin_basename( $file );\n\tadd_action( 'deactivate_' . $file, $function );\n}\n\n/**\n * Set the uninstallation hook for a plugin.\n *\n * Registers the uninstall hook that will be called when the user clicks on the\n * uninstall link that calls for the plugin to uninstall itself. The link won't\n * be active unless the plugin hooks into the action.\n *\n * The plugin should not run arbitrary code outside of functions, when\n * registering the uninstall hook. In order to run using the hook, the plugin\n * will have to be included, which means that any code laying outside of a\n * function will be run during the uninstallation process. The plugin should not\n * hinder the uninstallation process.\n *\n * If the plugin can not be written without running code within the plugin, then\n * the plugin should create a file named 'uninstall.php' in the base plugin\n * folder. This file will be called, if it exists, during the uninstallation process\n * bypassing the uninstall hook. The plugin, when using the 'uninstall.php'\n * should always check for the 'WP_UNINSTALL_PLUGIN' constant, before\n * executing.\n *\n * @since 2.7.0\n *\n * @param string   $file     Plugin file.\n * @param callable $callback The callback to run when the hook is called. Must be\n *                           a static method or function.\n */\nfunction register_uninstall_hook( $file, $callback ) {\n\tif ( is_array( $callback ) && is_object( $callback[0] ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Only a static class method or function can be used in an uninstall hook.' ), '3.1.0' );\n\t\treturn;\n\t}\n\n\t/*\n\t * The option should not be autoloaded, because it is not needed in most\n\t * cases. Emphasis should be put on using the 'uninstall.php' way of\n\t * uninstalling the plugin.\n\t */\n\t$uninstallable_plugins = (array) get_option( 'uninstall_plugins' );\n\t$plugin_basename       = plugin_basename( $file );\n\tif ( ! isset( $uninstallable_plugins[ $plugin_basename ] ) || $uninstallable_plugins[ $plugin_basename ] !== $callback ) {\n\t\t$uninstallable_plugins[ $plugin_basename ] = $callback;\n\t\tupdate_option( 'uninstall_plugins', $uninstallable_plugins );\n\t}\n}\n\n/**\n * Call the 'all' hook, which will process the functions hooked into it.\n *\n * The 'all' hook passes all of the arguments or parameters that were used for\n * the hook, which this function was called for.\n *\n * This function is used internally for apply_filters(), do_action(), and\n * do_action_ref_array() and is not meant to be used from outside those\n * functions. This function does not check for the existence of the all hook, so\n * it will fail unless the all hook exists prior to this function call.\n *\n * @since 2.5.0\n * @access private\n *\n * @global array $wp_filter Stores all of the filters and actions.\n *\n * @param array $args The collected parameters from the hook that was called.\n */\nfunction _wp_call_all_hook( $args ) {\n\tglobal $wp_filter;\n\n\t$wp_filter['all']->do_all_hook( $args );\n}\n\n/**\n * Build Unique ID for storage and retrieval.\n *\n * The old way to serialize the callback caused issues and this function is the\n * solution. It works by checking for objects and creating a new property in\n * the class to keep track of the object and new objects of the same class that\n * need to be added.\n *\n * It also allows for the removal of actions and filters for objects after they\n * change class properties. It is possible to include the property $wp_filter_id\n * in your class and set it to \"null\" or a number to bypass the workaround.\n * However this will prevent you from adding new classes and any new classes\n * will overwrite the previous hook by the same class.\n *\n * Functions and static method callbacks are just returned as strings and\n * shouldn't have any speed penalty.\n *\n * @link https://core.trac.wordpress.org/ticket/3875\n *\n * @since 2.2.3\n * @since 5.3.0 Removed workarounds for spl_object_hash().\n *              `$tag` and `$priority` are no longer used,\n *              and the function always returns a string.\n * @access private\n *\n * @param string   $tag      Unused. The name of the filter to build ID for.\n * @param callable $function The function to generate ID for.\n * @param int      $priority Unused. The order in which the functions\n *                           associated with a particular action are executed.\n * @return string Unique function ID for usage as array key.\n */\nfunction _wp_filter_build_unique_id( $tag, $function, $priority ) {\n\tif ( is_string( $function ) ) {\n\t\treturn $function;\n\t}\n\n\tif ( is_object( $function ) ) {\n\t\t// Closures are currently implemented as objects.\n\t\t$function = array( $function, '' );\n\t} else {\n\t\t$function = (array) $function;\n\t}\n\n\tif ( is_object( $function[0] ) ) {\n\t\t// Object class calling.\n\t\treturn spl_object_hash( $function[0] ) . $function[1];\n\t} elseif ( is_string( $function[0] ) ) {\n\t\t// Static calling.\n\t\treturn $function[0] . '::' . $function[1];\n\t}\n}\n", "num_lines": 929}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Post format functions.\n *\n * @package WordPress\n * @subpackage Post\n */\n\n/**\n * Retrieve the format slug for a post\n *\n * @since 3.1.0\n *\n * @param int|object|null $post Optional. Post ID or post object. Defaults to the current post in the loop.\n * @return string|false The format if successful. False otherwise.\n */\nfunction get_post_format( $post = null ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\tif ( ! post_type_supports( $post->post_type, 'post-formats' ) ) {\n\t\treturn false;\n\t}\n\n\t$_format = get_the_terms( $post->ID, 'post_format' );\n\n\tif ( empty( $_format ) ) {\n\t\treturn false;\n\t}\n\n\t$format = reset( $_format );\n\n\treturn str_replace( 'post-format-', '', $format->slug );\n}\n\n/**\n * Check if a post has any of the given formats, or any format.\n *\n * @since 3.1.0\n *\n * @param string|array     $format Optional. The format or formats to check.\n * @param WP_Post|int|null $post   Optional. The post to check. Defaults to the current post in the loop.\n * @return bool True if the post has any of the given formats (or any format, if no format specified),\n *              false otherwise.\n */\nfunction has_post_format( $format = array(), $post = null ) {\n\t$prefixed = array();\n\n\tif ( $format ) {\n\t\tforeach ( (array) $format as $single ) {\n\t\t\t$prefixed[] = 'post-format-' . sanitize_key( $single );\n\t\t}\n\t}\n\n\treturn has_term( $prefixed, 'post_format', $post );\n}\n\n/**\n * Assign a format to a post\n *\n * @since 3.1.0\n *\n * @param int|object $post   The post for which to assign a format.\n * @param string     $format A format to assign. Use an empty string or array to remove all formats from the post.\n * @return array|WP_Error|false Array of affected term IDs on success. WP_Error on error.\n */\nfunction set_post_format( $post, $format ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn new WP_Error( 'invalid_post', __( 'Invalid post.' ) );\n\t}\n\n\tif ( ! empty( $format ) ) {\n\t\t$format = sanitize_key( $format );\n\t\tif ( 'standard' === $format || ! in_array( $format, get_post_format_slugs(), true ) ) {\n\t\t\t$format = '';\n\t\t} else {\n\t\t\t$format = 'post-format-' . $format;\n\t\t}\n\t}\n\n\treturn wp_set_post_terms( $post->ID, $format, 'post_format' );\n}\n\n/**\n * Returns an array of post format slugs to their translated and pretty display versions\n *\n * @since 3.1.0\n *\n * @return string[] Array of post format labels keyed by format slug.\n */\nfunction get_post_format_strings() {\n\t$strings = array(\n\t\t'standard' => _x( 'Standard', 'Post format' ), // Special case. Any value that evals to false will be considered standard.\n\t\t'aside'    => _x( 'Aside', 'Post format' ),\n\t\t'chat'     => _x( 'Chat', 'Post format' ),\n\t\t'gallery'  => _x( 'Gallery', 'Post format' ),\n\t\t'link'     => _x( 'Link', 'Post format' ),\n\t\t'image'    => _x( 'Image', 'Post format' ),\n\t\t'quote'    => _x( 'Quote', 'Post format' ),\n\t\t'status'   => _x( 'Status', 'Post format' ),\n\t\t'video'    => _x( 'Video', 'Post format' ),\n\t\t'audio'    => _x( 'Audio', 'Post format' ),\n\t);\n\treturn $strings;\n}\n\n/**\n * Retrieves the array of post format slugs.\n *\n * @since 3.1.0\n *\n * @return string[] The array of post format slugs as both keys and values.\n */\nfunction get_post_format_slugs() {\n\t$slugs = array_keys( get_post_format_strings() );\n\treturn array_combine( $slugs, $slugs );\n}\n\n/**\n * Returns a pretty, translated version of a post format slug\n *\n * @since 3.1.0\n *\n * @param string $slug A post format slug.\n * @return string The translated post format name.\n */\nfunction get_post_format_string( $slug ) {\n\t$strings = get_post_format_strings();\n\tif ( ! $slug ) {\n\t\treturn $strings['standard'];\n\t} else {\n\t\treturn ( isset( $strings[ $slug ] ) ) ? $strings[ $slug ] : '';\n\t}\n}\n\n/**\n * Returns a link to a post format index.\n *\n * @since 3.1.0\n *\n * @param string $format The post format slug.\n * @return string|WP_Error|false The post format term link.\n */\nfunction get_post_format_link( $format ) {\n\t$term = get_term_by( 'slug', 'post-format-' . $format, 'post_format' );\n\tif ( ! $term || is_wp_error( $term ) ) {\n\t\treturn false;\n\t}\n\treturn get_term_link( $term );\n}\n\n/**\n * Filters the request to allow for the format prefix.\n *\n * @access private\n * @since 3.1.0\n *\n * @param array $qvs\n * @return array\n */\nfunction _post_format_request( $qvs ) {\n\tif ( ! isset( $qvs['post_format'] ) ) {\n\t\treturn $qvs;\n\t}\n\t$slugs = get_post_format_slugs();\n\tif ( isset( $slugs[ $qvs['post_format'] ] ) ) {\n\t\t$qvs['post_format'] = 'post-format-' . $slugs[ $qvs['post_format'] ];\n\t}\n\t$tax = get_taxonomy( 'post_format' );\n\tif ( ! is_admin() ) {\n\t\t$qvs['post_type'] = $tax->object_type;\n\t}\n\treturn $qvs;\n}\n\n/**\n * Filters the post format term link to remove the format prefix.\n *\n * @access private\n * @since 3.1.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string $link\n * @param object $term\n * @param string $taxonomy\n * @return string\n */\nfunction _post_format_link( $link, $term, $taxonomy ) {\n\tglobal $wp_rewrite;\n\tif ( 'post_format' !== $taxonomy ) {\n\t\treturn $link;\n\t}\n\tif ( $wp_rewrite->get_extra_permastruct( $taxonomy ) ) {\n\t\treturn str_replace( \"/{$term->slug}\", '/' . str_replace( 'post-format-', '', $term->slug ), $link );\n\t} else {\n\t\t$link = remove_query_arg( 'post_format', $link );\n\t\treturn add_query_arg( 'post_format', str_replace( 'post-format-', '', $term->slug ), $link );\n\t}\n}\n\n/**\n * Remove the post format prefix from the name property of the term object created by get_term().\n *\n * @access private\n * @since 3.1.0\n *\n * @param object $term\n * @return object\n */\nfunction _post_format_get_term( $term ) {\n\tif ( isset( $term->slug ) ) {\n\t\t$term->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );\n\t}\n\treturn $term;\n}\n\n/**\n * Remove the post format prefix from the name property of the term objects created by get_terms().\n *\n * @access private\n * @since 3.1.0\n *\n * @param array        $terms\n * @param string|array $taxonomies\n * @param array        $args\n * @return array\n */\nfunction _post_format_get_terms( $terms, $taxonomies, $args ) {\n\tif ( in_array( 'post_format', (array) $taxonomies, true ) ) {\n\t\tif ( isset( $args['fields'] ) && 'names' === $args['fields'] ) {\n\t\t\tforeach ( $terms as $order => $name ) {\n\t\t\t\t$terms[ $order ] = get_post_format_string( str_replace( 'post-format-', '', $name ) );\n\t\t\t}\n\t\t} else {\n\t\t\tforeach ( (array) $terms as $order => $term ) {\n\t\t\t\tif ( isset( $term->taxonomy ) && 'post_format' === $term->taxonomy ) {\n\t\t\t\t\t$terms[ $order ]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $terms;\n}\n\n/**\n * Remove the post format prefix from the name property of the term objects created by wp_get_object_terms().\n *\n * @access private\n * @since 3.1.0\n *\n * @param array $terms\n * @return array\n */\nfunction _post_format_wp_get_object_terms( $terms ) {\n\tforeach ( (array) $terms as $order => $term ) {\n\t\tif ( isset( $term->taxonomy ) && 'post_format' === $term->taxonomy ) {\n\t\t\t$terms[ $order ]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );\n\t\t}\n\t}\n\treturn $terms;\n}\n", "num_lines": 268}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Post Template Functions.\n *\n * Gets content for the current post in the loop.\n *\n * @package WordPress\n * @subpackage Template\n */\n\n/**\n * Display the ID of the current item in the WordPress Loop.\n *\n * @since 0.71\n */\nfunction the_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid\n\techo get_the_ID();\n}\n\n/**\n * Retrieve the ID of the current item in the WordPress Loop.\n *\n * @since 2.1.0\n *\n * @return int|false The ID of the current item in the WordPress Loop. False if $post is not set.\n */\nfunction get_the_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid\n\t$post = get_post();\n\treturn ! empty( $post ) ? $post->ID : false;\n}\n\n/**\n * Display or retrieve the current post title with optional markup.\n *\n * @since 0.71\n *\n * @param string $before Optional. Markup to prepend to the title. Default empty.\n * @param string $after  Optional. Markup to append to the title. Default empty.\n * @param bool   $echo   Optional. Whether to echo or return the title. Default true for echo.\n * @return void|string Void if `$echo` argument is true, current post title if `$echo` is false.\n */\nfunction the_title( $before = '', $after = '', $echo = true ) {\n\t$title = get_the_title();\n\n\tif ( strlen( $title ) == 0 ) {\n\t\treturn;\n\t}\n\n\t$title = $before . $title . $after;\n\n\tif ( $echo ) {\n\t\techo $title;\n\t} else {\n\t\treturn $title;\n\t}\n}\n\n/**\n * Sanitize the current title when retrieving or displaying.\n *\n * Works like the_title(), except the parameters can be in a string or\n * an array. See the function for what can be override in the $args parameter.\n *\n * The title before it is displayed will have the tags stripped and esc_attr()\n * before it is passed to the user or displayed. The default as with the_title(),\n * is to display the title.\n *\n * @since 2.3.0\n *\n * @param string|array $args {\n *     Title attribute arguments. Optional.\n *\n *     @type string  $before Markup to prepend to the title. Default empty.\n *     @type string  $after  Markup to append to the title. Default empty.\n *     @type bool    $echo   Whether to echo or return the title. Default true for echo.\n *     @type WP_Post $post   Current post object to retrieve the title for.\n * }\n * @return void|string Void if 'echo' argument is true, the title attribute if 'echo' is false.\n */\nfunction the_title_attribute( $args = '' ) {\n\t$defaults    = array(\n\t\t'before' => '',\n\t\t'after'  => '',\n\t\t'echo'   => true,\n\t\t'post'   => get_post(),\n\t);\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t$title = get_the_title( $parsed_args['post'] );\n\n\tif ( strlen( $title ) == 0 ) {\n\t\treturn;\n\t}\n\n\t$title = $parsed_args['before'] . $title . $parsed_args['after'];\n\t$title = esc_attr( strip_tags( $title ) );\n\n\tif ( $parsed_args['echo'] ) {\n\t\techo $title;\n\t} else {\n\t\treturn $title;\n\t}\n}\n\n/**\n * Retrieve post title.\n *\n * If the post is protected and the visitor is not an admin, then \"Protected\"\n * will be displayed before the post title. If the post is private, then\n * \"Private\" will be located before the post title.\n *\n * @since 0.71\n *\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.\n * @return string\n */\nfunction get_the_title( $post = 0 ) {\n\t$post = get_post( $post );\n\n\t$title = isset( $post->post_title ) ? $post->post_title : '';\n\t$id    = isset( $post->ID ) ? $post->ID : 0;\n\n\tif ( ! is_admin() ) {\n\t\tif ( ! empty( $post->post_password ) ) {\n\n\t\t\t/* translators: %s: Protected post title. */\n\t\t\t$prepend = __( 'Protected: %s' );\n\n\t\t\t/**\n\t\t\t * Filters the text prepended to the post title for protected posts.\n\t\t\t *\n\t\t\t * The filter is only applied on the front end.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t *\n\t\t\t * @param string  $prepend Text displayed before the post title.\n\t\t\t *                         Default 'Protected: %s'.\n\t\t\t * @param WP_Post $post    Current post object.\n\t\t\t */\n\t\t\t$protected_title_format = apply_filters( 'protected_title_format', $prepend, $post );\n\t\t\t$title                  = sprintf( $protected_title_format, $title );\n\t\t} elseif ( isset( $post->post_status ) && 'private' === $post->post_status ) {\n\n\t\t\t/* translators: %s: Private post title. */\n\t\t\t$prepend = __( 'Private: %s' );\n\n\t\t\t/**\n\t\t\t * Filters the text prepended to the post title of private posts.\n\t\t\t *\n\t\t\t * The filter is only applied on the front end.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t *\n\t\t\t * @param string  $prepend Text displayed before the post title.\n\t\t\t *                         Default 'Private: %s'.\n\t\t\t * @param WP_Post $post    Current post object.\n\t\t\t */\n\t\t\t$private_title_format = apply_filters( 'private_title_format', $prepend, $post );\n\t\t\t$title                = sprintf( $private_title_format, $title );\n\t\t}\n\t}\n\n\t/**\n\t * Filters the post title.\n\t *\n\t * @since 0.71\n\t *\n\t * @param string $title The post title.\n\t * @param int    $id    The post ID.\n\t */\n\treturn apply_filters( 'the_title', $title, $id );\n}\n\n/**\n * Display the Post Global Unique Identifier (guid).\n *\n * The guid will appear to be a link, but should not be used as a link to the\n * post. The reason you should not use it as a link, is because of moving the\n * blog across domains.\n *\n * URL is escaped to make it XML-safe.\n *\n * @since 1.5.0\n *\n * @param int|WP_Post $post Optional. Post ID or post object. Default is global $post.\n */\nfunction the_guid( $post = 0 ) {\n\t$post = get_post( $post );\n\n\t$guid = isset( $post->guid ) ? get_the_guid( $post ) : '';\n\t$id   = isset( $post->ID ) ? $post->ID : 0;\n\n\t/**\n\t * Filters the escaped Global Unique Identifier (guid) of the post.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @see get_the_guid()\n\t *\n\t * @param string $guid Escaped Global Unique Identifier (guid) of the post.\n\t * @param int    $id   The post ID.\n\t */\n\techo apply_filters( 'the_guid', $guid, $id );\n}\n\n/**\n * Retrieve the Post Global Unique Identifier (guid).\n *\n * The guid will appear to be a link, but should not be used as an link to the\n * post. The reason you should not use it as a link, is because of moving the\n * blog across domains.\n *\n * @since 1.5.0\n *\n * @param int|WP_Post $post Optional. Post ID or post object. Default is global $post.\n * @return string\n */\nfunction get_the_guid( $post = 0 ) {\n\t$post = get_post( $post );\n\n\t$guid = isset( $post->guid ) ? $post->guid : '';\n\t$id   = isset( $post->ID ) ? $post->ID : 0;\n\n\t/**\n\t * Filters the Global Unique Identifier (guid) of the post.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $guid Global Unique Identifier (guid) of the post.\n\t * @param int    $id   The post ID.\n\t */\n\treturn apply_filters( 'get_the_guid', $guid, $id );\n}\n\n/**\n * Display the post content.\n *\n * @since 0.71\n *\n * @param string $more_link_text Optional. Content for when there is more text.\n * @param bool   $strip_teaser   Optional. Strip teaser content before the more text. Default false.\n */\nfunction the_content( $more_link_text = null, $strip_teaser = false ) {\n\t$content = get_the_content( $more_link_text, $strip_teaser );\n\n\t/**\n\t * Filters the post content.\n\t *\n\t * @since 0.71\n\t *\n\t * @param string $content Content of the current post.\n\t */\n\t$content = apply_filters( 'the_content', $content );\n\t$content = str_replace( ']]>', ']]&gt;', $content );\n\techo $content;\n}\n\n/**\n * Retrieve the post content.\n *\n * @since 0.71\n * @since 5.2.0 Added the `$post` parameter.\n *\n * @global int   $page      Page number of a single post/page.\n * @global int   $more      Boolean indicator for whether single post/page is being viewed.\n * @global bool  $preview   Whether post/page is in preview mode.\n * @global array $pages     Array of all pages in post/page. Each array element contains\n *                          part of the content separated by the `<!--nextpage-->` tag.\n * @global int   $multipage Boolean indicator for whether multiple pages are in play.\n *\n * @param string             $more_link_text Optional. Content for when there is more text.\n * @param bool               $strip_teaser   Optional. Strip teaser content before the more text. Default false.\n * @param WP_Post|object|int $post           Optional. WP_Post instance or Post ID/object. Default null.\n * @return string\n */\nfunction get_the_content( $more_link_text = null, $strip_teaser = false, $post = null ) {\n\tglobal $page, $more, $preview, $pages, $multipage;\n\n\t$_post = get_post( $post );\n\n\tif ( ! ( $_post instanceof WP_Post ) ) {\n\t\treturn '';\n\t}\n\n\t// Use the globals if the $post parameter was not specified,\n\t// but only after they have been set up in setup_postdata().\n\tif ( null === $post && did_action( 'the_post' ) ) {\n\t\t$elements = compact( 'page', 'more', 'preview', 'pages', 'multipage' );\n\t} else {\n\t\t$elements = generate_postdata( $_post );\n\t}\n\n\tif ( null === $more_link_text ) {\n\t\t$more_link_text = sprintf(\n\t\t\t'<span aria-label=\"%1$s\">%2$s</span>',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t__( 'Continue reading %s' ),\n\t\t\t\tthe_title_attribute(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'echo' => false,\n\t\t\t\t\t\t'post' => $_post,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t__( '(more&hellip;)' )\n\t\t);\n\t}\n\n\t$output     = '';\n\t$has_teaser = false;\n\n\t// If post password required and it doesn't match the cookie.\n\tif ( post_password_required( $_post ) ) {\n\t\treturn get_the_password_form( $_post );\n\t}\n\n\t// If the requested page doesn't exist.\n\tif ( $elements['page'] > count( $elements['pages'] ) ) {\n\t\t// Give them the highest numbered page that DOES exist.\n\t\t$elements['page'] = count( $elements['pages'] );\n\t}\n\n\t$page_no = $elements['page'];\n\t$content = $elements['pages'][ $page_no - 1 ];\n\tif ( preg_match( '/<!--more(.*?)?-->/', $content, $matches ) ) {\n\t\tif ( has_block( 'more', $content ) ) {\n\t\t\t// Remove the core/more block delimiters. They will be left over after $content is split up.\n\t\t\t$content = preg_replace( '/<!-- \\/?wp:more(.*?) -->/', '', $content );\n\t\t}\n\n\t\t$content = explode( $matches[0], $content, 2 );\n\n\t\tif ( ! empty( $matches[1] ) && ! empty( $more_link_text ) ) {\n\t\t\t$more_link_text = strip_tags( wp_kses_no_null( trim( $matches[1] ) ) );\n\t\t}\n\n\t\t$has_teaser = true;\n\t} else {\n\t\t$content = array( $content );\n\t}\n\n\tif ( false !== strpos( $_post->post_content, '<!--noteaser-->' ) && ( ! $elements['multipage'] || 1 == $elements['page'] ) ) {\n\t\t$strip_teaser = true;\n\t}\n\n\t$teaser = $content[0];\n\n\tif ( $elements['more'] && $strip_teaser && $has_teaser ) {\n\t\t$teaser = '';\n\t}\n\n\t$output .= $teaser;\n\n\tif ( count( $content ) > 1 ) {\n\t\tif ( $elements['more'] ) {\n\t\t\t$output .= '<span id=\"more-' . $_post->ID . '\"></span>' . $content[1];\n\t\t} else {\n\t\t\tif ( ! empty( $more_link_text ) ) {\n\n\t\t\t\t/**\n\t\t\t\t * Filters the Read More link text.\n\t\t\t\t *\n\t\t\t\t * @since 2.8.0\n\t\t\t\t *\n\t\t\t\t * @param string $more_link_element Read More link element.\n\t\t\t\t * @param string $more_link_text    Read More text.\n\t\t\t\t */\n\t\t\t\t$output .= apply_filters( 'the_content_more_link', ' <a href=\"' . get_permalink( $_post ) . \"#more-{$_post->ID}\\\" class=\\\"more-link\\\">$more_link_text</a>\", $more_link_text );\n\t\t\t}\n\t\t\t$output = force_balance_tags( $output );\n\t\t}\n\t}\n\n\treturn $output;\n}\n\n/**\n * Display the post excerpt.\n *\n * @since 0.71\n */\nfunction the_excerpt() {\n\n\t/**\n\t * Filters the displayed post excerpt.\n\t *\n\t * @since 0.71\n\t *\n\t * @see get_the_excerpt()\n\t *\n\t * @param string $post_excerpt The post excerpt.\n\t */\n\techo apply_filters( 'the_excerpt', get_the_excerpt() );\n}\n\n/**\n * Retrieves the post excerpt.\n *\n * @since 0.71\n * @since 4.5.0 Introduced the `$post` parameter.\n *\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.\n * @return string Post excerpt.\n */\nfunction get_the_excerpt( $post = null ) {\n\tif ( is_bool( $post ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '2.3.0' );\n\t}\n\n\t$post = get_post( $post );\n\tif ( empty( $post ) ) {\n\t\treturn '';\n\t}\n\n\tif ( post_password_required( $post ) ) {\n\t\treturn __( 'There is no excerpt because this is a protected post.' );\n\t}\n\n\t/**\n\t * Filters the retrieved post excerpt.\n\t *\n\t * @since 1.2.0\n\t * @since 4.5.0 Introduced the `$post` parameter.\n\t *\n\t * @param string  $post_excerpt The post excerpt.\n\t * @param WP_Post $post         Post object.\n\t */\n\treturn apply_filters( 'get_the_excerpt', $post->post_excerpt, $post );\n}\n\n/**\n * Determines whether the post has a custom excerpt.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.3.0\n *\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.\n * @return bool True if the post has a custom excerpt, false otherwise.\n */\nfunction has_excerpt( $post = 0 ) {\n\t$post = get_post( $post );\n\treturn ( ! empty( $post->post_excerpt ) );\n}\n\n/**\n * Displays the classes for the post container element.\n *\n * @since 2.7.0\n *\n * @param string|array $class   One or more classes to add to the class list.\n * @param int|WP_Post  $post_id Optional. Post ID or post object. Defaults to the global `$post`.\n */\nfunction post_class( $class = '', $post_id = null ) {\n\t// Separates classes with a single space, collates classes for post DIV.\n\techo 'class=\"' . esc_attr( join( ' ', get_post_class( $class, $post_id ) ) ) . '\"';\n}\n\n/**\n * Retrieves an array of the class names for the post container element.\n *\n * The class names are many. If the post is a sticky, then the 'sticky'\n * class name. The class 'hentry' is always added to each post. If the post has a\n * post thumbnail, 'has-post-thumbnail' is added as a class. For each taxonomy that\n * the post belongs to, a class will be added of the format '{$taxonomy}-{$slug}' -\n * eg 'category-foo' or 'my_custom_taxonomy-bar'.\n *\n * The 'post_tag' taxonomy is a special\n * case; the class has the 'tag-' prefix instead of 'post_tag-'. All class names are\n * passed through the filter, {@see 'post_class'}, with the list of class names, followed by\n * $class parameter value, with the post ID as the last parameter.\n *\n * @since 2.7.0\n * @since 4.2.0 Custom taxonomy class names were added.\n *\n * @param string|string[] $class   Space-separated string or array of class names to add to the class list.\n * @param int|WP_Post     $post_id Optional. Post ID or post object.\n * @return string[] Array of class names.\n */\nfunction get_post_class( $class = '', $post_id = null ) {\n\t$post = get_post( $post_id );\n\n\t$classes = array();\n\n\tif ( $class ) {\n\t\tif ( ! is_array( $class ) ) {\n\t\t\t$class = preg_split( '#\\s+#', $class );\n\t\t}\n\t\t$classes = array_map( 'esc_attr', $class );\n\t} else {\n\t\t// Ensure that we always coerce class to being an array.\n\t\t$class = array();\n\t}\n\n\tif ( ! $post ) {\n\t\treturn $classes;\n\t}\n\n\t$classes[] = 'post-' . $post->ID;\n\tif ( ! is_admin() ) {\n\t\t$classes[] = $post->post_type;\n\t}\n\t$classes[] = 'type-' . $post->post_type;\n\t$classes[] = 'status-' . $post->post_status;\n\n\t// Post Format.\n\tif ( post_type_supports( $post->post_type, 'post-formats' ) ) {\n\t\t$post_format = get_post_format( $post->ID );\n\n\t\tif ( $post_format && ! is_wp_error( $post_format ) ) {\n\t\t\t$classes[] = 'format-' . sanitize_html_class( $post_format );\n\t\t} else {\n\t\t\t$classes[] = 'format-standard';\n\t\t}\n\t}\n\n\t$post_password_required = post_password_required( $post->ID );\n\n\t// Post requires password.\n\tif ( $post_password_required ) {\n\t\t$classes[] = 'post-password-required';\n\t} elseif ( ! empty( $post->post_password ) ) {\n\t\t$classes[] = 'post-password-protected';\n\t}\n\n\t// Post thumbnails.\n\tif ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $post->ID ) && ! is_attachment( $post ) && ! $post_password_required ) {\n\t\t$classes[] = 'has-post-thumbnail';\n\t}\n\n\t// Sticky for Sticky Posts.\n\tif ( is_sticky( $post->ID ) ) {\n\t\tif ( is_home() && ! is_paged() ) {\n\t\t\t$classes[] = 'sticky';\n\t\t} elseif ( is_admin() ) {\n\t\t\t$classes[] = 'status-sticky';\n\t\t}\n\t}\n\n\t// hentry for hAtom compliance.\n\t$classes[] = 'hentry';\n\n\t// All public taxonomies.\n\t$taxonomies = get_taxonomies( array( 'public' => true ) );\n\tforeach ( (array) $taxonomies as $taxonomy ) {\n\t\tif ( is_object_in_taxonomy( $post->post_type, $taxonomy ) ) {\n\t\t\tforeach ( (array) get_the_terms( $post->ID, $taxonomy ) as $term ) {\n\t\t\t\tif ( empty( $term->slug ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$term_class = sanitize_html_class( $term->slug, $term->term_id );\n\t\t\t\tif ( is_numeric( $term_class ) || ! trim( $term_class, '-' ) ) {\n\t\t\t\t\t$term_class = $term->term_id;\n\t\t\t\t}\n\n\t\t\t\t// 'post_tag' uses the 'tag' prefix for backward compatibility.\n\t\t\t\tif ( 'post_tag' === $taxonomy ) {\n\t\t\t\t\t$classes[] = 'tag-' . $term_class;\n\t\t\t\t} else {\n\t\t\t\t\t$classes[] = sanitize_html_class( $taxonomy . '-' . $term_class, $taxonomy . '-' . $term->term_id );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t$classes = array_map( 'esc_attr', $classes );\n\n\t/**\n\t * Filters the list of CSS class names for the current post.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string[] $classes An array of post class names.\n\t * @param string[] $class   An array of additional class names added to the post.\n\t * @param int      $post_id The post ID.\n\t */\n\t$classes = apply_filters( 'post_class', $classes, $class, $post->ID );\n\n\treturn array_unique( $classes );\n}\n\n/**\n * Displays the class names for the body element.\n *\n * @since 2.8.0\n *\n * @param string|string[] $class Space-separated string or array of class names to add to the class list.\n */\nfunction body_class( $class = '' ) {\n\t// Separates class names with a single space, collates class names for body element.\n\techo 'class=\"' . esc_attr( join( ' ', get_body_class( $class ) ) ) . '\"';\n}\n\n/**\n * Retrieves an array of the class names for the body element.\n *\n * @since 2.8.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param string|string[] $class Space-separated string or array of class names to add to the class list.\n * @return string[] Array of class names.\n */\nfunction get_body_class( $class = '' ) {\n\tglobal $wp_query;\n\n\t$classes = array();\n\n\tif ( is_rtl() ) {\n\t\t$classes[] = 'rtl';\n\t}\n\n\tif ( is_front_page() ) {\n\t\t$classes[] = 'home';\n\t}\n\tif ( is_home() ) {\n\t\t$classes[] = 'blog';\n\t}\n\tif ( is_privacy_policy() ) {\n\t\t$classes[] = 'privacy-policy';\n\t}\n\tif ( is_archive() ) {\n\t\t$classes[] = 'archive';\n\t}\n\tif ( is_date() ) {\n\t\t$classes[] = 'date';\n\t}\n\tif ( is_search() ) {\n\t\t$classes[] = 'search';\n\t\t$classes[] = $wp_query->posts ? 'search-results' : 'search-no-results';\n\t}\n\tif ( is_paged() ) {\n\t\t$classes[] = 'paged';\n\t}\n\tif ( is_attachment() ) {\n\t\t$classes[] = 'attachment';\n\t}\n\tif ( is_404() ) {\n\t\t$classes[] = 'error404';\n\t}\n\n\tif ( is_singular() ) {\n\t\t$post_id   = $wp_query->get_queried_object_id();\n\t\t$post      = $wp_query->get_queried_object();\n\t\t$post_type = $post->post_type;\n\n\t\tif ( is_page_template() ) {\n\t\t\t$classes[] = \"{$post_type}-template\";\n\n\t\t\t$template_slug  = get_page_template_slug( $post_id );\n\t\t\t$template_parts = explode( '/', $template_slug );\n\n\t\t\tforeach ( $template_parts as $part ) {\n\t\t\t\t$classes[] = \"{$post_type}-template-\" . sanitize_html_class( str_replace( array( '.', '/' ), '-', basename( $part, '.php' ) ) );\n\t\t\t}\n\t\t\t$classes[] = \"{$post_type}-template-\" . sanitize_html_class( str_replace( '.', '-', $template_slug ) );\n\t\t} else {\n\t\t\t$classes[] = \"{$post_type}-template-default\";\n\t\t}\n\n\t\tif ( is_single() ) {\n\t\t\t$classes[] = 'single';\n\t\t\tif ( isset( $post->post_type ) ) {\n\t\t\t\t$classes[] = 'single-' . sanitize_html_class( $post->post_type, $post_id );\n\t\t\t\t$classes[] = 'postid-' . $post_id;\n\n\t\t\t\t// Post Format.\n\t\t\t\tif ( post_type_supports( $post->post_type, 'post-formats' ) ) {\n\t\t\t\t\t$post_format = get_post_format( $post->ID );\n\n\t\t\t\t\tif ( $post_format && ! is_wp_error( $post_format ) ) {\n\t\t\t\t\t\t$classes[] = 'single-format-' . sanitize_html_class( $post_format );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$classes[] = 'single-format-standard';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( is_attachment() ) {\n\t\t\t$mime_type   = get_post_mime_type( $post_id );\n\t\t\t$mime_prefix = array( 'application/', 'image/', 'text/', 'audio/', 'video/', 'music/' );\n\t\t\t$classes[]   = 'attachmentid-' . $post_id;\n\t\t\t$classes[]   = 'attachment-' . str_replace( $mime_prefix, '', $mime_type );\n\t\t} elseif ( is_page() ) {\n\t\t\t$classes[] = 'page';\n\n\t\t\t$page_id = $wp_query->get_queried_object_id();\n\n\t\t\t$post = get_post( $page_id );\n\n\t\t\t$classes[] = 'page-id-' . $page_id;\n\n\t\t\tif ( get_pages(\n\t\t\t\tarray(\n\t\t\t\t\t'parent' => $page_id,\n\t\t\t\t\t'number' => 1,\n\t\t\t\t)\n\t\t\t) ) {\n\t\t\t\t$classes[] = 'page-parent';\n\t\t\t}\n\n\t\t\tif ( $post->post_parent ) {\n\t\t\t\t$classes[] = 'page-child';\n\t\t\t\t$classes[] = 'parent-pageid-' . $post->post_parent;\n\t\t\t}\n\t\t}\n\t} elseif ( is_archive() ) {\n\t\tif ( is_post_type_archive() ) {\n\t\t\t$classes[] = 'post-type-archive';\n\t\t\t$post_type = get_query_var( 'post_type' );\n\t\t\tif ( is_array( $post_type ) ) {\n\t\t\t\t$post_type = reset( $post_type );\n\t\t\t}\n\t\t\t$classes[] = 'post-type-archive-' . sanitize_html_class( $post_type );\n\t\t} elseif ( is_author() ) {\n\t\t\t$author    = $wp_query->get_queried_object();\n\t\t\t$classes[] = 'author';\n\t\t\tif ( isset( $author->user_nicename ) ) {\n\t\t\t\t$classes[] = 'author-' . sanitize_html_class( $author->user_nicename, $author->ID );\n\t\t\t\t$classes[] = 'author-' . $author->ID;\n\t\t\t}\n\t\t} elseif ( is_category() ) {\n\t\t\t$cat       = $wp_query->get_queried_object();\n\t\t\t$classes[] = 'category';\n\t\t\tif ( isset( $cat->term_id ) ) {\n\t\t\t\t$cat_class = sanitize_html_class( $cat->slug, $cat->term_id );\n\t\t\t\tif ( is_numeric( $cat_class ) || ! trim( $cat_class, '-' ) ) {\n\t\t\t\t\t$cat_class = $cat->term_id;\n\t\t\t\t}\n\n\t\t\t\t$classes[] = 'category-' . $cat_class;\n\t\t\t\t$classes[] = 'category-' . $cat->term_id;\n\t\t\t}\n\t\t} elseif ( is_tag() ) {\n\t\t\t$tag       = $wp_query->get_queried_object();\n\t\t\t$classes[] = 'tag';\n\t\t\tif ( isset( $tag->term_id ) ) {\n\t\t\t\t$tag_class = sanitize_html_class( $tag->slug, $tag->term_id );\n\t\t\t\tif ( is_numeric( $tag_class ) || ! trim( $tag_class, '-' ) ) {\n\t\t\t\t\t$tag_class = $tag->term_id;\n\t\t\t\t}\n\n\t\t\t\t$classes[] = 'tag-' . $tag_class;\n\t\t\t\t$classes[] = 'tag-' . $tag->term_id;\n\t\t\t}\n\t\t} elseif ( is_tax() ) {\n\t\t\t$term = $wp_query->get_queried_object();\n\t\t\tif ( isset( $term->term_id ) ) {\n\t\t\t\t$term_class = sanitize_html_class( $term->slug, $term->term_id );\n\t\t\t\tif ( is_numeric( $term_class ) || ! trim( $term_class, '-' ) ) {\n\t\t\t\t\t$term_class = $term->term_id;\n\t\t\t\t}\n\n\t\t\t\t$classes[] = 'tax-' . sanitize_html_class( $term->taxonomy );\n\t\t\t\t$classes[] = 'term-' . $term_class;\n\t\t\t\t$classes[] = 'term-' . $term->term_id;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( is_user_logged_in() ) {\n\t\t$classes[] = 'logged-in';\n\t}\n\n\tif ( is_admin_bar_showing() ) {\n\t\t$classes[] = 'admin-bar';\n\t\t$classes[] = 'no-customize-support';\n\t}\n\n\tif ( current_theme_supports( 'custom-background' )\n\t\t&& ( get_background_color() !== get_theme_support( 'custom-background', 'default-color' ) || get_background_image() ) ) {\n\t\t$classes[] = 'custom-background';\n\t}\n\n\tif ( has_custom_logo() ) {\n\t\t$classes[] = 'wp-custom-logo';\n\t}\n\n\tif ( current_theme_supports( 'responsive-embeds' ) ) {\n\t\t$classes[] = 'wp-embed-responsive';\n\t}\n\n\t$page = $wp_query->get( 'page' );\n\n\tif ( ! $page || $page < 2 ) {\n\t\t$page = $wp_query->get( 'paged' );\n\t}\n\n\tif ( $page && $page > 1 && ! is_404() ) {\n\t\t$classes[] = 'paged-' . $page;\n\n\t\tif ( is_single() ) {\n\t\t\t$classes[] = 'single-paged-' . $page;\n\t\t} elseif ( is_page() ) {\n\t\t\t$classes[] = 'page-paged-' . $page;\n\t\t} elseif ( is_category() ) {\n\t\t\t$classes[] = 'category-paged-' . $page;\n\t\t} elseif ( is_tag() ) {\n\t\t\t$classes[] = 'tag-paged-' . $page;\n\t\t} elseif ( is_date() ) {\n\t\t\t$classes[] = 'date-paged-' . $page;\n\t\t} elseif ( is_author() ) {\n\t\t\t$classes[] = 'author-paged-' . $page;\n\t\t} elseif ( is_search() ) {\n\t\t\t$classes[] = 'search-paged-' . $page;\n\t\t} elseif ( is_post_type_archive() ) {\n\t\t\t$classes[] = 'post-type-paged-' . $page;\n\t\t}\n\t}\n\n\tif ( ! empty( $class ) ) {\n\t\tif ( ! is_array( $class ) ) {\n\t\t\t$class = preg_split( '#\\s+#', $class );\n\t\t}\n\t\t$classes = array_merge( $classes, $class );\n\t} else {\n\t\t// Ensure that we always coerce class to being an array.\n\t\t$class = array();\n\t}\n\n\t$classes = array_map( 'esc_attr', $classes );\n\n\t/**\n\t * Filters the list of CSS body class names for the current post or page.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string[] $classes An array of body class names.\n\t * @param string[] $class   An array of additional class names added to the body.\n\t */\n\t$classes = apply_filters( 'body_class', $classes, $class );\n\n\treturn array_unique( $classes );\n}\n\n/**\n * Whether post requires password and correct password has been provided.\n *\n * @since 2.7.0\n *\n * @param int|WP_Post|null $post An optional post. Global $post used if not provided.\n * @return bool false if a password is not required or the correct password cookie is present, true otherwise.\n */\nfunction post_password_required( $post = null ) {\n\t$post = get_post( $post );\n\n\tif ( empty( $post->post_password ) ) {\n\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\treturn apply_filters( 'post_password_required', false, $post );\n\t}\n\n\tif ( ! isset( $_COOKIE[ 'wp-postpass_' . COOKIEHASH ] ) ) {\n\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\treturn apply_filters( 'post_password_required', true, $post );\n\t}\n\n\trequire_once ABSPATH . WPINC . '/class-phpass.php';\n\t$hasher = new PasswordHash( 8, true );\n\n\t$hash = wp_unslash( $_COOKIE[ 'wp-postpass_' . COOKIEHASH ] );\n\tif ( 0 !== strpos( $hash, '$P$B' ) ) {\n\t\t$required = true;\n\t} else {\n\t\t$required = ! $hasher->CheckPassword( $post->post_password, $hash );\n\t}\n\n\t/**\n\t * Filters whether a post requires the user to supply a password.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param bool    $required Whether the user needs to supply a password. True if password has not been\n\t *                          provided or is incorrect, false if password has been supplied or is not required.\n\t * @param WP_Post $post     Post data.\n\t */\n\treturn apply_filters( 'post_password_required', $required, $post );\n}\n\n//\n// Page Template Functions for usage in Themes.\n//\n\n/**\n * The formatted output of a list of pages.\n *\n * Displays page links for paginated posts (i.e. including the `<!--nextpage-->`\n * Quicktag one or more times). This tag must be within The Loop.\n *\n * @since 1.2.0\n * @since 5.1.0 Added the `aria_current` argument.\n *\n * @global int $page\n * @global int $numpages\n * @global int $multipage\n * @global int $more\n *\n * @param string|array $args {\n *     Optional. Array or string of default arguments.\n *\n *     @type string       $before           HTML or text to prepend to each link. Default is `<p> Pages:`.\n *     @type string       $after            HTML or text to append to each link. Default is `</p>`.\n *     @type string       $link_before      HTML or text to prepend to each link, inside the `<a>` tag.\n *                                          Also prepended to the current item, which is not linked. Default empty.\n *     @type string       $link_after       HTML or text to append to each Pages link inside the `<a>` tag.\n *                                          Also appended to the current item, which is not linked. Default empty.\n *     @type string       $aria_current     The value for the aria-current attribute. Possible values are 'page',\n *                                          'step', 'location', 'date', 'time', 'true', 'false'. Default is 'page'.\n *     @type string       $next_or_number   Indicates whether page numbers should be used. Valid values are number\n *                                          and next. Default is 'number'.\n *     @type string       $separator        Text between pagination links. Default is ' '.\n *     @type string       $nextpagelink     Link text for the next page link, if available. Default is 'Next Page'.\n *     @type string       $previouspagelink Link text for the previous page link, if available. Default is 'Previous Page'.\n *     @type string       $pagelink         Format string for page numbers. The % in the parameter string will be\n *                                          replaced with the page number, so 'Page %' generates \"Page 1\", \"Page 2\", etc.\n *                                          Defaults to '%', just the page number.\n *     @type int|bool     $echo             Whether to echo or not. Accepts 1|true or 0|false. Default 1|true.\n * }\n * @return string Formatted output in HTML.\n */\nfunction wp_link_pages( $args = '' ) {\n\tglobal $page, $numpages, $multipage, $more;\n\n\t$defaults = array(\n\t\t'before'           => '<p class=\"post-nav-links\">' . __( 'Pages:' ),\n\t\t'after'            => '</p>',\n\t\t'link_before'      => '',\n\t\t'link_after'       => '',\n\t\t'aria_current'     => 'page',\n\t\t'next_or_number'   => 'number',\n\t\t'separator'        => ' ',\n\t\t'nextpagelink'     => __( 'Next page' ),\n\t\t'previouspagelink' => __( 'Previous page' ),\n\t\t'pagelink'         => '%',\n\t\t'echo'             => 1,\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t/**\n\t * Filters the arguments used in retrieving page links for paginated posts.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param array $parsed_args An array of arguments for page links for paginated posts.\n\t */\n\t$parsed_args = apply_filters( 'wp_link_pages_args', $parsed_args );\n\n\t$output = '';\n\tif ( $multipage ) {\n\t\tif ( 'number' === $parsed_args['next_or_number'] ) {\n\t\t\t$output .= $parsed_args['before'];\n\t\t\tfor ( $i = 1; $i <= $numpages; $i++ ) {\n\t\t\t\t$link = $parsed_args['link_before'] . str_replace( '%', $i, $parsed_args['pagelink'] ) . $parsed_args['link_after'];\n\t\t\t\tif ( $i != $page || ! $more && 1 == $page ) {\n\t\t\t\t\t$link = _wp_link_page( $i ) . $link . '</a>';\n\t\t\t\t} elseif ( $i === $page ) {\n\t\t\t\t\t$link = '<span class=\"post-page-numbers current\" aria-current=\"' . esc_attr( $parsed_args['aria_current'] ) . '\">' . $link . '</span>';\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * Filters the HTML output of individual page number links.\n\t\t\t\t *\n\t\t\t\t * @since 3.6.0\n\t\t\t\t *\n\t\t\t\t * @param string $link The page number HTML output.\n\t\t\t\t * @param int    $i    Page number for paginated posts' page links.\n\t\t\t\t */\n\t\t\t\t$link = apply_filters( 'wp_link_pages_link', $link, $i );\n\n\t\t\t\t// Use the custom links separator beginning with the second link.\n\t\t\t\t$output .= ( 1 === $i ) ? ' ' : $parsed_args['separator'];\n\t\t\t\t$output .= $link;\n\t\t\t}\n\t\t\t$output .= $parsed_args['after'];\n\t\t} elseif ( $more ) {\n\t\t\t$output .= $parsed_args['before'];\n\t\t\t$prev    = $page - 1;\n\t\t\tif ( $prev > 0 ) {\n\t\t\t\t$link = _wp_link_page( $prev ) . $parsed_args['link_before'] . $parsed_args['previouspagelink'] . $parsed_args['link_after'] . '</a>';\n\n\t\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t\t$output .= apply_filters( 'wp_link_pages_link', $link, $prev );\n\t\t\t}\n\t\t\t$next = $page + 1;\n\t\t\tif ( $next <= $numpages ) {\n\t\t\t\tif ( $prev ) {\n\t\t\t\t\t$output .= $parsed_args['separator'];\n\t\t\t\t}\n\t\t\t\t$link = _wp_link_page( $next ) . $parsed_args['link_before'] . $parsed_args['nextpagelink'] . $parsed_args['link_after'] . '</a>';\n\n\t\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t\t$output .= apply_filters( 'wp_link_pages_link', $link, $next );\n\t\t\t}\n\t\t\t$output .= $parsed_args['after'];\n\t\t}\n\t}\n\n\t/**\n\t * Filters the HTML output of page links for paginated posts.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param string $output HTML output of paginated posts' page links.\n\t * @param array  $args   An array of arguments.\n\t */\n\t$html = apply_filters( 'wp_link_pages', $output, $args );\n\n\tif ( $parsed_args['echo'] ) {\n\t\techo $html;\n\t}\n\treturn $html;\n}\n\n/**\n * Helper function for wp_link_pages().\n *\n * @since 3.1.0\n * @access private\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param int $i Page number.\n * @return string Link.\n */\nfunction _wp_link_page( $i ) {\n\tglobal $wp_rewrite;\n\t$post       = get_post();\n\t$query_args = array();\n\n\tif ( 1 == $i ) {\n\t\t$url = get_permalink();\n\t} else {\n\t\tif ( ! get_option( 'permalink_structure' ) || in_array( $post->post_status, array( 'draft', 'pending' ), true ) ) {\n\t\t\t$url = add_query_arg( 'page', $i, get_permalink() );\n\t\t} elseif ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post->ID ) {\n\t\t\t$url = trailingslashit( get_permalink() ) . user_trailingslashit( \"$wp_rewrite->pagination_base/\" . $i, 'single_paged' );\n\t\t} else {\n\t\t\t$url = trailingslashit( get_permalink() ) . user_trailingslashit( $i, 'single_paged' );\n\t\t}\n\t}\n\n\tif ( is_preview() ) {\n\n\t\tif ( ( 'draft' !== $post->post_status ) && isset( $_GET['preview_id'], $_GET['preview_nonce'] ) ) {\n\t\t\t$query_args['preview_id']    = wp_unslash( $_GET['preview_id'] );\n\t\t\t$query_args['preview_nonce'] = wp_unslash( $_GET['preview_nonce'] );\n\t\t}\n\n\t\t$url = get_preview_post_link( $post, $query_args, $url );\n\t}\n\n\treturn '<a href=\"' . esc_url( $url ) . '\" class=\"post-page-numbers\">';\n}\n\n//\n// Post-meta: Custom per-post fields.\n//\n\n/**\n * Retrieve post custom meta data field.\n *\n * @since 1.5.0\n *\n * @param string $key Meta data key name.\n * @return array|string|false Array of values, or single value if only one element exists.\n *                            False if the key does not exist.\n */\nfunction post_custom( $key = '' ) {\n\t$custom = get_post_custom();\n\n\tif ( ! isset( $custom[ $key ] ) ) {\n\t\treturn false;\n\t} elseif ( 1 === count( $custom[ $key ] ) ) {\n\t\treturn $custom[ $key ][0];\n\t} else {\n\t\treturn $custom[ $key ];\n\t}\n}\n\n/**\n * Display a list of post custom fields.\n *\n * @since 1.2.0\n *\n * @internal This will probably change at some point...\n */\nfunction the_meta() {\n\t$keys = get_post_custom_keys();\n\tif ( $keys ) {\n\t\t$li_html = '';\n\t\tforeach ( (array) $keys as $key ) {\n\t\t\t$keyt = trim( $key );\n\t\t\tif ( is_protected_meta( $keyt, 'post' ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$values = array_map( 'trim', get_post_custom_values( $key ) );\n\t\t\t$value  = implode( ', ', $values );\n\n\t\t\t$html = sprintf(\n\t\t\t\t\"<li><span class='post-meta-key'>%s</span> %s</li>\\n\",\n\t\t\t\t/* translators: %s: Post custom field name. */\n\t\t\t\tsprintf( _x( '%s:', 'Post custom field name' ), $key ),\n\t\t\t\t$value\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Filters the HTML output of the li element in the post custom fields list.\n\t\t\t *\n\t\t\t * @since 2.2.0\n\t\t\t *\n\t\t\t * @param string $html  The HTML output for the li element.\n\t\t\t * @param string $key   Meta key.\n\t\t\t * @param string $value Meta value.\n\t\t\t */\n\t\t\t$li_html .= apply_filters( 'the_meta_key', $html, $key, $value );\n\t\t}\n\n\t\tif ( $li_html ) {\n\t\t\techo \"<ul class='post-meta'>\\n{$li_html}</ul>\\n\";\n\t\t}\n\t}\n}\n\n//\n// Pages.\n//\n\n/**\n * Retrieve or display a list of pages as a dropdown (select list).\n *\n * @since 2.1.0\n * @since 4.2.0 The `$value_field` argument was added.\n * @since 4.3.0 The `$class` argument was added.\n *\n * @see get_pages()\n *\n * @param array|string $args {\n *     Optional. Array or string of arguments to generate a page dropdown. See `get_pages()` for additional arguments.\n *\n *     @type int          $depth                 Maximum depth. Default 0.\n *     @type int          $child_of              Page ID to retrieve child pages of. Default 0.\n *     @type int|string   $selected              Value of the option that should be selected. Default 0.\n *     @type bool|int     $echo                  Whether to echo or return the generated markup. Accepts 0, 1,\n *                                               or their bool equivalents. Default 1.\n *     @type string       $name                  Value for the 'name' attribute of the select element.\n *                                               Default 'page_id'.\n *     @type string       $id                    Value for the 'id' attribute of the select element.\n *     @type string       $class                 Value for the 'class' attribute of the select element. Default: none.\n *                                               Defaults to the value of `$name`.\n *     @type string       $show_option_none      Text to display for showing no pages. Default empty (does not display).\n *     @type string       $show_option_no_change Text to display for \"no change\" option. Default empty (does not display).\n *     @type string       $option_none_value     Value to use when no page is selected. Default empty.\n *     @type string       $value_field           Post field used to populate the 'value' attribute of the option\n *                                               elements. Accepts any valid post field. Default 'ID'.\n * }\n * @return string HTML dropdown list of pages.\n */\nfunction wp_dropdown_pages( $args = '' ) {\n\t$defaults = array(\n\t\t'depth'                 => 0,\n\t\t'child_of'              => 0,\n\t\t'selected'              => 0,\n\t\t'echo'                  => 1,\n\t\t'name'                  => 'page_id',\n\t\t'id'                    => '',\n\t\t'class'                 => '',\n\t\t'show_option_none'      => '',\n\t\t'show_option_no_change' => '',\n\t\t'option_none_value'     => '',\n\t\t'value_field'           => 'ID',\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t$pages  = get_pages( $parsed_args );\n\t$output = '';\n\t// Back-compat with old system where both id and name were based on $name argument.\n\tif ( empty( $parsed_args['id'] ) ) {\n\t\t$parsed_args['id'] = $parsed_args['name'];\n\t}\n\n\tif ( ! empty( $pages ) ) {\n\t\t$class = '';\n\t\tif ( ! empty( $parsed_args['class'] ) ) {\n\t\t\t$class = \" class='\" . esc_attr( $parsed_args['class'] ) . \"'\";\n\t\t}\n\n\t\t$output = \"<select name='\" . esc_attr( $parsed_args['name'] ) . \"'\" . $class . \" id='\" . esc_attr( $parsed_args['id'] ) . \"'>\\n\";\n\t\tif ( $parsed_args['show_option_no_change'] ) {\n\t\t\t$output .= \"\\t<option value=\\\"-1\\\">\" . $parsed_args['show_option_no_change'] . \"</option>\\n\";\n\t\t}\n\t\tif ( $parsed_args['show_option_none'] ) {\n\t\t\t$output .= \"\\t<option value=\\\"\" . esc_attr( $parsed_args['option_none_value'] ) . '\">' . $parsed_args['show_option_none'] . \"</option>\\n\";\n\t\t}\n\t\t$output .= walk_page_dropdown_tree( $pages, $parsed_args['depth'], $parsed_args );\n\t\t$output .= \"</select>\\n\";\n\t}\n\n\t/**\n\t * Filters the HTML output of a list of pages as a drop down.\n\t *\n\t * @since 2.1.0\n\t * @since 4.4.0 `$parsed_args` and `$pages` added as arguments.\n\t *\n\t * @param string    $output      HTML output for drop down list of pages.\n\t * @param array     $parsed_args The parsed arguments array.\n\t * @param WP_Post[] $pages       Array of the page objects.\n\t */\n\t$html = apply_filters( 'wp_dropdown_pages', $output, $parsed_args, $pages );\n\n\tif ( $parsed_args['echo'] ) {\n\t\techo $html;\n\t}\n\n\treturn $html;\n}\n\n/**\n * Retrieve or display a list of pages (or hierarchical post type items) in list (li) format.\n *\n * @since 1.5.0\n * @since 4.7.0 Added the `item_spacing` argument.\n *\n * @see get_pages()\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param array|string $args {\n *     Optional. Array or string of arguments to generate a list of pages. See `get_pages()` for additional arguments.\n *\n *     @type int          $child_of     Display only the sub-pages of a single page by ID. Default 0 (all pages).\n *     @type string       $authors      Comma-separated list of author IDs. Default empty (all authors).\n *     @type string       $date_format  PHP date format to use for the listed pages. Relies on the 'show_date' parameter.\n *                                      Default is the value of 'date_format' option.\n *     @type int          $depth        Number of levels in the hierarchy of pages to include in the generated list.\n *                                      Accepts -1 (any depth), 0 (all pages), 1 (top-level pages only), and n (pages to\n *                                      the given n depth). Default 0.\n *     @type bool         $echo         Whether or not to echo the list of pages. Default true.\n *     @type string       $exclude      Comma-separated list of page IDs to exclude. Default empty.\n *     @type array        $include      Comma-separated list of page IDs to include. Default empty.\n *     @type string       $link_after   Text or HTML to follow the page link label. Default null.\n *     @type string       $link_before  Text or HTML to precede the page link label. Default null.\n *     @type string       $post_type    Post type to query for. Default 'page'.\n *     @type string|array $post_status  Comma-separated list or array of post statuses to include. Default 'publish'.\n *     @type string       $show_date    Whether to display the page publish or modified date for each page. Accepts\n *                                      'modified' or any other value. An empty value hides the date. Default empty.\n *     @type string       $sort_column  Comma-separated list of column names to sort the pages by. Accepts 'post_author',\n *                                      'post_date', 'post_title', 'post_name', 'post_modified', 'post_modified_gmt',\n *                                      'menu_order', 'post_parent', 'ID', 'rand', or 'comment_count'. Default 'post_title'.\n *     @type string       $title_li     List heading. Passing a null or empty value will result in no heading, and the list\n *                                      will not be wrapped with unordered list `<ul>` tags. Default 'Pages'.\n *     @type string       $item_spacing Whether to preserve whitespace within the menu's HTML. Accepts 'preserve' or 'discard'.\n *                                      Default 'preserve'.\n *     @type Walker       $walker       Walker instance to use for listing pages. Default empty (Walker_Page).\n * }\n * @return void|string Void if 'echo' argument is true, HTML list of pages if 'echo' is false.\n */\nfunction wp_list_pages( $args = '' ) {\n\t$defaults = array(\n\t\t'depth'        => 0,\n\t\t'show_date'    => '',\n\t\t'date_format'  => get_option( 'date_format' ),\n\t\t'child_of'     => 0,\n\t\t'exclude'      => '',\n\t\t'title_li'     => __( 'Pages' ),\n\t\t'echo'         => 1,\n\t\t'authors'      => '',\n\t\t'sort_column'  => 'menu_order, post_title',\n\t\t'link_before'  => '',\n\t\t'link_after'   => '',\n\t\t'item_spacing' => 'preserve',\n\t\t'walker'       => '',\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\tif ( ! in_array( $parsed_args['item_spacing'], array( 'preserve', 'discard' ), true ) ) {\n\t\t// Invalid value, fall back to default.\n\t\t$parsed_args['item_spacing'] = $defaults['item_spacing'];\n\t}\n\n\t$output       = '';\n\t$current_page = 0;\n\n\t// Sanitize, mostly to keep spaces out.\n\t$parsed_args['exclude'] = preg_replace( '/[^0-9,]/', '', $parsed_args['exclude'] );\n\n\t// Allow plugins to filter an array of excluded pages (but don't put a nullstring into the array).\n\t$exclude_array = ( $parsed_args['exclude'] ) ? explode( ',', $parsed_args['exclude'] ) : array();\n\n\t/**\n\t * Filters the array of pages to exclude from the pages list.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string[] $exclude_array An array of page IDs to exclude.\n\t */\n\t$parsed_args['exclude'] = implode( ',', apply_filters( 'wp_list_pages_excludes', $exclude_array ) );\n\n\t$parsed_args['hierarchical'] = 0;\n\n\t// Query pages.\n\t$pages = get_pages( $parsed_args );\n\n\tif ( ! empty( $pages ) ) {\n\t\tif ( $parsed_args['title_li'] ) {\n\t\t\t$output .= '<li class=\"pagenav\">' . $parsed_args['title_li'] . '<ul>';\n\t\t}\n\t\tglobal $wp_query;\n\t\tif ( is_page() || is_attachment() || $wp_query->is_posts_page ) {\n\t\t\t$current_page = get_queried_object_id();\n\t\t} elseif ( is_singular() ) {\n\t\t\t$queried_object = get_queried_object();\n\t\t\tif ( is_post_type_hierarchical( $queried_object->post_type ) ) {\n\t\t\t\t$current_page = $queried_object->ID;\n\t\t\t}\n\t\t}\n\n\t\t$output .= walk_page_tree( $pages, $parsed_args['depth'], $current_page, $parsed_args );\n\n\t\tif ( $parsed_args['title_li'] ) {\n\t\t\t$output .= '</ul></li>';\n\t\t}\n\t}\n\n\t/**\n\t * Filters the HTML output of the pages to list.\n\t *\n\t * @since 1.5.1\n\t * @since 4.4.0 `$pages` added as arguments.\n\t *\n\t * @see wp_list_pages()\n\t *\n\t * @param string    $output      HTML output of the pages list.\n\t * @param array     $parsed_args An array of page-listing arguments.\n\t * @param WP_Post[] $pages       Array of the page objects.\n\t */\n\t$html = apply_filters( 'wp_list_pages', $output, $parsed_args, $pages );\n\n\tif ( $parsed_args['echo'] ) {\n\t\techo $html;\n\t} else {\n\t\treturn $html;\n\t}\n}\n\n/**\n * Displays or retrieves a list of pages with an optional home link.\n *\n * The arguments are listed below and part of the arguments are for wp_list_pages() function.\n * Check that function for more info on those arguments.\n *\n * @since 2.7.0\n * @since 4.4.0 Added `menu_id`, `container`, `before`, `after`, and `walker` arguments.\n * @since 4.7.0 Added the `item_spacing` argument.\n *\n * @param array|string $args {\n *     Optional. Array or string of arguments to generate a page menu. See `wp_list_pages()` for additional arguments.\n *\n *     @type string          $sort_column  How to sort the list of pages. Accepts post column names.\n *                                         Default 'menu_order, post_title'.\n *     @type string          $menu_id      ID for the div containing the page list. Default is empty string.\n *     @type string          $menu_class   Class to use for the element containing the page list. Default 'menu'.\n *     @type string          $container    Element to use for the element containing the page list. Default 'div'.\n *     @type bool            $echo         Whether to echo the list or return it. Accepts true (echo) or false (return).\n *                                         Default true.\n *     @type int|bool|string $show_home    Whether to display the link to the home page. Can just enter the text\n *                                         you'd like shown for the home link. 1|true defaults to 'Home'.\n *     @type string          $link_before  The HTML or text to prepend to $show_home text. Default empty.\n *     @type string          $link_after   The HTML or text to append to $show_home text. Default empty.\n *     @type string          $before       The HTML or text to prepend to the menu. Default is '<ul>'.\n *     @type string          $after        The HTML or text to append to the menu. Default is '</ul>'.\n *     @type string          $item_spacing Whether to preserve whitespace within the menu's HTML. Accepts 'preserve'\n *                                         or 'discard'. Default 'discard'.\n *     @type Walker          $walker       Walker instance to use for listing pages. Default empty (Walker_Page).\n * }\n * @return void|string Void if 'echo' argument is true, HTML menu if 'echo' is false.\n */\nfunction wp_page_menu( $args = array() ) {\n\t$defaults = array(\n\t\t'sort_column'  => 'menu_order, post_title',\n\t\t'menu_id'      => '',\n\t\t'menu_class'   => 'menu',\n\t\t'container'    => 'div',\n\t\t'echo'         => true,\n\t\t'link_before'  => '',\n\t\t'link_after'   => '',\n\t\t'before'       => '<ul>',\n\t\t'after'        => '</ul>',\n\t\t'item_spacing' => 'discard',\n\t\t'walker'       => '',\n\t);\n\t$args     = wp_parse_args( $args, $defaults );\n\n\tif ( ! in_array( $args['item_spacing'], array( 'preserve', 'discard' ), true ) ) {\n\t\t// Invalid value, fall back to default.\n\t\t$args['item_spacing'] = $defaults['item_spacing'];\n\t}\n\n\tif ( 'preserve' === $args['item_spacing'] ) {\n\t\t$t = \"\\t\";\n\t\t$n = \"\\n\";\n\t} else {\n\t\t$t = '';\n\t\t$n = '';\n\t}\n\n\t/**\n\t * Filters the arguments used to generate a page-based menu.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @see wp_page_menu()\n\t *\n\t * @param array $args An array of page menu arguments.\n\t */\n\t$args = apply_filters( 'wp_page_menu_args', $args );\n\n\t$menu = '';\n\n\t$list_args = $args;\n\n\t// Show Home in the menu.\n\tif ( ! empty( $args['show_home'] ) ) {\n\t\tif ( true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home'] ) {\n\t\t\t$text = __( 'Home' );\n\t\t} else {\n\t\t\t$text = $args['show_home'];\n\t\t}\n\t\t$class = '';\n\t\tif ( is_front_page() && ! is_paged() ) {\n\t\t\t$class = 'class=\"current_page_item\"';\n\t\t}\n\t\t$menu .= '<li ' . $class . '><a href=\"' . home_url( '/' ) . '\">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';\n\t\t// If the front page is a page, add it to the exclude list.\n\t\tif ( 'page' === get_option( 'show_on_front' ) ) {\n\t\t\tif ( ! empty( $list_args['exclude'] ) ) {\n\t\t\t\t$list_args['exclude'] .= ',';\n\t\t\t} else {\n\t\t\t\t$list_args['exclude'] = '';\n\t\t\t}\n\t\t\t$list_args['exclude'] .= get_option( 'page_on_front' );\n\t\t}\n\t}\n\n\t$list_args['echo']     = false;\n\t$list_args['title_li'] = '';\n\t$menu                 .= wp_list_pages( $list_args );\n\n\t$container = sanitize_text_field( $args['container'] );\n\n\t// Fallback in case `wp_nav_menu()` was called without a container.\n\tif ( empty( $container ) ) {\n\t\t$container = 'div';\n\t}\n\n\tif ( $menu ) {\n\n\t\t// wp_nav_menu() doesn't set before and after.\n\t\tif ( isset( $args['fallback_cb'] ) &&\n\t\t\t'wp_page_menu' === $args['fallback_cb'] &&\n\t\t\t'ul' !== $container ) {\n\t\t\t$args['before'] = \"<ul>{$n}\";\n\t\t\t$args['after']  = '</ul>';\n\t\t}\n\n\t\t$menu = $args['before'] . $menu . $args['after'];\n\t}\n\n\t$attrs = '';\n\tif ( ! empty( $args['menu_id'] ) ) {\n\t\t$attrs .= ' id=\"' . esc_attr( $args['menu_id'] ) . '\"';\n\t}\n\n\tif ( ! empty( $args['menu_class'] ) ) {\n\t\t$attrs .= ' class=\"' . esc_attr( $args['menu_class'] ) . '\"';\n\t}\n\n\t$menu = \"<{$container}{$attrs}>\" . $menu . \"</{$container}>{$n}\";\n\n\t/**\n\t * Filters the HTML output of a page-based menu.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @see wp_page_menu()\n\t *\n\t * @param string $menu The HTML output.\n\t * @param array  $args An array of arguments.\n\t */\n\t$menu = apply_filters( 'wp_page_menu', $menu, $args );\n\n\tif ( $args['echo'] ) {\n\t\techo $menu;\n\t} else {\n\t\treturn $menu;\n\t}\n}\n\n//\n// Page helpers.\n//\n\n/**\n * Retrieve HTML list content for page list.\n *\n * @uses Walker_Page to create HTML list content.\n * @since 2.1.0\n *\n * @param array $pages\n * @param int   $depth\n * @param int   $current_page\n * @param array $r\n * @return string\n */\nfunction walk_page_tree( $pages, $depth, $current_page, $r ) {\n\tif ( empty( $r['walker'] ) ) {\n\t\t$walker = new Walker_Page;\n\t} else {\n\t\t/**\n\t\t * @var Walker $walker\n\t\t */\n\t\t$walker = $r['walker'];\n\t}\n\n\tforeach ( (array) $pages as $page ) {\n\t\tif ( $page->post_parent ) {\n\t\t\t$r['pages_with_children'][ $page->post_parent ] = true;\n\t\t}\n\t}\n\n\treturn $walker->walk( $pages, $depth, $r, $current_page );\n}\n\n/**\n * Retrieve HTML dropdown (select) content for page list.\n *\n * @since 2.1.0\n * @since 5.3.0 Formalized the existing `...$args` parameter by adding it\n *              to the function signature.\n *\n * @uses Walker_PageDropdown to create HTML dropdown content.\n * @see Walker_PageDropdown::walk() for parameters and return description.\n *\n * @param mixed ...$args Elements array, maximum hierarchical depth and optional additional arguments.\n * @return string\n */\nfunction walk_page_dropdown_tree( ...$args ) {\n\tif ( empty( $args[2]['walker'] ) ) { // The user's options are the third parameter.\n\t\t$walker = new Walker_PageDropdown;\n\t} else {\n\t\t/**\n\t\t * @var Walker $walker\n\t\t */\n\t\t$walker = $args[2]['walker'];\n\t}\n\n\treturn $walker->walk( ...$args );\n}\n\n//\n// Attachments.\n//\n\n/**\n * Display an attachment page link using an image or icon.\n *\n * @since 2.0.0\n *\n * @param int|WP_Post $id Optional. Post ID or post object.\n * @param bool        $fullsize     Optional. Whether to use full size. Default false.\n * @param bool        $deprecated   Deprecated. Not used.\n * @param bool        $permalink    Optional. Whether to include permalink. Default false.\n */\nfunction the_attachment_link( $id = 0, $fullsize = false, $deprecated = false, $permalink = false ) {\n\tif ( ! empty( $deprecated ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '2.5.0' );\n\t}\n\n\tif ( $fullsize ) {\n\t\techo wp_get_attachment_link( $id, 'full', $permalink );\n\t} else {\n\t\techo wp_get_attachment_link( $id, 'thumbnail', $permalink );\n\t}\n}\n\n/**\n * Retrieve an attachment page link using an image or icon, if possible.\n *\n * @since 2.5.0\n * @since 4.4.0 The `$id` parameter can now accept either a post ID or `WP_Post` object.\n *\n * @param int|WP_Post  $id        Optional. Post ID or post object.\n * @param string|array $size      Optional. Image size. Accepts any valid image size, or an array\n *                                of width and height values in pixels (in that order).\n *                                Default 'thumbnail'.\n * @param bool         $permalink Optional. Whether to add permalink to image. Default false.\n * @param bool         $icon      Optional. Whether the attachment is an icon. Default false.\n * @param string|false $text      Optional. Link text to use. Activated by passing a string, false otherwise.\n *                                Default false.\n * @param array|string $attr      Optional. Array or string of attributes. Default empty.\n * @return string HTML content.\n */\nfunction wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false, $attr = '' ) {\n\t$_post = get_post( $id );\n\n\tif ( empty( $_post ) || ( 'attachment' !== $_post->post_type ) || ! wp_get_attachment_url( $_post->ID ) ) {\n\t\treturn __( 'Missing Attachment' );\n\t}\n\n\t$url = wp_get_attachment_url( $_post->ID );\n\n\tif ( $permalink ) {\n\t\t$url = get_attachment_link( $_post->ID );\n\t}\n\n\tif ( $text ) {\n\t\t$link_text = $text;\n\t} elseif ( $size && 'none' !== $size ) {\n\t\t$link_text = wp_get_attachment_image( $_post->ID, $size, $icon, $attr );\n\t} else {\n\t\t$link_text = '';\n\t}\n\n\tif ( '' === trim( $link_text ) ) {\n\t\t$link_text = $_post->post_title;\n\t}\n\n\tif ( '' === trim( $link_text ) ) {\n\t\t$link_text = esc_html( pathinfo( get_attached_file( $_post->ID ), PATHINFO_FILENAME ) );\n\t}\n\t/**\n\t * Filters a retrieved attachment page link.\n\t *\n\t * @since 2.7.0\n\t * @since 5.1.0 Added the $attr parameter.\n\t *\n\t * @param string       $link_html The page link HTML output.\n\t * @param int          $id        Post ID.\n\t * @param string|array $size      Size of the image. Image size or array of width and height values (in that order).\n\t *                                Default 'thumbnail'.\n\t * @param bool         $permalink Whether to add permalink to image. Default false.\n\t * @param bool         $icon      Whether to include an icon. Default false.\n\t * @param string|bool  $text      If string, will be link text. Default false.\n\t * @param array|string $attr      Array or string of attributes. Default empty.\n\t */\n\treturn apply_filters( 'wp_get_attachment_link', \"<a href='\" . esc_url( $url ) . \"'>$link_text</a>\", $id, $size, $permalink, $icon, $text, $attr );\n}\n\n/**\n * Wrap attachment in paragraph tag before content.\n *\n * @since 2.0.0\n *\n * @param string $content\n * @return string\n */\nfunction prepend_attachment( $content ) {\n\t$post = get_post();\n\n\tif ( empty( $post->post_type ) || 'attachment' !== $post->post_type ) {\n\t\treturn $content;\n\t}\n\n\tif ( wp_attachment_is( 'video', $post ) ) {\n\t\t$meta = wp_get_attachment_metadata( get_the_ID() );\n\t\t$atts = array( 'src' => wp_get_attachment_url() );\n\t\tif ( ! empty( $meta['width'] ) && ! empty( $meta['height'] ) ) {\n\t\t\t$atts['width']  = (int) $meta['width'];\n\t\t\t$atts['height'] = (int) $meta['height'];\n\t\t}\n\t\tif ( has_post_thumbnail() ) {\n\t\t\t$atts['poster'] = wp_get_attachment_url( get_post_thumbnail_id() );\n\t\t}\n\t\t$p = wp_video_shortcode( $atts );\n\t} elseif ( wp_attachment_is( 'audio', $post ) ) {\n\t\t$p = wp_audio_shortcode( array( 'src' => wp_get_attachment_url() ) );\n\t} else {\n\t\t$p = '<p class=\"attachment\">';\n\t\t// Show the medium sized image representation of the attachment if available, and link to the raw file.\n\t\t$p .= wp_get_attachment_link( 0, 'medium', false );\n\t\t$p .= '</p>';\n\t}\n\n\t/**\n\t * Filters the attachment markup to be prepended to the post content.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @see prepend_attachment()\n\t *\n\t * @param string $p The attachment HTML output.\n\t */\n\t$p = apply_filters( 'prepend_attachment', $p );\n\n\treturn \"$p\\n$content\";\n}\n\n//\n// Misc.\n//\n\n/**\n * Retrieve protected post password form content.\n *\n * @since 1.0.0\n *\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.\n * @return string HTML content for password form for password protected post.\n */\nfunction get_the_password_form( $post = 0 ) {\n\t$post   = get_post( $post );\n\t$label  = 'pwbox-' . ( empty( $post->ID ) ? rand() : $post->ID );\n\t$output = '<form action=\"' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '\" class=\"post-password-form\" method=\"post\">\n\t<p>' . __( 'This content is password protected. To view it please enter your password below:' ) . '</p>\n\t<p><label for=\"' . $label . '\">' . __( 'Password:' ) . ' <input name=\"post_password\" id=\"' . $label . '\" type=\"password\" size=\"20\" /></label> <input type=\"submit\" name=\"Submit\" value=\"' . esc_attr_x( 'Enter', 'post password form' ) . '\" /></p></form>\n\t';\n\n\t/**\n\t * Filters the HTML output for the protected post password form.\n\t *\n\t * If modifying the password field, please note that the core database schema\n\t * limits the password field to 20 characters regardless of the value of the\n\t * size attribute in the form input.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param string $output The password form HTML output.\n\t */\n\treturn apply_filters( 'the_password_form', $output );\n}\n\n/**\n * Determines whether currently in a page template.\n *\n * This template tag allows you to determine if you are in a page template.\n * You can optionally provide a template filename or array of template filenames\n * and then the check will be specific to that template.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.5.0\n * @since 4.2.0 The `$template` parameter was changed to also accept an array of page templates.\n * @since 4.7.0 Now works with any post type, not just pages.\n *\n * @param string|array $template The specific template filename or array of templates to match.\n * @return bool True on success, false on failure.\n */\nfunction is_page_template( $template = '' ) {\n\tif ( ! is_singular() ) {\n\t\treturn false;\n\t}\n\n\t$page_template = get_page_template_slug( get_queried_object_id() );\n\n\tif ( empty( $template ) ) {\n\t\treturn (bool) $page_template;\n\t}\n\n\tif ( $template == $page_template ) {\n\t\treturn true;\n\t}\n\n\tif ( is_array( $template ) ) {\n\t\tif ( ( in_array( 'default', $template, true ) && ! $page_template )\n\t\t\t|| in_array( $page_template, $template, true )\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn ( 'default' === $template && ! $page_template );\n}\n\n/**\n * Get the specific template filename for a given post.\n *\n * @since 3.4.0\n * @since 4.7.0 Now works with any post type, not just pages.\n *\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.\n * @return string|false Page template filename. Returns an empty string when the default page template\n *                      is in use. Returns false if the post does not exist.\n */\nfunction get_page_template_slug( $post = null ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$template = get_post_meta( $post->ID, '_wp_page_template', true );\n\n\tif ( ! $template || 'default' === $template ) {\n\t\treturn '';\n\t}\n\n\treturn $template;\n}\n\n/**\n * Retrieve formatted date timestamp of a revision (linked to that revisions's page).\n *\n * @since 2.6.0\n *\n * @param int|object $revision Revision ID or revision object.\n * @param bool       $link     Optional. Whether to link to revision's page. Default true.\n * @return string|false i18n formatted datetimestamp or localized 'Current Revision'.\n */\nfunction wp_post_revision_title( $revision, $link = true ) {\n\t$revision = get_post( $revision );\n\tif ( ! $revision ) {\n\t\treturn $revision;\n\t}\n\n\tif ( ! in_array( $revision->post_type, array( 'post', 'page', 'revision' ), true ) ) {\n\t\treturn false;\n\t}\n\n\t/* translators: Revision date format, see https://www.php.net/date */\n\t$datef = _x( 'F j, Y @ H:i:s', 'revision date format' );\n\t/* translators: %s: Revision date. */\n\t$autosavef = __( '%s [Autosave]' );\n\t/* translators: %s: Revision date. */\n\t$currentf = __( '%s [Current Revision]' );\n\n\t$date      = date_i18n( $datef, strtotime( $revision->post_modified ) );\n\t$edit_link = get_edit_post_link( $revision->ID );\n\tif ( $link && current_user_can( 'edit_post', $revision->ID ) && $edit_link ) {\n\t\t$date = \"<a href='$edit_link'>$date</a>\";\n\t}\n\n\tif ( ! wp_is_post_revision( $revision ) ) {\n\t\t$date = sprintf( $currentf, $date );\n\t} elseif ( wp_is_post_autosave( $revision ) ) {\n\t\t$date = sprintf( $autosavef, $date );\n\t}\n\n\treturn $date;\n}\n\n/**\n * Retrieve formatted date timestamp of a revision (linked to that revisions's page).\n *\n * @since 3.6.0\n *\n * @param int|object $revision Revision ID or revision object.\n * @param bool       $link     Optional. Whether to link to revision's page. Default true.\n * @return string|false gravatar, user, i18n formatted datetimestamp or localized 'Current Revision'.\n */\nfunction wp_post_revision_title_expanded( $revision, $link = true ) {\n\t$revision = get_post( $revision );\n\tif ( ! $revision ) {\n\t\treturn $revision;\n\t}\n\n\tif ( ! in_array( $revision->post_type, array( 'post', 'page', 'revision' ), true ) ) {\n\t\treturn false;\n\t}\n\n\t$author = get_the_author_meta( 'display_name', $revision->post_author );\n\t/* translators: Revision date format, see https://www.php.net/date */\n\t$datef = _x( 'F j, Y @ H:i:s', 'revision date format' );\n\n\t$gravatar = get_avatar( $revision->post_author, 24 );\n\n\t$date      = date_i18n( $datef, strtotime( $revision->post_modified ) );\n\t$edit_link = get_edit_post_link( $revision->ID );\n\tif ( $link && current_user_can( 'edit_post', $revision->ID ) && $edit_link ) {\n\t\t$date = \"<a href='$edit_link'>$date</a>\";\n\t}\n\n\t$revision_date_author = sprintf(\n\t\t/* translators: Post revision title. 1: Author avatar, 2: Author name, 3: Time ago, 4: Date. */\n\t\t__( '%1$s %2$s, %3$s ago (%4$s)' ),\n\t\t$gravatar,\n\t\t$author,\n\t\thuman_time_diff( strtotime( $revision->post_modified_gmt ) ),\n\t\t$date\n\t);\n\n\t/* translators: %s: Revision date with author avatar. */\n\t$autosavef = __( '%s [Autosave]' );\n\t/* translators: %s: Revision date with author avatar. */\n\t$currentf = __( '%s [Current Revision]' );\n\n\tif ( ! wp_is_post_revision( $revision ) ) {\n\t\t$revision_date_author = sprintf( $currentf, $revision_date_author );\n\t} elseif ( wp_is_post_autosave( $revision ) ) {\n\t\t$revision_date_author = sprintf( $autosavef, $revision_date_author );\n\t}\n\n\t/**\n\t * Filters the formatted author and date for a revision.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string  $revision_date_author The formatted string.\n\t * @param WP_Post $revision             The revision object.\n\t * @param bool    $link                 Whether to link to the revisions page, as passed into\n\t *                                      wp_post_revision_title_expanded().\n\t */\n\treturn apply_filters( 'wp_post_revision_title_expanded', $revision_date_author, $revision, $link );\n}\n\n/**\n * Display a list of a post's revisions.\n *\n * Can output either a UL with edit links or a TABLE with diff interface, and\n * restore action links.\n *\n * @since 2.6.0\n *\n * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.\n * @param string      $type    'all' (default), 'revision' or 'autosave'\n */\nfunction wp_list_post_revisions( $post_id = 0, $type = 'all' ) {\n\t$post = get_post( $post_id );\n\tif ( ! $post ) {\n\t\treturn;\n\t}\n\n\t// $args array with (parent, format, right, left, type) deprecated since 3.6.\n\tif ( is_array( $type ) ) {\n\t\t$type = ! empty( $type['type'] ) ? $type['type'] : $type;\n\t\t_deprecated_argument( __FUNCTION__, '3.6.0' );\n\t}\n\n\t$revisions = wp_get_post_revisions( $post->ID );\n\tif ( ! $revisions ) {\n\t\treturn;\n\t}\n\n\t$rows = '';\n\tforeach ( $revisions as $revision ) {\n\t\tif ( ! current_user_can( 'read_post', $revision->ID ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$is_autosave = wp_is_post_autosave( $revision );\n\t\tif ( ( 'revision' === $type && $is_autosave ) || ( 'autosave' === $type && ! $is_autosave ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$rows .= \"\\t<li>\" . wp_post_revision_title_expanded( $revision ) . \"</li>\\n\";\n\t}\n\n\techo \"<div class='hide-if-js'><p>\" . __( 'JavaScript must be enabled to use this feature.' ) . \"</p></div>\\n\";\n\n\techo \"<ul class='post-revisions hide-if-no-js'>\\n\";\n\techo $rows;\n\techo '</ul>';\n}\n", "num_lines": 1961}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Post Thumbnail Template Functions.\n *\n * Support for post thumbnails.\n * Theme's functions.php must call add_theme_support( 'post-thumbnails' ) to use these.\n *\n * @package WordPress\n * @subpackage Template\n */\n\n/**\n * Determines whether a post has an image attached.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.9.0\n * @since 4.4.0 `$post` can be a post ID or WP_Post object.\n *\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.\n * @return bool Whether the post has an image attached.\n */\nfunction has_post_thumbnail( $post = null ) {\n\t$thumbnail_id  = get_post_thumbnail_id( $post );\n\t$has_thumbnail = (bool) $thumbnail_id;\n\n\t/**\n\t * Filters whether a post has a post thumbnail.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param bool             $has_thumbnail true if the post has a post thumbnail, otherwise false.\n\t * @param int|WP_Post|null $post          Post ID or WP_Post object. Default is global `$post`.\n\t * @param int|string       $thumbnail_id  Post thumbnail ID or empty string.\n\t */\n\treturn (bool) apply_filters( 'has_post_thumbnail', $has_thumbnail, $post, $thumbnail_id );\n}\n\n/**\n * Retrieve post thumbnail ID.\n *\n * @since 2.9.0\n * @since 4.4.0 `$post` can be a post ID or WP_Post object.\n * @since 5.5.0 The return value for a non-existing post\n *              was changed to false instead of an empty string.\n *\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.\n * @return int|false Post thumbnail ID (which can be 0 if the thumbnail is not set),\n *                   or false if the post does not exist.\n */\nfunction get_post_thumbnail_id( $post = null ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\treturn (int) get_post_meta( $post->ID, '_thumbnail_id', true );\n}\n\n/**\n * Display the post thumbnail.\n *\n * When a theme adds 'post-thumbnail' support, a special 'post-thumbnail' image size\n * is registered, which differs from the 'thumbnail' image size managed via the\n * Settings > Media screen.\n *\n * When using the_post_thumbnail() or related functions, the 'post-thumbnail' image\n * size is used by default, though a different size can be specified instead as needed.\n *\n * @since 2.9.0\n *\n * @see get_the_post_thumbnail()\n *\n * @param string|array $size Optional. Image size to use. Accepts any valid image size, or\n *                           an array of width and height values in pixels (in that order).\n *                           Default 'post-thumbnail'.\n * @param string|array $attr Optional. Query string or array of attributes. Default empty.\n */\nfunction the_post_thumbnail( $size = 'post-thumbnail', $attr = '' ) {\n\techo get_the_post_thumbnail( null, $size, $attr );\n}\n\n/**\n * Update cache for thumbnails in the current loop.\n *\n * @since 3.2.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param WP_Query $wp_query Optional. A WP_Query instance. Defaults to the $wp_query global.\n */\nfunction update_post_thumbnail_cache( $wp_query = null ) {\n\tif ( ! $wp_query ) {\n\t\t$wp_query = $GLOBALS['wp_query'];\n\t}\n\n\tif ( $wp_query->thumbnails_cached ) {\n\t\treturn;\n\t}\n\n\t$thumb_ids = array();\n\n\tforeach ( $wp_query->posts as $post ) {\n\t\t$id = get_post_thumbnail_id( $post->ID );\n\t\tif ( $id ) {\n\t\t\t$thumb_ids[] = $id;\n\t\t}\n\t}\n\n\tif ( ! empty( $thumb_ids ) ) {\n\t\t_prime_post_caches( $thumb_ids, false, true );\n\t}\n\n\t$wp_query->thumbnails_cached = true;\n}\n\n/**\n * Retrieve the post thumbnail.\n *\n * When a theme adds 'post-thumbnail' support, a special 'post-thumbnail' image size\n * is registered, which differs from the 'thumbnail' image size managed via the\n * Settings > Media screen.\n *\n * When using the_post_thumbnail() or related functions, the 'post-thumbnail' image\n * size is used by default, though a different size can be specified instead as needed.\n *\n * @since 2.9.0\n * @since 4.4.0 `$post` can be a post ID or WP_Post object.\n *\n * @param int|WP_Post  $post Optional. Post ID or WP_Post object.  Default is global `$post`.\n * @param string|array $size Optional. Image size to use. Accepts any valid image size, or\n *                           an array of width and height values in pixels (in that order).\n *                           Default 'post-thumbnail'.\n * @param string|array $attr Optional. Query string or array of attributes. Default empty.\n * @return string The post thumbnail image tag.\n */\nfunction get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr = '' ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn '';\n\t}\n\n\t$post_thumbnail_id = get_post_thumbnail_id( $post );\n\n\t/**\n\t * Filters the post thumbnail size.\n\t *\n\t * @since 2.9.0\n\t * @since 4.9.0 Added the `$post_id` parameter.\n\t *\n\t * @param string|array $size    The post thumbnail size. Image size or array of width and height\n\t *                              values (in that order). Default 'post-thumbnail'.\n\t * @param int          $post_id The post ID.\n\t */\n\t$size = apply_filters( 'post_thumbnail_size', $size, $post->ID );\n\n\tif ( $post_thumbnail_id ) {\n\n\t\t/**\n\t\t * Fires before fetching the post thumbnail HTML.\n\t\t *\n\t\t * Provides \"just in time\" filtering of all filters in wp_get_attachment_image().\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param int          $post_id           The post ID.\n\t\t * @param string       $post_thumbnail_id The post thumbnail ID.\n\t\t * @param string|array $size              The post thumbnail size. Image size or array of width\n\t\t *                                        and height values (in that order). Default 'post-thumbnail'.\n\t\t */\n\t\tdo_action( 'begin_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size );\n\n\t\tif ( in_the_loop() ) {\n\t\t\tupdate_post_thumbnail_cache();\n\t\t}\n\n\t\t$html = wp_get_attachment_image( $post_thumbnail_id, $size, false, $attr );\n\n\t\t/**\n\t\t * Fires after fetching the post thumbnail HTML.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param int          $post_id           The post ID.\n\t\t * @param string       $post_thumbnail_id The post thumbnail ID.\n\t\t * @param string|array $size              The post thumbnail size. Image size or array of width\n\t\t *                                        and height values (in that order). Default 'post-thumbnail'.\n\t\t */\n\t\tdo_action( 'end_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size );\n\n\t} else {\n\t\t$html = '';\n\t}\n\n\t/**\n\t * Filters the post thumbnail HTML.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string       $html              The post thumbnail HTML.\n\t * @param int          $post_id           The post ID.\n\t * @param string       $post_thumbnail_id The post thumbnail ID.\n\t * @param string|array $size              The post thumbnail size. Image size or array of width and height\n\t *                                        values (in that order). Default 'post-thumbnail'.\n\t * @param string       $attr              Query string of attributes.\n\t */\n\treturn apply_filters( 'post_thumbnail_html', $html, $post->ID, $post_thumbnail_id, $size, $attr );\n}\n\n/**\n * Return the post thumbnail URL.\n *\n * @since 4.4.0\n *\n * @param int|WP_Post  $post Optional. Post ID or WP_Post object.  Default is global `$post`.\n * @param string|array $size Optional. Registered image size to retrieve the source for or a flat\n *                           array of height and width dimensions. Default 'post-thumbnail'.\n * @return string|false Post thumbnail URL or false if no URL is available.\n */\nfunction get_the_post_thumbnail_url( $post = null, $size = 'post-thumbnail' ) {\n\t$post_thumbnail_id = get_post_thumbnail_id( $post );\n\n\tif ( ! $post_thumbnail_id ) {\n\t\treturn false;\n\t}\n\n\treturn wp_get_attachment_image_url( $post_thumbnail_id, $size );\n}\n\n/**\n * Display the post thumbnail URL.\n *\n * @since 4.4.0\n *\n * @param string|array $size Optional. Image size to use. Accepts any valid image size,\n *                           or an array of width and height values in pixels (in that order).\n *                           Default 'post-thumbnail'.\n */\nfunction the_post_thumbnail_url( $size = 'post-thumbnail' ) {\n\t$url = get_the_post_thumbnail_url( null, $size );\n\n\tif ( $url ) {\n\t\techo esc_url( $url );\n\t}\n}\n\n/**\n * Returns the post thumbnail caption.\n *\n * @since 4.6.0\n *\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.\n * @return string Post thumbnail caption.\n */\nfunction get_the_post_thumbnail_caption( $post = null ) {\n\t$post_thumbnail_id = get_post_thumbnail_id( $post );\n\n\tif ( ! $post_thumbnail_id ) {\n\t\treturn '';\n\t}\n\n\t$caption = wp_get_attachment_caption( $post_thumbnail_id );\n\n\tif ( ! $caption ) {\n\t\t$caption = '';\n\t}\n\n\treturn $caption;\n}\n\n/**\n * Displays the post thumbnail caption.\n *\n * @since 4.6.0\n *\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.\n */\nfunction the_post_thumbnail_caption( $post = null ) {\n\t/**\n\t * Filters the displayed post thumbnail caption.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string $caption Caption for the given attachment.\n\t */\n\techo apply_filters( 'the_post_thumbnail_caption', get_the_post_thumbnail_caption( $post ) );\n}\n", "num_lines": 292}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Core Post API\n *\n * @package WordPress\n * @subpackage Post\n */\n\n//\n// Post Type registration.\n//\n\n/**\n * Creates the initial post types when 'init' action is fired.\n *\n * See {@see 'init'}.\n *\n * @since 2.9.0\n */\nfunction create_initial_post_types() {\n\tregister_post_type(\n\t\t'post',\n\t\tarray(\n\t\t\t'labels'                => array(\n\t\t\t\t'name_admin_bar' => _x( 'Post', 'add new from admin bar' ),\n\t\t\t),\n\t\t\t'public'                => true,\n\t\t\t'_builtin'              => true, /* internal use only. don't use this when registering your own post type. */\n\t\t\t'_edit_link'            => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */\n\t\t\t'capability_type'       => 'post',\n\t\t\t'map_meta_cap'          => true,\n\t\t\t'menu_position'         => 5,\n\t\t\t'menu_icon'             => 'dashicons-admin-post',\n\t\t\t'hierarchical'          => false,\n\t\t\t'rewrite'               => false,\n\t\t\t'query_var'             => false,\n\t\t\t'delete_with_user'      => true,\n\t\t\t'supports'              => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats' ),\n\t\t\t'show_in_rest'          => true,\n\t\t\t'rest_base'             => 'posts',\n\t\t\t'rest_controller_class' => 'WP_REST_Posts_Controller',\n\t\t)\n\t);\n\n\tregister_post_type(\n\t\t'page',\n\t\tarray(\n\t\t\t'labels'                => array(\n\t\t\t\t'name_admin_bar' => _x( 'Page', 'add new from admin bar' ),\n\t\t\t),\n\t\t\t'public'                => true,\n\t\t\t'publicly_queryable'    => false,\n\t\t\t'_builtin'              => true, /* internal use only. don't use this when registering your own post type. */\n\t\t\t'_edit_link'            => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */\n\t\t\t'capability_type'       => 'page',\n\t\t\t'map_meta_cap'          => true,\n\t\t\t'menu_position'         => 20,\n\t\t\t'menu_icon'             => 'dashicons-admin-page',\n\t\t\t'hierarchical'          => true,\n\t\t\t'rewrite'               => false,\n\t\t\t'query_var'             => false,\n\t\t\t'delete_with_user'      => true,\n\t\t\t'supports'              => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes', 'custom-fields', 'comments', 'revisions' ),\n\t\t\t'show_in_rest'          => true,\n\t\t\t'rest_base'             => 'pages',\n\t\t\t'rest_controller_class' => 'WP_REST_Posts_Controller',\n\t\t)\n\t);\n\n\tregister_post_type(\n\t\t'attachment',\n\t\tarray(\n\t\t\t'labels'                => array(\n\t\t\t\t'name'           => _x( 'Media', 'post type general name' ),\n\t\t\t\t'name_admin_bar' => _x( 'Media', 'add new from admin bar' ),\n\t\t\t\t'add_new'        => _x( 'Add New', 'add new media' ),\n\t\t\t\t'edit_item'      => __( 'Edit Media' ),\n\t\t\t\t'view_item'      => __( 'View Attachment Page' ),\n\t\t\t\t'attributes'     => __( 'Attachment Attributes' ),\n\t\t\t),\n\t\t\t'public'                => true,\n\t\t\t'show_ui'               => true,\n\t\t\t'_builtin'              => true, /* internal use only. don't use this when registering your own post type. */\n\t\t\t'_edit_link'            => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */\n\t\t\t'capability_type'       => 'post',\n\t\t\t'capabilities'          => array(\n\t\t\t\t'create_posts' => 'upload_files',\n\t\t\t),\n\t\t\t'map_meta_cap'          => true,\n\t\t\t'menu_icon'             => 'dashicons-admin-media',\n\t\t\t'hierarchical'          => false,\n\t\t\t'rewrite'               => false,\n\t\t\t'query_var'             => false,\n\t\t\t'show_in_nav_menus'     => false,\n\t\t\t'delete_with_user'      => true,\n\t\t\t'supports'              => array( 'title', 'author', 'comments' ),\n\t\t\t'show_in_rest'          => true,\n\t\t\t'rest_base'             => 'media',\n\t\t\t'rest_controller_class' => 'WP_REST_Attachments_Controller',\n\t\t)\n\t);\n\tadd_post_type_support( 'attachment:audio', 'thumbnail' );\n\tadd_post_type_support( 'attachment:video', 'thumbnail' );\n\n\tregister_post_type(\n\t\t'revision',\n\t\tarray(\n\t\t\t'labels'           => array(\n\t\t\t\t'name'          => __( 'Revisions' ),\n\t\t\t\t'singular_name' => __( 'Revision' ),\n\t\t\t),\n\t\t\t'public'           => false,\n\t\t\t'_builtin'         => true, /* internal use only. don't use this when registering your own post type. */\n\t\t\t'_edit_link'       => 'revision.php?revision=%d', /* internal use only. don't use this when registering your own post type. */\n\t\t\t'capability_type'  => 'post',\n\t\t\t'map_meta_cap'     => true,\n\t\t\t'hierarchical'     => false,\n\t\t\t'rewrite'          => false,\n\t\t\t'query_var'        => false,\n\t\t\t'can_export'       => false,\n\t\t\t'delete_with_user' => true,\n\t\t\t'supports'         => array( 'author' ),\n\t\t)\n\t);\n\n\tregister_post_type(\n\t\t'nav_menu_item',\n\t\tarray(\n\t\t\t'labels'           => array(\n\t\t\t\t'name'          => __( 'Navigation Menu Items' ),\n\t\t\t\t'singular_name' => __( 'Navigation Menu Item' ),\n\t\t\t),\n\t\t\t'public'           => false,\n\t\t\t'_builtin'         => true, /* internal use only. don't use this when registering your own post type. */\n\t\t\t'hierarchical'     => false,\n\t\t\t'rewrite'          => false,\n\t\t\t'delete_with_user' => false,\n\t\t\t'query_var'        => false,\n\t\t)\n\t);\n\n\tregister_post_type(\n\t\t'custom_css',\n\t\tarray(\n\t\t\t'labels'           => array(\n\t\t\t\t'name'          => __( 'Custom CSS' ),\n\t\t\t\t'singular_name' => __( 'Custom CSS' ),\n\t\t\t),\n\t\t\t'public'           => false,\n\t\t\t'hierarchical'     => false,\n\t\t\t'rewrite'          => false,\n\t\t\t'query_var'        => false,\n\t\t\t'delete_with_user' => false,\n\t\t\t'can_export'       => true,\n\t\t\t'_builtin'         => true, /* internal use only. don't use this when registering your own post type. */\n\t\t\t'supports'         => array( 'title', 'revisions' ),\n\t\t\t'capabilities'     => array(\n\t\t\t\t'delete_posts'           => 'edit_theme_options',\n\t\t\t\t'delete_post'            => 'edit_theme_options',\n\t\t\t\t'delete_published_posts' => 'edit_theme_options',\n\t\t\t\t'delete_private_posts'   => 'edit_theme_options',\n\t\t\t\t'delete_others_posts'    => 'edit_theme_options',\n\t\t\t\t'edit_post'              => 'edit_css',\n\t\t\t\t'edit_posts'             => 'edit_css',\n\t\t\t\t'edit_others_posts'      => 'edit_css',\n\t\t\t\t'edit_published_posts'   => 'edit_css',\n\t\t\t\t'read_post'              => 'read',\n\t\t\t\t'read_private_posts'     => 'read',\n\t\t\t\t'publish_posts'          => 'edit_theme_options',\n\t\t\t),\n\t\t)\n\t);\n\n\tregister_post_type(\n\t\t'customize_changeset',\n\t\tarray(\n\t\t\t'labels'           => array(\n\t\t\t\t'name'               => _x( 'Changesets', 'post type general name' ),\n\t\t\t\t'singular_name'      => _x( 'Changeset', 'post type singular name' ),\n\t\t\t\t'menu_name'          => _x( 'Changesets', 'admin menu' ),\n\t\t\t\t'name_admin_bar'     => _x( 'Changeset', 'add new on admin bar' ),\n\t\t\t\t'add_new'            => _x( 'Add New', 'Customize Changeset' ),\n\t\t\t\t'add_new_item'       => __( 'Add New Changeset' ),\n\t\t\t\t'new_item'           => __( 'New Changeset' ),\n\t\t\t\t'edit_item'          => __( 'Edit Changeset' ),\n\t\t\t\t'view_item'          => __( 'View Changeset' ),\n\t\t\t\t'all_items'          => __( 'All Changesets' ),\n\t\t\t\t'search_items'       => __( 'Search Changesets' ),\n\t\t\t\t'not_found'          => __( 'No changesets found.' ),\n\t\t\t\t'not_found_in_trash' => __( 'No changesets found in Trash.' ),\n\t\t\t),\n\t\t\t'public'           => false,\n\t\t\t'_builtin'         => true, /* internal use only. don't use this when registering your own post type. */\n\t\t\t'map_meta_cap'     => true,\n\t\t\t'hierarchical'     => false,\n\t\t\t'rewrite'          => false,\n\t\t\t'query_var'        => false,\n\t\t\t'can_export'       => false,\n\t\t\t'delete_with_user' => false,\n\t\t\t'supports'         => array( 'title', 'author' ),\n\t\t\t'capability_type'  => 'customize_changeset',\n\t\t\t'capabilities'     => array(\n\t\t\t\t'create_posts'           => 'customize',\n\t\t\t\t'delete_others_posts'    => 'customize',\n\t\t\t\t'delete_post'            => 'customize',\n\t\t\t\t'delete_posts'           => 'customize',\n\t\t\t\t'delete_private_posts'   => 'customize',\n\t\t\t\t'delete_published_posts' => 'customize',\n\t\t\t\t'edit_others_posts'      => 'customize',\n\t\t\t\t'edit_post'              => 'customize',\n\t\t\t\t'edit_posts'             => 'customize',\n\t\t\t\t'edit_private_posts'     => 'customize',\n\t\t\t\t'edit_published_posts'   => 'do_not_allow',\n\t\t\t\t'publish_posts'          => 'customize',\n\t\t\t\t'read'                   => 'read',\n\t\t\t\t'read_post'              => 'customize',\n\t\t\t\t'read_private_posts'     => 'customize',\n\t\t\t),\n\t\t)\n\t);\n\n\tregister_post_type(\n\t\t'oembed_cache',\n\t\tarray(\n\t\t\t'labels'           => array(\n\t\t\t\t'name'          => __( 'oEmbed Responses' ),\n\t\t\t\t'singular_name' => __( 'oEmbed Response' ),\n\t\t\t),\n\t\t\t'public'           => false,\n\t\t\t'hierarchical'     => false,\n\t\t\t'rewrite'          => false,\n\t\t\t'query_var'        => false,\n\t\t\t'delete_with_user' => false,\n\t\t\t'can_export'       => false,\n\t\t\t'_builtin'         => true, /* internal use only. don't use this when registering your own post type. */\n\t\t\t'supports'         => array(),\n\t\t)\n\t);\n\n\tregister_post_type(\n\t\t'user_request',\n\t\tarray(\n\t\t\t'labels'           => array(\n\t\t\t\t'name'          => __( 'User Requests' ),\n\t\t\t\t'singular_name' => __( 'User Request' ),\n\t\t\t),\n\t\t\t'public'           => false,\n\t\t\t'_builtin'         => true, /* internal use only. don't use this when registering your own post type. */\n\t\t\t'hierarchical'     => false,\n\t\t\t'rewrite'          => false,\n\t\t\t'query_var'        => false,\n\t\t\t'can_export'       => false,\n\t\t\t'delete_with_user' => false,\n\t\t\t'supports'         => array(),\n\t\t)\n\t);\n\n\tregister_post_type(\n\t\t'wp_block',\n\t\tarray(\n\t\t\t'labels'                => array(\n\t\t\t\t'name'                     => _x( 'Blocks', 'post type general name' ),\n\t\t\t\t'singular_name'            => _x( 'Block', 'post type singular name' ),\n\t\t\t\t'menu_name'                => _x( 'Blocks', 'admin menu' ),\n\t\t\t\t'name_admin_bar'           => _x( 'Block', 'add new on admin bar' ),\n\t\t\t\t'add_new'                  => _x( 'Add New', 'Block' ),\n\t\t\t\t'add_new_item'             => __( 'Add New Block' ),\n\t\t\t\t'new_item'                 => __( 'New Block' ),\n\t\t\t\t'edit_item'                => __( 'Edit Block' ),\n\t\t\t\t'view_item'                => __( 'View Block' ),\n\t\t\t\t'all_items'                => __( 'All Blocks' ),\n\t\t\t\t'search_items'             => __( 'Search Blocks' ),\n\t\t\t\t'not_found'                => __( 'No blocks found.' ),\n\t\t\t\t'not_found_in_trash'       => __( 'No blocks found in Trash.' ),\n\t\t\t\t'filter_items_list'        => __( 'Filter blocks list' ),\n\t\t\t\t'items_list_navigation'    => __( 'Blocks list navigation' ),\n\t\t\t\t'items_list'               => __( 'Blocks list' ),\n\t\t\t\t'item_published'           => __( 'Block published.' ),\n\t\t\t\t'item_published_privately' => __( 'Block published privately.' ),\n\t\t\t\t'item_reverted_to_draft'   => __( 'Block reverted to draft.' ),\n\t\t\t\t'item_scheduled'           => __( 'Block scheduled.' ),\n\t\t\t\t'item_updated'             => __( 'Block updated.' ),\n\t\t\t),\n\t\t\t'public'                => false,\n\t\t\t'_builtin'              => true, /* internal use only. don't use this when registering your own post type. */\n\t\t\t'show_ui'               => true,\n\t\t\t'show_in_menu'          => false,\n\t\t\t'rewrite'               => false,\n\t\t\t'show_in_rest'          => true,\n\t\t\t'rest_base'             => 'blocks',\n\t\t\t'rest_controller_class' => 'WP_REST_Blocks_Controller',\n\t\t\t'capability_type'       => 'block',\n\t\t\t'capabilities'          => array(\n\t\t\t\t// You need to be able to edit posts, in order to read blocks in their raw form.\n\t\t\t\t'read'                   => 'edit_posts',\n\t\t\t\t// You need to be able to publish posts, in order to create blocks.\n\t\t\t\t'create_posts'           => 'publish_posts',\n\t\t\t\t'edit_posts'             => 'edit_posts',\n\t\t\t\t'edit_published_posts'   => 'edit_published_posts',\n\t\t\t\t'delete_published_posts' => 'delete_published_posts',\n\t\t\t\t'edit_others_posts'      => 'edit_others_posts',\n\t\t\t\t'delete_others_posts'    => 'delete_others_posts',\n\t\t\t),\n\t\t\t'map_meta_cap'          => true,\n\t\t\t'supports'              => array(\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t),\n\t\t)\n\t);\n\n\tregister_post_status(\n\t\t'publish',\n\t\tarray(\n\t\t\t'label'       => _x( 'Published', 'post status' ),\n\t\t\t'public'      => true,\n\t\t\t'_builtin'    => true, /* internal use only. */\n\t\t\t/* translators: %s: Number of published posts. */\n\t\t\t'label_count' => _n_noop(\n\t\t\t\t'Published <span class=\"count\">(%s)</span>',\n\t\t\t\t'Published <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t)\n\t);\n\n\tregister_post_status(\n\t\t'future',\n\t\tarray(\n\t\t\t'label'       => _x( 'Scheduled', 'post status' ),\n\t\t\t'protected'   => true,\n\t\t\t'_builtin'    => true, /* internal use only. */\n\t\t\t/* translators: %s: Number of scheduled posts. */\n\t\t\t'label_count' => _n_noop(\n\t\t\t\t'Scheduled <span class=\"count\">(%s)</span>',\n\t\t\t\t'Scheduled <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t)\n\t);\n\n\tregister_post_status(\n\t\t'draft',\n\t\tarray(\n\t\t\t'label'         => _x( 'Draft', 'post status' ),\n\t\t\t'protected'     => true,\n\t\t\t'_builtin'      => true, /* internal use only. */\n\t\t\t/* translators: %s: Number of draft posts. */\n\t\t\t'label_count'   => _n_noop(\n\t\t\t\t'Draft <span class=\"count\">(%s)</span>',\n\t\t\t\t'Drafts <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t\t'date_floating' => true,\n\t\t)\n\t);\n\n\tregister_post_status(\n\t\t'pending',\n\t\tarray(\n\t\t\t'label'         => _x( 'Pending', 'post status' ),\n\t\t\t'protected'     => true,\n\t\t\t'_builtin'      => true, /* internal use only. */\n\t\t\t/* translators: %s: Number of pending posts. */\n\t\t\t'label_count'   => _n_noop(\n\t\t\t\t'Pending <span class=\"count\">(%s)</span>',\n\t\t\t\t'Pending <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t\t'date_floating' => true,\n\t\t)\n\t);\n\n\tregister_post_status(\n\t\t'private',\n\t\tarray(\n\t\t\t'label'       => _x( 'Private', 'post status' ),\n\t\t\t'private'     => true,\n\t\t\t'_builtin'    => true, /* internal use only. */\n\t\t\t/* translators: %s: Number of private posts. */\n\t\t\t'label_count' => _n_noop(\n\t\t\t\t'Private <span class=\"count\">(%s)</span>',\n\t\t\t\t'Private <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t)\n\t);\n\n\tregister_post_status(\n\t\t'trash',\n\t\tarray(\n\t\t\t'label'                     => _x( 'Trash', 'post status' ),\n\t\t\t'internal'                  => true,\n\t\t\t'_builtin'                  => true, /* internal use only. */\n\t\t\t/* translators: %s: Number of trashed posts. */\n\t\t\t'label_count'               => _n_noop(\n\t\t\t\t'Trash <span class=\"count\">(%s)</span>',\n\t\t\t\t'Trash <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t\t'show_in_admin_status_list' => true,\n\t\t)\n\t);\n\n\tregister_post_status(\n\t\t'auto-draft',\n\t\tarray(\n\t\t\t'label'         => 'auto-draft',\n\t\t\t'internal'      => true,\n\t\t\t'_builtin'      => true, /* internal use only. */\n\t\t\t'date_floating' => true,\n\t\t)\n\t);\n\n\tregister_post_status(\n\t\t'inherit',\n\t\tarray(\n\t\t\t'label'               => 'inherit',\n\t\t\t'internal'            => true,\n\t\t\t'_builtin'            => true, /* internal use only. */\n\t\t\t'exclude_from_search' => false,\n\t\t)\n\t);\n\n\tregister_post_status(\n\t\t'request-pending',\n\t\tarray(\n\t\t\t'label'               => _x( 'Pending', 'request status' ),\n\t\t\t'internal'            => true,\n\t\t\t'_builtin'            => true, /* internal use only. */\n\t\t\t/* translators: %s: Number of pending requests. */\n\t\t\t'label_count'         => _n_noop(\n\t\t\t\t'Pending <span class=\"count\">(%s)</span>',\n\t\t\t\t'Pending <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t\t'exclude_from_search' => false,\n\t\t)\n\t);\n\n\tregister_post_status(\n\t\t'request-confirmed',\n\t\tarray(\n\t\t\t'label'               => _x( 'Confirmed', 'request status' ),\n\t\t\t'internal'            => true,\n\t\t\t'_builtin'            => true, /* internal use only. */\n\t\t\t/* translators: %s: Number of confirmed requests. */\n\t\t\t'label_count'         => _n_noop(\n\t\t\t\t'Confirmed <span class=\"count\">(%s)</span>',\n\t\t\t\t'Confirmed <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t\t'exclude_from_search' => false,\n\t\t)\n\t);\n\n\tregister_post_status(\n\t\t'request-failed',\n\t\tarray(\n\t\t\t'label'               => _x( 'Failed', 'request status' ),\n\t\t\t'internal'            => true,\n\t\t\t'_builtin'            => true, /* internal use only. */\n\t\t\t/* translators: %s: Number of failed requests. */\n\t\t\t'label_count'         => _n_noop(\n\t\t\t\t'Failed <span class=\"count\">(%s)</span>',\n\t\t\t\t'Failed <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t\t'exclude_from_search' => false,\n\t\t)\n\t);\n\n\tregister_post_status(\n\t\t'request-completed',\n\t\tarray(\n\t\t\t'label'               => _x( 'Completed', 'request status' ),\n\t\t\t'internal'            => true,\n\t\t\t'_builtin'            => true, /* internal use only. */\n\t\t\t/* translators: %s: Number of completed requests. */\n\t\t\t'label_count'         => _n_noop(\n\t\t\t\t'Completed <span class=\"count\">(%s)</span>',\n\t\t\t\t'Completed <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t\t'exclude_from_search' => false,\n\t\t)\n\t);\n}\n\n/**\n * Retrieve attached file path based on attachment ID.\n *\n * By default the path will go through the 'get_attached_file' filter, but\n * passing a true to the $unfiltered argument of get_attached_file() will\n * return the file path unfiltered.\n *\n * The function works by getting the single post meta name, named\n * '_wp_attached_file' and returning it. This is a convenience function to\n * prevent looking up the meta name and provide a mechanism for sending the\n * attached filename through a filter.\n *\n * @since 2.0.0\n *\n * @param int  $attachment_id Attachment ID.\n * @param bool $unfiltered    Optional. Whether to apply filters. Default false.\n * @return string|false The file path to where the attached file should be, false otherwise.\n */\nfunction get_attached_file( $attachment_id, $unfiltered = false ) {\n\t$file = get_post_meta( $attachment_id, '_wp_attached_file', true );\n\n\t// If the file is relative, prepend upload dir.\n\tif ( $file && 0 !== strpos( $file, '/' ) && ! preg_match( '|^.:\\\\\\|', $file ) ) {\n\t\t$uploads = wp_get_upload_dir();\n\t\tif ( false === $uploads['error'] ) {\n\t\t\t$file = $uploads['basedir'] . \"/$file\";\n\t\t}\n\t}\n\n\tif ( $unfiltered ) {\n\t\treturn $file;\n\t}\n\n\t/**\n\t * Filters the attached file based on the given ID.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string|false $file          The file path to where the attached file should be, false otherwise.\n\t * @param int          $attachment_id Attachment ID.\n\t */\n\treturn apply_filters( 'get_attached_file', $file, $attachment_id );\n}\n\n/**\n * Update attachment file path based on attachment ID.\n *\n * Used to update the file path of the attachment, which uses post meta name\n * '_wp_attached_file' to store the path of the attachment.\n *\n * @since 2.1.0\n *\n * @param int    $attachment_id Attachment ID.\n * @param string $file          File path for the attachment.\n * @return bool True on success, false on failure.\n */\nfunction update_attached_file( $attachment_id, $file ) {\n\tif ( ! get_post( $attachment_id ) ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Filters the path to the attached file to update.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $file          Path to the attached file to update.\n\t * @param int    $attachment_id Attachment ID.\n\t */\n\t$file = apply_filters( 'update_attached_file', $file, $attachment_id );\n\n\t$file = _wp_relative_upload_path( $file );\n\tif ( $file ) {\n\t\treturn update_post_meta( $attachment_id, '_wp_attached_file', $file );\n\t} else {\n\t\treturn delete_post_meta( $attachment_id, '_wp_attached_file' );\n\t}\n}\n\n/**\n * Return relative path to an uploaded file.\n *\n * The path is relative to the current upload dir.\n *\n * @since 2.9.0\n * @access private\n *\n * @param string $path Full path to the file.\n * @return string Relative path on success, unchanged path on failure.\n */\nfunction _wp_relative_upload_path( $path ) {\n\t$new_path = $path;\n\n\t$uploads = wp_get_upload_dir();\n\tif ( 0 === strpos( $new_path, $uploads['basedir'] ) ) {\n\t\t\t$new_path = str_replace( $uploads['basedir'], '', $new_path );\n\t\t\t$new_path = ltrim( $new_path, '/' );\n\t}\n\n\t/**\n\t * Filters the relative path to an uploaded file.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string $new_path Relative path to the file.\n\t * @param string $path     Full path to the file.\n\t */\n\treturn apply_filters( '_wp_relative_upload_path', $new_path, $path );\n}\n\n/**\n * Retrieve all children of the post parent ID.\n *\n * Normally, without any enhancements, the children would apply to pages. In the\n * context of the inner workings of WordPress, pages, posts, and attachments\n * share the same table, so therefore the functionality could apply to any one\n * of them. It is then noted that while this function does not work on posts, it\n * does not mean that it won't work on posts. It is recommended that you know\n * what context you wish to retrieve the children of.\n *\n * Attachments may also be made the child of a post, so if that is an accurate\n * statement (which needs to be verified), it would then be possible to get\n * all of the attachments for a post. Attachments have since changed since\n * version 2.5, so this is most likely inaccurate, but serves generally as an\n * example of what is possible.\n *\n * The arguments listed as defaults are for this function and also of the\n * get_posts() function. The arguments are combined with the get_children defaults\n * and are then passed to the get_posts() function, which accepts additional arguments.\n * You can replace the defaults in this function, listed below and the additional\n * arguments listed in the get_posts() function.\n *\n * The 'post_parent' is the most important argument and important attention\n * needs to be paid to the $args parameter. If you pass either an object or an\n * integer (number), then just the 'post_parent' is grabbed and everything else\n * is lost. If you don't specify any arguments, then it is assumed that you are\n * in The Loop and the post parent will be grabbed for from the current post.\n *\n * The 'post_parent' argument is the ID to get the children. The 'numberposts'\n * is the amount of posts to retrieve that has a default of '-1', which is\n * used to get all of the posts. Giving a number higher than 0 will only\n * retrieve that amount of posts.\n *\n * The 'post_type' and 'post_status' arguments can be used to choose what\n * criteria of posts to retrieve. The 'post_type' can be anything, but WordPress\n * post types are 'post', 'pages', and 'attachments'. The 'post_status'\n * argument will accept any post status within the write administration panels.\n *\n * @since 2.0.0\n *\n * @see get_posts()\n * @todo Check validity of description.\n *\n * @global WP_Post $post Global post object.\n *\n * @param mixed  $args   Optional. User defined arguments for replacing the defaults. Default empty.\n * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which\n *                       correspond to a WP_Post object, an associative array, or a numeric array,\n *                       respectively. Default OBJECT.\n * @return WP_Post[]|int[] Array of post objects or post IDs.\n */\nfunction get_children( $args = '', $output = OBJECT ) {\n\t$kids = array();\n\tif ( empty( $args ) ) {\n\t\tif ( isset( $GLOBALS['post'] ) ) {\n\t\t\t$args = array( 'post_parent' => (int) $GLOBALS['post']->post_parent );\n\t\t} else {\n\t\t\treturn $kids;\n\t\t}\n\t} elseif ( is_object( $args ) ) {\n\t\t$args = array( 'post_parent' => (int) $args->post_parent );\n\t} elseif ( is_numeric( $args ) ) {\n\t\t$args = array( 'post_parent' => (int) $args );\n\t}\n\n\t$defaults = array(\n\t\t'numberposts' => -1,\n\t\t'post_type'   => 'any',\n\t\t'post_status' => 'any',\n\t\t'post_parent' => 0,\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t$children = get_posts( $parsed_args );\n\n\tif ( ! $children ) {\n\t\treturn $kids;\n\t}\n\n\tif ( ! empty( $parsed_args['fields'] ) ) {\n\t\treturn $children;\n\t}\n\n\tupdate_post_cache( $children );\n\n\tforeach ( $children as $key => $child ) {\n\t\t$kids[ $child->ID ] = $children[ $key ];\n\t}\n\n\tif ( OBJECT == $output ) {\n\t\treturn $kids;\n\t} elseif ( ARRAY_A == $output ) {\n\t\t$weeuns = array();\n\t\tforeach ( (array) $kids as $kid ) {\n\t\t\t$weeuns[ $kid->ID ] = get_object_vars( $kids[ $kid->ID ] );\n\t\t}\n\t\treturn $weeuns;\n\t} elseif ( ARRAY_N == $output ) {\n\t\t$babes = array();\n\t\tforeach ( (array) $kids as $kid ) {\n\t\t\t$babes[ $kid->ID ] = array_values( get_object_vars( $kids[ $kid->ID ] ) );\n\t\t}\n\t\treturn $babes;\n\t} else {\n\t\treturn $kids;\n\t}\n}\n\n/**\n * Get extended entry info (<!--more-->).\n *\n * There should not be any space after the second dash and before the word\n * 'more'. There can be text or space(s) after the word 'more', but won't be\n * referenced.\n *\n * The returned array has 'main', 'extended', and 'more_text' keys. Main has the text before\n * the `<!--more-->`. The 'extended' key has the content after the\n * `<!--more-->` comment. The 'more_text' key has the custom \"Read More\" text.\n *\n * @since 1.0.0\n *\n * @param string $post Post content.\n * @return string[] {\n *     Extended entry info.\n *\n *     @type string $main      Content before the more tag.\n *     @type string $extended  Content after the more tag.\n *     @type string $more_text Custom read more text, or empty string.\n * }\n */\nfunction get_extended( $post ) {\n\t// Match the new style more links.\n\tif ( preg_match( '/<!--more(.*?)?-->/', $post, $matches ) ) {\n\t\tlist($main, $extended) = explode( $matches[0], $post, 2 );\n\t\t$more_text             = $matches[1];\n\t} else {\n\t\t$main      = $post;\n\t\t$extended  = '';\n\t\t$more_text = '';\n\t}\n\n\t// Leading and trailing whitespace.\n\t$main      = preg_replace( '/^[\\s]*(.*)[\\s]*$/', '\\\\1', $main );\n\t$extended  = preg_replace( '/^[\\s]*(.*)[\\s]*$/', '\\\\1', $extended );\n\t$more_text = preg_replace( '/^[\\s]*(.*)[\\s]*$/', '\\\\1', $more_text );\n\n\treturn array(\n\t\t'main'      => $main,\n\t\t'extended'  => $extended,\n\t\t'more_text' => $more_text,\n\t);\n}\n\n/**\n * Retrieves post data given a post ID or post object.\n *\n * See sanitize_post() for optional $filter values. Also, the parameter\n * `$post`, must be given as a variable, since it is passed by reference.\n *\n * @since 1.5.1\n *\n * @global WP_Post $post Global post object.\n *\n * @param int|WP_Post|null $post   Optional. Post ID or post object. Defaults to global $post.\n * @param string           $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which\n *                                 correspond to a WP_Post object, an associative array, or a numeric array,\n *                                 respectively. Default OBJECT.\n * @param string           $filter Optional. Type of filter to apply. Accepts 'raw', 'edit', 'db',\n *                                 or 'display'. Default 'raw'.\n * @return WP_Post|array|null Type corresponding to $output on success or null on failure.\n *                            When $output is OBJECT, a `WP_Post` instance is returned.\n */\nfunction get_post( $post = null, $output = OBJECT, $filter = 'raw' ) {\n\tif ( empty( $post ) && isset( $GLOBALS['post'] ) ) {\n\t\t$post = $GLOBALS['post'];\n\t}\n\n\tif ( $post instanceof WP_Post ) {\n\t\t$_post = $post;\n\t} elseif ( is_object( $post ) ) {\n\t\tif ( empty( $post->filter ) ) {\n\t\t\t$_post = sanitize_post( $post, 'raw' );\n\t\t\t$_post = new WP_Post( $_post );\n\t\t} elseif ( 'raw' === $post->filter ) {\n\t\t\t$_post = new WP_Post( $post );\n\t\t} else {\n\t\t\t$_post = WP_Post::get_instance( $post->ID );\n\t\t}\n\t} else {\n\t\t$_post = WP_Post::get_instance( $post );\n\t}\n\n\tif ( ! $_post ) {\n\t\treturn null;\n\t}\n\n\t$_post = $_post->filter( $filter );\n\n\tif ( ARRAY_A == $output ) {\n\t\treturn $_post->to_array();\n\t} elseif ( ARRAY_N == $output ) {\n\t\treturn array_values( $_post->to_array() );\n\t}\n\n\treturn $_post;\n}\n\n/**\n * Retrieve ancestors of a post.\n *\n * @since 2.5.0\n *\n * @param int|WP_Post $post Post ID or post object.\n * @return int[] Ancestor IDs or empty array if none are found.\n */\nfunction get_post_ancestors( $post ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post || empty( $post->post_parent ) || $post->post_parent == $post->ID ) {\n\t\treturn array();\n\t}\n\n\t$ancestors = array();\n\n\t$id          = $post->post_parent;\n\t$ancestors[] = $id;\n\n\twhile ( $ancestor = get_post( $id ) ) {\n\t\t// Loop detection: If the ancestor has been seen before, break.\n\t\tif ( empty( $ancestor->post_parent ) || ( $ancestor->post_parent == $post->ID ) || in_array( $ancestor->post_parent, $ancestors, true ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\t$id          = $ancestor->post_parent;\n\t\t$ancestors[] = $id;\n\t}\n\n\treturn $ancestors;\n}\n\n/**\n * Retrieve data from a post field based on Post ID.\n *\n * Examples of the post field will be, 'post_type', 'post_status', 'post_content',\n * etc and based off of the post object property or key names.\n *\n * The context values are based off of the taxonomy filter functions and\n * supported values are found within those functions.\n *\n * @since 2.3.0\n * @since 4.5.0 The `$post` parameter was made optional.\n *\n * @see sanitize_post_field()\n *\n * @param string      $field   Post field name.\n * @param int|WP_Post $post    Optional. Post ID or post object. Defaults to global $post.\n * @param string      $context Optional. How to filter the field. Accepts 'raw', 'edit', 'db',\n *                             or 'display'. Default 'display'.\n * @return string The value of the post field on success, empty string on failure.\n */\nfunction get_post_field( $field, $post = null, $context = 'display' ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post ) {\n\t\treturn '';\n\t}\n\n\tif ( ! isset( $post->$field ) ) {\n\t\treturn '';\n\t}\n\n\treturn sanitize_post_field( $field, $post->$field, $post->ID, $context );\n}\n\n/**\n * Retrieve the mime type of an attachment based on the ID.\n *\n * This function can be used with any post type, but it makes more sense with\n * attachments.\n *\n * @since 2.0.0\n *\n * @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post.\n * @return string|false The mime type on success, false on failure.\n */\nfunction get_post_mime_type( $post = null ) {\n\t$post = get_post( $post );\n\n\tif ( is_object( $post ) ) {\n\t\treturn $post->post_mime_type;\n\t}\n\n\treturn false;\n}\n\n/**\n * Retrieve the post status based on the post ID.\n *\n * If the post ID is of an attachment, then the parent post status will be given\n * instead.\n *\n * @since 2.0.0\n *\n * @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post..\n * @return string|false Post status on success, false on failure.\n */\nfunction get_post_status( $post = null ) {\n\t$post = get_post( $post );\n\n\tif ( ! is_object( $post ) ) {\n\t\treturn false;\n\t}\n\n\tif ( 'attachment' === $post->post_type ) {\n\t\tif ( 'private' === $post->post_status ) {\n\t\t\treturn 'private';\n\t\t}\n\n\t\t// Unattached attachments are assumed to be published.\n\t\tif ( ( 'inherit' === $post->post_status ) && ( 0 == $post->post_parent ) ) {\n\t\t\treturn 'publish';\n\t\t}\n\n\t\t// Inherit status from the parent.\n\t\tif ( $post->post_parent && ( $post->ID != $post->post_parent ) ) {\n\t\t\t$parent_post_status = get_post_status( $post->post_parent );\n\t\t\tif ( 'trash' === $parent_post_status ) {\n\t\t\t\treturn get_post_meta( $post->post_parent, '_wp_trash_meta_status', true );\n\t\t\t} else {\n\t\t\t\treturn $parent_post_status;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filters the post status.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string  $post_status The post status.\n\t * @param WP_Post $post        The post object.\n\t */\n\treturn apply_filters( 'get_post_status', $post->post_status, $post );\n}\n\n/**\n * Retrieve all of the WordPress supported post statuses.\n *\n * Posts have a limited set of valid status values, this provides the\n * post_status values and descriptions.\n *\n * @since 2.5.0\n *\n * @return string[] Array of post status labels keyed by their status.\n */\nfunction get_post_statuses() {\n\t$status = array(\n\t\t'draft'   => __( 'Draft' ),\n\t\t'pending' => __( 'Pending Review' ),\n\t\t'private' => __( 'Private' ),\n\t\t'publish' => __( 'Published' ),\n\t);\n\n\treturn $status;\n}\n\n/**\n * Retrieve all of the WordPress support page statuses.\n *\n * Pages have a limited set of valid status values, this provides the\n * post_status values and descriptions.\n *\n * @since 2.5.0\n *\n * @return string[] Array of page status labels keyed by their status.\n */\nfunction get_page_statuses() {\n\t$status = array(\n\t\t'draft'   => __( 'Draft' ),\n\t\t'private' => __( 'Private' ),\n\t\t'publish' => __( 'Published' ),\n\t);\n\n\treturn $status;\n}\n\n/**\n * Return statuses for privacy requests.\n *\n * @since 4.9.6\n * @access private\n *\n * @return array\n */\nfunction _wp_privacy_statuses() {\n\treturn array(\n\t\t'request-pending'   => _x( 'Pending', 'request status' ),      // Pending confirmation from user.\n\t\t'request-confirmed' => _x( 'Confirmed', 'request status' ),    // User has confirmed the action.\n\t\t'request-failed'    => _x( 'Failed', 'request status' ),       // User failed to confirm the action.\n\t\t'request-completed' => _x( 'Completed', 'request status' ),    // Admin has handled the request.\n\t);\n}\n\n/**\n * Register a post status. Do not use before init.\n *\n * A simple function for creating or modifying a post status based on the\n * parameters given. The function will accept an array (second optional\n * parameter), along with a string for the post status name.\n *\n * Arguments prefixed with an _underscore shouldn't be used by plugins and themes.\n *\n * @since 3.0.0\n *\n * @global array $wp_post_statuses Inserts new post status object into the list\n *\n * @param string       $post_status Name of the post status.\n * @param array|string $args {\n *     Optional. Array or string of post status arguments.\n *\n *     @type bool|string $label                     A descriptive name for the post status marked\n *                                                  for translation. Defaults to value of $post_status.\n *     @type bool|array  $label_count               Descriptive text to use for nooped plurals.\n *                                                  Default array of $label, twice.\n *     @type bool        $exclude_from_search       Whether to exclude posts with this post status\n *                                                  from search results. Default is value of $internal.\n *     @type bool        $_builtin                  Whether the status is built-in. Core-use only.\n *                                                  Default false.\n *     @type bool        $public                    Whether posts of this status should be shown\n *                                                  in the front end of the site. Default false.\n *     @type bool        $internal                  Whether the status is for internal use only.\n *                                                  Default false.\n *     @type bool        $protected                 Whether posts with this status should be protected.\n *                                                  Default false.\n *     @type bool        $private                   Whether posts with this status should be private.\n *                                                  Default false.\n *     @type bool        $publicly_queryable        Whether posts with this status should be publicly-\n *                                                  queryable. Default is value of $public.\n *     @type bool        $show_in_admin_all_list    Whether to include posts in the edit listing for\n *                                                  their post type. Default is the opposite value\n *                                                  of $internal.\n *     @type bool        $show_in_admin_status_list Show in the list of statuses with post counts at\n *                                                  the top of the edit listings,\n *                                                  e.g. All (12) | Published (9) | My Custom Status (2)\n *                                                  Default is the opposite value of $internal.\n *     @type bool        $date_floating             Whether the post has a floating creation date.\n *                                                  Default to false.\n * }\n * @return object\n */\nfunction register_post_status( $post_status, $args = array() ) {\n\tglobal $wp_post_statuses;\n\n\tif ( ! is_array( $wp_post_statuses ) ) {\n\t\t$wp_post_statuses = array();\n\t}\n\n\t// Args prefixed with an underscore are reserved for internal use.\n\t$defaults = array(\n\t\t'label'                     => false,\n\t\t'label_count'               => false,\n\t\t'exclude_from_search'       => null,\n\t\t'_builtin'                  => false,\n\t\t'public'                    => null,\n\t\t'internal'                  => null,\n\t\t'protected'                 => null,\n\t\t'private'                   => null,\n\t\t'publicly_queryable'        => null,\n\t\t'show_in_admin_status_list' => null,\n\t\t'show_in_admin_all_list'    => null,\n\t\t'date_floating'             => null,\n\t);\n\t$args     = wp_parse_args( $args, $defaults );\n\t$args     = (object) $args;\n\n\t$post_status = sanitize_key( $post_status );\n\t$args->name  = $post_status;\n\n\t// Set various defaults.\n\tif ( null === $args->public && null === $args->internal && null === $args->protected && null === $args->private ) {\n\t\t$args->internal = true;\n\t}\n\n\tif ( null === $args->public ) {\n\t\t$args->public = false;\n\t}\n\n\tif ( null === $args->private ) {\n\t\t$args->private = false;\n\t}\n\n\tif ( null === $args->protected ) {\n\t\t$args->protected = false;\n\t}\n\n\tif ( null === $args->internal ) {\n\t\t$args->internal = false;\n\t}\n\n\tif ( null === $args->publicly_queryable ) {\n\t\t$args->publicly_queryable = $args->public;\n\t}\n\n\tif ( null === $args->exclude_from_search ) {\n\t\t$args->exclude_from_search = $args->internal;\n\t}\n\n\tif ( null === $args->show_in_admin_all_list ) {\n\t\t$args->show_in_admin_all_list = ! $args->internal;\n\t}\n\n\tif ( null === $args->show_in_admin_status_list ) {\n\t\t$args->show_in_admin_status_list = ! $args->internal;\n\t}\n\n\tif ( null === $args->date_floating ) {\n\t\t$args->date_floating = false;\n\t}\n\n\tif ( false === $args->label ) {\n\t\t$args->label = $post_status;\n\t}\n\n\tif ( false === $args->label_count ) {\n\t\t// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralSingle,WordPress.WP.I18n.NonSingularStringLiteralPlural\n\t\t$args->label_count = _n_noop( $args->label, $args->label );\n\t}\n\n\t$wp_post_statuses[ $post_status ] = $args;\n\n\treturn $args;\n}\n\n/**\n * Retrieve a post status object by name.\n *\n * @since 3.0.0\n *\n * @global array $wp_post_statuses List of post statuses.\n *\n * @see register_post_status()\n *\n * @param string $post_status The name of a registered post status.\n * @return object|null A post status object.\n */\nfunction get_post_status_object( $post_status ) {\n\tglobal $wp_post_statuses;\n\n\tif ( empty( $wp_post_statuses[ $post_status ] ) ) {\n\t\treturn null;\n\t}\n\n\treturn $wp_post_statuses[ $post_status ];\n}\n\n/**\n * Get a list of post statuses.\n *\n * @since 3.0.0\n *\n * @global array $wp_post_statuses List of post statuses.\n *\n * @see register_post_status()\n *\n * @param array|string $args     Optional. Array or string of post status arguments to compare against\n *                               properties of the global `$wp_post_statuses objects`. Default empty array.\n * @param string       $output   Optional. The type of output to return, either 'names' or 'objects'. Default 'names'.\n * @param string       $operator Optional. The logical operation to perform. 'or' means only one element\n *                               from the array needs to match; 'and' means all elements must match.\n *                               Default 'and'.\n * @return array A list of post status names or objects.\n */\nfunction get_post_stati( $args = array(), $output = 'names', $operator = 'and' ) {\n\tglobal $wp_post_statuses;\n\n\t$field = ( 'names' === $output ) ? 'name' : false;\n\n\treturn wp_filter_object_list( $wp_post_statuses, $args, $operator, $field );\n}\n\n/**\n * Whether the post type is hierarchical.\n *\n * A false return value might also mean that the post type does not exist.\n *\n * @since 3.0.0\n *\n * @see get_post_type_object()\n *\n * @param string $post_type Post type name\n * @return bool Whether post type is hierarchical.\n */\nfunction is_post_type_hierarchical( $post_type ) {\n\tif ( ! post_type_exists( $post_type ) ) {\n\t\treturn false;\n\t}\n\n\t$post_type = get_post_type_object( $post_type );\n\treturn $post_type->hierarchical;\n}\n\n/**\n * Determines whether a post type is registered.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 3.0.0\n *\n * @see get_post_type_object()\n *\n * @param string $post_type Post type name.\n * @return bool Whether post type is registered.\n */\nfunction post_type_exists( $post_type ) {\n\treturn (bool) get_post_type_object( $post_type );\n}\n\n/**\n * Retrieves the post type of the current post or of a given post.\n *\n * @since 2.1.0\n *\n * @param int|WP_Post|null $post Optional. Post ID or post object. Default is global $post.\n * @return string|false          Post type on success, false on failure.\n */\nfunction get_post_type( $post = null ) {\n\t$post = get_post( $post );\n\tif ( $post ) {\n\t\treturn $post->post_type;\n\t}\n\n\treturn false;\n}\n\n/**\n * Retrieves a post type object by name.\n *\n * @since 3.0.0\n * @since 4.6.0 Object returned is now an instance of `WP_Post_Type`.\n *\n * @global array $wp_post_types List of post types.\n *\n * @see register_post_type()\n *\n * @param string $post_type The name of a registered post type.\n * @return WP_Post_Type|null WP_Post_Type object if it exists, null otherwise.\n */\nfunction get_post_type_object( $post_type ) {\n\tglobal $wp_post_types;\n\n\tif ( ! is_scalar( $post_type ) || empty( $wp_post_types[ $post_type ] ) ) {\n\t\treturn null;\n\t}\n\n\treturn $wp_post_types[ $post_type ];\n}\n\n/**\n * Get a list of all registered post type objects.\n *\n * @since 2.9.0\n *\n * @global array $wp_post_types List of post types.\n *\n * @see register_post_type() for accepted arguments.\n *\n * @param array|string $args     Optional. An array of key => value arguments to match against\n *                               the post type objects. Default empty array.\n * @param string       $output   Optional. The type of output to return. Accepts post type 'names'\n *                               or 'objects'. Default 'names'.\n * @param string       $operator Optional. The logical operation to perform. 'or' means only one\n *                               element from the array needs to match; 'and' means all elements\n *                               must match; 'not' means no elements may match. Default 'and'.\n * @return string[]|WP_Post_Type[] An array of post type names or objects.\n */\nfunction get_post_types( $args = array(), $output = 'names', $operator = 'and' ) {\n\tglobal $wp_post_types;\n\n\t$field = ( 'names' === $output ) ? 'name' : false;\n\n\treturn wp_filter_object_list( $wp_post_types, $args, $operator, $field );\n}\n\n/**\n * Registers a post type.\n *\n * Note: Post type registrations should not be hooked before the\n * {@see 'init'} action. Also, any taxonomy connections should be\n * registered via the `$taxonomies` argument to ensure consistency\n * when hooks such as {@see 'parse_query'} or {@see 'pre_get_posts'}\n * are used.\n *\n * Post types can support any number of built-in core features such\n * as meta boxes, custom fields, post thumbnails, post statuses,\n * comments, and more. See the `$supports` argument for a complete\n * list of supported features.\n *\n * @since 2.9.0\n * @since 3.0.0 The `show_ui` argument is now enforced on the new post screen.\n * @since 4.4.0 The `show_ui` argument is now enforced on the post type listing\n *              screen and post editing screen.\n * @since 4.6.0 Post type object returned is now an instance of `WP_Post_Type`.\n * @since 4.7.0 Introduced `show_in_rest`, `rest_base` and `rest_controller_class`\n *              arguments to register the post type in REST API.\n * @since 5.3.0 The `supports` argument will now accept an array of arguments for a feature.\n * .\n * @global array $wp_post_types List of post types.\n *\n * @param string       $post_type Post type key. Must not exceed 20 characters and may\n *                                only contain lowercase alphanumeric characters, dashes,\n *                                and underscores. See sanitize_key().\n * @param array|string $args {\n *     Array or string of arguments for registering a post type.\n *\n *     @type string      $label                 Name of the post type shown in the menu. Usually plural.\n *                                              Default is value of $labels['name'].\n *     @type array       $labels                An array of labels for this post type. If not set, post\n *                                              labels are inherited for non-hierarchical types and page\n *                                              labels for hierarchical ones. See get_post_type_labels() for a full\n *                                              list of supported labels.\n *     @type string      $description           A short descriptive summary of what the post type is.\n *                                              Default empty.\n *     @type bool        $public                Whether a post type is intended for use publicly either via\n *                                              the admin interface or by front-end users. While the default\n *                                              settings of $exclude_from_search, $publicly_queryable, $show_ui,\n *                                              and $show_in_nav_menus are inherited from public, each does not\n *                                              rely on this relationship and controls a very specific intention.\n *                                              Default false.\n *     @type bool        $hierarchical          Whether the post type is hierarchical (e.g. page). Default false.\n *     @type bool        $exclude_from_search   Whether to exclude posts with this post type from front end search\n *                                              results. Default is the opposite value of $public.\n *     @type bool        $publicly_queryable    Whether queries can be performed on the front end for the post type\n *                                              as part of parse_request(). Endpoints would include:\n *                                              * ?post_type={post_type_key}\n *                                              * ?{post_type_key}={single_post_slug}\n *                                              * ?{post_type_query_var}={single_post_slug}\n *                                              If not set, the default is inherited from $public.\n *     @type bool        $show_ui               Whether to generate and allow a UI for managing this post type in the\n *                                              admin. Default is value of $public.\n *     @type bool|string $show_in_menu          Where to show the post type in the admin menu. To work, $show_ui\n *                                              must be true. If true, the post type is shown in its own top level\n *                                              menu. If false, no menu is shown. If a string of an existing top\n *                                              level menu (eg. 'tools.php' or 'edit.php?post_type=page'), the post\n *                                              type will be placed as a sub-menu of that.\n *                                              Default is value of $show_ui.\n *     @type bool        $show_in_nav_menus     Makes this post type available for selection in navigation menus.\n *                                              Default is value of $public.\n *     @type bool        $show_in_admin_bar     Makes this post type available via the admin bar. Default is value\n *                                              of $show_in_menu.\n *     @type bool        $show_in_rest          Whether to include the post type in the REST API. Set this to true\n *                                              for the post type to be available in the block editor.\n *     @type string      $rest_base             To change the base url of REST API route. Default is $post_type.\n *     @type string      $rest_controller_class REST API Controller class name. Default is 'WP_REST_Posts_Controller'.\n *     @type int         $menu_position         The position in the menu order the post type should appear. To work,\n *                                              $show_in_menu must be true. Default null (at the bottom).\n *     @type string      $menu_icon             The url to the icon to be used for this menu. Pass a base64-encoded\n *                                              SVG using a data URI, which will be colored to match the color scheme\n *                                              -- this should begin with 'data:image/svg+xml;base64,'. Pass the name\n *                                              of a Dashicons helper class to use a font icon, e.g.\n *                                              'dashicons-chart-pie'. Pass 'none' to leave div.wp-menu-image empty\n *                                              so an icon can be added via CSS. Defaults to use the posts icon.\n *     @type string      $capability_type       The string to use to build the read, edit, and delete capabilities.\n *                                              May be passed as an array to allow for alternative plurals when using\n *                                              this argument as a base to construct the capabilities, e.g.\n *                                              array('story', 'stories'). Default 'post'.\n *     @type array       $capabilities          Array of capabilities for this post type. $capability_type is used\n *                                              as a base to construct capabilities by default.\n *                                              See get_post_type_capabilities().\n *     @type bool        $map_meta_cap          Whether to use the internal default meta capability handling.\n *                                              Default false.\n *     @type array       $supports              Core feature(s) the post type supports. Serves as an alias for calling\n *                                              add_post_type_support() directly. Core features include 'title',\n *                                              'editor', 'comments', 'revisions', 'trackbacks', 'author', 'excerpt',\n *                                              'page-attributes', 'thumbnail', 'custom-fields', and 'post-formats'.\n *                                              Additionally, the 'revisions' feature dictates whether the post type\n *                                              will store revisions, and the 'comments' feature dictates whether the\n *                                              comments count will show on the edit screen. A feature can also be\n *                                              specified as an array of arguments to provide additional information\n *                                              about supporting that feature.\n *                                              Example: `array( 'my_feature', array( 'field' => 'value' ) )`.\n *                                              Default is an array containing 'title' and 'editor'.\n *     @type callable    $register_meta_box_cb  Provide a callback function that sets up the meta boxes for the\n *                                              edit form. Do remove_meta_box() and add_meta_box() calls in the\n *                                              callback. Default null.\n *     @type array       $taxonomies            An array of taxonomy identifiers that will be registered for the\n *                                              post type. Taxonomies can be registered later with register_taxonomy()\n *                                              or register_taxonomy_for_object_type().\n *                                              Default empty array.\n *     @type bool|string $has_archive           Whether there should be post type archives, or if a string, the\n *                                              archive slug to use. Will generate the proper rewrite rules if\n *                                              $rewrite is enabled. Default false.\n *     @type bool|array  $rewrite              {\n *         Triggers the handling of rewrites for this post type. To prevent rewrite, set to false.\n *         Defaults to true, using $post_type as slug. To specify rewrite rules, an array can be\n *         passed with any of these keys:\n *\n *         @type string $slug       Customize the permastruct slug. Defaults to $post_type key.\n *         @type bool   $with_front Whether the permastruct should be prepended with WP_Rewrite::$front.\n *                                  Default true.\n *         @type bool   $feeds      Whether the feed permastruct should be built for this post type.\n *                                  Default is value of $has_archive.\n *         @type bool   $pages      Whether the permastruct should provide for pagination. Default true.\n *         @type const  $ep_mask    Endpoint mask to assign. If not specified and permalink_epmask is set,\n *                                  inherits from $permalink_epmask. If not specified and permalink_epmask\n *                                  is not set, defaults to EP_PERMALINK.\n *     }\n *     @type string|bool $query_var             Sets the query_var key for this post type. Defaults to $post_type\n *                                              key. If false, a post type cannot be loaded at\n *                                              ?{query_var}={post_slug}. If specified as a string, the query\n *                                              ?{query_var_string}={post_slug} will be valid.\n *     @type bool        $can_export            Whether to allow this post type to be exported. Default true.\n *     @type bool        $delete_with_user      Whether to delete posts of this type when deleting a user. If true,\n *                                              posts of this type belonging to the user will be moved to Trash\n *                                              when then user is deleted. If false, posts of this type belonging\n *                                              to the user will *not* be trashed or deleted. If not set (the default),\n *                                              posts are trashed if post_type_supports('author'). Otherwise posts\n *                                              are not trashed or deleted. Default null.\n *     @type bool        $_builtin              FOR INTERNAL USE ONLY! True if this post type is a native or\n *                                              \"built-in\" post_type. Default false.\n *     @type string      $_edit_link            FOR INTERNAL USE ONLY! URL segment to use for edit link of\n *                                              this post type. Default 'post.php?post=%d'.\n * }\n * @return WP_Post_Type|WP_Error The registered post type object on success,\n *                               WP_Error object on failure.\n */\nfunction register_post_type( $post_type, $args = array() ) {\n\tglobal $wp_post_types;\n\n\tif ( ! is_array( $wp_post_types ) ) {\n\t\t$wp_post_types = array();\n\t}\n\n\t// Sanitize post type name.\n\t$post_type = sanitize_key( $post_type );\n\n\tif ( empty( $post_type ) || strlen( $post_type ) > 20 ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Post type names must be between 1 and 20 characters in length.' ), '4.2.0' );\n\t\treturn new WP_Error( 'post_type_length_invalid', __( 'Post type names must be between 1 and 20 characters in length.' ) );\n\t}\n\n\t$post_type_object = new WP_Post_Type( $post_type, $args );\n\t$post_type_object->add_supports();\n\t$post_type_object->add_rewrite_rules();\n\t$post_type_object->register_meta_boxes();\n\n\t$wp_post_types[ $post_type ] = $post_type_object;\n\n\t$post_type_object->add_hooks();\n\t$post_type_object->register_taxonomies();\n\n\t/**\n\t * Fires after a post type is registered.\n\t *\n\t * @since 3.3.0\n\t * @since 4.6.0 Converted the `$post_type` parameter to accept a `WP_Post_Type` object.\n\t *\n\t * @param string       $post_type        Post type.\n\t * @param WP_Post_Type $post_type_object Arguments used to register the post type.\n\t */\n\tdo_action( 'registered_post_type', $post_type, $post_type_object );\n\n\treturn $post_type_object;\n}\n\n/**\n * Unregisters a post type.\n *\n * Can not be used to unregister built-in post types.\n *\n * @since 4.5.0\n *\n * @global array $wp_post_types List of post types.\n *\n * @param string $post_type Post type to unregister.\n * @return bool|WP_Error True on success, WP_Error on failure or if the post type doesn't exist.\n */\nfunction unregister_post_type( $post_type ) {\n\tglobal $wp_post_types;\n\n\tif ( ! post_type_exists( $post_type ) ) {\n\t\treturn new WP_Error( 'invalid_post_type', __( 'Invalid post type.' ) );\n\t}\n\n\t$post_type_object = get_post_type_object( $post_type );\n\n\t// Do not allow unregistering internal post types.\n\tif ( $post_type_object->_builtin ) {\n\t\treturn new WP_Error( 'invalid_post_type', __( 'Unregistering a built-in post type is not allowed' ) );\n\t}\n\n\t$post_type_object->remove_supports();\n\t$post_type_object->remove_rewrite_rules();\n\t$post_type_object->unregister_meta_boxes();\n\t$post_type_object->remove_hooks();\n\t$post_type_object->unregister_taxonomies();\n\n\tunset( $wp_post_types[ $post_type ] );\n\n\t/**\n\t * Fires after a post type was unregistered.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param string $post_type Post type key.\n\t */\n\tdo_action( 'unregistered_post_type', $post_type );\n\n\treturn true;\n}\n\n/**\n * Build an object with all post type capabilities out of a post type object\n *\n * Post type capabilities use the 'capability_type' argument as a base, if the\n * capability is not set in the 'capabilities' argument array or if the\n * 'capabilities' argument is not supplied.\n *\n * The capability_type argument can optionally be registered as an array, with\n * the first value being singular and the second plural, e.g. array('story, 'stories')\n * Otherwise, an 's' will be added to the value for the plural form. After\n * registration, capability_type will always be a string of the singular value.\n *\n * By default, eight keys are accepted as part of the capabilities array:\n *\n * - edit_post, read_post, and delete_post are meta capabilities, which are then\n *   generally mapped to corresponding primitive capabilities depending on the\n *   context, which would be the post being edited/read/deleted and the user or\n *   role being checked. Thus these capabilities would generally not be granted\n *   directly to users or roles.\n *\n * - edit_posts - Controls whether objects of this post type can be edited.\n * - edit_others_posts - Controls whether objects of this type owned by other users\n *   can be edited. If the post type does not support an author, then this will\n *   behave like edit_posts.\n * - delete_posts - Controls whether objects of this post type can be deleted.\n * - publish_posts - Controls publishing objects of this post type.\n * - read_private_posts - Controls whether private objects can be read.\n *\n * These five primitive capabilities are checked in core in various locations.\n * There are also six other primitive capabilities which are not referenced\n * directly in core, except in map_meta_cap(), which takes the three aforementioned\n * meta capabilities and translates them into one or more primitive capabilities\n * that must then be checked against the user or role, depending on the context.\n *\n * - read - Controls whether objects of this post type can be read.\n * - delete_private_posts - Controls whether private objects can be deleted.\n * - delete_published_posts - Controls whether published objects can be deleted.\n * - delete_others_posts - Controls whether objects owned by other users can be\n *   can be deleted. If the post type does not support an author, then this will\n *   behave like delete_posts.\n * - edit_private_posts - Controls whether private objects can be edited.\n * - edit_published_posts - Controls whether published objects can be edited.\n *\n * These additional capabilities are only used in map_meta_cap(). Thus, they are\n * only assigned by default if the post type is registered with the 'map_meta_cap'\n * argument set to true (default is false).\n *\n * @since 3.0.0\n * @since 5.4.0 'delete_posts' is included in default capabilities.\n *\n * @see register_post_type()\n * @see map_meta_cap()\n *\n * @param object $args Post type registration arguments.\n * @return object Object with all the capabilities as member variables.\n */\nfunction get_post_type_capabilities( $args ) {\n\tif ( ! is_array( $args->capability_type ) ) {\n\t\t$args->capability_type = array( $args->capability_type, $args->capability_type . 's' );\n\t}\n\n\t// Singular base for meta capabilities, plural base for primitive capabilities.\n\tlist( $singular_base, $plural_base ) = $args->capability_type;\n\n\t$default_capabilities = array(\n\t\t// Meta capabilities.\n\t\t'edit_post'          => 'edit_' . $singular_base,\n\t\t'read_post'          => 'read_' . $singular_base,\n\t\t'delete_post'        => 'delete_' . $singular_base,\n\t\t// Primitive capabilities used outside of map_meta_cap():\n\t\t'edit_posts'         => 'edit_' . $plural_base,\n\t\t'edit_others_posts'  => 'edit_others_' . $plural_base,\n\t\t'delete_posts'       => 'delete_' . $plural_base,\n\t\t'publish_posts'      => 'publish_' . $plural_base,\n\t\t'read_private_posts' => 'read_private_' . $plural_base,\n\t);\n\n\t// Primitive capabilities used within map_meta_cap():\n\tif ( $args->map_meta_cap ) {\n\t\t$default_capabilities_for_mapping = array(\n\t\t\t'read'                   => 'read',\n\t\t\t'delete_private_posts'   => 'delete_private_' . $plural_base,\n\t\t\t'delete_published_posts' => 'delete_published_' . $plural_base,\n\t\t\t'delete_others_posts'    => 'delete_others_' . $plural_base,\n\t\t\t'edit_private_posts'     => 'edit_private_' . $plural_base,\n\t\t\t'edit_published_posts'   => 'edit_published_' . $plural_base,\n\t\t);\n\t\t$default_capabilities             = array_merge( $default_capabilities, $default_capabilities_for_mapping );\n\t}\n\n\t$capabilities = array_merge( $default_capabilities, $args->capabilities );\n\n\t// Post creation capability simply maps to edit_posts by default:\n\tif ( ! isset( $capabilities['create_posts'] ) ) {\n\t\t$capabilities['create_posts'] = $capabilities['edit_posts'];\n\t}\n\n\t// Remember meta capabilities for future reference.\n\tif ( $args->map_meta_cap ) {\n\t\t_post_type_meta_capabilities( $capabilities );\n\t}\n\n\treturn (object) $capabilities;\n}\n\n/**\n * Store or return a list of post type meta caps for map_meta_cap().\n *\n * @since 3.1.0\n * @access private\n *\n * @global array $post_type_meta_caps Used to store meta capabilities.\n *\n * @param string[] $capabilities Post type meta capabilities.\n */\nfunction _post_type_meta_capabilities( $capabilities = null ) {\n\tglobal $post_type_meta_caps;\n\n\tforeach ( $capabilities as $core => $custom ) {\n\t\tif ( in_array( $core, array( 'read_post', 'delete_post', 'edit_post' ), true ) ) {\n\t\t\t$post_type_meta_caps[ $custom ] = $core;\n\t\t}\n\t}\n}\n\n/**\n * Builds an object with all post type labels out of a post type object.\n *\n * Accepted keys of the label array in the post type object:\n *\n * - `name` - General name for the post type, usually plural. The same and overridden\n *          by `$post_type_object->label`. Default is 'Posts' / 'Pages'.\n * - `singular_name` - Name for one object of this post type. Default is 'Post' / 'Page'.\n * - `add_new` - Default is 'Add New' for both hierarchical and non-hierarchical types.\n *             When internationalizing this string, please use a {@link https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/#disambiguation-by-context gettext context}\n *             matching your post type. Example: `_x( 'Add New', 'product', 'textdomain' );`.\n * - `add_new_item` - Label for adding a new singular item. Default is 'Add New Post' / 'Add New Page'.\n * - `edit_item` - Label for editing a singular item. Default is 'Edit Post' / 'Edit Page'.\n * - `new_item` - Label for the new item page title. Default is 'New Post' / 'New Page'.\n * - `view_item` - Label for viewing a singular item. Default is 'View Post' / 'View Page'.\n * - `view_items` - Label for viewing post type archives. Default is 'View Posts' / 'View Pages'.\n * - `search_items` - Label for searching plural items. Default is 'Search Posts' / 'Search Pages'.\n * - `not_found` - Label used when no items are found. Default is 'No posts found' / 'No pages found'.\n * - `not_found_in_trash` - Label used when no items are in the Trash. Default is 'No posts found in Trash' /\n *                        'No pages found in Trash'.\n * - `parent_item_colon` - Label used to prefix parents of hierarchical items. Not used on non-hierarchical\n *                       post types. Default is 'Parent Page:'.\n * - `all_items` - Label to signify all items in a submenu link. Default is 'All Posts' / 'All Pages'.\n * - `archives` - Label for archives in nav menus. Default is 'Post Archives' / 'Page Archives'.\n * - `attributes` - Label for the attributes meta box. Default is 'Post Attributes' / 'Page Attributes'.\n * - `insert_into_item` - Label for the media frame button. Default is 'Insert into post' / 'Insert into page'.\n * - `uploaded_to_this_item` - Label for the media frame filter. Default is 'Uploaded to this post' /\n *                           'Uploaded to this page'.\n * - `featured_image` - Label for the featured image meta box title. Default is 'Featured image'.\n * - `set_featured_image` - Label for setting the featured image. Default is 'Set featured image'.\n * - `remove_featured_image` - Label for removing the featured image. Default is 'Remove featured image'.\n * - `use_featured_image` - Label in the media frame for using a featured image. Default is 'Use as featured image'.\n * - `menu_name` - Label for the menu name. Default is the same as `name`.\n * - `filter_items_list` - Label for the table views hidden heading. Default is 'Filter posts list' /\n *                       'Filter pages list'.\n * - `items_list_navigation` - Label for the table pagination hidden heading. Default is 'Posts list navigation' /\n *                           'Pages list navigation'.\n * - `items_list` - Label for the table hidden heading. Default is 'Posts list' / 'Pages list'.\n * - `item_published` - Label used when an item is published. Default is 'Post published.' / 'Page published.'\n * - `item_published_privately` - Label used when an item is published with private visibility.\n *                              Default is 'Post published privately.' / 'Page published privately.'\n * - `item_reverted_to_draft` - Label used when an item is switched to a draft.\n *                            Default is 'Post reverted to draft.' / 'Page reverted to draft.'\n * - `item_scheduled` - Label used when an item is scheduled for publishing. Default is 'Post scheduled.' /\n *                    'Page scheduled.'\n * - `item_updated` - Label used when an item is updated. Default is 'Post updated.' / 'Page updated.'\n *\n * Above, the first default value is for non-hierarchical post types (like posts)\n * and the second one is for hierarchical post types (like pages).\n *\n * Note: To set labels used in post type admin notices, see the {@see 'post_updated_messages'} filter.\n *\n * @since 3.0.0\n * @since 4.3.0 Added the `featured_image`, `set_featured_image`, `remove_featured_image`,\n *              and `use_featured_image` labels.\n * @since 4.4.0 Added the `archives`, `insert_into_item`, `uploaded_to_this_item`, `filter_items_list`,\n *              `items_list_navigation`, and `items_list` labels.\n * @since 4.6.0 Converted the `$post_type` parameter to accept a `WP_Post_Type` object.\n * @since 4.7.0 Added the `view_items` and `attributes` labels.\n * @since 5.0.0 Added the `item_published`, `item_published_privately`, `item_reverted_to_draft`,\n *              `item_scheduled`, and `item_updated` labels.\n *\n * @access private\n *\n * @param object|WP_Post_Type $post_type_object Post type object.\n * @return object Object with all the labels as member variables.\n */\nfunction get_post_type_labels( $post_type_object ) {\n\t$nohier_vs_hier_defaults              = array(\n\t\t'name'                     => array( _x( 'Posts', 'post type general name' ), _x( 'Pages', 'post type general name' ) ),\n\t\t'singular_name'            => array( _x( 'Post', 'post type singular name' ), _x( 'Page', 'post type singular name' ) ),\n\t\t'add_new'                  => array( _x( 'Add New', 'post' ), _x( 'Add New', 'page' ) ),\n\t\t'add_new_item'             => array( __( 'Add New Post' ), __( 'Add New Page' ) ),\n\t\t'edit_item'                => array( __( 'Edit Post' ), __( 'Edit Page' ) ),\n\t\t'new_item'                 => array( __( 'New Post' ), __( 'New Page' ) ),\n\t\t'view_item'                => array( __( 'View Post' ), __( 'View Page' ) ),\n\t\t'view_items'               => array( __( 'View Posts' ), __( 'View Pages' ) ),\n\t\t'search_items'             => array( __( 'Search Posts' ), __( 'Search Pages' ) ),\n\t\t'not_found'                => array( __( 'No posts found.' ), __( 'No pages found.' ) ),\n\t\t'not_found_in_trash'       => array( __( 'No posts found in Trash.' ), __( 'No pages found in Trash.' ) ),\n\t\t'parent_item_colon'        => array( null, __( 'Parent Page:' ) ),\n\t\t'all_items'                => array( __( 'All Posts' ), __( 'All Pages' ) ),\n\t\t'archives'                 => array( __( 'Post Archives' ), __( 'Page Archives' ) ),\n\t\t'attributes'               => array( __( 'Post Attributes' ), __( 'Page Attributes' ) ),\n\t\t'insert_into_item'         => array( __( 'Insert into post' ), __( 'Insert into page' ) ),\n\t\t'uploaded_to_this_item'    => array( __( 'Uploaded to this post' ), __( 'Uploaded to this page' ) ),\n\t\t'featured_image'           => array( _x( 'Featured image', 'post' ), _x( 'Featured image', 'page' ) ),\n\t\t'set_featured_image'       => array( _x( 'Set featured image', 'post' ), _x( 'Set featured image', 'page' ) ),\n\t\t'remove_featured_image'    => array( _x( 'Remove featured image', 'post' ), _x( 'Remove featured image', 'page' ) ),\n\t\t'use_featured_image'       => array( _x( 'Use as featured image', 'post' ), _x( 'Use as featured image', 'page' ) ),\n\t\t'filter_items_list'        => array( __( 'Filter posts list' ), __( 'Filter pages list' ) ),\n\t\t'items_list_navigation'    => array( __( 'Posts list navigation' ), __( 'Pages list navigation' ) ),\n\t\t'items_list'               => array( __( 'Posts list' ), __( 'Pages list' ) ),\n\t\t'item_published'           => array( __( 'Post published.' ), __( 'Page published.' ) ),\n\t\t'item_published_privately' => array( __( 'Post published privately.' ), __( 'Page published privately.' ) ),\n\t\t'item_reverted_to_draft'   => array( __( 'Post reverted to draft.' ), __( 'Page reverted to draft.' ) ),\n\t\t'item_scheduled'           => array( __( 'Post scheduled.' ), __( 'Page scheduled.' ) ),\n\t\t'item_updated'             => array( __( 'Post updated.' ), __( 'Page updated.' ) ),\n\t);\n\t$nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];\n\n\t$labels = _get_custom_object_labels( $post_type_object, $nohier_vs_hier_defaults );\n\n\t$post_type = $post_type_object->name;\n\n\t$default_labels = clone $labels;\n\n\t/**\n\t * Filters the labels of a specific post type.\n\t *\n\t * The dynamic portion of the hook name, `$post_type`, refers to\n\t * the post type slug.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @see get_post_type_labels() for the full list of labels.\n\t *\n\t * @param object $labels Object with labels for the post type as member variables.\n\t */\n\t$labels = apply_filters( \"post_type_labels_{$post_type}\", $labels );\n\n\t// Ensure that the filtered labels contain all required default values.\n\t$labels = (object) array_merge( (array) $default_labels, (array) $labels );\n\n\treturn $labels;\n}\n\n/**\n * Build an object with custom-something object (post type, taxonomy) labels\n * out of a custom-something object\n *\n * @since 3.0.0\n * @access private\n *\n * @param object $object                  A custom-something object.\n * @param array  $nohier_vs_hier_defaults Hierarchical vs non-hierarchical default labels.\n * @return object Object containing labels for the given custom-something object.\n */\nfunction _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) {\n\t$object->labels = (array) $object->labels;\n\n\tif ( isset( $object->label ) && empty( $object->labels['name'] ) ) {\n\t\t$object->labels['name'] = $object->label;\n\t}\n\n\tif ( ! isset( $object->labels['singular_name'] ) && isset( $object->labels['name'] ) ) {\n\t\t$object->labels['singular_name'] = $object->labels['name'];\n\t}\n\n\tif ( ! isset( $object->labels['name_admin_bar'] ) ) {\n\t\t$object->labels['name_admin_bar'] = isset( $object->labels['singular_name'] ) ? $object->labels['singular_name'] : $object->name;\n\t}\n\n\tif ( ! isset( $object->labels['menu_name'] ) && isset( $object->labels['name'] ) ) {\n\t\t$object->labels['menu_name'] = $object->labels['name'];\n\t}\n\n\tif ( ! isset( $object->labels['all_items'] ) && isset( $object->labels['menu_name'] ) ) {\n\t\t$object->labels['all_items'] = $object->labels['menu_name'];\n\t}\n\n\tif ( ! isset( $object->labels['archives'] ) && isset( $object->labels['all_items'] ) ) {\n\t\t$object->labels['archives'] = $object->labels['all_items'];\n\t}\n\n\t$defaults = array();\n\tforeach ( $nohier_vs_hier_defaults as $key => $value ) {\n\t\t$defaults[ $key ] = $object->hierarchical ? $value[1] : $value[0];\n\t}\n\t$labels         = array_merge( $defaults, $object->labels );\n\t$object->labels = (object) $object->labels;\n\n\treturn (object) $labels;\n}\n\n/**\n * Add submenus for post types.\n *\n * @access private\n * @since 3.1.0\n */\nfunction _add_post_type_submenus() {\n\tforeach ( get_post_types( array( 'show_ui' => true ) ) as $ptype ) {\n\t\t$ptype_obj = get_post_type_object( $ptype );\n\t\t// Sub-menus only.\n\t\tif ( ! $ptype_obj->show_in_menu || true === $ptype_obj->show_in_menu ) {\n\t\t\tcontinue;\n\t\t}\n\t\tadd_submenu_page( $ptype_obj->show_in_menu, $ptype_obj->labels->name, $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, \"edit.php?post_type=$ptype\" );\n\t}\n}\n\n/**\n * Registers support of certain features for a post type.\n *\n * All core features are directly associated with a functional area of the edit\n * screen, such as the editor or a meta box. Features include: 'title', 'editor',\n * 'comments', 'revisions', 'trackbacks', 'author', 'excerpt', 'page-attributes',\n * 'thumbnail', 'custom-fields', and 'post-formats'.\n *\n * Additionally, the 'revisions' feature dictates whether the post type will\n * store revisions, and the 'comments' feature dictates whether the comments\n * count will show on the edit screen.\n *\n * A third, optional parameter can also be passed along with a feature to provide\n * additional information about supporting that feature.\n *\n * Example usage:\n *\n *     add_post_type_support( 'my_post_type', 'comments' );\n *     add_post_type_support( 'my_post_type', array(\n *         'author', 'excerpt',\n *     ) );\n *     add_post_type_support( 'my_post_type', 'my_feature', array(\n *         'field' => 'value',\n *     ) );\n *\n * @since 3.0.0\n * @since 5.3.0 Formalized the existing and already documented `...$args` parameter\n *              by adding it to the function signature.\n *\n * @global array $_wp_post_type_features\n *\n * @param string       $post_type The post type for which to add the feature.\n * @param string|array $feature   The feature being added, accepts an array of\n *                                feature strings or a single string.\n * @param mixed        ...$args   Optional extra arguments to pass along with certain features.\n */\nfunction add_post_type_support( $post_type, $feature, ...$args ) {\n\tglobal $_wp_post_type_features;\n\n\t$features = (array) $feature;\n\tforeach ( $features as $feature ) {\n\t\tif ( $args ) {\n\t\t\t$_wp_post_type_features[ $post_type ][ $feature ] = $args;\n\t\t} else {\n\t\t\t$_wp_post_type_features[ $post_type ][ $feature ] = true;\n\t\t}\n\t}\n}\n\n/**\n * Remove support for a feature from a post type.\n *\n * @since 3.0.0\n *\n * @global array $_wp_post_type_features\n *\n * @param string $post_type The post type for which to remove the feature.\n * @param string $feature   The feature being removed.\n */\nfunction remove_post_type_support( $post_type, $feature ) {\n\tglobal $_wp_post_type_features;\n\n\tunset( $_wp_post_type_features[ $post_type ][ $feature ] );\n}\n\n/**\n * Get all the post type features\n *\n * @since 3.4.0\n *\n * @global array $_wp_post_type_features\n *\n * @param string $post_type The post type.\n * @return array Post type supports list.\n */\nfunction get_all_post_type_supports( $post_type ) {\n\tglobal $_wp_post_type_features;\n\n\tif ( isset( $_wp_post_type_features[ $post_type ] ) ) {\n\t\treturn $_wp_post_type_features[ $post_type ];\n\t}\n\n\treturn array();\n}\n\n/**\n * Check a post type's support for a given feature.\n *\n * @since 3.0.0\n *\n * @global array $_wp_post_type_features\n *\n * @param string $post_type The post type being checked.\n * @param string $feature   The feature being checked.\n * @return bool Whether the post type supports the given feature.\n */\nfunction post_type_supports( $post_type, $feature ) {\n\tglobal $_wp_post_type_features;\n\n\treturn ( isset( $_wp_post_type_features[ $post_type ][ $feature ] ) );\n}\n\n/**\n * Retrieves a list of post type names that support a specific feature.\n *\n * @since 4.5.0\n *\n * @global array $_wp_post_type_features Post type features\n *\n * @param array|string $feature  Single feature or an array of features the post types should support.\n * @param string       $operator Optional. The logical operation to perform. 'or' means\n *                               only one element from the array needs to match; 'and'\n *                               means all elements must match; 'not' means no elements may\n *                               match. Default 'and'.\n * @return string[] A list of post type names.\n */\nfunction get_post_types_by_support( $feature, $operator = 'and' ) {\n\tglobal $_wp_post_type_features;\n\n\t$features = array_fill_keys( (array) $feature, true );\n\n\treturn array_keys( wp_filter_object_list( $_wp_post_type_features, $features, $operator ) );\n}\n\n/**\n * Update the post type for the post ID.\n *\n * The page or post cache will be cleaned for the post ID.\n *\n * @since 2.5.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int    $post_id   Optional. Post ID to change post type. Default 0.\n * @param string $post_type Optional. Post type. Accepts 'post' or 'page' to\n *                          name a few. Default 'post'.\n * @return int|false Amount of rows changed. Should be 1 for success and 0 for failure.\n */\nfunction set_post_type( $post_id = 0, $post_type = 'post' ) {\n\tglobal $wpdb;\n\n\t$post_type = sanitize_post_field( 'post_type', $post_type, $post_id, 'db' );\n\t$return    = $wpdb->update( $wpdb->posts, array( 'post_type' => $post_type ), array( 'ID' => $post_id ) );\n\n\tclean_post_cache( $post_id );\n\n\treturn $return;\n}\n\n/**\n * Determines whether a post type is considered \"viewable\".\n *\n * For built-in post types such as posts and pages, the 'public' value will be evaluated.\n * For all others, the 'publicly_queryable' value will be used.\n *\n * @since 4.4.0\n * @since 4.5.0 Added the ability to pass a post type name in addition to object.\n * @since 4.6.0 Converted the `$post_type` parameter to accept a `WP_Post_Type` object.\n *\n * @param string|WP_Post_Type $post_type Post type name or object.\n * @return bool Whether the post type should be considered viewable.\n */\nfunction is_post_type_viewable( $post_type ) {\n\tif ( is_scalar( $post_type ) ) {\n\t\t$post_type = get_post_type_object( $post_type );\n\t\tif ( ! $post_type ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn $post_type->publicly_queryable || ( $post_type->_builtin && $post_type->public );\n}\n\n/**\n * Retrieves an array of the latest posts, or posts matching the given criteria.\n *\n * The defaults are as follows:\n *\n * @since 1.2.0\n *\n * @see WP_Query::parse_query()\n *\n * @param array $args {\n *     Optional. Arguments to retrieve posts. See WP_Query::parse_query() for all\n *     available arguments.\n *\n *     @type int        $numberposts      Total number of posts to retrieve. Is an alias of $posts_per_page\n *                                        in WP_Query. Accepts -1 for all. Default 5.\n *     @type int|string $category         Category ID or comma-separated list of IDs (this or any children).\n *                                        Is an alias of $cat in WP_Query. Default 0.\n *     @type array      $include          An array of post IDs to retrieve, sticky posts will be included.\n *                                        Is an alias of $post__in in WP_Query. Default empty array.\n *     @type array      $exclude          An array of post IDs not to retrieve. Default empty array.\n *     @type bool       $suppress_filters Whether to suppress filters. Default true.\n * }\n * @return WP_Post[]|int[] Array of post objects or post IDs.\n */\nfunction get_posts( $args = null ) {\n\t$defaults = array(\n\t\t'numberposts'      => 5,\n\t\t'category'         => 0,\n\t\t'orderby'          => 'date',\n\t\t'order'            => 'DESC',\n\t\t'include'          => array(),\n\t\t'exclude'          => array(),\n\t\t'meta_key'         => '',\n\t\t'meta_value'       => '',\n\t\t'post_type'        => 'post',\n\t\t'suppress_filters' => true,\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\tif ( empty( $parsed_args['post_status'] ) ) {\n\t\t$parsed_args['post_status'] = ( 'attachment' === $parsed_args['post_type'] ) ? 'inherit' : 'publish';\n\t}\n\tif ( ! empty( $parsed_args['numberposts'] ) && empty( $parsed_args['posts_per_page'] ) ) {\n\t\t$parsed_args['posts_per_page'] = $parsed_args['numberposts'];\n\t}\n\tif ( ! empty( $parsed_args['category'] ) ) {\n\t\t$parsed_args['cat'] = $parsed_args['category'];\n\t}\n\tif ( ! empty( $parsed_args['include'] ) ) {\n\t\t$incposts                      = wp_parse_id_list( $parsed_args['include'] );\n\t\t$parsed_args['posts_per_page'] = count( $incposts );  // Only the number of posts included.\n\t\t$parsed_args['post__in']       = $incposts;\n\t} elseif ( ! empty( $parsed_args['exclude'] ) ) {\n\t\t$parsed_args['post__not_in'] = wp_parse_id_list( $parsed_args['exclude'] );\n\t}\n\n\t$parsed_args['ignore_sticky_posts'] = true;\n\t$parsed_args['no_found_rows']       = true;\n\n\t$get_posts = new WP_Query;\n\treturn $get_posts->query( $parsed_args );\n\n}\n\n//\n// Post meta functions.\n//\n\n/**\n * Adds a meta field to the given post.\n *\n * Post meta data is called \"Custom Fields\" on the Administration Screen.\n *\n * @since 1.5.0\n *\n * @param int    $post_id    Post ID.\n * @param string $meta_key   Metadata name.\n * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.\n * @param bool   $unique     Optional. Whether the same key should not be added.\n *                           Default false.\n * @return int|false Meta ID on success, false on failure.\n */\nfunction add_post_meta( $post_id, $meta_key, $meta_value, $unique = false ) {\n\t// Make sure meta is added to the post, not a revision.\n\t$the_post = wp_is_post_revision( $post_id );\n\tif ( $the_post ) {\n\t\t$post_id = $the_post;\n\t}\n\n\treturn add_metadata( 'post', $post_id, $meta_key, $meta_value, $unique );\n}\n\n/**\n * Deletes a post meta field for the given post ID.\n *\n * You can match based on the key, or key and value. Removing based on key and\n * value, will keep from removing duplicate metadata with the same key. It also\n * allows removing all metadata matching the key, if needed.\n *\n * @since 1.5.0\n *\n * @param int    $post_id    Post ID.\n * @param string $meta_key   Metadata name.\n * @param mixed  $meta_value Optional. Metadata value. If provided,\n *                           rows will only be removed that match the value.\n *                           Must be serializable if non-scalar. Default empty.\n * @return bool True on success, false on failure.\n */\nfunction delete_post_meta( $post_id, $meta_key, $meta_value = '' ) {\n\t// Make sure meta is added to the post, not a revision.\n\t$the_post = wp_is_post_revision( $post_id );\n\tif ( $the_post ) {\n\t\t$post_id = $the_post;\n\t}\n\n\treturn delete_metadata( 'post', $post_id, $meta_key, $meta_value );\n}\n\n/**\n * Retrieves a post meta field for the given post ID.\n *\n * @since 1.5.0\n *\n * @param int    $post_id Post ID.\n * @param string $key     Optional. The meta key to retrieve. By default,\n *                        returns data for all keys. Default empty.\n * @param bool   $single  Optional. Whether to return a single value.\n *                        This parameter has no effect if $key is not specified.\n *                        Default false.\n * @return mixed An array if $single is false. The value of the meta field\n *               if $single is true. False for an invalid $post_id.\n */\nfunction get_post_meta( $post_id, $key = '', $single = false ) {\n\treturn get_metadata( 'post', $post_id, $key, $single );\n}\n\n/**\n * Updates a post meta field based on the given post ID.\n *\n * Use the `$prev_value` parameter to differentiate between meta fields with the\n * same key and post ID.\n *\n * If the meta field for the post does not exist, it will be added and its ID returned.\n *\n * Can be used in place of add_post_meta().\n *\n * @since 1.5.0\n *\n * @param int    $post_id    Post ID.\n * @param string $meta_key   Metadata key.\n * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.\n * @param mixed  $prev_value Optional. Previous value to check before updating.\n *                           If specified, only update existing metadata entries with\n *                           this value. Otherwise, update all entries. Default empty.\n * @return int|bool Meta ID if the key didn't exist, true on successful update,\n *                  false on failure or if the value passed to the function\n *                  is the same as the one that is already in the database.\n */\nfunction update_post_meta( $post_id, $meta_key, $meta_value, $prev_value = '' ) {\n\t// Make sure meta is added to the post, not a revision.\n\t$the_post = wp_is_post_revision( $post_id );\n\tif ( $the_post ) {\n\t\t$post_id = $the_post;\n\t}\n\n\treturn update_metadata( 'post', $post_id, $meta_key, $meta_value, $prev_value );\n}\n\n/**\n * Deletes everything from post meta matching the given meta key.\n *\n * @since 2.3.0\n *\n * @param string $post_meta_key Key to search for when deleting.\n * @return bool Whether the post meta key was deleted from the database.\n */\nfunction delete_post_meta_by_key( $post_meta_key ) {\n\treturn delete_metadata( 'post', null, $post_meta_key, '', true );\n}\n\n/**\n * Registers a meta key for posts.\n *\n * @since 4.9.8\n *\n * @param string $post_type Post type to register a meta key for. Pass an empty string\n *                          to register the meta key across all existing post types.\n * @param string $meta_key  The meta key to register.\n * @param array  $args      Data used to describe the meta key when registered. See\n *                          {@see register_meta()} for a list of supported arguments.\n * @return bool True if the meta key was successfully registered, false if not.\n */\nfunction register_post_meta( $post_type, $meta_key, array $args ) {\n\t$args['object_subtype'] = $post_type;\n\n\treturn register_meta( 'post', $meta_key, $args );\n}\n\n/**\n * Unregisters a meta key for posts.\n *\n * @since 4.9.8\n *\n * @param string $post_type Post type the meta key is currently registered for. Pass\n *                          an empty string if the meta key is registered across all\n *                          existing post types.\n * @param string $meta_key  The meta key to unregister.\n * @return bool True on success, false if the meta key was not previously registered.\n */\nfunction unregister_post_meta( $post_type, $meta_key ) {\n\treturn unregister_meta_key( 'post', $meta_key, $post_type );\n}\n\n/**\n * Retrieve post meta fields, based on post ID.\n *\n * The post meta fields are retrieved from the cache where possible,\n * so the function is optimized to be called more than once.\n *\n * @since 1.2.0\n *\n * @param int $post_id Optional. Post ID. Default is ID of the global $post.\n * @return array Post meta for the given post.\n */\nfunction get_post_custom( $post_id = 0 ) {\n\t$post_id = absint( $post_id );\n\tif ( ! $post_id ) {\n\t\t$post_id = get_the_ID();\n\t}\n\n\treturn get_post_meta( $post_id );\n}\n\n/**\n * Retrieve meta field names for a post.\n *\n * If there are no meta fields, then nothing (null) will be returned.\n *\n * @since 1.2.0\n *\n * @param int $post_id Optional. Post ID. Default is ID of the global $post.\n * @return array|void Array of the keys, if retrieved.\n */\nfunction get_post_custom_keys( $post_id = 0 ) {\n\t$custom = get_post_custom( $post_id );\n\n\tif ( ! is_array( $custom ) ) {\n\t\treturn;\n\t}\n\n\t$keys = array_keys( $custom );\n\tif ( $keys ) {\n\t\treturn $keys;\n\t}\n}\n\n/**\n * Retrieve values for a custom post field.\n *\n * The parameters must not be considered optional. All of the post meta fields\n * will be retrieved and only the meta field key values returned.\n *\n * @since 1.2.0\n *\n * @param string $key     Optional. Meta field key. Default empty.\n * @param int    $post_id Optional. Post ID. Default is ID of the global $post.\n * @return array|null Meta field values.\n */\nfunction get_post_custom_values( $key = '', $post_id = 0 ) {\n\tif ( ! $key ) {\n\t\treturn null;\n\t}\n\n\t$custom = get_post_custom( $post_id );\n\n\treturn isset( $custom[ $key ] ) ? $custom[ $key ] : null;\n}\n\n/**\n * Determines whether a post is sticky.\n *\n * Sticky posts should remain at the top of The Loop. If the post ID is not\n * given, then The Loop ID for the current post will be used.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.7.0\n *\n * @param int $post_id Optional. Post ID. Default is ID of the global $post.\n * @return bool Whether post is sticky.\n */\nfunction is_sticky( $post_id = 0 ) {\n\t$post_id = absint( $post_id );\n\n\tif ( ! $post_id ) {\n\t\t$post_id = get_the_ID();\n\t}\n\n\t$stickies = get_option( 'sticky_posts' );\n\n\tif ( is_array( $stickies ) ) {\n\t\t$stickies  = array_map( 'intval', $stickies );\n\t\t$is_sticky = in_array( $post_id, $stickies, true );\n\t} else {\n\t\t$is_sticky = false;\n\t}\n\n\t/**\n\t * Filters whether a post is sticky.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param bool $is_sticky Whether a post is sticky.\n\t * @param int  $post_id   Post ID.\n\t */\n\treturn apply_filters( 'is_sticky', $is_sticky, $post_id );\n}\n\n/**\n * Sanitize every post field.\n *\n * If the context is 'raw', then the post object or array will get minimal\n * sanitization of the integer fields.\n *\n * @since 2.3.0\n *\n * @see sanitize_post_field()\n *\n * @param object|WP_Post|array $post    The Post Object or Array\n * @param string               $context Optional. How to sanitize post fields.\n *                                      Accepts 'raw', 'edit', 'db', or 'display'.\n *                                      Default 'display'.\n * @return object|WP_Post|array The now sanitized Post Object or Array (will be the\n *                              same type as $post).\n */\nfunction sanitize_post( $post, $context = 'display' ) {\n\tif ( is_object( $post ) ) {\n\t\t// Check if post already filtered for this context.\n\t\tif ( isset( $post->filter ) && $context == $post->filter ) {\n\t\t\treturn $post;\n\t\t}\n\t\tif ( ! isset( $post->ID ) ) {\n\t\t\t$post->ID = 0;\n\t\t}\n\t\tforeach ( array_keys( get_object_vars( $post ) ) as $field ) {\n\t\t\t$post->$field = sanitize_post_field( $field, $post->$field, $post->ID, $context );\n\t\t}\n\t\t$post->filter = $context;\n\t} elseif ( is_array( $post ) ) {\n\t\t// Check if post already filtered for this context.\n\t\tif ( isset( $post['filter'] ) && $context == $post['filter'] ) {\n\t\t\treturn $post;\n\t\t}\n\t\tif ( ! isset( $post['ID'] ) ) {\n\t\t\t$post['ID'] = 0;\n\t\t}\n\t\tforeach ( array_keys( $post ) as $field ) {\n\t\t\t$post[ $field ] = sanitize_post_field( $field, $post[ $field ], $post['ID'], $context );\n\t\t}\n\t\t$post['filter'] = $context;\n\t}\n\treturn $post;\n}\n\n/**\n * Sanitizes a post field based on context.\n *\n * Possible context values are:  'raw', 'edit', 'db', 'display', 'attribute' and\n * 'js'. The 'display' context is used by default. 'attribute' and 'js' contexts\n * are treated like 'display' when calling filters.\n *\n * @since 2.3.0\n * @since 4.4.0 Like `sanitize_post()`, `$context` defaults to 'display'.\n *\n * @param string $field   The Post Object field name.\n * @param mixed  $value   The Post Object value.\n * @param int    $post_id Post ID.\n * @param string $context Optional. How to sanitize the field. Possible values are 'raw', 'edit',\n *                        'db', 'display', 'attribute' and 'js'. Default 'display'.\n * @return mixed Sanitized value.\n */\nfunction sanitize_post_field( $field, $value, $post_id, $context = 'display' ) {\n\t$int_fields = array( 'ID', 'post_parent', 'menu_order' );\n\tif ( in_array( $field, $int_fields, true ) ) {\n\t\t$value = (int) $value;\n\t}\n\n\t// Fields which contain arrays of integers.\n\t$array_int_fields = array( 'ancestors' );\n\tif ( in_array( $field, $array_int_fields, true ) ) {\n\t\t$value = array_map( 'absint', $value );\n\t\treturn $value;\n\t}\n\n\tif ( 'raw' === $context ) {\n\t\treturn $value;\n\t}\n\n\t$prefixed = false;\n\tif ( false !== strpos( $field, 'post_' ) ) {\n\t\t$prefixed        = true;\n\t\t$field_no_prefix = str_replace( 'post_', '', $field );\n\t}\n\n\tif ( 'edit' === $context ) {\n\t\t$format_to_edit = array( 'post_content', 'post_excerpt', 'post_title', 'post_password' );\n\n\t\tif ( $prefixed ) {\n\n\t\t\t/**\n\t\t\t * Filters the value of a specific post field to edit.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$field`, refers to the post\n\t\t\t * field name.\n\t\t\t *\n\t\t\t * @since 2.3.0\n\t\t\t *\n\t\t\t * @param mixed $value   Value of the post field.\n\t\t\t * @param int   $post_id Post ID.\n\t\t\t */\n\t\t\t$value = apply_filters( \"edit_{$field}\", $value, $post_id );\n\n\t\t\t/**\n\t\t\t * Filters the value of a specific post field to edit.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$field_no_prefix`, refers to\n\t\t\t * the post field name.\n\t\t\t *\n\t\t\t * @since 2.3.0\n\t\t\t *\n\t\t\t * @param mixed $value   Value of the post field.\n\t\t\t * @param int   $post_id Post ID.\n\t\t\t */\n\t\t\t$value = apply_filters( \"{$field_no_prefix}_edit_pre\", $value, $post_id );\n\t\t} else {\n\t\t\t$value = apply_filters( \"edit_post_{$field}\", $value, $post_id );\n\t\t}\n\n\t\tif ( in_array( $field, $format_to_edit, true ) ) {\n\t\t\tif ( 'post_content' === $field ) {\n\t\t\t\t$value = format_to_edit( $value, user_can_richedit() );\n\t\t\t} else {\n\t\t\t\t$value = format_to_edit( $value );\n\t\t\t}\n\t\t} else {\n\t\t\t$value = esc_attr( $value );\n\t\t}\n\t} elseif ( 'db' === $context ) {\n\t\tif ( $prefixed ) {\n\n\t\t\t/**\n\t\t\t * Filters the value of a specific post field before saving.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$field`, refers to the post\n\t\t\t * field name.\n\t\t\t *\n\t\t\t * @since 2.3.0\n\t\t\t *\n\t\t\t * @param mixed $value Value of the post field.\n\t\t\t */\n\t\t\t$value = apply_filters( \"pre_{$field}\", $value );\n\n\t\t\t/**\n\t\t\t * Filters the value of a specific field before saving.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$field_no_prefix`, refers\n\t\t\t * to the post field name.\n\t\t\t *\n\t\t\t * @since 2.3.0\n\t\t\t *\n\t\t\t * @param mixed $value Value of the post field.\n\t\t\t */\n\t\t\t$value = apply_filters( \"{$field_no_prefix}_save_pre\", $value );\n\t\t} else {\n\t\t\t$value = apply_filters( \"pre_post_{$field}\", $value );\n\n\t\t\t/**\n\t\t\t * Filters the value of a specific post field before saving.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$field`, refers to the post\n\t\t\t * field name.\n\t\t\t *\n\t\t\t * @since 2.3.0\n\t\t\t *\n\t\t\t * @param mixed $value Value of the post field.\n\t\t\t */\n\t\t\t$value = apply_filters( \"{$field}_pre\", $value );\n\t\t}\n\t} else {\n\n\t\t// Use display filters by default.\n\t\tif ( $prefixed ) {\n\n\t\t\t/**\n\t\t\t * Filters the value of a specific post field for display.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$field`, refers to the post\n\t\t\t * field name.\n\t\t\t *\n\t\t\t * @since 2.3.0\n\t\t\t *\n\t\t\t * @param mixed  $value   Value of the prefixed post field.\n\t\t\t * @param int    $post_id Post ID.\n\t\t\t * @param string $context Context for how to sanitize the field. Possible\n\t\t\t *                        values include 'edit', 'display',\n\t\t\t *                        'attribute' and 'js'.\n\t\t\t */\n\t\t\t$value = apply_filters( \"{$field}\", $value, $post_id, $context );\n\t\t} else {\n\t\t\t$value = apply_filters( \"post_{$field}\", $value, $post_id, $context );\n\t\t}\n\n\t\tif ( 'attribute' === $context ) {\n\t\t\t$value = esc_attr( $value );\n\t\t} elseif ( 'js' === $context ) {\n\t\t\t$value = esc_js( $value );\n\t\t}\n\t}\n\n\treturn $value;\n}\n\n/**\n * Make a post sticky.\n *\n * Sticky posts should be displayed at the top of the front page.\n *\n * @since 2.7.0\n *\n * @param int $post_id Post ID.\n */\nfunction stick_post( $post_id ) {\n\t$post_id  = (int) $post_id;\n\t$stickies = get_option( 'sticky_posts' );\n\n\tif ( ! is_array( $stickies ) ) {\n\t\t$stickies = array();\n\t}\n\n\t$stickies = array_map( 'intval', $stickies );\n\n\tif ( ! in_array( $post_id, $stickies, true ) ) {\n\t\t$stickies[] = $post_id;\n\t}\n\n\t$updated = update_option( 'sticky_posts', $stickies );\n\n\tif ( $updated ) {\n\t\t/**\n\t\t * Fires once a post has been added to the sticky list.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param int $post_id ID of the post that was stuck.\n\t\t */\n\t\tdo_action( 'post_stuck', $post_id );\n\t}\n}\n\n/**\n * Un-stick a post.\n *\n * Sticky posts should be displayed at the top of the front page.\n *\n * @since 2.7.0\n *\n * @param int $post_id Post ID.\n */\nfunction unstick_post( $post_id ) {\n\t$post_id  = (int) $post_id;\n\t$stickies = get_option( 'sticky_posts' );\n\n\tif ( ! is_array( $stickies ) ) {\n\t\treturn;\n\t}\n\n\t$stickies = array_map( 'intval', $stickies );\n\n\tif ( ! in_array( $post_id, $stickies, true ) ) {\n\t\treturn;\n\t}\n\n\t$offset = array_search( $post_id, $stickies, true );\n\tif ( false === $offset ) {\n\t\treturn;\n\t}\n\n\tarray_splice( $stickies, $offset, 1 );\n\n\t$updated = update_option( 'sticky_posts', $stickies );\n\n\tif ( $updated ) {\n\t\t/**\n\t\t * Fires once a post has been removed from the sticky list.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param int $post_id ID of the post that was unstuck.\n\t\t */\n\t\tdo_action( 'post_unstuck', $post_id );\n\t}\n}\n\n/**\n * Return the cache key for wp_count_posts() based on the passed arguments.\n *\n * @since 3.9.0\n * @access private\n *\n * @param string $type Optional. Post type to retrieve count Default 'post'.\n * @param string $perm Optional. 'readable' or empty. Default empty.\n * @return string The cache key.\n */\nfunction _count_posts_cache_key( $type = 'post', $perm = '' ) {\n\t$cache_key = 'posts-' . $type;\n\n\tif ( 'readable' === $perm && is_user_logged_in() ) {\n\t\t$post_type_object = get_post_type_object( $type );\n\n\t\tif ( $post_type_object && ! current_user_can( $post_type_object->cap->read_private_posts ) ) {\n\t\t\t$cache_key .= '_' . $perm . '_' . get_current_user_id();\n\t\t}\n\t}\n\n\treturn $cache_key;\n}\n\n/**\n * Count number of posts of a post type and if user has permissions to view.\n *\n * This function provides an efficient method of finding the amount of post's\n * type a blog has. Another method is to count the amount of items in\n * get_posts(), but that method has a lot of overhead with doing so. Therefore,\n * when developing for 2.5+, use this function instead.\n *\n * The $perm parameter checks for 'readable' value and if the user can read\n * private posts, it will display that for the user that is signed in.\n *\n * @since 2.5.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $type Optional. Post type to retrieve count. Default 'post'.\n * @param string $perm Optional. 'readable' or empty. Default empty.\n * @return object Number of posts for each status.\n */\nfunction wp_count_posts( $type = 'post', $perm = '' ) {\n\tglobal $wpdb;\n\n\tif ( ! post_type_exists( $type ) ) {\n\t\treturn new stdClass;\n\t}\n\n\t$cache_key = _count_posts_cache_key( $type, $perm );\n\n\t$counts = wp_cache_get( $cache_key, 'counts' );\n\tif ( false !== $counts ) {\n\t\t// We may have cached this before every status was registered.\n\t\tforeach ( get_post_stati() as $status ) {\n\t\t\tif ( ! isset( $counts->{$status} ) ) {\n\t\t\t\t$counts->{$status} = 0;\n\t\t\t}\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/post.php */\n\t\treturn apply_filters( 'wp_count_posts', $counts, $type, $perm );\n\t}\n\n\t$query = \"SELECT post_status, COUNT( * ) AS num_posts FROM {$wpdb->posts} WHERE post_type = %s\";\n\n\tif ( 'readable' === $perm && is_user_logged_in() ) {\n\t\t$post_type_object = get_post_type_object( $type );\n\t\tif ( ! current_user_can( $post_type_object->cap->read_private_posts ) ) {\n\t\t\t$query .= $wpdb->prepare(\n\t\t\t\t\" AND (post_status != 'private' OR ( post_author = %d AND post_status = 'private' ))\",\n\t\t\t\tget_current_user_id()\n\t\t\t);\n\t\t}\n\t}\n\n\t$query .= ' GROUP BY post_status';\n\n\t$results = (array) $wpdb->get_results( $wpdb->prepare( $query, $type ), ARRAY_A );\n\t$counts  = array_fill_keys( get_post_stati(), 0 );\n\n\tforeach ( $results as $row ) {\n\t\t$counts[ $row['post_status'] ] = $row['num_posts'];\n\t}\n\n\t$counts = (object) $counts;\n\twp_cache_set( $cache_key, $counts, 'counts' );\n\n\t/**\n\t * Modify returned post counts by status for the current post type.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param object $counts An object containing the current post_type's post\n\t *                       counts by status.\n\t * @param string $type   Post type.\n\t * @param string $perm   The permission to determine if the posts are 'readable'\n\t *                       by the current user.\n\t */\n\treturn apply_filters( 'wp_count_posts', $counts, $type, $perm );\n}\n\n/**\n * Count number of attachments for the mime type(s).\n *\n * If you set the optional mime_type parameter, then an array will still be\n * returned, but will only have the item you are looking for. It does not give\n * you the number of attachments that are children of a post. You can get that\n * by counting the number of children that post has.\n *\n * @since 2.5.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string|array $mime_type Optional. Array or comma-separated list of\n *                                MIME patterns. Default empty.\n * @return object An object containing the attachment counts by mime type.\n */\nfunction wp_count_attachments( $mime_type = '' ) {\n\tglobal $wpdb;\n\n\t$and   = wp_post_mime_type_where( $mime_type );\n\t$count = $wpdb->get_results( \"SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' $and GROUP BY post_mime_type\", ARRAY_A );\n\n\t$counts = array();\n\tforeach ( (array) $count as $row ) {\n\t\t$counts[ $row['post_mime_type'] ] = $row['num_posts'];\n\t}\n\t$counts['trash'] = $wpdb->get_var( \"SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status = 'trash' $and\" );\n\n\t/**\n\t * Modify returned attachment counts by mime type.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param object $counts    An object containing the attachment counts by\n\t *                          mime type.\n\t * @param string $mime_type The mime type pattern used to filter the attachments\n\t *                          counted.\n\t */\n\treturn apply_filters( 'wp_count_attachments', (object) $counts, $mime_type );\n}\n\n/**\n * Get default post mime types.\n *\n * @since 2.9.0\n * @since 5.3.0 Added the 'Documents', 'Spreadsheets', and 'Archives' mime type groups.\n *\n * @return array List of post mime types.\n */\nfunction get_post_mime_types() {\n\t$post_mime_types = array(   // array( adj, noun )\n\t\t'image'       => array(\n\t\t\t__( 'Images' ),\n\t\t\t__( 'Manage Images' ),\n\t\t\t/* translators: %s: Number of images. */\n\t\t\t_n_noop(\n\t\t\t\t'Image <span class=\"count\">(%s)</span>',\n\t\t\t\t'Images <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t),\n\t\t'audio'       => array(\n\t\t\t__( 'Audio' ),\n\t\t\t__( 'Manage Audio' ),\n\t\t\t/* translators: %s: Number of audio files. */\n\t\t\t_n_noop(\n\t\t\t\t'Audio <span class=\"count\">(%s)</span>',\n\t\t\t\t'Audio <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t),\n\t\t'video'       => array(\n\t\t\t__( 'Video' ),\n\t\t\t__( 'Manage Video' ),\n\t\t\t/* translators: %s: Number of video files. */\n\t\t\t_n_noop(\n\t\t\t\t'Video <span class=\"count\">(%s)</span>',\n\t\t\t\t'Video <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t),\n\t\t'document'    => array(\n\t\t\t__( 'Documents' ),\n\t\t\t__( 'Manage Documents' ),\n\t\t\t/* translators: %s: Number of documents. */\n\t\t\t_n_noop(\n\t\t\t\t'Document <span class=\"count\">(%s)</span>',\n\t\t\t\t'Documents <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t),\n\t\t'spreadsheet' => array(\n\t\t\t__( 'Spreadsheets' ),\n\t\t\t__( 'Manage Spreadsheets' ),\n\t\t\t/* translators: %s: Number of spreadsheets. */\n\t\t\t_n_noop(\n\t\t\t\t'Spreadsheet <span class=\"count\">(%s)</span>',\n\t\t\t\t'Spreadsheets <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t),\n\t\t'archive'     => array(\n\t\t\t_x( 'Archives', 'file type group' ),\n\t\t\t__( 'Manage Archives' ),\n\t\t\t/* translators: %s: Number of archives. */\n\t\t\t_n_noop(\n\t\t\t\t'Archive <span class=\"count\">(%s)</span>',\n\t\t\t\t'Archives <span class=\"count\">(%s)</span>'\n\t\t\t),\n\t\t),\n\t);\n\n\t$ext_types  = wp_get_ext_types();\n\t$mime_types = wp_get_mime_types();\n\n\tforeach ( $post_mime_types as $group => $labels ) {\n\t\tif ( in_array( $group, array( 'image', 'audio', 'video' ), true ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( ! isset( $ext_types[ $group ] ) ) {\n\t\t\tunset( $post_mime_types[ $group ] );\n\t\t\tcontinue;\n\t\t}\n\n\t\t$group_mime_types = array();\n\t\tforeach ( $ext_types[ $group ] as $extension ) {\n\t\t\tforeach ( $mime_types as $exts => $mime ) {\n\t\t\t\tif ( preg_match( '!^(' . $exts . ')$!i', $extension ) ) {\n\t\t\t\t\t$group_mime_types[] = $mime;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$group_mime_types = implode( ',', array_unique( $group_mime_types ) );\n\n\t\t$post_mime_types[ $group_mime_types ] = $labels;\n\t\tunset( $post_mime_types[ $group ] );\n\t}\n\n\t/**\n\t * Filters the default list of post mime types.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param array $post_mime_types Default list of post mime types.\n\t */\n\treturn apply_filters( 'post_mime_types', $post_mime_types );\n}\n\n/**\n * Check a MIME-Type against a list.\n *\n * If the wildcard_mime_types parameter is a string, it must be comma separated\n * list. If the real_mime_types is a string, it is also comma separated to\n * create the list.\n *\n * @since 2.5.0\n *\n * @param string|array $wildcard_mime_types Mime types, e.g. audio/mpeg or image (same as image/*)\n *                                          or flash (same as *flash*).\n * @param string|array $real_mime_types     Real post mime type values.\n * @return array array(wildcard=>array(real types)).\n */\nfunction wp_match_mime_types( $wildcard_mime_types, $real_mime_types ) {\n\t$matches = array();\n\tif ( is_string( $wildcard_mime_types ) ) {\n\t\t$wildcard_mime_types = array_map( 'trim', explode( ',', $wildcard_mime_types ) );\n\t}\n\tif ( is_string( $real_mime_types ) ) {\n\t\t$real_mime_types = array_map( 'trim', explode( ',', $real_mime_types ) );\n\t}\n\n\t$patternses = array();\n\t$wild       = '[-._a-z0-9]*';\n\n\tforeach ( (array) $wildcard_mime_types as $type ) {\n\t\t$mimes = array_map( 'trim', explode( ',', $type ) );\n\t\tforeach ( $mimes as $mime ) {\n\t\t\t$regex = str_replace( '__wildcard__', $wild, preg_quote( str_replace( '*', '__wildcard__', $mime ) ) );\n\n\t\t\t$patternses[][ $type ] = \"^$regex$\";\n\n\t\t\tif ( false === strpos( $mime, '/' ) ) {\n\t\t\t\t$patternses[][ $type ] = \"^$regex/\";\n\t\t\t\t$patternses[][ $type ] = $regex;\n\t\t\t}\n\t\t}\n\t}\n\tasort( $patternses );\n\n\tforeach ( $patternses as $patterns ) {\n\t\tforeach ( $patterns as $type => $pattern ) {\n\t\t\tforeach ( (array) $real_mime_types as $real ) {\n\t\t\t\tif ( preg_match( \"#$pattern#\", $real )\n\t\t\t\t\t&& ( empty( $matches[ $type ] ) || false === array_search( $real, $matches[ $type ], true ) )\n\t\t\t\t) {\n\t\t\t\t\t$matches[ $type ][] = $real;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $matches;\n}\n\n/**\n * Convert MIME types into SQL.\n *\n * @since 2.5.0\n *\n * @param string|array $post_mime_types List of mime types or comma separated string\n *                                      of mime types.\n * @param string       $table_alias     Optional. Specify a table alias, if needed.\n *                                      Default empty.\n * @return string The SQL AND clause for mime searching.\n */\nfunction wp_post_mime_type_where( $post_mime_types, $table_alias = '' ) {\n\t$where     = '';\n\t$wildcards = array( '', '%', '%/%' );\n\tif ( is_string( $post_mime_types ) ) {\n\t\t$post_mime_types = array_map( 'trim', explode( ',', $post_mime_types ) );\n\t}\n\n\t$wheres = array();\n\n\tforeach ( (array) $post_mime_types as $mime_type ) {\n\t\t$mime_type = preg_replace( '/\\s/', '', $mime_type );\n\t\t$slashpos  = strpos( $mime_type, '/' );\n\t\tif ( false !== $slashpos ) {\n\t\t\t$mime_group    = preg_replace( '/[^-*.a-zA-Z0-9]/', '', substr( $mime_type, 0, $slashpos ) );\n\t\t\t$mime_subgroup = preg_replace( '/[^-*.+a-zA-Z0-9]/', '', substr( $mime_type, $slashpos + 1 ) );\n\t\t\tif ( empty( $mime_subgroup ) ) {\n\t\t\t\t$mime_subgroup = '*';\n\t\t\t} else {\n\t\t\t\t$mime_subgroup = str_replace( '/', '', $mime_subgroup );\n\t\t\t}\n\t\t\t$mime_pattern = \"$mime_group/$mime_subgroup\";\n\t\t} else {\n\t\t\t$mime_pattern = preg_replace( '/[^-*.a-zA-Z0-9]/', '', $mime_type );\n\t\t\tif ( false === strpos( $mime_pattern, '*' ) ) {\n\t\t\t\t$mime_pattern .= '/*';\n\t\t\t}\n\t\t}\n\n\t\t$mime_pattern = preg_replace( '/\\*+/', '%', $mime_pattern );\n\n\t\tif ( in_array( $mime_type, $wildcards, true ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif ( false !== strpos( $mime_pattern, '%' ) ) {\n\t\t\t$wheres[] = empty( $table_alias ) ? \"post_mime_type LIKE '$mime_pattern'\" : \"$table_alias.post_mime_type LIKE '$mime_pattern'\";\n\t\t} else {\n\t\t\t$wheres[] = empty( $table_alias ) ? \"post_mime_type = '$mime_pattern'\" : \"$table_alias.post_mime_type = '$mime_pattern'\";\n\t\t}\n\t}\n\n\tif ( ! empty( $wheres ) ) {\n\t\t$where = ' AND (' . join( ' OR ', $wheres ) . ') ';\n\t}\n\n\treturn $where;\n}\n\n/**\n * Trash or delete a post or page.\n *\n * When the post and page is permanently deleted, everything that is tied to\n * it is deleted also. This includes comments, post meta fields, and terms\n * associated with the post.\n *\n * The post or page is moved to Trash instead of permanently deleted unless\n * Trash is disabled, item is already in the Trash, or $force_delete is true.\n *\n * @since 1.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n * @see wp_delete_attachment()\n * @see wp_trash_post()\n *\n * @param int  $postid       Optional. Post ID. Default 0.\n * @param bool $force_delete Optional. Whether to bypass Trash and force deletion.\n *                           Default false.\n * @return WP_Post|false|null Post data on success, false or null on failure.\n */\nfunction wp_delete_post( $postid = 0, $force_delete = false ) {\n\tglobal $wpdb;\n\n\t$post = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $wpdb->posts WHERE ID = %d\", $postid ) );\n\n\tif ( ! $post ) {\n\t\treturn $post;\n\t}\n\n\t$post = get_post( $post );\n\n\tif ( ! $force_delete && ( 'post' === $post->post_type || 'page' === $post->post_type ) && 'trash' !== get_post_status( $postid ) && EMPTY_TRASH_DAYS ) {\n\t\treturn wp_trash_post( $postid );\n\t}\n\n\tif ( 'attachment' === $post->post_type ) {\n\t\treturn wp_delete_attachment( $postid, $force_delete );\n\t}\n\n\t/**\n\t * Filters whether a post deletion should take place.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param bool|null $delete       Whether to go forward with deletion.\n\t * @param WP_Post   $post         Post object.\n\t * @param bool      $force_delete Whether to bypass the Trash.\n\t */\n\t$check = apply_filters( 'pre_delete_post', null, $post, $force_delete );\n\tif ( null !== $check ) {\n\t\treturn $check;\n\t}\n\n\t/**\n\t * Fires before a post is deleted, at the start of wp_delete_post().\n\t *\n\t * @since 3.2.0\n\t * @since 5.5.0 Added the `$post` parameter.\n\t *\n\t * @see wp_delete_post()\n\t *\n\t * @param int     $postid Post ID.\n\t * @param WP_Post $post   Post object.\n\t */\n\tdo_action( 'before_delete_post', $postid, $post );\n\n\tdelete_post_meta( $postid, '_wp_trash_meta_status' );\n\tdelete_post_meta( $postid, '_wp_trash_meta_time' );\n\n\twp_delete_object_term_relationships( $postid, get_object_taxonomies( $post->post_type ) );\n\n\t$parent_data  = array( 'post_parent' => $post->post_parent );\n\t$parent_where = array( 'post_parent' => $postid );\n\n\tif ( is_post_type_hierarchical( $post->post_type ) ) {\n\t\t// Point children of this page to its parent, also clean the cache of affected children.\n\t\t$children_query = $wpdb->prepare( \"SELECT * FROM $wpdb->posts WHERE post_parent = %d AND post_type = %s\", $postid, $post->post_type );\n\t\t$children       = $wpdb->get_results( $children_query );\n\t\tif ( $children ) {\n\t\t\t$wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => $post->post_type ) );\n\t\t}\n\t}\n\n\t// Do raw query. wp_get_post_revisions() is filtered.\n\t$revision_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'revision'\", $postid ) );\n\t// Use wp_delete_post (via wp_delete_post_revision) again. Ensures any meta/misplaced data gets cleaned up.\n\tforeach ( $revision_ids as $revision_id ) {\n\t\twp_delete_post_revision( $revision_id );\n\t}\n\n\t// Point all attachments to this post up one level.\n\t$wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => 'attachment' ) );\n\n\twp_defer_comment_counting( true );\n\n\t$comment_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d\", $postid ) );\n\tforeach ( $comment_ids as $comment_id ) {\n\t\twp_delete_comment( $comment_id, true );\n\t}\n\n\twp_defer_comment_counting( false );\n\n\t$post_meta_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d \", $postid ) );\n\tforeach ( $post_meta_ids as $mid ) {\n\t\tdelete_metadata_by_mid( 'post', $mid );\n\t}\n\n\t/**\n\t * Fires immediately before a post is deleted from the database.\n\t *\n\t * @since 1.2.0\n\t * @since 5.5.0 Added the `$post` parameter.\n\t *\n\t * @param int     $postid Post ID.\n\t * @param WP_Post $post   Post object.\n\t */\n\tdo_action( 'delete_post', $postid, $post );\n\n\t$result = $wpdb->delete( $wpdb->posts, array( 'ID' => $postid ) );\n\tif ( ! $result ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Fires immediately after a post is deleted from the database.\n\t *\n\t * @since 2.2.0\n\t * @since 5.5.0 Added the `$post` parameter.\n\t *\n\t * @param int     $postid Post ID.\n\t * @param WP_Post $post   Post object.\n\t */\n\tdo_action( 'deleted_post', $postid, $post );\n\n\tclean_post_cache( $post );\n\n\tif ( is_post_type_hierarchical( $post->post_type ) && $children ) {\n\t\tforeach ( $children as $child ) {\n\t\t\tclean_post_cache( $child );\n\t\t}\n\t}\n\n\twp_clear_scheduled_hook( 'publish_future_post', array( $postid ) );\n\n\t/**\n\t * Fires after a post is deleted, at the conclusion of wp_delete_post().\n\t *\n\t * @since 3.2.0\n\t * @since 5.5.0 Added the `$post` parameter.\n\t *\n\t * @see wp_delete_post()\n\t *\n\t * @param int     $postid Post ID.\n\t * @param WP_Post $post   Post object.\n\t */\n\tdo_action( 'after_delete_post', $postid, $post );\n\n\treturn $post;\n}\n\n/**\n * Reset the page_on_front, show_on_front, and page_for_post settings when\n * a linked page is deleted or trashed.\n *\n * Also ensures the post is no longer sticky.\n *\n * @since 3.7.0\n * @access private\n *\n * @param int $post_id Post ID.\n */\nfunction _reset_front_page_settings_for_post( $post_id ) {\n\t$post = get_post( $post_id );\n\n\tif ( 'page' === $post->post_type ) {\n\t\t/*\n\t\t * If the page is defined in option page_on_front or post_for_posts,\n\t\t * adjust the corresponding options.\n\t\t */\n\t\tif ( get_option( 'page_on_front' ) == $post->ID ) {\n\t\t\tupdate_option( 'show_on_front', 'posts' );\n\t\t\tupdate_option( 'page_on_front', 0 );\n\t\t}\n\t\tif ( get_option( 'page_for_posts' ) == $post->ID ) {\n\t\t\tupdate_option( 'page_for_posts', 0 );\n\t\t}\n\t}\n\n\tunstick_post( $post->ID );\n}\n\n/**\n * Move a post or page to the Trash\n *\n * If Trash is disabled, the post or page is permanently deleted.\n *\n * @since 2.9.0\n *\n * @see wp_delete_post()\n *\n * @param int $post_id Optional. Post ID. Default is ID of the global $post\n *                     if EMPTY_TRASH_DAYS equals true.\n * @return WP_Post|false|null Post data on success, false or null on failure.\n */\nfunction wp_trash_post( $post_id = 0 ) {\n\tif ( ! EMPTY_TRASH_DAYS ) {\n\t\treturn wp_delete_post( $post_id, true );\n\t}\n\n\t$post = get_post( $post_id );\n\n\tif ( ! $post ) {\n\t\treturn $post;\n\t}\n\n\tif ( 'trash' === $post->post_status ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Filters whether a post trashing should take place.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param bool|null $trash Whether to go forward with trashing.\n\t * @param WP_Post   $post  Post object.\n\t */\n\t$check = apply_filters( 'pre_trash_post', null, $post );\n\tif ( null !== $check ) {\n\t\treturn $check;\n\t}\n\n\t/**\n\t * Fires before a post is sent to the Trash.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param int $post_id Post ID.\n\t */\n\tdo_action( 'wp_trash_post', $post_id );\n\n\tadd_post_meta( $post_id, '_wp_trash_meta_status', $post->post_status );\n\tadd_post_meta( $post_id, '_wp_trash_meta_time', time() );\n\n\t$post_updated = wp_update_post(\n\t\tarray(\n\t\t\t'ID'          => $post_id,\n\t\t\t'post_status' => 'trash',\n\t\t)\n\t);\n\n\tif ( ! $post_updated ) {\n\t\treturn false;\n\t}\n\n\twp_trash_post_comments( $post_id );\n\n\t/**\n\t * Fires after a post is sent to the Trash.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param int $post_id Post ID.\n\t */\n\tdo_action( 'trashed_post', $post_id );\n\n\treturn $post;\n}\n\n/**\n * Restore a post or page from the Trash.\n *\n * @since 2.9.0\n *\n * @param int $post_id Optional. Post ID. Default is ID of the global $post.\n * @return WP_Post|false|null Post data on success, false or null on failure.\n */\nfunction wp_untrash_post( $post_id = 0 ) {\n\t$post = get_post( $post_id );\n\n\tif ( ! $post ) {\n\t\treturn $post;\n\t}\n\n\tif ( 'trash' !== $post->post_status ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Filters whether a post untrashing should take place.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param bool|null $untrash Whether to go forward with untrashing.\n\t * @param WP_Post   $post    Post object.\n\t */\n\t$check = apply_filters( 'pre_untrash_post', null, $post );\n\tif ( null !== $check ) {\n\t\treturn $check;\n\t}\n\n\t/**\n\t * Fires before a post is restored from the Trash.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param int $post_id Post ID.\n\t */\n\tdo_action( 'untrash_post', $post_id );\n\n\t$post_status = get_post_meta( $post_id, '_wp_trash_meta_status', true );\n\n\tdelete_post_meta( $post_id, '_wp_trash_meta_status' );\n\tdelete_post_meta( $post_id, '_wp_trash_meta_time' );\n\n\t$post_updated = wp_update_post(\n\t\tarray(\n\t\t\t'ID'          => $post_id,\n\t\t\t'post_status' => $post_status,\n\t\t)\n\t);\n\n\tif ( ! $post_updated ) {\n\t\treturn false;\n\t}\n\n\twp_untrash_post_comments( $post_id );\n\n\t/**\n\t * Fires after a post is restored from the Trash.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param int $post_id Post ID.\n\t */\n\tdo_action( 'untrashed_post', $post_id );\n\n\treturn $post;\n}\n\n/**\n * Moves comments for a post to the Trash.\n *\n * @since 2.9.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int|WP_Post|null $post Optional. Post ID or post object. Defaults to global $post.\n * @return mixed|void False on failure.\n */\nfunction wp_trash_post_comments( $post = null ) {\n\tglobal $wpdb;\n\n\t$post = get_post( $post );\n\tif ( empty( $post ) ) {\n\t\treturn;\n\t}\n\n\t$post_id = $post->ID;\n\n\t/**\n\t * Fires before comments are sent to the Trash.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param int $post_id Post ID.\n\t */\n\tdo_action( 'trash_post_comments', $post_id );\n\n\t$comments = $wpdb->get_results( $wpdb->prepare( \"SELECT comment_ID, comment_approved FROM $wpdb->comments WHERE comment_post_ID = %d\", $post_id ) );\n\tif ( empty( $comments ) ) {\n\t\treturn;\n\t}\n\n\t// Cache current status for each comment.\n\t$statuses = array();\n\tforeach ( $comments as $comment ) {\n\t\t$statuses[ $comment->comment_ID ] = $comment->comment_approved;\n\t}\n\tadd_post_meta( $post_id, '_wp_trash_meta_comments_status', $statuses );\n\n\t// Set status for all comments to post-trashed.\n\t$result = $wpdb->update( $wpdb->comments, array( 'comment_approved' => 'post-trashed' ), array( 'comment_post_ID' => $post_id ) );\n\n\tclean_comment_cache( array_keys( $statuses ) );\n\n\t/**\n\t * Fires after comments are sent to the Trash.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param int   $post_id  Post ID.\n\t * @param array $statuses Array of comment statuses.\n\t */\n\tdo_action( 'trashed_post_comments', $post_id, $statuses );\n\n\treturn $result;\n}\n\n/**\n * Restore comments for a post from the Trash.\n *\n * @since 2.9.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int|WP_Post|null $post Optional. Post ID or post object. Defaults to global $post.\n * @return true|void\n */\nfunction wp_untrash_post_comments( $post = null ) {\n\tglobal $wpdb;\n\n\t$post = get_post( $post );\n\tif ( empty( $post ) ) {\n\t\treturn;\n\t}\n\n\t$post_id = $post->ID;\n\n\t$statuses = get_post_meta( $post_id, '_wp_trash_meta_comments_status', true );\n\n\tif ( empty( $statuses ) ) {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Fires before comments are restored for a post from the Trash.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param int $post_id Post ID.\n\t */\n\tdo_action( 'untrash_post_comments', $post_id );\n\n\t// Restore each comment to its original status.\n\t$group_by_status = array();\n\tforeach ( $statuses as $comment_id => $comment_status ) {\n\t\t$group_by_status[ $comment_status ][] = $comment_id;\n\t}\n\n\tforeach ( $group_by_status as $status => $comments ) {\n\t\t// Sanity check. This shouldn't happen.\n\t\tif ( 'post-trashed' === $status ) {\n\t\t\t$status = '0';\n\t\t}\n\t\t$comments_in = implode( ', ', array_map( 'intval', $comments ) );\n\t\t$wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->comments SET comment_approved = %s WHERE comment_ID IN ($comments_in)\", $status ) );\n\t}\n\n\tclean_comment_cache( array_keys( $statuses ) );\n\n\tdelete_post_meta( $post_id, '_wp_trash_meta_comments_status' );\n\n\t/**\n\t * Fires after comments are restored for a post from the Trash.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param int $post_id Post ID.\n\t */\n\tdo_action( 'untrashed_post_comments', $post_id );\n}\n\n/**\n * Retrieve the list of categories for a post.\n *\n * Compatibility layer for themes and plugins. Also an easy layer of abstraction\n * away from the complexity of the taxonomy layer.\n *\n * @since 2.1.0\n *\n * @see wp_get_object_terms()\n *\n * @param int   $post_id Optional. The Post ID. Does not default to the ID of the\n *                       global $post. Default 0.\n * @param array $args    Optional. Category query parameters. Default empty array.\n *                       See WP_Term_Query::__construct() for supported arguments.\n * @return array|WP_Error List of categories. If the `$fields` argument passed via `$args` is 'all' or\n *                        'all_with_object_id', an array of WP_Term objects will be returned. If `$fields`\n *                        is 'ids', an array of category IDs. If `$fields` is 'names', an array of category names.\n *                        WP_Error object if 'category' taxonomy doesn't exist.\n */\nfunction wp_get_post_categories( $post_id = 0, $args = array() ) {\n\t$post_id = (int) $post_id;\n\n\t$defaults = array( 'fields' => 'ids' );\n\t$args     = wp_parse_args( $args, $defaults );\n\n\t$cats = wp_get_object_terms( $post_id, 'category', $args );\n\treturn $cats;\n}\n\n/**\n * Retrieve the tags for a post.\n *\n * There is only one default for this function, called 'fields' and by default\n * is set to 'all'. There are other defaults that can be overridden in\n * wp_get_object_terms().\n *\n * @since 2.3.0\n *\n * @param int   $post_id Optional. The Post ID. Does not default to the ID of the\n *                       global $post. Default 0.\n * @param array $args    Optional. Tag query parameters. Default empty array.\n *                       See WP_Term_Query::__construct() for supported arguments.\n * @return array|WP_Error Array of WP_Term objects on success or empty array if no tags were found.\n *                        WP_Error object if 'post_tag' taxonomy doesn't exist.\n */\nfunction wp_get_post_tags( $post_id = 0, $args = array() ) {\n\treturn wp_get_post_terms( $post_id, 'post_tag', $args );\n}\n\n/**\n * Retrieves the terms for a post.\n *\n * @since 2.8.0\n *\n * @param int          $post_id  Optional. The Post ID. Does not default to the ID of the\n *                               global $post. Default 0.\n * @param string|array $taxonomy Optional. The taxonomy slug or array of slugs for which\n *                               to retrieve terms. Default 'post_tag'.\n * @param array        $args     {\n *     Optional. Term query parameters. See WP_Term_Query::__construct() for supported arguments.\n *\n *     @type string $fields Term fields to retrieve. Default 'all'.\n * }\n * @return array|WP_Error Array of WP_Term objects on success or empty array if no terms were found.\n *                        WP_Error object if `$taxonomy` doesn't exist.\n */\nfunction wp_get_post_terms( $post_id = 0, $taxonomy = 'post_tag', $args = array() ) {\n\t$post_id = (int) $post_id;\n\n\t$defaults = array( 'fields' => 'all' );\n\t$args     = wp_parse_args( $args, $defaults );\n\n\t$tags = wp_get_object_terms( $post_id, $taxonomy, $args );\n\n\treturn $tags;\n}\n\n/**\n * Retrieve a number of recent posts.\n *\n * @since 1.0.0\n *\n * @see get_posts()\n *\n * @param array  $args   Optional. Arguments to retrieve posts. Default empty array.\n * @param string $output Optional. The required return type. One of OBJECT or ARRAY_A, which\n *                       correspond to a WP_Post object or an associative array, respectively.\n *                       Default ARRAY_A.\n * @return array|false Array of recent posts, where the type of each element is determined\n *                     by the `$output` parameter. Empty array on failure.\n */\nfunction wp_get_recent_posts( $args = array(), $output = ARRAY_A ) {\n\n\tif ( is_numeric( $args ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '3.1.0', __( 'Passing an integer number of posts is deprecated. Pass an array of arguments instead.' ) );\n\t\t$args = array( 'numberposts' => absint( $args ) );\n\t}\n\n\t// Set default arguments.\n\t$defaults = array(\n\t\t'numberposts'      => 10,\n\t\t'offset'           => 0,\n\t\t'category'         => 0,\n\t\t'orderby'          => 'post_date',\n\t\t'order'            => 'DESC',\n\t\t'include'          => '',\n\t\t'exclude'          => '',\n\t\t'meta_key'         => '',\n\t\t'meta_value'       => '',\n\t\t'post_type'        => 'post',\n\t\t'post_status'      => 'draft, publish, future, pending, private',\n\t\t'suppress_filters' => true,\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t$results = get_posts( $parsed_args );\n\n\t// Backward compatibility. Prior to 3.1 expected posts to be returned in array.\n\tif ( ARRAY_A == $output ) {\n\t\tforeach ( $results as $key => $result ) {\n\t\t\t$results[ $key ] = get_object_vars( $result );\n\t\t}\n\t\treturn $results ? $results : array();\n\t}\n\n\treturn $results ? $results : false;\n\n}\n\n/**\n * Insert or update a post.\n *\n * If the $postarr parameter has 'ID' set to a value, then post will be updated.\n *\n * You can set the post date manually, by setting the values for 'post_date'\n * and 'post_date_gmt' keys. You can close the comments or open the comments by\n * setting the value for 'comment_status' key.\n *\n * @since 1.0.0\n * @since 4.2.0 Support was added for encoding emoji in the post title, content, and excerpt.\n * @since 4.4.0 A 'meta_input' array can now be passed to `$postarr` to add post meta data.\n *\n * @see sanitize_post()\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param array $postarr {\n *     An array of elements that make up a post to update or insert.\n *\n *     @type int    $ID                    The post ID. If equal to something other than 0,\n *                                         the post with that ID will be updated. Default 0.\n *     @type int    $post_author           The ID of the user who added the post. Default is\n *                                         the current user ID.\n *     @type string $post_date             The date of the post. Default is the current time.\n *     @type string $post_date_gmt         The date of the post in the GMT timezone. Default is\n *                                         the value of `$post_date`.\n *     @type mixed  $post_content          The post content. Default empty.\n *     @type string $post_content_filtered The filtered post content. Default empty.\n *     @type string $post_title            The post title. Default empty.\n *     @type string $post_excerpt          The post excerpt. Default empty.\n *     @type string $post_status           The post status. Default 'draft'.\n *     @type string $post_type             The post type. Default 'post'.\n *     @type string $comment_status        Whether the post can accept comments. Accepts 'open' or 'closed'.\n *                                         Default is the value of 'default_comment_status' option.\n *     @type string $ping_status           Whether the post can accept pings. Accepts 'open' or 'closed'.\n *                                         Default is the value of 'default_ping_status' option.\n *     @type string $post_password         The password to access the post. Default empty.\n *     @type string $post_name             The post name. Default is the sanitized post title\n *                                         when creating a new post.\n *     @type string $to_ping               Space or carriage return-separated list of URLs to ping.\n *                                         Default empty.\n *     @type string $pinged                Space or carriage return-separated list of URLs that have\n *                                         been pinged. Default empty.\n *     @type string $post_modified         The date when the post was last modified. Default is\n *                                         the current time.\n *     @type string $post_modified_gmt     The date when the post was last modified in the GMT\n *                                         timezone. Default is the current time.\n *     @type int    $post_parent           Set this for the post it belongs to, if any. Default 0.\n *     @type int    $menu_order            The order the post should be displayed in. Default 0.\n *     @type string $post_mime_type        The mime type of the post. Default empty.\n *     @type string $guid                  Global Unique ID for referencing the post. Default empty.\n *     @type array  $post_category         Array of category IDs.\n *                                         Defaults to value of the 'default_category' option.\n *     @type array  $tags_input            Array of tag names, slugs, or IDs. Default empty.\n *     @type array  $tax_input             Array of taxonomy terms keyed by their taxonomy name. Default empty.\n *     @type array  $meta_input            Array of post meta values keyed by their post meta key. Default empty.\n * }\n * @param bool  $wp_error Optional. Whether to return a WP_Error on failure. Default false.\n * @return int|WP_Error The post ID on success. The value 0 or WP_Error on failure.\n */\nfunction wp_insert_post( $postarr, $wp_error = false ) {\n\tglobal $wpdb;\n\n\t// Capture original pre-sanitized array for passing into filters.\n\t$unsanitized_postarr = $postarr;\n\n\t$user_id = get_current_user_id();\n\n\t$defaults = array(\n\t\t'post_author'           => $user_id,\n\t\t'post_content'          => '',\n\t\t'post_content_filtered' => '',\n\t\t'post_title'            => '',\n\t\t'post_excerpt'          => '',\n\t\t'post_status'           => 'draft',\n\t\t'post_type'             => 'post',\n\t\t'comment_status'        => '',\n\t\t'ping_status'           => '',\n\t\t'post_password'         => '',\n\t\t'to_ping'               => '',\n\t\t'pinged'                => '',\n\t\t'post_parent'           => 0,\n\t\t'menu_order'            => 0,\n\t\t'guid'                  => '',\n\t\t'import_id'             => 0,\n\t\t'context'               => '',\n\t);\n\n\t$postarr = wp_parse_args( $postarr, $defaults );\n\n\tunset( $postarr['filter'] );\n\n\t$postarr = sanitize_post( $postarr, 'db' );\n\n\t// Are we updating or creating?\n\t$post_ID = 0;\n\t$update  = false;\n\t$guid    = $postarr['guid'];\n\n\tif ( ! empty( $postarr['ID'] ) ) {\n\t\t$update = true;\n\n\t\t// Get the post ID and GUID.\n\t\t$post_ID     = $postarr['ID'];\n\t\t$post_before = get_post( $post_ID );\n\n\t\tif ( is_null( $post_before ) ) {\n\t\t\tif ( $wp_error ) {\n\t\t\t\treturn new WP_Error( 'invalid_post', __( 'Invalid post ID.' ) );\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t$guid            = get_post_field( 'guid', $post_ID );\n\t\t$previous_status = get_post_field( 'post_status', $post_ID );\n\t} else {\n\t\t$previous_status = 'new';\n\t}\n\n\t$post_type = empty( $postarr['post_type'] ) ? 'post' : $postarr['post_type'];\n\n\t$post_title   = $postarr['post_title'];\n\t$post_content = $postarr['post_content'];\n\t$post_excerpt = $postarr['post_excerpt'];\n\n\tif ( isset( $postarr['post_name'] ) ) {\n\t\t$post_name = $postarr['post_name'];\n\t} elseif ( $update ) {\n\t\t// For an update, don't modify the post_name if it wasn't supplied as an argument.\n\t\t$post_name = $post_before->post_name;\n\t}\n\n\t$maybe_empty = 'attachment' !== $post_type\n\t\t&& ! $post_content && ! $post_title && ! $post_excerpt\n\t\t&& post_type_supports( $post_type, 'editor' )\n\t\t&& post_type_supports( $post_type, 'title' )\n\t\t&& post_type_supports( $post_type, 'excerpt' );\n\n\t/**\n\t * Filters whether the post should be considered \"empty\".\n\t *\n\t * The post is considered \"empty\" if both:\n\t * 1. The post type supports the title, editor, and excerpt fields\n\t * 2. The title, editor, and excerpt fields are all empty\n\t *\n\t * Returning a truthy value from the filter will effectively short-circuit\n\t * the new post being inserted and return 0. If $wp_error is true, a WP_Error\n\t * will be returned instead.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param bool  $maybe_empty Whether the post should be considered \"empty\".\n\t * @param array $postarr     Array of post data.\n\t */\n\tif ( apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) {\n\t\tif ( $wp_error ) {\n\t\t\treturn new WP_Error( 'empty_content', __( 'Content, title, and excerpt are empty.' ) );\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\t$post_status = empty( $postarr['post_status'] ) ? 'draft' : $postarr['post_status'];\n\n\tif ( 'attachment' === $post_type && ! in_array( $post_status, array( 'inherit', 'private', 'trash', 'auto-draft' ), true ) ) {\n\t\t$post_status = 'inherit';\n\t}\n\n\tif ( ! empty( $postarr['post_category'] ) ) {\n\t\t// Filter out empty terms.\n\t\t$post_category = array_filter( $postarr['post_category'] );\n\t}\n\n\t// Make sure we set a valid category.\n\tif ( empty( $post_category ) || 0 === count( $post_category ) || ! is_array( $post_category ) ) {\n\t\t// 'post' requires at least one category.\n\t\tif ( 'post' === $post_type && 'auto-draft' !== $post_status ) {\n\t\t\t$post_category = array( get_option( 'default_category' ) );\n\t\t} else {\n\t\t\t$post_category = array();\n\t\t}\n\t}\n\n\t/*\n\t * Don't allow contributors to set the post slug for pending review posts.\n\t *\n\t * For new posts check the primitive capability, for updates check the meta capability.\n\t */\n\t$post_type_object = get_post_type_object( $post_type );\n\n\tif ( ! $update && 'pending' === $post_status && ! current_user_can( $post_type_object->cap->publish_posts ) ) {\n\t\t$post_name = '';\n\t} elseif ( $update && 'pending' === $post_status && ! current_user_can( 'publish_post', $post_ID ) ) {\n\t\t$post_name = '';\n\t}\n\n\t/*\n\t * Create a valid post name. Drafts and pending posts are allowed to have\n\t * an empty post name.\n\t */\n\tif ( empty( $post_name ) ) {\n\t\tif ( ! in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ), true ) ) {\n\t\t\t$post_name = sanitize_title( $post_title );\n\t\t} else {\n\t\t\t$post_name = '';\n\t\t}\n\t} else {\n\t\t// On updates, we need to check to see if it's using the old, fixed sanitization context.\n\t\t$check_name = sanitize_title( $post_name, '', 'old-save' );\n\n\t\tif ( $update && strtolower( urlencode( $post_name ) ) == $check_name && get_post_field( 'post_name', $post_ID ) == $check_name ) {\n\t\t\t$post_name = $check_name;\n\t\t} else { // new post, or slug has changed.\n\t\t\t$post_name = sanitize_title( $post_name );\n\t\t}\n\t}\n\n\t/*\n\t * If the post date is empty (due to having been new or a draft) and status\n\t * is not 'draft' or 'pending', set date to now.\n\t */\n\tif ( empty( $postarr['post_date'] ) || '0000-00-00 00:00:00' === $postarr['post_date'] ) {\n\t\tif ( empty( $postarr['post_date_gmt'] ) || '0000-00-00 00:00:00' === $postarr['post_date_gmt'] ) {\n\t\t\t$post_date = current_time( 'mysql' );\n\t\t} else {\n\t\t\t$post_date = get_date_from_gmt( $postarr['post_date_gmt'] );\n\t\t}\n\t} else {\n\t\t$post_date = $postarr['post_date'];\n\t}\n\n\t// Validate the date.\n\t$mm         = substr( $post_date, 5, 2 );\n\t$jj         = substr( $post_date, 8, 2 );\n\t$aa         = substr( $post_date, 0, 4 );\n\t$valid_date = wp_checkdate( $mm, $jj, $aa, $post_date );\n\tif ( ! $valid_date ) {\n\t\tif ( $wp_error ) {\n\t\t\treturn new WP_Error( 'invalid_date', __( 'Invalid date.' ) );\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\tif ( empty( $postarr['post_date_gmt'] ) || '0000-00-00 00:00:00' === $postarr['post_date_gmt'] ) {\n\t\tif ( ! in_array( $post_status, get_post_stati( array( 'date_floating' => true ) ), true ) ) {\n\t\t\t$post_date_gmt = get_gmt_from_date( $post_date );\n\t\t} else {\n\t\t\t$post_date_gmt = '0000-00-00 00:00:00';\n\t\t}\n\t} else {\n\t\t$post_date_gmt = $postarr['post_date_gmt'];\n\t}\n\n\tif ( $update || '0000-00-00 00:00:00' === $post_date ) {\n\t\t$post_modified     = current_time( 'mysql' );\n\t\t$post_modified_gmt = current_time( 'mysql', 1 );\n\t} else {\n\t\t$post_modified     = $post_date;\n\t\t$post_modified_gmt = $post_date_gmt;\n\t}\n\n\tif ( 'attachment' !== $post_type ) {\n\t\t$now = gmdate( 'Y-m-d H:i:s' );\n\n\t\tif ( 'publish' === $post_status ) {\n\t\t\tif ( strtotime( $post_date_gmt ) - strtotime( $now ) >= MINUTE_IN_SECONDS ) {\n\t\t\t\t$post_status = 'future';\n\t\t\t}\n\t\t} elseif ( 'future' === $post_status ) {\n\t\t\tif ( strtotime( $post_date_gmt ) - strtotime( $now ) < MINUTE_IN_SECONDS ) {\n\t\t\t\t$post_status = 'publish';\n\t\t\t}\n\t\t}\n\t}\n\n\t// Comment status.\n\tif ( empty( $postarr['comment_status'] ) ) {\n\t\tif ( $update ) {\n\t\t\t$comment_status = 'closed';\n\t\t} else {\n\t\t\t$comment_status = get_default_comment_status( $post_type );\n\t\t}\n\t} else {\n\t\t$comment_status = $postarr['comment_status'];\n\t}\n\n\t// These variables are needed by compact() later.\n\t$post_content_filtered = $postarr['post_content_filtered'];\n\t$post_author           = isset( $postarr['post_author'] ) ? $postarr['post_author'] : $user_id;\n\t$ping_status           = empty( $postarr['ping_status'] ) ? get_default_comment_status( $post_type, 'pingback' ) : $postarr['ping_status'];\n\t$to_ping               = isset( $postarr['to_ping'] ) ? sanitize_trackback_urls( $postarr['to_ping'] ) : '';\n\t$pinged                = isset( $postarr['pinged'] ) ? $postarr['pinged'] : '';\n\t$import_id             = isset( $postarr['import_id'] ) ? $postarr['import_id'] : 0;\n\n\t/*\n\t * The 'wp_insert_post_parent' filter expects all variables to be present.\n\t * Previously, these variables would have already been extracted\n\t */\n\tif ( isset( $postarr['menu_order'] ) ) {\n\t\t$menu_order = (int) $postarr['menu_order'];\n\t} else {\n\t\t$menu_order = 0;\n\t}\n\n\t$post_password = isset( $postarr['post_password'] ) ? $postarr['post_password'] : '';\n\tif ( 'private' === $post_status ) {\n\t\t$post_password = '';\n\t}\n\n\tif ( isset( $postarr['post_parent'] ) ) {\n\t\t$post_parent = (int) $postarr['post_parent'];\n\t} else {\n\t\t$post_parent = 0;\n\t}\n\n\t$new_postarr = array_merge(\n\t\tarray(\n\t\t\t'ID' => $post_ID,\n\t\t),\n\t\tcompact( array_diff( array_keys( $defaults ), array( 'context', 'filter' ) ) )\n\t);\n\n\t/**\n\t * Filters the post parent -- used to check for and prevent hierarchy loops.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param int   $post_parent Post parent ID.\n\t * @param int   $post_ID     Post ID.\n\t * @param array $new_postarr Array of parsed post data.\n\t * @param array $postarr     Array of sanitized, but otherwise unmodified post data.\n\t */\n\t$post_parent = apply_filters( 'wp_insert_post_parent', $post_parent, $post_ID, $new_postarr, $postarr );\n\n\t/*\n\t * If the post is being untrashed and it has a desired slug stored in post meta,\n\t * reassign it.\n\t */\n\tif ( 'trash' === $previous_status && 'trash' !== $post_status ) {\n\t\t$desired_post_slug = get_post_meta( $post_ID, '_wp_desired_post_slug', true );\n\n\t\tif ( $desired_post_slug ) {\n\t\t\tdelete_post_meta( $post_ID, '_wp_desired_post_slug' );\n\t\t\t$post_name = $desired_post_slug;\n\t\t}\n\t}\n\n\t// If a trashed post has the desired slug, change it and let this post have it.\n\tif ( 'trash' !== $post_status && $post_name ) {\n\t\t/**\n\t\t * Filters whether or not to add a `__trashed` suffix to trashed posts that match the name of the updated post.\n\t\t *\n\t\t * @since 5.4.0\n\t\t *\n\t\t * @param bool   $add_trashed_suffix Whether to attempt to add the suffix.\n\t\t * @param string $post_name          The name of the post being updated.\n\t\t * @param int    $post_ID            Post ID.\n\t\t */\n\t\t$add_trashed_suffix = apply_filters( 'add_trashed_suffix_to_trashed_posts', true, $post_name, $post_ID );\n\n\t\tif ( $add_trashed_suffix ) {\n\t\t\twp_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $post_ID );\n\t\t}\n\t}\n\n\t// When trashing an existing post, change its slug to allow non-trashed posts to use it.\n\tif ( 'trash' === $post_status && 'trash' !== $previous_status && 'new' !== $previous_status ) {\n\t\t$post_name = wp_add_trashed_suffix_to_post_name_for_post( $post_ID );\n\t}\n\n\t$post_name = wp_unique_post_slug( $post_name, $post_ID, $post_status, $post_type, $post_parent );\n\n\t// Don't unslash.\n\t$post_mime_type = isset( $postarr['post_mime_type'] ) ? $postarr['post_mime_type'] : '';\n\n\t// Expected_slashed (everything!).\n\t$data = compact( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order', 'post_mime_type', 'guid' );\n\n\t$emoji_fields = array( 'post_title', 'post_content', 'post_excerpt' );\n\n\tforeach ( $emoji_fields as $emoji_field ) {\n\t\tif ( isset( $data[ $emoji_field ] ) ) {\n\t\t\t$charset = $wpdb->get_col_charset( $wpdb->posts, $emoji_field );\n\n\t\t\tif ( 'utf8' === $charset ) {\n\t\t\t\t$data[ $emoji_field ] = wp_encode_emoji( $data[ $emoji_field ] );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( 'attachment' === $post_type ) {\n\t\t/**\n\t\t * Filters attachment post data before it is updated in or added to the database.\n\t\t *\n\t\t * @since 3.9.0\n\t\t * @since 5.4.1 `$unsanitized_postarr` argument added.\n\t\t *\n\t\t * @param array $data                An array of slashed, sanitized, and processed attachment post data.\n\t\t * @param array $postarr             An array of slashed and sanitized attachment post data, but not processed.\n\t\t * @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed attachment post data\n\t\t *                                   as originally passed to wp_insert_post().\n\t\t */\n\t\t$data = apply_filters( 'wp_insert_attachment_data', $data, $postarr, $unsanitized_postarr );\n\t} else {\n\t\t/**\n\t\t * Filters slashed post data just before it is inserted into the database.\n\t\t *\n\t\t * @since 2.7.0\n\t\t * @since 5.4.1 `$unsanitized_postarr` argument added.\n\t\t *\n\t\t * @param array $data                An array of slashed, sanitized, and processed post data.\n\t\t * @param array $postarr             An array of sanitized (and slashed) but otherwise unmodified post data.\n\t\t * @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed post data as\n\t\t *                                   originally passed to wp_insert_post().\n\t\t */\n\t\t$data = apply_filters( 'wp_insert_post_data', $data, $postarr, $unsanitized_postarr );\n\t}\n\n\t$data  = wp_unslash( $data );\n\t$where = array( 'ID' => $post_ID );\n\n\tif ( $update ) {\n\t\t/**\n\t\t * Fires immediately before an existing post is updated in the database.\n\t\t *\n\t\t * @since 2.5.0\n\t\t *\n\t\t * @param int   $post_ID Post ID.\n\t\t * @param array $data    Array of unslashed post data.\n\t\t */\n\t\tdo_action( 'pre_post_update', $post_ID, $data );\n\n\t\tif ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) {\n\t\t\tif ( $wp_error ) {\n\t\t\t\tif ( 'attachment' === $post_type ) {\n\t\t\t\t\t$message = __( 'Could not update attachment in the database.' );\n\t\t\t\t} else {\n\t\t\t\t\t$message = __( 'Could not update post in the database.' );\n\t\t\t\t}\n\n\t\t\t\treturn new WP_Error( 'db_update_error', $message, $wpdb->last_error );\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// If there is a suggested ID, use it if not already present.\n\t\tif ( ! empty( $import_id ) ) {\n\t\t\t$import_id = (int) $import_id;\n\n\t\t\tif ( ! $wpdb->get_var( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE ID = %d\", $import_id ) ) ) {\n\t\t\t\t$data['ID'] = $import_id;\n\t\t\t}\n\t\t}\n\n\t\tif ( false === $wpdb->insert( $wpdb->posts, $data ) ) {\n\t\t\tif ( $wp_error ) {\n\t\t\t\tif ( 'attachment' === $post_type ) {\n\t\t\t\t\t$message = __( 'Could not insert attachment into the database.' );\n\t\t\t\t} else {\n\t\t\t\t\t$message = __( 'Could not insert post into the database.' );\n\t\t\t\t}\n\n\t\t\t\treturn new WP_Error( 'db_insert_error', $message, $wpdb->last_error );\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\t$post_ID = (int) $wpdb->insert_id;\n\n\t\t// Use the newly generated $post_ID.\n\t\t$where = array( 'ID' => $post_ID );\n\t}\n\n\tif ( empty( $data['post_name'] ) && ! in_array( $data['post_status'], array( 'draft', 'pending', 'auto-draft' ), true ) ) {\n\t\t$data['post_name'] = wp_unique_post_slug( sanitize_title( $data['post_title'], $post_ID ), $post_ID, $data['post_status'], $post_type, $post_parent );\n\n\t\t$wpdb->update( $wpdb->posts, array( 'post_name' => $data['post_name'] ), $where );\n\t\tclean_post_cache( $post_ID );\n\t}\n\n\tif ( is_object_in_taxonomy( $post_type, 'category' ) ) {\n\t\twp_set_post_categories( $post_ID, $post_category );\n\t}\n\n\tif ( isset( $postarr['tags_input'] ) && is_object_in_taxonomy( $post_type, 'post_tag' ) ) {\n\t\twp_set_post_tags( $post_ID, $postarr['tags_input'] );\n\t}\n\n\t// Add default term for all associated custom taxonomies.\n\tif ( 'auto-draft' !== $post_status ) {\n\t\tforeach ( get_object_taxonomies( $post_type, 'object' ) as $taxonomy => $tax_object ) {\n\n\t\t\tif ( ! empty( $tax_object->default_term ) ) {\n\n\t\t\t\t// Filter out empty terms.\n\t\t\t\tif ( isset( $postarr['tax_input'][ $taxonomy ] ) && is_array( $postarr['tax_input'][ $taxonomy ] ) ) {\n\t\t\t\t\t$postarr['tax_input'][ $taxonomy ] = array_filter( $postarr['tax_input'][ $taxonomy ] );\n\t\t\t\t}\n\n\t\t\t\t// Passed custom taxonomy list overwrites the existing list if not empty.\n\t\t\t\t$terms = wp_get_object_terms( $post_ID, $taxonomy, array( 'fields' => 'ids' ) );\n\t\t\t\tif ( ! empty( $terms ) && empty( $postarr['tax_input'][ $taxonomy ] ) ) {\n\t\t\t\t\t$postarr['tax_input'][ $taxonomy ] = $terms;\n\t\t\t\t}\n\n\t\t\t\tif ( empty( $postarr['tax_input'][ $taxonomy ] ) ) {\n\t\t\t\t\t$default_term_id = get_option( 'default_term_' . $taxonomy );\n\t\t\t\t\tif ( ! empty( $default_term_id ) ) {\n\t\t\t\t\t\t$postarr['tax_input'][ $taxonomy ] = array( (int) $default_term_id );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// New-style support for all custom taxonomies.\n\tif ( ! empty( $postarr['tax_input'] ) ) {\n\t\tforeach ( $postarr['tax_input'] as $taxonomy => $tags ) {\n\t\t\t$taxonomy_obj = get_taxonomy( $taxonomy );\n\n\t\t\tif ( ! $taxonomy_obj ) {\n\t\t\t\t/* translators: %s: Taxonomy name. */\n\t\t\t\t_doing_it_wrong( __FUNCTION__, sprintf( __( 'Invalid taxonomy: %s.' ), $taxonomy ), '4.4.0' );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// array = hierarchical, string = non-hierarchical.\n\t\t\tif ( is_array( $tags ) ) {\n\t\t\t\t$tags = array_filter( $tags );\n\t\t\t}\n\n\t\t\tif ( current_user_can( $taxonomy_obj->cap->assign_terms ) ) {\n\t\t\t\twp_set_post_terms( $post_ID, $tags, $taxonomy );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! empty( $postarr['meta_input'] ) ) {\n\t\tforeach ( $postarr['meta_input'] as $field => $value ) {\n\t\t\tupdate_post_meta( $post_ID, $field, $value );\n\t\t}\n\t}\n\n\t$current_guid = get_post_field( 'guid', $post_ID );\n\n\t// Set GUID.\n\tif ( ! $update && '' === $current_guid ) {\n\t\t$wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post_ID ) ), $where );\n\t}\n\n\tif ( 'attachment' === $postarr['post_type'] ) {\n\t\tif ( ! empty( $postarr['file'] ) ) {\n\t\t\tupdate_attached_file( $post_ID, $postarr['file'] );\n\t\t}\n\n\t\tif ( ! empty( $postarr['context'] ) ) {\n\t\t\tadd_post_meta( $post_ID, '_wp_attachment_context', $postarr['context'], true );\n\t\t}\n\t}\n\n\t// Set or remove featured image.\n\tif ( isset( $postarr['_thumbnail_id'] ) ) {\n\t\t$thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' ) || 'revision' === $post_type;\n\n\t\tif ( ! $thumbnail_support && 'attachment' === $post_type && $post_mime_type ) {\n\t\t\tif ( wp_attachment_is( 'audio', $post_ID ) ) {\n\t\t\t\t$thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );\n\t\t\t} elseif ( wp_attachment_is( 'video', $post_ID ) ) {\n\t\t\t\t$thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );\n\t\t\t}\n\t\t}\n\n\t\tif ( $thumbnail_support ) {\n\t\t\t$thumbnail_id = intval( $postarr['_thumbnail_id'] );\n\t\t\tif ( -1 === $thumbnail_id ) {\n\t\t\t\tdelete_post_thumbnail( $post_ID );\n\t\t\t} else {\n\t\t\t\tset_post_thumbnail( $post_ID, $thumbnail_id );\n\t\t\t}\n\t\t}\n\t}\n\n\tclean_post_cache( $post_ID );\n\n\t$post = get_post( $post_ID );\n\n\tif ( ! empty( $postarr['page_template'] ) ) {\n\t\t$post->page_template = $postarr['page_template'];\n\t\t$page_templates      = wp_get_theme()->get_page_templates( $post );\n\n\t\tif ( 'default' !== $postarr['page_template'] && ! isset( $page_templates[ $postarr['page_template'] ] ) ) {\n\t\t\tif ( $wp_error ) {\n\t\t\t\treturn new WP_Error( 'invalid_page_template', __( 'Invalid page template.' ) );\n\t\t\t}\n\n\t\t\tupdate_post_meta( $post_ID, '_wp_page_template', 'default' );\n\t\t} else {\n\t\t\tupdate_post_meta( $post_ID, '_wp_page_template', $postarr['page_template'] );\n\t\t}\n\t}\n\n\tif ( 'attachment' !== $postarr['post_type'] ) {\n\t\twp_transition_post_status( $data['post_status'], $previous_status, $post );\n\t} else {\n\t\tif ( $update ) {\n\t\t\t/**\n\t\t\t * Fires once an existing attachment has been updated.\n\t\t\t *\n\t\t\t * @since 2.0.0\n\t\t\t *\n\t\t\t * @param int $post_ID Attachment ID.\n\t\t\t */\n\t\t\tdo_action( 'edit_attachment', $post_ID );\n\n\t\t\t$post_after = get_post( $post_ID );\n\n\t\t\t/**\n\t\t\t * Fires once an existing attachment has been updated.\n\t\t\t *\n\t\t\t * @since 4.4.0\n\t\t\t *\n\t\t\t * @param int     $post_ID      Post ID.\n\t\t\t * @param WP_Post $post_after   Post object following the update.\n\t\t\t * @param WP_Post $post_before  Post object before the update.\n\t\t\t */\n\t\t\tdo_action( 'attachment_updated', $post_ID, $post_after, $post_before );\n\t\t} else {\n\n\t\t\t/**\n\t\t\t * Fires once an attachment has been added.\n\t\t\t *\n\t\t\t * @since 2.0.0\n\t\t\t *\n\t\t\t * @param int $post_ID Attachment ID.\n\t\t\t */\n\t\t\tdo_action( 'add_attachment', $post_ID );\n\t\t}\n\n\t\treturn $post_ID;\n\t}\n\n\tif ( $update ) {\n\t\t/**\n\t\t * Fires once an existing post has been updated.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$post->post_type`, refers to\n\t\t * the post type slug.\n\t\t *\n\t\t * @since 5.1.0\n\t\t *\n\t\t * @param int     $post_ID Post ID.\n\t\t * @param WP_Post $post    Post object.\n\t\t */\n\t\tdo_action( \"edit_post_{$post->post_type}\", $post_ID, $post );\n\n\t\t/**\n\t\t * Fires once an existing post has been updated.\n\t\t *\n\t\t * @since 1.2.0\n\t\t *\n\t\t * @param int     $post_ID Post ID.\n\t\t * @param WP_Post $post    Post object.\n\t\t */\n\t\tdo_action( 'edit_post', $post_ID, $post );\n\n\t\t$post_after = get_post( $post_ID );\n\n\t\t/**\n\t\t * Fires once an existing post has been updated.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param int     $post_ID      Post ID.\n\t\t * @param WP_Post $post_after   Post object following the update.\n\t\t * @param WP_Post $post_before  Post object before the update.\n\t\t */\n\t\tdo_action( 'post_updated', $post_ID, $post_after, $post_before );\n\t}\n\n\t/**\n\t * Fires once a post has been saved.\n\t *\n\t * The dynamic portion of the hook name, `$post->post_type`, refers to\n\t * the post type slug.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param int     $post_ID Post ID.\n\t * @param WP_Post $post    Post object.\n\t * @param bool    $update  Whether this is an existing post being updated.\n\t */\n\tdo_action( \"save_post_{$post->post_type}\", $post_ID, $post, $update );\n\n\t/**\n\t * Fires once a post has been saved.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param int     $post_ID Post ID.\n\t * @param WP_Post $post    Post object.\n\t * @param bool    $update  Whether this is an existing post being updated.\n\t */\n\tdo_action( 'save_post', $post_ID, $post, $update );\n\n\t/**\n\t * Fires once a post has been saved.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param int     $post_ID Post ID.\n\t * @param WP_Post $post    Post object.\n\t * @param bool    $update  Whether this is an existing post being updated.\n\t */\n\tdo_action( 'wp_insert_post', $post_ID, $post, $update );\n\n\treturn $post_ID;\n}\n\n/**\n * Update a post with new post data.\n *\n * The date does not have to be set for drafts. You can set the date and it will\n * not be overridden.\n *\n * @since 1.0.0\n *\n * @param array|object $postarr  Optional. Post data. Arrays are expected to be escaped,\n *                               objects are not. Default array.\n * @param bool         $wp_error Optional. Allow return of WP_Error on failure. Default false.\n * @return int|WP_Error The post ID on success. The value 0 or WP_Error on failure.\n */\nfunction wp_update_post( $postarr = array(), $wp_error = false ) {\n\tif ( is_object( $postarr ) ) {\n\t\t// Non-escaped post was passed.\n\t\t$postarr = get_object_vars( $postarr );\n\t\t$postarr = wp_slash( $postarr );\n\t}\n\n\t// First, get all of the original fields.\n\t$post = get_post( $postarr['ID'], ARRAY_A );\n\n\tif ( is_null( $post ) ) {\n\t\tif ( $wp_error ) {\n\t\t\treturn new WP_Error( 'invalid_post', __( 'Invalid post ID.' ) );\n\t\t}\n\t\treturn 0;\n\t}\n\n\t// Escape data pulled from DB.\n\t$post = wp_slash( $post );\n\n\t// Passed post category list overwrites existing category list if not empty.\n\tif ( isset( $postarr['post_category'] ) && is_array( $postarr['post_category'] )\n\t\t&& count( $postarr['post_category'] ) > 0\n\t) {\n\t\t$post_cats = $postarr['post_category'];\n\t} else {\n\t\t$post_cats = $post['post_category'];\n\t}\n\n\t// Drafts shouldn't be assigned a date unless explicitly done so by the user.\n\tif ( isset( $post['post_status'] )\n\t\t&& in_array( $post['post_status'], array( 'draft', 'pending', 'auto-draft' ), true )\n\t\t&& empty( $postarr['edit_date'] ) && ( '0000-00-00 00:00:00' === $post['post_date_gmt'] )\n\t) {\n\t\t$clear_date = true;\n\t} else {\n\t\t$clear_date = false;\n\t}\n\n\t// Merge old and new fields with new fields overwriting old ones.\n\t$postarr                  = array_merge( $post, $postarr );\n\t$postarr['post_category'] = $post_cats;\n\tif ( $clear_date ) {\n\t\t$postarr['post_date']     = current_time( 'mysql' );\n\t\t$postarr['post_date_gmt'] = '';\n\t}\n\n\tif ( 'attachment' === $postarr['post_type'] ) {\n\t\treturn wp_insert_attachment( $postarr, false, 0, $wp_error );\n\t}\n\n\t// Discard 'tags_input' parameter if it's the same as existing post tags.\n\tif ( isset( $postarr['tags_input'] ) && is_object_in_taxonomy( $postarr['post_type'], 'post_tag' ) ) {\n\t\t$tags      = get_the_terms( $postarr['ID'], 'post_tag' );\n\t\t$tag_names = array();\n\n\t\tif ( $tags && ! is_wp_error( $tags ) ) {\n\t\t\t$tag_names = wp_list_pluck( $tags, 'name' );\n\t\t}\n\n\t\tif ( $postarr['tags_input'] === $tag_names ) {\n\t\t\tunset( $postarr['tags_input'] );\n\t\t}\n\t}\n\n\treturn wp_insert_post( $postarr, $wp_error );\n}\n\n/**\n * Publish a post by transitioning the post status.\n *\n * @since 2.1.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int|WP_Post $post Post ID or post object.\n */\nfunction wp_publish_post( $post ) {\n\tglobal $wpdb;\n\n\t$post = get_post( $post );\n\tif ( ! $post ) {\n\t\treturn;\n\t}\n\n\tif ( 'publish' === $post->post_status ) {\n\t\treturn;\n\t}\n\n\t$wpdb->update( $wpdb->posts, array( 'post_status' => 'publish' ), array( 'ID' => $post->ID ) );\n\n\tclean_post_cache( $post->ID );\n\n\t$old_status        = $post->post_status;\n\t$post->post_status = 'publish';\n\twp_transition_post_status( 'publish', $old_status, $post );\n\n\t/** This action is documented in wp-includes/post.php */\n\tdo_action( \"edit_post_{$post->post_type}\", $post->ID, $post );\n\n\t/** This action is documented in wp-includes/post.php */\n\tdo_action( 'edit_post', $post->ID, $post );\n\n\t/** This action is documented in wp-includes/post.php */\n\tdo_action( \"save_post_{$post->post_type}\", $post->ID, $post, true );\n\n\t/** This action is documented in wp-includes/post.php */\n\tdo_action( 'save_post', $post->ID, $post, true );\n\n\t/** This action is documented in wp-includes/post.php */\n\tdo_action( 'wp_insert_post', $post->ID, $post, true );\n}\n\n/**\n * Publish future post and make sure post ID has future post status.\n *\n * Invoked by cron 'publish_future_post' event. This safeguard prevents cron\n * from publishing drafts, etc.\n *\n * @since 2.5.0\n *\n * @param int|WP_Post $post_id Post ID or post object.\n */\nfunction check_and_publish_future_post( $post_id ) {\n\t$post = get_post( $post_id );\n\n\tif ( empty( $post ) ) {\n\t\treturn;\n\t}\n\n\tif ( 'future' !== $post->post_status ) {\n\t\treturn;\n\t}\n\n\t$time = strtotime( $post->post_date_gmt . ' GMT' );\n\n\t// Uh oh, someone jumped the gun!\n\tif ( $time > time() ) {\n\t\twp_clear_scheduled_hook( 'publish_future_post', array( $post_id ) ); // Clear anything else in the system.\n\t\twp_schedule_single_event( $time, 'publish_future_post', array( $post_id ) );\n\t\treturn;\n\t}\n\n\t// wp_publish_post() returns no meaningful value.\n\twp_publish_post( $post_id );\n}\n\n/**\n * Computes a unique slug for the post, when given the desired slug and some post details.\n *\n * @since 2.8.0\n *\n * @global wpdb       $wpdb       WordPress database abstraction object.\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string $slug        The desired slug (post_name).\n * @param int    $post_ID     Post ID.\n * @param string $post_status No uniqueness checks are made if the post is still draft or pending.\n * @param string $post_type   Post type.\n * @param int    $post_parent Post parent ID.\n * @return string Unique slug for the post, based on $post_name (with a -1, -2, etc. suffix)\n */\nfunction wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_parent ) {\n\tif ( in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ), true )\n\t\t|| ( 'inherit' === $post_status && 'revision' === $post_type ) || 'user_request' === $post_type\n\t) {\n\t\treturn $slug;\n\t}\n\n\t/**\n\t * Filters the post slug before it is generated to be unique.\n\t *\n\t * Returning a non-null value will short-circuit the\n\t * unique slug generation, returning the passed value instead.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param string|null $override_slug Short-circuit return value.\n\t * @param string      $slug          The desired slug (post_name).\n\t * @param int         $post_ID       Post ID.\n\t * @param string      $post_status   The post status.\n\t * @param string      $post_type     Post type.\n\t * @param int         $post_parent   Post parent ID.\n\t */\n\t$override_slug = apply_filters( 'pre_wp_unique_post_slug', null, $slug, $post_ID, $post_status, $post_type, $post_parent );\n\tif ( null !== $override_slug ) {\n\t\treturn $override_slug;\n\t}\n\n\tglobal $wpdb, $wp_rewrite;\n\n\t$original_slug = $slug;\n\n\t$feeds = $wp_rewrite->feeds;\n\tif ( ! is_array( $feeds ) ) {\n\t\t$feeds = array();\n\t}\n\n\tif ( 'attachment' === $post_type ) {\n\t\t// Attachment slugs must be unique across all types.\n\t\t$check_sql       = \"SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND ID != %d LIMIT 1\";\n\t\t$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_ID ) );\n\n\t\t/**\n\t\t * Filters whether the post slug would make a bad attachment slug.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param bool   $bad_slug Whether the slug would be bad as an attachment slug.\n\t\t * @param string $slug     The post slug.\n\t\t */\n\t\t$is_bad_attachment_slug = apply_filters( 'wp_unique_post_slug_is_bad_attachment_slug', false, $slug );\n\n\t\tif ( $post_name_check\n\t\t\t|| in_array( $slug, $feeds, true ) || 'embed' === $slug\n\t\t\t|| $is_bad_attachment_slug\n\t\t) {\n\t\t\t$suffix = 2;\n\t\t\tdo {\n\t\t\t\t$alt_post_name   = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . \"-$suffix\";\n\t\t\t\t$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_ID ) );\n\t\t\t\t$suffix++;\n\t\t\t} while ( $post_name_check );\n\t\t\t$slug = $alt_post_name;\n\t\t}\n\t} elseif ( is_post_type_hierarchical( $post_type ) ) {\n\t\tif ( 'nav_menu_item' === $post_type ) {\n\t\t\treturn $slug;\n\t\t}\n\n\t\t/*\n\t\t * Page slugs must be unique within their own trees. Pages are in a separate\n\t\t * namespace than posts so page slugs are allowed to overlap post slugs.\n\t\t */\n\t\t$check_sql       = \"SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( %s, 'attachment' ) AND ID != %d AND post_parent = %d LIMIT 1\";\n\t\t$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID, $post_parent ) );\n\n\t\t/**\n\t\t * Filters whether the post slug would make a bad hierarchical post slug.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param bool   $bad_slug    Whether the post slug would be bad in a hierarchical post context.\n\t\t * @param string $slug        The post slug.\n\t\t * @param string $post_type   Post type.\n\t\t * @param int    $post_parent Post parent ID.\n\t\t */\n\t\t$is_bad_hierarchical_slug = apply_filters( 'wp_unique_post_slug_is_bad_hierarchical_slug', false, $slug, $post_type, $post_parent );\n\n\t\tif ( $post_name_check\n\t\t\t|| in_array( $slug, $feeds, true ) || 'embed' === $slug\n\t\t\t|| preg_match( \"@^($wp_rewrite->pagination_base)?\\d+$@\", $slug )\n\t\t\t|| $is_bad_hierarchical_slug\n\t\t) {\n\t\t\t$suffix = 2;\n\t\t\tdo {\n\t\t\t\t$alt_post_name   = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . \"-$suffix\";\n\t\t\t\t$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_ID, $post_parent ) );\n\t\t\t\t$suffix++;\n\t\t\t} while ( $post_name_check );\n\t\t\t$slug = $alt_post_name;\n\t\t}\n\t} else {\n\t\t// Post slugs must be unique across all posts.\n\t\t$check_sql       = \"SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1\";\n\t\t$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID ) );\n\n\t\t$post = get_post( $post_ID );\n\n\t\t// Prevent new post slugs that could result in URLs that conflict with date archives.\n\t\t$conflicts_with_date_archive = false;\n\t\tif ( 'post' === $post_type && ( ! $post || $post->post_name !== $slug ) && preg_match( '/^[0-9]+$/', $slug ) ) {\n\t\t\t$slug_num = intval( $slug );\n\n\t\t\tif ( $slug_num ) {\n\t\t\t\t$permastructs   = array_values( array_filter( explode( '/', get_option( 'permalink_structure' ) ) ) );\n\t\t\t\t$postname_index = array_search( '%postname%', $permastructs, true );\n\n\t\t\t\t/*\n\t\t\t\t* Potential date clashes are as follows:\n\t\t\t\t*\n\t\t\t\t* - Any integer in the first permastruct position could be a year.\n\t\t\t\t* - An integer between 1 and 12 that follows 'year' conflicts with 'monthnum'.\n\t\t\t\t* - An integer between 1 and 31 that follows 'monthnum' conflicts with 'day'.\n\t\t\t\t*/\n\t\t\t\tif ( 0 === $postname_index ||\n\t\t\t\t\t( $postname_index && '%year%' === $permastructs[ $postname_index - 1 ] && 13 > $slug_num ) ||\n\t\t\t\t\t( $postname_index && '%monthnum%' === $permastructs[ $postname_index - 1 ] && 32 > $slug_num )\n\t\t\t\t) {\n\t\t\t\t\t$conflicts_with_date_archive = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters whether the post slug would be bad as a flat slug.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param bool   $bad_slug  Whether the post slug would be bad as a flat slug.\n\t\t * @param string $slug      The post slug.\n\t\t * @param string $post_type Post type.\n\t\t */\n\t\t$is_bad_flat_slug = apply_filters( 'wp_unique_post_slug_is_bad_flat_slug', false, $slug, $post_type );\n\n\t\tif ( $post_name_check\n\t\t\t|| in_array( $slug, $feeds, true ) || 'embed' === $slug\n\t\t\t|| $conflicts_with_date_archive\n\t\t\t|| $is_bad_flat_slug\n\t\t) {\n\t\t\t$suffix = 2;\n\t\t\tdo {\n\t\t\t\t$alt_post_name   = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . \"-$suffix\";\n\t\t\t\t$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_ID ) );\n\t\t\t\t$suffix++;\n\t\t\t} while ( $post_name_check );\n\t\t\t$slug = $alt_post_name;\n\t\t}\n\t}\n\n\t/**\n\t * Filters the unique post slug.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string $slug          The post slug.\n\t * @param int    $post_ID       Post ID.\n\t * @param string $post_status   The post status.\n\t * @param string $post_type     Post type.\n\t * @param int    $post_parent   Post parent ID\n\t * @param string $original_slug The original post slug.\n\t */\n\treturn apply_filters( 'wp_unique_post_slug', $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug );\n}\n\n/**\n * Truncate a post slug.\n *\n * @since 3.6.0\n * @access private\n *\n * @see utf8_uri_encode()\n *\n * @param string $slug   The slug to truncate.\n * @param int    $length Optional. Max length of the slug. Default 200 (characters).\n * @return string The truncated slug.\n */\nfunction _truncate_post_slug( $slug, $length = 200 ) {\n\tif ( strlen( $slug ) > $length ) {\n\t\t$decoded_slug = urldecode( $slug );\n\t\tif ( $decoded_slug === $slug ) {\n\t\t\t$slug = substr( $slug, 0, $length );\n\t\t} else {\n\t\t\t$slug = utf8_uri_encode( $decoded_slug, $length );\n\t\t}\n\t}\n\n\treturn rtrim( $slug, '-' );\n}\n\n/**\n * Add tags to a post.\n *\n * @see wp_set_post_tags()\n *\n * @since 2.3.0\n *\n * @param int          $post_id Optional. The Post ID. Does not default to the ID of the global $post.\n * @param string|array $tags    Optional. An array of tags to set for the post, or a string of tags\n *                              separated by commas. Default empty.\n * @return array|false|WP_Error Array of affected term IDs. WP_Error or false on failure.\n */\nfunction wp_add_post_tags( $post_id = 0, $tags = '' ) {\n\treturn wp_set_post_tags( $post_id, $tags, true );\n}\n\n/**\n * Set the tags for a post.\n *\n * @since 2.3.0\n *\n * @see wp_set_object_terms()\n *\n * @param int          $post_id Optional. The Post ID. Does not default to the ID of the global $post.\n * @param string|array $tags    Optional. An array of tags to set for the post, or a string of tags\n *                              separated by commas. Default empty.\n * @param bool         $append  Optional. If true, don't delete existing tags, just add on. If false,\n *                              replace the tags with the new tags. Default false.\n * @return array|false|WP_Error Array of term taxonomy IDs of affected terms. WP_Error or false on failure.\n */\nfunction wp_set_post_tags( $post_id = 0, $tags = '', $append = false ) {\n\treturn wp_set_post_terms( $post_id, $tags, 'post_tag', $append );\n}\n\n/**\n * Set the terms for a post.\n *\n * @since 2.8.0\n *\n * @see wp_set_object_terms()\n *\n * @param int          $post_id  Optional. The Post ID. Does not default to the ID of the global $post.\n * @param string|array $tags     Optional. An array of terms to set for the post, or a string of terms\n *                               separated by commas. Hierarchical taxonomies must always pass IDs rather\n *                               than names so that children with the same names but different parents\n *                               aren't confused. Default empty.\n * @param string       $taxonomy Optional. Taxonomy name. Default 'post_tag'.\n * @param bool         $append   Optional. If true, don't delete existing terms, just add on. If false,\n *                               replace the terms with the new terms. Default false.\n * @return array|false|WP_Error Array of term taxonomy IDs of affected terms. WP_Error or false on failure.\n */\nfunction wp_set_post_terms( $post_id = 0, $tags = '', $taxonomy = 'post_tag', $append = false ) {\n\t$post_id = (int) $post_id;\n\n\tif ( ! $post_id ) {\n\t\treturn false;\n\t}\n\n\tif ( empty( $tags ) ) {\n\t\t$tags = array();\n\t}\n\n\tif ( ! is_array( $tags ) ) {\n\t\t$comma = _x( ',', 'tag delimiter' );\n\t\tif ( ',' !== $comma ) {\n\t\t\t$tags = str_replace( $comma, ',', $tags );\n\t\t}\n\t\t$tags = explode( ',', trim( $tags, \" \\n\\t\\r\\0\\x0B,\" ) );\n\t}\n\n\t/*\n\t * Hierarchical taxonomies must always pass IDs rather than names so that\n\t * children with the same names but different parents aren't confused.\n\t */\n\tif ( is_taxonomy_hierarchical( $taxonomy ) ) {\n\t\t$tags = array_unique( array_map( 'intval', $tags ) );\n\t}\n\n\treturn wp_set_object_terms( $post_id, $tags, $taxonomy, $append );\n}\n\n/**\n * Set categories for a post.\n *\n * If no categories are provided, the default category is used.\n *\n * @since 2.1.0\n *\n * @param int       $post_ID         Optional. The Post ID. Does not default to the ID\n *                                   of the global $post. Default 0.\n * @param array|int $post_categories Optional. List of category IDs, or the ID of a single category.\n *                                   Default empty array.\n * @param bool      $append          If true, don't delete existing categories, just add on.\n *                                   If false, replace the categories with the new categories.\n * @return array|false|WP_Error Array of term taxonomy IDs of affected categories. WP_Error or false on failure.\n */\nfunction wp_set_post_categories( $post_ID = 0, $post_categories = array(), $append = false ) {\n\t$post_ID     = (int) $post_ID;\n\t$post_type   = get_post_type( $post_ID );\n\t$post_status = get_post_status( $post_ID );\n\n\t// If $post_categories isn't already an array, make it one.\n\t$post_categories = (array) $post_categories;\n\n\tif ( empty( $post_categories ) ) {\n\t\t/**\n\t\t * Filters post types (in addition to 'post') that require a default category.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param string[] $post_types An array of post type names. Default empty array.\n\t\t */\n\t\t$default_category_post_types = apply_filters( 'default_category_post_types', array() );\n\n\t\t// Regular posts always require a default category.\n\t\t$default_category_post_types = array_merge( $default_category_post_types, array( 'post' ) );\n\n\t\tif ( in_array( $post_type, $default_category_post_types, true )\n\t\t\t&& is_object_in_taxonomy( $post_type, 'category' )\n\t\t\t&& 'auto-draft' !== $post_status\n\t\t) {\n\t\t\t$post_categories = array( get_option( 'default_category' ) );\n\t\t\t$append          = false;\n\t\t} else {\n\t\t\t$post_categories = array();\n\t\t}\n\t} elseif ( 1 === count( $post_categories ) && '' === reset( $post_categories ) ) {\n\t\treturn true;\n\t}\n\n\treturn wp_set_post_terms( $post_ID, $post_categories, 'category', $append );\n}\n\n/**\n * Fires actions related to the transitioning of a post's status.\n *\n * When a post is saved, the post status is \"transitioned\" from one status to another,\n * though this does not always mean the status has actually changed before and after\n * the save. This function fires a number of action hooks related to that transition:\n * the generic {@see 'transition_post_status'} action, as well as the dynamic hooks\n * {@see '$old_status_to_$new_status'} and {@see '$new_status_$post->post_type'}. Note\n * that the function does not transition the post object in the database.\n *\n * For instance: When publishing a post for the first time, the post status may transition\n * from 'draft' \u00e2\u20ac\u201c or some other status \u00e2\u20ac\u201c to 'publish'. However, if a post is already\n * published and is simply being updated, the \"old\" and \"new\" statuses may both be 'publish'\n * before and after the transition.\n *\n * @since 2.3.0\n *\n * @param string  $new_status Transition to this post status.\n * @param string  $old_status Previous post status.\n * @param WP_Post $post Post data.\n */\nfunction wp_transition_post_status( $new_status, $old_status, $post ) {\n\t/**\n\t * Fires when a post is transitioned from one status to another.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string  $new_status New post status.\n\t * @param string  $old_status Old post status.\n\t * @param WP_Post $post       Post object.\n\t */\n\tdo_action( 'transition_post_status', $new_status, $old_status, $post );\n\n\t/**\n\t * Fires when a post is transitioned from one status to another.\n\t *\n\t * The dynamic portions of the hook name, `$new_status` and `$old status`,\n\t * refer to the old and new post statuses, respectively.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param WP_Post $post Post object.\n\t */\n\tdo_action( \"{$old_status}_to_{$new_status}\", $post );\n\n\t/**\n\t * Fires when a post is transitioned from one status to another.\n\t *\n\t * The dynamic portions of the hook name, `$new_status` and `$post->post_type`,\n\t * refer to the new post status and post type, respectively.\n\t *\n\t * Please note: When this action is hooked using a particular post status (like\n\t * 'publish', as `publish_{$post->post_type}`), it will fire both when a post is\n\t * first transitioned to that status from something else, as well as upon\n\t * subsequent post updates (old and new status are both the same).\n\t *\n\t * Therefore, if you are looking to only fire a callback when a post is first\n\t * transitioned to a status, use the {@see 'transition_post_status'} hook instead.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param int     $post_id Post ID.\n\t * @param WP_Post $post    Post object.\n\t */\n\tdo_action( \"{$new_status}_{$post->post_type}\", $post->ID, $post );\n}\n\n//\n// Comment, trackback, and pingback functions.\n//\n\n/**\n * Add a URL to those already pinged.\n *\n * @since 1.5.0\n * @since 4.7.0 `$post_id` can be a WP_Post object.\n * @since 4.7.0 `$uri` can be an array of URIs.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int|WP_Post  $post_id Post object or ID.\n * @param string|array $uri     Ping URI or array of URIs.\n * @return int|false How many rows were updated.\n */\nfunction add_ping( $post_id, $uri ) {\n\tglobal $wpdb;\n\n\t$post = get_post( $post_id );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$pung = trim( $post->pinged );\n\t$pung = preg_split( '/\\s/', $pung );\n\n\tif ( is_array( $uri ) ) {\n\t\t$pung = array_merge( $pung, $uri );\n\t} else {\n\t\t$pung[] = $uri;\n\t}\n\t$new = implode( \"\\n\", $pung );\n\n\t/**\n\t * Filters the new ping URL to add for the given post.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string $new New ping URL to add.\n\t */\n\t$new = apply_filters( 'add_ping', $new );\n\n\t$return = $wpdb->update( $wpdb->posts, array( 'pinged' => $new ), array( 'ID' => $post->ID ) );\n\tclean_post_cache( $post->ID );\n\treturn $return;\n}\n\n/**\n * Retrieve enclosures already enclosed for a post.\n *\n * @since 1.5.0\n *\n * @param int $post_id Post ID.\n * @return string[] Array of enclosures for the given post.\n */\nfunction get_enclosed( $post_id ) {\n\t$custom_fields = get_post_custom( $post_id );\n\t$pung          = array();\n\tif ( ! is_array( $custom_fields ) ) {\n\t\treturn $pung;\n\t}\n\n\tforeach ( $custom_fields as $key => $val ) {\n\t\tif ( 'enclosure' !== $key || ! is_array( $val ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tforeach ( $val as $enc ) {\n\t\t\t$enclosure = explode( \"\\n\", $enc );\n\t\t\t$pung[]    = trim( $enclosure[0] );\n\t\t}\n\t}\n\n\t/**\n\t * Filters the list of enclosures already enclosed for the given post.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string[] $pung    Array of enclosures for the given post.\n\t * @param int      $post_id Post ID.\n\t */\n\treturn apply_filters( 'get_enclosed', $pung, $post_id );\n}\n\n/**\n * Retrieve URLs already pinged for a post.\n *\n * @since 1.5.0\n *\n * @since 4.7.0 `$post_id` can be a WP_Post object.\n *\n * @param int|WP_Post $post_id Post ID or object.\n * @return bool|string[] Array of URLs already pinged for the given post, false if the post is not found.\n */\nfunction get_pung( $post_id ) {\n\t$post = get_post( $post_id );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$pung = trim( $post->pinged );\n\t$pung = preg_split( '/\\s/', $pung );\n\n\t/**\n\t * Filters the list of already-pinged URLs for the given post.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string[] $pung Array of URLs already pinged for the given post.\n\t */\n\treturn apply_filters( 'get_pung', $pung );\n}\n\n/**\n * Retrieve URLs that need to be pinged.\n *\n * @since 1.5.0\n * @since 4.7.0 `$post_id` can be a WP_Post object.\n *\n * @param int|WP_Post $post_id Post Object or ID\n * @return string[]|false List of URLs yet to ping.\n */\nfunction get_to_ping( $post_id ) {\n\t$post = get_post( $post_id );\n\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$to_ping = sanitize_trackback_urls( $post->to_ping );\n\t$to_ping = preg_split( '/\\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY );\n\n\t/**\n\t * Filters the list of URLs yet to ping for the given post.\n\t *\n\t * @since 2.0.0\n\t *\n\t * @param string[] $to_ping List of URLs yet to ping.\n\t */\n\treturn apply_filters( 'get_to_ping', $to_ping );\n}\n\n/**\n * Do trackbacks for a list of URLs.\n *\n * @since 1.0.0\n *\n * @param string $tb_list Comma separated list of URLs.\n * @param int    $post_id Post ID.\n */\nfunction trackback_url_list( $tb_list, $post_id ) {\n\tif ( ! empty( $tb_list ) ) {\n\t\t// Get post data.\n\t\t$postdata = get_post( $post_id, ARRAY_A );\n\n\t\t// Form an excerpt.\n\t\t$excerpt = strip_tags( $postdata['post_excerpt'] ? $postdata['post_excerpt'] : $postdata['post_content'] );\n\n\t\tif ( strlen( $excerpt ) > 255 ) {\n\t\t\t$excerpt = substr( $excerpt, 0, 252 ) . '&hellip;';\n\t\t}\n\n\t\t$trackback_urls = explode( ',', $tb_list );\n\t\tforeach ( (array) $trackback_urls as $tb_url ) {\n\t\t\t$tb_url = trim( $tb_url );\n\t\t\ttrackback( $tb_url, wp_unslash( $postdata['post_title'] ), $excerpt, $post_id );\n\t\t}\n\t}\n}\n\n//\n// Page functions.\n//\n\n/**\n * Get a list of page IDs.\n *\n * @since 2.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @return string[] List of page IDs as strings.\n */\nfunction get_all_page_ids() {\n\tglobal $wpdb;\n\n\t$page_ids = wp_cache_get( 'all_page_ids', 'posts' );\n\tif ( ! is_array( $page_ids ) ) {\n\t\t$page_ids = $wpdb->get_col( \"SELECT ID FROM $wpdb->posts WHERE post_type = 'page'\" );\n\t\twp_cache_add( 'all_page_ids', $page_ids, 'posts' );\n\t}\n\n\treturn $page_ids;\n}\n\n/**\n * Retrieves page data given a page ID or page object.\n *\n * Use get_post() instead of get_page().\n *\n * @since 1.5.1\n * @deprecated 3.5.0 Use get_post()\n *\n * @param int|WP_Post $page   Page object or page ID. Passed by reference.\n * @param string      $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which\n *                            correspond to a WP_Post object, an associative array, or a numeric array,\n *                            respectively. Default OBJECT.\n * @param string      $filter Optional. How the return value should be filtered. Accepts 'raw',\n *                            'edit', 'db', 'display'. Default 'raw'.\n * @return WP_Post|array|null WP_Post or array on success, null on failure.\n */\nfunction get_page( $page, $output = OBJECT, $filter = 'raw' ) {\n\treturn get_post( $page, $output, $filter );\n}\n\n/**\n * Retrieves a page given its path.\n *\n * @since 2.1.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string       $page_path Page path.\n * @param string       $output    Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which\n *                                correspond to a WP_Post object, an associative array, or a numeric array,\n *                                respectively. Default OBJECT.\n * @param string|array $post_type Optional. Post type or array of post types. Default 'page'.\n * @return WP_Post|array|null WP_Post (or array) on success, or null on failure.\n */\nfunction get_page_by_path( $page_path, $output = OBJECT, $post_type = 'page' ) {\n\tglobal $wpdb;\n\n\t$last_changed = wp_cache_get_last_changed( 'posts' );\n\n\t$hash      = md5( $page_path . serialize( $post_type ) );\n\t$cache_key = \"get_page_by_path:$hash:$last_changed\";\n\t$cached    = wp_cache_get( $cache_key, 'posts' );\n\tif ( false !== $cached ) {\n\t\t// Special case: '0' is a bad `$page_path`.\n\t\tif ( '0' === $cached || 0 === $cached ) {\n\t\t\treturn;\n\t\t} else {\n\t\t\treturn get_post( $cached, $output );\n\t\t}\n\t}\n\n\t$page_path     = rawurlencode( urldecode( $page_path ) );\n\t$page_path     = str_replace( '%2F', '/', $page_path );\n\t$page_path     = str_replace( '%20', ' ', $page_path );\n\t$parts         = explode( '/', trim( $page_path, '/' ) );\n\t$parts         = array_map( 'sanitize_title_for_query', $parts );\n\t$escaped_parts = esc_sql( $parts );\n\n\t$in_string = \"'\" . implode( \"','\", $escaped_parts ) . \"'\";\n\n\tif ( is_array( $post_type ) ) {\n\t\t$post_types = $post_type;\n\t} else {\n\t\t$post_types = array( $post_type, 'attachment' );\n\t}\n\n\t$post_types          = esc_sql( $post_types );\n\t$post_type_in_string = \"'\" . implode( \"','\", $post_types ) . \"'\";\n\t$sql                 = \"\n\t\tSELECT ID, post_name, post_parent, post_type\n\t\tFROM $wpdb->posts\n\t\tWHERE post_name IN ($in_string)\n\t\tAND post_type IN ($post_type_in_string)\n\t\";\n\n\t$pages = $wpdb->get_results( $sql, OBJECT_K );\n\n\t$revparts = array_reverse( $parts );\n\n\t$foundid = 0;\n\tforeach ( (array) $pages as $page ) {\n\t\tif ( $page->post_name == $revparts[0] ) {\n\t\t\t$count = 0;\n\t\t\t$p     = $page;\n\n\t\t\t/*\n\t\t\t * Loop through the given path parts from right to left,\n\t\t\t * ensuring each matches the post ancestry.\n\t\t\t */\n\t\t\twhile ( 0 != $p->post_parent && isset( $pages[ $p->post_parent ] ) ) {\n\t\t\t\t$count++;\n\t\t\t\t$parent = $pages[ $p->post_parent ];\n\t\t\t\tif ( ! isset( $revparts[ $count ] ) || $parent->post_name != $revparts[ $count ] ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$p = $parent;\n\t\t\t}\n\n\t\t\tif ( 0 == $p->post_parent && count( $revparts ) == $count + 1 && $p->post_name == $revparts[ $count ] ) {\n\t\t\t\t$foundid = $page->ID;\n\t\t\t\tif ( $page->post_type == $post_type ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// We cache misses as well as hits.\n\twp_cache_set( $cache_key, $foundid, 'posts' );\n\n\tif ( $foundid ) {\n\t\treturn get_post( $foundid, $output );\n\t}\n}\n\n/**\n * Retrieve a page given its title.\n *\n * If more than one post uses the same title, the post with the smallest ID will be returned.\n * Be careful: in case of more than one post having the same title, it will check the oldest\n * publication date, not the smallest ID.\n *\n * Because this function uses the MySQL '=' comparison, $page_title will usually be matched\n * as case-insensitive with default collation.\n *\n * @since 2.1.0\n * @since 3.0.0 The `$post_type` parameter was added.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string       $page_title Page title.\n * @param string       $output     Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which\n *                                 correspond to a WP_Post object, an associative array, or a numeric array,\n *                                 respectively. Default OBJECT.\n * @param string|array $post_type  Optional. Post type or array of post types. Default 'page'.\n * @return WP_Post|array|null WP_Post (or array) on success, or null on failure.\n */\nfunction get_page_by_title( $page_title, $output = OBJECT, $post_type = 'page' ) {\n\tglobal $wpdb;\n\n\tif ( is_array( $post_type ) ) {\n\t\t$post_type           = esc_sql( $post_type );\n\t\t$post_type_in_string = \"'\" . implode( \"','\", $post_type ) . \"'\";\n\t\t$sql                 = $wpdb->prepare(\n\t\t\t\"\n\t\t\tSELECT ID\n\t\t\tFROM $wpdb->posts\n\t\t\tWHERE post_title = %s\n\t\t\tAND post_type IN ($post_type_in_string)\n\t\t\",\n\t\t\t$page_title\n\t\t);\n\t} else {\n\t\t$sql = $wpdb->prepare(\n\t\t\t\"\n\t\t\tSELECT ID\n\t\t\tFROM $wpdb->posts\n\t\t\tWHERE post_title = %s\n\t\t\tAND post_type = %s\n\t\t\",\n\t\t\t$page_title,\n\t\t\t$post_type\n\t\t);\n\t}\n\n\t$page = $wpdb->get_var( $sql );\n\n\tif ( $page ) {\n\t\treturn get_post( $page, $output );\n\t}\n}\n\n/**\n * Identify descendants of a given page ID in a list of page objects.\n *\n * Descendants are identified from the `$pages` array passed to the function. No database queries are performed.\n *\n * @since 1.5.1\n *\n * @param int   $page_id Page ID.\n * @param array $pages   List of page objects from which descendants should be identified.\n * @return array List of page children.\n */\nfunction get_page_children( $page_id, $pages ) {\n\t// Build a hash of ID -> children.\n\t$children = array();\n\tforeach ( (array) $pages as $page ) {\n\t\t$children[ intval( $page->post_parent ) ][] = $page;\n\t}\n\n\t$page_list = array();\n\n\t// Start the search by looking at immediate children.\n\tif ( isset( $children[ $page_id ] ) ) {\n\t\t// Always start at the end of the stack in order to preserve original `$pages` order.\n\t\t$to_look = array_reverse( $children[ $page_id ] );\n\n\t\twhile ( $to_look ) {\n\t\t\t$p           = array_pop( $to_look );\n\t\t\t$page_list[] = $p;\n\t\t\tif ( isset( $children[ $p->ID ] ) ) {\n\t\t\t\tforeach ( array_reverse( $children[ $p->ID ] ) as $child ) {\n\t\t\t\t\t// Append to the `$to_look` stack to descend the tree.\n\t\t\t\t\t$to_look[] = $child;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $page_list;\n}\n\n/**\n * Order the pages with children under parents in a flat list.\n *\n * It uses auxiliary structure to hold parent-children relationships and\n * runs in O(N) complexity\n *\n * @since 2.0.0\n *\n * @param WP_Post[] $pages   Posts array (passed by reference).\n * @param int       $page_id Optional. Parent page ID. Default 0.\n * @return string[] Array of post names keyed by ID and arranged by hierarchy. Children immediately follow their parents.\n */\nfunction get_page_hierarchy( &$pages, $page_id = 0 ) {\n\tif ( empty( $pages ) ) {\n\t\treturn array();\n\t}\n\n\t$children = array();\n\tforeach ( (array) $pages as $p ) {\n\t\t$parent_id                = intval( $p->post_parent );\n\t\t$children[ $parent_id ][] = $p;\n\t}\n\n\t$result = array();\n\t_page_traverse_name( $page_id, $children, $result );\n\n\treturn $result;\n}\n\n/**\n * Traverse and return all the nested children post names of a root page.\n *\n * $children contains parent-children relations\n *\n * @since 2.9.0\n * @access private\n *\n * @see _page_traverse_name()\n *\n * @param int      $page_id  Page ID.\n * @param array    $children Parent-children relations (passed by reference).\n * @param string[] $result   Array of page names keyed by ID (passed by reference).\n */\nfunction _page_traverse_name( $page_id, &$children, &$result ) {\n\tif ( isset( $children[ $page_id ] ) ) {\n\t\tforeach ( (array) $children[ $page_id ] as $child ) {\n\t\t\t$result[ $child->ID ] = $child->post_name;\n\t\t\t_page_traverse_name( $child->ID, $children, $result );\n\t\t}\n\t}\n}\n\n/**\n * Build the URI path for a page.\n *\n * Sub pages will be in the \"directory\" under the parent page post name.\n *\n * @since 1.5.0\n * @since 4.6.0 The `$page` parameter was made optional.\n *\n * @param WP_Post|object|int $page Optional. Page ID or WP_Post object. Default is global $post.\n * @return string|false Page URI, false on error.\n */\nfunction get_page_uri( $page = 0 ) {\n\tif ( ! $page instanceof WP_Post ) {\n\t\t$page = get_post( $page );\n\t}\n\n\tif ( ! $page ) {\n\t\treturn false;\n\t}\n\n\t$uri = $page->post_name;\n\n\tforeach ( $page->ancestors as $parent ) {\n\t\t$parent = get_post( $parent );\n\t\tif ( $parent && $parent->post_name ) {\n\t\t\t$uri = $parent->post_name . '/' . $uri;\n\t\t}\n\t}\n\n\t/**\n\t * Filters the URI for a page.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string  $uri  Page URI.\n\t * @param WP_Post $page Page object.\n\t */\n\treturn apply_filters( 'get_page_uri', $uri, $page );\n}\n\n/**\n * Retrieve a list of pages (or hierarchical post type items).\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @since 1.5.0\n *\n * @param array|string $args {\n *     Optional. Array or string of arguments to retrieve pages.\n *\n *     @type int          $child_of     Page ID to return child and grandchild pages of. Note: The value\n *                                      of `$hierarchical` has no bearing on whether `$child_of` returns\n *                                      hierarchical results. Default 0, or no restriction.\n *     @type string       $sort_order   How to sort retrieved pages. Accepts 'ASC', 'DESC'. Default 'ASC'.\n *     @type string       $sort_column  What columns to sort pages by, comma-separated. Accepts 'post_author',\n *                                      'post_date', 'post_title', 'post_name', 'post_modified', 'menu_order',\n *                                      'post_modified_gmt', 'post_parent', 'ID', 'rand', 'comment_count'.\n *                                      'post_' can be omitted for any values that start with it.\n *                                      Default 'post_title'.\n *     @type bool         $hierarchical Whether to return pages hierarchically. If false in conjunction with\n *                                      `$child_of` also being false, both arguments will be disregarded.\n *                                      Default true.\n *     @type array        $exclude      Array of page IDs to exclude. Default empty array.\n *     @type array        $include      Array of page IDs to include. Cannot be used with `$child_of`,\n *                                      `$parent`, `$exclude`, `$meta_key`, `$meta_value`, or `$hierarchical`.\n *                                      Default empty array.\n *     @type string       $meta_key     Only include pages with this meta key. Default empty.\n *     @type string       $meta_value   Only include pages with this meta value. Requires `$meta_key`.\n *                                      Default empty.\n *     @type string       $authors      A comma-separated list of author IDs. Default empty.\n *     @type int          $parent       Page ID to return direct children of. Default -1, or no restriction.\n *     @type string|array $exclude_tree Comma-separated string or array of page IDs to exclude.\n *                                      Default empty array.\n *     @type int          $number       The number of pages to return. Default 0, or all pages.\n *     @type int          $offset       The number of pages to skip before returning. Requires `$number`.\n *                                      Default 0.\n *     @type string       $post_type    The post type to query. Default 'page'.\n *     @type string|array $post_status  A comma-separated list or array of post statuses to include.\n *                                      Default 'publish'.\n * }\n * @return array|false List of pages matching defaults or `$args`.\n */\nfunction get_pages( $args = array() ) {\n\tglobal $wpdb;\n\n\t$defaults = array(\n\t\t'child_of'     => 0,\n\t\t'sort_order'   => 'ASC',\n\t\t'sort_column'  => 'post_title',\n\t\t'hierarchical' => 1,\n\t\t'exclude'      => array(),\n\t\t'include'      => array(),\n\t\t'meta_key'     => '',\n\t\t'meta_value'   => '',\n\t\t'authors'      => '',\n\t\t'parent'       => -1,\n\t\t'exclude_tree' => array(),\n\t\t'number'       => '',\n\t\t'offset'       => 0,\n\t\t'post_type'    => 'page',\n\t\t'post_status'  => 'publish',\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t$number       = (int) $parsed_args['number'];\n\t$offset       = (int) $parsed_args['offset'];\n\t$child_of     = (int) $parsed_args['child_of'];\n\t$hierarchical = $parsed_args['hierarchical'];\n\t$exclude      = $parsed_args['exclude'];\n\t$meta_key     = $parsed_args['meta_key'];\n\t$meta_value   = $parsed_args['meta_value'];\n\t$parent       = $parsed_args['parent'];\n\t$post_status  = $parsed_args['post_status'];\n\n\t// Make sure the post type is hierarchical.\n\t$hierarchical_post_types = get_post_types( array( 'hierarchical' => true ) );\n\tif ( ! in_array( $parsed_args['post_type'], $hierarchical_post_types, true ) ) {\n\t\treturn false;\n\t}\n\n\tif ( $parent > 0 && ! $child_of ) {\n\t\t$hierarchical = false;\n\t}\n\n\t// Make sure we have a valid post status.\n\tif ( ! is_array( $post_status ) ) {\n\t\t$post_status = explode( ',', $post_status );\n\t}\n\tif ( array_diff( $post_status, get_post_stati() ) ) {\n\t\treturn false;\n\t}\n\n\t// $args can be whatever, only use the args defined in defaults to compute the key.\n\t$key          = md5( serialize( wp_array_slice_assoc( $parsed_args, array_keys( $defaults ) ) ) );\n\t$last_changed = wp_cache_get_last_changed( 'posts' );\n\n\t$cache_key = \"get_pages:$key:$last_changed\";\n\t$cache     = wp_cache_get( $cache_key, 'posts' );\n\tif ( false !== $cache ) {\n\t\t// Convert to WP_Post instances.\n\t\t$pages = array_map( 'get_post', $cache );\n\t\t/** This filter is documented in wp-includes/post.php */\n\t\t$pages = apply_filters( 'get_pages', $pages, $parsed_args );\n\t\treturn $pages;\n\t}\n\n\t$inclusions = '';\n\tif ( ! empty( $parsed_args['include'] ) ) {\n\t\t$child_of     = 0; // Ignore child_of, parent, exclude, meta_key, and meta_value params if using include.\n\t\t$parent       = -1;\n\t\t$exclude      = '';\n\t\t$meta_key     = '';\n\t\t$meta_value   = '';\n\t\t$hierarchical = false;\n\t\t$incpages     = wp_parse_id_list( $parsed_args['include'] );\n\t\tif ( ! empty( $incpages ) ) {\n\t\t\t$inclusions = ' AND ID IN (' . implode( ',', $incpages ) . ')';\n\t\t}\n\t}\n\n\t$exclusions = '';\n\tif ( ! empty( $exclude ) ) {\n\t\t$expages = wp_parse_id_list( $exclude );\n\t\tif ( ! empty( $expages ) ) {\n\t\t\t$exclusions = ' AND ID NOT IN (' . implode( ',', $expages ) . ')';\n\t\t}\n\t}\n\n\t$author_query = '';\n\tif ( ! empty( $parsed_args['authors'] ) ) {\n\t\t$post_authors = wp_parse_list( $parsed_args['authors'] );\n\n\t\tif ( ! empty( $post_authors ) ) {\n\t\t\tforeach ( $post_authors as $post_author ) {\n\t\t\t\t// Do we have an author id or an author login?\n\t\t\t\tif ( 0 == intval( $post_author ) ) {\n\t\t\t\t\t$post_author = get_user_by( 'login', $post_author );\n\t\t\t\t\tif ( empty( $post_author ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ( empty( $post_author->ID ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$post_author = $post_author->ID;\n\t\t\t\t}\n\n\t\t\t\tif ( '' === $author_query ) {\n\t\t\t\t\t$author_query = $wpdb->prepare( ' post_author = %d ', $post_author );\n\t\t\t\t} else {\n\t\t\t\t\t$author_query .= $wpdb->prepare( ' OR post_author = %d ', $post_author );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( '' !== $author_query ) {\n\t\t\t\t$author_query = \" AND ($author_query)\";\n\t\t\t}\n\t\t}\n\t}\n\n\t$join  = '';\n\t$where = \"$exclusions $inclusions \";\n\tif ( '' !== $meta_key || '' !== $meta_value ) {\n\t\t$join = \" LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id )\";\n\n\t\t// meta_key and meta_value might be slashed.\n\t\t$meta_key   = wp_unslash( $meta_key );\n\t\t$meta_value = wp_unslash( $meta_value );\n\t\tif ( '' !== $meta_key ) {\n\t\t\t$where .= $wpdb->prepare( \" AND $wpdb->postmeta.meta_key = %s\", $meta_key );\n\t\t}\n\t\tif ( '' !== $meta_value ) {\n\t\t\t$where .= $wpdb->prepare( \" AND $wpdb->postmeta.meta_value = %s\", $meta_value );\n\t\t}\n\t}\n\n\tif ( is_array( $parent ) ) {\n\t\t$post_parent__in = implode( ',', array_map( 'absint', (array) $parent ) );\n\t\tif ( ! empty( $post_parent__in ) ) {\n\t\t\t$where .= \" AND post_parent IN ($post_parent__in)\";\n\t\t}\n\t} elseif ( $parent >= 0 ) {\n\t\t$where .= $wpdb->prepare( ' AND post_parent = %d ', $parent );\n\t}\n\n\tif ( 1 === count( $post_status ) ) {\n\t\t$where_post_type = $wpdb->prepare( 'post_type = %s AND post_status = %s', $parsed_args['post_type'], reset( $post_status ) );\n\t} else {\n\t\t$post_status     = implode( \"', '\", $post_status );\n\t\t$where_post_type = $wpdb->prepare( \"post_type = %s AND post_status IN ('$post_status')\", $parsed_args['post_type'] );\n\t}\n\n\t$orderby_array = array();\n\t$allowed_keys  = array(\n\t\t'author',\n\t\t'post_author',\n\t\t'date',\n\t\t'post_date',\n\t\t'title',\n\t\t'post_title',\n\t\t'name',\n\t\t'post_name',\n\t\t'modified',\n\t\t'post_modified',\n\t\t'modified_gmt',\n\t\t'post_modified_gmt',\n\t\t'menu_order',\n\t\t'parent',\n\t\t'post_parent',\n\t\t'ID',\n\t\t'rand',\n\t\t'comment_count',\n\t);\n\n\tforeach ( explode( ',', $parsed_args['sort_column'] ) as $orderby ) {\n\t\t$orderby = trim( $orderby );\n\t\tif ( ! in_array( $orderby, $allowed_keys, true ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tswitch ( $orderby ) {\n\t\t\tcase 'menu_order':\n\t\t\t\tbreak;\n\t\t\tcase 'ID':\n\t\t\t\t$orderby = \"$wpdb->posts.ID\";\n\t\t\t\tbreak;\n\t\t\tcase 'rand':\n\t\t\t\t$orderby = 'RAND()';\n\t\t\t\tbreak;\n\t\t\tcase 'comment_count':\n\t\t\t\t$orderby = \"$wpdb->posts.comment_count\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif ( 0 === strpos( $orderby, 'post_' ) ) {\n\t\t\t\t\t$orderby = \"$wpdb->posts.\" . $orderby;\n\t\t\t\t} else {\n\t\t\t\t\t$orderby = \"$wpdb->posts.post_\" . $orderby;\n\t\t\t\t}\n\t\t}\n\n\t\t$orderby_array[] = $orderby;\n\n\t}\n\t$sort_column = ! empty( $orderby_array ) ? implode( ',', $orderby_array ) : \"$wpdb->posts.post_title\";\n\n\t$sort_order = strtoupper( $parsed_args['sort_order'] );\n\tif ( '' !== $sort_order && ! in_array( $sort_order, array( 'ASC', 'DESC' ), true ) ) {\n\t\t$sort_order = 'ASC';\n\t}\n\n\t$query  = \"SELECT * FROM $wpdb->posts $join WHERE ($where_post_type) $where \";\n\t$query .= $author_query;\n\t$query .= ' ORDER BY ' . $sort_column . ' ' . $sort_order;\n\n\tif ( ! empty( $number ) ) {\n\t\t$query .= ' LIMIT ' . $offset . ',' . $number;\n\t}\n\n\t$pages = $wpdb->get_results( $query );\n\n\tif ( empty( $pages ) ) {\n\t\twp_cache_set( $cache_key, array(), 'posts' );\n\n\t\t/** This filter is documented in wp-includes/post.php */\n\t\t$pages = apply_filters( 'get_pages', array(), $parsed_args );\n\t\treturn $pages;\n\t}\n\n\t// Sanitize before caching so it'll only get done once.\n\t$num_pages = count( $pages );\n\tfor ( $i = 0; $i < $num_pages; $i++ ) {\n\t\t$pages[ $i ] = sanitize_post( $pages[ $i ], 'raw' );\n\t}\n\n\t// Update cache.\n\tupdate_post_cache( $pages );\n\n\tif ( $child_of || $hierarchical ) {\n\t\t$pages = get_page_children( $child_of, $pages );\n\t}\n\n\tif ( ! empty( $parsed_args['exclude_tree'] ) ) {\n\t\t$exclude = wp_parse_id_list( $parsed_args['exclude_tree'] );\n\t\tforeach ( $exclude as $id ) {\n\t\t\t$children = get_page_children( $id, $pages );\n\t\t\tforeach ( $children as $child ) {\n\t\t\t\t$exclude[] = $child->ID;\n\t\t\t}\n\t\t}\n\n\t\t$num_pages = count( $pages );\n\t\tfor ( $i = 0; $i < $num_pages; $i++ ) {\n\t\t\tif ( in_array( $pages[ $i ]->ID, $exclude, true ) ) {\n\t\t\t\tunset( $pages[ $i ] );\n\t\t\t}\n\t\t}\n\t}\n\n\t$page_structure = array();\n\tforeach ( $pages as $page ) {\n\t\t$page_structure[] = $page->ID;\n\t}\n\n\twp_cache_set( $cache_key, $page_structure, 'posts' );\n\n\t// Convert to WP_Post instances.\n\t$pages = array_map( 'get_post', $pages );\n\n\t/**\n\t * Filters the retrieved list of pages.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param WP_Post[] $pages       Array of page objects.\n\t * @param array     $parsed_args Array of get_pages() arguments.\n\t */\n\treturn apply_filters( 'get_pages', $pages, $parsed_args );\n}\n\n//\n// Attachment functions.\n//\n\n/**\n * Determines whether an attachment URI is local and really an attachment.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.0.0\n *\n * @param string $url URL to check\n * @return bool True on success, false on failure.\n */\nfunction is_local_attachment( $url ) {\n\tif ( strpos( $url, home_url() ) === false ) {\n\t\treturn false;\n\t}\n\tif ( strpos( $url, home_url( '/?attachment_id=' ) ) !== false ) {\n\t\treturn true;\n\t}\n\n\t$id = url_to_postid( $url );\n\tif ( $id ) {\n\t\t$post = get_post( $id );\n\t\tif ( 'attachment' === $post->post_type ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Insert an attachment.\n *\n * If you set the 'ID' in the $args parameter, it will mean that you are\n * updating and attempt to update the attachment. You can also set the\n * attachment name or title by setting the key 'post_name' or 'post_title'.\n *\n * You can set the dates for the attachment manually by setting the 'post_date'\n * and 'post_date_gmt' keys' values.\n *\n * By default, the comments will use the default settings for whether the\n * comments are allowed. You can close them manually or keep them open by\n * setting the value for the 'comment_status' key.\n *\n * @since 2.0.0\n * @since 4.7.0 Added the `$wp_error` parameter to allow a WP_Error to be returned on failure.\n *\n * @see wp_insert_post()\n *\n * @param string|array $args     Arguments for inserting an attachment.\n * @param string       $file     Optional. Filename.\n * @param int          $parent   Optional. Parent post ID.\n * @param bool         $wp_error Optional. Whether to return a WP_Error on failure. Default false.\n * @return int|WP_Error The attachment ID on success. The value 0 or WP_Error on failure.\n */\nfunction wp_insert_attachment( $args, $file = false, $parent = 0, $wp_error = false ) {\n\t$defaults = array(\n\t\t'file'        => $file,\n\t\t'post_parent' => 0,\n\t);\n\n\t$data = wp_parse_args( $args, $defaults );\n\n\tif ( ! empty( $parent ) ) {\n\t\t$data['post_parent'] = $parent;\n\t}\n\n\t$data['post_type'] = 'attachment';\n\n\treturn wp_insert_post( $data, $wp_error );\n}\n\n/**\n * Trash or delete an attachment.\n *\n * When an attachment is permanently deleted, the file will also be removed.\n * Deletion removes all post meta fields, taxonomy, comments, etc. associated\n * with the attachment (except the main post).\n *\n * The attachment is moved to the Trash instead of permanently deleted unless Trash\n * for media is disabled, item is already in the Trash, or $force_delete is true.\n *\n * @since 2.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int  $post_id      Attachment ID.\n * @param bool $force_delete Optional. Whether to bypass Trash and force deletion.\n *                           Default false.\n * @return WP_Post|false|null Post data on success, false or null on failure.\n */\nfunction wp_delete_attachment( $post_id, $force_delete = false ) {\n\tglobal $wpdb;\n\n\t$post = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $wpdb->posts WHERE ID = %d\", $post_id ) );\n\n\tif ( ! $post ) {\n\t\treturn $post;\n\t}\n\n\t$post = get_post( $post );\n\n\tif ( 'attachment' !== $post->post_type ) {\n\t\treturn false;\n\t}\n\n\tif ( ! $force_delete && EMPTY_TRASH_DAYS && MEDIA_TRASH && 'trash' !== $post->post_status ) {\n\t\treturn wp_trash_post( $post_id );\n\t}\n\n\t/**\n\t * Filters whether an attachment deletion should take place.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param bool|null $delete       Whether to go forward with deletion.\n\t * @param WP_Post   $post         Post object.\n\t * @param bool      $force_delete Whether to bypass the Trash.\n\t */\n\t$check = apply_filters( 'pre_delete_attachment', null, $post, $force_delete );\n\tif ( null !== $check ) {\n\t\treturn $check;\n\t}\n\n\tdelete_post_meta( $post_id, '_wp_trash_meta_status' );\n\tdelete_post_meta( $post_id, '_wp_trash_meta_time' );\n\n\t$meta         = wp_get_attachment_metadata( $post_id );\n\t$backup_sizes = get_post_meta( $post->ID, '_wp_attachment_backup_sizes', true );\n\t$file         = get_attached_file( $post_id );\n\n\tif ( is_multisite() ) {\n\t\tdelete_transient( 'dirsize_cache' );\n\t}\n\n\t/**\n\t * Fires before an attachment is deleted, at the start of wp_delete_attachment().\n\t *\n\t * @since 2.0.0\n\t * @since 5.5.0 Added the `$post` parameter.\n\t *\n\t * @param int     $post_id Attachment ID.\n\t * @param WP_Post $post    Post object.\n\t */\n\tdo_action( 'delete_attachment', $post_id, $post );\n\n\twp_delete_object_term_relationships( $post_id, array( 'category', 'post_tag' ) );\n\twp_delete_object_term_relationships( $post_id, get_object_taxonomies( $post->post_type ) );\n\n\t// Delete all for any posts.\n\tdelete_metadata( 'post', null, '_thumbnail_id', $post_id, true );\n\n\twp_defer_comment_counting( true );\n\n\t$comment_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d\", $post_id ) );\n\tforeach ( $comment_ids as $comment_id ) {\n\t\twp_delete_comment( $comment_id, true );\n\t}\n\n\twp_defer_comment_counting( false );\n\n\t$post_meta_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d \", $post_id ) );\n\tforeach ( $post_meta_ids as $mid ) {\n\t\tdelete_metadata_by_mid( 'post', $mid );\n\t}\n\n\t/** This action is documented in wp-includes/post.php */\n\tdo_action( 'delete_post', $post_id, $post );\n\t$result = $wpdb->delete( $wpdb->posts, array( 'ID' => $post_id ) );\n\tif ( ! $result ) {\n\t\treturn false;\n\t}\n\t/** This action is documented in wp-includes/post.php */\n\tdo_action( 'deleted_post', $post_id, $post );\n\n\twp_delete_attachment_files( $post_id, $meta, $backup_sizes, $file );\n\n\tclean_post_cache( $post );\n\n\treturn $post;\n}\n\n/**\n * Deletes all files that belong to the given attachment.\n *\n * @since 4.9.7\n *\n * @param int    $post_id      Attachment ID.\n * @param array  $meta         The attachment's meta data.\n * @param array  $backup_sizes The meta data for the attachment's backup images.\n * @param string $file         Absolute path to the attachment's file.\n * @return bool True on success, false on failure.\n */\nfunction wp_delete_attachment_files( $post_id, $meta, $backup_sizes, $file ) {\n\tglobal $wpdb;\n\n\t$uploadpath = wp_get_upload_dir();\n\t$deleted    = true;\n\n\tif ( ! empty( $meta['thumb'] ) ) {\n\t\t// Don't delete the thumb if another attachment uses it.\n\t\tif ( ! $wpdb->get_row( $wpdb->prepare( \"SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value LIKE %s AND post_id <> %d\", '%' . $wpdb->esc_like( $meta['thumb'] ) . '%', $post_id ) ) ) {\n\t\t\t$thumbfile = str_replace( wp_basename( $file ), $meta['thumb'], $file );\n\n\t\t\tif ( ! empty( $thumbfile ) ) {\n\t\t\t\t$thumbfile = path_join( $uploadpath['basedir'], $thumbfile );\n\t\t\t\t$thumbdir  = path_join( $uploadpath['basedir'], dirname( $file ) );\n\n\t\t\t\tif ( ! wp_delete_file_from_directory( $thumbfile, $thumbdir ) ) {\n\t\t\t\t\t$deleted = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove intermediate and backup images if there are any.\n\tif ( isset( $meta['sizes'] ) && is_array( $meta['sizes'] ) ) {\n\t\t$intermediate_dir = path_join( $uploadpath['basedir'], dirname( $file ) );\n\n\t\tforeach ( $meta['sizes'] as $size => $sizeinfo ) {\n\t\t\t$intermediate_file = str_replace( wp_basename( $file ), $sizeinfo['file'], $file );\n\n\t\t\tif ( ! empty( $intermediate_file ) ) {\n\t\t\t\t$intermediate_file = path_join( $uploadpath['basedir'], $intermediate_file );\n\n\t\t\t\tif ( ! wp_delete_file_from_directory( $intermediate_file, $intermediate_dir ) ) {\n\t\t\t\t\t$deleted = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! empty( $meta['original_image'] ) ) {\n\t\tif ( empty( $intermediate_dir ) ) {\n\t\t\t$intermediate_dir = path_join( $uploadpath['basedir'], dirname( $file ) );\n\t\t}\n\n\t\t$original_image = str_replace( wp_basename( $file ), $meta['original_image'], $file );\n\n\t\tif ( ! empty( $original_image ) ) {\n\t\t\t$original_image = path_join( $uploadpath['basedir'], $original_image );\n\n\t\t\tif ( ! wp_delete_file_from_directory( $original_image, $intermediate_dir ) ) {\n\t\t\t\t$deleted = false;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( is_array( $backup_sizes ) ) {\n\t\t$del_dir = path_join( $uploadpath['basedir'], dirname( $meta['file'] ) );\n\n\t\tforeach ( $backup_sizes as $size ) {\n\t\t\t$del_file = path_join( dirname( $meta['file'] ), $size['file'] );\n\n\t\t\tif ( ! empty( $del_file ) ) {\n\t\t\t\t$del_file = path_join( $uploadpath['basedir'], $del_file );\n\n\t\t\t\tif ( ! wp_delete_file_from_directory( $del_file, $del_dir ) ) {\n\t\t\t\t\t$deleted = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! wp_delete_file_from_directory( $file, $uploadpath['basedir'] ) ) {\n\t\t$deleted = false;\n\t}\n\n\treturn $deleted;\n}\n\n/**\n * Retrieves attachment metadata for attachment ID.\n *\n * @since 2.1.0\n *\n * @param int  $attachment_id Attachment post ID. Defaults to global $post.\n * @param bool $unfiltered    Optional. If true, filters are not run. Default false.\n * @return array|false {\n *     Attachment metadata. False on failure.\n *\n *     @type int    $width      The width of the attachment.\n *     @type int    $height     The height of the attachment.\n *     @type string $file       The file path relative to `wp-content/uploads`.\n *     @type array  $sizes      Keys are size slugs, each value is an array containing\n *                              'file', 'width', 'height', and 'mime-type'.\n *     @type array  $image_meta Image metadata.\n * }\n */\nfunction wp_get_attachment_metadata( $attachment_id = 0, $unfiltered = false ) {\n\t$attachment_id = (int) $attachment_id;\n\n\t$post = get_post( $attachment_id );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$data = get_post_meta( $post->ID, '_wp_attachment_metadata', true );\n\n\tif ( $unfiltered ) {\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Filters the attachment meta data.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param array|bool $data          Array of meta data for the given attachment, or false\n\t *                                  if the object does not exist.\n\t * @param int        $attachment_id Attachment post ID.\n\t */\n\treturn apply_filters( 'wp_get_attachment_metadata', $data, $post->ID );\n}\n\n/**\n * Updates metadata for an attachment.\n *\n * @since 2.1.0\n *\n * @param int   $attachment_id Attachment post ID.\n * @param array $data          Attachment meta data.\n * @return int|bool False if $post is invalid.\n */\nfunction wp_update_attachment_metadata( $attachment_id, $data ) {\n\t$attachment_id = (int) $attachment_id;\n\n\t$post = get_post( $attachment_id );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Filters the updated attachment meta data.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param array $data          Array of updated attachment meta data.\n\t * @param int   $attachment_id Attachment post ID.\n\t */\n\t$data = apply_filters( 'wp_update_attachment_metadata', $data, $post->ID );\n\tif ( $data ) {\n\t\treturn update_post_meta( $post->ID, '_wp_attachment_metadata', $data );\n\t} else {\n\t\treturn delete_post_meta( $post->ID, '_wp_attachment_metadata' );\n\t}\n}\n\n/**\n * Retrieve the URL for an attachment.\n *\n * @since 2.1.0\n *\n * @global string $pagenow\n *\n * @param int $attachment_id Optional. Attachment post ID. Defaults to global $post.\n * @return string|false Attachment URL, otherwise false.\n */\nfunction wp_get_attachment_url( $attachment_id = 0 ) {\n\t$attachment_id = (int) $attachment_id;\n\n\t$post = get_post( $attachment_id );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\tif ( 'attachment' !== $post->post_type ) {\n\t\treturn false;\n\t}\n\n\t$url = '';\n\t// Get attached file.\n\t$file = get_post_meta( $post->ID, '_wp_attached_file', true );\n\tif ( $file ) {\n\t\t// Get upload directory.\n\t\t$uploads = wp_get_upload_dir();\n\t\tif ( $uploads && false === $uploads['error'] ) {\n\t\t\t// Check that the upload base exists in the file location.\n\t\t\tif ( 0 === strpos( $file, $uploads['basedir'] ) ) {\n\t\t\t\t// Replace file location with url location.\n\t\t\t\t$url = str_replace( $uploads['basedir'], $uploads['baseurl'], $file );\n\t\t\t} elseif ( false !== strpos( $file, 'wp-content/uploads' ) ) {\n\t\t\t\t// Get the directory name relative to the basedir (back compat for pre-2.7 uploads).\n\t\t\t\t$url = trailingslashit( $uploads['baseurl'] . '/' . _wp_get_attachment_relative_path( $file ) ) . wp_basename( $file );\n\t\t\t} else {\n\t\t\t\t// It's a newly-uploaded file, therefore $file is relative to the basedir.\n\t\t\t\t$url = $uploads['baseurl'] . \"/$file\";\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t * If any of the above options failed, Fallback on the GUID as used pre-2.7,\n\t * not recommended to rely upon this.\n\t */\n\tif ( empty( $url ) ) {\n\t\t$url = get_the_guid( $post->ID );\n\t}\n\n\t// On SSL front end, URLs should be HTTPS.\n\tif ( is_ssl() && ! is_admin() && 'wp-login.php' !== $GLOBALS['pagenow'] ) {\n\t\t$url = set_url_scheme( $url );\n\t}\n\n\t/**\n\t * Filters the attachment URL.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $url           URL for the given attachment.\n\t * @param int    $attachment_id Attachment post ID.\n\t */\n\t$url = apply_filters( 'wp_get_attachment_url', $url, $post->ID );\n\n\tif ( empty( $url ) ) {\n\t\treturn false;\n\t}\n\n\treturn $url;\n}\n\n/**\n * Retrieves the caption for an attachment.\n *\n * @since 4.6.0\n *\n * @param int $post_id Optional. Attachment ID. Default is the ID of the global `$post`.\n * @return string|false False on failure. Attachment caption on success.\n */\nfunction wp_get_attachment_caption( $post_id = 0 ) {\n\t$post_id = (int) $post_id;\n\t$post    = get_post( $post_id );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\tif ( 'attachment' !== $post->post_type ) {\n\t\treturn false;\n\t}\n\n\t$caption = $post->post_excerpt;\n\n\t/**\n\t * Filters the attachment caption.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string $caption Caption for the given attachment.\n\t * @param int    $post_id Attachment ID.\n\t */\n\treturn apply_filters( 'wp_get_attachment_caption', $caption, $post->ID );\n}\n\n/**\n * Retrieve thumbnail for an attachment.\n *\n * @since 2.1.0\n *\n * @param int $post_id Optional. Attachment ID. Default 0.\n * @return string|false False on failure. Thumbnail file path on success.\n */\nfunction wp_get_attachment_thumb_file( $post_id = 0 ) {\n\t$post_id = (int) $post_id;\n\t$post    = get_post( $post_id );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$imagedata = wp_get_attachment_metadata( $post->ID );\n\tif ( ! is_array( $imagedata ) ) {\n\t\treturn false;\n\t}\n\n\t$file = get_attached_file( $post->ID );\n\n\tif ( ! empty( $imagedata['thumb'] ) ) {\n\t\t$thumbfile = str_replace( wp_basename( $file ), $imagedata['thumb'], $file );\n\t\tif ( file_exists( $thumbfile ) ) {\n\t\t\t/**\n\t\t\t * Filters the attachment thumbnail file path.\n\t\t\t *\n\t\t\t * @since 2.1.0\n\t\t\t *\n\t\t\t * @param string $thumbfile File path to the attachment thumbnail.\n\t\t\t * @param int    $post_id   Attachment ID.\n\t\t\t */\n\t\t\treturn apply_filters( 'wp_get_attachment_thumb_file', $thumbfile, $post->ID );\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Retrieve URL for an attachment thumbnail.\n *\n * @since 2.1.0\n *\n * @param int $post_id Optional. Attachment ID. Default 0.\n * @return string|false False on failure. Thumbnail URL on success.\n */\nfunction wp_get_attachment_thumb_url( $post_id = 0 ) {\n\t$post_id = (int) $post_id;\n\t$post    = get_post( $post_id );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$url = wp_get_attachment_url( $post->ID );\n\tif ( ! $url ) {\n\t\treturn false;\n\t}\n\n\t$sized = image_downsize( $post_id, 'thumbnail' );\n\tif ( $sized ) {\n\t\treturn $sized[0];\n\t}\n\n\t$thumb = wp_get_attachment_thumb_file( $post->ID );\n\tif ( ! $thumb ) {\n\t\treturn false;\n\t}\n\n\t$url = str_replace( wp_basename( $url ), wp_basename( $thumb ), $url );\n\n\t/**\n\t * Filters the attachment thumbnail URL.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $url     URL for the attachment thumbnail.\n\t * @param int    $post_id Attachment ID.\n\t */\n\treturn apply_filters( 'wp_get_attachment_thumb_url', $url, $post->ID );\n}\n\n/**\n * Verifies an attachment is of a given type.\n *\n * @since 4.2.0\n *\n * @param string      $type Attachment type. Accepts 'image', 'audio', or 'video'.\n * @param int|WP_Post $post Optional. Attachment ID or object. Default is global $post.\n * @return bool True if one of the accepted types, false otherwise.\n */\nfunction wp_attachment_is( $type, $post = null ) {\n\t$post = get_post( $post );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\t$file = get_attached_file( $post->ID );\n\tif ( ! $file ) {\n\t\treturn false;\n\t}\n\n\tif ( 0 === strpos( $post->post_mime_type, $type . '/' ) ) {\n\t\treturn true;\n\t}\n\n\t$check = wp_check_filetype( $file );\n\tif ( empty( $check['ext'] ) ) {\n\t\treturn false;\n\t}\n\n\t$ext = $check['ext'];\n\n\tif ( 'import' !== $post->post_mime_type ) {\n\t\treturn $type === $ext;\n\t}\n\n\tswitch ( $type ) {\n\t\tcase 'image':\n\t\t\t$image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );\n\t\t\treturn in_array( $ext, $image_exts, true );\n\n\t\tcase 'audio':\n\t\t\treturn in_array( $ext, wp_get_audio_extensions(), true );\n\n\t\tcase 'video':\n\t\t\treturn in_array( $ext, wp_get_video_extensions(), true );\n\n\t\tdefault:\n\t\t\treturn $type === $ext;\n\t}\n}\n\n/**\n * Determines whether an attachment is an image.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.1.0\n * @since 4.2.0 Modified into wrapper for wp_attachment_is() and\n *              allowed WP_Post object to be passed.\n *\n * @param int|WP_Post $post Optional. Attachment ID or object. Default is global $post.\n * @return bool Whether the attachment is an image.\n */\nfunction wp_attachment_is_image( $post = null ) {\n\treturn wp_attachment_is( 'image', $post );\n}\n\n/**\n * Retrieve the icon for a MIME type or attachment.\n *\n * @since 2.1.0\n *\n * @param string|int $mime MIME type or attachment ID.\n * @return string|false Icon, false otherwise.\n */\nfunction wp_mime_type_icon( $mime = 0 ) {\n\tif ( ! is_numeric( $mime ) ) {\n\t\t$icon = wp_cache_get( \"mime_type_icon_$mime\" );\n\t}\n\n\t$post_id = 0;\n\tif ( empty( $icon ) ) {\n\t\t$post_mimes = array();\n\t\tif ( is_numeric( $mime ) ) {\n\t\t\t$mime = (int) $mime;\n\t\t\t$post = get_post( $mime );\n\t\t\tif ( $post ) {\n\t\t\t\t$post_id = (int) $post->ID;\n\t\t\t\t$file    = get_attached_file( $post_id );\n\t\t\t\t$ext     = preg_replace( '/^.+?\\.([^.]+)$/', '$1', $file );\n\t\t\t\tif ( ! empty( $ext ) ) {\n\t\t\t\t\t$post_mimes[] = $ext;\n\t\t\t\t\t$ext_type     = wp_ext2type( $ext );\n\t\t\t\t\tif ( $ext_type ) {\n\t\t\t\t\t\t$post_mimes[] = $ext_type;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$mime = $post->post_mime_type;\n\t\t\t} else {\n\t\t\t\t$mime = 0;\n\t\t\t}\n\t\t} else {\n\t\t\t$post_mimes[] = $mime;\n\t\t}\n\n\t\t$icon_files = wp_cache_get( 'icon_files' );\n\n\t\tif ( ! is_array( $icon_files ) ) {\n\t\t\t/**\n\t\t\t * Filters the icon directory path.\n\t\t\t *\n\t\t\t * @since 2.0.0\n\t\t\t *\n\t\t\t * @param string $path Icon directory absolute path.\n\t\t\t */\n\t\t\t$icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' );\n\n\t\t\t/**\n\t\t\t * Filters the icon directory URI.\n\t\t\t *\n\t\t\t * @since 2.0.0\n\t\t\t *\n\t\t\t * @param string $uri Icon directory URI.\n\t\t\t */\n\t\t\t$icon_dir_uri = apply_filters( 'icon_dir_uri', includes_url( 'images/media' ) );\n\n\t\t\t/**\n\t\t\t * Filters the array of icon directory URIs.\n\t\t\t *\n\t\t\t * @since 2.5.0\n\t\t\t *\n\t\t\t * @param string[] $uris Array of icon directory URIs keyed by directory absolute path.\n\t\t\t */\n\t\t\t$dirs       = apply_filters( 'icon_dirs', array( $icon_dir => $icon_dir_uri ) );\n\t\t\t$icon_files = array();\n\t\t\twhile ( $dirs ) {\n\t\t\t\t$keys = array_keys( $dirs );\n\t\t\t\t$dir  = array_shift( $keys );\n\t\t\t\t$uri  = array_shift( $dirs );\n\t\t\t\t$dh   = opendir( $dir );\n\t\t\t\tif ( $dh ) {\n\t\t\t\t\twhile ( false !== $file = readdir( $dh ) ) {\n\t\t\t\t\t\t$file = wp_basename( $file );\n\t\t\t\t\t\tif ( '.' === substr( $file, 0, 1 ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$ext = strtolower( substr( $file, -4 ) );\n\t\t\t\t\t\tif ( ! in_array( $ext, array( '.png', '.gif', '.jpg' ), true ) ) {\n\t\t\t\t\t\t\tif ( is_dir( \"$dir/$file\" ) ) {\n\t\t\t\t\t\t\t\t$dirs[ \"$dir/$file\" ] = \"$uri/$file\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$icon_files[ \"$dir/$file\" ] = \"$uri/$file\";\n\t\t\t\t\t}\n\t\t\t\t\tclosedir( $dh );\n\t\t\t\t}\n\t\t\t}\n\t\t\twp_cache_add( 'icon_files', $icon_files, 'default', 600 );\n\t\t}\n\n\t\t$types = array();\n\t\t// Icon wp_basename - extension = MIME wildcard.\n\t\tforeach ( $icon_files as $file => $uri ) {\n\t\t\t$types[ preg_replace( '/^([^.]*).*$/', '$1', wp_basename( $file ) ) ] =& $icon_files[ $file ];\n\t\t}\n\n\t\tif ( ! empty( $mime ) ) {\n\t\t\t$post_mimes[] = substr( $mime, 0, strpos( $mime, '/' ) );\n\t\t\t$post_mimes[] = substr( $mime, strpos( $mime, '/' ) + 1 );\n\t\t\t$post_mimes[] = str_replace( '/', '_', $mime );\n\t\t}\n\n\t\t$matches            = wp_match_mime_types( array_keys( $types ), $post_mimes );\n\t\t$matches['default'] = array( 'default' );\n\n\t\tforeach ( $matches as $match => $wilds ) {\n\t\t\tforeach ( $wilds as $wild ) {\n\t\t\t\tif ( ! isset( $types[ $wild ] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$icon = $types[ $wild ];\n\t\t\t\tif ( ! is_numeric( $mime ) ) {\n\t\t\t\t\twp_cache_add( \"mime_type_icon_$mime\", $icon );\n\t\t\t\t}\n\t\t\t\tbreak 2;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filters the mime type icon.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $icon    Path to the mime type icon.\n\t * @param string $mime    Mime type.\n\t * @param int    $post_id Attachment ID. Will equal 0 if the function passed\n\t *                        the mime type.\n\t */\n\treturn apply_filters( 'wp_mime_type_icon', $icon, $mime, $post_id );\n}\n\n/**\n * Check for changed slugs for published post objects and save the old slug.\n *\n * The function is used when a post object of any type is updated,\n * by comparing the current and previous post objects.\n *\n * If the slug was changed and not already part of the old slugs then it will be\n * added to the post meta field ('_wp_old_slug') for storing old slugs for that\n * post.\n *\n * The most logically usage of this function is redirecting changed post objects, so\n * that those that linked to an changed post will be redirected to the new post.\n *\n * @since 2.1.0\n *\n * @param int     $post_id     Post ID.\n * @param WP_Post $post        The Post Object\n * @param WP_Post $post_before The Previous Post Object\n */\nfunction wp_check_for_changed_slugs( $post_id, $post, $post_before ) {\n\t// Don't bother if it hasn't changed.\n\tif ( $post->post_name == $post_before->post_name ) {\n\t\treturn;\n\t}\n\n\t// We're only concerned with published, non-hierarchical objects.\n\tif ( ! ( 'publish' === $post->post_status || ( 'attachment' === get_post_type( $post ) && 'inherit' === $post->post_status ) ) || is_post_type_hierarchical( $post->post_type ) ) {\n\t\treturn;\n\t}\n\n\t$old_slugs = (array) get_post_meta( $post_id, '_wp_old_slug' );\n\n\t// If we haven't added this old slug before, add it now.\n\tif ( ! empty( $post_before->post_name ) && ! in_array( $post_before->post_name, $old_slugs, true ) ) {\n\t\tadd_post_meta( $post_id, '_wp_old_slug', $post_before->post_name );\n\t}\n\n\t// If the new slug was used previously, delete it from the list.\n\tif ( in_array( $post->post_name, $old_slugs, true ) ) {\n\t\tdelete_post_meta( $post_id, '_wp_old_slug', $post->post_name );\n\t}\n}\n\n/**\n * Check for changed dates for published post objects and save the old date.\n *\n * The function is used when a post object of any type is updated,\n * by comparing the current and previous post objects.\n *\n * If the date was changed and not already part of the old dates then it will be\n * added to the post meta field ('_wp_old_date') for storing old dates for that\n * post.\n *\n * The most logically usage of this function is redirecting changed post objects, so\n * that those that linked to an changed post will be redirected to the new post.\n *\n * @since 4.9.3\n *\n * @param int     $post_id     Post ID.\n * @param WP_Post $post        The Post Object\n * @param WP_Post $post_before The Previous Post Object\n */\nfunction wp_check_for_changed_dates( $post_id, $post, $post_before ) {\n\t$previous_date = gmdate( 'Y-m-d', strtotime( $post_before->post_date ) );\n\t$new_date      = gmdate( 'Y-m-d', strtotime( $post->post_date ) );\n\n\t// Don't bother if it hasn't changed.\n\tif ( $new_date == $previous_date ) {\n\t\treturn;\n\t}\n\n\t// We're only concerned with published, non-hierarchical objects.\n\tif ( ! ( 'publish' === $post->post_status || ( 'attachment' === get_post_type( $post ) && 'inherit' === $post->post_status ) ) || is_post_type_hierarchical( $post->post_type ) ) {\n\t\treturn;\n\t}\n\n\t$old_dates = (array) get_post_meta( $post_id, '_wp_old_date' );\n\n\t// If we haven't added this old date before, add it now.\n\tif ( ! empty( $previous_date ) && ! in_array( $previous_date, $old_dates, true ) ) {\n\t\tadd_post_meta( $post_id, '_wp_old_date', $previous_date );\n\t}\n\n\t// If the new slug was used previously, delete it from the list.\n\tif ( in_array( $new_date, $old_dates, true ) ) {\n\t\tdelete_post_meta( $post_id, '_wp_old_date', $new_date );\n\t}\n}\n\n/**\n * Retrieve the private post SQL based on capability.\n *\n * This function provides a standardized way to appropriately select on the\n * post_status of a post type. The function will return a piece of SQL code\n * that can be added to a WHERE clause; this SQL is constructed to allow all\n * published posts, and all private posts to which the user has access.\n *\n * @since 2.2.0\n * @since 4.3.0 Added the ability to pass an array to `$post_type`.\n *\n * @param string|array $post_type Single post type or an array of post types. Currently only supports 'post' or 'page'.\n * @return string SQL code that can be added to a where clause.\n */\nfunction get_private_posts_cap_sql( $post_type ) {\n\treturn get_posts_by_author_sql( $post_type, false );\n}\n\n/**\n * Retrieve the post SQL based on capability, author, and type.\n *\n * @since 3.0.0\n * @since 4.3.0 Introduced the ability to pass an array of post types to `$post_type`.\n *\n * @see get_private_posts_cap_sql()\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string|string[] $post_type   Single post type or an array of post types.\n * @param bool            $full        Optional. Returns a full WHERE statement instead of just\n *                                     an 'andalso' term. Default true.\n * @param int             $post_author Optional. Query posts having a single author ID. Default null.\n * @param bool            $public_only Optional. Only return public posts. Skips cap checks for\n *                                     $current_user.  Default false.\n * @return string SQL WHERE code that can be added to a query.\n */\nfunction get_posts_by_author_sql( $post_type, $full = true, $post_author = null, $public_only = false ) {\n\tglobal $wpdb;\n\n\tif ( is_array( $post_type ) ) {\n\t\t$post_types = $post_type;\n\t} else {\n\t\t$post_types = array( $post_type );\n\t}\n\n\t$post_type_clauses = array();\n\tforeach ( $post_types as $post_type ) {\n\t\t$post_type_obj = get_post_type_object( $post_type );\n\t\tif ( ! $post_type_obj ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t/**\n\t\t * Filters the capability to read private posts for a custom post type\n\t\t * when generating SQL for getting posts by author.\n\t\t *\n\t\t * @since 2.2.0\n\t\t * @deprecated 3.2.0 The hook transitioned from \"somewhat useless\" to \"totally useless\".\n\t\t *\n\t\t * @param string $cap Capability.\n\t\t */\n\t\t$cap = apply_filters_deprecated( 'pub_priv_sql_capability', array( '' ), '3.2.0' );\n\t\tif ( ! $cap ) {\n\t\t\t$cap = current_user_can( $post_type_obj->cap->read_private_posts );\n\t\t}\n\n\t\t// Only need to check the cap if $public_only is false.\n\t\t$post_status_sql = \"post_status = 'publish'\";\n\t\tif ( false === $public_only ) {\n\t\t\tif ( $cap ) {\n\t\t\t\t// Does the user have the capability to view private posts? Guess so.\n\t\t\t\t$post_status_sql .= \" OR post_status = 'private'\";\n\t\t\t} elseif ( is_user_logged_in() ) {\n\t\t\t\t// Users can view their own private posts.\n\t\t\t\t$id = get_current_user_id();\n\t\t\t\tif ( null === $post_author || ! $full ) {\n\t\t\t\t\t$post_status_sql .= \" OR post_status = 'private' AND post_author = $id\";\n\t\t\t\t} elseif ( $id == (int) $post_author ) {\n\t\t\t\t\t$post_status_sql .= \" OR post_status = 'private'\";\n\t\t\t\t} // Else none.\n\t\t\t} // Else none.\n\t\t}\n\n\t\t$post_type_clauses[] = \"( post_type = '\" . $post_type . \"' AND ( $post_status_sql ) )\";\n\t}\n\n\tif ( empty( $post_type_clauses ) ) {\n\t\treturn $full ? 'WHERE 1 = 0' : '1 = 0';\n\t}\n\n\t$sql = '( ' . implode( ' OR ', $post_type_clauses ) . ' )';\n\n\tif ( null !== $post_author ) {\n\t\t$sql .= $wpdb->prepare( ' AND post_author = %d', $post_author );\n\t}\n\n\tif ( $full ) {\n\t\t$sql = 'WHERE ' . $sql;\n\t}\n\n\treturn $sql;\n}\n\n/**\n * Retrieves the most recent time that a post on the site was published.\n *\n * The server timezone is the default and is the difference between GMT and\n * server time. The 'blog' value is the date when the last post was posted.\n * The 'gmt' is when the last post was posted in GMT formatted date.\n *\n * @since 0.71\n * @since 4.4.0 The `$post_type` argument was added.\n *\n * @param string $timezone  Optional. The timezone for the timestamp. Accepts 'server', 'blog', or 'gmt'.\n *                          'server' uses the server's internal timezone.\n *                          'blog' uses the `post_date` field, which proxies to the timezone set for the site.\n *                          'gmt' uses the `post_date_gmt` field.\n *                          Default 'server'.\n * @param string $post_type Optional. The post type to check. Default 'any'.\n * @return string The date of the last post, or false on failure.\n */\nfunction get_lastpostdate( $timezone = 'server', $post_type = 'any' ) {\n\t$lastpostdate = _get_last_post_time( $timezone, 'date', $post_type );\n\n\t/**\n\t * Filters the most recent time that a post on the site was published.\n\t *\n\t * @since 2.3.0\n\t * @since 5.5.0 Added the `$post_type` parameter.\n\t *\n\t * @param string|false $lastpostdate The most recent time that a post was published,\n\t *                                   in 'Y-m-d H:i:s' format. False on failure.\n\t * @param string       $timezone     Location to use for getting the post published date.\n\t *                                   See get_lastpostdate() for accepted `$timezone` values.\n\t * @param string       $post_type    The post type to check.\n\t */\n\treturn apply_filters( 'get_lastpostdate', $lastpostdate, $timezone, $post_type );\n}\n\n/**\n * Get the most recent time that a post on the site was modified.\n *\n * The server timezone is the default and is the difference between GMT and\n * server time. The 'blog' value is just when the last post was modified.\n * The 'gmt' is when the last post was modified in GMT time.\n *\n * @since 1.2.0\n * @since 4.4.0 The `$post_type` argument was added.\n *\n * @param string $timezone  Optional. The timezone for the timestamp. See get_lastpostdate()\n *                          for information on accepted values.\n *                          Default 'server'.\n * @param string $post_type Optional. The post type to check. Default 'any'.\n * @return string The timestamp in 'Y-m-d H:i:s' format, or false on failure.\n */\nfunction get_lastpostmodified( $timezone = 'server', $post_type = 'any' ) {\n\t/**\n\t * Pre-filter the return value of get_lastpostmodified() before the query is run.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string|false $lastpostmodified The most recent time that a post was modified,\n\t *                                       in 'Y-m-d H:i:s' format, or false. Returning anything\n\t *                                       other than false will short-circuit the function.\n\t * @param string       $timezone         Location to use for getting the post modified date.\n\t *                                       See get_lastpostdate() for accepted `$timezone` values.\n\t * @param string       $post_type        The post type to check.\n\t */\n\t$lastpostmodified = apply_filters( 'pre_get_lastpostmodified', false, $timezone, $post_type );\n\n\tif ( false !== $lastpostmodified ) {\n\t\treturn $lastpostmodified;\n\t}\n\n\t$lastpostmodified = _get_last_post_time( $timezone, 'modified', $post_type );\n\t$lastpostdate     = get_lastpostdate( $timezone, $post_type );\n\n\tif ( $lastpostdate > $lastpostmodified ) {\n\t\t$lastpostmodified = $lastpostdate;\n\t}\n\n\t/**\n\t * Filters the most recent time that a post on the site was modified.\n\t *\n\t * @since 2.3.0\n\t * @since 5.5.0 Added the `$post_type` parameter.\n\t *\n\t * @param string|false $lastpostmodified The most recent time that a post was modified,\n\t *                                       in 'Y-m-d H:i:s' format. False on failure.\n\t * @param string       $timezone         Location to use for getting the post modified date.\n\t *                                       See get_lastpostdate() for accepted `$timezone` values.\n\t * @param string       $post_type        The post type to check.\n\t */\n\treturn apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone, $post_type );\n}\n\n/**\n * Gets the timestamp of the last time any post was modified or published.\n *\n * @since 3.1.0\n * @since 4.4.0 The `$post_type` argument was added.\n * @access private\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $timezone  The timezone for the timestamp. See get_lastpostdate().\n *                          for information on accepted values.\n * @param string $field     Post field to check. Accepts 'date' or 'modified'.\n * @param string $post_type Optional. The post type to check. Default 'any'.\n * @return string|false The timestamp in 'Y-m-d H:i:s' format, or false on failure.\n */\nfunction _get_last_post_time( $timezone, $field, $post_type = 'any' ) {\n\tglobal $wpdb;\n\n\tif ( ! in_array( $field, array( 'date', 'modified' ), true ) ) {\n\t\treturn false;\n\t}\n\n\t$timezone = strtolower( $timezone );\n\n\t$key = \"lastpost{$field}:$timezone\";\n\tif ( 'any' !== $post_type ) {\n\t\t$key .= ':' . sanitize_key( $post_type );\n\t}\n\n\t$date = wp_cache_get( $key, 'timeinfo' );\n\tif ( false !== $date ) {\n\t\treturn $date;\n\t}\n\n\tif ( 'any' === $post_type ) {\n\t\t$post_types = get_post_types( array( 'public' => true ) );\n\t\tarray_walk( $post_types, array( $wpdb, 'escape_by_ref' ) );\n\t\t$post_types = \"'\" . implode( \"', '\", $post_types ) . \"'\";\n\t} else {\n\t\t$post_types = \"'\" . sanitize_key( $post_type ) . \"'\";\n\t}\n\n\tswitch ( $timezone ) {\n\t\tcase 'gmt':\n\t\t\t$date = $wpdb->get_var( \"SELECT post_{$field}_gmt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt DESC LIMIT 1\" );\n\t\t\tbreak;\n\t\tcase 'blog':\n\t\t\t$date = $wpdb->get_var( \"SELECT post_{$field} FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt DESC LIMIT 1\" );\n\t\t\tbreak;\n\t\tcase 'server':\n\t\t\t$add_seconds_server = gmdate( 'Z' );\n\t\t\t$date               = $wpdb->get_var( \"SELECT DATE_ADD(post_{$field}_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt DESC LIMIT 1\" );\n\t\t\tbreak;\n\t}\n\n\tif ( $date ) {\n\t\twp_cache_set( $key, $date, 'timeinfo' );\n\n\t\treturn $date;\n\t}\n\n\treturn false;\n}\n\n/**\n * Updates posts in cache.\n *\n * @since 1.5.1\n *\n * @param WP_Post[] $posts Array of post objects (passed by reference).\n */\nfunction update_post_cache( &$posts ) {\n\tif ( ! $posts ) {\n\t\treturn;\n\t}\n\n\tforeach ( $posts as $post ) {\n\t\twp_cache_add( $post->ID, $post, 'posts' );\n\t}\n}\n\n/**\n * Will clean the post in the cache.\n *\n * Cleaning means delete from the cache of the post. Will call to clean the term\n * object cache associated with the post ID.\n *\n * This function not run if $_wp_suspend_cache_invalidation is not empty. See\n * wp_suspend_cache_invalidation().\n *\n * @since 2.0.0\n *\n * @global bool $_wp_suspend_cache_invalidation\n *\n * @param int|WP_Post $post Post ID or post object to remove from the cache.\n */\nfunction clean_post_cache( $post ) {\n\tglobal $_wp_suspend_cache_invalidation;\n\n\tif ( ! empty( $_wp_suspend_cache_invalidation ) ) {\n\t\treturn;\n\t}\n\n\t$post = get_post( $post );\n\tif ( empty( $post ) ) {\n\t\treturn;\n\t}\n\n\twp_cache_delete( $post->ID, 'posts' );\n\twp_cache_delete( $post->ID, 'post_meta' );\n\n\tclean_object_term_cache( $post->ID, $post->post_type );\n\n\twp_cache_delete( 'wp_get_archives', 'general' );\n\n\t/**\n\t * Fires immediately after the given post's cache is cleaned.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param int     $post_id Post ID.\n\t * @param WP_Post $post    Post object.\n\t */\n\tdo_action( 'clean_post_cache', $post->ID, $post );\n\n\tif ( 'page' === $post->post_type ) {\n\t\twp_cache_delete( 'all_page_ids', 'posts' );\n\n\t\t/**\n\t\t * Fires immediately after the given page's cache is cleaned.\n\t\t *\n\t\t * @since 2.5.0\n\t\t *\n\t\t * @param int $post_id Post ID.\n\t\t */\n\t\tdo_action( 'clean_page_cache', $post->ID );\n\t}\n\n\twp_cache_set( 'last_changed', microtime(), 'posts' );\n}\n\n/**\n * Call major cache updating functions for list of Post objects.\n *\n * @since 1.5.0\n *\n * @param WP_Post[] $posts             Array of Post objects\n * @param string    $post_type         Optional. Post type. Default 'post'.\n * @param bool      $update_term_cache Optional. Whether to update the term cache. Default true.\n * @param bool      $update_meta_cache Optional. Whether to update the meta cache. Default true.\n */\nfunction update_post_caches( &$posts, $post_type = 'post', $update_term_cache = true, $update_meta_cache = true ) {\n\t// No point in doing all this work if we didn't match any posts.\n\tif ( ! $posts ) {\n\t\treturn;\n\t}\n\n\tupdate_post_cache( $posts );\n\n\t$post_ids = array();\n\tforeach ( $posts as $post ) {\n\t\t$post_ids[] = $post->ID;\n\t}\n\n\tif ( ! $post_type ) {\n\t\t$post_type = 'any';\n\t}\n\n\tif ( $update_term_cache ) {\n\t\tif ( is_array( $post_type ) ) {\n\t\t\t$ptypes = $post_type;\n\t\t} elseif ( 'any' === $post_type ) {\n\t\t\t$ptypes = array();\n\t\t\t// Just use the post_types in the supplied posts.\n\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t$ptypes[] = $post->post_type;\n\t\t\t}\n\t\t\t$ptypes = array_unique( $ptypes );\n\t\t} else {\n\t\t\t$ptypes = array( $post_type );\n\t\t}\n\n\t\tif ( ! empty( $ptypes ) ) {\n\t\t\tupdate_object_term_cache( $post_ids, $ptypes );\n\t\t}\n\t}\n\n\tif ( $update_meta_cache ) {\n\t\tupdate_postmeta_cache( $post_ids );\n\t}\n}\n\n/**\n * Updates metadata cache for list of post IDs.\n *\n * Performs SQL query to retrieve the metadata for the post IDs and updates the\n * metadata cache for the posts. Therefore, the functions, which call this\n * function, do not need to perform SQL queries on their own.\n *\n * @since 2.1.0\n *\n * @param int[] $post_ids Array of post IDs.\n * @return array|false An array of metadata on success, false if there is nothing to update.\n */\nfunction update_postmeta_cache( $post_ids ) {\n\treturn update_meta_cache( 'post', $post_ids );\n}\n\n/**\n * Will clean the attachment in the cache.\n *\n * Cleaning means delete from the cache. Optionally will clean the term\n * object cache associated with the attachment ID.\n *\n * This function will not run if $_wp_suspend_cache_invalidation is not empty.\n *\n * @since 3.0.0\n *\n * @global bool $_wp_suspend_cache_invalidation\n *\n * @param int  $id          The attachment ID in the cache to clean.\n * @param bool $clean_terms Optional. Whether to clean terms cache. Default false.\n */\nfunction clean_attachment_cache( $id, $clean_terms = false ) {\n\tglobal $_wp_suspend_cache_invalidation;\n\n\tif ( ! empty( $_wp_suspend_cache_invalidation ) ) {\n\t\treturn;\n\t}\n\n\t$id = (int) $id;\n\n\twp_cache_delete( $id, 'posts' );\n\twp_cache_delete( $id, 'post_meta' );\n\n\tif ( $clean_terms ) {\n\t\tclean_object_term_cache( $id, 'attachment' );\n\t}\n\n\t/**\n\t * Fires after the given attachment's cache is cleaned.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param int $id Attachment ID.\n\t */\n\tdo_action( 'clean_attachment_cache', $id );\n}\n\n//\n// Hooks.\n//\n\n/**\n * Hook for managing future post transitions to published.\n *\n * @since 2.3.0\n * @access private\n *\n * @see wp_clear_scheduled_hook()\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string  $new_status New post status.\n * @param string  $old_status Previous post status.\n * @param WP_Post $post       Post object.\n */\nfunction _transition_post_status( $new_status, $old_status, $post ) {\n\tglobal $wpdb;\n\n\tif ( 'publish' !== $old_status && 'publish' === $new_status ) {\n\t\t// Reset GUID if transitioning to publish and it is empty.\n\t\tif ( '' === get_the_guid( $post->ID ) ) {\n\t\t\t$wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) );\n\t\t}\n\n\t\t/**\n\t\t * Fires when a post's status is transitioned from private to published.\n\t\t *\n\t\t * @since 1.5.0\n\t\t * @deprecated 2.3.0 Use {@see 'private_to_publish'} instead.\n\t\t *\n\t\t * @param int $post_id Post ID.\n\t\t */\n\t\tdo_action_deprecated( 'private_to_published', array( $post->ID ), '2.3.0', 'private_to_publish' );\n\t}\n\n\t// If published posts changed clear the lastpostmodified cache.\n\tif ( 'publish' === $new_status || 'publish' === $old_status ) {\n\t\tforeach ( array( 'server', 'gmt', 'blog' ) as $timezone ) {\n\t\t\twp_cache_delete( \"lastpostmodified:$timezone\", 'timeinfo' );\n\t\t\twp_cache_delete( \"lastpostdate:$timezone\", 'timeinfo' );\n\t\t\twp_cache_delete( \"lastpostdate:$timezone:{$post->post_type}\", 'timeinfo' );\n\t\t}\n\t}\n\n\tif ( $new_status !== $old_status ) {\n\t\twp_cache_delete( _count_posts_cache_key( $post->post_type ), 'counts' );\n\t\twp_cache_delete( _count_posts_cache_key( $post->post_type, 'readable' ), 'counts' );\n\t}\n\n\t// Always clears the hook in case the post status bounced from future to draft.\n\twp_clear_scheduled_hook( 'publish_future_post', array( $post->ID ) );\n}\n\n/**\n * Hook used to schedule publication for a post marked for the future.\n *\n * The $post properties used and must exist are 'ID' and 'post_date_gmt'.\n *\n * @since 2.3.0\n * @access private\n *\n * @param int     $deprecated Not used. Can be set to null. Never implemented. Not marked\n *                            as deprecated with _deprecated_argument() as it conflicts with\n *                            wp_transition_post_status() and the default filter for _future_post_hook().\n * @param WP_Post $post       Post object.\n */\nfunction _future_post_hook( $deprecated, $post ) {\n\twp_clear_scheduled_hook( 'publish_future_post', array( $post->ID ) );\n\twp_schedule_single_event( strtotime( get_gmt_from_date( $post->post_date ) . ' GMT' ), 'publish_future_post', array( $post->ID ) );\n}\n\n/**\n * Hook to schedule pings and enclosures when a post is published.\n *\n * Uses XMLRPC_REQUEST and WP_IMPORTING constants.\n *\n * @since 2.3.0\n * @access private\n *\n * @param int $post_id The ID in the database table of the post being published.\n */\nfunction _publish_post_hook( $post_id ) {\n\tif ( defined( 'XMLRPC_REQUEST' ) ) {\n\t\t/**\n\t\t * Fires when _publish_post_hook() is called during an XML-RPC request.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param int $post_id Post ID.\n\t\t */\n\t\tdo_action( 'xmlrpc_publish_post', $post_id );\n\t}\n\n\tif ( defined( 'WP_IMPORTING' ) ) {\n\t\treturn;\n\t}\n\n\tif ( get_option( 'default_pingback_flag' ) ) {\n\t\tadd_post_meta( $post_id, '_pingme', '1', true );\n\t}\n\tadd_post_meta( $post_id, '_encloseme', '1', true );\n\n\t$to_ping = get_to_ping( $post_id );\n\tif ( ! empty( $to_ping ) ) {\n\t\tadd_post_meta( $post_id, '_trackbackme', '1' );\n\t}\n\n\tif ( ! wp_next_scheduled( 'do_pings' ) ) {\n\t\twp_schedule_single_event( time(), 'do_pings' );\n\t}\n}\n\n/**\n * Returns the ID of the post's parent.\n *\n * @since 3.1.0\n *\n * @param int|WP_Post $post Post ID or post object. Defaults to global $post.\n * @return int|false Post parent ID (which can be 0 if there is no parent),\n *                   or false if the post does not exist.\n */\nfunction wp_get_post_parent_id( $post ) {\n\t$post = get_post( $post );\n\tif ( ! $post || is_wp_error( $post ) ) {\n\t\treturn false;\n\t}\n\treturn (int) $post->post_parent;\n}\n\n/**\n * Check the given subset of the post hierarchy for hierarchy loops.\n *\n * Prevents loops from forming and breaks those that it finds. Attached\n * to the {@see 'wp_insert_post_parent'} filter.\n *\n * @since 3.1.0\n *\n * @see wp_find_hierarchy_loop()\n *\n * @param int $post_parent ID of the parent for the post we're checking.\n * @param int $post_ID     ID of the post we're checking.\n * @return int The new post_parent for the post, 0 otherwise.\n */\nfunction wp_check_post_hierarchy_for_loops( $post_parent, $post_ID ) {\n\t// Nothing fancy here - bail.\n\tif ( ! $post_parent ) {\n\t\treturn 0;\n\t}\n\n\t// New post can't cause a loop.\n\tif ( empty( $post_ID ) ) {\n\t\treturn $post_parent;\n\t}\n\n\t// Can't be its own parent.\n\tif ( $post_parent == $post_ID ) {\n\t\treturn 0;\n\t}\n\n\t// Now look for larger loops.\n\t$loop = wp_find_hierarchy_loop( 'wp_get_post_parent_id', $post_ID, $post_parent );\n\tif ( ! $loop ) {\n\t\treturn $post_parent; // No loop.\n\t}\n\n\t// Setting $post_parent to the given value causes a loop.\n\tif ( isset( $loop[ $post_ID ] ) ) {\n\t\treturn 0;\n\t}\n\n\t// There's a loop, but it doesn't contain $post_ID. Break the loop.\n\tforeach ( array_keys( $loop ) as $loop_member ) {\n\t\twp_update_post(\n\t\t\tarray(\n\t\t\t\t'ID'          => $loop_member,\n\t\t\t\t'post_parent' => 0,\n\t\t\t)\n\t\t);\n\t}\n\n\treturn $post_parent;\n}\n\n/**\n * Sets the post thumbnail (featured image) for the given post.\n *\n * @since 3.1.0\n *\n * @param int|WP_Post $post         Post ID or post object where thumbnail should be attached.\n * @param int         $thumbnail_id Thumbnail to attach.\n * @return int|bool True on success, false on failure.\n */\nfunction set_post_thumbnail( $post, $thumbnail_id ) {\n\t$post         = get_post( $post );\n\t$thumbnail_id = absint( $thumbnail_id );\n\tif ( $post && $thumbnail_id && get_post( $thumbnail_id ) ) {\n\t\tif ( wp_get_attachment_image( $thumbnail_id, 'thumbnail' ) ) {\n\t\t\treturn update_post_meta( $post->ID, '_thumbnail_id', $thumbnail_id );\n\t\t} else {\n\t\t\treturn delete_post_meta( $post->ID, '_thumbnail_id' );\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Removes the thumbnail (featured image) from the given post.\n *\n * @since 3.3.0\n *\n * @param int|WP_Post $post Post ID or post object from which the thumbnail should be removed.\n * @return bool True on success, false on failure.\n */\nfunction delete_post_thumbnail( $post ) {\n\t$post = get_post( $post );\n\tif ( $post ) {\n\t\treturn delete_post_meta( $post->ID, '_thumbnail_id' );\n\t}\n\treturn false;\n}\n\n/**\n * Delete auto-drafts for new posts that are > 7 days old.\n *\n * @since 3.4.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction wp_delete_auto_drafts() {\n\tglobal $wpdb;\n\n\t// Cleanup old auto-drafts more than 7 days old.\n\t$old_posts = $wpdb->get_col( \"SELECT ID FROM $wpdb->posts WHERE post_status = 'auto-draft' AND DATE_SUB( NOW(), INTERVAL 7 DAY ) > post_date\" );\n\tforeach ( (array) $old_posts as $delete ) {\n\t\t// Force delete.\n\t\twp_delete_post( $delete, true );\n\t}\n}\n\n/**\n * Queues posts for lazy-loading of term meta.\n *\n * @since 4.5.0\n *\n * @param array $posts Array of WP_Post objects.\n */\nfunction wp_queue_posts_for_term_meta_lazyload( $posts ) {\n\t$post_type_taxonomies = array();\n\t$term_ids             = array();\n\tforeach ( $posts as $post ) {\n\t\tif ( ! ( $post instanceof WP_Post ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( ! isset( $post_type_taxonomies[ $post->post_type ] ) ) {\n\t\t\t$post_type_taxonomies[ $post->post_type ] = get_object_taxonomies( $post->post_type );\n\t\t}\n\n\t\tforeach ( $post_type_taxonomies[ $post->post_type ] as $taxonomy ) {\n\t\t\t// Term cache should already be primed by `update_post_term_cache()`.\n\t\t\t$terms = get_object_term_cache( $post->ID, $taxonomy );\n\t\t\tif ( false !== $terms ) {\n\t\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t\tif ( ! isset( $term_ids[ $term->term_id ] ) ) {\n\t\t\t\t\t\t$term_ids[] = $term->term_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( $term_ids ) {\n\t\t$lazyloader = wp_metadata_lazyloader();\n\t\t$lazyloader->queue_objects( 'term', $term_ids );\n\t}\n}\n\n/**\n * Update the custom taxonomies' term counts when a post's status is changed.\n *\n * For example, default posts term counts (for custom taxonomies) don't include\n * private / draft posts.\n *\n * @since 3.3.0\n * @access private\n *\n * @param string  $new_status New post status.\n * @param string  $old_status Old post status.\n * @param WP_Post $post       Post object.\n */\nfunction _update_term_count_on_transition_post_status( $new_status, $old_status, $post ) {\n\t// Update counts for the post's terms.\n\tforeach ( (array) get_object_taxonomies( $post->post_type ) as $taxonomy ) {\n\t\t$tt_ids = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'tt_ids' ) );\n\t\twp_update_term_count( $tt_ids, $taxonomy );\n\t}\n}\n\n/**\n * Adds any posts from the given IDs to the cache that do not already exist in cache\n *\n * @since 3.4.0\n * @access private\n *\n * @see update_post_caches()\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param array $ids               ID list.\n * @param bool  $update_term_cache Optional. Whether to update the term cache. Default true.\n * @param bool  $update_meta_cache Optional. Whether to update the meta cache. Default true.\n */\nfunction _prime_post_caches( $ids, $update_term_cache = true, $update_meta_cache = true ) {\n\tglobal $wpdb;\n\n\t$non_cached_ids = _get_non_cached_ids( $ids, 'posts' );\n\tif ( ! empty( $non_cached_ids ) ) {\n\t\t$fresh_posts = $wpdb->get_results( sprintf( \"SELECT $wpdb->posts.* FROM $wpdb->posts WHERE ID IN (%s)\", join( ',', $non_cached_ids ) ) );\n\n\t\tupdate_post_caches( $fresh_posts, 'any', $update_term_cache, $update_meta_cache );\n\t}\n}\n\n/**\n * Adds a suffix if any trashed posts have a given slug.\n *\n * Store its desired (i.e. current) slug so it can try to reclaim it\n * if the post is untrashed.\n *\n * For internal use.\n *\n * @since 4.5.0\n * @access private\n *\n * @param string $post_name Slug.\n * @param string $post_ID   Optional. Post ID that should be ignored. Default 0.\n */\nfunction wp_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $post_ID = 0 ) {\n\t$trashed_posts_with_desired_slug = get_posts(\n\t\tarray(\n\t\t\t'name'         => $post_name,\n\t\t\t'post_status'  => 'trash',\n\t\t\t'post_type'    => 'any',\n\t\t\t'nopaging'     => true,\n\t\t\t'post__not_in' => array( $post_ID ),\n\t\t)\n\t);\n\n\tif ( ! empty( $trashed_posts_with_desired_slug ) ) {\n\t\tforeach ( $trashed_posts_with_desired_slug as $_post ) {\n\t\t\twp_add_trashed_suffix_to_post_name_for_post( $_post );\n\t\t}\n\t}\n}\n\n/**\n * Adds a trashed suffix for a given post.\n *\n * Store its desired (i.e. current) slug so it can try to reclaim it\n * if the post is untrashed.\n *\n * For internal use.\n *\n * @since 4.5.0\n * @access private\n *\n * @param WP_Post $post The post.\n * @return string New slug for the post.\n */\nfunction wp_add_trashed_suffix_to_post_name_for_post( $post ) {\n\tglobal $wpdb;\n\n\t$post = get_post( $post );\n\n\tif ( '__trashed' === substr( $post->post_name, -9 ) ) {\n\t\treturn $post->post_name;\n\t}\n\tadd_post_meta( $post->ID, '_wp_desired_post_slug', $post->post_name );\n\t$post_name = _truncate_post_slug( $post->post_name, 191 ) . '__trashed';\n\t$wpdb->update( $wpdb->posts, array( 'post_name' => $post_name ), array( 'ID' => $post->ID ) );\n\tclean_post_cache( $post->ID );\n\treturn $post_name;\n}\n\n/**\n * Filter the SQL clauses of an attachment query to include filenames.\n *\n * @since 4.7.0\n * @access private\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string[] $clauses An array including WHERE, GROUP BY, JOIN, ORDER BY,\n *                          DISTINCT, fields (SELECT), and LIMITS clauses.\n * @return string[] The modified array of clauses.\n */\nfunction _filter_query_attachment_filenames( $clauses ) {\n\tglobal $wpdb;\n\tremove_filter( 'posts_clauses', __FUNCTION__ );\n\n\t// Add a LEFT JOIN of the postmeta table so we don't trample existing JOINs.\n\t$clauses['join'] .= \" LEFT JOIN {$wpdb->postmeta} AS sq1 ON ( {$wpdb->posts}.ID = sq1.post_id AND sq1.meta_key = '_wp_attached_file' )\";\n\n\t$clauses['groupby'] = \"{$wpdb->posts}.ID\";\n\n\t$clauses['where'] = preg_replace(\n\t\t\"/\\({$wpdb->posts}.post_content (NOT LIKE|LIKE) (\\'[^']+\\')\\)/\",\n\t\t'$0 OR ( sq1.meta_value $1 $2 )',\n\t\t$clauses['where']\n\t);\n\n\treturn $clauses;\n}\n\n/**\n * Sets the last changed time for the 'posts' cache group.\n *\n * @since 5.0.0\n */\nfunction wp_cache_set_posts_last_changed() {\n\twp_cache_set( 'last_changed', microtime(), 'posts' );\n}\n\n/**\n * Get all available post MIME types for a given post type.\n *\n * @since 2.5.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $type\n * @return mixed\n */\nfunction get_available_post_mime_types( $type = 'attachment' ) {\n\tglobal $wpdb;\n\n\t$types = $wpdb->get_col( $wpdb->prepare( \"SELECT DISTINCT post_mime_type FROM $wpdb->posts WHERE post_type = %s\", $type ) );\n\treturn $types;\n}\n\n/**\n * Retrieves the path to an uploaded image file.\n *\n * Similar to `get_attached_file()` however some images may have been processed after uploading\n * to make them suitable for web use. In this case the attached \"full\" size file is usually replaced\n * with a scaled down version of the original image. This function always returns the path\n * to the originally uploaded image file.\n *\n * @since 5.3.0\n * @since 5.4.0 Added the `$unfiltered` parameter.\n *\n * @param int  $attachment_id Attachment ID.\n * @param bool $unfiltered Optional. Passed through to `get_attached_file()`. Default false.\n * @return string|false Path to the original image file or false if the attachment is not an image.\n */\nfunction wp_get_original_image_path( $attachment_id, $unfiltered = false ) {\n\tif ( ! wp_attachment_is_image( $attachment_id ) ) {\n\t\treturn false;\n\t}\n\n\t$image_meta = wp_get_attachment_metadata( $attachment_id );\n\t$image_file = get_attached_file( $attachment_id, $unfiltered );\n\n\tif ( empty( $image_meta['original_image'] ) ) {\n\t\t$original_image = $image_file;\n\t} else {\n\t\t$original_image = path_join( dirname( $image_file ), $image_meta['original_image'] );\n\t}\n\n\t/**\n\t * Filters the path to the original image.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param string $original_image Path to original image file.\n\t * @param int    $attachment_id  Attachment ID.\n\t */\n\treturn apply_filters( 'wp_get_original_image_path', $original_image, $attachment_id );\n}\n\n/**\n * Retrieve the URL to an original attachment image.\n *\n * Similar to `wp_get_attachment_url()` however some images may have been\n * processed after uploading. In this case this function returns the URL\n * to the originally uploaded image file.\n *\n * @since 5.3.0\n *\n * @param int $attachment_id Attachment post ID.\n * @return string|false Attachment image URL, false on error or if the attachment is not an image.\n */\nfunction wp_get_original_image_url( $attachment_id ) {\n\tif ( ! wp_attachment_is_image( $attachment_id ) ) {\n\t\treturn false;\n\t}\n\n\t$image_url = wp_get_attachment_url( $attachment_id );\n\n\tif ( empty( $image_url ) ) {\n\t\treturn false;\n\t}\n\n\t$image_meta = wp_get_attachment_metadata( $attachment_id );\n\n\tif ( empty( $image_meta['original_image'] ) ) {\n\t\t$original_image_url = $image_url;\n\t} else {\n\t\t$original_image_url = path_join( dirname( $image_url ), $image_meta['original_image'] );\n\t}\n\n\t/**\n\t * Filters the URL to the original attachment image.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param string $original_image_url URL to original image.\n\t * @param int    $attachment_id      Attachment ID.\n\t */\n\treturn apply_filters( 'wp_get_original_image_url', $original_image_url, $attachment_id );\n}\n", "num_lines": 7469}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Query API\n *\n * The query API attempts to get which part of WordPress the user is on. It\n * also provides functionality for getting URL query information.\n *\n * @link https://developer.wordpress.org/themes/basics/the-loop/ More information on The Loop.\n *\n * @package WordPress\n * @subpackage Query\n */\n\n/**\n * Retrieve variable in the WP_Query class.\n *\n * @since 1.5.0\n * @since 3.9.0 The `$default` argument was introduced.\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param string $var       The variable key to retrieve.\n * @param mixed  $default   Optional. Value to return if the query variable is not set. Default empty.\n * @return mixed Contents of the query variable.\n */\nfunction get_query_var( $var, $default = '' ) {\n\tglobal $wp_query;\n\treturn $wp_query->get( $var, $default );\n}\n\n/**\n * Retrieve the currently-queried object.\n *\n * Wrapper for WP_Query::get_queried_object().\n *\n * @since 3.1.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return object Queried object.\n */\nfunction get_queried_object() {\n\tglobal $wp_query;\n\treturn $wp_query->get_queried_object();\n}\n\n/**\n * Retrieve ID of the current queried object.\n *\n * Wrapper for WP_Query::get_queried_object_id().\n *\n * @since 3.1.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return int ID of the queried object.\n */\nfunction get_queried_object_id() {\n\tglobal $wp_query;\n\treturn $wp_query->get_queried_object_id();\n}\n\n/**\n * Set query variable.\n *\n * @since 2.2.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param string $var   Query variable key.\n * @param mixed  $value Query variable value.\n */\nfunction set_query_var( $var, $value ) {\n\tglobal $wp_query;\n\t$wp_query->set( $var, $value );\n}\n\n/**\n * Sets up The Loop with query parameters.\n *\n * Note: This function will completely override the main query and isn't intended for use\n * by plugins or themes. Its overly-simplistic approach to modifying the main query can be\n * problematic and should be avoided wherever possible. In most cases, there are better,\n * more performant options for modifying the main query such as via the {@see 'pre_get_posts'}\n * action within WP_Query.\n *\n * This must not be used within the WordPress Loop.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param array|string $query Array or string of WP_Query arguments.\n * @return WP_Post[]|int[] Array of post objects or post IDs.\n */\nfunction query_posts( $query ) {\n\t$GLOBALS['wp_query'] = new WP_Query();\n\treturn $GLOBALS['wp_query']->query( $query );\n}\n\n/**\n * Destroys the previous query and sets up a new query.\n *\n * This should be used after query_posts() and before another query_posts().\n * This will remove obscure bugs that occur when the previous WP_Query object\n * is not destroyed properly before another is set up.\n *\n * @since 2.3.0\n *\n * @global WP_Query $wp_query     WordPress Query object.\n * @global WP_Query $wp_the_query Copy of the global WP_Query instance created during wp_reset_query().\n */\nfunction wp_reset_query() {\n\t$GLOBALS['wp_query'] = $GLOBALS['wp_the_query'];\n\twp_reset_postdata();\n}\n\n/**\n * After looping through a separate query, this function restores\n * the $post global to the current post in the main query.\n *\n * @since 3.0.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n */\nfunction wp_reset_postdata() {\n\tglobal $wp_query;\n\n\tif ( isset( $wp_query ) ) {\n\t\t$wp_query->reset_postdata();\n\t}\n}\n\n/*\n * Query type checks.\n */\n\n/**\n * Determines whether the query is for an existing archive page.\n *\n * Month, Year, Category, Author, Post Type archive...\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for an existing archive page.\n */\nfunction is_archive() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_archive();\n}\n\n/**\n * Determines whether the query is for an existing post type archive page.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 3.1.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param string|string[] $post_types Optional. Post type or array of posts types\n *                                    to check against. Default empty.\n * @return bool Whether the query is for an existing post type archive page.\n */\nfunction is_post_type_archive( $post_types = '' ) {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_post_type_archive( $post_types );\n}\n\n/**\n * Determines whether the query is for an existing attachment page.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.0.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param int|string|int[]|string[] $attachment Optional. Attachment ID, title, slug, or array of such\n *                                              to check against. Default empty.\n * @return bool Whether the query is for an existing attachment page.\n */\nfunction is_attachment( $attachment = '' ) {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_attachment( $attachment );\n}\n\n/**\n * Determines whether the query is for an existing author archive page.\n *\n * If the $author parameter is specified, this function will additionally\n * check if the query is for one of the authors specified.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param int|string|int[]|string[] $author Optional. User ID, nickname, nicename, or array of such\n *                                          to check against. Default empty.\n * @return bool Whether the query is for an existing author archive page.\n */\nfunction is_author( $author = '' ) {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_author( $author );\n}\n\n/**\n * Determines whether the query is for an existing category archive page.\n *\n * If the $category parameter is specified, this function will additionally\n * check if the query is for one of the categories specified.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param int|string|int[]|string[] $category Optional. Category ID, name, slug, or array of such\n *                                            to check against. Default empty.\n * @return bool Whether the query is for an existing category archive page.\n */\nfunction is_category( $category = '' ) {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_category( $category );\n}\n\n/**\n * Determines whether the query is for an existing tag archive page.\n *\n * If the $tag parameter is specified, this function will additionally\n * check if the query is for one of the tags specified.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.3.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param int|string|int[]|string[] $tag Optional. Tag ID, name, slug, or array of such\n *                                       to check against. Default empty.\n * @return bool Whether the query is for an existing tag archive page.\n */\nfunction is_tag( $tag = '' ) {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_tag( $tag );\n}\n\n/**\n * Determines whether the query is for an existing custom taxonomy archive page.\n *\n * If the $taxonomy parameter is specified, this function will additionally\n * check if the query is for that specific $taxonomy.\n *\n * If the $term parameter is specified in addition to the $taxonomy parameter,\n * this function will additionally check if the query is for one of the terms\n * specified.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param string|string[]           $taxonomy Optional. Taxonomy slug or slugs to check against.\n *                                            Default empty.\n * @param int|string|int[]|string[] $term     Optional. Term ID, name, slug, or array of such\n *                                            to check against. Default empty.\n * @return bool Whether the query is for an existing custom taxonomy archive page.\n *              True for custom taxonomy archive pages, false for built-in taxonomies\n *              (category and tag archives).\n */\nfunction is_tax( $taxonomy = '', $term = '' ) {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_tax( $taxonomy, $term );\n}\n\n/**\n * Determines whether the query is for an existing date archive.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for an existing date archive.\n */\nfunction is_date() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_date();\n}\n\n/**\n * Determines whether the query is for an existing day archive.\n *\n * A conditional check to test whether the page is a date-based archive page displaying posts for the current day.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for an existing day archive.\n */\nfunction is_day() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_day();\n}\n\n/**\n * Determines whether the query is for a feed.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param string|string[] $feeds Optional. Feed type or array of feed types\n *                                         to check against. Default empty.\n * @return bool Whether the query is for a feed.\n */\nfunction is_feed( $feeds = '' ) {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_feed( $feeds );\n}\n\n/**\n * Is the query for a comments feed?\n *\n * @since 3.0.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for a comments feed.\n */\nfunction is_comment_feed() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_comment_feed();\n}\n\n/**\n * Determines whether the query is for the front page of the site.\n *\n * This is for what is displayed at your site's main URL.\n *\n * Depends on the site's \"Front page displays\" Reading Settings 'show_on_front' and 'page_on_front'.\n *\n * If you set a static page for the front page of your site, this function will return\n * true when viewing that page.\n *\n * Otherwise the same as @see is_home()\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for the front page of the site.\n */\nfunction is_front_page() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_front_page();\n}\n\n/**\n * Determines whether the query is for the blog homepage.\n *\n * The blog homepage is the page that shows the time-based blog content of the site.\n *\n * is_home() is dependent on the site's \"Front page displays\" Reading Settings 'show_on_front'\n * and 'page_for_posts'.\n *\n * If a static page is set for the front page of the site, this function will return true only\n * on the page you set as the \"Posts page\".\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n *\n * @see is_front_page()\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for the blog homepage.\n */\nfunction is_home() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_home();\n}\n\n/**\n * Determines whether the query is for the Privacy Policy page.\n *\n * The Privacy Policy page is the page that shows the Privacy Policy content of the site.\n *\n * is_privacy_policy() is dependent on the site's \"Change your Privacy Policy page\" Privacy Settings 'wp_page_for_privacy_policy'.\n *\n * This function will return true only on the page you set as the \"Privacy Policy page\".\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 5.2.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for the Privacy Policy page.\n */\nfunction is_privacy_policy() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_privacy_policy();\n}\n\n/**\n * Determines whether the query is for an existing month archive.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for an existing month archive.\n */\nfunction is_month() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_month();\n}\n\n/**\n * Determines whether the query is for an existing single page.\n *\n * If the $page parameter is specified, this function will additionally\n * check if the query is for one of the pages specified.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @see is_single()\n * @see is_singular()\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param int|string|int[]|string[] $page Optional. Page ID, title, slug, or array of such\n *                                        to check against. Default empty.\n * @return bool Whether the query is for an existing single page.\n */\nfunction is_page( $page = '' ) {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_page( $page );\n}\n\n/**\n * Determines whether the query is for a paged result and not for the first page.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for a paged result.\n */\nfunction is_paged() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_paged();\n}\n\n/**\n * Determines whether the query is for a post or page preview.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.0.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for a post or page preview.\n */\nfunction is_preview() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_preview();\n}\n\n/**\n * Is the query for the robots.txt file?\n *\n * @since 2.1.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for the robots.txt file.\n */\nfunction is_robots() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_robots();\n}\n\n/**\n * Is the query for the favicon.ico file?\n *\n * @since 5.4.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for the favicon.ico file.\n */\nfunction is_favicon() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_favicon();\n}\n\n/**\n * Determines whether the query is for a search.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for a search.\n */\nfunction is_search() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_search();\n}\n\n/**\n * Determines whether the query is for an existing single post.\n *\n * Works for any post type, except attachments and pages\n *\n * If the $post parameter is specified, this function will additionally\n * check if the query is for one of the Posts specified.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @see is_page()\n * @see is_singular()\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param int|string|int[]|string[] $post Optional. Post ID, title, slug, or array of such\n *                                        to check against. Default empty.\n * @return bool Whether the query is for an existing single post.\n */\nfunction is_single( $post = '' ) {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_single( $post );\n}\n\n/**\n * Determines whether the query is for an existing single post of any post type\n * (post, attachment, page, custom post types).\n *\n * If the $post_types parameter is specified, this function will additionally\n * check if the query is for one of the Posts Types specified.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @see is_page()\n * @see is_single()\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param string|string[] $post_types Optional. Post type or array of post types\n *                                    to check against. Default empty.\n * @return bool Whether the query is for an existing single post\n *              or any of the given post types.\n */\nfunction is_singular( $post_types = '' ) {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_singular( $post_types );\n}\n\n/**\n * Determines whether the query is for a specific time.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for a specific time.\n */\nfunction is_time() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_time();\n}\n\n/**\n * Determines whether the query is for a trackback endpoint call.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for a trackback endpoint call.\n */\nfunction is_trackback() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_trackback();\n}\n\n/**\n * Determines whether the query is for an existing year archive.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for an existing year archive.\n */\nfunction is_year() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_year();\n}\n\n/**\n * Determines whether the query has resulted in a 404 (returns no results).\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is a 404 error.\n */\nfunction is_404() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_404();\n}\n\n/**\n * Is the query for an embedded post?\n *\n * @since 4.4.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is for an embedded post.\n */\nfunction is_embed() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_embed();\n}\n\n/**\n * Determines whether the query is the main query.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 3.3.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool Whether the query is the main query.\n */\nfunction is_main_query() {\n\tif ( 'pre_get_posts' === current_filter() ) {\n\t\t$message = sprintf(\n\t\t\t/* translators: 1: pre_get_posts, 2: WP_Query->is_main_query(), 3: is_main_query(), 4: Link to codex is_main_query() page. */\n\t\t\t__( 'In %1$s, use the %2$s method, not the %3$s function. See %4$s.' ),\n\t\t\t'<code>pre_get_posts</code>',\n\t\t\t'<code>WP_Query->is_main_query()</code>',\n\t\t\t'<code>is_main_query()</code>',\n\t\t\t__( 'https://codex.wordpress.org/Function_Reference/is_main_query' )\n\t\t);\n\t\t_doing_it_wrong( __FUNCTION__, $message, '3.7.0' );\n\t}\n\n\tglobal $wp_query;\n\treturn $wp_query->is_main_query();\n}\n\n/*\n * The Loop. Post loop control.\n */\n\n/**\n * Determines whether current WordPress query has posts to loop over.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool True if posts are available, false if end of the loop.\n */\nfunction have_posts() {\n\tglobal $wp_query;\n\treturn $wp_query->have_posts();\n}\n\n/**\n * Determines whether the caller is in the Loop.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.0.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool True if caller is within loop, false if loop hasn't started or ended.\n */\nfunction in_the_loop() {\n\tglobal $wp_query;\n\treturn $wp_query->in_the_loop;\n}\n\n/**\n * Rewind the loop posts.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n */\nfunction rewind_posts() {\n\tglobal $wp_query;\n\t$wp_query->rewind_posts();\n}\n\n/**\n * Iterate the post index in the loop.\n *\n * @since 1.5.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n */\nfunction the_post() {\n\tglobal $wp_query;\n\t$wp_query->the_post();\n}\n\n/*\n * Comments loop.\n */\n\n/**\n * Determines whether current WordPress query has comments to loop over.\n *\n * @since 2.2.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return bool True if comments are available, false if no more comments.\n */\nfunction have_comments() {\n\tglobal $wp_query;\n\treturn $wp_query->have_comments();\n}\n\n/**\n * Iterate comment index in the comment loop.\n *\n * @since 2.2.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @return object\n */\nfunction the_comment() {\n\tglobal $wp_query;\n\treturn $wp_query->the_comment();\n}\n\n/**\n * Redirect old slugs to the correct permalink.\n *\n * Attempts to find the current slug from the past slugs.\n *\n * @since 2.1.0\n */\nfunction wp_old_slug_redirect() {\n\tif ( is_404() && '' !== get_query_var( 'name' ) ) {\n\t\t// Guess the current post type based on the query vars.\n\t\tif ( get_query_var( 'post_type' ) ) {\n\t\t\t$post_type = get_query_var( 'post_type' );\n\t\t} elseif ( get_query_var( 'attachment' ) ) {\n\t\t\t$post_type = 'attachment';\n\t\t} elseif ( get_query_var( 'pagename' ) ) {\n\t\t\t$post_type = 'page';\n\t\t} else {\n\t\t\t$post_type = 'post';\n\t\t}\n\n\t\tif ( is_array( $post_type ) ) {\n\t\t\tif ( count( $post_type ) > 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$post_type = reset( $post_type );\n\t\t}\n\n\t\t// Do not attempt redirect for hierarchical post types.\n\t\tif ( is_post_type_hierarchical( $post_type ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$id = _find_post_by_old_slug( $post_type );\n\n\t\tif ( ! $id ) {\n\t\t\t$id = _find_post_by_old_date( $post_type );\n\t\t}\n\n\t\t/**\n\t\t * Filters the old slug redirect post ID.\n\t\t *\n\t\t * @since 4.9.3\n\t\t *\n\t\t * @param int $id The redirect post ID.\n\t\t */\n\t\t$id = apply_filters( 'old_slug_redirect_post_id', $id );\n\n\t\tif ( ! $id ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$link = get_permalink( $id );\n\n\t\tif ( get_query_var( 'paged' ) > 1 ) {\n\t\t\t$link = user_trailingslashit( trailingslashit( $link ) . 'page/' . get_query_var( 'paged' ) );\n\t\t} elseif ( is_embed() ) {\n\t\t\t$link = user_trailingslashit( trailingslashit( $link ) . 'embed' );\n\t\t}\n\n\t\t/**\n\t\t * Filters the old slug redirect URL.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string $link The redirect URL.\n\t\t */\n\t\t$link = apply_filters( 'old_slug_redirect_url', $link );\n\n\t\tif ( ! $link ) {\n\t\t\treturn;\n\t\t}\n\n\t\twp_redirect( $link, 301 ); // Permanent redirect.\n\t\texit;\n\t}\n}\n\n/**\n * Find the post ID for redirecting an old slug.\n *\n * @see wp_old_slug_redirect()\n *\n * @since 4.9.3\n * @access private\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $post_type The current post type based on the query vars.\n * @return int The Post ID.\n */\nfunction _find_post_by_old_slug( $post_type ) {\n\tglobal $wpdb;\n\n\t$query = $wpdb->prepare( \"SELECT post_id FROM $wpdb->postmeta, $wpdb->posts WHERE ID = post_id AND post_type = %s AND meta_key = '_wp_old_slug' AND meta_value = %s\", $post_type, get_query_var( 'name' ) );\n\n\t// If year, monthnum, or day have been specified, make our query more precise\n\t// just in case there are multiple identical _wp_old_slug values.\n\tif ( get_query_var( 'year' ) ) {\n\t\t$query .= $wpdb->prepare( ' AND YEAR(post_date) = %d', get_query_var( 'year' ) );\n\t}\n\tif ( get_query_var( 'monthnum' ) ) {\n\t\t$query .= $wpdb->prepare( ' AND MONTH(post_date) = %d', get_query_var( 'monthnum' ) );\n\t}\n\tif ( get_query_var( 'day' ) ) {\n\t\t$query .= $wpdb->prepare( ' AND DAYOFMONTH(post_date) = %d', get_query_var( 'day' ) );\n\t}\n\n\t$id = (int) $wpdb->get_var( $query );\n\n\treturn $id;\n}\n\n/**\n * Find the post ID for redirecting an old date.\n *\n * @see wp_old_slug_redirect()\n *\n * @since 4.9.3\n * @access private\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $post_type The current post type based on the query vars.\n * @return int The Post ID.\n */\nfunction _find_post_by_old_date( $post_type ) {\n\tglobal $wpdb;\n\n\t$date_query = '';\n\tif ( get_query_var( 'year' ) ) {\n\t\t$date_query .= $wpdb->prepare( ' AND YEAR(pm_date.meta_value) = %d', get_query_var( 'year' ) );\n\t}\n\tif ( get_query_var( 'monthnum' ) ) {\n\t\t$date_query .= $wpdb->prepare( ' AND MONTH(pm_date.meta_value) = %d', get_query_var( 'monthnum' ) );\n\t}\n\tif ( get_query_var( 'day' ) ) {\n\t\t$date_query .= $wpdb->prepare( ' AND DAYOFMONTH(pm_date.meta_value) = %d', get_query_var( 'day' ) );\n\t}\n\n\t$id = 0;\n\tif ( $date_query ) {\n\t\t$id = (int) $wpdb->get_var( $wpdb->prepare( \"SELECT post_id FROM $wpdb->postmeta AS pm_date, $wpdb->posts WHERE ID = post_id AND post_type = %s AND meta_key = '_wp_old_date' AND post_name = %s\" . $date_query, $post_type, get_query_var( 'name' ) ) );\n\n\t\tif ( ! $id ) {\n\t\t\t// Check to see if an old slug matches the old date.\n\t\t\t$id = (int) $wpdb->get_var( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts, $wpdb->postmeta AS pm_slug, $wpdb->postmeta AS pm_date WHERE ID = pm_slug.post_id AND ID = pm_date.post_id AND post_type = %s AND pm_slug.meta_key = '_wp_old_slug' AND pm_slug.meta_value = %s AND pm_date.meta_key = '_wp_old_date'\" . $date_query, $post_type, get_query_var( 'name' ) ) );\n\t\t}\n\t}\n\n\treturn $id;\n}\n\n/**\n * Set up global post data.\n *\n * @since 1.5.0\n * @since 4.4.0 Added the ability to pass a post ID to `$post`.\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param WP_Post|object|int $post WP_Post instance or Post ID/object.\n * @return bool True when finished.\n */\nfunction setup_postdata( $post ) {\n\tglobal $wp_query;\n\n\tif ( ! empty( $wp_query ) && $wp_query instanceof WP_Query ) {\n\t\treturn $wp_query->setup_postdata( $post );\n\t}\n\n\treturn false;\n}\n\n/**\n * Generates post data.\n *\n * @since 5.2.0\n *\n * @global WP_Query $wp_query WordPress Query object.\n *\n * @param WP_Post|object|int $post WP_Post instance or Post ID/object.\n * @return array|bool Elements of post, or false on failure.\n */\nfunction generate_postdata( $post ) {\n\tglobal $wp_query;\n\n\tif ( ! empty( $wp_query ) && $wp_query instanceof WP_Query ) {\n\t\treturn $wp_query->generate_postdata( $post );\n\t}\n\n\treturn false;\n}\n", "num_lines": 1198}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Deprecated. No longer needed.\n *\n * @package WordPress\n * @deprecated 2.1.0\n */\n\n_deprecated_file( basename( __FILE__ ), '2.1.0', null, __( 'This file no longer needs to be included.' ) );\n", "num_lines": 10}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Deprecated. No longer needed.\n *\n * @package WordPress\n * @deprecated 3.1.0\n */\n\n_deprecated_file( basename( __FILE__ ), '3.1.0', null, __( 'This file no longer needs to be included.' ) );\n", "num_lines": 10}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API functions.\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.4.0\n */\n\n/**\n * Version number for our API.\n *\n * @var string\n */\ndefine( 'REST_API_VERSION', '2.0' );\n\n/**\n * Registers a REST API route.\n *\n * Note: Do not use before the {@see 'rest_api_init'} hook.\n *\n * @since 4.4.0\n * @since 5.1.0 Added a `_doing_it_wrong()` notice when not called on or after the `rest_api_init` hook.\n * @since 5.5.0 Added a `_doing_it_wrong()` notice when the required `permission_callback` argument is not set.\n *\n * @param string $namespace The first URL segment after core prefix. Should be unique to your package/plugin.\n * @param string $route     The base URL for route you are adding.\n * @param array  $args      Optional. Either an array of options for the endpoint, or an array of arrays for\n *                          multiple methods. Default empty array.\n * @param bool   $override  Optional. If the route already exists, should we override it? True overrides,\n *                          false merges (with newer overriding if duplicate keys exist). Default false.\n * @return bool True on success, false on error.\n */\nfunction register_rest_route( $namespace, $route, $args = array(), $override = false ) {\n\tif ( empty( $namespace ) ) {\n\t\t/*\n\t\t * Non-namespaced routes are not allowed, with the exception of the main\n\t\t * and namespace indexes. If you really need to register a\n\t\t * non-namespaced route, call `WP_REST_Server::register_route` directly.\n\t\t */\n\t\t_doing_it_wrong( 'register_rest_route', __( 'Routes must be namespaced with plugin or theme name and version.' ), '4.4.0' );\n\t\treturn false;\n\t} elseif ( empty( $route ) ) {\n\t\t_doing_it_wrong( 'register_rest_route', __( 'Route must be specified.' ), '4.4.0' );\n\t\treturn false;\n\t}\n\n\t$clean_namespace = trim( $namespace, '/' );\n\n\tif ( $clean_namespace !== $namespace ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Namespace must not start or end with a slash.' ), '5.4.2' );\n\t}\n\n\tif ( ! did_action( 'rest_api_init' ) ) {\n\t\t_doing_it_wrong(\n\t\t\t'register_rest_route',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: rest_api_init */\n\t\t\t\t__( 'REST API routes must be registered on the %s action.' ),\n\t\t\t\t'<code>rest_api_init</code>'\n\t\t\t),\n\t\t\t'5.1.0'\n\t\t);\n\t}\n\n\tif ( isset( $args['args'] ) ) {\n\t\t$common_args = $args['args'];\n\t\tunset( $args['args'] );\n\t} else {\n\t\t$common_args = array();\n\t}\n\n\tif ( isset( $args['callback'] ) ) {\n\t\t// Upgrade a single set to multiple.\n\t\t$args = array( $args );\n\t}\n\n\t$defaults = array(\n\t\t'methods'  => 'GET',\n\t\t'callback' => null,\n\t\t'args'     => array(),\n\t);\n\n\tforeach ( $args as $key => &$arg_group ) {\n\t\tif ( ! is_numeric( $key ) ) {\n\t\t\t// Route option, skip here.\n\t\t\tcontinue;\n\t\t}\n\n\t\t$arg_group         = array_merge( $defaults, $arg_group );\n\t\t$arg_group['args'] = array_merge( $common_args, $arg_group['args'] );\n\n\t\tif ( ! isset( $arg_group['permission_callback'] ) ) {\n\t\t\t_doing_it_wrong(\n\t\t\t\t__FUNCTION__,\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1. The REST API route being registered. 2. The argument name. 3. The suggested function name. */\n\t\t\t\t\t__( 'The REST API route definition for %1$s is missing the required %2$s argument. For REST API routes that are intended to be public, use %3$s as the permission callback.' ),\n\t\t\t\t\t'<code>' . $clean_namespace . '/' . trim( $route, '/' ) . '</code>',\n\t\t\t\t\t'<code>permission_callback</code>',\n\t\t\t\t\t'<code>__return_true</code>'\n\t\t\t\t),\n\t\t\t\t'5.5.0'\n\t\t\t);\n\t\t}\n\t}\n\n\t$full_route = '/' . $clean_namespace . '/' . trim( $route, '/' );\n\trest_get_server()->register_route( $clean_namespace, $full_route, $args, $override );\n\treturn true;\n}\n\n/**\n * Registers a new field on an existing WordPress object type.\n *\n * @since 4.7.0\n *\n * @global array $wp_rest_additional_fields Holds registered fields, organized\n *                                          by object type.\n *\n * @param string|array $object_type Object(s) the field is being registered\n *                                  to, \"post\"|\"term\"|\"comment\" etc.\n * @param string       $attribute   The attribute name.\n * @param array        $args {\n *     Optional. An array of arguments used to handle the registered field.\n *\n *     @type callable|null $get_callback    Optional. The callback function used to retrieve the field value. Default is\n *                                          'null', the field will not be returned in the response. The function will\n *                                          be passed the prepared object data.\n *     @type callable|null $update_callback Optional. The callback function used to set and update the field value. Default\n *                                          is 'null', the value cannot be set or updated. The function will be passed\n *                                          the model object, like WP_Post.\n *     @type array|null $schema             Optional. The callback function used to create the schema for this field.\n *                                          Default is 'null', no schema entry will be returned.\n * }\n */\nfunction register_rest_field( $object_type, $attribute, $args = array() ) {\n\t$defaults = array(\n\t\t'get_callback'    => null,\n\t\t'update_callback' => null,\n\t\t'schema'          => null,\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\tglobal $wp_rest_additional_fields;\n\n\t$object_types = (array) $object_type;\n\n\tforeach ( $object_types as $object_type ) {\n\t\t$wp_rest_additional_fields[ $object_type ][ $attribute ] = $args;\n\t}\n}\n\n/**\n * Registers rewrite rules for the API.\n *\n * @since 4.4.0\n *\n * @see rest_api_register_rewrites()\n * @global WP $wp Current WordPress environment instance.\n */\nfunction rest_api_init() {\n\trest_api_register_rewrites();\n\n\tglobal $wp;\n\t$wp->add_query_var( 'rest_route' );\n}\n\n/**\n * Adds REST rewrite rules.\n *\n * @since 4.4.0\n *\n * @see add_rewrite_rule()\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n */\nfunction rest_api_register_rewrites() {\n\tglobal $wp_rewrite;\n\n\tadd_rewrite_rule( '^' . rest_get_url_prefix() . '/?$', 'index.php?rest_route=/', 'top' );\n\tadd_rewrite_rule( '^' . rest_get_url_prefix() . '/(.*)?', 'index.php?rest_route=/$matches[1]', 'top' );\n\tadd_rewrite_rule( '^' . $wp_rewrite->index . '/' . rest_get_url_prefix() . '/?$', 'index.php?rest_route=/', 'top' );\n\tadd_rewrite_rule( '^' . $wp_rewrite->index . '/' . rest_get_url_prefix() . '/(.*)?', 'index.php?rest_route=/$matches[1]', 'top' );\n}\n\n/**\n * Registers the default REST API filters.\n *\n * Attached to the {@see 'rest_api_init'} action\n * to make testing and disabling these filters easier.\n *\n * @since 4.4.0\n */\nfunction rest_api_default_filters() {\n\tif ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {\n\t\t// Deprecated reporting.\n\t\tadd_action( 'deprecated_function_run', 'rest_handle_deprecated_function', 10, 3 );\n\t\tadd_filter( 'deprecated_function_trigger_error', '__return_false' );\n\t\tadd_action( 'deprecated_argument_run', 'rest_handle_deprecated_argument', 10, 3 );\n\t\tadd_filter( 'deprecated_argument_trigger_error', '__return_false' );\n\t\tadd_action( 'doing_it_wrong_run', 'rest_handle_doing_it_wrong', 10, 3 );\n\t\tadd_filter( 'doing_it_wrong_trigger_error', '__return_false' );\n\t}\n\n\t// Default serving.\n\tadd_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' );\n\tadd_filter( 'rest_post_dispatch', 'rest_send_allow_header', 10, 3 );\n\tadd_filter( 'rest_post_dispatch', 'rest_filter_response_fields', 10, 3 );\n\n\tadd_filter( 'rest_pre_dispatch', 'rest_handle_options_request', 10, 3 );\n}\n\n/**\n * Registers default REST API routes.\n *\n * @since 4.7.0\n */\nfunction create_initial_rest_routes() {\n\tforeach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) {\n\t\t$controller = $post_type->get_rest_controller();\n\n\t\tif ( ! $controller ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$controller->register_routes();\n\n\t\tif ( post_type_supports( $post_type->name, 'revisions' ) ) {\n\t\t\t$revisions_controller = new WP_REST_Revisions_Controller( $post_type->name );\n\t\t\t$revisions_controller->register_routes();\n\t\t}\n\n\t\tif ( 'attachment' !== $post_type->name ) {\n\t\t\t$autosaves_controller = new WP_REST_Autosaves_Controller( $post_type->name );\n\t\t\t$autosaves_controller->register_routes();\n\t\t}\n\t}\n\n\t// Post types.\n\t$controller = new WP_REST_Post_Types_Controller;\n\t$controller->register_routes();\n\n\t// Post statuses.\n\t$controller = new WP_REST_Post_Statuses_Controller;\n\t$controller->register_routes();\n\n\t// Taxonomies.\n\t$controller = new WP_REST_Taxonomies_Controller;\n\t$controller->register_routes();\n\n\t// Terms.\n\tforeach ( get_taxonomies( array( 'show_in_rest' => true ), 'object' ) as $taxonomy ) {\n\t\t$controller = $taxonomy->get_rest_controller();\n\n\t\tif ( ! $controller ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$controller->register_routes();\n\t}\n\n\t// Users.\n\t$controller = new WP_REST_Users_Controller;\n\t$controller->register_routes();\n\n\t// Comments.\n\t$controller = new WP_REST_Comments_Controller;\n\t$controller->register_routes();\n\n\t/**\n\t * Filters the search handlers to use in the REST search controller.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param array $search_handlers List of search handlers to use in the controller. Each search\n\t *                               handler instance must extend the `WP_REST_Search_Handler` class.\n\t *                               Default is only a handler for posts.\n\t */\n\t$search_handlers = apply_filters( 'wp_rest_search_handlers', array( new WP_REST_Post_Search_Handler() ) );\n\n\t$controller = new WP_REST_Search_Controller( $search_handlers );\n\t$controller->register_routes();\n\n\t// Block Renderer.\n\t$controller = new WP_REST_Block_Renderer_Controller;\n\t$controller->register_routes();\n\n\t// Block Types.\n\t$controller = new WP_REST_Block_Types_Controller();\n\t$controller->register_routes();\n\n\t// Settings.\n\t$controller = new WP_REST_Settings_Controller;\n\t$controller->register_routes();\n\n\t// Themes.\n\t$controller = new WP_REST_Themes_Controller;\n\t$controller->register_routes();\n\n\t// Plugins.\n\t$controller = new WP_REST_Plugins_Controller();\n\t$controller->register_routes();\n\n\t// Block Directory.\n\t$controller = new WP_REST_Block_Directory_Controller();\n\t$controller->register_routes();\n\n}\n\n/**\n * Loads the REST API.\n *\n * @since 4.4.0\n *\n * @global WP $wp Current WordPress environment instance.\n */\nfunction rest_api_loaded() {\n\tif ( empty( $GLOBALS['wp']->query_vars['rest_route'] ) ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Whether this is a REST Request.\n\t *\n\t * @since 4.4.0\n\t * @var bool\n\t */\n\tdefine( 'REST_REQUEST', true );\n\n\t// Initialize the server.\n\t$server = rest_get_server();\n\n\t// Fire off the request.\n\t$route = untrailingslashit( $GLOBALS['wp']->query_vars['rest_route'] );\n\tif ( empty( $route ) ) {\n\t\t$route = '/';\n\t}\n\t$server->serve_request( $route );\n\n\t// We're done.\n\tdie();\n}\n\n/**\n * Retrieves the URL prefix for any API resource.\n *\n * @since 4.4.0\n *\n * @return string Prefix.\n */\nfunction rest_get_url_prefix() {\n\t/**\n\t * Filters the REST URL prefix.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $prefix URL prefix. Default 'wp-json'.\n\t */\n\treturn apply_filters( 'rest_url_prefix', 'wp-json' );\n}\n\n/**\n * Retrieves the URL to a REST endpoint on a site.\n *\n * Note: The returned URL is NOT escaped.\n *\n * @since 4.4.0\n *\n * @todo Check if this is even necessary\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param int    $blog_id Optional. Blog ID. Default of null returns URL for current blog.\n * @param string $path    Optional. REST route. Default '/'.\n * @param string $scheme  Optional. Sanitization scheme. Default 'rest'.\n * @return string Full URL to the endpoint.\n */\nfunction get_rest_url( $blog_id = null, $path = '/', $scheme = 'rest' ) {\n\tif ( empty( $path ) ) {\n\t\t$path = '/';\n\t}\n\n\t$path = '/' . ltrim( $path, '/' );\n\n\tif ( is_multisite() && get_blog_option( $blog_id, 'permalink_structure' ) || get_option( 'permalink_structure' ) ) {\n\t\tglobal $wp_rewrite;\n\n\t\tif ( $wp_rewrite->using_index_permalinks() ) {\n\t\t\t$url = get_home_url( $blog_id, $wp_rewrite->index . '/' . rest_get_url_prefix(), $scheme );\n\t\t} else {\n\t\t\t$url = get_home_url( $blog_id, rest_get_url_prefix(), $scheme );\n\t\t}\n\n\t\t$url .= $path;\n\t} else {\n\t\t$url = trailingslashit( get_home_url( $blog_id, '', $scheme ) );\n\t\t// nginx only allows HTTP/1.0 methods when redirecting from / to /index.php.\n\t\t// To work around this, we manually add index.php to the URL, avoiding the redirect.\n\t\tif ( 'index.php' !== substr( $url, 9 ) ) {\n\t\t\t$url .= 'index.php';\n\t\t}\n\n\t\t$url = add_query_arg( 'rest_route', $path, $url );\n\t}\n\n\tif ( is_ssl() && isset( $_SERVER['SERVER_NAME'] ) ) {\n\t\t// If the current host is the same as the REST URL host, force the REST URL scheme to HTTPS.\n\t\tif ( parse_url( get_home_url( $blog_id ), PHP_URL_HOST ) === $_SERVER['SERVER_NAME'] ) {\n\t\t\t$url = set_url_scheme( $url, 'https' );\n\t\t}\n\t}\n\n\tif ( is_admin() && force_ssl_admin() ) {\n\t\t/*\n\t\t * In this situation the home URL may be http:, and `is_ssl()` may be false,\n\t\t * but the admin is served over https: (one way or another), so REST API usage\n\t\t * will be blocked by browsers unless it is also served over HTTPS.\n\t\t */\n\t\t$url = set_url_scheme( $url, 'https' );\n\t}\n\n\t/**\n\t * Filters the REST URL.\n\t *\n\t * Use this filter to adjust the url returned by the get_rest_url() function.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $url     REST URL.\n\t * @param string $path    REST route.\n\t * @param int    $blog_id Blog ID.\n\t * @param string $scheme  Sanitization scheme.\n\t */\n\treturn apply_filters( 'rest_url', $url, $path, $blog_id, $scheme );\n}\n\n/**\n * Retrieves the URL to a REST endpoint.\n *\n * Note: The returned URL is NOT escaped.\n *\n * @since 4.4.0\n *\n * @param string $path   Optional. REST route. Default empty.\n * @param string $scheme Optional. Sanitization scheme. Default 'rest'.\n * @return string Full URL to the endpoint.\n */\nfunction rest_url( $path = '', $scheme = 'rest' ) {\n\treturn get_rest_url( null, $path, $scheme );\n}\n\n/**\n * Do a REST request.\n *\n * Used primarily to route internal requests through WP_REST_Server.\n *\n * @since 4.4.0\n *\n * @param WP_REST_Request|string $request Request.\n * @return WP_REST_Response REST response.\n */\nfunction rest_do_request( $request ) {\n\t$request = rest_ensure_request( $request );\n\treturn rest_get_server()->dispatch( $request );\n}\n\n/**\n * Retrieves the current REST server instance.\n *\n * Instantiates a new instance if none exists already.\n *\n * @since 4.5.0\n *\n * @global WP_REST_Server $wp_rest_server REST server instance.\n *\n * @return WP_REST_Server REST server instance.\n */\nfunction rest_get_server() {\n\t/* @var WP_REST_Server $wp_rest_server */\n\tglobal $wp_rest_server;\n\n\tif ( empty( $wp_rest_server ) ) {\n\t\t/**\n\t\t * Filters the REST Server Class.\n\t\t *\n\t\t * This filter allows you to adjust the server class used by the API, using a\n\t\t * different class to handle requests.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string $class_name The name of the server class. Default 'WP_REST_Server'.\n\t\t */\n\t\t$wp_rest_server_class = apply_filters( 'wp_rest_server_class', 'WP_REST_Server' );\n\t\t$wp_rest_server       = new $wp_rest_server_class;\n\n\t\t/**\n\t\t * Fires when preparing to serve an API request.\n\t\t *\n\t\t * Endpoint objects should be created and register their hooks on this action rather\n\t\t * than another action to ensure they're only loaded when needed.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param WP_REST_Server $wp_rest_server Server object.\n\t\t */\n\t\tdo_action( 'rest_api_init', $wp_rest_server );\n\t}\n\n\treturn $wp_rest_server;\n}\n\n/**\n * Ensures request arguments are a request object (for consistency).\n *\n * @since 4.4.0\n * @since 5.3.0 Accept string argument for the request path.\n *\n * @param array|string|WP_REST_Request $request Request to check.\n * @return WP_REST_Request REST request instance.\n */\nfunction rest_ensure_request( $request ) {\n\tif ( $request instanceof WP_REST_Request ) {\n\t\treturn $request;\n\t}\n\n\tif ( is_string( $request ) ) {\n\t\treturn new WP_REST_Request( 'GET', $request );\n\t}\n\n\treturn new WP_REST_Request( 'GET', '', $request );\n}\n\n/**\n * Ensures a REST response is a response object (for consistency).\n *\n * This implements WP_REST_Response, allowing usage of `set_status`/`header`/etc\n * without needing to double-check the object. Will also allow WP_Error to indicate error\n * responses, so users should immediately check for this value.\n *\n * @since 4.4.0\n *\n * @param WP_REST_Response|WP_Error|WP_HTTP_Response|mixed $response Response to check.\n * @return WP_REST_Response|WP_Error If response generated an error, WP_Error, if response\n *                                   is already an instance, WP_REST_Response, otherwise\n *                                   returns a new WP_REST_Response instance.\n */\nfunction rest_ensure_response( $response ) {\n\tif ( is_wp_error( $response ) ) {\n\t\treturn $response;\n\t}\n\n\tif ( $response instanceof WP_REST_Response ) {\n\t\treturn $response;\n\t}\n\n\t// While WP_HTTP_Response is the base class of WP_REST_Response, it doesn't provide\n\t// all the required methods used in WP_REST_Server::dispatch().\n\tif ( $response instanceof WP_HTTP_Response ) {\n\t\treturn new WP_REST_Response(\n\t\t\t$response->get_data(),\n\t\t\t$response->get_status(),\n\t\t\t$response->get_headers()\n\t\t);\n\t}\n\n\treturn new WP_REST_Response( $response );\n}\n\n/**\n * Handles _deprecated_function() errors.\n *\n * @since 4.4.0\n *\n * @param string $function    The function that was called.\n * @param string $replacement The function that should have been called.\n * @param string $version     Version.\n */\nfunction rest_handle_deprecated_function( $function, $replacement, $version ) {\n\tif ( ! WP_DEBUG || headers_sent() ) {\n\t\treturn;\n\t}\n\tif ( ! empty( $replacement ) ) {\n\t\t/* translators: 1: Function name, 2: WordPress version number, 3: New function name. */\n\t\t$string = sprintf( __( '%1$s (since %2$s; use %3$s instead)' ), $function, $version, $replacement );\n\t} else {\n\t\t/* translators: 1: Function name, 2: WordPress version number. */\n\t\t$string = sprintf( __( '%1$s (since %2$s; no alternative available)' ), $function, $version );\n\t}\n\n\theader( sprintf( 'X-WP-DeprecatedFunction: %s', $string ) );\n}\n\n/**\n * Handles _deprecated_argument() errors.\n *\n * @since 4.4.0\n *\n * @param string $function    The function that was called.\n * @param string $message     A message regarding the change.\n * @param string $version     Version.\n */\nfunction rest_handle_deprecated_argument( $function, $message, $version ) {\n\tif ( ! WP_DEBUG || headers_sent() ) {\n\t\treturn;\n\t}\n\tif ( $message ) {\n\t\t/* translators: 1: Function name, 2: WordPress version number, 3: Error message. */\n\t\t$string = sprintf( __( '%1$s (since %2$s; %3$s)' ), $function, $version, $message );\n\t} else {\n\t\t/* translators: 1: Function name, 2: WordPress version number. */\n\t\t$string = sprintf( __( '%1$s (since %2$s; no alternative available)' ), $function, $version );\n\t}\n\n\theader( sprintf( 'X-WP-DeprecatedParam: %s', $string ) );\n}\n\n/**\n * Handles _doing_it_wrong errors.\n *\n * @since 5.5.0\n *\n * @param string      $function The function that was called.\n * @param string      $message  A message explaining what has been done incorrectly.\n * @param string|null $version  The version of WordPress where the message was added.\n */\nfunction rest_handle_doing_it_wrong( $function, $message, $version ) {\n\tif ( ! WP_DEBUG || headers_sent() ) {\n\t\treturn;\n\t}\n\n\tif ( $version ) {\n\t\t/* translators: Developer debugging message. 1: PHP function name, 2: WordPress version number, 3: Explanatory message. */\n\t\t$string = __( '%1$s (since %2$s; %3$s)' );\n\t\t$string = sprintf( $string, $function, $version, $message );\n\t} else {\n\t\t/* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message. */\n\t\t$string = __( '%1$s (%2$s)' );\n\t\t$string = sprintf( $string, $function, $message );\n\t}\n\n\theader( sprintf( 'X-WP-DoingItWrong: %s', $string ) );\n}\n\n/**\n * Sends Cross-Origin Resource Sharing headers with API requests.\n *\n * @since 4.4.0\n *\n * @param mixed $value Response data.\n * @return mixed Response data.\n */\nfunction rest_send_cors_headers( $value ) {\n\t$origin = get_http_origin();\n\n\tif ( $origin ) {\n\t\t// Requests from file:// and data: URLs send \"Origin: null\".\n\t\tif ( 'null' !== $origin ) {\n\t\t\t$origin = esc_url_raw( $origin );\n\t\t}\n\t\theader( 'Access-Control-Allow-Origin: ' . $origin );\n\t\theader( 'Access-Control-Allow-Methods: OPTIONS, GET, POST, PUT, PATCH, DELETE' );\n\t\theader( 'Access-Control-Allow-Credentials: true' );\n\t\theader( 'Vary: Origin', false );\n\t} elseif ( ! headers_sent() && 'GET' === $_SERVER['REQUEST_METHOD'] && ! is_user_logged_in() ) {\n\t\theader( 'Vary: Origin', false );\n\t}\n\n\treturn $value;\n}\n\n/**\n * Handles OPTIONS requests for the server.\n *\n * This is handled outside of the server code, as it doesn't obey normal route\n * mapping.\n *\n * @since 4.4.0\n *\n * @param mixed           $response Current response, either response or `null` to indicate pass-through.\n * @param WP_REST_Server  $handler  ResponseHandler instance (usually WP_REST_Server).\n * @param WP_REST_Request $request  The request that was used to make current response.\n * @return WP_REST_Response Modified response, either response or `null` to indicate pass-through.\n */\nfunction rest_handle_options_request( $response, $handler, $request ) {\n\tif ( ! empty( $response ) || $request->get_method() !== 'OPTIONS' ) {\n\t\treturn $response;\n\t}\n\n\t$response = new WP_REST_Response();\n\t$data     = array();\n\n\tforeach ( $handler->get_routes() as $route => $endpoints ) {\n\t\t$match = preg_match( '@^' . $route . '$@i', $request->get_route(), $matches );\n\n\t\tif ( ! $match ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$args = array();\n\t\tforeach ( $matches as $param => $value ) {\n\t\t\tif ( ! is_int( $param ) ) {\n\t\t\t\t$args[ $param ] = $value;\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $endpoints as $endpoint ) {\n\t\t\t// Remove the redundant preg_match() argument.\n\t\t\tunset( $args[0] );\n\n\t\t\t$request->set_url_params( $args );\n\t\t\t$request->set_attributes( $endpoint );\n\t\t}\n\n\t\t$data = $handler->get_data_for_route( $route, $endpoints, 'help' );\n\t\t$response->set_matched_route( $route );\n\t\tbreak;\n\t}\n\n\t$response->set_data( $data );\n\treturn $response;\n}\n\n/**\n * Sends the \"Allow\" header to state all methods that can be sent to the current route.\n *\n * @since 4.4.0\n *\n * @param WP_REST_Response $response Current response being served.\n * @param WP_REST_Server   $server   ResponseHandler instance (usually WP_REST_Server).\n * @param WP_REST_Request  $request  The request that was used to make current response.\n * @return WP_REST_Response Response to be served, with \"Allow\" header if route has allowed methods.\n */\nfunction rest_send_allow_header( $response, $server, $request ) {\n\t$matched_route = $response->get_matched_route();\n\n\tif ( ! $matched_route ) {\n\t\treturn $response;\n\t}\n\n\t$routes = $server->get_routes();\n\n\t$allowed_methods = array();\n\n\t// Get the allowed methods across the routes.\n\tforeach ( $routes[ $matched_route ] as $_handler ) {\n\t\tforeach ( $_handler['methods'] as $handler_method => $value ) {\n\n\t\t\tif ( ! empty( $_handler['permission_callback'] ) ) {\n\n\t\t\t\t$permission = call_user_func( $_handler['permission_callback'], $request );\n\n\t\t\t\t$allowed_methods[ $handler_method ] = true === $permission;\n\t\t\t} else {\n\t\t\t\t$allowed_methods[ $handler_method ] = true;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Strip out all the methods that are not allowed (false values).\n\t$allowed_methods = array_filter( $allowed_methods );\n\n\tif ( $allowed_methods ) {\n\t\t$response->header( 'Allow', implode( ', ', array_map( 'strtoupper', array_keys( $allowed_methods ) ) ) );\n\t}\n\n\treturn $response;\n}\n\n/**\n * Recursively computes the intersection of arrays using keys for comparison.\n *\n * @since 5.3.0\n *\n * @param array $array1 The array with master keys to check.\n * @param array $array2 An array to compare keys against.\n * @return array An associative array containing all the entries of array1 which have keys\n *               that are present in all arguments.\n */\nfunction _rest_array_intersect_key_recursive( $array1, $array2 ) {\n\t$array1 = array_intersect_key( $array1, $array2 );\n\tforeach ( $array1 as $key => $value ) {\n\t\tif ( is_array( $value ) && is_array( $array2[ $key ] ) ) {\n\t\t\t$array1[ $key ] = _rest_array_intersect_key_recursive( $value, $array2[ $key ] );\n\t\t}\n\t}\n\treturn $array1;\n}\n\n/**\n * Filter the API response to include only a white-listed set of response object fields.\n *\n * @since 4.8.0\n *\n * @param WP_REST_Response $response Current response being served.\n * @param WP_REST_Server   $server   ResponseHandler instance (usually WP_REST_Server).\n * @param WP_REST_Request  $request  The request that was used to make current response.\n * @return WP_REST_Response Response to be served, trimmed down to contain a subset of fields.\n */\nfunction rest_filter_response_fields( $response, $server, $request ) {\n\tif ( ! isset( $request['_fields'] ) || $response->is_error() ) {\n\t\treturn $response;\n\t}\n\n\t$data = $response->get_data();\n\n\t$fields = wp_parse_list( $request['_fields'] );\n\n\tif ( 0 === count( $fields ) ) {\n\t\treturn $response;\n\t}\n\n\t// Trim off outside whitespace from the comma delimited list.\n\t$fields = array_map( 'trim', $fields );\n\n\t// Create nested array of accepted field hierarchy.\n\t$fields_as_keyed = array();\n\tforeach ( $fields as $field ) {\n\t\t$parts = explode( '.', $field );\n\t\t$ref   = &$fields_as_keyed;\n\t\twhile ( count( $parts ) > 1 ) {\n\t\t\t$next = array_shift( $parts );\n\t\t\tif ( isset( $ref[ $next ] ) && true === $ref[ $next ] ) {\n\t\t\t\t// Skip any sub-properties if their parent prop is already marked for inclusion.\n\t\t\t\tbreak 2;\n\t\t\t}\n\t\t\t$ref[ $next ] = isset( $ref[ $next ] ) ? $ref[ $next ] : array();\n\t\t\t$ref          = &$ref[ $next ];\n\t\t}\n\t\t$last         = array_shift( $parts );\n\t\t$ref[ $last ] = true;\n\t}\n\n\tif ( wp_is_numeric_array( $data ) ) {\n\t\t$new_data = array();\n\t\tforeach ( $data as $item ) {\n\t\t\t$new_data[] = _rest_array_intersect_key_recursive( $item, $fields_as_keyed );\n\t\t}\n\t} else {\n\t\t$new_data = _rest_array_intersect_key_recursive( $data, $fields_as_keyed );\n\t}\n\n\t$response->set_data( $new_data );\n\n\treturn $response;\n}\n\n/**\n * Given an array of fields to include in a response, some of which may be\n * `nested.fields`, determine whether the provided field should be included\n * in the response body.\n *\n * If a parent field is passed in, the presence of any nested field within\n * that parent will cause the method to return `true`. For example \"title\"\n * will return true if any of `title`, `title.raw` or `title.rendered` is\n * provided.\n *\n * @since 5.3.0\n *\n * @param string $field  A field to test for inclusion in the response body.\n * @param array  $fields An array of string fields supported by the endpoint.\n * @return bool Whether to include the field or not.\n */\nfunction rest_is_field_included( $field, $fields ) {\n\tif ( in_array( $field, $fields, true ) ) {\n\t\treturn true;\n\t}\n\n\tforeach ( $fields as $accepted_field ) {\n\t\t// Check to see if $field is the parent of any item in $fields.\n\t\t// A field \"parent\" should be accepted if \"parent.child\" is accepted.\n\t\tif ( strpos( $accepted_field, \"$field.\" ) === 0 ) {\n\t\t\treturn true;\n\t\t}\n\t\t// Conversely, if \"parent\" is accepted, all \"parent.child\" fields\n\t\t// should also be accepted.\n\t\tif ( strpos( $field, \"$accepted_field.\" ) === 0 ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Adds the REST API URL to the WP RSD endpoint.\n *\n * @since 4.4.0\n *\n * @see get_rest_url()\n */\nfunction rest_output_rsd() {\n\t$api_root = get_rest_url();\n\n\tif ( empty( $api_root ) ) {\n\t\treturn;\n\t}\n\t?>\n\t<api name=\"WP-API\" blogID=\"1\" preferred=\"false\" apiLink=\"<?php echo esc_url( $api_root ); ?>\" />\n\t<?php\n}\n\n/**\n * Outputs the REST API link tag into page header.\n *\n * @since 4.4.0\n *\n * @see get_rest_url()\n */\nfunction rest_output_link_wp_head() {\n\t$api_root = get_rest_url();\n\n\tif ( empty( $api_root ) ) {\n\t\treturn;\n\t}\n\n\tprintf( '<link rel=\"https://api.w.org/\" href=\"%s\" />', esc_url( $api_root ) );\n\n\t$resource = rest_get_queried_resource_route();\n\n\tif ( $resource ) {\n\t\tprintf( '<link rel=\"alternate\" type=\"application/json\" href=\"%s\" />', esc_url( rest_url( $resource ) ) );\n\t}\n}\n\n/**\n * Sends a Link header for the REST API.\n *\n * @since 4.4.0\n */\nfunction rest_output_link_header() {\n\tif ( headers_sent() ) {\n\t\treturn;\n\t}\n\n\t$api_root = get_rest_url();\n\n\tif ( empty( $api_root ) ) {\n\t\treturn;\n\t}\n\n\theader( sprintf( 'Link: <%s>; rel=\"https://api.w.org/\"', esc_url_raw( $api_root ) ), false );\n\n\t$resource = rest_get_queried_resource_route();\n\n\tif ( $resource ) {\n\t\theader( sprintf( 'Link: <%s>; rel=\"alternate\"; type=\"application/json\"', esc_url_raw( rest_url( $resource ) ) ), false );\n\t}\n}\n\n/**\n * Checks for errors when using cookie-based authentication.\n *\n * WordPress' built-in cookie authentication is always active\n * for logged in users. However, the API has to check nonces\n * for each request to ensure users are not vulnerable to CSRF.\n *\n * @since 4.4.0\n *\n * @global mixed          $wp_rest_auth_cookie\n *\n * @param WP_Error|mixed $result Error from another authentication handler,\n *                               null if we should handle it, or another value if not.\n * @return WP_Error|mixed|bool WP_Error if the cookie is invalid, the $result, otherwise true.\n */\nfunction rest_cookie_check_errors( $result ) {\n\tif ( ! empty( $result ) ) {\n\t\treturn $result;\n\t}\n\n\tglobal $wp_rest_auth_cookie;\n\n\t/*\n\t * Is cookie authentication being used? (If we get an auth\n\t * error, but we're still logged in, another authentication\n\t * must have been used).\n\t */\n\tif ( true !== $wp_rest_auth_cookie && is_user_logged_in() ) {\n\t\treturn $result;\n\t}\n\n\t// Determine if there is a nonce.\n\t$nonce = null;\n\n\tif ( isset( $_REQUEST['_wpnonce'] ) ) {\n\t\t$nonce = $_REQUEST['_wpnonce'];\n\t} elseif ( isset( $_SERVER['HTTP_X_WP_NONCE'] ) ) {\n\t\t$nonce = $_SERVER['HTTP_X_WP_NONCE'];\n\t}\n\n\tif ( null === $nonce ) {\n\t\t// No nonce at all, so act as if it's an unauthenticated request.\n\t\twp_set_current_user( 0 );\n\t\treturn true;\n\t}\n\n\t// Check the nonce.\n\t$result = wp_verify_nonce( $nonce, 'wp_rest' );\n\n\tif ( ! $result ) {\n\t\treturn new WP_Error( 'rest_cookie_invalid_nonce', __( 'Cookie nonce is invalid' ), array( 'status' => 403 ) );\n\t}\n\n\t// Send a refreshed nonce in header.\n\trest_get_server()->send_header( 'X-WP-Nonce', wp_create_nonce( 'wp_rest' ) );\n\n\treturn true;\n}\n\n/**\n * Collects cookie authentication status.\n *\n * Collects errors from wp_validate_auth_cookie for use by rest_cookie_check_errors.\n *\n * @since 4.4.0\n *\n * @see current_action()\n * @global mixed $wp_rest_auth_cookie\n */\nfunction rest_cookie_collect_status() {\n\tglobal $wp_rest_auth_cookie;\n\n\t$status_type = current_action();\n\n\tif ( 'auth_cookie_valid' !== $status_type ) {\n\t\t$wp_rest_auth_cookie = substr( $status_type, 12 );\n\t\treturn;\n\t}\n\n\t$wp_rest_auth_cookie = true;\n}\n\n/**\n * Retrieves the avatar urls in various sizes.\n *\n * @since 4.7.0\n *\n * @see get_avatar_url()\n *\n * @param mixed $id_or_email The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash,\n *                           user email, WP_User object, WP_Post object, or WP_Comment object.\n * @return array Avatar URLs keyed by size. Each value can be a URL string or boolean false.\n */\nfunction rest_get_avatar_urls( $id_or_email ) {\n\t$avatar_sizes = rest_get_avatar_sizes();\n\n\t$urls = array();\n\tforeach ( $avatar_sizes as $size ) {\n\t\t$urls[ $size ] = get_avatar_url( $id_or_email, array( 'size' => $size ) );\n\t}\n\n\treturn $urls;\n}\n\n/**\n * Retrieves the pixel sizes for avatars.\n *\n * @since 4.7.0\n *\n * @return int[] List of pixel sizes for avatars. Default `[ 24, 48, 96 ]`.\n */\nfunction rest_get_avatar_sizes() {\n\t/**\n\t * Filters the REST avatar sizes.\n\t *\n\t * Use this filter to adjust the array of sizes returned by the\n\t * `rest_get_avatar_sizes` function.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param int[] $sizes An array of int values that are the pixel sizes for avatars.\n\t *                     Default `[ 24, 48, 96 ]`.\n\t */\n\treturn apply_filters( 'rest_avatar_sizes', array( 24, 48, 96 ) );\n}\n\n/**\n * Parses an RFC3339 time into a Unix timestamp.\n *\n * @since 4.4.0\n *\n * @param string $date      RFC3339 timestamp.\n * @param bool   $force_utc Optional. Whether to force UTC timezone instead of using\n *                          the timestamp's timezone. Default false.\n * @return int Unix timestamp.\n */\nfunction rest_parse_date( $date, $force_utc = false ) {\n\tif ( $force_utc ) {\n\t\t$date = preg_replace( '/[+-]\\d+:?\\d+$/', '+00:00', $date );\n\t}\n\n\t$regex = '#^\\d{4}-\\d{2}-\\d{2}[Tt ]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}(?::\\d{2})?)?$#';\n\n\tif ( ! preg_match( $regex, $date, $matches ) ) {\n\t\treturn false;\n\t}\n\n\treturn strtotime( $date );\n}\n\n/**\n * Parses a 3 or 6 digit hex color (with #).\n *\n * @since 5.4.0\n *\n * @param string $color 3 or 6 digit hex color (with #).\n * @return string|false\n */\nfunction rest_parse_hex_color( $color ) {\n\t$regex = '|^#([A-Fa-f0-9]{3}){1,2}$|';\n\tif ( ! preg_match( $regex, $color, $matches ) ) {\n\t\treturn false;\n\t}\n\n\treturn $color;\n}\n\n/**\n * Parses a date into both its local and UTC equivalent, in MySQL datetime format.\n *\n * @since 4.4.0\n *\n * @see rest_parse_date()\n *\n * @param string $date   RFC3339 timestamp.\n * @param bool   $is_utc Whether the provided date should be interpreted as UTC. Default false.\n * @return array|null Local and UTC datetime strings, in MySQL datetime format (Y-m-d H:i:s),\n *                    null on failure.\n */\nfunction rest_get_date_with_gmt( $date, $is_utc = false ) {\n\t/*\n\t * Whether or not the original date actually has a timezone string\n\t * changes the way we need to do timezone conversion.\n\t * Store this info before parsing the date, and use it later.\n\t */\n\t$has_timezone = preg_match( '#(Z|[+-]\\d{2}(:\\d{2})?)$#', $date );\n\n\t$date = rest_parse_date( $date );\n\n\tif ( empty( $date ) ) {\n\t\treturn null;\n\t}\n\n\t/*\n\t * At this point $date could either be a local date (if we were passed\n\t * a *local* date without a timezone offset) or a UTC date (otherwise).\n\t * Timezone conversion needs to be handled differently between these two cases.\n\t */\n\tif ( ! $is_utc && ! $has_timezone ) {\n\t\t$local = gmdate( 'Y-m-d H:i:s', $date );\n\t\t$utc   = get_gmt_from_date( $local );\n\t} else {\n\t\t$utc   = gmdate( 'Y-m-d H:i:s', $date );\n\t\t$local = get_date_from_gmt( $utc );\n\t}\n\n\treturn array( $local, $utc );\n}\n\n/**\n * Returns a contextual HTTP error code for authorization failure.\n *\n * @since 4.7.0\n *\n * @return integer 401 if the user is not logged in, 403 if the user is logged in.\n */\nfunction rest_authorization_required_code() {\n\treturn is_user_logged_in() ? 403 : 401;\n}\n\n/**\n * Validate a request argument based on details registered to the route.\n *\n * @since 4.7.0\n *\n * @param mixed           $value\n * @param WP_REST_Request $request\n * @param string          $param\n * @return true|WP_Error\n */\nfunction rest_validate_request_arg( $value, $request, $param ) {\n\t$attributes = $request->get_attributes();\n\tif ( ! isset( $attributes['args'][ $param ] ) || ! is_array( $attributes['args'][ $param ] ) ) {\n\t\treturn true;\n\t}\n\t$args = $attributes['args'][ $param ];\n\n\treturn rest_validate_value_from_schema( $value, $args, $param );\n}\n\n/**\n * Sanitize a request argument based on details registered to the route.\n *\n * @since 4.7.0\n *\n * @param mixed           $value\n * @param WP_REST_Request $request\n * @param string          $param\n * @return mixed\n */\nfunction rest_sanitize_request_arg( $value, $request, $param ) {\n\t$attributes = $request->get_attributes();\n\tif ( ! isset( $attributes['args'][ $param ] ) || ! is_array( $attributes['args'][ $param ] ) ) {\n\t\treturn $value;\n\t}\n\t$args = $attributes['args'][ $param ];\n\n\treturn rest_sanitize_value_from_schema( $value, $args, $param );\n}\n\n/**\n * Parse a request argument based on details registered to the route.\n *\n * Runs a validation check and sanitizes the value, primarily to be used via\n * the `sanitize_callback` arguments in the endpoint args registration.\n *\n * @since 4.7.0\n *\n * @param mixed           $value\n * @param WP_REST_Request $request\n * @param string          $param\n * @return mixed\n */\nfunction rest_parse_request_arg( $value, $request, $param ) {\n\t$is_valid = rest_validate_request_arg( $value, $request, $param );\n\n\tif ( is_wp_error( $is_valid ) ) {\n\t\treturn $is_valid;\n\t}\n\n\t$value = rest_sanitize_request_arg( $value, $request, $param );\n\n\treturn $value;\n}\n\n/**\n * Determines if an IP address is valid.\n *\n * Handles both IPv4 and IPv6 addresses.\n *\n * @since 4.7.0\n *\n * @param string $ip IP address.\n * @return string|false The valid IP address, otherwise false.\n */\nfunction rest_is_ip_address( $ip ) {\n\t$ipv4_pattern = '/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/';\n\n\tif ( ! preg_match( $ipv4_pattern, $ip ) && ! Requests_IPv6::check_ipv6( $ip ) ) {\n\t\treturn false;\n\t}\n\n\treturn $ip;\n}\n\n/**\n * Changes a boolean-like value into the proper boolean value.\n *\n * @since 4.7.0\n *\n * @param bool|string|int $value The value being evaluated.\n * @return boolean Returns the proper associated boolean value.\n */\nfunction rest_sanitize_boolean( $value ) {\n\t// String values are translated to `true`; make sure 'false' is false.\n\tif ( is_string( $value ) ) {\n\t\t$value = strtolower( $value );\n\t\tif ( in_array( $value, array( 'false', '0' ), true ) ) {\n\t\t\t$value = false;\n\t\t}\n\t}\n\n\t// Everything else will map nicely to boolean.\n\treturn (bool) $value;\n}\n\n/**\n * Determines if a given value is boolean-like.\n *\n * @since 4.7.0\n *\n * @param bool|string $maybe_bool The value being evaluated.\n * @return boolean True if a boolean, otherwise false.\n */\nfunction rest_is_boolean( $maybe_bool ) {\n\tif ( is_bool( $maybe_bool ) ) {\n\t\treturn true;\n\t}\n\n\tif ( is_string( $maybe_bool ) ) {\n\t\t$maybe_bool = strtolower( $maybe_bool );\n\n\t\t$valid_boolean_values = array(\n\t\t\t'false',\n\t\t\t'true',\n\t\t\t'0',\n\t\t\t'1',\n\t\t);\n\n\t\treturn in_array( $maybe_bool, $valid_boolean_values, true );\n\t}\n\n\tif ( is_int( $maybe_bool ) ) {\n\t\treturn in_array( $maybe_bool, array( 0, 1 ), true );\n\t}\n\n\treturn false;\n}\n\n/**\n * Determines if a given value is integer-like.\n *\n * @since 5.5.0\n *\n * @param mixed $maybe_integer The value being evaluated.\n * @return bool True if an integer, otherwise false.\n */\nfunction rest_is_integer( $maybe_integer ) {\n\treturn is_numeric( $maybe_integer ) && round( floatval( $maybe_integer ) ) === floatval( $maybe_integer );\n}\n\n/**\n * Determines if a given value is array-like.\n *\n * @since 5.5.0\n *\n * @param mixed $maybe_array The value being evaluated.\n * @return bool\n */\nfunction rest_is_array( $maybe_array ) {\n\tif ( is_scalar( $maybe_array ) ) {\n\t\t$maybe_array = wp_parse_list( $maybe_array );\n\t}\n\n\treturn wp_is_numeric_array( $maybe_array );\n}\n\n/**\n * Converts an array-like value to an array.\n *\n * @since 5.5.0\n *\n * @param mixed $maybe_array The value being evaluated.\n * @return array Returns the array extracted from the value.\n */\nfunction rest_sanitize_array( $maybe_array ) {\n\tif ( is_scalar( $maybe_array ) ) {\n\t\treturn wp_parse_list( $maybe_array );\n\t}\n\n\tif ( ! is_array( $maybe_array ) ) {\n\t\treturn array();\n\t}\n\n\t// Normalize to numeric array so nothing unexpected is in the keys.\n\treturn array_values( $maybe_array );\n}\n\n/**\n * Determines if a given value is object-like.\n *\n * @since 5.5.0\n *\n * @param mixed $maybe_object The value being evaluated.\n * @return bool True if object like, otherwise false.\n */\nfunction rest_is_object( $maybe_object ) {\n\tif ( '' === $maybe_object ) {\n\t\treturn true;\n\t}\n\n\tif ( $maybe_object instanceof stdClass ) {\n\t\treturn true;\n\t}\n\n\tif ( $maybe_object instanceof JsonSerializable ) {\n\t\t$maybe_object = $maybe_object->jsonSerialize();\n\t}\n\n\treturn is_array( $maybe_object );\n}\n\n/**\n * Converts an object-like value to an object.\n *\n * @since 5.5.0\n *\n * @param mixed $maybe_object The value being evaluated.\n * @return array Returns the object extracted from the value.\n */\nfunction rest_sanitize_object( $maybe_object ) {\n\tif ( '' === $maybe_object ) {\n\t\treturn array();\n\t}\n\n\tif ( $maybe_object instanceof stdClass ) {\n\t\treturn (array) $maybe_object;\n\t}\n\n\tif ( $maybe_object instanceof JsonSerializable ) {\n\t\t$maybe_object = $maybe_object->jsonSerialize();\n\t}\n\n\tif ( ! is_array( $maybe_object ) ) {\n\t\treturn array();\n\t}\n\n\treturn $maybe_object;\n}\n\n/**\n * Gets the best type for a value.\n *\n * @since 5.5.0\n *\n * @param mixed $value The value to check.\n * @param array $types The list of possible types.\n * @return string The best matching type, an empty string if no types match.\n */\nfunction rest_get_best_type_for_value( $value, $types ) {\n\tstatic $checks = array(\n\t\t'array'   => 'rest_is_array',\n\t\t'object'  => 'rest_is_object',\n\t\t'integer' => 'rest_is_integer',\n\t\t'number'  => 'is_numeric',\n\t\t'boolean' => 'rest_is_boolean',\n\t\t'string'  => 'is_string',\n\t\t'null'    => 'is_null',\n\t);\n\n\t// Both arrays and objects allow empty strings to be converted to their types.\n\t// But the best answer for this type is a string.\n\tif ( '' === $value && in_array( 'string', $types, true ) ) {\n\t\treturn 'string';\n\t}\n\n\tforeach ( $types as $type ) {\n\t\tif ( isset( $checks[ $type ] ) && $checks[ $type ]( $value ) ) {\n\t\t\treturn $type;\n\t\t}\n\t}\n\n\treturn '';\n}\n\n/**\n * Handles getting the best type for a multi-type schema.\n *\n * This is a wrapper for {@see rest_get_best_type_for_value()} that handles\n * backward compatibility for schemas that use invalid types.\n *\n * @since 5.5.0\n *\n * @param mixed  $value The value to check.\n * @param array  $args  The schema array to use.\n * @param string $param The parameter name, used in error messages.\n * @return string\n */\nfunction rest_handle_multi_type_schema( $value, $args, $param = '' ) {\n\t$allowed_types = array( 'array', 'object', 'string', 'number', 'integer', 'boolean', 'null' );\n\t$invalid_types = array_diff( $args['type'], $allowed_types );\n\n\tif ( $invalid_types ) {\n\t\t_doing_it_wrong(\n\t\t\t__FUNCTION__,\n\t\t\t/* translators: 1. Parameter. 2. List of allowed types. */\n\t\t\twp_sprintf( __( 'The \"type\" schema keyword for %1$s can only contain the built-in types: %2$l.' ), $param, $allowed_types ),\n\t\t\t'5.5.0'\n\t\t);\n\t}\n\n\t$best_type = rest_get_best_type_for_value( $value, $args['type'] );\n\n\tif ( ! $best_type ) {\n\t\tif ( ! $invalid_types ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t// Backward compatibility for previous behavior which allowed the value if there was an invalid type used.\n\t\t$best_type = reset( $invalid_types );\n\t}\n\n\treturn $best_type;\n}\n\n/**\n * Checks if an array is made up of unique items.\n *\n * @since 5.5.0\n *\n * @param array $array The array to check.\n * @return bool True if the array contains unique items, false otherwise.\n */\nfunction rest_validate_array_contains_unique_items( $array ) {\n\t$seen = array();\n\n\tforeach ( $array as $item ) {\n\t\t$stabilized = rest_stabilize_value( $item );\n\t\t$key        = serialize( $stabilized );\n\n\t\tif ( ! isset( $seen[ $key ] ) ) {\n\t\t\t$seen[ $key ] = true;\n\n\t\t\tcontinue;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Stabilizes a value following JSON Schema semantics.\n *\n * For lists, order is preserved. For objects, properties are reordered alphabetically.\n *\n * @since 5.5.0\n *\n * @param mixed $value The value to stabilize. Must already be sanitized. Objects should have been converted to arrays.\n * @return mixed The stabilized value.\n */\nfunction rest_stabilize_value( $value ) {\n\tif ( is_scalar( $value ) || is_null( $value ) ) {\n\t\treturn $value;\n\t}\n\n\tif ( is_object( $value ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Cannot stabilize objects. Convert the object to an array first.' ), '5.5.0' );\n\n\t\treturn $value;\n\t}\n\n\tksort( $value );\n\n\tforeach ( $value as $k => $v ) {\n\t\t$value[ $k ] = rest_stabilize_value( $v );\n\t}\n\n\treturn $value;\n}\n\n/**\n * Validate a value based on a schema.\n *\n * @since 4.7.0\n * @since 4.9.0 Support the \"object\" type.\n * @since 5.2.0 Support validating \"additionalProperties\" against a schema.\n * @since 5.3.0 Support multiple types.\n * @since 5.4.0 Convert an empty string to an empty object.\n * @since 5.5.0 Add the \"uuid\" and \"hex-color\" formats.\n *              Support the \"minLength\", \"maxLength\" and \"pattern\" keywords for strings.\n *              Support the \"minItems\", \"maxItems\" and \"uniqueItems\" keywords for arrays.\n *              Validate required properties.\n *\n * @param mixed  $value The value to validate.\n * @param array  $args  Schema array to use for validation.\n * @param string $param The parameter name, used in error messages.\n * @return true|WP_Error\n */\nfunction rest_validate_value_from_schema( $value, $args, $param = '' ) {\n\t$allowed_types = array( 'array', 'object', 'string', 'number', 'integer', 'boolean', 'null' );\n\n\tif ( ! isset( $args['type'] ) ) {\n\t\t/* translators: 1. Parameter */\n\t\t_doing_it_wrong( __FUNCTION__, sprintf( __( 'The \"type\" schema keyword for %s is required.' ), $param ), '5.5.0' );\n\t}\n\n\tif ( is_array( $args['type'] ) ) {\n\t\t$best_type = rest_handle_multi_type_schema( $value, $args, $param );\n\n\t\tif ( ! $best_type ) {\n\t\t\t/* translators: 1: Parameter, 2: List of types. */\n\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, implode( ',', $args['type'] ) ) );\n\t\t}\n\n\t\t$args['type'] = $best_type;\n\t}\n\n\tif ( ! in_array( $args['type'], $allowed_types, true ) ) {\n\t\t_doing_it_wrong(\n\t\t\t__FUNCTION__,\n\t\t\t/* translators: 1. Parameter 2. The list of allowed types. */\n\t\t\twp_sprintf( __( 'The \"type\" schema keyword for %1$s can only be one of the built-in types: %2$l.' ), $param, $allowed_types ),\n\t\t\t'5.5.0'\n\t\t);\n\t}\n\n\tif ( 'array' === $args['type'] ) {\n\t\tif ( ! rest_is_array( $value ) ) {\n\t\t\t/* translators: 1: Parameter, 2: Type name. */\n\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, 'array' ) );\n\t\t}\n\n\t\t$value = rest_sanitize_array( $value );\n\n\t\tif ( isset( $args['items'] ) ) {\n\t\t\tforeach ( $value as $index => $v ) {\n\t\t\t\t$is_valid = rest_validate_value_from_schema( $v, $args['items'], $param . '[' . $index . ']' );\n\t\t\t\tif ( is_wp_error( $is_valid ) ) {\n\t\t\t\t\treturn $is_valid;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $args['minItems'] ) && count( $value ) < $args['minItems'] ) {\n\t\t\t/* translators: 1: Parameter, 2: Number. */\n\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must contain at least %2$s items.' ), $param, number_format_i18n( $args['minItems'] ) ) );\n\t\t}\n\n\t\tif ( isset( $args['maxItems'] ) && count( $value ) > $args['maxItems'] ) {\n\t\t\t/* translators: 1: Parameter, 2: Number. */\n\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must contain at most %2$s items.' ), $param, number_format_i18n( $args['maxItems'] ) ) );\n\t\t}\n\n\t\tif ( ! empty( $args['uniqueItems'] ) && ! rest_validate_array_contains_unique_items( $value ) ) {\n\t\t\t/* translators: 1: Parameter */\n\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s has duplicate items.' ), $param ) );\n\t\t}\n\t}\n\n\tif ( 'object' === $args['type'] ) {\n\t\tif ( ! rest_is_object( $value ) ) {\n\t\t\t/* translators: 1: Parameter, 2: Type name. */\n\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, 'object' ) );\n\t\t}\n\n\t\t$value = rest_sanitize_object( $value );\n\n\t\tif ( isset( $args['required'] ) && is_array( $args['required'] ) ) { // schema version 4\n\t\t\tforeach ( $args['required'] as $name ) {\n\t\t\t\tif ( ! array_key_exists( $name, $value ) ) {\n\t\t\t\t\t/* translators: 1: Property of an object, 2: Parameter. */\n\t\t\t\t\treturn new WP_Error( 'rest_property_required', sprintf( __( '%1$s is a required property of %2$s.' ), $name, $param ) );\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( isset( $args['properties'] ) ) { // schema version 3\n\t\t\tforeach ( $args['properties'] as $name => $property ) {\n\t\t\t\tif ( isset( $property['required'] ) && true === $property['required'] && ! array_key_exists( $name, $value ) ) {\n\t\t\t\t\t/* translators: 1: Property of an object, 2: Parameter. */\n\t\t\t\t\treturn new WP_Error( 'rest_property_required', sprintf( __( '%1$s is a required property of %2$s.' ), $name, $param ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $value as $property => $v ) {\n\t\t\tif ( isset( $args['properties'][ $property ] ) ) {\n\t\t\t\t$is_valid = rest_validate_value_from_schema( $v, $args['properties'][ $property ], $param . '[' . $property . ']' );\n\t\t\t\tif ( is_wp_error( $is_valid ) ) {\n\t\t\t\t\treturn $is_valid;\n\t\t\t\t}\n\t\t\t} elseif ( isset( $args['additionalProperties'] ) ) {\n\t\t\t\tif ( false === $args['additionalProperties'] ) {\n\t\t\t\t\t/* translators: %s: Property of an object. */\n\t\t\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not a valid property of Object.' ), $property ) );\n\t\t\t\t}\n\n\t\t\t\tif ( is_array( $args['additionalProperties'] ) ) {\n\t\t\t\t\t$is_valid = rest_validate_value_from_schema( $v, $args['additionalProperties'], $param . '[' . $property . ']' );\n\t\t\t\t\tif ( is_wp_error( $is_valid ) ) {\n\t\t\t\t\t\treturn $is_valid;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( 'null' === $args['type'] ) {\n\t\tif ( null !== $value ) {\n\t\t\t/* translators: 1: Parameter, 2: Type name. */\n\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, 'null' ) );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tif ( ! empty( $args['enum'] ) ) {\n\t\tif ( ! in_array( $value, $args['enum'], true ) ) {\n\t\t\t/* translators: 1: Parameter, 2: List of valid values. */\n\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not one of %2$s.' ), $param, implode( ', ', $args['enum'] ) ) );\n\t\t}\n\t}\n\n\tif ( in_array( $args['type'], array( 'integer', 'number' ), true ) && ! is_numeric( $value ) ) {\n\t\t/* translators: 1: Parameter, 2: Type name. */\n\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, $args['type'] ) );\n\t}\n\n\tif ( 'integer' === $args['type'] && ! rest_is_integer( $value ) ) {\n\t\t/* translators: 1: Parameter, 2: Type name. */\n\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, 'integer' ) );\n\t}\n\n\tif ( 'boolean' === $args['type'] && ! rest_is_boolean( $value ) ) {\n\t\t/* translators: 1: Parameter, 2: Type name. */\n\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, 'boolean' ) );\n\t}\n\n\tif ( 'string' === $args['type'] ) {\n\t\tif ( ! is_string( $value ) ) {\n\t\t\t/* translators: 1: Parameter, 2: Type name. */\n\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, 'string' ) );\n\t\t}\n\n\t\tif ( isset( $args['minLength'] ) && mb_strlen( $value ) < $args['minLength'] ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_invalid_param',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: Parameter, 2: Number of characters. */\n\t\t\t\t\t_n( '%1$s must be at least %2$s character long.', '%1$s must be at least %2$s characters long.', $args['minLength'] ),\n\t\t\t\t\t$param,\n\t\t\t\t\tnumber_format_i18n( $args['minLength'] )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( isset( $args['maxLength'] ) && mb_strlen( $value ) > $args['maxLength'] ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_invalid_param',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: 1: Parameter, 2: Number of characters. */\n\t\t\t\t\t_n( '%1$s must be at most %2$s character long.', '%1$s must be at most %2$s characters long.', $args['maxLength'] ),\n\t\t\t\t\t$param,\n\t\t\t\t\tnumber_format_i18n( $args['maxLength'] )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( isset( $args['pattern'] ) ) {\n\t\t\t$pattern = str_replace( '#', '\\\\#', $args['pattern'] );\n\t\t\tif ( ! preg_match( '#' . $pattern . '#u', $value ) ) {\n\t\t\t\t/* translators: 1: Parameter, 2: Pattern. */\n\t\t\t\treturn new WP_Error( 'rest_invalid_pattern', sprintf( __( '%1$s does not match pattern %2$s.' ), $param, $args['pattern'] ) );\n\t\t\t}\n\t\t}\n\t}\n\n\t// The \"format\" keyword should only be applied to strings. However, for backward compatibility,\n\t// we allow the \"format\" keyword if the type keyword was not specified, or was set to an invalid value.\n\tif ( isset( $args['format'] )\n\t\t&& ( ! isset( $args['type'] ) || 'string' === $args['type'] || ! in_array( $args['type'], $allowed_types, true ) )\n\t) {\n\t\tswitch ( $args['format'] ) {\n\t\t\tcase 'hex-color':\n\t\t\t\tif ( ! rest_parse_hex_color( $value ) ) {\n\t\t\t\t\treturn new WP_Error( 'rest_invalid_hex_color', __( 'Invalid hex color.' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'date-time':\n\t\t\t\tif ( ! rest_parse_date( $value ) ) {\n\t\t\t\t\treturn new WP_Error( 'rest_invalid_date', __( 'Invalid date.' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'email':\n\t\t\t\tif ( ! is_email( $value ) ) {\n\t\t\t\t\treturn new WP_Error( 'rest_invalid_email', __( 'Invalid email address.' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ip':\n\t\t\t\tif ( ! rest_is_ip_address( $value ) ) {\n\t\t\t\t\t/* translators: %s: IP address. */\n\t\t\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%s is not a valid IP address.' ), $param ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'uuid':\n\t\t\t\tif ( ! wp_is_uuid( $value ) ) {\n\t\t\t\t\t/* translators: %s is the name of a JSON field expecting a valid uuid. */\n\t\t\t\t\treturn new WP_Error( 'rest_invalid_uuid', sprintf( __( '%s is not a valid UUID.' ), $param ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ( in_array( $args['type'], array( 'number', 'integer' ), true ) && ( isset( $args['minimum'] ) || isset( $args['maximum'] ) ) ) {\n\t\tif ( isset( $args['minimum'] ) && ! isset( $args['maximum'] ) ) {\n\t\t\tif ( ! empty( $args['exclusiveMinimum'] ) && $value <= $args['minimum'] ) {\n\t\t\t\t/* translators: 1: Parameter, 2: Minimum number. */\n\t\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be greater than %2$d' ), $param, $args['minimum'] ) );\n\t\t\t} elseif ( empty( $args['exclusiveMinimum'] ) && $value < $args['minimum'] ) {\n\t\t\t\t/* translators: 1: Parameter, 2: Minimum number. */\n\t\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be greater than or equal to %2$d' ), $param, $args['minimum'] ) );\n\t\t\t}\n\t\t} elseif ( isset( $args['maximum'] ) && ! isset( $args['minimum'] ) ) {\n\t\t\tif ( ! empty( $args['exclusiveMaximum'] ) && $value >= $args['maximum'] ) {\n\t\t\t\t/* translators: 1: Parameter, 2: Maximum number. */\n\t\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be less than %2$d' ), $param, $args['maximum'] ) );\n\t\t\t} elseif ( empty( $args['exclusiveMaximum'] ) && $value > $args['maximum'] ) {\n\t\t\t\t/* translators: 1: Parameter, 2: Maximum number. */\n\t\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be less than or equal to %2$d' ), $param, $args['maximum'] ) );\n\t\t\t}\n\t\t} elseif ( isset( $args['maximum'] ) && isset( $args['minimum'] ) ) {\n\t\t\tif ( ! empty( $args['exclusiveMinimum'] ) && ! empty( $args['exclusiveMaximum'] ) ) {\n\t\t\t\tif ( $value >= $args['maximum'] || $value <= $args['minimum'] ) {\n\t\t\t\t\t/* translators: 1: Parameter, 2: Minimum number, 3: Maximum number. */\n\t\t\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (exclusive) and %3$d (exclusive)' ), $param, $args['minimum'], $args['maximum'] ) );\n\t\t\t\t}\n\t\t\t} elseif ( empty( $args['exclusiveMinimum'] ) && ! empty( $args['exclusiveMaximum'] ) ) {\n\t\t\t\tif ( $value >= $args['maximum'] || $value < $args['minimum'] ) {\n\t\t\t\t\t/* translators: 1: Parameter, 2: Minimum number, 3: Maximum number. */\n\t\t\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (inclusive) and %3$d (exclusive)' ), $param, $args['minimum'], $args['maximum'] ) );\n\t\t\t\t}\n\t\t\t} elseif ( ! empty( $args['exclusiveMinimum'] ) && empty( $args['exclusiveMaximum'] ) ) {\n\t\t\t\tif ( $value > $args['maximum'] || $value <= $args['minimum'] ) {\n\t\t\t\t\t/* translators: 1: Parameter, 2: Minimum number, 3: Maximum number. */\n\t\t\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (exclusive) and %3$d (inclusive)' ), $param, $args['minimum'], $args['maximum'] ) );\n\t\t\t\t}\n\t\t\t} elseif ( empty( $args['exclusiveMinimum'] ) && empty( $args['exclusiveMaximum'] ) ) {\n\t\t\t\tif ( $value > $args['maximum'] || $value < $args['minimum'] ) {\n\t\t\t\t\t/* translators: 1: Parameter, 2: Minimum number, 3: Maximum number. */\n\t\t\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (inclusive) and %3$d (inclusive)' ), $param, $args['minimum'], $args['maximum'] ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Sanitize a value based on a schema.\n *\n * @since 4.7.0\n * @since 5.5.0 Added the `$param` parameter.\n *\n * @param mixed  $value The value to sanitize.\n * @param array  $args  Schema array to use for sanitization.\n * @param string $param The parameter name, used in error messages.\n * @return mixed|WP_Error The sanitized value or a WP_Error instance if the value cannot be safely sanitized.\n */\nfunction rest_sanitize_value_from_schema( $value, $args, $param = '' ) {\n\t$allowed_types = array( 'array', 'object', 'string', 'number', 'integer', 'boolean', 'null' );\n\n\tif ( ! isset( $args['type'] ) ) {\n\t\t/* translators: 1. Parameter */\n\t\t_doing_it_wrong( __FUNCTION__, sprintf( __( 'The \"type\" schema keyword for %s is required.' ), $param ), '5.5.0' );\n\t}\n\n\tif ( is_array( $args['type'] ) ) {\n\t\t$best_type = rest_handle_multi_type_schema( $value, $args, $param );\n\n\t\tif ( ! $best_type ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$args['type'] = $best_type;\n\t}\n\n\tif ( ! in_array( $args['type'], $allowed_types, true ) ) {\n\t\t_doing_it_wrong(\n\t\t\t__FUNCTION__,\n\t\t\t/* translators: 1. Parameter. 2. The list of allowed types. */\n\t\t\twp_sprintf( __( 'The \"type\" schema keyword for %1$s can only be one of the built-in types: %2$l.' ), $param, $allowed_types ),\n\t\t\t'5.5.0'\n\t\t);\n\t}\n\n\tif ( 'array' === $args['type'] ) {\n\t\t$value = rest_sanitize_array( $value );\n\n\t\tif ( ! empty( $args['items'] ) ) {\n\t\t\tforeach ( $value as $index => $v ) {\n\t\t\t\t$value[ $index ] = rest_sanitize_value_from_schema( $v, $args['items'], $param . '[' . $index . ']' );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $args['uniqueItems'] ) && ! rest_validate_array_contains_unique_items( $value ) ) {\n\t\t\t/* translators: 1: Parameter */\n\t\t\treturn new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s has duplicate items.' ), $param ) );\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\tif ( 'object' === $args['type'] ) {\n\t\t$value = rest_sanitize_object( $value );\n\n\t\tforeach ( $value as $property => $v ) {\n\t\t\tif ( isset( $args['properties'][ $property ] ) ) {\n\t\t\t\t$value[ $property ] = rest_sanitize_value_from_schema( $v, $args['properties'][ $property ], $param . '[' . $property . ']' );\n\t\t\t} elseif ( isset( $args['additionalProperties'] ) ) {\n\t\t\t\tif ( false === $args['additionalProperties'] ) {\n\t\t\t\t\tunset( $value[ $property ] );\n\t\t\t\t} elseif ( is_array( $args['additionalProperties'] ) ) {\n\t\t\t\t\t$value[ $property ] = rest_sanitize_value_from_schema( $v, $args['additionalProperties'], $param . '[' . $property . ']' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\tif ( 'null' === $args['type'] ) {\n\t\treturn null;\n\t}\n\n\tif ( 'integer' === $args['type'] ) {\n\t\treturn (int) $value;\n\t}\n\n\tif ( 'number' === $args['type'] ) {\n\t\treturn (float) $value;\n\t}\n\n\tif ( 'boolean' === $args['type'] ) {\n\t\treturn rest_sanitize_boolean( $value );\n\t}\n\n\t// This behavior matches rest_validate_value_from_schema().\n\tif ( isset( $args['format'] )\n\t\t&& ( ! isset( $args['type'] ) || 'string' === $args['type'] || ! in_array( $args['type'], $allowed_types, true ) )\n\t) {\n\t\tswitch ( $args['format'] ) {\n\t\t\tcase 'hex-color':\n\t\t\t\treturn (string) sanitize_hex_color( $value );\n\n\t\t\tcase 'date-time':\n\t\t\t\treturn sanitize_text_field( $value );\n\n\t\t\tcase 'email':\n\t\t\t\t// sanitize_email() validates, which would be unexpected.\n\t\t\t\treturn sanitize_text_field( $value );\n\n\t\t\tcase 'uri':\n\t\t\t\treturn esc_url_raw( $value );\n\n\t\t\tcase 'ip':\n\t\t\t\treturn sanitize_text_field( $value );\n\n\t\t\tcase 'uuid':\n\t\t\t\treturn sanitize_text_field( $value );\n\t\t}\n\t}\n\n\tif ( 'string' === $args['type'] ) {\n\t\treturn strval( $value );\n\t}\n\n\treturn $value;\n}\n\n/**\n * Append result of internal request to REST API for purpose of preloading data to be attached to a page.\n * Expected to be called in the context of `array_reduce`.\n *\n * @since 5.0.0\n *\n * @param array  $memo Reduce accumulator.\n * @param string $path REST API path to preload.\n * @return array Modified reduce accumulator.\n */\nfunction rest_preload_api_request( $memo, $path ) {\n\t// array_reduce() doesn't support passing an array in PHP 5.2,\n\t// so we need to make sure we start with one.\n\tif ( ! is_array( $memo ) ) {\n\t\t$memo = array();\n\t}\n\n\tif ( empty( $path ) ) {\n\t\treturn $memo;\n\t}\n\n\t$method = 'GET';\n\tif ( is_array( $path ) && 2 === count( $path ) ) {\n\t\t$method = end( $path );\n\t\t$path   = reset( $path );\n\n\t\tif ( ! in_array( $method, array( 'GET', 'OPTIONS' ), true ) ) {\n\t\t\t$method = 'GET';\n\t\t}\n\t}\n\n\t$path_parts = parse_url( $path );\n\tif ( false === $path_parts ) {\n\t\treturn $memo;\n\t}\n\n\t$request = new WP_REST_Request( $method, $path_parts['path'] );\n\tif ( ! empty( $path_parts['query'] ) ) {\n\t\tparse_str( $path_parts['query'], $query_params );\n\t\t$request->set_query_params( $query_params );\n\t}\n\n\t$response = rest_do_request( $request );\n\tif ( 200 === $response->status ) {\n\t\t$server = rest_get_server();\n\t\t$data   = (array) $response->get_data();\n\t\t$links  = $server::get_compact_response_links( $response );\n\t\tif ( ! empty( $links ) ) {\n\t\t\t$data['_links'] = $links;\n\t\t}\n\n\t\tif ( 'OPTIONS' === $method ) {\n\t\t\t$response = rest_send_allow_header( $response, $server, $request );\n\n\t\t\t$memo[ $method ][ $path ] = array(\n\t\t\t\t'body'    => $data,\n\t\t\t\t'headers' => $response->headers,\n\t\t\t);\n\t\t} else {\n\t\t\t$memo[ $path ] = array(\n\t\t\t\t'body'    => $data,\n\t\t\t\t'headers' => $response->headers,\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $memo;\n}\n\n/**\n * Parses the \"_embed\" parameter into the list of resources to embed.\n *\n * @since 5.4.0\n *\n * @param string|array $embed Raw \"_embed\" parameter value.\n * @return true|string[] Either true to embed all embeds, or a list of relations to embed.\n */\nfunction rest_parse_embed_param( $embed ) {\n\tif ( ! $embed || 'true' === $embed || '1' === $embed ) {\n\t\treturn true;\n\t}\n\n\t$rels = wp_parse_list( $embed );\n\n\tif ( ! $rels ) {\n\t\treturn true;\n\t}\n\n\treturn $rels;\n}\n\n/**\n * Filters the response to remove any fields not available in the given context.\n *\n * @since 5.5.0\n *\n * @param array|object $data    The response data to modify.\n * @param array        $schema  The schema for the endpoint used to filter the response.\n * @param string       $context The requested context.\n * @return array|object The filtered response data.\n */\nfunction rest_filter_response_by_context( $data, $schema, $context ) {\n\tif ( ! is_array( $data ) && ! is_object( $data ) ) {\n\t\treturn $data;\n\t}\n\n\tif ( isset( $schema['type'] ) ) {\n\t\t$type = $schema['type'];\n\t} elseif ( isset( $schema['properties'] ) ) {\n\t\t$type = 'object'; // Back compat if a developer accidentally omitted the type.\n\t} else {\n\t\treturn $data;\n\t}\n\n\t$is_array_type  = 'array' === $type || ( is_array( $type ) && in_array( 'array', $type, true ) );\n\t$is_object_type = 'object' === $type || ( is_array( $type ) && in_array( 'object', $type, true ) );\n\n\tif ( $is_array_type && $is_object_type ) {\n\t\tif ( rest_is_array( $data ) ) {\n\t\t\t$is_object_type = false;\n\t\t} else {\n\t\t\t$is_array_type = false;\n\t\t}\n\t}\n\n\t$has_additional_properties = $is_object_type && isset( $schema['additionalProperties'] ) && is_array( $schema['additionalProperties'] );\n\n\tforeach ( $data as $key => $value ) {\n\t\t$check = array();\n\n\t\tif ( $is_array_type ) {\n\t\t\t$check = isset( $schema['items'] ) ? $schema['items'] : array();\n\t\t} elseif ( $is_object_type ) {\n\t\t\tif ( isset( $schema['properties'][ $key ] ) ) {\n\t\t\t\t$check = $schema['properties'][ $key ];\n\t\t\t} elseif ( $has_additional_properties ) {\n\t\t\t\t$check = $schema['additionalProperties'];\n\t\t\t}\n\t\t}\n\n\t\tif ( ! isset( $check['context'] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( ! in_array( $context, $check['context'], true ) ) {\n\t\t\tif ( $is_array_type ) {\n\t\t\t\t// All array items share schema, so there's no need to check each one.\n\t\t\t\t$data = array();\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( is_object( $data ) ) {\n\t\t\t\tunset( $data->$key );\n\t\t\t} else {\n\t\t\t\tunset( $data[ $key ] );\n\t\t\t}\n\t\t} elseif ( is_array( $value ) || is_object( $value ) ) {\n\t\t\t$new_value = rest_filter_response_by_context( $value, $check, $context );\n\n\t\t\tif ( is_object( $data ) ) {\n\t\t\t\t$data->$key = $new_value;\n\t\t\t} else {\n\t\t\t\t$data[ $key ] = $new_value;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $data;\n}\n\n/**\n * Sets the \"additionalProperties\" to false by default for all object definitions in the schema.\n *\n * @since 5.5.0\n *\n * @param array $schema The schema to modify.\n * @return array The modified schema.\n */\nfunction rest_default_additional_properties_to_false( $schema ) {\n\t$type = (array) $schema['type'];\n\n\tif ( in_array( 'object', $type, true ) ) {\n\t\tif ( isset( $schema['properties'] ) ) {\n\t\t\tforeach ( $schema['properties'] as $key => $child_schema ) {\n\t\t\t\t$schema['properties'][ $key ] = rest_default_additional_properties_to_false( $child_schema );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! isset( $schema['additionalProperties'] ) ) {\n\t\t\t$schema['additionalProperties'] = false;\n\t\t}\n\t}\n\n\tif ( in_array( 'array', $type, true ) ) {\n\t\tif ( isset( $schema['items'] ) ) {\n\t\t\t$schema['items'] = rest_default_additional_properties_to_false( $schema['items'] );\n\t\t}\n\t}\n\n\treturn $schema;\n}\n\n/**\n * Gets the REST API route for a post.\n *\n * @since 5.5.0\n *\n * @param int|WP_Post $post Post ID or post object.\n * @return string The route path with a leading slash for the given post, or an empty string if there is not a route.\n */\nfunction rest_get_route_for_post( $post ) {\n\t$post = get_post( $post );\n\n\tif ( ! $post instanceof WP_Post ) {\n\t\treturn '';\n\t}\n\n\t$post_type = get_post_type_object( $post->post_type );\n\tif ( ! $post_type ) {\n\t\treturn '';\n\t}\n\n\t$controller = $post_type->get_rest_controller();\n\tif ( ! $controller ) {\n\t\treturn '';\n\t}\n\n\t$route = '';\n\n\t// The only two controllers that we can detect are the Attachments and Posts controllers.\n\tif ( in_array( get_class( $controller ), array( 'WP_REST_Attachments_Controller', 'WP_REST_Posts_Controller' ), true ) ) {\n\t\t$namespace = 'wp/v2';\n\t\t$rest_base = ! empty( $post_type->rest_base ) ? $post_type->rest_base : $post_type->name;\n\t\t$route     = sprintf( '/%s/%s/%d', $namespace, $rest_base, $post->ID );\n\t}\n\n\t/**\n\t * Filters the REST API route for a post.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string  $route The route path.\n\t * @param WP_Post $post  The post object.\n\t */\n\treturn apply_filters( 'rest_route_for_post', $route, $post );\n}\n\n/**\n * Gets the REST API route for a term.\n *\n * @since 5.5.0\n *\n * @param int|WP_Term $term Term ID or term object.\n * @return string The route path with a leading slash for the given term, or an empty string if there is not a route.\n */\nfunction rest_get_route_for_term( $term ) {\n\t$term = get_term( $term );\n\n\tif ( ! $term instanceof WP_Term ) {\n\t\treturn '';\n\t}\n\n\t$taxonomy = get_taxonomy( $term->taxonomy );\n\tif ( ! $taxonomy ) {\n\t\treturn '';\n\t}\n\n\t$controller = $taxonomy->get_rest_controller();\n\tif ( ! $controller ) {\n\t\treturn '';\n\t}\n\n\t$route = '';\n\n\t// The only controller that works is the Terms controller.\n\tif ( 'WP_REST_Terms_Controller' === get_class( $controller ) ) {\n\t\t$namespace = 'wp/v2';\n\t\t$rest_base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name;\n\t\t$route     = sprintf( '/%s/%s/%d', $namespace, $rest_base, $term->term_id );\n\t}\n\n\t/**\n\t * Filters the REST API route for a term.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string  $route The route path.\n\t * @param WP_Term $term  The term object.\n\t */\n\treturn apply_filters( 'rest_route_for_term', $route, $term );\n}\n\n/**\n * Gets the REST route for the currently queried object.\n *\n * @since 5.5.0\n *\n * @return string The REST route of the resource, or an empty string if no resource identified.\n */\nfunction rest_get_queried_resource_route() {\n\tif ( is_singular() ) {\n\t\t$route = rest_get_route_for_post( get_queried_object() );\n\t} elseif ( is_category() || is_tag() || is_tax() ) {\n\t\t$route = rest_get_route_for_term( get_queried_object() );\n\t} elseif ( is_author() ) {\n\t\t$route = '/wp/v2/users/' . get_queried_object_id();\n\t} else {\n\t\t$route = '';\n\t}\n\n\t/**\n\t * Filters the REST route for the currently queried object.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $link The route with a leading slash, or an empty string.\n\t */\n\treturn apply_filters( 'rest_queried_resource_route', $route );\n}\n", "num_lines": 2261}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Post revision functions.\n *\n * @package WordPress\n * @subpackage Post_Revisions\n */\n\n/**\n * Determines which fields of posts are to be saved in revisions.\n *\n * @since 2.6.0\n * @since 4.5.0 A `WP_Post` object can now be passed to the `$post` parameter.\n * @since 4.5.0 The optional `$autosave` parameter was deprecated and renamed to `$deprecated`.\n * @access private\n *\n * @param array|WP_Post $post       Optional. A post array or a WP_Post object being processed\n *                                  for insertion as a post revision. Default empty array.\n * @param bool          $deprecated Not used.\n * @return array Array of fields that can be versioned.\n */\nfunction _wp_post_revision_fields( $post = array(), $deprecated = false ) {\n\tstatic $fields = null;\n\n\tif ( ! is_array( $post ) ) {\n\t\t$post = get_post( $post, ARRAY_A );\n\t}\n\n\tif ( is_null( $fields ) ) {\n\t\t// Allow these to be versioned.\n\t\t$fields = array(\n\t\t\t'post_title'   => __( 'Title' ),\n\t\t\t'post_content' => __( 'Content' ),\n\t\t\t'post_excerpt' => __( 'Excerpt' ),\n\t\t);\n\t}\n\n\t/**\n\t * Filters the list of fields saved in post revisions.\n\t *\n\t * Included by default: 'post_title', 'post_content' and 'post_excerpt'.\n\t *\n\t * Disallowed fields: 'ID', 'post_name', 'post_parent', 'post_date',\n\t * 'post_date_gmt', 'post_status', 'post_type', 'comment_count',\n\t * and 'post_author'.\n\t *\n\t * @since 2.6.0\n\t * @since 4.5.0 The `$post` parameter was added.\n\t *\n\t * @param array $fields List of fields to revision. Contains 'post_title',\n\t *                      'post_content', and 'post_excerpt' by default.\n\t * @param array $post   A post array being processed for insertion as a post revision.\n\t */\n\t$fields = apply_filters( '_wp_post_revision_fields', $fields, $post );\n\n\t// WP uses these internally either in versioning or elsewhere - they cannot be versioned.\n\tforeach ( array( 'ID', 'post_name', 'post_parent', 'post_date', 'post_date_gmt', 'post_status', 'post_type', 'comment_count', 'post_author' ) as $protect ) {\n\t\tunset( $fields[ $protect ] );\n\t}\n\n\treturn $fields;\n}\n\n/**\n * Returns a post array ready to be inserted into the posts table as a post revision.\n *\n * @since 4.5.0\n * @access private\n *\n * @param array|WP_Post $post     Optional. A post array or a WP_Post object to be processed\n *                                for insertion as a post revision. Default empty array.\n * @param bool          $autosave Optional. Is the revision an autosave? Default false.\n * @return array Post array ready to be inserted as a post revision.\n */\nfunction _wp_post_revision_data( $post = array(), $autosave = false ) {\n\tif ( ! is_array( $post ) ) {\n\t\t$post = get_post( $post, ARRAY_A );\n\t}\n\n\t$fields = _wp_post_revision_fields( $post );\n\n\t$revision_data = array();\n\n\tforeach ( array_intersect( array_keys( $post ), array_keys( $fields ) ) as $field ) {\n\t\t$revision_data[ $field ] = $post[ $field ];\n\t}\n\n\t$revision_data['post_parent']   = $post['ID'];\n\t$revision_data['post_status']   = 'inherit';\n\t$revision_data['post_type']     = 'revision';\n\t$revision_data['post_name']     = $autosave ? \"$post[ID]-autosave-v1\" : \"$post[ID]-revision-v1\"; // \"1\" is the revisioning system version.\n\t$revision_data['post_date']     = isset( $post['post_modified'] ) ? $post['post_modified'] : '';\n\t$revision_data['post_date_gmt'] = isset( $post['post_modified_gmt'] ) ? $post['post_modified_gmt'] : '';\n\n\treturn $revision_data;\n}\n\n/**\n * Creates a revision for the current version of a post.\n *\n * Typically used immediately after a post update, as every update is a revision,\n * and the most recent revision always matches the current post.\n *\n * @since 2.6.0\n *\n * @param int $post_id The ID of the post to save as a revision.\n * @return int|WP_Error|void Void or 0 if error, new revision ID, if success.\n */\nfunction wp_save_post_revision( $post_id ) {\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\treturn;\n\t}\n\n\t$post = get_post( $post_id );\n\tif ( ! $post ) {\n\t\treturn;\n\t}\n\n\tif ( ! post_type_supports( $post->post_type, 'revisions' ) ) {\n\t\treturn;\n\t}\n\n\tif ( 'auto-draft' === $post->post_status ) {\n\t\treturn;\n\t}\n\n\tif ( ! wp_revisions_enabled( $post ) ) {\n\t\treturn;\n\t}\n\n\t/*\n\t * Compare the proposed update with the last stored revision verifying that\n\t * they are different, unless a plugin tells us to always save regardless.\n\t * If no previous revisions, save one.\n\t */\n\t$revisions = wp_get_post_revisions( $post_id );\n\tif ( $revisions ) {\n\t\t// Grab the last revision, but not an autosave.\n\t\tforeach ( $revisions as $revision ) {\n\t\t\tif ( false !== strpos( $revision->post_name, \"{$revision->post_parent}-revision\" ) ) {\n\t\t\t\t$last_revision = $revision;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters whether the post has changed since the last revision.\n\t\t *\n\t\t * By default a revision is saved only if one of the revisioned fields has changed.\n\t\t * This filter can override that so a revision is saved even if nothing has changed.\n\t\t *\n\t\t * @since 3.6.0\n\t\t *\n\t\t * @param bool    $check_for_changes Whether to check for changes before saving a new revision.\n\t\t *                                   Default true.\n\t\t * @param WP_Post $last_revision     The last revision post object.\n\t\t * @param WP_Post $post              The post object.\n\t\t */\n\t\tif ( isset( $last_revision ) && apply_filters( 'wp_save_post_revision_check_for_changes', true, $last_revision, $post ) ) {\n\t\t\t$post_has_changed = false;\n\n\t\t\tforeach ( array_keys( _wp_post_revision_fields( $post ) ) as $field ) {\n\t\t\t\tif ( normalize_whitespace( $post->$field ) !== normalize_whitespace( $last_revision->$field ) ) {\n\t\t\t\t\t$post_has_changed = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters whether a post has changed.\n\t\t\t *\n\t\t\t * By default a revision is saved only if one of the revisioned fields has changed.\n\t\t\t * This filter allows for additional checks to determine if there were changes.\n\t\t\t *\n\t\t\t * @since 4.1.0\n\t\t\t *\n\t\t\t * @param bool    $post_has_changed Whether the post has changed.\n\t\t\t * @param WP_Post $last_revision    The last revision post object.\n\t\t\t * @param WP_Post $post             The post object.\n\t\t\t */\n\t\t\t$post_has_changed = (bool) apply_filters( 'wp_save_post_revision_post_has_changed', $post_has_changed, $last_revision, $post );\n\n\t\t\t// Don't save revision if post unchanged.\n\t\t\tif ( ! $post_has_changed ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\t$return = _wp_put_post_revision( $post );\n\n\t// If a limit for the number of revisions to keep has been set,\n\t// delete the oldest ones.\n\t$revisions_to_keep = wp_revisions_to_keep( $post );\n\n\tif ( $revisions_to_keep < 0 ) {\n\t\treturn $return;\n\t}\n\n\t$revisions = wp_get_post_revisions( $post_id, array( 'order' => 'ASC' ) );\n\n\t$delete = count( $revisions ) - $revisions_to_keep;\n\n\tif ( $delete < 1 ) {\n\t\treturn $return;\n\t}\n\n\t$revisions = array_slice( $revisions, 0, $delete );\n\n\tfor ( $i = 0; isset( $revisions[ $i ] ); $i++ ) {\n\t\tif ( false !== strpos( $revisions[ $i ]->post_name, 'autosave' ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\twp_delete_post_revision( $revisions[ $i ]->ID );\n\t}\n\n\treturn $return;\n}\n\n/**\n * Retrieve the autosaved data of the specified post.\n *\n * Returns a post object with the information that was autosaved for the specified post.\n * If the optional $user_id is passed, returns the autosave for that user, otherwise\n * returns the latest autosave.\n *\n * @since 2.6.0\n *\n * @param int $post_id The post ID.\n * @param int $user_id Optional The post author ID.\n * @return WP_Post|false The autosaved data or false on failure or when no autosave exists.\n */\nfunction wp_get_post_autosave( $post_id, $user_id = 0 ) {\n\tglobal $wpdb;\n\n\t$autosave_name = $post_id . '-autosave-v1';\n\t$user_id_query = ( 0 !== $user_id ) ? \"AND post_author = $user_id\" : null;\n\n\t// Construct the autosave query.\n\t$autosave_query = \"\n\t\tSELECT *\n\t\tFROM $wpdb->posts\n\t\tWHERE post_parent = %d\n\t\tAND post_type = 'revision'\n\t\tAND post_status = 'inherit'\n\t\tAND post_name   = %s \" . $user_id_query . '\n\t\tORDER BY post_date DESC\n\t\tLIMIT 1';\n\n\t$autosave = $wpdb->get_results(\n\t\t$wpdb->prepare(\n\t\t\t$autosave_query,\n\t\t\t$post_id,\n\t\t\t$autosave_name\n\t\t)\n\t);\n\n\tif ( ! $autosave ) {\n\t\treturn false;\n\t}\n\n\treturn get_post( $autosave[0] );\n}\n\n/**\n * Determines if the specified post is a revision.\n *\n * @since 2.6.0\n *\n * @param int|WP_Post $post Post ID or post object.\n * @return int|false ID of revision's parent on success, false if not a revision.\n */\nfunction wp_is_post_revision( $post ) {\n\t$post = wp_get_post_revision( $post );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\treturn (int) $post->post_parent;\n}\n\n/**\n * Determines if the specified post is an autosave.\n *\n * @since 2.6.0\n *\n * @param int|WP_Post $post Post ID or post object.\n * @return int|false ID of autosave's parent on success, false if not a revision.\n */\nfunction wp_is_post_autosave( $post ) {\n\t$post = wp_get_post_revision( $post );\n\tif ( ! $post ) {\n\t\treturn false;\n\t}\n\n\tif ( false !== strpos( $post->post_name, \"{$post->post_parent}-autosave\" ) ) {\n\t\treturn (int) $post->post_parent;\n\t}\n\n\treturn false;\n}\n\n/**\n * Inserts post data into the posts table as a post revision.\n *\n * @since 2.6.0\n * @access private\n *\n * @param int|WP_Post|array|null $post     Post ID, post object OR post array.\n * @param bool                   $autosave Optional. Is the revision an autosave?\n * @return int|WP_Error WP_Error or 0 if error, new revision ID if success.\n */\nfunction _wp_put_post_revision( $post = null, $autosave = false ) {\n\tif ( is_object( $post ) ) {\n\t\t$post = get_object_vars( $post );\n\t} elseif ( ! is_array( $post ) ) {\n\t\t$post = get_post( $post, ARRAY_A );\n\t}\n\n\tif ( ! $post || empty( $post['ID'] ) ) {\n\t\treturn new WP_Error( 'invalid_post', __( 'Invalid post ID.' ) );\n\t}\n\n\tif ( isset( $post['post_type'] ) && 'revision' === $post['post_type'] ) {\n\t\treturn new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );\n\t}\n\n\t$post = _wp_post_revision_data( $post, $autosave );\n\t$post = wp_slash( $post ); // Since data is from DB.\n\n\t$revision_id = wp_insert_post( $post );\n\tif ( is_wp_error( $revision_id ) ) {\n\t\treturn $revision_id;\n\t}\n\n\tif ( $revision_id ) {\n\t\t/**\n\t\t * Fires once a revision has been saved.\n\t\t *\n\t\t * @since 2.6.0\n\t\t *\n\t\t * @param int $revision_id Post revision ID.\n\t\t */\n\t\tdo_action( '_wp_put_post_revision', $revision_id );\n\t}\n\n\treturn $revision_id;\n}\n\n/**\n * Gets a post revision.\n *\n * @since 2.6.0\n *\n * @param int|WP_Post $post   The post ID or object.\n * @param string      $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which\n *                            correspond to a WP_Post object, an associative array, or a numeric array,\n *                            respectively. Default OBJECT.\n * @param string      $filter Optional sanitation filter. See sanitize_post().\n * @return WP_Post|array|null WP_Post (or array) on success, or null on failure.\n */\nfunction wp_get_post_revision( &$post, $output = OBJECT, $filter = 'raw' ) {\n\t$revision = get_post( $post, OBJECT, $filter );\n\tif ( ! $revision ) {\n\t\treturn $revision;\n\t}\n\tif ( 'revision' !== $revision->post_type ) {\n\t\treturn null;\n\t}\n\n\tif ( OBJECT == $output ) {\n\t\treturn $revision;\n\t} elseif ( ARRAY_A == $output ) {\n\t\t$_revision = get_object_vars( $revision );\n\t\treturn $_revision;\n\t} elseif ( ARRAY_N == $output ) {\n\t\t$_revision = array_values( get_object_vars( $revision ) );\n\t\treturn $_revision;\n\t}\n\n\treturn $revision;\n}\n\n/**\n * Restores a post to the specified revision.\n *\n * Can restore a past revision using all fields of the post revision, or only selected fields.\n *\n * @since 2.6.0\n *\n * @param int|WP_Post $revision_id Revision ID or revision object.\n * @param array       $fields      Optional. What fields to restore from. Defaults to all.\n * @return int|false|null Null if error, false if no fields to restore, (int) post ID if success.\n */\nfunction wp_restore_post_revision( $revision_id, $fields = null ) {\n\t$revision = wp_get_post_revision( $revision_id, ARRAY_A );\n\tif ( ! $revision ) {\n\t\treturn $revision;\n\t}\n\n\tif ( ! is_array( $fields ) ) {\n\t\t$fields = array_keys( _wp_post_revision_fields( $revision ) );\n\t}\n\n\t$update = array();\n\tforeach ( array_intersect( array_keys( $revision ), $fields ) as $field ) {\n\t\t$update[ $field ] = $revision[ $field ];\n\t}\n\n\tif ( ! $update ) {\n\t\treturn false;\n\t}\n\n\t$update['ID'] = $revision['post_parent'];\n\n\t$update = wp_slash( $update ); // Since data is from DB.\n\n\t$post_id = wp_update_post( $update );\n\tif ( ! $post_id || is_wp_error( $post_id ) ) {\n\t\treturn $post_id;\n\t}\n\n\t// Update last edit user.\n\tupdate_post_meta( $post_id, '_edit_last', get_current_user_id() );\n\n\t/**\n\t * Fires after a post revision has been restored.\n\t *\n\t * @since 2.6.0\n\t *\n\t * @param int $post_id     Post ID.\n\t * @param int $revision_id Post revision ID.\n\t */\n\tdo_action( 'wp_restore_post_revision', $post_id, $revision['ID'] );\n\n\treturn $post_id;\n}\n\n/**\n * Deletes a revision.\n *\n * Deletes the row from the posts table corresponding to the specified revision.\n *\n * @since 2.6.0\n *\n * @param int|WP_Post $revision_id Revision ID or revision object.\n * @return array|false|WP_Post|WP_Error|null Null or WP_Error if error, deleted post if success.\n */\nfunction wp_delete_post_revision( $revision_id ) {\n\t$revision = wp_get_post_revision( $revision_id );\n\tif ( ! $revision ) {\n\t\treturn $revision;\n\t}\n\n\t$delete = wp_delete_post( $revision->ID );\n\tif ( $delete ) {\n\t\t/**\n\t\t * Fires once a post revision has been deleted.\n\t\t *\n\t\t * @since 2.6.0\n\t\t *\n\t\t * @param int     $revision_id Post revision ID.\n\t\t * @param WP_Post $revision    Post revision object.\n\t\t */\n\t\tdo_action( 'wp_delete_post_revision', $revision->ID, $revision );\n\t}\n\n\treturn $delete;\n}\n\n/**\n * Returns all revisions of specified post.\n *\n * @since 2.6.0\n *\n * @see get_children()\n *\n * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global `$post`.\n * @param array|null  $args    Optional. Arguments for retrieving post revisions. Default null.\n * @return array An array of revisions, or an empty array if none.\n */\nfunction wp_get_post_revisions( $post_id = 0, $args = null ) {\n\t$post = get_post( $post_id );\n\tif ( ! $post || empty( $post->ID ) ) {\n\t\treturn array();\n\t}\n\n\t$defaults = array(\n\t\t'order'         => 'DESC',\n\t\t'orderby'       => 'date ID',\n\t\t'check_enabled' => true,\n\t);\n\t$args     = wp_parse_args( $args, $defaults );\n\n\tif ( $args['check_enabled'] && ! wp_revisions_enabled( $post ) ) {\n\t\treturn array();\n\t}\n\n\t$args = array_merge(\n\t\t$args,\n\t\tarray(\n\t\t\t'post_parent' => $post->ID,\n\t\t\t'post_type'   => 'revision',\n\t\t\t'post_status' => 'inherit',\n\t\t)\n\t);\n\n\t$revisions = get_children( $args );\n\tif ( ! $revisions ) {\n\t\treturn array();\n\t}\n\n\treturn $revisions;\n}\n\n/**\n * Determine if revisions are enabled for a given post.\n *\n * @since 3.6.0\n *\n * @param WP_Post $post The post object.\n * @return bool True if number of revisions to keep isn't zero, false otherwise.\n */\nfunction wp_revisions_enabled( $post ) {\n\treturn wp_revisions_to_keep( $post ) !== 0;\n}\n\n/**\n * Determine how many revisions to retain for a given post.\n *\n * By default, an infinite number of revisions are kept.\n *\n * The constant WP_POST_REVISIONS can be set in wp-config to specify the limit\n * of revisions to keep.\n *\n * @since 3.6.0\n *\n * @param WP_Post $post The post object.\n * @return int The number of revisions to keep.\n */\nfunction wp_revisions_to_keep( $post ) {\n\t$num = WP_POST_REVISIONS;\n\n\tif ( true === $num ) {\n\t\t$num = -1;\n\t} else {\n\t\t$num = intval( $num );\n\t}\n\n\tif ( ! post_type_supports( $post->post_type, 'revisions' ) ) {\n\t\t$num = 0;\n\t}\n\n\t/**\n\t * Filters the number of revisions to save for the given post.\n\t *\n\t * Overrides the value of WP_POST_REVISIONS.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param int     $num  Number of revisions to store.\n\t * @param WP_Post $post Post object.\n\t */\n\treturn (int) apply_filters( 'wp_revisions_to_keep', $num, $post );\n}\n\n/**\n * Sets up the post object for preview based on the post autosave.\n *\n * @since 2.7.0\n * @access private\n *\n * @param WP_Post $post\n * @return WP_Post|false\n */\nfunction _set_preview( $post ) {\n\tif ( ! is_object( $post ) ) {\n\t\treturn $post;\n\t}\n\n\t$preview = wp_get_post_autosave( $post->ID );\n\tif ( ! is_object( $preview ) ) {\n\t\treturn $post;\n\t}\n\n\t$preview = sanitize_post( $preview );\n\n\t$post->post_content = $preview->post_content;\n\t$post->post_title   = $preview->post_title;\n\t$post->post_excerpt = $preview->post_excerpt;\n\n\tadd_filter( 'get_the_terms', '_wp_preview_terms_filter', 10, 3 );\n\tadd_filter( 'get_post_metadata', '_wp_preview_post_thumbnail_filter', 10, 3 );\n\n\treturn $post;\n}\n\n/**\n * Filters the latest content for preview from the post autosave.\n *\n * @since 2.7.0\n * @access private\n */\nfunction _show_post_preview() {\n\tif ( isset( $_GET['preview_id'] ) && isset( $_GET['preview_nonce'] ) ) {\n\t\t$id = (int) $_GET['preview_id'];\n\n\t\tif ( false === wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . $id ) ) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to preview drafts.' ), 403 );\n\t\t}\n\n\t\tadd_filter( 'the_preview', '_set_preview' );\n\t}\n}\n\n/**\n * Filters terms lookup to set the post format.\n *\n * @since 3.6.0\n * @access private\n *\n * @param array  $terms\n * @param int    $post_id\n * @param string $taxonomy\n * @return array\n */\nfunction _wp_preview_terms_filter( $terms, $post_id, $taxonomy ) {\n\t$post = get_post();\n\tif ( ! $post ) {\n\t\treturn $terms;\n\t}\n\n\tif ( empty( $_REQUEST['post_format'] ) || $post->ID != $post_id\n\t\t|| 'post_format' !== $taxonomy || 'revision' === $post->post_type\n\t) {\n\t\treturn $terms;\n\t}\n\n\tif ( 'standard' === $_REQUEST['post_format'] ) {\n\t\t$terms = array();\n\t} else {\n\t\t$term = get_term_by( 'slug', 'post-format-' . sanitize_key( $_REQUEST['post_format'] ), 'post_format' );\n\t\tif ( $term ) {\n\t\t\t$terms = array( $term ); // Can only have one post format.\n\t\t}\n\t}\n\n\treturn $terms;\n}\n\n/**\n * Filters post thumbnail lookup to set the post thumbnail.\n *\n * @since 4.6.0\n * @access private\n *\n * @param null|array|string $value    The value to return - a single metadata value, or an array of values.\n * @param int               $post_id  Post ID.\n * @param string            $meta_key Meta key.\n * @return null|array The default return value or the post thumbnail meta array.\n */\nfunction _wp_preview_post_thumbnail_filter( $value, $post_id, $meta_key ) {\n\t$post = get_post();\n\tif ( ! $post ) {\n\t\treturn $value;\n\t}\n\n\tif ( empty( $_REQUEST['_thumbnail_id'] ) ||\n\t\tempty( $_REQUEST['preview_id'] ) ||\n\t\t$post->ID != $post_id ||\n\t\t'_thumbnail_id' !== $meta_key ||\n\t\t'revision' === $post->post_type ||\n\t\t$post_id != $_REQUEST['preview_id'] ) {\n\n\t\treturn $value;\n\t}\n\n\t$thumbnail_id = intval( $_REQUEST['_thumbnail_id'] );\n\tif ( $thumbnail_id <= 0 ) {\n\t\treturn '';\n\t}\n\n\treturn strval( $thumbnail_id );\n}\n\n/**\n * Gets the post revision version.\n *\n * @since 3.6.0\n * @access private\n *\n * @param WP_Post $revision\n * @return int|false\n */\nfunction _wp_get_post_revision_version( $revision ) {\n\tif ( is_object( $revision ) ) {\n\t\t$revision = get_object_vars( $revision );\n\t} elseif ( ! is_array( $revision ) ) {\n\t\treturn false;\n\t}\n\n\tif ( preg_match( '/^\\d+-(?:autosave|revision)-v(\\d+)$/', $revision['post_name'], $matches ) ) {\n\t\treturn (int) $matches[1];\n\t}\n\n\treturn 0;\n}\n\n/**\n * Upgrade the revisions author, add the current post as a revision and set the revisions version to 1\n *\n * @since 3.6.0\n * @access private\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param WP_Post $post      Post object\n * @param array   $revisions Current revisions of the post\n * @return bool true if the revisions were upgraded, false if problems\n */\nfunction _wp_upgrade_revisions_of_post( $post, $revisions ) {\n\tglobal $wpdb;\n\n\t// Add post option exclusively.\n\t$lock   = \"revision-upgrade-{$post->ID}\";\n\t$now    = time();\n\t$result = $wpdb->query( $wpdb->prepare( \"INSERT IGNORE INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, 'no') /* LOCK */\", $lock, $now ) );\n\tif ( ! $result ) {\n\t\t// If we couldn't get a lock, see how old the previous lock is.\n\t\t$locked = get_option( $lock );\n\t\tif ( ! $locked ) {\n\t\t\t// Can't write to the lock, and can't read the lock.\n\t\t\t// Something broken has happened.\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $locked > $now - 3600 ) {\n\t\t\t// Lock is not too old: some other process may be upgrading this post. Bail.\n\t\t\treturn false;\n\t\t}\n\n\t\t// Lock is too old - update it (below) and continue.\n\t}\n\n\t// If we could get a lock, re-\"add\" the option to fire all the correct filters.\n\tupdate_option( $lock, $now );\n\n\treset( $revisions );\n\t$add_last = true;\n\n\tdo {\n\t\t$this_revision = current( $revisions );\n\t\t$prev_revision = next( $revisions );\n\n\t\t$this_revision_version = _wp_get_post_revision_version( $this_revision );\n\n\t\t// Something terrible happened.\n\t\tif ( false === $this_revision_version ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// 1 is the latest revision version, so we're already up to date.\n\t\t// No need to add a copy of the post as latest revision.\n\t\tif ( 0 < $this_revision_version ) {\n\t\t\t$add_last = false;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Always update the revision version.\n\t\t$update = array(\n\t\t\t'post_name' => preg_replace( '/^(\\d+-(?:autosave|revision))[\\d-]*$/', '$1-v1', $this_revision->post_name ),\n\t\t);\n\n\t\t/*\n\t\t * If this revision is the oldest revision of the post, i.e. no $prev_revision,\n\t\t * the correct post_author is probably $post->post_author, but that's only a good guess.\n\t\t * Update the revision version only and Leave the author as-is.\n\t\t */\n\t\tif ( $prev_revision ) {\n\t\t\t$prev_revision_version = _wp_get_post_revision_version( $prev_revision );\n\n\t\t\t// If the previous revision is already up to date, it no longer has the information we need :(\n\t\t\tif ( $prev_revision_version < 1 ) {\n\t\t\t\t$update['post_author'] = $prev_revision->post_author;\n\t\t\t}\n\t\t}\n\n\t\t// Upgrade this revision.\n\t\t$result = $wpdb->update( $wpdb->posts, $update, array( 'ID' => $this_revision->ID ) );\n\n\t\tif ( $result ) {\n\t\t\twp_cache_delete( $this_revision->ID, 'posts' );\n\t\t}\n\t} while ( $prev_revision );\n\n\tdelete_option( $lock );\n\n\t// Add a copy of the post as latest revision.\n\tif ( $add_last ) {\n\t\twp_save_post_revision( $post->ID );\n\t}\n\n\treturn true;\n}\n", "num_lines": 806}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Rewrite API\n *\n * @package WordPress\n * @subpackage Rewrite\n */\n\n/**\n * Endpoint Mask for default, which is nothing.\n *\n * @since 2.1.0\n */\ndefine( 'EP_NONE', 0 );\n\n/**\n * Endpoint Mask for Permalink.\n *\n * @since 2.1.0\n */\ndefine( 'EP_PERMALINK', 1 );\n\n/**\n * Endpoint Mask for Attachment.\n *\n * @since 2.1.0\n */\ndefine( 'EP_ATTACHMENT', 2 );\n\n/**\n * Endpoint Mask for date.\n *\n * @since 2.1.0\n */\ndefine( 'EP_DATE', 4 );\n\n/**\n * Endpoint Mask for year\n *\n * @since 2.1.0\n */\ndefine( 'EP_YEAR', 8 );\n\n/**\n * Endpoint Mask for month.\n *\n * @since 2.1.0\n */\ndefine( 'EP_MONTH', 16 );\n\n/**\n * Endpoint Mask for day.\n *\n * @since 2.1.0\n */\ndefine( 'EP_DAY', 32 );\n\n/**\n * Endpoint Mask for root.\n *\n * @since 2.1.0\n */\ndefine( 'EP_ROOT', 64 );\n\n/**\n * Endpoint Mask for comments.\n *\n * @since 2.1.0\n */\ndefine( 'EP_COMMENTS', 128 );\n\n/**\n * Endpoint Mask for searches.\n *\n * @since 2.1.0\n */\ndefine( 'EP_SEARCH', 256 );\n\n/**\n * Endpoint Mask for categories.\n *\n * @since 2.1.0\n */\ndefine( 'EP_CATEGORIES', 512 );\n\n/**\n * Endpoint Mask for tags.\n *\n * @since 2.3.0\n */\ndefine( 'EP_TAGS', 1024 );\n\n/**\n * Endpoint Mask for authors.\n *\n * @since 2.1.0\n */\ndefine( 'EP_AUTHORS', 2048 );\n\n/**\n * Endpoint Mask for pages.\n *\n * @since 2.1.0\n */\ndefine( 'EP_PAGES', 4096 );\n\n/**\n * Endpoint Mask for all archive views.\n *\n * @since 3.7.0\n */\ndefine( 'EP_ALL_ARCHIVES', EP_DATE | EP_YEAR | EP_MONTH | EP_DAY | EP_CATEGORIES | EP_TAGS | EP_AUTHORS );\n\n/**\n * Endpoint Mask for everything.\n *\n * @since 2.1.0\n */\ndefine( 'EP_ALL', EP_PERMALINK | EP_ATTACHMENT | EP_ROOT | EP_COMMENTS | EP_SEARCH | EP_PAGES | EP_ALL_ARCHIVES );\n\n/**\n * Adds a rewrite rule that transforms a URL structure to a set of query vars.\n *\n * Any value in the $after parameter that isn't 'bottom' will result in the rule\n * being placed at the top of the rewrite rules.\n *\n * @since 2.1.0\n * @since 4.4.0 Array support was added to the `$query` parameter.\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string       $regex Regular expression to match request against.\n * @param string|array $query The corresponding query vars for this rewrite rule.\n * @param string       $after Optional. Priority of the new rule. Accepts 'top'\n *                            or 'bottom'. Default 'bottom'.\n */\nfunction add_rewrite_rule( $regex, $query, $after = 'bottom' ) {\n\tglobal $wp_rewrite;\n\n\t$wp_rewrite->add_rule( $regex, $query, $after );\n}\n\n/**\n * Add a new rewrite tag (like %postname%).\n *\n * The $query parameter is optional. If it is omitted you must ensure that\n * you call this on, or before, the {@see 'init'} hook. This is because $query defaults\n * to \"$tag=\", and for this to work a new query var has to be added.\n *\n * @since 2.1.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n * @global WP         $wp         Current WordPress environment instance.\n *\n * @param string $tag   Name of the new rewrite tag.\n * @param string $regex Regular expression to substitute the tag for in rewrite rules.\n * @param string $query Optional. String to append to the rewritten query. Must end in '='. Default empty.\n */\nfunction add_rewrite_tag( $tag, $regex, $query = '' ) {\n\t// Validate the tag's name.\n\tif ( strlen( $tag ) < 3 || '%' !== $tag[0] || '%' !== $tag[ strlen( $tag ) - 1 ] ) {\n\t\treturn;\n\t}\n\n\tglobal $wp_rewrite, $wp;\n\n\tif ( empty( $query ) ) {\n\t\t$qv = trim( $tag, '%' );\n\t\t$wp->add_query_var( $qv );\n\t\t$query = $qv . '=';\n\t}\n\n\t$wp_rewrite->add_rewrite_tag( $tag, $regex, $query );\n}\n\n/**\n * Removes an existing rewrite tag (like %postname%).\n *\n * @since 4.5.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string $tag Name of the rewrite tag.\n */\nfunction remove_rewrite_tag( $tag ) {\n\tglobal $wp_rewrite;\n\t$wp_rewrite->remove_rewrite_tag( $tag );\n}\n\n/**\n * Add permalink structure.\n *\n * @since 3.0.0\n *\n * @see WP_Rewrite::add_permastruct()\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string $name   Name for permalink structure.\n * @param string $struct Permalink structure.\n * @param array  $args   Optional. Arguments for building the rules from the permalink structure,\n *                       see WP_Rewrite::add_permastruct() for full details. Default empty array.\n */\nfunction add_permastruct( $name, $struct, $args = array() ) {\n\tglobal $wp_rewrite;\n\n\t// Back-compat for the old parameters: $with_front and $ep_mask.\n\tif ( ! is_array( $args ) ) {\n\t\t$args = array( 'with_front' => $args );\n\t}\n\tif ( func_num_args() == 4 ) {\n\t\t$args['ep_mask'] = func_get_arg( 3 );\n\t}\n\n\t$wp_rewrite->add_permastruct( $name, $struct, $args );\n}\n\n/**\n * Removes a permalink structure.\n *\n * Can only be used to remove permastructs that were added using add_permastruct().\n * Built-in permastructs cannot be removed.\n *\n * @since 4.5.0\n *\n * @see WP_Rewrite::remove_permastruct()\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string $name Name for permalink structure.\n */\nfunction remove_permastruct( $name ) {\n\tglobal $wp_rewrite;\n\n\t$wp_rewrite->remove_permastruct( $name );\n}\n\n/**\n * Add a new feed type like /atom1/.\n *\n * @since 2.1.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string   $feedname Feed name.\n * @param callable $function Callback to run on feed display.\n * @return string Feed action name.\n */\nfunction add_feed( $feedname, $function ) {\n\tglobal $wp_rewrite;\n\n\tif ( ! in_array( $feedname, $wp_rewrite->feeds, true ) ) {\n\t\t$wp_rewrite->feeds[] = $feedname;\n\t}\n\n\t$hook = 'do_feed_' . $feedname;\n\n\t// Remove default function hook.\n\tremove_action( $hook, $hook );\n\n\tadd_action( $hook, $function, 10, 2 );\n\n\treturn $hook;\n}\n\n/**\n * Remove rewrite rules and then recreate rewrite rules.\n *\n * @since 3.0.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param bool $hard Whether to update .htaccess (hard flush) or just update\n *                   rewrite_rules option (soft flush). Default is true (hard).\n */\nfunction flush_rewrite_rules( $hard = true ) {\n\tglobal $wp_rewrite;\n\n\tif ( is_callable( array( $wp_rewrite, 'flush_rules' ) ) ) {\n\t\t$wp_rewrite->flush_rules( $hard );\n\t}\n}\n\n/**\n * Add an endpoint, like /trackback/.\n *\n * Adding an endpoint creates extra rewrite rules for each of the matching\n * places specified by the provided bitmask. For example:\n *\n *     add_rewrite_endpoint( 'json', EP_PERMALINK | EP_PAGES );\n *\n * will add a new rewrite rule ending with \"json(/(.*))?/?$\" for every permastruct\n * that describes a permalink (post) or page. This is rewritten to \"json=$match\"\n * where $match is the part of the URL matched by the endpoint regex (e.g. \"foo\" in\n * \"[permalink]/json/foo/\").\n *\n * A new query var with the same name as the endpoint will also be created.\n *\n * When specifying $places ensure that you are using the EP_* constants (or a\n * combination of them using the bitwise OR operator) as their values are not\n * guaranteed to remain static (especially `EP_ALL`).\n *\n * Be sure to flush the rewrite rules - see flush_rewrite_rules() - when your plugin gets\n * activated and deactivated.\n *\n * @since 2.1.0\n * @since 4.3.0 Added support for skipping query var registration by passing `false` to `$query_var`.\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param string      $name      Name of the endpoint.\n * @param int         $places    Endpoint mask describing the places the endpoint should be added.\n * @param string|bool $query_var Name of the corresponding query variable. Pass `false` to skip registering a query_var\n *                               for this endpoint. Defaults to the value of `$name`.\n */\nfunction add_rewrite_endpoint( $name, $places, $query_var = true ) {\n\tglobal $wp_rewrite;\n\t$wp_rewrite->add_endpoint( $name, $places, $query_var );\n}\n\n/**\n * Filters the URL base for taxonomies.\n *\n * To remove any manually prepended /index.php/.\n *\n * @access private\n * @since 2.6.0\n *\n * @param string $base The taxonomy base that we're going to filter\n * @return string\n */\nfunction _wp_filter_taxonomy_base( $base ) {\n\tif ( ! empty( $base ) ) {\n\t\t$base = preg_replace( '|^/index\\.php/|', '', $base );\n\t\t$base = trim( $base, '/' );\n\t}\n\treturn $base;\n}\n\n\n/**\n * Resolve numeric slugs that collide with date permalinks.\n *\n * Permalinks of posts with numeric slugs can sometimes look to WP_Query::parse_query()\n * like a date archive, as when your permalink structure is `/%year%/%postname%/` and\n * a post with post_name '05' has the URL `/2015/05/`.\n *\n * This function detects conflicts of this type and resolves them in favor of the\n * post permalink.\n *\n * Note that, since 4.3.0, wp_unique_post_slug() prevents the creation of post slugs\n * that would result in a date archive conflict. The resolution performed in this\n * function is primarily for legacy content, as well as cases when the admin has changed\n * the site's permalink structure in a way that introduces URL conflicts.\n *\n * @since 4.3.0\n *\n * @param array $query_vars Optional. Query variables for setting up the loop, as determined in\n *                          WP::parse_request(). Default empty array.\n * @return array Returns the original array of query vars, with date/post conflicts resolved.\n */\nfunction wp_resolve_numeric_slug_conflicts( $query_vars = array() ) {\n\tif ( ! isset( $query_vars['year'] ) && ! isset( $query_vars['monthnum'] ) && ! isset( $query_vars['day'] ) ) {\n\t\treturn $query_vars;\n\t}\n\n\t// Identify the 'postname' position in the permastruct array.\n\t$permastructs   = array_values( array_filter( explode( '/', get_option( 'permalink_structure' ) ) ) );\n\t$postname_index = array_search( '%postname%', $permastructs, true );\n\n\tif ( false === $postname_index ) {\n\t\treturn $query_vars;\n\t}\n\n\t/*\n\t * A numeric slug could be confused with a year, month, or day, depending on position. To account for\n\t * the possibility of post pagination (eg 2015/2 for the second page of a post called '2015'), our\n\t * `is_*` checks are generous: check for year-slug clashes when `is_year` *or* `is_month`, and check\n\t * for month-slug clashes when `is_month` *or* `is_day`.\n\t */\n\t$compare = '';\n\tif ( 0 === $postname_index && ( isset( $query_vars['year'] ) || isset( $query_vars['monthnum'] ) ) ) {\n\t\t$compare = 'year';\n\t} elseif ( $postname_index && '%year%' === $permastructs[ $postname_index - 1 ] && ( isset( $query_vars['monthnum'] ) || isset( $query_vars['day'] ) ) ) {\n\t\t$compare = 'monthnum';\n\t} elseif ( $postname_index && '%monthnum%' === $permastructs[ $postname_index - 1 ] && isset( $query_vars['day'] ) ) {\n\t\t$compare = 'day';\n\t}\n\n\tif ( ! $compare ) {\n\t\treturn $query_vars;\n\t}\n\n\t// This is the potentially clashing slug.\n\t$value = $query_vars[ $compare ];\n\n\t$post = get_page_by_path( $value, OBJECT, 'post' );\n\tif ( ! ( $post instanceof WP_Post ) ) {\n\t\treturn $query_vars;\n\t}\n\n\t// If the date of the post doesn't match the date specified in the URL, resolve to the date archive.\n\tif ( preg_match( '/^([0-9]{4})\\-([0-9]{2})/', $post->post_date, $matches ) && isset( $query_vars['year'] ) && ( 'monthnum' === $compare || 'day' === $compare ) ) {\n\t\t// $matches[1] is the year the post was published.\n\t\tif ( intval( $query_vars['year'] ) !== intval( $matches[1] ) ) {\n\t\t\treturn $query_vars;\n\t\t}\n\n\t\t// $matches[2] is the month the post was published.\n\t\tif ( 'day' === $compare && isset( $query_vars['monthnum'] ) && intval( $query_vars['monthnum'] ) !== intval( $matches[2] ) ) {\n\t\t\treturn $query_vars;\n\t\t}\n\t}\n\n\t/*\n\t * If the located post contains nextpage pagination, then the URL chunk following postname may be\n\t * intended as the page number. Verify that it's a valid page before resolving to it.\n\t */\n\t$maybe_page = '';\n\tif ( 'year' === $compare && isset( $query_vars['monthnum'] ) ) {\n\t\t$maybe_page = $query_vars['monthnum'];\n\t} elseif ( 'monthnum' === $compare && isset( $query_vars['day'] ) ) {\n\t\t$maybe_page = $query_vars['day'];\n\t}\n\t// Bug found in #11694 - 'page' was returning '/4'.\n\t$maybe_page = (int) trim( $maybe_page, '/' );\n\n\t$post_page_count = substr_count( $post->post_content, '<!--nextpage-->' ) + 1;\n\n\t// If the post doesn't have multiple pages, but a 'page' candidate is found, resolve to the date archive.\n\tif ( 1 === $post_page_count && $maybe_page ) {\n\t\treturn $query_vars;\n\t}\n\n\t// If the post has multiple pages and the 'page' number isn't valid, resolve to the date archive.\n\tif ( $post_page_count > 1 && $maybe_page > $post_page_count ) {\n\t\treturn $query_vars;\n\t}\n\n\t// If we've gotten to this point, we have a slug/date clash. First, adjust for nextpage.\n\tif ( '' !== $maybe_page ) {\n\t\t$query_vars['page'] = intval( $maybe_page );\n\t}\n\n\t// Next, unset autodetected date-related query vars.\n\tunset( $query_vars['year'] );\n\tunset( $query_vars['monthnum'] );\n\tunset( $query_vars['day'] );\n\n\t// Then, set the identified post.\n\t$query_vars['name'] = $post->post_name;\n\n\t// Finally, return the modified query vars.\n\treturn $query_vars;\n}\n\n/**\n * Examine a URL and try to determine the post ID it represents.\n *\n * Checks are supposedly from the hosted site blog.\n *\n * @since 1.0.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n * @global WP         $wp         Current WordPress environment instance.\n *\n * @param string $url Permalink to check.\n * @return int Post ID, or 0 on failure.\n */\nfunction url_to_postid( $url ) {\n\tglobal $wp_rewrite;\n\n\t/**\n\t * Filters the URL to derive the post ID from.\n\t *\n\t * @since 2.2.0\n\t *\n\t * @param string $url The URL to derive the post ID from.\n\t */\n\t$url = apply_filters( 'url_to_postid', $url );\n\n\t$url_host      = str_replace( 'www.', '', parse_url( $url, PHP_URL_HOST ) );\n\t$home_url_host = str_replace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );\n\n\t// Bail early if the URL does not belong to this site.\n\tif ( $url_host && $url_host !== $home_url_host ) {\n\t\treturn 0;\n\t}\n\n\t// First, check to see if there is a 'p=N' or 'page_id=N' to match against.\n\tif ( preg_match( '#[?&](p|page_id|attachment_id)=(\\d+)#', $url, $values ) ) {\n\t\t$id = absint( $values[2] );\n\t\tif ( $id ) {\n\t\t\treturn $id;\n\t\t}\n\t}\n\n\t// Get rid of the #anchor.\n\t$url_split = explode( '#', $url );\n\t$url       = $url_split[0];\n\n\t// Get rid of URL ?query=string.\n\t$url_split = explode( '?', $url );\n\t$url       = $url_split[0];\n\n\t// Set the correct URL scheme.\n\t$scheme = parse_url( home_url(), PHP_URL_SCHEME );\n\t$url    = set_url_scheme( $url, $scheme );\n\n\t// Add 'www.' if it is absent and should be there.\n\tif ( false !== strpos( home_url(), '://www.' ) && false === strpos( $url, '://www.' ) ) {\n\t\t$url = str_replace( '://', '://www.', $url );\n\t}\n\n\t// Strip 'www.' if it is present and shouldn't be.\n\tif ( false === strpos( home_url(), '://www.' ) ) {\n\t\t$url = str_replace( '://www.', '://', $url );\n\t}\n\n\tif ( trim( $url, '/' ) === home_url() && 'page' === get_option( 'show_on_front' ) ) {\n\t\t$page_on_front = get_option( 'page_on_front' );\n\n\t\tif ( $page_on_front && get_post( $page_on_front ) instanceof WP_Post ) {\n\t\t\treturn (int) $page_on_front;\n\t\t}\n\t}\n\n\t// Check to see if we are using rewrite rules.\n\t$rewrite = $wp_rewrite->wp_rewrite_rules();\n\n\t// Not using rewrite rules, and 'p=N' and 'page_id=N' methods failed, so we're out of options.\n\tif ( empty( $rewrite ) ) {\n\t\treturn 0;\n\t}\n\n\t// Strip 'index.php/' if we're not using path info permalinks.\n\tif ( ! $wp_rewrite->using_index_permalinks() ) {\n\t\t$url = str_replace( $wp_rewrite->index . '/', '', $url );\n\t}\n\n\tif ( false !== strpos( trailingslashit( $url ), home_url( '/' ) ) ) {\n\t\t// Chop off http://domain.com/[path].\n\t\t$url = str_replace( home_url(), '', $url );\n\t} else {\n\t\t// Chop off /path/to/blog.\n\t\t$home_path = parse_url( home_url( '/' ) );\n\t\t$home_path = isset( $home_path['path'] ) ? $home_path['path'] : '';\n\t\t$url       = preg_replace( sprintf( '#^%s#', preg_quote( $home_path ) ), '', trailingslashit( $url ) );\n\t}\n\n\t// Trim leading and lagging slashes.\n\t$url = trim( $url, '/' );\n\n\t$request              = $url;\n\t$post_type_query_vars = array();\n\n\tforeach ( get_post_types( array(), 'objects' ) as $post_type => $t ) {\n\t\tif ( ! empty( $t->query_var ) ) {\n\t\t\t$post_type_query_vars[ $t->query_var ] = $post_type;\n\t\t}\n\t}\n\n\t// Look for matches.\n\t$request_match = $request;\n\tforeach ( (array) $rewrite as $match => $query ) {\n\n\t\t// If the requesting file is the anchor of the match,\n\t\t// prepend it to the path info.\n\t\tif ( ! empty( $url ) && ( $url != $request ) && ( strpos( $match, $url ) === 0 ) ) {\n\t\t\t$request_match = $url . '/' . $request;\n\t\t}\n\n\t\tif ( preg_match( \"#^$match#\", $request_match, $matches ) ) {\n\n\t\t\tif ( $wp_rewrite->use_verbose_page_rules && preg_match( '/pagename=\\$matches\\[([0-9]+)\\]/', $query, $varmatch ) ) {\n\t\t\t\t// This is a verbose page match, let's check to be sure about it.\n\t\t\t\t$page = get_page_by_path( $matches[ $varmatch[1] ] );\n\t\t\t\tif ( ! $page ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$post_status_obj = get_post_status_object( $page->post_status );\n\t\t\t\tif ( ! $post_status_obj->public && ! $post_status_obj->protected\n\t\t\t\t\t&& ! $post_status_obj->private && $post_status_obj->exclude_from_search ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Got a match.\n\t\t\t// Trim the query of everything up to the '?'.\n\t\t\t$query = preg_replace( '!^.+\\?!', '', $query );\n\n\t\t\t// Substitute the substring matches into the query.\n\t\t\t$query = addslashes( WP_MatchesMapRegex::apply( $query, $matches ) );\n\n\t\t\t// Filter out non-public query vars.\n\t\t\tglobal $wp;\n\t\t\tparse_str( $query, $query_vars );\n\t\t\t$query = array();\n\t\t\tforeach ( (array) $query_vars as $key => $value ) {\n\t\t\t\tif ( in_array( (string) $key, $wp->public_query_vars, true ) ) {\n\t\t\t\t\t$query[ $key ] = $value;\n\t\t\t\t\tif ( isset( $post_type_query_vars[ $key ] ) ) {\n\t\t\t\t\t\t$query['post_type'] = $post_type_query_vars[ $key ];\n\t\t\t\t\t\t$query['name']      = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Resolve conflicts between posts with numeric slugs and date archive queries.\n\t\t\t$query = wp_resolve_numeric_slug_conflicts( $query );\n\n\t\t\t// Do the query.\n\t\t\t$query = new WP_Query( $query );\n\t\t\tif ( ! empty( $query->posts ) && $query->is_singular ) {\n\t\t\t\treturn $query->post->ID;\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n\treturn 0;\n}\n", "num_lines": 622}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Deprecated. Use rss.php instead.\n *\n * @package WordPress\n * @deprecated 2.1.0\n */\n\n_deprecated_file( basename( __FILE__ ), '2.1.0', WPINC . '/rss.php' );\nrequire_once ABSPATH . WPINC . '/rss.php';\n", "num_lines": 11}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * MagpieRSS: a simple RSS integration tool\n *\n * A compiled file for RSS syndication\n *\n * @author Kellan Elliott-McCrea <kellan@protest.net>\n * @version 0.51\n * @license GPL\n *\n * @package External\n * @subpackage MagpieRSS\n * @deprecated 3.0.0 Use SimplePie instead.\n */\n\n/**\n * Deprecated. Use SimplePie (class-simplepie.php) instead.\n */\n_deprecated_file( basename( __FILE__ ), '3.0.0', WPINC . '/class-simplepie.php' );\n\n/**\n * Fires before MagpieRSS is loaded, to optionally replace it.\n *\n * @since 2.3.0\n * @deprecated 3.0.0\n */\ndo_action( 'load_feed_engine' );\n\n/** RSS feed constant. */\ndefine('RSS', 'RSS');\ndefine('ATOM', 'Atom');\ndefine('MAGPIE_USER_AGENT', 'WordPress/' . $GLOBALS['wp_version']);\n\nclass MagpieRSS {\n\tvar $parser;\n\tvar $current_item\t= array();\t// item currently being parsed\n\tvar $items\t\t\t= array();\t// collection of parsed items\n\tvar $channel\t\t= array();\t// hash of channel fields\n\tvar $textinput\t\t= array();\n\tvar $image\t\t\t= array();\n\tvar $feed_type;\n\tvar $feed_version;\n\n\t// parser variables\n\tvar $stack\t\t\t\t= array(); // parser stack\n\tvar $inchannel\t\t\t= false;\n\tvar $initem \t\t\t= false;\n\tvar $incontent\t\t\t= false; // if in Atom <content mode=\"xml\"> field\n\tvar $intextinput\t\t= false;\n\tvar $inimage \t\t\t= false;\n\tvar $current_field\t\t= '';\n\tvar $current_namespace\t= false;\n\n\t//var $ERROR = \"\";\n\n\tvar $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright');\n\n\t/**\n\t * PHP5 constructor.\n\t */\n\tfunction __construct( $source ) {\n\n\t\t# Check if PHP xml isn't compiled\n\t\t#\n\t\tif ( ! function_exists('xml_parser_create') ) {\n\t\t\treturn trigger_error( \"PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension.\" );\n\t\t}\n\n\t\t$parser = xml_parser_create();\n\n\t\t$this->parser = $parser;\n\n\t\t# pass in parser, and a reference to this object\n\t\t# set up handlers\n\t\t#\n\t\txml_set_object( $this->parser, $this );\n\t\txml_set_element_handler($this->parser,\n\t\t\t\t'feed_start_element', 'feed_end_element' );\n\n\t\txml_set_character_data_handler( $this->parser, 'feed_cdata' );\n\n\t\t$status = xml_parse( $this->parser, $source );\n\n\t\tif (! $status ) {\n\t\t\t$errorcode = xml_get_error_code( $this->parser );\n\t\t\tif ( $errorcode != XML_ERROR_NONE ) {\n\t\t\t\t$xml_error = xml_error_string( $errorcode );\n\t\t\t\t$error_line = xml_get_current_line_number($this->parser);\n\t\t\t\t$error_col = xml_get_current_column_number($this->parser);\n\t\t\t\t$errormsg = \"$xml_error at line $error_line, column $error_col\";\n\n\t\t\t\t$this->error( $errormsg );\n\t\t\t}\n\t\t}\n\n\t\txml_parser_free( $this->parser );\n\t\tunset( $this->parser );\n\n\t\t$this->normalize();\n\t}\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function MagpieRSS( $source ) {\n\t\tself::__construct( $source );\n\t}\n\n\tfunction feed_start_element($p, $element, &$attrs) {\n\t\t$el = $element = strtolower($element);\n\t\t$attrs = array_change_key_case($attrs, CASE_LOWER);\n\n\t\t// check for a namespace, and split if found\n\t\t$ns\t= false;\n\t\tif ( strpos( $element, ':' ) ) {\n\t\t\tlist($ns, $el) = explode( ':', $element, 2);\n\t\t}\n\t\tif ( $ns and $ns != 'rdf' ) {\n\t\t\t$this->current_namespace = $ns;\n\t\t}\n\n\t\t# if feed type isn't set, then this is first element of feed\n\t\t# identify feed from root element\n\t\t#\n\t\tif (!isset($this->feed_type) ) {\n\t\t\tif ( $el == 'rdf' ) {\n\t\t\t\t$this->feed_type = RSS;\n\t\t\t\t$this->feed_version = '1.0';\n\t\t\t}\n\t\t\telseif ( $el == 'rss' ) {\n\t\t\t\t$this->feed_type = RSS;\n\t\t\t\t$this->feed_version = $attrs['version'];\n\t\t\t}\n\t\t\telseif ( $el == 'feed' ) {\n\t\t\t\t$this->feed_type = ATOM;\n\t\t\t\t$this->feed_version = $attrs['version'];\n\t\t\t\t$this->inchannel = true;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $el == 'channel' )\n\t\t{\n\t\t\t$this->inchannel = true;\n\t\t}\n\t\telseif ($el == 'item' or $el == 'entry' )\n\t\t{\n\t\t\t$this->initem = true;\n\t\t\tif ( isset($attrs['rdf:about']) ) {\n\t\t\t\t$this->current_item['about'] = $attrs['rdf:about'];\n\t\t\t}\n\t\t}\n\n\t\t// if we're in the default namespace of an RSS feed,\n\t\t//  record textinput or image fields\n\t\telseif (\n\t\t\t$this->feed_type == RSS and\n\t\t\t$this->current_namespace == '' and\n\t\t\t$el == 'textinput' )\n\t\t{\n\t\t\t$this->intextinput = true;\n\t\t}\n\n\t\telseif (\n\t\t\t$this->feed_type == RSS and\n\t\t\t$this->current_namespace == '' and\n\t\t\t$el == 'image' )\n\t\t{\n\t\t\t$this->inimage = true;\n\t\t}\n\n\t\t# handle atom content constructs\n\t\telseif ( $this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )\n\t\t{\n\t\t\t// avoid clashing w/ RSS mod_content\n\t\t\tif ($el == 'content' ) {\n\t\t\t\t$el = 'atom_content';\n\t\t\t}\n\n\t\t\t$this->incontent = $el;\n\n\t\t}\n\n\t\t// if inside an Atom content construct (e.g. content or summary) field treat tags as text\n\t\telseif ($this->feed_type == ATOM and $this->incontent )\n\t\t{\n\t\t\t// if tags are inlined, then flatten\n\t\t\t$attrs_str = join(' ',\n\t\t\t\t\tarray_map(array('MagpieRSS', 'map_attrs'),\n\t\t\t\t\tarray_keys($attrs),\n\t\t\t\t\tarray_values($attrs) ) );\n\n\t\t\t$this->append_content( \"<$element $attrs_str>\"  );\n\n\t\t\tarray_unshift( $this->stack, $el );\n\t\t}\n\n\t\t// Atom support many links per containging element.\n\t\t// Magpie treats link elements of type rel='alternate'\n\t\t// as being equivalent to RSS's simple link element.\n\t\t//\n\t\telseif ($this->feed_type == ATOM and $el == 'link' )\n\t\t{\n\t\t\tif ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' )\n\t\t\t{\n\t\t\t\t$link_el = 'link';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$link_el = 'link_' . $attrs['rel'];\n\t\t\t}\n\n\t\t\t$this->append($link_el, $attrs['href']);\n\t\t}\n\t\t// set stack[0] to current element\n\t\telse {\n\t\t\tarray_unshift($this->stack, $el);\n\t\t}\n\t}\n\n\tfunction feed_cdata ($p, $text) {\n\n\t\tif ($this->feed_type == ATOM and $this->incontent)\n\t\t{\n\t\t\t$this->append_content( $text );\n\t\t}\n\t\telse {\n\t\t\t$current_el = join('_', array_reverse($this->stack));\n\t\t\t$this->append($current_el, $text);\n\t\t}\n\t}\n\n\tfunction feed_end_element ($p, $el) {\n\t\t$el = strtolower($el);\n\n\t\tif ( $el == 'item' or $el == 'entry' )\n\t\t{\n\t\t\t$this->items[] = $this->current_item;\n\t\t\t$this->current_item = array();\n\t\t\t$this->initem = false;\n\t\t}\n\t\telseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' )\n\t\t{\n\t\t\t$this->intextinput = false;\n\t\t}\n\t\telseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' )\n\t\t{\n\t\t\t$this->inimage = false;\n\t\t}\n\t\telseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )\n\t\t{\n\t\t\t$this->incontent = false;\n\t\t}\n\t\telseif ($el == 'channel' or $el == 'feed' )\n\t\t{\n\t\t\t$this->inchannel = false;\n\t\t}\n\t\telseif ($this->feed_type == ATOM and $this->incontent  ) {\n\t\t\t// balance tags properly\n\t\t\t// note: This may not actually be necessary\n\t\t\tif ( $this->stack[0] == $el )\n\t\t\t{\n\t\t\t\t$this->append_content(\"</$el>\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->append_content(\"<$el />\");\n\t\t\t}\n\n\t\t\tarray_shift( $this->stack );\n\t\t}\n\t\telse {\n\t\t\tarray_shift( $this->stack );\n\t\t}\n\n\t\t$this->current_namespace = false;\n\t}\n\n\tfunction concat (&$str1, $str2=\"\") {\n\t\tif (!isset($str1) ) {\n\t\t\t$str1=\"\";\n\t\t}\n\t\t$str1 .= $str2;\n\t}\n\n\tfunction append_content($text) {\n\t\tif ( $this->initem ) {\n\t\t\t$this->concat( $this->current_item[ $this->incontent ], $text );\n\t\t}\n\t\telseif ( $this->inchannel ) {\n\t\t\t$this->concat( $this->channel[ $this->incontent ], $text );\n\t\t}\n\t}\n\n\t// smart append - field and namespace aware\n\tfunction append($el, $text) {\n\t\tif (!$el) {\n\t\t\treturn;\n\t\t}\n\t\tif ( $this->current_namespace )\n\t\t{\n\t\t\tif ( $this->initem ) {\n\t\t\t\t$this->concat(\n\t\t\t\t\t$this->current_item[ $this->current_namespace ][ $el ], $text);\n\t\t\t}\n\t\t\telseif ($this->inchannel) {\n\t\t\t\t$this->concat(\n\t\t\t\t\t$this->channel[ $this->current_namespace][ $el ], $text );\n\t\t\t}\n\t\t\telseif ($this->intextinput) {\n\t\t\t\t$this->concat(\n\t\t\t\t\t$this->textinput[ $this->current_namespace][ $el ], $text );\n\t\t\t}\n\t\t\telseif ($this->inimage) {\n\t\t\t\t$this->concat(\n\t\t\t\t\t$this->image[ $this->current_namespace ][ $el ], $text );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif ( $this->initem ) {\n\t\t\t\t$this->concat(\n\t\t\t\t\t$this->current_item[ $el ], $text);\n\t\t\t}\n\t\t\telseif ($this->intextinput) {\n\t\t\t\t$this->concat(\n\t\t\t\t\t$this->textinput[ $el ], $text );\n\t\t\t}\n\t\t\telseif ($this->inimage) {\n\t\t\t\t$this->concat(\n\t\t\t\t\t$this->image[ $el ], $text );\n\t\t\t}\n\t\t\telseif ($this->inchannel) {\n\t\t\t\t$this->concat(\n\t\t\t\t\t$this->channel[ $el ], $text );\n\t\t\t}\n\n\t\t}\n\t}\n\n\tfunction normalize () {\n\t\t// if atom populate rss fields\n\t\tif ( $this->is_atom() ) {\n\t\t\t$this->channel['descripton'] = $this->channel['tagline'];\n\t\t\tfor ( $i = 0; $i < count($this->items); $i++) {\n\t\t\t\t$item = $this->items[$i];\n\t\t\t\tif ( isset($item['summary']) )\n\t\t\t\t\t$item['description'] = $item['summary'];\n\t\t\t\tif ( isset($item['atom_content']))\n\t\t\t\t\t$item['content']['encoded'] = $item['atom_content'];\n\n\t\t\t\t$this->items[$i] = $item;\n\t\t\t}\n\t\t}\n\t\telseif ( $this->is_rss() ) {\n\t\t\t$this->channel['tagline'] = $this->channel['description'];\n\t\t\tfor ( $i = 0; $i < count($this->items); $i++) {\n\t\t\t\t$item = $this->items[$i];\n\t\t\t\tif ( isset($item['description']))\n\t\t\t\t\t$item['summary'] = $item['description'];\n\t\t\t\tif ( isset($item['content']['encoded'] ) )\n\t\t\t\t\t$item['atom_content'] = $item['content']['encoded'];\n\n\t\t\t\t$this->items[$i] = $item;\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction is_rss () {\n\t\tif ( $this->feed_type == RSS ) {\n\t\t\treturn $this->feed_version;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tfunction is_atom() {\n\t\tif ( $this->feed_type == ATOM ) {\n\t\t\treturn $this->feed_version;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tfunction map_attrs($k, $v) {\n\t\treturn \"$k=\\\"$v\\\"\";\n\t}\n\n\tfunction error( $errormsg, $lvl = E_USER_WARNING ) {\n\t\tif ( MAGPIE_DEBUG ) {\n\t\t\ttrigger_error( $errormsg, $lvl);\n\t\t} else {\n\t\t\terror_log( $errormsg, 0);\n\t\t}\n\t}\n\n}\n\nif ( !function_exists('fetch_rss') ) :\n/**\n * Build Magpie object based on RSS from URL.\n *\n * @since 1.5.0\n * @package External\n * @subpackage MagpieRSS\n *\n * @param string $url URL to retrieve feed\n * @return bool|MagpieRSS false on failure or MagpieRSS object on success.\n */\nfunction fetch_rss ($url) {\n\t// initialize constants\n\tinit();\n\n\tif ( !isset($url) ) {\n\t\t// error(\"fetch_rss called without a url\");\n\t\treturn false;\n\t}\n\n\t// if cache is disabled\n\tif ( !MAGPIE_CACHE_ON ) {\n\t\t// fetch file, and parse it\n\t\t$resp = _fetch_remote_file( $url );\n\t\tif ( is_success( $resp->status ) ) {\n\t\t\treturn _response_to_rss( $resp );\n\t\t}\n\t\telse {\n\t\t\t// error(\"Failed to fetch $url and cache is off\");\n\t\t\treturn false;\n\t\t}\n\t}\n\t// else cache is ON\n\telse {\n\t\t// Flow\n\t\t// 1. check cache\n\t\t// 2. if there is a hit, make sure it's fresh\n\t\t// 3. if cached obj fails freshness check, fetch remote\n\t\t// 4. if remote fails, return stale object, or error\n\n\t\t$cache = new RSSCache( MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE );\n\n\t\tif (MAGPIE_DEBUG and $cache->ERROR) {\n\t\t\tdebug($cache->ERROR, E_USER_WARNING);\n\t\t}\n\n\t\t$cache_status \t = 0;\t\t// response of check_cache\n\t\t$request_headers = array(); // HTTP headers to send with fetch\n\t\t$rss \t\t\t = 0;\t\t// parsed RSS object\n\t\t$errormsg\t\t = 0;\t\t// errors, if any\n\n\t\tif (!$cache->ERROR) {\n\t\t\t// return cache HIT, MISS, or STALE\n\t\t\t$cache_status = $cache->check_cache( $url );\n\t\t}\n\n\t\t// if object cached, and cache is fresh, return cached obj\n\t\tif ( $cache_status == 'HIT' ) {\n\t\t\t$rss = $cache->get( $url );\n\t\t\tif ( isset($rss) and $rss ) {\n\t\t\t\t$rss->from_cache = 1;\n\t\t\t\tif ( MAGPIE_DEBUG > 1) {\n\t\t\t\tdebug(\"MagpieRSS: Cache HIT\", E_USER_NOTICE);\n\t\t\t}\n\t\t\t\treturn $rss;\n\t\t\t}\n\t\t}\n\n\t\t// else attempt a conditional get\n\n\t\t// set up headers\n\t\tif ( $cache_status == 'STALE' ) {\n\t\t\t$rss = $cache->get( $url );\n\t\t\tif ( isset($rss->etag) and $rss->last_modified ) {\n\t\t\t\t$request_headers['If-None-Match'] = $rss->etag;\n\t\t\t\t$request_headers['If-Last-Modified'] = $rss->last_modified;\n\t\t\t}\n\t\t}\n\n\t\t$resp = _fetch_remote_file( $url, $request_headers );\n\n\t\tif (isset($resp) and $resp) {\n\t\t\tif ($resp->status == '304' ) {\n\t\t\t\t// we have the most current copy\n\t\t\t\tif ( MAGPIE_DEBUG > 1) {\n\t\t\t\t\tdebug(\"Got 304 for $url\");\n\t\t\t\t}\n\t\t\t\t// reset cache on 304 (at minutillo insistent prodding)\n\t\t\t\t$cache->set($url, $rss);\n\t\t\t\treturn $rss;\n\t\t\t}\n\t\t\telseif ( is_success( $resp->status ) ) {\n\t\t\t\t$rss = _response_to_rss( $resp );\n\t\t\t\tif ( $rss ) {\n\t\t\t\t\tif (MAGPIE_DEBUG > 1) {\n\t\t\t\t\t\tdebug(\"Fetch successful\");\n\t\t\t\t\t}\n\t\t\t\t\t// add object to cache\n\t\t\t\t\t$cache->set( $url, $rss );\n\t\t\t\t\treturn $rss;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$errormsg = \"Failed to fetch $url. \";\n\t\t\t\tif ( $resp->error ) {\n\t\t\t\t\t# compensate for Snoopy's annoying habbit to tacking\n\t\t\t\t\t# on '\\n'\n\t\t\t\t\t$http_error = substr($resp->error, 0, -2);\n\t\t\t\t\t$errormsg .= \"(HTTP Error: $http_error)\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$errormsg .=  \"(HTTP Response: \" . $resp->response_code .')';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$errormsg = \"Unable to retrieve RSS file for unknown reasons.\";\n\t\t}\n\n\t\t// else fetch failed\n\n\t\t// attempt to return cached object\n\t\tif ($rss) {\n\t\t\tif ( MAGPIE_DEBUG ) {\n\t\t\t\tdebug(\"Returning STALE object for $url\");\n\t\t\t}\n\t\t\treturn $rss;\n\t\t}\n\n\t\t// else we totally failed\n\t\t// error( $errormsg );\n\n\t\treturn false;\n\n\t} // end if ( !MAGPIE_CACHE_ON ) {\n} // end fetch_rss()\nendif;\n\n/**\n * Retrieve URL headers and content using WP HTTP Request API.\n *\n * @since 1.5.0\n * @package External\n * @subpackage MagpieRSS\n *\n * @param string $url URL to retrieve\n * @param array $headers Optional. Headers to send to the URL.\n * @return Snoopy style response\n */\nfunction _fetch_remote_file($url, $headers = \"\" ) {\n\t$resp = wp_safe_remote_request( $url, array( 'headers' => $headers, 'timeout' => MAGPIE_FETCH_TIME_OUT ) );\n\tif ( is_wp_error($resp) ) {\n\t\t$error = array_shift($resp->errors);\n\n\t\t$resp = new stdClass;\n\t\t$resp->status = 500;\n\t\t$resp->response_code = 500;\n\t\t$resp->error = $error[0] . \"\\n\"; //\\n = Snoopy compatibility\n\t\treturn $resp;\n\t}\n\n\t// Snoopy returns headers unprocessed.\n\t// Also note, WP_HTTP lowercases all keys, Snoopy did not.\n\t$return_headers = array();\n\tforeach ( wp_remote_retrieve_headers( $resp ) as $key => $value ) {\n\t\tif ( !is_array($value) ) {\n\t\t\t$return_headers[] = \"$key: $value\";\n\t\t} else {\n\t\t\tforeach ( $value as $v )\n\t\t\t\t$return_headers[] = \"$key: $v\";\n\t\t}\n\t}\n\n\t$response = new stdClass;\n\t$response->status = wp_remote_retrieve_response_code( $resp );\n\t$response->response_code = wp_remote_retrieve_response_code( $resp );\n\t$response->headers = $return_headers;\n\t$response->results = wp_remote_retrieve_body( $resp );\n\n\treturn $response;\n}\n\n/**\n * Retrieve\n *\n * @since 1.5.0\n * @package External\n * @subpackage MagpieRSS\n *\n * @param array $resp\n * @return MagpieRSS|bool\n */\nfunction _response_to_rss ($resp) {\n\t$rss = new MagpieRSS( $resp->results );\n\n\t// if RSS parsed successfully\n\tif ( $rss && (!isset($rss->ERROR) || !$rss->ERROR) ) {\n\n\t\t// find Etag, and Last-Modified\n\t\tforeach ( (array) $resp->headers as $h) {\n\t\t\t// 2003-03-02 - Nicola Asuni (www.tecnick.com) - fixed bug \"Undefined offset: 1\"\n\t\t\tif (strpos($h, \": \")) {\n\t\t\t\tlist($field, $val) = explode(\": \", $h, 2);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$field = $h;\n\t\t\t\t$val = \"\";\n\t\t\t}\n\n\t\t\tif ( $field == 'etag' ) {\n\t\t\t\t$rss->etag = $val;\n\t\t\t}\n\n\t\t\tif ( $field == 'last-modified' ) {\n\t\t\t\t$rss->last_modified = $val;\n\t\t\t}\n\t\t}\n\n\t\treturn $rss;\n\t} // else construct error message\n\telse {\n\t\t$errormsg = \"Failed to parse RSS file.\";\n\n\t\tif ($rss) {\n\t\t\t$errormsg .= \" (\" . $rss->ERROR . \")\";\n\t\t}\n\t\t// error($errormsg);\n\n\t\treturn false;\n\t} // end if ($rss and !$rss->error)\n}\n\n/**\n * Set up constants with default values, unless user overrides.\n *\n * @since 1.5.0\n * @package External\n * @subpackage MagpieRSS\n */\nfunction init () {\n\tif ( defined('MAGPIE_INITALIZED') ) {\n\t\treturn;\n\t}\n\telse {\n\t\tdefine('MAGPIE_INITALIZED', 1);\n\t}\n\n\tif ( !defined('MAGPIE_CACHE_ON') ) {\n\t\tdefine('MAGPIE_CACHE_ON', 1);\n\t}\n\n\tif ( !defined('MAGPIE_CACHE_DIR') ) {\n\t\tdefine('MAGPIE_CACHE_DIR', './cache');\n\t}\n\n\tif ( !defined('MAGPIE_CACHE_AGE') ) {\n\t\tdefine('MAGPIE_CACHE_AGE', 60*60); // one hour\n\t}\n\n\tif ( !defined('MAGPIE_CACHE_FRESH_ONLY') ) {\n\t\tdefine('MAGPIE_CACHE_FRESH_ONLY', 0);\n\t}\n\n\t\tif ( !defined('MAGPIE_DEBUG') ) {\n\t\tdefine('MAGPIE_DEBUG', 0);\n\t}\n\n\tif ( !defined('MAGPIE_USER_AGENT') ) {\n\t\t$ua = 'WordPress/' . $GLOBALS['wp_version'];\n\n\t\tif ( MAGPIE_CACHE_ON ) {\n\t\t\t$ua = $ua . ')';\n\t\t}\n\t\telse {\n\t\t\t$ua = $ua . '; No cache)';\n\t\t}\n\n\t\tdefine('MAGPIE_USER_AGENT', $ua);\n\t}\n\n\tif ( !defined('MAGPIE_FETCH_TIME_OUT') ) {\n\t\tdefine('MAGPIE_FETCH_TIME_OUT', 2);\t// 2 second timeout\n\t}\n\n\t// use gzip encoding to fetch rss files if supported?\n\tif ( !defined('MAGPIE_USE_GZIP') ) {\n\t\tdefine('MAGPIE_USE_GZIP', true);\n\t}\n}\n\nfunction is_info ($sc) {\n\treturn $sc >= 100 && $sc < 200;\n}\n\nfunction is_success ($sc) {\n\treturn $sc >= 200 && $sc < 300;\n}\n\nfunction is_redirect ($sc) {\n\treturn $sc >= 300 && $sc < 400;\n}\n\nfunction is_error ($sc) {\n\treturn $sc >= 400 && $sc < 600;\n}\n\nfunction is_client_error ($sc) {\n\treturn $sc >= 400 && $sc < 500;\n}\n\nfunction is_server_error ($sc) {\n\treturn $sc >= 500 && $sc < 600;\n}\n\nclass RSSCache {\n\tvar $BASE_CACHE;\t// where the cache files are stored\n\tvar $MAX_AGE\t= 43200;  \t\t// when are files stale, default twelve hours\n\tvar $ERROR \t\t= '';\t\t\t// accumulate error messages\n\n\t/**\n\t * PHP5 constructor.\n\t */\n\tfunction __construct( $base = '', $age = '' ) {\n\t\t$this->BASE_CACHE = WP_CONTENT_DIR . '/cache';\n\t\tif ( $base ) {\n\t\t\t$this->BASE_CACHE = $base;\n\t\t}\n\t\tif ( $age ) {\n\t\t\t$this->MAX_AGE = $age;\n\t\t}\n\n\t}\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function RSSCache( $base = '', $age = '' ) {\n\t\tself::__construct( $base, $age );\n\t}\n\n/*=======================================================================*\\\n\tFunction:\tset\n\tPurpose:\tadd an item to the cache, keyed on url\n\tInput:\t\turl from which the rss file was fetched\n\tOutput:\t\ttrue on success\n\\*=======================================================================*/\n\tfunction set ($url, $rss) {\n\t\t$cache_option = 'rss_' . $this->file_name( $url );\n\n\t\tset_transient($cache_option, $rss, $this->MAX_AGE);\n\n\t\treturn $cache_option;\n\t}\n\n/*=======================================================================*\\\n\tFunction:\tget\n\tPurpose:\tfetch an item from the cache\n\tInput:\t\turl from which the rss file was fetched\n\tOutput:\t\tcached object on HIT, false on MISS\n\\*=======================================================================*/\n\tfunction get ($url) {\n\t\t$this->ERROR = \"\";\n\t\t$cache_option = 'rss_' . $this->file_name( $url );\n\n\t\tif ( ! $rss = get_transient( $cache_option ) ) {\n\t\t\t$this->debug(\n\t\t\t\t\"Cache doesn't contain: $url (cache option: $cache_option)\"\n\t\t\t);\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn $rss;\n\t}\n\n/*=======================================================================*\\\n\tFunction:\tcheck_cache\n\tPurpose:\tcheck a url for membership in the cache\n\t\t\t\tand whether the object is older then MAX_AGE (ie. STALE)\n\tInput:\t\turl from which the rss file was fetched\n\tOutput:\t\tcached object on HIT, false on MISS\n\\*=======================================================================*/\n\tfunction check_cache ( $url ) {\n\t\t$this->ERROR = \"\";\n\t\t$cache_option = 'rss_' . $this->file_name( $url );\n\n\t\tif ( get_transient($cache_option) ) {\n\t\t\t// object exists and is current\n\t\t\t\treturn 'HIT';\n\t\t} else {\n\t\t\t// object does not exist\n\t\t\treturn 'MISS';\n\t\t}\n\t}\n\n/*=======================================================================*\\\n\tFunction:\tserialize\n\\*=======================================================================*/\n\tfunction serialize ( $rss ) {\n\t\treturn serialize( $rss );\n\t}\n\n/*=======================================================================*\\\n\tFunction:\tunserialize\n\\*=======================================================================*/\n\tfunction unserialize ( $data ) {\n\t\treturn unserialize( $data );\n\t}\n\n/*=======================================================================*\\\n\tFunction:\tfile_name\n\tPurpose:\tmap url to location in cache\n\tInput:\t\turl from which the rss file was fetched\n\tOutput:\t\ta file name\n\\*=======================================================================*/\n\tfunction file_name ($url) {\n\t\treturn md5( $url );\n\t}\n\n/*=======================================================================*\\\n\tFunction:\terror\n\tPurpose:\tregister error\n\\*=======================================================================*/\n\tfunction error ($errormsg, $lvl=E_USER_WARNING) {\n\t\t$this->ERROR = $errormsg;\n\t\tif ( MAGPIE_DEBUG ) {\n\t\t\ttrigger_error( $errormsg, $lvl);\n\t\t}\n\t\telse {\n\t\t\terror_log( $errormsg, 0);\n\t\t}\n\t}\n\t\t\tfunction debug ($debugmsg, $lvl=E_USER_NOTICE) {\n\t\tif ( MAGPIE_DEBUG ) {\n\t\t\t$this->error(\"MagpieRSS [debug] $debugmsg\", $lvl);\n\t\t}\n\t}\n}\n\nif ( !function_exists('parse_w3cdtf') ) :\nfunction parse_w3cdtf ( $date_str ) {\n\n\t# regex to match wc3dtf\n\t$pat = \"/(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2})(:(\\d{2}))?(?:([-+])(\\d{2}):?(\\d{2})|(Z))?/\";\n\n\tif ( preg_match( $pat, $date_str, $match ) ) {\n\t\tlist( $year, $month, $day, $hours, $minutes, $seconds) =\n\t\t\tarray( $match[1], $match[2], $match[3], $match[4], $match[5], $match[7]);\n\n\t\t# calc epoch for current date assuming GMT\n\t\t$epoch = gmmktime( $hours, $minutes, $seconds, $month, $day, $year);\n\n\t\t$offset = 0;\n\t\tif ( $match[11] == 'Z' ) {\n\t\t\t# zulu time, aka GMT\n\t\t}\n\t\telse {\n\t\t\tlist( $tz_mod, $tz_hour, $tz_min ) =\n\t\t\t\tarray( $match[8], $match[9], $match[10]);\n\n\t\t\t# zero out the variables\n\t\t\tif ( ! $tz_hour ) { $tz_hour = 0; }\n\t\t\tif ( ! $tz_min ) { $tz_min = 0; }\n\n\t\t\t$offset_secs = (($tz_hour*60)+$tz_min)*60;\n\n\t\t\t# is timezone ahead of GMT?  then subtract offset\n\t\t\t#\n\t\t\tif ( $tz_mod == '+' ) {\n\t\t\t\t$offset_secs = $offset_secs * -1;\n\t\t\t}\n\n\t\t\t$offset = $offset_secs;\n\t\t}\n\t\t$epoch = $epoch + $offset;\n\t\treturn $epoch;\n\t}\n\telse {\n\t\treturn -1;\n\t}\n}\nendif;\n\nif ( !function_exists('wp_rss') ) :\n/**\n * Display all RSS items in a HTML ordered list.\n *\n * @since 1.5.0\n * @package External\n * @subpackage MagpieRSS\n *\n * @param string $url URL of feed to display. Will not auto sense feed URL.\n * @param int $num_items Optional. Number of items to display, default is all.\n */\nfunction wp_rss( $url, $num_items = -1 ) {\n\tif ( $rss = fetch_rss( $url ) ) {\n\t\techo '<ul>';\n\n\t\tif ( $num_items !== -1 ) {\n\t\t\t$rss->items = array_slice( $rss->items, 0, $num_items );\n\t\t}\n\n\t\tforeach ( (array) $rss->items as $item ) {\n\t\t\tprintf(\n\t\t\t\t'<li><a href=\"%1$s\" title=\"%2$s\">%3$s</a></li>',\n\t\t\t\tesc_url( $item['link'] ),\n\t\t\t\tesc_attr( strip_tags( $item['description'] ) ),\n\t\t\t\tesc_html( $item['title'] )\n\t\t\t);\n\t\t}\n\n\t\techo '</ul>';\n\t} else {\n\t\t_e( 'An error has occurred, which probably means the feed is down. Try again later.' );\n\t}\n}\nendif;\n\nif ( !function_exists('get_rss') ) :\n/**\n * Display RSS items in HTML list items.\n *\n * You have to specify which HTML list you want, either ordered or unordered\n * before using the function. You also have to specify how many items you wish\n * to display. You can't display all of them like you can with wp_rss()\n * function.\n *\n * @since 1.5.0\n * @package External\n * @subpackage MagpieRSS\n *\n * @param string $url URL of feed to display. Will not auto sense feed URL.\n * @param int $num_items Optional. Number of items to display, default is all.\n * @return bool False on failure.\n */\nfunction get_rss ($url, $num_items = 5) { // Like get posts, but for RSS\n\t$rss = fetch_rss($url);\n\tif ( $rss ) {\n\t\t$rss->items = array_slice($rss->items, 0, $num_items);\n\t\tforeach ( (array) $rss->items as $item ) {\n\t\t\techo \"<li>\\n\";\n\t\t\techo \"<a href='$item[link]' title='$item[description]'>\";\n\t\t\techo esc_html($item['title']);\n\t\t\techo \"</a><br />\\n\";\n\t\t\techo \"</li>\\n\";\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\n}\nendif;\n", "num_lines": 948}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress scripts and styles default loader.\n *\n * Several constants are used to manage the loading, concatenating and compression of scripts and CSS:\n * define('SCRIPT_DEBUG', true); loads the development (non-minified) versions of all scripts and CSS, and disables compression and concatenation,\n * define('CONCATENATE_SCRIPTS', false); disables compression and concatenation of scripts and CSS,\n * define('COMPRESS_SCRIPTS', false); disables compression of scripts,\n * define('COMPRESS_CSS', false); disables compression of CSS,\n * define('ENFORCE_GZIP', true); forces gzip for compression (default is deflate).\n *\n * The globals $concatenate_scripts, $compress_scripts and $compress_css can be set by plugins\n * to temporarily override the above settings. Also a compression test is run once and the result is saved\n * as option 'can_compress_scripts' (0/1). The test will run again if that option is deleted.\n *\n * @package WordPress\n */\n\n/** WordPress Dependency Class */\nrequire ABSPATH . WPINC . '/class-wp-dependency.php';\n\n/** WordPress Dependencies Class */\nrequire ABSPATH . WPINC . '/class.wp-dependencies.php';\n\n/** WordPress Scripts Class */\nrequire ABSPATH . WPINC . '/class.wp-scripts.php';\n\n/** WordPress Scripts Functions */\nrequire ABSPATH . WPINC . '/functions.wp-scripts.php';\n\n/** WordPress Styles Class */\nrequire ABSPATH . WPINC . '/class.wp-styles.php';\n\n/** WordPress Styles Functions */\nrequire ABSPATH . WPINC . '/functions.wp-styles.php';\n\n/**\n * Registers TinyMCE scripts.\n *\n * @since 5.0.0\n *\n * @param WP_Scripts $scripts            WP_Scripts object.\n * @param bool       $force_uncompressed Whether to forcibly prevent gzip compression. Default false.\n */\nfunction wp_register_tinymce_scripts( $scripts, $force_uncompressed = false ) {\n\tglobal $tinymce_version, $concatenate_scripts, $compress_scripts;\n\t$suffix     = wp_scripts_get_suffix();\n\t$dev_suffix = wp_scripts_get_suffix( 'dev' );\n\n\tscript_concat_settings();\n\n\t$compressed = $compress_scripts && $concatenate_scripts && isset( $_SERVER['HTTP_ACCEPT_ENCODING'] )\n\t\t&& false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && ! $force_uncompressed;\n\n\t// Load tinymce.js when running from /src, otherwise load wp-tinymce.js.gz (in production)\n\t// or tinymce.min.js (when SCRIPT_DEBUG is true).\n\tif ( $compressed ) {\n\t\t$scripts->add( 'wp-tinymce', includes_url( 'js/tinymce/' ) . 'wp-tinymce.js', array(), $tinymce_version );\n\t} else {\n\t\t$scripts->add( 'wp-tinymce-root', includes_url( 'js/tinymce/' ) . \"tinymce$dev_suffix.js\", array(), $tinymce_version );\n\t\t$scripts->add( 'wp-tinymce', includes_url( 'js/tinymce/' ) . \"plugins/compat3x/plugin$dev_suffix.js\", array( 'wp-tinymce-root' ), $tinymce_version );\n\t}\n\n\t$scripts->add( 'wp-tinymce-lists', includes_url( \"js/tinymce/plugins/lists/plugin$suffix.js\" ), array( 'wp-tinymce' ), $tinymce_version );\n}\n\n/**\n * Registers all the WordPress vendor scripts that are in the standardized\n * `js/dist/vendor/` location.\n *\n * For the order of `$scripts->add` see `wp_default_scripts`.\n *\n * @since 5.0.0\n *\n * @param WP_Scripts $scripts WP_Scripts object.\n */\nfunction wp_default_packages_vendor( $scripts ) {\n\tglobal $wp_locale;\n\n\t$suffix = wp_scripts_get_suffix();\n\n\t$vendor_scripts = array(\n\t\t'react'     => array( 'wp-polyfill' ),\n\t\t'react-dom' => array( 'react' ),\n\t\t'moment',\n\t\t'lodash',\n\t\t'wp-polyfill-fetch',\n\t\t'wp-polyfill-formdata',\n\t\t'wp-polyfill-node-contains',\n\t\t'wp-polyfill-url',\n\t\t'wp-polyfill-dom-rect',\n\t\t'wp-polyfill-element-closest',\n\t\t'wp-polyfill',\n\t);\n\n\t$vendor_scripts_versions = array(\n\t\t'react'                       => '16.9.0',\n\t\t'react-dom'                   => '16.9.0',\n\t\t'moment'                      => '2.26.0',\n\t\t'lodash'                      => '4.17.15',\n\t\t'wp-polyfill-fetch'           => '3.0.0',\n\t\t'wp-polyfill-formdata'        => '3.0.12',\n\t\t'wp-polyfill-node-contains'   => '3.42.0',\n\t\t'wp-polyfill-url'             => '3.6.4',\n\t\t'wp-polyfill-dom-rect'        => '3.42.0',\n\t\t'wp-polyfill-element-closest' => '2.0.2',\n\t\t'wp-polyfill'                 => '7.4.4',\n\t);\n\n\tforeach ( $vendor_scripts as $handle => $dependencies ) {\n\t\tif ( is_string( $dependencies ) ) {\n\t\t\t$handle       = $dependencies;\n\t\t\t$dependencies = array();\n\t\t}\n\n\t\t$path    = \"/wp-includes/js/dist/vendor/$handle$suffix.js\";\n\t\t$version = $vendor_scripts_versions[ $handle ];\n\n\t\t$scripts->add( $handle, $path, $dependencies, $version, 1 );\n\t}\n\n\t$scripts->add( 'wp-polyfill', null, array( 'wp-polyfill' ) );\n\tdid_action( 'init' ) && $scripts->add_inline_script(\n\t\t'wp-polyfill',\n\t\twp_get_script_polyfill(\n\t\t\t$scripts,\n\t\t\tarray(\n\t\t\t\t'\\'fetch\\' in window' => 'wp-polyfill-fetch',\n\t\t\t\t'document.contains'   => 'wp-polyfill-node-contains',\n\t\t\t\t'window.DOMRect'      => 'wp-polyfill-dom-rect',\n\t\t\t\t'window.URL && window.URL.prototype && window.URLSearchParams' => 'wp-polyfill-url',\n\t\t\t\t'window.FormData && window.FormData.prototype.keys' => 'wp-polyfill-formdata',\n\t\t\t\t'Element.prototype.matches && Element.prototype.closest' => 'wp-polyfill-element-closest',\n\t\t\t)\n\t\t)\n\t);\n\n\tdid_action( 'init' ) && $scripts->add_inline_script( 'lodash', 'window.lodash = _.noConflict();' );\n\n\tdid_action( 'init' ) && $scripts->add_inline_script(\n\t\t'moment',\n\t\tsprintf(\n\t\t\t\"moment.updateLocale( '%s', %s );\",\n\t\t\tget_user_locale(),\n\t\t\twp_json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'months'         => array_values( $wp_locale->month ),\n\t\t\t\t\t'monthsShort'    => array_values( $wp_locale->month_abbrev ),\n\t\t\t\t\t'weekdays'       => array_values( $wp_locale->weekday ),\n\t\t\t\t\t'weekdaysShort'  => array_values( $wp_locale->weekday_abbrev ),\n\t\t\t\t\t'week'           => array(\n\t\t\t\t\t\t'dow' => (int) get_option( 'start_of_week', 0 ),\n\t\t\t\t\t),\n\t\t\t\t\t'longDateFormat' => array(\n\t\t\t\t\t\t'LT'   => get_option( 'time_format', __( 'g:i a', 'default' ) ),\n\t\t\t\t\t\t'LTS'  => null,\n\t\t\t\t\t\t'L'    => null,\n\t\t\t\t\t\t'LL'   => get_option( 'date_format', __( 'F j, Y', 'default' ) ),\n\t\t\t\t\t\t'LLL'  => __( 'F j, Y g:i a', 'default' ),\n\t\t\t\t\t\t'LLLL' => null,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\t\t'after'\n\t);\n}\n\n/**\n * Returns contents of an inline script used in appending polyfill scripts for\n * browsers which fail the provided tests. The provided array is a mapping from\n * a condition to verify feature support to its polyfill script handle.\n *\n * @since 5.0.0\n *\n * @param WP_Scripts $scripts WP_Scripts object.\n * @param array      $tests   Features to detect.\n * @return string Conditional polyfill inline script.\n */\nfunction wp_get_script_polyfill( $scripts, $tests ) {\n\t$polyfill = '';\n\tforeach ( $tests as $test => $handle ) {\n\t\tif ( ! array_key_exists( $handle, $scripts->registered ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$src = $scripts->registered[ $handle ]->src;\n\t\t$ver = $scripts->registered[ $handle ]->ver;\n\n\t\tif ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $scripts->content_url && 0 === strpos( $src, $scripts->content_url ) ) ) {\n\t\t\t$src = $scripts->base_url . $src;\n\t\t}\n\n\t\tif ( ! empty( $ver ) ) {\n\t\t\t$src = add_query_arg( 'ver', $ver, $src );\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/class.wp-scripts.php */\n\t\t$src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) );\n\n\t\tif ( ! $src ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$polyfill .= (\n\t\t\t// Test presence of feature...\n\t\t\t'( ' . $test . ' ) || ' .\n\t\t\t/*\n\t\t\t * ...appending polyfill on any failures. Cautious viewers may balk\n\t\t\t * at the `document.write`. Its caveat of synchronous mid-stream\n\t\t\t * blocking write is exactly the behavior we need though.\n\t\t\t */\n\t\t\t'document.write( \\'<script src=\"' .\n\t\t\t$src .\n\t\t\t'\"></scr\\' + \\'ipt>\\' );'\n\t\t);\n\t}\n\n\treturn $polyfill;\n}\n\n/**\n * Registers all the WordPress packages scripts that are in the standardized\n * `js/dist/` location.\n *\n * For the order of `$scripts->add` see `wp_default_scripts`.\n *\n * @since 5.0.0\n *\n * @param WP_Scripts $scripts WP_Scripts object.\n */\nfunction wp_default_packages_scripts( $scripts ) {\n\t$suffix = wp_scripts_get_suffix();\n\n\t// Expects multidimensional array like:\n\t//\t'a11y.js' => array('dependencies' => array(...), 'version' => '...'),\n\t//\t'annotations.js' => array('dependencies' => array(...), 'version' => '...'),\n\t//\t'api-fetch.js' => array(...\n\t$assets = include ABSPATH . WPINC . '/assets/script-loader-packages.php';\n\n\tforeach ( $assets as $package_name => $package_data ) {\n\t\t$basename = basename( $package_name, '.js' );\n\t\t$handle   = 'wp-' . $basename;\n\t\t$path     = \"/wp-includes/js/dist/{$basename}{$suffix}.js\";\n\n\t\tif ( ! empty( $package_data['dependencies'] ) ) {\n\t\t\t$dependencies = $package_data['dependencies'];\n\t\t} else {\n\t\t\t$dependencies = array();\n\t\t}\n\n\t\t// Add dependencies that cannot be detected and generated by build tools.\n\t\tswitch ( $handle ) {\n\t\t\tcase 'wp-block-library':\n\t\t\t\tarray_push( $dependencies, 'editor' );\n\t\t\t\tbreak;\n\t\t\tcase 'wp-edit-post':\n\t\t\t\tarray_push( $dependencies, 'media-models', 'media-views', 'postbox', 'wp-dom-ready' );\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$scripts->add( $handle, $path, $dependencies, $package_data['version'], 1 );\n\n\t\tif ( in_array( 'wp-i18n', $dependencies, true ) ) {\n\t\t\t$scripts->set_translations( $handle );\n\t\t}\n\t}\n}\n\n/**\n * Adds inline scripts required for the WordPress JavaScript packages.\n *\n * @since 5.0.0\n *\n * @param WP_Scripts $scripts WP_Scripts object.\n */\nfunction wp_default_packages_inline_scripts( $scripts ) {\n\tglobal $wp_locale;\n\n\tif ( isset( $scripts->registered['wp-api-fetch'] ) ) {\n\t\t$scripts->registered['wp-api-fetch']->deps[] = 'wp-hooks';\n\t}\n\t$scripts->add_inline_script(\n\t\t'wp-api-fetch',\n\t\tsprintf(\n\t\t\t'wp.apiFetch.use( wp.apiFetch.createRootURLMiddleware( \"%s\" ) );',\n\t\t\tesc_url_raw( get_rest_url() )\n\t\t),\n\t\t'after'\n\t);\n\t$scripts->add_inline_script(\n\t\t'wp-api-fetch',\n\t\timplode(\n\t\t\t\"\\n\",\n\t\t\tarray(\n\t\t\t\tsprintf(\n\t\t\t\t\t'wp.apiFetch.nonceMiddleware = wp.apiFetch.createNonceMiddleware( \"%s\" );',\n\t\t\t\t\t( wp_installing() && ! is_multisite() ) ? '' : wp_create_nonce( 'wp_rest' )\n\t\t\t\t),\n\t\t\t\t'wp.apiFetch.use( wp.apiFetch.nonceMiddleware );',\n\t\t\t\t'wp.apiFetch.use( wp.apiFetch.mediaUploadMiddleware );',\n\t\t\t\tsprintf(\n\t\t\t\t\t'wp.apiFetch.nonceEndpoint = \"%s\";',\n\t\t\t\t\tadmin_url( 'admin-ajax.php?action=rest-nonce' )\n\t\t\t\t),\n\t\t\t)\n\t\t),\n\t\t'after'\n\t);\n\t$scripts->add_inline_script(\n\t\t'wp-data',\n\t\timplode(\n\t\t\t\"\\n\",\n\t\t\tarray(\n\t\t\t\t'( function() {',\n\t\t\t\t'\tvar userId = ' . get_current_user_ID() . ';',\n\t\t\t\t'\tvar storageKey = \"WP_DATA_USER_\" + userId;',\n\t\t\t\t'\twp.data',\n\t\t\t\t'\t\t.use( wp.data.plugins.persistence, { storageKey: storageKey } );',\n\t\t\t\t'\twp.data.plugins.persistence.__unstableMigrate( { storageKey: storageKey } );',\n\t\t\t\t'} )();',\n\t\t\t)\n\t\t)\n\t);\n\n\t$scripts->add_inline_script(\n\t\t'wp-date',\n\t\tsprintf(\n\t\t\t'wp.date.setSettings( %s );',\n\t\t\twp_json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'l10n'     => array(\n\t\t\t\t\t\t'locale'        => get_user_locale(),\n\t\t\t\t\t\t'months'        => array_values( $wp_locale->month ),\n\t\t\t\t\t\t'monthsShort'   => array_values( $wp_locale->month_abbrev ),\n\t\t\t\t\t\t'weekdays'      => array_values( $wp_locale->weekday ),\n\t\t\t\t\t\t'weekdaysShort' => array_values( $wp_locale->weekday_abbrev ),\n\t\t\t\t\t\t'meridiem'      => (object) $wp_locale->meridiem,\n\t\t\t\t\t\t'relative'      => array(\n\t\t\t\t\t\t\t/* translators: %s: Duration. */\n\t\t\t\t\t\t\t'future' => __( '%s from now' ),\n\t\t\t\t\t\t\t/* translators: %s: Duration. */\n\t\t\t\t\t\t\t'past'   => __( '%s ago' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'formats'  => array(\n\t\t\t\t\t\t/* translators: Time format, see https://www.php.net/date */\n\t\t\t\t\t\t'time'                => get_option( 'time_format', __( 'g:i a' ) ),\n\t\t\t\t\t\t/* translators: Date format, see https://www.php.net/date */\n\t\t\t\t\t\t'date'                => get_option( 'date_format', __( 'F j, Y' ) ),\n\t\t\t\t\t\t/* translators: Date/Time format, see https://www.php.net/date */\n\t\t\t\t\t\t'datetime'            => __( 'F j, Y g:i a' ),\n\t\t\t\t\t\t/* translators: Abbreviated date/time format, see https://www.php.net/date */\n\t\t\t\t\t\t'datetimeAbbreviated' => __( 'M j, Y g:i a' ),\n\t\t\t\t\t),\n\t\t\t\t\t'timezone' => array(\n\t\t\t\t\t\t'offset' => get_option( 'gmt_offset', 0 ),\n\t\t\t\t\t\t'string' => get_option( 'timezone_string', 'UTC' ),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\t\t'after'\n\t);\n\n\t// Loading the old editor and its config to ensure the classic block works as expected.\n\t$scripts->add_inline_script(\n\t\t'editor',\n\t\t'window.wp.oldEditor = window.wp.editor;',\n\t\t'after'\n\t);\n}\n\n/**\n * Adds inline scripts required for the TinyMCE in the block editor.\n *\n * These TinyMCE init settings are used to extend and override the default settings\n * from `_WP_Editors::default_settings()` for the Classic block.\n *\n * @since 5.0.0\n *\n * @global WP_Scripts $wp_scripts\n */\nfunction wp_tinymce_inline_scripts() {\n\tglobal $wp_scripts;\n\n\t/** This filter is documented in wp-includes/class-wp-editor.php */\n\t$editor_settings = apply_filters( 'wp_editor_settings', array( 'tinymce' => true ), 'classic-block' );\n\n\t$tinymce_plugins = array(\n\t\t'charmap',\n\t\t'colorpicker',\n\t\t'hr',\n\t\t'lists',\n\t\t'media',\n\t\t'paste',\n\t\t'tabfocus',\n\t\t'textcolor',\n\t\t'fullscreen',\n\t\t'wordpress',\n\t\t'wpautoresize',\n\t\t'wpeditimage',\n\t\t'wpemoji',\n\t\t'wpgallery',\n\t\t'wplink',\n\t\t'wpdialogs',\n\t\t'wptextpattern',\n\t\t'wpview',\n\t);\n\n\t/** This filter is documented in wp-includes/class-wp-editor.php */\n\t$tinymce_plugins = apply_filters( 'tiny_mce_plugins', $tinymce_plugins, 'classic-block' );\n\t$tinymce_plugins = array_unique( $tinymce_plugins );\n\n\t$disable_captions = false;\n\t// Runs after `tiny_mce_plugins` but before `mce_buttons`.\n\t/** This filter is documented in wp-admin/includes/media.php */\n\tif ( apply_filters( 'disable_captions', '' ) ) {\n\t\t$disable_captions = true;\n\t}\n\n\t$toolbar1 = array(\n\t\t'formatselect',\n\t\t'bold',\n\t\t'italic',\n\t\t'bullist',\n\t\t'numlist',\n\t\t'blockquote',\n\t\t'alignleft',\n\t\t'aligncenter',\n\t\t'alignright',\n\t\t'link',\n\t\t'unlink',\n\t\t'wp_more',\n\t\t'spellchecker',\n\t\t'wp_add_media',\n\t\t'wp_adv',\n\t);\n\n\t/** This filter is documented in wp-includes/class-wp-editor.php */\n\t$toolbar1 = apply_filters( 'mce_buttons', $toolbar1, 'classic-block' );\n\n\t$toolbar2 = array(\n\t\t'strikethrough',\n\t\t'hr',\n\t\t'forecolor',\n\t\t'pastetext',\n\t\t'removeformat',\n\t\t'charmap',\n\t\t'outdent',\n\t\t'indent',\n\t\t'undo',\n\t\t'redo',\n\t\t'wp_help',\n\t);\n\n\t/** This filter is documented in wp-includes/class-wp-editor.php */\n\t$toolbar2 = apply_filters( 'mce_buttons_2', $toolbar2, 'classic-block' );\n\t/** This filter is documented in wp-includes/class-wp-editor.php */\n\t$toolbar3 = apply_filters( 'mce_buttons_3', array(), 'classic-block' );\n\t/** This filter is documented in wp-includes/class-wp-editor.php */\n\t$toolbar4 = apply_filters( 'mce_buttons_4', array(), 'classic-block' );\n\t/** This filter is documented in wp-includes/class-wp-editor.php */\n\t$external_plugins = apply_filters( 'mce_external_plugins', array(), 'classic-block' );\n\n\t$tinymce_settings = array(\n\t\t'plugins'              => implode( ',', $tinymce_plugins ),\n\t\t'toolbar1'             => implode( ',', $toolbar1 ),\n\t\t'toolbar2'             => implode( ',', $toolbar2 ),\n\t\t'toolbar3'             => implode( ',', $toolbar3 ),\n\t\t'toolbar4'             => implode( ',', $toolbar4 ),\n\t\t'external_plugins'     => wp_json_encode( $external_plugins ),\n\t\t'classic_block_editor' => true,\n\t);\n\n\tif ( $disable_captions ) {\n\t\t$tinymce_settings['wpeditimage_disable_captions'] = true;\n\t}\n\n\tif ( ! empty( $editor_settings['tinymce'] ) && is_array( $editor_settings['tinymce'] ) ) {\n\t\tarray_merge( $tinymce_settings, $editor_settings['tinymce'] );\n\t}\n\n\t/** This filter is documented in wp-includes/class-wp-editor.php */\n\t$tinymce_settings = apply_filters( 'tiny_mce_before_init', $tinymce_settings, 'classic-block' );\n\n\t// Do \"by hand\" translation from PHP array to js object.\n\t// Prevents breakage in some custom settings.\n\t$init_obj = '';\n\tforeach ( $tinymce_settings as $key => $value ) {\n\t\tif ( is_bool( $value ) ) {\n\t\t\t$val       = $value ? 'true' : 'false';\n\t\t\t$init_obj .= $key . ':' . $val . ',';\n\t\t\tcontinue;\n\t\t} elseif ( ! empty( $value ) && is_string( $value ) && (\n\t\t\t( '{' === $value[0] && '}' === $value[ strlen( $value ) - 1 ] ) ||\n\t\t\t( '[' === $value[0] && ']' === $value[ strlen( $value ) - 1 ] ) ||\n\t\t\tpreg_match( '/^\\(?function ?\\(/', $value ) ) ) {\n\t\t\t$init_obj .= $key . ':' . $value . ',';\n\t\t\tcontinue;\n\t\t}\n\t\t$init_obj .= $key . ':\"' . $value . '\",';\n\t}\n\n\t$init_obj = '{' . trim( $init_obj, ' ,' ) . '}';\n\n\t$script = 'window.wpEditorL10n = {\n\t\ttinymce: {\n\t\t\tbaseURL: ' . wp_json_encode( includes_url( 'js/tinymce' ) ) . ',\n\t\t\tsuffix: ' . ( SCRIPT_DEBUG ? '\"\"' : '\".min\"' ) . ',\n\t\t\tsettings: ' . $init_obj . ',\n\t\t}\n\t}';\n\n\t$wp_scripts->add_inline_script( 'wp-block-library', $script, 'before' );\n}\n\n/**\n * Registers all the WordPress packages scripts.\n *\n * @since 5.0.0\n *\n * @param WP_Scripts $scripts WP_Scripts object.\n */\nfunction wp_default_packages( $scripts ) {\n\twp_default_packages_vendor( $scripts );\n\twp_register_tinymce_scripts( $scripts );\n\twp_default_packages_scripts( $scripts );\n\n\tif ( did_action( 'init' ) ) {\n\t\twp_default_packages_inline_scripts( $scripts );\n\t}\n}\n\n/**\n * Returns the suffix that can be used for the scripts.\n *\n * There are two suffix types, the normal one and the dev suffix.\n *\n * @since 5.0.0\n *\n * @param string $type The type of suffix to retrieve.\n * @return string The script suffix.\n */\nfunction wp_scripts_get_suffix( $type = '' ) {\n\tstatic $suffixes;\n\n\tif ( null === $suffixes ) {\n\t\t// Include an unmodified $wp_version.\n\t\trequire ABSPATH . WPINC . '/version.php';\n\n\t\t$develop_src = false !== strpos( $wp_version, '-src' );\n\n\t\tif ( ! defined( 'SCRIPT_DEBUG' ) ) {\n\t\t\tdefine( 'SCRIPT_DEBUG', $develop_src );\n\t\t}\n\t\t$suffix     = SCRIPT_DEBUG ? '' : '.min';\n\t\t$dev_suffix = $develop_src ? '' : '.min';\n\n\t\t$suffixes = array(\n\t\t\t'suffix'     => $suffix,\n\t\t\t'dev_suffix' => $dev_suffix,\n\t\t);\n\t}\n\n\tif ( 'dev' === $type ) {\n\t\treturn $suffixes['dev_suffix'];\n\t}\n\n\treturn $suffixes['suffix'];\n}\n\n/**\n * Register all WordPress scripts.\n *\n * Localizes some of them.\n * args order: `$scripts->add( 'handle', 'url', 'dependencies', 'query-string', 1 );`\n * when last arg === 1 queues the script for the footer\n *\n * @since 2.6.0\n *\n * @param WP_Scripts $scripts WP_Scripts object.\n */\nfunction wp_default_scripts( $scripts ) {\n\t$suffix     = wp_scripts_get_suffix();\n\t$dev_suffix = wp_scripts_get_suffix( 'dev' );\n\t$guessurl   = site_url();\n\n\tif ( ! $guessurl ) {\n\t\t$guessed_url = true;\n\t\t$guessurl    = wp_guess_url();\n\t}\n\n\t$scripts->base_url        = $guessurl;\n\t$scripts->content_url     = defined( 'WP_CONTENT_URL' ) ? WP_CONTENT_URL : '';\n\t$scripts->default_version = get_bloginfo( 'version' );\n\t$scripts->default_dirs    = array( '/wp-admin/js/', '/wp-includes/js/' );\n\n\t$scripts->add( 'utils', \"/wp-includes/js/utils$suffix.js\" );\n\tdid_action( 'init' ) && $scripts->localize(\n\t\t'utils',\n\t\t'userSettings',\n\t\tarray(\n\t\t\t'url'    => (string) SITECOOKIEPATH,\n\t\t\t'uid'    => (string) get_current_user_id(),\n\t\t\t'time'   => (string) time(),\n\t\t\t'secure' => (string) ( 'https' === parse_url( site_url(), PHP_URL_SCHEME ) ),\n\t\t)\n\t);\n\n\t$scripts->add( 'common', \"/wp-admin/js/common$suffix.js\", array( 'jquery', 'hoverIntent', 'utils' ), false, 1 );\n\t$scripts->set_translations( 'common' );\n\n\t$scripts->add( 'wp-sanitize', \"/wp-includes/js/wp-sanitize$suffix.js\", array(), false, 1 );\n\n\t$scripts->add( 'sack', \"/wp-includes/js/tw-sack$suffix.js\", array(), '1.6.1', 1 );\n\n\t$scripts->add( 'quicktags', \"/wp-includes/js/quicktags$suffix.js\", array(), false, 1 );\n\tdid_action( 'init' ) && $scripts->localize(\n\t\t'quicktags',\n\t\t'quicktagsL10n',\n\t\tarray(\n\t\t\t'closeAllOpenTags'      => __( 'Close all open tags' ),\n\t\t\t'closeTags'             => __( 'close tags' ),\n\t\t\t'enterURL'              => __( 'Enter the URL' ),\n\t\t\t'enterImageURL'         => __( 'Enter the URL of the image' ),\n\t\t\t'enterImageDescription' => __( 'Enter a description of the image' ),\n\t\t\t'textdirection'         => __( 'text direction' ),\n\t\t\t'toggleTextdirection'   => __( 'Toggle Editor Text Direction' ),\n\t\t\t'dfw'                   => __( 'Distraction-free writing mode' ),\n\t\t\t'strong'                => __( 'Bold' ),\n\t\t\t'strongClose'           => __( 'Close bold tag' ),\n\t\t\t'em'                    => __( 'Italic' ),\n\t\t\t'emClose'               => __( 'Close italic tag' ),\n\t\t\t'link'                  => __( 'Insert link' ),\n\t\t\t'blockquote'            => __( 'Blockquote' ),\n\t\t\t'blockquoteClose'       => __( 'Close blockquote tag' ),\n\t\t\t'del'                   => __( 'Deleted text (strikethrough)' ),\n\t\t\t'delClose'              => __( 'Close deleted text tag' ),\n\t\t\t'ins'                   => __( 'Inserted text' ),\n\t\t\t'insClose'              => __( 'Close inserted text tag' ),\n\t\t\t'image'                 => __( 'Insert image' ),\n\t\t\t'ul'                    => __( 'Bulleted list' ),\n\t\t\t'ulClose'               => __( 'Close bulleted list tag' ),\n\t\t\t'ol'                    => __( 'Numbered list' ),\n\t\t\t'olClose'               => __( 'Close numbered list tag' ),\n\t\t\t'li'                    => __( 'List item' ),\n\t\t\t'liClose'               => __( 'Close list item tag' ),\n\t\t\t'code'                  => __( 'Code' ),\n\t\t\t'codeClose'             => __( 'Close code tag' ),\n\t\t\t'more'                  => __( 'Insert Read More tag' ),\n\t\t)\n\t);\n\n\t$scripts->add( 'colorpicker', \"/wp-includes/js/colorpicker$suffix.js\", array( 'prototype' ), '3517m' );\n\n\t$scripts->add( 'editor', \"/wp-admin/js/editor$suffix.js\", array( 'utils', 'jquery' ), false, 1 );\n\n\t$scripts->add( 'clipboard', \"/wp-includes/js/clipboard$suffix.js\", array(), false, 1 );\n\n\t$scripts->add( 'wp-ajax-response', \"/wp-includes/js/wp-ajax-response$suffix.js\", array( 'jquery' ), false, 1 );\n\tdid_action( 'init' ) && $scripts->localize(\n\t\t'wp-ajax-response',\n\t\t'wpAjax',\n\t\tarray(\n\t\t\t'noPerm' => __( 'Sorry, you are not allowed to do that.' ),\n\t\t\t'broken' => __( 'Something went wrong.' ),\n\t\t)\n\t);\n\n\t$scripts->add( 'wp-api-request', \"/wp-includes/js/api-request$suffix.js\", array( 'jquery' ), false, 1 );\n\t// `wpApiSettings` is also used by `wp-api`, which depends on this script.\n\tdid_action( 'init' ) && $scripts->localize(\n\t\t'wp-api-request',\n\t\t'wpApiSettings',\n\t\tarray(\n\t\t\t'root'          => esc_url_raw( get_rest_url() ),\n\t\t\t'nonce'         => ( wp_installing() && ! is_multisite() ) ? '' : wp_create_nonce( 'wp_rest' ),\n\t\t\t'versionString' => 'wp/v2/',\n\t\t)\n\t);\n\n\t$scripts->add( 'wp-pointer', \"/wp-includes/js/wp-pointer$suffix.js\", array( 'jquery-ui-widget', 'jquery-ui-position' ), false, 1 );\n\t$scripts->set_translations( 'wp-pointer' );\n\n\t$scripts->add( 'autosave', \"/wp-includes/js/autosave$suffix.js\", array( 'heartbeat' ), false, 1 );\n\n\t$scripts->add( 'heartbeat', \"/wp-includes/js/heartbeat$suffix.js\", array( 'jquery', 'wp-hooks' ), false, 1 );\n\tdid_action( 'init' ) && $scripts->localize(\n\t\t'heartbeat',\n\t\t'heartbeatSettings',\n\t\t/**\n\t\t * Filters the Heartbeat settings.\n\t\t *\n\t\t * @since 3.6.0\n\t\t *\n\t\t * @param array $settings Heartbeat settings array.\n\t\t */\n\t\tapply_filters( 'heartbeat_settings', array() )\n\t);\n\n\t$scripts->add( 'wp-auth-check', \"/wp-includes/js/wp-auth-check$suffix.js\", array( 'heartbeat' ), false, 1 );\n\t$scripts->set_translations( 'wp-auth-check' );\n\n\t$scripts->add( 'wp-lists', \"/wp-includes/js/wp-lists$suffix.js\", array( 'wp-ajax-response', 'jquery-color' ), false, 1 );\n\n\t// WordPress no longer uses or bundles Prototype or script.aculo.us. These are now pulled from an external source.\n\t$scripts->add( 'prototype', 'https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js', array(), '1.7.1' );\n\t$scripts->add( 'scriptaculous-root', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js', array( 'prototype' ), '1.9.0' );\n\t$scripts->add( 'scriptaculous-builder', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/builder.js', array( 'scriptaculous-root' ), '1.9.0' );\n\t$scripts->add( 'scriptaculous-dragdrop', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/dragdrop.js', array( 'scriptaculous-builder', 'scriptaculous-effects' ), '1.9.0' );\n\t$scripts->add( 'scriptaculous-effects', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/effects.js', array( 'scriptaculous-root' ), '1.9.0' );\n\t$scripts->add( 'scriptaculous-slider', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/slider.js', array( 'scriptaculous-effects' ), '1.9.0' );\n\t$scripts->add( 'scriptaculous-sound', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/sound.js', array( 'scriptaculous-root' ), '1.9.0' );\n\t$scripts->add( 'scriptaculous-controls', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/controls.js', array( 'scriptaculous-root' ), '1.9.0' );\n\t$scripts->add( 'scriptaculous', false, array( 'scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls' ) );\n\n\t// Not used in core, replaced by Jcrop.js.\n\t$scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array( 'scriptaculous-dragdrop' ) );\n\n\t// jQuery.\n\t$scripts->add( 'jquery', false, array( 'jquery-core' ), '1.12.4-wp' );\n\t$scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.12.4-wp' );\n\t$scripts->add( 'jquery-migrate', \"/wp-includes/js/jquery/jquery-migrate$suffix.js\", array(), '1.4.1' );\n\n\t// Full jQuery UI.\n\t$scripts->add( 'jquery-ui-core', \"/wp-includes/js/jquery/ui/core$dev_suffix.js\", array( 'jquery' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-effects-core', \"/wp-includes/js/jquery/ui/effect$dev_suffix.js\", array( 'jquery' ), '1.11.4', 1 );\n\n\t$scripts->add( 'jquery-effects-blind', \"/wp-includes/js/jquery/ui/effect-blind$dev_suffix.js\", array( 'jquery-effects-core' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-effects-bounce', \"/wp-includes/js/jquery/ui/effect-bounce$dev_suffix.js\", array( 'jquery-effects-core' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-effects-clip', \"/wp-includes/js/jquery/ui/effect-clip$dev_suffix.js\", array( 'jquery-effects-core' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-effects-drop', \"/wp-includes/js/jquery/ui/effect-drop$dev_suffix.js\", array( 'jquery-effects-core' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-effects-explode', \"/wp-includes/js/jquery/ui/effect-explode$dev_suffix.js\", array( 'jquery-effects-core' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-effects-fade', \"/wp-includes/js/jquery/ui/effect-fade$dev_suffix.js\", array( 'jquery-effects-core' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-effects-fold', \"/wp-includes/js/jquery/ui/effect-fold$dev_suffix.js\", array( 'jquery-effects-core' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-effects-highlight', \"/wp-includes/js/jquery/ui/effect-highlight$dev_suffix.js\", array( 'jquery-effects-core' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-effects-puff', \"/wp-includes/js/jquery/ui/effect-puff$dev_suffix.js\", array( 'jquery-effects-core', 'jquery-effects-scale' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-effects-pulsate', \"/wp-includes/js/jquery/ui/effect-pulsate$dev_suffix.js\", array( 'jquery-effects-core' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-effects-scale', \"/wp-includes/js/jquery/ui/effect-scale$dev_suffix.js\", array( 'jquery-effects-core', 'jquery-effects-size' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-effects-shake', \"/wp-includes/js/jquery/ui/effect-shake$dev_suffix.js\", array( 'jquery-effects-core' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-effects-size', \"/wp-includes/js/jquery/ui/effect-size$dev_suffix.js\", array( 'jquery-effects-core' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-effects-slide', \"/wp-includes/js/jquery/ui/effect-slide$dev_suffix.js\", array( 'jquery-effects-core' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-effects-transfer', \"/wp-includes/js/jquery/ui/effect-transfer$dev_suffix.js\", array( 'jquery-effects-core' ), '1.11.4', 1 );\n\n\t$scripts->add( 'jquery-ui-accordion', \"/wp-includes/js/jquery/ui/accordion$dev_suffix.js\", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-autocomplete', \"/wp-includes/js/jquery/ui/autocomplete$dev_suffix.js\", array( 'jquery-ui-menu', 'wp-a11y' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-button', \"/wp-includes/js/jquery/ui/button$dev_suffix.js\", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-datepicker', \"/wp-includes/js/jquery/ui/datepicker$dev_suffix.js\", array( 'jquery-ui-core' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-dialog', \"/wp-includes/js/jquery/ui/dialog$dev_suffix.js\", array( 'jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-button', 'jquery-ui-position' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-draggable', \"/wp-includes/js/jquery/ui/draggable$dev_suffix.js\", array( 'jquery-ui-mouse' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-droppable', \"/wp-includes/js/jquery/ui/droppable$dev_suffix.js\", array( 'jquery-ui-draggable' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-menu', \"/wp-includes/js/jquery/ui/menu$dev_suffix.js\", array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-mouse', \"/wp-includes/js/jquery/ui/mouse$dev_suffix.js\", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-position', \"/wp-includes/js/jquery/ui/position$dev_suffix.js\", array( 'jquery' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-progressbar', \"/wp-includes/js/jquery/ui/progressbar$dev_suffix.js\", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-resizable', \"/wp-includes/js/jquery/ui/resizable$dev_suffix.js\", array( 'jquery-ui-mouse' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-selectable', \"/wp-includes/js/jquery/ui/selectable$dev_suffix.js\", array( 'jquery-ui-mouse' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-selectmenu', \"/wp-includes/js/jquery/ui/selectmenu$dev_suffix.js\", array( 'jquery-ui-menu' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-slider', \"/wp-includes/js/jquery/ui/slider$dev_suffix.js\", array( 'jquery-ui-mouse' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-sortable', \"/wp-includes/js/jquery/ui/sortable$dev_suffix.js\", array( 'jquery-ui-mouse' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-spinner', \"/wp-includes/js/jquery/ui/spinner$dev_suffix.js\", array( 'jquery-ui-button' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-tabs', \"/wp-includes/js/jquery/ui/tabs$dev_suffix.js\", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-tooltip', \"/wp-includes/js/jquery/ui/tooltip$dev_suffix.js\", array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.11.4', 1 );\n\t$scripts->add( 'jquery-ui-widget', \"/wp-includes/js/jquery/ui/widget$dev_suffix.js\", array( 'jquery' ), '1.11.4', 1 );\n\n\t// Strings for 'jquery-ui-autocomplete' live region messages.\n\tdid_action( 'init' ) && $scripts->localize(\n\t\t'jquery-ui-autocomplete',\n\t\t'uiAutocompleteL10n',\n\t\tarray(\n\t\t\t'noResults'    => __( 'No results found.' ),\n\t\t\t/* translators: Number of results found when using jQuery UI Autocomplete. */\n\t\t\t'oneResult'    => __( '1 result found. Use up and down arrow keys to navigate.' ),\n\t\t\t/* translators: %d: Number of results found when using jQuery UI Autocomplete. */\n\t\t\t'manyResults'  => __( '%d results found. Use up and down arrow keys to navigate.' ),\n\t\t\t'itemSelected' => __( 'Item selected.' ),\n\t\t)\n\t);\n\n\t// Deprecated, not used in core, most functionality is included in jQuery 1.3.\n\t$scripts->add( 'jquery-form', \"/wp-includes/js/jquery/jquery.form$suffix.js\", array( 'jquery' ), '4.2.1', 1 );\n\n\t// jQuery plugins.\n\t$scripts->add( 'jquery-color', '/wp-includes/js/jquery/jquery.color.min.js', array( 'jquery' ), '2.1.2', 1 );\n\t$scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array( 'jquery' ), '20m', 1 );\n\t$scripts->add( 'jquery-query', '/wp-includes/js/jquery/jquery.query.js', array( 'jquery' ), '2.1.7', 1 );\n\t$scripts->add( 'jquery-serialize-object', '/wp-includes/js/jquery/jquery.serialize-object.js', array( 'jquery' ), '0.2', 1 );\n\t$scripts->add( 'jquery-hotkeys', \"/wp-includes/js/jquery/jquery.hotkeys$suffix.js\", array( 'jquery' ), '0.0.2m', 1 );\n\t$scripts->add( 'jquery-table-hotkeys', \"/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js\", array( 'jquery', 'jquery-hotkeys' ), false, 1 );\n\t$scripts->add( 'jquery-touch-punch', '/wp-includes/js/jquery/jquery.ui.touch-punch.js', array( 'jquery-ui-widget', 'jquery-ui-mouse' ), '0.2.2', 1 );\n\n\t// Not used any more, registered for backward compatibility.\n\t$scripts->add( 'suggest', \"/wp-includes/js/jquery/suggest$suffix.js\", array( 'jquery' ), '1.1-20110113', 1 );\n\n\t// Masonry v2 depended on jQuery. v3 does not. The older jquery-masonry handle is a shiv.\n\t// It sets jQuery as a dependency, as the theme may have been implicitly loading it this way.\n\t$scripts->add( 'imagesloaded', '/wp-includes/js/imagesloaded.min.js', array(), '4.1.4', 1 );\n\t$scripts->add( 'masonry', '/wp-includes/js/masonry.min.js', array( 'imagesloaded' ), '4.2.2', 1 );\n\t$scripts->add( 'jquery-masonry', \"/wp-includes/js/jquery/jquery.masonry$dev_suffix.js\", array( 'jquery', 'masonry' ), '3.1.2b', 1 );\n\n\t$scripts->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array( 'jquery' ), '3.1-20121105', 1 );\n\tdid_action( 'init' ) && $scripts->localize(\n\t\t'thickbox',\n\t\t'thickboxL10n',\n\t\tarray(\n\t\t\t'next'             => __( 'Next &gt;' ),\n\t\t\t'prev'             => __( '&lt; Prev' ),\n\t\t\t'image'            => __( 'Image' ),\n\t\t\t'of'               => __( 'of' ),\n\t\t\t'close'            => __( 'Close' ),\n\t\t\t'noiframes'        => __( 'This feature requires inline frames. You have iframes disabled or your browser does not support them.' ),\n\t\t\t'loadingAnimation' => includes_url( 'js/thickbox/loadingAnimation.gif' ),\n\t\t)\n\t);\n\n\t$scripts->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.min.js', array( 'jquery' ), '0.9.12' );\n\n\t$scripts->add( 'swfobject', '/wp-includes/js/swfobject.js', array(), '2.2-20120417' );\n\n\t// Error messages for Plupload.\n\t$uploader_l10n = array(\n\t\t'queue_limit_exceeded'      => __( 'You have attempted to queue too many files.' ),\n\t\t/* translators: %s: File name. */\n\t\t'file_exceeds_size_limit'   => __( '%s exceeds the maximum upload size for this site.' ),\n\t\t'zero_byte_file'            => __( 'This file is empty. Please try another.' ),\n\t\t'invalid_filetype'          => __( 'Sorry, this file type is not permitted for security reasons.' ),\n\t\t'not_an_image'              => __( 'This file is not an image. Please try another.' ),\n\t\t'image_memory_exceeded'     => __( 'Memory exceeded. Please try another smaller file.' ),\n\t\t'image_dimensions_exceeded' => __( 'This is larger than the maximum size. Please try another.' ),\n\t\t'default_error'             => __( 'An error occurred in the upload. Please try again later.' ),\n\t\t'missing_upload_url'        => __( 'There was a configuration error. Please contact the server administrator.' ),\n\t\t'upload_limit_exceeded'     => __( 'You may only upload 1 file.' ),\n\t\t'http_error'                => __( 'Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.' ),\n\t\t'http_error_image'          => __( 'Post-processing of the image failed likely because the server is busy or does not have enough resources. Uploading a smaller image may help. Suggested maximum size is 2500 pixels.' ),\n\t\t'upload_failed'             => __( 'Upload failed.' ),\n\t\t/* translators: 1: Opening link tag, 2: Closing link tag. */\n\t\t'big_upload_failed'         => __( 'Please try uploading this file with the %1$sbrowser uploader%2$s.' ),\n\t\t/* translators: %s: File name. */\n\t\t'big_upload_queued'         => __( '%s exceeds the maximum upload size for the multi-file uploader when used in your browser.' ),\n\t\t'io_error'                  => __( 'IO error.' ),\n\t\t'security_error'            => __( 'Security error.' ),\n\t\t'file_cancelled'            => __( 'File canceled.' ),\n\t\t'upload_stopped'            => __( 'Upload stopped.' ),\n\t\t'dismiss'                   => __( 'Dismiss' ),\n\t\t'crunching'                 => __( 'Crunching&hellip;' ),\n\t\t'deleted'                   => __( 'moved to the Trash.' ),\n\t\t/* translators: %s: File name. */\n\t\t'error_uploading'           => __( '&#8220;%s&#8221; has failed to upload.' ),\n\t\t'unsupported_image'         => __( 'This image cannot be displayed in a web browser. For best results convert it to JPEG before uploading.' ),\n\t);\n\n\t$scripts->add( 'moxiejs', \"/wp-includes/js/plupload/moxie$suffix.js\", array(), '1.3.5' );\n\t$scripts->add( 'plupload', \"/wp-includes/js/plupload/plupload$suffix.js\", array( 'moxiejs' ), '2.1.9' );\n\t// Back compat handles:\n\tforeach ( array( 'all', 'html5', 'flash', 'silverlight', 'html4' ) as $handle ) {\n\t\t$scripts->add( \"plupload-$handle\", false, array( 'plupload' ), '2.1.1' );\n\t}\n\n\t$scripts->add( 'plupload-handlers', \"/wp-includes/js/plupload/handlers$suffix.js\", array( 'plupload', 'jquery' ) );\n\tdid_action( 'init' ) && $scripts->localize( 'plupload-handlers', 'pluploadL10n', $uploader_l10n );\n\n\t$scripts->add( 'wp-plupload', \"/wp-includes/js/plupload/wp-plupload$suffix.js\", array( 'plupload', 'jquery', 'json2', 'media-models' ), false, 1 );\n\tdid_action( 'init' ) && $scripts->localize( 'wp-plupload', 'pluploadL10n', $uploader_l10n );\n\n\t// Keep 'swfupload' for back-compat.\n\t$scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', array(), '2201-20110113' );\n\t$scripts->add( 'swfupload-all', false, array( 'swfupload' ), '2201' );\n\t$scripts->add( 'swfupload-handlers', \"/wp-includes/js/swfupload/handlers$suffix.js\", array( 'swfupload-all', 'jquery' ), '2201-20110524' );\n\tdid_action( 'init' ) && $scripts->localize( 'swfupload-handlers', 'swfuploadL10n', $uploader_l10n );\n\n\t$scripts->add( 'comment-reply', \"/wp-includes/js/comment-reply$suffix.js\", array(), false, 1 );\n\n\t$scripts->add( 'json2', \"/wp-includes/js/json2$suffix.js\", array(), '2015-05-03' );\n\tdid_action( 'init' ) && $scripts->add_data( 'json2', 'conditional', 'lt IE 8' );\n\n\t$scripts->add( 'underscore', \"/wp-includes/js/underscore$dev_suffix.js\", array(), '1.8.3', 1 );\n\t$scripts->add( 'backbone', \"/wp-includes/js/backbone$dev_suffix.js\", array( 'underscore', 'jquery' ), '1.4.0', 1 );\n\n\t$scripts->add( 'wp-util', \"/wp-includes/js/wp-util$suffix.js\", array( 'underscore', 'jquery' ), false, 1 );\n\tdid_action( 'init' ) && $scripts->localize(\n\t\t'wp-util',\n\t\t'_wpUtilSettings',\n\t\tarray(\n\t\t\t'ajax' => array(\n\t\t\t\t'url' => admin_url( 'admin-ajax.php', 'relative' ),\n\t\t\t),\n\t\t)\n\t);\n\n\t$scripts->add( 'wp-backbone', \"/wp-includes/js/wp-backbone$suffix.js\", array( 'backbone', 'wp-util' ), false, 1 );\n\n\t$scripts->add( 'revisions', \"/wp-admin/js/revisions$suffix.js\", array( 'wp-backbone', 'jquery-ui-slider', 'hoverIntent' ), false, 1 );\n\n\t$scripts->add( 'imgareaselect', \"/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js\", array( 'jquery' ), false, 1 );\n\n\t$scripts->add( 'mediaelement', false, array( 'jquery', 'mediaelement-core', 'mediaelement-migrate' ), '4.2.13-9993131', 1 );\n\t$scripts->add( 'mediaelement-core', \"/wp-includes/js/mediaelement/mediaelement-and-player$suffix.js\", array(), '4.2.13-9993131', 1 );\n\t$scripts->add( 'mediaelement-migrate', \"/wp-includes/js/mediaelement/mediaelement-migrate$suffix.js\", array(), false, 1 );\n\n\tdid_action( 'init' ) && $scripts->add_inline_script(\n\t\t'mediaelement-core',\n\t\tsprintf(\n\t\t\t'var mejsL10n = %s;',\n\t\t\twp_json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'language' => strtolower( strtok( determine_locale(), '_-' ) ),\n\t\t\t\t\t'strings'  => array(\n\t\t\t\t\t\t'mejs.download-file'       => __( 'Download File' ),\n\t\t\t\t\t\t'mejs.install-flash'       => __( 'You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/' ),\n\t\t\t\t\t\t'mejs.fullscreen'          => __( 'Fullscreen' ),\n\t\t\t\t\t\t'mejs.play'                => __( 'Play' ),\n\t\t\t\t\t\t'mejs.pause'               => __( 'Pause' ),\n\t\t\t\t\t\t'mejs.time-slider'         => __( 'Time Slider' ),\n\t\t\t\t\t\t'mejs.time-help-text'      => __( 'Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.' ),\n\t\t\t\t\t\t'mejs.live-broadcast'      => __( 'Live Broadcast' ),\n\t\t\t\t\t\t'mejs.volume-help-text'    => __( 'Use Up/Down Arrow keys to increase or decrease volume.' ),\n\t\t\t\t\t\t'mejs.unmute'              => __( 'Unmute' ),\n\t\t\t\t\t\t'mejs.mute'                => __( 'Mute' ),\n\t\t\t\t\t\t'mejs.volume-slider'       => __( 'Volume Slider' ),\n\t\t\t\t\t\t'mejs.video-player'        => __( 'Video Player' ),\n\t\t\t\t\t\t'mejs.audio-player'        => __( 'Audio Player' ),\n\t\t\t\t\t\t'mejs.captions-subtitles'  => __( 'Captions/Subtitles' ),\n\t\t\t\t\t\t'mejs.captions-chapters'   => __( 'Chapters' ),\n\t\t\t\t\t\t'mejs.none'                => __( 'None' ),\n\t\t\t\t\t\t'mejs.afrikaans'           => __( 'Afrikaans' ),\n\t\t\t\t\t\t'mejs.albanian'            => __( 'Albanian' ),\n\t\t\t\t\t\t'mejs.arabic'              => __( 'Arabic' ),\n\t\t\t\t\t\t'mejs.belarusian'          => __( 'Belarusian' ),\n\t\t\t\t\t\t'mejs.bulgarian'           => __( 'Bulgarian' ),\n\t\t\t\t\t\t'mejs.catalan'             => __( 'Catalan' ),\n\t\t\t\t\t\t'mejs.chinese'             => __( 'Chinese' ),\n\t\t\t\t\t\t'mejs.chinese-simplified'  => __( 'Chinese (Simplified)' ),\n\t\t\t\t\t\t'mejs.chinese-traditional' => __( 'Chinese (Traditional)' ),\n\t\t\t\t\t\t'mejs.croatian'            => __( 'Croatian' ),\n\t\t\t\t\t\t'mejs.czech'               => __( 'Czech' ),\n\t\t\t\t\t\t'mejs.danish'              => __( 'Danish' ),\n\t\t\t\t\t\t'mejs.dutch'               => __( 'Dutch' ),\n\t\t\t\t\t\t'mejs.english'             => __( 'English' ),\n\t\t\t\t\t\t'mejs.estonian'            => __( 'Estonian' ),\n\t\t\t\t\t\t'mejs.filipino'            => __( 'Filipino' ),\n\t\t\t\t\t\t'mejs.finnish'             => __( 'Finnish' ),\n\t\t\t\t\t\t'mejs.french'              => __( 'French' ),\n\t\t\t\t\t\t'mejs.galician'            => __( 'Galician' ),\n\t\t\t\t\t\t'mejs.german'              => __( 'German' ),\n\t\t\t\t\t\t'mejs.greek'               => __( 'Greek' ),\n\t\t\t\t\t\t'mejs.haitian-creole'      => __( 'Haitian Creole' ),\n\t\t\t\t\t\t'mejs.hebrew'              => __( 'Hebrew' ),\n\t\t\t\t\t\t'mejs.hindi'               => __( 'Hindi' ),\n\t\t\t\t\t\t'mejs.hungarian'           => __( 'Hungarian' ),\n\t\t\t\t\t\t'mejs.icelandic'           => __( 'Icelandic' ),\n\t\t\t\t\t\t'mejs.indonesian'          => __( 'Indonesian' ),\n\t\t\t\t\t\t'mejs.irish'               => __( 'Irish' ),\n\t\t\t\t\t\t'mejs.italian'             => __( 'Italian' ),\n\t\t\t\t\t\t'mejs.japanese'            => __( 'Japanese' ),\n\t\t\t\t\t\t'mejs.korean'              => __( 'Korean' ),\n\t\t\t\t\t\t'mejs.latvian'             => __( 'Latvian' ),\n\t\t\t\t\t\t'mejs.lithuanian'          => __( 'Lithuanian' ),\n\t\t\t\t\t\t'mejs.macedonian'          => __( 'Macedonian' ),\n\t\t\t\t\t\t'mejs.malay'               => __( 'Malay' ),\n\t\t\t\t\t\t'mejs.maltese'             => __( 'Maltese' ),\n\t\t\t\t\t\t'mejs.norwegian'           => __( 'Norwegian' ),\n\t\t\t\t\t\t'mejs.persian'             => __( 'Persian' ),\n\t\t\t\t\t\t'mejs.polish'              => __( 'Polish' ),\n\t\t\t\t\t\t'mejs.portuguese'          => __( 'Portuguese' ),\n\t\t\t\t\t\t'mejs.romanian'            => __( 'Romanian' ),\n\t\t\t\t\t\t'mejs.russian'             => __( 'Russian' ),\n\t\t\t\t\t\t'mejs.serbian'             => __( 'Serbian' ),\n\t\t\t\t\t\t'mejs.slovak'              => __( 'Slovak' ),\n\t\t\t\t\t\t'mejs.slovenian'           => __( 'Slovenian' ),\n\t\t\t\t\t\t'mejs.spanish'             => __( 'Spanish' ),\n\t\t\t\t\t\t'mejs.swahili'             => __( 'Swahili' ),\n\t\t\t\t\t\t'mejs.swedish'             => __( 'Swedish' ),\n\t\t\t\t\t\t'mejs.tagalog'             => __( 'Tagalog' ),\n\t\t\t\t\t\t'mejs.thai'                => __( 'Thai' ),\n\t\t\t\t\t\t'mejs.turkish'             => __( 'Turkish' ),\n\t\t\t\t\t\t'mejs.ukrainian'           => __( 'Ukrainian' ),\n\t\t\t\t\t\t'mejs.vietnamese'          => __( 'Vietnamese' ),\n\t\t\t\t\t\t'mejs.welsh'               => __( 'Welsh' ),\n\t\t\t\t\t\t'mejs.yiddish'             => __( 'Yiddish' ),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\t\t'before'\n\t);\n\n\t$scripts->add( 'mediaelement-vimeo', '/wp-includes/js/mediaelement/renderers/vimeo.min.js', array( 'mediaelement' ), '4.2.13-9993131', 1 );\n\t$scripts->add( 'wp-mediaelement', \"/wp-includes/js/mediaelement/wp-mediaelement$suffix.js\", array( 'mediaelement' ), false, 1 );\n\t$mejs_settings = array(\n\t\t'pluginPath'  => includes_url( 'js/mediaelement/', 'relative' ),\n\t\t'classPrefix' => 'mejs-',\n\t\t'stretching'  => 'responsive',\n\t);\n\tdid_action( 'init' ) && $scripts->localize(\n\t\t'mediaelement',\n\t\t'_wpmejsSettings',\n\t\t/**\n\t\t * Filters the MediaElement configuration settings.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param array $mejs_settings MediaElement settings array.\n\t\t */\n\t\tapply_filters( 'mejs_settings', $mejs_settings )\n\t);\n\n\t$scripts->add( 'wp-codemirror', '/wp-includes/js/codemirror/codemirror.min.js', array(), '5.29.1-alpha-ee20357' );\n\t$scripts->add( 'csslint', '/wp-includes/js/codemirror/csslint.js', array(), '1.0.5' );\n\t$scripts->add( 'esprima', '/wp-includes/js/codemirror/esprima.js', array(), '4.0.0' );\n\t$scripts->add( 'jshint', '/wp-includes/js/codemirror/fakejshint.js', array( 'esprima' ), '2.9.5' );\n\t$scripts->add( 'jsonlint', '/wp-includes/js/codemirror/jsonlint.js', array(), '1.6.2' );\n\t$scripts->add( 'htmlhint', '/wp-includes/js/codemirror/htmlhint.js', array(), '0.9.14-xwp' );\n\t$scripts->add( 'htmlhint-kses', '/wp-includes/js/codemirror/htmlhint-kses.js', array( 'htmlhint' ) );\n\t$scripts->add( 'code-editor', \"/wp-admin/js/code-editor$suffix.js\", array( 'jquery', 'wp-codemirror', 'underscore' ) );\n\t$scripts->add( 'wp-theme-plugin-editor', \"/wp-admin/js/theme-plugin-editor$suffix.js\", array( 'common', 'wp-util', 'wp-sanitize', 'jquery', 'jquery-ui-core', 'wp-a11y', 'underscore' ) );\n\t$scripts->set_translations( 'wp-theme-plugin-editor' );\n\n\t$scripts->add( 'wp-playlist', \"/wp-includes/js/mediaelement/wp-playlist$suffix.js\", array( 'wp-util', 'backbone', 'mediaelement' ), false, 1 );\n\n\t$scripts->add( 'zxcvbn-async', \"/wp-includes/js/zxcvbn-async$suffix.js\", array(), '1.0' );\n\tdid_action( 'init' ) && $scripts->localize(\n\t\t'zxcvbn-async',\n\t\t'_zxcvbnSettings',\n\t\tarray(\n\t\t\t'src' => empty( $guessed_url ) ? includes_url( '/js/zxcvbn.min.js' ) : $scripts->base_url . '/wp-includes/js/zxcvbn.min.js',\n\t\t)\n\t);\n\n\t$scripts->add( 'password-strength-meter', \"/wp-admin/js/password-strength-meter$suffix.js\", array( 'jquery', 'zxcvbn-async' ), false, 1 );\n\tdid_action( 'init' ) && $scripts->localize(\n\t\t'password-strength-meter',\n\t\t'pwsL10n',\n\t\tarray(\n\t\t\t'unknown'  => _x( 'Password strength unknown', 'password strength' ),\n\t\t\t'short'    => _x( 'Very weak', 'password strength' ),\n\t\t\t'bad'      => _x( 'Weak', 'password strength' ),\n\t\t\t'good'     => _x( 'Medium', 'password strength' ),\n\t\t\t'strong'   => _x( 'Strong', 'password strength' ),\n\t\t\t'mismatch' => _x( 'Mismatch', 'password mismatch' ),\n\t\t)\n\t);\n\t$scripts->set_translations( 'password-strength-meter' );\n\n\t$scripts->add( 'user-profile', \"/wp-admin/js/user-profile$suffix.js\", array( 'jquery', 'password-strength-meter', 'wp-util' ), false, 1 );\n\t$scripts->set_translations( 'user-profile' );\n\n\t$scripts->add( 'language-chooser', \"/wp-admin/js/language-chooser$suffix.js\", array( 'jquery' ), false, 1 );\n\n\t$scripts->add( 'user-suggest', \"/wp-admin/js/user-suggest$suffix.js\", array( 'jquery-ui-autocomplete' ), false, 1 );\n\n\t$scripts->add( 'admin-bar', \"/wp-includes/js/admin-bar$suffix.js\", array( 'hoverintent-js' ), false, 1 );\n\n\t$scripts->add( 'wplink', \"/wp-includes/js/wplink$suffix.js\", array( 'jquery', 'wp-a11y' ), false, 1 );\n\tdid_action( 'init' ) && $scripts->localize(\n\t\t'wplink',\n\t\t'wpLinkL10n',\n\t\tarray(\n\t\t\t'title'          => __( 'Insert/edit link' ),\n\t\t\t'update'         => __( 'Update' ),\n\t\t\t'save'           => __( 'Add Link' ),\n\t\t\t'noTitle'        => __( '(no title)' ),\n\t\t\t'noMatchesFound' => __( 'No results found.' ),\n\t\t\t'linkSelected'   => __( 'Link selected.' ),\n\t\t\t'linkInserted'   => __( 'Link inserted.' ),\n\t\t\t/* translators: Minimum input length in characters to start searching posts in the \"Insert/edit link\" modal. */\n\t\t\t'minInputLength' => (int) _x( '3', 'minimum input length for searching post links' ),\n\t\t)\n\t);\n\n\t$scripts->add( 'wpdialogs', \"/wp-includes/js/wpdialog$suffix.js\", array( 'jquery-ui-dialog' ), false, 1 );\n\n\t$scripts->add( 'word-count', \"/wp-admin/js/word-count$suffix.js\", array(), false, 1 );\n\n\t$scripts->add( 'media-upload', \"/wp-admin/js/media-upload$suffix.js\", array( 'thickbox', 'shortcode' ), false, 1 );\n\n\t$scripts->add( 'hoverIntent', \"/wp-includes/js/hoverIntent$suffix.js\", array( 'jquery' ), '1.8.1', 1 );\n\n\t// JS-only version of hoverintent (no dependencies).\n\t$scripts->add( 'hoverintent-js', '/wp-includes/js/hoverintent-js.min.js', array(), '2.2.1', 1 );\n\n\t$scripts->add( 'customize-base', \"/wp-includes/js/customize-base$suffix.js\", array( 'jquery', 'json2', 'underscore' ), false, 1 );\n\t$scripts->add( 'customize-loader', \"/wp-includes/js/customize-loader$suffix.js\", array( 'customize-base' ), false, 1 );\n\t$scripts->add( 'customize-preview', \"/wp-includes/js/customize-preview$suffix.js\", array( 'wp-a11y', 'customize-base' ), false, 1 );\n\t$scripts->add( 'customize-models', '/wp-includes/js/customize-models.js', array( 'underscore', 'backbone' ), false, 1 );\n\t$scripts->add( 'customize-views', '/wp-includes/js/customize-views.js', array( 'jquery', 'underscore', 'imgareaselect', 'customize-models', 'media-editor', 'media-views' ), false, 1 );\n\t$scripts->add( 'customize-controls', \"/wp-admin/js/customize-controls$suffix.js\", array( 'customize-base', 'wp-a11y', 'wp-util', 'jquery-ui-core' ), false, 1 );\n\tdid_action( 'init' ) && $scripts->localize(\n\t\t'customize-controls',\n\t\t'_wpCustomizeControlsL10n',\n\t\tarray(\n\t\t\t'activate'                => __( 'Activate &amp; Publish' ),\n\t\t\t'save'                    => __( 'Save &amp; Publish' ), // @todo Remove as not required.\n\t\t\t'publish'                 => __( 'Publish' ),\n\t\t\t'published'               => __( 'Published' ),\n\t\t\t'saveDraft'               => __( 'Save Draft' ),\n\t\t\t'draftSaved'              => __( 'Draft Saved' ),\n\t\t\t'updating'                => __( 'Updating' ),\n\t\t\t'schedule'                => _x( 'Schedule', 'customizer changeset action/button label' ),\n\t\t\t'scheduled'               => _x( 'Scheduled', 'customizer changeset status' ),\n\t\t\t'invalid'                 => __( 'Invalid' ),\n\t\t\t'saveBeforeShare'         => __( 'Please save your changes in order to share the preview.' ),\n\t\t\t'futureDateError'         => __( 'You must supply a future date to schedule.' ),\n\t\t\t'saveAlert'               => __( 'The changes you made will be lost if you navigate away from this page.' ),\n\t\t\t'saved'                   => __( 'Saved' ),\n\t\t\t'cancel'                  => __( 'Cancel' ),\n\t\t\t'close'                   => __( 'Close' ),\n\t\t\t'action'                  => __( 'Action' ),\n\t\t\t'discardChanges'          => __( 'Discard changes' ),\n\t\t\t'cheatin'                 => __( 'Something went wrong.' ),\n\t\t\t'notAllowedHeading'       => __( 'You need a higher level of permission.' ),\n\t\t\t'notAllowed'              => __( 'Sorry, you are not allowed to customize this site.' ),\n\t\t\t'previewIframeTitle'      => __( 'Site Preview' ),\n\t\t\t'loginIframeTitle'        => __( 'Session expired' ),\n\t\t\t'collapseSidebar'         => _x( 'Hide Controls', 'label for hide controls button without length constraints' ),\n\t\t\t'expandSidebar'           => _x( 'Show Controls', 'label for hide controls button without length constraints' ),\n\t\t\t'untitledBlogName'        => __( '(Untitled)' ),\n\t\t\t'unknownRequestFail'      => __( 'Looks like something&#8217;s gone wrong. Wait a couple seconds, and then try again.' ),\n\t\t\t'themeDownloading'        => __( 'Downloading your new theme&hellip;' ),\n\t\t\t'themePreviewWait'        => __( 'Setting up your live preview. This may take a bit.' ),\n\t\t\t'revertingChanges'        => __( 'Reverting unpublished changes&hellip;' ),\n\t\t\t'trashConfirm'            => __( 'Are you sure you want to discard your unpublished changes?' ),\n\t\t\t/* translators: %s: Display name of the user who has taken over the changeset in customizer. */\n\t\t\t'takenOverMessage'        => __( '%s has taken over and is currently customizing.' ),\n\t\t\t/* translators: %s: URL to the Customizer to load the autosaved version. */\n\t\t\t'autosaveNotice'          => __( 'There is a more recent autosave of your changes than the one you are previewing. <a href=\"%s\">Restore the autosave</a>' ),\n\t\t\t'videoHeaderNotice'       => __( 'This theme doesn&#8217;t support video headers on this page. Navigate to the front page or another page that supports video headers.' ),\n\t\t\t// Used for overriding the file types allowed in Plupload.\n\t\t\t'allowedFiles'            => __( 'Allowed Files' ),\n\t\t\t'customCssError'          => array(\n\t\t\t\t/* translators: %d: Error count. */\n\t\t\t\t'singular' => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 1 ),\n\t\t\t\t/* translators: %d: Error count. */\n\t\t\t\t'plural'   => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 2 ),\n\t\t\t\t// @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.\n\t\t\t),\n\t\t\t'pageOnFrontError'        => __( 'Homepage and posts page must be different.' ),\n\t\t\t'saveBlockedError'        => array(\n\t\t\t\t/* translators: %s: Number of invalid settings. */\n\t\t\t\t'singular' => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 1 ),\n\t\t\t\t/* translators: %s: Number of invalid settings. */\n\t\t\t\t'plural'   => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 2 ),\n\t\t\t\t// @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.\n\t\t\t),\n\t\t\t'scheduleDescription'     => __( 'Schedule your customization changes to publish (\"go live\") at a future date.' ),\n\t\t\t'themePreviewUnavailable' => __( 'Sorry, you can&#8217;t preview new themes when you have changes scheduled or saved as a draft. Please publish your changes, or wait until they publish to preview new themes.' ),\n\t\t\t'themeInstallUnavailable' => sprintf(\n\t\t\t\t/* translators: %s: URL to Add Themes admin screen. */\n\t\t\t\t__( 'You won&#8217;t be able to install new themes from here yet since your install requires SFTP credentials. For now, please <a href=\"%s\">add themes in the admin</a>.' ),\n\t\t\t\tesc_url( admin_url( 'theme-install.php' ) )\n\t\t\t),\n\t\t\t'publishSettings'         => __( 'Publish Settings' ),\n\t\t\t'invalidDate'             => __( 'Invalid date.' ),\n\t\t\t'invalidValue'            => __( 'Invalid value.' ),\n\t\t)\n\t);\n\t$scripts->add( 'customize-selective-refresh', \"/wp-includes/js/customize-selective-refresh$suffix.js\", array( 'jquery', 'wp-util', 'customize-preview' ), false, 1 );\n\n\t$scripts->add( 'customize-widgets', \"/wp-admin/js/customize-widgets$suffix.js\", array( 'jquery', 'jquery-ui-sortable', 'jquery-ui-droppable', 'wp-backbone', 'customize-controls' ), false, 1 );\n\t$scripts->add( 'customize-preview-widgets', \"/wp-includes/js/customize-preview-widgets$suffix.js\", array( 'jquery', 'wp-util', 'customize-preview', 'customize-selective-refresh' ), false, 1 );\n\n\t$scripts->add( 'customize-nav-menus', \"/wp-admin/js/customize-nav-menus$suffix.js\", array( 'jquery', 'wp-backbone', 'customize-controls', 'accordion', 'nav-menu', 'wp-sanitize' ), false, 1 );\n\t$scripts->add( 'customize-preview-nav-menus', \"/wp-includes/js/customize-preview-nav-menus$suffix.js\", array( 'jquery', 'wp-util', 'customize-preview', 'customize-selective-refresh' ), false, 1 );\n\n\t$scripts->add( 'wp-custom-header', \"/wp-includes/js/wp-custom-header$suffix.js\", array( 'wp-a11y' ), false, 1 );\n\n\t$scripts->add( 'accordion', \"/wp-admin/js/accordion$suffix.js\", array( 'jquery' ), false, 1 );\n\n\t$scripts->add( 'shortcode', \"/wp-includes/js/shortcode$suffix.js\", array( 'underscore' ), false, 1 );\n\t$scripts->add( 'media-models', \"/wp-includes/js/media-models$suffix.js\", array( 'wp-backbone' ), false, 1 );\n\tdid_action( 'init' ) && $scripts->localize(\n\t\t'media-models',\n\t\t'_wpMediaModelsL10n',\n\t\tarray(\n\t\t\t'settings' => array(\n\t\t\t\t'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ),\n\t\t\t\t'post'    => array( 'id' => 0 ),\n\t\t\t),\n\t\t)\n\t);\n\n\t$scripts->add( 'wp-embed', \"/wp-includes/js/wp-embed$suffix.js\" );\n\n\t// To enqueue media-views or media-editor, call wp_enqueue_media().\n\t// Both rely on numerous settings, styles, and templates to operate correctly.\n\t$scripts->add( 'media-views', \"/wp-includes/js/media-views$suffix.js\", array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable', 'wp-mediaelement', 'wp-api-request', 'wp-a11y', 'clipboard' ), false, 1 );\n\t$scripts->set_translations( 'media-views' );\n\n\t$scripts->add( 'media-editor', \"/wp-includes/js/media-editor$suffix.js\", array( 'shortcode', 'media-views' ), false, 1 );\n\t$scripts->set_translations( 'media-editor' );\n\t$scripts->add( 'media-audiovideo', \"/wp-includes/js/media-audiovideo$suffix.js\", array( 'media-editor' ), false, 1 );\n\t$scripts->add( 'mce-view', \"/wp-includes/js/mce-view$suffix.js\", array( 'shortcode', 'jquery', 'media-views', 'media-audiovideo' ), false, 1 );\n\n\t$scripts->add( 'wp-api', \"/wp-includes/js/wp-api$suffix.js\", array( 'jquery', 'backbone', 'underscore', 'wp-api-request' ), false, 1 );\n\n\tif ( is_admin() ) {\n\t\t$scripts->add( 'admin-tags', \"/wp-admin/js/tags$suffix.js\", array( 'jquery', 'wp-ajax-response' ), false, 1 );\n\t\t$scripts->set_translations( 'admin-tags' );\n\n\t\t$scripts->add( 'admin-comments', \"/wp-admin/js/edit-comments$suffix.js\", array( 'wp-lists', 'quicktags', 'jquery-query' ), false, 1 );\n\t\t$scripts->set_translations( 'admin-comments' );\n\t\tdid_action( 'init' ) && $scripts->localize(\n\t\t\t'admin-comments',\n\t\t\t'adminCommentsSettings',\n\t\t\tarray(\n\t\t\t\t'hotkeys_highlight_first' => isset( $_GET['hotkeys_highlight_first'] ),\n\t\t\t\t'hotkeys_highlight_last'  => isset( $_GET['hotkeys_highlight_last'] ),\n\t\t\t)\n\t\t);\n\n\t\t$scripts->add( 'xfn', \"/wp-admin/js/xfn$suffix.js\", array( 'jquery' ), false, 1 );\n\n\t\t$scripts->add( 'postbox', \"/wp-admin/js/postbox$suffix.js\", array( 'jquery-ui-sortable', 'wp-a11y' ), false, 1 );\n\t\t$scripts->set_translations( 'postbox' );\n\n\t\t$scripts->add( 'tags-box', \"/wp-admin/js/tags-box$suffix.js\", array( 'jquery', 'tags-suggest' ), false, 1 );\n\t\t$scripts->set_translations( 'tags-box' );\n\n\t\t$scripts->add( 'tags-suggest', \"/wp-admin/js/tags-suggest$suffix.js\", array( 'jquery-ui-autocomplete', 'wp-a11y' ), false, 1 );\n\t\t$scripts->set_translations( 'tags-suggest' );\n\n\t\t$scripts->add( 'post', \"/wp-admin/js/post$suffix.js\", array( 'suggest', 'wp-lists', 'postbox', 'tags-box', 'underscore', 'word-count', 'wp-a11y', 'wp-sanitize', 'clipboard' ), false, 1 );\n\t\t$scripts->set_translations( 'post' );\n\n\t\t$scripts->add( 'editor-expand', \"/wp-admin/js/editor-expand$suffix.js\", array( 'jquery', 'underscore' ), false, 1 );\n\n\t\t$scripts->add( 'link', \"/wp-admin/js/link$suffix.js\", array( 'wp-lists', 'postbox' ), false, 1 );\n\n\t\t$scripts->add( 'comment', \"/wp-admin/js/comment$suffix.js\", array( 'jquery', 'postbox' ), false, 1 );\n\t\t$scripts->set_translations( 'comment' );\n\n\t\t$scripts->add( 'admin-gallery', \"/wp-admin/js/gallery$suffix.js\", array( 'jquery-ui-sortable' ) );\n\n\t\t$scripts->add( 'admin-widgets', \"/wp-admin/js/widgets$suffix.js\", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'wp-a11y' ), false, 1 );\n\t\t$scripts->set_translations( 'admin-widgets' );\n\n\t\t$scripts->add( 'media-widgets', \"/wp-admin/js/widgets/media-widgets$suffix.js\", array( 'jquery', 'media-models', 'media-views', 'wp-api-request' ) );\n\t\t$scripts->add_inline_script( 'media-widgets', 'wp.mediaWidgets.init();', 'after' );\n\n\t\t$scripts->add( 'media-audio-widget', \"/wp-admin/js/widgets/media-audio-widget$suffix.js\", array( 'media-widgets', 'media-audiovideo' ) );\n\t\t$scripts->add( 'media-image-widget', \"/wp-admin/js/widgets/media-image-widget$suffix.js\", array( 'media-widgets' ) );\n\t\t$scripts->add( 'media-gallery-widget', \"/wp-admin/js/widgets/media-gallery-widget$suffix.js\", array( 'media-widgets' ) );\n\t\t$scripts->add( 'media-video-widget', \"/wp-admin/js/widgets/media-video-widget$suffix.js\", array( 'media-widgets', 'media-audiovideo', 'wp-api-request' ) );\n\t\t$scripts->add( 'text-widgets', \"/wp-admin/js/widgets/text-widgets$suffix.js\", array( 'jquery', 'backbone', 'editor', 'wp-util', 'wp-a11y' ) );\n\t\t$scripts->add( 'custom-html-widgets', \"/wp-admin/js/widgets/custom-html-widgets$suffix.js\", array( 'jquery', 'backbone', 'wp-util', 'jquery-ui-core', 'wp-a11y' ) );\n\n\t\t$scripts->add( 'theme', \"/wp-admin/js/theme$suffix.js\", array( 'wp-backbone', 'wp-a11y', 'customize-base' ), false, 1 );\n\n\t\t$scripts->add( 'inline-edit-post', \"/wp-admin/js/inline-edit-post$suffix.js\", array( 'jquery', 'tags-suggest', 'wp-a11y' ), false, 1 );\n\t\t$scripts->set_translations( 'inline-edit-post' );\n\n\t\t$scripts->add( 'inline-edit-tax', \"/wp-admin/js/inline-edit-tax$suffix.js\", array( 'jquery', 'wp-a11y' ), false, 1 );\n\t\t$scripts->set_translations( 'inline-edit-tax' );\n\n\t\t$scripts->add( 'plugin-install', \"/wp-admin/js/plugin-install$suffix.js\", array( 'jquery', 'jquery-ui-core', 'thickbox' ), false, 1 );\n\t\t$scripts->set_translations( 'plugin-install' );\n\n\t\t$scripts->add( 'site-health', \"/wp-admin/js/site-health$suffix.js\", array( 'clipboard', 'jquery', 'wp-util', 'wp-a11y' ), false, 1 );\n\t\t$scripts->set_translations( 'site-health' );\n\n\t\t$scripts->add( 'privacy-tools', \"/wp-admin/js/privacy-tools$suffix.js\", array( 'jquery', 'wp-a11y' ), false, 1 );\n\t\t$scripts->set_translations( 'privacy-tools' );\n\n\t\t$scripts->add( 'updates', \"/wp-admin/js/updates$suffix.js\", array( 'common', 'jquery', 'wp-util', 'wp-a11y', 'wp-sanitize' ), false, 1 );\n\t\t$scripts->set_translations( 'updates' );\n\t\tdid_action( 'init' ) && $scripts->localize(\n\t\t\t'updates',\n\t\t\t'_wpUpdatesSettings',\n\t\t\tarray(\n\t\t\t\t'ajax_nonce' => wp_create_nonce( 'updates' ),\n\t\t\t)\n\t\t);\n\n\t\t$scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array( 'jquery' ), '1.2' );\n\n\t\t$scripts->add( 'iris', '/wp-admin/js/iris.min.js', array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), '1.0.7', 1 );\n\t\t$scripts->add( 'wp-color-picker', \"/wp-admin/js/color-picker$suffix.js\", array( 'iris' ), false, 1 );\n\t\t$scripts->set_translations( 'wp-color-picker' );\n\n\t\t$scripts->add( 'dashboard', \"/wp-admin/js/dashboard$suffix.js\", array( 'jquery', 'admin-comments', 'postbox', 'wp-util', 'wp-a11y', 'wp-date' ), false, 1 );\n\t\t$scripts->set_translations( 'dashboard' );\n\n\t\t$scripts->add( 'list-revisions', \"/wp-includes/js/wp-list-revisions$suffix.js\" );\n\n\t\t$scripts->add( 'media-grid', \"/wp-includes/js/media-grid$suffix.js\", array( 'media-editor' ), false, 1 );\n\t\t$scripts->add( 'media', \"/wp-admin/js/media$suffix.js\", array( 'jquery' ), false, 1 );\n\t\t$scripts->set_translations( 'media' );\n\n\t\t$scripts->add( 'image-edit', \"/wp-admin/js/image-edit$suffix.js\", array( 'jquery', 'jquery-ui-core', 'json2', 'imgareaselect', 'wp-a11y' ), false, 1 );\n\t\t$scripts->set_translations( 'image-edit' );\n\n\t\t$scripts->add( 'set-post-thumbnail', \"/wp-admin/js/set-post-thumbnail$suffix.js\", array( 'jquery' ), false, 1 );\n\t\t$scripts->set_translations( 'set-post-thumbnail' );\n\n\t\t/*\n\t\t * Navigation Menus: Adding underscore as a dependency to utilize _.debounce\n\t\t * see https://core.trac.wordpress.org/ticket/42321\n\t\t */\n\t\t$scripts->add( 'nav-menu', \"/wp-admin/js/nav-menu$suffix.js\", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'wp-lists', 'postbox', 'json2', 'underscore' ) );\n\t\t$scripts->set_translations( 'nav-menu' );\n\n\t\t$scripts->add( 'custom-header', '/wp-admin/js/custom-header.js', array( 'jquery-masonry' ), false, 1 );\n\t\t$scripts->add( 'custom-background', \"/wp-admin/js/custom-background$suffix.js\", array( 'wp-color-picker', 'media-views' ), false, 1 );\n\t\t$scripts->add( 'media-gallery', \"/wp-admin/js/media-gallery$suffix.js\", array( 'jquery' ), false, 1 );\n\n\t\t$scripts->add( 'svg-painter', '/wp-admin/js/svg-painter.js', array( 'jquery' ), false, 1 );\n\t}\n}\n\n/**\n * Assign default styles to $styles object.\n *\n * Nothing is returned, because the $styles parameter is passed by reference.\n * Meaning that whatever object is passed will be updated without having to\n * reassign the variable that was passed back to the same value. This saves\n * memory.\n *\n * Adding default styles is not the only task, it also assigns the base_url\n * property, the default version, and text direction for the object.\n *\n * @since 2.6.0\n *\n * @param WP_Styles $styles\n */\nfunction wp_default_styles( $styles ) {\n\t// Include an unmodified $wp_version.\n\trequire ABSPATH . WPINC . '/version.php';\n\n\tif ( ! defined( 'SCRIPT_DEBUG' ) ) {\n\t\tdefine( 'SCRIPT_DEBUG', false !== strpos( $wp_version, '-src' ) );\n\t}\n\n\t$guessurl = site_url();\n\n\tif ( ! $guessurl ) {\n\t\t$guessurl = wp_guess_url();\n\t}\n\n\t$styles->base_url        = $guessurl;\n\t$styles->content_url     = defined( 'WP_CONTENT_URL' ) ? WP_CONTENT_URL : '';\n\t$styles->default_version = get_bloginfo( 'version' );\n\t$styles->text_direction  = function_exists( 'is_rtl' ) && is_rtl() ? 'rtl' : 'ltr';\n\t$styles->default_dirs    = array( '/wp-admin/', '/wp-includes/css/' );\n\n\t// Open Sans is no longer used by core, but may be relied upon by themes and plugins.\n\t$open_sans_font_url = '';\n\n\t/*\n\t * translators: If there are characters in your language that are not supported\n\t * by Open Sans, translate this to 'off'. Do not translate into your own language.\n\t */\n\tif ( 'off' !== _x( 'on', 'Open Sans font: on or off' ) ) {\n\t\t$subsets = 'latin,latin-ext';\n\n\t\t/*\n\t\t * translators: To add an additional Open Sans character subset specific to your language,\n\t\t * translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language.\n\t\t */\n\t\t$subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)' );\n\n\t\tif ( 'cyrillic' === $subset ) {\n\t\t\t$subsets .= ',cyrillic,cyrillic-ext';\n\t\t} elseif ( 'greek' === $subset ) {\n\t\t\t$subsets .= ',greek,greek-ext';\n\t\t} elseif ( 'vietnamese' === $subset ) {\n\t\t\t$subsets .= ',vietnamese';\n\t\t}\n\n\t\t// Hotlink Open Sans, for now.\n\t\t$open_sans_font_url = \"https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=$subsets&display=fallback\";\n\t}\n\n\t// Register a stylesheet for the selected admin color scheme.\n\t$styles->add( 'colors', true, array( 'wp-admin', 'buttons' ) );\n\n\t$suffix = SCRIPT_DEBUG ? '' : '.min';\n\n\t// Admin CSS.\n\t$styles->add( 'common', \"/wp-admin/css/common$suffix.css\" );\n\t$styles->add( 'forms', \"/wp-admin/css/forms$suffix.css\" );\n\t$styles->add( 'admin-menu', \"/wp-admin/css/admin-menu$suffix.css\" );\n\t$styles->add( 'dashboard', \"/wp-admin/css/dashboard$suffix.css\" );\n\t$styles->add( 'list-tables', \"/wp-admin/css/list-tables$suffix.css\" );\n\t$styles->add( 'edit', \"/wp-admin/css/edit$suffix.css\" );\n\t$styles->add( 'revisions', \"/wp-admin/css/revisions$suffix.css\" );\n\t$styles->add( 'media', \"/wp-admin/css/media$suffix.css\" );\n\t$styles->add( 'themes', \"/wp-admin/css/themes$suffix.css\" );\n\t$styles->add( 'about', \"/wp-admin/css/about$suffix.css\" );\n\t$styles->add( 'nav-menus', \"/wp-admin/css/nav-menus$suffix.css\" );\n\t$styles->add( 'widgets', \"/wp-admin/css/widgets$suffix.css\", array( 'wp-pointer' ) );\n\t$styles->add( 'site-icon', \"/wp-admin/css/site-icon$suffix.css\" );\n\t$styles->add( 'l10n', \"/wp-admin/css/l10n$suffix.css\" );\n\t$styles->add( 'code-editor', \"/wp-admin/css/code-editor$suffix.css\", array( 'wp-codemirror' ) );\n\t$styles->add( 'site-health', \"/wp-admin/css/site-health$suffix.css\" );\n\n\t$styles->add( 'wp-admin', false, array( 'dashicons', 'common', 'forms', 'admin-menu', 'dashboard', 'list-tables', 'edit', 'revisions', 'media', 'themes', 'about', 'nav-menus', 'widgets', 'site-icon', 'l10n' ) );\n\n\t$styles->add( 'login', \"/wp-admin/css/login$suffix.css\", array( 'dashicons', 'buttons', 'forms', 'l10n' ) );\n\t$styles->add( 'install', \"/wp-admin/css/install$suffix.css\", array( 'dashicons', 'buttons', 'forms', 'l10n' ) );\n\t$styles->add( 'wp-color-picker', \"/wp-admin/css/color-picker$suffix.css\" );\n\t$styles->add( 'customize-controls', \"/wp-admin/css/customize-controls$suffix.css\", array( 'wp-admin', 'colors', 'imgareaselect' ) );\n\t$styles->add( 'customize-widgets', \"/wp-admin/css/customize-widgets$suffix.css\", array( 'wp-admin', 'colors' ) );\n\t$styles->add( 'customize-nav-menus', \"/wp-admin/css/customize-nav-menus$suffix.css\", array( 'wp-admin', 'colors' ) );\n\n\t// Common dependencies.\n\t$styles->add( 'buttons', \"/wp-includes/css/buttons$suffix.css\" );\n\t$styles->add( 'dashicons', \"/wp-includes/css/dashicons$suffix.css\" );\n\n\t// Includes CSS.\n\t$styles->add( 'admin-bar', \"/wp-includes/css/admin-bar$suffix.css\", array( 'dashicons' ) );\n\t$styles->add( 'wp-auth-check', \"/wp-includes/css/wp-auth-check$suffix.css\", array( 'dashicons' ) );\n\t$styles->add( 'editor-buttons', \"/wp-includes/css/editor$suffix.css\", array( 'dashicons' ) );\n\t$styles->add( 'media-views', \"/wp-includes/css/media-views$suffix.css\", array( 'buttons', 'dashicons', 'wp-mediaelement' ) );\n\t$styles->add( 'wp-pointer', \"/wp-includes/css/wp-pointer$suffix.css\", array( 'dashicons' ) );\n\t$styles->add( 'customize-preview', \"/wp-includes/css/customize-preview$suffix.css\", array( 'dashicons' ) );\n\t$styles->add( 'wp-embed-template-ie', \"/wp-includes/css/wp-embed-template-ie$suffix.css\" );\n\t$styles->add_data( 'wp-embed-template-ie', 'conditional', 'lte IE 8' );\n\n\t// External libraries and friends.\n\t$styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.8' );\n\t$styles->add( 'wp-jquery-ui-dialog', \"/wp-includes/css/jquery-ui-dialog$suffix.css\", array( 'dashicons' ) );\n\t$styles->add( 'mediaelement', '/wp-includes/js/mediaelement/mediaelementplayer-legacy.min.css', array(), '4.2.13-9993131' );\n\t$styles->add( 'wp-mediaelement', \"/wp-includes/js/mediaelement/wp-mediaelement$suffix.css\", array( 'mediaelement' ) );\n\t$styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array( 'dashicons' ) );\n\t$styles->add( 'wp-codemirror', '/wp-includes/js/codemirror/codemirror.min.css', array(), '5.29.1-alpha-ee20357' );\n\n\t// Deprecated CSS.\n\t$styles->add( 'deprecated-media', \"/wp-admin/css/deprecated-media$suffix.css\" );\n\t$styles->add( 'farbtastic', \"/wp-admin/css/farbtastic$suffix.css\", array(), '1.3u1' );\n\t$styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.min.css', array(), '0.9.12' );\n\t$styles->add( 'colors-fresh', false, array( 'wp-admin', 'buttons' ) ); // Old handle.\n\t$styles->add( 'open-sans', $open_sans_font_url ); // No longer used in core as of 4.6.\n\n\t// Packages styles.\n\t$fonts_url = '';\n\n\t/*\n\t * translators: Use this to specify the proper Google Font name and variants\n\t * to load that is supported by your language. Do not translate.\n\t * Set to 'off' to disable loading.\n\t */\n\t$font_family = _x( 'Noto Serif:400,400i,700,700i', 'Google Font Name and Variants' );\n\tif ( 'off' !== $font_family ) {\n\t\t$fonts_url = 'https://fonts.googleapis.com/css?family=' . urlencode( $font_family );\n\t}\n\t$styles->add( 'wp-editor-font', $fonts_url );\n\n\t$styles->add( 'wp-block-library-theme', \"/wp-includes/css/dist/block-library/theme$suffix.css\" );\n\n\t$styles->add(\n\t\t'wp-edit-blocks',\n\t\t\"/wp-includes/css/dist/block-library/editor$suffix.css\",\n\t\tarray(\n\t\t\t'wp-components',\n\t\t\t'wp-editor',\n\t\t\t'wp-block-library',\n\t\t\t// Always include visual styles so the editor never appears broken.\n\t\t\t'wp-block-library-theme',\n\t\t)\n\t);\n\n\t$package_styles = array(\n\t\t'block-editor'         => array(\n\t\t\t'wp-components',\n\t\t\t'wp-editor-font',\n\t\t),\n\t\t'block-library'        => array(),\n\t\t'block-directory'      => array(),\n\t\t'components'           => array(),\n\t\t'edit-post'            => array(\n\t\t\t'wp-components',\n\t\t\t'wp-block-editor',\n\t\t\t'wp-editor',\n\t\t\t'wp-edit-blocks',\n\t\t\t'wp-block-library',\n\t\t\t'wp-nux',\n\t\t),\n\t\t'editor'               => array(\n\t\t\t'wp-components',\n\t\t\t'wp-block-editor',\n\t\t\t'wp-nux',\n\t\t),\n\t\t'format-library'       => array(),\n\t\t'list-reusable-blocks' => array( 'wp-components' ),\n\t\t'nux'                  => array( 'wp-components' ),\n\t);\n\n\tforeach ( $package_styles as $package => $dependencies ) {\n\t\t$handle = 'wp-' . $package;\n\t\t$path   = \"/wp-includes/css/dist/$package/style$suffix.css\";\n\n\t\t$styles->add( $handle, $path, $dependencies );\n\t}\n\n\t// RTL CSS.\n\t$rtl_styles = array(\n\t\t// Admin CSS.\n\t\t'common',\n\t\t'forms',\n\t\t'admin-menu',\n\t\t'dashboard',\n\t\t'list-tables',\n\t\t'edit',\n\t\t'revisions',\n\t\t'media',\n\t\t'themes',\n\t\t'about',\n\t\t'nav-menus',\n\t\t'widgets',\n\t\t'site-icon',\n\t\t'l10n',\n\t\t'install',\n\t\t'wp-color-picker',\n\t\t'customize-controls',\n\t\t'customize-widgets',\n\t\t'customize-nav-menus',\n\t\t'customize-preview',\n\t\t'login',\n\t\t'site-health',\n\t\t// Includes CSS.\n\t\t'buttons',\n\t\t'admin-bar',\n\t\t'wp-auth-check',\n\t\t'editor-buttons',\n\t\t'media-views',\n\t\t'wp-pointer',\n\t\t'wp-jquery-ui-dialog',\n\t\t// Package styles.\n\t\t'wp-block-library-theme',\n\t\t'wp-edit-blocks',\n\t\t'wp-block-editor',\n\t\t'wp-block-library',\n\t\t'wp-block-directory',\n\t\t'wp-components',\n\t\t'wp-edit-post',\n\t\t'wp-editor',\n\t\t'wp-format-library',\n\t\t'wp-list-reusable-blocks',\n\t\t'wp-nux',\n\t\t// Deprecated CSS.\n\t\t'deprecated-media',\n\t\t'farbtastic',\n\t);\n\n\tforeach ( $rtl_styles as $rtl_style ) {\n\t\t$styles->add_data( $rtl_style, 'rtl', 'replace' );\n\t\tif ( $suffix ) {\n\t\t\t$styles->add_data( $rtl_style, 'suffix', $suffix );\n\t\t}\n\t}\n}\n\n/**\n * Reorder JavaScript scripts array to place prototype before jQuery.\n *\n * @since 2.3.1\n *\n * @param array $js_array JavaScript scripts array\n * @return array Reordered array, if needed.\n */\nfunction wp_prototype_before_jquery( $js_array ) {\n\t$prototype = array_search( 'prototype', $js_array, true );\n\n\tif ( false === $prototype ) {\n\t\treturn $js_array;\n\t}\n\n\t$jquery = array_search( 'jquery', $js_array, true );\n\n\tif ( false === $jquery ) {\n\t\treturn $js_array;\n\t}\n\n\tif ( $prototype < $jquery ) {\n\t\treturn $js_array;\n\t}\n\n\tunset( $js_array[ $prototype ] );\n\n\tarray_splice( $js_array, $jquery, 0, 'prototype' );\n\n\treturn $js_array;\n}\n\n/**\n * Load localized data on print rather than initialization.\n *\n * These localizations require information that may not be loaded even by init.\n *\n * @since 2.5.0\n */\nfunction wp_just_in_time_script_localization() {\n\n\twp_localize_script(\n\t\t'autosave',\n\t\t'autosaveL10n',\n\t\tarray(\n\t\t\t'autosaveInterval' => AUTOSAVE_INTERVAL,\n\t\t\t'blog_id'          => get_current_blog_id(),\n\t\t)\n\t);\n\n\twp_localize_script(\n\t\t'mce-view',\n\t\t'mceViewL10n',\n\t\tarray(\n\t\t\t'shortcodes' => ! empty( $GLOBALS['shortcode_tags'] ) ? array_keys( $GLOBALS['shortcode_tags'] ) : array(),\n\t\t)\n\t);\n\n\twp_localize_script(\n\t\t'word-count',\n\t\t'wordCountL10n',\n\t\tarray(\n\t\t\t/*\n\t\t\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t\t\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t\t\t * Do not translate into your own language.\n\t\t\t */\n\t\t\t'type'       => _x( 'words', 'Word count type. Do not translate!' ),\n\t\t\t'shortcodes' => ! empty( $GLOBALS['shortcode_tags'] ) ? array_keys( $GLOBALS['shortcode_tags'] ) : array(),\n\t\t)\n\t);\n}\n\n/**\n * Localizes the jQuery UI datepicker.\n *\n * @since 4.6.0\n *\n * @link https://api.jqueryui.com/datepicker/#options\n *\n * @global WP_Locale $wp_locale WordPress date and time locale object.\n */\nfunction wp_localize_jquery_ui_datepicker() {\n\tglobal $wp_locale;\n\n\tif ( ! wp_script_is( 'jquery-ui-datepicker', 'enqueued' ) ) {\n\t\treturn;\n\t}\n\n\t// Convert the PHP date format into jQuery UI's format.\n\t$datepicker_date_format = str_replace(\n\t\tarray(\n\t\t\t'd',\n\t\t\t'j',\n\t\t\t'l',\n\t\t\t'z', // Day.\n\t\t\t'F',\n\t\t\t'M',\n\t\t\t'n',\n\t\t\t'm', // Month.\n\t\t\t'Y',\n\t\t\t'y', // Year.\n\t\t),\n\t\tarray(\n\t\t\t'dd',\n\t\t\t'd',\n\t\t\t'DD',\n\t\t\t'o',\n\t\t\t'MM',\n\t\t\t'M',\n\t\t\t'm',\n\t\t\t'mm',\n\t\t\t'yy',\n\t\t\t'y',\n\t\t),\n\t\tget_option( 'date_format' )\n\t);\n\n\t$datepicker_defaults = wp_json_encode(\n\t\tarray(\n\t\t\t'closeText'       => __( 'Close' ),\n\t\t\t'currentText'     => __( 'Today' ),\n\t\t\t'monthNames'      => array_values( $wp_locale->month ),\n\t\t\t'monthNamesShort' => array_values( $wp_locale->month_abbrev ),\n\t\t\t'nextText'        => __( 'Next' ),\n\t\t\t'prevText'        => __( 'Previous' ),\n\t\t\t'dayNames'        => array_values( $wp_locale->weekday ),\n\t\t\t'dayNamesShort'   => array_values( $wp_locale->weekday_abbrev ),\n\t\t\t'dayNamesMin'     => array_values( $wp_locale->weekday_initial ),\n\t\t\t'dateFormat'      => $datepicker_date_format,\n\t\t\t'firstDay'        => absint( get_option( 'start_of_week' ) ),\n\t\t\t'isRTL'           => $wp_locale->is_rtl(),\n\t\t)\n\t);\n\n\twp_add_inline_script( 'jquery-ui-datepicker', \"jQuery(document).ready(function(jQuery){jQuery.datepicker.setDefaults({$datepicker_defaults});});\" );\n}\n\n/**\n * Localizes community events data that needs to be passed to dashboard.js.\n *\n * @since 4.8.0\n */\nfunction wp_localize_community_events() {\n\tif ( ! wp_script_is( 'dashboard' ) ) {\n\t\treturn;\n\t}\n\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-community-events.php';\n\n\t$user_id            = get_current_user_id();\n\t$saved_location     = get_user_option( 'community-events-location', $user_id );\n\t$saved_ip_address   = isset( $saved_location['ip'] ) ? $saved_location['ip'] : false;\n\t$current_ip_address = WP_Community_Events::get_unsafe_client_ip();\n\n\t/*\n\t * If the user's location is based on their IP address, then update their\n\t * location when their IP address changes. This allows them to see events\n\t * in their current city when travelling. Otherwise, they would always be\n\t * shown events in the city where they were when they first loaded the\n\t * Dashboard, which could have been months or years ago.\n\t */\n\tif ( $saved_ip_address && $current_ip_address && $current_ip_address !== $saved_ip_address ) {\n\t\t$saved_location['ip'] = $current_ip_address;\n\t\tupdate_user_option( $user_id, 'community-events-location', $saved_location, true );\n\t}\n\n\t$events_client = new WP_Community_Events( $user_id, $saved_location );\n\n\twp_localize_script(\n\t\t'dashboard',\n\t\t'communityEventsData',\n\t\tarray(\n\t\t\t'nonce'       => wp_create_nonce( 'community_events' ),\n\t\t\t'cache'       => $events_client->get_cached_events(),\n\t\t\t'time_format' => get_option( 'time_format' ),\n\n\t\t\t'l10n'        => array(\n\t\t\t\t'enter_closest_city'              => __( 'Enter your closest city to find nearby events.' ),\n\t\t\t\t'error_occurred_please_try_again' => __( 'An error occurred. Please try again.' ),\n\t\t\t\t'attend_event_near_generic'       => __( 'Attend an upcoming event near you.' ),\n\n\t\t\t\t/*\n\t\t\t\t * These specific examples were chosen to highlight the fact that a\n\t\t\t\t * state is not needed, even for cities whose name is not unique.\n\t\t\t\t * It would be too cumbersome to include that in the instructions\n\t\t\t\t * to the user, so it's left as an implication.\n\t\t\t\t */\n\t\t\t\t/*\n\t\t\t\t * translators: %s is the name of the city we couldn't locate.\n\t\t\t\t * Replace the examples with cities related to your locale. Test that\n\t\t\t\t * they match the expected location and have upcoming events before\n\t\t\t\t * including them. If no cities related to your locale have events,\n\t\t\t\t * then use cities related to your locale that would be recognizable\n\t\t\t\t * to most users. Use only the city name itself, without any region\n\t\t\t\t * or country. Use the endonym (native locale name) instead of the\n\t\t\t\t * English name if possible.\n\t\t\t\t */\n\t\t\t\t'could_not_locate_city'           => __( 'We couldn&#8217;t locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland.' ),\n\n\t\t\t\t// This one is only used with wp.a11y.speak(), so it can/should be more brief.\n\t\t\t\t/* translators: %s: The name of a city. */\n\t\t\t\t'city_updated'                    => __( 'City updated. Listing events near %s.' ),\n\t\t\t),\n\t\t)\n\t);\n}\n\n/**\n * Administration Screen CSS for changing the styles.\n *\n * If installing the 'wp-admin/' directory will be replaced with './'.\n *\n * The $_wp_admin_css_colors global manages the Administration Screens CSS\n * stylesheet that is loaded. The option that is set is 'admin_color' and is the\n * color and key for the array. The value for the color key is an object with\n * a 'url' parameter that has the URL path to the CSS file.\n *\n * The query from $src parameter will be appended to the URL that is given from\n * the $_wp_admin_css_colors array value URL.\n *\n * @since 2.6.0\n *\n * @global array $_wp_admin_css_colors\n *\n * @param string $src    Source URL.\n * @param string $handle Either 'colors' or 'colors-rtl'.\n * @return string|false URL path to CSS stylesheet for Administration Screens.\n */\nfunction wp_style_loader_src( $src, $handle ) {\n\tglobal $_wp_admin_css_colors;\n\n\tif ( wp_installing() ) {\n\t\treturn preg_replace( '#^wp-admin/#', './', $src );\n\t}\n\n\tif ( 'colors' === $handle ) {\n\t\t$color = get_user_option( 'admin_color' );\n\n\t\tif ( empty( $color ) || ! isset( $_wp_admin_css_colors[ $color ] ) ) {\n\t\t\t$color = 'fresh';\n\t\t}\n\n\t\t$color = $_wp_admin_css_colors[ $color ];\n\t\t$url   = $color->url;\n\n\t\tif ( ! $url ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$parsed = parse_url( $src );\n\t\tif ( isset( $parsed['query'] ) && $parsed['query'] ) {\n\t\t\twp_parse_str( $parsed['query'], $qv );\n\t\t\t$url = add_query_arg( $qv, $url );\n\t\t}\n\n\t\treturn $url;\n\t}\n\n\treturn $src;\n}\n\n/**\n * Prints the script queue in the HTML head on admin pages.\n *\n * Postpones the scripts that were queued for the footer.\n * print_footer_scripts() is called in the footer to print these scripts.\n *\n * @since 2.8.0\n *\n * @see wp_print_scripts()\n *\n * @global bool $concatenate_scripts\n *\n * @return array\n */\nfunction print_head_scripts() {\n\tglobal $concatenate_scripts;\n\n\tif ( ! did_action( 'wp_print_scripts' ) ) {\n\t\t/** This action is documented in wp-includes/functions.wp-scripts.php */\n\t\tdo_action( 'wp_print_scripts' );\n\t}\n\n\t$wp_scripts = wp_scripts();\n\n\tscript_concat_settings();\n\t$wp_scripts->do_concat = $concatenate_scripts;\n\t$wp_scripts->do_head_items();\n\n\t/**\n\t * Filters whether to print the head scripts.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param bool $print Whether to print the head scripts. Default true.\n\t */\n\tif ( apply_filters( 'print_head_scripts', true ) ) {\n\t\t_print_scripts();\n\t}\n\n\t$wp_scripts->reset();\n\treturn $wp_scripts->done;\n}\n\n/**\n * Prints the scripts that were queued for the footer or too late for the HTML head.\n *\n * @since 2.8.0\n *\n * @global WP_Scripts $wp_scripts\n * @global bool       $concatenate_scripts\n *\n * @return array\n */\nfunction print_footer_scripts() {\n\tglobal $wp_scripts, $concatenate_scripts;\n\n\tif ( ! ( $wp_scripts instanceof WP_Scripts ) ) {\n\t\treturn array(); // No need to run if not instantiated.\n\t}\n\tscript_concat_settings();\n\t$wp_scripts->do_concat = $concatenate_scripts;\n\t$wp_scripts->do_footer_items();\n\n\t/**\n\t * Filters whether to print the footer scripts.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param bool $print Whether to print the footer scripts. Default true.\n\t */\n\tif ( apply_filters( 'print_footer_scripts', true ) ) {\n\t\t_print_scripts();\n\t}\n\n\t$wp_scripts->reset();\n\treturn $wp_scripts->done;\n}\n\n/**\n * Print scripts (internal use only)\n *\n * @ignore\n *\n * @global WP_Scripts $wp_scripts\n * @global bool       $compress_scripts\n */\nfunction _print_scripts() {\n\tglobal $wp_scripts, $compress_scripts;\n\n\t$zip = $compress_scripts ? 1 : 0;\n\tif ( $zip && defined( 'ENFORCE_GZIP' ) && ENFORCE_GZIP ) {\n\t\t$zip = 'gzip';\n\t}\n\n\t$concat    = trim( $wp_scripts->concat, ', ' );\n\t$type_attr = current_theme_supports( 'html5', 'script' ) ? '' : \" type='text/javascript'\";\n\n\tif ( $concat ) {\n\t\tif ( ! empty( $wp_scripts->print_code ) ) {\n\t\t\techo \"\\n<script{$type_attr}>\\n\";\n\t\t\techo \"/* <![CDATA[ */\\n\"; // Not needed in HTML 5.\n\t\t\techo $wp_scripts->print_code;\n\t\t\techo \"/* ]]> */\\n\";\n\t\t\techo \"</script>\\n\";\n\t\t}\n\n\t\t$concat       = str_split( $concat, 128 );\n\t\t$concatenated = '';\n\n\t\tforeach ( $concat as $key => $chunk ) {\n\t\t\t$concatenated .= \"&load%5Bchunk_{$key}%5D={$chunk}\";\n\t\t}\n\n\t\t$src = $wp_scripts->base_url . \"/wp-admin/load-scripts.php?c={$zip}\" . $concatenated . '&ver=' . $wp_scripts->default_version;\n\t\techo \"<script{$type_attr} src='\" . esc_attr( $src ) . \"'></script>\\n\";\n\t}\n\n\tif ( ! empty( $wp_scripts->print_html ) ) {\n\t\techo $wp_scripts->print_html;\n\t}\n}\n\n/**\n * Prints the script queue in the HTML head on the front end.\n *\n * Postpones the scripts that were queued for the footer.\n * wp_print_footer_scripts() is called in the footer to print these scripts.\n *\n * @since 2.8.0\n *\n * @global WP_Scripts $wp_scripts\n *\n * @return array\n */\nfunction wp_print_head_scripts() {\n\tif ( ! did_action( 'wp_print_scripts' ) ) {\n\t\t/** This action is documented in wp-includes/functions.wp-scripts.php */\n\t\tdo_action( 'wp_print_scripts' );\n\t}\n\n\tglobal $wp_scripts;\n\n\tif ( ! ( $wp_scripts instanceof WP_Scripts ) ) {\n\t\treturn array(); // No need to run if nothing is queued.\n\t}\n\treturn print_head_scripts();\n}\n\n/**\n * Private, for use in *_footer_scripts hooks\n *\n * @since 3.3.0\n */\nfunction _wp_footer_scripts() {\n\tprint_late_styles();\n\tprint_footer_scripts();\n}\n\n/**\n * Hooks to print the scripts and styles in the footer.\n *\n * @since 2.8.0\n */\nfunction wp_print_footer_scripts() {\n\t/**\n\t * Fires when footer scripts are printed.\n\t *\n\t * @since 2.8.0\n\t */\n\tdo_action( 'wp_print_footer_scripts' );\n}\n\n/**\n * Wrapper for do_action( 'wp_enqueue_scripts' ).\n *\n * Allows plugins to queue scripts for the front end using wp_enqueue_script().\n * Runs first in wp_head() where all is_home(), is_page(), etc. functions are available.\n *\n * @since 2.8.0\n */\nfunction wp_enqueue_scripts() {\n\t/**\n\t * Fires when scripts and styles are enqueued.\n\t *\n\t * @since 2.8.0\n\t */\n\tdo_action( 'wp_enqueue_scripts' );\n}\n\n/**\n * Prints the styles queue in the HTML head on admin pages.\n *\n * @since 2.8.0\n *\n * @global bool $concatenate_scripts\n *\n * @return array\n */\nfunction print_admin_styles() {\n\tglobal $concatenate_scripts;\n\n\t$wp_styles = wp_styles();\n\n\tscript_concat_settings();\n\t$wp_styles->do_concat = $concatenate_scripts;\n\t$wp_styles->do_items( false );\n\n\t/**\n\t * Filters whether to print the admin styles.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param bool $print Whether to print the admin styles. Default true.\n\t */\n\tif ( apply_filters( 'print_admin_styles', true ) ) {\n\t\t_print_styles();\n\t}\n\n\t$wp_styles->reset();\n\treturn $wp_styles->done;\n}\n\n/**\n * Prints the styles that were queued too late for the HTML head.\n *\n * @since 3.3.0\n *\n * @global WP_Styles $wp_styles\n * @global bool      $concatenate_scripts\n *\n * @return array|void\n */\nfunction print_late_styles() {\n\tglobal $wp_styles, $concatenate_scripts;\n\n\tif ( ! ( $wp_styles instanceof WP_Styles ) ) {\n\t\treturn;\n\t}\n\n\tscript_concat_settings();\n\t$wp_styles->do_concat = $concatenate_scripts;\n\t$wp_styles->do_footer_items();\n\n\t/**\n\t * Filters whether to print the styles queued too late for the HTML head.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param bool $print Whether to print the 'late' styles. Default true.\n\t */\n\tif ( apply_filters( 'print_late_styles', true ) ) {\n\t\t_print_styles();\n\t}\n\n\t$wp_styles->reset();\n\treturn $wp_styles->done;\n}\n\n/**\n * Print styles (internal use only)\n *\n * @ignore\n * @since 3.3.0\n *\n * @global bool $compress_css\n */\nfunction _print_styles() {\n\tglobal $compress_css;\n\n\t$wp_styles = wp_styles();\n\n\t$zip = $compress_css ? 1 : 0;\n\tif ( $zip && defined( 'ENFORCE_GZIP' ) && ENFORCE_GZIP ) {\n\t\t$zip = 'gzip';\n\t}\n\n\t$concat    = trim( $wp_styles->concat, ', ' );\n\t$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type=\"text/css\"';\n\n\tif ( $concat ) {\n\t\t$dir = $wp_styles->text_direction;\n\t\t$ver = $wp_styles->default_version;\n\n\t\t$concat       = str_split( $concat, 128 );\n\t\t$concatenated = '';\n\n\t\tforeach ( $concat as $key => $chunk ) {\n\t\t\t$concatenated .= \"&load%5Bchunk_{$key}%5D={$chunk}\";\n\t\t}\n\n\t\t$href = $wp_styles->base_url . \"/wp-admin/load-styles.php?c={$zip}&dir={$dir}\" . $concatenated . '&ver=' . $ver;\n\t\techo \"<link rel='stylesheet' href='\" . esc_attr( $href ) . \"'{$type_attr} media='all' />\\n\";\n\n\t\tif ( ! empty( $wp_styles->print_code ) ) {\n\t\t\techo \"<style{$type_attr}>\\n\";\n\t\t\techo $wp_styles->print_code;\n\t\t\techo \"\\n</style>\\n\";\n\t\t}\n\t}\n\n\tif ( ! empty( $wp_styles->print_html ) ) {\n\t\techo $wp_styles->print_html;\n\t}\n}\n\n/**\n * Determine the concatenation and compression settings for scripts and styles.\n *\n * @since 2.8.0\n *\n * @global bool $concatenate_scripts\n * @global bool $compress_scripts\n * @global bool $compress_css\n */\nfunction script_concat_settings() {\n\tglobal $concatenate_scripts, $compress_scripts, $compress_css;\n\n\t$compressed_output = ( ini_get( 'zlib.output_compression' ) || 'ob_gzhandler' === ini_get( 'output_handler' ) );\n\n\tif ( ! isset( $concatenate_scripts ) ) {\n\t\t$concatenate_scripts = defined( 'CONCATENATE_SCRIPTS' ) ? CONCATENATE_SCRIPTS : true;\n\t\tif ( ( ! is_admin() && ! did_action( 'login_init' ) ) || ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ) {\n\t\t\t$concatenate_scripts = false;\n\t\t}\n\t}\n\n\tif ( ! isset( $compress_scripts ) ) {\n\t\t$compress_scripts = defined( 'COMPRESS_SCRIPTS' ) ? COMPRESS_SCRIPTS : true;\n\t\tif ( $compress_scripts && ( ! get_site_option( 'can_compress_scripts' ) || $compressed_output ) ) {\n\t\t\t$compress_scripts = false;\n\t\t}\n\t}\n\n\tif ( ! isset( $compress_css ) ) {\n\t\t$compress_css = defined( 'COMPRESS_CSS' ) ? COMPRESS_CSS : true;\n\t\tif ( $compress_css && ( ! get_site_option( 'can_compress_scripts' ) || $compressed_output ) ) {\n\t\t\t$compress_css = false;\n\t\t}\n\t}\n}\n\n/**\n * Handles the enqueueing of block scripts and styles that are common to both\n * the editor and the front-end.\n *\n * @since 5.0.0\n *\n * @global WP_Screen $current_screen WordPress current screen object.\n */\nfunction wp_common_block_scripts_and_styles() {\n\tglobal $current_screen;\n\n\tif ( is_admin() && ( $current_screen instanceof WP_Screen ) && ! $current_screen->is_block_editor() ) {\n\t\treturn;\n\t}\n\n\twp_enqueue_style( 'wp-block-library' );\n\n\tif ( current_theme_supports( 'wp-block-styles' ) ) {\n\t\twp_enqueue_style( 'wp-block-library-theme' );\n\t}\n\n\t/**\n\t * Fires after enqueuing block assets for both editor and front-end.\n\t *\n\t * Call `add_action` on any hook before 'wp_enqueue_scripts'.\n\t *\n\t * In the function call you supply, simply use `wp_enqueue_script` and\n\t * `wp_enqueue_style` to add your functionality to the Gutenberg editor.\n\t *\n\t * @since 5.0.0\n\t */\n\tdo_action( 'enqueue_block_assets' );\n}\n\n/**\n * Enqueues registered block scripts and styles, depending on current rendered\n * context (only enqueuing editor scripts while in context of the editor).\n *\n * @since 5.0.0\n *\n * @global WP_Screen $current_screen WordPress current screen object.\n */\nfunction wp_enqueue_registered_block_scripts_and_styles() {\n\tglobal $current_screen;\n\n\t$is_editor = ( ( $current_screen instanceof WP_Screen ) && $current_screen->is_block_editor() );\n\n\t$block_registry = WP_Block_Type_Registry::get_instance();\n\tforeach ( $block_registry->get_all_registered() as $block_name => $block_type ) {\n\t\t// Front-end styles.\n\t\tif ( ! empty( $block_type->style ) ) {\n\t\t\twp_enqueue_style( $block_type->style );\n\t\t}\n\n\t\t// Front-end script.\n\t\tif ( ! empty( $block_type->script ) ) {\n\t\t\twp_enqueue_script( $block_type->script );\n\t\t}\n\n\t\t// Editor styles.\n\t\tif ( $is_editor && ! empty( $block_type->editor_style ) ) {\n\t\t\twp_enqueue_style( $block_type->editor_style );\n\t\t}\n\n\t\t// Editor script.\n\t\tif ( $is_editor && ! empty( $block_type->editor_script ) ) {\n\t\t\twp_enqueue_script( $block_type->editor_script );\n\t\t}\n\t}\n}\n\n/**\n * Function responsible for enqueuing the styles required for block styles functionality on the editor and on the frontend.\n *\n * @since 5.3.0\n */\nfunction enqueue_block_styles_assets() {\n\t$block_styles = WP_Block_Styles_Registry::get_instance()->get_all_registered();\n\n\tforeach ( $block_styles as $styles ) {\n\t\tforeach ( $styles as $style_properties ) {\n\t\t\tif ( isset( $style_properties['style_handle'] ) ) {\n\t\t\t\twp_enqueue_style( $style_properties['style_handle'] );\n\t\t\t}\n\t\t\tif ( isset( $style_properties['inline_style'] ) ) {\n\t\t\t\twp_add_inline_style( 'wp-block-library', $style_properties['inline_style'] );\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Function responsible for enqueuing the assets required for block styles functionality on the editor.\n *\n * @since 5.3.0\n */\nfunction enqueue_editor_block_styles_assets() {\n\t$block_styles = WP_Block_Styles_Registry::get_instance()->get_all_registered();\n\n\t$register_script_lines = array( '( function() {' );\n\tforeach ( $block_styles as $block_name => $styles ) {\n\t\tforeach ( $styles as $style_properties ) {\n\t\t\t$register_script_lines[] = sprintf(\n\t\t\t\t'\twp.blocks.registerBlockStyle( \\'%s\\', %s );',\n\t\t\t\t$block_name,\n\t\t\t\twp_json_encode(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name'  => $style_properties['name'],\n\t\t\t\t\t\t'label' => $style_properties['label'],\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\t$register_script_lines[] = '} )();';\n\t$inline_script           = implode( \"\\n\", $register_script_lines );\n\n\twp_register_script( 'wp-block-styles', false, array( 'wp-blocks' ), true, true );\n\twp_add_inline_script( 'wp-block-styles', $inline_script );\n\twp_enqueue_script( 'wp-block-styles' );\n}\n\n/**\n * Enqueues the assets required for the block directory within the block editor.\n *\n * @since 5.5.0\n */\nfunction wp_enqueue_editor_block_directory_assets() {\n\twp_enqueue_script( 'wp-block-directory' );\n\twp_enqueue_style( 'wp-block-directory' );\n}\n", "num_lines": 2287}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Session API\n *\n * @since 4.0.0\n * @deprecated 4.7.0\n */\n\n_deprecated_file( basename( __FILE__ ), '4.7.0' );\n\nrequire_once ABSPATH . WPINC . '/class-wp-session-tokens.php';\nrequire_once ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php';\n", "num_lines": 13}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress API for creating bbcode-like tags or what WordPress calls\n * \"shortcodes\". The tag and attribute parsing or regular expression code is\n * based on the Textpattern tag parser.\n *\n * A few examples are below:\n *\n * [shortcode /]\n * [shortcode foo=\"bar\" baz=\"bing\" /]\n * [shortcode foo=\"bar\"]content[/shortcode]\n *\n * Shortcode tags support attributes and enclosed content, but does not entirely\n * support inline shortcodes in other shortcodes. You will have to call the\n * shortcode parser in your function to account for that.\n *\n * {@internal\n * Please be aware that the above note was made during the beta of WordPress 2.6\n * and in the future may not be accurate. Please update the note when it is no\n * longer the case.}}\n *\n * To apply shortcode tags to content:\n *\n *     $out = do_shortcode( $content );\n *\n * @link https://developer.wordpress.org/plugins/shortcodes/\n *\n * @package WordPress\n * @subpackage Shortcodes\n * @since 2.5.0\n */\n\n/**\n * Container for storing shortcode tags and their hook to call for the shortcode\n *\n * @since 2.5.0\n *\n * @name $shortcode_tags\n * @var array\n * @global array $shortcode_tags\n */\n$shortcode_tags = array();\n\n/**\n * Adds a new shortcode.\n *\n * Care should be taken through prefixing or other means to ensure that the\n * shortcode tag being added is unique and will not conflict with other,\n * already-added shortcode tags. In the event of a duplicated tag, the tag\n * loaded last will take precedence.\n *\n * @since 2.5.0\n *\n * @global array $shortcode_tags\n *\n * @param string   $tag      Shortcode tag to be searched in post content.\n * @param callable $callback The callback function to run when the shortcode is found.\n *                           Every shortcode callback is passed three parameters by default,\n *                           including an array of attributes (`$atts`), the shortcode content\n *                           or null if not set (`$content`), and finally the shortcode tag\n *                           itself (`$shortcode_tag`), in that order.\n */\nfunction add_shortcode( $tag, $callback ) {\n\tglobal $shortcode_tags;\n\n\tif ( '' === trim( $tag ) ) {\n\t\t$message = __( 'Invalid shortcode name: Empty name given.' );\n\t\t_doing_it_wrong( __FUNCTION__, $message, '4.4.0' );\n\t\treturn;\n\t}\n\n\tif ( 0 !== preg_match( '@[<>&/\\[\\]\\x00-\\x20=]@', $tag ) ) {\n\t\t/* translators: 1: Shortcode name, 2: Space-separated list of reserved characters. */\n\t\t$message = sprintf( __( 'Invalid shortcode name: %1$s. Do not use spaces or reserved characters: %2$s' ), $tag, '& / < > [ ] =' );\n\t\t_doing_it_wrong( __FUNCTION__, $message, '4.4.0' );\n\t\treturn;\n\t}\n\n\t$shortcode_tags[ $tag ] = $callback;\n}\n\n/**\n * Removes hook for shortcode.\n *\n * @since 2.5.0\n *\n * @global array $shortcode_tags\n *\n * @param string $tag Shortcode tag to remove hook for.\n */\nfunction remove_shortcode( $tag ) {\n\tglobal $shortcode_tags;\n\n\tunset( $shortcode_tags[ $tag ] );\n}\n\n/**\n * Clear all shortcodes.\n *\n * This function is simple, it clears all of the shortcode tags by replacing the\n * shortcodes global by a empty array. This is actually a very efficient method\n * for removing all shortcodes.\n *\n * @since 2.5.0\n *\n * @global array $shortcode_tags\n */\nfunction remove_all_shortcodes() {\n\tglobal $shortcode_tags;\n\n\t$shortcode_tags = array();\n}\n\n/**\n * Whether a registered shortcode exists named $tag\n *\n * @since 3.6.0\n *\n * @global array $shortcode_tags List of shortcode tags and their callback hooks.\n *\n * @param string $tag Shortcode tag to check.\n * @return bool Whether the given shortcode exists.\n */\nfunction shortcode_exists( $tag ) {\n\tglobal $shortcode_tags;\n\treturn array_key_exists( $tag, $shortcode_tags );\n}\n\n/**\n * Whether the passed content contains the specified shortcode\n *\n * @since 3.6.0\n *\n * @global array $shortcode_tags\n *\n * @param string $content Content to search for shortcodes.\n * @param string $tag     Shortcode tag to check.\n * @return bool Whether the passed content contains the given shortcode.\n */\nfunction has_shortcode( $content, $tag ) {\n\tif ( false === strpos( $content, '[' ) ) {\n\t\treturn false;\n\t}\n\n\tif ( shortcode_exists( $tag ) ) {\n\t\tpreg_match_all( '/' . get_shortcode_regex() . '/', $content, $matches, PREG_SET_ORDER );\n\t\tif ( empty( $matches ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ( $matches as $shortcode ) {\n\t\t\tif ( $tag === $shortcode[2] ) {\n\t\t\t\treturn true;\n\t\t\t} elseif ( ! empty( $shortcode[5] ) && has_shortcode( $shortcode[5], $tag ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Search content for shortcodes and filter shortcodes through their hooks.\n *\n * This function is an alias for do_shortcode().\n *\n * @since 5.4.0\n *\n * @see do_shortcode()\n *\n * @param string $content     Content to search for shortcodes.\n * @param bool   $ignore_html When true, shortcodes inside HTML elements will be skipped.\n *                            Default false.\n * @return string Content with shortcodes filtered out.\n */\nfunction apply_shortcodes( $content, $ignore_html = false ) {\n\treturn do_shortcode( $content, $ignore_html );\n}\n\n/**\n * Search content for shortcodes and filter shortcodes through their hooks.\n *\n * If there are no shortcode tags defined, then the content will be returned\n * without any filtering. This might cause issues when plugins are disabled but\n * the shortcode will still show up in the post or content.\n *\n * @since 2.5.0\n *\n * @global array $shortcode_tags List of shortcode tags and their callback hooks.\n *\n * @param string $content     Content to search for shortcodes.\n * @param bool   $ignore_html When true, shortcodes inside HTML elements will be skipped.\n *                            Default false.\n * @return string Content with shortcodes filtered out.\n */\nfunction do_shortcode( $content, $ignore_html = false ) {\n\tglobal $shortcode_tags;\n\n\tif ( false === strpos( $content, '[' ) ) {\n\t\treturn $content;\n\t}\n\n\tif ( empty( $shortcode_tags ) || ! is_array( $shortcode_tags ) ) {\n\t\treturn $content;\n\t}\n\n\t// Find all registered tag names in $content.\n\tpreg_match_all( '@\\[([^<>&/\\[\\]\\x00-\\x20=]++)@', $content, $matches );\n\t$tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] );\n\n\tif ( empty( $tagnames ) ) {\n\t\treturn $content;\n\t}\n\n\t$content = do_shortcodes_in_html_tags( $content, $ignore_html, $tagnames );\n\n\t$pattern = get_shortcode_regex( $tagnames );\n\t$content = preg_replace_callback( \"/$pattern/\", 'do_shortcode_tag', $content );\n\n\t// Always restore square braces so we don't break things like <!--[if IE ]>.\n\t$content = unescape_invalid_shortcodes( $content );\n\n\treturn $content;\n}\n\n/**\n * Retrieve the shortcode regular expression for searching.\n *\n * The regular expression combines the shortcode tags in the regular expression\n * in a regex class.\n *\n * The regular expression contains 6 different sub matches to help with parsing.\n *\n * 1 - An extra [ to allow for escaping shortcodes with double [[]]\n * 2 - The shortcode name\n * 3 - The shortcode argument list\n * 4 - The self closing /\n * 5 - The content of a shortcode when it wraps some content.\n * 6 - An extra ] to allow for escaping shortcodes with double [[]]\n *\n * @since 2.5.0\n * @since 4.4.0 Added the `$tagnames` parameter.\n *\n * @global array $shortcode_tags\n *\n * @param array $tagnames Optional. List of shortcodes to find. Defaults to all registered shortcodes.\n * @return string The shortcode search regular expression\n */\nfunction get_shortcode_regex( $tagnames = null ) {\n\tglobal $shortcode_tags;\n\n\tif ( empty( $tagnames ) ) {\n\t\t$tagnames = array_keys( $shortcode_tags );\n\t}\n\t$tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) );\n\n\t// WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcode_tag().\n\t// Also, see shortcode_unautop() and shortcode.js.\n\n\t// phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation\n\treturn '\\\\['                             // Opening bracket.\n\t\t. '(\\\\[?)'                           // 1: Optional second opening bracket for escaping shortcodes: [[tag]].\n\t\t. \"($tagregexp)\"                     // 2: Shortcode name.\n\t\t. '(?![\\\\w-])'                       // Not followed by word character or hyphen.\n\t\t. '('                                // 3: Unroll the loop: Inside the opening shortcode tag.\n\t\t.     '[^\\\\]\\\\/]*'                   // Not a closing bracket or forward slash.\n\t\t.     '(?:'\n\t\t.         '\\\\/(?!\\\\])'               // A forward slash not followed by a closing bracket.\n\t\t.         '[^\\\\]\\\\/]*'               // Not a closing bracket or forward slash.\n\t\t.     ')*?'\n\t\t. ')'\n\t\t. '(?:'\n\t\t.     '(\\\\/)'                        // 4: Self closing tag...\n\t\t.     '\\\\]'                          // ...and closing bracket.\n\t\t. '|'\n\t\t.     '\\\\]'                          // Closing bracket.\n\t\t.     '(?:'\n\t\t.         '('                        // 5: Unroll the loop: Optionally, anything between the opening and closing shortcode tags.\n\t\t.             '[^\\\\[]*+'             // Not an opening bracket.\n\t\t.             '(?:'\n\t\t.                 '\\\\[(?!\\\\/\\\\2\\\\])' // An opening bracket not followed by the closing shortcode tag.\n\t\t.                 '[^\\\\[]*+'         // Not an opening bracket.\n\t\t.             ')*+'\n\t\t.         ')'\n\t\t.         '\\\\[\\\\/\\\\2\\\\]'             // Closing shortcode tag.\n\t\t.     ')?'\n\t\t. ')'\n\t\t. '(\\\\]?)';                          // 6: Optional second closing brocket for escaping shortcodes: [[tag]].\n\t// phpcs:enable\n}\n\n/**\n * Regular Expression callable for do_shortcode() for calling shortcode hook.\n *\n * @see get_shortcode_regex for details of the match array contents.\n *\n * @since 2.5.0\n * @access private\n *\n * @global array $shortcode_tags\n *\n * @param array $m Regular expression match array\n * @return string|false False on failure.\n */\nfunction do_shortcode_tag( $m ) {\n\tglobal $shortcode_tags;\n\n\t// Allow [[foo]] syntax for escaping a tag.\n\tif ( '[' === $m[1] && ']' === $m[6] ) {\n\t\treturn substr( $m[0], 1, -1 );\n\t}\n\n\t$tag  = $m[2];\n\t$attr = shortcode_parse_atts( $m[3] );\n\n\tif ( ! is_callable( $shortcode_tags[ $tag ] ) ) {\n\t\t/* translators: %s: Shortcode tag. */\n\t\t$message = sprintf( __( 'Attempting to parse a shortcode without a valid callback: %s' ), $tag );\n\t\t_doing_it_wrong( __FUNCTION__, $message, '4.3.0' );\n\t\treturn $m[0];\n\t}\n\n\t/**\n\t * Filters whether to call a shortcode callback.\n\t *\n\t * Returning a non-false value from filter will short-circuit the\n\t * shortcode generation process, returning that value instead.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param false|string $return      Short-circuit return value. Either false or the value to replace the shortcode with.\n\t * @param string       $tag         Shortcode name.\n\t * @param array|string $attr        Shortcode attributes array or empty string.\n\t * @param array        $m           Regular expression match array.\n\t */\n\t$return = apply_filters( 'pre_do_shortcode_tag', false, $tag, $attr, $m );\n\tif ( false !== $return ) {\n\t\treturn $return;\n\t}\n\n\t$content = isset( $m[5] ) ? $m[5] : null;\n\n\t$output = $m[1] . call_user_func( $shortcode_tags[ $tag ], $attr, $content, $tag ) . $m[6];\n\n\t/**\n\t * Filters the output created by a shortcode callback.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string       $output Shortcode output.\n\t * @param string       $tag    Shortcode name.\n\t * @param array|string $attr   Shortcode attributes array or empty string.\n\t * @param array        $m      Regular expression match array.\n\t */\n\treturn apply_filters( 'do_shortcode_tag', $output, $tag, $attr, $m );\n}\n\n/**\n * Search only inside HTML elements for shortcodes and process them.\n *\n * Any [ or ] characters remaining inside elements will be HTML encoded\n * to prevent interference with shortcodes that are outside the elements.\n * Assumes $content processed by KSES already.  Users with unfiltered_html\n * capability may get unexpected output if angle braces are nested in tags.\n *\n * @since 4.2.3\n *\n * @param string $content     Content to search for shortcodes.\n * @param bool   $ignore_html When true, all square braces inside elements will be encoded.\n * @param array  $tagnames    List of shortcodes to find.\n * @return string Content with shortcodes filtered out.\n */\nfunction do_shortcodes_in_html_tags( $content, $ignore_html, $tagnames ) {\n\t// Normalize entities in unfiltered HTML before adding placeholders.\n\t$trans   = array(\n\t\t'&#91;' => '&#091;',\n\t\t'&#93;' => '&#093;',\n\t);\n\t$content = strtr( $content, $trans );\n\t$trans   = array(\n\t\t'[' => '&#91;',\n\t\t']' => '&#93;',\n\t);\n\n\t$pattern = get_shortcode_regex( $tagnames );\n\t$textarr = wp_html_split( $content );\n\n\tforeach ( $textarr as &$element ) {\n\t\tif ( '' === $element || '<' !== $element[0] ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$noopen  = false === strpos( $element, '[' );\n\t\t$noclose = false === strpos( $element, ']' );\n\t\tif ( $noopen || $noclose ) {\n\t\t\t// This element does not contain shortcodes.\n\t\t\tif ( $noopen xor $noclose ) {\n\t\t\t\t// Need to encode stray '[' or ']' chars.\n\t\t\t\t$element = strtr( $element, $trans );\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( $ignore_html || '<!--' === substr( $element, 0, 4 ) || '<![CDATA[' === substr( $element, 0, 9 ) ) {\n\t\t\t// Encode all '[' and ']' chars.\n\t\t\t$element = strtr( $element, $trans );\n\t\t\tcontinue;\n\t\t}\n\n\t\t$attributes = wp_kses_attr_parse( $element );\n\t\tif ( false === $attributes ) {\n\t\t\t// Some plugins are doing things like [name] <[email]>.\n\t\t\tif ( 1 === preg_match( '%^<\\s*\\[\\[?[^\\[\\]]+\\]%', $element ) ) {\n\t\t\t\t$element = preg_replace_callback( \"/$pattern/\", 'do_shortcode_tag', $element );\n\t\t\t}\n\n\t\t\t// Looks like we found some crazy unfiltered HTML. Skipping it for sanity.\n\t\t\t$element = strtr( $element, $trans );\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Get element name.\n\t\t$front   = array_shift( $attributes );\n\t\t$back    = array_pop( $attributes );\n\t\t$matches = array();\n\t\tpreg_match( '%[a-zA-Z0-9]+%', $front, $matches );\n\t\t$elname = $matches[0];\n\n\t\t// Look for shortcodes in each attribute separately.\n\t\tforeach ( $attributes as &$attr ) {\n\t\t\t$open  = strpos( $attr, '[' );\n\t\t\t$close = strpos( $attr, ']' );\n\t\t\tif ( false === $open || false === $close ) {\n\t\t\t\tcontinue; // Go to next attribute. Square braces will be escaped at end of loop.\n\t\t\t}\n\t\t\t$double = strpos( $attr, '\"' );\n\t\t\t$single = strpos( $attr, \"'\" );\n\t\t\tif ( ( false === $single || $open < $single ) && ( false === $double || $open < $double ) ) {\n\t\t\t\t/*\n\t\t\t\t * $attr like '[shortcode]' or 'name = [shortcode]' implies unfiltered_html.\n\t\t\t\t * In this specific situation we assume KSES did not run because the input\n\t\t\t\t * was written by an administrator, so we should avoid changing the output\n\t\t\t\t * and we do not need to run KSES here.\n\t\t\t\t */\n\t\t\t\t$attr = preg_replace_callback( \"/$pattern/\", 'do_shortcode_tag', $attr );\n\t\t\t} else {\n\t\t\t\t// $attr like 'name = \"[shortcode]\"' or \"name = '[shortcode]'\".\n\t\t\t\t// We do not know if $content was unfiltered. Assume KSES ran before shortcodes.\n\t\t\t\t$count    = 0;\n\t\t\t\t$new_attr = preg_replace_callback( \"/$pattern/\", 'do_shortcode_tag', $attr, -1, $count );\n\t\t\t\tif ( $count > 0 ) {\n\t\t\t\t\t// Sanitize the shortcode output using KSES.\n\t\t\t\t\t$new_attr = wp_kses_one_attr( $new_attr, $elname );\n\t\t\t\t\tif ( '' !== trim( $new_attr ) ) {\n\t\t\t\t\t\t// The shortcode is safe to use now.\n\t\t\t\t\t\t$attr = $new_attr;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$element = $front . implode( '', $attributes ) . $back;\n\n\t\t// Now encode any remaining '[' or ']' chars.\n\t\t$element = strtr( $element, $trans );\n\t}\n\n\t$content = implode( '', $textarr );\n\n\treturn $content;\n}\n\n/**\n * Remove placeholders added by do_shortcodes_in_html_tags().\n *\n * @since 4.2.3\n *\n * @param string $content Content to search for placeholders.\n * @return string Content with placeholders removed.\n */\nfunction unescape_invalid_shortcodes( $content ) {\n\t// Clean up entire string, avoids re-parsing HTML.\n\t$trans = array(\n\t\t'&#91;' => '[',\n\t\t'&#93;' => ']',\n\t);\n\n\t$content = strtr( $content, $trans );\n\n\treturn $content;\n}\n\n/**\n * Retrieve the shortcode attributes regex.\n *\n * @since 4.4.0\n *\n * @return string The shortcode attribute regular expression\n */\nfunction get_shortcode_atts_regex() {\n\treturn '/([\\w-]+)\\s*=\\s*\"([^\"]*)\"(?:\\s|$)|([\\w-]+)\\s*=\\s*\\'([^\\']*)\\'(?:\\s|$)|([\\w-]+)\\s*=\\s*([^\\s\\'\"]+)(?:\\s|$)|\"([^\"]*)\"(?:\\s|$)|\\'([^\\']*)\\'(?:\\s|$)|(\\S+)(?:\\s|$)/';\n}\n\n/**\n * Retrieve all attributes from the shortcodes tag.\n *\n * The attributes list has the attribute name as the key and the value of the\n * attribute as the value in the key/value pair. This allows for easier\n * retrieval of the attributes, since all attributes have to be known.\n *\n * @since 2.5.0\n *\n * @param string $text\n * @return array|string List of attribute values.\n *                      Returns empty array if '\"\"' === trim( $text ).\n *                      Returns empty string if '' === trim( $text ).\n *                      All other matches are checked for not empty().\n */\nfunction shortcode_parse_atts( $text ) {\n\t$atts    = array();\n\t$pattern = get_shortcode_atts_regex();\n\t$text    = preg_replace( \"/[\\x{00a0}\\x{200b}]+/u\", ' ', $text );\n\tif ( preg_match_all( $pattern, $text, $match, PREG_SET_ORDER ) ) {\n\t\tforeach ( $match as $m ) {\n\t\t\tif ( ! empty( $m[1] ) ) {\n\t\t\t\t$atts[ strtolower( $m[1] ) ] = stripcslashes( $m[2] );\n\t\t\t} elseif ( ! empty( $m[3] ) ) {\n\t\t\t\t$atts[ strtolower( $m[3] ) ] = stripcslashes( $m[4] );\n\t\t\t} elseif ( ! empty( $m[5] ) ) {\n\t\t\t\t$atts[ strtolower( $m[5] ) ] = stripcslashes( $m[6] );\n\t\t\t} elseif ( isset( $m[7] ) && strlen( $m[7] ) ) {\n\t\t\t\t$atts[] = stripcslashes( $m[7] );\n\t\t\t} elseif ( isset( $m[8] ) && strlen( $m[8] ) ) {\n\t\t\t\t$atts[] = stripcslashes( $m[8] );\n\t\t\t} elseif ( isset( $m[9] ) ) {\n\t\t\t\t$atts[] = stripcslashes( $m[9] );\n\t\t\t}\n\t\t}\n\n\t\t// Reject any unclosed HTML elements.\n\t\tforeach ( $atts as &$value ) {\n\t\t\tif ( false !== strpos( $value, '<' ) ) {\n\t\t\t\tif ( 1 !== preg_match( '/^[^<]*+(?:<[^>]*+>[^<]*+)*+$/', $value ) ) {\n\t\t\t\t\t$value = '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$atts = ltrim( $text );\n\t}\n\n\treturn $atts;\n}\n\n/**\n * Combine user attributes with known attributes and fill in defaults when needed.\n *\n * The pairs should be considered to be all of the attributes which are\n * supported by the caller and given as a list. The returned attributes will\n * only contain the attributes in the $pairs list.\n *\n * If the $atts list has unsupported attributes, then they will be ignored and\n * removed from the final returned list.\n *\n * @since 2.5.0\n *\n * @param array  $pairs     Entire list of supported attributes and their defaults.\n * @param array  $atts      User defined attributes in shortcode tag.\n * @param string $shortcode Optional. The name of the shortcode, provided for context to enable filtering\n * @return array Combined and filtered attribute list.\n */\nfunction shortcode_atts( $pairs, $atts, $shortcode = '' ) {\n\t$atts = (array) $atts;\n\t$out  = array();\n\tforeach ( $pairs as $name => $default ) {\n\t\tif ( array_key_exists( $name, $atts ) ) {\n\t\t\t$out[ $name ] = $atts[ $name ];\n\t\t} else {\n\t\t\t$out[ $name ] = $default;\n\t\t}\n\t}\n\n\tif ( $shortcode ) {\n\t\t/**\n\t\t * Filters shortcode attributes.\n\t\t *\n\t\t * If the third parameter of the shortcode_atts() function is present then this filter is available.\n\t\t * The third parameter, $shortcode, is the name of the shortcode.\n\t\t *\n\t\t * @since 3.6.0\n\t\t * @since 4.4.0 Added the `$shortcode` parameter.\n\t\t *\n\t\t * @param array  $out       The output array of shortcode attributes.\n\t\t * @param array  $pairs     The supported attributes and their defaults.\n\t\t * @param array  $atts      The user defined shortcode attributes.\n\t\t * @param string $shortcode The shortcode name.\n\t\t */\n\t\t$out = apply_filters( \"shortcode_atts_{$shortcode}\", $out, $pairs, $atts, $shortcode );\n\t}\n\n\treturn $out;\n}\n\n/**\n * Remove all shortcode tags from the given content.\n *\n * @since 2.5.0\n *\n * @global array $shortcode_tags\n *\n * @param string $content Content to remove shortcode tags.\n * @return string Content without shortcode tags.\n */\nfunction strip_shortcodes( $content ) {\n\tglobal $shortcode_tags;\n\n\tif ( false === strpos( $content, '[' ) ) {\n\t\treturn $content;\n\t}\n\n\tif ( empty( $shortcode_tags ) || ! is_array( $shortcode_tags ) ) {\n\t\treturn $content;\n\t}\n\n\t// Find all registered tag names in $content.\n\tpreg_match_all( '@\\[([^<>&/\\[\\]\\x00-\\x20=]++)@', $content, $matches );\n\n\t$tags_to_remove = array_keys( $shortcode_tags );\n\n\t/**\n\t * Filters the list of shortcode tags to remove from the content.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array  $tags_to_remove Array of shortcode tags to remove.\n\t * @param string $content        Content shortcodes are being removed from.\n\t */\n\t$tags_to_remove = apply_filters( 'strip_shortcodes_tagnames', $tags_to_remove, $content );\n\n\t$tagnames = array_intersect( $tags_to_remove, $matches[1] );\n\n\tif ( empty( $tagnames ) ) {\n\t\treturn $content;\n\t}\n\n\t$content = do_shortcodes_in_html_tags( $content, true, $tagnames );\n\n\t$pattern = get_shortcode_regex( $tagnames );\n\t$content = preg_replace_callback( \"/$pattern/\", 'strip_shortcode_tag', $content );\n\n\t// Always restore square braces so we don't break things like <!--[if IE ]>.\n\t$content = unescape_invalid_shortcodes( $content );\n\n\treturn $content;\n}\n\n/**\n * Strips a shortcode tag based on RegEx matches against post content.\n *\n * @since 3.3.0\n *\n * @param array $m RegEx matches against post content.\n * @return string|false The content stripped of the tag, otherwise false.\n */\nfunction strip_shortcode_tag( $m ) {\n\t// Allow [[foo]] syntax for escaping a tag.\n\tif ( '[' === $m[1] && ']' === $m[6] ) {\n\t\treturn substr( $m[0], 1, -1 );\n\t}\n\n\treturn $m[1] . $m[6];\n}\n", "num_lines": 672}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Sitemaps: Public functions\n *\n * This file contains a variety of public functions developers can use to interact with\n * the XML Sitemaps API.\n *\n * @package WordPress\n * @subpackage Sitemaps\n * @since 5.5.0\n */\n\n/**\n * Retrieves the current Sitemaps server instance.\n *\n * @since 5.5.0\n *\n * @global WP_Sitemaps $wp_sitemaps Global Core Sitemaps instance.\n *\n * @return WP_Sitemaps Sitemaps instance.\n */\nfunction wp_sitemaps_get_server() {\n\tglobal $wp_sitemaps;\n\n\t// If there isn't a global instance, set and bootstrap the sitemaps system.\n\tif ( empty( $wp_sitemaps ) ) {\n\t\t$wp_sitemaps = new WP_Sitemaps();\n\t\t$wp_sitemaps->init();\n\n\t\t/**\n\t\t * Fires when initializing the Sitemaps object.\n\t\t *\n\t\t * Additional sitemaps should be registered on this hook.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param WP_Sitemaps $wp_sitemaps Sitemaps object.\n\t\t */\n\t\tdo_action( 'wp_sitemaps_init', $wp_sitemaps );\n\t}\n\n\treturn $wp_sitemaps;\n}\n\n/**\n * Gets an array of sitemap providers.\n *\n * @since 5.5.0\n *\n * @return WP_Sitemaps_Provider[] Array of sitemap providers.\n */\nfunction wp_get_sitemap_providers() {\n\t$sitemaps = wp_sitemaps_get_server();\n\treturn $sitemaps->registry->get_providers();\n}\n\n/**\n * Registers a new sitemap provider.\n *\n * @since 5.5.0\n *\n * @param string               $name     Unique name for the sitemap provider.\n * @param WP_Sitemaps_Provider $provider The `Sitemaps_Provider` instance implementing the sitemap.\n * @return bool Whether the sitemap was added.\n */\nfunction wp_register_sitemap_provider( $name, WP_Sitemaps_Provider $provider ) {\n\t$sitemaps = wp_sitemaps_get_server();\n\treturn $sitemaps->registry->add_provider( $name, $provider );\n}\n\n/**\n * Gets the maximum number of URLs for a sitemap.\n *\n * @since 5.5.0\n *\n * @param string $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user').\n * @return int The maximum number of URLs.\n */\nfunction wp_sitemaps_get_max_urls( $object_type ) {\n\t/**\n\t * Filters the maximum number of URLs displayed on a sitemap.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param int    $max_urls    The maximum number of URLs included in a sitemap. Default 2000.\n\t * @param string $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user').\n\t */\n\treturn apply_filters( 'wp_sitemaps_max_urls', 2000, $object_type );\n}\n\n/**\n * Retrieves the full URL for a sitemap.\n *\n * @since 5.5.1\n *\n * @param string $name         The sitemap name.\n * @param string $subtype_name The sitemap subtype name.  Default empty string.\n * @param int    $page         The page of the sitemap.  Default 1.\n * @return string|false The sitemap URL or false if the sitemap doesn't exist.\n */\nfunction get_sitemap_url( $name, $subtype_name = '', $page = 1 ) {\n\t$sitemaps = wp_sitemaps_get_server();\n\tif ( ! $sitemaps ) {\n\t\treturn false;\n\t}\n\n\tif ( 'index' === $name ) {\n\t\treturn $sitemaps->index->get_index_url();\n\t}\n\n\t$provider = $sitemaps->registry->get_provider( $name );\n\tif ( ! $provider ) {\n\t\treturn false;\n\t}\n\n\tif ( $subtype_name && ! in_array( $subtype_name, array_keys( $provider->get_object_subtypes() ), true ) ) {\n\t\treturn false;\n\t}\n\n\t$page = absint( $page );\n\tif ( 0 >= $page ) {\n\t\t$page = 1;\n\t}\n\treturn $provider->get_sitemap_url( $subtype_name, $page );\n}\n", "num_lines": 126}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Polyfill for SPL autoload feature. This file is separate to prevent compiler notices\n * on the deprecated __autoload() function.\n *\n * See https://core.trac.wordpress.org/ticket/41134\n *\n * @deprecated 5.3.0 No longer needed as the minimum PHP requirement has moved beyond PHP 5.3.\n *\n * @package PHP\n * @access private\n */\n\n_deprecated_file( basename( __FILE__ ), '5.3.0', null, 'SPL can no longer be disabled as of PHP 5.3.' );\n", "num_lines": 15}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Core Taxonomy API\n *\n * @package WordPress\n * @subpackage Taxonomy\n */\n\n//\n// Taxonomy registration.\n//\n\n/**\n * Creates the initial taxonomies.\n *\n * This function fires twice: in wp-settings.php before plugins are loaded (for\n * backward compatibility reasons), and again on the {@see 'init'} action. We must\n * avoid registering rewrite rules before the {@see 'init'} action.\n *\n * @since 2.8.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n */\nfunction create_initial_taxonomies() {\n\tglobal $wp_rewrite;\n\n\tif ( ! did_action( 'init' ) ) {\n\t\t$rewrite = array(\n\t\t\t'category'    => false,\n\t\t\t'post_tag'    => false,\n\t\t\t'post_format' => false,\n\t\t);\n\t} else {\n\n\t\t/**\n\t\t * Filters the post formats rewrite base.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param string $context Context of the rewrite base. Default 'type'.\n\t\t */\n\t\t$post_format_base = apply_filters( 'post_format_rewrite_base', 'type' );\n\t\t$rewrite          = array(\n\t\t\t'category'    => array(\n\t\t\t\t'hierarchical' => true,\n\t\t\t\t'slug'         => get_option( 'category_base' ) ? get_option( 'category_base' ) : 'category',\n\t\t\t\t'with_front'   => ! get_option( 'category_base' ) || $wp_rewrite->using_index_permalinks(),\n\t\t\t\t'ep_mask'      => EP_CATEGORIES,\n\t\t\t),\n\t\t\t'post_tag'    => array(\n\t\t\t\t'hierarchical' => false,\n\t\t\t\t'slug'         => get_option( 'tag_base' ) ? get_option( 'tag_base' ) : 'tag',\n\t\t\t\t'with_front'   => ! get_option( 'tag_base' ) || $wp_rewrite->using_index_permalinks(),\n\t\t\t\t'ep_mask'      => EP_TAGS,\n\t\t\t),\n\t\t\t'post_format' => $post_format_base ? array( 'slug' => $post_format_base ) : false,\n\t\t);\n\t}\n\n\tregister_taxonomy(\n\t\t'category',\n\t\t'post',\n\t\tarray(\n\t\t\t'hierarchical'          => true,\n\t\t\t'query_var'             => 'category_name',\n\t\t\t'rewrite'               => $rewrite['category'],\n\t\t\t'public'                => true,\n\t\t\t'show_ui'               => true,\n\t\t\t'show_admin_column'     => true,\n\t\t\t'_builtin'              => true,\n\t\t\t'capabilities'          => array(\n\t\t\t\t'manage_terms' => 'manage_categories',\n\t\t\t\t'edit_terms'   => 'edit_categories',\n\t\t\t\t'delete_terms' => 'delete_categories',\n\t\t\t\t'assign_terms' => 'assign_categories',\n\t\t\t),\n\t\t\t'show_in_rest'          => true,\n\t\t\t'rest_base'             => 'categories',\n\t\t\t'rest_controller_class' => 'WP_REST_Terms_Controller',\n\t\t)\n\t);\n\n\tregister_taxonomy(\n\t\t'post_tag',\n\t\t'post',\n\t\tarray(\n\t\t\t'hierarchical'          => false,\n\t\t\t'query_var'             => 'tag',\n\t\t\t'rewrite'               => $rewrite['post_tag'],\n\t\t\t'public'                => true,\n\t\t\t'show_ui'               => true,\n\t\t\t'show_admin_column'     => true,\n\t\t\t'_builtin'              => true,\n\t\t\t'capabilities'          => array(\n\t\t\t\t'manage_terms' => 'manage_post_tags',\n\t\t\t\t'edit_terms'   => 'edit_post_tags',\n\t\t\t\t'delete_terms' => 'delete_post_tags',\n\t\t\t\t'assign_terms' => 'assign_post_tags',\n\t\t\t),\n\t\t\t'show_in_rest'          => true,\n\t\t\t'rest_base'             => 'tags',\n\t\t\t'rest_controller_class' => 'WP_REST_Terms_Controller',\n\t\t)\n\t);\n\n\tregister_taxonomy(\n\t\t'nav_menu',\n\t\t'nav_menu_item',\n\t\tarray(\n\t\t\t'public'            => false,\n\t\t\t'hierarchical'      => false,\n\t\t\t'labels'            => array(\n\t\t\t\t'name'          => __( 'Navigation Menus' ),\n\t\t\t\t'singular_name' => __( 'Navigation Menu' ),\n\t\t\t),\n\t\t\t'query_var'         => false,\n\t\t\t'rewrite'           => false,\n\t\t\t'show_ui'           => false,\n\t\t\t'_builtin'          => true,\n\t\t\t'show_in_nav_menus' => false,\n\t\t)\n\t);\n\n\tregister_taxonomy(\n\t\t'link_category',\n\t\t'link',\n\t\tarray(\n\t\t\t'hierarchical' => false,\n\t\t\t'labels'       => array(\n\t\t\t\t'name'                       => __( 'Link Categories' ),\n\t\t\t\t'singular_name'              => __( 'Link Category' ),\n\t\t\t\t'search_items'               => __( 'Search Link Categories' ),\n\t\t\t\t'popular_items'              => null,\n\t\t\t\t'all_items'                  => __( 'All Link Categories' ),\n\t\t\t\t'edit_item'                  => __( 'Edit Link Category' ),\n\t\t\t\t'update_item'                => __( 'Update Link Category' ),\n\t\t\t\t'add_new_item'               => __( 'Add New Link Category' ),\n\t\t\t\t'new_item_name'              => __( 'New Link Category Name' ),\n\t\t\t\t'separate_items_with_commas' => null,\n\t\t\t\t'add_or_remove_items'        => null,\n\t\t\t\t'choose_from_most_used'      => null,\n\t\t\t\t'back_to_items'              => __( '&larr; Back to Link Categories' ),\n\t\t\t),\n\t\t\t'capabilities' => array(\n\t\t\t\t'manage_terms' => 'manage_links',\n\t\t\t\t'edit_terms'   => 'manage_links',\n\t\t\t\t'delete_terms' => 'manage_links',\n\t\t\t\t'assign_terms' => 'manage_links',\n\t\t\t),\n\t\t\t'query_var'    => false,\n\t\t\t'rewrite'      => false,\n\t\t\t'public'       => false,\n\t\t\t'show_ui'      => true,\n\t\t\t'_builtin'     => true,\n\t\t)\n\t);\n\n\tregister_taxonomy(\n\t\t'post_format',\n\t\t'post',\n\t\tarray(\n\t\t\t'public'            => true,\n\t\t\t'hierarchical'      => false,\n\t\t\t'labels'            => array(\n\t\t\t\t'name'          => _x( 'Formats', 'post format' ),\n\t\t\t\t'singular_name' => _x( 'Format', 'post format' ),\n\t\t\t),\n\t\t\t'query_var'         => true,\n\t\t\t'rewrite'           => $rewrite['post_format'],\n\t\t\t'show_ui'           => false,\n\t\t\t'_builtin'          => true,\n\t\t\t'show_in_nav_menus' => current_theme_supports( 'post-formats' ),\n\t\t)\n\t);\n}\n\n/**\n * Retrieves a list of registered taxonomy names or objects.\n *\n * @since 3.0.0\n *\n * @global array $wp_taxonomies The registered taxonomies.\n *\n * @param array  $args     Optional. An array of `key => value` arguments to match against the taxonomy objects.\n *                         Default empty array.\n * @param string $output   Optional. The type of output to return in the array. Accepts either taxonomy 'names'\n *                         or 'objects'. Default 'names'.\n * @param string $operator Optional. The logical operation to perform. Accepts 'and' or 'or'. 'or' means only\n *                         one element from the array needs to match; 'and' means all elements must match.\n *                         Default 'and'.\n * @return string[]|WP_Taxonomy[] An array of taxonomy names or objects.\n */\nfunction get_taxonomies( $args = array(), $output = 'names', $operator = 'and' ) {\n\tglobal $wp_taxonomies;\n\n\t$field = ( 'names' === $output ) ? 'name' : false;\n\n\treturn wp_filter_object_list( $wp_taxonomies, $args, $operator, $field );\n}\n\n/**\n * Return the names or objects of the taxonomies which are registered for the requested object or object type, such as\n * a post object or post type name.\n *\n * Example:\n *\n *     $taxonomies = get_object_taxonomies( 'post' );\n *\n * This results in:\n *\n *     Array( 'category', 'post_tag' )\n *\n * @since 2.3.0\n *\n * @global array $wp_taxonomies The registered taxonomies.\n *\n * @param string|string[]|WP_Post $object Name of the type of taxonomy object, or an object (row from posts)\n * @param string                  $output Optional. The type of output to return in the array. Accepts either\n *                                        'names' or 'objects'. Default 'names'.\n * @return string[]|WP_Taxonomy[] The names or objects of all taxonomies of `$object_type`.\n */\nfunction get_object_taxonomies( $object, $output = 'names' ) {\n\tglobal $wp_taxonomies;\n\n\tif ( is_object( $object ) ) {\n\t\tif ( 'attachment' === $object->post_type ) {\n\t\t\treturn get_attachment_taxonomies( $object, $output );\n\t\t}\n\t\t$object = $object->post_type;\n\t}\n\n\t$object = (array) $object;\n\n\t$taxonomies = array();\n\tforeach ( (array) $wp_taxonomies as $tax_name => $tax_obj ) {\n\t\tif ( array_intersect( $object, (array) $tax_obj->object_type ) ) {\n\t\t\tif ( 'names' === $output ) {\n\t\t\t\t$taxonomies[] = $tax_name;\n\t\t\t} else {\n\t\t\t\t$taxonomies[ $tax_name ] = $tax_obj;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $taxonomies;\n}\n\n/**\n * Retrieves the taxonomy object of $taxonomy.\n *\n * The get_taxonomy function will first check that the parameter string given\n * is a taxonomy object and if it is, it will return it.\n *\n * @since 2.3.0\n *\n * @global array $wp_taxonomies The registered taxonomies.\n *\n * @param string $taxonomy Name of taxonomy object to return.\n * @return WP_Taxonomy|false The Taxonomy Object or false if $taxonomy doesn't exist.\n */\nfunction get_taxonomy( $taxonomy ) {\n\tglobal $wp_taxonomies;\n\n\tif ( ! taxonomy_exists( $taxonomy ) ) {\n\t\treturn false;\n\t}\n\n\treturn $wp_taxonomies[ $taxonomy ];\n}\n\n/**\n * Determines whether the taxonomy name exists.\n *\n * Formerly is_taxonomy(), introduced in 2.3.0.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 3.0.0\n *\n * @global array $wp_taxonomies The registered taxonomies.\n *\n * @param string $taxonomy Name of taxonomy object.\n * @return bool Whether the taxonomy exists.\n */\nfunction taxonomy_exists( $taxonomy ) {\n\tglobal $wp_taxonomies;\n\n\treturn isset( $wp_taxonomies[ $taxonomy ] );\n}\n\n/**\n * Determines whether the taxonomy object is hierarchical.\n *\n * Checks to make sure that the taxonomy is an object first. Then Gets the\n * object, and finally returns the hierarchical value in the object.\n *\n * A false return value might also mean that the taxonomy does not exist.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.3.0\n *\n * @param string $taxonomy Name of taxonomy object.\n * @return bool Whether the taxonomy is hierarchical.\n */\nfunction is_taxonomy_hierarchical( $taxonomy ) {\n\tif ( ! taxonomy_exists( $taxonomy ) ) {\n\t\treturn false;\n\t}\n\n\t$taxonomy = get_taxonomy( $taxonomy );\n\treturn $taxonomy->hierarchical;\n}\n\n/**\n * Creates or modifies a taxonomy object.\n *\n * Note: Do not use before the {@see 'init'} hook.\n *\n * A simple function for creating or modifying a taxonomy object based on\n * the parameters given. If modifying an existing taxonomy object, note\n * that the `$object_type` value from the original registration will be\n * overwritten.\n *\n * @since 2.3.0\n * @since 4.2.0 Introduced `show_in_quick_edit` argument.\n * @since 4.4.0 The `show_ui` argument is now enforced on the term editing screen.\n * @since 4.4.0 The `public` argument now controls whether the taxonomy can be queried on the front end.\n * @since 4.5.0 Introduced `publicly_queryable` argument.\n * @since 4.7.0 Introduced `show_in_rest`, 'rest_base' and 'rest_controller_class'\n *              arguments to register the Taxonomy in REST API.\n * @since 5.1.0 Introduced `meta_box_sanitize_cb` argument.\n * @since 5.4.0 Added the registered taxonomy object as a return value.\n * @since 5.5.0 Introduced `default_term` argument.\n *\n * @global array $wp_taxonomies Registered taxonomies.\n *\n * @param string       $taxonomy    Taxonomy key, must not exceed 32 characters.\n * @param array|string $object_type Object type or array of object types with which the taxonomy should be associated.\n * @param array|string $args        {\n *     Optional. Array or query string of arguments for registering a taxonomy.\n *\n *     @type array         $labels                An array of labels for this taxonomy. By default, Tag labels are\n *                                                used for non-hierarchical taxonomies, and Category labels are used\n *                                                for hierarchical taxonomies. See accepted values in\n *                                                get_taxonomy_labels(). Default empty array.\n *     @type string        $description           A short descriptive summary of what the taxonomy is for. Default empty.\n *     @type bool          $public                Whether a taxonomy is intended for use publicly either via\n *                                                the admin interface or by front-end users. The default settings\n *                                                of `$publicly_queryable`, `$show_ui`, and `$show_in_nav_menus`\n *                                                are inherited from `$public`.\n *     @type bool          $publicly_queryable    Whether the taxonomy is publicly queryable.\n *                                                If not set, the default is inherited from `$public`\n *     @type bool          $hierarchical          Whether the taxonomy is hierarchical. Default false.\n *     @type bool          $show_ui               Whether to generate and allow a UI for managing terms in this taxonomy in\n *                                                the admin. If not set, the default is inherited from `$public`\n *                                                (default true).\n *     @type bool          $show_in_menu          Whether to show the taxonomy in the admin menu. If true, the taxonomy is\n *                                                shown as a submenu of the object type menu. If false, no menu is shown.\n *                                                `$show_ui` must be true. If not set, default is inherited from `$show_ui`\n *                                                (default true).\n *     @type bool          $show_in_nav_menus     Makes this taxonomy available for selection in navigation menus. If not\n *                                                set, the default is inherited from `$public` (default true).\n *     @type bool          $show_in_rest          Whether to include the taxonomy in the REST API. Set this to true\n *                                                for the taxonomy to be available in the block editor.\n *     @type string        $rest_base             To change the base url of REST API route. Default is $taxonomy.\n *     @type string        $rest_controller_class REST API Controller class name. Default is 'WP_REST_Terms_Controller'.\n *     @type bool          $show_tagcloud         Whether to list the taxonomy in the Tag Cloud Widget controls. If not set,\n *                                                the default is inherited from `$show_ui` (default true).\n *     @type bool          $show_in_quick_edit    Whether to show the taxonomy in the quick/bulk edit panel. It not set,\n *                                                the default is inherited from `$show_ui` (default true).\n *     @type bool          $show_admin_column     Whether to display a column for the taxonomy on its post type listing\n *                                                screens. Default false.\n *     @type bool|callable $meta_box_cb           Provide a callback function for the meta box display. If not set,\n *                                                post_categories_meta_box() is used for hierarchical taxonomies, and\n *                                                post_tags_meta_box() is used for non-hierarchical. If false, no meta\n *                                                box is shown.\n *     @type callable      $meta_box_sanitize_cb  Callback function for sanitizing taxonomy data saved from a meta\n *                                                box. If no callback is defined, an appropriate one is determined\n *                                                based on the value of `$meta_box_cb`.\n *     @type array         $capabilities {\n *         Array of capabilities for this taxonomy.\n *\n *         @type string $manage_terms Default 'manage_categories'.\n *         @type string $edit_terms   Default 'manage_categories'.\n *         @type string $delete_terms Default 'manage_categories'.\n *         @type string $assign_terms Default 'edit_posts'.\n *     }\n *     @type bool|array    $rewrite {\n *         Triggers the handling of rewrites for this taxonomy. Default true, using $taxonomy as slug. To prevent\n *         rewrite, set to false. To specify rewrite rules, an array can be passed with any of these keys:\n *\n *         @type string $slug         Customize the permastruct slug. Default `$taxonomy` key.\n *         @type bool   $with_front   Should the permastruct be prepended with WP_Rewrite::$front. Default true.\n *         @type bool   $hierarchical Either hierarchical rewrite tag or not. Default false.\n *         @type int    $ep_mask      Assign an endpoint mask. Default `EP_NONE`.\n *     }\n *     @type string|bool   $query_var             Sets the query var key for this taxonomy. Default `$taxonomy` key. If\n *                                                false, a taxonomy cannot be loaded at `?{query_var}={term_slug}`. If a\n *                                                string, the query `?{query_var}={term_slug}` will be valid.\n *     @type callable      $update_count_callback Works much like a hook, in that it will be called when the count is\n *                                                updated. Default _update_post_term_count() for taxonomies attached\n *                                                to post types, which confirms that the objects are published before\n *                                                counting them. Default _update_generic_term_count() for taxonomies\n *                                                attached to other object types, such as users.\n *     @type string|array  $default_term {\n *         Default term to be used for the taxonomy.\n *\n *         @type string $name         Name of default term.\n *         @type string $slug         Slug for default term. Default empty.\n *         @type string $description  Description for default term. Default empty.\n *     }\n *     @type bool          $_builtin              This taxonomy is a \"built-in\" taxonomy. INTERNAL USE ONLY!\n *                                                Default false.\n * }\n * @return WP_Taxonomy|WP_Error The registered taxonomy object on success, WP_Error object on failure.\n */\nfunction register_taxonomy( $taxonomy, $object_type, $args = array() ) {\n\tglobal $wp_taxonomies;\n\n\tif ( ! is_array( $wp_taxonomies ) ) {\n\t\t$wp_taxonomies = array();\n\t}\n\n\t$args = wp_parse_args( $args );\n\n\tif ( empty( $taxonomy ) || strlen( $taxonomy ) > 32 ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Taxonomy names must be between 1 and 32 characters in length.' ), '4.2.0' );\n\t\treturn new WP_Error( 'taxonomy_length_invalid', __( 'Taxonomy names must be between 1 and 32 characters in length.' ) );\n\t}\n\n\t$taxonomy_object = new WP_Taxonomy( $taxonomy, $object_type, $args );\n\t$taxonomy_object->add_rewrite_rules();\n\n\t$wp_taxonomies[ $taxonomy ] = $taxonomy_object;\n\n\t$taxonomy_object->add_hooks();\n\n\t// Add default term.\n\tif ( ! empty( $taxonomy_object->default_term ) ) {\n\t\t$term = term_exists( $taxonomy_object->default_term['name'], $taxonomy );\n\t\tif ( $term ) {\n\t\t\tupdate_option( 'default_term_' . $taxonomy_object->name, $term['term_id'] );\n\t\t} else {\n\t\t\t$term = wp_insert_term(\n\t\t\t\t$taxonomy_object->default_term['name'],\n\t\t\t\t$taxonomy,\n\t\t\t\tarray(\n\t\t\t\t\t'slug'        => sanitize_title( $taxonomy_object->default_term['slug'] ),\n\t\t\t\t\t'description' => $taxonomy_object->default_term['description'],\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Update `term_id` in options.\n\t\t\tif ( ! is_wp_error( $term ) ) {\n\t\t\t\tupdate_option( 'default_term_' . $taxonomy_object->name, $term['term_id'] );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Fires after a taxonomy is registered.\n\t *\n\t * @since 3.3.0\n\t *\n\t * @param string       $taxonomy    Taxonomy slug.\n\t * @param array|string $object_type Object type or array of object types.\n\t * @param array        $args        Array of taxonomy registration arguments.\n\t */\n\tdo_action( 'registered_taxonomy', $taxonomy, $object_type, (array) $taxonomy_object );\n\n\treturn $taxonomy_object;\n}\n\n/**\n * Unregisters a taxonomy.\n *\n * Can not be used to unregister built-in taxonomies.\n *\n * @since 4.5.0\n *\n * @global WP    $wp            Current WordPress environment instance.\n * @global array $wp_taxonomies List of taxonomies.\n *\n * @param string $taxonomy Taxonomy name.\n * @return bool|WP_Error True on success, WP_Error on failure or if the taxonomy doesn't exist.\n */\nfunction unregister_taxonomy( $taxonomy ) {\n\tif ( ! taxonomy_exists( $taxonomy ) ) {\n\t\treturn new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );\n\t}\n\n\t$taxonomy_object = get_taxonomy( $taxonomy );\n\n\t// Do not allow unregistering internal taxonomies.\n\tif ( $taxonomy_object->_builtin ) {\n\t\treturn new WP_Error( 'invalid_taxonomy', __( 'Unregistering a built-in taxonomy is not allowed.' ) );\n\t}\n\n\tglobal $wp_taxonomies;\n\n\t$taxonomy_object->remove_rewrite_rules();\n\t$taxonomy_object->remove_hooks();\n\n\t// Remove custom taxonomy default term option.\n\tif ( ! empty( $taxonomy_object->default_term ) ) {\n\t\tdelete_option( 'default_term_' . $taxonomy_object->name );\n\t}\n\n\t// Remove the taxonomy.\n\tunset( $wp_taxonomies[ $taxonomy ] );\n\n\t/**\n\t * Fires after a taxonomy is unregistered.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param string $taxonomy Taxonomy name.\n\t */\n\tdo_action( 'unregistered_taxonomy', $taxonomy );\n\n\treturn true;\n}\n\n/**\n * Builds an object with all taxonomy labels out of a taxonomy object.\n *\n * @since 3.0.0\n * @since 4.3.0 Added the `no_terms` label.\n * @since 4.4.0 Added the `items_list_navigation` and `items_list` labels.\n * @since 4.9.0 Added the `most_used` and `back_to_items` labels.\n *\n * @param WP_Taxonomy $tax Taxonomy object.\n * @return object {\n *     Taxonomy labels object. The first default value is for non-hierarchical taxonomies\n *     (like tags) and the second one is for hierarchical taxonomies (like categories).\n *\n *     @type string $name                       General name for the taxonomy, usually plural. The same\n *                                              as and overridden by `$tax->label`. Default 'Tags'/'Categories'.\n *     @type string $singular_name              Name for one object of this taxonomy. Default 'Tag'/'Category'.\n *     @type string $search_items               Default 'Search Tags'/'Search Categories'.\n *     @type string $popular_items              This label is only used for non-hierarchical taxonomies.\n *                                              Default 'Popular Tags'.\n *     @type string $all_items                  Default 'All Tags'/'All Categories'.\n *     @type string $parent_item                This label is only used for hierarchical taxonomies. Default\n *                                              'Parent Category'.\n *     @type string $parent_item_colon          The same as `parent_item`, but with colon `:` in the end.\n *     @type string $edit_item                  Default 'Edit Tag'/'Edit Category'.\n *     @type string $view_item                  Default 'View Tag'/'View Category'.\n *     @type string $update_item                Default 'Update Tag'/'Update Category'.\n *     @type string $add_new_item               Default 'Add New Tag'/'Add New Category'.\n *     @type string $new_item_name              Default 'New Tag Name'/'New Category Name'.\n *     @type string $separate_items_with_commas This label is only used for non-hierarchical taxonomies. Default\n *                                              'Separate tags with commas', used in the meta box.\n *     @type string $add_or_remove_items        This label is only used for non-hierarchical taxonomies. Default\n *                                              'Add or remove tags', used in the meta box when JavaScript\n *                                              is disabled.\n *     @type string $choose_from_most_used      This label is only used on non-hierarchical taxonomies. Default\n *                                              'Choose from the most used tags', used in the meta box.\n *     @type string $not_found                  Default 'No tags found'/'No categories found', used in\n *                                              the meta box and taxonomy list table.\n *     @type string $no_terms                   Default 'No tags'/'No categories', used in the posts and media\n *                                              list tables.\n *     @type string $items_list_navigation      Label for the table pagination hidden heading.\n *     @type string $items_list                 Label for the table hidden heading.\n *     @type string $most_used                  Title for the Most Used tab. Default 'Most Used'.\n *     @type string $back_to_items              Label displayed after a term has been updated.\n * }\n */\nfunction get_taxonomy_labels( $tax ) {\n\t$tax->labels = (array) $tax->labels;\n\n\tif ( isset( $tax->helps ) && empty( $tax->labels['separate_items_with_commas'] ) ) {\n\t\t$tax->labels['separate_items_with_commas'] = $tax->helps;\n\t}\n\n\tif ( isset( $tax->no_tagcloud ) && empty( $tax->labels['not_found'] ) ) {\n\t\t$tax->labels['not_found'] = $tax->no_tagcloud;\n\t}\n\n\t$nohier_vs_hier_defaults = array(\n\t\t'name'                       => array( _x( 'Tags', 'taxonomy general name' ), _x( 'Categories', 'taxonomy general name' ) ),\n\t\t'singular_name'              => array( _x( 'Tag', 'taxonomy singular name' ), _x( 'Category', 'taxonomy singular name' ) ),\n\t\t'search_items'               => array( __( 'Search Tags' ), __( 'Search Categories' ) ),\n\t\t'popular_items'              => array( __( 'Popular Tags' ), null ),\n\t\t'all_items'                  => array( __( 'All Tags' ), __( 'All Categories' ) ),\n\t\t'parent_item'                => array( null, __( 'Parent Category' ) ),\n\t\t'parent_item_colon'          => array( null, __( 'Parent Category:' ) ),\n\t\t'edit_item'                  => array( __( 'Edit Tag' ), __( 'Edit Category' ) ),\n\t\t'view_item'                  => array( __( 'View Tag' ), __( 'View Category' ) ),\n\t\t'update_item'                => array( __( 'Update Tag' ), __( 'Update Category' ) ),\n\t\t'add_new_item'               => array( __( 'Add New Tag' ), __( 'Add New Category' ) ),\n\t\t'new_item_name'              => array( __( 'New Tag Name' ), __( 'New Category Name' ) ),\n\t\t'separate_items_with_commas' => array( __( 'Separate tags with commas' ), null ),\n\t\t'add_or_remove_items'        => array( __( 'Add or remove tags' ), null ),\n\t\t'choose_from_most_used'      => array( __( 'Choose from the most used tags' ), null ),\n\t\t'not_found'                  => array( __( 'No tags found.' ), __( 'No categories found.' ) ),\n\t\t'no_terms'                   => array( __( 'No tags' ), __( 'No categories' ) ),\n\t\t'items_list_navigation'      => array( __( 'Tags list navigation' ), __( 'Categories list navigation' ) ),\n\t\t'items_list'                 => array( __( 'Tags list' ), __( 'Categories list' ) ),\n\t\t/* translators: Tab heading when selecting from the most used terms. */\n\t\t'most_used'                  => array( _x( 'Most Used', 'tags' ), _x( 'Most Used', 'categories' ) ),\n\t\t'back_to_items'              => array( __( '&larr; Back to Tags' ), __( '&larr; Back to Categories' ) ),\n\t);\n\t$nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];\n\n\t$labels = _get_custom_object_labels( $tax, $nohier_vs_hier_defaults );\n\n\t$taxonomy = $tax->name;\n\n\t$default_labels = clone $labels;\n\n\t/**\n\t * Filters the labels of a specific taxonomy.\n\t *\n\t * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @see get_taxonomy_labels() for the full list of taxonomy labels.\n\t *\n\t * @param object $labels Object with labels for the taxonomy as member variables.\n\t */\n\t$labels = apply_filters( \"taxonomy_labels_{$taxonomy}\", $labels );\n\n\t// Ensure that the filtered labels contain all required default values.\n\t$labels = (object) array_merge( (array) $default_labels, (array) $labels );\n\n\treturn $labels;\n}\n\n/**\n * Add an already registered taxonomy to an object type.\n *\n * @since 3.0.0\n *\n * @global array $wp_taxonomies The registered taxonomies.\n *\n * @param string $taxonomy    Name of taxonomy object.\n * @param string $object_type Name of the object type.\n * @return bool True if successful, false if not.\n */\nfunction register_taxonomy_for_object_type( $taxonomy, $object_type ) {\n\tglobal $wp_taxonomies;\n\n\tif ( ! isset( $wp_taxonomies[ $taxonomy ] ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! get_post_type_object( $object_type ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! in_array( $object_type, $wp_taxonomies[ $taxonomy ]->object_type, true ) ) {\n\t\t$wp_taxonomies[ $taxonomy ]->object_type[] = $object_type;\n\t}\n\n\t// Filter out empties.\n\t$wp_taxonomies[ $taxonomy ]->object_type = array_filter( $wp_taxonomies[ $taxonomy ]->object_type );\n\n\t/**\n\t * Fires after a taxonomy is registered for an object type.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param string $taxonomy    Taxonomy name.\n\t * @param string $object_type Name of the object type.\n\t */\n\tdo_action( 'registered_taxonomy_for_object_type', $taxonomy, $object_type );\n\n\treturn true;\n}\n\n/**\n * Remove an already registered taxonomy from an object type.\n *\n * @since 3.7.0\n *\n * @global array $wp_taxonomies The registered taxonomies.\n *\n * @param string $taxonomy    Name of taxonomy object.\n * @param string $object_type Name of the object type.\n * @return bool True if successful, false if not.\n */\nfunction unregister_taxonomy_for_object_type( $taxonomy, $object_type ) {\n\tglobal $wp_taxonomies;\n\n\tif ( ! isset( $wp_taxonomies[ $taxonomy ] ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! get_post_type_object( $object_type ) ) {\n\t\treturn false;\n\t}\n\n\t$key = array_search( $object_type, $wp_taxonomies[ $taxonomy ]->object_type, true );\n\tif ( false === $key ) {\n\t\treturn false;\n\t}\n\n\tunset( $wp_taxonomies[ $taxonomy ]->object_type[ $key ] );\n\n\t/**\n\t * Fires after a taxonomy is unregistered for an object type.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param string $taxonomy    Taxonomy name.\n\t * @param string $object_type Name of the object type.\n\t */\n\tdo_action( 'unregistered_taxonomy_for_object_type', $taxonomy, $object_type );\n\n\treturn true;\n}\n\n//\n// Term API.\n//\n\n/**\n * Retrieve object_ids of valid taxonomy and term.\n *\n * The strings of $taxonomies must exist before this function will continue. On\n * failure of finding a valid taxonomy, it will return an WP_Error class, kind\n * of like Exceptions in PHP 5, except you can't catch them. Even so, you can\n * still test for the WP_Error class and get the error message.\n *\n * The $terms aren't checked the same as $taxonomies, but still need to exist\n * for $object_ids to be returned.\n *\n * It is possible to change the order that object_ids is returned by either\n * using PHP sort family functions or using the database by using $args with\n * either ASC or DESC array. The value should be in the key named 'order'.\n *\n * @since 2.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int|array    $term_ids   Term ID or array of term IDs of terms that will be used.\n * @param string|array $taxonomies String of taxonomy name or Array of string values of taxonomy names.\n * @param array|string $args       Change the order of the object_ids, either ASC or DESC.\n * @return WP_Error|array If the taxonomy does not exist, then WP_Error will be returned. On success.\n *  the array can be empty meaning that there are no $object_ids found or it will return the $object_ids found.\n */\nfunction get_objects_in_term( $term_ids, $taxonomies, $args = array() ) {\n\tglobal $wpdb;\n\n\tif ( ! is_array( $term_ids ) ) {\n\t\t$term_ids = array( $term_ids );\n\t}\n\tif ( ! is_array( $taxonomies ) ) {\n\t\t$taxonomies = array( $taxonomies );\n\t}\n\tforeach ( (array) $taxonomies as $taxonomy ) {\n\t\tif ( ! taxonomy_exists( $taxonomy ) ) {\n\t\t\treturn new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );\n\t\t}\n\t}\n\n\t$defaults = array( 'order' => 'ASC' );\n\t$args     = wp_parse_args( $args, $defaults );\n\n\t$order = ( 'desc' === strtolower( $args['order'] ) ) ? 'DESC' : 'ASC';\n\n\t$term_ids = array_map( 'intval', $term_ids );\n\n\t$taxonomies = \"'\" . implode( \"', '\", array_map( 'esc_sql', $taxonomies ) ) . \"'\";\n\t$term_ids   = \"'\" . implode( \"', '\", $term_ids ) . \"'\";\n\n\t$sql = \"SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ($taxonomies) AND tt.term_id IN ($term_ids) ORDER BY tr.object_id $order\";\n\n\t$last_changed = wp_cache_get_last_changed( 'terms' );\n\t$cache_key    = 'get_objects_in_term:' . md5( $sql ) . \":$last_changed\";\n\t$cache        = wp_cache_get( $cache_key, 'terms' );\n\tif ( false === $cache ) {\n\t\t$object_ids = $wpdb->get_col( $sql );\n\t\twp_cache_set( $cache_key, $object_ids, 'terms' );\n\t} else {\n\t\t$object_ids = (array) $cache;\n\t}\n\n\tif ( ! $object_ids ) {\n\t\treturn array();\n\t}\n\treturn $object_ids;\n}\n\n/**\n * Given a taxonomy query, generates SQL to be appended to a main query.\n *\n * @since 3.1.0\n *\n * @see WP_Tax_Query\n *\n * @param array  $tax_query         A compact tax query\n * @param string $primary_table\n * @param string $primary_id_column\n * @return array\n */\nfunction get_tax_sql( $tax_query, $primary_table, $primary_id_column ) {\n\t$tax_query_obj = new WP_Tax_Query( $tax_query );\n\treturn $tax_query_obj->get_sql( $primary_table, $primary_id_column );\n}\n\n/**\n * Get all Term data from database by Term ID.\n *\n * The usage of the get_term function is to apply filters to a term object. It\n * is possible to get a term object from the database before applying the\n * filters.\n *\n * $term ID must be part of $taxonomy, to get from the database. Failure, might\n * be able to be captured by the hooks. Failure would be the same value as $wpdb\n * returns for the get_row method.\n *\n * There are two hooks, one is specifically for each term, named 'get_term', and\n * the second is for the taxonomy name, 'term_$taxonomy'. Both hooks gets the\n * term object, and the taxonomy name as parameters. Both hooks are expected to\n * return a Term object.\n *\n * {@see 'get_term'} hook - Takes two parameters the term Object and the taxonomy name.\n * Must return term object. Used in get_term() as a catch-all filter for every\n * $term.\n *\n * {@see 'get_$taxonomy'} hook - Takes two parameters the term Object and the taxonomy\n * name. Must return term object. $taxonomy will be the taxonomy name, so for\n * example, if 'category', it would be 'get_category' as the filter name. Useful\n * for custom taxonomies or plugging into default taxonomies.\n *\n * @todo Better formatting for DocBlock\n *\n * @since 2.3.0\n * @since 4.4.0 Converted to return a WP_Term object if `$output` is `OBJECT`.\n *              The `$taxonomy` parameter was made optional.\n *\n * @see sanitize_term_field() The $context param lists the available values for get_term_by() $filter param.\n *\n * @param int|WP_Term|object $term     If integer, term data will be fetched from the database,\n *                                     or from the cache if available.\n *                                     If stdClass object (as in the results of a database query),\n *                                     will apply filters and return a `WP_Term` object with the `$term` data.\n *                                     If `WP_Term`, will return `$term`.\n * @param string             $taxonomy Optional. Taxonomy name that `$term` is part of.\n * @param string             $output   Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which\n *                                     correspond to a WP_Term object, an associative array, or a numeric array,\n *                                     respectively. Default OBJECT.\n * @param string             $filter   Optional. How to sanitize term fields. Default 'raw'.\n * @return WP_Term|array|WP_Error|null WP_Term instance (or array) on success, depending on the `$output` value.\n *                                     WP_Error if `$taxonomy` does not exist. Null for miscellaneous failure.\n */\nfunction get_term( $term, $taxonomy = '', $output = OBJECT, $filter = 'raw' ) {\n\tif ( empty( $term ) ) {\n\t\treturn new WP_Error( 'invalid_term', __( 'Empty Term.' ) );\n\t}\n\n\tif ( $taxonomy && ! taxonomy_exists( $taxonomy ) ) {\n\t\treturn new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );\n\t}\n\n\tif ( $term instanceof WP_Term ) {\n\t\t$_term = $term;\n\t} elseif ( is_object( $term ) ) {\n\t\tif ( empty( $term->filter ) || 'raw' === $term->filter ) {\n\t\t\t$_term = sanitize_term( $term, $taxonomy, 'raw' );\n\t\t\t$_term = new WP_Term( $_term );\n\t\t} else {\n\t\t\t$_term = WP_Term::get_instance( $term->term_id );\n\t\t}\n\t} else {\n\t\t$_term = WP_Term::get_instance( $term, $taxonomy );\n\t}\n\n\tif ( is_wp_error( $_term ) ) {\n\t\treturn $_term;\n\t} elseif ( ! $_term ) {\n\t\treturn null;\n\t}\n\n\t// Ensure for filters that this is not empty.\n\t$taxonomy = $_term->taxonomy;\n\n\t/**\n\t * Filters a taxonomy term object.\n\t *\n\t * @since 2.3.0\n\t * @since 4.4.0 `$_term` is now a `WP_Term` object.\n\t *\n\t * @param WP_Term $_term    Term object.\n\t * @param string  $taxonomy The taxonomy slug.\n\t */\n\t$_term = apply_filters( 'get_term', $_term, $taxonomy );\n\n\t/**\n\t * Filters a taxonomy term object.\n\t *\n\t * The dynamic portion of the filter name, `$taxonomy`, refers\n\t * to the slug of the term's taxonomy.\n\t *\n\t * @since 2.3.0\n\t * @since 4.4.0 `$_term` is now a `WP_Term` object.\n\t *\n\t * @param WP_Term $_term    Term object.\n\t * @param string  $taxonomy The taxonomy slug.\n\t */\n\t$_term = apply_filters( \"get_{$taxonomy}\", $_term, $taxonomy );\n\n\t// Bail if a filter callback has changed the type of the `$_term` object.\n\tif ( ! ( $_term instanceof WP_Term ) ) {\n\t\treturn $_term;\n\t}\n\n\t// Sanitize term, according to the specified filter.\n\t$_term->filter( $filter );\n\n\tif ( ARRAY_A === $output ) {\n\t\treturn $_term->to_array();\n\t} elseif ( ARRAY_N === $output ) {\n\t\treturn array_values( $_term->to_array() );\n\t}\n\n\treturn $_term;\n}\n\n/**\n * Get all Term data from database by Term field and data.\n *\n * Warning: $value is not escaped for 'name' $field. You must do it yourself, if\n * required.\n *\n * The default $field is 'id', therefore it is possible to also use null for\n * field, but not recommended that you do so.\n *\n * If $value does not exist, the return value will be false. If $taxonomy exists\n * and $field and $value combinations exist, the Term will be returned.\n *\n * This function will always return the first term that matches the `$field`-\n * `$value`-`$taxonomy` combination specified in the parameters. If your query\n * is likely to match more than one term (as is likely to be the case when\n * `$field` is 'name', for example), consider using get_terms() instead; that\n * way, you will get all matching terms, and can provide your own logic for\n * deciding which one was intended.\n *\n * @todo Better formatting for DocBlock.\n *\n * @since 2.3.0\n * @since 4.4.0 `$taxonomy` is optional if `$field` is 'term_taxonomy_id'. Converted to return\n *              a WP_Term object if `$output` is `OBJECT`.\n * @since 5.5.0 Added 'ID' as an alias of 'id' for the `$field` parameter.\n *\n * @see sanitize_term_field() The $context param lists the available values for get_term_by() $filter param.\n *\n * @param string     $field    Either 'slug', 'name', 'id' or 'ID' (term_id), or 'term_taxonomy_id'.\n * @param string|int $value    Search for this term value.\n * @param string     $taxonomy Taxonomy name. Optional, if `$field` is 'term_taxonomy_id'.\n * @param string     $output   Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which\n *                             correspond to a WP_Term object, an associative array, or a numeric array,\n *                             respectively. Default OBJECT.\n * @param string     $filter   Optional. How to sanitize term fields. Default 'raw'.\n * @return WP_Term|array|false WP_Term instance (or array) on success, depending on the `$output` value.\n *                             False if `$taxonomy` does not exist or `$term` was not found.\n */\nfunction get_term_by( $field, $value, $taxonomy = '', $output = OBJECT, $filter = 'raw' ) {\n\n\t// 'term_taxonomy_id' lookups don't require taxonomy checks.\n\tif ( 'term_taxonomy_id' !== $field && ! taxonomy_exists( $taxonomy ) ) {\n\t\treturn false;\n\t}\n\n\t// No need to perform a query for empty 'slug' or 'name'.\n\tif ( 'slug' === $field || 'name' === $field ) {\n\t\t$value = (string) $value;\n\n\t\tif ( 0 === strlen( $value ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif ( 'id' === $field || 'ID' === $field || 'term_id' === $field ) {\n\t\t$term = get_term( (int) $value, $taxonomy, $output, $filter );\n\t\tif ( is_wp_error( $term ) || null === $term ) {\n\t\t\t$term = false;\n\t\t}\n\t\treturn $term;\n\t}\n\n\t$args = array(\n\t\t'get'                    => 'all',\n\t\t'number'                 => 1,\n\t\t'taxonomy'               => $taxonomy,\n\t\t'update_term_meta_cache' => false,\n\t\t'orderby'                => 'none',\n\t\t'suppress_filter'        => true,\n\t);\n\n\tswitch ( $field ) {\n\t\tcase 'slug':\n\t\t\t$args['slug'] = $value;\n\t\t\tbreak;\n\t\tcase 'name':\n\t\t\t$args['name'] = $value;\n\t\t\tbreak;\n\t\tcase 'term_taxonomy_id':\n\t\t\t$args['term_taxonomy_id'] = $value;\n\t\t\tunset( $args['taxonomy'] );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n\n\t$terms = get_terms( $args );\n\tif ( is_wp_error( $terms ) || empty( $terms ) ) {\n\t\treturn false;\n\t}\n\n\t$term = array_shift( $terms );\n\n\t// In the case of 'term_taxonomy_id', override the provided `$taxonomy` with whatever we find in the DB.\n\tif ( 'term_taxonomy_id' === $field ) {\n\t\t$taxonomy = $term->taxonomy;\n\t}\n\n\treturn get_term( $term, $taxonomy, $output, $filter );\n}\n\n/**\n * Merge all term children into a single array of their IDs.\n *\n * This recursive function will merge all of the children of $term into the same\n * array of term IDs. Only useful for taxonomies which are hierarchical.\n *\n * Will return an empty array if $term does not exist in $taxonomy.\n *\n * @since 2.3.0\n *\n * @param int    $term_id  ID of Term to get children.\n * @param string $taxonomy Taxonomy Name.\n * @return array|WP_Error List of Term IDs. WP_Error returned if `$taxonomy` does not exist.\n */\nfunction get_term_children( $term_id, $taxonomy ) {\n\tif ( ! taxonomy_exists( $taxonomy ) ) {\n\t\treturn new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );\n\t}\n\n\t$term_id = intval( $term_id );\n\n\t$terms = _get_term_hierarchy( $taxonomy );\n\n\tif ( ! isset( $terms[ $term_id ] ) ) {\n\t\treturn array();\n\t}\n\n\t$children = $terms[ $term_id ];\n\n\tforeach ( (array) $terms[ $term_id ] as $child ) {\n\t\tif ( $term_id === $child ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( isset( $terms[ $child ] ) ) {\n\t\t\t$children = array_merge( $children, get_term_children( $child, $taxonomy ) );\n\t\t}\n\t}\n\n\treturn $children;\n}\n\n/**\n * Get sanitized Term field.\n *\n * The function is for contextual reasons and for simplicity of usage.\n *\n * @since 2.3.0\n * @since 4.4.0 The `$taxonomy` parameter was made optional. `$term` can also now accept a WP_Term object.\n *\n * @see sanitize_term_field()\n *\n * @param string      $field    Term field to fetch.\n * @param int|WP_Term $term     Term ID or object.\n * @param string      $taxonomy Optional. Taxonomy Name. Default empty.\n * @param string      $context  Optional. How to sanitize term fields. Look at sanitize_term_field() for available options.\n *                              Default 'display'.\n * @return string|int|null|WP_Error Will return an empty string if $term is not an object or if $field is not set in $term.\n */\nfunction get_term_field( $field, $term, $taxonomy = '', $context = 'display' ) {\n\t$term = get_term( $term, $taxonomy );\n\tif ( is_wp_error( $term ) ) {\n\t\treturn $term;\n\t}\n\n\tif ( ! is_object( $term ) ) {\n\t\treturn '';\n\t}\n\n\tif ( ! isset( $term->$field ) ) {\n\t\treturn '';\n\t}\n\n\treturn sanitize_term_field( $field, $term->$field, $term->term_id, $term->taxonomy, $context );\n}\n\n/**\n * Sanitizes Term for editing.\n *\n * Return value is sanitize_term() and usage is for sanitizing the term for\n * editing. Function is for contextual and simplicity.\n *\n * @since 2.3.0\n *\n * @param int|object $id       Term ID or object.\n * @param string     $taxonomy Taxonomy name.\n * @return string|int|null|WP_Error Will return empty string if $term is not an object.\n */\nfunction get_term_to_edit( $id, $taxonomy ) {\n\t$term = get_term( $id, $taxonomy );\n\n\tif ( is_wp_error( $term ) ) {\n\t\treturn $term;\n\t}\n\n\tif ( ! is_object( $term ) ) {\n\t\treturn '';\n\t}\n\n\treturn sanitize_term( $term, $taxonomy, 'edit' );\n}\n\n/**\n * Retrieve the terms in a given taxonomy or list of taxonomies.\n *\n * You can fully inject any customizations to the query before it is sent, as\n * well as control the output with a filter.\n *\n * The {@see 'get_terms'} filter will be called when the cache has the term and will\n * pass the found term along with the array of $taxonomies and array of $args.\n * This filter is also called before the array of terms is passed and will pass\n * the array of terms, along with the $taxonomies and $args.\n *\n * The {@see 'list_terms_exclusions'} filter passes the compiled exclusions along with\n * the $args.\n *\n * The {@see 'get_terms_orderby'} filter passes the `ORDER BY` clause for the query\n * along with the $args array.\n *\n * Prior to 4.5.0, the first parameter of `get_terms()` was a taxonomy or list of taxonomies:\n *\n *     $terms = get_terms( 'post_tag', array(\n *         'hide_empty' => false,\n *     ) );\n *\n * Since 4.5.0, taxonomies should be passed via the 'taxonomy' argument in the `$args` array:\n *\n *     $terms = get_terms( array(\n *         'taxonomy' => 'post_tag',\n *         'hide_empty' => false,\n *     ) );\n *\n * @since 2.3.0\n * @since 4.2.0 Introduced 'name' and 'childless' parameters.\n * @since 4.4.0 Introduced the ability to pass 'term_id' as an alias of 'id' for the `orderby` parameter.\n *              Introduced the 'meta_query' and 'update_term_meta_cache' parameters. Converted to return\n *              a list of WP_Term objects.\n * @since 4.5.0 Changed the function signature so that the `$args` array can be provided as the first parameter.\n *              Introduced 'meta_key' and 'meta_value' parameters. Introduced the ability to order results by metadata.\n * @since 4.8.0 Introduced 'suppress_filter' parameter.\n *\n * @internal The `$deprecated` parameter is parsed for backward compatibility only.\n *\n * @param array|string $args       Optional. Array or string of arguments. See WP_Term_Query::__construct()\n *                                 for information on accepted arguments. Default empty.\n * @param array|string $deprecated Argument array, when using the legacy function parameter format. If present,\n *                                 this parameter will be interpreted as `$args`, and the first function parameter\n *                                 will be parsed as a taxonomy or array of taxonomies.\n * @return WP_Term[]|int|WP_Error Array of WP_Term instances, a count thereof,\n *                                or WP_Error if any of the taxonomies do not exist.\n */\nfunction get_terms( $args = array(), $deprecated = '' ) {\n\t$term_query = new WP_Term_Query();\n\n\t$defaults = array(\n\t\t'suppress_filter' => false,\n\t);\n\n\t/*\n\t * Legacy argument format ($taxonomy, $args) takes precedence.\n\t *\n\t * We detect legacy argument format by checking if\n\t * (a) a second non-empty parameter is passed, or\n\t * (b) the first parameter shares no keys with the default array (ie, it's a list of taxonomies)\n\t */\n\t$_args          = wp_parse_args( $args );\n\t$key_intersect  = array_intersect_key( $term_query->query_var_defaults, (array) $_args );\n\t$do_legacy_args = $deprecated || empty( $key_intersect );\n\n\tif ( $do_legacy_args ) {\n\t\t$taxonomies       = (array) $args;\n\t\t$args             = wp_parse_args( $deprecated, $defaults );\n\t\t$args['taxonomy'] = $taxonomies;\n\t} else {\n\t\t$args = wp_parse_args( $args, $defaults );\n\t\tif ( isset( $args['taxonomy'] ) && null !== $args['taxonomy'] ) {\n\t\t\t$args['taxonomy'] = (array) $args['taxonomy'];\n\t\t}\n\t}\n\n\tif ( ! empty( $args['taxonomy'] ) ) {\n\t\tforeach ( $args['taxonomy'] as $taxonomy ) {\n\t\t\tif ( ! taxonomy_exists( $taxonomy ) ) {\n\t\t\t\treturn new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Don't pass suppress_filter to WP_Term_Query.\n\t$suppress_filter = $args['suppress_filter'];\n\tunset( $args['suppress_filter'] );\n\n\t$terms = $term_query->query( $args );\n\n\t// Count queries are not filtered, for legacy reasons.\n\tif ( ! is_array( $terms ) ) {\n\t\treturn $terms;\n\t}\n\n\tif ( $suppress_filter ) {\n\t\treturn $terms;\n\t}\n\n\t/**\n\t * Filters the found terms.\n\t *\n\t * @since 2.3.0\n\t * @since 4.6.0 Added the `$term_query` parameter.\n\t *\n\t * @param array         $terms      Array of found terms.\n\t * @param array         $taxonomies An array of taxonomies.\n\t * @param array         $args       An array of get_terms() arguments.\n\t * @param WP_Term_Query $term_query The WP_Term_Query object.\n\t */\n\treturn apply_filters( 'get_terms', $terms, $term_query->query_vars['taxonomy'], $term_query->query_vars, $term_query );\n}\n\n/**\n * Adds metadata to a term.\n *\n * @since 4.4.0\n *\n * @param int    $term_id    Term ID.\n * @param string $meta_key   Metadata name.\n * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.\n * @param bool   $unique     Optional. Whether the same key should not be added.\n *                           Default false.\n * @return int|false|WP_Error Meta ID on success, false on failure.\n *                            WP_Error when term_id is ambiguous between taxonomies.\n */\nfunction add_term_meta( $term_id, $meta_key, $meta_value, $unique = false ) {\n\tif ( wp_term_is_shared( $term_id ) ) {\n\t\treturn new WP_Error( 'ambiguous_term_id', __( 'Term meta cannot be added to terms that are shared between taxonomies.' ), $term_id );\n\t}\n\n\treturn add_metadata( 'term', $term_id, $meta_key, $meta_value, $unique );\n}\n\n/**\n * Removes metadata matching criteria from a term.\n *\n * @since 4.4.0\n *\n * @param int    $term_id    Term ID.\n * @param string $meta_key   Metadata name.\n * @param mixed  $meta_value Optional. Metadata value. If provided,\n *                           rows will only be removed that match the value.\n *                           Must be serializable if non-scalar. Default empty.\n * @return bool True on success, false on failure.\n */\nfunction delete_term_meta( $term_id, $meta_key, $meta_value = '' ) {\n\treturn delete_metadata( 'term', $term_id, $meta_key, $meta_value );\n}\n\n/**\n * Retrieves metadata for a term.\n *\n * @since 4.4.0\n *\n * @param int    $term_id Term ID.\n * @param string $key     Optional. The meta key to retrieve. By default,\n *                        returns data for all keys. Default empty.\n * @param bool   $single  Optional. Whether to return a single value.\n *                        This parameter has no effect if $key is not specified.\n *                        Default false.\n * @return mixed An array if $single is false. The value of the meta field\n *               if $single is true. False for an invalid $term_id.\n */\nfunction get_term_meta( $term_id, $key = '', $single = false ) {\n\treturn get_metadata( 'term', $term_id, $key, $single );\n}\n\n/**\n * Updates term metadata.\n *\n * Use the `$prev_value` parameter to differentiate between meta fields with the same key and term ID.\n *\n * If the meta field for the term does not exist, it will be added.\n *\n * @since 4.4.0\n *\n * @param int    $term_id    Term ID.\n * @param string $meta_key   Metadata key.\n * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.\n * @param mixed  $prev_value Optional. Previous value to check before updating.\n *                           If specified, only update existing metadata entries with\n *                           this value. Otherwise, update all entries. Default empty.\n * @return int|bool|WP_Error Meta ID if the key didn't exist. true on successful update,\n *                           false on failure or if the value passed to the function\n *                           is the same as the one that is already in the database.\n *                           WP_Error when term_id is ambiguous between taxonomies.\n */\nfunction update_term_meta( $term_id, $meta_key, $meta_value, $prev_value = '' ) {\n\tif ( wp_term_is_shared( $term_id ) ) {\n\t\treturn new WP_Error( 'ambiguous_term_id', __( 'Term meta cannot be added to terms that are shared between taxonomies.' ), $term_id );\n\t}\n\n\treturn update_metadata( 'term', $term_id, $meta_key, $meta_value, $prev_value );\n}\n\n/**\n * Updates metadata cache for list of term IDs.\n *\n * Performs SQL query to retrieve all metadata for the terms matching `$term_ids` and stores them in the cache.\n * Subsequent calls to `get_term_meta()` will not need to query the database.\n *\n * @since 4.4.0\n *\n * @param array $term_ids List of term IDs.\n * @return array|false An array of metadata on success, false if there is nothing to update.\n */\nfunction update_termmeta_cache( $term_ids ) {\n\treturn update_meta_cache( 'term', $term_ids );\n}\n\n/**\n * Get all meta data, including meta IDs, for the given term ID.\n *\n * @since 4.9.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int $term_id Term ID.\n * @return array|false Array with meta data, or false when the meta table is not installed.\n */\nfunction has_term_meta( $term_id ) {\n\t$check = wp_check_term_meta_support_prefilter( null );\n\tif ( null !== $check ) {\n\t\treturn $check;\n\t}\n\n\tglobal $wpdb;\n\n\treturn $wpdb->get_results( $wpdb->prepare( \"SELECT meta_key, meta_value, meta_id, term_id FROM $wpdb->termmeta WHERE term_id = %d ORDER BY meta_key,meta_id\", $term_id ), ARRAY_A );\n}\n\n/**\n * Registers a meta key for terms.\n *\n * @since 4.9.8\n *\n * @param string $taxonomy Taxonomy to register a meta key for. Pass an empty string\n *                         to register the meta key across all existing taxonomies.\n * @param string $meta_key The meta key to register.\n * @param array  $args     Data used to describe the meta key when registered. See\n *                         {@see register_meta()} for a list of supported arguments.\n * @return bool True if the meta key was successfully registered, false if not.\n */\nfunction register_term_meta( $taxonomy, $meta_key, array $args ) {\n\t$args['object_subtype'] = $taxonomy;\n\n\treturn register_meta( 'term', $meta_key, $args );\n}\n\n/**\n * Unregisters a meta key for terms.\n *\n * @since 4.9.8\n *\n * @param string $taxonomy Taxonomy the meta key is currently registered for. Pass\n *                         an empty string if the meta key is registered across all\n *                         existing taxonomies.\n * @param string $meta_key The meta key to unregister.\n * @return bool True on success, false if the meta key was not previously registered.\n */\nfunction unregister_term_meta( $taxonomy, $meta_key ) {\n\treturn unregister_meta_key( 'term', $meta_key, $taxonomy );\n}\n\n/**\n * Determines whether a taxonomy term exists.\n *\n * Formerly is_term(), introduced in 2.3.0.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 3.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int|string $term     The term to check. Accepts term ID, slug, or name.\n * @param string     $taxonomy Optional. The taxonomy name to use.\n * @param int        $parent   Optional. ID of parent term under which to confine the exists search.\n * @return mixed Returns null if the term does not exist.\n *               Returns the term ID if no taxonomy is specified and the term ID exists.\n *               Returns an array of the term ID and the term taxonomy ID if the taxonomy is specified and the pairing exists.\n *               Returns 0 if term ID 0 is passed to the function.\n */\nfunction term_exists( $term, $taxonomy = '', $parent = null ) {\n\tglobal $wpdb;\n\n\t$select     = \"SELECT term_id FROM $wpdb->terms as t WHERE \";\n\t$tax_select = \"SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE \";\n\n\tif ( is_int( $term ) ) {\n\t\tif ( 0 === $term ) {\n\t\t\treturn 0;\n\t\t}\n\t\t$where = 't.term_id = %d';\n\t\tif ( ! empty( $taxonomy ) ) {\n\t\t\t// phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber\n\t\t\treturn $wpdb->get_row( $wpdb->prepare( $tax_select . $where . ' AND tt.taxonomy = %s', $term, $taxonomy ), ARRAY_A );\n\t\t} else {\n\t\t\treturn $wpdb->get_var( $wpdb->prepare( $select . $where, $term ) );\n\t\t}\n\t}\n\n\t$term = trim( wp_unslash( $term ) );\n\t$slug = sanitize_title( $term );\n\n\t$where             = 't.slug = %s';\n\t$else_where        = 't.name = %s';\n\t$where_fields      = array( $slug );\n\t$else_where_fields = array( $term );\n\t$orderby           = 'ORDER BY t.term_id ASC';\n\t$limit             = 'LIMIT 1';\n\tif ( ! empty( $taxonomy ) ) {\n\t\tif ( is_numeric( $parent ) ) {\n\t\t\t$parent              = (int) $parent;\n\t\t\t$where_fields[]      = $parent;\n\t\t\t$else_where_fields[] = $parent;\n\t\t\t$where              .= ' AND tt.parent = %d';\n\t\t\t$else_where         .= ' AND tt.parent = %d';\n\t\t}\n\n\t\t$where_fields[]      = $taxonomy;\n\t\t$else_where_fields[] = $taxonomy;\n\n\t\t$result = $wpdb->get_row( $wpdb->prepare( \"SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s $orderby $limit\", $where_fields ), ARRAY_A );\n\t\tif ( $result ) {\n\t\t\treturn $result;\n\t\t}\n\n\t\treturn $wpdb->get_row( $wpdb->prepare( \"SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $else_where AND tt.taxonomy = %s $orderby $limit\", $else_where_fields ), ARRAY_A );\n\t}\n\n\t// phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare\n\t$result = $wpdb->get_var( $wpdb->prepare( \"SELECT term_id FROM $wpdb->terms as t WHERE $where $orderby $limit\", $where_fields ) );\n\tif ( $result ) {\n\t\treturn $result;\n\t}\n\n\t// phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare\n\treturn $wpdb->get_var( $wpdb->prepare( \"SELECT term_id FROM $wpdb->terms as t WHERE $else_where $orderby $limit\", $else_where_fields ) );\n}\n\n/**\n * Check if a term is an ancestor of another term.\n *\n * You can use either an ID or the term object for both parameters.\n *\n * @since 3.4.0\n *\n * @param int|object $term1    ID or object to check if this is the parent term.\n * @param int|object $term2    The child term.\n * @param string     $taxonomy Taxonomy name that $term1 and `$term2` belong to.\n * @return bool Whether `$term2` is a child of `$term1`.\n */\nfunction term_is_ancestor_of( $term1, $term2, $taxonomy ) {\n\tif ( ! isset( $term1->term_id ) ) {\n\t\t$term1 = get_term( $term1, $taxonomy );\n\t}\n\tif ( ! isset( $term2->parent ) ) {\n\t\t$term2 = get_term( $term2, $taxonomy );\n\t}\n\n\tif ( empty( $term1->term_id ) || empty( $term2->parent ) ) {\n\t\treturn false;\n\t}\n\tif ( $term2->parent === $term1->term_id ) {\n\t\treturn true;\n\t}\n\n\treturn term_is_ancestor_of( $term1, get_term( $term2->parent, $taxonomy ), $taxonomy );\n}\n\n/**\n * Sanitize Term all fields.\n *\n * Relies on sanitize_term_field() to sanitize the term. The difference is that\n * this function will sanitize <strong>all</strong> fields. The context is based\n * on sanitize_term_field().\n *\n * The $term is expected to be either an array or an object.\n *\n * @since 2.3.0\n *\n * @param array|object $term     The term to check.\n * @param string       $taxonomy The taxonomy name to use.\n * @param string       $context  Optional. Context in which to sanitize the term. Accepts 'edit', 'db',\n *                               'display', 'attribute', or 'js'. Default 'display'.\n * @return array|object Term with all fields sanitized.\n */\nfunction sanitize_term( $term, $taxonomy, $context = 'display' ) {\n\t$fields = array( 'term_id', 'name', 'description', 'slug', 'count', 'parent', 'term_group', 'term_taxonomy_id', 'object_id' );\n\n\t$do_object = is_object( $term );\n\n\t$term_id = $do_object ? $term->term_id : ( isset( $term['term_id'] ) ? $term['term_id'] : 0 );\n\n\tforeach ( (array) $fields as $field ) {\n\t\tif ( $do_object ) {\n\t\t\tif ( isset( $term->$field ) ) {\n\t\t\t\t$term->$field = sanitize_term_field( $field, $term->$field, $term_id, $taxonomy, $context );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( isset( $term[ $field ] ) ) {\n\t\t\t\t$term[ $field ] = sanitize_term_field( $field, $term[ $field ], $term_id, $taxonomy, $context );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( $do_object ) {\n\t\t$term->filter = $context;\n\t} else {\n\t\t$term['filter'] = $context;\n\t}\n\n\treturn $term;\n}\n\n/**\n * Cleanse the field value in the term based on the context.\n *\n * Passing a term field value through the function should be assumed to have\n * cleansed the value for whatever context the term field is going to be used.\n *\n * If no context or an unsupported context is given, then default filters will\n * be applied.\n *\n * There are enough filters for each context to support a custom filtering\n * without creating your own filter function. Simply create a function that\n * hooks into the filter you need.\n *\n * @since 2.3.0\n *\n * @param string $field    Term field to sanitize.\n * @param string $value    Search for this term value.\n * @param int    $term_id  Term ID.\n * @param string $taxonomy Taxonomy Name.\n * @param string $context  Context in which to sanitize the term field. Accepts 'edit', 'db', 'display',\n *                         'attribute', or 'js'.\n * @return mixed Sanitized field.\n */\nfunction sanitize_term_field( $field, $value, $term_id, $taxonomy, $context ) {\n\t$int_fields = array( 'parent', 'term_id', 'count', 'term_group', 'term_taxonomy_id', 'object_id' );\n\tif ( in_array( $field, $int_fields, true ) ) {\n\t\t$value = (int) $value;\n\t\tif ( $value < 0 ) {\n\t\t\t$value = 0;\n\t\t}\n\t}\n\n\t$context = strtolower( $context );\n\n\tif ( 'raw' === $context ) {\n\t\treturn $value;\n\t}\n\n\tif ( 'edit' === $context ) {\n\n\t\t/**\n\t\t * Filters a term field to edit before it is sanitized.\n\t\t *\n\t\t * The dynamic portion of the filter name, `$field`, refers to the term field.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param mixed $value     Value of the term field.\n\t\t * @param int   $term_id   Term ID.\n\t\t * @param string $taxonomy Taxonomy slug.\n\t\t */\n\t\t$value = apply_filters( \"edit_term_{$field}\", $value, $term_id, $taxonomy );\n\n\t\t/**\n\t\t * Filters the taxonomy field to edit before it is sanitized.\n\t\t *\n\t\t * The dynamic portions of the filter name, `$taxonomy` and `$field`, refer\n\t\t * to the taxonomy slug and taxonomy field, respectively.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param mixed $value   Value of the taxonomy field to edit.\n\t\t * @param int   $term_id Term ID.\n\t\t */\n\t\t$value = apply_filters( \"edit_{$taxonomy}_{$field}\", $value, $term_id );\n\n\t\tif ( 'description' === $field ) {\n\t\t\t$value = esc_html( $value ); // textarea_escaped\n\t\t} else {\n\t\t\t$value = esc_attr( $value );\n\t\t}\n\t} elseif ( 'db' === $context ) {\n\n\t\t/**\n\t\t * Filters a term field value before it is sanitized.\n\t\t *\n\t\t * The dynamic portion of the filter name, `$field`, refers to the term field.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param mixed  $value    Value of the term field.\n\t\t * @param string $taxonomy Taxonomy slug.\n\t\t */\n\t\t$value = apply_filters( \"pre_term_{$field}\", $value, $taxonomy );\n\n\t\t/**\n\t\t * Filters a taxonomy field before it is sanitized.\n\t\t *\n\t\t * The dynamic portions of the filter name, `$taxonomy` and `$field`, refer\n\t\t * to the taxonomy slug and field name, respectively.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param mixed $value Value of the taxonomy field.\n\t\t */\n\t\t$value = apply_filters( \"pre_{$taxonomy}_{$field}\", $value );\n\n\t\t// Back compat filters.\n\t\tif ( 'slug' === $field ) {\n\t\t\t/**\n\t\t\t * Filters the category nicename before it is sanitized.\n\t\t\t *\n\t\t\t * Use the {@see 'pre_$taxonomy_$field'} hook instead.\n\t\t\t *\n\t\t\t * @since 2.0.3\n\t\t\t *\n\t\t\t * @param string $value The category nicename.\n\t\t\t */\n\t\t\t$value = apply_filters( 'pre_category_nicename', $value );\n\t\t}\n\t} elseif ( 'rss' === $context ) {\n\n\t\t/**\n\t\t * Filters the term field for use in RSS.\n\t\t *\n\t\t * The dynamic portion of the filter name, `$field`, refers to the term field.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param mixed  $value    Value of the term field.\n\t\t * @param string $taxonomy Taxonomy slug.\n\t\t */\n\t\t$value = apply_filters( \"term_{$field}_rss\", $value, $taxonomy );\n\n\t\t/**\n\t\t * Filters the taxonomy field for use in RSS.\n\t\t *\n\t\t * The dynamic portions of the hook name, `$taxonomy`, and `$field`, refer\n\t\t * to the taxonomy slug and field name, respectively.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param mixed $value Value of the taxonomy field.\n\t\t */\n\t\t$value = apply_filters( \"{$taxonomy}_{$field}_rss\", $value );\n\t} else {\n\t\t// Use display filters by default.\n\n\t\t/**\n\t\t * Filters the term field sanitized for display.\n\t\t *\n\t\t * The dynamic portion of the filter name, `$field`, refers to the term field name.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param mixed  $value    Value of the term field.\n\t\t * @param int    $term_id  Term ID.\n\t\t * @param string $taxonomy Taxonomy slug.\n\t\t * @param string $context  Context to retrieve the term field value.\n\t\t */\n\t\t$value = apply_filters( \"term_{$field}\", $value, $term_id, $taxonomy, $context );\n\n\t\t/**\n\t\t * Filters the taxonomy field sanitized for display.\n\t\t *\n\t\t * The dynamic portions of the filter name, `$taxonomy`, and `$field`, refer\n\t\t * to the taxonomy slug and taxonomy field, respectively.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param mixed  $value   Value of the taxonomy field.\n\t\t * @param int    $term_id Term ID.\n\t\t * @param string $context Context to retrieve the taxonomy field value.\n\t\t */\n\t\t$value = apply_filters( \"{$taxonomy}_{$field}\", $value, $term_id, $context );\n\t}\n\n\tif ( 'attribute' === $context ) {\n\t\t$value = esc_attr( $value );\n\t} elseif ( 'js' === $context ) {\n\t\t$value = esc_js( $value );\n\t}\n\treturn $value;\n}\n\n/**\n * Count how many terms are in Taxonomy.\n *\n * Default $args is 'hide_empty' which can be 'hide_empty=true' or array('hide_empty' => true).\n *\n * @since 2.3.0\n *\n * @param string       $taxonomy Taxonomy name.\n * @param array|string $args     Optional. Array of arguments that get passed to get_terms().\n *                               Default empty array.\n * @return array|int|WP_Error Number of terms in that taxonomy or WP_Error if the taxonomy does not exist.\n */\nfunction wp_count_terms( $taxonomy, $args = array() ) {\n\t$defaults = array(\n\t\t'taxonomy'   => $taxonomy,\n\t\t'hide_empty' => false,\n\t);\n\t$args     = wp_parse_args( $args, $defaults );\n\n\t// Backward compatibility.\n\tif ( isset( $args['ignore_empty'] ) ) {\n\t\t$args['hide_empty'] = $args['ignore_empty'];\n\t\tunset( $args['ignore_empty'] );\n\t}\n\n\t$args['fields'] = 'count';\n\n\treturn get_terms( $args );\n}\n\n/**\n * Will unlink the object from the taxonomy or taxonomies.\n *\n * Will remove all relationships between the object and any terms in\n * a particular taxonomy or taxonomies. Does not remove the term or\n * taxonomy itself.\n *\n * @since 2.3.0\n *\n * @param int          $object_id  The term Object Id that refers to the term.\n * @param string|array $taxonomies List of Taxonomy Names or single Taxonomy name.\n */\nfunction wp_delete_object_term_relationships( $object_id, $taxonomies ) {\n\t$object_id = (int) $object_id;\n\n\tif ( ! is_array( $taxonomies ) ) {\n\t\t$taxonomies = array( $taxonomies );\n\t}\n\n\tforeach ( (array) $taxonomies as $taxonomy ) {\n\t\t$term_ids = wp_get_object_terms( $object_id, $taxonomy, array( 'fields' => 'ids' ) );\n\t\t$term_ids = array_map( 'intval', $term_ids );\n\t\twp_remove_object_terms( $object_id, $term_ids, $taxonomy );\n\t}\n}\n\n/**\n * Removes a term from the database.\n *\n * If the term is a parent of other terms, then the children will be updated to\n * that term's parent.\n *\n * Metadata associated with the term will be deleted.\n *\n * @since 2.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int          $term     Term ID.\n * @param string       $taxonomy Taxonomy Name.\n * @param array|string $args {\n *     Optional. Array of arguments to override the default term ID. Default empty array.\n *\n *     @type int  $default       The term ID to make the default term. This will only override\n *                               the terms found if there is only one term found. Any other and\n *                               the found terms are used.\n *     @type bool $force_default Optional. Whether to force the supplied term as default to be\n *                               assigned even if the object was not going to be term-less.\n *                               Default false.\n * }\n * @return bool|int|WP_Error True on success, false if term does not exist. Zero on attempted\n *                           deletion of default Category. WP_Error if the taxonomy does not exist.\n */\nfunction wp_delete_term( $term, $taxonomy, $args = array() ) {\n\tglobal $wpdb;\n\n\t$term = (int) $term;\n\n\t$ids = term_exists( $term, $taxonomy );\n\tif ( ! $ids ) {\n\t\treturn false;\n\t}\n\tif ( is_wp_error( $ids ) ) {\n\t\treturn $ids;\n\t}\n\n\t$tt_id = $ids['term_taxonomy_id'];\n\n\t$defaults = array();\n\n\tif ( 'category' === $taxonomy ) {\n\t\t$defaults['default'] = (int) get_option( 'default_category' );\n\t\tif ( $defaults['default'] === $term ) {\n\t\t\treturn 0; // Don't delete the default category.\n\t\t}\n\t}\n\n\t// Don't delete the default custom taxonomy term.\n\t$taxonomy_object = get_taxonomy( $taxonomy );\n\tif ( ! empty( $taxonomy_object->default_term ) ) {\n\t\t$defaults['default'] = (int) get_option( 'default_term_' . $taxonomy );\n\t\tif ( $defaults['default'] === $term ) {\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\tif ( isset( $args['default'] ) ) {\n\t\t$default = (int) $args['default'];\n\t\tif ( ! term_exists( $default, $taxonomy ) ) {\n\t\t\tunset( $default );\n\t\t}\n\t}\n\n\tif ( isset( $args['force_default'] ) ) {\n\t\t$force_default = $args['force_default'];\n\t}\n\n\t/**\n\t * Fires when deleting a term, before any modifications are made to posts or terms.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param int    $term     Term ID.\n\t * @param string $taxonomy Taxonomy Name.\n\t */\n\tdo_action( 'pre_delete_term', $term, $taxonomy );\n\n\t// Update children to point to new parent.\n\tif ( is_taxonomy_hierarchical( $taxonomy ) ) {\n\t\t$term_obj = get_term( $term, $taxonomy );\n\t\tif ( is_wp_error( $term_obj ) ) {\n\t\t\treturn $term_obj;\n\t\t}\n\t\t$parent = $term_obj->parent;\n\n\t\t$edit_ids    = $wpdb->get_results( \"SELECT term_id, term_taxonomy_id FROM $wpdb->term_taxonomy WHERE `parent` = \" . (int) $term_obj->term_id );\n\t\t$edit_tt_ids = wp_list_pluck( $edit_ids, 'term_taxonomy_id' );\n\n\t\t/**\n\t\t * Fires immediately before a term to delete's children are reassigned a parent.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param array $edit_tt_ids An array of term taxonomy IDs for the given term.\n\t\t */\n\t\tdo_action( 'edit_term_taxonomies', $edit_tt_ids );\n\n\t\t$wpdb->update( $wpdb->term_taxonomy, compact( 'parent' ), array( 'parent' => $term_obj->term_id ) + compact( 'taxonomy' ) );\n\n\t\t// Clean the cache for all child terms.\n\t\t$edit_term_ids = wp_list_pluck( $edit_ids, 'term_id' );\n\t\tclean_term_cache( $edit_term_ids, $taxonomy );\n\n\t\t/**\n\t\t * Fires immediately after a term to delete's children are reassigned a parent.\n\t\t *\n\t\t * @since 2.9.0\n\t\t *\n\t\t * @param array $edit_tt_ids An array of term taxonomy IDs for the given term.\n\t\t */\n\t\tdo_action( 'edited_term_taxonomies', $edit_tt_ids );\n\t}\n\n\t// Get the term before deleting it or its term relationships so we can pass to actions below.\n\t$deleted_term = get_term( $term, $taxonomy );\n\n\t$object_ids = (array) $wpdb->get_col( $wpdb->prepare( \"SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d\", $tt_id ) );\n\n\tforeach ( $object_ids as $object_id ) {\n\t\t$terms = wp_get_object_terms(\n\t\t\t$object_id,\n\t\t\t$taxonomy,\n\t\t\tarray(\n\t\t\t\t'fields'  => 'ids',\n\t\t\t\t'orderby' => 'none',\n\t\t\t)\n\t\t);\n\t\tif ( 1 === count( $terms ) && isset( $default ) ) {\n\t\t\t$terms = array( $default );\n\t\t} else {\n\t\t\t$terms = array_diff( $terms, array( $term ) );\n\t\t\tif ( isset( $default ) && isset( $force_default ) && $force_default ) {\n\t\t\t\t$terms = array_merge( $terms, array( $default ) );\n\t\t\t}\n\t\t}\n\t\t$terms = array_map( 'intval', $terms );\n\t\twp_set_object_terms( $object_id, $terms, $taxonomy );\n\t}\n\n\t// Clean the relationship caches for all object types using this term.\n\t$tax_object = get_taxonomy( $taxonomy );\n\tforeach ( $tax_object->object_type as $object_type ) {\n\t\tclean_object_term_cache( $object_ids, $object_type );\n\t}\n\n\t$term_meta_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT meta_id FROM $wpdb->termmeta WHERE term_id = %d \", $term ) );\n\tforeach ( $term_meta_ids as $mid ) {\n\t\tdelete_metadata_by_mid( 'term', $mid );\n\t}\n\n\t/**\n\t * Fires immediately before a term taxonomy ID is deleted.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param int $tt_id Term taxonomy ID.\n\t */\n\tdo_action( 'delete_term_taxonomy', $tt_id );\n\n\t$wpdb->delete( $wpdb->term_taxonomy, array( 'term_taxonomy_id' => $tt_id ) );\n\n\t/**\n\t * Fires immediately after a term taxonomy ID is deleted.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param int $tt_id Term taxonomy ID.\n\t */\n\tdo_action( 'deleted_term_taxonomy', $tt_id );\n\n\t// Delete the term if no taxonomies use it.\n\tif ( ! $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE term_id = %d\", $term ) ) ) {\n\t\t$wpdb->delete( $wpdb->terms, array( 'term_id' => $term ) );\n\t}\n\n\tclean_term_cache( $term, $taxonomy );\n\n\t/**\n\t * Fires after a term is deleted from the database and the cache is cleaned.\n\t *\n\t * @since 2.5.0\n\t * @since 4.5.0 Introduced the `$object_ids` argument.\n\t *\n\t * @param int     $term         Term ID.\n\t * @param int     $tt_id        Term taxonomy ID.\n\t * @param string  $taxonomy     Taxonomy slug.\n\t * @param mixed   $deleted_term Copy of the already-deleted term, in the form specified\n\t *                              by the parent function. WP_Error otherwise.\n\t * @param array   $object_ids   List of term object IDs.\n\t */\n\tdo_action( 'delete_term', $term, $tt_id, $taxonomy, $deleted_term, $object_ids );\n\n\t/**\n\t * Fires after a term in a specific taxonomy is deleted.\n\t *\n\t * The dynamic portion of the hook name, `$taxonomy`, refers to the specific\n\t * taxonomy the term belonged to.\n\t *\n\t * @since 2.3.0\n\t * @since 4.5.0 Introduced the `$object_ids` argument.\n\t *\n\t * @param int     $term         Term ID.\n\t * @param int     $tt_id        Term taxonomy ID.\n\t * @param mixed   $deleted_term Copy of the already-deleted term, in the form specified\n\t *                              by the parent function. WP_Error otherwise.\n\t * @param array   $object_ids   List of term object IDs.\n\t */\n\tdo_action( \"delete_{$taxonomy}\", $term, $tt_id, $deleted_term, $object_ids );\n\n\treturn true;\n}\n\n/**\n * Deletes one existing category.\n *\n * @since 2.0.0\n *\n * @param int $cat_ID Category term ID.\n * @return bool|int|WP_Error Returns true if completes delete action; false if term doesn't exist;\n *  Zero on attempted deletion of default Category; WP_Error object is also a possibility.\n */\nfunction wp_delete_category( $cat_ID ) {\n\treturn wp_delete_term( $cat_ID, 'category' );\n}\n\n/**\n * Retrieves the terms associated with the given object(s), in the supplied taxonomies.\n *\n * @since 2.3.0\n * @since 4.2.0 Added support for 'taxonomy', 'parent', and 'term_taxonomy_id' values of `$orderby`.\n *              Introduced `$parent` argument.\n * @since 4.4.0 Introduced `$meta_query` and `$update_term_meta_cache` arguments. When `$fields` is 'all' or\n *              'all_with_object_id', an array of `WP_Term` objects will be returned.\n * @since 4.7.0 Refactored to use WP_Term_Query, and to support any WP_Term_Query arguments.\n *\n * @param int|int[]       $object_ids The ID(s) of the object(s) to retrieve.\n * @param string|string[] $taxonomies The taxonomy names to retrieve terms from.\n * @param array|string    $args       See WP_Term_Query::__construct() for supported arguments.\n * @return array|WP_Error The requested term data or empty array if no terms found.\n *                        WP_Error if any of the taxonomies don't exist.\n */\nfunction wp_get_object_terms( $object_ids, $taxonomies, $args = array() ) {\n\tif ( empty( $object_ids ) || empty( $taxonomies ) ) {\n\t\treturn array();\n\t}\n\n\tif ( ! is_array( $taxonomies ) ) {\n\t\t$taxonomies = array( $taxonomies );\n\t}\n\n\tforeach ( $taxonomies as $taxonomy ) {\n\t\tif ( ! taxonomy_exists( $taxonomy ) ) {\n\t\t\treturn new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );\n\t\t}\n\t}\n\n\tif ( ! is_array( $object_ids ) ) {\n\t\t$object_ids = array( $object_ids );\n\t}\n\t$object_ids = array_map( 'intval', $object_ids );\n\n\t$args = wp_parse_args( $args );\n\n\t/**\n\t * Filter arguments for retrieving object terms.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param array    $args       An array of arguments for retrieving terms for the given object(s).\n\t *                             See {@see wp_get_object_terms()} for details.\n\t * @param int[]    $object_ids Array of object IDs.\n\t * @param string[] $taxonomies Array of taxonomy names to retrieve terms from.\n\t */\n\t$args = apply_filters( 'wp_get_object_terms_args', $args, $object_ids, $taxonomies );\n\n\t/*\n\t * When one or more queried taxonomies is registered with an 'args' array,\n\t * those params override the `$args` passed to this function.\n\t */\n\t$terms = array();\n\tif ( count( $taxonomies ) > 1 ) {\n\t\tforeach ( $taxonomies as $index => $taxonomy ) {\n\t\t\t$t = get_taxonomy( $taxonomy );\n\t\t\tif ( isset( $t->args ) && is_array( $t->args ) && array_merge( $args, $t->args ) != $args ) {\n\t\t\t\tunset( $taxonomies[ $index ] );\n\t\t\t\t$terms = array_merge( $terms, wp_get_object_terms( $object_ids, $taxonomy, array_merge( $args, $t->args ) ) );\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$t = get_taxonomy( $taxonomies[0] );\n\t\tif ( isset( $t->args ) && is_array( $t->args ) ) {\n\t\t\t$args = array_merge( $args, $t->args );\n\t\t}\n\t}\n\n\t$args['taxonomy']   = $taxonomies;\n\t$args['object_ids'] = $object_ids;\n\n\t// Taxonomies registered without an 'args' param are handled here.\n\tif ( ! empty( $taxonomies ) ) {\n\t\t$terms_from_remaining_taxonomies = get_terms( $args );\n\n\t\t// Array keys should be preserved for values of $fields that use term_id for keys.\n\t\tif ( ! empty( $args['fields'] ) && 0 === strpos( $args['fields'], 'id=>' ) ) {\n\t\t\t$terms = $terms + $terms_from_remaining_taxonomies;\n\t\t} else {\n\t\t\t$terms = array_merge( $terms, $terms_from_remaining_taxonomies );\n\t\t}\n\t}\n\n\t/**\n\t * Filters the terms for a given object or objects.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param array    $terms      Array of terms for the given object or objects.\n\t * @param int[]    $object_ids Array of object IDs for which terms were retrieved.\n\t * @param string[] $taxonomies Array of taxonomy names from which terms were retrieved.\n\t * @param array    $args       Array of arguments for retrieving terms for the given\n\t *                             object(s). See wp_get_object_terms() for details.\n\t */\n\t$terms = apply_filters( 'get_object_terms', $terms, $object_ids, $taxonomies, $args );\n\n\t$object_ids = implode( ',', $object_ids );\n\t$taxonomies = \"'\" . implode( \"', '\", array_map( 'esc_sql', $taxonomies ) ) . \"'\";\n\n\t/**\n\t * Filters the terms for a given object or objects.\n\t *\n\t * The `$taxonomies` parameter passed to this filter is formatted as a SQL fragment. The\n\t * {@see 'get_object_terms'} filter is recommended as an alternative.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array    $terms      Array of terms for the given object or objects.\n\t * @param int[]    $object_ids Array of object IDs for which terms were retrieved.\n\t * @param string[] $taxonomies Array of taxonomy names from which terms were retrieved.\n\t * @param array    $args       Array of arguments for retrieving terms for the given\n\t *                             object(s). See wp_get_object_terms() for details.\n\t */\n\treturn apply_filters( 'wp_get_object_terms', $terms, $object_ids, $taxonomies, $args );\n}\n\n/**\n * Add a new term to the database.\n *\n * A non-existent term is inserted in the following sequence:\n * 1. The term is added to the term table, then related to the taxonomy.\n * 2. If everything is correct, several actions are fired.\n * 3. The 'term_id_filter' is evaluated.\n * 4. The term cache is cleaned.\n * 5. Several more actions are fired.\n * 6. An array is returned containing the `term_id` and `term_taxonomy_id`.\n *\n * If the 'slug' argument is not empty, then it is checked to see if the term\n * is invalid. If it is not a valid, existing term, it is added and the term_id\n * is given.\n *\n * If the taxonomy is hierarchical, and the 'parent' argument is not empty,\n * the term is inserted and the term_id will be given.\n *\n * Error handling:\n * If `$taxonomy` does not exist or `$term` is empty,\n * a WP_Error object will be returned.\n *\n * If the term already exists on the same hierarchical level,\n * or the term slug and name are not unique, a WP_Error object will be returned.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @since 2.3.0\n *\n * @param string       $term     The term name to add.\n * @param string       $taxonomy The taxonomy to which to add the term.\n * @param array|string $args {\n *     Optional. Array or string of arguments for inserting a term.\n *\n *     @type string $alias_of    Slug of the term to make this term an alias of.\n *                               Default empty string. Accepts a term slug.\n *     @type string $description The term description. Default empty string.\n *     @type int    $parent      The id of the parent term. Default 0.\n *     @type string $slug        The term slug to use. Default empty string.\n * }\n * @return array|WP_Error An array containing the `term_id` and `term_taxonomy_id`,\n *                        WP_Error otherwise.\n */\nfunction wp_insert_term( $term, $taxonomy, $args = array() ) {\n\tglobal $wpdb;\n\n\tif ( ! taxonomy_exists( $taxonomy ) ) {\n\t\treturn new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );\n\t}\n\n\t/**\n\t * Filters a term before it is sanitized and inserted into the database.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string|WP_Error $term     The term name to add, or a WP_Error object if there's an error.\n\t * @param string          $taxonomy Taxonomy slug.\n\t */\n\t$term = apply_filters( 'pre_insert_term', $term, $taxonomy );\n\n\tif ( is_wp_error( $term ) ) {\n\t\treturn $term;\n\t}\n\n\tif ( is_int( $term ) && 0 === $term ) {\n\t\treturn new WP_Error( 'invalid_term_id', __( 'Invalid term ID.' ) );\n\t}\n\n\tif ( '' === trim( $term ) ) {\n\t\treturn new WP_Error( 'empty_term_name', __( 'A name is required for this term.' ) );\n\t}\n\n\t$defaults = array(\n\t\t'alias_of'    => '',\n\t\t'description' => '',\n\t\t'parent'      => 0,\n\t\t'slug'        => '',\n\t);\n\t$args     = wp_parse_args( $args, $defaults );\n\n\tif ( $args['parent'] > 0 && ! term_exists( (int) $args['parent'] ) ) {\n\t\treturn new WP_Error( 'missing_parent', __( 'Parent term does not exist.' ) );\n\t}\n\n\t$args['name']     = $term;\n\t$args['taxonomy'] = $taxonomy;\n\n\t// Coerce null description to strings, to avoid database errors.\n\t$args['description'] = (string) $args['description'];\n\n\t$args = sanitize_term( $args, $taxonomy, 'db' );\n\n\t// expected_slashed ($name)\n\t$name        = wp_unslash( $args['name'] );\n\t$description = wp_unslash( $args['description'] );\n\t$parent      = (int) $args['parent'];\n\n\t$slug_provided = ! empty( $args['slug'] );\n\tif ( ! $slug_provided ) {\n\t\t$slug = sanitize_title( $name );\n\t} else {\n\t\t$slug = $args['slug'];\n\t}\n\n\t$term_group = 0;\n\tif ( $args['alias_of'] ) {\n\t\t$alias = get_term_by( 'slug', $args['alias_of'], $taxonomy );\n\t\tif ( ! empty( $alias->term_group ) ) {\n\t\t\t// The alias we want is already in a group, so let's use that one.\n\t\t\t$term_group = $alias->term_group;\n\t\t} elseif ( ! empty( $alias->term_id ) ) {\n\t\t\t/*\n\t\t\t * The alias is not in a group, so we create a new one\n\t\t\t * and add the alias to it.\n\t\t\t */\n\t\t\t$term_group = $wpdb->get_var( \"SELECT MAX(term_group) FROM $wpdb->terms\" ) + 1;\n\n\t\t\twp_update_term(\n\t\t\t\t$alias->term_id,\n\t\t\t\t$taxonomy,\n\t\t\t\tarray(\n\t\t\t\t\t'term_group' => $term_group,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\t/*\n\t * Prevent the creation of terms with duplicate names at the same level of a taxonomy hierarchy,\n\t * unless a unique slug has been explicitly provided.\n\t */\n\t$name_matches = get_terms(\n\t\tarray(\n\t\t\t'taxonomy'               => $taxonomy,\n\t\t\t'name'                   => $name,\n\t\t\t'hide_empty'             => false,\n\t\t\t'parent'                 => $args['parent'],\n\t\t\t'update_term_meta_cache' => false,\n\t\t)\n\t);\n\n\t/*\n\t * The `name` match in `get_terms()` doesn't differentiate accented characters,\n\t * so we do a stricter comparison here.\n\t */\n\t$name_match = null;\n\tif ( $name_matches ) {\n\t\tforeach ( $name_matches as $_match ) {\n\t\t\tif ( strtolower( $name ) === strtolower( $_match->name ) ) {\n\t\t\t\t$name_match = $_match;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( $name_match ) {\n\t\t$slug_match = get_term_by( 'slug', $slug, $taxonomy );\n\t\tif ( ! $slug_provided || $name_match->slug === $slug || $slug_match ) {\n\t\t\tif ( is_taxonomy_hierarchical( $taxonomy ) ) {\n\t\t\t\t$siblings = get_terms(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'taxonomy'               => $taxonomy,\n\t\t\t\t\t\t'get'                    => 'all',\n\t\t\t\t\t\t'parent'                 => $parent,\n\t\t\t\t\t\t'update_term_meta_cache' => false,\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t$existing_term = null;\n\t\t\t\t$sibling_names = wp_list_pluck( $siblings, 'name' );\n\t\t\t\t$sibling_slugs = wp_list_pluck( $siblings, 'slug' );\n\n\t\t\t\tif ( ( ! $slug_provided || $name_match->slug === $slug ) && in_array( $name, $sibling_names, true ) ) {\n\t\t\t\t\t$existing_term = $name_match;\n\t\t\t\t} elseif ( $slug_match && in_array( $slug, $sibling_slugs, true ) ) {\n\t\t\t\t\t$existing_term = $slug_match;\n\t\t\t\t}\n\n\t\t\t\tif ( $existing_term ) {\n\t\t\t\t\treturn new WP_Error( 'term_exists', __( 'A term with the name provided already exists with this parent.' ), $existing_term->term_id );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn new WP_Error( 'term_exists', __( 'A term with the name provided already exists in this taxonomy.' ), $name_match->term_id );\n\t\t\t}\n\t\t}\n\t}\n\n\t$slug = wp_unique_term_slug( $slug, (object) $args );\n\n\t$data = compact( 'name', 'slug', 'term_group' );\n\n\t/**\n\t * Filters term data before it is inserted into the database.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array  $data     Term data to be inserted.\n\t * @param string $taxonomy Taxonomy slug.\n\t * @param array  $args     Arguments passed to wp_insert_term().\n\t */\n\t$data = apply_filters( 'wp_insert_term_data', $data, $taxonomy, $args );\n\n\tif ( false === $wpdb->insert( $wpdb->terms, $data ) ) {\n\t\treturn new WP_Error( 'db_insert_error', __( 'Could not insert term into the database.' ), $wpdb->last_error );\n\t}\n\n\t$term_id = (int) $wpdb->insert_id;\n\n\t// Seems unreachable. However, is used in the case that a term name is provided, which sanitizes to an empty string.\n\tif ( empty( $slug ) ) {\n\t\t$slug = sanitize_title( $slug, $term_id );\n\n\t\t/** This action is documented in wp-includes/taxonomy.php */\n\t\tdo_action( 'edit_terms', $term_id, $taxonomy );\n\t\t$wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) );\n\n\t\t/** This action is documented in wp-includes/taxonomy.php */\n\t\tdo_action( 'edited_terms', $term_id, $taxonomy );\n\t}\n\n\t$tt_id = $wpdb->get_var( $wpdb->prepare( \"SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id = %d\", $taxonomy, $term_id ) );\n\n\tif ( ! empty( $tt_id ) ) {\n\t\treturn array(\n\t\t\t'term_id'          => $term_id,\n\t\t\t'term_taxonomy_id' => $tt_id,\n\t\t);\n\t}\n\n\tif ( false === $wpdb->insert( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent' ) + array( 'count' => 0 ) ) ) {\n\t\treturn new WP_Error( 'db_insert_error', __( 'Could not insert term taxonomy into the database.' ), $wpdb->last_error );\n\t}\n\n\t$tt_id = (int) $wpdb->insert_id;\n\n\t/*\n\t * Sanity check: if we just created a term with the same parent + taxonomy + slug but a higher term_id than\n\t * an existing term, then we have unwittingly created a duplicate term. Delete the dupe, and use the term_id\n\t * and term_taxonomy_id of the older term instead. Then return out of the function so that the \"create\" hooks\n\t * are not fired.\n\t */\n\t$duplicate_term = $wpdb->get_row( $wpdb->prepare( \"SELECT t.term_id, t.slug, tt.term_taxonomy_id, tt.taxonomy FROM $wpdb->terms t INNER JOIN $wpdb->term_taxonomy tt ON ( tt.term_id = t.term_id ) WHERE t.slug = %s AND tt.parent = %d AND tt.taxonomy = %s AND t.term_id < %d AND tt.term_taxonomy_id != %d\", $slug, $parent, $taxonomy, $term_id, $tt_id ) );\n\n\t/**\n\t * Filters the duplicate term check that takes place during term creation.\n\t *\n\t * Term parent+taxonomy+slug combinations are meant to be unique, and wp_insert_term()\n\t * performs a last-minute confirmation of this uniqueness before allowing a new term\n\t * to be created. Plugins with different uniqueness requirements may use this filter\n\t * to bypass or modify the duplicate-term check.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param object $duplicate_term Duplicate term row from terms table, if found.\n\t * @param string $term           Term being inserted.\n\t * @param string $taxonomy       Taxonomy name.\n\t * @param array  $args           Term arguments passed to the function.\n\t * @param int    $tt_id          term_taxonomy_id for the newly created term.\n\t */\n\t$duplicate_term = apply_filters( 'wp_insert_term_duplicate_term_check', $duplicate_term, $term, $taxonomy, $args, $tt_id );\n\n\tif ( $duplicate_term ) {\n\t\t$wpdb->delete( $wpdb->terms, array( 'term_id' => $term_id ) );\n\t\t$wpdb->delete( $wpdb->term_taxonomy, array( 'term_taxonomy_id' => $tt_id ) );\n\n\t\t$term_id = (int) $duplicate_term->term_id;\n\t\t$tt_id   = (int) $duplicate_term->term_taxonomy_id;\n\n\t\tclean_term_cache( $term_id, $taxonomy );\n\t\treturn array(\n\t\t\t'term_id'          => $term_id,\n\t\t\t'term_taxonomy_id' => $tt_id,\n\t\t);\n\t}\n\n\t/**\n\t * Fires immediately after a new term is created, before the term cache is cleaned.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param int    $term_id  Term ID.\n\t * @param int    $tt_id    Term taxonomy ID.\n\t * @param string $taxonomy Taxonomy slug.\n\t */\n\tdo_action( 'create_term', $term_id, $tt_id, $taxonomy );\n\n\t/**\n\t * Fires after a new term is created for a specific taxonomy.\n\t *\n\t * The dynamic portion of the hook name, `$taxonomy`, refers\n\t * to the slug of the taxonomy the term was created for.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param int $term_id Term ID.\n\t * @param int $tt_id   Term taxonomy ID.\n\t */\n\tdo_action( \"create_{$taxonomy}\", $term_id, $tt_id );\n\n\t/**\n\t * Filters the term ID after a new term is created.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param int $term_id Term ID.\n\t * @param int $tt_id   Term taxonomy ID.\n\t */\n\t$term_id = apply_filters( 'term_id_filter', $term_id, $tt_id );\n\n\tclean_term_cache( $term_id, $taxonomy );\n\n\t/**\n\t * Fires after a new term is created, and after the term cache has been cleaned.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param int    $term_id  Term ID.\n\t * @param int    $tt_id    Term taxonomy ID.\n\t * @param string $taxonomy Taxonomy slug.\n\t */\n\tdo_action( 'created_term', $term_id, $tt_id, $taxonomy );\n\n\t/**\n\t * Fires after a new term in a specific taxonomy is created, and after the term\n\t * cache has been cleaned.\n\t *\n\t * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param int $term_id Term ID.\n\t * @param int $tt_id   Term taxonomy ID.\n\t */\n\tdo_action( \"created_{$taxonomy}\", $term_id, $tt_id );\n\n\t/**\n\t * Fires after a term has been saved, and the term cache has been cleared.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param int    $term_id  Term ID.\n\t * @param int    $tt_id    Term taxonomy ID.\n\t * @param string $taxonomy Taxonomy slug.\n\t * @param bool   $update   Whether this is an existing term being updated.\n\t */\n\tdo_action( 'saved_term', $term_id, $tt_id, $taxonomy, false );\n\n\t/**\n\t * Fires after a term in a specific taxonomy has been saved, and the term\n\t * cache has been cleared.\n\t *\n\t * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param int  $term_id Term ID.\n\t * @param int  $tt_id   Term taxonomy ID.\n\t * @param bool $update  Whether this is an existing term being updated.\n\t */\n\tdo_action( \"saved_{$taxonomy}\", $term_id, $tt_id, false );\n\n\treturn array(\n\t\t'term_id'          => $term_id,\n\t\t'term_taxonomy_id' => $tt_id,\n\t);\n}\n\n/**\n * Create Term and Taxonomy Relationships.\n *\n * Relates an object (post, link etc) to a term and taxonomy type. Creates the\n * term and taxonomy relationship if it doesn't already exist. Creates a term if\n * it doesn't exist (using the slug).\n *\n * A relationship means that the term is grouped in or belongs to the taxonomy.\n * A term has no meaning until it is given context by defining which taxonomy it\n * exists under.\n *\n * @since 2.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int              $object_id The object to relate to.\n * @param string|int|array $terms     A single term slug, single term ID, or array of either term slugs or IDs.\n *                                    Will replace all existing related terms in this taxonomy. Passing an\n *                                    empty value will remove all related terms.\n * @param string           $taxonomy  The context in which to relate the term to the object.\n * @param bool             $append    Optional. If false will delete difference of terms. Default false.\n * @return array|WP_Error Term taxonomy IDs of the affected terms or WP_Error on failure.\n */\nfunction wp_set_object_terms( $object_id, $terms, $taxonomy, $append = false ) {\n\tglobal $wpdb;\n\n\t$object_id = (int) $object_id;\n\n\tif ( ! taxonomy_exists( $taxonomy ) ) {\n\t\treturn new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );\n\t}\n\n\tif ( ! is_array( $terms ) ) {\n\t\t$terms = array( $terms );\n\t}\n\n\tif ( ! $append ) {\n\t\t$old_tt_ids = wp_get_object_terms(\n\t\t\t$object_id,\n\t\t\t$taxonomy,\n\t\t\tarray(\n\t\t\t\t'fields'                 => 'tt_ids',\n\t\t\t\t'orderby'                => 'none',\n\t\t\t\t'update_term_meta_cache' => false,\n\t\t\t)\n\t\t);\n\t} else {\n\t\t$old_tt_ids = array();\n\t}\n\n\t$tt_ids     = array();\n\t$term_ids   = array();\n\t$new_tt_ids = array();\n\n\tforeach ( (array) $terms as $term ) {\n\t\tif ( '' === trim( $term ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$term_info = term_exists( $term, $taxonomy );\n\n\t\tif ( ! $term_info ) {\n\t\t\t// Skip if a non-existent term ID is passed.\n\t\t\tif ( is_int( $term ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$term_info = wp_insert_term( $term, $taxonomy );\n\t\t}\n\n\t\tif ( is_wp_error( $term_info ) ) {\n\t\t\treturn $term_info;\n\t\t}\n\n\t\t$term_ids[] = $term_info['term_id'];\n\t\t$tt_id      = $term_info['term_taxonomy_id'];\n\t\t$tt_ids[]   = $tt_id;\n\n\t\tif ( $wpdb->get_var( $wpdb->prepare( \"SELECT term_taxonomy_id FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id = %d\", $object_id, $tt_id ) ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t/**\n\t\t * Fires immediately before an object-term relationship is added.\n\t\t *\n\t\t * @since 2.9.0\n\t\t * @since 4.7.0 Added the `$taxonomy` parameter.\n\t\t *\n\t\t * @param int    $object_id Object ID.\n\t\t * @param int    $tt_id     Term taxonomy ID.\n\t\t * @param string $taxonomy  Taxonomy slug.\n\t\t */\n\t\tdo_action( 'add_term_relationship', $object_id, $tt_id, $taxonomy );\n\n\t\t$wpdb->insert(\n\t\t\t$wpdb->term_relationships,\n\t\t\tarray(\n\t\t\t\t'object_id'        => $object_id,\n\t\t\t\t'term_taxonomy_id' => $tt_id,\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Fires immediately after an object-term relationship is added.\n\t\t *\n\t\t * @since 2.9.0\n\t\t * @since 4.7.0 Added the `$taxonomy` parameter.\n\t\t *\n\t\t * @param int    $object_id Object ID.\n\t\t * @param int    $tt_id     Term taxonomy ID.\n\t\t * @param string $taxonomy  Taxonomy slug.\n\t\t */\n\t\tdo_action( 'added_term_relationship', $object_id, $tt_id, $taxonomy );\n\n\t\t$new_tt_ids[] = $tt_id;\n\t}\n\n\tif ( $new_tt_ids ) {\n\t\twp_update_term_count( $new_tt_ids, $taxonomy );\n\t}\n\n\tif ( ! $append ) {\n\t\t$delete_tt_ids = array_diff( $old_tt_ids, $tt_ids );\n\n\t\tif ( $delete_tt_ids ) {\n\t\t\t$in_delete_tt_ids = \"'\" . implode( \"', '\", $delete_tt_ids ) . \"'\";\n\t\t\t$delete_term_ids  = $wpdb->get_col( $wpdb->prepare( \"SELECT tt.term_id FROM $wpdb->term_taxonomy AS tt WHERE tt.taxonomy = %s AND tt.term_taxonomy_id IN ($in_delete_tt_ids)\", $taxonomy ) );\n\t\t\t$delete_term_ids  = array_map( 'intval', $delete_term_ids );\n\n\t\t\t$remove = wp_remove_object_terms( $object_id, $delete_term_ids, $taxonomy );\n\t\t\tif ( is_wp_error( $remove ) ) {\n\t\t\t\treturn $remove;\n\t\t\t}\n\t\t}\n\t}\n\n\t$t = get_taxonomy( $taxonomy );\n\n\tif ( ! $append && isset( $t->sort ) && $t->sort ) {\n\t\t$values     = array();\n\t\t$term_order = 0;\n\n\t\t$final_tt_ids = wp_get_object_terms(\n\t\t\t$object_id,\n\t\t\t$taxonomy,\n\t\t\tarray(\n\t\t\t\t'fields'                 => 'tt_ids',\n\t\t\t\t'update_term_meta_cache' => false,\n\t\t\t)\n\t\t);\n\n\t\tforeach ( $tt_ids as $tt_id ) {\n\t\t\tif ( in_array( (int) $tt_id, $final_tt_ids, true ) ) {\n\t\t\t\t$values[] = $wpdb->prepare( '(%d, %d, %d)', $object_id, $tt_id, ++$term_order );\n\t\t\t}\n\t\t}\n\n\t\tif ( $values ) {\n\t\t\tif ( false === $wpdb->query( \"INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES \" . join( ',', $values ) . ' ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)' ) ) {\n\t\t\t\treturn new WP_Error( 'db_insert_error', __( 'Could not insert term relationship into the database.' ), $wpdb->last_error );\n\t\t\t}\n\t\t}\n\t}\n\n\twp_cache_delete( $object_id, $taxonomy . '_relationships' );\n\twp_cache_delete( 'last_changed', 'terms' );\n\n\t/**\n\t * Fires after an object's terms have been set.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param int    $object_id  Object ID.\n\t * @param array  $terms      An array of object terms.\n\t * @param array  $tt_ids     An array of term taxonomy IDs.\n\t * @param string $taxonomy   Taxonomy slug.\n\t * @param bool   $append     Whether to append new terms to the old terms.\n\t * @param array  $old_tt_ids Old array of term taxonomy IDs.\n\t */\n\tdo_action( 'set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids );\n\n\treturn $tt_ids;\n}\n\n/**\n * Add term(s) associated with a given object.\n *\n * @since 3.6.0\n *\n * @param int              $object_id The ID of the object to which the terms will be added.\n * @param string|int|array $terms     The slug(s) or ID(s) of the term(s) to add.\n * @param array|string     $taxonomy  Taxonomy name.\n * @return array|WP_Error Term taxonomy IDs of the affected terms.\n */\nfunction wp_add_object_terms( $object_id, $terms, $taxonomy ) {\n\treturn wp_set_object_terms( $object_id, $terms, $taxonomy, true );\n}\n\n/**\n * Remove term(s) associated with a given object.\n *\n * @since 3.6.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int              $object_id The ID of the object from which the terms will be removed.\n * @param string|int|array $terms     The slug(s) or ID(s) of the term(s) to remove.\n * @param array|string     $taxonomy  Taxonomy name.\n * @return bool|WP_Error True on success, false or WP_Error on failure.\n */\nfunction wp_remove_object_terms( $object_id, $terms, $taxonomy ) {\n\tglobal $wpdb;\n\n\t$object_id = (int) $object_id;\n\n\tif ( ! taxonomy_exists( $taxonomy ) ) {\n\t\treturn new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );\n\t}\n\n\tif ( ! is_array( $terms ) ) {\n\t\t$terms = array( $terms );\n\t}\n\n\t$tt_ids = array();\n\n\tforeach ( (array) $terms as $term ) {\n\t\tif ( '' === trim( $term ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$term_info = term_exists( $term, $taxonomy );\n\t\tif ( ! $term_info ) {\n\t\t\t// Skip if a non-existent term ID is passed.\n\t\t\tif ( is_int( $term ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif ( is_wp_error( $term_info ) ) {\n\t\t\treturn $term_info;\n\t\t}\n\n\t\t$tt_ids[] = $term_info['term_taxonomy_id'];\n\t}\n\n\tif ( $tt_ids ) {\n\t\t$in_tt_ids = \"'\" . implode( \"', '\", $tt_ids ) . \"'\";\n\n\t\t/**\n\t\t * Fires immediately before an object-term relationship is deleted.\n\t\t *\n\t\t * @since 2.9.0\n\t\t * @since 4.7.0 Added the `$taxonomy` parameter.\n\t\t *\n\t\t * @param int   $object_id Object ID.\n\t\t * @param array $tt_ids    An array of term taxonomy IDs.\n\t\t * @param string $taxonomy  Taxonomy slug.\n\t\t */\n\t\tdo_action( 'delete_term_relationships', $object_id, $tt_ids, $taxonomy );\n\n\t\t$deleted = $wpdb->query( $wpdb->prepare( \"DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_tt_ids)\", $object_id ) );\n\n\t\twp_cache_delete( $object_id, $taxonomy . '_relationships' );\n\t\twp_cache_delete( 'last_changed', 'terms' );\n\n\t\t/**\n\t\t * Fires immediately after an object-term relationship is deleted.\n\t\t *\n\t\t * @since 2.9.0\n\t\t * @since 4.7.0 Added the `$taxonomy` parameter.\n\t\t *\n\t\t * @param int    $object_id Object ID.\n\t\t * @param array  $tt_ids    An array of term taxonomy IDs.\n\t\t * @param string $taxonomy  Taxonomy slug.\n\t\t */\n\t\tdo_action( 'deleted_term_relationships', $object_id, $tt_ids, $taxonomy );\n\n\t\twp_update_term_count( $tt_ids, $taxonomy );\n\n\t\treturn (bool) $deleted;\n\t}\n\n\treturn false;\n}\n\n/**\n * Will make slug unique, if it isn't already.\n *\n * The `$slug` has to be unique global to every taxonomy, meaning that one\n * taxonomy term can't have a matching slug with another taxonomy term. Each\n * slug has to be globally unique for every taxonomy.\n *\n * The way this works is that if the taxonomy that the term belongs to is\n * hierarchical and has a parent, it will append that parent to the $slug.\n *\n * If that still doesn't return a unique slug, then it tries to append a number\n * until it finds a number that is truly unique.\n *\n * The only purpose for `$term` is for appending a parent, if one exists.\n *\n * @since 2.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $slug The string that will be tried for a unique slug.\n * @param object $term The term object that the `$slug` will belong to.\n * @return string Will return a true unique slug.\n */\nfunction wp_unique_term_slug( $slug, $term ) {\n\tglobal $wpdb;\n\n\t$needs_suffix  = true;\n\t$original_slug = $slug;\n\n\t// As of 4.1, duplicate slugs are allowed as long as they're in different taxonomies.\n\tif ( ! term_exists( $slug ) || get_option( 'db_version' ) >= 30133 && ! get_term_by( 'slug', $slug, $term->taxonomy ) ) {\n\t\t$needs_suffix = false;\n\t}\n\n\t/*\n\t * If the taxonomy supports hierarchy and the term has a parent, make the slug unique\n\t * by incorporating parent slugs.\n\t */\n\t$parent_suffix = '';\n\tif ( $needs_suffix && is_taxonomy_hierarchical( $term->taxonomy ) && ! empty( $term->parent ) ) {\n\t\t$the_parent = $term->parent;\n\t\twhile ( ! empty( $the_parent ) ) {\n\t\t\t$parent_term = get_term( $the_parent, $term->taxonomy );\n\t\t\tif ( is_wp_error( $parent_term ) || empty( $parent_term ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$parent_suffix .= '-' . $parent_term->slug;\n\t\t\tif ( ! term_exists( $slug . $parent_suffix ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( empty( $parent_term->parent ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$the_parent = $parent_term->parent;\n\t\t}\n\t}\n\n\t// If we didn't get a unique slug, try appending a number to make it unique.\n\n\t/**\n\t * Filters whether the proposed unique term slug is bad.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param bool   $needs_suffix Whether the slug needs to be made unique with a suffix.\n\t * @param string $slug         The slug.\n\t * @param object $term         Term object.\n\t */\n\tif ( apply_filters( 'wp_unique_term_slug_is_bad_slug', $needs_suffix, $slug, $term ) ) {\n\t\tif ( $parent_suffix ) {\n\t\t\t$slug .= $parent_suffix;\n\t\t}\n\n\t\tif ( ! empty( $term->term_id ) ) {\n\t\t\t$query = $wpdb->prepare( \"SELECT slug FROM $wpdb->terms WHERE slug = %s AND term_id != %d\", $slug, $term->term_id );\n\t\t} else {\n\t\t\t$query = $wpdb->prepare( \"SELECT slug FROM $wpdb->terms WHERE slug = %s\", $slug );\n\t\t}\n\n\t\tif ( $wpdb->get_var( $query ) ) { // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t\t\t$num = 2;\n\t\t\tdo {\n\t\t\t\t$alt_slug = $slug . \"-$num\";\n\t\t\t\t$num++;\n\t\t\t\t$slug_check = $wpdb->get_var( $wpdb->prepare( \"SELECT slug FROM $wpdb->terms WHERE slug = %s\", $alt_slug ) );\n\t\t\t} while ( $slug_check );\n\t\t\t$slug = $alt_slug;\n\t\t}\n\t}\n\n\t/**\n\t * Filters the unique term slug.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param string $slug          Unique term slug.\n\t * @param object $term          Term object.\n\t * @param string $original_slug Slug originally passed to the function for testing.\n\t */\n\treturn apply_filters( 'wp_unique_term_slug', $slug, $term, $original_slug );\n}\n\n/**\n * Update term based on arguments provided.\n *\n * The `$args` will indiscriminately override all values with the same field name.\n * Care must be taken to not override important information need to update or\n * update will fail (or perhaps create a new term, neither would be acceptable).\n *\n * Defaults will set 'alias_of', 'description', 'parent', and 'slug' if not\n * defined in `$args` already.\n *\n * 'alias_of' will create a term group, if it doesn't already exist, and\n * update it for the `$term`.\n *\n * If the 'slug' argument in `$args` is missing, then the 'name' will be used.\n * If you set 'slug' and it isn't unique, then a WP_Error is returned.\n * If you don't pass any slug, then a unique one will be created.\n *\n * @since 2.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int          $term_id  The ID of the term.\n * @param string       $taxonomy The taxonomy of the term.\n * @param array|string $args {\n *     Optional. Array or string of arguments for updating a term.\n *\n *     @type string $alias_of    Slug of the term to make this term an alias of.\n *                               Default empty string. Accepts a term slug.\n *     @type string $description The term description. Default empty string.\n *     @type int    $parent      The id of the parent term. Default 0.\n *     @type string $slug        The term slug to use. Default empty string.\n * }\n * @return array|WP_Error An array containing the `term_id` and `term_taxonomy_id`,\n *                        WP_Error otherwise.\n */\nfunction wp_update_term( $term_id, $taxonomy, $args = array() ) {\n\tglobal $wpdb;\n\n\tif ( ! taxonomy_exists( $taxonomy ) ) {\n\t\treturn new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );\n\t}\n\n\t$term_id = (int) $term_id;\n\n\t// First, get all of the original args.\n\t$term = get_term( $term_id, $taxonomy );\n\n\tif ( is_wp_error( $term ) ) {\n\t\treturn $term;\n\t}\n\n\tif ( ! $term ) {\n\t\treturn new WP_Error( 'invalid_term', __( 'Empty Term.' ) );\n\t}\n\n\t$term = (array) $term->data;\n\n\t// Escape data pulled from DB.\n\t$term = wp_slash( $term );\n\n\t// Merge old and new args with new args overwriting old ones.\n\t$args = array_merge( $term, $args );\n\n\t$defaults    = array(\n\t\t'alias_of'    => '',\n\t\t'description' => '',\n\t\t'parent'      => 0,\n\t\t'slug'        => '',\n\t);\n\t$args        = wp_parse_args( $args, $defaults );\n\t$args        = sanitize_term( $args, $taxonomy, 'db' );\n\t$parsed_args = $args;\n\n\t// expected_slashed ($name)\n\t$name        = wp_unslash( $args['name'] );\n\t$description = wp_unslash( $args['description'] );\n\n\t$parsed_args['name']        = $name;\n\t$parsed_args['description'] = $description;\n\n\tif ( '' === trim( $name ) ) {\n\t\treturn new WP_Error( 'empty_term_name', __( 'A name is required for this term.' ) );\n\t}\n\n\tif ( $parsed_args['parent'] > 0 && ! term_exists( (int) $parsed_args['parent'] ) ) {\n\t\treturn new WP_Error( 'missing_parent', __( 'Parent term does not exist.' ) );\n\t}\n\n\t$empty_slug = false;\n\tif ( empty( $args['slug'] ) ) {\n\t\t$empty_slug = true;\n\t\t$slug       = sanitize_title( $name );\n\t} else {\n\t\t$slug = $args['slug'];\n\t}\n\n\t$parsed_args['slug'] = $slug;\n\n\t$term_group = isset( $parsed_args['term_group'] ) ? $parsed_args['term_group'] : 0;\n\tif ( $args['alias_of'] ) {\n\t\t$alias = get_term_by( 'slug', $args['alias_of'], $taxonomy );\n\t\tif ( ! empty( $alias->term_group ) ) {\n\t\t\t// The alias we want is already in a group, so let's use that one.\n\t\t\t$term_group = $alias->term_group;\n\t\t} elseif ( ! empty( $alias->term_id ) ) {\n\t\t\t/*\n\t\t\t * The alias is not in a group, so we create a new one\n\t\t\t * and add the alias to it.\n\t\t\t */\n\t\t\t$term_group = $wpdb->get_var( \"SELECT MAX(term_group) FROM $wpdb->terms\" ) + 1;\n\n\t\t\twp_update_term(\n\t\t\t\t$alias->term_id,\n\t\t\t\t$taxonomy,\n\t\t\t\tarray(\n\t\t\t\t\t'term_group' => $term_group,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$parsed_args['term_group'] = $term_group;\n\t}\n\n\t/**\n\t * Filters the term parent.\n\t *\n\t * Hook to this filter to see if it will cause a hierarchy loop.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param int    $parent      ID of the parent term.\n\t * @param int    $term_id     Term ID.\n\t * @param string $taxonomy    Taxonomy slug.\n\t * @param array  $parsed_args An array of potentially altered update arguments for the given term.\n\t * @param array  $args        An array of update arguments for the given term.\n\t */\n\t$parent = (int) apply_filters( 'wp_update_term_parent', $args['parent'], $term_id, $taxonomy, $parsed_args, $args );\n\n\t// Check for duplicate slug.\n\t$duplicate = get_term_by( 'slug', $slug, $taxonomy );\n\tif ( $duplicate && $duplicate->term_id !== $term_id ) {\n\t\t// If an empty slug was passed or the parent changed, reset the slug to something unique.\n\t\t// Otherwise, bail.\n\t\tif ( $empty_slug || ( $parent !== (int) $term['parent'] ) ) {\n\t\t\t$slug = wp_unique_term_slug( $slug, (object) $args );\n\t\t} else {\n\t\t\t/* translators: %s: Taxonomy term slug. */\n\t\t\treturn new WP_Error( 'duplicate_term_slug', sprintf( __( 'The slug &#8220;%s&#8221; is already in use by another term.' ), $slug ) );\n\t\t}\n\t}\n\n\t$tt_id = (int) $wpdb->get_var( $wpdb->prepare( \"SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id = %d\", $taxonomy, $term_id ) );\n\n\t// Check whether this is a shared term that needs splitting.\n\t$_term_id = _split_shared_term( $term_id, $tt_id );\n\tif ( ! is_wp_error( $_term_id ) ) {\n\t\t$term_id = $_term_id;\n\t}\n\n\t/**\n\t * Fires immediately before the given terms are edited.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param int    $term_id  Term ID.\n\t * @param string $taxonomy Taxonomy slug.\n\t */\n\tdo_action( 'edit_terms', $term_id, $taxonomy );\n\n\t$data = compact( 'name', 'slug', 'term_group' );\n\n\t/**\n\t * Filters term data before it is updated in the database.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array  $data     Term data to be updated.\n\t * @param int    $term_id  Term ID.\n\t * @param string $taxonomy Taxonomy slug.\n\t * @param array  $args     Arguments passed to wp_update_term().\n\t */\n\t$data = apply_filters( 'wp_update_term_data', $data, $term_id, $taxonomy, $args );\n\n\t$wpdb->update( $wpdb->terms, $data, compact( 'term_id' ) );\n\n\tif ( empty( $slug ) ) {\n\t\t$slug = sanitize_title( $name, $term_id );\n\t\t$wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) );\n\t}\n\n\t/**\n\t * Fires immediately after the given terms are edited.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param int    $term_id  Term ID\n\t * @param string $taxonomy Taxonomy slug.\n\t */\n\tdo_action( 'edited_terms', $term_id, $taxonomy );\n\n\t/**\n\t * Fires immediate before a term-taxonomy relationship is updated.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param int    $tt_id    Term taxonomy ID.\n\t * @param string $taxonomy Taxonomy slug.\n\t */\n\tdo_action( 'edit_term_taxonomy', $tt_id, $taxonomy );\n\n\t$wpdb->update( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent' ), array( 'term_taxonomy_id' => $tt_id ) );\n\n\t/**\n\t * Fires immediately after a term-taxonomy relationship is updated.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param int    $tt_id    Term taxonomy ID.\n\t * @param string $taxonomy Taxonomy slug.\n\t */\n\tdo_action( 'edited_term_taxonomy', $tt_id, $taxonomy );\n\n\t/**\n\t * Fires after a term has been updated, but before the term cache has been cleaned.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param int    $term_id  Term ID.\n\t * @param int    $tt_id    Term taxonomy ID.\n\t * @param string $taxonomy Taxonomy slug.\n\t */\n\tdo_action( 'edit_term', $term_id, $tt_id, $taxonomy );\n\n\t/**\n\t * Fires after a term in a specific taxonomy has been updated, but before the term\n\t * cache has been cleaned.\n\t *\n\t * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param int $term_id Term ID.\n\t * @param int $tt_id   Term taxonomy ID.\n\t */\n\tdo_action( \"edit_{$taxonomy}\", $term_id, $tt_id );\n\n\t/** This filter is documented in wp-includes/taxonomy.php */\n\t$term_id = apply_filters( 'term_id_filter', $term_id, $tt_id );\n\n\tclean_term_cache( $term_id, $taxonomy );\n\n\t/**\n\t * Fires after a term has been updated, and the term cache has been cleaned.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param int    $term_id  Term ID.\n\t * @param int    $tt_id    Term taxonomy ID.\n\t * @param string $taxonomy Taxonomy slug.\n\t */\n\tdo_action( 'edited_term', $term_id, $tt_id, $taxonomy );\n\n\t/**\n\t * Fires after a term for a specific taxonomy has been updated, and the term\n\t * cache has been cleaned.\n\t *\n\t * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param int $term_id Term ID.\n\t * @param int $tt_id   Term taxonomy ID.\n\t */\n\tdo_action( \"edited_{$taxonomy}\", $term_id, $tt_id );\n\n\t/** This action is documented in wp-includes/taxonomy.php */\n\tdo_action( 'saved_term', $term_id, $tt_id, $taxonomy, true );\n\n\t/** This action is documented in wp-includes/taxonomy.php */\n\tdo_action( \"saved_{$taxonomy}\", $term_id, $tt_id, true );\n\n\treturn array(\n\t\t'term_id'          => $term_id,\n\t\t'term_taxonomy_id' => $tt_id,\n\t);\n}\n\n/**\n * Enable or disable term counting.\n *\n * @since 2.5.0\n *\n * @param bool $defer Optional. Enable if true, disable if false.\n * @return bool Whether term counting is enabled or disabled.\n */\nfunction wp_defer_term_counting( $defer = null ) {\n\tstatic $_defer = false;\n\n\tif ( is_bool( $defer ) ) {\n\t\t$_defer = $defer;\n\t\t// Flush any deferred counts.\n\t\tif ( ! $defer ) {\n\t\t\twp_update_term_count( null, null, true );\n\t\t}\n\t}\n\n\treturn $_defer;\n}\n\n/**\n * Updates the amount of terms in taxonomy.\n *\n * If there is a taxonomy callback applied, then it will be called for updating\n * the count.\n *\n * The default action is to count what the amount of terms have the relationship\n * of term ID. Once that is done, then update the database.\n *\n * @since 2.3.0\n *\n * @param int|array $terms       The term_taxonomy_id of the terms.\n * @param string    $taxonomy    The context of the term.\n * @param bool      $do_deferred Whether to flush the deferred term counts too. Default false.\n * @return bool If no terms will return false, and if successful will return true.\n */\nfunction wp_update_term_count( $terms, $taxonomy, $do_deferred = false ) {\n\tstatic $_deferred = array();\n\n\tif ( $do_deferred ) {\n\t\tforeach ( (array) array_keys( $_deferred ) as $tax ) {\n\t\t\twp_update_term_count_now( $_deferred[ $tax ], $tax );\n\t\t\tunset( $_deferred[ $tax ] );\n\t\t}\n\t}\n\n\tif ( empty( $terms ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! is_array( $terms ) ) {\n\t\t$terms = array( $terms );\n\t}\n\n\tif ( wp_defer_term_counting() ) {\n\t\tif ( ! isset( $_deferred[ $taxonomy ] ) ) {\n\t\t\t$_deferred[ $taxonomy ] = array();\n\t\t}\n\t\t$_deferred[ $taxonomy ] = array_unique( array_merge( $_deferred[ $taxonomy ], $terms ) );\n\t\treturn true;\n\t}\n\n\treturn wp_update_term_count_now( $terms, $taxonomy );\n}\n\n/**\n * Perform term count update immediately.\n *\n * @since 2.5.0\n *\n * @param array  $terms    The term_taxonomy_id of terms to update.\n * @param string $taxonomy The context of the term.\n * @return true Always true when complete.\n */\nfunction wp_update_term_count_now( $terms, $taxonomy ) {\n\t$terms = array_map( 'intval', $terms );\n\n\t$taxonomy = get_taxonomy( $taxonomy );\n\tif ( ! empty( $taxonomy->update_count_callback ) ) {\n\t\tcall_user_func( $taxonomy->update_count_callback, $terms, $taxonomy );\n\t} else {\n\t\t$object_types = (array) $taxonomy->object_type;\n\t\tforeach ( $object_types as &$object_type ) {\n\t\t\tif ( 0 === strpos( $object_type, 'attachment:' ) ) {\n\t\t\t\tlist( $object_type ) = explode( ':', $object_type );\n\t\t\t}\n\t\t}\n\n\t\tif ( array_filter( $object_types, 'post_type_exists' ) == $object_types ) {\n\t\t\t// Only post types are attached to this taxonomy.\n\t\t\t_update_post_term_count( $terms, $taxonomy );\n\t\t} else {\n\t\t\t// Default count updater.\n\t\t\t_update_generic_term_count( $terms, $taxonomy );\n\t\t}\n\t}\n\n\tclean_term_cache( $terms, '', false );\n\n\treturn true;\n}\n\n//\n// Cache.\n//\n\n/**\n * Removes the taxonomy relationship to terms from the cache.\n *\n * Will remove the entire taxonomy relationship containing term `$object_id`. The\n * term IDs have to exist within the taxonomy `$object_type` for the deletion to\n * take place.\n *\n * @since 2.3.0\n *\n * @global bool $_wp_suspend_cache_invalidation\n *\n * @see get_object_taxonomies() for more on $object_type.\n *\n * @param int|array    $object_ids  Single or list of term object ID(s).\n * @param array|string $object_type The taxonomy object type.\n */\nfunction clean_object_term_cache( $object_ids, $object_type ) {\n\tglobal $_wp_suspend_cache_invalidation;\n\n\tif ( ! empty( $_wp_suspend_cache_invalidation ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! is_array( $object_ids ) ) {\n\t\t$object_ids = array( $object_ids );\n\t}\n\n\t$taxonomies = get_object_taxonomies( $object_type );\n\n\tforeach ( $object_ids as $id ) {\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\twp_cache_delete( $id, \"{$taxonomy}_relationships\" );\n\t\t}\n\t}\n\n\t/**\n\t * Fires after the object term cache has been cleaned.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param array  $object_ids An array of object IDs.\n\t * @param string $object_type Object type.\n\t */\n\tdo_action( 'clean_object_term_cache', $object_ids, $object_type );\n}\n\n/**\n * Will remove all of the term IDs from the cache.\n *\n * @since 2.3.0\n *\n * @global wpdb $wpdb                           WordPress database abstraction object.\n * @global bool $_wp_suspend_cache_invalidation\n *\n * @param int|int[] $ids            Single or array of term IDs.\n * @param string    $taxonomy       Optional. Taxonomy slug. Can be empty, in which case the taxonomies of the passed\n *                                  term IDs will be used. Default empty.\n * @param bool      $clean_taxonomy Optional. Whether to clean taxonomy wide caches (true), or just individual\n *                                  term object caches (false). Default true.\n */\nfunction clean_term_cache( $ids, $taxonomy = '', $clean_taxonomy = true ) {\n\tglobal $wpdb, $_wp_suspend_cache_invalidation;\n\n\tif ( ! empty( $_wp_suspend_cache_invalidation ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! is_array( $ids ) ) {\n\t\t$ids = array( $ids );\n\t}\n\n\t$taxonomies = array();\n\t// If no taxonomy, assume tt_ids.\n\tif ( empty( $taxonomy ) ) {\n\t\t$tt_ids = array_map( 'intval', $ids );\n\t\t$tt_ids = implode( ', ', $tt_ids );\n\t\t$terms  = $wpdb->get_results( \"SELECT term_id, taxonomy FROM $wpdb->term_taxonomy WHERE term_taxonomy_id IN ($tt_ids)\" );\n\t\t$ids    = array();\n\n\t\tforeach ( (array) $terms as $term ) {\n\t\t\t$taxonomies[] = $term->taxonomy;\n\t\t\t$ids[]        = $term->term_id;\n\t\t\twp_cache_delete( $term->term_id, 'terms' );\n\t\t}\n\n\t\t$taxonomies = array_unique( $taxonomies );\n\t} else {\n\t\t$taxonomies = array( $taxonomy );\n\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\tforeach ( $ids as $id ) {\n\t\t\t\twp_cache_delete( $id, 'terms' );\n\t\t\t}\n\t\t}\n\t}\n\n\tforeach ( $taxonomies as $taxonomy ) {\n\t\tif ( $clean_taxonomy ) {\n\t\t\tclean_taxonomy_cache( $taxonomy );\n\t\t}\n\n\t\t/**\n\t\t * Fires once after each taxonomy's term cache has been cleaned.\n\t\t *\n\t\t * @since 2.5.0\n\t\t * @since 4.5.0 Added the `$clean_taxonomy` parameter.\n\t\t *\n\t\t * @param array  $ids            An array of term IDs.\n\t\t * @param string $taxonomy       Taxonomy slug.\n\t\t * @param bool   $clean_taxonomy Whether or not to clean taxonomy-wide caches\n\t\t */\n\t\tdo_action( 'clean_term_cache', $ids, $taxonomy, $clean_taxonomy );\n\t}\n\n\twp_cache_set( 'last_changed', microtime(), 'terms' );\n}\n\n/**\n * Clean the caches for a taxonomy.\n *\n * @since 4.9.0\n *\n * @param string $taxonomy Taxonomy slug.\n */\nfunction clean_taxonomy_cache( $taxonomy ) {\n\twp_cache_delete( 'all_ids', $taxonomy );\n\twp_cache_delete( 'get', $taxonomy );\n\n\t// Regenerate cached hierarchy.\n\tdelete_option( \"{$taxonomy}_children\" );\n\t_get_term_hierarchy( $taxonomy );\n\n\t/**\n\t * Fires after a taxonomy's caches have been cleaned.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param string $taxonomy Taxonomy slug.\n\t */\n\tdo_action( 'clean_taxonomy_cache', $taxonomy );\n}\n\n/**\n * Retrieves the cached term objects for the given object ID.\n *\n * Upstream functions (like get_the_terms() and is_object_in_term()) are\n * responsible for populating the object-term relationship cache. The current\n * function only fetches relationship data that is already in the cache.\n *\n * @since 2.3.0\n * @since 4.7.0 Returns a `WP_Error` object if there's an error with\n *              any of the matched terms.\n *\n * @param int    $id       Term object ID, for example a post, comment, or user ID.\n * @param string $taxonomy Taxonomy name.\n * @return bool|WP_Term[]|WP_Error Array of `WP_Term` objects, if cached.\n *                                 False if cache is empty for `$taxonomy` and `$id`.\n *                                 WP_Error if get_term() returns an error object for any term.\n */\nfunction get_object_term_cache( $id, $taxonomy ) {\n\t$_term_ids = wp_cache_get( $id, \"{$taxonomy}_relationships\" );\n\n\t// We leave the priming of relationship caches to upstream functions.\n\tif ( false === $_term_ids ) {\n\t\treturn false;\n\t}\n\n\t// Backward compatibility for if a plugin is putting objects into the cache, rather than IDs.\n\t$term_ids = array();\n\tforeach ( $_term_ids as $term_id ) {\n\t\tif ( is_numeric( $term_id ) ) {\n\t\t\t$term_ids[] = intval( $term_id );\n\t\t} elseif ( isset( $term_id->term_id ) ) {\n\t\t\t$term_ids[] = intval( $term_id->term_id );\n\t\t}\n\t}\n\n\t// Fill the term objects.\n\t_prime_term_caches( $term_ids );\n\n\t$terms = array();\n\tforeach ( $term_ids as $term_id ) {\n\t\t$term = get_term( $term_id, $taxonomy );\n\t\tif ( is_wp_error( $term ) ) {\n\t\t\treturn $term;\n\t\t}\n\n\t\t$terms[] = $term;\n\t}\n\n\treturn $terms;\n}\n\n/**\n * Updates the cache for the given term object ID(s).\n *\n * Note: Due to performance concerns, great care should be taken to only update\n * term caches when necessary. Processing time can increase exponentially depending\n * on both the number of passed term IDs and the number of taxonomies those terms\n * belong to.\n *\n * Caches will only be updated for terms not already cached.\n *\n * @since 2.3.0\n *\n * @param string|int[]    $object_ids  Comma-separated list or array of term object IDs.\n * @param string|string[] $object_type The taxonomy object type or array of the same.\n * @return void|false False if all of the terms in `$object_ids` are already cached.\n */\nfunction update_object_term_cache( $object_ids, $object_type ) {\n\tif ( empty( $object_ids ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! is_array( $object_ids ) ) {\n\t\t$object_ids = explode( ',', $object_ids );\n\t}\n\n\t$object_ids     = array_map( 'intval', $object_ids );\n\t$non_cached_ids = array();\n\n\t$taxonomies = get_object_taxonomies( $object_type );\n\n\tforeach ( $taxonomies as $taxonomy ) {\n\t\t$cache_values = wp_cache_get_multiple( (array) $object_ids, \"{$taxonomy}_relationships\" );\n\n\t\tforeach ( $cache_values as $id => $value ) {\n\t\t\tif ( false === $value ) {\n\t\t\t\t$non_cached_ids[] = $id;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( empty( $non_cached_ids ) ) {\n\t\treturn false;\n\t}\n\n\t$non_cached_ids = array_unique( $non_cached_ids );\n\n\t$terms = wp_get_object_terms(\n\t\t$non_cached_ids,\n\t\t$taxonomies,\n\t\tarray(\n\t\t\t'fields'                 => 'all_with_object_id',\n\t\t\t'orderby'                => 'name',\n\t\t\t'update_term_meta_cache' => false,\n\t\t)\n\t);\n\n\t$object_terms = array();\n\tforeach ( (array) $terms as $term ) {\n\t\t$object_terms[ $term->object_id ][ $term->taxonomy ][] = $term->term_id;\n\t}\n\n\tforeach ( $non_cached_ids as $id ) {\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\tif ( ! isset( $object_terms[ $id ][ $taxonomy ] ) ) {\n\t\t\t\tif ( ! isset( $object_terms[ $id ] ) ) {\n\t\t\t\t\t$object_terms[ $id ] = array();\n\t\t\t\t}\n\t\t\t\t$object_terms[ $id ][ $taxonomy ] = array();\n\t\t\t}\n\t\t}\n\t}\n\n\tforeach ( $object_terms as $id => $value ) {\n\t\tforeach ( $value as $taxonomy => $terms ) {\n\t\t\twp_cache_add( $id, $terms, \"{$taxonomy}_relationships\" );\n\t\t}\n\t}\n}\n\n/**\n * Updates Terms to Taxonomy in cache.\n *\n * @since 2.3.0\n *\n * @param WP_Term[] $terms    Array of term objects to change.\n * @param string    $taxonomy Not used.\n */\nfunction update_term_cache( $terms, $taxonomy = '' ) {\n\tforeach ( (array) $terms as $term ) {\n\t\t// Create a copy in case the array was passed by reference.\n\t\t$_term = clone $term;\n\n\t\t// Object ID should not be cached.\n\t\tunset( $_term->object_id );\n\n\t\twp_cache_add( $term->term_id, $_term, 'terms' );\n\t}\n}\n\n//\n// Private.\n//\n\n/**\n * Retrieves children of taxonomy as Term IDs.\n *\n * @access private\n * @since 2.3.0\n *\n * @param string $taxonomy Taxonomy name.\n * @return array Empty if $taxonomy isn't hierarchical or returns children as Term IDs.\n */\nfunction _get_term_hierarchy( $taxonomy ) {\n\tif ( ! is_taxonomy_hierarchical( $taxonomy ) ) {\n\t\treturn array();\n\t}\n\t$children = get_option( \"{$taxonomy}_children\" );\n\n\tif ( is_array( $children ) ) {\n\t\treturn $children;\n\t}\n\t$children = array();\n\t$terms    = get_terms(\n\t\tarray(\n\t\t\t'taxonomy'               => $taxonomy,\n\t\t\t'get'                    => 'all',\n\t\t\t'orderby'                => 'id',\n\t\t\t'fields'                 => 'id=>parent',\n\t\t\t'update_term_meta_cache' => false,\n\t\t)\n\t);\n\tforeach ( $terms as $term_id => $parent ) {\n\t\tif ( $parent > 0 ) {\n\t\t\t$children[ $parent ][] = $term_id;\n\t\t}\n\t}\n\tupdate_option( \"{$taxonomy}_children\", $children );\n\n\treturn $children;\n}\n\n/**\n * Get the subset of $terms that are descendants of $term_id.\n *\n * If `$terms` is an array of objects, then _get_term_children() returns an array of objects.\n * If `$terms` is an array of IDs, then _get_term_children() returns an array of IDs.\n *\n * @access private\n * @since 2.3.0\n *\n * @param int    $term_id   The ancestor term: all returned terms should be descendants of `$term_id`.\n * @param array  $terms     The set of terms - either an array of term objects or term IDs - from which those that\n *                          are descendants of $term_id will be chosen.\n * @param string $taxonomy  The taxonomy which determines the hierarchy of the terms.\n * @param array  $ancestors Optional. Term ancestors that have already been identified. Passed by reference, to keep\n *                          track of found terms when recursing the hierarchy. The array of located ancestors is used\n *                          to prevent infinite recursion loops. For performance, `term_ids` are used as array keys,\n *                          with 1 as value. Default empty array.\n * @return array|WP_Error The subset of $terms that are descendants of $term_id.\n */\nfunction _get_term_children( $term_id, $terms, $taxonomy, &$ancestors = array() ) {\n\t$empty_array = array();\n\tif ( empty( $terms ) ) {\n\t\treturn $empty_array;\n\t}\n\n\t$term_id      = (int) $term_id;\n\t$term_list    = array();\n\t$has_children = _get_term_hierarchy( $taxonomy );\n\n\tif ( $term_id && ! isset( $has_children[ $term_id ] ) ) {\n\t\treturn $empty_array;\n\t}\n\n\t// Include the term itself in the ancestors array, so we can properly detect when a loop has occurred.\n\tif ( empty( $ancestors ) ) {\n\t\t$ancestors[ $term_id ] = 1;\n\t}\n\n\tforeach ( (array) $terms as $term ) {\n\t\t$use_id = false;\n\t\tif ( ! is_object( $term ) ) {\n\t\t\t$term = get_term( $term, $taxonomy );\n\t\t\tif ( is_wp_error( $term ) ) {\n\t\t\t\treturn $term;\n\t\t\t}\n\t\t\t$use_id = true;\n\t\t}\n\n\t\t// Don't recurse if we've already identified the term as a child - this indicates a loop.\n\t\tif ( isset( $ancestors[ $term->term_id ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( (int) $term->parent === $term_id ) {\n\t\t\tif ( $use_id ) {\n\t\t\t\t$term_list[] = $term->term_id;\n\t\t\t} else {\n\t\t\t\t$term_list[] = $term;\n\t\t\t}\n\n\t\t\tif ( ! isset( $has_children[ $term->term_id ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$ancestors[ $term->term_id ] = 1;\n\n\t\t\t$children = _get_term_children( $term->term_id, $terms, $taxonomy, $ancestors );\n\t\t\tif ( $children ) {\n\t\t\t\t$term_list = array_merge( $term_list, $children );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $term_list;\n}\n\n/**\n * Add count of children to parent count.\n *\n * Recalculates term counts by including items from child terms. Assumes all\n * relevant children are already in the $terms argument.\n *\n * @access private\n * @since 2.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param array  $terms    List of term objects (passed by reference).\n * @param string $taxonomy Term context.\n */\nfunction _pad_term_counts( &$terms, $taxonomy ) {\n\tglobal $wpdb;\n\n\t// This function only works for hierarchical taxonomies like post categories.\n\tif ( ! is_taxonomy_hierarchical( $taxonomy ) ) {\n\t\treturn;\n\t}\n\n\t$term_hier = _get_term_hierarchy( $taxonomy );\n\n\tif ( empty( $term_hier ) ) {\n\t\treturn;\n\t}\n\n\t$term_items  = array();\n\t$terms_by_id = array();\n\t$term_ids    = array();\n\n\tforeach ( (array) $terms as $key => $term ) {\n\t\t$terms_by_id[ $term->term_id ]       = & $terms[ $key ];\n\t\t$term_ids[ $term->term_taxonomy_id ] = $term->term_id;\n\t}\n\n\t// Get the object and term IDs and stick them in a lookup table.\n\t$tax_obj      = get_taxonomy( $taxonomy );\n\t$object_types = esc_sql( $tax_obj->object_type );\n\t$results      = $wpdb->get_results( \"SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships INNER JOIN $wpdb->posts ON object_id = ID WHERE term_taxonomy_id IN (\" . implode( ',', array_keys( $term_ids ) ) . \") AND post_type IN ('\" . implode( \"', '\", $object_types ) . \"') AND post_status = 'publish'\" );\n\n\tforeach ( $results as $row ) {\n\t\t$id = $term_ids[ $row->term_taxonomy_id ];\n\n\t\t$term_items[ $id ][ $row->object_id ] = isset( $term_items[ $id ][ $row->object_id ] ) ? ++$term_items[ $id ][ $row->object_id ] : 1;\n\t}\n\n\t// Touch every ancestor's lookup row for each post in each term.\n\tforeach ( $term_ids as $term_id ) {\n\t\t$child     = $term_id;\n\t\t$ancestors = array();\n\t\twhile ( ! empty( $terms_by_id[ $child ] ) && $parent = $terms_by_id[ $child ]->parent ) {\n\t\t\t$ancestors[] = $child;\n\n\t\t\tif ( ! empty( $term_items[ $term_id ] ) ) {\n\t\t\t\tforeach ( $term_items[ $term_id ] as $item_id => $touches ) {\n\t\t\t\t\t$term_items[ $parent ][ $item_id ] = isset( $term_items[ $parent ][ $item_id ] ) ? ++$term_items[ $parent ][ $item_id ] : 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$child = $parent;\n\n\t\t\tif ( in_array( $parent, $ancestors, true ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Transfer the touched cells.\n\tforeach ( (array) $term_items as $id => $items ) {\n\t\tif ( isset( $terms_by_id[ $id ] ) ) {\n\t\t\t$terms_by_id[ $id ]->count = count( $items );\n\t\t}\n\t}\n}\n\n/**\n * Adds any terms from the given IDs to the cache that do not already exist in cache.\n *\n * @since 4.6.0\n * @access private\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param array $term_ids          Array of term IDs.\n * @param bool  $update_meta_cache Optional. Whether to update the meta cache. Default true.\n */\nfunction _prime_term_caches( $term_ids, $update_meta_cache = true ) {\n\tglobal $wpdb;\n\n\t$non_cached_ids = _get_non_cached_ids( $term_ids, 'terms' );\n\tif ( ! empty( $non_cached_ids ) ) {\n\t\t$fresh_terms = $wpdb->get_results( sprintf( \"SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE t.term_id IN (%s)\", join( ',', array_map( 'intval', $non_cached_ids ) ) ) );\n\n\t\tupdate_term_cache( $fresh_terms, $update_meta_cache );\n\n\t\tif ( $update_meta_cache ) {\n\t\t\tupdate_termmeta_cache( $non_cached_ids );\n\t\t}\n\t}\n}\n\n//\n// Default callbacks.\n//\n\n/**\n * Will update term count based on object types of the current taxonomy.\n *\n * Private function for the default callback for post_tag and category\n * taxonomies.\n *\n * @access private\n * @since 2.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int[]       $terms    List of Term taxonomy IDs.\n * @param WP_Taxonomy $taxonomy Current taxonomy object of terms.\n */\nfunction _update_post_term_count( $terms, $taxonomy ) {\n\tglobal $wpdb;\n\n\t$object_types = (array) $taxonomy->object_type;\n\n\tforeach ( $object_types as &$object_type ) {\n\t\tlist( $object_type ) = explode( ':', $object_type );\n\t}\n\n\t$object_types = array_unique( $object_types );\n\n\t$check_attachments = array_search( 'attachment', $object_types, true );\n\tif ( false !== $check_attachments ) {\n\t\tunset( $object_types[ $check_attachments ] );\n\t\t$check_attachments = true;\n\t}\n\n\tif ( $object_types ) {\n\t\t$object_types = esc_sql( array_filter( $object_types, 'post_type_exists' ) );\n\t}\n\n\tforeach ( (array) $terms as $term ) {\n\t\t$count = 0;\n\n\t\t// Attachments can be 'inherit' status, we need to base count off the parent's status if so.\n\t\tif ( $check_attachments ) {\n\t\t\t$count += (int) $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts p1 WHERE p1.ID = $wpdb->term_relationships.object_id AND ( post_status = 'publish' OR ( post_status = 'inherit' AND post_parent > 0 AND ( SELECT post_status FROM $wpdb->posts WHERE ID = p1.post_parent ) = 'publish' ) ) AND post_type = 'attachment' AND term_taxonomy_id = %d\", $term ) );\n\t\t}\n\n\t\tif ( $object_types ) {\n\t\t\t// phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.QuotedDynamicPlaceholderGeneration\n\t\t\t$count += (int) $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type IN ('\" . implode( \"', '\", $object_types ) . \"') AND term_taxonomy_id = %d\", $term ) );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/taxonomy.php */\n\t\tdo_action( 'edit_term_taxonomy', $term, $taxonomy->name );\n\t\t$wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) );\n\n\t\t/** This action is documented in wp-includes/taxonomy.php */\n\t\tdo_action( 'edited_term_taxonomy', $term, $taxonomy->name );\n\t}\n}\n\n/**\n * Will update term count based on number of objects.\n *\n * Default callback for the 'link_category' taxonomy.\n *\n * @since 3.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int[]       $terms    List of term taxonomy IDs.\n * @param WP_Taxonomy $taxonomy Current taxonomy object of terms.\n */\nfunction _update_generic_term_count( $terms, $taxonomy ) {\n\tglobal $wpdb;\n\n\tforeach ( (array) $terms as $term ) {\n\t\t$count = $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d\", $term ) );\n\n\t\t/** This action is documented in wp-includes/taxonomy.php */\n\t\tdo_action( 'edit_term_taxonomy', $term, $taxonomy->name );\n\t\t$wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) );\n\n\t\t/** This action is documented in wp-includes/taxonomy.php */\n\t\tdo_action( 'edited_term_taxonomy', $term, $taxonomy->name );\n\t}\n}\n\n/**\n * Create a new term for a term_taxonomy item that currently shares its term\n * with another term_taxonomy.\n *\n * @ignore\n * @since 4.2.0\n * @since 4.3.0 Introduced `$record` parameter. Also, `$term_id` and\n *              `$term_taxonomy_id` can now accept objects.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int|object $term_id          ID of the shared term, or the shared term object.\n * @param int|object $term_taxonomy_id ID of the term_taxonomy item to receive a new term, or the term_taxonomy object\n *                                     (corresponding to a row from the term_taxonomy table).\n * @param bool       $record           Whether to record data about the split term in the options table. The recording\n *                                     process has the potential to be resource-intensive, so during batch operations\n *                                     it can be beneficial to skip inline recording and do it just once, after the\n *                                     batch is processed. Only set this to `false` if you know what you are doing.\n *                                     Default: true.\n * @return int|WP_Error When the current term does not need to be split (or cannot be split on the current\n *                      database schema), `$term_id` is returned. When the term is successfully split, the\n *                      new term_id is returned. A WP_Error is returned for miscellaneous errors.\n */\nfunction _split_shared_term( $term_id, $term_taxonomy_id, $record = true ) {\n\tglobal $wpdb;\n\n\tif ( is_object( $term_id ) ) {\n\t\t$shared_term = $term_id;\n\t\t$term_id     = intval( $shared_term->term_id );\n\t}\n\n\tif ( is_object( $term_taxonomy_id ) ) {\n\t\t$term_taxonomy    = $term_taxonomy_id;\n\t\t$term_taxonomy_id = intval( $term_taxonomy->term_taxonomy_id );\n\t}\n\n\t// If there are no shared term_taxonomy rows, there's nothing to do here.\n\t$shared_tt_count = (int) $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT(*) FROM $wpdb->term_taxonomy tt WHERE tt.term_id = %d AND tt.term_taxonomy_id != %d\", $term_id, $term_taxonomy_id ) );\n\n\tif ( ! $shared_tt_count ) {\n\t\treturn $term_id;\n\t}\n\n\t/*\n\t * Verify that the term_taxonomy_id passed to the function is actually associated with the term_id.\n\t * If there's a mismatch, it may mean that the term is already split. Return the actual term_id from the db.\n\t */\n\t$check_term_id = (int) $wpdb->get_var( $wpdb->prepare( \"SELECT term_id FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d\", $term_taxonomy_id ) );\n\tif ( $check_term_id !== $term_id ) {\n\t\treturn $check_term_id;\n\t}\n\n\t// Pull up data about the currently shared slug, which we'll use to populate the new one.\n\tif ( empty( $shared_term ) ) {\n\t\t$shared_term = $wpdb->get_row( $wpdb->prepare( \"SELECT t.* FROM $wpdb->terms t WHERE t.term_id = %d\", $term_id ) );\n\t}\n\n\t$new_term_data = array(\n\t\t'name'       => $shared_term->name,\n\t\t'slug'       => $shared_term->slug,\n\t\t'term_group' => $shared_term->term_group,\n\t);\n\n\tif ( false === $wpdb->insert( $wpdb->terms, $new_term_data ) ) {\n\t\treturn new WP_Error( 'db_insert_error', __( 'Could not split shared term.' ), $wpdb->last_error );\n\t}\n\n\t$new_term_id = (int) $wpdb->insert_id;\n\n\t// Update the existing term_taxonomy to point to the newly created term.\n\t$wpdb->update(\n\t\t$wpdb->term_taxonomy,\n\t\tarray( 'term_id' => $new_term_id ),\n\t\tarray( 'term_taxonomy_id' => $term_taxonomy_id )\n\t);\n\n\t// Reassign child terms to the new parent.\n\tif ( empty( $term_taxonomy ) ) {\n\t\t$term_taxonomy = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d\", $term_taxonomy_id ) );\n\t}\n\n\t$children_tt_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE parent = %d AND taxonomy = %s\", $term_id, $term_taxonomy->taxonomy ) );\n\tif ( ! empty( $children_tt_ids ) ) {\n\t\tforeach ( $children_tt_ids as $child_tt_id ) {\n\t\t\t$wpdb->update(\n\t\t\t\t$wpdb->term_taxonomy,\n\t\t\t\tarray( 'parent' => $new_term_id ),\n\t\t\t\tarray( 'term_taxonomy_id' => $child_tt_id )\n\t\t\t);\n\t\t\tclean_term_cache( (int) $child_tt_id, '', false );\n\t\t}\n\t} else {\n\t\t// If the term has no children, we must force its taxonomy cache to be rebuilt separately.\n\t\tclean_term_cache( $new_term_id, $term_taxonomy->taxonomy, false );\n\t}\n\n\tclean_term_cache( $term_id, $term_taxonomy->taxonomy, false );\n\n\t/*\n\t * Taxonomy cache clearing is delayed to avoid race conditions that may occur when\n\t * regenerating the taxonomy's hierarchy tree.\n\t */\n\t$taxonomies_to_clean = array( $term_taxonomy->taxonomy );\n\n\t// Clean the cache for term taxonomies formerly shared with the current term.\n\t$shared_term_taxonomies = $wpdb->get_col( $wpdb->prepare( \"SELECT taxonomy FROM $wpdb->term_taxonomy WHERE term_id = %d\", $term_id ) );\n\t$taxonomies_to_clean    = array_merge( $taxonomies_to_clean, $shared_term_taxonomies );\n\n\tforeach ( $taxonomies_to_clean as $taxonomy_to_clean ) {\n\t\tclean_taxonomy_cache( $taxonomy_to_clean );\n\t}\n\n\t// Keep a record of term_ids that have been split, keyed by old term_id. See wp_get_split_term().\n\tif ( $record ) {\n\t\t$split_term_data = get_option( '_split_terms', array() );\n\t\tif ( ! isset( $split_term_data[ $term_id ] ) ) {\n\t\t\t$split_term_data[ $term_id ] = array();\n\t\t}\n\n\t\t$split_term_data[ $term_id ][ $term_taxonomy->taxonomy ] = $new_term_id;\n\t\tupdate_option( '_split_terms', $split_term_data );\n\t}\n\n\t// If we've just split the final shared term, set the \"finished\" flag.\n\t$shared_terms_exist = $wpdb->get_results(\n\t\t\"SELECT tt.term_id, t.*, count(*) as term_tt_count FROM {$wpdb->term_taxonomy} tt\n\t\t LEFT JOIN {$wpdb->terms} t ON t.term_id = tt.term_id\n\t\t GROUP BY t.term_id\n\t\t HAVING term_tt_count > 1\n\t\t LIMIT 1\"\n\t);\n\tif ( ! $shared_terms_exist ) {\n\t\tupdate_option( 'finished_splitting_shared_terms', true );\n\t}\n\n\t/**\n\t * Fires after a previously shared taxonomy term is split into two separate terms.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param int    $term_id          ID of the formerly shared term.\n\t * @param int    $new_term_id      ID of the new term created for the $term_taxonomy_id.\n\t * @param int    $term_taxonomy_id ID for the term_taxonomy row affected by the split.\n\t * @param string $taxonomy         Taxonomy for the split term.\n\t */\n\tdo_action( 'split_shared_term', $term_id, $new_term_id, $term_taxonomy_id, $term_taxonomy->taxonomy );\n\n\treturn $new_term_id;\n}\n\n/**\n * Splits a batch of shared taxonomy terms.\n *\n * @since 4.3.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n */\nfunction _wp_batch_split_terms() {\n\tglobal $wpdb;\n\n\t$lock_name = 'term_split.lock';\n\n\t// Try to lock.\n\t$lock_result = $wpdb->query( $wpdb->prepare( \"INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'no') /* LOCK */\", $lock_name, time() ) );\n\n\tif ( ! $lock_result ) {\n\t\t$lock_result = get_option( $lock_name );\n\n\t\t// Bail if we were unable to create a lock, or if the existing lock is still valid.\n\t\tif ( ! $lock_result || ( $lock_result > ( time() - HOUR_IN_SECONDS ) ) ) {\n\t\t\twp_schedule_single_event( time() + ( 5 * MINUTE_IN_SECONDS ), 'wp_split_shared_term_batch' );\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// Update the lock, as by this point we've definitely got a lock, just need to fire the actions.\n\tupdate_option( $lock_name, time() );\n\n\t// Get a list of shared terms (those with more than one associated row in term_taxonomy).\n\t$shared_terms = $wpdb->get_results(\n\t\t\"SELECT tt.term_id, t.*, count(*) as term_tt_count FROM {$wpdb->term_taxonomy} tt\n\t\t LEFT JOIN {$wpdb->terms} t ON t.term_id = tt.term_id\n\t\t GROUP BY t.term_id\n\t\t HAVING term_tt_count > 1\n\t\t LIMIT 10\"\n\t);\n\n\t// No more terms, we're done here.\n\tif ( ! $shared_terms ) {\n\t\tupdate_option( 'finished_splitting_shared_terms', true );\n\t\tdelete_option( $lock_name );\n\t\treturn;\n\t}\n\n\t// Shared terms found? We'll need to run this script again.\n\twp_schedule_single_event( time() + ( 2 * MINUTE_IN_SECONDS ), 'wp_split_shared_term_batch' );\n\n\t// Rekey shared term array for faster lookups.\n\t$_shared_terms = array();\n\tforeach ( $shared_terms as $shared_term ) {\n\t\t$term_id                   = intval( $shared_term->term_id );\n\t\t$_shared_terms[ $term_id ] = $shared_term;\n\t}\n\t$shared_terms = $_shared_terms;\n\n\t// Get term taxonomy data for all shared terms.\n\t$shared_term_ids = implode( ',', array_keys( $shared_terms ) );\n\t$shared_tts      = $wpdb->get_results( \"SELECT * FROM {$wpdb->term_taxonomy} WHERE `term_id` IN ({$shared_term_ids})\" );\n\n\t// Split term data recording is slow, so we do it just once, outside the loop.\n\t$split_term_data    = get_option( '_split_terms', array() );\n\t$skipped_first_term = array();\n\t$taxonomies         = array();\n\tforeach ( $shared_tts as $shared_tt ) {\n\t\t$term_id = intval( $shared_tt->term_id );\n\n\t\t// Don't split the first tt belonging to a given term_id.\n\t\tif ( ! isset( $skipped_first_term[ $term_id ] ) ) {\n\t\t\t$skipped_first_term[ $term_id ] = 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( ! isset( $split_term_data[ $term_id ] ) ) {\n\t\t\t$split_term_data[ $term_id ] = array();\n\t\t}\n\n\t\t// Keep track of taxonomies whose hierarchies need flushing.\n\t\tif ( ! isset( $taxonomies[ $shared_tt->taxonomy ] ) ) {\n\t\t\t$taxonomies[ $shared_tt->taxonomy ] = 1;\n\t\t}\n\n\t\t// Split the term.\n\t\t$split_term_data[ $term_id ][ $shared_tt->taxonomy ] = _split_shared_term( $shared_terms[ $term_id ], $shared_tt, false );\n\t}\n\n\t// Rebuild the cached hierarchy for each affected taxonomy.\n\tforeach ( array_keys( $taxonomies ) as $tax ) {\n\t\tdelete_option( \"{$tax}_children\" );\n\t\t_get_term_hierarchy( $tax );\n\t}\n\n\tupdate_option( '_split_terms', $split_term_data );\n\n\tdelete_option( $lock_name );\n}\n\n/**\n * In order to avoid the _wp_batch_split_terms() job being accidentally removed,\n * check that it's still scheduled while we haven't finished splitting terms.\n *\n * @ignore\n * @since 4.3.0\n */\nfunction _wp_check_for_scheduled_split_terms() {\n\tif ( ! get_option( 'finished_splitting_shared_terms' ) && ! wp_next_scheduled( 'wp_split_shared_term_batch' ) ) {\n\t\twp_schedule_single_event( time() + MINUTE_IN_SECONDS, 'wp_split_shared_term_batch' );\n\t}\n}\n\n/**\n * Check default categories when a term gets split to see if any of them need to be updated.\n *\n * @ignore\n * @since 4.2.0\n *\n * @param int    $term_id          ID of the formerly shared term.\n * @param int    $new_term_id      ID of the new term created for the $term_taxonomy_id.\n * @param int    $term_taxonomy_id ID for the term_taxonomy row affected by the split.\n * @param string $taxonomy         Taxonomy for the split term.\n */\nfunction _wp_check_split_default_terms( $term_id, $new_term_id, $term_taxonomy_id, $taxonomy ) {\n\tif ( 'category' !== $taxonomy ) {\n\t\treturn;\n\t}\n\n\tforeach ( array( 'default_category', 'default_link_category', 'default_email_category' ) as $option ) {\n\t\tif ( (int) get_option( $option, -1 ) === $term_id ) {\n\t\t\tupdate_option( $option, $new_term_id );\n\t\t}\n\t}\n}\n\n/**\n * Check menu items when a term gets split to see if any of them need to be updated.\n *\n * @ignore\n * @since 4.2.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int    $term_id          ID of the formerly shared term.\n * @param int    $new_term_id      ID of the new term created for the $term_taxonomy_id.\n * @param int    $term_taxonomy_id ID for the term_taxonomy row affected by the split.\n * @param string $taxonomy         Taxonomy for the split term.\n */\nfunction _wp_check_split_terms_in_menus( $term_id, $new_term_id, $term_taxonomy_id, $taxonomy ) {\n\tglobal $wpdb;\n\t$post_ids = $wpdb->get_col(\n\t\t$wpdb->prepare(\n\t\t\t\"SELECT m1.post_id\n\t\tFROM {$wpdb->postmeta} AS m1\n\t\t\tINNER JOIN {$wpdb->postmeta} AS m2 ON ( m2.post_id = m1.post_id )\n\t\t\tINNER JOIN {$wpdb->postmeta} AS m3 ON ( m3.post_id = m1.post_id )\n\t\tWHERE ( m1.meta_key = '_menu_item_type' AND m1.meta_value = 'taxonomy' )\n\t\t\tAND ( m2.meta_key = '_menu_item_object' AND m2.meta_value = %s )\n\t\t\tAND ( m3.meta_key = '_menu_item_object_id' AND m3.meta_value = %d )\",\n\t\t\t$taxonomy,\n\t\t\t$term_id\n\t\t)\n\t);\n\n\tif ( $post_ids ) {\n\t\tforeach ( $post_ids as $post_id ) {\n\t\t\tupdate_post_meta( $post_id, '_menu_item_object_id', $new_term_id, $term_id );\n\t\t}\n\t}\n}\n\n/**\n * If the term being split is a nav_menu, change associations.\n *\n * @ignore\n * @since 4.3.0\n *\n * @param int    $term_id          ID of the formerly shared term.\n * @param int    $new_term_id      ID of the new term created for the $term_taxonomy_id.\n * @param int    $term_taxonomy_id ID for the term_taxonomy row affected by the split.\n * @param string $taxonomy         Taxonomy for the split term.\n */\nfunction _wp_check_split_nav_menu_terms( $term_id, $new_term_id, $term_taxonomy_id, $taxonomy ) {\n\tif ( 'nav_menu' !== $taxonomy ) {\n\t\treturn;\n\t}\n\n\t// Update menu locations.\n\t$locations = get_nav_menu_locations();\n\tforeach ( $locations as $location => $menu_id ) {\n\t\tif ( $term_id === $menu_id ) {\n\t\t\t$locations[ $location ] = $new_term_id;\n\t\t}\n\t}\n\tset_theme_mod( 'nav_menu_locations', $locations );\n}\n\n/**\n * Get data about terms that previously shared a single term_id, but have since been split.\n *\n * @since 4.2.0\n *\n * @param int $old_term_id Term ID. This is the old, pre-split term ID.\n * @return array Array of new term IDs, keyed by taxonomy.\n */\nfunction wp_get_split_terms( $old_term_id ) {\n\t$split_terms = get_option( '_split_terms', array() );\n\n\t$terms = array();\n\tif ( isset( $split_terms[ $old_term_id ] ) ) {\n\t\t$terms = $split_terms[ $old_term_id ];\n\t}\n\n\treturn $terms;\n}\n\n/**\n * Get the new term ID corresponding to a previously split term.\n *\n * @since 4.2.0\n *\n * @param int    $old_term_id Term ID. This is the old, pre-split term ID.\n * @param string $taxonomy    Taxonomy that the term belongs to.\n * @return int|false If a previously split term is found corresponding to the old term_id and taxonomy,\n *                   the new term_id will be returned. If no previously split term is found matching\n *                   the parameters, returns false.\n */\nfunction wp_get_split_term( $old_term_id, $taxonomy ) {\n\t$split_terms = wp_get_split_terms( $old_term_id );\n\n\t$term_id = false;\n\tif ( isset( $split_terms[ $taxonomy ] ) ) {\n\t\t$term_id = (int) $split_terms[ $taxonomy ];\n\t}\n\n\treturn $term_id;\n}\n\n/**\n * Determine whether a term is shared between multiple taxonomies.\n *\n * Shared taxonomy terms began to be split in 4.3, but failed cron tasks or\n * other delays in upgrade routines may cause shared terms to remain.\n *\n * @since 4.4.0\n *\n * @param int $term_id Term ID.\n * @return bool Returns false if a term is not shared between multiple taxonomies or\n *              if splitting shared taxonomy terms is finished.\n */\nfunction wp_term_is_shared( $term_id ) {\n\tglobal $wpdb;\n\n\tif ( get_option( 'finished_splitting_shared_terms' ) ) {\n\t\treturn false;\n\t}\n\n\t$tt_count = $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE term_id = %d\", $term_id ) );\n\n\treturn $tt_count > 1;\n}\n\n/**\n * Generate a permalink for a taxonomy term archive.\n *\n * @since 2.5.0\n *\n * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n *\n * @param WP_Term|int|string $term     The term object, ID, or slug whose link will be retrieved.\n * @param string             $taxonomy Optional. Taxonomy. Default empty.\n * @return string|WP_Error URL of the taxonomy term archive on success, WP_Error if term does not exist.\n */\nfunction get_term_link( $term, $taxonomy = '' ) {\n\tglobal $wp_rewrite;\n\n\tif ( ! is_object( $term ) ) {\n\t\tif ( is_int( $term ) ) {\n\t\t\t$term = get_term( $term, $taxonomy );\n\t\t} else {\n\t\t\t$term = get_term_by( 'slug', $term, $taxonomy );\n\t\t}\n\t}\n\n\tif ( ! is_object( $term ) ) {\n\t\t$term = new WP_Error( 'invalid_term', __( 'Empty Term.' ) );\n\t}\n\n\tif ( is_wp_error( $term ) ) {\n\t\treturn $term;\n\t}\n\n\t$taxonomy = $term->taxonomy;\n\n\t$termlink = $wp_rewrite->get_extra_permastruct( $taxonomy );\n\n\t/**\n\t * Filters the permalink structure for a terms before token replacement occurs.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param string  $termlink The permalink structure for the term's taxonomy.\n\t * @param WP_Term $term     The term object.\n\t */\n\t$termlink = apply_filters( 'pre_term_link', $termlink, $term );\n\n\t$slug = $term->slug;\n\t$t    = get_taxonomy( $taxonomy );\n\n\tif ( empty( $termlink ) ) {\n\t\tif ( 'category' === $taxonomy ) {\n\t\t\t$termlink = '?cat=' . $term->term_id;\n\t\t} elseif ( $t->query_var ) {\n\t\t\t$termlink = \"?$t->query_var=$slug\";\n\t\t} else {\n\t\t\t$termlink = \"?taxonomy=$taxonomy&term=$slug\";\n\t\t}\n\t\t$termlink = home_url( $termlink );\n\t} else {\n\t\tif ( $t->rewrite['hierarchical'] ) {\n\t\t\t$hierarchical_slugs = array();\n\t\t\t$ancestors          = get_ancestors( $term->term_id, $taxonomy, 'taxonomy' );\n\t\t\tforeach ( (array) $ancestors as $ancestor ) {\n\t\t\t\t$ancestor_term        = get_term( $ancestor, $taxonomy );\n\t\t\t\t$hierarchical_slugs[] = $ancestor_term->slug;\n\t\t\t}\n\t\t\t$hierarchical_slugs   = array_reverse( $hierarchical_slugs );\n\t\t\t$hierarchical_slugs[] = $slug;\n\t\t\t$termlink             = str_replace( \"%$taxonomy%\", implode( '/', $hierarchical_slugs ), $termlink );\n\t\t} else {\n\t\t\t$termlink = str_replace( \"%$taxonomy%\", $slug, $termlink );\n\t\t}\n\t\t$termlink = home_url( user_trailingslashit( $termlink, 'category' ) );\n\t}\n\n\t// Back compat filters.\n\tif ( 'post_tag' === $taxonomy ) {\n\n\t\t/**\n\t\t * Filters the tag link.\n\t\t *\n\t\t * @since 2.3.0\n\t\t * @since 2.5.0 Deprecated in favor of {@see 'term_link'} filter.\n\t\t * @since 5.4.1 Restored (un-deprecated).\n\t\t *\n\t\t * @param string $termlink Tag link URL.\n\t\t * @param int    $term_id  Term ID.\n\t\t */\n\t\t$termlink = apply_filters( 'tag_link', $termlink, $term->term_id );\n\t} elseif ( 'category' === $taxonomy ) {\n\n\t\t/**\n\t\t * Filters the category link.\n\t\t *\n\t\t * @since 1.5.0\n\t\t * @since 2.5.0 Deprecated in favor of {@see 'term_link'} filter.\n\t\t * @since 5.4.1 Restored (un-deprecated).\n\t\t *\n\t\t * @param string $termlink Category link URL.\n\t\t * @param int    $term_id  Term ID.\n\t\t */\n\t\t$termlink = apply_filters( 'category_link', $termlink, $term->term_id );\n\t}\n\n\t/**\n\t * Filters the term link.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string  $termlink Term link URL.\n\t * @param WP_Term $term     Term object.\n\t * @param string  $taxonomy Taxonomy slug.\n\t */\n\treturn apply_filters( 'term_link', $termlink, $term, $taxonomy );\n}\n\n/**\n * Display the taxonomies of a post with available options.\n *\n * This function can be used within the loop to display the taxonomies for a\n * post without specifying the Post ID. You can also use it outside the Loop to\n * display the taxonomies for a specific post.\n *\n * @since 2.5.0\n *\n * @param array $args {\n *     Arguments about which post to use and how to format the output. Shares all of the arguments\n *     supported by get_the_taxonomies(), in addition to the following.\n *\n *     @type  int|WP_Post $post   Post ID or object to get taxonomies of. Default current post.\n *     @type  string      $before Displays before the taxonomies. Default empty string.\n *     @type  string      $sep    Separates each taxonomy. Default is a space.\n *     @type  string      $after  Displays after the taxonomies. Default empty string.\n * }\n */\nfunction the_taxonomies( $args = array() ) {\n\t$defaults = array(\n\t\t'post'   => 0,\n\t\t'before' => '',\n\t\t'sep'    => ' ',\n\t\t'after'  => '',\n\t);\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\techo $parsed_args['before'] . join( $parsed_args['sep'], get_the_taxonomies( $parsed_args['post'], $parsed_args ) ) . $parsed_args['after'];\n}\n\n/**\n * Retrieve all taxonomies associated with a post.\n *\n * This function can be used within the loop. It will also return an array of\n * the taxonomies with links to the taxonomy and name.\n *\n * @since 2.5.0\n *\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.\n * @param array       $args {\n *           Optional. Arguments about how to format the list of taxonomies. Default empty array.\n *\n *     @type string $template      Template for displaying a taxonomy label and list of terms.\n *                                 Default is \"Label: Terms.\"\n *     @type string $term_template Template for displaying a single term in the list. Default is the term name\n *                                 linked to its archive.\n * }\n * @return array List of taxonomies.\n */\nfunction get_the_taxonomies( $post = 0, $args = array() ) {\n\t$post = get_post( $post );\n\n\t$args = wp_parse_args(\n\t\t$args,\n\t\tarray(\n\t\t\t/* translators: %s: Taxonomy label, %l: List of terms formatted as per $term_template. */\n\t\t\t'template'      => __( '%s: %l.' ),\n\t\t\t'term_template' => '<a href=\"%1$s\">%2$s</a>',\n\t\t)\n\t);\n\n\t$taxonomies = array();\n\n\tif ( ! $post ) {\n\t\treturn $taxonomies;\n\t}\n\n\tforeach ( get_object_taxonomies( $post ) as $taxonomy ) {\n\t\t$t = (array) get_taxonomy( $taxonomy );\n\t\tif ( empty( $t['label'] ) ) {\n\t\t\t$t['label'] = $taxonomy;\n\t\t}\n\t\tif ( empty( $t['args'] ) ) {\n\t\t\t$t['args'] = array();\n\t\t}\n\t\tif ( empty( $t['template'] ) ) {\n\t\t\t$t['template'] = $args['template'];\n\t\t}\n\t\tif ( empty( $t['term_template'] ) ) {\n\t\t\t$t['term_template'] = $args['term_template'];\n\t\t}\n\n\t\t$terms = get_object_term_cache( $post->ID, $taxonomy );\n\t\tif ( false === $terms ) {\n\t\t\t$terms = wp_get_object_terms( $post->ID, $taxonomy, $t['args'] );\n\t\t}\n\t\t$links = array();\n\n\t\tforeach ( $terms as $term ) {\n\t\t\t$links[] = wp_sprintf( $t['term_template'], esc_attr( get_term_link( $term ) ), $term->name );\n\t\t}\n\t\tif ( $links ) {\n\t\t\t$taxonomies[ $taxonomy ] = wp_sprintf( $t['template'], $t['label'], $links, $terms );\n\t\t}\n\t}\n\treturn $taxonomies;\n}\n\n/**\n * Retrieve all taxonomy names for the given post.\n *\n * @since 2.5.0\n *\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.\n * @return string[] An array of all taxonomy names for the given post.\n */\nfunction get_post_taxonomies( $post = 0 ) {\n\t$post = get_post( $post );\n\n\treturn get_object_taxonomies( $post );\n}\n\n/**\n * Determine if the given object is associated with any of the given terms.\n *\n * The given terms are checked against the object's terms' term_ids, names and slugs.\n * Terms given as integers will only be checked against the object's terms' term_ids.\n * If no terms are given, determines if object is associated with any terms in the given taxonomy.\n *\n * @since 2.7.0\n *\n * @param int              $object_id ID of the object (post ID, link ID, ...).\n * @param string           $taxonomy  Single taxonomy name.\n * @param int|string|array $terms     Optional. Term term_id, name, slug or array of said. Default null.\n * @return bool|WP_Error WP_Error on input error.\n */\nfunction is_object_in_term( $object_id, $taxonomy, $terms = null ) {\n\t$object_id = (int) $object_id;\n\tif ( ! $object_id ) {\n\t\treturn new WP_Error( 'invalid_object', __( 'Invalid object ID.' ) );\n\t}\n\n\t$object_terms = get_object_term_cache( $object_id, $taxonomy );\n\tif ( false === $object_terms ) {\n\t\t$object_terms = wp_get_object_terms( $object_id, $taxonomy, array( 'update_term_meta_cache' => false ) );\n\t\tif ( is_wp_error( $object_terms ) ) {\n\t\t\treturn $object_terms;\n\t\t}\n\n\t\twp_cache_set( $object_id, wp_list_pluck( $object_terms, 'term_id' ), \"{$taxonomy}_relationships\" );\n\t}\n\n\tif ( is_wp_error( $object_terms ) ) {\n\t\treturn $object_terms;\n\t}\n\tif ( empty( $object_terms ) ) {\n\t\treturn false;\n\t}\n\tif ( empty( $terms ) ) {\n\t\treturn ( ! empty( $object_terms ) );\n\t}\n\n\t$terms = (array) $terms;\n\n\t$ints = array_filter( $terms, 'is_int' );\n\tif ( $ints ) {\n\t\t$strs = array_diff( $terms, $ints );\n\t} else {\n\t\t$strs =& $terms;\n\t}\n\n\tforeach ( $object_terms as $object_term ) {\n\t\t// If term is an int, check against term_ids only.\n\t\tif ( $ints && in_array( $object_term->term_id, $ints, true ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( $strs ) {\n\t\t\t// Only check numeric strings against term_id, to avoid false matches due to type juggling.\n\t\t\t$numeric_strs = array_map( 'intval', array_filter( $strs, 'is_numeric' ) );\n\t\t\tif ( in_array( $object_term->term_id, $numeric_strs, true ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ( in_array( $object_term->name, $strs, true ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ( in_array( $object_term->slug, $strs, true ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Determine if the given object type is associated with the given taxonomy.\n *\n * @since 3.0.0\n *\n * @param string $object_type Object type string.\n * @param string $taxonomy    Single taxonomy name.\n * @return bool True if object is associated with the taxonomy, otherwise false.\n */\nfunction is_object_in_taxonomy( $object_type, $taxonomy ) {\n\t$taxonomies = get_object_taxonomies( $object_type );\n\tif ( empty( $taxonomies ) ) {\n\t\treturn false;\n\t}\n\treturn in_array( $taxonomy, $taxonomies, true );\n}\n\n/**\n * Get an array of ancestor IDs for a given object.\n *\n * @since 3.1.0\n * @since 4.1.0 Introduced the `$resource_type` argument.\n *\n * @param int    $object_id     Optional. The ID of the object. Default 0.\n * @param string $object_type   Optional. The type of object for which we'll be retrieving\n *                              ancestors. Accepts a post type or a taxonomy name. Default empty.\n * @param string $resource_type Optional. Type of resource $object_type is. Accepts 'post_type'\n *                              or 'taxonomy'. Default empty.\n * @return int[] An array of IDs of ancestors from lowest to highest in the hierarchy.\n */\nfunction get_ancestors( $object_id = 0, $object_type = '', $resource_type = '' ) {\n\t$object_id = (int) $object_id;\n\n\t$ancestors = array();\n\n\tif ( empty( $object_id ) ) {\n\n\t\t/** This filter is documented in wp-includes/taxonomy.php */\n\t\treturn apply_filters( 'get_ancestors', $ancestors, $object_id, $object_type, $resource_type );\n\t}\n\n\tif ( ! $resource_type ) {\n\t\tif ( is_taxonomy_hierarchical( $object_type ) ) {\n\t\t\t$resource_type = 'taxonomy';\n\t\t} elseif ( post_type_exists( $object_type ) ) {\n\t\t\t$resource_type = 'post_type';\n\t\t}\n\t}\n\n\tif ( 'taxonomy' === $resource_type ) {\n\t\t$term = get_term( $object_id, $object_type );\n\t\twhile ( ! is_wp_error( $term ) && ! empty( $term->parent ) && ! in_array( $term->parent, $ancestors, true ) ) {\n\t\t\t$ancestors[] = (int) $term->parent;\n\t\t\t$term        = get_term( $term->parent, $object_type );\n\t\t}\n\t} elseif ( 'post_type' === $resource_type ) {\n\t\t$ancestors = get_post_ancestors( $object_id );\n\t}\n\n\t/**\n\t * Filters a given object's ancestors.\n\t *\n\t * @since 3.1.0\n\t * @since 4.1.1 Introduced the `$resource_type` parameter.\n\t *\n\t * @param int[]  $ancestors     An array of IDs of object ancestors.\n\t * @param int    $object_id     Object ID.\n\t * @param string $object_type   Type of object.\n\t * @param string $resource_type Type of resource $object_type is.\n\t */\n\treturn apply_filters( 'get_ancestors', $ancestors, $object_id, $object_type, $resource_type );\n}\n\n/**\n * Returns the term's parent's term_ID.\n *\n * @since 3.1.0\n *\n * @param int    $term_id  Term ID.\n * @param string $taxonomy Taxonomy name.\n * @return int|false False on error.\n */\nfunction wp_get_term_taxonomy_parent_id( $term_id, $taxonomy ) {\n\t$term = get_term( $term_id, $taxonomy );\n\tif ( ! $term || is_wp_error( $term ) ) {\n\t\treturn false;\n\t}\n\treturn (int) $term->parent;\n}\n\n/**\n * Checks the given subset of the term hierarchy for hierarchy loops.\n * Prevents loops from forming and breaks those that it finds.\n *\n * Attached to the {@see 'wp_update_term_parent'} filter.\n *\n * @since 3.1.0\n *\n * @param int    $parent   `term_id` of the parent for the term we're checking.\n * @param int    $term_id  The term we're checking.\n * @param string $taxonomy The taxonomy of the term we're checking.\n * @return int The new parent for the term.\n */\nfunction wp_check_term_hierarchy_for_loops( $parent, $term_id, $taxonomy ) {\n\t// Nothing fancy here - bail.\n\tif ( ! $parent ) {\n\t\treturn 0;\n\t}\n\n\t// Can't be its own parent.\n\tif ( $parent === $term_id ) {\n\t\treturn 0;\n\t}\n\n\t// Now look for larger loops.\n\t$loop = wp_find_hierarchy_loop( 'wp_get_term_taxonomy_parent_id', $term_id, $parent, array( $taxonomy ) );\n\tif ( ! $loop ) {\n\t\treturn $parent; // No loop.\n\t}\n\n\t// Setting $parent to the given value causes a loop.\n\tif ( isset( $loop[ $term_id ] ) ) {\n\t\treturn 0;\n\t}\n\n\t// There's a loop, but it doesn't contain $term_id. Break the loop.\n\tforeach ( array_keys( $loop ) as $loop_member ) {\n\t\twp_update_term( $loop_member, $taxonomy, array( 'parent' => 0 ) );\n\t}\n\n\treturn $parent;\n}\n\n/**\n * Determines whether a taxonomy is considered \"viewable\".\n *\n * @since 5.1.0\n *\n * @param string|WP_Taxonomy $taxonomy Taxonomy name or object.\n * @return bool Whether the taxonomy should be considered viewable.\n */\nfunction is_taxonomy_viewable( $taxonomy ) {\n\tif ( is_scalar( $taxonomy ) ) {\n\t\t$taxonomy = get_taxonomy( $taxonomy );\n\t\tif ( ! $taxonomy ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn $taxonomy->publicly_queryable;\n}\n\n/**\n * Sets the last changed time for the 'terms' cache group.\n *\n * @since 5.0.0\n */\nfunction wp_cache_set_terms_last_changed() {\n\twp_cache_set( 'last_changed', microtime(), 'terms' );\n}\n\n/**\n * Aborts calls to term meta if it is not supported.\n *\n * @since 5.0.0\n *\n * @param mixed $check Skip-value for whether to proceed term meta function execution.\n * @return mixed Original value of $check, or false if term meta is not supported.\n */\nfunction wp_check_term_meta_support_prefilter( $check ) {\n\tif ( get_option( 'db_version' ) < 34370 ) {\n\t\treturn false;\n\t}\n\n\treturn $check;\n}\n", "num_lines": 4770}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Loads the correct template based on the visitor's url\n *\n * @package WordPress\n */\nif ( wp_using_themes() ) {\n\t/**\n\t * Fires before determining which template to load.\n\t *\n\t * @since 1.5.0\n\t */\n\tdo_action( 'template_redirect' );\n}\n\n/**\n * Filters whether to allow 'HEAD' requests to generate content.\n *\n * Provides a significant performance bump by exiting before the page\n * content loads for 'HEAD' requests. See #14348.\n *\n * @since 3.5.0\n *\n * @param bool $exit Whether to exit without generating any content for 'HEAD' requests. Default true.\n */\nif ( 'HEAD' === $_SERVER['REQUEST_METHOD'] && apply_filters( 'exit_on_http_head', true ) ) {\n\texit;\n}\n\n// Process feeds and trackbacks even if not using themes.\nif ( is_robots() ) {\n\t/**\n\t * Fired when the template loader determines a robots.txt request.\n\t *\n\t * @since 2.1.0\n\t */\n\tdo_action( 'do_robots' );\n\treturn;\n} elseif ( is_favicon() ) {\n\t/**\n\t * Fired when the template loader determines a favicon.ico request.\n\t *\n\t * @since 5.4.0\n\t */\n\tdo_action( 'do_favicon' );\n\treturn;\n} elseif ( is_feed() ) {\n\tdo_feed();\n\treturn;\n} elseif ( is_trackback() ) {\n\trequire ABSPATH . 'wp-trackback.php';\n\treturn;\n}\n\nif ( wp_using_themes() ) {\n\n\t$tag_templates = array(\n\t\t'is_embed'             => 'get_embed_template',\n\t\t'is_404'               => 'get_404_template',\n\t\t'is_search'            => 'get_search_template',\n\t\t'is_front_page'        => 'get_front_page_template',\n\t\t'is_home'              => 'get_home_template',\n\t\t'is_privacy_policy'    => 'get_privacy_policy_template',\n\t\t'is_post_type_archive' => 'get_post_type_archive_template',\n\t\t'is_tax'               => 'get_taxonomy_template',\n\t\t'is_attachment'        => 'get_attachment_template',\n\t\t'is_single'            => 'get_single_template',\n\t\t'is_page'              => 'get_page_template',\n\t\t'is_singular'          => 'get_singular_template',\n\t\t'is_category'          => 'get_category_template',\n\t\t'is_tag'               => 'get_tag_template',\n\t\t'is_author'            => 'get_author_template',\n\t\t'is_date'              => 'get_date_template',\n\t\t'is_archive'           => 'get_archive_template',\n\t);\n\t$template      = false;\n\n\t// Loop through each of the template conditionals, and find the appropriate template file.\n\tforeach ( $tag_templates as $tag => $template_getter ) {\n\t\tif ( call_user_func( $tag ) ) {\n\t\t\t$template = call_user_func( $template_getter );\n\t\t}\n\n\t\tif ( $template ) {\n\t\t\tif ( 'is_attachment' === $tag ) {\n\t\t\t\tremove_filter( 'the_content', 'prepend_attachment' );\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ( ! $template ) {\n\t\t$template = get_index_template();\n\t}\n\n\t/**\n\t * Filters the path of the current template before including it.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $template The path of the template to include.\n\t */\n\t$template = apply_filters( 'template_include', $template );\n\tif ( $template ) {\n\t\tinclude $template;\n\t} elseif ( current_user_can( 'switch_themes' ) ) {\n\t\t$theme = wp_get_theme();\n\t\tif ( $theme->errors() ) {\n\t\t\twp_die( $theme->errors() );\n\t\t}\n\t}\n\treturn;\n}\n", "num_lines": 115}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Template loading functions.\n *\n * @package WordPress\n * @subpackage Template\n */\n\n/**\n * Retrieve path to a template\n *\n * Used to quickly retrieve the path of a template without including the file\n * extension. It will also check the parent theme, if the file exists, with\n * the use of locate_template(). Allows for more generic template location\n * without the use of the other get_*_template() functions.\n *\n * @since 1.5.0\n *\n * @param string $type      Filename without extension.\n * @param array  $templates An optional list of template candidates\n * @return string Full path to template file.\n */\nfunction get_query_template( $type, $templates = array() ) {\n\t$type = preg_replace( '|[^a-z0-9-]+|', '', $type );\n\n\tif ( empty( $templates ) ) {\n\t\t$templates = array( \"{$type}.php\" );\n\t}\n\n\t/**\n\t * Filters the list of template filenames that are searched for when retrieving a template to use.\n\t *\n\t * The last element in the array should always be the fallback template for this query type.\n\t *\n\t * Possible values for `$type` include: 'index', '404', 'archive', 'author', 'category', 'tag', 'taxonomy', 'date',\n\t * 'embed', 'home', 'frontpage', 'privacypolicy', 'page', 'paged', 'search', 'single', 'singular', and 'attachment'.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $templates A list of template candidates, in descending order of priority.\n\t */\n\t$templates = apply_filters( \"{$type}_template_hierarchy\", $templates );\n\n\t$template = locate_template( $templates );\n\n\t/**\n\t * Filters the path of the queried template by type.\n\t *\n\t * The dynamic portion of the hook name, `$type`, refers to the filename -- minus the file\n\t * extension and any non-alphanumeric characters delimiting words -- of the file to load.\n\t * This hook also applies to various types of files loaded as part of the Template Hierarchy.\n\t *\n\t * Possible values for `$type` include: 'index', '404', 'archive', 'author', 'category', 'tag', 'taxonomy', 'date',\n\t * 'embed', 'home', 'frontpage', 'privacypolicy', 'page', 'paged', 'search', 'single', 'singular', and 'attachment'.\n\t *\n\t * @since 1.5.0\n\t * @since 4.8.0 The `$type` and `$templates` parameters were added.\n\t *\n\t * @param string $template  Path to the template. See locate_template().\n\t * @param string $type      Sanitized filename without extension.\n\t * @param array  $templates A list of template candidates, in descending order of priority.\n\t */\n\treturn apply_filters( \"{$type}_template\", $template, $type, $templates );\n}\n\n/**\n * Retrieve path of index template in current or parent template.\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'index'.\n *\n * @since 3.0.0\n *\n * @see get_query_template()\n *\n * @return string Full path to index template file.\n */\nfunction get_index_template() {\n\treturn get_query_template( 'index' );\n}\n\n/**\n * Retrieve path of 404 template in current or parent template.\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is '404'.\n *\n * @since 1.5.0\n *\n * @see get_query_template()\n *\n * @return string Full path to 404 template file.\n */\nfunction get_404_template() {\n\treturn get_query_template( '404' );\n}\n\n/**\n * Retrieve path of archive template in current or parent template.\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'archive'.\n *\n * @since 1.5.0\n *\n * @see get_query_template()\n *\n * @return string Full path to archive template file.\n */\nfunction get_archive_template() {\n\t$post_types = array_filter( (array) get_query_var( 'post_type' ) );\n\n\t$templates = array();\n\n\tif ( count( $post_types ) == 1 ) {\n\t\t$post_type   = reset( $post_types );\n\t\t$templates[] = \"archive-{$post_type}.php\";\n\t}\n\t$templates[] = 'archive.php';\n\n\treturn get_query_template( 'archive', $templates );\n}\n\n/**\n * Retrieve path of post type archive template in current or parent template.\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'archive'.\n *\n * @since 3.7.0\n *\n * @see get_archive_template()\n *\n * @return string Full path to archive template file.\n */\nfunction get_post_type_archive_template() {\n\t$post_type = get_query_var( 'post_type' );\n\tif ( is_array( $post_type ) ) {\n\t\t$post_type = reset( $post_type );\n\t}\n\n\t$obj = get_post_type_object( $post_type );\n\tif ( ! ( $obj instanceof WP_Post_Type ) || ! $obj->has_archive ) {\n\t\treturn '';\n\t}\n\n\treturn get_archive_template();\n}\n\n/**\n * Retrieve path of author template in current or parent template.\n *\n * The hierarchy for this template looks like:\n *\n * 1. author-{nicename}.php\n * 2. author-{id}.php\n * 3. author.php\n *\n * An example of this is:\n *\n * 1. author-john.php\n * 2. author-1.php\n * 3. author.php\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'author'.\n *\n * @since 1.5.0\n *\n * @see get_query_template()\n *\n * @return string Full path to author template file.\n */\nfunction get_author_template() {\n\t$author = get_queried_object();\n\n\t$templates = array();\n\n\tif ( $author instanceof WP_User ) {\n\t\t$templates[] = \"author-{$author->user_nicename}.php\";\n\t\t$templates[] = \"author-{$author->ID}.php\";\n\t}\n\t$templates[] = 'author.php';\n\n\treturn get_query_template( 'author', $templates );\n}\n\n/**\n * Retrieve path of category template in current or parent template.\n *\n * The hierarchy for this template looks like:\n *\n * 1. category-{slug}.php\n * 2. category-{id}.php\n * 3. category.php\n *\n * An example of this is:\n *\n * 1. category-news.php\n * 2. category-2.php\n * 3. category.php\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'category'.\n *\n * @since 1.5.0\n * @since 4.7.0 The decoded form of `category-{slug}.php` was added to the top of the\n *              template hierarchy when the category slug contains multibyte characters.\n *\n * @see get_query_template()\n *\n * @return string Full path to category template file.\n */\nfunction get_category_template() {\n\t$category = get_queried_object();\n\n\t$templates = array();\n\n\tif ( ! empty( $category->slug ) ) {\n\n\t\t$slug_decoded = urldecode( $category->slug );\n\t\tif ( $slug_decoded !== $category->slug ) {\n\t\t\t$templates[] = \"category-{$slug_decoded}.php\";\n\t\t}\n\n\t\t$templates[] = \"category-{$category->slug}.php\";\n\t\t$templates[] = \"category-{$category->term_id}.php\";\n\t}\n\t$templates[] = 'category.php';\n\n\treturn get_query_template( 'category', $templates );\n}\n\n/**\n * Retrieve path of tag template in current or parent template.\n *\n * The hierarchy for this template looks like:\n *\n * 1. tag-{slug}.php\n * 2. tag-{id}.php\n * 3. tag.php\n *\n * An example of this is:\n *\n * 1. tag-wordpress.php\n * 2. tag-3.php\n * 3. tag.php\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'tag'.\n *\n * @since 2.3.0\n * @since 4.7.0 The decoded form of `tag-{slug}.php` was added to the top of the\n *              template hierarchy when the tag slug contains multibyte characters.\n *\n * @see get_query_template()\n *\n * @return string Full path to tag template file.\n */\nfunction get_tag_template() {\n\t$tag = get_queried_object();\n\n\t$templates = array();\n\n\tif ( ! empty( $tag->slug ) ) {\n\n\t\t$slug_decoded = urldecode( $tag->slug );\n\t\tif ( $slug_decoded !== $tag->slug ) {\n\t\t\t$templates[] = \"tag-{$slug_decoded}.php\";\n\t\t}\n\n\t\t$templates[] = \"tag-{$tag->slug}.php\";\n\t\t$templates[] = \"tag-{$tag->term_id}.php\";\n\t}\n\t$templates[] = 'tag.php';\n\n\treturn get_query_template( 'tag', $templates );\n}\n\n/**\n * Retrieve path of custom taxonomy term template in current or parent template.\n *\n * The hierarchy for this template looks like:\n *\n * 1. taxonomy-{taxonomy_slug}-{term_slug}.php\n * 2. taxonomy-{taxonomy_slug}.php\n * 3. taxonomy.php\n *\n * An example of this is:\n *\n * 1. taxonomy-location-texas.php\n * 2. taxonomy-location.php\n * 3. taxonomy.php\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'taxonomy'.\n *\n * @since 2.5.0\n * @since 4.7.0 The decoded form of `taxonomy-{taxonomy_slug}-{term_slug}.php` was added to the top of the\n *              template hierarchy when the term slug contains multibyte characters.\n *\n * @see get_query_template()\n *\n * @return string Full path to custom taxonomy term template file.\n */\nfunction get_taxonomy_template() {\n\t$term = get_queried_object();\n\n\t$templates = array();\n\n\tif ( ! empty( $term->slug ) ) {\n\t\t$taxonomy = $term->taxonomy;\n\n\t\t$slug_decoded = urldecode( $term->slug );\n\t\tif ( $slug_decoded !== $term->slug ) {\n\t\t\t$templates[] = \"taxonomy-$taxonomy-{$slug_decoded}.php\";\n\t\t}\n\n\t\t$templates[] = \"taxonomy-$taxonomy-{$term->slug}.php\";\n\t\t$templates[] = \"taxonomy-$taxonomy.php\";\n\t}\n\t$templates[] = 'taxonomy.php';\n\n\treturn get_query_template( 'taxonomy', $templates );\n}\n\n/**\n * Retrieve path of date template in current or parent template.\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'date'.\n *\n * @since 1.5.0\n *\n * @see get_query_template()\n *\n * @return string Full path to date template file.\n */\nfunction get_date_template() {\n\treturn get_query_template( 'date' );\n}\n\n/**\n * Retrieve path of home template in current or parent template.\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'home'.\n *\n * @since 1.5.0\n *\n * @see get_query_template()\n *\n * @return string Full path to home template file.\n */\nfunction get_home_template() {\n\t$templates = array( 'home.php', 'index.php' );\n\n\treturn get_query_template( 'home', $templates );\n}\n\n/**\n * Retrieve path of front page template in current or parent template.\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'frontpage'.\n *\n * @since 3.0.0\n *\n * @see get_query_template()\n *\n * @return string Full path to front page template file.\n */\nfunction get_front_page_template() {\n\t$templates = array( 'front-page.php' );\n\n\treturn get_query_template( 'frontpage', $templates );\n}\n\n/**\n * Retrieve path of Privacy Policy page template in current or parent template.\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'privacypolicy'.\n *\n * @since 5.2.0\n *\n * @see get_query_template()\n *\n * @return string Full path to privacy policy template file.\n */\nfunction get_privacy_policy_template() {\n\t$templates = array( 'privacy-policy.php' );\n\n\treturn get_query_template( 'privacypolicy', $templates );\n}\n\n/**\n * Retrieve path of page template in current or parent template.\n *\n * The hierarchy for this template looks like:\n *\n * 1. {Page Template}.php\n * 2. page-{page_name}.php\n * 3. page-{id}.php\n * 4. page.php\n *\n * An example of this is:\n *\n * 1. page-templates/full-width.php\n * 2. page-about.php\n * 3. page-4.php\n * 4. page.php\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'page'.\n *\n * @since 1.5.0\n * @since 4.7.0 The decoded form of `page-{page_name}.php` was added to the top of the\n *              template hierarchy when the page name contains multibyte characters.\n *\n * @see get_query_template()\n *\n * @return string Full path to page template file.\n */\nfunction get_page_template() {\n\t$id       = get_queried_object_id();\n\t$template = get_page_template_slug();\n\t$pagename = get_query_var( 'pagename' );\n\n\tif ( ! $pagename && $id ) {\n\t\t// If a static page is set as the front page, $pagename will not be set.\n\t\t// Retrieve it from the queried object.\n\t\t$post = get_queried_object();\n\t\tif ( $post ) {\n\t\t\t$pagename = $post->post_name;\n\t\t}\n\t}\n\n\t$templates = array();\n\tif ( $template && 0 === validate_file( $template ) ) {\n\t\t$templates[] = $template;\n\t}\n\tif ( $pagename ) {\n\t\t$pagename_decoded = urldecode( $pagename );\n\t\tif ( $pagename_decoded !== $pagename ) {\n\t\t\t$templates[] = \"page-{$pagename_decoded}.php\";\n\t\t}\n\t\t$templates[] = \"page-{$pagename}.php\";\n\t}\n\tif ( $id ) {\n\t\t$templates[] = \"page-{$id}.php\";\n\t}\n\t$templates[] = 'page.php';\n\n\treturn get_query_template( 'page', $templates );\n}\n\n/**\n * Retrieve path of search template in current or parent template.\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'search'.\n *\n * @since 1.5.0\n *\n * @see get_query_template()\n *\n * @return string Full path to search template file.\n */\nfunction get_search_template() {\n\treturn get_query_template( 'search' );\n}\n\n/**\n * Retrieve path of single template in current or parent template. Applies to single Posts,\n * single Attachments, and single custom post types.\n *\n * The hierarchy for this template looks like:\n *\n * 1. {Post Type Template}.php\n * 2. single-{post_type}-{post_name}.php\n * 3. single-{post_type}.php\n * 4. single.php\n *\n * An example of this is:\n *\n * 1. templates/full-width.php\n * 2. single-post-hello-world.php\n * 3. single-post.php\n * 4. single.php\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'single'.\n *\n * @since 1.5.0\n * @since 4.4.0 `single-{post_type}-{post_name}.php` was added to the top of the template hierarchy.\n * @since 4.7.0 The decoded form of `single-{post_type}-{post_name}.php` was added to the top of the\n *              template hierarchy when the post name contains multibyte characters.\n * @since 4.7.0 `{Post Type Template}.php` was added to the top of the template hierarchy.\n *\n * @see get_query_template()\n *\n * @return string Full path to single template file.\n */\nfunction get_single_template() {\n\t$object = get_queried_object();\n\n\t$templates = array();\n\n\tif ( ! empty( $object->post_type ) ) {\n\t\t$template = get_page_template_slug( $object );\n\t\tif ( $template && 0 === validate_file( $template ) ) {\n\t\t\t$templates[] = $template;\n\t\t}\n\n\t\t$name_decoded = urldecode( $object->post_name );\n\t\tif ( $name_decoded !== $object->post_name ) {\n\t\t\t$templates[] = \"single-{$object->post_type}-{$name_decoded}.php\";\n\t\t}\n\n\t\t$templates[] = \"single-{$object->post_type}-{$object->post_name}.php\";\n\t\t$templates[] = \"single-{$object->post_type}.php\";\n\t}\n\n\t$templates[] = 'single.php';\n\n\treturn get_query_template( 'single', $templates );\n}\n\n/**\n * Retrieves an embed template path in the current or parent template.\n *\n * The hierarchy for this template looks like:\n *\n * 1. embed-{post_type}-{post_format}.php\n * 2. embed-{post_type}.php\n * 3. embed.php\n *\n * An example of this is:\n *\n * 1. embed-post-audio.php\n * 2. embed-post.php\n * 3. embed.php\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'embed'.\n *\n * @since 4.5.0\n *\n * @see get_query_template()\n *\n * @return string Full path to embed template file.\n */\nfunction get_embed_template() {\n\t$object = get_queried_object();\n\n\t$templates = array();\n\n\tif ( ! empty( $object->post_type ) ) {\n\t\t$post_format = get_post_format( $object );\n\t\tif ( $post_format ) {\n\t\t\t$templates[] = \"embed-{$object->post_type}-{$post_format}.php\";\n\t\t}\n\t\t$templates[] = \"embed-{$object->post_type}.php\";\n\t}\n\n\t$templates[] = 'embed.php';\n\n\treturn get_query_template( 'embed', $templates );\n}\n\n/**\n * Retrieves the path of the singular template in current or parent template.\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'singular'.\n *\n * @since 4.3.0\n *\n * @see get_query_template()\n *\n * @return string Full path to singular template file\n */\nfunction get_singular_template() {\n\treturn get_query_template( 'singular' );\n}\n\n/**\n * Retrieve path of attachment template in current or parent template.\n *\n * The hierarchy for this template looks like:\n *\n * 1. {mime_type}-{sub_type}.php\n * 2. {sub_type}.php\n * 3. {mime_type}.php\n * 4. attachment.php\n *\n * An example of this is:\n *\n * 1. image-jpeg.php\n * 2. jpeg.php\n * 3. image.php\n * 4. attachment.php\n *\n * The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}\n * and {@see '$type_template'} dynamic hooks, where `$type` is 'attachment'.\n *\n * @since 2.0.0\n * @since 4.3.0 The order of the mime type logic was reversed so the hierarchy is more logical.\n *\n * @see get_query_template()\n *\n * @global array $posts\n *\n * @return string Full path to attachment template file.\n */\nfunction get_attachment_template() {\n\t$attachment = get_queried_object();\n\n\t$templates = array();\n\n\tif ( $attachment ) {\n\t\tif ( false !== strpos( $attachment->post_mime_type, '/' ) ) {\n\t\t\tlist( $type, $subtype ) = explode( '/', $attachment->post_mime_type );\n\t\t} else {\n\t\t\tlist( $type, $subtype ) = array( $attachment->post_mime_type, '' );\n\t\t}\n\n\t\tif ( ! empty( $subtype ) ) {\n\t\t\t$templates[] = \"{$type}-{$subtype}.php\";\n\t\t\t$templates[] = \"{$subtype}.php\";\n\t\t}\n\t\t$templates[] = \"{$type}.php\";\n\t}\n\t$templates[] = 'attachment.php';\n\n\treturn get_query_template( 'attachment', $templates );\n}\n\n/**\n * Retrieve the name of the highest priority template file that exists.\n *\n * Searches in the STYLESHEETPATH before TEMPLATEPATH and wp-includes/theme-compat\n * so that themes which inherit from a parent theme can just overload one file.\n *\n * @since 2.7.0\n * @since 5.5.0 The `$args` parameter was added.\n *\n * @param string|array $template_names Template file(s) to search for, in order.\n * @param bool         $load           If true the template file will be loaded if it is found.\n * @param bool         $require_once   Whether to require_once or require. Has no effect if `$load` is false.\n *                                     Default true.\n * @param array        $args           Optional. Additional arguments passed to the template.\n *                                     Default empty array.\n * @return string The template filename if one is located.\n */\nfunction locate_template( $template_names, $load = false, $require_once = true, $args = array() ) {\n\t$located = '';\n\tforeach ( (array) $template_names as $template_name ) {\n\t\tif ( ! $template_name ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( file_exists( STYLESHEETPATH . '/' . $template_name ) ) {\n\t\t\t$located = STYLESHEETPATH . '/' . $template_name;\n\t\t\tbreak;\n\t\t} elseif ( file_exists( TEMPLATEPATH . '/' . $template_name ) ) {\n\t\t\t$located = TEMPLATEPATH . '/' . $template_name;\n\t\t\tbreak;\n\t\t} elseif ( file_exists( ABSPATH . WPINC . '/theme-compat/' . $template_name ) ) {\n\t\t\t$located = ABSPATH . WPINC . '/theme-compat/' . $template_name;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ( $load && '' !== $located ) {\n\t\tload_template( $located, $require_once, $args );\n\t}\n\n\treturn $located;\n}\n\n/**\n * Require the template file with WordPress environment.\n *\n * The globals are set up for the template file to ensure that the WordPress\n * environment is available from within the function. The query variables are\n * also available.\n *\n * @since 1.5.0\n * @since 5.5.0 The `$args` parameter was added.\n *\n * @global array      $posts\n * @global WP_Post    $post          Global post object.\n * @global bool       $wp_did_header\n * @global WP_Query   $wp_query      WordPress Query object.\n * @global WP_Rewrite $wp_rewrite    WordPress rewrite component.\n * @global wpdb       $wpdb          WordPress database abstraction object.\n * @global string     $wp_version\n * @global WP         $wp            Current WordPress environment instance.\n * @global int        $id\n * @global WP_Comment $comment       Global comment object.\n * @global int        $user_ID\n *\n * @param string $_template_file Path to template file.\n * @param bool   $require_once   Whether to require_once or require. Default true.\n * @param array  $args           Optional. Additional arguments passed to the template.\n *                               Default empty array.\n */\nfunction load_template( $_template_file, $require_once = true, $args = array() ) {\n\tglobal $posts, $post, $wp_did_header, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID;\n\n\tif ( is_array( $wp_query->query_vars ) ) {\n\t\t/*\n\t\t * This use of extract() cannot be removed. There are many possible ways that\n\t\t * templates could depend on variables that it creates existing, and no way to\n\t\t * detect and deprecate it.\n\t\t *\n\t\t * Passing the EXTR_SKIP flag is the safest option, ensuring globals and\n\t\t * function variables cannot be overwritten.\n\t\t */\n\t\t// phpcs:ignore WordPress.PHP.DontExtract.extract_extract\n\t\textract( $wp_query->query_vars, EXTR_SKIP );\n\t}\n\n\tif ( isset( $s ) ) {\n\t\t$s = esc_attr( $s );\n\t}\n\n\tif ( $require_once ) {\n\t\trequire_once $_template_file;\n\t} else {\n\t\trequire $_template_file;\n\t}\n}\n", "num_lines": 735}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Theme, template, and stylesheet functions.\n *\n * @package WordPress\n * @subpackage Theme\n */\n\n/**\n * Returns an array of WP_Theme objects based on the arguments.\n *\n * Despite advances over get_themes(), this function is quite expensive, and grows\n * linearly with additional themes. Stick to wp_get_theme() if possible.\n *\n * @since 3.4.0\n *\n * @global array $wp_theme_directories\n *\n * @param array $args {\n *     Optional. The search arguments.\n *\n *     @type mixed $errors  True to return themes with errors, false to return\n *                          themes without errors, null to return all themes.\n *                          Default false.\n *     @type mixed $allowed (Multisite) True to return only allowed themes for a site.\n *                          False to return only disallowed themes for a site.\n *                          'site' to return only site-allowed themes.\n *                          'network' to return only network-allowed themes.\n *                          Null to return all themes. Default null.\n *     @type int   $blog_id (Multisite) The blog ID used to calculate which themes\n *                          are allowed. Default 0, synonymous for the current blog.\n * }\n * @return WP_Theme[] Array of WP_Theme objects.\n */\nfunction wp_get_themes( $args = array() ) {\n\tglobal $wp_theme_directories;\n\n\t$defaults = array(\n\t\t'errors'  => false,\n\t\t'allowed' => null,\n\t\t'blog_id' => 0,\n\t);\n\t$args     = wp_parse_args( $args, $defaults );\n\n\t$theme_directories = search_theme_directories();\n\n\tif ( is_array( $wp_theme_directories ) && count( $wp_theme_directories ) > 1 ) {\n\t\t// Make sure the current theme wins out, in case search_theme_directories() picks the wrong\n\t\t// one in the case of a conflict. (Normally, last registered theme root wins.)\n\t\t$current_theme = get_stylesheet();\n\t\tif ( isset( $theme_directories[ $current_theme ] ) ) {\n\t\t\t$root_of_current_theme = get_raw_theme_root( $current_theme );\n\t\t\tif ( ! in_array( $root_of_current_theme, $wp_theme_directories, true ) ) {\n\t\t\t\t$root_of_current_theme = WP_CONTENT_DIR . $root_of_current_theme;\n\t\t\t}\n\t\t\t$theme_directories[ $current_theme ]['theme_root'] = $root_of_current_theme;\n\t\t}\n\t}\n\n\tif ( empty( $theme_directories ) ) {\n\t\treturn array();\n\t}\n\n\tif ( is_multisite() && null !== $args['allowed'] ) {\n\t\t$allowed = $args['allowed'];\n\t\tif ( 'network' === $allowed ) {\n\t\t\t$theme_directories = array_intersect_key( $theme_directories, WP_Theme::get_allowed_on_network() );\n\t\t} elseif ( 'site' === $allowed ) {\n\t\t\t$theme_directories = array_intersect_key( $theme_directories, WP_Theme::get_allowed_on_site( $args['blog_id'] ) );\n\t\t} elseif ( $allowed ) {\n\t\t\t$theme_directories = array_intersect_key( $theme_directories, WP_Theme::get_allowed( $args['blog_id'] ) );\n\t\t} else {\n\t\t\t$theme_directories = array_diff_key( $theme_directories, WP_Theme::get_allowed( $args['blog_id'] ) );\n\t\t}\n\t}\n\n\t$themes         = array();\n\tstatic $_themes = array();\n\n\tforeach ( $theme_directories as $theme => $theme_root ) {\n\t\tif ( isset( $_themes[ $theme_root['theme_root'] . '/' . $theme ] ) ) {\n\t\t\t$themes[ $theme ] = $_themes[ $theme_root['theme_root'] . '/' . $theme ];\n\t\t} else {\n\t\t\t$themes[ $theme ] = new WP_Theme( $theme, $theme_root['theme_root'] );\n\n\t\t\t$_themes[ $theme_root['theme_root'] . '/' . $theme ] = $themes[ $theme ];\n\t\t}\n\t}\n\n\tif ( null !== $args['errors'] ) {\n\t\tforeach ( $themes as $theme => $wp_theme ) {\n\t\t\tif ( $wp_theme->errors() != $args['errors'] ) {\n\t\t\t\tunset( $themes[ $theme ] );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $themes;\n}\n\n/**\n * Gets a WP_Theme object for a theme.\n *\n * @since 3.4.0\n *\n * @global array $wp_theme_directories\n *\n * @param string $stylesheet Optional. Directory name for the theme. Defaults to current theme.\n * @param string $theme_root Optional. Absolute path of the theme root to look in.\n *                           If not specified, get_raw_theme_root() is used to calculate\n *                           the theme root for the $stylesheet provided (or current theme).\n * @return WP_Theme Theme object. Be sure to check the object's exists() method\n *                  if you need to confirm the theme's existence.\n */\nfunction wp_get_theme( $stylesheet = '', $theme_root = '' ) {\n\tglobal $wp_theme_directories;\n\n\tif ( empty( $stylesheet ) ) {\n\t\t$stylesheet = get_stylesheet();\n\t}\n\n\tif ( empty( $theme_root ) ) {\n\t\t$theme_root = get_raw_theme_root( $stylesheet );\n\t\tif ( false === $theme_root ) {\n\t\t\t$theme_root = WP_CONTENT_DIR . '/themes';\n\t\t} elseif ( ! in_array( $theme_root, (array) $wp_theme_directories, true ) ) {\n\t\t\t$theme_root = WP_CONTENT_DIR . $theme_root;\n\t\t}\n\t}\n\n\treturn new WP_Theme( $stylesheet, $theme_root );\n}\n\n/**\n * Clears the cache held by get_theme_roots() and WP_Theme.\n *\n * @since 3.5.0\n * @param bool $clear_update_cache Whether to clear the theme updates cache.\n */\nfunction wp_clean_themes_cache( $clear_update_cache = true ) {\n\tif ( $clear_update_cache ) {\n\t\tdelete_site_transient( 'update_themes' );\n\t}\n\tsearch_theme_directories( true );\n\tforeach ( wp_get_themes( array( 'errors' => null ) ) as $theme ) {\n\t\t$theme->cache_delete();\n\t}\n}\n\n/**\n * Whether a child theme is in use.\n *\n * @since 3.0.0\n *\n * @return bool True if a child theme is in use, false otherwise.\n */\nfunction is_child_theme() {\n\treturn ( TEMPLATEPATH !== STYLESHEETPATH );\n}\n\n/**\n * Retrieves name of the current stylesheet.\n *\n * The theme name that is currently set as the front end theme.\n *\n * For all intents and purposes, the template name and the stylesheet name\n * are going to be the same for most cases.\n *\n * @since 1.5.0\n *\n * @return string Stylesheet name.\n */\nfunction get_stylesheet() {\n\t/**\n\t * Filters the name of current stylesheet.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $stylesheet Name of the current stylesheet.\n\t */\n\treturn apply_filters( 'stylesheet', get_option( 'stylesheet' ) );\n}\n\n/**\n * Retrieves stylesheet directory path for current theme.\n *\n * @since 1.5.0\n *\n * @return string Path to current theme's stylesheet directory.\n */\nfunction get_stylesheet_directory() {\n\t$stylesheet     = get_stylesheet();\n\t$theme_root     = get_theme_root( $stylesheet );\n\t$stylesheet_dir = \"$theme_root/$stylesheet\";\n\n\t/**\n\t * Filters the stylesheet directory path for current theme.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $stylesheet_dir Absolute path to the current theme.\n\t * @param string $stylesheet     Directory name of the current theme.\n\t * @param string $theme_root     Absolute path to themes directory.\n\t */\n\treturn apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root );\n}\n\n/**\n * Retrieves stylesheet directory URI for current theme.\n *\n * @since 1.5.0\n *\n * @return string URI to current theme's stylesheet directory.\n */\nfunction get_stylesheet_directory_uri() {\n\t$stylesheet         = str_replace( '%2F', '/', rawurlencode( get_stylesheet() ) );\n\t$theme_root_uri     = get_theme_root_uri( $stylesheet );\n\t$stylesheet_dir_uri = \"$theme_root_uri/$stylesheet\";\n\n\t/**\n\t * Filters the stylesheet directory URI.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $stylesheet_dir_uri Stylesheet directory URI.\n\t * @param string $stylesheet         Name of the activated theme's directory.\n\t * @param string $theme_root_uri     Themes root URI.\n\t */\n\treturn apply_filters( 'stylesheet_directory_uri', $stylesheet_dir_uri, $stylesheet, $theme_root_uri );\n}\n\n/**\n * Retrieves stylesheet URI for current theme.\n *\n * The stylesheet file name is 'style.css' which is appended to the stylesheet directory URI path.\n * See get_stylesheet_directory_uri().\n *\n * @since 1.5.0\n *\n * @return string URI to current theme's stylesheet.\n */\nfunction get_stylesheet_uri() {\n\t$stylesheet_dir_uri = get_stylesheet_directory_uri();\n\t$stylesheet_uri     = $stylesheet_dir_uri . '/style.css';\n\t/**\n\t * Filters the URI of the current theme stylesheet.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $stylesheet_uri     Stylesheet URI for the current theme/child theme.\n\t * @param string $stylesheet_dir_uri Stylesheet directory URI for the current theme/child theme.\n\t */\n\treturn apply_filters( 'stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri );\n}\n\n/**\n * Retrieves the localized stylesheet URI.\n *\n * The stylesheet directory for the localized stylesheet files are located, by\n * default, in the base theme directory. The name of the locale file will be the\n * locale followed by '.css'. If that does not exist, then the text direction\n * stylesheet will be checked for existence, for example 'ltr.css'.\n *\n * The theme may change the location of the stylesheet directory by either using\n * the {@see 'stylesheet_directory_uri'} or {@see 'locale_stylesheet_uri'} filters.\n *\n * If you want to change the location of the stylesheet files for the entire\n * WordPress workflow, then change the former. If you just have the locale in a\n * separate folder, then change the latter.\n *\n * @since 2.1.0\n *\n * @global WP_Locale $wp_locale WordPress date and time locale object.\n *\n * @return string URI to current theme's localized stylesheet.\n */\nfunction get_locale_stylesheet_uri() {\n\tglobal $wp_locale;\n\t$stylesheet_dir_uri = get_stylesheet_directory_uri();\n\t$dir                = get_stylesheet_directory();\n\t$locale             = get_locale();\n\tif ( file_exists( \"$dir/$locale.css\" ) ) {\n\t\t$stylesheet_uri = \"$stylesheet_dir_uri/$locale.css\";\n\t} elseif ( ! empty( $wp_locale->text_direction ) && file_exists( \"$dir/{$wp_locale->text_direction}.css\" ) ) {\n\t\t$stylesheet_uri = \"$stylesheet_dir_uri/{$wp_locale->text_direction}.css\";\n\t} else {\n\t\t$stylesheet_uri = '';\n\t}\n\t/**\n\t * Filters the localized stylesheet URI.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $stylesheet_uri     Localized stylesheet URI.\n\t * @param string $stylesheet_dir_uri Stylesheet directory URI.\n\t */\n\treturn apply_filters( 'locale_stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri );\n}\n\n/**\n * Retrieves name of the current theme.\n *\n * @since 1.5.0\n *\n * @return string Template name.\n */\nfunction get_template() {\n\t/**\n\t * Filters the name of the current theme.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $template Current theme's directory name.\n\t */\n\treturn apply_filters( 'template', get_option( 'template' ) );\n}\n\n/**\n * Retrieves template directory path for current theme.\n *\n * @since 1.5.0\n *\n * @return string Path to current theme's template directory.\n */\nfunction get_template_directory() {\n\t$template     = get_template();\n\t$theme_root   = get_theme_root( $template );\n\t$template_dir = \"$theme_root/$template\";\n\n\t/**\n\t * Filters the current theme directory path.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $template_dir The path of the current theme directory.\n\t * @param string $template     Directory name of the current theme.\n\t * @param string $theme_root   Absolute path to the themes directory.\n\t */\n\treturn apply_filters( 'template_directory', $template_dir, $template, $theme_root );\n}\n\n/**\n * Retrieves template directory URI for current theme.\n *\n * @since 1.5.0\n *\n * @return string URI to current theme's template directory.\n */\nfunction get_template_directory_uri() {\n\t$template         = str_replace( '%2F', '/', rawurlencode( get_template() ) );\n\t$theme_root_uri   = get_theme_root_uri( $template );\n\t$template_dir_uri = \"$theme_root_uri/$template\";\n\n\t/**\n\t * Filters the current theme directory URI.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $template_dir_uri The URI of the current theme directory.\n\t * @param string $template         Directory name of the current theme.\n\t * @param string $theme_root_uri   The themes root URI.\n\t */\n\treturn apply_filters( 'template_directory_uri', $template_dir_uri, $template, $theme_root_uri );\n}\n\n/**\n * Retrieves theme roots.\n *\n * @since 2.9.0\n *\n * @global array $wp_theme_directories\n *\n * @return array|string An array of theme roots keyed by template/stylesheet\n *                      or a single theme root if all themes have the same root.\n */\nfunction get_theme_roots() {\n\tglobal $wp_theme_directories;\n\n\tif ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) {\n\t\treturn '/themes';\n\t}\n\n\t$theme_roots = get_site_transient( 'theme_roots' );\n\tif ( false === $theme_roots ) {\n\t\tsearch_theme_directories( true ); // Regenerate the transient.\n\t\t$theme_roots = get_site_transient( 'theme_roots' );\n\t}\n\treturn $theme_roots;\n}\n\n/**\n * Registers a directory that contains themes.\n *\n * @since 2.9.0\n *\n * @global array $wp_theme_directories\n *\n * @param string $directory Either the full filesystem path to a theme folder\n *                          or a folder within WP_CONTENT_DIR.\n * @return bool True if successfully registered a directory that contains themes,\n *              false if the directory does not exist.\n */\nfunction register_theme_directory( $directory ) {\n\tglobal $wp_theme_directories;\n\n\tif ( ! file_exists( $directory ) ) {\n\t\t// Try prepending as the theme directory could be relative to the content directory.\n\t\t$directory = WP_CONTENT_DIR . '/' . $directory;\n\t\t// If this directory does not exist, return and do not register.\n\t\tif ( ! file_exists( $directory ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif ( ! is_array( $wp_theme_directories ) ) {\n\t\t$wp_theme_directories = array();\n\t}\n\n\t$untrailed = untrailingslashit( $directory );\n\tif ( ! empty( $untrailed ) && ! in_array( $untrailed, $wp_theme_directories, true ) ) {\n\t\t$wp_theme_directories[] = $untrailed;\n\t}\n\n\treturn true;\n}\n\n/**\n * Searches all registered theme directories for complete and valid themes.\n *\n * @since 2.9.0\n *\n * @global array $wp_theme_directories\n *\n * @param bool $force Optional. Whether to force a new directory scan. Default false.\n * @return array|false Valid themes found on success, false on failure.\n */\nfunction search_theme_directories( $force = false ) {\n\tglobal $wp_theme_directories;\n\tstatic $found_themes = null;\n\n\tif ( empty( $wp_theme_directories ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! $force && isset( $found_themes ) ) {\n\t\treturn $found_themes;\n\t}\n\n\t$found_themes = array();\n\n\t$wp_theme_directories = (array) $wp_theme_directories;\n\t$relative_theme_roots = array();\n\n\t/*\n\t * Set up maybe-relative, maybe-absolute array of theme directories.\n\t * We always want to return absolute, but we need to cache relative\n\t * to use in get_theme_root().\n\t */\n\tforeach ( $wp_theme_directories as $theme_root ) {\n\t\tif ( 0 === strpos( $theme_root, WP_CONTENT_DIR ) ) {\n\t\t\t$relative_theme_roots[ str_replace( WP_CONTENT_DIR, '', $theme_root ) ] = $theme_root;\n\t\t} else {\n\t\t\t$relative_theme_roots[ $theme_root ] = $theme_root;\n\t\t}\n\t}\n\n\t/**\n\t * Filters whether to get the cache of the registered theme directories.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param bool   $cache_expiration Whether to get the cache of the theme directories. Default false.\n\t * @param string $context          The class or function name calling the filter.\n\t */\n\t$cache_expiration = apply_filters( 'wp_cache_themes_persistently', false, 'search_theme_directories' );\n\n\tif ( $cache_expiration ) {\n\t\t$cached_roots = get_site_transient( 'theme_roots' );\n\t\tif ( is_array( $cached_roots ) ) {\n\t\t\tforeach ( $cached_roots as $theme_dir => $theme_root ) {\n\t\t\t\t// A cached theme root is no longer around, so skip it.\n\t\t\t\tif ( ! isset( $relative_theme_roots[ $theme_root ] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$found_themes[ $theme_dir ] = array(\n\t\t\t\t\t'theme_file' => $theme_dir . '/style.css',\n\t\t\t\t\t'theme_root' => $relative_theme_roots[ $theme_root ], // Convert relative to absolute.\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn $found_themes;\n\t\t}\n\t\tif ( ! is_int( $cache_expiration ) ) {\n\t\t\t$cache_expiration = 30 * MINUTE_IN_SECONDS;\n\t\t}\n\t} else {\n\t\t$cache_expiration = 30 * MINUTE_IN_SECONDS;\n\t}\n\n\t/* Loop the registered theme directories and extract all themes */\n\tforeach ( $wp_theme_directories as $theme_root ) {\n\n\t\t// Start with directories in the root of the current theme directory.\n\t\t$dirs = @ scandir( $theme_root );\n\t\tif ( ! $dirs ) {\n\t\t\ttrigger_error( \"$theme_root is not readable\", E_USER_NOTICE );\n\t\t\tcontinue;\n\t\t}\n\t\tforeach ( $dirs as $dir ) {\n\t\t\tif ( ! is_dir( $theme_root . '/' . $dir ) || '.' === $dir[0] || 'CVS' === $dir ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( file_exists( $theme_root . '/' . $dir . '/style.css' ) ) {\n\t\t\t\t// wp-content/themes/a-single-theme\n\t\t\t\t// wp-content/themes is $theme_root, a-single-theme is $dir.\n\t\t\t\t$found_themes[ $dir ] = array(\n\t\t\t\t\t'theme_file' => $dir . '/style.css',\n\t\t\t\t\t'theme_root' => $theme_root,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$found_theme = false;\n\t\t\t\t// wp-content/themes/a-folder-of-themes/*\n\t\t\t\t// wp-content/themes is $theme_root, a-folder-of-themes is $dir, then themes are $sub_dirs.\n\t\t\t\t$sub_dirs = @ scandir( $theme_root . '/' . $dir );\n\t\t\t\tif ( ! $sub_dirs ) {\n\t\t\t\t\ttrigger_error( \"$theme_root/$dir is not readable\", E_USER_NOTICE );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach ( $sub_dirs as $sub_dir ) {\n\t\t\t\t\tif ( ! is_dir( $theme_root . '/' . $dir . '/' . $sub_dir ) || '.' === $dir[0] || 'CVS' === $dir ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! file_exists( $theme_root . '/' . $dir . '/' . $sub_dir . '/style.css' ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$found_themes[ $dir . '/' . $sub_dir ] = array(\n\t\t\t\t\t\t'theme_file' => $dir . '/' . $sub_dir . '/style.css',\n\t\t\t\t\t\t'theme_root' => $theme_root,\n\t\t\t\t\t);\n\t\t\t\t\t$found_theme                           = true;\n\t\t\t\t}\n\t\t\t\t// Never mind the above, it's just a theme missing a style.css.\n\t\t\t\t// Return it; WP_Theme will catch the error.\n\t\t\t\tif ( ! $found_theme ) {\n\t\t\t\t\t$found_themes[ $dir ] = array(\n\t\t\t\t\t\t'theme_file' => $dir . '/style.css',\n\t\t\t\t\t\t'theme_root' => $theme_root,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tasort( $found_themes );\n\n\t$theme_roots          = array();\n\t$relative_theme_roots = array_flip( $relative_theme_roots );\n\n\tforeach ( $found_themes as $theme_dir => $theme_data ) {\n\t\t$theme_roots[ $theme_dir ] = $relative_theme_roots[ $theme_data['theme_root'] ]; // Convert absolute to relative.\n\t}\n\n\tif ( get_site_transient( 'theme_roots' ) != $theme_roots ) {\n\t\tset_site_transient( 'theme_roots', $theme_roots, $cache_expiration );\n\t}\n\n\treturn $found_themes;\n}\n\n/**\n * Retrieves path to themes directory.\n *\n * Does not have trailing slash.\n *\n * @since 1.5.0\n *\n * @global array $wp_theme_directories\n *\n * @param string $stylesheet_or_template Optional. The stylesheet or template name of the theme.\n *                                       Default is to leverage the main theme root.\n * @return string Themes directory path.\n */\nfunction get_theme_root( $stylesheet_or_template = '' ) {\n\tglobal $wp_theme_directories;\n\n\t$theme_root = '';\n\n\tif ( $stylesheet_or_template ) {\n\t\t$theme_root = get_raw_theme_root( $stylesheet_or_template );\n\t\tif ( $theme_root ) {\n\t\t\t// Always prepend WP_CONTENT_DIR unless the root currently registered as a theme directory.\n\t\t\t// This gives relative theme roots the benefit of the doubt when things go haywire.\n\t\t\tif ( ! in_array( $theme_root, (array) $wp_theme_directories, true ) ) {\n\t\t\t\t$theme_root = WP_CONTENT_DIR . $theme_root;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! $theme_root ) {\n\t\t$theme_root = WP_CONTENT_DIR . '/themes';\n\t}\n\n\t/**\n\t * Filters the absolute path to the themes directory.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $theme_root Absolute path to themes directory.\n\t */\n\treturn apply_filters( 'theme_root', $theme_root );\n}\n\n/**\n * Retrieves URI for themes directory.\n *\n * Does not have trailing slash.\n *\n * @since 1.5.0\n *\n * @global array $wp_theme_directories\n *\n * @param string $stylesheet_or_template Optional. The stylesheet or template name of the theme.\n *                                       Default is to leverage the main theme root.\n * @param string $theme_root             Optional. The theme root for which calculations will be based,\n *                                       preventing the need for a get_raw_theme_root() call. Default empty.\n * @return string Themes directory URI.\n */\nfunction get_theme_root_uri( $stylesheet_or_template = '', $theme_root = '' ) {\n\tglobal $wp_theme_directories;\n\n\tif ( $stylesheet_or_template && ! $theme_root ) {\n\t\t$theme_root = get_raw_theme_root( $stylesheet_or_template );\n\t}\n\n\tif ( $stylesheet_or_template && $theme_root ) {\n\t\tif ( in_array( $theme_root, (array) $wp_theme_directories, true ) ) {\n\t\t\t// Absolute path. Make an educated guess. YMMV -- but note the filter below.\n\t\t\tif ( 0 === strpos( $theme_root, WP_CONTENT_DIR ) ) {\n\t\t\t\t$theme_root_uri = content_url( str_replace( WP_CONTENT_DIR, '', $theme_root ) );\n\t\t\t} elseif ( 0 === strpos( $theme_root, ABSPATH ) ) {\n\t\t\t\t$theme_root_uri = site_url( str_replace( ABSPATH, '', $theme_root ) );\n\t\t\t} elseif ( 0 === strpos( $theme_root, WP_PLUGIN_DIR ) || 0 === strpos( $theme_root, WPMU_PLUGIN_DIR ) ) {\n\t\t\t\t$theme_root_uri = plugins_url( basename( $theme_root ), $theme_root );\n\t\t\t} else {\n\t\t\t\t$theme_root_uri = $theme_root;\n\t\t\t}\n\t\t} else {\n\t\t\t$theme_root_uri = content_url( $theme_root );\n\t\t}\n\t} else {\n\t\t$theme_root_uri = content_url( 'themes' );\n\t}\n\n\t/**\n\t * Filters the URI for themes directory.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $theme_root_uri         The URI for themes directory.\n\t * @param string $siteurl                WordPress web address which is set in General Options.\n\t * @param string $stylesheet_or_template The stylesheet or template name of the theme.\n\t */\n\treturn apply_filters( 'theme_root_uri', $theme_root_uri, get_option( 'siteurl' ), $stylesheet_or_template );\n}\n\n/**\n * Gets the raw theme root relative to the content directory with no filters applied.\n *\n * @since 3.1.0\n *\n * @global array $wp_theme_directories\n *\n * @param string $stylesheet_or_template The stylesheet or template name of the theme.\n * @param bool   $skip_cache             Optional. Whether to skip the cache.\n *                                       Defaults to false, meaning the cache is used.\n * @return string Theme root.\n */\nfunction get_raw_theme_root( $stylesheet_or_template, $skip_cache = false ) {\n\tglobal $wp_theme_directories;\n\n\tif ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) {\n\t\treturn '/themes';\n\t}\n\n\t$theme_root = false;\n\n\t// If requesting the root for the current theme, consult options to avoid calling get_theme_roots().\n\tif ( ! $skip_cache ) {\n\t\tif ( get_option( 'stylesheet' ) == $stylesheet_or_template ) {\n\t\t\t$theme_root = get_option( 'stylesheet_root' );\n\t\t} elseif ( get_option( 'template' ) == $stylesheet_or_template ) {\n\t\t\t$theme_root = get_option( 'template_root' );\n\t\t}\n\t}\n\n\tif ( empty( $theme_root ) ) {\n\t\t$theme_roots = get_theme_roots();\n\t\tif ( ! empty( $theme_roots[ $stylesheet_or_template ] ) ) {\n\t\t\t$theme_root = $theme_roots[ $stylesheet_or_template ];\n\t\t}\n\t}\n\n\treturn $theme_root;\n}\n\n/**\n * Displays localized stylesheet link element.\n *\n * @since 2.1.0\n */\nfunction locale_stylesheet() {\n\t$stylesheet = get_locale_stylesheet_uri();\n\tif ( empty( $stylesheet ) ) {\n\t\treturn;\n\t}\n\n\t$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type=\"text/css\"';\n\n\tprintf(\n\t\t'<link rel=\"stylesheet\" href=\"%s\"%s media=\"screen\" />',\n\t\t$stylesheet,\n\t\t$type_attr\n\t);\n}\n\n/**\n * Switches the theme.\n *\n * Accepts one argument: $stylesheet of the theme. It also accepts an additional function signature\n * of two arguments: $template then $stylesheet. This is for backward compatibility.\n *\n * @since 2.5.0\n *\n * @global array                $wp_theme_directories\n * @global WP_Customize_Manager $wp_customize\n * @global array                $sidebars_widgets\n *\n * @param string $stylesheet Stylesheet name.\n */\nfunction switch_theme( $stylesheet ) {\n\tglobal $wp_theme_directories, $wp_customize, $sidebars_widgets;\n\n\t$requirements = validate_theme_requirements( $stylesheet );\n\tif ( is_wp_error( $requirements ) ) {\n\t\twp_die( $requirements );\n\t}\n\n\t$_sidebars_widgets = null;\n\tif ( 'wp_ajax_customize_save' === current_action() ) {\n\t\t$old_sidebars_widgets_data_setting = $wp_customize->get_setting( 'old_sidebars_widgets_data' );\n\t\tif ( $old_sidebars_widgets_data_setting ) {\n\t\t\t$_sidebars_widgets = $wp_customize->post_value( $old_sidebars_widgets_data_setting );\n\t\t}\n\t} elseif ( is_array( $sidebars_widgets ) ) {\n\t\t$_sidebars_widgets = $sidebars_widgets;\n\t}\n\n\tif ( is_array( $_sidebars_widgets ) ) {\n\t\tset_theme_mod(\n\t\t\t'sidebars_widgets',\n\t\t\tarray(\n\t\t\t\t'time' => time(),\n\t\t\t\t'data' => $_sidebars_widgets,\n\t\t\t)\n\t\t);\n\t}\n\n\t$nav_menu_locations = get_theme_mod( 'nav_menu_locations' );\n\tupdate_option( 'theme_switch_menu_locations', $nav_menu_locations );\n\n\tif ( func_num_args() > 1 ) {\n\t\t$stylesheet = func_get_arg( 1 );\n\t}\n\n\t$old_theme = wp_get_theme();\n\t$new_theme = wp_get_theme( $stylesheet );\n\t$template  = $new_theme->get_template();\n\n\tif ( wp_is_recovery_mode() ) {\n\t\t$paused_themes = wp_paused_themes();\n\t\t$paused_themes->delete( $old_theme->get_stylesheet() );\n\t\t$paused_themes->delete( $old_theme->get_template() );\n\t}\n\n\tupdate_option( 'template', $template );\n\tupdate_option( 'stylesheet', $stylesheet );\n\n\tif ( count( $wp_theme_directories ) > 1 ) {\n\t\tupdate_option( 'template_root', get_raw_theme_root( $template, true ) );\n\t\tupdate_option( 'stylesheet_root', get_raw_theme_root( $stylesheet, true ) );\n\t} else {\n\t\tdelete_option( 'template_root' );\n\t\tdelete_option( 'stylesheet_root' );\n\t}\n\n\t$new_name = $new_theme->get( 'Name' );\n\n\tupdate_option( 'current_theme', $new_name );\n\n\t// Migrate from the old mods_{name} option to theme_mods_{slug}.\n\tif ( is_admin() && false === get_option( 'theme_mods_' . $stylesheet ) ) {\n\t\t$default_theme_mods = (array) get_option( 'mods_' . $new_name );\n\t\tif ( ! empty( $nav_menu_locations ) && empty( $default_theme_mods['nav_menu_locations'] ) ) {\n\t\t\t$default_theme_mods['nav_menu_locations'] = $nav_menu_locations;\n\t\t}\n\t\tadd_option( \"theme_mods_$stylesheet\", $default_theme_mods );\n\t} else {\n\t\t/*\n\t\t * Since retrieve_widgets() is called when initializing a theme in the Customizer,\n\t\t * we need to remove the theme mods to avoid overwriting changes made via\n\t\t * the Customizer when accessing wp-admin/widgets.php.\n\t\t */\n\t\tif ( 'wp_ajax_customize_save' === current_action() ) {\n\t\t\tremove_theme_mod( 'sidebars_widgets' );\n\t\t}\n\t}\n\n\tupdate_option( 'theme_switched', $old_theme->get_stylesheet() );\n\n\t/**\n\t * Fires after the theme is switched.\n\t *\n\t * @since 1.5.0\n\t * @since 4.5.0 Introduced the `$old_theme` parameter.\n\t *\n\t * @param string   $new_name  Name of the new theme.\n\t * @param WP_Theme $new_theme WP_Theme instance of the new theme.\n\t * @param WP_Theme $old_theme WP_Theme instance of the old theme.\n\t */\n\tdo_action( 'switch_theme', $new_name, $new_theme, $old_theme );\n}\n\n/**\n * Checks that the current theme has 'index.php' and 'style.css' files.\n *\n * Does not initially check the default theme, which is the fallback and should always exist.\n * But if it doesn't exist, it'll fall back to the latest core default theme that does exist.\n * Will switch theme to the fallback theme if current theme does not validate.\n *\n * You can use the {@see 'validate_current_theme'} filter to return false to disable\n * this functionality.\n *\n * @since 1.5.0\n *\n * @see WP_DEFAULT_THEME\n *\n * @return bool\n */\nfunction validate_current_theme() {\n\t/**\n\t * Filters whether to validate the current theme.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param bool $validate Whether to validate the current theme. Default true.\n\t */\n\tif ( wp_installing() || ! apply_filters( 'validate_current_theme', true ) ) {\n\t\treturn true;\n\t}\n\n\tif ( ! file_exists( get_template_directory() . '/index.php' ) ) {\n\t\t// Invalid.\n\t} elseif ( ! file_exists( get_template_directory() . '/style.css' ) ) {\n\t\t// Invalid.\n\t} elseif ( is_child_theme() && ! file_exists( get_stylesheet_directory() . '/style.css' ) ) {\n\t\t// Invalid.\n\t} else {\n\t\t// Valid.\n\t\treturn true;\n\t}\n\n\t$default = wp_get_theme( WP_DEFAULT_THEME );\n\tif ( $default->exists() ) {\n\t\tswitch_theme( WP_DEFAULT_THEME );\n\t\treturn false;\n\t}\n\n\t/**\n\t * If we're in an invalid state but WP_DEFAULT_THEME doesn't exist,\n\t * switch to the latest core default theme that's installed.\n\t *\n\t * If it turns out that this latest core default theme is our current\n\t * theme, then there's nothing we can do about that, so we have to bail,\n\t * rather than going into an infinite loop. (This is why there are\n\t * checks against WP_DEFAULT_THEME above, also.) We also can't do anything\n\t * if it turns out there is no default theme installed. (That's `false`.)\n\t */\n\t$default = WP_Theme::get_core_default_theme();\n\tif ( false === $default || get_stylesheet() == $default->get_stylesheet() ) {\n\t\treturn true;\n\t}\n\n\tswitch_theme( $default->get_stylesheet() );\n\treturn false;\n}\n\n/**\n * Validates the theme requirements for WordPress version and PHP version.\n *\n * Uses the information from `Requires at least` and `Requires PHP` headers\n * defined in the theme's `style.css` file.\n *\n * If the headers are not present in the theme's stylesheet file,\n * `readme.txt` is also checked as a fallback.\n *\n * @since 5.5.0\n *\n * @param string $stylesheet Directory name for the theme.\n * @return true|WP_Error True if requirements are met, WP_Error on failure.\n */\nfunction validate_theme_requirements( $stylesheet ) {\n\t$theme = wp_get_theme( $stylesheet );\n\n\t$requirements = array(\n\t\t'requires'     => ! empty( $theme->get( 'RequiresWP' ) ) ? $theme->get( 'RequiresWP' ) : '',\n\t\t'requires_php' => ! empty( $theme->get( 'RequiresPHP' ) ) ? $theme->get( 'RequiresPHP' ) : '',\n\t);\n\n\t$readme_file = $theme->theme_root . '/' . $stylesheet . '/readme.txt';\n\n\tif ( file_exists( $readme_file ) ) {\n\t\t$readme_headers = get_file_data(\n\t\t\t$readme_file,\n\t\t\tarray(\n\t\t\t\t'requires'     => 'Requires at least',\n\t\t\t\t'requires_php' => 'Requires PHP',\n\t\t\t),\n\t\t\t'theme'\n\t\t);\n\n\t\t$requirements = array_merge( $readme_headers, $requirements );\n\t}\n\n\t$compatible_wp  = is_wp_version_compatible( $requirements['requires'] );\n\t$compatible_php = is_php_version_compatible( $requirements['requires_php'] );\n\n\tif ( ! $compatible_wp && ! $compatible_php ) {\n\t\treturn new WP_Error(\n\t\t\t'theme_wp_php_incompatible',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t_x( '<strong>Error:</strong> Current WordPress and PHP versions do not meet minimum requirements for %s.', 'theme' ),\n\t\t\t\t$theme->display( 'Name' )\n\t\t\t)\n\t\t);\n\t} elseif ( ! $compatible_php ) {\n\t\treturn new WP_Error(\n\t\t\t'theme_php_incompatible',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t_x( '<strong>Error:</strong> Current PHP version does not meet minimum requirements for %s.', 'theme' ),\n\t\t\t\t$theme->display( 'Name' )\n\t\t\t)\n\t\t);\n\t} elseif ( ! $compatible_wp ) {\n\t\treturn new WP_Error(\n\t\t\t'theme_wp_incompatible',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t_x( '<strong>Error:</strong> Current WordPress version does not meet minimum requirements for %s.', 'theme' ),\n\t\t\t\t$theme->display( 'Name' )\n\t\t\t)\n\t\t);\n\t}\n\n\treturn true;\n}\n\n/**\n * Retrieves all theme modifications.\n *\n * @since 3.1.0\n *\n * @return array|void Theme modifications.\n */\nfunction get_theme_mods() {\n\t$theme_slug = get_option( 'stylesheet' );\n\t$mods       = get_option( \"theme_mods_$theme_slug\" );\n\tif ( false === $mods ) {\n\t\t$theme_name = get_option( 'current_theme' );\n\t\tif ( false === $theme_name ) {\n\t\t\t$theme_name = wp_get_theme()->get( 'Name' );\n\t\t}\n\t\t$mods = get_option( \"mods_$theme_name\" ); // Deprecated location.\n\t\tif ( is_admin() && false !== $mods ) {\n\t\t\tupdate_option( \"theme_mods_$theme_slug\", $mods );\n\t\t\tdelete_option( \"mods_$theme_name\" );\n\t\t}\n\t}\n\treturn $mods;\n}\n\n/**\n * Retrieves theme modification value for the current theme.\n *\n * If the modification name does not exist, then the $default will be passed\n * through {@link https://www.php.net/sprintf sprintf()} PHP function with\n * the template directory URI as the first string and the stylesheet directory URI\n * as the second string.\n *\n * @since 2.1.0\n *\n * @param string       $name    Theme modification name.\n * @param string|false $default Optional. Theme modification default value. Default false.\n * @return mixed Theme modification value.\n */\nfunction get_theme_mod( $name, $default = false ) {\n\t$mods = get_theme_mods();\n\n\tif ( isset( $mods[ $name ] ) ) {\n\t\t/**\n\t\t * Filters the theme modification, or 'theme_mod', value.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$name`, refers to the key name\n\t\t * of the modification array. For example, 'header_textcolor', 'header_image',\n\t\t * and so on depending on the theme options.\n\t\t *\n\t\t * @since 2.2.0\n\t\t *\n\t\t * @param string $current_mod The value of the current theme modification.\n\t\t */\n\t\treturn apply_filters( \"theme_mod_{$name}\", $mods[ $name ] );\n\t}\n\n\tif ( is_string( $default ) ) {\n\t\t// Only run the replacement if an sprintf() string format pattern was found.\n\t\tif ( preg_match( '#(?<!%)%(?:\\d+\\$?)?s#', $default ) ) {\n\t\t\t$default = sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() );\n\t\t}\n\t}\n\n\t/** This filter is documented in wp-includes/theme.php */\n\treturn apply_filters( \"theme_mod_{$name}\", $default );\n}\n\n/**\n * Updates theme modification value for the current theme.\n *\n * @since 2.1.0\n *\n * @param string $name  Theme modification name.\n * @param mixed  $value Theme modification value.\n */\nfunction set_theme_mod( $name, $value ) {\n\t$mods      = get_theme_mods();\n\t$old_value = isset( $mods[ $name ] ) ? $mods[ $name ] : false;\n\n\t/**\n\t * Filters the theme modification, or 'theme_mod', value on save.\n\t *\n\t * The dynamic portion of the hook name, `$name`, refers to the key name\n\t * of the modification array. For example, 'header_textcolor', 'header_image',\n\t * and so on depending on the theme options.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param string $value     The new value of the theme modification.\n\t * @param string $old_value The current value of the theme modification.\n\t */\n\t$mods[ $name ] = apply_filters( \"pre_set_theme_mod_{$name}\", $value, $old_value );\n\n\t$theme = get_option( 'stylesheet' );\n\tupdate_option( \"theme_mods_$theme\", $mods );\n}\n\n/**\n * Removes theme modification name from current theme list.\n *\n * If removing the name also removes all elements, then the entire option\n * will be removed.\n *\n * @since 2.1.0\n *\n * @param string $name Theme modification name.\n */\nfunction remove_theme_mod( $name ) {\n\t$mods = get_theme_mods();\n\n\tif ( ! isset( $mods[ $name ] ) ) {\n\t\treturn;\n\t}\n\n\tunset( $mods[ $name ] );\n\n\tif ( empty( $mods ) ) {\n\t\tremove_theme_mods();\n\t\treturn;\n\t}\n\t$theme = get_option( 'stylesheet' );\n\tupdate_option( \"theme_mods_$theme\", $mods );\n}\n\n/**\n * Removes theme modifications option for current theme.\n *\n * @since 2.1.0\n */\nfunction remove_theme_mods() {\n\tdelete_option( 'theme_mods_' . get_option( 'stylesheet' ) );\n\n\t// Old style.\n\t$theme_name = get_option( 'current_theme' );\n\tif ( false === $theme_name ) {\n\t\t$theme_name = wp_get_theme()->get( 'Name' );\n\t}\n\tdelete_option( 'mods_' . $theme_name );\n}\n\n/**\n * Retrieves the custom header text color in 3- or 6-digit hexadecimal form.\n *\n * @since 2.1.0\n *\n * @return string Header text color in 3- or 6-digit hexadecimal form (minus the hash symbol).\n */\nfunction get_header_textcolor() {\n\treturn get_theme_mod( 'header_textcolor', get_theme_support( 'custom-header', 'default-text-color' ) );\n}\n\n/**\n * Displays the custom header text color in 3- or 6-digit hexadecimal form (minus the hash symbol).\n *\n * @since 2.1.0\n */\nfunction header_textcolor() {\n\techo get_header_textcolor();\n}\n\n/**\n * Whether to display the header text.\n *\n * @since 3.4.0\n *\n * @return bool\n */\nfunction display_header_text() {\n\tif ( ! current_theme_supports( 'custom-header', 'header-text' ) ) {\n\t\treturn false;\n\t}\n\n\t$text_color = get_theme_mod( 'header_textcolor', get_theme_support( 'custom-header', 'default-text-color' ) );\n\treturn 'blank' !== $text_color;\n}\n\n/**\n * Checks whether a header image is set or not.\n *\n * @since 4.2.0\n *\n * @see get_header_image()\n *\n * @return bool Whether a header image is set or not.\n */\nfunction has_header_image() {\n\treturn (bool) get_header_image();\n}\n\n/**\n * Retrieves header image for custom header.\n *\n * @since 2.1.0\n *\n * @return string|false\n */\nfunction get_header_image() {\n\t$url = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) );\n\n\tif ( 'remove-header' === $url ) {\n\t\treturn false;\n\t}\n\n\tif ( is_random_header_image() ) {\n\t\t$url = get_random_header_image();\n\t}\n\n\treturn esc_url_raw( set_url_scheme( $url ) );\n}\n\n/**\n * Creates image tag markup for a custom header image.\n *\n * @since 4.4.0\n *\n * @param array $attr Optional. Additional attributes for the image tag. Can be used\n *                              to override the default attributes. Default empty.\n * @return string HTML image element markup or empty string on failure.\n */\nfunction get_header_image_tag( $attr = array() ) {\n\t$header      = get_custom_header();\n\t$header->url = get_header_image();\n\n\tif ( ! $header->url ) {\n\t\treturn '';\n\t}\n\n\t$width  = absint( $header->width );\n\t$height = absint( $header->height );\n\n\t$attr = wp_parse_args(\n\t\t$attr,\n\t\tarray(\n\t\t\t'src'    => $header->url,\n\t\t\t'width'  => $width,\n\t\t\t'height' => $height,\n\t\t\t'alt'    => get_bloginfo( 'name' ),\n\t\t)\n\t);\n\n\t// Generate 'srcset' and 'sizes' if not already present.\n\tif ( empty( $attr['srcset'] ) && ! empty( $header->attachment_id ) ) {\n\t\t$image_meta = get_post_meta( $header->attachment_id, '_wp_attachment_metadata', true );\n\t\t$size_array = array( $width, $height );\n\n\t\tif ( is_array( $image_meta ) ) {\n\t\t\t$srcset = wp_calculate_image_srcset( $size_array, $header->url, $image_meta, $header->attachment_id );\n\t\t\t$sizes  = ! empty( $attr['sizes'] ) ? $attr['sizes'] : wp_calculate_image_sizes( $size_array, $header->url, $image_meta, $header->attachment_id );\n\n\t\t\tif ( $srcset && $sizes ) {\n\t\t\t\t$attr['srcset'] = $srcset;\n\t\t\t\t$attr['sizes']  = $sizes;\n\t\t\t}\n\t\t}\n\t}\n\n\t$attr = array_map( 'esc_attr', $attr );\n\t$html = '<img';\n\n\tforeach ( $attr as $name => $value ) {\n\t\t$html .= ' ' . $name . '=\"' . $value . '\"';\n\t}\n\n\t$html .= ' />';\n\n\t/**\n\t * Filters the markup of header images.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $html   The HTML image tag markup being filtered.\n\t * @param object $header The custom header object returned by 'get_custom_header()'.\n\t * @param array  $attr   Array of the attributes for the image tag.\n\t */\n\treturn apply_filters( 'get_header_image_tag', $html, $header, $attr );\n}\n\n/**\n * Displays the image markup for a custom header image.\n *\n * @since 4.4.0\n *\n * @param array $attr Optional. Attributes for the image markup. Default empty.\n */\nfunction the_header_image_tag( $attr = array() ) {\n\techo get_header_image_tag( $attr );\n}\n\n/**\n * Gets random header image data from registered images in theme.\n *\n * @since 3.4.0\n *\n * @access private\n *\n * @global array $_wp_default_headers\n *\n * @return object\n */\nfunction _get_random_header_data() {\n\tstatic $_wp_random_header = null;\n\n\tif ( empty( $_wp_random_header ) ) {\n\t\tglobal $_wp_default_headers;\n\t\t$header_image_mod = get_theme_mod( 'header_image', '' );\n\t\t$headers          = array();\n\n\t\tif ( 'random-uploaded-image' === $header_image_mod ) {\n\t\t\t$headers = get_uploaded_header_images();\n\t\t} elseif ( ! empty( $_wp_default_headers ) ) {\n\t\t\tif ( 'random-default-image' === $header_image_mod ) {\n\t\t\t\t$headers = $_wp_default_headers;\n\t\t\t} else {\n\t\t\t\tif ( current_theme_supports( 'custom-header', 'random-default' ) ) {\n\t\t\t\t\t$headers = $_wp_default_headers;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $headers ) ) {\n\t\t\treturn new stdClass;\n\t\t}\n\n\t\t$_wp_random_header = (object) $headers[ array_rand( $headers ) ];\n\n\t\t$_wp_random_header->url           = sprintf( $_wp_random_header->url, get_template_directory_uri(), get_stylesheet_directory_uri() );\n\t\t$_wp_random_header->thumbnail_url = sprintf( $_wp_random_header->thumbnail_url, get_template_directory_uri(), get_stylesheet_directory_uri() );\n\t}\n\n\treturn $_wp_random_header;\n}\n\n/**\n * Gets random header image URL from registered images in theme.\n *\n * @since 3.2.0\n *\n * @return string Path to header image.\n */\nfunction get_random_header_image() {\n\t$random_image = _get_random_header_data();\n\n\tif ( empty( $random_image->url ) ) {\n\t\treturn '';\n\t}\n\n\treturn $random_image->url;\n}\n\n/**\n * Checks if random header image is in use.\n *\n * Always true if user expressly chooses the option in Appearance > Header.\n * Also true if theme has multiple header images registered, no specific header image\n * is chosen, and theme turns on random headers with add_theme_support().\n *\n * @since 3.2.0\n *\n * @param string $type The random pool to use. Possible values include 'any',\n *                     'default', 'uploaded'. Default 'any'.\n * @return bool\n */\nfunction is_random_header_image( $type = 'any' ) {\n\t$header_image_mod = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) );\n\n\tif ( 'any' === $type ) {\n\t\tif ( 'random-default-image' === $header_image_mod\n\t\t\t|| 'random-uploaded-image' === $header_image_mod\n\t\t\t|| ( '' !== get_random_header_image() && empty( $header_image_mod ) )\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t} else {\n\t\tif ( \"random-$type-image\" === $header_image_mod ) {\n\t\t\treturn true;\n\t\t} elseif ( 'default' === $type && empty( $header_image_mod ) && '' !== get_random_header_image() ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Displays header image URL.\n *\n * @since 2.1.0\n */\nfunction header_image() {\n\t$image = get_header_image();\n\n\tif ( $image ) {\n\t\techo esc_url( $image );\n\t}\n}\n\n/**\n * Gets the header images uploaded for the current theme.\n *\n * @since 3.2.0\n *\n * @return array\n */\nfunction get_uploaded_header_images() {\n\t$header_images = array();\n\n\t// @todo Caching.\n\t$headers = get_posts(\n\t\tarray(\n\t\t\t'post_type'  => 'attachment',\n\t\t\t'meta_key'   => '_wp_attachment_is_custom_header',\n\t\t\t'meta_value' => get_option( 'stylesheet' ),\n\t\t\t'orderby'    => 'none',\n\t\t\t'nopaging'   => true,\n\t\t)\n\t);\n\n\tif ( empty( $headers ) ) {\n\t\treturn array();\n\t}\n\n\tforeach ( (array) $headers as $header ) {\n\t\t$url          = esc_url_raw( wp_get_attachment_url( $header->ID ) );\n\t\t$header_data  = wp_get_attachment_metadata( $header->ID );\n\t\t$header_index = $header->ID;\n\n\t\t$header_images[ $header_index ]                      = array();\n\t\t$header_images[ $header_index ]['attachment_id']     = $header->ID;\n\t\t$header_images[ $header_index ]['url']               = $url;\n\t\t$header_images[ $header_index ]['thumbnail_url']     = $url;\n\t\t$header_images[ $header_index ]['alt_text']          = get_post_meta( $header->ID, '_wp_attachment_image_alt', true );\n\t\t$header_images[ $header_index ]['attachment_parent'] = isset( $header_data['attachment_parent'] ) ? $header_data['attachment_parent'] : '';\n\n\t\tif ( isset( $header_data['width'] ) ) {\n\t\t\t$header_images[ $header_index ]['width'] = $header_data['width'];\n\t\t}\n\t\tif ( isset( $header_data['height'] ) ) {\n\t\t\t$header_images[ $header_index ]['height'] = $header_data['height'];\n\t\t}\n\t}\n\n\treturn $header_images;\n}\n\n/**\n * Gets the header image data.\n *\n * @since 3.4.0\n *\n * @global array $_wp_default_headers\n *\n * @return object\n */\nfunction get_custom_header() {\n\tglobal $_wp_default_headers;\n\n\tif ( is_random_header_image() ) {\n\t\t$data = _get_random_header_data();\n\t} else {\n\t\t$data = get_theme_mod( 'header_image_data' );\n\t\tif ( ! $data && current_theme_supports( 'custom-header', 'default-image' ) ) {\n\t\t\t$directory_args        = array( get_template_directory_uri(), get_stylesheet_directory_uri() );\n\t\t\t$data                  = array();\n\t\t\t$data['url']           = vsprintf( get_theme_support( 'custom-header', 'default-image' ), $directory_args );\n\t\t\t$data['thumbnail_url'] = $data['url'];\n\t\t\tif ( ! empty( $_wp_default_headers ) ) {\n\t\t\t\tforeach ( (array) $_wp_default_headers as $default_header ) {\n\t\t\t\t\t$url = vsprintf( $default_header['url'], $directory_args );\n\t\t\t\t\tif ( $data['url'] == $url ) {\n\t\t\t\t\t\t$data                  = $default_header;\n\t\t\t\t\t\t$data['url']           = $url;\n\t\t\t\t\t\t$data['thumbnail_url'] = vsprintf( $data['thumbnail_url'], $directory_args );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t$default = array(\n\t\t'url'           => '',\n\t\t'thumbnail_url' => '',\n\t\t'width'         => get_theme_support( 'custom-header', 'width' ),\n\t\t'height'        => get_theme_support( 'custom-header', 'height' ),\n\t\t'video'         => get_theme_support( 'custom-header', 'video' ),\n\t);\n\treturn (object) wp_parse_args( $data, $default );\n}\n\n/**\n * Registers a selection of default headers to be displayed by the custom header admin UI.\n *\n * @since 3.0.0\n *\n * @global array $_wp_default_headers\n *\n * @param array $headers Array of headers keyed by a string ID. The IDs point to arrays\n *                       containing 'url', 'thumbnail_url', and 'description' keys.\n */\nfunction register_default_headers( $headers ) {\n\tglobal $_wp_default_headers;\n\n\t$_wp_default_headers = array_merge( (array) $_wp_default_headers, (array) $headers );\n}\n\n/**\n * Unregisters default headers.\n *\n * This function must be called after register_default_headers() has already added the\n * header you want to remove.\n *\n * @see register_default_headers()\n * @since 3.0.0\n *\n * @global array $_wp_default_headers\n *\n * @param string|array $header The header string id (key of array) to remove, or an array thereof.\n * @return bool|void A single header returns true on success, false on failure.\n *                   There is currently no return value for multiple headers.\n */\nfunction unregister_default_headers( $header ) {\n\tglobal $_wp_default_headers;\n\tif ( is_array( $header ) ) {\n\t\tarray_map( 'unregister_default_headers', $header );\n\t} elseif ( isset( $_wp_default_headers[ $header ] ) ) {\n\t\tunset( $_wp_default_headers[ $header ] );\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}\n\n/**\n * Checks whether a header video is set or not.\n *\n * @since 4.7.0\n *\n * @see get_header_video_url()\n *\n * @return bool Whether a header video is set or not.\n */\nfunction has_header_video() {\n\treturn (bool) get_header_video_url();\n}\n\n/**\n * Retrieves header video URL for custom header.\n *\n * Uses a local video if present, or falls back to an external video.\n *\n * @since 4.7.0\n *\n * @return string|false Header video URL or false if there is no video.\n */\nfunction get_header_video_url() {\n\t$id = absint( get_theme_mod( 'header_video' ) );\n\n\tif ( $id ) {\n\t\t// Get the file URL from the attachment ID.\n\t\t$url = wp_get_attachment_url( $id );\n\t} else {\n\t\t$url = get_theme_mod( 'external_header_video' );\n\t}\n\n\t/**\n\t * Filters the header video URL.\n\t *\n\t * @since 4.7.3\n\t *\n\t * @param string $url Header video URL, if available.\n\t */\n\t$url = apply_filters( 'get_header_video_url', $url );\n\n\tif ( ! $id && ! $url ) {\n\t\treturn false;\n\t}\n\n\treturn esc_url_raw( set_url_scheme( $url ) );\n}\n\n/**\n * Displays header video URL.\n *\n * @since 4.7.0\n */\nfunction the_header_video_url() {\n\t$video = get_header_video_url();\n\n\tif ( $video ) {\n\t\techo esc_url( $video );\n\t}\n}\n\n/**\n * Retrieves header video settings.\n *\n * @since 4.7.0\n *\n * @return array\n */\nfunction get_header_video_settings() {\n\t$header     = get_custom_header();\n\t$video_url  = get_header_video_url();\n\t$video_type = wp_check_filetype( $video_url, wp_get_mime_types() );\n\n\t$settings = array(\n\t\t'mimeType'  => '',\n\t\t'posterUrl' => get_header_image(),\n\t\t'videoUrl'  => $video_url,\n\t\t'width'     => absint( $header->width ),\n\t\t'height'    => absint( $header->height ),\n\t\t'minWidth'  => 900,\n\t\t'minHeight' => 500,\n\t\t'l10n'      => array(\n\t\t\t'pause'      => __( 'Pause' ),\n\t\t\t'play'       => __( 'Play' ),\n\t\t\t'pauseSpeak' => __( 'Video is paused.' ),\n\t\t\t'playSpeak'  => __( 'Video is playing.' ),\n\t\t),\n\t);\n\n\tif ( preg_match( '#^https?://(?:www\\.)?(?:youtube\\.com/watch|youtu\\.be/)#', $video_url ) ) {\n\t\t$settings['mimeType'] = 'video/x-youtube';\n\t} elseif ( ! empty( $video_type['type'] ) ) {\n\t\t$settings['mimeType'] = $video_type['type'];\n\t}\n\n\t/**\n\t * Filters header video settings.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $settings An array of header video settings.\n\t */\n\treturn apply_filters( 'header_video_settings', $settings );\n}\n\n/**\n * Checks whether a custom header is set or not.\n *\n * @since 4.7.0\n *\n * @return bool True if a custom header is set. False if not.\n */\nfunction has_custom_header() {\n\tif ( has_header_image() || ( has_header_video() && is_header_video_active() ) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Checks whether the custom header video is eligible to show on the current page.\n *\n * @since 4.7.0\n *\n * @return bool True if the custom header video should be shown. False if not.\n */\nfunction is_header_video_active() {\n\tif ( ! get_theme_support( 'custom-header', 'video' ) ) {\n\t\treturn false;\n\t}\n\n\t$video_active_cb = get_theme_support( 'custom-header', 'video-active-callback' );\n\n\tif ( empty( $video_active_cb ) || ! is_callable( $video_active_cb ) ) {\n\t\t$show_video = true;\n\t} else {\n\t\t$show_video = call_user_func( $video_active_cb );\n\t}\n\n\t/**\n\t * Filters whether the custom header video is eligible to show on the current page.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param bool $show_video Whether the custom header video should be shown. Returns the value\n\t *                         of the theme setting for the `custom-header`'s `video-active-callback`.\n\t *                         If no callback is set, the default value is that of `is_front_page()`.\n\t */\n\treturn apply_filters( 'is_header_video_active', $show_video );\n}\n\n/**\n * Retrieves the markup for a custom header.\n *\n * The container div will always be returned in the Customizer preview.\n *\n * @since 4.7.0\n *\n * @return string The markup for a custom header on success.\n */\nfunction get_custom_header_markup() {\n\tif ( ! has_custom_header() && ! is_customize_preview() ) {\n\t\treturn '';\n\t}\n\n\treturn sprintf(\n\t\t'<div id=\"wp-custom-header\" class=\"wp-custom-header\">%s</div>',\n\t\tget_header_image_tag()\n\t);\n}\n\n/**\n * Prints the markup for a custom header.\n *\n * A container div will always be printed in the Customizer preview.\n *\n * @since 4.7.0\n */\nfunction the_custom_header_markup() {\n\t$custom_header = get_custom_header_markup();\n\tif ( empty( $custom_header ) ) {\n\t\treturn;\n\t}\n\n\techo $custom_header;\n\n\tif ( is_header_video_active() && ( has_header_video() || is_customize_preview() ) ) {\n\t\twp_enqueue_script( 'wp-custom-header' );\n\t\twp_localize_script( 'wp-custom-header', '_wpCustomHeaderSettings', get_header_video_settings() );\n\t}\n}\n\n/**\n * Retrieves background image for custom background.\n *\n * @since 3.0.0\n *\n * @return string\n */\nfunction get_background_image() {\n\treturn get_theme_mod( 'background_image', get_theme_support( 'custom-background', 'default-image' ) );\n}\n\n/**\n * Displays background image path.\n *\n * @since 3.0.0\n */\nfunction background_image() {\n\techo get_background_image();\n}\n\n/**\n * Retrieves value for custom background color.\n *\n * @since 3.0.0\n *\n * @return string\n */\nfunction get_background_color() {\n\treturn get_theme_mod( 'background_color', get_theme_support( 'custom-background', 'default-color' ) );\n}\n\n/**\n * Displays background color value.\n *\n * @since 3.0.0\n */\nfunction background_color() {\n\techo get_background_color();\n}\n\n/**\n * Default custom background callback.\n *\n * @since 3.0.0\n */\nfunction _custom_background_cb() {\n\t// $background is the saved custom image, or the default image.\n\t$background = set_url_scheme( get_background_image() );\n\n\t// $color is the saved custom color.\n\t// A default has to be specified in style.css. It will not be printed here.\n\t$color = get_background_color();\n\n\tif ( get_theme_support( 'custom-background', 'default-color' ) === $color ) {\n\t\t$color = false;\n\t}\n\n\t$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type=\"text/css\"';\n\n\tif ( ! $background && ! $color ) {\n\t\tif ( is_customize_preview() ) {\n\t\t\tprintf( '<style%s id=\"custom-background-css\"></style>', $type_attr );\n\t\t}\n\t\treturn;\n\t}\n\n\t$style = $color ? \"background-color: #$color;\" : '';\n\n\tif ( $background ) {\n\t\t$image = ' background-image: url(\"' . esc_url_raw( $background ) . '\");';\n\n\t\t// Background Position.\n\t\t$position_x = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) );\n\t\t$position_y = get_theme_mod( 'background_position_y', get_theme_support( 'custom-background', 'default-position-y' ) );\n\n\t\tif ( ! in_array( $position_x, array( 'left', 'center', 'right' ), true ) ) {\n\t\t\t$position_x = 'left';\n\t\t}\n\n\t\tif ( ! in_array( $position_y, array( 'top', 'center', 'bottom' ), true ) ) {\n\t\t\t$position_y = 'top';\n\t\t}\n\n\t\t$position = \" background-position: $position_x $position_y;\";\n\n\t\t// Background Size.\n\t\t$size = get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) );\n\n\t\tif ( ! in_array( $size, array( 'auto', 'contain', 'cover' ), true ) ) {\n\t\t\t$size = 'auto';\n\t\t}\n\n\t\t$size = \" background-size: $size;\";\n\n\t\t// Background Repeat.\n\t\t$repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) );\n\n\t\tif ( ! in_array( $repeat, array( 'repeat-x', 'repeat-y', 'repeat', 'no-repeat' ), true ) ) {\n\t\t\t$repeat = 'repeat';\n\t\t}\n\n\t\t$repeat = \" background-repeat: $repeat;\";\n\n\t\t// Background Scroll.\n\t\t$attachment = get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) );\n\n\t\tif ( 'fixed' !== $attachment ) {\n\t\t\t$attachment = 'scroll';\n\t\t}\n\n\t\t$attachment = \" background-attachment: $attachment;\";\n\n\t\t$style .= $image . $position . $size . $repeat . $attachment;\n\t}\n\t?>\n<style<?php echo $type_attr; ?> id=\"custom-background-css\">\nbody.custom-background { <?php echo trim( $style ); ?> }\n</style>\n\t<?php\n}\n\n/**\n * Renders the Custom CSS style element.\n *\n * @since 4.7.0\n */\nfunction wp_custom_css_cb() {\n\t$styles = wp_get_custom_css();\n\tif ( $styles || is_customize_preview() ) :\n\t\t$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type=\"text/css\"';\n\t\t?>\n\t\t<style<?php echo $type_attr; ?> id=\"wp-custom-css\">\n\t\t\t<?php echo strip_tags( $styles ); // Note that esc_html() cannot be used because `div &gt; span` is not interpreted properly. ?>\n\t\t</style>\n\t\t<?php\n\tendif;\n}\n\n/**\n * Fetches the `custom_css` post for a given theme.\n *\n * @since 4.7.0\n *\n * @param string $stylesheet Optional. A theme object stylesheet name. Defaults to the current theme.\n * @return WP_Post|null The custom_css post or null if none exists.\n */\nfunction wp_get_custom_css_post( $stylesheet = '' ) {\n\tif ( empty( $stylesheet ) ) {\n\t\t$stylesheet = get_stylesheet();\n\t}\n\n\t$custom_css_query_vars = array(\n\t\t'post_type'              => 'custom_css',\n\t\t'post_status'            => get_post_stati(),\n\t\t'name'                   => sanitize_title( $stylesheet ),\n\t\t'posts_per_page'         => 1,\n\t\t'no_found_rows'          => true,\n\t\t'cache_results'          => true,\n\t\t'update_post_meta_cache' => false,\n\t\t'update_post_term_cache' => false,\n\t\t'lazy_load_term_meta'    => false,\n\t);\n\n\t$post = null;\n\tif ( get_stylesheet() === $stylesheet ) {\n\t\t$post_id = get_theme_mod( 'custom_css_post_id' );\n\n\t\tif ( $post_id > 0 && get_post( $post_id ) ) {\n\t\t\t$post = get_post( $post_id );\n\t\t}\n\n\t\t// `-1` indicates no post exists; no query necessary.\n\t\tif ( ! $post && -1 !== $post_id ) {\n\t\t\t$query = new WP_Query( $custom_css_query_vars );\n\t\t\t$post  = $query->post;\n\t\t\t/*\n\t\t\t * Cache the lookup. See wp_update_custom_css_post().\n\t\t\t * @todo This should get cleared if a custom_css post is added/removed.\n\t\t\t */\n\t\t\tset_theme_mod( 'custom_css_post_id', $post ? $post->ID : -1 );\n\t\t}\n\t} else {\n\t\t$query = new WP_Query( $custom_css_query_vars );\n\t\t$post  = $query->post;\n\t}\n\n\treturn $post;\n}\n\n/**\n * Fetches the saved Custom CSS content for rendering.\n *\n * @since 4.7.0\n *\n * @param string $stylesheet Optional. A theme object stylesheet name. Defaults to the current theme.\n * @return string The Custom CSS Post content.\n */\nfunction wp_get_custom_css( $stylesheet = '' ) {\n\t$css = '';\n\n\tif ( empty( $stylesheet ) ) {\n\t\t$stylesheet = get_stylesheet();\n\t}\n\n\t$post = wp_get_custom_css_post( $stylesheet );\n\tif ( $post ) {\n\t\t$css = $post->post_content;\n\t}\n\n\t/**\n\t * Filters the Custom CSS Output into the <head>.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $css        CSS pulled in from the Custom CSS CPT.\n\t * @param string $stylesheet The theme stylesheet name.\n\t */\n\t$css = apply_filters( 'wp_get_custom_css', $css, $stylesheet );\n\n\treturn $css;\n}\n\n/**\n * Updates the `custom_css` post for a given theme.\n *\n * Inserts a `custom_css` post when one doesn't yet exist.\n *\n * @since 4.7.0\n *\n * @param string $css CSS, stored in `post_content`.\n * @param array  $args {\n *     Args.\n *\n *     @type string $preprocessed Pre-processed CSS, stored in `post_content_filtered`. Normally empty string. Optional.\n *     @type string $stylesheet   Stylesheet (child theme) to update. Optional, defaults to current theme/stylesheet.\n * }\n * @return WP_Post|WP_Error Post on success, error on failure.\n */\nfunction wp_update_custom_css_post( $css, $args = array() ) {\n\t$args = wp_parse_args(\n\t\t$args,\n\t\tarray(\n\t\t\t'preprocessed' => '',\n\t\t\t'stylesheet'   => get_stylesheet(),\n\t\t)\n\t);\n\n\t$data = array(\n\t\t'css'          => $css,\n\t\t'preprocessed' => $args['preprocessed'],\n\t);\n\n\t/**\n\t * Filters the `css` (`post_content`) and `preprocessed` (`post_content_filtered`) args for a `custom_css` post being updated.\n\t *\n\t * This filter can be used by plugin that offer CSS pre-processors, to store the original\n\t * pre-processed CSS in `post_content_filtered` and then store processed CSS in `post_content`.\n\t * When used in this way, the `post_content_filtered` should be supplied as the setting value\n\t * instead of `post_content` via a the `customize_value_custom_css` filter, for example:\n\t *\n\t * <code>\n\t * add_filter( 'customize_value_custom_css', function( $value, $setting ) {\n\t *     $post = wp_get_custom_css_post( $setting->stylesheet );\n\t *     if ( $post && ! empty( $post->post_content_filtered ) ) {\n\t *         $css = $post->post_content_filtered;\n\t *     }\n\t *     return $css;\n\t * }, 10, 2 );\n\t * </code>\n\t *\n\t * @since 4.7.0\n\t * @param array $data {\n\t *     Custom CSS data.\n\t *\n\t *     @type string $css          CSS stored in `post_content`.\n\t *     @type string $preprocessed Pre-processed CSS stored in `post_content_filtered`. Normally empty string.\n\t * }\n\t * @param array $args {\n\t *     The args passed into `wp_update_custom_css_post()` merged with defaults.\n\t *\n\t *     @type string $css          The original CSS passed in to be updated.\n\t *     @type string $preprocessed The original preprocessed CSS passed in to be updated.\n\t *     @type string $stylesheet   The stylesheet (theme) being updated.\n\t * }\n\t */\n\t$data = apply_filters( 'update_custom_css_data', $data, array_merge( $args, compact( 'css' ) ) );\n\n\t$post_data = array(\n\t\t'post_title'            => $args['stylesheet'],\n\t\t'post_name'             => sanitize_title( $args['stylesheet'] ),\n\t\t'post_type'             => 'custom_css',\n\t\t'post_status'           => 'publish',\n\t\t'post_content'          => $data['css'],\n\t\t'post_content_filtered' => $data['preprocessed'],\n\t);\n\n\t// Update post if it already exists, otherwise create a new one.\n\t$post = wp_get_custom_css_post( $args['stylesheet'] );\n\tif ( $post ) {\n\t\t$post_data['ID'] = $post->ID;\n\t\t$r               = wp_update_post( wp_slash( $post_data ), true );\n\t} else {\n\t\t$r = wp_insert_post( wp_slash( $post_data ), true );\n\n\t\tif ( ! is_wp_error( $r ) ) {\n\t\t\tif ( get_stylesheet() === $args['stylesheet'] ) {\n\t\t\t\tset_theme_mod( 'custom_css_post_id', $r );\n\t\t\t}\n\n\t\t\t// Trigger creation of a revision. This should be removed once #30854 is resolved.\n\t\t\tif ( 0 === count( wp_get_post_revisions( $r ) ) ) {\n\t\t\t\twp_save_post_revision( $r );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( is_wp_error( $r ) ) {\n\t\treturn $r;\n\t}\n\treturn get_post( $r );\n}\n\n/**\n * Adds callback for custom TinyMCE editor stylesheets.\n *\n * The parameter $stylesheet is the name of the stylesheet, relative to\n * the theme root. It also accepts an array of stylesheets.\n * It is optional and defaults to 'editor-style.css'.\n *\n * This function automatically adds another stylesheet with -rtl prefix, e.g. editor-style-rtl.css.\n * If that file doesn't exist, it is removed before adding the stylesheet(s) to TinyMCE.\n * If an array of stylesheets is passed to add_editor_style(),\n * RTL is only added for the first stylesheet.\n *\n * Since version 3.4 the TinyMCE body has .rtl CSS class.\n * It is a better option to use that class and add any RTL styles to the main stylesheet.\n *\n * @since 3.0.0\n *\n * @global array $editor_styles\n *\n * @param array|string $stylesheet Optional. Stylesheet name or array thereof, relative to theme root.\n *                                 Defaults to 'editor-style.css'\n */\nfunction add_editor_style( $stylesheet = 'editor-style.css' ) {\n\tglobal $editor_styles;\n\n\tadd_theme_support( 'editor-style' );\n\n\t$editor_styles = (array) $editor_styles;\n\t$stylesheet    = (array) $stylesheet;\n\n\tif ( is_rtl() ) {\n\t\t$rtl_stylesheet = str_replace( '.css', '-rtl.css', $stylesheet[0] );\n\t\t$stylesheet[]   = $rtl_stylesheet;\n\t}\n\n\t$editor_styles = array_merge( $editor_styles, $stylesheet );\n}\n\n/**\n * Removes all visual editor stylesheets.\n *\n * @since 3.1.0\n *\n * @global array $editor_styles\n *\n * @return bool True on success, false if there were no stylesheets to remove.\n */\nfunction remove_editor_styles() {\n\tif ( ! current_theme_supports( 'editor-style' ) ) {\n\t\treturn false;\n\t}\n\t_remove_theme_support( 'editor-style' );\n\tif ( is_admin() ) {\n\t\t$GLOBALS['editor_styles'] = array();\n\t}\n\treturn true;\n}\n\n/**\n * Retrieves any registered editor stylesheet URLs.\n *\n * @since 4.0.0\n *\n * @global array $editor_styles Registered editor stylesheets\n *\n * @return string[] If registered, a list of editor stylesheet URLs.\n */\nfunction get_editor_stylesheets() {\n\t$stylesheets = array();\n\t// Load editor_style.css if the current theme supports it.\n\tif ( ! empty( $GLOBALS['editor_styles'] ) && is_array( $GLOBALS['editor_styles'] ) ) {\n\t\t$editor_styles = $GLOBALS['editor_styles'];\n\n\t\t$editor_styles = array_unique( array_filter( $editor_styles ) );\n\t\t$style_uri     = get_stylesheet_directory_uri();\n\t\t$style_dir     = get_stylesheet_directory();\n\n\t\t// Support externally referenced styles (like, say, fonts).\n\t\tforeach ( $editor_styles as $key => $file ) {\n\t\t\tif ( preg_match( '~^(https?:)?//~', $file ) ) {\n\t\t\t\t$stylesheets[] = esc_url_raw( $file );\n\t\t\t\tunset( $editor_styles[ $key ] );\n\t\t\t}\n\t\t}\n\n\t\t// Look in a parent theme first, that way child theme CSS overrides.\n\t\tif ( is_child_theme() ) {\n\t\t\t$template_uri = get_template_directory_uri();\n\t\t\t$template_dir = get_template_directory();\n\n\t\t\tforeach ( $editor_styles as $key => $file ) {\n\t\t\t\tif ( $file && file_exists( \"$template_dir/$file\" ) ) {\n\t\t\t\t\t$stylesheets[] = \"$template_uri/$file\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $editor_styles as $file ) {\n\t\t\tif ( $file && file_exists( \"$style_dir/$file\" ) ) {\n\t\t\t\t$stylesheets[] = \"$style_uri/$file\";\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Filters the array of URLs of stylesheets applied to the editor.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param string[] $stylesheets Array of URLs of stylesheets to be applied to the editor.\n\t */\n\treturn apply_filters( 'editor_stylesheets', $stylesheets );\n}\n\n/**\n * Expands a theme's starter content configuration using core-provided data.\n *\n * @since 4.7.0\n *\n * @return array Array of starter content.\n */\nfunction get_theme_starter_content() {\n\t$theme_support = get_theme_support( 'starter-content' );\n\tif ( is_array( $theme_support ) && ! empty( $theme_support[0] ) && is_array( $theme_support[0] ) ) {\n\t\t$config = $theme_support[0];\n\t} else {\n\t\t$config = array();\n\t}\n\n\t$core_content = array(\n\t\t'widgets'   => array(\n\t\t\t'text_business_info' => array(\n\t\t\t\t'text',\n\t\t\t\tarray(\n\t\t\t\t\t'title'  => _x( 'Find Us', 'Theme starter content' ),\n\t\t\t\t\t'text'   => join(\n\t\t\t\t\t\t'',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'<strong>' . _x( 'Address', 'Theme starter content' ) . \"</strong>\\n\",\n\t\t\t\t\t\t\t_x( '123 Main Street', 'Theme starter content' ) . \"\\n\" . _x( 'New York, NY 10001', 'Theme starter content' ) . \"\\n\\n\",\n\t\t\t\t\t\t\t'<strong>' . _x( 'Hours', 'Theme starter content' ) . \"</strong>\\n\",\n\t\t\t\t\t\t\t_x( 'Monday&ndash;Friday: 9:00AM&ndash;5:00PM', 'Theme starter content' ) . \"\\n\" . _x( 'Saturday &amp; Sunday: 11:00AM&ndash;3:00PM', 'Theme starter content' ),\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'filter' => true,\n\t\t\t\t\t'visual' => true,\n\t\t\t\t),\n\t\t\t),\n\t\t\t'text_about'         => array(\n\t\t\t\t'text',\n\t\t\t\tarray(\n\t\t\t\t\t'title'  => _x( 'About This Site', 'Theme starter content' ),\n\t\t\t\t\t'text'   => _x( 'This may be a good place to introduce yourself and your site or include some credits.', 'Theme starter content' ),\n\t\t\t\t\t'filter' => true,\n\t\t\t\t\t'visual' => true,\n\t\t\t\t),\n\t\t\t),\n\t\t\t'archives'           => array(\n\t\t\t\t'archives',\n\t\t\t\tarray(\n\t\t\t\t\t'title' => _x( 'Archives', 'Theme starter content' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'calendar'           => array(\n\t\t\t\t'calendar',\n\t\t\t\tarray(\n\t\t\t\t\t'title' => _x( 'Calendar', 'Theme starter content' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'categories'         => array(\n\t\t\t\t'categories',\n\t\t\t\tarray(\n\t\t\t\t\t'title' => _x( 'Categories', 'Theme starter content' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'meta'               => array(\n\t\t\t\t'meta',\n\t\t\t\tarray(\n\t\t\t\t\t'title' => _x( 'Meta', 'Theme starter content' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'recent-comments'    => array(\n\t\t\t\t'recent-comments',\n\t\t\t\tarray(\n\t\t\t\t\t'title' => _x( 'Recent Comments', 'Theme starter content' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'recent-posts'       => array(\n\t\t\t\t'recent-posts',\n\t\t\t\tarray(\n\t\t\t\t\t'title' => _x( 'Recent Posts', 'Theme starter content' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'search'             => array(\n\t\t\t\t'search',\n\t\t\t\tarray(\n\t\t\t\t\t'title' => _x( 'Search', 'Theme starter content' ),\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t\t'nav_menus' => array(\n\t\t\t'link_home'       => array(\n\t\t\t\t'type'  => 'custom',\n\t\t\t\t'title' => _x( 'Home', 'Theme starter content' ),\n\t\t\t\t'url'   => home_url( '/' ),\n\t\t\t),\n\t\t\t'page_home'       => array( // Deprecated in favor of 'link_home'.\n\t\t\t\t'type'      => 'post_type',\n\t\t\t\t'object'    => 'page',\n\t\t\t\t'object_id' => '{{home}}',\n\t\t\t),\n\t\t\t'page_about'      => array(\n\t\t\t\t'type'      => 'post_type',\n\t\t\t\t'object'    => 'page',\n\t\t\t\t'object_id' => '{{about}}',\n\t\t\t),\n\t\t\t'page_blog'       => array(\n\t\t\t\t'type'      => 'post_type',\n\t\t\t\t'object'    => 'page',\n\t\t\t\t'object_id' => '{{blog}}',\n\t\t\t),\n\t\t\t'page_news'       => array(\n\t\t\t\t'type'      => 'post_type',\n\t\t\t\t'object'    => 'page',\n\t\t\t\t'object_id' => '{{news}}',\n\t\t\t),\n\t\t\t'page_contact'    => array(\n\t\t\t\t'type'      => 'post_type',\n\t\t\t\t'object'    => 'page',\n\t\t\t\t'object_id' => '{{contact}}',\n\t\t\t),\n\n\t\t\t'link_email'      => array(\n\t\t\t\t'title' => _x( 'Email', 'Theme starter content' ),\n\t\t\t\t'url'   => 'mailto:wordpress@example.com',\n\t\t\t),\n\t\t\t'link_facebook'   => array(\n\t\t\t\t'title' => _x( 'Facebook', 'Theme starter content' ),\n\t\t\t\t'url'   => 'https://www.facebook.com/wordpress',\n\t\t\t),\n\t\t\t'link_foursquare' => array(\n\t\t\t\t'title' => _x( 'Foursquare', 'Theme starter content' ),\n\t\t\t\t'url'   => 'https://foursquare.com/',\n\t\t\t),\n\t\t\t'link_github'     => array(\n\t\t\t\t'title' => _x( 'GitHub', 'Theme starter content' ),\n\t\t\t\t'url'   => 'https://github.com/wordpress/',\n\t\t\t),\n\t\t\t'link_instagram'  => array(\n\t\t\t\t'title' => _x( 'Instagram', 'Theme starter content' ),\n\t\t\t\t'url'   => 'https://www.instagram.com/explore/tags/wordcamp/',\n\t\t\t),\n\t\t\t'link_linkedin'   => array(\n\t\t\t\t'title' => _x( 'LinkedIn', 'Theme starter content' ),\n\t\t\t\t'url'   => 'https://www.linkedin.com/company/1089783',\n\t\t\t),\n\t\t\t'link_pinterest'  => array(\n\t\t\t\t'title' => _x( 'Pinterest', 'Theme starter content' ),\n\t\t\t\t'url'   => 'https://www.pinterest.com/',\n\t\t\t),\n\t\t\t'link_twitter'    => array(\n\t\t\t\t'title' => _x( 'Twitter', 'Theme starter content' ),\n\t\t\t\t'url'   => 'https://twitter.com/wordpress',\n\t\t\t),\n\t\t\t'link_yelp'       => array(\n\t\t\t\t'title' => _x( 'Yelp', 'Theme starter content' ),\n\t\t\t\t'url'   => 'https://www.yelp.com',\n\t\t\t),\n\t\t\t'link_youtube'    => array(\n\t\t\t\t'title' => _x( 'YouTube', 'Theme starter content' ),\n\t\t\t\t'url'   => 'https://www.youtube.com/channel/UCdof4Ju7amm1chz1gi1T2ZA',\n\t\t\t),\n\t\t),\n\t\t'posts'     => array(\n\t\t\t'home'             => array(\n\t\t\t\t'post_type'    => 'page',\n\t\t\t\t'post_title'   => _x( 'Home', 'Theme starter content' ),\n\t\t\t\t'post_content' => sprintf(\n\t\t\t\t\t\"<!-- wp:paragraph -->\\n<p>%s</p>\\n<!-- /wp:paragraph -->\",\n\t\t\t\t\t_x( 'Welcome to your site! This is your homepage, which is what most visitors will see when they come to your site for the first time.', 'Theme starter content' )\n\t\t\t\t),\n\t\t\t),\n\t\t\t'about'            => array(\n\t\t\t\t'post_type'    => 'page',\n\t\t\t\t'post_title'   => _x( 'About', 'Theme starter content' ),\n\t\t\t\t'post_content' => sprintf(\n\t\t\t\t\t\"<!-- wp:paragraph -->\\n<p>%s</p>\\n<!-- /wp:paragraph -->\",\n\t\t\t\t\t_x( 'You might be an artist who would like to introduce yourself and your work here or maybe you&rsquo;re a business with a mission to describe.', 'Theme starter content' )\n\t\t\t\t),\n\t\t\t),\n\t\t\t'contact'          => array(\n\t\t\t\t'post_type'    => 'page',\n\t\t\t\t'post_title'   => _x( 'Contact', 'Theme starter content' ),\n\t\t\t\t'post_content' => sprintf(\n\t\t\t\t\t\"<!-- wp:paragraph -->\\n<p>%s</p>\\n<!-- /wp:paragraph -->\",\n\t\t\t\t\t_x( 'This is a page with some basic contact information, such as an address and phone number. You might also try a plugin to add a contact form.', 'Theme starter content' )\n\t\t\t\t),\n\t\t\t),\n\t\t\t'blog'             => array(\n\t\t\t\t'post_type'  => 'page',\n\t\t\t\t'post_title' => _x( 'Blog', 'Theme starter content' ),\n\t\t\t),\n\t\t\t'news'             => array(\n\t\t\t\t'post_type'  => 'page',\n\t\t\t\t'post_title' => _x( 'News', 'Theme starter content' ),\n\t\t\t),\n\n\t\t\t'homepage-section' => array(\n\t\t\t\t'post_type'    => 'page',\n\t\t\t\t'post_title'   => _x( 'A homepage section', 'Theme starter content' ),\n\t\t\t\t'post_content' => sprintf(\n\t\t\t\t\t\"<!-- wp:paragraph -->\\n<p>%s</p>\\n<!-- /wp:paragraph -->\",\n\t\t\t\t\t_x( 'This is an example of a homepage section. Homepage sections can be any page other than the homepage itself, including the page that shows your latest blog posts.', 'Theme starter content' )\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t);\n\n\t$content = array();\n\n\tforeach ( $config as $type => $args ) {\n\t\tswitch ( $type ) {\n\t\t\t// Use options and theme_mods as-is.\n\t\t\tcase 'options':\n\t\t\tcase 'theme_mods':\n\t\t\t\t$content[ $type ] = $config[ $type ];\n\t\t\t\tbreak;\n\n\t\t\t// Widgets are grouped into sidebars.\n\t\t\tcase 'widgets':\n\t\t\t\tforeach ( $config[ $type ] as $sidebar_id => $widgets ) {\n\t\t\t\t\tforeach ( $widgets as $id => $widget ) {\n\t\t\t\t\t\tif ( is_array( $widget ) ) {\n\n\t\t\t\t\t\t\t// Item extends core content.\n\t\t\t\t\t\t\tif ( ! empty( $core_content[ $type ][ $id ] ) ) {\n\t\t\t\t\t\t\t\t$widget = array(\n\t\t\t\t\t\t\t\t\t$core_content[ $type ][ $id ][0],\n\t\t\t\t\t\t\t\t\tarray_merge( $core_content[ $type ][ $id ][1], $widget ),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$content[ $type ][ $sidebar_id ][] = $widget;\n\t\t\t\t\t\t} elseif ( is_string( $widget ) && ! empty( $core_content[ $type ] ) && ! empty( $core_content[ $type ][ $widget ] ) ) {\n\t\t\t\t\t\t\t$content[ $type ][ $sidebar_id ][] = $core_content[ $type ][ $widget ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// And nav menu items are grouped into nav menus.\n\t\t\tcase 'nav_menus':\n\t\t\t\tforeach ( $config[ $type ] as $nav_menu_location => $nav_menu ) {\n\n\t\t\t\t\t// Ensure nav menus get a name.\n\t\t\t\t\tif ( empty( $nav_menu['name'] ) ) {\n\t\t\t\t\t\t$nav_menu['name'] = $nav_menu_location;\n\t\t\t\t\t}\n\n\t\t\t\t\t$content[ $type ][ $nav_menu_location ]['name'] = $nav_menu['name'];\n\n\t\t\t\t\tforeach ( $nav_menu['items'] as $id => $nav_menu_item ) {\n\t\t\t\t\t\tif ( is_array( $nav_menu_item ) ) {\n\n\t\t\t\t\t\t\t// Item extends core content.\n\t\t\t\t\t\t\tif ( ! empty( $core_content[ $type ][ $id ] ) ) {\n\t\t\t\t\t\t\t\t$nav_menu_item = array_merge( $core_content[ $type ][ $id ], $nav_menu_item );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$content[ $type ][ $nav_menu_location ]['items'][] = $nav_menu_item;\n\t\t\t\t\t\t} elseif ( is_string( $nav_menu_item ) && ! empty( $core_content[ $type ] ) && ! empty( $core_content[ $type ][ $nav_menu_item ] ) ) {\n\t\t\t\t\t\t\t$content[ $type ][ $nav_menu_location ]['items'][] = $core_content[ $type ][ $nav_menu_item ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// Attachments are posts but have special treatment.\n\t\t\tcase 'attachments':\n\t\t\t\tforeach ( $config[ $type ] as $id => $item ) {\n\t\t\t\t\tif ( ! empty( $item['file'] ) ) {\n\t\t\t\t\t\t$content[ $type ][ $id ] = $item;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// All that's left now are posts (besides attachments).\n\t\t\t// Not a default case for the sake of clarity and future work.\n\t\t\tcase 'posts':\n\t\t\t\tforeach ( $config[ $type ] as $id => $item ) {\n\t\t\t\t\tif ( is_array( $item ) ) {\n\n\t\t\t\t\t\t// Item extends core content.\n\t\t\t\t\t\tif ( ! empty( $core_content[ $type ][ $id ] ) ) {\n\t\t\t\t\t\t\t$item = array_merge( $core_content[ $type ][ $id ], $item );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Enforce a subset of fields.\n\t\t\t\t\t\t$content[ $type ][ $id ] = wp_array_slice_assoc(\n\t\t\t\t\t\t\t$item,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'post_type',\n\t\t\t\t\t\t\t\t'post_title',\n\t\t\t\t\t\t\t\t'post_excerpt',\n\t\t\t\t\t\t\t\t'post_name',\n\t\t\t\t\t\t\t\t'post_content',\n\t\t\t\t\t\t\t\t'menu_order',\n\t\t\t\t\t\t\t\t'comment_status',\n\t\t\t\t\t\t\t\t'thumbnail',\n\t\t\t\t\t\t\t\t'template',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} elseif ( is_string( $item ) && ! empty( $core_content[ $type ][ $item ] ) ) {\n\t\t\t\t\t\t$content[ $type ][ $item ] = $core_content[ $type ][ $item ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Filters the expanded array of starter content.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $content Array of starter content.\n\t * @param array $config  Array of theme-specific starter content configuration.\n\t */\n\treturn apply_filters( 'get_theme_starter_content', $content, $config );\n}\n\n/**\n * Registers theme support for a given feature.\n *\n * Must be called in the theme's functions.php file to work.\n * If attached to a hook, it must be {@see 'after_setup_theme'}.\n * The {@see 'init'} hook may be too late for some features.\n *\n * Example usage:\n *\n *     add_theme_support( 'title-tag' );\n *     add_theme_support( 'custom-logo', array(\n *         'height' => 480,\n *         'width'  => 720,\n *     ) );\n *\n * @since 2.9.0\n * @since 3.4.0 The `custom-header-uploads` feature was deprecated.\n * @since 3.6.0 The `html5` feature was added.\n * @since 3.9.0 The `html5` feature now also accepts 'gallery' and 'caption'.\n * @since 4.1.0 The `title-tag` feature was added.\n * @since 4.5.0 The `customize-selective-refresh-widgets` feature was added.\n * @since 4.7.0 The `starter-content` feature was added.\n * @since 5.0.0 The `responsive-embeds`, `align-wide`, `dark-editor-style`, `disable-custom-colors`,\n *              `disable-custom-font-sizes`, `editor-color-palette`, `editor-font-sizes`,\n *              `editor-styles`, and `wp-block-styles` features were added.\n * @since 5.3.0 The `html5` feature now also accepts 'script' and 'style'.\n * @since 5.3.0 Formalized the existing and already documented `...$args` parameter\n *              by adding it to the function signature.\n * @since 5.5.0 The `core-block-patterns` feature was added and is enabled by default.\n * @since 5.5.0 The `custom-logo` feature now also accepts 'unlink-homepage-logo'.\n *\n * @global array $_wp_theme_features\n *\n * @param string $feature The feature being added. Likely core values include 'post-formats', 'post-thumbnails',\n *                        'custom-header', 'custom-background', 'custom-logo', 'menus', 'automatic-feed-links',\n *                        'html5', 'title-tag', 'customize-selective-refresh-widgets', 'starter-content',\n *                        'responsive-embeds', 'align-wide', 'dark-editor-style', 'disable-custom-colors',\n *                        'disable-custom-font-sizes', 'editor-color-palette', 'editor-font-sizes',\n *                        'editor-styles', 'wp-block-styles', and 'core-block-patterns'.\n * @param mixed  ...$args Optional extra arguments to pass along with certain features.\n * @return void|bool False on failure, void otherwise.\n */\nfunction add_theme_support( $feature, ...$args ) {\n\tglobal $_wp_theme_features;\n\n\tif ( ! $args ) {\n\t\t$args = true;\n\t}\n\n\tswitch ( $feature ) {\n\t\tcase 'post-thumbnails':\n\t\t\t// All post types are already supported.\n\t\t\tif ( true === get_theme_support( 'post-thumbnails' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Merge post types with any that already declared their support\n\t\t\t * for post thumbnails.\n\t\t\t */\n\t\t\tif ( isset( $args[0] ) && is_array( $args[0] ) && isset( $_wp_theme_features['post-thumbnails'] ) ) {\n\t\t\t\t$args[0] = array_unique( array_merge( $_wp_theme_features['post-thumbnails'][0], $args[0] ) );\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase 'post-formats':\n\t\t\tif ( isset( $args[0] ) && is_array( $args[0] ) ) {\n\t\t\t\t$post_formats = get_post_format_slugs();\n\t\t\t\tunset( $post_formats['standard'] );\n\n\t\t\t\t$args[0] = array_intersect( $args[0], array_keys( $post_formats ) );\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'html5':\n\t\t\t// You can't just pass 'html5', you need to pass an array of types.\n\t\t\tif ( empty( $args[0] ) ) {\n\t\t\t\t// Build an array of types for back-compat.\n\t\t\t\t$args = array( 0 => array( 'comment-list', 'comment-form', 'search-form' ) );\n\t\t\t} elseif ( ! isset( $args[0] ) || ! is_array( $args[0] ) ) {\n\t\t\t\t_doing_it_wrong( \"add_theme_support( 'html5' )\", __( 'You need to pass an array of types.' ), '3.6.1' );\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Calling 'html5' again merges, rather than overwrites.\n\t\t\tif ( isset( $_wp_theme_features['html5'] ) ) {\n\t\t\t\t$args[0] = array_merge( $_wp_theme_features['html5'][0], $args[0] );\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'custom-logo':\n\t\t\tif ( true === $args ) {\n\t\t\t\t$args = array( 0 => array() );\n\t\t\t}\n\t\t\t$defaults = array(\n\t\t\t\t'width'                => null,\n\t\t\t\t'height'               => null,\n\t\t\t\t'flex-width'           => false,\n\t\t\t\t'flex-height'          => false,\n\t\t\t\t'header-text'          => '',\n\t\t\t\t'unlink-homepage-logo' => false,\n\t\t\t);\n\t\t\t$args[0]  = wp_parse_args( array_intersect_key( $args[0], $defaults ), $defaults );\n\n\t\t\t// Allow full flexibility if no size is specified.\n\t\t\tif ( is_null( $args[0]['width'] ) && is_null( $args[0]['height'] ) ) {\n\t\t\t\t$args[0]['flex-width']  = true;\n\t\t\t\t$args[0]['flex-height'] = true;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'custom-header-uploads':\n\t\t\treturn add_theme_support( 'custom-header', array( 'uploads' => true ) );\n\n\t\tcase 'custom-header':\n\t\t\tif ( true === $args ) {\n\t\t\t\t$args = array( 0 => array() );\n\t\t\t}\n\n\t\t\t$defaults = array(\n\t\t\t\t'default-image'          => '',\n\t\t\t\t'random-default'         => false,\n\t\t\t\t'width'                  => 0,\n\t\t\t\t'height'                 => 0,\n\t\t\t\t'flex-height'            => false,\n\t\t\t\t'flex-width'             => false,\n\t\t\t\t'default-text-color'     => '',\n\t\t\t\t'header-text'            => true,\n\t\t\t\t'uploads'                => true,\n\t\t\t\t'wp-head-callback'       => '',\n\t\t\t\t'admin-head-callback'    => '',\n\t\t\t\t'admin-preview-callback' => '',\n\t\t\t\t'video'                  => false,\n\t\t\t\t'video-active-callback'  => 'is_front_page',\n\t\t\t);\n\n\t\t\t$jit = isset( $args[0]['__jit'] );\n\t\t\tunset( $args[0]['__jit'] );\n\n\t\t\t// Merge in data from previous add_theme_support() calls.\n\t\t\t// The first value registered wins. (A child theme is set up first.)\n\t\t\tif ( isset( $_wp_theme_features['custom-header'] ) ) {\n\t\t\t\t$args[0] = wp_parse_args( $_wp_theme_features['custom-header'][0], $args[0] );\n\t\t\t}\n\n\t\t\t// Load in the defaults at the end, as we need to insure first one wins.\n\t\t\t// This will cause all constants to be defined, as each arg will then be set to the default.\n\t\t\tif ( $jit ) {\n\t\t\t\t$args[0] = wp_parse_args( $args[0], $defaults );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * If a constant was defined, use that value. Otherwise, define the constant to ensure\n\t\t\t * the constant is always accurate (and is not defined later,  overriding our value).\n\t\t\t * As stated above, the first value wins.\n\t\t\t * Once we get to wp_loaded (just-in-time), define any constants we haven't already.\n\t\t\t * Constants are lame. Don't reference them. This is just for backward compatibility.\n\t\t\t */\n\n\t\t\tif ( defined( 'NO_HEADER_TEXT' ) ) {\n\t\t\t\t$args[0]['header-text'] = ! NO_HEADER_TEXT;\n\t\t\t} elseif ( isset( $args[0]['header-text'] ) ) {\n\t\t\t\tdefine( 'NO_HEADER_TEXT', empty( $args[0]['header-text'] ) );\n\t\t\t}\n\n\t\t\tif ( defined( 'HEADER_IMAGE_WIDTH' ) ) {\n\t\t\t\t$args[0]['width'] = (int) HEADER_IMAGE_WIDTH;\n\t\t\t} elseif ( isset( $args[0]['width'] ) ) {\n\t\t\t\tdefine( 'HEADER_IMAGE_WIDTH', (int) $args[0]['width'] );\n\t\t\t}\n\n\t\t\tif ( defined( 'HEADER_IMAGE_HEIGHT' ) ) {\n\t\t\t\t$args[0]['height'] = (int) HEADER_IMAGE_HEIGHT;\n\t\t\t} elseif ( isset( $args[0]['height'] ) ) {\n\t\t\t\tdefine( 'HEADER_IMAGE_HEIGHT', (int) $args[0]['height'] );\n\t\t\t}\n\n\t\t\tif ( defined( 'HEADER_TEXTCOLOR' ) ) {\n\t\t\t\t$args[0]['default-text-color'] = HEADER_TEXTCOLOR;\n\t\t\t} elseif ( isset( $args[0]['default-text-color'] ) ) {\n\t\t\t\tdefine( 'HEADER_TEXTCOLOR', $args[0]['default-text-color'] );\n\t\t\t}\n\n\t\t\tif ( defined( 'HEADER_IMAGE' ) ) {\n\t\t\t\t$args[0]['default-image'] = HEADER_IMAGE;\n\t\t\t} elseif ( isset( $args[0]['default-image'] ) ) {\n\t\t\t\tdefine( 'HEADER_IMAGE', $args[0]['default-image'] );\n\t\t\t}\n\n\t\t\tif ( $jit && ! empty( $args[0]['default-image'] ) ) {\n\t\t\t\t$args[0]['random-default'] = false;\n\t\t\t}\n\n\t\t\t// If headers are supported, and we still don't have a defined width or height,\n\t\t\t// we have implicit flex sizes.\n\t\t\tif ( $jit ) {\n\t\t\t\tif ( empty( $args[0]['width'] ) && empty( $args[0]['flex-width'] ) ) {\n\t\t\t\t\t$args[0]['flex-width'] = true;\n\t\t\t\t}\n\t\t\t\tif ( empty( $args[0]['height'] ) && empty( $args[0]['flex-height'] ) ) {\n\t\t\t\t\t$args[0]['flex-height'] = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase 'custom-background':\n\t\t\tif ( true === $args ) {\n\t\t\t\t$args = array( 0 => array() );\n\t\t\t}\n\n\t\t\t$defaults = array(\n\t\t\t\t'default-image'          => '',\n\t\t\t\t'default-preset'         => 'default',\n\t\t\t\t'default-position-x'     => 'left',\n\t\t\t\t'default-position-y'     => 'top',\n\t\t\t\t'default-size'           => 'auto',\n\t\t\t\t'default-repeat'         => 'repeat',\n\t\t\t\t'default-attachment'     => 'scroll',\n\t\t\t\t'default-color'          => '',\n\t\t\t\t'wp-head-callback'       => '_custom_background_cb',\n\t\t\t\t'admin-head-callback'    => '',\n\t\t\t\t'admin-preview-callback' => '',\n\t\t\t);\n\n\t\t\t$jit = isset( $args[0]['__jit'] );\n\t\t\tunset( $args[0]['__jit'] );\n\n\t\t\t// Merge in data from previous add_theme_support() calls. The first value registered wins.\n\t\t\tif ( isset( $_wp_theme_features['custom-background'] ) ) {\n\t\t\t\t$args[0] = wp_parse_args( $_wp_theme_features['custom-background'][0], $args[0] );\n\t\t\t}\n\n\t\t\tif ( $jit ) {\n\t\t\t\t$args[0] = wp_parse_args( $args[0], $defaults );\n\t\t\t}\n\n\t\t\tif ( defined( 'BACKGROUND_COLOR' ) ) {\n\t\t\t\t$args[0]['default-color'] = BACKGROUND_COLOR;\n\t\t\t} elseif ( isset( $args[0]['default-color'] ) || $jit ) {\n\t\t\t\tdefine( 'BACKGROUND_COLOR', $args[0]['default-color'] );\n\t\t\t}\n\n\t\t\tif ( defined( 'BACKGROUND_IMAGE' ) ) {\n\t\t\t\t$args[0]['default-image'] = BACKGROUND_IMAGE;\n\t\t\t} elseif ( isset( $args[0]['default-image'] ) || $jit ) {\n\t\t\t\tdefine( 'BACKGROUND_IMAGE', $args[0]['default-image'] );\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\t// Ensure that 'title-tag' is accessible in the admin.\n\t\tcase 'title-tag':\n\t\t\t// Can be called in functions.php but must happen before wp_loaded, i.e. not in header.php.\n\t\t\tif ( did_action( 'wp_loaded' ) ) {\n\t\t\t\t_doing_it_wrong(\n\t\t\t\t\t\"add_theme_support( 'title-tag' )\",\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1: title-tag, 2: wp_loaded */\n\t\t\t\t\t\t__( 'Theme support for %1$s should be registered before the %2$s hook.' ),\n\t\t\t\t\t\t'<code>title-tag</code>',\n\t\t\t\t\t\t'<code>wp_loaded</code>'\n\t\t\t\t\t),\n\t\t\t\t\t'4.1.0'\n\t\t\t\t);\n\n\t\t\t\treturn false;\n\t\t\t}\n\t}\n\n\t$_wp_theme_features[ $feature ] = $args;\n}\n\n/**\n * Registers the internal custom header and background routines.\n *\n * @since 3.4.0\n * @access private\n *\n * @global Custom_Image_Header $custom_image_header\n * @global Custom_Background   $custom_background\n */\nfunction _custom_header_background_just_in_time() {\n\tglobal $custom_image_header, $custom_background;\n\n\tif ( current_theme_supports( 'custom-header' ) ) {\n\t\t// In case any constants were defined after an add_custom_image_header() call, re-run.\n\t\tadd_theme_support( 'custom-header', array( '__jit' => true ) );\n\n\t\t$args = get_theme_support( 'custom-header' );\n\t\tif ( $args[0]['wp-head-callback'] ) {\n\t\t\tadd_action( 'wp_head', $args[0]['wp-head-callback'] );\n\t\t}\n\n\t\tif ( is_admin() ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/class-custom-image-header.php';\n\t\t\t$custom_image_header = new Custom_Image_Header( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] );\n\t\t}\n\t}\n\n\tif ( current_theme_supports( 'custom-background' ) ) {\n\t\t// In case any constants were defined after an add_custom_background() call, re-run.\n\t\tadd_theme_support( 'custom-background', array( '__jit' => true ) );\n\n\t\t$args = get_theme_support( 'custom-background' );\n\t\tadd_action( 'wp_head', $args[0]['wp-head-callback'] );\n\n\t\tif ( is_admin() ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/class-custom-background.php';\n\t\t\t$custom_background = new Custom_Background( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] );\n\t\t}\n\t}\n}\n\n/**\n * Adds CSS to hide header text for custom logo, based on Customizer setting.\n *\n * @since 4.5.0\n * @access private\n */\nfunction _custom_logo_header_styles() {\n\tif ( ! current_theme_supports( 'custom-header', 'header-text' ) && get_theme_support( 'custom-logo', 'header-text' ) && ! get_theme_mod( 'header_text', true ) ) {\n\t\t$classes = (array) get_theme_support( 'custom-logo', 'header-text' );\n\t\t$classes = array_map( 'sanitize_html_class', $classes );\n\t\t$classes = '.' . implode( ', .', $classes );\n\n\t\t$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type=\"text/css\"';\n\t\t?>\n\t\t<!-- Custom Logo: hide header text -->\n\t\t<style id=\"custom-logo-css\"<?php echo $type_attr; ?>>\n\t\t\t<?php echo $classes; ?> {\n\t\t\t\tposition: absolute;\n\t\t\t\tclip: rect(1px, 1px, 1px, 1px);\n\t\t\t}\n\t\t</style>\n\t\t<?php\n\t}\n}\n\n/**\n * Gets the theme support arguments passed when registering that support.\n *\n * Example usage:\n *\n *     get_theme_support( 'custom-logo' );\n *     get_theme_support( 'custom-header', 'width' );\n *\n * @since 3.1.0\n * @since 5.3.0 Formalized the existing and already documented `...$args` parameter\n *              by adding it to the function signature.\n *\n * @global array $_wp_theme_features\n *\n * @param string $feature The feature to check. See add_theme_support() for the list\n *                        of possible values.\n * @param mixed  ...$args Optional extra arguments to be checked against certain features.\n * @return mixed The array of extra arguments or the value for the registered feature.\n */\nfunction get_theme_support( $feature, ...$args ) {\n\tglobal $_wp_theme_features;\n\tif ( ! isset( $_wp_theme_features[ $feature ] ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! $args ) {\n\t\treturn $_wp_theme_features[ $feature ];\n\t}\n\n\tswitch ( $feature ) {\n\t\tcase 'custom-logo':\n\t\tcase 'custom-header':\n\t\tcase 'custom-background':\n\t\t\tif ( isset( $_wp_theme_features[ $feature ][0][ $args[0] ] ) ) {\n\t\t\t\treturn $_wp_theme_features[ $feature ][0][ $args[0] ];\n\t\t\t}\n\t\t\treturn false;\n\n\t\tdefault:\n\t\t\treturn $_wp_theme_features[ $feature ];\n\t}\n}\n\n/**\n * Allows a theme to de-register its support of a certain feature\n *\n * Should be called in the theme's functions.php file. Generally would\n * be used for child themes to override support from the parent theme.\n *\n * @since 3.0.0\n *\n * @see add_theme_support()\n *\n * @param string $feature The feature being removed. See add_theme_support() for the list\n *                        of possible values.\n * @return bool|void Whether feature was removed.\n */\nfunction remove_theme_support( $feature ) {\n\t// Do not remove internal registrations that are not used directly by themes.\n\tif ( in_array( $feature, array( 'editor-style', 'widgets', 'menus' ), true ) ) {\n\t\treturn false;\n\t}\n\n\treturn _remove_theme_support( $feature );\n}\n\n/**\n * Do not use. Removes theme support internally without knowledge of those not used\n * by themes directly.\n *\n * @access private\n * @since 3.1.0\n * @global array               $_wp_theme_features\n * @global Custom_Image_Header $custom_image_header\n * @global Custom_Background   $custom_background\n *\n * @param string $feature The feature being removed. See add_theme_support() for the list\n *                        of possible values.\n * @return bool True if support was removed, false if the feature was not registered.\n */\nfunction _remove_theme_support( $feature ) {\n\tglobal $_wp_theme_features;\n\n\tswitch ( $feature ) {\n\t\tcase 'custom-header-uploads':\n\t\t\tif ( ! isset( $_wp_theme_features['custom-header'] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tadd_theme_support( 'custom-header', array( 'uploads' => false ) );\n\t\t\treturn; // Do not continue - custom-header-uploads no longer exists.\n\t}\n\n\tif ( ! isset( $_wp_theme_features[ $feature ] ) ) {\n\t\treturn false;\n\t}\n\n\tswitch ( $feature ) {\n\t\tcase 'custom-header':\n\t\t\tif ( ! did_action( 'wp_loaded' ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$support = get_theme_support( 'custom-header' );\n\t\t\tif ( isset( $support[0]['wp-head-callback'] ) ) {\n\t\t\t\tremove_action( 'wp_head', $support[0]['wp-head-callback'] );\n\t\t\t}\n\t\t\tif ( isset( $GLOBALS['custom_image_header'] ) ) {\n\t\t\t\tremove_action( 'admin_menu', array( $GLOBALS['custom_image_header'], 'init' ) );\n\t\t\t\tunset( $GLOBALS['custom_image_header'] );\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'custom-background':\n\t\t\tif ( ! did_action( 'wp_loaded' ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$support = get_theme_support( 'custom-background' );\n\t\t\tif ( isset( $support[0]['wp-head-callback'] ) ) {\n\t\t\t\tremove_action( 'wp_head', $support[0]['wp-head-callback'] );\n\t\t\t}\n\t\t\tremove_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) );\n\t\t\tunset( $GLOBALS['custom_background'] );\n\t\t\tbreak;\n\t}\n\n\tunset( $_wp_theme_features[ $feature ] );\n\n\treturn true;\n}\n\n/**\n * Checks a theme's support for a given feature.\n *\n * Example usage:\n *\n *     current_theme_supports( 'custom-logo' );\n *     current_theme_supports( 'html5', 'comment-form' );\n *\n * @since 2.9.0\n * @since 5.3.0 Formalized the existing and already documented `...$args` parameter\n *              by adding it to the function signature.\n *\n * @global array $_wp_theme_features\n *\n * @param string $feature The feature being checked. See add_theme_support() for the list\n *                        of possible values.\n * @param mixed  ...$args Optional extra arguments to be checked against certain features.\n * @return bool True if the current theme supports the feature, false otherwise.\n */\nfunction current_theme_supports( $feature, ...$args ) {\n\tglobal $_wp_theme_features;\n\n\tif ( 'custom-header-uploads' === $feature ) {\n\t\treturn current_theme_supports( 'custom-header', 'uploads' );\n\t}\n\n\tif ( ! isset( $_wp_theme_features[ $feature ] ) ) {\n\t\treturn false;\n\t}\n\n\t// If no args passed then no extra checks need be performed.\n\tif ( ! $args ) {\n\t\treturn true;\n\t}\n\n\tswitch ( $feature ) {\n\t\tcase 'post-thumbnails':\n\t\t\t/*\n\t\t\t * post-thumbnails can be registered for only certain content/post types\n\t\t\t * by passing an array of types to add_theme_support().\n\t\t\t * If no array was passed, then any type is accepted.\n\t\t\t */\n\t\t\tif ( true === $_wp_theme_features[ $feature ] ) {  // Registered for all types.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t$content_type = $args[0];\n\t\t\treturn in_array( $content_type, $_wp_theme_features[ $feature ][0], true );\n\n\t\tcase 'html5':\n\t\tcase 'post-formats':\n\t\t\t/*\n\t\t\t * Specific post formats can be registered by passing an array of types\n\t\t\t * to add_theme_support().\n\t\t\t *\n\t\t\t * Specific areas of HTML5 support *must* be passed via an array to add_theme_support().\n\t\t\t */\n\t\t\t$type = $args[0];\n\t\t\treturn in_array( $type, $_wp_theme_features[ $feature ][0], true );\n\n\t\tcase 'custom-logo':\n\t\tcase 'custom-header':\n\t\tcase 'custom-background':\n\t\t\t// Specific capabilities can be registered by passing an array to add_theme_support().\n\t\t\treturn ( isset( $_wp_theme_features[ $feature ][0][ $args[0] ] ) && $_wp_theme_features[ $feature ][0][ $args[0] ] );\n\t}\n\n\t/**\n\t * Filters whether the current theme supports a specific feature.\n\t *\n\t * The dynamic portion of the hook name, `$feature`, refers to the specific\n\t * theme feature. See add_theme_support() for the list of possible values.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param bool   $supports Whether the current theme supports the given feature. Default true.\n\t * @param array  $args     Array of arguments for the feature.\n\t * @param string $feature  The theme feature.\n\t */\n\treturn apply_filters( \"current_theme_supports-{$feature}\", true, $args, $_wp_theme_features[ $feature ] ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n}\n\n/**\n * Checks a theme's support for a given feature before loading the functions which implement it.\n *\n * @since 2.9.0\n *\n * @param string $feature The feature being checked. See add_theme_support() for the list\n *                        of possible values.\n * @param string $include Path to the file.\n * @return bool True if the current theme supports the supplied feature, false otherwise.\n */\nfunction require_if_theme_supports( $feature, $include ) {\n\tif ( current_theme_supports( $feature ) ) {\n\t\trequire $include;\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Registers a theme feature for use in add_theme_support().\n *\n * This does not indicate that the current theme supports the feature, it only describes\n * the feature's supported options.\n *\n * @since 5.5.0\n *\n * @see add_theme_support()\n *\n * @global array $_wp_registered_theme_features\n *\n * @param string $feature The name uniquely identifying the feature. See add_theme_support()\n *                        for the list of possible values.\n * @param array  $args {\n *     Data used to describe the theme.\n *\n *     @type string     $type         The type of data associated with this feature.\n *                                    Valid values are 'string', 'boolean', 'integer',\n *                                    'number', 'array', and 'object'. Defaults to 'boolean'.\n *     @type boolean    $variadic     Does this feature utilize the variadic support\n *                                    of add_theme_support(), or are all arguments specified\n *                                    as the second parameter. Must be used with the \"array\" type.\n *     @type string     $description  A short description of the feature. Included in\n *                                    the Themes REST API schema. Intended for developers.\n *     @type bool|array $show_in_rest {\n *         Whether this feature should be included in the Themes REST API endpoint.\n *         Defaults to not being included. When registering an 'array' or 'object' type,\n *         this argument must be an array with the 'schema' key.\n *\n *         @type array    $schema           Specifies the JSON Schema definition describing\n *                                          the feature. If any objects in the schema do not include\n *                                          the 'additionalProperties' keyword, it is set to false.\n *         @type string   $name             An alternate name to be used as the property name\n *                                          in the REST API.\n *         @type callable $prepare_callback A function used to format the theme support in the REST API.\n *                                          Receives the raw theme support value.\n *      }\n * }\n * @return true|WP_Error True if the theme feature was successfully registered, a WP_Error object if not.\n */\nfunction register_theme_feature( $feature, $args = array() ) {\n\tglobal $_wp_registered_theme_features;\n\n\tif ( ! is_array( $_wp_registered_theme_features ) ) {\n\t\t$_wp_registered_theme_features = array();\n\t}\n\n\t$defaults = array(\n\t\t'type'         => 'boolean',\n\t\t'variadic'     => false,\n\t\t'description'  => '',\n\t\t'show_in_rest' => false,\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\tif ( true === $args['show_in_rest'] ) {\n\t\t$args['show_in_rest'] = array();\n\t}\n\n\tif ( is_array( $args['show_in_rest'] ) ) {\n\t\t$args['show_in_rest'] = wp_parse_args(\n\t\t\t$args['show_in_rest'],\n\t\t\tarray(\n\t\t\t\t'schema'           => array(),\n\t\t\t\t'name'             => $feature,\n\t\t\t\t'prepare_callback' => null,\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( ! in_array( $args['type'], array( 'string', 'boolean', 'integer', 'number', 'array', 'object' ), true ) ) {\n\t\treturn new WP_Error(\n\t\t\t'invalid_type',\n\t\t\t__( 'The feature \"type\" is not valid JSON Schema type.' )\n\t\t);\n\t}\n\n\tif ( true === $args['variadic'] && 'array' !== $args['type'] ) {\n\t\treturn new WP_Error(\n\t\t\t'variadic_must_be_array',\n\t\t\t__( 'When registering a \"variadic\" theme feature, the \"type\" must be an \"array\".' )\n\t\t);\n\t}\n\n\tif ( false !== $args['show_in_rest'] && in_array( $args['type'], array( 'array', 'object' ), true ) ) {\n\t\tif ( ! is_array( $args['show_in_rest'] ) || empty( $args['show_in_rest']['schema'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'missing_schema',\n\t\t\t\t__( 'When registering an \"array\" or \"object\" feature to show in the REST API, the feature\\'s schema must also be defined.' )\n\t\t\t);\n\t\t}\n\n\t\tif ( 'array' === $args['type'] && ! isset( $args['show_in_rest']['schema']['items'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'missing_schema_items',\n\t\t\t\t__( 'When registering an \"array\" feature, the feature\\'s schema must include the \"items\" keyword.' )\n\t\t\t);\n\t\t}\n\n\t\tif ( 'object' === $args['type'] && ! isset( $args['show_in_rest']['schema']['properties'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'missing_schema_properties',\n\t\t\t\t__( 'When registering an \"object\" feature, the feature\\'s schema must include the \"properties\" keyword.' )\n\t\t\t);\n\t\t}\n\t}\n\n\tif ( is_array( $args['show_in_rest'] ) ) {\n\t\tif ( isset( $args['show_in_rest']['prepare_callback'] ) && ! is_callable( $args['show_in_rest']['prepare_callback'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'invalid_rest_prepare_callback',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: prepare_callback */\n\t\t\t\t\t__( 'The \"%s\" must be a callable function.' ),\n\t\t\t\t\t'prepare_callback'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$args['show_in_rest']['schema'] = wp_parse_args(\n\t\t\t$args['show_in_rest']['schema'],\n\t\t\tarray(\n\t\t\t\t'description' => $args['description'],\n\t\t\t\t'type'        => $args['type'],\n\t\t\t\t'default'     => false,\n\t\t\t)\n\t\t);\n\n\t\tif ( is_bool( $args['show_in_rest']['schema']['default'] )\n\t\t\t&& ! in_array( 'boolean', (array) $args['show_in_rest']['schema']['type'], true )\n\t\t) {\n\t\t\t// Automatically include the \"boolean\" type when the default value is a boolean.\n\t\t\t$args['show_in_rest']['schema']['type'] = (array) $args['show_in_rest']['schema']['type'];\n\t\t\tarray_unshift( $args['show_in_rest']['schema']['type'], 'boolean' );\n\t\t}\n\n\t\t$args['show_in_rest']['schema'] = rest_default_additional_properties_to_false( $args['show_in_rest']['schema'] );\n\t}\n\n\t$_wp_registered_theme_features[ $feature ] = $args;\n\n\treturn true;\n}\n\n/**\n * Gets the list of registered theme features.\n *\n * @since 5.5.0\n *\n * @global array $_wp_registered_theme_features\n *\n * @return array[] List of theme features, keyed by their name.\n */\nfunction get_registered_theme_features() {\n\tglobal $_wp_registered_theme_features;\n\n\tif ( ! is_array( $_wp_registered_theme_features ) ) {\n\t\treturn array();\n\t}\n\n\treturn $_wp_registered_theme_features;\n}\n\n/**\n * Gets the registration config for a theme feature.\n *\n * @since 5.5.0\n *\n * @global array $_wp_registered_theme_features\n *\n * @param string $feature The feature name. See add_theme_support() for the list\n *                        of possible values.\n * @return array|null The registration args, or null if the feature was not registered.\n */\nfunction get_registered_theme_feature( $feature ) {\n\tglobal $_wp_registered_theme_features;\n\n\tif ( ! is_array( $_wp_registered_theme_features ) ) {\n\t\treturn null;\n\t}\n\n\treturn isset( $_wp_registered_theme_features[ $feature ] ) ? $_wp_registered_theme_features[ $feature ] : null;\n}\n\n/**\n * Checks an attachment being deleted to see if it's a header or background image.\n *\n * If true it removes the theme modification which would be pointing at the deleted\n * attachment.\n *\n * @access private\n * @since 3.0.0\n * @since 4.3.0 Also removes `header_image_data`.\n * @since 4.5.0 Also removes custom logo theme mods.\n *\n * @param int $id The attachment ID.\n */\nfunction _delete_attachment_theme_mod( $id ) {\n\t$attachment_image = wp_get_attachment_url( $id );\n\t$header_image     = get_header_image();\n\t$background_image = get_background_image();\n\t$custom_logo_id   = get_theme_mod( 'custom_logo' );\n\n\tif ( $custom_logo_id && $custom_logo_id == $id ) {\n\t\tremove_theme_mod( 'custom_logo' );\n\t\tremove_theme_mod( 'header_text' );\n\t}\n\n\tif ( $header_image && $header_image == $attachment_image ) {\n\t\tremove_theme_mod( 'header_image' );\n\t\tremove_theme_mod( 'header_image_data' );\n\t}\n\n\tif ( $background_image && $background_image == $attachment_image ) {\n\t\tremove_theme_mod( 'background_image' );\n\t}\n}\n\n/**\n * Checks if a theme has been changed and runs 'after_switch_theme' hook on the next WP load.\n *\n * See {@see 'after_switch_theme'}.\n *\n * @since 3.3.0\n */\nfunction check_theme_switched() {\n\t$stylesheet = get_option( 'theme_switched' );\n\tif ( $stylesheet ) {\n\t\t$old_theme = wp_get_theme( $stylesheet );\n\n\t\t// Prevent widget & menu mapping from running since Customizer already called it up front.\n\t\tif ( get_option( 'theme_switched_via_customizer' ) ) {\n\t\t\tremove_action( 'after_switch_theme', '_wp_menus_changed' );\n\t\t\tremove_action( 'after_switch_theme', '_wp_sidebars_changed' );\n\t\t\tupdate_option( 'theme_switched_via_customizer', false );\n\t\t}\n\n\t\tif ( $old_theme->exists() ) {\n\t\t\t/**\n\t\t\t * Fires on the first WP load after a theme switch if the old theme still exists.\n\t\t\t *\n\t\t\t * This action fires multiple times and the parameters differs\n\t\t\t * according to the context, if the old theme exists or not.\n\t\t\t * If the old theme is missing, the parameter will be the slug\n\t\t\t * of the old theme.\n\t\t\t *\n\t\t\t * @since 3.3.0\n\t\t\t *\n\t\t\t * @param string   $old_name  Old theme name.\n\t\t\t * @param WP_Theme $old_theme WP_Theme instance of the old theme.\n\t\t\t */\n\t\t\tdo_action( 'after_switch_theme', $old_theme->get( 'Name' ), $old_theme );\n\t\t} else {\n\t\t\t/** This action is documented in wp-includes/theme.php */\n\t\t\tdo_action( 'after_switch_theme', $stylesheet, $old_theme );\n\t\t}\n\t\tflush_rewrite_rules();\n\n\t\tupdate_option( 'theme_switched', false );\n\t}\n}\n\n/**\n * Includes and instantiates the WP_Customize_Manager class.\n *\n * Loads the Customizer at plugins_loaded when accessing the customize.php admin\n * page or when any request includes a wp_customize=on param or a customize_changeset\n * param (a UUID). This param is a signal for whether to bootstrap the Customizer when\n * WordPress is loading, especially in the Customizer preview\n * or when making Customizer Ajax requests for widgets or menus.\n *\n * @since 3.4.0\n *\n * @global WP_Customize_Manager $wp_customize\n */\nfunction _wp_customize_include() {\n\n\t$is_customize_admin_page = ( is_admin() && 'customize.php' === basename( $_SERVER['PHP_SELF'] ) );\n\t$should_include          = (\n\t\t$is_customize_admin_page\n\t\t||\n\t\t( isset( $_REQUEST['wp_customize'] ) && 'on' === $_REQUEST['wp_customize'] )\n\t\t||\n\t\t( ! empty( $_GET['customize_changeset_uuid'] ) || ! empty( $_POST['customize_changeset_uuid'] ) )\n\t);\n\n\tif ( ! $should_include ) {\n\t\treturn;\n\t}\n\n\t/*\n\t * Note that wp_unslash() is not being used on the input vars because it is\n\t * called before wp_magic_quotes() gets called. Besides this fact, none of\n\t * the values should contain any characters needing slashes anyway.\n\t */\n\t$keys       = array( 'changeset_uuid', 'customize_changeset_uuid', 'customize_theme', 'theme', 'customize_messenger_channel', 'customize_autosaved' );\n\t$input_vars = array_merge(\n\t\twp_array_slice_assoc( $_GET, $keys ),\n\t\twp_array_slice_assoc( $_POST, $keys )\n\t);\n\n\t$theme             = null;\n\t$autosaved         = null;\n\t$messenger_channel = null;\n\n\t// Value false indicates UUID should be determined after_setup_theme\n\t// to either re-use existing saved changeset or else generate a new UUID if none exists.\n\t$changeset_uuid = false;\n\n\t// Set initially fo false since defaults to true for back-compat;\n\t// can be overridden via the customize_changeset_branching filter.\n\t$branching = false;\n\n\tif ( $is_customize_admin_page && isset( $input_vars['changeset_uuid'] ) ) {\n\t\t$changeset_uuid = sanitize_key( $input_vars['changeset_uuid'] );\n\t} elseif ( ! empty( $input_vars['customize_changeset_uuid'] ) ) {\n\t\t$changeset_uuid = sanitize_key( $input_vars['customize_changeset_uuid'] );\n\t}\n\n\t// Note that theme will be sanitized via WP_Theme.\n\tif ( $is_customize_admin_page && isset( $input_vars['theme'] ) ) {\n\t\t$theme = $input_vars['theme'];\n\t} elseif ( isset( $input_vars['customize_theme'] ) ) {\n\t\t$theme = $input_vars['customize_theme'];\n\t}\n\n\tif ( ! empty( $input_vars['customize_autosaved'] ) ) {\n\t\t$autosaved = true;\n\t}\n\n\tif ( isset( $input_vars['customize_messenger_channel'] ) ) {\n\t\t$messenger_channel = sanitize_key( $input_vars['customize_messenger_channel'] );\n\t}\n\n\t/*\n\t * Note that settings must be previewed even outside the customizer preview\n\t * and also in the customizer pane itself. This is to enable loading an existing\n\t * changeset into the customizer. Previewing the settings only has to be prevented\n\t * here in the case of a customize_save action because this will cause WP to think\n\t * there is nothing changed that needs to be saved.\n\t */\n\t$is_customize_save_action = (\n\t\twp_doing_ajax()\n\t\t&&\n\t\tisset( $_REQUEST['action'] )\n\t\t&&\n\t\t'customize_save' === wp_unslash( $_REQUEST['action'] )\n\t);\n\t$settings_previewed       = ! $is_customize_save_action;\n\n\trequire_once ABSPATH . WPINC . '/class-wp-customize-manager.php';\n\t$GLOBALS['wp_customize'] = new WP_Customize_Manager( compact( 'changeset_uuid', 'theme', 'messenger_channel', 'settings_previewed', 'autosaved', 'branching' ) );\n}\n\n/**\n * Publishes a snapshot's changes.\n *\n * @since 4.7.0\n * @access private\n *\n * @global wpdb                 $wpdb         WordPress database abstraction object.\n * @global WP_Customize_Manager $wp_customize Customizer instance.\n *\n * @param string  $new_status     New post status.\n * @param string  $old_status     Old post status.\n * @param WP_Post $changeset_post Changeset post object.\n */\nfunction _wp_customize_publish_changeset( $new_status, $old_status, $changeset_post ) {\n\tglobal $wp_customize, $wpdb;\n\n\t$is_publishing_changeset = (\n\t\t'customize_changeset' === $changeset_post->post_type\n\t\t&&\n\t\t'publish' === $new_status\n\t\t&&\n\t\t'publish' !== $old_status\n\t);\n\tif ( ! $is_publishing_changeset ) {\n\t\treturn;\n\t}\n\n\tif ( empty( $wp_customize ) ) {\n\t\trequire_once ABSPATH . WPINC . '/class-wp-customize-manager.php';\n\t\t$wp_customize = new WP_Customize_Manager(\n\t\t\tarray(\n\t\t\t\t'changeset_uuid'     => $changeset_post->post_name,\n\t\t\t\t'settings_previewed' => false,\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( ! did_action( 'customize_register' ) ) {\n\t\t/*\n\t\t * When running from CLI or Cron, the customize_register action will need\n\t\t * to be triggered in order for core, themes, and plugins to register their\n\t\t * settings. Normally core will add_action( 'customize_register' ) at\n\t\t * priority 10 to register the core settings, and if any themes/plugins\n\t\t * also add_action( 'customize_register' ) at the same priority, they\n\t\t * will have a $wp_customize with those settings registered since they\n\t\t * call add_action() afterward, normally. However, when manually doing\n\t\t * the customize_register action after the setup_theme, then the order\n\t\t * will be reversed for two actions added at priority 10, resulting in\n\t\t * the core settings no longer being available as expected to themes/plugins.\n\t\t * So the following manually calls the method that registers the core\n\t\t * settings up front before doing the action.\n\t\t */\n\t\tremove_action( 'customize_register', array( $wp_customize, 'register_controls' ) );\n\t\t$wp_customize->register_controls();\n\n\t\t/** This filter is documented in /wp-includes/class-wp-customize-manager.php */\n\t\tdo_action( 'customize_register', $wp_customize );\n\t}\n\t$wp_customize->_publish_changeset_values( $changeset_post->ID );\n\n\t/*\n\t * Trash the changeset post if revisions are not enabled. Unpublished\n\t * changesets by default get garbage collected due to the auto-draft status.\n\t * When a changeset post is published, however, it would no longer get cleaned\n\t * out. This is a problem when the changeset posts are never displayed anywhere,\n\t * since they would just be endlessly piling up. So here we use the revisions\n\t * feature to indicate whether or not a published changeset should get trashed\n\t * and thus garbage collected.\n\t */\n\tif ( ! wp_revisions_enabled( $changeset_post ) ) {\n\t\t$wp_customize->trash_changeset_post( $changeset_post->ID );\n\t}\n}\n\n/**\n * Filters changeset post data upon insert to ensure post_name is intact.\n *\n * This is needed to prevent the post_name from being dropped when the post is\n * transitioned into pending status by a contributor.\n *\n * @since 4.7.0\n *\n * @see wp_insert_post()\n *\n * @param array $post_data          An array of slashed post data.\n * @param array $supplied_post_data An array of sanitized, but otherwise unmodified post data.\n * @return array Filtered data.\n */\nfunction _wp_customize_changeset_filter_insert_post_data( $post_data, $supplied_post_data ) {\n\tif ( isset( $post_data['post_type'] ) && 'customize_changeset' === $post_data['post_type'] ) {\n\n\t\t// Prevent post_name from being dropped, such as when contributor saves a changeset post as pending.\n\t\tif ( empty( $post_data['post_name'] ) && ! empty( $supplied_post_data['post_name'] ) ) {\n\t\t\t$post_data['post_name'] = $supplied_post_data['post_name'];\n\t\t}\n\t}\n\treturn $post_data;\n}\n\n/**\n * Adds settings for the customize-loader script.\n *\n * @since 3.4.0\n */\nfunction _wp_customize_loader_settings() {\n\t$admin_origin = parse_url( admin_url() );\n\t$home_origin  = parse_url( home_url() );\n\t$cross_domain = ( strtolower( $admin_origin['host'] ) != strtolower( $home_origin['host'] ) );\n\n\t$browser = array(\n\t\t'mobile' => wp_is_mobile(),\n\t\t'ios'    => wp_is_mobile() && preg_match( '/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT'] ),\n\t);\n\n\t$settings = array(\n\t\t'url'           => esc_url( admin_url( 'customize.php' ) ),\n\t\t'isCrossDomain' => $cross_domain,\n\t\t'browser'       => $browser,\n\t\t'l10n'          => array(\n\t\t\t'saveAlert'       => __( 'The changes you made will be lost if you navigate away from this page.' ),\n\t\t\t'mainIframeTitle' => __( 'Customizer' ),\n\t\t),\n\t);\n\n\t$script = 'var _wpCustomizeLoaderSettings = ' . wp_json_encode( $settings ) . ';';\n\n\t$wp_scripts = wp_scripts();\n\t$data       = $wp_scripts->get_data( 'customize-loader', 'data' );\n\tif ( $data ) {\n\t\t$script = \"$data\\n$script\";\n\t}\n\n\t$wp_scripts->add_data( 'customize-loader', 'data', $script );\n}\n\n/**\n * Returns a URL to load the Customizer.\n *\n * @since 3.4.0\n *\n * @param string $stylesheet Optional. Theme to customize. Defaults to current theme.\n *                           The theme's stylesheet will be urlencoded if necessary.\n * @return string\n */\nfunction wp_customize_url( $stylesheet = '' ) {\n\t$url = admin_url( 'customize.php' );\n\tif ( $stylesheet ) {\n\t\t$url .= '?theme=' . urlencode( $stylesheet );\n\t}\n\treturn esc_url( $url );\n}\n\n/**\n * Prints a script to check whether or not the Customizer is supported,\n * and apply either the no-customize-support or customize-support class\n * to the body.\n *\n * This function MUST be called inside the body tag.\n *\n * Ideally, call this function immediately after the body tag is opened.\n * This prevents a flash of unstyled content.\n *\n * It is also recommended that you add the \"no-customize-support\" class\n * to the body tag by default.\n *\n * @since 3.4.0\n * @since 4.7.0 Support for IE8 and below is explicitly removed via conditional comments.\n * @since 5.5.0 IE8 and older are no longer supported.\n */\nfunction wp_customize_support_script() {\n\t$admin_origin = parse_url( admin_url() );\n\t$home_origin  = parse_url( home_url() );\n\t$cross_domain = ( strtolower( $admin_origin['host'] ) != strtolower( $home_origin['host'] ) );\n\t$type_attr    = current_theme_supports( 'html5', 'script' ) ? '' : ' type=\"text/javascript\"';\n\t?>\n\t<script<?php echo $type_attr; ?>>\n\t\t(function() {\n\t\t\tvar request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\\\s+)(no-)?'+cs+'(\\\\s+|$)');\n\n\t<?php\tif ( $cross_domain ) : ?>\n\t\t\trequest = (function(){ var xhr = new XMLHttpRequest(); return ('withCredentials' in xhr); })();\n\t<?php\telse : ?>\n\t\t\trequest = true;\n\t<?php\tendif; ?>\n\n\t\t\tb[c] = b[c].replace( rcs, ' ' );\n\t\t\t// The customizer requires postMessage and CORS (if the site is cross domain).\n\t\t\tb[c] += ( window.postMessage && request ? ' ' : ' no-' ) + cs;\n\t\t}());\n\t</script>\n\t<?php\n}\n\n/**\n * Whether the site is being previewed in the Customizer.\n *\n * @since 4.0.0\n *\n * @global WP_Customize_Manager $wp_customize Customizer instance.\n *\n * @return bool True if the site is being previewed in the Customizer, false otherwise.\n */\nfunction is_customize_preview() {\n\tglobal $wp_customize;\n\n\treturn ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview();\n}\n\n/**\n * Makes sure that auto-draft posts get their post_date bumped or status changed to draft to prevent premature garbage-collection.\n *\n * When a changeset is updated but remains an auto-draft, ensure the post_date\n * for the auto-draft posts remains the same so that it will be\n * garbage-collected at the same time by `wp_delete_auto_drafts()`. Otherwise,\n * if the changeset is updated to be a draft then update the posts\n * to have a far-future post_date so that they will never be garbage collected\n * unless the changeset post itself is deleted.\n *\n * When a changeset is updated to be a persistent draft or to be scheduled for\n * publishing, then transition any dependent auto-drafts to a draft status so\n * that they likewise will not be garbage-collected but also so that they can\n * be edited in the admin before publishing since there is not yet a post/page\n * editing flow in the Customizer. See #39752.\n *\n * @link https://core.trac.wordpress.org/ticket/39752\n *\n * @since 4.8.0\n * @access private\n * @see wp_delete_auto_drafts()\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string   $new_status Transition to this post status.\n * @param string   $old_status Previous post status.\n * @param \\WP_Post $post       Post data.\n */\nfunction _wp_keep_alive_customize_changeset_dependent_auto_drafts( $new_status, $old_status, $post ) {\n\tglobal $wpdb;\n\tunset( $old_status );\n\n\t// Short-circuit if not a changeset or if the changeset was published.\n\tif ( 'customize_changeset' !== $post->post_type || 'publish' === $new_status ) {\n\t\treturn;\n\t}\n\n\t$data = json_decode( $post->post_content, true );\n\tif ( empty( $data['nav_menus_created_posts']['value'] ) ) {\n\t\treturn;\n\t}\n\n\t/*\n\t * Actually, in lieu of keeping alive, trash any customization drafts here if the changeset itself is\n\t * getting trashed. This is needed because when a changeset transitions to a draft, then any of the\n\t * dependent auto-draft post/page stubs will also get transitioned to customization drafts which\n\t * are then visible in the WP Admin. We cannot wait for the deletion of the changeset in which\n\t * _wp_delete_customize_changeset_dependent_auto_drafts() will be called, since they need to be\n\t * trashed to remove from visibility immediately.\n\t */\n\tif ( 'trash' === $new_status ) {\n\t\tforeach ( $data['nav_menus_created_posts']['value'] as $post_id ) {\n\t\t\tif ( ! empty( $post_id ) && 'draft' === get_post_status( $post_id ) ) {\n\t\t\t\twp_trash_post( $post_id );\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}\n\n\t$post_args = array();\n\tif ( 'auto-draft' === $new_status ) {\n\t\t/*\n\t\t * Keep the post date for the post matching the changeset\n\t\t * so that it will not be garbage-collected before the changeset.\n\t\t */\n\t\t$post_args['post_date'] = $post->post_date; // Note wp_delete_auto_drafts() only looks at this date.\n\t} else {\n\t\t/*\n\t\t * Since the changeset no longer has an auto-draft (and it is not published)\n\t\t * it is now a persistent changeset, a long-lived draft, and so any\n\t\t * associated auto-draft posts should likewise transition into having a draft\n\t\t * status. These drafts will be treated differently than regular drafts in\n\t\t * that they will be tied to the given changeset. The publish meta box is\n\t\t * replaced with a notice about how the post is part of a set of customized changes\n\t\t * which will be published when the changeset is published.\n\t\t */\n\t\t$post_args['post_status'] = 'draft';\n\t}\n\n\tforeach ( $data['nav_menus_created_posts']['value'] as $post_id ) {\n\t\tif ( empty( $post_id ) || 'auto-draft' !== get_post_status( $post_id ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\t$wpdb->update(\n\t\t\t$wpdb->posts,\n\t\t\t$post_args,\n\t\t\tarray( 'ID' => $post_id )\n\t\t);\n\t\tclean_post_cache( $post_id );\n\t}\n}\n\n/**\n * Creates the initial theme features when the 'setup_theme' action is fired.\n *\n * See {@see 'setup_theme'}.\n *\n * @since 5.5.0\n */\nfunction create_initial_theme_features() {\n\tregister_theme_feature(\n\t\t'align-wide',\n\t\tarray(\n\t\t\t'description'  => __( 'Whether theme opts in to wide alignment CSS class.' ),\n\t\t\t'show_in_rest' => true,\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'automatic-feed-links',\n\t\tarray(\n\t\t\t'description'  => __( 'Whether posts and comments RSS feed links are added to head.' ),\n\t\t\t'show_in_rest' => true,\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'custom-background',\n\t\tarray(\n\t\t\t'description'  => __( 'Custom background if defined by the theme.' ),\n\t\t\t'type'         => 'object',\n\t\t\t'show_in_rest' => array(\n\t\t\t\t'schema' => array(\n\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t'default-image'      => array(\n\t\t\t\t\t\t\t'type'   => 'string',\n\t\t\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default-preset'     => array(\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t'enum' => array(\n\t\t\t\t\t\t\t\t'default',\n\t\t\t\t\t\t\t\t'fill',\n\t\t\t\t\t\t\t\t'fit',\n\t\t\t\t\t\t\t\t'repeat',\n\t\t\t\t\t\t\t\t'custom',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default-position-x' => array(\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t'enum' => array(\n\t\t\t\t\t\t\t\t'left',\n\t\t\t\t\t\t\t\t'center',\n\t\t\t\t\t\t\t\t'right',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default-position-y' => array(\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t'enum' => array(\n\t\t\t\t\t\t\t\t'left',\n\t\t\t\t\t\t\t\t'center',\n\t\t\t\t\t\t\t\t'right',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default-size'       => array(\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t'enum' => array(\n\t\t\t\t\t\t\t\t'auto',\n\t\t\t\t\t\t\t\t'contain',\n\t\t\t\t\t\t\t\t'cover',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default-repeat'     => array(\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t'enum' => array(\n\t\t\t\t\t\t\t\t'repeat-x',\n\t\t\t\t\t\t\t\t'repeat-y',\n\t\t\t\t\t\t\t\t'repeat',\n\t\t\t\t\t\t\t\t'no-repeat',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default-attachment' => array(\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t'enum' => array(\n\t\t\t\t\t\t\t\t'scroll',\n\t\t\t\t\t\t\t\t'fixed',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default-color'      => array(\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'custom-header',\n\t\tarray(\n\t\t\t'description'  => __( 'Custom header if defined by the theme.' ),\n\t\t\t'type'         => 'object',\n\t\t\t'show_in_rest' => array(\n\t\t\t\t'schema' => array(\n\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t'default-image'      => array(\n\t\t\t\t\t\t\t'type'   => 'string',\n\t\t\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'random-default'     => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'width'              => array(\n\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'height'             => array(\n\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'flex-height'        => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'flex-width'         => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default-text-color' => array(\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'header-text'        => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'uploads'            => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'video'              => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'custom-logo',\n\t\tarray(\n\t\t\t'type'         => 'object',\n\t\t\t'description'  => __( 'Custom logo if defined by the theme.' ),\n\t\t\t'show_in_rest' => array(\n\t\t\t\t'schema' => array(\n\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t'width'                => array(\n\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'height'               => array(\n\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'flex-width'           => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'flex-height'          => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'header-text'          => array(\n\t\t\t\t\t\t\t'type'  => 'array',\n\t\t\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'unlink-homepage-logo' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'customize-selective-refresh-widgets',\n\t\tarray(\n\t\t\t'description'  => __( 'Whether the theme enables Selective Refresh for Widgets being managed with the Customizer.' ),\n\t\t\t'show_in_rest' => true,\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'dark-editor-style',\n\t\tarray(\n\t\t\t'description'  => __( 'Whether theme opts in to the dark editor style UI.' ),\n\t\t\t'show_in_rest' => true,\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'disable-custom-colors',\n\t\tarray(\n\t\t\t'description'  => __( 'Whether the theme disables custom colors.' ),\n\t\t\t'show_in_rest' => true,\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'disable-custom-font-sizes',\n\t\tarray(\n\t\t\t'description'  => __( 'Whether the theme disables custom font sizes.' ),\n\t\t\t'show_in_rest' => true,\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'disable-custom-gradients',\n\t\tarray(\n\t\t\t'description'  => __( 'Whether the theme disables custom gradients.' ),\n\t\t\t'show_in_rest' => true,\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'editor-color-palette',\n\t\tarray(\n\t\t\t'type'         => 'array',\n\t\t\t'description'  => __( 'Custom color palette if defined by the theme.' ),\n\t\t\t'show_in_rest' => array(\n\t\t\t\t'schema' => array(\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type'       => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'name'  => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'slug'  => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\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\t\t\t),\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'editor-font-sizes',\n\t\tarray(\n\t\t\t'type'         => 'array',\n\t\t\t'description'  => __( 'Custom font sizes if defined by the theme.' ),\n\t\t\t'show_in_rest' => array(\n\t\t\t\t'schema' => array(\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type'       => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'size' => array(\n\t\t\t\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'slug' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\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\t\t\t),\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'editor-gradient-presets',\n\t\tarray(\n\t\t\t'type'         => 'array',\n\t\t\t'description'  => __( 'Custom gradient presets if defined by the theme.' ),\n\t\t\t'show_in_rest' => array(\n\t\t\t\t'schema' => array(\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type'       => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'name'     => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'gradient' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'slug'     => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\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\t\t\t),\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'editor-styles',\n\t\tarray(\n\t\t\t'description'  => __( 'Whether theme opts in to the editor styles CSS wrapper.' ),\n\t\t\t'show_in_rest' => true,\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'html5',\n\t\tarray(\n\t\t\t'type'         => 'array',\n\t\t\t'description'  => __( 'Allows use of HTML5 markup for search forms, comment forms, comment lists, gallery, and caption.' ),\n\t\t\t'show_in_rest' => array(\n\t\t\t\t'schema' => array(\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'enum' => array(\n\t\t\t\t\t\t\t'search-form',\n\t\t\t\t\t\t\t'comment-form',\n\t\t\t\t\t\t\t'comment-list',\n\t\t\t\t\t\t\t'gallery',\n\t\t\t\t\t\t\t'caption',\n\t\t\t\t\t\t\t'script',\n\t\t\t\t\t\t\t'style',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'post-formats',\n\t\tarray(\n\t\t\t'type'         => 'array',\n\t\t\t'description'  => __( 'Post formats supported.' ),\n\t\t\t'show_in_rest' => array(\n\t\t\t\t'name'             => 'formats',\n\t\t\t\t'schema'           => array(\n\t\t\t\t\t'items'   => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'enum' => get_post_format_slugs(),\n\t\t\t\t\t),\n\t\t\t\t\t'default' => array( 'standard' ),\n\t\t\t\t),\n\t\t\t\t'prepare_callback' => static function ( $formats ) {\n\t\t\t\t\t$formats = is_array( $formats ) ? array_values( $formats[0] ) : array();\n\t\t\t\t\t$formats = array_merge( array( 'standard' ), $formats );\n\n\t\t\t\t\treturn $formats;\n\t\t\t\t},\n\t\t\t),\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'post-thumbnails',\n\t\tarray(\n\t\t\t'type'         => 'array',\n\t\t\t'description'  => __( 'The post types that support thumbnails or true if all post types are supported.' ),\n\t\t\t'show_in_rest' => array(\n\t\t\t\t'type'   => array( 'boolean', 'array' ),\n\t\t\t\t'schema' => array(\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'responsive-embeds',\n\t\tarray(\n\t\t\t'description'  => __( 'Whether the theme supports responsive embedded content.' ),\n\t\t\t'show_in_rest' => true,\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'title-tag',\n\t\tarray(\n\t\t\t'description'  => __( 'Whether the theme can manage the document title tag.' ),\n\t\t\t'show_in_rest' => true,\n\t\t)\n\t);\n\tregister_theme_feature(\n\t\t'wp-block-styles',\n\t\tarray(\n\t\t\t'description'  => __( 'Whether theme opts in to default WordPress block styles for viewing.' ),\n\t\t\t'show_in_rest' => true,\n\t\t)\n\t);\n}\n", "num_lines": 4040}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * A simple set of functions to check our version 1.0 update service.\n *\n * @package WordPress\n * @since 2.3.0\n */\n\n/**\n * Check WordPress version against the newest version.\n *\n * The WordPress version, PHP version, and locale is sent.\n *\n * Checks against the WordPress server at api.wordpress.org. Will only check\n * if WordPress isn't installing.\n *\n * @since 2.3.0\n *\n * @global string $wp_version       Used to check against the newest WordPress version.\n * @global wpdb   $wpdb             WordPress database abstraction object.\n * @global string $wp_local_package Locale code of the package.\n *\n * @param array $extra_stats Extra statistics to report to the WordPress.org API.\n * @param bool  $force_check Whether to bypass the transient cache and force a fresh update check. Defaults to false, true if $extra_stats is set.\n */\nfunction wp_version_check( $extra_stats = array(), $force_check = false ) {\n\tglobal $wpdb, $wp_local_package;\n\n\tif ( wp_installing() ) {\n\t\treturn;\n\t}\n\n\t// Include an unmodified $wp_version.\n\trequire ABSPATH . WPINC . '/version.php';\n\t$php_version = phpversion();\n\n\t$current      = get_site_transient( 'update_core' );\n\t$translations = wp_get_installed_translations( 'core' );\n\n\t// Invalidate the transient when $wp_version changes.\n\tif ( is_object( $current ) && $wp_version !== $current->version_checked ) {\n\t\t$current = false;\n\t}\n\n\tif ( ! is_object( $current ) ) {\n\t\t$current                  = new stdClass;\n\t\t$current->updates         = array();\n\t\t$current->version_checked = $wp_version;\n\t}\n\n\tif ( ! empty( $extra_stats ) ) {\n\t\t$force_check = true;\n\t}\n\n\t// Wait 1 minute between multiple version check requests.\n\t$timeout          = MINUTE_IN_SECONDS;\n\t$time_not_changed = isset( $current->last_checked ) && $timeout > ( time() - $current->last_checked );\n\n\tif ( ! $force_check && $time_not_changed ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Filters the locale requested for WordPress core translations.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $locale Current locale.\n\t */\n\t$locale = apply_filters( 'core_version_check_locale', get_locale() );\n\n\t// Update last_checked for current to prevent multiple blocking requests if request hangs.\n\t$current->last_checked = time();\n\tset_site_transient( 'update_core', $current );\n\n\tif ( method_exists( $wpdb, 'db_version' ) ) {\n\t\t$mysql_version = preg_replace( '/[^0-9.].*/', '', $wpdb->db_version() );\n\t} else {\n\t\t$mysql_version = 'N/A';\n\t}\n\n\tif ( is_multisite() ) {\n\t\t$user_count        = get_user_count();\n\t\t$num_blogs         = get_blog_count();\n\t\t$wp_install        = network_site_url();\n\t\t$multisite_enabled = 1;\n\t} else {\n\t\t$user_count        = count_users();\n\t\t$user_count        = $user_count['total_users'];\n\t\t$multisite_enabled = 0;\n\t\t$num_blogs         = 1;\n\t\t$wp_install        = home_url( '/' );\n\t}\n\n\t$query = array(\n\t\t'version'            => $wp_version,\n\t\t'php'                => $php_version,\n\t\t'locale'             => $locale,\n\t\t'mysql'              => $mysql_version,\n\t\t'local_package'      => isset( $wp_local_package ) ? $wp_local_package : '',\n\t\t'blogs'              => $num_blogs,\n\t\t'users'              => $user_count,\n\t\t'multisite_enabled'  => $multisite_enabled,\n\t\t'initial_db_version' => get_site_option( 'initial_db_version' ),\n\t);\n\n\t/**\n\t * Filter the query arguments sent as part of the core version check.\n\t *\n\t * WARNING: Changing this data may result in your site not receiving security updates.\n\t * Please exercise extreme caution.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param array $query {\n\t *     Version check query arguments.\n\t *\n\t *     @type string $version            WordPress version number.\n\t *     @type string $php                PHP version number.\n\t *     @type string $locale             The locale to retrieve updates for.\n\t *     @type string $mysql              MySQL version number.\n\t *     @type string $local_package      The value of the $wp_local_package global, when set.\n\t *     @type int    $blogs              Number of sites on this WordPress installation.\n\t *     @type int    $users              Number of users on this WordPress installation.\n\t *     @type int    $multisite_enabled  Whether this WordPress installation uses Multisite.\n\t *     @type int    $initial_db_version Database version of WordPress at time of installation.\n\t * }\n\t */\n\t$query = apply_filters( 'core_version_check_query_args', $query );\n\n\t$post_body = array(\n\t\t'translations' => wp_json_encode( $translations ),\n\t);\n\n\tif ( is_array( $extra_stats ) ) {\n\t\t$post_body = array_merge( $post_body, $extra_stats );\n\t}\n\n\t$url      = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' );\n\t$http_url = $url;\n\t$ssl      = wp_http_supports( array( 'ssl' ) );\n\n\tif ( $ssl ) {\n\t\t$url = set_url_scheme( $url, 'https' );\n\t}\n\n\t$doing_cron = wp_doing_cron();\n\n\t$options = array(\n\t\t'timeout'    => $doing_cron ? 30 : 3,\n\t\t'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),\n\t\t'headers'    => array(\n\t\t\t'wp_install' => $wp_install,\n\t\t\t'wp_blog'    => home_url( '/' ),\n\t\t),\n\t\t'body'       => $post_body,\n\t);\n\n\t$response = wp_remote_post( $url, $options );\n\n\tif ( $ssl && is_wp_error( $response ) ) {\n\t\ttrigger_error(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=\"%s\">support forums</a>.' ),\n\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),\n\t\t\theaders_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE\n\t\t);\n\t\t$response = wp_remote_post( $http_url, $options );\n\t}\n\n\tif ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {\n\t\treturn;\n\t}\n\n\t$body = trim( wp_remote_retrieve_body( $response ) );\n\t$body = json_decode( $body, true );\n\n\tif ( ! is_array( $body ) || ! isset( $body['offers'] ) ) {\n\t\treturn;\n\t}\n\n\t$offers = $body['offers'];\n\n\tforeach ( $offers as &$offer ) {\n\t\tforeach ( $offer as $offer_key => $value ) {\n\t\t\tif ( 'packages' === $offer_key ) {\n\t\t\t\t$offer['packages'] = (object) array_intersect_key(\n\t\t\t\t\tarray_map( 'esc_url', $offer['packages'] ),\n\t\t\t\t\tarray_fill_keys( array( 'full', 'no_content', 'new_bundled', 'partial', 'rollback' ), '' )\n\t\t\t\t);\n\t\t\t} elseif ( 'download' === $offer_key ) {\n\t\t\t\t$offer['download'] = esc_url( $value );\n\t\t\t} else {\n\t\t\t\t$offer[ $offer_key ] = esc_html( $value );\n\t\t\t}\n\t\t}\n\t\t$offer = (object) array_intersect_key(\n\t\t\t$offer,\n\t\t\tarray_fill_keys(\n\t\t\t\tarray(\n\t\t\t\t\t'response',\n\t\t\t\t\t'download',\n\t\t\t\t\t'locale',\n\t\t\t\t\t'packages',\n\t\t\t\t\t'current',\n\t\t\t\t\t'version',\n\t\t\t\t\t'php_version',\n\t\t\t\t\t'mysql_version',\n\t\t\t\t\t'new_bundled',\n\t\t\t\t\t'partial_version',\n\t\t\t\t\t'notify_email',\n\t\t\t\t\t'support_email',\n\t\t\t\t\t'new_files',\n\t\t\t\t),\n\t\t\t\t''\n\t\t\t)\n\t\t);\n\t}\n\n\t$updates                  = new stdClass();\n\t$updates->updates         = $offers;\n\t$updates->last_checked    = time();\n\t$updates->version_checked = $wp_version;\n\n\tif ( isset( $body['translations'] ) ) {\n\t\t$updates->translations = $body['translations'];\n\t}\n\n\tset_site_transient( 'update_core', $updates );\n\n\tif ( ! empty( $body['ttl'] ) ) {\n\t\t$ttl = (int) $body['ttl'];\n\n\t\tif ( $ttl && ( time() + $ttl < wp_next_scheduled( 'wp_version_check' ) ) ) {\n\t\t\t// Queue an event to re-run the update check in $ttl seconds.\n\t\t\twp_schedule_single_event( time() + $ttl, 'wp_version_check' );\n\t\t}\n\t}\n\n\t// Trigger background updates if running non-interactively, and we weren't called from the update handler.\n\tif ( $doing_cron && ! doing_action( 'wp_maybe_auto_update' ) ) {\n\t\t/**\n\t\t * Fires during wp_cron, starting the auto-update process.\n\t\t *\n\t\t * @since 3.9.0\n\t\t */\n\t\tdo_action( 'wp_maybe_auto_update' );\n\t}\n}\n\n/**\n * Checks for available updates to plugins based on the latest versions hosted on WordPress.org.\n *\n * Despite its name this function does not actually perform any updates, it only checks for available updates.\n *\n * A list of all plugins installed is sent to WP, along with the site locale.\n *\n * Checks against the WordPress server at api.wordpress.org. Will only check\n * if WordPress isn't installing.\n *\n * @since 2.3.0\n *\n * @global string $wp_version The WordPress version string.\n *\n * @param array $extra_stats Extra statistics to report to the WordPress.org API.\n */\nfunction wp_update_plugins( $extra_stats = array() ) {\n\tif ( wp_installing() ) {\n\t\treturn;\n\t}\n\n\t// Include an unmodified $wp_version.\n\trequire ABSPATH . WPINC . '/version.php';\n\n\t// If running blog-side, bail unless we've not checked in the last 12 hours.\n\tif ( ! function_exists( 'get_plugins' ) ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\t}\n\n\t$plugins      = get_plugins();\n\t$translations = wp_get_installed_translations( 'plugins' );\n\n\t$active  = get_option( 'active_plugins', array() );\n\t$current = get_site_transient( 'update_plugins' );\n\n\tif ( ! is_object( $current ) ) {\n\t\t$current = new stdClass;\n\t}\n\n\t$new_option               = new stdClass;\n\t$new_option->last_checked = time();\n\n\t$doing_cron = wp_doing_cron();\n\n\t// Check for update on a different schedule, depending on the page.\n\tswitch ( current_filter() ) {\n\t\tcase 'upgrader_process_complete':\n\t\t\t$timeout = 0;\n\t\t\tbreak;\n\t\tcase 'load-update-core.php':\n\t\t\t$timeout = MINUTE_IN_SECONDS;\n\t\t\tbreak;\n\t\tcase 'load-plugins.php':\n\t\tcase 'load-update.php':\n\t\t\t$timeout = HOUR_IN_SECONDS;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif ( $doing_cron ) {\n\t\t\t\t$timeout = 2 * HOUR_IN_SECONDS;\n\t\t\t} else {\n\t\t\t\t$timeout = 12 * HOUR_IN_SECONDS;\n\t\t\t}\n\t}\n\n\t$time_not_changed = isset( $current->last_checked ) && $timeout > ( time() - $current->last_checked );\n\n\tif ( $time_not_changed && ! $extra_stats ) {\n\t\t$plugin_changed = false;\n\n\t\tforeach ( $plugins as $file => $p ) {\n\t\t\t$new_option->checked[ $file ] = $p['Version'];\n\n\t\t\tif ( ! isset( $current->checked[ $file ] ) || strval( $current->checked[ $file ] ) !== strval( $p['Version'] ) ) {\n\t\t\t\t$plugin_changed = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $current->response ) && is_array( $current->response ) ) {\n\t\t\tforeach ( $current->response as $plugin_file => $update_details ) {\n\t\t\t\tif ( ! isset( $plugins[ $plugin_file ] ) ) {\n\t\t\t\t\t$plugin_changed = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Bail if we've checked recently and if nothing has changed.\n\t\tif ( ! $plugin_changed ) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// Update last_checked for current to prevent multiple blocking requests if request hangs.\n\t$current->last_checked = time();\n\tset_site_transient( 'update_plugins', $current );\n\n\t$to_send = compact( 'plugins', 'active' );\n\n\t$locales = array_values( get_available_languages() );\n\n\t/**\n\t * Filters the locales requested for plugin translations.\n\t *\n\t * @since 3.7.0\n\t * @since 4.5.0 The default value of the `$locales` parameter changed to include all locales.\n\t *\n\t * @param array $locales Plugin locales. Default is all available locales of the site.\n\t */\n\t$locales = apply_filters( 'plugins_update_check_locales', $locales );\n\t$locales = array_unique( $locales );\n\n\tif ( $doing_cron ) {\n\t\t$timeout = 30;\n\t} else {\n\t\t// Three seconds, plus one extra second for every 10 plugins.\n\t\t$timeout = 3 + (int) ( count( $plugins ) / 10 );\n\t}\n\n\t$options = array(\n\t\t'timeout'    => $timeout,\n\t\t'body'       => array(\n\t\t\t'plugins'      => wp_json_encode( $to_send ),\n\t\t\t'translations' => wp_json_encode( $translations ),\n\t\t\t'locale'       => wp_json_encode( $locales ),\n\t\t\t'all'          => wp_json_encode( true ),\n\t\t),\n\t\t'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),\n\t);\n\n\tif ( $extra_stats ) {\n\t\t$options['body']['update_stats'] = wp_json_encode( $extra_stats );\n\t}\n\n\t$url      = 'http://api.wordpress.org/plugins/update-check/1.1/';\n\t$http_url = $url;\n\t$ssl      = wp_http_supports( array( 'ssl' ) );\n\n\tif ( $ssl ) {\n\t\t$url = set_url_scheme( $url, 'https' );\n\t}\n\n\t$raw_response = wp_remote_post( $url, $options );\n\n\tif ( $ssl && is_wp_error( $raw_response ) ) {\n\t\ttrigger_error(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=\"%s\">support forums</a>.' ),\n\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),\n\t\t\theaders_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE\n\t\t);\n\t\t$raw_response = wp_remote_post( $http_url, $options );\n\t}\n\n\tif ( is_wp_error( $raw_response ) || 200 !== wp_remote_retrieve_response_code( $raw_response ) ) {\n\t\treturn;\n\t}\n\n\t$response = json_decode( wp_remote_retrieve_body( $raw_response ), true );\n\n\tforeach ( $response['plugins'] as &$plugin ) {\n\t\t$plugin = (object) $plugin;\n\n\t\tif ( isset( $plugin->compatibility ) ) {\n\t\t\t$plugin->compatibility = (object) $plugin->compatibility;\n\n\t\t\tforeach ( $plugin->compatibility as &$data ) {\n\t\t\t\t$data = (object) $data;\n\t\t\t}\n\t\t}\n\t}\n\n\tunset( $plugin, $data );\n\n\tforeach ( $response['no_update'] as &$plugin ) {\n\t\t$plugin = (object) $plugin;\n\t}\n\n\tunset( $plugin );\n\n\tif ( is_array( $response ) ) {\n\t\t$new_option->response     = $response['plugins'];\n\t\t$new_option->translations = $response['translations'];\n\t\t// TODO: Perhaps better to store no_update in a separate transient with an expiry?\n\t\t$new_option->no_update = $response['no_update'];\n\t} else {\n\t\t$new_option->response     = array();\n\t\t$new_option->translations = array();\n\t\t$new_option->no_update    = array();\n\t}\n\n\tset_site_transient( 'update_plugins', $new_option );\n}\n\n/**\n * Checks for available updates to themes based on the latest versions hosted on WordPress.org.\n *\n * Despite its name this function does not actually perform any updates, it only checks for available updates.\n *\n * A list of all themes installed is sent to WP, along with the site locale.\n *\n * Checks against the WordPress server at api.wordpress.org. Will only check\n * if WordPress isn't installing.\n *\n * @since 2.7.0\n *\n * @global string $wp_version The WordPress version string.\n *\n * @param array $extra_stats Extra statistics to report to the WordPress.org API.\n */\nfunction wp_update_themes( $extra_stats = array() ) {\n\tif ( wp_installing() ) {\n\t\treturn;\n\t}\n\n\t// Include an unmodified $wp_version.\n\trequire ABSPATH . WPINC . '/version.php';\n\n\t$installed_themes = wp_get_themes();\n\t$translations     = wp_get_installed_translations( 'themes' );\n\n\t$last_update = get_site_transient( 'update_themes' );\n\n\tif ( ! is_object( $last_update ) ) {\n\t\t$last_update = new stdClass;\n\t}\n\n\t$themes  = array();\n\t$checked = array();\n\t$request = array();\n\n\t// Put slug of current theme into request.\n\t$request['active'] = get_option( 'stylesheet' );\n\n\tforeach ( $installed_themes as $theme ) {\n\t\t$checked[ $theme->get_stylesheet() ] = $theme->get( 'Version' );\n\n\t\t$themes[ $theme->get_stylesheet() ] = array(\n\t\t\t'Name'       => $theme->get( 'Name' ),\n\t\t\t'Title'      => $theme->get( 'Name' ),\n\t\t\t'Version'    => $theme->get( 'Version' ),\n\t\t\t'Author'     => $theme->get( 'Author' ),\n\t\t\t'Author URI' => $theme->get( 'AuthorURI' ),\n\t\t\t'Template'   => $theme->get_template(),\n\t\t\t'Stylesheet' => $theme->get_stylesheet(),\n\t\t);\n\t}\n\n\t$doing_cron = wp_doing_cron();\n\n\t// Check for update on a different schedule, depending on the page.\n\tswitch ( current_filter() ) {\n\t\tcase 'upgrader_process_complete':\n\t\t\t$timeout = 0;\n\t\t\tbreak;\n\t\tcase 'load-update-core.php':\n\t\t\t$timeout = MINUTE_IN_SECONDS;\n\t\t\tbreak;\n\t\tcase 'load-themes.php':\n\t\tcase 'load-update.php':\n\t\t\t$timeout = HOUR_IN_SECONDS;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif ( $doing_cron ) {\n\t\t\t\t$timeout = 2 * HOUR_IN_SECONDS;\n\t\t\t} else {\n\t\t\t\t$timeout = 12 * HOUR_IN_SECONDS;\n\t\t\t}\n\t}\n\n\t$time_not_changed = isset( $last_update->last_checked ) && $timeout > ( time() - $last_update->last_checked );\n\n\tif ( $time_not_changed && ! $extra_stats ) {\n\t\t$theme_changed = false;\n\n\t\tforeach ( $checked as $slug => $v ) {\n\t\t\tif ( ! isset( $last_update->checked[ $slug ] ) || strval( $last_update->checked[ $slug ] ) !== strval( $v ) ) {\n\t\t\t\t$theme_changed = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $last_update->response ) && is_array( $last_update->response ) ) {\n\t\t\tforeach ( $last_update->response as $slug => $update_details ) {\n\t\t\t\tif ( ! isset( $checked[ $slug ] ) ) {\n\t\t\t\t\t$theme_changed = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Bail if we've checked recently and if nothing has changed.\n\t\tif ( ! $theme_changed ) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// Update last_checked for current to prevent multiple blocking requests if request hangs.\n\t$last_update->last_checked = time();\n\tset_site_transient( 'update_themes', $last_update );\n\n\t$request['themes'] = $themes;\n\n\t$locales = array_values( get_available_languages() );\n\n\t/**\n\t * Filters the locales requested for theme translations.\n\t *\n\t * @since 3.7.0\n\t * @since 4.5.0 The default value of the `$locales` parameter changed to include all locales.\n\t *\n\t * @param array $locales Theme locales. Default is all available locales of the site.\n\t */\n\t$locales = apply_filters( 'themes_update_check_locales', $locales );\n\t$locales = array_unique( $locales );\n\n\tif ( $doing_cron ) {\n\t\t$timeout = 30;\n\t} else {\n\t\t// Three seconds, plus one extra second for every 10 themes.\n\t\t$timeout = 3 + (int) ( count( $themes ) / 10 );\n\t}\n\n\t$options = array(\n\t\t'timeout'    => $timeout,\n\t\t'body'       => array(\n\t\t\t'themes'       => wp_json_encode( $request ),\n\t\t\t'translations' => wp_json_encode( $translations ),\n\t\t\t'locale'       => wp_json_encode( $locales ),\n\t\t),\n\t\t'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),\n\t);\n\n\tif ( $extra_stats ) {\n\t\t$options['body']['update_stats'] = wp_json_encode( $extra_stats );\n\t}\n\n\t$url      = 'http://api.wordpress.org/themes/update-check/1.1/';\n\t$http_url = $url;\n\t$ssl      = wp_http_supports( array( 'ssl' ) );\n\n\tif ( $ssl ) {\n\t\t$url = set_url_scheme( $url, 'https' );\n\t}\n\n\t$raw_response = wp_remote_post( $url, $options );\n\n\tif ( $ssl && is_wp_error( $raw_response ) ) {\n\t\ttrigger_error(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=\"%s\">support forums</a>.' ),\n\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),\n\t\t\theaders_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE\n\t\t);\n\t\t$raw_response = wp_remote_post( $http_url, $options );\n\t}\n\n\tif ( is_wp_error( $raw_response ) || 200 !== wp_remote_retrieve_response_code( $raw_response ) ) {\n\t\treturn;\n\t}\n\n\t$new_update               = new stdClass;\n\t$new_update->last_checked = time();\n\t$new_update->checked      = $checked;\n\n\t$response = json_decode( wp_remote_retrieve_body( $raw_response ), true );\n\n\tif ( is_array( $response ) ) {\n\t\t$new_update->response     = $response['themes'];\n\t\t$new_update->no_update    = $response['no_update'];\n\t\t$new_update->translations = $response['translations'];\n\t}\n\n\tset_site_transient( 'update_themes', $new_update );\n}\n\n/**\n * Performs WordPress automatic background updates.\n *\n * Updates WordPress core plus any plugins and themes that have automatic updates enabled.\n *\n * @since 3.7.0\n */\nfunction wp_maybe_auto_update() {\n\tinclude_once ABSPATH . 'wp-admin/includes/admin.php';\n\trequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\n\t$upgrader = new WP_Automatic_Updater;\n\t$upgrader->run();\n}\n\n/**\n * Retrieves a list of all language updates available.\n *\n * @since 3.7.0\n *\n * @return object[] Array of translation objects that have available updates.\n */\nfunction wp_get_translation_updates() {\n\t$updates    = array();\n\t$transients = array(\n\t\t'update_core'    => 'core',\n\t\t'update_plugins' => 'plugin',\n\t\t'update_themes'  => 'theme',\n\t);\n\n\tforeach ( $transients as $transient => $type ) {\n\t\t$transient = get_site_transient( $transient );\n\n\t\tif ( empty( $transient->translations ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tforeach ( $transient->translations as $translation ) {\n\t\t\t$updates[] = (object) $translation;\n\t\t}\n\t}\n\n\treturn $updates;\n}\n\n/**\n * Collect counts and UI strings for available updates\n *\n * @since 3.3.0\n *\n * @return array\n */\nfunction wp_get_update_data() {\n\t$counts = array(\n\t\t'plugins'      => 0,\n\t\t'themes'       => 0,\n\t\t'wordpress'    => 0,\n\t\t'translations' => 0,\n\t);\n\n\t$plugins = current_user_can( 'update_plugins' );\n\n\tif ( $plugins ) {\n\t\t$update_plugins = get_site_transient( 'update_plugins' );\n\n\t\tif ( ! empty( $update_plugins->response ) ) {\n\t\t\t$counts['plugins'] = count( $update_plugins->response );\n\t\t}\n\t}\n\n\t$themes = current_user_can( 'update_themes' );\n\n\tif ( $themes ) {\n\t\t$update_themes = get_site_transient( 'update_themes' );\n\n\t\tif ( ! empty( $update_themes->response ) ) {\n\t\t\t$counts['themes'] = count( $update_themes->response );\n\t\t}\n\t}\n\n\t$core = current_user_can( 'update_core' );\n\n\tif ( $core && function_exists( 'get_core_updates' ) ) {\n\t\t$update_wordpress = get_core_updates( array( 'dismissed' => false ) );\n\n\t\tif ( ! empty( $update_wordpress )\n\t\t\t&& ! in_array( $update_wordpress[0]->response, array( 'development', 'latest' ), true )\n\t\t\t&& current_user_can( 'update_core' )\n\t\t) {\n\t\t\t$counts['wordpress'] = 1;\n\t\t}\n\t}\n\n\tif ( ( $core || $plugins || $themes ) && wp_get_translation_updates() ) {\n\t\t$counts['translations'] = 1;\n\t}\n\n\t$counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'] + $counts['translations'];\n\t$titles          = array();\n\n\tif ( $counts['wordpress'] ) {\n\t\t/* translators: %d: Number of available WordPress updates. */\n\t\t$titles['wordpress'] = sprintf( __( '%d WordPress Update' ), $counts['wordpress'] );\n\t}\n\n\tif ( $counts['plugins'] ) {\n\t\t/* translators: %d: Number of available plugin updates. */\n\t\t$titles['plugins'] = sprintf( _n( '%d Plugin Update', '%d Plugin Updates', $counts['plugins'] ), $counts['plugins'] );\n\t}\n\n\tif ( $counts['themes'] ) {\n\t\t/* translators: %d: Number of available theme updates. */\n\t\t$titles['themes'] = sprintf( _n( '%d Theme Update', '%d Theme Updates', $counts['themes'] ), $counts['themes'] );\n\t}\n\n\tif ( $counts['translations'] ) {\n\t\t$titles['translations'] = __( 'Translation Updates' );\n\t}\n\n\t$update_title = $titles ? esc_attr( implode( ', ', $titles ) ) : '';\n\n\t$update_data = array(\n\t\t'counts' => $counts,\n\t\t'title'  => $update_title,\n\t);\n\t/**\n\t * Filters the returned array of update data for plugins, themes, and WordPress core.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param array $update_data {\n\t *     Fetched update data.\n\t *\n\t *     @type array   $counts       An array of counts for available plugin, theme, and WordPress updates.\n\t *     @type string  $update_title Titles of available updates.\n\t * }\n\t * @param array $titles An array of update counts and UI strings for available updates.\n\t */\n\treturn apply_filters( 'wp_get_update_data', $update_data, $titles );\n}\n\n/**\n * Determines whether core should be updated.\n *\n * @since 2.8.0\n *\n * @global string $wp_version The WordPress version string.\n */\nfunction _maybe_update_core() {\n\t// Include an unmodified $wp_version.\n\trequire ABSPATH . WPINC . '/version.php';\n\n\t$current = get_site_transient( 'update_core' );\n\n\tif ( isset( $current->last_checked, $current->version_checked )\n\t\t&& 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked )\n\t\t&& $current->version_checked === $wp_version\n\t) {\n\t\treturn;\n\t}\n\n\twp_version_check();\n}\n/**\n * Check the last time plugins were run before checking plugin versions.\n *\n * This might have been backported to WordPress 2.6.1 for performance reasons.\n * This is used for the wp-admin to check only so often instead of every page\n * load.\n *\n * @since 2.7.0\n * @access private\n */\nfunction _maybe_update_plugins() {\n\t$current = get_site_transient( 'update_plugins' );\n\n\tif ( isset( $current->last_checked )\n\t\t&& 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked )\n\t) {\n\t\treturn;\n\t}\n\n\twp_update_plugins();\n}\n\n/**\n * Check themes versions only after a duration of time.\n *\n * This is for performance reasons to make sure that on the theme version\n * checker is not run on every page load.\n *\n * @since 2.7.0\n * @access private\n */\nfunction _maybe_update_themes() {\n\t$current = get_site_transient( 'update_themes' );\n\n\tif ( isset( $current->last_checked )\n\t\t&& 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked )\n\t) {\n\t\treturn;\n\t}\n\n\twp_update_themes();\n}\n\n/**\n * Schedule core, theme, and plugin update checks.\n *\n * @since 3.1.0\n */\nfunction wp_schedule_update_checks() {\n\tif ( ! wp_next_scheduled( 'wp_version_check' ) && ! wp_installing() ) {\n\t\twp_schedule_event( time(), 'twicedaily', 'wp_version_check' );\n\t}\n\n\tif ( ! wp_next_scheduled( 'wp_update_plugins' ) && ! wp_installing() ) {\n\t\twp_schedule_event( time(), 'twicedaily', 'wp_update_plugins' );\n\t}\n\n\tif ( ! wp_next_scheduled( 'wp_update_themes' ) && ! wp_installing() ) {\n\t\twp_schedule_event( time(), 'twicedaily', 'wp_update_themes' );\n\t}\n}\n\n/**\n * Clear existing update caches for plugins, themes, and core.\n *\n * @since 4.1.0\n */\nfunction wp_clean_update_cache() {\n\tif ( function_exists( 'wp_clean_plugins_cache' ) ) {\n\t\twp_clean_plugins_cache();\n\t} else {\n\t\tdelete_site_transient( 'update_plugins' );\n\t}\n\n\twp_clean_themes_cache();\n\n\tdelete_site_transient( 'update_core' );\n}\n\nif ( ( ! is_main_site() && ! is_network_admin() ) || wp_doing_ajax() ) {\n\treturn;\n}\n\nadd_action( 'admin_init', '_maybe_update_core' );\nadd_action( 'wp_version_check', 'wp_version_check' );\n\nadd_action( 'load-plugins.php', 'wp_update_plugins' );\nadd_action( 'load-update.php', 'wp_update_plugins' );\nadd_action( 'load-update-core.php', 'wp_update_plugins' );\nadd_action( 'admin_init', '_maybe_update_plugins' );\nadd_action( 'wp_update_plugins', 'wp_update_plugins' );\n\nadd_action( 'load-themes.php', 'wp_update_themes' );\nadd_action( 'load-update.php', 'wp_update_themes' );\nadd_action( 'load-update-core.php', 'wp_update_themes' );\nadd_action( 'admin_init', '_maybe_update_themes' );\nadd_action( 'wp_update_themes', 'wp_update_themes' );\n\nadd_action( 'update_option_WPLANG', 'wp_clean_update_cache', 10, 0 );\n\nadd_action( 'wp_maybe_auto_update', 'wp_maybe_auto_update' );\n\nadd_action( 'init', 'wp_schedule_update_checks' );\n", "num_lines": 897}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Core User API\n *\n * @package WordPress\n * @subpackage Users\n */\n\n/**\n * Authenticates and logs a user in with 'remember' capability.\n *\n * The credentials is an array that has 'user_login', 'user_password', and\n * 'remember' indices. If the credentials is not given, then the log in form\n * will be assumed and used if set.\n *\n * The various authentication cookies will be set by this function and will be\n * set for a longer period depending on if the 'remember' credential is set to\n * true.\n *\n * Note: wp_signon() doesn't handle setting the current user. This means that if the\n * function is called before the {@see 'init'} hook is fired, is_user_logged_in() will\n * evaluate as false until that point. If is_user_logged_in() is needed in conjunction\n * with wp_signon(), wp_set_current_user() should be called explicitly.\n *\n * @since 2.5.0\n *\n * @global string $auth_secure_cookie\n *\n * @param array       $credentials   Optional. User info in order to sign on.\n * @param string|bool $secure_cookie Optional. Whether to use secure cookie.\n * @return WP_User|WP_Error WP_User on success, WP_Error on failure.\n */\nfunction wp_signon( $credentials = array(), $secure_cookie = '' ) {\n\tif ( empty( $credentials ) ) {\n\t\t$credentials = array(); // Back-compat for plugins passing an empty string.\n\n\t\tif ( ! empty( $_POST['log'] ) ) {\n\t\t\t$credentials['user_login'] = wp_unslash( $_POST['log'] );\n\t\t}\n\t\tif ( ! empty( $_POST['pwd'] ) ) {\n\t\t\t$credentials['user_password'] = $_POST['pwd'];\n\t\t}\n\t\tif ( ! empty( $_POST['rememberme'] ) ) {\n\t\t\t$credentials['remember'] = $_POST['rememberme'];\n\t\t}\n\t}\n\n\tif ( ! empty( $credentials['remember'] ) ) {\n\t\t$credentials['remember'] = true;\n\t} else {\n\t\t$credentials['remember'] = false;\n\t}\n\n\t/**\n\t * Fires before the user is authenticated.\n\t *\n\t * The variables passed to the callbacks are passed by reference,\n\t * and can be modified by callback functions.\n\t *\n\t * @since 1.5.1\n\t *\n\t * @todo Decide whether to deprecate the wp_authenticate action.\n\t *\n\t * @param string $user_login    Username (passed by reference).\n\t * @param string $user_password User password (passed by reference).\n\t */\n\tdo_action_ref_array( 'wp_authenticate', array( &$credentials['user_login'], &$credentials['user_password'] ) );\n\n\tif ( '' === $secure_cookie ) {\n\t\t$secure_cookie = is_ssl();\n\t}\n\n\t/**\n\t * Filters whether to use a secure sign-on cookie.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param bool  $secure_cookie Whether to use a secure sign-on cookie.\n\t * @param array $credentials {\n\t *     Array of entered sign-on data.\n\t *\n\t *     @type string $user_login    Username.\n\t *     @type string $user_password Password entered.\n\t *     @type bool   $remember      Whether to 'remember' the user. Increases the time\n\t *                                 that the cookie will be kept. Default false.\n\t * }\n\t */\n\t$secure_cookie = apply_filters( 'secure_signon_cookie', $secure_cookie, $credentials );\n\n\tglobal $auth_secure_cookie; // XXX ugly hack to pass this to wp_authenticate_cookie().\n\t$auth_secure_cookie = $secure_cookie;\n\n\tadd_filter( 'authenticate', 'wp_authenticate_cookie', 30, 3 );\n\n\t$user = wp_authenticate( $credentials['user_login'], $credentials['user_password'] );\n\n\tif ( is_wp_error( $user ) ) {\n\t\treturn $user;\n\t}\n\n\twp_set_auth_cookie( $user->ID, $credentials['remember'], $secure_cookie );\n\t/**\n\t * Fires after the user has successfully logged in.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string  $user_login Username.\n\t * @param WP_User $user       WP_User object of the logged-in user.\n\t */\n\tdo_action( 'wp_login', $user->user_login, $user );\n\treturn $user;\n}\n\n/**\n * Authenticate a user, confirming the username and password are valid.\n *\n * @since 2.8.0\n *\n * @param WP_User|WP_Error|null $user     WP_User or WP_Error object from a previous callback. Default null.\n * @param string                $username Username for authentication.\n * @param string                $password Password for authentication.\n * @return WP_User|WP_Error WP_User on success, WP_Error on failure.\n */\nfunction wp_authenticate_username_password( $user, $username, $password ) {\n\tif ( $user instanceof WP_User ) {\n\t\treturn $user;\n\t}\n\n\tif ( empty( $username ) || empty( $password ) ) {\n\t\tif ( is_wp_error( $user ) ) {\n\t\t\treturn $user;\n\t\t}\n\n\t\t$error = new WP_Error();\n\n\t\tif ( empty( $username ) ) {\n\t\t\t$error->add( 'empty_username', __( '<strong>Error</strong>: The username field is empty.' ) );\n\t\t}\n\n\t\tif ( empty( $password ) ) {\n\t\t\t$error->add( 'empty_password', __( '<strong>Error</strong>: The password field is empty.' ) );\n\t\t}\n\n\t\treturn $error;\n\t}\n\n\t$user = get_user_by( 'login', $username );\n\n\tif ( ! $user ) {\n\t\treturn new WP_Error(\n\t\t\t'invalid_username',\n\t\t\t__( 'Unknown username. Check again or try your email address.' )\n\t\t);\n\t}\n\n\t/**\n\t * Filters whether the given user can be authenticated with the provided $password.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param WP_User|WP_Error $user     WP_User or WP_Error object if a previous\n\t *                                   callback failed authentication.\n\t * @param string           $password Password to check against the user.\n\t */\n\t$user = apply_filters( 'wp_authenticate_user', $user, $password );\n\tif ( is_wp_error( $user ) ) {\n\t\treturn $user;\n\t}\n\n\tif ( ! wp_check_password( $password, $user->user_pass, $user->ID ) ) {\n\t\treturn new WP_Error(\n\t\t\t'incorrect_password',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: User name. */\n\t\t\t\t__( '<strong>Error</strong>: The password you entered for the username %s is incorrect.' ),\n\t\t\t\t'<strong>' . $username . '</strong>'\n\t\t\t) .\n\t\t\t' <a href=\"' . wp_lostpassword_url() . '\">' .\n\t\t\t__( 'Lost your password?' ) .\n\t\t\t'</a>'\n\t\t);\n\t}\n\n\treturn $user;\n}\n\n/**\n * Authenticates a user using the email and password.\n *\n * @since 4.5.0\n *\n * @param WP_User|WP_Error|null $user     WP_User or WP_Error object if a previous\n *                                        callback failed authentication.\n * @param string                $email    Email address for authentication.\n * @param string                $password Password for authentication.\n * @return WP_User|WP_Error WP_User on success, WP_Error on failure.\n */\nfunction wp_authenticate_email_password( $user, $email, $password ) {\n\tif ( $user instanceof WP_User ) {\n\t\treturn $user;\n\t}\n\n\tif ( empty( $email ) || empty( $password ) ) {\n\t\tif ( is_wp_error( $user ) ) {\n\t\t\treturn $user;\n\t\t}\n\n\t\t$error = new WP_Error();\n\n\t\tif ( empty( $email ) ) {\n\t\t\t// Uses 'empty_username' for back-compat with wp_signon().\n\t\t\t$error->add( 'empty_username', __( '<strong>Error</strong>: The email field is empty.' ) );\n\t\t}\n\n\t\tif ( empty( $password ) ) {\n\t\t\t$error->add( 'empty_password', __( '<strong>Error</strong>: The password field is empty.' ) );\n\t\t}\n\n\t\treturn $error;\n\t}\n\n\tif ( ! is_email( $email ) ) {\n\t\treturn $user;\n\t}\n\n\t$user = get_user_by( 'email', $email );\n\n\tif ( ! $user ) {\n\t\treturn new WP_Error(\n\t\t\t'invalid_email',\n\t\t\t__( 'Unknown email address. Check again or try your username.' )\n\t\t);\n\t}\n\n\t/** This filter is documented in wp-includes/user.php */\n\t$user = apply_filters( 'wp_authenticate_user', $user, $password );\n\n\tif ( is_wp_error( $user ) ) {\n\t\treturn $user;\n\t}\n\n\tif ( ! wp_check_password( $password, $user->user_pass, $user->ID ) ) {\n\t\treturn new WP_Error(\n\t\t\t'incorrect_password',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Email address. */\n\t\t\t\t__( '<strong>Error</strong>: The password you entered for the email address %s is incorrect.' ),\n\t\t\t\t'<strong>' . $email . '</strong>'\n\t\t\t) .\n\t\t\t' <a href=\"' . wp_lostpassword_url() . '\">' .\n\t\t\t__( 'Lost your password?' ) .\n\t\t\t'</a>'\n\t\t);\n\t}\n\n\treturn $user;\n}\n\n/**\n * Authenticate the user using the WordPress auth cookie.\n *\n * @since 2.8.0\n *\n * @global string $auth_secure_cookie\n *\n * @param WP_User|WP_Error|null $user     WP_User or WP_Error object from a previous callback. Default null.\n * @param string                $username Username. If not empty, cancels the cookie authentication.\n * @param string                $password Password. If not empty, cancels the cookie authentication.\n * @return WP_User|WP_Error WP_User on success, WP_Error on failure.\n */\nfunction wp_authenticate_cookie( $user, $username, $password ) {\n\tif ( $user instanceof WP_User ) {\n\t\treturn $user;\n\t}\n\n\tif ( empty( $username ) && empty( $password ) ) {\n\t\t$user_id = wp_validate_auth_cookie();\n\t\tif ( $user_id ) {\n\t\t\treturn new WP_User( $user_id );\n\t\t}\n\n\t\tglobal $auth_secure_cookie;\n\n\t\tif ( $auth_secure_cookie ) {\n\t\t\t$auth_cookie = SECURE_AUTH_COOKIE;\n\t\t} else {\n\t\t\t$auth_cookie = AUTH_COOKIE;\n\t\t}\n\n\t\tif ( ! empty( $_COOKIE[ $auth_cookie ] ) ) {\n\t\t\treturn new WP_Error( 'expired_session', __( 'Please log in again.' ) );\n\t\t}\n\n\t\t// If the cookie is not set, be silent.\n\t}\n\n\treturn $user;\n}\n\n/**\n * For Multisite blogs, check if the authenticated user has been marked as a\n * spammer, or if the user's primary blog has been marked as spam.\n *\n * @since 3.7.0\n *\n * @param WP_User|WP_Error|null $user WP_User or WP_Error object from a previous callback. Default null.\n * @return WP_User|WP_Error WP_User on success, WP_Error if the user is considered a spammer.\n */\nfunction wp_authenticate_spam_check( $user ) {\n\tif ( $user instanceof WP_User && is_multisite() ) {\n\t\t/**\n\t\t * Filters whether the user has been marked as a spammer.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param bool    $spammed Whether the user is considered a spammer.\n\t\t * @param WP_User $user    User to check against.\n\t\t */\n\t\t$spammed = apply_filters( 'check_is_user_spammed', is_user_spammy( $user ), $user );\n\n\t\tif ( $spammed ) {\n\t\t\treturn new WP_Error( 'spammer_account', __( '<strong>Error</strong>: Your account has been marked as a spammer.' ) );\n\t\t}\n\t}\n\treturn $user;\n}\n\n/**\n * Validates the logged-in cookie.\n *\n * Checks the logged-in cookie if the previous auth cookie could not be\n * validated and parsed.\n *\n * This is a callback for the {@see 'determine_current_user'} filter, rather than API.\n *\n * @since 3.9.0\n *\n * @param int|bool $user_id The user ID (or false) as received from\n *                          the `determine_current_user` filter.\n * @return int|false User ID if validated, false otherwise. If a user ID from\n *                   an earlier filter callback is received, that value is returned.\n */\nfunction wp_validate_logged_in_cookie( $user_id ) {\n\tif ( $user_id ) {\n\t\treturn $user_id;\n\t}\n\n\tif ( is_blog_admin() || is_network_admin() || empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {\n\t\treturn false;\n\t}\n\n\treturn wp_validate_auth_cookie( $_COOKIE[ LOGGED_IN_COOKIE ], 'logged_in' );\n}\n\n/**\n * Number of posts user has written.\n *\n * @since 3.0.0\n * @since 4.1.0 Added `$post_type` argument.\n * @since 4.3.0 Added `$public_only` argument. Added the ability to pass an array\n *              of post types to `$post_type`.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int          $userid      User ID.\n * @param array|string $post_type   Optional. Single post type or array of post types to count the number of posts for. Default 'post'.\n * @param bool         $public_only Optional. Whether to only return counts for public posts. Default false.\n * @return string Number of posts the user has written in this post type.\n */\nfunction count_user_posts( $userid, $post_type = 'post', $public_only = false ) {\n\tglobal $wpdb;\n\n\t$where = get_posts_by_author_sql( $post_type, true, $userid, $public_only );\n\n\t$count = $wpdb->get_var( \"SELECT COUNT(*) FROM $wpdb->posts $where\" );\n\n\t/**\n\t * Filters the number of posts a user has written.\n\t *\n\t * @since 2.7.0\n\t * @since 4.1.0 Added `$post_type` argument.\n\t * @since 4.3.1 Added `$public_only` argument.\n\t *\n\t * @param int          $count       The user's post count.\n\t * @param int          $userid      User ID.\n\t * @param string|array $post_type   Single post type or array of post types to count the number of posts for.\n\t * @param bool         $public_only Whether to limit counted posts to public posts.\n\t */\n\treturn apply_filters( 'get_usernumposts', $count, $userid, $post_type, $public_only );\n}\n\n/**\n * Number of posts written by a list of users.\n *\n * @since 3.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int[]           $users       Array of user IDs.\n * @param string|string[] $post_type   Optional. Single post type or array of post types to check. Defaults to 'post'.\n * @param bool            $public_only Optional. Only return counts for public posts.  Defaults to false.\n * @return string[] Amount of posts each user has written, as strings, keyed by user ID.\n */\nfunction count_many_users_posts( $users, $post_type = 'post', $public_only = false ) {\n\tglobal $wpdb;\n\n\t$count = array();\n\tif ( empty( $users ) || ! is_array( $users ) ) {\n\t\treturn $count;\n\t}\n\n\t$userlist = implode( ',', array_map( 'absint', $users ) );\n\t$where    = get_posts_by_author_sql( $post_type, true, null, $public_only );\n\n\t$result = $wpdb->get_results( \"SELECT post_author, COUNT(*) FROM $wpdb->posts $where AND post_author IN ($userlist) GROUP BY post_author\", ARRAY_N );\n\tforeach ( $result as $row ) {\n\t\t$count[ $row[0] ] = $row[1];\n\t}\n\n\tforeach ( $users as $id ) {\n\t\tif ( ! isset( $count[ $id ] ) ) {\n\t\t\t$count[ $id ] = 0;\n\t\t}\n\t}\n\n\treturn $count;\n}\n\n//\n// User option functions.\n//\n\n/**\n * Get the current user's ID\n *\n * @since MU (3.0.0)\n *\n * @return int The current user's ID, or 0 if no user is logged in.\n */\nfunction get_current_user_id() {\n\tif ( ! function_exists( 'wp_get_current_user' ) ) {\n\t\treturn 0;\n\t}\n\t$user = wp_get_current_user();\n\treturn ( isset( $user->ID ) ? (int) $user->ID : 0 );\n}\n\n/**\n * Retrieve user option that can be either per Site or per Network.\n *\n * If the user ID is not given, then the current user will be used instead. If\n * the user ID is given, then the user data will be retrieved. The filter for\n * the result, will also pass the original option name and finally the user data\n * object as the third parameter.\n *\n * The option will first check for the per site name and then the per Network name.\n *\n * @since 2.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string $option     User option name.\n * @param int    $user       Optional. User ID.\n * @param string $deprecated Use get_option() to check for an option in the options table.\n * @return mixed User option value on success, false on failure.\n */\nfunction get_user_option( $option, $user = 0, $deprecated = '' ) {\n\tglobal $wpdb;\n\n\tif ( ! empty( $deprecated ) ) {\n\t\t_deprecated_argument( __FUNCTION__, '3.0.0' );\n\t}\n\n\tif ( empty( $user ) ) {\n\t\t$user = get_current_user_id();\n\t}\n\n\t$user = get_userdata( $user );\n\tif ( ! $user ) {\n\t\treturn false;\n\t}\n\n\t$prefix = $wpdb->get_blog_prefix();\n\tif ( $user->has_prop( $prefix . $option ) ) { // Blog-specific.\n\t\t$result = $user->get( $prefix . $option );\n\t} elseif ( $user->has_prop( $option ) ) { // User-specific and cross-blog.\n\t\t$result = $user->get( $option );\n\t} else {\n\t\t$result = false;\n\t}\n\n\t/**\n\t * Filters a specific user option value.\n\t *\n\t * The dynamic portion of the hook name, `$option`, refers to the user option name.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param mixed   $result Value for the user's option.\n\t * @param string  $option Name of the option being retrieved.\n\t * @param WP_User $user   WP_User object of the user whose option is being retrieved.\n\t */\n\treturn apply_filters( \"get_user_option_{$option}\", $result, $option, $user );\n}\n\n/**\n * Update user option with global blog capability.\n *\n * User options are just like user metadata except that they have support for\n * global blog options. If the 'global' parameter is false, which it is by default\n * it will prepend the WordPress table prefix to the option name.\n *\n * Deletes the user option if $newvalue is empty.\n *\n * @since 2.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int    $user_id     User ID.\n * @param string $option_name User option name.\n * @param mixed  $newvalue    User option value.\n * @param bool   $global      Optional. Whether option name is global or blog specific.\n *                            Default false (blog specific).\n * @return int|bool User meta ID if the option didn't exist, true on successful update,\n *                  false on failure.\n */\nfunction update_user_option( $user_id, $option_name, $newvalue, $global = false ) {\n\tglobal $wpdb;\n\n\tif ( ! $global ) {\n\t\t$option_name = $wpdb->get_blog_prefix() . $option_name;\n\t}\n\n\treturn update_user_meta( $user_id, $option_name, $newvalue );\n}\n\n/**\n * Delete user option with global blog capability.\n *\n * User options are just like user metadata except that they have support for\n * global blog options. If the 'global' parameter is false, which it is by default\n * it will prepend the WordPress table prefix to the option name.\n *\n * @since 3.0.0\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int    $user_id     User ID\n * @param string $option_name User option name.\n * @param bool   $global      Optional. Whether option name is global or blog specific.\n *                            Default false (blog specific).\n * @return bool True on success, false on failure.\n */\nfunction delete_user_option( $user_id, $option_name, $global = false ) {\n\tglobal $wpdb;\n\n\tif ( ! $global ) {\n\t\t$option_name = $wpdb->get_blog_prefix() . $option_name;\n\t}\n\treturn delete_user_meta( $user_id, $option_name );\n}\n\n/**\n * Retrieve list of users matching criteria.\n *\n * @since 3.1.0\n *\n * @see WP_User_Query\n *\n * @param array $args Optional. Arguments to retrieve users. See WP_User_Query::prepare_query().\n *                    for more information on accepted arguments.\n * @return array List of users.\n */\nfunction get_users( $args = array() ) {\n\n\t$args                = wp_parse_args( $args );\n\t$args['count_total'] = false;\n\n\t$user_search = new WP_User_Query( $args );\n\n\treturn (array) $user_search->get_results();\n}\n\n/**\n * Get the sites a user belongs to.\n *\n * @since 3.0.0\n * @since 4.7.0 Converted to use `get_sites()`.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int  $user_id User ID\n * @param bool $all     Whether to retrieve all sites, or only sites that are not\n *                      marked as deleted, archived, or spam.\n * @return array A list of the user's sites. An empty array if the user doesn't exist\n *               or belongs to no sites.\n */\nfunction get_blogs_of_user( $user_id, $all = false ) {\n\tglobal $wpdb;\n\n\t$user_id = (int) $user_id;\n\n\t// Logged out users can't have sites.\n\tif ( empty( $user_id ) ) {\n\t\treturn array();\n\t}\n\n\t/**\n\t * Filters the list of a user's sites before it is populated.\n\t *\n\t * Returning a non-null value from the filter will effectively short circuit\n\t * get_blogs_of_user(), returning that value instead.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param null|array $sites   An array of site objects of which the user is a member.\n\t * @param int        $user_id User ID.\n\t * @param bool       $all     Whether the returned array should contain all sites, including\n\t *                            those marked 'deleted', 'archived', or 'spam'. Default false.\n\t */\n\t$sites = apply_filters( 'pre_get_blogs_of_user', null, $user_id, $all );\n\n\tif ( null !== $sites ) {\n\t\treturn $sites;\n\t}\n\n\t$keys = get_user_meta( $user_id );\n\tif ( empty( $keys ) ) {\n\t\treturn array();\n\t}\n\n\tif ( ! is_multisite() ) {\n\t\t$site_id                        = get_current_blog_id();\n\t\t$sites                          = array( $site_id => new stdClass );\n\t\t$sites[ $site_id ]->userblog_id = $site_id;\n\t\t$sites[ $site_id ]->blogname    = get_option( 'blogname' );\n\t\t$sites[ $site_id ]->domain      = '';\n\t\t$sites[ $site_id ]->path        = '';\n\t\t$sites[ $site_id ]->site_id     = 1;\n\t\t$sites[ $site_id ]->siteurl     = get_option( 'siteurl' );\n\t\t$sites[ $site_id ]->archived    = 0;\n\t\t$sites[ $site_id ]->spam        = 0;\n\t\t$sites[ $site_id ]->deleted     = 0;\n\t\treturn $sites;\n\t}\n\n\t$site_ids = array();\n\n\tif ( isset( $keys[ $wpdb->base_prefix . 'capabilities' ] ) && defined( 'MULTISITE' ) ) {\n\t\t$site_ids[] = 1;\n\t\tunset( $keys[ $wpdb->base_prefix . 'capabilities' ] );\n\t}\n\n\t$keys = array_keys( $keys );\n\n\tforeach ( $keys as $key ) {\n\t\tif ( 'capabilities' !== substr( $key, -12 ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( $wpdb->base_prefix && 0 !== strpos( $key, $wpdb->base_prefix ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\t$site_id = str_replace( array( $wpdb->base_prefix, '_capabilities' ), '', $key );\n\t\tif ( ! is_numeric( $site_id ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$site_ids[] = (int) $site_id;\n\t}\n\n\t$sites = array();\n\n\tif ( ! empty( $site_ids ) ) {\n\t\t$args = array(\n\t\t\t'number'                 => '',\n\t\t\t'site__in'               => $site_ids,\n\t\t\t'update_site_meta_cache' => false,\n\t\t);\n\t\tif ( ! $all ) {\n\t\t\t$args['archived'] = 0;\n\t\t\t$args['spam']     = 0;\n\t\t\t$args['deleted']  = 0;\n\t\t}\n\n\t\t$_sites = get_sites( $args );\n\n\t\tforeach ( $_sites as $site ) {\n\t\t\t$sites[ $site->id ] = (object) array(\n\t\t\t\t'userblog_id' => $site->id,\n\t\t\t\t'blogname'    => $site->blogname,\n\t\t\t\t'domain'      => $site->domain,\n\t\t\t\t'path'        => $site->path,\n\t\t\t\t'site_id'     => $site->network_id,\n\t\t\t\t'siteurl'     => $site->siteurl,\n\t\t\t\t'archived'    => $site->archived,\n\t\t\t\t'mature'      => $site->mature,\n\t\t\t\t'spam'        => $site->spam,\n\t\t\t\t'deleted'     => $site->deleted,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Filters the list of sites a user belongs to.\n\t *\n\t * @since MU (3.0.0)\n\t *\n\t * @param array $sites   An array of site objects belonging to the user.\n\t * @param int   $user_id User ID.\n\t * @param bool  $all     Whether the returned sites array should contain all sites, including\n\t *                       those marked 'deleted', 'archived', or 'spam'. Default false.\n\t */\n\treturn apply_filters( 'get_blogs_of_user', $sites, $user_id, $all );\n}\n\n/**\n * Find out whether a user is a member of a given blog.\n *\n * @since MU (3.0.0)\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param int $user_id Optional. The unique ID of the user. Defaults to the current user.\n * @param int $blog_id Optional. ID of the blog to check. Defaults to the current site.\n * @return bool\n */\nfunction is_user_member_of_blog( $user_id = 0, $blog_id = 0 ) {\n\tglobal $wpdb;\n\n\t$user_id = (int) $user_id;\n\t$blog_id = (int) $blog_id;\n\n\tif ( empty( $user_id ) ) {\n\t\t$user_id = get_current_user_id();\n\t}\n\n\t// Technically not needed, but does save calls to get_site() and get_user_meta()\n\t// in the event that the function is called when a user isn't logged in.\n\tif ( empty( $user_id ) ) {\n\t\treturn false;\n\t} else {\n\t\t$user = get_userdata( $user_id );\n\t\tif ( ! $user instanceof WP_User ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif ( ! is_multisite() ) {\n\t\treturn true;\n\t}\n\n\tif ( empty( $blog_id ) ) {\n\t\t$blog_id = get_current_blog_id();\n\t}\n\n\t$blog = get_site( $blog_id );\n\n\tif ( ! $blog || ! isset( $blog->domain ) || $blog->archived || $blog->spam || $blog->deleted ) {\n\t\treturn false;\n\t}\n\n\t$keys = get_user_meta( $user_id );\n\tif ( empty( $keys ) ) {\n\t\treturn false;\n\t}\n\n\t// No underscore before capabilities in $base_capabilities_key.\n\t$base_capabilities_key = $wpdb->base_prefix . 'capabilities';\n\t$site_capabilities_key = $wpdb->base_prefix . $blog_id . '_capabilities';\n\n\tif ( isset( $keys[ $base_capabilities_key ] ) && 1 == $blog_id ) {\n\t\treturn true;\n\t}\n\n\tif ( isset( $keys[ $site_capabilities_key ] ) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Adds meta data to a user.\n *\n * @since 3.0.0\n *\n * @param int    $user_id    User ID.\n * @param string $meta_key   Metadata name.\n * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.\n * @param bool   $unique     Optional. Whether the same key should not be added.\n *                           Default false.\n * @return int|false Meta ID on success, false on failure.\n */\nfunction add_user_meta( $user_id, $meta_key, $meta_value, $unique = false ) {\n\treturn add_metadata( 'user', $user_id, $meta_key, $meta_value, $unique );\n}\n\n/**\n * Remove metadata matching criteria from a user.\n *\n * You can match based on the key, or key and value. Removing based on key and\n * value, will keep from removing duplicate metadata with the same key. It also\n * allows removing all metadata matching key, if needed.\n *\n * @since 3.0.0\n *\n * @link https://developer.wordpress.org/reference/functions/delete_user_meta/\n *\n * @param int    $user_id    User ID\n * @param string $meta_key   Metadata name.\n * @param mixed  $meta_value Optional. Metadata value. If provided,\n *                           rows will only be removed that match the value.\n *                           Must be serializable if non-scalar. Default empty.\n * @return bool True on success, false on failure.\n */\nfunction delete_user_meta( $user_id, $meta_key, $meta_value = '' ) {\n\treturn delete_metadata( 'user', $user_id, $meta_key, $meta_value );\n}\n\n/**\n * Retrieve user meta field for a user.\n *\n * @since 3.0.0\n *\n * @link https://developer.wordpress.org/reference/functions/get_user_meta/\n *\n * @param int    $user_id User ID.\n * @param string $key     Optional. The meta key to retrieve. By default,\n *                        returns data for all keys.\n * @param bool   $single  Optional. Whether to return a single value.\n *                        This parameter has no effect if $key is not specified.\n *                        Default false.\n * @return mixed An array if $single is false. The value of meta data field\n *               if $single is true. False for an invalid $user_id.\n */\nfunction get_user_meta( $user_id, $key = '', $single = false ) {\n\treturn get_metadata( 'user', $user_id, $key, $single );\n}\n\n/**\n * Update user meta field based on user ID.\n *\n * Use the $prev_value parameter to differentiate between meta fields with the\n * same key and user ID.\n *\n * If the meta field for the user does not exist, it will be added.\n *\n * @since 3.0.0\n *\n * @link https://developer.wordpress.org/reference/functions/update_user_meta/\n *\n * @param int    $user_id    User ID.\n * @param string $meta_key   Metadata key.\n * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.\n * @param mixed  $prev_value Optional. Previous value to check before updating.\n *                           If specified, only update existing metadata entries with\n *                           this value. Otherwise, update all entries. Default empty.\n * @return int|bool Meta ID if the key didn't exist, true on successful update,\n *                  false on failure or if the value passed to the function\n *                  is the same as the one that is already in the database.\n */\nfunction update_user_meta( $user_id, $meta_key, $meta_value, $prev_value = '' ) {\n\treturn update_metadata( 'user', $user_id, $meta_key, $meta_value, $prev_value );\n}\n\n/**\n * Count number of users who have each of the user roles.\n *\n * Assumes there are neither duplicated nor orphaned capabilities meta_values.\n * Assumes role names are unique phrases. Same assumption made by WP_User_Query::prepare_query()\n * Using $strategy = 'time' this is CPU-intensive and should handle around 10^7 users.\n * Using $strategy = 'memory' this is memory-intensive and should handle around 10^5 users, but see WP Bug #12257.\n *\n * @since 3.0.0\n * @since 4.4.0 The number of users with no role is now included in the `none` element.\n * @since 4.9.0 The `$site_id` parameter was added to support multisite.\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param string   $strategy Optional. The computational strategy to use when counting the users.\n *                           Accepts either 'time' or 'memory'. Default 'time'.\n * @param int|null $site_id  Optional. The site ID to count users for. Defaults to the current site.\n * @return array {\n *     User counts.\n *\n *     @type int   $total_users Total number of users on the site.\n *     @type int[] $avail_roles Array of user counts keyed by user role.\n * }\n */\nfunction count_users( $strategy = 'time', $site_id = null ) {\n\tglobal $wpdb;\n\n\t// Initialize.\n\tif ( ! $site_id ) {\n\t\t$site_id = get_current_blog_id();\n\t}\n\n\t/**\n\t * Filter the user count before queries are run. Return a non-null value to cause count_users()\n\t * to return early.\n\t *\n\t * @since 5.1.0\n\t *\n\t * @param null|string $result   The value to return instead. Default null to continue with the query.\n\t * @param string      $strategy Optional. The computational strategy to use when counting the users.\n\t *                              Accepts either 'time' or 'memory'. Default 'time'.\n\t * @param int|null    $site_id  Optional. The site ID to count users for. Defaults to the current site.\n\t */\n\t$pre = apply_filters( 'pre_count_users', null, $strategy, $site_id );\n\n\tif ( null !== $pre ) {\n\t\treturn $pre;\n\t}\n\n\t$blog_prefix = $wpdb->get_blog_prefix( $site_id );\n\t$result      = array();\n\n\tif ( 'time' === $strategy ) {\n\t\tif ( is_multisite() && get_current_blog_id() != $site_id ) {\n\t\t\tswitch_to_blog( $site_id );\n\t\t\t$avail_roles = wp_roles()->get_names();\n\t\t\trestore_current_blog();\n\t\t} else {\n\t\t\t$avail_roles = wp_roles()->get_names();\n\t\t}\n\n\t\t// Build a CPU-intensive query that will return concise information.\n\t\t$select_count = array();\n\t\tforeach ( $avail_roles as $this_role => $name ) {\n\t\t\t$select_count[] = $wpdb->prepare( 'COUNT(NULLIF(`meta_value` LIKE %s, false))', '%' . $wpdb->esc_like( '\"' . $this_role . '\"' ) . '%' );\n\t\t}\n\t\t$select_count[] = \"COUNT(NULLIF(`meta_value` = 'a:0:{}', false))\";\n\t\t$select_count   = implode( ', ', $select_count );\n\n\t\t// Add the meta_value index to the selection list, then run the query.\n\t\t$row = $wpdb->get_row(\n\t\t\t\"\n\t\t\tSELECT {$select_count}, COUNT(*)\n\t\t\tFROM {$wpdb->usermeta}\n\t\t\tINNER JOIN {$wpdb->users} ON user_id = ID\n\t\t\tWHERE meta_key = '{$blog_prefix}capabilities'\n\t\t\",\n\t\t\tARRAY_N\n\t\t);\n\n\t\t// Run the previous loop again to associate results with role names.\n\t\t$col         = 0;\n\t\t$role_counts = array();\n\t\tforeach ( $avail_roles as $this_role => $name ) {\n\t\t\t$count = (int) $row[ $col++ ];\n\t\t\tif ( $count > 0 ) {\n\t\t\t\t$role_counts[ $this_role ] = $count;\n\t\t\t}\n\t\t}\n\n\t\t$role_counts['none'] = (int) $row[ $col++ ];\n\n\t\t// Get the meta_value index from the end of the result set.\n\t\t$total_users = (int) $row[ $col ];\n\n\t\t$result['total_users'] = $total_users;\n\t\t$result['avail_roles'] =& $role_counts;\n\t} else {\n\t\t$avail_roles = array(\n\t\t\t'none' => 0,\n\t\t);\n\n\t\t$users_of_blog = $wpdb->get_col(\n\t\t\t\"\n\t\t\tSELECT meta_value\n\t\t\tFROM {$wpdb->usermeta}\n\t\t\tINNER JOIN {$wpdb->users} ON user_id = ID\n\t\t\tWHERE meta_key = '{$blog_prefix}capabilities'\n\t\t\"\n\t\t);\n\n\t\tforeach ( $users_of_blog as $caps_meta ) {\n\t\t\t$b_roles = maybe_unserialize( $caps_meta );\n\t\t\tif ( ! is_array( $b_roles ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( empty( $b_roles ) ) {\n\t\t\t\t$avail_roles['none']++;\n\t\t\t}\n\t\t\tforeach ( $b_roles as $b_role => $val ) {\n\t\t\t\tif ( isset( $avail_roles[ $b_role ] ) ) {\n\t\t\t\t\t$avail_roles[ $b_role ]++;\n\t\t\t\t} else {\n\t\t\t\t\t$avail_roles[ $b_role ] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$result['total_users'] = count( $users_of_blog );\n\t\t$result['avail_roles'] =& $avail_roles;\n\t}\n\n\treturn $result;\n}\n\n//\n// Private helper functions.\n//\n\n/**\n * Set up global user vars.\n *\n * Used by wp_set_current_user() for back compat. Might be deprecated in the future.\n *\n * @since 2.0.4\n *\n * @global string  $user_login    The user username for logging in\n * @global WP_User $userdata      User data.\n * @global int     $user_level    The level of the user\n * @global int     $user_ID       The ID of the user\n * @global string  $user_email    The email address of the user\n * @global string  $user_url      The url in the user's profile\n * @global string  $user_identity The display name of the user\n *\n * @param int $for_user_id Optional. User ID to set up global data. Default 0.\n */\nfunction setup_userdata( $for_user_id = 0 ) {\n\tglobal $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_identity;\n\n\tif ( ! $for_user_id ) {\n\t\t$for_user_id = get_current_user_id();\n\t}\n\t$user = get_userdata( $for_user_id );\n\n\tif ( ! $user ) {\n\t\t$user_ID       = 0;\n\t\t$user_level    = 0;\n\t\t$userdata      = null;\n\t\t$user_login    = '';\n\t\t$user_email    = '';\n\t\t$user_url      = '';\n\t\t$user_identity = '';\n\t\treturn;\n\t}\n\n\t$user_ID       = (int) $user->ID;\n\t$user_level    = (int) $user->user_level;\n\t$userdata      = $user;\n\t$user_login    = $user->user_login;\n\t$user_email    = $user->user_email;\n\t$user_url      = $user->user_url;\n\t$user_identity = $user->display_name;\n}\n\n/**\n * Create dropdown HTML content of users.\n *\n * The content can either be displayed, which it is by default or retrieved by\n * setting the 'echo' argument. The 'include' and 'exclude' arguments do not\n * need to be used; all users will be displayed in that case. Only one can be\n * used, either 'include' or 'exclude', but not both.\n *\n * The available arguments are as follows:\n *\n * @since 2.3.0\n * @since 4.5.0 Added the 'display_name_with_login' value for 'show'.\n * @since 4.7.0 Added the `$role`, `$role__in`, and `$role__not_in` parameters.\n *\n * @param array|string $args {\n *     Optional. Array or string of arguments to generate a drop-down of users.\n *     See WP_User_Query::prepare_query() for additional available arguments.\n *\n *     @type string       $show_option_all         Text to show as the drop-down default (all).\n *                                                 Default empty.\n *     @type string       $show_option_none        Text to show as the drop-down default when no\n *                                                 users were found. Default empty.\n *     @type int|string   $option_none_value       Value to use for $show_option_non when no users\n *                                                 were found. Default -1.\n *     @type string       $hide_if_only_one_author Whether to skip generating the drop-down\n *                                                 if only one user was found. Default empty.\n *     @type string       $orderby                 Field to order found users by. Accepts user fields.\n *                                                 Default 'display_name'.\n *     @type string       $order                   Whether to order users in ascending or descending\n *                                                 order. Accepts 'ASC' (ascending) or 'DESC' (descending).\n *                                                 Default 'ASC'.\n *     @type array|string $include                 Array or comma-separated list of user IDs to include.\n *                                                 Default empty.\n *     @type array|string $exclude                 Array or comma-separated list of user IDs to exclude.\n *                                                 Default empty.\n *     @type bool|int     $multi                   Whether to skip the ID attribute on the 'select' element.\n *                                                 Accepts 1|true or 0|false. Default 0|false.\n *     @type string       $show                    User data to display. If the selected item is empty\n *                                                 then the 'user_login' will be displayed in parentheses.\n *                                                 Accepts any user field, or 'display_name_with_login' to show\n *                                                 the display name with user_login in parentheses.\n *                                                 Default 'display_name'.\n *     @type int|bool     $echo                    Whether to echo or return the drop-down. Accepts 1|true (echo)\n *                                                 or 0|false (return). Default 1|true.\n *     @type int          $selected                Which user ID should be selected. Default 0.\n *     @type bool         $include_selected        Whether to always include the selected user ID in the drop-\n *                                                 down. Default false.\n *     @type string       $name                    Name attribute of select element. Default 'user'.\n *     @type string       $id                      ID attribute of the select element. Default is the value of $name.\n *     @type string       $class                   Class attribute of the select element. Default empty.\n *     @type int          $blog_id                 ID of blog (Multisite only). Default is ID of the current blog.\n *     @type string       $who                     Which type of users to query. Accepts only an empty string or\n *                                                 'authors'. Default empty.\n *     @type string|array $role                    An array or a comma-separated list of role names that users must\n *                                                 match to be included in results. Note that this is an inclusive\n *                                                 list: users must match *each* role. Default empty.\n *     @type array        $role__in                An array of role names. Matched users must have at least one of\n *                                                 these roles. Default empty array.\n *     @type array        $role__not_in            An array of role names to exclude. Users matching one or more of\n *                                                 these roles will not be included in results. Default empty array.\n * }\n * @return string HTML dropdown list of users.\n */\nfunction wp_dropdown_users( $args = '' ) {\n\t$defaults = array(\n\t\t'show_option_all'         => '',\n\t\t'show_option_none'        => '',\n\t\t'hide_if_only_one_author' => '',\n\t\t'orderby'                 => 'display_name',\n\t\t'order'                   => 'ASC',\n\t\t'include'                 => '',\n\t\t'exclude'                 => '',\n\t\t'multi'                   => 0,\n\t\t'show'                    => 'display_name',\n\t\t'echo'                    => 1,\n\t\t'selected'                => 0,\n\t\t'name'                    => 'user',\n\t\t'class'                   => '',\n\t\t'id'                      => '',\n\t\t'blog_id'                 => get_current_blog_id(),\n\t\t'who'                     => '',\n\t\t'include_selected'        => false,\n\t\t'option_none_value'       => -1,\n\t\t'role'                    => '',\n\t\t'role__in'                => array(),\n\t\t'role__not_in'            => array(),\n\t);\n\n\t$defaults['selected'] = is_author() ? get_query_var( 'author' ) : 0;\n\n\t$parsed_args = wp_parse_args( $args, $defaults );\n\n\t$query_args = wp_array_slice_assoc( $parsed_args, array( 'blog_id', 'include', 'exclude', 'orderby', 'order', 'who', 'role', 'role__in', 'role__not_in' ) );\n\n\t$fields = array( 'ID', 'user_login' );\n\n\t$show = ! empty( $parsed_args['show'] ) ? $parsed_args['show'] : 'display_name';\n\tif ( 'display_name_with_login' === $show ) {\n\t\t$fields[] = 'display_name';\n\t} else {\n\t\t$fields[] = $show;\n\t}\n\n\t$query_args['fields'] = $fields;\n\n\t$show_option_all   = $parsed_args['show_option_all'];\n\t$show_option_none  = $parsed_args['show_option_none'];\n\t$option_none_value = $parsed_args['option_none_value'];\n\n\t/**\n\t * Filters the query arguments for the list of users in the dropdown.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $query_args  The query arguments for get_users().\n\t * @param array $parsed_args The arguments passed to wp_dropdown_users() combined with the defaults.\n\t */\n\t$query_args = apply_filters( 'wp_dropdown_users_args', $query_args, $parsed_args );\n\n\t$users = get_users( $query_args );\n\n\t$output = '';\n\tif ( ! empty( $users ) && ( empty( $parsed_args['hide_if_only_one_author'] ) || count( $users ) > 1 ) ) {\n\t\t$name = esc_attr( $parsed_args['name'] );\n\t\tif ( $parsed_args['multi'] && ! $parsed_args['id'] ) {\n\t\t\t$id = '';\n\t\t} else {\n\t\t\t$id = $parsed_args['id'] ? \" id='\" . esc_attr( $parsed_args['id'] ) . \"'\" : \" id='$name'\";\n\t\t}\n\t\t$output = \"<select name='{$name}'{$id} class='\" . $parsed_args['class'] . \"'>\\n\";\n\n\t\tif ( $show_option_all ) {\n\t\t\t$output .= \"\\t<option value='0'>$show_option_all</option>\\n\";\n\t\t}\n\n\t\tif ( $show_option_none ) {\n\t\t\t$_selected = selected( $option_none_value, $parsed_args['selected'], false );\n\t\t\t$output   .= \"\\t<option value='\" . esc_attr( $option_none_value ) . \"'$_selected>$show_option_none</option>\\n\";\n\t\t}\n\n\t\tif ( $parsed_args['include_selected'] && ( $parsed_args['selected'] > 0 ) ) {\n\t\t\t$found_selected          = false;\n\t\t\t$parsed_args['selected'] = (int) $parsed_args['selected'];\n\t\t\tforeach ( (array) $users as $user ) {\n\t\t\t\t$user->ID = (int) $user->ID;\n\t\t\t\tif ( $user->ID === $parsed_args['selected'] ) {\n\t\t\t\t\t$found_selected = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! $found_selected ) {\n\t\t\t\t$users[] = get_userdata( $parsed_args['selected'] );\n\t\t\t}\n\t\t}\n\n\t\tforeach ( (array) $users as $user ) {\n\t\t\tif ( 'display_name_with_login' === $show ) {\n\t\t\t\t/* translators: 1: User's display name, 2: User login. */\n\t\t\t\t$display = sprintf( _x( '%1$s (%2$s)', 'user dropdown' ), $user->display_name, $user->user_login );\n\t\t\t} elseif ( ! empty( $user->$show ) ) {\n\t\t\t\t$display = $user->$show;\n\t\t\t} else {\n\t\t\t\t$display = '(' . $user->user_login . ')';\n\t\t\t}\n\n\t\t\t$_selected = selected( $user->ID, $parsed_args['selected'], false );\n\t\t\t$output   .= \"\\t<option value='$user->ID'$_selected>\" . esc_html( $display ) . \"</option>\\n\";\n\t\t}\n\n\t\t$output .= '</select>';\n\t}\n\n\t/**\n\t * Filters the wp_dropdown_users() HTML output.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string $output HTML output generated by wp_dropdown_users().\n\t */\n\t$html = apply_filters( 'wp_dropdown_users', $output );\n\n\tif ( $parsed_args['echo'] ) {\n\t\techo $html;\n\t}\n\treturn $html;\n}\n\n/**\n * Sanitize user field based on context.\n *\n * Possible context values are:  'raw', 'edit', 'db', 'display', 'attribute' and 'js'. The\n * 'display' context is used by default. 'attribute' and 'js' contexts are treated like 'display'\n * when calling filters.\n *\n * @since 2.3.0\n *\n * @param string $field   The user Object field name.\n * @param mixed  $value   The user Object value.\n * @param int    $user_id User ID.\n * @param string $context How to sanitize user fields. Looks for 'raw', 'edit', 'db', 'display',\n *                        'attribute' and 'js'.\n * @return mixed Sanitized value.\n */\nfunction sanitize_user_field( $field, $value, $user_id, $context ) {\n\t$int_fields = array( 'ID' );\n\tif ( in_array( $field, $int_fields, true ) ) {\n\t\t$value = (int) $value;\n\t}\n\n\tif ( 'raw' === $context ) {\n\t\treturn $value;\n\t}\n\n\tif ( ! is_string( $value ) && ! is_numeric( $value ) ) {\n\t\treturn $value;\n\t}\n\n\t$prefixed = false !== strpos( $field, 'user_' );\n\n\tif ( 'edit' === $context ) {\n\t\tif ( $prefixed ) {\n\n\t\t\t/** This filter is documented in wp-includes/post.php */\n\t\t\t$value = apply_filters( \"edit_{$field}\", $value, $user_id );\n\t\t} else {\n\n\t\t\t/**\n\t\t\t * Filters a user field value in the 'edit' context.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$field`, refers to the prefixed user\n\t\t\t * field being filtered, such as 'user_login', 'user_email', 'first_name', etc.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t *\n\t\t\t * @param mixed $value   Value of the prefixed user field.\n\t\t\t * @param int   $user_id User ID.\n\t\t\t */\n\t\t\t$value = apply_filters( \"edit_user_{$field}\", $value, $user_id );\n\t\t}\n\n\t\tif ( 'description' === $field ) {\n\t\t\t$value = esc_html( $value ); // textarea_escaped?\n\t\t} else {\n\t\t\t$value = esc_attr( $value );\n\t\t}\n\t} elseif ( 'db' === $context ) {\n\t\tif ( $prefixed ) {\n\t\t\t/** This filter is documented in wp-includes/post.php */\n\t\t\t$value = apply_filters( \"pre_{$field}\", $value );\n\t\t} else {\n\n\t\t\t/**\n\t\t\t * Filters the value of a user field in the 'db' context.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$field`, refers to the prefixed user\n\t\t\t * field being filtered, such as 'user_login', 'user_email', 'first_name', etc.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t *\n\t\t\t * @param mixed $value Value of the prefixed user field.\n\t\t\t */\n\t\t\t$value = apply_filters( \"pre_user_{$field}\", $value );\n\t\t}\n\t} else {\n\t\t// Use display filters by default.\n\t\tif ( $prefixed ) {\n\n\t\t\t/** This filter is documented in wp-includes/post.php */\n\t\t\t$value = apply_filters( \"{$field}\", $value, $user_id, $context );\n\t\t} else {\n\n\t\t\t/**\n\t\t\t * Filters the value of a user field in a standard context.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$field`, refers to the prefixed user\n\t\t\t * field being filtered, such as 'user_login', 'user_email', 'first_name', etc.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t *\n\t\t\t * @param mixed  $value   The user object value to sanitize.\n\t\t\t * @param int    $user_id User ID.\n\t\t\t * @param string $context The context to filter within.\n\t\t\t */\n\t\t\t$value = apply_filters( \"user_{$field}\", $value, $user_id, $context );\n\t\t}\n\t}\n\n\tif ( 'user_url' === $field ) {\n\t\t$value = esc_url( $value );\n\t}\n\n\tif ( 'attribute' === $context ) {\n\t\t$value = esc_attr( $value );\n\t} elseif ( 'js' === $context ) {\n\t\t$value = esc_js( $value );\n\t}\n\treturn $value;\n}\n\n/**\n * Update all user caches\n *\n * @since 3.0.0\n *\n * @param WP_User $user User object to be cached\n * @return bool|null Returns false on failure.\n */\nfunction update_user_caches( $user ) {\n\tif ( $user instanceof WP_User ) {\n\t\tif ( ! $user->exists() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$user = $user->data;\n\t}\n\n\twp_cache_add( $user->ID, $user, 'users' );\n\twp_cache_add( $user->user_login, $user->ID, 'userlogins' );\n\twp_cache_add( $user->user_email, $user->ID, 'useremail' );\n\twp_cache_add( $user->user_nicename, $user->ID, 'userslugs' );\n}\n\n/**\n * Clean all user caches\n *\n * @since 3.0.0\n * @since 4.4.0 'clean_user_cache' action was added.\n *\n * @param WP_User|int $user User object or ID to be cleaned from the cache\n */\nfunction clean_user_cache( $user ) {\n\tif ( is_numeric( $user ) ) {\n\t\t$user = new WP_User( $user );\n\t}\n\n\tif ( ! $user->exists() ) {\n\t\treturn;\n\t}\n\n\twp_cache_delete( $user->ID, 'users' );\n\twp_cache_delete( $user->user_login, 'userlogins' );\n\twp_cache_delete( $user->user_email, 'useremail' );\n\twp_cache_delete( $user->user_nicename, 'userslugs' );\n\n\t/**\n\t * Fires immediately after the given user's cache is cleaned.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param int     $user_id User ID.\n\t * @param WP_User $user    User object.\n\t */\n\tdo_action( 'clean_user_cache', $user->ID, $user );\n}\n\n/**\n * Determines whether the given username exists.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.0.0\n *\n * @param string $username Username.\n * @return int|false The user's ID on success, and false on failure.\n */\nfunction username_exists( $username ) {\n\t$user = get_user_by( 'login', $username );\n\tif ( $user ) {\n\t\t$user_id = $user->ID;\n\t} else {\n\t\t$user_id = false;\n\t}\n\n\t/**\n\t * Filters whether the given username exists or not.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param int|false $user_id  The user's ID on success, and false on failure.\n\t * @param string    $username Username to check.\n\t */\n\treturn apply_filters( 'username_exists', $user_id, $username );\n}\n\n/**\n * Determines whether the given email exists.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.1.0\n *\n * @param string $email Email.\n * @return int|false The user's ID on success, and false on failure.\n */\nfunction email_exists( $email ) {\n\t$user = get_user_by( 'email', $email );\n\tif ( $user ) {\n\t\treturn $user->ID;\n\t}\n\treturn false;\n}\n\n/**\n * Checks whether a username is valid.\n *\n * @since 2.0.1\n * @since 4.4.0 Empty sanitized usernames are now considered invalid\n *\n * @param string $username Username.\n * @return bool Whether username given is valid\n */\nfunction validate_username( $username ) {\n\t$sanitized = sanitize_user( $username, true );\n\t$valid     = ( $sanitized == $username && ! empty( $sanitized ) );\n\n\t/**\n\t * Filters whether the provided username is valid or not.\n\t *\n\t * @since 2.0.1\n\t *\n\t * @param bool   $valid    Whether given username is valid.\n\t * @param string $username Username to check.\n\t */\n\treturn apply_filters( 'validate_username', $valid, $username );\n}\n\n/**\n * Insert a user into the database.\n *\n * Most of the `$userdata` array fields have filters associated with the values. Exceptions are\n * 'ID', 'rich_editing', 'syntax_highlighting', 'comment_shortcuts', 'admin_color', 'use_ssl',\n * 'user_registered', 'user_activation_key', 'spam', and 'role'. The filters have the prefix\n * 'pre_user_' followed by the field name. An example using 'description' would have the filter\n * called 'pre_user_description' that can be hooked into.\n *\n * @since 2.0.0\n * @since 3.6.0 The `aim`, `jabber`, and `yim` fields were removed as default user contact\n *              methods for new installations. See wp_get_user_contact_methods().\n * @since 4.7.0 The user's locale can be passed to `$userdata`.\n * @since 5.3.0 The `user_activation_key` field can be passed to `$userdata`.\n * @since 5.3.0 The `spam` field can be passed to `$userdata` (Multisite only).\n *\n * @global wpdb $wpdb WordPress database abstraction object.\n *\n * @param array|object|WP_User $userdata {\n *     An array, object, or WP_User object of user data arguments.\n *\n *     @type int    $ID                   User ID. If supplied, the user will be updated.\n *     @type string $user_pass            The plain-text user password.\n *     @type string $user_login           The user's login username.\n *     @type string $user_nicename        The URL-friendly user name.\n *     @type string $user_url             The user URL.\n *     @type string $user_email           The user email address.\n *     @type string $display_name         The user's display name.\n *                                        Default is the user's username.\n *     @type string $nickname             The user's nickname.\n *                                        Default is the user's username.\n *     @type string $first_name           The user's first name. For new users, will be used\n *                                        to build the first part of the user's display name\n *                                        if `$display_name` is not specified.\n *     @type string $last_name            The user's last name. For new users, will be used\n *                                        to build the second part of the user's display name\n *                                        if `$display_name` is not specified.\n *     @type string $description          The user's biographical description.\n *     @type string $rich_editing         Whether to enable the rich-editor for the user.\n *                                        Accepts 'true' or 'false' as a string literal,\n *                                        not boolean. Default 'true'.\n *     @type string $syntax_highlighting  Whether to enable the rich code editor for the user.\n *                                        Accepts 'true' or 'false' as a string literal,\n *                                        not boolean. Default 'true'.\n *     @type string $comment_shortcuts    Whether to enable comment moderation keyboard\n *                                        shortcuts for the user. Accepts 'true' or 'false'\n *                                        as a string literal, not boolean. Default 'false'.\n *     @type string $admin_color          Admin color scheme for the user. Default 'fresh'.\n *     @type bool   $use_ssl              Whether the user should always access the admin over\n *                                        https. Default false.\n *     @type string $user_registered      Date the user registered. Format is 'Y-m-d H:i:s'.\n *     @type string $user_activation_key  Password reset key. Default empty.\n *     @type bool   $spam                 Multisite only. Whether the user is marked as spam.\n *                                        Default false.\n *     @type string $show_admin_bar_front Whether to display the Admin Bar for the user\n *                                        on the site's front end. Accepts 'true' or 'false'\n *                                        as a string literal, not boolean. Default 'true'.\n *     @type string $role                 User's role.\n *     @type string $locale               User's locale. Default empty.\n * }\n * @return int|WP_Error The newly created user's ID or a WP_Error object if the user could not\n *                      be created.\n */\nfunction wp_insert_user( $userdata ) {\n\tglobal $wpdb;\n\n\tif ( $userdata instanceof stdClass ) {\n\t\t$userdata = get_object_vars( $userdata );\n\t} elseif ( $userdata instanceof WP_User ) {\n\t\t$userdata = $userdata->to_array();\n\t}\n\n\t// Are we updating or creating?\n\tif ( ! empty( $userdata['ID'] ) ) {\n\t\t$ID            = (int) $userdata['ID'];\n\t\t$update        = true;\n\t\t$old_user_data = get_userdata( $ID );\n\n\t\tif ( ! $old_user_data ) {\n\t\t\treturn new WP_Error( 'invalid_user_id', __( 'Invalid user ID.' ) );\n\t\t}\n\n\t\t// Hashed in wp_update_user(), plaintext if called directly.\n\t\t$user_pass = ! empty( $userdata['user_pass'] ) ? $userdata['user_pass'] : $old_user_data->user_pass;\n\t} else {\n\t\t$update = false;\n\t\t// Hash the password.\n\t\t$user_pass = wp_hash_password( $userdata['user_pass'] );\n\t}\n\n\t$sanitized_user_login = sanitize_user( $userdata['user_login'], true );\n\n\t/**\n\t * Filters a username after it has been sanitized.\n\t *\n\t * This filter is called before the user is created or updated.\n\t *\n\t * @since 2.0.3\n\t *\n\t * @param string $sanitized_user_login Username after it has been sanitized.\n\t */\n\t$pre_user_login = apply_filters( 'pre_user_login', $sanitized_user_login );\n\n\t// Remove any non-printable chars from the login string to see if we have ended up with an empty username.\n\t$user_login = trim( $pre_user_login );\n\n\t// user_login must be between 0 and 60 characters.\n\tif ( empty( $user_login ) ) {\n\t\treturn new WP_Error( 'empty_user_login', __( 'Cannot create a user with an empty login name.' ) );\n\t} elseif ( mb_strlen( $user_login ) > 60 ) {\n\t\treturn new WP_Error( 'user_login_too_long', __( 'Username may not be longer than 60 characters.' ) );\n\t}\n\n\tif ( ! $update && username_exists( $user_login ) ) {\n\t\treturn new WP_Error( 'existing_user_login', __( 'Sorry, that username already exists!' ) );\n\t}\n\n\t/**\n\t * Filters the list of disallowed usernames.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $usernames Array of disallowed usernames.\n\t */\n\t$illegal_logins = (array) apply_filters( 'illegal_user_logins', array() );\n\n\tif ( in_array( strtolower( $user_login ), array_map( 'strtolower', $illegal_logins ), true ) ) {\n\t\treturn new WP_Error( 'invalid_username', __( 'Sorry, that username is not allowed.' ) );\n\t}\n\n\t/*\n\t * If a nicename is provided, remove unsafe user characters before using it.\n\t * Otherwise build a nicename from the user_login.\n\t */\n\tif ( ! empty( $userdata['user_nicename'] ) ) {\n\t\t$user_nicename = sanitize_user( $userdata['user_nicename'], true );\n\t\tif ( mb_strlen( $user_nicename ) > 50 ) {\n\t\t\treturn new WP_Error( 'user_nicename_too_long', __( 'Nicename may not be longer than 50 characters.' ) );\n\t\t}\n\t} else {\n\t\t$user_nicename = mb_substr( $user_login, 0, 50 );\n\t}\n\n\t$user_nicename = sanitize_title( $user_nicename );\n\n\t/**\n\t * Filters a user's nicename before the user is created or updated.\n\t *\n\t * @since 2.0.3\n\t *\n\t * @param string $user_nicename The user's nicename.\n\t */\n\t$user_nicename = apply_filters( 'pre_user_nicename', $user_nicename );\n\n\t$user_nicename_check = $wpdb->get_var( $wpdb->prepare( \"SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1\", $user_nicename, $user_login ) );\n\n\tif ( $user_nicename_check ) {\n\t\t$suffix = 2;\n\t\twhile ( $user_nicename_check ) {\n\t\t\t// user_nicename allows 50 chars. Subtract one for a hyphen, plus the length of the suffix.\n\t\t\t$base_length         = 49 - mb_strlen( $suffix );\n\t\t\t$alt_user_nicename   = mb_substr( $user_nicename, 0, $base_length ) . \"-$suffix\";\n\t\t\t$user_nicename_check = $wpdb->get_var( $wpdb->prepare( \"SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1\", $alt_user_nicename, $user_login ) );\n\t\t\t$suffix++;\n\t\t}\n\t\t$user_nicename = $alt_user_nicename;\n\t}\n\n\t$raw_user_email = empty( $userdata['user_email'] ) ? '' : $userdata['user_email'];\n\n\t/**\n\t * Filters a user's email before the user is created or updated.\n\t *\n\t * @since 2.0.3\n\t *\n\t * @param string $raw_user_email The user's email.\n\t */\n\t$user_email = apply_filters( 'pre_user_email', $raw_user_email );\n\n\t/*\n\t * If there is no update, just check for `email_exists`. If there is an update,\n\t * check if current email and new email are the same, or not, and check `email_exists`\n\t * accordingly.\n\t */\n\tif ( ( ! $update || ( ! empty( $old_user_data ) && 0 !== strcasecmp( $user_email, $old_user_data->user_email ) ) )\n\t\t&& ! defined( 'WP_IMPORTING' )\n\t\t&& email_exists( $user_email )\n\t) {\n\t\treturn new WP_Error( 'existing_user_email', __( 'Sorry, that email address is already used!' ) );\n\t}\n\n\t$raw_user_url = empty( $userdata['user_url'] ) ? '' : $userdata['user_url'];\n\n\t/**\n\t * Filters a user's URL before the user is created or updated.\n\t *\n\t * @since 2.0.3\n\t *\n\t * @param string $raw_user_url The user's URL.\n\t */\n\t$user_url = apply_filters( 'pre_user_url', $raw_user_url );\n\n\t$user_registered = empty( $userdata['user_registered'] ) ? gmdate( 'Y-m-d H:i:s' ) : $userdata['user_registered'];\n\n\t$user_activation_key = empty( $userdata['user_activation_key'] ) ? '' : $userdata['user_activation_key'];\n\n\tif ( ! empty( $userdata['spam'] ) && ! is_multisite() ) {\n\t\treturn new WP_Error( 'no_spam', __( 'Sorry, marking a user as spam is only supported on Multisite.' ) );\n\t}\n\n\t$spam = empty( $userdata['spam'] ) ? 0 : (bool) $userdata['spam'];\n\n\t// Store values to save in user meta.\n\t$meta = array();\n\n\t$nickname = empty( $userdata['nickname'] ) ? $user_login : $userdata['nickname'];\n\n\t/**\n\t * Filters a user's nickname before the user is created or updated.\n\t *\n\t * @since 2.0.3\n\t *\n\t * @param string $nickname The user's nickname.\n\t */\n\t$meta['nickname'] = apply_filters( 'pre_user_nickname', $nickname );\n\n\t$first_name = empty( $userdata['first_name'] ) ? '' : $userdata['first_name'];\n\n\t/**\n\t * Filters a user's first name before the user is created or updated.\n\t *\n\t * @since 2.0.3\n\t *\n\t * @param string $first_name The user's first name.\n\t */\n\t$meta['first_name'] = apply_filters( 'pre_user_first_name', $first_name );\n\n\t$last_name = empty( $userdata['last_name'] ) ? '' : $userdata['last_name'];\n\n\t/**\n\t * Filters a user's last name before the user is created or updated.\n\t *\n\t * @since 2.0.3\n\t *\n\t * @param string $last_name The user's last name.\n\t */\n\t$meta['last_name'] = apply_filters( 'pre_user_last_name', $last_name );\n\n\tif ( empty( $userdata['display_name'] ) ) {\n\t\tif ( $update ) {\n\t\t\t$display_name = $user_login;\n\t\t} elseif ( $meta['first_name'] && $meta['last_name'] ) {\n\t\t\t/* translators: 1: User's first name, 2: Last name. */\n\t\t\t$display_name = sprintf( _x( '%1$s %2$s', 'Display name based on first name and last name' ), $meta['first_name'], $meta['last_name'] );\n\t\t} elseif ( $meta['first_name'] ) {\n\t\t\t$display_name = $meta['first_name'];\n\t\t} elseif ( $meta['last_name'] ) {\n\t\t\t$display_name = $meta['last_name'];\n\t\t} else {\n\t\t\t$display_name = $user_login;\n\t\t}\n\t} else {\n\t\t$display_name = $userdata['display_name'];\n\t}\n\n\t/**\n\t * Filters a user's display name before the user is created or updated.\n\t *\n\t * @since 2.0.3\n\t *\n\t * @param string $display_name The user's display name.\n\t */\n\t$display_name = apply_filters( 'pre_user_display_name', $display_name );\n\n\t$description = empty( $userdata['description'] ) ? '' : $userdata['description'];\n\n\t/**\n\t * Filters a user's description before the user is created or updated.\n\t *\n\t * @since 2.0.3\n\t *\n\t * @param string $description The user's description.\n\t */\n\t$meta['description'] = apply_filters( 'pre_user_description', $description );\n\n\t$meta['rich_editing'] = empty( $userdata['rich_editing'] ) ? 'true' : $userdata['rich_editing'];\n\n\t$meta['syntax_highlighting'] = empty( $userdata['syntax_highlighting'] ) ? 'true' : $userdata['syntax_highlighting'];\n\n\t$meta['comment_shortcuts'] = empty( $userdata['comment_shortcuts'] ) || 'false' === $userdata['comment_shortcuts'] ? 'false' : 'true';\n\n\t$admin_color         = empty( $userdata['admin_color'] ) ? 'fresh' : $userdata['admin_color'];\n\t$meta['admin_color'] = preg_replace( '|[^a-z0-9 _.\\-@]|i', '', $admin_color );\n\n\t$meta['use_ssl'] = empty( $userdata['use_ssl'] ) ? 0 : (bool) $userdata['use_ssl'];\n\n\t$meta['show_admin_bar_front'] = empty( $userdata['show_admin_bar_front'] ) ? 'true' : $userdata['show_admin_bar_front'];\n\n\t$meta['locale'] = isset( $userdata['locale'] ) ? $userdata['locale'] : '';\n\n\t$compacted = compact( 'user_pass', 'user_nicename', 'user_email', 'user_url', 'user_registered', 'user_activation_key', 'display_name' );\n\t$data      = wp_unslash( $compacted );\n\n\tif ( ! $update ) {\n\t\t$data = $data + compact( 'user_login' );\n\t}\n\n\tif ( is_multisite() ) {\n\t\t$data = $data + compact( 'spam' );\n\t}\n\n\t/**\n\t * Filters user data before the record is created or updated.\n\t *\n\t * It only includes data in the wp_users table wp_user, not any user metadata.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param array    $data {\n\t *     Values and keys for the user.\n\t *\n\t *     @type string $user_login      The user's login. Only included if $update == false\n\t *     @type string $user_pass       The user's password.\n\t *     @type string $user_email      The user's email.\n\t *     @type string $user_url        The user's url.\n\t *     @type string $user_nicename   The user's nice name. Defaults to a URL-safe version of user's login\n\t *     @type string $display_name    The user's display name.\n\t *     @type string $user_registered MySQL timestamp describing the moment when the user registered. Defaults to\n\t *                                   the current UTC timestamp.\n\t * }\n\t * @param bool     $update Whether the user is being updated rather than created.\n\t * @param int|null $id     ID of the user to be updated, or NULL if the user is being created.\n\t */\n\t$data = apply_filters( 'wp_pre_insert_user_data', $data, $update, $update ? (int) $ID : null );\n\n\tif ( empty( $data ) || ! is_array( $data ) ) {\n\t\treturn new WP_Error( 'empty_data', __( 'Not enough data to create this user.' ) );\n\t}\n\n\tif ( $update ) {\n\t\tif ( $user_email !== $old_user_data->user_email || $user_pass !== $old_user_data->user_pass ) {\n\t\t\t$data['user_activation_key'] = '';\n\t\t}\n\t\t$wpdb->update( $wpdb->users, $data, compact( 'ID' ) );\n\t\t$user_id = (int) $ID;\n\t} else {\n\t\t$wpdb->insert( $wpdb->users, $data );\n\t\t$user_id = (int) $wpdb->insert_id;\n\t}\n\n\t$user = new WP_User( $user_id );\n\n\t/**\n\t * Filters a user's meta values and keys immediately after the user is created or updated\n\t * and before any user meta is inserted or updated.\n\t *\n\t * Does not include contact methods. These are added using `wp_get_user_contact_methods( $user )`.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $meta {\n\t *     Default meta values and keys for the user.\n\t *\n\t *     @type string   $nickname             The user's nickname. Default is the user's username.\n\t *     @type string   $first_name           The user's first name.\n\t *     @type string   $last_name            The user's last name.\n\t *     @type string   $description          The user's description.\n\t *     @type string   $rich_editing         Whether to enable the rich-editor for the user. Default 'true'.\n\t *     @type string   $syntax_highlighting  Whether to enable the rich code editor for the user. Default 'true'.\n\t *     @type string   $comment_shortcuts    Whether to enable keyboard shortcuts for the user. Default 'false'.\n\t *     @type string   $admin_color          The color scheme for a user's admin screen. Default 'fresh'.\n\t *     @type int|bool $use_ssl              Whether to force SSL on the user's admin area. 0|false if SSL\n\t *                                          is not forced.\n\t *     @type string   $show_admin_bar_front Whether to show the admin bar on the front end for the user.\n\t *                                          Default 'true'.\n\t *     @type string   $locale               User's locale. Default empty.\n\t * }\n\t * @param WP_User $user   User object.\n\t * @param bool    $update Whether the user is being updated rather than created.\n\t */\n\t$meta = apply_filters( 'insert_user_meta', $meta, $user, $update );\n\n\t// Update user meta.\n\tforeach ( $meta as $key => $value ) {\n\t\tupdate_user_meta( $user_id, $key, $value );\n\t}\n\n\tforeach ( wp_get_user_contact_methods( $user ) as $key => $value ) {\n\t\tif ( isset( $userdata[ $key ] ) ) {\n\t\t\tupdate_user_meta( $user_id, $key, $userdata[ $key ] );\n\t\t}\n\t}\n\n\tif ( isset( $userdata['role'] ) ) {\n\t\t$user->set_role( $userdata['role'] );\n\t} elseif ( ! $update ) {\n\t\t$user->set_role( get_option( 'default_role' ) );\n\t}\n\n\tclean_user_cache( $user_id );\n\n\tif ( $update ) {\n\t\t/**\n\t\t * Fires immediately after an existing user is updated.\n\t\t *\n\t\t * @since 2.0.0\n\t\t *\n\t\t * @param int     $user_id       User ID.\n\t\t * @param WP_User $old_user_data Object containing user's data prior to update.\n\t\t */\n\t\tdo_action( 'profile_update', $user_id, $old_user_data );\n\n\t\tif ( isset( $userdata['spam'] ) && $userdata['spam'] != $old_user_data->spam ) {\n\t\t\tif ( 1 == $userdata['spam'] ) {\n\t\t\t\t/**\n\t\t\t\t * Fires after the user is marked as a SPAM user.\n\t\t\t\t *\n\t\t\t\t * @since 3.0.0\n\t\t\t\t *\n\t\t\t\t * @param int $user_id ID of the user marked as SPAM.\n\t\t\t\t */\n\t\t\t\tdo_action( 'make_spam_user', $user_id );\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * Fires after the user is marked as a HAM user. Opposite of SPAM.\n\t\t\t\t *\n\t\t\t\t * @since 3.0.0\n\t\t\t\t *\n\t\t\t\t * @param int $user_id ID of the user marked as HAM.\n\t\t\t\t */\n\t\t\t\tdo_action( 'make_ham_user', $user_id );\n\t\t\t}\n\t\t}\n\t} else {\n\t\t/**\n\t\t * Fires immediately after a new user is registered.\n\t\t *\n\t\t * @since 1.5.0\n\t\t *\n\t\t * @param int $user_id User ID.\n\t\t */\n\t\tdo_action( 'user_register', $user_id );\n\t}\n\n\treturn $user_id;\n}\n\n/**\n * Update a user in the database.\n *\n * It is possible to update a user's password by specifying the 'user_pass'\n * value in the $userdata parameter array.\n *\n * If current user's password is being updated, then the cookies will be\n * cleared.\n *\n * @since 2.0.0\n *\n * @see wp_insert_user() For what fields can be set in $userdata.\n *\n * @param array|object|WP_User $userdata An array of user data or a user object of type stdClass or WP_User.\n * @return int|WP_Error The updated user's ID or a WP_Error object if the user could not be updated.\n */\nfunction wp_update_user( $userdata ) {\n\tif ( $userdata instanceof stdClass ) {\n\t\t$userdata = get_object_vars( $userdata );\n\t} elseif ( $userdata instanceof WP_User ) {\n\t\t$userdata = $userdata->to_array();\n\t}\n\n\t$ID = isset( $userdata['ID'] ) ? (int) $userdata['ID'] : 0;\n\tif ( ! $ID ) {\n\t\treturn new WP_Error( 'invalid_user_id', __( 'Invalid user ID.' ) );\n\t}\n\n\t// First, get all of the original fields.\n\t$user_obj = get_userdata( $ID );\n\tif ( ! $user_obj ) {\n\t\treturn new WP_Error( 'invalid_user_id', __( 'Invalid user ID.' ) );\n\t}\n\n\t$user = $user_obj->to_array();\n\n\t// Add additional custom fields.\n\tforeach ( _get_additional_user_keys( $user_obj ) as $key ) {\n\t\t$user[ $key ] = get_user_meta( $ID, $key, true );\n\t}\n\n\t// Escape data pulled from DB.\n\t$user = add_magic_quotes( $user );\n\n\tif ( ! empty( $userdata['user_pass'] ) && $userdata['user_pass'] !== $user_obj->user_pass ) {\n\t\t// If password is changing, hash it now.\n\t\t$plaintext_pass        = $userdata['user_pass'];\n\t\t$userdata['user_pass'] = wp_hash_password( $userdata['user_pass'] );\n\n\t\t/**\n\t\t * Filters whether to send the password change email.\n\t\t *\n\t\t * @since 4.3.0\n\t\t *\n\t\t * @see wp_insert_user() For `$user` and `$userdata` fields.\n\t\t *\n\t\t * @param bool  $send     Whether to send the email.\n\t\t * @param array $user     The original user array.\n\t\t * @param array $userdata The updated user array.\n\t\t */\n\t\t$send_password_change_email = apply_filters( 'send_password_change_email', true, $user, $userdata );\n\t}\n\n\tif ( isset( $userdata['user_email'] ) && $user['user_email'] !== $userdata['user_email'] ) {\n\t\t/**\n\t\t * Filters whether to send the email change email.\n\t\t *\n\t\t * @since 4.3.0\n\t\t *\n\t\t * @see wp_insert_user() For `$user` and `$userdata` fields.\n\t\t *\n\t\t * @param bool  $send     Whether to send the email.\n\t\t * @param array $user     The original user array.\n\t\t * @param array $userdata The updated user array.\n\t\t */\n\t\t$send_email_change_email = apply_filters( 'send_email_change_email', true, $user, $userdata );\n\t}\n\n\tclean_user_cache( $user_obj );\n\n\t// Merge old and new fields with new fields overwriting old ones.\n\t$userdata = array_merge( $user, $userdata );\n\t$user_id  = wp_insert_user( $userdata );\n\n\tif ( ! is_wp_error( $user_id ) ) {\n\n\t\t$blog_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );\n\n\t\t$switched_locale = false;\n\t\tif ( ! empty( $send_password_change_email ) || ! empty( $send_email_change_email ) ) {\n\t\t\t$switched_locale = switch_to_locale( get_user_locale( $user_id ) );\n\t\t}\n\n\t\tif ( ! empty( $send_password_change_email ) ) {\n\t\t\t/* translators: Do not translate USERNAME, ADMIN_EMAIL, EMAIL, SITENAME, SITEURL: those are placeholders. */\n\t\t\t$pass_change_text = __(\n\t\t\t\t'Hi ###USERNAME###,\n\nThis notice confirms that your password was changed on ###SITENAME###.\n\nIf you did not change your password, please contact the Site Administrator at\n###ADMIN_EMAIL###\n\nThis email has been sent to ###EMAIL###\n\nRegards,\nAll at ###SITENAME###\n###SITEURL###'\n\t\t\t);\n\n\t\t\t$pass_change_email = array(\n\t\t\t\t'to'      => $user['user_email'],\n\t\t\t\t/* translators: Password change notification email subject. %s: Site title. */\n\t\t\t\t'subject' => __( '[%s] Password Changed' ),\n\t\t\t\t'message' => $pass_change_text,\n\t\t\t\t'headers' => '',\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Filters the contents of the email sent when the user's password is changed.\n\t\t\t *\n\t\t\t * @since 4.3.0\n\t\t\t *\n\t\t\t * @param array $pass_change_email {\n\t\t\t *            Used to build wp_mail().\n\t\t\t *\n\t\t\t *            @type string $to      The intended recipients. Add emails in a comma separated string.\n\t\t\t *            @type string $subject The subject of the email.\n\t\t\t *            @type string $message The content of the email.\n\t\t\t *                The following strings have a special meaning and will get replaced dynamically:\n\t\t\t *                - ###USERNAME###    The current user's username.\n\t\t\t *                - ###ADMIN_EMAIL### The admin email in case this was unexpected.\n\t\t\t *                - ###EMAIL###       The user's email address.\n\t\t\t *                - ###SITENAME###    The name of the site.\n\t\t\t *                - ###SITEURL###     The URL to the site.\n\t\t\t *            @type string $headers Headers. Add headers in a newline (\\r\\n) separated string.\n\t\t\t *        }\n\t\t\t * @param array $user     The original user array.\n\t\t\t * @param array $userdata The updated user array.\n\t\t\t */\n\t\t\t$pass_change_email = apply_filters( 'password_change_email', $pass_change_email, $user, $userdata );\n\n\t\t\t$pass_change_email['message'] = str_replace( '###USERNAME###', $user['user_login'], $pass_change_email['message'] );\n\t\t\t$pass_change_email['message'] = str_replace( '###ADMIN_EMAIL###', get_option( 'admin_email' ), $pass_change_email['message'] );\n\t\t\t$pass_change_email['message'] = str_replace( '###EMAIL###', $user['user_email'], $pass_change_email['message'] );\n\t\t\t$pass_change_email['message'] = str_replace( '###SITENAME###', $blog_name, $pass_change_email['message'] );\n\t\t\t$pass_change_email['message'] = str_replace( '###SITEURL###', home_url(), $pass_change_email['message'] );\n\n\t\t\twp_mail( $pass_change_email['to'], sprintf( $pass_change_email['subject'], $blog_name ), $pass_change_email['message'], $pass_change_email['headers'] );\n\t\t}\n\n\t\tif ( ! empty( $send_email_change_email ) ) {\n\t\t\t/* translators: Do not translate USERNAME, ADMIN_EMAIL, NEW_EMAIL, EMAIL, SITENAME, SITEURL: those are placeholders. */\n\t\t\t$email_change_text = __(\n\t\t\t\t'Hi ###USERNAME###,\n\nThis notice confirms that your email address on ###SITENAME### was changed to ###NEW_EMAIL###.\n\nIf you did not change your email, please contact the Site Administrator at\n###ADMIN_EMAIL###\n\nThis email has been sent to ###EMAIL###\n\nRegards,\nAll at ###SITENAME###\n###SITEURL###'\n\t\t\t);\n\n\t\t\t$email_change_email = array(\n\t\t\t\t'to'      => $user['user_email'],\n\t\t\t\t/* translators: Email change notification email subject. %s: Site title. */\n\t\t\t\t'subject' => __( '[%s] Email Changed' ),\n\t\t\t\t'message' => $email_change_text,\n\t\t\t\t'headers' => '',\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Filters the contents of the email sent when the user's email is changed.\n\t\t\t *\n\t\t\t * @since 4.3.0\n\t\t\t *\n\t\t\t * @param array $email_change_email {\n\t\t\t *            Used to build wp_mail().\n\t\t\t *\n\t\t\t *            @type string $to      The intended recipients.\n\t\t\t *            @type string $subject The subject of the email.\n\t\t\t *            @type string $message The content of the email.\n\t\t\t *                The following strings have a special meaning and will get replaced dynamically:\n\t\t\t *                - ###USERNAME###    The current user's username.\n\t\t\t *                - ###ADMIN_EMAIL### The admin email in case this was unexpected.\n\t\t\t *                - ###NEW_EMAIL###   The new email address.\n\t\t\t *                - ###EMAIL###       The old email address.\n\t\t\t *                - ###SITENAME###    The name of the site.\n\t\t\t *                - ###SITEURL###     The URL to the site.\n\t\t\t *            @type string $headers Headers.\n\t\t\t *        }\n\t\t\t * @param array $user     The original user array.\n\t\t\t * @param array $userdata The updated user array.\n\t\t\t */\n\t\t\t$email_change_email = apply_filters( 'email_change_email', $email_change_email, $user, $userdata );\n\n\t\t\t$email_change_email['message'] = str_replace( '###USERNAME###', $user['user_login'], $email_change_email['message'] );\n\t\t\t$email_change_email['message'] = str_replace( '###ADMIN_EMAIL###', get_option( 'admin_email' ), $email_change_email['message'] );\n\t\t\t$email_change_email['message'] = str_replace( '###NEW_EMAIL###', $userdata['user_email'], $email_change_email['message'] );\n\t\t\t$email_change_email['message'] = str_replace( '###EMAIL###', $user['user_email'], $email_change_email['message'] );\n\t\t\t$email_change_email['message'] = str_replace( '###SITENAME###', $blog_name, $email_change_email['message'] );\n\t\t\t$email_change_email['message'] = str_replace( '###SITEURL###', home_url(), $email_change_email['message'] );\n\n\t\t\twp_mail( $email_change_email['to'], sprintf( $email_change_email['subject'], $blog_name ), $email_change_email['message'], $email_change_email['headers'] );\n\t\t}\n\n\t\tif ( $switched_locale ) {\n\t\t\trestore_previous_locale();\n\t\t}\n\t}\n\n\t// Update the cookies if the password changed.\n\t$current_user = wp_get_current_user();\n\tif ( $current_user->ID == $ID ) {\n\t\tif ( isset( $plaintext_pass ) ) {\n\t\t\twp_clear_auth_cookie();\n\n\t\t\t// Here we calculate the expiration length of the current auth cookie and compare it to the default expiration.\n\t\t\t// If it's greater than this, then we know the user checked 'Remember Me' when they logged in.\n\t\t\t$logged_in_cookie = wp_parse_auth_cookie( '', 'logged_in' );\n\t\t\t/** This filter is documented in wp-includes/pluggable.php */\n\t\t\t$default_cookie_life = apply_filters( 'auth_cookie_expiration', ( 2 * DAY_IN_SECONDS ), $ID, false );\n\t\t\t$remember            = false;\n\t\t\tif ( false !== $logged_in_cookie && ( $logged_in_cookie['expiration'] - time() ) > $default_cookie_life ) {\n\t\t\t\t$remember = true;\n\t\t\t}\n\n\t\t\twp_set_auth_cookie( $ID, $remember );\n\t\t}\n\t}\n\n\treturn $user_id;\n}\n\n/**\n * A simpler way of inserting a user into the database.\n *\n * Creates a new user with just the username, password, and email. For more\n * complex user creation use wp_insert_user() to specify more information.\n *\n * @since 2.0.0\n *\n * @see wp_insert_user() More complete way to create a new user.\n *\n * @param string $username The user's username.\n * @param string $password The user's password.\n * @param string $email    Optional. The user's email. Default empty.\n * @return int|WP_Error The newly created user's ID or a WP_Error object if the user could not\n *                      be created.\n */\nfunction wp_create_user( $username, $password, $email = '' ) {\n\t$user_login = wp_slash( $username );\n\t$user_email = wp_slash( $email );\n\t$user_pass  = $password;\n\n\t$userdata = compact( 'user_login', 'user_email', 'user_pass' );\n\treturn wp_insert_user( $userdata );\n}\n\n/**\n * Returns a list of meta keys to be (maybe) populated in wp_update_user().\n *\n * The list of keys returned via this function are dependent on the presence\n * of those keys in the user meta data to be set.\n *\n * @since 3.3.0\n * @access private\n *\n * @param WP_User $user WP_User instance.\n * @return string[] List of user keys to be populated in wp_update_user().\n */\nfunction _get_additional_user_keys( $user ) {\n\t$keys = array( 'first_name', 'last_name', 'nickname', 'description', 'rich_editing', 'syntax_highlighting', 'comment_shortcuts', 'admin_color', 'use_ssl', 'show_admin_bar_front', 'locale' );\n\treturn array_merge( $keys, array_keys( wp_get_user_contact_methods( $user ) ) );\n}\n\n/**\n * Set up the user contact methods.\n *\n * Default contact methods were removed in 3.6. A filter dictates contact methods.\n *\n * @since 3.7.0\n *\n * @param WP_User $user Optional. WP_User object.\n * @return string[] Array of contact method labels keyed by contact method.\n */\nfunction wp_get_user_contact_methods( $user = null ) {\n\t$methods = array();\n\tif ( get_site_option( 'initial_db_version' ) < 23588 ) {\n\t\t$methods = array(\n\t\t\t'aim'    => __( 'AIM' ),\n\t\t\t'yim'    => __( 'Yahoo IM' ),\n\t\t\t'jabber' => __( 'Jabber / Google Talk' ),\n\t\t);\n\t}\n\n\t/**\n\t * Filters the user contact methods.\n\t *\n\t * @since 2.9.0\n\t *\n\t * @param string[] $methods Array of contact method labels keyed by contact method.\n\t * @param WP_User  $user    WP_User object.\n\t */\n\treturn apply_filters( 'user_contactmethods', $methods, $user );\n}\n\n/**\n * The old private function for setting up user contact methods.\n *\n * Use wp_get_user_contact_methods() instead.\n *\n * @since 2.9.0\n * @access private\n *\n * @param WP_User $user Optional. WP_User object. Default null.\n * @return string[] Array of contact method labels keyed by contact method.\n */\nfunction _wp_get_user_contactmethods( $user = null ) {\n\treturn wp_get_user_contact_methods( $user );\n}\n\n/**\n * Gets the text suggesting how to create strong passwords.\n *\n * @since 4.1.0\n *\n * @return string The password hint text.\n */\nfunction wp_get_password_hint() {\n\t$hint = __( 'Hint: The password should be at least twelve characters long. To make it stronger, use upper and lower case letters, numbers, and symbols like ! \" ? $ % ^ &amp; ).' );\n\n\t/**\n\t * Filters the text describing the site's password complexity policy.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @param string $hint The password hint text.\n\t */\n\treturn apply_filters( 'password_hint', $hint );\n}\n\n/**\n * Creates, stores, then returns a password reset key for user.\n *\n * @since 4.4.0\n *\n * @global PasswordHash $wp_hasher Portable PHP password hashing framework.\n *\n * @param WP_User $user User to retrieve password reset key for.\n * @return string|WP_Error Password reset key on success. WP_Error on error.\n */\nfunction get_password_reset_key( $user ) {\n\tglobal $wp_hasher;\n\n\tif ( ! ( $user instanceof WP_User ) ) {\n\t\treturn new WP_Error( 'invalidcombo', __( '<strong>Error</strong>: There is no account with that username or email address.' ) );\n\t}\n\n\t/**\n\t * Fires before a new password is retrieved.\n\t *\n\t * Use the {@see 'retrieve_password'} hook instead.\n\t *\n\t * @since 1.5.0\n\t * @deprecated 1.5.1 Misspelled. Use {@see 'retrieve_password'} hook instead.\n\t *\n\t * @param string $user_login The user login name.\n\t */\n\tdo_action_deprecated( 'retreive_password', array( $user->user_login ), '1.5.1', 'retrieve_password' );\n\n\t/**\n\t * Fires before a new password is retrieved.\n\t *\n\t * @since 1.5.1\n\t *\n\t * @param string $user_login The user login name.\n\t */\n\tdo_action( 'retrieve_password', $user->user_login );\n\n\t$allow = true;\n\tif ( is_multisite() && is_user_spammy( $user ) ) {\n\t\t$allow = false;\n\t}\n\n\t/**\n\t * Filters whether to allow a password to be reset.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param bool $allow Whether to allow the password to be reset. Default true.\n\t * @param int  $ID    The ID of the user attempting to reset a password.\n\t */\n\t$allow = apply_filters( 'allow_password_reset', $allow, $user->ID );\n\n\tif ( ! $allow ) {\n\t\treturn new WP_Error( 'no_password_reset', __( 'Password reset is not allowed for this user' ) );\n\t} elseif ( is_wp_error( $allow ) ) {\n\t\treturn $allow;\n\t}\n\n\t// Generate something random for a password reset key.\n\t$key = wp_generate_password( 20, false );\n\n\t/**\n\t * Fires when a password reset key is generated.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $user_login The username for the user.\n\t * @param string $key        The generated password reset key.\n\t */\n\tdo_action( 'retrieve_password_key', $user->user_login, $key );\n\n\t// Now insert the key, hashed, into the DB.\n\tif ( empty( $wp_hasher ) ) {\n\t\trequire_once ABSPATH . WPINC . '/class-phpass.php';\n\t\t$wp_hasher = new PasswordHash( 8, true );\n\t}\n\n\t$hashed = time() . ':' . $wp_hasher->HashPassword( $key );\n\n\t$key_saved = wp_update_user(\n\t\tarray(\n\t\t\t'ID'                  => $user->ID,\n\t\t\t'user_activation_key' => $hashed,\n\t\t)\n\t);\n\n\tif ( is_wp_error( $key_saved ) ) {\n\t\treturn $key_saved;\n\t}\n\n\treturn $key;\n}\n\n/**\n * Retrieves a user row based on password reset key and login\n *\n * A key is considered 'expired' if it exactly matches the value of the\n * user_activation_key field, rather than being matched after going through the\n * hashing process. This field is now hashed; old values are no longer accepted\n * but have a different WP_Error code so good user feedback can be provided.\n *\n * @since 3.1.0\n *\n * @global wpdb         $wpdb      WordPress database object for queries.\n * @global PasswordHash $wp_hasher Portable PHP password hashing framework instance.\n *\n * @param string $key       Hash to validate sending user's password.\n * @param string $login     The user login.\n * @return WP_User|WP_Error WP_User object on success, WP_Error object for invalid or expired keys.\n */\nfunction check_password_reset_key( $key, $login ) {\n\tglobal $wpdb, $wp_hasher;\n\n\t$key = preg_replace( '/[^a-z0-9]/i', '', $key );\n\n\tif ( empty( $key ) || ! is_string( $key ) ) {\n\t\treturn new WP_Error( 'invalid_key', __( 'Invalid key.' ) );\n\t}\n\n\tif ( empty( $login ) || ! is_string( $login ) ) {\n\t\treturn new WP_Error( 'invalid_key', __( 'Invalid key.' ) );\n\t}\n\n\t$user = get_user_by( 'login', $login );\n\n\tif ( ! $user ) {\n\t\treturn new WP_Error( 'invalid_key', __( 'Invalid key.' ) );\n\t}\n\n\tif ( empty( $wp_hasher ) ) {\n\t\trequire_once ABSPATH . WPINC . '/class-phpass.php';\n\t\t$wp_hasher = new PasswordHash( 8, true );\n\t}\n\n\t/**\n\t * Filters the expiration time of password reset keys.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param int $expiration The expiration time in seconds.\n\t */\n\t$expiration_duration = apply_filters( 'password_reset_expiration', DAY_IN_SECONDS );\n\n\tif ( false !== strpos( $user->user_activation_key, ':' ) ) {\n\t\tlist( $pass_request_time, $pass_key ) = explode( ':', $user->user_activation_key, 2 );\n\t\t$expiration_time                      = $pass_request_time + $expiration_duration;\n\t} else {\n\t\t$pass_key        = $user->user_activation_key;\n\t\t$expiration_time = false;\n\t}\n\n\tif ( ! $pass_key ) {\n\t\treturn new WP_Error( 'invalid_key', __( 'Invalid key.' ) );\n\t}\n\n\t$hash_is_correct = $wp_hasher->CheckPassword( $key, $pass_key );\n\n\tif ( $hash_is_correct && $expiration_time && time() < $expiration_time ) {\n\t\treturn $user;\n\t} elseif ( $hash_is_correct && $expiration_time ) {\n\t\t// Key has an expiration time that's passed.\n\t\treturn new WP_Error( 'expired_key', __( 'Invalid key.' ) );\n\t}\n\n\tif ( hash_equals( $user->user_activation_key, $key ) || ( $hash_is_correct && ! $expiration_time ) ) {\n\t\t$return  = new WP_Error( 'expired_key', __( 'Invalid key.' ) );\n\t\t$user_id = $user->ID;\n\n\t\t/**\n\t\t * Filters the return value of check_password_reset_key() when an\n\t\t * old-style key is used.\n\t\t *\n\t\t * @since 3.7.0 Previously plain-text keys were stored in the database.\n\t\t * @since 4.3.0 Previously key hashes were stored without an expiration time.\n\t\t *\n\t\t * @param WP_Error $return  A WP_Error object denoting an expired key.\n\t\t *                          Return a WP_User object to validate the key.\n\t\t * @param int      $user_id The matched user ID.\n\t\t */\n\t\treturn apply_filters( 'password_reset_key_expired', $return, $user_id );\n\t}\n\n\treturn new WP_Error( 'invalid_key', __( 'Invalid key.' ) );\n}\n\n/**\n * Handles resetting the user's password.\n *\n * @since 2.5.0\n *\n * @param WP_User $user     The user\n * @param string  $new_pass New password for the user in plaintext\n */\nfunction reset_password( $user, $new_pass ) {\n\t/**\n\t * Fires before the user's password is reset.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param WP_User $user     The user.\n\t * @param string  $new_pass New user password.\n\t */\n\tdo_action( 'password_reset', $user, $new_pass );\n\n\twp_set_password( $new_pass, $user->ID );\n\tupdate_user_option( $user->ID, 'default_password_nag', false, true );\n\n\t/**\n\t * Fires after the user's password is reset.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param WP_User $user     The user.\n\t * @param string  $new_pass New user password.\n\t */\n\tdo_action( 'after_password_reset', $user, $new_pass );\n}\n\n/**\n * Handles registering a new user.\n *\n * @since 2.5.0\n *\n * @param string $user_login User's username for logging in\n * @param string $user_email User's email address to send password and add\n * @return int|WP_Error Either user's ID or error on failure.\n */\nfunction register_new_user( $user_login, $user_email ) {\n\t$errors = new WP_Error();\n\n\t$sanitized_user_login = sanitize_user( $user_login );\n\t/**\n\t * Filters the email address of a user being registered.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string $user_email The email address of the new user.\n\t */\n\t$user_email = apply_filters( 'user_registration_email', $user_email );\n\n\t// Check the username.\n\tif ( '' === $sanitized_user_login ) {\n\t\t$errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter a username.' ) );\n\t} elseif ( ! validate_username( $user_login ) ) {\n\t\t$errors->add( 'invalid_username', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );\n\t\t$sanitized_user_login = '';\n\t} elseif ( username_exists( $sanitized_user_login ) ) {\n\t\t$errors->add( 'username_exists', __( '<strong>Error</strong>: This username is already registered. Please choose another one.' ) );\n\n\t} else {\n\t\t/** This filter is documented in wp-includes/user.php */\n\t\t$illegal_user_logins = (array) apply_filters( 'illegal_user_logins', array() );\n\t\tif ( in_array( strtolower( $sanitized_user_login ), array_map( 'strtolower', $illegal_user_logins ), true ) ) {\n\t\t\t$errors->add( 'invalid_username', __( '<strong>Error</strong>: Sorry, that username is not allowed.' ) );\n\t\t}\n\t}\n\n\t// Check the email address.\n\tif ( '' === $user_email ) {\n\t\t$errors->add( 'empty_email', __( '<strong>Error</strong>: Please type your email address.' ) );\n\t} elseif ( ! is_email( $user_email ) ) {\n\t\t$errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address isn&#8217;t correct.' ) );\n\t\t$user_email = '';\n\t} elseif ( email_exists( $user_email ) ) {\n\t\t$errors->add( 'email_exists', __( '<strong>Error</strong>: This email is already registered. Please choose another one.' ) );\n\t}\n\n\t/**\n\t * Fires when submitting registration form data, before the user is created.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param string   $sanitized_user_login The submitted username after being sanitized.\n\t * @param string   $user_email           The submitted email.\n\t * @param WP_Error $errors               Contains any errors with submitted username and email,\n\t *                                       e.g., an empty field, an invalid username or email,\n\t *                                       or an existing username or email.\n\t */\n\tdo_action( 'register_post', $sanitized_user_login, $user_email, $errors );\n\n\t/**\n\t * Filters the errors encountered when a new user is being registered.\n\t *\n\t * The filtered WP_Error object may, for example, contain errors for an invalid\n\t * or existing username or email address. A WP_Error object should always be returned,\n\t * but may or may not contain errors.\n\t *\n\t * If any errors are present in $errors, this will abort the user's registration.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param WP_Error $errors               A WP_Error object containing any errors encountered\n\t *                                       during registration.\n\t * @param string   $sanitized_user_login User's username after it has been sanitized.\n\t * @param string   $user_email           User's email.\n\t */\n\t$errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email );\n\n\tif ( $errors->has_errors() ) {\n\t\treturn $errors;\n\t}\n\n\t$user_pass = wp_generate_password( 12, false );\n\t$user_id   = wp_create_user( $sanitized_user_login, $user_pass, $user_email );\n\tif ( ! $user_id || is_wp_error( $user_id ) ) {\n\t\t$errors->add(\n\t\t\t'registerfail',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Admin email address. */\n\t\t\t\t__( '<strong>Error</strong>: Couldn&#8217;t register you&hellip; please contact the <a href=\"mailto:%s\">site admin</a>!' ),\n\t\t\t\tget_option( 'admin_email' )\n\t\t\t)\n\t\t);\n\t\treturn $errors;\n\t}\n\n\tupdate_user_option( $user_id, 'default_password_nag', true, true ); // Set up the password change nag.\n\n\t/**\n\t * Fires after a new user registration has been recorded.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param int $user_id ID of the newly registered user.\n\t */\n\tdo_action( 'register_new_user', $user_id );\n\n\treturn $user_id;\n}\n\n/**\n * Initiates email notifications related to the creation of new users.\n *\n * Notifications are sent both to the site admin and to the newly created user.\n *\n * @since 4.4.0\n * @since 4.6.0 Converted the `$notify` parameter to accept 'user' for sending\n *              notifications only to the user created.\n *\n * @param int    $user_id ID of the newly created user.\n * @param string $notify  Optional. Type of notification that should happen. Accepts 'admin'\n *                        or an empty string (admin only), 'user', or 'both' (admin and user).\n *                        Default 'both'.\n */\nfunction wp_send_new_user_notifications( $user_id, $notify = 'both' ) {\n\twp_new_user_notification( $user_id, null, $notify );\n}\n\n/**\n * Retrieve the current session token from the logged_in cookie.\n *\n * @since 4.0.0\n *\n * @return string Token.\n */\nfunction wp_get_session_token() {\n\t$cookie = wp_parse_auth_cookie( '', 'logged_in' );\n\treturn ! empty( $cookie['token'] ) ? $cookie['token'] : '';\n}\n\n/**\n * Retrieve a list of sessions for the current user.\n *\n * @since 4.0.0\n *\n * @return array Array of sessions.\n */\nfunction wp_get_all_sessions() {\n\t$manager = WP_Session_Tokens::get_instance( get_current_user_id() );\n\treturn $manager->get_all();\n}\n\n/**\n * Remove the current session token from the database.\n *\n * @since 4.0.0\n */\nfunction wp_destroy_current_session() {\n\t$token = wp_get_session_token();\n\tif ( $token ) {\n\t\t$manager = WP_Session_Tokens::get_instance( get_current_user_id() );\n\t\t$manager->destroy( $token );\n\t}\n}\n\n/**\n * Remove all but the current session token for the current user for the database.\n *\n * @since 4.0.0\n */\nfunction wp_destroy_other_sessions() {\n\t$token = wp_get_session_token();\n\tif ( $token ) {\n\t\t$manager = WP_Session_Tokens::get_instance( get_current_user_id() );\n\t\t$manager->destroy_others( $token );\n\t}\n}\n\n/**\n * Remove all session tokens for the current user from the database.\n *\n * @since 4.0.0\n */\nfunction wp_destroy_all_sessions() {\n\t$manager = WP_Session_Tokens::get_instance( get_current_user_id() );\n\t$manager->destroy_all();\n}\n\n/**\n * Get the user IDs of all users with no role on this site.\n *\n * @since 4.4.0\n * @since 4.9.0 The `$site_id` parameter was added to support multisite.\n *\n * @param int|null $site_id Optional. The site ID to get users with no role for. Defaults to the current site.\n * @return string[] Array of user IDs as strings.\n */\nfunction wp_get_users_with_no_role( $site_id = null ) {\n\tglobal $wpdb;\n\n\tif ( ! $site_id ) {\n\t\t$site_id = get_current_blog_id();\n\t}\n\n\t$prefix = $wpdb->get_blog_prefix( $site_id );\n\n\tif ( is_multisite() && get_current_blog_id() != $site_id ) {\n\t\tswitch_to_blog( $site_id );\n\t\t$role_names = wp_roles()->get_names();\n\t\trestore_current_blog();\n\t} else {\n\t\t$role_names = wp_roles()->get_names();\n\t}\n\n\t$regex = implode( '|', array_keys( $role_names ) );\n\t$regex = preg_replace( '/[^a-zA-Z_\\|-]/', '', $regex );\n\t$users = $wpdb->get_col(\n\t\t$wpdb->prepare(\n\t\t\t\"\n\t\tSELECT user_id\n\t\tFROM $wpdb->usermeta\n\t\tWHERE meta_key = '{$prefix}capabilities'\n\t\tAND meta_value NOT REGEXP %s\n\t\",\n\t\t\t$regex\n\t\t)\n\t);\n\n\treturn $users;\n}\n\n/**\n * Retrieves the current user object.\n *\n * Will set the current user, if the current user is not set. The current user\n * will be set to the logged-in person. If no user is logged-in, then it will\n * set the current user to 0, which is invalid and won't have any permissions.\n *\n * This function is used by the pluggable functions wp_get_current_user() and\n * get_currentuserinfo(), the latter of which is deprecated but used for backward\n * compatibility.\n *\n * @since 4.5.0\n * @access private\n *\n * @see wp_get_current_user()\n * @global WP_User $current_user Checks if the current user is set.\n *\n * @return WP_User Current WP_User instance.\n */\nfunction _wp_get_current_user() {\n\tglobal $current_user;\n\n\tif ( ! empty( $current_user ) ) {\n\t\tif ( $current_user instanceof WP_User ) {\n\t\t\treturn $current_user;\n\t\t}\n\n\t\t// Upgrade stdClass to WP_User.\n\t\tif ( is_object( $current_user ) && isset( $current_user->ID ) ) {\n\t\t\t$cur_id       = $current_user->ID;\n\t\t\t$current_user = null;\n\t\t\twp_set_current_user( $cur_id );\n\t\t\treturn $current_user;\n\t\t}\n\n\t\t// $current_user has a junk value. Force to WP_User with ID 0.\n\t\t$current_user = null;\n\t\twp_set_current_user( 0 );\n\t\treturn $current_user;\n\t}\n\n\tif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) {\n\t\twp_set_current_user( 0 );\n\t\treturn $current_user;\n\t}\n\n\t/**\n\t * Filters the current user.\n\t *\n\t * The default filters use this to determine the current user from the\n\t * request's cookies, if available.\n\t *\n\t * Returning a value of false will effectively short-circuit setting\n\t * the current user.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param int|bool $user_id User ID if one has been determined, false otherwise.\n\t */\n\t$user_id = apply_filters( 'determine_current_user', false );\n\tif ( ! $user_id ) {\n\t\twp_set_current_user( 0 );\n\t\treturn $current_user;\n\t}\n\n\twp_set_current_user( $user_id );\n\n\treturn $current_user;\n}\n\n/**\n * Send a confirmation request email when a change of user email address is attempted.\n *\n * @since 3.0.0\n * @since 4.9.0 This function was moved from wp-admin/includes/ms.php so it's no longer Multisite specific.\n *\n * @global WP_Error $errors WP_Error object.\n */\nfunction send_confirmation_on_profile_email() {\n\tglobal $errors;\n\n\t$current_user = wp_get_current_user();\n\tif ( ! is_object( $errors ) ) {\n\t\t$errors = new WP_Error();\n\t}\n\n\tif ( $current_user->ID != $_POST['user_id'] ) {\n\t\treturn false;\n\t}\n\n\tif ( $current_user->user_email != $_POST['email'] ) {\n\t\tif ( ! is_email( $_POST['email'] ) ) {\n\t\t\t$errors->add(\n\t\t\t\t'user_email',\n\t\t\t\t__( '<strong>Error</strong>: The email address isn&#8217;t correct.' ),\n\t\t\t\tarray(\n\t\t\t\t\t'form-field' => 'email',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif ( email_exists( $_POST['email'] ) ) {\n\t\t\t$errors->add(\n\t\t\t\t'user_email',\n\t\t\t\t__( '<strong>Error</strong>: The email address is already used.' ),\n\t\t\t\tarray(\n\t\t\t\t\t'form-field' => 'email',\n\t\t\t\t)\n\t\t\t);\n\t\t\tdelete_user_meta( $current_user->ID, '_new_email' );\n\n\t\t\treturn;\n\t\t}\n\n\t\t$hash           = md5( $_POST['email'] . time() . wp_rand() );\n\t\t$new_user_email = array(\n\t\t\t'hash'     => $hash,\n\t\t\t'newemail' => $_POST['email'],\n\t\t);\n\t\tupdate_user_meta( $current_user->ID, '_new_email', $new_user_email );\n\n\t\t$sitename = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );\n\n\t\t/* translators: Do not translate USERNAME, ADMIN_URL, EMAIL, SITENAME, SITEURL: those are placeholders. */\n\t\t$email_text = __(\n\t\t\t'Howdy ###USERNAME###,\n\nYou recently requested to have the email address on your account changed.\n\nIf this is correct, please click on the following link to change it:\n###ADMIN_URL###\n\nYou can safely ignore and delete this email if you do not want to\ntake this action.\n\nThis email has been sent to ###EMAIL###\n\nRegards,\nAll at ###SITENAME###\n###SITEURL###'\n\t\t);\n\n\t\t/**\n\t\t * Filters the text of the email sent when a change of user email address is attempted.\n\t\t *\n\t\t * The following strings have a special meaning and will get replaced dynamically:\n\t\t * - ###USERNAME###  The current user's username.\n\t\t * - ###ADMIN_URL### The link to click on to confirm the email change.\n\t\t * - ###EMAIL###     The new email.\n\t\t * - ###SITENAME###  The name of the site.\n\t\t * - ###SITEURL###   The URL to the site.\n\t\t *\n\t\t * @since MU (3.0.0)\n\t\t * @since 4.9.0 This filter is no longer Multisite specific.\n\t\t *\n\t\t * @param string $email_text     Text in the email.\n\t\t * @param array  $new_user_email {\n\t\t *     Data relating to the new user email address.\n\t\t *\n\t\t *     @type string $hash     The secure hash used in the confirmation link URL.\n\t\t *     @type string $newemail The proposed new email address.\n\t\t * }\n\t\t */\n\t\t$content = apply_filters( 'new_user_email_content', $email_text, $new_user_email );\n\n\t\t$content = str_replace( '###USERNAME###', $current_user->user_login, $content );\n\t\t$content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'profile.php?newuseremail=' . $hash ) ), $content );\n\t\t$content = str_replace( '###EMAIL###', $_POST['email'], $content );\n\t\t$content = str_replace( '###SITENAME###', $sitename, $content );\n\t\t$content = str_replace( '###SITEURL###', home_url(), $content );\n\n\t\t/* translators: New email address notification email subject. %s: Site title. */\n\t\twp_mail( $_POST['email'], sprintf( __( '[%s] Email Change Request' ), $sitename ), $content );\n\n\t\t$_POST['email'] = $current_user->user_email;\n\t}\n}\n\n/**\n * Adds an admin notice alerting the user to check for confirmation request email\n * after email address change.\n *\n * @since 3.0.0\n * @since 4.9.0 This function was moved from wp-admin/includes/ms.php so it's no longer Multisite specific.\n *\n * @global string $pagenow\n */\nfunction new_user_email_admin_notice() {\n\tglobal $pagenow;\n\n\tif ( 'profile.php' === $pagenow && isset( $_GET['updated'] ) ) {\n\t\t$email = get_user_meta( get_current_user_id(), '_new_email', true );\n\t\tif ( $email ) {\n\t\t\t/* translators: %s: New email address. */\n\t\t\techo '<div class=\"notice notice-info\"><p>' . sprintf( __( 'Your email address has not been updated yet. Please check your inbox at %s for a confirmation email.' ), '<code>' . esc_html( $email['newemail'] ) . '</code>' ) . '</p></div>';\n\t\t}\n\t}\n}\n\n/**\n * Get all user privacy request types.\n *\n * @since 4.9.6\n * @access private\n *\n * @return array List of core privacy action types.\n */\nfunction _wp_privacy_action_request_types() {\n\treturn array(\n\t\t'export_personal_data',\n\t\t'remove_personal_data',\n\t);\n}\n\n/**\n * Registers the personal data exporter for users.\n *\n * @since 4.9.6\n *\n * @param array $exporters  An array of personal data exporters.\n * @return array An array of personal data exporters.\n */\nfunction wp_register_user_personal_data_exporter( $exporters ) {\n\t$exporters['wordpress-user'] = array(\n\t\t'exporter_friendly_name' => __( 'WordPress User' ),\n\t\t'callback'               => 'wp_user_personal_data_exporter',\n\t);\n\n\treturn $exporters;\n}\n\n/**\n * Finds and exports personal data associated with an email address from the user and user_meta table.\n *\n * @since 4.9.6\n * @since 5.4.0 Added 'Community Events Location' group to the export data.\n * @since 5.4.0 Added 'Session Tokens' group to the export data.\n *\n * @param string $email_address  The user's email address.\n * @return array An array of personal data.\n */\nfunction wp_user_personal_data_exporter( $email_address ) {\n\t$email_address = trim( $email_address );\n\n\t$data_to_export = array();\n\n\t$user = get_user_by( 'email', $email_address );\n\n\tif ( ! $user ) {\n\t\treturn array(\n\t\t\t'data' => array(),\n\t\t\t'done' => true,\n\t\t);\n\t}\n\n\t$user_meta = get_user_meta( $user->ID );\n\n\t$user_props_to_export = array(\n\t\t'ID'              => __( 'User ID' ),\n\t\t'user_login'      => __( 'User Login Name' ),\n\t\t'user_nicename'   => __( 'User Nice Name' ),\n\t\t'user_email'      => __( 'User Email' ),\n\t\t'user_url'        => __( 'User URL' ),\n\t\t'user_registered' => __( 'User Registration Date' ),\n\t\t'display_name'    => __( 'User Display Name' ),\n\t\t'nickname'        => __( 'User Nickname' ),\n\t\t'first_name'      => __( 'User First Name' ),\n\t\t'last_name'       => __( 'User Last Name' ),\n\t\t'description'     => __( 'User Description' ),\n\t);\n\n\t$user_data_to_export = array();\n\n\tforeach ( $user_props_to_export as $key => $name ) {\n\t\t$value = '';\n\n\t\tswitch ( $key ) {\n\t\t\tcase 'ID':\n\t\t\tcase 'user_login':\n\t\t\tcase 'user_nicename':\n\t\t\tcase 'user_email':\n\t\t\tcase 'user_url':\n\t\t\tcase 'user_registered':\n\t\t\tcase 'display_name':\n\t\t\t\t$value = $user->data->$key;\n\t\t\t\tbreak;\n\t\t\tcase 'nickname':\n\t\t\tcase 'first_name':\n\t\t\tcase 'last_name':\n\t\t\tcase 'description':\n\t\t\t\t$value = $user_meta[ $key ][0];\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( ! empty( $value ) ) {\n\t\t\t$user_data_to_export[] = array(\n\t\t\t\t'name'  => $name,\n\t\t\t\t'value' => $value,\n\t\t\t);\n\t\t}\n\t}\n\n\t// Get the list of reserved names.\n\t$reserved_names = array_values( $user_props_to_export );\n\n\t/**\n\t * Filter to extend the user's profile data for the privacy exporter.\n\t *\n\t * @since 5.4.0\n\t *\n\t * @param array    $additional_user_profile_data {\n\t *     An array of name-value pairs of additional user data items. Default empty array.\n\t *\n\t *     @type string $name  The user-facing name of an item name-value pair,e.g. 'IP Address'.\n\t *     @type string $value The user-facing value of an item data pair, e.g. '50.60.70.0'.\n\t * }\n\t * @param WP_User  $user           The user whose data is being exported.\n\t * @param string[] $reserved_names An array of reserved names. Any item in `$additional_user_data`\n\t *                                 that uses one of these for its `name` will not be included in the export.\n\t */\n\t$_extra_data = apply_filters( 'wp_privacy_additional_user_profile_data', array(), $user, $reserved_names );\n\n\tif ( is_array( $_extra_data ) && ! empty( $_extra_data ) ) {\n\t\t// Remove items that use reserved names.\n\t\t$extra_data = array_filter(\n\t\t\t$_extra_data,\n\t\t\tfunction( $item ) use ( $reserved_names ) {\n\t\t\t\treturn ! in_array( $item['name'], $reserved_names, true );\n\t\t\t}\n\t\t);\n\n\t\tif ( count( $extra_data ) !== count( $_extra_data ) ) {\n\t\t\t_doing_it_wrong(\n\t\t\t\t__FUNCTION__,\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: wp_privacy_additional_user_profile_data */\n\t\t\t\t\t__( 'Filter %s returned items with reserved names.' ),\n\t\t\t\t\t'<code>wp_privacy_additional_user_profile_data</code>'\n\t\t\t\t),\n\t\t\t\t'5.4.0'\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $extra_data ) ) {\n\t\t\t$user_data_to_export = array_merge( $user_data_to_export, $extra_data );\n\t\t}\n\t}\n\n\t$data_to_export[] = array(\n\t\t'group_id'          => 'user',\n\t\t'group_label'       => __( 'User' ),\n\t\t'group_description' => __( 'User&#8217;s profile data.' ),\n\t\t'item_id'           => \"user-{$user->ID}\",\n\t\t'data'              => $user_data_to_export,\n\t);\n\n\tif ( isset( $user_meta['community-events-location'] ) ) {\n\t\t$location = maybe_unserialize( $user_meta['community-events-location'][0] );\n\n\t\t$location_props_to_export = array(\n\t\t\t'description' => __( 'City' ),\n\t\t\t'country'     => __( 'Country' ),\n\t\t\t'latitude'    => __( 'Latitude' ),\n\t\t\t'longitude'   => __( 'Longitude' ),\n\t\t\t'ip'          => __( 'IP' ),\n\t\t);\n\n\t\t$location_data_to_export = array();\n\n\t\tforeach ( $location_props_to_export as $key => $name ) {\n\t\t\tif ( ! empty( $location[ $key ] ) ) {\n\t\t\t\t$location_data_to_export[] = array(\n\t\t\t\t\t'name'  => $name,\n\t\t\t\t\t'value' => $location[ $key ],\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$data_to_export[] = array(\n\t\t\t'group_id'          => 'community-events-location',\n\t\t\t'group_label'       => __( 'Community Events Location' ),\n\t\t\t'group_description' => __( 'User&#8217;s location data used for the Community Events in the WordPress Events and News dashboard widget.' ),\n\t\t\t'item_id'           => \"community-events-location-{$user->ID}\",\n\t\t\t'data'              => $location_data_to_export,\n\t\t);\n\t}\n\n\tif ( isset( $user_meta['session_tokens'] ) ) {\n\t\t$session_tokens = maybe_unserialize( $user_meta['session_tokens'][0] );\n\n\t\t$session_tokens_props_to_export = array(\n\t\t\t'expiration' => __( 'Expiration' ),\n\t\t\t'ip'         => __( 'IP' ),\n\t\t\t'ua'         => __( 'User Agent' ),\n\t\t\t'login'      => __( 'Last Login' ),\n\t\t);\n\n\t\tforeach ( $session_tokens as $token_key => $session_token ) {\n\t\t\t$session_tokens_data_to_export = array();\n\n\t\t\tforeach ( $session_tokens_props_to_export as $key => $name ) {\n\t\t\t\tif ( ! empty( $session_token[ $key ] ) ) {\n\t\t\t\t\t$value = $session_token[ $key ];\n\t\t\t\t\tif ( in_array( $key, array( 'expiration', 'login' ), true ) ) {\n\t\t\t\t\t\t$value = date_i18n( 'F d, Y H:i A', $value );\n\t\t\t\t\t}\n\t\t\t\t\t$session_tokens_data_to_export[] = array(\n\t\t\t\t\t\t'name'  => $name,\n\t\t\t\t\t\t'value' => $value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$data_to_export[] = array(\n\t\t\t\t'group_id'          => 'session-tokens',\n\t\t\t\t'group_label'       => __( 'Session Tokens' ),\n\t\t\t\t'group_description' => __( 'User&#8217;s Session Tokens data.' ),\n\t\t\t\t'item_id'           => \"session-tokens-{$user->ID}-{$token_key}\",\n\t\t\t\t'data'              => $session_tokens_data_to_export,\n\t\t\t);\n\t\t}\n\t}\n\n\treturn array(\n\t\t'data' => $data_to_export,\n\t\t'done' => true,\n\t);\n}\n\n/**\n * Update log when privacy request is confirmed.\n *\n * @since 4.9.6\n * @access private\n *\n * @param int $request_id ID of the request.\n */\nfunction _wp_privacy_account_request_confirmed( $request_id ) {\n\t$request = wp_get_user_request( $request_id );\n\n\tif ( ! $request ) {\n\t\treturn;\n\t}\n\n\tif ( ! in_array( $request->status, array( 'request-pending', 'request-failed' ), true ) ) {\n\t\treturn;\n\t}\n\n\tupdate_post_meta( $request_id, '_wp_user_request_confirmed_timestamp', time() );\n\twp_update_post(\n\t\tarray(\n\t\t\t'ID'          => $request_id,\n\t\t\t'post_status' => 'request-confirmed',\n\t\t)\n\t);\n}\n\n/**\n * Notify the site administrator via email when a request is confirmed.\n *\n * Without this, the admin would have to manually check the site to see if any\n * action was needed on their part yet.\n *\n * @since 4.9.6\n *\n * @param int $request_id The ID of the request.\n */\nfunction _wp_privacy_send_request_confirmation_notification( $request_id ) {\n\t$request = wp_get_user_request( $request_id );\n\n\tif ( ! is_a( $request, 'WP_User_Request' ) || 'request-confirmed' !== $request->status ) {\n\t\treturn;\n\t}\n\n\t$already_notified = (bool) get_post_meta( $request_id, '_wp_admin_notified', true );\n\n\tif ( $already_notified ) {\n\t\treturn;\n\t}\n\n\tif ( 'export_personal_data' === $request->action_name ) {\n\t\t$manage_url = admin_url( 'export-personal-data.php' );\n\t} elseif ( 'remove_personal_data' === $request->action_name ) {\n\t\t$manage_url = admin_url( 'erase-personal-data.php' );\n\t}\n\t$action_description = wp_user_request_action_description( $request->action_name );\n\n\t/**\n\t * Filters the recipient of the data request confirmation notification.\n\t *\n\t * In a Multisite environment, this will default to the email address of the\n\t * network admin because, by default, single site admins do not have the\n\t * capabilities required to process requests. Some networks may wish to\n\t * delegate those capabilities to a single-site admin, or a dedicated person\n\t * responsible for managing privacy requests.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param string          $admin_email The email address of the notification recipient.\n\t * @param WP_User_Request $request     The request that is initiating the notification.\n\t */\n\t$admin_email = apply_filters( 'user_request_confirmed_email_to', get_site_option( 'admin_email' ), $request );\n\n\t$email_data = array(\n\t\t'request'     => $request,\n\t\t'user_email'  => $request->email,\n\t\t'description' => $action_description,\n\t\t'manage_url'  => $manage_url,\n\t\t'sitename'    => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ),\n\t\t'siteurl'     => home_url(),\n\t\t'admin_email' => $admin_email,\n\t);\n\n\t/* translators: Do not translate SITENAME, USER_EMAIL, DESCRIPTION, MANAGE_URL, SITEURL; those are placeholders. */\n\t$email_text = __(\n\t\t'Howdy,\n\nA user data privacy request has been confirmed on ###SITENAME###:\n\nUser: ###USER_EMAIL###\nRequest: ###DESCRIPTION###\n\nYou can view and manage these data privacy requests here:\n\n###MANAGE_URL###\n\nRegards,\nAll at ###SITENAME###\n###SITEURL###'\n\t);\n\n\t/**\n\t * Filters the body of the user request confirmation email.\n\t *\n\t * The email is sent to an administrator when an user request is confirmed.\n\t * The following strings have a special meaning and will get replaced dynamically:\n\t *\n\t * ###SITENAME###    The name of the site.\n\t * ###USER_EMAIL###  The user email for the request.\n\t * ###DESCRIPTION### Description of the action being performed so the user knows what the email is for.\n\t * ###MANAGE_URL###  The URL to manage requests.\n\t * ###SITEURL###     The URL to the site.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param string $email_text Text in the email.\n\t * @param array  $email_data {\n\t *     Data relating to the account action email.\n\t *\n\t *     @type WP_User_Request $request     User request object.\n\t *     @type string          $user_email  The email address confirming a request\n\t *     @type string          $description Description of the action being performed so the user knows what the email is for.\n\t *     @type string          $manage_url  The link to click manage privacy requests of this type.\n\t *     @type string          $sitename    The site name sending the mail.\n\t *     @type string          $siteurl     The site URL sending the mail.\n\t *     @type string          $admin_email The administrator email receiving the mail.\n\t * }\n\t */\n\t$content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data );\n\n\t$content = str_replace( '###SITENAME###', $email_data['sitename'], $content );\n\t$content = str_replace( '###USER_EMAIL###', $email_data['user_email'], $content );\n\t$content = str_replace( '###DESCRIPTION###', $email_data['description'], $content );\n\t$content = str_replace( '###MANAGE_URL###', esc_url_raw( $email_data['manage_url'] ), $content );\n\t$content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );\n\n\t$subject = sprintf(\n\t\t/* translators: Privacy data request confirmed notification email subject. 1: Site title, 2: Name of the confirmed action. */\n\t\t__( '[%1$s] Action Confirmed: %2$s' ),\n\t\t$email_data['sitename'],\n\t\t$action_description\n\t);\n\n\t/**\n\t * Filters the subject of the user request confirmation email.\n\t *\n\t * @since 4.9.8\n\t *\n\t * @param string $subject    The email subject.\n\t * @param string $sitename   The name of the site.\n\t * @param array  $email_data {\n\t *     Data relating to the account action email.\n\t *\n\t *     @type WP_User_Request $request     User request object.\n\t *     @type string          $user_email  The email address confirming a request\n\t *     @type string          $description Description of the action being performed so the user knows what the email is for.\n\t *     @type string          $manage_url  The link to click manage privacy requests of this type.\n\t *     @type string          $sitename    The site name sending the mail.\n\t *     @type string          $siteurl     The site URL sending the mail.\n\t *     @type string          $admin_email The administrator email receiving the mail.\n\t * }\n\t */\n\t$subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $email_data['sitename'], $email_data );\n\n\t$headers = '';\n\n\t/**\n\t * Filters the headers of the user request confirmation email.\n\t *\n\t * @since 5.4.0\n\t *\n\t * @param string|array $headers    The email headers.\n\t * @param string       $subject    The email subject.\n\t * @param string       $content    The email content.\n\t * @param int          $request_id The request ID.\n\t * @param array        $email_data {\n\t *     Data relating to the account action email.\n\t *\n\t *     @type WP_User_Request $request     User request object.\n\t *     @type string          $user_email  The email address confirming a request\n\t *     @type string          $description Description of the action being performed so the user knows what the email is for.\n\t *     @type string          $manage_url  The link to click manage privacy requests of this type.\n\t *     @type string          $sitename    The site name sending the mail.\n\t *     @type string          $siteurl     The site URL sending the mail.\n\t *     @type string          $admin_email The administrator email receiving the mail.\n\t * }\n\t */\n\t$headers = apply_filters( 'user_request_confirmed_email_headers', $headers, $subject, $content, $request_id, $email_data );\n\n\t$email_sent = wp_mail( $email_data['admin_email'], $subject, $content, $headers );\n\n\tif ( $email_sent ) {\n\t\tupdate_post_meta( $request_id, '_wp_admin_notified', true );\n\t}\n}\n\n/**\n * Notify the user when their erasure request is fulfilled.\n *\n * Without this, the user would never know if their data was actually erased.\n *\n * @since 4.9.6\n *\n * @param int $request_id The privacy request post ID associated with this request.\n */\nfunction _wp_privacy_send_erasure_fulfillment_notification( $request_id ) {\n\t$request = wp_get_user_request( $request_id );\n\n\tif ( ! is_a( $request, 'WP_User_Request' ) || 'request-completed' !== $request->status ) {\n\t\treturn;\n\t}\n\n\t$already_notified = (bool) get_post_meta( $request_id, '_wp_user_notified', true );\n\n\tif ( $already_notified ) {\n\t\treturn;\n\t}\n\n\t// Localize message content for user; fallback to site default for visitors.\n\tif ( ! empty( $request->user_id ) ) {\n\t\t$locale = get_user_locale( $request->user_id );\n\t} else {\n\t\t$locale = get_locale();\n\t}\n\n\t$switched_locale = switch_to_locale( $locale );\n\n\t/**\n\t * Filters the recipient of the data erasure fulfillment notification.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param string          $user_email The email address of the notification recipient.\n\t * @param WP_User_Request $request    The request that is initiating the notification.\n\t */\n\t$user_email = apply_filters( 'user_erasure_fulfillment_email_to', $request->email, $request );\n\n\t$email_data = array(\n\t\t'request'            => $request,\n\t\t'message_recipient'  => $user_email,\n\t\t'privacy_policy_url' => get_privacy_policy_url(),\n\t\t'sitename'           => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ),\n\t\t'siteurl'            => home_url(),\n\t);\n\n\t$subject = sprintf(\n\t\t/* translators: Erasure request fulfilled notification email subject. %s: Site title. */\n\t\t__( '[%s] Erasure Request Fulfilled' ),\n\t\t$email_data['sitename']\n\t);\n\n\t/**\n\t * Filters the subject of the email sent when an erasure request is completed.\n\t *\n\t * @since 4.9.8\n\t *\n\t * @param string $subject    The email subject.\n\t * @param string $sitename   The name of the site.\n\t * @param array  $email_data {\n\t *     Data relating to the account action email.\n\t *\n\t *     @type WP_User_Request $request            User request object.\n\t *     @type string          $message_recipient  The address that the email will be sent to. Defaults\n\t *                                               to the value of `$request->email`, but can be changed\n\t *                                               by the `user_erasure_fulfillment_email_to` filter.\n\t *     @type string          $privacy_policy_url Privacy policy URL.\n\t *     @type string          $sitename           The site name sending the mail.\n\t *     @type string          $siteurl            The site URL sending the mail.\n\t * }\n\t */\n\t$subject = apply_filters( 'user_erasure_complete_email_subject', $subject, $email_data['sitename'], $email_data );\n\n\tif ( empty( $email_data['privacy_policy_url'] ) ) {\n\t\t/* translators: Do not translate SITENAME, SITEURL; those are placeholders. */\n\t\t$email_text = __(\n\t\t\t'Howdy,\n\nYour request to erase your personal data on ###SITENAME### has been completed.\n\nIf you have any follow-up questions or concerns, please contact the site administrator.\n\nRegards,\nAll at ###SITENAME###\n###SITEURL###'\n\t\t);\n\t} else {\n\t\t/* translators: Do not translate SITENAME, SITEURL, PRIVACY_POLICY_URL; those are placeholders. */\n\t\t$email_text = __(\n\t\t\t'Howdy,\n\nYour request to erase your personal data on ###SITENAME### has been completed.\n\nIf you have any follow-up questions or concerns, please contact the site administrator.\n\nFor more information, you can also read our privacy policy: ###PRIVACY_POLICY_URL###\n\nRegards,\nAll at ###SITENAME###\n###SITEURL###'\n\t\t);\n\t}\n\n\t/**\n\t * Filters the body of the data erasure fulfillment notification.\n\t *\n\t * The email is sent to a user when a their data erasure request is fulfilled\n\t * by an administrator.\n\t *\n\t * The following strings have a special meaning and will get replaced dynamically:\n\t *\n\t * ###SITENAME###           The name of the site.\n\t * ###PRIVACY_POLICY_URL### Privacy policy page URL.\n\t * ###SITEURL###            The URL to the site.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param string $email_text Text in the email.\n\t * @param array  $email_data {\n\t *     Data relating to the account action email.\n\t *\n\t *     @type WP_User_Request $request            User request object.\n\t *     @type string          $message_recipient  The address that the email will be sent to. Defaults\n\t *                                               to the value of `$request->email`, but can be changed\n\t *                                               by the `user_erasure_fulfillment_email_to` filter.\n\t *     @type string          $privacy_policy_url Privacy policy URL.\n\t *     @type string          $sitename           The site name sending the mail.\n\t *     @type string          $siteurl            The site URL sending the mail.\n\t * }\n\t */\n\t$content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data );\n\n\t$content = str_replace( '###SITENAME###', $email_data['sitename'], $content );\n\t$content = str_replace( '###PRIVACY_POLICY_URL###', $email_data['privacy_policy_url'], $content );\n\t$content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );\n\n\t$headers = '';\n\n\t/**\n\t * Filters the headers of the data erasure fulfillment notification.\n\t *\n\t * @since 5.4.0\n\t *\n\t * @param string|array $headers    The email headers.\n\t * @param string       $subject    The email subject.\n\t * @param string       $content    The email content.\n\t * @param int          $request_id The request ID.\n\t * @param array        $email_data {\n\t *     Data relating to the account action email.\n\t *\n\t *     @type WP_User_Request $request            User request object.\n\t *     @type string          $message_recipient  The address that the email will be sent to. Defaults\n\t *                                               to the value of `$request->email`, but can be changed\n\t *                                               by the `user_erasure_fulfillment_email_to` filter.\n\t *     @type string          $privacy_policy_url Privacy policy URL.\n\t *     @type string          $sitename           The site name sending the mail.\n\t *     @type string          $siteurl            The site URL sending the mail.\n\t * }\n\t */\n\t$headers = apply_filters( 'user_erasure_complete_email_headers', $headers, $subject, $content, $request_id, $email_data );\n\n\t$email_sent = wp_mail( $user_email, $subject, $content, $headers );\n\n\tif ( $switched_locale ) {\n\t\trestore_previous_locale();\n\t}\n\n\tif ( $email_sent ) {\n\t\tupdate_post_meta( $request_id, '_wp_user_notified', true );\n\t}\n}\n\n/**\n * Return request confirmation message HTML.\n *\n * @since 4.9.6\n * @access private\n *\n * @param int $request_id The request ID being confirmed.\n * @return string The confirmation message.\n */\nfunction _wp_privacy_account_request_confirmed_message( $request_id ) {\n\t$request = wp_get_user_request( $request_id );\n\n\t$message  = '<p class=\"success\">' . __( 'Action has been confirmed.' ) . '</p>';\n\t$message .= '<p>' . __( 'The site administrator has been notified and will fulfill your request as soon as possible.' ) . '</p>';\n\n\tif ( $request && in_array( $request->action_name, _wp_privacy_action_request_types(), true ) ) {\n\t\tif ( 'export_personal_data' === $request->action_name ) {\n\t\t\t$message  = '<p class=\"success\">' . __( 'Thanks for confirming your export request.' ) . '</p>';\n\t\t\t$message .= '<p>' . __( 'The site administrator has been notified. You will receive a link to download your export via email when they fulfill your request.' ) . '</p>';\n\t\t} elseif ( 'remove_personal_data' === $request->action_name ) {\n\t\t\t$message  = '<p class=\"success\">' . __( 'Thanks for confirming your erasure request.' ) . '</p>';\n\t\t\t$message .= '<p>' . __( 'The site administrator has been notified. You will receive an email confirmation when they erase your data.' ) . '</p>';\n\t\t}\n\t}\n\n\t/**\n\t * Filters the message displayed to a user when they confirm a data request.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param string $message    The message to the user.\n\t * @param int    $request_id The ID of the request being confirmed.\n\t */\n\t$message = apply_filters( 'user_request_action_confirmed_message', $message, $request_id );\n\n\treturn $message;\n}\n\n/**\n * Create and log a user request to perform a specific action.\n *\n * Requests are stored inside a post type named `user_request` since they can apply to both\n * users on the site, or guests without a user account.\n *\n * @since 4.9.6\n *\n * @param string $email_address User email address. This can be the address of a registered or non-registered user.\n * @param string $action_name   Name of the action that is being confirmed. Required.\n * @param array  $request_data  Misc data you want to send with the verification request and pass to the actions once the request is confirmed.\n * @return int|WP_Error Returns the request ID if successful, or a WP_Error object on failure.\n */\nfunction wp_create_user_request( $email_address = '', $action_name = '', $request_data = array() ) {\n\t$email_address = sanitize_email( $email_address );\n\t$action_name   = sanitize_key( $action_name );\n\n\tif ( ! is_email( $email_address ) ) {\n\t\treturn new WP_Error( 'invalid_email', __( 'Invalid email address.' ) );\n\t}\n\n\tif ( ! $action_name ) {\n\t\treturn new WP_Error( 'invalid_action', __( 'Invalid action name.' ) );\n\t}\n\n\t$user    = get_user_by( 'email', $email_address );\n\t$user_id = $user && ! is_wp_error( $user ) ? $user->ID : 0;\n\n\t// Check for duplicates.\n\t$requests_query = new WP_Query(\n\t\tarray(\n\t\t\t'post_type'     => 'user_request',\n\t\t\t'post_name__in' => array( $action_name ), // Action name stored in post_name column.\n\t\t\t'title'         => $email_address,        // Email address stored in post_title column.\n\t\t\t'post_status'   => array(\n\t\t\t\t'request-pending',\n\t\t\t\t'request-confirmed',\n\t\t\t),\n\t\t\t'fields'        => 'ids',\n\t\t)\n\t);\n\n\tif ( $requests_query->found_posts ) {\n\t\treturn new WP_Error( 'duplicate_request', __( 'An incomplete request for this email address already exists.' ) );\n\t}\n\n\t$request_id = wp_insert_post(\n\t\tarray(\n\t\t\t'post_author'   => $user_id,\n\t\t\t'post_name'     => $action_name,\n\t\t\t'post_title'    => $email_address,\n\t\t\t'post_content'  => wp_json_encode( $request_data ),\n\t\t\t'post_status'   => 'request-pending',\n\t\t\t'post_type'     => 'user_request',\n\t\t\t'post_date'     => current_time( 'mysql', false ),\n\t\t\t'post_date_gmt' => current_time( 'mysql', true ),\n\t\t),\n\t\ttrue\n\t);\n\n\treturn $request_id;\n}\n\n/**\n * Get action description from the name and return a string.\n *\n * @since 4.9.6\n *\n * @param string $action_name Action name of the request.\n * @return string Human readable action name.\n */\nfunction wp_user_request_action_description( $action_name ) {\n\tswitch ( $action_name ) {\n\t\tcase 'export_personal_data':\n\t\t\t$description = __( 'Export Personal Data' );\n\t\t\tbreak;\n\t\tcase 'remove_personal_data':\n\t\t\t$description = __( 'Erase Personal Data' );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t/* translators: %s: Action name. */\n\t\t\t$description = sprintf( __( 'Confirm the \"%s\" action' ), $action_name );\n\t\t\tbreak;\n\t}\n\n\t/**\n\t * Filters the user action description.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param string $description The default description.\n\t * @param string $action_name The name of the request.\n\t */\n\treturn apply_filters( 'user_request_action_description', $description, $action_name );\n}\n\n/**\n * Send a confirmation request email to confirm an action.\n *\n * If the request is not already pending, it will be updated.\n *\n * @since 4.9.6\n *\n * @param string $request_id ID of the request created via wp_create_user_request().\n * @return bool|WP_Error True on success, `WP_Error` on failure.\n */\nfunction wp_send_user_request( $request_id ) {\n\t$request_id = absint( $request_id );\n\t$request    = wp_get_user_request( $request_id );\n\n\tif ( ! $request ) {\n\t\treturn new WP_Error( 'invalid_request', __( 'Invalid user request.' ) );\n\t}\n\n\t// Localize message content for user; fallback to site default for visitors.\n\tif ( ! empty( $request->user_id ) ) {\n\t\t$locale = get_user_locale( $request->user_id );\n\t} else {\n\t\t$locale = get_locale();\n\t}\n\n\t$switched_locale = switch_to_locale( $locale );\n\n\t$email_data = array(\n\t\t'request'     => $request,\n\t\t'email'       => $request->email,\n\t\t'description' => wp_user_request_action_description( $request->action_name ),\n\t\t'confirm_url' => add_query_arg(\n\t\t\tarray(\n\t\t\t\t'action'      => 'confirmaction',\n\t\t\t\t'request_id'  => $request_id,\n\t\t\t\t'confirm_key' => wp_generate_user_request_key( $request_id ),\n\t\t\t),\n\t\t\twp_login_url()\n\t\t),\n\t\t'sitename'    => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ),\n\t\t'siteurl'     => home_url(),\n\t);\n\n\t/* translators: Do not translate DESCRIPTION, CONFIRM_URL, SITENAME, SITEURL: those are placeholders. */\n\t$email_text = __(\n\t\t'Howdy,\n\nA request has been made to perform the following action on your account:\n\n     ###DESCRIPTION###\n\nTo confirm this, please click on the following link:\n###CONFIRM_URL###\n\nYou can safely ignore and delete this email if you do not want to\ntake this action.\n\nRegards,\nAll at ###SITENAME###\n###SITEURL###'\n\t);\n\n\t/**\n\t * Filters the text of the email sent when an account action is attempted.\n\t *\n\t * The following strings have a special meaning and will get replaced dynamically:\n\t *\n\t * ###DESCRIPTION### Description of the action being performed so the user knows what the email is for.\n\t * ###CONFIRM_URL### The link to click on to confirm the account action.\n\t * ###SITENAME###    The name of the site.\n\t * ###SITEURL###     The URL to the site.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param string $email_text Text in the email.\n\t * @param array  $email_data {\n\t *     Data relating to the account action email.\n\t *\n\t *     @type WP_User_Request $request     User request object.\n\t *     @type string          $email       The email address this is being sent to.\n\t *     @type string          $description Description of the action being performed so the user knows what the email is for.\n\t *     @type string          $confirm_url The link to click on to confirm the account action.\n\t *     @type string          $sitename    The site name sending the mail.\n\t *     @type string          $siteurl     The site URL sending the mail.\n\t * }\n\t */\n\t$content = apply_filters( 'user_request_action_email_content', $email_text, $email_data );\n\n\t$content = str_replace( '###DESCRIPTION###', $email_data['description'], $content );\n\t$content = str_replace( '###CONFIRM_URL###', esc_url_raw( $email_data['confirm_url'] ), $content );\n\t$content = str_replace( '###EMAIL###', $email_data['email'], $content );\n\t$content = str_replace( '###SITENAME###', $email_data['sitename'], $content );\n\t$content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );\n\n\t/* translators: Confirm privacy data request notification email subject. 1: Site title, 2: Name of the action. */\n\t$subject = sprintf( __( '[%1$s] Confirm Action: %2$s' ), $email_data['sitename'], $email_data['description'] );\n\n\t/**\n\t * Filters the subject of the email sent when an account action is attempted.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param string $subject    The email subject.\n\t * @param string $sitename   The name of the site.\n\t * @param array  $email_data {\n\t *     Data relating to the account action email.\n\t *\n\t *     @type WP_User_Request $request     User request object.\n\t *     @type string          $email       The email address this is being sent to.\n\t *     @type string          $description Description of the action being performed so the user knows what the email is for.\n\t *     @type string          $confirm_url The link to click on to confirm the account action.\n\t *     @type string          $sitename    The site name sending the mail.\n\t *     @type string          $siteurl     The site URL sending the mail.\n\t * }\n\t */\n\t$subject = apply_filters( 'user_request_action_email_subject', $subject, $email_data['sitename'], $email_data );\n\n\t$headers = '';\n\n\t/**\n\t * Filters the headers of the email sent when an account action is attempted.\n\t *\n\t * @since 5.4.0\n\t *\n\t * @param string|array $headers    The email headers.\n\t * @param string       $subject    The email subject.\n\t * @param string       $content    The email content.\n\t * @param int          $request_id The request ID.\n\t * @param array        $email_data {\n\t *     Data relating to the account action email.\n\t *\n\t *     @type WP_User_Request $request     User request object.\n\t *     @type string          $email       The email address this is being sent to.\n\t *     @type string          $description Description of the action being performed so the user knows what the email is for.\n\t *     @type string          $confirm_url The link to click on to confirm the account action.\n\t *     @type string          $sitename    The site name sending the mail.\n\t *     @type string          $siteurl     The site URL sending the mail.\n\t * }\n\t */\n\t$headers = apply_filters( 'user_request_action_email_headers', $headers, $subject, $content, $request_id, $email_data );\n\n\t$email_sent = wp_mail( $email_data['email'], $subject, $content, $headers );\n\n\tif ( $switched_locale ) {\n\t\trestore_previous_locale();\n\t}\n\n\tif ( ! $email_sent ) {\n\t\treturn new WP_Error( 'privacy_email_error', __( 'Unable to send personal data export confirmation email.' ) );\n\t}\n\n\treturn true;\n}\n\n/**\n * Returns a confirmation key for a user action and stores the hashed version for future comparison.\n *\n * @since 4.9.6\n *\n * @param int $request_id Request ID.\n * @return string Confirmation key.\n */\nfunction wp_generate_user_request_key( $request_id ) {\n\tglobal $wp_hasher;\n\n\t// Generate something random for a confirmation key.\n\t$key = wp_generate_password( 20, false );\n\n\t// Return the key, hashed.\n\tif ( empty( $wp_hasher ) ) {\n\t\trequire_once ABSPATH . WPINC . '/class-phpass.php';\n\t\t$wp_hasher = new PasswordHash( 8, true );\n\t}\n\n\twp_update_post(\n\t\tarray(\n\t\t\t'ID'            => $request_id,\n\t\t\t'post_status'   => 'request-pending',\n\t\t\t'post_password' => $wp_hasher->HashPassword( $key ),\n\t\t)\n\t);\n\n\treturn $key;\n}\n\n/**\n * Validate a user request by comparing the key with the request's key.\n *\n * @since 4.9.6\n *\n * @param string $request_id ID of the request being confirmed.\n * @param string $key        Provided key to validate.\n * @return bool|WP_Error True on success, WP_Error on failure.\n */\nfunction wp_validate_user_request_key( $request_id, $key ) {\n\tglobal $wp_hasher;\n\n\t$request_id = absint( $request_id );\n\t$request    = wp_get_user_request( $request_id );\n\n\tif ( ! $request ) {\n\t\treturn new WP_Error( 'invalid_request', __( 'Invalid request.' ) );\n\t}\n\n\tif ( ! in_array( $request->status, array( 'request-pending', 'request-failed' ), true ) ) {\n\t\treturn new WP_Error( 'expired_link', __( 'This link has expired.' ) );\n\t}\n\n\tif ( empty( $key ) ) {\n\t\treturn new WP_Error( 'missing_key', __( 'Missing confirm key.' ) );\n\t}\n\n\tif ( empty( $wp_hasher ) ) {\n\t\trequire_once ABSPATH . WPINC . '/class-phpass.php';\n\t\t$wp_hasher = new PasswordHash( 8, true );\n\t}\n\n\t$key_request_time = $request->modified_timestamp;\n\t$saved_key        = $request->confirm_key;\n\n\tif ( ! $saved_key ) {\n\t\treturn new WP_Error( 'invalid_key', __( 'Invalid key.' ) );\n\t}\n\n\tif ( ! $key_request_time ) {\n\t\treturn new WP_Error( 'invalid_key', __( 'Invalid action.' ) );\n\t}\n\n\t/**\n\t * Filters the expiration time of confirm keys.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param int $expiration The expiration time in seconds.\n\t */\n\t$expiration_duration = (int) apply_filters( 'user_request_key_expiration', DAY_IN_SECONDS );\n\t$expiration_time     = $key_request_time + $expiration_duration;\n\n\tif ( ! $wp_hasher->CheckPassword( $key, $saved_key ) ) {\n\t\treturn new WP_Error( 'invalid_key', __( 'Invalid key.' ) );\n\t}\n\n\tif ( ! $expiration_time || time() > $expiration_time ) {\n\t\treturn new WP_Error( 'expired_key', __( 'The confirmation email has expired.' ) );\n\t}\n\n\treturn true;\n}\n\n/**\n * Return the user request object for the specified request ID.\n *\n * @since 4.9.6\n *\n * @param int $request_id The ID of the user request.\n * @return WP_User_Request|false\n */\nfunction wp_get_user_request( $request_id ) {\n\t$request_id = absint( $request_id );\n\t$post       = get_post( $request_id );\n\n\tif ( ! $post || 'user_request' !== $post->post_type ) {\n\t\treturn false;\n\t}\n\n\treturn new WP_User_Request( $post );\n}\n", "num_lines": 3930}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Creates common globals for the rest of WordPress\n *\n * Sets $pagenow global which is the current page. Checks\n * for the browser to set which one is currently being used.\n *\n * Detects which user environment WordPress is being used on.\n * Only attempts to check for Apache, Nginx and IIS -- three web\n * servers with known pretty permalink capability.\n *\n * Note: Though Nginx is detected, WordPress does not currently\n * generate rewrite rules for it. See https://wordpress.org/support/article/nginx/\n *\n * @package WordPress\n */\n\nglobal $pagenow,\n\t$is_lynx, $is_gecko, $is_winIE, $is_macIE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone, $is_IE, $is_edge,\n\t$is_apache, $is_IIS, $is_iis7, $is_nginx;\n\n// On which page are we?\nif ( is_admin() ) {\n\t// wp-admin pages are checked more carefully.\n\tif ( is_network_admin() ) {\n\t\tpreg_match( '#/wp-admin/network/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches );\n\t} elseif ( is_user_admin() ) {\n\t\tpreg_match( '#/wp-admin/user/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches );\n\t} else {\n\t\tpreg_match( '#/wp-admin/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches );\n\t}\n\t$pagenow = $self_matches[1];\n\t$pagenow = trim( $pagenow, '/' );\n\t$pagenow = preg_replace( '#\\?.*?$#', '', $pagenow );\n\tif ( '' === $pagenow || 'index' === $pagenow || 'index.php' === $pagenow ) {\n\t\t$pagenow = 'index.php';\n\t} else {\n\t\tpreg_match( '#(.*?)(/|$)#', $pagenow, $self_matches );\n\t\t$pagenow = strtolower( $self_matches[1] );\n\t\tif ( '.php' !== substr( $pagenow, -4, 4 ) ) {\n\t\t\t$pagenow .= '.php'; // For `Options +Multiviews`: /wp-admin/themes/index.php (themes.php is queried).\n\t\t}\n\t}\n} else {\n\tif ( preg_match( '#([^/]+\\.php)([?/].*?)?$#i', $_SERVER['PHP_SELF'], $self_matches ) ) {\n\t\t$pagenow = strtolower( $self_matches[1] );\n\t} else {\n\t\t$pagenow = 'index.php';\n\t}\n}\nunset( $self_matches );\n\n// Simple browser detection.\n$is_lynx   = false;\n$is_gecko  = false;\n$is_winIE  = false;\n$is_macIE  = false;\n$is_opera  = false;\n$is_NS4    = false;\n$is_safari = false;\n$is_chrome = false;\n$is_iphone = false;\n$is_edge   = false;\n\nif ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) {\n\tif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Lynx' ) !== false ) {\n\t\t$is_lynx = true;\n\t} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Edge' ) !== false ) {\n\t\t$is_edge = true;\n\t} elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'chrome' ) !== false ) {\n\t\tif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'chromeframe' ) !== false ) {\n\t\t\t$is_admin = is_admin();\n\t\t\t/**\n\t\t\t * Filters whether Google Chrome Frame should be used, if available.\n\t\t\t *\n\t\t\t * @since 3.2.0\n\t\t\t *\n\t\t\t * @param bool $is_admin Whether to use the Google Chrome Frame. Default is the value of is_admin().\n\t\t\t */\n\t\t\t$is_chrome = apply_filters( 'use_google_chrome_frame', $is_admin );\n\t\t\tif ( $is_chrome ) {\n\t\t\t\theader( 'X-UA-Compatible: chrome=1' );\n\t\t\t}\n\t\t\t$is_winIE = ! $is_chrome;\n\t\t} else {\n\t\t\t$is_chrome = true;\n\t\t}\n\t} elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'safari' ) !== false ) {\n\t\t$is_safari = true;\n\t} elseif ( ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false || strpos( $_SERVER['HTTP_USER_AGENT'], 'Trident' ) !== false ) && strpos( $_SERVER['HTTP_USER_AGENT'], 'Win' ) !== false ) {\n\t\t$is_winIE = true;\n\t} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false && strpos( $_SERVER['HTTP_USER_AGENT'], 'Mac' ) !== false ) {\n\t\t$is_macIE = true;\n\t} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Gecko' ) !== false ) {\n\t\t$is_gecko = true;\n\t} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Opera' ) !== false ) {\n\t\t$is_opera = true;\n\t} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Nav' ) !== false && strpos( $_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.' ) !== false ) {\n\t\t$is_NS4 = true;\n\t}\n}\n\nif ( $is_safari && stripos( $_SERVER['HTTP_USER_AGENT'], 'mobile' ) !== false ) {\n\t$is_iphone = true;\n}\n\n$is_IE = ( $is_macIE || $is_winIE );\n\n// Server detection.\n\n/**\n * Whether the server software is Apache or something else\n *\n * @global bool $is_apache\n */\n$is_apache = ( strpos( $_SERVER['SERVER_SOFTWARE'], 'Apache' ) !== false || strpos( $_SERVER['SERVER_SOFTWARE'], 'LiteSpeed' ) !== false );\n\n/**\n * Whether the server software is Nginx or something else\n *\n * @global bool $is_nginx\n */\n$is_nginx = ( strpos( $_SERVER['SERVER_SOFTWARE'], 'nginx' ) !== false );\n\n/**\n * Whether the server software is IIS or something else\n *\n * @global bool $is_IIS\n */\n$is_IIS = ! $is_apache && ( strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) !== false || strpos( $_SERVER['SERVER_SOFTWARE'], 'ExpressionDevServer' ) !== false );\n\n/**\n * Whether the server software is IIS 7.X or greater\n *\n * @global bool $is_iis7\n */\n$is_iis7 = $is_IIS && intval( substr( $_SERVER['SERVER_SOFTWARE'], strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/' ) + 14 ) ) >= 7;\n\n/**\n * Test if the current browser runs on a mobile device (smart phone, tablet, etc.)\n *\n * @since 3.4.0\n *\n * @return bool\n */\nfunction wp_is_mobile() {\n\tif ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {\n\t\t$is_mobile = false;\n\t} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Mobile' ) !== false // Many mobile devices (all iPhone, iPad, etc.)\n\t\t|| strpos( $_SERVER['HTTP_USER_AGENT'], 'Android' ) !== false\n\t\t|| strpos( $_SERVER['HTTP_USER_AGENT'], 'Silk/' ) !== false\n\t\t|| strpos( $_SERVER['HTTP_USER_AGENT'], 'Kindle' ) !== false\n\t\t|| strpos( $_SERVER['HTTP_USER_AGENT'], 'BlackBerry' ) !== false\n\t\t|| strpos( $_SERVER['HTTP_USER_AGENT'], 'Opera Mini' ) !== false\n\t\t|| strpos( $_SERVER['HTTP_USER_AGENT'], 'Opera Mobi' ) !== false ) {\n\t\t\t$is_mobile = true;\n\t} else {\n\t\t$is_mobile = false;\n\t}\n\n\t/**\n\t * Filters whether the request should be treated as coming from a mobile device or not.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param bool $is_mobile Whether the request is from a mobile device or not.\n\t */\n\treturn apply_filters( 'wp_is_mobile', $is_mobile );\n}\n", "num_lines": 170}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Version\n *\n * Contains version information for the current WordPress release.\n *\n * @package WordPress\n * @since 1.1.0\n */\n\n/**\n * The WordPress version string.\n *\n * @global string $wp_version\n */\n$wp_version = '5.5.3';\n\n/**\n * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.\n *\n * @global int $wp_db_version\n */\n$wp_db_version = 48748;\n\n/**\n * Holds the TinyMCE version.\n *\n * @global string $tinymce_version\n */\n$tinymce_version = '49100-20200624';\n\n/**\n * Holds the required PHP version.\n *\n * @global string $required_php_version\n */\n$required_php_version = '5.6.20';\n\n/**\n * Holds the required MySQL version.\n *\n * @global string $required_mysql_version\n */\n$required_mysql_version = '5.0';\n", "num_lines": 45}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Core Widgets API\n *\n * This API is used for creating dynamic sidebar without hardcoding functionality into\n * themes\n *\n * Includes both internal WordPress routines and theme-use routines.\n *\n * This functionality was found in a plugin before the WordPress 2.2 release, which\n * included it in the core from that point on.\n *\n * @link https://wordpress.org/support/article/wordpress-widgets/\n * @link https://developer.wordpress.org/themes/functionality/widgets/\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 2.2.0\n */\n\n//\n// Global Variables.\n//\n\n/** @ignore */\nglobal $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates;\n\n/**\n * Stores the sidebars, since many themes can have more than one.\n *\n * @global array $wp_registered_sidebars Registered sidebars.\n * @since 2.2.0\n */\n$wp_registered_sidebars = array();\n\n/**\n * Stores the registered widgets.\n *\n * @global array $wp_registered_widgets\n * @since 2.2.0\n */\n$wp_registered_widgets = array();\n\n/**\n * Stores the registered widget controls (options).\n *\n * @global array $wp_registered_widget_controls\n * @since 2.2.0\n */\n$wp_registered_widget_controls = array();\n/**\n * @global array $wp_registered_widget_updates\n */\n$wp_registered_widget_updates = array();\n\n/**\n * Private\n *\n * @global array $_wp_sidebars_widgets\n */\n$_wp_sidebars_widgets = array();\n\n/**\n * Private\n *\n * @global array $_wp_deprecated_widgets_callbacks\n */\n$GLOBALS['_wp_deprecated_widgets_callbacks'] = array(\n\t'wp_widget_pages',\n\t'wp_widget_pages_control',\n\t'wp_widget_calendar',\n\t'wp_widget_calendar_control',\n\t'wp_widget_archives',\n\t'wp_widget_archives_control',\n\t'wp_widget_links',\n\t'wp_widget_meta',\n\t'wp_widget_meta_control',\n\t'wp_widget_search',\n\t'wp_widget_recent_entries',\n\t'wp_widget_recent_entries_control',\n\t'wp_widget_tag_cloud',\n\t'wp_widget_tag_cloud_control',\n\t'wp_widget_categories',\n\t'wp_widget_categories_control',\n\t'wp_widget_text',\n\t'wp_widget_text_control',\n\t'wp_widget_rss',\n\t'wp_widget_rss_control',\n\t'wp_widget_recent_comments',\n\t'wp_widget_recent_comments_control',\n);\n\n//\n// Template tags & API functions.\n//\n\n/**\n * Register a widget\n *\n * Registers a WP_Widget widget\n *\n * @since 2.8.0\n * @since 4.6.0 Updated the `$widget` parameter to also accept a WP_Widget instance object\n *              instead of simply a `WP_Widget` subclass name.\n *\n * @see WP_Widget\n *\n * @global WP_Widget_Factory $wp_widget_factory\n *\n * @param string|WP_Widget $widget Either the name of a `WP_Widget` subclass or an instance of a `WP_Widget` subclass.\n */\nfunction register_widget( $widget ) {\n\tglobal $wp_widget_factory;\n\n\t$wp_widget_factory->register( $widget );\n}\n\n/**\n * Unregisters a widget.\n *\n * Unregisters a WP_Widget widget. Useful for un-registering default widgets.\n * Run within a function hooked to the {@see 'widgets_init'} action.\n *\n * @since 2.8.0\n * @since 4.6.0 Updated the `$widget` parameter to also accept a WP_Widget instance object\n *              instead of simply a `WP_Widget` subclass name.\n *\n * @see WP_Widget\n *\n * @global WP_Widget_Factory $wp_widget_factory\n *\n * @param string|WP_Widget $widget Either the name of a `WP_Widget` subclass or an instance of a `WP_Widget` subclass.\n */\nfunction unregister_widget( $widget ) {\n\tglobal $wp_widget_factory;\n\n\t$wp_widget_factory->unregister( $widget );\n}\n\n/**\n * Creates multiple sidebars.\n *\n * If you wanted to quickly create multiple sidebars for a theme or internally.\n * This function will allow you to do so. If you don't pass the 'name' and/or\n * 'id' in `$args`, then they will be built for you.\n *\n * @since 2.2.0\n *\n * @see register_sidebar() The second parameter is documented by register_sidebar() and is the same here.\n *\n * @global array $wp_registered_sidebars The new sidebars are stored in this array by sidebar ID.\n *\n * @param int          $number Optional. Number of sidebars to create. Default 1.\n * @param array|string $args {\n *     Optional. Array or string of arguments for building a sidebar.\n *\n *     @type string $id   The base string of the unique identifier for each sidebar. If provided, and multiple\n *                        sidebars are being defined, the ID will have \"-2\" appended, and so on.\n *                        Default 'sidebar-' followed by the number the sidebar creation is currently at.\n *     @type string $name The name or title for the sidebars displayed in the admin dashboard. If registering\n *                        more than one sidebar, include '%d' in the string as a placeholder for the uniquely\n *                        assigned number for each sidebar.\n *                        Default 'Sidebar' for the first sidebar, otherwise 'Sidebar %d'.\n * }\n */\nfunction register_sidebars( $number = 1, $args = array() ) {\n\tglobal $wp_registered_sidebars;\n\t$number = (int) $number;\n\n\tif ( is_string( $args ) ) {\n\t\tparse_str( $args, $args );\n\t}\n\n\tfor ( $i = 1; $i <= $number; $i++ ) {\n\t\t$_args = $args;\n\n\t\tif ( $number > 1 ) {\n\t\t\tif ( isset( $args['name'] ) ) {\n\t\t\t\t$_args['name'] = sprintf( $args['name'], $i );\n\t\t\t} else {\n\t\t\t\t/* translators: %d: Sidebar number. */\n\t\t\t\t$_args['name'] = sprintf( __( 'Sidebar %d' ), $i );\n\t\t\t}\n\t\t} else {\n\t\t\t$_args['name'] = isset( $args['name'] ) ? $args['name'] : __( 'Sidebar' );\n\t\t}\n\n\t\t// Custom specified ID's are suffixed if they exist already.\n\t\t// Automatically generated sidebar names need to be suffixed regardless starting at -0.\n\t\tif ( isset( $args['id'] ) ) {\n\t\t\t$_args['id'] = $args['id'];\n\t\t\t$n           = 2; // Start at -2 for conflicting custom IDs.\n\t\t\twhile ( is_registered_sidebar( $_args['id'] ) ) {\n\t\t\t\t$_args['id'] = $args['id'] . '-' . $n++;\n\t\t\t}\n\t\t} else {\n\t\t\t$n = count( $wp_registered_sidebars );\n\t\t\tdo {\n\t\t\t\t$_args['id'] = 'sidebar-' . ++$n;\n\t\t\t} while ( is_registered_sidebar( $_args['id'] ) );\n\t\t}\n\t\tregister_sidebar( $_args );\n\t}\n}\n\n/**\n * Builds the definition for a single sidebar and returns the ID.\n *\n * Accepts either a string or an array and then parses that against a set\n * of default arguments for the new sidebar. WordPress will automatically\n * generate a sidebar ID and name based on the current number of registered\n * sidebars if those arguments are not included.\n *\n * When allowing for automatic generation of the name and ID parameters, keep\n * in mind that the incrementor for your sidebar can change over time depending\n * on what other plugins and themes are installed.\n *\n * If theme support for 'widgets' has not yet been added when this function is\n * called, it will be automatically enabled through the use of add_theme_support()\n *\n * @since 2.2.0\n *\n * @global array $wp_registered_sidebars Registered sidebars.\n *\n * @param array|string $args {\n *     Optional. Array or string of arguments for the sidebar being registered.\n *\n *     @type string $name          The name or title of the sidebar displayed in the Widgets\n *                                 interface. Default 'Sidebar $instance'.\n *     @type string $id            The unique identifier by which the sidebar will be called.\n *                                 Default 'sidebar-$instance'.\n *     @type string $description   Description of the sidebar, displayed in the Widgets interface.\n *                                 Default empty string.\n *     @type string $class         Extra CSS class to assign to the sidebar in the Widgets interface.\n *                                 Default empty.\n *     @type string $before_widget HTML content to prepend to each widget's HTML output when\n *                                 assigned to this sidebar. Default is an opening list item element.\n *     @type string $after_widget  HTML content to append to each widget's HTML output when\n *                                 assigned to this sidebar. Default is a closing list item element.\n *     @type string $before_title  HTML content to prepend to the sidebar title when displayed.\n *                                 Default is an opening h2 element.\n *     @type string $after_title   HTML content to append to the sidebar title when displayed.\n *                                 Default is a closing h2 element.\n * }\n * @return string Sidebar ID added to $wp_registered_sidebars global.\n */\nfunction register_sidebar( $args = array() ) {\n\tglobal $wp_registered_sidebars;\n\n\t$i = count( $wp_registered_sidebars ) + 1;\n\n\t$id_is_empty = empty( $args['id'] );\n\n\t$defaults = array(\n\t\t/* translators: %d: Sidebar number. */\n\t\t'name'          => sprintf( __( 'Sidebar %d' ), $i ),\n\t\t'id'            => \"sidebar-$i\",\n\t\t'description'   => '',\n\t\t'class'         => '',\n\t\t'before_widget' => '<li id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget'  => \"</li>\\n\",\n\t\t'before_title'  => '<h2 class=\"widgettitle\">',\n\t\t'after_title'   => \"</h2>\\n\",\n\t);\n\n\t/**\n\t * Filters the sidebar default arguments.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @see register_sidebar()\n\t *\n\t * @param array $defaults The default sidebar arguments.\n\t */\n\t$sidebar = wp_parse_args( $args, apply_filters( 'register_sidebar_defaults', $defaults ) );\n\n\tif ( $id_is_empty ) {\n\t\t_doing_it_wrong(\n\t\t\t__FUNCTION__,\n\t\t\tsprintf(\n\t\t\t\t/* translators: 1: The 'id' argument, 2: Sidebar name, 3: Recommended 'id' value. */\n\t\t\t\t__( 'No %1$s was set in the arguments array for the \"%2$s\" sidebar. Defaulting to \"%3$s\". Manually set the %1$s to \"%3$s\" to silence this notice and keep existing sidebar content.' ),\n\t\t\t\t'<code>id</code>',\n\t\t\t\t$sidebar['name'],\n\t\t\t\t$sidebar['id']\n\t\t\t),\n\t\t\t'4.2.0'\n\t\t);\n\t}\n\n\t$wp_registered_sidebars[ $sidebar['id'] ] = $sidebar;\n\n\tadd_theme_support( 'widgets' );\n\n\t/**\n\t * Fires once a sidebar has been registered.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param array $sidebar Parsed arguments for the registered sidebar.\n\t */\n\tdo_action( 'register_sidebar', $sidebar );\n\n\treturn $sidebar['id'];\n}\n\n/**\n * Removes a sidebar from the list.\n *\n * @since 2.2.0\n *\n * @global array $wp_registered_sidebars Registered sidebars.\n *\n * @param string|int $sidebar_id The ID of the sidebar when it was registered.\n */\nfunction unregister_sidebar( $sidebar_id ) {\n\tglobal $wp_registered_sidebars;\n\n\tunset( $wp_registered_sidebars[ $sidebar_id ] );\n}\n\n/**\n * Checks if a sidebar is registered.\n *\n * @since 4.4.0\n *\n * @global array $wp_registered_sidebars Registered sidebars.\n *\n * @param string|int $sidebar_id The ID of the sidebar when it was registered.\n * @return bool True if the sidebar is registered, false otherwise.\n */\nfunction is_registered_sidebar( $sidebar_id ) {\n\tglobal $wp_registered_sidebars;\n\n\treturn isset( $wp_registered_sidebars[ $sidebar_id ] );\n}\n\n/**\n * Register an instance of a widget.\n *\n * The default widget option is 'classname' that can be overridden.\n *\n * The function can also be used to un-register widgets when `$output_callback`\n * parameter is an empty string.\n *\n * @since 2.2.0\n * @since 5.3.0 Formalized the existing and already documented `...$params` parameter\n *              by adding it to the function signature.\n *\n * @global array $wp_registered_widgets            Uses stored registered widgets.\n * @global array $wp_registered_widget_controls    Stores the registered widget controls (options).\n * @global array $wp_registered_widget_updates\n * @global array $_wp_deprecated_widgets_callbacks\n *\n * @param int|string $id              Widget ID.\n * @param string     $name            Widget display title.\n * @param callable   $output_callback Run when widget is called.\n * @param array      $options {\n *     Optional. An array of supplementary widget options for the instance.\n *\n *     @type string $classname   Class name for the widget's HTML container. Default is a shortened\n *                               version of the output callback name.\n *     @type string $description Widget description for display in the widget administration\n *                               panel and/or theme.\n * }\n * @param mixed      ...$params       Optional additional parameters to pass to the callback function when it's called.\n */\nfunction wp_register_sidebar_widget( $id, $name, $output_callback, $options = array(), ...$params ) {\n\tglobal $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates, $_wp_deprecated_widgets_callbacks;\n\n\t$id = strtolower( $id );\n\n\tif ( empty( $output_callback ) ) {\n\t\tunset( $wp_registered_widgets[ $id ] );\n\t\treturn;\n\t}\n\n\t$id_base = _get_widget_id_base( $id );\n\tif ( in_array( $output_callback, $_wp_deprecated_widgets_callbacks, true ) && ! is_callable( $output_callback ) ) {\n\t\tunset( $wp_registered_widget_controls[ $id ] );\n\t\tunset( $wp_registered_widget_updates[ $id_base ] );\n\t\treturn;\n\t}\n\n\t$defaults = array( 'classname' => $output_callback );\n\t$options  = wp_parse_args( $options, $defaults );\n\t$widget   = array(\n\t\t'name'     => $name,\n\t\t'id'       => $id,\n\t\t'callback' => $output_callback,\n\t\t'params'   => $params,\n\t);\n\t$widget   = array_merge( $widget, $options );\n\n\tif ( is_callable( $output_callback ) && ( ! isset( $wp_registered_widgets[ $id ] ) || did_action( 'widgets_init' ) ) ) {\n\n\t\t/**\n\t\t * Fires once for each registered widget.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param array $widget An array of default widget arguments.\n\t\t */\n\t\tdo_action( 'wp_register_sidebar_widget', $widget );\n\t\t$wp_registered_widgets[ $id ] = $widget;\n\t}\n}\n\n/**\n * Retrieve description for widget.\n *\n * When registering widgets, the options can also include 'description' that\n * describes the widget for display on the widget administration panel or\n * in the theme.\n *\n * @since 2.5.0\n *\n * @global array $wp_registered_widgets\n *\n * @param int|string $id Widget ID.\n * @return string|void Widget description, if available.\n */\nfunction wp_widget_description( $id ) {\n\tif ( ! is_scalar( $id ) ) {\n\t\treturn;\n\t}\n\n\tglobal $wp_registered_widgets;\n\n\tif ( isset( $wp_registered_widgets[ $id ]['description'] ) ) {\n\t\treturn esc_html( $wp_registered_widgets[ $id ]['description'] );\n\t}\n}\n\n/**\n * Retrieve description for a sidebar.\n *\n * When registering sidebars a 'description' parameter can be included that\n * describes the sidebar for display on the widget administration panel.\n *\n * @since 2.9.0\n *\n * @global array $wp_registered_sidebars Registered sidebars.\n *\n * @param string $id sidebar ID.\n * @return string|void Sidebar description, if available.\n */\nfunction wp_sidebar_description( $id ) {\n\tif ( ! is_scalar( $id ) ) {\n\t\treturn;\n\t}\n\n\tglobal $wp_registered_sidebars;\n\n\tif ( isset( $wp_registered_sidebars[ $id ]['description'] ) ) {\n\t\treturn wp_kses( $wp_registered_sidebars[ $id ]['description'], 'sidebar_description' );\n\t}\n}\n\n/**\n * Remove widget from sidebar.\n *\n * @since 2.2.0\n *\n * @param int|string $id Widget ID.\n */\nfunction wp_unregister_sidebar_widget( $id ) {\n\n\t/**\n\t * Fires just before a widget is removed from a sidebar.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param int $id The widget ID.\n\t */\n\tdo_action( 'wp_unregister_sidebar_widget', $id );\n\n\twp_register_sidebar_widget( $id, '', '' );\n\twp_unregister_widget_control( $id );\n}\n\n/**\n * Registers widget control callback for customizing options.\n *\n * @since 2.2.0\n * @since 5.3.0 Formalized the existing and already documented `...$params` parameter\n *              by adding it to the function signature.\n *\n * @global array $wp_registered_widget_controls\n * @global array $wp_registered_widget_updates\n * @global array $wp_registered_widgets\n * @global array $_wp_deprecated_widgets_callbacks\n *\n * @param int|string $id               Sidebar ID.\n * @param string     $name             Sidebar display name.\n * @param callable   $control_callback Run when sidebar is displayed.\n * @param array      $options {\n *     Optional. Array or string of control options. Default empty array.\n *\n *     @type int        $height  Never used. Default 200.\n *     @type int        $width   Width of the fully expanded control form (but try hard to use the default width).\n *                               Default 250.\n *     @type int|string $id_base Required for multi-widgets, i.e widgets that allow multiple instances such as the\n *                               text widget. The widget id will end up looking like `{$id_base}-{$unique_number}`.\n * }\n * @param mixed      ...$params        Optional additional parameters to pass to the callback function when it's called.\n */\nfunction wp_register_widget_control( $id, $name, $control_callback, $options = array(), ...$params ) {\n\tglobal $wp_registered_widget_controls, $wp_registered_widget_updates, $wp_registered_widgets, $_wp_deprecated_widgets_callbacks;\n\n\t$id      = strtolower( $id );\n\t$id_base = _get_widget_id_base( $id );\n\n\tif ( empty( $control_callback ) ) {\n\t\tunset( $wp_registered_widget_controls[ $id ] );\n\t\tunset( $wp_registered_widget_updates[ $id_base ] );\n\t\treturn;\n\t}\n\n\tif ( in_array( $control_callback, $_wp_deprecated_widgets_callbacks, true ) && ! is_callable( $control_callback ) ) {\n\t\tunset( $wp_registered_widgets[ $id ] );\n\t\treturn;\n\t}\n\n\tif ( isset( $wp_registered_widget_controls[ $id ] ) && ! did_action( 'widgets_init' ) ) {\n\t\treturn;\n\t}\n\n\t$defaults          = array(\n\t\t'width'  => 250,\n\t\t'height' => 200,\n\t); // Height is never used.\n\t$options           = wp_parse_args( $options, $defaults );\n\t$options['width']  = (int) $options['width'];\n\t$options['height'] = (int) $options['height'];\n\n\t$widget = array(\n\t\t'name'     => $name,\n\t\t'id'       => $id,\n\t\t'callback' => $control_callback,\n\t\t'params'   => $params,\n\t);\n\t$widget = array_merge( $widget, $options );\n\n\t$wp_registered_widget_controls[ $id ] = $widget;\n\n\tif ( isset( $wp_registered_widget_updates[ $id_base ] ) ) {\n\t\treturn;\n\t}\n\n\tif ( isset( $widget['params'][0]['number'] ) ) {\n\t\t$widget['params'][0]['number'] = -1;\n\t}\n\n\tunset( $widget['width'], $widget['height'], $widget['name'], $widget['id'] );\n\t$wp_registered_widget_updates[ $id_base ] = $widget;\n}\n\n/**\n * Registers the update callback for a widget.\n *\n * @since 2.8.0\n * @since 5.3.0 Formalized the existing and already documented `...$params` parameter\n *              by adding it to the function signature.\n *\n * @global array $wp_registered_widget_updates\n *\n * @param string   $id_base         The base ID of a widget created by extending WP_Widget.\n * @param callable $update_callback Update callback method for the widget.\n * @param array    $options         Optional. Widget control options. See wp_register_widget_control().\n *                                  Default empty array.\n * @param mixed    ...$params       Optional additional parameters to pass to the callback function when it's called.\n */\nfunction _register_widget_update_callback( $id_base, $update_callback, $options = array(), ...$params ) {\n\tglobal $wp_registered_widget_updates;\n\n\tif ( isset( $wp_registered_widget_updates[ $id_base ] ) ) {\n\t\tif ( empty( $update_callback ) ) {\n\t\t\tunset( $wp_registered_widget_updates[ $id_base ] );\n\t\t}\n\t\treturn;\n\t}\n\n\t$widget = array(\n\t\t'callback' => $update_callback,\n\t\t'params'   => $params,\n\t);\n\n\t$widget                                   = array_merge( $widget, $options );\n\t$wp_registered_widget_updates[ $id_base ] = $widget;\n}\n\n/**\n * Registers the form callback for a widget.\n *\n * @since 2.8.0\n * @since 5.3.0 Formalized the existing and already documented `...$params` parameter\n *              by adding it to the function signature.\n *\n * @global array $wp_registered_widget_controls\n *\n * @param int|string $id            Widget ID.\n * @param string     $name          Name attribute for the widget.\n * @param callable   $form_callback Form callback.\n * @param array      $options       Optional. Widget control options. See wp_register_widget_control().\n *                                  Default empty array.\n * @param mixed      ...$params     Optional additional parameters to pass to the callback function when it's called.\n */\n\nfunction _register_widget_form_callback( $id, $name, $form_callback, $options = array(), ...$params ) {\n\tglobal $wp_registered_widget_controls;\n\n\t$id = strtolower( $id );\n\n\tif ( empty( $form_callback ) ) {\n\t\tunset( $wp_registered_widget_controls[ $id ] );\n\t\treturn;\n\t}\n\n\tif ( isset( $wp_registered_widget_controls[ $id ] ) && ! did_action( 'widgets_init' ) ) {\n\t\treturn;\n\t}\n\n\t$defaults          = array(\n\t\t'width'  => 250,\n\t\t'height' => 200,\n\t);\n\t$options           = wp_parse_args( $options, $defaults );\n\t$options['width']  = (int) $options['width'];\n\t$options['height'] = (int) $options['height'];\n\n\t$widget = array(\n\t\t'name'     => $name,\n\t\t'id'       => $id,\n\t\t'callback' => $form_callback,\n\t\t'params'   => $params,\n\t);\n\t$widget = array_merge( $widget, $options );\n\n\t$wp_registered_widget_controls[ $id ] = $widget;\n}\n\n/**\n * Remove control callback for widget.\n *\n * @since 2.2.0\n *\n * @param int|string $id Widget ID.\n */\nfunction wp_unregister_widget_control( $id ) {\n\twp_register_widget_control( $id, '', '' );\n}\n\n/**\n * Display dynamic sidebar.\n *\n * By default this displays the default sidebar or 'sidebar-1'. If your theme specifies the 'id' or\n * 'name' parameter for its registered sidebars you can pass an ID or name as the $index parameter.\n * Otherwise, you can pass in a numerical index to display the sidebar at that index.\n *\n * @since 2.2.0\n *\n * @global array $wp_registered_sidebars Registered sidebars.\n * @global array $wp_registered_widgets  Registered widgets.\n *\n * @param int|string $index Optional. Index, name or ID of dynamic sidebar. Default 1.\n * @return bool True, if widget sidebar was found and called. False if not found or not called.\n */\nfunction dynamic_sidebar( $index = 1 ) {\n\tglobal $wp_registered_sidebars, $wp_registered_widgets;\n\n\tif ( is_int( $index ) ) {\n\t\t$index = \"sidebar-$index\";\n\t} else {\n\t\t$index = sanitize_title( $index );\n\t\tforeach ( (array) $wp_registered_sidebars as $key => $value ) {\n\t\t\tif ( sanitize_title( $value['name'] ) === $index ) {\n\t\t\t\t$index = $key;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t$sidebars_widgets = wp_get_sidebars_widgets();\n\tif ( empty( $wp_registered_sidebars[ $index ] ) || empty( $sidebars_widgets[ $index ] ) || ! is_array( $sidebars_widgets[ $index ] ) ) {\n\t\t/** This action is documented in wp-includes/widget.php */\n\t\tdo_action( 'dynamic_sidebar_before', $index, false );\n\t\t/** This action is documented in wp-includes/widget.php */\n\t\tdo_action( 'dynamic_sidebar_after', $index, false );\n\t\t/** This filter is documented in wp-includes/widget.php */\n\t\treturn apply_filters( 'dynamic_sidebar_has_widgets', false, $index );\n\t}\n\n\t/**\n\t * Fires before widgets are rendered in a dynamic sidebar.\n\t *\n\t * Note: The action also fires for empty sidebars, and on both the front end\n\t * and back end, including the Inactive Widgets sidebar on the Widgets screen.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param int|string $index       Index, name, or ID of the dynamic sidebar.\n\t * @param bool       $has_widgets Whether the sidebar is populated with widgets.\n\t *                                Default true.\n\t */\n\tdo_action( 'dynamic_sidebar_before', $index, true );\n\t$sidebar = $wp_registered_sidebars[ $index ];\n\n\t$did_one = false;\n\tforeach ( (array) $sidebars_widgets[ $index ] as $id ) {\n\n\t\tif ( ! isset( $wp_registered_widgets[ $id ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$params = array_merge(\n\t\t\tarray(\n\t\t\t\tarray_merge(\n\t\t\t\t\t$sidebar,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'widget_id'   => $id,\n\t\t\t\t\t\t'widget_name' => $wp_registered_widgets[ $id ]['name'],\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\t(array) $wp_registered_widgets[ $id ]['params']\n\t\t);\n\n\t\t// Substitute HTML `id` and `class` attributes into `before_widget`.\n\t\t$classname_ = '';\n\t\tforeach ( (array) $wp_registered_widgets[ $id ]['classname'] as $cn ) {\n\t\t\tif ( is_string( $cn ) ) {\n\t\t\t\t$classname_ .= '_' . $cn;\n\t\t\t} elseif ( is_object( $cn ) ) {\n\t\t\t\t$classname_ .= '_' . get_class( $cn );\n\t\t\t}\n\t\t}\n\t\t$classname_                 = ltrim( $classname_, '_' );\n\t\t$params[0]['before_widget'] = sprintf( $params[0]['before_widget'], $id, $classname_ );\n\n\t\t/**\n\t\t * Filters the parameters passed to a widget's display callback.\n\t\t *\n\t\t * Note: The filter is evaluated on both the front end and back end,\n\t\t * including for the Inactive Widgets sidebar on the Widgets screen.\n\t\t *\n\t\t * @since 2.5.0\n\t\t *\n\t\t * @see register_sidebar()\n\t\t *\n\t\t * @param array $params {\n\t\t *     @type array $args  {\n\t\t *         An array of widget display arguments.\n\t\t *\n\t\t *         @type string $name          Name of the sidebar the widget is assigned to.\n\t\t *         @type string $id            ID of the sidebar the widget is assigned to.\n\t\t *         @type string $description   The sidebar description.\n\t\t *         @type string $class         CSS class applied to the sidebar container.\n\t\t *         @type string $before_widget HTML markup to prepend to each widget in the sidebar.\n\t\t *         @type string $after_widget  HTML markup to append to each widget in the sidebar.\n\t\t *         @type string $before_title  HTML markup to prepend to the widget title when displayed.\n\t\t *         @type string $after_title   HTML markup to append to the widget title when displayed.\n\t\t *         @type string $widget_id     ID of the widget.\n\t\t *         @type string $widget_name   Name of the widget.\n\t\t *     }\n\t\t *     @type array $widget_args {\n\t\t *         An array of multi-widget arguments.\n\t\t *\n\t\t *         @type int $number Number increment used for multiples of the same widget.\n\t\t *     }\n\t\t * }\n\t\t */\n\t\t$params = apply_filters( 'dynamic_sidebar_params', $params );\n\n\t\t$callback = $wp_registered_widgets[ $id ]['callback'];\n\n\t\t/**\n\t\t * Fires before a widget's display callback is called.\n\t\t *\n\t\t * Note: The action fires on both the front end and back end, including\n\t\t * for widgets in the Inactive Widgets sidebar on the Widgets screen.\n\t\t *\n\t\t * The action is not fired for empty sidebars.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param array $widget_id {\n\t\t *     An associative array of widget arguments.\n\t\t *\n\t\t *     @type string   $name        Name of the widget.\n\t\t *     @type string   $id          Widget ID.\n\t\t *     @type callable $callback    When the hook is fired on the front end, $callback is an array\n\t\t *                                 containing the widget object. Fired on the back end, $callback\n\t\t *                                 is 'wp_widget_control', see $_callback.\n\t\t *     @type array    $params      An associative array of multi-widget arguments.\n\t\t *     @type string   $classname   CSS class applied to the widget container.\n\t\t *     @type string   $description The widget description.\n\t\t *     @type array    $_callback   When the hook is fired on the back end, $_callback is populated\n\t\t *                                 with an array containing the widget object, see $callback.\n\t\t * }\n\t\t */\n\t\tdo_action( 'dynamic_sidebar', $wp_registered_widgets[ $id ] );\n\n\t\tif ( is_callable( $callback ) ) {\n\t\t\tcall_user_func_array( $callback, $params );\n\t\t\t$did_one = true;\n\t\t}\n\t}\n\n\t/**\n\t * Fires after widgets are rendered in a dynamic sidebar.\n\t *\n\t * Note: The action also fires for empty sidebars, and on both the front end\n\t * and back end, including the Inactive Widgets sidebar on the Widgets screen.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param int|string $index       Index, name, or ID of the dynamic sidebar.\n\t * @param bool       $has_widgets Whether the sidebar is populated with widgets.\n\t *                                Default true.\n\t */\n\tdo_action( 'dynamic_sidebar_after', $index, true );\n\n\t/**\n\t * Filters whether a sidebar has widgets.\n\t *\n\t * Note: The filter is also evaluated for empty sidebars, and on both the front end\n\t * and back end, including the Inactive Widgets sidebar on the Widgets screen.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param bool       $did_one Whether at least one widget was rendered in the sidebar.\n\t *                            Default false.\n\t * @param int|string $index   Index, name, or ID of the dynamic sidebar.\n\t */\n\treturn apply_filters( 'dynamic_sidebar_has_widgets', $did_one, $index );\n}\n\n/**\n * Determines whether a given widget is displayed on the front end.\n *\n * Either $callback or $id_base can be used\n * $id_base is the first argument when extending WP_Widget class\n * Without the optional $widget_id parameter, returns the ID of the first sidebar\n * in which the first instance of the widget with the given callback or $id_base is found.\n * With the $widget_id parameter, returns the ID of the sidebar where\n * the widget with that callback/$id_base AND that ID is found.\n *\n * NOTE: $widget_id and $id_base are the same for single widgets. To be effective\n * this function has to run after widgets have initialized, at action {@see 'init'} or later.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.2.0\n *\n * @global array $wp_registered_widgets\n *\n * @param callable|false $callback      Optional, Widget callback to check. Default false.\n * @param int|false      $widget_id     Optional. Widget ID. Optional, but needed for checking. Default false.\n * @param string|false   $id_base       Optional. The base ID of a widget created by extending WP_Widget. Default false.\n * @param bool           $skip_inactive Optional. Whether to check in 'wp_inactive_widgets'. Default true.\n * @return string|false False if widget is not active or id of sidebar in which the widget is active.\n */\nfunction is_active_widget( $callback = false, $widget_id = false, $id_base = false, $skip_inactive = true ) {\n\tglobal $wp_registered_widgets;\n\n\t$sidebars_widgets = wp_get_sidebars_widgets();\n\n\tif ( is_array( $sidebars_widgets ) ) {\n\t\tforeach ( $sidebars_widgets as $sidebar => $widgets ) {\n\t\t\tif ( $skip_inactive && ( 'wp_inactive_widgets' === $sidebar || 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( is_array( $widgets ) ) {\n\t\t\t\tforeach ( $widgets as $widget ) {\n\t\t\t\t\tif ( ( $callback && isset( $wp_registered_widgets[ $widget ]['callback'] ) && $wp_registered_widgets[ $widget ]['callback'] === $callback ) || ( $id_base && _get_widget_id_base( $widget ) === $id_base ) ) {\n\t\t\t\t\t\tif ( ! $widget_id || $widget_id === $wp_registered_widgets[ $widget ]['id'] ) {\n\t\t\t\t\t\t\treturn $sidebar;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Determines whether the dynamic sidebar is enabled and used by the theme.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.2.0\n *\n * @global array $wp_registered_widgets  Registered widgets.\n * @global array $wp_registered_sidebars Registered sidebars.\n *\n * @return bool True if using widgets, false otherwise.\n */\nfunction is_dynamic_sidebar() {\n\tglobal $wp_registered_widgets, $wp_registered_sidebars;\n\n\t$sidebars_widgets = get_option( 'sidebars_widgets' );\n\n\tforeach ( (array) $wp_registered_sidebars as $index => $sidebar ) {\n\t\tif ( ! empty( $sidebars_widgets[ $index ] ) ) {\n\t\t\tforeach ( (array) $sidebars_widgets[ $index ] as $widget ) {\n\t\t\t\tif ( array_key_exists( $widget, $wp_registered_widgets ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Determines whether a sidebar contains widgets.\n *\n * For more information on this and similar theme functions, check out\n * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/\n * Conditional Tags} article in the Theme Developer Handbook.\n *\n * @since 2.8.0\n *\n * @param string|int $index Sidebar name, id or number to check.\n * @return bool True if the sidebar has widgets, false otherwise.\n */\nfunction is_active_sidebar( $index ) {\n\t$index             = ( is_int( $index ) ) ? \"sidebar-$index\" : sanitize_title( $index );\n\t$sidebars_widgets  = wp_get_sidebars_widgets();\n\t$is_active_sidebar = ! empty( $sidebars_widgets[ $index ] );\n\n\t/**\n\t * Filters whether a dynamic sidebar is considered \"active\".\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param bool       $is_active_sidebar Whether or not the sidebar should be considered \"active\".\n\t *                                      In other words, whether the sidebar contains any widgets.\n\t * @param int|string $index             Index, name, or ID of the dynamic sidebar.\n\t */\n\treturn apply_filters( 'is_active_sidebar', $is_active_sidebar, $index );\n}\n\n//\n// Internal Functions.\n//\n\n/**\n * Retrieve full list of sidebars and their widget instance IDs.\n *\n * Will upgrade sidebar widget list, if needed. Will also save updated list, if\n * needed.\n *\n * @since 2.2.0\n * @access private\n *\n * @global array $_wp_sidebars_widgets\n * @global array $sidebars_widgets\n *\n * @param bool $deprecated Not used (argument deprecated).\n * @return array Upgraded list of widgets to version 3 array format when called from the admin.\n */\nfunction wp_get_sidebars_widgets( $deprecated = true ) {\n\tif ( true !== $deprecated ) {\n\t\t_deprecated_argument( __FUNCTION__, '2.8.1' );\n\t}\n\n\tglobal $_wp_sidebars_widgets, $sidebars_widgets;\n\n\t// If loading from front page, consult $_wp_sidebars_widgets rather than options\n\t// to see if wp_convert_widget_settings() has made manipulations in memory.\n\tif ( ! is_admin() ) {\n\t\tif ( empty( $_wp_sidebars_widgets ) ) {\n\t\t\t$_wp_sidebars_widgets = get_option( 'sidebars_widgets', array() );\n\t\t}\n\n\t\t$sidebars_widgets = $_wp_sidebars_widgets;\n\t} else {\n\t\t$sidebars_widgets = get_option( 'sidebars_widgets', array() );\n\t}\n\n\tif ( is_array( $sidebars_widgets ) && isset( $sidebars_widgets['array_version'] ) ) {\n\t\tunset( $sidebars_widgets['array_version'] );\n\t}\n\n\t/**\n\t * Filters the list of sidebars and their widgets.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @param array $sidebars_widgets An associative array of sidebars and their widgets.\n\t */\n\treturn apply_filters( 'sidebars_widgets', $sidebars_widgets );\n}\n\n/**\n * Set the sidebar widget option to update sidebars.\n *\n * @since 2.2.0\n * @access private\n *\n * @global array $_wp_sidebars_widgets\n * @param array $sidebars_widgets Sidebar widgets and their settings.\n */\nfunction wp_set_sidebars_widgets( $sidebars_widgets ) {\n\tglobal $_wp_sidebars_widgets;\n\n\t// Clear cached value used in wp_get_sidebars_widgets().\n\t$_wp_sidebars_widgets = null;\n\n\tif ( ! isset( $sidebars_widgets['array_version'] ) ) {\n\t\t$sidebars_widgets['array_version'] = 3;\n\t}\n\n\tupdate_option( 'sidebars_widgets', $sidebars_widgets );\n}\n\n/**\n * Retrieve default registered sidebars list.\n *\n * @since 2.2.0\n * @access private\n *\n * @global array $wp_registered_sidebars Registered sidebars.\n *\n * @return array\n */\nfunction wp_get_widget_defaults() {\n\tglobal $wp_registered_sidebars;\n\n\t$defaults = array();\n\n\tforeach ( (array) $wp_registered_sidebars as $index => $sidebar ) {\n\t\t$defaults[ $index ] = array();\n\t}\n\n\treturn $defaults;\n}\n\n/**\n * Converts the widget settings from single to multi-widget format.\n *\n * @since 2.8.0\n *\n * @global array $_wp_sidebars_widgets\n *\n * @param string $base_name   Root ID for all widgets of this type.\n * @param string $option_name Option name for this widget type.\n * @param array  $settings    The array of widget instance settings.\n * @return array The array of widget settings converted to multi-widget format.\n */\nfunction wp_convert_widget_settings( $base_name, $option_name, $settings ) {\n\t// This test may need expanding.\n\t$single  = false;\n\t$changed = false;\n\n\tif ( empty( $settings ) ) {\n\t\t$single = true;\n\t} else {\n\t\tforeach ( array_keys( $settings ) as $number ) {\n\t\t\tif ( 'number' === $number ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( ! is_numeric( $number ) ) {\n\t\t\t\t$single = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( $single ) {\n\t\t$settings = array( 2 => $settings );\n\n\t\t// If loading from the front page, update sidebar in memory but don't save to options.\n\t\tif ( is_admin() ) {\n\t\t\t$sidebars_widgets = get_option( 'sidebars_widgets' );\n\t\t} else {\n\t\t\tif ( empty( $GLOBALS['_wp_sidebars_widgets'] ) ) {\n\t\t\t\t$GLOBALS['_wp_sidebars_widgets'] = get_option( 'sidebars_widgets', array() );\n\t\t\t}\n\t\t\t$sidebars_widgets = &$GLOBALS['_wp_sidebars_widgets'];\n\t\t}\n\n\t\tforeach ( (array) $sidebars_widgets as $index => $sidebar ) {\n\t\t\tif ( is_array( $sidebar ) ) {\n\t\t\t\tforeach ( $sidebar as $i => $name ) {\n\t\t\t\t\tif ( $base_name === $name ) {\n\t\t\t\t\t\t$sidebars_widgets[ $index ][ $i ] = \"$name-2\";\n\t\t\t\t\t\t$changed                          = true;\n\t\t\t\t\t\tbreak 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( is_admin() && $changed ) {\n\t\t\tupdate_option( 'sidebars_widgets', $sidebars_widgets );\n\t\t}\n\t}\n\n\t$settings['_multiwidget'] = 1;\n\tif ( is_admin() ) {\n\t\tupdate_option( $option_name, $settings );\n\t}\n\n\treturn $settings;\n}\n\n/**\n * Output an arbitrary widget as a template tag.\n *\n * @since 2.8.0\n *\n * @global WP_Widget_Factory $wp_widget_factory\n *\n * @param string $widget   The widget's PHP class name (see class-wp-widget.php).\n * @param array  $instance Optional. The widget's instance settings. Default empty array.\n * @param array  $args {\n *     Optional. Array of arguments to configure the display of the widget.\n *\n *     @type string $before_widget HTML content that will be prepended to the widget's HTML output.\n *                                 Default `<div class=\"widget %s\">`, where `%s` is the widget's class name.\n *     @type string $after_widget  HTML content that will be appended to the widget's HTML output.\n *                                 Default `</div>`.\n *     @type string $before_title  HTML content that will be prepended to the widget's title when displayed.\n *                                 Default `<h2 class=\"widgettitle\">`.\n *     @type string $after_title   HTML content that will be appended to the widget's title when displayed.\n *                                 Default `</h2>`.\n * }\n */\nfunction the_widget( $widget, $instance = array(), $args = array() ) {\n\tglobal $wp_widget_factory;\n\n\tif ( ! isset( $wp_widget_factory->widgets[ $widget ] ) ) {\n\t\t_doing_it_wrong(\n\t\t\t__FUNCTION__,\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: register_widget() */\n\t\t\t\t__( 'Widgets need to be registered using %s, before they can be displayed.' ),\n\t\t\t\t'<code>register_widget()</code>'\n\t\t\t),\n\t\t\t'4.9.0'\n\t\t);\n\t\treturn;\n\t}\n\n\t$widget_obj = $wp_widget_factory->widgets[ $widget ];\n\tif ( ! ( $widget_obj instanceof WP_Widget ) ) {\n\t\treturn;\n\t}\n\n\t$default_args          = array(\n\t\t'before_widget' => '<div class=\"widget %s\">',\n\t\t'after_widget'  => '</div>',\n\t\t'before_title'  => '<h2 class=\"widgettitle\">',\n\t\t'after_title'   => '</h2>',\n\t);\n\t$args                  = wp_parse_args( $args, $default_args );\n\t$args['before_widget'] = sprintf( $args['before_widget'], $widget_obj->widget_options['classname'] );\n\n\t$instance = wp_parse_args( $instance );\n\n\t/** This filter is documented in wp-includes/class-wp-widget.php */\n\t$instance = apply_filters( 'widget_display_callback', $instance, $widget_obj, $args );\n\n\tif ( false === $instance ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Fires before rendering the requested widget.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $widget   The widget's class name.\n\t * @param array  $instance The current widget instance's settings.\n\t * @param array  $args     An array of the widget's sidebar arguments.\n\t */\n\tdo_action( 'the_widget', $widget, $instance, $args );\n\n\t$widget_obj->_set( -1 );\n\t$widget_obj->widget( $args, $instance );\n}\n\n/**\n * Retrieves the widget ID base value.\n *\n * @since 2.8.0\n *\n * @param string $id Widget ID.\n * @return string Widget ID base.\n */\nfunction _get_widget_id_base( $id ) {\n\treturn preg_replace( '/-[0-9]+$/', '', $id );\n}\n\n/**\n * Handle sidebars config after theme change\n *\n * @access private\n * @since 3.3.0\n *\n * @global array $sidebars_widgets\n */\nfunction _wp_sidebars_changed() {\n\tglobal $sidebars_widgets;\n\n\tif ( ! is_array( $sidebars_widgets ) ) {\n\t\t$sidebars_widgets = wp_get_sidebars_widgets();\n\t}\n\n\tretrieve_widgets( true );\n}\n\n/**\n * Look for \"lost\" widgets, this has to run at least on each theme change.\n *\n * @since 2.8.0\n *\n * @global array $wp_registered_sidebars Registered sidebars.\n * @global array $sidebars_widgets\n * @global array $wp_registered_widgets  Registered widgets.\n *\n * @param string|bool $theme_changed Whether the theme was changed as a boolean. A value\n *                                   of 'customize' defers updates for the Customizer.\n * @return array Updated sidebars widgets.\n */\nfunction retrieve_widgets( $theme_changed = false ) {\n\tglobal $wp_registered_sidebars, $sidebars_widgets, $wp_registered_widgets;\n\n\t$registered_sidebars_keys = array_keys( $wp_registered_sidebars );\n\t$registered_widgets_ids   = array_keys( $wp_registered_widgets );\n\n\tif ( ! is_array( get_theme_mod( 'sidebars_widgets' ) ) ) {\n\t\tif ( empty( $sidebars_widgets ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\tunset( $sidebars_widgets['array_version'] );\n\n\t\t$sidebars_widgets_keys = array_keys( $sidebars_widgets );\n\t\tsort( $sidebars_widgets_keys );\n\t\tsort( $registered_sidebars_keys );\n\n\t\tif ( $sidebars_widgets_keys === $registered_sidebars_keys ) {\n\t\t\t$sidebars_widgets = _wp_remove_unregistered_widgets( $sidebars_widgets, $registered_widgets_ids );\n\n\t\t\treturn $sidebars_widgets;\n\t\t}\n\t}\n\n\t// Discard invalid, theme-specific widgets from sidebars.\n\t$sidebars_widgets = _wp_remove_unregistered_widgets( $sidebars_widgets, $registered_widgets_ids );\n\t$sidebars_widgets = wp_map_sidebars_widgets( $sidebars_widgets );\n\n\t// Find hidden/lost multi-widget instances.\n\t$shown_widgets = call_user_func_array( 'array_merge', $sidebars_widgets );\n\t$lost_widgets  = array_diff( $registered_widgets_ids, $shown_widgets );\n\n\tforeach ( $lost_widgets as $key => $widget_id ) {\n\t\t$number = preg_replace( '/.+?-([0-9]+)$/', '$1', $widget_id );\n\n\t\t// Only keep active and default widgets.\n\t\tif ( is_numeric( $number ) && (int) $number < 2 ) {\n\t\t\tunset( $lost_widgets[ $key ] );\n\t\t}\n\t}\n\t$sidebars_widgets['wp_inactive_widgets'] = array_merge( $lost_widgets, (array) $sidebars_widgets['wp_inactive_widgets'] );\n\n\tif ( 'customize' !== $theme_changed ) {\n\t\twp_set_sidebars_widgets( $sidebars_widgets );\n\t}\n\n\treturn $sidebars_widgets;\n}\n\n/**\n * Compares a list of sidebars with their widgets against an allowed list.\n *\n * @since 4.9.0\n * @since 4.9.2 Always tries to restore widget assignments from previous data, not just if sidebars needed mapping.\n *\n * @param array $existing_sidebars_widgets List of sidebars and their widget instance IDs.\n * @return array Mapped sidebars widgets.\n */\nfunction wp_map_sidebars_widgets( $existing_sidebars_widgets ) {\n\tglobal $wp_registered_sidebars;\n\n\t$new_sidebars_widgets = array(\n\t\t'wp_inactive_widgets' => array(),\n\t);\n\n\t// Short-circuit if there are no sidebars to map.\n\tif ( ! is_array( $existing_sidebars_widgets ) || empty( $existing_sidebars_widgets ) ) {\n\t\treturn $new_sidebars_widgets;\n\t}\n\n\tforeach ( $existing_sidebars_widgets as $sidebar => $widgets ) {\n\t\tif ( 'wp_inactive_widgets' === $sidebar || 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) {\n\t\t\t$new_sidebars_widgets['wp_inactive_widgets'] = array_merge( $new_sidebars_widgets['wp_inactive_widgets'], (array) $widgets );\n\t\t\tunset( $existing_sidebars_widgets[ $sidebar ] );\n\t\t}\n\t}\n\n\t// If old and new theme have just one sidebar, map it and we're done.\n\tif ( 1 === count( $existing_sidebars_widgets ) && 1 === count( $wp_registered_sidebars ) ) {\n\t\t$new_sidebars_widgets[ key( $wp_registered_sidebars ) ] = array_pop( $existing_sidebars_widgets );\n\n\t\treturn $new_sidebars_widgets;\n\t}\n\n\t// Map locations with the same slug.\n\t$existing_sidebars = array_keys( $existing_sidebars_widgets );\n\n\tforeach ( $wp_registered_sidebars as $sidebar => $name ) {\n\t\tif ( in_array( $sidebar, $existing_sidebars, true ) ) {\n\t\t\t$new_sidebars_widgets[ $sidebar ] = $existing_sidebars_widgets[ $sidebar ];\n\t\t\tunset( $existing_sidebars_widgets[ $sidebar ] );\n\t\t} elseif ( ! array_key_exists( $sidebar, $new_sidebars_widgets ) ) {\n\t\t\t$new_sidebars_widgets[ $sidebar ] = array();\n\t\t}\n\t}\n\n\t// If there are more sidebars, try to map them.\n\tif ( ! empty( $existing_sidebars_widgets ) ) {\n\n\t\t/*\n\t\t * If old and new theme both have sidebars that contain phrases\n\t\t * from within the same group, make an educated guess and map it.\n\t\t */\n\t\t$common_slug_groups = array(\n\t\t\tarray( 'sidebar', 'primary', 'main', 'right' ),\n\t\t\tarray( 'second', 'left' ),\n\t\t\tarray( 'sidebar-2', 'footer', 'bottom' ),\n\t\t\tarray( 'header', 'top' ),\n\t\t);\n\n\t\t// Go through each group...\n\t\tforeach ( $common_slug_groups as $slug_group ) {\n\n\t\t\t// ...and see if any of these slugs...\n\t\t\tforeach ( $slug_group as $slug ) {\n\n\t\t\t\t// ...and any of the new sidebars...\n\t\t\t\tforeach ( $wp_registered_sidebars as $new_sidebar => $args ) {\n\n\t\t\t\t\t// ...actually match!\n\t\t\t\t\tif ( false === stripos( $new_sidebar, $slug ) && false === stripos( $slug, $new_sidebar ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Then see if any of the existing sidebars...\n\t\t\t\t\tforeach ( $existing_sidebars_widgets as $sidebar => $widgets ) {\n\n\t\t\t\t\t\t// ...and any slug in the same group...\n\t\t\t\t\t\tforeach ( $slug_group as $slug ) {\n\n\t\t\t\t\t\t\t// ... have a match as well.\n\t\t\t\t\t\t\tif ( false === stripos( $sidebar, $slug ) && false === stripos( $slug, $sidebar ) ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Make sure this sidebar wasn't mapped and removed previously.\n\t\t\t\t\t\t\tif ( ! empty( $existing_sidebars_widgets[ $sidebar ] ) ) {\n\n\t\t\t\t\t\t\t\t// We have a match that can be mapped!\n\t\t\t\t\t\t\t\t$new_sidebars_widgets[ $new_sidebar ] = array_merge( $new_sidebars_widgets[ $new_sidebar ], $existing_sidebars_widgets[ $sidebar ] );\n\n\t\t\t\t\t\t\t\t// Remove the mapped sidebar so it can't be mapped again.\n\t\t\t\t\t\t\t\tunset( $existing_sidebars_widgets[ $sidebar ] );\n\n\t\t\t\t\t\t\t\t// Go back and check the next new sidebar.\n\t\t\t\t\t\t\t\tcontinue 3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // End foreach ( $slug_group as $slug ).\n\t\t\t\t\t} // End foreach ( $existing_sidebars_widgets as $sidebar => $widgets ).\n\t\t\t\t} // End foreach ( $wp_registered_sidebars as $new_sidebar => $args ).\n\t\t\t} // End foreach ( $slug_group as $slug ).\n\t\t} // End foreach ( $common_slug_groups as $slug_group ).\n\t}\n\n\t// Move any left over widgets to inactive sidebar.\n\tforeach ( $existing_sidebars_widgets as $widgets ) {\n\t\tif ( is_array( $widgets ) && ! empty( $widgets ) ) {\n\t\t\t$new_sidebars_widgets['wp_inactive_widgets'] = array_merge( $new_sidebars_widgets['wp_inactive_widgets'], $widgets );\n\t\t}\n\t}\n\n\t// Sidebars_widgets settings from when this theme was previously active.\n\t$old_sidebars_widgets = get_theme_mod( 'sidebars_widgets' );\n\t$old_sidebars_widgets = isset( $old_sidebars_widgets['data'] ) ? $old_sidebars_widgets['data'] : false;\n\n\tif ( is_array( $old_sidebars_widgets ) ) {\n\n\t\t// Remove empty sidebars, no need to map those.\n\t\t$old_sidebars_widgets = array_filter( $old_sidebars_widgets );\n\n\t\t// Only check sidebars that are empty or have not been mapped to yet.\n\t\tforeach ( $new_sidebars_widgets as $new_sidebar => $new_widgets ) {\n\t\t\tif ( array_key_exists( $new_sidebar, $old_sidebars_widgets ) && ! empty( $new_widgets ) ) {\n\t\t\t\tunset( $old_sidebars_widgets[ $new_sidebar ] );\n\t\t\t}\n\t\t}\n\n\t\t// Remove orphaned widgets, we're only interested in previously active sidebars.\n\t\tforeach ( $old_sidebars_widgets as $sidebar => $widgets ) {\n\t\t\tif ( 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) {\n\t\t\t\tunset( $old_sidebars_widgets[ $sidebar ] );\n\t\t\t}\n\t\t}\n\n\t\t$old_sidebars_widgets = _wp_remove_unregistered_widgets( $old_sidebars_widgets );\n\n\t\tif ( ! empty( $old_sidebars_widgets ) ) {\n\n\t\t\t// Go through each remaining sidebar...\n\t\t\tforeach ( $old_sidebars_widgets as $old_sidebar => $old_widgets ) {\n\n\t\t\t\t// ...and check every new sidebar...\n\t\t\t\tforeach ( $new_sidebars_widgets as $new_sidebar => $new_widgets ) {\n\n\t\t\t\t\t// ...for every widget we're trying to revive.\n\t\t\t\t\tforeach ( $old_widgets as $key => $widget_id ) {\n\t\t\t\t\t\t$active_key = array_search( $widget_id, $new_widgets, true );\n\n\t\t\t\t\t\t// If the widget is used elsewhere...\n\t\t\t\t\t\tif ( false !== $active_key ) {\n\n\t\t\t\t\t\t\t// ...and that elsewhere is inactive widgets...\n\t\t\t\t\t\t\tif ( 'wp_inactive_widgets' === $new_sidebar ) {\n\n\t\t\t\t\t\t\t\t// ...remove it from there and keep the active version...\n\t\t\t\t\t\t\t\tunset( $new_sidebars_widgets['wp_inactive_widgets'][ $active_key ] );\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// ...otherwise remove it from the old sidebar and keep it in the new one.\n\t\t\t\t\t\t\t\tunset( $old_sidebars_widgets[ $old_sidebar ][ $key ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // End if ( $active_key ).\n\t\t\t\t\t} // End foreach ( $old_widgets as $key => $widget_id ).\n\t\t\t\t} // End foreach ( $new_sidebars_widgets as $new_sidebar => $new_widgets ).\n\t\t\t} // End foreach ( $old_sidebars_widgets as $old_sidebar => $old_widgets ).\n\t\t} // End if ( ! empty( $old_sidebars_widgets ) ).\n\n\t\t// Restore widget settings from when theme was previously active.\n\t\t$new_sidebars_widgets = array_merge( $new_sidebars_widgets, $old_sidebars_widgets );\n\t}\n\n\treturn $new_sidebars_widgets;\n}\n\n/**\n * Compares a list of sidebars with their widgets against an allowed list.\n *\n * @since 4.9.0\n *\n * @param array $sidebars_widgets   List of sidebars and their widget instance IDs.\n * @param array $allowed_widget_ids Optional. List of widget IDs to compare against. Default: Registered widgets.\n * @return array Sidebars with allowed widgets.\n */\nfunction _wp_remove_unregistered_widgets( $sidebars_widgets, $allowed_widget_ids = array() ) {\n\tif ( empty( $allowed_widget_ids ) ) {\n\t\t$allowed_widget_ids = array_keys( $GLOBALS['wp_registered_widgets'] );\n\t}\n\n\tforeach ( $sidebars_widgets as $sidebar => $widgets ) {\n\t\tif ( is_array( $widgets ) ) {\n\t\t\t$sidebars_widgets[ $sidebar ] = array_intersect( $widgets, $allowed_widget_ids );\n\t\t}\n\t}\n\n\treturn $sidebars_widgets;\n}\n\n/**\n * Display the RSS entries in a list.\n *\n * @since 2.5.0\n *\n * @param string|array|object $rss  RSS url.\n * @param array               $args Widget arguments.\n */\nfunction wp_widget_rss_output( $rss, $args = array() ) {\n\tif ( is_string( $rss ) ) {\n\t\t$rss = fetch_feed( $rss );\n\t} elseif ( is_array( $rss ) && isset( $rss['url'] ) ) {\n\t\t$args = $rss;\n\t\t$rss  = fetch_feed( $rss['url'] );\n\t} elseif ( ! is_object( $rss ) ) {\n\t\treturn;\n\t}\n\n\tif ( is_wp_error( $rss ) ) {\n\t\tif ( is_admin() || current_user_can( 'manage_options' ) ) {\n\t\t\techo '<p><strong>' . __( 'RSS Error:' ) . '</strong> ' . $rss->get_error_message() . '</p>';\n\t\t}\n\t\treturn;\n\t}\n\n\t$default_args = array(\n\t\t'show_author'  => 0,\n\t\t'show_date'    => 0,\n\t\t'show_summary' => 0,\n\t\t'items'        => 0,\n\t);\n\t$args         = wp_parse_args( $args, $default_args );\n\n\t$items = (int) $args['items'];\n\tif ( $items < 1 || 20 < $items ) {\n\t\t$items = 10;\n\t}\n\t$show_summary = (int) $args['show_summary'];\n\t$show_author  = (int) $args['show_author'];\n\t$show_date    = (int) $args['show_date'];\n\n\tif ( ! $rss->get_item_quantity() ) {\n\t\techo '<ul><li>' . __( 'An error has occurred, which probably means the feed is down. Try again later.' ) . '</li></ul>';\n\t\t$rss->__destruct();\n\t\tunset( $rss );\n\t\treturn;\n\t}\n\n\techo '<ul>';\n\tforeach ( $rss->get_items( 0, $items ) as $item ) {\n\t\t$link = $item->get_link();\n\t\twhile ( stristr( $link, 'http' ) !== $link ) {\n\t\t\t$link = substr( $link, 1 );\n\t\t}\n\t\t$link = esc_url( strip_tags( $link ) );\n\n\t\t$title = esc_html( trim( strip_tags( $item->get_title() ) ) );\n\t\tif ( empty( $title ) ) {\n\t\t\t$title = __( 'Untitled' );\n\t\t}\n\n\t\t$desc = html_entity_decode( $item->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) );\n\t\t$desc = esc_attr( wp_trim_words( $desc, 55, ' [&hellip;]' ) );\n\n\t\t$summary = '';\n\t\tif ( $show_summary ) {\n\t\t\t$summary = $desc;\n\n\t\t\t// Change existing [...] to [&hellip;].\n\t\t\tif ( '[...]' === substr( $summary, -5 ) ) {\n\t\t\t\t$summary = substr( $summary, 0, -5 ) . '[&hellip;]';\n\t\t\t}\n\n\t\t\t$summary = '<div class=\"rssSummary\">' . esc_html( $summary ) . '</div>';\n\t\t}\n\n\t\t$date = '';\n\t\tif ( $show_date ) {\n\t\t\t$date = $item->get_date( 'U' );\n\n\t\t\tif ( $date ) {\n\t\t\t\t$date = ' <span class=\"rss-date\">' . date_i18n( get_option( 'date_format' ), $date ) . '</span>';\n\t\t\t}\n\t\t}\n\n\t\t$author = '';\n\t\tif ( $show_author ) {\n\t\t\t$author = $item->get_author();\n\t\t\tif ( is_object( $author ) ) {\n\t\t\t\t$author = $author->get_name();\n\t\t\t\t$author = ' <cite>' . esc_html( strip_tags( $author ) ) . '</cite>';\n\t\t\t}\n\t\t}\n\n\t\tif ( '' === $link ) {\n\t\t\techo \"<li>$title{$date}{$summary}{$author}</li>\";\n\t\t} elseif ( $show_summary ) {\n\t\t\techo \"<li><a class='rsswidget' href='$link'>$title</a>{$date}{$summary}{$author}</li>\";\n\t\t} else {\n\t\t\techo \"<li><a class='rsswidget' href='$link'>$title</a>{$date}{$author}</li>\";\n\t\t}\n\t}\n\techo '</ul>';\n\t$rss->__destruct();\n\tunset( $rss );\n}\n\n/**\n * Display RSS widget options form.\n *\n * The options for what fields are displayed for the RSS form are all booleans\n * and are as follows: 'url', 'title', 'items', 'show_summary', 'show_author',\n * 'show_date'.\n *\n * @since 2.5.0\n *\n * @param array|string $args   Values for input fields.\n * @param array        $inputs Override default display options.\n */\nfunction wp_widget_rss_form( $args, $inputs = null ) {\n\t$default_inputs = array(\n\t\t'url'          => true,\n\t\t'title'        => true,\n\t\t'items'        => true,\n\t\t'show_summary' => true,\n\t\t'show_author'  => true,\n\t\t'show_date'    => true,\n\t);\n\t$inputs         = wp_parse_args( $inputs, $default_inputs );\n\n\t$args['title'] = isset( $args['title'] ) ? $args['title'] : '';\n\t$args['url']   = isset( $args['url'] ) ? $args['url'] : '';\n\t$args['items'] = isset( $args['items'] ) ? (int) $args['items'] : 0;\n\n\tif ( $args['items'] < 1 || 20 < $args['items'] ) {\n\t\t$args['items'] = 10;\n\t}\n\n\t$args['show_summary'] = isset( $args['show_summary'] ) ? (int) $args['show_summary'] : (int) $inputs['show_summary'];\n\t$args['show_author']  = isset( $args['show_author'] ) ? (int) $args['show_author'] : (int) $inputs['show_author'];\n\t$args['show_date']    = isset( $args['show_date'] ) ? (int) $args['show_date'] : (int) $inputs['show_date'];\n\n\tif ( ! empty( $args['error'] ) ) {\n\t\techo '<p class=\"widget-error\"><strong>' . __( 'RSS Error:' ) . '</strong> ' . $args['error'] . '</p>';\n\t}\n\n\t$esc_number = esc_attr( $args['number'] );\n\tif ( $inputs['url'] ) :\n\t\t?>\n\t<p><label for=\"rss-url-<?php echo $esc_number; ?>\"><?php _e( 'Enter the RSS feed URL here:' ); ?></label>\n\t<input class=\"widefat\" id=\"rss-url-<?php echo $esc_number; ?>\" name=\"widget-rss[<?php echo $esc_number; ?>][url]\" type=\"text\" value=\"<?php echo esc_url( $args['url'] ); ?>\" /></p>\n<?php endif; if ( $inputs['title'] ) : ?>\n\t<p><label for=\"rss-title-<?php echo $esc_number; ?>\"><?php _e( 'Give the feed a title (optional):' ); ?></label>\n\t<input class=\"widefat\" id=\"rss-title-<?php echo $esc_number; ?>\" name=\"widget-rss[<?php echo $esc_number; ?>][title]\" type=\"text\" value=\"<?php echo esc_attr( $args['title'] ); ?>\" /></p>\n<?php endif; if ( $inputs['items'] ) : ?>\n\t<p><label for=\"rss-items-<?php echo $esc_number; ?>\"><?php _e( 'How many items would you like to display?' ); ?></label>\n\t<select id=\"rss-items-<?php echo $esc_number; ?>\" name=\"widget-rss[<?php echo $esc_number; ?>][items]\">\n\t<?php\n\tfor ( $i = 1; $i <= 20; ++$i ) {\n\t\techo \"<option value='$i' \" . selected( $args['items'], $i, false ) . \">$i</option>\";\n\t}\n\t?>\n\t</select></p>\n<?php endif; if ( $inputs['show_summary'] || $inputs['show_author'] || $inputs['show_date'] ) : ?>\n\t<p>\n\t<?php if ( $inputs['show_summary'] ) : ?>\n\t\t<input id=\"rss-show-summary-<?php echo $esc_number; ?>\" name=\"widget-rss[<?php echo $esc_number; ?>][show_summary]\" type=\"checkbox\" value=\"1\" <?php checked( $args['show_summary'] ); ?> />\n\t\t<label for=\"rss-show-summary-<?php echo $esc_number; ?>\"><?php _e( 'Display item content?' ); ?></label><br />\n\t<?php endif; if ( $inputs['show_author'] ) : ?>\n\t\t<input id=\"rss-show-author-<?php echo $esc_number; ?>\" name=\"widget-rss[<?php echo $esc_number; ?>][show_author]\" type=\"checkbox\" value=\"1\" <?php checked( $args['show_author'] ); ?> />\n\t\t<label for=\"rss-show-author-<?php echo $esc_number; ?>\"><?php _e( 'Display item author if available?' ); ?></label><br />\n\t<?php endif; if ( $inputs['show_date'] ) : ?>\n\t\t<input id=\"rss-show-date-<?php echo $esc_number; ?>\" name=\"widget-rss[<?php echo $esc_number; ?>][show_date]\" type=\"checkbox\" value=\"1\" <?php checked( $args['show_date'] ); ?>/>\n\t\t<label for=\"rss-show-date-<?php echo $esc_number; ?>\"><?php _e( 'Display item date?' ); ?></label><br />\n\t<?php endif; ?>\n\t</p>\n\t<?php\n\tendif; // End of display options.\nforeach ( array_keys( $default_inputs ) as $input ) :\n\tif ( 'hidden' === $inputs[ $input ] ) :\n\t\t$id = str_replace( '_', '-', $input );\n\t\t?>\n<input type=\"hidden\" id=\"rss-<?php echo esc_attr( $id ); ?>-<?php echo $esc_number; ?>\" name=\"widget-rss[<?php echo $esc_number; ?>][<?php echo esc_attr( $input ); ?>]\" value=\"<?php echo esc_attr( $args[ $input ] ); ?>\" />\n\t\t<?php\n\tendif;\n\tendforeach;\n}\n\n/**\n * Process RSS feed widget data and optionally retrieve feed items.\n *\n * The feed widget can not have more than 20 items or it will reset back to the\n * default, which is 10.\n *\n * The resulting array has the feed title, feed url, feed link (from channel),\n * feed items, error (if any), and whether to show summary, author, and date.\n * All respectively in the order of the array elements.\n *\n * @since 2.5.0\n *\n * @param array $widget_rss RSS widget feed data. Expects unescaped data.\n * @param bool  $check_feed Optional. Whether to check feed for errors. Default true.\n * @return array\n */\nfunction wp_widget_rss_process( $widget_rss, $check_feed = true ) {\n\t$items = (int) $widget_rss['items'];\n\tif ( $items < 1 || 20 < $items ) {\n\t\t$items = 10;\n\t}\n\t$url          = esc_url_raw( strip_tags( $widget_rss['url'] ) );\n\t$title        = isset( $widget_rss['title'] ) ? trim( strip_tags( $widget_rss['title'] ) ) : '';\n\t$show_summary = isset( $widget_rss['show_summary'] ) ? (int) $widget_rss['show_summary'] : 0;\n\t$show_author  = isset( $widget_rss['show_author'] ) ? (int) $widget_rss['show_author'] : 0;\n\t$show_date    = isset( $widget_rss['show_date'] ) ? (int) $widget_rss['show_date'] : 0;\n\n\tif ( $check_feed ) {\n\t\t$rss   = fetch_feed( $url );\n\t\t$error = false;\n\t\t$link  = '';\n\t\tif ( is_wp_error( $rss ) ) {\n\t\t\t$error = $rss->get_error_message();\n\t\t} else {\n\t\t\t$link = esc_url( strip_tags( $rss->get_permalink() ) );\n\t\t\twhile ( stristr( $link, 'http' ) !== $link ) {\n\t\t\t\t$link = substr( $link, 1 );\n\t\t\t}\n\n\t\t\t$rss->__destruct();\n\t\t\tunset( $rss );\n\t\t}\n\t}\n\n\treturn compact( 'title', 'url', 'link', 'items', 'error', 'show_summary', 'show_author', 'show_date' );\n}\n\n/**\n * Registers all of the default WordPress widgets on startup.\n *\n * Calls {@see 'widgets_init'} action after all of the WordPress widgets have been registered.\n *\n * @since 2.2.0\n */\nfunction wp_widgets_init() {\n\tif ( ! is_blog_installed() ) {\n\t\treturn;\n\t}\n\n\tregister_widget( 'WP_Widget_Pages' );\n\n\tregister_widget( 'WP_Widget_Calendar' );\n\n\tregister_widget( 'WP_Widget_Archives' );\n\n\tif ( get_option( 'link_manager_enabled' ) ) {\n\t\tregister_widget( 'WP_Widget_Links' );\n\t}\n\n\tregister_widget( 'WP_Widget_Media_Audio' );\n\n\tregister_widget( 'WP_Widget_Media_Image' );\n\n\tregister_widget( 'WP_Widget_Media_Gallery' );\n\n\tregister_widget( 'WP_Widget_Media_Video' );\n\n\tregister_widget( 'WP_Widget_Meta' );\n\n\tregister_widget( 'WP_Widget_Search' );\n\n\tregister_widget( 'WP_Widget_Text' );\n\n\tregister_widget( 'WP_Widget_Categories' );\n\n\tregister_widget( 'WP_Widget_Recent_Posts' );\n\n\tregister_widget( 'WP_Widget_Recent_Comments' );\n\n\tregister_widget( 'WP_Widget_RSS' );\n\n\tregister_widget( 'WP_Widget_Tag_Cloud' );\n\n\tregister_widget( 'WP_Nav_Menu_Widget' );\n\n\tregister_widget( 'WP_Widget_Custom_HTML' );\n\n\t/**\n\t * Fires after all default WordPress widgets have been registered.\n\t *\n\t * @since 2.2.0\n\t */\n\tdo_action( 'widgets_init' );\n}\n", "num_lines": 1775}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress database access abstraction class\n *\n * Original code from {@link http://php.justinvincent.com Justin Vincent (justin@visunet.ie)}\n *\n * @package WordPress\n * @subpackage Database\n * @since 0.71\n */\n\n/**\n * @since 0.71\n */\ndefine( 'EZSQL_VERSION', 'WP1.25' );\n\n/**\n * @since 0.71\n */\ndefine( 'OBJECT', 'OBJECT' );\n// phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase\ndefine( 'object', 'OBJECT' ); // Back compat.\n\n/**\n * @since 2.5.0\n */\ndefine( 'OBJECT_K', 'OBJECT_K' );\n\n/**\n * @since 0.71\n */\ndefine( 'ARRAY_A', 'ARRAY_A' );\n\n/**\n * @since 0.71\n */\ndefine( 'ARRAY_N', 'ARRAY_N' );\n\n/**\n * WordPress database access abstraction class.\n *\n * This class is used to interact with a database without needing to use raw SQL statements.\n * By default, WordPress uses this class to instantiate the global $wpdb object, providing\n * access to the WordPress database.\n *\n * It is possible to replace this class with your own by setting the $wpdb global variable\n * in wp-content/db.php file to your class. The wpdb class will still be included, so you can\n * extend it or simply use your own.\n *\n * @link https://developer.wordpress.org/reference/classes/wpdb/\n *\n * @since 0.71\n */\nclass wpdb {\n\n\t/**\n\t * Whether to show SQL/DB errors.\n\t *\n\t * Default is to show errors if both WP_DEBUG and WP_DEBUG_DISPLAY evaluate to true.\n\t *\n\t * @since 0.71\n\t * @var bool\n\t */\n\tvar $show_errors = false;\n\n\t/**\n\t * Whether to suppress errors during the DB bootstrapping. Default false.\n\t *\n\t * @since 2.5.0\n\t * @var bool\n\t */\n\tvar $suppress_errors = false;\n\n\t/**\n\t * The error encountered during the last query.\n\t *\n\t * @since 2.5.0\n\t * @var string\n\t */\n\tpublic $last_error = '';\n\n\t/**\n\t * The number of queries made.\n\t *\n\t * @since 1.2.0\n\t * @var int\n\t */\n\tpublic $num_queries = 0;\n\n\t/**\n\t * Count of rows returned by the last query.\n\t *\n\t * @since 0.71\n\t * @var int\n\t */\n\tpublic $num_rows = 0;\n\n\t/**\n\t * Count of rows affected by the last query.\n\t *\n\t * @since 0.71\n\t * @var int\n\t */\n\tvar $rows_affected = 0;\n\n\t/**\n\t * The ID generated for an AUTO_INCREMENT column by the last query (usually INSERT).\n\t *\n\t * @since 0.71\n\t * @var int\n\t */\n\tpublic $insert_id = 0;\n\n\t/**\n\t * The last query made.\n\t *\n\t * @since 0.71\n\t * @var string\n\t */\n\tvar $last_query;\n\n\t/**\n\t * Results of the last query.\n\t *\n\t * @since 0.71\n\t * @var array|null\n\t */\n\tvar $last_result;\n\n\t/**\n\t * MySQL result, which is either a resource or boolean.\n\t *\n\t * @since 0.71\n\t * @var mixed\n\t */\n\tprotected $result;\n\n\t/**\n\t * Cached column info, for sanity checking data before inserting.\n\t *\n\t * @since 4.2.0\n\t * @var array\n\t */\n\tprotected $col_meta = array();\n\n\t/**\n\t * Calculated character sets on tables.\n\t *\n\t * @since 4.2.0\n\t * @var array\n\t */\n\tprotected $table_charset = array();\n\n\t/**\n\t * Whether text fields in the current query need to be sanity checked. Default false.\n\t *\n\t * @since 4.2.0\n\t * @var bool\n\t */\n\tprotected $check_current_query = true;\n\n\t/**\n\t * Flag to ensure we don't run into recursion problems when checking the collation.\n\t *\n\t * @since 4.2.0\n\t * @see wpdb::check_safe_collation()\n\t * @var bool\n\t */\n\tprivate $checking_collation = false;\n\n\t/**\n\t * Saved info on the table column.\n\t *\n\t * @since 0.71\n\t * @var array\n\t */\n\tprotected $col_info;\n\n\t/**\n\t * Log of queries that were executed, for debugging purposes.\n\t *\n\t * @since 1.5.0\n\t * @since 2.5.0 The third element in each query log was added to record the calling functions.\n\t * @since 5.1.0 The fourth element in each query log was added to record the start time.\n\t * @since 5.3.0 The fifth element in each query log was added to record custom data.\n\t *\n\t * @var array[] {\n\t *     Array of queries that were executed.\n\t *\n\t *     @type array ...$0 {\n\t *         Data for each query.\n\t *\n\t *         @type string $0 The query's SQL.\n\t *         @type float  $1 Total time spent on the query, in seconds.\n\t *         @type string $2 Comma-separated list of the calling functions.\n\t *         @type float  $3 Unix timestamp of the time at the start of the query.\n\t *         @type array  $4 Custom query data.\n\t *     }\n\t * }\n\t */\n\tvar $queries;\n\n\t/**\n\t * The number of times to retry reconnecting before dying. Default 5.\n\t *\n\t * @since 3.9.0\n\t * @see wpdb::check_connection()\n\t * @var int\n\t */\n\tprotected $reconnect_retries = 5;\n\n\t/**\n\t * WordPress table prefix\n\t *\n\t * You can set this to have multiple WordPress installations in a single database.\n\t * The second reason is for possible security precautions.\n\t *\n\t * @since 2.5.0\n\t * @var string\n\t */\n\tpublic $prefix = '';\n\n\t/**\n\t * WordPress base table prefix.\n\t *\n\t * @since 3.0.0\n\t * @var string\n\t */\n\tpublic $base_prefix;\n\n\t/**\n\t * Whether the database queries are ready to start executing.\n\t *\n\t * @since 2.3.2\n\t * @var bool\n\t */\n\tvar $ready = false;\n\n\t/**\n\t * Blog ID.\n\t *\n\t * @since 3.0.0\n\t * @var int\n\t */\n\tpublic $blogid = 0;\n\n\t/**\n\t * Site ID.\n\t *\n\t * @since 3.0.0\n\t * @var int\n\t */\n\tpublic $siteid = 0;\n\n\t/**\n\t * List of WordPress per-blog tables.\n\t *\n\t * @since 2.5.0\n\t * @see wpdb::tables()\n\t * @var array\n\t */\n\tvar $tables = array(\n\t\t'posts',\n\t\t'comments',\n\t\t'links',\n\t\t'options',\n\t\t'postmeta',\n\t\t'terms',\n\t\t'term_taxonomy',\n\t\t'term_relationships',\n\t\t'termmeta',\n\t\t'commentmeta',\n\t);\n\n\t/**\n\t * List of deprecated WordPress tables.\n\t *\n\t * 'categories', 'post2cat', and 'link2cat' were deprecated in 2.3.0, db version 5539.\n\t *\n\t * @since 2.9.0\n\t * @see wpdb::tables()\n\t * @var array\n\t */\n\tvar $old_tables = array( 'categories', 'post2cat', 'link2cat' );\n\n\t/**\n\t * List of WordPress global tables.\n\t *\n\t * @since 3.0.0\n\t * @see wpdb::tables()\n\t * @var array\n\t */\n\tvar $global_tables = array( 'users', 'usermeta' );\n\n\t/**\n\t * List of Multisite global tables.\n\t *\n\t * @since 3.0.0\n\t * @see wpdb::tables()\n\t * @var array\n\t */\n\tvar $ms_global_tables = array(\n\t\t'blogs',\n\t\t'blogmeta',\n\t\t'signups',\n\t\t'site',\n\t\t'sitemeta',\n\t\t'sitecategories',\n\t\t'registration_log',\n\t);\n\n\t/**\n\t * WordPress Comments table.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tpublic $comments;\n\n\t/**\n\t * WordPress Comment Metadata table.\n\t *\n\t * @since 2.9.0\n\t * @var string\n\t */\n\tpublic $commentmeta;\n\n\t/**\n\t * WordPress Links table.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tpublic $links;\n\n\t/**\n\t * WordPress Options table.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tpublic $options;\n\n\t/**\n\t * WordPress Post Metadata table.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tpublic $postmeta;\n\n\t/**\n\t * WordPress Posts table.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tpublic $posts;\n\n\t/**\n\t * WordPress Terms table.\n\t *\n\t * @since 2.3.0\n\t * @var string\n\t */\n\tpublic $terms;\n\n\t/**\n\t * WordPress Term Relationships table.\n\t *\n\t * @since 2.3.0\n\t * @var string\n\t */\n\tpublic $term_relationships;\n\n\t/**\n\t * WordPress Term Taxonomy table.\n\t *\n\t * @since 2.3.0\n\t * @var string\n\t */\n\tpublic $term_taxonomy;\n\n\t/**\n\t * WordPress Term Meta table.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tpublic $termmeta;\n\n\t//\n\t// Global and Multisite tables\n\t//\n\n\t/**\n\t * WordPress User Metadata table.\n\t *\n\t * @since 2.3.0\n\t * @var string\n\t */\n\tpublic $usermeta;\n\n\t/**\n\t * WordPress Users table.\n\t *\n\t * @since 1.5.0\n\t * @var string\n\t */\n\tpublic $users;\n\n\t/**\n\t * Multisite Blogs table.\n\t *\n\t * @since 3.0.0\n\t * @var string\n\t */\n\tpublic $blogs;\n\n\t/**\n\t * Multisite Blog Metadata table.\n\t *\n\t * @since 5.1.0\n\t * @var string\n\t */\n\tpublic $blogmeta;\n\n\t/**\n\t * Multisite Registration Log table.\n\t *\n\t * @since 3.0.0\n\t * @var string\n\t */\n\tpublic $registration_log;\n\n\t/**\n\t * Multisite Signups table.\n\t *\n\t * @since 3.0.0\n\t * @var string\n\t */\n\tpublic $signups;\n\n\t/**\n\t * Multisite Sites table.\n\t *\n\t * @since 3.0.0\n\t * @var string\n\t */\n\tpublic $site;\n\n\t/**\n\t * Multisite Sitewide Terms table.\n\t *\n\t * @since 3.0.0\n\t * @var string\n\t */\n\tpublic $sitecategories;\n\n\t/**\n\t * Multisite Site Metadata table.\n\t *\n\t * @since 3.0.0\n\t * @var string\n\t */\n\tpublic $sitemeta;\n\n\t/**\n\t * Format specifiers for DB columns.\n\t *\n\t * Columns not listed here default to %s. Initialized during WP load.\n\t * Keys are column names, values are format types: 'ID' => '%d'.\n\t *\n\t * @since 2.8.0\n\t * @see wpdb::prepare()\n\t * @see wpdb::insert()\n\t * @see wpdb::update()\n\t * @see wpdb::delete()\n\t * @see wp_set_wpdb_vars()\n\t * @var array\n\t */\n\tpublic $field_types = array();\n\n\t/**\n\t * Database table columns charset.\n\t *\n\t * @since 2.2.0\n\t * @var string\n\t */\n\tpublic $charset;\n\n\t/**\n\t * Database table columns collate.\n\t *\n\t * @since 2.2.0\n\t * @var string\n\t */\n\tpublic $collate;\n\n\t/**\n\t * Database Username.\n\t *\n\t * @since 2.9.0\n\t * @var string\n\t */\n\tprotected $dbuser;\n\n\t/**\n\t * Database Password.\n\t *\n\t * @since 3.1.0\n\t * @var string\n\t */\n\tprotected $dbpassword;\n\n\t/**\n\t * Database Name.\n\t *\n\t * @since 3.1.0\n\t * @var string\n\t */\n\tprotected $dbname;\n\n\t/**\n\t * Database Host.\n\t *\n\t * @since 3.1.0\n\t * @var string\n\t */\n\tprotected $dbhost;\n\n\t/**\n\t * Database Handle.\n\t *\n\t * @since 0.71\n\t * @var string\n\t */\n\tprotected $dbh;\n\n\t/**\n\t * A textual description of the last query/get_row/get_var call.\n\t *\n\t * @since 3.0.0\n\t * @var string\n\t */\n\tpublic $func_call;\n\n\t/**\n\t * Whether MySQL is used as the database engine.\n\t *\n\t * Set in wpdb::db_connect() to true, by default. This is used when checking\n\t * against the required MySQL version for WordPress. Normally, a replacement\n\t * database drop-in (db.php) will skip these checks, but setting this to true\n\t * will force the checks to occur.\n\t *\n\t * @since 3.3.0\n\t * @var bool\n\t */\n\tpublic $is_mysql = null;\n\n\t/**\n\t * A list of incompatible SQL modes.\n\t *\n\t * @since 3.9.0\n\t * @var array\n\t */\n\tprotected $incompatible_modes = array(\n\t\t'NO_ZERO_DATE',\n\t\t'ONLY_FULL_GROUP_BY',\n\t\t'STRICT_TRANS_TABLES',\n\t\t'STRICT_ALL_TABLES',\n\t\t'TRADITIONAL',\n\t\t'ANSI',\n\t);\n\n\t/**\n\t * Whether to use mysqli over mysql. Default false.\n\t *\n\t * @since 3.9.0\n\t * @var bool\n\t */\n\tprivate $use_mysqli = false;\n\n\t/**\n\t * Whether we've managed to successfully connect at some point.\n\t *\n\t * @since 3.9.0\n\t * @var bool\n\t */\n\tprivate $has_connected = false;\n\n\t/**\n\t * Connects to the database server and selects a database.\n\t *\n\t * PHP5 style constructor for compatibility with PHP5. Does the actual setting up\n\t * of the class properties and connection to the database.\n\t *\n\t * @since 2.0.8\n\t *\n\t * @link https://core.trac.wordpress.org/ticket/3354\n\t * @global string $wp_version The WordPress version string.\n\t *\n\t * @param string $dbuser     MySQL database user.\n\t * @param string $dbpassword MySQL database password.\n\t * @param string $dbname     MySQL database name.\n\t * @param string $dbhost     MySQL database host.\n\t */\n\tpublic function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) {\n\t\tif ( WP_DEBUG && WP_DEBUG_DISPLAY ) {\n\t\t\t$this->show_errors();\n\t\t}\n\n\t\t// Use ext/mysqli if it exists unless WP_USE_EXT_MYSQL is defined as true.\n\t\tif ( function_exists( 'mysqli_connect' ) ) {\n\t\t\t$this->use_mysqli = true;\n\n\t\t\tif ( defined( 'WP_USE_EXT_MYSQL' ) ) {\n\t\t\t\t$this->use_mysqli = ! WP_USE_EXT_MYSQL;\n\t\t\t}\n\t\t}\n\n\t\t$this->dbuser     = $dbuser;\n\t\t$this->dbpassword = $dbpassword;\n\t\t$this->dbname     = $dbname;\n\t\t$this->dbhost     = $dbhost;\n\n\t\t// wp-config.php creation will manually connect when ready.\n\t\tif ( defined( 'WP_SETUP_CONFIG' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->db_connect();\n\t}\n\n\t/**\n\t * Makes private properties readable for backward compatibility.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $name The private member to get, and optionally process.\n\t * @return mixed The private member.\n\t */\n\tpublic function __get( $name ) {\n\t\tif ( 'col_info' === $name ) {\n\t\t\t$this->load_col_info();\n\t\t}\n\n\t\treturn $this->$name;\n\t}\n\n\t/**\n\t * Makes private properties settable for backward compatibility.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $name  The private member to set.\n\t * @param mixed  $value The value to set.\n\t */\n\tpublic function __set( $name, $value ) {\n\t\t$protected_members = array(\n\t\t\t'col_meta',\n\t\t\t'table_charset',\n\t\t\t'check_current_query',\n\t\t);\n\t\tif ( in_array( $name, $protected_members, true ) ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->$name = $value;\n\t}\n\n\t/**\n\t * Makes private properties check-able for backward compatibility.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $name The private member to check.\n\t * @return bool If the member is set or not.\n\t */\n\tpublic function __isset( $name ) {\n\t\treturn isset( $this->$name );\n\t}\n\n\t/**\n\t * Makes private properties un-settable for backward compatibility.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @param string $name  The private member to unset\n\t */\n\tpublic function __unset( $name ) {\n\t\tunset( $this->$name );\n\t}\n\n\t/**\n\t * Sets $this->charset and $this->collate.\n\t *\n\t * @since 3.1.0\n\t */\n\tpublic function init_charset() {\n\t\t$charset = '';\n\t\t$collate = '';\n\n\t\tif ( function_exists( 'is_multisite' ) && is_multisite() ) {\n\t\t\t$charset = 'utf8';\n\t\t\tif ( defined( 'DB_COLLATE' ) && DB_COLLATE ) {\n\t\t\t\t$collate = DB_COLLATE;\n\t\t\t} else {\n\t\t\t\t$collate = 'utf8_general_ci';\n\t\t\t}\n\t\t} elseif ( defined( 'DB_COLLATE' ) ) {\n\t\t\t$collate = DB_COLLATE;\n\t\t}\n\n\t\tif ( defined( 'DB_CHARSET' ) ) {\n\t\t\t$charset = DB_CHARSET;\n\t\t}\n\n\t\t$charset_collate = $this->determine_charset( $charset, $collate );\n\n\t\t$this->charset = $charset_collate['charset'];\n\t\t$this->collate = $charset_collate['collate'];\n\t}\n\n\t/**\n\t * Determines the best charset and collation to use given a charset and collation.\n\t *\n\t * For example, when able, utf8mb4 should be used instead of utf8.\n\t *\n\t * @since 4.6.0\n\t *\n\t * @param string $charset The character set to check.\n\t * @param string $collate The collation to check.\n\t * @return array {\n\t *     The most appropriate character set and collation to use.\n\t *\n\t *     @type string $charset Character set.\n\t *     @type string $collate Collation.\n\t * }\n\t */\n\tpublic function determine_charset( $charset, $collate ) {\n\t\tif ( ( $this->use_mysqli && ! ( $this->dbh instanceof mysqli ) ) || empty( $this->dbh ) ) {\n\t\t\treturn compact( 'charset', 'collate' );\n\t\t}\n\n\t\tif ( 'utf8' === $charset && $this->has_cap( 'utf8mb4' ) ) {\n\t\t\t$charset = 'utf8mb4';\n\t\t}\n\n\t\tif ( 'utf8mb4' === $charset && ! $this->has_cap( 'utf8mb4' ) ) {\n\t\t\t$charset = 'utf8';\n\t\t\t$collate = str_replace( 'utf8mb4_', 'utf8_', $collate );\n\t\t}\n\n\t\tif ( 'utf8mb4' === $charset ) {\n\t\t\t// _general_ is outdated, so we can upgrade it to _unicode_, instead.\n\t\t\tif ( ! $collate || 'utf8_general_ci' === $collate ) {\n\t\t\t\t$collate = 'utf8mb4_unicode_ci';\n\t\t\t} else {\n\t\t\t\t$collate = str_replace( 'utf8_', 'utf8mb4_', $collate );\n\t\t\t}\n\t\t}\n\n\t\t// _unicode_520_ is a better collation, we should use that when it's available.\n\t\tif ( $this->has_cap( 'utf8mb4_520' ) && 'utf8mb4_unicode_ci' === $collate ) {\n\t\t\t$collate = 'utf8mb4_unicode_520_ci';\n\t\t}\n\n\t\treturn compact( 'charset', 'collate' );\n\t}\n\n\t/**\n\t * Sets the connection's character set.\n\t *\n\t * @since 3.1.0\n\t *\n\t * @param resource $dbh     The resource given by mysql_connect.\n\t * @param string   $charset Optional. The character set. Default null.\n\t * @param string   $collate Optional. The collation. Default null.\n\t */\n\tpublic function set_charset( $dbh, $charset = null, $collate = null ) {\n\t\tif ( ! isset( $charset ) ) {\n\t\t\t$charset = $this->charset;\n\t\t}\n\t\tif ( ! isset( $collate ) ) {\n\t\t\t$collate = $this->collate;\n\t\t}\n\t\tif ( $this->has_cap( 'collation' ) && ! empty( $charset ) ) {\n\t\t\t$set_charset_succeeded = true;\n\n\t\t\tif ( $this->use_mysqli ) {\n\t\t\t\tif ( function_exists( 'mysqli_set_charset' ) && $this->has_cap( 'set_charset' ) ) {\n\t\t\t\t\t$set_charset_succeeded = mysqli_set_charset( $dbh, $charset );\n\t\t\t\t}\n\n\t\t\t\tif ( $set_charset_succeeded ) {\n\t\t\t\t\t$query = $this->prepare( 'SET NAMES %s', $charset );\n\t\t\t\t\tif ( ! empty( $collate ) ) {\n\t\t\t\t\t\t$query .= $this->prepare( ' COLLATE %s', $collate );\n\t\t\t\t\t}\n\t\t\t\t\tmysqli_query( $dbh, $query );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset' ) ) {\n\t\t\t\t\t$set_charset_succeeded = mysql_set_charset( $charset, $dbh );\n\t\t\t\t}\n\t\t\t\tif ( $set_charset_succeeded ) {\n\t\t\t\t\t$query = $this->prepare( 'SET NAMES %s', $charset );\n\t\t\t\t\tif ( ! empty( $collate ) ) {\n\t\t\t\t\t\t$query .= $this->prepare( ' COLLATE %s', $collate );\n\t\t\t\t\t}\n\t\t\t\t\tmysql_query( $query, $dbh );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Changes the current SQL mode, and ensures its WordPress compatibility.\n\t *\n\t * If no modes are passed, it will ensure the current MySQL server modes are compatible.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param array $modes Optional. A list of SQL modes to set. Default empty array.\n\t */\n\tpublic function set_sql_mode( $modes = array() ) {\n\t\tif ( empty( $modes ) ) {\n\t\t\tif ( $this->use_mysqli ) {\n\t\t\t\t$res = mysqli_query( $this->dbh, 'SELECT @@SESSION.sql_mode' );\n\t\t\t} else {\n\t\t\t\t$res = mysql_query( 'SELECT @@SESSION.sql_mode', $this->dbh );\n\t\t\t}\n\n\t\t\tif ( empty( $res ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( $this->use_mysqli ) {\n\t\t\t\t$modes_array = mysqli_fetch_array( $res );\n\t\t\t\tif ( empty( $modes_array[0] ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$modes_str = $modes_array[0];\n\t\t\t} else {\n\t\t\t\t$modes_str = mysql_result( $res, 0 );\n\t\t\t}\n\n\t\t\tif ( empty( $modes_str ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$modes = explode( ',', $modes_str );\n\t\t}\n\n\t\t$modes = array_change_key_case( $modes, CASE_UPPER );\n\n\t\t/**\n\t\t * Filters the list of incompatible SQL modes to exclude.\n\t\t *\n\t\t * @since 3.9.0\n\t\t *\n\t\t * @param array $incompatible_modes An array of incompatible modes.\n\t\t */\n\t\t$incompatible_modes = (array) apply_filters( 'incompatible_sql_modes', $this->incompatible_modes );\n\n\t\tforeach ( $modes as $i => $mode ) {\n\t\t\tif ( in_array( $mode, $incompatible_modes, true ) ) {\n\t\t\t\tunset( $modes[ $i ] );\n\t\t\t}\n\t\t}\n\n\t\t$modes_str = implode( ',', $modes );\n\n\t\tif ( $this->use_mysqli ) {\n\t\t\tmysqli_query( $this->dbh, \"SET SESSION sql_mode='$modes_str'\" );\n\t\t} else {\n\t\t\tmysql_query( \"SET SESSION sql_mode='$modes_str'\", $this->dbh );\n\t\t}\n\t}\n\n\t/**\n\t * Sets the table prefix for the WordPress tables.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $prefix          Alphanumeric name for the new prefix.\n\t * @param bool   $set_table_names Optional. Whether the table names, e.g. wpdb::$posts,\n\t *                                should be updated or not. Default true.\n\t * @return string|WP_Error Old prefix or WP_Error on error.\n\t */\n\tpublic function set_prefix( $prefix, $set_table_names = true ) {\n\n\t\tif ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) {\n\t\t\treturn new WP_Error( 'invalid_db_prefix', 'Invalid database prefix' );\n\t\t}\n\n\t\t$old_prefix = is_multisite() ? '' : $prefix;\n\n\t\tif ( isset( $this->base_prefix ) ) {\n\t\t\t$old_prefix = $this->base_prefix;\n\t\t}\n\n\t\t$this->base_prefix = $prefix;\n\n\t\tif ( $set_table_names ) {\n\t\t\tforeach ( $this->tables( 'global' ) as $table => $prefixed_table ) {\n\t\t\t\t$this->$table = $prefixed_table;\n\t\t\t}\n\n\t\t\tif ( is_multisite() && empty( $this->blogid ) ) {\n\t\t\t\treturn $old_prefix;\n\t\t\t}\n\n\t\t\t$this->prefix = $this->get_blog_prefix();\n\n\t\t\tforeach ( $this->tables( 'blog' ) as $table => $prefixed_table ) {\n\t\t\t\t$this->$table = $prefixed_table;\n\t\t\t}\n\n\t\t\tforeach ( $this->tables( 'old' ) as $table => $prefixed_table ) {\n\t\t\t\t$this->$table = $prefixed_table;\n\t\t\t}\n\t\t}\n\t\treturn $old_prefix;\n\t}\n\n\t/**\n\t * Sets blog ID.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param int $blog_id\n\t * @param int $network_id Optional.\n\t * @return int Previous blog ID.\n\t */\n\tpublic function set_blog_id( $blog_id, $network_id = 0 ) {\n\t\tif ( ! empty( $network_id ) ) {\n\t\t\t$this->siteid = $network_id;\n\t\t}\n\n\t\t$old_blog_id  = $this->blogid;\n\t\t$this->blogid = $blog_id;\n\n\t\t$this->prefix = $this->get_blog_prefix();\n\n\t\tforeach ( $this->tables( 'blog' ) as $table => $prefixed_table ) {\n\t\t\t$this->$table = $prefixed_table;\n\t\t}\n\n\t\tforeach ( $this->tables( 'old' ) as $table => $prefixed_table ) {\n\t\t\t$this->$table = $prefixed_table;\n\t\t}\n\n\t\treturn $old_blog_id;\n\t}\n\n\t/**\n\t * Gets blog prefix.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param int $blog_id Optional.\n\t * @return string Blog prefix.\n\t */\n\tpublic function get_blog_prefix( $blog_id = null ) {\n\t\tif ( is_multisite() ) {\n\t\t\tif ( null === $blog_id ) {\n\t\t\t\t$blog_id = $this->blogid;\n\t\t\t}\n\n\t\t\t$blog_id = (int) $blog_id;\n\n\t\t\tif ( defined( 'MULTISITE' ) && ( 0 === $blog_id || 1 === $blog_id ) ) {\n\t\t\t\treturn $this->base_prefix;\n\t\t\t} else {\n\t\t\t\treturn $this->base_prefix . $blog_id . '_';\n\t\t\t}\n\t\t} else {\n\t\t\treturn $this->base_prefix;\n\t\t}\n\t}\n\n\t/**\n\t * Returns an array of WordPress tables.\n\t *\n\t * Also allows for the CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE to override the WordPress users\n\t * and usermeta tables that would otherwise be determined by the prefix.\n\t *\n\t * The $scope argument can take one of the following:\n\t *\n\t * 'all' - returns 'all' and 'global' tables. No old tables are returned.\n\t * 'blog' - returns the blog-level tables for the queried blog.\n\t * 'global' - returns the global tables for the installation, returning multisite tables only on multisite.\n\t * 'ms_global' - returns the multisite global tables, regardless if current installation is multisite.\n\t * 'old' - returns tables which are deprecated.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @uses wpdb::$tables\n\t * @uses wpdb::$old_tables\n\t * @uses wpdb::$global_tables\n\t * @uses wpdb::$ms_global_tables\n\t *\n\t * @param string $scope   Optional. Possible values include 'all', 'global', 'ms_global', 'blog',\n\t *                        or 'old' tables. Default 'all'.\n\t * @param bool   $prefix  Optional. Whether to include table prefixes. If blog prefix is requested,\n\t *                        then the custom users and usermeta tables will be mapped. Default true.\n\t * @param int    $blog_id Optional. The blog_id to prefix. Used only when prefix is requested.\n\t *                        Defaults to wpdb::$blogid.\n\t * @return array Table names. When a prefix is requested, the key is the unprefixed table name.\n\t */\n\tpublic function tables( $scope = 'all', $prefix = true, $blog_id = 0 ) {\n\t\tswitch ( $scope ) {\n\t\t\tcase 'all':\n\t\t\t\t$tables = array_merge( $this->global_tables, $this->tables );\n\t\t\t\tif ( is_multisite() ) {\n\t\t\t\t\t$tables = array_merge( $tables, $this->ms_global_tables );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'blog':\n\t\t\t\t$tables = $this->tables;\n\t\t\t\tbreak;\n\t\t\tcase 'global':\n\t\t\t\t$tables = $this->global_tables;\n\t\t\t\tif ( is_multisite() ) {\n\t\t\t\t\t$tables = array_merge( $tables, $this->ms_global_tables );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ms_global':\n\t\t\t\t$tables = $this->ms_global_tables;\n\t\t\t\tbreak;\n\t\t\tcase 'old':\n\t\t\t\t$tables = $this->old_tables;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn array();\n\t\t}\n\n\t\tif ( $prefix ) {\n\t\t\tif ( ! $blog_id ) {\n\t\t\t\t$blog_id = $this->blogid;\n\t\t\t}\n\t\t\t$blog_prefix   = $this->get_blog_prefix( $blog_id );\n\t\t\t$base_prefix   = $this->base_prefix;\n\t\t\t$global_tables = array_merge( $this->global_tables, $this->ms_global_tables );\n\t\t\tforeach ( $tables as $k => $table ) {\n\t\t\t\tif ( in_array( $table, $global_tables, true ) ) {\n\t\t\t\t\t$tables[ $table ] = $base_prefix . $table;\n\t\t\t\t} else {\n\t\t\t\t\t$tables[ $table ] = $blog_prefix . $table;\n\t\t\t\t}\n\t\t\t\tunset( $tables[ $k ] );\n\t\t\t}\n\n\t\t\tif ( isset( $tables['users'] ) && defined( 'CUSTOM_USER_TABLE' ) ) {\n\t\t\t\t$tables['users'] = CUSTOM_USER_TABLE;\n\t\t\t}\n\n\t\t\tif ( isset( $tables['usermeta'] ) && defined( 'CUSTOM_USER_META_TABLE' ) ) {\n\t\t\t\t$tables['usermeta'] = CUSTOM_USER_META_TABLE;\n\t\t\t}\n\t\t}\n\n\t\treturn $tables;\n\t}\n\n\t/**\n\t * Selects a database using the current database connection.\n\t *\n\t * The database name will be changed based on the current database connection.\n\t * On failure, the execution will bail and display a DB error.\n\t *\n\t * @since 0.71\n\t *\n\t * @param string        $db  MySQL database name.\n\t * @param resource|null $dbh Optional link identifier.\n\t */\n\tpublic function select( $db, $dbh = null ) {\n\t\tif ( is_null( $dbh ) ) {\n\t\t\t$dbh = $this->dbh;\n\t\t}\n\n\t\tif ( $this->use_mysqli ) {\n\t\t\t$success = mysqli_select_db( $dbh, $db );\n\t\t} else {\n\t\t\t$success = mysql_select_db( $db, $dbh );\n\t\t}\n\t\tif ( ! $success ) {\n\t\t\t$this->ready = false;\n\t\t\tif ( ! did_action( 'template_redirect' ) ) {\n\t\t\t\twp_load_translations_early();\n\n\t\t\t\t$message = '<h1>' . __( 'Can&#8217;t select database' ) . \"</h1>\\n\";\n\n\t\t\t\t$message .= '<p>' . sprintf(\n\t\t\t\t\t/* translators: %s: Database name. */\n\t\t\t\t\t__( 'We were able to connect to the database server (which means your username and password is okay) but not able to select the %s database.' ),\n\t\t\t\t\t'<code>' . htmlspecialchars( $db, ENT_QUOTES ) . '</code>'\n\t\t\t\t) . \"</p>\\n\";\n\n\t\t\t\t$message .= \"<ul>\\n\";\n\t\t\t\t$message .= '<li>' . __( 'Are you sure it exists?' ) . \"</li>\\n\";\n\n\t\t\t\t$message .= '<li>' . sprintf(\n\t\t\t\t\t/* translators: 1: Database user, 2: Database name. */\n\t\t\t\t\t__( 'Does the user %1$s have permission to use the %2$s database?' ),\n\t\t\t\t\t'<code>' . htmlspecialchars( $this->dbuser, ENT_QUOTES ) . '</code>',\n\t\t\t\t\t'<code>' . htmlspecialchars( $db, ENT_QUOTES ) . '</code>'\n\t\t\t\t) . \"</li>\\n\";\n\n\t\t\t\t$message .= '<li>' . sprintf(\n\t\t\t\t\t/* translators: %s: Database name. */\n\t\t\t\t\t__( 'On some systems the name of your database is prefixed with your username, so it would be like <code>username_%1$s</code>. Could that be the problem?' ),\n\t\t\t\t\thtmlspecialchars( $db, ENT_QUOTES )\n\t\t\t\t) . \"</li>\\n\";\n\n\t\t\t\t$message .= \"</ul>\\n\";\n\n\t\t\t\t$message .= '<p>' . sprintf(\n\t\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t\t__( 'If you don&#8217;t know how to set up a database you should <strong>contact your host</strong>. If all else fails you may find help at the <a href=\"%s\">WordPress Support Forums</a>.' ),\n\t\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t\t) . \"</p>\\n\";\n\n\t\t\t\t$this->bail( $message, 'db_select_fail' );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Do not use, deprecated.\n\t *\n\t * Use esc_sql() or wpdb::prepare() instead.\n\t *\n\t * @since 2.8.0\n\t * @deprecated 3.6.0 Use wpdb::prepare()\n\t * @see wpdb::prepare()\n\t * @see esc_sql()\n\t *\n\t * @param string $string\n\t * @return string\n\t */\n\tfunction _weak_escape( $string ) {\n\t\tif ( func_num_args() === 1 && function_exists( '_deprecated_function' ) ) {\n\t\t\t_deprecated_function( __METHOD__, '3.6.0', 'wpdb::prepare() or esc_sql()' );\n\t\t}\n\t\treturn addslashes( $string );\n\t}\n\n\t/**\n\t * Real escape, using mysqli_real_escape_string() or mysql_real_escape_string().\n\t *\n\t * @since 2.8.0\n\t *\n\t * @see mysqli_real_escape_string()\n\t * @see mysql_real_escape_string()\n\t *\n\t * @param string $string String to escape.\n\t * @return string Escaped string.\n\t */\n\tfunction _real_escape( $string ) {\n\t\tif ( $this->dbh ) {\n\t\t\tif ( $this->use_mysqli ) {\n\t\t\t\t$escaped = mysqli_real_escape_string( $this->dbh, $string );\n\t\t\t} else {\n\t\t\t\t$escaped = mysql_real_escape_string( $string, $this->dbh );\n\t\t\t}\n\t\t} else {\n\t\t\t$class = get_class( $this );\n\t\t\tif ( function_exists( '__' ) ) {\n\t\t\t\t/* translators: %s: Database access abstraction class, usually wpdb or a class extending wpdb. */\n\t\t\t\t_doing_it_wrong( $class, sprintf( __( '%s must set a database connection for use with escaping.' ), $class ), '3.6.0' );\n\t\t\t} else {\n\t\t\t\t_doing_it_wrong( $class, sprintf( '%s must set a database connection for use with escaping.', $class ), '3.6.0' );\n\t\t\t}\n\t\t\t$escaped = addslashes( $string );\n\t\t}\n\n\t\treturn $this->add_placeholder_escape( $escaped );\n\t}\n\n\t/**\n\t * Escapes data. Works on arrays.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @uses wpdb::_real_escape()\n\t *\n\t * @param string|array $data Data to escape.\n\t * @return string|array Escaped data, in the same type as supplied.\n\t */\n\tpublic function _escape( $data ) {\n\t\tif ( is_array( $data ) ) {\n\t\t\tforeach ( $data as $k => $v ) {\n\t\t\t\tif ( is_array( $v ) ) {\n\t\t\t\t\t$data[ $k ] = $this->_escape( $v );\n\t\t\t\t} else {\n\t\t\t\t\t$data[ $k ] = $this->_real_escape( $v );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$data = $this->_real_escape( $data );\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Do not use, deprecated.\n\t *\n\t * Use esc_sql() or wpdb::prepare() instead.\n\t *\n\t * @since 0.71\n\t * @deprecated 3.6.0 Use wpdb::prepare()\n\t * @see wpdb::prepare()\n\t * @see esc_sql()\n\t *\n\t * @param string|array $data Data to escape.\n\t * @return string|array Escaped data, in the same type as supplied.\n\t */\n\tpublic function escape( $data ) {\n\t\tif ( func_num_args() === 1 && function_exists( '_deprecated_function' ) ) {\n\t\t\t_deprecated_function( __METHOD__, '3.6.0', 'wpdb::prepare() or esc_sql()' );\n\t\t}\n\t\tif ( is_array( $data ) ) {\n\t\t\tforeach ( $data as $k => $v ) {\n\t\t\t\tif ( is_array( $v ) ) {\n\t\t\t\t\t$data[ $k ] = $this->escape( $v, 'recursive' );\n\t\t\t\t} else {\n\t\t\t\t\t$data[ $k ] = $this->_weak_escape( $v, 'internal' );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$data = $this->_weak_escape( $data, 'internal' );\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Escapes content by reference for insertion into the database, for security.\n\t *\n\t * @uses wpdb::_real_escape()\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string $string String to escape.\n\t */\n\tpublic function escape_by_ref( &$string ) {\n\t\tif ( ! is_float( $string ) ) {\n\t\t\t$string = $this->_real_escape( $string );\n\t\t}\n\t}\n\n\t/**\n\t * Prepares a SQL query for safe execution.\n\t *\n\t * Uses sprintf()-like syntax. The following placeholders can be used in the query string:\n\t *   %d (integer)\n\t *   %f (float)\n\t *   %s (string)\n\t *\n\t * All placeholders MUST be left unquoted in the query string. A corresponding argument\n\t * MUST be passed for each placeholder.\n\t *\n\t * Note: There is one exception to the above: for compatibility with old behavior,\n\t * numbered or formatted string placeholders (eg, %1$s, %5s) will not have quotes\n\t * added by this function, so should be passed with appropriate quotes around them.\n\t *\n\t * Literal percentage signs (%) in the query string must be written as %%. Percentage wildcards\n\t * (for example, to use in LIKE syntax) must be passed via a substitution argument containing\n\t * the complete LIKE string, these cannot be inserted directly in the query string.\n\t * Also see wpdb::esc_like().\n\t *\n\t * Arguments may be passed as individual arguments to the method, or as a single array\n\t * containing all arguments. A combination of the two is not supported.\n\t *\n\t * Examples:\n\t *     $wpdb->prepare( \"SELECT * FROM `table` WHERE `column` = %s AND `field` = %d OR `other_field` LIKE %s\", array( 'foo', 1337, '%bar' ) );\n\t *     $wpdb->prepare( \"SELECT DATE_FORMAT(`field`, '%%c') FROM `table` WHERE `column` = %s\", 'foo' );\n\t *\n\t * @since 2.3.0\n\t * @since 5.3.0 Formalized the existing and already documented `...$args` parameter\n\t *              by updating the function signature. The second parameter was changed\n\t *              from `$args` to `...$args`.\n\t *\n\t * @link https://www.php.net/sprintf Description of syntax.\n\t *\n\t * @param string      $query   Query statement with sprintf()-like placeholders.\n\t * @param array|mixed $args    The array of variables to substitute into the query's placeholders\n\t *                             if being called with an array of arguments, or the first variable\n\t *                             to substitute into the query's placeholders if being called with\n\t *                             individual arguments.\n\t * @param mixed       ...$args Further variables to substitute into the query's placeholders\n\t *                             if being called with individual arguments.\n\t * @return string|void Sanitized query string, if there is a query to prepare.\n\t */\n\tpublic function prepare( $query, ...$args ) {\n\t\tif ( is_null( $query ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// This is not meant to be foolproof -- but it will catch obviously incorrect usage.\n\t\tif ( strpos( $query, '%' ) === false ) {\n\t\t\twp_load_translations_early();\n\t\t\t_doing_it_wrong(\n\t\t\t\t'wpdb::prepare',\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: wpdb::prepare() */\n\t\t\t\t\t__( 'The query argument of %s must have a placeholder.' ),\n\t\t\t\t\t'wpdb::prepare()'\n\t\t\t\t),\n\t\t\t\t'3.9.0'\n\t\t\t);\n\t\t}\n\n\t\t// If args were passed as an array (as in vsprintf), move them up.\n\t\t$passed_as_array = false;\n\t\tif ( is_array( $args[0] ) && count( $args ) === 1 ) {\n\t\t\t$passed_as_array = true;\n\t\t\t$args            = $args[0];\n\t\t}\n\n\t\tforeach ( $args as $arg ) {\n\t\t\tif ( ! is_scalar( $arg ) && ! is_null( $arg ) ) {\n\t\t\t\twp_load_translations_early();\n\t\t\t\t_doing_it_wrong(\n\t\t\t\t\t'wpdb::prepare',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: Value type. */\n\t\t\t\t\t\t__( 'Unsupported value type (%s).' ),\n\t\t\t\t\t\tgettype( $arg )\n\t\t\t\t\t),\n\t\t\t\t\t'4.8.2'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Specify the formatting allowed in a placeholder. The following are allowed:\n\t\t *\n\t\t * - Sign specifier. eg, $+d\n\t\t * - Numbered placeholders. eg, %1$s\n\t\t * - Padding specifier, including custom padding characters. eg, %05s, %'#5s\n\t\t * - Alignment specifier. eg, %05-s\n\t\t * - Precision specifier. eg, %.2f\n\t\t */\n\t\t$allowed_format = '(?:[1-9][0-9]*[$])?[-+0-9]*(?: |0|\\'.)?[-+0-9]*(?:\\.[0-9]+)?';\n\n\t\t/*\n\t\t * If a %s placeholder already has quotes around it, removing the existing quotes and re-inserting them\n\t\t * ensures the quotes are consistent.\n\t\t *\n\t\t * For backward compatibility, this is only applied to %s, and not to placeholders like %1$s, which are frequently\n\t\t * used in the middle of longer strings, or as table name placeholders.\n\t\t */\n\t\t$query = str_replace( \"'%s'\", '%s', $query ); // Strip any existing single quotes.\n\t\t$query = str_replace( '\"%s\"', '%s', $query ); // Strip any existing double quotes.\n\t\t$query = preg_replace( '/(?<!%)%s/', \"'%s'\", $query ); // Quote the strings, avoiding escaped strings like %%s.\n\n\t\t$query = preg_replace( \"/(?<!%)(%($allowed_format)?f)/\", '%\\\\2F', $query ); // Force floats to be locale-unaware.\n\n\t\t$query = preg_replace( \"/%(?:%|$|(?!($allowed_format)?[sdF]))/\", '%%\\\\1', $query ); // Escape any unescaped percents.\n\n\t\t// Count the number of valid placeholders in the query.\n\t\t$placeholders = preg_match_all( \"/(^|[^%]|(%%)+)%($allowed_format)?[sdF]/\", $query, $matches );\n\n\t\tif ( count( $args ) !== $placeholders ) {\n\t\t\tif ( 1 === $placeholders && $passed_as_array ) {\n\t\t\t\t// If the passed query only expected one argument, but the wrong number of arguments were sent as an array, bail.\n\t\t\t\twp_load_translations_early();\n\t\t\t\t_doing_it_wrong(\n\t\t\t\t\t'wpdb::prepare',\n\t\t\t\t\t__( 'The query only expected one placeholder, but an array of multiple placeholders was sent.' ),\n\t\t\t\t\t'4.9.0'\n\t\t\t\t);\n\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\t/*\n\t\t\t\t * If we don't have the right number of placeholders, but they were passed as individual arguments,\n\t\t\t\t * or we were expecting multiple arguments in an array, throw a warning.\n\t\t\t\t */\n\t\t\t\twp_load_translations_early();\n\t\t\t\t_doing_it_wrong(\n\t\t\t\t\t'wpdb::prepare',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1: Number of placeholders, 2: Number of arguments passed. */\n\t\t\t\t\t\t__( 'The query does not contain the correct number of placeholders (%1$d) for the number of arguments passed (%2$d).' ),\n\t\t\t\t\t\t$placeholders,\n\t\t\t\t\t\tcount( $args )\n\t\t\t\t\t),\n\t\t\t\t\t'4.8.3'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tarray_walk( $args, array( $this, 'escape_by_ref' ) );\n\t\t$query = vsprintf( $query, $args );\n\n\t\treturn $this->add_placeholder_escape( $query );\n\t}\n\n\t/**\n\t * First half of escaping for LIKE special characters % and _ before preparing for MySQL.\n\t *\n\t * Use this only before wpdb::prepare() or esc_sql(). Reversing the order is very bad for security.\n\t *\n\t * Example Prepared Statement:\n\t *\n\t *     $wild = '%';\n\t *     $find = 'only 43% of planets';\n\t *     $like = $wild . $wpdb->esc_like( $find ) . $wild;\n\t *     $sql  = $wpdb->prepare( \"SELECT * FROM $wpdb->posts WHERE post_content LIKE %s\", $like );\n\t *\n\t * Example Escape Chain:\n\t *\n\t *     $sql  = esc_sql( $wpdb->esc_like( $input ) );\n\t *\n\t * @since 4.0.0\n\t *\n\t * @param string $text The raw text to be escaped. The input typed by the user\n\t *                     should have no extra or deleted slashes.\n\t * @return string Text in the form of a LIKE phrase. The output is not SQL safe.\n\t *                Call wpdb::prepare() or wpdb::_real_escape() next.\n\t */\n\tpublic function esc_like( $text ) {\n\t\treturn addcslashes( $text, '_%\\\\' );\n\t}\n\n\t/**\n\t * Prints SQL/DB error.\n\t *\n\t * @since 0.71\n\t *\n\t * @global array $EZSQL_ERROR Stores error information of query and error string.\n\t *\n\t * @param string $str The error to display.\n\t * @return void|false Void if the showing of errors is enabled, false if disabled.\n\t */\n\tpublic function print_error( $str = '' ) {\n\t\tglobal $EZSQL_ERROR;\n\n\t\tif ( ! $str ) {\n\t\t\tif ( $this->use_mysqli ) {\n\t\t\t\t$str = mysqli_error( $this->dbh );\n\t\t\t} else {\n\t\t\t\t$str = mysql_error( $this->dbh );\n\t\t\t}\n\t\t}\n\t\t$EZSQL_ERROR[] = array(\n\t\t\t'query'     => $this->last_query,\n\t\t\t'error_str' => $str,\n\t\t);\n\n\t\tif ( $this->suppress_errors ) {\n\t\t\treturn false;\n\t\t}\n\n\t\twp_load_translations_early();\n\n\t\t$caller = $this->get_caller();\n\t\tif ( $caller ) {\n\t\t\t/* translators: 1: Database error message, 2: SQL query, 3: Name of the calling function. */\n\t\t\t$error_str = sprintf( __( 'WordPress database error %1$s for query %2$s made by %3$s' ), $str, $this->last_query, $caller );\n\t\t} else {\n\t\t\t/* translators: 1: Database error message, 2: SQL query. */\n\t\t\t$error_str = sprintf( __( 'WordPress database error %1$s for query %2$s' ), $str, $this->last_query );\n\t\t}\n\n\t\terror_log( $error_str );\n\n\t\t// Are we showing errors?\n\t\tif ( ! $this->show_errors ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If there is an error then take note of it.\n\t\tif ( is_multisite() ) {\n\t\t\t$msg = sprintf(\n\t\t\t\t\"%s [%s]\\n%s\\n\",\n\t\t\t\t__( 'WordPress database error:' ),\n\t\t\t\t$str,\n\t\t\t\t$this->last_query\n\t\t\t);\n\n\t\t\tif ( defined( 'ERRORLOGFILE' ) ) {\n\t\t\t\terror_log( $msg, 3, ERRORLOGFILE );\n\t\t\t}\n\t\t\tif ( defined( 'DIEONDBERROR' ) ) {\n\t\t\t\twp_die( $msg );\n\t\t\t}\n\t\t} else {\n\t\t\t$str   = htmlspecialchars( $str, ENT_QUOTES );\n\t\t\t$query = htmlspecialchars( $this->last_query, ENT_QUOTES );\n\n\t\t\tprintf(\n\t\t\t\t'<div id=\"error\"><p class=\"wpdberror\"><strong>%s</strong> [%s]<br /><code>%s</code></p></div>',\n\t\t\t\t__( 'WordPress database error:' ),\n\t\t\t\t$str,\n\t\t\t\t$query\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Enables showing of database errors.\n\t *\n\t * This function should be used only to enable showing of errors.\n\t * wpdb::hide_errors() should be used instead for hiding errors.\n\t *\n\t * @since 0.71\n\t *\n\t * @see wpdb::hide_errors()\n\t *\n\t * @param bool $show Optional. Whether to show errors. Default true.\n\t * @return bool Whether showing of errors was previously active.\n\t */\n\tpublic function show_errors( $show = true ) {\n\t\t$errors            = $this->show_errors;\n\t\t$this->show_errors = $show;\n\t\treturn $errors;\n\t}\n\n\t/**\n\t * Disables showing of database errors.\n\t *\n\t * By default database errors are not shown.\n\t *\n\t * @since 0.71\n\t *\n\t * @see wpdb::show_errors()\n\t *\n\t * @return bool Whether showing of errors was previously active.\n\t */\n\tpublic function hide_errors() {\n\t\t$show              = $this->show_errors;\n\t\t$this->show_errors = false;\n\t\treturn $show;\n\t}\n\n\t/**\n\t * Enables or disables suppressing of database errors.\n\t *\n\t * By default database errors are suppressed.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @see wpdb::hide_errors()\n\t *\n\t * @param bool $suppress Optional. Whether to suppress errors. Default true.\n\t * @return bool Whether suppressing of errors was previously active.\n\t */\n\tpublic function suppress_errors( $suppress = true ) {\n\t\t$errors                = $this->suppress_errors;\n\t\t$this->suppress_errors = (bool) $suppress;\n\t\treturn $errors;\n\t}\n\n\t/**\n\t * Kills cached query results.\n\t *\n\t * @since 0.71\n\t */\n\tpublic function flush() {\n\t\t$this->last_result   = array();\n\t\t$this->col_info      = null;\n\t\t$this->last_query    = null;\n\t\t$this->rows_affected = 0;\n\t\t$this->num_rows      = 0;\n\t\t$this->last_error    = '';\n\n\t\tif ( $this->use_mysqli && $this->result instanceof mysqli_result ) {\n\t\t\tmysqli_free_result( $this->result );\n\t\t\t$this->result = null;\n\n\t\t\t// Sanity check before using the handle.\n\t\t\tif ( empty( $this->dbh ) || ! ( $this->dbh instanceof mysqli ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Clear out any results from a multi-query.\n\t\t\twhile ( mysqli_more_results( $this->dbh ) ) {\n\t\t\t\tmysqli_next_result( $this->dbh );\n\t\t\t}\n\t\t} elseif ( is_resource( $this->result ) ) {\n\t\t\tmysql_free_result( $this->result );\n\t\t}\n\t}\n\n\t/**\n\t * Connects to and selects database.\n\t *\n\t * If $allow_bail is false, the lack of database connection will need to be handled manually.\n\t *\n\t * @since 3.0.0\n\t * @since 3.9.0 $allow_bail parameter added.\n\t *\n\t * @param bool $allow_bail Optional. Allows the function to bail. Default true.\n\t * @return bool True with a successful connection, false on failure.\n\t */\n\tpublic function db_connect( $allow_bail = true ) {\n\t\t$this->is_mysql = true;\n\n\t\t/*\n\t\t * Deprecated in 3.9+ when using MySQLi. No equivalent\n\t\t * $new_link parameter exists for mysqli_* functions.\n\t\t */\n\t\t$new_link     = defined( 'MYSQL_NEW_LINK' ) ? MYSQL_NEW_LINK : true;\n\t\t$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0;\n\n\t\tif ( $this->use_mysqli ) {\n\t\t\t$this->dbh = mysqli_init();\n\n\t\t\t$host    = $this->dbhost;\n\t\t\t$port    = null;\n\t\t\t$socket  = null;\n\t\t\t$is_ipv6 = false;\n\n\t\t\t$host_data = $this->parse_db_host( $this->dbhost );\n\t\t\tif ( $host_data ) {\n\t\t\t\tlist( $host, $port, $socket, $is_ipv6 ) = $host_data;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * If using the `mysqlnd` library, the IPv6 address needs to be enclosed\n\t\t\t * in square brackets, whereas it doesn't while using the `libmysqlclient` library.\n\t\t\t * @see https://bugs.php.net/bug.php?id=67563\n\t\t\t */\n\t\t\tif ( $is_ipv6 && extension_loaded( 'mysqlnd' ) ) {\n\t\t\t\t$host = \"[$host]\";\n\t\t\t}\n\n\t\t\tif ( WP_DEBUG ) {\n\t\t\t\tmysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );\n\t\t\t} else {\n\t\t\t\t// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged\n\t\t\t\t@mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );\n\t\t\t}\n\n\t\t\tif ( $this->dbh->connect_errno ) {\n\t\t\t\t$this->dbh = null;\n\n\t\t\t\t/*\n\t\t\t\t * It's possible ext/mysqli is misconfigured. Fall back to ext/mysql if:\n\t\t\t\t *  - We haven't previously connected, and\n\t\t\t\t *  - WP_USE_EXT_MYSQL isn't set to false, and\n\t\t\t\t *  - ext/mysql is loaded.\n\t\t\t\t */\n\t\t\t\t$attempt_fallback = true;\n\n\t\t\t\tif ( $this->has_connected ) {\n\t\t\t\t\t$attempt_fallback = false;\n\t\t\t\t} elseif ( defined( 'WP_USE_EXT_MYSQL' ) && ! WP_USE_EXT_MYSQL ) {\n\t\t\t\t\t$attempt_fallback = false;\n\t\t\t\t} elseif ( ! function_exists( 'mysql_connect' ) ) {\n\t\t\t\t\t$attempt_fallback = false;\n\t\t\t\t}\n\n\t\t\t\tif ( $attempt_fallback ) {\n\t\t\t\t\t$this->use_mysqli = false;\n\t\t\t\t\treturn $this->db_connect( $allow_bail );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif ( WP_DEBUG ) {\n\t\t\t\t$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );\n\t\t\t} else {\n\t\t\t\t// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged\n\t\t\t\t$this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $this->dbh && $allow_bail ) {\n\t\t\twp_load_translations_early();\n\n\t\t\t// Load custom DB error template, if present.\n\t\t\tif ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) {\n\t\t\t\trequire_once WP_CONTENT_DIR . '/db-error.php';\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\t$message = '<h1>' . __( 'Error establishing a database connection' ) . \"</h1>\\n\";\n\n\t\t\t$message .= '<p>' . sprintf(\n\t\t\t\t/* translators: 1: wp-config.php, 2: Database host. */\n\t\t\t\t__( 'This either means that the username and password information in your %1$s file is incorrect or we can&#8217;t contact the database server at %2$s. This could mean your host&#8217;s database server is down.' ),\n\t\t\t\t'<code>wp-config.php</code>',\n\t\t\t\t'<code>' . htmlspecialchars( $this->dbhost, ENT_QUOTES ) . '</code>'\n\t\t\t) . \"</p>\\n\";\n\n\t\t\t$message .= \"<ul>\\n\";\n\t\t\t$message .= '<li>' . __( 'Are you sure you have the correct username and password?' ) . \"</li>\\n\";\n\t\t\t$message .= '<li>' . __( 'Are you sure you have typed the correct hostname?' ) . \"</li>\\n\";\n\t\t\t$message .= '<li>' . __( 'Are you sure the database server is running?' ) . \"</li>\\n\";\n\t\t\t$message .= \"</ul>\\n\";\n\n\t\t\t$message .= '<p>' . sprintf(\n\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t__( 'If you&#8217;re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href=\"%s\">WordPress Support Forums</a>.' ),\n\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t) . \"</p>\\n\";\n\n\t\t\t$this->bail( $message, 'db_connect_fail' );\n\n\t\t\treturn false;\n\t\t} elseif ( $this->dbh ) {\n\t\t\tif ( ! $this->has_connected ) {\n\t\t\t\t$this->init_charset();\n\t\t\t}\n\n\t\t\t$this->has_connected = true;\n\n\t\t\t$this->set_charset( $this->dbh );\n\n\t\t\t$this->ready = true;\n\t\t\t$this->set_sql_mode();\n\t\t\t$this->select( $this->dbname, $this->dbh );\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Parses the DB_HOST setting to interpret it for mysqli_real_connect().\n\t *\n\t * mysqli_real_connect() doesn't support the host param including a port or socket\n\t * like mysql_connect() does. This duplicates how mysql_connect() detects a port\n\t * and/or socket file.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param string $host The DB_HOST setting to parse.\n\t * @return array|false Array containing the host, the port, the socket and\n\t *                     whether it is an IPv6 address, in that order.\n\t *                     False if $host couldn't be parsed.\n\t */\n\tpublic function parse_db_host( $host ) {\n\t\t$port    = null;\n\t\t$socket  = null;\n\t\t$is_ipv6 = false;\n\n\t\t// First peel off the socket parameter from the right, if it exists.\n\t\t$socket_pos = strpos( $host, ':/' );\n\t\tif ( false !== $socket_pos ) {\n\t\t\t$socket = substr( $host, $socket_pos + 1 );\n\t\t\t$host   = substr( $host, 0, $socket_pos );\n\t\t}\n\n\t\t// We need to check for an IPv6 address first.\n\t\t// An IPv6 address will always contain at least two colons.\n\t\tif ( substr_count( $host, ':' ) > 1 ) {\n\t\t\t$pattern = '#^(?:\\[)?(?P<host>[0-9a-fA-F:]+)(?:\\]:(?P<port>[\\d]+))?#';\n\t\t\t$is_ipv6 = true;\n\t\t} else {\n\t\t\t// We seem to be dealing with an IPv4 address.\n\t\t\t$pattern = '#^(?P<host>[^:/]*)(?::(?P<port>[\\d]+))?#';\n\t\t}\n\n\t\t$matches = array();\n\t\t$result  = preg_match( $pattern, $host, $matches );\n\n\t\tif ( 1 !== $result ) {\n\t\t\t// Couldn't parse the address, bail.\n\t\t\treturn false;\n\t\t}\n\n\t\t$host = '';\n\t\tforeach ( array( 'host', 'port' ) as $component ) {\n\t\t\tif ( ! empty( $matches[ $component ] ) ) {\n\t\t\t\t$$component = $matches[ $component ];\n\t\t\t}\n\t\t}\n\n\t\treturn array( $host, $port, $socket, $is_ipv6 );\n\t}\n\n\t/**\n\t * Checks that the connection to the database is still up. If not, try to reconnect.\n\t *\n\t * If this function is unable to reconnect, it will forcibly die, or if called\n\t * after the {@see 'template_redirect'} hook has been fired, return false instead.\n\t *\n\t * If $allow_bail is false, the lack of database connection will need to be handled manually.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @param bool $allow_bail Optional. Allows the function to bail. Default true.\n\t * @return bool|void True if the connection is up.\n\t */\n\tpublic function check_connection( $allow_bail = true ) {\n\t\tif ( $this->use_mysqli ) {\n\t\t\tif ( ! empty( $this->dbh ) && mysqli_ping( $this->dbh ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\tif ( ! empty( $this->dbh ) && mysql_ping( $this->dbh ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t$error_reporting = false;\n\n\t\t// Disable warnings, as we don't want to see a multitude of \"unable to connect\" messages.\n\t\tif ( WP_DEBUG ) {\n\t\t\t$error_reporting = error_reporting();\n\t\t\terror_reporting( $error_reporting & ~E_WARNING );\n\t\t}\n\n\t\tfor ( $tries = 1; $tries <= $this->reconnect_retries; $tries++ ) {\n\t\t\t// On the last try, re-enable warnings. We want to see a single instance\n\t\t\t// of the \"unable to connect\" message on the bail() screen, if it appears.\n\t\t\tif ( $this->reconnect_retries === $tries && WP_DEBUG ) {\n\t\t\t\terror_reporting( $error_reporting );\n\t\t\t}\n\n\t\t\tif ( $this->db_connect( false ) ) {\n\t\t\t\tif ( $error_reporting ) {\n\t\t\t\t\terror_reporting( $error_reporting );\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tsleep( 1 );\n\t\t}\n\n\t\t// If template_redirect has already happened, it's too late for wp_die()/dead_db().\n\t\t// Let's just return and hope for the best.\n\t\tif ( did_action( 'template_redirect' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $allow_bail ) {\n\t\t\treturn false;\n\t\t}\n\n\t\twp_load_translations_early();\n\n\t\t$message = '<h1>' . __( 'Error reconnecting to the database' ) . \"</h1>\\n\";\n\n\t\t$message .= '<p>' . sprintf(\n\t\t\t/* translators: %s: Database host. */\n\t\t\t__( 'This means that we lost contact with the database server at %s. This could mean your host&#8217;s database server is down.' ),\n\t\t\t'<code>' . htmlspecialchars( $this->dbhost, ENT_QUOTES ) . '</code>'\n\t\t) . \"</p>\\n\";\n\n\t\t$message .= \"<ul>\\n\";\n\t\t$message .= '<li>' . __( 'Are you sure the database server is running?' ) . \"</li>\\n\";\n\t\t$message .= '<li>' . __( 'Are you sure the database server is not under particularly heavy load?' ) . \"</li>\\n\";\n\t\t$message .= \"</ul>\\n\";\n\n\t\t$message .= '<p>' . sprintf(\n\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t__( 'If you&#8217;re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href=\"%s\">WordPress Support Forums</a>.' ),\n\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t) . \"</p>\\n\";\n\n\t\t// We weren't able to reconnect, so we better bail.\n\t\t$this->bail( $message, 'db_connect_fail' );\n\n\t\t// Call dead_db() if bail didn't die, because this database is no more.\n\t\t// It has ceased to be (at least temporarily).\n\t\tdead_db();\n\t}\n\n\t/**\n\t * Performs a MySQL database query, using current database connection.\n\t *\n\t * More information can be found on the Codex page.\n\t *\n\t * @since 0.71\n\t *\n\t * @link https://codex.wordpress.org/Function_Reference/wpdb_Class\n\t *\n\t * @param string $query Database query.\n\t * @return int|bool Boolean true for CREATE, ALTER, TRUNCATE and DROP queries. Number of rows\n\t *                  affected/selected for all other queries. Boolean false on error.\n\t */\n\tpublic function query( $query ) {\n\t\tif ( ! $this->ready ) {\n\t\t\t$this->check_current_query = true;\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * Filters the database query.\n\t\t *\n\t\t * Some queries are made before the plugins have been loaded,\n\t\t * and thus cannot be filtered with this method.\n\t\t *\n\t\t * @since 2.1.0\n\t\t *\n\t\t * @param string $query Database query.\n\t\t */\n\t\t$query = apply_filters( 'query', $query );\n\n\t\t$this->flush();\n\n\t\t// Log how the function was called.\n\t\t$this->func_call = \"\\$db->query(\\\"$query\\\")\";\n\n\t\t// If we're writing to the database, make sure the query will write safely.\n\t\tif ( $this->check_current_query && ! $this->check_ascii( $query ) ) {\n\t\t\t$stripped_query = $this->strip_invalid_text_from_query( $query );\n\t\t\t// strip_invalid_text_from_query() can perform queries, so we need\n\t\t\t// to flush again, just to make sure everything is clear.\n\t\t\t$this->flush();\n\t\t\tif ( $stripped_query !== $query ) {\n\t\t\t\t$this->insert_id = 0;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$this->check_current_query = true;\n\n\t\t// Keep track of the last query for debug.\n\t\t$this->last_query = $query;\n\n\t\t$this->_do_query( $query );\n\n\t\t// MySQL server has gone away, try to reconnect.\n\t\t$mysql_errno = 0;\n\t\tif ( ! empty( $this->dbh ) ) {\n\t\t\tif ( $this->use_mysqli ) {\n\t\t\t\tif ( $this->dbh instanceof mysqli ) {\n\t\t\t\t\t$mysql_errno = mysqli_errno( $this->dbh );\n\t\t\t\t} else {\n\t\t\t\t\t// $dbh is defined, but isn't a real connection.\n\t\t\t\t\t// Something has gone horribly wrong, let's try a reconnect.\n\t\t\t\t\t$mysql_errno = 2006;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( is_resource( $this->dbh ) ) {\n\t\t\t\t\t$mysql_errno = mysql_errno( $this->dbh );\n\t\t\t\t} else {\n\t\t\t\t\t$mysql_errno = 2006;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $this->dbh ) || 2006 === $mysql_errno ) {\n\t\t\tif ( $this->check_connection() ) {\n\t\t\t\t$this->_do_query( $query );\n\t\t\t} else {\n\t\t\t\t$this->insert_id = 0;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// If there is an error then take note of it.\n\t\tif ( $this->use_mysqli ) {\n\t\t\tif ( $this->dbh instanceof mysqli ) {\n\t\t\t\t$this->last_error = mysqli_error( $this->dbh );\n\t\t\t} else {\n\t\t\t\t$this->last_error = __( 'Unable to retrieve the error message from MySQL' );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( is_resource( $this->dbh ) ) {\n\t\t\t\t$this->last_error = mysql_error( $this->dbh );\n\t\t\t} else {\n\t\t\t\t$this->last_error = __( 'Unable to retrieve the error message from MySQL' );\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->last_error ) {\n\t\t\t// Clear insert_id on a subsequent failed insert.\n\t\t\tif ( $this->insert_id && preg_match( '/^\\s*(insert|replace)\\s/i', $query ) ) {\n\t\t\t\t$this->insert_id = 0;\n\t\t\t}\n\n\t\t\t$this->print_error();\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( preg_match( '/^\\s*(create|alter|truncate|drop)\\s/i', $query ) ) {\n\t\t\t$return_val = $this->result;\n\t\t} elseif ( preg_match( '/^\\s*(insert|delete|update|replace)\\s/i', $query ) ) {\n\t\t\tif ( $this->use_mysqli ) {\n\t\t\t\t$this->rows_affected = mysqli_affected_rows( $this->dbh );\n\t\t\t} else {\n\t\t\t\t$this->rows_affected = mysql_affected_rows( $this->dbh );\n\t\t\t}\n\t\t\t// Take note of the insert_id.\n\t\t\tif ( preg_match( '/^\\s*(insert|replace)\\s/i', $query ) ) {\n\t\t\t\tif ( $this->use_mysqli ) {\n\t\t\t\t\t$this->insert_id = mysqli_insert_id( $this->dbh );\n\t\t\t\t} else {\n\t\t\t\t\t$this->insert_id = mysql_insert_id( $this->dbh );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Return number of rows affected.\n\t\t\t$return_val = $this->rows_affected;\n\t\t} else {\n\t\t\t$num_rows = 0;\n\t\t\tif ( $this->use_mysqli && $this->result instanceof mysqli_result ) {\n\t\t\t\twhile ( $row = mysqli_fetch_object( $this->result ) ) {\n\t\t\t\t\t$this->last_result[ $num_rows ] = $row;\n\t\t\t\t\t$num_rows++;\n\t\t\t\t}\n\t\t\t} elseif ( is_resource( $this->result ) ) {\n\t\t\t\twhile ( $row = mysql_fetch_object( $this->result ) ) {\n\t\t\t\t\t$this->last_result[ $num_rows ] = $row;\n\t\t\t\t\t$num_rows++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Log and return the number of rows selected.\n\t\t\t$this->num_rows = $num_rows;\n\t\t\t$return_val     = $num_rows;\n\t\t}\n\n\t\treturn $return_val;\n\t}\n\n\t/**\n\t * Internal function to perform the mysql_query() call.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @see wpdb::query()\n\t *\n\t * @param string $query The query to run.\n\t */\n\tprivate function _do_query( $query ) {\n\t\tif ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) {\n\t\t\t$this->timer_start();\n\t\t}\n\n\t\tif ( ! empty( $this->dbh ) && $this->use_mysqli ) {\n\t\t\t$this->result = mysqli_query( $this->dbh, $query );\n\t\t} elseif ( ! empty( $this->dbh ) ) {\n\t\t\t$this->result = mysql_query( $query, $this->dbh );\n\t\t}\n\t\t$this->num_queries++;\n\n\t\tif ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) {\n\t\t\t$this->log_query(\n\t\t\t\t$query,\n\t\t\t\t$this->timer_stop(),\n\t\t\t\t$this->get_caller(),\n\t\t\t\t$this->time_start,\n\t\t\t\tarray()\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Logs query data.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param string $query           The query's SQL.\n\t * @param float  $query_time      Total time spent on the query, in seconds.\n\t * @param string $query_callstack Comma-separated list of the calling functions.\n\t * @param float  $query_start     Unix timestamp of the time at the start of the query.\n\t * @param array  $query_data      Custom query data.\n\t */\n\tpublic function log_query( $query, $query_time, $query_callstack, $query_start, $query_data ) {\n\t\t/**\n\t\t * Filters the custom query data being logged.\n\t\t *\n\t\t * Caution should be used when modifying any of this data, it is recommended that any additional\n\t\t * information you need to store about a query be added as a new associative entry to the fourth\n\t\t * element $query_data.\n\t\t *\n\t\t * @since 5.3.0\n\t\t *\n\t\t * @param array  $query_data      Custom query data.\n\t\t * @param string $query           The query's SQL.\n\t\t * @param float  $query_time      Total time spent on the query, in seconds.\n\t\t * @param string $query_callstack Comma-separated list of the calling functions.\n\t\t * @param float  $query_start     Unix timestamp of the time at the start of the query.\n\t\t */\n\t\t$query_data = apply_filters( 'log_query_custom_data', $query_data, $query, $query_time, $query_callstack, $query_start );\n\n\t\t$this->queries[] = array(\n\t\t\t$query,\n\t\t\t$query_time,\n\t\t\t$query_callstack,\n\t\t\t$query_start,\n\t\t\t$query_data,\n\t\t);\n\t}\n\n\t/**\n\t * Generates and returns a placeholder escape string for use in queries returned by ::prepare().\n\t *\n\t * @since 4.8.3\n\t *\n\t * @return string String to escape placeholders.\n\t */\n\tpublic function placeholder_escape() {\n\t\tstatic $placeholder;\n\n\t\tif ( ! $placeholder ) {\n\t\t\t// If ext/hash is not present, compat.php's hash_hmac() does not support sha256.\n\t\t\t$algo = function_exists( 'hash' ) ? 'sha256' : 'sha1';\n\t\t\t// Old WP installs may not have AUTH_SALT defined.\n\t\t\t$salt = defined( 'AUTH_SALT' ) && AUTH_SALT ? AUTH_SALT : (string) rand();\n\n\t\t\t$placeholder = '{' . hash_hmac( $algo, uniqid( $salt, true ), $salt ) . '}';\n\t\t}\n\n\t\t/*\n\t\t * Add the filter to remove the placeholder escaper. Uses priority 0, so that anything\n\t\t * else attached to this filter will receive the query with the placeholder string removed.\n\t\t */\n\t\tif ( false === has_filter( 'query', array( $this, 'remove_placeholder_escape' ) ) ) {\n\t\t\tadd_filter( 'query', array( $this, 'remove_placeholder_escape' ), 0 );\n\t\t}\n\n\t\treturn $placeholder;\n\t}\n\n\t/**\n\t * Adds a placeholder escape string, to escape anything that resembles a printf() placeholder.\n\t *\n\t * @since 4.8.3\n\t *\n\t * @param string $query The query to escape.\n\t * @return string The query with the placeholder escape string inserted where necessary.\n\t */\n\tpublic function add_placeholder_escape( $query ) {\n\t\t/*\n\t\t * To prevent returning anything that even vaguely resembles a placeholder,\n\t\t * we clobber every % we can find.\n\t\t */\n\t\treturn str_replace( '%', $this->placeholder_escape(), $query );\n\t}\n\n\t/**\n\t * Removes the placeholder escape strings from a query.\n\t *\n\t * @since 4.8.3\n\t *\n\t * @param string $query The query from which the placeholder will be removed.\n\t * @return string The query with the placeholder removed.\n\t */\n\tpublic function remove_placeholder_escape( $query ) {\n\t\treturn str_replace( $this->placeholder_escape(), '%', $query );\n\t}\n\n\t/**\n\t * Inserts a row into the table.\n\t *\n\t * Examples:\n\t *     wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 'bar' ) )\n\t *     wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )\n\t *\n\t * @since 2.5.0\n\t *\n\t * @see wpdb::prepare()\n\t * @see wpdb::$field_types\n\t * @see wp_set_wpdb_vars()\n\t *\n\t * @param string       $table  Table name.\n\t * @param array        $data   Data to insert (in column => value pairs).\n\t *                             Both $data columns and $data values should be \"raw\" (neither should be SQL escaped).\n\t *                             Sending a null value will cause the column to be set to NULL - the corresponding\n\t *                             format is ignored in this case.\n\t * @param array|string $format Optional. An array of formats to be mapped to each of the value in $data.\n\t *                             If string, that format will be used for all of the values in $data.\n\t *                             A format is one of '%d', '%f', '%s' (integer, float, string).\n\t *                             If omitted, all values in $data will be treated as strings unless otherwise\n\t *                             specified in wpdb::$field_types.\n\t * @return int|false The number of rows inserted, or false on error.\n\t */\n\tpublic function insert( $table, $data, $format = null ) {\n\t\treturn $this->_insert_replace_helper( $table, $data, $format, 'INSERT' );\n\t}\n\n\t/**\n\t * Replaces a row in the table.\n\t *\n\t * Examples:\n\t *     wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 'bar' ) )\n\t *     wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )\n\t *\n\t * @since 3.0.0\n\t *\n\t * @see wpdb::prepare()\n\t * @see wpdb::$field_types\n\t * @see wp_set_wpdb_vars()\n\t *\n\t * @param string       $table  Table name.\n\t * @param array        $data   Data to insert (in column => value pairs).\n\t *                             Both $data columns and $data values should be \"raw\" (neither should be SQL escaped).\n\t *                             Sending a null value will cause the column to be set to NULL - the corresponding\n\t *                             format is ignored in this case.\n\t * @param array|string $format Optional. An array of formats to be mapped to each of the value in $data.\n\t *                             If string, that format will be used for all of the values in $data.\n\t *                             A format is one of '%d', '%f', '%s' (integer, float, string).\n\t *                             If omitted, all values in $data will be treated as strings unless otherwise\n\t *                             specified in wpdb::$field_types.\n\t * @return int|false The number of rows affected, or false on error.\n\t */\n\tpublic function replace( $table, $data, $format = null ) {\n\t\treturn $this->_insert_replace_helper( $table, $data, $format, 'REPLACE' );\n\t}\n\n\t/**\n\t * Helper function for insert and replace.\n\t *\n\t * Runs an insert or replace query based on $type argument.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @see wpdb::prepare()\n\t * @see wpdb::$field_types\n\t * @see wp_set_wpdb_vars()\n\t *\n\t * @param string       $table  Table name.\n\t * @param array        $data   Data to insert (in column => value pairs).\n\t *                             Both $data columns and $data values should be \"raw\" (neither should be SQL escaped).\n\t *                             Sending a null value will cause the column to be set to NULL - the corresponding\n\t *                             format is ignored in this case.\n\t * @param array|string $format Optional. An array of formats to be mapped to each of the value in $data.\n\t *                             If string, that format will be used for all of the values in $data.\n\t *                             A format is one of '%d', '%f', '%s' (integer, float, string).\n\t *                             If omitted, all values in $data will be treated as strings unless otherwise\n\t *                             specified in wpdb::$field_types.\n\t * @param string       $type   Optional. Type of operation. Possible values include 'INSERT' or 'REPLACE'.\n\t *                             Default 'INSERT'.\n\t * @return int|false The number of rows affected, or false on error.\n\t */\n\tfunction _insert_replace_helper( $table, $data, $format = null, $type = 'INSERT' ) {\n\t\t$this->insert_id = 0;\n\n\t\tif ( ! in_array( strtoupper( $type ), array( 'REPLACE', 'INSERT' ), true ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$data = $this->process_fields( $table, $data, $format );\n\t\tif ( false === $data ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$formats = array();\n\t\t$values  = array();\n\t\tforeach ( $data as $value ) {\n\t\t\tif ( is_null( $value['value'] ) ) {\n\t\t\t\t$formats[] = 'NULL';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$formats[] = $value['format'];\n\t\t\t$values[]  = $value['value'];\n\t\t}\n\n\t\t$fields  = '`' . implode( '`, `', array_keys( $data ) ) . '`';\n\t\t$formats = implode( ', ', $formats );\n\n\t\t$sql = \"$type INTO `$table` ($fields) VALUES ($formats)\";\n\n\t\t$this->check_current_query = false;\n\t\treturn $this->query( $this->prepare( $sql, $values ) );\n\t}\n\n\t/**\n\t * Updates a row in the table.\n\t *\n\t * Examples:\n\t *     wpdb::update( 'table', array( 'column' => 'foo', 'field' => 'bar' ), array( 'ID' => 1 ) )\n\t *     wpdb::update( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( 'ID' => 1 ), array( '%s', '%d' ), array( '%d' ) )\n\t *\n\t * @since 2.5.0\n\t *\n\t * @see wpdb::prepare()\n\t * @see wpdb::$field_types\n\t * @see wp_set_wpdb_vars()\n\t *\n\t * @param string       $table        Table name.\n\t * @param array        $data         Data to update (in column => value pairs).\n\t *                                   Both $data columns and $data values should be \"raw\" (neither should be SQL escaped).\n\t *                                   Sending a null value will cause the column to be set to NULL - the corresponding\n\t *                                   format is ignored in this case.\n\t * @param array        $where        A named array of WHERE clauses (in column => value pairs).\n\t *                                   Multiple clauses will be joined with ANDs.\n\t *                                   Both $where columns and $where values should be \"raw\".\n\t *                                   Sending a null value will create an IS NULL comparison - the corresponding\n\t *                                   format will be ignored in this case.\n\t * @param array|string $format       Optional. An array of formats to be mapped to each of the values in $data.\n\t *                                   If string, that format will be used for all of the values in $data.\n\t *                                   A format is one of '%d', '%f', '%s' (integer, float, string).\n\t *                                   If omitted, all values in $data will be treated as strings unless otherwise\n\t *                                   specified in wpdb::$field_types.\n\t * @param array|string $where_format Optional. An array of formats to be mapped to each of the values in $where.\n\t *                                   If string, that format will be used for all of the items in $where.\n\t *                                   A format is one of '%d', '%f', '%s' (integer, float, string).\n\t *                                   If omitted, all values in $where will be treated as strings.\n\t * @return int|false The number of rows updated, or false on error.\n\t */\n\tpublic function update( $table, $data, $where, $format = null, $where_format = null ) {\n\t\tif ( ! is_array( $data ) || ! is_array( $where ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$data = $this->process_fields( $table, $data, $format );\n\t\tif ( false === $data ) {\n\t\t\treturn false;\n\t\t}\n\t\t$where = $this->process_fields( $table, $where, $where_format );\n\t\tif ( false === $where ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$fields     = array();\n\t\t$conditions = array();\n\t\t$values     = array();\n\t\tforeach ( $data as $field => $value ) {\n\t\t\tif ( is_null( $value['value'] ) ) {\n\t\t\t\t$fields[] = \"`$field` = NULL\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$fields[] = \"`$field` = \" . $value['format'];\n\t\t\t$values[] = $value['value'];\n\t\t}\n\t\tforeach ( $where as $field => $value ) {\n\t\t\tif ( is_null( $value['value'] ) ) {\n\t\t\t\t$conditions[] = \"`$field` IS NULL\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$conditions[] = \"`$field` = \" . $value['format'];\n\t\t\t$values[]     = $value['value'];\n\t\t}\n\n\t\t$fields     = implode( ', ', $fields );\n\t\t$conditions = implode( ' AND ', $conditions );\n\n\t\t$sql = \"UPDATE `$table` SET $fields WHERE $conditions\";\n\n\t\t$this->check_current_query = false;\n\t\treturn $this->query( $this->prepare( $sql, $values ) );\n\t}\n\n\t/**\n\t * Deletes a row in the table.\n\t *\n\t * Examples:\n\t *     wpdb::delete( 'table', array( 'ID' => 1 ) )\n\t *     wpdb::delete( 'table', array( 'ID' => 1 ), array( '%d' ) )\n\t *\n\t * @since 3.4.0\n\t *\n\t * @see wpdb::prepare()\n\t * @see wpdb::$field_types\n\t * @see wp_set_wpdb_vars()\n\t *\n\t * @param string       $table        Table name.\n\t * @param array        $where        A named array of WHERE clauses (in column => value pairs).\n\t *                                   Multiple clauses will be joined with ANDs.\n\t *                                   Both $where columns and $where values should be \"raw\".\n\t *                                   Sending a null value will create an IS NULL comparison - the corresponding\n\t *                                   format will be ignored in this case.\n\t * @param array|string $where_format Optional. An array of formats to be mapped to each of the values in $where.\n\t *                                   If string, that format will be used for all of the items in $where.\n\t *                                   A format is one of '%d', '%f', '%s' (integer, float, string).\n\t *                                   If omitted, all values in $data will be treated as strings unless otherwise\n\t *                                   specified in wpdb::$field_types.\n\t * @return int|false The number of rows updated, or false on error.\n\t */\n\tpublic function delete( $table, $where, $where_format = null ) {\n\t\tif ( ! is_array( $where ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$where = $this->process_fields( $table, $where, $where_format );\n\t\tif ( false === $where ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$conditions = array();\n\t\t$values     = array();\n\t\tforeach ( $where as $field => $value ) {\n\t\t\tif ( is_null( $value['value'] ) ) {\n\t\t\t\t$conditions[] = \"`$field` IS NULL\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$conditions[] = \"`$field` = \" . $value['format'];\n\t\t\t$values[]     = $value['value'];\n\t\t}\n\n\t\t$conditions = implode( ' AND ', $conditions );\n\n\t\t$sql = \"DELETE FROM `$table` WHERE $conditions\";\n\n\t\t$this->check_current_query = false;\n\t\treturn $this->query( $this->prepare( $sql, $values ) );\n\t}\n\n\t/**\n\t * Processes arrays of field/value pairs and field formats.\n\t *\n\t * This is a helper method for wpdb's CRUD methods, which take field/value pairs\n\t * for inserts, updates, and where clauses. This method first pairs each value\n\t * with a format. Then it determines the charset of that field, using that\n\t * to determine if any invalid text would be stripped. If text is stripped,\n\t * then field processing is rejected and the query fails.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param string $table  Table name.\n\t * @param array  $data   Field/value pair.\n\t * @param mixed  $format Format for each field.\n\t * @return array|false An array of fields that contain paired value and formats.\n\t *                     False for invalid values.\n\t */\n\tprotected function process_fields( $table, $data, $format ) {\n\t\t$data = $this->process_field_formats( $data, $format );\n\t\tif ( false === $data ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$data = $this->process_field_charsets( $data, $table );\n\t\tif ( false === $data ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$data = $this->process_field_lengths( $data, $table );\n\t\tif ( false === $data ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$converted_data = $this->strip_invalid_text( $data );\n\n\t\tif ( $data !== $converted_data ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Prepares arrays of value/format pairs as passed to wpdb CRUD methods.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param array $data   Array of fields to values.\n\t * @param mixed $format Formats to be mapped to the values in $data.\n\t * @return array Array, keyed by field names with values being an array\n\t *               of 'value' and 'format' keys.\n\t */\n\tprotected function process_field_formats( $data, $format ) {\n\t\t$formats          = (array) $format;\n\t\t$original_formats = $formats;\n\n\t\tforeach ( $data as $field => $value ) {\n\t\t\t$value = array(\n\t\t\t\t'value'  => $value,\n\t\t\t\t'format' => '%s',\n\t\t\t);\n\n\t\t\tif ( ! empty( $format ) ) {\n\t\t\t\t$value['format'] = array_shift( $formats );\n\t\t\t\tif ( ! $value['format'] ) {\n\t\t\t\t\t$value['format'] = reset( $original_formats );\n\t\t\t\t}\n\t\t\t} elseif ( isset( $this->field_types[ $field ] ) ) {\n\t\t\t\t$value['format'] = $this->field_types[ $field ];\n\t\t\t}\n\n\t\t\t$data[ $field ] = $value;\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Adds field charsets to field/value/format arrays generated by wpdb::process_field_formats().\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param array  $data  As it comes from the wpdb::process_field_formats() method.\n\t * @param string $table Table name.\n\t * @return array|false The same array as $data with additional 'charset' keys.\n\t *                     False on failure.\n\t */\n\tprotected function process_field_charsets( $data, $table ) {\n\t\tforeach ( $data as $field => $value ) {\n\t\t\tif ( '%d' === $value['format'] || '%f' === $value['format'] ) {\n\t\t\t\t/*\n\t\t\t\t * We can skip this field if we know it isn't a string.\n\t\t\t\t * This checks %d/%f versus ! %s because its sprintf() could take more.\n\t\t\t\t */\n\t\t\t\t$value['charset'] = false;\n\t\t\t} else {\n\t\t\t\t$value['charset'] = $this->get_col_charset( $table, $field );\n\t\t\t\tif ( is_wp_error( $value['charset'] ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$data[ $field ] = $value;\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * For string fields, records the maximum string length that field can safely save.\n\t *\n\t * @since 4.2.1\n\t *\n\t * @param array  $data  As it comes from the wpdb::process_field_charsets() method.\n\t * @param string $table Table name.\n\t * @return array|false The same array as $data with additional 'length' keys, or false if\n\t *                     any of the values were too long for their corresponding field.\n\t */\n\tprotected function process_field_lengths( $data, $table ) {\n\t\tforeach ( $data as $field => $value ) {\n\t\t\tif ( '%d' === $value['format'] || '%f' === $value['format'] ) {\n\t\t\t\t/*\n\t\t\t\t * We can skip this field if we know it isn't a string.\n\t\t\t\t * This checks %d/%f versus ! %s because its sprintf() could take more.\n\t\t\t\t */\n\t\t\t\t$value['length'] = false;\n\t\t\t} else {\n\t\t\t\t$value['length'] = $this->get_col_length( $table, $field );\n\t\t\t\tif ( is_wp_error( $value['length'] ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$data[ $field ] = $value;\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Retrieves one variable from the database.\n\t *\n\t * Executes a SQL query and returns the value from the SQL result.\n\t * If the SQL result contains more than one column and/or more than one row,\n\t * the value in the column and row specified is returned. If $query is null,\n\t * the value in the specified column and row from the previous SQL result is returned.\n\t *\n\t * @since 0.71\n\t *\n\t * @param string|null $query Optional. SQL query. Defaults to null, use the result from the previous query.\n\t * @param int         $x     Optional. Column of value to return. Indexed from 0.\n\t * @param int         $y     Optional. Row of value to return. Indexed from 0.\n\t * @return string|null Database query result (as string), or null on failure.\n\t */\n\tpublic function get_var( $query = null, $x = 0, $y = 0 ) {\n\t\t$this->func_call = \"\\$db->get_var(\\\"$query\\\", $x, $y)\";\n\n\t\tif ( $this->check_current_query && $this->check_safe_collation( $query ) ) {\n\t\t\t$this->check_current_query = false;\n\t\t}\n\n\t\tif ( $query ) {\n\t\t\t$this->query( $query );\n\t\t}\n\n\t\t// Extract var out of cached results based on x,y vals.\n\t\tif ( ! empty( $this->last_result[ $y ] ) ) {\n\t\t\t$values = array_values( get_object_vars( $this->last_result[ $y ] ) );\n\t\t}\n\n\t\t// If there is a value return it, else return null.\n\t\treturn ( isset( $values[ $x ] ) && '' !== $values[ $x ] ) ? $values[ $x ] : null;\n\t}\n\n\t/**\n\t * Retrieves one row from the database.\n\t *\n\t * Executes a SQL query and returns the row from the SQL result.\n\t *\n\t * @since 0.71\n\t *\n\t * @param string|null $query  SQL query.\n\t * @param string      $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which\n\t *                            correspond to an stdClass object, an associative array, or a numeric array,\n\t *                            respectively. Default OBJECT.\n\t * @param int         $y      Optional. Row to return. Indexed from 0.\n\t * @return array|object|null|void Database query result in format specified by $output or null on failure.\n\t */\n\tpublic function get_row( $query = null, $output = OBJECT, $y = 0 ) {\n\t\t$this->func_call = \"\\$db->get_row(\\\"$query\\\",$output,$y)\";\n\n\t\tif ( $this->check_current_query && $this->check_safe_collation( $query ) ) {\n\t\t\t$this->check_current_query = false;\n\t\t}\n\n\t\tif ( $query ) {\n\t\t\t$this->query( $query );\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( ! isset( $this->last_result[ $y ] ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( OBJECT === $output ) {\n\t\t\treturn $this->last_result[ $y ] ? $this->last_result[ $y ] : null;\n\t\t} elseif ( ARRAY_A === $output ) {\n\t\t\treturn $this->last_result[ $y ] ? get_object_vars( $this->last_result[ $y ] ) : null;\n\t\t} elseif ( ARRAY_N === $output ) {\n\t\t\treturn $this->last_result[ $y ] ? array_values( get_object_vars( $this->last_result[ $y ] ) ) : null;\n\t\t} elseif ( OBJECT === strtoupper( $output ) ) {\n\t\t\t// Back compat for OBJECT being previously case-insensitive.\n\t\t\treturn $this->last_result[ $y ] ? $this->last_result[ $y ] : null;\n\t\t} else {\n\t\t\t$this->print_error( ' $db->get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N' );\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves one column from the database.\n\t *\n\t * Executes a SQL query and returns the column from the SQL result.\n\t * If the SQL result contains more than one column, the column specified is returned.\n\t * If $query is null, the specified column from the previous SQL result is returned.\n\t *\n\t * @since 0.71\n\t *\n\t * @param string|null $query Optional. SQL query. Defaults to previous query.\n\t * @param int         $x     Optional. Column to return. Indexed from 0.\n\t * @return array Database query result. Array indexed from 0 by SQL result row number.\n\t */\n\tpublic function get_col( $query = null, $x = 0 ) {\n\t\tif ( $this->check_current_query && $this->check_safe_collation( $query ) ) {\n\t\t\t$this->check_current_query = false;\n\t\t}\n\n\t\tif ( $query ) {\n\t\t\t$this->query( $query );\n\t\t}\n\n\t\t$new_array = array();\n\t\t// Extract the column values.\n\t\tif ( $this->last_result ) {\n\t\t\tfor ( $i = 0, $j = count( $this->last_result ); $i < $j; $i++ ) {\n\t\t\t\t$new_array[ $i ] = $this->get_var( null, $x, $i );\n\t\t\t}\n\t\t}\n\t\treturn $new_array;\n\t}\n\n\t/**\n\t * Retrieves an entire SQL result set from the database (i.e., many rows).\n\t *\n\t * Executes a SQL query and returns the entire SQL result.\n\t *\n\t * @since 0.71\n\t *\n\t * @param string $query  SQL query.\n\t * @param string $output Optional. Any of ARRAY_A | ARRAY_N | OBJECT | OBJECT_K constants.\n\t *                       With one of the first three, return an array of rows indexed\n\t *                       from 0 by SQL result row number. Each row is an associative array\n\t *                       (column => value, ...), a numerically indexed array (0 => value, ...),\n\t *                       or an object ( ->column = value ), respectively. With OBJECT_K,\n\t *                       return an associative array of row objects keyed by the value\n\t *                       of each row's first column's value. Duplicate keys are discarded.\n\t * @return array|object|null Database query results.\n\t */\n\tpublic function get_results( $query = null, $output = OBJECT ) {\n\t\t$this->func_call = \"\\$db->get_results(\\\"$query\\\", $output)\";\n\n\t\tif ( $this->check_current_query && $this->check_safe_collation( $query ) ) {\n\t\t\t$this->check_current_query = false;\n\t\t}\n\n\t\tif ( $query ) {\n\t\t\t$this->query( $query );\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\n\t\t$new_array = array();\n\t\tif ( OBJECT === $output ) {\n\t\t\t// Return an integer-keyed array of row objects.\n\t\t\treturn $this->last_result;\n\t\t} elseif ( OBJECT_K === $output ) {\n\t\t\t// Return an array of row objects with keys from column 1.\n\t\t\t// (Duplicates are discarded.)\n\t\t\tif ( $this->last_result ) {\n\t\t\t\tforeach ( $this->last_result as $row ) {\n\t\t\t\t\t$var_by_ref = get_object_vars( $row );\n\t\t\t\t\t$key        = array_shift( $var_by_ref );\n\t\t\t\t\tif ( ! isset( $new_array[ $key ] ) ) {\n\t\t\t\t\t\t$new_array[ $key ] = $row;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $new_array;\n\t\t} elseif ( ARRAY_A === $output || ARRAY_N === $output ) {\n\t\t\t// Return an integer-keyed array of...\n\t\t\tif ( $this->last_result ) {\n\t\t\t\tforeach ( (array) $this->last_result as $row ) {\n\t\t\t\t\tif ( ARRAY_N === $output ) {\n\t\t\t\t\t\t// ...integer-keyed row arrays.\n\t\t\t\t\t\t$new_array[] = array_values( get_object_vars( $row ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// ...column name-keyed row arrays.\n\t\t\t\t\t\t$new_array[] = get_object_vars( $row );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $new_array;\n\t\t} elseif ( strtoupper( $output ) === OBJECT ) {\n\t\t\t// Back compat for OBJECT being previously case-insensitive.\n\t\t\treturn $this->last_result;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Retrieves the character set for the given table.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param string $table Table name.\n\t * @return string|WP_Error Table character set, WP_Error object if it couldn't be found.\n\t */\n\tprotected function get_table_charset( $table ) {\n\t\t$tablekey = strtolower( $table );\n\n\t\t/**\n\t\t * Filters the table charset value before the DB is checked.\n\t\t *\n\t\t * Passing a non-null value to the filter will effectively short-circuit\n\t\t * checking the DB for the charset, returning that value instead.\n\t\t *\n\t\t * @since 4.2.0\n\t\t *\n\t\t * @param string|null $charset The character set to use. Default null.\n\t\t * @param string      $table   The name of the table being checked.\n\t\t */\n\t\t$charset = apply_filters( 'pre_get_table_charset', null, $table );\n\t\tif ( null !== $charset ) {\n\t\t\treturn $charset;\n\t\t}\n\n\t\tif ( isset( $this->table_charset[ $tablekey ] ) ) {\n\t\t\treturn $this->table_charset[ $tablekey ];\n\t\t}\n\n\t\t$charsets = array();\n\t\t$columns  = array();\n\n\t\t$table_parts = explode( '.', $table );\n\t\t$table       = '`' . implode( '`.`', $table_parts ) . '`';\n\t\t$results     = $this->get_results( \"SHOW FULL COLUMNS FROM $table\" );\n\t\tif ( ! $results ) {\n\t\t\treturn new WP_Error( 'wpdb_get_table_charset_failure' );\n\t\t}\n\n\t\tforeach ( $results as $column ) {\n\t\t\t$columns[ strtolower( $column->Field ) ] = $column;\n\t\t}\n\n\t\t$this->col_meta[ $tablekey ] = $columns;\n\n\t\tforeach ( $columns as $column ) {\n\t\t\tif ( ! empty( $column->Collation ) ) {\n\t\t\t\tlist( $charset ) = explode( '_', $column->Collation );\n\n\t\t\t\t// If the current connection can't support utf8mb4 characters, let's only send 3-byte utf8 characters.\n\t\t\t\tif ( 'utf8mb4' === $charset && ! $this->has_cap( 'utf8mb4' ) ) {\n\t\t\t\t\t$charset = 'utf8';\n\t\t\t\t}\n\n\t\t\t\t$charsets[ strtolower( $charset ) ] = true;\n\t\t\t}\n\n\t\t\tlist( $type ) = explode( '(', $column->Type );\n\n\t\t\t// A binary/blob means the whole query gets treated like this.\n\t\t\tif ( in_array( strtoupper( $type ), array( 'BINARY', 'VARBINARY', 'TINYBLOB', 'MEDIUMBLOB', 'BLOB', 'LONGBLOB' ), true ) ) {\n\t\t\t\t$this->table_charset[ $tablekey ] = 'binary';\n\t\t\t\treturn 'binary';\n\t\t\t}\n\t\t}\n\n\t\t// utf8mb3 is an alias for utf8.\n\t\tif ( isset( $charsets['utf8mb3'] ) ) {\n\t\t\t$charsets['utf8'] = true;\n\t\t\tunset( $charsets['utf8mb3'] );\n\t\t}\n\n\t\t// Check if we have more than one charset in play.\n\t\t$count = count( $charsets );\n\t\tif ( 1 === $count ) {\n\t\t\t$charset = key( $charsets );\n\t\t} elseif ( 0 === $count ) {\n\t\t\t// No charsets, assume this table can store whatever.\n\t\t\t$charset = false;\n\t\t} else {\n\t\t\t// More than one charset. Remove latin1 if present and recalculate.\n\t\t\tunset( $charsets['latin1'] );\n\t\t\t$count = count( $charsets );\n\t\t\tif ( 1 === $count ) {\n\t\t\t\t// Only one charset (besides latin1).\n\t\t\t\t$charset = key( $charsets );\n\t\t\t} elseif ( 2 === $count && isset( $charsets['utf8'], $charsets['utf8mb4'] ) ) {\n\t\t\t\t// Two charsets, but they're utf8 and utf8mb4, use utf8.\n\t\t\t\t$charset = 'utf8';\n\t\t\t} else {\n\t\t\t\t// Two mixed character sets. ascii.\n\t\t\t\t$charset = 'ascii';\n\t\t\t}\n\t\t}\n\n\t\t$this->table_charset[ $tablekey ] = $charset;\n\t\treturn $charset;\n\t}\n\n\t/**\n\t * Retrieves the character set for the given column.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param string $table  Table name.\n\t * @param string $column Column name.\n\t * @return string|false|WP_Error Column character set as a string. False if the column has\n\t *                               no character set. WP_Error object if there was an error.\n\t */\n\tpublic function get_col_charset( $table, $column ) {\n\t\t$tablekey  = strtolower( $table );\n\t\t$columnkey = strtolower( $column );\n\n\t\t/**\n\t\t * Filters the column charset value before the DB is checked.\n\t\t *\n\t\t * Passing a non-null value to the filter will short-circuit\n\t\t * checking the DB for the charset, returning that value instead.\n\t\t *\n\t\t * @since 4.2.0\n\t\t *\n\t\t * @param string|null $charset The character set to use. Default null.\n\t\t * @param string      $table   The name of the table being checked.\n\t\t * @param string      $column  The name of the column being checked.\n\t\t */\n\t\t$charset = apply_filters( 'pre_get_col_charset', null, $table, $column );\n\t\tif ( null !== $charset ) {\n\t\t\treturn $charset;\n\t\t}\n\n\t\t// Skip this entirely if this isn't a MySQL database.\n\t\tif ( empty( $this->is_mysql ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( empty( $this->table_charset[ $tablekey ] ) ) {\n\t\t\t// This primes column information for us.\n\t\t\t$table_charset = $this->get_table_charset( $table );\n\t\t\tif ( is_wp_error( $table_charset ) ) {\n\t\t\t\treturn $table_charset;\n\t\t\t}\n\t\t}\n\n\t\t// If still no column information, return the table charset.\n\t\tif ( empty( $this->col_meta[ $tablekey ] ) ) {\n\t\t\treturn $this->table_charset[ $tablekey ];\n\t\t}\n\n\t\t// If this column doesn't exist, return the table charset.\n\t\tif ( empty( $this->col_meta[ $tablekey ][ $columnkey ] ) ) {\n\t\t\treturn $this->table_charset[ $tablekey ];\n\t\t}\n\n\t\t// Return false when it's not a string column.\n\t\tif ( empty( $this->col_meta[ $tablekey ][ $columnkey ]->Collation ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlist( $charset ) = explode( '_', $this->col_meta[ $tablekey ][ $columnkey ]->Collation );\n\t\treturn $charset;\n\t}\n\n\t/**\n\t * Retrieves the maximum string length allowed in a given column.\n\t *\n\t * The length may either be specified as a byte length or a character length.\n\t *\n\t * @since 4.2.1\n\t *\n\t * @param string $table  Table name.\n\t * @param string $column Column name.\n\t * @return array|false|WP_Error array( 'length' => (int), 'type' => 'byte' | 'char' ).\n\t *                              False if the column has no length (for example, numeric column).\n\t *                              WP_Error object if there was an error.\n\t */\n\tpublic function get_col_length( $table, $column ) {\n\t\t$tablekey  = strtolower( $table );\n\t\t$columnkey = strtolower( $column );\n\n\t\t// Skip this entirely if this isn't a MySQL database.\n\t\tif ( empty( $this->is_mysql ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( empty( $this->col_meta[ $tablekey ] ) ) {\n\t\t\t// This primes column information for us.\n\t\t\t$table_charset = $this->get_table_charset( $table );\n\t\t\tif ( is_wp_error( $table_charset ) ) {\n\t\t\t\treturn $table_charset;\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $this->col_meta[ $tablekey ][ $columnkey ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$typeinfo = explode( '(', $this->col_meta[ $tablekey ][ $columnkey ]->Type );\n\n\t\t$type = strtolower( $typeinfo[0] );\n\t\tif ( ! empty( $typeinfo[1] ) ) {\n\t\t\t$length = trim( $typeinfo[1], ')' );\n\t\t} else {\n\t\t\t$length = false;\n\t\t}\n\n\t\tswitch ( $type ) {\n\t\t\tcase 'char':\n\t\t\tcase 'varchar':\n\t\t\t\treturn array(\n\t\t\t\t\t'type'   => 'char',\n\t\t\t\t\t'length' => (int) $length,\n\t\t\t\t);\n\n\t\t\tcase 'binary':\n\t\t\tcase 'varbinary':\n\t\t\t\treturn array(\n\t\t\t\t\t'type'   => 'byte',\n\t\t\t\t\t'length' => (int) $length,\n\t\t\t\t);\n\n\t\t\tcase 'tinyblob':\n\t\t\tcase 'tinytext':\n\t\t\t\treturn array(\n\t\t\t\t\t'type'   => 'byte',\n\t\t\t\t\t'length' => 255,        // 2^8 - 1\n\t\t\t\t);\n\n\t\t\tcase 'blob':\n\t\t\tcase 'text':\n\t\t\t\treturn array(\n\t\t\t\t\t'type'   => 'byte',\n\t\t\t\t\t'length' => 65535,      // 2^16 - 1\n\t\t\t\t);\n\n\t\t\tcase 'mediumblob':\n\t\t\tcase 'mediumtext':\n\t\t\t\treturn array(\n\t\t\t\t\t'type'   => 'byte',\n\t\t\t\t\t'length' => 16777215,   // 2^24 - 1\n\t\t\t\t);\n\n\t\t\tcase 'longblob':\n\t\t\tcase 'longtext':\n\t\t\t\treturn array(\n\t\t\t\t\t'type'   => 'byte',\n\t\t\t\t\t'length' => 4294967295, // 2^32 - 1\n\t\t\t\t);\n\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Checks if a string is ASCII.\n\t *\n\t * The negative regex is faster for non-ASCII strings, as it allows\n\t * the search to finish as soon as it encounters a non-ASCII character.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param string $string String to check.\n\t * @return bool True if ASCII, false if not.\n\t */\n\tprotected function check_ascii( $string ) {\n\t\tif ( function_exists( 'mb_check_encoding' ) ) {\n\t\t\tif ( mb_check_encoding( $string, 'ASCII' ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} elseif ( ! preg_match( '/[^\\x00-\\x7F]/', $string ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks if the query is accessing a collation considered safe on the current version of MySQL.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param string $query The query to check.\n\t * @return bool True if the collation is safe, false if it isn't.\n\t */\n\tprotected function check_safe_collation( $query ) {\n\t\tif ( $this->checking_collation ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// We don't need to check the collation for queries that don't read data.\n\t\t$query = ltrim( $query, \"\\r\\n\\t (\" );\n\t\tif ( preg_match( '/^(?:SHOW|DESCRIBE|DESC|EXPLAIN|CREATE)\\s/i', $query ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// All-ASCII queries don't need extra checking.\n\t\tif ( $this->check_ascii( $query ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$table = $this->get_table_from_query( $query );\n\t\tif ( ! $table ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->checking_collation = true;\n\t\t$collation                = $this->get_table_charset( $table );\n\t\t$this->checking_collation = false;\n\n\t\t// Tables with no collation, or latin1 only, don't need extra checking.\n\t\tif ( false === $collation || 'latin1' === $collation ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$table = strtolower( $table );\n\t\tif ( empty( $this->col_meta[ $table ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If any of the columns don't have one of these collations, it needs more sanity checking.\n\t\tforeach ( $this->col_meta[ $table ] as $col ) {\n\t\t\tif ( empty( $col->Collation ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! in_array( $col->Collation, array( 'utf8_general_ci', 'utf8_bin', 'utf8mb4_general_ci', 'utf8mb4_bin' ), true ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Strips any invalid characters based on value/charset pairs.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param array $data Array of value arrays. Each value array has the keys 'value' and 'charset'.\n\t *                    An optional 'ascii' key can be set to false to avoid redundant ASCII checks.\n\t * @return array|WP_Error The $data parameter, with invalid characters removed from each value.\n\t *                        This works as a passthrough: any additional keys such as 'field' are\n\t *                        retained in each value array. If we cannot remove invalid characters,\n\t *                        a WP_Error object is returned.\n\t */\n\tprotected function strip_invalid_text( $data ) {\n\t\t$db_check_string = false;\n\n\t\tforeach ( $data as &$value ) {\n\t\t\t$charset = $value['charset'];\n\n\t\t\tif ( is_array( $value['length'] ) ) {\n\t\t\t\t$length                  = $value['length']['length'];\n\t\t\t\t$truncate_by_byte_length = 'byte' === $value['length']['type'];\n\t\t\t} else {\n\t\t\t\t$length = false;\n\t\t\t\t// Since we have no length, we'll never truncate. Initialize the variable to false.\n\t\t\t\t// True would take us through an unnecessary (for this case) codepath below.\n\t\t\t\t$truncate_by_byte_length = false;\n\t\t\t}\n\n\t\t\t// There's no charset to work with.\n\t\t\tif ( false === $charset ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Column isn't a string.\n\t\t\tif ( ! is_string( $value['value'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$needs_validation = true;\n\t\t\tif (\n\t\t\t\t// latin1 can store any byte sequence.\n\t\t\t\t'latin1' === $charset\n\t\t\t||\n\t\t\t\t// ASCII is always OK.\n\t\t\t\t( ! isset( $value['ascii'] ) && $this->check_ascii( $value['value'] ) )\n\t\t\t) {\n\t\t\t\t$truncate_by_byte_length = true;\n\t\t\t\t$needs_validation        = false;\n\t\t\t}\n\n\t\t\tif ( $truncate_by_byte_length ) {\n\t\t\t\tmbstring_binary_safe_encoding();\n\t\t\t\tif ( false !== $length && strlen( $value['value'] ) > $length ) {\n\t\t\t\t\t$value['value'] = substr( $value['value'], 0, $length );\n\t\t\t\t}\n\t\t\t\treset_mbstring_encoding();\n\n\t\t\t\tif ( ! $needs_validation ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// utf8 can be handled by regex, which is a bunch faster than a DB lookup.\n\t\t\tif ( ( 'utf8' === $charset || 'utf8mb3' === $charset || 'utf8mb4' === $charset ) && function_exists( 'mb_strlen' ) ) {\n\t\t\t\t$regex = '/\n\t\t\t\t\t(\n\t\t\t\t\t\t(?: [\\x00-\\x7F]                  # single-byte sequences   0xxxxxxx\n\t\t\t\t\t\t|   [\\xC2-\\xDF][\\x80-\\xBF]       # double-byte sequences   110xxxxx 10xxxxxx\n\t\t\t\t\t\t|   \\xE0[\\xA0-\\xBF][\\x80-\\xBF]   # triple-byte sequences   1110xxxx 10xxxxxx * 2\n\t\t\t\t\t\t|   [\\xE1-\\xEC][\\x80-\\xBF]{2}\n\t\t\t\t\t\t|   \\xED[\\x80-\\x9F][\\x80-\\xBF]\n\t\t\t\t\t\t|   [\\xEE-\\xEF][\\x80-\\xBF]{2}';\n\n\t\t\t\tif ( 'utf8mb4' === $charset ) {\n\t\t\t\t\t$regex .= '\n\t\t\t\t\t\t|    \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # four-byte sequences   11110xxx 10xxxxxx * 3\n\t\t\t\t\t\t|    [\\xF1-\\xF3][\\x80-\\xBF]{3}\n\t\t\t\t\t\t|    \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2}\n\t\t\t\t\t';\n\t\t\t\t}\n\n\t\t\t\t$regex         .= '){1,40}                          # ...one or more times\n\t\t\t\t\t)\n\t\t\t\t\t| .                                  # anything else\n\t\t\t\t\t/x';\n\t\t\t\t$value['value'] = preg_replace( $regex, '$1', $value['value'] );\n\n\t\t\t\tif ( false !== $length && mb_strlen( $value['value'], 'UTF-8' ) > $length ) {\n\t\t\t\t\t$value['value'] = mb_substr( $value['value'], 0, $length, 'UTF-8' );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// We couldn't use any local conversions, send it to the DB.\n\t\t\t$value['db']     = true;\n\t\t\t$db_check_string = true;\n\t\t}\n\t\tunset( $value ); // Remove by reference.\n\n\t\tif ( $db_check_string ) {\n\t\t\t$queries = array();\n\t\t\tforeach ( $data as $col => $value ) {\n\t\t\t\tif ( ! empty( $value['db'] ) ) {\n\t\t\t\t\t// We're going to need to truncate by characters or bytes, depending on the length value we have.\n\t\t\t\t\tif ( isset( $value['length']['type'] ) && 'byte' === $value['length']['type'] ) {\n\t\t\t\t\t\t// Using binary causes LEFT() to truncate by bytes.\n\t\t\t\t\t\t$charset = 'binary';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$charset = $value['charset'];\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $this->charset ) {\n\t\t\t\t\t\t$connection_charset = $this->charset;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( $this->use_mysqli ) {\n\t\t\t\t\t\t\t$connection_charset = mysqli_character_set_name( $this->dbh );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$connection_charset = mysql_client_encoding();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( is_array( $value['length'] ) ) {\n\t\t\t\t\t\t$length          = sprintf( '%.0f', $value['length']['length'] );\n\t\t\t\t\t\t$queries[ $col ] = $this->prepare( \"CONVERT( LEFT( CONVERT( %s USING $charset ), $length ) USING $connection_charset )\", $value['value'] );\n\t\t\t\t\t} elseif ( 'binary' !== $charset ) {\n\t\t\t\t\t\t// If we don't have a length, there's no need to convert binary - it will always return the same result.\n\t\t\t\t\t\t$queries[ $col ] = $this->prepare( \"CONVERT( CONVERT( %s USING $charset ) USING $connection_charset )\", $value['value'] );\n\t\t\t\t\t}\n\n\t\t\t\t\tunset( $data[ $col ]['db'] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$sql = array();\n\t\t\tforeach ( $queries as $column => $query ) {\n\t\t\t\tif ( ! $query ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$sql[] = $query . \" AS x_$column\";\n\t\t\t}\n\n\t\t\t$this->check_current_query = false;\n\t\t\t$row                       = $this->get_row( 'SELECT ' . implode( ', ', $sql ), ARRAY_A );\n\t\t\tif ( ! $row ) {\n\t\t\t\treturn new WP_Error( 'wpdb_strip_invalid_text_failure' );\n\t\t\t}\n\n\t\t\tforeach ( array_keys( $data ) as $column ) {\n\t\t\t\tif ( isset( $row[ \"x_$column\" ] ) ) {\n\t\t\t\t\t$data[ $column ]['value'] = $row[ \"x_$column\" ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Strips any invalid characters from the query.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param string $query Query to convert.\n\t * @return string|WP_Error The converted query, or a WP_Error object if the conversion fails.\n\t */\n\tprotected function strip_invalid_text_from_query( $query ) {\n\t\t// We don't need to check the collation for queries that don't read data.\n\t\t$trimmed_query = ltrim( $query, \"\\r\\n\\t (\" );\n\t\tif ( preg_match( '/^(?:SHOW|DESCRIBE|DESC|EXPLAIN|CREATE)\\s/i', $trimmed_query ) ) {\n\t\t\treturn $query;\n\t\t}\n\n\t\t$table = $this->get_table_from_query( $query );\n\t\tif ( $table ) {\n\t\t\t$charset = $this->get_table_charset( $table );\n\t\t\tif ( is_wp_error( $charset ) ) {\n\t\t\t\treturn $charset;\n\t\t\t}\n\n\t\t\t// We can't reliably strip text from tables containing binary/blob columns.\n\t\t\tif ( 'binary' === $charset ) {\n\t\t\t\treturn $query;\n\t\t\t}\n\t\t} else {\n\t\t\t$charset = $this->charset;\n\t\t}\n\n\t\t$data = array(\n\t\t\t'value'   => $query,\n\t\t\t'charset' => $charset,\n\t\t\t'ascii'   => false,\n\t\t\t'length'  => false,\n\t\t);\n\n\t\t$data = $this->strip_invalid_text( array( $data ) );\n\t\tif ( is_wp_error( $data ) ) {\n\t\t\treturn $data;\n\t\t}\n\n\t\treturn $data[0]['value'];\n\t}\n\n\t/**\n\t * Strips any invalid characters from the string for a given table and column.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param string $table  Table name.\n\t * @param string $column Column name.\n\t * @param string $value  The text to check.\n\t * @return string|WP_Error The converted string, or a WP_Error object if the conversion fails.\n\t */\n\tpublic function strip_invalid_text_for_column( $table, $column, $value ) {\n\t\tif ( ! is_string( $value ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\t$charset = $this->get_col_charset( $table, $column );\n\t\tif ( ! $charset ) {\n\t\t\t// Not a string column.\n\t\t\treturn $value;\n\t\t} elseif ( is_wp_error( $charset ) ) {\n\t\t\t// Bail on real errors.\n\t\t\treturn $charset;\n\t\t}\n\n\t\t$data = array(\n\t\t\t$column => array(\n\t\t\t\t'value'   => $value,\n\t\t\t\t'charset' => $charset,\n\t\t\t\t'length'  => $this->get_col_length( $table, $column ),\n\t\t\t),\n\t\t);\n\n\t\t$data = $this->strip_invalid_text( $data );\n\t\tif ( is_wp_error( $data ) ) {\n\t\t\treturn $data;\n\t\t}\n\n\t\treturn $data[ $column ]['value'];\n\t}\n\n\t/**\n\t * Finds the first table name referenced in a query.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @param string $query The query to search.\n\t * @return string|false The table name found, or false if a table couldn't be found.\n\t */\n\tprotected function get_table_from_query( $query ) {\n\t\t// Remove characters that can legally trail the table name.\n\t\t$query = rtrim( $query, ';/-#' );\n\n\t\t// Allow (select...) union [...] style queries. Use the first query's table name.\n\t\t$query = ltrim( $query, \"\\r\\n\\t (\" );\n\n\t\t// Strip everything between parentheses except nested selects.\n\t\t$query = preg_replace( '/\\((?!\\s*select)[^(]*?\\)/is', '()', $query );\n\n\t\t// Quickly match most common queries.\n\t\tif ( preg_match(\n\t\t\t'/^\\s*(?:'\n\t\t\t\t. 'SELECT.*?\\s+FROM'\n\t\t\t\t. '|INSERT(?:\\s+LOW_PRIORITY|\\s+DELAYED|\\s+HIGH_PRIORITY)?(?:\\s+IGNORE)?(?:\\s+INTO)?'\n\t\t\t\t. '|REPLACE(?:\\s+LOW_PRIORITY|\\s+DELAYED)?(?:\\s+INTO)?'\n\t\t\t\t. '|UPDATE(?:\\s+LOW_PRIORITY)?(?:\\s+IGNORE)?'\n\t\t\t\t. '|DELETE(?:\\s+LOW_PRIORITY|\\s+QUICK|\\s+IGNORE)*(?:.+?FROM)?'\n\t\t\t. ')\\s+((?:[0-9a-zA-Z$_.`-]|[\\xC2-\\xDF][\\x80-\\xBF])+)/is',\n\t\t\t$query,\n\t\t\t$maybe\n\t\t) ) {\n\t\t\treturn str_replace( '`', '', $maybe[1] );\n\t\t}\n\n\t\t// SHOW TABLE STATUS and SHOW TABLES WHERE Name = 'wp_posts'\n\t\tif ( preg_match( '/^\\s*SHOW\\s+(?:TABLE\\s+STATUS|(?:FULL\\s+)?TABLES).+WHERE\\s+Name\\s*=\\s*(\"|\\')((?:[0-9a-zA-Z$_.-]|[\\xC2-\\xDF][\\x80-\\xBF])+)\\\\1/is', $query, $maybe ) ) {\n\t\t\treturn $maybe[2];\n\t\t}\n\n\t\t/*\n\t\t * SHOW TABLE STATUS LIKE and SHOW TABLES LIKE 'wp\\_123\\_%'\n\t\t * This quoted LIKE operand seldom holds a full table name.\n\t\t * It is usually a pattern for matching a prefix so we just\n\t\t * strip the trailing % and unescape the _ to get 'wp_123_'\n\t\t * which drop-ins can use for routing these SQL statements.\n\t\t */\n\t\tif ( preg_match( '/^\\s*SHOW\\s+(?:TABLE\\s+STATUS|(?:FULL\\s+)?TABLES)\\s+(?:WHERE\\s+Name\\s+)?LIKE\\s*(\"|\\')((?:[\\\\\\\\0-9a-zA-Z$_.-]|[\\xC2-\\xDF][\\x80-\\xBF])+)%?\\\\1/is', $query, $maybe ) ) {\n\t\t\treturn str_replace( '\\\\_', '_', $maybe[2] );\n\t\t}\n\n\t\t// Big pattern for the rest of the table-related queries.\n\t\tif ( preg_match(\n\t\t\t'/^\\s*(?:'\n\t\t\t\t. '(?:EXPLAIN\\s+(?:EXTENDED\\s+)?)?SELECT.*?\\s+FROM'\n\t\t\t\t. '|DESCRIBE|DESC|EXPLAIN|HANDLER'\n\t\t\t\t. '|(?:LOCK|UNLOCK)\\s+TABLE(?:S)?'\n\t\t\t\t. '|(?:RENAME|OPTIMIZE|BACKUP|RESTORE|CHECK|CHECKSUM|ANALYZE|REPAIR).*\\s+TABLE'\n\t\t\t\t. '|TRUNCATE(?:\\s+TABLE)?'\n\t\t\t\t. '|CREATE(?:\\s+TEMPORARY)?\\s+TABLE(?:\\s+IF\\s+NOT\\s+EXISTS)?'\n\t\t\t\t. '|ALTER(?:\\s+IGNORE)?\\s+TABLE'\n\t\t\t\t. '|DROP\\s+TABLE(?:\\s+IF\\s+EXISTS)?'\n\t\t\t\t. '|CREATE(?:\\s+\\w+)?\\s+INDEX.*\\s+ON'\n\t\t\t\t. '|DROP\\s+INDEX.*\\s+ON'\n\t\t\t\t. '|LOAD\\s+DATA.*INFILE.*INTO\\s+TABLE'\n\t\t\t\t. '|(?:GRANT|REVOKE).*ON\\s+TABLE'\n\t\t\t\t. '|SHOW\\s+(?:.*FROM|.*TABLE)'\n\t\t\t. ')\\s+\\(*\\s*((?:[0-9a-zA-Z$_.`-]|[\\xC2-\\xDF][\\x80-\\xBF])+)\\s*\\)*/is',\n\t\t\t$query,\n\t\t\t$maybe\n\t\t) ) {\n\t\t\treturn str_replace( '`', '', $maybe[1] );\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Loads the column metadata from the last query.\n\t *\n\t * @since 3.5.0\n\t */\n\tprotected function load_col_info() {\n\t\tif ( $this->col_info ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $this->use_mysqli ) {\n\t\t\t$num_fields = mysqli_num_fields( $this->result );\n\t\t\tfor ( $i = 0; $i < $num_fields; $i++ ) {\n\t\t\t\t$this->col_info[ $i ] = mysqli_fetch_field( $this->result );\n\t\t\t}\n\t\t} else {\n\t\t\t$num_fields = mysql_num_fields( $this->result );\n\t\t\tfor ( $i = 0; $i < $num_fields; $i++ ) {\n\t\t\t\t$this->col_info[ $i ] = mysql_fetch_field( $this->result, $i );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves column metadata from the last query.\n\t *\n\t * @since 0.71\n\t *\n\t * @param string $info_type  Optional. Possible values include 'name', 'table', 'def', 'max_length',\n\t *                           'not_null', 'primary_key', 'multiple_key', 'unique_key', 'numeric',\n\t *                           'blob', 'type', 'unsigned', 'zerofill'. Default 'name'.\n\t * @param int    $col_offset Optional. 0: col name. 1: which table the col's in. 2: col's max length.\n\t *                           3: if the col is numeric. 4: col's type. Default -1.\n\t * @return mixed Column results.\n\t */\n\tpublic function get_col_info( $info_type = 'name', $col_offset = -1 ) {\n\t\t$this->load_col_info();\n\n\t\tif ( $this->col_info ) {\n\t\t\tif ( -1 === $col_offset ) {\n\t\t\t\t$i         = 0;\n\t\t\t\t$new_array = array();\n\t\t\t\tforeach ( (array) $this->col_info as $col ) {\n\t\t\t\t\t$new_array[ $i ] = $col->{$info_type};\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\treturn $new_array;\n\t\t\t} else {\n\t\t\t\treturn $this->col_info[ $col_offset ]->{$info_type};\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Starts the timer, for debugging purposes.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return true\n\t */\n\tpublic function timer_start() {\n\t\t$this->time_start = microtime( true );\n\t\treturn true;\n\t}\n\n\t/**\n\t * Stops the debugging timer.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return float Total time spent on the query, in seconds.\n\t */\n\tpublic function timer_stop() {\n\t\treturn ( microtime( true ) - $this->time_start );\n\t}\n\n\t/**\n\t * Wraps errors in a nice header and footer and dies.\n\t *\n\t * Will not die if wpdb::$show_errors is false.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @param string $message    The error message.\n\t * @param string $error_code Optional. A computer-readable string to identify the error.\n\t *                           Default '500'.\n\t * @return void|false Void if the showing of errors is enabled, false if disabled.\n\t */\n\tpublic function bail( $message, $error_code = '500' ) {\n\t\tif ( $this->show_errors ) {\n\t\t\t$error = '';\n\n\t\t\tif ( $this->use_mysqli ) {\n\t\t\t\tif ( $this->dbh instanceof mysqli ) {\n\t\t\t\t\t$error = mysqli_error( $this->dbh );\n\t\t\t\t} elseif ( mysqli_connect_errno() ) {\n\t\t\t\t\t$error = mysqli_connect_error();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( is_resource( $this->dbh ) ) {\n\t\t\t\t\t$error = mysql_error( $this->dbh );\n\t\t\t\t} else {\n\t\t\t\t\t$error = mysql_error();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $error ) {\n\t\t\t\t$message = '<p><code>' . $error . \"</code></p>\\n\" . $message;\n\t\t\t}\n\n\t\t\twp_die( $message );\n\t\t} else {\n\t\t\tif ( class_exists( 'WP_Error', false ) ) {\n\t\t\t\t$this->error = new WP_Error( $error_code, $message );\n\t\t\t} else {\n\t\t\t\t$this->error = $message;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t}\n\n\n\t/**\n\t * Closes the current database connection.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @return bool True if the connection was successfully closed,\n\t *              false if it wasn't, or if the connection doesn't exist.\n\t */\n\tpublic function close() {\n\t\tif ( ! $this->dbh ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $this->use_mysqli ) {\n\t\t\t$closed = mysqli_close( $this->dbh );\n\t\t} else {\n\t\t\t$closed = mysql_close( $this->dbh );\n\t\t}\n\n\t\tif ( $closed ) {\n\t\t\t$this->dbh           = null;\n\t\t\t$this->ready         = false;\n\t\t\t$this->has_connected = false;\n\t\t}\n\n\t\treturn $closed;\n\t}\n\n\t/**\n\t * Determines whether MySQL database is at least the required minimum version.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @global string $wp_version             The WordPress version string.\n\t * @global string $required_mysql_version The required MySQL version string.\n\t * @return void|WP_Error\n\t */\n\tpublic function check_database_version() {\n\t\tglobal $wp_version, $required_mysql_version;\n\t\t// Make sure the server has the required MySQL version.\n\t\tif ( version_compare( $this->db_version(), $required_mysql_version, '<' ) ) {\n\t\t\t/* translators: 1: WordPress version number, 2: Minimum required MySQL version number. */\n\t\t\treturn new WP_Error( 'database_version', sprintf( __( '<strong>Error</strong>: WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version ) );\n\t\t}\n\t}\n\n\t/**\n\t * Determines whether the database supports collation.\n\t *\n\t * Called when WordPress is generating the table scheme.\n\t *\n\t * Use `wpdb::has_cap( 'collation' )`.\n\t *\n\t * @since 2.5.0\n\t * @deprecated 3.5.0 Use wpdb::has_cap()\n\t *\n\t * @return bool True if collation is supported, false if not.\n\t */\n\tpublic function supports_collation() {\n\t\t_deprecated_function( __FUNCTION__, '3.5.0', 'wpdb::has_cap( \\'collation\\' )' );\n\t\treturn $this->has_cap( 'collation' );\n\t}\n\n\t/**\n\t * Retrieves the database character collate.\n\t *\n\t * @since 3.5.0\n\t *\n\t * @return string The database character collate.\n\t */\n\tpublic function get_charset_collate() {\n\t\t$charset_collate = '';\n\n\t\tif ( ! empty( $this->charset ) ) {\n\t\t\t$charset_collate = \"DEFAULT CHARACTER SET $this->charset\";\n\t\t}\n\t\tif ( ! empty( $this->collate ) ) {\n\t\t\t$charset_collate .= \" COLLATE $this->collate\";\n\t\t}\n\n\t\treturn $charset_collate;\n\t}\n\n\t/**\n\t * Determines if a database supports a particular feature.\n\t *\n\t * @since 2.7.0\n\t * @since 4.1.0 Added support for the 'utf8mb4' feature.\n\t * @since 4.6.0 Added support for the 'utf8mb4_520' feature.\n\t *\n\t * @see wpdb::db_version()\n\t *\n\t * @param string $db_cap The feature to check for. Accepts 'collation', 'group_concat',\n\t *                       'subqueries', 'set_charset', 'utf8mb4', or 'utf8mb4_520'.\n\t * @return int|false Whether the database feature is supported, false otherwise.\n\t */\n\tpublic function has_cap( $db_cap ) {\n\t\t$version = $this->db_version();\n\n\t\tswitch ( strtolower( $db_cap ) ) {\n\t\t\tcase 'collation':    // @since 2.5.0\n\t\t\tcase 'group_concat': // @since 2.7.0\n\t\t\tcase 'subqueries':   // @since 2.7.0\n\t\t\t\treturn version_compare( $version, '4.1', '>=' );\n\t\t\tcase 'set_charset':\n\t\t\t\treturn version_compare( $version, '5.0.7', '>=' );\n\t\t\tcase 'utf8mb4':      // @since 4.1.0\n\t\t\t\tif ( version_compare( $version, '5.5.3', '<' ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif ( $this->use_mysqli ) {\n\t\t\t\t\t$client_version = mysqli_get_client_info();\n\t\t\t\t} else {\n\t\t\t\t\t$client_version = mysql_get_client_info();\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * libmysql has supported utf8mb4 since 5.5.3, same as the MySQL server.\n\t\t\t\t * mysqlnd has supported utf8mb4 since 5.0.9.\n\t\t\t\t */\n\t\t\t\tif ( false !== strpos( $client_version, 'mysqlnd' ) ) {\n\t\t\t\t\t$client_version = preg_replace( '/^\\D+([\\d.]+).*/', '$1', $client_version );\n\t\t\t\t\treturn version_compare( $client_version, '5.0.9', '>=' );\n\t\t\t\t} else {\n\t\t\t\t\treturn version_compare( $client_version, '5.5.3', '>=' );\n\t\t\t\t}\n\t\t\tcase 'utf8mb4_520': // @since 4.6.0\n\t\t\t\treturn version_compare( $version, '5.6', '>=' );\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Retrieves the name of the function that called wpdb.\n\t *\n\t * Searches up the list of functions until it reaches the one that would\n\t * most logically had called this method.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @return string Comma-separated list of the calling functions.\n\t */\n\tpublic function get_caller() {\n\t\treturn wp_debug_backtrace_summary( __CLASS__ );\n\t}\n\n\t/**\n\t * Retrieves the MySQL server version.\n\t *\n\t * @since 2.7.0\n\t *\n\t * @return string|null Version number on success, null on failure.\n\t */\n\tpublic function db_version() {\n\t\treturn preg_replace( '/[^0-9.].*/', '', $this->db_server_info() );\n\t}\n\n\t/**\n\t * Retrieves full MySQL server information.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return string|false Server info on success, false on failure.\n\t */\n\tpublic function db_server_info() {\n\t\tif ( $this->use_mysqli ) {\n\t\t\t$server_info = mysqli_get_server_info( $this->dbh );\n\t\t} else {\n\t\t\t$server_info = mysql_get_server_info( $this->dbh );\n\t\t}\n\n\t\treturn $server_info;\n\t}\n}\n", "num_lines": 3667}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * WordPress Diff bastard child of old MediaWiki Diff Formatter.\n *\n * Basically all that remains is the table structure and some method names.\n *\n * @package WordPress\n * @subpackage Diff\n */\n\nif ( ! class_exists( 'Text_Diff', false ) ) {\n\t/** Text_Diff class */\n\trequire ABSPATH . WPINC . '/Text/Diff.php';\n\t/** Text_Diff_Renderer class */\n\trequire ABSPATH . WPINC . '/Text/Diff/Renderer.php';\n\t/** Text_Diff_Renderer_inline class */\n\trequire ABSPATH . WPINC . '/Text/Diff/Renderer/inline.php';\n}\n\nrequire ABSPATH . WPINC . '/class-wp-text-diff-renderer-table.php';\nrequire ABSPATH . WPINC . '/class-wp-text-diff-renderer-inline.php';\n", "num_lines": 22}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php return array('a11y.js' => array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => '13971b965470c74a60fa32d392c78f2f'), 'annotations.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => 'eb723f9407c194aa273285192d83b312'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '8773a93ea0d1278a2eaa147fdb6eb96d'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => '762a290d38a892cf7a6a0413600eda07'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => '65d313a41f95f4c2ea65820c3f1cad27'), 'block-directory.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-data-controls', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives'), 'version' => '8388cf6a415f3a2add2bd51874c0ccef'), 'block-editor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-wordcount'), 'version' => 'a5482da84276f82419126932713bda2f'), 'block-library.js' => array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'f09af769b371273ed7ccd78059d641f7'), 'block-serialization-default-parser.js' => array('dependencies' => array('wp-polyfill'), 'version' => '22c85d6c5f095fa70bc1e81f823454da'), 'blocks.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-shortcode'), 'version' => '94ae7f5a0fa088eb1cb5e8b7a601a5eb'), 'components.js' => array('dependencies' => array('lodash', 'moment', 'react', 'wp-a11y', 'wp-compose', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => '2152e06558875aa948807b6ffd5da769'), 'compose.js' => array('dependencies' => array('lodash', 'react', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue'), 'version' => 'c4775e2aa9288586791e26a980eff851'), 'core-data.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-data', 'wp-data-controls', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => '966113d894f354075b1eed5a141241bb'), 'data.js' => array('dependencies' => array('lodash', 'react', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-redux-routine'), 'version' => '75f90354ddff4acd5b0b4026454037ca'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-polyfill'), 'version' => '59b9a16339ffe9c2ef592270c19f77ed'), 'date.js' => array('dependencies' => array('moment', 'wp-polyfill'), 'version' => '09eae2d679436dd6bd745b0e8b1687e9'), 'deprecated.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '99b042a92d284c1276e553789c674cab'), 'dom.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '3f7b757d117b8e53e66943297e96bf38'), 'dom-ready.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'db63eb2f693cb5e38b083946b14f0684'), 'edit-post.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning'), 'version' => 'c2b76a0494382d835bb3dbd6b0e2c934'), 'editor.js' => array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport', 'wp-wordcount'), 'version' => 'a65f9b8727c91b9df1641cfd0545e051'), 'element.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => 'd061952232722fcef7dbe8a686d9996f'), 'escape-html.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'f7b0e4c8bb987c1ab79bdda0d9db465b'), 'format-library.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '84ea7b31cf4165d6a32ada977a99acd9'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b4778690e29d8a2b7518413652ba30c4'), 'html-entities.js' => array('dependencies' => array('wp-polyfill'), 'version' => '75dab3db5644768cfaaf16da58993afb'), 'i18n.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'bb7c3c45d012206bfcd73d6a31f84d9e'), 'is-shallow-equal.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'faf996f5d8657ed8cb4e326307229895'), 'keyboard-shortcuts.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-keycodes', 'wp-polyfill'), 'version' => '9cbe52add50401a0e626ebfcb37d742a'), 'keycodes.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill'), 'version' => 'd22da43ca8a6cd671dd34ea661fff05f'), 'list-reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'e2d0d2a64fba958ae8866811a94c3f1c'), 'media-utils.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '9ad24b42cc69f241229ded4dc61409fb'), 'notices.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-polyfill'), 'version' => 'e8ba84906787f0394f07956c137fc314'), 'nux.js' => array('dependencies' => array('lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'd070fe9092a4a8ae465536d7a49b0e62'), 'plugins.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => '782bb26c3f2f05a0d444baf877880dc0'), 'primitives.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => '29a6188bba37f7dd03ab293172d040cd'), 'priority-queue.js' => array('dependencies' => array('wp-polyfill'), 'version' => '25df4fcfc831934f96ee620ba97b8d72'), 'redux-routine.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '9c464c6fba42fc0112f5feedb4939fa6'), 'rich-text.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-keycodes', 'wp-polyfill'), 'version' => 'a4056cfcb2aec8ceb3c8e8935dfd0bc4'), 'server-side-render.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '4f5ad383aad9be9918f3a66c06cd5e4c'), 'shortcode.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '14fe6c63320b3200f356d0bcbca32121'), 'token-list.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '384d238d095e0738c66c24d5efd0d19e'), 'url.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '9dd4e33d1648e90d1390113c29d21f27'), 'viewport.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => '74fa211298bad8b930c1e9c17d583843'), 'warning.js' => array('dependencies' => array('wp-polyfill'), 'version' => '4846e6a00f535179609298debad4670b'), 'wordcount.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '29fa35570f10ea28f9198bc26cd088cd'));", "num_lines": 1}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Heading and paragraph block pattern.\n *\n * @package WordPress\n */\n\nreturn array(\n\t'title'         => __( 'Heading and paragraph' ),\n\t'content'       => \"<!-- wp:group -->\\n<div class=\\\"wp-block-group\\\"><div class=\\\"wp-block-group__inner-container\\\"><!-- wp:heading {\\\"fontSize\\\":\\\"large\\\"} -->\\n<h2 class=\\\"has-large-font-size\\\"><span style=\\\"color:#ba0c49\\\" class=\\\"has-inline-color\\\"><strong>2</strong>.</span><br>\" . __( 'Which treats of the first sally the ingenious Don Quixote made from home' ) . \"</h2>\\n<!-- /wp:heading -->\\n\\n<!-- wp:paragraph -->\\n<p>\" . __( 'These preliminaries settled, he did not care to put off any longer the execution of his design, urged on to it by the thought of all the world was losing by his delay, seeing what wrongs he intended to right, grievances to redress, injustices to repair, abuses to remove, and duties to discharge.' ) . \"</p>\\n<!-- /wp:paragraph --></div></div>\\n<!-- /wp:group -->\",\n\t'viewportWidth' => 1000,\n\t'categories'    => array( 'text' ),\n\t'description'   => _x( 'A heading preceded by a chapter number, and followed by a paragraph.', 'Block pattern description' ),\n);\n", "num_lines": 15}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Large header and a button block pattern.\n *\n * @package WordPress\n */\n\nreturn array(\n\t'title'         => __( 'Large header with a heading and a button ' ),\n\t'content'       => \"<!-- wp:cover {\\\"minHeight\\\":575,\\\"minHeightUnit\\\":\\\"px\\\",\\\"customGradient\\\":\\\"linear-gradient(135deg,rgb(249,72,72) 1%,rgb(179,22,22) 100%)\\\",\\\"contentPosition\\\":\\\"center center\\\",\\\"align\\\":\\\"wide\\\"} -->\\n<div class=\\\"wp-block-cover alignwide has-background-dim has-background-gradient is-position-center-center\\\" style=\\\"background:linear-gradient(135deg,rgb(249,72,72) 1%,rgb(179,22,22) 100%);min-height:575px\\\"><div class=\\\"wp-block-cover__inner-container\\\"><!-- wp:columns {\\\"align\\\":\\\"wide\\\"} -->\\n<div class=\\\"wp-block-columns alignwide\\\"><!-- wp:column {\\\"width\\\":12} -->\\n<div class=\\\"wp-block-column\\\" style=\\\"flex-basis:12%\\\"><!-- wp:spacer -->\\n<div style=\\\"height:100px\\\" aria-hidden=\\\"true\\\" class=\\\"wp-block-spacer\\\"></div>\\n<!-- /wp:spacer --></div>\\n<!-- /wp:column -->\\n\\n<!-- wp:column -->\\n<div class=\\\"wp-block-column\\\"><!-- wp:spacer -->\\n<div style=\\\"height:100px\\\" aria-hidden=\\\"true\\\" class=\\\"wp-block-spacer\\\"></div>\\n<!-- /wp:spacer -->\\n\\n<!-- wp:paragraph {\\\"align\\\":\\\"left\\\",\\\"placeholder\\\":\\\"\" . __( 'Write title\u00e2\u20ac\u00a6' ) . \"\\\",\\\"style\\\":{\\\"typography\\\":{\\\"fontSize\\\":68,\\\"lineHeight\\\":\\\"1.2\\\"},\\\"color\\\":{\\\"text\\\":\\\"#fffffa\\\"}}} -->\\n<p class=\\\"has-text-align-left has-text-color\\\" style=\\\"line-height:1.2;font-size:68px;color:#fffffa\\\"><strong>\" . __( 'Thou hast seen' ) . '</strong><br><strong>' . __( 'nothing yet' ) . \"</strong></p>\\n<!-- /wp:paragraph -->\\n\\n<!-- wp:buttons -->\\n<div class=\\\"wp-block-buttons\\\"><!-- wp:button {\\\"borderRadius\\\":3,\\\"style\\\":{\\\"color\\\":{\\\"background\\\":\\\"#fffffa\\\",\\\"text\\\":\\\"#00000a\\\"}}} -->\\n<div class=\\\"wp-block-button\\\"><a class=\\\"wp-block-button__link has-text-color has-background\\\" style=\\\"border-radius:3px;background-color:#fffffa;color:#00000a\\\">\" . __( 'Read now' ) . \"</a></div>\\n<!-- /wp:button --></div>\\n<!-- /wp:buttons -->\\n\\n<!-- wp:spacer -->\\n<div style=\\\"height:100px\\\" aria-hidden=\\\"true\\\" class=\\\"wp-block-spacer\\\"></div>\\n<!-- /wp:spacer --></div>\\n<!-- /wp:column -->\\n\\n<!-- wp:column {\\\"width\\\":12} -->\\n<div class=\\\"wp-block-column\\\" style=\\\"flex-basis:12%\\\"><!-- wp:spacer -->\\n<div style=\\\"height:100px\\\" aria-hidden=\\\"true\\\" class=\\\"wp-block-spacer\\\"></div>\\n<!-- /wp:spacer --></div>\\n<!-- /wp:column --></div>\\n<!-- /wp:columns --></div></div>\\n<!-- /wp:cover -->\",\n\t'viewportWidth' => 1000,\n\t'categories'    => array( 'header' ),\n\t'description'   => _x( 'A large hero section with a bright gradient background, a big heading and a filled button.', 'Block pattern description' ),\n);\n", "num_lines": 15}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Large header block pattern.\n *\n * @package WordPress\n */\n\nreturn array(\n\t'title'         => __( 'Large header with a heading' ),\n\t'content'       => \"<!-- wp:cover {\\\"url\\\":\\\"https://s.w.org/images/core/5.5/don-quixote-06.jpg\\\",\\\"id\\\":165,\\\"dimRatio\\\":15,\\\"focalPoint\\\":{\\\"x\\\":\\\"0.40\\\",\\\"y\\\":\\\"0.26\\\"},\\\"minHeight\\\":375,\\\"minHeightUnit\\\":\\\"px\\\",\\\"contentPosition\\\":\\\"center center\\\",\\\"align\\\":\\\"wide\\\"} -->\\n<div class=\\\"wp-block-cover alignwide has-background-dim-20 has-background-dim is-position-center-center\\\" style=\\\"background-image:url(https://s.w.org/images/core/5.5/don-quixote-06.jpg);min-height:375px;background-position:40% 26%\\\"><div class=\\\"wp-block-cover__inner-container\\\"><!-- wp:paragraph {\\\"align\\\":\\\"center\\\",\\\"placeholder\\\":\\\"\" . __( 'Write title\u00e2\u20ac\u00a6' ) . \"\\\",\\\"style\\\":{\\\"typography\\\":{\\\"fontSize\\\":74,\\\"lineHeight\\\":\\\"1.1\\\"},\\\"color\\\":{\\\"text\\\":\\\"#fffffa\\\"}}} -->\\n<p class=\\\"has-text-align-center has-text-color\\\" style=\\\"line-height:1.1;font-size:74px;color:#fffffa\\\"><strong>\" . __( 'Don Quixote' ) . \"</strong></p>\\n<!-- /wp:paragraph --></div></div>\\n<!-- /wp:cover -->\",\n\t'viewportWidth' => 1000,\n\t'categories'    => array( 'header' ),\n\t'description'   => _x( 'A large hero section with an example background image and a heading in the center.', 'Block pattern description' ),\n);\n", "num_lines": 15}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Quote block pattern.\n *\n * @package WordPress\n */\n\nreturn array(\n\t'title'         => __( 'Quote' ),\n\t'content'       => \"<!-- wp:group -->\\n<div class=\\\"wp-block-group\\\"><div class=\\\"wp-block-group__inner-container\\\"><!-- wp:image {\\\"align\\\":\\\"center\\\",\\\"width\\\":164,\\\"height\\\":164,\\\"sizeSlug\\\":\\\"large\\\",\\\"className\\\":\\\"is-style-rounded\\\"} -->\\n<div class=\\\"wp-block-image is-style-rounded\\\"><figure class=\\\"aligncenter size-large is-resized\\\"><img src=\\\"https://s.w.org/images/core/5.5/don-quixote-03.jpg\\\" alt=\\\"\" . __( 'Pencil drawing of Don Quixote' ) . \"\\\" width=\\\"164\\\" height=\\\"164\\\"/></figure></div>\\n<!-- /wp:image -->\\n\\n<!-- wp:quote {\\\"align\\\":\\\"center\\\",\\\"className\\\":\\\"is-style-large\\\"} -->\\n<blockquote class=\\\"wp-block-quote has-text-align-center is-style-large\\\"><p>\" . __( '\"Do you see over yonder, friend Sancho, thirty or forty hulking giants? I intend to do battle with them and slay them.\"' ) . '</p><cite>' . __( '\u00e2\u20ac\u201d Don Quixote' ) . \"</cite></blockquote>\\n<!-- /wp:quote -->\\n\\n<!-- wp:separator {\\\"className\\\":\\\"is-style-dots\\\"} -->\\n<hr class=\\\"wp-block-separator is-style-dots\\\"/>\\n<!-- /wp:separator --></div></div>\\n<!-- /wp:group -->\",\n\t'viewportWidth' => 800,\n\t'categories'    => array( 'text' ),\n\t'description'   => _x( 'A quote and citation with an image above, and a separator at the bottom.', 'Block pattern description' ),\n);\n", "num_lines": 15}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Three columns of text, each a button at the bottom block pattern.\n *\n * @package WordPress\n */\n\nreturn array(\n\t'title'         => __( 'Three columns of text with buttons' ),\n\t'categories'    => array( 'columns' ),\n\t'content'       => \"<!-- wp:group {\\\"align\\\":\\\"wide\\\"} -->\\n<div class=\\\"wp-block-group alignwide\\\"><div class=\\\"wp-block-group__inner-container\\\"><!-- wp:columns {\\\"align\\\":\\\"wide\\\"} -->\\n<div class=\\\"wp-block-columns alignwide\\\"><!-- wp:column -->\\n<div class=\\\"wp-block-column\\\"><!-- wp:paragraph -->\\n<p>\" . __( 'Which treats of the character and pursuits of the famous Don Quixote of La Mancha.' ) . \"</p>\\n<!-- /wp:paragraph -->\\n\\n<!-- wp:buttons -->\\n<div class=\\\"wp-block-buttons\\\"><!-- wp:button {\\\"borderRadius\\\":50,\\\"style\\\":{\\\"color\\\":{\\\"text\\\":\\\"#ba0c49\\\"}},\\\"className\\\":\\\"is-style-outline\\\"} -->\\n<div class=\\\"wp-block-button is-style-outline\\\"><a class=\\\"wp-block-button__link has-text-color\\\" style=\\\"border-radius:50px;color:#ba0c49\\\">\" . __( 'Chapter One' ) . \"</a></div>\\n<!-- /wp:button --></div>\\n<!-- /wp:buttons --></div>\\n<!-- /wp:column -->\\n\\n<!-- wp:column -->\\n<div class=\\\"wp-block-column\\\"><!-- wp:paragraph -->\\n<p>\" . __( 'Which treats of the first sally the ingenious Don Quixote made from home.' ) . \"</p>\\n<!-- /wp:paragraph -->\\n\\n<!-- wp:buttons -->\\n<div class=\\\"wp-block-buttons\\\"><!-- wp:button {\\\"borderRadius\\\":50,\\\"style\\\":{\\\"color\\\":{\\\"text\\\":\\\"#ba0c49\\\"}},\\\"className\\\":\\\"is-style-outline\\\"} -->\\n<div class=\\\"wp-block-button is-style-outline\\\"><a class=\\\"wp-block-button__link has-text-color\\\" style=\\\"border-radius:50px;color:#ba0c49\\\">\" . __( 'Chapter Two' ) . \"</a></div>\\n<!-- /wp:button --></div>\\n<!-- /wp:buttons --></div>\\n<!-- /wp:column -->\\n\\n<!-- wp:column -->\\n<div class=\\\"wp-block-column\\\"><!-- wp:paragraph -->\\n<p>\" . __( 'Wherein is related the droll way in which Don Quixote had himself dubbed a knight.' ) . \"</p>\\n<!-- /wp:paragraph -->\\n\\n<!-- wp:buttons -->\\n<div class=\\\"wp-block-buttons\\\"><!-- wp:button {\\\"borderRadius\\\":50,\\\"style\\\":{\\\"color\\\":{\\\"text\\\":\\\"#ba0c49\\\"}},\\\"className\\\":\\\"is-style-outline\\\"} -->\\n<div class=\\\"wp-block-button is-style-outline\\\"><a class=\\\"wp-block-button__link has-text-color\\\" style=\\\"border-radius:50px;color:#ba0c49\\\">\" . __( 'Chapter Three' ) . \"</a></div>\\n<!-- /wp:button --></div>\\n<!-- /wp:buttons --></div>\\n<!-- /wp:column --></div>\\n<!-- /wp:columns --></div></div>\\n<!-- /wp:group -->\",\n\t'viewportWidth' => 1000,\n\t'description'   => _x( 'Three small columns of text, each with an outlined button with rounded corners at the bottom.', 'Block pattern description' ),\n);\n", "num_lines": 15}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Two columns of text, each with an image on top block pattern.\n *\n * @package WordPress\n */\n\nreturn array(\n\t'title'       => __( 'Two columns of text with images' ),\n\t'categories'  => array( 'columns' ),\n\t'content'     => \"<!-- wp:group -->\\n<div class=\\\"wp-block-group\\\"><div class=\\\"wp-block-group__inner-container\\\"><!-- wp:columns -->\\n<div class=\\\"wp-block-columns\\\"><!-- wp:column -->\\n<div class=\\\"wp-block-column\\\"><!-- wp:image {\\\"sizeSlug\\\":\\\"large\\\"} -->\\n<figure class=\\\"wp-block-image size-large\\\"><img src=\\\"https://s.w.org/images/core/5.5/don-quixote-02.jpg\\\" alt=\\\"\\\"/></figure>\\n<!-- /wp:image -->\\n\\n<!-- wp:paragraph {\\\"style\\\":{\\\"typography\\\":{\\\"fontSize\\\":18}}} -->\\n<p style=\\\"font-size:18px\\\">\" . __( 'They must know, then, that the above-named gentleman whenever he was at leisure (which was mostly all the year round) gave himself up to reading books of chivalry with such ardour and avidity that he almost entirely neglected the pursuit of his field-sports, and even the management of his property; and to such a pitch did his eagerness and infatuation go that he sold many an acre of tillageland to buy books of chivalry to read, and brought home as many of them as he could get.' ) . \"</p>\\n<!-- /wp:paragraph --></div>\\n<!-- /wp:column -->\\n\\n<!-- wp:column -->\\n<div class=\\\"wp-block-column\\\"><!-- wp:image {\\\"sizeSlug\\\":\\\"large\\\"} -->\\n<figure class=\\\"wp-block-image size-large\\\"><img src=\\\"https://s.w.org/images/core/5.5/don-quixote-04.jpg\\\" alt=\\\"\\\"/></figure>\\n<!-- /wp:image -->\\n\\n<!-- wp:paragraph {\\\"style\\\":{\\\"typography\\\":{\\\"fontSize\\\":18}}} -->\\n<p style=\\\"font-size:18px\\\">\" . __( 'But of all there were none he liked so well as those of the famous Feliciano de Silva\\'s composition, for their lucidity of style and complicated conceits were as pearls in his sight, particularly when in his reading he came upon courtships and cartels, where he often found passages like \"the reason of the unreason with which my reason is afflicted so weakens my reason that with reason I murmur at your beauty;\" or again, \"the high heavens render you deserving of the desert your greatness deserves.\"' ) . \"</p>\\n<!-- /wp:paragraph --></div>\\n<!-- /wp:column --></div>\\n<!-- /wp:columns --></div></div>\\n<!-- /wp:group -->\",\n\t'description' => _x( 'Two columns of text, each with an image on top.', 'Block pattern description' ),\n);\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Two columns of Text block pattern.\n *\n * @package WordPress\n */\n\nreturn array(\n\t'title'       => __( 'Two columns of text' ),\n\t'categories'  => array( 'columns' ),\n\t'content'     => \"<!-- wp:group -->\\n<div class=\\\"wp-block-group\\\"><div class=\\\"wp-block-group__inner-container\\\"><!-- wp:heading {\\\"style\\\":{\\\"typography\\\":{\\\"fontSize\\\":38},\\\"color\\\":{\\\"text\\\":\\\"#ba0c49\\\"}}} -->\\n<h2 class=\\\"has-text-color\\\" style=\\\"font-size:38px;color:#ba0c49\\\">\" . __( 'Which treats of the character and pursuits of the famous gentleman Don Quixote of La Mancha' ) . \"</h2>\\n<!-- /wp:heading -->\\n\\n<!-- wp:columns -->\\n<div class=\\\"wp-block-columns\\\"><!-- wp:column -->\\n<div class=\\\"wp-block-column\\\"><!-- wp:paragraph {\\\"style\\\":{\\\"typography\\\":{\\\"fontSize\\\":18}}} -->\\n<p style=\\\"font-size:18px\\\">\" . __( 'In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing. An olla of rather more beef than mutton, a salad on most nights, scraps on Saturdays, lentils on Fridays, and a pigeon or so extra on Sundays, made away with three-quarters of his income.' ) . \"</p>\\n<!-- /wp:paragraph --></div>\\n<!-- /wp:column -->\\n\\n<!-- wp:column -->\\n<div class=\\\"wp-block-column\\\"><!-- wp:paragraph {\\\"style\\\":{\\\"typography\\\":{\\\"fontSize\\\":18}}} -->\\n<p style=\\\"font-size:18px\\\">\" . __( 'The rest of it went in a doublet of fine cloth and velvet breeches and shoes to match for holidays, while on week-days he made a brave figure in his best homespun. He had in his house a housekeeper past forty, a niece under twenty, and a lad for the field and market-place, who used to saddle the hack as well as handle the bill-hook. The age of this gentleman of ours was bordering on fifty; he was of a hardy habit, spare, gaunt-featured, a very early riser and a great sportsman.' ) . \"</p>\\n<!-- /wp:paragraph --></div>\\n<!-- /wp:column --></div>\\n<!-- /wp:columns --></div></div>\\n<!-- /wp:group -->\",\n\t'description' => _x( 'Two columns of text preceded by a long heading.', 'Block pattern description' ),\n);\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Three Buttons block pattern.\n *\n * @package WordPress\n */\n\nreturn array(\n\t'title'         => __( 'Three buttons' ),\n\t'content'       => \"<!-- wp:buttons {\\\"align\\\":\\\"center\\\"} -->\\n<div class=\\\"wp-block-buttons aligncenter\\\"><!-- wp:button {\\\"borderRadius\\\":50,\\\"style\\\":{\\\"color\\\":{\\\"gradient\\\":\\\"linear-gradient(135deg,rgb(135,9,53) 0%,rgb(179,22,22) 100%)\\\",\\\"text\\\":\\\"#fffffa\\\"}}} -->\\n<div class=\\\"wp-block-button\\\"><a class=\\\"wp-block-button__link has-text-color has-background\\\" style=\\\"border-radius:50px;background:linear-gradient(135deg,rgb(135,9,53) 0%,rgb(179,22,22) 100%);color:#fffffa\\\">\" . __( 'About Cervantes' ) . \"</a></div>\\n<!-- /wp:button -->\\n\\n<!-- wp:button {\\\"borderRadius\\\":50,\\\"style\\\":{\\\"color\\\":{\\\"gradient\\\":\\\"linear-gradient(317deg,rgb(135,9,53) 0%,rgb(179,22,22) 100%)\\\",\\\"text\\\":\\\"#fffffa\\\"}}} -->\\n<div class=\\\"wp-block-button\\\"><a class=\\\"wp-block-button__link has-text-color has-background\\\" style=\\\"border-radius:50px;background:linear-gradient(317deg,rgb(135,9,53) 0%,rgb(179,22,22) 100%);color:#fffffa\\\">\" . __( 'Contact us' ) . \"</a></div>\\n<!-- /wp:button -->\\n\\n<!-- wp:button {\\\"borderRadius\\\":50,\\\"style\\\":{\\\"color\\\":{\\\"gradient\\\":\\\"linear-gradient(42deg,rgb(135,9,53) 0%,rgb(179,22,22) 100%)\\\",\\\"text\\\":\\\"#fffffa\\\"}}} -->\\n<div class=\\\"wp-block-button\\\"><a class=\\\"wp-block-button__link has-text-color has-background\\\" style=\\\"border-radius:50px;background:linear-gradient(42deg,rgb(135,9,53) 0%,rgb(179,22,22) 100%);color:#fffffa\\\">\" . __( 'Books' ) . \"</a></div>\\n<!-- /wp:button --></div>\\n<!-- /wp:buttons -->\",\n\t'viewportWidth' => 600,\n\t'categories'    => array( 'buttons' ),\n\t'description'   => _x( 'Three filled buttons with rounded corners, side by side.', 'Block pattern description' ),\n);\n", "num_lines": 15}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Two Buttons block pattern.\n *\n * @package WordPress\n */\n\nreturn array(\n\t'title'         => __( 'Two buttons' ),\n\t'content'       => \"<!-- wp:buttons {\\\"align\\\":\\\"center\\\"} -->\\n<div class=\\\"wp-block-buttons aligncenter\\\"><!-- wp:button {\\\"borderRadius\\\":2,\\\"style\\\":{\\\"color\\\":{\\\"background\\\":\\\"#ba0c49\\\",\\\"text\\\":\\\"#fffffa\\\"}}} -->\\n<div class=\\\"wp-block-button\\\"><a class=\\\"wp-block-button__link has-text-color has-background\\\" style=\\\"border-radius:2px;background-color:#ba0c49;color:#fffffa\\\">\" . __( 'Download now' ) . \"</a></div>\\n<!-- /wp:button -->\\n\\n<!-- wp:button {\\\"borderRadius\\\":2,\\\"style\\\":{\\\"color\\\":{\\\"text\\\":\\\"#ba0c49\\\"}},\\\"className\\\":\\\"is-style-outline\\\"} -->\\n<div class=\\\"wp-block-button is-style-outline\\\"><a class=\\\"wp-block-button__link has-text-color\\\" style=\\\"border-radius:2px;color:#ba0c49\\\">\" . __( 'About Cervantes' ) . \"</a></div>\\n<!-- /wp:button --></div>\\n<!-- /wp:buttons -->\",\n\t'viewportWidth' => 500,\n\t'categories'    => array( 'buttons' ),\n\t'description'   => _x( 'Two buttons, one filled and one outlined, side by side.', 'Block pattern description' ),\n);\n", "num_lines": 15}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Two images side by side block pattern.\n *\n * @package WordPress\n */\n\nreturn array(\n\t'title'       => __( 'Two images side by side' ),\n\t'categories'  => array( 'gallery' ),\n\t'description' => _x( 'An image gallery with two example images.', 'Block pattern description' ),\n\t'content'     => \"<!-- wp:gallery {\\\"ids\\\":[null,null],\\\"align\\\":\\\"wide\\\"} -->\\n<figure class=\\\"wp-block-gallery alignwide columns-2 is-cropped\\\"><ul class=\\\"blocks-gallery-grid\\\"><li class=\\\"blocks-gallery-item\\\"><figure><img src=\\\"https://s.w.org/images/core/5.5/don-quixote-05.jpg\\\" alt=\\\"\" . __( 'An old pencil drawing of Don Quixote and Sancho Panza sitting on their horses, by Wilhelm Marstrand.' ) . '\"/></figure></li><li class=\"blocks-gallery-item\"><figure><img src=\"https://s.w.org/images/core/5.5/don-quixote-01.jpg\" alt=\"' . __( 'An old pencil drawing of Don Quixote and Sancho Panza sitting on their horses, by Wilhelm Marstrand.' ) . \"\\\"/></figure></li></ul></figure>\\n<!-- /wp:gallery -->\",\n);\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Server-side rendering of the `core/archives` block.\n *\n * @package WordPress\n */\n\n/**\n * Renders the `core/archives` block on server.\n *\n * @see WP_Widget_Archives\n *\n * @param array $attributes The block attributes.\n *\n * @return string Returns the post content with archives added.\n */\nfunction render_block_core_archives( $attributes ) {\n\t$show_post_count = ! empty( $attributes['showPostCounts'] );\n\n\t$class = 'wp-block-archives';\n\n\tif ( isset( $attributes['align'] ) ) {\n\t\t$class .= \" align{$attributes['align']}\";\n\t}\n\n\tif ( isset( $attributes['className'] ) ) {\n\t\t$class .= \" {$attributes['className']}\";\n\t}\n\n\tif ( ! empty( $attributes['displayAsDropdown'] ) ) {\n\n\t\t$class .= ' wp-block-archives-dropdown';\n\n\t\t$dropdown_id = esc_attr( uniqid( 'wp-block-archives-' ) );\n\t\t$title       = __( 'Archives' );\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-widget-archives.php */\n\t\t$dropdown_args = apply_filters(\n\t\t\t'widget_archives_dropdown_args',\n\t\t\tarray(\n\t\t\t\t'type'            => 'monthly',\n\t\t\t\t'format'          => 'option',\n\t\t\t\t'show_post_count' => $show_post_count,\n\t\t\t)\n\t\t);\n\n\t\t$dropdown_args['echo'] = 0;\n\n\t\t$archives = wp_get_archives( $dropdown_args );\n\n\t\tswitch ( $dropdown_args['type'] ) {\n\t\t\tcase 'yearly':\n\t\t\t\t$label = __( 'Select Year' );\n\t\t\t\tbreak;\n\t\t\tcase 'monthly':\n\t\t\t\t$label = __( 'Select Month' );\n\t\t\t\tbreak;\n\t\t\tcase 'daily':\n\t\t\t\t$label = __( 'Select Day' );\n\t\t\t\tbreak;\n\t\t\tcase 'weekly':\n\t\t\t\t$label = __( 'Select Week' );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$label = __( 'Select Post' );\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$label = esc_attr( $label );\n\n\t\t$block_content = '<label class=\"screen-reader-text\" for=\"' . $dropdown_id . '\">' . $title . '</label>\n\t<select id=\"' . $dropdown_id . '\" name=\"archive-dropdown\" onchange=\"document.location.href=this.options[this.selectedIndex].value;\">\n\t<option value=\"\">' . $label . '</option>' . $archives . '</select>';\n\n\t\treturn sprintf(\n\t\t\t'<div class=\"%1$s\">%2$s</div>',\n\t\t\tesc_attr( $class ),\n\t\t\t$block_content\n\t\t);\n\t}\n\n\t$class .= ' wp-block-archives-list';\n\n\t/** This filter is documented in wp-includes/widgets/class-wp-widget-archives.php */\n\t$archives_args = apply_filters(\n\t\t'widget_archives_args',\n\t\tarray(\n\t\t\t'type'            => 'monthly',\n\t\t\t'show_post_count' => $show_post_count,\n\t\t)\n\t);\n\n\t$archives_args['echo'] = 0;\n\n\t$archives = wp_get_archives( $archives_args );\n\n\t$classnames = esc_attr( $class );\n\n\tif ( empty( $archives ) ) {\n\n\t\treturn sprintf(\n\t\t\t'<div class=\"%1$s\">%2$s</div>',\n\t\t\t$classnames,\n\t\t\t__( 'No archives to show.' )\n\t\t);\n\t}\n\n\treturn sprintf(\n\t\t'<ul class=\"%1$s\">%2$s</ul>',\n\t\t$classnames,\n\t\t$archives\n\t);\n}\n\n/**\n * Register archives block.\n */\nfunction register_block_core_archives() {\n\tregister_block_type_from_metadata(\n\t\t__DIR__ . '/archives',\n\t\tarray(\n\t\t\t'render_callback' => 'render_block_core_archives',\n\t\t)\n\t);\n}\nadd_action( 'init', 'register_block_core_archives' );\n", "num_lines": 127}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Server-side rendering of the `core/block` block.\n *\n * @package WordPress\n */\n\n/**\n * Renders the `core/block` block on server.\n *\n * @param array $attributes The block attributes.\n *\n * @return string Rendered HTML of the referenced block.\n */\nfunction render_block_core_block( $attributes ) {\n\tif ( empty( $attributes['ref'] ) ) {\n\t\treturn '';\n\t}\n\n\t$reusable_block = get_post( $attributes['ref'] );\n\tif ( ! $reusable_block || 'wp_block' !== $reusable_block->post_type ) {\n\t\treturn '';\n\t}\n\n\tif ( 'publish' !== $reusable_block->post_status || ! empty( $reusable_block->post_password ) ) {\n\t\treturn '';\n\t}\n\n\treturn do_blocks( $reusable_block->post_content );\n}\n\n/**\n * Registers the `core/block` block.\n */\nfunction register_block_core_block() {\n\tregister_block_type_from_metadata(\n\t\t__DIR__ . '/block',\n\t\tarray(\n\t\t\t'render_callback' => 'render_block_core_block',\n\t\t)\n\t);\n}\nadd_action( 'init', 'register_block_core_block' );\n", "num_lines": 44}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Server-side rendering of the `core/calendar` block.\n *\n * @package WordPress\n */\n\n/**\n * Renders the `core/calendar` block on server.\n *\n * @param array $attributes The block attributes.\n *\n * @return string Returns the block content.\n */\nfunction render_block_core_calendar( $attributes ) {\n\tglobal $monthnum, $year;\n\n\t$previous_monthnum = $monthnum;\n\t$previous_year     = $year;\n\n\tif ( isset( $attributes['month'] ) && isset( $attributes['year'] ) ) {\n\t\t$permalink_structure = get_option( 'permalink_structure' );\n\t\tif (\n\t\t\tstrpos( $permalink_structure, '%monthnum%' ) !== false &&\n\t\t\tstrpos( $permalink_structure, '%year%' ) !== false\n\t\t) {\n\t\t\t// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited\n\t\t\t$monthnum = $attributes['month'];\n\t\t\t// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited\n\t\t\t$year = $attributes['year'];\n\t\t}\n\t}\n\n\t$custom_class_name = empty( $attributes['className'] ) ? '' : ' ' . $attributes['className'];\n\t$align_class_name  = empty( $attributes['align'] ) ? '' : ' ' . \"align{$attributes['align']}\";\n\n\t$output = sprintf(\n\t\t'<div class=\"%1$s\">%2$s</div>',\n\t\tesc_attr( 'wp-block-calendar' . $custom_class_name . $align_class_name ),\n\t\tget_calendar( true, false )\n\t);\n\n\t// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited\n\t$monthnum = $previous_monthnum;\n\t// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited\n\t$year = $previous_year;\n\n\treturn $output;\n}\n\n/**\n * Registers the `core/calendar` block on server.\n */\nfunction register_block_core_calendar() {\n\tregister_block_type_from_metadata(\n\t\t__DIR__ . '/calendar',\n\t\tarray(\n\t\t\t'render_callback' => 'render_block_core_calendar',\n\t\t)\n\t);\n}\n\nadd_action( 'init', 'register_block_core_calendar' );\n", "num_lines": 64}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Server-side rendering of the `core/categories` block.\n *\n * @package WordPress\n */\n\n/**\n * Renders the `core/categories` block on server.\n *\n * @param array $attributes The block attributes.\n *\n * @return string Returns the categories list/dropdown markup.\n */\nfunction render_block_core_categories( $attributes ) {\n\tstatic $block_id = 0;\n\t$block_id++;\n\n\t$args = array(\n\t\t'echo'         => false,\n\t\t'hierarchical' => ! empty( $attributes['showHierarchy'] ),\n\t\t'orderby'      => 'name',\n\t\t'show_count'   => ! empty( $attributes['showPostCounts'] ),\n\t\t'title_li'     => '',\n\t);\n\n\tif ( ! empty( $attributes['displayAsDropdown'] ) ) {\n\t\t$id                       = 'wp-block-categories-' . $block_id;\n\t\t$args['id']               = $id;\n\t\t$args['show_option_none'] = __( 'Select Category' );\n\t\t$wrapper_markup           = '<div class=\"%1$s\">%2$s</div>';\n\t\t$items_markup             = wp_dropdown_categories( $args );\n\t\t$type                     = 'dropdown';\n\n\t\tif ( ! is_admin() ) {\n\t\t\t$wrapper_markup .= build_dropdown_script_block_core_categories( $id );\n\t\t}\n\t} else {\n\t\t$wrapper_markup = '<ul class=\"%1$s\">%2$s</ul>';\n\t\t$items_markup   = wp_list_categories( $args );\n\t\t$type           = 'list';\n\t}\n\n\t$class = \"wp-block-categories wp-block-categories-{$type}\";\n\n\tif ( isset( $attributes['align'] ) ) {\n\t\t$class .= \" align{$attributes['align']}\";\n\t}\n\n\tif ( isset( $attributes['className'] ) ) {\n\t\t$class .= \" {$attributes['className']}\";\n\t}\n\n\treturn sprintf(\n\t\t$wrapper_markup,\n\t\tesc_attr( $class ),\n\t\t$items_markup\n\t);\n}\n\n/**\n * Generates the inline script for a categories dropdown field.\n *\n * @param string $dropdown_id ID of the dropdown field.\n *\n * @return string Returns the dropdown onChange redirection script.\n */\nfunction build_dropdown_script_block_core_categories( $dropdown_id ) {\n\tob_start();\n\t?>\n\t<script type='text/javascript'>\n\t/* <![CDATA[ */\n\t( function() {\n\t\tvar dropdown = document.getElementById( '<?php echo esc_js( $dropdown_id ); ?>' );\n\t\tfunction onCatChange() {\n\t\t\tif ( dropdown.options[ dropdown.selectedIndex ].value > 0 ) {\n\t\t\t\tlocation.href = \"<?php echo home_url(); ?>/?cat=\" + dropdown.options[ dropdown.selectedIndex ].value;\n\t\t\t}\n\t\t}\n\t\tdropdown.onchange = onCatChange;\n\t})();\n\t/* ]]> */\n\t</script>\n\t<?php\n\treturn ob_get_clean();\n}\n\n/**\n * Registers the `core/categories` block on server.\n */\nfunction register_block_core_categories() {\n\tregister_block_type_from_metadata(\n\t\t__DIR__ . '/categories',\n\t\tarray(\n\t\t\t'render_callback' => 'render_block_core_categories',\n\t\t)\n\t);\n}\nadd_action( 'init', 'register_block_core_categories' );\n", "num_lines": 100}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Used to set up all core blocks used with the block editor.\n *\n * @package WordPress\n */\n\n// Include files required for core blocks registration.\nrequire ABSPATH . WPINC . '/blocks/archives.php';\nrequire ABSPATH . WPINC . '/blocks/block.php';\nrequire ABSPATH . WPINC . '/blocks/calendar.php';\nrequire ABSPATH . WPINC . '/blocks/categories.php';\nrequire ABSPATH . WPINC . '/blocks/latest-comments.php';\nrequire ABSPATH . WPINC . '/blocks/latest-posts.php';\nrequire ABSPATH . WPINC . '/blocks/rss.php';\nrequire ABSPATH . WPINC . '/blocks/search.php';\nrequire ABSPATH . WPINC . '/blocks/shortcode.php';\nrequire ABSPATH . WPINC . '/blocks/social-link.php';\nrequire ABSPATH . WPINC . '/blocks/tag-cloud.php';\n\n/**\n * Registers core block types using metadata files.\n * Dynamic core blocks are registered separately.\n *\n * @since 5.5.0\n */\nfunction register_core_block_types_from_metadata() {\n\t$block_folders = array(\n\t\t'audio',\n\t\t'button',\n\t\t'buttons',\n\t\t'classic',\n\t\t'code',\n\t\t'column',\n\t\t'columns',\n\t\t'file',\n\t\t'gallery',\n\t\t'group',\n\t\t'heading',\n\t\t'html',\n\t\t'image',\n\t\t'list',\n\t\t'media-text',\n\t\t'missing',\n\t\t'more',\n\t\t'nextpage',\n\t\t'paragraph',\n\t\t'preformatted',\n\t\t'pullquote',\n\t\t'quote',\n\t\t'separator',\n\t\t'social-links',\n\t\t'spacer',\n\t\t'subhead',\n\t\t'table',\n\t\t'text-columns',\n\t\t'verse',\n\t\t'video',\n\t);\n\n\tforeach ( $block_folders as $block_folder ) {\n\t\tregister_block_type_from_metadata(\n\t\t\tABSPATH . WPINC . '/blocks/' . $block_folder\n\t\t);\n\t}\n}\nadd_action( 'init', 'register_core_block_types_from_metadata' );\n", "num_lines": 68}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Server-side rendering of the `core/latest-comments` block.\n *\n * @package WordPress\n */\n\n/**\n * Get the post title.\n *\n * The post title is fetched and if it is blank then a default string is\n * returned.\n *\n * Copied from `wp-admin/includes/template.php`, but we can't include that\n * file because:\n *\n * 1. It causes bugs with test fixture generation and strange Docker 255 error\n *    codes.\n * 2. It's in the admin; ideally we *shouldn't* be including files from the\n *    admin for a block's output. It's a very small/simple function as well,\n *    so duplicating it isn't too terrible.\n *\n * @since 3.3.0\n *\n * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.\n * @return string The post title if set; \"(no title)\" if no title is set.\n */\nfunction wp_latest_comments_draft_or_post_title( $post = 0 ) {\n\t$title = get_the_title( $post );\n\tif ( empty( $title ) ) {\n\t\t$title = __( '(no title)' );\n\t}\n\treturn esc_html( $title );\n}\n\n/**\n * Renders the `core/latest-comments` block on server.\n *\n * @param array $attributes The block attributes.\n *\n * @return string Returns the post content with latest comments added.\n */\nfunction render_block_core_latest_comments( $attributes = array() ) {\n\t// This filter is documented in wp-includes/widgets/class-wp-widget-recent-comments.php.\n\t$comments = get_comments(\n\t\tapply_filters(\n\t\t\t'widget_comments_args',\n\t\t\tarray(\n\t\t\t\t'number'      => $attributes['commentsToShow'],\n\t\t\t\t'status'      => 'approve',\n\t\t\t\t'post_status' => 'publish',\n\t\t\t)\n\t\t)\n\t);\n\n\t$list_items_markup = '';\n\tif ( ! empty( $comments ) ) {\n\t\t// Prime the cache for associated posts. This is copied from \\WP_Widget_Recent_Comments::widget().\n\t\t$post_ids = array_unique( wp_list_pluck( $comments, 'comment_post_ID' ) );\n\t\t_prime_post_caches( $post_ids, strpos( get_option( 'permalink_structure' ), '%category%' ), false );\n\n\t\tforeach ( $comments as $comment ) {\n\t\t\t$list_items_markup .= '<li class=\"wp-block-latest-comments__comment\">';\n\t\t\tif ( $attributes['displayAvatar'] ) {\n\t\t\t\t$avatar = get_avatar(\n\t\t\t\t\t$comment,\n\t\t\t\t\t48,\n\t\t\t\t\t'',\n\t\t\t\t\t'',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'class' => 'wp-block-latest-comments__comment-avatar',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tif ( $avatar ) {\n\t\t\t\t\t$list_items_markup .= $avatar;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$list_items_markup .= '<article>';\n\t\t\t$list_items_markup .= '<footer class=\"wp-block-latest-comments__comment-meta\">';\n\t\t\t$author_url         = get_comment_author_url( $comment );\n\t\t\tif ( empty( $author_url ) && ! empty( $comment->user_id ) ) {\n\t\t\t\t$author_url = get_author_posts_url( $comment->user_id );\n\t\t\t}\n\n\t\t\t$author_markup = '';\n\t\t\tif ( $author_url ) {\n\t\t\t\t$author_markup .= '<a class=\"wp-block-latest-comments__comment-author\" href=\"' . esc_url( $author_url ) . '\">' . get_comment_author( $comment ) . '</a>';\n\t\t\t} else {\n\t\t\t\t$author_markup .= '<span class=\"wp-block-latest-comments__comment-author\">' . get_comment_author( $comment ) . '</span>';\n\t\t\t}\n\n\t\t\t// `_draft_or_post_title` calls `esc_html()` so we don't need to wrap that call in\n\t\t\t// `esc_html`.\n\t\t\t$post_title = '<a class=\"wp-block-latest-comments__comment-link\" href=\"' . esc_url( get_comment_link( $comment ) ) . '\">' . wp_latest_comments_draft_or_post_title( $comment->comment_post_ID ) . '</a>';\n\n\t\t\t$list_items_markup .= sprintf(\n\t\t\t\t/* translators: 1: author name (inside <a> or <span> tag, based on if they have a URL), 2: post title related to this comment */\n\t\t\t\t__( '%1$s on %2$s' ),\n\t\t\t\t$author_markup,\n\t\t\t\t$post_title\n\t\t\t);\n\n\t\t\tif ( $attributes['displayDate'] ) {\n\t\t\t\t$list_items_markup .= sprintf(\n\t\t\t\t\t'<time datetime=\"%1$s\" class=\"wp-block-latest-comments__comment-date\">%2$s</time>',\n\t\t\t\t\tesc_attr( get_comment_date( 'c', $comment ) ),\n\t\t\t\t\tdate_i18n( get_option( 'date_format' ), get_comment_date( 'U', $comment ) )\n\t\t\t\t);\n\t\t\t}\n\t\t\t$list_items_markup .= '</footer>';\n\t\t\tif ( $attributes['displayExcerpt'] ) {\n\t\t\t\t$list_items_markup .= '<div class=\"wp-block-latest-comments__comment-excerpt\">' . wpautop( get_comment_excerpt( $comment ) ) . '</div>';\n\t\t\t}\n\t\t\t$list_items_markup .= '</article></li>';\n\t\t}\n\t}\n\n\t$class = 'wp-block-latest-comments';\n\tif ( ! empty( $attributes['className'] ) ) {\n\t\t$class .= ' ' . $attributes['className'];\n\t}\n\tif ( isset( $attributes['align'] ) ) {\n\t\t$class .= \" align{$attributes['align']}\";\n\t}\n\tif ( $attributes['displayAvatar'] ) {\n\t\t$class .= ' has-avatars';\n\t}\n\tif ( $attributes['displayDate'] ) {\n\t\t$class .= ' has-dates';\n\t}\n\tif ( $attributes['displayExcerpt'] ) {\n\t\t$class .= ' has-excerpts';\n\t}\n\tif ( empty( $comments ) ) {\n\t\t$class .= ' no-comments';\n\t}\n\t$classnames = esc_attr( $class );\n\n\treturn ! empty( $comments ) ? sprintf(\n\t\t'<ol class=\"%1$s\">%2$s</ol>',\n\t\t$classnames,\n\t\t$list_items_markup\n\t) : sprintf(\n\t\t'<div class=\"%1$s\">%2$s</div>',\n\t\t$classnames,\n\t\t__( 'No comments to show.' )\n\t);\n}\n\n/**\n * Registers the `core/latest-comments` block.\n */\nfunction register_block_core_latest_comments() {\n\tregister_block_type_from_metadata(\n\t\t__DIR__ . '/latest-comments',\n\t\tarray(\n\t\t\t'render_callback' => 'render_block_core_latest_comments',\n\t\t)\n\t);\n}\n\nadd_action( 'init', 'register_block_core_latest_comments' );\n", "num_lines": 164}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Server-side rendering of the `core/latest-posts` block.\n *\n * @package WordPress\n */\n\n/**\n * The excerpt length set by the Latest Posts core block\n * set at render time and used by the block itself.\n *\n * @var int\n */\n$block_core_latest_posts_excerpt_length = 0;\n\n/**\n * Callback for the excerpt_length filter used by\n * the Latest Posts block at render time.\n *\n * @return int Returns the global $block_core_latest_posts_excerpt_length variable\n *             to allow the excerpt_length filter respect the Latest Block setting.\n */\nfunction block_core_latest_posts_get_excerpt_length() {\n\tglobal $block_core_latest_posts_excerpt_length;\n\treturn $block_core_latest_posts_excerpt_length;\n}\n\n/**\n * Renders the `core/latest-posts` block on server.\n *\n * @param array $attributes The block attributes.\n *\n * @return string Returns the post content with latest posts added.\n */\nfunction render_block_core_latest_posts( $attributes ) {\n\tglobal $post, $block_core_latest_posts_excerpt_length;\n\n\t$args = array(\n\t\t'posts_per_page'   => $attributes['postsToShow'],\n\t\t'post_status'      => 'publish',\n\t\t'order'            => $attributes['order'],\n\t\t'orderby'          => $attributes['orderBy'],\n\t\t'suppress_filters' => false,\n\t);\n\n\t$block_core_latest_posts_excerpt_length = $attributes['excerptLength'];\n\tadd_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 );\n\n\tif ( isset( $attributes['categories'] ) ) {\n\t\t$args['category__in'] = array_column( $attributes['categories'], 'id' );\n\t}\n\tif ( isset( $attributes['selectedAuthor'] ) ) {\n\t\t$args['author'] = $attributes['selectedAuthor'];\n\t}\n\n\t$recent_posts = get_posts( $args );\n\n\t$list_items_markup = '';\n\n\tforeach ( $recent_posts as $post ) {\n\n\t\t$list_items_markup .= '<li>';\n\n\t\tif ( $attributes['displayFeaturedImage'] && has_post_thumbnail( $post ) ) {\n\t\t\t$image_style = '';\n\t\t\tif ( isset( $attributes['featuredImageSizeWidth'] ) ) {\n\t\t\t\t$image_style .= sprintf( 'max-width:%spx;', $attributes['featuredImageSizeWidth'] );\n\t\t\t}\n\t\t\tif ( isset( $attributes['featuredImageSizeHeight'] ) ) {\n\t\t\t\t$image_style .= sprintf( 'max-height:%spx;', $attributes['featuredImageSizeHeight'] );\n\t\t\t}\n\n\t\t\t$image_classes = 'wp-block-latest-posts__featured-image';\n\t\t\tif ( isset( $attributes['featuredImageAlign'] ) ) {\n\t\t\t\t$image_classes .= ' align' . $attributes['featuredImageAlign'];\n\t\t\t}\n\n\t\t\t$list_items_markup .= sprintf(\n\t\t\t\t'<div class=\"%1$s\">%2$s</div>',\n\t\t\t\t$image_classes,\n\t\t\t\tget_the_post_thumbnail(\n\t\t\t\t\t$post,\n\t\t\t\t\t$attributes['featuredImageSizeSlug'],\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'style' => $image_style,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$title = get_the_title( $post );\n\t\tif ( ! $title ) {\n\t\t\t$title = __( '(no title)' );\n\t\t}\n\t\t$list_items_markup .= sprintf(\n\t\t\t'<a href=\"%1$s\">%2$s</a>',\n\t\t\tesc_url( get_permalink( $post ) ),\n\t\t\t$title\n\t\t);\n\n\t\tif ( isset( $attributes['displayAuthor'] ) && $attributes['displayAuthor'] ) {\n\t\t\t$author_display_name = get_the_author_meta( 'display_name', $post->post_author );\n\n\t\t\t/* translators: byline. %s: current author. */\n\t\t\t$byline = sprintf( __( 'by %s' ), $author_display_name );\n\n\t\t\tif ( ! empty( $author_display_name ) ) {\n\t\t\t\t$list_items_markup .= sprintf(\n\t\t\t\t\t'<div class=\"wp-block-latest-posts__post-author\">%1$s</div>',\n\t\t\t\t\tesc_html( $byline )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $attributes['displayPostDate'] ) && $attributes['displayPostDate'] ) {\n\t\t\t$list_items_markup .= sprintf(\n\t\t\t\t'<time datetime=\"%1$s\" class=\"wp-block-latest-posts__post-date\">%2$s</time>',\n\t\t\t\tesc_attr( get_the_date( 'c', $post ) ),\n\t\t\t\tesc_html( get_the_date( '', $post ) )\n\t\t\t);\n\t\t}\n\n\t\tif ( isset( $attributes['displayPostContent'] ) && $attributes['displayPostContent']\n\t\t\t&& isset( $attributes['displayPostContentRadio'] ) && 'excerpt' === $attributes['displayPostContentRadio'] ) {\n\n\t\t\t$trimmed_excerpt = get_the_excerpt( $post );\n\n\t\t\t$list_items_markup .= sprintf(\n\t\t\t\t'<div class=\"wp-block-latest-posts__post-excerpt\">%1$s</div>',\n\t\t\t\t$trimmed_excerpt\n\t\t\t);\n\t\t}\n\n\t\tif ( isset( $attributes['displayPostContent'] ) && $attributes['displayPostContent']\n\t\t\t&& isset( $attributes['displayPostContentRadio'] ) && 'full_post' === $attributes['displayPostContentRadio'] ) {\n\t\t\t$list_items_markup .= sprintf(\n\t\t\t\t'<div class=\"wp-block-latest-posts__post-full-content\">%1$s</div>',\n\t\t\t\twp_kses_post( html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset' ) ) )\n\t\t\t);\n\t\t}\n\n\t\t$list_items_markup .= \"</li>\\n\";\n\t}\n\n\tremove_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 );\n\n\t$class = 'wp-block-latest-posts wp-block-latest-posts__list';\n\tif ( isset( $attributes['align'] ) ) {\n\t\t$class .= ' align' . $attributes['align'];\n\t}\n\n\tif ( isset( $attributes['postLayout'] ) && 'grid' === $attributes['postLayout'] ) {\n\t\t$class .= ' is-grid';\n\t}\n\n\tif ( isset( $attributes['columns'] ) && 'grid' === $attributes['postLayout'] ) {\n\t\t$class .= ' columns-' . $attributes['columns'];\n\t}\n\n\tif ( isset( $attributes['displayPostDate'] ) && $attributes['displayPostDate'] ) {\n\t\t$class .= ' has-dates';\n\t}\n\n\tif ( isset( $attributes['displayAuthor'] ) && $attributes['displayAuthor'] ) {\n\t\t$class .= ' has-author';\n\t}\n\n\tif ( isset( $attributes['className'] ) ) {\n\t\t$class .= ' ' . $attributes['className'];\n\t}\n\n\treturn sprintf(\n\t\t'<ul class=\"%1$s\">%2$s</ul>',\n\t\tesc_attr( $class ),\n\t\t$list_items_markup\n\t);\n}\n\n/**\n * Registers the `core/latest-posts` block on server.\n */\nfunction register_block_core_latest_posts() {\n\tregister_block_type_from_metadata(\n\t\t__DIR__ . '/latest-posts',\n\t\tarray(\n\t\t\t'render_callback' => 'render_block_core_latest_posts',\n\t\t)\n\t);\n}\nadd_action( 'init', 'register_block_core_latest_posts' );\n\n/**\n * Handles outdated versions of the `core/latest-posts` block by converting\n * attribute `categories` from a numeric string to an array with key `id`.\n *\n * This is done to accommodate the changes introduced in #20781 that sought to\n * add support for multiple categories to the block. However, given that this\n * block is dynamic, the usual provisions for block migration are insufficient,\n * as they only act when a block is loaded in the editor.\n *\n * TODO: Remove when and if the bottom client-side deprecation for this block\n * is removed.\n *\n * @param array $block A single parsed block object.\n *\n * @return array The migrated block object.\n */\nfunction block_core_latest_posts_migrate_categories( $block ) {\n\tif (\n\t\t'core/latest-posts' === $block['blockName'] &&\n\t\t! empty( $block['attrs']['categories'] ) &&\n\t\tis_string( $block['attrs']['categories'] )\n\t) {\n\t\t$block['attrs']['categories'] = array(\n\t\t\tarray( 'id' => absint( $block['attrs']['categories'] ) ),\n\t\t);\n\t}\n\n\treturn $block;\n}\nadd_filter( 'render_block_data', 'block_core_latest_posts_migrate_categories' );\n", "num_lines": 222}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Server-side rendering of the `core/rss` block.\n *\n * @package WordPress\n */\n\n/**\n * Renders the `core/rss` block on server.\n *\n * @param array $attributes The block attributes.\n *\n * @return string Returns the block content with received rss items.\n */\nfunction render_block_core_rss( $attributes ) {\n\t$rss = fetch_feed( $attributes['feedURL'] );\n\n\tif ( is_wp_error( $rss ) ) {\n\t\treturn '<div class=\"components-placeholder\"><div class=\"notice notice-error\"><strong>' . __( 'RSS Error:' ) . '</strong> ' . $rss->get_error_message() . '</div></div>';\n\t}\n\n\tif ( ! $rss->get_item_quantity() ) {\n\t\treturn '<div class=\"components-placeholder\"><div class=\"notice notice-error\">' . __( 'An error has occurred, which probably means the feed is down. Try again later.' ) . '</div></div>';\n\t}\n\n\t$rss_items  = $rss->get_items( 0, $attributes['itemsToShow'] );\n\t$list_items = '';\n\tforeach ( $rss_items as $item ) {\n\t\t$title = esc_html( trim( strip_tags( $item->get_title() ) ) );\n\t\tif ( empty( $title ) ) {\n\t\t\t$title = __( '(no title)' );\n\t\t}\n\t\t$link = $item->get_link();\n\t\t$link = esc_url( $link );\n\t\tif ( $link ) {\n\t\t\t$title = \"<a href='{$link}'>{$title}</a>\";\n\t\t}\n\t\t$title = \"<div class='wp-block-rss__item-title'>{$title}</div>\";\n\n\t\t$date = '';\n\t\tif ( $attributes['displayDate'] ) {\n\t\t\t$date = $item->get_date( 'U' );\n\n\t\t\tif ( $date ) {\n\t\t\t\t$date = sprintf(\n\t\t\t\t\t'<time datetime=\"%1$s\" class=\"wp-block-rss__item-publish-date\">%2$s</time> ',\n\t\t\t\t\tdate_i18n( get_option( 'c' ), $date ),\n\t\t\t\t\tdate_i18n( get_option( 'date_format' ), $date )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$author = '';\n\t\tif ( $attributes['displayAuthor'] ) {\n\t\t\t$author = $item->get_author();\n\t\t\tif ( is_object( $author ) ) {\n\t\t\t\t$author = $author->get_name();\n\t\t\t\t$author = '<span class=\"wp-block-rss__item-author\">' . sprintf(\n\t\t\t\t\t/* translators: %s: the author. */\n\t\t\t\t\t__( 'by %s' ),\n\t\t\t\t\tesc_html( strip_tags( $author ) )\n\t\t\t\t) . '</span>';\n\t\t\t}\n\t\t}\n\n\t\t$excerpt = '';\n\t\tif ( $attributes['displayExcerpt'] ) {\n\t\t\t$excerpt = html_entity_decode( $item->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) );\n\t\t\t$excerpt = esc_attr( wp_trim_words( $excerpt, $attributes['excerptLength'], ' [&hellip;]' ) );\n\n\t\t\t// Change existing [...] to [&hellip;].\n\t\t\tif ( '[...]' === substr( $excerpt, -5 ) ) {\n\t\t\t\t$excerpt = substr( $excerpt, 0, -5 ) . '[&hellip;]';\n\t\t\t}\n\n\t\t\t$excerpt = '<div class=\"wp-block-rss__item-excerpt\">' . esc_html( $excerpt ) . '</div>';\n\t\t}\n\n\t\t$list_items .= \"<li class='wp-block-rss__item'>{$title}{$date}{$author}{$excerpt}</li>\";\n\t}\n\n\t$class = 'wp-block-rss';\n\tif ( isset( $attributes['align'] ) ) {\n\t\t$class .= ' align' . $attributes['align'];\n\t}\n\n\tif ( isset( $attributes['blockLayout'] ) && 'grid' === $attributes['blockLayout'] ) {\n\t\t$class .= ' is-grid';\n\t}\n\n\tif ( isset( $attributes['columns'] ) && 'grid' === $attributes['blockLayout'] ) {\n\t\t$class .= ' columns-' . $attributes['columns'];\n\t}\n\n\tif ( isset( $attributes['className'] ) ) {\n\t\t$class .= ' ' . $attributes['className'];\n\t}\n\n\treturn sprintf( '<ul class=\"%s\">%s</ul>', esc_attr( $class ), $list_items );\n}\n\n/**\n * Registers the `core/rss` block on server.\n */\nfunction register_block_core_rss() {\n\tregister_block_type_from_metadata(\n\t\t__DIR__ . '/rss',\n\t\tarray(\n\t\t\t'render_callback' => 'render_block_core_rss',\n\t\t)\n\t);\n}\nadd_action( 'init', 'register_block_core_rss' );\n", "num_lines": 114}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Server-side rendering of the `core/search` block.\n *\n * @package WordPress\n */\n\n/**\n * Dynamically renders the `core/search` block.\n *\n * @param array $attributes The block attributes.\n *\n * @return string The search block markup.\n */\nfunction render_block_core_search( $attributes ) {\n\tstatic $instance_id = 0;\n\n\t// Older versions of the Search block defaulted the label and buttonText\n\t// attributes to `__( 'Search' )` meaning that many posts contain `<!--\n\t// wp:search /-->`. Support these by defaulting an undefined label and\n\t// buttonText to `__( 'Search' )`.\n\t$attributes = wp_parse_args(\n\t\t$attributes,\n\t\tarray(\n\t\t\t'label'      => __( 'Search' ),\n\t\t\t'buttonText' => __( 'Search' ),\n\t\t)\n\t);\n\n\t$input_id      = 'wp-block-search__input-' . ++$instance_id;\n\t$label_markup  = '';\n\t$button_markup = '';\n\n\tif ( ! empty( $attributes['label'] ) ) {\n\t\t$label_markup = sprintf(\n\t\t\t'<label for=\"%s\" class=\"wp-block-search__label\">%s</label>',\n\t\t\t$input_id,\n\t\t\t$attributes['label']\n\t\t);\n\t} else {\n\t\t$label_markup = sprintf(\n\t\t\t'<label for=\"%s\" class=\"wp-block-search__label screen-reader-text\">%s</label>',\n\t\t\t$input_id,\n\t\t\t__( 'Search' )\n\t\t);\n\t}\n\n\t$input_markup = sprintf(\n\t\t'<input type=\"search\" id=\"%s\" class=\"wp-block-search__input\" name=\"s\" value=\"%s\" placeholder=\"%s\" required />',\n\t\t$input_id,\n\t\tesc_attr( get_search_query() ),\n\t\tesc_attr( $attributes['placeholder'] )\n\t);\n\n\tif ( ! empty( $attributes['buttonText'] ) ) {\n\t\t$button_markup = sprintf(\n\t\t\t'<button type=\"submit\" class=\"wp-block-search__button\">%s</button>',\n\t\t\t$attributes['buttonText']\n\t\t);\n\t}\n\n\t$class = 'wp-block-search';\n\tif ( isset( $attributes['className'] ) ) {\n\t\t$class .= ' ' . $attributes['className'];\n\t}\n\tif ( isset( $attributes['align'] ) ) {\n\t\t$class .= ' align' . $attributes['align'];\n\t}\n\n\treturn sprintf(\n\t\t'<form class=\"%s\" role=\"search\" method=\"get\" action=\"%s\">%s</form>',\n\t\tesc_attr( $class ),\n\t\tesc_url( home_url( '/' ) ),\n\t\t$label_markup . $input_markup . $button_markup\n\t);\n}\n\n/**\n * Registers the `core/search` block on the server.\n */\nfunction register_block_core_search() {\n\tregister_block_type_from_metadata(\n\t\t__DIR__ . '/search',\n\t\tarray(\n\t\t\t'render_callback' => 'render_block_core_search',\n\t\t)\n\t);\n}\nadd_action( 'init', 'register_block_core_search' );\n", "num_lines": 90}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Server-side rendering of the `core/shortcode` block.\n *\n * @package WordPress\n */\n\n/**\n * Performs wpautop() on the shortcode block content.\n *\n * @param array  $attributes The block attributes.\n * @param string $content    The block content.\n *\n * @return string Returns the block content.\n */\nfunction render_block_core_shortcode( $attributes, $content ) {\n\treturn wpautop( $content );\n}\n\n/**\n * Registers the `core/shortcode` block on server.\n */\nfunction register_block_core_shortcode() {\n\tregister_block_type_from_metadata(\n\t\t__DIR__ . '/shortcode',\n\t\tarray(\n\t\t\t'render_callback' => 'render_block_core_shortcode',\n\t\t)\n\t);\n}\nadd_action( 'init', 'register_block_core_shortcode' );\n", "num_lines": 32}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Server-side rendering of the `core/social-link` blocks.\n *\n * @package WordPress\n */\n\n/**\n * Renders the `core/social-link` block on server.\n *\n * @param array $attributes The block attributes.\n *\n * @return string Rendered HTML of the referenced block.\n */\nfunction render_block_core_social_link( $attributes ) {\n\t$service    = ( isset( $attributes['service'] ) ) ? $attributes['service'] : 'Icon';\n\t$url        = ( isset( $attributes['url'] ) ) ? $attributes['url'] : false;\n\t$label      = ( isset( $attributes['label'] ) ) ? $attributes['label'] : block_core_social_link_get_name( $service );\n\t$class_name = isset( $attributes['className'] ) ? ' ' . $attributes['className'] : false;\n\n\t// Don't render a link if there is no URL set.\n\tif ( ! $url ) {\n\t\treturn '';\n\t}\n\n\t$icon = block_core_social_link_get_icon( $service );\n\treturn '<li class=\"wp-social-link wp-social-link-' . esc_attr( $service ) . esc_attr( $class_name ) . '\"><a href=\"' . esc_url( $url ) . '\" aria-label=\"' . esc_attr( $label ) . '\"> ' . $icon . '</a></li>';\n}\n\n/**\n * Registers the `core/social-link` blocks.\n */\nfunction register_block_core_social_link() {\n\tregister_block_type_from_metadata(\n\t\t__DIR__ . '/social-link',\n\t\tarray(\n\t\t\t'render_callback' => 'render_block_core_social_link',\n\t\t)\n\t);\n}\nadd_action( 'init', 'register_block_core_social_link' );\n\n\n/**\n * Returns the SVG for social link.\n *\n * @param string $service The service icon.\n *\n * @return string SVG Element for service icon.\n */\nfunction block_core_social_link_get_icon( $service ) {\n\t$services = block_core_social_link_services();\n\tif ( isset( $services[ $service ] ) && isset( $services[ $service ]['icon'] ) ) {\n\t\treturn $services[ $service ]['icon'];\n\t}\n\n\treturn $services['share']['icon'];\n}\n\n/**\n * Returns the brand name for social link.\n *\n * @param string $service The service icon.\n *\n * @return string Brand label.\n */\nfunction block_core_social_link_get_name( $service ) {\n\t$services = block_core_social_link_services();\n\tif ( isset( $services[ $service ] ) && isset( $services[ $service ]['name'] ) ) {\n\t\treturn $services[ $service ]['name'];\n\t}\n\n\treturn $services['share']['name'];\n}\n\n/**\n * Returns the SVG for social link.\n *\n * @param string $service The service slug to extract data from.\n * @param string $field The field ('name', 'icon', etc) to extract for a service.\n *\n * @return array|string\n */\nfunction block_core_social_link_services( $service = '', $field = '' ) {\n\t$services_data = array(\n\t\t'fivehundredpx' => array(\n\t\t\t'name' => '500px',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z\"></path></svg>',\n\t\t),\n\t\t'amazon'        => array(\n\t\t\t'name' => 'Amazon',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z\"></path></svg>',\n\t\t),\n\t\t'bandcamp'      => array(\n\t\t\t'name' => 'Bandcamp',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289\"></path></svg>',\n\t\t),\n\t\t'behance'       => array(\n\t\t\t'name' => 'Behance',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z\"></path></svg>',\n\t\t),\n\t\t'chain'         => array(\n\t\t\t'name' => 'Link',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M19.647,16.706a1.134,1.134,0,0,0-.343-.833l-2.549-2.549a1.134,1.134,0,0,0-.833-.343,1.168,1.168,0,0,0-.883.392l.233.226q.2.189.264.264a2.922,2.922,0,0,1,.184.233.986.986,0,0,1,.159.312,1.242,1.242,0,0,1,.043.337,1.172,1.172,0,0,1-1.176,1.176,1.237,1.237,0,0,1-.337-.043,1,1,0,0,1-.312-.159,2.76,2.76,0,0,1-.233-.184q-.073-.068-.264-.264l-.226-.233a1.19,1.19,0,0,0-.4.895,1.134,1.134,0,0,0,.343.833L15.837,19.3a1.13,1.13,0,0,0,.833.331,1.18,1.18,0,0,0,.833-.318l1.8-1.789a1.12,1.12,0,0,0,.343-.821Zm-8.615-8.64a1.134,1.134,0,0,0-.343-.833L8.163,4.7a1.134,1.134,0,0,0-.833-.343,1.184,1.184,0,0,0-.833.331L4.7,6.473a1.12,1.12,0,0,0-.343.821,1.134,1.134,0,0,0,.343.833l2.549,2.549a1.13,1.13,0,0,0,.833.331,1.184,1.184,0,0,0,.883-.38L8.728,10.4q-.2-.189-.264-.264A2.922,2.922,0,0,1,8.28,9.9a.986.986,0,0,1-.159-.312,1.242,1.242,0,0,1-.043-.337A1.172,1.172,0,0,1,9.254,8.079a1.237,1.237,0,0,1,.337.043,1,1,0,0,1,.312.159,2.761,2.761,0,0,1,.233.184q.073.068.264.264l.226.233a1.19,1.19,0,0,0,.4-.895ZM22,16.706a3.343,3.343,0,0,1-1.042,2.488l-1.8,1.789a3.536,3.536,0,0,1-4.988-.025l-2.525-2.537a3.384,3.384,0,0,1-1.017-2.488,3.448,3.448,0,0,1,1.078-2.561l-1.078-1.078a3.434,3.434,0,0,1-2.549,1.078,3.4,3.4,0,0,1-2.5-1.029L3.029,9.794A3.4,3.4,0,0,1,2,7.294,3.343,3.343,0,0,1,3.042,4.806l1.8-1.789A3.384,3.384,0,0,1,7.331,2a3.357,3.357,0,0,1,2.5,1.042l2.525,2.537a3.384,3.384,0,0,1,1.017,2.488,3.448,3.448,0,0,1-1.078,2.561l1.078,1.078a3.551,3.551,0,0,1,5.049-.049l2.549,2.549A3.4,3.4,0,0,1,22,16.706Z\"></path></svg>',\n\t\t),\n\t\t'codepen'       => array(\n\t\t\t'name' => 'CodePen',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z\"></path></svg>',\n\t\t),\n\t\t'deviantart'    => array(\n\t\t\t'name' => 'DeviantArt',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z\"></path></svg>',\n\t\t),\n\t\t'dribbble'      => array(\n\t\t\t'name' => 'Dribbble',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z\"></path></svg>',\n\t\t),\n\t\t'dropbox'       => array(\n\t\t\t'name' => 'Dropbox',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z\"></path></svg>',\n\t\t),\n\t\t'etsy'          => array(\n\t\t\t'name' => 'Etsy',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z\"></path></svg>',\n\t\t),\n\t\t'facebook'      => array(\n\t\t\t'name' => 'Facebook',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z\"></path></svg>',\n\t\t),\n\t\t'feed'          => array(\n\t\t\t'name' => 'RSS Feed',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z\"></path></svg>',\n\t\t),\n\t\t'flickr'        => array(\n\t\t\t'name' => 'Flickr',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z\"></path></svg>',\n\t\t),\n\t\t'foursquare'    => array(\n\t\t\t'name' => 'Foursquare',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z\"></path></svg>',\n\t\t),\n\t\t'goodreads'     => array(\n\t\t\t'name' => 'Goodreads',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z\"></path></svg>',\n\t\t),\n\t\t'google'        => array(\n\t\t\t'name' => 'Google',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z\"></path></svg>',\n\t\t),\n\t\t'github'        => array(\n\t\t\t'name' => 'GitHub',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z\"></path></svg>',\n\t\t),\n\t\t'instagram'     => array(\n\t\t\t'name' => 'Instagram',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z\"></path></svg>',\n\t\t),\n\t\t'lastfm'        => array(\n\t\t\t'name' => 'Last.fm',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M10.5002,0 C4.7006,0 0,4.70109753 0,10.4998496 C0,16.2989526 4.7006,21 10.5002,21 C16.299,21 21,16.2989526 21,10.4998496 C21,4.70109753 16.299,0 10.5002,0 Z M14.69735,14.7204413 C13.3164,14.7151781 12.4346,14.0870017 11.83445,12.6859357 L11.6816001,12.3451305 L10.35405,9.31011397 C9.92709997,8.26875064 8.85260001,7.57120012 7.68010001,7.57120012 C6.06945001,7.57120012 4.75925001,8.88509738 4.75925001,10.5009524 C4.75925001,12.1164565 6.06945001,13.4303036 7.68010001,13.4303036 C8.77200001,13.4303036 9.76514999,12.827541 10.2719501,11.8567047 C10.2893,11.8235214 10.3239,11.8019673 10.36305,11.8038219 C10.4007,11.8053759 10.43535,11.8287847 10.4504,11.8631709 L10.98655,13.1045863 C11.0016,13.1389726 10.9956,13.17782 10.97225,13.2068931 C10.1605001,14.1995341 8.96020001,14.7683115 7.68010001,14.7683115 C5.33305,14.7683115 3.42340001,12.8535563 3.42340001,10.5009524 C3.42340001,8.14679459 5.33300001,6.23203946 7.68010001,6.23203946 C9.45720002,6.23203946 10.8909,7.19074535 11.6138,8.86359341 C11.6205501,8.88018505 12.3412,10.5707777 12.97445,12.0190621 C13.34865,12.8739575 13.64615,13.3959676 14.6288,13.4291508 C15.5663001,13.4612814 16.25375,12.9121534 16.25375,12.1484869 C16.25375,11.4691321 15.8320501,11.3003585 14.8803,10.98216 C13.2365,10.4397989 12.34495,9.88605929 12.34495,8.51817658 C12.34495,7.1809207 13.26665,6.31615054 14.692,6.31615054 C15.62875,6.31615054 16.3155,6.7286858 16.79215,7.5768142 C16.80495,7.60062396 16.8079001,7.62814302 16.8004001,7.65420843 C16.7929,7.68027384 16.7748,7.70212868 16.7507001,7.713808 L15.86145,8.16900031 C15.8178001,8.19200805 15.7643,8.17807308 15.73565,8.13847371 C15.43295,7.71345711 15.0956,7.52513451 14.6423,7.52513451 C14.05125,7.52513451 13.6220001,7.92899802 13.6220001,8.48649708 C13.6220001,9.17382194 14.1529001,9.34144259 15.0339,9.61923972 C15.14915,9.65578139 15.26955,9.69397731 15.39385,9.73432853 C16.7763,10.1865133 17.57675,10.7311301 17.57675,12.1836251 C17.57685,13.629654 16.3389,14.7204413 14.69735,14.7204413 Z\"></path></svg>',\n\t\t),\n\t\t'linkedin'      => array(\n\t\t\t'name' => 'LinkedIn',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z\"></path></svg>',\n\t\t),\n\t\t'mail'          => array(\n\t\t\t'name' => 'Mail',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M20,4H4C2.895,4,2,4.895,2,6v12c0,1.105,0.895,2,2,2h16c1.105,0,2-0.895,2-2V6C22,4.895,21.105,4,20,4z M20,8.236l-8,4.882 L4,8.236V6h16V8.236z\"></path></svg>',\n\t\t),\n\t\t'mastodon'      => array(\n\t\t\t'name' => 'Mastodon',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z\"/></svg>',\n\t\t),\n\t\t'meetup'        => array(\n\t\t\t'name' => 'Meetup',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z\"></path></svg>',\n\t\t),\n\t\t'medium'        => array(\n\t\t\t'name' => 'Medium',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M20.962,7.257l-5.457,8.867l-3.923-6.375l3.126-5.08c0.112-0.182,0.319-0.286,0.527-0.286c0.05,0,0.1,0.008,0.149,0.02 c0.039,0.01,0.078,0.023,0.114,0.041l5.43,2.715l0.006,0.003c0.004,0.002,0.007,0.006,0.011,0.008 C20.971,7.191,20.98,7.227,20.962,7.257z M9.86,8.592v5.783l5.14,2.57L9.86,8.592z M15.772,17.331l4.231,2.115 C20.554,19.721,21,19.529,21,19.016V8.835L15.772,17.331z M8.968,7.178L3.665,4.527C3.569,4.479,3.478,4.456,3.395,4.456 C3.163,4.456,3,4.636,3,4.938v11.45c0,0.306,0.224,0.669,0.498,0.806l4.671,2.335c0.12,0.06,0.234,0.088,0.337,0.088 c0.29,0,0.494-0.225,0.494-0.602V7.231C9,7.208,8.988,7.188,8.968,7.178z\"></path></svg>',\n\t\t),\n\t\t'pinterest'     => array(\n\t\t\t'name' => 'Pinterest',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2\"></path></svg>',\n\t\t),\n\t\t'pocket'        => array(\n\t\t\t'name' => 'Pocket',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z\"></path></svg>',\n\t\t),\n\t\t'reddit'        => array(\n\t\t\t'name' => 'Reddit',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M22,11.816c0-1.256-1.021-2.277-2.277-2.277c-0.593,0-1.122,0.24-1.526,0.614c-1.481-0.965-3.455-1.594-5.647-1.69 l1.171-3.702l3.18,0.748c0.008,1.028,0.846,1.862,1.876,1.862c1.035,0,1.877-0.842,1.877-1.878c0-1.035-0.842-1.877-1.877-1.877 c-0.769,0-1.431,0.466-1.72,1.13l-3.508-0.826c-0.203-0.047-0.399,0.067-0.46,0.261l-1.35,4.268 c-2.316,0.038-4.411,0.67-5.97,1.671C5.368,9.765,4.853,9.539,4.277,9.539C3.021,9.539,2,10.56,2,11.816 c0,0.814,0.433,1.523,1.078,1.925c-0.037,0.221-0.061,0.444-0.061,0.672c0,3.292,4.011,5.97,8.941,5.97s8.941-2.678,8.941-5.97 c0-0.214-0.02-0.424-0.053-0.632C21.533,13.39,22,12.661,22,11.816z M18.776,4.394c0.606,0,1.1,0.493,1.1,1.1s-0.493,1.1-1.1,1.1 s-1.1-0.494-1.1-1.1S18.169,4.394,18.776,4.394z M2.777,11.816c0-0.827,0.672-1.5,1.499-1.5c0.313,0,0.598,0.103,0.838,0.269 c-0.851,0.676-1.477,1.479-1.812,2.36C2.983,12.672,2.777,12.27,2.777,11.816z M11.959,19.606c-4.501,0-8.164-2.329-8.164-5.193 S7.457,9.22,11.959,9.22s8.164,2.329,8.164,5.193S16.46,19.606,11.959,19.606z M20.636,13.001c-0.326-0.89-0.948-1.701-1.797-2.384 c0.248-0.186,0.55-0.301,0.883-0.301c0.827,0,1.5,0.673,1.5,1.5C21.223,12.299,20.992,12.727,20.636,13.001z M8.996,14.704 c-0.76,0-1.397-0.616-1.397-1.376c0-0.76,0.637-1.397,1.397-1.397c0.76,0,1.376,0.637,1.376,1.397 C10.372,14.088,9.756,14.704,8.996,14.704z M16.401,13.328c0,0.76-0.616,1.376-1.376,1.376c-0.76,0-1.399-0.616-1.399-1.376 c0-0.76,0.639-1.397,1.399-1.397C15.785,11.931,16.401,12.568,16.401,13.328z M15.229,16.708c0.152,0.152,0.152,0.398,0,0.55 c-0.674,0.674-1.727,1.002-3.219,1.002c-0.004,0-0.007-0.002-0.011-0.002c-0.004,0-0.007,0.002-0.011,0.002 c-1.492,0-2.544-0.328-3.218-1.002c-0.152-0.152-0.152-0.398,0-0.55c0.152-0.152,0.399-0.151,0.55,0 c0.521,0.521,1.394,0.775,2.669,0.775c0.004,0,0.007,0.002,0.011,0.002c0.004,0,0.007-0.002,0.011-0.002 c1.275,0,2.148-0.253,2.669-0.775C14.831,16.556,15.078,16.556,15.229,16.708z\"></path></svg>',\n\t\t),\n\t\t'skype'         => array(\n\t\t\t'name' => 'Skype',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z\"></path></svg>',\n\t\t),\n\t\t'snapchat'      => array(\n\t\t\t'name' => 'Snapchat',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z\"></path></svg>',\n\t\t),\n\t\t'soundcloud'    => array(\n\t\t\t'name' => 'Soundcloud',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M8.9,16.1L9,14L8.9,9.5c0-0.1,0-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1c-0.1,0-0.1,0-0.1,0.1c0,0-0.1,0.1-0.1,0.1L8.3,14l0.1,2.1 c0,0.1,0,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1C8.8,16.3,8.9,16.3,8.9,16.1z M11.4,15.9l0.1-1.8L11.4,9c0-0.1,0-0.2-0.1-0.2 c0,0-0.1,0-0.1,0s-0.1,0-0.1,0c-0.1,0-0.1,0.1-0.1,0.2l0,0.1l-0.1,5c0,0,0,0.7,0.1,2v0c0,0.1,0,0.1,0.1,0.1c0.1,0.1,0.1,0.1,0.2,0.1 c0.1,0,0.1,0,0.2-0.1c0.1,0,0.1-0.1,0.1-0.2L11.4,15.9z M2.4,12.9L2.5,14l-0.2,1.1c0,0.1,0,0.1-0.1,0.1c0,0-0.1,0-0.1-0.1L2.1,14 l0.1-1.1C2.2,12.9,2.3,12.9,2.4,12.9C2.3,12.9,2.4,12.9,2.4,12.9z M3.1,12.2L3.3,14l-0.2,1.8c0,0.1,0,0.1-0.1,0.1 c-0.1,0-0.1,0-0.1-0.1L2.8,14L3,12.2C3,12.2,3,12.2,3.1,12.2C3.1,12.2,3.1,12.2,3.1,12.2z M3.9,11.9L4.1,14l-0.2,2.1 c0,0.1,0,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L3.5,14l0.2-2.1c0-0.1,0-0.1,0.1-0.1C3.9,11.8,3.9,11.8,3.9,11.9z M4.7,11.9L4.9,14 l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L4.3,14l0.2-2.2c0-0.1,0-0.1,0.1-0.1C4.7,11.7,4.7,11.8,4.7,11.9z M5.6,12 l0.2,2l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c0,0-0.1,0-0.1,0c0,0,0-0.1,0-0.1L5.1,14l0.2-2c0,0,0-0.1,0-0.1s0.1,0,0.1,0 C5.5,11.9,5.5,11.9,5.6,12L5.6,12z M6.4,10.7L6.6,14l-0.2,2.1c0,0,0,0.1,0,0.1c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.2L5.9,14 l0.2-3.3c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0C6.4,10.7,6.4,10.7,6.4,10.7z M7.2,10l0.2,4.1l-0.2,2.1c0,0,0,0.1,0,0.1 c0,0-0.1,0-0.1,0c-0.1,0-0.2-0.1-0.2-0.2l-0.1-2.1L6.8,10c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0S7.2,9.9,7.2,10z M8,9.6L8.2,14 L8,16.1c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.2-0.1-0.2-0.2L7.5,14l0.1-4.4c0-0.1,0-0.1,0.1-0.1c0,0,0.1-0.1,0.1-0.1c0.1,0,0.1,0,0.1,0.1 C8,9.6,8,9.6,8,9.6z M11.4,16.1L11.4,16.1L11.4,16.1z M9.7,9.6L9.8,14l-0.1,2.1c0,0.1,0,0.1-0.1,0.2s-0.1,0.1-0.2,0.1 c-0.1,0-0.1,0-0.1-0.1s-0.1-0.1-0.1-0.2L9.2,14l0.1-4.4c0-0.1,0-0.1,0.1-0.2s0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S9.7,9.5,9.7,9.6 L9.7,9.6z M10.6,9.8l0.1,4.3l-0.1,2c0,0.1,0,0.1-0.1,0.2c0,0-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c0,0-0.1-0.1-0.1-0.2L10,14 l0.1-4.3c0-0.1,0-0.1,0.1-0.2c0,0,0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S10.6,9.7,10.6,9.8z M12.4,14l-0.1,2c0,0.1,0,0.1-0.1,0.2 c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2l-0.1-1l-0.1-1l0.1-5.5v0c0-0.1,0-0.2,0.1-0.2 c0.1,0,0.1-0.1,0.2-0.1c0,0,0.1,0,0.1,0c0.1,0,0.1,0.1,0.1,0.2L12.4,14z M22.1,13.9c0,0.7-0.2,1.3-0.7,1.7c-0.5,0.5-1.1,0.7-1.7,0.7 h-6.8c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2V8.2c0-0.1,0.1-0.2,0.2-0.3c0.5-0.2,1-0.3,1.6-0.3c1.1,0,2.1,0.4,2.9,1.1 c0.8,0.8,1.3,1.7,1.4,2.8c0.3-0.1,0.6-0.2,1-0.2c0.7,0,1.3,0.2,1.7,0.7C21.8,12.6,22.1,13.2,22.1,13.9L22.1,13.9z\"></path></svg>',\n\t\t),\n\t\t'spotify'       => array(\n\t\t\t'name' => 'Spotify',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865\"></path></svg>',\n\t\t),\n\t\t'tumblr'        => array(\n\t\t\t'name' => 'Tumblr',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z\" /></path></svg>',\n\t\t),\n\t\t'twitch'        => array(\n\t\t\t'name' => 'Twitch',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z\"></path></svg>',\n\t\t),\n\t\t'twitter'       => array(\n\t\t\t'name' => 'Twitter',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z\"></path></svg>',\n\t\t),\n\t\t'vimeo'         => array(\n\t\t\t'name' => 'Vimeo',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z\"></path></svg>',\n\t\t),\n\t\t'vk'            => array(\n\t\t\t'name' => 'VK',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z\"></path></svg>',\n\t\t),\n\t\t'wordpress'     => array(\n\t\t\t'name' => 'WordPress',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z\"></path></svg>',\n\t\t),\n\t\t'yelp'          => array(\n\t\t\t'name' => 'Yelp',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z\"></path></svg>',\n\t\t),\n\t\t'youtube'       => array(\n\t\t\t'name' => 'YouTube',\n\t\t\t'icon' => '<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z\"></path></svg>',\n\t\t),\n\t\t'share'         => array(\n\t\t\t'name' => 'Share Icon',\n\t\t\t'icon' => '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z\"/></svg>',\n\t\t),\n\t);\n\n\tif ( ! empty( $service )\n\t\t&& ! empty( $field )\n\t\t&& isset( $services_data[ $service ] )\n\t\t&& ( 'icon' === $field || 'name' === $field )\n\t) {\n\t\treturn $services_data[ $service ][ $field ];\n\t} elseif ( ! empty( $service ) && isset( $services_data[ $service ] ) ) {\n\t\treturn $services_data[ $service ];\n\t}\n\n\treturn $services_data;\n}\n", "num_lines": 260}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Server-side rendering of the `core/tag-cloud` block.\n *\n * @package WordPress\n */\n\n/**\n * Renders the `core/tag-cloud` block on server.\n *\n * @param array $attributes The block attributes.\n *\n * @return string Returns the tag cloud for selected taxonomy.\n */\nfunction render_block_core_tag_cloud( $attributes ) {\n\t$class = isset( $attributes['align'] ) ?\n\t\t\"wp-block-tag-cloud align{$attributes['align']}\" :\n\t\t'wp-block-tag-cloud';\n\n\tif ( isset( $attributes['className'] ) ) {\n\t\t$class .= ' ' . $attributes['className'];\n\t}\n\n\t$args = array(\n\t\t'echo'       => false,\n\t\t'taxonomy'   => $attributes['taxonomy'],\n\t\t'show_count' => $attributes['showTagCounts'],\n\t);\n\n\t$tag_cloud = wp_tag_cloud( $args );\n\n\tif ( ! $tag_cloud ) {\n\t\t$labels    = get_taxonomy_labels( get_taxonomy( $attributes['taxonomy'] ) );\n\t\t$tag_cloud = esc_html(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: taxonomy name */\n\t\t\t\t__( 'Your site doesn&#8217;t have any %s, so there&#8217;s nothing to display here at the moment.' ),\n\t\t\t\tstrtolower( $labels->name )\n\t\t\t)\n\t\t);\n\t}\n\n\treturn sprintf(\n\t\t'<p class=\"%1$s\">%2$s</p>',\n\t\tesc_attr( $class ),\n\t\t$tag_cloud\n\t);\n}\n\n/**\n * Registers the `core/tag-cloud` block on server.\n */\nfunction register_block_core_tag_cloud() {\n\tregister_block_type_from_metadata(\n\t\t__DIR__ . '/tag-cloud',\n\t\tarray(\n\t\t\t'render_callback' => 'render_block_core_tag_cloud',\n\t\t)\n\t);\n}\nadd_action( 'init', 'register_block_core_tag_cloud' );\n", "num_lines": 62}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Background_Image_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize Background Image Control class.\n *\n * @since 3.4.0\n *\n * @see WP_Customize_Image_Control\n */\nclass WP_Customize_Background_Image_Control extends WP_Customize_Image_Control {\n\tpublic $type = 'background';\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.4.0\n\t * @uses WP_Customize_Image_Control::__construct()\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t */\n\tpublic function __construct( $manager ) {\n\t\tparent::__construct(\n\t\t\t$manager,\n\t\t\t'background_image',\n\t\t\tarray(\n\t\t\t\t'label'   => __( 'Background Image' ),\n\t\t\t\t'section' => 'background_image',\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Enqueue control related scripts/styles.\n\t *\n\t * @since 4.1.0\n\t */\n\tpublic function enqueue() {\n\t\tparent::enqueue();\n\n\t\t$custom_background = get_theme_support( 'custom-background' );\n\t\twp_localize_script(\n\t\t\t'customize-controls',\n\t\t\t'_wpCustomizeBackground',\n\t\t\tarray(\n\t\t\t\t'defaults' => ! empty( $custom_background[0] ) ? $custom_background[0] : array(),\n\t\t\t\t'nonces'   => array(\n\t\t\t\t\t'add' => wp_create_nonce( 'background-add' ),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}\n}\n", "num_lines": 60}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Background_Image_Setting class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customizer Background Image Setting class.\n *\n * @since 3.4.0\n *\n * @see WP_Customize_Setting\n */\nfinal class WP_Customize_Background_Image_Setting extends WP_Customize_Setting {\n\tpublic $id = 'background_image_thumb';\n\n\t/**\n\t * @since 3.4.0\n\t *\n\t * @param $value\n\t */\n\tpublic function update( $value ) {\n\t\tremove_theme_mod( 'background_image_thumb' );\n\t}\n}\n", "num_lines": 29}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Background_Position_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.7.0\n */\n\n/**\n * Customize Background Position Control class.\n *\n * @since 4.7.0\n *\n * @see WP_Customize_Control\n */\nclass WP_Customize_Background_Position_Control extends WP_Customize_Control {\n\n\t/**\n\t * Type.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tpublic $type = 'background_position';\n\n\t/**\n\t * Don't render the control content from PHP, as it's rendered via JS on load.\n\t *\n\t * @since 4.7.0\n\t */\n\tpublic function render_content() {}\n\n\t/**\n\t * Render a JS template for the content of the position control.\n\t *\n\t * @since 4.7.0\n\t */\n\tpublic function content_template() {\n\t\t$options = array(\n\t\t\tarray(\n\t\t\t\t'left top'   => array(\n\t\t\t\t\t'label' => __( 'Top Left' ),\n\t\t\t\t\t'icon'  => 'dashicons dashicons-arrow-left-alt',\n\t\t\t\t),\n\t\t\t\t'center top' => array(\n\t\t\t\t\t'label' => __( 'Top' ),\n\t\t\t\t\t'icon'  => 'dashicons dashicons-arrow-up-alt',\n\t\t\t\t),\n\t\t\t\t'right top'  => array(\n\t\t\t\t\t'label' => __( 'Top Right' ),\n\t\t\t\t\t'icon'  => 'dashicons dashicons-arrow-right-alt',\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'left center'   => array(\n\t\t\t\t\t'label' => __( 'Left' ),\n\t\t\t\t\t'icon'  => 'dashicons dashicons-arrow-left-alt',\n\t\t\t\t),\n\t\t\t\t'center center' => array(\n\t\t\t\t\t'label' => __( 'Center' ),\n\t\t\t\t\t'icon'  => 'background-position-center-icon',\n\t\t\t\t),\n\t\t\t\t'right center'  => array(\n\t\t\t\t\t'label' => __( 'Right' ),\n\t\t\t\t\t'icon'  => 'dashicons dashicons-arrow-right-alt',\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'left bottom'   => array(\n\t\t\t\t\t'label' => __( 'Bottom Left' ),\n\t\t\t\t\t'icon'  => 'dashicons dashicons-arrow-left-alt',\n\t\t\t\t),\n\t\t\t\t'center bottom' => array(\n\t\t\t\t\t'label' => __( 'Bottom' ),\n\t\t\t\t\t'icon'  => 'dashicons dashicons-arrow-down-alt',\n\t\t\t\t),\n\t\t\t\t'right bottom'  => array(\n\t\t\t\t\t'label' => __( 'Bottom Right' ),\n\t\t\t\t\t'icon'  => 'dashicons dashicons-arrow-right-alt',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t?>\n\t\t<# if ( data.label ) { #>\n\t\t\t<span class=\"customize-control-title\">{{{ data.label }}}</span>\n\t\t<# } #>\n\t\t<# if ( data.description ) { #>\n\t\t\t<span class=\"description customize-control-description\">{{{ data.description }}}</span>\n\t\t<# } #>\n\t\t<div class=\"customize-control-content\">\n\t\t\t<fieldset>\n\t\t\t\t<legend class=\"screen-reader-text\"><span><?php _e( 'Image Position' ); ?></span></legend>\n\t\t\t\t<div class=\"background-position-control\">\n\t\t\t\t<?php foreach ( $options as $group ) : ?>\n\t\t\t\t\t<div class=\"button-group\">\n\t\t\t\t\t<?php foreach ( $group as $value => $input ) : ?>\n\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t<input class=\"screen-reader-text\" name=\"background-position\" type=\"radio\" value=\"<?php echo esc_attr( $value ); ?>\">\n\t\t\t\t\t\t\t<span class=\"button display-options position\"><span class=\"<?php echo esc_attr( $input['icon'] ); ?>\" aria-hidden=\"true\"></span></span>\n\t\t\t\t\t\t\t<span class=\"screen-reader-text\"><?php echo $input['label']; ?></span>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t</div>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\t\t</div>\n\t\t<?php\n\t}\n}\n", "num_lines": 112}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Code_Editor_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.9.0\n */\n\n/**\n * Customize Code Editor Control class.\n *\n * @since 4.9.0\n *\n * @see WP_Customize_Control\n */\nclass WP_Customize_Code_Editor_Control extends WP_Customize_Control {\n\n\t/**\n\t * Customize control type.\n\t *\n\t * @since 4.9.0\n\t * @var string\n\t */\n\tpublic $type = 'code_editor';\n\n\t/**\n\t * Type of code that is being edited.\n\t *\n\t * @since 4.9.0\n\t * @var string\n\t */\n\tpublic $code_type = '';\n\n\t/**\n\t * Code editor settings.\n\t *\n\t * @see wp_enqueue_code_editor()\n\t * @since 4.9.0\n\t * @var array|false\n\t */\n\tpublic $editor_settings = array();\n\n\t/**\n\t * Enqueue control related scripts/styles.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic function enqueue() {\n\t\t$this->editor_settings = wp_enqueue_code_editor(\n\t\t\tarray_merge(\n\t\t\t\tarray(\n\t\t\t\t\t'type'       => $this->code_type,\n\t\t\t\t\t'codemirror' => array(\n\t\t\t\t\t\t'indentUnit' => 2,\n\t\t\t\t\t\t'tabSize'    => 2,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t$this->editor_settings\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Refresh the parameters passed to the JavaScript via JSON.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @see WP_Customize_Control::json()\n\t *\n\t * @return array Array of parameters passed to the JavaScript.\n\t */\n\tpublic function json() {\n\t\t$json                    = parent::json();\n\t\t$json['editor_settings'] = $this->editor_settings;\n\t\t$json['input_attrs']     = $this->input_attrs;\n\t\treturn $json;\n\t}\n\n\t/**\n\t * Don't render the control content from PHP, as it's rendered via JS on load.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic function render_content() {}\n\n\t/**\n\t * Render a JS template for control display.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic function content_template() {\n\t\t?>\n\t\t<# var elementIdPrefix = 'el' + String( Math.random() ); #>\n\t\t<# if ( data.label ) { #>\n\t\t\t<label for=\"{{ elementIdPrefix }}_editor\" class=\"customize-control-title\">\n\t\t\t\t{{ data.label }}\n\t\t\t</label>\n\t\t<# } #>\n\t\t<# if ( data.description ) { #>\n\t\t\t<span class=\"description customize-control-description\">{{{ data.description }}}</span>\n\t\t<# } #>\n\t\t<div class=\"customize-control-notifications-container\"></div>\n\t\t<textarea id=\"{{ elementIdPrefix }}_editor\"\n\t\t\t<# _.each( _.extend( { 'class': 'code' }, data.input_attrs ), function( value, key ) { #>\n\t\t\t\t{{{ key }}}=\"{{ value }}\"\n\t\t\t<# }); #>\n\t\t\t></textarea>\n\t\t<?php\n\t}\n}\n", "num_lines": 112}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Color_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize Color Control class.\n *\n * @since 3.4.0\n *\n * @see WP_Customize_Control\n */\nclass WP_Customize_Color_Control extends WP_Customize_Control {\n\t/**\n\t * Type.\n\t *\n\t * @var string\n\t */\n\tpublic $type = 'color';\n\n\t/**\n\t * Statuses.\n\t *\n\t * @var array\n\t */\n\tpublic $statuses;\n\n\t/**\n\t * Mode.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tpublic $mode = 'full';\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @see WP_Customize_Control::__construct()\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t * @param string               $id      Control ID.\n\t * @param array                $args    Optional. Arguments to override class property defaults.\n\t *                                      See WP_Customize_Control::__construct() for information\n\t *                                      on accepted arguments. Default empty array.\n\t */\n\tpublic function __construct( $manager, $id, $args = array() ) {\n\t\t$this->statuses = array( '' => __( 'Default' ) );\n\t\tparent::__construct( $manager, $id, $args );\n\t}\n\n\t/**\n\t * Enqueue scripts/styles for the color picker.\n\t *\n\t * @since 3.4.0\n\t */\n\tpublic function enqueue() {\n\t\twp_enqueue_script( 'wp-color-picker' );\n\t\twp_enqueue_style( 'wp-color-picker' );\n\t}\n\n\t/**\n\t * Refresh the parameters passed to the JavaScript via JSON.\n\t *\n\t * @since 3.4.0\n\t * @uses WP_Customize_Control::to_json()\n\t */\n\tpublic function to_json() {\n\t\tparent::to_json();\n\t\t$this->json['statuses']     = $this->statuses;\n\t\t$this->json['defaultValue'] = $this->setting->default;\n\t\t$this->json['mode']         = $this->mode;\n\t}\n\n\t/**\n\t * Don't render the control content from PHP, as it's rendered via JS on load.\n\t *\n\t * @since 3.4.0\n\t */\n\tpublic function render_content() {}\n\n\t/**\n\t * Render a JS template for the content of the color picker control.\n\t *\n\t * @since 4.1.0\n\t */\n\tpublic function content_template() {\n\t\t?>\n\t\t<# var defaultValue = '#RRGGBB', defaultValueAttr = '',\n\t\t\tisHueSlider = data.mode === 'hue';\n\t\tif ( data.defaultValue && _.isString( data.defaultValue ) && ! isHueSlider ) {\n\t\t\tif ( '#' !== data.defaultValue.substring( 0, 1 ) ) {\n\t\t\t\tdefaultValue = '#' + data.defaultValue;\n\t\t\t} else {\n\t\t\t\tdefaultValue = data.defaultValue;\n\t\t\t}\n\t\t\tdefaultValueAttr = ' data-default-color=' + defaultValue; // Quotes added automatically.\n\t\t} #>\n\t\t<# if ( data.label ) { #>\n\t\t\t<span class=\"customize-control-title\">{{{ data.label }}}</span>\n\t\t<# } #>\n\t\t<# if ( data.description ) { #>\n\t\t\t<span class=\"description customize-control-description\">{{{ data.description }}}</span>\n\t\t<# } #>\n\t\t<div class=\"customize-control-content\">\n\t\t\t<label><span class=\"screen-reader-text\">{{{ data.label }}}</span>\n\t\t\t<# if ( isHueSlider ) { #>\n\t\t\t\t<input class=\"color-picker-hue\" type=\"text\" data-type=\"hue\" />\n\t\t\t<# } else { #>\n\t\t\t\t<input class=\"color-picker-hex\" type=\"text\" maxlength=\"7\" placeholder=\"{{ defaultValue }}\" {{ defaultValueAttr }} />\n\t\t\t<# } #>\n\t\t\t</label>\n\t\t</div>\n\t\t<?php\n\t}\n}\n", "num_lines": 123}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Cropped_Image_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize Cropped Image Control class.\n *\n * @since 4.3.0\n *\n * @see WP_Customize_Image_Control\n */\nclass WP_Customize_Cropped_Image_Control extends WP_Customize_Image_Control {\n\n\t/**\n\t * Control type.\n\t *\n\t * @since 4.3.0\n\t * @var string\n\t */\n\tpublic $type = 'cropped_image';\n\n\t/**\n\t * Suggested width for cropped image.\n\t *\n\t * @since 4.3.0\n\t * @var int\n\t */\n\tpublic $width = 150;\n\n\t/**\n\t * Suggested height for cropped image.\n\t *\n\t * @since 4.3.0\n\t * @var int\n\t */\n\tpublic $height = 150;\n\n\t/**\n\t * Whether the width is flexible.\n\t *\n\t * @since 4.3.0\n\t * @var bool\n\t */\n\tpublic $flex_width = false;\n\n\t/**\n\t * Whether the height is flexible.\n\t *\n\t * @since 4.3.0\n\t * @var bool\n\t */\n\tpublic $flex_height = false;\n\n\t/**\n\t * Enqueue control related scripts/styles.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function enqueue() {\n\t\twp_enqueue_script( 'customize-views' );\n\n\t\tparent::enqueue();\n\t}\n\n\t/**\n\t * Refresh the parameters passed to the JavaScript via JSON.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see WP_Customize_Control::to_json()\n\t */\n\tpublic function to_json() {\n\t\tparent::to_json();\n\n\t\t$this->json['width']       = absint( $this->width );\n\t\t$this->json['height']      = absint( $this->height );\n\t\t$this->json['flex_width']  = absint( $this->flex_width );\n\t\t$this->json['flex_height'] = absint( $this->flex_height );\n\t}\n\n}\n", "num_lines": 87}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Custom_CSS_Setting class\n *\n * This handles validation, sanitization and saving of the value.\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.7.0\n */\n\n/**\n * Custom Setting to handle WP Custom CSS.\n *\n * @since 4.7.0\n *\n * @see WP_Customize_Setting\n */\nfinal class WP_Customize_Custom_CSS_Setting extends WP_Customize_Setting {\n\n\t/**\n\t * The setting type.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tpublic $type = 'custom_css';\n\n\t/**\n\t * Setting Transport\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tpublic $transport = 'postMessage';\n\n\t/**\n\t * Capability required to edit this setting.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tpublic $capability = 'edit_css';\n\n\t/**\n\t * Stylesheet\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tpublic $stylesheet = '';\n\n\t/**\n\t * WP_Customize_Custom_CSS_Setting constructor.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @throws Exception If the setting ID does not match the pattern `custom_css[$stylesheet]`.\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t * @param string               $id      A specific ID of the setting.\n\t *                                      Can be a theme mod or option name.\n\t * @param array                $args    Setting arguments.\n\t */\n\tpublic function __construct( $manager, $id, $args = array() ) {\n\t\tparent::__construct( $manager, $id, $args );\n\t\tif ( 'custom_css' !== $this->id_data['base'] ) {\n\t\t\tthrow new Exception( 'Expected custom_css id_base.' );\n\t\t}\n\t\tif ( 1 !== count( $this->id_data['keys'] ) || empty( $this->id_data['keys'][0] ) ) {\n\t\t\tthrow new Exception( 'Expected single stylesheet key.' );\n\t\t}\n\t\t$this->stylesheet = $this->id_data['keys'][0];\n\t}\n\n\t/**\n\t * Add filter to preview post value.\n\t *\n\t * @since 4.7.9\n\t *\n\t * @return bool False when preview short-circuits due no change needing to be previewed.\n\t */\n\tpublic function preview() {\n\t\tif ( $this->is_previewed ) {\n\t\t\treturn false;\n\t\t}\n\t\t$this->is_previewed = true;\n\t\tadd_filter( 'wp_get_custom_css', array( $this, 'filter_previewed_wp_get_custom_css' ), 9, 2 );\n\t\treturn true;\n\t}\n\n\t/**\n\t * Filter `wp_get_custom_css` for applying the customized value.\n\t *\n\t * This is used in the preview when `wp_get_custom_css()` is called for rendering the styles.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see wp_get_custom_css()\n\t *\n\t * @param string $css        Original CSS.\n\t * @param string $stylesheet Current stylesheet.\n\t * @return string CSS.\n\t */\n\tpublic function filter_previewed_wp_get_custom_css( $css, $stylesheet ) {\n\t\tif ( $stylesheet === $this->stylesheet ) {\n\t\t\t$customized_value = $this->post_value( null );\n\t\t\tif ( ! is_null( $customized_value ) ) {\n\t\t\t\t$css = $customized_value;\n\t\t\t}\n\t\t}\n\t\treturn $css;\n\t}\n\n\t/**\n\t * Fetch the value of the setting. Will return the previewed value when `preview()` is called.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see WP_Customize_Setting::value()\n\t *\n\t * @return string\n\t */\n\tpublic function value() {\n\t\tif ( $this->is_previewed ) {\n\t\t\t$post_value = $this->post_value( null );\n\t\t\tif ( null !== $post_value ) {\n\t\t\t\treturn $post_value;\n\t\t\t}\n\t\t}\n\t\t$id_base = $this->id_data['base'];\n\t\t$value   = '';\n\t\t$post    = wp_get_custom_css_post( $this->stylesheet );\n\t\tif ( $post ) {\n\t\t\t$value = $post->post_content;\n\t\t}\n\t\tif ( empty( $value ) ) {\n\t\t\t$value = $this->default;\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/class-wp-customize-setting.php */\n\t\t$value = apply_filters( \"customize_value_{$id_base}\", $value, $this );\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Validate CSS.\n\t *\n\t * Checks for imbalanced braces, brackets, and comments.\n\t * Notifications are rendered when the customizer state is saved.\n\t *\n\t * @since 4.7.0\n\t * @since 4.9.0 Checking for balanced characters has been moved client-side via linting in code editor.\n\t *\n\t * @param string $css The input string.\n\t * @return true|WP_Error True if the input was validated, otherwise WP_Error.\n\t */\n\tpublic function validate( $css ) {\n\t\t$validity = new WP_Error();\n\n\t\tif ( preg_match( '#</?\\w+#', $css ) ) {\n\t\t\t$validity->add( 'illegal_markup', __( 'Markup is not allowed in CSS.' ) );\n\t\t}\n\n\t\tif ( ! $validity->has_errors() ) {\n\t\t\t$validity = parent::validate( $css );\n\t\t}\n\t\treturn $validity;\n\t}\n\n\t/**\n\t * Store the CSS setting value in the custom_css custom post type for the stylesheet.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $css The input value.\n\t * @return int|false The post ID or false if the value could not be saved.\n\t */\n\tpublic function update( $css ) {\n\t\tif ( empty( $css ) ) {\n\t\t\t$css = '';\n\t\t}\n\n\t\t$r = wp_update_custom_css_post(\n\t\t\t$css,\n\t\t\tarray(\n\t\t\t\t'stylesheet' => $this->stylesheet,\n\t\t\t)\n\t\t);\n\n\t\tif ( $r instanceof WP_Error ) {\n\t\t\treturn false;\n\t\t}\n\t\t$post_id = $r->ID;\n\n\t\t// Cache post ID in theme mod for performance to avoid additional DB query.\n\t\tif ( $this->manager->get_stylesheet() === $this->stylesheet ) {\n\t\t\tset_theme_mod( 'custom_css_post_id', $post_id );\n\t\t}\n\n\t\treturn $post_id;\n\t}\n}\n", "num_lines": 205}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Date_Time_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.9.0\n */\n\n/**\n * Customize Date Time Control class.\n *\n * @since 4.9.0\n *\n * @see WP_Customize_Control\n */\nclass WP_Customize_Date_Time_Control extends WP_Customize_Control {\n\n\t/**\n\t * Customize control type.\n\t *\n\t * @since 4.9.0\n\t * @var string\n\t */\n\tpublic $type = 'date_time';\n\n\t/**\n\t * Minimum Year.\n\t *\n\t * @since 4.9.0\n\t * @var integer\n\t */\n\tpublic $min_year = 1000;\n\n\t/**\n\t * Maximum Year.\n\t *\n\t * @since 4.9.0\n\t * @var integer\n\t */\n\tpublic $max_year = 9999;\n\n\t/**\n\t * Allow past date, if set to false user can only select future date.\n\t *\n\t * @since 4.9.0\n\t * @var boolean\n\t */\n\tpublic $allow_past_date = true;\n\n\t/**\n\t * Whether hours, minutes, and meridian should be shown.\n\t *\n\t * @since 4.9.0\n\t * @var boolean\n\t */\n\tpublic $include_time = true;\n\n\t/**\n\t * If set to false the control will appear in 24 hour format,\n\t * the value will still be saved in Y-m-d H:i:s format.\n\t *\n\t * @since 4.9.0\n\t * @var boolean\n\t */\n\tpublic $twelve_hour_format = true;\n\n\t/**\n\t * Don't render the control's content - it's rendered with a JS template.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic function render_content() {}\n\n\t/**\n\t * Export data to JS.\n\t *\n\t * @since 4.9.0\n\t * @return array\n\t */\n\tpublic function json() {\n\t\t$data = parent::json();\n\n\t\t$data['maxYear']          = intval( $this->max_year );\n\t\t$data['minYear']          = intval( $this->min_year );\n\t\t$data['allowPastDate']    = (bool) $this->allow_past_date;\n\t\t$data['twelveHourFormat'] = (bool) $this->twelve_hour_format;\n\t\t$data['includeTime']      = (bool) $this->include_time;\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Renders a JS template for the content of date time control.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic function content_template() {\n\t\t$data          = array_merge( $this->json(), $this->get_month_choices() );\n\t\t$timezone_info = $this->get_timezone_info();\n\n\t\t$date_format = get_option( 'date_format' );\n\t\t$date_format = preg_replace( '/(?<!\\\\\\\\)[Yyo]/', '%1$s', $date_format );\n\t\t$date_format = preg_replace( '/(?<!\\\\\\\\)[FmMn]/', '%2$s', $date_format );\n\t\t$date_format = preg_replace( '/(?<!\\\\\\\\)[jd]/', '%3$s', $date_format );\n\n\t\t// Fallback to ISO date format if year, month, or day are missing from the date format.\n\t\tif ( 1 !== substr_count( $date_format, '%1$s' ) || 1 !== substr_count( $date_format, '%2$s' ) || 1 !== substr_count( $date_format, '%3$s' ) ) {\n\t\t\t$date_format = '%1$s-%2$s-%3$s';\n\t\t}\n\t\t?>\n\n\t\t<# _.defaults( data, <?php echo wp_json_encode( $data ); ?> ); #>\n\t\t<# var idPrefix = _.uniqueId( 'el' ) + '-'; #>\n\n\t\t<# if ( data.label ) { #>\n\t\t\t<span class=\"customize-control-title\">\n\t\t\t\t{{ data.label }}\n\t\t\t</span>\n\t\t<# } #>\n\t\t<div class=\"customize-control-notifications-container\"></div>\n\t\t<# if ( data.description ) { #>\n\t\t\t<span class=\"description customize-control-description\">{{ data.description }}</span>\n\t\t<# } #>\n\t\t<div class=\"date-time-fields {{ data.includeTime ? 'includes-time' : '' }}\">\n\t\t\t<fieldset class=\"day-row\">\n\t\t\t\t<legend class=\"title-day {{ ! data.includeTime ? 'screen-reader-text' : '' }}\"><?php esc_html_e( 'Date' ); ?></legend>\n\t\t\t\t<div class=\"day-fields clear\">\n\t\t\t\t\t<?php ob_start(); ?>\n\t\t\t\t\t<label for=\"{{ idPrefix }}date-time-month\" class=\"screen-reader-text\"><?php esc_html_e( 'Month' ); ?></label>\n\t\t\t\t\t<select id=\"{{ idPrefix }}date-time-month\" class=\"date-input month\" data-component=\"month\">\n\t\t\t\t\t\t<# _.each( data.month_choices, function( choice ) {\n\t\t\t\t\t\t\tif ( _.isObject( choice ) && ! _.isUndefined( choice.text ) && ! _.isUndefined( choice.value ) ) {\n\t\t\t\t\t\t\t\ttext = choice.text;\n\t\t\t\t\t\t\t\tvalue = choice.value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t#>\n\t\t\t\t\t\t\t<option value=\"{{ value }}\" >\n\t\t\t\t\t\t\t\t{{ text }}\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t<# } ); #>\n\t\t\t\t\t</select>\n\t\t\t\t\t<?php $month_field = trim( ob_get_clean() ); ?>\n\n\t\t\t\t\t<?php ob_start(); ?>\n\t\t\t\t\t<label for=\"{{ idPrefix }}date-time-day\" class=\"screen-reader-text\"><?php esc_html_e( 'Day' ); ?></label>\n\t\t\t\t\t<input id=\"{{ idPrefix }}date-time-day\" type=\"number\" size=\"2\" autocomplete=\"off\" class=\"date-input day\" data-component=\"day\" min=\"1\" max=\"31\" />\n\t\t\t\t\t<?php $day_field = trim( ob_get_clean() ); ?>\n\n\t\t\t\t\t<?php ob_start(); ?>\n\t\t\t\t\t<label for=\"{{ idPrefix }}date-time-year\" class=\"screen-reader-text\"><?php esc_html_e( 'Year' ); ?></label>\n\t\t\t\t\t<input id=\"{{ idPrefix }}date-time-year\" type=\"number\" size=\"4\" autocomplete=\"off\" class=\"date-input year\" data-component=\"year\" min=\"{{ data.minYear }}\" max=\"{{ data.maxYear }}\">\n\t\t\t\t\t<?php $year_field = trim( ob_get_clean() ); ?>\n\n\t\t\t\t\t<?php printf( $date_format, $year_field, $month_field, $day_field ); ?>\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\t\t\t<# if ( data.includeTime ) { #>\n\t\t\t\t<fieldset class=\"time-row clear\">\n\t\t\t\t\t<legend class=\"title-time\"><?php esc_html_e( 'Time' ); ?></legend>\n\t\t\t\t\t<div class=\"time-fields clear\">\n\t\t\t\t\t\t<label for=\"{{ idPrefix }}date-time-hour\" class=\"screen-reader-text\"><?php esc_html_e( 'Hour' ); ?></label>\n\t\t\t\t\t\t<# var maxHour = data.twelveHourFormat ? 12 : 23; #>\n\t\t\t\t\t\t<# var minHour = data.twelveHourFormat ? 1 : 0; #>\n\t\t\t\t\t\t<input id=\"{{ idPrefix }}date-time-hour\" type=\"number\" size=\"2\" autocomplete=\"off\" class=\"date-input hour\" data-component=\"hour\" min=\"{{ minHour }}\" max=\"{{ maxHour }}\">\n\t\t\t\t\t\t:\n\t\t\t\t\t\t<label for=\"{{ idPrefix }}date-time-minute\" class=\"screen-reader-text\"><?php esc_html_e( 'Minute' ); ?></label>\n\t\t\t\t\t\t<input id=\"{{ idPrefix }}date-time-minute\" type=\"number\" size=\"2\" autocomplete=\"off\" class=\"date-input minute\" data-component=\"minute\" min=\"0\" max=\"59\">\n\t\t\t\t\t\t<# if ( data.twelveHourFormat ) { #>\n\t\t\t\t\t\t\t<label for=\"{{ idPrefix }}date-time-meridian\" class=\"screen-reader-text\"><?php esc_html_e( 'Meridian' ); ?></label>\n\t\t\t\t\t\t\t<select id=\"{{ idPrefix }}date-time-meridian\" class=\"date-input meridian\" data-component=\"meridian\">\n\t\t\t\t\t\t\t\t<option value=\"am\"><?php esc_html_e( 'AM' ); ?></option>\n\t\t\t\t\t\t\t\t<option value=\"pm\"><?php esc_html_e( 'PM' ); ?></option>\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t\t<p><?php echo $timezone_info['description']; ?></p>\n\t\t\t\t\t</div>\n\t\t\t\t</fieldset>\n\t\t\t<# } #>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Generate options for the month Select.\n\t *\n\t * Based on touch_time().\n\t *\n\t * @since 4.9.0\n\t *\n\t * @see touch_time()\n\t *\n\t * @global WP_Locale $wp_locale WordPress date and time locale object.\n\t *\n\t * @return array\n\t */\n\tpublic function get_month_choices() {\n\t\tglobal $wp_locale;\n\t\t$months = array();\n\t\tfor ( $i = 1; $i < 13; $i++ ) {\n\t\t\t$month_text = $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) );\n\n\t\t\t/* translators: 1: Month number (01, 02, etc.), 2: Month abbreviation. */\n\t\t\t$months[ $i ]['text']  = sprintf( __( '%1$s-%2$s' ), $i, $month_text );\n\t\t\t$months[ $i ]['value'] = $i;\n\t\t}\n\t\treturn array(\n\t\t\t'month_choices' => $months,\n\t\t);\n\t}\n\n\t/**\n\t * Get timezone info.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @return array abbr and description.\n\t */\n\tpublic function get_timezone_info() {\n\t\t$tz_string     = get_option( 'timezone_string' );\n\t\t$timezone_info = array();\n\n\t\tif ( $tz_string ) {\n\t\t\ttry {\n\t\t\t\t$tz = new DateTimezone( $tz_string );\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\t$tz = '';\n\t\t\t}\n\n\t\t\tif ( $tz ) {\n\t\t\t\t$now                   = new DateTime( 'now', $tz );\n\t\t\t\t$formatted_gmt_offset  = $this->format_gmt_offset( $tz->getOffset( $now ) / 3600 );\n\t\t\t\t$tz_name               = str_replace( '_', ' ', $tz->getName() );\n\t\t\t\t$timezone_info['abbr'] = $now->format( 'T' );\n\n\t\t\t\t$timezone_info['description'] = sprintf(\n\t\t\t\t\t/* translators: 1: Timezone name, 2: Timezone abbreviation, 3: UTC abbreviation and offset, 4: UTC offset. */\n\t\t\t\t\t__( 'Your timezone is set to %1$s (%2$s), currently %3$s (Coordinated Universal Time %4$s).' ),\n\t\t\t\t\t$tz_name,\n\t\t\t\t\t'<abbr>' . $timezone_info['abbr'] . '</abbr>',\n\t\t\t\t\t'<abbr>UTC</abbr>' . $formatted_gmt_offset,\n\t\t\t\t\t$formatted_gmt_offset\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$timezone_info['description'] = '';\n\t\t\t}\n\t\t} else {\n\t\t\t$formatted_gmt_offset = $this->format_gmt_offset( intval( get_option( 'gmt_offset', 0 ) ) );\n\n\t\t\t$timezone_info['description'] = sprintf(\n\t\t\t\t/* translators: 1: UTC abbreviation and offset, 2: UTC offset. */\n\t\t\t\t__( 'Your timezone is set to %1$s (Coordinated Universal Time %2$s).' ),\n\t\t\t\t'<abbr>UTC</abbr>' . $formatted_gmt_offset,\n\t\t\t\t$formatted_gmt_offset\n\t\t\t);\n\t\t}\n\n\t\treturn $timezone_info;\n\t}\n\n\t/**\n\t * Format GMT Offset.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @see wp_timezone_choice()\n\t *\n\t * @param float $offset Offset in hours.\n\t * @return string Formatted offset.\n\t */\n\tpublic function format_gmt_offset( $offset ) {\n\t\tif ( 0 <= $offset ) {\n\t\t\t$formatted_offset = '+' . (string) $offset;\n\t\t} else {\n\t\t\t$formatted_offset = (string) $offset;\n\t\t}\n\t\t$formatted_offset = str_replace(\n\t\t\tarray( '.25', '.5', '.75' ),\n\t\t\tarray( ':15', ':30', ':45' ),\n\t\t\t$formatted_offset\n\t\t);\n\t\treturn $formatted_offset;\n\t}\n}\n", "num_lines": 285}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Filter_Setting class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * A setting that is used to filter a value, but will not save the results.\n *\n * Results should be properly handled using another setting or callback.\n *\n * @since 3.4.0\n *\n * @see WP_Customize_Setting\n */\nclass WP_Customize_Filter_Setting extends WP_Customize_Setting {\n\n\t/**\n\t * Saves the value of the setting, using the related API.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param mixed $value The value to update.\n\t */\n\tpublic function update( $value ) {}\n}\n", "num_lines": 30}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Header_Image_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize Header Image Control class.\n *\n * @since 3.4.0\n *\n * @see WP_Customize_Image_Control\n */\nclass WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {\n\t/**\n\t * Customize control type.\n\t *\n\t * @since 4.2.0\n\t * @var string\n\t */\n\tpublic $type = 'header';\n\n\t/**\n\t * Uploaded header images.\n\t *\n\t * @since 3.9.0\n\t * @var string\n\t */\n\tpublic $uploaded_headers;\n\n\t/**\n\t * Default header images.\n\t *\n\t * @since 3.9.0\n\t * @var string\n\t */\n\tpublic $default_headers;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t */\n\tpublic function __construct( $manager ) {\n\t\tparent::__construct(\n\t\t\t$manager,\n\t\t\t'header_image',\n\t\t\tarray(\n\t\t\t\t'label'    => __( 'Header Image' ),\n\t\t\t\t'settings' => array(\n\t\t\t\t\t'default' => 'header_image',\n\t\t\t\t\t'data'    => 'header_image_data',\n\t\t\t\t),\n\t\t\t\t'section'  => 'header_image',\n\t\t\t\t'removed'  => 'remove-header',\n\t\t\t\t'get_url'  => 'get_header_image',\n\t\t\t)\n\t\t);\n\n\t}\n\n\t/**\n\t */\n\tpublic function enqueue() {\n\t\twp_enqueue_media();\n\t\twp_enqueue_script( 'customize-views' );\n\n\t\t$this->prepare_control();\n\n\t\twp_localize_script(\n\t\t\t'customize-views',\n\t\t\t'_wpCustomizeHeader',\n\t\t\tarray(\n\t\t\t\t'data'     => array(\n\t\t\t\t\t'width'         => absint( get_theme_support( 'custom-header', 'width' ) ),\n\t\t\t\t\t'height'        => absint( get_theme_support( 'custom-header', 'height' ) ),\n\t\t\t\t\t'flex-width'    => absint( get_theme_support( 'custom-header', 'flex-width' ) ),\n\t\t\t\t\t'flex-height'   => absint( get_theme_support( 'custom-header', 'flex-height' ) ),\n\t\t\t\t\t'currentImgSrc' => $this->get_current_image_src(),\n\t\t\t\t),\n\t\t\t\t'nonces'   => array(\n\t\t\t\t\t'add'    => wp_create_nonce( 'header-add' ),\n\t\t\t\t\t'remove' => wp_create_nonce( 'header-remove' ),\n\t\t\t\t),\n\t\t\t\t'uploads'  => $this->uploaded_headers,\n\t\t\t\t'defaults' => $this->default_headers,\n\t\t\t)\n\t\t);\n\n\t\tparent::enqueue();\n\t}\n\n\t/**\n\t * @global Custom_Image_Header $custom_image_header\n\t */\n\tpublic function prepare_control() {\n\t\tglobal $custom_image_header;\n\t\tif ( empty( $custom_image_header ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_action( 'customize_controls_print_footer_scripts', array( $this, 'print_header_image_template' ) );\n\n\t\t// Process default headers and uploaded headers.\n\t\t$custom_image_header->process_default_headers();\n\t\t$this->default_headers  = $custom_image_header->get_default_header_images();\n\t\t$this->uploaded_headers = $custom_image_header->get_uploaded_header_images();\n\t}\n\n\t/**\n\t */\n\tpublic function print_header_image_template() {\n\t\t?>\n\t\t<script type=\"text/template\" id=\"tmpl-header-choice\">\n\t\t\t<# if (data.random) { #>\n\t\t\t<button type=\"button\" class=\"button display-options random\">\n\t\t\t\t<span class=\"dashicons dashicons-randomize dice\"></span>\n\t\t\t\t<# if ( data.type === 'uploaded' ) { #>\n\t\t\t\t\t<?php _e( 'Randomize uploaded headers' ); ?>\n\t\t\t\t<# } else if ( data.type === 'default' ) { #>\n\t\t\t\t\t<?php _e( 'Randomize suggested headers' ); ?>\n\t\t\t\t<# } #>\n\t\t\t</button>\n\n\t\t\t<# } else { #>\n\n\t\t\t<button type=\"button\" class=\"choice thumbnail\"\n\t\t\t\tdata-customize-image-value=\"{{{data.header.url}}}\"\n\t\t\t\tdata-customize-header-image-data=\"{{JSON.stringify(data.header)}}\">\n\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Set image' ); ?></span>\n\t\t\t\t<img src=\"{{{data.header.thumbnail_url}}}\" alt=\"{{{data.header.alt_text || data.header.description}}}\">\n\t\t\t</button>\n\n\t\t\t<# if ( data.type === 'uploaded' ) { #>\n\t\t\t\t<button type=\"button\" class=\"dashicons dashicons-no close\"><span class=\"screen-reader-text\"><?php _e( 'Remove image' ); ?></span></button>\n\t\t\t<# } #>\n\n\t\t\t<# } #>\n\t\t</script>\n\n\t\t<script type=\"text/template\" id=\"tmpl-header-current\">\n\t\t\t<# if (data.choice) { #>\n\t\t\t\t<# if (data.random) { #>\n\n\t\t\t<div class=\"placeholder\">\n\t\t\t\t<span class=\"dashicons dashicons-randomize dice\"></span>\n\t\t\t\t<# if ( data.type === 'uploaded' ) { #>\n\t\t\t\t\t<?php _e( 'Randomizing uploaded headers' ); ?>\n\t\t\t\t<# } else if ( data.type === 'default' ) { #>\n\t\t\t\t\t<?php _e( 'Randomizing suggested headers' ); ?>\n\t\t\t\t<# } #>\n\t\t\t</div>\n\n\t\t\t\t<# } else { #>\n\n\t\t\t<img src=\"{{{data.header.thumbnail_url}}}\" alt=\"{{{data.header.alt_text || data.header.description}}}\" />\n\n\t\t\t\t<# } #>\n\t\t\t<# } else { #>\n\n\t\t\t<div class=\"placeholder\">\n\t\t\t\t<?php _e( 'No image set' ); ?>\n\t\t\t</div>\n\n\t\t\t<# } #>\n\t\t</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * @return string|void\n\t */\n\tpublic function get_current_image_src() {\n\t\t$src = $this->value();\n\t\tif ( isset( $this->get_url ) ) {\n\t\t\t$src = call_user_func( $this->get_url, $src );\n\t\t\treturn $src;\n\t\t}\n\t}\n\n\t/**\n\t */\n\tpublic function render_content() {\n\t\t$visibility = $this->get_current_image_src() ? '' : ' style=\"display:none\" ';\n\t\t$width      = absint( get_theme_support( 'custom-header', 'width' ) );\n\t\t$height     = absint( get_theme_support( 'custom-header', 'height' ) );\n\t\t?>\n\t\t<div class=\"customize-control-content\">\n\t\t\t<?php\n\t\t\tif ( current_theme_supports( 'custom-header', 'video' ) ) {\n\t\t\t\techo '<span class=\"customize-control-title\">' . $this->label . '</span>';\n\t\t\t}\n\t\t\t?>\n\t\t\t<div class=\"customize-control-notifications-container\"></div>\n\t\t\t<p class=\"customizer-section-intro customize-control-description\">\n\t\t\t\t<?php\n\t\t\t\tif ( current_theme_supports( 'custom-header', 'video' ) ) {\n\t\t\t\t\t_e( 'Click &#8220;Add new image&#8221; to upload an image file from your computer. Your theme works best with an image that matches the size of your video &#8212; you&#8217;ll be able to crop your image once you upload it for a perfect fit.' );\n\t\t\t\t} elseif ( $width && $height ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Header size in pixels. */\n\t\t\t\t\t\t__( 'Click &#8220;Add new image&#8221; to upload an image file from your computer. Your theme works best with an image with a header size of %s pixels &#8212; you&#8217;ll be able to crop your image once you upload it for a perfect fit.' ),\n\t\t\t\t\t\tsprintf( '<strong>%s &times; %s</strong>', $width, $height )\n\t\t\t\t\t);\n\t\t\t\t} elseif ( $width ) {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Header width in pixels. */\n\t\t\t\t\t\t__( 'Click &#8220;Add new image&#8221; to upload an image file from your computer. Your theme works best with an image with a header width of %s pixels &#8212; you&#8217;ll be able to crop your image once you upload it for a perfect fit.' ),\n\t\t\t\t\t\tsprintf( '<strong>%s</strong>', $width )\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Header height in pixels. */\n\t\t\t\t\t\t__( 'Click &#8220;Add new image&#8221; to upload an image file from your computer. Your theme works best with an image with a header height of %s pixels &#8212; you&#8217;ll be able to crop your image once you upload it for a perfect fit.' ),\n\t\t\t\t\t\tsprintf( '<strong>%s</strong>', $height )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</p>\n\t\t\t<div class=\"current\">\n\t\t\t\t<label for=\"header_image-button\">\n\t\t\t\t\t<span class=\"customize-control-title\">\n\t\t\t\t\t\t<?php _e( 'Current header' ); ?>\n\t\t\t\t\t</span>\n\t\t\t\t</label>\n\t\t\t\t<div class=\"container\">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"actions\">\n\t\t\t\t<?php if ( current_user_can( 'upload_files' ) ) : ?>\n\t\t\t\t<button type=\"button\"<?php echo $visibility; ?> class=\"button remove\" aria-label=\"<?php esc_attr_e( 'Hide header image' ); ?>\"><?php _e( 'Hide image' ); ?></button>\n\t\t\t\t<button type=\"button\" class=\"button new\" id=\"header_image-button\" aria-label=\"<?php esc_attr_e( 'Add new header image' ); ?>\"><?php _e( 'Add new image' ); ?></button>\n\t\t\t\t<?php endif; ?>\n\t\t\t</div>\n\t\t\t<div class=\"choices\">\n\t\t\t\t<span class=\"customize-control-title header-previously-uploaded\">\n\t\t\t\t\t<?php _ex( 'Previously uploaded', 'custom headers' ); ?>\n\t\t\t\t</span>\n\t\t\t\t<div class=\"uploaded\">\n\t\t\t\t\t<div class=\"list\">\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<span class=\"customize-control-title header-default\">\n\t\t\t\t\t<?php _ex( 'Suggested', 'custom headers' ); ?>\n\t\t\t\t</span>\n\t\t\t\t<div class=\"default\">\n\t\t\t\t\t<div class=\"list\">\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}\n}\n", "num_lines": 260}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Header_Image_Setting class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * A setting that is used to filter a value, but will not save the results.\n *\n * Results should be properly handled using another setting or callback.\n *\n * @since 3.4.0\n *\n * @see WP_Customize_Setting\n */\nfinal class WP_Customize_Header_Image_Setting extends WP_Customize_Setting {\n\tpublic $id = 'header_image_data';\n\n\t/**\n\t * @since 3.4.0\n\t *\n\t * @global Custom_Image_Header $custom_image_header\n\t *\n\t * @param $value\n\t */\n\tpublic function update( $value ) {\n\t\tglobal $custom_image_header;\n\n\t\t// If _custom_header_background_just_in_time() fails to initialize $custom_image_header when not is_admin().\n\t\tif ( empty( $custom_image_header ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/class-custom-image-header.php';\n\t\t\t$args                   = get_theme_support( 'custom-header' );\n\t\t\t$admin_head_callback    = isset( $args[0]['admin-head-callback'] ) ? $args[0]['admin-head-callback'] : null;\n\t\t\t$admin_preview_callback = isset( $args[0]['admin-preview-callback'] ) ? $args[0]['admin-preview-callback'] : null;\n\t\t\t$custom_image_header    = new Custom_Image_Header( $admin_head_callback, $admin_preview_callback );\n\t\t}\n\n\t\t// If the value doesn't exist (removed or random),\n\t\t// use the header_image value.\n\t\tif ( ! $value ) {\n\t\t\t$value = $this->manager->get_setting( 'header_image' )->post_value();\n\t\t}\n\n\t\tif ( is_array( $value ) && isset( $value['choice'] ) ) {\n\t\t\t$custom_image_header->set_header_image( $value['choice'] );\n\t\t} else {\n\t\t\t$custom_image_header->set_header_image( $value );\n\t\t}\n\t}\n}\n", "num_lines": 54}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Image_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize Image Control class.\n *\n * @since 3.4.0\n *\n * @see WP_Customize_Upload_Control\n */\nclass WP_Customize_Image_Control extends WP_Customize_Upload_Control {\n\tpublic $type      = 'image';\n\tpublic $mime_type = 'image';\n\n\t/**\n\t * @since 3.4.2\n\t * @deprecated 4.1.0\n\t */\n\tpublic function prepare_control() {}\n\n\t/**\n\t * @since 3.4.0\n\t * @deprecated 4.1.0\n\t *\n\t * @param string $id\n\t * @param string $label\n\t * @param mixed  $callback\n\t */\n\tpublic function add_tab( $id, $label, $callback ) {\n\t\t_deprecated_function( __METHOD__, '4.1.0' );\n\t}\n\n\t/**\n\t * @since 3.4.0\n\t * @deprecated 4.1.0\n\t *\n\t * @param string $id\n\t */\n\tpublic function remove_tab( $id ) {\n\t\t_deprecated_function( __METHOD__, '4.1.0' );\n\t}\n\n\t/**\n\t * @since 3.4.0\n\t * @deprecated 4.1.0\n\t *\n\t * @param string $url\n\t * @param string $thumbnail_url\n\t */\n\tpublic function print_tab_image( $url, $thumbnail_url = null ) {\n\t\t_deprecated_function( __METHOD__, '4.1.0' );\n\t}\n}\n", "num_lines": 60}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Media_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize Media Control class.\n *\n * @since 4.2.0\n *\n * @see WP_Customize_Control\n */\nclass WP_Customize_Media_Control extends WP_Customize_Control {\n\t/**\n\t * Control type.\n\t *\n\t * @since 4.2.0\n\t * @var string\n\t */\n\tpublic $type = 'media';\n\n\t/**\n\t * Media control mime type.\n\t *\n\t * @since 4.2.0\n\t * @var string\n\t */\n\tpublic $mime_type = '';\n\n\t/**\n\t * Button labels.\n\t *\n\t * @since 4.2.0\n\t * @var array\n\t */\n\tpublic $button_labels = array();\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.1.0\n\t * @since 4.2.0 Moved from WP_Customize_Upload_Control.\n\t *\n\t * @see WP_Customize_Control::__construct()\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t * @param string               $id      Control ID.\n\t * @param array                $args    Optional. Arguments to override class property defaults.\n\t *                                      See WP_Customize_Control::__construct() for information\n\t *                                      on accepted arguments. Default empty array.\n\t */\n\tpublic function __construct( $manager, $id, $args = array() ) {\n\t\tparent::__construct( $manager, $id, $args );\n\n\t\t$this->button_labels = wp_parse_args( $this->button_labels, $this->get_default_button_labels() );\n\t}\n\n\t/**\n\t * Enqueue control related scripts/styles.\n\t *\n\t * @since 3.4.0\n\t * @since 4.2.0 Moved from WP_Customize_Upload_Control.\n\t */\n\tpublic function enqueue() {\n\t\twp_enqueue_media();\n\t}\n\n\t/**\n\t * Refresh the parameters passed to the JavaScript via JSON.\n\t *\n\t * @since 3.4.0\n\t * @since 4.2.0 Moved from WP_Customize_Upload_Control.\n\t *\n\t * @see WP_Customize_Control::to_json()\n\t */\n\tpublic function to_json() {\n\t\tparent::to_json();\n\t\t$this->json['label']         = html_entity_decode( $this->label, ENT_QUOTES, get_bloginfo( 'charset' ) );\n\t\t$this->json['mime_type']     = $this->mime_type;\n\t\t$this->json['button_labels'] = $this->button_labels;\n\t\t$this->json['canUpload']     = current_user_can( 'upload_files' );\n\n\t\t$value = $this->value();\n\n\t\tif ( is_object( $this->setting ) ) {\n\t\t\tif ( $this->setting->default ) {\n\t\t\t\t// Fake an attachment model - needs all fields used by template.\n\t\t\t\t// Note that the default value must be a URL, NOT an attachment ID.\n\t\t\t\t$ext  = substr( $this->setting->default, -3 );\n\t\t\t\t$type = in_array( $ext, array( 'jpg', 'png', 'gif', 'bmp' ), true ) ? 'image' : 'document';\n\n\t\t\t\t$default_attachment = array(\n\t\t\t\t\t'id'    => 1,\n\t\t\t\t\t'url'   => $this->setting->default,\n\t\t\t\t\t'type'  => $type,\n\t\t\t\t\t'icon'  => wp_mime_type_icon( $type ),\n\t\t\t\t\t'title' => wp_basename( $this->setting->default ),\n\t\t\t\t);\n\n\t\t\t\tif ( 'image' === $type ) {\n\t\t\t\t\t$default_attachment['sizes'] = array(\n\t\t\t\t\t\t'full' => array( 'url' => $this->setting->default ),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$this->json['defaultAttachment'] = $default_attachment;\n\t\t\t}\n\n\t\t\tif ( $value && $this->setting->default && $value === $this->setting->default ) {\n\t\t\t\t// Set the default as the attachment.\n\t\t\t\t$this->json['attachment'] = $this->json['defaultAttachment'];\n\t\t\t} elseif ( $value ) {\n\t\t\t\t$this->json['attachment'] = wp_prepare_attachment_for_js( $value );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Don't render any content for this control from PHP.\n\t *\n\t * @since 3.4.0\n\t * @since 4.2.0 Moved from WP_Customize_Upload_Control.\n\t *\n\t * @see WP_Customize_Media_Control::content_template()\n\t */\n\tpublic function render_content() {}\n\n\t/**\n\t * Render a JS template for the content of the media control.\n\t *\n\t * @since 4.1.0\n\t * @since 4.2.0 Moved from WP_Customize_Upload_Control.\n\t */\n\tpublic function content_template() {\n\t\t?>\n\t\t<#\n\t\tvar descriptionId = _.uniqueId( 'customize-media-control-description-' );\n\t\tvar describedByAttr = data.description ? ' aria-describedby=\"' + descriptionId + '\" ' : '';\n\t\t#>\n\t\t<# if ( data.label ) { #>\n\t\t\t<span class=\"customize-control-title\">{{ data.label }}</span>\n\t\t<# } #>\n\t\t<div class=\"customize-control-notifications-container\"></div>\n\t\t<# if ( data.description ) { #>\n\t\t\t<span id=\"{{ descriptionId }}\" class=\"description customize-control-description\">{{{ data.description }}}</span>\n\t\t<# } #>\n\n\t\t<# if ( data.attachment && data.attachment.id ) { #>\n\t\t\t<div class=\"attachment-media-view attachment-media-view-{{ data.attachment.type }} {{ data.attachment.orientation }}\">\n\t\t\t\t<div class=\"thumbnail thumbnail-{{ data.attachment.type }}\">\n\t\t\t\t\t<# if ( 'image' === data.attachment.type && data.attachment.sizes && data.attachment.sizes.medium ) { #>\n\t\t\t\t\t\t<img class=\"attachment-thumb\" src=\"{{ data.attachment.sizes.medium.url }}\" draggable=\"false\" alt=\"\" />\n\t\t\t\t\t<# } else if ( 'image' === data.attachment.type && data.attachment.sizes && data.attachment.sizes.full ) { #>\n\t\t\t\t\t\t<img class=\"attachment-thumb\" src=\"{{ data.attachment.sizes.full.url }}\" draggable=\"false\" alt=\"\" />\n\t\t\t\t\t<# } else if ( 'audio' === data.attachment.type ) { #>\n\t\t\t\t\t\t<# if ( data.attachment.image && data.attachment.image.src && data.attachment.image.src !== data.attachment.icon ) { #>\n\t\t\t\t\t\t\t<img src=\"{{ data.attachment.image.src }}\" class=\"thumbnail\" draggable=\"false\" alt=\"\" />\n\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t<img src=\"{{ data.attachment.icon }}\" class=\"attachment-thumb type-icon\" draggable=\"false\" alt=\"\" />\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t\t<p class=\"attachment-meta attachment-meta-title\">&#8220;{{ data.attachment.title }}&#8221;</p>\n\t\t\t\t\t\t<# if ( data.attachment.album || data.attachment.meta.album ) { #>\n\t\t\t\t\t\t<p class=\"attachment-meta\"><em>{{ data.attachment.album || data.attachment.meta.album }}</em></p>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t\t<# if ( data.attachment.artist || data.attachment.meta.artist ) { #>\n\t\t\t\t\t\t<p class=\"attachment-meta\">{{ data.attachment.artist || data.attachment.meta.artist }}</p>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t\t<audio style=\"visibility: hidden\" controls class=\"wp-audio-shortcode\" width=\"100%\" preload=\"none\">\n\t\t\t\t\t\t\t<source type=\"{{ data.attachment.mime }}\" src=\"{{ data.attachment.url }}\"/>\n\t\t\t\t\t\t</audio>\n\t\t\t\t\t<# } else if ( 'video' === data.attachment.type ) { #>\n\t\t\t\t\t\t<div class=\"wp-media-wrapper wp-video\">\n\t\t\t\t\t\t\t<video controls=\"controls\" class=\"wp-video-shortcode\" preload=\"metadata\"\n\t\t\t\t\t\t\t\t<# if ( data.attachment.image && data.attachment.image.src !== data.attachment.icon ) { #>poster=\"{{ data.attachment.image.src }}\"<# } #>>\n\t\t\t\t\t\t\t\t<source type=\"{{ data.attachment.mime }}\" src=\"{{ data.attachment.url }}\"/>\n\t\t\t\t\t\t\t</video>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t<img class=\"attachment-thumb type-icon icon\" src=\"{{ data.attachment.icon }}\" draggable=\"false\" alt=\"\" />\n\t\t\t\t\t\t<p class=\"attachment-title\">{{ data.attachment.title }}</p>\n\t\t\t\t\t<# } #>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"actions\">\n\t\t\t\t\t<# if ( data.canUpload ) { #>\n\t\t\t\t\t<button type=\"button\" class=\"button remove-button\">{{ data.button_labels.remove }}</button>\n\t\t\t\t\t<button type=\"button\" class=\"button upload-button control-focus\" {{{ describedByAttr }}}>{{ data.button_labels.change }}</button>\n\t\t\t\t\t<# } #>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<# } else { #>\n\t\t\t<div class=\"attachment-media-view\">\n\t\t\t\t<# if ( data.canUpload ) { #>\n\t\t\t\t\t<button type=\"button\" class=\"upload-button button-add-media\" {{{ describedByAttr }}}>{{ data.button_labels.select }}</button>\n\t\t\t\t<# } #>\n\t\t\t\t<div class=\"actions\">\n\t\t\t\t\t<# if ( data.defaultAttachment ) { #>\n\t\t\t\t\t\t<button type=\"button\" class=\"button default-button\">{{ data.button_labels['default'] }}</button>\n\t\t\t\t\t<# } #>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<# } #>\n\t\t<?php\n\t}\n\n\t/**\n\t * Get default button labels.\n\t *\n\t * Provides an array of the default button labels based on the mime type of the current control.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @return string[] An associative array of default button labels keyed by the button name.\n\t */\n\tpublic function get_default_button_labels() {\n\t\t// Get just the mime type and strip the mime subtype if present.\n\t\t$mime_type = ! empty( $this->mime_type ) ? strtok( ltrim( $this->mime_type, '/' ), '/' ) : 'default';\n\n\t\tswitch ( $mime_type ) {\n\t\t\tcase 'video':\n\t\t\t\treturn array(\n\t\t\t\t\t'select'       => __( 'Select video' ),\n\t\t\t\t\t'change'       => __( 'Change video' ),\n\t\t\t\t\t'default'      => __( 'Default' ),\n\t\t\t\t\t'remove'       => __( 'Remove' ),\n\t\t\t\t\t'placeholder'  => __( 'No video selected' ),\n\t\t\t\t\t'frame_title'  => __( 'Select video' ),\n\t\t\t\t\t'frame_button' => __( 'Choose video' ),\n\t\t\t\t);\n\t\t\tcase 'audio':\n\t\t\t\treturn array(\n\t\t\t\t\t'select'       => __( 'Select audio' ),\n\t\t\t\t\t'change'       => __( 'Change audio' ),\n\t\t\t\t\t'default'      => __( 'Default' ),\n\t\t\t\t\t'remove'       => __( 'Remove' ),\n\t\t\t\t\t'placeholder'  => __( 'No audio selected' ),\n\t\t\t\t\t'frame_title'  => __( 'Select audio' ),\n\t\t\t\t\t'frame_button' => __( 'Choose audio' ),\n\t\t\t\t);\n\t\t\tcase 'image':\n\t\t\t\treturn array(\n\t\t\t\t\t'select'       => __( 'Select image' ),\n\t\t\t\t\t'site_icon'    => __( 'Select site icon' ),\n\t\t\t\t\t'change'       => __( 'Change image' ),\n\t\t\t\t\t'default'      => __( 'Default' ),\n\t\t\t\t\t'remove'       => __( 'Remove' ),\n\t\t\t\t\t'placeholder'  => __( 'No image selected' ),\n\t\t\t\t\t'frame_title'  => __( 'Select image' ),\n\t\t\t\t\t'frame_button' => __( 'Choose image' ),\n\t\t\t\t);\n\t\t\tdefault:\n\t\t\t\treturn array(\n\t\t\t\t\t'select'       => __( 'Select file' ),\n\t\t\t\t\t'change'       => __( 'Change file' ),\n\t\t\t\t\t'default'      => __( 'Default' ),\n\t\t\t\t\t'remove'       => __( 'Remove' ),\n\t\t\t\t\t'placeholder'  => __( 'No file selected' ),\n\t\t\t\t\t'frame_title'  => __( 'Select file' ),\n\t\t\t\t\t'frame_button' => __( 'Choose file' ),\n\t\t\t\t);\n\t\t} // End switch().\n\t}\n}\n", "num_lines": 267}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Nav_Menu_Auto_Add_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize control to represent the auto_add field for a given menu.\n *\n * @since 4.3.0\n *\n * @see WP_Customize_Control\n */\nclass WP_Customize_Nav_Menu_Auto_Add_Control extends WP_Customize_Control {\n\n\t/**\n\t * Type of control, used by JS.\n\t *\n\t * @since 4.3.0\n\t * @var string\n\t */\n\tpublic $type = 'nav_menu_auto_add';\n\n\t/**\n\t * No-op since we're using JS template.\n\t *\n\t * @since 4.3.0\n\t */\n\tprotected function render_content() {}\n\n\t/**\n\t * Render the Underscore template for this control.\n\t *\n\t * @since 4.3.0\n\t */\n\tprotected function content_template() {\n\t\t?>\n\t\t<# var elementId = _.uniqueId( 'customize-nav-menu-auto-add-control-' ); #>\n\t\t<span class=\"customize-control-title\"><?php _e( 'Menu Options' ); ?></span>\n\t\t<span class=\"customize-inside-control-row\">\n\t\t\t<input id=\"{{ elementId }}\" type=\"checkbox\" class=\"auto_add\" />\n\t\t\t<label for=\"{{ elementId }}\">\n\t\t\t\t<?php _e( 'Automatically add new top-level pages to this menu' ); ?>\n\t\t\t</label>\n\t\t</span>\n\t\t<?php\n\t}\n}\n", "num_lines": 52}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Nav_Menu_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize Nav Menu Control Class.\n *\n * @since 4.3.0\n *\n * @see WP_Customize_Control\n */\nclass WP_Customize_Nav_Menu_Control extends WP_Customize_Control {\n\n\t/**\n\t * Control type.\n\t *\n\t * @since 4.3.0\n\t * @var string\n\t */\n\tpublic $type = 'nav_menu';\n\n\t/**\n\t * Don't render the control's content - it uses a JS template instead.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function render_content() {}\n\n\t/**\n\t * JS/Underscore template for the control UI.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function content_template() {\n\t\t$add_items = __( 'Add Items' );\n\t\t?>\n\t\t<p class=\"new-menu-item-invitation\">\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: \"Add Items\" button text. */\n\t\t\t\t__( 'Time to add some links! Click &#8220;%s&#8221; to start putting pages, categories, and custom links in your menu. Add as many things as you&#8217;d like.' ),\n\t\t\t\t$add_items\n\t\t\t);\n\t\t\t?>\n\t\t</p>\n\t\t<div class=\"customize-control-nav_menu-buttons\">\n\t\t\t<button type=\"button\" class=\"button add-new-menu-item\" aria-label=\"<?php esc_attr_e( 'Add or remove menu items' ); ?>\" aria-expanded=\"false\" aria-controls=\"available-menu-items\">\n\t\t\t\t<?php echo $add_items; ?>\n\t\t\t</button>\n\t\t\t<button type=\"button\" class=\"button-link reorder-toggle\" aria-label=\"<?php esc_attr_e( 'Reorder menu items' ); ?>\" aria-describedby=\"reorder-items-desc-{{ data.menu_id }}\">\n\t\t\t\t<span class=\"reorder\"><?php _e( 'Reorder' ); ?></span>\n\t\t\t\t<span class=\"reorder-done\"><?php _e( 'Done' ); ?></span>\n\t\t\t</button>\n\t\t</div>\n\t\t<p class=\"screen-reader-text\" id=\"reorder-items-desc-{{ data.menu_id }}\"><?php _e( 'When in reorder mode, additional controls to reorder menu items will be available in the items list above.' ); ?></p>\n\t\t<?php\n\t}\n\n\t/**\n\t * Return parameters for this control.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @return array Exported parameters.\n\t */\n\tpublic function json() {\n\t\t$exported            = parent::json();\n\t\t$exported['menu_id'] = $this->setting->term_id;\n\n\t\treturn $exported;\n\t}\n}\n", "num_lines": 78}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Nav_Menu_Item_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize control to represent the name field for a given menu.\n *\n * @since 4.3.0\n *\n * @see WP_Customize_Control\n */\nclass WP_Customize_Nav_Menu_Item_Control extends WP_Customize_Control {\n\n\t/**\n\t * Control type.\n\t *\n\t * @since 4.3.0\n\t * @var string\n\t */\n\tpublic $type = 'nav_menu_item';\n\n\t/**\n\t * The nav menu item setting.\n\t *\n\t * @since 4.3.0\n\t * @var WP_Customize_Nav_Menu_Item_Setting\n\t */\n\tpublic $setting;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see WP_Customize_Control::__construct()\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t * @param string               $id      The control ID.\n\t * @param array                $args    Optional. Arguments to override class property defaults.\n\t *                                      See WP_Customize_Control::__construct() for information\n\t *                                      on accepted arguments. Default empty array.\n\t */\n\tpublic function __construct( $manager, $id, $args = array() ) {\n\t\tparent::__construct( $manager, $id, $args );\n\t}\n\n\t/**\n\t * Don't render the control's content - it's rendered with a JS template.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function render_content() {}\n\n\t/**\n\t * JS/Underscore template for the control UI.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function content_template() {\n\t\t?>\n\t\t<div class=\"menu-item-bar\">\n\t\t\t<div class=\"menu-item-handle\">\n\t\t\t\t<span class=\"item-type\" aria-hidden=\"true\">{{ data.item_type_label }}</span>\n\t\t\t\t<span class=\"item-title\" aria-hidden=\"true\">\n\t\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t\t\t<span class=\"menu-item-title<# if ( ! data.title && ! data.original_title ) { #> no-title<# } #>\">{{ data.title || data.original_title || wp.customize.Menus.data.l10n.untitled }}</span>\n\t\t\t\t</span>\n\t\t\t\t<span class=\"item-controls\">\n\t\t\t\t\t<button type=\"button\" class=\"button-link item-edit\" aria-expanded=\"false\"><span class=\"screen-reader-text\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t/* translators: 1: Title of a menu item, 2: Type of a menu item. */\n\t\t\t\t\t\tprintf( __( 'Edit menu item: %1$s (%2$s)' ), '{{ data.title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.item_type_label }}' );\n\t\t\t\t\t?>\n\t\t\t\t\t</span><span class=\"toggle-indicator\" aria-hidden=\"true\"></span></button>\n\t\t\t\t\t<button type=\"button\" class=\"button-link item-delete submitdelete deletion\"><span class=\"screen-reader-text\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t/* translators: 1: Title of a menu item, 2: Type of a menu item. */\n\t\t\t\t\t\tprintf( __( 'Remove Menu Item: %1$s (%2$s)' ), '{{ data.title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.item_type_label }}' );\n\t\t\t\t\t?>\n\t\t\t\t\t</span></button>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"menu-item-settings\" id=\"menu-item-settings-{{ data.menu_item_id }}\">\n\t\t\t<# if ( 'custom' === data.item_type ) { #>\n\t\t\t<p class=\"field-url description description-thin\">\n\t\t\t\t<label for=\"edit-menu-item-url-{{ data.menu_item_id }}\">\n\t\t\t\t\t<?php _e( 'URL' ); ?><br />\n\t\t\t\t\t<input class=\"widefat code edit-menu-item-url\" type=\"text\" id=\"edit-menu-item-url-{{ data.menu_item_id }}\" name=\"menu-item-url\" />\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t<# } #>\n\t\t\t<p class=\"description description-thin\">\n\t\t\t\t<label for=\"edit-menu-item-title-{{ data.menu_item_id }}\">\n\t\t\t\t\t<?php _e( 'Navigation Label' ); ?><br />\n\t\t\t\t\t<input type=\"text\" id=\"edit-menu-item-title-{{ data.menu_item_id }}\" placeholder=\"{{ data.original_title }}\" class=\"widefat edit-menu-item-title\" name=\"menu-item-title\" />\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p class=\"field-link-target description description-thin\">\n\t\t\t\t<label for=\"edit-menu-item-target-{{ data.menu_item_id }}\">\n\t\t\t\t\t<input type=\"checkbox\" id=\"edit-menu-item-target-{{ data.menu_item_id }}\" class=\"edit-menu-item-target\" value=\"_blank\" name=\"menu-item-target\" />\n\t\t\t\t\t<?php _e( 'Open link in a new tab' ); ?>\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p class=\"field-title-attribute field-attr-title description description-thin\">\n\t\t\t\t<label for=\"edit-menu-item-attr-title-{{ data.menu_item_id }}\">\n\t\t\t\t\t<?php _e( 'Title Attribute' ); ?><br />\n\t\t\t\t\t<input type=\"text\" id=\"edit-menu-item-attr-title-{{ data.menu_item_id }}\" class=\"widefat edit-menu-item-attr-title\" name=\"menu-item-attr-title\" />\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p class=\"field-css-classes description description-thin\">\n\t\t\t\t<label for=\"edit-menu-item-classes-{{ data.menu_item_id }}\">\n\t\t\t\t\t<?php _e( 'CSS Classes' ); ?><br />\n\t\t\t\t\t<input type=\"text\" id=\"edit-menu-item-classes-{{ data.menu_item_id }}\" class=\"widefat code edit-menu-item-classes\" name=\"menu-item-classes\" />\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p class=\"field-xfn description description-thin\">\n\t\t\t\t<label for=\"edit-menu-item-xfn-{{ data.menu_item_id }}\">\n\t\t\t\t\t<?php _e( 'Link Relationship (XFN)' ); ?><br />\n\t\t\t\t\t<input type=\"text\" id=\"edit-menu-item-xfn-{{ data.menu_item_id }}\" class=\"widefat code edit-menu-item-xfn\" name=\"menu-item-xfn\" />\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t\t<p class=\"field-description description description-thin\">\n\t\t\t\t<label for=\"edit-menu-item-description-{{ data.menu_item_id }}\">\n\t\t\t\t\t<?php _e( 'Description' ); ?><br />\n\t\t\t\t\t<textarea id=\"edit-menu-item-description-{{ data.menu_item_id }}\" class=\"widefat edit-menu-item-description\" rows=\"3\" cols=\"20\" name=\"menu-item-description\">{{ data.description }}</textarea>\n\t\t\t\t\t<span class=\"description\"><?php _e( 'The description will be displayed in the menu if the current theme supports it.' ); ?></span>\n\t\t\t\t</label>\n\t\t\t</p>\n\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * Fires at the end of the form field template for nav menu items in the customizer.\n\t\t\t *\n\t\t\t * Additional fields can be rendered here and managed in JavaScript.\n\t\t\t *\n\t\t\t * @since 5.4.0\n\t\t\t */\n\t\t\tdo_action( 'wp_nav_menu_item_custom_fields_customize_template' );\n\t\t\t?>\n\n\t\t\t<div class=\"menu-item-actions description-thin submitbox\">\n\t\t\t\t<# if ( ( 'post_type' === data.item_type || 'taxonomy' === data.item_type ) && '' !== data.original_title ) { #>\n\t\t\t\t<p class=\"link-to-original\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t/* translators: Nav menu item original title. %s: Original title. */\n\t\t\t\t\t\tprintf( __( 'Original: %s' ), '<a class=\"original-link\" href=\"{{ data.url }}\">{{ data.original_title }}</a>' );\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t\t<# } #>\n\n\t\t\t\t<button type=\"button\" class=\"button-link button-link-delete item-delete submitdelete deletion\"><?php _e( 'Remove' ); ?></button>\n\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t</div>\n\t\t\t<input type=\"hidden\" name=\"menu-item-db-id[{{ data.menu_item_id }}]\" class=\"menu-item-data-db-id\" value=\"{{ data.menu_item_id }}\" />\n\t\t\t<input type=\"hidden\" name=\"menu-item-parent-id[{{ data.menu_item_id }}]\" class=\"menu-item-data-parent-id\" value=\"{{ data.parent }}\" />\n\t\t</div><!-- .menu-item-settings-->\n\t\t<ul class=\"menu-item-transport\"></ul>\n\t\t<?php\n\t}\n\n\t/**\n\t * Return parameters for this control.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @return array Exported parameters.\n\t */\n\tpublic function json() {\n\t\t$exported                 = parent::json();\n\t\t$exported['menu_item_id'] = $this->setting->post_id;\n\n\t\treturn $exported;\n\t}\n}\n", "num_lines": 182}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Nav_Menu_Item_Setting class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize Setting to represent a nav_menu.\n *\n * Subclass of WP_Customize_Setting to represent a nav_menu taxonomy term, and\n * the IDs for the nav_menu_items associated with the nav menu.\n *\n * @since 4.3.0\n *\n * @see WP_Customize_Setting\n */\nclass WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting {\n\n\tconst ID_PATTERN = '/^nav_menu_item\\[(?P<id>-?\\d+)\\]$/';\n\n\tconst POST_TYPE = 'nav_menu_item';\n\n\tconst TYPE = 'nav_menu_item';\n\n\t/**\n\t * Setting type.\n\t *\n\t * @since 4.3.0\n\t * @var string\n\t */\n\tpublic $type = self::TYPE;\n\n\t/**\n\t * Default setting value.\n\t *\n\t * @since 4.3.0\n\t * @var array\n\t *\n\t * @see wp_setup_nav_menu_item()\n\t */\n\tpublic $default = array(\n\t\t// The $menu_item_data for wp_update_nav_menu_item().\n\t\t'object_id'        => 0,\n\t\t'object'           => '', // Taxonomy name.\n\t\t'menu_item_parent' => 0, // A.K.A. menu-item-parent-id; note that post_parent is different, and not included.\n\t\t'position'         => 0, // A.K.A. menu_order.\n\t\t'type'             => 'custom', // Note that type_label is not included here.\n\t\t'title'            => '',\n\t\t'url'              => '',\n\t\t'target'           => '',\n\t\t'attr_title'       => '',\n\t\t'description'      => '',\n\t\t'classes'          => '',\n\t\t'xfn'              => '',\n\t\t'status'           => 'publish',\n\t\t'original_title'   => '',\n\t\t'nav_menu_term_id' => 0, // This will be supplied as the $menu_id arg for wp_update_nav_menu_item().\n\t\t'_invalid'         => false,\n\t);\n\n\t/**\n\t * Default transport.\n\t *\n\t * @since 4.3.0\n\t * @since 4.5.0 Default changed to 'refresh'\n\t * @var string\n\t */\n\tpublic $transport = 'refresh';\n\n\t/**\n\t * The post ID represented by this setting instance. This is the db_id.\n\t *\n\t * A negative value represents a placeholder ID for a new menu not yet saved.\n\t *\n\t * @since 4.3.0\n\t * @var int\n\t */\n\tpublic $post_id;\n\n\t/**\n\t * Storage of pre-setup menu item to prevent wasted calls to wp_setup_nav_menu_item().\n\t *\n\t * @since 4.3.0\n\t * @var array|null\n\t */\n\tprotected $value;\n\n\t/**\n\t * Previous (placeholder) post ID used before creating a new menu item.\n\t *\n\t * This value will be exported to JS via the customize_save_response filter\n\t * so that JavaScript can update the settings to refer to the newly-assigned\n\t * post ID. This value is always negative to indicate it does not refer to\n\t * a real post.\n\t *\n\t * @since 4.3.0\n\t * @var int\n\t *\n\t * @see WP_Customize_Nav_Menu_Item_Setting::update()\n\t * @see WP_Customize_Nav_Menu_Item_Setting::amend_customize_save_response()\n\t */\n\tpublic $previous_post_id;\n\n\t/**\n\t * When previewing or updating a menu item, this stores the previous nav_menu_term_id\n\t * which ensures that we can apply the proper filters.\n\t *\n\t * @since 4.3.0\n\t * @var int\n\t */\n\tpublic $original_nav_menu_term_id;\n\n\t/**\n\t * Whether or not update() was called.\n\t *\n\t * @since 4.3.0\n\t * @var bool\n\t */\n\tprotected $is_updated = false;\n\n\t/**\n\t * Status for calling the update method, used in customize_save_response filter.\n\t *\n\t * See {@see 'customize_save_response'}.\n\t *\n\t * When status is inserted, the placeholder post ID is stored in $previous_post_id.\n\t * When status is error, the error is stored in $update_error.\n\t *\n\t * @since 4.3.0\n\t * @var string updated|inserted|deleted|error\n\t *\n\t * @see WP_Customize_Nav_Menu_Item_Setting::update()\n\t * @see WP_Customize_Nav_Menu_Item_Setting::amend_customize_save_response()\n\t */\n\tpublic $update_status;\n\n\t/**\n\t * Any error object returned by wp_update_nav_menu_item() when setting is updated.\n\t *\n\t * @since 4.3.0\n\t * @var WP_Error\n\t *\n\t * @see WP_Customize_Nav_Menu_Item_Setting::update()\n\t * @see WP_Customize_Nav_Menu_Item_Setting::amend_customize_save_response()\n\t */\n\tpublic $update_error;\n\n\t/**\n\t * Constructor.\n\t *\n\t * Any supplied $args override class property defaults.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @throws Exception If $id is not valid for this setting type.\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t * @param string               $id      A specific ID of the setting.\n\t *                                      Can be a theme mod or option name.\n\t * @param array                $args    Optional. Setting arguments.\n\t */\n\tpublic function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {\n\t\tif ( empty( $manager->nav_menus ) ) {\n\t\t\tthrow new Exception( 'Expected WP_Customize_Manager::$nav_menus to be set.' );\n\t\t}\n\n\t\tif ( ! preg_match( self::ID_PATTERN, $id, $matches ) ) {\n\t\t\tthrow new Exception( \"Illegal widget setting ID: $id\" );\n\t\t}\n\n\t\t$this->post_id = intval( $matches['id'] );\n\t\tadd_action( 'wp_update_nav_menu_item', array( $this, 'flush_cached_value' ), 10, 2 );\n\n\t\tparent::__construct( $manager, $id, $args );\n\n\t\t// Ensure that an initially-supplied value is valid.\n\t\tif ( isset( $this->value ) ) {\n\t\t\t$this->populate_value();\n\t\t\tforeach ( array_diff( array_keys( $this->default ), array_keys( $this->value ) ) as $missing ) {\n\t\t\t\tthrow new Exception( \"Supplied nav_menu_item value missing property: $missing\" );\n\t\t\t}\n\t\t}\n\n\t}\n\n\t/**\n\t * Clear the cached value when this nav menu item is updated.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param int $menu_id       The term ID for the menu.\n\t * @param int $menu_item_id  The post ID for the menu item.\n\t */\n\tpublic function flush_cached_value( $menu_id, $menu_item_id ) {\n\t\tunset( $menu_id );\n\t\tif ( $menu_item_id === $this->post_id ) {\n\t\t\t$this->value = null;\n\t\t}\n\t}\n\n\t/**\n\t * Get the instance data for a given nav_menu_item setting.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see wp_setup_nav_menu_item()\n\t *\n\t * @return array|false Instance data array, or false if the item is marked for deletion.\n\t */\n\tpublic function value() {\n\t\tif ( $this->is_previewed && get_current_blog_id() === $this->_previewed_blog_id ) {\n\t\t\t$undefined  = new stdClass(); // Symbol.\n\t\t\t$post_value = $this->post_value( $undefined );\n\n\t\t\tif ( $undefined === $post_value ) {\n\t\t\t\t$value = $this->_original_value;\n\t\t\t} else {\n\t\t\t\t$value = $post_value;\n\t\t\t}\n\t\t\tif ( ! empty( $value ) && empty( $value['original_title'] ) ) {\n\t\t\t\t$value['original_title'] = $this->get_original_title( (object) $value );\n\t\t\t}\n\t\t} elseif ( isset( $this->value ) ) {\n\t\t\t$value = $this->value;\n\t\t} else {\n\t\t\t$value = false;\n\n\t\t\t// Note that a ID of less than one indicates a nav_menu not yet inserted.\n\t\t\tif ( $this->post_id > 0 ) {\n\t\t\t\t$post = get_post( $this->post_id );\n\t\t\t\tif ( $post && self::POST_TYPE === $post->post_type ) {\n\t\t\t\t\t$is_title_empty = empty( $post->post_title );\n\t\t\t\t\t$value          = (array) wp_setup_nav_menu_item( $post );\n\t\t\t\t\tif ( $is_title_empty ) {\n\t\t\t\t\t\t$value['title'] = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! is_array( $value ) ) {\n\t\t\t\t$value = $this->default;\n\t\t\t}\n\n\t\t\t// Cache the value for future calls to avoid having to re-call wp_setup_nav_menu_item().\n\t\t\t$this->value = $value;\n\t\t\t$this->populate_value();\n\t\t\t$value = $this->value;\n\t\t}\n\n\t\tif ( ! empty( $value ) && empty( $value['type_label'] ) ) {\n\t\t\t$value['type_label'] = $this->get_type_label( (object) $value );\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Get original title.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param object $item Nav menu item.\n\t * @return string The original title.\n\t */\n\tprotected function get_original_title( $item ) {\n\t\t$original_title = '';\n\t\tif ( 'post_type' === $item->type && ! empty( $item->object_id ) ) {\n\t\t\t$original_object = get_post( $item->object_id );\n\t\t\tif ( $original_object ) {\n\t\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t\t$original_title = apply_filters( 'the_title', $original_object->post_title, $original_object->ID );\n\n\t\t\t\tif ( '' === $original_title ) {\n\t\t\t\t\t/* translators: %d: ID of a post. */\n\t\t\t\t\t$original_title = sprintf( __( '#%d (no title)' ), $original_object->ID );\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( 'taxonomy' === $item->type && ! empty( $item->object_id ) ) {\n\t\t\t$original_term_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' );\n\t\t\tif ( ! is_wp_error( $original_term_title ) ) {\n\t\t\t\t$original_title = $original_term_title;\n\t\t\t}\n\t\t} elseif ( 'post_type_archive' === $item->type ) {\n\t\t\t$original_object = get_post_type_object( $item->object );\n\t\t\tif ( $original_object ) {\n\t\t\t\t$original_title = $original_object->labels->archives;\n\t\t\t}\n\t\t}\n\t\t$original_title = html_entity_decode( $original_title, ENT_QUOTES, get_bloginfo( 'charset' ) );\n\t\treturn $original_title;\n\t}\n\n\t/**\n\t * Get type label.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param object $item Nav menu item.\n\t * @return string The type label.\n\t */\n\tprotected function get_type_label( $item ) {\n\t\tif ( 'post_type' === $item->type ) {\n\t\t\t$object = get_post_type_object( $item->object );\n\t\t\tif ( $object ) {\n\t\t\t\t$type_label = $object->labels->singular_name;\n\t\t\t} else {\n\t\t\t\t$type_label = $item->object;\n\t\t\t}\n\t\t} elseif ( 'taxonomy' === $item->type ) {\n\t\t\t$object = get_taxonomy( $item->object );\n\t\t\tif ( $object ) {\n\t\t\t\t$type_label = $object->labels->singular_name;\n\t\t\t} else {\n\t\t\t\t$type_label = $item->object;\n\t\t\t}\n\t\t} elseif ( 'post_type_archive' === $item->type ) {\n\t\t\t$type_label = __( 'Post Type Archive' );\n\t\t} else {\n\t\t\t$type_label = __( 'Custom Link' );\n\t\t}\n\t\treturn $type_label;\n\t}\n\n\t/**\n\t * Ensure that the value is fully populated with the necessary properties.\n\t *\n\t * Translates some properties added by wp_setup_nav_menu_item() and removes others.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see WP_Customize_Nav_Menu_Item_Setting::value()\n\t */\n\tprotected function populate_value() {\n\t\tif ( ! is_array( $this->value ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( $this->value['menu_order'] ) ) {\n\t\t\t$this->value['position'] = $this->value['menu_order'];\n\t\t\tunset( $this->value['menu_order'] );\n\t\t}\n\t\tif ( isset( $this->value['post_status'] ) ) {\n\t\t\t$this->value['status'] = $this->value['post_status'];\n\t\t\tunset( $this->value['post_status'] );\n\t\t}\n\n\t\tif ( ! isset( $this->value['original_title'] ) ) {\n\t\t\t$this->value['original_title'] = $this->get_original_title( (object) $this->value );\n\t\t}\n\n\t\tif ( ! isset( $this->value['nav_menu_term_id'] ) && $this->post_id > 0 ) {\n\t\t\t$menus = wp_get_post_terms(\n\t\t\t\t$this->post_id,\n\t\t\t\tWP_Customize_Nav_Menu_Setting::TAXONOMY,\n\t\t\t\tarray(\n\t\t\t\t\t'fields' => 'ids',\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ( ! empty( $menus ) ) {\n\t\t\t\t$this->value['nav_menu_term_id'] = array_shift( $menus );\n\t\t\t} else {\n\t\t\t\t$this->value['nav_menu_term_id'] = 0;\n\t\t\t}\n\t\t}\n\n\t\tforeach ( array( 'object_id', 'menu_item_parent', 'nav_menu_term_id' ) as $key ) {\n\t\t\tif ( ! is_int( $this->value[ $key ] ) ) {\n\t\t\t\t$this->value[ $key ] = intval( $this->value[ $key ] );\n\t\t\t}\n\t\t}\n\t\tforeach ( array( 'classes', 'xfn' ) as $key ) {\n\t\t\tif ( is_array( $this->value[ $key ] ) ) {\n\t\t\t\t$this->value[ $key ] = implode( ' ', $this->value[ $key ] );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! isset( $this->value['title'] ) ) {\n\t\t\t$this->value['title'] = '';\n\t\t}\n\n\t\tif ( ! isset( $this->value['_invalid'] ) ) {\n\t\t\t$this->value['_invalid'] = false;\n\t\t\t$is_known_invalid        = (\n\t\t\t\t( ( 'post_type' === $this->value['type'] || 'post_type_archive' === $this->value['type'] ) && ! post_type_exists( $this->value['object'] ) )\n\t\t\t\t||\n\t\t\t\t( 'taxonomy' === $this->value['type'] && ! taxonomy_exists( $this->value['object'] ) )\n\t\t\t);\n\t\t\tif ( $is_known_invalid ) {\n\t\t\t\t$this->value['_invalid'] = true;\n\t\t\t}\n\t\t}\n\n\t\t// Remove remaining properties available on a setup nav_menu_item post object which aren't relevant to the setting value.\n\t\t$irrelevant_properties = array(\n\t\t\t'ID',\n\t\t\t'comment_count',\n\t\t\t'comment_status',\n\t\t\t'db_id',\n\t\t\t'filter',\n\t\t\t'guid',\n\t\t\t'ping_status',\n\t\t\t'pinged',\n\t\t\t'post_author',\n\t\t\t'post_content',\n\t\t\t'post_content_filtered',\n\t\t\t'post_date',\n\t\t\t'post_date_gmt',\n\t\t\t'post_excerpt',\n\t\t\t'post_mime_type',\n\t\t\t'post_modified',\n\t\t\t'post_modified_gmt',\n\t\t\t'post_name',\n\t\t\t'post_parent',\n\t\t\t'post_password',\n\t\t\t'post_title',\n\t\t\t'post_type',\n\t\t\t'to_ping',\n\t\t);\n\t\tforeach ( $irrelevant_properties as $property ) {\n\t\t\tunset( $this->value[ $property ] );\n\t\t}\n\t}\n\n\t/**\n\t * Handle previewing the setting.\n\t *\n\t * @since 4.3.0\n\t * @since 4.4.0 Added boolean return value.\n\t *\n\t * @see WP_Customize_Manager::post_value()\n\t *\n\t * @return bool False if method short-circuited due to no-op.\n\t */\n\tpublic function preview() {\n\t\tif ( $this->is_previewed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$undefined      = new stdClass();\n\t\t$is_placeholder = ( $this->post_id < 0 );\n\t\t$is_dirty       = ( $undefined !== $this->post_value( $undefined ) );\n\t\tif ( ! $is_placeholder && ! $is_dirty ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->is_previewed              = true;\n\t\t$this->_original_value           = $this->value();\n\t\t$this->original_nav_menu_term_id = $this->_original_value['nav_menu_term_id'];\n\t\t$this->_previewed_blog_id        = get_current_blog_id();\n\n\t\tadd_filter( 'wp_get_nav_menu_items', array( $this, 'filter_wp_get_nav_menu_items' ), 10, 3 );\n\n\t\t$sort_callback = array( __CLASS__, 'sort_wp_get_nav_menu_items' );\n\t\tif ( ! has_filter( 'wp_get_nav_menu_items', $sort_callback ) ) {\n\t\t\tadd_filter( 'wp_get_nav_menu_items', array( __CLASS__, 'sort_wp_get_nav_menu_items' ), 1000, 3 );\n\t\t}\n\n\t\t// @todo Add get_post_metadata filters for plugins to add their data.\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Filters the wp_get_nav_menu_items() result to supply the previewed menu items.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see wp_get_nav_menu_items()\n\t *\n\t * @param WP_Post[] $items An array of menu item post objects.\n\t * @param WP_Term   $menu  The menu object.\n\t * @param array     $args  An array of arguments used to retrieve menu item objects.\n\t * @return WP_Post[] Array of menu item objects.\n\t */\n\tpublic function filter_wp_get_nav_menu_items( $items, $menu, $args ) {\n\t\t$this_item                = $this->value();\n\t\t$current_nav_menu_term_id = null;\n\t\tif ( isset( $this_item['nav_menu_term_id'] ) ) {\n\t\t\t$current_nav_menu_term_id = $this_item['nav_menu_term_id'];\n\t\t\tunset( $this_item['nav_menu_term_id'] );\n\t\t}\n\n\t\t$should_filter = (\n\t\t\t$menu->term_id === $this->original_nav_menu_term_id\n\t\t\t||\n\t\t\t$menu->term_id === $current_nav_menu_term_id\n\t\t);\n\t\tif ( ! $should_filter ) {\n\t\t\treturn $items;\n\t\t}\n\n\t\t// Handle deleted menu item, or menu item moved to another menu.\n\t\t$should_remove = (\n\t\t\tfalse === $this_item\n\t\t\t||\n\t\t\t( isset( $this_item['_invalid'] ) && true === $this_item['_invalid'] )\n\t\t\t||\n\t\t\t(\n\t\t\t\t$this->original_nav_menu_term_id === $menu->term_id\n\t\t\t\t&&\n\t\t\t\t$current_nav_menu_term_id !== $this->original_nav_menu_term_id\n\t\t\t)\n\t\t);\n\t\tif ( $should_remove ) {\n\t\t\t$filtered_items = array();\n\t\t\tforeach ( $items as $item ) {\n\t\t\t\tif ( $item->db_id !== $this->post_id ) {\n\t\t\t\t\t$filtered_items[] = $item;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $filtered_items;\n\t\t}\n\n\t\t$mutated       = false;\n\t\t$should_update = (\n\t\t\tis_array( $this_item )\n\t\t\t&&\n\t\t\t$current_nav_menu_term_id === $menu->term_id\n\t\t);\n\t\tif ( $should_update ) {\n\t\t\tforeach ( $items as $item ) {\n\t\t\t\tif ( $item->db_id === $this->post_id ) {\n\t\t\t\t\tforeach ( get_object_vars( $this->value_as_wp_post_nav_menu_item() ) as $key => $value ) {\n\t\t\t\t\t\t$item->$key = $value;\n\t\t\t\t\t}\n\t\t\t\t\t$mutated = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Not found so we have to append it..\n\t\t\tif ( ! $mutated ) {\n\t\t\t\t$items[] = $this->value_as_wp_post_nav_menu_item();\n\t\t\t}\n\t\t}\n\n\t\treturn $items;\n\t}\n\n\t/**\n\t * Re-apply the tail logic also applied on $items by wp_get_nav_menu_items().\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see wp_get_nav_menu_items()\n\t *\n\t * @param WP_Post[] $items An array of menu item post objects.\n\t * @param WP_Term   $menu  The menu object.\n\t * @param array     $args  An array of arguments used to retrieve menu item objects.\n\t * @return WP_Post[] Array of menu item objects.\n\t */\n\tpublic static function sort_wp_get_nav_menu_items( $items, $menu, $args ) {\n\t\t// @todo We should probably re-apply some constraints imposed by $args.\n\t\tunset( $args['include'] );\n\n\t\t// Remove invalid items only in front end.\n\t\tif ( ! is_admin() ) {\n\t\t\t$items = array_filter( $items, '_is_valid_nav_menu_item' );\n\t\t}\n\n\t\tif ( ARRAY_A === $args['output'] ) {\n\t\t\t$items = wp_list_sort(\n\t\t\t\t$items,\n\t\t\t\tarray(\n\t\t\t\t\t$args['output_key'] => 'ASC',\n\t\t\t\t)\n\t\t\t);\n\t\t\t$i     = 1;\n\n\t\t\tforeach ( $items as $k => $item ) {\n\t\t\t\t$items[ $k ]->{$args['output_key']} = $i++;\n\t\t\t}\n\t\t}\n\n\t\treturn $items;\n\t}\n\n\t/**\n\t * Get the value emulated into a WP_Post and set up as a nav_menu_item.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @return WP_Post With wp_setup_nav_menu_item() applied.\n\t */\n\tpublic function value_as_wp_post_nav_menu_item() {\n\t\t$item = (object) $this->value();\n\t\tunset( $item->nav_menu_term_id );\n\n\t\t$item->post_status = $item->status;\n\t\tunset( $item->status );\n\n\t\t$item->post_type  = 'nav_menu_item';\n\t\t$item->menu_order = $item->position;\n\t\tunset( $item->position );\n\n\t\tif ( empty( $item->original_title ) ) {\n\t\t\t$item->original_title = $this->get_original_title( $item );\n\t\t}\n\t\tif ( empty( $item->title ) && ! empty( $item->original_title ) ) {\n\t\t\t$item->title = $item->original_title;\n\t\t}\n\t\tif ( $item->title ) {\n\t\t\t$item->post_title = $item->title;\n\t\t}\n\n\t\t$item->ID    = $this->post_id;\n\t\t$item->db_id = $this->post_id;\n\t\t$post        = new WP_Post( (object) $item );\n\n\t\tif ( empty( $post->post_author ) ) {\n\t\t\t$post->post_author = get_current_user_id();\n\t\t}\n\n\t\tif ( ! isset( $post->type_label ) ) {\n\t\t\t$post->type_label = $this->get_type_label( $post );\n\t\t}\n\n\t\t// Ensure nav menu item URL is set according to linked object.\n\t\tif ( 'post_type' === $post->type && ! empty( $post->object_id ) ) {\n\t\t\t$post->url = get_permalink( $post->object_id );\n\t\t} elseif ( 'taxonomy' === $post->type && ! empty( $post->object ) && ! empty( $post->object_id ) ) {\n\t\t\t$post->url = get_term_link( (int) $post->object_id, $post->object );\n\t\t} elseif ( 'post_type_archive' === $post->type && ! empty( $post->object ) ) {\n\t\t\t$post->url = get_post_type_archive_link( $post->object );\n\t\t}\n\t\tif ( is_wp_error( $post->url ) ) {\n\t\t\t$post->url = '';\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/nav-menu.php */\n\t\t$post->attr_title = apply_filters( 'nav_menu_attr_title', $post->attr_title );\n\n\t\t/** This filter is documented in wp-includes/nav-menu.php */\n\t\t$post->description = apply_filters( 'nav_menu_description', wp_trim_words( $post->description, 200 ) );\n\n\t\t/** This filter is documented in wp-includes/nav-menu.php */\n\t\t$post = apply_filters( 'wp_setup_nav_menu_item', $post );\n\n\t\treturn $post;\n\t}\n\n\t/**\n\t * Sanitize an input.\n\t *\n\t * Note that parent::sanitize() erroneously does wp_unslash() on $value, but\n\t * we remove that in this override.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param array $menu_item_value The value to sanitize.\n\t * @return array|false|null|WP_Error Null or WP_Error if an input isn't valid. False if it is marked for deletion.\n\t *                                   Otherwise the sanitized value.\n\t */\n\tpublic function sanitize( $menu_item_value ) {\n\t\t// Menu is marked for deletion.\n\t\tif ( false === $menu_item_value ) {\n\t\t\treturn $menu_item_value;\n\t\t}\n\n\t\t// Invalid.\n\t\tif ( ! is_array( $menu_item_value ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$default                     = array(\n\t\t\t'object_id'        => 0,\n\t\t\t'object'           => '',\n\t\t\t'menu_item_parent' => 0,\n\t\t\t'position'         => 0,\n\t\t\t'type'             => 'custom',\n\t\t\t'title'            => '',\n\t\t\t'url'              => '',\n\t\t\t'target'           => '',\n\t\t\t'attr_title'       => '',\n\t\t\t'description'      => '',\n\t\t\t'classes'          => '',\n\t\t\t'xfn'              => '',\n\t\t\t'status'           => 'publish',\n\t\t\t'original_title'   => '',\n\t\t\t'nav_menu_term_id' => 0,\n\t\t\t'_invalid'         => false,\n\t\t);\n\t\t$menu_item_value             = array_merge( $default, $menu_item_value );\n\t\t$menu_item_value             = wp_array_slice_assoc( $menu_item_value, array_keys( $default ) );\n\t\t$menu_item_value['position'] = intval( $menu_item_value['position'] );\n\n\t\tforeach ( array( 'object_id', 'menu_item_parent', 'nav_menu_term_id' ) as $key ) {\n\t\t\t// Note we need to allow negative-integer IDs for previewed objects not inserted yet.\n\t\t\t$menu_item_value[ $key ] = intval( $menu_item_value[ $key ] );\n\t\t}\n\n\t\tforeach ( array( 'type', 'object', 'target' ) as $key ) {\n\t\t\t$menu_item_value[ $key ] = sanitize_key( $menu_item_value[ $key ] );\n\t\t}\n\n\t\tforeach ( array( 'xfn', 'classes' ) as $key ) {\n\t\t\t$value = $menu_item_value[ $key ];\n\t\t\tif ( ! is_array( $value ) ) {\n\t\t\t\t$value = explode( ' ', $value );\n\t\t\t}\n\t\t\t$menu_item_value[ $key ] = implode( ' ', array_map( 'sanitize_html_class', $value ) );\n\t\t}\n\n\t\t$menu_item_value['original_title'] = sanitize_text_field( $menu_item_value['original_title'] );\n\n\t\t// Apply the same filters as when calling wp_insert_post().\n\n\t\t/** This filter is documented in wp-includes/post.php */\n\t\t$menu_item_value['title'] = wp_unslash( apply_filters( 'title_save_pre', wp_slash( $menu_item_value['title'] ) ) );\n\n\t\t/** This filter is documented in wp-includes/post.php */\n\t\t$menu_item_value['attr_title'] = wp_unslash( apply_filters( 'excerpt_save_pre', wp_slash( $menu_item_value['attr_title'] ) ) );\n\n\t\t/** This filter is documented in wp-includes/post.php */\n\t\t$menu_item_value['description'] = wp_unslash( apply_filters( 'content_save_pre', wp_slash( $menu_item_value['description'] ) ) );\n\n\t\tif ( '' !== $menu_item_value['url'] ) {\n\t\t\t$menu_item_value['url'] = esc_url_raw( $menu_item_value['url'] );\n\t\t\tif ( '' === $menu_item_value['url'] ) {\n\t\t\t\treturn new WP_Error( 'invalid_url', __( 'Invalid URL.' ) ); // Fail sanitization if URL is invalid.\n\t\t\t}\n\t\t}\n\t\tif ( 'publish' !== $menu_item_value['status'] ) {\n\t\t\t$menu_item_value['status'] = 'draft';\n\t\t}\n\n\t\t$menu_item_value['_invalid'] = (bool) $menu_item_value['_invalid'];\n\n\t\t/** This filter is documented in wp-includes/class-wp-customize-setting.php */\n\t\treturn apply_filters( \"customize_sanitize_{$this->id}\", $menu_item_value, $this );\n\t}\n\n\t/**\n\t * Creates/updates the nav_menu_item post for this setting.\n\t *\n\t * Any created menu items will have their assigned post IDs exported to the client\n\t * via the {@see 'customize_save_response'} filter. Likewise, any errors will be\n\t * exported to the client via the customize_save_response() filter.\n\t *\n\t * To delete a menu, the client can send false as the value.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see wp_update_nav_menu_item()\n\t *\n\t * @param array|false $value The menu item array to update. If false, then the menu item will be deleted\n\t *                           entirely. See WP_Customize_Nav_Menu_Item_Setting::$default for what the value\n\t *                           should consist of.\n\t * @return null|void\n\t */\n\tprotected function update( $value ) {\n\t\tif ( $this->is_updated ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->is_updated = true;\n\t\t$is_placeholder   = ( $this->post_id < 0 );\n\t\t$is_delete        = ( false === $value );\n\n\t\t// Update the cached value.\n\t\t$this->value = $value;\n\n\t\tadd_filter( 'customize_save_response', array( $this, 'amend_customize_save_response' ) );\n\n\t\tif ( $is_delete ) {\n\t\t\t// If the current setting post is a placeholder, a delete request is a no-op.\n\t\t\tif ( $is_placeholder ) {\n\t\t\t\t$this->update_status = 'deleted';\n\t\t\t} else {\n\t\t\t\t$r = wp_delete_post( $this->post_id, true );\n\n\t\t\t\tif ( false === $r ) {\n\t\t\t\t\t$this->update_error  = new WP_Error( 'delete_failure' );\n\t\t\t\t\t$this->update_status = 'error';\n\t\t\t\t} else {\n\t\t\t\t\t$this->update_status = 'deleted';\n\t\t\t\t}\n\t\t\t\t// @todo send back the IDs for all associated nav menu items deleted, so these settings (and controls) can be removed from Customizer?\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Handle saving menu items for menus that are being newly-created.\n\t\t\tif ( $value['nav_menu_term_id'] < 0 ) {\n\t\t\t\t$nav_menu_setting_id = sprintf( 'nav_menu[%s]', $value['nav_menu_term_id'] );\n\t\t\t\t$nav_menu_setting    = $this->manager->get_setting( $nav_menu_setting_id );\n\n\t\t\t\tif ( ! $nav_menu_setting || ! ( $nav_menu_setting instanceof WP_Customize_Nav_Menu_Setting ) ) {\n\t\t\t\t\t$this->update_status = 'error';\n\t\t\t\t\t$this->update_error  = new WP_Error( 'unexpected_nav_menu_setting' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( false === $nav_menu_setting->save() ) {\n\t\t\t\t\t$this->update_status = 'error';\n\t\t\t\t\t$this->update_error  = new WP_Error( 'nav_menu_setting_failure' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( intval( $value['nav_menu_term_id'] ) !== $nav_menu_setting->previous_term_id ) {\n\t\t\t\t\t$this->update_status = 'error';\n\t\t\t\t\t$this->update_error  = new WP_Error( 'unexpected_previous_term_id' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$value['nav_menu_term_id'] = $nav_menu_setting->term_id;\n\t\t\t}\n\n\t\t\t// Handle saving a nav menu item that is a child of a nav menu item being newly-created.\n\t\t\tif ( $value['menu_item_parent'] < 0 ) {\n\t\t\t\t$parent_nav_menu_item_setting_id = sprintf( 'nav_menu_item[%s]', $value['menu_item_parent'] );\n\t\t\t\t$parent_nav_menu_item_setting    = $this->manager->get_setting( $parent_nav_menu_item_setting_id );\n\n\t\t\t\tif ( ! $parent_nav_menu_item_setting || ! ( $parent_nav_menu_item_setting instanceof WP_Customize_Nav_Menu_Item_Setting ) ) {\n\t\t\t\t\t$this->update_status = 'error';\n\t\t\t\t\t$this->update_error  = new WP_Error( 'unexpected_nav_menu_item_setting' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( false === $parent_nav_menu_item_setting->save() ) {\n\t\t\t\t\t$this->update_status = 'error';\n\t\t\t\t\t$this->update_error  = new WP_Error( 'nav_menu_item_setting_failure' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( intval( $value['menu_item_parent'] ) !== $parent_nav_menu_item_setting->previous_post_id ) {\n\t\t\t\t\t$this->update_status = 'error';\n\t\t\t\t\t$this->update_error  = new WP_Error( 'unexpected_previous_post_id' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$value['menu_item_parent'] = $parent_nav_menu_item_setting->post_id;\n\t\t\t}\n\n\t\t\t// Insert or update menu.\n\t\t\t$menu_item_data = array(\n\t\t\t\t'menu-item-object-id'   => $value['object_id'],\n\t\t\t\t'menu-item-object'      => $value['object'],\n\t\t\t\t'menu-item-parent-id'   => $value['menu_item_parent'],\n\t\t\t\t'menu-item-position'    => $value['position'],\n\t\t\t\t'menu-item-type'        => $value['type'],\n\t\t\t\t'menu-item-title'       => $value['title'],\n\t\t\t\t'menu-item-url'         => $value['url'],\n\t\t\t\t'menu-item-description' => $value['description'],\n\t\t\t\t'menu-item-attr-title'  => $value['attr_title'],\n\t\t\t\t'menu-item-target'      => $value['target'],\n\t\t\t\t'menu-item-classes'     => $value['classes'],\n\t\t\t\t'menu-item-xfn'         => $value['xfn'],\n\t\t\t\t'menu-item-status'      => $value['status'],\n\t\t\t);\n\n\t\t\t$r = wp_update_nav_menu_item(\n\t\t\t\t$value['nav_menu_term_id'],\n\t\t\t\t$is_placeholder ? 0 : $this->post_id,\n\t\t\t\twp_slash( $menu_item_data )\n\t\t\t);\n\n\t\t\tif ( is_wp_error( $r ) ) {\n\t\t\t\t$this->update_status = 'error';\n\t\t\t\t$this->update_error  = $r;\n\t\t\t} else {\n\t\t\t\tif ( $is_placeholder ) {\n\t\t\t\t\t$this->previous_post_id = $this->post_id;\n\t\t\t\t\t$this->post_id          = $r;\n\t\t\t\t\t$this->update_status    = 'inserted';\n\t\t\t\t} else {\n\t\t\t\t\t$this->update_status = 'updated';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\t/**\n\t * Export data for the JS client.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see WP_Customize_Nav_Menu_Item_Setting::update()\n\t *\n\t * @param array $data Additional information passed back to the 'saved' event on `wp.customize`.\n\t * @return array Save response data.\n\t */\n\tpublic function amend_customize_save_response( $data ) {\n\t\tif ( ! isset( $data['nav_menu_item_updates'] ) ) {\n\t\t\t$data['nav_menu_item_updates'] = array();\n\t\t}\n\n\t\t$data['nav_menu_item_updates'][] = array(\n\t\t\t'post_id'          => $this->post_id,\n\t\t\t'previous_post_id' => $this->previous_post_id,\n\t\t\t'error'            => $this->update_error ? $this->update_error->get_error_code() : null,\n\t\t\t'status'           => $this->update_status,\n\t\t);\n\t\treturn $data;\n\t}\n}\n", "num_lines": 899}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Nav_Menu_Location_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize Menu Location Control Class.\n *\n * This custom control is only needed for JS.\n *\n * @since 4.3.0\n *\n * @see WP_Customize_Control\n */\nclass WP_Customize_Nav_Menu_Location_Control extends WP_Customize_Control {\n\n\t/**\n\t * Control type.\n\t *\n\t * @since 4.3.0\n\t * @var string\n\t */\n\tpublic $type = 'nav_menu_location';\n\n\t/**\n\t * Location ID.\n\t *\n\t * @since 4.3.0\n\t * @var string\n\t */\n\tpublic $location_id = '';\n\n\t/**\n\t * Refresh the parameters passed to JavaScript via JSON.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see WP_Customize_Control::to_json()\n\t */\n\tpublic function to_json() {\n\t\tparent::to_json();\n\t\t$this->json['locationId'] = $this->location_id;\n\t}\n\n\t/**\n\t * Render content just like a normal select control.\n\t *\n\t * @since 4.3.0\n\t * @since 4.9.0 Added a button to create menus.\n\t */\n\tpublic function render_content() {\n\t\tif ( empty( $this->choices ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$value_hidden_class    = '';\n\t\t$no_value_hidden_class = '';\n\t\tif ( $this->value() ) {\n\t\t\t$value_hidden_class = ' hidden';\n\t\t} else {\n\t\t\t$no_value_hidden_class = ' hidden';\n\t\t}\n\t\t?>\n\t\t<label>\n\t\t\t<?php if ( ! empty( $this->label ) ) : ?>\n\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t<?php endif; ?>\n\n\t\t\t<?php if ( ! empty( $this->description ) ) : ?>\n\t\t\t<span class=\"description customize-control-description\"><?php echo $this->description; ?></span>\n\t\t\t<?php endif; ?>\n\n\t\t\t<select <?php $this->link(); ?>>\n\t\t\t\t<?php\n\t\t\t\tforeach ( $this->choices as $value => $label ) :\n\t\t\t\t\techo '<option value=\"' . esc_attr( $value ) . '\"' . selected( $this->value(), $value, false ) . '>' . $label . '</option>';\n\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</label>\n\t\t<button type=\"button\" class=\"button-link create-menu<?php echo $value_hidden_class; ?>\" data-location-id=\"<?php echo esc_attr( $this->location_id ); ?>\" aria-label=\"<?php esc_attr_e( 'Create a menu for this location' ); ?>\"><?php _e( '+ Create New Menu' ); ?></button>\n\t\t<button type=\"button\" class=\"button-link edit-menu<?php echo $no_value_hidden_class; ?>\" aria-label=\"<?php esc_attr_e( 'Edit selected menu' ); ?>\"><?php _e( 'Edit Menu' ); ?></button>\n\t\t<?php\n\t}\n}\n", "num_lines": 90}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Nav_Menu_Locations_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.9.0\n */\n\n/**\n * Customize Nav Menu Locations Control Class.\n *\n * @since 4.9.0\n *\n * @see WP_Customize_Control\n */\nclass WP_Customize_Nav_Menu_Locations_Control extends WP_Customize_Control {\n\n\t/**\n\t * Control type.\n\t *\n\t * @since 4.9.0\n\t * @var string\n\t */\n\tpublic $type = 'nav_menu_locations';\n\n\t/**\n\t * Don't render the control's content - it uses a JS template instead.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic function render_content() {}\n\n\t/**\n\t * JS/Underscore template for the control UI.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic function content_template() {\n\t\tif ( current_theme_supports( 'menus' ) ) :\n\t\t\t?>\n\t\t\t<# var elementId; #>\n\t\t\t<ul class=\"menu-location-settings\">\n\t\t\t\t<li class=\"customize-control assigned-menu-locations-title\">\n\t\t\t\t\t<span class=\"customize-control-title\">{{ wp.customize.Menus.data.l10n.locationsTitle }}</span>\n\t\t\t\t\t<# if ( data.isCreating ) { #>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<?php echo _x( 'Where do you want this menu to appear?', 'menu locations' ); ?>\n\t\t\t\t\t\t\t<em class=\"new-menu-locations-widget-note\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t/* translators: 1: Documentation URL, 2: Additional link attributes, 3: Accessibility text. */\n\t\t\t\t\t\t\t\t\t_x( '(If you plan to use a menu <a href=\"%1$s\" %2$s>widget%3$s</a>, skip this step.)', 'menu locations' ),\n\t\t\t\t\t\t\t\t\t__( 'https://wordpress.org/support/article/wordpress-widgets/' ),\n\t\t\t\t\t\t\t\t\t' class=\"external-link\" target=\"_blank\"',\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t'<span class=\"screen-reader-text\"> %s</span>',\n\t\t\t\t\t\t\t\t\t\t/* translators: Accessibility text. */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\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\t?>\n\t\t\t\t\t\t\t</em>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t<p><?php echo _x( 'Here&#8217;s where this menu appears. If you&#8217;d like to change that, pick another location.', 'menu locations' ); ?></p>\n\t\t\t\t\t<# } #>\n\t\t\t\t</li>\n\n\t\t\t\t<?php foreach ( get_registered_nav_menus() as $location => $description ) : ?>\n\t\t\t\t\t<# elementId = _.uniqueId( 'customize-nav-menu-control-location-' ); #>\n\t\t\t\t\t<li class=\"customize-control customize-control-checkbox assigned-menu-location\">\n\t\t\t\t\t\t<span class=\"customize-inside-control-row\">\n\t\t\t\t\t\t\t<input id=\"{{ elementId }}\" type=\"checkbox\" data-menu-id=\"{{ data.menu_id }}\" data-location-id=\"<?php echo esc_attr( $location ); ?>\" class=\"menu-location\" />\n\t\t\t\t\t\t\t<label for=\"{{ elementId }}\">\n\t\t\t\t\t\t\t\t<?php echo $description; ?>\n\t\t\t\t\t\t\t\t<span class=\"theme-location-set\">\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: Menu name. */\n\t\t\t\t\t\t\t\t\t\t_x( '(Current: %s)', 'menu location' ),\n\t\t\t\t\t\t\t\t\t\t'<span class=\"current-menu-location-name-' . esc_attr( $location ) . '\"></span>'\n\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</span>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</ul>\n\t\t\t<?php\n\t\tendif;\n\t}\n}\n", "num_lines": 95}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Nav_Menu_Name_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize control to represent the name field for a given menu.\n *\n * @since 4.3.0\n *\n * @see WP_Customize_Control\n */\nclass WP_Customize_Nav_Menu_Name_Control extends WP_Customize_Control {\n\n\t/**\n\t * Type of control, used by JS.\n\t *\n\t * @since 4.3.0\n\t * @var string\n\t */\n\tpublic $type = 'nav_menu_name';\n\n\t/**\n\t * No-op since we're using JS template.\n\t *\n\t * @since 4.3.0\n\t */\n\tprotected function render_content() {}\n\n\t/**\n\t * Render the Underscore template for this control.\n\t *\n\t * @since 4.3.0\n\t */\n\tprotected function content_template() {\n\t\t?>\n\t\t<label>\n\t\t\t<# if ( data.label ) { #>\n\t\t\t\t<span class=\"customize-control-title\">{{ data.label }}</span>\n\t\t\t<# } #>\n\t\t\t<input type=\"text\" class=\"menu-name-field live-update-section-title\"\n\t\t\t\t<# if ( data.description ) { #>\n\t\t\t\t\taria-describedby=\"{{ data.section }}-description\"\n\t\t\t\t<# } #>\n\t\t\t\t/>\n\t\t</label>\n\t\t<# if ( data.description ) { #>\n\t\t\t<p id=\"{{ data.section }}-description\">{{ data.description }}</p>\n\t\t<# } #>\n\t\t<?php\n\t}\n}\n", "num_lines": 57}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Nav_Menu_Section class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize Menu Section Class\n *\n * Custom section only needed in JS.\n *\n * @since 4.3.0\n *\n * @see WP_Customize_Section\n */\nclass WP_Customize_Nav_Menu_Section extends WP_Customize_Section {\n\n\t/**\n\t * Control type.\n\t *\n\t * @since 4.3.0\n\t * @var string\n\t */\n\tpublic $type = 'nav_menu';\n\n\t/**\n\t * Get section parameters for JS.\n\t *\n\t * @since 4.3.0\n\t * @return array Exported parameters.\n\t */\n\tpublic function json() {\n\t\t$exported            = parent::json();\n\t\t$exported['menu_id'] = intval( preg_replace( '/^nav_menu\\[(-?\\d+)\\]/', '$1', $this->id ) );\n\n\t\treturn $exported;\n\t}\n}\n", "num_lines": 42}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Nav_Menu_Setting class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize Setting to represent a nav_menu.\n *\n * Subclass of WP_Customize_Setting to represent a nav_menu taxonomy term, and\n * the IDs for the nav_menu_items associated with the nav menu.\n *\n * @since 4.3.0\n *\n * @see wp_get_nav_menu_object()\n * @see WP_Customize_Setting\n */\nclass WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting {\n\n\tconst ID_PATTERN = '/^nav_menu\\[(?P<id>-?\\d+)\\]$/';\n\n\tconst TAXONOMY = 'nav_menu';\n\n\tconst TYPE = 'nav_menu';\n\n\t/**\n\t * Setting type.\n\t *\n\t * @since 4.3.0\n\t * @var string\n\t */\n\tpublic $type = self::TYPE;\n\n\t/**\n\t * Default setting value.\n\t *\n\t * @since 4.3.0\n\t * @var array\n\t *\n\t * @see wp_get_nav_menu_object()\n\t */\n\tpublic $default = array(\n\t\t'name'        => '',\n\t\t'description' => '',\n\t\t'parent'      => 0,\n\t\t'auto_add'    => false,\n\t);\n\n\t/**\n\t * Default transport.\n\t *\n\t * @since 4.3.0\n\t * @var string\n\t */\n\tpublic $transport = 'postMessage';\n\n\t/**\n\t * The term ID represented by this setting instance.\n\t *\n\t * A negative value represents a placeholder ID for a new menu not yet saved.\n\t *\n\t * @since 4.3.0\n\t * @var int\n\t */\n\tpublic $term_id;\n\n\t/**\n\t * Previous (placeholder) term ID used before creating a new menu.\n\t *\n\t * This value will be exported to JS via the {@see 'customize_save_response'} filter\n\t * so that JavaScript can update the settings to refer to the newly-assigned\n\t * term ID. This value is always negative to indicate it does not refer to\n\t * a real term.\n\t *\n\t * @since 4.3.0\n\t * @var int\n\t *\n\t * @see WP_Customize_Nav_Menu_Setting::update()\n\t * @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response()\n\t */\n\tpublic $previous_term_id;\n\n\t/**\n\t * Whether or not update() was called.\n\t *\n\t * @since 4.3.0\n\t * @var bool\n\t */\n\tprotected $is_updated = false;\n\n\t/**\n\t * Status for calling the update method, used in customize_save_response filter.\n\t *\n\t * See {@see 'customize_save_response'}.\n\t *\n\t * When status is inserted, the placeholder term ID is stored in `$previous_term_id`.\n\t * When status is error, the error is stored in `$update_error`.\n\t *\n\t * @since 4.3.0\n\t * @var string updated|inserted|deleted|error\n\t *\n\t * @see WP_Customize_Nav_Menu_Setting::update()\n\t * @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response()\n\t */\n\tpublic $update_status;\n\n\t/**\n\t * Any error object returned by wp_update_nav_menu_object() when setting is updated.\n\t *\n\t * @since 4.3.0\n\t * @var WP_Error\n\t *\n\t * @see WP_Customize_Nav_Menu_Setting::update()\n\t * @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response()\n\t */\n\tpublic $update_error;\n\n\t/**\n\t * Constructor.\n\t *\n\t * Any supplied $args override class property defaults.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @throws Exception If $id is not valid for this setting type.\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t * @param string               $id      A specific ID of the setting.\n\t *                                      Can be a theme mod or option name.\n\t * @param array                $args    Optional. Setting arguments.\n\t */\n\tpublic function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {\n\t\tif ( empty( $manager->nav_menus ) ) {\n\t\t\tthrow new Exception( 'Expected WP_Customize_Manager::$nav_menus to be set.' );\n\t\t}\n\n\t\tif ( ! preg_match( self::ID_PATTERN, $id, $matches ) ) {\n\t\t\tthrow new Exception( \"Illegal widget setting ID: $id\" );\n\t\t}\n\n\t\t$this->term_id = intval( $matches['id'] );\n\n\t\tparent::__construct( $manager, $id, $args );\n\t}\n\n\t/**\n\t * Get the instance data for a given widget setting.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see wp_get_nav_menu_object()\n\t *\n\t * @return array Instance data.\n\t */\n\tpublic function value() {\n\t\tif ( $this->is_previewed && get_current_blog_id() === $this->_previewed_blog_id ) {\n\t\t\t$undefined  = new stdClass(); // Symbol.\n\t\t\t$post_value = $this->post_value( $undefined );\n\n\t\t\tif ( $undefined === $post_value ) {\n\t\t\t\t$value = $this->_original_value;\n\t\t\t} else {\n\t\t\t\t$value = $post_value;\n\t\t\t}\n\t\t} else {\n\t\t\t$value = false;\n\n\t\t\t// Note that a term_id of less than one indicates a nav_menu not yet inserted.\n\t\t\tif ( $this->term_id > 0 ) {\n\t\t\t\t$term = wp_get_nav_menu_object( $this->term_id );\n\n\t\t\t\tif ( $term ) {\n\t\t\t\t\t$value = wp_array_slice_assoc( (array) $term, array_keys( $this->default ) );\n\n\t\t\t\t\t$nav_menu_options  = (array) get_option( 'nav_menu_options', array() );\n\t\t\t\t\t$value['auto_add'] = false;\n\n\t\t\t\t\tif ( isset( $nav_menu_options['auto_add'] ) && is_array( $nav_menu_options['auto_add'] ) ) {\n\t\t\t\t\t\t$value['auto_add'] = in_array( $term->term_id, $nav_menu_options['auto_add'], true );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! is_array( $value ) ) {\n\t\t\t\t$value = $this->default;\n\t\t\t}\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Handle previewing the setting.\n\t *\n\t * @since 4.3.0\n\t * @since 4.4.0 Added boolean return value\n\t *\n\t * @see WP_Customize_Manager::post_value()\n\t *\n\t * @return bool False if method short-circuited due to no-op.\n\t */\n\tpublic function preview() {\n\t\tif ( $this->is_previewed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$undefined      = new stdClass();\n\t\t$is_placeholder = ( $this->term_id < 0 );\n\t\t$is_dirty       = ( $undefined !== $this->post_value( $undefined ) );\n\t\tif ( ! $is_placeholder && ! $is_dirty ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->is_previewed       = true;\n\t\t$this->_original_value    = $this->value();\n\t\t$this->_previewed_blog_id = get_current_blog_id();\n\n\t\tadd_filter( 'wp_get_nav_menus', array( $this, 'filter_wp_get_nav_menus' ), 10, 2 );\n\t\tadd_filter( 'wp_get_nav_menu_object', array( $this, 'filter_wp_get_nav_menu_object' ), 10, 2 );\n\t\tadd_filter( 'default_option_nav_menu_options', array( $this, 'filter_nav_menu_options' ) );\n\t\tadd_filter( 'option_nav_menu_options', array( $this, 'filter_nav_menu_options' ) );\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Filters the wp_get_nav_menus() result to ensure the inserted menu object is included, and the deleted one is removed.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see wp_get_nav_menus()\n\t *\n\t * @param WP_Term[] $menus An array of menu objects.\n\t * @param array     $args  An array of arguments used to retrieve menu objects.\n\t * @return WP_Term[] Array of menu objects.\n\t */\n\tpublic function filter_wp_get_nav_menus( $menus, $args ) {\n\t\tif ( get_current_blog_id() !== $this->_previewed_blog_id ) {\n\t\t\treturn $menus;\n\t\t}\n\n\t\t$setting_value = $this->value();\n\t\t$is_delete     = ( false === $setting_value );\n\t\t$index         = -1;\n\n\t\t// Find the existing menu item's position in the list.\n\t\tforeach ( $menus as $i => $menu ) {\n\t\t\tif ( (int) $this->term_id === (int) $menu->term_id || (int) $this->previous_term_id === (int) $menu->term_id ) {\n\t\t\t\t$index = $i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( $is_delete ) {\n\t\t\t// Handle deleted menu by removing it from the list.\n\t\t\tif ( -1 !== $index ) {\n\t\t\t\tarray_splice( $menus, $index, 1 );\n\t\t\t}\n\t\t} else {\n\t\t\t// Handle menus being updated or inserted.\n\t\t\t$menu_obj = (object) array_merge(\n\t\t\t\tarray(\n\t\t\t\t\t'term_id'          => $this->term_id,\n\t\t\t\t\t'term_taxonomy_id' => $this->term_id,\n\t\t\t\t\t'slug'             => sanitize_title( $setting_value['name'] ),\n\t\t\t\t\t'count'            => 0,\n\t\t\t\t\t'term_group'       => 0,\n\t\t\t\t\t'taxonomy'         => self::TAXONOMY,\n\t\t\t\t\t'filter'           => 'raw',\n\t\t\t\t),\n\t\t\t\t$setting_value\n\t\t\t);\n\n\t\t\tarray_splice( $menus, $index, ( -1 === $index ? 0 : 1 ), array( $menu_obj ) );\n\t\t}\n\n\t\t// Make sure the menu objects get re-sorted after an update/insert.\n\t\tif ( ! $is_delete && ! empty( $args['orderby'] ) ) {\n\t\t\t$menus = wp_list_sort(\n\t\t\t\t$menus,\n\t\t\t\tarray(\n\t\t\t\t\t$args['orderby'] => 'ASC',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t// @todo Add support for $args['hide_empty'] === true.\n\n\t\treturn $menus;\n\t}\n\n\t/**\n\t * Temporary non-closure passing of orderby value to function.\n\t *\n\t * @since 4.3.0\n\t * @var string\n\t *\n\t * @see WP_Customize_Nav_Menu_Setting::filter_wp_get_nav_menus()\n\t * @see WP_Customize_Nav_Menu_Setting::_sort_menus_by_orderby()\n\t */\n\tprotected $_current_menus_sort_orderby;\n\n\t/**\n\t * Sort menu objects by the class-supplied orderby property.\n\t *\n\t * This is a workaround for a lack of closures.\n\t *\n\t * @since 4.3.0\n\t * @deprecated 4.7.0 Use wp_list_sort()\n\t *\n\t * @param object $menu1\n\t * @param object $menu2\n\t * @return int\n\t *\n\t * @see WP_Customize_Nav_Menu_Setting::filter_wp_get_nav_menus()\n\t */\n\tprotected function _sort_menus_by_orderby( $menu1, $menu2 ) {\n\t\t_deprecated_function( __METHOD__, '4.7.0', 'wp_list_sort' );\n\n\t\t$key = $this->_current_menus_sort_orderby;\n\t\treturn strcmp( $menu1->$key, $menu2->$key );\n\t}\n\n\t/**\n\t * Filters the wp_get_nav_menu_object() result to supply the previewed menu object.\n\t *\n\t * Requesting a nav_menu object by anything but ID is not supported.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see wp_get_nav_menu_object()\n\t *\n\t * @param object|null $menu_obj Object returned by wp_get_nav_menu_object().\n\t * @param string      $menu_id  ID of the nav_menu term. Requests by slug or name will be ignored.\n\t * @return object|null\n\t */\n\tpublic function filter_wp_get_nav_menu_object( $menu_obj, $menu_id ) {\n\t\t$ok = (\n\t\t\tget_current_blog_id() === $this->_previewed_blog_id\n\t\t\t&&\n\t\t\tis_int( $menu_id )\n\t\t\t&&\n\t\t\t$menu_id === $this->term_id\n\t\t);\n\t\tif ( ! $ok ) {\n\t\t\treturn $menu_obj;\n\t\t}\n\n\t\t$setting_value = $this->value();\n\n\t\t// Handle deleted menus.\n\t\tif ( false === $setting_value ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Handle sanitization failure by preventing short-circuiting.\n\t\tif ( null === $setting_value ) {\n\t\t\treturn $menu_obj;\n\t\t}\n\n\t\t$menu_obj = (object) array_merge(\n\t\t\tarray(\n\t\t\t\t'term_id'          => $this->term_id,\n\t\t\t\t'term_taxonomy_id' => $this->term_id,\n\t\t\t\t'slug'             => sanitize_title( $setting_value['name'] ),\n\t\t\t\t'count'            => 0,\n\t\t\t\t'term_group'       => 0,\n\t\t\t\t'taxonomy'         => self::TAXONOMY,\n\t\t\t\t'filter'           => 'raw',\n\t\t\t),\n\t\t\t$setting_value\n\t\t);\n\n\t\treturn $menu_obj;\n\t}\n\n\t/**\n\t * Filters the nav_menu_options option to include this menu's auto_add preference.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param array $nav_menu_options Nav menu options including auto_add.\n\t * @return array (Maybe) modified nav menu options.\n\t */\n\tpublic function filter_nav_menu_options( $nav_menu_options ) {\n\t\tif ( get_current_blog_id() !== $this->_previewed_blog_id ) {\n\t\t\treturn $nav_menu_options;\n\t\t}\n\n\t\t$menu             = $this->value();\n\t\t$nav_menu_options = $this->filter_nav_menu_options_value(\n\t\t\t$nav_menu_options,\n\t\t\t$this->term_id,\n\t\t\tfalse === $menu ? false : $menu['auto_add']\n\t\t);\n\n\t\treturn $nav_menu_options;\n\t}\n\n\t/**\n\t * Sanitize an input.\n\t *\n\t * Note that parent::sanitize() erroneously does wp_unslash() on $value, but\n\t * we remove that in this override.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @param array $value The value to sanitize.\n\t * @return array|false|null Null if an input isn't valid. False if it is marked for deletion.\n\t *                          Otherwise the sanitized value.\n\t */\n\tpublic function sanitize( $value ) {\n\t\t// Menu is marked for deletion.\n\t\tif ( false === $value ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\t// Invalid.\n\t\tif ( ! is_array( $value ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$default = array(\n\t\t\t'name'        => '',\n\t\t\t'description' => '',\n\t\t\t'parent'      => 0,\n\t\t\t'auto_add'    => false,\n\t\t);\n\t\t$value   = array_merge( $default, $value );\n\t\t$value   = wp_array_slice_assoc( $value, array_keys( $default ) );\n\n\t\t$value['name']        = trim( esc_html( $value['name'] ) ); // This sanitization code is used in wp-admin/nav-menus.php.\n\t\t$value['description'] = sanitize_text_field( $value['description'] );\n\t\t$value['parent']      = max( 0, intval( $value['parent'] ) );\n\t\t$value['auto_add']    = ! empty( $value['auto_add'] );\n\n\t\tif ( '' === $value['name'] ) {\n\t\t\t$value['name'] = _x( '(unnamed)', 'Missing menu name.' );\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/class-wp-customize-setting.php */\n\t\treturn apply_filters( \"customize_sanitize_{$this->id}\", $value, $this );\n\t}\n\n\t/**\n\t * Storage for data to be sent back to client in customize_save_response filter.\n\t *\n\t * See {@see 'customize_save_response'}.\n\t *\n\t * @since 4.3.0\n\t * @var array\n\t *\n\t * @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response()\n\t */\n\tprotected $_widget_nav_menu_updates = array();\n\n\t/**\n\t * Create/update the nav_menu term for this setting.\n\t *\n\t * Any created menus will have their assigned term IDs exported to the client\n\t * via the {@see 'customize_save_response'} filter. Likewise, any errors will be exported\n\t * to the client via the customize_save_response() filter.\n\t *\n\t * To delete a menu, the client can send false as the value.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see wp_update_nav_menu_object()\n\t *\n\t * @param array|false $value {\n\t *     The value to update. Note that slug cannot be updated via wp_update_nav_menu_object().\n\t *     If false, then the menu will be deleted entirely.\n\t *\n\t *     @type string $name        The name of the menu to save.\n\t *     @type string $description The term description. Default empty string.\n\t *     @type int    $parent      The id of the parent term. Default 0.\n\t *     @type bool   $auto_add    Whether pages will auto_add to this menu. Default false.\n\t * }\n\t * @return null|void\n\t */\n\tprotected function update( $value ) {\n\t\tif ( $this->is_updated ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->is_updated = true;\n\t\t$is_placeholder   = ( $this->term_id < 0 );\n\t\t$is_delete        = ( false === $value );\n\n\t\tadd_filter( 'customize_save_response', array( $this, 'amend_customize_save_response' ) );\n\n\t\t$auto_add = null;\n\t\tif ( $is_delete ) {\n\t\t\t// If the current setting term is a placeholder, a delete request is a no-op.\n\t\t\tif ( $is_placeholder ) {\n\t\t\t\t$this->update_status = 'deleted';\n\t\t\t} else {\n\t\t\t\t$r = wp_delete_nav_menu( $this->term_id );\n\n\t\t\t\tif ( is_wp_error( $r ) ) {\n\t\t\t\t\t$this->update_status = 'error';\n\t\t\t\t\t$this->update_error  = $r;\n\t\t\t\t} else {\n\t\t\t\t\t$this->update_status = 'deleted';\n\t\t\t\t\t$auto_add            = false;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Insert or update menu.\n\t\t\t$menu_data              = wp_array_slice_assoc( $value, array( 'description', 'parent' ) );\n\t\t\t$menu_data['menu-name'] = $value['name'];\n\n\t\t\t$menu_id              = $is_placeholder ? 0 : $this->term_id;\n\t\t\t$r                    = wp_update_nav_menu_object( $menu_id, wp_slash( $menu_data ) );\n\t\t\t$original_name        = $menu_data['menu-name'];\n\t\t\t$name_conflict_suffix = 1;\n\t\t\twhile ( is_wp_error( $r ) && 'menu_exists' === $r->get_error_code() ) {\n\t\t\t\t$name_conflict_suffix += 1;\n\t\t\t\t/* translators: 1: Original menu name, 2: Duplicate count. */\n\t\t\t\t$menu_data['menu-name'] = sprintf( __( '%1$s (%2$d)' ), $original_name, $name_conflict_suffix );\n\t\t\t\t$r                      = wp_update_nav_menu_object( $menu_id, wp_slash( $menu_data ) );\n\t\t\t}\n\n\t\t\tif ( is_wp_error( $r ) ) {\n\t\t\t\t$this->update_status = 'error';\n\t\t\t\t$this->update_error  = $r;\n\t\t\t} else {\n\t\t\t\tif ( $is_placeholder ) {\n\t\t\t\t\t$this->previous_term_id = $this->term_id;\n\t\t\t\t\t$this->term_id          = $r;\n\t\t\t\t\t$this->update_status    = 'inserted';\n\t\t\t\t} else {\n\t\t\t\t\t$this->update_status = 'updated';\n\t\t\t\t}\n\n\t\t\t\t$auto_add = $value['auto_add'];\n\t\t\t}\n\t\t}\n\n\t\tif ( null !== $auto_add ) {\n\t\t\t$nav_menu_options = $this->filter_nav_menu_options_value(\n\t\t\t\t(array) get_option( 'nav_menu_options', array() ),\n\t\t\t\t$this->term_id,\n\t\t\t\t$auto_add\n\t\t\t);\n\t\t\tupdate_option( 'nav_menu_options', $nav_menu_options );\n\t\t}\n\n\t\tif ( 'inserted' === $this->update_status ) {\n\t\t\t// Make sure that new menus assigned to nav menu locations use their new IDs.\n\t\t\tforeach ( $this->manager->settings() as $setting ) {\n\t\t\t\tif ( ! preg_match( '/^nav_menu_locations\\[/', $setting->id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$post_value = $setting->post_value( null );\n\t\t\t\tif ( ! is_null( $post_value ) && intval( $post_value ) === $this->previous_term_id ) {\n\t\t\t\t\t$this->manager->set_post_value( $setting->id, $this->term_id );\n\t\t\t\t\t$setting->save();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Make sure that any nav_menu widgets referencing the placeholder nav menu get updated and sent back to client.\n\t\t\tforeach ( array_keys( $this->manager->unsanitized_post_values() ) as $setting_id ) {\n\t\t\t\t$nav_menu_widget_setting = $this->manager->get_setting( $setting_id );\n\t\t\t\tif ( ! $nav_menu_widget_setting || ! preg_match( '/^widget_nav_menu\\[/', $nav_menu_widget_setting->id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$widget_instance = $nav_menu_widget_setting->post_value(); // Note that this calls WP_Customize_Widgets::sanitize_widget_instance().\n\t\t\t\tif ( empty( $widget_instance['nav_menu'] ) || intval( $widget_instance['nav_menu'] ) !== $this->previous_term_id ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$widget_instance['nav_menu'] = $this->term_id;\n\t\t\t\t$updated_widget_instance     = $this->manager->widgets->sanitize_widget_js_instance( $widget_instance );\n\t\t\t\t$this->manager->set_post_value( $nav_menu_widget_setting->id, $updated_widget_instance );\n\t\t\t\t$nav_menu_widget_setting->save();\n\n\t\t\t\t$this->_widget_nav_menu_updates[ $nav_menu_widget_setting->id ] = $updated_widget_instance;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Updates a nav_menu_options array.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see WP_Customize_Nav_Menu_Setting::filter_nav_menu_options()\n\t * @see WP_Customize_Nav_Menu_Setting::update()\n\t *\n\t * @param array $nav_menu_options Array as returned by get_option( 'nav_menu_options' ).\n\t * @param int   $menu_id          The term ID for the given menu.\n\t * @param bool  $auto_add         Whether to auto-add or not.\n\t * @return array (Maybe) modified nav_menu_otions array.\n\t */\n\tprotected function filter_nav_menu_options_value( $nav_menu_options, $menu_id, $auto_add ) {\n\t\t$nav_menu_options = (array) $nav_menu_options;\n\t\tif ( ! isset( $nav_menu_options['auto_add'] ) ) {\n\t\t\t$nav_menu_options['auto_add'] = array();\n\t\t}\n\n\t\t$i = array_search( $menu_id, $nav_menu_options['auto_add'], true );\n\n\t\tif ( $auto_add && false === $i ) {\n\t\t\tarray_push( $nav_menu_options['auto_add'], $this->term_id );\n\t\t} elseif ( ! $auto_add && false !== $i ) {\n\t\t\tarray_splice( $nav_menu_options['auto_add'], $i, 1 );\n\t\t}\n\n\t\treturn $nav_menu_options;\n\t}\n\n\t/**\n\t * Export data for the JS client.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see WP_Customize_Nav_Menu_Setting::update()\n\t *\n\t * @param array $data Additional information passed back to the 'saved' event on `wp.customize`.\n\t * @return array Export data.\n\t */\n\tpublic function amend_customize_save_response( $data ) {\n\t\tif ( ! isset( $data['nav_menu_updates'] ) ) {\n\t\t\t$data['nav_menu_updates'] = array();\n\t\t}\n\t\tif ( ! isset( $data['widget_nav_menu_updates'] ) ) {\n\t\t\t$data['widget_nav_menu_updates'] = array();\n\t\t}\n\n\t\t$data['nav_menu_updates'][] = array(\n\t\t\t'term_id'          => $this->term_id,\n\t\t\t'previous_term_id' => $this->previous_term_id,\n\t\t\t'error'            => $this->update_error ? $this->update_error->get_error_code() : null,\n\t\t\t'status'           => $this->update_status,\n\t\t\t'saved_value'      => 'deleted' === $this->update_status ? null : $this->value(),\n\t\t);\n\n\t\t$data['widget_nav_menu_updates'] = array_merge(\n\t\t\t$data['widget_nav_menu_updates'],\n\t\t\t$this->_widget_nav_menu_updates\n\t\t);\n\t\t$this->_widget_nav_menu_updates  = array();\n\n\t\treturn $data;\n\t}\n}\n", "num_lines": 652}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Nav_Menus_Panel class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize Nav Menus Panel Class\n *\n * Needed to add screen options.\n *\n * @since 4.3.0\n *\n * @see WP_Customize_Panel\n */\nclass WP_Customize_Nav_Menus_Panel extends WP_Customize_Panel {\n\n\t/**\n\t * Control type.\n\t *\n\t * @since 4.3.0\n\t * @var string\n\t */\n\tpublic $type = 'nav_menus';\n\n\t/**\n\t * Render screen options for Menus.\n\t *\n\t * @since 4.3.0\n\t */\n\tpublic function render_screen_options() {\n\t\t// Adds the screen options.\n\t\trequire_once ABSPATH . 'wp-admin/includes/nav-menu.php';\n\t\tadd_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' );\n\n\t\t// Display screen options.\n\t\t$screen = WP_Screen::get( 'nav-menus.php' );\n\t\t$screen->render_screen_options( array( 'wrap' => false ) );\n\t}\n\n\t/**\n\t * Returns the advanced options for the nav menus page.\n\t *\n\t * Link title attribute added as it's a relatively advanced concept for new users.\n\t *\n\t * @since 4.3.0\n\t * @deprecated 4.5.0 Deprecated in favor of wp_nav_menu_manage_columns().\n\t */\n\tpublic function wp_nav_menu_manage_columns() {\n\t\t_deprecated_function( __METHOD__, '4.5.0', 'wp_nav_menu_manage_columns' );\n\t\trequire_once ABSPATH . 'wp-admin/includes/nav-menu.php';\n\t\treturn wp_nav_menu_manage_columns();\n\t}\n\n\t/**\n\t * An Underscore (JS) template for this panel's content (but not its container).\n\t *\n\t * Class variables for this panel class are available in the `data` JS object;\n\t * export custom variables by overriding WP_Customize_Panel::json().\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see WP_Customize_Panel::print_template()\n\t */\n\tprotected function content_template() {\n\t\t?>\n\t\t<li class=\"panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>\">\n\t\t\t<button type=\"button\" class=\"customize-panel-back\" tabindex=\"-1\">\n\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Back' ); ?></span>\n\t\t\t</button>\n\t\t\t<div class=\"accordion-section-title\">\n\t\t\t\t<span class=\"preview-notice\">\n\t\t\t\t\t<?php\n\t\t\t\t\t/* translators: %s: The site/panel title in the Customizer. */\n\t\t\t\t\tprintf( __( 'You are customizing %s' ), '<strong class=\"panel-title\">{{ data.title }}</strong>' );\n\t\t\t\t\t?>\n\t\t\t\t</span>\n\t\t\t\t<button type=\"button\" class=\"customize-help-toggle dashicons dashicons-editor-help\" aria-expanded=\"false\">\n\t\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Help' ); ?></span>\n\t\t\t\t</button>\n\t\t\t\t<button type=\"button\" class=\"customize-screen-options-toggle\" aria-expanded=\"false\">\n\t\t\t\t\t<span class=\"screen-reader-text\"><?php _e( 'Menu Options' ); ?></span>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t<# if ( data.description ) { #>\n\t\t\t<div class=\"description customize-panel-description\">{{{ data.description }}}</div>\n\t\t\t<# } #>\n\t\t\t<div id=\"screen-options-wrap\">\n\t\t\t\t<?php $this->render_screen_options(); ?>\n\t\t\t</div>\n\t\t</li>\n\t\t<?php\n\t\t// NOTE: The following is a workaround for an inability to treat (and thus label) a list of sections as a whole.\n\t\t?>\n\t\t<li class=\"customize-control-title customize-section-title-nav_menus-heading\"><?php _e( 'Menus' ); ?></li>\n\t\t<?php\n\t}\n}\n", "num_lines": 102}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_New_Menu_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n * @deprecated 4.9.0 This file is no longer used as of the menu creation UX introduced in #40104.\n */\n\n_deprecated_file( basename( __FILE__ ), '4.9.0' );\n\n/**\n * Customize control class for new menus.\n *\n * @since 4.3.0\n * @deprecated 4.9.0 This class is no longer used as of the menu creation UX introduced in #40104.\n *\n * @see WP_Customize_Control\n */\nclass WP_Customize_New_Menu_Control extends WP_Customize_Control {\n\n\t/**\n\t * Control type.\n\t *\n\t * @since 4.3.0\n\t * @var string\n\t */\n\tpublic $type = 'new_menu';\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.9.0\n\t * @deprecated 4.9.0\n\t *\n\t * @see WP_Customize_Control::__construct()\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t * @param string               $id      The control ID.\n\t * @param array                $args    Optional. Arguments to override class property defaults.\n\t *                                      See WP_Customize_Control::__construct() for information\n\t *                                      on accepted arguments. Default empty array.\n\t */\n\tpublic function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {\n\t\t_deprecated_function( __METHOD__, '4.9.0' );\n\t\tparent::__construct( $manager, $id, $args );\n\t}\n\n\t/**\n\t * Render the control's content.\n\t *\n\t * @since 4.3.0\n\t * @deprecated 4.9.0\n\t */\n\tpublic function render_content() {\n\t\t_deprecated_function( __METHOD__, '4.9.0' );\n\t\t?>\n\t\t<button type=\"button\" class=\"button button-primary\" id=\"create-new-menu-submit\"><?php _e( 'Create Menu' ); ?></button>\n\t\t<span class=\"spinner\"></span>\n\t\t<?php\n\t}\n}\n", "num_lines": 64}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_New_Menu_Section class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n * @deprecated 4.9.0 This file is no longer used as of the menu creation UX introduced in #40104.\n */\n\n_deprecated_file( basename( __FILE__ ), '4.9.0' );\n\n/**\n * Customize Menu Section Class\n *\n * @since 4.3.0\n * @deprecated 4.9.0 This class is no longer used as of the menu creation UX introduced in #40104.\n *\n * @see WP_Customize_Section\n */\nclass WP_Customize_New_Menu_Section extends WP_Customize_Section {\n\n\t/**\n\t * Control type.\n\t *\n\t * @since 4.3.0\n\t * @var string\n\t */\n\tpublic $type = 'new_menu';\n\n\t/**\n\t * Constructor.\n\t *\n\t * Any supplied $args override class property defaults.\n\t *\n\t * @since 4.9.0\n\t * @deprecated 4.9.0\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t * @param string               $id      A specific ID of the section.\n\t * @param array                $args    Section arguments.\n\t */\n\tpublic function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {\n\t\t_deprecated_function( __METHOD__, '4.9.0' );\n\t\tparent::__construct( $manager, $id, $args );\n\t}\n\n\t/**\n\t * Render the section, and the controls that have been added to it.\n\t *\n\t * @since 4.3.0\n\t * @deprecated 4.9.0\n\t */\n\tprotected function render() {\n\t\t_deprecated_function( __METHOD__, '4.9.0' );\n\t\t?>\n\t\t<li id=\"accordion-section-<?php echo esc_attr( $this->id ); ?>\" class=\"accordion-section-new-menu\">\n\t\t\t<button type=\"button\" class=\"button add-new-menu-item add-menu-toggle\" aria-expanded=\"false\">\n\t\t\t\t<?php echo esc_html( $this->title ); ?>\n\t\t\t</button>\n\t\t\t<ul class=\"new-menu-section-content\"></ul>\n\t\t</li>\n\t\t<?php\n\t}\n}\n", "num_lines": 66}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Partial class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.5.0\n */\n\n/**\n * Core Customizer class for implementing selective refresh partials.\n *\n * Representation of a rendered region in the previewed page that gets\n * selectively refreshed when an associated setting is changed.\n * This class is analogous of WP_Customize_Control.\n *\n * @since 4.5.0\n */\nclass WP_Customize_Partial {\n\n\t/**\n\t * Component.\n\t *\n\t * @since 4.5.0\n\t * @var WP_Customize_Selective_Refresh\n\t */\n\tpublic $component;\n\n\t/**\n\t * Unique identifier for the partial.\n\t *\n\t * If the partial is used to display a single setting, this would generally\n\t * be the same as the associated setting's ID.\n\t *\n\t * @since 4.5.0\n\t * @var string\n\t */\n\tpublic $id;\n\n\t/**\n\t * Parsed ID.\n\t *\n\t * @since 4.5.0\n\t * @var array {\n\t *     @type string $base ID base.\n\t *     @type array  $keys Keys for multidimensional.\n\t * }\n\t */\n\tprotected $id_data = array();\n\n\t/**\n\t * Type of this partial.\n\t *\n\t * @since 4.5.0\n\t * @var string\n\t */\n\tpublic $type = 'default';\n\n\t/**\n\t * The jQuery selector to find the container element for the partial.\n\t *\n\t * @since 4.5.0\n\t * @var string\n\t */\n\tpublic $selector;\n\n\t/**\n\t * IDs for settings tied to the partial.\n\t *\n\t * @since 4.5.0\n\t * @var string[]\n\t */\n\tpublic $settings;\n\n\t/**\n\t * The ID for the setting that this partial is primarily responsible for rendering.\n\t *\n\t * If not supplied, it will default to the ID of the first setting.\n\t *\n\t * @since 4.5.0\n\t * @var string\n\t */\n\tpublic $primary_setting;\n\n\t/**\n\t * Capability required to edit this partial.\n\t *\n\t * Normally this is empty and the capability is derived from the capabilities\n\t * of the associated `$settings`.\n\t *\n\t * @since 4.5.0\n\t * @var string\n\t */\n\tpublic $capability;\n\n\t/**\n\t * Render callback.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @see WP_Customize_Partial::render()\n\t * @var callable Callback is called with one argument, the instance of\n\t *               WP_Customize_Partial. The callback can either echo the\n\t *               partial or return the partial as a string, or return false if error.\n\t */\n\tpublic $render_callback;\n\n\t/**\n\t * Whether the container element is included in the partial, or if only the contents are rendered.\n\t *\n\t * @since 4.5.0\n\t * @var bool\n\t */\n\tpublic $container_inclusive = false;\n\n\t/**\n\t * Whether to refresh the entire preview in case a partial cannot be refreshed.\n\t *\n\t * A partial render is considered a failure if the render_callback returns false.\n\t *\n\t * @since 4.5.0\n\t * @var bool\n\t */\n\tpublic $fallback_refresh = true;\n\n\t/**\n\t * Constructor.\n\t *\n\t * Supplied `$args` override class property defaults.\n\t *\n\t * If `$args['settings']` is not defined, use the $id as the setting ID.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param WP_Customize_Selective_Refresh $component Customize Partial Refresh plugin instance.\n\t * @param string                         $id        Control ID.\n\t * @param array                          $args {\n\t *     Optional. Array of properties for the new Partials object. Default empty array.\n\t *\n\t *     @type string   $type                  Type of the partial to be created.\n\t *     @type string   $selector              The jQuery selector to find the container element for the partial, that is,\n\t *                                           a partial's placement.\n\t *     @type string[] $settings              IDs for settings tied to the partial. If undefined, `$id` will be used.\n\t *     @type string   $primary_setting       The ID for the setting that this partial is primarily responsible for\n\t *                                           rendering. If not supplied, it will default to the ID of the first setting.\n\t *     @type string   $capability            Capability required to edit this partial.\n\t *                                           Normally this is empty and the capability is derived from the capabilities\n\t *                                           of the associated `$settings`.\n\t *     @type callable $render_callback       Render callback.\n\t *                                           Callback is called with one argument, the instance of WP_Customize_Partial.\n\t *                                           The callback can either echo the partial or return the partial as a string,\n\t *                                           or return false if error.\n\t *     @type bool     $container_inclusive   Whether the container element is included in the partial, or if only\n\t *                                           the contents are rendered.\n\t *     @type bool     $fallback_refresh      Whether to refresh the entire preview in case a partial cannot be refreshed.\n\t *                                           A partial render is considered a failure if the render_callback returns\n\t *                                           false.\n\t * }\n\t */\n\tpublic function __construct( WP_Customize_Selective_Refresh $component, $id, $args = array() ) {\n\t\t$keys = array_keys( get_object_vars( $this ) );\n\t\tforeach ( $keys as $key ) {\n\t\t\tif ( isset( $args[ $key ] ) ) {\n\t\t\t\t$this->$key = $args[ $key ];\n\t\t\t}\n\t\t}\n\n\t\t$this->component       = $component;\n\t\t$this->id              = $id;\n\t\t$this->id_data['keys'] = preg_split( '/\\[/', str_replace( ']', '', $this->id ) );\n\t\t$this->id_data['base'] = array_shift( $this->id_data['keys'] );\n\n\t\tif ( empty( $this->render_callback ) ) {\n\t\t\t$this->render_callback = array( $this, 'render_callback' );\n\t\t}\n\n\t\t// Process settings.\n\t\tif ( ! isset( $this->settings ) ) {\n\t\t\t$this->settings = array( $id );\n\t\t} elseif ( is_string( $this->settings ) ) {\n\t\t\t$this->settings = array( $this->settings );\n\t\t}\n\n\t\tif ( empty( $this->primary_setting ) ) {\n\t\t\t$this->primary_setting = current( $this->settings );\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves parsed ID data for multidimensional setting.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @return array {\n\t *     ID data for multidimensional partial.\n\t *\n\t *     @type string $base ID base.\n\t *     @type array  $keys Keys for multidimensional array.\n\t * }\n\t */\n\tfinal public function id_data() {\n\t\treturn $this->id_data;\n\t}\n\n\t/**\n\t * Renders the template partial involving the associated settings.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param array $container_context Optional. Array of context data associated with the target container (placement).\n\t *                                 Default empty array.\n\t * @return string|array|false The rendered partial as a string, raw data array (for client-side JS template),\n\t *                            or false if no render applied.\n\t */\n\tfinal public function render( $container_context = array() ) {\n\t\t$partial  = $this;\n\t\t$rendered = false;\n\n\t\tif ( ! empty( $this->render_callback ) ) {\n\t\t\tob_start();\n\t\t\t$return_render = call_user_func( $this->render_callback, $this, $container_context );\n\t\t\t$ob_render     = ob_get_clean();\n\n\t\t\tif ( null !== $return_render && '' !== $ob_render ) {\n\t\t\t\t_doing_it_wrong( __FUNCTION__, __( 'Partial render must echo the content or return the content string (or array), but not both.' ), '4.5.0' );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Note that the string return takes precedence because the $ob_render may just\\\n\t\t\t * include PHP warnings or notices.\n\t\t\t */\n\t\t\t$rendered = null !== $return_render ? $return_render : $ob_render;\n\t\t}\n\n\t\t/**\n\t\t * Filters partial rendering.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @param string|array|false   $rendered          The partial value. Default false.\n\t\t * @param WP_Customize_Partial $partial           WP_Customize_Setting instance.\n\t\t * @param array                $container_context Optional array of context data associated with\n\t\t *                                                the target container.\n\t\t */\n\t\t$rendered = apply_filters( 'customize_partial_render', $rendered, $partial, $container_context );\n\n\t\t/**\n\t\t * Filters partial rendering for a specific partial.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$partial->ID` refers to the partial ID.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @param string|array|false   $rendered          The partial value. Default false.\n\t\t * @param WP_Customize_Partial $partial           WP_Customize_Setting instance.\n\t\t * @param array                $container_context Optional array of context data associated with\n\t\t *                                                the target container.\n\t\t */\n\t\t$rendered = apply_filters( \"customize_partial_render_{$partial->id}\", $rendered, $partial, $container_context );\n\n\t\treturn $rendered;\n\t}\n\n\t/**\n\t * Default callback used when invoking WP_Customize_Control::render().\n\t *\n\t * Note that this method may echo the partial *or* return the partial as\n\t * a string or array, but not both. Output buffering is performed when this\n\t * is called. Subclasses can override this with their specific logic, or they\n\t * may provide an 'render_callback' argument to the constructor.\n\t *\n\t * This method may return an HTML string for straight DOM injection, or it\n\t * may return an array for supporting Partial JS subclasses to render by\n\t * applying to client-side templating.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param WP_Customize_Partial $partial Partial.\n\t * @param array                $context Context.\n\t * @return string|array|false\n\t */\n\tpublic function render_callback( WP_Customize_Partial $partial, $context = array() ) {\n\t\tunset( $partial, $context );\n\t\treturn false;\n\t}\n\n\t/**\n\t * Retrieves the data to export to the client via JSON.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @return array Array of parameters passed to the JavaScript.\n\t */\n\tpublic function json() {\n\t\t$exports = array(\n\t\t\t'settings'           => $this->settings,\n\t\t\t'primarySetting'     => $this->primary_setting,\n\t\t\t'selector'           => $this->selector,\n\t\t\t'type'               => $this->type,\n\t\t\t'fallbackRefresh'    => $this->fallback_refresh,\n\t\t\t'containerInclusive' => $this->container_inclusive,\n\t\t);\n\t\treturn $exports;\n\t}\n\n\t/**\n\t * Checks if the user can refresh this partial.\n\t *\n\t * Returns false if the user cannot manipulate one of the associated settings,\n\t * or if one of the associated settings does not exist.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @return bool False if user can't edit one of the related settings,\n\t *                    or if one of the associated settings does not exist.\n\t */\n\tfinal public function check_capabilities() {\n\t\tif ( ! empty( $this->capability ) && ! current_user_can( $this->capability ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ( $this->settings as $setting_id ) {\n\t\t\t$setting = $this->component->manager->get_setting( $setting_id );\n\t\t\tif ( ! $setting || ! $setting->check_capabilities() ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}\n", "num_lines": 330}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Selective_Refresh class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.5.0\n */\n\n/**\n * Core Customizer class for implementing selective refresh.\n *\n * @since 4.5.0\n */\nfinal class WP_Customize_Selective_Refresh {\n\n\t/**\n\t * Query var used in requests to render partials.\n\t *\n\t * @since 4.5.0\n\t */\n\tconst RENDER_QUERY_VAR = 'wp_customize_render_partials';\n\n\t/**\n\t * Customize manager.\n\t *\n\t * @since 4.5.0\n\t * @var WP_Customize_Manager\n\t */\n\tpublic $manager;\n\n\t/**\n\t * Registered instances of WP_Customize_Partial.\n\t *\n\t * @since 4.5.0\n\t * @var WP_Customize_Partial[]\n\t */\n\tprotected $partials = array();\n\n\t/**\n\t * Log of errors triggered when partials are rendered.\n\t *\n\t * @since 4.5.0\n\t * @var array\n\t */\n\tprotected $triggered_errors = array();\n\n\t/**\n\t * Keep track of the current partial being rendered.\n\t *\n\t * @since 4.5.0\n\t * @var string|null\n\t */\n\tprotected $current_partial_id;\n\n\t/**\n\t * Plugin bootstrap for Partial Refresh functionality.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t */\n\tpublic function __construct( WP_Customize_Manager $manager ) {\n\t\t$this->manager = $manager;\n\t\trequire_once ABSPATH . WPINC . '/customize/class-wp-customize-partial.php';\n\n\t\tadd_action( 'customize_preview_init', array( $this, 'init_preview' ) );\n\t}\n\n\t/**\n\t * Retrieves the registered partials.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @return array Partials.\n\t */\n\tpublic function partials() {\n\t\treturn $this->partials;\n\t}\n\n\t/**\n\t * Adds a partial.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @see WP_Customize_Partial::__construct()\n\t *\n\t * @param WP_Customize_Partial|string $id   Customize Partial object, or Partial ID.\n\t * @param array                       $args Optional. Array of properties for the new Partials object.\n\t *                                          See WP_Customize_Partial::__construct() for information\n\t *                                          on accepted arguments. Default empty array.\n\t * @return WP_Customize_Partial The instance of the partial that was added.\n\t */\n\tpublic function add_partial( $id, $args = array() ) {\n\t\tif ( $id instanceof WP_Customize_Partial ) {\n\t\t\t$partial = $id;\n\t\t} else {\n\t\t\t$class = 'WP_Customize_Partial';\n\n\t\t\t/** This filter is documented in wp-includes/customize/class-wp-customize-selective-refresh.php */\n\t\t\t$args = apply_filters( 'customize_dynamic_partial_args', $args, $id );\n\n\t\t\t/** This filter is documented in wp-includes/customize/class-wp-customize-selective-refresh.php */\n\t\t\t$class = apply_filters( 'customize_dynamic_partial_class', $class, $id, $args );\n\n\t\t\t$partial = new $class( $this, $id, $args );\n\t\t}\n\n\t\t$this->partials[ $partial->id ] = $partial;\n\t\treturn $partial;\n\t}\n\n\t/**\n\t * Retrieves a partial.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param string $id Customize Partial ID.\n\t * @return WP_Customize_Partial|null The partial, if set. Otherwise null.\n\t */\n\tpublic function get_partial( $id ) {\n\t\tif ( isset( $this->partials[ $id ] ) ) {\n\t\t\treturn $this->partials[ $id ];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t/**\n\t * Removes a partial.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param string $id Customize Partial ID.\n\t */\n\tpublic function remove_partial( $id ) {\n\t\tunset( $this->partials[ $id ] );\n\t}\n\n\t/**\n\t * Initializes the Customizer preview.\n\t *\n\t * @since 4.5.0\n\t */\n\tpublic function init_preview() {\n\t\tadd_action( 'template_redirect', array( $this, 'handle_render_partials_request' ) );\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_preview_scripts' ) );\n\t}\n\n\t/**\n\t * Enqueues preview scripts.\n\t *\n\t * @since 4.5.0\n\t */\n\tpublic function enqueue_preview_scripts() {\n\t\twp_enqueue_script( 'customize-selective-refresh' );\n\t\tadd_action( 'wp_footer', array( $this, 'export_preview_data' ), 1000 );\n\t}\n\n\t/**\n\t * Exports data in preview after it has finished rendering so that partials can be added at runtime.\n\t *\n\t * @since 4.5.0\n\t */\n\tpublic function export_preview_data() {\n\t\t$partials = array();\n\n\t\tforeach ( $this->partials() as $partial ) {\n\t\t\tif ( $partial->check_capabilities() ) {\n\t\t\t\t$partials[ $partial->id ] = $partial->json();\n\t\t\t}\n\t\t}\n\n\t\t$switched_locale = switch_to_locale( get_user_locale() );\n\t\t$l10n            = array(\n\t\t\t'shiftClickToEdit' => __( 'Shift-click to edit this element.' ),\n\t\t\t'clickEditMenu'    => __( 'Click to edit this menu.' ),\n\t\t\t'clickEditWidget'  => __( 'Click to edit this widget.' ),\n\t\t\t'clickEditTitle'   => __( 'Click to edit the site title.' ),\n\t\t\t'clickEditMisc'    => __( 'Click to edit this element.' ),\n\t\t\t/* translators: %s: document.write() */\n\t\t\t'badDocumentWrite' => sprintf( __( '%s is forbidden' ), 'document.write()' ),\n\t\t);\n\t\tif ( $switched_locale ) {\n\t\t\trestore_previous_locale();\n\t\t}\n\n\t\t$exports = array(\n\t\t\t'partials'       => $partials,\n\t\t\t'renderQueryVar' => self::RENDER_QUERY_VAR,\n\t\t\t'l10n'           => $l10n,\n\t\t);\n\n\t\t// Export data to JS.\n\t\tprintf( '<script>var _customizePartialRefreshExports = %s;</script>', wp_json_encode( $exports ) );\n\t}\n\n\t/**\n\t * Registers dynamically-created partials.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @see WP_Customize_Manager::add_dynamic_settings()\n\t *\n\t * @param string[] $partial_ids Array of the partial IDs to add.\n\t * @return WP_Customize_Partial[] Array of added WP_Customize_Partial instances.\n\t */\n\tpublic function add_dynamic_partials( $partial_ids ) {\n\t\t$new_partials = array();\n\n\t\tforeach ( $partial_ids as $partial_id ) {\n\n\t\t\t// Skip partials already created.\n\t\t\t$partial = $this->get_partial( $partial_id );\n\t\t\tif ( $partial ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$partial_args  = false;\n\t\t\t$partial_class = 'WP_Customize_Partial';\n\n\t\t\t/**\n\t\t\t * Filters a dynamic partial's constructor arguments.\n\t\t\t *\n\t\t\t * For a dynamic partial to be registered, this filter must be employed\n\t\t\t * to override the default false value with an array of args to pass to\n\t\t\t * the WP_Customize_Partial constructor.\n\t\t\t *\n\t\t\t * @since 4.5.0\n\t\t\t *\n\t\t\t * @param false|array $partial_args The arguments to the WP_Customize_Partial constructor.\n\t\t\t * @param string      $partial_id   ID for dynamic partial.\n\t\t\t */\n\t\t\t$partial_args = apply_filters( 'customize_dynamic_partial_args', $partial_args, $partial_id );\n\t\t\tif ( false === $partial_args ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the class used to construct partials.\n\t\t\t *\n\t\t\t * Allow non-statically created partials to be constructed with custom WP_Customize_Partial subclass.\n\t\t\t *\n\t\t\t * @since 4.5.0\n\t\t\t *\n\t\t\t * @param string $partial_class WP_Customize_Partial or a subclass.\n\t\t\t * @param string $partial_id    ID for dynamic partial.\n\t\t\t * @param array  $partial_args  The arguments to the WP_Customize_Partial constructor.\n\t\t\t */\n\t\t\t$partial_class = apply_filters( 'customize_dynamic_partial_class', $partial_class, $partial_id, $partial_args );\n\n\t\t\t$partial = new $partial_class( $this, $partial_id, $partial_args );\n\n\t\t\t$this->add_partial( $partial );\n\t\t\t$new_partials[] = $partial;\n\t\t}\n\t\treturn $new_partials;\n\t}\n\n\t/**\n\t * Checks whether the request is for rendering partials.\n\t *\n\t * Note that this will not consider whether the request is authorized or valid,\n\t * just that essentially the route is a match.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @return bool Whether the request is for rendering partials.\n\t */\n\tpublic function is_render_partials_request() {\n\t\treturn ! empty( $_POST[ self::RENDER_QUERY_VAR ] );\n\t}\n\n\t/**\n\t * Handles PHP errors triggered during rendering the partials.\n\t *\n\t * These errors will be relayed back to the client in the Ajax response.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param int    $errno   Error number.\n\t * @param string $errstr  Error string.\n\t * @param string $errfile Error file.\n\t * @param string $errline Error line.\n\t * @return true Always true.\n\t */\n\tpublic function handle_error( $errno, $errstr, $errfile = null, $errline = null ) {\n\t\t$this->triggered_errors[] = array(\n\t\t\t'partial'      => $this->current_partial_id,\n\t\t\t'error_number' => $errno,\n\t\t\t'error_string' => $errstr,\n\t\t\t'error_file'   => $errfile,\n\t\t\t'error_line'   => $errline,\n\t\t);\n\t\treturn true;\n\t}\n\n\t/**\n\t * Handles the Ajax request to return the rendered partials for the requested placements.\n\t *\n\t * @since 4.5.0\n\t */\n\tpublic function handle_render_partials_request() {\n\t\tif ( ! $this->is_render_partials_request() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Note that is_customize_preview() returning true will entail that the\n\t\t * user passed the 'customize' capability check and the nonce check, since\n\t\t * WP_Customize_Manager::setup_theme() is where the previewing flag is set.\n\t\t */\n\t\tif ( ! is_customize_preview() ) {\n\t\t\twp_send_json_error( 'expected_customize_preview', 403 );\n\t\t} elseif ( ! isset( $_POST['partials'] ) ) {\n\t\t\twp_send_json_error( 'missing_partials', 400 );\n\t\t}\n\n\t\t// Ensure that doing selective refresh on 404 template doesn't result in fallback rendering behavior (full refreshes).\n\t\tstatus_header( 200 );\n\n\t\t$partials = json_decode( wp_unslash( $_POST['partials'] ), true );\n\n\t\tif ( ! is_array( $partials ) ) {\n\t\t\twp_send_json_error( 'malformed_partials' );\n\t\t}\n\n\t\t$this->add_dynamic_partials( array_keys( $partials ) );\n\n\t\t/**\n\t\t * Fires immediately before partials are rendered.\n\t\t *\n\t\t * Plugins may do things like call wp_enqueue_scripts() and gather a list of the scripts\n\t\t * and styles which may get enqueued in the response.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @param WP_Customize_Selective_Refresh $this     Selective refresh component.\n\t\t * @param array                          $partials Placements' context data for the partials rendered in the request.\n\t\t *                                                 The array is keyed by partial ID, with each item being an array of\n\t\t *                                                 the placements' context data.\n\t\t */\n\t\tdo_action( 'customize_render_partials_before', $this, $partials );\n\n\t\tset_error_handler( array( $this, 'handle_error' ), error_reporting() );\n\n\t\t$contents = array();\n\n\t\tforeach ( $partials as $partial_id => $container_contexts ) {\n\t\t\t$this->current_partial_id = $partial_id;\n\n\t\t\tif ( ! is_array( $container_contexts ) ) {\n\t\t\t\twp_send_json_error( 'malformed_container_contexts' );\n\t\t\t}\n\n\t\t\t$partial = $this->get_partial( $partial_id );\n\n\t\t\tif ( ! $partial || ! $partial->check_capabilities() ) {\n\t\t\t\t$contents[ $partial_id ] = null;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$contents[ $partial_id ] = array();\n\n\t\t\t// @todo The array should include not only the contents, but also whether the container is included?\n\t\t\tif ( empty( $container_contexts ) ) {\n\t\t\t\t// Since there are no container contexts, render just once.\n\t\t\t\t$contents[ $partial_id ][] = $partial->render( null );\n\t\t\t} else {\n\t\t\t\tforeach ( $container_contexts as $container_context ) {\n\t\t\t\t\t$contents[ $partial_id ][] = $partial->render( $container_context );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->current_partial_id = null;\n\n\t\trestore_error_handler();\n\n\t\t/**\n\t\t * Fires immediately after partials are rendered.\n\t\t *\n\t\t * Plugins may do things like call wp_footer() to scrape scripts output and return them\n\t\t * via the {@see 'customize_render_partials_response'} filter.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @param WP_Customize_Selective_Refresh $this     Selective refresh component.\n\t\t * @param array                          $partials Placements' context data for the partials rendered in the request.\n\t\t *                                                 The array is keyed by partial ID, with each item being an array of\n\t\t *                                                 the placements' context data.\n\t\t */\n\t\tdo_action( 'customize_render_partials_after', $this, $partials );\n\n\t\t$response = array(\n\t\t\t'contents' => $contents,\n\t\t);\n\n\t\tif ( defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY ) {\n\t\t\t$response['errors'] = $this->triggered_errors;\n\t\t}\n\n\t\t$setting_validities             = $this->manager->validate_setting_values( $this->manager->unsanitized_post_values() );\n\t\t$exported_setting_validities    = array_map( array( $this->manager, 'prepare_setting_validity_for_js' ), $setting_validities );\n\t\t$response['setting_validities'] = $exported_setting_validities;\n\n\t\t/**\n\t\t * Filters the response from rendering the partials.\n\t\t *\n\t\t * Plugins may use this filter to inject `$scripts` and `$styles`, which are dependencies\n\t\t * for the partials being rendered. The response data will be available to the client via\n\t\t * the `render-partials-response` JS event, so the client can then inject the scripts and\n\t\t * styles into the DOM if they have not already been enqueued there.\n\t\t *\n\t\t * If plugins do this, they'll need to take care for any scripts that do `document.write()`\n\t\t * and make sure that these are not injected, or else to override the function to no-op,\n\t\t * or else the page will be destroyed.\n\t\t *\n\t\t * Plugins should be aware that `$scripts` and `$styles` may eventually be included by\n\t\t * default in the response.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @param array $response {\n\t\t *     Response.\n\t\t *\n\t\t *     @type array $contents Associative array mapping a partial ID its corresponding array of contents\n\t\t *                           for the containers requested.\n\t\t *     @type array $errors   List of errors triggered during rendering of partials, if `WP_DEBUG_DISPLAY`\n\t\t *                           is enabled.\n\t\t * }\n\t\t * @param WP_Customize_Selective_Refresh $this     Selective refresh component.\n\t\t * @param array                          $partials Placements' context data for the partials rendered in the request.\n\t\t *                                                 The array is keyed by partial ID, with each item being an array of\n\t\t *                                                 the placements' context data.\n\t\t */\n\t\t$response = apply_filters( 'customize_render_partials_response', $response, $this, $partials );\n\n\t\twp_send_json_success( $response );\n\t}\n}\n", "num_lines": 441}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Sidebar_Section class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customizer section representing widget area (sidebar).\n *\n * @since 4.1.0\n *\n * @see WP_Customize_Section\n */\nclass WP_Customize_Sidebar_Section extends WP_Customize_Section {\n\n\t/**\n\t * Type of this section.\n\t *\n\t * @since 4.1.0\n\t * @var string\n\t */\n\tpublic $type = 'sidebar';\n\n\t/**\n\t * Unique identifier.\n\t *\n\t * @since 4.1.0\n\t * @var string\n\t */\n\tpublic $sidebar_id;\n\n\t/**\n\t * Gather the parameters passed to client JavaScript via JSON.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @return array The array to be exported to the client as JSON.\n\t */\n\tpublic function json() {\n\t\t$json              = parent::json();\n\t\t$json['sidebarId'] = $this->sidebar_id;\n\t\treturn $json;\n\t}\n\n\t/**\n\t * Whether the current sidebar is rendered on the page.\n\t *\n\t * @since 4.1.0\n\t *\n\t * @return bool Whether sidebar is rendered.\n\t */\n\tpublic function active_callback() {\n\t\treturn $this->manager->widgets->is_sidebar_rendered( $this->sidebar_id );\n\t}\n}\n", "num_lines": 59}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Site_Icon_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize Site Icon control class.\n *\n * Used only for custom functionality in JavaScript.\n *\n * @since 4.3.0\n *\n * @see WP_Customize_Cropped_Image_Control\n */\nclass WP_Customize_Site_Icon_Control extends WP_Customize_Cropped_Image_Control {\n\n\t/**\n\t * Control type.\n\t *\n\t * @since 4.3.0\n\t * @var string\n\t */\n\tpublic $type = 'site_icon';\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.3.0\n\t *\n\t * @see WP_Customize_Control::__construct()\n\t *\n\t * @param WP_Customize_Manager $manager Customizer bootstrap instance.\n\t * @param string               $id      Control ID.\n\t * @param array                $args    Optional. Arguments to override class property defaults.\n\t *                                      See WP_Customize_Control::__construct() for information\n\t *                                      on accepted arguments. Default empty array.\n\t */\n\tpublic function __construct( $manager, $id, $args = array() ) {\n\t\tparent::__construct( $manager, $id, $args );\n\t\tadd_action( 'customize_controls_print_styles', 'wp_site_icon', 99 );\n\t}\n\n\t/**\n\t * Renders a JS template for the content of the site icon control.\n\t *\n\t * @since 4.5.0\n\t */\n\tpublic function content_template() {\n\t\t?>\n\t\t<# if ( data.label ) { #>\n\t\t\t<span class=\"customize-control-title\">{{ data.label }}</span>\n\t\t<# } #>\n\t\t<# if ( data.description ) { #>\n\t\t\t<span class=\"description customize-control-description\">{{{ data.description }}}</span>\n\t\t<# } #>\n\n\t\t<# if ( data.attachment && data.attachment.id ) { #>\n\t\t\t<div class=\"attachment-media-view\">\n\t\t\t\t<# if ( data.attachment.sizes ) { #>\n\t\t\t\t\t<div class=\"site-icon-preview wp-clearfix\">\n\t\t\t\t\t\t<div class=\"favicon-preview\">\n\t\t\t\t\t\t\t<img src=\"<?php echo esc_url( admin_url( 'images/' . ( is_rtl() ? 'browser-rtl.png' : 'browser.png' ) ) ); ?>\" class=\"browser-preview\" width=\"182\" alt=\"\" />\n\n\t\t\t\t\t\t\t<div class=\"favicon\">\n\t\t\t\t\t\t\t\t<img src=\"{{ data.attachment.sizes.full ? data.attachment.sizes.full.url : data.attachment.url }}\" alt=\"<?php esc_attr_e( 'Preview as a browser icon' ); ?>\"/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<span class=\"browser-title\" aria-hidden=\"true\"><# print( '<?php bloginfo( 'name' ); ?>' ) #></span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<img class=\"app-icon-preview\" src=\"{{ data.attachment.sizes.full ? data.attachment.sizes.full.url : data.attachment.url }}\" alt=\"<?php esc_attr_e( 'Preview as an app icon' ); ?>\"/>\n\t\t\t\t\t</div>\n\t\t\t\t<# } #>\n\t\t\t\t<div class=\"actions\">\n\t\t\t\t\t<# if ( data.canUpload ) { #>\n\t\t\t\t\t\t<button type=\"button\" class=\"button remove-button\"><?php echo $this->button_labels['remove']; ?></button>\n\t\t\t\t\t\t<button type=\"button\" class=\"button upload-button\"><?php echo $this->button_labels['change']; ?></button>\n\t\t\t\t\t<# } #>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<# } else { #>\n\t\t\t<div class=\"attachment-media-view\">\n\t\t\t\t<# if ( data.canUpload ) { #>\n\t\t\t\t\t<button type=\"button\" class=\"upload-button button-add-media\"><?php echo $this->button_labels['site_icon']; ?></button>\n\t\t\t\t<# } #>\n\t\t\t\t<div class=\"actions\">\n\t\t\t\t\t<# if ( data.defaultAttachment ) { #>\n\t\t\t\t\t\t<button type=\"button\" class=\"button default-button\"><?php echo $this->button_labels['default']; ?></button>\n\t\t\t\t\t<# } #>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<# } #>\n\t\t<?php\n\t}\n}\n", "num_lines": 98}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Theme_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize Theme Control class.\n *\n * @since 4.2.0\n *\n * @see WP_Customize_Control\n */\nclass WP_Customize_Theme_Control extends WP_Customize_Control {\n\n\t/**\n\t * Customize control type.\n\t *\n\t * @since 4.2.0\n\t * @var string\n\t */\n\tpublic $type = 'theme';\n\n\t/**\n\t * Theme object.\n\t *\n\t * @since 4.2.0\n\t * @var WP_Theme\n\t */\n\tpublic $theme;\n\n\t/**\n\t * Refresh the parameters passed to the JavaScript via JSON.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @see WP_Customize_Control::to_json()\n\t */\n\tpublic function to_json() {\n\t\tparent::to_json();\n\t\t$this->json['theme'] = $this->theme;\n\t}\n\n\t/**\n\t * Don't render the control content from PHP, as it's rendered via JS on load.\n\t *\n\t * @since 4.2.0\n\t */\n\tpublic function render_content() {}\n\n\t/**\n\t * Render a JS template for theme display.\n\t *\n\t * @since 4.2.0\n\t */\n\tpublic function content_template() {\n\t\t/* translators: %s: Theme name. */\n\t\t$details_label = sprintf( __( 'Details for theme: %s' ), '{{ data.theme.name }}' );\n\t\t/* translators: %s: Theme name. */\n\t\t$customize_label = sprintf( __( 'Customize theme: %s' ), '{{ data.theme.name }}' );\n\t\t/* translators: %s: Theme name. */\n\t\t$preview_label = sprintf( __( 'Live preview theme: %s' ), '{{ data.theme.name }}' );\n\t\t/* translators: %s: Theme name. */\n\t\t$install_label = sprintf( __( 'Install and preview theme: %s' ), '{{ data.theme.name }}' );\n\t\t?>\n\t\t<# if ( data.theme.active ) { #>\n\t\t\t<div class=\"theme active\" tabindex=\"0\" aria-describedby=\"{{ data.section }}-{{ data.theme.id }}-action\">\n\t\t<# } else { #>\n\t\t\t<div class=\"theme\" tabindex=\"0\" aria-describedby=\"{{ data.section }}-{{ data.theme.id }}-action\">\n\t\t<# } #>\n\n\t\t\t<# if ( data.theme.screenshot && data.theme.screenshot[0] ) { #>\n\t\t\t\t<div class=\"theme-screenshot\">\n\t\t\t\t\t<img data-src=\"{{ data.theme.screenshot[0] }}\" alt=\"\" />\n\t\t\t\t</div>\n\t\t\t<# } else { #>\n\t\t\t\t<div class=\"theme-screenshot blank\"></div>\n\t\t\t<# } #>\n\n\t\t\t<span class=\"more-details theme-details\" id=\"{{ data.section }}-{{ data.theme.id }}-action\" aria-label=\"<?php echo esc_attr( $details_label ); ?>\"><?php _e( 'Theme Details' ); ?></span>\n\n\t\t\t<div class=\"theme-author\">\n\t\t\t<?php\n\t\t\t\t/* translators: Theme author name. */\n\t\t\t\tprintf( _x( 'By %s', 'theme author' ), '{{ data.theme.author }}' );\n\t\t\t?>\n\t\t\t</div>\n\n\t\t\t<# if ( 'installed' === data.theme.type && data.theme.hasUpdate ) { #>\n\t\t\t\t<# if ( data.theme.updateResponse.compatibleWP && data.theme.updateResponse.compatiblePHP ) { #>\n\t\t\t\t\t<div class=\"update-message notice inline notice-warning notice-alt\" data-slug=\"{{ data.theme.id }}\">\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( is_multisite() ) {\n\t\t\t\t\t\t\t\t_e( 'New version available.' );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: \"Update now\" button. */\n\t\t\t\t\t\t\t\t\t__( 'New version available. %s' ),\n\t\t\t\t\t\t\t\t\t'<button class=\"button-link update-theme\" type=\"button\">' . __( 'Update now' ) . '</button>'\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?>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t<# } else { #>\n\t\t\t\t\t<div class=\"update-message notice inline notice-error notice-alt\" data-slug=\"{{ data.theme.id }}\">\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<# if ( ! data.theme.updateResponse.compatibleWP && ! data.theme.updateResponse.compatiblePHP ) { #>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),\n\t\t\t\t\t\t\t\t\t'{{{ data.theme.name }}}'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tif ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%1$s\">Please update WordPress</a>, and then <a href=\"%2$s\">learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t\t\t\t} elseif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} elseif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\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<# } else if ( ! data.theme.updateResponse.compatibleWP ) { #>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),\n\t\t\t\t\t\t\t\t\t'{{{ data.theme.name }}}'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\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\t?>\n\t\t\t\t\t\t\t<# } else if ( ! data.theme.updateResponse.compatiblePHP ) { #>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: Theme name. */\n\t\t\t\t\t\t\t\t\t__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),\n\t\t\t\t\t\t\t\t\t'{{{ data.theme.name }}}'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\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<# } #>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t<# } #>\n\t\t\t<# } #>\n\n\t\t\t<# if ( ! data.theme.compatibleWP || ! data.theme.compatiblePHP ) { #>\n\t\t\t\t<div class=\"notice notice-error notice-alt\"><p>\n\t\t\t\t\t<# if ( ! data.theme.compatibleWP && ! data.theme.compatiblePHP ) { #>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t_e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );\n\t\t\t\t\t\tif ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%1$s\">Please update WordPress</a>, and then <a href=\"%2$s\">learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' ),\n\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t\t} elseif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} elseif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t<# } else if ( ! data.theme.compatibleWP ) { #>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t_e( 'This theme doesn&#8217;t work with your version of WordPress.' );\n\t\t\t\t\t\tif ( current_user_can( 'update_core' ) ) {\n\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: URL to WordPress Updates screen. */\n\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Please update WordPress</a>.' ),\n\t\t\t\t\t\t\t\tself_admin_url( 'update-core.php' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t<# } else if ( ! data.theme.compatiblePHP ) { #>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t_e( 'This theme doesn&#8217;t work with your version of PHP.' );\n\t\t\t\t\t\tif ( current_user_can( 'update_php' ) ) {\n\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: URL to Update PHP page. */\n\t\t\t\t\t\t\t\t' ' . __( '<a href=\"%s\">Learn more about updating PHP</a>.' ),\n\t\t\t\t\t\t\t\tesc_url( wp_get_update_php_url() )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\twp_update_php_annotation( '</p><p><em>', '</em>' );\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</p></div>\n\t\t\t<# } #>\n\n\t\t\t<# if ( data.theme.active ) { #>\n\t\t\t\t<div class=\"theme-id-container\">\n\t\t\t\t\t<h3 class=\"theme-name\" id=\"{{ data.section }}-{{ data.theme.id }}-name\">\n\t\t\t\t\t\t<span><?php _ex( 'Previewing:', 'theme' ); ?></span> {{ data.theme.name }}\n\t\t\t\t\t</h3>\n\t\t\t\t\t<div class=\"theme-actions\">\n\t\t\t\t\t\t<button type=\"button\" class=\"button button-primary customize-theme\" aria-label=\"<?php echo esc_attr( $customize_label ); ?>\"><?php _e( 'Customize' ); ?></button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"notice notice-success notice-alt\"><p><?php _ex( 'Installed', 'theme' ); ?></p></div>\n\t\t\t<# } else if ( 'installed' === data.theme.type ) { #>\n\t\t\t\t<div class=\"theme-id-container\">\n\t\t\t\t\t<h3 class=\"theme-name\" id=\"{{ data.section }}-{{ data.theme.id }}-name\">{{ data.theme.name }}</h3>\n\t\t\t\t\t<div class=\"theme-actions\">\n\t\t\t\t\t\t<# if ( data.theme.compatibleWP && data.theme.compatiblePHP ) { #>\n\t\t\t\t\t\t\t<button type=\"button\" class=\"button button-primary preview-theme\" aria-label=\"<?php echo esc_attr( $preview_label ); ?>\" data-slug=\"{{ data.theme.id }}\"><?php _e( 'Live Preview' ); ?></button>\n\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t<button type=\"button\" class=\"button button-primary disabled\" aria-label=\"<?php echo esc_attr( $preview_label ); ?>\"><?php _e( 'Live Preview' ); ?></button>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"notice notice-success notice-alt\"><p><?php _ex( 'Installed', 'theme' ); ?></p></div>\n\t\t\t<# } else { #>\n\t\t\t\t<div class=\"theme-id-container\">\n\t\t\t\t\t<h3 class=\"theme-name\" id=\"{{ data.section }}-{{ data.theme.id }}-name\">{{ data.theme.name }}</h3>\n\t\t\t\t\t<div class=\"theme-actions\">\n\t\t\t\t\t\t<# if ( data.theme.compatibleWP && data.theme.compatiblePHP ) { #>\n\t\t\t\t\t\t\t<button type=\"button\" class=\"button button-primary theme-install preview\" aria-label=\"<?php echo esc_attr( $install_label ); ?>\" data-slug=\"{{ data.theme.id }}\" data-name=\"{{ data.theme.name }}\"><?php _e( 'Install &amp; Preview' ); ?></button>\n\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t<button type=\"button\" class=\"button button-primary disabled\" aria-label=\"<?php echo esc_attr( $install_label ); ?>\" disabled><?php _e( 'Install &amp; Preview' ); ?></button>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t<# } #>\n\t\t</div>\n\t\t<?php\n\t}\n}\n", "num_lines": 272}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Themes_Panel class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.9.0\n */\n\n/**\n * Customize Themes Panel Class\n *\n * @since 4.9.0\n *\n * @see WP_Customize_Panel\n */\nclass WP_Customize_Themes_Panel extends WP_Customize_Panel {\n\n\t/**\n\t * Panel type.\n\t *\n\t * @since 4.9.0\n\t * @var string\n\t */\n\tpublic $type = 'themes';\n\n\t/**\n\t * An Underscore (JS) template for rendering this panel's container.\n\t *\n\t * The themes panel renders a custom panel heading with the current theme and a switch themes button.\n\t *\n\t * @see WP_Customize_Panel::print_template()\n\t *\n\t * @since 4.9.0\n\t */\n\tprotected function render_template() {\n\t\t?>\n\t\t<li id=\"accordion-section-{{ data.id }}\" class=\"accordion-section control-panel-themes\">\n\t\t\t<h3 class=\"accordion-section-title\">\n\t\t\t\t<?php\n\t\t\t\tif ( $this->manager->is_theme_active() ) {\n\t\t\t\t\techo '<span class=\"customize-action\">' . __( 'Active theme' ) . '</span> {{ data.title }}';\n\t\t\t\t} else {\n\t\t\t\t\techo '<span class=\"customize-action\">' . __( 'Previewing theme' ) . '</span> {{ data.title }}';\n\t\t\t\t}\n\t\t\t\t?>\n\n\t\t\t\t<?php if ( current_user_can( 'switch_themes' ) ) : ?>\n\t\t\t\t\t<button type=\"button\" class=\"button change-theme\" aria-label=\"<?php esc_attr_e( 'Change theme' ); ?>\"><?php _ex( 'Change', 'theme' ); ?></button>\n\t\t\t\t<?php endif; ?>\n\t\t\t</h3>\n\t\t\t<ul class=\"accordion-sub-container control-panel-content\"></ul>\n\t\t</li>\n\t\t<?php\n\t}\n\n\t/**\n\t * An Underscore (JS) template for this panel's content (but not its container).\n\t *\n\t * Class variables for this panel class are available in the `data` JS object;\n\t * export custom variables by overriding WP_Customize_Panel::json().\n\t *\n\t * @since 4.9.0\n\t *\n\t * @see WP_Customize_Panel::print_template()\n\t */\n\tprotected function content_template() {\n\t\t?>\n\t\t<li class=\"panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>\">\n\t\t\t<button class=\"customize-panel-back\" tabindex=\"-1\" type=\"button\"><span class=\"screen-reader-text\"><?php _e( 'Back' ); ?></span></button>\n\t\t\t<div class=\"accordion-section-title\">\n\t\t\t\t<span class=\"preview-notice\">\n\t\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Themes panel title in the Customizer. */\n\t\t\t\t\t\t__( 'You are browsing %s' ),\n\t\t\t\t\t\t'<strong class=\"panel-title\">' . __( 'Themes' ) . '</strong>'\n\t\t\t\t\t); // Separate strings for consistency with other panels.\n\t\t\t\t\t?>\n\t\t\t\t</span>\n\t\t\t\t<?php if ( current_user_can( 'install_themes' ) && ! is_multisite() ) : ?>\n\t\t\t\t\t<# if ( data.description ) { #>\n\t\t\t\t\t\t<button class=\"customize-help-toggle dashicons dashicons-editor-help\" type=\"button\" aria-expanded=\"false\"><span class=\"screen-reader-text\"><?php _e( 'Help' ); ?></span></button>\n\t\t\t\t\t<# } #>\n\t\t\t\t<?php endif; ?>\n\t\t\t</div>\n\t\t\t<?php if ( current_user_can( 'install_themes' ) && ! is_multisite() ) : ?>\n\t\t\t\t<# if ( data.description ) { #>\n\t\t\t\t\t<div class=\"description customize-panel-description\">\n\t\t\t\t\t\t{{{ data.description }}}\n\t\t\t\t\t</div>\n\t\t\t\t<# } #>\n\t\t\t<?php endif; ?>\n\n\t\t\t<div class=\"customize-control-notifications-container\"></div>\n\t\t</li>\n\t\t<li class=\"customize-themes-full-container-container\">\n\t\t\t<div class=\"customize-themes-full-container\">\n\t\t\t\t<div class=\"customize-themes-notifications\"></div>\n\t\t\t</div>\n\t\t</li>\n\t\t<?php\n\t}\n}\n", "num_lines": 105}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Themes_Section class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize Themes Section class.\n *\n * A UI container for theme controls, which are displayed within sections.\n *\n * @since 4.2.0\n *\n * @see WP_Customize_Section\n */\nclass WP_Customize_Themes_Section extends WP_Customize_Section {\n\n\t/**\n\t * Section type.\n\t *\n\t * @since 4.2.0\n\t * @var string\n\t */\n\tpublic $type = 'themes';\n\n\t/**\n\t * Theme section action.\n\t *\n\t * Defines the type of themes to load (installed, wporg, etc.).\n\t *\n\t * @since 4.9.0\n\t * @var string\n\t */\n\tpublic $action = '';\n\n\t/**\n\t * Theme section filter type.\n\t *\n\t * Determines whether filters are applied to loaded (local) themes or by initiating a new remote query (remote).\n\t * When filtering is local, the initial themes query is not paginated by default.\n\t *\n\t * @since 4.9.0\n\t * @var string\n\t */\n\tpublic $filter_type = 'local';\n\n\t/**\n\t * Get section parameters for JS.\n\t *\n\t * @since 4.9.0\n\t * @return array Exported parameters.\n\t */\n\tpublic function json() {\n\t\t$exported                = parent::json();\n\t\t$exported['action']      = $this->action;\n\t\t$exported['filter_type'] = $this->filter_type;\n\n\t\treturn $exported;\n\t}\n\n\t/**\n\t * Render a themes section as a JS template.\n\t *\n\t * The template is only rendered by PHP once, so all actions are prepared at once on the server side.\n\t *\n\t * @since 4.9.0\n\t */\n\tprotected function render_template() {\n\t\t?>\n\t\t<li id=\"accordion-section-{{ data.id }}\" class=\"theme-section\">\n\t\t\t<button type=\"button\" class=\"customize-themes-section-title themes-section-{{ data.id }}\">{{ data.title }}</button>\n\t\t\t<?php if ( current_user_can( 'install_themes' ) || is_multisite() ) : // @todo Upload support. ?>\n\t\t\t<?php endif; ?>\n\t\t\t<div class=\"customize-themes-section themes-section-{{ data.id }} control-section-content themes-php\">\n\t\t\t\t<div class=\"theme-overlay\" tabindex=\"0\" role=\"dialog\" aria-label=\"<?php esc_attr_e( 'Theme Details' ); ?>\"></div>\n\t\t\t\t<div class=\"theme-browser rendered\">\n\t\t\t\t\t<div class=\"customize-preview-header themes-filter-bar\">\n\t\t\t\t\t\t<?php $this->filter_bar_content_template(); ?>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php $this->filter_drawer_content_template(); ?>\n\t\t\t\t\t<div class=\"error unexpected-error\" style=\"display: none; \">\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: Support forums URL. */\n\t\t\t\t\t\t\t\t__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=\"%s\">support forums</a>.' ),\n\t\t\t\t\t\t\t\t__( 'https://wordpress.org/support/forums/' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<ul class=\"themes\">\n\t\t\t\t\t</ul>\n\t\t\t\t\t<p class=\"no-themes\"><?php _e( 'No themes found. Try a different search.' ); ?></p>\n\t\t\t\t\t<p class=\"no-themes-local\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t/* translators: %s: \"Search WordPress.org themes\" button text. */\n\t\t\t\t\t\t\t__( 'No themes found. Try a different search, or %s.' ),\n\t\t\t\t\t\t\tsprintf( '<button type=\"button\" class=\"button-link search-dotorg-themes\">%s</button>', __( 'Search WordPress.org themes' ) )\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t</p>\n\t\t\t\t\t<p class=\"spinner\"></p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</li>\n\t\t<?php\n\t}\n\n\t/**\n\t * Render the filter bar portion of a themes section as a JS template.\n\t *\n\t * The template is only rendered by PHP once, so all actions are prepared at once on the server side.\n\t * The filter bar container is rendered by @see `render_template()`.\n\t *\n\t * @since 4.9.0\n\t */\n\tprotected function filter_bar_content_template() {\n\t\t?>\n\t\t<button type=\"button\" class=\"button button-primary customize-section-back customize-themes-mobile-back\"><?php _e( 'Back to theme sources' ); ?></button>\n\t\t<# if ( 'wporg' === data.action ) { #>\n\t\t\t<div class=\"search-form\">\n\t\t\t\t<label for=\"wp-filter-search-input-{{ data.id }}\" class=\"screen-reader-text\"><?php _e( 'Search themes&hellip;' ); ?></label>\n\t\t\t\t<input type=\"search\" id=\"wp-filter-search-input-{{ data.id }}\" placeholder=\"<?php esc_attr_e( 'Search themes&hellip;' ); ?>\" aria-describedby=\"{{ data.id }}-live-search-desc\" class=\"wp-filter-search\">\n\t\t\t\t<div class=\"search-icon\" aria-hidden=\"true\"></div>\n\t\t\t\t<span id=\"{{ data.id }}-live-search-desc\" class=\"screen-reader-text\"><?php _e( 'The search results will be updated as you type.' ); ?></span>\n\t\t\t</div>\n\t\t\t<button type=\"button\" class=\"button feature-filter-toggle\">\n\t\t\t\t<span class=\"filter-count-0\"><?php _e( 'Filter themes' ); ?></span><span class=\"filter-count-filters\">\n\t\t\t\t<?php\n\t\t\t\t/* translators: %s: Number of filters selected. */\n\t\t\t\tprintf( __( 'Filter themes (%s)' ), '<span class=\"theme-filter-count\">0</span>' );\n\t\t\t\t?>\n\t\t\t\t</span>\n\t\t\t</button>\n\t\t<# } else { #>\n\t\t\t<div class=\"themes-filter-container\">\n\t\t\t\t<label for=\"{{ data.id }}-themes-filter\" class=\"screen-reader-text\"><?php _e( 'Search themes&hellip;' ); ?></label>\n\t\t\t\t<input type=\"search\" id=\"{{ data.id }}-themes-filter\" placeholder=\"<?php esc_attr_e( 'Search themes&hellip;' ); ?>\" aria-describedby=\"{{ data.id }}-live-search-desc\" class=\"wp-filter-search wp-filter-search-themes\" />\n\t\t\t\t<div class=\"search-icon\" aria-hidden=\"true\"></div>\n\t\t\t\t<span id=\"{{ data.id }}-live-search-desc\" class=\"screen-reader-text\"><?php _e( 'The search results will be updated as you type.' ); ?></span>\n\t\t\t</div>\n\t\t<# } #>\n\t\t<div class=\"filter-themes-count\">\n\t\t\t<span class=\"themes-displayed\">\n\t\t\t\t<?php\n\t\t\t\t/* translators: %s: Number of themes displayed. */\n\t\t\t\tprintf( __( '%s themes' ), '<span class=\"theme-count\">0</span>' );\n\t\t\t\t?>\n\t\t\t</span>\n\t\t</div>\n\t\t<?php\n\t}\n\n\t/**\n\t * Render the filter drawer portion of a themes section as a JS template.\n\t *\n\t * The filter bar container is rendered by @see `render_template()`.\n\t *\n\t * @since 4.9.0\n\t */\n\tprotected function filter_drawer_content_template() {\n\t\t// @todo Use the .org API instead of the local core feature list.\n\t\t// The .org API is currently outdated and will be reconciled when the .org themes directory is next redesigned.\n\t\t$feature_list = get_theme_feature_list( false );\n\t\t?>\n\t\t<# if ( 'wporg' === data.action ) { #>\n\t\t\t<div class=\"filter-drawer filter-details\">\n\t\t\t\t<?php foreach ( $feature_list as $feature_name => $features ) : ?>\n\t\t\t\t\t<fieldset class=\"filter-group\">\n\t\t\t\t\t\t<legend><?php echo esc_html( $feature_name ); ?></legend>\n\t\t\t\t\t\t<div class=\"filter-group-feature\">\n\t\t\t\t\t\t\t<?php foreach ( $features as $feature => $feature_name ) : ?>\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" id=\"filter-id-<?php echo esc_attr( $feature ); ?>\" value=\"<?php echo esc_attr( $feature ); ?>\" />\n\t\t\t\t\t\t\t\t<label for=\"filter-id-<?php echo esc_attr( $feature ); ?>\"><?php echo esc_html( $feature_name ); ?></label>\n\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</fieldset>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</div>\n\t\t<# } #>\n\t\t<?php\n\t}\n}\n", "num_lines": 189}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Customize_Upload_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Customize Upload Control Class.\n *\n * @since 3.4.0\n *\n * @see WP_Customize_Media_Control\n */\nclass WP_Customize_Upload_Control extends WP_Customize_Media_Control {\n\tpublic $type          = 'upload';\n\tpublic $mime_type     = '';\n\tpublic $button_labels = array();\n\tpublic $removed       = '';   // Unused.\n\tpublic $context;              // Unused.\n\tpublic $extensions = array(); // Unused.\n\n\t/**\n\t * Refresh the parameters passed to the JavaScript via JSON.\n\t *\n\t * @since 3.4.0\n\t *\n\t * @uses WP_Customize_Media_Control::to_json()\n\t */\n\tpublic function to_json() {\n\t\tparent::to_json();\n\n\t\t$value = $this->value();\n\t\tif ( $value ) {\n\t\t\t// Get the attachment model for the existing file.\n\t\t\t$attachment_id = attachment_url_to_postid( $value );\n\t\t\tif ( $attachment_id ) {\n\t\t\t\t$this->json['attachment'] = wp_prepare_attachment_for_js( $attachment_id );\n\t\t\t}\n\t\t}\n\t}\n}\n", "num_lines": 45}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Widget_Area_Customize_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 3.4.0\n */\n\n/**\n * Widget Area Customize Control class.\n *\n * @since 3.9.0\n *\n * @see WP_Customize_Control\n */\nclass WP_Widget_Area_Customize_Control extends WP_Customize_Control {\n\n\t/**\n\t * Customize control type.\n\t *\n\t * @since 3.9.0\n\t * @var string\n\t */\n\tpublic $type = 'sidebar_widgets';\n\n\t/**\n\t * Sidebar ID.\n\t *\n\t * @since 3.9.0\n\t * @var int|string\n\t */\n\tpublic $sidebar_id;\n\n\t/**\n\t * Refreshes the parameters passed to the JavaScript via JSON.\n\t *\n\t * @since 3.9.0\n\t */\n\tpublic function to_json() {\n\t\tparent::to_json();\n\t\t$exported_properties = array( 'sidebar_id' );\n\t\tforeach ( $exported_properties as $key ) {\n\t\t\t$this->json[ $key ] = $this->$key;\n\t\t}\n\t}\n\n\t/**\n\t * Renders the control's content.\n\t *\n\t * @since 3.9.0\n\t */\n\tpublic function render_content() {\n\t\t$id = 'reorder-widgets-desc-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id );\n\t\t?>\n\t\t<button type=\"button\" class=\"button add-new-widget\" aria-expanded=\"false\" aria-controls=\"available-widgets\">\n\t\t\t<?php _e( 'Add a Widget' ); ?>\n\t\t</button>\n\t\t<button type=\"button\" class=\"button-link reorder-toggle\" aria-label=\"<?php esc_attr_e( 'Reorder widgets' ); ?>\" aria-describedby=\"<?php echo esc_attr( $id ); ?>\">\n\t\t\t<span class=\"reorder\"><?php _e( 'Reorder' ); ?></span>\n\t\t\t<span class=\"reorder-done\"><?php _e( 'Done' ); ?></span>\n\t\t</button>\n\t\t<p class=\"screen-reader-text\" id=\"<?php echo esc_attr( $id ); ?>\"><?php _e( 'When in reorder mode, additional controls to reorder widgets will be available in the widgets list above.' ); ?></p>\n\t\t<?php\n\t}\n}\n", "num_lines": 67}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Customize API: WP_Widget_Form_Customize_Control class\n *\n * @package WordPress\n * @subpackage Customize\n * @since 4.4.0\n */\n\n/**\n * Widget Form Customize Control class.\n *\n * @since 3.9.0\n *\n * @see WP_Customize_Control\n */\nclass WP_Widget_Form_Customize_Control extends WP_Customize_Control {\n\t/**\n\t * Customize control type.\n\t *\n\t * @since 3.9.0\n\t * @var string\n\t */\n\tpublic $type = 'widget_form';\n\n\t/**\n\t * Widget ID.\n\t *\n\t * @since 3.9.0\n\t * @var string\n\t */\n\tpublic $widget_id;\n\n\t/**\n\t * Widget ID base.\n\t *\n\t * @since 3.9.0\n\t * @var string\n\t */\n\tpublic $widget_id_base;\n\n\t/**\n\t * Sidebar ID.\n\t *\n\t * @since 3.9.0\n\t * @var string\n\t */\n\tpublic $sidebar_id;\n\n\t/**\n\t * Widget status.\n\t *\n\t * @since 3.9.0\n\t * @var bool True if new, false otherwise. Default false.\n\t */\n\tpublic $is_new = false;\n\n\t/**\n\t * Widget width.\n\t *\n\t * @since 3.9.0\n\t * @var int\n\t */\n\tpublic $width;\n\n\t/**\n\t * Widget height.\n\t *\n\t * @since 3.9.0\n\t * @var int\n\t */\n\tpublic $height;\n\n\t/**\n\t * Widget mode.\n\t *\n\t * @since 3.9.0\n\t * @var bool True if wide, false otherwise. Default false.\n\t */\n\tpublic $is_wide = false;\n\n\t/**\n\t * Gather control params for exporting to JavaScript.\n\t *\n\t * @since 3.9.0\n\t *\n\t * @global array $wp_registered_widgets\n\t */\n\tpublic function to_json() {\n\t\tglobal $wp_registered_widgets;\n\n\t\tparent::to_json();\n\t\t$exported_properties = array( 'widget_id', 'widget_id_base', 'sidebar_id', 'width', 'height', 'is_wide' );\n\t\tforeach ( $exported_properties as $key ) {\n\t\t\t$this->json[ $key ] = $this->$key;\n\t\t}\n\n\t\t// Get the widget_control and widget_content.\n\t\trequire_once ABSPATH . 'wp-admin/includes/widgets.php';\n\n\t\t$widget = $wp_registered_widgets[ $this->widget_id ];\n\t\tif ( ! isset( $widget['params'][0] ) ) {\n\t\t\t$widget['params'][0] = array();\n\t\t}\n\n\t\t$args = array(\n\t\t\t'widget_id'   => $widget['id'],\n\t\t\t'widget_name' => $widget['name'],\n\t\t);\n\n\t\t$args                 = wp_list_widget_controls_dynamic_sidebar(\n\t\t\tarray(\n\t\t\t\t0 => $args,\n\t\t\t\t1 => $widget['params'][0],\n\t\t\t)\n\t\t);\n\t\t$widget_control_parts = $this->manager->widgets->get_widget_control_parts( $args );\n\n\t\t$this->json['widget_control'] = $widget_control_parts['control'];\n\t\t$this->json['widget_content'] = $widget_control_parts['content'];\n\t}\n\n\t/**\n\t * Override render_content to be no-op since content is exported via to_json for deferred embedding.\n\t *\n\t * @since 3.9.0\n\t */\n\tpublic function render_content() {}\n\n\t/**\n\t * Whether the current widget is rendered on the page.\n\t *\n\t * @since 4.0.0\n\t *\n\t * @return bool Whether the widget is rendered.\n\t */\n\tpublic function active_callback() {\n\t\treturn $this->manager->widgets->is_widget_rendered( $this->widget_id );\n\t}\n}\n", "num_lines": 141}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/////////////////////////////////////////////////////////////////\n/// getID3() by James Heinrich <info@getid3.org>               //\n//  available at https://github.com/JamesHeinrich/getID3       //\n//            or https://www.getid3.org                        //\n//            or http://getid3.sourceforge.net                 //\n//                                                             //\n// getid3.lib.php - part of getID3()                           //\n//  see readme.txt for more details                            //\n//                                                            ///\n/////////////////////////////////////////////////////////////////\n\n\nclass getid3_lib\n{\n\t/**\n\t * @param string      $string\n\t * @param bool        $hex\n\t * @param bool        $spaces\n\t * @param string|bool $htmlencoding\n\t *\n\t * @return string\n\t */\n\tpublic static function PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8') {\n\t\t$returnstring = '';\n\t\tfor ($i = 0; $i < strlen($string); $i++) {\n\t\t\tif ($hex) {\n\t\t\t\t$returnstring .= str_pad(dechex(ord($string[$i])), 2, '0', STR_PAD_LEFT);\n\t\t\t} else {\n\t\t\t\t$returnstring .= ' '.(preg_match(\"#[\\x20-\\x7E]#\", $string[$i]) ? $string[$i] : '\u00c2\u00a4');\n\t\t\t}\n\t\t\tif ($spaces) {\n\t\t\t\t$returnstring .= ' ';\n\t\t\t}\n\t\t}\n\t\tif (!empty($htmlencoding)) {\n\t\t\tif ($htmlencoding === true) {\n\t\t\t\t$htmlencoding = 'UTF-8'; // prior to getID3 v1.9.0 the function's 4th parameter was boolean\n\t\t\t}\n\t\t\t$returnstring = htmlentities($returnstring, ENT_QUOTES, $htmlencoding);\n\t\t}\n\t\treturn $returnstring;\n\t}\n\n\t/**\n\t * Truncates a floating-point number at the decimal point.\n\t *\n\t * @param float $floatnumber\n\t *\n\t * @return float|int returns int (if possible, otherwise float)\n\t */\n\tpublic static function trunc($floatnumber) {\n\t\tif ($floatnumber >= 1) {\n\t\t\t$truncatednumber = floor($floatnumber);\n\t\t} elseif ($floatnumber <= -1) {\n\t\t\t$truncatednumber = ceil($floatnumber);\n\t\t} else {\n\t\t\t$truncatednumber = 0;\n\t\t}\n\t\tif (self::intValueSupported($truncatednumber)) {\n\t\t\t$truncatednumber = (int) $truncatednumber;\n\t\t}\n\t\treturn $truncatednumber;\n\t}\n\n\t/**\n\t * @param int|null $variable\n\t * @param int      $increment\n\t *\n\t * @return bool\n\t */\n\tpublic static function safe_inc(&$variable, $increment=1) {\n\t\tif (isset($variable)) {\n\t\t\t$variable += $increment;\n\t\t} else {\n\t\t\t$variable = $increment;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param int|float $floatnum\n\t *\n\t * @return int|float\n\t */\n\tpublic static function CastAsInt($floatnum) {\n\t\t// convert to float if not already\n\t\t$floatnum = (float) $floatnum;\n\n\t\t// convert a float to type int, only if possible\n\t\tif (self::trunc($floatnum) == $floatnum) {\n\t\t\t// it's not floating point\n\t\t\tif (self::intValueSupported($floatnum)) {\n\t\t\t\t// it's within int range\n\t\t\t\t$floatnum = (int) $floatnum;\n\t\t\t}\n\t\t}\n\t\treturn $floatnum;\n\t}\n\n\t/**\n\t * @param int $num\n\t *\n\t * @return bool\n\t */\n\tpublic static function intValueSupported($num) {\n\t\t// check if integers are 64-bit\n\t\tstatic $hasINT64 = null;\n\t\tif ($hasINT64 === null) { // 10x faster than is_null()\n\t\t\t$hasINT64 = is_int(pow(2, 31)); // 32-bit int are limited to (2^31)-1\n\t\t\tif (!$hasINT64 && !defined('PHP_INT_MIN')) {\n\t\t\t\tdefine('PHP_INT_MIN', ~PHP_INT_MAX);\n\t\t\t}\n\t\t}\n\t\t// if integers are 64-bit - no other check required\n\t\tif ($hasINT64 || (($num <= PHP_INT_MAX) && ($num >= PHP_INT_MIN))) { // phpcs:ignore PHPCompatibility.Constants.NewConstants.php_int_minFound\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * @param string $fraction\n\t *\n\t * @return float\n\t */\n\tpublic static function DecimalizeFraction($fraction) {\n\t\tlist($numerator, $denominator) = explode('/', $fraction);\n\t\treturn $numerator / ($denominator ? $denominator : 1);\n\t}\n\n\t/**\n\t * @param string $binarynumerator\n\t *\n\t * @return float\n\t */\n\tpublic static function DecimalBinary2Float($binarynumerator) {\n\t\t$numerator   = self::Bin2Dec($binarynumerator);\n\t\t$denominator = self::Bin2Dec('1'.str_repeat('0', strlen($binarynumerator)));\n\t\treturn ($numerator / $denominator);\n\t}\n\n\t/**\n\t * @link http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html\n\t *\n\t * @param string $binarypointnumber\n\t * @param int    $maxbits\n\t *\n\t * @return array\n\t */\n\tpublic static function NormalizeBinaryPoint($binarypointnumber, $maxbits=52) {\n\t\tif (strpos($binarypointnumber, '.') === false) {\n\t\t\t$binarypointnumber = '0.'.$binarypointnumber;\n\t\t} elseif ($binarypointnumber[0] == '.') {\n\t\t\t$binarypointnumber = '0'.$binarypointnumber;\n\t\t}\n\t\t$exponent = 0;\n\t\twhile (($binarypointnumber[0] != '1') || (substr($binarypointnumber, 1, 1) != '.')) {\n\t\t\tif (substr($binarypointnumber, 1, 1) == '.') {\n\t\t\t\t$exponent--;\n\t\t\t\t$binarypointnumber = substr($binarypointnumber, 2, 1).'.'.substr($binarypointnumber, 3);\n\t\t\t} else {\n\t\t\t\t$pointpos = strpos($binarypointnumber, '.');\n\t\t\t\t$exponent += ($pointpos - 1);\n\t\t\t\t$binarypointnumber = str_replace('.', '', $binarypointnumber);\n\t\t\t\t$binarypointnumber = $binarypointnumber[0].'.'.substr($binarypointnumber, 1);\n\t\t\t}\n\t\t}\n\t\t$binarypointnumber = str_pad(substr($binarypointnumber, 0, $maxbits + 2), $maxbits + 2, '0', STR_PAD_RIGHT);\n\t\treturn array('normalized'=>$binarypointnumber, 'exponent'=>(int) $exponent);\n\t}\n\n\t/**\n\t * @link http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html\n\t *\n\t * @param float $floatvalue\n\t *\n\t * @return string\n\t */\n\tpublic static function Float2BinaryDecimal($floatvalue) {\n\t\t$maxbits = 128; // to how many bits of precision should the calculations be taken?\n\t\t$intpart   = self::trunc($floatvalue);\n\t\t$floatpart = abs($floatvalue - $intpart);\n\t\t$pointbitstring = '';\n\t\twhile (($floatpart != 0) && (strlen($pointbitstring) < $maxbits)) {\n\t\t\t$floatpart *= 2;\n\t\t\t$pointbitstring .= (string) self::trunc($floatpart);\n\t\t\t$floatpart -= self::trunc($floatpart);\n\t\t}\n\t\t$binarypointnumber = decbin($intpart).'.'.$pointbitstring;\n\t\treturn $binarypointnumber;\n\t}\n\n\t/**\n\t * @link http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee-expl.html\n\t *\n\t * @param float $floatvalue\n\t * @param int $bits\n\t *\n\t * @return string|false\n\t */\n\tpublic static function Float2String($floatvalue, $bits) {\n\t\t$exponentbits = 0;\n\t\t$fractionbits = 0;\n\t\tswitch ($bits) {\n\t\t\tcase 32:\n\t\t\t\t$exponentbits = 8;\n\t\t\t\t$fractionbits = 23;\n\t\t\t\tbreak;\n\n\t\t\tcase 64:\n\t\t\t\t$exponentbits = 11;\n\t\t\t\t$fractionbits = 52;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\tif ($floatvalue >= 0) {\n\t\t\t$signbit = '0';\n\t\t} else {\n\t\t\t$signbit = '1';\n\t\t}\n\t\t$normalizedbinary  = self::NormalizeBinaryPoint(self::Float2BinaryDecimal($floatvalue), $fractionbits);\n\t\t$biasedexponent    = pow(2, $exponentbits - 1) - 1 + $normalizedbinary['exponent']; // (127 or 1023) +/- exponent\n\t\t$exponentbitstring = str_pad(decbin($biasedexponent), $exponentbits, '0', STR_PAD_LEFT);\n\t\t$fractionbitstring = str_pad(substr($normalizedbinary['normalized'], 2), $fractionbits, '0', STR_PAD_RIGHT);\n\n\t\treturn self::BigEndian2String(self::Bin2Dec($signbit.$exponentbitstring.$fractionbitstring), $bits % 8, false);\n\t}\n\n\t/**\n\t * @param string $byteword\n\t *\n\t * @return float|false\n\t */\n\tpublic static function LittleEndian2Float($byteword) {\n\t\treturn self::BigEndian2Float(strrev($byteword));\n\t}\n\n\t/**\n\t * ANSI/IEEE Standard 754-1985, Standard for Binary Floating Point Arithmetic\n\t *\n\t * @link http://www.psc.edu/general/software/packages/ieee/ieee.html\n\t * @link http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee.html\n\t *\n\t * @param string $byteword\n\t *\n\t * @return float|false\n\t */\n\tpublic static function BigEndian2Float($byteword) {\n\t\t$bitword = self::BigEndian2Bin($byteword);\n\t\tif (!$bitword) {\n\t\t\treturn 0;\n\t\t}\n\t\t$signbit = $bitword[0];\n\t\t$floatvalue = 0;\n\t\t$exponentbits = 0;\n\t\t$fractionbits = 0;\n\n\t\tswitch (strlen($byteword) * 8) {\n\t\t\tcase 32:\n\t\t\t\t$exponentbits = 8;\n\t\t\t\t$fractionbits = 23;\n\t\t\t\tbreak;\n\n\t\t\tcase 64:\n\t\t\t\t$exponentbits = 11;\n\t\t\t\t$fractionbits = 52;\n\t\t\t\tbreak;\n\n\t\t\tcase 80:\n\t\t\t\t// 80-bit Apple SANE format\n\t\t\t\t// http://www.mactech.com/articles/mactech/Vol.06/06.01/SANENormalized/\n\t\t\t\t$exponentstring = substr($bitword, 1, 15);\n\t\t\t\t$isnormalized = intval($bitword[16]);\n\t\t\t\t$fractionstring = substr($bitword, 17, 63);\n\t\t\t\t$exponent = pow(2, self::Bin2Dec($exponentstring) - 16383);\n\t\t\t\t$fraction = $isnormalized + self::DecimalBinary2Float($fractionstring);\n\t\t\t\t$floatvalue = $exponent * $fraction;\n\t\t\t\tif ($signbit == '1') {\n\t\t\t\t\t$floatvalue *= -1;\n\t\t\t\t}\n\t\t\t\treturn $floatvalue;\n\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\t$exponentstring = substr($bitword, 1, $exponentbits);\n\t\t$fractionstring = substr($bitword, $exponentbits + 1, $fractionbits);\n\t\t$exponent = self::Bin2Dec($exponentstring);\n\t\t$fraction = self::Bin2Dec($fractionstring);\n\n\t\tif (($exponent == (pow(2, $exponentbits) - 1)) && ($fraction != 0)) {\n\t\t\t// Not a Number\n\t\t\t$floatvalue = false;\n\t\t} elseif (($exponent == (pow(2, $exponentbits) - 1)) && ($fraction == 0)) {\n\t\t\tif ($signbit == '1') {\n\t\t\t\t$floatvalue = '-infinity';\n\t\t\t} else {\n\t\t\t\t$floatvalue = '+infinity';\n\t\t\t}\n\t\t} elseif (($exponent == 0) && ($fraction == 0)) {\n\t\t\tif ($signbit == '1') {\n\t\t\t\t$floatvalue = -0;\n\t\t\t} else {\n\t\t\t\t$floatvalue = 0;\n\t\t\t}\n\t\t\t$floatvalue = ($signbit ? 0 : -0);\n\t\t} elseif (($exponent == 0) && ($fraction != 0)) {\n\t\t\t// These are 'unnormalized' values\n\t\t\t$floatvalue = pow(2, (-1 * (pow(2, $exponentbits - 1) - 2))) * self::DecimalBinary2Float($fractionstring);\n\t\t\tif ($signbit == '1') {\n\t\t\t\t$floatvalue *= -1;\n\t\t\t}\n\t\t} elseif ($exponent != 0) {\n\t\t\t$floatvalue = pow(2, ($exponent - (pow(2, $exponentbits - 1) - 1))) * (1 + self::DecimalBinary2Float($fractionstring));\n\t\t\tif ($signbit == '1') {\n\t\t\t\t$floatvalue *= -1;\n\t\t\t}\n\t\t}\n\t\treturn (float) $floatvalue;\n\t}\n\n\t/**\n\t * @param string $byteword\n\t * @param bool   $synchsafe\n\t * @param bool   $signed\n\t *\n\t * @return int|float|false\n\t * @throws Exception\n\t */\n\tpublic static function BigEndian2Int($byteword, $synchsafe=false, $signed=false) {\n\t\t$intvalue = 0;\n\t\t$bytewordlen = strlen($byteword);\n\t\tif ($bytewordlen == 0) {\n\t\t\treturn false;\n\t\t}\n\t\tfor ($i = 0; $i < $bytewordlen; $i++) {\n\t\t\tif ($synchsafe) { // disregard MSB, effectively 7-bit bytes\n\t\t\t\t//$intvalue = $intvalue | (ord($byteword{$i}) & 0x7F) << (($bytewordlen - 1 - $i) * 7); // faster, but runs into problems past 2^31 on 32-bit systems\n\t\t\t\t$intvalue += (ord($byteword[$i]) & 0x7F) * pow(2, ($bytewordlen - 1 - $i) * 7);\n\t\t\t} else {\n\t\t\t\t$intvalue += ord($byteword[$i]) * pow(256, ($bytewordlen - 1 - $i));\n\t\t\t}\n\t\t}\n\t\tif ($signed && !$synchsafe) {\n\t\t\t// synchsafe ints are not allowed to be signed\n\t\t\tif ($bytewordlen <= PHP_INT_SIZE) {\n\t\t\t\t$signMaskBit = 0x80 << (8 * ($bytewordlen - 1));\n\t\t\t\tif ($intvalue & $signMaskBit) {\n\t\t\t\t\t$intvalue = 0 - ($intvalue & ($signMaskBit - 1));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Exception('ERROR: Cannot have signed integers larger than '.(8 * PHP_INT_SIZE).'-bits ('.strlen($byteword).') in self::BigEndian2Int()');\n\t\t\t}\n\t\t}\n\t\treturn self::CastAsInt($intvalue);\n\t}\n\n\t/**\n\t * @param string $byteword\n\t * @param bool   $signed\n\t *\n\t * @return int|float|false\n\t */\n\tpublic static function LittleEndian2Int($byteword, $signed=false) {\n\t\treturn self::BigEndian2Int(strrev($byteword), false, $signed);\n\t}\n\n\t/**\n\t * @param string $byteword\n\t *\n\t * @return string\n\t */\n\tpublic static function LittleEndian2Bin($byteword) {\n\t\treturn self::BigEndian2Bin(strrev($byteword));\n\t}\n\n\t/**\n\t * @param string $byteword\n\t *\n\t * @return string\n\t */\n\tpublic static function BigEndian2Bin($byteword) {\n\t\t$binvalue = '';\n\t\t$bytewordlen = strlen($byteword);\n\t\tfor ($i = 0; $i < $bytewordlen; $i++) {\n\t\t\t$binvalue .= str_pad(decbin(ord($byteword[$i])), 8, '0', STR_PAD_LEFT);\n\t\t}\n\t\treturn $binvalue;\n\t}\n\n\t/**\n\t * @param int  $number\n\t * @param int  $minbytes\n\t * @param bool $synchsafe\n\t * @param bool $signed\n\t *\n\t * @return string\n\t * @throws Exception\n\t */\n\tpublic static function BigEndian2String($number, $minbytes=1, $synchsafe=false, $signed=false) {\n\t\tif ($number < 0) {\n\t\t\tthrow new Exception('ERROR: self::BigEndian2String() does not support negative numbers');\n\t\t}\n\t\t$maskbyte = (($synchsafe || $signed) ? 0x7F : 0xFF);\n\t\t$intstring = '';\n\t\tif ($signed) {\n\t\t\tif ($minbytes > PHP_INT_SIZE) {\n\t\t\t\tthrow new Exception('ERROR: Cannot have signed integers larger than '.(8 * PHP_INT_SIZE).'-bits in self::BigEndian2String()');\n\t\t\t}\n\t\t\t$number = $number & (0x80 << (8 * ($minbytes - 1)));\n\t\t}\n\t\twhile ($number != 0) {\n\t\t\t$quotient = ($number / ($maskbyte + 1));\n\t\t\t$intstring = chr(ceil(($quotient - floor($quotient)) * $maskbyte)).$intstring;\n\t\t\t$number = floor($quotient);\n\t\t}\n\t\treturn str_pad($intstring, $minbytes, \"\\x00\", STR_PAD_LEFT);\n\t}\n\n\t/**\n\t * @param int $number\n\t *\n\t * @return string\n\t */\n\tpublic static function Dec2Bin($number) {\n\t\twhile ($number >= 256) {\n\t\t\t$bytes[] = (($number / 256) - (floor($number / 256))) * 256;\n\t\t\t$number = floor($number / 256);\n\t\t}\n\t\t$bytes[] = $number;\n\t\t$binstring = '';\n\t\tfor ($i = 0; $i < count($bytes); $i++) {\n\t\t\t$binstring = (($i == count($bytes) - 1) ? decbin($bytes[$i]) : str_pad(decbin($bytes[$i]), 8, '0', STR_PAD_LEFT)).$binstring;\n\t\t}\n\t\treturn $binstring;\n\t}\n\n\t/**\n\t * @param string $binstring\n\t * @param bool   $signed\n\t *\n\t * @return int|float\n\t */\n\tpublic static function Bin2Dec($binstring, $signed=false) {\n\t\t$signmult = 1;\n\t\tif ($signed) {\n\t\t\tif ($binstring[0] == '1') {\n\t\t\t\t$signmult = -1;\n\t\t\t}\n\t\t\t$binstring = substr($binstring, 1);\n\t\t}\n\t\t$decvalue = 0;\n\t\tfor ($i = 0; $i < strlen($binstring); $i++) {\n\t\t\t$decvalue += ((int) substr($binstring, strlen($binstring) - $i - 1, 1)) * pow(2, $i);\n\t\t}\n\t\treturn self::CastAsInt($decvalue * $signmult);\n\t}\n\n\t/**\n\t * @param string $binstring\n\t *\n\t * @return string\n\t */\n\tpublic static function Bin2String($binstring) {\n\t\t// return 'hi' for input of '0110100001101001'\n\t\t$string = '';\n\t\t$binstringreversed = strrev($binstring);\n\t\tfor ($i = 0; $i < strlen($binstringreversed); $i += 8) {\n\t\t\t$string = chr(self::Bin2Dec(strrev(substr($binstringreversed, $i, 8)))).$string;\n\t\t}\n\t\treturn $string;\n\t}\n\n\t/**\n\t * @param int  $number\n\t * @param int  $minbytes\n\t * @param bool $synchsafe\n\t *\n\t * @return string\n\t */\n\tpublic static function LittleEndian2String($number, $minbytes=1, $synchsafe=false) {\n\t\t$intstring = '';\n\t\twhile ($number > 0) {\n\t\t\tif ($synchsafe) {\n\t\t\t\t$intstring = $intstring.chr($number & 127);\n\t\t\t\t$number >>= 7;\n\t\t\t} else {\n\t\t\t\t$intstring = $intstring.chr($number & 255);\n\t\t\t\t$number >>= 8;\n\t\t\t}\n\t\t}\n\t\treturn str_pad($intstring, $minbytes, \"\\x00\", STR_PAD_RIGHT);\n\t}\n\n\t/**\n\t * @param mixed $array1\n\t * @param mixed $array2\n\t *\n\t * @return array|false\n\t */\n\tpublic static function array_merge_clobber($array1, $array2) {\n\t\t// written by kc\u00c3\u02dchireability*com\n\t\t// taken from http://www.php.net/manual/en/function.array-merge-recursive.php\n\t\tif (!is_array($array1) || !is_array($array2)) {\n\t\t\treturn false;\n\t\t}\n\t\t$newarray = $array1;\n\t\tforeach ($array2 as $key => $val) {\n\t\t\tif (is_array($val) && isset($newarray[$key]) && is_array($newarray[$key])) {\n\t\t\t\t$newarray[$key] = self::array_merge_clobber($newarray[$key], $val);\n\t\t\t} else {\n\t\t\t\t$newarray[$key] = $val;\n\t\t\t}\n\t\t}\n\t\treturn $newarray;\n\t}\n\n\t/**\n\t * @param mixed $array1\n\t * @param mixed $array2\n\t *\n\t * @return array|false\n\t */\n\tpublic static function array_merge_noclobber($array1, $array2) {\n\t\tif (!is_array($array1) || !is_array($array2)) {\n\t\t\treturn false;\n\t\t}\n\t\t$newarray = $array1;\n\t\tforeach ($array2 as $key => $val) {\n\t\t\tif (is_array($val) && isset($newarray[$key]) && is_array($newarray[$key])) {\n\t\t\t\t$newarray[$key] = self::array_merge_noclobber($newarray[$key], $val);\n\t\t\t} elseif (!isset($newarray[$key])) {\n\t\t\t\t$newarray[$key] = $val;\n\t\t\t}\n\t\t}\n\t\treturn $newarray;\n\t}\n\n\t/**\n\t * @param mixed $array1\n\t * @param mixed $array2\n\t *\n\t * @return array|false|null\n\t */\n\tpublic static function flipped_array_merge_noclobber($array1, $array2) {\n\t\tif (!is_array($array1) || !is_array($array2)) {\n\t\t\treturn false;\n\t\t}\n\t\t# naturally, this only works non-recursively\n\t\t$newarray = array_flip($array1);\n\t\tforeach (array_flip($array2) as $key => $val) {\n\t\t\tif (!isset($newarray[$key])) {\n\t\t\t\t$newarray[$key] = count($newarray);\n\t\t\t}\n\t\t}\n\t\treturn array_flip($newarray);\n\t}\n\n\t/**\n\t * @param array $theArray\n\t *\n\t * @return bool\n\t */\n\tpublic static function ksort_recursive(&$theArray) {\n\t\tksort($theArray);\n\t\tforeach ($theArray as $key => $value) {\n\t\t\tif (is_array($value)) {\n\t\t\t\tself::ksort_recursive($theArray[$key]);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $filename\n\t * @param int    $numextensions\n\t *\n\t * @return string\n\t */\n\tpublic static function fileextension($filename, $numextensions=1) {\n\t\tif (strstr($filename, '.')) {\n\t\t\t$reversedfilename = strrev($filename);\n\t\t\t$offset = 0;\n\t\t\tfor ($i = 0; $i < $numextensions; $i++) {\n\t\t\t\t$offset = strpos($reversedfilename, '.', $offset + 1);\n\t\t\t\tif ($offset === false) {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn strrev(substr($reversedfilename, 0, $offset));\n\t\t}\n\t\treturn '';\n\t}\n\n\t/**\n\t * @param int $seconds\n\t *\n\t * @return string\n\t */\n\tpublic static function PlaytimeString($seconds) {\n\t\t$sign = (($seconds < 0) ? '-' : '');\n\t\t$seconds = round(abs($seconds));\n\t\t$H = (int) floor( $seconds                            / 3600);\n\t\t$M = (int) floor(($seconds - (3600 * $H)            ) /   60);\n\t\t$S = (int) round( $seconds - (3600 * $H) - (60 * $M)        );\n\t\treturn $sign.($H ? $H.':' : '').($H ? str_pad($M, 2, '0', STR_PAD_LEFT) : intval($M)).':'.str_pad($S, 2, 0, STR_PAD_LEFT);\n\t}\n\n\t/**\n\t * @param int $macdate\n\t *\n\t * @return int|float\n\t */\n\tpublic static function DateMac2Unix($macdate) {\n\t\t// Macintosh timestamp: seconds since 00:00h January 1, 1904\n\t\t// UNIX timestamp:      seconds since 00:00h January 1, 1970\n\t\treturn self::CastAsInt($macdate - 2082844800);\n\t}\n\n\t/**\n\t * @param string $rawdata\n\t *\n\t * @return float\n\t */\n\tpublic static function FixedPoint8_8($rawdata) {\n\t\treturn self::BigEndian2Int(substr($rawdata, 0, 1)) + (float) (self::BigEndian2Int(substr($rawdata, 1, 1)) / pow(2, 8));\n\t}\n\n\t/**\n\t * @param string $rawdata\n\t *\n\t * @return float\n\t */\n\tpublic static function FixedPoint16_16($rawdata) {\n\t\treturn self::BigEndian2Int(substr($rawdata, 0, 2)) + (float) (self::BigEndian2Int(substr($rawdata, 2, 2)) / pow(2, 16));\n\t}\n\n\t/**\n\t * @param string $rawdata\n\t *\n\t * @return float\n\t */\n\tpublic static function FixedPoint2_30($rawdata) {\n\t\t$binarystring = self::BigEndian2Bin($rawdata);\n\t\treturn self::Bin2Dec(substr($binarystring, 0, 2)) + (float) (self::Bin2Dec(substr($binarystring, 2, 30)) / pow(2, 30));\n\t}\n\n\n\t/**\n\t * @param string $ArrayPath\n\t * @param string $Separator\n\t * @param mixed $Value\n\t *\n\t * @return array\n\t */\n\tpublic static function CreateDeepArray($ArrayPath, $Separator, $Value) {\n\t\t// assigns $Value to a nested array path:\n\t\t//   $foo = self::CreateDeepArray('/path/to/my', '/', 'file.txt')\n\t\t// is the same as:\n\t\t//   $foo = array('path'=>array('to'=>'array('my'=>array('file.txt'))));\n\t\t// or\n\t\t//   $foo['path']['to']['my'] = 'file.txt';\n\t\t$ArrayPath = ltrim($ArrayPath, $Separator);\n\t\tif (($pos = strpos($ArrayPath, $Separator)) !== false) {\n\t\t\t$ReturnedArray[substr($ArrayPath, 0, $pos)] = self::CreateDeepArray(substr($ArrayPath, $pos + 1), $Separator, $Value);\n\t\t} else {\n\t\t\t$ReturnedArray[$ArrayPath] = $Value;\n\t\t}\n\t\treturn $ReturnedArray;\n\t}\n\n\t/**\n\t * @param array $arraydata\n\t * @param bool  $returnkey\n\t *\n\t * @return int|false\n\t */\n\tpublic static function array_max($arraydata, $returnkey=false) {\n\t\t$maxvalue = false;\n\t\t$maxkey   = false;\n\t\tforeach ($arraydata as $key => $value) {\n\t\t\tif (!is_array($value)) {\n\t\t\t\tif (($maxvalue === false) || ($value > $maxvalue)) {\n\t\t\t\t\t$maxvalue = $value;\n\t\t\t\t\t$maxkey = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ($returnkey ? $maxkey : $maxvalue);\n\t}\n\n\t/**\n\t * @param array $arraydata\n\t * @param bool  $returnkey\n\t *\n\t * @return int|false\n\t */\n\tpublic static function array_min($arraydata, $returnkey=false) {\n\t\t$minvalue = false;\n\t\t$minkey   = false;\n\t\tforeach ($arraydata as $key => $value) {\n\t\t\tif (!is_array($value)) {\n\t\t\t\tif (($minvalue === false) || ($value < $minvalue)) {\n\t\t\t\t\t$minvalue = $value;\n\t\t\t\t\t$minkey = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ($returnkey ? $minkey : $minvalue);\n\t}\n\n\t/**\n\t * @param string $XMLstring\n\t *\n\t * @return array|false\n\t */\n\tpublic static function XML2array($XMLstring) {\n\t\tif (function_exists('simplexml_load_string') && function_exists('libxml_disable_entity_loader')) {\n\t\t\t// http://websec.io/2012/08/27/Preventing-XEE-in-PHP.html\n\t\t\t// https://core.trac.wordpress.org/changeset/29378\n\t\t\t$loader = libxml_disable_entity_loader(true);\n\t\t\t$XMLobject = simplexml_load_string($XMLstring, 'SimpleXMLElement', LIBXML_NOENT);\n\t\t\t$return = self::SimpleXMLelement2array($XMLobject);\n\t\t\tlibxml_disable_entity_loader($loader);\n\t\t\treturn $return;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t* @param SimpleXMLElement|array|mixed $XMLobject\n\t*\n\t* @return mixed\n\t*/\n\tpublic static function SimpleXMLelement2array($XMLobject) {\n\t\tif (!is_object($XMLobject) && !is_array($XMLobject)) {\n\t\t\treturn $XMLobject;\n\t\t}\n\t\t$XMLarray = $XMLobject instanceof SimpleXMLElement ? get_object_vars($XMLobject) : $XMLobject;\n\t\tforeach ($XMLarray as $key => $value) {\n\t\t\t$XMLarray[$key] = self::SimpleXMLelement2array($value);\n\t\t}\n\t\treturn $XMLarray;\n\t}\n\n\t/**\n\t * Returns checksum for a file from starting position to absolute end position.\n\t *\n\t * @param string $file\n\t * @param int    $offset\n\t * @param int    $end\n\t * @param string $algorithm\n\t *\n\t * @return string|false\n\t * @throws getid3_exception\n\t */\n\tpublic static function hash_data($file, $offset, $end, $algorithm) {\n\t\tif (!self::intValueSupported($end)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!in_array($algorithm, array('md5', 'sha1'))) {\n\t\t\tthrow new getid3_exception('Invalid algorithm ('.$algorithm.') in self::hash_data()');\n\t\t}\n\n\t\t$size = $end - $offset;\n\n\t\t$fp = fopen($file, 'rb');\n\t\tfseek($fp, $offset);\n\t\t$ctx = hash_init($algorithm);\n\t\twhile ($size > 0) {\n\t\t\t$buffer = fread($fp, min($size, getID3::FREAD_BUFFER_SIZE));\n\t\t\thash_update($ctx, $buffer);\n\t\t\t$size -= getID3::FREAD_BUFFER_SIZE;\n\t\t}\n\t\t$hash = hash_final($ctx);\n\t\tfclose($fp);\n\n\t\treturn $hash;\n\t}\n\n\t/**\n\t * @param string $filename_source\n\t * @param string $filename_dest\n\t * @param int    $offset\n\t * @param int    $length\n\t *\n\t * @return bool\n\t * @throws Exception\n\t *\n\t * @deprecated Unused, may be removed in future versions of getID3\n\t */\n\tpublic static function CopyFileParts($filename_source, $filename_dest, $offset, $length) {\n\t\tif (!self::intValueSupported($offset + $length)) {\n\t\t\tthrow new Exception('cannot copy file portion, it extends beyond the '.round(PHP_INT_MAX / 1073741824).'GB limit');\n\t\t}\n\t\tif (is_readable($filename_source) && is_file($filename_source) && ($fp_src = fopen($filename_source, 'rb'))) {\n\t\t\tif (($fp_dest = fopen($filename_dest, 'wb'))) {\n\t\t\t\tif (fseek($fp_src, $offset) == 0) {\n\t\t\t\t\t$byteslefttowrite = $length;\n\t\t\t\t\twhile (($byteslefttowrite > 0) && ($buffer = fread($fp_src, min($byteslefttowrite, getID3::FREAD_BUFFER_SIZE)))) {\n\t\t\t\t\t\t$byteswritten = fwrite($fp_dest, $buffer, $byteslefttowrite);\n\t\t\t\t\t\t$byteslefttowrite -= $byteswritten;\n\t\t\t\t\t}\n\t\t\t\t\tfclose($fp_dest);\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tfclose($fp_src);\n\t\t\t\t\tthrow new Exception('failed to seek to offset '.$offset.' in '.$filename_source);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Exception('failed to create file for writing '.$filename_dest);\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Exception('failed to open file for reading '.$filename_source);\n\t\t}\n\t}\n\n\t/**\n\t * @param int $charval\n\t *\n\t * @return string\n\t */\n\tpublic static function iconv_fallback_int_utf8($charval) {\n\t\tif ($charval < 128) {\n\t\t\t// 0bbbbbbb\n\t\t\t$newcharstring = chr($charval);\n\t\t} elseif ($charval < 2048) {\n\t\t\t// 110bbbbb 10bbbbbb\n\t\t\t$newcharstring  = chr(($charval >>   6) | 0xC0);\n\t\t\t$newcharstring .= chr(($charval & 0x3F) | 0x80);\n\t\t} elseif ($charval < 65536) {\n\t\t\t// 1110bbbb 10bbbbbb 10bbbbbb\n\t\t\t$newcharstring  = chr(($charval >>  12) | 0xE0);\n\t\t\t$newcharstring .= chr(($charval >>   6) | 0xC0);\n\t\t\t$newcharstring .= chr(($charval & 0x3F) | 0x80);\n\t\t} else {\n\t\t\t// 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb\n\t\t\t$newcharstring  = chr(($charval >>  18) | 0xF0);\n\t\t\t$newcharstring .= chr(($charval >>  12) | 0xC0);\n\t\t\t$newcharstring .= chr(($charval >>   6) | 0xC0);\n\t\t\t$newcharstring .= chr(($charval & 0x3F) | 0x80);\n\t\t}\n\t\treturn $newcharstring;\n\t}\n\n\t/**\n\t * ISO-8859-1 => UTF-8\n\t *\n\t * @param string $string\n\t * @param bool   $bom\n\t *\n\t * @return string\n\t */\n\tpublic static function iconv_fallback_iso88591_utf8($string, $bom=false) {\n\t\tif (function_exists('utf8_encode')) {\n\t\t\treturn utf8_encode($string);\n\t\t}\n\t\t// utf8_encode() unavailable, use getID3()'s iconv_fallback() conversions (possibly PHP is compiled without XML support)\n\t\t$newcharstring = '';\n\t\tif ($bom) {\n\t\t\t$newcharstring .= \"\\xEF\\xBB\\xBF\";\n\t\t}\n\t\tfor ($i = 0; $i < strlen($string); $i++) {\n\t\t\t$charval = ord($string[$i]);\n\t\t\t$newcharstring .= self::iconv_fallback_int_utf8($charval);\n\t\t}\n\t\treturn $newcharstring;\n\t}\n\n\t/**\n\t * ISO-8859-1 => UTF-16BE\n\t *\n\t * @param string $string\n\t * @param bool   $bom\n\t *\n\t * @return string\n\t */\n\tpublic static function iconv_fallback_iso88591_utf16be($string, $bom=false) {\n\t\t$newcharstring = '';\n\t\tif ($bom) {\n\t\t\t$newcharstring .= \"\\xFE\\xFF\";\n\t\t}\n\t\tfor ($i = 0; $i < strlen($string); $i++) {\n\t\t\t$newcharstring .= \"\\x00\".$string[$i];\n\t\t}\n\t\treturn $newcharstring;\n\t}\n\n\t/**\n\t * ISO-8859-1 => UTF-16LE\n\t *\n\t * @param string $string\n\t * @param bool   $bom\n\t *\n\t * @return string\n\t */\n\tpublic static function iconv_fallback_iso88591_utf16le($string, $bom=false) {\n\t\t$newcharstring = '';\n\t\tif ($bom) {\n\t\t\t$newcharstring .= \"\\xFF\\xFE\";\n\t\t}\n\t\tfor ($i = 0; $i < strlen($string); $i++) {\n\t\t\t$newcharstring .= $string[$i].\"\\x00\";\n\t\t}\n\t\treturn $newcharstring;\n\t}\n\n\t/**\n\t * ISO-8859-1 => UTF-16LE (BOM)\n\t *\n\t * @param string $string\n\t *\n\t * @return string\n\t */\n\tpublic static function iconv_fallback_iso88591_utf16($string) {\n\t\treturn self::iconv_fallback_iso88591_utf16le($string, true);\n\t}\n\n\t/**\n\t * UTF-8 => ISO-8859-1\n\t *\n\t * @param string $string\n\t *\n\t * @return string\n\t */\n\tpublic static function iconv_fallback_utf8_iso88591($string) {\n\t\tif (function_exists('utf8_decode')) {\n\t\t\treturn utf8_decode($string);\n\t\t}\n\t\t// utf8_decode() unavailable, use getID3()'s iconv_fallback() conversions (possibly PHP is compiled without XML support)\n\t\t$newcharstring = '';\n\t\t$offset = 0;\n\t\t$stringlength = strlen($string);\n\t\twhile ($offset < $stringlength) {\n\t\t\tif ((ord($string[$offset]) | 0x07) == 0xF7) {\n\t\t\t\t// 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb\n\t\t\t\t$charval = ((ord($string[($offset + 0)]) & 0x07) << 18) &\n\t\t\t\t\t\t   ((ord($string[($offset + 1)]) & 0x3F) << 12) &\n\t\t\t\t\t\t   ((ord($string[($offset + 2)]) & 0x3F) <<  6) &\n\t\t\t\t\t\t\t(ord($string[($offset + 3)]) & 0x3F);\n\t\t\t\t$offset += 4;\n\t\t\t} elseif ((ord($string[$offset]) | 0x0F) == 0xEF) {\n\t\t\t\t// 1110bbbb 10bbbbbb 10bbbbbb\n\t\t\t\t$charval = ((ord($string[($offset + 0)]) & 0x0F) << 12) &\n\t\t\t\t\t\t   ((ord($string[($offset + 1)]) & 0x3F) <<  6) &\n\t\t\t\t\t\t\t(ord($string[($offset + 2)]) & 0x3F);\n\t\t\t\t$offset += 3;\n\t\t\t} elseif ((ord($string[$offset]) | 0x1F) == 0xDF) {\n\t\t\t\t// 110bbbbb 10bbbbbb\n\t\t\t\t$charval = ((ord($string[($offset + 0)]) & 0x1F) <<  6) &\n\t\t\t\t\t\t\t(ord($string[($offset + 1)]) & 0x3F);\n\t\t\t\t$offset += 2;\n\t\t\t} elseif ((ord($string[$offset]) | 0x7F) == 0x7F) {\n\t\t\t\t// 0bbbbbbb\n\t\t\t\t$charval = ord($string[$offset]);\n\t\t\t\t$offset += 1;\n\t\t\t} else {\n\t\t\t\t// error? throw some kind of warning here?\n\t\t\t\t$charval = false;\n\t\t\t\t$offset += 1;\n\t\t\t}\n\t\t\tif ($charval !== false) {\n\t\t\t\t$newcharstring .= (($charval < 256) ? chr($charval) : '?');\n\t\t\t}\n\t\t}\n\t\treturn $newcharstring;\n\t}\n\n\t/**\n\t * UTF-8 => UTF-16BE\n\t *\n\t * @param string $string\n\t * @param bool   $bom\n\t *\n\t * @return string\n\t */\n\tpublic static function iconv_fallback_utf8_utf16be($string, $bom=false) {\n\t\t$newcharstring = '';\n\t\tif ($bom) {\n\t\t\t$newcharstring .= \"\\xFE\\xFF\";\n\t\t}\n\t\t$offset = 0;\n\t\t$stringlength = strlen($string);\n\t\twhile ($offset < $stringlength) {\n\t\t\tif ((ord($string[$offset]) | 0x07) == 0xF7) {\n\t\t\t\t// 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb\n\t\t\t\t$charval = ((ord($string[($offset + 0)]) & 0x07) << 18) &\n\t\t\t\t\t\t   ((ord($string[($offset + 1)]) & 0x3F) << 12) &\n\t\t\t\t\t\t   ((ord($string[($offset + 2)]) & 0x3F) <<  6) &\n\t\t\t\t\t\t\t(ord($string[($offset + 3)]) & 0x3F);\n\t\t\t\t$offset += 4;\n\t\t\t} elseif ((ord($string[$offset]) | 0x0F) == 0xEF) {\n\t\t\t\t// 1110bbbb 10bbbbbb 10bbbbbb\n\t\t\t\t$charval = ((ord($string[($offset + 0)]) & 0x0F) << 12) &\n\t\t\t\t\t\t   ((ord($string[($offset + 1)]) & 0x3F) <<  6) &\n\t\t\t\t\t\t\t(ord($string[($offset + 2)]) & 0x3F);\n\t\t\t\t$offset += 3;\n\t\t\t} elseif ((ord($string[$offset]) | 0x1F) == 0xDF) {\n\t\t\t\t// 110bbbbb 10bbbbbb\n\t\t\t\t$charval = ((ord($string[($offset + 0)]) & 0x1F) <<  6) &\n\t\t\t\t\t\t\t(ord($string[($offset + 1)]) & 0x3F);\n\t\t\t\t$offset += 2;\n\t\t\t} elseif ((ord($string[$offset]) | 0x7F) == 0x7F) {\n\t\t\t\t// 0bbbbbbb\n\t\t\t\t$charval = ord($string[$offset]);\n\t\t\t\t$offset += 1;\n\t\t\t} else {\n\t\t\t\t// error? throw some kind of warning here?\n\t\t\t\t$charval = false;\n\t\t\t\t$offset += 1;\n\t\t\t}\n\t\t\tif ($charval !== false) {\n\t\t\t\t$newcharstring .= (($charval < 65536) ? self::BigEndian2String($charval, 2) : \"\\x00\".'?');\n\t\t\t}\n\t\t}\n\t\treturn $newcharstring;\n\t}\n\n\t/**\n\t * UTF-8 => UTF-16LE\n\t *\n\t * @param string $string\n\t * @param bool   $bom\n\t *\n\t * @return string\n\t */\n\tpublic static function iconv_fallback_utf8_utf16le($string, $bom=false) {\n\t\t$newcharstring = '';\n\t\tif ($bom) {\n\t\t\t$newcharstring .= \"\\xFF\\xFE\";\n\t\t}\n\t\t$offset = 0;\n\t\t$stringlength = strlen($string);\n\t\twhile ($offset < $stringlength) {\n\t\t\tif ((ord($string[$offset]) | 0x07) == 0xF7) {\n\t\t\t\t// 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb\n\t\t\t\t$charval = ((ord($string[($offset + 0)]) & 0x07) << 18) &\n\t\t\t\t\t\t   ((ord($string[($offset + 1)]) & 0x3F) << 12) &\n\t\t\t\t\t\t   ((ord($string[($offset + 2)]) & 0x3F) <<  6) &\n\t\t\t\t\t\t\t(ord($string[($offset + 3)]) & 0x3F);\n\t\t\t\t$offset += 4;\n\t\t\t} elseif ((ord($string[$offset]) | 0x0F) == 0xEF) {\n\t\t\t\t// 1110bbbb 10bbbbbb 10bbbbbb\n\t\t\t\t$charval = ((ord($string[($offset + 0)]) & 0x0F) << 12) &\n\t\t\t\t\t\t   ((ord($string[($offset + 1)]) & 0x3F) <<  6) &\n\t\t\t\t\t\t\t(ord($string[($offset + 2)]) & 0x3F);\n\t\t\t\t$offset += 3;\n\t\t\t} elseif ((ord($string[$offset]) | 0x1F) == 0xDF) {\n\t\t\t\t// 110bbbbb 10bbbbbb\n\t\t\t\t$charval = ((ord($string[($offset + 0)]) & 0x1F) <<  6) &\n\t\t\t\t\t\t\t(ord($string[($offset + 1)]) & 0x3F);\n\t\t\t\t$offset += 2;\n\t\t\t} elseif ((ord($string[$offset]) | 0x7F) == 0x7F) {\n\t\t\t\t// 0bbbbbbb\n\t\t\t\t$charval = ord($string[$offset]);\n\t\t\t\t$offset += 1;\n\t\t\t} else {\n\t\t\t\t// error? maybe throw some warning here?\n\t\t\t\t$charval = false;\n\t\t\t\t$offset += 1;\n\t\t\t}\n\t\t\tif ($charval !== false) {\n\t\t\t\t$newcharstring .= (($charval < 65536) ? self::LittleEndian2String($charval, 2) : '?'.\"\\x00\");\n\t\t\t}\n\t\t}\n\t\treturn $newcharstring;\n\t}\n\n\t/**\n\t * UTF-8 => UTF-16LE (BOM)\n\t *\n\t * @param string $string\n\t *\n\t * @return string\n\t */\n\tpublic static function iconv_fallback_utf8_utf16($string) {\n\t\treturn self::iconv_fallback_utf8_utf16le($string, true);\n\t}\n\n\t/**\n\t * UTF-16BE => UTF-8\n\t *\n\t * @param string $string\n\t *\n\t * @return string\n\t */\n\tpublic static function iconv_fallback_utf16be_utf8($string) {\n\t\tif (substr($string, 0, 2) == \"\\xFE\\xFF\") {\n\t\t\t// strip BOM\n\t\t\t$string = substr($string, 2);\n\t\t}\n\t\t$newcharstring = '';\n\t\tfor ($i = 0; $i < strlen($string); $i += 2) {\n\t\t\t$charval = self::BigEndian2Int(substr($string, $i, 2));\n\t\t\t$newcharstring .= self::iconv_fallback_int_utf8($charval);\n\t\t}\n\t\treturn $newcharstring;\n\t}\n\n\t/**\n\t * UTF-16LE => UTF-8\n\t *\n\t * @param string $string\n\t *\n\t * @return string\n\t */\n\tpublic static function iconv_fallback_utf16le_utf8($string) {\n\t\tif (substr($string, 0, 2) == \"\\xFF\\xFE\") {\n\t\t\t// strip BOM\n\t\t\t$string = substr($string, 2);\n\t\t}\n\t\t$newcharstring = '';\n\t\tfor ($i = 0; $i < strlen($string); $i += 2) {\n\t\t\t$charval = self::LittleEndian2Int(substr($string, $i, 2));\n\t\t\t$newcharstring .= self::iconv_fallback_int_utf8($charval);\n\t\t}\n\t\treturn $newcharstring;\n\t}\n\n\t/**\n\t * UTF-16BE => ISO-8859-1\n\t *\n\t * @param string $string\n\t *\n\t * @return string\n\t */\n\tpublic static function iconv_fallback_utf16be_iso88591($string) {\n\t\tif (substr($string, 0, 2) == \"\\xFE\\xFF\") {\n\t\t\t// strip BOM\n\t\t\t$string = substr($string, 2);\n\t\t}\n\t\t$newcharstring = '';\n\t\tfor ($i = 0; $i < strlen($string); $i += 2) {\n\t\t\t$charval = self::BigEndian2Int(substr($string, $i, 2));\n\t\t\t$newcharstring .= (($charval < 256) ? chr($charval) : '?');\n\t\t}\n\t\treturn $newcharstring;\n\t}\n\n\t/**\n\t * UTF-16LE => ISO-8859-1\n\t *\n\t * @param string $string\n\t *\n\t * @return string\n\t */\n\tpublic static function iconv_fallback_utf16le_iso88591($string) {\n\t\tif (substr($string, 0, 2) == \"\\xFF\\xFE\") {\n\t\t\t// strip BOM\n\t\t\t$string = substr($string, 2);\n\t\t}\n\t\t$newcharstring = '';\n\t\tfor ($i = 0; $i < strlen($string); $i += 2) {\n\t\t\t$charval = self::LittleEndian2Int(substr($string, $i, 2));\n\t\t\t$newcharstring .= (($charval < 256) ? chr($charval) : '?');\n\t\t}\n\t\treturn $newcharstring;\n\t}\n\n\t/**\n\t * UTF-16 (BOM) => ISO-8859-1\n\t *\n\t * @param string $string\n\t *\n\t * @return string\n\t */\n\tpublic static function iconv_fallback_utf16_iso88591($string) {\n\t\t$bom = substr($string, 0, 2);\n\t\tif ($bom == \"\\xFE\\xFF\") {\n\t\t\treturn self::iconv_fallback_utf16be_iso88591(substr($string, 2));\n\t\t} elseif ($bom == \"\\xFF\\xFE\") {\n\t\t\treturn self::iconv_fallback_utf16le_iso88591(substr($string, 2));\n\t\t}\n\t\treturn $string;\n\t}\n\n\t/**\n\t * UTF-16 (BOM) => UTF-8\n\t *\n\t * @param string $string\n\t *\n\t * @return string\n\t */\n\tpublic static function iconv_fallback_utf16_utf8($string) {\n\t\t$bom = substr($string, 0, 2);\n\t\tif ($bom == \"\\xFE\\xFF\") {\n\t\t\treturn self::iconv_fallback_utf16be_utf8(substr($string, 2));\n\t\t} elseif ($bom == \"\\xFF\\xFE\") {\n\t\t\treturn self::iconv_fallback_utf16le_utf8(substr($string, 2));\n\t\t}\n\t\treturn $string;\n\t}\n\n\t/**\n\t * @param string $in_charset\n\t * @param string $out_charset\n\t * @param string $string\n\t *\n\t * @return string\n\t * @throws Exception\n\t */\n\tpublic static function iconv_fallback($in_charset, $out_charset, $string) {\n\n\t\tif ($in_charset == $out_charset) {\n\t\t\treturn $string;\n\t\t}\n\n\t\t// mb_convert_encoding() available\n\t\tif (function_exists('mb_convert_encoding')) {\n\t\t\tif ((strtoupper($in_charset) == 'UTF-16') && (substr($string, 0, 2) != \"\\xFE\\xFF\") && (substr($string, 0, 2) != \"\\xFF\\xFE\")) {\n\t\t\t\t// if BOM missing, mb_convert_encoding will mishandle the conversion, assume UTF-16BE and prepend appropriate BOM\n\t\t\t\t$string = \"\\xFF\\xFE\".$string;\n\t\t\t}\n\t\t\tif ((strtoupper($in_charset) == 'UTF-16') && (strtoupper($out_charset) == 'UTF-8')) {\n\t\t\t\tif (($string == \"\\xFF\\xFE\") || ($string == \"\\xFE\\xFF\")) {\n\t\t\t\t\t// if string consists of only BOM, mb_convert_encoding will return the BOM unmodified\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($converted_string = @mb_convert_encoding($string, $out_charset, $in_charset)) {\n\t\t\t\tswitch ($out_charset) {\n\t\t\t\t\tcase 'ISO-8859-1':\n\t\t\t\t\t\t$converted_string = rtrim($converted_string, \"\\x00\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn $converted_string;\n\t\t\t}\n\t\t\treturn $string;\n\n\t\t// iconv() available\n\t\t} elseif (function_exists('iconv')) {\n\t\t\tif ($converted_string = @iconv($in_charset, $out_charset.'//TRANSLIT', $string)) {\n\t\t\t\tswitch ($out_charset) {\n\t\t\t\t\tcase 'ISO-8859-1':\n\t\t\t\t\t\t$converted_string = rtrim($converted_string, \"\\x00\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn $converted_string;\n\t\t\t}\n\n\t\t\t// iconv() may sometimes fail with \"illegal character in input string\" error message\n\t\t\t// and return an empty string, but returning the unconverted string is more useful\n\t\t\treturn $string;\n\t\t}\n\n\n\t\t// neither mb_convert_encoding or iconv() is available\n\t\tstatic $ConversionFunctionList = array();\n\t\tif (empty($ConversionFunctionList)) {\n\t\t\t$ConversionFunctionList['ISO-8859-1']['UTF-8']    = 'iconv_fallback_iso88591_utf8';\n\t\t\t$ConversionFunctionList['ISO-8859-1']['UTF-16']   = 'iconv_fallback_iso88591_utf16';\n\t\t\t$ConversionFunctionList['ISO-8859-1']['UTF-16BE'] = 'iconv_fallback_iso88591_utf16be';\n\t\t\t$ConversionFunctionList['ISO-8859-1']['UTF-16LE'] = 'iconv_fallback_iso88591_utf16le';\n\t\t\t$ConversionFunctionList['UTF-8']['ISO-8859-1']    = 'iconv_fallback_utf8_iso88591';\n\t\t\t$ConversionFunctionList['UTF-8']['UTF-16']        = 'iconv_fallback_utf8_utf16';\n\t\t\t$ConversionFunctionList['UTF-8']['UTF-16BE']      = 'iconv_fallback_utf8_utf16be';\n\t\t\t$ConversionFunctionList['UTF-8']['UTF-16LE']      = 'iconv_fallback_utf8_utf16le';\n\t\t\t$ConversionFunctionList['UTF-16']['ISO-8859-1']   = 'iconv_fallback_utf16_iso88591';\n\t\t\t$ConversionFunctionList['UTF-16']['UTF-8']        = 'iconv_fallback_utf16_utf8';\n\t\t\t$ConversionFunctionList['UTF-16LE']['ISO-8859-1'] = 'iconv_fallback_utf16le_iso88591';\n\t\t\t$ConversionFunctionList['UTF-16LE']['UTF-8']      = 'iconv_fallback_utf16le_utf8';\n\t\t\t$ConversionFunctionList['UTF-16BE']['ISO-8859-1'] = 'iconv_fallback_utf16be_iso88591';\n\t\t\t$ConversionFunctionList['UTF-16BE']['UTF-8']      = 'iconv_fallback_utf16be_utf8';\n\t\t}\n\t\tif (isset($ConversionFunctionList[strtoupper($in_charset)][strtoupper($out_charset)])) {\n\t\t\t$ConversionFunction = $ConversionFunctionList[strtoupper($in_charset)][strtoupper($out_charset)];\n\t\t\treturn self::$ConversionFunction($string);\n\t\t}\n\t\tthrow new Exception('PHP does not has mb_convert_encoding() or iconv() support - cannot convert from '.$in_charset.' to '.$out_charset);\n\t}\n\n\t/**\n\t * @param mixed  $data\n\t * @param string $charset\n\t *\n\t * @return mixed\n\t */\n\tpublic static function recursiveMultiByteCharString2HTML($data, $charset='ISO-8859-1') {\n\t\tif (is_string($data)) {\n\t\t\treturn self::MultiByteCharString2HTML($data, $charset);\n\t\t} elseif (is_array($data)) {\n\t\t\t$return_data = array();\n\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t$return_data[$key] = self::recursiveMultiByteCharString2HTML($value, $charset);\n\t\t\t}\n\t\t\treturn $return_data;\n\t\t}\n\t\t// integer, float, objects, resources, etc\n\t\treturn $data;\n\t}\n\n\t/**\n\t * @param string|int|float $string\n\t * @param string           $charset\n\t *\n\t * @return string\n\t */\n\tpublic static function MultiByteCharString2HTML($string, $charset='ISO-8859-1') {\n\t\t$string = (string) $string; // in case trying to pass a numeric (float, int) string, would otherwise return an empty string\n\t\t$HTMLstring = '';\n\n\t\tswitch (strtolower($charset)) {\n\t\t\tcase '1251':\n\t\t\tcase '1252':\n\t\t\tcase '866':\n\t\t\tcase '932':\n\t\t\tcase '936':\n\t\t\tcase '950':\n\t\t\tcase 'big5':\n\t\t\tcase 'big5-hkscs':\n\t\t\tcase 'cp1251':\n\t\t\tcase 'cp1252':\n\t\t\tcase 'cp866':\n\t\t\tcase 'euc-jp':\n\t\t\tcase 'eucjp':\n\t\t\tcase 'gb2312':\n\t\t\tcase 'ibm866':\n\t\t\tcase 'iso-8859-1':\n\t\t\tcase 'iso-8859-15':\n\t\t\tcase 'iso8859-1':\n\t\t\tcase 'iso8859-15':\n\t\t\tcase 'koi8-r':\n\t\t\tcase 'koi8-ru':\n\t\t\tcase 'koi8r':\n\t\t\tcase 'shift_jis':\n\t\t\tcase 'sjis':\n\t\t\tcase 'win-1251':\n\t\t\tcase 'windows-1251':\n\t\t\tcase 'windows-1252':\n\t\t\t\t$HTMLstring = htmlentities($string, ENT_COMPAT, $charset);\n\t\t\t\tbreak;\n\n\t\t\tcase 'utf-8':\n\t\t\t\t$strlen = strlen($string);\n\t\t\t\tfor ($i = 0; $i < $strlen; $i++) {\n\t\t\t\t\t$char_ord_val = ord($string[$i]);\n\t\t\t\t\t$charval = 0;\n\t\t\t\t\tif ($char_ord_val < 0x80) {\n\t\t\t\t\t\t$charval = $char_ord_val;\n\t\t\t\t\t} elseif ((($char_ord_val & 0xF0) >> 4) == 0x0F  &&  $i+3 < $strlen) {\n\t\t\t\t\t\t$charval  = (($char_ord_val & 0x07) << 18);\n\t\t\t\t\t\t$charval += ((ord($string[++$i]) & 0x3F) << 12);\n\t\t\t\t\t\t$charval += ((ord($string[++$i]) & 0x3F) << 6);\n\t\t\t\t\t\t$charval +=  (ord($string[++$i]) & 0x3F);\n\t\t\t\t\t} elseif ((($char_ord_val & 0xE0) >> 5) == 0x07  &&  $i+2 < $strlen) {\n\t\t\t\t\t\t$charval  = (($char_ord_val & 0x0F) << 12);\n\t\t\t\t\t\t$charval += ((ord($string[++$i]) & 0x3F) << 6);\n\t\t\t\t\t\t$charval +=  (ord($string[++$i]) & 0x3F);\n\t\t\t\t\t} elseif ((($char_ord_val & 0xC0) >> 6) == 0x03  &&  $i+1 < $strlen) {\n\t\t\t\t\t\t$charval  = (($char_ord_val & 0x1F) << 6);\n\t\t\t\t\t\t$charval += (ord($string[++$i]) & 0x3F);\n\t\t\t\t\t}\n\t\t\t\t\tif (($charval >= 32) && ($charval <= 127)) {\n\t\t\t\t\t\t$HTMLstring .= htmlentities(chr($charval));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$HTMLstring .= '&#'.$charval.';';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'utf-16le':\n\t\t\t\tfor ($i = 0; $i < strlen($string); $i += 2) {\n\t\t\t\t\t$charval = self::LittleEndian2Int(substr($string, $i, 2));\n\t\t\t\t\tif (($charval >= 32) && ($charval <= 127)) {\n\t\t\t\t\t\t$HTMLstring .= chr($charval);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$HTMLstring .= '&#'.$charval.';';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'utf-16be':\n\t\t\t\tfor ($i = 0; $i < strlen($string); $i += 2) {\n\t\t\t\t\t$charval = self::BigEndian2Int(substr($string, $i, 2));\n\t\t\t\t\tif (($charval >= 32) && ($charval <= 127)) {\n\t\t\t\t\t\t$HTMLstring .= chr($charval);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$HTMLstring .= '&#'.$charval.';';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$HTMLstring = 'ERROR: Character set \"'.$charset.'\" not supported in MultiByteCharString2HTML()';\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $HTMLstring;\n\t}\n\n\t/**\n\t * @param int $namecode\n\t *\n\t * @return string\n\t */\n\tpublic static function RGADnameLookup($namecode) {\n\t\tstatic $RGADname = array();\n\t\tif (empty($RGADname)) {\n\t\t\t$RGADname[0] = 'not set';\n\t\t\t$RGADname[1] = 'Track Gain Adjustment';\n\t\t\t$RGADname[2] = 'Album Gain Adjustment';\n\t\t}\n\n\t\treturn (isset($RGADname[$namecode]) ? $RGADname[$namecode] : '');\n\t}\n\n\t/**\n\t * @param int $originatorcode\n\t *\n\t * @return string\n\t */\n\tpublic static function RGADoriginatorLookup($originatorcode) {\n\t\tstatic $RGADoriginator = array();\n\t\tif (empty($RGADoriginator)) {\n\t\t\t$RGADoriginator[0] = 'unspecified';\n\t\t\t$RGADoriginator[1] = 'pre-set by artist/producer/mastering engineer';\n\t\t\t$RGADoriginator[2] = 'set by user';\n\t\t\t$RGADoriginator[3] = 'determined automatically';\n\t\t}\n\n\t\treturn (isset($RGADoriginator[$originatorcode]) ? $RGADoriginator[$originatorcode] : '');\n\t}\n\n\t/**\n\t * @param int $rawadjustment\n\t * @param int $signbit\n\t *\n\t * @return float\n\t */\n\tpublic static function RGADadjustmentLookup($rawadjustment, $signbit) {\n\t\t$adjustment = (float) $rawadjustment / 10;\n\t\tif ($signbit == 1) {\n\t\t\t$adjustment *= -1;\n\t\t}\n\t\treturn $adjustment;\n\t}\n\n\t/**\n\t * @param int $namecode\n\t * @param int $originatorcode\n\t * @param int $replaygain\n\t *\n\t * @return string\n\t */\n\tpublic static function RGADgainString($namecode, $originatorcode, $replaygain) {\n\t\tif ($replaygain < 0) {\n\t\t\t$signbit = '1';\n\t\t} else {\n\t\t\t$signbit = '0';\n\t\t}\n\t\t$storedreplaygain = intval(round($replaygain * 10));\n\t\t$gainstring  = str_pad(decbin($namecode), 3, '0', STR_PAD_LEFT);\n\t\t$gainstring .= str_pad(decbin($originatorcode), 3, '0', STR_PAD_LEFT);\n\t\t$gainstring .= $signbit;\n\t\t$gainstring .= str_pad(decbin($storedreplaygain), 9, '0', STR_PAD_LEFT);\n\n\t\treturn $gainstring;\n\t}\n\n\t/**\n\t * @param float $amplitude\n\t *\n\t * @return float\n\t */\n\tpublic static function RGADamplitude2dB($amplitude) {\n\t\treturn 20 * log10($amplitude);\n\t}\n\n\t/**\n\t * @param string $imgData\n\t * @param array  $imageinfo\n\t *\n\t * @return array|false\n\t */\n\tpublic static function GetDataImageSize($imgData, &$imageinfo=array()) {\n\t\tif (PHP_VERSION_ID >= 50400) {\n\t\t\t$GetDataImageSize = @getimagesizefromstring($imgData, $imageinfo);\n\t\t\tif ($GetDataImageSize === false || !isset($GetDataImageSize[0], $GetDataImageSize[1])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$GetDataImageSize['height'] = $GetDataImageSize[0];\n\t\t\t$GetDataImageSize['width'] = $GetDataImageSize[1];\n\t\t\treturn $GetDataImageSize;\n\t\t}\n\t\tstatic $tempdir = '';\n\t\tif (empty($tempdir)) {\n\t\t\tif (function_exists('sys_get_temp_dir')) {\n\t\t\t\t$tempdir = sys_get_temp_dir(); // https://github.com/JamesHeinrich/getID3/issues/52\n\t\t\t}\n\n\t\t\t// yes this is ugly, feel free to suggest a better way\n\t\t\tif (include_once(dirname(__FILE__).'/getid3.php')) {\n\t\t\t\t$getid3_temp = new getID3();\n\t\t\t\tif ($getid3_temp_tempdir = $getid3_temp->tempdir) {\n\t\t\t\t\t$tempdir = $getid3_temp_tempdir;\n\t\t\t\t}\n\t\t\t\tunset($getid3_temp, $getid3_temp_tempdir);\n\t\t\t}\n\t\t}\n\t\t$GetDataImageSize = false;\n\t\tif ($tempfilename = tempnam($tempdir, 'gI3')) {\n\t\t\tif (is_writable($tempfilename) && is_file($tempfilename) && ($tmp = fopen($tempfilename, 'wb'))) {\n\t\t\t\tfwrite($tmp, $imgData);\n\t\t\t\tfclose($tmp);\n\t\t\t\t$GetDataImageSize = @getimagesize($tempfilename, $imageinfo);\n\t\t\t\tif (($GetDataImageSize === false) || !isset($GetDataImageSize[0]) || !isset($GetDataImageSize[1])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$GetDataImageSize['height'] = $GetDataImageSize[0];\n\t\t\t\t$GetDataImageSize['width']  = $GetDataImageSize[1];\n\t\t\t}\n\t\t\tunlink($tempfilename);\n\t\t}\n\t\treturn $GetDataImageSize;\n\t}\n\n\t/**\n\t * @param string $mime_type\n\t *\n\t * @return string\n\t */\n\tpublic static function ImageExtFromMime($mime_type) {\n\t\t// temporary way, works OK for now, but should be reworked in the future\n\t\treturn str_replace(array('image/', 'x-', 'jpeg'), array('', '', 'jpg'), $mime_type);\n\t}\n\n\t/**\n\t * @param array $ThisFileInfo\n\t * @param bool  $option_tags_html default true (just as in the main getID3 class)\n\t *\n\t * @return bool\n\t */\n\tpublic static function CopyTagsToComments(&$ThisFileInfo, $option_tags_html=true) {\n\t\t// Copy all entries from ['tags'] into common ['comments']\n\t\tif (!empty($ThisFileInfo['tags'])) {\n\t\t\tif (isset($ThisFileInfo['tags']['id3v1'])) {\n\t\t\t\t// bubble ID3v1 to the end, if present to aid in detecting bad ID3v1 encodings\n\t\t\t\t$ID3v1 = $ThisFileInfo['tags']['id3v1'];\n\t\t\t\tunset($ThisFileInfo['tags']['id3v1']);\n\t\t\t\t$ThisFileInfo['tags']['id3v1'] = $ID3v1;\n\t\t\t\tunset($ID3v1);\n\t\t\t}\n\t\t\tforeach ($ThisFileInfo['tags'] as $tagtype => $tagarray) {\n\t\t\t\tforeach ($tagarray as $tagname => $tagdata) {\n\t\t\t\t\tforeach ($tagdata as $key => $value) {\n\t\t\t\t\t\tif (!empty($value)) {\n\t\t\t\t\t\t\tif (empty($ThisFileInfo['comments'][$tagname])) {\n\n\t\t\t\t\t\t\t\t// fall through and append value\n\n\t\t\t\t\t\t\t} elseif ($tagtype == 'id3v1') {\n\n\t\t\t\t\t\t\t\t$newvaluelength = strlen(trim($value));\n\t\t\t\t\t\t\t\tforeach ($ThisFileInfo['comments'][$tagname] as $existingkey => $existingvalue) {\n\t\t\t\t\t\t\t\t\t$oldvaluelength = strlen(trim($existingvalue));\n\t\t\t\t\t\t\t\t\tif (($newvaluelength <= $oldvaluelength) && (substr($existingvalue, 0, $newvaluelength) == trim($value))) {\n\t\t\t\t\t\t\t\t\t\t// new value is identical but shorter-than (or equal-length to) one already in comments - skip\n\t\t\t\t\t\t\t\t\t\tbreak 2;\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\tif (function_exists('mb_convert_encoding')) {\n\t\t\t\t\t\t\t\t\tif (trim($value) == trim(substr(mb_convert_encoding($existingvalue, $ThisFileInfo['id3v1']['encoding'], $ThisFileInfo['encoding']), 0, 30))) {\n\t\t\t\t\t\t\t\t\t\t// value stored in ID3v1 appears to be probably the multibyte value transliterated (badly) into ISO-8859-1 in ID3v1.\n\t\t\t\t\t\t\t\t\t\t// As an example, Foobar2000 will do this if you tag a file with Chinese or Arabic or Cyrillic or something that doesn't fit into ISO-8859-1 the ID3v1 will consist of mostly \"?\" characters, one per multibyte unrepresentable character\n\t\t\t\t\t\t\t\t\t\tbreak 2;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} elseif (!is_array($value)) {\n\n\t\t\t\t\t\t\t\t$newvaluelength = strlen(trim($value));\n\t\t\t\t\t\t\t\tforeach ($ThisFileInfo['comments'][$tagname] as $existingkey => $existingvalue) {\n\t\t\t\t\t\t\t\t\t$oldvaluelength = strlen(trim($existingvalue));\n\t\t\t\t\t\t\t\t\tif ((strlen($existingvalue) > 10) && ($newvaluelength > $oldvaluelength) && (substr(trim($value), 0, strlen($existingvalue)) == $existingvalue)) {\n\t\t\t\t\t\t\t\t\t\t$ThisFileInfo['comments'][$tagname][$existingkey] = trim($value);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (is_array($value) || empty($ThisFileInfo['comments'][$tagname]) || !in_array(trim($value), $ThisFileInfo['comments'][$tagname])) {\n\t\t\t\t\t\t\t\t$value = (is_string($value) ? trim($value) : $value);\n\t\t\t\t\t\t\t\tif (!is_int($key) && !ctype_digit($key)) {\n\t\t\t\t\t\t\t\t\t$ThisFileInfo['comments'][$tagname][$key] = $value;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (!isset($ThisFileInfo['comments'][$tagname])) {\n\t\t\t\t\t\t\t\t\t\t$ThisFileInfo['comments'][$tagname] = array($value);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$ThisFileInfo['comments'][$tagname][] = $value;\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// attempt to standardize spelling of returned keys\n\t\t\t$StandardizeFieldNames = array(\n\t\t\t\t'tracknumber' => 'track_number',\n\t\t\t\t'track'       => 'track_number',\n\t\t\t);\n\t\t\tforeach ($StandardizeFieldNames as $badkey => $goodkey) {\n\t\t\t\tif (array_key_exists($badkey, $ThisFileInfo['comments']) && !array_key_exists($goodkey, $ThisFileInfo['comments'])) {\n\t\t\t\t\t$ThisFileInfo['comments'][$goodkey] = $ThisFileInfo['comments'][$badkey];\n\t\t\t\t\tunset($ThisFileInfo['comments'][$badkey]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($option_tags_html) {\n\t\t\t\t// Copy ['comments'] to ['comments_html']\n\t\t\t\tif (!empty($ThisFileInfo['comments'])) {\n\t\t\t\t\tforeach ($ThisFileInfo['comments'] as $field => $values) {\n\t\t\t\t\t\tif ($field == 'picture') {\n\t\t\t\t\t\t\t// pictures can take up a lot of space, and we don't need multiple copies of them\n\t\t\t\t\t\t\t// let there be a single copy in [comments][picture], and not elsewhere\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach ($values as $index => $value) {\n\t\t\t\t\t\t\tif (is_array($value)) {\n\t\t\t\t\t\t\t\t$ThisFileInfo['comments_html'][$field][$index] = $value;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$ThisFileInfo['comments_html'][$field][$index] = str_replace('&#0;', '', self::MultiByteCharString2HTML($value, $ThisFileInfo['encoding']));\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\t\t\t}\n\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $key\n\t * @param int    $begin\n\t * @param int    $end\n\t * @param string $file\n\t * @param string $name\n\t *\n\t * @return string\n\t */\n\tpublic static function EmbeddedLookup($key, $begin, $end, $file, $name) {\n\n\t\t// Cached\n\t\tstatic $cache;\n\t\tif (isset($cache[$file][$name])) {\n\t\t\treturn (isset($cache[$file][$name][$key]) ? $cache[$file][$name][$key] : '');\n\t\t}\n\n\t\t// Init\n\t\t$keylength  = strlen($key);\n\t\t$line_count = $end - $begin - 7;\n\n\t\t// Open php file\n\t\t$fp = fopen($file, 'r');\n\n\t\t// Discard $begin lines\n\t\tfor ($i = 0; $i < ($begin + 3); $i++) {\n\t\t\tfgets($fp, 1024);\n\t\t}\n\n\t\t// Loop thru line\n\t\twhile (0 < $line_count--) {\n\n\t\t\t// Read line\n\t\t\t$line = ltrim(fgets($fp, 1024), \"\\t \");\n\n\t\t\t// METHOD A: only cache the matching key - less memory but slower on next lookup of not-previously-looked-up key\n\t\t\t//$keycheck = substr($line, 0, $keylength);\n\t\t\t//if ($key == $keycheck)  {\n\t\t\t//\t$cache[$file][$name][$keycheck] = substr($line, $keylength + 1);\n\t\t\t//\tbreak;\n\t\t\t//}\n\n\t\t\t// METHOD B: cache all keys in this lookup - more memory but faster on next lookup of not-previously-looked-up key\n\t\t\t//$cache[$file][$name][substr($line, 0, $keylength)] = trim(substr($line, $keylength + 1));\n\t\t\t$explodedLine = explode(\"\\t\", $line, 2);\n\t\t\t$ThisKey   = (isset($explodedLine[0]) ? $explodedLine[0] : '');\n\t\t\t$ThisValue = (isset($explodedLine[1]) ? $explodedLine[1] : '');\n\t\t\t$cache[$file][$name][$ThisKey] = trim($ThisValue);\n\t\t}\n\n\t\t// Close and return\n\t\tfclose($fp);\n\t\treturn (isset($cache[$file][$name][$key]) ? $cache[$file][$name][$key] : '');\n\t}\n\n\t/**\n\t * @param string $filename\n\t * @param string $sourcefile\n\t * @param bool   $DieOnFailure\n\t *\n\t * @return bool\n\t * @throws Exception\n\t */\n\tpublic static function IncludeDependency($filename, $sourcefile, $DieOnFailure=false) {\n\t\tglobal $GETID3_ERRORARRAY;\n\n\t\tif (file_exists($filename)) {\n\t\t\tif (include_once($filename)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$diemessage = basename($sourcefile).' depends on '.$filename.', which has errors';\n\t\t\t}\n\t\t} else {\n\t\t\t$diemessage = basename($sourcefile).' depends on '.$filename.', which is missing';\n\t\t}\n\t\tif ($DieOnFailure) {\n\t\t\tthrow new Exception($diemessage);\n\t\t} else {\n\t\t\t$GETID3_ERRORARRAY[] = $diemessage;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * @param string $string\n\t *\n\t * @return string\n\t */\n\tpublic static function trimNullByte($string) {\n\t\treturn trim($string, \"\\x00\");\n\t}\n\n\t/**\n\t * @param string $path\n\t *\n\t * @return float|bool\n\t */\n\tpublic static function getFileSizeSyscall($path) {\n\t\t$filesize = false;\n\n\t\tif (GETID3_OS_ISWINDOWS) {\n\t\t\tif (class_exists('COM')) { // From PHP 5.3.15 and 5.4.5, COM and DOTNET is no longer built into the php core.you have to add COM support in php.ini:\n\t\t\t\t$filesystem = new COM('Scripting.FileSystemObject');\n\t\t\t\t$file = $filesystem->GetFile($path);\n\t\t\t\t$filesize = $file->Size();\n\t\t\t\tunset($filesystem, $file);\n\t\t\t} else {\n\t\t\t\t$commandline = 'for %I in ('.escapeshellarg($path).') do @echo %~zI';\n\t\t\t}\n\t\t} else {\n\t\t\t$commandline = 'ls -l '.escapeshellarg($path).' | awk \\'{print $5}\\'';\n\t\t}\n\t\tif (isset($commandline)) {\n\t\t\t$output = trim(`$commandline`);\n\t\t\tif (ctype_digit($output)) {\n\t\t\t\t$filesize = (float) $output;\n\t\t\t}\n\t\t}\n\t\treturn $filesize;\n\t}\n\n\t/**\n\t * @param string $filename\n\t *\n\t * @return string|false\n\t */\n\tpublic static function truepath($filename) {\n\t\t// 2017-11-08: this could use some improvement, patches welcome\n\t\tif (preg_match('#^(\\\\\\\\\\\\\\\\|//)[a-z0-9]#i', $filename, $matches)) {\n\t\t\t// PHP's built-in realpath function does not work on UNC Windows shares\n\t\t\t$goodpath = array();\n\t\t\tforeach (explode('/', str_replace('\\\\', '/', $filename)) as $part) {\n\t\t\t\tif ($part == '.') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ($part == '..') {\n\t\t\t\t\tif (count($goodpath)) {\n\t\t\t\t\t\tarray_pop($goodpath);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// cannot step above this level, already at top level\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$goodpath[] = $part;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn implode(DIRECTORY_SEPARATOR, $goodpath);\n\t\t}\n\t\treturn realpath($filename);\n\t}\n\n\t/**\n\t * Workaround for Bug #37268 (https://bugs.php.net/bug.php?id=37268)\n\t *\n\t * @param string $path A path.\n\t * @param string $suffix If the name component ends in suffix this will also be cut off.\n\t *\n\t * @return string\n\t */\n\tpublic static function mb_basename($path, $suffix = null) {\n\t\t$splited = preg_split('#/#', rtrim($path, '/ '));\n\t\treturn substr(basename('X'.$splited[count($splited) - 1], $suffix), 1);\n\t}\n\n}\n", "num_lines": 1802}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/////////////////////////////////////////////////////////////////\n/// getID3() by James Heinrich <info@getid3.org>               //\n//  available at https://github.com/JamesHeinrich/getID3       //\n//            or https://www.getid3.org                        //\n//            or http://getid3.sourceforge.net                 //\n//                                                             //\n// Please see readme.txt for more information                  //\n//                                                            ///\n/////////////////////////////////////////////////////////////////\n\n// define a constant rather than looking up every time it is needed\nif (!defined('GETID3_OS_ISWINDOWS')) {\n\tdefine('GETID3_OS_ISWINDOWS', (stripos(PHP_OS, 'WIN') === 0));\n}\n// Get base path of getID3() - ONCE\nif (!defined('GETID3_INCLUDEPATH')) {\n\tdefine('GETID3_INCLUDEPATH', dirname(__FILE__).DIRECTORY_SEPARATOR);\n}\n// Workaround Bug #39923 (https://bugs.php.net/bug.php?id=39923)\nif (!defined('IMG_JPG') && defined('IMAGETYPE_JPEG')) {\n\tdefine('IMG_JPG', IMAGETYPE_JPEG);\n}\nif (!defined('ENT_SUBSTITUTE')) { // PHP5.3 adds ENT_IGNORE, PHP5.4 adds ENT_SUBSTITUTE\n\tdefine('ENT_SUBSTITUTE', (defined('ENT_IGNORE') ? ENT_IGNORE : 8));\n}\n\n/*\nhttps://www.getid3.org/phpBB3/viewtopic.php?t=2114\nIf you are running into a the problem where filenames with special characters are being handled\nincorrectly by external helper programs (e.g. metaflac), notably with the special characters removed,\nand you are passing in the filename in UTF8 (typically via a HTML form), try uncommenting this line:\n*/\n//setlocale(LC_CTYPE, 'en_US.UTF-8');\n\n// attempt to define temp dir as something flexible but reliable\n$temp_dir = ini_get('upload_tmp_dir');\nif ($temp_dir && (!is_dir($temp_dir) || !is_readable($temp_dir))) {\n\t$temp_dir = '';\n}\nif (!$temp_dir && function_exists('sys_get_temp_dir')) { // sys_get_temp_dir added in PHP v5.2.1\n\t// sys_get_temp_dir() may give inaccessible temp dir, e.g. with open_basedir on virtual hosts\n\t$temp_dir = sys_get_temp_dir();\n}\n$temp_dir = @realpath($temp_dir); // see https://github.com/JamesHeinrich/getID3/pull/10\n$open_basedir = ini_get('open_basedir');\nif ($open_basedir) {\n\t// e.g. \"/var/www/vhosts/getid3.org/httpdocs/:/tmp/\"\n\t$temp_dir     = str_replace(array('/', '\\\\'), DIRECTORY_SEPARATOR, $temp_dir);\n\t$open_basedir = str_replace(array('/', '\\\\'), DIRECTORY_SEPARATOR, $open_basedir);\n\tif (substr($temp_dir, -1, 1) != DIRECTORY_SEPARATOR) {\n\t\t$temp_dir .= DIRECTORY_SEPARATOR;\n\t}\n\t$found_valid_tempdir = false;\n\t$open_basedirs = explode(PATH_SEPARATOR, $open_basedir);\n\tforeach ($open_basedirs as $basedir) {\n\t\tif (substr($basedir, -1, 1) != DIRECTORY_SEPARATOR) {\n\t\t\t$basedir .= DIRECTORY_SEPARATOR;\n\t\t}\n\t\tif (preg_match('#^'.preg_quote($basedir).'#', $temp_dir)) {\n\t\t\t$found_valid_tempdir = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (!$found_valid_tempdir) {\n\t\t$temp_dir = '';\n\t}\n\tunset($open_basedirs, $found_valid_tempdir, $basedir);\n}\nif (!$temp_dir) {\n\t$temp_dir = '*'; // invalid directory name should force tempnam() to use system default temp dir\n}\n// $temp_dir = '/something/else/';  // feel free to override temp dir here if it works better for your system\nif (!defined('GETID3_TEMP_DIR')) {\n\tdefine('GETID3_TEMP_DIR', $temp_dir);\n}\nunset($open_basedir, $temp_dir);\n\n// End: Defines\n\n\nclass getID3\n{\n\t/*\n\t * Settings\n\t */\n\n\t/**\n\t * CASE SENSITIVE! - i.e. (must be supported by iconv()). Examples:  ISO-8859-1  UTF-8  UTF-16  UTF-16BE\n\t *\n\t * @var string\n\t */\n\tpublic $encoding        = 'UTF-8';\n\n\t/**\n\t * Should always be 'ISO-8859-1', but some tags may be written in other encodings such as 'EUC-CN' or 'CP1252'\n\t *\n\t * @var string\n\t */\n\tpublic $encoding_id3v1  = 'ISO-8859-1';\n\n\t/**\n\t * ID3v1 should always be 'ISO-8859-1', but some tags may be written in other encodings such as 'Windows-1251' or 'KOI8-R'. If true attempt to detect these encodings, but may return incorrect values for some tags actually in ISO-8859-1 encoding\n\t *\n\t * @var bool\n\t */\n\tpublic $encoding_id3v1_autodetect  = false;\n\n\t/*\n\t * Optional tag checks - disable for speed.\n\t */\n\n\t/**\n\t * Read and process ID3v1 tags\n\t *\n\t * @var bool\n\t */\n\tpublic $option_tag_id3v1         = true;\n\n\t/**\n\t * Read and process ID3v2 tags\n\t *\n\t * @var bool\n\t */\n\tpublic $option_tag_id3v2         = true;\n\n\t/**\n\t * Read and process Lyrics3 tags\n\t *\n\t * @var bool\n\t */\n\tpublic $option_tag_lyrics3       = true;\n\n\t/**\n\t * Read and process APE tags\n\t *\n\t * @var bool\n\t */\n\tpublic $option_tag_apetag        = true;\n\n\t/**\n\t * Copy tags to root key 'tags' and encode to $this->encoding\n\t *\n\t * @var bool\n\t */\n\tpublic $option_tags_process      = true;\n\n\t/**\n\t * Copy tags to root key 'tags_html' properly translated from various encodings to HTML entities\n\t *\n\t * @var bool\n\t */\n\tpublic $option_tags_html         = true;\n\n\t/*\n\t * Optional tag/comment calculations\n\t */\n\n\t/**\n\t * Calculate additional info such as bitrate, channelmode etc\n\t *\n\t * @var bool\n\t */\n\tpublic $option_extra_info        = true;\n\n\t/*\n\t * Optional handling of embedded attachments (e.g. images)\n\t */\n\n\t/**\n\t * Defaults to true (ATTACHMENTS_INLINE) for backward compatibility\n\t *\n\t * @var bool|string\n\t */\n\tpublic $option_save_attachments  = true;\n\n\t/*\n\t * Optional calculations\n\t */\n\n\t/**\n\t * Get MD5 sum of data part - slow\n\t *\n\t * @var bool\n\t */\n\tpublic $option_md5_data          = false;\n\n\t/**\n\t * Use MD5 of source file if availble - only FLAC and OptimFROG\n\t *\n\t * @var bool\n\t */\n\tpublic $option_md5_data_source   = false;\n\n\t/**\n\t * Get SHA1 sum of data part - slow\n\t *\n\t * @var bool\n\t */\n\tpublic $option_sha1_data         = false;\n\n\t/**\n\t * Check whether file is larger than 2GB and thus not supported by 32-bit PHP (null: auto-detect based on\n\t * PHP_INT_MAX)\n\t *\n\t * @var bool|null\n\t */\n\tpublic $option_max_2gb_check;\n\n\t/**\n\t * Read buffer size in bytes\n\t *\n\t * @var int\n\t */\n\tpublic $option_fread_buffer_size = 32768;\n\n\t// Public variables\n\n\t/**\n\t * Filename of file being analysed.\n\t *\n\t * @var string\n\t */\n\tpublic $filename;\n\n\t/**\n\t * Filepointer to file being analysed.\n\t *\n\t * @var resource\n\t */\n\tpublic $fp;\n\n\t/**\n\t * Result array.\n\t *\n\t * @var array\n\t */\n\tpublic $info;\n\n\t/**\n\t * @var string\n\t */\n\tpublic $tempdir = GETID3_TEMP_DIR;\n\n\t/**\n\t * @var int\n\t */\n\tpublic $memory_limit = 0;\n\n\t/**\n\t * @var string\n\t */\n\tprotected $startup_error   = '';\n\n\t/**\n\t * @var string\n\t */\n\tprotected $startup_warning = '';\n\n\tconst VERSION           = '1.9.20-202006061653';\n\tconst FREAD_BUFFER_SIZE = 32768;\n\n\tconst ATTACHMENTS_NONE   = false;\n\tconst ATTACHMENTS_INLINE = true;\n\n\tpublic function __construct() {\n\n\t\t// Check for PHP version\n\t\t$required_php_version = '5.3.0';\n\t\tif (version_compare(PHP_VERSION, $required_php_version, '<')) {\n\t\t\t$this->startup_error .= 'getID3() requires PHP v'.$required_php_version.' or higher - you are running v'.PHP_VERSION.\"\\n\";\n\t\t\treturn;\n\t\t}\n\n\t\t// Check memory\n\t\t$memoryLimit = ini_get('memory_limit');\n\t\tif (preg_match('#([0-9]+) ?M#i', $memoryLimit, $matches)) {\n\t\t\t// could be stored as \"16M\" rather than 16777216 for example\n\t\t\t$memoryLimit = $matches[1] * 1048576;\n\t\t} elseif (preg_match('#([0-9]+) ?G#i', $memoryLimit, $matches)) { // The 'G' modifier is available since PHP 5.1.0\n\t\t\t// could be stored as \"2G\" rather than 2147483648 for example\n\t\t\t$memoryLimit = $matches[1] * 1073741824;\n\t\t}\n\t\t$this->memory_limit = $memoryLimit;\n\n\t\tif ($this->memory_limit <= 0) {\n\t\t\t// memory limits probably disabled\n\t\t} elseif ($this->memory_limit <= 4194304) {\n\t\t\t$this->startup_error .= 'PHP has less than 4MB available memory and will very likely run out. Increase memory_limit in php.ini'.\"\\n\";\n\t\t} elseif ($this->memory_limit <= 12582912) {\n\t\t\t$this->startup_warning .= 'PHP has less than 12MB available memory and might run out if all modules are loaded. Increase memory_limit in php.ini'.\"\\n\";\n\t\t}\n\n\t\t// Check safe_mode off\n\t\tif (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved\n\t\t\t$this->warning('WARNING: Safe mode is on, shorten support disabled, md5data/sha1data for ogg vorbis disabled, ogg vorbos/flac tag writing disabled.');\n\t\t}\n\n\t\t// phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated\n\t\tif (($mbstring_func_overload = (int) ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) {\n\t\t\t// http://php.net/manual/en/mbstring.overload.php\n\t\t\t// \"mbstring.func_overload in php.ini is a positive value that represents a combination of bitmasks specifying the categories of functions to be overloaded. It should be set to 1 to overload the mail() function. 2 for string functions, 4 for regular expression functions\"\n\t\t\t// getID3 cannot run when string functions are overloaded. It doesn't matter if mail() or ereg* functions are overloaded since getID3 does not use those.\n\t\t\t// phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated\n\t\t\t$this->startup_error .= 'WARNING: php.ini contains \"mbstring.func_overload = '.ini_get('mbstring.func_overload').'\", getID3 cannot run with this setting (bitmask 2 (string functions) cannot be set). Recommended to disable entirely.'.\"\\n\";\n\t\t}\n\n\t\t// check for magic quotes in PHP < 7.4.0 (when these functions became deprecated)\n\t\tif (version_compare(PHP_VERSION, '7.4.0', '<')) {\n\t\t\t// Check for magic_quotes_runtime\n\t\t\tif (function_exists('get_magic_quotes_runtime')) {\n\t\t\t\t// phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_runtimeDeprecated\n\t\t\t\tif (get_magic_quotes_runtime()) {\n\t\t\t\t\t$this->startup_error .= 'magic_quotes_runtime must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_runtime(0) and set_magic_quotes_runtime(1).'.\"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check for magic_quotes_gpc\n\t\t\tif (function_exists('get_magic_quotes_gpc')) {\n\t\t\t\t// phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_gpcDeprecated\n\t\t\t\tif (get_magic_quotes_gpc()) {\n\t\t\t\t\t$this->startup_error .= 'magic_quotes_gpc must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_gpc(0) and set_magic_quotes_gpc(1).'.\"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Load support library\n\t\tif (!include_once(GETID3_INCLUDEPATH.'getid3.lib.php')) {\n\t\t\t$this->startup_error .= 'getid3.lib.php is missing or corrupt'.\"\\n\";\n\t\t}\n\n\t\tif ($this->option_max_2gb_check === null) {\n\t\t\t$this->option_max_2gb_check = (PHP_INT_MAX <= 2147483647);\n\t\t}\n\n\n\t\t// Needed for Windows only:\n\t\t// Define locations of helper applications for Shorten, VorbisComment, MetaFLAC\n\t\t//   as well as other helper functions such as head, etc\n\t\t// This path cannot contain spaces, but the below code will attempt to get the\n\t\t//   8.3-equivalent path automatically\n\t\t// IMPORTANT: This path must include the trailing slash\n\t\tif (GETID3_OS_ISWINDOWS && !defined('GETID3_HELPERAPPSDIR')) {\n\n\t\t\t$helperappsdir = GETID3_INCLUDEPATH.'..'.DIRECTORY_SEPARATOR.'helperapps'; // must not have any space in this path\n\n\t\t\tif (!is_dir($helperappsdir)) {\n\t\t\t\t$this->startup_warning .= '\"'.$helperappsdir.'\" cannot be defined as GETID3_HELPERAPPSDIR because it does not exist'.\"\\n\";\n\t\t\t} elseif (strpos(realpath($helperappsdir), ' ') !== false) {\n\t\t\t\t$DirPieces = explode(DIRECTORY_SEPARATOR, realpath($helperappsdir));\n\t\t\t\t$path_so_far = array();\n\t\t\t\tforeach ($DirPieces as $key => $value) {\n\t\t\t\t\tif (strpos($value, ' ') !== false) {\n\t\t\t\t\t\tif (!empty($path_so_far)) {\n\t\t\t\t\t\t\t$commandline = 'dir /x '.escapeshellarg(implode(DIRECTORY_SEPARATOR, $path_so_far));\n\t\t\t\t\t\t\t$dir_listing = `$commandline`;\n\t\t\t\t\t\t\t$lines = explode(\"\\n\", $dir_listing);\n\t\t\t\t\t\t\tforeach ($lines as $line) {\n\t\t\t\t\t\t\t\t$line = trim($line);\n\t\t\t\t\t\t\t\tif (preg_match('#^([0-9/]{10}) +([0-9:]{4,5}( [AP]M)?) +(<DIR>|[0-9,]+) +([^ ]{0,11}) +(.+)$#', $line, $matches)) {\n\t\t\t\t\t\t\t\t\tlist($dummy, $date, $time, $ampm, $filesize, $shortname, $filename) = $matches;\n\t\t\t\t\t\t\t\t\tif ((strtoupper($filesize) == '<DIR>') && (strtolower($filename) == strtolower($value))) {\n\t\t\t\t\t\t\t\t\t\t$value = $shortname;\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}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->startup_warning .= 'GETID3_HELPERAPPSDIR must not have any spaces in it - use 8dot3 naming convention if neccesary. You can run \"dir /x\" from the commandline to see the correct 8.3-style names.'.\"\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$path_so_far[] = $value;\n\t\t\t\t}\n\t\t\t\t$helperappsdir = implode(DIRECTORY_SEPARATOR, $path_so_far);\n\t\t\t}\n\t\t\tdefine('GETID3_HELPERAPPSDIR', $helperappsdir.DIRECTORY_SEPARATOR);\n\t\t}\n\n\t\tif (!empty($this->startup_error)) {\n\t\t\techo $this->startup_error;\n\t\t\tthrow new getid3_exception($this->startup_error);\n\t\t}\n\t}\n\n\t/**\n\t * @return string\n\t */\n\tpublic function version() {\n\t\treturn self::VERSION;\n\t}\n\n\t/**\n\t * @return int\n\t */\n\tpublic function fread_buffer_size() {\n\t\treturn $this->option_fread_buffer_size;\n\t}\n\n\t/**\n\t * @param array $optArray\n\t *\n\t * @return bool\n\t */\n\tpublic function setOption($optArray) {\n\t\tif (!is_array($optArray) || empty($optArray)) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ($optArray as $opt => $val) {\n\t\t\tif (isset($this->$opt) === false) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$this->$opt = $val;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string   $filename\n\t * @param int      $filesize\n\t * @param resource $fp\n\t *\n\t * @return bool\n\t *\n\t * @throws getid3_exception\n\t */\n\tpublic function openfile($filename, $filesize=null, $fp=null) {\n\t\ttry {\n\t\t\tif (!empty($this->startup_error)) {\n\t\t\t\tthrow new getid3_exception($this->startup_error);\n\t\t\t}\n\t\t\tif (!empty($this->startup_warning)) {\n\t\t\t\tforeach (explode(\"\\n\", $this->startup_warning) as $startup_warning) {\n\t\t\t\t\t$this->warning($startup_warning);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// init result array and set parameters\n\t\t\t$this->filename = $filename;\n\t\t\t$this->info = array();\n\t\t\t$this->info['GETID3_VERSION']   = $this->version();\n\t\t\t$this->info['php_memory_limit'] = (($this->memory_limit > 0) ? $this->memory_limit : false);\n\n\t\t\t// remote files not supported\n\t\t\tif (preg_match('#^(ht|f)tp://#', $filename)) {\n\t\t\t\tthrow new getid3_exception('Remote files are not supported - please copy the file locally first');\n\t\t\t}\n\n\t\t\t$filename = str_replace('/', DIRECTORY_SEPARATOR, $filename);\n\t\t\t//$filename = preg_replace('#(?<!gs:)('.preg_quote(DIRECTORY_SEPARATOR).'{2,})#', DIRECTORY_SEPARATOR, $filename);\n\n\t\t\t// open local file\n\t\t\t//if (is_readable($filename) && is_file($filename) && ($this->fp = fopen($filename, 'rb'))) { // see https://www.getid3.org/phpBB3/viewtopic.php?t=1720\n\t\t\tif (($fp != null) && ((get_resource_type($fp) == 'file') || (get_resource_type($fp) == 'stream'))) {\n\t\t\t\t$this->fp = $fp;\n\t\t\t} elseif ((is_readable($filename) || file_exists($filename)) && is_file($filename) && ($this->fp = fopen($filename, 'rb'))) {\n\t\t\t\t// great\n\t\t\t} else {\n\t\t\t\t$errormessagelist = array();\n\t\t\t\tif (!is_readable($filename)) {\n\t\t\t\t\t$errormessagelist[] = '!is_readable';\n\t\t\t\t}\n\t\t\t\tif (!is_file($filename)) {\n\t\t\t\t\t$errormessagelist[] = '!is_file';\n\t\t\t\t}\n\t\t\t\tif (!file_exists($filename)) {\n\t\t\t\t\t$errormessagelist[] = '!file_exists';\n\t\t\t\t}\n\t\t\t\tif (empty($errormessagelist)) {\n\t\t\t\t\t$errormessagelist[] = 'fopen failed';\n\t\t\t\t}\n\t\t\t\tthrow new getid3_exception('Could not open \"'.$filename.'\" ('.implode('; ', $errormessagelist).')');\n\t\t\t}\n\n\t\t\t$this->info['filesize'] = (!is_null($filesize) ? $filesize : filesize($filename));\n\t\t\t// set redundant parameters - might be needed in some include file\n\t\t\t// filenames / filepaths in getID3 are always expressed with forward slashes (unix-style) for both Windows and other to try and minimize confusion\n\t\t\t$filename = str_replace('\\\\', '/', $filename);\n\t\t\t$this->info['filepath']     = str_replace('\\\\', '/', realpath(dirname($filename)));\n\t\t\t$this->info['filename']     = getid3_lib::mb_basename($filename);\n\t\t\t$this->info['filenamepath'] = $this->info['filepath'].'/'.$this->info['filename'];\n\n\t\t\t// set more parameters\n\t\t\t$this->info['avdataoffset']        = 0;\n\t\t\t$this->info['avdataend']           = $this->info['filesize'];\n\t\t\t$this->info['fileformat']          = '';                // filled in later\n\t\t\t$this->info['audio']['dataformat'] = '';                // filled in later, unset if not used\n\t\t\t$this->info['video']['dataformat'] = '';                // filled in later, unset if not used\n\t\t\t$this->info['tags']                = array();           // filled in later, unset if not used\n\t\t\t$this->info['error']               = array();           // filled in later, unset if not used\n\t\t\t$this->info['warning']             = array();           // filled in later, unset if not used\n\t\t\t$this->info['comments']            = array();           // filled in later, unset if not used\n\t\t\t$this->info['encoding']            = $this->encoding;   // required by id3v2 and iso modules - can be unset at the end if desired\n\n\t\t\t// option_max_2gb_check\n\t\t\tif ($this->option_max_2gb_check) {\n\t\t\t\t// PHP (32-bit all, and 64-bit Windows) doesn't support integers larger than 2^31 (~2GB)\n\t\t\t\t// filesize() simply returns (filesize % (pow(2, 32)), no matter the actual filesize\n\t\t\t\t// ftell() returns 0 if seeking to the end is beyond the range of unsigned integer\n\t\t\t\t$fseek = fseek($this->fp, 0, SEEK_END);\n\t\t\t\tif (($fseek < 0) || (($this->info['filesize'] != 0) && (ftell($this->fp) == 0)) ||\n\t\t\t\t\t($this->info['filesize'] < 0) ||\n\t\t\t\t\t(ftell($this->fp) < 0)) {\n\t\t\t\t\t\t$real_filesize = getid3_lib::getFileSizeSyscall($this->info['filenamepath']);\n\n\t\t\t\t\t\tif ($real_filesize === false) {\n\t\t\t\t\t\t\tunset($this->info['filesize']);\n\t\t\t\t\t\t\tfclose($this->fp);\n\t\t\t\t\t\t\tthrow new getid3_exception('Unable to determine actual filesize. File is most likely larger than '.round(PHP_INT_MAX / 1073741824).'GB and is not supported by PHP.');\n\t\t\t\t\t\t} elseif (getid3_lib::intValueSupported($real_filesize)) {\n\t\t\t\t\t\t\tunset($this->info['filesize']);\n\t\t\t\t\t\t\tfclose($this->fp);\n\t\t\t\t\t\t\tthrow new getid3_exception('PHP seems to think the file is larger than '.round(PHP_INT_MAX / 1073741824).'GB, but filesystem reports it as '.number_format($real_filesize / 1073741824, 3).'GB, please report to info@getid3.org');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->info['filesize'] = $real_filesize;\n\t\t\t\t\t\t$this->warning('File is larger than '.round(PHP_INT_MAX / 1073741824).'GB (filesystem reports it as '.number_format($real_filesize / 1073741824, 3).'GB) and is not properly supported by PHP.');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->error($e->getMessage());\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * analyze file\n\t *\n\t * @param string   $filename\n\t * @param int      $filesize\n\t * @param string   $original_filename\n\t * @param resource $fp\n\t *\n\t * @return array\n\t */\n\tpublic function analyze($filename, $filesize=null, $original_filename='', $fp=null) {\n\t\ttry {\n\t\t\tif (!$this->openfile($filename, $filesize, $fp)) {\n\t\t\t\treturn $this->info;\n\t\t\t}\n\n\t\t\t// Handle tags\n\t\t\tforeach (array('id3v2'=>'id3v2', 'id3v1'=>'id3v1', 'apetag'=>'ape', 'lyrics3'=>'lyrics3') as $tag_name => $tag_key) {\n\t\t\t\t$option_tag = 'option_tag_'.$tag_name;\n\t\t\t\tif ($this->$option_tag) {\n\t\t\t\t\t$this->include_module('tag.'.$tag_name);\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$tag_class = 'getid3_'.$tag_name;\n\t\t\t\t\t\t$tag = new $tag_class($this);\n\t\t\t\t\t\t$tag->Analyze();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (getid3_exception $e) {\n\t\t\t\t\t\tthrow $e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($this->info['id3v2']['tag_offset_start'])) {\n\t\t\t\t$this->info['avdataoffset'] = max($this->info['avdataoffset'], $this->info['id3v2']['tag_offset_end']);\n\t\t\t}\n\t\t\tforeach (array('id3v1'=>'id3v1', 'apetag'=>'ape', 'lyrics3'=>'lyrics3') as $tag_name => $tag_key) {\n\t\t\t\tif (isset($this->info[$tag_key]['tag_offset_start'])) {\n\t\t\t\t\t$this->info['avdataend'] = min($this->info['avdataend'], $this->info[$tag_key]['tag_offset_start']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// ID3v2 detection (NOT parsing), even if ($this->option_tag_id3v2 == false) done to make fileformat easier\n\t\t\tif (!$this->option_tag_id3v2) {\n\t\t\t\tfseek($this->fp, 0);\n\t\t\t\t$header = fread($this->fp, 10);\n\t\t\t\tif ((substr($header, 0, 3) == 'ID3') && (strlen($header) == 10)) {\n\t\t\t\t\t$this->info['id3v2']['header']        = true;\n\t\t\t\t\t$this->info['id3v2']['majorversion']  = ord($header[3]);\n\t\t\t\t\t$this->info['id3v2']['minorversion']  = ord($header[4]);\n\t\t\t\t\t$this->info['avdataoffset']          += getid3_lib::BigEndian2Int(substr($header, 6, 4), 1) + 10; // length of ID3v2 tag in 10-byte header doesn't include 10-byte header length\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// read 32 kb file data\n\t\t\tfseek($this->fp, $this->info['avdataoffset']);\n\t\t\t$formattest = fread($this->fp, 32774);\n\n\t\t\t// determine format\n\t\t\t$determined_format = $this->GetFileFormat($formattest, ($original_filename ? $original_filename : $filename));\n\n\t\t\t// unable to determine file format\n\t\t\tif (!$determined_format) {\n\t\t\t\tfclose($this->fp);\n\t\t\t\treturn $this->error('unable to determine file format');\n\t\t\t}\n\n\t\t\t// check for illegal ID3 tags\n\t\t\tif (isset($determined_format['fail_id3']) && (in_array('id3v1', $this->info['tags']) || in_array('id3v2', $this->info['tags']))) {\n\t\t\t\tif ($determined_format['fail_id3'] === 'ERROR') {\n\t\t\t\t\tfclose($this->fp);\n\t\t\t\t\treturn $this->error('ID3 tags not allowed on this file type.');\n\t\t\t\t} elseif ($determined_format['fail_id3'] === 'WARNING') {\n\t\t\t\t\t$this->warning('ID3 tags not allowed on this file type.');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// check for illegal APE tags\n\t\t\tif (isset($determined_format['fail_ape']) && in_array('ape', $this->info['tags'])) {\n\t\t\t\tif ($determined_format['fail_ape'] === 'ERROR') {\n\t\t\t\t\tfclose($this->fp);\n\t\t\t\t\treturn $this->error('APE tags not allowed on this file type.');\n\t\t\t\t} elseif ($determined_format['fail_ape'] === 'WARNING') {\n\t\t\t\t\t$this->warning('APE tags not allowed on this file type.');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// set mime type\n\t\t\t$this->info['mime_type'] = $determined_format['mime_type'];\n\n\t\t\t// supported format signature pattern detected, but module deleted\n\t\t\tif (!file_exists(GETID3_INCLUDEPATH.$determined_format['include'])) {\n\t\t\t\tfclose($this->fp);\n\t\t\t\treturn $this->error('Format not supported, module \"'.$determined_format['include'].'\" was removed.');\n\t\t\t}\n\n\t\t\t// module requires mb_convert_encoding/iconv support\n\t\t\t// Check encoding/iconv support\n\t\t\tif (!empty($determined_format['iconv_req']) && !function_exists('mb_convert_encoding') && !function_exists('iconv') && !in_array($this->encoding, array('ISO-8859-1', 'UTF-8', 'UTF-16LE', 'UTF-16BE', 'UTF-16'))) {\n\t\t\t\t$errormessage = 'mb_convert_encoding() or iconv() support is required for this module ('.$determined_format['include'].') for encodings other than ISO-8859-1, UTF-8, UTF-16LE, UTF16-BE, UTF-16. ';\n\t\t\t\tif (GETID3_OS_ISWINDOWS) {\n\t\t\t\t\t$errormessage .= 'PHP does not have mb_convert_encoding() or iconv() support. Please enable php_mbstring.dll / php_iconv.dll in php.ini, and copy php_mbstring.dll / iconv.dll from c:/php/dlls to c:/windows/system32';\n\t\t\t\t} else {\n\t\t\t\t\t$errormessage .= 'PHP is not compiled with mb_convert_encoding() or iconv() support. Please recompile with the --enable-mbstring / --with-iconv switch';\n\t\t\t\t}\n\t\t\t\treturn $this->error($errormessage);\n\t\t\t}\n\n\t\t\t// include module\n\t\t\tinclude_once(GETID3_INCLUDEPATH.$determined_format['include']);\n\n\t\t\t// instantiate module class\n\t\t\t$class_name = 'getid3_'.$determined_format['module'];\n\t\t\tif (!class_exists($class_name)) {\n\t\t\t\treturn $this->error('Format not supported, module \"'.$determined_format['include'].'\" is corrupt.');\n\t\t\t}\n\t\t\t$class = new $class_name($this);\n\t\t\t$class->Analyze();\n\t\t\tunset($class);\n\n\t\t\t// close file\n\t\t\tfclose($this->fp);\n\n\t\t\t// process all tags - copy to 'tags' and convert charsets\n\t\t\tif ($this->option_tags_process) {\n\t\t\t\t$this->HandleAllTags();\n\t\t\t}\n\n\t\t\t// perform more calculations\n\t\t\tif ($this->option_extra_info) {\n\t\t\t\t$this->ChannelsBitratePlaytimeCalculations();\n\t\t\t\t$this->CalculateCompressionRatioVideo();\n\t\t\t\t$this->CalculateCompressionRatioAudio();\n\t\t\t\t$this->CalculateReplayGain();\n\t\t\t\t$this->ProcessAudioStreams();\n\t\t\t}\n\n\t\t\t// get the MD5 sum of the audio/video portion of the file - without ID3/APE/Lyrics3/etc header/footer tags\n\t\t\tif ($this->option_md5_data) {\n\t\t\t\t// do not calc md5_data if md5_data_source is present - set by flac only - future MPC/SV8 too\n\t\t\t\tif (!$this->option_md5_data_source || empty($this->info['md5_data_source'])) {\n\t\t\t\t\t$this->getHashdata('md5');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// get the SHA1 sum of the audio/video portion of the file - without ID3/APE/Lyrics3/etc header/footer tags\n\t\t\tif ($this->option_sha1_data) {\n\t\t\t\t$this->getHashdata('sha1');\n\t\t\t}\n\n\t\t\t// remove undesired keys\n\t\t\t$this->CleanUp();\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->error('Caught exception: '.$e->getMessage());\n\t\t}\n\n\t\t// return info array\n\t\treturn $this->info;\n\t}\n\n\n\t/**\n\t * Error handling.\n\t *\n\t * @param string $message\n\t *\n\t * @return array\n\t */\n\tpublic function error($message) {\n\t\t$this->CleanUp();\n\t\tif (!isset($this->info['error'])) {\n\t\t\t$this->info['error'] = array();\n\t\t}\n\t\t$this->info['error'][] = $message;\n\t\treturn $this->info;\n\t}\n\n\n\t/**\n\t * Warning handling.\n\t *\n\t * @param string $message\n\t *\n\t * @return bool\n\t */\n\tpublic function warning($message) {\n\t\t$this->info['warning'][] = $message;\n\t\treturn true;\n\t}\n\n\n\t/**\n\t * @return bool\n\t */\n\tprivate function CleanUp() {\n\n\t\t// remove possible empty keys\n\t\t$AVpossibleEmptyKeys = array('dataformat', 'bits_per_sample', 'encoder_options', 'streams', 'bitrate');\n\t\tforeach ($AVpossibleEmptyKeys as $dummy => $key) {\n\t\t\tif (empty($this->info['audio'][$key]) && isset($this->info['audio'][$key])) {\n\t\t\t\tunset($this->info['audio'][$key]);\n\t\t\t}\n\t\t\tif (empty($this->info['video'][$key]) && isset($this->info['video'][$key])) {\n\t\t\t\tunset($this->info['video'][$key]);\n\t\t\t}\n\t\t}\n\n\t\t// remove empty root keys\n\t\tif (!empty($this->info)) {\n\t\t\tforeach ($this->info as $key => $value) {\n\t\t\t\tif (empty($this->info[$key]) && ($this->info[$key] !== 0) && ($this->info[$key] !== '0')) {\n\t\t\t\t\tunset($this->info[$key]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// remove meaningless entries from unknown-format files\n\t\tif (empty($this->info['fileformat'])) {\n\t\t\tif (isset($this->info['avdataoffset'])) {\n\t\t\t\tunset($this->info['avdataoffset']);\n\t\t\t}\n\t\t\tif (isset($this->info['avdataend'])) {\n\t\t\t\tunset($this->info['avdataend']);\n\t\t\t}\n\t\t}\n\n\t\t// remove possible duplicated identical entries\n\t\tif (!empty($this->info['error'])) {\n\t\t\t$this->info['error'] = array_values(array_unique($this->info['error']));\n\t\t}\n\t\tif (!empty($this->info['warning'])) {\n\t\t\t$this->info['warning'] = array_values(array_unique($this->info['warning']));\n\t\t}\n\n\t\t// remove \"global variable\" type keys\n\t\tunset($this->info['php_memory_limit']);\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Return array containing information about all supported formats.\n\t *\n\t * @return array\n\t */\n\tpublic function GetFileFormatArray() {\n\t\tstatic $format_info = array();\n\t\tif (empty($format_info)) {\n\t\t\t$format_info = array(\n\n\t\t\t\t// Audio formats\n\n\t\t\t\t// AC-3   - audio      - Dolby AC-3 / Dolby Digital\n\t\t\t\t'ac3'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\x0B\\\\x77',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'ac3',\n\t\t\t\t\t\t\t'mime_type' => 'audio/ac3',\n\t\t\t\t\t\t),\n\n\t\t\t\t// AAC  - audio       - Advanced Audio Coding (AAC) - ADIF format\n\t\t\t\t'adif' => array(\n\t\t\t\t\t\t\t'pattern'   => '^ADIF',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'aac',\n\t\t\t\t\t\t\t'mime_type' => 'audio/aac',\n\t\t\t\t\t\t\t'fail_ape'  => 'WARNING',\n\t\t\t\t\t\t),\n\n/*\n\t\t\t\t// AA   - audio       - Audible Audiobook\n\t\t\t\t'aa'   => array(\n\t\t\t\t\t\t\t'pattern'   => '^.{4}\\\\x57\\\\x90\\\\x75\\\\x36',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'aa',\n\t\t\t\t\t\t\t'mime_type' => 'audio/audible',\n\t\t\t\t\t\t),\n*/\n\t\t\t\t// AAC  - audio       - Advanced Audio Coding (AAC) - ADTS format (very similar to MP3)\n\t\t\t\t'adts' => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\xFF[\\\\xF0-\\\\xF1\\\\xF8-\\\\xF9]',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'aac',\n\t\t\t\t\t\t\t'mime_type' => 'audio/aac',\n\t\t\t\t\t\t\t'fail_ape'  => 'WARNING',\n\t\t\t\t\t\t),\n\n\n\t\t\t\t// AU   - audio       - NeXT/Sun AUdio (AU)\n\t\t\t\t'au'   => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\.snd',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'au',\n\t\t\t\t\t\t\t'mime_type' => 'audio/basic',\n\t\t\t\t\t\t),\n\n\t\t\t\t// AMR  - audio       - Adaptive Multi Rate\n\t\t\t\t'amr'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\x23\\\\x21AMR\\\\x0A', // #!AMR[0A]\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'amr',\n\t\t\t\t\t\t\t'mime_type' => 'audio/amr',\n\t\t\t\t\t\t),\n\n\t\t\t\t// AVR  - audio       - Audio Visual Research\n\t\t\t\t'avr'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^2BIT',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'avr',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t),\n\n\t\t\t\t// BONK - audio       - Bonk v0.9+\n\t\t\t\t'bonk' => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\x00(BONK|INFO|META| ID3)',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'bonk',\n\t\t\t\t\t\t\t'mime_type' => 'audio/xmms-bonk',\n\t\t\t\t\t\t),\n\n\t\t\t\t// DSF  - audio       - Direct Stream Digital (DSD) Storage Facility files (DSF) - https://en.wikipedia.org/wiki/Direct_Stream_Digital\n\t\t\t\t'dsf'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^DSD ',  // including trailing space: 44 53 44 20\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'dsf',\n\t\t\t\t\t\t\t'mime_type' => 'audio/dsd',\n\t\t\t\t\t\t),\n\n\t\t\t\t// DSS  - audio       - Digital Speech Standard\n\t\t\t\t'dss'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^[\\\\x02-\\\\x08]ds[s2]',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'dss',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t),\n\n\t\t\t\t// DSDIFF - audio     - Direct Stream Digital Interchange File Format\n\t\t\t\t'dsdiff' => array(\n\t\t\t\t\t\t\t'pattern'   => '^FRM8',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'dsdiff',\n\t\t\t\t\t\t\t'mime_type' => 'audio/dsd',\n\t\t\t\t\t\t),\n\n\t\t\t\t// DTS  - audio       - Dolby Theatre System\n\t\t\t\t'dts'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\x7F\\\\xFE\\\\x80\\\\x01',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'dts',\n\t\t\t\t\t\t\t'mime_type' => 'audio/dts',\n\t\t\t\t\t\t),\n\n\t\t\t\t// FLAC - audio       - Free Lossless Audio Codec\n\t\t\t\t'flac' => array(\n\t\t\t\t\t\t\t'pattern'   => '^fLaC',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'flac',\n\t\t\t\t\t\t\t'mime_type' => 'audio/flac',\n\t\t\t\t\t\t),\n\n\t\t\t\t// LA   - audio       - Lossless Audio (LA)\n\t\t\t\t'la'   => array(\n\t\t\t\t\t\t\t'pattern'   => '^LA0[2-4]',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'la',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t),\n\n\t\t\t\t// LPAC - audio       - Lossless Predictive Audio Compression (LPAC)\n\t\t\t\t'lpac' => array(\n\t\t\t\t\t\t\t'pattern'   => '^LPAC',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'lpac',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t),\n\n\t\t\t\t// MIDI - audio       - MIDI (Musical Instrument Digital Interface)\n\t\t\t\t'midi' => array(\n\t\t\t\t\t\t\t'pattern'   => '^MThd',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'midi',\n\t\t\t\t\t\t\t'mime_type' => 'audio/midi',\n\t\t\t\t\t\t),\n\n\t\t\t\t// MAC  - audio       - Monkey's Audio Compressor\n\t\t\t\t'mac'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^MAC ',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'monkey',\n\t\t\t\t\t\t\t'mime_type' => 'audio/x-monkeys-audio',\n\t\t\t\t\t\t),\n\n// has been known to produce false matches in random files (e.g. JPEGs), leave out until more precise matching available\n//\t\t\t\t// MOD  - audio       - MODule (assorted sub-formats)\n//\t\t\t\t'mod'  => array(\n//\t\t\t\t\t\t\t'pattern'   => '^.{1080}(M\\\\.K\\\\.|M!K!|FLT4|FLT8|[5-9]CHN|[1-3][0-9]CH)',\n//\t\t\t\t\t\t\t'group'     => 'audio',\n//\t\t\t\t\t\t\t'module'    => 'mod',\n//\t\t\t\t\t\t\t'option'    => 'mod',\n//\t\t\t\t\t\t\t'mime_type' => 'audio/mod',\n//\t\t\t\t\t\t),\n\n\t\t\t\t// MOD  - audio       - MODule (Impulse Tracker)\n\t\t\t\t'it'   => array(\n\t\t\t\t\t\t\t'pattern'   => '^IMPM',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'mod',\n\t\t\t\t\t\t\t//'option'    => 'it',\n\t\t\t\t\t\t\t'mime_type' => 'audio/it',\n\t\t\t\t\t\t),\n\n\t\t\t\t// MOD  - audio       - MODule (eXtended Module, various sub-formats)\n\t\t\t\t'xm'   => array(\n\t\t\t\t\t\t\t'pattern'   => '^Extended Module',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'mod',\n\t\t\t\t\t\t\t//'option'    => 'xm',\n\t\t\t\t\t\t\t'mime_type' => 'audio/xm',\n\t\t\t\t\t\t),\n\n\t\t\t\t// MOD  - audio       - MODule (ScreamTracker)\n\t\t\t\t's3m'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^.{44}SCRM',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'mod',\n\t\t\t\t\t\t\t//'option'    => 's3m',\n\t\t\t\t\t\t\t'mime_type' => 'audio/s3m',\n\t\t\t\t\t\t),\n\n\t\t\t\t// MPC  - audio       - Musepack / MPEGplus\n\t\t\t\t'mpc'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^(MPCK|MP\\\\+|[\\\\x00\\\\x01\\\\x10\\\\x11\\\\x40\\\\x41\\\\x50\\\\x51\\\\x80\\\\x81\\\\x90\\\\x91\\\\xC0\\\\xC1\\\\xD0\\\\xD1][\\\\x20-\\\\x37][\\\\x00\\\\x20\\\\x40\\\\x60\\\\x80\\\\xA0\\\\xC0\\\\xE0])',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'mpc',\n\t\t\t\t\t\t\t'mime_type' => 'audio/x-musepack',\n\t\t\t\t\t\t),\n\n\t\t\t\t// MP3  - audio       - MPEG-audio Layer 3 (very similar to AAC-ADTS)\n\t\t\t\t'mp3'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\xFF[\\\\xE2-\\\\xE7\\\\xF2-\\\\xF7\\\\xFA-\\\\xFF][\\\\x00-\\\\x0B\\\\x10-\\\\x1B\\\\x20-\\\\x2B\\\\x30-\\\\x3B\\\\x40-\\\\x4B\\\\x50-\\\\x5B\\\\x60-\\\\x6B\\\\x70-\\\\x7B\\\\x80-\\\\x8B\\\\x90-\\\\x9B\\\\xA0-\\\\xAB\\\\xB0-\\\\xBB\\\\xC0-\\\\xCB\\\\xD0-\\\\xDB\\\\xE0-\\\\xEB\\\\xF0-\\\\xFB]',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'mp3',\n\t\t\t\t\t\t\t'mime_type' => 'audio/mpeg',\n\t\t\t\t\t\t),\n\n\t\t\t\t// OFR  - audio       - OptimFROG\n\t\t\t\t'ofr'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^(\\\\*RIFF|OFR)',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'optimfrog',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t),\n\n\t\t\t\t// RKAU - audio       - RKive AUdio compressor\n\t\t\t\t'rkau' => array(\n\t\t\t\t\t\t\t'pattern'   => '^RKA',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'rkau',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t),\n\n\t\t\t\t// SHN  - audio       - Shorten\n\t\t\t\t'shn'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^ajkg',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'shorten',\n\t\t\t\t\t\t\t'mime_type' => 'audio/xmms-shn',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\t\t\t\t// TAK  - audio       - Tom's lossless Audio Kompressor\n\t\t\t\t'tak'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^tBaK',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'tak',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t),\n\n\t\t\t\t// TTA  - audio       - TTA Lossless Audio Compressor (http://tta.corecodec.org)\n\t\t\t\t'tta'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^TTA',  // could also be '^TTA(\\\\x01|\\\\x02|\\\\x03|2|1)'\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'tta',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t),\n\n\t\t\t\t// VOC  - audio       - Creative Voice (VOC)\n\t\t\t\t'voc'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^Creative Voice File',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'voc',\n\t\t\t\t\t\t\t'mime_type' => 'audio/voc',\n\t\t\t\t\t\t),\n\n\t\t\t\t// VQF  - audio       - transform-domain weighted interleave Vector Quantization Format (VQF)\n\t\t\t\t'vqf'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^TWIN',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'vqf',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t),\n\n\t\t\t\t// WV  - audio        - WavPack (v4.0+)\n\t\t\t\t'wv'   => array(\n\t\t\t\t\t\t\t'pattern'   => '^wvpk',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'wavpack',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t),\n\n\n\t\t\t\t// Audio-Video formats\n\n\t\t\t\t// ASF  - audio/video - Advanced Streaming Format, Windows Media Video, Windows Media Audio\n\t\t\t\t'asf'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\x30\\\\x26\\\\xB2\\\\x75\\\\x8E\\\\x66\\\\xCF\\\\x11\\\\xA6\\\\xD9\\\\x00\\\\xAA\\\\x00\\\\x62\\\\xCE\\\\x6C',\n\t\t\t\t\t\t\t'group'     => 'audio-video',\n\t\t\t\t\t\t\t'module'    => 'asf',\n\t\t\t\t\t\t\t'mime_type' => 'video/x-ms-asf',\n\t\t\t\t\t\t\t'iconv_req' => false,\n\t\t\t\t\t\t),\n\n\t\t\t\t// BINK - audio/video - Bink / Smacker\n\t\t\t\t'bink' => array(\n\t\t\t\t\t\t\t'pattern'   => '^(BIK|SMK)',\n\t\t\t\t\t\t\t'group'     => 'audio-video',\n\t\t\t\t\t\t\t'module'    => 'bink',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t),\n\n\t\t\t\t// FLV  - audio/video - FLash Video\n\t\t\t\t'flv' => array(\n\t\t\t\t\t\t\t'pattern'   => '^FLV[\\\\x01]',\n\t\t\t\t\t\t\t'group'     => 'audio-video',\n\t\t\t\t\t\t\t'module'    => 'flv',\n\t\t\t\t\t\t\t'mime_type' => 'video/x-flv',\n\t\t\t\t\t\t),\n\n\t\t\t\t// IVF - audio/video - IVF\n\t\t\t\t'ivf' => array(\n\t\t\t\t\t\t\t'pattern'   => '^DKIF',\n\t\t\t\t\t\t\t'group'     => 'audio-video',\n\t\t\t\t\t\t\t'module'    => 'ivf',\n\t\t\t\t\t\t\t'mime_type' => 'video/x-ivf',\n\t\t\t\t\t\t),\n\n\t\t\t\t// MKAV - audio/video - Mastroka\n\t\t\t\t'matroska' => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\x1A\\\\x45\\\\xDF\\\\xA3',\n\t\t\t\t\t\t\t'group'     => 'audio-video',\n\t\t\t\t\t\t\t'module'    => 'matroska',\n\t\t\t\t\t\t\t'mime_type' => 'video/x-matroska', // may also be audio/x-matroska\n\t\t\t\t\t\t),\n\n\t\t\t\t// MPEG - audio/video - MPEG (Moving Pictures Experts Group)\n\t\t\t\t'mpeg' => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\x00\\\\x00\\\\x01[\\\\xB3\\\\xBA]',\n\t\t\t\t\t\t\t'group'     => 'audio-video',\n\t\t\t\t\t\t\t'module'    => 'mpeg',\n\t\t\t\t\t\t\t'mime_type' => 'video/mpeg',\n\t\t\t\t\t\t),\n\n\t\t\t\t// NSV  - audio/video - Nullsoft Streaming Video (NSV)\n\t\t\t\t'nsv'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^NSV[sf]',\n\t\t\t\t\t\t\t'group'     => 'audio-video',\n\t\t\t\t\t\t\t'module'    => 'nsv',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t),\n\n\t\t\t\t// Ogg  - audio/video - Ogg (Ogg-Vorbis, Ogg-FLAC, Speex, Ogg-Theora(*), Ogg-Tarkin(*))\n\t\t\t\t'ogg'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^OggS',\n\t\t\t\t\t\t\t'group'     => 'audio',\n\t\t\t\t\t\t\t'module'    => 'ogg',\n\t\t\t\t\t\t\t'mime_type' => 'application/ogg',\n\t\t\t\t\t\t\t'fail_id3'  => 'WARNING',\n\t\t\t\t\t\t\t'fail_ape'  => 'WARNING',\n\t\t\t\t\t\t),\n\n\t\t\t\t// QT   - audio/video - Quicktime\n\t\t\t\t'quicktime' => array(\n\t\t\t\t\t\t\t'pattern'   => '^.{4}(cmov|free|ftyp|mdat|moov|pnot|skip|wide)',\n\t\t\t\t\t\t\t'group'     => 'audio-video',\n\t\t\t\t\t\t\t'module'    => 'quicktime',\n\t\t\t\t\t\t\t'mime_type' => 'video/quicktime',\n\t\t\t\t\t\t),\n\n\t\t\t\t// RIFF - audio/video - Resource Interchange File Format (RIFF) / WAV / AVI / CD-audio / SDSS = renamed variant used by SmartSound QuickTracks (www.smartsound.com) / FORM = Audio Interchange File Format (AIFF)\n\t\t\t\t'riff' => array(\n\t\t\t\t\t\t\t'pattern'   => '^(RIFF|SDSS|FORM)',\n\t\t\t\t\t\t\t'group'     => 'audio-video',\n\t\t\t\t\t\t\t'module'    => 'riff',\n\t\t\t\t\t\t\t'mime_type' => 'audio/wav',\n\t\t\t\t\t\t\t'fail_ape'  => 'WARNING',\n\t\t\t\t\t\t),\n\n\t\t\t\t// Real - audio/video - RealAudio, RealVideo\n\t\t\t\t'real' => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\.(RMF|ra)',\n\t\t\t\t\t\t\t'group'     => 'audio-video',\n\t\t\t\t\t\t\t'module'    => 'real',\n\t\t\t\t\t\t\t'mime_type' => 'audio/x-realaudio',\n\t\t\t\t\t\t),\n\n\t\t\t\t// SWF - audio/video - ShockWave Flash\n\t\t\t\t'swf' => array(\n\t\t\t\t\t\t\t'pattern'   => '^(F|C)WS',\n\t\t\t\t\t\t\t'group'     => 'audio-video',\n\t\t\t\t\t\t\t'module'    => 'swf',\n\t\t\t\t\t\t\t'mime_type' => 'application/x-shockwave-flash',\n\t\t\t\t\t\t),\n\n\t\t\t\t// TS - audio/video - MPEG-2 Transport Stream\n\t\t\t\t'ts' => array(\n\t\t\t\t\t\t\t'pattern'   => '^(\\\\x47.{187}){10,}', // packets are 188 bytes long and start with 0x47 \"G\".  Check for at least 10 packets matching this pattern\n\t\t\t\t\t\t\t'group'     => 'audio-video',\n\t\t\t\t\t\t\t'module'    => 'ts',\n\t\t\t\t\t\t\t'mime_type' => 'video/MP2T',\n\t\t\t\t\t\t),\n\n\t\t\t\t// WTV - audio/video - Windows Recorded TV Show\n\t\t\t\t'wtv' => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\xB7\\\\xD8\\\\x00\\\\x20\\\\x37\\\\x49\\\\xDA\\\\x11\\\\xA6\\\\x4E\\\\x00\\\\x07\\\\xE9\\\\x5E\\\\xAD\\\\x8D',\n\t\t\t\t\t\t\t'group'     => 'audio-video',\n\t\t\t\t\t\t\t'module'    => 'wtv',\n\t\t\t\t\t\t\t'mime_type' => 'video/x-ms-wtv',\n\t\t\t\t\t\t),\n\n\n\t\t\t\t// Still-Image formats\n\n\t\t\t\t// BMP  - still image - Bitmap (Windows, OS/2; uncompressed, RLE8, RLE4)\n\t\t\t\t'bmp'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^BM',\n\t\t\t\t\t\t\t'group'     => 'graphic',\n\t\t\t\t\t\t\t'module'    => 'bmp',\n\t\t\t\t\t\t\t'mime_type' => 'image/bmp',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\t\t\t\t// GIF  - still image - Graphics Interchange Format\n\t\t\t\t'gif'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^GIF',\n\t\t\t\t\t\t\t'group'     => 'graphic',\n\t\t\t\t\t\t\t'module'    => 'gif',\n\t\t\t\t\t\t\t'mime_type' => 'image/gif',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\t\t\t\t// JPEG - still image - Joint Photographic Experts Group (JPEG)\n\t\t\t\t'jpg'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\xFF\\\\xD8\\\\xFF',\n\t\t\t\t\t\t\t'group'     => 'graphic',\n\t\t\t\t\t\t\t'module'    => 'jpg',\n\t\t\t\t\t\t\t'mime_type' => 'image/jpeg',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\t\t\t\t// PCD  - still image - Kodak Photo CD\n\t\t\t\t'pcd'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^.{2048}PCD_IPI\\\\x00',\n\t\t\t\t\t\t\t'group'     => 'graphic',\n\t\t\t\t\t\t\t'module'    => 'pcd',\n\t\t\t\t\t\t\t'mime_type' => 'image/x-photo-cd',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\n\t\t\t\t// PNG  - still image - Portable Network Graphics (PNG)\n\t\t\t\t'png'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\x89\\\\x50\\\\x4E\\\\x47\\\\x0D\\\\x0A\\\\x1A\\\\x0A',\n\t\t\t\t\t\t\t'group'     => 'graphic',\n\t\t\t\t\t\t\t'module'    => 'png',\n\t\t\t\t\t\t\t'mime_type' => 'image/png',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\n\t\t\t\t// SVG  - still image - Scalable Vector Graphics (SVG)\n\t\t\t\t'svg'  => array(\n\t\t\t\t\t\t\t'pattern'   => '(<!DOCTYPE svg PUBLIC |xmlns=\"http://www\\\\.w3\\\\.org/2000/svg\")',\n\t\t\t\t\t\t\t'group'     => 'graphic',\n\t\t\t\t\t\t\t'module'    => 'svg',\n\t\t\t\t\t\t\t'mime_type' => 'image/svg+xml',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\n\t\t\t\t// TIFF - still image - Tagged Information File Format (TIFF)\n\t\t\t\t'tiff' => array(\n\t\t\t\t\t\t\t'pattern'   => '^(II\\\\x2A\\\\x00|MM\\\\x00\\\\x2A)',\n\t\t\t\t\t\t\t'group'     => 'graphic',\n\t\t\t\t\t\t\t'module'    => 'tiff',\n\t\t\t\t\t\t\t'mime_type' => 'image/tiff',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\n\t\t\t\t// EFAX - still image - eFax (TIFF derivative)\n\t\t\t\t'efax'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\xDC\\\\xFE',\n\t\t\t\t\t\t\t'group'     => 'graphic',\n\t\t\t\t\t\t\t'module'    => 'efax',\n\t\t\t\t\t\t\t'mime_type' => 'image/efax',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\n\t\t\t\t// Data formats\n\n\t\t\t\t// ISO  - data        - International Standards Organization (ISO) CD-ROM Image\n\t\t\t\t'iso'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^.{32769}CD001',\n\t\t\t\t\t\t\t'group'     => 'misc',\n\t\t\t\t\t\t\t'module'    => 'iso',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t\t'iconv_req' => false,\n\t\t\t\t\t\t),\n\n\t\t\t\t// HPK  - data        - HPK compressed data\n\t\t\t\t'hpk'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^BPUL',\n\t\t\t\t\t\t\t'group'     => 'archive',\n\t\t\t\t\t\t\t'module'    => 'hpk',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\t\t\t\t// RAR  - data        - RAR compressed data\n\t\t\t\t'rar'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^Rar\\\\!',\n\t\t\t\t\t\t\t'group'     => 'archive',\n\t\t\t\t\t\t\t'module'    => 'rar',\n\t\t\t\t\t\t\t'mime_type' => 'application/vnd.rar',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\t\t\t\t// SZIP - audio/data  - SZIP compressed data\n\t\t\t\t'szip' => array(\n\t\t\t\t\t\t\t'pattern'   => '^SZ\\\\x0A\\\\x04',\n\t\t\t\t\t\t\t'group'     => 'archive',\n\t\t\t\t\t\t\t'module'    => 'szip',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\t\t\t\t// TAR  - data        - TAR compressed data\n\t\t\t\t'tar'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^.{100}[0-9\\\\x20]{7}\\\\x00[0-9\\\\x20]{7}\\\\x00[0-9\\\\x20]{7}\\\\x00[0-9\\\\x20\\\\x00]{12}[0-9\\\\x20\\\\x00]{12}',\n\t\t\t\t\t\t\t'group'     => 'archive',\n\t\t\t\t\t\t\t'module'    => 'tar',\n\t\t\t\t\t\t\t'mime_type' => 'application/x-tar',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\t\t\t\t// GZIP  - data        - GZIP compressed data\n\t\t\t\t'gz'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\x1F\\\\x8B\\\\x08',\n\t\t\t\t\t\t\t'group'     => 'archive',\n\t\t\t\t\t\t\t'module'    => 'gzip',\n\t\t\t\t\t\t\t'mime_type' => 'application/gzip',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\t\t\t\t// ZIP  - data         - ZIP compressed data\n\t\t\t\t'zip'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^PK\\\\x03\\\\x04',\n\t\t\t\t\t\t\t'group'     => 'archive',\n\t\t\t\t\t\t\t'module'    => 'zip',\n\t\t\t\t\t\t\t'mime_type' => 'application/zip',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\t\t\t\t// XZ   - data         - XZ compressed data\n\t\t\t\t'xz'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\xFD7zXZ\\\\x00',\n\t\t\t\t\t\t\t'group'     => 'archive',\n\t\t\t\t\t\t\t'module'    => 'xz',\n\t\t\t\t\t\t\t'mime_type' => 'application/x-xz',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\n\t\t\t\t// Misc other formats\n\n\t\t\t\t// PAR2 - data        - Parity Volume Set Specification 2.0\n\t\t\t\t'par2' => array (\n\t\t\t\t\t\t\t'pattern'   => '^PAR2\\\\x00PKT',\n\t\t\t\t\t\t\t'group'     => 'misc',\n\t\t\t\t\t\t\t'module'    => 'par2',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\t\t\t\t// PDF  - data        - Portable Document Format\n\t\t\t\t'pdf'  => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\x25PDF',\n\t\t\t\t\t\t\t'group'     => 'misc',\n\t\t\t\t\t\t\t'module'    => 'pdf',\n\t\t\t\t\t\t\t'mime_type' => 'application/pdf',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\t\t\t\t// MSOFFICE  - data   - ZIP compressed data\n\t\t\t\t'msoffice' => array(\n\t\t\t\t\t\t\t'pattern'   => '^\\\\xD0\\\\xCF\\\\x11\\\\xE0\\\\xA1\\\\xB1\\\\x1A\\\\xE1', // D0CF11E == DOCFILE == Microsoft Office Document\n\t\t\t\t\t\t\t'group'     => 'misc',\n\t\t\t\t\t\t\t'module'    => 'msoffice',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t\t'fail_id3'  => 'ERROR',\n\t\t\t\t\t\t\t'fail_ape'  => 'ERROR',\n\t\t\t\t\t\t),\n\n\t\t\t\t // CUE  - data       - CUEsheet (index to single-file disc images)\n\t\t\t\t 'cue' => array(\n\t\t\t\t\t\t\t'pattern'   => '', // empty pattern means cannot be automatically detected, will fall through all other formats and match based on filename and very basic file contents\n\t\t\t\t\t\t\t'group'     => 'misc',\n\t\t\t\t\t\t\t'module'    => 'cue',\n\t\t\t\t\t\t\t'mime_type' => 'application/octet-stream',\n\t\t\t\t\t\t   ),\n\n\t\t\t);\n\t\t}\n\n\t\treturn $format_info;\n\t}\n\n\t/**\n\t * @param string $filedata\n\t * @param string $filename\n\t *\n\t * @return mixed|false\n\t */\n\tpublic function GetFileFormat(&$filedata, $filename='') {\n\t\t// this function will determine the format of a file based on usually\n\t\t// the first 2-4 bytes of the file (8 bytes for PNG, 16 bytes for JPG,\n\t\t// and in the case of ISO CD image, 6 bytes offset 32kb from the start\n\t\t// of the file).\n\n\t\t// Identify file format - loop through $format_info and detect with reg expr\n\t\tforeach ($this->GetFileFormatArray() as $format_name => $info) {\n\t\t\t// The /s switch on preg_match() forces preg_match() NOT to treat\n\t\t\t// newline (0x0A) characters as special chars but do a binary match\n\t\t\tif (!empty($info['pattern']) && preg_match('#'.$info['pattern'].'#s', $filedata)) {\n\t\t\t\t$info['include'] = 'module.'.$info['group'].'.'.$info['module'].'.php';\n\t\t\t\treturn $info;\n\t\t\t}\n\t\t}\n\n\n\t\tif (preg_match('#\\\\.mp[123a]$#i', $filename)) {\n\t\t\t// Too many mp3 encoders on the market put garbage in front of mpeg files\n\t\t\t// use assume format on these if format detection failed\n\t\t\t$GetFileFormatArray = $this->GetFileFormatArray();\n\t\t\t$info = $GetFileFormatArray['mp3'];\n\t\t\t$info['include'] = 'module.'.$info['group'].'.'.$info['module'].'.php';\n\t\t\treturn $info;\n\t\t} elseif (preg_match('#\\\\.cue$#i', $filename) && preg_match('#FILE \"[^\"]+\" (BINARY|MOTOROLA|AIFF|WAVE|MP3)#', $filedata)) {\n\t\t\t// there's not really a useful consistent \"magic\" at the beginning of .cue files to identify them\n\t\t\t// so until I think of something better, just go by filename if all other format checks fail\n\t\t\t// and verify there's at least one instance of \"TRACK xx AUDIO\" in the file\n\t\t\t$GetFileFormatArray = $this->GetFileFormatArray();\n\t\t\t$info = $GetFileFormatArray['cue'];\n\t\t\t$info['include']   = 'module.'.$info['group'].'.'.$info['module'].'.php';\n\t\t\treturn $info;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Converts array to $encoding charset from $this->encoding.\n\t *\n\t * @param array  $array\n\t * @param string $encoding\n\t */\n\tpublic function CharConvert(&$array, $encoding) {\n\n\t\t// identical encoding - end here\n\t\tif ($encoding == $this->encoding) {\n\t\t\treturn;\n\t\t}\n\n\t\t// loop thru array\n\t\tforeach ($array as $key => $value) {\n\n\t\t\t// go recursive\n\t\t\tif (is_array($value)) {\n\t\t\t\t$this->CharConvert($array[$key], $encoding);\n\t\t\t}\n\n\t\t\t// convert string\n\t\t\telseif (is_string($value)) {\n\t\t\t\t$array[$key] = trim(getid3_lib::iconv_fallback($encoding, $this->encoding, $value));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function HandleAllTags() {\n\n\t\t// key name => array (tag name, character encoding)\n\t\tstatic $tags;\n\t\tif (empty($tags)) {\n\t\t\t$tags = array(\n\t\t\t\t'asf'       => array('asf'           , 'UTF-16LE'),\n\t\t\t\t'midi'      => array('midi'          , 'ISO-8859-1'),\n\t\t\t\t'nsv'       => array('nsv'           , 'ISO-8859-1'),\n\t\t\t\t'ogg'       => array('vorbiscomment' , 'UTF-8'),\n\t\t\t\t'png'       => array('png'           , 'UTF-8'),\n\t\t\t\t'tiff'      => array('tiff'          , 'ISO-8859-1'),\n\t\t\t\t'quicktime' => array('quicktime'     , 'UTF-8'),\n\t\t\t\t'real'      => array('real'          , 'ISO-8859-1'),\n\t\t\t\t'vqf'       => array('vqf'           , 'ISO-8859-1'),\n\t\t\t\t'zip'       => array('zip'           , 'ISO-8859-1'),\n\t\t\t\t'riff'      => array('riff'          , 'ISO-8859-1'),\n\t\t\t\t'lyrics3'   => array('lyrics3'       , 'ISO-8859-1'),\n\t\t\t\t'id3v1'     => array('id3v1'         , $this->encoding_id3v1),\n\t\t\t\t'id3v2'     => array('id3v2'         , 'UTF-8'), // not according to the specs (every frame can have a different encoding), but getID3() force-converts all encodings to UTF-8\n\t\t\t\t'ape'       => array('ape'           , 'UTF-8'),\n\t\t\t\t'cue'       => array('cue'           , 'ISO-8859-1'),\n\t\t\t\t'matroska'  => array('matroska'      , 'UTF-8'),\n\t\t\t\t'flac'      => array('vorbiscomment' , 'UTF-8'),\n\t\t\t\t'divxtag'   => array('divx'          , 'ISO-8859-1'),\n\t\t\t\t'iptc'      => array('iptc'          , 'ISO-8859-1'),\n\t\t\t\t'dsdiff'    => array('dsdiff'        , 'ISO-8859-1'),\n\t\t\t);\n\t\t}\n\n\t\t// loop through comments array\n\t\tforeach ($tags as $comment_name => $tagname_encoding_array) {\n\t\t\tlist($tag_name, $encoding) = $tagname_encoding_array;\n\n\t\t\t// fill in default encoding type if not already present\n\t\t\tif (isset($this->info[$comment_name]) && !isset($this->info[$comment_name]['encoding'])) {\n\t\t\t\t$this->info[$comment_name]['encoding'] = $encoding;\n\t\t\t}\n\n\t\t\t// copy comments if key name set\n\t\t\tif (!empty($this->info[$comment_name]['comments'])) {\n\t\t\t\tforeach ($this->info[$comment_name]['comments'] as $tag_key => $valuearray) {\n\t\t\t\t\tforeach ($valuearray as $key => $value) {\n\t\t\t\t\t\tif (is_string($value)) {\n\t\t\t\t\t\t\t$value = trim($value, \" \\r\\n\\t\"); // do not trim nulls from $value!! Unicode characters will get mangled if trailing nulls are removed!\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($value) {\n\t\t\t\t\t\t\tif (!is_numeric($key)) {\n\t\t\t\t\t\t\t\t$this->info['tags'][trim($tag_name)][trim($tag_key)][$key] = $value;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->info['tags'][trim($tag_name)][trim($tag_key)][]     = $value;\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\tif ($tag_key == 'picture') {\n\t\t\t\t\t\t// pictures can take up a lot of space, and we don't need multiple copies of them; let there be a single copy in [comments][picture], and not elsewhere\n\t\t\t\t\t\tunset($this->info[$comment_name]['comments'][$tag_key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!isset($this->info['tags'][$tag_name])) {\n\t\t\t\t\t// comments are set but contain nothing but empty strings, so skip\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$this->CharConvert($this->info['tags'][$tag_name], $this->info[$comment_name]['encoding']);           // only copy gets converted!\n\n\t\t\t\tif ($this->option_tags_html) {\n\t\t\t\t\tforeach ($this->info['tags'][$tag_name] as $tag_key => $valuearray) {\n\t\t\t\t\t\tif ($tag_key == 'picture') {\n\t\t\t\t\t\t\t// Do not to try to convert binary picture data to HTML\n\t\t\t\t\t\t\t// https://github.com/JamesHeinrich/getID3/issues/178\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->info['tags_html'][$tag_name][$tag_key] = getid3_lib::recursiveMultiByteCharString2HTML($valuearray, $this->info[$comment_name]['encoding']);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// pictures can take up a lot of space, and we don't need multiple copies of them; let there be a single copy in [comments][picture], and not elsewhere\n\t\tif (!empty($this->info['tags'])) {\n\t\t\t$unset_keys = array('tags', 'tags_html');\n\t\t\tforeach ($this->info['tags'] as $tagtype => $tagarray) {\n\t\t\t\tforeach ($tagarray as $tagname => $tagdata) {\n\t\t\t\t\tif ($tagname == 'picture') {\n\t\t\t\t\t\tforeach ($tagdata as $key => $tagarray) {\n\t\t\t\t\t\t\t$this->info['comments']['picture'][] = $tagarray;\n\t\t\t\t\t\t\tif (isset($tagarray['data']) && isset($tagarray['image_mime'])) {\n\t\t\t\t\t\t\t\tif (isset($this->info['tags'][$tagtype][$tagname][$key])) {\n\t\t\t\t\t\t\t\t\tunset($this->info['tags'][$tagtype][$tagname][$key]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (isset($this->info['tags_html'][$tagtype][$tagname][$key])) {\n\t\t\t\t\t\t\t\t\tunset($this->info['tags_html'][$tagtype][$tagname][$key]);\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\t\t\t\tforeach ($unset_keys as $unset_key) {\n\t\t\t\t\t// remove possible empty keys from (e.g. [tags][id3v2][picture])\n\t\t\t\t\tif (empty($this->info[$unset_key][$tagtype]['picture'])) {\n\t\t\t\t\t\tunset($this->info[$unset_key][$tagtype]['picture']);\n\t\t\t\t\t}\n\t\t\t\t\tif (empty($this->info[$unset_key][$tagtype])) {\n\t\t\t\t\t\tunset($this->info[$unset_key][$tagtype]);\n\t\t\t\t\t}\n\t\t\t\t\tif (empty($this->info[$unset_key])) {\n\t\t\t\t\t\tunset($this->info[$unset_key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// remove duplicate copy of picture data from (e.g. [id3v2][comments][picture])\n\t\t\t\tif (isset($this->info[$tagtype]['comments']['picture'])) {\n\t\t\t\t\tunset($this->info[$tagtype]['comments']['picture']);\n\t\t\t\t}\n\t\t\t\tif (empty($this->info[$tagtype]['comments'])) {\n\t\t\t\t\tunset($this->info[$tagtype]['comments']);\n\t\t\t\t}\n\t\t\t\tif (empty($this->info[$tagtype])) {\n\t\t\t\t\tunset($this->info[$tagtype]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Calls getid3_lib::CopyTagsToComments() but passes in the option_tags_html setting from this instance of getID3\n\t *\n\t * @param array $ThisFileInfo\n\t *\n\t * @return bool\n\t */\n\tpublic function CopyTagsToComments(&$ThisFileInfo) {\n\t    return getid3_lib::CopyTagsToComments($ThisFileInfo, $this->option_tags_html);\n\t}\n\n\t/**\n\t * @param string $algorithm\n\t *\n\t * @return array|bool\n\t */\n\tpublic function getHashdata($algorithm) {\n\t\tswitch ($algorithm) {\n\t\t\tcase 'md5':\n\t\t\tcase 'sha1':\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\treturn $this->error('bad algorithm \"'.$algorithm.'\" in getHashdata()');\n\t\t}\n\n\t\tif (!empty($this->info['fileformat']) && !empty($this->info['dataformat']) && ($this->info['fileformat'] == 'ogg') && ($this->info['audio']['dataformat'] == 'vorbis')) {\n\n\t\t\t// We cannot get an identical md5_data value for Ogg files where the comments\n\t\t\t// span more than 1 Ogg page (compared to the same audio data with smaller\n\t\t\t// comments) using the normal getID3() method of MD5'ing the data between the\n\t\t\t// end of the comments and the end of the file (minus any trailing tags),\n\t\t\t// because the page sequence numbers of the pages that the audio data is on\n\t\t\t// do not match. Under normal circumstances, where comments are smaller than\n\t\t\t// the nominal 4-8kB page size, then this is not a problem, but if there are\n\t\t\t// very large comments, the only way around it is to strip off the comment\n\t\t\t// tags with vorbiscomment and MD5 that file.\n\t\t\t// This procedure must be applied to ALL Ogg files, not just the ones with\n\t\t\t// comments larger than 1 page, because the below method simply MD5's the\n\t\t\t// whole file with the comments stripped, not just the portion after the\n\t\t\t// comments block (which is the standard getID3() method.\n\n\t\t\t// The above-mentioned problem of comments spanning multiple pages and changing\n\t\t\t// page sequence numbers likely happens for OggSpeex and OggFLAC as well, but\n\t\t\t// currently vorbiscomment only works on OggVorbis files.\n\n\t\t\t// phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved\n\t\t\tif (preg_match('#(1|ON)#i', ini_get('safe_mode'))) {\n\n\t\t\t\t$this->warning('Failed making system call to vorbiscomment.exe - '.$algorithm.'_data is incorrect - error returned: PHP running in Safe Mode (backtick operator not available)');\n\t\t\t\t$this->info[$algorithm.'_data'] = false;\n\n\t\t\t} else {\n\n\t\t\t\t// Prevent user from aborting script\n\t\t\t\t$old_abort = ignore_user_abort(true);\n\n\t\t\t\t// Create empty file\n\t\t\t\t$empty = tempnam(GETID3_TEMP_DIR, 'getID3');\n\t\t\t\ttouch($empty);\n\n\t\t\t\t// Use vorbiscomment to make temp file without comments\n\t\t\t\t$temp = tempnam(GETID3_TEMP_DIR, 'getID3');\n\t\t\t\t$file = $this->info['filenamepath'];\n\n\t\t\t\tif (GETID3_OS_ISWINDOWS) {\n\n\t\t\t\t\tif (file_exists(GETID3_HELPERAPPSDIR.'vorbiscomment.exe')) {\n\n\t\t\t\t\t\t$commandline = '\"'.GETID3_HELPERAPPSDIR.'vorbiscomment.exe\" -w -c \"'.$empty.'\" \"'.$file.'\" \"'.$temp.'\"';\n\t\t\t\t\t\t$VorbisCommentError = `$commandline`;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t$VorbisCommentError = 'vorbiscomment.exe not found in '.GETID3_HELPERAPPSDIR;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$commandline = 'vorbiscomment -w -c '.escapeshellarg($empty).' '.escapeshellarg($file).' '.escapeshellarg($temp).' 2>&1';\n\t\t\t\t\t$VorbisCommentError = `$commandline`;\n\n\t\t\t\t}\n\n\t\t\t\tif (!empty($VorbisCommentError)) {\n\n\t\t\t\t\t$this->warning('Failed making system call to vorbiscomment(.exe) - '.$algorithm.'_data will be incorrect. If vorbiscomment is unavailable, please download from http://www.vorbis.com/download.psp and put in the getID3() directory. Error returned: '.$VorbisCommentError);\n\t\t\t\t\t$this->info[$algorithm.'_data'] = false;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Get hash of newly created file\n\t\t\t\t\tswitch ($algorithm) {\n\t\t\t\t\t\tcase 'md5':\n\t\t\t\t\t\t\t$this->info[$algorithm.'_data'] = md5_file($temp);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'sha1':\n\t\t\t\t\t\t\t$this->info[$algorithm.'_data'] = sha1_file($temp);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Clean up\n\t\t\t\tunlink($empty);\n\t\t\t\tunlink($temp);\n\n\t\t\t\t// Reset abort setting\n\t\t\t\tignore_user_abort($old_abort);\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif (!empty($this->info['avdataoffset']) || (isset($this->info['avdataend']) && ($this->info['avdataend'] < $this->info['filesize']))) {\n\n\t\t\t\t// get hash from part of file\n\t\t\t\t$this->info[$algorithm.'_data'] = getid3_lib::hash_data($this->info['filenamepath'], $this->info['avdataoffset'], $this->info['avdataend'], $algorithm);\n\n\t\t\t} else {\n\n\t\t\t\t// get hash from whole file\n\t\t\t\tswitch ($algorithm) {\n\t\t\t\t\tcase 'md5':\n\t\t\t\t\t\t$this->info[$algorithm.'_data'] = md5_file($this->info['filenamepath']);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'sha1':\n\t\t\t\t\t\t$this->info[$algorithm.'_data'] = sha1_file($this->info['filenamepath']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic function ChannelsBitratePlaytimeCalculations() {\n\n\t\t// set channelmode on audio\n\t\tif (!empty($this->info['audio']['channelmode']) || !isset($this->info['audio']['channels'])) {\n\t\t\t// ignore\n\t\t} elseif ($this->info['audio']['channels'] == 1) {\n\t\t\t$this->info['audio']['channelmode'] = 'mono';\n\t\t} elseif ($this->info['audio']['channels'] == 2) {\n\t\t\t$this->info['audio']['channelmode'] = 'stereo';\n\t\t}\n\n\t\t// Calculate combined bitrate - audio + video\n\t\t$CombinedBitrate  = 0;\n\t\t$CombinedBitrate += (isset($this->info['audio']['bitrate']) ? $this->info['audio']['bitrate'] : 0);\n\t\t$CombinedBitrate += (isset($this->info['video']['bitrate']) ? $this->info['video']['bitrate'] : 0);\n\t\tif (($CombinedBitrate > 0) && empty($this->info['bitrate'])) {\n\t\t\t$this->info['bitrate'] = $CombinedBitrate;\n\t\t}\n\t\t//if ((isset($this->info['video']) && !isset($this->info['video']['bitrate'])) || (isset($this->info['audio']) && !isset($this->info['audio']['bitrate']))) {\n\t\t//\t// for example, VBR MPEG video files cannot determine video bitrate:\n\t\t//\t// should not set overall bitrate and playtime from audio bitrate only\n\t\t//\tunset($this->info['bitrate']);\n\t\t//}\n\n\t\t// video bitrate undetermined, but calculable\n\t\tif (isset($this->info['video']['dataformat']) && $this->info['video']['dataformat'] && (!isset($this->info['video']['bitrate']) || ($this->info['video']['bitrate'] == 0))) {\n\t\t\t// if video bitrate not set\n\t\t\tif (isset($this->info['audio']['bitrate']) && ($this->info['audio']['bitrate'] > 0) && ($this->info['audio']['bitrate'] == $this->info['bitrate'])) {\n\t\t\t\t// AND if audio bitrate is set to same as overall bitrate\n\t\t\t\tif (isset($this->info['playtime_seconds']) && ($this->info['playtime_seconds'] > 0)) {\n\t\t\t\t\t// AND if playtime is set\n\t\t\t\t\tif (isset($this->info['avdataend']) && isset($this->info['avdataoffset'])) {\n\t\t\t\t\t\t// AND if AV data offset start/end is known\n\t\t\t\t\t\t// THEN we can calculate the video bitrate\n\t\t\t\t\t\t$this->info['bitrate'] = round((($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $this->info['playtime_seconds']);\n\t\t\t\t\t\t$this->info['video']['bitrate'] = $this->info['bitrate'] - $this->info['audio']['bitrate'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ((!isset($this->info['playtime_seconds']) || ($this->info['playtime_seconds'] <= 0)) && !empty($this->info['bitrate'])) {\n\t\t\t$this->info['playtime_seconds'] = (($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $this->info['bitrate'];\n\t\t}\n\n\t\tif (!isset($this->info['bitrate']) && !empty($this->info['playtime_seconds'])) {\n\t\t\t$this->info['bitrate'] = (($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $this->info['playtime_seconds'];\n\t\t}\n\t\tif (isset($this->info['bitrate']) && empty($this->info['audio']['bitrate']) && empty($this->info['video']['bitrate'])) {\n\t\t\tif (isset($this->info['audio']['dataformat']) && empty($this->info['video']['resolution_x'])) {\n\t\t\t\t// audio only\n\t\t\t\t$this->info['audio']['bitrate'] = $this->info['bitrate'];\n\t\t\t} elseif (isset($this->info['video']['resolution_x']) && empty($this->info['audio']['dataformat'])) {\n\t\t\t\t// video only\n\t\t\t\t$this->info['video']['bitrate'] = $this->info['bitrate'];\n\t\t\t}\n\t\t}\n\n\t\t// Set playtime string\n\t\tif (!empty($this->info['playtime_seconds']) && empty($this->info['playtime_string'])) {\n\t\t\t$this->info['playtime_string'] = getid3_lib::PlaytimeString($this->info['playtime_seconds']);\n\t\t}\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function CalculateCompressionRatioVideo() {\n\t\tif (empty($this->info['video'])) {\n\t\t\treturn false;\n\t\t}\n\t\tif (empty($this->info['video']['resolution_x']) || empty($this->info['video']['resolution_y'])) {\n\t\t\treturn false;\n\t\t}\n\t\tif (empty($this->info['video']['bits_per_sample'])) {\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch ($this->info['video']['dataformat']) {\n\t\t\tcase 'bmp':\n\t\t\tcase 'gif':\n\t\t\tcase 'jpeg':\n\t\t\tcase 'jpg':\n\t\t\tcase 'png':\n\t\t\tcase 'tiff':\n\t\t\t\t$FrameRate = 1;\n\t\t\t\t$PlaytimeSeconds = 1;\n\t\t\t\t$BitrateCompressed = $this->info['filesize'] * 8;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tif (!empty($this->info['video']['frame_rate'])) {\n\t\t\t\t\t$FrameRate = $this->info['video']['frame_rate'];\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (!empty($this->info['playtime_seconds'])) {\n\t\t\t\t\t$PlaytimeSeconds = $this->info['playtime_seconds'];\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (!empty($this->info['video']['bitrate'])) {\n\t\t\t\t\t$BitrateCompressed = $this->info['video']['bitrate'];\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t$BitrateUncompressed = $this->info['video']['resolution_x'] * $this->info['video']['resolution_y'] * $this->info['video']['bits_per_sample'] * $FrameRate;\n\n\t\t$this->info['video']['compression_ratio'] = $BitrateCompressed / $BitrateUncompressed;\n\t\treturn true;\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function CalculateCompressionRatioAudio() {\n\t\tif (empty($this->info['audio']['bitrate']) || empty($this->info['audio']['channels']) || empty($this->info['audio']['sample_rate']) || !is_numeric($this->info['audio']['sample_rate'])) {\n\t\t\treturn false;\n\t\t}\n\t\t$this->info['audio']['compression_ratio'] = $this->info['audio']['bitrate'] / ($this->info['audio']['channels'] * $this->info['audio']['sample_rate'] * (!empty($this->info['audio']['bits_per_sample']) ? $this->info['audio']['bits_per_sample'] : 16));\n\n\t\tif (!empty($this->info['audio']['streams'])) {\n\t\t\tforeach ($this->info['audio']['streams'] as $streamnumber => $streamdata) {\n\t\t\t\tif (!empty($streamdata['bitrate']) && !empty($streamdata['channels']) && !empty($streamdata['sample_rate'])) {\n\t\t\t\t\t$this->info['audio']['streams'][$streamnumber]['compression_ratio'] = $streamdata['bitrate'] / ($streamdata['channels'] * $streamdata['sample_rate'] * (!empty($streamdata['bits_per_sample']) ? $streamdata['bits_per_sample'] : 16));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function CalculateReplayGain() {\n\t\tif (isset($this->info['replay_gain'])) {\n\t\t\tif (!isset($this->info['replay_gain']['reference_volume'])) {\n\t\t\t\t$this->info['replay_gain']['reference_volume'] = 89.0;\n\t\t\t}\n\t\t\tif (isset($this->info['replay_gain']['track']['adjustment'])) {\n\t\t\t\t$this->info['replay_gain']['track']['volume'] = $this->info['replay_gain']['reference_volume'] - $this->info['replay_gain']['track']['adjustment'];\n\t\t\t}\n\t\t\tif (isset($this->info['replay_gain']['album']['adjustment'])) {\n\t\t\t\t$this->info['replay_gain']['album']['volume'] = $this->info['replay_gain']['reference_volume'] - $this->info['replay_gain']['album']['adjustment'];\n\t\t\t}\n\n\t\t\tif (isset($this->info['replay_gain']['track']['peak'])) {\n\t\t\t\t$this->info['replay_gain']['track']['max_noclip_gain'] = 0 - getid3_lib::RGADamplitude2dB($this->info['replay_gain']['track']['peak']);\n\t\t\t}\n\t\t\tif (isset($this->info['replay_gain']['album']['peak'])) {\n\t\t\t\t$this->info['replay_gain']['album']['max_noclip_gain'] = 0 - getid3_lib::RGADamplitude2dB($this->info['replay_gain']['album']['peak']);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function ProcessAudioStreams() {\n\t\tif (!empty($this->info['audio']['bitrate']) || !empty($this->info['audio']['channels']) || !empty($this->info['audio']['sample_rate'])) {\n\t\t\tif (!isset($this->info['audio']['streams'])) {\n\t\t\t\tforeach ($this->info['audio'] as $key => $value) {\n\t\t\t\t\tif ($key != 'streams') {\n\t\t\t\t\t\t$this->info['audio']['streams'][0][$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @return string|bool\n\t */\n\tpublic function getid3_tempnam() {\n\t\treturn tempnam($this->tempdir, 'gI3');\n\t}\n\n\t/**\n\t * @param string $name\n\t *\n\t * @return bool\n\t *\n\t * @throws getid3_exception\n\t */\n\tpublic function include_module($name) {\n\t\t//if (!file_exists($this->include_path.'module.'.$name.'.php')) {\n\t\tif (!file_exists(GETID3_INCLUDEPATH.'module.'.$name.'.php')) {\n\t\t\tthrow new getid3_exception('Required module.'.$name.'.php is missing.');\n\t\t}\n\t\tinclude_once(GETID3_INCLUDEPATH.'module.'.$name.'.php');\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $filename\n\t *\n\t * @return bool\n\t */\n\tpublic static function is_writable ($filename) {\n\t\t$ret = is_writable($filename);\n\t\tif (!$ret) {\n\t\t\t$perms = fileperms($filename);\n\t\t\t$ret = ($perms & 0x0080) || ($perms & 0x0010) || ($perms & 0x0002);\n\t\t}\n\t\treturn $ret;\n\t}\n\n}\n\n\nabstract class getid3_handler\n{\n\n\t/**\n\t* @var getID3\n\t*/\n\tprotected $getid3;                       // pointer\n\n\t/**\n\t * Analyzing filepointer or string.\n\t *\n\t * @var bool\n\t */\n\tprotected $data_string_flag     = false;\n\n\t/**\n\t * String to analyze.\n\t *\n\t * @var string\n\t */\n\tprotected $data_string          = '';\n\n\t/**\n\t * Seek position in string.\n\t *\n\t * @var int\n\t */\n\tprotected $data_string_position = 0;\n\n\t/**\n\t * String length.\n\t *\n\t * @var int\n\t */\n\tprotected $data_string_length   = 0;\n\n\t/**\n\t * @var string\n\t */\n\tprivate $dependency_to;\n\n\t/**\n\t * getid3_handler constructor.\n\t *\n\t * @param getID3 $getid3\n\t * @param string $call_module\n\t */\n\tpublic function __construct(getID3 $getid3, $call_module=null) {\n\t\t$this->getid3 = $getid3;\n\n\t\tif ($call_module) {\n\t\t\t$this->dependency_to = str_replace('getid3_', '', $call_module);\n\t\t}\n\t}\n\n\t/**\n\t * Analyze from file pointer.\n\t *\n\t * @return bool\n\t */\n\tabstract public function Analyze();\n\n\t/**\n\t * Analyze from string instead.\n\t *\n\t * @param string $string\n\t */\n\tpublic function AnalyzeString($string) {\n\t\t// Enter string mode\n\t\t$this->setStringMode($string);\n\n\t\t// Save info\n\t\t$saved_avdataoffset = $this->getid3->info['avdataoffset'];\n\t\t$saved_avdataend    = $this->getid3->info['avdataend'];\n\t\t$saved_filesize     = (isset($this->getid3->info['filesize']) ? $this->getid3->info['filesize'] : null); // may be not set if called as dependency without openfile() call\n\n\t\t// Reset some info\n\t\t$this->getid3->info['avdataoffset'] = 0;\n\t\t$this->getid3->info['avdataend']    = $this->getid3->info['filesize'] = $this->data_string_length;\n\n\t\t// Analyze\n\t\t$this->Analyze();\n\n\t\t// Restore some info\n\t\t$this->getid3->info['avdataoffset'] = $saved_avdataoffset;\n\t\t$this->getid3->info['avdataend']    = $saved_avdataend;\n\t\t$this->getid3->info['filesize']     = $saved_filesize;\n\n\t\t// Exit string mode\n\t\t$this->data_string_flag = false;\n\t}\n\n\t/**\n\t * @param string $string\n\t */\n\tpublic function setStringMode($string) {\n\t\t$this->data_string_flag   = true;\n\t\t$this->data_string        = $string;\n\t\t$this->data_string_length = strlen($string);\n\t}\n\n\t/**\n\t * @return int|bool\n\t */\n\tprotected function ftell() {\n\t\tif ($this->data_string_flag) {\n\t\t\treturn $this->data_string_position;\n\t\t}\n\t\treturn ftell($this->getid3->fp);\n\t}\n\n\t/**\n\t * @param int $bytes\n\t *\n\t * @return string|false\n\t *\n\t * @throws getid3_exception\n\t */\n\tprotected function fread($bytes) {\n\t\tif ($this->data_string_flag) {\n\t\t\t$this->data_string_position += $bytes;\n\t\t\treturn substr($this->data_string, $this->data_string_position - $bytes, $bytes);\n\t\t}\n\t\t$pos = $this->ftell() + $bytes;\n\t\tif (!getid3_lib::intValueSupported($pos)) {\n\t\t\tthrow new getid3_exception('cannot fread('.$bytes.' from '.$this->ftell().') because beyond PHP filesystem limit', 10);\n\t\t}\n\n\t\t//return fread($this->getid3->fp, $bytes);\n\t\t/*\n\t\t* https://www.getid3.org/phpBB3/viewtopic.php?t=1930\n\t\t* \"I found out that the root cause for the problem was how getID3 uses the PHP system function fread().\n\t\t* It seems to assume that fread() would always return as many bytes as were requested.\n\t\t* However, according the PHP manual (http://php.net/manual/en/function.fread.php), this is the case only with regular local files, but not e.g. with Linux pipes.\n\t\t* The call may return only part of the requested data and a new call is needed to get more.\"\n\t\t*/\n\t\t$contents = '';\n\t\tdo {\n\t\t\t//if (($this->getid3->memory_limit > 0) && ($bytes > $this->getid3->memory_limit)) {\n\t\t\tif (($this->getid3->memory_limit > 0) && (($bytes / $this->getid3->memory_limit) > 0.99)) { // enable a more-fuzzy match to prevent close misses generating errors like \"PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 33554464 bytes)\"\n\t\t\t\tthrow new getid3_exception('cannot fread('.$bytes.' from '.$this->ftell().') that is more than available PHP memory ('.$this->getid3->memory_limit.')', 10);\n\t\t\t}\n\t\t\t$part = fread($this->getid3->fp, $bytes);\n\t\t\t$partLength  = strlen($part);\n\t\t\t$bytes      -= $partLength;\n\t\t\t$contents   .= $part;\n\t\t} while (($bytes > 0) && ($partLength > 0));\n\t\treturn $contents;\n\t}\n\n\t/**\n\t * @param int $bytes\n\t * @param int $whence\n\t *\n\t * @return int\n\t *\n\t * @throws getid3_exception\n\t */\n\tprotected function fseek($bytes, $whence=SEEK_SET) {\n\t\tif ($this->data_string_flag) {\n\t\t\tswitch ($whence) {\n\t\t\t\tcase SEEK_SET:\n\t\t\t\t\t$this->data_string_position = $bytes;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase SEEK_CUR:\n\t\t\t\t\t$this->data_string_position += $bytes;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase SEEK_END:\n\t\t\t\t\t$this->data_string_position = $this->data_string_length + $bytes;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn 0;\n\t\t} else {\n\t\t\t$pos = $bytes;\n\t\t\tif ($whence == SEEK_CUR) {\n\t\t\t\t$pos = $this->ftell() + $bytes;\n\t\t\t} elseif ($whence == SEEK_END) {\n\t\t\t\t$pos = $this->getid3->info['filesize'] + $bytes;\n\t\t\t}\n\t\t\tif (!getid3_lib::intValueSupported($pos)) {\n\t\t\t\tthrow new getid3_exception('cannot fseek('.$pos.') because beyond PHP filesystem limit', 10);\n\t\t\t}\n\t\t}\n\t\treturn fseek($this->getid3->fp, $bytes, $whence);\n\t}\n\n\t/**\n\t * @return string|false\n\t *\n\t * @throws getid3_exception\n\t */\n\tprotected function fgets() {\n\t\t// must be able to handle CR/LF/CRLF but not read more than one lineend\n\t\t$buffer   = ''; // final string we will return\n\t\t$prevchar = ''; // save previously-read character for end-of-line checking\n\t\tif ($this->data_string_flag) {\n\t\t\twhile (true) {\n\t\t\t\t$thischar = substr($this->data_string, $this->data_string_position++, 1);\n\t\t\t\tif (($prevchar == \"\\r\") && ($thischar != \"\\n\")) {\n\t\t\t\t\t// read one byte too many, back up\n\t\t\t\t\t$this->data_string_position--;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$buffer .= $thischar;\n\t\t\t\tif ($thischar == \"\\n\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ($this->data_string_position >= $this->data_string_length) {\n\t\t\t\t\t// EOF\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$prevchar = $thischar;\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// Ideally we would just use PHP's fgets() function, however...\n\t\t\t// it does not behave consistently with regards to mixed line endings, may be system-dependent\n\t\t\t// and breaks entirely when given a file with mixed \\r vs \\n vs \\r\\n line endings (e.g. some PDFs)\n\t\t\t//return fgets($this->getid3->fp);\n\t\t\twhile (true) {\n\t\t\t\t$thischar = fgetc($this->getid3->fp);\n\t\t\t\tif (($prevchar == \"\\r\") && ($thischar != \"\\n\")) {\n\t\t\t\t\t// read one byte too many, back up\n\t\t\t\t\tfseek($this->getid3->fp, -1, SEEK_CUR);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$buffer .= $thischar;\n\t\t\t\tif ($thischar == \"\\n\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (feof($this->getid3->fp)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$prevchar = $thischar;\n\t\t\t}\n\n\t\t}\n\t\treturn $buffer;\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tprotected function feof() {\n\t\tif ($this->data_string_flag) {\n\t\t\treturn $this->data_string_position >= $this->data_string_length;\n\t\t}\n\t\treturn feof($this->getid3->fp);\n\t}\n\n\t/**\n\t * @param string $module\n\t *\n\t * @return bool\n\t */\n\tfinal protected function isDependencyFor($module) {\n\t\treturn $this->dependency_to == $module;\n\t}\n\n\t/**\n\t * @param string $text\n\t *\n\t * @return bool\n\t */\n\tprotected function error($text) {\n\t\t$this->getid3->info['error'][] = $text;\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * @param string $text\n\t *\n\t * @return bool\n\t */\n\tprotected function warning($text) {\n\t\treturn $this->getid3->warning($text);\n\t}\n\n\t/**\n\t * @param string $text\n\t */\n\tprotected function notice($text) {\n\t\t// does nothing for now\n\t}\n\n\t/**\n\t * @param string $name\n\t * @param int    $offset\n\t * @param int    $length\n\t * @param string $image_mime\n\t *\n\t * @return string|null\n\t *\n\t * @throws Exception\n\t * @throws getid3_exception\n\t */\n\tpublic function saveAttachment($name, $offset, $length, $image_mime=null) {\n\t\ttry {\n\n\t\t\t// do not extract at all\n\t\t\tif ($this->getid3->option_save_attachments === getID3::ATTACHMENTS_NONE) {\n\n\t\t\t\t$attachment = null; // do not set any\n\n\t\t\t// extract to return array\n\t\t\t} elseif ($this->getid3->option_save_attachments === getID3::ATTACHMENTS_INLINE) {\n\n\t\t\t\t$this->fseek($offset);\n\t\t\t\t$attachment = $this->fread($length); // get whole data in one pass, till it is anyway stored in memory\n\t\t\t\tif ($attachment === false || strlen($attachment) != $length) {\n\t\t\t\t\tthrow new Exception('failed to read attachment data');\n\t\t\t\t}\n\n\t\t\t// assume directory path is given\n\t\t\t} else {\n\n\t\t\t\t// set up destination path\n\t\t\t\t$dir = rtrim(str_replace(array('/', '\\\\'), DIRECTORY_SEPARATOR, $this->getid3->option_save_attachments), DIRECTORY_SEPARATOR);\n\t\t\t\tif (!is_dir($dir) || !getID3::is_writable($dir)) { // check supplied directory\n\t\t\t\t\tthrow new Exception('supplied path ('.$dir.') does not exist, or is not writable');\n\t\t\t\t}\n\t\t\t\t$dest = $dir.DIRECTORY_SEPARATOR.$name.($image_mime ? '.'.getid3_lib::ImageExtFromMime($image_mime) : '');\n\n\t\t\t\t// create dest file\n\t\t\t\tif (($fp_dest = fopen($dest, 'wb')) == false) {\n\t\t\t\t\tthrow new Exception('failed to create file '.$dest);\n\t\t\t\t}\n\n\t\t\t\t// copy data\n\t\t\t\t$this->fseek($offset);\n\t\t\t\t$buffersize = ($this->data_string_flag ? $length : $this->getid3->fread_buffer_size());\n\t\t\t\t$bytesleft = $length;\n\t\t\t\twhile ($bytesleft > 0) {\n\t\t\t\t\tif (($buffer = $this->fread(min($buffersize, $bytesleft))) === false || ($byteswritten = fwrite($fp_dest, $buffer)) === false || ($byteswritten === 0)) {\n\t\t\t\t\t\tthrow new Exception($buffer === false ? 'not enough data to read' : 'failed to write to destination file, may be not enough disk space');\n\t\t\t\t\t}\n\t\t\t\t\t$bytesleft -= $byteswritten;\n\t\t\t\t}\n\n\t\t\t\tfclose($fp_dest);\n\t\t\t\t$attachment = $dest;\n\n\t\t\t}\n\n\t\t} catch (Exception $e) {\n\n\t\t\t// close and remove dest file if created\n\t\t\tif (isset($fp_dest) && is_resource($fp_dest)) {\n\t\t\t\tfclose($fp_dest);\n\t\t\t}\n\n\t\t\tif (isset($dest) && file_exists($dest)) {\n\t\t\t\tunlink($dest);\n\t\t\t}\n\n\t\t\t// do not set any is case of error\n\t\t\t$attachment = null;\n\t\t\t$this->warning('Failed to extract attachment '.$name.': '.$e->getMessage());\n\n\t\t}\n\n\t\t// seek to the end of attachment\n\t\t$this->fseek($offset + $length);\n\n\t\treturn $attachment;\n\t}\n\n}\n\n\nclass getid3_exception extends Exception\n{\n\tpublic $message;\n}\n", "num_lines": 2304}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/////////////////////////////////////////////////////////////////\n/// getID3() by James Heinrich <info@getid3.org>               //\n//  available at https://github.com/JamesHeinrich/getID3       //\n//            or https://www.getid3.org                        //\n//            or http://getid3.sourceforge.net                 //\n//  see readme.txt for more details                            //\n/////////////////////////////////////////////////////////////////\n//                                                             //\n// module.audio-video.asf.php                                  //\n// module for analyzing ASF, WMA and WMV files                 //\n// dependencies: module.audio-video.riff.php                   //\n//                                                            ///\n/////////////////////////////////////////////////////////////////\n\nif (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers\n\texit;\n}\ngetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true);\n\nclass getid3_asf extends getid3_handler\n{\n\t/**\n\t * @param getID3 $getid3\n\t */\n\tpublic function __construct(getID3 $getid3) {\n\t\tparent::__construct($getid3);  // extends getid3_handler::__construct()\n\n\t\t// initialize all GUID constants\n\t\t$GUIDarray = $this->KnownGUIDs();\n\t\tforeach ($GUIDarray as $GUIDname => $hexstringvalue) {\n\t\t\tif (!defined($GUIDname)) {\n\t\t\t\tdefine($GUIDname, $this->GUIDtoBytestring($hexstringvalue));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function Analyze() {\n\t\t$info = &$this->getid3->info;\n\n\t\t// Shortcuts\n\t\t$thisfile_audio = &$info['audio'];\n\t\t$thisfile_video = &$info['video'];\n\t\t$info['asf']  = array();\n\t\t$thisfile_asf = &$info['asf'];\n\t\t$thisfile_asf['comments'] = array();\n\t\t$thisfile_asf_comments    = &$thisfile_asf['comments'];\n\t\t$thisfile_asf['header_object'] = array();\n\t\t$thisfile_asf_headerobject     = &$thisfile_asf['header_object'];\n\n\n\t\t// ASF structure:\n\t\t// * Header Object [required]\n\t\t//   * File Properties Object [required]   (global file attributes)\n\t\t//   * Stream Properties Object [required] (defines media stream & characteristics)\n\t\t//   * Header Extension Object [required]  (additional functionality)\n\t\t//   * Content Description Object          (bibliographic information)\n\t\t//   * Script Command Object               (commands for during playback)\n\t\t//   * Marker Object                       (named jumped points within the file)\n\t\t// * Data Object [required]\n\t\t//   * Data Packets\n\t\t// * Index Object\n\n\t\t// Header Object: (mandatory, one only)\n\t\t// Field Name                   Field Type   Size (bits)\n\t\t// Object ID                    GUID         128             // GUID for header object - GETID3_ASF_Header_Object\n\t\t// Object Size                  QWORD        64              // size of header object, including 30 bytes of Header Object header\n\t\t// Number of Header Objects     DWORD        32              // number of objects in header object\n\t\t// Reserved1                    BYTE         8               // hardcoded: 0x01\n\t\t// Reserved2                    BYTE         8               // hardcoded: 0x02\n\n\t\t$info['fileformat'] = 'asf';\n\n\t\t$this->fseek($info['avdataoffset']);\n\t\t$HeaderObjectData = $this->fread(30);\n\n\t\t$thisfile_asf_headerobject['objectid']      = substr($HeaderObjectData, 0, 16);\n\t\t$thisfile_asf_headerobject['objectid_guid'] = $this->BytestringToGUID($thisfile_asf_headerobject['objectid']);\n\t\tif ($thisfile_asf_headerobject['objectid'] != GETID3_ASF_Header_Object) {\n\t\t\tunset($info['fileformat'], $info['asf']);\n\t\t\treturn $this->error('ASF header GUID {'.$this->BytestringToGUID($thisfile_asf_headerobject['objectid']).'} does not match expected \"GETID3_ASF_Header_Object\" GUID {'.$this->BytestringToGUID(GETID3_ASF_Header_Object).'}');\n\t\t}\n\t\t$thisfile_asf_headerobject['objectsize']    = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 16, 8));\n\t\t$thisfile_asf_headerobject['headerobjects'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 24, 4));\n\t\t$thisfile_asf_headerobject['reserved1']     = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 28, 1));\n\t\t$thisfile_asf_headerobject['reserved2']     = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 29, 1));\n\n\t\t$NextObjectOffset = $this->ftell();\n\t\t$ASFHeaderData = $this->fread($thisfile_asf_headerobject['objectsize'] - 30);\n\t\t$offset = 0;\n\t\t$thisfile_asf_streambitratepropertiesobject = array();\n\t\t$thisfile_asf_codeclistobject = array();\n\n\t\tfor ($HeaderObjectsCounter = 0; $HeaderObjectsCounter < $thisfile_asf_headerobject['headerobjects']; $HeaderObjectsCounter++) {\n\t\t\t$NextObjectGUID = substr($ASFHeaderData, $offset, 16);\n\t\t\t$offset += 16;\n\t\t\t$NextObjectGUIDtext = $this->BytestringToGUID($NextObjectGUID);\n\t\t\t$NextObjectSize = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));\n\t\t\t$offset += 8;\n\t\t\tswitch ($NextObjectGUID) {\n\n\t\t\t\tcase GETID3_ASF_File_Properties_Object:\n\t\t\t\t\t// File Properties Object: (mandatory, one only)\n\t\t\t\t\t// Field Name                   Field Type   Size (bits)\n\t\t\t\t\t// Object ID                    GUID         128             // GUID for file properties object - GETID3_ASF_File_Properties_Object\n\t\t\t\t\t// Object Size                  QWORD        64              // size of file properties object, including 104 bytes of File Properties Object header\n\t\t\t\t\t// File ID                      GUID         128             // unique ID - identical to File ID in Data Object\n\t\t\t\t\t// File Size                    QWORD        64              // entire file in bytes. Invalid if Broadcast Flag == 1\n\t\t\t\t\t// Creation Date                QWORD        64              // date & time of file creation. Maybe invalid if Broadcast Flag == 1\n\t\t\t\t\t// Data Packets Count           QWORD        64              // number of data packets in Data Object. Invalid if Broadcast Flag == 1\n\t\t\t\t\t// Play Duration                QWORD        64              // playtime, in 100-nanosecond units. Invalid if Broadcast Flag == 1\n\t\t\t\t\t// Send Duration                QWORD        64              // time needed to send file, in 100-nanosecond units. Players can ignore this value. Invalid if Broadcast Flag == 1\n\t\t\t\t\t// Preroll                      QWORD        64              // time to buffer data before starting to play file, in 1-millisecond units. If <> 0, PlayDuration and PresentationTime have been offset by this amount\n\t\t\t\t\t// Flags                        DWORD        32              //\n\t\t\t\t\t// * Broadcast Flag             bits         1  (0x01)       // file is currently being written, some header values are invalid\n\t\t\t\t\t// * Seekable Flag              bits         1  (0x02)       // is file seekable\n\t\t\t\t\t// * Reserved                   bits         30 (0xFFFFFFFC) // reserved - set to zero\n\t\t\t\t\t// Minimum Data Packet Size     DWORD        32              // in bytes. should be same as Maximum Data Packet Size. Invalid if Broadcast Flag == 1\n\t\t\t\t\t// Maximum Data Packet Size     DWORD        32              // in bytes. should be same as Minimum Data Packet Size. Invalid if Broadcast Flag == 1\n\t\t\t\t\t// Maximum Bitrate              DWORD        32              // maximum instantaneous bitrate in bits per second for entire file, including all data streams and ASF overhead\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_asf['file_properties_object'] = array();\n\t\t\t\t\t$thisfile_asf_filepropertiesobject      = &$thisfile_asf['file_properties_object'];\n\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['offset']             = $NextObjectOffset + $offset;\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['objectid']           = $NextObjectGUID;\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['objectid_guid']      = $NextObjectGUIDtext;\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['objectsize']         = $NextObjectSize;\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['fileid']             = substr($ASFHeaderData, $offset, 16);\n\t\t\t\t\t$offset += 16;\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['fileid_guid']        = $this->BytestringToGUID($thisfile_asf_filepropertiesobject['fileid']);\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['filesize']           = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));\n\t\t\t\t\t$offset += 8;\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['creation_date']      = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['creation_date_unix'] = $this->FILETIMEtoUNIXtime($thisfile_asf_filepropertiesobject['creation_date']);\n\t\t\t\t\t$offset += 8;\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['data_packets']       = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));\n\t\t\t\t\t$offset += 8;\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['play_duration']      = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));\n\t\t\t\t\t$offset += 8;\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['send_duration']      = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));\n\t\t\t\t\t$offset += 8;\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['preroll']            = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));\n\t\t\t\t\t$offset += 8;\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['flags_raw']          = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['flags']['broadcast'] = (bool) ($thisfile_asf_filepropertiesobject['flags_raw'] & 0x0001);\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['flags']['seekable']  = (bool) ($thisfile_asf_filepropertiesobject['flags_raw'] & 0x0002);\n\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['min_packet_size']    = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['max_packet_size']    = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\t\t\t\t\t$thisfile_asf_filepropertiesobject['max_bitrate']        = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\n\t\t\t\t\tif ($thisfile_asf_filepropertiesobject['flags']['broadcast']) {\n\n\t\t\t\t\t\t// broadcast flag is set, some values invalid\n\t\t\t\t\t\tunset($thisfile_asf_filepropertiesobject['filesize']);\n\t\t\t\t\t\tunset($thisfile_asf_filepropertiesobject['data_packets']);\n\t\t\t\t\t\tunset($thisfile_asf_filepropertiesobject['play_duration']);\n\t\t\t\t\t\tunset($thisfile_asf_filepropertiesobject['send_duration']);\n\t\t\t\t\t\tunset($thisfile_asf_filepropertiesobject['min_packet_size']);\n\t\t\t\t\t\tunset($thisfile_asf_filepropertiesobject['max_packet_size']);\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// broadcast flag NOT set, perform calculations\n\t\t\t\t\t\t$info['playtime_seconds'] = ($thisfile_asf_filepropertiesobject['play_duration'] / 10000000) - ($thisfile_asf_filepropertiesobject['preroll'] / 1000);\n\n\t\t\t\t\t\t//$info['bitrate'] = $thisfile_asf_filepropertiesobject['max_bitrate'];\n\t\t\t\t\t\t$info['bitrate'] = ((isset($thisfile_asf_filepropertiesobject['filesize']) ? $thisfile_asf_filepropertiesobject['filesize'] : $info['filesize']) * 8) / $info['playtime_seconds'];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Stream_Properties_Object:\n\t\t\t\t\t// Stream Properties Object: (mandatory, one per media stream)\n\t\t\t\t\t// Field Name                   Field Type   Size (bits)\n\t\t\t\t\t// Object ID                    GUID         128             // GUID for stream properties object - GETID3_ASF_Stream_Properties_Object\n\t\t\t\t\t// Object Size                  QWORD        64              // size of stream properties object, including 78 bytes of Stream Properties Object header\n\t\t\t\t\t// Stream Type                  GUID         128             // GETID3_ASF_Audio_Media, GETID3_ASF_Video_Media or GETID3_ASF_Command_Media\n\t\t\t\t\t// Error Correction Type        GUID         128             // GETID3_ASF_Audio_Spread for audio-only streams, GETID3_ASF_No_Error_Correction for other stream types\n\t\t\t\t\t// Time Offset                  QWORD        64              // 100-nanosecond units. typically zero. added to all timestamps of samples in the stream\n\t\t\t\t\t// Type-Specific Data Length    DWORD        32              // number of bytes for Type-Specific Data field\n\t\t\t\t\t// Error Correction Data Length DWORD        32              // number of bytes for Error Correction Data field\n\t\t\t\t\t// Flags                        WORD         16              //\n\t\t\t\t\t// * Stream Number              bits         7 (0x007F)      // number of this stream.  1 <= valid <= 127\n\t\t\t\t\t// * Reserved                   bits         8 (0x7F80)      // reserved - set to zero\n\t\t\t\t\t// * Encrypted Content Flag     bits         1 (0x8000)      // stream contents encrypted if set\n\t\t\t\t\t// Reserved                     DWORD        32              // reserved - set to zero\n\t\t\t\t\t// Type-Specific Data           BYTESTREAM   variable        // type-specific format data, depending on value of Stream Type\n\t\t\t\t\t// Error Correction Data        BYTESTREAM   variable        // error-correction-specific format data, depending on value of Error Correct Type\n\n\t\t\t\t\t// There is one GETID3_ASF_Stream_Properties_Object for each stream (audio, video) but the\n\t\t\t\t\t// stream number isn't known until halfway through decoding the structure, hence it\n\t\t\t\t\t// it is decoded to a temporary variable and then stuck in the appropriate index later\n\n\t\t\t\t\t$StreamPropertiesObjectData['offset']             = $NextObjectOffset + $offset;\n\t\t\t\t\t$StreamPropertiesObjectData['objectid']           = $NextObjectGUID;\n\t\t\t\t\t$StreamPropertiesObjectData['objectid_guid']      = $NextObjectGUIDtext;\n\t\t\t\t\t$StreamPropertiesObjectData['objectsize']         = $NextObjectSize;\n\t\t\t\t\t$StreamPropertiesObjectData['stream_type']        = substr($ASFHeaderData, $offset, 16);\n\t\t\t\t\t$offset += 16;\n\t\t\t\t\t$StreamPropertiesObjectData['stream_type_guid']   = $this->BytestringToGUID($StreamPropertiesObjectData['stream_type']);\n\t\t\t\t\t$StreamPropertiesObjectData['error_correct_type'] = substr($ASFHeaderData, $offset, 16);\n\t\t\t\t\t$offset += 16;\n\t\t\t\t\t$StreamPropertiesObjectData['error_correct_guid'] = $this->BytestringToGUID($StreamPropertiesObjectData['error_correct_type']);\n\t\t\t\t\t$StreamPropertiesObjectData['time_offset']        = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));\n\t\t\t\t\t$offset += 8;\n\t\t\t\t\t$StreamPropertiesObjectData['type_data_length']   = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\t\t\t\t\t$StreamPropertiesObjectData['error_data_length']  = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\t\t\t\t\t$StreamPropertiesObjectData['flags_raw']          = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\t$StreamPropertiesObjectStreamNumber               = $StreamPropertiesObjectData['flags_raw'] & 0x007F;\n\t\t\t\t\t$StreamPropertiesObjectData['flags']['encrypted'] = (bool) ($StreamPropertiesObjectData['flags_raw'] & 0x8000);\n\n\t\t\t\t\t$offset += 4; // reserved - DWORD\n\t\t\t\t\t$StreamPropertiesObjectData['type_specific_data'] = substr($ASFHeaderData, $offset, $StreamPropertiesObjectData['type_data_length']);\n\t\t\t\t\t$offset += $StreamPropertiesObjectData['type_data_length'];\n\t\t\t\t\t$StreamPropertiesObjectData['error_correct_data'] = substr($ASFHeaderData, $offset, $StreamPropertiesObjectData['error_data_length']);\n\t\t\t\t\t$offset += $StreamPropertiesObjectData['error_data_length'];\n\n\t\t\t\t\tswitch ($StreamPropertiesObjectData['stream_type']) {\n\n\t\t\t\t\t\tcase GETID3_ASF_Audio_Media:\n\t\t\t\t\t\t\t$thisfile_audio['dataformat']   = (!empty($thisfile_audio['dataformat'])   ? $thisfile_audio['dataformat']   : 'asf');\n\t\t\t\t\t\t\t$thisfile_audio['bitrate_mode'] = (!empty($thisfile_audio['bitrate_mode']) ? $thisfile_audio['bitrate_mode'] : 'cbr');\n\n\t\t\t\t\t\t\t$audiodata = getid3_riff::parseWAVEFORMATex(substr($StreamPropertiesObjectData['type_specific_data'], 0, 16));\n\t\t\t\t\t\t\tunset($audiodata['raw']);\n\t\t\t\t\t\t\t$thisfile_audio = getid3_lib::array_merge_noclobber($audiodata, $thisfile_audio);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase GETID3_ASF_Video_Media:\n\t\t\t\t\t\t\t$thisfile_video['dataformat']   = (!empty($thisfile_video['dataformat'])   ? $thisfile_video['dataformat']   : 'asf');\n\t\t\t\t\t\t\t$thisfile_video['bitrate_mode'] = (!empty($thisfile_video['bitrate_mode']) ? $thisfile_video['bitrate_mode'] : 'cbr');\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase GETID3_ASF_Command_Media:\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$thisfile_asf['stream_properties_object'][$StreamPropertiesObjectStreamNumber] = $StreamPropertiesObjectData;\n\t\t\t\t\tunset($StreamPropertiesObjectData); // clear for next stream, if any\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Header_Extension_Object:\n\t\t\t\t\t// Header Extension Object: (mandatory, one only)\n\t\t\t\t\t// Field Name                   Field Type   Size (bits)\n\t\t\t\t\t// Object ID                    GUID         128             // GUID for Header Extension object - GETID3_ASF_Header_Extension_Object\n\t\t\t\t\t// Object Size                  QWORD        64              // size of Header Extension object, including 46 bytes of Header Extension Object header\n\t\t\t\t\t// Reserved Field 1             GUID         128             // hardcoded: GETID3_ASF_Reserved_1\n\t\t\t\t\t// Reserved Field 2             WORD         16              // hardcoded: 0x00000006\n\t\t\t\t\t// Header Extension Data Size   DWORD        32              // in bytes. valid: 0, or > 24. equals object size minus 46\n\t\t\t\t\t// Header Extension Data        BYTESTREAM   variable        // array of zero or more extended header objects\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_asf['header_extension_object'] = array();\n\t\t\t\t\t$thisfile_asf_headerextensionobject      = &$thisfile_asf['header_extension_object'];\n\n\t\t\t\t\t$thisfile_asf_headerextensionobject['offset']              = $NextObjectOffset + $offset;\n\t\t\t\t\t$thisfile_asf_headerextensionobject['objectid']            = $NextObjectGUID;\n\t\t\t\t\t$thisfile_asf_headerextensionobject['objectid_guid']       = $NextObjectGUIDtext;\n\t\t\t\t\t$thisfile_asf_headerextensionobject['objectsize']          = $NextObjectSize;\n\t\t\t\t\t$thisfile_asf_headerextensionobject['reserved_1']          = substr($ASFHeaderData, $offset, 16);\n\t\t\t\t\t$offset += 16;\n\t\t\t\t\t$thisfile_asf_headerextensionobject['reserved_1_guid']     = $this->BytestringToGUID($thisfile_asf_headerextensionobject['reserved_1']);\n\t\t\t\t\tif ($thisfile_asf_headerextensionobject['reserved_1'] != GETID3_ASF_Reserved_1) {\n\t\t\t\t\t\t$this->warning('header_extension_object.reserved_1 GUID ('.$this->BytestringToGUID($thisfile_asf_headerextensionobject['reserved_1']).') does not match expected \"GETID3_ASF_Reserved_1\" GUID ('.$this->BytestringToGUID(GETID3_ASF_Reserved_1).')');\n\t\t\t\t\t\t//return false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_asf_headerextensionobject['reserved_2']          = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\tif ($thisfile_asf_headerextensionobject['reserved_2'] != 6) {\n\t\t\t\t\t\t$this->warning('header_extension_object.reserved_2 ('.getid3_lib::PrintHexBytes($thisfile_asf_headerextensionobject['reserved_2']).') does not match expected value of \"6\"');\n\t\t\t\t\t\t//return false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_asf_headerextensionobject['extension_data_size'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\t\t\t\t\t$thisfile_asf_headerextensionobject['extension_data']      =                              substr($ASFHeaderData, $offset, $thisfile_asf_headerextensionobject['extension_data_size']);\n\t\t\t\t\t$unhandled_sections = 0;\n\t\t\t\t\t$thisfile_asf_headerextensionobject['extension_data_parsed'] = $this->HeaderExtensionObjectDataParse($thisfile_asf_headerextensionobject['extension_data'], $unhandled_sections);\n\t\t\t\t\tif ($unhandled_sections === 0) {\n\t\t\t\t\t\tunset($thisfile_asf_headerextensionobject['extension_data']);\n\t\t\t\t\t}\n\t\t\t\t\t$offset += $thisfile_asf_headerextensionobject['extension_data_size'];\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Codec_List_Object:\n\t\t\t\t\t// Codec List Object: (optional, one only)\n\t\t\t\t\t// Field Name                   Field Type   Size (bits)\n\t\t\t\t\t// Object ID                    GUID         128             // GUID for Codec List object - GETID3_ASF_Codec_List_Object\n\t\t\t\t\t// Object Size                  QWORD        64              // size of Codec List object, including 44 bytes of Codec List Object header\n\t\t\t\t\t// Reserved                     GUID         128             // hardcoded: 86D15241-311D-11D0-A3A4-00A0C90348F6\n\t\t\t\t\t// Codec Entries Count          DWORD        32              // number of entries in Codec Entries array\n\t\t\t\t\t// Codec Entries                array of:    variable        //\n\t\t\t\t\t// * Type                       WORD         16              // 0x0001 = Video Codec, 0x0002 = Audio Codec, 0xFFFF = Unknown Codec\n\t\t\t\t\t// * Codec Name Length          WORD         16              // number of Unicode characters stored in the Codec Name field\n\t\t\t\t\t// * Codec Name                 WCHAR        variable        // array of Unicode characters - name of codec used to create the content\n\t\t\t\t\t// * Codec Description Length   WORD         16              // number of Unicode characters stored in the Codec Description field\n\t\t\t\t\t// * Codec Description          WCHAR        variable        // array of Unicode characters - description of format used to create the content\n\t\t\t\t\t// * Codec Information Length   WORD         16              // number of Unicode characters stored in the Codec Information field\n\t\t\t\t\t// * Codec Information          BYTESTREAM   variable        // opaque array of information bytes about the codec used to create the content\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_asf['codec_list_object'] = array();\n\t\t\t\t\t$thisfile_asf_codeclistobject      = &$thisfile_asf['codec_list_object'];\n\n\t\t\t\t\t$thisfile_asf_codeclistobject['offset']                    = $NextObjectOffset + $offset;\n\t\t\t\t\t$thisfile_asf_codeclistobject['objectid']                  = $NextObjectGUID;\n\t\t\t\t\t$thisfile_asf_codeclistobject['objectid_guid']             = $NextObjectGUIDtext;\n\t\t\t\t\t$thisfile_asf_codeclistobject['objectsize']                = $NextObjectSize;\n\t\t\t\t\t$thisfile_asf_codeclistobject['reserved']                  = substr($ASFHeaderData, $offset, 16);\n\t\t\t\t\t$offset += 16;\n\t\t\t\t\t$thisfile_asf_codeclistobject['reserved_guid']             = $this->BytestringToGUID($thisfile_asf_codeclistobject['reserved']);\n\t\t\t\t\tif ($thisfile_asf_codeclistobject['reserved'] != $this->GUIDtoBytestring('86D15241-311D-11D0-A3A4-00A0C90348F6')) {\n\t\t\t\t\t\t$this->warning('codec_list_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_codeclistobject['reserved']).'} does not match expected \"GETID3_ASF_Reserved_1\" GUID {86D15241-311D-11D0-A3A4-00A0C90348F6}');\n\t\t\t\t\t\t//return false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_asf_codeclistobject['codec_entries_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\t\t\t\t\tfor ($CodecEntryCounter = 0; $CodecEntryCounter < $thisfile_asf_codeclistobject['codec_entries_count']; $CodecEntryCounter++) {\n\t\t\t\t\t\t// shortcut\n\t\t\t\t\t\t$thisfile_asf_codeclistobject['codec_entries'][$CodecEntryCounter] = array();\n\t\t\t\t\t\t$thisfile_asf_codeclistobject_codecentries_current = &$thisfile_asf_codeclistobject['codec_entries'][$CodecEntryCounter];\n\n\t\t\t\t\t\t$thisfile_asf_codeclistobject_codecentries_current['type_raw'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$thisfile_asf_codeclistobject_codecentries_current['type'] = self::codecListObjectTypeLookup($thisfile_asf_codeclistobject_codecentries_current['type_raw']);\n\n\t\t\t\t\t\t$CodecNameLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$thisfile_asf_codeclistobject_codecentries_current['name'] = substr($ASFHeaderData, $offset, $CodecNameLength);\n\t\t\t\t\t\t$offset += $CodecNameLength;\n\n\t\t\t\t\t\t$CodecDescriptionLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$thisfile_asf_codeclistobject_codecentries_current['description'] = substr($ASFHeaderData, $offset, $CodecDescriptionLength);\n\t\t\t\t\t\t$offset += $CodecDescriptionLength;\n\n\t\t\t\t\t\t$CodecInformationLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$thisfile_asf_codeclistobject_codecentries_current['information'] = substr($ASFHeaderData, $offset, $CodecInformationLength);\n\t\t\t\t\t\t$offset += $CodecInformationLength;\n\n\t\t\t\t\t\tif ($thisfile_asf_codeclistobject_codecentries_current['type_raw'] == 2) { // audio codec\n\n\t\t\t\t\t\t\tif (strpos($thisfile_asf_codeclistobject_codecentries_current['description'], ',') === false) {\n\t\t\t\t\t\t\t\t$this->warning('[asf][codec_list_object][codec_entries]['.$CodecEntryCounter.'][description] expected to contain comma-separated list of parameters: \"'.$thisfile_asf_codeclistobject_codecentries_current['description'].'\"');\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tlist($AudioCodecBitrate, $AudioCodecFrequency, $AudioCodecChannels) = explode(',', $this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['description']));\n\t\t\t\t\t\t\t\t$thisfile_audio['codec'] = $this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['name']);\n\n\t\t\t\t\t\t\t\tif (!isset($thisfile_audio['bitrate']) && strstr($AudioCodecBitrate, 'kbps')) {\n\t\t\t\t\t\t\t\t\t$thisfile_audio['bitrate'] = (int) trim(str_replace('kbps', '', $AudioCodecBitrate)) * 1000;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//if (!isset($thisfile_video['bitrate']) && isset($thisfile_audio['bitrate']) && isset($thisfile_asf['file_properties_object']['max_bitrate']) && ($thisfile_asf_codeclistobject['codec_entries_count'] > 1)) {\n\t\t\t\t\t\t\t\tif (empty($thisfile_video['bitrate']) && !empty($thisfile_audio['bitrate']) && !empty($info['bitrate'])) {\n\t\t\t\t\t\t\t\t\t//$thisfile_video['bitrate'] = $thisfile_asf['file_properties_object']['max_bitrate'] - $thisfile_audio['bitrate'];\n\t\t\t\t\t\t\t\t\t$thisfile_video['bitrate'] = $info['bitrate'] - $thisfile_audio['bitrate'];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$AudioCodecFrequency = (int) trim(str_replace('kHz', '', $AudioCodecFrequency));\n\t\t\t\t\t\t\t\tswitch ($AudioCodecFrequency) {\n\t\t\t\t\t\t\t\t\tcase 8:\n\t\t\t\t\t\t\t\t\tcase 8000:\n\t\t\t\t\t\t\t\t\t\t$thisfile_audio['sample_rate'] = 8000;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 11:\n\t\t\t\t\t\t\t\t\tcase 11025:\n\t\t\t\t\t\t\t\t\t\t$thisfile_audio['sample_rate'] = 11025;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\t\t\tcase 12000:\n\t\t\t\t\t\t\t\t\t\t$thisfile_audio['sample_rate'] = 12000;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 16:\n\t\t\t\t\t\t\t\t\tcase 16000:\n\t\t\t\t\t\t\t\t\t\t$thisfile_audio['sample_rate'] = 16000;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 22:\n\t\t\t\t\t\t\t\t\tcase 22050:\n\t\t\t\t\t\t\t\t\t\t$thisfile_audio['sample_rate'] = 22050;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 24:\n\t\t\t\t\t\t\t\t\tcase 24000:\n\t\t\t\t\t\t\t\t\t\t$thisfile_audio['sample_rate'] = 24000;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\t\t\tcase 32000:\n\t\t\t\t\t\t\t\t\t\t$thisfile_audio['sample_rate'] = 32000;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 44:\n\t\t\t\t\t\t\t\t\tcase 441000:\n\t\t\t\t\t\t\t\t\t\t$thisfile_audio['sample_rate'] = 44100;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 48:\n\t\t\t\t\t\t\t\t\tcase 48000:\n\t\t\t\t\t\t\t\t\t\t$thisfile_audio['sample_rate'] = 48000;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t$this->warning('unknown frequency: \"'.$AudioCodecFrequency.'\" ('.$this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['description']).')');\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (!isset($thisfile_audio['channels'])) {\n\t\t\t\t\t\t\t\t\tif (strstr($AudioCodecChannels, 'stereo')) {\n\t\t\t\t\t\t\t\t\t\t$thisfile_audio['channels'] = 2;\n\t\t\t\t\t\t\t\t\t} elseif (strstr($AudioCodecChannels, 'mono')) {\n\t\t\t\t\t\t\t\t\t\t$thisfile_audio['channels'] = 1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\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\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Script_Command_Object:\n\t\t\t\t\t// Script Command Object: (optional, one only)\n\t\t\t\t\t// Field Name                   Field Type   Size (bits)\n\t\t\t\t\t// Object ID                    GUID         128             // GUID for Script Command object - GETID3_ASF_Script_Command_Object\n\t\t\t\t\t// Object Size                  QWORD        64              // size of Script Command object, including 44 bytes of Script Command Object header\n\t\t\t\t\t// Reserved                     GUID         128             // hardcoded: 4B1ACBE3-100B-11D0-A39B-00A0C90348F6\n\t\t\t\t\t// Commands Count               WORD         16              // number of Commands structures in the Script Commands Objects\n\t\t\t\t\t// Command Types Count          WORD         16              // number of Command Types structures in the Script Commands Objects\n\t\t\t\t\t// Command Types                array of:    variable        //\n\t\t\t\t\t// * Command Type Name Length   WORD         16              // number of Unicode characters for Command Type Name\n\t\t\t\t\t// * Command Type Name          WCHAR        variable        // array of Unicode characters - name of a type of command\n\t\t\t\t\t// Commands                     array of:    variable        //\n\t\t\t\t\t// * Presentation Time          DWORD        32              // presentation time of that command, in milliseconds\n\t\t\t\t\t// * Type Index                 WORD         16              // type of this command, as a zero-based index into the array of Command Types of this object\n\t\t\t\t\t// * Command Name Length        WORD         16              // number of Unicode characters for Command Name\n\t\t\t\t\t// * Command Name               WCHAR        variable        // array of Unicode characters - name of this command\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_asf['script_command_object'] = array();\n\t\t\t\t\t$thisfile_asf_scriptcommandobject      = &$thisfile_asf['script_command_object'];\n\n\t\t\t\t\t$thisfile_asf_scriptcommandobject['offset']               = $NextObjectOffset + $offset;\n\t\t\t\t\t$thisfile_asf_scriptcommandobject['objectid']             = $NextObjectGUID;\n\t\t\t\t\t$thisfile_asf_scriptcommandobject['objectid_guid']        = $NextObjectGUIDtext;\n\t\t\t\t\t$thisfile_asf_scriptcommandobject['objectsize']           = $NextObjectSize;\n\t\t\t\t\t$thisfile_asf_scriptcommandobject['reserved']             = substr($ASFHeaderData, $offset, 16);\n\t\t\t\t\t$offset += 16;\n\t\t\t\t\t$thisfile_asf_scriptcommandobject['reserved_guid']        = $this->BytestringToGUID($thisfile_asf_scriptcommandobject['reserved']);\n\t\t\t\t\tif ($thisfile_asf_scriptcommandobject['reserved'] != $this->GUIDtoBytestring('4B1ACBE3-100B-11D0-A39B-00A0C90348F6')) {\n\t\t\t\t\t\t$this->warning('script_command_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_scriptcommandobject['reserved']).'} does not match expected \"GETID3_ASF_Reserved_1\" GUID {4B1ACBE3-100B-11D0-A39B-00A0C90348F6}');\n\t\t\t\t\t\t//return false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_asf_scriptcommandobject['commands_count']       = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\t$thisfile_asf_scriptcommandobject['command_types_count']  = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\tfor ($CommandTypesCounter = 0; $CommandTypesCounter < $thisfile_asf_scriptcommandobject['command_types_count']; $CommandTypesCounter++) {\n\t\t\t\t\t\t$CommandTypeNameLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$thisfile_asf_scriptcommandobject['command_types'][$CommandTypesCounter]['name'] = substr($ASFHeaderData, $offset, $CommandTypeNameLength);\n\t\t\t\t\t\t$offset += $CommandTypeNameLength;\n\t\t\t\t\t}\n\t\t\t\t\tfor ($CommandsCounter = 0; $CommandsCounter < $thisfile_asf_scriptcommandobject['commands_count']; $CommandsCounter++) {\n\t\t\t\t\t\t$thisfile_asf_scriptcommandobject['commands'][$CommandsCounter]['presentation_time']  = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));\n\t\t\t\t\t\t$offset += 4;\n\t\t\t\t\t\t$thisfile_asf_scriptcommandobject['commands'][$CommandsCounter]['type_index']         = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t\t$offset += 2;\n\n\t\t\t\t\t\t$CommandTypeNameLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$thisfile_asf_scriptcommandobject['commands'][$CommandsCounter]['name'] = substr($ASFHeaderData, $offset, $CommandTypeNameLength);\n\t\t\t\t\t\t$offset += $CommandTypeNameLength;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Marker_Object:\n\t\t\t\t\t// Marker Object: (optional, one only)\n\t\t\t\t\t// Field Name                   Field Type   Size (bits)\n\t\t\t\t\t// Object ID                    GUID         128             // GUID for Marker object - GETID3_ASF_Marker_Object\n\t\t\t\t\t// Object Size                  QWORD        64              // size of Marker object, including 48 bytes of Marker Object header\n\t\t\t\t\t// Reserved                     GUID         128             // hardcoded: 4CFEDB20-75F6-11CF-9C0F-00A0C90349CB\n\t\t\t\t\t// Markers Count                DWORD        32              // number of Marker structures in Marker Object\n\t\t\t\t\t// Reserved                     WORD         16              // hardcoded: 0x0000\n\t\t\t\t\t// Name Length                  WORD         16              // number of bytes in the Name field\n\t\t\t\t\t// Name                         WCHAR        variable        // name of the Marker Object\n\t\t\t\t\t// Markers                      array of:    variable        //\n\t\t\t\t\t// * Offset                     QWORD        64              // byte offset into Data Object\n\t\t\t\t\t// * Presentation Time          QWORD        64              // in 100-nanosecond units\n\t\t\t\t\t// * Entry Length               WORD         16              // length in bytes of (Send Time + Flags + Marker Description Length + Marker Description + Padding)\n\t\t\t\t\t// * Send Time                  DWORD        32              // in milliseconds\n\t\t\t\t\t// * Flags                      DWORD        32              // hardcoded: 0x00000000\n\t\t\t\t\t// * Marker Description Length  DWORD        32              // number of bytes in Marker Description field\n\t\t\t\t\t// * Marker Description         WCHAR        variable        // array of Unicode characters - description of marker entry\n\t\t\t\t\t// * Padding                    BYTESTREAM   variable        // optional padding bytes\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_asf['marker_object'] = array();\n\t\t\t\t\t$thisfile_asf_markerobject     = &$thisfile_asf['marker_object'];\n\n\t\t\t\t\t$thisfile_asf_markerobject['offset']               = $NextObjectOffset + $offset;\n\t\t\t\t\t$thisfile_asf_markerobject['objectid']             = $NextObjectGUID;\n\t\t\t\t\t$thisfile_asf_markerobject['objectid_guid']        = $NextObjectGUIDtext;\n\t\t\t\t\t$thisfile_asf_markerobject['objectsize']           = $NextObjectSize;\n\t\t\t\t\t$thisfile_asf_markerobject['reserved']             = substr($ASFHeaderData, $offset, 16);\n\t\t\t\t\t$offset += 16;\n\t\t\t\t\t$thisfile_asf_markerobject['reserved_guid']        = $this->BytestringToGUID($thisfile_asf_markerobject['reserved']);\n\t\t\t\t\tif ($thisfile_asf_markerobject['reserved'] != $this->GUIDtoBytestring('4CFEDB20-75F6-11CF-9C0F-00A0C90349CB')) {\n\t\t\t\t\t\t$this->warning('marker_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_markerobject['reserved_1']).'} does not match expected \"GETID3_ASF_Reserved_1\" GUID {4CFEDB20-75F6-11CF-9C0F-00A0C90349CB}');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_asf_markerobject['markers_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\t\t\t\t\t$thisfile_asf_markerobject['reserved_2'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\tif ($thisfile_asf_markerobject['reserved_2'] != 0) {\n\t\t\t\t\t\t$this->warning('marker_object.reserved_2 ('.getid3_lib::PrintHexBytes($thisfile_asf_markerobject['reserved_2']).') does not match expected value of \"0\"');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_asf_markerobject['name_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\t$thisfile_asf_markerobject['name'] = substr($ASFHeaderData, $offset, $thisfile_asf_markerobject['name_length']);\n\t\t\t\t\t$offset += $thisfile_asf_markerobject['name_length'];\n\t\t\t\t\tfor ($MarkersCounter = 0; $MarkersCounter < $thisfile_asf_markerobject['markers_count']; $MarkersCounter++) {\n\t\t\t\t\t\t$thisfile_asf_markerobject['markers'][$MarkersCounter]['offset']  = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));\n\t\t\t\t\t\t$offset += 8;\n\t\t\t\t\t\t$thisfile_asf_markerobject['markers'][$MarkersCounter]['presentation_time']         = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));\n\t\t\t\t\t\t$offset += 8;\n\t\t\t\t\t\t$thisfile_asf_markerobject['markers'][$MarkersCounter]['entry_length']              = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$thisfile_asf_markerobject['markers'][$MarkersCounter]['send_time']                 = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));\n\t\t\t\t\t\t$offset += 4;\n\t\t\t\t\t\t$thisfile_asf_markerobject['markers'][$MarkersCounter]['flags']                     = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));\n\t\t\t\t\t\t$offset += 4;\n\t\t\t\t\t\t$thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));\n\t\t\t\t\t\t$offset += 4;\n\t\t\t\t\t\t$thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description']        = substr($ASFHeaderData, $offset, $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description_length']);\n\t\t\t\t\t\t$offset += $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description_length'];\n\t\t\t\t\t\t$PaddingLength = $thisfile_asf_markerobject['markers'][$MarkersCounter]['entry_length'] - 4 -  4 - 4 - $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description_length'];\n\t\t\t\t\t\tif ($PaddingLength > 0) {\n\t\t\t\t\t\t\t$thisfile_asf_markerobject['markers'][$MarkersCounter]['padding']               = substr($ASFHeaderData, $offset, $PaddingLength);\n\t\t\t\t\t\t\t$offset += $PaddingLength;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Bitrate_Mutual_Exclusion_Object:\n\t\t\t\t\t// Bitrate Mutual Exclusion Object: (optional)\n\t\t\t\t\t// Field Name                   Field Type   Size (bits)\n\t\t\t\t\t// Object ID                    GUID         128             // GUID for Bitrate Mutual Exclusion object - GETID3_ASF_Bitrate_Mutual_Exclusion_Object\n\t\t\t\t\t// Object Size                  QWORD        64              // size of Bitrate Mutual Exclusion object, including 42 bytes of Bitrate Mutual Exclusion Object header\n\t\t\t\t\t// Exlusion Type                GUID         128             // nature of mutual exclusion relationship. one of: (GETID3_ASF_Mutex_Bitrate, GETID3_ASF_Mutex_Unknown)\n\t\t\t\t\t// Stream Numbers Count         WORD         16              // number of video streams\n\t\t\t\t\t// Stream Numbers               WORD         variable        // array of mutually exclusive video stream numbers. 1 <= valid <= 127\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_asf['bitrate_mutual_exclusion_object'] = array();\n\t\t\t\t\t$thisfile_asf_bitratemutualexclusionobject       = &$thisfile_asf['bitrate_mutual_exclusion_object'];\n\n\t\t\t\t\t$thisfile_asf_bitratemutualexclusionobject['offset']               = $NextObjectOffset + $offset;\n\t\t\t\t\t$thisfile_asf_bitratemutualexclusionobject['objectid']             = $NextObjectGUID;\n\t\t\t\t\t$thisfile_asf_bitratemutualexclusionobject['objectid_guid']        = $NextObjectGUIDtext;\n\t\t\t\t\t$thisfile_asf_bitratemutualexclusionobject['objectsize']           = $NextObjectSize;\n\t\t\t\t\t$thisfile_asf_bitratemutualexclusionobject['reserved']             = substr($ASFHeaderData, $offset, 16);\n\t\t\t\t\t$thisfile_asf_bitratemutualexclusionobject['reserved_guid']        = $this->BytestringToGUID($thisfile_asf_bitratemutualexclusionobject['reserved']);\n\t\t\t\t\t$offset += 16;\n\t\t\t\t\tif (($thisfile_asf_bitratemutualexclusionobject['reserved'] != GETID3_ASF_Mutex_Bitrate) && ($thisfile_asf_bitratemutualexclusionobject['reserved'] != GETID3_ASF_Mutex_Unknown)) {\n\t\t\t\t\t\t$this->warning('bitrate_mutual_exclusion_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_bitratemutualexclusionobject['reserved']).'} does not match expected \"GETID3_ASF_Mutex_Bitrate\" GUID {'.$this->BytestringToGUID(GETID3_ASF_Mutex_Bitrate).'} or  \"GETID3_ASF_Mutex_Unknown\" GUID {'.$this->BytestringToGUID(GETID3_ASF_Mutex_Unknown).'}');\n\t\t\t\t\t\t//return false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_asf_bitratemutualexclusionobject['stream_numbers_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\tfor ($StreamNumberCounter = 0; $StreamNumberCounter < $thisfile_asf_bitratemutualexclusionobject['stream_numbers_count']; $StreamNumberCounter++) {\n\t\t\t\t\t\t$thisfile_asf_bitratemutualexclusionobject['stream_numbers'][$StreamNumberCounter] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Error_Correction_Object:\n\t\t\t\t\t// Error Correction Object: (optional, one only)\n\t\t\t\t\t// Field Name                   Field Type   Size (bits)\n\t\t\t\t\t// Object ID                    GUID         128             // GUID for Error Correction object - GETID3_ASF_Error_Correction_Object\n\t\t\t\t\t// Object Size                  QWORD        64              // size of Error Correction object, including 44 bytes of Error Correction Object header\n\t\t\t\t\t// Error Correction Type        GUID         128             // type of error correction. one of: (GETID3_ASF_No_Error_Correction, GETID3_ASF_Audio_Spread)\n\t\t\t\t\t// Error Correction Data Length DWORD        32              // number of bytes in Error Correction Data field\n\t\t\t\t\t// Error Correction Data        BYTESTREAM   variable        // structure depends on value of Error Correction Type field\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_asf['error_correction_object'] = array();\n\t\t\t\t\t$thisfile_asf_errorcorrectionobject      = &$thisfile_asf['error_correction_object'];\n\n\t\t\t\t\t$thisfile_asf_errorcorrectionobject['offset']                = $NextObjectOffset + $offset;\n\t\t\t\t\t$thisfile_asf_errorcorrectionobject['objectid']              = $NextObjectGUID;\n\t\t\t\t\t$thisfile_asf_errorcorrectionobject['objectid_guid']         = $NextObjectGUIDtext;\n\t\t\t\t\t$thisfile_asf_errorcorrectionobject['objectsize']            = $NextObjectSize;\n\t\t\t\t\t$thisfile_asf_errorcorrectionobject['error_correction_type'] = substr($ASFHeaderData, $offset, 16);\n\t\t\t\t\t$offset += 16;\n\t\t\t\t\t$thisfile_asf_errorcorrectionobject['error_correction_guid'] = $this->BytestringToGUID($thisfile_asf_errorcorrectionobject['error_correction_type']);\n\t\t\t\t\t$thisfile_asf_errorcorrectionobject['error_correction_data_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\t\t\t\t\tswitch ($thisfile_asf_errorcorrectionobject['error_correction_type']) {\n\t\t\t\t\t\tcase GETID3_ASF_No_Error_Correction:\n\t\t\t\t\t\t\t// should be no data, but just in case there is, skip to the end of the field\n\t\t\t\t\t\t\t$offset += $thisfile_asf_errorcorrectionobject['error_correction_data_length'];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase GETID3_ASF_Audio_Spread:\n\t\t\t\t\t\t\t// Field Name                   Field Type   Size (bits)\n\t\t\t\t\t\t\t// Span                         BYTE         8               // number of packets over which audio will be spread.\n\t\t\t\t\t\t\t// Virtual Packet Length        WORD         16              // size of largest audio payload found in audio stream\n\t\t\t\t\t\t\t// Virtual Chunk Length         WORD         16              // size of largest audio payload found in audio stream\n\t\t\t\t\t\t\t// Silence Data Length          WORD         16              // number of bytes in Silence Data field\n\t\t\t\t\t\t\t// Silence Data                 BYTESTREAM   variable        // hardcoded: 0x00 * (Silence Data Length) bytes\n\n\t\t\t\t\t\t\t$thisfile_asf_errorcorrectionobject['span']                  = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 1));\n\t\t\t\t\t\t\t$offset += 1;\n\t\t\t\t\t\t\t$thisfile_asf_errorcorrectionobject['virtual_packet_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t\t$thisfile_asf_errorcorrectionobject['virtual_chunk_length']  = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t\t$thisfile_asf_errorcorrectionobject['silence_data_length']   = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t\t$thisfile_asf_errorcorrectionobject['silence_data']          = substr($ASFHeaderData, $offset, $thisfile_asf_errorcorrectionobject['silence_data_length']);\n\t\t\t\t\t\t\t$offset += $thisfile_asf_errorcorrectionobject['silence_data_length'];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$this->warning('error_correction_object.error_correction_type GUID {'.$this->BytestringToGUID($thisfile_asf_errorcorrectionobject['reserved']).'} does not match expected \"GETID3_ASF_No_Error_Correction\" GUID {'.$this->BytestringToGUID(GETID3_ASF_No_Error_Correction).'} or  \"GETID3_ASF_Audio_Spread\" GUID {'.$this->BytestringToGUID(GETID3_ASF_Audio_Spread).'}');\n\t\t\t\t\t\t\t//return false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Content_Description_Object:\n\t\t\t\t\t// Content Description Object: (optional, one only)\n\t\t\t\t\t// Field Name                   Field Type   Size (bits)\n\t\t\t\t\t// Object ID                    GUID         128             // GUID for Content Description object - GETID3_ASF_Content_Description_Object\n\t\t\t\t\t// Object Size                  QWORD        64              // size of Content Description object, including 34 bytes of Content Description Object header\n\t\t\t\t\t// Title Length                 WORD         16              // number of bytes in Title field\n\t\t\t\t\t// Author Length                WORD         16              // number of bytes in Author field\n\t\t\t\t\t// Copyright Length             WORD         16              // number of bytes in Copyright field\n\t\t\t\t\t// Description Length           WORD         16              // number of bytes in Description field\n\t\t\t\t\t// Rating Length                WORD         16              // number of bytes in Rating field\n\t\t\t\t\t// Title                        WCHAR        16              // array of Unicode characters - Title\n\t\t\t\t\t// Author                       WCHAR        16              // array of Unicode characters - Author\n\t\t\t\t\t// Copyright                    WCHAR        16              // array of Unicode characters - Copyright\n\t\t\t\t\t// Description                  WCHAR        16              // array of Unicode characters - Description\n\t\t\t\t\t// Rating                       WCHAR        16              // array of Unicode characters - Rating\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_asf['content_description_object'] = array();\n\t\t\t\t\t$thisfile_asf_contentdescriptionobject      = &$thisfile_asf['content_description_object'];\n\n\t\t\t\t\t$thisfile_asf_contentdescriptionobject['offset']                = $NextObjectOffset + $offset;\n\t\t\t\t\t$thisfile_asf_contentdescriptionobject['objectid']              = $NextObjectGUID;\n\t\t\t\t\t$thisfile_asf_contentdescriptionobject['objectid_guid']         = $NextObjectGUIDtext;\n\t\t\t\t\t$thisfile_asf_contentdescriptionobject['objectsize']            = $NextObjectSize;\n\t\t\t\t\t$thisfile_asf_contentdescriptionobject['title_length']          = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\t$thisfile_asf_contentdescriptionobject['author_length']         = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\t$thisfile_asf_contentdescriptionobject['copyright_length']      = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\t$thisfile_asf_contentdescriptionobject['description_length']    = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\t$thisfile_asf_contentdescriptionobject['rating_length']         = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\t$thisfile_asf_contentdescriptionobject['title']                 = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['title_length']);\n\t\t\t\t\t$offset += $thisfile_asf_contentdescriptionobject['title_length'];\n\t\t\t\t\t$thisfile_asf_contentdescriptionobject['author']                = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['author_length']);\n\t\t\t\t\t$offset += $thisfile_asf_contentdescriptionobject['author_length'];\n\t\t\t\t\t$thisfile_asf_contentdescriptionobject['copyright']             = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['copyright_length']);\n\t\t\t\t\t$offset += $thisfile_asf_contentdescriptionobject['copyright_length'];\n\t\t\t\t\t$thisfile_asf_contentdescriptionobject['description']           = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['description_length']);\n\t\t\t\t\t$offset += $thisfile_asf_contentdescriptionobject['description_length'];\n\t\t\t\t\t$thisfile_asf_contentdescriptionobject['rating']                = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['rating_length']);\n\t\t\t\t\t$offset += $thisfile_asf_contentdescriptionobject['rating_length'];\n\n\t\t\t\t\t$ASFcommentKeysToCopy = array('title'=>'title', 'author'=>'artist', 'copyright'=>'copyright', 'description'=>'comment', 'rating'=>'rating');\n\t\t\t\t\tforeach ($ASFcommentKeysToCopy as $keytocopyfrom => $keytocopyto) {\n\t\t\t\t\t\tif (!empty($thisfile_asf_contentdescriptionobject[$keytocopyfrom])) {\n\t\t\t\t\t\t\t$thisfile_asf_comments[$keytocopyto][] = $this->TrimTerm($thisfile_asf_contentdescriptionobject[$keytocopyfrom]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Extended_Content_Description_Object:\n\t\t\t\t\t// Extended Content Description Object: (optional, one only)\n\t\t\t\t\t// Field Name                   Field Type   Size (bits)\n\t\t\t\t\t// Object ID                    GUID         128             // GUID for Extended Content Description object - GETID3_ASF_Extended_Content_Description_Object\n\t\t\t\t\t// Object Size                  QWORD        64              // size of ExtendedContent Description object, including 26 bytes of Extended Content Description Object header\n\t\t\t\t\t// Content Descriptors Count    WORD         16              // number of entries in Content Descriptors list\n\t\t\t\t\t// Content Descriptors          array of:    variable        //\n\t\t\t\t\t// * Descriptor Name Length     WORD         16              // size in bytes of Descriptor Name field\n\t\t\t\t\t// * Descriptor Name            WCHAR        variable        // array of Unicode characters - Descriptor Name\n\t\t\t\t\t// * Descriptor Value Data Type WORD         16              // Lookup array:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 0x0000 = Unicode String (variable length)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 0x0001 = BYTE array     (variable length)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 0x0002 = BOOL           (DWORD, 32 bits)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 0x0003 = DWORD          (DWORD, 32 bits)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 0x0004 = QWORD          (QWORD, 64 bits)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 0x0005 = WORD           (WORD,  16 bits)\n\t\t\t\t\t// * Descriptor Value Length    WORD         16              // number of bytes stored in Descriptor Value field\n\t\t\t\t\t// * Descriptor Value           variable     variable        // value for Content Descriptor\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_asf['extended_content_description_object'] = array();\n\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject       = &$thisfile_asf['extended_content_description_object'];\n\n\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject['offset']                    = $NextObjectOffset + $offset;\n\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject['objectid']                  = $NextObjectGUID;\n\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject['objectid_guid']             = $NextObjectGUIDtext;\n\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject['objectsize']                = $NextObjectSize;\n\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject['content_descriptors_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\tfor ($ExtendedContentDescriptorsCounter = 0; $ExtendedContentDescriptorsCounter < $thisfile_asf_extendedcontentdescriptionobject['content_descriptors_count']; $ExtendedContentDescriptorsCounter++) {\n\t\t\t\t\t\t// shortcut\n\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject['content_descriptors'][$ExtendedContentDescriptorsCounter] = array();\n\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current                 = &$thisfile_asf_extendedcontentdescriptionobject['content_descriptors'][$ExtendedContentDescriptorsCounter];\n\n\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['base_offset']  = $offset + 30;\n\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name_length']  = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name']         = substr($ASFHeaderData, $offset, $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name_length']);\n\t\t\t\t\t\t$offset += $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name_length'];\n\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type']   = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']        = substr($ASFHeaderData, $offset, $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_length']);\n\t\t\t\t\t\t$offset += $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_length'];\n\t\t\t\t\t\tswitch ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type']) {\n\t\t\t\t\t\t\tcase 0x0000: // Unicode string\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 0x0001: // BYTE array\n\t\t\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 0x0002: // BOOL\n\t\t\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'] = (bool) getid3_lib::LittleEndian2Int($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 0x0003: // DWORD\n\t\t\t\t\t\t\tcase 0x0004: // QWORD\n\t\t\t\t\t\t\tcase 0x0005: // WORD\n\t\t\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'] = getid3_lib::LittleEndian2Int($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$this->warning('extended_content_description.content_descriptors.'.$ExtendedContentDescriptorsCounter.'.value_type is invalid ('.$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type'].')');\n\t\t\t\t\t\t\t\t//return false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tswitch ($this->TrimConvert(strtolower($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name']))) {\n\n\t\t\t\t\t\t\tcase 'wm/albumartist':\n\t\t\t\t\t\t\tcase 'artist':\n\t\t\t\t\t\t\t\t// Note: not 'artist', that comes from 'author' tag\n\t\t\t\t\t\t\t\t$thisfile_asf_comments['albumartist'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'wm/albumtitle':\n\t\t\t\t\t\t\tcase 'album':\n\t\t\t\t\t\t\t\t$thisfile_asf_comments['album']  = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'wm/genre':\n\t\t\t\t\t\t\tcase 'genre':\n\t\t\t\t\t\t\t\t$thisfile_asf_comments['genre'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'wm/partofset':\n\t\t\t\t\t\t\t\t$thisfile_asf_comments['partofset'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'wm/tracknumber':\n\t\t\t\t\t\t\tcase 'tracknumber':\n\t\t\t\t\t\t\t\t// be careful casting to int: casting unicode strings to int gives unexpected results (stops parsing at first non-numeric character)\n\t\t\t\t\t\t\t\t$thisfile_asf_comments['track_number'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));\n\t\t\t\t\t\t\t\tforeach ($thisfile_asf_comments['track_number'] as $key => $value) {\n\t\t\t\t\t\t\t\t\tif (preg_match('/^[0-9\\x00]+$/', $value)) {\n\t\t\t\t\t\t\t\t\t\t$thisfile_asf_comments['track_number'][$key] = intval(str_replace(\"\\x00\", '', $value));\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\tbreak;\n\n\t\t\t\t\t\t\tcase 'wm/track':\n\t\t\t\t\t\t\t\tif (empty($thisfile_asf_comments['track_number'])) {\n\t\t\t\t\t\t\t\t\t$thisfile_asf_comments['track_number'] = array(1 + (int) $this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'wm/year':\n\t\t\t\t\t\t\tcase 'year':\n\t\t\t\t\t\t\tcase 'date':\n\t\t\t\t\t\t\t\t$thisfile_asf_comments['year'] = array( $this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'wm/lyrics':\n\t\t\t\t\t\t\tcase 'lyrics':\n\t\t\t\t\t\t\t\t$thisfile_asf_comments['lyrics'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'isvbr':\n\t\t\t\t\t\t\t\tif ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']) {\n\t\t\t\t\t\t\t\t\t$thisfile_audio['bitrate_mode'] = 'vbr';\n\t\t\t\t\t\t\t\t\t$thisfile_video['bitrate_mode'] = 'vbr';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'id3':\n\t\t\t\t\t\t\t\t$this->getid3->include_module('tag.id3v2');\n\n\t\t\t\t\t\t\t\t$getid3_id3v2 = new getid3_id3v2($this->getid3);\n\t\t\t\t\t\t\t\t$getid3_id3v2->AnalyzeString($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);\n\t\t\t\t\t\t\t\tunset($getid3_id3v2);\n\n\t\t\t\t\t\t\t\tif ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_length'] > 1024) {\n\t\t\t\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'] = '<value too large to display>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'wm/encodingtime':\n\t\t\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['encoding_time_unix'] = $this->FILETIMEtoUNIXtime($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);\n\t\t\t\t\t\t\t\t$thisfile_asf_comments['encoding_time_unix'] = array($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['encoding_time_unix']);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'wm/picture':\n\t\t\t\t\t\t\t\t$WMpicture = $this->ASF_WMpicture($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);\n\t\t\t\t\t\t\t\tforeach ($WMpicture as $key => $value) {\n\t\t\t\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current[$key] = $value;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tunset($WMpicture);\n/*\n\t\t\t\t\t\t\t\t$wm_picture_offset = 0;\n\t\t\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type_id'] = getid3_lib::LittleEndian2Int(substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 1));\n\t\t\t\t\t\t\t\t$wm_picture_offset += 1;\n\t\t\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type']    = self::WMpictureTypeLookup($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type_id']);\n\t\t\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_size']    = getid3_lib::LittleEndian2Int(substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 4));\n\t\t\t\t\t\t\t\t$wm_picture_offset += 4;\n\n\t\t\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime'] = '';\n\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\t$next_byte_pair = substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 2);\n\t\t\t\t\t\t\t\t\t$wm_picture_offset += 2;\n\t\t\t\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime'] .= $next_byte_pair;\n\t\t\t\t\t\t\t\t} while ($next_byte_pair !== \"\\x00\\x00\");\n\n\t\t\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_description'] = '';\n\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\t$next_byte_pair = substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 2);\n\t\t\t\t\t\t\t\t\t$wm_picture_offset += 2;\n\t\t\t\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_description'] .= $next_byte_pair;\n\t\t\t\t\t\t\t\t} while ($next_byte_pair !== \"\\x00\\x00\");\n\n\t\t\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['dataoffset'] = $wm_picture_offset;\n\t\t\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['data'] = substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset);\n\t\t\t\t\t\t\t\tunset($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);\n\n\t\t\t\t\t\t\t\t$imageinfo = array();\n\t\t\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime'] = '';\n\t\t\t\t\t\t\t\t$imagechunkcheck = getid3_lib::GetDataImageSize($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['data'], $imageinfo);\n\t\t\t\t\t\t\t\tunset($imageinfo);\n\t\t\t\t\t\t\t\tif (!empty($imagechunkcheck)) {\n\t\t\t\t\t\t\t\t\t$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime'] = image_type_to_mime_type($imagechunkcheck[2]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (!isset($thisfile_asf_comments['picture'])) {\n\t\t\t\t\t\t\t\t\t$thisfile_asf_comments['picture'] = array();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$thisfile_asf_comments['picture'][] = array('data'=>$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['data'], 'image_mime'=>$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime']);\n*/\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tswitch ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type']) {\n\t\t\t\t\t\t\t\t\tcase 0: // Unicode string\n\t\t\t\t\t\t\t\t\t\tif (substr($this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name']), 0, 3) == 'WM/') {\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_asf_comments[str_replace('wm/', '', strtolower($this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name'])))] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Stream_Bitrate_Properties_Object:\n\t\t\t\t\t// Stream Bitrate Properties Object: (optional, one only)\n\t\t\t\t\t// Field Name                   Field Type   Size (bits)\n\t\t\t\t\t// Object ID                    GUID         128             // GUID for Stream Bitrate Properties object - GETID3_ASF_Stream_Bitrate_Properties_Object\n\t\t\t\t\t// Object Size                  QWORD        64              // size of Extended Content Description object, including 26 bytes of Stream Bitrate Properties Object header\n\t\t\t\t\t// Bitrate Records Count        WORD         16              // number of records in Bitrate Records\n\t\t\t\t\t// Bitrate Records              array of:    variable        //\n\t\t\t\t\t// * Flags                      WORD         16              //\n\t\t\t\t\t// * * Stream Number            bits         7  (0x007F)     // number of this stream\n\t\t\t\t\t// * * Reserved                 bits         9  (0xFF80)     // hardcoded: 0\n\t\t\t\t\t// * Average Bitrate            DWORD        32              // in bits per second\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_asf['stream_bitrate_properties_object'] = array();\n\t\t\t\t\t$thisfile_asf_streambitratepropertiesobject       = &$thisfile_asf['stream_bitrate_properties_object'];\n\n\t\t\t\t\t$thisfile_asf_streambitratepropertiesobject['offset']                    = $NextObjectOffset + $offset;\n\t\t\t\t\t$thisfile_asf_streambitratepropertiesobject['objectid']                  = $NextObjectGUID;\n\t\t\t\t\t$thisfile_asf_streambitratepropertiesobject['objectid_guid']             = $NextObjectGUIDtext;\n\t\t\t\t\t$thisfile_asf_streambitratepropertiesobject['objectsize']                = $NextObjectSize;\n\t\t\t\t\t$thisfile_asf_streambitratepropertiesobject['bitrate_records_count']     = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\tfor ($BitrateRecordsCounter = 0; $BitrateRecordsCounter < $thisfile_asf_streambitratepropertiesobject['bitrate_records_count']; $BitrateRecordsCounter++) {\n\t\t\t\t\t\t$thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['flags_raw'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['flags']['stream_number'] = $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['flags_raw'] & 0x007F;\n\t\t\t\t\t\t$thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['bitrate'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));\n\t\t\t\t\t\t$offset += 4;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Padding_Object:\n\t\t\t\t\t// Padding Object: (optional)\n\t\t\t\t\t// Field Name                   Field Type   Size (bits)\n\t\t\t\t\t// Object ID                    GUID         128             // GUID for Padding object - GETID3_ASF_Padding_Object\n\t\t\t\t\t// Object Size                  QWORD        64              // size of Padding object, including 24 bytes of ASF Padding Object header\n\t\t\t\t\t// Padding Data                 BYTESTREAM   variable        // ignore\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_asf['padding_object'] = array();\n\t\t\t\t\t$thisfile_asf_paddingobject     = &$thisfile_asf['padding_object'];\n\n\t\t\t\t\t$thisfile_asf_paddingobject['offset']                    = $NextObjectOffset + $offset;\n\t\t\t\t\t$thisfile_asf_paddingobject['objectid']                  = $NextObjectGUID;\n\t\t\t\t\t$thisfile_asf_paddingobject['objectid_guid']             = $NextObjectGUIDtext;\n\t\t\t\t\t$thisfile_asf_paddingobject['objectsize']                = $NextObjectSize;\n\t\t\t\t\t$thisfile_asf_paddingobject['padding_length']            = $thisfile_asf_paddingobject['objectsize'] - 16 - 8;\n\t\t\t\t\t$thisfile_asf_paddingobject['padding']                   = substr($ASFHeaderData, $offset, $thisfile_asf_paddingobject['padding_length']);\n\t\t\t\t\t$offset += ($NextObjectSize - 16 - 8);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Extended_Content_Encryption_Object:\n\t\t\t\tcase GETID3_ASF_Content_Encryption_Object:\n\t\t\t\t\t// WMA DRM - just ignore\n\t\t\t\t\t$offset += ($NextObjectSize - 16 - 8);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t// Implementations shall ignore any standard or non-standard object that they do not know how to handle.\n\t\t\t\t\tif ($this->GUIDname($NextObjectGUIDtext)) {\n\t\t\t\t\t\t$this->warning('unhandled GUID \"'.$this->GUIDname($NextObjectGUIDtext).'\" {'.$NextObjectGUIDtext.'} in ASF header at offset '.($offset - 16 - 8));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('unknown GUID {'.$NextObjectGUIDtext.'} in ASF header at offset '.($offset - 16 - 8));\n\t\t\t\t\t}\n\t\t\t\t\t$offset += ($NextObjectSize - 16 - 8);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (isset($thisfile_asf_streambitratepropertiesobject['bitrate_records_count'])) {\n\t\t\t$ASFbitrateAudio = 0;\n\t\t\t$ASFbitrateVideo = 0;\n\t\t\tfor ($BitrateRecordsCounter = 0; $BitrateRecordsCounter < $thisfile_asf_streambitratepropertiesobject['bitrate_records_count']; $BitrateRecordsCounter++) {\n\t\t\t\tif (isset($thisfile_asf_codeclistobject['codec_entries'][$BitrateRecordsCounter])) {\n\t\t\t\t\tswitch ($thisfile_asf_codeclistobject['codec_entries'][$BitrateRecordsCounter]['type_raw']) {\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t$ASFbitrateVideo += $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['bitrate'];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t$ASFbitrateAudio += $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['bitrate'];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($ASFbitrateAudio > 0) {\n\t\t\t\t$thisfile_audio['bitrate'] = $ASFbitrateAudio;\n\t\t\t}\n\t\t\tif ($ASFbitrateVideo > 0) {\n\t\t\t\t$thisfile_video['bitrate'] = $ASFbitrateVideo;\n\t\t\t}\n\t\t}\n\t\tif (isset($thisfile_asf['stream_properties_object']) && is_array($thisfile_asf['stream_properties_object'])) {\n\n\t\t\t$thisfile_audio['bitrate'] = 0;\n\t\t\t$thisfile_video['bitrate'] = 0;\n\n\t\t\tforeach ($thisfile_asf['stream_properties_object'] as $streamnumber => $streamdata) {\n\n\t\t\t\tswitch ($streamdata['stream_type']) {\n\t\t\t\t\tcase GETID3_ASF_Audio_Media:\n\t\t\t\t\t\t// Field Name                   Field Type   Size (bits)\n\t\t\t\t\t\t// Codec ID / Format Tag        WORD         16              // unique ID of audio codec - defined as wFormatTag field of WAVEFORMATEX structure\n\t\t\t\t\t\t// Number of Channels           WORD         16              // number of channels of audio - defined as nChannels field of WAVEFORMATEX structure\n\t\t\t\t\t\t// Samples Per Second           DWORD        32              // in Hertz - defined as nSamplesPerSec field of WAVEFORMATEX structure\n\t\t\t\t\t\t// Average number of Bytes/sec  DWORD        32              // bytes/sec of audio stream  - defined as nAvgBytesPerSec field of WAVEFORMATEX structure\n\t\t\t\t\t\t// Block Alignment              WORD         16              // block size in bytes of audio codec - defined as nBlockAlign field of WAVEFORMATEX structure\n\t\t\t\t\t\t// Bits per sample              WORD         16              // bits per sample of mono data. set to zero for variable bitrate codecs. defined as wBitsPerSample field of WAVEFORMATEX structure\n\t\t\t\t\t\t// Codec Specific Data Size     WORD         16              // size in bytes of Codec Specific Data buffer - defined as cbSize field of WAVEFORMATEX structure\n\t\t\t\t\t\t// Codec Specific Data          BYTESTREAM   variable        // array of codec-specific data bytes\n\n\t\t\t\t\t\t// shortcut\n\t\t\t\t\t\t$thisfile_asf['audio_media'][$streamnumber] = array();\n\t\t\t\t\t\t$thisfile_asf_audiomedia_currentstream      = &$thisfile_asf['audio_media'][$streamnumber];\n\n\t\t\t\t\t\t$audiomediaoffset = 0;\n\n\t\t\t\t\t\t$thisfile_asf_audiomedia_currentstream = getid3_riff::parseWAVEFORMATex(substr($streamdata['type_specific_data'], $audiomediaoffset, 16));\n\t\t\t\t\t\t$audiomediaoffset += 16;\n\n\t\t\t\t\t\t$thisfile_audio['lossless'] = false;\n\t\t\t\t\t\tswitch ($thisfile_asf_audiomedia_currentstream['raw']['wFormatTag']) {\n\t\t\t\t\t\t\tcase 0x0001: // PCM\n\t\t\t\t\t\t\tcase 0x0163: // WMA9 Lossless\n\t\t\t\t\t\t\t\t$thisfile_audio['lossless'] = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!empty($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'])) {\n\t\t\t\t\t\t\tforeach ($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'] as $dummy => $dataarray) {\n\t\t\t\t\t\t\t\tif (isset($dataarray['flags']['stream_number']) && ($dataarray['flags']['stream_number'] == $streamnumber)) {\n\t\t\t\t\t\t\t\t\t$thisfile_asf_audiomedia_currentstream['bitrate'] = $dataarray['bitrate'];\n\t\t\t\t\t\t\t\t\t$thisfile_audio['bitrate'] += $dataarray['bitrate'];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (!empty($thisfile_asf_audiomedia_currentstream['bytes_sec'])) {\n\t\t\t\t\t\t\t\t$thisfile_audio['bitrate'] += $thisfile_asf_audiomedia_currentstream['bytes_sec'] * 8;\n\t\t\t\t\t\t\t} elseif (!empty($thisfile_asf_audiomedia_currentstream['bitrate'])) {\n\t\t\t\t\t\t\t\t$thisfile_audio['bitrate'] += $thisfile_asf_audiomedia_currentstream['bitrate'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$thisfile_audio['streams'][$streamnumber]                = $thisfile_asf_audiomedia_currentstream;\n\t\t\t\t\t\t$thisfile_audio['streams'][$streamnumber]['wformattag']  = $thisfile_asf_audiomedia_currentstream['raw']['wFormatTag'];\n\t\t\t\t\t\t$thisfile_audio['streams'][$streamnumber]['lossless']    = $thisfile_audio['lossless'];\n\t\t\t\t\t\t$thisfile_audio['streams'][$streamnumber]['bitrate']     = $thisfile_audio['bitrate'];\n\t\t\t\t\t\t$thisfile_audio['streams'][$streamnumber]['dataformat']  = 'wma';\n\t\t\t\t\t\tunset($thisfile_audio['streams'][$streamnumber]['raw']);\n\n\t\t\t\t\t\t$thisfile_asf_audiomedia_currentstream['codec_data_size'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $audiomediaoffset, 2));\n\t\t\t\t\t\t$audiomediaoffset += 2;\n\t\t\t\t\t\t$thisfile_asf_audiomedia_currentstream['codec_data']      = substr($streamdata['type_specific_data'], $audiomediaoffset, $thisfile_asf_audiomedia_currentstream['codec_data_size']);\n\t\t\t\t\t\t$audiomediaoffset += $thisfile_asf_audiomedia_currentstream['codec_data_size'];\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase GETID3_ASF_Video_Media:\n\t\t\t\t\t\t// Field Name                   Field Type   Size (bits)\n\t\t\t\t\t\t// Encoded Image Width          DWORD        32              // width of image in pixels\n\t\t\t\t\t\t// Encoded Image Height         DWORD        32              // height of image in pixels\n\t\t\t\t\t\t// Reserved Flags               BYTE         8               // hardcoded: 0x02\n\t\t\t\t\t\t// Format Data Size             WORD         16              // size of Format Data field in bytes\n\t\t\t\t\t\t// Format Data                  array of:    variable        //\n\t\t\t\t\t\t// * Format Data Size           DWORD        32              // number of bytes in Format Data field, in bytes - defined as biSize field of BITMAPINFOHEADER structure\n\t\t\t\t\t\t// * Image Width                LONG         32              // width of encoded image in pixels - defined as biWidth field of BITMAPINFOHEADER structure\n\t\t\t\t\t\t// * Image Height               LONG         32              // height of encoded image in pixels - defined as biHeight field of BITMAPINFOHEADER structure\n\t\t\t\t\t\t// * Reserved                   WORD         16              // hardcoded: 0x0001 - defined as biPlanes field of BITMAPINFOHEADER structure\n\t\t\t\t\t\t// * Bits Per Pixel Count       WORD         16              // bits per pixel - defined as biBitCount field of BITMAPINFOHEADER structure\n\t\t\t\t\t\t// * Compression ID             FOURCC       32              // fourcc of video codec - defined as biCompression field of BITMAPINFOHEADER structure\n\t\t\t\t\t\t// * Image Size                 DWORD        32              // image size in bytes - defined as biSizeImage field of BITMAPINFOHEADER structure\n\t\t\t\t\t\t// * Horizontal Pixels / Meter  DWORD        32              // horizontal resolution of target device in pixels per meter - defined as biXPelsPerMeter field of BITMAPINFOHEADER structure\n\t\t\t\t\t\t// * Vertical Pixels / Meter    DWORD        32              // vertical resolution of target device in pixels per meter - defined as biYPelsPerMeter field of BITMAPINFOHEADER structure\n\t\t\t\t\t\t// * Colors Used Count          DWORD        32              // number of color indexes in the color table that are actually used - defined as biClrUsed field of BITMAPINFOHEADER structure\n\t\t\t\t\t\t// * Important Colors Count     DWORD        32              // number of color index required for displaying bitmap. if zero, all colors are required. defined as biClrImportant field of BITMAPINFOHEADER structure\n\t\t\t\t\t\t// * Codec Specific Data        BYTESTREAM   variable        // array of codec-specific data bytes\n\n\t\t\t\t\t\t// shortcut\n\t\t\t\t\t\t$thisfile_asf['video_media'][$streamnumber] = array();\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream      = &$thisfile_asf['video_media'][$streamnumber];\n\n\t\t\t\t\t\t$videomediaoffset = 0;\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['image_width']                     = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));\n\t\t\t\t\t\t$videomediaoffset += 4;\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['image_height']                    = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));\n\t\t\t\t\t\t$videomediaoffset += 4;\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['flags']                           = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 1));\n\t\t\t\t\t\t$videomediaoffset += 1;\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['format_data_size']                = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 2));\n\t\t\t\t\t\t$videomediaoffset += 2;\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['format_data']['format_data_size'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));\n\t\t\t\t\t\t$videomediaoffset += 4;\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['format_data']['image_width']      = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));\n\t\t\t\t\t\t$videomediaoffset += 4;\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['format_data']['image_height']     = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));\n\t\t\t\t\t\t$videomediaoffset += 4;\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['format_data']['reserved']         = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 2));\n\t\t\t\t\t\t$videomediaoffset += 2;\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['format_data']['bits_per_pixel']   = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 2));\n\t\t\t\t\t\t$videomediaoffset += 2;\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['format_data']['codec_fourcc']     = substr($streamdata['type_specific_data'], $videomediaoffset, 4);\n\t\t\t\t\t\t$videomediaoffset += 4;\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['format_data']['image_size']       = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));\n\t\t\t\t\t\t$videomediaoffset += 4;\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['format_data']['horizontal_pels']  = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));\n\t\t\t\t\t\t$videomediaoffset += 4;\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['format_data']['vertical_pels']    = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));\n\t\t\t\t\t\t$videomediaoffset += 4;\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['format_data']['colors_used']      = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));\n\t\t\t\t\t\t$videomediaoffset += 4;\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['format_data']['colors_important'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));\n\t\t\t\t\t\t$videomediaoffset += 4;\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['format_data']['codec_data']       = substr($streamdata['type_specific_data'], $videomediaoffset);\n\n\t\t\t\t\t\tif (!empty($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'])) {\n\t\t\t\t\t\t\tforeach ($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'] as $dummy => $dataarray) {\n\t\t\t\t\t\t\t\tif (isset($dataarray['flags']['stream_number']) && ($dataarray['flags']['stream_number'] == $streamnumber)) {\n\t\t\t\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['bitrate'] = $dataarray['bitrate'];\n\t\t\t\t\t\t\t\t\t$thisfile_video['streams'][$streamnumber]['bitrate'] = $dataarray['bitrate'];\n\t\t\t\t\t\t\t\t\t$thisfile_video['bitrate'] += $dataarray['bitrate'];\n\t\t\t\t\t\t\t\t\tbreak;\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\n\t\t\t\t\t\t$thisfile_asf_videomedia_currentstream['format_data']['codec'] = getid3_riff::fourccLookup($thisfile_asf_videomedia_currentstream['format_data']['codec_fourcc']);\n\n\t\t\t\t\t\t$thisfile_video['streams'][$streamnumber]['fourcc']          = $thisfile_asf_videomedia_currentstream['format_data']['codec_fourcc'];\n\t\t\t\t\t\t$thisfile_video['streams'][$streamnumber]['codec']           = $thisfile_asf_videomedia_currentstream['format_data']['codec'];\n\t\t\t\t\t\t$thisfile_video['streams'][$streamnumber]['resolution_x']    = $thisfile_asf_videomedia_currentstream['image_width'];\n\t\t\t\t\t\t$thisfile_video['streams'][$streamnumber]['resolution_y']    = $thisfile_asf_videomedia_currentstream['image_height'];\n\t\t\t\t\t\t$thisfile_video['streams'][$streamnumber]['bits_per_sample'] = $thisfile_asf_videomedia_currentstream['format_data']['bits_per_pixel'];\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twhile ($this->ftell() < $info['avdataend']) {\n\t\t\t$NextObjectDataHeader = $this->fread(24);\n\t\t\t$offset = 0;\n\t\t\t$NextObjectGUID = substr($NextObjectDataHeader, 0, 16);\n\t\t\t$offset += 16;\n\t\t\t$NextObjectGUIDtext = $this->BytestringToGUID($NextObjectGUID);\n\t\t\t$NextObjectSize = getid3_lib::LittleEndian2Int(substr($NextObjectDataHeader, $offset, 8));\n\t\t\t$offset += 8;\n\n\t\t\tswitch ($NextObjectGUID) {\n\t\t\t\tcase GETID3_ASF_Data_Object:\n\t\t\t\t\t// Data Object: (mandatory, one only)\n\t\t\t\t\t// Field Name                       Field Type   Size (bits)\n\t\t\t\t\t// Object ID                        GUID         128             // GUID for Data object - GETID3_ASF_Data_Object\n\t\t\t\t\t// Object Size                      QWORD        64              // size of Data object, including 50 bytes of Data Object header. may be 0 if FilePropertiesObject.BroadcastFlag == 1\n\t\t\t\t\t// File ID                          GUID         128             // unique identifier. identical to File ID field in Header Object\n\t\t\t\t\t// Total Data Packets               QWORD        64              // number of Data Packet entries in Data Object. invalid if FilePropertiesObject.BroadcastFlag == 1\n\t\t\t\t\t// Reserved                         WORD         16              // hardcoded: 0x0101\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_asf['data_object'] = array();\n\t\t\t\t\t$thisfile_asf_dataobject     = &$thisfile_asf['data_object'];\n\n\t\t\t\t\t$DataObjectData = $NextObjectDataHeader.$this->fread(50 - 24);\n\t\t\t\t\t$offset = 24;\n\n\t\t\t\t\t$thisfile_asf_dataobject['objectid']           = $NextObjectGUID;\n\t\t\t\t\t$thisfile_asf_dataobject['objectid_guid']      = $NextObjectGUIDtext;\n\t\t\t\t\t$thisfile_asf_dataobject['objectsize']         = $NextObjectSize;\n\n\t\t\t\t\t$thisfile_asf_dataobject['fileid']             = substr($DataObjectData, $offset, 16);\n\t\t\t\t\t$offset += 16;\n\t\t\t\t\t$thisfile_asf_dataobject['fileid_guid']        = $this->BytestringToGUID($thisfile_asf_dataobject['fileid']);\n\t\t\t\t\t$thisfile_asf_dataobject['total_data_packets'] = getid3_lib::LittleEndian2Int(substr($DataObjectData, $offset, 8));\n\t\t\t\t\t$offset += 8;\n\t\t\t\t\t$thisfile_asf_dataobject['reserved']           = getid3_lib::LittleEndian2Int(substr($DataObjectData, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\tif ($thisfile_asf_dataobject['reserved'] != 0x0101) {\n\t\t\t\t\t\t$this->warning('data_object.reserved ('.getid3_lib::PrintHexBytes($thisfile_asf_dataobject['reserved']).') does not match expected value of \"0x0101\"');\n\t\t\t\t\t\t//return false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Data Packets                     array of:    variable        //\n\t\t\t\t\t// * Error Correction Flags         BYTE         8               //\n\t\t\t\t\t// * * Error Correction Data Length bits         4               // if Error Correction Length Type == 00, size of Error Correction Data in bytes, else hardcoded: 0000\n\t\t\t\t\t// * * Opaque Data Present          bits         1               //\n\t\t\t\t\t// * * Error Correction Length Type bits         2               // number of bits for size of the error correction data. hardcoded: 00\n\t\t\t\t\t// * * Error Correction Present     bits         1               // If set, use Opaque Data Packet structure, else use Payload structure\n\t\t\t\t\t// * Error Correction Data\n\n\t\t\t\t\t$info['avdataoffset'] = $this->ftell();\n\t\t\t\t\t$this->fseek(($thisfile_asf_dataobject['objectsize'] - 50), SEEK_CUR); // skip actual audio/video data\n\t\t\t\t\t$info['avdataend'] = $this->ftell();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Simple_Index_Object:\n\t\t\t\t\t// Simple Index Object: (optional, recommended, one per video stream)\n\t\t\t\t\t// Field Name                       Field Type   Size (bits)\n\t\t\t\t\t// Object ID                        GUID         128             // GUID for Simple Index object - GETID3_ASF_Data_Object\n\t\t\t\t\t// Object Size                      QWORD        64              // size of Simple Index object, including 56 bytes of Simple Index Object header\n\t\t\t\t\t// File ID                          GUID         128             // unique identifier. may be zero or identical to File ID field in Data Object and Header Object\n\t\t\t\t\t// Index Entry Time Interval        QWORD        64              // interval between index entries in 100-nanosecond units\n\t\t\t\t\t// Maximum Packet Count             DWORD        32              // maximum packet count for all index entries\n\t\t\t\t\t// Index Entries Count              DWORD        32              // number of Index Entries structures\n\t\t\t\t\t// Index Entries                    array of:    variable        //\n\t\t\t\t\t// * Packet Number                  DWORD        32              // number of the Data Packet associated with this index entry\n\t\t\t\t\t// * Packet Count                   WORD         16              // number of Data Packets to sent at this index entry\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_asf['simple_index_object'] = array();\n\t\t\t\t\t$thisfile_asf_simpleindexobject      = &$thisfile_asf['simple_index_object'];\n\n\t\t\t\t\t$SimpleIndexObjectData = $NextObjectDataHeader.$this->fread(56 - 24);\n\t\t\t\t\t$offset = 24;\n\n\t\t\t\t\t$thisfile_asf_simpleindexobject['objectid']                  = $NextObjectGUID;\n\t\t\t\t\t$thisfile_asf_simpleindexobject['objectid_guid']             = $NextObjectGUIDtext;\n\t\t\t\t\t$thisfile_asf_simpleindexobject['objectsize']                = $NextObjectSize;\n\n\t\t\t\t\t$thisfile_asf_simpleindexobject['fileid']                    =                  substr($SimpleIndexObjectData, $offset, 16);\n\t\t\t\t\t$offset += 16;\n\t\t\t\t\t$thisfile_asf_simpleindexobject['fileid_guid']               = $this->BytestringToGUID($thisfile_asf_simpleindexobject['fileid']);\n\t\t\t\t\t$thisfile_asf_simpleindexobject['index_entry_time_interval'] = getid3_lib::LittleEndian2Int(substr($SimpleIndexObjectData, $offset, 8));\n\t\t\t\t\t$offset += 8;\n\t\t\t\t\t$thisfile_asf_simpleindexobject['maximum_packet_count']      = getid3_lib::LittleEndian2Int(substr($SimpleIndexObjectData, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\t\t\t\t\t$thisfile_asf_simpleindexobject['index_entries_count']       = getid3_lib::LittleEndian2Int(substr($SimpleIndexObjectData, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\n\t\t\t\t\t$IndexEntriesData = $SimpleIndexObjectData.$this->fread(6 * $thisfile_asf_simpleindexobject['index_entries_count']);\n\t\t\t\t\tfor ($IndexEntriesCounter = 0; $IndexEntriesCounter < $thisfile_asf_simpleindexobject['index_entries_count']; $IndexEntriesCounter++) {\n\t\t\t\t\t\t$thisfile_asf_simpleindexobject['index_entries'][$IndexEntriesCounter]['packet_number'] = getid3_lib::LittleEndian2Int(substr($IndexEntriesData, $offset, 4));\n\t\t\t\t\t\t$offset += 4;\n\t\t\t\t\t\t$thisfile_asf_simpleindexobject['index_entries'][$IndexEntriesCounter]['packet_count']  = getid3_lib::LittleEndian2Int(substr($IndexEntriesData, $offset, 4));\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Index_Object:\n\t\t\t\t\t// 6.2 ASF top-level Index Object (optional but recommended when appropriate, 0 or 1)\n\t\t\t\t\t// Field Name                       Field Type   Size (bits)\n\t\t\t\t\t// Object ID                        GUID         128             // GUID for the Index Object - GETID3_ASF_Index_Object\n\t\t\t\t\t// Object Size                      QWORD        64              // Specifies the size, in bytes, of the Index Object, including at least 34 bytes of Index Object header\n\t\t\t\t\t// Index Entry Time Interval        DWORD        32              // Specifies the time interval between each index entry in ms.\n\t\t\t\t\t// Index Specifiers Count           WORD         16              // Specifies the number of Index Specifiers structures in this Index Object.\n\t\t\t\t\t// Index Blocks Count               DWORD        32              // Specifies the number of Index Blocks structures in this Index Object.\n\n\t\t\t\t\t// Index Entry Time Interval        DWORD        32              // Specifies the time interval between index entries in milliseconds.  This value cannot be 0.\n\t\t\t\t\t// Index Specifiers Count           WORD         16              // Specifies the number of entries in the Index Specifiers list.  Valid values are 1 and greater.\n\t\t\t\t\t// Index Specifiers                 array of:    varies          //\n\t\t\t\t\t// * Stream Number                  WORD         16              // Specifies the stream number that the Index Specifiers refer to. Valid values are between 1 and 127.\n\t\t\t\t\t// * Index Type                     WORD         16              // Specifies Index Type values as follows:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//   1 = Nearest Past Data Packet - indexes point to the data packet whose presentation time is closest to the index entry time.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//   2 = Nearest Past Media Object - indexes point to the closest data packet containing an entire object or first fragment of an object.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//   3 = Nearest Past Cleanpoint. - indexes point to the closest data packet containing an entire object (or first fragment of an object) that has the Cleanpoint Flag set.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//   Nearest Past Cleanpoint is the most common type of index.\n\t\t\t\t\t// Index Entry Count                DWORD        32              // Specifies the number of Index Entries in the block.\n\t\t\t\t\t// * Block Positions                QWORD        varies          // Specifies a list of byte offsets of the beginnings of the blocks relative to the beginning of the first Data Packet (i.e., the beginning of the Data Object + 50 bytes). The number of entries in this list is specified by the value of the Index Specifiers Count field. The order of those byte offsets is tied to the order in which Index Specifiers are listed.\n\t\t\t\t\t// * Index Entries                  array of:    varies          //\n\t\t\t\t\t// * * Offsets                      DWORD        varies          // An offset value of 0xffffffff indicates an invalid offset value\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_asf['asf_index_object'] = array();\n\t\t\t\t\t$thisfile_asf_asfindexobject      = &$thisfile_asf['asf_index_object'];\n\n\t\t\t\t\t$ASFIndexObjectData = $NextObjectDataHeader.$this->fread(34 - 24);\n\t\t\t\t\t$offset = 24;\n\n\t\t\t\t\t$thisfile_asf_asfindexobject['objectid']                  = $NextObjectGUID;\n\t\t\t\t\t$thisfile_asf_asfindexobject['objectid_guid']             = $NextObjectGUIDtext;\n\t\t\t\t\t$thisfile_asf_asfindexobject['objectsize']                = $NextObjectSize;\n\n\t\t\t\t\t$thisfile_asf_asfindexobject['entry_time_interval']       = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\t\t\t\t\t$thisfile_asf_asfindexobject['index_specifiers_count']    = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\t$thisfile_asf_asfindexobject['index_blocks_count']        = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\n\t\t\t\t\t$ASFIndexObjectData .= $this->fread(4 * $thisfile_asf_asfindexobject['index_specifiers_count']);\n\t\t\t\t\tfor ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) {\n\t\t\t\t\t\t$IndexSpecifierStreamNumber = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 2));\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['stream_number']   = $IndexSpecifierStreamNumber;\n\t\t\t\t\t\t$thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['index_type']      = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 2));\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['index_type_text'] = $this->ASFIndexObjectIndexTypeLookup($thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['index_type']);\n\t\t\t\t\t}\n\n\t\t\t\t\t$ASFIndexObjectData .= $this->fread(4);\n\t\t\t\t\t$thisfile_asf_asfindexobject['index_entry_count'] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4));\n\t\t\t\t\t$offset += 4;\n\n\t\t\t\t\t$ASFIndexObjectData .= $this->fread(8 * $thisfile_asf_asfindexobject['index_specifiers_count']);\n\t\t\t\t\tfor ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) {\n\t\t\t\t\t\t$thisfile_asf_asfindexobject['block_positions'][$IndexSpecifiersCounter] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 8));\n\t\t\t\t\t\t$offset += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\t$ASFIndexObjectData .= $this->fread(4 * $thisfile_asf_asfindexobject['index_specifiers_count'] * $thisfile_asf_asfindexobject['index_entry_count']);\n\t\t\t\t\tfor ($IndexEntryCounter = 0; $IndexEntryCounter < $thisfile_asf_asfindexobject['index_entry_count']; $IndexEntryCounter++) {\n\t\t\t\t\t\tfor ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) {\n\t\t\t\t\t\t\t$thisfile_asf_asfindexobject['offsets'][$IndexSpecifiersCounter][$IndexEntryCounter] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4));\n\t\t\t\t\t\t\t$offset += 4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tdefault:\n\t\t\t\t\t// Implementations shall ignore any standard or non-standard object that they do not know how to handle.\n\t\t\t\t\tif ($this->GUIDname($NextObjectGUIDtext)) {\n\t\t\t\t\t\t$this->warning('unhandled GUID \"'.$this->GUIDname($NextObjectGUIDtext).'\" {'.$NextObjectGUIDtext.'} in ASF body at offset '.($offset - 16 - 8));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('unknown GUID {'.$NextObjectGUIDtext.'} in ASF body at offset '.($this->ftell() - 16 - 8));\n\t\t\t\t\t}\n\t\t\t\t\t$this->fseek(($NextObjectSize - 16 - 8), SEEK_CUR);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (isset($thisfile_asf_codeclistobject['codec_entries']) && is_array($thisfile_asf_codeclistobject['codec_entries'])) {\n\t\t\tforeach ($thisfile_asf_codeclistobject['codec_entries'] as $streamnumber => $streamdata) {\n\t\t\t\tswitch ($streamdata['information']) {\n\t\t\t\t\tcase 'WMV1':\n\t\t\t\t\tcase 'WMV2':\n\t\t\t\t\tcase 'WMV3':\n\t\t\t\t\tcase 'MSS1':\n\t\t\t\t\tcase 'MSS2':\n\t\t\t\t\tcase 'WMVA':\n\t\t\t\t\tcase 'WVC1':\n\t\t\t\t\tcase 'WMVP':\n\t\t\t\t\tcase 'WVP2':\n\t\t\t\t\t\t$thisfile_video['dataformat'] = 'wmv';\n\t\t\t\t\t\t$info['mime_type'] = 'video/x-ms-wmv';\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'MP42':\n\t\t\t\t\tcase 'MP43':\n\t\t\t\t\tcase 'MP4S':\n\t\t\t\t\tcase 'mp4s':\n\t\t\t\t\t\t$thisfile_video['dataformat'] = 'asf';\n\t\t\t\t\t\t$info['mime_type'] = 'video/x-ms-asf';\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tswitch ($streamdata['type_raw']) {\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\tif (strstr($this->TrimConvert($streamdata['name']), 'Windows Media')) {\n\t\t\t\t\t\t\t\t\t$thisfile_video['dataformat'] = 'wmv';\n\t\t\t\t\t\t\t\t\tif ($info['mime_type'] == 'video/x-ms-asf') {\n\t\t\t\t\t\t\t\t\t\t$info['mime_type'] = 'video/x-ms-wmv';\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\tbreak;\n\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tif (strstr($this->TrimConvert($streamdata['name']), 'Windows Media')) {\n\t\t\t\t\t\t\t\t\t$thisfile_audio['dataformat'] = 'wma';\n\t\t\t\t\t\t\t\t\tif ($info['mime_type'] == 'video/x-ms-asf') {\n\t\t\t\t\t\t\t\t\t\t$info['mime_type'] = 'audio/x-ms-wma';\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\tbreak;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tswitch (isset($thisfile_audio['codec']) ? $thisfile_audio['codec'] : '') {\n\t\t\tcase 'MPEG Layer-3':\n\t\t\t\t$thisfile_audio['dataformat'] = 'mp3';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (isset($thisfile_asf_codeclistobject['codec_entries'])) {\n\t\t\tforeach ($thisfile_asf_codeclistobject['codec_entries'] as $streamnumber => $streamdata) {\n\t\t\t\tswitch ($streamdata['type_raw']) {\n\n\t\t\t\t\tcase 1: // video\n\t\t\t\t\t\t$thisfile_video['encoder'] = $this->TrimConvert($thisfile_asf_codeclistobject['codec_entries'][$streamnumber]['name']);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 2: // audio\n\t\t\t\t\t\t$thisfile_audio['encoder'] = $this->TrimConvert($thisfile_asf_codeclistobject['codec_entries'][$streamnumber]['name']);\n\n\t\t\t\t\t\t// AH 2003-10-01\n\t\t\t\t\t\t$thisfile_audio['encoder_options'] = $this->TrimConvert($thisfile_asf_codeclistobject['codec_entries'][0]['description']);\n\n\t\t\t\t\t\t$thisfile_audio['codec']   = $thisfile_audio['encoder'];\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$this->warning('Unknown streamtype: [codec_list_object][codec_entries]['.$streamnumber.'][type_raw] == '.$streamdata['type_raw']);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (isset($info['audio'])) {\n\t\t\t$thisfile_audio['lossless']           = (isset($thisfile_audio['lossless'])           ? $thisfile_audio['lossless']           : false);\n\t\t\t$thisfile_audio['dataformat']         = (!empty($thisfile_audio['dataformat'])        ? $thisfile_audio['dataformat']         : 'asf');\n\t\t}\n\t\tif (!empty($thisfile_video['dataformat'])) {\n\t\t\t$thisfile_video['lossless']           = (isset($thisfile_audio['lossless'])           ? $thisfile_audio['lossless']           : false);\n\t\t\t$thisfile_video['pixel_aspect_ratio'] = (isset($thisfile_audio['pixel_aspect_ratio']) ? $thisfile_audio['pixel_aspect_ratio'] : (float) 1);\n\t\t\t$thisfile_video['dataformat']         = (!empty($thisfile_video['dataformat'])        ? $thisfile_video['dataformat']         : 'asf');\n\t\t}\n\t\tif (!empty($thisfile_video['streams'])) {\n\t\t\t$thisfile_video['resolution_x'] = 0;\n\t\t\t$thisfile_video['resolution_y'] = 0;\n\t\t\tforeach ($thisfile_video['streams'] as $key => $valuearray) {\n\t\t\t\tif (($valuearray['resolution_x'] > $thisfile_video['resolution_x']) || ($valuearray['resolution_y'] > $thisfile_video['resolution_y'])) {\n\t\t\t\t\t$thisfile_video['resolution_x'] = $valuearray['resolution_x'];\n\t\t\t\t\t$thisfile_video['resolution_y'] = $valuearray['resolution_y'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$info['bitrate'] = (isset($thisfile_audio['bitrate']) ? $thisfile_audio['bitrate'] : 0) + (isset($thisfile_video['bitrate']) ? $thisfile_video['bitrate'] : 0);\n\n\t\tif ((!isset($info['playtime_seconds']) || ($info['playtime_seconds'] <= 0)) && ($info['bitrate'] > 0)) {\n\t\t\t$info['playtime_seconds'] = ($info['filesize'] - $info['avdataoffset']) / ($info['bitrate'] / 8);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param int $CodecListType\n\t *\n\t * @return string\n\t */\n\tpublic static function codecListObjectTypeLookup($CodecListType) {\n\t\tstatic $lookup = array(\n\t\t\t0x0001 => 'Video Codec',\n\t\t\t0x0002 => 'Audio Codec',\n\t\t\t0xFFFF => 'Unknown Codec'\n\t\t);\n\n\t\treturn (isset($lookup[$CodecListType]) ? $lookup[$CodecListType] : 'Invalid Codec Type');\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic static function KnownGUIDs() {\n\t\tstatic $GUIDarray = array(\n\t\t\t'GETID3_ASF_Extended_Stream_Properties_Object'   => '14E6A5CB-C672-4332-8399-A96952065B5A',\n\t\t\t'GETID3_ASF_Padding_Object'                      => '1806D474-CADF-4509-A4BA-9AABCB96AAE8',\n\t\t\t'GETID3_ASF_Payload_Ext_Syst_Pixel_Aspect_Ratio' => '1B1EE554-F9EA-4BC8-821A-376B74E4C4B8',\n\t\t\t'GETID3_ASF_Script_Command_Object'               => '1EFB1A30-0B62-11D0-A39B-00A0C90348F6',\n\t\t\t'GETID3_ASF_No_Error_Correction'                 => '20FB5700-5B55-11CF-A8FD-00805F5C442B',\n\t\t\t'GETID3_ASF_Content_Branding_Object'             => '2211B3FA-BD23-11D2-B4B7-00A0C955FC6E',\n\t\t\t'GETID3_ASF_Content_Encryption_Object'           => '2211B3FB-BD23-11D2-B4B7-00A0C955FC6E',\n\t\t\t'GETID3_ASF_Digital_Signature_Object'            => '2211B3FC-BD23-11D2-B4B7-00A0C955FC6E',\n\t\t\t'GETID3_ASF_Extended_Content_Encryption_Object'  => '298AE614-2622-4C17-B935-DAE07EE9289C',\n\t\t\t'GETID3_ASF_Simple_Index_Object'                 => '33000890-E5B1-11CF-89F4-00A0C90349CB',\n\t\t\t'GETID3_ASF_Degradable_JPEG_Media'               => '35907DE0-E415-11CF-A917-00805F5C442B',\n\t\t\t'GETID3_ASF_Payload_Extension_System_Timecode'   => '399595EC-8667-4E2D-8FDB-98814CE76C1E',\n\t\t\t'GETID3_ASF_Binary_Media'                        => '3AFB65E2-47EF-40F2-AC2C-70A90D71D343',\n\t\t\t'GETID3_ASF_Timecode_Index_Object'               => '3CB73FD0-0C4A-4803-953D-EDF7B6228F0C',\n\t\t\t'GETID3_ASF_Metadata_Library_Object'             => '44231C94-9498-49D1-A141-1D134E457054',\n\t\t\t'GETID3_ASF_Reserved_3'                          => '4B1ACBE3-100B-11D0-A39B-00A0C90348F6',\n\t\t\t'GETID3_ASF_Reserved_4'                          => '4CFEDB20-75F6-11CF-9C0F-00A0C90349CB',\n\t\t\t'GETID3_ASF_Command_Media'                       => '59DACFC0-59E6-11D0-A3AC-00A0C90348F6',\n\t\t\t'GETID3_ASF_Header_Extension_Object'             => '5FBF03B5-A92E-11CF-8EE3-00C00C205365',\n\t\t\t'GETID3_ASF_Media_Object_Index_Parameters_Obj'   => '6B203BAD-3F11-4E84-ACA8-D7613DE2CFA7',\n\t\t\t'GETID3_ASF_Header_Object'                       => '75B22630-668E-11CF-A6D9-00AA0062CE6C',\n\t\t\t'GETID3_ASF_Content_Description_Object'          => '75B22633-668E-11CF-A6D9-00AA0062CE6C',\n\t\t\t'GETID3_ASF_Error_Correction_Object'             => '75B22635-668E-11CF-A6D9-00AA0062CE6C',\n\t\t\t'GETID3_ASF_Data_Object'                         => '75B22636-668E-11CF-A6D9-00AA0062CE6C',\n\t\t\t'GETID3_ASF_Web_Stream_Media_Subtype'            => '776257D4-C627-41CB-8F81-7AC7FF1C40CC',\n\t\t\t'GETID3_ASF_Stream_Bitrate_Properties_Object'    => '7BF875CE-468D-11D1-8D82-006097C9A2B2',\n\t\t\t'GETID3_ASF_Language_List_Object'                => '7C4346A9-EFE0-4BFC-B229-393EDE415C85',\n\t\t\t'GETID3_ASF_Codec_List_Object'                   => '86D15240-311D-11D0-A3A4-00A0C90348F6',\n\t\t\t'GETID3_ASF_Reserved_2'                          => '86D15241-311D-11D0-A3A4-00A0C90348F6',\n\t\t\t'GETID3_ASF_File_Properties_Object'              => '8CABDCA1-A947-11CF-8EE4-00C00C205365',\n\t\t\t'GETID3_ASF_File_Transfer_Media'                 => '91BD222C-F21C-497A-8B6D-5AA86BFC0185',\n\t\t\t'GETID3_ASF_Old_RTP_Extension_Data'              => '96800C63-4C94-11D1-837B-0080C7A37F95',\n\t\t\t'GETID3_ASF_Advanced_Mutual_Exclusion_Object'    => 'A08649CF-4775-4670-8A16-6E35357566CD',\n\t\t\t'GETID3_ASF_Bandwidth_Sharing_Object'            => 'A69609E6-517B-11D2-B6AF-00C04FD908E9',\n\t\t\t'GETID3_ASF_Reserved_1'                          => 'ABD3D211-A9BA-11cf-8EE6-00C00C205365',\n\t\t\t'GETID3_ASF_Bandwidth_Sharing_Exclusive'         => 'AF6060AA-5197-11D2-B6AF-00C04FD908E9',\n\t\t\t'GETID3_ASF_Bandwidth_Sharing_Partial'           => 'AF6060AB-5197-11D2-B6AF-00C04FD908E9',\n\t\t\t'GETID3_ASF_JFIF_Media'                          => 'B61BE100-5B4E-11CF-A8FD-00805F5C442B',\n\t\t\t'GETID3_ASF_Stream_Properties_Object'            => 'B7DC0791-A9B7-11CF-8EE6-00C00C205365',\n\t\t\t'GETID3_ASF_Video_Media'                         => 'BC19EFC0-5B4D-11CF-A8FD-00805F5C442B',\n\t\t\t'GETID3_ASF_Audio_Spread'                        => 'BFC3CD50-618F-11CF-8BB2-00AA00B4E220',\n\t\t\t'GETID3_ASF_Metadata_Object'                     => 'C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA',\n\t\t\t'GETID3_ASF_Payload_Ext_Syst_Sample_Duration'    => 'C6BD9450-867F-4907-83A3-C77921B733AD',\n\t\t\t'GETID3_ASF_Group_Mutual_Exclusion_Object'       => 'D1465A40-5A79-4338-B71B-E36B8FD6C249',\n\t\t\t'GETID3_ASF_Extended_Content_Description_Object' => 'D2D0A440-E307-11D2-97F0-00A0C95EA850',\n\t\t\t'GETID3_ASF_Stream_Prioritization_Object'        => 'D4FED15B-88D3-454F-81F0-ED5C45999E24',\n\t\t\t'GETID3_ASF_Payload_Ext_System_Content_Type'     => 'D590DC20-07BC-436C-9CF7-F3BBFBF1A4DC',\n\t\t\t'GETID3_ASF_Old_File_Properties_Object'          => 'D6E229D0-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_ASF_Header_Object'               => 'D6E229D1-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_ASF_Data_Object'                 => 'D6E229D2-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Index_Object'                        => 'D6E229D3-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Stream_Properties_Object'        => 'D6E229D4-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Content_Description_Object'      => 'D6E229D5-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Script_Command_Object'           => 'D6E229D6-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Marker_Object'                   => 'D6E229D7-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Component_Download_Object'       => 'D6E229D8-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Stream_Group_Object'             => 'D6E229D9-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Scalable_Object'                 => 'D6E229DA-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Prioritization_Object'           => 'D6E229DB-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Bitrate_Mutual_Exclusion_Object'     => 'D6E229DC-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Inter_Media_Dependency_Object'   => 'D6E229DD-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Rating_Object'                   => 'D6E229DE-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Index_Parameters_Object'             => 'D6E229DF-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Color_Table_Object'              => 'D6E229E0-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Language_List_Object'            => 'D6E229E1-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Audio_Media'                     => 'D6E229E2-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Video_Media'                     => 'D6E229E3-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Image_Media'                     => 'D6E229E4-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Timecode_Media'                  => 'D6E229E5-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Text_Media'                      => 'D6E229E6-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_MIDI_Media'                      => 'D6E229E7-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Command_Media'                   => 'D6E229E8-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_No_Error_Concealment'            => 'D6E229EA-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Scrambled_Audio'                 => 'D6E229EB-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_No_Color_Table'                  => 'D6E229EC-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_SMPTE_Time'                      => 'D6E229ED-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_ASCII_Text'                      => 'D6E229EE-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Unicode_Text'                    => 'D6E229EF-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_HTML_Text'                       => 'D6E229F0-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_URL_Command'                     => 'D6E229F1-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Filename_Command'                => 'D6E229F2-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_ACM_Codec'                       => 'D6E229F3-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_VCM_Codec'                       => 'D6E229F4-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_QuickTime_Codec'                 => 'D6E229F5-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_DirectShow_Transform_Filter'     => 'D6E229F6-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_DirectShow_Rendering_Filter'     => 'D6E229F7-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_No_Enhancement'                  => 'D6E229F8-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Unknown_Enhancement_Type'        => 'D6E229F9-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Temporal_Enhancement'            => 'D6E229FA-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Spatial_Enhancement'             => 'D6E229FB-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Quality_Enhancement'             => 'D6E229FC-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Number_of_Channels_Enhancement'  => 'D6E229FD-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Frequency_Response_Enhancement'  => 'D6E229FE-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Media_Object'                    => 'D6E229FF-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Mutex_Language'                      => 'D6E22A00-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Mutex_Bitrate'                       => 'D6E22A01-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Mutex_Unknown'                       => 'D6E22A02-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_ASF_Placeholder_Object'          => 'D6E22A0E-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Old_Data_Unit_Extension_Object'      => 'D6E22A0F-35DA-11D1-9034-00A0C90349BE',\n\t\t\t'GETID3_ASF_Web_Stream_Format'                   => 'DA1E6B13-8359-4050-B398-388E965BF00C',\n\t\t\t'GETID3_ASF_Payload_Ext_System_File_Name'        => 'E165EC0E-19ED-45D7-B4A7-25CBD1E28E9B',\n\t\t\t'GETID3_ASF_Marker_Object'                       => 'F487CD01-A951-11CF-8EE6-00C00C205365',\n\t\t\t'GETID3_ASF_Timecode_Index_Parameters_Object'    => 'F55E496D-9797-4B5D-8C8B-604DFE9BFB24',\n\t\t\t'GETID3_ASF_Audio_Media'                         => 'F8699E40-5B4D-11CF-A8FD-00805F5C442B',\n\t\t\t'GETID3_ASF_Media_Object_Index_Object'           => 'FEB103F8-12AD-4C64-840F-2A1D2F7AD48C',\n\t\t\t'GETID3_ASF_Alt_Extended_Content_Encryption_Obj' => 'FF889EF1-ADEE-40DA-9E71-98704BB928CE',\n\t\t\t'GETID3_ASF_Index_Placeholder_Object'            => 'D9AADE20-7C17-4F9C-BC28-8555DD98E2A2', // http://cpan.uwinnipeg.ca/htdocs/Audio-WMA/Audio/WMA.pm.html\n\t\t\t'GETID3_ASF_Compatibility_Object'                => '26F18B5D-4584-47EC-9F5F-0E651F0452C9', // http://cpan.uwinnipeg.ca/htdocs/Audio-WMA/Audio/WMA.pm.html\n\t\t);\n\t\treturn $GUIDarray;\n\t}\n\n\t/**\n\t * @param string $GUIDstring\n\t *\n\t * @return string|false\n\t */\n\tpublic static function GUIDname($GUIDstring) {\n\t\tstatic $GUIDarray = array();\n\t\tif (empty($GUIDarray)) {\n\t\t\t$GUIDarray = self::KnownGUIDs();\n\t\t}\n\t\treturn array_search($GUIDstring, $GUIDarray);\n\t}\n\n\t/**\n\t * @param int $id\n\t *\n\t * @return string\n\t */\n\tpublic static function ASFIndexObjectIndexTypeLookup($id) {\n\t\tstatic $ASFIndexObjectIndexTypeLookup = array();\n\t\tif (empty($ASFIndexObjectIndexTypeLookup)) {\n\t\t\t$ASFIndexObjectIndexTypeLookup[1] = 'Nearest Past Data Packet';\n\t\t\t$ASFIndexObjectIndexTypeLookup[2] = 'Nearest Past Media Object';\n\t\t\t$ASFIndexObjectIndexTypeLookup[3] = 'Nearest Past Cleanpoint';\n\t\t}\n\t\treturn (isset($ASFIndexObjectIndexTypeLookup[$id]) ? $ASFIndexObjectIndexTypeLookup[$id] : 'invalid');\n\t}\n\n\t/**\n\t * @param string $GUIDstring\n\t *\n\t * @return string\n\t */\n\tpublic static function GUIDtoBytestring($GUIDstring) {\n\t\t// Microsoft defines these 16-byte (128-bit) GUIDs in the strangest way:\n\t\t// first 4 bytes are in little-endian order\n\t\t// next 2 bytes are appended in little-endian order\n\t\t// next 2 bytes are appended in little-endian order\n\t\t// next 2 bytes are appended in big-endian order\n\t\t// next 6 bytes are appended in big-endian order\n\n\t\t// AaBbCcDd-EeFf-GgHh-IiJj-KkLlMmNnOoPp is stored as this 16-byte string:\n\t\t// $Dd $Cc $Bb $Aa $Ff $Ee $Hh $Gg $Ii $Jj $Kk $Ll $Mm $Nn $Oo $Pp\n\n\t\t$hexbytecharstring  = chr(hexdec(substr($GUIDstring,  6, 2)));\n\t\t$hexbytecharstring .= chr(hexdec(substr($GUIDstring,  4, 2)));\n\t\t$hexbytecharstring .= chr(hexdec(substr($GUIDstring,  2, 2)));\n\t\t$hexbytecharstring .= chr(hexdec(substr($GUIDstring,  0, 2)));\n\n\t\t$hexbytecharstring .= chr(hexdec(substr($GUIDstring, 11, 2)));\n\t\t$hexbytecharstring .= chr(hexdec(substr($GUIDstring,  9, 2)));\n\n\t\t$hexbytecharstring .= chr(hexdec(substr($GUIDstring, 16, 2)));\n\t\t$hexbytecharstring .= chr(hexdec(substr($GUIDstring, 14, 2)));\n\n\t\t$hexbytecharstring .= chr(hexdec(substr($GUIDstring, 19, 2)));\n\t\t$hexbytecharstring .= chr(hexdec(substr($GUIDstring, 21, 2)));\n\n\t\t$hexbytecharstring .= chr(hexdec(substr($GUIDstring, 24, 2)));\n\t\t$hexbytecharstring .= chr(hexdec(substr($GUIDstring, 26, 2)));\n\t\t$hexbytecharstring .= chr(hexdec(substr($GUIDstring, 28, 2)));\n\t\t$hexbytecharstring .= chr(hexdec(substr($GUIDstring, 30, 2)));\n\t\t$hexbytecharstring .= chr(hexdec(substr($GUIDstring, 32, 2)));\n\t\t$hexbytecharstring .= chr(hexdec(substr($GUIDstring, 34, 2)));\n\n\t\treturn $hexbytecharstring;\n\t}\n\n\t/**\n\t * @param string $Bytestring\n\t *\n\t * @return string\n\t */\n\tpublic static function BytestringToGUID($Bytestring) {\n\t\t$GUIDstring  = str_pad(dechex(ord($Bytestring[3])),  2, '0', STR_PAD_LEFT);\n\t\t$GUIDstring .= str_pad(dechex(ord($Bytestring[2])),  2, '0', STR_PAD_LEFT);\n\t\t$GUIDstring .= str_pad(dechex(ord($Bytestring[1])),  2, '0', STR_PAD_LEFT);\n\t\t$GUIDstring .= str_pad(dechex(ord($Bytestring[0])),  2, '0', STR_PAD_LEFT);\n\t\t$GUIDstring .= '-';\n\t\t$GUIDstring .= str_pad(dechex(ord($Bytestring[5])),  2, '0', STR_PAD_LEFT);\n\t\t$GUIDstring .= str_pad(dechex(ord($Bytestring[4])),  2, '0', STR_PAD_LEFT);\n\t\t$GUIDstring .= '-';\n\t\t$GUIDstring .= str_pad(dechex(ord($Bytestring[7])),  2, '0', STR_PAD_LEFT);\n\t\t$GUIDstring .= str_pad(dechex(ord($Bytestring[6])),  2, '0', STR_PAD_LEFT);\n\t\t$GUIDstring .= '-';\n\t\t$GUIDstring .= str_pad(dechex(ord($Bytestring[8])),  2, '0', STR_PAD_LEFT);\n\t\t$GUIDstring .= str_pad(dechex(ord($Bytestring[9])),  2, '0', STR_PAD_LEFT);\n\t\t$GUIDstring .= '-';\n\t\t$GUIDstring .= str_pad(dechex(ord($Bytestring[10])), 2, '0', STR_PAD_LEFT);\n\t\t$GUIDstring .= str_pad(dechex(ord($Bytestring[11])), 2, '0', STR_PAD_LEFT);\n\t\t$GUIDstring .= str_pad(dechex(ord($Bytestring[12])), 2, '0', STR_PAD_LEFT);\n\t\t$GUIDstring .= str_pad(dechex(ord($Bytestring[13])), 2, '0', STR_PAD_LEFT);\n\t\t$GUIDstring .= str_pad(dechex(ord($Bytestring[14])), 2, '0', STR_PAD_LEFT);\n\t\t$GUIDstring .= str_pad(dechex(ord($Bytestring[15])), 2, '0', STR_PAD_LEFT);\n\n\t\treturn strtoupper($GUIDstring);\n\t}\n\n\t/**\n\t * @param int  $FILETIME\n\t * @param bool $round\n\t *\n\t * @return float|int\n\t */\n\tpublic static function FILETIMEtoUNIXtime($FILETIME, $round=true) {\n\t\t// FILETIME is a 64-bit unsigned integer representing\n\t\t// the number of 100-nanosecond intervals since January 1, 1601\n\t\t// UNIX timestamp is number of seconds since January 1, 1970\n\t\t// 116444736000000000 = 10000000 * 60 * 60 * 24 * 365 * 369 + 89 leap days\n\t\tif ($round) {\n\t\t\treturn intval(round(($FILETIME - 116444736000000000) / 10000000));\n\t\t}\n\t\treturn ($FILETIME - 116444736000000000) / 10000000;\n\t}\n\n\t/**\n\t * @param int $WMpictureType\n\t *\n\t * @return string\n\t */\n\tpublic static function WMpictureTypeLookup($WMpictureType) {\n\t\tstatic $lookup = null;\n\t\tif ($lookup === null) {\n\t\t\t$lookup = array(\n\t\t\t\t0x03 => 'Front Cover',\n\t\t\t\t0x04 => 'Back Cover',\n\t\t\t\t0x00 => 'User Defined',\n\t\t\t\t0x05 => 'Leaflet Page',\n\t\t\t\t0x06 => 'Media Label',\n\t\t\t\t0x07 => 'Lead Artist',\n\t\t\t\t0x08 => 'Artist',\n\t\t\t\t0x09 => 'Conductor',\n\t\t\t\t0x0A => 'Band',\n\t\t\t\t0x0B => 'Composer',\n\t\t\t\t0x0C => 'Lyricist',\n\t\t\t\t0x0D => 'Recording Location',\n\t\t\t\t0x0E => 'During Recording',\n\t\t\t\t0x0F => 'During Performance',\n\t\t\t\t0x10 => 'Video Screen Capture',\n\t\t\t\t0x12 => 'Illustration',\n\t\t\t\t0x13 => 'Band Logotype',\n\t\t\t\t0x14 => 'Publisher Logotype'\n\t\t\t);\n\t\t\t$lookup = array_map(function($str) {\n\t\t\t\treturn getid3_lib::iconv_fallback('UTF-8', 'UTF-16LE', $str);\n\t\t\t}, $lookup);\n\t\t}\n\n\t\treturn (isset($lookup[$WMpictureType]) ? $lookup[$WMpictureType] : '');\n\t}\n\n\t/**\n\t * @param string $asf_header_extension_object_data\n\t * @param int    $unhandled_sections\n\t *\n\t * @return array\n\t */\n\tpublic function HeaderExtensionObjectDataParse(&$asf_header_extension_object_data, &$unhandled_sections) {\n\t\t// http://msdn.microsoft.com/en-us/library/bb643323.aspx\n\n\t\t$offset = 0;\n\t\t$objectOffset = 0;\n\t\t$HeaderExtensionObjectParsed = array();\n\t\twhile ($objectOffset < strlen($asf_header_extension_object_data)) {\n\t\t\t$offset = $objectOffset;\n\t\t\t$thisObject = array();\n\n\t\t\t$thisObject['guid']                              =                              substr($asf_header_extension_object_data, $offset, 16);\n\t\t\t$offset += 16;\n\t\t\t$thisObject['guid_text'] = $this->BytestringToGUID($thisObject['guid']);\n\t\t\t$thisObject['guid_name'] = $this->GUIDname($thisObject['guid_text']);\n\n\t\t\t$thisObject['size']                              = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  8));\n\t\t\t$offset += 8;\n\t\t\tif ($thisObject['size'] <= 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tswitch ($thisObject['guid']) {\n\t\t\t\tcase GETID3_ASF_Extended_Stream_Properties_Object:\n\t\t\t\t\t$thisObject['start_time']                        = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  8));\n\t\t\t\t\t$offset += 8;\n\t\t\t\t\t$thisObject['start_time_unix']                   = $this->FILETIMEtoUNIXtime($thisObject['start_time']);\n\n\t\t\t\t\t$thisObject['end_time']                          = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  8));\n\t\t\t\t\t$offset += 8;\n\t\t\t\t\t$thisObject['end_time_unix']                     = $this->FILETIMEtoUNIXtime($thisObject['end_time']);\n\n\t\t\t\t\t$thisObject['data_bitrate']                      = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));\n\t\t\t\t\t$offset += 4;\n\n\t\t\t\t\t$thisObject['buffer_size']                       = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));\n\t\t\t\t\t$offset += 4;\n\n\t\t\t\t\t$thisObject['initial_buffer_fullness']           = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));\n\t\t\t\t\t$offset += 4;\n\n\t\t\t\t\t$thisObject['alternate_data_bitrate']            = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));\n\t\t\t\t\t$offset += 4;\n\n\t\t\t\t\t$thisObject['alternate_buffer_size']             = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));\n\t\t\t\t\t$offset += 4;\n\n\t\t\t\t\t$thisObject['alternate_initial_buffer_fullness'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));\n\t\t\t\t\t$offset += 4;\n\n\t\t\t\t\t$thisObject['maximum_object_size']               = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));\n\t\t\t\t\t$offset += 4;\n\n\t\t\t\t\t$thisObject['flags_raw']                         = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));\n\t\t\t\t\t$offset += 4;\n\t\t\t\t\t$thisObject['flags']['reliable']                = (bool) $thisObject['flags_raw'] & 0x00000001;\n\t\t\t\t\t$thisObject['flags']['seekable']                = (bool) $thisObject['flags_raw'] & 0x00000002;\n\t\t\t\t\t$thisObject['flags']['no_cleanpoints']          = (bool) $thisObject['flags_raw'] & 0x00000004;\n\t\t\t\t\t$thisObject['flags']['resend_live_cleanpoints'] = (bool) $thisObject['flags_raw'] & 0x00000008;\n\n\t\t\t\t\t$thisObject['stream_number']                     = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t$offset += 2;\n\n\t\t\t\t\t$thisObject['stream_language_id_index']          = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t$offset += 2;\n\n\t\t\t\t\t$thisObject['average_time_per_frame']            = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));\n\t\t\t\t\t$offset += 4;\n\n\t\t\t\t\t$thisObject['stream_name_count']                 = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t$offset += 2;\n\n\t\t\t\t\t$thisObject['payload_extension_system_count']    = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t$offset += 2;\n\n\t\t\t\t\tfor ($i = 0; $i < $thisObject['stream_name_count']; $i++) {\n\t\t\t\t\t\t$streamName = array();\n\n\t\t\t\t\t\t$streamName['language_id_index']             = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t\t$offset += 2;\n\n\t\t\t\t\t\t$streamName['stream_name_length']            = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t\t$offset += 2;\n\n\t\t\t\t\t\t$streamName['stream_name']                   = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  $streamName['stream_name_length']));\n\t\t\t\t\t\t$offset += $streamName['stream_name_length'];\n\n\t\t\t\t\t\t$thisObject['stream_names'][$i] = $streamName;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ($i = 0; $i < $thisObject['payload_extension_system_count']; $i++) {\n\t\t\t\t\t\t$payloadExtensionSystem = array();\n\n\t\t\t\t\t\t$payloadExtensionSystem['extension_system_id']   =                              substr($asf_header_extension_object_data, $offset, 16);\n\t\t\t\t\t\t$offset += 16;\n\t\t\t\t\t\t$payloadExtensionSystem['extension_system_id_text'] = $this->BytestringToGUID($payloadExtensionSystem['extension_system_id']);\n\n\t\t\t\t\t\t$payloadExtensionSystem['extension_system_size'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\tif ($payloadExtensionSystem['extension_system_size'] <= 0) {\n\t\t\t\t\t\t\tbreak 2;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$payloadExtensionSystem['extension_system_info_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));\n\t\t\t\t\t\t$offset += 4;\n\n\t\t\t\t\t\t$payloadExtensionSystem['extension_system_info_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  $payloadExtensionSystem['extension_system_info_length']));\n\t\t\t\t\t\t$offset += $payloadExtensionSystem['extension_system_info_length'];\n\n\t\t\t\t\t\t$thisObject['payload_extension_systems'][$i] = $payloadExtensionSystem;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Padding_Object:\n\t\t\t\t\t// padding, skip it\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Metadata_Object:\n\t\t\t\t\t$thisObject['description_record_counts'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t$offset += 2;\n\n\t\t\t\t\tfor ($i = 0; $i < $thisObject['description_record_counts']; $i++) {\n\t\t\t\t\t\t$descriptionRecord = array();\n\n\t\t\t\t\t\t$descriptionRecord['reserved_1']         = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2)); // must be zero\n\t\t\t\t\t\t$offset += 2;\n\n\t\t\t\t\t\t$descriptionRecord['stream_number']      = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t\t$offset += 2;\n\n\t\t\t\t\t\t$descriptionRecord['name_length']        = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t\t$offset += 2;\n\n\t\t\t\t\t\t$descriptionRecord['data_type']          = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$descriptionRecord['data_type_text'] = self::metadataLibraryObjectDataTypeLookup($descriptionRecord['data_type']);\n\n\t\t\t\t\t\t$descriptionRecord['data_length']        = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));\n\t\t\t\t\t\t$offset += 4;\n\n\t\t\t\t\t\t$descriptionRecord['name']               =                              substr($asf_header_extension_object_data, $offset,  $descriptionRecord['name_length']);\n\t\t\t\t\t\t$offset += $descriptionRecord['name_length'];\n\n\t\t\t\t\t\t$descriptionRecord['data']               =                              substr($asf_header_extension_object_data, $offset,  $descriptionRecord['data_length']);\n\t\t\t\t\t\t$offset += $descriptionRecord['data_length'];\n\t\t\t\t\t\tswitch ($descriptionRecord['data_type']) {\n\t\t\t\t\t\t\tcase 0x0000: // Unicode string\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 0x0001: // BYTE array\n\t\t\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 0x0002: // BOOL\n\t\t\t\t\t\t\t\t$descriptionRecord['data'] = (bool) getid3_lib::LittleEndian2Int($descriptionRecord['data']);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 0x0003: // DWORD\n\t\t\t\t\t\t\tcase 0x0004: // QWORD\n\t\t\t\t\t\t\tcase 0x0005: // WORD\n\t\t\t\t\t\t\t\t$descriptionRecord['data'] = getid3_lib::LittleEndian2Int($descriptionRecord['data']);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 0x0006: // GUID\n\t\t\t\t\t\t\t\t$descriptionRecord['data_text'] = $this->BytestringToGUID($descriptionRecord['data']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$thisObject['description_record'][$i] = $descriptionRecord;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Language_List_Object:\n\t\t\t\t\t$thisObject['language_id_record_counts'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t$offset += 2;\n\n\t\t\t\t\tfor ($i = 0; $i < $thisObject['language_id_record_counts']; $i++) {\n\t\t\t\t\t\t$languageIDrecord = array();\n\n\t\t\t\t\t\t$languageIDrecord['language_id_length']         = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  1));\n\t\t\t\t\t\t$offset += 1;\n\n\t\t\t\t\t\t$languageIDrecord['language_id']                =                              substr($asf_header_extension_object_data, $offset,  $languageIDrecord['language_id_length']);\n\t\t\t\t\t\t$offset += $languageIDrecord['language_id_length'];\n\n\t\t\t\t\t\t$thisObject['language_id_record'][$i] = $languageIDrecord;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_ASF_Metadata_Library_Object:\n\t\t\t\t\t$thisObject['description_records_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t$offset += 2;\n\n\t\t\t\t\tfor ($i = 0; $i < $thisObject['description_records_count']; $i++) {\n\t\t\t\t\t\t$descriptionRecord = array();\n\n\t\t\t\t\t\t$descriptionRecord['language_list_index'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t\t$offset += 2;\n\n\t\t\t\t\t\t$descriptionRecord['stream_number']       = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t\t$offset += 2;\n\n\t\t\t\t\t\t$descriptionRecord['name_length']         = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t\t$offset += 2;\n\n\t\t\t\t\t\t$descriptionRecord['data_type']           = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$descriptionRecord['data_type_text'] = self::metadataLibraryObjectDataTypeLookup($descriptionRecord['data_type']);\n\n\t\t\t\t\t\t$descriptionRecord['data_length']         = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));\n\t\t\t\t\t\t$offset += 4;\n\n\t\t\t\t\t\t$descriptionRecord['name']                =                              substr($asf_header_extension_object_data, $offset,  $descriptionRecord['name_length']);\n\t\t\t\t\t\t$offset += $descriptionRecord['name_length'];\n\n\t\t\t\t\t\t$descriptionRecord['data']                =                              substr($asf_header_extension_object_data, $offset,  $descriptionRecord['data_length']);\n\t\t\t\t\t\t$offset += $descriptionRecord['data_length'];\n\n\t\t\t\t\t\tif (preg_match('#^WM/Picture$#', str_replace(\"\\x00\", '', trim($descriptionRecord['name'])))) {\n\t\t\t\t\t\t\t$WMpicture = $this->ASF_WMpicture($descriptionRecord['data']);\n\t\t\t\t\t\t\tforeach ($WMpicture as $key => $value) {\n\t\t\t\t\t\t\t\t$descriptionRecord['data'] = $WMpicture;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tunset($WMpicture);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$thisObject['description_record'][$i] = $descriptionRecord;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$unhandled_sections++;\n\t\t\t\t\tif ($this->GUIDname($thisObject['guid_text'])) {\n\t\t\t\t\t\t$this->warning('unhandled Header Extension Object GUID \"'.$this->GUIDname($thisObject['guid_text']).'\" {'.$thisObject['guid_text'].'} at offset '.($offset - 16 - 8));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('unknown Header Extension Object GUID {'.$thisObject['guid_text'].'} in at offset '.($offset - 16 - 8));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$HeaderExtensionObjectParsed[] = $thisObject;\n\n\t\t\t$objectOffset += $thisObject['size'];\n\t\t}\n\t\treturn $HeaderExtensionObjectParsed;\n\t}\n\n\t/**\n\t * @param int $id\n\t *\n\t * @return string\n\t */\n\tpublic static function metadataLibraryObjectDataTypeLookup($id) {\n\t\tstatic $lookup = array(\n\t\t\t0x0000 => 'Unicode string', // The data consists of a sequence of Unicode characters\n\t\t\t0x0001 => 'BYTE array',     // The type of the data is implementation-specific\n\t\t\t0x0002 => 'BOOL',           // The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer. Only 0x0000 or 0x0001 are permitted values\n\t\t\t0x0003 => 'DWORD',          // The data is 4 bytes long and should be interpreted as a 32-bit unsigned integer\n\t\t\t0x0004 => 'QWORD',          // The data is 8 bytes long and should be interpreted as a 64-bit unsigned integer\n\t\t\t0x0005 => 'WORD',           // The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer\n\t\t\t0x0006 => 'GUID',           // The data is 16 bytes long and should be interpreted as a 128-bit GUID\n\t\t);\n\t\treturn (isset($lookup[$id]) ? $lookup[$id] : 'invalid');\n\t}\n\n\t/**\n\t * @param string $data\n\t *\n\t * @return array\n\t */\n\tpublic function ASF_WMpicture(&$data) {\n\t\t//typedef struct _WMPicture{\n\t\t//  LPWSTR  pwszMIMEType;\n\t\t//  BYTE  bPictureType;\n\t\t//  LPWSTR  pwszDescription;\n\t\t//  DWORD  dwDataLen;\n\t\t//  BYTE*  pbData;\n\t\t//} WM_PICTURE;\n\n\t\t$WMpicture = array();\n\n\t\t$offset = 0;\n\t\t$WMpicture['image_type_id'] = getid3_lib::LittleEndian2Int(substr($data, $offset, 1));\n\t\t$offset += 1;\n\t\t$WMpicture['image_type']    = self::WMpictureTypeLookup($WMpicture['image_type_id']);\n\t\t$WMpicture['image_size']    = getid3_lib::LittleEndian2Int(substr($data, $offset, 4));\n\t\t$offset += 4;\n\n\t\t$WMpicture['image_mime'] = '';\n\t\tdo {\n\t\t\t$next_byte_pair = substr($data, $offset, 2);\n\t\t\t$offset += 2;\n\t\t\t$WMpicture['image_mime'] .= $next_byte_pair;\n\t\t} while ($next_byte_pair !== \"\\x00\\x00\");\n\n\t\t$WMpicture['image_description'] = '';\n\t\tdo {\n\t\t\t$next_byte_pair = substr($data, $offset, 2);\n\t\t\t$offset += 2;\n\t\t\t$WMpicture['image_description'] .= $next_byte_pair;\n\t\t} while ($next_byte_pair !== \"\\x00\\x00\");\n\n\t\t$WMpicture['dataoffset'] = $offset;\n\t\t$WMpicture['data'] = substr($data, $offset);\n\n\t\t$imageinfo = array();\n\t\t$WMpicture['image_mime'] = '';\n\t\t$imagechunkcheck = getid3_lib::GetDataImageSize($WMpicture['data'], $imageinfo);\n\t\tunset($imageinfo);\n\t\tif (!empty($imagechunkcheck)) {\n\t\t\t$WMpicture['image_mime'] = image_type_to_mime_type($imagechunkcheck[2]);\n\t\t}\n\t\tif (!isset($this->getid3->info['asf']['comments']['picture'])) {\n\t\t\t$this->getid3->info['asf']['comments']['picture'] = array();\n\t\t}\n\t\t$this->getid3->info['asf']['comments']['picture'][] = array('data'=>$WMpicture['data'], 'image_mime'=>$WMpicture['image_mime']);\n\n\t\treturn $WMpicture;\n\t}\n\n\t/**\n\t * Remove terminator 00 00 and convert UTF-16LE to Latin-1.\n\t *\n\t * @param string $string\n\t *\n\t * @return string\n\t */\n\tpublic static function TrimConvert($string) {\n\t\treturn trim(getid3_lib::iconv_fallback('UTF-16LE', 'ISO-8859-1', self::TrimTerm($string)), ' ');\n\t}\n\n\t/**\n\t * Remove terminator 00 00.\n\t *\n\t * @param string $string\n\t *\n\t * @return string\n\t */\n\tpublic static function TrimTerm($string) {\n\t\t// remove terminator, only if present (it should be, but...)\n\t\tif (substr($string, -2) === \"\\x00\\x00\") {\n\t\t\t$string = substr($string, 0, -2);\n\t\t}\n\t\treturn $string;\n\t}\n\n}\n", "num_lines": 2088}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/////////////////////////////////////////////////////////////////\n/// getID3() by James Heinrich <info@getid3.org>               //\n//  available at https://github.com/JamesHeinrich/getID3       //\n//            or https://www.getid3.org                        //\n//            or http://getid3.sourceforge.net                 //\n//  see readme.txt for more details                            //\n/////////////////////////////////////////////////////////////////\n//                                                             //\n// module.audio-video.flv.php                                  //\n// module for analyzing Shockwave Flash Video files            //\n// dependencies: NONE                                          //\n//                                                             //\n/////////////////////////////////////////////////////////////////\n//                                                             //\n//  FLV module by Seth Kaufman <seth\u00c3\u02dcwhirl-i-gig*com>          //\n//                                                             //\n//  * version 0.1 (26 June 2005)                               //\n//                                                             //\n//  * version 0.1.1 (15 July 2005)                             //\n//  minor modifications by James Heinrich <info@getid3.org>    //\n//                                                             //\n//  * version 0.2 (22 February 2006)                           //\n//  Support for On2 VP6 codec and meta information             //\n//    by Steve Webster <steve.webster\u00c3\u02dcfeaturecreep*com>        //\n//                                                             //\n//  * version 0.3 (15 June 2006)                               //\n//  Modified to not read entire file into memory               //\n//    by James Heinrich <info@getid3.org>                      //\n//                                                             //\n//  * version 0.4 (07 December 2007)                           //\n//  Bugfixes for incorrectly parsed FLV dimensions             //\n//    and incorrect parsing of onMetaTag                       //\n//    by Evgeny Moysevich <moysevich\u00c3\u02dcgmail*com>                //\n//                                                             //\n//  * version 0.5 (21 May 2009)                                //\n//  Fixed parsing of audio tags and added additional codec     //\n//    details. The duration is now read from onMetaTag (if     //\n//    exists), rather than parsing whole file                  //\n//    by Nigel Barnes <ngbarnes\u00c3\u02dchotmail*com>                   //\n//                                                             //\n//  * version 0.6 (24 May 2009)                                //\n//  Better parsing of files with h264 video                    //\n//    by Evgeny Moysevich <moysevich\u00c3\u02dcgmail*com>                //\n//                                                             //\n//  * version 0.6.1 (30 May 2011)                              //\n//    prevent infinite loops in expGolombUe()                  //\n//                                                             //\n//  * version 0.7.0 (16 Jul 2013)                              //\n//  handle GETID3_FLV_VIDEO_VP6FLV_ALPHA                       //\n//  improved AVCSequenceParameterSetReader::readData()         //\n//    by Xander Schouwerwou <schouwerwou\u00c3\u02dcgmail*com>            //\n//                                                            ///\n/////////////////////////////////////////////////////////////////\n\nif (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers\n\texit;\n}\n\ndefine('GETID3_FLV_TAG_AUDIO',          8);\ndefine('GETID3_FLV_TAG_VIDEO',          9);\ndefine('GETID3_FLV_TAG_META',          18);\n\ndefine('GETID3_FLV_VIDEO_H263',         2);\ndefine('GETID3_FLV_VIDEO_SCREEN',       3);\ndefine('GETID3_FLV_VIDEO_VP6FLV',       4);\ndefine('GETID3_FLV_VIDEO_VP6FLV_ALPHA', 5);\ndefine('GETID3_FLV_VIDEO_SCREENV2',     6);\ndefine('GETID3_FLV_VIDEO_H264',         7);\n\ndefine('H264_AVC_SEQUENCE_HEADER',          0);\ndefine('H264_PROFILE_BASELINE',            66);\ndefine('H264_PROFILE_MAIN',                77);\ndefine('H264_PROFILE_EXTENDED',            88);\ndefine('H264_PROFILE_HIGH',               100);\ndefine('H264_PROFILE_HIGH10',             110);\ndefine('H264_PROFILE_HIGH422',            122);\ndefine('H264_PROFILE_HIGH444',            144);\ndefine('H264_PROFILE_HIGH444_PREDICTIVE', 244);\n\nclass getid3_flv extends getid3_handler\n{\n\tconst magic = 'FLV';\n\n\t/**\n\t * Break out of the loop if too many frames have been scanned; only scan this\n\t * many if meta frame does not contain useful duration.\n\t *\n\t * @var int\n\t */\n\tpublic $max_frames = 100000;\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function Analyze() {\n\t\t$info = &$this->getid3->info;\n\n\t\t$this->fseek($info['avdataoffset']);\n\n\t\t$FLVdataLength = $info['avdataend'] - $info['avdataoffset'];\n\t\t$FLVheader = $this->fread(5);\n\n\t\t$info['fileformat'] = 'flv';\n\t\t$info['flv']['header']['signature'] =                           substr($FLVheader, 0, 3);\n\t\t$info['flv']['header']['version']   = getid3_lib::BigEndian2Int(substr($FLVheader, 3, 1));\n\t\t$TypeFlags                          = getid3_lib::BigEndian2Int(substr($FLVheader, 4, 1));\n\n\t\tif ($info['flv']['header']['signature'] != self::magic) {\n\t\t\t$this->error('Expecting \"'.getid3_lib::PrintHexBytes(self::magic).'\" at offset '.$info['avdataoffset'].', found \"'.getid3_lib::PrintHexBytes($info['flv']['header']['signature']).'\"');\n\t\t\tunset($info['flv'], $info['fileformat']);\n\t\t\treturn false;\n\t\t}\n\n\t\t$info['flv']['header']['hasAudio'] = (bool) ($TypeFlags & 0x04);\n\t\t$info['flv']['header']['hasVideo'] = (bool) ($TypeFlags & 0x01);\n\n\t\t$FrameSizeDataLength = getid3_lib::BigEndian2Int($this->fread(4));\n\t\t$FLVheaderFrameLength = 9;\n\t\tif ($FrameSizeDataLength > $FLVheaderFrameLength) {\n\t\t\t$this->fseek($FrameSizeDataLength - $FLVheaderFrameLength, SEEK_CUR);\n\t\t}\n\t\t$Duration = 0;\n\t\t$found_video = false;\n\t\t$found_audio = false;\n\t\t$found_meta  = false;\n\t\t$found_valid_meta_playtime = false;\n\t\t$tagParseCount = 0;\n\t\t$info['flv']['framecount'] = array('total'=>0, 'audio'=>0, 'video'=>0);\n\t\t$flv_framecount = &$info['flv']['framecount'];\n\t\twhile ((($this->ftell() + 16) < $info['avdataend']) && (($tagParseCount++ <= $this->max_frames) || !$found_valid_meta_playtime))  {\n\t\t\t$ThisTagHeader = $this->fread(16);\n\n\t\t\t$PreviousTagLength = getid3_lib::BigEndian2Int(substr($ThisTagHeader,  0, 4));\n\t\t\t$TagType           = getid3_lib::BigEndian2Int(substr($ThisTagHeader,  4, 1));\n\t\t\t$DataLength        = getid3_lib::BigEndian2Int(substr($ThisTagHeader,  5, 3));\n\t\t\t$Timestamp         = getid3_lib::BigEndian2Int(substr($ThisTagHeader,  8, 3));\n\t\t\t$LastHeaderByte    = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 15, 1));\n\t\t\t$NextOffset = $this->ftell() - 1 + $DataLength;\n\t\t\tif ($Timestamp > $Duration) {\n\t\t\t\t$Duration = $Timestamp;\n\t\t\t}\n\n\t\t\t$flv_framecount['total']++;\n\t\t\tswitch ($TagType) {\n\t\t\t\tcase GETID3_FLV_TAG_AUDIO:\n\t\t\t\t\t$flv_framecount['audio']++;\n\t\t\t\t\tif (!$found_audio) {\n\t\t\t\t\t\t$found_audio = true;\n\t\t\t\t\t\t$info['flv']['audio']['audioFormat']     = ($LastHeaderByte >> 4) & 0x0F;\n\t\t\t\t\t\t$info['flv']['audio']['audioRate']       = ($LastHeaderByte >> 2) & 0x03;\n\t\t\t\t\t\t$info['flv']['audio']['audioSampleSize'] = ($LastHeaderByte >> 1) & 0x01;\n\t\t\t\t\t\t$info['flv']['audio']['audioType']       =  $LastHeaderByte       & 0x01;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase GETID3_FLV_TAG_VIDEO:\n\t\t\t\t\t$flv_framecount['video']++;\n\t\t\t\t\tif (!$found_video) {\n\t\t\t\t\t\t$found_video = true;\n\t\t\t\t\t\t$info['flv']['video']['videoCodec'] = $LastHeaderByte & 0x07;\n\n\t\t\t\t\t\t$FLVvideoHeader = $this->fread(11);\n\n\t\t\t\t\t\tif ($info['flv']['video']['videoCodec'] == GETID3_FLV_VIDEO_H264) {\n\t\t\t\t\t\t\t// this code block contributed by: moysevich\u00c3\u02dcgmail*com\n\n\t\t\t\t\t\t\t$AVCPacketType = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 0, 1));\n\t\t\t\t\t\t\tif ($AVCPacketType == H264_AVC_SEQUENCE_HEADER) {\n\t\t\t\t\t\t\t\t//\tread AVCDecoderConfigurationRecord\n\t\t\t\t\t\t\t\t$configurationVersion       = getid3_lib::BigEndian2Int(substr($FLVvideoHeader,  4, 1));\n\t\t\t\t\t\t\t\t$AVCProfileIndication       = getid3_lib::BigEndian2Int(substr($FLVvideoHeader,  5, 1));\n\t\t\t\t\t\t\t\t$profile_compatibility      = getid3_lib::BigEndian2Int(substr($FLVvideoHeader,  6, 1));\n\t\t\t\t\t\t\t\t$lengthSizeMinusOne         = getid3_lib::BigEndian2Int(substr($FLVvideoHeader,  7, 1));\n\t\t\t\t\t\t\t\t$numOfSequenceParameterSets = getid3_lib::BigEndian2Int(substr($FLVvideoHeader,  8, 1));\n\n\t\t\t\t\t\t\t\tif (($numOfSequenceParameterSets & 0x1F) != 0) {\n\t\t\t\t\t\t\t\t\t//\tthere is at least one SequenceParameterSet\n\t\t\t\t\t\t\t\t\t//\tread size of the first SequenceParameterSet\n\t\t\t\t\t\t\t\t\t//$spsSize = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 9, 2));\n\t\t\t\t\t\t\t\t\t$spsSize = getid3_lib::LittleEndian2Int(substr($FLVvideoHeader, 9, 2));\n\t\t\t\t\t\t\t\t\t//\tread the first SequenceParameterSet\n\t\t\t\t\t\t\t\t\t$sps = $this->fread($spsSize);\n\t\t\t\t\t\t\t\t\tif (strlen($sps) == $spsSize) {\t//\tmake sure that whole SequenceParameterSet was red\n\t\t\t\t\t\t\t\t\t\t$spsReader = new AVCSequenceParameterSetReader($sps);\n\t\t\t\t\t\t\t\t\t\t$spsReader->readData();\n\t\t\t\t\t\t\t\t\t\t$info['video']['resolution_x'] = $spsReader->getWidth();\n\t\t\t\t\t\t\t\t\t\t$info['video']['resolution_y'] = $spsReader->getHeight();\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}\n\t\t\t\t\t\t\t// end: moysevich\u00c3\u02dcgmail*com\n\n\t\t\t\t\t\t} elseif ($info['flv']['video']['videoCodec'] == GETID3_FLV_VIDEO_H263) {\n\n\t\t\t\t\t\t\t$PictureSizeType = (getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 3, 2))) >> 7;\n\t\t\t\t\t\t\t$PictureSizeType = $PictureSizeType & 0x0007;\n\t\t\t\t\t\t\t$info['flv']['header']['videoSizeType'] = $PictureSizeType;\n\t\t\t\t\t\t\tswitch ($PictureSizeType) {\n\t\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t\t//$PictureSizeEnc = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 2));\n\t\t\t\t\t\t\t\t\t//$PictureSizeEnc <<= 1;\n\t\t\t\t\t\t\t\t\t//$info['video']['resolution_x'] = ($PictureSizeEnc & 0xFF00) >> 8;\n\t\t\t\t\t\t\t\t\t//$PictureSizeEnc = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 2));\n\t\t\t\t\t\t\t\t\t//$PictureSizeEnc <<= 1;\n\t\t\t\t\t\t\t\t\t//$info['video']['resolution_y'] = ($PictureSizeEnc & 0xFF00) >> 8;\n\n\t\t\t\t\t\t\t\t\t$PictureSizeEnc['x'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 4, 2)) >> 7;\n\t\t\t\t\t\t\t\t\t$PictureSizeEnc['y'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 2)) >> 7;\n\t\t\t\t\t\t\t\t\t$info['video']['resolution_x'] = $PictureSizeEnc['x'] & 0xFF;\n\t\t\t\t\t\t\t\t\t$info['video']['resolution_y'] = $PictureSizeEnc['y'] & 0xFF;\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t$PictureSizeEnc['x'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 4, 3)) >> 7;\n\t\t\t\t\t\t\t\t\t$PictureSizeEnc['y'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 3)) >> 7;\n\t\t\t\t\t\t\t\t\t$info['video']['resolution_x'] = $PictureSizeEnc['x'] & 0xFFFF;\n\t\t\t\t\t\t\t\t\t$info['video']['resolution_y'] = $PictureSizeEnc['y'] & 0xFFFF;\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\t$info['video']['resolution_x'] = 352;\n\t\t\t\t\t\t\t\t\t$info['video']['resolution_y'] = 288;\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\t$info['video']['resolution_x'] = 176;\n\t\t\t\t\t\t\t\t\t$info['video']['resolution_y'] = 144;\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\t\t$info['video']['resolution_x'] = 128;\n\t\t\t\t\t\t\t\t\t$info['video']['resolution_y'] = 96;\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\t\t\t$info['video']['resolution_x'] = 320;\n\t\t\t\t\t\t\t\t\t$info['video']['resolution_y'] = 240;\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\t\t\t$info['video']['resolution_x'] = 160;\n\t\t\t\t\t\t\t\t\t$info['video']['resolution_y'] = 120;\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t$info['video']['resolution_x'] = 0;\n\t\t\t\t\t\t\t\t\t$info['video']['resolution_y'] = 0;\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} elseif ($info['flv']['video']['videoCodec'] ==  GETID3_FLV_VIDEO_VP6FLV_ALPHA) {\n\n\t\t\t\t\t\t\t/* contributed by schouwerwou\u00c3\u02dcgmail*com */\n\t\t\t\t\t\t\tif (!isset($info['video']['resolution_x'])) { // only when meta data isn't set\n\t\t\t\t\t\t\t\t$PictureSizeEnc['x'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 2));\n\t\t\t\t\t\t\t\t$PictureSizeEnc['y'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 7, 2));\n\t\t\t\t\t\t\t\t$info['video']['resolution_x'] = ($PictureSizeEnc['x'] & 0xFF) << 3;\n\t\t\t\t\t\t\t\t$info['video']['resolution_y'] = ($PictureSizeEnc['y'] & 0xFF) << 3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/* end schouwerwou\u00c3\u02dcgmail*com */\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!empty($info['video']['resolution_x']) && !empty($info['video']['resolution_y'])) {\n\t\t\t\t\t\t\t$info['video']['pixel_aspect_ratio'] = $info['video']['resolution_x'] / $info['video']['resolution_y'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Meta tag\n\t\t\t\tcase GETID3_FLV_TAG_META:\n\t\t\t\t\tif (!$found_meta) {\n\t\t\t\t\t\t$found_meta = true;\n\t\t\t\t\t\t$this->fseek(-1, SEEK_CUR);\n\t\t\t\t\t\t$datachunk = $this->fread($DataLength);\n\t\t\t\t\t\t$AMFstream = new AMFStream($datachunk);\n\t\t\t\t\t\t$reader = new AMFReader($AMFstream);\n\t\t\t\t\t\t$eventName = $reader->readData();\n\t\t\t\t\t\t$info['flv']['meta'][$eventName] = $reader->readData();\n\t\t\t\t\t\tunset($reader);\n\n\t\t\t\t\t\t$copykeys = array('framerate'=>'frame_rate', 'width'=>'resolution_x', 'height'=>'resolution_y', 'audiodatarate'=>'bitrate', 'videodatarate'=>'bitrate');\n\t\t\t\t\t\tforeach ($copykeys as $sourcekey => $destkey) {\n\t\t\t\t\t\t\tif (isset($info['flv']['meta']['onMetaData'][$sourcekey])) {\n\t\t\t\t\t\t\t\tswitch ($sourcekey) {\n\t\t\t\t\t\t\t\t\tcase 'width':\n\t\t\t\t\t\t\t\t\tcase 'height':\n\t\t\t\t\t\t\t\t\t\t$info['video'][$destkey] = intval(round($info['flv']['meta']['onMetaData'][$sourcekey]));\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 'audiodatarate':\n\t\t\t\t\t\t\t\t\t\t$info['audio'][$destkey] = getid3_lib::CastAsInt(round($info['flv']['meta']['onMetaData'][$sourcekey] * 1000));\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 'videodatarate':\n\t\t\t\t\t\t\t\t\tcase 'frame_rate':\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t$info['video'][$destkey] = $info['flv']['meta']['onMetaData'][$sourcekey];\n\t\t\t\t\t\t\t\t\t\tbreak;\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\tif (!empty($info['flv']['meta']['onMetaData']['duration'])) {\n\t\t\t\t\t\t\t$found_valid_meta_playtime = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t// noop\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->fseek($NextOffset);\n\t\t}\n\n\t\t$info['playtime_seconds'] = $Duration / 1000;\n\t\tif ($info['playtime_seconds'] > 0) {\n\t\t\t$info['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds'];\n\t\t}\n\n\t\tif ($info['flv']['header']['hasAudio']) {\n\t\t\t$info['audio']['codec']           =   self::audioFormatLookup($info['flv']['audio']['audioFormat']);\n\t\t\t$info['audio']['sample_rate']     =     self::audioRateLookup($info['flv']['audio']['audioRate']);\n\t\t\t$info['audio']['bits_per_sample'] = self::audioBitDepthLookup($info['flv']['audio']['audioSampleSize']);\n\n\t\t\t$info['audio']['channels']   =  $info['flv']['audio']['audioType'] + 1; // 0=mono,1=stereo\n\t\t\t$info['audio']['lossless']   = ($info['flv']['audio']['audioFormat'] ? false : true); // 0=uncompressed\n\t\t\t$info['audio']['dataformat'] = 'flv';\n\t\t}\n\t\tif (!empty($info['flv']['header']['hasVideo'])) {\n\t\t\t$info['video']['codec']      = self::videoCodecLookup($info['flv']['video']['videoCodec']);\n\t\t\t$info['video']['dataformat'] = 'flv';\n\t\t\t$info['video']['lossless']   = false;\n\t\t}\n\n\t\t// Set information from meta\n\t\tif (!empty($info['flv']['meta']['onMetaData']['duration'])) {\n\t\t\t$info['playtime_seconds'] = $info['flv']['meta']['onMetaData']['duration'];\n\t\t\t$info['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds'];\n\t\t}\n\t\tif (isset($info['flv']['meta']['onMetaData']['audiocodecid'])) {\n\t\t\t$info['audio']['codec'] = self::audioFormatLookup($info['flv']['meta']['onMetaData']['audiocodecid']);\n\t\t}\n\t\tif (isset($info['flv']['meta']['onMetaData']['videocodecid'])) {\n\t\t\t$info['video']['codec'] = self::videoCodecLookup($info['flv']['meta']['onMetaData']['videocodecid']);\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param int $id\n\t *\n\t * @return string|false\n\t */\n\tpublic static function audioFormatLookup($id) {\n\t\tstatic $lookup = array(\n\t\t\t0  => 'Linear PCM, platform endian',\n\t\t\t1  => 'ADPCM',\n\t\t\t2  => 'mp3',\n\t\t\t3  => 'Linear PCM, little endian',\n\t\t\t4  => 'Nellymoser 16kHz mono',\n\t\t\t5  => 'Nellymoser 8kHz mono',\n\t\t\t6  => 'Nellymoser',\n\t\t\t7  => 'G.711A-law logarithmic PCM',\n\t\t\t8  => 'G.711 mu-law logarithmic PCM',\n\t\t\t9  => 'reserved',\n\t\t\t10 => 'AAC',\n\t\t\t11 => 'Speex',\n\t\t\t12 => false, // unknown?\n\t\t\t13 => false, // unknown?\n\t\t\t14 => 'mp3 8kHz',\n\t\t\t15 => 'Device-specific sound',\n\t\t);\n\t\treturn (isset($lookup[$id]) ? $lookup[$id] : false);\n\t}\n\n\t/**\n\t * @param int $id\n\t *\n\t * @return int|false\n\t */\n\tpublic static function audioRateLookup($id) {\n\t\tstatic $lookup = array(\n\t\t\t0 =>  5500,\n\t\t\t1 => 11025,\n\t\t\t2 => 22050,\n\t\t\t3 => 44100,\n\t\t);\n\t\treturn (isset($lookup[$id]) ? $lookup[$id] : false);\n\t}\n\n\t/**\n\t * @param int $id\n\t *\n\t * @return int|false\n\t */\n\tpublic static function audioBitDepthLookup($id) {\n\t\tstatic $lookup = array(\n\t\t\t0 =>  8,\n\t\t\t1 => 16,\n\t\t);\n\t\treturn (isset($lookup[$id]) ? $lookup[$id] : false);\n\t}\n\n\t/**\n\t * @param int $id\n\t *\n\t * @return string|false\n\t */\n\tpublic static function videoCodecLookup($id) {\n\t\tstatic $lookup = array(\n\t\t\tGETID3_FLV_VIDEO_H263         => 'Sorenson H.263',\n\t\t\tGETID3_FLV_VIDEO_SCREEN       => 'Screen video',\n\t\t\tGETID3_FLV_VIDEO_VP6FLV       => 'On2 VP6',\n\t\t\tGETID3_FLV_VIDEO_VP6FLV_ALPHA => 'On2 VP6 with alpha channel',\n\t\t\tGETID3_FLV_VIDEO_SCREENV2     => 'Screen video v2',\n\t\t\tGETID3_FLV_VIDEO_H264         => 'Sorenson H.264',\n\t\t);\n\t\treturn (isset($lookup[$id]) ? $lookup[$id] : false);\n\t}\n}\n\nclass AMFStream\n{\n\t/**\n\t * @var string\n\t */\n\tpublic $bytes;\n\n\t/**\n\t * @var int\n\t */\n\tpublic $pos;\n\n\t/**\n\t * @param string $bytes\n\t */\n\tpublic function __construct(&$bytes) {\n\t\t$this->bytes =& $bytes;\n\t\t$this->pos = 0;\n\t}\n\n\t/**\n\t * @return int\n\t */\n\tpublic function readByte() { //  8-bit\n\t\treturn ord(substr($this->bytes, $this->pos++, 1));\n\t}\n\n\t/**\n\t * @return int\n\t */\n\tpublic function readInt() { // 16-bit\n\t\treturn ($this->readByte() << 8) + $this->readByte();\n\t}\n\n\t/**\n\t * @return int\n\t */\n\tpublic function readLong() { // 32-bit\n\t\treturn ($this->readByte() << 24) + ($this->readByte() << 16) + ($this->readByte() << 8) + $this->readByte();\n\t}\n\n\t/**\n\t * @return float|false\n\t */\n\tpublic function readDouble() {\n\t\treturn getid3_lib::BigEndian2Float($this->read(8));\n\t}\n\n\t/**\n\t * @return string\n\t */\n\tpublic function readUTF() {\n\t\t$length = $this->readInt();\n\t\treturn $this->read($length);\n\t}\n\n\t/**\n\t * @return string\n\t */\n\tpublic function readLongUTF() {\n\t\t$length = $this->readLong();\n\t\treturn $this->read($length);\n\t}\n\n\t/**\n\t * @param int $length\n\t *\n\t * @return string\n\t */\n\tpublic function read($length) {\n\t\t$val = substr($this->bytes, $this->pos, $length);\n\t\t$this->pos += $length;\n\t\treturn $val;\n\t}\n\n\t/**\n\t * @return int\n\t */\n\tpublic function peekByte() {\n\t\t$pos = $this->pos;\n\t\t$val = $this->readByte();\n\t\t$this->pos = $pos;\n\t\treturn $val;\n\t}\n\n\t/**\n\t * @return int\n\t */\n\tpublic function peekInt() {\n\t\t$pos = $this->pos;\n\t\t$val = $this->readInt();\n\t\t$this->pos = $pos;\n\t\treturn $val;\n\t}\n\n\t/**\n\t * @return int\n\t */\n\tpublic function peekLong() {\n\t\t$pos = $this->pos;\n\t\t$val = $this->readLong();\n\t\t$this->pos = $pos;\n\t\treturn $val;\n\t}\n\n\t/**\n\t * @return float|false\n\t */\n\tpublic function peekDouble() {\n\t\t$pos = $this->pos;\n\t\t$val = $this->readDouble();\n\t\t$this->pos = $pos;\n\t\treturn $val;\n\t}\n\n\t/**\n\t * @return string\n\t */\n\tpublic function peekUTF() {\n\t\t$pos = $this->pos;\n\t\t$val = $this->readUTF();\n\t\t$this->pos = $pos;\n\t\treturn $val;\n\t}\n\n\t/**\n\t * @return string\n\t */\n\tpublic function peekLongUTF() {\n\t\t$pos = $this->pos;\n\t\t$val = $this->readLongUTF();\n\t\t$this->pos = $pos;\n\t\treturn $val;\n\t}\n}\n\nclass AMFReader\n{\n\t/**\n\t* @var AMFStream\n\t*/\n\tpublic $stream;\n\n\t/**\n\t * @param AMFStream $stream\n\t */\n\tpublic function __construct(AMFStream $stream) {\n\t\t$this->stream = $stream;\n\t}\n\n\t/**\n\t * @return mixed\n\t */\n\tpublic function readData() {\n\t\t$value = null;\n\n\t\t$type = $this->stream->readByte();\n\t\tswitch ($type) {\n\n\t\t\t// Double\n\t\t\tcase 0:\n\t\t\t\t$value = $this->readDouble();\n\t\t\tbreak;\n\n\t\t\t// Boolean\n\t\t\tcase 1:\n\t\t\t\t$value = $this->readBoolean();\n\t\t\t\tbreak;\n\n\t\t\t// String\n\t\t\tcase 2:\n\t\t\t\t$value = $this->readString();\n\t\t\t\tbreak;\n\n\t\t\t// Object\n\t\t\tcase 3:\n\t\t\t\t$value = $this->readObject();\n\t\t\t\tbreak;\n\n\t\t\t// null\n\t\t\tcase 6:\n\t\t\t\treturn null;\n\n\t\t\t// Mixed array\n\t\t\tcase 8:\n\t\t\t\t$value = $this->readMixedArray();\n\t\t\t\tbreak;\n\n\t\t\t// Array\n\t\t\tcase 10:\n\t\t\t\t$value = $this->readArray();\n\t\t\t\tbreak;\n\n\t\t\t// Date\n\t\t\tcase 11:\n\t\t\t\t$value = $this->readDate();\n\t\t\t\tbreak;\n\n\t\t\t// Long string\n\t\t\tcase 13:\n\t\t\t\t$value = $this->readLongString();\n\t\t\t\tbreak;\n\n\t\t\t// XML (handled as string)\n\t\t\tcase 15:\n\t\t\t\t$value = $this->readXML();\n\t\t\t\tbreak;\n\n\t\t\t// Typed object (handled as object)\n\t\t\tcase 16:\n\t\t\t\t$value = $this->readTypedObject();\n\t\t\t\tbreak;\n\n\t\t\t// Long string\n\t\t\tdefault:\n\t\t\t\t$value = '(unknown or unsupported data type)';\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * @return float|false\n\t */\n\tpublic function readDouble() {\n\t\treturn $this->stream->readDouble();\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function readBoolean() {\n\t\treturn $this->stream->readByte() == 1;\n\t}\n\n\t/**\n\t * @return string\n\t */\n\tpublic function readString() {\n\t\treturn $this->stream->readUTF();\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic function readObject() {\n\t\t// Get highest numerical index - ignored\n//\t\t$highestIndex = $this->stream->readLong();\n\n\t\t$data = array();\n\t\t$key = null;\n\n\t\twhile ($key = $this->stream->readUTF()) {\n\t\t\t$data[$key] = $this->readData();\n\t\t}\n\t\t// Mixed array record ends with empty string (0x00 0x00) and 0x09\n\t\tif (($key == '') && ($this->stream->peekByte() == 0x09)) {\n\t\t\t// Consume byte\n\t\t\t$this->stream->readByte();\n\t\t}\n\t\treturn $data;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic function readMixedArray() {\n\t\t// Get highest numerical index - ignored\n\t\t$highestIndex = $this->stream->readLong();\n\n\t\t$data = array();\n\t\t$key = null;\n\n\t\twhile ($key = $this->stream->readUTF()) {\n\t\t\tif (is_numeric($key)) {\n\t\t\t\t$key = (int) $key;\n\t\t\t}\n\t\t\t$data[$key] = $this->readData();\n\t\t}\n\t\t// Mixed array record ends with empty string (0x00 0x00) and 0x09\n\t\tif (($key == '') && ($this->stream->peekByte() == 0x09)) {\n\t\t\t// Consume byte\n\t\t\t$this->stream->readByte();\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic function readArray() {\n\t\t$length = $this->stream->readLong();\n\t\t$data = array();\n\n\t\tfor ($i = 0; $i < $length; $i++) {\n\t\t\t$data[] = $this->readData();\n\t\t}\n\t\treturn $data;\n\t}\n\n\t/**\n\t * @return float|false\n\t */\n\tpublic function readDate() {\n\t\t$timestamp = $this->stream->readDouble();\n\t\t$timezone = $this->stream->readInt();\n\t\treturn $timestamp;\n\t}\n\n\t/**\n\t * @return string\n\t */\n\tpublic function readLongString() {\n\t\treturn $this->stream->readLongUTF();\n\t}\n\n\t/**\n\t * @return string\n\t */\n\tpublic function readXML() {\n\t\treturn $this->stream->readLongUTF();\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic function readTypedObject() {\n\t\t$className = $this->stream->readUTF();\n\t\treturn $this->readObject();\n\t}\n}\n\nclass AVCSequenceParameterSetReader\n{\n\t/**\n\t * @var string\n\t */\n\tpublic $sps;\n\tpublic $start = 0;\n\tpublic $currentBytes = 0;\n\tpublic $currentBits = 0;\n\n\t/**\n\t * @var int\n\t */\n\tpublic $width;\n\n\t/**\n\t * @var int\n\t */\n\tpublic $height;\n\n\t/**\n\t * @param string $sps\n\t */\n\tpublic function __construct($sps) {\n\t\t$this->sps = $sps;\n\t}\n\n\tpublic function readData() {\n\t\t$this->skipBits(8);\n\t\t$this->skipBits(8);\n\t\t$profile = $this->getBits(8);                               // read profile\n\t\tif ($profile > 0) {\n\t\t\t$this->skipBits(8);\n\t\t\t$level_idc = $this->getBits(8);                         // level_idc\n\t\t\t$this->expGolombUe();                                   // seq_parameter_set_id // sps\n\t\t\t$this->expGolombUe();                                   // log2_max_frame_num_minus4\n\t\t\t$picOrderType = $this->expGolombUe();                   // pic_order_cnt_type\n\t\t\tif ($picOrderType == 0) {\n\t\t\t\t$this->expGolombUe();                               // log2_max_pic_order_cnt_lsb_minus4\n\t\t\t} elseif ($picOrderType == 1) {\n\t\t\t\t$this->skipBits(1);                                 // delta_pic_order_always_zero_flag\n\t\t\t\t$this->expGolombSe();                               // offset_for_non_ref_pic\n\t\t\t\t$this->expGolombSe();                               // offset_for_top_to_bottom_field\n\t\t\t\t$num_ref_frames_in_pic_order_cnt_cycle = $this->expGolombUe(); // num_ref_frames_in_pic_order_cnt_cycle\n\t\t\t\tfor ($i = 0; $i < $num_ref_frames_in_pic_order_cnt_cycle; $i++) {\n\t\t\t\t\t$this->expGolombSe();                           // offset_for_ref_frame[ i ]\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->expGolombUe();                                   // num_ref_frames\n\t\t\t$this->skipBits(1);                                     // gaps_in_frame_num_value_allowed_flag\n\t\t\t$pic_width_in_mbs_minus1 = $this->expGolombUe();        // pic_width_in_mbs_minus1\n\t\t\t$pic_height_in_map_units_minus1 = $this->expGolombUe(); // pic_height_in_map_units_minus1\n\n\t\t\t$frame_mbs_only_flag = $this->getBits(1);               // frame_mbs_only_flag\n\t\t\tif ($frame_mbs_only_flag == 0) {\n\t\t\t\t$this->skipBits(1);                                 // mb_adaptive_frame_field_flag\n\t\t\t}\n\t\t\t$this->skipBits(1);                                     // direct_8x8_inference_flag\n\t\t\t$frame_cropping_flag = $this->getBits(1);               // frame_cropping_flag\n\n\t\t\t$frame_crop_left_offset   = 0;\n\t\t\t$frame_crop_right_offset  = 0;\n\t\t\t$frame_crop_top_offset    = 0;\n\t\t\t$frame_crop_bottom_offset = 0;\n\n\t\t\tif ($frame_cropping_flag) {\n\t\t\t\t$frame_crop_left_offset   = $this->expGolombUe();   // frame_crop_left_offset\n\t\t\t\t$frame_crop_right_offset  = $this->expGolombUe();   // frame_crop_right_offset\n\t\t\t\t$frame_crop_top_offset    = $this->expGolombUe();   // frame_crop_top_offset\n\t\t\t\t$frame_crop_bottom_offset = $this->expGolombUe();   // frame_crop_bottom_offset\n\t\t\t}\n\t\t\t$this->skipBits(1);                                     // vui_parameters_present_flag\n\t\t\t// etc\n\n\t\t\t$this->width  = (($pic_width_in_mbs_minus1 + 1) * 16) - ($frame_crop_left_offset * 2) - ($frame_crop_right_offset * 2);\n\t\t\t$this->height = ((2 - $frame_mbs_only_flag) * ($pic_height_in_map_units_minus1 + 1) * 16) - ($frame_crop_top_offset * 2) - ($frame_crop_bottom_offset * 2);\n\t\t}\n\t}\n\n\t/**\n\t * @param int $bits\n\t */\n\tpublic function skipBits($bits) {\n\t\t$newBits = $this->currentBits + $bits;\n\t\t$this->currentBytes += (int)floor($newBits / 8);\n\t\t$this->currentBits = $newBits % 8;\n\t}\n\n\t/**\n\t * @return int\n\t */\n\tpublic function getBit() {\n\t\t$result = (getid3_lib::BigEndian2Int(substr($this->sps, $this->currentBytes, 1)) >> (7 - $this->currentBits)) & 0x01;\n\t\t$this->skipBits(1);\n\t\treturn $result;\n\t}\n\n\t/**\n\t * @param int $bits\n\t *\n\t * @return int\n\t */\n\tpublic function getBits($bits) {\n\t\t$result = 0;\n\t\tfor ($i = 0; $i < $bits; $i++) {\n\t\t\t$result = ($result << 1) + $this->getBit();\n\t\t}\n\t\treturn $result;\n\t}\n\n\t/**\n\t * @return int\n\t */\n\tpublic function expGolombUe() {\n\t\t$significantBits = 0;\n\t\t$bit = $this->getBit();\n\t\twhile ($bit == 0) {\n\t\t\t$significantBits++;\n\t\t\t$bit = $this->getBit();\n\n\t\t\tif ($significantBits > 31) {\n\t\t\t\t// something is broken, this is an emergency escape to prevent infinite loops\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\treturn (1 << $significantBits) + $this->getBits($significantBits) - 1;\n\t}\n\n\t/**\n\t * @return int\n\t */\n\tpublic function expGolombSe() {\n\t\t$result = $this->expGolombUe();\n\t\tif (($result & 0x01) == 0) {\n\t\t\treturn -($result >> 1);\n\t\t} else {\n\t\t\treturn ($result + 1) >> 1;\n\t\t}\n\t}\n\n\t/**\n\t * @return int\n\t */\n\tpublic function getWidth() {\n\t\treturn $this->width;\n\t}\n\n\t/**\n\t * @return int\n\t */\n\tpublic function getHeight() {\n\t\treturn $this->height;\n\t}\n}\n", "num_lines": 910}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/////////////////////////////////////////////////////////////////\n/// getID3() by James Heinrich <info@getid3.org>               //\n//  available at https://github.com/JamesHeinrich/getID3       //\n//            or https://www.getid3.org                        //\n//            or http://getid3.sourceforge.net                 //\n//  see readme.txt for more details                            //\n/////////////////////////////////////////////////////////////////\n//                                                             //\n// module.audio-video.matriska.php                             //\n// module for analyzing Matroska containers                    //\n// dependencies: NONE                                          //\n//                                                            ///\n/////////////////////////////////////////////////////////////////\n\nif (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers\n\texit;\n}\n\ndefine('EBML_ID_CHAPTERS',                  0x0043A770); // [10][43][A7][70] -- A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation.\ndefine('EBML_ID_SEEKHEAD',                  0x014D9B74); // [11][4D][9B][74] -- Contains the position of other level 1 elements.\ndefine('EBML_ID_TAGS',                      0x0254C367); // [12][54][C3][67] -- Element containing elements specific to Tracks/Chapters. A list of valid tags can be found <http://www.matroska.org/technical/specs/tagging/index.html>.\ndefine('EBML_ID_INFO',                      0x0549A966); // [15][49][A9][66] -- Contains miscellaneous general information and statistics on the file.\ndefine('EBML_ID_TRACKS',                    0x0654AE6B); // [16][54][AE][6B] -- A top-level block of information with many tracks described.\ndefine('EBML_ID_SEGMENT',                   0x08538067); // [18][53][80][67] -- This element contains all other top-level (level 1) elements. Typically a Matroska file is composed of 1 segment.\ndefine('EBML_ID_ATTACHMENTS',               0x0941A469); // [19][41][A4][69] -- Contain attached files.\ndefine('EBML_ID_EBML',                      0x0A45DFA3); // [1A][45][DF][A3] -- Set the EBML characteristics of the data to follow. Each EBML document has to start with this.\ndefine('EBML_ID_CUES',                      0x0C53BB6B); // [1C][53][BB][6B] -- A top-level element to speed seeking access. All entries are local to the segment.\ndefine('EBML_ID_CLUSTER',                   0x0F43B675); // [1F][43][B6][75] -- The lower level element containing the (monolithic) Block structure.\ndefine('EBML_ID_LANGUAGE',                    0x02B59C); //     [22][B5][9C] -- Specifies the language of the track in the Matroska languages form.\ndefine('EBML_ID_TRACKTIMECODESCALE',          0x03314F); //     [23][31][4F] -- The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs).\ndefine('EBML_ID_DEFAULTDURATION',             0x03E383); //     [23][E3][83] -- Number of nanoseconds (i.e. not scaled) per frame.\ndefine('EBML_ID_CODECNAME',                   0x058688); //     [25][86][88] -- A human-readable string specifying the codec.\ndefine('EBML_ID_CODECDOWNLOADURL',            0x06B240); //     [26][B2][40] -- A URL to download about the codec used.\ndefine('EBML_ID_TIMECODESCALE',               0x0AD7B1); //     [2A][D7][B1] -- Timecode scale in nanoseconds (1.000.000 means all timecodes in the segment are expressed in milliseconds).\ndefine('EBML_ID_COLOURSPACE',                 0x0EB524); //     [2E][B5][24] -- Same value as in AVI (32 bits).\ndefine('EBML_ID_GAMMAVALUE',                  0x0FB523); //     [2F][B5][23] -- Gamma Value.\ndefine('EBML_ID_CODECSETTINGS',               0x1A9697); //     [3A][96][97] -- A string describing the encoding setting used.\ndefine('EBML_ID_CODECINFOURL',                0x1B4040); //     [3B][40][40] -- A URL to find information about the codec used.\ndefine('EBML_ID_PREVFILENAME',                0x1C83AB); //     [3C][83][AB] -- An escaped filename corresponding to the previous segment.\ndefine('EBML_ID_PREVUID',                     0x1CB923); //     [3C][B9][23] -- A unique ID to identify the previous chained segment (128 bits).\ndefine('EBML_ID_NEXTFILENAME',                0x1E83BB); //     [3E][83][BB] -- An escaped filename corresponding to the next segment.\ndefine('EBML_ID_NEXTUID',                     0x1EB923); //     [3E][B9][23] -- A unique ID to identify the next chained segment (128 bits).\ndefine('EBML_ID_CONTENTCOMPALGO',               0x0254); //         [42][54] -- The compression algorithm used. Algorithms that have been specified so far are:\ndefine('EBML_ID_CONTENTCOMPSETTINGS',           0x0255); //         [42][55] -- Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track.\ndefine('EBML_ID_DOCTYPE',                       0x0282); //         [42][82] -- A string that describes the type of document that follows this EBML header ('matroska' in our case).\ndefine('EBML_ID_DOCTYPEREADVERSION',            0x0285); //         [42][85] -- The minimum DocType version an interpreter has to support to read this file.\ndefine('EBML_ID_EBMLVERSION',                   0x0286); //         [42][86] -- The version of EBML parser used to create the file.\ndefine('EBML_ID_DOCTYPEVERSION',                0x0287); //         [42][87] -- The version of DocType interpreter used to create the file.\ndefine('EBML_ID_EBMLMAXIDLENGTH',               0x02F2); //         [42][F2] -- The maximum length of the IDs you'll find in this file (4 or less in Matroska).\ndefine('EBML_ID_EBMLMAXSIZELENGTH',             0x02F3); //         [42][F3] -- The maximum length of the sizes you'll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid.\ndefine('EBML_ID_EBMLREADVERSION',               0x02F7); //         [42][F7] -- The minimum EBML version a parser has to support to read this file.\ndefine('EBML_ID_CHAPLANGUAGE',                  0x037C); //         [43][7C] -- The languages corresponding to the string, in the bibliographic ISO-639-2 form.\ndefine('EBML_ID_CHAPCOUNTRY',                   0x037E); //         [43][7E] -- The countries corresponding to the string, same 2 octets as in Internet domains.\ndefine('EBML_ID_SEGMENTFAMILY',                 0x0444); //         [44][44] -- A randomly generated unique ID that all segments related to each other must use (128 bits).\ndefine('EBML_ID_DATEUTC',                       0x0461); //         [44][61] -- Date of the origin of timecode (value 0), i.e. production date.\ndefine('EBML_ID_TAGLANGUAGE',                   0x047A); //         [44][7A] -- Specifies the language of the tag specified, in the Matroska languages form.\ndefine('EBML_ID_TAGDEFAULT',                    0x0484); //         [44][84] -- Indication to know if this is the default/original language to use for the given tag.\ndefine('EBML_ID_TAGBINARY',                     0x0485); //         [44][85] -- The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString.\ndefine('EBML_ID_TAGSTRING',                     0x0487); //         [44][87] -- The value of the Tag.\ndefine('EBML_ID_DURATION',                      0x0489); //         [44][89] -- Duration of the segment (based on TimecodeScale).\ndefine('EBML_ID_CHAPPROCESSPRIVATE',            0x050D); //         [45][0D] -- Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the \"DVD level\" equivalent.\ndefine('EBML_ID_CHAPTERFLAGENABLED',            0x0598); //         [45][98] -- Specify wether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie should skip all the content between the TimeStart and TimeEnd of this chapter.\ndefine('EBML_ID_TAGNAME',                       0x05A3); //         [45][A3] -- The name of the Tag that is going to be stored.\ndefine('EBML_ID_EDITIONENTRY',                  0x05B9); //         [45][B9] -- Contains all information about a segment edition.\ndefine('EBML_ID_EDITIONUID',                    0x05BC); //         [45][BC] -- A unique ID to identify the edition. It's useful for tagging an edition.\ndefine('EBML_ID_EDITIONFLAGHIDDEN',             0x05BD); //         [45][BD] -- If an edition is hidden (1), it should not be available to the user interface (but still to Control Tracks).\ndefine('EBML_ID_EDITIONFLAGDEFAULT',            0x05DB); //         [45][DB] -- If a flag is set (1) the edition should be used as the default one.\ndefine('EBML_ID_EDITIONFLAGORDERED',            0x05DD); //         [45][DD] -- Specify if the chapters can be defined multiple times and the order to play them is enforced.\ndefine('EBML_ID_FILEDATA',                      0x065C); //         [46][5C] -- The data of the file.\ndefine('EBML_ID_FILEMIMETYPE',                  0x0660); //         [46][60] -- MIME type of the file.\ndefine('EBML_ID_FILENAME',                      0x066E); //         [46][6E] -- Filename of the attached file.\ndefine('EBML_ID_FILEREFERRAL',                  0x0675); //         [46][75] -- A binary value that a track/codec can refer to when the attachment is needed.\ndefine('EBML_ID_FILEDESCRIPTION',               0x067E); //         [46][7E] -- A human-friendly name for the attached file.\ndefine('EBML_ID_FILEUID',                       0x06AE); //         [46][AE] -- Unique ID representing the file, as random as possible.\ndefine('EBML_ID_CONTENTENCALGO',                0x07E1); //         [47][E1] -- The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. Predefined values:\ndefine('EBML_ID_CONTENTENCKEYID',               0x07E2); //         [47][E2] -- For public key algorithms this is the ID of the public key the data was encrypted with.\ndefine('EBML_ID_CONTENTSIGNATURE',              0x07E3); //         [47][E3] -- A cryptographic signature of the contents.\ndefine('EBML_ID_CONTENTSIGKEYID',               0x07E4); //         [47][E4] -- This is the ID of the private key the data was signed with.\ndefine('EBML_ID_CONTENTSIGALGO',                0x07E5); //         [47][E5] -- The algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values:\ndefine('EBML_ID_CONTENTSIGHASHALGO',            0x07E6); //         [47][E6] -- The hash algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values:\ndefine('EBML_ID_MUXINGAPP',                     0x0D80); //         [4D][80] -- Muxing application or library (\"libmatroska-0.4.3\").\ndefine('EBML_ID_SEEK',                          0x0DBB); //         [4D][BB] -- Contains a single seek entry to an EBML element.\ndefine('EBML_ID_CONTENTENCODINGORDER',          0x1031); //         [50][31] -- Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder elements in the segment.\ndefine('EBML_ID_CONTENTENCODINGSCOPE',          0x1032); //         [50][32] -- A bit field that describes which elements have been modified in this way. Values (big endian) can be OR'ed. Possible values:\ndefine('EBML_ID_CONTENTENCODINGTYPE',           0x1033); //         [50][33] -- A value describing what kind of transformation has been done. Possible values:\ndefine('EBML_ID_CONTENTCOMPRESSION',            0x1034); //         [50][34] -- Settings describing the compression used. Must be present if the value of ContentEncodingType is 0 and absent otherwise. Each block must be decompressable even if no previous block is available in order not to prevent seeking.\ndefine('EBML_ID_CONTENTENCRYPTION',             0x1035); //         [50][35] -- Settings describing the encryption used. Must be present if the value of ContentEncodingType is 1 and absent otherwise.\ndefine('EBML_ID_CUEREFNUMBER',                  0x135F); //         [53][5F] -- Number of the referenced Block of Track X in the specified Cluster.\ndefine('EBML_ID_NAME',                          0x136E); //         [53][6E] -- A human-readable track name.\ndefine('EBML_ID_CUEBLOCKNUMBER',                0x1378); //         [53][78] -- Number of the Block in the specified Cluster.\ndefine('EBML_ID_TRACKOFFSET',                   0x137F); //         [53][7F] -- A value to add to the Block's Timecode. This can be used to adjust the playback offset of a track.\ndefine('EBML_ID_SEEKID',                        0x13AB); //         [53][AB] -- The binary ID corresponding to the element name.\ndefine('EBML_ID_SEEKPOSITION',                  0x13AC); //         [53][AC] -- The position of the element in the segment in octets (0 = first level 1 element).\ndefine('EBML_ID_STEREOMODE',                    0x13B8); //         [53][B8] -- Stereo-3D video mode.\ndefine('EBML_ID_OLDSTEREOMODE',                 0x13B9); //         [53][B9] -- Bogus StereoMode value used in old versions of libmatroska. DO NOT USE. (0: mono, 1: right eye, 2: left eye, 3: both eyes).\ndefine('EBML_ID_PIXELCROPBOTTOM',               0x14AA); //         [54][AA] -- The number of video pixels to remove at the bottom of the image (for HDTV content).\ndefine('EBML_ID_DISPLAYWIDTH',                  0x14B0); //         [54][B0] -- Width of the video frames to display.\ndefine('EBML_ID_DISPLAYUNIT',                   0x14B2); //         [54][B2] -- Type of the unit for DisplayWidth/Height (0: pixels, 1: centimeters, 2: inches).\ndefine('EBML_ID_ASPECTRATIOTYPE',               0x14B3); //         [54][B3] -- Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed).\ndefine('EBML_ID_DISPLAYHEIGHT',                 0x14BA); //         [54][BA] -- Height of the video frames to display.\ndefine('EBML_ID_PIXELCROPTOP',                  0x14BB); //         [54][BB] -- The number of video pixels to remove at the top of the image.\ndefine('EBML_ID_PIXELCROPLEFT',                 0x14CC); //         [54][CC] -- The number of video pixels to remove on the left of the image.\ndefine('EBML_ID_PIXELCROPRIGHT',                0x14DD); //         [54][DD] -- The number of video pixels to remove on the right of the image.\ndefine('EBML_ID_FLAGFORCED',                    0x15AA); //         [55][AA] -- Set if that track MUST be used during playback. There can be many forced track for a kind (audio, video or subs), the player should select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind.\ndefine('EBML_ID_MAXBLOCKADDITIONID',            0x15EE); //         [55][EE] -- The maximum value of BlockAddID. A value 0 means there is no BlockAdditions for this track.\ndefine('EBML_ID_WRITINGAPP',                    0x1741); //         [57][41] -- Writing application (\"mkvmerge-0.3.3\").\ndefine('EBML_ID_CLUSTERSILENTTRACKS',           0x1854); //         [58][54] -- The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking. Then you should decide what track to use.\ndefine('EBML_ID_CLUSTERSILENTTRACKNUMBER',      0x18D7); //         [58][D7] -- One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster.\ndefine('EBML_ID_ATTACHEDFILE',                  0x21A7); //         [61][A7] -- An attached file.\ndefine('EBML_ID_CONTENTENCODING',               0x2240); //         [62][40] -- Settings for one content encoding like compression or encryption.\ndefine('EBML_ID_BITDEPTH',                      0x2264); //         [62][64] -- Bits per sample, mostly used for PCM.\ndefine('EBML_ID_CODECPRIVATE',                  0x23A2); //         [63][A2] -- Private data only known to the codec.\ndefine('EBML_ID_TARGETS',                       0x23C0); //         [63][C0] -- Contain all UIDs where the specified meta data apply. It is void to describe everything in the segment.\ndefine('EBML_ID_CHAPTERPHYSICALEQUIV',          0x23C3); //         [63][C3] -- Specify the physical equivalent of this ChapterAtom like \"DVD\" (60) or \"SIDE\" (50), see complete list of values.\ndefine('EBML_ID_TAGCHAPTERUID',                 0x23C4); //         [63][C4] -- A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment.\ndefine('EBML_ID_TAGTRACKUID',                   0x23C5); //         [63][C5] -- A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment.\ndefine('EBML_ID_TAGATTACHMENTUID',              0x23C6); //         [63][C6] -- A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment.\ndefine('EBML_ID_TAGEDITIONUID',                 0x23C9); //         [63][C9] -- A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment.\ndefine('EBML_ID_TARGETTYPE',                    0x23CA); //         [63][CA] -- An informational string that can be used to display the logical level of the target like \"ALBUM\", \"TRACK\", \"MOVIE\", \"CHAPTER\", etc (see TargetType).\ndefine('EBML_ID_TRACKTRANSLATE',                0x2624); //         [66][24] -- The track identification for the given Chapter Codec.\ndefine('EBML_ID_TRACKTRANSLATETRACKID',         0x26A5); //         [66][A5] -- The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used.\ndefine('EBML_ID_TRACKTRANSLATECODEC',           0x26BF); //         [66][BF] -- The chapter codec using this ID (0: Matroska Script, 1: DVD-menu).\ndefine('EBML_ID_TRACKTRANSLATEEDITIONUID',      0x26FC); //         [66][FC] -- Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the segment.\ndefine('EBML_ID_SIMPLETAG',                     0x27C8); //         [67][C8] -- Contains general information about the target.\ndefine('EBML_ID_TARGETTYPEVALUE',               0x28CA); //         [68][CA] -- A number to indicate the logical level of the target (see TargetType).\ndefine('EBML_ID_CHAPPROCESSCOMMAND',            0x2911); //         [69][11] -- Contains all the commands associated to the Atom.\ndefine('EBML_ID_CHAPPROCESSTIME',               0x2922); //         [69][22] -- Defines when the process command should be handled (0: during the whole chapter, 1: before starting playback, 2: after playback of the chapter).\ndefine('EBML_ID_CHAPTERTRANSLATE',              0x2924); //         [69][24] -- A tuple of corresponding ID used by chapter codecs to represent this segment.\ndefine('EBML_ID_CHAPPROCESSDATA',               0x2933); //         [69][33] -- Contains the command information. The data should be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands.\ndefine('EBML_ID_CHAPPROCESS',                   0x2944); //         [69][44] -- Contains all the commands associated to the Atom.\ndefine('EBML_ID_CHAPPROCESSCODECID',            0x2955); //         [69][55] -- Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later.\ndefine('EBML_ID_CHAPTERTRANSLATEID',            0x29A5); //         [69][A5] -- The binary value used to represent this segment in the chapter codec data. The format depends on the ChapProcessCodecID used.\ndefine('EBML_ID_CHAPTERTRANSLATECODEC',         0x29BF); //         [69][BF] -- The chapter codec using this ID (0: Matroska Script, 1: DVD-menu).\ndefine('EBML_ID_CHAPTERTRANSLATEEDITIONUID',    0x29FC); //         [69][FC] -- Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the segment.\ndefine('EBML_ID_CONTENTENCODINGS',              0x2D80); //         [6D][80] -- Settings for several content encoding mechanisms like compression or encryption.\ndefine('EBML_ID_MINCACHE',                      0x2DE7); //         [6D][E7] -- The minimum number of frames a player should be able to cache during playback. If set to 0, the reference pseudo-cache system is not used.\ndefine('EBML_ID_MAXCACHE',                      0x2DF8); //         [6D][F8] -- The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed.\ndefine('EBML_ID_CHAPTERSEGMENTUID',             0x2E67); //         [6E][67] -- A segment to play in place of this chapter. Edition ChapterSegmentEditionUID should be used for this segment, otherwise no edition is used.\ndefine('EBML_ID_CHAPTERSEGMENTEDITIONUID',      0x2EBC); //         [6E][BC] -- The edition to play from the segment linked in ChapterSegmentUID.\ndefine('EBML_ID_TRACKOVERLAY',                  0x2FAB); //         [6F][AB] -- Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track should be used instead. The order of multiple TrackOverlay matters, the first one is the one that should be used. If not found it should be the second, etc.\ndefine('EBML_ID_TAG',                           0x3373); //         [73][73] -- Element containing elements specific to Tracks/Chapters.\ndefine('EBML_ID_SEGMENTFILENAME',               0x3384); //         [73][84] -- A filename corresponding to this segment.\ndefine('EBML_ID_SEGMENTUID',                    0x33A4); //         [73][A4] -- A randomly generated unique ID to identify the current segment between many others (128 bits).\ndefine('EBML_ID_CHAPTERUID',                    0x33C4); //         [73][C4] -- A unique ID to identify the Chapter.\ndefine('EBML_ID_TRACKUID',                      0x33C5); //         [73][C5] -- A unique ID to identify the Track. This should be kept the same when making a direct stream copy of the Track to another file.\ndefine('EBML_ID_ATTACHMENTLINK',                0x3446); //         [74][46] -- The UID of an attachment that is used by this codec.\ndefine('EBML_ID_CLUSTERBLOCKADDITIONS',         0x35A1); //         [75][A1] -- Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data.\ndefine('EBML_ID_CHANNELPOSITIONS',              0x347B); //         [7D][7B] -- Table of horizontal angles for each successive channel, see appendix.\ndefine('EBML_ID_OUTPUTSAMPLINGFREQUENCY',       0x38B5); //         [78][B5] -- Real output sampling frequency in Hz (used for SBR techniques).\ndefine('EBML_ID_TITLE',                         0x3BA9); //         [7B][A9] -- General name of the segment.\ndefine('EBML_ID_CHAPTERDISPLAY',                  0x00); //             [80] -- Contains all possible strings to use for the chapter display.\ndefine('EBML_ID_TRACKTYPE',                       0x03); //             [83] -- A set of track types coded on 8 bits (1: video, 2: audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: control).\ndefine('EBML_ID_CHAPSTRING',                      0x05); //             [85] -- Contains the string to use as the chapter atom.\ndefine('EBML_ID_CODECID',                         0x06); //             [86] -- An ID corresponding to the codec, see the codec page for more info.\ndefine('EBML_ID_FLAGDEFAULT',                     0x08); //             [88] -- Set if that track (audio, video or subs) SHOULD be used if no language found matches the user preference.\ndefine('EBML_ID_CHAPTERTRACKNUMBER',              0x09); //             [89] -- UID of the Track to apply this chapter too. In the absense of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absense of this element indicates that the Chapter should be applied to any currently used Tracks.\ndefine('EBML_ID_CLUSTERSLICES',                   0x0E); //             [8E] -- Contains slices description.\ndefine('EBML_ID_CHAPTERTRACK',                    0x0F); //             [8F] -- List of tracks on which the chapter applies. If this element is not present, all tracks apply\ndefine('EBML_ID_CHAPTERTIMESTART',                0x11); //             [91] -- Timecode of the start of Chapter (not scaled).\ndefine('EBML_ID_CHAPTERTIMEEND',                  0x12); //             [92] -- Timecode of the end of Chapter (timecode excluded, not scaled).\ndefine('EBML_ID_CUEREFTIME',                      0x16); //             [96] -- Timecode of the referenced Block.\ndefine('EBML_ID_CUEREFCLUSTER',                   0x17); //             [97] -- Position of the Cluster containing the referenced Block.\ndefine('EBML_ID_CHAPTERFLAGHIDDEN',               0x18); //             [98] -- If a chapter is hidden (1), it should not be available to the user interface (but still to Control Tracks).\ndefine('EBML_ID_FLAGINTERLACED',                  0x1A); //             [9A] -- Set if the video is interlaced.\ndefine('EBML_ID_CLUSTERBLOCKDURATION',            0x1B); //             [9B] -- The duration of the Block (based on TimecodeScale). This element is mandatory when DefaultDuration is set for the track. When not written and with no DefaultDuration, the value is assumed to be the difference between the timecode of this Block and the timecode of the next Block in \"display\" order (not coding order). This element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks.\ndefine('EBML_ID_FLAGLACING',                      0x1C); //             [9C] -- Set if the track may contain blocks using lacing.\ndefine('EBML_ID_CHANNELS',                        0x1F); //             [9F] -- Numbers of channels in the track.\ndefine('EBML_ID_CLUSTERBLOCKGROUP',               0x20); //             [A0] -- Basic container of information containing a single Block or BlockVirtual, and information specific to that Block/VirtualBlock.\ndefine('EBML_ID_CLUSTERBLOCK',                    0x21); //             [A1] -- Block containing the actual data to be rendered and a timecode relative to the Cluster Timecode.\ndefine('EBML_ID_CLUSTERBLOCKVIRTUAL',             0x22); //             [A2] -- A Block with no data. It must be stored in the stream at the place the real Block should be in display order.\ndefine('EBML_ID_CLUSTERSIMPLEBLOCK',              0x23); //             [A3] -- Similar to Block but without all the extra information, mostly used to reduced overhead when no extra feature is needed.\ndefine('EBML_ID_CLUSTERCODECSTATE',               0x24); //             [A4] -- The new codec state to use. Data interpretation is private to the codec. This information should always be referenced by a seek entry.\ndefine('EBML_ID_CLUSTERBLOCKADDITIONAL',          0x25); //             [A5] -- Interpreted by the codec as it wishes (using the BlockAddID).\ndefine('EBML_ID_CLUSTERBLOCKMORE',                0x26); //             [A6] -- Contain the BlockAdditional and some parameters.\ndefine('EBML_ID_CLUSTERPOSITION',                 0x27); //             [A7] -- Position of the Cluster in the segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.\ndefine('EBML_ID_CODECDECODEALL',                  0x2A); //             [AA] -- The codec can decode potentially damaged data.\ndefine('EBML_ID_CLUSTERPREVSIZE',                 0x2B); //             [AB] -- Size of the previous Cluster, in octets. Can be useful for backward playing.\ndefine('EBML_ID_TRACKENTRY',                      0x2E); //             [AE] -- Describes a track with all elements.\ndefine('EBML_ID_CLUSTERENCRYPTEDBLOCK',           0x2F); //             [AF] -- Similar to SimpleBlock but the data inside the Block are Transformed (encrypt and/or signed).\ndefine('EBML_ID_PIXELWIDTH',                      0x30); //             [B0] -- Width of the encoded video frames in pixels.\ndefine('EBML_ID_CUETIME',                         0x33); //             [B3] -- Absolute timecode according to the segment time base.\ndefine('EBML_ID_SAMPLINGFREQUENCY',               0x35); //             [B5] -- Sampling frequency in Hz.\ndefine('EBML_ID_CHAPTERATOM',                     0x36); //             [B6] -- Contains the atom information to use as the chapter atom (apply to all tracks).\ndefine('EBML_ID_CUETRACKPOSITIONS',               0x37); //             [B7] -- Contain positions for different tracks corresponding to the timecode.\ndefine('EBML_ID_FLAGENABLED',                     0x39); //             [B9] -- Set if the track is used.\ndefine('EBML_ID_PIXELHEIGHT',                     0x3A); //             [BA] -- Height of the encoded video frames in pixels.\ndefine('EBML_ID_CUEPOINT',                        0x3B); //             [BB] -- Contains all information relative to a seek point in the segment.\ndefine('EBML_ID_CRC32',                           0x3F); //             [BF] -- The CRC is computed on all the data of the Master element it's in, regardless of its position. It's recommended to put the CRC value at the beggining of the Master element for easier reading. All level 1 elements should include a CRC-32.\ndefine('EBML_ID_CLUSTERBLOCKADDITIONID',          0x4B); //             [CB] -- The ID of the BlockAdditional element (0 is the main Block).\ndefine('EBML_ID_CLUSTERLACENUMBER',               0x4C); //             [CC] -- The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback.\ndefine('EBML_ID_CLUSTERFRAMENUMBER',              0x4D); //             [CD] -- The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame).\ndefine('EBML_ID_CLUSTERDELAY',                    0x4E); //             [CE] -- The (scaled) delay to apply to the element.\ndefine('EBML_ID_CLUSTERDURATION',                 0x4F); //             [CF] -- The (scaled) duration to apply to the element.\ndefine('EBML_ID_TRACKNUMBER',                     0x57); //             [D7] -- The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number).\ndefine('EBML_ID_CUEREFERENCE',                    0x5B); //             [DB] -- The Clusters containing the required referenced Blocks.\ndefine('EBML_ID_VIDEO',                           0x60); //             [E0] -- Video settings.\ndefine('EBML_ID_AUDIO',                           0x61); //             [E1] -- Audio settings.\ndefine('EBML_ID_CLUSTERTIMESLICE',                0x68); //             [E8] -- Contains extra time information about the data contained in the Block. While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback.\ndefine('EBML_ID_CUECODECSTATE',                   0x6A); //             [EA] -- The position of the Codec State corresponding to this Cue element. 0 means that the data is taken from the initial Track Entry.\ndefine('EBML_ID_CUEREFCODECSTATE',                0x6B); //             [EB] -- The position of the Codec State corresponding to this referenced element. 0 means that the data is taken from the initial Track Entry.\ndefine('EBML_ID_VOID',                            0x6C); //             [EC] -- Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use.\ndefine('EBML_ID_CLUSTERTIMECODE',                 0x67); //             [E7] -- Absolute timecode of the cluster (based on TimecodeScale).\ndefine('EBML_ID_CLUSTERBLOCKADDID',               0x6E); //             [EE] -- An ID to identify the BlockAdditional level.\ndefine('EBML_ID_CUECLUSTERPOSITION',              0x71); //             [F1] -- The position of the Cluster containing the required Block.\ndefine('EBML_ID_CUETRACK',                        0x77); //             [F7] -- The track for which a position is given.\ndefine('EBML_ID_CLUSTERREFERENCEPRIORITY',        0x7A); //             [FA] -- This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced.\ndefine('EBML_ID_CLUSTERREFERENCEBLOCK',           0x7B); //             [FB] -- Timecode of another frame used as a reference (ie: B or P frame). The timecode is relative to the block it's attached to.\ndefine('EBML_ID_CLUSTERREFERENCEVIRTUAL',         0x7D); //             [FD] -- Relative position of the data that should be in position of the virtual block.\n\n\n/**\n* @tutorial http://www.matroska.org/technical/specs/index.html\n*\n* @todo Rewrite EBML parser to reduce it's size and honor default element values\n* @todo After rewrite implement stream size calculation, that will provide additional useful info and enable AAC/FLAC audio bitrate detection\n*/\nclass getid3_matroska extends getid3_handler\n{\n\t/**\n\t * If true, do not return information about CLUSTER chunks, since there's a lot of them\n\t * and they're not usually useful [default: TRUE].\n\t *\n\t * @var bool\n\t */\n\tpublic static $hide_clusters    = true;\n\n\t/**\n\t * True to parse the whole file, not only header [default: FALSE].\n\t *\n\t * @var bool\n\t */\n\tpublic static $parse_whole_file = false;\n\n\t/*\n\t * Private parser settings/placeholders.\n\t */\n\tprivate $EBMLbuffer        = '';\n\tprivate $EBMLbuffer_offset = 0;\n\tprivate $EBMLbuffer_length = 0;\n\tprivate $current_offset    = 0;\n\tprivate $unuseful_elements = array(EBML_ID_CRC32, EBML_ID_VOID);\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function Analyze()\n\t{\n\t\t$info = &$this->getid3->info;\n\n\t\t// parse container\n\t\ttry {\n\t\t\t$this->parseEBML($info);\n\t\t} catch (Exception $e) {\n\t\t\t$this->error('EBML parser: '.$e->getMessage());\n\t\t}\n\n\t\t// calculate playtime\n\t\tif (isset($info['matroska']['info']) && is_array($info['matroska']['info'])) {\n\t\t\tforeach ($info['matroska']['info'] as $key => $infoarray) {\n\t\t\t\tif (isset($infoarray['Duration'])) {\n\t\t\t\t\t// TimecodeScale is how many nanoseconds each Duration unit is\n\t\t\t\t\t$info['playtime_seconds'] = $infoarray['Duration'] * ((isset($infoarray['TimecodeScale']) ? $infoarray['TimecodeScale'] : 1000000) / 1000000000);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// extract tags\n\t\tif (isset($info['matroska']['tags']) && is_array($info['matroska']['tags'])) {\n\t\t\tforeach ($info['matroska']['tags'] as $key => $infoarray) {\n\t\t\t\t$this->ExtractCommentsSimpleTag($infoarray);\n\t\t\t}\n\t\t}\n\n\t\t// process tracks\n\t\tif (isset($info['matroska']['tracks']['tracks']) && is_array($info['matroska']['tracks']['tracks'])) {\n\t\t\tforeach ($info['matroska']['tracks']['tracks'] as $key => $trackarray) {\n\n\t\t\t\t$track_info = array();\n\t\t\t\t$track_info['dataformat'] = self::CodecIDtoCommonName($trackarray['CodecID']);\n\t\t\t\t$track_info['default'] = (isset($trackarray['FlagDefault']) ? $trackarray['FlagDefault'] : true);\n\t\t\t\tif (isset($trackarray['Name'])) { $track_info['name'] = $trackarray['Name']; }\n\n\t\t\t\tswitch ($trackarray['TrackType']) {\n\n\t\t\t\t\tcase 1: // Video\n\t\t\t\t\t\t$track_info['resolution_x'] = $trackarray['PixelWidth'];\n\t\t\t\t\t\t$track_info['resolution_y'] = $trackarray['PixelHeight'];\n\t\t\t\t\t\t$track_info['display_unit'] = self::displayUnit(isset($trackarray['DisplayUnit']) ? $trackarray['DisplayUnit'] : 0);\n\t\t\t\t\t\t$track_info['display_x']    = (isset($trackarray['DisplayWidth']) ? $trackarray['DisplayWidth'] : $trackarray['PixelWidth']);\n\t\t\t\t\t\t$track_info['display_y']    = (isset($trackarray['DisplayHeight']) ? $trackarray['DisplayHeight'] : $trackarray['PixelHeight']);\n\n\t\t\t\t\t\tif (isset($trackarray['PixelCropBottom'])) { $track_info['crop_bottom'] = $trackarray['PixelCropBottom']; }\n\t\t\t\t\t\tif (isset($trackarray['PixelCropTop']))    { $track_info['crop_top']    = $trackarray['PixelCropTop']; }\n\t\t\t\t\t\tif (isset($trackarray['PixelCropLeft']))   { $track_info['crop_left']   = $trackarray['PixelCropLeft']; }\n\t\t\t\t\t\tif (isset($trackarray['PixelCropRight']))  { $track_info['crop_right']  = $trackarray['PixelCropRight']; }\n\t\t\t\t\t\tif (isset($trackarray['DefaultDuration'])) { $track_info['frame_rate']  = round(1000000000 / $trackarray['DefaultDuration'], 3); }\n\t\t\t\t\t\tif (isset($trackarray['CodecName']))       { $track_info['codec']       = $trackarray['CodecName']; }\n\n\t\t\t\t\t\tswitch ($trackarray['CodecID']) {\n\t\t\t\t\t\t\tcase 'V_MS/VFW/FOURCC':\n\t\t\t\t\t\t\t\tgetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true);\n\n\t\t\t\t\t\t\t\t$parsed = getid3_riff::ParseBITMAPINFOHEADER($trackarray['CodecPrivate']);\n\t\t\t\t\t\t\t\t$track_info['codec'] = getid3_riff::fourccLookup($parsed['fourcc']);\n\t\t\t\t\t\t\t\t$info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $parsed;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t/*case 'V_MPEG4/ISO/AVC':\n\t\t\t\t\t\t\t\t$h264['profile']    = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], 1, 1));\n\t\t\t\t\t\t\t\t$h264['level']      = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], 3, 1));\n\t\t\t\t\t\t\t\t$rn                 = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], 4, 1));\n\t\t\t\t\t\t\t\t$h264['NALUlength'] = ($rn & 3) + 1;\n\t\t\t\t\t\t\t\t$rn                 = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], 5, 1));\n\t\t\t\t\t\t\t\t$nsps               = ($rn & 31);\n\t\t\t\t\t\t\t\t$offset             = 6;\n\t\t\t\t\t\t\t\tfor ($i = 0; $i < $nsps; $i ++) {\n\t\t\t\t\t\t\t\t\t$length        = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], $offset, 2));\n\t\t\t\t\t\t\t\t\t$h264['SPS'][] = substr($trackarray['CodecPrivate'], $offset + 2, $length);\n\t\t\t\t\t\t\t\t\t$offset       += 2 + $length;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$npps               = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], $offset, 1));\n\t\t\t\t\t\t\t\t$offset            += 1;\n\t\t\t\t\t\t\t\tfor ($i = 0; $i < $npps; $i ++) {\n\t\t\t\t\t\t\t\t\t$length        = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], $offset, 2));\n\t\t\t\t\t\t\t\t\t$h264['PPS'][] = substr($trackarray['CodecPrivate'], $offset + 2, $length);\n\t\t\t\t\t\t\t\t\t$offset       += 2 + $length;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $h264;\n\t\t\t\t\t\t\t\tbreak;*/\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$info['video']['streams'][$trackarray['TrackUID']] = $track_info;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 2: // Audio\n\t\t\t\t\t\t$track_info['sample_rate'] = (isset($trackarray['SamplingFrequency']) ? $trackarray['SamplingFrequency'] : 8000.0);\n\t\t\t\t\t\t$track_info['channels']    = (isset($trackarray['Channels']) ? $trackarray['Channels'] : 1);\n\t\t\t\t\t\t$track_info['language']    = (isset($trackarray['Language']) ? $trackarray['Language'] : 'eng');\n\t\t\t\t\t\tif (isset($trackarray['BitDepth']))  { $track_info['bits_per_sample'] = $trackarray['BitDepth']; }\n\t\t\t\t\t\tif (isset($trackarray['CodecName'])) { $track_info['codec']           = $trackarray['CodecName']; }\n\n\t\t\t\t\t\tswitch ($trackarray['CodecID']) {\n\t\t\t\t\t\t\tcase 'A_PCM/INT/LIT':\n\t\t\t\t\t\t\tcase 'A_PCM/INT/BIG':\n\t\t\t\t\t\t\t\t$track_info['bitrate'] = $track_info['sample_rate'] * $track_info['channels'] * $trackarray['BitDepth'];\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'A_AC3':\n\t\t\t\t\t\t\tcase 'A_EAC3':\n\t\t\t\t\t\t\tcase 'A_DTS':\n\t\t\t\t\t\t\tcase 'A_MPEG/L3':\n\t\t\t\t\t\t\tcase 'A_MPEG/L2':\n\t\t\t\t\t\t\tcase 'A_FLAC':\n\t\t\t\t\t\t\t\t$module_dataformat = ($track_info['dataformat'] == 'mp2' ? 'mp3' : ($track_info['dataformat'] == 'eac3' ? 'ac3' : $track_info['dataformat']));\n\t\t\t\t\t\t\t\tgetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.'.$module_dataformat.'.php', __FILE__, true);\n\n\t\t\t\t\t\t\t\tif (!isset($info['matroska']['track_data_offsets'][$trackarray['TrackNumber']])) {\n\t\t\t\t\t\t\t\t\t$this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because $info[matroska][track_data_offsets]['.$trackarray['TrackNumber'].'] not set');\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// create temp instance\n\t\t\t\t\t\t\t\t$getid3_temp = new getID3();\n\t\t\t\t\t\t\t\tif ($track_info['dataformat'] != 'flac') {\n\t\t\t\t\t\t\t\t\t$getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$getid3_temp->info['avdataoffset'] = $info['matroska']['track_data_offsets'][$trackarray['TrackNumber']]['offset'];\n\t\t\t\t\t\t\t\tif ($track_info['dataformat'][0] == 'm' || $track_info['dataformat'] == 'flac') {\n\t\t\t\t\t\t\t\t\t$getid3_temp->info['avdataend'] = $info['matroska']['track_data_offsets'][$trackarray['TrackNumber']]['offset'] + $info['matroska']['track_data_offsets'][$trackarray['TrackNumber']]['length'];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// analyze\n\t\t\t\t\t\t\t\t$class = 'getid3_'.$module_dataformat;\n\t\t\t\t\t\t\t\t$header_data_key = $track_info['dataformat'][0] == 'm' ? 'mpeg' : $track_info['dataformat'];\n\t\t\t\t\t\t\t\t$getid3_audio = new $class($getid3_temp, __CLASS__);\n\t\t\t\t\t\t\t\tif ($track_info['dataformat'] == 'flac') {\n\t\t\t\t\t\t\t\t\t$getid3_audio->AnalyzeString($trackarray['CodecPrivate']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t$getid3_audio->Analyze();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (!empty($getid3_temp->info[$header_data_key])) {\n\t\t\t\t\t\t\t\t\t$info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $getid3_temp->info[$header_data_key];\n\t\t\t\t\t\t\t\t\tif (isset($getid3_temp->info['audio']) && is_array($getid3_temp->info['audio'])) {\n\t\t\t\t\t\t\t\t\t\tforeach ($getid3_temp->info['audio'] as $sub_key => $value) {\n\t\t\t\t\t\t\t\t\t\t\t$track_info[$sub_key] = $value;\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}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t$this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because '.$class.'::Analyze() failed at offset '.$getid3_temp->info['avdataoffset']);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// copy errors and warnings\n\t\t\t\t\t\t\t\tif (!empty($getid3_temp->info['error'])) {\n\t\t\t\t\t\t\t\t\tforeach ($getid3_temp->info['error'] as $newerror) {\n\t\t\t\t\t\t\t\t\t\t$this->warning($class.'() says: ['.$newerror.']');\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\tif (!empty($getid3_temp->info['warning'])) {\n\t\t\t\t\t\t\t\t\tforeach ($getid3_temp->info['warning'] as $newerror) {\n\t\t\t\t\t\t\t\t\t\t$this->warning($class.'() says: ['.$newerror.']');\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\tunset($getid3_temp, $getid3_audio);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'A_AAC':\n\t\t\t\t\t\t\tcase 'A_AAC/MPEG2/LC':\n\t\t\t\t\t\t\tcase 'A_AAC/MPEG2/LC/SBR':\n\t\t\t\t\t\t\tcase 'A_AAC/MPEG4/LC':\n\t\t\t\t\t\t\tcase 'A_AAC/MPEG4/LC/SBR':\n\t\t\t\t\t\t\t\t$this->warning($trackarray['CodecID'].' audio data contains no header, audio/video bitrates can\\'t be calculated');\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'A_VORBIS':\n\t\t\t\t\t\t\t\tif (!isset($trackarray['CodecPrivate'])) {\n\t\t\t\t\t\t\t\t\t$this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because CodecPrivate data not set');\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$vorbis_offset = strpos($trackarray['CodecPrivate'], 'vorbis', 1);\n\t\t\t\t\t\t\t\tif ($vorbis_offset === false) {\n\t\t\t\t\t\t\t\t\t$this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because CodecPrivate data does not contain \"vorbis\" keyword');\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$vorbis_offset -= 1;\n\n\t\t\t\t\t\t\t\tgetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ogg.php', __FILE__, true);\n\n\t\t\t\t\t\t\t\t// create temp instance\n\t\t\t\t\t\t\t\t$getid3_temp = new getID3();\n\n\t\t\t\t\t\t\t\t// analyze\n\t\t\t\t\t\t\t\t$getid3_ogg = new getid3_ogg($getid3_temp);\n\t\t\t\t\t\t\t\t$oggpageinfo['page_seqno'] = 0;\n\t\t\t\t\t\t\t\t$getid3_ogg->ParseVorbisPageHeader($trackarray['CodecPrivate'], $vorbis_offset, $oggpageinfo);\n\t\t\t\t\t\t\t\tif (!empty($getid3_temp->info['ogg'])) {\n\t\t\t\t\t\t\t\t\t$info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $getid3_temp->info['ogg'];\n\t\t\t\t\t\t\t\t\tif (isset($getid3_temp->info['audio']) && is_array($getid3_temp->info['audio'])) {\n\t\t\t\t\t\t\t\t\t\tforeach ($getid3_temp->info['audio'] as $sub_key => $value) {\n\t\t\t\t\t\t\t\t\t\t\t$track_info[$sub_key] = $value;\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}\n\n\t\t\t\t\t\t\t\t// copy errors and warnings\n\t\t\t\t\t\t\t\tif (!empty($getid3_temp->info['error'])) {\n\t\t\t\t\t\t\t\t\tforeach ($getid3_temp->info['error'] as $newerror) {\n\t\t\t\t\t\t\t\t\t\t$this->warning('getid3_ogg() says: ['.$newerror.']');\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\tif (!empty($getid3_temp->info['warning'])) {\n\t\t\t\t\t\t\t\t\tforeach ($getid3_temp->info['warning'] as $newerror) {\n\t\t\t\t\t\t\t\t\t\t$this->warning('getid3_ogg() says: ['.$newerror.']');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (!empty($getid3_temp->info['ogg']['bitrate_nominal'])) {\n\t\t\t\t\t\t\t\t\t$track_info['bitrate'] = $getid3_temp->info['ogg']['bitrate_nominal'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tunset($getid3_temp, $getid3_ogg, $oggpageinfo, $vorbis_offset);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'A_MS/ACM':\n\t\t\t\t\t\t\t\tgetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true);\n\n\t\t\t\t\t\t\t\t$parsed = getid3_riff::parseWAVEFORMATex($trackarray['CodecPrivate']);\n\t\t\t\t\t\t\t\tforeach ($parsed as $sub_key => $value) {\n\t\t\t\t\t\t\t\t\tif ($sub_key != 'raw') {\n\t\t\t\t\t\t\t\t\t\t$track_info[$sub_key] = $value;\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\t$info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $parsed;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$this->warning('Unhandled audio type \"'.(isset($trackarray['CodecID']) ? $trackarray['CodecID'] : '').'\"');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$info['audio']['streams'][$trackarray['TrackUID']] = $track_info;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($info['video']['streams'])) {\n\t\t\t\t$info['video'] = self::getDefaultStreamInfo($info['video']['streams']);\n\t\t\t}\n\t\t\tif (!empty($info['audio']['streams'])) {\n\t\t\t\t$info['audio'] = self::getDefaultStreamInfo($info['audio']['streams']);\n\t\t\t}\n\t\t}\n\n\t\t// process attachments\n\t\tif (isset($info['matroska']['attachments']) && $this->getid3->option_save_attachments !== getID3::ATTACHMENTS_NONE) {\n\t\t\tforeach ($info['matroska']['attachments'] as $i => $entry) {\n\t\t\t\tif (strpos($entry['FileMimeType'], 'image/') === 0 && !empty($entry['FileData'])) {\n\t\t\t\t\t$info['matroska']['comments']['picture'][] = array('data' => $entry['FileData'], 'image_mime' => $entry['FileMimeType'], 'filename' => $entry['FileName']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// determine mime type\n\t\tif (!empty($info['video']['streams'])) {\n\t\t\t$info['mime_type'] = ($info['matroska']['doctype'] == 'webm' ? 'video/webm' : 'video/x-matroska');\n\t\t} elseif (!empty($info['audio']['streams'])) {\n\t\t\t$info['mime_type'] = ($info['matroska']['doctype'] == 'webm' ? 'audio/webm' : 'audio/x-matroska');\n\t\t} elseif (isset($info['mime_type'])) {\n\t\t\tunset($info['mime_type']);\n\t\t}\n\n\t\t// use _STATISTICS_TAGS if available to set audio/video bitrates\n\t\tif (!empty($info['matroska']['tags'])) {\n\t\t\t$_STATISTICS_byTrackUID = array();\n\t\t\tforeach ($info['matroska']['tags'] as $key1 => $value1) {\n\t\t\t\tif (!empty($value1['Targets']['TagTrackUID'][0]) && !empty($value1['SimpleTag'])) {\n\t\t\t\t\tforeach ($value1['SimpleTag'] as $key2 => $value2) {\n\t\t\t\t\t\tif (!empty($value2['TagName']) && isset($value2['TagString'])) {\n\t\t\t\t\t\t\t$_STATISTICS_byTrackUID[$value1['Targets']['TagTrackUID'][0]][$value2['TagName']] = $value2['TagString'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach (array('audio','video') as $avtype) {\n\t\t\t\tif (!empty($info[$avtype]['streams'])) {\n\t\t\t\t\tforeach ($info[$avtype]['streams'] as $trackUID => $trackdata) {\n\t\t\t\t\t\tif (!isset($trackdata['bitrate']) && !empty($_STATISTICS_byTrackUID[$trackUID]['BPS'])) {\n\t\t\t\t\t\t\t$info[$avtype]['streams'][$trackUID]['bitrate'] = (int) $_STATISTICS_byTrackUID[$trackUID]['BPS'];\n\t\t\t\t\t\t\t@$info[$avtype]['bitrate'] += $info[$avtype]['streams'][$trackUID]['bitrate'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param array $info\n\t */\n\tprivate function parseEBML(&$info) {\n\t\t// http://www.matroska.org/technical/specs/index.html#EBMLBasics\n\t\t$this->current_offset = $info['avdataoffset'];\n\n\t\twhile ($this->getEBMLelement($top_element, $info['avdataend'])) {\n\t\t\tswitch ($top_element['id']) {\n\n\t\t\t\tcase EBML_ID_EBML:\n\t\t\t\t\t$info['matroska']['header']['offset'] = $top_element['offset'];\n\t\t\t\t\t$info['matroska']['header']['length'] = $top_element['length'];\n\n\t\t\t\t\twhile ($this->getEBMLelement($element_data, $top_element['end'], true)) {\n\t\t\t\t\t\tswitch ($element_data['id']) {\n\n\t\t\t\t\t\t\tcase EBML_ID_EBMLVERSION:\n\t\t\t\t\t\t\tcase EBML_ID_EBMLREADVERSION:\n\t\t\t\t\t\t\tcase EBML_ID_EBMLMAXIDLENGTH:\n\t\t\t\t\t\t\tcase EBML_ID_EBMLMAXSIZELENGTH:\n\t\t\t\t\t\t\tcase EBML_ID_DOCTYPEVERSION:\n\t\t\t\t\t\t\tcase EBML_ID_DOCTYPEREADVERSION:\n\t\t\t\t\t\t\t\t$element_data['data'] = getid3_lib::BigEndian2Int($element_data['data']);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase EBML_ID_DOCTYPE:\n\t\t\t\t\t\t\t\t$element_data['data'] = getid3_lib::trimNullByte($element_data['data']);\n\t\t\t\t\t\t\t\t$info['matroska']['doctype'] = $element_data['data'];\n\t\t\t\t\t\t\t\t$info['fileformat'] = $element_data['data'];\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$this->unhandledElement('header', __LINE__, $element_data);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tunset($element_data['offset'], $element_data['end']);\n\t\t\t\t\t\t$info['matroska']['header']['elements'][] = $element_data;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase EBML_ID_SEGMENT:\n\t\t\t\t\t$info['matroska']['segment'][0]['offset'] = $top_element['offset'];\n\t\t\t\t\t$info['matroska']['segment'][0]['length'] = $top_element['length'];\n\n\t\t\t\t\twhile ($this->getEBMLelement($element_data, $top_element['end'])) {\n\t\t\t\t\t\tif ($element_data['id'] != EBML_ID_CLUSTER || !self::$hide_clusters) { // collect clusters only if required\n\t\t\t\t\t\t\t$info['matroska']['segments'][] = $element_data;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tswitch ($element_data['id']) {\n\n\t\t\t\t\t\t\tcase EBML_ID_SEEKHEAD: // Contains the position of other level 1 elements.\n\n\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($seek_entry, $element_data['end'])) {\n\t\t\t\t\t\t\t\t\tswitch ($seek_entry['id']) {\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_SEEK: // Contains a single seek entry to an EBML element\n\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_seek_entry, $seek_entry['end'], true)) {\n\n\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_seek_entry['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_SEEKID:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$seek_entry['target_id']   = self::EBML2Int($sub_seek_entry['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$seek_entry['target_name'] = self::EBMLidName($seek_entry['target_id']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_SEEKPOSITION:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$seek_entry['target_offset'] = $element_data['offset'] + getid3_lib::BigEndian2Int($sub_seek_entry['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('seekhead.seek', __LINE__, $sub_seek_entry);\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif (!isset($seek_entry['target_id'])) {\n\t\t\t\t\t\t\t\t\t\t\t\t$this->warning('seek_entry[target_id] unexpectedly not set at '.$seek_entry['offset']);\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif (($seek_entry['target_id'] != EBML_ID_CLUSTER) || !self::$hide_clusters) { // collect clusters only if required\n\t\t\t\t\t\t\t\t\t\t\t\t$info['matroska']['seek'][] = $seek_entry;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('seekhead', __LINE__, $seek_entry);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\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\tbreak;\n\n\t\t\t\t\t\t\tcase EBML_ID_TRACKS: // A top-level block of information with many tracks described.\n\t\t\t\t\t\t\t\t$info['matroska']['tracks'] = $element_data;\n\n\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($track_entry, $element_data['end'])) {\n\t\t\t\t\t\t\t\t\tswitch ($track_entry['id']) {\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_TRACKENTRY: //subelements: Describes a track with all elements.\n\n\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($subelement, $track_entry['end'], array(EBML_ID_VIDEO, EBML_ID_AUDIO, EBML_ID_CONTENTENCODINGS, EBML_ID_CODECPRIVATE))) {\n\t\t\t\t\t\t\t\t\t\t\t\tswitch ($subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_TRACKUID:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$subelement['id_name']] = getid3_lib::PrintHexBytes($subelement['data'], true, false);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_TRACKNUMBER:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_TRACKTYPE:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_MINCACHE:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_MAXCACHE:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_MAXBLOCKADDITIONID:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_DEFAULTDURATION: // nanoseconds per frame\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$subelement['id_name']] = getid3_lib::BigEndian2Int($subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_TRACKTIMECODESCALE:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$subelement['id_name']] = getid3_lib::BigEndian2Float($subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CODECID:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_LANGUAGE:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_NAME:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CODECNAME:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$subelement['id_name']] = getid3_lib::trimNullByte($subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CODECPRIVATE:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$subelement['id_name']] = $this->readEBMLelementData($subelement['length'], true);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_FLAGENABLED:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_FLAGDEFAULT:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_FLAGFORCED:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_FLAGLACING:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CODECDECODEALL:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$subelement['id_name']] = (bool) getid3_lib::BigEndian2Int($subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_VIDEO:\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_subelement, $subelement['end'], true)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_PIXELWIDTH:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_PIXELHEIGHT:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_PIXELCROPBOTTOM:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_PIXELCROPTOP:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_PIXELCROPLEFT:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_PIXELCROPRIGHT:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_DISPLAYWIDTH:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_DISPLAYHEIGHT:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_DISPLAYUNIT:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_ASPECTRATIOTYPE:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_STEREOMODE:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_OLDSTEREOMODE:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_FLAGINTERLACED:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$sub_subelement['id_name']] = (bool)getid3_lib::BigEndian2Int($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_GAMMAVALUE:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$sub_subelement['id_name']] = getid3_lib::BigEndian2Float($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_COLOURSPACE:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$sub_subelement['id_name']] = getid3_lib::trimNullByte($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('track.video', __LINE__, $sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_AUDIO:\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_subelement, $subelement['end'], true)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHANNELS:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_BITDEPTH:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_SAMPLINGFREQUENCY:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_OUTPUTSAMPLINGFREQUENCY:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$sub_subelement['id_name']] = getid3_lib::BigEndian2Float($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHANNELPOSITIONS:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$sub_subelement['id_name']] = getid3_lib::trimNullByte($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('track.audio', __LINE__, $sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CONTENTENCODINGS:\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_subelement, $subelement['end'])) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CONTENTENCODING:\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_sub_subelement, $sub_subelement['end'], array(EBML_ID_CONTENTCOMPRESSION, EBML_ID_CONTENTENCRYPTION))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CONTENTENCODINGORDER:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CONTENTENCODINGSCOPE:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CONTENTENCODINGTYPE:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$sub_subelement['id_name']][$sub_sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CONTENTCOMPRESSION:\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_sub_sub_subelement, $sub_sub_subelement['end'], true)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_sub_sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CONTENTCOMPALGO:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$sub_subelement['id_name']][$sub_sub_subelement['id_name']][$sub_sub_sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_sub_sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CONTENTCOMPSETTINGS:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$sub_subelement['id_name']][$sub_sub_subelement['id_name']][$sub_sub_sub_subelement['id_name']] = $sub_sub_sub_subelement['data'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('track.contentencodings.contentencoding.contentcompression', __LINE__, $sub_sub_sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CONTENTENCRYPTION:\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_sub_sub_subelement, $sub_sub_subelement['end'], true)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_sub_sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CONTENTENCALGO:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CONTENTSIGALGO:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CONTENTSIGHASHALGO:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$sub_subelement['id_name']][$sub_sub_subelement['id_name']][$sub_sub_sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_sub_sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CONTENTENCKEYID:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CONTENTSIGNATURE:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CONTENTSIGKEYID:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$track_entry[$sub_subelement['id_name']][$sub_sub_subelement['id_name']][$sub_sub_sub_subelement['id_name']] = $sub_sub_sub_subelement['data'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('track.contentencodings.contentencoding.contentcompression', __LINE__, $sub_sub_sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('track.contentencodings.contentencoding', __LINE__, $sub_sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\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\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('track.contentencodings', __LINE__, $sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('track', __LINE__, $subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$info['matroska']['tracks']['tracks'][] = $track_entry;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('tracks', __LINE__, $track_entry);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\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\tbreak;\n\n\t\t\t\t\t\t\tcase EBML_ID_INFO: // Contains miscellaneous general information and statistics on the file.\n\t\t\t\t\t\t\t\t$info_entry = array();\n\n\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($subelement, $element_data['end'], true)) {\n\t\t\t\t\t\t\t\t\tswitch ($subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_TIMECODESCALE:\n\t\t\t\t\t\t\t\t\t\t\t$info_entry[$subelement['id_name']] = getid3_lib::BigEndian2Int($subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_DURATION:\n\t\t\t\t\t\t\t\t\t\t\t$info_entry[$subelement['id_name']] = getid3_lib::BigEndian2Float($subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_DATEUTC:\n\t\t\t\t\t\t\t\t\t\t\t$info_entry[$subelement['id_name']]         = getid3_lib::BigEndian2Int($subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t$info_entry[$subelement['id_name'].'_unix'] = self::EBMLdate2unix($info_entry[$subelement['id_name']]);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_SEGMENTUID:\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_PREVUID:\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_NEXTUID:\n\t\t\t\t\t\t\t\t\t\t\t$info_entry[$subelement['id_name']] = getid3_lib::trimNullByte($subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_SEGMENTFAMILY:\n\t\t\t\t\t\t\t\t\t\t\t$info_entry[$subelement['id_name']][] = getid3_lib::trimNullByte($subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_SEGMENTFILENAME:\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_PREVFILENAME:\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_NEXTFILENAME:\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_TITLE:\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_MUXINGAPP:\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_WRITINGAPP:\n\t\t\t\t\t\t\t\t\t\t\t$info_entry[$subelement['id_name']] = getid3_lib::trimNullByte($subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t$info['matroska']['comments'][strtolower($subelement['id_name'])][] = $info_entry[$subelement['id_name']];\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPTERTRANSLATE:\n\t\t\t\t\t\t\t\t\t\t\t$chaptertranslate_entry = array();\n\n\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_subelement, $subelement['end'], true)) {\n\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPTERTRANSLATEEDITIONUID:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$chaptertranslate_entry[$sub_subelement['id_name']][] = getid3_lib::BigEndian2Int($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPTERTRANSLATECODEC:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$chaptertranslate_entry[$sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPTERTRANSLATEID:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$chaptertranslate_entry[$sub_subelement['id_name']] = getid3_lib::trimNullByte($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('info.chaptertranslate', __LINE__, $sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$info_entry[$subelement['id_name']] = $chaptertranslate_entry;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('info', __LINE__, $subelement);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\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\t$info['matroska']['info'][] = $info_entry;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase EBML_ID_CUES: // A top-level element to speed seeking access. All entries are local to the segment. Should be mandatory for non \"live\" streams.\n\t\t\t\t\t\t\t\tif (self::$hide_clusters) { // do not parse cues if hide clusters is \"ON\" till they point to clusters anyway\n\t\t\t\t\t\t\t\t\t$this->current_offset = $element_data['end'];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$cues_entry = array();\n\n\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($subelement, $element_data['end'])) {\n\t\t\t\t\t\t\t\t\tswitch ($subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CUEPOINT:\n\t\t\t\t\t\t\t\t\t\t\t$cuepoint_entry = array();\n\n\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_subelement, $subelement['end'], array(EBML_ID_CUETRACKPOSITIONS))) {\n\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CUETRACKPOSITIONS:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cuetrackpositions_entry = array();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_sub_subelement, $sub_subelement['end'], true)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CUETRACK:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CUECLUSTERPOSITION:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CUEBLOCKNUMBER:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CUECODECSTATE:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cuetrackpositions_entry[$sub_sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('cues.cuepoint.cuetrackpositions', __LINE__, $sub_sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cuepoint_entry[$sub_subelement['id_name']][] = $cuetrackpositions_entry;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CUETIME:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cuepoint_entry[$sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('cues.cuepoint', __LINE__, $sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$cues_entry[] = $cuepoint_entry;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('cues', __LINE__, $subelement);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\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\t$info['matroska']['cues'] = $cues_entry;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase EBML_ID_TAGS: // Element containing elements specific to Tracks/Chapters.\n\t\t\t\t\t\t\t\t$tags_entry = array();\n\n\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($subelement, $element_data['end'], false)) {\n\t\t\t\t\t\t\t\t\tswitch ($subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_TAG:\n\t\t\t\t\t\t\t\t\t\t\t$tag_entry = array();\n\n\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_subelement, $subelement['end'], false)) {\n\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_TARGETS:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$targets_entry = array();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_sub_subelement, $sub_subelement['end'], true)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_TARGETTYPEVALUE:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$targets_entry[$sub_sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$targets_entry[strtolower($sub_sub_subelement['id_name']).'_long'] = self::TargetTypeValue($targets_entry[$sub_sub_subelement['id_name']]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_TARGETTYPE:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$targets_entry[$sub_sub_subelement['id_name']] = $sub_sub_subelement['data'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_TAGTRACKUID:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_TAGEDITIONUID:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_TAGCHAPTERUID:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_TAGATTACHMENTUID:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$targets_entry[$sub_sub_subelement['id_name']][] = getid3_lib::PrintHexBytes($sub_sub_subelement['data'], true, false);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('tags.tag.targets', __LINE__, $sub_sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_entry[$sub_subelement['id_name']] = $targets_entry;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_SIMPLETAG:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_entry[$sub_subelement['id_name']][] = $this->HandleEMBLSimpleTag($sub_subelement['end']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('tags.tag', __LINE__, $sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$tags_entry[] = $tag_entry;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('tags', __LINE__, $subelement);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\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\t$info['matroska']['tags'] = $tags_entry;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase EBML_ID_ATTACHMENTS: // Contain attached files.\n\n\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($subelement, $element_data['end'])) {\n\t\t\t\t\t\t\t\t\tswitch ($subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_ATTACHEDFILE:\n\t\t\t\t\t\t\t\t\t\t\t$attachedfile_entry = array();\n\n\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_subelement, $subelement['end'], array(EBML_ID_FILEDATA))) {\n\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_FILEDESCRIPTION:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_FILENAME:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_FILEMIMETYPE:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attachedfile_entry[$sub_subelement['id_name']] = $sub_subelement['data'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_FILEDATA:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attachedfile_entry['data_offset'] = $this->current_offset;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attachedfile_entry['data_length'] = $sub_subelement['length'];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attachedfile_entry[$sub_subelement['id_name']] = $this->saveAttachment(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attachedfile_entry['FileName'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attachedfile_entry['data_offset'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attachedfile_entry['data_length']);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->current_offset = $sub_subelement['end'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_FILEUID:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attachedfile_entry[$sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('attachments.attachedfile', __LINE__, $sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$info['matroska']['attachments'][] = $attachedfile_entry;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('attachments', __LINE__, $subelement);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\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\tbreak;\n\n\t\t\t\t\t\t\tcase EBML_ID_CHAPTERS:\n\n\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($subelement, $element_data['end'])) {\n\t\t\t\t\t\t\t\t\tswitch ($subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_EDITIONENTRY:\n\t\t\t\t\t\t\t\t\t\t\t$editionentry_entry = array();\n\n\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_subelement, $subelement['end'], array(EBML_ID_CHAPTERATOM))) {\n\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_EDITIONUID:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$editionentry_entry[$sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_EDITIONFLAGHIDDEN:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_EDITIONFLAGDEFAULT:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_EDITIONFLAGORDERED:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$editionentry_entry[$sub_subelement['id_name']] = (bool)getid3_lib::BigEndian2Int($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPTERATOM:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$chapteratom_entry = array();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_sub_subelement, $sub_subelement['end'], array(EBML_ID_CHAPTERTRACK, EBML_ID_CHAPTERDISPLAY))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPTERSEGMENTUID:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPTERSEGMENTEDITIONUID:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$chapteratom_entry[$sub_sub_subelement['id_name']] = $sub_sub_subelement['data'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPTERFLAGENABLED:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPTERFLAGHIDDEN:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$chapteratom_entry[$sub_sub_subelement['id_name']] = (bool)getid3_lib::BigEndian2Int($sub_sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPTERUID:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPTERTIMESTART:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPTERTIMEEND:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$chapteratom_entry[$sub_sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPTERTRACK:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$chaptertrack_entry = array();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_sub_sub_subelement, $sub_sub_subelement['end'], true)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_sub_sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPTERTRACKNUMBER:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$chaptertrack_entry[$sub_sub_sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_sub_sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('chapters.editionentry.chapteratom.chaptertrack', __LINE__, $sub_sub_sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\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\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$chapteratom_entry[$sub_sub_subelement['id_name']][] = $chaptertrack_entry;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPTERDISPLAY:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$chapterdisplay_entry = array();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_sub_sub_subelement, $sub_sub_subelement['end'], true)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_sub_sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPSTRING:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPLANGUAGE:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CHAPCOUNTRY:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$chapterdisplay_entry[$sub_sub_sub_subelement['id_name']] = $sub_sub_sub_subelement['data'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('chapters.editionentry.chapteratom.chapterdisplay', __LINE__, $sub_sub_sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\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\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$chapteratom_entry[$sub_sub_subelement['id_name']][] = $chapterdisplay_entry;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('chapters.editionentry.chapteratom', __LINE__, $sub_sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$editionentry_entry[$sub_subelement['id_name']][] = $chapteratom_entry;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('chapters.editionentry', __LINE__, $sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$info['matroska']['chapters'][] = $editionentry_entry;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('chapters', __LINE__, $subelement);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\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\tbreak;\n\n\t\t\t\t\t\t\tcase EBML_ID_CLUSTER: // The lower level element containing the (monolithic) Block structure.\n\t\t\t\t\t\t\t\t$cluster_entry = array();\n\n\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($subelement, $element_data['end'], array(EBML_ID_CLUSTERSILENTTRACKS, EBML_ID_CLUSTERBLOCKGROUP, EBML_ID_CLUSTERSIMPLEBLOCK))) {\n\t\t\t\t\t\t\t\t\tswitch ($subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CLUSTERTIMECODE:\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CLUSTERPOSITION:\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CLUSTERPREVSIZE:\n\t\t\t\t\t\t\t\t\t\t\t$cluster_entry[$subelement['id_name']] = getid3_lib::BigEndian2Int($subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CLUSTERSILENTTRACKS:\n\t\t\t\t\t\t\t\t\t\t\t$cluster_silent_tracks = array();\n\n\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_subelement, $subelement['end'], true)) {\n\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CLUSTERSILENTTRACKNUMBER:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cluster_silent_tracks[] = getid3_lib::BigEndian2Int($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('cluster.silenttracks', __LINE__, $sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$cluster_entry[$subelement['id_name']][] = $cluster_silent_tracks;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CLUSTERBLOCKGROUP:\n\t\t\t\t\t\t\t\t\t\t\t$cluster_block_group = array('offset' => $this->current_offset);\n\n\t\t\t\t\t\t\t\t\t\t\twhile ($this->getEBMLelement($sub_subelement, $subelement['end'], array(EBML_ID_CLUSTERBLOCK))) {\n\t\t\t\t\t\t\t\t\t\t\t\tswitch ($sub_subelement['id']) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CLUSTERBLOCK:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cluster_block_group[$sub_subelement['id_name']] = $this->HandleEMBLClusterBlock($sub_subelement, EBML_ID_CLUSTERBLOCK, $info);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CLUSTERREFERENCEPRIORITY: // unsigned-int\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CLUSTERBLOCKDURATION:     // unsigned-int\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cluster_block_group[$sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CLUSTERREFERENCEBLOCK:    // signed-int\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cluster_block_group[$sub_subelement['id_name']][] = getid3_lib::BigEndian2Int($sub_subelement['data'], false, true);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CLUSTERCODECSTATE:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cluster_block_group[$sub_subelement['id_name']] = getid3_lib::trimNullByte($sub_subelement['data']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('clusters.blockgroup', __LINE__, $sub_subelement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$cluster_entry[$subelement['id_name']][] = $cluster_block_group;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tcase EBML_ID_CLUSTERSIMPLEBLOCK:\n\t\t\t\t\t\t\t\t\t\t\t$cluster_entry[$subelement['id_name']][] = $this->HandleEMBLClusterBlock($subelement, EBML_ID_CLUSTERSIMPLEBLOCK, $info);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t$this->unhandledElement('cluster', __LINE__, $subelement);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->current_offset = $subelement['end'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (!self::$hide_clusters) {\n\t\t\t\t\t\t\t\t\t$info['matroska']['cluster'][] = $cluster_entry;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// check to see if all the data we need exists already, if so, break out of the loop\n\t\t\t\t\t\t\t\tif (!self::$parse_whole_file) {\n\t\t\t\t\t\t\t\t\tif (isset($info['matroska']['info']) && is_array($info['matroska']['info'])) {\n\t\t\t\t\t\t\t\t\t\tif (isset($info['matroska']['tracks']['tracks']) && is_array($info['matroska']['tracks']['tracks'])) {\n\t\t\t\t\t\t\t\t\t\t\tif (count($info['matroska']['track_data_offsets']) == count($info['matroska']['tracks']['tracks'])) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\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}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$this->unhandledElement('segment', __LINE__, $element_data);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->unhandledElement('root', __LINE__, $top_element);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param int $min_data\n\t *\n\t * @return bool\n\t */\n\tprivate function EnsureBufferHasEnoughData($min_data=1024) {\n\t\tif (($this->current_offset - $this->EBMLbuffer_offset) >= ($this->EBMLbuffer_length - $min_data)) {\n\t\t\t$read_bytes = max($min_data, $this->getid3->fread_buffer_size());\n\n\t\t\ttry {\n\t\t\t\t$this->fseek($this->current_offset);\n\t\t\t\t$this->EBMLbuffer_offset = $this->current_offset;\n\t\t\t\t$this->EBMLbuffer        = $this->fread($read_bytes);\n\t\t\t\t$this->EBMLbuffer_length = strlen($this->EBMLbuffer);\n\t\t\t} catch (getid3_exception $e) {\n\t\t\t\t$this->warning('EBML parser: '.$e->getMessage());\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ($this->EBMLbuffer_length == 0 && $this->feof()) {\n\t\t\t\treturn $this->error('EBML parser: ran out of file at offset '.$this->current_offset);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @return int|float|false\n\t */\n\tprivate function readEBMLint() {\n\t\t$actual_offset = $this->current_offset - $this->EBMLbuffer_offset;\n\n\t\t// get length of integer\n\t\t$first_byte_int = ord($this->EBMLbuffer[$actual_offset]);\n\t\tif       (0x80 & $first_byte_int) {\n\t\t\t$length = 1;\n\t\t} elseif (0x40 & $first_byte_int) {\n\t\t\t$length = 2;\n\t\t} elseif (0x20 & $first_byte_int) {\n\t\t\t$length = 3;\n\t\t} elseif (0x10 & $first_byte_int) {\n\t\t\t$length = 4;\n\t\t} elseif (0x08 & $first_byte_int) {\n\t\t\t$length = 5;\n\t\t} elseif (0x04 & $first_byte_int) {\n\t\t\t$length = 6;\n\t\t} elseif (0x02 & $first_byte_int) {\n\t\t\t$length = 7;\n\t\t} elseif (0x01 & $first_byte_int) {\n\t\t\t$length = 8;\n\t\t} else {\n\t\t\tthrow new Exception('invalid EBML integer (leading 0x00) at '.$this->current_offset);\n\t\t}\n\n\t\t// read\n\t\t$int_value = self::EBML2Int(substr($this->EBMLbuffer, $actual_offset, $length));\n\t\t$this->current_offset += $length;\n\n\t\treturn $int_value;\n\t}\n\n\t/**\n\t * @param int  $length\n\t * @param bool $check_buffer\n\t *\n\t * @return string|false\n\t */\n\tprivate function readEBMLelementData($length, $check_buffer=false) {\n\t\tif ($check_buffer && !$this->EnsureBufferHasEnoughData($length)) {\n\t\t\treturn false;\n\t\t}\n\t\t$data = substr($this->EBMLbuffer, $this->current_offset - $this->EBMLbuffer_offset, $length);\n\t\t$this->current_offset += $length;\n\t\treturn $data;\n\t}\n\n\t/**\n\t * @param array      $element\n\t * @param int        $parent_end\n\t * @param array|bool $get_data\n\t *\n\t * @return bool\n\t */\n\tprivate function getEBMLelement(&$element, $parent_end, $get_data=false) {\n\t\tif ($this->current_offset >= $parent_end) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$this->EnsureBufferHasEnoughData()) {\n\t\t\t$this->current_offset = PHP_INT_MAX; // do not exit parser right now, allow to finish current loop to gather maximum information\n\t\t\treturn false;\n\t\t}\n\n\t\t$element = array();\n\n\t\t// set offset\n\t\t$element['offset'] = $this->current_offset;\n\n\t\t// get ID\n\t\t$element['id'] = $this->readEBMLint();\n\n\t\t// get name\n\t\t$element['id_name'] = self::EBMLidName($element['id']);\n\n\t\t// get length\n\t\t$element['length'] = $this->readEBMLint();\n\n\t\t// get end offset\n\t\t$element['end'] = $this->current_offset + $element['length'];\n\n\t\t// get raw data\n\t\t$dont_parse = (in_array($element['id'], $this->unuseful_elements) || $element['id_name'] == dechex($element['id']));\n\t\tif (($get_data === true || (is_array($get_data) && !in_array($element['id'], $get_data))) && !$dont_parse) {\n\t\t\t$element['data'] = $this->readEBMLelementData($element['length'], $element);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $type\n\t * @param int    $line\n\t * @param array  $element\n\t */\n\tprivate function unhandledElement($type, $line, $element) {\n\t\t// warn only about unknown and missed elements, not about unuseful\n\t\tif (!in_array($element['id'], $this->unuseful_elements)) {\n\t\t\t$this->warning('Unhandled '.$type.' element ['.basename(__FILE__).':'.$line.'] ('.$element['id'].'::'.$element['id_name'].' ['.$element['length'].' bytes]) at '.$element['offset']);\n\t\t}\n\n\t\t// increase offset for unparsed elements\n\t\tif (!isset($element['data'])) {\n\t\t\t$this->current_offset = $element['end'];\n\t\t}\n\t}\n\n\t/**\n\t * @param array $SimpleTagArray\n\t *\n\t * @return bool\n\t */\n\tprivate function ExtractCommentsSimpleTag($SimpleTagArray) {\n\t\tif (!empty($SimpleTagArray['SimpleTag'])) {\n\t\t\tforeach ($SimpleTagArray['SimpleTag'] as $SimpleTagKey => $SimpleTagData) {\n\t\t\t\tif (!empty($SimpleTagData['TagName']) && !empty($SimpleTagData['TagString'])) {\n\t\t\t\t\t$this->getid3->info['matroska']['comments'][strtolower($SimpleTagData['TagName'])][] = $SimpleTagData['TagString'];\n\t\t\t\t}\n\t\t\t\tif (!empty($SimpleTagData['SimpleTag'])) {\n\t\t\t\t\t$this->ExtractCommentsSimpleTag($SimpleTagData);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param int $parent_end\n\t *\n\t * @return array\n\t */\n\tprivate function HandleEMBLSimpleTag($parent_end) {\n\t\t$simpletag_entry = array();\n\n\t\twhile ($this->getEBMLelement($element, $parent_end, array(EBML_ID_SIMPLETAG))) {\n\t\t\tswitch ($element['id']) {\n\n\t\t\t\tcase EBML_ID_TAGNAME:\n\t\t\t\tcase EBML_ID_TAGLANGUAGE:\n\t\t\t\tcase EBML_ID_TAGSTRING:\n\t\t\t\tcase EBML_ID_TAGBINARY:\n\t\t\t\t\t$simpletag_entry[$element['id_name']] = $element['data'];\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase EBML_ID_SIMPLETAG:\n\t\t\t\t\t$simpletag_entry[$element['id_name']][] = $this->HandleEMBLSimpleTag($element['end']);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase EBML_ID_TAGDEFAULT:\n\t\t\t\t\t$simpletag_entry[$element['id_name']] = (bool)getid3_lib::BigEndian2Int($element['data']);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->unhandledElement('tag.simpletag', __LINE__, $element);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $simpletag_entry;\n\t}\n\n\t/**\n\t * @param array $element\n\t * @param int   $block_type\n\t * @param array $info\n\t *\n\t * @return array\n\t */\n\tprivate function HandleEMBLClusterBlock($element, $block_type, &$info) {\n\t\t// http://www.matroska.org/technical/specs/index.html#block_structure\n\t\t// http://www.matroska.org/technical/specs/index.html#simpleblock_structure\n\n\t\t$block_data = array();\n\t\t$block_data['tracknumber'] = $this->readEBMLint();\n\t\t$block_data['timecode']    = getid3_lib::BigEndian2Int($this->readEBMLelementData(2), false, true);\n\t\t$block_data['flags_raw']   = getid3_lib::BigEndian2Int($this->readEBMLelementData(1));\n\n\t\tif ($block_type == EBML_ID_CLUSTERSIMPLEBLOCK) {\n\t\t\t$block_data['flags']['keyframe']  = (($block_data['flags_raw'] & 0x80) >> 7);\n\t\t\t//$block_data['flags']['reserved1'] = (($block_data['flags_raw'] & 0x70) >> 4);\n\t\t}\n\t\telse {\n\t\t\t//$block_data['flags']['reserved1'] = (($block_data['flags_raw'] & 0xF0) >> 4);\n\t\t}\n\t\t$block_data['flags']['invisible'] = (bool)(($block_data['flags_raw'] & 0x08) >> 3);\n\t\t$block_data['flags']['lacing']    =       (($block_data['flags_raw'] & 0x06) >> 1);  // 00=no lacing; 01=Xiph lacing; 11=EBML lacing; 10=fixed-size lacing\n\t\tif ($block_type == EBML_ID_CLUSTERSIMPLEBLOCK) {\n\t\t\t$block_data['flags']['discardable'] = (($block_data['flags_raw'] & 0x01));\n\t\t}\n\t\telse {\n\t\t\t//$block_data['flags']['reserved2'] = (($block_data['flags_raw'] & 0x01) >> 0);\n\t\t}\n\t\t$block_data['flags']['lacing_type'] = self::BlockLacingType($block_data['flags']['lacing']);\n\n\t\t// Lace (when lacing bit is set)\n\t\tif ($block_data['flags']['lacing'] > 0) {\n\t\t\t$block_data['lace_frames'] = getid3_lib::BigEndian2Int($this->readEBMLelementData(1)) + 1; // Number of frames in the lace-1 (uint8)\n\t\t\tif ($block_data['flags']['lacing'] != 0x02) {\n\t\t\t\tfor ($i = 1; $i < $block_data['lace_frames']; $i ++) { // Lace-coded size of each frame of the lace, except for the last one (multiple uint8). *This is not used with Fixed-size lacing as it is calculated automatically from (total size of lace) / (number of frames in lace).\n\t\t\t\t\tif ($block_data['flags']['lacing'] == 0x03) { // EBML lacing\n\t\t\t\t\t\t$block_data['lace_frames_size'][$i] = $this->readEBMLint(); // TODO: read size correctly, calc size for the last frame. For now offsets are deteminded OK with readEBMLint() and that's the most important thing.\n\t\t\t\t\t}\n\t\t\t\t\telse { // Xiph lacing\n\t\t\t\t\t\t$block_data['lace_frames_size'][$i] = 0;\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t$size = getid3_lib::BigEndian2Int($this->readEBMLelementData(1));\n\t\t\t\t\t\t\t$block_data['lace_frames_size'][$i] += $size;\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhile ($size == 255);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($block_data['flags']['lacing'] == 0x01) { // calc size of the last frame only for Xiph lacing, till EBML sizes are now anyway determined incorrectly\n\t\t\t\t\t$block_data['lace_frames_size'][] = $element['end'] - $this->current_offset - array_sum($block_data['lace_frames_size']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!isset($info['matroska']['track_data_offsets'][$block_data['tracknumber']])) {\n\t\t\t$info['matroska']['track_data_offsets'][$block_data['tracknumber']]['offset'] = $this->current_offset;\n\t\t\t$info['matroska']['track_data_offsets'][$block_data['tracknumber']]['length'] = $element['end'] - $this->current_offset;\n\t\t\t//$info['matroska']['track_data_offsets'][$block_data['tracknumber']]['total_length'] = 0;\n\t\t}\n\t\t//$info['matroska']['track_data_offsets'][$block_data['tracknumber']]['total_length'] += $info['matroska']['track_data_offsets'][$block_data['tracknumber']]['length'];\n\t\t//$info['matroska']['track_data_offsets'][$block_data['tracknumber']]['duration']      = $block_data['timecode'] * ((isset($info['matroska']['info'][0]['TimecodeScale']) ? $info['matroska']['info'][0]['TimecodeScale'] : 1000000) / 1000000000);\n\n\t\t// set offset manually\n\t\t$this->current_offset = $element['end'];\n\n\t\treturn $block_data;\n\t}\n\n\t/**\n\t * @param string $EBMLstring\n\t *\n\t * @return int|float|false\n\t */\n\tprivate static function EBML2Int($EBMLstring) {\n\t\t// http://matroska.org/specs/\n\n\t\t// Element ID coded with an UTF-8 like system:\n\t\t// 1xxx xxxx                                  - Class A IDs (2^7 -2 possible values) (base 0x8X)\n\t\t// 01xx xxxx  xxxx xxxx                       - Class B IDs (2^14-2 possible values) (base 0x4X 0xXX)\n\t\t// 001x xxxx  xxxx xxxx  xxxx xxxx            - Class C IDs (2^21-2 possible values) (base 0x2X 0xXX 0xXX)\n\t\t// 0001 xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx - Class D IDs (2^28-2 possible values) (base 0x1X 0xXX 0xXX 0xXX)\n\t\t// Values with all x at 0 and 1 are reserved (hence the -2).\n\n\t\t// Data size, in octets, is also coded with an UTF-8 like system :\n\t\t// 1xxx xxxx                                                                              - value 0 to  2^7-2\n\t\t// 01xx xxxx  xxxx xxxx                                                                   - value 0 to 2^14-2\n\t\t// 001x xxxx  xxxx xxxx  xxxx xxxx                                                        - value 0 to 2^21-2\n\t\t// 0001 xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx                                             - value 0 to 2^28-2\n\t\t// 0000 1xxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx                                  - value 0 to 2^35-2\n\t\t// 0000 01xx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx                       - value 0 to 2^42-2\n\t\t// 0000 001x  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx            - value 0 to 2^49-2\n\t\t// 0000 0001  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx - value 0 to 2^56-2\n\n\t\t$first_byte_int = ord($EBMLstring[0]);\n\t\tif (0x80 & $first_byte_int) {\n\t\t\t$EBMLstring[0] = chr($first_byte_int & 0x7F);\n\t\t} elseif (0x40 & $first_byte_int) {\n\t\t\t$EBMLstring[0] = chr($first_byte_int & 0x3F);\n\t\t} elseif (0x20 & $first_byte_int) {\n\t\t\t$EBMLstring[0] = chr($first_byte_int & 0x1F);\n\t\t} elseif (0x10 & $first_byte_int) {\n\t\t\t$EBMLstring[0] = chr($first_byte_int & 0x0F);\n\t\t} elseif (0x08 & $first_byte_int) {\n\t\t\t$EBMLstring[0] = chr($first_byte_int & 0x07);\n\t\t} elseif (0x04 & $first_byte_int) {\n\t\t\t$EBMLstring[0] = chr($first_byte_int & 0x03);\n\t\t} elseif (0x02 & $first_byte_int) {\n\t\t\t$EBMLstring[0] = chr($first_byte_int & 0x01);\n\t\t} elseif (0x01 & $first_byte_int) {\n\t\t\t$EBMLstring[0] = chr($first_byte_int & 0x00);\n\t\t}\n\n\t\treturn getid3_lib::BigEndian2Int($EBMLstring);\n\t}\n\n\t/**\n\t * @param int $EBMLdatestamp\n\t *\n\t * @return float\n\t */\n\tprivate static function EBMLdate2unix($EBMLdatestamp) {\n\t\t// Date - signed 8 octets integer in nanoseconds with 0 indicating the precise beginning of the millennium (at 2001-01-01T00:00:00,000000000 UTC)\n\t\t// 978307200 == mktime(0, 0, 0, 1, 1, 2001) == January 1, 2001 12:00:00am UTC\n\t\treturn round(($EBMLdatestamp / 1000000000) + 978307200);\n\t}\n\n\t/**\n\t * @param int $target_type\n\t *\n\t * @return string|int\n\t */\n\tpublic static function TargetTypeValue($target_type) {\n\t\t// http://www.matroska.org/technical/specs/tagging/index.html\n\t\tstatic $TargetTypeValue = array();\n\t\tif (empty($TargetTypeValue)) {\n\t\t\t$TargetTypeValue[10] = 'A: ~ V:shot';                                           // the lowest hierarchy found in music or movies\n\t\t\t$TargetTypeValue[20] = 'A:subtrack/part/movement ~ V:scene';                    // corresponds to parts of a track for audio (like a movement)\n\t\t\t$TargetTypeValue[30] = 'A:track/song ~ V:chapter';                              // the common parts of an album or a movie\n\t\t\t$TargetTypeValue[40] = 'A:part/session ~ V:part/session';                       // when an album or episode has different logical parts\n\t\t\t$TargetTypeValue[50] = 'A:album/opera/concert ~ V:movie/episode/concert';       // the most common grouping level of music and video (equals to an episode for TV series)\n\t\t\t$TargetTypeValue[60] = 'A:edition/issue/volume/opus ~ V:season/sequel/volume';  // a list of lower levels grouped together\n\t\t\t$TargetTypeValue[70] = 'A:collection ~ V:collection';                           // the high hierarchy consisting of many different lower items\n\t\t}\n\t\treturn (isset($TargetTypeValue[$target_type]) ? $TargetTypeValue[$target_type] : $target_type);\n\t}\n\n\t/**\n\t * @param int $lacingtype\n\t *\n\t * @return string|int\n\t */\n\tpublic static function BlockLacingType($lacingtype) {\n\t\t// http://matroska.org/technical/specs/index.html#block_structure\n\t\tstatic $BlockLacingType = array();\n\t\tif (empty($BlockLacingType)) {\n\t\t\t$BlockLacingType[0x00] = 'no lacing';\n\t\t\t$BlockLacingType[0x01] = 'Xiph lacing';\n\t\t\t$BlockLacingType[0x02] = 'fixed-size lacing';\n\t\t\t$BlockLacingType[0x03] = 'EBML lacing';\n\t\t}\n\t\treturn (isset($BlockLacingType[$lacingtype]) ? $BlockLacingType[$lacingtype] : $lacingtype);\n\t}\n\n\t/**\n\t * @param string $codecid\n\t *\n\t * @return string\n\t */\n\tpublic static function CodecIDtoCommonName($codecid) {\n\t\t// http://www.matroska.org/technical/specs/codecid/index.html\n\t\tstatic $CodecIDlist = array();\n\t\tif (empty($CodecIDlist)) {\n\t\t\t$CodecIDlist['A_AAC']            = 'aac';\n\t\t\t$CodecIDlist['A_AAC/MPEG2/LC']   = 'aac';\n\t\t\t$CodecIDlist['A_AC3']            = 'ac3';\n\t\t\t$CodecIDlist['A_EAC3']           = 'eac3';\n\t\t\t$CodecIDlist['A_DTS']            = 'dts';\n\t\t\t$CodecIDlist['A_FLAC']           = 'flac';\n\t\t\t$CodecIDlist['A_MPEG/L1']        = 'mp1';\n\t\t\t$CodecIDlist['A_MPEG/L2']        = 'mp2';\n\t\t\t$CodecIDlist['A_MPEG/L3']        = 'mp3';\n\t\t\t$CodecIDlist['A_PCM/INT/LIT']    = 'pcm';       // PCM Integer Little Endian\n\t\t\t$CodecIDlist['A_PCM/INT/BIG']    = 'pcm';       // PCM Integer Big Endian\n\t\t\t$CodecIDlist['A_QUICKTIME/QDMC'] = 'quicktime'; // Quicktime: QDesign Music\n\t\t\t$CodecIDlist['A_QUICKTIME/QDM2'] = 'quicktime'; // Quicktime: QDesign Music v2\n\t\t\t$CodecIDlist['A_VORBIS']         = 'vorbis';\n\t\t\t$CodecIDlist['V_MPEG1']          = 'mpeg';\n\t\t\t$CodecIDlist['V_THEORA']         = 'theora';\n\t\t\t$CodecIDlist['V_REAL/RV40']      = 'real';\n\t\t\t$CodecIDlist['V_REAL/RV10']      = 'real';\n\t\t\t$CodecIDlist['V_REAL/RV20']      = 'real';\n\t\t\t$CodecIDlist['V_REAL/RV30']      = 'real';\n\t\t\t$CodecIDlist['V_QUICKTIME']      = 'quicktime'; // Quicktime\n\t\t\t$CodecIDlist['V_MPEG4/ISO/AP']   = 'mpeg4';\n\t\t\t$CodecIDlist['V_MPEG4/ISO/ASP']  = 'mpeg4';\n\t\t\t$CodecIDlist['V_MPEG4/ISO/AVC']  = 'h264';\n\t\t\t$CodecIDlist['V_MPEG4/ISO/SP']   = 'mpeg4';\n\t\t\t$CodecIDlist['V_VP8']            = 'vp8';\n\t\t\t$CodecIDlist['V_MS/VFW/FOURCC']  = 'vcm'; // Microsoft (TM) Video Codec Manager (VCM)\n\t\t\t$CodecIDlist['A_MS/ACM']         = 'acm'; // Microsoft (TM) Audio Codec Manager (ACM)\n\t\t}\n\t\treturn (isset($CodecIDlist[$codecid]) ? $CodecIDlist[$codecid] : $codecid);\n\t}\n\n\t/**\n\t * @param int $value\n\t *\n\t * @return string\n\t */\n\tprivate static function EBMLidName($value) {\n\t\tstatic $EBMLidList = array();\n\t\tif (empty($EBMLidList)) {\n\t\t\t$EBMLidList[EBML_ID_ASPECTRATIOTYPE]            = 'AspectRatioType';\n\t\t\t$EBMLidList[EBML_ID_ATTACHEDFILE]               = 'AttachedFile';\n\t\t\t$EBMLidList[EBML_ID_ATTACHMENTLINK]             = 'AttachmentLink';\n\t\t\t$EBMLidList[EBML_ID_ATTACHMENTS]                = 'Attachments';\n\t\t\t$EBMLidList[EBML_ID_AUDIO]                      = 'Audio';\n\t\t\t$EBMLidList[EBML_ID_BITDEPTH]                   = 'BitDepth';\n\t\t\t$EBMLidList[EBML_ID_CHANNELPOSITIONS]           = 'ChannelPositions';\n\t\t\t$EBMLidList[EBML_ID_CHANNELS]                   = 'Channels';\n\t\t\t$EBMLidList[EBML_ID_CHAPCOUNTRY]                = 'ChapCountry';\n\t\t\t$EBMLidList[EBML_ID_CHAPLANGUAGE]               = 'ChapLanguage';\n\t\t\t$EBMLidList[EBML_ID_CHAPPROCESS]                = 'ChapProcess';\n\t\t\t$EBMLidList[EBML_ID_CHAPPROCESSCODECID]         = 'ChapProcessCodecID';\n\t\t\t$EBMLidList[EBML_ID_CHAPPROCESSCOMMAND]         = 'ChapProcessCommand';\n\t\t\t$EBMLidList[EBML_ID_CHAPPROCESSDATA]            = 'ChapProcessData';\n\t\t\t$EBMLidList[EBML_ID_CHAPPROCESSPRIVATE]         = 'ChapProcessPrivate';\n\t\t\t$EBMLidList[EBML_ID_CHAPPROCESSTIME]            = 'ChapProcessTime';\n\t\t\t$EBMLidList[EBML_ID_CHAPSTRING]                 = 'ChapString';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERATOM]                = 'ChapterAtom';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERDISPLAY]             = 'ChapterDisplay';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERFLAGENABLED]         = 'ChapterFlagEnabled';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERFLAGHIDDEN]          = 'ChapterFlagHidden';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERPHYSICALEQUIV]       = 'ChapterPhysicalEquiv';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERS]                   = 'Chapters';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERSEGMENTEDITIONUID]   = 'ChapterSegmentEditionUID';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERSEGMENTUID]          = 'ChapterSegmentUID';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERTIMEEND]             = 'ChapterTimeEnd';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERTIMESTART]           = 'ChapterTimeStart';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERTRACK]               = 'ChapterTrack';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERTRACKNUMBER]         = 'ChapterTrackNumber';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERTRANSLATE]           = 'ChapterTranslate';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERTRANSLATECODEC]      = 'ChapterTranslateCodec';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERTRANSLATEEDITIONUID] = 'ChapterTranslateEditionUID';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERTRANSLATEID]         = 'ChapterTranslateID';\n\t\t\t$EBMLidList[EBML_ID_CHAPTERUID]                 = 'ChapterUID';\n\t\t\t$EBMLidList[EBML_ID_CLUSTER]                    = 'Cluster';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERBLOCK]               = 'ClusterBlock';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERBLOCKADDID]          = 'ClusterBlockAddID';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERBLOCKADDITIONAL]     = 'ClusterBlockAdditional';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERBLOCKADDITIONID]     = 'ClusterBlockAdditionID';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERBLOCKADDITIONS]      = 'ClusterBlockAdditions';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERBLOCKDURATION]       = 'ClusterBlockDuration';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERBLOCKGROUP]          = 'ClusterBlockGroup';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERBLOCKMORE]           = 'ClusterBlockMore';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERBLOCKVIRTUAL]        = 'ClusterBlockVirtual';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERCODECSTATE]          = 'ClusterCodecState';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERDELAY]               = 'ClusterDelay';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERDURATION]            = 'ClusterDuration';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERENCRYPTEDBLOCK]      = 'ClusterEncryptedBlock';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERFRAMENUMBER]         = 'ClusterFrameNumber';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERLACENUMBER]          = 'ClusterLaceNumber';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERPOSITION]            = 'ClusterPosition';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERPREVSIZE]            = 'ClusterPrevSize';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERREFERENCEBLOCK]      = 'ClusterReferenceBlock';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERREFERENCEPRIORITY]   = 'ClusterReferencePriority';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERREFERENCEVIRTUAL]    = 'ClusterReferenceVirtual';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERSILENTTRACKNUMBER]   = 'ClusterSilentTrackNumber';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERSILENTTRACKS]        = 'ClusterSilentTracks';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERSIMPLEBLOCK]         = 'ClusterSimpleBlock';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERTIMECODE]            = 'ClusterTimecode';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERTIMESLICE]           = 'ClusterTimeSlice';\n\t\t\t$EBMLidList[EBML_ID_CODECDECODEALL]             = 'CodecDecodeAll';\n\t\t\t$EBMLidList[EBML_ID_CODECDOWNLOADURL]           = 'CodecDownloadURL';\n\t\t\t$EBMLidList[EBML_ID_CODECID]                    = 'CodecID';\n\t\t\t$EBMLidList[EBML_ID_CODECINFOURL]               = 'CodecInfoURL';\n\t\t\t$EBMLidList[EBML_ID_CODECNAME]                  = 'CodecName';\n\t\t\t$EBMLidList[EBML_ID_CODECPRIVATE]               = 'CodecPrivate';\n\t\t\t$EBMLidList[EBML_ID_CODECSETTINGS]              = 'CodecSettings';\n\t\t\t$EBMLidList[EBML_ID_COLOURSPACE]                = 'ColourSpace';\n\t\t\t$EBMLidList[EBML_ID_CONTENTCOMPALGO]            = 'ContentCompAlgo';\n\t\t\t$EBMLidList[EBML_ID_CONTENTCOMPRESSION]         = 'ContentCompression';\n\t\t\t$EBMLidList[EBML_ID_CONTENTCOMPSETTINGS]        = 'ContentCompSettings';\n\t\t\t$EBMLidList[EBML_ID_CONTENTENCALGO]             = 'ContentEncAlgo';\n\t\t\t$EBMLidList[EBML_ID_CONTENTENCKEYID]            = 'ContentEncKeyID';\n\t\t\t$EBMLidList[EBML_ID_CONTENTENCODING]            = 'ContentEncoding';\n\t\t\t$EBMLidList[EBML_ID_CONTENTENCODINGORDER]       = 'ContentEncodingOrder';\n\t\t\t$EBMLidList[EBML_ID_CONTENTENCODINGS]           = 'ContentEncodings';\n\t\t\t$EBMLidList[EBML_ID_CONTENTENCODINGSCOPE]       = 'ContentEncodingScope';\n\t\t\t$EBMLidList[EBML_ID_CONTENTENCODINGTYPE]        = 'ContentEncodingType';\n\t\t\t$EBMLidList[EBML_ID_CONTENTENCRYPTION]          = 'ContentEncryption';\n\t\t\t$EBMLidList[EBML_ID_CONTENTSIGALGO]             = 'ContentSigAlgo';\n\t\t\t$EBMLidList[EBML_ID_CONTENTSIGHASHALGO]         = 'ContentSigHashAlgo';\n\t\t\t$EBMLidList[EBML_ID_CONTENTSIGKEYID]            = 'ContentSigKeyID';\n\t\t\t$EBMLidList[EBML_ID_CONTENTSIGNATURE]           = 'ContentSignature';\n\t\t\t$EBMLidList[EBML_ID_CRC32]                      = 'CRC32';\n\t\t\t$EBMLidList[EBML_ID_CUEBLOCKNUMBER]             = 'CueBlockNumber';\n\t\t\t$EBMLidList[EBML_ID_CUECLUSTERPOSITION]         = 'CueClusterPosition';\n\t\t\t$EBMLidList[EBML_ID_CUECODECSTATE]              = 'CueCodecState';\n\t\t\t$EBMLidList[EBML_ID_CUEPOINT]                   = 'CuePoint';\n\t\t\t$EBMLidList[EBML_ID_CUEREFCLUSTER]              = 'CueRefCluster';\n\t\t\t$EBMLidList[EBML_ID_CUEREFCODECSTATE]           = 'CueRefCodecState';\n\t\t\t$EBMLidList[EBML_ID_CUEREFERENCE]               = 'CueReference';\n\t\t\t$EBMLidList[EBML_ID_CUEREFNUMBER]               = 'CueRefNumber';\n\t\t\t$EBMLidList[EBML_ID_CUEREFTIME]                 = 'CueRefTime';\n\t\t\t$EBMLidList[EBML_ID_CUES]                       = 'Cues';\n\t\t\t$EBMLidList[EBML_ID_CUETIME]                    = 'CueTime';\n\t\t\t$EBMLidList[EBML_ID_CUETRACK]                   = 'CueTrack';\n\t\t\t$EBMLidList[EBML_ID_CUETRACKPOSITIONS]          = 'CueTrackPositions';\n\t\t\t$EBMLidList[EBML_ID_DATEUTC]                    = 'DateUTC';\n\t\t\t$EBMLidList[EBML_ID_DEFAULTDURATION]            = 'DefaultDuration';\n\t\t\t$EBMLidList[EBML_ID_DISPLAYHEIGHT]              = 'DisplayHeight';\n\t\t\t$EBMLidList[EBML_ID_DISPLAYUNIT]                = 'DisplayUnit';\n\t\t\t$EBMLidList[EBML_ID_DISPLAYWIDTH]               = 'DisplayWidth';\n\t\t\t$EBMLidList[EBML_ID_DOCTYPE]                    = 'DocType';\n\t\t\t$EBMLidList[EBML_ID_DOCTYPEREADVERSION]         = 'DocTypeReadVersion';\n\t\t\t$EBMLidList[EBML_ID_DOCTYPEVERSION]             = 'DocTypeVersion';\n\t\t\t$EBMLidList[EBML_ID_DURATION]                   = 'Duration';\n\t\t\t$EBMLidList[EBML_ID_EBML]                       = 'EBML';\n\t\t\t$EBMLidList[EBML_ID_EBMLMAXIDLENGTH]            = 'EBMLMaxIDLength';\n\t\t\t$EBMLidList[EBML_ID_EBMLMAXSIZELENGTH]          = 'EBMLMaxSizeLength';\n\t\t\t$EBMLidList[EBML_ID_EBMLREADVERSION]            = 'EBMLReadVersion';\n\t\t\t$EBMLidList[EBML_ID_EBMLVERSION]                = 'EBMLVersion';\n\t\t\t$EBMLidList[EBML_ID_EDITIONENTRY]               = 'EditionEntry';\n\t\t\t$EBMLidList[EBML_ID_EDITIONFLAGDEFAULT]         = 'EditionFlagDefault';\n\t\t\t$EBMLidList[EBML_ID_EDITIONFLAGHIDDEN]          = 'EditionFlagHidden';\n\t\t\t$EBMLidList[EBML_ID_EDITIONFLAGORDERED]         = 'EditionFlagOrdered';\n\t\t\t$EBMLidList[EBML_ID_EDITIONUID]                 = 'EditionUID';\n\t\t\t$EBMLidList[EBML_ID_FILEDATA]                   = 'FileData';\n\t\t\t$EBMLidList[EBML_ID_FILEDESCRIPTION]            = 'FileDescription';\n\t\t\t$EBMLidList[EBML_ID_FILEMIMETYPE]               = 'FileMimeType';\n\t\t\t$EBMLidList[EBML_ID_FILENAME]                   = 'FileName';\n\t\t\t$EBMLidList[EBML_ID_FILEREFERRAL]               = 'FileReferral';\n\t\t\t$EBMLidList[EBML_ID_FILEUID]                    = 'FileUID';\n\t\t\t$EBMLidList[EBML_ID_FLAGDEFAULT]                = 'FlagDefault';\n\t\t\t$EBMLidList[EBML_ID_FLAGENABLED]                = 'FlagEnabled';\n\t\t\t$EBMLidList[EBML_ID_FLAGFORCED]                 = 'FlagForced';\n\t\t\t$EBMLidList[EBML_ID_FLAGINTERLACED]             = 'FlagInterlaced';\n\t\t\t$EBMLidList[EBML_ID_FLAGLACING]                 = 'FlagLacing';\n\t\t\t$EBMLidList[EBML_ID_GAMMAVALUE]                 = 'GammaValue';\n\t\t\t$EBMLidList[EBML_ID_INFO]                       = 'Info';\n\t\t\t$EBMLidList[EBML_ID_LANGUAGE]                   = 'Language';\n\t\t\t$EBMLidList[EBML_ID_MAXBLOCKADDITIONID]         = 'MaxBlockAdditionID';\n\t\t\t$EBMLidList[EBML_ID_MAXCACHE]                   = 'MaxCache';\n\t\t\t$EBMLidList[EBML_ID_MINCACHE]                   = 'MinCache';\n\t\t\t$EBMLidList[EBML_ID_MUXINGAPP]                  = 'MuxingApp';\n\t\t\t$EBMLidList[EBML_ID_NAME]                       = 'Name';\n\t\t\t$EBMLidList[EBML_ID_NEXTFILENAME]               = 'NextFilename';\n\t\t\t$EBMLidList[EBML_ID_NEXTUID]                    = 'NextUID';\n\t\t\t$EBMLidList[EBML_ID_OUTPUTSAMPLINGFREQUENCY]    = 'OutputSamplingFrequency';\n\t\t\t$EBMLidList[EBML_ID_PIXELCROPBOTTOM]            = 'PixelCropBottom';\n\t\t\t$EBMLidList[EBML_ID_PIXELCROPLEFT]              = 'PixelCropLeft';\n\t\t\t$EBMLidList[EBML_ID_PIXELCROPRIGHT]             = 'PixelCropRight';\n\t\t\t$EBMLidList[EBML_ID_PIXELCROPTOP]               = 'PixelCropTop';\n\t\t\t$EBMLidList[EBML_ID_PIXELHEIGHT]                = 'PixelHeight';\n\t\t\t$EBMLidList[EBML_ID_PIXELWIDTH]                 = 'PixelWidth';\n\t\t\t$EBMLidList[EBML_ID_PREVFILENAME]               = 'PrevFilename';\n\t\t\t$EBMLidList[EBML_ID_PREVUID]                    = 'PrevUID';\n\t\t\t$EBMLidList[EBML_ID_SAMPLINGFREQUENCY]          = 'SamplingFrequency';\n\t\t\t$EBMLidList[EBML_ID_SEEK]                       = 'Seek';\n\t\t\t$EBMLidList[EBML_ID_SEEKHEAD]                   = 'SeekHead';\n\t\t\t$EBMLidList[EBML_ID_SEEKID]                     = 'SeekID';\n\t\t\t$EBMLidList[EBML_ID_SEEKPOSITION]               = 'SeekPosition';\n\t\t\t$EBMLidList[EBML_ID_SEGMENT]                    = 'Segment';\n\t\t\t$EBMLidList[EBML_ID_SEGMENTFAMILY]              = 'SegmentFamily';\n\t\t\t$EBMLidList[EBML_ID_SEGMENTFILENAME]            = 'SegmentFilename';\n\t\t\t$EBMLidList[EBML_ID_SEGMENTUID]                 = 'SegmentUID';\n\t\t\t$EBMLidList[EBML_ID_SIMPLETAG]                  = 'SimpleTag';\n\t\t\t$EBMLidList[EBML_ID_CLUSTERSLICES]              = 'ClusterSlices';\n\t\t\t$EBMLidList[EBML_ID_STEREOMODE]                 = 'StereoMode';\n\t\t\t$EBMLidList[EBML_ID_OLDSTEREOMODE]              = 'OldStereoMode';\n\t\t\t$EBMLidList[EBML_ID_TAG]                        = 'Tag';\n\t\t\t$EBMLidList[EBML_ID_TAGATTACHMENTUID]           = 'TagAttachmentUID';\n\t\t\t$EBMLidList[EBML_ID_TAGBINARY]                  = 'TagBinary';\n\t\t\t$EBMLidList[EBML_ID_TAGCHAPTERUID]              = 'TagChapterUID';\n\t\t\t$EBMLidList[EBML_ID_TAGDEFAULT]                 = 'TagDefault';\n\t\t\t$EBMLidList[EBML_ID_TAGEDITIONUID]              = 'TagEditionUID';\n\t\t\t$EBMLidList[EBML_ID_TAGLANGUAGE]                = 'TagLanguage';\n\t\t\t$EBMLidList[EBML_ID_TAGNAME]                    = 'TagName';\n\t\t\t$EBMLidList[EBML_ID_TAGTRACKUID]                = 'TagTrackUID';\n\t\t\t$EBMLidList[EBML_ID_TAGS]                       = 'Tags';\n\t\t\t$EBMLidList[EBML_ID_TAGSTRING]                  = 'TagString';\n\t\t\t$EBMLidList[EBML_ID_TARGETS]                    = 'Targets';\n\t\t\t$EBMLidList[EBML_ID_TARGETTYPE]                 = 'TargetType';\n\t\t\t$EBMLidList[EBML_ID_TARGETTYPEVALUE]            = 'TargetTypeValue';\n\t\t\t$EBMLidList[EBML_ID_TIMECODESCALE]              = 'TimecodeScale';\n\t\t\t$EBMLidList[EBML_ID_TITLE]                      = 'Title';\n\t\t\t$EBMLidList[EBML_ID_TRACKENTRY]                 = 'TrackEntry';\n\t\t\t$EBMLidList[EBML_ID_TRACKNUMBER]                = 'TrackNumber';\n\t\t\t$EBMLidList[EBML_ID_TRACKOFFSET]                = 'TrackOffset';\n\t\t\t$EBMLidList[EBML_ID_TRACKOVERLAY]               = 'TrackOverlay';\n\t\t\t$EBMLidList[EBML_ID_TRACKS]                     = 'Tracks';\n\t\t\t$EBMLidList[EBML_ID_TRACKTIMECODESCALE]         = 'TrackTimecodeScale';\n\t\t\t$EBMLidList[EBML_ID_TRACKTRANSLATE]             = 'TrackTranslate';\n\t\t\t$EBMLidList[EBML_ID_TRACKTRANSLATECODEC]        = 'TrackTranslateCodec';\n\t\t\t$EBMLidList[EBML_ID_TRACKTRANSLATEEDITIONUID]   = 'TrackTranslateEditionUID';\n\t\t\t$EBMLidList[EBML_ID_TRACKTRANSLATETRACKID]      = 'TrackTranslateTrackID';\n\t\t\t$EBMLidList[EBML_ID_TRACKTYPE]                  = 'TrackType';\n\t\t\t$EBMLidList[EBML_ID_TRACKUID]                   = 'TrackUID';\n\t\t\t$EBMLidList[EBML_ID_VIDEO]                      = 'Video';\n\t\t\t$EBMLidList[EBML_ID_VOID]                       = 'Void';\n\t\t\t$EBMLidList[EBML_ID_WRITINGAPP]                 = 'WritingApp';\n\t\t}\n\n\t\treturn (isset($EBMLidList[$value]) ? $EBMLidList[$value] : dechex($value));\n\t}\n\n\t/**\n\t * @param int $value\n\t *\n\t * @return string\n\t */\n\tpublic static function displayUnit($value) {\n\t\t// http://www.matroska.org/technical/specs/index.html#DisplayUnit\n\t\tstatic $units = array(\n\t\t\t0 => 'pixels',\n\t\t\t1 => 'centimeters',\n\t\t\t2 => 'inches',\n\t\t\t3 => 'Display Aspect Ratio');\n\n\t\treturn (isset($units[$value]) ? $units[$value] : 'unknown');\n\t}\n\n\t/**\n\t * @param array $streams\n\t *\n\t * @return array\n\t */\n\tprivate static function getDefaultStreamInfo($streams)\n\t{\n\t\t$stream = array();\n\t\tforeach (array_reverse($streams) as $stream) {\n\t\t\tif ($stream['default']) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$unset = array('default', 'name');\n\t\tforeach ($unset as $u) {\n\t\t\tif (isset($stream[$u])) {\n\t\t\t\tunset($stream[$u]);\n\t\t\t}\n\t\t}\n\n\t\t$info = $stream;\n\t\t$info['streams'] = $streams;\n\n\t\treturn $info;\n\t}\n\n}\n", "num_lines": 1923}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/////////////////////////////////////////////////////////////////\n/// getID3() by James Heinrich <info@getid3.org>               //\n//  available at https://github.com/JamesHeinrich/getID3       //\n//            or https://www.getid3.org                        //\n//            or http://getid3.sourceforge.net                 //\n//  see readme.txt for more details                            //\n/////////////////////////////////////////////////////////////////\n//                                                             //\n// module.audio-video.quicktime.php                            //\n// module for analyzing Quicktime and MP3-in-MP4 files         //\n// dependencies: module.audio.mp3.php                          //\n// dependencies: module.tag.id3v2.php                          //\n//                                                            ///\n/////////////////////////////////////////////////////////////////\n\nif (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers\n\texit;\n}\ngetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.mp3.php', __FILE__, true);\ngetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true); // needed for ISO 639-2 language code lookup\n\nclass getid3_quicktime extends getid3_handler\n{\n\n\tpublic $ReturnAtomData        = true;\n\tpublic $ParseAllPossibleAtoms = false;\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function Analyze() {\n\t\t$info = &$this->getid3->info;\n\n\t\t$info['fileformat'] = 'quicktime';\n\t\t$info['quicktime']['hinting']    = false;\n\t\t$info['quicktime']['controller'] = 'standard'; // may be overridden if 'ctyp' atom is present\n\n\t\t$this->fseek($info['avdataoffset']);\n\n\t\t$offset      = 0;\n\t\t$atomcounter = 0;\n\t\t$atom_data_read_buffer_size = $info['php_memory_limit'] ? round($info['php_memory_limit'] / 4) : $this->getid3->option_fread_buffer_size * 1024; // set read buffer to 25% of PHP memory limit (if one is specified), otherwise use option_fread_buffer_size [default: 32MB]\n\t\twhile ($offset < $info['avdataend']) {\n\t\t\tif (!getid3_lib::intValueSupported($offset)) {\n\t\t\t\t$this->error('Unable to parse atom at offset '.$offset.' because beyond '.round(PHP_INT_MAX / 1073741824).'GB limit of PHP filesystem functions');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->fseek($offset);\n\t\t\t$AtomHeader = $this->fread(8);\n\n\t\t\t$atomsize = getid3_lib::BigEndian2Int(substr($AtomHeader, 0, 4));\n\t\t\t$atomname = substr($AtomHeader, 4, 4);\n\n\t\t\t// 64-bit MOV patch by jlegate\u00c3\u02dcktnc*com\n\t\t\tif ($atomsize == 1) {\n\t\t\t\t$atomsize = getid3_lib::BigEndian2Int($this->fread(8));\n\t\t\t}\n\n\t\t\tif (($offset + $atomsize) > $info['avdataend']) {\n\t\t\t\t$info['quicktime'][$atomname]['name']   = $atomname;\n\t\t\t\t$info['quicktime'][$atomname]['size']   = $atomsize;\n\t\t\t\t$info['quicktime'][$atomname]['offset'] = $offset;\n\t\t\t\t$this->error('Atom at offset '.$offset.' claims to go beyond end-of-file (length: '.$atomsize.' bytes)');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ($atomsize == 0) {\n\t\t\t\t// Furthermore, for historical reasons the list of atoms is optionally\n\t\t\t\t// terminated by a 32-bit integer set to 0. If you are writing a program\n\t\t\t\t// to read user data atoms, you should allow for the terminating 0.\n\t\t\t\t$info['quicktime'][$atomname]['name']   = $atomname;\n\t\t\t\t$info['quicktime'][$atomname]['size']   = $atomsize;\n\t\t\t\t$info['quicktime'][$atomname]['offset'] = $offset;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$atomHierarchy = array();\n\t\t\t$parsedAtomData = $this->QuicktimeParseAtom($atomname, $atomsize, $this->fread(min($atomsize, $atom_data_read_buffer_size)), $offset, $atomHierarchy, $this->ParseAllPossibleAtoms);\n\t\t\t$parsedAtomData['name']   = $atomname;\n\t\t\t$parsedAtomData['size']   = $atomsize;\n\t\t\t$parsedAtomData['offset'] = $offset;\n\t\t\tif (in_array($atomname, array('uuid'))) {\n\t\t\t\t@$info['quicktime'][$atomname][] = $parsedAtomData;\n\t\t\t} else {\n\t\t\t\t$info['quicktime'][$atomname] = $parsedAtomData;\n\t\t\t}\n\n\t\t\t$offset += $atomsize;\n\t\t\t$atomcounter++;\n\t\t}\n\n\t\tif (!empty($info['avdataend_tmp'])) {\n\t\t\t// this value is assigned to a temp value and then erased because\n\t\t\t// otherwise any atoms beyond the 'mdat' atom would not get parsed\n\t\t\t$info['avdataend'] = $info['avdataend_tmp'];\n\t\t\tunset($info['avdataend_tmp']);\n\t\t}\n\n\t\tif (!empty($info['quicktime']['comments']['chapters']) && is_array($info['quicktime']['comments']['chapters']) && (count($info['quicktime']['comments']['chapters']) > 0)) {\n\t\t\t$durations = $this->quicktime_time_to_sample_table($info);\n\t\t\tfor ($i = 0; $i < count($info['quicktime']['comments']['chapters']); $i++) {\n\t\t\t\t$bookmark = array();\n\t\t\t\t$bookmark['title'] = $info['quicktime']['comments']['chapters'][$i];\n\t\t\t\tif (isset($durations[$i])) {\n\t\t\t\t\t$bookmark['duration_sample'] = $durations[$i]['sample_duration'];\n\t\t\t\t\tif ($i > 0) {\n\t\t\t\t\t\t$bookmark['start_sample'] = $info['quicktime']['bookmarks'][($i - 1)]['start_sample'] + $info['quicktime']['bookmarks'][($i - 1)]['duration_sample'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bookmark['start_sample'] = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif ($time_scale = $this->quicktime_bookmark_time_scale($info)) {\n\t\t\t\t\t\t$bookmark['duration_seconds'] = $bookmark['duration_sample'] / $time_scale;\n\t\t\t\t\t\t$bookmark['start_seconds']    = $bookmark['start_sample']    / $time_scale;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$info['quicktime']['bookmarks'][] = $bookmark;\n\t\t\t}\n\t\t}\n\n\t\tif (isset($info['quicktime']['temp_meta_key_names'])) {\n\t\t\tunset($info['quicktime']['temp_meta_key_names']);\n\t\t}\n\n\t\tif (!empty($info['quicktime']['comments']['location.ISO6709'])) {\n\t\t\t// https://en.wikipedia.org/wiki/ISO_6709\n\t\t\tforeach ($info['quicktime']['comments']['location.ISO6709'] as $ISO6709string) {\n\t\t\t\t$ISO6709parsed = array('latitude'=>false, 'longitude'=>false, 'altitude'=>false);\n\t\t\t\tif (preg_match('#^([\\\\+\\\\-])([0-9]{2}|[0-9]{4}|[0-9]{6})(\\\\.[0-9]+)?([\\\\+\\\\-])([0-9]{3}|[0-9]{5}|[0-9]{7})(\\\\.[0-9]+)?(([\\\\+\\\\-])([0-9]{3}|[0-9]{5}|[0-9]{7})(\\\\.[0-9]+)?)?/$#', $ISO6709string, $matches)) {\n\t\t\t\t\t// phpcs:ignore PHPCompatibility.Lists.AssignmentOrder.Affected\n\t\t\t\t\t@list($dummy, $lat_sign, $lat_deg, $lat_deg_dec, $lon_sign, $lon_deg, $lon_deg_dec, $dummy, $alt_sign, $alt_deg, $alt_deg_dec) = $matches;\n\n\t\t\t\t\tif (strlen($lat_deg) == 2) {        // [+-]DD.D\n\t\t\t\t\t\t$ISO6709parsed['latitude'] = (($lat_sign == '-') ? -1 : 1) * floatval(ltrim($lat_deg, '0').$lat_deg_dec);\n\t\t\t\t\t} elseif (strlen($lat_deg) == 4) {  // [+-]DDMM.M\n\t\t\t\t\t\t$ISO6709parsed['latitude'] = (($lat_sign == '-') ? -1 : 1) * floatval(ltrim(substr($lat_deg, 0, 2), '0')) + floatval(ltrim(substr($lat_deg, 2, 2), '0').$lat_deg_dec / 60);\n\t\t\t\t\t} elseif (strlen($lat_deg) == 6) {  // [+-]DDMMSS.S\n\t\t\t\t\t\t$ISO6709parsed['latitude'] = (($lat_sign == '-') ? -1 : 1) * floatval(ltrim(substr($lat_deg, 0, 2), '0')) + floatval(ltrim(substr($lat_deg, 2, 2), '0') / 60) + floatval(ltrim(substr($lat_deg, 4, 2), '0').$lat_deg_dec / 3600);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (strlen($lon_deg) == 3) {        // [+-]DDD.D\n\t\t\t\t\t\t$ISO6709parsed['longitude'] = (($lon_sign == '-') ? -1 : 1) * floatval(ltrim($lon_deg, '0').$lon_deg_dec);\n\t\t\t\t\t} elseif (strlen($lon_deg) == 5) {  // [+-]DDDMM.M\n\t\t\t\t\t\t$ISO6709parsed['longitude'] = (($lon_sign == '-') ? -1 : 1) * floatval(ltrim(substr($lon_deg, 0, 2), '0')) + floatval(ltrim(substr($lon_deg, 2, 2), '0').$lon_deg_dec / 60);\n\t\t\t\t\t} elseif (strlen($lon_deg) == 7) {  // [+-]DDDMMSS.S\n\t\t\t\t\t\t$ISO6709parsed['longitude'] = (($lon_sign == '-') ? -1 : 1) * floatval(ltrim(substr($lon_deg, 0, 2), '0')) + floatval(ltrim(substr($lon_deg, 2, 2), '0') / 60) + floatval(ltrim(substr($lon_deg, 4, 2), '0').$lon_deg_dec / 3600);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (strlen($alt_deg) == 3) {        // [+-]DDD.D\n\t\t\t\t\t\t$ISO6709parsed['altitude'] = (($alt_sign == '-') ? -1 : 1) * floatval(ltrim($alt_deg, '0').$alt_deg_dec);\n\t\t\t\t\t} elseif (strlen($alt_deg) == 5) {  // [+-]DDDMM.M\n\t\t\t\t\t\t$ISO6709parsed['altitude'] = (($alt_sign == '-') ? -1 : 1) * floatval(ltrim(substr($alt_deg, 0, 2), '0')) + floatval(ltrim(substr($alt_deg, 2, 2), '0').$alt_deg_dec / 60);\n\t\t\t\t\t} elseif (strlen($alt_deg) == 7) {  // [+-]DDDMMSS.S\n\t\t\t\t\t\t$ISO6709parsed['altitude'] = (($alt_sign == '-') ? -1 : 1) * floatval(ltrim(substr($alt_deg, 0, 2), '0')) + floatval(ltrim(substr($alt_deg, 2, 2), '0') / 60) + floatval(ltrim(substr($alt_deg, 4, 2), '0').$alt_deg_dec / 3600);\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach (array('latitude', 'longitude', 'altitude') as $key) {\n\t\t\t\t\t\tif ($ISO6709parsed[$key] !== false) {\n\t\t\t\t\t\t\t$value = (($lat_sign == '-') ? -1 : 1) * floatval($ISO6709parsed[$key]);\n\t\t\t\t\t\t\tif (!isset($info['quicktime']['comments']['gps_'.$key]) || !in_array($value, $info['quicktime']['comments']['gps_'.$key])) {\n\t\t\t\t\t\t\t\t@$info['quicktime']['comments']['gps_'.$key][] = (($lat_sign == '-') ? -1 : 1) * floatval($ISO6709parsed[$key]);\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\t\t\t\tif ($ISO6709parsed['latitude'] === false) {\n\t\t\t\t\t$this->warning('location.ISO6709 string not parsed correctly: \"'.$ISO6709string.'\", please submit as a bug');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!isset($info['bitrate']) && isset($info['playtime_seconds'])) {\n\t\t\t$info['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds'];\n\t\t}\n\t\tif (isset($info['bitrate']) && !isset($info['audio']['bitrate']) && !isset($info['quicktime']['video'])) {\n\t\t\t$info['audio']['bitrate'] = $info['bitrate'];\n\t\t}\n\t\tif (!empty($info['bitrate']) && !empty($info['audio']['bitrate']) && empty($info['video']['bitrate']) && !empty($info['video']['frame_rate']) && !empty($info['video']['resolution_x']) && ($info['bitrate'] > $info['audio']['bitrate'])) {\n\t\t\t$info['video']['bitrate'] = $info['bitrate'] - $info['audio']['bitrate'];\n\t\t}\n\t\tif (!empty($info['playtime_seconds']) && !isset($info['video']['frame_rate']) && !empty($info['quicktime']['stts_framecount'])) {\n\t\t\tforeach ($info['quicktime']['stts_framecount'] as $key => $samples_count) {\n\t\t\t\t$samples_per_second = $samples_count / $info['playtime_seconds'];\n\t\t\t\tif ($samples_per_second > 240) {\n\t\t\t\t\t// has to be audio samples\n\t\t\t\t} else {\n\t\t\t\t\t$info['video']['frame_rate'] = $samples_per_second;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($info['audio']['dataformat'] == 'mp4') {\n\t\t\t$info['fileformat'] = 'mp4';\n\t\t\tif (empty($info['video']['resolution_x'])) {\n\t\t\t\t$info['mime_type']  = 'audio/mp4';\n\t\t\t\tunset($info['video']['dataformat']);\n\t\t\t} else {\n\t\t\t\t$info['mime_type']  = 'video/mp4';\n\t\t\t}\n\t\t}\n\n\t\tif (!$this->ReturnAtomData) {\n\t\t\tunset($info['quicktime']['moov']);\n\t\t}\n\n\t\tif (empty($info['audio']['dataformat']) && !empty($info['quicktime']['audio'])) {\n\t\t\t$info['audio']['dataformat'] = 'quicktime';\n\t\t}\n\t\tif (empty($info['video']['dataformat']) && !empty($info['quicktime']['video'])) {\n\t\t\t$info['video']['dataformat'] = 'quicktime';\n\t\t}\n\t\tif (isset($info['video']) && ($info['mime_type'] == 'audio/mp4') && empty($info['video']['resolution_x']) && empty($info['video']['resolution_y']))  {\n\t\t\tunset($info['video']);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $atomname\n\t * @param int    $atomsize\n\t * @param string $atom_data\n\t * @param int    $baseoffset\n\t * @param array  $atomHierarchy\n\t * @param bool   $ParseAllPossibleAtoms\n\t *\n\t * @return array|false\n\t */\n\tpublic function QuicktimeParseAtom($atomname, $atomsize, $atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms) {\n\t\t// http://developer.apple.com/techpubs/quicktime/qtdevdocs/APIREF/INDEX/atomalphaindex.htm\n\t\t// https://code.google.com/p/mp4v2/wiki/iTunesMetadata\n\n\t\t$info = &$this->getid3->info;\n\n\t\t$atom_parent = end($atomHierarchy); // not array_pop($atomHierarchy); see https://www.getid3.org/phpBB3/viewtopic.php?t=1717\n\t\tarray_push($atomHierarchy, $atomname);\n\t\t$atom_structure              = array();\n\t\t$atom_structure['hierarchy'] = implode(' ', $atomHierarchy);\n\t\t$atom_structure['name']      = $atomname;\n\t\t$atom_structure['size']      = $atomsize;\n\t\t$atom_structure['offset']    = $baseoffset;\n\t\tif (substr($atomname, 0, 3) == \"\\x00\\x00\\x00\") {\n\t\t\t// https://github.com/JamesHeinrich/getID3/issues/139\n\t\t\t$atomname = getid3_lib::BigEndian2Int($atomname);\n\t\t\t$atom_structure['name'] = $atomname;\n\t\t\t$atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms);\n\t\t} else {\n\t\t\tswitch ($atomname) {\n\t\t\t\tcase 'moov': // MOVie container atom\n\t\t\t\tcase 'trak': // TRAcK container atom\n\t\t\t\tcase 'clip': // CLIPping container atom\n\t\t\t\tcase 'matt': // track MATTe container atom\n\t\t\t\tcase 'edts': // EDiTS container atom\n\t\t\t\tcase 'tref': // Track REFerence container atom\n\t\t\t\tcase 'mdia': // MeDIA container atom\n\t\t\t\tcase 'minf': // Media INFormation container atom\n\t\t\t\tcase 'dinf': // Data INFormation container atom\n\t\t\t\tcase 'nmhd': // Null Media HeaDer container atom\n\t\t\t\tcase 'udta': // User DaTA container atom\n\t\t\t\tcase 'cmov': // Compressed MOVie container atom\n\t\t\t\tcase 'rmra': // Reference Movie Record Atom\n\t\t\t\tcase 'rmda': // Reference Movie Descriptor Atom\n\t\t\t\tcase 'gmhd': // Generic Media info HeaDer atom (seen on QTVR)\n\t\t\t\t\t$atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ilst': // Item LiST container atom\n\t\t\t\t\tif ($atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms)) {\n\t\t\t\t\t\t// some \"ilst\" atoms contain data atoms that have a numeric name, and the data is far more accessible if the returned array is compacted\n\t\t\t\t\t\t$allnumericnames = true;\n\t\t\t\t\t\tforeach ($atom_structure['subatoms'] as $subatomarray) {\n\t\t\t\t\t\t\tif (!is_integer($subatomarray['name']) || (count($subatomarray['subatoms']) != 1)) {\n\t\t\t\t\t\t\t\t$allnumericnames = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($allnumericnames) {\n\t\t\t\t\t\t\t$newData = array();\n\t\t\t\t\t\t\tforeach ($atom_structure['subatoms'] as $subatomarray) {\n\t\t\t\t\t\t\t\tforeach ($subatomarray['subatoms'] as $newData_subatomarray) {\n\t\t\t\t\t\t\t\t\tunset($newData_subatomarray['hierarchy'], $newData_subatomarray['name']);\n\t\t\t\t\t\t\t\t\t$newData[$subatomarray['name']] = $newData_subatomarray;\n\t\t\t\t\t\t\t\t\tbreak;\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$atom_structure['data'] = $newData;\n\t\t\t\t\t\t\tunset($atom_structure['subatoms']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'stbl': // Sample TaBLe container atom\n\t\t\t\t\t$atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms);\n\t\t\t\t\t$isVideo = false;\n\t\t\t\t\t$framerate  = 0;\n\t\t\t\t\t$framecount = 0;\n\t\t\t\t\tforeach ($atom_structure['subatoms'] as $key => $value_array) {\n\t\t\t\t\t\tif (isset($value_array['sample_description_table'])) {\n\t\t\t\t\t\t\tforeach ($value_array['sample_description_table'] as $key2 => $value_array2) {\n\t\t\t\t\t\t\t\tif (isset($value_array2['data_format'])) {\n\t\t\t\t\t\t\t\t\tswitch ($value_array2['data_format']) {\n\t\t\t\t\t\t\t\t\t\tcase 'avc1':\n\t\t\t\t\t\t\t\t\t\tcase 'mp4v':\n\t\t\t\t\t\t\t\t\t\t\t// video data\n\t\t\t\t\t\t\t\t\t\t\t$isVideo = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 'mp4a':\n\t\t\t\t\t\t\t\t\t\t\t// audio data\n\t\t\t\t\t\t\t\t\t\t\tbreak;\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}\n\t\t\t\t\t\t} elseif (isset($value_array['time_to_sample_table'])) {\n\t\t\t\t\t\t\tforeach ($value_array['time_to_sample_table'] as $key2 => $value_array2) {\n\t\t\t\t\t\t\t\tif (isset($value_array2['sample_count']) && isset($value_array2['sample_duration']) && ($value_array2['sample_duration'] > 0)) {\n\t\t\t\t\t\t\t\t\t$framerate  = round($info['quicktime']['time_scale'] / $value_array2['sample_duration'], 3);\n\t\t\t\t\t\t\t\t\t$framecount = $value_array2['sample_count'];\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\tif ($isVideo && $framerate) {\n\t\t\t\t\t\t$info['quicktime']['video']['frame_rate'] = $framerate;\n\t\t\t\t\t\t$info['video']['frame_rate'] = $info['quicktime']['video']['frame_rate'];\n\t\t\t\t\t}\n\t\t\t\t\tif ($isVideo && $framecount) {\n\t\t\t\t\t\t$info['quicktime']['video']['frame_count'] = $framecount;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase \"\\xA9\".'alb': // ALBum\n\t\t\t\tcase \"\\xA9\".'ART': //\n\t\t\t\tcase \"\\xA9\".'art': // ARTist\n\t\t\t\tcase \"\\xA9\".'aut': //\n\t\t\t\tcase \"\\xA9\".'cmt': // CoMmenT\n\t\t\t\tcase \"\\xA9\".'com': // COMposer\n\t\t\t\tcase \"\\xA9\".'cpy': //\n\t\t\t\tcase \"\\xA9\".'day': // content created year\n\t\t\t\tcase \"\\xA9\".'dir': //\n\t\t\t\tcase \"\\xA9\".'ed1': //\n\t\t\t\tcase \"\\xA9\".'ed2': //\n\t\t\t\tcase \"\\xA9\".'ed3': //\n\t\t\t\tcase \"\\xA9\".'ed4': //\n\t\t\t\tcase \"\\xA9\".'ed5': //\n\t\t\t\tcase \"\\xA9\".'ed6': //\n\t\t\t\tcase \"\\xA9\".'ed7': //\n\t\t\t\tcase \"\\xA9\".'ed8': //\n\t\t\t\tcase \"\\xA9\".'ed9': //\n\t\t\t\tcase \"\\xA9\".'enc': //\n\t\t\t\tcase \"\\xA9\".'fmt': //\n\t\t\t\tcase \"\\xA9\".'gen': // GENre\n\t\t\t\tcase \"\\xA9\".'grp': // GRouPing\n\t\t\t\tcase \"\\xA9\".'hst': //\n\t\t\t\tcase \"\\xA9\".'inf': //\n\t\t\t\tcase \"\\xA9\".'lyr': // LYRics\n\t\t\t\tcase \"\\xA9\".'mak': //\n\t\t\t\tcase \"\\xA9\".'mod': //\n\t\t\t\tcase \"\\xA9\".'nam': // full NAMe\n\t\t\t\tcase \"\\xA9\".'ope': //\n\t\t\t\tcase \"\\xA9\".'PRD': //\n\t\t\t\tcase \"\\xA9\".'prf': //\n\t\t\t\tcase \"\\xA9\".'req': //\n\t\t\t\tcase \"\\xA9\".'src': //\n\t\t\t\tcase \"\\xA9\".'swr': //\n\t\t\t\tcase \"\\xA9\".'too': // encoder\n\t\t\t\tcase \"\\xA9\".'trk': // TRacK\n\t\t\t\tcase \"\\xA9\".'url': //\n\t\t\t\tcase \"\\xA9\".'wrn': //\n\t\t\t\tcase \"\\xA9\".'wrt': // WRiTer\n\t\t\t\tcase '----': // itunes specific\n\t\t\t\tcase 'aART': // Album ARTist\n\t\t\t\tcase 'akID': // iTunes store account type\n\t\t\t\tcase 'apID': // Purchase Account\n\t\t\t\tcase 'atID': //\n\t\t\t\tcase 'catg': // CaTeGory\n\t\t\t\tcase 'cmID': //\n\t\t\t\tcase 'cnID': //\n\t\t\t\tcase 'covr': // COVeR artwork\n\t\t\t\tcase 'cpil': // ComPILation\n\t\t\t\tcase 'cprt': // CoPyRighT\n\t\t\t\tcase 'desc': // DESCription\n\t\t\t\tcase 'disk': // DISK number\n\t\t\t\tcase 'egid': // Episode Global ID\n\t\t\t\tcase 'geID': //\n\t\t\t\tcase 'gnre': // GeNRE\n\t\t\t\tcase 'hdvd': // HD ViDeo\n\t\t\t\tcase 'keyw': // KEYWord\n\t\t\t\tcase 'ldes': // Long DEScription\n\t\t\t\tcase 'pcst': // PodCaST\n\t\t\t\tcase 'pgap': // GAPless Playback\n\t\t\t\tcase 'plID': //\n\t\t\t\tcase 'purd': // PURchase Date\n\t\t\t\tcase 'purl': // Podcast URL\n\t\t\t\tcase 'rati': //\n\t\t\t\tcase 'rndu': //\n\t\t\t\tcase 'rpdu': //\n\t\t\t\tcase 'rtng': // RaTiNG\n\t\t\t\tcase 'sfID': // iTunes store country\n\t\t\t\tcase 'soaa': // SOrt Album Artist\n\t\t\t\tcase 'soal': // SOrt ALbum\n\t\t\t\tcase 'soar': // SOrt ARtist\n\t\t\t\tcase 'soco': // SOrt COmposer\n\t\t\t\tcase 'sonm': // SOrt NaMe\n\t\t\t\tcase 'sosn': // SOrt Show Name\n\t\t\t\tcase 'stik': //\n\t\t\t\tcase 'tmpo': // TeMPO (BPM)\n\t\t\t\tcase 'trkn': // TRacK Number\n\t\t\t\tcase 'tven': // tvEpisodeID\n\t\t\t\tcase 'tves': // TV EpiSode\n\t\t\t\tcase 'tvnn': // TV Network Name\n\t\t\t\tcase 'tvsh': // TV SHow Name\n\t\t\t\tcase 'tvsn': // TV SeasoN\n\t\t\t\t\tif ($atom_parent == 'udta') {\n\t\t\t\t\t\t// User data atom handler\n\t\t\t\t\t\t$atom_structure['data_length'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 2));\n\t\t\t\t\t\t$atom_structure['language_id'] = getid3_lib::BigEndian2Int(substr($atom_data, 2, 2));\n\t\t\t\t\t\t$atom_structure['data']        =                           substr($atom_data, 4);\n\n\t\t\t\t\t\t$atom_structure['language']    = $this->QuicktimeLanguageLookup($atom_structure['language_id']);\n\t\t\t\t\t\tif (empty($info['comments']['language']) || (!in_array($atom_structure['language'], $info['comments']['language']))) {\n\t\t\t\t\t\t\t$info['comments']['language'][] = $atom_structure['language'];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Apple item list box atom handler\n\t\t\t\t\t\t$atomoffset = 0;\n\t\t\t\t\t\tif (substr($atom_data, 2, 2) == \"\\x10\\xB5\") {\n\t\t\t\t\t\t\t// not sure what it means, but observed on iPhone4 data.\n\t\t\t\t\t\t\t// Each $atom_data has 2 bytes of datasize, plus 0x10B5, then data\n\t\t\t\t\t\t\twhile ($atomoffset < strlen($atom_data)) {\n\t\t\t\t\t\t\t\t$boxsmallsize = getid3_lib::BigEndian2Int(substr($atom_data, $atomoffset,     2));\n\t\t\t\t\t\t\t\t$boxsmalltype =                           substr($atom_data, $atomoffset + 2, 2);\n\t\t\t\t\t\t\t\t$boxsmalldata =                           substr($atom_data, $atomoffset + 4, $boxsmallsize);\n\t\t\t\t\t\t\t\tif ($boxsmallsize <= 1) {\n\t\t\t\t\t\t\t\t\t$this->warning('Invalid QuickTime atom smallbox size \"'.$boxsmallsize.'\" in atom \"'.preg_replace('#[^a-zA-Z0-9 _\\\\-]#', '?', $atomname).'\" at offset: '.($atom_structure['offset'] + $atomoffset));\n\t\t\t\t\t\t\t\t\t$atom_structure['data'] = null;\n\t\t\t\t\t\t\t\t\t$atomoffset = strlen($atom_data);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tswitch ($boxsmalltype) {\n\t\t\t\t\t\t\t\t\tcase \"\\x10\\xB5\":\n\t\t\t\t\t\t\t\t\t\t$atom_structure['data'] = $boxsmalldata;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t$this->warning('Unknown QuickTime smallbox type: \"'.preg_replace('#[^a-zA-Z0-9 _\\\\-]#', '?', $boxsmalltype).'\" ('.trim(getid3_lib::PrintHexBytes($boxsmalltype)).') at offset '.$baseoffset);\n\t\t\t\t\t\t\t\t\t\t$atom_structure['data'] = $atom_data;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$atomoffset += (4 + $boxsmallsize);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twhile ($atomoffset < strlen($atom_data)) {\n\t\t\t\t\t\t\t\t$boxsize = getid3_lib::BigEndian2Int(substr($atom_data, $atomoffset, 4));\n\t\t\t\t\t\t\t\t$boxtype =                           substr($atom_data, $atomoffset + 4, 4);\n\t\t\t\t\t\t\t\t$boxdata =                           substr($atom_data, $atomoffset + 8, $boxsize - 8);\n\t\t\t\t\t\t\t\tif ($boxsize <= 1) {\n\t\t\t\t\t\t\t\t\t$this->warning('Invalid QuickTime atom box size \"'.$boxsize.'\" in atom \"'.preg_replace('#[^a-zA-Z0-9 _\\\\-]#', '?', $atomname).'\" at offset: '.($atom_structure['offset'] + $atomoffset));\n\t\t\t\t\t\t\t\t\t$atom_structure['data'] = null;\n\t\t\t\t\t\t\t\t\t$atomoffset = strlen($atom_data);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$atomoffset += $boxsize;\n\n\t\t\t\t\t\t\t\tswitch ($boxtype) {\n\t\t\t\t\t\t\t\t\tcase 'mean':\n\t\t\t\t\t\t\t\t\tcase 'name':\n\t\t\t\t\t\t\t\t\t\t$atom_structure[$boxtype] = substr($boxdata, 4);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'data':\n\t\t\t\t\t\t\t\t\t\t$atom_structure['version']   = getid3_lib::BigEndian2Int(substr($boxdata,  0, 1));\n\t\t\t\t\t\t\t\t\t\t$atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($boxdata,  1, 3));\n\t\t\t\t\t\t\t\t\t\tswitch ($atom_structure['flags_raw']) {\n\t\t\t\t\t\t\t\t\t\t\tcase  0: // data flag\n\t\t\t\t\t\t\t\t\t\t\tcase 21: // tmpo/cpil flag\n\t\t\t\t\t\t\t\t\t\t\t\tswitch ($atomname) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'cpil':\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'hdvd':\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'pcst':\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'pgap':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 8-bit integer (boolean)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['data'] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 1));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'tmpo':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 16-bit integer\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['data'] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 2));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'disk':\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'trkn':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// binary\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$num       = getid3_lib::BigEndian2Int(substr($boxdata, 10, 2));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$num_total = getid3_lib::BigEndian2Int(substr($boxdata, 12, 2));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['data']  = empty($num) ? '' : $num;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['data'] .= empty($num_total) ? '' : '/'.$num_total;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'gnre':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// enum\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$GenreID = getid3_lib::BigEndian2Int(substr($boxdata, 8, 4));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['data']    = getid3_id3v1::LookupGenreName($GenreID - 1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'rtng':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 8-bit integer\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure[$atomname] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 1));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['data']    = $this->QuicktimeContentRatingLookup($atom_structure[$atomname]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'stik':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 8-bit integer (enum)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure[$atomname] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 1));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['data']    = $this->QuicktimeSTIKLookup($atom_structure[$atomname]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'sfID':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 32-bit integer\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure[$atomname] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 4));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['data']    = $this->QuicktimeStoreFrontCodeLookup($atom_structure[$atomname]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'egid':\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'purl':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['data'] = substr($boxdata, 8);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'plID':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 64-bit integer\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['data'] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 8));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'covr':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['data'] = substr($boxdata, 8);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// not a foolproof check, but better than nothing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#^\\\\xFF\\\\xD8\\\\xFF#', $atom_structure['data'])) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['image_mime'] = 'image/jpeg';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} elseif (preg_match('#^\\\\x89\\\\x50\\\\x4E\\\\x47\\\\x0D\\\\x0A\\\\x1A\\\\x0A#', $atom_structure['data'])) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['image_mime'] = 'image/png';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} elseif (preg_match('#^GIF#', $atom_structure['data'])) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['image_mime'] = 'image/gif';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$info['quicktime']['comments']['picture'][] = array('image_mime'=>$atom_structure['image_mime'], 'data'=>$atom_structure['data'], 'description'=>'cover');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'atID':\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'cnID':\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'geID':\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'tves':\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'tvsn':\n\t\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 32-bit integer\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['data'] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 4));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\tcase  1: // text flag\n\t\t\t\t\t\t\t\t\t\t\tcase 13: // image flag\n\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['data'] = substr($boxdata, 8);\n\t\t\t\t\t\t\t\t\t\t\t\tif ($atomname == 'covr') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// not a foolproof check, but better than nothing\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#^\\\\xFF\\\\xD8\\\\xFF#', $atom_structure['data'])) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['image_mime'] = 'image/jpeg';\n\t\t\t\t\t\t\t\t\t\t\t\t\t} elseif (preg_match('#^\\\\x89\\\\x50\\\\x4E\\\\x47\\\\x0D\\\\x0A\\\\x1A\\\\x0A#', $atom_structure['data'])) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['image_mime'] = 'image/png';\n\t\t\t\t\t\t\t\t\t\t\t\t\t} elseif (preg_match('#^GIF#', $atom_structure['data'])) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$atom_structure['image_mime'] = 'image/gif';\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t$info['quicktime']['comments']['picture'][] = array('image_mime'=>$atom_structure['image_mime'], 'data'=>$atom_structure['data'], 'description'=>'cover');\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t$this->warning('Unknown QuickTime box type: \"'.preg_replace('#[^a-zA-Z0-9 _\\\\-]#', '?', $boxtype).'\" ('.trim(getid3_lib::PrintHexBytes($boxtype)).') at offset '.$baseoffset);\n\t\t\t\t\t\t\t\t\t\t$atom_structure['data'] = $atom_data;\n\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\t$this->CopyToAppropriateCommentsSection($atomname, $atom_structure['data'], $atom_structure['name']);\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'play': // auto-PLAY atom\n\t\t\t\t\t$atom_structure['autoplay'] = (bool) getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\n\t\t\t\t\t$info['quicktime']['autoplay'] = $atom_structure['autoplay'];\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'WLOC': // Window LOCation atom\n\t\t\t\t\t$atom_structure['location_x']  = getid3_lib::BigEndian2Int(substr($atom_data,  0, 2));\n\t\t\t\t\t$atom_structure['location_y']  = getid3_lib::BigEndian2Int(substr($atom_data,  2, 2));\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'LOOP': // LOOPing atom\n\t\t\t\tcase 'SelO': // play SELection Only atom\n\t\t\t\tcase 'AllF': // play ALL Frames atom\n\t\t\t\t\t$atom_structure['data'] = getid3_lib::BigEndian2Int($atom_data);\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'name': //\n\t\t\t\tcase 'MCPS': // Media Cleaner PRo\n\t\t\t\tcase '@PRM': // adobe PReMiere version\n\t\t\t\tcase '@PRQ': // adobe PRemiere Quicktime version\n\t\t\t\t\t$atom_structure['data'] = $atom_data;\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'cmvd': // Compressed MooV Data atom\n\t\t\t\t\t// Code by ubergeek\u00c3\u02dcubergeek*tv based on information from\n\t\t\t\t\t// http://developer.apple.com/quicktime/icefloe/dispatch012.html\n\t\t\t\t\t$atom_structure['unCompressedSize'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 4));\n\n\t\t\t\t\t$CompressedFileData = substr($atom_data, 4);\n\t\t\t\t\tif ($UncompressedHeader = @gzuncompress($CompressedFileData)) {\n\t\t\t\t\t\t$atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($UncompressedHeader, 0, $atomHierarchy, $ParseAllPossibleAtoms);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('Error decompressing compressed MOV atom at offset '.$atom_structure['offset']);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'dcom': // Data COMpression atom\n\t\t\t\t\t$atom_structure['compression_id']   = $atom_data;\n\t\t\t\t\t$atom_structure['compression_text'] = $this->QuicktimeDCOMLookup($atom_data);\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'rdrf': // Reference movie Data ReFerence atom\n\t\t\t\t\t$atom_structure['version']                = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3));\n\t\t\t\t\t$atom_structure['flags']['internal_data'] = (bool) ($atom_structure['flags_raw'] & 0x000001);\n\n\t\t\t\t\t$atom_structure['reference_type_name']    =                           substr($atom_data,  4, 4);\n\t\t\t\t\t$atom_structure['reference_length']       = getid3_lib::BigEndian2Int(substr($atom_data,  8, 4));\n\t\t\t\t\tswitch ($atom_structure['reference_type_name']) {\n\t\t\t\t\t\tcase 'url ':\n\t\t\t\t\t\t\t$atom_structure['url']            =       $this->NoNullString(substr($atom_data, 12));\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'alis':\n\t\t\t\t\t\t\t$atom_structure['file_alias']     =                           substr($atom_data, 12);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'rsrc':\n\t\t\t\t\t\t\t$atom_structure['resource_alias'] =                           substr($atom_data, 12);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$atom_structure['data']           =                           substr($atom_data, 12);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'rmqu': // Reference Movie QUality atom\n\t\t\t\t\t$atom_structure['movie_quality'] = getid3_lib::BigEndian2Int($atom_data);\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'rmcs': // Reference Movie Cpu Speed atom\n\t\t\t\t\t$atom_structure['version']          = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']        = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t$atom_structure['cpu_speed_rating'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 2));\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'rmvc': // Reference Movie Version Check atom\n\t\t\t\t\t$atom_structure['version']            = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']          = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t$atom_structure['gestalt_selector']   =                           substr($atom_data,  4, 4);\n\t\t\t\t\t$atom_structure['gestalt_value_mask'] = getid3_lib::BigEndian2Int(substr($atom_data,  8, 4));\n\t\t\t\t\t$atom_structure['gestalt_value']      = getid3_lib::BigEndian2Int(substr($atom_data, 12, 4));\n\t\t\t\t\t$atom_structure['gestalt_check_type'] = getid3_lib::BigEndian2Int(substr($atom_data, 14, 2));\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'rmcd': // Reference Movie Component check atom\n\t\t\t\t\t$atom_structure['version']                = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t$atom_structure['component_type']         =                           substr($atom_data,  4, 4);\n\t\t\t\t\t$atom_structure['component_subtype']      =                           substr($atom_data,  8, 4);\n\t\t\t\t\t$atom_structure['component_manufacturer'] =                           substr($atom_data, 12, 4);\n\t\t\t\t\t$atom_structure['component_flags_raw']    = getid3_lib::BigEndian2Int(substr($atom_data, 16, 4));\n\t\t\t\t\t$atom_structure['component_flags_mask']   = getid3_lib::BigEndian2Int(substr($atom_data, 20, 4));\n\t\t\t\t\t$atom_structure['component_min_version']  = getid3_lib::BigEndian2Int(substr($atom_data, 24, 4));\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'rmdr': // Reference Movie Data Rate atom\n\t\t\t\t\t$atom_structure['version']       = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']     = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t$atom_structure['data_rate']     = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));\n\n\t\t\t\t\t$atom_structure['data_rate_bps'] = $atom_structure['data_rate'] * 10;\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'rmla': // Reference Movie Language Atom\n\t\t\t\t\t$atom_structure['version']     = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']   = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t$atom_structure['language_id'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 2));\n\n\t\t\t\t\t$atom_structure['language']    = $this->QuicktimeLanguageLookup($atom_structure['language_id']);\n\t\t\t\t\tif (empty($info['comments']['language']) || (!in_array($atom_structure['language'], $info['comments']['language']))) {\n\t\t\t\t\t\t$info['comments']['language'][] = $atom_structure['language'];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'ptv ': // Print To Video - defines a movie's full screen mode\n\t\t\t\t\t// http://developer.apple.com/documentation/QuickTime/APIREF/SOURCESIV/at_ptv-_pg.htm\n\t\t\t\t\t$atom_structure['display_size_raw']  = getid3_lib::BigEndian2Int(substr($atom_data, 0, 2));\n\t\t\t\t\t$atom_structure['reserved_1']        = getid3_lib::BigEndian2Int(substr($atom_data, 2, 2)); // hardcoded: 0x0000\n\t\t\t\t\t$atom_structure['reserved_2']        = getid3_lib::BigEndian2Int(substr($atom_data, 4, 2)); // hardcoded: 0x0000\n\t\t\t\t\t$atom_structure['slide_show_flag']   = getid3_lib::BigEndian2Int(substr($atom_data, 6, 1));\n\t\t\t\t\t$atom_structure['play_on_open_flag'] = getid3_lib::BigEndian2Int(substr($atom_data, 7, 1));\n\n\t\t\t\t\t$atom_structure['flags']['play_on_open'] = (bool) $atom_structure['play_on_open_flag'];\n\t\t\t\t\t$atom_structure['flags']['slide_show']   = (bool) $atom_structure['slide_show_flag'];\n\n\t\t\t\t\t$ptv_lookup[0] = 'normal';\n\t\t\t\t\t$ptv_lookup[1] = 'double';\n\t\t\t\t\t$ptv_lookup[2] = 'half';\n\t\t\t\t\t$ptv_lookup[3] = 'full';\n\t\t\t\t\t$ptv_lookup[4] = 'current';\n\t\t\t\t\tif (isset($ptv_lookup[$atom_structure['display_size_raw']])) {\n\t\t\t\t\t\t$atom_structure['display_size'] = $ptv_lookup[$atom_structure['display_size_raw']];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('unknown \"ptv \" display constant ('.$atom_structure['display_size_raw'].')');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'stsd': // Sample Table Sample Description atom\n\t\t\t\t\t$atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t$atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));\n\n\t\t\t\t\t// see: https://github.com/JamesHeinrich/getID3/issues/111\n\t\t\t\t\t// Some corrupt files have been known to have high bits set in the number_entries field\n\t\t\t\t\t// This field shouldn't really need to be 32-bits, values stores are likely in the range 1-100000\n\t\t\t\t\t// Workaround: mask off the upper byte and throw a warning if it's nonzero\n\t\t\t\t\tif ($atom_structure['number_entries'] > 0x000FFFFF) {\n\t\t\t\t\t\tif ($atom_structure['number_entries'] > 0x00FFFFFF) {\n\t\t\t\t\t\t\t$this->warning('\"stsd\" atom contains improbably large number_entries (0x'.getid3_lib::PrintHexBytes(substr($atom_data, 4, 4), true, false).' = '.$atom_structure['number_entries'].'), probably in error. Ignoring upper byte and interpreting this as 0x'.getid3_lib::PrintHexBytes(substr($atom_data, 5, 3), true, false).' = '.($atom_structure['number_entries'] & 0x00FFFFFF));\n\t\t\t\t\t\t\t$atom_structure['number_entries'] = ($atom_structure['number_entries'] & 0x00FFFFFF);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->warning('\"stsd\" atom contains improbably large number_entries (0x'.getid3_lib::PrintHexBytes(substr($atom_data, 4, 4), true, false).' = '.$atom_structure['number_entries'].'), probably in error. Please report this to info@getid3.org referencing bug report #111');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$stsdEntriesDataOffset = 8;\n\t\t\t\t\tfor ($i = 0; $i < $atom_structure['number_entries']; $i++) {\n\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['size']             = getid3_lib::BigEndian2Int(substr($atom_data, $stsdEntriesDataOffset, 4));\n\t\t\t\t\t\t$stsdEntriesDataOffset += 4;\n\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['data_format']      =                           substr($atom_data, $stsdEntriesDataOffset, 4);\n\t\t\t\t\t\t$stsdEntriesDataOffset += 4;\n\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['reserved']         = getid3_lib::BigEndian2Int(substr($atom_data, $stsdEntriesDataOffset, 6));\n\t\t\t\t\t\t$stsdEntriesDataOffset += 6;\n\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['reference_index']  = getid3_lib::BigEndian2Int(substr($atom_data, $stsdEntriesDataOffset, 2));\n\t\t\t\t\t\t$stsdEntriesDataOffset += 2;\n\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['data']             =                           substr($atom_data, $stsdEntriesDataOffset, ($atom_structure['sample_description_table'][$i]['size'] - 4 - 4 - 6 - 2));\n\t\t\t\t\t\t$stsdEntriesDataOffset += ($atom_structure['sample_description_table'][$i]['size'] - 4 - 4 - 6 - 2);\n\n\t\t\t\t\t\tif (substr($atom_structure['sample_description_table'][$i]['data'],  1, 54) == 'application/octet-stream;type=com.parrot.videometadata') {\n\t\t\t\t\t\t\t// special handling for apparently-malformed (TextMetaDataSampleEntry?) data for some version of Parrot drones\n\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['parrot_frame_metadata']['mime_type']        =       substr($atom_structure['sample_description_table'][$i]['data'],  1, 55);\n\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['parrot_frame_metadata']['metadata_version'] = (int) substr($atom_structure['sample_description_table'][$i]['data'], 55,  1);\n\t\t\t\t\t\t\tunset($atom_structure['sample_description_table'][$i]['data']);\n$this->warning('incomplete/incorrect handling of \"stsd\" with Parrot metadata in this version of getID3() ['.$this->getid3->version().']');\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['encoder_version']  = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'],  0, 2));\n\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['encoder_revision'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'],  2, 2));\n\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['encoder_vendor']   =                           substr($atom_structure['sample_description_table'][$i]['data'],  4, 4);\n\n\t\t\t\t\t\tswitch ($atom_structure['sample_description_table'][$i]['encoder_vendor']) {\n\n\t\t\t\t\t\t\tcase \"\\x00\\x00\\x00\\x00\":\n\t\t\t\t\t\t\t\t// audio tracks\n\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['audio_channels']       =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'],  8,  2));\n\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['audio_bit_depth']      =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 10,  2));\n\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['audio_compression_id'] =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 12,  2));\n\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['audio_packet_size']    =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 14,  2));\n\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['audio_sample_rate']    = getid3_lib::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 16,  4));\n\n\t\t\t\t\t\t\t\t// video tracks\n\t\t\t\t\t\t\t\t// http://developer.apple.com/library/mac/#documentation/QuickTime/QTFF/QTFFChap3/qtff3.html\n\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['temporal_quality'] =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'],  8,  4));\n\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['spatial_quality']  =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 12,  4));\n\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['width']            =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 16,  2));\n\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['height']           =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 18,  2));\n\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['resolution_x']     = getid3_lib::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 24,  4));\n\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['resolution_y']     = getid3_lib::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 28,  4));\n\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['data_size']        =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 32,  4));\n\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['frame_count']      =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 36,  2));\n\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['compressor_name']  =                             substr($atom_structure['sample_description_table'][$i]['data'], 38,  4);\n\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['pixel_depth']      =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 42,  2));\n\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['color_table_id']   =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 44,  2));\n\n\t\t\t\t\t\t\t\tswitch ($atom_structure['sample_description_table'][$i]['data_format']) {\n\t\t\t\t\t\t\t\t\tcase '2vuY':\n\t\t\t\t\t\t\t\t\tcase 'avc1':\n\t\t\t\t\t\t\t\t\tcase 'cvid':\n\t\t\t\t\t\t\t\t\tcase 'dvc ':\n\t\t\t\t\t\t\t\t\tcase 'dvcp':\n\t\t\t\t\t\t\t\t\tcase 'gif ':\n\t\t\t\t\t\t\t\t\tcase 'h263':\n\t\t\t\t\t\t\t\t\tcase 'jpeg':\n\t\t\t\t\t\t\t\t\tcase 'kpcd':\n\t\t\t\t\t\t\t\t\tcase 'mjpa':\n\t\t\t\t\t\t\t\t\tcase 'mjpb':\n\t\t\t\t\t\t\t\t\tcase 'mp4v':\n\t\t\t\t\t\t\t\t\tcase 'png ':\n\t\t\t\t\t\t\t\t\tcase 'raw ':\n\t\t\t\t\t\t\t\t\tcase 'rle ':\n\t\t\t\t\t\t\t\t\tcase 'rpza':\n\t\t\t\t\t\t\t\t\tcase 'smc ':\n\t\t\t\t\t\t\t\t\tcase 'SVQ1':\n\t\t\t\t\t\t\t\t\tcase 'SVQ3':\n\t\t\t\t\t\t\t\t\tcase 'tiff':\n\t\t\t\t\t\t\t\t\tcase 'v210':\n\t\t\t\t\t\t\t\t\tcase 'v216':\n\t\t\t\t\t\t\t\t\tcase 'v308':\n\t\t\t\t\t\t\t\t\tcase 'v408':\n\t\t\t\t\t\t\t\t\tcase 'v410':\n\t\t\t\t\t\t\t\t\tcase 'yuv2':\n\t\t\t\t\t\t\t\t\t\t$info['fileformat'] = 'mp4';\n\t\t\t\t\t\t\t\t\t\t$info['video']['fourcc'] = $atom_structure['sample_description_table'][$i]['data_format'];\n\t\t\t\t\t\t\t\t\t\tif ($this->QuicktimeVideoCodecLookup($info['video']['fourcc'])) {\n\t\t\t\t\t\t\t\t\t\t\t$info['video']['fourcc_lookup'] = $this->QuicktimeVideoCodecLookup($info['video']['fourcc']);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// https://www.getid3.org/phpBB3/viewtopic.php?t=1550\n\t\t\t\t\t\t\t\t\t\t//if ((!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($atom_structure['sample_description_table'][$i]['width'])) && (empty($info['video']['resolution_x']) || empty($info['video']['resolution_y']) || (number_format($info['video']['resolution_x'], 6) != number_format(round($info['video']['resolution_x']), 6)) || (number_format($info['video']['resolution_y'], 6) != number_format(round($info['video']['resolution_y']), 6)))) { // ugly check for floating point numbers\n\t\t\t\t\t\t\t\t\t\tif (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($atom_structure['sample_description_table'][$i]['height'])) {\n\t\t\t\t\t\t\t\t\t\t\t// assume that values stored here are more important than values stored in [tkhd] atom\n\t\t\t\t\t\t\t\t\t\t\t$info['video']['resolution_x'] = $atom_structure['sample_description_table'][$i]['width'];\n\t\t\t\t\t\t\t\t\t\t\t$info['video']['resolution_y'] = $atom_structure['sample_description_table'][$i]['height'];\n\t\t\t\t\t\t\t\t\t\t\t$info['quicktime']['video']['resolution_x'] = $info['video']['resolution_x'];\n\t\t\t\t\t\t\t\t\t\t\t$info['quicktime']['video']['resolution_y'] = $info['video']['resolution_y'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'qtvr':\n\t\t\t\t\t\t\t\t\t\t$info['video']['dataformat'] = 'quicktimevr';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'mp4a':\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t$info['quicktime']['audio']['codec']       = $this->QuicktimeAudioCodecLookup($atom_structure['sample_description_table'][$i]['data_format']);\n\t\t\t\t\t\t\t\t\t\t$info['quicktime']['audio']['sample_rate'] = $atom_structure['sample_description_table'][$i]['audio_sample_rate'];\n\t\t\t\t\t\t\t\t\t\t$info['quicktime']['audio']['channels']    = $atom_structure['sample_description_table'][$i]['audio_channels'];\n\t\t\t\t\t\t\t\t\t\t$info['quicktime']['audio']['bit_depth']   = $atom_structure['sample_description_table'][$i]['audio_bit_depth'];\n\t\t\t\t\t\t\t\t\t\t$info['audio']['codec']                    = $info['quicktime']['audio']['codec'];\n\t\t\t\t\t\t\t\t\t\t$info['audio']['sample_rate']              = $info['quicktime']['audio']['sample_rate'];\n\t\t\t\t\t\t\t\t\t\t$info['audio']['channels']                 = $info['quicktime']['audio']['channels'];\n\t\t\t\t\t\t\t\t\t\t$info['audio']['bits_per_sample']          = $info['quicktime']['audio']['bit_depth'];\n\t\t\t\t\t\t\t\t\t\tswitch ($atom_structure['sample_description_table'][$i]['data_format']) {\n\t\t\t\t\t\t\t\t\t\t\tcase 'raw ': // PCM\n\t\t\t\t\t\t\t\t\t\t\tcase 'alac': // Apple Lossless Audio Codec\n\t\t\t\t\t\t\t\t\t\t\tcase 'sowt': // signed/two's complement (Little Endian)\n\t\t\t\t\t\t\t\t\t\t\tcase 'twos': // signed/two's complement (Big Endian)\n\t\t\t\t\t\t\t\t\t\t\tcase 'in24': // 24-bit Integer\n\t\t\t\t\t\t\t\t\t\t\tcase 'in32': // 32-bit Integer\n\t\t\t\t\t\t\t\t\t\t\tcase 'fl32': // 32-bit Floating Point\n\t\t\t\t\t\t\t\t\t\t\tcase 'fl64': // 64-bit Floating Point\n\t\t\t\t\t\t\t\t\t\t\t\t$info['audio']['lossless'] = $info['quicktime']['audio']['lossless'] = true;\n\t\t\t\t\t\t\t\t\t\t\t\t$info['audio']['bitrate']  = $info['quicktime']['audio']['bitrate']  = $info['audio']['channels'] * $info['audio']['bits_per_sample'] * $info['audio']['sample_rate'];\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t$info['audio']['lossless'] = false;\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tswitch ($atom_structure['sample_description_table'][$i]['data_format']) {\n\t\t\t\t\t\t\t\t\tcase 'mp4s':\n\t\t\t\t\t\t\t\t\t\t$info['fileformat'] = 'mp4';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t// video atom\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['video_temporal_quality']  =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'],  8,  4));\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['video_spatial_quality']   =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 12,  4));\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['video_frame_width']       =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 16,  2));\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['video_frame_height']      =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 18,  2));\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['video_resolution_x']      = getid3_lib::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 20,  4));\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['video_resolution_y']      = getid3_lib::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 24,  4));\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['video_data_size']         =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 28,  4));\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['video_frame_count']       =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 32,  2));\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['video_encoder_name_len']  =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 34,  1));\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['video_encoder_name']      =                             substr($atom_structure['sample_description_table'][$i]['data'], 35, $atom_structure['sample_description_table'][$i]['video_encoder_name_len']);\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['video_pixel_color_depth'] =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 66,  2));\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['video_color_table_id']    =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 68,  2));\n\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['video_pixel_color_type']  = (($atom_structure['sample_description_table'][$i]['video_pixel_color_depth'] > 32) ? 'grayscale' : 'color');\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sample_description_table'][$i]['video_pixel_color_name']  = $this->QuicktimeColorNameLookup($atom_structure['sample_description_table'][$i]['video_pixel_color_depth']);\n\n\t\t\t\t\t\t\t\t\t\tif ($atom_structure['sample_description_table'][$i]['video_pixel_color_name'] != 'invalid') {\n\t\t\t\t\t\t\t\t\t\t\t$info['quicktime']['video']['codec_fourcc']        = $atom_structure['sample_description_table'][$i]['data_format'];\n\t\t\t\t\t\t\t\t\t\t\t$info['quicktime']['video']['codec_fourcc_lookup'] = $this->QuicktimeVideoCodecLookup($atom_structure['sample_description_table'][$i]['data_format']);\n\t\t\t\t\t\t\t\t\t\t\t$info['quicktime']['video']['codec']               = (($atom_structure['sample_description_table'][$i]['video_encoder_name_len'] > 0) ? $atom_structure['sample_description_table'][$i]['video_encoder_name'] : $atom_structure['sample_description_table'][$i]['data_format']);\n\t\t\t\t\t\t\t\t\t\t\t$info['quicktime']['video']['color_depth']         = $atom_structure['sample_description_table'][$i]['video_pixel_color_depth'];\n\t\t\t\t\t\t\t\t\t\t\t$info['quicktime']['video']['color_depth_name']    = $atom_structure['sample_description_table'][$i]['video_pixel_color_name'];\n\n\t\t\t\t\t\t\t\t\t\t\t$info['video']['codec']           = $info['quicktime']['video']['codec'];\n\t\t\t\t\t\t\t\t\t\t\t$info['video']['bits_per_sample'] = $info['quicktime']['video']['color_depth'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$info['video']['lossless']           = false;\n\t\t\t\t\t\t\t\t\t\t$info['video']['pixel_aspect_ratio'] = (float) 1;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tswitch (strtolower($atom_structure['sample_description_table'][$i]['data_format'])) {\n\t\t\t\t\t\t\tcase 'mp4a':\n\t\t\t\t\t\t\t\t$info['audio']['dataformat']         = 'mp4';\n\t\t\t\t\t\t\t\t$info['quicktime']['audio']['codec'] = 'mp4';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase '3ivx':\n\t\t\t\t\t\t\tcase '3iv1':\n\t\t\t\t\t\t\tcase '3iv2':\n\t\t\t\t\t\t\t\t$info['video']['dataformat'] = '3ivx';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'xvid':\n\t\t\t\t\t\t\t\t$info['video']['dataformat'] = 'xvid';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'mp4v':\n\t\t\t\t\t\t\t\t$info['video']['dataformat'] = 'mpeg4';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'divx':\n\t\t\t\t\t\t\tcase 'div1':\n\t\t\t\t\t\t\tcase 'div2':\n\t\t\t\t\t\t\tcase 'div3':\n\t\t\t\t\t\t\tcase 'div4':\n\t\t\t\t\t\t\tcase 'div5':\n\t\t\t\t\t\t\tcase 'div6':\n\t\t\t\t\t\t\t\t$info['video']['dataformat'] = 'divx';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($atom_structure['sample_description_table'][$i]['data']);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'stts': // Sample Table Time-to-Sample atom\n\t\t\t\t\t$atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t$atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));\n\t\t\t\t\t$sttsEntriesDataOffset = 8;\n\t\t\t\t\t//$FrameRateCalculatorArray = array();\n\t\t\t\t\t$frames_count = 0;\n\n\t\t\t\t\t$max_stts_entries_to_scan = ($info['php_memory_limit'] ? min(floor($this->getid3->memory_limit / 10000), $atom_structure['number_entries']) : $atom_structure['number_entries']);\n\t\t\t\t\tif ($max_stts_entries_to_scan < $atom_structure['number_entries']) {\n\t\t\t\t\t\t$this->warning('QuickTime atom \"stts\" has '.$atom_structure['number_entries'].' but only scanning the first '.$max_stts_entries_to_scan.' entries due to limited PHP memory available ('.floor($this->getid3->memory_limit / 1048576).'MB).');\n\t\t\t\t\t}\n\t\t\t\t\tfor ($i = 0; $i < $max_stts_entries_to_scan; $i++) {\n\t\t\t\t\t\t$atom_structure['time_to_sample_table'][$i]['sample_count']    = getid3_lib::BigEndian2Int(substr($atom_data, $sttsEntriesDataOffset, 4));\n\t\t\t\t\t\t$sttsEntriesDataOffset += 4;\n\t\t\t\t\t\t$atom_structure['time_to_sample_table'][$i]['sample_duration'] = getid3_lib::BigEndian2Int(substr($atom_data, $sttsEntriesDataOffset, 4));\n\t\t\t\t\t\t$sttsEntriesDataOffset += 4;\n\n\t\t\t\t\t\t$frames_count += $atom_structure['time_to_sample_table'][$i]['sample_count'];\n\n\t\t\t\t\t\t// THIS SECTION REPLACED WITH CODE IN \"stbl\" ATOM\n\t\t\t\t\t\t//if (!empty($info['quicktime']['time_scale']) && ($atom_structure['time_to_sample_table'][$i]['sample_duration'] > 0)) {\n\t\t\t\t\t\t//\t$stts_new_framerate = $info['quicktime']['time_scale'] / $atom_structure['time_to_sample_table'][$i]['sample_duration'];\n\t\t\t\t\t\t//\tif ($stts_new_framerate <= 60) {\n\t\t\t\t\t\t//\t\t// some atoms have durations of \"1\" giving a very large framerate, which probably is not right\n\t\t\t\t\t\t//\t\t$info['video']['frame_rate'] = max($info['video']['frame_rate'], $stts_new_framerate);\n\t\t\t\t\t\t//\t}\n\t\t\t\t\t\t//}\n\t\t\t\t\t\t//\n\t\t\t\t\t\t//$FrameRateCalculatorArray[($info['quicktime']['time_scale'] / $atom_structure['time_to_sample_table'][$i]['sample_duration'])] += $atom_structure['time_to_sample_table'][$i]['sample_count'];\n\t\t\t\t\t}\n\t\t\t\t\t$info['quicktime']['stts_framecount'][] = $frames_count;\n\t\t\t\t\t//$sttsFramesTotal  = 0;\n\t\t\t\t\t//$sttsSecondsTotal = 0;\n\t\t\t\t\t//foreach ($FrameRateCalculatorArray as $frames_per_second => $frame_count) {\n\t\t\t\t\t//\tif (($frames_per_second > 60) || ($frames_per_second < 1)) {\n\t\t\t\t\t//\t\t// not video FPS information, probably audio information\n\t\t\t\t\t//\t\t$sttsFramesTotal  = 0;\n\t\t\t\t\t//\t\t$sttsSecondsTotal = 0;\n\t\t\t\t\t//\t\tbreak;\n\t\t\t\t\t//\t}\n\t\t\t\t\t//\t$sttsFramesTotal  += $frame_count;\n\t\t\t\t\t//\t$sttsSecondsTotal += $frame_count / $frames_per_second;\n\t\t\t\t\t//}\n\t\t\t\t\t//if (($sttsFramesTotal > 0) && ($sttsSecondsTotal > 0)) {\n\t\t\t\t\t//\tif (($sttsFramesTotal / $sttsSecondsTotal) > $info['video']['frame_rate']) {\n\t\t\t\t\t//\t\t$info['video']['frame_rate'] = $sttsFramesTotal / $sttsSecondsTotal;\n\t\t\t\t\t//\t}\n\t\t\t\t\t//}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'stss': // Sample Table Sync Sample (key frames) atom\n\t\t\t\t\tif ($ParseAllPossibleAtoms) {\n\t\t\t\t\t\t$atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t\t$atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t\t$atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));\n\t\t\t\t\t\t$stssEntriesDataOffset = 8;\n\t\t\t\t\t\tfor ($i = 0; $i < $atom_structure['number_entries']; $i++) {\n\t\t\t\t\t\t\t$atom_structure['time_to_sample_table'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $stssEntriesDataOffset, 4));\n\t\t\t\t\t\t\t$stssEntriesDataOffset += 4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'stsc': // Sample Table Sample-to-Chunk atom\n\t\t\t\t\tif ($ParseAllPossibleAtoms) {\n\t\t\t\t\t\t$atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t\t$atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t\t$atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));\n\t\t\t\t\t\t$stscEntriesDataOffset = 8;\n\t\t\t\t\t\tfor ($i = 0; $i < $atom_structure['number_entries']; $i++) {\n\t\t\t\t\t\t\t$atom_structure['sample_to_chunk_table'][$i]['first_chunk']        = getid3_lib::BigEndian2Int(substr($atom_data, $stscEntriesDataOffset, 4));\n\t\t\t\t\t\t\t$stscEntriesDataOffset += 4;\n\t\t\t\t\t\t\t$atom_structure['sample_to_chunk_table'][$i]['samples_per_chunk']  = getid3_lib::BigEndian2Int(substr($atom_data, $stscEntriesDataOffset, 4));\n\t\t\t\t\t\t\t$stscEntriesDataOffset += 4;\n\t\t\t\t\t\t\t$atom_structure['sample_to_chunk_table'][$i]['sample_description'] = getid3_lib::BigEndian2Int(substr($atom_data, $stscEntriesDataOffset, 4));\n\t\t\t\t\t\t\t$stscEntriesDataOffset += 4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'stsz': // Sample Table SiZe atom\n\t\t\t\t\tif ($ParseAllPossibleAtoms) {\n\t\t\t\t\t\t$atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t\t$atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t\t$atom_structure['sample_size']    = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));\n\t\t\t\t\t\t$atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  8, 4));\n\t\t\t\t\t\t$stszEntriesDataOffset = 12;\n\t\t\t\t\t\tif ($atom_structure['sample_size'] == 0) {\n\t\t\t\t\t\t\tfor ($i = 0; $i < $atom_structure['number_entries']; $i++) {\n\t\t\t\t\t\t\t\t$atom_structure['sample_size_table'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $stszEntriesDataOffset, 4));\n\t\t\t\t\t\t\t\t$stszEntriesDataOffset += 4;\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\tbreak;\n\n\n\t\t\t\tcase 'stco': // Sample Table Chunk Offset atom\n//\t\t\t\t\tif (true) {\n\t\t\t\t\tif ($ParseAllPossibleAtoms) {\n\t\t\t\t\t\t$atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t\t$atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t\t$atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));\n\t\t\t\t\t\t$stcoEntriesDataOffset = 8;\n\t\t\t\t\t\tfor ($i = 0; $i < $atom_structure['number_entries']; $i++) {\n\t\t\t\t\t\t\t$atom_structure['chunk_offset_table'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $stcoEntriesDataOffset, 4));\n\t\t\t\t\t\t\t$stcoEntriesDataOffset += 4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'co64': // Chunk Offset 64-bit (version of \"stco\" that supports > 2GB files)\n\t\t\t\t\tif ($ParseAllPossibleAtoms) {\n\t\t\t\t\t\t$atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t\t$atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t\t$atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));\n\t\t\t\t\t\t$stcoEntriesDataOffset = 8;\n\t\t\t\t\t\tfor ($i = 0; $i < $atom_structure['number_entries']; $i++) {\n\t\t\t\t\t\t\t$atom_structure['chunk_offset_table'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $stcoEntriesDataOffset, 8));\n\t\t\t\t\t\t\t$stcoEntriesDataOffset += 8;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'dref': // Data REFerence atom\n\t\t\t\t\t$atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t$atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));\n\t\t\t\t\t$drefDataOffset = 8;\n\t\t\t\t\tfor ($i = 0; $i < $atom_structure['number_entries']; $i++) {\n\t\t\t\t\t\t$atom_structure['data_references'][$i]['size']                    = getid3_lib::BigEndian2Int(substr($atom_data, $drefDataOffset, 4));\n\t\t\t\t\t\t$drefDataOffset += 4;\n\t\t\t\t\t\t$atom_structure['data_references'][$i]['type']                    =                           substr($atom_data, $drefDataOffset, 4);\n\t\t\t\t\t\t$drefDataOffset += 4;\n\t\t\t\t\t\t$atom_structure['data_references'][$i]['version']                 = getid3_lib::BigEndian2Int(substr($atom_data,  $drefDataOffset, 1));\n\t\t\t\t\t\t$drefDataOffset += 1;\n\t\t\t\t\t\t$atom_structure['data_references'][$i]['flags_raw']               = getid3_lib::BigEndian2Int(substr($atom_data,  $drefDataOffset, 3)); // hardcoded: 0x0000\n\t\t\t\t\t\t$drefDataOffset += 3;\n\t\t\t\t\t\t$atom_structure['data_references'][$i]['data']                    =                           substr($atom_data, $drefDataOffset, ($atom_structure['data_references'][$i]['size'] - 4 - 4 - 1 - 3));\n\t\t\t\t\t\t$drefDataOffset += ($atom_structure['data_references'][$i]['size'] - 4 - 4 - 1 - 3);\n\n\t\t\t\t\t\t$atom_structure['data_references'][$i]['flags']['self_reference'] = (bool) ($atom_structure['data_references'][$i]['flags_raw'] & 0x001);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'gmin': // base Media INformation atom\n\t\t\t\t\t$atom_structure['version']                = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t$atom_structure['graphics_mode']          = getid3_lib::BigEndian2Int(substr($atom_data,  4, 2));\n\t\t\t\t\t$atom_structure['opcolor_red']            = getid3_lib::BigEndian2Int(substr($atom_data,  6, 2));\n\t\t\t\t\t$atom_structure['opcolor_green']          = getid3_lib::BigEndian2Int(substr($atom_data,  8, 2));\n\t\t\t\t\t$atom_structure['opcolor_blue']           = getid3_lib::BigEndian2Int(substr($atom_data, 10, 2));\n\t\t\t\t\t$atom_structure['balance']                = getid3_lib::BigEndian2Int(substr($atom_data, 12, 2));\n\t\t\t\t\t$atom_structure['reserved']               = getid3_lib::BigEndian2Int(substr($atom_data, 14, 2));\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'smhd': // Sound Media information HeaDer atom\n\t\t\t\t\t$atom_structure['version']                = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t$atom_structure['balance']                = getid3_lib::BigEndian2Int(substr($atom_data,  4, 2));\n\t\t\t\t\t$atom_structure['reserved']               = getid3_lib::BigEndian2Int(substr($atom_data,  6, 2));\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'vmhd': // Video Media information HeaDer atom\n\t\t\t\t\t$atom_structure['version']                = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3));\n\t\t\t\t\t$atom_structure['graphics_mode']          = getid3_lib::BigEndian2Int(substr($atom_data,  4, 2));\n\t\t\t\t\t$atom_structure['opcolor_red']            = getid3_lib::BigEndian2Int(substr($atom_data,  6, 2));\n\t\t\t\t\t$atom_structure['opcolor_green']          = getid3_lib::BigEndian2Int(substr($atom_data,  8, 2));\n\t\t\t\t\t$atom_structure['opcolor_blue']           = getid3_lib::BigEndian2Int(substr($atom_data, 10, 2));\n\n\t\t\t\t\t$atom_structure['flags']['no_lean_ahead'] = (bool) ($atom_structure['flags_raw'] & 0x001);\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'hdlr': // HanDLeR reference atom\n\t\t\t\t\t$atom_structure['version']                = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t$atom_structure['component_type']         =                           substr($atom_data,  4, 4);\n\t\t\t\t\t$atom_structure['component_subtype']      =                           substr($atom_data,  8, 4);\n\t\t\t\t\t$atom_structure['component_manufacturer'] =                           substr($atom_data, 12, 4);\n\t\t\t\t\t$atom_structure['component_flags_raw']    = getid3_lib::BigEndian2Int(substr($atom_data, 16, 4));\n\t\t\t\t\t$atom_structure['component_flags_mask']   = getid3_lib::BigEndian2Int(substr($atom_data, 20, 4));\n\t\t\t\t\t$atom_structure['component_name']         = $this->MaybePascal2String(substr($atom_data, 24));\n\n\t\t\t\t\tif (($atom_structure['component_subtype'] == 'STpn') && ($atom_structure['component_manufacturer'] == 'zzzz')) {\n\t\t\t\t\t\t$info['video']['dataformat'] = 'quicktimevr';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'mdhd': // MeDia HeaDer atom\n\t\t\t\t\t$atom_structure['version']               = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']             = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t$atom_structure['creation_time']         = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));\n\t\t\t\t\t$atom_structure['modify_time']           = getid3_lib::BigEndian2Int(substr($atom_data,  8, 4));\n\t\t\t\t\t$atom_structure['time_scale']            = getid3_lib::BigEndian2Int(substr($atom_data, 12, 4));\n\t\t\t\t\t$atom_structure['duration']              = getid3_lib::BigEndian2Int(substr($atom_data, 16, 4));\n\t\t\t\t\t$atom_structure['language_id']           = getid3_lib::BigEndian2Int(substr($atom_data, 20, 2));\n\t\t\t\t\t$atom_structure['quality']               = getid3_lib::BigEndian2Int(substr($atom_data, 22, 2));\n\n\t\t\t\t\tif ($atom_structure['time_scale'] == 0) {\n\t\t\t\t\t\t$this->error('Corrupt Quicktime file: mdhd.time_scale == zero');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t$info['quicktime']['time_scale'] = ((isset($info['quicktime']['time_scale']) && ($info['quicktime']['time_scale'] < 1000)) ? max($info['quicktime']['time_scale'], $atom_structure['time_scale']) : $atom_structure['time_scale']);\n\n\t\t\t\t\t$atom_structure['creation_time_unix']    = getid3_lib::DateMac2Unix($atom_structure['creation_time']);\n\t\t\t\t\t$atom_structure['modify_time_unix']      = getid3_lib::DateMac2Unix($atom_structure['modify_time']);\n\t\t\t\t\t$atom_structure['playtime_seconds']      = $atom_structure['duration'] / $atom_structure['time_scale'];\n\t\t\t\t\t$atom_structure['language']              = $this->QuicktimeLanguageLookup($atom_structure['language_id']);\n\t\t\t\t\tif (empty($info['comments']['language']) || (!in_array($atom_structure['language'], $info['comments']['language']))) {\n\t\t\t\t\t\t$info['comments']['language'][] = $atom_structure['language'];\n\t\t\t\t\t}\n\t\t\t\t\t$info['quicktime']['timestamps_unix']['create'][$atom_structure['hierarchy']] = $atom_structure['creation_time_unix'];\n\t\t\t\t\t$info['quicktime']['timestamps_unix']['modify'][$atom_structure['hierarchy']] = $atom_structure['modify_time_unix'];\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'pnot': // Preview atom\n\t\t\t\t\t$atom_structure['modification_date']      = getid3_lib::BigEndian2Int(substr($atom_data,  0, 4)); // \"standard Macintosh format\"\n\t\t\t\t\t$atom_structure['version_number']         = getid3_lib::BigEndian2Int(substr($atom_data,  4, 2)); // hardcoded: 0x00\n\t\t\t\t\t$atom_structure['atom_type']              =                           substr($atom_data,  6, 4);        // usually: 'PICT'\n\t\t\t\t\t$atom_structure['atom_index']             = getid3_lib::BigEndian2Int(substr($atom_data, 10, 2)); // usually: 0x01\n\n\t\t\t\t\t$atom_structure['modification_date_unix'] = getid3_lib::DateMac2Unix($atom_structure['modification_date']);\n\t\t\t\t\t$info['quicktime']['timestamps_unix']['modify'][$atom_structure['hierarchy']] = $atom_structure['modification_date_unix'];\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'crgn': // Clipping ReGioN atom\n\t\t\t\t\t$atom_structure['region_size']   = getid3_lib::BigEndian2Int(substr($atom_data,  0, 2)); // The Region size, Region boundary box,\n\t\t\t\t\t$atom_structure['boundary_box']  = getid3_lib::BigEndian2Int(substr($atom_data,  2, 8)); // and Clipping region data fields\n\t\t\t\t\t$atom_structure['clipping_data'] =                           substr($atom_data, 10);           // constitute a QuickDraw region.\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'load': // track LOAD settings atom\n\t\t\t\t\t$atom_structure['preload_start_time'] = getid3_lib::BigEndian2Int(substr($atom_data,  0, 4));\n\t\t\t\t\t$atom_structure['preload_duration']   = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));\n\t\t\t\t\t$atom_structure['preload_flags_raw']  = getid3_lib::BigEndian2Int(substr($atom_data,  8, 4));\n\t\t\t\t\t$atom_structure['default_hints_raw']  = getid3_lib::BigEndian2Int(substr($atom_data, 12, 4));\n\n\t\t\t\t\t$atom_structure['default_hints']['double_buffer'] = (bool) ($atom_structure['default_hints_raw'] & 0x0020);\n\t\t\t\t\t$atom_structure['default_hints']['high_quality']  = (bool) ($atom_structure['default_hints_raw'] & 0x0100);\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'tmcd': // TiMe CoDe atom\n\t\t\t\tcase 'chap': // CHAPter list atom\n\t\t\t\tcase 'sync': // SYNChronization atom\n\t\t\t\tcase 'scpt': // tranSCriPT atom\n\t\t\t\tcase 'ssrc': // non-primary SouRCe atom\n\t\t\t\t\tfor ($i = 0; $i < strlen($atom_data); $i += 4) {\n\t\t\t\t\t\t@$atom_structure['track_id'][] = getid3_lib::BigEndian2Int(substr($atom_data, $i, 4));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'elst': // Edit LiST atom\n\t\t\t\t\t$atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t$atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));\n\t\t\t\t\tfor ($i = 0; $i < $atom_structure['number_entries']; $i++ ) {\n\t\t\t\t\t\t$atom_structure['edit_list'][$i]['track_duration'] =   getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($i * 12) + 0, 4));\n\t\t\t\t\t\t$atom_structure['edit_list'][$i]['media_time']     =   getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($i * 12) + 4, 4));\n\t\t\t\t\t\t$atom_structure['edit_list'][$i]['media_rate']     = getid3_lib::FixedPoint16_16(substr($atom_data, 8 + ($i * 12) + 8, 4));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'kmat': // compressed MATte atom\n\t\t\t\t\t$atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000\n\t\t\t\t\t$atom_structure['matte_data_raw'] =               substr($atom_data,  4);\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'ctab': // Color TABle atom\n\t\t\t\t\t$atom_structure['color_table_seed']   = getid3_lib::BigEndian2Int(substr($atom_data,  0, 4)); // hardcoded: 0x00000000\n\t\t\t\t\t$atom_structure['color_table_flags']  = getid3_lib::BigEndian2Int(substr($atom_data,  4, 2)); // hardcoded: 0x8000\n\t\t\t\t\t$atom_structure['color_table_size']   = getid3_lib::BigEndian2Int(substr($atom_data,  6, 2)) + 1;\n\t\t\t\t\tfor ($colortableentry = 0; $colortableentry < $atom_structure['color_table_size']; $colortableentry++) {\n\t\t\t\t\t\t$atom_structure['color_table'][$colortableentry]['alpha'] = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 0, 2));\n\t\t\t\t\t\t$atom_structure['color_table'][$colortableentry]['red']   = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 2, 2));\n\t\t\t\t\t\t$atom_structure['color_table'][$colortableentry]['green'] = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 4, 2));\n\t\t\t\t\t\t$atom_structure['color_table'][$colortableentry]['blue']  = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 6, 2));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'mvhd': // MoVie HeaDer atom\n\t\t\t\t\t$atom_structure['version']            =   getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']          =   getid3_lib::BigEndian2Int(substr($atom_data,  1, 3));\n\t\t\t\t\t$atom_structure['creation_time']      =   getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));\n\t\t\t\t\t$atom_structure['modify_time']        =   getid3_lib::BigEndian2Int(substr($atom_data,  8, 4));\n\t\t\t\t\t$atom_structure['time_scale']         =   getid3_lib::BigEndian2Int(substr($atom_data, 12, 4));\n\t\t\t\t\t$atom_structure['duration']           =   getid3_lib::BigEndian2Int(substr($atom_data, 16, 4));\n\t\t\t\t\t$atom_structure['preferred_rate']     = getid3_lib::FixedPoint16_16(substr($atom_data, 20, 4));\n\t\t\t\t\t$atom_structure['preferred_volume']   =   getid3_lib::FixedPoint8_8(substr($atom_data, 24, 2));\n\t\t\t\t\t$atom_structure['reserved']           =                             substr($atom_data, 26, 10);\n\t\t\t\t\t$atom_structure['matrix_a']           = getid3_lib::FixedPoint16_16(substr($atom_data, 36, 4));\n\t\t\t\t\t$atom_structure['matrix_b']           = getid3_lib::FixedPoint16_16(substr($atom_data, 40, 4));\n\t\t\t\t\t$atom_structure['matrix_u']           =  getid3_lib::FixedPoint2_30(substr($atom_data, 44, 4));\n\t\t\t\t\t$atom_structure['matrix_c']           = getid3_lib::FixedPoint16_16(substr($atom_data, 48, 4));\n\t\t\t\t\t$atom_structure['matrix_d']           = getid3_lib::FixedPoint16_16(substr($atom_data, 52, 4));\n\t\t\t\t\t$atom_structure['matrix_v']           =  getid3_lib::FixedPoint2_30(substr($atom_data, 56, 4));\n\t\t\t\t\t$atom_structure['matrix_x']           = getid3_lib::FixedPoint16_16(substr($atom_data, 60, 4));\n\t\t\t\t\t$atom_structure['matrix_y']           = getid3_lib::FixedPoint16_16(substr($atom_data, 64, 4));\n\t\t\t\t\t$atom_structure['matrix_w']           =  getid3_lib::FixedPoint2_30(substr($atom_data, 68, 4));\n\t\t\t\t\t$atom_structure['preview_time']       =   getid3_lib::BigEndian2Int(substr($atom_data, 72, 4));\n\t\t\t\t\t$atom_structure['preview_duration']   =   getid3_lib::BigEndian2Int(substr($atom_data, 76, 4));\n\t\t\t\t\t$atom_structure['poster_time']        =   getid3_lib::BigEndian2Int(substr($atom_data, 80, 4));\n\t\t\t\t\t$atom_structure['selection_time']     =   getid3_lib::BigEndian2Int(substr($atom_data, 84, 4));\n\t\t\t\t\t$atom_structure['selection_duration'] =   getid3_lib::BigEndian2Int(substr($atom_data, 88, 4));\n\t\t\t\t\t$atom_structure['current_time']       =   getid3_lib::BigEndian2Int(substr($atom_data, 92, 4));\n\t\t\t\t\t$atom_structure['next_track_id']      =   getid3_lib::BigEndian2Int(substr($atom_data, 96, 4));\n\n\t\t\t\t\tif ($atom_structure['time_scale'] == 0) {\n\t\t\t\t\t\t$this->error('Corrupt Quicktime file: mvhd.time_scale == zero');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t$atom_structure['creation_time_unix']        = getid3_lib::DateMac2Unix($atom_structure['creation_time']);\n\t\t\t\t\t$atom_structure['modify_time_unix']          = getid3_lib::DateMac2Unix($atom_structure['modify_time']);\n\t\t\t\t\t$info['quicktime']['timestamps_unix']['create'][$atom_structure['hierarchy']] = $atom_structure['creation_time_unix'];\n\t\t\t\t\t$info['quicktime']['timestamps_unix']['modify'][$atom_structure['hierarchy']] = $atom_structure['modify_time_unix'];\n\t\t\t\t\t$info['quicktime']['time_scale']    = ((isset($info['quicktime']['time_scale']) && ($info['quicktime']['time_scale'] < 1000)) ? max($info['quicktime']['time_scale'], $atom_structure['time_scale']) : $atom_structure['time_scale']);\n\t\t\t\t\t$info['quicktime']['display_scale'] = $atom_structure['matrix_a'];\n\t\t\t\t\t$info['playtime_seconds']           = $atom_structure['duration'] / $atom_structure['time_scale'];\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'tkhd': // TracK HeaDer atom\n\t\t\t\t\t$atom_structure['version']             =   getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']           =   getid3_lib::BigEndian2Int(substr($atom_data,  1, 3));\n\t\t\t\t\t$atom_structure['creation_time']       =   getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));\n\t\t\t\t\t$atom_structure['modify_time']         =   getid3_lib::BigEndian2Int(substr($atom_data,  8, 4));\n\t\t\t\t\t$atom_structure['trackid']             =   getid3_lib::BigEndian2Int(substr($atom_data, 12, 4));\n\t\t\t\t\t$atom_structure['reserved1']           =   getid3_lib::BigEndian2Int(substr($atom_data, 16, 4));\n\t\t\t\t\t$atom_structure['duration']            =   getid3_lib::BigEndian2Int(substr($atom_data, 20, 4));\n\t\t\t\t\t$atom_structure['reserved2']           =   getid3_lib::BigEndian2Int(substr($atom_data, 24, 8));\n\t\t\t\t\t$atom_structure['layer']               =   getid3_lib::BigEndian2Int(substr($atom_data, 32, 2));\n\t\t\t\t\t$atom_structure['alternate_group']     =   getid3_lib::BigEndian2Int(substr($atom_data, 34, 2));\n\t\t\t\t\t$atom_structure['volume']              =   getid3_lib::FixedPoint8_8(substr($atom_data, 36, 2));\n\t\t\t\t\t$atom_structure['reserved3']           =   getid3_lib::BigEndian2Int(substr($atom_data, 38, 2));\n\t\t\t\t\t// http://developer.apple.com/library/mac/#documentation/QuickTime/RM/MovieBasics/MTEditing/K-Chapter/11MatrixFunctions.html\n\t\t\t\t\t// http://developer.apple.com/library/mac/#documentation/QuickTime/qtff/QTFFChap4/qtff4.html#//apple_ref/doc/uid/TP40000939-CH206-18737\n\t\t\t\t\t$atom_structure['matrix_a']            = getid3_lib::FixedPoint16_16(substr($atom_data, 40, 4));\n\t\t\t\t\t$atom_structure['matrix_b']            = getid3_lib::FixedPoint16_16(substr($atom_data, 44, 4));\n\t\t\t\t\t$atom_structure['matrix_u']            =  getid3_lib::FixedPoint2_30(substr($atom_data, 48, 4));\n\t\t\t\t\t$atom_structure['matrix_c']            = getid3_lib::FixedPoint16_16(substr($atom_data, 52, 4));\n\t\t\t\t\t$atom_structure['matrix_d']            = getid3_lib::FixedPoint16_16(substr($atom_data, 56, 4));\n\t\t\t\t\t$atom_structure['matrix_v']            =  getid3_lib::FixedPoint2_30(substr($atom_data, 60, 4));\n\t\t\t\t\t$atom_structure['matrix_x']            = getid3_lib::FixedPoint16_16(substr($atom_data, 64, 4));\n\t\t\t\t\t$atom_structure['matrix_y']            = getid3_lib::FixedPoint16_16(substr($atom_data, 68, 4));\n\t\t\t\t\t$atom_structure['matrix_w']            =  getid3_lib::FixedPoint2_30(substr($atom_data, 72, 4));\n\t\t\t\t\t$atom_structure['width']               = getid3_lib::FixedPoint16_16(substr($atom_data, 76, 4));\n\t\t\t\t\t$atom_structure['height']              = getid3_lib::FixedPoint16_16(substr($atom_data, 80, 4));\n\t\t\t\t\t$atom_structure['flags']['enabled']    = (bool) ($atom_structure['flags_raw'] & 0x0001);\n\t\t\t\t\t$atom_structure['flags']['in_movie']   = (bool) ($atom_structure['flags_raw'] & 0x0002);\n\t\t\t\t\t$atom_structure['flags']['in_preview'] = (bool) ($atom_structure['flags_raw'] & 0x0004);\n\t\t\t\t\t$atom_structure['flags']['in_poster']  = (bool) ($atom_structure['flags_raw'] & 0x0008);\n\t\t\t\t\t$atom_structure['creation_time_unix']  = getid3_lib::DateMac2Unix($atom_structure['creation_time']);\n\t\t\t\t\t$atom_structure['modify_time_unix']    = getid3_lib::DateMac2Unix($atom_structure['modify_time']);\n\t\t\t\t\t$info['quicktime']['timestamps_unix']['create'][$atom_structure['hierarchy']] = $atom_structure['creation_time_unix'];\n\t\t\t\t\t$info['quicktime']['timestamps_unix']['modify'][$atom_structure['hierarchy']] = $atom_structure['modify_time_unix'];\n\n\t\t\t\t\t// https://www.getid3.org/phpBB3/viewtopic.php?t=1908\n\t\t\t\t\t// attempt to compute rotation from matrix values\n\t\t\t\t\t// 2017-Dec-28: uncertain if 90/270 are correctly oriented; values returned by FixedPoint16_16 should perhaps be -1 instead of 65535(?)\n\t\t\t\t\t$matrixRotation = 0;\n\t\t\t\t\tswitch ($atom_structure['matrix_a'].':'.$atom_structure['matrix_b'].':'.$atom_structure['matrix_c'].':'.$atom_structure['matrix_d']) {\n\t\t\t\t\t\tcase '1:0:0:1':         $matrixRotation =   0; break;\n\t\t\t\t\t\tcase '0:1:65535:0':     $matrixRotation =  90; break;\n\t\t\t\t\t\tcase '65535:0:0:65535': $matrixRotation = 180; break;\n\t\t\t\t\t\tcase '0:65535:1:0':     $matrixRotation = 270; break;\n\t\t\t\t\t\tdefault: break;\n\t\t\t\t\t}\n\n\t\t\t\t\t// https://www.getid3.org/phpBB3/viewtopic.php?t=2468\n\t\t\t\t\t// The rotation matrix can appear in the Quicktime file multiple times, at least once for each track,\n\t\t\t\t\t// and it's possible that only the video track (or, in theory, one of the video tracks) is flagged as\n\t\t\t\t\t// rotated while the other tracks (e.g. audio) is tagged as rotation=0 (behavior noted on iPhone 8 Plus)\n\t\t\t\t\t// The correct solution would be to check if the TrackID associated with the rotation matrix is indeed\n\t\t\t\t\t// a video track (or the main video track) and only set the rotation then, but since information about\n\t\t\t\t\t// what track is what is not trivially there to be examined, the lazy solution is to set the rotation\n\t\t\t\t\t// if it is found to be nonzero, on the assumption that tracks that don't need it will have rotation set\n\t\t\t\t\t// to zero (and be effectively ignored) and the video track will have rotation set correctly, which will\n\t\t\t\t\t// either be zero and automatically correct, or nonzero and be set correctly.\n\t\t\t\t\tif (!isset($info['video']['rotate']) || (($info['video']['rotate'] == 0) && ($matrixRotation > 0))) {\n\t\t\t\t\t\t$info['quicktime']['video']['rotate'] = $info['video']['rotate'] = $matrixRotation;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($atom_structure['flags']['enabled'] == 1) {\n\t\t\t\t\t\tif (!isset($info['video']['resolution_x']) || !isset($info['video']['resolution_y'])) {\n\t\t\t\t\t\t\t$info['video']['resolution_x'] = $atom_structure['width'];\n\t\t\t\t\t\t\t$info['video']['resolution_y'] = $atom_structure['height'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$info['video']['resolution_x'] = max($info['video']['resolution_x'], $atom_structure['width']);\n\t\t\t\t\t\t$info['video']['resolution_y'] = max($info['video']['resolution_y'], $atom_structure['height']);\n\t\t\t\t\t\t$info['quicktime']['video']['resolution_x'] = $info['video']['resolution_x'];\n\t\t\t\t\t\t$info['quicktime']['video']['resolution_y'] = $info['video']['resolution_y'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// see: https://www.getid3.org/phpBB3/viewtopic.php?t=1295\n\t\t\t\t\t\t//if (isset($info['video']['resolution_x'])) { unset($info['video']['resolution_x']); }\n\t\t\t\t\t\t//if (isset($info['video']['resolution_y'])) { unset($info['video']['resolution_y']); }\n\t\t\t\t\t\t//if (isset($info['quicktime']['video']))    { unset($info['quicktime']['video']);    }\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'iods': // Initial Object DeScriptor atom\n\t\t\t\t\t// http://www.koders.com/c/fid1FAB3E762903DC482D8A246D4A4BF9F28E049594.aspx?s=windows.h\n\t\t\t\t\t// http://libquicktime.sourcearchive.com/documentation/1.0.2plus-pdebian/iods_8c-source.html\n\t\t\t\t\t$offset = 0;\n\t\t\t\t\t$atom_structure['version']                =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));\n\t\t\t\t\t$offset += 1;\n\t\t\t\t\t$atom_structure['flags_raw']              =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 3));\n\t\t\t\t\t$offset += 3;\n\t\t\t\t\t$atom_structure['mp4_iod_tag']            =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));\n\t\t\t\t\t$offset += 1;\n\t\t\t\t\t$atom_structure['length']                 = $this->quicktime_read_mp4_descr_length($atom_data, $offset);\n\t\t\t\t\t//$offset already adjusted by quicktime_read_mp4_descr_length()\n\t\t\t\t\t$atom_structure['object_descriptor_id']   =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 2));\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\t$atom_structure['od_profile_level']       =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));\n\t\t\t\t\t$offset += 1;\n\t\t\t\t\t$atom_structure['scene_profile_level']    =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));\n\t\t\t\t\t$offset += 1;\n\t\t\t\t\t$atom_structure['audio_profile_id']       =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));\n\t\t\t\t\t$offset += 1;\n\t\t\t\t\t$atom_structure['video_profile_id']       =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));\n\t\t\t\t\t$offset += 1;\n\t\t\t\t\t$atom_structure['graphics_profile_level'] =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));\n\t\t\t\t\t$offset += 1;\n\n\t\t\t\t\t$atom_structure['num_iods_tracks'] = ($atom_structure['length'] - 7) / 6; // 6 bytes would only be right if all tracks use 1-byte length fields\n\t\t\t\t\tfor ($i = 0; $i < $atom_structure['num_iods_tracks']; $i++) {\n\t\t\t\t\t\t$atom_structure['track'][$i]['ES_ID_IncTag'] =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));\n\t\t\t\t\t\t$offset += 1;\n\t\t\t\t\t\t$atom_structure['track'][$i]['length']       = $this->quicktime_read_mp4_descr_length($atom_data, $offset);\n\t\t\t\t\t\t//$offset already adjusted by quicktime_read_mp4_descr_length()\n\t\t\t\t\t\t$atom_structure['track'][$i]['track_id']     =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 4));\n\t\t\t\t\t\t$offset += 4;\n\t\t\t\t\t}\n\n\t\t\t\t\t$atom_structure['audio_profile_name'] = $this->QuicktimeIODSaudioProfileName($atom_structure['audio_profile_id']);\n\t\t\t\t\t$atom_structure['video_profile_name'] = $this->QuicktimeIODSvideoProfileName($atom_structure['video_profile_id']);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ftyp': // FileTYPe (?) atom (for MP4 it seems)\n\t\t\t\t\t$atom_structure['signature'] =                           substr($atom_data,  0, 4);\n\t\t\t\t\t$atom_structure['unknown_1'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));\n\t\t\t\t\t$atom_structure['fourcc']    =                           substr($atom_data,  8, 4);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'mdat': // Media DATa atom\n\t\t\t\t\t// 'mdat' contains the actual data for the audio/video, possibly also subtitles\n\n\t/* due to lack of known documentation, this is a kludge implementation. If you know of documentation on how mdat is properly structed, please send it to info@getid3.org */\n\n\t\t\t\t\t// first, skip any 'wide' padding, and second 'mdat' header (with specified size of zero?)\n\t\t\t\t\t$mdat_offset = 0;\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tif (substr($atom_data, $mdat_offset, 8) == \"\\x00\\x00\\x00\\x08\".'wide') {\n\t\t\t\t\t\t\t$mdat_offset += 8;\n\t\t\t\t\t\t} elseif (substr($atom_data, $mdat_offset, 8) == \"\\x00\\x00\\x00\\x00\".'mdat') {\n\t\t\t\t\t\t\t$mdat_offset += 8;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (substr($atom_data, $mdat_offset, 4) == 'GPRO') {\n\t\t\t\t\t\t$GOPRO_chunk_length = getid3_lib::LittleEndian2Int(substr($atom_data, $mdat_offset + 4, 4));\n\t\t\t\t\t\t$GOPRO_offset = 8;\n\t\t\t\t\t\t$atom_structure['GPRO']['raw'] = substr($atom_data, $mdat_offset + 8, $GOPRO_chunk_length - 8);\n\t\t\t\t\t\t$atom_structure['GPRO']['firmware'] = substr($atom_structure['GPRO']['raw'],  0, 15);\n\t\t\t\t\t\t$atom_structure['GPRO']['unknown1'] = substr($atom_structure['GPRO']['raw'], 15, 16);\n\t\t\t\t\t\t$atom_structure['GPRO']['unknown2'] = substr($atom_structure['GPRO']['raw'], 31, 32);\n\t\t\t\t\t\t$atom_structure['GPRO']['unknown3'] = substr($atom_structure['GPRO']['raw'], 63, 16);\n\t\t\t\t\t\t$atom_structure['GPRO']['camera']   = substr($atom_structure['GPRO']['raw'], 79, 32);\n\t\t\t\t\t\t$info['quicktime']['camera']['model'] = rtrim($atom_structure['GPRO']['camera'], \"\\x00\");\n\t\t\t\t\t}\n\n\t\t\t\t\t// check to see if it looks like chapter titles, in the form of unterminated strings with a leading 16-bit size field\n\t\t\t\t\twhile (($mdat_offset < (strlen($atom_data) - 8))\n\t\t\t\t\t\t&& ($chapter_string_length = getid3_lib::BigEndian2Int(substr($atom_data, $mdat_offset, 2)))\n\t\t\t\t\t\t&& ($chapter_string_length < 1000)\n\t\t\t\t\t\t&& ($chapter_string_length <= (strlen($atom_data) - $mdat_offset - 2))\n\t\t\t\t\t\t&& preg_match('#^([\\x00-\\xFF]{2})([\\x20-\\xFF]+)$#', substr($atom_data, $mdat_offset, $chapter_string_length + 2), $chapter_matches)) {\n\t\t\t\t\t\t\tlist($dummy, $chapter_string_length_hex, $chapter_string) = $chapter_matches;\n\t\t\t\t\t\t\t$mdat_offset += (2 + $chapter_string_length);\n\t\t\t\t\t\t\t@$info['quicktime']['comments']['chapters'][] = $chapter_string;\n\n\t\t\t\t\t\t\t// \"encd\" atom specifies encoding. In theory could be anything, almost always UTF-8, but may be UTF-16 with BOM (not currently handled)\n\t\t\t\t\t\t\tif (substr($atom_data, $mdat_offset, 12) == \"\\x00\\x00\\x00\\x0C\\x65\\x6E\\x63\\x64\\x00\\x00\\x01\\x00\") { // UTF-8\n\t\t\t\t\t\t\t\t$mdat_offset += 12;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (($atomsize > 8) && (!isset($info['avdataend_tmp']) || ($info['quicktime'][$atomname]['size'] > ($info['avdataend_tmp'] - $info['avdataoffset'])))) {\n\n\t\t\t\t\t\t$info['avdataoffset'] = $atom_structure['offset'] + 8;                       // $info['quicktime'][$atomname]['offset'] + 8;\n\t\t\t\t\t\t$OldAVDataEnd         = $info['avdataend'];\n\t\t\t\t\t\t$info['avdataend']    = $atom_structure['offset'] + $atom_structure['size']; // $info['quicktime'][$atomname]['offset'] + $info['quicktime'][$atomname]['size'];\n\n\t\t\t\t\t\t$getid3_temp = new getID3();\n\t\t\t\t\t\t$getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp);\n\t\t\t\t\t\t$getid3_temp->info['avdataoffset'] = $info['avdataoffset'];\n\t\t\t\t\t\t$getid3_temp->info['avdataend']    = $info['avdataend'];\n\t\t\t\t\t\t$getid3_mp3 = new getid3_mp3($getid3_temp);\n\t\t\t\t\t\tif ($getid3_mp3->MPEGaudioHeaderValid($getid3_mp3->MPEGaudioHeaderDecode($this->fread(4)))) {\n\t\t\t\t\t\t\t$getid3_mp3->getOnlyMPEGaudioInfo($getid3_temp->info['avdataoffset'], false);\n\t\t\t\t\t\t\tif (!empty($getid3_temp->info['warning'])) {\n\t\t\t\t\t\t\t\tforeach ($getid3_temp->info['warning'] as $value) {\n\t\t\t\t\t\t\t\t\t$this->warning($value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!empty($getid3_temp->info['mpeg'])) {\n\t\t\t\t\t\t\t\t$info['mpeg'] = $getid3_temp->info['mpeg'];\n\t\t\t\t\t\t\t\tif (isset($info['mpeg']['audio'])) {\n\t\t\t\t\t\t\t\t\t$info['audio']['dataformat']   = 'mp3';\n\t\t\t\t\t\t\t\t\t$info['audio']['codec']        = (!empty($info['mpeg']['audio']['encoder']) ? $info['mpeg']['audio']['encoder'] : (!empty($info['mpeg']['audio']['codec']) ? $info['mpeg']['audio']['codec'] : (!empty($info['mpeg']['audio']['LAME']) ? 'LAME' :'mp3')));\n\t\t\t\t\t\t\t\t\t$info['audio']['sample_rate']  = $info['mpeg']['audio']['sample_rate'];\n\t\t\t\t\t\t\t\t\t$info['audio']['channels']     = $info['mpeg']['audio']['channels'];\n\t\t\t\t\t\t\t\t\t$info['audio']['bitrate']      = $info['mpeg']['audio']['bitrate'];\n\t\t\t\t\t\t\t\t\t$info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']);\n\t\t\t\t\t\t\t\t\t$info['bitrate']               = $info['audio']['bitrate'];\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\tunset($getid3_mp3, $getid3_temp);\n\t\t\t\t\t\t$info['avdataend'] = $OldAVDataEnd;\n\t\t\t\t\t\tunset($OldAVDataEnd);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tunset($mdat_offset, $chapter_string_length, $chapter_matches);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'free': // FREE space atom\n\t\t\t\tcase 'skip': // SKIP atom\n\t\t\t\tcase 'wide': // 64-bit expansion placeholder atom\n\t\t\t\t\t// 'free', 'skip' and 'wide' are just padding, contains no useful data at all\n\n\t\t\t\t\t// When writing QuickTime files, it is sometimes necessary to update an atom's size.\n\t\t\t\t\t// It is impossible to update a 32-bit atom to a 64-bit atom since the 32-bit atom\n\t\t\t\t\t// is only 8 bytes in size, and the 64-bit atom requires 16 bytes. Therefore, QuickTime\n\t\t\t\t\t// puts an 8-byte placeholder atom before any atoms it may have to update the size of.\n\t\t\t\t\t// In this way, if the atom needs to be converted from a 32-bit to a 64-bit atom, the\n\t\t\t\t\t// placeholder atom can be overwritten to obtain the necessary 8 extra bytes.\n\t\t\t\t\t// The placeholder atom has a type of kWideAtomPlaceholderType ( 'wide' ).\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'nsav': // NoSAVe atom\n\t\t\t\t\t// http://developer.apple.com/technotes/tn/tn2038.html\n\t\t\t\t\t$atom_structure['data'] = getid3_lib::BigEndian2Int(substr($atom_data,  0, 4));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ctyp': // Controller TYPe atom (seen on QTVR)\n\t\t\t\t\t// http://homepages.slingshot.co.nz/~helmboy/quicktime/formats/qtm-layout.txt\n\t\t\t\t\t// some controller names are:\n\t\t\t\t\t//   0x00 + 'std' for linear movie\n\t\t\t\t\t//   'none' for no controls\n\t\t\t\t\t$atom_structure['ctyp'] = substr($atom_data, 0, 4);\n\t\t\t\t\t$info['quicktime']['controller'] = $atom_structure['ctyp'];\n\t\t\t\t\tswitch ($atom_structure['ctyp']) {\n\t\t\t\t\t\tcase 'qtvr':\n\t\t\t\t\t\t\t$info['video']['dataformat'] = 'quicktimevr';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'pano': // PANOrama track (seen on QTVR)\n\t\t\t\t\t$atom_structure['pano'] = getid3_lib::BigEndian2Int(substr($atom_data,  0, 4));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hint': // HINT track\n\t\t\t\tcase 'hinf': //\n\t\t\t\tcase 'hinv': //\n\t\t\t\tcase 'hnti': //\n\t\t\t\t\t$info['quicktime']['hinting'] = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'imgt': // IMaGe Track reference (kQTVRImageTrackRefType) (seen on QTVR)\n\t\t\t\t\tfor ($i = 0; $i < ($atom_structure['size'] - 8); $i += 4) {\n\t\t\t\t\t\t$atom_structure['imgt'][] = getid3_lib::BigEndian2Int(substr($atom_data, $i, 4));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\t// Observed-but-not-handled atom types are just listed here to prevent warnings being generated\n\t\t\t\tcase 'FXTC': // Something to do with Adobe After Effects (?)\n\t\t\t\tcase 'PrmA':\n\t\t\t\tcase 'code':\n\t\t\t\tcase 'FIEL': // this is NOT \"fiel\" (Field Ordering) as describe here: http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap3/chapter_4_section_2.html\n\t\t\t\tcase 'tapt': // TrackApertureModeDimensionsAID - http://developer.apple.com/documentation/QuickTime/Reference/QT7-1_Update_Reference/Constants/Constants.html\n\t\t\t\t\t\t\t// tapt seems to be used to compute the video size [https://www.getid3.org/phpBB3/viewtopic.php?t=838]\n\t\t\t\t\t\t\t// * http://lists.apple.com/archives/quicktime-api/2006/Aug/msg00014.html\n\t\t\t\t\t\t\t// * http://handbrake.fr/irclogs/handbrake-dev/handbrake-dev20080128_pg2.html\n\t\t\t\tcase 'ctts'://  STCompositionOffsetAID             - http://developer.apple.com/documentation/QuickTime/Reference/QTRef_Constants/Reference/reference.html\n\t\t\t\tcase 'cslg'://  STCompositionShiftLeastGreatestAID - http://developer.apple.com/documentation/QuickTime/Reference/QTRef_Constants/Reference/reference.html\n\t\t\t\tcase 'sdtp'://  STSampleDependencyAID              - http://developer.apple.com/documentation/QuickTime/Reference/QTRef_Constants/Reference/reference.html\n\t\t\t\tcase 'stps'://  STPartialSyncSampleAID             - http://developer.apple.com/documentation/QuickTime/Reference/QTRef_Constants/Reference/reference.html\n\t\t\t\t\t//$atom_structure['data'] = $atom_data;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"\\xA9\".'xyz':  // GPS latitude+longitude+altitude\n\t\t\t\t\t$atom_structure['data'] = $atom_data;\n\t\t\t\t\tif (preg_match('#([\\\\+\\\\-][0-9\\\\.]+)([\\\\+\\\\-][0-9\\\\.]+)([\\\\+\\\\-][0-9\\\\.]+)?/$#i', $atom_data, $matches)) {\n\t\t\t\t\t\t@list($all, $latitude, $longitude, $altitude) = $matches;\n\t\t\t\t\t\t$info['quicktime']['comments']['gps_latitude'][]  = floatval($latitude);\n\t\t\t\t\t\t$info['quicktime']['comments']['gps_longitude'][] = floatval($longitude);\n\t\t\t\t\t\tif (!empty($altitude)) {\n\t\t\t\t\t\t\t$info['quicktime']['comments']['gps_altitude'][] = floatval($altitude);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('QuickTime atom \"\u00c2\u00a9xyz\" data does not match expected data pattern at offset '.$baseoffset.'. Please report as getID3() bug.');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'NCDT':\n\t\t\t\t\t// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html\n\t\t\t\t\t// Nikon-specific QuickTime tags found in the NCDT atom of MOV videos from some Nikon cameras such as the Coolpix S8000 and D5100\n\t\t\t\t\t$atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 4, $atomHierarchy, $ParseAllPossibleAtoms);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'NCTH': // Nikon Camera THumbnail image\n\t\t\t\tcase 'NCVW': // Nikon Camera preVieW image\n\t\t\t\t\t// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html\n\t\t\t\t\tif (preg_match('/^\\xFF\\xD8\\xFF/', $atom_data)) {\n\t\t\t\t\t\t$atom_structure['data'] = $atom_data;\n\t\t\t\t\t\t$atom_structure['image_mime'] = 'image/jpeg';\n\t\t\t\t\t\t$atom_structure['description'] = (($atomname == 'NCTH') ? 'Nikon Camera Thumbnail Image' : (($atomname == 'NCVW') ? 'Nikon Camera Preview Image' : 'Nikon preview image'));\n\t\t\t\t\t\t$info['quicktime']['comments']['picture'][] = array('image_mime'=>$atom_structure['image_mime'], 'data'=>$atom_data, 'description'=>$atom_structure['description']);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'NCTG': // Nikon - http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#NCTG\n\t\t\t\t\t$atom_structure['data'] = $this->QuicktimeParseNikonNCTG($atom_data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'NCHD': // Nikon:MakerNoteVersion  - http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html\n\t\t\t\tcase 'NCDB': // Nikon                   - http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html\n\t\t\t\tcase 'CNCV': // Canon:CompressorVersion - http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Canon.html\n\t\t\t\t\t$atom_structure['data'] = $atom_data;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"\\x00\\x00\\x00\\x00\":\n\t\t\t\t\t// some kind of metacontainer, may contain a big data dump such as:\n\t\t\t\t\t// mdta keys \\005 mdtacom.apple.quicktime.make (mdtacom.apple.quicktime.creationdate ,mdtacom.apple.quicktime.location.ISO6709 $mdtacom.apple.quicktime.software !mdtacom.apple.quicktime.model ilst \\01D \\001 \\015data \\001DE\\010Apple 0 \\002 (data \\001DE\\0102011-05-11T17:54:04+0200 2 \\003 *data \\001DE\\010+52.4936+013.3897+040.247/ \\01D \\004 \\015data \\001DE\\0104.3.1 \\005 \\018data \\001DE\\010iPhone 4\n\t\t\t\t\t// http://www.geocities.com/xhelmboyx/quicktime/formats/qti-layout.txt\n\n\t\t\t\t\t$atom_structure['version']   =          getid3_lib::BigEndian2Int(substr($atom_data, 0, 1));\n\t\t\t\t\t$atom_structure['flags_raw'] =          getid3_lib::BigEndian2Int(substr($atom_data, 1, 3));\n\t\t\t\t\t$atom_structure['subatoms']  = $this->QuicktimeParseContainerAtom(substr($atom_data, 4), $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms);\n\t\t\t\t\t//$atom_structure['subatoms']  = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'meta': // METAdata atom\n\t\t\t\t\t// https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/Metadata/Metadata.html\n\n\t\t\t\t\t$atom_structure['version']   =          getid3_lib::BigEndian2Int(substr($atom_data, 0, 1));\n\t\t\t\t\t$atom_structure['flags_raw'] =          getid3_lib::BigEndian2Int(substr($atom_data, 1, 3));\n\t\t\t\t\t$atom_structure['subatoms']  = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'data': // metaDATA atom\n\t\t\t\t\tstatic $metaDATAkey = 1; // real ugly, but so is the QuickTime structure that stores keys and values in different multinested locations that are hard to relate to each other\n\t\t\t\t\t// seems to be 2 bytes language code (ASCII), 2 bytes unknown (set to 0x10B5 in sample I have), remainder is useful data\n\t\t\t\t\t$atom_structure['language'] =                           substr($atom_data, 4 + 0, 2);\n\t\t\t\t\t$atom_structure['unknown']  = getid3_lib::BigEndian2Int(substr($atom_data, 4 + 2, 2));\n\t\t\t\t\t$atom_structure['data']     =                           substr($atom_data, 4 + 4);\n\t\t\t\t\t$atom_structure['key_name'] = @$info['quicktime']['temp_meta_key_names'][$metaDATAkey++];\n\n\t\t\t\t\tif ($atom_structure['key_name'] && $atom_structure['data']) {\n\t\t\t\t\t\t@$info['quicktime']['comments'][str_replace('com.apple.quicktime.', '', $atom_structure['key_name'])][] = $atom_structure['data'];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'keys': // KEYS that may be present in the metadata atom.\n\t\t\t\t\t// https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/Metadata/Metadata.html#//apple_ref/doc/uid/TP40000939-CH1-SW21\n\t\t\t\t\t// The metadata item keys atom holds a list of the metadata keys that may be present in the metadata atom.\n\t\t\t\t\t// This list is indexed starting with 1; 0 is a reserved index value. The metadata item keys atom is a full atom with an atom type of \"keys\".\n\t\t\t\t\t$atom_structure['version']       = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));\n\t\t\t\t\t$atom_structure['flags_raw']     = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3));\n\t\t\t\t\t$atom_structure['entry_count']   = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));\n\t\t\t\t\t$keys_atom_offset = 8;\n\t\t\t\t\tfor ($i = 1; $i <= $atom_structure['entry_count']; $i++) {\n\t\t\t\t\t\t$atom_structure['keys'][$i]['key_size']      = getid3_lib::BigEndian2Int(substr($atom_data, $keys_atom_offset + 0, 4));\n\t\t\t\t\t\t$atom_structure['keys'][$i]['key_namespace'] =                           substr($atom_data, $keys_atom_offset + 4, 4);\n\t\t\t\t\t\t$atom_structure['keys'][$i]['key_value']     =                           substr($atom_data, $keys_atom_offset + 8, $atom_structure['keys'][$i]['key_size'] - 8);\n\t\t\t\t\t\t$keys_atom_offset += $atom_structure['keys'][$i]['key_size']; // key_size includes the 4+4 bytes for key_size and key_namespace\n\n\t\t\t\t\t\t$info['quicktime']['temp_meta_key_names'][$i] = $atom_structure['keys'][$i]['key_value'];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'uuid': // user-defined atom often seen containing XML data, also used for potentially many other purposes, only a few specifically handled by getID3 (e.g. 360fly spatial data)\n\t\t\t\t\t//Get the UUID ID in first 16 bytes\n\t\t\t\t\t$uuid_bytes_read = unpack('H8time_low/H4time_mid/H4time_hi/H4clock_seq_hi/H12clock_seq_low', substr($atom_data, 0, 16));\n\t\t\t\t\t$atom_structure['uuid_field_id'] = implode('-', $uuid_bytes_read);\n\n\t\t\t\t\tswitch ($atom_structure['uuid_field_id']) {   // http://fileformats.archiveteam.org/wiki/Boxes/atoms_format#UUID_boxes\n\n\t\t\t\t\t\tcase '0537cdab-9d0c-4431-a72a-fa561f2a113e': // Exif                                       - http://fileformats.archiveteam.org/wiki/Exif\n\t\t\t\t\t\tcase '2c4c0100-8504-40b9-a03e-562148d6dfeb': // Photoshop Image Resources                  - http://fileformats.archiveteam.org/wiki/Photoshop_Image_Resources\n\t\t\t\t\t\tcase '33c7a4d2-b81d-4723-a0ba-f1a3e097ad38': // IPTC-IIM                                   - http://fileformats.archiveteam.org/wiki/IPTC-IIM\n\t\t\t\t\t\tcase '8974dbce-7be7-4c51-84f9-7148f9882554': // PIFF Track Encryption Box                  - http://fileformats.archiveteam.org/wiki/Protected_Interoperable_File_Format\n\t\t\t\t\t\tcase '96a9f1f1-dc98-402d-a7ae-d68e34451809': // GeoJP2 World File Box                      - http://fileformats.archiveteam.org/wiki/GeoJP2\n\t\t\t\t\t\tcase 'a2394f52-5a9b-4f14-a244-6c427c648df4': // PIFF Sample Encryption Box                 - http://fileformats.archiveteam.org/wiki/Protected_Interoperable_File_Format\n\t\t\t\t\t\tcase 'b14bf8bd-083d-4b43-a5ae-8cd7d5a6ce03': // GeoJP2 GeoTIFF Box                         - http://fileformats.archiveteam.org/wiki/GeoJP2\n\t\t\t\t\t\tcase 'd08a4f18-10f3-4a82-b6c8-32d8aba183d3': // PIFF Protection System Specific Header Box - http://fileformats.archiveteam.org/wiki/Protected_Interoperable_File_Format\n\t\t\t\t\t\t\t$this->warning('Unhandled (but recognized) \"uuid\" atom identified by \"'.$atom_structure['uuid_field_id'].'\" at offset '.$atom_structure['offset'].' ('.strlen($atom_data).' bytes)');\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'be7acfcb-97a9-42e8-9c71-999491e3afac': // XMP data (in XML format)\n\t\t\t\t\t\t\t$atom_structure['xml'] = substr($atom_data, 16, strlen($atom_data) - 16 - 8); // 16 bytes for UUID, 8 bytes header(?)\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'efe1589a-bb77-49ef-8095-27759eb1dc6f': // 360fly data\n\t\t\t\t\t\t\t/* 360fly code in this block by Paul Lewis 2019-Oct-31 */\n\t\t\t\t\t\t\t/*\tSensor Timestamps need to be calculated using the recordings base time at ['quicktime']['moov']['subatoms'][0]['creation_time_unix']. */\n\t\t\t\t\t\t\t$atom_structure['title'] = '360Fly Sensor Data';\n\n\t\t\t\t\t\t\t//Get the UUID HEADER data\n\t\t\t\t\t\t\t$uuid_bytes_read = unpack('vheader_size/vheader_version/vtimescale/vhardware_version/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/', substr($atom_data, 16, 32));\n\t\t\t\t\t\t\t$atom_structure['uuid_header'] = $uuid_bytes_read;\n\n\t\t\t\t\t\t\t$start_byte = 48;\n\t\t\t\t\t\t\t$atom_SENSOR_data = substr($atom_data, $start_byte);\n\t\t\t\t\t\t\t$atom_structure['sensor_data']['data_type'] = array(\n\t\t\t\t\t\t\t\t\t'fusion_count'   => 0,       // ID 250\n\t\t\t\t\t\t\t\t\t'fusion_data'    => array(),\n\t\t\t\t\t\t\t\t\t'accel_count'    => 0,       // ID 1\n\t\t\t\t\t\t\t\t\t'accel_data'     => array(),\n\t\t\t\t\t\t\t\t\t'gyro_count'     => 0,       // ID 2\n\t\t\t\t\t\t\t\t\t'gyro_data'      => array(),\n\t\t\t\t\t\t\t\t\t'magno_count'    => 0,       // ID 3\n\t\t\t\t\t\t\t\t\t'magno_data'     => array(),\n\t\t\t\t\t\t\t\t\t'gps_count'      => 0,       // ID 5\n\t\t\t\t\t\t\t\t\t'gps_data'       => array(),\n\t\t\t\t\t\t\t\t\t'rotation_count' => 0,       // ID 6\n\t\t\t\t\t\t\t\t\t'rotation_data'  => array(),\n\t\t\t\t\t\t\t\t\t'unknown_count'  => 0,       // ID ??\n\t\t\t\t\t\t\t\t\t'unknown_data'   => array(),\n\t\t\t\t\t\t\t\t\t'debug_list'     => '',      // Used to debug variables stored as comma delimited strings\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$debug_structure['debug_items'] = array();\n\t\t\t\t\t\t\t// Can start loop here to decode all sensor data in 32 Byte chunks:\n\t\t\t\t\t\t\tforeach (str_split($atom_SENSOR_data, 32) as $sensor_key => $sensor_data) {\n\t\t\t\t\t\t\t\t// This gets me a data_type code to work out what data is in the next 31 bytes.\n\t\t\t\t\t\t\t\t$sensor_data_type = substr($sensor_data, 0, 1);\n\t\t\t\t\t\t\t\t$sensor_data_content = substr($sensor_data, 1);\n\t\t\t\t\t\t\t\t$uuid_bytes_read = unpack('C*', $sensor_data_type);\n\t\t\t\t\t\t\t\t$sensor_data_array = array();\n\t\t\t\t\t\t\t\tswitch ($uuid_bytes_read[1]) {\n\t\t\t\t\t\t\t\t\tcase 250:\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sensor_data']['data_type']['fusion_count']++;\n\t\t\t\t\t\t\t\t\t\t$uuid_bytes_read = unpack('cmode/Jtimestamp/Gyaw/Gpitch/Groll/x*', $sensor_data_content);\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['mode']      = $uuid_bytes_read['mode'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['yaw']       = $uuid_bytes_read['yaw'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['pitch']     = $uuid_bytes_read['pitch'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['roll']      = $uuid_bytes_read['roll'];\n\t\t\t\t\t\t\t\t\t\tarray_push($atom_structure['sensor_data']['data_type']['fusion_data'], $sensor_data_array);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sensor_data']['data_type']['accel_count']++;\n\t\t\t\t\t\t\t\t\t\t$uuid_bytes_read = unpack('cmode/Jtimestamp/Gyaw/Gpitch/Groll/x*', $sensor_data_content);\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['mode']      = $uuid_bytes_read['mode'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['yaw']       = $uuid_bytes_read['yaw'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['pitch']     = $uuid_bytes_read['pitch'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['roll']      = $uuid_bytes_read['roll'];\n\t\t\t\t\t\t\t\t\t\tarray_push($atom_structure['sensor_data']['data_type']['accel_data'], $sensor_data_array);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sensor_data']['data_type']['gyro_count']++;\n\t\t\t\t\t\t\t\t\t\t$uuid_bytes_read = unpack('cmode/Jtimestamp/Gyaw/Gpitch/Groll/x*', $sensor_data_content);\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['mode']      = $uuid_bytes_read['mode'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['yaw']       = $uuid_bytes_read['yaw'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['pitch']     = $uuid_bytes_read['pitch'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['roll']      = $uuid_bytes_read['roll'];\n\t\t\t\t\t\t\t\t\t\tarray_push($atom_structure['sensor_data']['data_type']['gyro_data'], $sensor_data_array);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sensor_data']['data_type']['magno_count']++;\n\t\t\t\t\t\t\t\t\t\t$uuid_bytes_read = unpack('cmode/Jtimestamp/Gmagx/Gmagy/Gmagz/x*', $sensor_data_content);\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['mode']      = $uuid_bytes_read['mode'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['magx']      = $uuid_bytes_read['magx'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['magy']      = $uuid_bytes_read['magy'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['magz']      = $uuid_bytes_read['magz'];\n\t\t\t\t\t\t\t\t\t\tarray_push($atom_structure['sensor_data']['data_type']['magno_data'], $sensor_data_array);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sensor_data']['data_type']['gps_count']++;\n\t\t\t\t\t\t\t\t\t\t$uuid_bytes_read = unpack('cmode/Jtimestamp/Glat/Glon/Galt/Gspeed/nbearing/nacc/x*', $sensor_data_content);\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['mode']      = $uuid_bytes_read['mode'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['lat']       = $uuid_bytes_read['lat'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['lon']       = $uuid_bytes_read['lon'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['alt']       = $uuid_bytes_read['alt'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['speed']     = $uuid_bytes_read['speed'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['bearing']   = $uuid_bytes_read['bearing'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['acc']       = $uuid_bytes_read['acc'];\n\t\t\t\t\t\t\t\t\t\tarray_push($atom_structure['sensor_data']['data_type']['gps_data'], $sensor_data_array);\n\t\t\t\t\t\t\t\t\t\t//array_push($debug_structure['debug_items'], $uuid_bytes_read['timestamp']);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sensor_data']['data_type']['rotation_count']++;\n\t\t\t\t\t\t\t\t\t\t$uuid_bytes_read = unpack('cmode/Jtimestamp/Grotx/Groty/Grotz/x*', $sensor_data_content);\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['mode']      = $uuid_bytes_read['mode'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['rotx']      = $uuid_bytes_read['rotx'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['roty']      = $uuid_bytes_read['roty'];\n\t\t\t\t\t\t\t\t\t\t$sensor_data_array['rotz']      = $uuid_bytes_read['rotz'];\n\t\t\t\t\t\t\t\t\t\tarray_push($atom_structure['sensor_data']['data_type']['rotation_data'], $sensor_data_array);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t$atom_structure['sensor_data']['data_type']['unknown_count']++;\n\t\t\t\t\t\t\t\t\t\tbreak;\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//if (isset($debug_structure['debug_items']) && count($debug_structure['debug_items']) > 0) {\n\t\t\t\t\t\t\t//\t$atom_structure['sensor_data']['data_type']['debug_list'] = implode(',', $debug_structure['debug_items']);\n\t\t\t\t\t\t\t//} else {\n\t\t\t\t\t\t\t\t$atom_structure['sensor_data']['data_type']['debug_list'] = 'No debug items in list!';\n\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$this->warning('Unhandled \"uuid\" atom identified by \"'.$atom_structure['uuid_field_id'].'\" at offset '.$atom_structure['offset'].' ('.strlen($atom_data).' bytes)');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'gps ':\n\t\t\t\t\t// https://dashcamtalk.com/forum/threads/script-to-extract-gps-data-from-novatek-mp4.20808/page-2#post-291730\n\t\t\t\t\t// The 'gps ' contains simple look up table made up of 8byte rows, that point to the 'free' atoms that contains the actual GPS data.\n\t\t\t\t\t// The first row is version/metadata/notsure, I skip that.\n\t\t\t\t\t// The following rows consist of 4byte address (absolute) and 4byte size (0x1000), these point to the GPS data in the file.\n\n\t\t\t\t\t$GPS_rowsize = 8; // 4 bytes for offset, 4 bytes for size\n\t\t\t\t\tif (strlen($atom_data) > 0) {\n\t\t\t\t\t\tif ((strlen($atom_data) % $GPS_rowsize) == 0) {\n\t\t\t\t\t\t\t$atom_structure['gps_toc'] = array();\n\t\t\t\t\t\t\tforeach (str_split($atom_data, $GPS_rowsize) as $counter => $datapair) {\n\t\t\t\t\t\t\t\t$atom_structure['gps_toc'][] = unpack('Noffset/Nsize', substr($atom_data, $counter * $GPS_rowsize, $GPS_rowsize));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$atom_structure['gps_entries'] = array();\n\t\t\t\t\t\t\t$previous_offset = $this->ftell();\n\t\t\t\t\t\t\tforeach ($atom_structure['gps_toc'] as $key => $gps_pointer) {\n\t\t\t\t\t\t\t\tif ($key == 0) {\n\t\t\t\t\t\t\t\t\t// \"The first row is version/metadata/notsure, I skip that.\"\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->fseek($gps_pointer['offset']);\n\t\t\t\t\t\t\t\t$GPS_free_data = $this->fread($gps_pointer['size']);\n\n\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t// 2017-05-10: I see some of the data, notably the Hour-Minute-Second, but cannot reconcile the rest of the data. However, the NMEA \"GPRMC\" line is there and relatively easy to parse, so I'm using that instead\n\n\t\t\t\t\t\t\t\t// https://dashcamtalk.com/forum/threads/script-to-extract-gps-data-from-novatek-mp4.20808/page-2#post-291730\n\t\t\t\t\t\t\t\t// The structure of the GPS data atom (the 'free' atoms mentioned above) is following:\n\t\t\t\t\t\t\t\t// hour,minute,second,year,month,day,active,latitude_b,longitude_b,unknown2,latitude,longitude,speed = struct.unpack_from('<IIIIIIssssfff',data, 48)\n\t\t\t\t\t\t\t\t// For those unfamiliar with python struct:\n\t\t\t\t\t\t\t\t// I = int\n\t\t\t\t\t\t\t\t// s = is string (size 1, in this case)\n\t\t\t\t\t\t\t\t// f = float\n\n\t\t\t\t\t\t\t\t//$atom_structure['gps_entries'][$key] = unpack('Vhour/Vminute/Vsecond/Vyear/Vmonth/Vday/Vactive/Vlatitude_b/Vlongitude_b/Vunknown2/flatitude/flongitude/fspeed', substr($GPS_free_data, 48));\n\t\t\t\t\t\t\t\t*/\n\n\t\t\t\t\t\t\t\t// $GPRMC,081836,A,3751.65,S,14507.36,E,000.0,360.0,130998,011.3,E*62\n\t\t\t\t\t\t\t\t// $GPRMC,183731,A,3907.482,N,12102.436,W,000.0,360.0,080301,015.5,E*67\n\t\t\t\t\t\t\t\t// $GPRMC,002454,A,3553.5295,N,13938.6570,E,0.0,43.1,180700,7.1,W,A*3F\n\t\t\t\t\t\t\t\t// $GPRMC,094347.000,A,5342.0061,N,00737.9908,W,0.01,156.75,140217,,,A*7D\n\t\t\t\t\t\t\t\tif (preg_match('#\\\\$GPRMC,([0-9\\\\.]*),([AV]),([0-9\\\\.]*),([NS]),([0-9\\\\.]*),([EW]),([0-9\\\\.]*),([0-9\\\\.]*),([0-9]*),([0-9\\\\.]*),([EW]?)(,[A])?(\\\\*[0-9A-F]{2})#', $GPS_free_data, $matches)) {\n\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC = array();\n\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC_raw = array();\n\t\t\t\t\t\t\t\t\tlist(\n\t\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC_raw['gprmc'],\n\t\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC_raw['timestamp'],\n\t\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC_raw['status'],\n\t\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC_raw['latitude'],\n\t\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC_raw['latitude_direction'],\n\t\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC_raw['longitude'],\n\t\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC_raw['longitude_direction'],\n\t\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC_raw['knots'],\n\t\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC_raw['angle'],\n\t\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC_raw['datestamp'],\n\t\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC_raw['variation'],\n\t\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC_raw['variation_direction'],\n\t\t\t\t\t\t\t\t\t\t$dummy,\n\t\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC_raw['checksum'],\n\t\t\t\t\t\t\t\t\t) = $matches;\n\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC['raw'] = $GPS_this_GPRMC_raw;\n\n\t\t\t\t\t\t\t\t\t$hour   = substr($GPS_this_GPRMC['raw']['timestamp'], 0, 2);\n\t\t\t\t\t\t\t\t\t$minute = substr($GPS_this_GPRMC['raw']['timestamp'], 2, 2);\n\t\t\t\t\t\t\t\t\t$second = substr($GPS_this_GPRMC['raw']['timestamp'], 4, 2);\n\t\t\t\t\t\t\t\t\t$ms     = substr($GPS_this_GPRMC['raw']['timestamp'], 6);    // may contain decimal seconds\n\t\t\t\t\t\t\t\t\t$day    = substr($GPS_this_GPRMC['raw']['datestamp'], 0, 2);\n\t\t\t\t\t\t\t\t\t$month  = substr($GPS_this_GPRMC['raw']['datestamp'], 2, 2);\n\t\t\t\t\t\t\t\t\t$year   = (int) substr($GPS_this_GPRMC['raw']['datestamp'], 4, 2);\n\t\t\t\t\t\t\t\t\t$year += (($year > 90) ? 1900 : 2000); // complete lack of foresight: datestamps are stored with 2-digit years, take best guess\n\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC['timestamp'] = $year.'-'.$month.'-'.$day.' '.$hour.':'.$minute.':'.$second.$ms;\n\n\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC['active'] = ($GPS_this_GPRMC['raw']['status'] == 'A'); // A=Active,V=Void\n\n\t\t\t\t\t\t\t\t\tforeach (array('latitude','longitude') as $latlon) {\n\t\t\t\t\t\t\t\t\t\tpreg_match('#^([0-9]{1,3})([0-9]{2}\\\\.[0-9]+)$#', $GPS_this_GPRMC['raw'][$latlon], $matches);\n\t\t\t\t\t\t\t\t\t\tlist($dummy, $deg, $min) = $matches;\n\t\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC[$latlon] = $deg + ($min / 60);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC['latitude']  *= (($GPS_this_GPRMC['raw']['latitude_direction']  == 'S') ? -1 : 1);\n\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC['longitude'] *= (($GPS_this_GPRMC['raw']['longitude_direction'] == 'W') ? -1 : 1);\n\n\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC['heading']    = $GPS_this_GPRMC['raw']['angle'];\n\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC['speed_knot'] = $GPS_this_GPRMC['raw']['knots'];\n\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC['speed_kmh']  = $GPS_this_GPRMC['raw']['knots'] * 1.852;\n\t\t\t\t\t\t\t\t\tif ($GPS_this_GPRMC['raw']['variation']) {\n\t\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC['variation']  = $GPS_this_GPRMC['raw']['variation'];\n\t\t\t\t\t\t\t\t\t\t$GPS_this_GPRMC['variation'] *= (($GPS_this_GPRMC['raw']['variation_direction'] == 'W') ? -1 : 1);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$atom_structure['gps_entries'][$key] = $GPS_this_GPRMC;\n\n\t\t\t\t\t\t\t\t\t@$info['quicktime']['gps_track'][$GPS_this_GPRMC['timestamp']] = array(\n\t\t\t\t\t\t\t\t\t\t'latitude'  => (float) $GPS_this_GPRMC['latitude'],\n\t\t\t\t\t\t\t\t\t\t'longitude' => (float) $GPS_this_GPRMC['longitude'],\n\t\t\t\t\t\t\t\t\t\t'speed_kmh' => (float) $GPS_this_GPRMC['speed_kmh'],\n\t\t\t\t\t\t\t\t\t\t'heading'   => (float) $GPS_this_GPRMC['heading'],\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$this->warning('Unhandled GPS format in \"free\" atom at offset '.$gps_pointer['offset']);\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$this->fseek($previous_offset);\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->warning('QuickTime atom \"'.$atomname.'\" is not mod-8 bytes long ('.$atomsize.' bytes) at offset '.$baseoffset);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('QuickTime atom \"'.$atomname.'\" is zero bytes long at offset '.$baseoffset);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'loci':// 3GP location (El Loco)\n\t\t\t\t\t$loffset = 0;\n\t\t\t\t\t$info['quicktime']['comments']['gps_flags']     = array(  getid3_lib::BigEndian2Int(substr($atom_data, 0, 4)));\n\t\t\t\t\t$info['quicktime']['comments']['gps_lang']      = array(  getid3_lib::BigEndian2Int(substr($atom_data, 4, 2)));\n\t\t\t\t\t$info['quicktime']['comments']['gps_location']  = array(          $this->LociString(substr($atom_data, 6), $loffset));\n\t\t\t\t\t$loci_data = substr($atom_data, 6 + $loffset);\n\t\t\t\t\t$info['quicktime']['comments']['gps_role']      = array(  getid3_lib::BigEndian2Int(substr($loci_data, 0, 1)));\n\t\t\t\t\t$info['quicktime']['comments']['gps_longitude'] = array(getid3_lib::FixedPoint16_16(substr($loci_data, 1, 4)));\n\t\t\t\t\t$info['quicktime']['comments']['gps_latitude']  = array(getid3_lib::FixedPoint16_16(substr($loci_data, 5, 4)));\n\t\t\t\t\t$info['quicktime']['comments']['gps_altitude']  = array(getid3_lib::FixedPoint16_16(substr($loci_data, 9, 4)));\n\t\t\t\t\t$info['quicktime']['comments']['gps_body']      = array(          $this->LociString(substr($loci_data, 13           ), $loffset));\n\t\t\t\t\t$info['quicktime']['comments']['gps_notes']     = array(          $this->LociString(substr($loci_data, 13 + $loffset), $loffset));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'chpl': // CHaPter List\n\t\t\t\t\t// https://www.adobe.com/content/dam/Adobe/en/devnet/flv/pdfs/video_file_format_spec_v10.pdf\n\t\t\t\t\t$chpl_version = getid3_lib::BigEndian2Int(substr($atom_data, 4, 1)); // Expected to be 0\n\t\t\t\t\t$chpl_flags   = getid3_lib::BigEndian2Int(substr($atom_data, 5, 3)); // Reserved, set to 0\n\t\t\t\t\t$chpl_count   = getid3_lib::BigEndian2Int(substr($atom_data, 8, 1));\n\t\t\t\t\t$chpl_offset = 9;\n\t\t\t\t\tfor ($i = 0; $i < $chpl_count; $i++) {\n\t\t\t\t\t\tif (($chpl_offset + 9) >= strlen($atom_data)) {\n\t\t\t\t\t\t\t$this->warning('QuickTime chapter '.$i.' extends beyond end of \"chpl\" atom');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$info['quicktime']['chapters'][$i]['timestamp'] = getid3_lib::BigEndian2Int(substr($atom_data, $chpl_offset, 8)) / 10000000; // timestamps are stored as 100-nanosecond units\n\t\t\t\t\t\t$chpl_offset += 8;\n\t\t\t\t\t\t$chpl_title_size = getid3_lib::BigEndian2Int(substr($atom_data, $chpl_offset, 1));\n\t\t\t\t\t\t$chpl_offset += 1;\n\t\t\t\t\t\t$info['quicktime']['chapters'][$i]['title']     =                           substr($atom_data, $chpl_offset, $chpl_title_size);\n\t\t\t\t\t\t$chpl_offset += $chpl_title_size;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'FIRM': // FIRMware version(?), seen on GoPro Hero4\n\t\t\t\t\t$info['quicktime']['camera']['firmware'] = $atom_data;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'CAME': // FIRMware version(?), seen on GoPro Hero4\n\t\t\t\t\t$info['quicktime']['camera']['serial_hash'] = unpack('H*', $atom_data);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'dscp':\n\t\t\t\tcase 'rcif':\n\t\t\t\t\t// https://www.getid3.org/phpBB3/viewtopic.php?t=1908\n\t\t\t\t\tif (substr($atom_data, 0, 7) == \"\\x00\\x00\\x00\\x00\\x55\\xC4\".'{') {\n\t\t\t\t\t\tif ($json_decoded = @json_decode(rtrim(substr($atom_data, 6), \"\\x00\"), true)) {\n\t\t\t\t\t\t\t$info['quicktime']['camera'][$atomname] = $json_decoded;\n\t\t\t\t\t\t\tif (($atomname == 'rcif') && isset($info['quicktime']['camera']['rcif']['wxcamera']['rotate'])) {\n\t\t\t\t\t\t\t\t$info['video']['rotate'] = $info['quicktime']['video']['rotate'] = $info['quicktime']['camera']['rcif']['wxcamera']['rotate'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->warning('Failed to JSON decode atom \"'.$atomname.'\"');\n\t\t\t\t\t\t\t$atom_structure['data'] = $atom_data;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($json_decoded);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('Expecting 55 C4 7B at start of atom \"'.$atomname.'\", found '.getid3_lib::PrintHexBytes(substr($atom_data, 4, 3)).' instead');\n\t\t\t\t\t\t$atom_structure['data'] = $atom_data;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'frea':\n\t\t\t\t\t// https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Kodak.html#frea\n\t\t\t\t\t// may contain \"scra\" (PreviewImage) and/or \"thma\" (ThumbnailImage)\n\t\t\t\t\t$atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 4, $atomHierarchy, $ParseAllPossibleAtoms);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'tima': // subatom to \"frea\"\n\t\t\t\t\t// no idea what this does, the one sample file I've seen has a value of 0x00000027\n\t\t\t\t\t$atom_structure['data'] = $atom_data;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ver ': // subatom to \"frea\"\n\t\t\t\t\t// some kind of version number, the one sample file I've seen has a value of \"3.00.073\"\n\t\t\t\t\t$atom_structure['data'] = $atom_data;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'thma': // subatom to \"frea\" -- \"ThumbnailImage\"\n\t\t\t\t\t// https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Kodak.html#frea\n\t\t\t\t\tif (strlen($atom_data) > 0) {\n\t\t\t\t\t\t$info['quicktime']['comments']['picture'][] = array('data'=>$atom_data, 'image_mime'=>'image/jpeg', 'description'=>'ThumbnailImage');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'scra': // subatom to \"frea\" -- \"PreviewImage\"\n\t\t\t\t\t// https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Kodak.html#frea\n\t\t\t\t\t// but the only sample file I've seen has no useful data here\n\t\t\t\t\tif (strlen($atom_data) > 0) {\n\t\t\t\t\t\t$info['quicktime']['comments']['picture'][] = array('data'=>$atom_data, 'image_mime'=>'image/jpeg', 'description'=>'PreviewImage');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'cdsc': // timed metadata reference\n\t\t\t\t\t// A QuickTime movie can contain none, one, or several timed metadata tracks. Timed metadata tracks can refer to multiple tracks.\n\t\t\t\t\t// Metadata tracks are linked to the tracks they describe using a track-reference of type 'cdsc'. The metadata track holds the 'cdsc' track reference.\n\t\t\t\t\t$atom_structure['track_number'] = getid3_lib::BigEndian2Int($atom_data);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->warning('Unknown QuickTime atom type: \"'.preg_replace('#[^a-zA-Z0-9 _\\\\-]#', '?', $atomname).'\" ('.trim(getid3_lib::PrintHexBytes($atomname)).'), '.$atomsize.' bytes at offset '.$baseoffset);\n\t\t\t\t\t$atom_structure['data'] = $atom_data;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tarray_pop($atomHierarchy);\n\t\treturn $atom_structure;\n\t}\n\n\t/**\n\t * @param string $atom_data\n\t * @param int    $baseoffset\n\t * @param array  $atomHierarchy\n\t * @param bool   $ParseAllPossibleAtoms\n\t *\n\t * @return array|false\n\t */\n\tpublic function QuicktimeParseContainerAtom($atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms) {\n\t\t$atom_structure  = false;\n\t\t$subatomoffset  = 0;\n\t\t$subatomcounter = 0;\n\t\tif ((strlen($atom_data) == 4) && (getid3_lib::BigEndian2Int($atom_data) == 0x00000000)) {\n\t\t\treturn false;\n\t\t}\n\t\twhile ($subatomoffset < strlen($atom_data)) {\n\t\t\t$subatomsize = getid3_lib::BigEndian2Int(substr($atom_data, $subatomoffset + 0, 4));\n\t\t\t$subatomname =                           substr($atom_data, $subatomoffset + 4, 4);\n\t\t\t$subatomdata =                           substr($atom_data, $subatomoffset + 8, $subatomsize - 8);\n\t\t\tif ($subatomsize == 0) {\n\t\t\t\t// Furthermore, for historical reasons the list of atoms is optionally\n\t\t\t\t// terminated by a 32-bit integer set to 0. If you are writing a program\n\t\t\t\t// to read user data atoms, you should allow for the terminating 0.\n\t\t\t\tif (strlen($atom_data) > 12) {\n\t\t\t\t\t$subatomoffset += 4;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\treturn $atom_structure;\n\t\t\t}\n\t\t\tif (strlen($subatomdata) < ($subatomsize - 8)) {\n\t\t\t    // we don't have enough data to decode the subatom.\n\t\t\t    // this may be because we are refusing to parse large subatoms, or it may be because this atom had its size set too large\n\t\t\t    // so we passed in the start of a following atom incorrectly?\n\t\t\t    return $atom_structure;\n\t\t\t}\n\t\t\t$atom_structure[$subatomcounter++] = $this->QuicktimeParseAtom($subatomname, $subatomsize, $subatomdata, $baseoffset + $subatomoffset, $atomHierarchy, $ParseAllPossibleAtoms);\n\t\t\t$subatomoffset += $subatomsize;\n\t\t}\n\t\treturn $atom_structure;\n\t}\n\n\t/**\n\t * @param string $data\n\t * @param int    $offset\n\t *\n\t * @return int\n\t */\n\tpublic function quicktime_read_mp4_descr_length($data, &$offset) {\n\t\t// http://libquicktime.sourcearchive.com/documentation/2:1.0.2plus-pdebian-2build1/esds_8c-source.html\n\t\t$num_bytes = 0;\n\t\t$length    = 0;\n\t\tdo {\n\t\t\t$b = ord(substr($data, $offset++, 1));\n\t\t\t$length = ($length << 7) | ($b & 0x7F);\n\t\t} while (($b & 0x80) && ($num_bytes++ < 4));\n\t\treturn $length;\n\t}\n\n\t/**\n\t * @param int $languageid\n\t *\n\t * @return string\n\t */\n\tpublic function QuicktimeLanguageLookup($languageid) {\n\t\t// http://developer.apple.com/library/mac/#documentation/QuickTime/QTFF/QTFFChap4/qtff4.html#//apple_ref/doc/uid/TP40000939-CH206-34353\n\t\tstatic $QuicktimeLanguageLookup = array();\n\t\tif (empty($QuicktimeLanguageLookup)) {\n\t\t\t$QuicktimeLanguageLookup[0]     = 'English';\n\t\t\t$QuicktimeLanguageLookup[1]     = 'French';\n\t\t\t$QuicktimeLanguageLookup[2]     = 'German';\n\t\t\t$QuicktimeLanguageLookup[3]     = 'Italian';\n\t\t\t$QuicktimeLanguageLookup[4]     = 'Dutch';\n\t\t\t$QuicktimeLanguageLookup[5]     = 'Swedish';\n\t\t\t$QuicktimeLanguageLookup[6]     = 'Spanish';\n\t\t\t$QuicktimeLanguageLookup[7]     = 'Danish';\n\t\t\t$QuicktimeLanguageLookup[8]     = 'Portuguese';\n\t\t\t$QuicktimeLanguageLookup[9]     = 'Norwegian';\n\t\t\t$QuicktimeLanguageLookup[10]    = 'Hebrew';\n\t\t\t$QuicktimeLanguageLookup[11]    = 'Japanese';\n\t\t\t$QuicktimeLanguageLookup[12]    = 'Arabic';\n\t\t\t$QuicktimeLanguageLookup[13]    = 'Finnish';\n\t\t\t$QuicktimeLanguageLookup[14]    = 'Greek';\n\t\t\t$QuicktimeLanguageLookup[15]    = 'Icelandic';\n\t\t\t$QuicktimeLanguageLookup[16]    = 'Maltese';\n\t\t\t$QuicktimeLanguageLookup[17]    = 'Turkish';\n\t\t\t$QuicktimeLanguageLookup[18]    = 'Croatian';\n\t\t\t$QuicktimeLanguageLookup[19]    = 'Chinese (Traditional)';\n\t\t\t$QuicktimeLanguageLookup[20]    = 'Urdu';\n\t\t\t$QuicktimeLanguageLookup[21]    = 'Hindi';\n\t\t\t$QuicktimeLanguageLookup[22]    = 'Thai';\n\t\t\t$QuicktimeLanguageLookup[23]    = 'Korean';\n\t\t\t$QuicktimeLanguageLookup[24]    = 'Lithuanian';\n\t\t\t$QuicktimeLanguageLookup[25]    = 'Polish';\n\t\t\t$QuicktimeLanguageLookup[26]    = 'Hungarian';\n\t\t\t$QuicktimeLanguageLookup[27]    = 'Estonian';\n\t\t\t$QuicktimeLanguageLookup[28]    = 'Lettish';\n\t\t\t$QuicktimeLanguageLookup[28]    = 'Latvian';\n\t\t\t$QuicktimeLanguageLookup[29]    = 'Saamisk';\n\t\t\t$QuicktimeLanguageLookup[29]    = 'Lappish';\n\t\t\t$QuicktimeLanguageLookup[30]    = 'Faeroese';\n\t\t\t$QuicktimeLanguageLookup[31]    = 'Farsi';\n\t\t\t$QuicktimeLanguageLookup[31]    = 'Persian';\n\t\t\t$QuicktimeLanguageLookup[32]    = 'Russian';\n\t\t\t$QuicktimeLanguageLookup[33]    = 'Chinese (Simplified)';\n\t\t\t$QuicktimeLanguageLookup[34]    = 'Flemish';\n\t\t\t$QuicktimeLanguageLookup[35]    = 'Irish';\n\t\t\t$QuicktimeLanguageLookup[36]    = 'Albanian';\n\t\t\t$QuicktimeLanguageLookup[37]    = 'Romanian';\n\t\t\t$QuicktimeLanguageLookup[38]    = 'Czech';\n\t\t\t$QuicktimeLanguageLookup[39]    = 'Slovak';\n\t\t\t$QuicktimeLanguageLookup[40]    = 'Slovenian';\n\t\t\t$QuicktimeLanguageLookup[41]    = 'Yiddish';\n\t\t\t$QuicktimeLanguageLookup[42]    = 'Serbian';\n\t\t\t$QuicktimeLanguageLookup[43]    = 'Macedonian';\n\t\t\t$QuicktimeLanguageLookup[44]    = 'Bulgarian';\n\t\t\t$QuicktimeLanguageLookup[45]    = 'Ukrainian';\n\t\t\t$QuicktimeLanguageLookup[46]    = 'Byelorussian';\n\t\t\t$QuicktimeLanguageLookup[47]    = 'Uzbek';\n\t\t\t$QuicktimeLanguageLookup[48]    = 'Kazakh';\n\t\t\t$QuicktimeLanguageLookup[49]    = 'Azerbaijani';\n\t\t\t$QuicktimeLanguageLookup[50]    = 'AzerbaijanAr';\n\t\t\t$QuicktimeLanguageLookup[51]    = 'Armenian';\n\t\t\t$QuicktimeLanguageLookup[52]    = 'Georgian';\n\t\t\t$QuicktimeLanguageLookup[53]    = 'Moldavian';\n\t\t\t$QuicktimeLanguageLookup[54]    = 'Kirghiz';\n\t\t\t$QuicktimeLanguageLookup[55]    = 'Tajiki';\n\t\t\t$QuicktimeLanguageLookup[56]    = 'Turkmen';\n\t\t\t$QuicktimeLanguageLookup[57]    = 'Mongolian';\n\t\t\t$QuicktimeLanguageLookup[58]    = 'MongolianCyr';\n\t\t\t$QuicktimeLanguageLookup[59]    = 'Pashto';\n\t\t\t$QuicktimeLanguageLookup[60]    = 'Kurdish';\n\t\t\t$QuicktimeLanguageLookup[61]    = 'Kashmiri';\n\t\t\t$QuicktimeLanguageLookup[62]    = 'Sindhi';\n\t\t\t$QuicktimeLanguageLookup[63]    = 'Tibetan';\n\t\t\t$QuicktimeLanguageLookup[64]    = 'Nepali';\n\t\t\t$QuicktimeLanguageLookup[65]    = 'Sanskrit';\n\t\t\t$QuicktimeLanguageLookup[66]    = 'Marathi';\n\t\t\t$QuicktimeLanguageLookup[67]    = 'Bengali';\n\t\t\t$QuicktimeLanguageLookup[68]    = 'Assamese';\n\t\t\t$QuicktimeLanguageLookup[69]    = 'Gujarati';\n\t\t\t$QuicktimeLanguageLookup[70]    = 'Punjabi';\n\t\t\t$QuicktimeLanguageLookup[71]    = 'Oriya';\n\t\t\t$QuicktimeLanguageLookup[72]    = 'Malayalam';\n\t\t\t$QuicktimeLanguageLookup[73]    = 'Kannada';\n\t\t\t$QuicktimeLanguageLookup[74]    = 'Tamil';\n\t\t\t$QuicktimeLanguageLookup[75]    = 'Telugu';\n\t\t\t$QuicktimeLanguageLookup[76]    = 'Sinhalese';\n\t\t\t$QuicktimeLanguageLookup[77]    = 'Burmese';\n\t\t\t$QuicktimeLanguageLookup[78]    = 'Khmer';\n\t\t\t$QuicktimeLanguageLookup[79]    = 'Lao';\n\t\t\t$QuicktimeLanguageLookup[80]    = 'Vietnamese';\n\t\t\t$QuicktimeLanguageLookup[81]    = 'Indonesian';\n\t\t\t$QuicktimeLanguageLookup[82]    = 'Tagalog';\n\t\t\t$QuicktimeLanguageLookup[83]    = 'MalayRoman';\n\t\t\t$QuicktimeLanguageLookup[84]    = 'MalayArabic';\n\t\t\t$QuicktimeLanguageLookup[85]    = 'Amharic';\n\t\t\t$QuicktimeLanguageLookup[86]    = 'Tigrinya';\n\t\t\t$QuicktimeLanguageLookup[87]    = 'Galla';\n\t\t\t$QuicktimeLanguageLookup[87]    = 'Oromo';\n\t\t\t$QuicktimeLanguageLookup[88]    = 'Somali';\n\t\t\t$QuicktimeLanguageLookup[89]    = 'Swahili';\n\t\t\t$QuicktimeLanguageLookup[90]    = 'Ruanda';\n\t\t\t$QuicktimeLanguageLookup[91]    = 'Rundi';\n\t\t\t$QuicktimeLanguageLookup[92]    = 'Chewa';\n\t\t\t$QuicktimeLanguageLookup[93]    = 'Malagasy';\n\t\t\t$QuicktimeLanguageLookup[94]    = 'Esperanto';\n\t\t\t$QuicktimeLanguageLookup[128]   = 'Welsh';\n\t\t\t$QuicktimeLanguageLookup[129]   = 'Basque';\n\t\t\t$QuicktimeLanguageLookup[130]   = 'Catalan';\n\t\t\t$QuicktimeLanguageLookup[131]   = 'Latin';\n\t\t\t$QuicktimeLanguageLookup[132]   = 'Quechua';\n\t\t\t$QuicktimeLanguageLookup[133]   = 'Guarani';\n\t\t\t$QuicktimeLanguageLookup[134]   = 'Aymara';\n\t\t\t$QuicktimeLanguageLookup[135]   = 'Tatar';\n\t\t\t$QuicktimeLanguageLookup[136]   = 'Uighur';\n\t\t\t$QuicktimeLanguageLookup[137]   = 'Dzongkha';\n\t\t\t$QuicktimeLanguageLookup[138]   = 'JavaneseRom';\n\t\t\t$QuicktimeLanguageLookup[32767] = 'Unspecified';\n\t\t}\n\t\tif (($languageid > 138) && ($languageid < 32767)) {\n\t\t\t/*\n\t\t\tISO Language Codes - http://www.loc.gov/standards/iso639-2/php/code_list.php\n\t\t\tBecause the language codes specified by ISO 639-2/T are three characters long, they must be packed to fit into a 16-bit field.\n\t\t\tThe packing algorithm must map each of the three characters, which are always lowercase, into a 5-bit integer and then concatenate\n\t\t\tthese integers into the least significant 15 bits of a 16-bit integer, leaving the 16-bit integer's most significant bit set to zero.\n\n\t\t\tOne algorithm for performing this packing is to treat each ISO character as a 16-bit integer. Subtract 0x60 from the first character\n\t\t\tand multiply by 2^10 (0x400), subtract 0x60 from the second character and multiply by 2^5 (0x20), subtract 0x60 from the third character,\n\t\t\tand add the three 16-bit values. This will result in a single 16-bit value with the three codes correctly packed into the 15 least\n\t\t\tsignificant bits and the most significant bit set to zero.\n\t\t\t*/\n\t\t\t$iso_language_id  = '';\n\t\t\t$iso_language_id .= chr((($languageid & 0x7C00) >> 10) + 0x60);\n\t\t\t$iso_language_id .= chr((($languageid & 0x03E0) >>  5) + 0x60);\n\t\t\t$iso_language_id .= chr((($languageid & 0x001F) >>  0) + 0x60);\n\t\t\t$QuicktimeLanguageLookup[$languageid] = getid3_id3v2::LanguageLookup($iso_language_id);\n\t\t}\n\t\treturn (isset($QuicktimeLanguageLookup[$languageid]) ? $QuicktimeLanguageLookup[$languageid] : 'invalid');\n\t}\n\n\t/**\n\t * @param string $codecid\n\t *\n\t * @return string\n\t */\n\tpublic function QuicktimeVideoCodecLookup($codecid) {\n\t\tstatic $QuicktimeVideoCodecLookup = array();\n\t\tif (empty($QuicktimeVideoCodecLookup)) {\n\t\t\t$QuicktimeVideoCodecLookup['.SGI'] = 'SGI';\n\t\t\t$QuicktimeVideoCodecLookup['3IV1'] = '3ivx MPEG-4 v1';\n\t\t\t$QuicktimeVideoCodecLookup['3IV2'] = '3ivx MPEG-4 v2';\n\t\t\t$QuicktimeVideoCodecLookup['3IVX'] = '3ivx MPEG-4';\n\t\t\t$QuicktimeVideoCodecLookup['8BPS'] = 'Planar RGB';\n\t\t\t$QuicktimeVideoCodecLookup['avc1'] = 'H.264/MPEG-4 AVC';\n\t\t\t$QuicktimeVideoCodecLookup['avr '] = 'AVR-JPEG';\n\t\t\t$QuicktimeVideoCodecLookup['b16g'] = '16Gray';\n\t\t\t$QuicktimeVideoCodecLookup['b32a'] = '32AlphaGray';\n\t\t\t$QuicktimeVideoCodecLookup['b48r'] = '48RGB';\n\t\t\t$QuicktimeVideoCodecLookup['b64a'] = '64ARGB';\n\t\t\t$QuicktimeVideoCodecLookup['base'] = 'Base';\n\t\t\t$QuicktimeVideoCodecLookup['clou'] = 'Cloud';\n\t\t\t$QuicktimeVideoCodecLookup['cmyk'] = 'CMYK';\n\t\t\t$QuicktimeVideoCodecLookup['cvid'] = 'Cinepak';\n\t\t\t$QuicktimeVideoCodecLookup['dmb1'] = 'OpenDML JPEG';\n\t\t\t$QuicktimeVideoCodecLookup['dvc '] = 'DVC-NTSC';\n\t\t\t$QuicktimeVideoCodecLookup['dvcp'] = 'DVC-PAL';\n\t\t\t$QuicktimeVideoCodecLookup['dvpn'] = 'DVCPro-NTSC';\n\t\t\t$QuicktimeVideoCodecLookup['dvpp'] = 'DVCPro-PAL';\n\t\t\t$QuicktimeVideoCodecLookup['fire'] = 'Fire';\n\t\t\t$QuicktimeVideoCodecLookup['flic'] = 'FLC';\n\t\t\t$QuicktimeVideoCodecLookup['gif '] = 'GIF';\n\t\t\t$QuicktimeVideoCodecLookup['h261'] = 'H261';\n\t\t\t$QuicktimeVideoCodecLookup['h263'] = 'H263';\n\t\t\t$QuicktimeVideoCodecLookup['IV41'] = 'Indeo4';\n\t\t\t$QuicktimeVideoCodecLookup['jpeg'] = 'JPEG';\n\t\t\t$QuicktimeVideoCodecLookup['kpcd'] = 'PhotoCD';\n\t\t\t$QuicktimeVideoCodecLookup['mjpa'] = 'Motion JPEG-A';\n\t\t\t$QuicktimeVideoCodecLookup['mjpb'] = 'Motion JPEG-B';\n\t\t\t$QuicktimeVideoCodecLookup['msvc'] = 'Microsoft Video1';\n\t\t\t$QuicktimeVideoCodecLookup['myuv'] = 'MPEG YUV420';\n\t\t\t$QuicktimeVideoCodecLookup['path'] = 'Vector';\n\t\t\t$QuicktimeVideoCodecLookup['png '] = 'PNG';\n\t\t\t$QuicktimeVideoCodecLookup['PNTG'] = 'MacPaint';\n\t\t\t$QuicktimeVideoCodecLookup['qdgx'] = 'QuickDrawGX';\n\t\t\t$QuicktimeVideoCodecLookup['qdrw'] = 'QuickDraw';\n\t\t\t$QuicktimeVideoCodecLookup['raw '] = 'RAW';\n\t\t\t$QuicktimeVideoCodecLookup['ripl'] = 'WaterRipple';\n\t\t\t$QuicktimeVideoCodecLookup['rpza'] = 'Video';\n\t\t\t$QuicktimeVideoCodecLookup['smc '] = 'Graphics';\n\t\t\t$QuicktimeVideoCodecLookup['SVQ1'] = 'Sorenson Video 1';\n\t\t\t$QuicktimeVideoCodecLookup['SVQ1'] = 'Sorenson Video 3';\n\t\t\t$QuicktimeVideoCodecLookup['syv9'] = 'Sorenson YUV9';\n\t\t\t$QuicktimeVideoCodecLookup['tga '] = 'Targa';\n\t\t\t$QuicktimeVideoCodecLookup['tiff'] = 'TIFF';\n\t\t\t$QuicktimeVideoCodecLookup['WRAW'] = 'Windows RAW';\n\t\t\t$QuicktimeVideoCodecLookup['WRLE'] = 'BMP';\n\t\t\t$QuicktimeVideoCodecLookup['y420'] = 'YUV420';\n\t\t\t$QuicktimeVideoCodecLookup['yuv2'] = 'ComponentVideo';\n\t\t\t$QuicktimeVideoCodecLookup['yuvs'] = 'ComponentVideoUnsigned';\n\t\t\t$QuicktimeVideoCodecLookup['yuvu'] = 'ComponentVideoSigned';\n\t\t}\n\t\treturn (isset($QuicktimeVideoCodecLookup[$codecid]) ? $QuicktimeVideoCodecLookup[$codecid] : '');\n\t}\n\n\t/**\n\t * @param string $codecid\n\t *\n\t * @return mixed|string\n\t */\n\tpublic function QuicktimeAudioCodecLookup($codecid) {\n\t\tstatic $QuicktimeAudioCodecLookup = array();\n\t\tif (empty($QuicktimeAudioCodecLookup)) {\n\t\t\t$QuicktimeAudioCodecLookup['.mp3']          = 'Fraunhofer MPEG Layer-III alias';\n\t\t\t$QuicktimeAudioCodecLookup['aac ']          = 'ISO/IEC 14496-3 AAC';\n\t\t\t$QuicktimeAudioCodecLookup['agsm']          = 'Apple GSM 10:1';\n\t\t\t$QuicktimeAudioCodecLookup['alac']          = 'Apple Lossless Audio Codec';\n\t\t\t$QuicktimeAudioCodecLookup['alaw']          = 'A-law 2:1';\n\t\t\t$QuicktimeAudioCodecLookup['conv']          = 'Sample Format';\n\t\t\t$QuicktimeAudioCodecLookup['dvca']          = 'DV';\n\t\t\t$QuicktimeAudioCodecLookup['dvi ']          = 'DV 4:1';\n\t\t\t$QuicktimeAudioCodecLookup['eqal']          = 'Frequency Equalizer';\n\t\t\t$QuicktimeAudioCodecLookup['fl32']          = '32-bit Floating Point';\n\t\t\t$QuicktimeAudioCodecLookup['fl64']          = '64-bit Floating Point';\n\t\t\t$QuicktimeAudioCodecLookup['ima4']          = 'Interactive Multimedia Association 4:1';\n\t\t\t$QuicktimeAudioCodecLookup['in24']          = '24-bit Integer';\n\t\t\t$QuicktimeAudioCodecLookup['in32']          = '32-bit Integer';\n\t\t\t$QuicktimeAudioCodecLookup['lpc ']          = 'LPC 23:1';\n\t\t\t$QuicktimeAudioCodecLookup['MAC3']          = 'Macintosh Audio Compression/Expansion (MACE) 3:1';\n\t\t\t$QuicktimeAudioCodecLookup['MAC6']          = 'Macintosh Audio Compression/Expansion (MACE) 6:1';\n\t\t\t$QuicktimeAudioCodecLookup['mixb']          = '8-bit Mixer';\n\t\t\t$QuicktimeAudioCodecLookup['mixw']          = '16-bit Mixer';\n\t\t\t$QuicktimeAudioCodecLookup['mp4a']          = 'ISO/IEC 14496-3 AAC';\n\t\t\t$QuicktimeAudioCodecLookup['MS'.\"\\x00\\x02\"] = 'Microsoft ADPCM';\n\t\t\t$QuicktimeAudioCodecLookup['MS'.\"\\x00\\x11\"] = 'DV IMA';\n\t\t\t$QuicktimeAudioCodecLookup['MS'.\"\\x00\\x55\"] = 'Fraunhofer MPEG Layer III';\n\t\t\t$QuicktimeAudioCodecLookup['NONE']          = 'No Encoding';\n\t\t\t$QuicktimeAudioCodecLookup['Qclp']          = 'Qualcomm PureVoice';\n\t\t\t$QuicktimeAudioCodecLookup['QDM2']          = 'QDesign Music 2';\n\t\t\t$QuicktimeAudioCodecLookup['QDMC']          = 'QDesign Music 1';\n\t\t\t$QuicktimeAudioCodecLookup['ratb']          = '8-bit Rate';\n\t\t\t$QuicktimeAudioCodecLookup['ratw']          = '16-bit Rate';\n\t\t\t$QuicktimeAudioCodecLookup['raw ']          = 'raw PCM';\n\t\t\t$QuicktimeAudioCodecLookup['sour']          = 'Sound Source';\n\t\t\t$QuicktimeAudioCodecLookup['sowt']          = 'signed/two\\'s complement (Little Endian)';\n\t\t\t$QuicktimeAudioCodecLookup['str1']          = 'Iomega MPEG layer II';\n\t\t\t$QuicktimeAudioCodecLookup['str2']          = 'Iomega MPEG *layer II';\n\t\t\t$QuicktimeAudioCodecLookup['str3']          = 'Iomega MPEG **layer II';\n\t\t\t$QuicktimeAudioCodecLookup['str4']          = 'Iomega MPEG ***layer II';\n\t\t\t$QuicktimeAudioCodecLookup['twos']          = 'signed/two\\'s complement (Big Endian)';\n\t\t\t$QuicktimeAudioCodecLookup['ulaw']          = 'mu-law 2:1';\n\t\t}\n\t\treturn (isset($QuicktimeAudioCodecLookup[$codecid]) ? $QuicktimeAudioCodecLookup[$codecid] : '');\n\t}\n\n\t/**\n\t * @param string $compressionid\n\t *\n\t * @return string\n\t */\n\tpublic function QuicktimeDCOMLookup($compressionid) {\n\t\tstatic $QuicktimeDCOMLookup = array();\n\t\tif (empty($QuicktimeDCOMLookup)) {\n\t\t\t$QuicktimeDCOMLookup['zlib'] = 'ZLib Deflate';\n\t\t\t$QuicktimeDCOMLookup['adec'] = 'Apple Compression';\n\t\t}\n\t\treturn (isset($QuicktimeDCOMLookup[$compressionid]) ? $QuicktimeDCOMLookup[$compressionid] : '');\n\t}\n\n\t/**\n\t * @param int $colordepthid\n\t *\n\t * @return string\n\t */\n\tpublic function QuicktimeColorNameLookup($colordepthid) {\n\t\tstatic $QuicktimeColorNameLookup = array();\n\t\tif (empty($QuicktimeColorNameLookup)) {\n\t\t\t$QuicktimeColorNameLookup[1]  = '2-color (monochrome)';\n\t\t\t$QuicktimeColorNameLookup[2]  = '4-color';\n\t\t\t$QuicktimeColorNameLookup[4]  = '16-color';\n\t\t\t$QuicktimeColorNameLookup[8]  = '256-color';\n\t\t\t$QuicktimeColorNameLookup[16] = 'thousands (16-bit color)';\n\t\t\t$QuicktimeColorNameLookup[24] = 'millions (24-bit color)';\n\t\t\t$QuicktimeColorNameLookup[32] = 'millions+ (32-bit color)';\n\t\t\t$QuicktimeColorNameLookup[33] = 'black & white';\n\t\t\t$QuicktimeColorNameLookup[34] = '4-gray';\n\t\t\t$QuicktimeColorNameLookup[36] = '16-gray';\n\t\t\t$QuicktimeColorNameLookup[40] = '256-gray';\n\t\t}\n\t\treturn (isset($QuicktimeColorNameLookup[$colordepthid]) ? $QuicktimeColorNameLookup[$colordepthid] : 'invalid');\n\t}\n\n\t/**\n\t * @param int $stik\n\t *\n\t * @return string\n\t */\n\tpublic function QuicktimeSTIKLookup($stik) {\n\t\tstatic $QuicktimeSTIKLookup = array();\n\t\tif (empty($QuicktimeSTIKLookup)) {\n\t\t\t$QuicktimeSTIKLookup[0]  = 'Movie';\n\t\t\t$QuicktimeSTIKLookup[1]  = 'Normal';\n\t\t\t$QuicktimeSTIKLookup[2]  = 'Audiobook';\n\t\t\t$QuicktimeSTIKLookup[5]  = 'Whacked Bookmark';\n\t\t\t$QuicktimeSTIKLookup[6]  = 'Music Video';\n\t\t\t$QuicktimeSTIKLookup[9]  = 'Short Film';\n\t\t\t$QuicktimeSTIKLookup[10] = 'TV Show';\n\t\t\t$QuicktimeSTIKLookup[11] = 'Booklet';\n\t\t\t$QuicktimeSTIKLookup[14] = 'Ringtone';\n\t\t\t$QuicktimeSTIKLookup[21] = 'Podcast';\n\t\t}\n\t\treturn (isset($QuicktimeSTIKLookup[$stik]) ? $QuicktimeSTIKLookup[$stik] : 'invalid');\n\t}\n\n\t/**\n\t * @param int $audio_profile_id\n\t *\n\t * @return string\n\t */\n\tpublic function QuicktimeIODSaudioProfileName($audio_profile_id) {\n\t\tstatic $QuicktimeIODSaudioProfileNameLookup = array();\n\t\tif (empty($QuicktimeIODSaudioProfileNameLookup)) {\n\t\t\t$QuicktimeIODSaudioProfileNameLookup = array(\n\t\t\t\t0x00 => 'ISO Reserved (0x00)',\n\t\t\t\t0x01 => 'Main Audio Profile @ Level 1',\n\t\t\t\t0x02 => 'Main Audio Profile @ Level 2',\n\t\t\t\t0x03 => 'Main Audio Profile @ Level 3',\n\t\t\t\t0x04 => 'Main Audio Profile @ Level 4',\n\t\t\t\t0x05 => 'Scalable Audio Profile @ Level 1',\n\t\t\t\t0x06 => 'Scalable Audio Profile @ Level 2',\n\t\t\t\t0x07 => 'Scalable Audio Profile @ Level 3',\n\t\t\t\t0x08 => 'Scalable Audio Profile @ Level 4',\n\t\t\t\t0x09 => 'Speech Audio Profile @ Level 1',\n\t\t\t\t0x0A => 'Speech Audio Profile @ Level 2',\n\t\t\t\t0x0B => 'Synthetic Audio Profile @ Level 1',\n\t\t\t\t0x0C => 'Synthetic Audio Profile @ Level 2',\n\t\t\t\t0x0D => 'Synthetic Audio Profile @ Level 3',\n\t\t\t\t0x0E => 'High Quality Audio Profile @ Level 1',\n\t\t\t\t0x0F => 'High Quality Audio Profile @ Level 2',\n\t\t\t\t0x10 => 'High Quality Audio Profile @ Level 3',\n\t\t\t\t0x11 => 'High Quality Audio Profile @ Level 4',\n\t\t\t\t0x12 => 'High Quality Audio Profile @ Level 5',\n\t\t\t\t0x13 => 'High Quality Audio Profile @ Level 6',\n\t\t\t\t0x14 => 'High Quality Audio Profile @ Level 7',\n\t\t\t\t0x15 => 'High Quality Audio Profile @ Level 8',\n\t\t\t\t0x16 => 'Low Delay Audio Profile @ Level 1',\n\t\t\t\t0x17 => 'Low Delay Audio Profile @ Level 2',\n\t\t\t\t0x18 => 'Low Delay Audio Profile @ Level 3',\n\t\t\t\t0x19 => 'Low Delay Audio Profile @ Level 4',\n\t\t\t\t0x1A => 'Low Delay Audio Profile @ Level 5',\n\t\t\t\t0x1B => 'Low Delay Audio Profile @ Level 6',\n\t\t\t\t0x1C => 'Low Delay Audio Profile @ Level 7',\n\t\t\t\t0x1D => 'Low Delay Audio Profile @ Level 8',\n\t\t\t\t0x1E => 'Natural Audio Profile @ Level 1',\n\t\t\t\t0x1F => 'Natural Audio Profile @ Level 2',\n\t\t\t\t0x20 => 'Natural Audio Profile @ Level 3',\n\t\t\t\t0x21 => 'Natural Audio Profile @ Level 4',\n\t\t\t\t0x22 => 'Mobile Audio Internetworking Profile @ Level 1',\n\t\t\t\t0x23 => 'Mobile Audio Internetworking Profile @ Level 2',\n\t\t\t\t0x24 => 'Mobile Audio Internetworking Profile @ Level 3',\n\t\t\t\t0x25 => 'Mobile Audio Internetworking Profile @ Level 4',\n\t\t\t\t0x26 => 'Mobile Audio Internetworking Profile @ Level 5',\n\t\t\t\t0x27 => 'Mobile Audio Internetworking Profile @ Level 6',\n\t\t\t\t0x28 => 'AAC Profile @ Level 1',\n\t\t\t\t0x29 => 'AAC Profile @ Level 2',\n\t\t\t\t0x2A => 'AAC Profile @ Level 4',\n\t\t\t\t0x2B => 'AAC Profile @ Level 5',\n\t\t\t\t0x2C => 'High Efficiency AAC Profile @ Level 2',\n\t\t\t\t0x2D => 'High Efficiency AAC Profile @ Level 3',\n\t\t\t\t0x2E => 'High Efficiency AAC Profile @ Level 4',\n\t\t\t\t0x2F => 'High Efficiency AAC Profile @ Level 5',\n\t\t\t\t0xFE => 'Not part of MPEG-4 audio profiles',\n\t\t\t\t0xFF => 'No audio capability required',\n\t\t\t);\n\t\t}\n\t\treturn (isset($QuicktimeIODSaudioProfileNameLookup[$audio_profile_id]) ? $QuicktimeIODSaudioProfileNameLookup[$audio_profile_id] : 'ISO Reserved / User Private');\n\t}\n\n\t/**\n\t * @param int $video_profile_id\n\t *\n\t * @return string\n\t */\n\tpublic function QuicktimeIODSvideoProfileName($video_profile_id) {\n\t\tstatic $QuicktimeIODSvideoProfileNameLookup = array();\n\t\tif (empty($QuicktimeIODSvideoProfileNameLookup)) {\n\t\t\t$QuicktimeIODSvideoProfileNameLookup = array(\n\t\t\t\t0x00 => 'Reserved (0x00) Profile',\n\t\t\t\t0x01 => 'Simple Profile @ Level 1',\n\t\t\t\t0x02 => 'Simple Profile @ Level 2',\n\t\t\t\t0x03 => 'Simple Profile @ Level 3',\n\t\t\t\t0x08 => 'Simple Profile @ Level 0',\n\t\t\t\t0x10 => 'Simple Scalable Profile @ Level 0',\n\t\t\t\t0x11 => 'Simple Scalable Profile @ Level 1',\n\t\t\t\t0x12 => 'Simple Scalable Profile @ Level 2',\n\t\t\t\t0x15 => 'AVC/H264 Profile',\n\t\t\t\t0x21 => 'Core Profile @ Level 1',\n\t\t\t\t0x22 => 'Core Profile @ Level 2',\n\t\t\t\t0x32 => 'Main Profile @ Level 2',\n\t\t\t\t0x33 => 'Main Profile @ Level 3',\n\t\t\t\t0x34 => 'Main Profile @ Level 4',\n\t\t\t\t0x42 => 'N-bit Profile @ Level 2',\n\t\t\t\t0x51 => 'Scalable Texture Profile @ Level 1',\n\t\t\t\t0x61 => 'Simple Face Animation Profile @ Level 1',\n\t\t\t\t0x62 => 'Simple Face Animation Profile @ Level 2',\n\t\t\t\t0x63 => 'Simple FBA Profile @ Level 1',\n\t\t\t\t0x64 => 'Simple FBA Profile @ Level 2',\n\t\t\t\t0x71 => 'Basic Animated Texture Profile @ Level 1',\n\t\t\t\t0x72 => 'Basic Animated Texture Profile @ Level 2',\n\t\t\t\t0x81 => 'Hybrid Profile @ Level 1',\n\t\t\t\t0x82 => 'Hybrid Profile @ Level 2',\n\t\t\t\t0x91 => 'Advanced Real Time Simple Profile @ Level 1',\n\t\t\t\t0x92 => 'Advanced Real Time Simple Profile @ Level 2',\n\t\t\t\t0x93 => 'Advanced Real Time Simple Profile @ Level 3',\n\t\t\t\t0x94 => 'Advanced Real Time Simple Profile @ Level 4',\n\t\t\t\t0xA1 => 'Core Scalable Profile @ Level1',\n\t\t\t\t0xA2 => 'Core Scalable Profile @ Level2',\n\t\t\t\t0xA3 => 'Core Scalable Profile @ Level3',\n\t\t\t\t0xB1 => 'Advanced Coding Efficiency Profile @ Level 1',\n\t\t\t\t0xB2 => 'Advanced Coding Efficiency Profile @ Level 2',\n\t\t\t\t0xB3 => 'Advanced Coding Efficiency Profile @ Level 3',\n\t\t\t\t0xB4 => 'Advanced Coding Efficiency Profile @ Level 4',\n\t\t\t\t0xC1 => 'Advanced Core Profile @ Level 1',\n\t\t\t\t0xC2 => 'Advanced Core Profile @ Level 2',\n\t\t\t\t0xD1 => 'Advanced Scalable Texture @ Level1',\n\t\t\t\t0xD2 => 'Advanced Scalable Texture @ Level2',\n\t\t\t\t0xE1 => 'Simple Studio Profile @ Level 1',\n\t\t\t\t0xE2 => 'Simple Studio Profile @ Level 2',\n\t\t\t\t0xE3 => 'Simple Studio Profile @ Level 3',\n\t\t\t\t0xE4 => 'Simple Studio Profile @ Level 4',\n\t\t\t\t0xE5 => 'Core Studio Profile @ Level 1',\n\t\t\t\t0xE6 => 'Core Studio Profile @ Level 2',\n\t\t\t\t0xE7 => 'Core Studio Profile @ Level 3',\n\t\t\t\t0xE8 => 'Core Studio Profile @ Level 4',\n\t\t\t\t0xF0 => 'Advanced Simple Profile @ Level 0',\n\t\t\t\t0xF1 => 'Advanced Simple Profile @ Level 1',\n\t\t\t\t0xF2 => 'Advanced Simple Profile @ Level 2',\n\t\t\t\t0xF3 => 'Advanced Simple Profile @ Level 3',\n\t\t\t\t0xF4 => 'Advanced Simple Profile @ Level 4',\n\t\t\t\t0xF5 => 'Advanced Simple Profile @ Level 5',\n\t\t\t\t0xF7 => 'Advanced Simple Profile @ Level 3b',\n\t\t\t\t0xF8 => 'Fine Granularity Scalable Profile @ Level 0',\n\t\t\t\t0xF9 => 'Fine Granularity Scalable Profile @ Level 1',\n\t\t\t\t0xFA => 'Fine Granularity Scalable Profile @ Level 2',\n\t\t\t\t0xFB => 'Fine Granularity Scalable Profile @ Level 3',\n\t\t\t\t0xFC => 'Fine Granularity Scalable Profile @ Level 4',\n\t\t\t\t0xFD => 'Fine Granularity Scalable Profile @ Level 5',\n\t\t\t\t0xFE => 'Not part of MPEG-4 Visual profiles',\n\t\t\t\t0xFF => 'No visual capability required',\n\t\t\t);\n\t\t}\n\t\treturn (isset($QuicktimeIODSvideoProfileNameLookup[$video_profile_id]) ? $QuicktimeIODSvideoProfileNameLookup[$video_profile_id] : 'ISO Reserved Profile');\n\t}\n\n\t/**\n\t * @param int $rtng\n\t *\n\t * @return string\n\t */\n\tpublic function QuicktimeContentRatingLookup($rtng) {\n\t\tstatic $QuicktimeContentRatingLookup = array();\n\t\tif (empty($QuicktimeContentRatingLookup)) {\n\t\t\t$QuicktimeContentRatingLookup[0]  = 'None';\n\t\t\t$QuicktimeContentRatingLookup[2]  = 'Clean';\n\t\t\t$QuicktimeContentRatingLookup[4]  = 'Explicit';\n\t\t}\n\t\treturn (isset($QuicktimeContentRatingLookup[$rtng]) ? $QuicktimeContentRatingLookup[$rtng] : 'invalid');\n\t}\n\n\t/**\n\t * @param int $akid\n\t *\n\t * @return string\n\t */\n\tpublic function QuicktimeStoreAccountTypeLookup($akid) {\n\t\tstatic $QuicktimeStoreAccountTypeLookup = array();\n\t\tif (empty($QuicktimeStoreAccountTypeLookup)) {\n\t\t\t$QuicktimeStoreAccountTypeLookup[0] = 'iTunes';\n\t\t\t$QuicktimeStoreAccountTypeLookup[1] = 'AOL';\n\t\t}\n\t\treturn (isset($QuicktimeStoreAccountTypeLookup[$akid]) ? $QuicktimeStoreAccountTypeLookup[$akid] : 'invalid');\n\t}\n\n\t/**\n\t * @param int $sfid\n\t *\n\t * @return string\n\t */\n\tpublic function QuicktimeStoreFrontCodeLookup($sfid) {\n\t\tstatic $QuicktimeStoreFrontCodeLookup = array();\n\t\tif (empty($QuicktimeStoreFrontCodeLookup)) {\n\t\t\t$QuicktimeStoreFrontCodeLookup[143460] = 'Australia';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143445] = 'Austria';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143446] = 'Belgium';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143455] = 'Canada';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143458] = 'Denmark';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143447] = 'Finland';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143442] = 'France';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143443] = 'Germany';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143448] = 'Greece';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143449] = 'Ireland';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143450] = 'Italy';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143462] = 'Japan';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143451] = 'Luxembourg';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143452] = 'Netherlands';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143461] = 'New Zealand';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143457] = 'Norway';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143453] = 'Portugal';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143454] = 'Spain';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143456] = 'Sweden';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143459] = 'Switzerland';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143444] = 'United Kingdom';\n\t\t\t$QuicktimeStoreFrontCodeLookup[143441] = 'United States';\n\t\t}\n\t\treturn (isset($QuicktimeStoreFrontCodeLookup[$sfid]) ? $QuicktimeStoreFrontCodeLookup[$sfid] : 'invalid');\n\t}\n\n\t/**\n\t * @param string $atom_data\n\t *\n\t * @return array\n\t */\n\tpublic function QuicktimeParseNikonNCTG($atom_data) {\n\t\t// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#NCTG\n\t\t// Nikon-specific QuickTime tags found in the NCDT atom of MOV videos from some Nikon cameras such as the Coolpix S8000 and D5100\n\t\t// Data is stored as records of:\n\t\t// * 4 bytes record type\n\t\t// * 2 bytes size of data field type:\n\t\t//     0x0001 = flag   (size field *= 1-byte)\n\t\t//     0x0002 = char   (size field *= 1-byte)\n\t\t//     0x0003 = DWORD+ (size field *= 2-byte), values are stored CDAB\n\t\t//     0x0004 = QWORD+ (size field *= 4-byte), values are stored EFGHABCD\n\t\t//     0x0005 = float  (size field *= 8-byte), values are stored aaaabbbb where value is aaaa/bbbb; possibly multiple sets of values appended together\n\t\t//     0x0007 = bytes  (size field *= 1-byte), values are stored as ??????\n\t\t//     0x0008 = ?????  (size field *= 2-byte), values are stored as ??????\n\t\t// * 2 bytes data size field\n\t\t// * ? bytes data (string data may be null-padded; datestamp fields are in the format \"2011:05:25 20:24:15\")\n\t\t// all integers are stored BigEndian\n\n\t\t$NCTGtagName = array(\n\t\t\t0x00000001 => 'Make',\n\t\t\t0x00000002 => 'Model',\n\t\t\t0x00000003 => 'Software',\n\t\t\t0x00000011 => 'CreateDate',\n\t\t\t0x00000012 => 'DateTimeOriginal',\n\t\t\t0x00000013 => 'FrameCount',\n\t\t\t0x00000016 => 'FrameRate',\n\t\t\t0x00000022 => 'FrameWidth',\n\t\t\t0x00000023 => 'FrameHeight',\n\t\t\t0x00000032 => 'AudioChannels',\n\t\t\t0x00000033 => 'AudioBitsPerSample',\n\t\t\t0x00000034 => 'AudioSampleRate',\n\t\t\t0x02000001 => 'MakerNoteVersion',\n\t\t\t0x02000005 => 'WhiteBalance',\n\t\t\t0x0200000b => 'WhiteBalanceFineTune',\n\t\t\t0x0200001e => 'ColorSpace',\n\t\t\t0x02000023 => 'PictureControlData',\n\t\t\t0x02000024 => 'WorldTime',\n\t\t\t0x02000032 => 'UnknownInfo',\n\t\t\t0x02000083 => 'LensType',\n\t\t\t0x02000084 => 'Lens',\n\t\t);\n\n\t\t$offset = 0;\n\t\t$data = null;\n\t\t$datalength = strlen($atom_data);\n\t\t$parsed = array();\n\t\twhile ($offset < $datalength) {\n\t\t\t$record_type       = getid3_lib::BigEndian2Int(substr($atom_data, $offset, 4));  $offset += 4;\n\t\t\t$data_size_type    = getid3_lib::BigEndian2Int(substr($atom_data, $offset, 2));  $offset += 2;\n\t\t\t$data_size         = getid3_lib::BigEndian2Int(substr($atom_data, $offset, 2));  $offset += 2;\n\t\t\tswitch ($data_size_type) {\n\t\t\t\tcase 0x0001: // 0x0001 = flag   (size field *= 1-byte)\n\t\t\t\t\t$data = getid3_lib::BigEndian2Int(substr($atom_data, $offset, $data_size * 1));\n\t\t\t\t\t$offset += ($data_size * 1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x0002: // 0x0002 = char   (size field *= 1-byte)\n\t\t\t\t\t$data = substr($atom_data, $offset, $data_size * 1);\n\t\t\t\t\t$offset += ($data_size * 1);\n\t\t\t\t\t$data = rtrim($data, \"\\x00\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x0003: // 0x0003 = DWORD+ (size field *= 2-byte), values are stored CDAB\n\t\t\t\t\t$data = '';\n\t\t\t\t\tfor ($i = $data_size - 1; $i >= 0; $i--) {\n\t\t\t\t\t\t$data .= substr($atom_data, $offset + ($i * 2), 2);\n\t\t\t\t\t}\n\t\t\t\t\t$data = getid3_lib::BigEndian2Int($data);\n\t\t\t\t\t$offset += ($data_size * 2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x0004: // 0x0004 = QWORD+ (size field *= 4-byte), values are stored EFGHABCD\n\t\t\t\t\t$data = '';\n\t\t\t\t\tfor ($i = $data_size - 1; $i >= 0; $i--) {\n\t\t\t\t\t\t$data .= substr($atom_data, $offset + ($i * 4), 4);\n\t\t\t\t\t}\n\t\t\t\t\t$data = getid3_lib::BigEndian2Int($data);\n\t\t\t\t\t$offset += ($data_size * 4);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x0005: // 0x0005 = float  (size field *= 8-byte), values are stored aaaabbbb where value is aaaa/bbbb; possibly multiple sets of values appended together\n\t\t\t\t\t$data = array();\n\t\t\t\t\tfor ($i = 0; $i < $data_size; $i++) {\n\t\t\t\t\t\t$numerator    = getid3_lib::BigEndian2Int(substr($atom_data, $offset + ($i * 8) + 0, 4));\n\t\t\t\t\t\t$denomninator = getid3_lib::BigEndian2Int(substr($atom_data, $offset + ($i * 8) + 4, 4));\n\t\t\t\t\t\tif ($denomninator == 0) {\n\t\t\t\t\t\t\t$data[$i] = false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$data[$i] = (double) $numerator / $denomninator;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$offset += (8 * $data_size);\n\t\t\t\t\tif (count($data) == 1) {\n\t\t\t\t\t\t$data = $data[0];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x0007: // 0x0007 = bytes  (size field *= 1-byte), values are stored as ??????\n\t\t\t\t\t$data = substr($atom_data, $offset, $data_size * 1);\n\t\t\t\t\t$offset += ($data_size * 1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x0008: // 0x0008 = ?????  (size field *= 2-byte), values are stored as ??????\n\t\t\t\t\t$data = substr($atom_data, $offset, $data_size * 2);\n\t\t\t\t\t$offset += ($data_size * 2);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo 'QuicktimeParseNikonNCTG()::unknown $data_size_type: '.$data_size_type.'<br>';\n\t\t\t\t\tbreak 2;\n\t\t\t}\n\n\t\t\tswitch ($record_type) {\n\t\t\t\tcase 0x00000011: // CreateDate\n\t\t\t\tcase 0x00000012: // DateTimeOriginal\n\t\t\t\t\t$data = strtotime($data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x0200001e: // ColorSpace\n\t\t\t\t\tswitch ($data) {\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t$data = 'sRGB';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t$data = 'Adobe RGB';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x02000023: // PictureControlData\n\t\t\t\t\t$PictureControlAdjust = array(0=>'default', 1=>'quick', 2=>'full');\n\t\t\t\t\t$FilterEffect = array(0x80=>'off', 0x81=>'yellow', 0x82=>'orange',    0x83=>'red', 0x84=>'green',  0xff=>'n/a');\n\t\t\t\t\t$ToningEffect = array(0x80=>'b&w', 0x81=>'sepia',  0x82=>'cyanotype', 0x83=>'red', 0x84=>'yellow', 0x85=>'green', 0x86=>'blue-green', 0x87=>'blue', 0x88=>'purple-blue', 0x89=>'red-purple', 0xff=>'n/a');\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'PictureControlVersion'     =>                           substr($data,  0,  4),\n\t\t\t\t\t\t'PictureControlName'        =>                     rtrim(substr($data,  4, 20), \"\\x00\"),\n\t\t\t\t\t\t'PictureControlBase'        =>                     rtrim(substr($data, 24, 20), \"\\x00\"),\n\t\t\t\t\t\t//'?'                       =>                           substr($data, 44,  4),\n\t\t\t\t\t\t'PictureControlAdjust'      => $PictureControlAdjust[ord(substr($data, 48,  1))],\n\t\t\t\t\t\t'PictureControlQuickAdjust' =>                       ord(substr($data, 49,  1)),\n\t\t\t\t\t\t'Sharpness'                 =>                       ord(substr($data, 50,  1)),\n\t\t\t\t\t\t'Contrast'                  =>                       ord(substr($data, 51,  1)),\n\t\t\t\t\t\t'Brightness'                =>                       ord(substr($data, 52,  1)),\n\t\t\t\t\t\t'Saturation'                =>                       ord(substr($data, 53,  1)),\n\t\t\t\t\t\t'HueAdjustment'             =>                       ord(substr($data, 54,  1)),\n\t\t\t\t\t\t'FilterEffect'              =>         $FilterEffect[ord(substr($data, 55,  1))],\n\t\t\t\t\t\t'ToningEffect'              =>         $ToningEffect[ord(substr($data, 56,  1))],\n\t\t\t\t\t\t'ToningSaturation'          =>                       ord(substr($data, 57,  1)),\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x02000024: // WorldTime\n\t\t\t\t\t// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#WorldTime\n\t\t\t\t\t// timezone is stored as offset from GMT in minutes\n\t\t\t\t\t$timezone = getid3_lib::BigEndian2Int(substr($data, 0, 2));\n\t\t\t\t\tif ($timezone & 0x8000) {\n\t\t\t\t\t\t$timezone = 0 - (0x10000 - $timezone);\n\t\t\t\t\t}\n\t\t\t\t\t$timezone /= 60;\n\n\t\t\t\t\t$dst = (bool) getid3_lib::BigEndian2Int(substr($data, 2, 1));\n\t\t\t\t\tswitch (getid3_lib::BigEndian2Int(substr($data, 3, 1))) {\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t$datedisplayformat = 'D/M/Y'; break;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t$datedisplayformat = 'M/D/Y'; break;\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$datedisplayformat = 'Y/M/D'; break;\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = array('timezone'=>floatval($timezone), 'dst'=>$dst, 'display'=>$datedisplayformat);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x02000083: // LensType\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t//'_'  => $data,\n\t\t\t\t\t\t'mf' => (bool) ($data & 0x01),\n\t\t\t\t\t\t'd'  => (bool) ($data & 0x02),\n\t\t\t\t\t\t'g'  => (bool) ($data & 0x04),\n\t\t\t\t\t\t'vr' => (bool) ($data & 0x08),\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$tag_name = (isset($NCTGtagName[$record_type]) ? $NCTGtagName[$record_type] : '0x'.str_pad(dechex($record_type), 8, '0', STR_PAD_LEFT));\n\t\t\t$parsed[$tag_name] = $data;\n\t\t}\n\t\treturn $parsed;\n\t}\n\n\t/**\n\t * @param string $keyname\n\t * @param string|array $data\n\t * @param string $boxname\n\t *\n\t * @return bool\n\t */\n\tpublic function CopyToAppropriateCommentsSection($keyname, $data, $boxname='') {\n\t\tstatic $handyatomtranslatorarray = array();\n\t\tif (empty($handyatomtranslatorarray)) {\n\t\t\t// http://www.geocities.com/xhelmboyx/quicktime/formats/qtm-layout.txt\n\t\t\t// http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt\n\t\t\t// http://atomicparsley.sourceforge.net/mpeg-4files.html\n\t\t\t// https://code.google.com/p/mp4v2/wiki/iTunesMetadata\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'alb'] = 'album';               // iTunes 4.0\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'ART'] = 'artist';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'art'] = 'artist';              // iTunes 4.0\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'aut'] = 'author';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'cmt'] = 'comment';             // iTunes 4.0\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'com'] = 'comment';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'cpy'] = 'copyright';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'day'] = 'creation_date';       // iTunes 4.0\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'dir'] = 'director';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'ed1'] = 'edit1';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'ed2'] = 'edit2';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'ed3'] = 'edit3';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'ed4'] = 'edit4';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'ed5'] = 'edit5';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'ed6'] = 'edit6';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'ed7'] = 'edit7';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'ed8'] = 'edit8';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'ed9'] = 'edit9';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'enc'] = 'encoded_by';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'fmt'] = 'format';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'gen'] = 'genre';               // iTunes 4.0\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'grp'] = 'grouping';            // iTunes 4.2\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'hst'] = 'host_computer';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'inf'] = 'information';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'lyr'] = 'lyrics';              // iTunes 5.0\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'mak'] = 'make';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'mod'] = 'model';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'nam'] = 'title';               // iTunes 4.0\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'ope'] = 'composer';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'prd'] = 'producer';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'PRD'] = 'product';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'prf'] = 'performers';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'req'] = 'system_requirements';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'src'] = 'source_credit';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'swr'] = 'software';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'too'] = 'encoding_tool';       // iTunes 4.0\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'trk'] = 'track_number';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'url'] = 'url';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'wrn'] = 'warning';\n\t\t\t$handyatomtranslatorarray[\"\\xA9\".'wrt'] = 'composer';\n\t\t\t$handyatomtranslatorarray['aART'] = 'album_artist';\n\t\t\t$handyatomtranslatorarray['apID'] = 'purchase_account';\n\t\t\t$handyatomtranslatorarray['catg'] = 'category';            // iTunes 4.9\n\t\t\t$handyatomtranslatorarray['covr'] = 'picture';             // iTunes 4.0\n\t\t\t$handyatomtranslatorarray['cpil'] = 'compilation';         // iTunes 4.0\n\t\t\t$handyatomtranslatorarray['cprt'] = 'copyright';           // iTunes 4.0?\n\t\t\t$handyatomtranslatorarray['desc'] = 'description';         // iTunes 5.0\n\t\t\t$handyatomtranslatorarray['disk'] = 'disc_number';         // iTunes 4.0\n\t\t\t$handyatomtranslatorarray['egid'] = 'episode_guid';        // iTunes 4.9\n\t\t\t$handyatomtranslatorarray['gnre'] = 'genre';               // iTunes 4.0\n\t\t\t$handyatomtranslatorarray['hdvd'] = 'hd_video';            // iTunes 4.0\n\t\t\t$handyatomtranslatorarray['ldes'] = 'description_long';    //\n\t\t\t$handyatomtranslatorarray['keyw'] = 'keyword';             // iTunes 4.9\n\t\t\t$handyatomtranslatorarray['pcst'] = 'podcast';             // iTunes 4.9\n\t\t\t$handyatomtranslatorarray['pgap'] = 'gapless_playback';    // iTunes 7.0\n\t\t\t$handyatomtranslatorarray['purd'] = 'purchase_date';       // iTunes 6.0.2\n\t\t\t$handyatomtranslatorarray['purl'] = 'podcast_url';         // iTunes 4.9\n\t\t\t$handyatomtranslatorarray['rtng'] = 'rating';              // iTunes 4.0\n\t\t\t$handyatomtranslatorarray['soaa'] = 'sort_album_artist';   //\n\t\t\t$handyatomtranslatorarray['soal'] = 'sort_album';          //\n\t\t\t$handyatomtranslatorarray['soar'] = 'sort_artist';         //\n\t\t\t$handyatomtranslatorarray['soco'] = 'sort_composer';       //\n\t\t\t$handyatomtranslatorarray['sonm'] = 'sort_title';          //\n\t\t\t$handyatomtranslatorarray['sosn'] = 'sort_show';           //\n\t\t\t$handyatomtranslatorarray['stik'] = 'stik';                // iTunes 4.9\n\t\t\t$handyatomtranslatorarray['tmpo'] = 'bpm';                 // iTunes 4.0\n\t\t\t$handyatomtranslatorarray['trkn'] = 'track_number';        // iTunes 4.0\n\t\t\t$handyatomtranslatorarray['tven'] = 'tv_episode_id';       //\n\t\t\t$handyatomtranslatorarray['tves'] = 'tv_episode';          // iTunes 6.0\n\t\t\t$handyatomtranslatorarray['tvnn'] = 'tv_network_name';     // iTunes 6.0\n\t\t\t$handyatomtranslatorarray['tvsh'] = 'tv_show_name';        // iTunes 6.0\n\t\t\t$handyatomtranslatorarray['tvsn'] = 'tv_season';           // iTunes 6.0\n\n\t\t\t// boxnames:\n\t\t\t/*\n\t\t\t$handyatomtranslatorarray['iTunSMPB']                    = 'iTunSMPB';\n\t\t\t$handyatomtranslatorarray['iTunNORM']                    = 'iTunNORM';\n\t\t\t$handyatomtranslatorarray['Encoding Params']             = 'Encoding Params';\n\t\t\t$handyatomtranslatorarray['replaygain_track_gain']       = 'replaygain_track_gain';\n\t\t\t$handyatomtranslatorarray['replaygain_track_peak']       = 'replaygain_track_peak';\n\t\t\t$handyatomtranslatorarray['replaygain_track_minmax']     = 'replaygain_track_minmax';\n\t\t\t$handyatomtranslatorarray['MusicIP PUID']                = 'MusicIP PUID';\n\t\t\t$handyatomtranslatorarray['MusicBrainz Artist Id']       = 'MusicBrainz Artist Id';\n\t\t\t$handyatomtranslatorarray['MusicBrainz Album Id']        = 'MusicBrainz Album Id';\n\t\t\t$handyatomtranslatorarray['MusicBrainz Album Artist Id'] = 'MusicBrainz Album Artist Id';\n\t\t\t$handyatomtranslatorarray['MusicBrainz Track Id']        = 'MusicBrainz Track Id';\n\t\t\t$handyatomtranslatorarray['MusicBrainz Disc Id']         = 'MusicBrainz Disc Id';\n\n\t\t\t// http://age.hobba.nl/audio/tag_frame_reference.html\n\t\t\t$handyatomtranslatorarray['PLAY_COUNTER']                = 'play_counter'; // Foobar2000 - https://www.getid3.org/phpBB3/viewtopic.php?t=1355\n\t\t\t$handyatomtranslatorarray['MEDIATYPE']                   = 'mediatype';    // Foobar2000 - https://www.getid3.org/phpBB3/viewtopic.php?t=1355\n\t\t\t*/\n\t\t}\n\t\t$info = &$this->getid3->info;\n\t\t$comment_key = '';\n\t\tif ($boxname && ($boxname != $keyname)) {\n\t\t\t$comment_key = (isset($handyatomtranslatorarray[$boxname]) ? $handyatomtranslatorarray[$boxname] : $boxname);\n\t\t} elseif (isset($handyatomtranslatorarray[$keyname])) {\n\t\t\t$comment_key = $handyatomtranslatorarray[$keyname];\n\t\t}\n\t\tif ($comment_key) {\n\t\t\tif ($comment_key == 'picture') {\n\t\t\t\t// already copied directly into [comments][picture] elsewhere, do not re-copy here\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t$gooddata = array($data);\n\t\t\tif ($comment_key == 'genre') {\n\t\t\t\t// some other taggers separate multiple genres with semicolon, e.g. \"Heavy Metal;Thrash Metal;Metal\"\n\t\t\t\t$gooddata = explode(';', $data);\n\t\t\t}\n\t\t\tforeach ($gooddata as $data) {\n\t\t\t\tif (!empty($info['quicktime']['comments'][$comment_key]) && in_array($data, $info['quicktime']['comments'][$comment_key], true)) {\n\t\t\t\t\t// avoid duplicate copies of identical data\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$info['quicktime']['comments'][$comment_key][] = $data;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $lstring\n\t * @param int    $count\n\t *\n\t * @return string\n\t */\n\tpublic function LociString($lstring, &$count) {\n\t\t// Loci strings are UTF-8 or UTF-16 and null (x00/x0000) terminated. UTF-16 has a BOM\n\t\t// Also need to return the number of bytes the string occupied so additional fields can be extracted\n\t\t$len = strlen($lstring);\n\t\tif ($len == 0) {\n\t\t\t$count = 0;\n\t\t\treturn '';\n\t\t}\n\t\tif ($lstring[0] == \"\\x00\") {\n\t\t\t$count = 1;\n\t\t\treturn '';\n\t\t}\n\t\t// check for BOM\n\t\tif (($len > 2) && ((($lstring[0] == \"\\xFE\") && ($lstring[1] == \"\\xFF\")) || (($lstring[0] == \"\\xFF\") && ($lstring[1] == \"\\xFE\")))) {\n\t\t\t// UTF-16\n\t\t\tif (preg_match('/(.*)\\x00/', $lstring, $lmatches)) {\n\t\t\t\t$count = strlen($lmatches[1]) * 2 + 2; //account for 2 byte characters and trailing \\x0000\n\t\t\t\treturn getid3_lib::iconv_fallback_utf16_utf8($lmatches[1]);\n\t\t\t} else {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t}\n\t\t// UTF-8\n\t\tif (preg_match('/(.*)\\x00/', $lstring, $lmatches)) {\n\t\t\t$count = strlen($lmatches[1]) + 1; //account for trailing \\x00\n\t\t\treturn $lmatches[1];\n\t\t}\n\t\treturn '';\n\t}\n\n\t/**\n\t * @param string $nullterminatedstring\n\t *\n\t * @return string\n\t */\n\tpublic function NoNullString($nullterminatedstring) {\n\t\t// remove the single null terminator on null terminated strings\n\t\tif (substr($nullterminatedstring, strlen($nullterminatedstring) - 1, 1) === \"\\x00\") {\n\t\t\treturn substr($nullterminatedstring, 0, strlen($nullterminatedstring) - 1);\n\t\t}\n\t\treturn $nullterminatedstring;\n\t}\n\n\t/**\n\t * @param string $pascalstring\n\t *\n\t * @return string\n\t */\n\tpublic function Pascal2String($pascalstring) {\n\t\t// Pascal strings have 1 unsigned byte at the beginning saying how many chars (1-255) are in the string\n\t\treturn substr($pascalstring, 1);\n\t}\n\n\t/**\n\t * @param string $pascalstring\n\t *\n\t * @return string\n\t */\n\tpublic function MaybePascal2String($pascalstring) {\n\t\t// Pascal strings have 1 unsigned byte at the beginning saying how many chars (1-255) are in the string\n\t\t// Check if string actually is in this format or written incorrectly, straight string, or null-terminated string\n\t\tif (ord(substr($pascalstring, 0, 1)) == (strlen($pascalstring) - 1)) {\n\t\t\treturn substr($pascalstring, 1);\n\t\t} elseif (substr($pascalstring, -1, 1) == \"\\x00\") {\n\t\t\t// appears to be null-terminated instead of Pascal-style\n\t\t\treturn substr($pascalstring, 0, -1);\n\t\t}\n\t\treturn $pascalstring;\n\t}\n\n\n\t/**\n\t * Helper functions for m4b audiobook chapters\n\t * code by Steffen Hartmann 2015-Nov-08.\n\t *\n\t * @param array  $info\n\t * @param string $tag\n\t * @param string $history\n\t * @param array  $result\n\t */\n\tpublic function search_tag_by_key($info, $tag, $history, &$result) {\n\t\tforeach ($info as $key => $value) {\n\t\t\t$key_history = $history.'/'.$key;\n\t\t\tif ($key === $tag) {\n\t\t\t\t$result[] = array($key_history, $info);\n\t\t\t} else {\n\t\t\t\tif (is_array($value)) {\n\t\t\t\t\t$this->search_tag_by_key($value, $tag, $key_history, $result);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param array  $info\n\t * @param string $k\n\t * @param string $v\n\t * @param string $history\n\t * @param array  $result\n\t */\n\tpublic function search_tag_by_pair($info, $k, $v, $history, &$result) {\n\t\tforeach ($info as $key => $value) {\n\t\t\t$key_history = $history.'/'.$key;\n\t\t\tif (($key === $k) && ($value === $v)) {\n\t\t\t\t$result[] = array($key_history, $info);\n\t\t\t} else {\n\t\t\t\tif (is_array($value)) {\n\t\t\t\t\t$this->search_tag_by_pair($value, $k, $v, $key_history, $result);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param array $info\n\t *\n\t * @return array\n\t */\n\tpublic function quicktime_time_to_sample_table($info) {\n\t\t$res = array();\n\t\t$this->search_tag_by_pair($info['quicktime']['moov'], 'name', 'stbl', 'quicktime/moov', $res);\n\t\tforeach ($res as $value) {\n\t\t\t$stbl_res = array();\n\t\t\t$this->search_tag_by_pair($value[1], 'data_format', 'text', $value[0], $stbl_res);\n\t\t\tif (count($stbl_res) > 0) {\n\t\t\t\t$stts_res = array();\n\t\t\t\t$this->search_tag_by_key($value[1], 'time_to_sample_table', $value[0], $stts_res);\n\t\t\t\tif (count($stts_res) > 0) {\n\t\t\t\t\treturn $stts_res[0][1]['time_to_sample_table'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn array();\n\t}\n\n\t/**\n\t * @param array $info\n\t *\n\t * @return int\n\t */\n\tpublic function quicktime_bookmark_time_scale($info) {\n\t\t$time_scale = '';\n\t\t$ts_prefix_len = 0;\n\t\t$res = array();\n\t\t$this->search_tag_by_pair($info['quicktime']['moov'], 'name', 'stbl', 'quicktime/moov', $res);\n\t\tforeach ($res as $value) {\n\t\t\t$stbl_res = array();\n\t\t\t$this->search_tag_by_pair($value[1], 'data_format', 'text', $value[0], $stbl_res);\n\t\t\tif (count($stbl_res) > 0) {\n\t\t\t\t$ts_res = array();\n\t\t\t\t$this->search_tag_by_key($info['quicktime']['moov'], 'time_scale', 'quicktime/moov', $ts_res);\n\t\t\t\tforeach ($ts_res as $sub_value) {\n\t\t\t\t\t$prefix = substr($sub_value[0], 0, -12);\n\t\t\t\t\tif ((substr($stbl_res[0][0], 0, strlen($prefix)) === $prefix) && ($ts_prefix_len < strlen($prefix))) {\n\t\t\t\t\t\t$time_scale = $sub_value[1]['time_scale'];\n\t\t\t\t\t\t$ts_prefix_len = strlen($prefix);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $time_scale;\n\t}\n\t/*\n\t// END helper functions for m4b audiobook chapters\n\t*/\n\n\n}\n", "num_lines": 3101}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/////////////////////////////////////////////////////////////////\n/// getID3() by James Heinrich <info@getid3.org>               //\n//  available at https://github.com/JamesHeinrich/getID3       //\n//            or https://www.getid3.org                        //\n//            or http://getid3.sourceforge.net                 //\n//  see readme.txt for more details                            //\n/////////////////////////////////////////////////////////////////\n//                                                             //\n// module.audio-video.riff.php                                 //\n// module for analyzing RIFF files                             //\n// multiple formats supported by this module:                  //\n//    Wave, AVI, AIFF/AIFC, (MP3,AC3)/RIFF, Wavpack v3, 8SVX   //\n// dependencies: module.audio.mp3.php                          //\n//               module.audio.ac3.php                          //\n//               module.audio.dts.php                          //\n//                                                            ///\n/////////////////////////////////////////////////////////////////\n\n/**\n* @todo Parse AC-3/DTS audio inside WAVE correctly\n* @todo Rewrite RIFF parser totally\n*/\n\nif (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers\n\texit;\n}\ngetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.mp3.php', __FILE__, true);\ngetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ac3.php', __FILE__, true);\ngetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.dts.php', __FILE__, true);\n\nclass getid3_riff extends getid3_handler\n{\n\tprotected $container = 'riff'; // default\n\n\t/**\n\t * @return bool\n\t *\n\t * @throws getid3_exception\n\t */\n\tpublic function Analyze() {\n\t\t$info = &$this->getid3->info;\n\n\t\t// initialize these values to an empty array, otherwise they default to NULL\n\t\t// and you can't append array values to a NULL value\n\t\t$info['riff'] = array('raw'=>array());\n\n\t\t// Shortcuts\n\t\t$thisfile_riff             = &$info['riff'];\n\t\t$thisfile_riff_raw         = &$thisfile_riff['raw'];\n\t\t$thisfile_audio            = &$info['audio'];\n\t\t$thisfile_video            = &$info['video'];\n\t\t$thisfile_audio_dataformat = &$thisfile_audio['dataformat'];\n\t\t$thisfile_riff_audio       = &$thisfile_riff['audio'];\n\t\t$thisfile_riff_video       = &$thisfile_riff['video'];\n\t\t$thisfile_riff_WAVE        = array();\n\n\t\t$Original['avdataoffset'] = $info['avdataoffset'];\n\t\t$Original['avdataend']    = $info['avdataend'];\n\n\t\t$this->fseek($info['avdataoffset']);\n\t\t$RIFFheader = $this->fread(12);\n\t\t$offset = $this->ftell();\n\t\t$RIFFtype    = substr($RIFFheader, 0, 4);\n\t\t$RIFFsize    = substr($RIFFheader, 4, 4);\n\t\t$RIFFsubtype = substr($RIFFheader, 8, 4);\n\n\t\tswitch ($RIFFtype) {\n\n\t\t\tcase 'FORM':  // AIFF, AIFC\n\t\t\t\t//$info['fileformat']   = 'aiff';\n\t\t\t\t$this->container = 'aiff';\n\t\t\t\t$thisfile_riff['header_size'] = $this->EitherEndian2Int($RIFFsize);\n\t\t\t\t$thisfile_riff[$RIFFsubtype]  = $this->ParseRIFF($offset, ($offset + $thisfile_riff['header_size'] - 4));\n\t\t\t\tbreak;\n\n\t\t\tcase 'RIFF':  // AVI, WAV, etc\n\t\t\tcase 'SDSS':  // SDSS is identical to RIFF, just renamed. Used by SmartSound QuickTracks (www.smartsound.com)\n\t\t\tcase 'RMP3':  // RMP3 is identical to RIFF, just renamed. Used by [unknown program] when creating RIFF-MP3s\n\t\t\t\t//$info['fileformat']   = 'riff';\n\t\t\t\t$this->container = 'riff';\n\t\t\t\t$thisfile_riff['header_size'] = $this->EitherEndian2Int($RIFFsize);\n\t\t\t\tif ($RIFFsubtype == 'RMP3') {\n\t\t\t\t\t// RMP3 is identical to WAVE, just renamed. Used by [unknown program] when creating RIFF-MP3s\n\t\t\t\t\t$RIFFsubtype = 'WAVE';\n\t\t\t\t}\n\t\t\t\tif ($RIFFsubtype != 'AMV ') {\n\t\t\t\t\t// AMV files are RIFF-AVI files with parts of the spec deliberately broken, such as chunk size fields hardcoded to zero (because players known in hardware that these fields are always a certain size\n\t\t\t\t\t// Handled separately in ParseRIFFAMV()\n\t\t\t\t\t$thisfile_riff[$RIFFsubtype]  = $this->ParseRIFF($offset, ($offset + $thisfile_riff['header_size'] - 4));\n\t\t\t\t}\n\t\t\t\tif (($info['avdataend'] - $info['filesize']) == 1) {\n\t\t\t\t\t// LiteWave appears to incorrectly *not* pad actual output file\n\t\t\t\t\t// to nearest WORD boundary so may appear to be short by one\n\t\t\t\t\t// byte, in which case - skip warning\n\t\t\t\t\t$info['avdataend'] = $info['filesize'];\n\t\t\t\t}\n\n\t\t\t\t$nextRIFFoffset = $Original['avdataoffset'] + 8 + $thisfile_riff['header_size']; // 8 = \"RIFF\" + 32-bit offset\n\t\t\t\twhile ($nextRIFFoffset < min($info['filesize'], $info['avdataend'])) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$this->fseek($nextRIFFoffset);\n\t\t\t\t\t} catch (getid3_exception $e) {\n\t\t\t\t\t\tif ($e->getCode() == 10) {\n\t\t\t\t\t\t\t//$this->warning('RIFF parser: '.$e->getMessage());\n\t\t\t\t\t\t\t$this->error('AVI extends beyond '.round(PHP_INT_MAX / 1073741824).'GB and PHP filesystem functions cannot read that far, playtime may be wrong');\n\t\t\t\t\t\t\t$this->warning('[avdataend] value may be incorrect, multiple AVIX chunks may be present');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow $e;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$nextRIFFheader = $this->fread(12);\n\t\t\t\t\tif ($nextRIFFoffset == ($info['avdataend'] - 1)) {\n\t\t\t\t\t\tif (substr($nextRIFFheader, 0, 1) == \"\\x00\") {\n\t\t\t\t\t\t\t// RIFF padded to WORD boundary, we're actually already at the end\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$nextRIFFheaderID =                         substr($nextRIFFheader, 0, 4);\n\t\t\t\t\t$nextRIFFsize     = $this->EitherEndian2Int(substr($nextRIFFheader, 4, 4));\n\t\t\t\t\t$nextRIFFtype     =                         substr($nextRIFFheader, 8, 4);\n\t\t\t\t\t$chunkdata = array();\n\t\t\t\t\t$chunkdata['offset'] = $nextRIFFoffset + 8;\n\t\t\t\t\t$chunkdata['size']   = $nextRIFFsize;\n\t\t\t\t\t$nextRIFFoffset = $chunkdata['offset'] + $chunkdata['size'];\n\n\t\t\t\t\tswitch ($nextRIFFheaderID) {\n\t\t\t\t\t\tcase 'RIFF':\n\t\t\t\t\t\t\t$chunkdata['chunks'] = $this->ParseRIFF($chunkdata['offset'] + 4, $nextRIFFoffset);\n\t\t\t\t\t\t\tif (!isset($thisfile_riff[$nextRIFFtype])) {\n\t\t\t\t\t\t\t\t$thisfile_riff[$nextRIFFtype] = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$thisfile_riff[$nextRIFFtype][] = $chunkdata;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'AMV ':\n\t\t\t\t\t\t\tunset($info['riff']);\n\t\t\t\t\t\t\t$info['amv'] = $this->ParseRIFFAMV($chunkdata['offset'] + 4, $nextRIFFoffset);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'JUNK':\n\t\t\t\t\t\t\t// ignore\n\t\t\t\t\t\t\t$thisfile_riff[$nextRIFFheaderID][] = $chunkdata;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'IDVX':\n\t\t\t\t\t\t\t$info['divxtag']['comments'] = self::ParseDIVXTAG($this->fread($chunkdata['size']));\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif ($info['filesize'] == ($chunkdata['offset'] - 8 + 128)) {\n\t\t\t\t\t\t\t\t$DIVXTAG = $nextRIFFheader.$this->fread(128 - 12);\n\t\t\t\t\t\t\t\tif (substr($DIVXTAG, -7) == 'DIVXTAG') {\n\t\t\t\t\t\t\t\t\t// DIVXTAG is supposed to be inside an IDVX chunk in a LIST chunk, but some bad encoders just slap it on the end of a file\n\t\t\t\t\t\t\t\t\t$this->warning('Found wrongly-structured DIVXTAG at offset '.($this->ftell() - 128).', parsing anyway');\n\t\t\t\t\t\t\t\t\t$info['divxtag']['comments'] = self::ParseDIVXTAG($DIVXTAG);\n\t\t\t\t\t\t\t\t\tbreak 2;\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$this->warning('Expecting \"RIFF|JUNK|IDVX\" at '.$nextRIFFoffset.', found \"'.$nextRIFFheaderID.'\" ('.getid3_lib::PrintHexBytes($nextRIFFheaderID).') - skipping rest of file');\n\t\t\t\t\t\t\tbreak 2;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif ($RIFFsubtype == 'WAVE') {\n\t\t\t\t\t$thisfile_riff_WAVE = &$thisfile_riff['WAVE'];\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->error('Cannot parse RIFF (this is maybe not a RIFF / WAV / AVI file?) - expecting \"FORM|RIFF|SDSS|RMP3\" found \"'.$RIFFsubtype.'\" instead');\n\t\t\t\t//unset($info['fileformat']);\n\t\t\t\treturn false;\n\t\t}\n\n\t\t$streamindex = 0;\n\t\tswitch ($RIFFsubtype) {\n\n\t\t\t// http://en.wikipedia.org/wiki/Wav\n\t\t\tcase 'WAVE':\n\t\t\t\t$info['fileformat'] = 'wav';\n\n\t\t\t\tif (empty($thisfile_audio['bitrate_mode'])) {\n\t\t\t\t\t$thisfile_audio['bitrate_mode'] = 'cbr';\n\t\t\t\t}\n\t\t\t\tif (empty($thisfile_audio_dataformat)) {\n\t\t\t\t\t$thisfile_audio_dataformat = 'wav';\n\t\t\t\t}\n\n\t\t\t\tif (isset($thisfile_riff_WAVE['data'][0]['offset'])) {\n\t\t\t\t\t$info['avdataoffset'] = $thisfile_riff_WAVE['data'][0]['offset'] + 8;\n\t\t\t\t\t$info['avdataend']    = $info['avdataoffset'] + $thisfile_riff_WAVE['data'][0]['size'];\n\t\t\t\t}\n\t\t\t\tif (isset($thisfile_riff_WAVE['fmt '][0]['data'])) {\n\n\t\t\t\t\t$thisfile_riff_audio[$streamindex] = self::parseWAVEFORMATex($thisfile_riff_WAVE['fmt '][0]['data']);\n\t\t\t\t\t$thisfile_audio['wformattag'] = $thisfile_riff_audio[$streamindex]['raw']['wFormatTag'];\n\t\t\t\t\tif (!isset($thisfile_riff_audio[$streamindex]['bitrate']) || ($thisfile_riff_audio[$streamindex]['bitrate'] == 0)) {\n\t\t\t\t\t\t$this->error('Corrupt RIFF file: bitrate_audio == zero');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_riff_raw['fmt '] = $thisfile_riff_audio[$streamindex]['raw'];\n\t\t\t\t\tunset($thisfile_riff_audio[$streamindex]['raw']);\n\t\t\t\t\t$thisfile_audio['streams'][$streamindex] = $thisfile_riff_audio[$streamindex];\n\n\t\t\t\t\t$thisfile_audio = (array) getid3_lib::array_merge_noclobber($thisfile_audio, $thisfile_riff_audio[$streamindex]);\n\t\t\t\t\tif (substr($thisfile_audio['codec'], 0, strlen('unknown: 0x')) == 'unknown: 0x') {\n\t\t\t\t\t\t$this->warning('Audio codec = '.$thisfile_audio['codec']);\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_audio['bitrate'] = $thisfile_riff_audio[$streamindex]['bitrate'];\n\n\t\t\t\t\tif (empty($info['playtime_seconds'])) { // may already be set (e.g. DTS-WAV)\n\t\t\t\t\t\t$info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) / $thisfile_audio['bitrate']);\n\t\t\t\t\t}\n\n\t\t\t\t\t$thisfile_audio['lossless'] = false;\n\t\t\t\t\tif (isset($thisfile_riff_WAVE['data'][0]['offset']) && isset($thisfile_riff_raw['fmt ']['wFormatTag'])) {\n\t\t\t\t\t\tswitch ($thisfile_riff_raw['fmt ']['wFormatTag']) {\n\n\t\t\t\t\t\t\tcase 0x0001:  // PCM\n\t\t\t\t\t\t\t\t$thisfile_audio['lossless'] = true;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 0x2000:  // AC-3\n\t\t\t\t\t\t\t\t$thisfile_audio_dataformat = 'ac3';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_audio['streams'][$streamindex]['wformattag']   = $thisfile_audio['wformattag'];\n\t\t\t\t\t$thisfile_audio['streams'][$streamindex]['bitrate_mode'] = $thisfile_audio['bitrate_mode'];\n\t\t\t\t\t$thisfile_audio['streams'][$streamindex]['lossless']     = $thisfile_audio['lossless'];\n\t\t\t\t\t$thisfile_audio['streams'][$streamindex]['dataformat']   = $thisfile_audio_dataformat;\n\t\t\t\t}\n\n\t\t\t\tif (isset($thisfile_riff_WAVE['rgad'][0]['data'])) {\n\n\t\t\t\t\t// shortcuts\n\t\t\t\t\t$rgadData = &$thisfile_riff_WAVE['rgad'][0]['data'];\n\t\t\t\t\t$thisfile_riff_raw['rgad']    = array('track'=>array(), 'album'=>array());\n\t\t\t\t\t$thisfile_riff_raw_rgad       = &$thisfile_riff_raw['rgad'];\n\t\t\t\t\t$thisfile_riff_raw_rgad_track = &$thisfile_riff_raw_rgad['track'];\n\t\t\t\t\t$thisfile_riff_raw_rgad_album = &$thisfile_riff_raw_rgad['album'];\n\n\t\t\t\t\t$thisfile_riff_raw_rgad['fPeakAmplitude']      = getid3_lib::LittleEndian2Float(substr($rgadData, 0, 4));\n\t\t\t\t\t$thisfile_riff_raw_rgad['nRadioRgAdjust']      =        $this->EitherEndian2Int(substr($rgadData, 4, 2));\n\t\t\t\t\t$thisfile_riff_raw_rgad['nAudiophileRgAdjust'] =        $this->EitherEndian2Int(substr($rgadData, 6, 2));\n\n\t\t\t\t\t$nRadioRgAdjustBitstring      = str_pad(getid3_lib::Dec2Bin($thisfile_riff_raw_rgad['nRadioRgAdjust']), 16, '0', STR_PAD_LEFT);\n\t\t\t\t\t$nAudiophileRgAdjustBitstring = str_pad(getid3_lib::Dec2Bin($thisfile_riff_raw_rgad['nAudiophileRgAdjust']), 16, '0', STR_PAD_LEFT);\n\t\t\t\t\t$thisfile_riff_raw_rgad_track['name']       = getid3_lib::Bin2Dec(substr($nRadioRgAdjustBitstring, 0, 3));\n\t\t\t\t\t$thisfile_riff_raw_rgad_track['originator'] = getid3_lib::Bin2Dec(substr($nRadioRgAdjustBitstring, 3, 3));\n\t\t\t\t\t$thisfile_riff_raw_rgad_track['signbit']    = getid3_lib::Bin2Dec(substr($nRadioRgAdjustBitstring, 6, 1));\n\t\t\t\t\t$thisfile_riff_raw_rgad_track['adjustment'] = getid3_lib::Bin2Dec(substr($nRadioRgAdjustBitstring, 7, 9));\n\t\t\t\t\t$thisfile_riff_raw_rgad_album['name']       = getid3_lib::Bin2Dec(substr($nAudiophileRgAdjustBitstring, 0, 3));\n\t\t\t\t\t$thisfile_riff_raw_rgad_album['originator'] = getid3_lib::Bin2Dec(substr($nAudiophileRgAdjustBitstring, 3, 3));\n\t\t\t\t\t$thisfile_riff_raw_rgad_album['signbit']    = getid3_lib::Bin2Dec(substr($nAudiophileRgAdjustBitstring, 6, 1));\n\t\t\t\t\t$thisfile_riff_raw_rgad_album['adjustment'] = getid3_lib::Bin2Dec(substr($nAudiophileRgAdjustBitstring, 7, 9));\n\n\t\t\t\t\t$thisfile_riff['rgad']['peakamplitude'] = $thisfile_riff_raw_rgad['fPeakAmplitude'];\n\t\t\t\t\tif (($thisfile_riff_raw_rgad_track['name'] != 0) && ($thisfile_riff_raw_rgad_track['originator'] != 0)) {\n\t\t\t\t\t\t$thisfile_riff['rgad']['track']['name']            = getid3_lib::RGADnameLookup($thisfile_riff_raw_rgad_track['name']);\n\t\t\t\t\t\t$thisfile_riff['rgad']['track']['originator']      = getid3_lib::RGADoriginatorLookup($thisfile_riff_raw_rgad_track['originator']);\n\t\t\t\t\t\t$thisfile_riff['rgad']['track']['adjustment']      = getid3_lib::RGADadjustmentLookup($thisfile_riff_raw_rgad_track['adjustment'], $thisfile_riff_raw_rgad_track['signbit']);\n\t\t\t\t\t}\n\t\t\t\t\tif (($thisfile_riff_raw_rgad_album['name'] != 0) && ($thisfile_riff_raw_rgad_album['originator'] != 0)) {\n\t\t\t\t\t\t$thisfile_riff['rgad']['album']['name']       = getid3_lib::RGADnameLookup($thisfile_riff_raw_rgad_album['name']);\n\t\t\t\t\t\t$thisfile_riff['rgad']['album']['originator'] = getid3_lib::RGADoriginatorLookup($thisfile_riff_raw_rgad_album['originator']);\n\t\t\t\t\t\t$thisfile_riff['rgad']['album']['adjustment'] = getid3_lib::RGADadjustmentLookup($thisfile_riff_raw_rgad_album['adjustment'], $thisfile_riff_raw_rgad_album['signbit']);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (isset($thisfile_riff_WAVE['fact'][0]['data'])) {\n\t\t\t\t\t$thisfile_riff_raw['fact']['NumberOfSamples'] = $this->EitherEndian2Int(substr($thisfile_riff_WAVE['fact'][0]['data'], 0, 4));\n\n\t\t\t\t\t// This should be a good way of calculating exact playtime,\n\t\t\t\t\t// but some sample files have had incorrect number of samples,\n\t\t\t\t\t// so cannot use this method\n\n\t\t\t\t\t// if (!empty($thisfile_riff_raw['fmt ']['nSamplesPerSec'])) {\n\t\t\t\t\t//     $info['playtime_seconds'] = (float) $thisfile_riff_raw['fact']['NumberOfSamples'] / $thisfile_riff_raw['fmt ']['nSamplesPerSec'];\n\t\t\t\t\t// }\n\t\t\t\t}\n\t\t\t\tif (!empty($thisfile_riff_raw['fmt ']['nAvgBytesPerSec'])) {\n\t\t\t\t\t$thisfile_audio['bitrate'] = getid3_lib::CastAsInt($thisfile_riff_raw['fmt ']['nAvgBytesPerSec'] * 8);\n\t\t\t\t}\n\n\t\t\t\tif (isset($thisfile_riff_WAVE['bext'][0]['data'])) {\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_riff_WAVE_bext_0 = &$thisfile_riff_WAVE['bext'][0];\n\n\t\t\t\t\t$thisfile_riff_WAVE_bext_0['title']          =                         trim(substr($thisfile_riff_WAVE_bext_0['data'],   0, 256));\n\t\t\t\t\t$thisfile_riff_WAVE_bext_0['author']         =                         trim(substr($thisfile_riff_WAVE_bext_0['data'], 256,  32));\n\t\t\t\t\t$thisfile_riff_WAVE_bext_0['reference']      =                         trim(substr($thisfile_riff_WAVE_bext_0['data'], 288,  32));\n\t\t\t\t\t$thisfile_riff_WAVE_bext_0['origin_date']    =                              substr($thisfile_riff_WAVE_bext_0['data'], 320,  10);\n\t\t\t\t\t$thisfile_riff_WAVE_bext_0['origin_time']    =                              substr($thisfile_riff_WAVE_bext_0['data'], 330,   8);\n\t\t\t\t\t$thisfile_riff_WAVE_bext_0['time_reference'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_bext_0['data'], 338,   8));\n\t\t\t\t\t$thisfile_riff_WAVE_bext_0['bwf_version']    = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_bext_0['data'], 346,   1));\n\t\t\t\t\t$thisfile_riff_WAVE_bext_0['reserved']       =                              substr($thisfile_riff_WAVE_bext_0['data'], 347, 254);\n\t\t\t\t\t$thisfile_riff_WAVE_bext_0['coding_history'] =         explode(\"\\r\\n\", trim(substr($thisfile_riff_WAVE_bext_0['data'], 601)));\n\t\t\t\t\tif (preg_match('#^([0-9]{4}).([0-9]{2}).([0-9]{2})$#', $thisfile_riff_WAVE_bext_0['origin_date'], $matches_bext_date)) {\n\t\t\t\t\t\tif (preg_match('#^([0-9]{2}).([0-9]{2}).([0-9]{2})$#', $thisfile_riff_WAVE_bext_0['origin_time'], $matches_bext_time)) {\n\t\t\t\t\t\t\tlist($dummy, $bext_timestamp['year'], $bext_timestamp['month'],  $bext_timestamp['day'])    = $matches_bext_date;\n\t\t\t\t\t\t\tlist($dummy, $bext_timestamp['hour'], $bext_timestamp['minute'], $bext_timestamp['second']) = $matches_bext_time;\n\t\t\t\t\t\t\t$thisfile_riff_WAVE_bext_0['origin_date_unix'] = gmmktime($bext_timestamp['hour'], $bext_timestamp['minute'], $bext_timestamp['second'], $bext_timestamp['month'], $bext_timestamp['day'], $bext_timestamp['year']);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->warning('RIFF.WAVE.BEXT.origin_time is invalid');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('RIFF.WAVE.BEXT.origin_date is invalid');\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_riff['comments']['author'][] = $thisfile_riff_WAVE_bext_0['author'];\n\t\t\t\t\t$thisfile_riff['comments']['title'][]  = $thisfile_riff_WAVE_bext_0['title'];\n\t\t\t\t}\n\n\t\t\t\tif (isset($thisfile_riff_WAVE['MEXT'][0]['data'])) {\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_riff_WAVE_MEXT_0 = &$thisfile_riff_WAVE['MEXT'][0];\n\n\t\t\t\t\t$thisfile_riff_WAVE_MEXT_0['raw']['sound_information']      = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_MEXT_0['data'], 0, 2));\n\t\t\t\t\t$thisfile_riff_WAVE_MEXT_0['flags']['homogenous']           = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] & 0x0001);\n\t\t\t\t\tif ($thisfile_riff_WAVE_MEXT_0['flags']['homogenous']) {\n\t\t\t\t\t\t$thisfile_riff_WAVE_MEXT_0['flags']['padding']          = ($thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] & 0x0002) ? false : true;\n\t\t\t\t\t\t$thisfile_riff_WAVE_MEXT_0['flags']['22_or_44']         =        (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] & 0x0004);\n\t\t\t\t\t\t$thisfile_riff_WAVE_MEXT_0['flags']['free_format']      =        (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] & 0x0008);\n\n\t\t\t\t\t\t$thisfile_riff_WAVE_MEXT_0['nominal_frame_size']        = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_MEXT_0['data'], 2, 2));\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_riff_WAVE_MEXT_0['anciliary_data_length']         = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_MEXT_0['data'], 6, 2));\n\t\t\t\t\t$thisfile_riff_WAVE_MEXT_0['raw']['anciliary_data_def']     = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_MEXT_0['data'], 8, 2));\n\t\t\t\t\t$thisfile_riff_WAVE_MEXT_0['flags']['anciliary_data_left']  = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['anciliary_data_def'] & 0x0001);\n\t\t\t\t\t$thisfile_riff_WAVE_MEXT_0['flags']['anciliary_data_free']  = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['anciliary_data_def'] & 0x0002);\n\t\t\t\t\t$thisfile_riff_WAVE_MEXT_0['flags']['anciliary_data_right'] = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['anciliary_data_def'] & 0x0004);\n\t\t\t\t}\n\n\t\t\t\tif (isset($thisfile_riff_WAVE['cart'][0]['data'])) {\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0 = &$thisfile_riff_WAVE['cart'][0];\n\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['version']              =                              substr($thisfile_riff_WAVE_cart_0['data'],   0,  4);\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['title']                =                         trim(substr($thisfile_riff_WAVE_cart_0['data'],   4, 64));\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['artist']               =                         trim(substr($thisfile_riff_WAVE_cart_0['data'],  68, 64));\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['cut_id']               =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 132, 64));\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['client_id']            =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 196, 64));\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['category']             =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 260, 64));\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['classification']       =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 324, 64));\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['out_cue']              =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 388, 64));\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['start_date']           =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 452, 10));\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['start_time']           =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 462,  8));\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['end_date']             =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 470, 10));\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['end_time']             =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 480,  8));\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['producer_app_id']      =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 488, 64));\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['producer_app_version'] =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 552, 64));\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['user_defined_text']    =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 616, 64));\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['zero_db_reference']    = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_cart_0['data'], 680,  4), true);\n\t\t\t\t\tfor ($i = 0; $i < 8; $i++) {\n\t\t\t\t\t\t$thisfile_riff_WAVE_cart_0['post_time'][$i]['usage_fourcc'] =                  substr($thisfile_riff_WAVE_cart_0['data'], 684 + ($i * 8), 4);\n\t\t\t\t\t\t$thisfile_riff_WAVE_cart_0['post_time'][$i]['timer_value']  = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_cart_0['data'], 684 + ($i * 8) + 4, 4));\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['url']              =                 trim(substr($thisfile_riff_WAVE_cart_0['data'],  748, 1024));\n\t\t\t\t\t$thisfile_riff_WAVE_cart_0['tag_text']         = explode(\"\\r\\n\", trim(substr($thisfile_riff_WAVE_cart_0['data'], 1772)));\n\t\t\t\t\t$thisfile_riff['comments']['tag_text'][]       =                      substr($thisfile_riff_WAVE_cart_0['data'], 1772);\n\n\t\t\t\t\t$thisfile_riff['comments']['artist'][] = $thisfile_riff_WAVE_cart_0['artist'];\n\t\t\t\t\t$thisfile_riff['comments']['title'][]  = $thisfile_riff_WAVE_cart_0['title'];\n\t\t\t\t}\n\n\t\t\t\tif (isset($thisfile_riff_WAVE['SNDM'][0]['data'])) {\n\t\t\t\t\t// SoundMiner metadata\n\n\t\t\t\t\t// shortcuts\n\t\t\t\t\t$thisfile_riff_WAVE_SNDM_0      = &$thisfile_riff_WAVE['SNDM'][0];\n\t\t\t\t\t$thisfile_riff_WAVE_SNDM_0_data = &$thisfile_riff_WAVE_SNDM_0['data'];\n\t\t\t\t\t$SNDM_startoffset = 0;\n\t\t\t\t\t$SNDM_endoffset   = $thisfile_riff_WAVE_SNDM_0['size'];\n\n\t\t\t\t\twhile ($SNDM_startoffset < $SNDM_endoffset) {\n\t\t\t\t\t\t$SNDM_thisTagOffset = 0;\n\t\t\t\t\t\t$SNDM_thisTagSize      = getid3_lib::BigEndian2Int(substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, 4));\n\t\t\t\t\t\t$SNDM_thisTagOffset += 4;\n\t\t\t\t\t\t$SNDM_thisTagKey       =                           substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, 4);\n\t\t\t\t\t\t$SNDM_thisTagOffset += 4;\n\t\t\t\t\t\t$SNDM_thisTagDataSize  = getid3_lib::BigEndian2Int(substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, 2));\n\t\t\t\t\t\t$SNDM_thisTagOffset += 2;\n\t\t\t\t\t\t$SNDM_thisTagDataFlags = getid3_lib::BigEndian2Int(substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, 2));\n\t\t\t\t\t\t$SNDM_thisTagOffset += 2;\n\t\t\t\t\t\t$SNDM_thisTagDataText =                            substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, $SNDM_thisTagDataSize);\n\t\t\t\t\t\t$SNDM_thisTagOffset += $SNDM_thisTagDataSize;\n\n\t\t\t\t\t\tif ($SNDM_thisTagSize != (4 + 4 + 2 + 2 + $SNDM_thisTagDataSize)) {\n\t\t\t\t\t\t\t$this->warning('RIFF.WAVE.SNDM.data contains tag not expected length (expected: '.$SNDM_thisTagSize.', found: '.(4 + 4 + 2 + 2 + $SNDM_thisTagDataSize).') at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} elseif ($SNDM_thisTagSize <= 0) {\n\t\t\t\t\t\t\t$this->warning('RIFF.WAVE.SNDM.data contains zero-size tag at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$SNDM_startoffset += $SNDM_thisTagSize;\n\n\t\t\t\t\t\t$thisfile_riff_WAVE_SNDM_0['parsed_raw'][$SNDM_thisTagKey] = $SNDM_thisTagDataText;\n\t\t\t\t\t\tif ($parsedkey = self::waveSNDMtagLookup($SNDM_thisTagKey)) {\n\t\t\t\t\t\t\t$thisfile_riff_WAVE_SNDM_0['parsed'][$parsedkey] = $SNDM_thisTagDataText;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->warning('RIFF.WAVE.SNDM contains unknown tag \"'.$SNDM_thisTagKey.'\" at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$tagmapping = array(\n\t\t\t\t\t\t'tracktitle'=>'title',\n\t\t\t\t\t\t'category'  =>'genre',\n\t\t\t\t\t\t'cdtitle'   =>'album',\n\t\t\t\t\t);\n\t\t\t\t\tforeach ($tagmapping as $fromkey => $tokey) {\n\t\t\t\t\t\tif (isset($thisfile_riff_WAVE_SNDM_0['parsed'][$fromkey])) {\n\t\t\t\t\t\t\t$thisfile_riff['comments'][$tokey][] = $thisfile_riff_WAVE_SNDM_0['parsed'][$fromkey];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (isset($thisfile_riff_WAVE['iXML'][0]['data'])) {\n\t\t\t\t\t// requires functions simplexml_load_string and get_object_vars\n\t\t\t\t\tif ($parsedXML = getid3_lib::XML2array($thisfile_riff_WAVE['iXML'][0]['data'])) {\n\t\t\t\t\t\t$thisfile_riff_WAVE['iXML'][0]['parsed'] = $parsedXML;\n\t\t\t\t\t\tif (isset($parsedXML['SPEED']['MASTER_SPEED'])) {\n\t\t\t\t\t\t\t@list($numerator, $denominator) = explode('/', $parsedXML['SPEED']['MASTER_SPEED']);\n\t\t\t\t\t\t\t$thisfile_riff_WAVE['iXML'][0]['master_speed'] = $numerator / ($denominator ? $denominator : 1000);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($parsedXML['SPEED']['TIMECODE_RATE'])) {\n\t\t\t\t\t\t\t@list($numerator, $denominator) = explode('/', $parsedXML['SPEED']['TIMECODE_RATE']);\n\t\t\t\t\t\t\t$thisfile_riff_WAVE['iXML'][0]['timecode_rate'] = $numerator / ($denominator ? $denominator : 1000);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($parsedXML['SPEED']['TIMESTAMP_SAMPLES_SINCE_MIDNIGHT_LO']) && !empty($parsedXML['SPEED']['TIMESTAMP_SAMPLE_RATE']) && !empty($thisfile_riff_WAVE['iXML'][0]['timecode_rate'])) {\n\t\t\t\t\t\t\t$samples_since_midnight = floatval(ltrim($parsedXML['SPEED']['TIMESTAMP_SAMPLES_SINCE_MIDNIGHT_HI'].$parsedXML['SPEED']['TIMESTAMP_SAMPLES_SINCE_MIDNIGHT_LO'], '0'));\n\t\t\t\t\t\t\t$timestamp_sample_rate = (is_array($parsedXML['SPEED']['TIMESTAMP_SAMPLE_RATE']) ? max($parsedXML['SPEED']['TIMESTAMP_SAMPLE_RATE']) : $parsedXML['SPEED']['TIMESTAMP_SAMPLE_RATE']); // XML could possibly contain more than one TIMESTAMP_SAMPLE_RATE tag, returning as array instead of integer [why? does it make sense? perhaps doesn't matter but getID3 needs to deal with it] - see https://github.com/JamesHeinrich/getID3/issues/105\n\t\t\t\t\t\t\t$thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] = $samples_since_midnight / $timestamp_sample_rate;\n\t\t\t\t\t\t\t$h = floor( $thisfile_riff_WAVE['iXML'][0]['timecode_seconds']       / 3600);\n\t\t\t\t\t\t\t$m = floor(($thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] - ($h * 3600))      / 60);\n\t\t\t\t\t\t\t$s = floor( $thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] - ($h * 3600) - ($m * 60));\n\t\t\t\t\t\t\t$f =       ($thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] - ($h * 3600) - ($m * 60) - $s) * $thisfile_riff_WAVE['iXML'][0]['timecode_rate'];\n\t\t\t\t\t\t\t$thisfile_riff_WAVE['iXML'][0]['timecode_string']       = sprintf('%02d:%02d:%02d:%05.2f', $h, $m, $s,       $f);\n\t\t\t\t\t\t\t$thisfile_riff_WAVE['iXML'][0]['timecode_string_round'] = sprintf('%02d:%02d:%02d:%02d',   $h, $m, $s, round($f));\n\t\t\t\t\t\t\tunset($samples_since_midnight, $timestamp_sample_rate, $h, $m, $s, $f);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($parsedXML);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\n\t\t\t\tif (!isset($thisfile_audio['bitrate']) && isset($thisfile_riff_audio[$streamindex]['bitrate'])) {\n\t\t\t\t\t$thisfile_audio['bitrate'] = $thisfile_riff_audio[$streamindex]['bitrate'];\n\t\t\t\t\t$info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) / $thisfile_audio['bitrate']);\n\t\t\t\t}\n\n\t\t\t\tif (!empty($info['wavpack'])) {\n\t\t\t\t\t$thisfile_audio_dataformat = 'wavpack';\n\t\t\t\t\t$thisfile_audio['bitrate_mode'] = 'vbr';\n\t\t\t\t\t$thisfile_audio['encoder']      = 'WavPack v'.$info['wavpack']['version'];\n\n\t\t\t\t\t// Reset to the way it was - RIFF parsing will have messed this up\n\t\t\t\t\t$info['avdataend']        = $Original['avdataend'];\n\t\t\t\t\t$thisfile_audio['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds'];\n\n\t\t\t\t\t$this->fseek($info['avdataoffset'] - 44);\n\t\t\t\t\t$RIFFdata = $this->fread(44);\n\t\t\t\t\t$OrignalRIFFheaderSize = getid3_lib::LittleEndian2Int(substr($RIFFdata,  4, 4)) +  8;\n\t\t\t\t\t$OrignalRIFFdataSize   = getid3_lib::LittleEndian2Int(substr($RIFFdata, 40, 4)) + 44;\n\n\t\t\t\t\tif ($OrignalRIFFheaderSize > $OrignalRIFFdataSize) {\n\t\t\t\t\t\t$info['avdataend'] -= ($OrignalRIFFheaderSize - $OrignalRIFFdataSize);\n\t\t\t\t\t\t$this->fseek($info['avdataend']);\n\t\t\t\t\t\t$RIFFdata .= $this->fread($OrignalRIFFheaderSize - $OrignalRIFFdataSize);\n\t\t\t\t\t}\n\n\t\t\t\t\t// move the data chunk after all other chunks (if any)\n\t\t\t\t\t// so that the RIFF parser doesn't see EOF when trying\n\t\t\t\t\t// to skip over the data chunk\n\t\t\t\t\t$RIFFdata = substr($RIFFdata, 0, 36).substr($RIFFdata, 44).substr($RIFFdata, 36, 8);\n\t\t\t\t\t$getid3_riff = new getid3_riff($this->getid3);\n\t\t\t\t\t$getid3_riff->ParseRIFFdata($RIFFdata);\n\t\t\t\t\tunset($getid3_riff);\n\t\t\t\t}\n\n\t\t\t\tif (isset($thisfile_riff_raw['fmt ']['wFormatTag'])) {\n\t\t\t\t\tswitch ($thisfile_riff_raw['fmt ']['wFormatTag']) {\n\t\t\t\t\t\tcase 0x0001: // PCM\n\t\t\t\t\t\t\tif (!empty($info['ac3'])) {\n\t\t\t\t\t\t\t\t// Dolby Digital WAV files masquerade as PCM-WAV, but they're not\n\t\t\t\t\t\t\t\t$thisfile_audio['wformattag']  = 0x2000;\n\t\t\t\t\t\t\t\t$thisfile_audio['codec']       = self::wFormatTagLookup($thisfile_audio['wformattag']);\n\t\t\t\t\t\t\t\t$thisfile_audio['lossless']    = false;\n\t\t\t\t\t\t\t\t$thisfile_audio['bitrate']     = $info['ac3']['bitrate'];\n\t\t\t\t\t\t\t\t$thisfile_audio['sample_rate'] = $info['ac3']['sample_rate'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!empty($info['dts'])) {\n\t\t\t\t\t\t\t\t// Dolby DTS files masquerade as PCM-WAV, but they're not\n\t\t\t\t\t\t\t\t$thisfile_audio['wformattag']  = 0x2001;\n\t\t\t\t\t\t\t\t$thisfile_audio['codec']       = self::wFormatTagLookup($thisfile_audio['wformattag']);\n\t\t\t\t\t\t\t\t$thisfile_audio['lossless']    = false;\n\t\t\t\t\t\t\t\t$thisfile_audio['bitrate']     = $info['dts']['bitrate'];\n\t\t\t\t\t\t\t\t$thisfile_audio['sample_rate'] = $info['dts']['sample_rate'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 0x08AE: // ClearJump LiteWave\n\t\t\t\t\t\t\t$thisfile_audio['bitrate_mode'] = 'vbr';\n\t\t\t\t\t\t\t$thisfile_audio_dataformat   = 'litewave';\n\n\t\t\t\t\t\t\t//typedef struct tagSLwFormat {\n\t\t\t\t\t\t\t//  WORD    m_wCompFormat;     // low byte defines compression method, high byte is compression flags\n\t\t\t\t\t\t\t//  DWORD   m_dwScale;         // scale factor for lossy compression\n\t\t\t\t\t\t\t//  DWORD   m_dwBlockSize;     // number of samples in encoded blocks\n\t\t\t\t\t\t\t//  WORD    m_wQuality;        // alias for the scale factor\n\t\t\t\t\t\t\t//  WORD    m_wMarkDistance;   // distance between marks in bytes\n\t\t\t\t\t\t\t//  WORD    m_wReserved;\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t//  //following paramters are ignored if CF_FILESRC is not set\n\t\t\t\t\t\t\t//  DWORD   m_dwOrgSize;       // original file size in bytes\n\t\t\t\t\t\t\t//  WORD    m_bFactExists;     // indicates if 'fact' chunk exists in the original file\n\t\t\t\t\t\t\t//  DWORD   m_dwRiffChunkSize; // riff chunk size in the original file\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t//  PCMWAVEFORMAT m_OrgWf;     // original wave format\n\t\t\t\t\t\t\t// }SLwFormat, *PSLwFormat;\n\n\t\t\t\t\t\t\t// shortcut\n\t\t\t\t\t\t\t$thisfile_riff['litewave']['raw'] = array();\n\t\t\t\t\t\t\t$riff_litewave     = &$thisfile_riff['litewave'];\n\t\t\t\t\t\t\t$riff_litewave_raw = &$riff_litewave['raw'];\n\n\t\t\t\t\t\t\t$flags = array(\n\t\t\t\t\t\t\t\t'compression_method' => 1,\n\t\t\t\t\t\t\t\t'compression_flags'  => 1,\n\t\t\t\t\t\t\t\t'm_dwScale'          => 4,\n\t\t\t\t\t\t\t\t'm_dwBlockSize'      => 4,\n\t\t\t\t\t\t\t\t'm_wQuality'         => 2,\n\t\t\t\t\t\t\t\t'm_wMarkDistance'    => 2,\n\t\t\t\t\t\t\t\t'm_wReserved'        => 2,\n\t\t\t\t\t\t\t\t'm_dwOrgSize'        => 4,\n\t\t\t\t\t\t\t\t'm_bFactExists'      => 2,\n\t\t\t\t\t\t\t\t'm_dwRiffChunkSize'  => 4,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$litewave_offset = 18;\n\t\t\t\t\t\t\tforeach ($flags as $flag => $length) {\n\t\t\t\t\t\t\t\t$riff_litewave_raw[$flag] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE['fmt '][0]['data'], $litewave_offset, $length));\n\t\t\t\t\t\t\t\t$litewave_offset += $length;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//$riff_litewave['quality_factor'] = intval(round((2000 - $riff_litewave_raw['m_dwScale']) / 20));\n\t\t\t\t\t\t\t$riff_litewave['quality_factor'] = $riff_litewave_raw['m_wQuality'];\n\n\t\t\t\t\t\t\t$riff_litewave['flags']['raw_source']    = ($riff_litewave_raw['compression_flags'] & 0x01) ? false : true;\n\t\t\t\t\t\t\t$riff_litewave['flags']['vbr_blocksize'] = ($riff_litewave_raw['compression_flags'] & 0x02) ? false : true;\n\t\t\t\t\t\t\t$riff_litewave['flags']['seekpoints']    =        (bool) ($riff_litewave_raw['compression_flags'] & 0x04);\n\n\t\t\t\t\t\t\t$thisfile_audio['lossless']        = (($riff_litewave_raw['m_wQuality'] == 100) ? true : false);\n\t\t\t\t\t\t\t$thisfile_audio['encoder_options'] = '-q'.$riff_litewave['quality_factor'];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($info['avdataend'] > $info['filesize']) {\n\t\t\t\t\tswitch (!empty($thisfile_audio_dataformat) ? $thisfile_audio_dataformat : '') {\n\t\t\t\t\t\tcase 'wavpack': // WavPack\n\t\t\t\t\t\tcase 'lpac':    // LPAC\n\t\t\t\t\t\tcase 'ofr':     // OptimFROG\n\t\t\t\t\t\tcase 'ofs':     // OptimFROG DualStream\n\t\t\t\t\t\t\t// lossless compressed audio formats that keep original RIFF headers - skip warning\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'litewave':\n\t\t\t\t\t\t\tif (($info['avdataend'] - $info['filesize']) == 1) {\n\t\t\t\t\t\t\t\t// LiteWave appears to incorrectly *not* pad actual output file\n\t\t\t\t\t\t\t\t// to nearest WORD boundary so may appear to be short by one\n\t\t\t\t\t\t\t\t// byte, in which case - skip warning\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Short by more than one byte, throw warning\n\t\t\t\t\t\t\t\t$this->warning('Probably truncated file - expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)');\n\t\t\t\t\t\t\t\t$info['avdataend'] = $info['filesize'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif ((($info['avdataend'] - $info['filesize']) == 1) && (($thisfile_riff[$RIFFsubtype]['data'][0]['size'] % 2) == 0) && ((($info['filesize'] - $info['avdataoffset']) % 2) == 1)) {\n\t\t\t\t\t\t\t\t// output file appears to be incorrectly *not* padded to nearest WORD boundary\n\t\t\t\t\t\t\t\t// Output less severe warning\n\t\t\t\t\t\t\t\t$this->warning('File should probably be padded to nearest WORD boundary, but it is not (expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' therefore short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)');\n\t\t\t\t\t\t\t\t$info['avdataend'] = $info['filesize'];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Short by more than one byte, throw warning\n\t\t\t\t\t\t\t\t$this->warning('Probably truncated file - expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)');\n\t\t\t\t\t\t\t\t$info['avdataend'] = $info['filesize'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!empty($info['mpeg']['audio']['LAME']['audio_bytes'])) {\n\t\t\t\t\tif ((($info['avdataend'] - $info['avdataoffset']) - $info['mpeg']['audio']['LAME']['audio_bytes']) == 1) {\n\t\t\t\t\t\t$info['avdataend']--;\n\t\t\t\t\t\t$this->warning('Extra null byte at end of MP3 data assumed to be RIFF padding and therefore ignored');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isset($thisfile_audio_dataformat) && ($thisfile_audio_dataformat == 'ac3')) {\n\t\t\t\t\tunset($thisfile_audio['bits_per_sample']);\n\t\t\t\t\tif (!empty($info['ac3']['bitrate']) && ($info['ac3']['bitrate'] != $thisfile_audio['bitrate'])) {\n\t\t\t\t\t\t$thisfile_audio['bitrate'] = $info['ac3']['bitrate'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// http://en.wikipedia.org/wiki/Audio_Video_Interleave\n\t\t\tcase 'AVI ':\n\t\t\t\t$info['fileformat'] = 'avi';\n\t\t\t\t$info['mime_type']  = 'video/avi';\n\n\t\t\t\t$thisfile_video['bitrate_mode'] = 'vbr'; // maybe not, but probably\n\t\t\t\t$thisfile_video['dataformat']   = 'avi';\n\n\t\t\t\t$thisfile_riff_video_current = array();\n\n\t\t\t\tif (isset($thisfile_riff[$RIFFsubtype]['movi']['offset'])) {\n\t\t\t\t\t$info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['movi']['offset'] + 8;\n\t\t\t\t\tif (isset($thisfile_riff['AVIX'])) {\n\t\t\t\t\t\t$info['avdataend'] = $thisfile_riff['AVIX'][(count($thisfile_riff['AVIX']) - 1)]['chunks']['movi']['offset'] + $thisfile_riff['AVIX'][(count($thisfile_riff['AVIX']) - 1)]['chunks']['movi']['size'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$info['avdataend'] = $thisfile_riff['AVI ']['movi']['offset'] + $thisfile_riff['AVI ']['movi']['size'];\n\t\t\t\t\t}\n\t\t\t\t\tif ($info['avdataend'] > $info['filesize']) {\n\t\t\t\t\t\t$this->warning('Probably truncated file - expecting '.($info['avdataend'] - $info['avdataoffset']).' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($info['avdataend'] - $info['filesize']).' bytes)');\n\t\t\t\t\t\t$info['avdataend'] = $info['filesize'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (isset($thisfile_riff['AVI ']['hdrl']['strl']['indx'])) {\n\t\t\t\t\t//$bIndexType = array(\n\t\t\t\t\t//\t0x00 => 'AVI_INDEX_OF_INDEXES',\n\t\t\t\t\t//\t0x01 => 'AVI_INDEX_OF_CHUNKS',\n\t\t\t\t\t//\t0x80 => 'AVI_INDEX_IS_DATA',\n\t\t\t\t\t//);\n\t\t\t\t\t//$bIndexSubtype = array(\n\t\t\t\t\t//\t0x01 => array(\n\t\t\t\t\t//\t\t0x01 => 'AVI_INDEX_2FIELD',\n\t\t\t\t\t//\t),\n\t\t\t\t\t//);\n\t\t\t\t\tforeach ($thisfile_riff['AVI ']['hdrl']['strl']['indx'] as $streamnumber => $steamdataarray) {\n\t\t\t\t\t\t$ahsisd = &$thisfile_riff['AVI ']['hdrl']['strl']['indx'][$streamnumber]['data'];\n\n\t\t\t\t\t\t$thisfile_riff_raw['indx'][$streamnumber]['wLongsPerEntry'] = $this->EitherEndian2Int(substr($ahsisd,  0, 2));\n\t\t\t\t\t\t$thisfile_riff_raw['indx'][$streamnumber]['bIndexSubType']  = $this->EitherEndian2Int(substr($ahsisd,  2, 1));\n\t\t\t\t\t\t$thisfile_riff_raw['indx'][$streamnumber]['bIndexType']     = $this->EitherEndian2Int(substr($ahsisd,  3, 1));\n\t\t\t\t\t\t$thisfile_riff_raw['indx'][$streamnumber]['nEntriesInUse']  = $this->EitherEndian2Int(substr($ahsisd,  4, 4));\n\t\t\t\t\t\t$thisfile_riff_raw['indx'][$streamnumber]['dwChunkId']      =                         substr($ahsisd,  8, 4);\n\t\t\t\t\t\t$thisfile_riff_raw['indx'][$streamnumber]['dwReserved']     = $this->EitherEndian2Int(substr($ahsisd, 12, 4));\n\n\t\t\t\t\t\t//$thisfile_riff_raw['indx'][$streamnumber]['bIndexType_name']    =    $bIndexType[$thisfile_riff_raw['indx'][$streamnumber]['bIndexType']];\n\t\t\t\t\t\t//$thisfile_riff_raw['indx'][$streamnumber]['bIndexSubType_name'] = $bIndexSubtype[$thisfile_riff_raw['indx'][$streamnumber]['bIndexType']][$thisfile_riff_raw['indx'][$streamnumber]['bIndexSubType']];\n\n\t\t\t\t\t\tunset($ahsisd);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isset($thisfile_riff['AVI ']['hdrl']['avih'][$streamindex]['data'])) {\n\t\t\t\t\t$avihData = $thisfile_riff['AVI ']['hdrl']['avih'][$streamindex]['data'];\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_riff_raw['avih'] = array();\n\t\t\t\t\t$thisfile_riff_raw_avih = &$thisfile_riff_raw['avih'];\n\n\t\t\t\t\t$thisfile_riff_raw_avih['dwMicroSecPerFrame']    = $this->EitherEndian2Int(substr($avihData,  0, 4)); // frame display rate (or 0L)\n\t\t\t\t\tif ($thisfile_riff_raw_avih['dwMicroSecPerFrame'] == 0) {\n\t\t\t\t\t\t$this->error('Corrupt RIFF file: avih.dwMicroSecPerFrame == zero');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t$flags = array(\n\t\t\t\t\t\t'dwMaxBytesPerSec',       // max. transfer rate\n\t\t\t\t\t\t'dwPaddingGranularity',   // pad to multiples of this size; normally 2K.\n\t\t\t\t\t\t'dwFlags',                // the ever-present flags\n\t\t\t\t\t\t'dwTotalFrames',          // # frames in file\n\t\t\t\t\t\t'dwInitialFrames',        //\n\t\t\t\t\t\t'dwStreams',              //\n\t\t\t\t\t\t'dwSuggestedBufferSize',  //\n\t\t\t\t\t\t'dwWidth',                //\n\t\t\t\t\t\t'dwHeight',               //\n\t\t\t\t\t\t'dwScale',                //\n\t\t\t\t\t\t'dwRate',                 //\n\t\t\t\t\t\t'dwStart',                //\n\t\t\t\t\t\t'dwLength',               //\n\t\t\t\t\t);\n\t\t\t\t\t$avih_offset = 4;\n\t\t\t\t\tforeach ($flags as $flag) {\n\t\t\t\t\t\t$thisfile_riff_raw_avih[$flag] = $this->EitherEndian2Int(substr($avihData, $avih_offset, 4));\n\t\t\t\t\t\t$avih_offset += 4;\n\t\t\t\t\t}\n\n\t\t\t\t\t$flags = array(\n\t\t\t\t\t\t'hasindex'     => 0x00000010,\n\t\t\t\t\t\t'mustuseindex' => 0x00000020,\n\t\t\t\t\t\t'interleaved'  => 0x00000100,\n\t\t\t\t\t\t'trustcktype'  => 0x00000800,\n\t\t\t\t\t\t'capturedfile' => 0x00010000,\n\t\t\t\t\t\t'copyrighted'  => 0x00020010,\n\t\t\t\t\t);\n\t\t\t\t\tforeach ($flags as $flag => $value) {\n\t\t\t\t\t\t$thisfile_riff_raw_avih['flags'][$flag] = (bool) ($thisfile_riff_raw_avih['dwFlags'] & $value);\n\t\t\t\t\t}\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_riff_video[$streamindex] = array();\n\t\t\t\t\t/** @var array $thisfile_riff_video_current */\n\t\t\t\t\t$thisfile_riff_video_current = &$thisfile_riff_video[$streamindex];\n\n\t\t\t\t\tif ($thisfile_riff_raw_avih['dwWidth'] > 0) {\n\t\t\t\t\t\t$thisfile_riff_video_current['frame_width'] = $thisfile_riff_raw_avih['dwWidth'];\n\t\t\t\t\t\t$thisfile_video['resolution_x']             = $thisfile_riff_video_current['frame_width'];\n\t\t\t\t\t}\n\t\t\t\t\tif ($thisfile_riff_raw_avih['dwHeight'] > 0) {\n\t\t\t\t\t\t$thisfile_riff_video_current['frame_height'] = $thisfile_riff_raw_avih['dwHeight'];\n\t\t\t\t\t\t$thisfile_video['resolution_y']              = $thisfile_riff_video_current['frame_height'];\n\t\t\t\t\t}\n\t\t\t\t\tif ($thisfile_riff_raw_avih['dwTotalFrames'] > 0) {\n\t\t\t\t\t\t$thisfile_riff_video_current['total_frames'] = $thisfile_riff_raw_avih['dwTotalFrames'];\n\t\t\t\t\t\t$thisfile_video['total_frames']              = $thisfile_riff_video_current['total_frames'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$thisfile_riff_video_current['frame_rate'] = round(1000000 / $thisfile_riff_raw_avih['dwMicroSecPerFrame'], 3);\n\t\t\t\t\t$thisfile_video['frame_rate'] = $thisfile_riff_video_current['frame_rate'];\n\t\t\t\t}\n\t\t\t\tif (isset($thisfile_riff['AVI ']['hdrl']['strl']['strh'][0]['data'])) {\n\t\t\t\t\tif (is_array($thisfile_riff['AVI ']['hdrl']['strl']['strh'])) {\n\t\t\t\t\t\tfor ($i = 0; $i < count($thisfile_riff['AVI ']['hdrl']['strl']['strh']); $i++) {\n\t\t\t\t\t\t\tif (isset($thisfile_riff['AVI ']['hdrl']['strl']['strh'][$i]['data'])) {\n\t\t\t\t\t\t\t\t$strhData = $thisfile_riff['AVI ']['hdrl']['strl']['strh'][$i]['data'];\n\t\t\t\t\t\t\t\t$strhfccType = substr($strhData,  0, 4);\n\n\t\t\t\t\t\t\t\tif (isset($thisfile_riff['AVI ']['hdrl']['strl']['strf'][$i]['data'])) {\n\t\t\t\t\t\t\t\t\t$strfData = $thisfile_riff['AVI ']['hdrl']['strl']['strf'][$i]['data'];\n\n\t\t\t\t\t\t\t\t\t// shortcut\n\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strf_strhfccType_streamindex = &$thisfile_riff_raw['strf'][$strhfccType][$streamindex];\n\n\t\t\t\t\t\t\t\t\tswitch ($strhfccType) {\n\t\t\t\t\t\t\t\t\t\tcase 'auds':\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio['bitrate_mode'] = 'cbr';\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio_dataformat      = 'wav';\n\t\t\t\t\t\t\t\t\t\t\tif (isset($thisfile_riff_audio) && is_array($thisfile_riff_audio)) {\n\t\t\t\t\t\t\t\t\t\t\t\t$streamindex = count($thisfile_riff_audio);\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_audio[$streamindex] = self::parseWAVEFORMATex($strfData);\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio['wformattag'] = $thisfile_riff_audio[$streamindex]['raw']['wFormatTag'];\n\n\t\t\t\t\t\t\t\t\t\t\t// shortcut\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio['streams'][$streamindex] = $thisfile_riff_audio[$streamindex];\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio_streams_currentstream = &$thisfile_audio['streams'][$streamindex];\n\n\t\t\t\t\t\t\t\t\t\t\tif ($thisfile_audio_streams_currentstream['bits_per_sample'] == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\tunset($thisfile_audio_streams_currentstream['bits_per_sample']);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio_streams_currentstream['wformattag'] = $thisfile_audio_streams_currentstream['raw']['wFormatTag'];\n\t\t\t\t\t\t\t\t\t\t\tunset($thisfile_audio_streams_currentstream['raw']);\n\n\t\t\t\t\t\t\t\t\t\t\t// shortcut\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw['strf'][$strhfccType][$streamindex] = $thisfile_riff_audio[$streamindex]['raw'];\n\n\t\t\t\t\t\t\t\t\t\t\tunset($thisfile_riff_audio[$streamindex]['raw']);\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio = getid3_lib::array_merge_noclobber($thisfile_audio, $thisfile_riff_audio[$streamindex]);\n\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio['lossless'] = false;\n\t\t\t\t\t\t\t\t\t\t\tswitch ($thisfile_riff_raw_strf_strhfccType_streamindex['wFormatTag']) {\n\t\t\t\t\t\t\t\t\t\t\t\tcase 0x0001:  // PCM\n\t\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio_dataformat  = 'wav';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio['lossless'] = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\tcase 0x0050: // MPEG Layer 2 or Layer 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio_dataformat = 'mp2'; // Assume Layer-2\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\tcase 0x0055: // MPEG Layer 3\n\t\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio_dataformat = 'mp3';\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\tcase 0x00FF: // AAC\n\t\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio_dataformat = 'aac';\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\tcase 0x0161: // Windows Media v7 / v8 / v9\n\t\t\t\t\t\t\t\t\t\t\t\tcase 0x0162: // Windows Media Professional v9\n\t\t\t\t\t\t\t\t\t\t\t\tcase 0x0163: // Windows Media Lossess v9\n\t\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio_dataformat = 'wma';\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\tcase 0x2000: // AC-3\n\t\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio_dataformat = 'ac3';\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\tcase 0x2001: // DTS\n\t\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio_dataformat = 'dts';\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio_dataformat = 'wav';\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio_streams_currentstream['dataformat']   = $thisfile_audio_dataformat;\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio_streams_currentstream['lossless']     = $thisfile_audio['lossless'];\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_audio_streams_currentstream['bitrate_mode'] = $thisfile_audio['bitrate_mode'];\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\n\t\t\t\t\t\t\t\t\t\tcase 'iavs':\n\t\t\t\t\t\t\t\t\t\tcase 'vids':\n\t\t\t\t\t\t\t\t\t\t\t// shortcut\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw['strh'][$i]                  = array();\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strh_current                 = &$thisfile_riff_raw['strh'][$i];\n\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strh_current['fccType']               =                         substr($strhData,  0, 4);  // same as $strhfccType;\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strh_current['fccHandler']            =                         substr($strhData,  4, 4);\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strh_current['dwFlags']               = $this->EitherEndian2Int(substr($strhData,  8, 4)); // Contains AVITF_* flags\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strh_current['wPriority']             = $this->EitherEndian2Int(substr($strhData, 12, 2));\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strh_current['wLanguage']             = $this->EitherEndian2Int(substr($strhData, 14, 2));\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strh_current['dwInitialFrames']       = $this->EitherEndian2Int(substr($strhData, 16, 4));\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strh_current['dwScale']               = $this->EitherEndian2Int(substr($strhData, 20, 4));\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strh_current['dwRate']                = $this->EitherEndian2Int(substr($strhData, 24, 4));\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strh_current['dwStart']               = $this->EitherEndian2Int(substr($strhData, 28, 4));\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strh_current['dwLength']              = $this->EitherEndian2Int(substr($strhData, 32, 4));\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strh_current['dwSuggestedBufferSize'] = $this->EitherEndian2Int(substr($strhData, 36, 4));\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strh_current['dwQuality']             = $this->EitherEndian2Int(substr($strhData, 40, 4));\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strh_current['dwSampleSize']          = $this->EitherEndian2Int(substr($strhData, 44, 4));\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strh_current['rcFrame']               = $this->EitherEndian2Int(substr($strhData, 48, 4));\n\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_riff_raw_strh_current['fccHandler']);\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_video['fourcc']             = $thisfile_riff_raw_strh_current['fccHandler'];\n\t\t\t\t\t\t\t\t\t\t\tif (!$thisfile_riff_video_current['codec'] && isset($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']) && self::fourccLookup($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'])) {\n\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']);\n\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_video['fourcc']             = $thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'];\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_video['codec']              = $thisfile_riff_video_current['codec'];\n\t\t\t\t\t\t\t\t\t\t\t$thisfile_video['pixel_aspect_ratio'] = (float) 1;\n\t\t\t\t\t\t\t\t\t\t\tswitch ($thisfile_riff_raw_strh_current['fccHandler']) {\n\t\t\t\t\t\t\t\t\t\t\t\tcase 'HFYU': // Huffman Lossless Codec\n\t\t\t\t\t\t\t\t\t\t\t\tcase 'IRAW': // Intel YUV Uncompressed\n\t\t\t\t\t\t\t\t\t\t\t\tcase 'YUY2': // Uncompressed YUV 4:2:2\n\t\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_video['lossless'] = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_video['lossless'] = false;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tswitch ($strhfccType) {\n\t\t\t\t\t\t\t\t\t\t\t\tcase 'vids':\n\t\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_raw_strf_strhfccType_streamindex = self::ParseBITMAPINFOHEADER(substr($strfData, 0, 40), ($this->container == 'riff'));\n\t\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_video['bits_per_sample'] = $thisfile_riff_raw_strf_strhfccType_streamindex['biBitCount'];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($thisfile_riff_video_current['codec'] == 'DV') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_video_current['dv_type'] = 2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\t\t\tcase 'iavs':\n\t\t\t\t\t\t\t\t\t\t\t\t\t$thisfile_riff_video_current['dv_type'] = 1;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t$this->warning('Unhandled fccType for stream ('.$i.'): \"'.$strhfccType.'\"');\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\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}\n\n\t\t\t\t\t\t\tif (isset($thisfile_riff_raw_strf_strhfccType_streamindex) && isset($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'])) {\n\n\t\t\t\t\t\t\t\t$thisfile_video['fourcc'] = $thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'];\n\t\t\t\t\t\t\t\tif (self::fourccLookup($thisfile_video['fourcc'])) {\n\t\t\t\t\t\t\t\t\t$thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_video['fourcc']);\n\t\t\t\t\t\t\t\t\t$thisfile_video['codec']              = $thisfile_riff_video_current['codec'];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tswitch ($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']) {\n\t\t\t\t\t\t\t\t\tcase 'HFYU': // Huffman Lossless Codec\n\t\t\t\t\t\t\t\t\tcase 'IRAW': // Intel YUV Uncompressed\n\t\t\t\t\t\t\t\t\tcase 'YUY2': // Uncompressed YUV 4:2:2\n\t\t\t\t\t\t\t\t\t\t$thisfile_video['lossless']        = true;\n\t\t\t\t\t\t\t\t\t\t//$thisfile_video['bits_per_sample'] = 24;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t$thisfile_video['lossless']        = false;\n\t\t\t\t\t\t\t\t\t\t//$thisfile_video['bits_per_sample'] = 24;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\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\t\t\t\tbreak;\n\n\n\t\t\tcase 'AMV ':\n\t\t\t\t$info['fileformat'] = 'amv';\n\t\t\t\t$info['mime_type']  = 'video/amv';\n\n\t\t\t\t$thisfile_video['bitrate_mode']    = 'vbr'; // it's MJPEG, presumably contant-quality encoding, thereby VBR\n\t\t\t\t$thisfile_video['dataformat']      = 'mjpeg';\n\t\t\t\t$thisfile_video['codec']           = 'mjpeg';\n\t\t\t\t$thisfile_video['lossless']        = false;\n\t\t\t\t$thisfile_video['bits_per_sample'] = 24;\n\n\t\t\t\t$thisfile_audio['dataformat']   = 'adpcm';\n\t\t\t\t$thisfile_audio['lossless']     = false;\n\t\t\t\tbreak;\n\n\n\t\t\t// http://en.wikipedia.org/wiki/CD-DA\n\t\t\tcase 'CDDA':\n\t\t\t\t$info['fileformat'] = 'cda';\n\t\t\t\tunset($info['mime_type']);\n\n\t\t\t\t$thisfile_audio_dataformat      = 'cda';\n\n\t\t\t\t$info['avdataoffset'] = 44;\n\n\t\t\t\tif (isset($thisfile_riff['CDDA']['fmt '][0]['data'])) {\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_riff_CDDA_fmt_0 = &$thisfile_riff['CDDA']['fmt '][0];\n\n\t\t\t\t\t$thisfile_riff_CDDA_fmt_0['unknown1']           = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'],  0, 2));\n\t\t\t\t\t$thisfile_riff_CDDA_fmt_0['track_num']          = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'],  2, 2));\n\t\t\t\t\t$thisfile_riff_CDDA_fmt_0['disc_id']            = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'],  4, 4));\n\t\t\t\t\t$thisfile_riff_CDDA_fmt_0['start_offset_frame'] = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'],  8, 4));\n\t\t\t\t\t$thisfile_riff_CDDA_fmt_0['playtime_frames']    = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 12, 4));\n\t\t\t\t\t$thisfile_riff_CDDA_fmt_0['unknown6']           = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 16, 4));\n\t\t\t\t\t$thisfile_riff_CDDA_fmt_0['unknown7']           = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 20, 4));\n\n\t\t\t\t\t$thisfile_riff_CDDA_fmt_0['start_offset_seconds'] = (float) $thisfile_riff_CDDA_fmt_0['start_offset_frame'] / 75;\n\t\t\t\t\t$thisfile_riff_CDDA_fmt_0['playtime_seconds']     = (float) $thisfile_riff_CDDA_fmt_0['playtime_frames'] / 75;\n\t\t\t\t\t$info['comments']['track_number']         = $thisfile_riff_CDDA_fmt_0['track_num'];\n\t\t\t\t\t$info['playtime_seconds']                 = $thisfile_riff_CDDA_fmt_0['playtime_seconds'];\n\n\t\t\t\t\t// hardcoded data for CD-audio\n\t\t\t\t\t$thisfile_audio['lossless']        = true;\n\t\t\t\t\t$thisfile_audio['sample_rate']     = 44100;\n\t\t\t\t\t$thisfile_audio['channels']        = 2;\n\t\t\t\t\t$thisfile_audio['bits_per_sample'] = 16;\n\t\t\t\t\t$thisfile_audio['bitrate']         = $thisfile_audio['sample_rate'] * $thisfile_audio['channels'] * $thisfile_audio['bits_per_sample'];\n\t\t\t\t\t$thisfile_audio['bitrate_mode']    = 'cbr';\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// http://en.wikipedia.org/wiki/AIFF\n\t\t\tcase 'AIFF':\n\t\t\tcase 'AIFC':\n\t\t\t\t$info['fileformat'] = 'aiff';\n\t\t\t\t$info['mime_type']  = 'audio/x-aiff';\n\n\t\t\t\t$thisfile_audio['bitrate_mode'] = 'cbr';\n\t\t\t\t$thisfile_audio_dataformat      = 'aiff';\n\t\t\t\t$thisfile_audio['lossless']     = true;\n\n\t\t\t\tif (isset($thisfile_riff[$RIFFsubtype]['SSND'][0]['offset'])) {\n\t\t\t\t\t$info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['SSND'][0]['offset'] + 8;\n\t\t\t\t\t$info['avdataend']    = $info['avdataoffset'] + $thisfile_riff[$RIFFsubtype]['SSND'][0]['size'];\n\t\t\t\t\tif ($info['avdataend'] > $info['filesize']) {\n\t\t\t\t\t\tif (($info['avdataend'] == ($info['filesize'] + 1)) && (($info['filesize'] % 2) == 1)) {\n\t\t\t\t\t\t\t// structures rounded to 2-byte boundary, but dumb encoders\n\t\t\t\t\t\t\t// forget to pad end of file to make this actually work\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->warning('Probable truncated AIFF file: expecting '.$thisfile_riff[$RIFFsubtype]['SSND'][0]['size'].' bytes of audio data, only '.($info['filesize'] - $info['avdataoffset']).' bytes found');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$info['avdataend'] = $info['filesize'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (isset($thisfile_riff[$RIFFsubtype]['COMM'][0]['data'])) {\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_riff_RIFFsubtype_COMM_0_data = &$thisfile_riff[$RIFFsubtype]['COMM'][0]['data'];\n\n\t\t\t\t\t$thisfile_riff_audio['channels']         =         getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_COMM_0_data,  0,  2), true);\n\t\t\t\t\t$thisfile_riff_audio['total_samples']    =         getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_COMM_0_data,  2,  4), false);\n\t\t\t\t\t$thisfile_riff_audio['bits_per_sample']  =         getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_COMM_0_data,  6,  2), true);\n\t\t\t\t\t$thisfile_riff_audio['sample_rate']      = (int) getid3_lib::BigEndian2Float(substr($thisfile_riff_RIFFsubtype_COMM_0_data,  8, 10));\n\n\t\t\t\t\tif ($thisfile_riff[$RIFFsubtype]['COMM'][0]['size'] > 18) {\n\t\t\t\t\t\t$thisfile_riff_audio['codec_fourcc'] =                                   substr($thisfile_riff_RIFFsubtype_COMM_0_data, 18,  4);\n\t\t\t\t\t\t$CodecNameSize                       =         getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_COMM_0_data, 22,  1), false);\n\t\t\t\t\t\t$thisfile_riff_audio['codec_name']   =                                   substr($thisfile_riff_RIFFsubtype_COMM_0_data, 23,  $CodecNameSize);\n\t\t\t\t\t\tswitch ($thisfile_riff_audio['codec_name']) {\n\t\t\t\t\t\t\tcase 'NONE':\n\t\t\t\t\t\t\t\t$thisfile_audio['codec']    = 'Pulse Code Modulation (PCM)';\n\t\t\t\t\t\t\t\t$thisfile_audio['lossless'] = true;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase '':\n\t\t\t\t\t\t\t\tswitch ($thisfile_riff_audio['codec_fourcc']) {\n\t\t\t\t\t\t\t\t\t// http://developer.apple.com/qa/snd/snd07.html\n\t\t\t\t\t\t\t\t\tcase 'sowt':\n\t\t\t\t\t\t\t\t\t\t$thisfile_riff_audio['codec_name'] = 'Two\\'s Compliment Little-Endian PCM';\n\t\t\t\t\t\t\t\t\t\t$thisfile_audio['lossless'] = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'twos':\n\t\t\t\t\t\t\t\t\t\t$thisfile_riff_audio['codec_name'] = 'Two\\'s Compliment Big-Endian PCM';\n\t\t\t\t\t\t\t\t\t\t$thisfile_audio['lossless'] = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$thisfile_audio['codec']    = $thisfile_riff_audio['codec_name'];\n\t\t\t\t\t\t\t\t$thisfile_audio['lossless'] = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$thisfile_audio['channels']        = $thisfile_riff_audio['channels'];\n\t\t\t\t\tif ($thisfile_riff_audio['bits_per_sample'] > 0) {\n\t\t\t\t\t\t$thisfile_audio['bits_per_sample'] = $thisfile_riff_audio['bits_per_sample'];\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_audio['sample_rate']     = $thisfile_riff_audio['sample_rate'];\n\t\t\t\t\tif ($thisfile_audio['sample_rate'] == 0) {\n\t\t\t\t\t\t$this->error('Corrupted AIFF file: sample_rate == zero');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t$info['playtime_seconds'] = $thisfile_riff_audio['total_samples'] / $thisfile_audio['sample_rate'];\n\t\t\t\t}\n\n\t\t\t\tif (isset($thisfile_riff[$RIFFsubtype]['COMT'])) {\n\t\t\t\t\t$offset = 0;\n\t\t\t\t\t$CommentCount                                   = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, 2), false);\n\t\t\t\t\t$offset += 2;\n\t\t\t\t\tfor ($i = 0; $i < $CommentCount; $i++) {\n\t\t\t\t\t\t$info['comments_raw'][$i]['timestamp']      = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, 4), false);\n\t\t\t\t\t\t$offset += 4;\n\t\t\t\t\t\t$info['comments_raw'][$i]['marker_id']      = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, 2), true);\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$CommentLength                              = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, 2), false);\n\t\t\t\t\t\t$offset += 2;\n\t\t\t\t\t\t$info['comments_raw'][$i]['comment']        =                           substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, $CommentLength);\n\t\t\t\t\t\t$offset += $CommentLength;\n\n\t\t\t\t\t\t$info['comments_raw'][$i]['timestamp_unix'] = getid3_lib::DateMac2Unix($info['comments_raw'][$i]['timestamp']);\n\t\t\t\t\t\t$thisfile_riff['comments']['comment'][] = $info['comments_raw'][$i]['comment'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$CommentsChunkNames = array('NAME'=>'title', 'author'=>'artist', '(c) '=>'copyright', 'ANNO'=>'comment');\n\t\t\t\tforeach ($CommentsChunkNames as $key => $value) {\n\t\t\t\t\tif (isset($thisfile_riff[$RIFFsubtype][$key][0]['data'])) {\n\t\t\t\t\t\t$thisfile_riff['comments'][$value][] = $thisfile_riff[$RIFFsubtype][$key][0]['data'];\n\t\t\t\t\t}\n\t\t\t\t}\n/*\n\t\t\t\tif (isset($thisfile_riff[$RIFFsubtype]['ID3 '])) {\n\t\t\t\t\tgetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true);\n\t\t\t\t\t$getid3_temp = new getID3();\n\t\t\t\t\t$getid3_temp->openfile($this->getid3->filename, null, $this->getid3->fp);\n\t\t\t\t\t$getid3_id3v2 = new getid3_id3v2($getid3_temp);\n\t\t\t\t\t$getid3_id3v2->StartingOffset = $thisfile_riff[$RIFFsubtype]['ID3 '][0]['offset'] + 8;\n\t\t\t\t\tif ($thisfile_riff[$RIFFsubtype]['ID3 '][0]['valid'] = $getid3_id3v2->Analyze()) {\n\t\t\t\t\t\t$info['id3v2'] = $getid3_temp->info['id3v2'];\n\t\t\t\t\t}\n\t\t\t\t\tunset($getid3_temp, $getid3_id3v2);\n\t\t\t\t}\n*/\n\t\t\t\tbreak;\n\n\t\t\t// http://en.wikipedia.org/wiki/8SVX\n\t\t\tcase '8SVX':\n\t\t\t\t$info['fileformat'] = '8svx';\n\t\t\t\t$info['mime_type']  = 'audio/8svx';\n\n\t\t\t\t$thisfile_audio['bitrate_mode']    = 'cbr';\n\t\t\t\t$thisfile_audio_dataformat         = '8svx';\n\t\t\t\t$thisfile_audio['bits_per_sample'] = 8;\n\t\t\t\t$thisfile_audio['channels']        = 1; // overridden below, if need be\n\t\t\t\t$ActualBitsPerSample               = 0;\n\n\t\t\t\tif (isset($thisfile_riff[$RIFFsubtype]['BODY'][0]['offset'])) {\n\t\t\t\t\t$info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['BODY'][0]['offset'] + 8;\n\t\t\t\t\t$info['avdataend']    = $info['avdataoffset'] + $thisfile_riff[$RIFFsubtype]['BODY'][0]['size'];\n\t\t\t\t\tif ($info['avdataend'] > $info['filesize']) {\n\t\t\t\t\t\t$this->warning('Probable truncated AIFF file: expecting '.$thisfile_riff[$RIFFsubtype]['BODY'][0]['size'].' bytes of audio data, only '.($info['filesize'] - $info['avdataoffset']).' bytes found');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (isset($thisfile_riff[$RIFFsubtype]['VHDR'][0]['offset'])) {\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_riff_RIFFsubtype_VHDR_0 = &$thisfile_riff[$RIFFsubtype]['VHDR'][0];\n\n\t\t\t\t\t$thisfile_riff_RIFFsubtype_VHDR_0['oneShotHiSamples']  =   getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'],  0, 4));\n\t\t\t\t\t$thisfile_riff_RIFFsubtype_VHDR_0['repeatHiSamples']   =   getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'],  4, 4));\n\t\t\t\t\t$thisfile_riff_RIFFsubtype_VHDR_0['samplesPerHiCycle'] =   getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'],  8, 4));\n\t\t\t\t\t$thisfile_riff_RIFFsubtype_VHDR_0['samplesPerSec']     =   getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 12, 2));\n\t\t\t\t\t$thisfile_riff_RIFFsubtype_VHDR_0['ctOctave']          =   getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 14, 1));\n\t\t\t\t\t$thisfile_riff_RIFFsubtype_VHDR_0['sCompression']      =   getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 15, 1));\n\t\t\t\t\t$thisfile_riff_RIFFsubtype_VHDR_0['Volume']            = getid3_lib::FixedPoint16_16(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 16, 4));\n\n\t\t\t\t\t$thisfile_audio['sample_rate'] = $thisfile_riff_RIFFsubtype_VHDR_0['samplesPerSec'];\n\n\t\t\t\t\tswitch ($thisfile_riff_RIFFsubtype_VHDR_0['sCompression']) {\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t$thisfile_audio['codec']    = 'Pulse Code Modulation (PCM)';\n\t\t\t\t\t\t\t$thisfile_audio['lossless'] = true;\n\t\t\t\t\t\t\t$ActualBitsPerSample        = 8;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t$thisfile_audio['codec']    = 'Fibonacci-delta encoding';\n\t\t\t\t\t\t\t$thisfile_audio['lossless'] = false;\n\t\t\t\t\t\t\t$ActualBitsPerSample        = 4;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$this->warning('Unexpected sCompression value in 8SVX.VHDR chunk - expecting 0 or 1, found \"'.$thisfile_riff_RIFFsubtype_VHDR_0['sCompression'].'\"');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (isset($thisfile_riff[$RIFFsubtype]['CHAN'][0]['data'])) {\n\t\t\t\t\t$ChannelsIndex = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['CHAN'][0]['data'], 0, 4));\n\t\t\t\t\tswitch ($ChannelsIndex) {\n\t\t\t\t\t\tcase 6: // Stereo\n\t\t\t\t\t\t\t$thisfile_audio['channels'] = 2;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 2: // Left channel only\n\t\t\t\t\t\tcase 4: // Right channel only\n\t\t\t\t\t\t\t$thisfile_audio['channels'] = 1;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$this->warning('Unexpected value in 8SVX.CHAN chunk - expecting 2 or 4 or 6, found \"'.$ChannelsIndex.'\"');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$CommentsChunkNames = array('NAME'=>'title', 'author'=>'artist', '(c) '=>'copyright', 'ANNO'=>'comment');\n\t\t\t\tforeach ($CommentsChunkNames as $key => $value) {\n\t\t\t\t\tif (isset($thisfile_riff[$RIFFsubtype][$key][0]['data'])) {\n\t\t\t\t\t\t$thisfile_riff['comments'][$value][] = $thisfile_riff[$RIFFsubtype][$key][0]['data'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$thisfile_audio['bitrate'] = $thisfile_audio['sample_rate'] * $ActualBitsPerSample * $thisfile_audio['channels'];\n\t\t\t\tif (!empty($thisfile_audio['bitrate'])) {\n\t\t\t\t\t$info['playtime_seconds'] = ($info['avdataend'] - $info['avdataoffset']) / ($thisfile_audio['bitrate'] / 8);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'CDXA':\n\t\t\t\t$info['fileformat'] = 'vcd'; // Asume Video CD\n\t\t\t\t$info['mime_type']  = 'video/mpeg';\n\n\t\t\t\tif (!empty($thisfile_riff['CDXA']['data'][0]['size'])) {\n\t\t\t\t\tgetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.mpeg.php', __FILE__, true);\n\n\t\t\t\t\t$getid3_temp = new getID3();\n\t\t\t\t\t$getid3_temp->openfile($this->getid3->filename, null, $this->getid3->fp);\n\t\t\t\t\t$getid3_mpeg = new getid3_mpeg($getid3_temp);\n\t\t\t\t\t$getid3_mpeg->Analyze();\n\t\t\t\t\tif (empty($getid3_temp->info['error'])) {\n\t\t\t\t\t\t$info['audio']   = $getid3_temp->info['audio'];\n\t\t\t\t\t\t$info['video']   = $getid3_temp->info['video'];\n\t\t\t\t\t\t$info['mpeg']    = $getid3_temp->info['mpeg'];\n\t\t\t\t\t\t$info['warning'] = $getid3_temp->info['warning'];\n\t\t\t\t\t}\n\t\t\t\t\tunset($getid3_temp, $getid3_mpeg);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'WEBP':\n\t\t\t\t// https://developers.google.com/speed/webp/docs/riff_container\n\t\t\t\t// https://tools.ietf.org/html/rfc6386\n\t\t\t\t// https://chromium.googlesource.com/webm/libwebp/+/master/doc/webp-lossless-bitstream-spec.txt\n\t\t\t\t$info['fileformat'] = 'webp';\n\t\t\t\t$info['mime_type']  = 'image/webp';\n\n\t\t\t\tif (!empty($thisfile_riff['WEBP']['VP8 '][0]['size'])) {\n\t\t\t\t\t$old_offset = $this->ftell();\n\t\t\t\t\t$this->fseek($thisfile_riff['WEBP']['VP8 '][0]['offset'] + 8); // 4 bytes \"VP8 \" + 4 bytes chunk size\n\t\t\t\t\t$WEBP_VP8_header = $this->fread(10);\n\t\t\t\t\t$this->fseek($old_offset);\n\t\t\t\t\tif (substr($WEBP_VP8_header, 3, 3) == \"\\x9D\\x01\\x2A\") {\n\t\t\t\t\t\t$thisfile_riff['WEBP']['VP8 '][0]['keyframe']   = !(getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 0, 3)) & 0x800000);\n\t\t\t\t\t\t$thisfile_riff['WEBP']['VP8 '][0]['version']    =  (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 0, 3)) & 0x700000) >> 20;\n\t\t\t\t\t\t$thisfile_riff['WEBP']['VP8 '][0]['show_frame'] =  (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 0, 3)) & 0x080000);\n\t\t\t\t\t\t$thisfile_riff['WEBP']['VP8 '][0]['data_bytes'] =  (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 0, 3)) & 0x07FFFF) >>  0;\n\n\t\t\t\t\t\t$thisfile_riff['WEBP']['VP8 '][0]['scale_x']    =  (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 6, 2)) & 0xC000) >> 14;\n\t\t\t\t\t\t$thisfile_riff['WEBP']['VP8 '][0]['width']      =  (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 6, 2)) & 0x3FFF);\n\t\t\t\t\t\t$thisfile_riff['WEBP']['VP8 '][0]['scale_y']    =  (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 8, 2)) & 0xC000) >> 14;\n\t\t\t\t\t\t$thisfile_riff['WEBP']['VP8 '][0]['height']     =  (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 8, 2)) & 0x3FFF);\n\n\t\t\t\t\t\t$info['video']['resolution_x'] = $thisfile_riff['WEBP']['VP8 '][0]['width'];\n\t\t\t\t\t\t$info['video']['resolution_y'] = $thisfile_riff['WEBP']['VP8 '][0]['height'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->error('Expecting 9D 01 2A at offset '.($thisfile_riff['WEBP']['VP8 '][0]['offset'] + 8 + 3).', found \"'.getid3_lib::PrintHexBytes(substr($WEBP_VP8_header, 3, 3)).'\"');\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif (!empty($thisfile_riff['WEBP']['VP8L'][0]['size'])) {\n\t\t\t\t\t$old_offset = $this->ftell();\n\t\t\t\t\t$this->fseek($thisfile_riff['WEBP']['VP8L'][0]['offset'] + 8); // 4 bytes \"VP8L\" + 4 bytes chunk size\n\t\t\t\t\t$WEBP_VP8L_header = $this->fread(10);\n\t\t\t\t\t$this->fseek($old_offset);\n\t\t\t\t\tif (substr($WEBP_VP8L_header, 0, 1) == \"\\x2F\") {\n\t\t\t\t\t\t$width_height_flags = getid3_lib::LittleEndian2Bin(substr($WEBP_VP8L_header, 1, 4));\n\t\t\t\t\t\t$thisfile_riff['WEBP']['VP8L'][0]['width']         =        bindec(substr($width_height_flags, 18, 14)) + 1;\n\t\t\t\t\t\t$thisfile_riff['WEBP']['VP8L'][0]['height']        =        bindec(substr($width_height_flags,  4, 14)) + 1;\n\t\t\t\t\t\t$thisfile_riff['WEBP']['VP8L'][0]['alpha_is_used'] = (bool) bindec(substr($width_height_flags,  3,  1));\n\t\t\t\t\t\t$thisfile_riff['WEBP']['VP8L'][0]['version']       =        bindec(substr($width_height_flags,  0,  3));\n\n\t\t\t\t\t\t$info['video']['resolution_x'] = $thisfile_riff['WEBP']['VP8L'][0]['width'];\n\t\t\t\t\t\t$info['video']['resolution_y'] = $thisfile_riff['WEBP']['VP8L'][0]['height'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->error('Expecting 2F at offset '.($thisfile_riff['WEBP']['VP8L'][0]['offset'] + 8).', found \"'.getid3_lib::PrintHexBytes(substr($WEBP_VP8L_header, 0, 1)).'\"');\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->error('Unknown RIFF type: expecting one of (WAVE|RMP3|AVI |CDDA|AIFF|AIFC|8SVX|CDXA|WEBP), found \"'.$RIFFsubtype.'\" instead');\n\t\t\t\t//unset($info['fileformat']);\n\t\t}\n\n\t\tswitch ($RIFFsubtype) {\n\t\t\tcase 'WAVE':\n\t\t\tcase 'AIFF':\n\t\t\tcase 'AIFC':\n\t\t\t\t$ID3v2_key_good = 'id3 ';\n\t\t\t\t$ID3v2_keys_bad = array('ID3 ', 'tag ');\n\t\t\t\tforeach ($ID3v2_keys_bad as $ID3v2_key_bad) {\n\t\t\t\t\tif (isset($thisfile_riff[$RIFFsubtype][$ID3v2_key_bad]) && !array_key_exists($ID3v2_key_good, $thisfile_riff[$RIFFsubtype])) {\n\t\t\t\t\t\t$thisfile_riff[$RIFFsubtype][$ID3v2_key_good] = $thisfile_riff[$RIFFsubtype][$ID3v2_key_bad];\n\t\t\t\t\t\t$this->warning('mapping \"'.$ID3v2_key_bad.'\" chunk to \"'.$ID3v2_key_good.'\"');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (isset($thisfile_riff[$RIFFsubtype]['id3 '])) {\n\t\t\t\t\tgetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true);\n\n\t\t\t\t\t$getid3_temp = new getID3();\n\t\t\t\t\t$getid3_temp->openfile($this->getid3->filename, null, $this->getid3->fp);\n\t\t\t\t\t$getid3_id3v2 = new getid3_id3v2($getid3_temp);\n\t\t\t\t\t$getid3_id3v2->StartingOffset = $thisfile_riff[$RIFFsubtype]['id3 '][0]['offset'] + 8;\n\t\t\t\t\tif ($thisfile_riff[$RIFFsubtype]['id3 '][0]['valid'] = $getid3_id3v2->Analyze()) {\n\t\t\t\t\t\t$info['id3v2'] = $getid3_temp->info['id3v2'];\n\t\t\t\t\t}\n\t\t\t\t\tunset($getid3_temp, $getid3_id3v2);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (isset($thisfile_riff_WAVE['DISP']) && is_array($thisfile_riff_WAVE['DISP'])) {\n\t\t\t$thisfile_riff['comments']['title'][] = trim(substr($thisfile_riff_WAVE['DISP'][count($thisfile_riff_WAVE['DISP']) - 1]['data'], 4));\n\t\t}\n\t\tif (isset($thisfile_riff_WAVE['INFO']) && is_array($thisfile_riff_WAVE['INFO'])) {\n\t\t\tself::parseComments($thisfile_riff_WAVE['INFO'], $thisfile_riff['comments']);\n\t\t}\n\t\tif (isset($thisfile_riff['AVI ']['INFO']) && is_array($thisfile_riff['AVI ']['INFO'])) {\n\t\t\tself::parseComments($thisfile_riff['AVI ']['INFO'], $thisfile_riff['comments']);\n\t\t}\n\n\t\tif (empty($thisfile_audio['encoder']) && !empty($info['mpeg']['audio']['LAME']['short_version'])) {\n\t\t\t$thisfile_audio['encoder'] = $info['mpeg']['audio']['LAME']['short_version'];\n\t\t}\n\n\t\tif (!isset($info['playtime_seconds'])) {\n\t\t\t$info['playtime_seconds'] = 0;\n\t\t}\n\t\tif (isset($thisfile_riff_raw['strh'][0]['dwLength']) && isset($thisfile_riff_raw['avih']['dwMicroSecPerFrame'])) {\n\t\t\t// needed for >2GB AVIs where 'avih' chunk only lists number of frames in that chunk, not entire movie\n\t\t\t$info['playtime_seconds'] = $thisfile_riff_raw['strh'][0]['dwLength'] * ($thisfile_riff_raw['avih']['dwMicroSecPerFrame'] / 1000000);\n\t\t} elseif (isset($thisfile_riff_raw['avih']['dwTotalFrames']) && isset($thisfile_riff_raw['avih']['dwMicroSecPerFrame'])) {\n\t\t\t$info['playtime_seconds'] = $thisfile_riff_raw['avih']['dwTotalFrames'] * ($thisfile_riff_raw['avih']['dwMicroSecPerFrame'] / 1000000);\n\t\t}\n\n\t\tif ($info['playtime_seconds'] > 0) {\n\t\t\tif (isset($thisfile_riff_audio) && isset($thisfile_riff_video)) {\n\n\t\t\t\tif (!isset($info['bitrate'])) {\n\t\t\t\t\t$info['bitrate'] = ((($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8);\n\t\t\t\t}\n\n\t\t\t} elseif (isset($thisfile_riff_audio) && !isset($thisfile_riff_video)) {\n\n\t\t\t\tif (!isset($thisfile_audio['bitrate'])) {\n\t\t\t\t\t$thisfile_audio['bitrate'] = ((($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8);\n\t\t\t\t}\n\n\t\t\t} elseif (!isset($thisfile_riff_audio) && isset($thisfile_riff_video)) {\n\n\t\t\t\tif (!isset($thisfile_video['bitrate'])) {\n\t\t\t\t\t$thisfile_video['bitrate'] = ((($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\n\t\tif (isset($thisfile_riff_video) && isset($thisfile_audio['bitrate']) && ($thisfile_audio['bitrate'] > 0) && ($info['playtime_seconds'] > 0)) {\n\n\t\t\t$info['bitrate'] = ((($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8);\n\t\t\t$thisfile_audio['bitrate'] = 0;\n\t\t\t$thisfile_video['bitrate'] = $info['bitrate'];\n\t\t\tforeach ($thisfile_riff_audio as $channelnumber => $audioinfoarray) {\n\t\t\t\t$thisfile_video['bitrate'] -= $audioinfoarray['bitrate'];\n\t\t\t\t$thisfile_audio['bitrate'] += $audioinfoarray['bitrate'];\n\t\t\t}\n\t\t\tif ($thisfile_video['bitrate'] <= 0) {\n\t\t\t\tunset($thisfile_video['bitrate']);\n\t\t\t}\n\t\t\tif ($thisfile_audio['bitrate'] <= 0) {\n\t\t\t\tunset($thisfile_audio['bitrate']);\n\t\t\t}\n\t\t}\n\n\t\tif (isset($info['mpeg']['audio'])) {\n\t\t\t$thisfile_audio_dataformat      = 'mp'.$info['mpeg']['audio']['layer'];\n\t\t\t$thisfile_audio['sample_rate']  = $info['mpeg']['audio']['sample_rate'];\n\t\t\t$thisfile_audio['channels']     = $info['mpeg']['audio']['channels'];\n\t\t\t$thisfile_audio['bitrate']      = $info['mpeg']['audio']['bitrate'];\n\t\t\t$thisfile_audio['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']);\n\t\t\tif (!empty($info['mpeg']['audio']['codec'])) {\n\t\t\t\t$thisfile_audio['codec'] = $info['mpeg']['audio']['codec'].' '.$thisfile_audio['codec'];\n\t\t\t}\n\t\t\tif (!empty($thisfile_audio['streams'])) {\n\t\t\t\tforeach ($thisfile_audio['streams'] as $streamnumber => $streamdata) {\n\t\t\t\t\tif ($streamdata['dataformat'] == $thisfile_audio_dataformat) {\n\t\t\t\t\t\t$thisfile_audio['streams'][$streamnumber]['sample_rate']  = $thisfile_audio['sample_rate'];\n\t\t\t\t\t\t$thisfile_audio['streams'][$streamnumber]['channels']     = $thisfile_audio['channels'];\n\t\t\t\t\t\t$thisfile_audio['streams'][$streamnumber]['bitrate']      = $thisfile_audio['bitrate'];\n\t\t\t\t\t\t$thisfile_audio['streams'][$streamnumber]['bitrate_mode'] = $thisfile_audio['bitrate_mode'];\n\t\t\t\t\t\t$thisfile_audio['streams'][$streamnumber]['codec']        = $thisfile_audio['codec'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$getid3_mp3 = new getid3_mp3($this->getid3);\n\t\t\t$thisfile_audio['encoder_options'] = $getid3_mp3->GuessEncoderOptions();\n\t\t\tunset($getid3_mp3);\n\t\t}\n\n\n\t\tif (!empty($thisfile_riff_raw['fmt ']['wBitsPerSample']) && ($thisfile_riff_raw['fmt ']['wBitsPerSample'] > 0)) {\n\t\t\tswitch ($thisfile_audio_dataformat) {\n\t\t\t\tcase 'ac3':\n\t\t\t\t\t// ignore bits_per_sample\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$thisfile_audio['bits_per_sample'] = $thisfile_riff_raw['fmt ']['wBitsPerSample'];\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\n\t\tif (empty($thisfile_riff_raw)) {\n\t\t\tunset($thisfile_riff['raw']);\n\t\t}\n\t\tif (empty($thisfile_riff_audio)) {\n\t\t\tunset($thisfile_riff['audio']);\n\t\t}\n\t\tif (empty($thisfile_riff_video)) {\n\t\t\tunset($thisfile_riff['video']);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param int $startoffset\n\t * @param int $maxoffset\n\t *\n\t * @return array|false\n\t *\n\t * @throws Exception\n\t * @throws getid3_exception\n\t */\n\tpublic function ParseRIFFAMV($startoffset, $maxoffset) {\n\t\t// AMV files are RIFF-AVI files with parts of the spec deliberately broken, such as chunk size fields hardcoded to zero (because players known in hardware that these fields are always a certain size\n\n\t\t// https://code.google.com/p/amv-codec-tools/wiki/AmvDocumentation\n\t\t//typedef struct _amvmainheader {\n\t\t//FOURCC fcc; // 'amvh'\n\t\t//DWORD cb;\n\t\t//DWORD dwMicroSecPerFrame;\n\t\t//BYTE reserve[28];\n\t\t//DWORD dwWidth;\n\t\t//DWORD dwHeight;\n\t\t//DWORD dwSpeed;\n\t\t//DWORD reserve0;\n\t\t//DWORD reserve1;\n\t\t//BYTE bTimeSec;\n\t\t//BYTE bTimeMin;\n\t\t//WORD wTimeHour;\n\t\t//} AMVMAINHEADER;\n\n\t\t$info = &$this->getid3->info;\n\t\t$RIFFchunk = false;\n\n\t\ttry {\n\n\t\t\t$this->fseek($startoffset);\n\t\t\t$maxoffset = min($maxoffset, $info['avdataend']);\n\t\t\t$AMVheader = $this->fread(284);\n\t\t\tif (substr($AMVheader,   0,  8) != 'hdrlamvh') {\n\t\t\t\tthrow new Exception('expecting \"hdrlamv\" at offset '.($startoffset +   0).', found \"'.substr($AMVheader,   0, 8).'\"');\n\t\t\t}\n\t\t\tif (substr($AMVheader,   8,  4) != \"\\x38\\x00\\x00\\x00\") { // \"amvh\" chunk size, hardcoded to 0x38 = 56 bytes\n\t\t\t\tthrow new Exception('expecting \"0x38000000\" at offset '.($startoffset +   8).', found \"'.getid3_lib::PrintHexBytes(substr($AMVheader,   8, 4)).'\"');\n\t\t\t}\n\t\t\t$RIFFchunk = array();\n\t\t\t$RIFFchunk['amvh']['us_per_frame']   = getid3_lib::LittleEndian2Int(substr($AMVheader,  12,  4));\n\t\t\t$RIFFchunk['amvh']['reserved28']     =                              substr($AMVheader,  16, 28);  // null? reserved?\n\t\t\t$RIFFchunk['amvh']['resolution_x']   = getid3_lib::LittleEndian2Int(substr($AMVheader,  44,  4));\n\t\t\t$RIFFchunk['amvh']['resolution_y']   = getid3_lib::LittleEndian2Int(substr($AMVheader,  48,  4));\n\t\t\t$RIFFchunk['amvh']['frame_rate_int'] = getid3_lib::LittleEndian2Int(substr($AMVheader,  52,  4));\n\t\t\t$RIFFchunk['amvh']['reserved0']      = getid3_lib::LittleEndian2Int(substr($AMVheader,  56,  4)); // 1? reserved?\n\t\t\t$RIFFchunk['amvh']['reserved1']      = getid3_lib::LittleEndian2Int(substr($AMVheader,  60,  4)); // 0? reserved?\n\t\t\t$RIFFchunk['amvh']['runtime_sec']    = getid3_lib::LittleEndian2Int(substr($AMVheader,  64,  1));\n\t\t\t$RIFFchunk['amvh']['runtime_min']    = getid3_lib::LittleEndian2Int(substr($AMVheader,  65,  1));\n\t\t\t$RIFFchunk['amvh']['runtime_hrs']    = getid3_lib::LittleEndian2Int(substr($AMVheader,  66,  2));\n\n\t\t\t$info['video']['frame_rate']   = 1000000 / $RIFFchunk['amvh']['us_per_frame'];\n\t\t\t$info['video']['resolution_x'] = $RIFFchunk['amvh']['resolution_x'];\n\t\t\t$info['video']['resolution_y'] = $RIFFchunk['amvh']['resolution_y'];\n\t\t\t$info['playtime_seconds']      = ($RIFFchunk['amvh']['runtime_hrs'] * 3600) + ($RIFFchunk['amvh']['runtime_min'] * 60) + $RIFFchunk['amvh']['runtime_sec'];\n\n\t\t\t// the rest is all hardcoded(?) and does not appear to be useful until you get to audio info at offset 256, even then everything is probably hardcoded\n\n\t\t\tif (substr($AMVheader,  68, 20) != 'LIST'.\"\\x00\\x00\\x00\\x00\".'strlstrh'.\"\\x38\\x00\\x00\\x00\") {\n\t\t\t\tthrow new Exception('expecting \"LIST<0x00000000>strlstrh<0x38000000>\" at offset '.($startoffset +  68).', found \"'.getid3_lib::PrintHexBytes(substr($AMVheader,  68, 20)).'\"');\n\t\t\t}\n\t\t\t// followed by 56 bytes of null: substr($AMVheader,  88, 56) -> 144\n\t\t\tif (substr($AMVheader, 144,  8) != 'strf'.\"\\x24\\x00\\x00\\x00\") {\n\t\t\t\tthrow new Exception('expecting \"strf<0x24000000>\" at offset '.($startoffset + 144).', found \"'.getid3_lib::PrintHexBytes(substr($AMVheader, 144,  8)).'\"');\n\t\t\t}\n\t\t\t// followed by 36 bytes of null: substr($AMVheader, 144, 36) -> 180\n\n\t\t\tif (substr($AMVheader, 188, 20) != 'LIST'.\"\\x00\\x00\\x00\\x00\".'strlstrh'.\"\\x30\\x00\\x00\\x00\") {\n\t\t\t\tthrow new Exception('expecting \"LIST<0x00000000>strlstrh<0x30000000>\" at offset '.($startoffset + 188).', found \"'.getid3_lib::PrintHexBytes(substr($AMVheader, 188, 20)).'\"');\n\t\t\t}\n\t\t\t// followed by 48 bytes of null: substr($AMVheader, 208, 48) -> 256\n\t\t\tif (substr($AMVheader, 256,  8) != 'strf'.\"\\x14\\x00\\x00\\x00\") {\n\t\t\t\tthrow new Exception('expecting \"strf<0x14000000>\" at offset '.($startoffset + 256).', found \"'.getid3_lib::PrintHexBytes(substr($AMVheader, 256,  8)).'\"');\n\t\t\t}\n\t\t\t// followed by 20 bytes of a modified WAVEFORMATEX:\n\t\t\t// typedef struct {\n\t\t\t// WORD wFormatTag;       //(Fixme: this is equal to PCM's 0x01 format code)\n\t\t\t// WORD nChannels;        //(Fixme: this is always 1)\n\t\t\t// DWORD nSamplesPerSec;  //(Fixme: for all known sample files this is equal to 22050)\n\t\t\t// DWORD nAvgBytesPerSec; //(Fixme: for all known sample files this is equal to 44100)\n\t\t\t// WORD nBlockAlign;      //(Fixme: this seems to be 2 in AMV files, is this correct ?)\n\t\t\t// WORD wBitsPerSample;   //(Fixme: this seems to be 16 in AMV files instead of the expected 4)\n\t\t\t// WORD cbSize;           //(Fixme: this seems to be 0 in AMV files)\n\t\t\t// WORD reserved;\n\t\t\t// } WAVEFORMATEX;\n\t\t\t$RIFFchunk['strf']['wformattag']      = getid3_lib::LittleEndian2Int(substr($AMVheader,  264,  2));\n\t\t\t$RIFFchunk['strf']['nchannels']       = getid3_lib::LittleEndian2Int(substr($AMVheader,  266,  2));\n\t\t\t$RIFFchunk['strf']['nsamplespersec']  = getid3_lib::LittleEndian2Int(substr($AMVheader,  268,  4));\n\t\t\t$RIFFchunk['strf']['navgbytespersec'] = getid3_lib::LittleEndian2Int(substr($AMVheader,  272,  4));\n\t\t\t$RIFFchunk['strf']['nblockalign']     = getid3_lib::LittleEndian2Int(substr($AMVheader,  276,  2));\n\t\t\t$RIFFchunk['strf']['wbitspersample']  = getid3_lib::LittleEndian2Int(substr($AMVheader,  278,  2));\n\t\t\t$RIFFchunk['strf']['cbsize']          = getid3_lib::LittleEndian2Int(substr($AMVheader,  280,  2));\n\t\t\t$RIFFchunk['strf']['reserved']        = getid3_lib::LittleEndian2Int(substr($AMVheader,  282,  2));\n\n\n\t\t\t$info['audio']['lossless']        = false;\n\t\t\t$info['audio']['sample_rate']     = $RIFFchunk['strf']['nsamplespersec'];\n\t\t\t$info['audio']['channels']        = $RIFFchunk['strf']['nchannels'];\n\t\t\t$info['audio']['bits_per_sample'] = $RIFFchunk['strf']['wbitspersample'];\n\t\t\t$info['audio']['bitrate']         = $info['audio']['sample_rate'] * $info['audio']['channels'] * $info['audio']['bits_per_sample'];\n\t\t\t$info['audio']['bitrate_mode']    = 'cbr';\n\n\n\t\t} catch (getid3_exception $e) {\n\t\t\tif ($e->getCode() == 10) {\n\t\t\t\t$this->warning('RIFFAMV parser: '.$e->getMessage());\n\t\t\t} else {\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}\n\n\t\treturn $RIFFchunk;\n\t}\n\n\t/**\n\t * @param int $startoffset\n\t * @param int $maxoffset\n\t *\n\t * @return array|false\n\t * @throws getid3_exception\n\t */\n\tpublic function ParseRIFF($startoffset, $maxoffset) {\n\t\t$info = &$this->getid3->info;\n\n\t\t$RIFFchunk = false;\n\t\t$FoundAllChunksWeNeed = false;\n\n\t\ttry {\n\t\t\t$this->fseek($startoffset);\n\t\t\t$maxoffset = min($maxoffset, $info['avdataend']);\n\t\t\twhile ($this->ftell() < $maxoffset) {\n\t\t\t\t$chunknamesize = $this->fread(8);\n\t\t\t\t//$chunkname =                          substr($chunknamesize, 0, 4);\n\t\t\t\t$chunkname = str_replace(\"\\x00\", '_', substr($chunknamesize, 0, 4));  // note: chunk names of 4 null bytes do appear to be legal (has been observed inside INFO and PRMI chunks, for example), but makes traversing array keys more difficult\n\t\t\t\t$chunksize =  $this->EitherEndian2Int(substr($chunknamesize, 4, 4));\n\t\t\t\t//if (strlen(trim($chunkname, \"\\x00\")) < 4) {\n\t\t\t\tif (strlen($chunkname) < 4) {\n\t\t\t\t\t$this->error('Expecting chunk name at offset '.($this->ftell() - 8).' but found nothing. Aborting RIFF parsing.');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (($chunksize == 0) && ($chunkname != 'JUNK')) {\n\t\t\t\t\t$this->warning('Chunk ('.$chunkname.') size at offset '.($this->ftell() - 4).' is zero. Aborting RIFF parsing.');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (($chunksize % 2) != 0) {\n\t\t\t\t\t// all structures are packed on word boundaries\n\t\t\t\t\t$chunksize++;\n\t\t\t\t}\n\n\t\t\t\tswitch ($chunkname) {\n\t\t\t\t\tcase 'LIST':\n\t\t\t\t\t\t$listname = $this->fread(4);\n\t\t\t\t\t\tif (preg_match('#^(movi|rec )$#i', $listname)) {\n\t\t\t\t\t\t\t$RIFFchunk[$listname]['offset'] = $this->ftell() - 4;\n\t\t\t\t\t\t\t$RIFFchunk[$listname]['size']   = $chunksize;\n\n\t\t\t\t\t\t\tif (!$FoundAllChunksWeNeed) {\n\t\t\t\t\t\t\t\t$WhereWeWere      = $this->ftell();\n\t\t\t\t\t\t\t\t$AudioChunkHeader = $this->fread(12);\n\t\t\t\t\t\t\t\t$AudioChunkStreamNum  =                              substr($AudioChunkHeader, 0, 2);\n\t\t\t\t\t\t\t\t$AudioChunkStreamType =                              substr($AudioChunkHeader, 2, 2);\n\t\t\t\t\t\t\t\t$AudioChunkSize       = getid3_lib::LittleEndian2Int(substr($AudioChunkHeader, 4, 4));\n\n\t\t\t\t\t\t\t\tif ($AudioChunkStreamType == 'wb') {\n\t\t\t\t\t\t\t\t\t$FirstFourBytes = substr($AudioChunkHeader, 8, 4);\n\t\t\t\t\t\t\t\t\tif (preg_match('/^\\xFF[\\xE2-\\xE7\\xF2-\\xF7\\xFA-\\xFF][\\x00-\\xEB]/s', $FirstFourBytes)) {\n\t\t\t\t\t\t\t\t\t\t// MP3\n\t\t\t\t\t\t\t\t\t\tif (getid3_mp3::MPEGaudioHeaderBytesValid($FirstFourBytes)) {\n\t\t\t\t\t\t\t\t\t\t\t$getid3_temp = new getID3();\n\t\t\t\t\t\t\t\t\t\t\t$getid3_temp->openfile($this->getid3->filename, null, $this->getid3->fp);\n\t\t\t\t\t\t\t\t\t\t\t$getid3_temp->info['avdataoffset'] = $this->ftell() - 4;\n\t\t\t\t\t\t\t\t\t\t\t$getid3_temp->info['avdataend']    = $this->ftell() + $AudioChunkSize;\n\t\t\t\t\t\t\t\t\t\t\t$getid3_mp3 = new getid3_mp3($getid3_temp, __CLASS__);\n\t\t\t\t\t\t\t\t\t\t\t$getid3_mp3->getOnlyMPEGaudioInfo($getid3_temp->info['avdataoffset'], false);\n\t\t\t\t\t\t\t\t\t\t\tif (isset($getid3_temp->info['mpeg']['audio'])) {\n\t\t\t\t\t\t\t\t\t\t\t\t$info['mpeg']['audio']         = $getid3_temp->info['mpeg']['audio'];\n\t\t\t\t\t\t\t\t\t\t\t\t$info['audio']                 = $getid3_temp->info['audio'];\n\t\t\t\t\t\t\t\t\t\t\t\t$info['audio']['dataformat']   = 'mp'.$info['mpeg']['audio']['layer'];\n\t\t\t\t\t\t\t\t\t\t\t\t$info['audio']['sample_rate']  = $info['mpeg']['audio']['sample_rate'];\n\t\t\t\t\t\t\t\t\t\t\t\t$info['audio']['channels']     = $info['mpeg']['audio']['channels'];\n\t\t\t\t\t\t\t\t\t\t\t\t$info['audio']['bitrate']      = $info['mpeg']['audio']['bitrate'];\n\t\t\t\t\t\t\t\t\t\t\t\t$info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']);\n\t\t\t\t\t\t\t\t\t\t\t\t//$info['bitrate']               = $info['audio']['bitrate'];\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tunset($getid3_temp, $getid3_mp3);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t} elseif (strpos($FirstFourBytes, getid3_ac3::syncword) === 0) {\n\n\t\t\t\t\t\t\t\t\t\t// AC3\n\t\t\t\t\t\t\t\t\t\t$getid3_temp = new getID3();\n\t\t\t\t\t\t\t\t\t\t$getid3_temp->openfile($this->getid3->filename, null, $this->getid3->fp);\n\t\t\t\t\t\t\t\t\t\t$getid3_temp->info['avdataoffset'] = $this->ftell() - 4;\n\t\t\t\t\t\t\t\t\t\t$getid3_temp->info['avdataend']    = $this->ftell() + $AudioChunkSize;\n\t\t\t\t\t\t\t\t\t\t$getid3_ac3 = new getid3_ac3($getid3_temp);\n\t\t\t\t\t\t\t\t\t\t$getid3_ac3->Analyze();\n\t\t\t\t\t\t\t\t\t\tif (empty($getid3_temp->info['error'])) {\n\t\t\t\t\t\t\t\t\t\t\t$info['audio']   = $getid3_temp->info['audio'];\n\t\t\t\t\t\t\t\t\t\t\t$info['ac3']     = $getid3_temp->info['ac3'];\n\t\t\t\t\t\t\t\t\t\t\tif (!empty($getid3_temp->info['warning'])) {\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($getid3_temp->info['warning'] as $key => $value) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->warning($value);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tunset($getid3_temp, $getid3_ac3);\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\t$FoundAllChunksWeNeed = true;\n\t\t\t\t\t\t\t\t$this->fseek($WhereWeWere);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this->fseek($chunksize - 4, SEEK_CUR);\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif (!isset($RIFFchunk[$listname])) {\n\t\t\t\t\t\t\t\t$RIFFchunk[$listname] = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$LISTchunkParent    = $listname;\n\t\t\t\t\t\t\t$LISTchunkMaxOffset = $this->ftell() - 4 + $chunksize;\n\t\t\t\t\t\t\tif ($parsedChunk = $this->ParseRIFF($this->ftell(), $LISTchunkMaxOffset)) {\n\t\t\t\t\t\t\t\t$RIFFchunk[$listname] = array_merge_recursive($RIFFchunk[$listname], $parsedChunk);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (preg_match('#^[0-9]{2}(wb|pc|dc|db)$#', $chunkname)) {\n\t\t\t\t\t\t\t$this->fseek($chunksize, SEEK_CUR);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$thisindex = 0;\n\t\t\t\t\t\tif (isset($RIFFchunk[$chunkname]) && is_array($RIFFchunk[$chunkname])) {\n\t\t\t\t\t\t\t$thisindex = count($RIFFchunk[$chunkname]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['offset'] = $this->ftell() - 8;\n\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['size']   = $chunksize;\n\t\t\t\t\t\tswitch ($chunkname) {\n\t\t\t\t\t\t\tcase 'data':\n\t\t\t\t\t\t\t\t$info['avdataoffset'] = $this->ftell();\n\t\t\t\t\t\t\t\t$info['avdataend']    = $info['avdataoffset'] + $chunksize;\n\n\t\t\t\t\t\t\t\t$testData = $this->fread(36);\n\t\t\t\t\t\t\t\tif ($testData === '') {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (preg_match('/^\\xFF[\\xE2-\\xE7\\xF2-\\xF7\\xFA-\\xFF][\\x00-\\xEB]/s', substr($testData, 0, 4))) {\n\n\t\t\t\t\t\t\t\t\t// Probably is MP3 data\n\t\t\t\t\t\t\t\t\tif (getid3_mp3::MPEGaudioHeaderBytesValid(substr($testData, 0, 4))) {\n\t\t\t\t\t\t\t\t\t\t$getid3_temp = new getID3();\n\t\t\t\t\t\t\t\t\t\t$getid3_temp->openfile($this->getid3->filename, null, $this->getid3->fp);\n\t\t\t\t\t\t\t\t\t\t$getid3_temp->info['avdataoffset'] = $info['avdataoffset'];\n\t\t\t\t\t\t\t\t\t\t$getid3_temp->info['avdataend']    = $info['avdataend'];\n\t\t\t\t\t\t\t\t\t\t$getid3_mp3 = new getid3_mp3($getid3_temp, __CLASS__);\n\t\t\t\t\t\t\t\t\t\t$getid3_mp3->getOnlyMPEGaudioInfo($info['avdataoffset'], false);\n\t\t\t\t\t\t\t\t\t\tif (empty($getid3_temp->info['error'])) {\n\t\t\t\t\t\t\t\t\t\t\t$info['audio'] = $getid3_temp->info['audio'];\n\t\t\t\t\t\t\t\t\t\t\t$info['mpeg']  = $getid3_temp->info['mpeg'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tunset($getid3_temp, $getid3_mp3);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} elseif (($isRegularAC3 = (substr($testData, 0, 2) == getid3_ac3::syncword)) || substr($testData, 8, 2) == strrev(getid3_ac3::syncword)) {\n\n\t\t\t\t\t\t\t\t\t// This is probably AC-3 data\n\t\t\t\t\t\t\t\t\t$getid3_temp = new getID3();\n\t\t\t\t\t\t\t\t\tif ($isRegularAC3) {\n\t\t\t\t\t\t\t\t\t\t$getid3_temp->openfile($this->getid3->filename, null, $this->getid3->fp);\n\t\t\t\t\t\t\t\t\t\t$getid3_temp->info['avdataoffset'] = $info['avdataoffset'];\n\t\t\t\t\t\t\t\t\t\t$getid3_temp->info['avdataend']    = $info['avdataend'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$getid3_ac3 = new getid3_ac3($getid3_temp);\n\t\t\t\t\t\t\t\t\tif ($isRegularAC3) {\n\t\t\t\t\t\t\t\t\t\t$getid3_ac3->Analyze();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t// Dolby Digital WAV\n\t\t\t\t\t\t\t\t\t\t// AC-3 content, but not encoded in same format as normal AC-3 file\n\t\t\t\t\t\t\t\t\t\t// For one thing, byte order is swapped\n\t\t\t\t\t\t\t\t\t\t$ac3_data = '';\n\t\t\t\t\t\t\t\t\t\tfor ($i = 0; $i < 28; $i += 2) {\n\t\t\t\t\t\t\t\t\t\t\t$ac3_data .= substr($testData, 8 + $i + 1, 1);\n\t\t\t\t\t\t\t\t\t\t\t$ac3_data .= substr($testData, 8 + $i + 0, 1);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$getid3_ac3->AnalyzeString($ac3_data);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (empty($getid3_temp->info['error'])) {\n\t\t\t\t\t\t\t\t\t\t$info['audio'] = $getid3_temp->info['audio'];\n\t\t\t\t\t\t\t\t\t\t$info['ac3']   = $getid3_temp->info['ac3'];\n\t\t\t\t\t\t\t\t\t\tif (!empty($getid3_temp->info['warning'])) {\n\t\t\t\t\t\t\t\t\t\t\tforeach ($getid3_temp->info['warning'] as $newerror) {\n\t\t\t\t\t\t\t\t\t\t\t\t$this->warning('getid3_ac3() says: ['.$newerror.']');\n\t\t\t\t\t\t\t\t\t\t\t}\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\tunset($getid3_temp, $getid3_ac3);\n\n\t\t\t\t\t\t\t\t} elseif (preg_match('/^('.implode('|', array_map('preg_quote', getid3_dts::$syncwords)).')/', $testData)) {\n\n\t\t\t\t\t\t\t\t\t// This is probably DTS data\n\t\t\t\t\t\t\t\t\t$getid3_temp = new getID3();\n\t\t\t\t\t\t\t\t\t$getid3_temp->openfile($this->getid3->filename, null, $this->getid3->fp);\n\t\t\t\t\t\t\t\t\t$getid3_temp->info['avdataoffset'] = $info['avdataoffset'];\n\t\t\t\t\t\t\t\t\t$getid3_dts = new getid3_dts($getid3_temp);\n\t\t\t\t\t\t\t\t\t$getid3_dts->Analyze();\n\t\t\t\t\t\t\t\t\tif (empty($getid3_temp->info['error'])) {\n\t\t\t\t\t\t\t\t\t\t$info['audio']            = $getid3_temp->info['audio'];\n\t\t\t\t\t\t\t\t\t\t$info['dts']              = $getid3_temp->info['dts'];\n\t\t\t\t\t\t\t\t\t\t$info['playtime_seconds'] = $getid3_temp->info['playtime_seconds']; // may not match RIFF calculations since DTS-WAV often used 14/16 bit-word packing\n\t\t\t\t\t\t\t\t\t\tif (!empty($getid3_temp->info['warning'])) {\n\t\t\t\t\t\t\t\t\t\t\tforeach ($getid3_temp->info['warning'] as $newerror) {\n\t\t\t\t\t\t\t\t\t\t\t\t$this->warning('getid3_dts() says: ['.$newerror.']');\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tunset($getid3_temp, $getid3_dts);\n\n\t\t\t\t\t\t\t\t} elseif (substr($testData, 0, 4) == 'wvpk') {\n\n\t\t\t\t\t\t\t\t\t// This is WavPack data\n\t\t\t\t\t\t\t\t\t$info['wavpack']['offset'] = $info['avdataoffset'];\n\t\t\t\t\t\t\t\t\t$info['wavpack']['size']   = getid3_lib::LittleEndian2Int(substr($testData, 4, 4));\n\t\t\t\t\t\t\t\t\t$this->parseWavPackHeader(substr($testData, 8, 28));\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// This is some other kind of data (quite possibly just PCM)\n\t\t\t\t\t\t\t\t\t// do nothing special, just skip it\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$nextoffset = $info['avdataend'];\n\t\t\t\t\t\t\t\t$this->fseek($nextoffset);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'iXML':\n\t\t\t\t\t\t\tcase 'bext':\n\t\t\t\t\t\t\tcase 'cart':\n\t\t\t\t\t\t\tcase 'fmt ':\n\t\t\t\t\t\t\tcase 'strh':\n\t\t\t\t\t\t\tcase 'strf':\n\t\t\t\t\t\t\tcase 'indx':\n\t\t\t\t\t\t\tcase 'MEXT':\n\t\t\t\t\t\t\tcase 'DISP':\n\t\t\t\t\t\t\t\t// always read data in\n\t\t\t\t\t\t\tcase 'JUNK':\n\t\t\t\t\t\t\t\t// should be: never read data in\n\t\t\t\t\t\t\t\t// but some programs write their version strings in a JUNK chunk (e.g. VirtualDub, AVIdemux, etc)\n\t\t\t\t\t\t\t\tif ($chunksize < 1048576) {\n\t\t\t\t\t\t\t\t\tif ($chunksize > 0) {\n\t\t\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['data'] = $this->fread($chunksize);\n\t\t\t\t\t\t\t\t\t\tif ($chunkname == 'JUNK') {\n\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#^([\\\\x20-\\\\x7F]+)#', $RIFFchunk[$chunkname][$thisindex]['data'], $matches)) {\n\t\t\t\t\t\t\t\t\t\t\t\t// only keep text characters [chr(32)-chr(127)]\n\t\t\t\t\t\t\t\t\t\t\t\t$info['riff']['comments']['junk'][] = trim($matches[1]);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// but if nothing there, ignore\n\t\t\t\t\t\t\t\t\t\t\t// remove the key in either case\n\t\t\t\t\t\t\t\t\t\t\tunset($RIFFchunk[$chunkname][$thisindex]['data']);\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} else {\n\t\t\t\t\t\t\t\t\t$this->warning('Chunk \"'.$chunkname.'\" at offset '.$this->ftell().' is unexpectedly larger than 1MB (claims to be '.number_format($chunksize).' bytes), skipping data');\n\t\t\t\t\t\t\t\t\t$this->fseek($chunksize, SEEK_CUR);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t//case 'IDVX':\n\t\t\t\t\t\t\t//\t$info['divxtag']['comments'] = self::ParseDIVXTAG($this->fread($chunksize));\n\t\t\t\t\t\t\t//\tbreak;\n\n\t\t\t\t\t\t\tcase 'scot':\n\t\t\t\t\t\t\t\t// https://cmsdk.com/node-js/adding-scot-chunk-to-wav-file.html\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['data'] = $this->fread($chunksize);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['alter']           =                              substr($RIFFchunk[$chunkname][$thisindex]['data'],   0,   1);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['attrib']          =                              substr($RIFFchunk[$chunkname][$thisindex]['data'],   1,   1);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['artnum']          = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'],   2,   2));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['title']           =                              substr($RIFFchunk[$chunkname][$thisindex]['data'],   4,  43);  // \"name\" in other documentation\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['copy']            =                              substr($RIFFchunk[$chunkname][$thisindex]['data'],  47,   4);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['padd']            =                              substr($RIFFchunk[$chunkname][$thisindex]['data'],  51,   1);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['asclen']          =                              substr($RIFFchunk[$chunkname][$thisindex]['data'],  52,   5);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['startseconds']    = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'],  57,   2));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['starthundredths'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'],  59,   2));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['endseconds']      = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'],  61,   2));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['endhundreths']    = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'],  63,   2));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['sdate']           =                              substr($RIFFchunk[$chunkname][$thisindex]['data'],  65,   6);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['kdate']           =                              substr($RIFFchunk[$chunkname][$thisindex]['data'],  71,   6);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['start_hr']        =                              substr($RIFFchunk[$chunkname][$thisindex]['data'],  77,   1);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['kill_hr']         =                              substr($RIFFchunk[$chunkname][$thisindex]['data'],  78,   1);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['digital']         =                              substr($RIFFchunk[$chunkname][$thisindex]['data'],  79,   1);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['sample_rate']     = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'],  80,   2));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['stereo']          =                              substr($RIFFchunk[$chunkname][$thisindex]['data'],  82,   1);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['compress']        =                              substr($RIFFchunk[$chunkname][$thisindex]['data'],  83,   1);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['eomstrt']         = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'],  84,   4));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['eomlen']          = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'],  88,   2));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['attrib2']         = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'],  90,   4));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['future1']         =                              substr($RIFFchunk[$chunkname][$thisindex]['data'],  94,  12);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['catfontcolor']    = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 106,   4));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['catcolor']        = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 110,   4));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['segeompos']       = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 114,   4));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['vt_startsecs']    = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 118,   2));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['vt_starthunds']   = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 120,   2));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['priorcat']        =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 122,   3);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['priorcopy']       =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 125,   4);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['priorpadd']       =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 129,   1);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['postcat']         =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 130,   3);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['postcopy']        =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 133,   4);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['postpadd']        =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 137,   1);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['hrcanplay']       =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 138,  21);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['future2']         =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 159, 108);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['artist']          =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 267,  34);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['comment']         =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 301,  34); // \"trivia\" in other documentation\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['intro']           =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 335,   2);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['end']             =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 337,   1);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['year']            =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 338,   4);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['obsolete2']       =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 342,   1);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['rec_hr']          =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 343,   1);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['rdate']           =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 344,   6);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['mpeg_bitrate']    = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 350,   2));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['pitch']           = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 352,   2));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['playlevel']       = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 354,   2));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['lenvalid']        =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 356,   1);\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['filelength']      = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 357,   4));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['newplaylevel']    = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 361,   2));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['chopsize']        = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 363,   4));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['vteomovr']        = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 367,   4));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['desiredlen']      = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 371,   4));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['triggers']        = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 375,   4));\n\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['parsed']['fillout']         =                              substr($RIFFchunk[$chunkname][$thisindex]['data'], 379,   33);\n\n\t\t\t\t\t\t\t\tforeach (array('title', 'artist', 'comment') as $key) {\n\t\t\t\t\t\t\t\t\tif (trim($RIFFchunk[$chunkname][$thisindex]['parsed'][$key])) {\n\t\t\t\t\t\t\t\t\t\t$info['riff']['comments'][$key] = array($RIFFchunk[$chunkname][$thisindex]['parsed'][$key]);\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\tif ($RIFFchunk[$chunkname][$thisindex]['parsed']['filelength'] && !empty($info['filesize']) && ($RIFFchunk[$chunkname][$thisindex]['parsed']['filelength'] != $info['filesize'])) {\n\t\t\t\t\t\t\t\t\t$this->warning('RIFF.WAVE.scot.filelength ('.$RIFFchunk[$chunkname][$thisindex]['parsed']['filelength'].') different from actual filesize ('.$info['filesize'].')');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif (!empty($LISTchunkParent) && isset($LISTchunkMaxOffset) && (($RIFFchunk[$chunkname][$thisindex]['offset'] + $RIFFchunk[$chunkname][$thisindex]['size']) <= $LISTchunkMaxOffset)) {\n\t\t\t\t\t\t\t\t\t$RIFFchunk[$LISTchunkParent][$chunkname][$thisindex]['offset'] = $RIFFchunk[$chunkname][$thisindex]['offset'];\n\t\t\t\t\t\t\t\t\t$RIFFchunk[$LISTchunkParent][$chunkname][$thisindex]['size']   = $RIFFchunk[$chunkname][$thisindex]['size'];\n\t\t\t\t\t\t\t\t\tunset($RIFFchunk[$chunkname][$thisindex]['offset']);\n\t\t\t\t\t\t\t\t\tunset($RIFFchunk[$chunkname][$thisindex]['size']);\n\t\t\t\t\t\t\t\t\tif (isset($RIFFchunk[$chunkname][$thisindex]) && empty($RIFFchunk[$chunkname][$thisindex])) {\n\t\t\t\t\t\t\t\t\t\tunset($RIFFchunk[$chunkname][$thisindex]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($RIFFchunk[$chunkname]) && empty($RIFFchunk[$chunkname])) {\n\t\t\t\t\t\t\t\t\t\tunset($RIFFchunk[$chunkname]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$RIFFchunk[$LISTchunkParent][$chunkname][$thisindex]['data'] = $this->fread($chunksize);\n\t\t\t\t\t\t\t\t} elseif ($chunksize < 2048) {\n\t\t\t\t\t\t\t\t\t// only read data in if smaller than 2kB\n\t\t\t\t\t\t\t\t\t$RIFFchunk[$chunkname][$thisindex]['data'] = $this->fread($chunksize);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$this->fseek($chunksize, SEEK_CUR);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (getid3_exception $e) {\n\t\t\tif ($e->getCode() == 10) {\n\t\t\t\t$this->warning('RIFF parser: '.$e->getMessage());\n\t\t\t} else {\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}\n\n\t\treturn $RIFFchunk;\n\t}\n\n\t/**\n\t * @param string $RIFFdata\n\t *\n\t * @return bool\n\t */\n\tpublic function ParseRIFFdata(&$RIFFdata) {\n\t\t$info = &$this->getid3->info;\n\t\tif ($RIFFdata) {\n\t\t\t$tempfile = tempnam(GETID3_TEMP_DIR, 'getID3');\n\t\t\t$fp_temp  = fopen($tempfile, 'wb');\n\t\t\t$RIFFdataLength = strlen($RIFFdata);\n\t\t\t$NewLengthString = getid3_lib::LittleEndian2String($RIFFdataLength, 4);\n\t\t\tfor ($i = 0; $i < 4; $i++) {\n\t\t\t\t$RIFFdata[($i + 4)] = $NewLengthString[$i];\n\t\t\t}\n\t\t\tfwrite($fp_temp, $RIFFdata);\n\t\t\tfclose($fp_temp);\n\n\t\t\t$getid3_temp = new getID3();\n\t\t\t$getid3_temp->openfile($tempfile);\n\t\t\t$getid3_temp->info['filesize']     = $RIFFdataLength;\n\t\t\t$getid3_temp->info['filenamepath'] = $info['filenamepath'];\n\t\t\t$getid3_temp->info['tags']         = $info['tags'];\n\t\t\t$getid3_temp->info['warning']      = $info['warning'];\n\t\t\t$getid3_temp->info['error']        = $info['error'];\n\t\t\t$getid3_temp->info['comments']     = $info['comments'];\n\t\t\t$getid3_temp->info['audio']        = (isset($info['audio']) ? $info['audio'] : array());\n\t\t\t$getid3_temp->info['video']        = (isset($info['video']) ? $info['video'] : array());\n\t\t\t$getid3_riff = new getid3_riff($getid3_temp);\n\t\t\t$getid3_riff->Analyze();\n\n\t\t\t$info['riff']     = $getid3_temp->info['riff'];\n\t\t\t$info['warning']  = $getid3_temp->info['warning'];\n\t\t\t$info['error']    = $getid3_temp->info['error'];\n\t\t\t$info['tags']     = $getid3_temp->info['tags'];\n\t\t\t$info['comments'] = $getid3_temp->info['comments'];\n\t\t\tunset($getid3_riff, $getid3_temp);\n\t\t\tunlink($tempfile);\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * @param array $RIFFinfoArray\n\t * @param array $CommentsTargetArray\n\t *\n\t * @return bool\n\t */\n\tpublic static function parseComments(&$RIFFinfoArray, &$CommentsTargetArray) {\n\t\t$RIFFinfoKeyLookup = array(\n\t\t\t'IARL'=>'archivallocation',\n\t\t\t'IART'=>'artist',\n\t\t\t'ICDS'=>'costumedesigner',\n\t\t\t'ICMS'=>'commissionedby',\n\t\t\t'ICMT'=>'comment',\n\t\t\t'ICNT'=>'country',\n\t\t\t'ICOP'=>'copyright',\n\t\t\t'ICRD'=>'creationdate',\n\t\t\t'IDIM'=>'dimensions',\n\t\t\t'IDIT'=>'digitizationdate',\n\t\t\t'IDPI'=>'resolution',\n\t\t\t'IDST'=>'distributor',\n\t\t\t'IEDT'=>'editor',\n\t\t\t'IENG'=>'engineers',\n\t\t\t'IFRM'=>'accountofparts',\n\t\t\t'IGNR'=>'genre',\n\t\t\t'IKEY'=>'keywords',\n\t\t\t'ILGT'=>'lightness',\n\t\t\t'ILNG'=>'language',\n\t\t\t'IMED'=>'orignalmedium',\n\t\t\t'IMUS'=>'composer',\n\t\t\t'INAM'=>'title',\n\t\t\t'IPDS'=>'productiondesigner',\n\t\t\t'IPLT'=>'palette',\n\t\t\t'IPRD'=>'product',\n\t\t\t'IPRO'=>'producer',\n\t\t\t'IPRT'=>'part',\n\t\t\t'IRTD'=>'rating',\n\t\t\t'ISBJ'=>'subject',\n\t\t\t'ISFT'=>'software',\n\t\t\t'ISGN'=>'secondarygenre',\n\t\t\t'ISHP'=>'sharpness',\n\t\t\t'ISRC'=>'sourcesupplier',\n\t\t\t'ISRF'=>'digitizationsource',\n\t\t\t'ISTD'=>'productionstudio',\n\t\t\t'ISTR'=>'starring',\n\t\t\t'ITCH'=>'encoded_by',\n\t\t\t'IWEB'=>'url',\n\t\t\t'IWRI'=>'writer',\n\t\t\t'____'=>'comment',\n\t\t);\n\t\tforeach ($RIFFinfoKeyLookup as $key => $value) {\n\t\t\tif (isset($RIFFinfoArray[$key])) {\n\t\t\t\tforeach ($RIFFinfoArray[$key] as $commentid => $commentdata) {\n\t\t\t\t\tif (trim($commentdata['data']) != '') {\n\t\t\t\t\t\tif (isset($CommentsTargetArray[$value])) {\n\t\t\t\t\t\t\t$CommentsTargetArray[$value][] =     trim($commentdata['data']);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$CommentsTargetArray[$value] = array(trim($commentdata['data']));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $WaveFormatExData\n\t *\n\t * @return array\n\t */\n\tpublic static function parseWAVEFORMATex($WaveFormatExData) {\n\t\t// shortcut\n\t\t$WaveFormatEx        = array();\n\t\t$WaveFormatEx['raw'] = array();\n\t\t$WaveFormatEx_raw    = &$WaveFormatEx['raw'];\n\n\t\t$WaveFormatEx_raw['wFormatTag']      = substr($WaveFormatExData,  0, 2);\n\t\t$WaveFormatEx_raw['nChannels']       = substr($WaveFormatExData,  2, 2);\n\t\t$WaveFormatEx_raw['nSamplesPerSec']  = substr($WaveFormatExData,  4, 4);\n\t\t$WaveFormatEx_raw['nAvgBytesPerSec'] = substr($WaveFormatExData,  8, 4);\n\t\t$WaveFormatEx_raw['nBlockAlign']     = substr($WaveFormatExData, 12, 2);\n\t\t$WaveFormatEx_raw['wBitsPerSample']  = substr($WaveFormatExData, 14, 2);\n\t\tif (strlen($WaveFormatExData) > 16) {\n\t\t\t$WaveFormatEx_raw['cbSize']      = substr($WaveFormatExData, 16, 2);\n\t\t}\n\t\t$WaveFormatEx_raw = array_map('getid3_lib::LittleEndian2Int', $WaveFormatEx_raw);\n\n\t\t$WaveFormatEx['codec']           = self::wFormatTagLookup($WaveFormatEx_raw['wFormatTag']);\n\t\t$WaveFormatEx['channels']        = $WaveFormatEx_raw['nChannels'];\n\t\t$WaveFormatEx['sample_rate']     = $WaveFormatEx_raw['nSamplesPerSec'];\n\t\t$WaveFormatEx['bitrate']         = $WaveFormatEx_raw['nAvgBytesPerSec'] * 8;\n\t\t$WaveFormatEx['bits_per_sample'] = $WaveFormatEx_raw['wBitsPerSample'];\n\n\t\treturn $WaveFormatEx;\n\t}\n\n\t/**\n\t * @param string $WavPackChunkData\n\t *\n\t * @return bool\n\t */\n\tpublic function parseWavPackHeader($WavPackChunkData) {\n\t\t// typedef struct {\n\t\t//     char ckID [4];\n\t\t//     long ckSize;\n\t\t//     short version;\n\t\t//     short bits;                // added for version 2.00\n\t\t//     short flags, shift;        // added for version 3.00\n\t\t//     long total_samples, crc, crc2;\n\t\t//     char extension [4], extra_bc, extras [3];\n\t\t// } WavpackHeader;\n\n\t\t// shortcut\n\t\t$info = &$this->getid3->info;\n\t\t$info['wavpack']  = array();\n\t\t$thisfile_wavpack = &$info['wavpack'];\n\n\t\t$thisfile_wavpack['version']           = getid3_lib::LittleEndian2Int(substr($WavPackChunkData,  0, 2));\n\t\tif ($thisfile_wavpack['version'] >= 2) {\n\t\t\t$thisfile_wavpack['bits']          = getid3_lib::LittleEndian2Int(substr($WavPackChunkData,  2, 2));\n\t\t}\n\t\tif ($thisfile_wavpack['version'] >= 3) {\n\t\t\t$thisfile_wavpack['flags_raw']     = getid3_lib::LittleEndian2Int(substr($WavPackChunkData,  4, 2));\n\t\t\t$thisfile_wavpack['shift']         = getid3_lib::LittleEndian2Int(substr($WavPackChunkData,  6, 2));\n\t\t\t$thisfile_wavpack['total_samples'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData,  8, 4));\n\t\t\t$thisfile_wavpack['crc1']          = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 12, 4));\n\t\t\t$thisfile_wavpack['crc2']          = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 16, 4));\n\t\t\t$thisfile_wavpack['extension']     =                              substr($WavPackChunkData, 20, 4);\n\t\t\t$thisfile_wavpack['extra_bc']      = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 24, 1));\n\t\t\tfor ($i = 0; $i <= 2; $i++) {\n\t\t\t\t$thisfile_wavpack['extras'][]  = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 25 + $i, 1));\n\t\t\t}\n\n\t\t\t// shortcut\n\t\t\t$thisfile_wavpack['flags'] = array();\n\t\t\t$thisfile_wavpack_flags = &$thisfile_wavpack['flags'];\n\n\t\t\t$thisfile_wavpack_flags['mono']                 = (bool) ($thisfile_wavpack['flags_raw'] & 0x000001);\n\t\t\t$thisfile_wavpack_flags['fast_mode']            = (bool) ($thisfile_wavpack['flags_raw'] & 0x000002);\n\t\t\t$thisfile_wavpack_flags['raw_mode']             = (bool) ($thisfile_wavpack['flags_raw'] & 0x000004);\n\t\t\t$thisfile_wavpack_flags['calc_noise']           = (bool) ($thisfile_wavpack['flags_raw'] & 0x000008);\n\t\t\t$thisfile_wavpack_flags['high_quality']         = (bool) ($thisfile_wavpack['flags_raw'] & 0x000010);\n\t\t\t$thisfile_wavpack_flags['3_byte_samples']       = (bool) ($thisfile_wavpack['flags_raw'] & 0x000020);\n\t\t\t$thisfile_wavpack_flags['over_20_bits']         = (bool) ($thisfile_wavpack['flags_raw'] & 0x000040);\n\t\t\t$thisfile_wavpack_flags['use_wvc']              = (bool) ($thisfile_wavpack['flags_raw'] & 0x000080);\n\t\t\t$thisfile_wavpack_flags['noiseshaping']         = (bool) ($thisfile_wavpack['flags_raw'] & 0x000100);\n\t\t\t$thisfile_wavpack_flags['very_fast_mode']       = (bool) ($thisfile_wavpack['flags_raw'] & 0x000200);\n\t\t\t$thisfile_wavpack_flags['new_high_quality']     = (bool) ($thisfile_wavpack['flags_raw'] & 0x000400);\n\t\t\t$thisfile_wavpack_flags['cancel_extreme']       = (bool) ($thisfile_wavpack['flags_raw'] & 0x000800);\n\t\t\t$thisfile_wavpack_flags['cross_decorrelation']  = (bool) ($thisfile_wavpack['flags_raw'] & 0x001000);\n\t\t\t$thisfile_wavpack_flags['new_decorrelation']    = (bool) ($thisfile_wavpack['flags_raw'] & 0x002000);\n\t\t\t$thisfile_wavpack_flags['joint_stereo']         = (bool) ($thisfile_wavpack['flags_raw'] & 0x004000);\n\t\t\t$thisfile_wavpack_flags['extra_decorrelation']  = (bool) ($thisfile_wavpack['flags_raw'] & 0x008000);\n\t\t\t$thisfile_wavpack_flags['override_noiseshape']  = (bool) ($thisfile_wavpack['flags_raw'] & 0x010000);\n\t\t\t$thisfile_wavpack_flags['override_jointstereo'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x020000);\n\t\t\t$thisfile_wavpack_flags['copy_source_filetime'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x040000);\n\t\t\t$thisfile_wavpack_flags['create_exe']           = (bool) ($thisfile_wavpack['flags_raw'] & 0x080000);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $BITMAPINFOHEADER\n\t * @param bool   $littleEndian\n\t *\n\t * @return array\n\t */\n\tpublic static function ParseBITMAPINFOHEADER($BITMAPINFOHEADER, $littleEndian=true) {\n\n\t\t$parsed['biSize']          = substr($BITMAPINFOHEADER,  0, 4); // number of bytes required by the BITMAPINFOHEADER structure\n\t\t$parsed['biWidth']         = substr($BITMAPINFOHEADER,  4, 4); // width of the bitmap in pixels\n\t\t$parsed['biHeight']        = substr($BITMAPINFOHEADER,  8, 4); // height of the bitmap in pixels. If biHeight is positive, the bitmap is a 'bottom-up' DIB and its origin is the lower left corner. If biHeight is negative, the bitmap is a 'top-down' DIB and its origin is the upper left corner\n\t\t$parsed['biPlanes']        = substr($BITMAPINFOHEADER, 12, 2); // number of color planes on the target device. In most cases this value must be set to 1\n\t\t$parsed['biBitCount']      = substr($BITMAPINFOHEADER, 14, 2); // Specifies the number of bits per pixels\n\t\t$parsed['biSizeImage']     = substr($BITMAPINFOHEADER, 20, 4); // size of the bitmap data section of the image (the actual pixel data, excluding BITMAPINFOHEADER and RGBQUAD structures)\n\t\t$parsed['biXPelsPerMeter'] = substr($BITMAPINFOHEADER, 24, 4); // horizontal resolution, in pixels per metre, of the target device\n\t\t$parsed['biYPelsPerMeter'] = substr($BITMAPINFOHEADER, 28, 4); // vertical resolution, in pixels per metre, of the target device\n\t\t$parsed['biClrUsed']       = substr($BITMAPINFOHEADER, 32, 4); // actual number of color indices in the color table used by the bitmap. If this value is zero, the bitmap uses the maximum number of colors corresponding to the value of the biBitCount member for the compression mode specified by biCompression\n\t\t$parsed['biClrImportant']  = substr($BITMAPINFOHEADER, 36, 4); // number of color indices that are considered important for displaying the bitmap. If this value is zero, all colors are important\n\t\t$parsed = array_map('getid3_lib::'.($littleEndian ? 'Little' : 'Big').'Endian2Int', $parsed);\n\n\t\t$parsed['fourcc']          = substr($BITMAPINFOHEADER, 16, 4);  // compression identifier\n\n\t\treturn $parsed;\n\t}\n\n\t/**\n\t * @param string $DIVXTAG\n\t * @param bool   $raw\n\t *\n\t * @return array\n\t */\n\tpublic static function ParseDIVXTAG($DIVXTAG, $raw=false) {\n\t\t// structure from \"IDivX\" source, Form1.frm, by \"Greg Frazier of Daemonic Software Group\", email: gfrazier@icestorm.net, web: http://dsg.cjb.net/\n\t\t// source available at http://files.divx-digest.com/download/c663efe7ef8ad2e90bf4af4d3ea6188a/on0SWN2r/edit/IDivX.zip\n\t\t// 'Byte Layout:                   '1111111111111111\n\t\t// '32 for Movie - 1               '1111111111111111\n\t\t// '28 for Author - 6              '6666666666666666\n\t\t// '4  for year - 2                '6666666666662222\n\t\t// '3  for genre - 3               '7777777777777777\n\t\t// '48 for Comments - 7            '7777777777777777\n\t\t// '1  for Rating - 4              '7777777777777777\n\t\t// '5  for Future Additions - 0    '333400000DIVXTAG\n\t\t// '128 bytes total\n\n\t\tstatic $DIVXTAGgenre  = array(\n\t\t\t 0 => 'Action',\n\t\t\t 1 => 'Action/Adventure',\n\t\t\t 2 => 'Adventure',\n\t\t\t 3 => 'Adult',\n\t\t\t 4 => 'Anime',\n\t\t\t 5 => 'Cartoon',\n\t\t\t 6 => 'Claymation',\n\t\t\t 7 => 'Comedy',\n\t\t\t 8 => 'Commercial',\n\t\t\t 9 => 'Documentary',\n\t\t\t10 => 'Drama',\n\t\t\t11 => 'Home Video',\n\t\t\t12 => 'Horror',\n\t\t\t13 => 'Infomercial',\n\t\t\t14 => 'Interactive',\n\t\t\t15 => 'Mystery',\n\t\t\t16 => 'Music Video',\n\t\t\t17 => 'Other',\n\t\t\t18 => 'Religion',\n\t\t\t19 => 'Sci Fi',\n\t\t\t20 => 'Thriller',\n\t\t\t21 => 'Western',\n\t\t),\n\t\t$DIVXTAGrating = array(\n\t\t\t 0 => 'Unrated',\n\t\t\t 1 => 'G',\n\t\t\t 2 => 'PG',\n\t\t\t 3 => 'PG-13',\n\t\t\t 4 => 'R',\n\t\t\t 5 => 'NC-17',\n\t\t);\n\n\t\t$parsed              = array();\n\t\t$parsed['title']     =        trim(substr($DIVXTAG,   0, 32));\n\t\t$parsed['artist']    =        trim(substr($DIVXTAG,  32, 28));\n\t\t$parsed['year']      = intval(trim(substr($DIVXTAG,  60,  4)));\n\t\t$parsed['comment']   =        trim(substr($DIVXTAG,  64, 48));\n\t\t$parsed['genre_id']  = intval(trim(substr($DIVXTAG, 112,  3)));\n\t\t$parsed['rating_id'] =         ord(substr($DIVXTAG, 115,  1));\n\t\t//$parsed['padding'] =             substr($DIVXTAG, 116,  5);  // 5-byte null\n\t\t//$parsed['magic']   =             substr($DIVXTAG, 121,  7);  // \"DIVXTAG\"\n\n\t\t$parsed['genre']  = (isset($DIVXTAGgenre[$parsed['genre_id']])   ? $DIVXTAGgenre[$parsed['genre_id']]   : $parsed['genre_id']);\n\t\t$parsed['rating'] = (isset($DIVXTAGrating[$parsed['rating_id']]) ? $DIVXTAGrating[$parsed['rating_id']] : $parsed['rating_id']);\n\n\t\tif (!$raw) {\n\t\t\tunset($parsed['genre_id'], $parsed['rating_id']);\n\t\t\tforeach ($parsed as $key => $value) {\n\t\t\t\tif (empty($value)) {\n\t\t\t\t\tunset($parsed[$key]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tforeach ($parsed as $tag => $value) {\n\t\t\t$parsed[$tag] = array($value);\n\t\t}\n\n\t\treturn $parsed;\n\t}\n\n\t/**\n\t * @param string $tagshortname\n\t *\n\t * @return string\n\t */\n\tpublic static function waveSNDMtagLookup($tagshortname) {\n\t\t$begin = __LINE__;\n\n\t\t/** This is not a comment!\n\n\t\t\t\u00c2\u00a9kwd\tkeywords\n\t\t\t\u00c2\u00a9BPM\tbpm\n\t\t\t\u00c2\u00a9trt\ttracktitle\n\t\t\t\u00c2\u00a9des\tdescription\n\t\t\t\u00c2\u00a9gen\tcategory\n\t\t\t\u00c2\u00a9fin\tfeaturedinstrument\n\t\t\t\u00c2\u00a9LID\tlongid\n\t\t\t\u00c2\u00a9bex\tbwdescription\n\t\t\t\u00c2\u00a9pub\tpublisher\n\t\t\t\u00c2\u00a9cdt\tcdtitle\n\t\t\t\u00c2\u00a9alb\tlibrary\n\t\t\t\u00c2\u00a9com\tcomposer\n\n\t\t*/\n\n\t\treturn getid3_lib::EmbeddedLookup($tagshortname, $begin, __LINE__, __FILE__, 'riff-sndm');\n\t}\n\n\t/**\n\t * @param int $wFormatTag\n\t *\n\t * @return string\n\t */\n\tpublic static function wFormatTagLookup($wFormatTag) {\n\n\t\t$begin = __LINE__;\n\n\t\t/** This is not a comment!\n\n\t\t\t0x0000\tMicrosoft Unknown Wave Format\n\t\t\t0x0001\tPulse Code Modulation (PCM)\n\t\t\t0x0002\tMicrosoft ADPCM\n\t\t\t0x0003\tIEEE Float\n\t\t\t0x0004\tCompaq Computer VSELP\n\t\t\t0x0005\tIBM CVSD\n\t\t\t0x0006\tMicrosoft A-Law\n\t\t\t0x0007\tMicrosoft mu-Law\n\t\t\t0x0008\tMicrosoft DTS\n\t\t\t0x0010\tOKI ADPCM\n\t\t\t0x0011\tIntel DVI/IMA ADPCM\n\t\t\t0x0012\tVideologic MediaSpace ADPCM\n\t\t\t0x0013\tSierra Semiconductor ADPCM\n\t\t\t0x0014\tAntex Electronics G.723 ADPCM\n\t\t\t0x0015\tDSP Solutions DigiSTD\n\t\t\t0x0016\tDSP Solutions DigiFIX\n\t\t\t0x0017\tDialogic OKI ADPCM\n\t\t\t0x0018\tMediaVision ADPCM\n\t\t\t0x0019\tHewlett-Packard CU\n\t\t\t0x0020\tYamaha ADPCM\n\t\t\t0x0021\tSpeech Compression Sonarc\n\t\t\t0x0022\tDSP Group TrueSpeech\n\t\t\t0x0023\tEcho Speech EchoSC1\n\t\t\t0x0024\tAudiofile AF36\n\t\t\t0x0025\tAudio Processing Technology APTX\n\t\t\t0x0026\tAudioFile AF10\n\t\t\t0x0027\tProsody 1612\n\t\t\t0x0028\tLRC\n\t\t\t0x0030\tDolby AC2\n\t\t\t0x0031\tMicrosoft GSM 6.10\n\t\t\t0x0032\tMSNAudio\n\t\t\t0x0033\tAntex Electronics ADPCME\n\t\t\t0x0034\tControl Resources VQLPC\n\t\t\t0x0035\tDSP Solutions DigiREAL\n\t\t\t0x0036\tDSP Solutions DigiADPCM\n\t\t\t0x0037\tControl Resources CR10\n\t\t\t0x0038\tNatural MicroSystems VBXADPCM\n\t\t\t0x0039\tCrystal Semiconductor IMA ADPCM\n\t\t\t0x003A\tEchoSC3\n\t\t\t0x003B\tRockwell ADPCM\n\t\t\t0x003C\tRockwell Digit LK\n\t\t\t0x003D\tXebec\n\t\t\t0x0040\tAntex Electronics G.721 ADPCM\n\t\t\t0x0041\tG.728 CELP\n\t\t\t0x0042\tMSG723\n\t\t\t0x0050\tMPEG Layer-2 or Layer-1\n\t\t\t0x0052\tRT24\n\t\t\t0x0053\tPAC\n\t\t\t0x0055\tMPEG Layer-3\n\t\t\t0x0059\tLucent G.723\n\t\t\t0x0060\tCirrus\n\t\t\t0x0061\tESPCM\n\t\t\t0x0062\tVoxware\n\t\t\t0x0063\tCanopus Atrac\n\t\t\t0x0064\tG.726 ADPCM\n\t\t\t0x0065\tG.722 ADPCM\n\t\t\t0x0066\tDSAT\n\t\t\t0x0067\tDSAT Display\n\t\t\t0x0069\tVoxware Byte Aligned\n\t\t\t0x0070\tVoxware AC8\n\t\t\t0x0071\tVoxware AC10\n\t\t\t0x0072\tVoxware AC16\n\t\t\t0x0073\tVoxware AC20\n\t\t\t0x0074\tVoxware MetaVoice\n\t\t\t0x0075\tVoxware MetaSound\n\t\t\t0x0076\tVoxware RT29HW\n\t\t\t0x0077\tVoxware VR12\n\t\t\t0x0078\tVoxware VR18\n\t\t\t0x0079\tVoxware TQ40\n\t\t\t0x0080\tSoftsound\n\t\t\t0x0081\tVoxware TQ60\n\t\t\t0x0082\tMSRT24\n\t\t\t0x0083\tG.729A\n\t\t\t0x0084\tMVI MV12\n\t\t\t0x0085\tDF G.726\n\t\t\t0x0086\tDF GSM610\n\t\t\t0x0088\tISIAudio\n\t\t\t0x0089\tOnlive\n\t\t\t0x0091\tSBC24\n\t\t\t0x0092\tDolby AC3 SPDIF\n\t\t\t0x0093\tMediaSonic G.723\n\t\t\t0x0094\tAculab PLC    Prosody 8kbps\n\t\t\t0x0097\tZyXEL ADPCM\n\t\t\t0x0098\tPhilips LPCBB\n\t\t\t0x0099\tPacked\n\t\t\t0x00FF\tAAC\n\t\t\t0x0100\tRhetorex ADPCM\n\t\t\t0x0101\tIBM mu-law\n\t\t\t0x0102\tIBM A-law\n\t\t\t0x0103\tIBM AVC Adaptive Differential Pulse Code Modulation (ADPCM)\n\t\t\t0x0111\tVivo G.723\n\t\t\t0x0112\tVivo Siren\n\t\t\t0x0123\tDigital G.723\n\t\t\t0x0125\tSanyo LD ADPCM\n\t\t\t0x0130\tSipro Lab Telecom ACELP NET\n\t\t\t0x0131\tSipro Lab Telecom ACELP 4800\n\t\t\t0x0132\tSipro Lab Telecom ACELP 8V3\n\t\t\t0x0133\tSipro Lab Telecom G.729\n\t\t\t0x0134\tSipro Lab Telecom G.729A\n\t\t\t0x0135\tSipro Lab Telecom Kelvin\n\t\t\t0x0140\tWindows Media Video V8\n\t\t\t0x0150\tQualcomm PureVoice\n\t\t\t0x0151\tQualcomm HalfRate\n\t\t\t0x0155\tRing Zero Systems TUB GSM\n\t\t\t0x0160\tMicrosoft Audio 1\n\t\t\t0x0161\tWindows Media Audio V7 / V8 / V9\n\t\t\t0x0162\tWindows Media Audio Professional V9\n\t\t\t0x0163\tWindows Media Audio Lossless V9\n\t\t\t0x0200\tCreative Labs ADPCM\n\t\t\t0x0202\tCreative Labs Fastspeech8\n\t\t\t0x0203\tCreative Labs Fastspeech10\n\t\t\t0x0210\tUHER Informatic GmbH ADPCM\n\t\t\t0x0220\tQuarterdeck\n\t\t\t0x0230\tI-link Worldwide VC\n\t\t\t0x0240\tAureal RAW Sport\n\t\t\t0x0250\tInteractive Products HSX\n\t\t\t0x0251\tInteractive Products RPELP\n\t\t\t0x0260\tConsistent Software CS2\n\t\t\t0x0270\tSony SCX\n\t\t\t0x0300\tFujitsu FM Towns Snd\n\t\t\t0x0400\tBTV Digital\n\t\t\t0x0401\tIntel Music Coder\n\t\t\t0x0450\tQDesign Music\n\t\t\t0x0680\tVME VMPCM\n\t\t\t0x0681\tAT&T Labs TPC\n\t\t\t0x08AE\tClearJump LiteWave\n\t\t\t0x1000\tOlivetti GSM\n\t\t\t0x1001\tOlivetti ADPCM\n\t\t\t0x1002\tOlivetti CELP\n\t\t\t0x1003\tOlivetti SBC\n\t\t\t0x1004\tOlivetti OPR\n\t\t\t0x1100\tLernout & Hauspie Codec (0x1100)\n\t\t\t0x1101\tLernout & Hauspie CELP Codec (0x1101)\n\t\t\t0x1102\tLernout & Hauspie SBC Codec (0x1102)\n\t\t\t0x1103\tLernout & Hauspie SBC Codec (0x1103)\n\t\t\t0x1104\tLernout & Hauspie SBC Codec (0x1104)\n\t\t\t0x1400\tNorris\n\t\t\t0x1401\tAT&T ISIAudio\n\t\t\t0x1500\tSoundspace Music Compression\n\t\t\t0x181C\tVoxWare RT24 Speech\n\t\t\t0x1FC4\tNCT Soft ALF2CD (www.nctsoft.com)\n\t\t\t0x2000\tDolby AC3\n\t\t\t0x2001\tDolby DTS\n\t\t\t0x2002\tWAVE_FORMAT_14_4\n\t\t\t0x2003\tWAVE_FORMAT_28_8\n\t\t\t0x2004\tWAVE_FORMAT_COOK\n\t\t\t0x2005\tWAVE_FORMAT_DNET\n\t\t\t0x674F\tOgg Vorbis 1\n\t\t\t0x6750\tOgg Vorbis 2\n\t\t\t0x6751\tOgg Vorbis 3\n\t\t\t0x676F\tOgg Vorbis 1+\n\t\t\t0x6770\tOgg Vorbis 2+\n\t\t\t0x6771\tOgg Vorbis 3+\n\t\t\t0x7A21\tGSM-AMR (CBR, no SID)\n\t\t\t0x7A22\tGSM-AMR (VBR, including SID)\n\t\t\t0xFFFE\tWAVE_FORMAT_EXTENSIBLE\n\t\t\t0xFFFF\tWAVE_FORMAT_DEVELOPMENT\n\n\t\t*/\n\n\t\treturn getid3_lib::EmbeddedLookup('0x'.str_pad(strtoupper(dechex($wFormatTag)), 4, '0', STR_PAD_LEFT), $begin, __LINE__, __FILE__, 'riff-wFormatTag');\n\t}\n\n\t/**\n\t * @param string $fourcc\n\t *\n\t * @return string\n\t */\n\tpublic static function fourccLookup($fourcc) {\n\n\t\t$begin = __LINE__;\n\n\t\t/** This is not a comment!\n\n\t\t\tswot\thttp://developer.apple.com/qa/snd/snd07.html\n\t\t\t____\tNo Codec (____)\n\t\t\t_BIT\tBI_BITFIELDS (Raw RGB)\n\t\t\t_JPG\tJPEG compressed\n\t\t\t_PNG\tPNG compressed W3C/ISO/IEC (RFC-2083)\n\t\t\t_RAW\tFull Frames (Uncompressed)\n\t\t\t_RGB\tRaw RGB Bitmap\n\t\t\t_RL4\tRLE 4bpp RGB\n\t\t\t_RL8\tRLE 8bpp RGB\n\t\t\t3IV1\t3ivx MPEG-4 v1\n\t\t\t3IV2\t3ivx MPEG-4 v2\n\t\t\t3IVX\t3ivx MPEG-4\n\t\t\tAASC\tAutodesk Animator\n\t\t\tABYR\tKensington ?ABYR?\n\t\t\tAEMI\tArray Microsystems VideoONE MPEG1-I Capture\n\t\t\tAFLC\tAutodesk Animator FLC\n\t\t\tAFLI\tAutodesk Animator FLI\n\t\t\tAMPG\tArray Microsystems VideoONE MPEG\n\t\t\tANIM\tIntel RDX (ANIM)\n\t\t\tAP41\tAngelPotion Definitive\n\t\t\tASV1\tAsus Video v1\n\t\t\tASV2\tAsus Video v2\n\t\t\tASVX\tAsus Video 2.0 (audio)\n\t\t\tAUR2\tAuraVision Aura 2 Codec - YUV 4:2:2\n\t\t\tAURA\tAuraVision Aura 1 Codec - YUV 4:1:1\n\t\t\tAVDJ\tIndependent JPEG Group\\'s codec (AVDJ)\n\t\t\tAVRN\tIndependent JPEG Group\\'s codec (AVRN)\n\t\t\tAYUV\t4:4:4 YUV (AYUV)\n\t\t\tAZPR\tQuicktime Apple Video (AZPR)\n\t\t\tBGR \tRaw RGB32\n\t\t\tBLZ0\tBlizzard DivX MPEG-4\n\t\t\tBTVC\tConexant Composite Video\n\t\t\tBINK\tRAD Game Tools Bink Video\n\t\t\tBT20\tConexant Prosumer Video\n\t\t\tBTCV\tConexant Composite Video Codec\n\t\t\tBW10\tData Translation Broadway MPEG Capture\n\t\t\tCC12\tIntel YUV12\n\t\t\tCDVC\tCanopus DV\n\t\t\tCFCC\tDigital Processing Systems DPS Perception\n\t\t\tCGDI\tMicrosoft Office 97 Camcorder Video\n\t\t\tCHAM\tWinnov Caviara Champagne\n\t\t\tCJPG\tCreative WebCam JPEG\n\t\t\tCLJR\tCirrus Logic YUV 4:1:1\n\t\t\tCMYK\tCommon Data Format in Printing (Colorgraph)\n\t\t\tCPLA\tWeitek 4:2:0 YUV Planar\n\t\t\tCRAM\tMicrosoft Video 1 (CRAM)\n\t\t\tcvid\tRadius Cinepak\n\t\t\tCVID\tRadius Cinepak\n\t\t\tCWLT\tMicrosoft Color WLT DIB\n\t\t\tCYUV\tCreative Labs YUV\n\t\t\tCYUY\tATI YUV\n\t\t\tD261\tH.261\n\t\t\tD263\tH.263\n\t\t\tDIB \tDevice Independent Bitmap\n\t\t\tDIV1\tFFmpeg OpenDivX\n\t\t\tDIV2\tMicrosoft MPEG-4 v1/v2\n\t\t\tDIV3\tDivX ;-) MPEG-4 v3.x Low-Motion\n\t\t\tDIV4\tDivX ;-) MPEG-4 v3.x Fast-Motion\n\t\t\tDIV5\tDivX MPEG-4 v5.x\n\t\t\tDIV6\tDivX ;-) (MS MPEG-4 v3.x)\n\t\t\tDIVX\tDivX MPEG-4 v4 (OpenDivX / Project Mayo)\n\t\t\tdivx\tDivX MPEG-4\n\t\t\tDMB1\tMatrox Rainbow Runner hardware MJPEG\n\t\t\tDMB2\tParadigm MJPEG\n\t\t\tDSVD\t?DSVD?\n\t\t\tDUCK\tDuck TrueMotion 1.0\n\t\t\tDPS0\tDPS/Leitch Reality Motion JPEG\n\t\t\tDPSC\tDPS/Leitch PAR Motion JPEG\n\t\t\tDV25\tMatrox DVCPRO codec\n\t\t\tDV50\tMatrox DVCPRO50 codec\n\t\t\tDVC \tIEC 61834 and SMPTE 314M (DVC/DV Video)\n\t\t\tDVCP\tIEC 61834 and SMPTE 314M (DVC/DV Video)\n\t\t\tDVHD\tIEC Standard DV 1125 lines @ 30fps / 1250 lines @ 25fps\n\t\t\tDVMA\tDarim Vision DVMPEG (dummy for MPEG compressor) (www.darvision.com)\n\t\t\tDVSL\tIEC Standard DV compressed in SD (SDL)\n\t\t\tDVAN\t?DVAN?\n\t\t\tDVE2\tInSoft DVE-2 Videoconferencing\n\t\t\tdvsd\tIEC 61834 and SMPTE 314M DVC/DV Video\n\t\t\tDVSD\tIEC 61834 and SMPTE 314M DVC/DV Video\n\t\t\tDVX1\tLucent DVX1000SP Video Decoder\n\t\t\tDVX2\tLucent DVX2000S Video Decoder\n\t\t\tDVX3\tLucent DVX3000S Video Decoder\n\t\t\tDX50\tDivX v5\n\t\t\tDXT1\tMicrosoft DirectX Compressed Texture (DXT1)\n\t\t\tDXT2\tMicrosoft DirectX Compressed Texture (DXT2)\n\t\t\tDXT3\tMicrosoft DirectX Compressed Texture (DXT3)\n\t\t\tDXT4\tMicrosoft DirectX Compressed Texture (DXT4)\n\t\t\tDXT5\tMicrosoft DirectX Compressed Texture (DXT5)\n\t\t\tDXTC\tMicrosoft DirectX Compressed Texture (DXTC)\n\t\t\tDXTn\tMicrosoft DirectX Compressed Texture (DXTn)\n\t\t\tEM2V\tEtymonix MPEG-2 I-frame (www.etymonix.com)\n\t\t\tEKQ0\tElsa ?EKQ0?\n\t\t\tELK0\tElsa ?ELK0?\n\t\t\tESCP\tEidos Escape\n\t\t\tETV1\teTreppid Video ETV1\n\t\t\tETV2\teTreppid Video ETV2\n\t\t\tETVC\teTreppid Video ETVC\n\t\t\tFLIC\tAutodesk FLI/FLC Animation\n\t\t\tFLV1\tSorenson Spark\n\t\t\tFLV4\tOn2 TrueMotion VP6\n\t\t\tFRWT\tDarim Vision Forward Motion JPEG (www.darvision.com)\n\t\t\tFRWU\tDarim Vision Forward Uncompressed (www.darvision.com)\n\t\t\tFLJP\tD-Vision Field Encoded Motion JPEG\n\t\t\tFPS1\tFRAPS v1\n\t\t\tFRWA\tSoftLab-Nsk Forward Motion JPEG w/ alpha channel\n\t\t\tFRWD\tSoftLab-Nsk Forward Motion JPEG\n\t\t\tFVF1\tIterated Systems Fractal Video Frame\n\t\t\tGLZW\tMotion LZW (gabest@freemail.hu)\n\t\t\tGPEG\tMotion JPEG (gabest@freemail.hu)\n\t\t\tGWLT\tMicrosoft Greyscale WLT DIB\n\t\t\tH260\tIntel ITU H.260 Videoconferencing\n\t\t\tH261\tIntel ITU H.261 Videoconferencing\n\t\t\tH262\tIntel ITU H.262 Videoconferencing\n\t\t\tH263\tIntel ITU H.263 Videoconferencing\n\t\t\tH264\tIntel ITU H.264 Videoconferencing\n\t\t\tH265\tIntel ITU H.265 Videoconferencing\n\t\t\tH266\tIntel ITU H.266 Videoconferencing\n\t\t\tH267\tIntel ITU H.267 Videoconferencing\n\t\t\tH268\tIntel ITU H.268 Videoconferencing\n\t\t\tH269\tIntel ITU H.269 Videoconferencing\n\t\t\tHFYU\tHuffman Lossless Codec\n\t\t\tHMCR\tRendition Motion Compensation Format (HMCR)\n\t\t\tHMRR\tRendition Motion Compensation Format (HMRR)\n\t\t\tI263\tFFmpeg I263 decoder\n\t\t\tIF09\tIndeo YVU9 (\"YVU9 with additional delta-frame info after the U plane\")\n\t\t\tIUYV\tInterlaced version of UYVY (www.leadtools.com)\n\t\t\tIY41\tInterlaced version of Y41P (www.leadtools.com)\n\t\t\tIYU1\t12 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec    IEEE standard\n\t\t\tIYU2\t24 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec    IEEE standard\n\t\t\tIYUV\tPlanar YUV format (8-bpp Y plane, followed by 8-bpp 2\u00c3\u20142 U and V planes)\n\t\t\ti263\tIntel ITU H.263 Videoconferencing (i263)\n\t\t\tI420\tIntel Indeo 4\n\t\t\tIAN \tIntel Indeo 4 (RDX)\n\t\t\tICLB\tInSoft CellB Videoconferencing\n\t\t\tIGOR\tPower DVD\n\t\t\tIJPG\tIntergraph JPEG\n\t\t\tILVC\tIntel Layered Video\n\t\t\tILVR\tITU-T H.263+\n\t\t\tIPDV\tI-O Data Device Giga AVI DV Codec\n\t\t\tIR21\tIntel Indeo 2.1\n\t\t\tIRAW\tIntel YUV Uncompressed\n\t\t\tIV30\tIntel Indeo 3.0\n\t\t\tIV31\tIntel Indeo 3.1\n\t\t\tIV32\tLigos Indeo 3.2\n\t\t\tIV33\tLigos Indeo 3.3\n\t\t\tIV34\tLigos Indeo 3.4\n\t\t\tIV35\tLigos Indeo 3.5\n\t\t\tIV36\tLigos Indeo 3.6\n\t\t\tIV37\tLigos Indeo 3.7\n\t\t\tIV38\tLigos Indeo 3.8\n\t\t\tIV39\tLigos Indeo 3.9\n\t\t\tIV40\tLigos Indeo Interactive 4.0\n\t\t\tIV41\tLigos Indeo Interactive 4.1\n\t\t\tIV42\tLigos Indeo Interactive 4.2\n\t\t\tIV43\tLigos Indeo Interactive 4.3\n\t\t\tIV44\tLigos Indeo Interactive 4.4\n\t\t\tIV45\tLigos Indeo Interactive 4.5\n\t\t\tIV46\tLigos Indeo Interactive 4.6\n\t\t\tIV47\tLigos Indeo Interactive 4.7\n\t\t\tIV48\tLigos Indeo Interactive 4.8\n\t\t\tIV49\tLigos Indeo Interactive 4.9\n\t\t\tIV50\tLigos Indeo Interactive 5.0\n\t\t\tJBYR\tKensington ?JBYR?\n\t\t\tJPEG\tStill Image JPEG DIB\n\t\t\tJPGL\tPegasus Lossless Motion JPEG\n\t\t\tKMVC\tTeam17 Software Karl Morton\\'s Video Codec\n\t\t\tLSVM\tVianet Lighting Strike Vmail (Streaming) (www.vianet.com)\n\t\t\tLEAD\tLEAD Video Codec\n\t\t\tLjpg\tLEAD MJPEG Codec\n\t\t\tMDVD\tAlex MicroDVD Video (hacked MS MPEG-4) (www.tiasoft.de)\n\t\t\tMJPA\tMorgan Motion JPEG (MJPA) (www.morgan-multimedia.com)\n\t\t\tMJPB\tMorgan Motion JPEG (MJPB) (www.morgan-multimedia.com)\n\t\t\tMMES\tMatrox MPEG-2 I-frame\n\t\t\tMP2v\tMicrosoft S-Mpeg 4 version 1 (MP2v)\n\t\t\tMP42\tMicrosoft S-Mpeg 4 version 2 (MP42)\n\t\t\tMP43\tMicrosoft S-Mpeg 4 version 3 (MP43)\n\t\t\tMP4S\tMicrosoft S-Mpeg 4 version 3 (MP4S)\n\t\t\tMP4V\tFFmpeg MPEG-4\n\t\t\tMPG1\tFFmpeg MPEG 1/2\n\t\t\tMPG2\tFFmpeg MPEG 1/2\n\t\t\tMPG3\tFFmpeg DivX ;-) (MS MPEG-4 v3)\n\t\t\tMPG4\tMicrosoft MPEG-4\n\t\t\tMPGI\tSigma Designs MPEG\n\t\t\tMPNG\tPNG images decoder\n\t\t\tMSS1\tMicrosoft Windows Screen Video\n\t\t\tMSZH\tLCL (Lossless Codec Library) (www.geocities.co.jp/Playtown-Denei/2837/LRC.htm)\n\t\t\tM261\tMicrosoft H.261\n\t\t\tM263\tMicrosoft H.263\n\t\t\tM4S2\tMicrosoft Fully Compliant MPEG-4 v2 simple profile (M4S2)\n\t\t\tm4s2\tMicrosoft Fully Compliant MPEG-4 v2 simple profile (m4s2)\n\t\t\tMC12\tATI Motion Compensation Format (MC12)\n\t\t\tMCAM\tATI Motion Compensation Format (MCAM)\n\t\t\tMJ2C\tMorgan Multimedia Motion JPEG2000\n\t\t\tmJPG\tIBM Motion JPEG w/ Huffman Tables\n\t\t\tMJPG\tMicrosoft Motion JPEG DIB\n\t\t\tMP42\tMicrosoft MPEG-4 (low-motion)\n\t\t\tMP43\tMicrosoft MPEG-4 (fast-motion)\n\t\t\tMP4S\tMicrosoft MPEG-4 (MP4S)\n\t\t\tmp4s\tMicrosoft MPEG-4 (mp4s)\n\t\t\tMPEG\tChromatic Research MPEG-1 Video I-Frame\n\t\t\tMPG4\tMicrosoft MPEG-4 Video High Speed Compressor\n\t\t\tMPGI\tSigma Designs MPEG\n\t\t\tMRCA\tFAST Multimedia Martin Regen Codec\n\t\t\tMRLE\tMicrosoft Run Length Encoding\n\t\t\tMSVC\tMicrosoft Video 1\n\t\t\tMTX1\tMatrox ?MTX1?\n\t\t\tMTX2\tMatrox ?MTX2?\n\t\t\tMTX3\tMatrox ?MTX3?\n\t\t\tMTX4\tMatrox ?MTX4?\n\t\t\tMTX5\tMatrox ?MTX5?\n\t\t\tMTX6\tMatrox ?MTX6?\n\t\t\tMTX7\tMatrox ?MTX7?\n\t\t\tMTX8\tMatrox ?MTX8?\n\t\t\tMTX9\tMatrox ?MTX9?\n\t\t\tMV12\tMotion Pixels Codec (old)\n\t\t\tMWV1\tAware Motion Wavelets\n\t\t\tnAVI\tSMR Codec (hack of Microsoft MPEG-4) (IRC #shadowrealm)\n\t\t\tNT00\tNewTek LightWave HDTV YUV w/ Alpha (www.newtek.com)\n\t\t\tNUV1\tNuppelVideo\n\t\t\tNTN1\tNogatech Video Compression 1\n\t\t\tNVS0\tnVidia GeForce Texture (NVS0)\n\t\t\tNVS1\tnVidia GeForce Texture (NVS1)\n\t\t\tNVS2\tnVidia GeForce Texture (NVS2)\n\t\t\tNVS3\tnVidia GeForce Texture (NVS3)\n\t\t\tNVS4\tnVidia GeForce Texture (NVS4)\n\t\t\tNVS5\tnVidia GeForce Texture (NVS5)\n\t\t\tNVT0\tnVidia GeForce Texture (NVT0)\n\t\t\tNVT1\tnVidia GeForce Texture (NVT1)\n\t\t\tNVT2\tnVidia GeForce Texture (NVT2)\n\t\t\tNVT3\tnVidia GeForce Texture (NVT3)\n\t\t\tNVT4\tnVidia GeForce Texture (NVT4)\n\t\t\tNVT5\tnVidia GeForce Texture (NVT5)\n\t\t\tPIXL\tMiroXL, Pinnacle PCTV\n\t\t\tPDVC\tI-O Data Device Digital Video Capture DV codec\n\t\t\tPGVV\tRadius Video Vision\n\t\t\tPHMO\tIBM Photomotion\n\t\t\tPIM1\tMPEG Realtime (Pinnacle Cards)\n\t\t\tPIM2\tPegasus Imaging ?PIM2?\n\t\t\tPIMJ\tPegasus Imaging Lossless JPEG\n\t\t\tPVEZ\tHorizons Technology PowerEZ\n\t\t\tPVMM\tPacketVideo Corporation MPEG-4\n\t\t\tPVW2\tPegasus Imaging Wavelet Compression\n\t\t\tQ1.0\tQ-Team\\'s QPEG 1.0 (www.q-team.de)\n\t\t\tQ1.1\tQ-Team\\'s QPEG 1.1 (www.q-team.de)\n\t\t\tQPEG\tQ-Team QPEG 1.0\n\t\t\tqpeq\tQ-Team QPEG 1.1\n\t\t\tRGB \tRaw BGR32\n\t\t\tRGBA\tRaw RGB w/ Alpha\n\t\t\tRMP4\tREALmagic MPEG-4 (unauthorized XVID copy) (www.sigmadesigns.com)\n\t\t\tROQV\tId RoQ File Video Decoder\n\t\t\tRPZA\tQuicktime Apple Video (RPZA)\n\t\t\tRUD0\tRududu video codec (http://rududu.ifrance.com/rududu/)\n\t\t\tRV10\tRealVideo 1.0 (aka RealVideo 5.0)\n\t\t\tRV13\tRealVideo 1.0 (RV13)\n\t\t\tRV20\tRealVideo G2\n\t\t\tRV30\tRealVideo 8\n\t\t\tRV40\tRealVideo 9\n\t\t\tRGBT\tRaw RGB w/ Transparency\n\t\t\tRLE \tMicrosoft Run Length Encoder\n\t\t\tRLE4\tRun Length Encoded (4bpp, 16-color)\n\t\t\tRLE8\tRun Length Encoded (8bpp, 256-color)\n\t\t\tRT21\tIntel Indeo RealTime Video 2.1\n\t\t\trv20\tRealVideo G2\n\t\t\trv30\tRealVideo 8\n\t\t\tRVX \tIntel RDX (RVX )\n\t\t\tSMC \tApple Graphics (SMC )\n\t\t\tSP54\tLogitech Sunplus Sp54 Codec for Mustek GSmart Mini 2\n\t\t\tSPIG\tRadius Spigot\n\t\t\tSVQ3\tSorenson Video 3 (Apple Quicktime 5)\n\t\t\ts422\tTekram VideoCap C210 YUV 4:2:2\n\t\t\tSDCC\tSun Communication Digital Camera Codec\n\t\t\tSFMC\tCrystalNet Surface Fitting Method\n\t\t\tSMSC\tRadius SMSC\n\t\t\tSMSD\tRadius SMSD\n\t\t\tsmsv\tWorldConnect Wavelet Video\n\t\t\tSPIG\tRadius Spigot\n\t\t\tSPLC\tSplash Studios ACM Audio Codec (www.splashstudios.net)\n\t\t\tSQZ2\tMicrosoft VXTreme Video Codec V2\n\t\t\tSTVA\tST Microelectronics CMOS Imager Data (Bayer)\n\t\t\tSTVB\tST Microelectronics CMOS Imager Data (Nudged Bayer)\n\t\t\tSTVC\tST Microelectronics CMOS Imager Data (Bunched)\n\t\t\tSTVX\tST Microelectronics CMOS Imager Data (Extended CODEC Data Format)\n\t\t\tSTVY\tST Microelectronics CMOS Imager Data (Extended CODEC Data Format with Correction Data)\n\t\t\tSV10\tSorenson Video R1\n\t\t\tSVQ1\tSorenson Video\n\t\t\tT420\tToshiba YUV 4:2:0\n\t\t\tTM2A\tDuck TrueMotion Archiver 2.0 (www.duck.com)\n\t\t\tTVJP\tPinnacle/Truevision Targa 2000 board (TVJP)\n\t\t\tTVMJ\tPinnacle/Truevision Targa 2000 board (TVMJ)\n\t\t\tTY0N\tTecomac Low-Bit Rate Codec (www.tecomac.com)\n\t\t\tTY2C\tTrident Decompression Driver\n\t\t\tTLMS\tTeraLogic Motion Intraframe Codec (TLMS)\n\t\t\tTLST\tTeraLogic Motion Intraframe Codec (TLST)\n\t\t\tTM20\tDuck TrueMotion 2.0\n\t\t\tTM2X\tDuck TrueMotion 2X\n\t\t\tTMIC\tTeraLogic Motion Intraframe Codec (TMIC)\n\t\t\tTMOT\tHorizons Technology TrueMotion S\n\t\t\ttmot\tHorizons TrueMotion Video Compression\n\t\t\tTR20\tDuck TrueMotion RealTime 2.0\n\t\t\tTSCC\tTechSmith Screen Capture Codec\n\t\t\tTV10\tTecomac Low-Bit Rate Codec\n\t\t\tTY2N\tTrident ?TY2N?\n\t\t\tU263\tUB Video H.263/H.263+/H.263++ Decoder\n\t\t\tUMP4\tUB Video MPEG 4 (www.ubvideo.com)\n\t\t\tUYNV\tNvidia UYVY packed 4:2:2\n\t\t\tUYVP\tEvans & Sutherland YCbCr 4:2:2 extended precision\n\t\t\tUCOD\teMajix.com ClearVideo\n\t\t\tULTI\tIBM Ultimotion\n\t\t\tUYVY\tUYVY packed 4:2:2\n\t\t\tV261\tLucent VX2000S\n\t\t\tVIFP\tVFAPI Reader Codec (www.yks.ne.jp/~hori/)\n\t\t\tVIV1\tFFmpeg H263+ decoder\n\t\t\tVIV2\tVivo H.263\n\t\t\tVQC2\tVector-quantised codec 2 (research) http://eprints.ecs.soton.ac.uk/archive/00001310/01/VTC97-js.pdf)\n\t\t\tVTLP\tAlaris VideoGramPiX\n\t\t\tVYU9\tATI YUV (VYU9)\n\t\t\tVYUY\tATI YUV (VYUY)\n\t\t\tV261\tLucent VX2000S\n\t\t\tV422\tVitec Multimedia 24-bit YUV 4:2:2 Format\n\t\t\tV655\tVitec Multimedia 16-bit YUV 4:2:2 Format\n\t\t\tVCR1\tATI Video Codec 1\n\t\t\tVCR2\tATI Video Codec 2\n\t\t\tVCR3\tATI VCR 3.0\n\t\t\tVCR4\tATI VCR 4.0\n\t\t\tVCR5\tATI VCR 5.0\n\t\t\tVCR6\tATI VCR 6.0\n\t\t\tVCR7\tATI VCR 7.0\n\t\t\tVCR8\tATI VCR 8.0\n\t\t\tVCR9\tATI VCR 9.0\n\t\t\tVDCT\tVitec Multimedia Video Maker Pro DIB\n\t\t\tVDOM\tVDOnet VDOWave\n\t\t\tVDOW\tVDOnet VDOLive (H.263)\n\t\t\tVDTZ\tDarim Vison VideoTizer YUV\n\t\t\tVGPX\tAlaris VideoGramPiX\n\t\t\tVIDS\tVitec Multimedia YUV 4:2:2 CCIR 601 for V422\n\t\t\tVIVO\tVivo H.263 v2.00\n\t\t\tvivo\tVivo H.263\n\t\t\tVIXL\tMiro/Pinnacle Video XL\n\t\t\tVLV1\tVideoLogic/PURE Digital Videologic Capture\n\t\t\tVP30\tOn2 VP3.0\n\t\t\tVP31\tOn2 VP3.1\n\t\t\tVP6F\tOn2 TrueMotion VP6\n\t\t\tVX1K\tLucent VX1000S Video Codec\n\t\t\tVX2K\tLucent VX2000S Video Codec\n\t\t\tVXSP\tLucent VX1000SP Video Codec\n\t\t\tWBVC\tWinbond W9960\n\t\t\tWHAM\tMicrosoft Video 1 (WHAM)\n\t\t\tWINX\tWinnov Software Compression\n\t\t\tWJPG\tAverMedia Winbond JPEG\n\t\t\tWMV1\tWindows Media Video V7\n\t\t\tWMV2\tWindows Media Video V8\n\t\t\tWMV3\tWindows Media Video V9\n\t\t\tWNV1\tWinnov Hardware Compression\n\t\t\tXYZP\tExtended PAL format XYZ palette (www.riff.org)\n\t\t\tx263\tXirlink H.263\n\t\t\tXLV0\tNetXL Video Decoder\n\t\t\tXMPG\tXing MPEG (I-Frame only)\n\t\t\tXVID\tXviD MPEG-4 (www.xvid.org)\n\t\t\tXXAN\t?XXAN?\n\t\t\tYU92\tIntel YUV (YU92)\n\t\t\tYUNV\tNvidia Uncompressed YUV 4:2:2\n\t\t\tYUVP\tExtended PAL format YUV palette (www.riff.org)\n\t\t\tY211\tYUV 2:1:1 Packed\n\t\t\tY411\tYUV 4:1:1 Packed\n\t\t\tY41B\tWeitek YUV 4:1:1 Planar\n\t\t\tY41P\tBrooktree PC1 YUV 4:1:1 Packed\n\t\t\tY41T\tBrooktree PC1 YUV 4:1:1 with transparency\n\t\t\tY42B\tWeitek YUV 4:2:2 Planar\n\t\t\tY42T\tBrooktree UYUV 4:2:2 with transparency\n\t\t\tY422\tADS Technologies Copy of UYVY used in Pyro WebCam firewire camera\n\t\t\tY800\tSimple, single Y plane for monochrome images\n\t\t\tY8  \tGrayscale video\n\t\t\tYC12\tIntel YUV 12 codec\n\t\t\tYUV8\tWinnov Caviar YUV8\n\t\t\tYUV9\tIntel YUV9\n\t\t\tYUY2\tUncompressed YUV 4:2:2\n\t\t\tYUYV\tCanopus YUV\n\t\t\tYV12\tYVU12 Planar\n\t\t\tYVU9\tIntel YVU9 Planar (8-bpp Y plane, followed by 8-bpp 4x4 U and V planes)\n\t\t\tYVYU\tYVYU 4:2:2 Packed\n\t\t\tZLIB\tLossless Codec Library zlib compression (www.geocities.co.jp/Playtown-Denei/2837/LRC.htm)\n\t\t\tZPEG\tMetheus Video Zipper\n\n\t\t*/\n\n\t\treturn getid3_lib::EmbeddedLookup($fourcc, $begin, __LINE__, __FILE__, 'riff-fourcc');\n\t}\n\n\t/**\n\t * @param string $byteword\n\t * @param bool   $signed\n\t *\n\t * @return int|float|false\n\t */\n\tprivate function EitherEndian2Int($byteword, $signed=false) {\n\t\tif ($this->container == 'riff') {\n\t\t\treturn getid3_lib::LittleEndian2Int($byteword, $signed);\n\t\t}\n\t\treturn getid3_lib::BigEndian2Int($byteword, false, $signed);\n\t}\n\n}\n", "num_lines": 2792}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/////////////////////////////////////////////////////////////////\n/// getID3() by James Heinrich <info@getid3.org>               //\n//  available at https://github.com/JamesHeinrich/getID3       //\n//            or https://www.getid3.org                        //\n//            or http://getid3.sourceforge.net                 //\n//  see readme.txt for more details                            //\n/////////////////////////////////////////////////////////////////\n//                                                             //\n// module.audio.ac3.php                                        //\n// module for analyzing AC-3 (aka Dolby Digital) audio files   //\n// dependencies: NONE                                          //\n//                                                            ///\n/////////////////////////////////////////////////////////////////\n\nif (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers\n\texit;\n}\n\nclass getid3_ac3 extends getid3_handler\n{\n\t/**\n\t * @var array\n\t */\n\tprivate $AC3header = array();\n\n\t/**\n\t * @var int\n\t */\n\tprivate $BSIoffset = 0;\n\n\tconst syncword = 0x0B77;\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function Analyze() {\n\t\t$info = &$this->getid3->info;\n\n\t\t///AH\n\t\t$info['ac3']['raw']['bsi'] = array();\n\t\t$thisfile_ac3              = &$info['ac3'];\n\t\t$thisfile_ac3_raw          = &$thisfile_ac3['raw'];\n\t\t$thisfile_ac3_raw_bsi      = &$thisfile_ac3_raw['bsi'];\n\n\n\t\t// http://www.atsc.org/standards/a_52a.pdf\n\n\t\t$info['fileformat'] = 'ac3';\n\n\t\t// An AC-3 serial coded audio bit stream is made up of a sequence of synchronization frames\n\t\t// Each synchronization frame contains 6 coded audio blocks (AB), each of which represent 256\n\t\t// new audio samples per channel. A synchronization information (SI) header at the beginning\n\t\t// of each frame contains information needed to acquire and maintain synchronization. A\n\t\t// bit stream information (BSI) header follows SI, and contains parameters describing the coded\n\t\t// audio service. The coded audio blocks may be followed by an auxiliary data (Aux) field. At the\n\t\t// end of each frame is an error check field that includes a CRC word for error detection. An\n\t\t// additional CRC word is located in the SI header, the use of which, by a decoder, is optional.\n\t\t//\n\t\t// syncinfo() | bsi() | AB0 | AB1 | AB2 | AB3 | AB4 | AB5 | Aux | CRC\n\n\t\t// syncinfo() {\n\t\t// \t syncword    16\n\t\t// \t crc1        16\n\t\t// \t fscod        2\n\t\t// \t frmsizecod   6\n\t\t// } /* end of syncinfo */\n\n\t\t$this->fseek($info['avdataoffset']);\n\t\t$tempAC3header = $this->fread(100); // should be enough to cover all data, there are some variable-length fields...?\n\t\t$this->AC3header['syncinfo']  =     getid3_lib::BigEndian2Int(substr($tempAC3header, 0, 2));\n\t\t$this->AC3header['bsi']       =     getid3_lib::BigEndian2Bin(substr($tempAC3header, 2));\n\t\t$thisfile_ac3_raw_bsi['bsid'] = (getid3_lib::LittleEndian2Int(substr($tempAC3header, 5, 1)) & 0xF8) >> 3; // AC3 and E-AC3 put the \"bsid\" version identifier in the same place, but unfortnately the 4 bytes between the syncword and the version identifier are interpreted differently, so grab it here so the following code structure can make sense\n\t\tunset($tempAC3header);\n\n\t\tif ($this->AC3header['syncinfo'] !== self::syncword) {\n\t\t\tif (!$this->isDependencyFor('matroska')) {\n\t\t\t\tunset($info['fileformat'], $info['ac3']);\n\t\t\t\treturn $this->error('Expecting \"'.dechex(self::syncword).'\" at offset '.$info['avdataoffset'].', found \"'.dechex($this->AC3header['syncinfo']).'\"');\n\t\t\t}\n\t\t}\n\n\t\t$info['audio']['dataformat']   = 'ac3';\n\t\t$info['audio']['bitrate_mode'] = 'cbr';\n\t\t$info['audio']['lossless']     = false;\n\n\t\tif ($thisfile_ac3_raw_bsi['bsid'] <= 8) {\n\n\t\t\t$thisfile_ac3_raw_bsi['crc1']       = getid3_lib::Bin2Dec($this->readHeaderBSI(16));\n\t\t\t$thisfile_ac3_raw_bsi['fscod']      =                     $this->readHeaderBSI(2);   // 5.4.1.3\n\t\t\t$thisfile_ac3_raw_bsi['frmsizecod'] =                     $this->readHeaderBSI(6);   // 5.4.1.4\n\t\t\tif ($thisfile_ac3_raw_bsi['frmsizecod'] > 37) { // binary: 100101 - see Table 5.18 Frame Size Code Table (1 word = 16 bits)\n\t\t\t\t$this->warning('Unexpected ac3.bsi.frmsizecod value: '.$thisfile_ac3_raw_bsi['frmsizecod'].', bitrate not set correctly');\n\t\t\t}\n\n\t\t\t$thisfile_ac3_raw_bsi['bsid']  = $this->readHeaderBSI(5); // we already know this from pre-parsing the version identifier, but re-read it to let the bitstream flow as intended\n\t\t\t$thisfile_ac3_raw_bsi['bsmod'] = $this->readHeaderBSI(3);\n\t\t\t$thisfile_ac3_raw_bsi['acmod'] = $this->readHeaderBSI(3);\n\n\t\t\tif ($thisfile_ac3_raw_bsi['acmod'] & 0x01) {\n\t\t\t\t// If the lsb of acmod is a 1, center channel is in use and cmixlev follows in the bit stream.\n\t\t\t\t$thisfile_ac3_raw_bsi['cmixlev'] = $this->readHeaderBSI(2);\n\t\t\t\t$thisfile_ac3['center_mix_level'] = self::centerMixLevelLookup($thisfile_ac3_raw_bsi['cmixlev']);\n\t\t\t}\n\n\t\t\tif ($thisfile_ac3_raw_bsi['acmod'] & 0x04) {\n\t\t\t\t// If the msb of acmod is a 1, surround channels are in use and surmixlev follows in the bit stream.\n\t\t\t\t$thisfile_ac3_raw_bsi['surmixlev'] = $this->readHeaderBSI(2);\n\t\t\t\t$thisfile_ac3['surround_mix_level'] = self::surroundMixLevelLookup($thisfile_ac3_raw_bsi['surmixlev']);\n\t\t\t}\n\n\t\t\tif ($thisfile_ac3_raw_bsi['acmod'] == 0x02) {\n\t\t\t\t// When operating in the two channel mode, this 2-bit code indicates whether or not the program has been encoded in Dolby Surround.\n\t\t\t\t$thisfile_ac3_raw_bsi['dsurmod'] = $this->readHeaderBSI(2);\n\t\t\t\t$thisfile_ac3['dolby_surround_mode'] = self::dolbySurroundModeLookup($thisfile_ac3_raw_bsi['dsurmod']);\n\t\t\t}\n\n\t\t\t$thisfile_ac3_raw_bsi['flags']['lfeon'] = (bool) $this->readHeaderBSI(1);\n\n\t\t\t// This indicates how far the average dialogue level is below digital 100 percent. Valid values are 1-31.\n\t\t\t// The value of 0 is reserved. The values of 1 to 31 are interpreted as -1 dB to -31 dB with respect to digital 100 percent.\n\t\t\t$thisfile_ac3_raw_bsi['dialnorm'] = $this->readHeaderBSI(5);                 // 5.4.2.8 dialnorm: Dialogue Normalization, 5 Bits\n\n\t\t\t$thisfile_ac3_raw_bsi['flags']['compr'] = (bool) $this->readHeaderBSI(1);       // 5.4.2.9 compre: Compression Gain Word Exists, 1 Bit\n\t\t\tif ($thisfile_ac3_raw_bsi['flags']['compr']) {\n\t\t\t\t$thisfile_ac3_raw_bsi['compr'] = $this->readHeaderBSI(8);                // 5.4.2.10 compr: Compression Gain Word, 8 Bits\n\t\t\t\t$thisfile_ac3['heavy_compression'] = self::heavyCompression($thisfile_ac3_raw_bsi['compr']);\n\t\t\t}\n\n\t\t\t$thisfile_ac3_raw_bsi['flags']['langcod'] = (bool) $this->readHeaderBSI(1);     // 5.4.2.11 langcode: Language Code Exists, 1 Bit\n\t\t\tif ($thisfile_ac3_raw_bsi['flags']['langcod']) {\n\t\t\t\t$thisfile_ac3_raw_bsi['langcod'] = $this->readHeaderBSI(8);              // 5.4.2.12 langcod: Language Code, 8 Bits\n\t\t\t}\n\n\t\t\t$thisfile_ac3_raw_bsi['flags']['audprodinfo'] = (bool) $this->readHeaderBSI(1);  // 5.4.2.13 audprodie: Audio Production Information Exists, 1 Bit\n\t\t\tif ($thisfile_ac3_raw_bsi['flags']['audprodinfo']) {\n\t\t\t\t$thisfile_ac3_raw_bsi['mixlevel'] = $this->readHeaderBSI(5);             // 5.4.2.14 mixlevel: Mixing Level, 5 Bits\n\t\t\t\t$thisfile_ac3_raw_bsi['roomtyp']  = $this->readHeaderBSI(2);             // 5.4.2.15 roomtyp: Room Type, 2 Bits\n\n\t\t\t\t$thisfile_ac3['mixing_level'] = (80 + $thisfile_ac3_raw_bsi['mixlevel']).'dB';\n\t\t\t\t$thisfile_ac3['room_type']    = self::roomTypeLookup($thisfile_ac3_raw_bsi['roomtyp']);\n\t\t\t}\n\n\n\t\t\t$thisfile_ac3_raw_bsi['dialnorm2'] = $this->readHeaderBSI(5);                // 5.4.2.16 dialnorm2: Dialogue Normalization, ch2, 5 Bits\n\t\t\t$thisfile_ac3['dialogue_normalization2'] = '-'.$thisfile_ac3_raw_bsi['dialnorm2'].'dB';  // This indicates how far the average dialogue level is below digital 100 percent. Valid values are 1-31. The value of 0 is reserved. The values of 1 to 31 are interpreted as -1 dB to -31 dB with respect to digital 100 percent.\n\n\t\t\t$thisfile_ac3_raw_bsi['flags']['compr2'] = (bool) $this->readHeaderBSI(1);       // 5.4.2.17 compr2e: Compression Gain Word Exists, ch2, 1 Bit\n\t\t\tif ($thisfile_ac3_raw_bsi['flags']['compr2']) {\n\t\t\t\t$thisfile_ac3_raw_bsi['compr2'] = $this->readHeaderBSI(8);               // 5.4.2.18 compr2: Compression Gain Word, ch2, 8 Bits\n\t\t\t\t$thisfile_ac3['heavy_compression2'] = self::heavyCompression($thisfile_ac3_raw_bsi['compr2']);\n\t\t\t}\n\n\t\t\t$thisfile_ac3_raw_bsi['flags']['langcod2'] = (bool) $this->readHeaderBSI(1);    // 5.4.2.19 langcod2e: Language Code Exists, ch2, 1 Bit\n\t\t\tif ($thisfile_ac3_raw_bsi['flags']['langcod2']) {\n\t\t\t\t$thisfile_ac3_raw_bsi['langcod2'] = $this->readHeaderBSI(8);             // 5.4.2.20 langcod2: Language Code, ch2, 8 Bits\n\t\t\t}\n\n\t\t\t$thisfile_ac3_raw_bsi['flags']['audprodinfo2'] = (bool) $this->readHeaderBSI(1); // 5.4.2.21 audprodi2e: Audio Production Information Exists, ch2, 1 Bit\n\t\t\tif ($thisfile_ac3_raw_bsi['flags']['audprodinfo2']) {\n\t\t\t\t$thisfile_ac3_raw_bsi['mixlevel2'] = $this->readHeaderBSI(5);            // 5.4.2.22 mixlevel2: Mixing Level, ch2, 5 Bits\n\t\t\t\t$thisfile_ac3_raw_bsi['roomtyp2']  = $this->readHeaderBSI(2);            // 5.4.2.23 roomtyp2: Room Type, ch2, 2 Bits\n\n\t\t\t\t$thisfile_ac3['mixing_level2'] = (80 + $thisfile_ac3_raw_bsi['mixlevel2']).'dB';\n\t\t\t\t$thisfile_ac3['room_type2']    = self::roomTypeLookup($thisfile_ac3_raw_bsi['roomtyp2']);\n\t\t\t}\n\n\t\t\t$thisfile_ac3_raw_bsi['copyright'] = (bool) $this->readHeaderBSI(1);         // 5.4.2.24 copyrightb: Copyright Bit, 1 Bit\n\n\t\t\t$thisfile_ac3_raw_bsi['original']  = (bool) $this->readHeaderBSI(1);         // 5.4.2.25 origbs: Original Bit Stream, 1 Bit\n\n\t\t\t$thisfile_ac3_raw_bsi['flags']['timecod1'] = $this->readHeaderBSI(2);            // 5.4.2.26 timecod1e, timcode2e: Time Code (first and second) Halves Exist, 2 Bits\n\t\t\tif ($thisfile_ac3_raw_bsi['flags']['timecod1'] & 0x01) {\n\t\t\t\t$thisfile_ac3_raw_bsi['timecod1'] = $this->readHeaderBSI(14);            // 5.4.2.27 timecod1: Time code first half, 14 bits\n\t\t\t\t$thisfile_ac3['timecode1'] = 0;\n\t\t\t\t$thisfile_ac3['timecode1'] += (($thisfile_ac3_raw_bsi['timecod1'] & 0x3E00) >>  9) * 3600;  // The first 5 bits of this 14-bit field represent the time in hours, with valid values of 0\u00ef\u00bf\u00bd23\n\t\t\t\t$thisfile_ac3['timecode1'] += (($thisfile_ac3_raw_bsi['timecod1'] & 0x01F8) >>  3) *   60;  // The next 6 bits represent the time in minutes, with valid values of 0\u00ef\u00bf\u00bd59\n\t\t\t\t$thisfile_ac3['timecode1'] += (($thisfile_ac3_raw_bsi['timecod1'] & 0x0003) >>  0) *    8;  // The final 3 bits represents the time in 8 second increments, with valid values of 0\u00ef\u00bf\u00bd7 (representing 0, 8, 16, ... 56 seconds)\n\t\t\t}\n\t\t\tif ($thisfile_ac3_raw_bsi['flags']['timecod1'] & 0x02) {\n\t\t\t\t$thisfile_ac3_raw_bsi['timecod2'] = $this->readHeaderBSI(14);            // 5.4.2.28 timecod2: Time code second half, 14 bits\n\t\t\t\t$thisfile_ac3['timecode2'] = 0;\n\t\t\t\t$thisfile_ac3['timecode2'] += (($thisfile_ac3_raw_bsi['timecod2'] & 0x3800) >> 11) *   1;              // The first 3 bits of this 14-bit field represent the time in seconds, with valid values from 0\u00ef\u00bf\u00bd7 (representing 0-7 seconds)\n\t\t\t\t$thisfile_ac3['timecode2'] += (($thisfile_ac3_raw_bsi['timecod2'] & 0x07C0) >>  6) *  (1 / 30);        // The next 5 bits represents the time in frames, with valid values from 0\u00ef\u00bf\u00bd29 (one frame = 1/30th of a second)\n\t\t\t\t$thisfile_ac3['timecode2'] += (($thisfile_ac3_raw_bsi['timecod2'] & 0x003F) >>  0) * ((1 / 30) / 60);  // The final 6 bits represents fractions of 1/64 of a frame, with valid values from 0\u00ef\u00bf\u00bd63\n\t\t\t}\n\n\t\t\t$thisfile_ac3_raw_bsi['flags']['addbsi'] = (bool) $this->readHeaderBSI(1);\n\t\t\tif ($thisfile_ac3_raw_bsi['flags']['addbsi']) {\n\t\t\t\t$thisfile_ac3_raw_bsi['addbsi_length'] = $this->readHeaderBSI(6) + 1; // This 6-bit code, which exists only if addbside is a 1, indicates the length in bytes of additional bit stream information. The valid range of addbsil is 0\u00ef\u00bf\u00bd63, indicating 1\u00ef\u00bf\u00bd64 additional bytes, respectively.\n\n\t\t\t\t$this->AC3header['bsi'] .= getid3_lib::BigEndian2Bin($this->fread($thisfile_ac3_raw_bsi['addbsi_length']));\n\n\t\t\t\t$thisfile_ac3_raw_bsi['addbsi_data'] = substr($this->AC3header['bsi'], $this->BSIoffset, $thisfile_ac3_raw_bsi['addbsi_length'] * 8);\n\t\t\t\t$this->BSIoffset += $thisfile_ac3_raw_bsi['addbsi_length'] * 8;\n\t\t\t}\n\n\n\t\t} elseif ($thisfile_ac3_raw_bsi['bsid'] <= 16) { // E-AC3\n\n\n\t\t\t$this->error('E-AC3 parsing is incomplete and experimental in this version of getID3 ('.$this->getid3->version().'). Notably the bitrate calculations are wrong -- value might (or not) be correct, but it is not calculated correctly. Email info@getid3.org if you know how to calculate EAC3 bitrate correctly.');\n\t\t\t$info['audio']['dataformat'] = 'eac3';\n\n\t\t\t$thisfile_ac3_raw_bsi['strmtyp']          =        $this->readHeaderBSI(2);\n\t\t\t$thisfile_ac3_raw_bsi['substreamid']      =        $this->readHeaderBSI(3);\n\t\t\t$thisfile_ac3_raw_bsi['frmsiz']           =        $this->readHeaderBSI(11);\n\t\t\t$thisfile_ac3_raw_bsi['fscod']            =        $this->readHeaderBSI(2);\n\t\t\tif ($thisfile_ac3_raw_bsi['fscod'] == 3) {\n\t\t\t\t$thisfile_ac3_raw_bsi['fscod2']       =        $this->readHeaderBSI(2);\n\t\t\t\t$thisfile_ac3_raw_bsi['numblkscod'] = 3; // six blocks per syncframe\n\t\t\t} else {\n\t\t\t\t$thisfile_ac3_raw_bsi['numblkscod']   =        $this->readHeaderBSI(2);\n\t\t\t}\n\t\t\t$thisfile_ac3['bsi']['blocks_per_sync_frame'] = self::blocksPerSyncFrame($thisfile_ac3_raw_bsi['numblkscod']);\n\t\t\t$thisfile_ac3_raw_bsi['acmod']            =        $this->readHeaderBSI(3);\n\t\t\t$thisfile_ac3_raw_bsi['flags']['lfeon']   = (bool) $this->readHeaderBSI(1);\n\t\t\t$thisfile_ac3_raw_bsi['bsid']             =        $this->readHeaderBSI(5); // we already know this from pre-parsing the version identifier, but re-read it to let the bitstream flow as intended\n\t\t\t$thisfile_ac3_raw_bsi['dialnorm']         =        $this->readHeaderBSI(5);\n\t\t\t$thisfile_ac3_raw_bsi['flags']['compr']       = (bool) $this->readHeaderBSI(1);\n\t\t\tif ($thisfile_ac3_raw_bsi['flags']['compr']) {\n\t\t\t\t$thisfile_ac3_raw_bsi['compr']        =        $this->readHeaderBSI(8);\n\t\t\t}\n\t\t\tif ($thisfile_ac3_raw_bsi['acmod'] == 0) { // if 1+1 mode (dual mono, so some items need a second value)\n\t\t\t\t$thisfile_ac3_raw_bsi['dialnorm2']    =        $this->readHeaderBSI(5);\n\t\t\t\t$thisfile_ac3_raw_bsi['flags']['compr2']  = (bool) $this->readHeaderBSI(1);\n\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['compr2']) {\n\t\t\t\t\t$thisfile_ac3_raw_bsi['compr2']   =        $this->readHeaderBSI(8);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($thisfile_ac3_raw_bsi['strmtyp'] == 1) { // if dependent stream\n\t\t\t\t$thisfile_ac3_raw_bsi['flags']['chanmap'] = (bool) $this->readHeaderBSI(1);\n\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['chanmap']) {\n\t\t\t\t\t$thisfile_ac3_raw_bsi['chanmap']  =        $this->readHeaderBSI(8);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$thisfile_ac3_raw_bsi['flags']['mixmdat']     = (bool) $this->readHeaderBSI(1);\n\t\t\tif ($thisfile_ac3_raw_bsi['flags']['mixmdat']) { // Mixing metadata\n\t\t\t\tif ($thisfile_ac3_raw_bsi['acmod'] > 2) { // if more than 2 channels\n\t\t\t\t\t$thisfile_ac3_raw_bsi['dmixmod']  =        $this->readHeaderBSI(2);\n\t\t\t\t}\n\t\t\t\tif (($thisfile_ac3_raw_bsi['acmod'] & 0x01) && ($thisfile_ac3_raw_bsi['acmod'] > 2)) { // if three front channels exist\n\t\t\t\t\t$thisfile_ac3_raw_bsi['ltrtcmixlev'] =        $this->readHeaderBSI(3);\n\t\t\t\t\t$thisfile_ac3_raw_bsi['lorocmixlev'] =        $this->readHeaderBSI(3);\n\t\t\t\t}\n\t\t\t\tif ($thisfile_ac3_raw_bsi['acmod'] & 0x04) { // if a surround channel exists\n\t\t\t\t\t$thisfile_ac3_raw_bsi['ltrtsurmixlev'] =        $this->readHeaderBSI(3);\n\t\t\t\t\t$thisfile_ac3_raw_bsi['lorosurmixlev'] =        $this->readHeaderBSI(3);\n\t\t\t\t}\n\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['lfeon']) { // if the LFE channel exists\n\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['lfemixlevcod'] = (bool) $this->readHeaderBSI(1);\n\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['lfemixlevcod']) {\n\t\t\t\t\t\t$thisfile_ac3_raw_bsi['lfemixlevcod']  =        $this->readHeaderBSI(5);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($thisfile_ac3_raw_bsi['strmtyp'] == 0) { // if independent stream\n\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['pgmscl'] = (bool) $this->readHeaderBSI(1);\n\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['pgmscl']) {\n\t\t\t\t\t\t$thisfile_ac3_raw_bsi['pgmscl']  =        $this->readHeaderBSI(6);\n\t\t\t\t\t}\n\t\t\t\t\tif ($thisfile_ac3_raw_bsi['acmod'] == 0) { // if 1+1 mode (dual mono, so some items need a second value)\n\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['pgmscl2'] = (bool) $this->readHeaderBSI(1);\n\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['pgmscl2']) {\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['pgmscl2']  =        $this->readHeaderBSI(6);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['extpgmscl'] = (bool) $this->readHeaderBSI(1);\n\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['extpgmscl']) {\n\t\t\t\t\t\t$thisfile_ac3_raw_bsi['extpgmscl']  =        $this->readHeaderBSI(6);\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_ac3_raw_bsi['mixdef']  =        $this->readHeaderBSI(2);\n\t\t\t\t\tif ($thisfile_ac3_raw_bsi['mixdef'] == 1) { // mixing option 2\n\t\t\t\t\t\t$thisfile_ac3_raw_bsi['premixcmpsel']  = (bool) $this->readHeaderBSI(1);\n\t\t\t\t\t\t$thisfile_ac3_raw_bsi['drcsrc']        = (bool) $this->readHeaderBSI(1);\n\t\t\t\t\t\t$thisfile_ac3_raw_bsi['premixcmpscl']  =        $this->readHeaderBSI(3);\n\t\t\t\t\t} elseif ($thisfile_ac3_raw_bsi['mixdef'] == 2) { // mixing option 3\n\t\t\t\t\t\t$thisfile_ac3_raw_bsi['mixdata']       =        $this->readHeaderBSI(12);\n\t\t\t\t\t} elseif ($thisfile_ac3_raw_bsi['mixdef'] == 3) { // mixing option 4\n\t\t\t\t\t\t$mixdefbitsread = 0;\n\t\t\t\t\t\t$thisfile_ac3_raw_bsi['mixdeflen']     =        $this->readHeaderBSI(5); $mixdefbitsread += 5;\n\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['mixdata2'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1;\n\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['mixdata2']) {\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['premixcmpsel']  = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1;\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['drcsrc']        = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1;\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['premixcmpscl']  =        $this->readHeaderBSI(3); $mixdefbitsread += 3;\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['extpgmlscl']   = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1;\n\t\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['extpgmlscl']) {\n\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['extpgmlscl']    =        $this->readHeaderBSI(4); $mixdefbitsread += 4;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['extpgmcscl']   = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1;\n\t\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['extpgmcscl']) {\n\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['extpgmcscl']    =        $this->readHeaderBSI(4); $mixdefbitsread += 4;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['extpgmrscl']   = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1;\n\t\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['extpgmrscl']) {\n\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['extpgmrscl']    =        $this->readHeaderBSI(4);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['extpgmlsscl']  = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1;\n\t\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['extpgmlsscl']) {\n\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['extpgmlsscl']   =        $this->readHeaderBSI(4); $mixdefbitsread += 4;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['extpgmrsscl']  = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1;\n\t\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['extpgmrsscl']) {\n\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['extpgmrsscl']   =        $this->readHeaderBSI(4); $mixdefbitsread += 4;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['extpgmlfescl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1;\n\t\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['extpgmlfescl']) {\n\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['extpgmlfescl']  =        $this->readHeaderBSI(4); $mixdefbitsread += 4;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['dmixscl']      = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1;\n\t\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['dmixscl']) {\n\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['dmixscl']       =        $this->readHeaderBSI(4); $mixdefbitsread += 4;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['addch']        = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1;\n\t\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['addch']) {\n\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['extpgmaux1scl']   = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1;\n\t\t\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['extpgmaux1scl']) {\n\t\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['extpgmaux1scl']    =        $this->readHeaderBSI(4); $mixdefbitsread += 4;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['extpgmaux2scl']   = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1;\n\t\t\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['extpgmaux2scl']) {\n\t\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['extpgmaux2scl']    =        $this->readHeaderBSI(4); $mixdefbitsread += 4;\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\t$thisfile_ac3_raw_bsi['flags']['mixdata3'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1;\n\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['mixdata3']) {\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['spchdat']   =        $this->readHeaderBSI(5); $mixdefbitsread += 5;\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['addspchdat'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1;\n\t\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['addspchdat']) {\n\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['spchdat1']   =         $this->readHeaderBSI(5); $mixdefbitsread += 5;\n\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['spchan1att'] =         $this->readHeaderBSI(2); $mixdefbitsread += 2;\n\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['addspchdat1'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1;\n\t\t\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['addspchdat1']) {\n\t\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['spchdat2']   =         $this->readHeaderBSI(5); $mixdefbitsread += 5;\n\t\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['spchan2att'] =         $this->readHeaderBSI(3); $mixdefbitsread += 3;\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\t$mixdata_bits = (8 * ($thisfile_ac3_raw_bsi['mixdeflen'] + 2)) - $mixdefbitsread;\n\t\t\t\t\t\t$mixdata_fill = (($mixdata_bits % 8) ? 8 - ($mixdata_bits % 8) : 0);\n\t\t\t\t\t\t$thisfile_ac3_raw_bsi['mixdata']     =        $this->readHeaderBSI($mixdata_bits);\n\t\t\t\t\t\t$thisfile_ac3_raw_bsi['mixdatafill'] =        $this->readHeaderBSI($mixdata_fill);\n\t\t\t\t\t\tunset($mixdefbitsread, $mixdata_bits, $mixdata_fill);\n\t\t\t\t\t}\n\t\t\t\t\tif ($thisfile_ac3_raw_bsi['acmod'] < 2) { // if mono or dual mono source\n\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['paninfo'] = (bool) $this->readHeaderBSI(1);\n\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['paninfo']) {\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['panmean']   =        $this->readHeaderBSI(8);\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['paninfo']   =        $this->readHeaderBSI(6);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['acmod'] == 0) { // if 1+1 mode (dual mono, so some items need a second value)\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['paninfo2'] = (bool) $this->readHeaderBSI(1);\n\t\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['paninfo2']) {\n\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['panmean2']   =        $this->readHeaderBSI(8);\n\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['paninfo2']   =        $this->readHeaderBSI(6);\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$thisfile_ac3_raw_bsi['flags']['frmmixcfginfo'] = (bool) $this->readHeaderBSI(1);\n\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['frmmixcfginfo']) { // mixing configuration information\n\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['numblkscod'] == 0) {\n\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['blkmixcfginfo'][0]  =        $this->readHeaderBSI(5);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor ($blk = 0; $blk < $thisfile_ac3_raw_bsi['numblkscod']; $blk++) {\n\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['blkmixcfginfo'.$blk] = (bool) $this->readHeaderBSI(1);\n\t\t\t\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['blkmixcfginfo'.$blk]) { // mixing configuration information\n\t\t\t\t\t\t\t\t\t$thisfile_ac3_raw_bsi['blkmixcfginfo'][$blk]  =        $this->readHeaderBSI(5);\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\t\t\t}\n\t\t\t$thisfile_ac3_raw_bsi['flags']['infomdat']          = (bool) $this->readHeaderBSI(1);\n\t\t\tif ($thisfile_ac3_raw_bsi['flags']['infomdat']) { // Informational metadata\n\t\t\t\t$thisfile_ac3_raw_bsi['bsmod']                  =        $this->readHeaderBSI(3);\n\t\t\t\t$thisfile_ac3_raw_bsi['flags']['copyrightb']    = (bool) $this->readHeaderBSI(1);\n\t\t\t\t$thisfile_ac3_raw_bsi['flags']['origbs']        = (bool) $this->readHeaderBSI(1);\n\t\t\t\tif ($thisfile_ac3_raw_bsi['acmod'] == 2) { //  if in 2/0 mode\n\t\t\t\t\t$thisfile_ac3_raw_bsi['dsurmod']            =        $this->readHeaderBSI(2);\n\t\t\t\t\t$thisfile_ac3_raw_bsi['dheadphonmod']       =        $this->readHeaderBSI(2);\n\t\t\t\t}\n\t\t\t\tif ($thisfile_ac3_raw_bsi['acmod'] >= 6) { //  if both surround channels exist\n\t\t\t\t\t$thisfile_ac3_raw_bsi['dsurexmod']          =        $this->readHeaderBSI(2);\n\t\t\t\t}\n\t\t\t\t$thisfile_ac3_raw_bsi['flags']['audprodi']      = (bool) $this->readHeaderBSI(1);\n\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['audprodi']) {\n\t\t\t\t\t$thisfile_ac3_raw_bsi['mixlevel']           =        $this->readHeaderBSI(5);\n\t\t\t\t\t$thisfile_ac3_raw_bsi['roomtyp']            =        $this->readHeaderBSI(2);\n\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['adconvtyp'] = (bool) $this->readHeaderBSI(1);\n\t\t\t\t}\n\t\t\t\tif ($thisfile_ac3_raw_bsi['acmod'] == 0) { //  if 1+1 mode (dual mono, so some items need a second value)\n\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['audprodi2']      = (bool) $this->readHeaderBSI(1);\n\t\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['audprodi2']) {\n\t\t\t\t\t\t$thisfile_ac3_raw_bsi['mixlevel2']           =        $this->readHeaderBSI(5);\n\t\t\t\t\t\t$thisfile_ac3_raw_bsi['roomtyp2']            =        $this->readHeaderBSI(2);\n\t\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['adconvtyp2'] = (bool) $this->readHeaderBSI(1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($thisfile_ac3_raw_bsi['fscod'] < 3) { // if not half sample rate\n\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['sourcefscod'] = (bool) $this->readHeaderBSI(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (($thisfile_ac3_raw_bsi['strmtyp'] == 0) && ($thisfile_ac3_raw_bsi['numblkscod'] != 3)) { //  if both surround channels exist\n\t\t\t\t$thisfile_ac3_raw_bsi['flags']['convsync'] = (bool) $this->readHeaderBSI(1);\n\t\t\t}\n\t\t\tif ($thisfile_ac3_raw_bsi['strmtyp'] == 2) { //  if bit stream converted from AC-3\n\t\t\t\tif ($thisfile_ac3_raw_bsi['numblkscod'] != 3) { // 6 blocks per syncframe\n\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['blkid']  = 1;\n\t\t\t\t} else {\n\t\t\t\t\t$thisfile_ac3_raw_bsi['flags']['blkid']  = (bool) $this->readHeaderBSI(1);\n\t\t\t\t}\n\t\t\t\tif ($thisfile_ac3_raw_bsi['flags']['blkid']) {\n\t\t\t\t\t$thisfile_ac3_raw_bsi['frmsizecod']  =        $this->readHeaderBSI(6);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$thisfile_ac3_raw_bsi['flags']['addbsi']  = (bool) $this->readHeaderBSI(1);\n\t\t\tif ($thisfile_ac3_raw_bsi['flags']['addbsi']) {\n\t\t\t\t$thisfile_ac3_raw_bsi['addbsil']  =        $this->readHeaderBSI(6);\n\t\t\t\t$thisfile_ac3_raw_bsi['addbsi']   =        $this->readHeaderBSI(($thisfile_ac3_raw_bsi['addbsil'] + 1) * 8);\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$this->error('Bit stream identification is version '.$thisfile_ac3_raw_bsi['bsid'].', but getID3() only understands up to version 16. Please submit a support ticket with a sample file.');\n\t\t\tunset($info['ac3']);\n\t\t\treturn false;\n\n\t\t}\n\n\t\tif (isset($thisfile_ac3_raw_bsi['fscod2'])) {\n\t\t\t$thisfile_ac3['sample_rate'] = self::sampleRateCodeLookup2($thisfile_ac3_raw_bsi['fscod2']);\n\t\t} else {\n\t\t\t$thisfile_ac3['sample_rate'] = self::sampleRateCodeLookup($thisfile_ac3_raw_bsi['fscod']);\n\t\t}\n\t\tif ($thisfile_ac3_raw_bsi['fscod'] <= 3) {\n\t\t\t$info['audio']['sample_rate'] = $thisfile_ac3['sample_rate'];\n\t\t} else {\n\t\t\t$this->warning('Unexpected ac3.bsi.fscod value: '.$thisfile_ac3_raw_bsi['fscod']);\n\t\t}\n\t\tif (isset($thisfile_ac3_raw_bsi['frmsizecod'])) {\n\t\t\t$thisfile_ac3['frame_length'] = self::frameSizeLookup($thisfile_ac3_raw_bsi['frmsizecod'], $thisfile_ac3_raw_bsi['fscod']);\n\t\t\t$thisfile_ac3['bitrate']      = self::bitrateLookup($thisfile_ac3_raw_bsi['frmsizecod']);\n\t\t} elseif (!empty($thisfile_ac3_raw_bsi['frmsiz'])) {\n\t\t\t// this isn't right, but it's (usually) close, roughly 5% less than it should be.\n\t\t\t// but WHERE is the actual bitrate value stored in EAC3?? email info@getid3.org if you know!\n\t\t\t$thisfile_ac3['bitrate']      = ($thisfile_ac3_raw_bsi['frmsiz'] + 1) * 16 * 30; // The frmsiz field shall contain a value one less than the overall size of the coded syncframe in 16-bit words. That is, this field may assume a value ranging from 0 to 2047, and these values correspond to syncframe sizes ranging from 1 to 2048.\n\t\t\t// kludge-fix to make it approximately the expected value, still not \"right\":\n\t\t\t$thisfile_ac3['bitrate'] = round(($thisfile_ac3['bitrate'] * 1.05) / 16000) * 16000;\n\t\t}\n\t\t$info['audio']['bitrate'] = $thisfile_ac3['bitrate'];\n\n\t\tif (isset($thisfile_ac3_raw_bsi['bsmod']) && isset($thisfile_ac3_raw_bsi['acmod'])) {\n\t\t\t$thisfile_ac3['service_type'] = self::serviceTypeLookup($thisfile_ac3_raw_bsi['bsmod'], $thisfile_ac3_raw_bsi['acmod']);\n\t\t}\n\t\t$ac3_coding_mode = self::audioCodingModeLookup($thisfile_ac3_raw_bsi['acmod']);\n\t\tforeach($ac3_coding_mode as $key => $value) {\n\t\t\t$thisfile_ac3[$key] = $value;\n\t\t}\n\t\tswitch ($thisfile_ac3_raw_bsi['acmod']) {\n\t\t\tcase 0:\n\t\t\tcase 1:\n\t\t\t\t$info['audio']['channelmode'] = 'mono';\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\tcase 4:\n\t\t\t\t$info['audio']['channelmode'] = 'stereo';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$info['audio']['channelmode'] = 'surround';\n\t\t\t\tbreak;\n\t\t}\n\t\t$info['audio']['channels'] = $thisfile_ac3['num_channels'];\n\n\t\t$thisfile_ac3['lfe_enabled'] = $thisfile_ac3_raw_bsi['flags']['lfeon'];\n\t\tif ($thisfile_ac3_raw_bsi['flags']['lfeon']) {\n\t\t\t$info['audio']['channels'] .= '.1';\n\t\t}\n\n\t\t$thisfile_ac3['channels_enabled'] = self::channelsEnabledLookup($thisfile_ac3_raw_bsi['acmod'], $thisfile_ac3_raw_bsi['flags']['lfeon']);\n\t\t$thisfile_ac3['dialogue_normalization'] = '-'.$thisfile_ac3_raw_bsi['dialnorm'].'dB';\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param int $length\n\t *\n\t * @return int\n\t */\n\tprivate function readHeaderBSI($length) {\n\t\t$data = substr($this->AC3header['bsi'], $this->BSIoffset, $length);\n\t\t$this->BSIoffset += $length;\n\n\t\treturn bindec($data);\n\t}\n\n\t/**\n\t * @param int $fscod\n\t *\n\t * @return int|string|false\n\t */\n\tpublic static function sampleRateCodeLookup($fscod) {\n\t\tstatic $sampleRateCodeLookup = array(\n\t\t\t0 => 48000,\n\t\t\t1 => 44100,\n\t\t\t2 => 32000,\n\t\t\t3 => 'reserved' // If the reserved code is indicated, the decoder should not attempt to decode audio and should mute.\n\t\t);\n\t\treturn (isset($sampleRateCodeLookup[$fscod]) ? $sampleRateCodeLookup[$fscod] : false);\n\t}\n\n\t/**\n\t * @param int $fscod2\n\t *\n\t * @return int|string|false\n\t */\n\tpublic static function sampleRateCodeLookup2($fscod2) {\n\t\tstatic $sampleRateCodeLookup2 = array(\n\t\t\t0 => 24000,\n\t\t\t1 => 22050,\n\t\t\t2 => 16000,\n\t\t\t3 => 'reserved' // If the reserved code is indicated, the decoder should not attempt to decode audio and should mute.\n\t\t);\n\t\treturn (isset($sampleRateCodeLookup2[$fscod2]) ? $sampleRateCodeLookup2[$fscod2] : false);\n\t}\n\n\t/**\n\t * @param int $bsmod\n\t * @param int $acmod\n\t *\n\t * @return string|false\n\t */\n\tpublic static function serviceTypeLookup($bsmod, $acmod) {\n\t\tstatic $serviceTypeLookup = array();\n\t\tif (empty($serviceTypeLookup)) {\n\t\t\tfor ($i = 0; $i <= 7; $i++) {\n\t\t\t\t$serviceTypeLookup[0][$i] = 'main audio service: complete main (CM)';\n\t\t\t\t$serviceTypeLookup[1][$i] = 'main audio service: music and effects (ME)';\n\t\t\t\t$serviceTypeLookup[2][$i] = 'associated service: visually impaired (VI)';\n\t\t\t\t$serviceTypeLookup[3][$i] = 'associated service: hearing impaired (HI)';\n\t\t\t\t$serviceTypeLookup[4][$i] = 'associated service: dialogue (D)';\n\t\t\t\t$serviceTypeLookup[5][$i] = 'associated service: commentary (C)';\n\t\t\t\t$serviceTypeLookup[6][$i] = 'associated service: emergency (E)';\n\t\t\t}\n\n\t\t\t$serviceTypeLookup[7][1]      = 'associated service: voice over (VO)';\n\t\t\tfor ($i = 2; $i <= 7; $i++) {\n\t\t\t\t$serviceTypeLookup[7][$i] = 'main audio service: karaoke';\n\t\t\t}\n\t\t}\n\t\treturn (isset($serviceTypeLookup[$bsmod][$acmod]) ? $serviceTypeLookup[$bsmod][$acmod] : false);\n\t}\n\n\t/**\n\t * @param int $acmod\n\t *\n\t * @return array|false\n\t */\n\tpublic static function audioCodingModeLookup($acmod) {\n\t\t// array(channel configuration, # channels (not incl LFE), channel order)\n\t\tstatic $audioCodingModeLookup = array (\n\t\t\t0 => array('channel_config'=>'1+1', 'num_channels'=>2, 'channel_order'=>'Ch1,Ch2'),\n\t\t\t1 => array('channel_config'=>'1/0', 'num_channels'=>1, 'channel_order'=>'C'),\n\t\t\t2 => array('channel_config'=>'2/0', 'num_channels'=>2, 'channel_order'=>'L,R'),\n\t\t\t3 => array('channel_config'=>'3/0', 'num_channels'=>3, 'channel_order'=>'L,C,R'),\n\t\t\t4 => array('channel_config'=>'2/1', 'num_channels'=>3, 'channel_order'=>'L,R,S'),\n\t\t\t5 => array('channel_config'=>'3/1', 'num_channels'=>4, 'channel_order'=>'L,C,R,S'),\n\t\t\t6 => array('channel_config'=>'2/2', 'num_channels'=>4, 'channel_order'=>'L,R,SL,SR'),\n\t\t\t7 => array('channel_config'=>'3/2', 'num_channels'=>5, 'channel_order'=>'L,C,R,SL,SR'),\n\t\t);\n\t\treturn (isset($audioCodingModeLookup[$acmod]) ? $audioCodingModeLookup[$acmod] : false);\n\t}\n\n\t/**\n\t * @param int $cmixlev\n\t *\n\t * @return int|float|string|false\n\t */\n\tpublic static function centerMixLevelLookup($cmixlev) {\n\t\tstatic $centerMixLevelLookup;\n\t\tif (empty($centerMixLevelLookup)) {\n\t\t\t$centerMixLevelLookup = array(\n\t\t\t\t0 => pow(2, -3.0 / 6), // 0.707 (-3.0 dB)\n\t\t\t\t1 => pow(2, -4.5 / 6), // 0.595 (-4.5 dB)\n\t\t\t\t2 => pow(2, -6.0 / 6), // 0.500 (-6.0 dB)\n\t\t\t\t3 => 'reserved'\n\t\t\t);\n\t\t}\n\t\treturn (isset($centerMixLevelLookup[$cmixlev]) ? $centerMixLevelLookup[$cmixlev] : false);\n\t}\n\n\t/**\n\t * @param int $surmixlev\n\t *\n\t * @return int|float|string|false\n\t */\n\tpublic static function surroundMixLevelLookup($surmixlev) {\n\t\tstatic $surroundMixLevelLookup;\n\t\tif (empty($surroundMixLevelLookup)) {\n\t\t\t$surroundMixLevelLookup = array(\n\t\t\t\t0 => pow(2, -3.0 / 6),\n\t\t\t\t1 => pow(2, -6.0 / 6),\n\t\t\t\t2 => 0,\n\t\t\t\t3 => 'reserved'\n\t\t\t);\n\t\t}\n\t\treturn (isset($surroundMixLevelLookup[$surmixlev]) ? $surroundMixLevelLookup[$surmixlev] : false);\n\t}\n\n\t/**\n\t * @param int $dsurmod\n\t *\n\t * @return string|false\n\t */\n\tpublic static function dolbySurroundModeLookup($dsurmod) {\n\t\tstatic $dolbySurroundModeLookup = array(\n\t\t\t0 => 'not indicated',\n\t\t\t1 => 'Not Dolby Surround encoded',\n\t\t\t2 => 'Dolby Surround encoded',\n\t\t\t3 => 'reserved'\n\t\t);\n\t\treturn (isset($dolbySurroundModeLookup[$dsurmod]) ? $dolbySurroundModeLookup[$dsurmod] : false);\n\t}\n\n\t/**\n\t * @param int  $acmod\n\t * @param bool $lfeon\n\t *\n\t * @return array\n\t */\n\tpublic static function channelsEnabledLookup($acmod, $lfeon) {\n\t\t$lookup = array(\n\t\t\t'ch1'=>($acmod == 0),\n\t\t\t'ch2'=>($acmod == 0),\n\t\t\t'left'=>($acmod > 1),\n\t\t\t'right'=>($acmod > 1),\n\t\t\t'center'=>(bool) ($acmod & 0x01),\n\t\t\t'surround_mono'=>false,\n\t\t\t'surround_left'=>false,\n\t\t\t'surround_right'=>false,\n\t\t\t'lfe'=>$lfeon);\n\t\tswitch ($acmod) {\n\t\t\tcase 4:\n\t\t\tcase 5:\n\t\t\t\t$lookup['surround_mono']  = true;\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\tcase 7:\n\t\t\t\t$lookup['surround_left']  = true;\n\t\t\t\t$lookup['surround_right'] = true;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $lookup;\n\t}\n\n\t/**\n\t * @param int $compre\n\t *\n\t * @return float|int\n\t */\n\tpublic static function heavyCompression($compre) {\n\t\t// The first four bits indicate gain changes in 6.02dB increments which can be\n\t\t// implemented with an arithmetic shift operation. The following four bits\n\t\t// indicate linear gain changes, and require a 5-bit multiply.\n\t\t// We will represent the two 4-bit fields of compr as follows:\n\t\t//   X0 X1 X2 X3 . Y4 Y5 Y6 Y7\n\t\t// The meaning of the X values is most simply described by considering X to represent a 4-bit\n\t\t// signed integer with values from -8 to +7. The gain indicated by X is then (X + 1) * 6.02 dB. The\n\t\t// following table shows this in detail.\n\n\t\t// Meaning of 4 msb of compr\n\t\t//  7    +48.16 dB\n\t\t//  6    +42.14 dB\n\t\t//  5    +36.12 dB\n\t\t//  4    +30.10 dB\n\t\t//  3    +24.08 dB\n\t\t//  2    +18.06 dB\n\t\t//  1    +12.04 dB\n\t\t//  0     +6.02 dB\n\t\t// -1         0 dB\n\t\t// -2     -6.02 dB\n\t\t// -3    -12.04 dB\n\t\t// -4    -18.06 dB\n\t\t// -5    -24.08 dB\n\t\t// -6    -30.10 dB\n\t\t// -7    -36.12 dB\n\t\t// -8    -42.14 dB\n\n\t\t$fourbit = str_pad(decbin(($compre & 0xF0) >> 4), 4, '0', STR_PAD_LEFT);\n\t\tif ($fourbit[0] == '1') {\n\t\t\t$log_gain = -8 + bindec(substr($fourbit, 1));\n\t\t} else {\n\t\t\t$log_gain = bindec(substr($fourbit, 1));\n\t\t}\n\t\t$log_gain = ($log_gain + 1) * getid3_lib::RGADamplitude2dB(2);\n\n\t\t// The value of Y is a linear representation of a gain change of up to -6 dB. Y is considered to\n\t\t// be an unsigned fractional integer, with a leading value of 1, or: 0.1 Y4 Y5 Y6 Y7 (base 2). Y can\n\t\t// represent values between 0.111112 (or 31/32) and 0.100002 (or 1/2). Thus, Y can represent gain\n\t\t// changes from -0.28 dB to -6.02 dB.\n\n\t\t$lin_gain = (16 + ($compre & 0x0F)) / 32;\n\n\t\t// The combination of X and Y values allows compr to indicate gain changes from\n\t\t//  48.16 - 0.28 = +47.89 dB, to\n\t\t// -42.14 - 6.02 = -48.16 dB.\n\n\t\treturn $log_gain - $lin_gain;\n\t}\n\n\t/**\n\t * @param int $roomtyp\n\t *\n\t * @return string|false\n\t */\n\tpublic static function roomTypeLookup($roomtyp) {\n\t\tstatic $roomTypeLookup = array(\n\t\t\t0 => 'not indicated',\n\t\t\t1 => 'large room, X curve monitor',\n\t\t\t2 => 'small room, flat monitor',\n\t\t\t3 => 'reserved'\n\t\t);\n\t\treturn (isset($roomTypeLookup[$roomtyp]) ? $roomTypeLookup[$roomtyp] : false);\n\t}\n\n\t/**\n\t * @param int $frmsizecod\n\t * @param int $fscod\n\t *\n\t * @return int|false\n\t */\n\tpublic static function frameSizeLookup($frmsizecod, $fscod) {\n\t\t// LSB is whether padding is used or not\n\t\t$padding     = (bool) ($frmsizecod & 0x01);\n\t\t$framesizeid =        ($frmsizecod & 0x3E) >> 1;\n\n\t\tstatic $frameSizeLookup = array();\n\t\tif (empty($frameSizeLookup)) {\n\t\t\t$frameSizeLookup = array (\n\t\t\t\t0  => array( 128,  138,  192),  //  32 kbps\n\t\t\t\t1  => array( 160,  174,  240),  //  40 kbps\n\t\t\t\t2  => array( 192,  208,  288),  //  48 kbps\n\t\t\t\t3  => array( 224,  242,  336),  //  56 kbps\n\t\t\t\t4  => array( 256,  278,  384),  //  64 kbps\n\t\t\t\t5  => array( 320,  348,  480),  //  80 kbps\n\t\t\t\t6  => array( 384,  416,  576),  //  96 kbps\n\t\t\t\t7  => array( 448,  486,  672),  // 112 kbps\n\t\t\t\t8  => array( 512,  556,  768),  // 128 kbps\n\t\t\t\t9  => array( 640,  696,  960),  // 160 kbps\n\t\t\t\t10 => array( 768,  834, 1152),  // 192 kbps\n\t\t\t\t11 => array( 896,  974, 1344),  // 224 kbps\n\t\t\t\t12 => array(1024, 1114, 1536),  // 256 kbps\n\t\t\t\t13 => array(1280, 1392, 1920),  // 320 kbps\n\t\t\t\t14 => array(1536, 1670, 2304),  // 384 kbps\n\t\t\t\t15 => array(1792, 1950, 2688),  // 448 kbps\n\t\t\t\t16 => array(2048, 2228, 3072),  // 512 kbps\n\t\t\t\t17 => array(2304, 2506, 3456),  // 576 kbps\n\t\t\t\t18 => array(2560, 2786, 3840)   // 640 kbps\n\t\t\t);\n\t\t}\n\t\t$paddingBytes = 0;\n\t\tif (($fscod == 1) && $padding) {\n\t\t\t// frame lengths are padded by 1 word (16 bits) at 44100\n\t\t\t// (fscode==1) means 44100Hz (see sampleRateCodeLookup)\n\t\t\t$paddingBytes = 2;\n\t\t}\n\t\treturn (isset($frameSizeLookup[$framesizeid][$fscod]) ? $frameSizeLookup[$framesizeid][$fscod] + $paddingBytes : false);\n\t}\n\n\t/**\n\t * @param int $frmsizecod\n\t *\n\t * @return int|false\n\t */\n\tpublic static function bitrateLookup($frmsizecod) {\n\t\t// LSB is whether padding is used or not\n\t\t$padding     = (bool) ($frmsizecod & 0x01);\n\t\t$framesizeid =        ($frmsizecod & 0x3E) >> 1;\n\n\t\tstatic $bitrateLookup = array(\n\t\t\t 0 =>  32000,\n\t\t\t 1 =>  40000,\n\t\t\t 2 =>  48000,\n\t\t\t 3 =>  56000,\n\t\t\t 4 =>  64000,\n\t\t\t 5 =>  80000,\n\t\t\t 6 =>  96000,\n\t\t\t 7 => 112000,\n\t\t\t 8 => 128000,\n\t\t\t 9 => 160000,\n\t\t\t10 => 192000,\n\t\t\t11 => 224000,\n\t\t\t12 => 256000,\n\t\t\t13 => 320000,\n\t\t\t14 => 384000,\n\t\t\t15 => 448000,\n\t\t\t16 => 512000,\n\t\t\t17 => 576000,\n\t\t\t18 => 640000,\n\t\t);\n\t\treturn (isset($bitrateLookup[$framesizeid]) ? $bitrateLookup[$framesizeid] : false);\n\t}\n\n\t/**\n\t * @param int $numblkscod\n\t *\n\t * @return int|false\n\t */\n\tpublic static function blocksPerSyncFrame($numblkscod) {\n\t\tstatic $blocksPerSyncFrameLookup = array(\n\t\t\t0 => 1,\n\t\t\t1 => 2,\n\t\t\t2 => 3,\n\t\t\t3 => 6,\n\t\t);\n\t\treturn (isset($blocksPerSyncFrameLookup[$numblkscod]) ? $blocksPerSyncFrameLookup[$numblkscod] : false);\n\t}\n\n\n}\n", "num_lines": 824}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/////////////////////////////////////////////////////////////////\n/// getID3() by James Heinrich <info@getid3.org>               //\n//  available at https://github.com/JamesHeinrich/getID3       //\n//            or https://www.getid3.org                        //\n//            or http://getid3.sourceforge.net                 //\n//  see readme.txt for more details                            //\n/////////////////////////////////////////////////////////////////\n//                                                             //\n// module.audio.dts.php                                        //\n// module for analyzing DTS Audio files                        //\n// dependencies: NONE                                          //\n//                                                             //\n/////////////////////////////////////////////////////////////////\n\nif (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers\n\texit;\n}\n\n/**\n* @tutorial http://wiki.multimedia.cx/index.php?title=DTS\n*/\nclass getid3_dts extends getid3_handler\n{\n\t/**\n\t * Default DTS syncword used in native .cpt or .dts formats.\n\t */\n\tconst syncword = \"\\x7F\\xFE\\x80\\x01\";\n\n\t/**\n\t * @var int\n\t */\n\tprivate $readBinDataOffset = 0;\n\n\t/**\n\t * Possible syncwords indicating bitstream encoding.\n\t */\n\tpublic static $syncwords = array(\n\t\t0 => \"\\x7F\\xFE\\x80\\x01\",  // raw big-endian\n\t\t1 => \"\\xFE\\x7F\\x01\\x80\",  // raw little-endian\n\t\t2 => \"\\x1F\\xFF\\xE8\\x00\",  // 14-bit big-endian\n\t\t3 => \"\\xFF\\x1F\\x00\\xE8\"); // 14-bit little-endian\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function Analyze() {\n\t\t$info = &$this->getid3->info;\n\t\t$info['fileformat'] = 'dts';\n\n\t\t$this->fseek($info['avdataoffset']);\n\t\t$DTSheader = $this->fread(20); // we only need 2 words magic + 6 words frame header, but these words may be normal 16-bit words OR 14-bit words with 2 highest bits set to zero, so 8 words can be either 8*16/8 = 16 bytes OR 8*16*(16/14)/8 = 18.3 bytes\n\n\t\t// check syncword\n\t\t$sync = substr($DTSheader, 0, 4);\n\t\tif (($encoding = array_search($sync, self::$syncwords)) !== false) {\n\n\t\t\t$info['dts']['raw']['magic'] = $sync;\n\t\t\t$this->readBinDataOffset = 32;\n\n\t\t} elseif ($this->isDependencyFor('matroska')) {\n\n\t\t\t// Matroska contains DTS without syncword encoded as raw big-endian format\n\t\t\t$encoding = 0;\n\t\t\t$this->readBinDataOffset = 0;\n\n\t\t} else {\n\n\t\t\tunset($info['fileformat']);\n\t\t\treturn $this->error('Expecting \"'.implode('| ', array_map('getid3_lib::PrintHexBytes', self::$syncwords)).'\" at offset '.$info['avdataoffset'].', found \"'.getid3_lib::PrintHexBytes($sync).'\"');\n\n\t\t}\n\n\t\t// decode header\n\t\t$fhBS = '';\n\t\tfor ($word_offset = 0; $word_offset <= strlen($DTSheader); $word_offset += 2) {\n\t\t\tswitch ($encoding) {\n\t\t\t\tcase 0: // raw big-endian\n\t\t\t\t\t$fhBS .=        getid3_lib::BigEndian2Bin(       substr($DTSheader, $word_offset, 2) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1: // raw little-endian\n\t\t\t\t\t$fhBS .=        getid3_lib::BigEndian2Bin(strrev(substr($DTSheader, $word_offset, 2)));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2: // 14-bit big-endian\n\t\t\t\t\t$fhBS .= substr(getid3_lib::BigEndian2Bin(       substr($DTSheader, $word_offset, 2) ), 2, 14);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3: // 14-bit little-endian\n\t\t\t\t\t$fhBS .= substr(getid3_lib::BigEndian2Bin(strrev(substr($DTSheader, $word_offset, 2))), 2, 14);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$info['dts']['raw']['frame_type']             =        $this->readBinData($fhBS,  1);\n\t\t$info['dts']['raw']['deficit_samples']        =        $this->readBinData($fhBS,  5);\n\t\t$info['dts']['flags']['crc_present']          = (bool) $this->readBinData($fhBS,  1);\n\t\t$info['dts']['raw']['pcm_sample_blocks']      =        $this->readBinData($fhBS,  7);\n\t\t$info['dts']['raw']['frame_byte_size']        =        $this->readBinData($fhBS, 14);\n\t\t$info['dts']['raw']['channel_arrangement']    =        $this->readBinData($fhBS,  6);\n\t\t$info['dts']['raw']['sample_frequency']       =        $this->readBinData($fhBS,  4);\n\t\t$info['dts']['raw']['bitrate']                =        $this->readBinData($fhBS,  5);\n\t\t$info['dts']['flags']['embedded_downmix']     = (bool) $this->readBinData($fhBS,  1);\n\t\t$info['dts']['flags']['dynamicrange']         = (bool) $this->readBinData($fhBS,  1);\n\t\t$info['dts']['flags']['timestamp']            = (bool) $this->readBinData($fhBS,  1);\n\t\t$info['dts']['flags']['auxdata']              = (bool) $this->readBinData($fhBS,  1);\n\t\t$info['dts']['flags']['hdcd']                 = (bool) $this->readBinData($fhBS,  1);\n\t\t$info['dts']['raw']['extension_audio']        =        $this->readBinData($fhBS,  3);\n\t\t$info['dts']['flags']['extended_coding']      = (bool) $this->readBinData($fhBS,  1);\n\t\t$info['dts']['flags']['audio_sync_insertion'] = (bool) $this->readBinData($fhBS,  1);\n\t\t$info['dts']['raw']['lfe_effects']            =        $this->readBinData($fhBS,  2);\n\t\t$info['dts']['flags']['predictor_history']    = (bool) $this->readBinData($fhBS,  1);\n\t\tif ($info['dts']['flags']['crc_present']) {\n\t\t\t$info['dts']['raw']['crc16']              =        $this->readBinData($fhBS, 16);\n\t\t}\n\t\t$info['dts']['flags']['mri_perfect_reconst']  = (bool) $this->readBinData($fhBS,  1);\n\t\t$info['dts']['raw']['encoder_soft_version']   =        $this->readBinData($fhBS,  4);\n\t\t$info['dts']['raw']['copy_history']           =        $this->readBinData($fhBS,  2);\n\t\t$info['dts']['raw']['bits_per_sample']        =        $this->readBinData($fhBS,  2);\n\t\t$info['dts']['flags']['surround_es']          = (bool) $this->readBinData($fhBS,  1);\n\t\t$info['dts']['flags']['front_sum_diff']       = (bool) $this->readBinData($fhBS,  1);\n\t\t$info['dts']['flags']['surround_sum_diff']    = (bool) $this->readBinData($fhBS,  1);\n\t\t$info['dts']['raw']['dialog_normalization']   =        $this->readBinData($fhBS,  4);\n\n\n\t\t$info['dts']['bitrate']              = self::bitrateLookup($info['dts']['raw']['bitrate']);\n\t\t$info['dts']['bits_per_sample']      = self::bitPerSampleLookup($info['dts']['raw']['bits_per_sample']);\n\t\t$info['dts']['sample_rate']          = self::sampleRateLookup($info['dts']['raw']['sample_frequency']);\n\t\t$info['dts']['dialog_normalization'] = self::dialogNormalization($info['dts']['raw']['dialog_normalization'], $info['dts']['raw']['encoder_soft_version']);\n\t\t$info['dts']['flags']['lossless']    = (($info['dts']['raw']['bitrate'] == 31) ? true  : false);\n\t\t$info['dts']['bitrate_mode']         = (($info['dts']['raw']['bitrate'] == 30) ? 'vbr' : 'cbr');\n\t\t$info['dts']['channels']             = self::numChannelsLookup($info['dts']['raw']['channel_arrangement']);\n\t\t$info['dts']['channel_arrangement']  = self::channelArrangementLookup($info['dts']['raw']['channel_arrangement']);\n\n\t\t$info['audio']['dataformat']          = 'dts';\n\t\t$info['audio']['lossless']            = $info['dts']['flags']['lossless'];\n\t\t$info['audio']['bitrate_mode']        = $info['dts']['bitrate_mode'];\n\t\t$info['audio']['bits_per_sample']     = $info['dts']['bits_per_sample'];\n\t\t$info['audio']['sample_rate']         = $info['dts']['sample_rate'];\n\t\t$info['audio']['channels']            = $info['dts']['channels'];\n\t\t$info['audio']['bitrate']             = $info['dts']['bitrate'];\n\t\tif (isset($info['avdataend']) && !empty($info['dts']['bitrate']) && is_numeric($info['dts']['bitrate'])) {\n\t\t\t$info['playtime_seconds']         = ($info['avdataend'] - $info['avdataoffset']) / ($info['dts']['bitrate'] / 8);\n\t\t\tif (($encoding == 2) || ($encoding == 3)) {\n\t\t\t\t// 14-bit data packed into 16-bit words, so the playtime is wrong because only (14/16) of the bytes in the data portion of the file are used at the specified bitrate\n\t\t\t\t$info['playtime_seconds'] *= (14 / 16);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $bin\n\t * @param int $length\n\t *\n\t * @return int\n\t */\n\tprivate function readBinData($bin, $length) {\n\t\t$data = substr($bin, $this->readBinDataOffset, $length);\n\t\t$this->readBinDataOffset += $length;\n\n\t\treturn bindec($data);\n\t}\n\n\t/**\n\t * @param int $index\n\t *\n\t * @return int|string|false\n\t */\n\tpublic static function bitrateLookup($index) {\n\t\tstatic $lookup = array(\n\t\t\t0  => 32000,\n\t\t\t1  => 56000,\n\t\t\t2  => 64000,\n\t\t\t3  => 96000,\n\t\t\t4  => 112000,\n\t\t\t5  => 128000,\n\t\t\t6  => 192000,\n\t\t\t7  => 224000,\n\t\t\t8  => 256000,\n\t\t\t9  => 320000,\n\t\t\t10 => 384000,\n\t\t\t11 => 448000,\n\t\t\t12 => 512000,\n\t\t\t13 => 576000,\n\t\t\t14 => 640000,\n\t\t\t15 => 768000,\n\t\t\t16 => 960000,\n\t\t\t17 => 1024000,\n\t\t\t18 => 1152000,\n\t\t\t19 => 1280000,\n\t\t\t20 => 1344000,\n\t\t\t21 => 1408000,\n\t\t\t22 => 1411200,\n\t\t\t23 => 1472000,\n\t\t\t24 => 1536000,\n\t\t\t25 => 1920000,\n\t\t\t26 => 2048000,\n\t\t\t27 => 3072000,\n\t\t\t28 => 3840000,\n\t\t\t29 => 'open',\n\t\t\t30 => 'variable',\n\t\t\t31 => 'lossless',\n\t\t);\n\t\treturn (isset($lookup[$index]) ? $lookup[$index] : false);\n\t}\n\n\t/**\n\t * @param int $index\n\t *\n\t * @return int|string|false\n\t */\n\tpublic static function sampleRateLookup($index) {\n\t\tstatic $lookup = array(\n\t\t\t0  => 'invalid',\n\t\t\t1  => 8000,\n\t\t\t2  => 16000,\n\t\t\t3  => 32000,\n\t\t\t4  => 'invalid',\n\t\t\t5  => 'invalid',\n\t\t\t6  => 11025,\n\t\t\t7  => 22050,\n\t\t\t8  => 44100,\n\t\t\t9  => 'invalid',\n\t\t\t10 => 'invalid',\n\t\t\t11 => 12000,\n\t\t\t12 => 24000,\n\t\t\t13 => 48000,\n\t\t\t14 => 'invalid',\n\t\t\t15 => 'invalid',\n\t\t);\n\t\treturn (isset($lookup[$index]) ? $lookup[$index] : false);\n\t}\n\n\t/**\n\t * @param int $index\n\t *\n\t * @return int|false\n\t */\n\tpublic static function bitPerSampleLookup($index) {\n\t\tstatic $lookup = array(\n\t\t\t0  => 16,\n\t\t\t1  => 20,\n\t\t\t2  => 24,\n\t\t\t3  => 24,\n\t\t);\n\t\treturn (isset($lookup[$index]) ? $lookup[$index] : false);\n\t}\n\n\t/**\n\t * @param int $index\n\t *\n\t * @return int|false\n\t */\n\tpublic static function numChannelsLookup($index) {\n\t\tswitch ($index) {\n\t\t\tcase 0:\n\t\t\t\treturn 1;\n\t\t\tcase 1:\n\t\t\tcase 2:\n\t\t\tcase 3:\n\t\t\tcase 4:\n\t\t\t\treturn 2;\n\t\t\tcase 5:\n\t\t\tcase 6:\n\t\t\t\treturn 3;\n\t\t\tcase 7:\n\t\t\tcase 8:\n\t\t\t\treturn 4;\n\t\t\tcase 9:\n\t\t\t\treturn 5;\n\t\t\tcase 10:\n\t\t\tcase 11:\n\t\t\tcase 12:\n\t\t\t\treturn 6;\n\t\t\tcase 13:\n\t\t\t\treturn 7;\n\t\t\tcase 14:\n\t\t\tcase 15:\n\t\t\t\treturn 8;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * @param int $index\n\t *\n\t * @return string\n\t */\n\tpublic static function channelArrangementLookup($index) {\n\t\tstatic $lookup = array(\n\t\t\t0  => 'A',\n\t\t\t1  => 'A + B (dual mono)',\n\t\t\t2  => 'L + R (stereo)',\n\t\t\t3  => '(L+R) + (L-R) (sum-difference)',\n\t\t\t4  => 'LT + RT (left and right total)',\n\t\t\t5  => 'C + L + R',\n\t\t\t6  => 'L + R + S',\n\t\t\t7  => 'C + L + R + S',\n\t\t\t8  => 'L + R + SL + SR',\n\t\t\t9  => 'C + L + R + SL + SR',\n\t\t\t10 => 'CL + CR + L + R + SL + SR',\n\t\t\t11 => 'C + L + R+ LR + RR + OV',\n\t\t\t12 => 'CF + CR + LF + RF + LR + RR',\n\t\t\t13 => 'CL + C + CR + L + R + SL + SR',\n\t\t\t14 => 'CL + CR + L + R + SL1 + SL2 + SR1 + SR2',\n\t\t\t15 => 'CL + C+ CR + L + R + SL + S + SR',\n\t\t);\n\t\treturn (isset($lookup[$index]) ? $lookup[$index] : 'user-defined');\n\t}\n\n\t/**\n\t * @param int $index\n\t * @param int $version\n\t *\n\t * @return int|false\n\t */\n\tpublic static function dialogNormalization($index, $version) {\n\t\tswitch ($version) {\n\t\t\tcase 7:\n\t\t\t\treturn 0 - $index;\n\t\t\tcase 6:\n\t\t\t\treturn 0 - 16 - $index;\n\t\t}\n\t\treturn false;\n\t}\n\n}\n", "num_lines": 328}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/////////////////////////////////////////////////////////////////\n/// getID3() by James Heinrich <info@getid3.org>               //\n//  available at https://github.com/JamesHeinrich/getID3       //\n//            or https://www.getid3.org                        //\n//            or http://getid3.sourceforge.net                 //\n//  see readme.txt for more details                            //\n/////////////////////////////////////////////////////////////////\n//                                                             //\n// module.audio.flac.php                                       //\n// module for analyzing FLAC and OggFLAC audio files           //\n// dependencies: module.audio.ogg.php                          //\n//                                                            ///\n/////////////////////////////////////////////////////////////////\n\nif (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers\n\texit;\n}\ngetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ogg.php', __FILE__, true);\n\n/**\n* @tutorial http://flac.sourceforge.net/format.html\n*/\nclass getid3_flac extends getid3_handler\n{\n\tconst syncword = 'fLaC';\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function Analyze() {\n\t\t$info = &$this->getid3->info;\n\n\t\t$this->fseek($info['avdataoffset']);\n\t\t$StreamMarker = $this->fread(4);\n\t\tif ($StreamMarker != self::syncword) {\n\t\t\treturn $this->error('Expecting \"'.getid3_lib::PrintHexBytes(self::syncword).'\" at offset '.$info['avdataoffset'].', found \"'.getid3_lib::PrintHexBytes($StreamMarker).'\"');\n\t\t}\n\t\t$info['fileformat']            = 'flac';\n\t\t$info['audio']['dataformat']   = 'flac';\n\t\t$info['audio']['bitrate_mode'] = 'vbr';\n\t\t$info['audio']['lossless']     = true;\n\n\t\t// parse flac container\n\t\treturn $this->parseMETAdata();\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function parseMETAdata() {\n\t\t$info = &$this->getid3->info;\n\t\tdo {\n\t\t\t$BlockOffset   = $this->ftell();\n\t\t\t$BlockHeader   = $this->fread(4);\n\t\t\t$LBFBT         = getid3_lib::BigEndian2Int(substr($BlockHeader, 0, 1));  // LBFBT = LastBlockFlag + BlockType\n\t\t\t$LastBlockFlag = (bool) ($LBFBT & 0x80);\n\t\t\t$BlockType     =        ($LBFBT & 0x7F);\n\t\t\t$BlockLength   = getid3_lib::BigEndian2Int(substr($BlockHeader, 1, 3));\n\t\t\t$BlockTypeText = self::metaBlockTypeLookup($BlockType);\n\n\t\t\tif (($BlockOffset + 4 + $BlockLength) > $info['avdataend']) {\n\t\t\t\t$this->warning('METADATA_BLOCK_HEADER.BLOCK_TYPE ('.$BlockTypeText.') at offset '.$BlockOffset.' extends beyond end of file');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ($BlockLength < 1) {\n\t\t\t\tif ($BlockTypeText != 'reserved') {\n\t\t\t\t\t// probably supposed to be zero-length\n\t\t\t\t\t$this->warning('METADATA_BLOCK_HEADER.BLOCK_LENGTH ('.$BlockTypeText.') at offset '.$BlockOffset.' is zero bytes');\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$this->error('METADATA_BLOCK_HEADER.BLOCK_LENGTH ('.$BlockLength.') at offset '.$BlockOffset.' is invalid');\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$info['flac'][$BlockTypeText]['raw'] = array();\n\t\t\t$BlockTypeText_raw = &$info['flac'][$BlockTypeText]['raw'];\n\n\t\t\t$BlockTypeText_raw['offset']          = $BlockOffset;\n\t\t\t$BlockTypeText_raw['last_meta_block'] = $LastBlockFlag;\n\t\t\t$BlockTypeText_raw['block_type']      = $BlockType;\n\t\t\t$BlockTypeText_raw['block_type_text'] = $BlockTypeText;\n\t\t\t$BlockTypeText_raw['block_length']    = $BlockLength;\n\t\t\tif ($BlockTypeText_raw['block_type'] != 0x06) { // do not read attachment data automatically\n\t\t\t\t$BlockTypeText_raw['block_data']  = $this->fread($BlockLength);\n\t\t\t}\n\n\t\t\tswitch ($BlockTypeText) {\n\t\t\t\tcase 'STREAMINFO':     // 0x00\n\t\t\t\t\tif (!$this->parseSTREAMINFO($BlockTypeText_raw['block_data'])) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'PADDING':        // 0x01\n\t\t\t\t\tunset($info['flac']['PADDING']); // ignore\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'APPLICATION':    // 0x02\n\t\t\t\t\tif (!$this->parseAPPLICATION($BlockTypeText_raw['block_data'])) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'SEEKTABLE':      // 0x03\n\t\t\t\t\tif (!$this->parseSEEKTABLE($BlockTypeText_raw['block_data'])) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'VORBIS_COMMENT': // 0x04\n\t\t\t\t\tif (!$this->parseVORBIS_COMMENT($BlockTypeText_raw['block_data'])) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'CUESHEET':       // 0x05\n\t\t\t\t\tif (!$this->parseCUESHEET($BlockTypeText_raw['block_data'])) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'PICTURE':        // 0x06\n\t\t\t\t\tif (!$this->parsePICTURE()) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->warning('Unhandled METADATA_BLOCK_HEADER.BLOCK_TYPE ('.$BlockType.') at offset '.$BlockOffset);\n\t\t\t}\n\n\t\t\tunset($info['flac'][$BlockTypeText]['raw']);\n\t\t\t$info['avdataoffset'] = $this->ftell();\n\t\t}\n\t\twhile ($LastBlockFlag === false);\n\n\t\t// handle tags\n\t\tif (!empty($info['flac']['VORBIS_COMMENT']['comments'])) {\n\t\t\t$info['flac']['comments'] = $info['flac']['VORBIS_COMMENT']['comments'];\n\t\t}\n\t\tif (!empty($info['flac']['VORBIS_COMMENT']['vendor'])) {\n\t\t\t$info['audio']['encoder'] = str_replace('reference ', '', $info['flac']['VORBIS_COMMENT']['vendor']);\n\t\t}\n\n\t\t// copy attachments to 'comments' array if nesesary\n\t\tif (isset($info['flac']['PICTURE']) && ($this->getid3->option_save_attachments !== getID3::ATTACHMENTS_NONE)) {\n\t\t\tforeach ($info['flac']['PICTURE'] as $entry) {\n\t\t\t\tif (!empty($entry['data'])) {\n\t\t\t\t\tif (!isset($info['flac']['comments']['picture'])) {\n\t\t\t\t\t\t$info['flac']['comments']['picture'] = array();\n\t\t\t\t\t}\n\t\t\t\t\t$comments_picture_data = array();\n\t\t\t\t\tforeach (array('data', 'image_mime', 'image_width', 'image_height', 'imagetype', 'picturetype', 'description', 'datalength') as $picture_key) {\n\t\t\t\t\t\tif (isset($entry[$picture_key])) {\n\t\t\t\t\t\t\t$comments_picture_data[$picture_key] = $entry[$picture_key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$info['flac']['comments']['picture'][] = $comments_picture_data;\n\t\t\t\t\tunset($comments_picture_data);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (isset($info['flac']['STREAMINFO'])) {\n\t\t\tif (!$this->isDependencyFor('matroska')) {\n\t\t\t\t$info['flac']['compressed_audio_bytes'] = $info['avdataend'] - $info['avdataoffset'];\n\t\t\t}\n\t\t\t$info['flac']['uncompressed_audio_bytes'] = $info['flac']['STREAMINFO']['samples_stream'] * $info['flac']['STREAMINFO']['channels'] * ($info['flac']['STREAMINFO']['bits_per_sample'] / 8);\n\t\t\tif ($info['flac']['uncompressed_audio_bytes'] == 0) {\n\t\t\t\treturn $this->error('Corrupt FLAC file: uncompressed_audio_bytes == zero');\n\t\t\t}\n\t\t\tif (!empty($info['flac']['compressed_audio_bytes'])) {\n\t\t\t\t$info['flac']['compression_ratio'] = $info['flac']['compressed_audio_bytes'] / $info['flac']['uncompressed_audio_bytes'];\n\t\t\t}\n\t\t}\n\n\t\t// set md5_data_source - built into flac 0.5+\n\t\tif (isset($info['flac']['STREAMINFO']['audio_signature'])) {\n\n\t\t\tif ($info['flac']['STREAMINFO']['audio_signature'] === str_repeat(\"\\x00\", 16)) {\n\t\t\t\t$this->warning('FLAC STREAMINFO.audio_signature is null (known issue with libOggFLAC)');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$info['md5_data_source'] = '';\n\t\t\t\t$md5 = $info['flac']['STREAMINFO']['audio_signature'];\n\t\t\t\tfor ($i = 0; $i < strlen($md5); $i++) {\n\t\t\t\t\t$info['md5_data_source'] .= str_pad(dechex(ord($md5[$i])), 2, '00', STR_PAD_LEFT);\n\t\t\t\t}\n\t\t\t\tif (!preg_match('/^[0-9a-f]{32}$/', $info['md5_data_source'])) {\n\t\t\t\t\tunset($info['md5_data_source']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (isset($info['flac']['STREAMINFO']['bits_per_sample'])) {\n\t\t\t$info['audio']['bits_per_sample'] = $info['flac']['STREAMINFO']['bits_per_sample'];\n\t\t\tif ($info['audio']['bits_per_sample'] == 8) {\n\t\t\t\t// special case\n\t\t\t\t// must invert sign bit on all data bytes before MD5'ing to match FLAC's calculated value\n\t\t\t\t// MD5sum calculates on unsigned bytes, but FLAC calculated MD5 on 8-bit audio data as signed\n\t\t\t\t$this->warning('FLAC calculates MD5 data strangely on 8-bit audio, so the stored md5_data_source value will not match the decoded WAV file');\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\n\t/**\n\t * @param string $BlockData\n\t *\n\t * @return array\n\t */\n\tpublic static function parseSTREAMINFOdata($BlockData) {\n\t\t$streaminfo = array();\n\t\t$streaminfo['min_block_size']  = getid3_lib::BigEndian2Int(substr($BlockData, 0, 2));\n\t\t$streaminfo['max_block_size']  = getid3_lib::BigEndian2Int(substr($BlockData, 2, 2));\n\t\t$streaminfo['min_frame_size']  = getid3_lib::BigEndian2Int(substr($BlockData, 4, 3));\n\t\t$streaminfo['max_frame_size']  = getid3_lib::BigEndian2Int(substr($BlockData, 7, 3));\n\n\t\t$SRCSBSS                       = getid3_lib::BigEndian2Bin(substr($BlockData, 10, 8));\n\t\t$streaminfo['sample_rate']     = getid3_lib::Bin2Dec(substr($SRCSBSS,  0, 20));\n\t\t$streaminfo['channels']        = getid3_lib::Bin2Dec(substr($SRCSBSS, 20,  3)) + 1;\n\t\t$streaminfo['bits_per_sample'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 23,  5)) + 1;\n\t\t$streaminfo['samples_stream']  = getid3_lib::Bin2Dec(substr($SRCSBSS, 28, 36));\n\n\t\t$streaminfo['audio_signature'] =                           substr($BlockData, 18, 16);\n\n\t\treturn $streaminfo;\n\t}\n\n\t/**\n\t * @param string $BlockData\n\t *\n\t * @return bool\n\t */\n\tprivate function parseSTREAMINFO($BlockData) {\n\t\t$info = &$this->getid3->info;\n\n\t\t$info['flac']['STREAMINFO'] = self::parseSTREAMINFOdata($BlockData);\n\n\t\tif (!empty($info['flac']['STREAMINFO']['sample_rate'])) {\n\n\t\t\t$info['audio']['bitrate_mode']    = 'vbr';\n\t\t\t$info['audio']['sample_rate']     = $info['flac']['STREAMINFO']['sample_rate'];\n\t\t\t$info['audio']['channels']        = $info['flac']['STREAMINFO']['channels'];\n\t\t\t$info['audio']['bits_per_sample'] = $info['flac']['STREAMINFO']['bits_per_sample'];\n\t\t\t$info['playtime_seconds']         = $info['flac']['STREAMINFO']['samples_stream'] / $info['flac']['STREAMINFO']['sample_rate'];\n\t\t\tif ($info['playtime_seconds'] > 0) {\n\t\t\t\tif (!$this->isDependencyFor('matroska')) {\n\t\t\t\t\t$info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds'];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->warning('Cannot determine audio bitrate because total stream size is unknown');\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\treturn $this->error('Corrupt METAdata block: STREAMINFO');\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $BlockData\n\t *\n\t * @return bool\n\t */\n\tprivate function parseAPPLICATION($BlockData) {\n\t\t$info = &$this->getid3->info;\n\n\t\t$ApplicationID = getid3_lib::BigEndian2Int(substr($BlockData, 0, 4));\n\t\t$info['flac']['APPLICATION'][$ApplicationID]['name'] = self::applicationIDLookup($ApplicationID);\n\t\t$info['flac']['APPLICATION'][$ApplicationID]['data'] = substr($BlockData, 4);\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $BlockData\n\t *\n\t * @return bool\n\t */\n\tprivate function parseSEEKTABLE($BlockData) {\n\t\t$info = &$this->getid3->info;\n\n\t\t$offset = 0;\n\t\t$BlockLength = strlen($BlockData);\n\t\t$placeholderpattern = str_repeat(\"\\xFF\", 8);\n\t\twhile ($offset < $BlockLength) {\n\t\t\t$SampleNumberString = substr($BlockData, $offset, 8);\n\t\t\t$offset += 8;\n\t\t\tif ($SampleNumberString == $placeholderpattern) {\n\n\t\t\t\t// placeholder point\n\t\t\t\tgetid3_lib::safe_inc($info['flac']['SEEKTABLE']['placeholders'], 1);\n\t\t\t\t$offset += 10;\n\n\t\t\t} else {\n\n\t\t\t\t$SampleNumber                                        = getid3_lib::BigEndian2Int($SampleNumberString);\n\t\t\t\t$info['flac']['SEEKTABLE'][$SampleNumber]['offset']  = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8));\n\t\t\t\t$offset += 8;\n\t\t\t\t$info['flac']['SEEKTABLE'][$SampleNumber]['samples'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 2));\n\t\t\t\t$offset += 2;\n\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $BlockData\n\t *\n\t * @return bool\n\t */\n\tprivate function parseVORBIS_COMMENT($BlockData) {\n\t\t$info = &$this->getid3->info;\n\n\t\t$getid3_ogg = new getid3_ogg($this->getid3);\n\t\tif ($this->isDependencyFor('matroska')) {\n\t\t\t$getid3_ogg->setStringMode($this->data_string);\n\t\t}\n\t\t$getid3_ogg->ParseVorbisComments();\n\t\tif (isset($info['ogg'])) {\n\t\t\tunset($info['ogg']['comments_raw']);\n\t\t\t$info['flac']['VORBIS_COMMENT'] = $info['ogg'];\n\t\t\tunset($info['ogg']);\n\t\t}\n\n\t\tunset($getid3_ogg);\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $BlockData\n\t *\n\t * @return bool\n\t */\n\tprivate function parseCUESHEET($BlockData) {\n\t\t$info = &$this->getid3->info;\n\t\t$offset = 0;\n\t\t$info['flac']['CUESHEET']['media_catalog_number'] =                              trim(substr($BlockData, $offset, 128), \"\\0\");\n\t\t$offset += 128;\n\t\t$info['flac']['CUESHEET']['lead_in_samples']      =         getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8));\n\t\t$offset += 8;\n\t\t$info['flac']['CUESHEET']['flags']['is_cd']       = (bool) (getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)) & 0x80);\n\t\t$offset += 1;\n\n\t\t$offset += 258; // reserved\n\n\t\t$info['flac']['CUESHEET']['number_tracks']        =         getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1));\n\t\t$offset += 1;\n\n\t\tfor ($track = 0; $track < $info['flac']['CUESHEET']['number_tracks']; $track++) {\n\t\t\t$TrackSampleOffset = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8));\n\t\t\t$offset += 8;\n\t\t\t$TrackNumber       = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1));\n\t\t\t$offset += 1;\n\n\t\t\t$info['flac']['CUESHEET']['tracks'][$TrackNumber]['sample_offset']         = $TrackSampleOffset;\n\n\t\t\t$info['flac']['CUESHEET']['tracks'][$TrackNumber]['isrc']                  =                           substr($BlockData, $offset, 12);\n\t\t\t$offset += 12;\n\n\t\t\t$TrackFlagsRaw                                                             = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1));\n\t\t\t$offset += 1;\n\t\t\t$info['flac']['CUESHEET']['tracks'][$TrackNumber]['flags']['is_audio']     = (bool) ($TrackFlagsRaw & 0x80);\n\t\t\t$info['flac']['CUESHEET']['tracks'][$TrackNumber]['flags']['pre_emphasis'] = (bool) ($TrackFlagsRaw & 0x40);\n\n\t\t\t$offset += 13; // reserved\n\n\t\t\t$info['flac']['CUESHEET']['tracks'][$TrackNumber]['index_points']          = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1));\n\t\t\t$offset += 1;\n\n\t\t\tfor ($index = 0; $index < $info['flac']['CUESHEET']['tracks'][$TrackNumber]['index_points']; $index++) {\n\t\t\t\t$IndexSampleOffset = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8));\n\t\t\t\t$offset += 8;\n\t\t\t\t$IndexNumber       = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1));\n\t\t\t\t$offset += 1;\n\n\t\t\t\t$offset += 3; // reserved\n\n\t\t\t\t$info['flac']['CUESHEET']['tracks'][$TrackNumber]['indexes'][$IndexNumber] = $IndexSampleOffset;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Parse METADATA_BLOCK_PICTURE flac structure and extract attachment\n\t * External usage: audio.ogg\n\t *\n\t * @return bool\n\t */\n\tpublic function parsePICTURE() {\n\t\t$info = &$this->getid3->info;\n\n\t\t$picture['typeid']         = getid3_lib::BigEndian2Int($this->fread(4));\n\t\t$picture['picturetype']    = self::pictureTypeLookup($picture['typeid']);\n\t\t$picture['image_mime']     = $this->fread(getid3_lib::BigEndian2Int($this->fread(4)));\n\t\t$descr_length              = getid3_lib::BigEndian2Int($this->fread(4));\n\t\tif ($descr_length) {\n\t\t\t$picture['description'] = $this->fread($descr_length);\n\t\t}\n\t\t$picture['image_width']    = getid3_lib::BigEndian2Int($this->fread(4));\n\t\t$picture['image_height']   = getid3_lib::BigEndian2Int($this->fread(4));\n\t\t$picture['color_depth']    = getid3_lib::BigEndian2Int($this->fread(4));\n\t\t$picture['colors_indexed'] = getid3_lib::BigEndian2Int($this->fread(4));\n\t\t$picture['datalength']     = getid3_lib::BigEndian2Int($this->fread(4));\n\n\t\tif ($picture['image_mime'] == '-->') {\n\t\t\t$picture['data'] = $this->fread($picture['datalength']);\n\t\t} else {\n\t\t\t$picture['data'] = $this->saveAttachment(\n\t\t\t\tstr_replace('/', '_', $picture['picturetype']).'_'.$this->ftell(),\n\t\t\t\t$this->ftell(),\n\t\t\t\t$picture['datalength'],\n\t\t\t\t$picture['image_mime']);\n\t\t}\n\n\t\t$info['flac']['PICTURE'][] = $picture;\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param int $blocktype\n\t *\n\t * @return string\n\t */\n\tpublic static function metaBlockTypeLookup($blocktype) {\n\t\tstatic $lookup = array(\n\t\t\t0 => 'STREAMINFO',\n\t\t\t1 => 'PADDING',\n\t\t\t2 => 'APPLICATION',\n\t\t\t3 => 'SEEKTABLE',\n\t\t\t4 => 'VORBIS_COMMENT',\n\t\t\t5 => 'CUESHEET',\n\t\t\t6 => 'PICTURE',\n\t\t);\n\t\treturn (isset($lookup[$blocktype]) ? $lookup[$blocktype] : 'reserved');\n\t}\n\n\t/**\n\t * @param int $applicationid\n\t *\n\t * @return string\n\t */\n\tpublic static function applicationIDLookup($applicationid) {\n\t\t// http://flac.sourceforge.net/id.html\n\t\tstatic $lookup = array(\n\t\t\t0x41544348 => 'FlacFile',                                                                           // \"ATCH\"\n\t\t\t0x42534F4C => 'beSolo',                                                                             // \"BSOL\"\n\t\t\t0x42554753 => 'Bugs Player',                                                                        // \"BUGS\"\n\t\t\t0x43756573 => 'GoldWave cue points (specification)',                                                // \"Cues\"\n\t\t\t0x46696361 => 'CUE Splitter',                                                                       // \"Fica\"\n\t\t\t0x46746F6C => 'flac-tools',                                                                         // \"Ftol\"\n\t\t\t0x4D4F5442 => 'MOTB MetaCzar',                                                                      // \"MOTB\"\n\t\t\t0x4D505345 => 'MP3 Stream Editor',                                                                  // \"MPSE\"\n\t\t\t0x4D754D4C => 'MusicML: Music Metadata Language',                                                   // \"MuML\"\n\t\t\t0x52494646 => 'Sound Devices RIFF chunk storage',                                                   // \"RIFF\"\n\t\t\t0x5346464C => 'Sound Font FLAC',                                                                    // \"SFFL\"\n\t\t\t0x534F4E59 => 'Sony Creative Software',                                                             // \"SONY\"\n\t\t\t0x5351455A => 'flacsqueeze',                                                                        // \"SQEZ\"\n\t\t\t0x54745776 => 'TwistedWave',                                                                        // \"TtWv\"\n\t\t\t0x55495453 => 'UITS Embedding tools',                                                               // \"UITS\"\n\t\t\t0x61696666 => 'FLAC AIFF chunk storage',                                                            // \"aiff\"\n\t\t\t0x696D6167 => 'flac-image application for storing arbitrary files in APPLICATION metadata blocks',  // \"imag\"\n\t\t\t0x7065656D => 'Parseable Embedded Extensible Metadata (specification)',                             // \"peem\"\n\t\t\t0x71667374 => 'QFLAC Studio',                                                                       // \"qfst\"\n\t\t\t0x72696666 => 'FLAC RIFF chunk storage',                                                            // \"riff\"\n\t\t\t0x74756E65 => 'TagTuner',                                                                           // \"tune\"\n\t\t\t0x78626174 => 'XBAT',                                                                               // \"xbat\"\n\t\t\t0x786D6364 => 'xmcd',                                                                               // \"xmcd\"\n\t\t);\n\t\treturn (isset($lookup[$applicationid]) ? $lookup[$applicationid] : 'reserved');\n\t}\n\n\t/**\n\t * @param int $type_id\n\t *\n\t * @return string\n\t */\n\tpublic static function pictureTypeLookup($type_id) {\n\t\tstatic $lookup = array (\n\t\t\t 0 => 'Other',\n\t\t\t 1 => '32x32 pixels \\'file icon\\' (PNG only)',\n\t\t\t 2 => 'Other file icon',\n\t\t\t 3 => 'Cover (front)',\n\t\t\t 4 => 'Cover (back)',\n\t\t\t 5 => 'Leaflet page',\n\t\t\t 6 => 'Media (e.g. label side of CD)',\n\t\t\t 7 => 'Lead artist/lead performer/soloist',\n\t\t\t 8 => 'Artist/performer',\n\t\t\t 9 => 'Conductor',\n\t\t\t10 => 'Band/Orchestra',\n\t\t\t11 => 'Composer',\n\t\t\t12 => 'Lyricist/text writer',\n\t\t\t13 => 'Recording Location',\n\t\t\t14 => 'During recording',\n\t\t\t15 => 'During performance',\n\t\t\t16 => 'Movie/video screen capture',\n\t\t\t17 => 'A bright coloured fish',\n\t\t\t18 => 'Illustration',\n\t\t\t19 => 'Band/artist logotype',\n\t\t\t20 => 'Publisher/Studio logotype',\n\t\t);\n\t\treturn (isset($lookup[$type_id]) ? $lookup[$type_id] : 'reserved');\n\t}\n\n}\n", "num_lines": 519}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/////////////////////////////////////////////////////////////////\n/// getID3() by James Heinrich <info@getid3.org>               //\n//  available at https://github.com/JamesHeinrich/getID3       //\n//            or https://www.getid3.org                        //\n//            or http://getid3.sourceforge.net                 //\n//  see readme.txt for more details                            //\n/////////////////////////////////////////////////////////////////\n//                                                             //\n// module.audio.mp3.php                                        //\n// module for analyzing MP3 files                              //\n// dependencies: NONE                                          //\n//                                                            ///\n/////////////////////////////////////////////////////////////////\n\nif (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers\n\texit;\n}\n\n// number of frames to scan to determine if MPEG-audio sequence is valid\n// Lower this number to 5-20 for faster scanning\n// Increase this number to 50+ for most accurate detection of valid VBR/CBR\n// mpeg-audio streams\ndefine('GETID3_MP3_VALID_CHECK_FRAMES', 35);\n\n\nclass getid3_mp3 extends getid3_handler\n{\n\t/**\n\t * Forces getID3() to scan the file byte-by-byte and log all the valid audio frame headers - extremely slow,\n\t * unrecommended, but may provide data from otherwise-unusable files.\n\t *\n\t * @var bool\n\t */\n\tpublic $allow_bruteforce = false;\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function Analyze() {\n\t\t$info = &$this->getid3->info;\n\n\t\t$initialOffset = $info['avdataoffset'];\n\n\t\tif (!$this->getOnlyMPEGaudioInfo($info['avdataoffset'])) {\n\t\t\tif ($this->allow_bruteforce) {\n\t\t\t\t$this->error('Rescanning file in BruteForce mode');\n\t\t\t\t$this->getOnlyMPEGaudioInfoBruteForce();\n\t\t\t}\n\t\t}\n\n\n\t\tif (isset($info['mpeg']['audio']['bitrate_mode'])) {\n\t\t\t$info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']);\n\t\t}\n\n\t\tif (((isset($info['id3v2']['headerlength']) && ($info['avdataoffset'] > $info['id3v2']['headerlength'])) || (!isset($info['id3v2']) && ($info['avdataoffset'] > 0) && ($info['avdataoffset'] != $initialOffset)))) {\n\n\t\t\t$synchoffsetwarning = 'Unknown data before synch ';\n\t\t\tif (isset($info['id3v2']['headerlength'])) {\n\t\t\t\t$synchoffsetwarning .= '(ID3v2 header ends at '.$info['id3v2']['headerlength'].', then '.($info['avdataoffset'] - $info['id3v2']['headerlength']).' bytes garbage, ';\n\t\t\t} elseif ($initialOffset > 0) {\n\t\t\t\t$synchoffsetwarning .= '(should be at '.$initialOffset.', ';\n\t\t\t} else {\n\t\t\t\t$synchoffsetwarning .= '(should be at beginning of file, ';\n\t\t\t}\n\t\t\t$synchoffsetwarning .= 'synch detected at '.$info['avdataoffset'].')';\n\t\t\tif (isset($info['audio']['bitrate_mode']) && ($info['audio']['bitrate_mode'] == 'cbr')) {\n\n\t\t\t\tif (!empty($info['id3v2']['headerlength']) && (($info['avdataoffset'] - $info['id3v2']['headerlength']) == $info['mpeg']['audio']['framelength'])) {\n\n\t\t\t\t\t$synchoffsetwarning .= '. This is a known problem with some versions of LAME (3.90-3.92) DLL in CBR mode.';\n\t\t\t\t\t$info['audio']['codec'] = 'LAME';\n\t\t\t\t\t$CurrentDataLAMEversionString = 'LAME3.';\n\n\t\t\t\t} elseif (empty($info['id3v2']['headerlength']) && ($info['avdataoffset'] == $info['mpeg']['audio']['framelength'])) {\n\n\t\t\t\t\t$synchoffsetwarning .= '. This is a known problem with some versions of LAME (3.90 - 3.92) DLL in CBR mode.';\n\t\t\t\t\t$info['audio']['codec'] = 'LAME';\n\t\t\t\t\t$CurrentDataLAMEversionString = 'LAME3.';\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t$this->warning($synchoffsetwarning);\n\n\t\t}\n\n\t\tif (isset($info['mpeg']['audio']['LAME'])) {\n\t\t\t$info['audio']['codec'] = 'LAME';\n\t\t\tif (!empty($info['mpeg']['audio']['LAME']['long_version'])) {\n\t\t\t\t$info['audio']['encoder'] = rtrim($info['mpeg']['audio']['LAME']['long_version'], \"\\x00\");\n\t\t\t} elseif (!empty($info['mpeg']['audio']['LAME']['short_version'])) {\n\t\t\t\t$info['audio']['encoder'] = rtrim($info['mpeg']['audio']['LAME']['short_version'], \"\\x00\");\n\t\t\t}\n\t\t}\n\n\t\t$CurrentDataLAMEversionString = (!empty($CurrentDataLAMEversionString) ? $CurrentDataLAMEversionString : (isset($info['audio']['encoder']) ? $info['audio']['encoder'] : ''));\n\t\tif (!empty($CurrentDataLAMEversionString) && (substr($CurrentDataLAMEversionString, 0, 6) == 'LAME3.') && !preg_match('[0-9\\)]', substr($CurrentDataLAMEversionString, -1))) {\n\t\t\t// a version number of LAME that does not end with a number like \"LAME3.92\"\n\t\t\t// or with a closing parenthesis like \"LAME3.88 (alpha)\"\n\t\t\t// or a version of LAME with the LAMEtag-not-filled-in-DLL-mode bug (3.90-3.92)\n\n\t\t\t// not sure what the actual last frame length will be, but will be less than or equal to 1441\n\t\t\t$PossiblyLongerLAMEversion_FrameLength = 1441;\n\n\t\t\t// Not sure what version of LAME this is - look in padding of last frame for longer version string\n\t\t\t$PossibleLAMEversionStringOffset = $info['avdataend'] - $PossiblyLongerLAMEversion_FrameLength;\n\t\t\t$this->fseek($PossibleLAMEversionStringOffset);\n\t\t\t$PossiblyLongerLAMEversion_Data = $this->fread($PossiblyLongerLAMEversion_FrameLength);\n\t\t\tswitch (substr($CurrentDataLAMEversionString, -1)) {\n\t\t\t\tcase 'a':\n\t\t\t\tcase 'b':\n\t\t\t\t\t// \"LAME3.94a\" will have a longer version string of \"LAME3.94 (alpha)\" for example\n\t\t\t\t\t// need to trim off \"a\" to match longer string\n\t\t\t\t\t$CurrentDataLAMEversionString = substr($CurrentDataLAMEversionString, 0, -1);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (($PossiblyLongerLAMEversion_String = strstr($PossiblyLongerLAMEversion_Data, $CurrentDataLAMEversionString)) !== false) {\n\t\t\t\tif (substr($PossiblyLongerLAMEversion_String, 0, strlen($CurrentDataLAMEversionString)) == $CurrentDataLAMEversionString) {\n\t\t\t\t\t$PossiblyLongerLAMEversion_NewString = substr($PossiblyLongerLAMEversion_String, 0, strspn($PossiblyLongerLAMEversion_String, 'LAME0123456789., (abcdefghijklmnopqrstuvwxyzJFSOND)')); //\"LAME3.90.3\"  \"LAME3.87 (beta 1, Sep 27 2000)\" \"LAME3.88 (beta)\"\n\t\t\t\t\tif (empty($info['audio']['encoder']) || (strlen($PossiblyLongerLAMEversion_NewString) > strlen($info['audio']['encoder']))) {\n\t\t\t\t\t\t$info['audio']['encoder'] = $PossiblyLongerLAMEversion_NewString;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!empty($info['audio']['encoder'])) {\n\t\t\t$info['audio']['encoder'] = rtrim($info['audio']['encoder'], \"\\x00 \");\n\t\t}\n\n\t\tswitch (isset($info['mpeg']['audio']['layer']) ? $info['mpeg']['audio']['layer'] : '') {\n\t\t\tcase 1:\n\t\t\tcase 2:\n\t\t\t\t$info['audio']['dataformat'] = 'mp'.$info['mpeg']['audio']['layer'];\n\t\t\t\tbreak;\n\t\t}\n\t\tif (isset($info['fileformat']) && ($info['fileformat'] == 'mp3')) {\n\t\t\tswitch ($info['audio']['dataformat']) {\n\t\t\t\tcase 'mp1':\n\t\t\t\tcase 'mp2':\n\t\t\t\tcase 'mp3':\n\t\t\t\t\t$info['fileformat'] = $info['audio']['dataformat'];\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->warning('Expecting [audio][dataformat] to be mp1/mp2/mp3 when fileformat == mp3, [audio][dataformat] actually \"'.$info['audio']['dataformat'].'\"');\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (empty($info['fileformat'])) {\n\t\t\tunset($info['fileformat']);\n\t\t\tunset($info['audio']['bitrate_mode']);\n\t\t\tunset($info['avdataoffset']);\n\t\t\tunset($info['avdataend']);\n\t\t\treturn false;\n\t\t}\n\n\t\t$info['mime_type']         = 'audio/mpeg';\n\t\t$info['audio']['lossless'] = false;\n\n\t\t// Calculate playtime\n\t\tif (!isset($info['playtime_seconds']) && isset($info['audio']['bitrate']) && ($info['audio']['bitrate'] > 0)) {\n\t\t\t// https://github.com/JamesHeinrich/getID3/issues/161\n\t\t\t// VBR header frame contains ~0.026s of silent audio data, but is not actually part of the original encoding and should be ignored\n\t\t\t$xingVBRheaderFrameLength = ((isset($info['mpeg']['audio']['VBR_frames']) && isset($info['mpeg']['audio']['framelength'])) ? $info['mpeg']['audio']['framelength'] : 0);\n\n\t\t\t$info['playtime_seconds'] = ($info['avdataend'] - $info['avdataoffset'] - $xingVBRheaderFrameLength) * 8 / $info['audio']['bitrate'];\n\t\t}\n\n\t\t$info['audio']['encoder_options'] = $this->GuessEncoderOptions();\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @return string\n\t */\n\tpublic function GuessEncoderOptions() {\n\t\t// shortcuts\n\t\t$info = &$this->getid3->info;\n\t\t$thisfile_mpeg_audio = array();\n\t\t$thisfile_mpeg_audio_lame = array();\n\t\tif (!empty($info['mpeg']['audio'])) {\n\t\t\t$thisfile_mpeg_audio = &$info['mpeg']['audio'];\n\t\t\tif (!empty($thisfile_mpeg_audio['LAME'])) {\n\t\t\t\t$thisfile_mpeg_audio_lame = &$thisfile_mpeg_audio['LAME'];\n\t\t\t}\n\t\t}\n\n\t\t$encoder_options = '';\n\t\tstatic $NamedPresetBitrates = array(16, 24, 40, 56, 112, 128, 160, 192, 256);\n\n\t\tif (isset($thisfile_mpeg_audio['VBR_method']) && ($thisfile_mpeg_audio['VBR_method'] == 'Fraunhofer') && !empty($thisfile_mpeg_audio['VBR_quality'])) {\n\n\t\t\t$encoder_options = 'VBR q'.$thisfile_mpeg_audio['VBR_quality'];\n\n\t\t} elseif (!empty($thisfile_mpeg_audio_lame['preset_used']) && isset($thisfile_mpeg_audio_lame['preset_used_id']) && (!in_array($thisfile_mpeg_audio_lame['preset_used_id'], $NamedPresetBitrates))) {\n\n\t\t\t$encoder_options = $thisfile_mpeg_audio_lame['preset_used'];\n\n\t\t} elseif (!empty($thisfile_mpeg_audio_lame['vbr_quality'])) {\n\n\t\t\tstatic $KnownEncoderValues = array();\n\t\t\tif (empty($KnownEncoderValues)) {\n\n\t\t\t\t//$KnownEncoderValues[abrbitrate_minbitrate][vbr_quality][raw_vbr_method][raw_noise_shaping][raw_stereo_mode][ath_type][lowpass_frequency] = 'preset name';\n\t\t\t\t$KnownEncoderValues[0xFF][58][1][1][3][2][20500] = '--alt-preset insane';        // 3.90,   3.90.1, 3.92\n\t\t\t\t$KnownEncoderValues[0xFF][58][1][1][3][2][20600] = '--alt-preset insane';        // 3.90.2, 3.90.3, 3.91\n\t\t\t\t$KnownEncoderValues[0xFF][57][1][1][3][4][20500] = '--alt-preset insane';        // 3.94,   3.95\n\t\t\t\t$KnownEncoderValues['**'][78][3][2][3][2][19500] = '--alt-preset extreme';       // 3.90,   3.90.1, 3.92\n\t\t\t\t$KnownEncoderValues['**'][78][3][2][3][2][19600] = '--alt-preset extreme';       // 3.90.2, 3.91\n\t\t\t\t$KnownEncoderValues['**'][78][3][1][3][2][19600] = '--alt-preset extreme';       // 3.90.3\n\t\t\t\t$KnownEncoderValues['**'][78][4][2][3][2][19500] = '--alt-preset fast extreme';  // 3.90,   3.90.1, 3.92\n\t\t\t\t$KnownEncoderValues['**'][78][4][2][3][2][19600] = '--alt-preset fast extreme';  // 3.90.2, 3.90.3, 3.91\n\t\t\t\t$KnownEncoderValues['**'][78][3][2][3][4][19000] = '--alt-preset standard';      // 3.90,   3.90.1, 3.90.2, 3.91, 3.92\n\t\t\t\t$KnownEncoderValues['**'][78][3][1][3][4][19000] = '--alt-preset standard';      // 3.90.3\n\t\t\t\t$KnownEncoderValues['**'][78][4][2][3][4][19000] = '--alt-preset fast standard'; // 3.90,   3.90.1, 3.90.2, 3.91, 3.92\n\t\t\t\t$KnownEncoderValues['**'][78][4][1][3][4][19000] = '--alt-preset fast standard'; // 3.90.3\n\t\t\t\t$KnownEncoderValues['**'][88][4][1][3][3][19500] = '--r3mix';                    // 3.90,   3.90.1, 3.92\n\t\t\t\t$KnownEncoderValues['**'][88][4][1][3][3][19600] = '--r3mix';                    // 3.90.2, 3.90.3, 3.91\n\t\t\t\t$KnownEncoderValues['**'][67][4][1][3][4][18000] = '--r3mix';                    // 3.94,   3.95\n\t\t\t\t$KnownEncoderValues['**'][68][3][2][3][4][18000] = '--alt-preset medium';        // 3.90.3\n\t\t\t\t$KnownEncoderValues['**'][68][4][2][3][4][18000] = '--alt-preset fast medium';   // 3.90.3\n\n\t\t\t\t$KnownEncoderValues[0xFF][99][1][1][1][2][0]     = '--preset studio';            // 3.90,   3.90.1, 3.90.2, 3.91, 3.92\n\t\t\t\t$KnownEncoderValues[0xFF][58][2][1][3][2][20600] = '--preset studio';            // 3.90.3, 3.93.1\n\t\t\t\t$KnownEncoderValues[0xFF][58][2][1][3][2][20500] = '--preset studio';            // 3.93\n\t\t\t\t$KnownEncoderValues[0xFF][57][2][1][3][4][20500] = '--preset studio';            // 3.94,   3.95\n\t\t\t\t$KnownEncoderValues[0xC0][88][1][1][1][2][0]     = '--preset cd';                // 3.90,   3.90.1, 3.90.2,   3.91, 3.92\n\t\t\t\t$KnownEncoderValues[0xC0][58][2][2][3][2][19600] = '--preset cd';                // 3.90.3, 3.93.1\n\t\t\t\t$KnownEncoderValues[0xC0][58][2][2][3][2][19500] = '--preset cd';                // 3.93\n\t\t\t\t$KnownEncoderValues[0xC0][57][2][1][3][4][19500] = '--preset cd';                // 3.94,   3.95\n\t\t\t\t$KnownEncoderValues[0xA0][78][1][1][3][2][18000] = '--preset hifi';              // 3.90,   3.90.1, 3.90.2,   3.91, 3.92\n\t\t\t\t$KnownEncoderValues[0xA0][58][2][2][3][2][18000] = '--preset hifi';              // 3.90.3, 3.93,   3.93.1\n\t\t\t\t$KnownEncoderValues[0xA0][57][2][1][3][4][18000] = '--preset hifi';              // 3.94,   3.95\n\t\t\t\t$KnownEncoderValues[0x80][67][1][1][3][2][18000] = '--preset tape';              // 3.90,   3.90.1, 3.90.2,   3.91, 3.92\n\t\t\t\t$KnownEncoderValues[0x80][67][1][1][3][2][15000] = '--preset radio';             // 3.90,   3.90.1, 3.90.2,   3.91, 3.92\n\t\t\t\t$KnownEncoderValues[0x70][67][1][1][3][2][15000] = '--preset fm';                // 3.90,   3.90.1, 3.90.2,   3.91, 3.92\n\t\t\t\t$KnownEncoderValues[0x70][58][2][2][3][2][16000] = '--preset tape/radio/fm';     // 3.90.3, 3.93,   3.93.1\n\t\t\t\t$KnownEncoderValues[0x70][57][2][1][3][4][16000] = '--preset tape/radio/fm';     // 3.94,   3.95\n\t\t\t\t$KnownEncoderValues[0x38][58][2][2][0][2][10000] = '--preset voice';             // 3.90.3, 3.93,   3.93.1\n\t\t\t\t$KnownEncoderValues[0x38][57][2][1][0][4][15000] = '--preset voice';             // 3.94,   3.95\n\t\t\t\t$KnownEncoderValues[0x38][57][2][1][0][4][16000] = '--preset voice';             // 3.94a14\n\t\t\t\t$KnownEncoderValues[0x28][65][1][1][0][2][7500]  = '--preset mw-us';             // 3.90,   3.90.1, 3.92\n\t\t\t\t$KnownEncoderValues[0x28][65][1][1][0][2][7600]  = '--preset mw-us';             // 3.90.2, 3.91\n\t\t\t\t$KnownEncoderValues[0x28][58][2][2][0][2][7000]  = '--preset mw-us';             // 3.90.3, 3.93,   3.93.1\n\t\t\t\t$KnownEncoderValues[0x28][57][2][1][0][4][10500] = '--preset mw-us';             // 3.94,   3.95\n\t\t\t\t$KnownEncoderValues[0x28][57][2][1][0][4][11200] = '--preset mw-us';             // 3.94a14\n\t\t\t\t$KnownEncoderValues[0x28][57][2][1][0][4][8800]  = '--preset mw-us';             // 3.94a15\n\t\t\t\t$KnownEncoderValues[0x18][58][2][2][0][2][4000]  = '--preset phon+/lw/mw-eu/sw'; // 3.90.3, 3.93.1\n\t\t\t\t$KnownEncoderValues[0x18][58][2][2][0][2][3900]  = '--preset phon+/lw/mw-eu/sw'; // 3.93\n\t\t\t\t$KnownEncoderValues[0x18][57][2][1][0][4][5900]  = '--preset phon+/lw/mw-eu/sw'; // 3.94,   3.95\n\t\t\t\t$KnownEncoderValues[0x18][57][2][1][0][4][6200]  = '--preset phon+/lw/mw-eu/sw'; // 3.94a14\n\t\t\t\t$KnownEncoderValues[0x18][57][2][1][0][4][3200]  = '--preset phon+/lw/mw-eu/sw'; // 3.94a15\n\t\t\t\t$KnownEncoderValues[0x10][58][2][2][0][2][3800]  = '--preset phone';             // 3.90.3, 3.93.1\n\t\t\t\t$KnownEncoderValues[0x10][58][2][2][0][2][3700]  = '--preset phone';             // 3.93\n\t\t\t\t$KnownEncoderValues[0x10][57][2][1][0][4][5600]  = '--preset phone';             // 3.94,   3.95\n\t\t\t}\n\n\t\t\tif (isset($KnownEncoderValues[$thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']])) {\n\n\t\t\t\t$encoder_options = $KnownEncoderValues[$thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']];\n\n\t\t\t} elseif (isset($KnownEncoderValues['**'][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']])) {\n\n\t\t\t\t$encoder_options = $KnownEncoderValues['**'][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']];\n\n\t\t\t} elseif ($info['audio']['bitrate_mode'] == 'vbr') {\n\n\t\t\t\t// http://gabriel.mp3-tech.org/mp3infotag.html\n\t\t\t\t// int    Quality = (100 - 10 * gfp->VBR_q - gfp->quality)h\n\n\n\t\t\t\t$LAME_V_value = 10 - ceil($thisfile_mpeg_audio_lame['vbr_quality'] / 10);\n\t\t\t\t$LAME_q_value = 100 - $thisfile_mpeg_audio_lame['vbr_quality'] - ($LAME_V_value * 10);\n\t\t\t\t$encoder_options = '-V'.$LAME_V_value.' -q'.$LAME_q_value;\n\n\t\t\t} elseif ($info['audio']['bitrate_mode'] == 'cbr') {\n\n\t\t\t\t$encoder_options = strtoupper($info['audio']['bitrate_mode']).ceil($info['audio']['bitrate'] / 1000);\n\n\t\t\t} else {\n\n\t\t\t\t$encoder_options = strtoupper($info['audio']['bitrate_mode']);\n\n\t\t\t}\n\n\t\t} elseif (!empty($thisfile_mpeg_audio_lame['bitrate_abr'])) {\n\n\t\t\t$encoder_options = 'ABR'.$thisfile_mpeg_audio_lame['bitrate_abr'];\n\n\t\t} elseif (!empty($info['audio']['bitrate'])) {\n\n\t\t\tif ($info['audio']['bitrate_mode'] == 'cbr') {\n\t\t\t\t$encoder_options = strtoupper($info['audio']['bitrate_mode']).ceil($info['audio']['bitrate'] / 1000);\n\t\t\t} else {\n\t\t\t\t$encoder_options = strtoupper($info['audio']['bitrate_mode']);\n\t\t\t}\n\n\t\t}\n\t\tif (!empty($thisfile_mpeg_audio_lame['bitrate_min'])) {\n\t\t\t$encoder_options .= ' -b'.$thisfile_mpeg_audio_lame['bitrate_min'];\n\t\t}\n\n\t\tif (!empty($thisfile_mpeg_audio_lame['encoding_flags']['nogap_prev']) || !empty($thisfile_mpeg_audio_lame['encoding_flags']['nogap_next'])) {\n\t\t\t$encoder_options .= ' --nogap';\n\t\t}\n\n\t\tif (!empty($thisfile_mpeg_audio_lame['lowpass_frequency'])) {\n\t\t\t$ExplodedOptions = explode(' ', $encoder_options, 4);\n\t\t\tif ($ExplodedOptions[0] == '--r3mix') {\n\t\t\t\t$ExplodedOptions[1] = 'r3mix';\n\t\t\t}\n\t\t\tswitch ($ExplodedOptions[0]) {\n\t\t\t\tcase '--preset':\n\t\t\t\tcase '--alt-preset':\n\t\t\t\tcase '--r3mix':\n\t\t\t\t\tif ($ExplodedOptions[1] == 'fast') {\n\t\t\t\t\t\t$ExplodedOptions[1] .= ' '.$ExplodedOptions[2];\n\t\t\t\t\t}\n\t\t\t\t\tswitch ($ExplodedOptions[1]) {\n\t\t\t\t\t\tcase 'portable':\n\t\t\t\t\t\tcase 'medium':\n\t\t\t\t\t\tcase 'standard':\n\t\t\t\t\t\tcase 'extreme':\n\t\t\t\t\t\tcase 'insane':\n\t\t\t\t\t\tcase 'fast portable':\n\t\t\t\t\t\tcase 'fast medium':\n\t\t\t\t\t\tcase 'fast standard':\n\t\t\t\t\t\tcase 'fast extreme':\n\t\t\t\t\t\tcase 'fast insane':\n\t\t\t\t\t\tcase 'r3mix':\n\t\t\t\t\t\t\tstatic $ExpectedLowpass = array(\n\t\t\t\t\t\t\t\t\t'insane|20500'        => 20500,\n\t\t\t\t\t\t\t\t\t'insane|20600'        => 20600,  // 3.90.2, 3.90.3, 3.91\n\t\t\t\t\t\t\t\t\t'medium|18000'        => 18000,\n\t\t\t\t\t\t\t\t\t'fast medium|18000'   => 18000,\n\t\t\t\t\t\t\t\t\t'extreme|19500'       => 19500,  // 3.90,   3.90.1, 3.92, 3.95\n\t\t\t\t\t\t\t\t\t'extreme|19600'       => 19600,  // 3.90.2, 3.90.3, 3.91, 3.93.1\n\t\t\t\t\t\t\t\t\t'fast extreme|19500'  => 19500,  // 3.90,   3.90.1, 3.92, 3.95\n\t\t\t\t\t\t\t\t\t'fast extreme|19600'  => 19600,  // 3.90.2, 3.90.3, 3.91, 3.93.1\n\t\t\t\t\t\t\t\t\t'standard|19000'      => 19000,\n\t\t\t\t\t\t\t\t\t'fast standard|19000' => 19000,\n\t\t\t\t\t\t\t\t\t'r3mix|19500'         => 19500,  // 3.90,   3.90.1, 3.92\n\t\t\t\t\t\t\t\t\t'r3mix|19600'         => 19600,  // 3.90.2, 3.90.3, 3.91\n\t\t\t\t\t\t\t\t\t'r3mix|18000'         => 18000,  // 3.94,   3.95\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (!isset($ExpectedLowpass[$ExplodedOptions[1].'|'.$thisfile_mpeg_audio_lame['lowpass_frequency']]) && ($thisfile_mpeg_audio_lame['lowpass_frequency'] < 22050) && (round($thisfile_mpeg_audio_lame['lowpass_frequency'] / 1000) < round($thisfile_mpeg_audio['sample_rate'] / 2000))) {\n\t\t\t\t\t\t\t\t$encoder_options .= ' --lowpass '.$thisfile_mpeg_audio_lame['lowpass_frequency'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (isset($thisfile_mpeg_audio_lame['raw']['source_sample_freq'])) {\n\t\t\tif (($thisfile_mpeg_audio['sample_rate'] == 44100) && ($thisfile_mpeg_audio_lame['raw']['source_sample_freq'] != 1)) {\n\t\t\t\t$encoder_options .= ' --resample 44100';\n\t\t\t} elseif (($thisfile_mpeg_audio['sample_rate'] == 48000) && ($thisfile_mpeg_audio_lame['raw']['source_sample_freq'] != 2)) {\n\t\t\t\t$encoder_options .= ' --resample 48000';\n\t\t\t} elseif ($thisfile_mpeg_audio['sample_rate'] < 44100) {\n\t\t\t\tswitch ($thisfile_mpeg_audio_lame['raw']['source_sample_freq']) {\n\t\t\t\t\tcase 0: // <= 32000\n\t\t\t\t\t\t// may or may not be same as source frequency - ignore\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1: // 44100\n\t\t\t\t\tcase 2: // 48000\n\t\t\t\t\tcase 3: // 48000+\n\t\t\t\t\t\t$ExplodedOptions = explode(' ', $encoder_options, 4);\n\t\t\t\t\t\tswitch ($ExplodedOptions[0]) {\n\t\t\t\t\t\t\tcase '--preset':\n\t\t\t\t\t\t\tcase '--alt-preset':\n\t\t\t\t\t\t\t\tswitch ($ExplodedOptions[1]) {\n\t\t\t\t\t\t\t\t\tcase 'fast':\n\t\t\t\t\t\t\t\t\tcase 'portable':\n\t\t\t\t\t\t\t\t\tcase 'medium':\n\t\t\t\t\t\t\t\t\tcase 'standard':\n\t\t\t\t\t\t\t\t\tcase 'extreme':\n\t\t\t\t\t\t\t\t\tcase 'insane':\n\t\t\t\t\t\t\t\t\t\t$encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate'];\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tstatic $ExpectedResampledRate = array(\n\t\t\t\t\t\t\t\t\t\t\t\t'phon+/lw/mw-eu/sw|16000' => 16000,\n\t\t\t\t\t\t\t\t\t\t\t\t'mw-us|24000'             => 24000, // 3.95\n\t\t\t\t\t\t\t\t\t\t\t\t'mw-us|32000'             => 32000, // 3.93\n\t\t\t\t\t\t\t\t\t\t\t\t'mw-us|16000'             => 16000, // 3.92\n\t\t\t\t\t\t\t\t\t\t\t\t'phone|16000'             => 16000,\n\t\t\t\t\t\t\t\t\t\t\t\t'phone|11025'             => 11025, // 3.94a15\n\t\t\t\t\t\t\t\t\t\t\t\t'radio|32000'             => 32000, // 3.94a15\n\t\t\t\t\t\t\t\t\t\t\t\t'fm/radio|32000'          => 32000, // 3.92\n\t\t\t\t\t\t\t\t\t\t\t\t'fm|32000'                => 32000, // 3.90\n\t\t\t\t\t\t\t\t\t\t\t\t'voice|32000'             => 32000);\n\t\t\t\t\t\t\t\t\t\tif (!isset($ExpectedResampledRate[$ExplodedOptions[1].'|'.$thisfile_mpeg_audio['sample_rate']])) {\n\t\t\t\t\t\t\t\t\t\t\t$encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase '--r3mix':\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate'];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (empty($encoder_options) && !empty($info['audio']['bitrate']) && !empty($info['audio']['bitrate_mode'])) {\n\t\t\t//$encoder_options = strtoupper($info['audio']['bitrate_mode']).ceil($info['audio']['bitrate'] / 1000);\n\t\t\t$encoder_options = strtoupper($info['audio']['bitrate_mode']);\n\t\t}\n\n\t\treturn $encoder_options;\n\t}\n\n\t/**\n\t * @param int   $offset\n\t * @param array $info\n\t * @param bool  $recursivesearch\n\t * @param bool  $ScanAsCBR\n\t * @param bool  $FastMPEGheaderScan\n\t *\n\t * @return bool\n\t */\n\tpublic function decodeMPEGaudioHeader($offset, &$info, $recursivesearch=true, $ScanAsCBR=false, $FastMPEGheaderScan=false) {\n\t\tstatic $MPEGaudioVersionLookup;\n\t\tstatic $MPEGaudioLayerLookup;\n\t\tstatic $MPEGaudioBitrateLookup;\n\t\tstatic $MPEGaudioFrequencyLookup;\n\t\tstatic $MPEGaudioChannelModeLookup;\n\t\tstatic $MPEGaudioModeExtensionLookup;\n\t\tstatic $MPEGaudioEmphasisLookup;\n\t\tif (empty($MPEGaudioVersionLookup)) {\n\t\t\t$MPEGaudioVersionLookup       = self::MPEGaudioVersionArray();\n\t\t\t$MPEGaudioLayerLookup         = self::MPEGaudioLayerArray();\n\t\t\t$MPEGaudioBitrateLookup       = self::MPEGaudioBitrateArray();\n\t\t\t$MPEGaudioFrequencyLookup     = self::MPEGaudioFrequencyArray();\n\t\t\t$MPEGaudioChannelModeLookup   = self::MPEGaudioChannelModeArray();\n\t\t\t$MPEGaudioModeExtensionLookup = self::MPEGaudioModeExtensionArray();\n\t\t\t$MPEGaudioEmphasisLookup      = self::MPEGaudioEmphasisArray();\n\t\t}\n\n\t\tif ($this->fseek($offset) != 0) {\n\t\t\t$this->error('decodeMPEGaudioHeader() failed to seek to next offset at '.$offset);\n\t\t\treturn false;\n\t\t}\n\t\t//$headerstring = $this->fread(1441); // worst-case max length = 32kHz @ 320kbps layer 3 = 1441 bytes/frame\n\t\t$headerstring = $this->fread(226); // LAME header at offset 36 + 190 bytes of Xing/LAME data\n\n\t\t// MP3 audio frame structure:\n\t\t// $aa $aa $aa $aa [$bb $bb] $cc...\n\t\t// where $aa..$aa is the four-byte mpeg-audio header (below)\n\t\t// $bb $bb is the optional 2-byte CRC\n\t\t// and $cc... is the audio data\n\n\t\t$head4 = substr($headerstring, 0, 4);\n\t\t$head4_key = getid3_lib::PrintHexBytes($head4, true, false, false);\n\t\tstatic $MPEGaudioHeaderDecodeCache = array();\n\t\tif (isset($MPEGaudioHeaderDecodeCache[$head4_key])) {\n\t\t\t$MPEGheaderRawArray = $MPEGaudioHeaderDecodeCache[$head4_key];\n\t\t} else {\n\t\t\t$MPEGheaderRawArray = self::MPEGaudioHeaderDecode($head4);\n\t\t\t$MPEGaudioHeaderDecodeCache[$head4_key] = $MPEGheaderRawArray;\n\t\t}\n\n\t\tstatic $MPEGaudioHeaderValidCache = array();\n\t\tif (!isset($MPEGaudioHeaderValidCache[$head4_key])) { // Not in cache\n\t\t\t//$MPEGaudioHeaderValidCache[$head4_key] = self::MPEGaudioHeaderValid($MPEGheaderRawArray, false, true);  // allow badly-formatted freeformat (from LAME 3.90 - 3.93.1)\n\t\t\t$MPEGaudioHeaderValidCache[$head4_key] = self::MPEGaudioHeaderValid($MPEGheaderRawArray, false, false);\n\t\t}\n\n\t\t// shortcut\n\t\tif (!isset($info['mpeg']['audio'])) {\n\t\t\t$info['mpeg']['audio'] = array();\n\t\t}\n\t\t$thisfile_mpeg_audio = &$info['mpeg']['audio'];\n\n\t\tif ($MPEGaudioHeaderValidCache[$head4_key]) {\n\t\t\t$thisfile_mpeg_audio['raw'] = $MPEGheaderRawArray;\n\t\t} else {\n\t\t\t$this->error('Invalid MPEG audio header ('.getid3_lib::PrintHexBytes($head4).') at offset '.$offset);\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$FastMPEGheaderScan) {\n\t\t\t$thisfile_mpeg_audio['version']       = $MPEGaudioVersionLookup[$thisfile_mpeg_audio['raw']['version']];\n\t\t\t$thisfile_mpeg_audio['layer']         = $MPEGaudioLayerLookup[$thisfile_mpeg_audio['raw']['layer']];\n\n\t\t\t$thisfile_mpeg_audio['channelmode']   = $MPEGaudioChannelModeLookup[$thisfile_mpeg_audio['raw']['channelmode']];\n\t\t\t$thisfile_mpeg_audio['channels']      = (($thisfile_mpeg_audio['channelmode'] == 'mono') ? 1 : 2);\n\t\t\t$thisfile_mpeg_audio['sample_rate']   = $MPEGaudioFrequencyLookup[$thisfile_mpeg_audio['version']][$thisfile_mpeg_audio['raw']['sample_rate']];\n\t\t\t$thisfile_mpeg_audio['protection']    = !$thisfile_mpeg_audio['raw']['protection'];\n\t\t\t$thisfile_mpeg_audio['private']       = (bool) $thisfile_mpeg_audio['raw']['private'];\n\t\t\t$thisfile_mpeg_audio['modeextension'] = $MPEGaudioModeExtensionLookup[$thisfile_mpeg_audio['layer']][$thisfile_mpeg_audio['raw']['modeextension']];\n\t\t\t$thisfile_mpeg_audio['copyright']     = (bool) $thisfile_mpeg_audio['raw']['copyright'];\n\t\t\t$thisfile_mpeg_audio['original']      = (bool) $thisfile_mpeg_audio['raw']['original'];\n\t\t\t$thisfile_mpeg_audio['emphasis']      = $MPEGaudioEmphasisLookup[$thisfile_mpeg_audio['raw']['emphasis']];\n\n\t\t\t$info['audio']['channels']    = $thisfile_mpeg_audio['channels'];\n\t\t\t$info['audio']['sample_rate'] = $thisfile_mpeg_audio['sample_rate'];\n\n\t\t\tif ($thisfile_mpeg_audio['protection']) {\n\t\t\t\t$thisfile_mpeg_audio['crc'] = getid3_lib::BigEndian2Int(substr($headerstring, 4, 2));\n\t\t\t}\n\t\t}\n\n\t\tif ($thisfile_mpeg_audio['raw']['bitrate'] == 15) {\n\t\t\t// http://www.hydrogenaudio.org/?act=ST&f=16&t=9682&st=0\n\t\t\t$this->warning('Invalid bitrate index (15), this is a known bug in free-format MP3s encoded by LAME v3.90 - 3.93.1');\n\t\t\t$thisfile_mpeg_audio['raw']['bitrate'] = 0;\n\t\t}\n\t\t$thisfile_mpeg_audio['padding'] = (bool) $thisfile_mpeg_audio['raw']['padding'];\n\t\t$thisfile_mpeg_audio['bitrate'] = $MPEGaudioBitrateLookup[$thisfile_mpeg_audio['version']][$thisfile_mpeg_audio['layer']][$thisfile_mpeg_audio['raw']['bitrate']];\n\n\t\tif (($thisfile_mpeg_audio['bitrate'] == 'free') && ($offset == $info['avdataoffset'])) {\n\t\t\t// only skip multiple frame check if free-format bitstream found at beginning of file\n\t\t\t// otherwise is quite possibly simply corrupted data\n\t\t\t$recursivesearch = false;\n\t\t}\n\n\t\t// For Layer 2 there are some combinations of bitrate and mode which are not allowed.\n\t\tif (!$FastMPEGheaderScan && ($thisfile_mpeg_audio['layer'] == '2')) {\n\n\t\t\t$info['audio']['dataformat'] = 'mp2';\n\t\t\tswitch ($thisfile_mpeg_audio['channelmode']) {\n\n\t\t\t\tcase 'mono':\n\t\t\t\t\tif (($thisfile_mpeg_audio['bitrate'] == 'free') || ($thisfile_mpeg_audio['bitrate'] <= 192000)) {\n\t\t\t\t\t\t// these are ok\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->error($thisfile_mpeg_audio['bitrate'].'kbps not allowed in Layer 2, '.$thisfile_mpeg_audio['channelmode'].'.');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'stereo':\n\t\t\t\tcase 'joint stereo':\n\t\t\t\tcase 'dual channel':\n\t\t\t\t\tif (($thisfile_mpeg_audio['bitrate'] == 'free') || ($thisfile_mpeg_audio['bitrate'] == 64000) || ($thisfile_mpeg_audio['bitrate'] >= 96000)) {\n\t\t\t\t\t\t// these are ok\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->error(intval(round($thisfile_mpeg_audio['bitrate'] / 1000)).'kbps not allowed in Layer 2, '.$thisfile_mpeg_audio['channelmode'].'.');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\n\t\tif ($info['audio']['sample_rate'] > 0) {\n\t\t\t$thisfile_mpeg_audio['framelength'] = self::MPEGaudioFrameLength($thisfile_mpeg_audio['bitrate'], $thisfile_mpeg_audio['version'], $thisfile_mpeg_audio['layer'], (int) $thisfile_mpeg_audio['padding'], $info['audio']['sample_rate']);\n\t\t}\n\n\t\t$nextframetestoffset = $offset + 1;\n\t\tif ($thisfile_mpeg_audio['bitrate'] != 'free') {\n\n\t\t\t$info['audio']['bitrate'] = $thisfile_mpeg_audio['bitrate'];\n\n\t\t\tif (isset($thisfile_mpeg_audio['framelength'])) {\n\t\t\t\t$nextframetestoffset = $offset + $thisfile_mpeg_audio['framelength'];\n\t\t\t} else {\n\t\t\t\t$this->error('Frame at offset('.$offset.') is has an invalid frame length.');\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\n\t\t$ExpectedNumberOfAudioBytes = 0;\n\n\t\t////////////////////////////////////////////////////////////////////////////////////\n\t\t// Variable-bitrate headers\n\n\t\tif (substr($headerstring, 4 + 32, 4) == 'VBRI') {\n\t\t\t// Fraunhofer VBR header is hardcoded 'VBRI' at offset 0x24 (36)\n\t\t\t// specs taken from http://minnie.tuhs.org/pipermail/mp3encoder/2001-January/001800.html\n\n\t\t\t$thisfile_mpeg_audio['bitrate_mode'] = 'vbr';\n\t\t\t$thisfile_mpeg_audio['VBR_method']   = 'Fraunhofer';\n\t\t\t$info['audio']['codec']              = 'Fraunhofer';\n\n\t\t\t$SideInfoData = substr($headerstring, 4 + 2, 32);\n\n\t\t\t$FraunhoferVBROffset = 36;\n\n\t\t\t$thisfile_mpeg_audio['VBR_encoder_version']     = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset +  4, 2)); // VbriVersion\n\t\t\t$thisfile_mpeg_audio['VBR_encoder_delay']       = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset +  6, 2)); // VbriDelay\n\t\t\t$thisfile_mpeg_audio['VBR_quality']             = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset +  8, 2)); // VbriQuality\n\t\t\t$thisfile_mpeg_audio['VBR_bytes']               = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 10, 4)); // VbriStreamBytes\n\t\t\t$thisfile_mpeg_audio['VBR_frames']              = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 14, 4)); // VbriStreamFrames\n\t\t\t$thisfile_mpeg_audio['VBR_seek_offsets']        = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 18, 2)); // VbriTableSize\n\t\t\t$thisfile_mpeg_audio['VBR_seek_scale']          = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 20, 2)); // VbriTableScale\n\t\t\t$thisfile_mpeg_audio['VBR_entry_bytes']         = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 22, 2)); // VbriEntryBytes\n\t\t\t$thisfile_mpeg_audio['VBR_entry_frames']        = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 24, 2)); // VbriEntryFrames\n\n\t\t\t$ExpectedNumberOfAudioBytes = $thisfile_mpeg_audio['VBR_bytes'];\n\n\t\t\t$previousbyteoffset = $offset;\n\t\t\tfor ($i = 0; $i < $thisfile_mpeg_audio['VBR_seek_offsets']; $i++) {\n\t\t\t\t$Fraunhofer_OffsetN = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset, $thisfile_mpeg_audio['VBR_entry_bytes']));\n\t\t\t\t$FraunhoferVBROffset += $thisfile_mpeg_audio['VBR_entry_bytes'];\n\t\t\t\t$thisfile_mpeg_audio['VBR_offsets_relative'][$i] = ($Fraunhofer_OffsetN * $thisfile_mpeg_audio['VBR_seek_scale']);\n\t\t\t\t$thisfile_mpeg_audio['VBR_offsets_absolute'][$i] = ($Fraunhofer_OffsetN * $thisfile_mpeg_audio['VBR_seek_scale']) + $previousbyteoffset;\n\t\t\t\t$previousbyteoffset += $Fraunhofer_OffsetN;\n\t\t\t}\n\n\n\t\t} else {\n\n\t\t\t// Xing VBR header is hardcoded 'Xing' at a offset 0x0D (13), 0x15 (21) or 0x24 (36)\n\t\t\t// depending on MPEG layer and number of channels\n\n\t\t\t$VBRidOffset = self::XingVBRidOffset($thisfile_mpeg_audio['version'], $thisfile_mpeg_audio['channelmode']);\n\t\t\t$SideInfoData = substr($headerstring, 4 + 2, $VBRidOffset - 4);\n\n\t\t\tif ((substr($headerstring, $VBRidOffset, strlen('Xing')) == 'Xing') || (substr($headerstring, $VBRidOffset, strlen('Info')) == 'Info')) {\n\t\t\t\t// 'Xing' is traditional Xing VBR frame\n\t\t\t\t// 'Info' is LAME-encoded CBR (This was done to avoid CBR files to be recognized as traditional Xing VBR files by some decoders.)\n\t\t\t\t// 'Info' *can* legally be used to specify a VBR file as well, however.\n\n\t\t\t\t// http://www.multiweb.cz/twoinches/MP3inside.htm\n\t\t\t\t//00..03 = \"Xing\" or \"Info\"\n\t\t\t\t//04..07 = Flags:\n\t\t\t\t//  0x01  Frames Flag     set if value for number of frames in file is stored\n\t\t\t\t//  0x02  Bytes Flag      set if value for filesize in bytes is stored\n\t\t\t\t//  0x04  TOC Flag        set if values for TOC are stored\n\t\t\t\t//  0x08  VBR Scale Flag  set if values for VBR scale is stored\n\t\t\t\t//08..11  Frames: Number of frames in file (including the first Xing/Info one)\n\t\t\t\t//12..15  Bytes:  File length in Bytes\n\t\t\t\t//16..115  TOC (Table of Contents):\n\t\t\t\t//  Contains of 100 indexes (one Byte length) for easier lookup in file. Approximately solves problem with moving inside file.\n\t\t\t\t//  Each Byte has a value according this formula:\n\t\t\t\t//  (TOC[i] / 256) * fileLenInBytes\n\t\t\t\t//  So if song lasts eg. 240 sec. and you want to jump to 60. sec. (and file is 5 000 000 Bytes length) you can use:\n\t\t\t\t//  TOC[(60/240)*100] = TOC[25]\n\t\t\t\t//  and corresponding Byte in file is then approximately at:\n\t\t\t\t//  (TOC[25]/256) * 5000000\n\t\t\t\t//116..119  VBR Scale\n\n\n\t\t\t\t// should be safe to leave this at 'vbr' and let it be overriden to 'cbr' if a CBR preset/mode is used by LAME\n//\t\t\t\tif (substr($headerstring, $VBRidOffset, strlen('Info')) == 'Xing') {\n\t\t\t\t\t$thisfile_mpeg_audio['bitrate_mode'] = 'vbr';\n\t\t\t\t\t$thisfile_mpeg_audio['VBR_method']   = 'Xing';\n//\t\t\t\t} else {\n//\t\t\t\t\t$ScanAsCBR = true;\n//\t\t\t\t\t$thisfile_mpeg_audio['bitrate_mode'] = 'cbr';\n//\t\t\t\t}\n\n\t\t\t\t$thisfile_mpeg_audio['xing_flags_raw'] = getid3_lib::BigEndian2Int(substr($headerstring, $VBRidOffset + 4, 4));\n\n\t\t\t\t$thisfile_mpeg_audio['xing_flags']['frames']    = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000001);\n\t\t\t\t$thisfile_mpeg_audio['xing_flags']['bytes']     = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000002);\n\t\t\t\t$thisfile_mpeg_audio['xing_flags']['toc']       = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000004);\n\t\t\t\t$thisfile_mpeg_audio['xing_flags']['vbr_scale'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000008);\n\n\t\t\t\tif ($thisfile_mpeg_audio['xing_flags']['frames']) {\n\t\t\t\t\t$thisfile_mpeg_audio['VBR_frames'] = getid3_lib::BigEndian2Int(substr($headerstring, $VBRidOffset +  8, 4));\n\t\t\t\t\t//$thisfile_mpeg_audio['VBR_frames']--; // don't count header Xing/Info frame\n\t\t\t\t}\n\t\t\t\tif ($thisfile_mpeg_audio['xing_flags']['bytes']) {\n\t\t\t\t\t$thisfile_mpeg_audio['VBR_bytes']  = getid3_lib::BigEndian2Int(substr($headerstring, $VBRidOffset + 12, 4));\n\t\t\t\t}\n\n\t\t\t\t//if (($thisfile_mpeg_audio['bitrate'] == 'free') && !empty($thisfile_mpeg_audio['VBR_frames']) && !empty($thisfile_mpeg_audio['VBR_bytes'])) {\n\t\t\t\t//if (!empty($thisfile_mpeg_audio['VBR_frames']) && !empty($thisfile_mpeg_audio['VBR_bytes'])) {\n\t\t\t\tif (!empty($thisfile_mpeg_audio['VBR_frames'])) {\n\t\t\t\t\t$used_filesize  = 0;\n\t\t\t\t\tif (!empty($thisfile_mpeg_audio['VBR_bytes'])) {\n\t\t\t\t\t\t$used_filesize = $thisfile_mpeg_audio['VBR_bytes'];\n\t\t\t\t\t} elseif (!empty($info['filesize'])) {\n\t\t\t\t\t\t$used_filesize  = $info['filesize'];\n\t\t\t\t\t\t$used_filesize -= (isset($info['id3v2']['headerlength']) ? intval($info['id3v2']['headerlength']) : 0);\n\t\t\t\t\t\t$used_filesize -= (isset($info['id3v1']) ? 128 : 0);\n\t\t\t\t\t\t$used_filesize -= (isset($info['tag_offset_end']) ? $info['tag_offset_end'] - $info['tag_offset_start'] : 0);\n\t\t\t\t\t\t$this->warning('MP3.Xing header missing VBR_bytes, assuming MPEG audio portion of file is '.number_format($used_filesize).' bytes');\n\t\t\t\t\t}\n\n\t\t\t\t\t$framelengthfloat = $used_filesize / $thisfile_mpeg_audio['VBR_frames'];\n\n\t\t\t\t\tif ($thisfile_mpeg_audio['layer'] == '1') {\n\t\t\t\t\t\t// BitRate = (((FrameLengthInBytes / 4) - Padding) * SampleRate) / 12\n\t\t\t\t\t\t//$info['audio']['bitrate'] = ((($framelengthfloat / 4) - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 12;\n\t\t\t\t\t\t$info['audio']['bitrate'] = ($framelengthfloat / 4) * $thisfile_mpeg_audio['sample_rate'] * (2 / $info['audio']['channels']) / 12;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Bitrate = ((FrameLengthInBytes - Padding) * SampleRate) / 144\n\t\t\t\t\t\t//$info['audio']['bitrate'] = (($framelengthfloat - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 144;\n\t\t\t\t\t\t$info['audio']['bitrate'] = $framelengthfloat * $thisfile_mpeg_audio['sample_rate'] * (2 / $info['audio']['channels']) / 144;\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_mpeg_audio['framelength'] = floor($framelengthfloat);\n\t\t\t\t}\n\n\t\t\t\tif ($thisfile_mpeg_audio['xing_flags']['toc']) {\n\t\t\t\t\t$LAMEtocData = substr($headerstring, $VBRidOffset + 16, 100);\n\t\t\t\t\tfor ($i = 0; $i < 100; $i++) {\n\t\t\t\t\t\t$thisfile_mpeg_audio['toc'][$i] = ord($LAMEtocData[$i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($thisfile_mpeg_audio['xing_flags']['vbr_scale']) {\n\t\t\t\t\t$thisfile_mpeg_audio['VBR_scale'] = getid3_lib::BigEndian2Int(substr($headerstring, $VBRidOffset + 116, 4));\n\t\t\t\t}\n\n\n\t\t\t\t// http://gabriel.mp3-tech.org/mp3infotag.html\n\t\t\t\tif (substr($headerstring, $VBRidOffset + 120, 4) == 'LAME') {\n\n\t\t\t\t\t// shortcut\n\t\t\t\t\t$thisfile_mpeg_audio['LAME'] = array();\n\t\t\t\t\t$thisfile_mpeg_audio_lame    = &$thisfile_mpeg_audio['LAME'];\n\n\n\t\t\t\t\t$thisfile_mpeg_audio_lame['long_version']  = substr($headerstring, $VBRidOffset + 120, 20);\n\t\t\t\t\t$thisfile_mpeg_audio_lame['short_version'] = substr($thisfile_mpeg_audio_lame['long_version'], 0, 9);\n\t\t\t\t\t$thisfile_mpeg_audio_lame['numeric_version'] = str_replace('LAME', '', $thisfile_mpeg_audio_lame['short_version']);\n\t\t\t\t\tif (preg_match('#^LAME([0-9\\\\.a-z]+)#', $thisfile_mpeg_audio_lame['long_version'], $matches)) {\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['short_version']   = $matches[0];\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['numeric_version'] = $matches[1];\n\t\t\t\t\t}\n\t\t\t\t\tforeach (explode('.', $thisfile_mpeg_audio_lame['numeric_version']) as $key => $number) {\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['integer_version'][$key] = intval($number);\n\t\t\t\t\t}\n\n\t\t\t\t\t//if ($thisfile_mpeg_audio_lame['short_version'] >= 'LAME3.90') {\n\t\t\t\t\tif ((($thisfile_mpeg_audio_lame['integer_version'][0] * 1000) + $thisfile_mpeg_audio_lame['integer_version'][1]) >= 3090) { // cannot use string version compare, may have \"LAME3.90\" or \"LAME3.100\" -- see https://github.com/JamesHeinrich/getID3/issues/207\n\n\t\t\t\t\t\t// extra 11 chars are not part of version string when LAMEtag present\n\t\t\t\t\t\tunset($thisfile_mpeg_audio_lame['long_version']);\n\n\t\t\t\t\t\t// It the LAME tag was only introduced in LAME v3.90\n\t\t\t\t\t\t// http://www.hydrogenaudio.org/?act=ST&f=15&t=9933\n\n\t\t\t\t\t\t// Offsets of various bytes in http://gabriel.mp3-tech.org/mp3infotag.html\n\t\t\t\t\t\t// are assuming a 'Xing' identifier offset of 0x24, which is the case for\n\t\t\t\t\t\t// MPEG-1 non-mono, but not for other combinations\n\t\t\t\t\t\t$LAMEtagOffsetContant = $VBRidOffset - 0x24;\n\n\t\t\t\t\t\t// shortcuts\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['RGAD']    = array('track'=>array(), 'album'=>array());\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD       = &$thisfile_mpeg_audio_lame['RGAD'];\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD_track = &$thisfile_mpeg_audio_lame_RGAD['track'];\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD_album = &$thisfile_mpeg_audio_lame_RGAD['album'];\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['raw'] = array();\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame_raw    = &$thisfile_mpeg_audio_lame['raw'];\n\n\t\t\t\t\t\t// byte $9B  VBR Quality\n\t\t\t\t\t\t// This field is there to indicate a quality level, although the scale was not precised in the original Xing specifications.\n\t\t\t\t\t\t// Actually overwrites original Xing bytes\n\t\t\t\t\t\tunset($thisfile_mpeg_audio['VBR_scale']);\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['vbr_quality'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0x9B, 1));\n\n\t\t\t\t\t\t// bytes $9C-$A4  Encoder short VersionString\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['short_version'] = substr($headerstring, $LAMEtagOffsetContant + 0x9C, 9);\n\n\t\t\t\t\t\t// byte $A5  Info Tag revision + VBR method\n\t\t\t\t\t\t$LAMEtagRevisionVBRmethod = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xA5, 1));\n\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['tag_revision']   = ($LAMEtagRevisionVBRmethod & 0xF0) >> 4;\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame_raw['vbr_method'] =  $LAMEtagRevisionVBRmethod & 0x0F;\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['vbr_method']     = self::LAMEvbrMethodLookup($thisfile_mpeg_audio_lame_raw['vbr_method']);\n\t\t\t\t\t\t$thisfile_mpeg_audio['bitrate_mode']        = substr($thisfile_mpeg_audio_lame['vbr_method'], 0, 3); // usually either 'cbr' or 'vbr', but truncates 'vbr-old / vbr-rh' to 'vbr'\n\n\t\t\t\t\t\t// byte $A6  Lowpass filter value\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['lowpass_frequency'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xA6, 1)) * 100;\n\n\t\t\t\t\t\t// bytes $A7-$AE  Replay Gain\n\t\t\t\t\t\t// http://privatewww.essex.ac.uk/~djmrob/replaygain/rg_data_format.html\n\t\t\t\t\t\t// bytes $A7-$AA : 32 bit floating point \"Peak signal amplitude\"\n\t\t\t\t\t\tif ($thisfile_mpeg_audio_lame['short_version'] >= 'LAME3.94b') {\n\t\t\t\t\t\t\t// LAME 3.94a16 and later - 9.23 fixed point\n\t\t\t\t\t\t\t// ie 0x0059E2EE / (2^23) = 5890798 / 8388608 = 0.7022378444671630859375\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD['peak_amplitude'] = (float) ((getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xA7, 4))) / 8388608);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// LAME 3.94a15 and earlier - 32-bit floating point\n\t\t\t\t\t\t\t// Actually 3.94a16 will fall in here too and be WRONG, but is hard to detect 3.94a16 vs 3.94a15\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD['peak_amplitude'] = getid3_lib::LittleEndian2Float(substr($headerstring, $LAMEtagOffsetContant + 0xA7, 4));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($thisfile_mpeg_audio_lame_RGAD['peak_amplitude'] == 0) {\n\t\t\t\t\t\t\tunset($thisfile_mpeg_audio_lame_RGAD['peak_amplitude']);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD['peak_db'] = getid3_lib::RGADamplitude2dB($thisfile_mpeg_audio_lame_RGAD['peak_amplitude']);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame_raw['RGAD_track']      =   getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xAB, 2));\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame_raw['RGAD_album']      =   getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xAD, 2));\n\n\n\t\t\t\t\t\tif ($thisfile_mpeg_audio_lame_raw['RGAD_track'] != 0) {\n\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD_track['raw']['name']        = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0xE000) >> 13;\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD_track['raw']['originator']  = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x1C00) >> 10;\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD_track['raw']['sign_bit']    = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x0200) >> 9;\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD_track['raw']['gain_adjust'] =  $thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x01FF;\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD_track['name']       = getid3_lib::RGADnameLookup($thisfile_mpeg_audio_lame_RGAD_track['raw']['name']);\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD_track['originator'] = getid3_lib::RGADoriginatorLookup($thisfile_mpeg_audio_lame_RGAD_track['raw']['originator']);\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD_track['gain_db']    = getid3_lib::RGADadjustmentLookup($thisfile_mpeg_audio_lame_RGAD_track['raw']['gain_adjust'], $thisfile_mpeg_audio_lame_RGAD_track['raw']['sign_bit']);\n\n\t\t\t\t\t\t\tif (!empty($thisfile_mpeg_audio_lame_RGAD['peak_amplitude'])) {\n\t\t\t\t\t\t\t\t$info['replay_gain']['track']['peak']   = $thisfile_mpeg_audio_lame_RGAD['peak_amplitude'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$info['replay_gain']['track']['originator'] = $thisfile_mpeg_audio_lame_RGAD_track['originator'];\n\t\t\t\t\t\t\t$info['replay_gain']['track']['adjustment'] = $thisfile_mpeg_audio_lame_RGAD_track['gain_db'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tunset($thisfile_mpeg_audio_lame_RGAD['track']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($thisfile_mpeg_audio_lame_raw['RGAD_album'] != 0) {\n\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD_album['raw']['name']        = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0xE000) >> 13;\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD_album['raw']['originator']  = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x1C00) >> 10;\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD_album['raw']['sign_bit']    = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x0200) >> 9;\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD_album['raw']['gain_adjust'] = $thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x01FF;\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD_album['name']       = getid3_lib::RGADnameLookup($thisfile_mpeg_audio_lame_RGAD_album['raw']['name']);\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD_album['originator'] = getid3_lib::RGADoriginatorLookup($thisfile_mpeg_audio_lame_RGAD_album['raw']['originator']);\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame_RGAD_album['gain_db']    = getid3_lib::RGADadjustmentLookup($thisfile_mpeg_audio_lame_RGAD_album['raw']['gain_adjust'], $thisfile_mpeg_audio_lame_RGAD_album['raw']['sign_bit']);\n\n\t\t\t\t\t\t\tif (!empty($thisfile_mpeg_audio_lame_RGAD['peak_amplitude'])) {\n\t\t\t\t\t\t\t\t$info['replay_gain']['album']['peak']   = $thisfile_mpeg_audio_lame_RGAD['peak_amplitude'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$info['replay_gain']['album']['originator'] = $thisfile_mpeg_audio_lame_RGAD_album['originator'];\n\t\t\t\t\t\t\t$info['replay_gain']['album']['adjustment'] = $thisfile_mpeg_audio_lame_RGAD_album['gain_db'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tunset($thisfile_mpeg_audio_lame_RGAD['album']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (empty($thisfile_mpeg_audio_lame_RGAD)) {\n\t\t\t\t\t\t\tunset($thisfile_mpeg_audio_lame['RGAD']);\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t// byte $AF  Encoding flags + ATH Type\n\t\t\t\t\t\t$EncodingFlagsATHtype = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xAF, 1));\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['encoding_flags']['nspsytune']   = (bool) ($EncodingFlagsATHtype & 0x10);\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['encoding_flags']['nssafejoint'] = (bool) ($EncodingFlagsATHtype & 0x20);\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['encoding_flags']['nogap_next']  = (bool) ($EncodingFlagsATHtype & 0x40);\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['encoding_flags']['nogap_prev']  = (bool) ($EncodingFlagsATHtype & 0x80);\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['ath_type']                      =         $EncodingFlagsATHtype & 0x0F;\n\n\t\t\t\t\t\t// byte $B0  if ABR {specified bitrate} else {minimal bitrate}\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB0, 1));\n\t\t\t\t\t\tif ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 2) { // Average BitRate (ABR)\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame['bitrate_abr'] = $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate'];\n\t\t\t\t\t\t} elseif ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 1) { // Constant BitRate (CBR)\n\t\t\t\t\t\t\t// ignore\n\t\t\t\t\t\t} elseif ($thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate'] > 0) { // Variable BitRate (VBR) - minimum bitrate\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame['bitrate_min'] = $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// bytes $B1-$B3  Encoder delays\n\t\t\t\t\t\t$EncoderDelays = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB1, 3));\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['encoder_delay'] = ($EncoderDelays & 0xFFF000) >> 12;\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['end_padding']   =  $EncoderDelays & 0x000FFF;\n\n\t\t\t\t\t\t// byte $B4  Misc\n\t\t\t\t\t\t$MiscByte = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB4, 1));\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame_raw['noise_shaping']       = ($MiscByte & 0x03);\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame_raw['stereo_mode']         = ($MiscByte & 0x1C) >> 2;\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame_raw['not_optimal_quality'] = ($MiscByte & 0x20) >> 5;\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame_raw['source_sample_freq']  = ($MiscByte & 0xC0) >> 6;\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['noise_shaping']       = $thisfile_mpeg_audio_lame_raw['noise_shaping'];\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['stereo_mode']         = self::LAMEmiscStereoModeLookup($thisfile_mpeg_audio_lame_raw['stereo_mode']);\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['not_optimal_quality'] = (bool) $thisfile_mpeg_audio_lame_raw['not_optimal_quality'];\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['source_sample_freq']  = self::LAMEmiscSourceSampleFrequencyLookup($thisfile_mpeg_audio_lame_raw['source_sample_freq']);\n\n\t\t\t\t\t\t// byte $B5  MP3 Gain\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame_raw['mp3_gain'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB5, 1), false, true);\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['mp3_gain_db']     = (getid3_lib::RGADamplitude2dB(2) / 4) * $thisfile_mpeg_audio_lame_raw['mp3_gain'];\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['mp3_gain_factor'] = pow(2, ($thisfile_mpeg_audio_lame['mp3_gain_db'] / 6));\n\n\t\t\t\t\t\t// bytes $B6-$B7  Preset and surround info\n\t\t\t\t\t\t$PresetSurroundBytes = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB6, 2));\n\t\t\t\t\t\t// Reserved                                                    = ($PresetSurroundBytes & 0xC000);\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame_raw['surround_info'] = ($PresetSurroundBytes & 0x3800);\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['surround_info']     = self::LAMEsurroundInfoLookup($thisfile_mpeg_audio_lame_raw['surround_info']);\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['preset_used_id']    = ($PresetSurroundBytes & 0x07FF);\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['preset_used']       = self::LAMEpresetUsedLookup($thisfile_mpeg_audio_lame);\n\t\t\t\t\t\tif (!empty($thisfile_mpeg_audio_lame['preset_used_id']) && empty($thisfile_mpeg_audio_lame['preset_used'])) {\n\t\t\t\t\t\t\t$this->warning('Unknown LAME preset used ('.$thisfile_mpeg_audio_lame['preset_used_id'].') - please report to info@getid3.org');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (($thisfile_mpeg_audio_lame['short_version'] == 'LAME3.90.') && !empty($thisfile_mpeg_audio_lame['preset_used_id'])) {\n\t\t\t\t\t\t\t// this may change if 3.90.4 ever comes out\n\t\t\t\t\t\t\t$thisfile_mpeg_audio_lame['short_version'] = 'LAME3.90.3';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// bytes $B8-$BB  MusicLength\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['audio_bytes'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB8, 4));\n\t\t\t\t\t\t$ExpectedNumberOfAudioBytes = (($thisfile_mpeg_audio_lame['audio_bytes'] > 0) ? $thisfile_mpeg_audio_lame['audio_bytes'] : $thisfile_mpeg_audio['VBR_bytes']);\n\n\t\t\t\t\t\t// bytes $BC-$BD  MusicCRC\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['music_crc']    = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xBC, 2));\n\n\t\t\t\t\t\t// bytes $BE-$BF  CRC-16 of Info Tag\n\t\t\t\t\t\t$thisfile_mpeg_audio_lame['lame_tag_crc'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xBE, 2));\n\n\n\t\t\t\t\t\t// LAME CBR\n\t\t\t\t\t\tif ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 1) {\n\n\t\t\t\t\t\t\t$thisfile_mpeg_audio['bitrate_mode'] = 'cbr';\n\t\t\t\t\t\t\t$thisfile_mpeg_audio['bitrate'] = self::ClosestStandardMP3Bitrate($thisfile_mpeg_audio['bitrate']);\n\t\t\t\t\t\t\t$info['audio']['bitrate'] = $thisfile_mpeg_audio['bitrate'];\n\t\t\t\t\t\t\t//if (empty($thisfile_mpeg_audio['bitrate']) || (!empty($thisfile_mpeg_audio_lame['bitrate_min']) && ($thisfile_mpeg_audio_lame['bitrate_min'] != 255))) {\n\t\t\t\t\t\t\t//\t$thisfile_mpeg_audio['bitrate'] = $thisfile_mpeg_audio_lame['bitrate_min'];\n\t\t\t\t\t\t\t//}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// not Fraunhofer or Xing VBR methods, most likely CBR (but could be VBR with no header)\n\t\t\t\t$thisfile_mpeg_audio['bitrate_mode'] = 'cbr';\n\t\t\t\tif ($recursivesearch) {\n\t\t\t\t\t$thisfile_mpeg_audio['bitrate_mode'] = 'vbr';\n\t\t\t\t\tif ($this->RecursiveFrameScanning($offset, $nextframetestoffset, true)) {\n\t\t\t\t\t\t$recursivesearch = false;\n\t\t\t\t\t\t$thisfile_mpeg_audio['bitrate_mode'] = 'cbr';\n\t\t\t\t\t}\n\t\t\t\t\tif ($thisfile_mpeg_audio['bitrate_mode'] == 'vbr') {\n\t\t\t\t\t\t$this->warning('VBR file with no VBR header. Bitrate values calculated from actual frame bitrates.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif (($ExpectedNumberOfAudioBytes > 0) && ($ExpectedNumberOfAudioBytes != ($info['avdataend'] - $info['avdataoffset']))) {\n\t\t\tif ($ExpectedNumberOfAudioBytes > ($info['avdataend'] - $info['avdataoffset'])) {\n\t\t\t\tif ($this->isDependencyFor('matroska') || $this->isDependencyFor('riff')) {\n\t\t\t\t\t// ignore, audio data is broken into chunks so will always be data \"missing\"\n\t\t\t\t}\n\t\t\t\telseif (($ExpectedNumberOfAudioBytes - ($info['avdataend'] - $info['avdataoffset'])) == 1) {\n\t\t\t\t\t$this->warning('Last byte of data truncated (this is a known bug in Meracl ID3 Tag Writer before v1.3.5)');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->warning('Probable truncated file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, only found '.($info['avdataend'] - $info['avdataoffset']).' (short by '.($ExpectedNumberOfAudioBytes - ($info['avdataend'] - $info['avdataoffset'])).' bytes)');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ((($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes) == 1) {\n\t\t\t\t//\t$prenullbytefileoffset = $this->ftell();\n\t\t\t\t//\t$this->fseek($info['avdataend']);\n\t\t\t\t//\t$PossibleNullByte = $this->fread(1);\n\t\t\t\t//\t$this->fseek($prenullbytefileoffset);\n\t\t\t\t//\tif ($PossibleNullByte === \"\\x00\") {\n\t\t\t\t\t\t$info['avdataend']--;\n\t\t\t\t//\t\t$this->warning('Extra null byte at end of MP3 data assumed to be RIFF padding and therefore ignored');\n\t\t\t\t//\t} else {\n\t\t\t\t//\t\t$this->warning('Too much data in file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes).' bytes too many)');\n\t\t\t\t//\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->warning('Too much data in file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes).' bytes too many)');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (($thisfile_mpeg_audio['bitrate'] == 'free') && empty($info['audio']['bitrate'])) {\n\t\t\tif (($offset == $info['avdataoffset']) && empty($thisfile_mpeg_audio['VBR_frames'])) {\n\t\t\t\t$framebytelength = $this->FreeFormatFrameLength($offset, true);\n\t\t\t\tif ($framebytelength > 0) {\n\t\t\t\t\t$thisfile_mpeg_audio['framelength'] = $framebytelength;\n\t\t\t\t\tif ($thisfile_mpeg_audio['layer'] == '1') {\n\t\t\t\t\t\t// BitRate = (((FrameLengthInBytes / 4) - Padding) * SampleRate) / 12\n\t\t\t\t\t\t$info['audio']['bitrate'] = ((($framebytelength / 4) - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 12;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Bitrate = ((FrameLengthInBytes - Padding) * SampleRate) / 144\n\t\t\t\t\t\t$info['audio']['bitrate'] = (($framebytelength - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 144;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->error('Error calculating frame length of free-format MP3 without Xing/LAME header');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (isset($thisfile_mpeg_audio['VBR_frames']) ? $thisfile_mpeg_audio['VBR_frames'] : '') {\n\t\t\tswitch ($thisfile_mpeg_audio['bitrate_mode']) {\n\t\t\t\tcase 'vbr':\n\t\t\t\tcase 'abr':\n\t\t\t\t\t$bytes_per_frame = 1152;\n\t\t\t\t\tif (($thisfile_mpeg_audio['version'] == '1') && ($thisfile_mpeg_audio['layer'] == 1)) {\n\t\t\t\t\t\t$bytes_per_frame = 384;\n\t\t\t\t\t} elseif ((($thisfile_mpeg_audio['version'] == '2') || ($thisfile_mpeg_audio['version'] == '2.5')) && ($thisfile_mpeg_audio['layer'] == 3)) {\n\t\t\t\t\t\t$bytes_per_frame = 576;\n\t\t\t\t\t}\n\t\t\t\t\t$thisfile_mpeg_audio['VBR_bitrate'] = (isset($thisfile_mpeg_audio['VBR_bytes']) ? (($thisfile_mpeg_audio['VBR_bytes'] / $thisfile_mpeg_audio['VBR_frames']) * 8) * ($info['audio']['sample_rate'] / $bytes_per_frame) : 0);\n\t\t\t\t\tif ($thisfile_mpeg_audio['VBR_bitrate'] > 0) {\n\t\t\t\t\t\t$info['audio']['bitrate']       = $thisfile_mpeg_audio['VBR_bitrate'];\n\t\t\t\t\t\t$thisfile_mpeg_audio['bitrate'] = $thisfile_mpeg_audio['VBR_bitrate']; // to avoid confusion\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// End variable-bitrate headers\n\t\t////////////////////////////////////////////////////////////////////////////////////\n\n\t\tif ($recursivesearch) {\n\n\t\t\tif (!$this->RecursiveFrameScanning($offset, $nextframetestoffset, $ScanAsCBR)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\n\n\t\t//if (false) {\n\t\t//    // experimental side info parsing section - not returning anything useful yet\n\t\t//\n\t\t//    $SideInfoBitstream = getid3_lib::BigEndian2Bin($SideInfoData);\n\t\t//    $SideInfoOffset = 0;\n\t\t//\n\t\t//    if ($thisfile_mpeg_audio['version'] == '1') {\n\t\t//        if ($thisfile_mpeg_audio['channelmode'] == 'mono') {\n\t\t//            // MPEG-1 (mono)\n\t\t//            $thisfile_mpeg_audio['side_info']['main_data_begin'] = substr($SideInfoBitstream, $SideInfoOffset, 9);\n\t\t//            $SideInfoOffset += 9;\n\t\t//            $SideInfoOffset += 5;\n\t\t//        } else {\n\t\t//            // MPEG-1 (stereo, joint-stereo, dual-channel)\n\t\t//            $thisfile_mpeg_audio['side_info']['main_data_begin'] = substr($SideInfoBitstream, $SideInfoOffset, 9);\n\t\t//            $SideInfoOffset += 9;\n\t\t//            $SideInfoOffset += 3;\n\t\t//        }\n\t\t//    } else { // 2 or 2.5\n\t\t//        if ($thisfile_mpeg_audio['channelmode'] == 'mono') {\n\t\t//            // MPEG-2, MPEG-2.5 (mono)\n\t\t//            $thisfile_mpeg_audio['side_info']['main_data_begin'] = substr($SideInfoBitstream, $SideInfoOffset, 8);\n\t\t//            $SideInfoOffset += 8;\n\t\t//            $SideInfoOffset += 1;\n\t\t//        } else {\n\t\t//            // MPEG-2, MPEG-2.5 (stereo, joint-stereo, dual-channel)\n\t\t//            $thisfile_mpeg_audio['side_info']['main_data_begin'] = substr($SideInfoBitstream, $SideInfoOffset, 8);\n\t\t//            $SideInfoOffset += 8;\n\t\t//            $SideInfoOffset += 2;\n\t\t//        }\n\t\t//    }\n\t\t//\n\t\t//    if ($thisfile_mpeg_audio['version'] == '1') {\n\t\t//        for ($channel = 0; $channel < $info['audio']['channels']; $channel++) {\n\t\t//            for ($scfsi_band = 0; $scfsi_band < 4; $scfsi_band++) {\n\t\t//                $thisfile_mpeg_audio['scfsi'][$channel][$scfsi_band] = substr($SideInfoBitstream, $SideInfoOffset, 1);\n\t\t//                $SideInfoOffset += 2;\n\t\t//            }\n\t\t//        }\n\t\t//    }\n\t\t//    for ($granule = 0; $granule < (($thisfile_mpeg_audio['version'] == '1') ? 2 : 1); $granule++) {\n\t\t//        for ($channel = 0; $channel < $info['audio']['channels']; $channel++) {\n\t\t//            $thisfile_mpeg_audio['part2_3_length'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 12);\n\t\t//            $SideInfoOffset += 12;\n\t\t//            $thisfile_mpeg_audio['big_values'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 9);\n\t\t//            $SideInfoOffset += 9;\n\t\t//            $thisfile_mpeg_audio['global_gain'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 8);\n\t\t//            $SideInfoOffset += 8;\n\t\t//            if ($thisfile_mpeg_audio['version'] == '1') {\n\t\t//                $thisfile_mpeg_audio['scalefac_compress'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 4);\n\t\t//                $SideInfoOffset += 4;\n\t\t//            } else {\n\t\t//                $thisfile_mpeg_audio['scalefac_compress'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 9);\n\t\t//                $SideInfoOffset += 9;\n\t\t//            }\n\t\t//            $thisfile_mpeg_audio['window_switching_flag'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1);\n\t\t//            $SideInfoOffset += 1;\n\t\t//\n\t\t//            if ($thisfile_mpeg_audio['window_switching_flag'][$granule][$channel] == '1') {\n\t\t//\n\t\t//                $thisfile_mpeg_audio['block_type'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 2);\n\t\t//                $SideInfoOffset += 2;\n\t\t//                $thisfile_mpeg_audio['mixed_block_flag'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1);\n\t\t//                $SideInfoOffset += 1;\n\t\t//\n\t\t//                for ($region = 0; $region < 2; $region++) {\n\t\t//                    $thisfile_mpeg_audio['table_select'][$granule][$channel][$region] = substr($SideInfoBitstream, $SideInfoOffset, 5);\n\t\t//                    $SideInfoOffset += 5;\n\t\t//                }\n\t\t//                $thisfile_mpeg_audio['table_select'][$granule][$channel][2] = 0;\n\t\t//\n\t\t//                for ($window = 0; $window < 3; $window++) {\n\t\t//                    $thisfile_mpeg_audio['subblock_gain'][$granule][$channel][$window] = substr($SideInfoBitstream, $SideInfoOffset, 3);\n\t\t//                    $SideInfoOffset += 3;\n\t\t//                }\n\t\t//\n\t\t//            } else {\n\t\t//\n\t\t//                for ($region = 0; $region < 3; $region++) {\n\t\t//                    $thisfile_mpeg_audio['table_select'][$granule][$channel][$region] = substr($SideInfoBitstream, $SideInfoOffset, 5);\n\t\t//                    $SideInfoOffset += 5;\n\t\t//                }\n\t\t//\n\t\t//                $thisfile_mpeg_audio['region0_count'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 4);\n\t\t//                $SideInfoOffset += 4;\n\t\t//                $thisfile_mpeg_audio['region1_count'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 3);\n\t\t//                $SideInfoOffset += 3;\n\t\t//                $thisfile_mpeg_audio['block_type'][$granule][$channel] = 0;\n\t\t//            }\n\t\t//\n\t\t//            if ($thisfile_mpeg_audio['version'] == '1') {\n\t\t//                $thisfile_mpeg_audio['preflag'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1);\n\t\t//                $SideInfoOffset += 1;\n\t\t//            }\n\t\t//            $thisfile_mpeg_audio['scalefac_scale'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1);\n\t\t//            $SideInfoOffset += 1;\n\t\t//            $thisfile_mpeg_audio['count1table_select'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1);\n\t\t//            $SideInfoOffset += 1;\n\t\t//        }\n\t\t//    }\n\t\t//}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param int $offset\n\t * @param int $nextframetestoffset\n\t * @param bool $ScanAsCBR\n\t *\n\t * @return bool\n\t */\n\tpublic function RecursiveFrameScanning(&$offset, &$nextframetestoffset, $ScanAsCBR) {\n\t\t$info = &$this->getid3->info;\n\t\t$firstframetestarray = array('error' => array(), 'warning'=> array(), 'avdataend' => $info['avdataend'], 'avdataoffset' => $info['avdataoffset']);\n\t\t$this->decodeMPEGaudioHeader($offset, $firstframetestarray, false);\n\n\t\tfor ($i = 0; $i < GETID3_MP3_VALID_CHECK_FRAMES; $i++) {\n\t\t\t// check next GETID3_MP3_VALID_CHECK_FRAMES frames for validity, to make sure we haven't run across a false synch\n\t\t\tif (($nextframetestoffset + 4) >= $info['avdataend']) {\n\t\t\t\t// end of file\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t$nextframetestarray = array('error' => array(), 'warning' => array(), 'avdataend' => $info['avdataend'], 'avdataoffset'=>$info['avdataoffset']);\n\t\t\tif ($this->decodeMPEGaudioHeader($nextframetestoffset, $nextframetestarray, false)) {\n\t\t\t\tif ($ScanAsCBR) {\n\t\t\t\t\t// force CBR mode, used for trying to pick out invalid audio streams with valid(?) VBR headers, or VBR streams with no VBR header\n\t\t\t\t\tif (!isset($nextframetestarray['mpeg']['audio']['bitrate']) || !isset($firstframetestarray['mpeg']['audio']['bitrate']) || ($nextframetestarray['mpeg']['audio']['bitrate'] != $firstframetestarray['mpeg']['audio']['bitrate'])) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\t// next frame is OK, get ready to check the one after that\n\t\t\t\tif (isset($nextframetestarray['mpeg']['audio']['framelength']) && ($nextframetestarray['mpeg']['audio']['framelength'] > 0)) {\n\t\t\t\t\t$nextframetestoffset += $nextframetestarray['mpeg']['audio']['framelength'];\n\t\t\t\t} else {\n\t\t\t\t\t$this->error('Frame at offset ('.$offset.') is has an invalid frame length.');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t} elseif (!empty($firstframetestarray['mpeg']['audio']['framelength']) && (($nextframetestoffset + $firstframetestarray['mpeg']['audio']['framelength']) > $info['avdataend'])) {\n\n\t\t\t\t// it's not the end of the file, but there's not enough data left for another frame, so assume it's garbage/padding and return OK\n\t\t\t\treturn true;\n\n\t\t\t} else {\n\n\t\t\t\t// next frame is not valid, note the error and fail, so scanning can contiue for a valid frame sequence\n\t\t\t\t$this->warning('Frame at offset ('.$offset.') is valid, but the next one at ('.$nextframetestoffset.') is not.');\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param int  $offset\n\t * @param bool $deepscan\n\t *\n\t * @return int|false\n\t */\n\tpublic function FreeFormatFrameLength($offset, $deepscan=false) {\n\t\t$info = &$this->getid3->info;\n\n\t\t$this->fseek($offset);\n\t\t$MPEGaudioData = $this->fread(32768);\n\n\t\t$SyncPattern1 = substr($MPEGaudioData, 0, 4);\n\t\t// may be different pattern due to padding\n\t\t$SyncPattern2 = $SyncPattern1[0].$SyncPattern1[1].chr(ord($SyncPattern1[2]) | 0x02).$SyncPattern1[3];\n\t\tif ($SyncPattern2 === $SyncPattern1) {\n\t\t\t$SyncPattern2 = $SyncPattern1[0].$SyncPattern1[1].chr(ord($SyncPattern1[2]) & 0xFD).$SyncPattern1[3];\n\t\t}\n\n\t\t$framelength = false;\n\t\t$framelength1 = strpos($MPEGaudioData, $SyncPattern1, 4);\n\t\t$framelength2 = strpos($MPEGaudioData, $SyncPattern2, 4);\n\t\tif ($framelength1 > 4) {\n\t\t\t$framelength = $framelength1;\n\t\t}\n\t\tif (($framelength2 > 4) && ($framelength2 < $framelength1)) {\n\t\t\t$framelength = $framelength2;\n\t\t}\n\t\tif (!$framelength) {\n\n\t\t\t// LAME 3.88 has a different value for modeextension on the first frame vs the rest\n\t\t\t$framelength1 = strpos($MPEGaudioData, substr($SyncPattern1, 0, 3), 4);\n\t\t\t$framelength2 = strpos($MPEGaudioData, substr($SyncPattern2, 0, 3), 4);\n\n\t\t\tif ($framelength1 > 4) {\n\t\t\t\t$framelength = $framelength1;\n\t\t\t}\n\t\t\tif (($framelength2 > 4) && ($framelength2 < $framelength1)) {\n\t\t\t\t$framelength = $framelength2;\n\t\t\t}\n\t\t\tif (!$framelength) {\n\t\t\t\t$this->error('Cannot find next free-format synch pattern ('.getid3_lib::PrintHexBytes($SyncPattern1).' or '.getid3_lib::PrintHexBytes($SyncPattern2).') after offset '.$offset);\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t$this->warning('ModeExtension varies between first frame and other frames (known free-format issue in LAME 3.88)');\n\t\t\t\t$info['audio']['codec']   = 'LAME';\n\t\t\t\t$info['audio']['encoder'] = 'LAME3.88';\n\t\t\t\t$SyncPattern1 = substr($SyncPattern1, 0, 3);\n\t\t\t\t$SyncPattern2 = substr($SyncPattern2, 0, 3);\n\t\t\t}\n\t\t}\n\n\t\tif ($deepscan) {\n\n\t\t\t$ActualFrameLengthValues = array();\n\t\t\t$nextoffset = $offset + $framelength;\n\t\t\twhile ($nextoffset < ($info['avdataend'] - 6)) {\n\t\t\t\t$this->fseek($nextoffset - 1);\n\t\t\t\t$NextSyncPattern = $this->fread(6);\n\t\t\t\tif ((substr($NextSyncPattern, 1, strlen($SyncPattern1)) == $SyncPattern1) || (substr($NextSyncPattern, 1, strlen($SyncPattern2)) == $SyncPattern2)) {\n\t\t\t\t\t// good - found where expected\n\t\t\t\t\t$ActualFrameLengthValues[] = $framelength;\n\t\t\t\t} elseif ((substr($NextSyncPattern, 0, strlen($SyncPattern1)) == $SyncPattern1) || (substr($NextSyncPattern, 0, strlen($SyncPattern2)) == $SyncPattern2)) {\n\t\t\t\t\t// ok - found one byte earlier than expected (last frame wasn't padded, first frame was)\n\t\t\t\t\t$ActualFrameLengthValues[] = ($framelength - 1);\n\t\t\t\t\t$nextoffset--;\n\t\t\t\t} elseif ((substr($NextSyncPattern, 2, strlen($SyncPattern1)) == $SyncPattern1) || (substr($NextSyncPattern, 2, strlen($SyncPattern2)) == $SyncPattern2)) {\n\t\t\t\t\t// ok - found one byte later than expected (last frame was padded, first frame wasn't)\n\t\t\t\t\t$ActualFrameLengthValues[] = ($framelength + 1);\n\t\t\t\t\t$nextoffset++;\n\t\t\t\t} else {\n\t\t\t\t\t$this->error('Did not find expected free-format sync pattern at offset '.$nextoffset);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$nextoffset += $framelength;\n\t\t\t}\n\t\t\tif (count($ActualFrameLengthValues) > 0) {\n\t\t\t\t$framelength = intval(round(array_sum($ActualFrameLengthValues) / count($ActualFrameLengthValues)));\n\t\t\t}\n\t\t}\n\t\treturn $framelength;\n\t}\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function getOnlyMPEGaudioInfoBruteForce() {\n\t\t$MPEGaudioHeaderDecodeCache   = array();\n\t\t$MPEGaudioHeaderValidCache    = array();\n\t\t$MPEGaudioHeaderLengthCache   = array();\n\t\t$MPEGaudioVersionLookup       = self::MPEGaudioVersionArray();\n\t\t$MPEGaudioLayerLookup         = self::MPEGaudioLayerArray();\n\t\t$MPEGaudioBitrateLookup       = self::MPEGaudioBitrateArray();\n\t\t$MPEGaudioFrequencyLookup     = self::MPEGaudioFrequencyArray();\n\t\t$MPEGaudioChannelModeLookup   = self::MPEGaudioChannelModeArray();\n\t\t$MPEGaudioModeExtensionLookup = self::MPEGaudioModeExtensionArray();\n\t\t$MPEGaudioEmphasisLookup      = self::MPEGaudioEmphasisArray();\n\t\t$LongMPEGversionLookup        = array();\n\t\t$LongMPEGlayerLookup          = array();\n\t\t$LongMPEGbitrateLookup        = array();\n\t\t$LongMPEGpaddingLookup        = array();\n\t\t$LongMPEGfrequencyLookup      = array();\n\t\t$Distribution['bitrate']      = array();\n\t\t$Distribution['frequency']    = array();\n\t\t$Distribution['layer']        = array();\n\t\t$Distribution['version']      = array();\n\t\t$Distribution['padding']      = array();\n\n\t\t$info = &$this->getid3->info;\n\t\t$this->fseek($info['avdataoffset']);\n\n\t\t$max_frames_scan = 5000;\n\t\t$frames_scanned  = 0;\n\n\t\t$previousvalidframe = $info['avdataoffset'];\n\t\twhile ($this->ftell() < $info['avdataend']) {\n\t\t\tset_time_limit(30);\n\t\t\t$head4 = $this->fread(4);\n\t\t\tif (strlen($head4) < 4) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ($head4[0] != \"\\xFF\") {\n\t\t\t\tfor ($i = 1; $i < 4; $i++) {\n\t\t\t\t\tif ($head4[$i] == \"\\xFF\") {\n\t\t\t\t\t\t$this->fseek($i - 4, SEEK_CUR);\n\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!isset($MPEGaudioHeaderDecodeCache[$head4])) {\n\t\t\t\t$MPEGaudioHeaderDecodeCache[$head4] = self::MPEGaudioHeaderDecode($head4);\n\t\t\t}\n\t\t\tif (!isset($MPEGaudioHeaderValidCache[$head4])) {\n\t\t\t\t$MPEGaudioHeaderValidCache[$head4] = self::MPEGaudioHeaderValid($MPEGaudioHeaderDecodeCache[$head4], false, false);\n\t\t\t}\n\t\t\tif ($MPEGaudioHeaderValidCache[$head4]) {\n\n\t\t\t\tif (!isset($MPEGaudioHeaderLengthCache[$head4])) {\n\t\t\t\t\t$LongMPEGversionLookup[$head4]   = $MPEGaudioVersionLookup[$MPEGaudioHeaderDecodeCache[$head4]['version']];\n\t\t\t\t\t$LongMPEGlayerLookup[$head4]     = $MPEGaudioLayerLookup[$MPEGaudioHeaderDecodeCache[$head4]['layer']];\n\t\t\t\t\t$LongMPEGbitrateLookup[$head4]   = $MPEGaudioBitrateLookup[$LongMPEGversionLookup[$head4]][$LongMPEGlayerLookup[$head4]][$MPEGaudioHeaderDecodeCache[$head4]['bitrate']];\n\t\t\t\t\t$LongMPEGpaddingLookup[$head4]   = (bool) $MPEGaudioHeaderDecodeCache[$head4]['padding'];\n\t\t\t\t\t$LongMPEGfrequencyLookup[$head4] = $MPEGaudioFrequencyLookup[$LongMPEGversionLookup[$head4]][$MPEGaudioHeaderDecodeCache[$head4]['sample_rate']];\n\t\t\t\t\t$MPEGaudioHeaderLengthCache[$head4] = self::MPEGaudioFrameLength(\n\t\t\t\t\t\t$LongMPEGbitrateLookup[$head4],\n\t\t\t\t\t\t$LongMPEGversionLookup[$head4],\n\t\t\t\t\t\t$LongMPEGlayerLookup[$head4],\n\t\t\t\t\t\t$LongMPEGpaddingLookup[$head4],\n\t\t\t\t\t\t$LongMPEGfrequencyLookup[$head4]);\n\t\t\t\t}\n\t\t\t\tif ($MPEGaudioHeaderLengthCache[$head4] > 4) {\n\t\t\t\t\t$WhereWeWere = $this->ftell();\n\t\t\t\t\t$this->fseek($MPEGaudioHeaderLengthCache[$head4] - 4, SEEK_CUR);\n\t\t\t\t\t$next4 = $this->fread(4);\n\t\t\t\t\tif ($next4[0] == \"\\xFF\") {\n\t\t\t\t\t\tif (!isset($MPEGaudioHeaderDecodeCache[$next4])) {\n\t\t\t\t\t\t\t$MPEGaudioHeaderDecodeCache[$next4] = self::MPEGaudioHeaderDecode($next4);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!isset($MPEGaudioHeaderValidCache[$next4])) {\n\t\t\t\t\t\t\t$MPEGaudioHeaderValidCache[$next4] = self::MPEGaudioHeaderValid($MPEGaudioHeaderDecodeCache[$next4], false, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($MPEGaudioHeaderValidCache[$next4]) {\n\t\t\t\t\t\t\t$this->fseek(-4, SEEK_CUR);\n\n\t\t\t\t\t\t\t$Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]] = isset($Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]]) ? ++$Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]] : 1;\n\t\t\t\t\t\t\t$Distribution['layer'][$LongMPEGlayerLookup[$head4]] = isset($Distribution['layer'][$LongMPEGlayerLookup[$head4]]) ? ++$Distribution['layer'][$LongMPEGlayerLookup[$head4]] : 1;\n\t\t\t\t\t\t\t$Distribution['version'][$LongMPEGversionLookup[$head4]] = isset($Distribution['version'][$LongMPEGversionLookup[$head4]]) ? ++$Distribution['version'][$LongMPEGversionLookup[$head4]] : 1;\n\t\t\t\t\t\t\t$Distribution['padding'][intval($LongMPEGpaddingLookup[$head4])] = isset($Distribution['padding'][intval($LongMPEGpaddingLookup[$head4])]) ? ++$Distribution['padding'][intval($LongMPEGpaddingLookup[$head4])] : 1;\n\t\t\t\t\t\t\t$Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]] = isset($Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]]) ? ++$Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]] : 1;\n\t\t\t\t\t\t\tif (++$frames_scanned >= $max_frames_scan) {\n\t\t\t\t\t\t\t\t$pct_data_scanned = ($this->ftell() - $info['avdataoffset']) / ($info['avdataend'] - $info['avdataoffset']);\n\t\t\t\t\t\t\t\t$this->warning('too many MPEG audio frames to scan, only scanned first '.$max_frames_scan.' frames ('.number_format($pct_data_scanned * 100, 1).'% of file) and extrapolated distribution, playtime and bitrate may be incorrect.');\n\t\t\t\t\t\t\t\tforeach ($Distribution as $key1 => $value1) {\n\t\t\t\t\t\t\t\t\tforeach ($value1 as $key2 => $value2) {\n\t\t\t\t\t\t\t\t\t\t$Distribution[$key1][$key2] = round($value2 / $pct_data_scanned);\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\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tunset($next4);\n\t\t\t\t\t$this->fseek($WhereWeWere - 3);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tforeach ($Distribution as $key => $value) {\n\t\t\tksort($Distribution[$key], SORT_NUMERIC);\n\t\t}\n\t\tksort($Distribution['version'], SORT_STRING);\n\t\t$info['mpeg']['audio']['bitrate_distribution']   = $Distribution['bitrate'];\n\t\t$info['mpeg']['audio']['frequency_distribution'] = $Distribution['frequency'];\n\t\t$info['mpeg']['audio']['layer_distribution']     = $Distribution['layer'];\n\t\t$info['mpeg']['audio']['version_distribution']   = $Distribution['version'];\n\t\t$info['mpeg']['audio']['padding_distribution']   = $Distribution['padding'];\n\t\tif (count($Distribution['version']) > 1) {\n\t\t\t$this->error('Corrupt file - more than one MPEG version detected');\n\t\t}\n\t\tif (count($Distribution['layer']) > 1) {\n\t\t\t$this->error('Corrupt file - more than one MPEG layer detected');\n\t\t}\n\t\tif (count($Distribution['frequency']) > 1) {\n\t\t\t$this->error('Corrupt file - more than one MPEG sample rate detected');\n\t\t}\n\n\n\t\t$bittotal = 0;\n\t\tforeach ($Distribution['bitrate'] as $bitratevalue => $bitratecount) {\n\t\t\tif ($bitratevalue != 'free') {\n\t\t\t\t$bittotal += ($bitratevalue * $bitratecount);\n\t\t\t}\n\t\t}\n\t\t$info['mpeg']['audio']['frame_count']  = array_sum($Distribution['bitrate']);\n\t\tif ($info['mpeg']['audio']['frame_count'] == 0) {\n\t\t\t$this->error('no MPEG audio frames found');\n\t\t\treturn false;\n\t\t}\n\t\t$info['mpeg']['audio']['bitrate']      = ($bittotal / $info['mpeg']['audio']['frame_count']);\n\t\t$info['mpeg']['audio']['bitrate_mode'] = ((count($Distribution['bitrate']) > 0) ? 'vbr' : 'cbr');\n\t\t$info['mpeg']['audio']['sample_rate']  = getid3_lib::array_max($Distribution['frequency'], true);\n\n\t\t$info['audio']['bitrate']      = $info['mpeg']['audio']['bitrate'];\n\t\t$info['audio']['bitrate_mode'] = $info['mpeg']['audio']['bitrate_mode'];\n\t\t$info['audio']['sample_rate']  = $info['mpeg']['audio']['sample_rate'];\n\t\t$info['audio']['dataformat']   = 'mp'.getid3_lib::array_max($Distribution['layer'], true);\n\t\t$info['fileformat']            = $info['audio']['dataformat'];\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param int  $avdataoffset\n\t * @param bool $BitrateHistogram\n\t *\n\t * @return bool\n\t */\n\tpublic function getOnlyMPEGaudioInfo($avdataoffset, $BitrateHistogram=false) {\n\t\t// looks for synch, decodes MPEG audio header\n\n\t\t$info = &$this->getid3->info;\n\n\t\tstatic $MPEGaudioVersionLookup;\n\t\tstatic $MPEGaudioLayerLookup;\n\t\tstatic $MPEGaudioBitrateLookup;\n\t\tif (empty($MPEGaudioVersionLookup)) {\n\t\t\t$MPEGaudioVersionLookup = self::MPEGaudioVersionArray();\n\t\t\t$MPEGaudioLayerLookup   = self::MPEGaudioLayerArray();\n\t\t\t$MPEGaudioBitrateLookup = self::MPEGaudioBitrateArray();\n\t\t}\n\n\t\t$this->fseek($avdataoffset);\n\t\t$sync_seek_buffer_size = min(128 * 1024, $info['avdataend'] - $avdataoffset);\n\t\tif ($sync_seek_buffer_size <= 0) {\n\t\t\t$this->error('Invalid $sync_seek_buffer_size at offset '.$avdataoffset);\n\t\t\treturn false;\n\t\t}\n\t\t$header = $this->fread($sync_seek_buffer_size);\n\t\t$sync_seek_buffer_size = strlen($header);\n\t\t$SynchSeekOffset = 0;\n\t\twhile ($SynchSeekOffset < $sync_seek_buffer_size) {\n\t\t\tif ((($avdataoffset + $SynchSeekOffset)  < $info['avdataend']) && !feof($this->getid3->fp)) {\n\n\t\t\t\tif ($SynchSeekOffset > $sync_seek_buffer_size) {\n\t\t\t\t\t// if a synch's not found within the first 128k bytes, then give up\n\t\t\t\t\t$this->error('Could not find valid MPEG audio synch within the first '.round($sync_seek_buffer_size / 1024).'kB');\n\t\t\t\t\tif (isset($info['audio']['bitrate'])) {\n\t\t\t\t\t\tunset($info['audio']['bitrate']);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($info['mpeg']['audio'])) {\n\t\t\t\t\t\tunset($info['mpeg']['audio']);\n\t\t\t\t\t}\n\t\t\t\t\tif (empty($info['mpeg'])) {\n\t\t\t\t\t\tunset($info['mpeg']);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\n\t\t\t\t} elseif (feof($this->getid3->fp)) {\n\n\t\t\t\t\t$this->error('Could not find valid MPEG audio synch before end of file');\n\t\t\t\t\tif (isset($info['audio']['bitrate'])) {\n\t\t\t\t\t\tunset($info['audio']['bitrate']);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($info['mpeg']['audio'])) {\n\t\t\t\t\t\tunset($info['mpeg']['audio']);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($info['mpeg']) && (!is_array($info['mpeg']) || (count($info['mpeg']) == 0))) {\n\t\t\t\t\t\tunset($info['mpeg']);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (($SynchSeekOffset + 1) >= strlen($header)) {\n\t\t\t\t$this->error('Could not find valid MPEG synch before end of file');\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (($header[$SynchSeekOffset] == \"\\xFF\") && ($header[($SynchSeekOffset + 1)] > \"\\xE0\")) { // synch detected\n\t\t\t\t$FirstFrameAVDataOffset = null;\n\t\t\t\tif (!isset($FirstFrameThisfileInfo) && !isset($info['mpeg']['audio'])) {\n\t\t\t\t\t$FirstFrameThisfileInfo = $info;\n\t\t\t\t\t$FirstFrameAVDataOffset = $avdataoffset + $SynchSeekOffset;\n\t\t\t\t\tif (!$this->decodeMPEGaudioHeader($FirstFrameAVDataOffset, $FirstFrameThisfileInfo, false)) {\n\t\t\t\t\t\t// if this is the first valid MPEG-audio frame, save it in case it's a VBR header frame and there's\n\t\t\t\t\t\t// garbage between this frame and a valid sequence of MPEG-audio frames, to be restored below\n\t\t\t\t\t\tunset($FirstFrameThisfileInfo);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$dummy = $info; // only overwrite real data if valid header found\n\t\t\t\tif ($this->decodeMPEGaudioHeader($avdataoffset + $SynchSeekOffset, $dummy, true)) {\n\t\t\t\t\t$info = $dummy;\n\t\t\t\t\t$info['avdataoffset'] = $avdataoffset + $SynchSeekOffset;\n\t\t\t\t\tswitch (isset($info['fileformat']) ? $info['fileformat'] : '') {\n\t\t\t\t\t\tcase '':\n\t\t\t\t\t\tcase 'id3':\n\t\t\t\t\t\tcase 'ape':\n\t\t\t\t\t\tcase 'mp3':\n\t\t\t\t\t\t\t$info['fileformat']          = 'mp3';\n\t\t\t\t\t\t\t$info['audio']['dataformat'] = 'mp3';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($FirstFrameThisfileInfo) && isset($FirstFrameThisfileInfo['mpeg']['audio']['bitrate_mode']) && ($FirstFrameThisfileInfo['mpeg']['audio']['bitrate_mode'] == 'vbr')) {\n\t\t\t\t\t\tif (!(abs($info['audio']['bitrate'] - $FirstFrameThisfileInfo['audio']['bitrate']) <= 1)) {\n\t\t\t\t\t\t\t// If there is garbage data between a valid VBR header frame and a sequence\n\t\t\t\t\t\t\t// of valid MPEG-audio frames the VBR data is no longer discarded.\n\t\t\t\t\t\t\t$info = $FirstFrameThisfileInfo;\n\t\t\t\t\t\t\t$info['avdataoffset']        = $FirstFrameAVDataOffset;\n\t\t\t\t\t\t\t$info['fileformat']          = 'mp3';\n\t\t\t\t\t\t\t$info['audio']['dataformat'] = 'mp3';\n\t\t\t\t\t\t\t$dummy                       = $info;\n\t\t\t\t\t\t\tunset($dummy['mpeg']['audio']);\n\t\t\t\t\t\t\t$GarbageOffsetStart = $FirstFrameAVDataOffset + $FirstFrameThisfileInfo['mpeg']['audio']['framelength'];\n\t\t\t\t\t\t\t$GarbageOffsetEnd   = $avdataoffset + $SynchSeekOffset;\n\t\t\t\t\t\t\tif ($this->decodeMPEGaudioHeader($GarbageOffsetEnd, $dummy, true, true)) {\n\t\t\t\t\t\t\t\t$info = $dummy;\n\t\t\t\t\t\t\t\t$info['avdataoffset'] = $GarbageOffsetEnd;\n\t\t\t\t\t\t\t\t$this->warning('apparently-valid VBR header not used because could not find '.GETID3_MP3_VALID_CHECK_FRAMES.' consecutive MPEG-audio frames immediately after VBR header (garbage data for '.($GarbageOffsetEnd - $GarbageOffsetStart).' bytes between '.$GarbageOffsetStart.' and '.$GarbageOffsetEnd.'), but did find valid CBR stream starting at '.$GarbageOffsetEnd);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->warning('using data from VBR header even though could not find '.GETID3_MP3_VALID_CHECK_FRAMES.' consecutive MPEG-audio frames immediately after VBR header (garbage data for '.($GarbageOffsetEnd - $GarbageOffsetStart).' bytes between '.$GarbageOffsetStart.' and '.$GarbageOffsetEnd.')');\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\tif (isset($info['mpeg']['audio']['bitrate_mode']) && ($info['mpeg']['audio']['bitrate_mode'] == 'vbr') && !isset($info['mpeg']['audio']['VBR_method'])) {\n\t\t\t\t\t\t// VBR file with no VBR header\n\t\t\t\t\t\t$BitrateHistogram = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($BitrateHistogram) {\n\n\t\t\t\t\t\t$info['mpeg']['audio']['stereo_distribution']  = array('stereo'=>0, 'joint stereo'=>0, 'dual channel'=>0, 'mono'=>0);\n\t\t\t\t\t\t$info['mpeg']['audio']['version_distribution'] = array('1'=>0, '2'=>0, '2.5'=>0);\n\n\t\t\t\t\t\tif ($info['mpeg']['audio']['version'] == '1') {\n\t\t\t\t\t\t\tif ($info['mpeg']['audio']['layer'] == 3) {\n\t\t\t\t\t\t\t\t$info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 40000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 320000=>0);\n\t\t\t\t\t\t\t} elseif ($info['mpeg']['audio']['layer'] == 2) {\n\t\t\t\t\t\t\t\t$info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 320000=>0, 384000=>0);\n\t\t\t\t\t\t\t} elseif ($info['mpeg']['audio']['layer'] == 1) {\n\t\t\t\t\t\t\t\t$info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 64000=>0, 96000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 288000=>0, 320000=>0, 352000=>0, 384000=>0, 416000=>0, 448000=>0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif ($info['mpeg']['audio']['layer'] == 1) {\n\t\t\t\t\t\t\t$info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 144000=>0, 160000=>0, 176000=>0, 192000=>0, 224000=>0, 256000=>0);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 8000=>0, 16000=>0, 24000=>0, 32000=>0, 40000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 144000=>0, 160000=>0);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$dummy = array('error'=>$info['error'], 'warning'=>$info['warning'], 'avdataend'=>$info['avdataend'], 'avdataoffset'=>$info['avdataoffset']);\n\t\t\t\t\t\t$synchstartoffset = $info['avdataoffset'];\n\t\t\t\t\t\t$this->fseek($info['avdataoffset']);\n\n\t\t\t\t\t\t// you can play with these numbers:\n\t\t\t\t\t\t$max_frames_scan  = 50000;\n\t\t\t\t\t\t$max_scan_segments = 10;\n\n\t\t\t\t\t\t// don't play with these numbers:\n\t\t\t\t\t\t$FastMode = false;\n\t\t\t\t\t\t$SynchErrorsFound = 0;\n\t\t\t\t\t\t$frames_scanned   = 0;\n\t\t\t\t\t\t$this_scan_segment = 0;\n\t\t\t\t\t\t$frames_scan_per_segment = ceil($max_frames_scan / $max_scan_segments);\n\t\t\t\t\t\t$pct_data_scanned = 0;\n\t\t\t\t\t\tfor ($current_segment = 0; $current_segment < $max_scan_segments; $current_segment++) {\n\t\t\t\t\t\t\t$frames_scanned_this_segment = 0;\n\t\t\t\t\t\t\tif ($this->ftell() >= $info['avdataend']) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$scan_start_offset[$current_segment] = max($this->ftell(), $info['avdataoffset'] + round($current_segment * (($info['avdataend'] - $info['avdataoffset']) / $max_scan_segments)));\n\t\t\t\t\t\t\tif ($current_segment > 0) {\n\t\t\t\t\t\t\t\t$this->fseek($scan_start_offset[$current_segment]);\n\t\t\t\t\t\t\t\t$buffer_4k = $this->fread(4096);\n\t\t\t\t\t\t\t\tfor ($j = 0; $j < (strlen($buffer_4k) - 4); $j++) {\n\t\t\t\t\t\t\t\t\tif (($buffer_4k[$j] == \"\\xFF\") && ($buffer_4k[($j + 1)] > \"\\xE0\")) { // synch detected\n\t\t\t\t\t\t\t\t\t\tif ($this->decodeMPEGaudioHeader($scan_start_offset[$current_segment] + $j, $dummy, false, false, $FastMode)) {\n\t\t\t\t\t\t\t\t\t\t\t$calculated_next_offset = $scan_start_offset[$current_segment] + $j + $dummy['mpeg']['audio']['framelength'];\n\t\t\t\t\t\t\t\t\t\t\tif ($this->decodeMPEGaudioHeader($calculated_next_offset, $dummy, false, false, $FastMode)) {\n\t\t\t\t\t\t\t\t\t\t\t\t$scan_start_offset[$current_segment] += $j;\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\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}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$synchstartoffset = $scan_start_offset[$current_segment];\n\t\t\t\t\t\t\twhile (($synchstartoffset < $info['avdataend']) && $this->decodeMPEGaudioHeader($synchstartoffset, $dummy, false, false, $FastMode)) {\n\t\t\t\t\t\t\t\t$FastMode = true;\n\t\t\t\t\t\t\t\t$thisframebitrate = $MPEGaudioBitrateLookup[$MPEGaudioVersionLookup[$dummy['mpeg']['audio']['raw']['version']]][$MPEGaudioLayerLookup[$dummy['mpeg']['audio']['raw']['layer']]][$dummy['mpeg']['audio']['raw']['bitrate']];\n\n\t\t\t\t\t\t\t\tif (empty($dummy['mpeg']['audio']['framelength'])) {\n\t\t\t\t\t\t\t\t\t$SynchErrorsFound++;\n\t\t\t\t\t\t\t\t\t$synchstartoffset++;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tgetid3_lib::safe_inc($info['mpeg']['audio']['bitrate_distribution'][$thisframebitrate]);\n\t\t\t\t\t\t\t\t\tgetid3_lib::safe_inc($info['mpeg']['audio']['stereo_distribution'][$dummy['mpeg']['audio']['channelmode']]);\n\t\t\t\t\t\t\t\t\tgetid3_lib::safe_inc($info['mpeg']['audio']['version_distribution'][$dummy['mpeg']['audio']['version']]);\n\t\t\t\t\t\t\t\t\t$synchstartoffset += $dummy['mpeg']['audio']['framelength'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$frames_scanned++;\n\t\t\t\t\t\t\t\tif ($frames_scan_per_segment && (++$frames_scanned_this_segment >= $frames_scan_per_segment)) {\n\t\t\t\t\t\t\t\t\t$this_pct_scanned = ($this->ftell() - $scan_start_offset[$current_segment]) / ($info['avdataend'] - $info['avdataoffset']);\n\t\t\t\t\t\t\t\t\tif (($current_segment == 0) && (($this_pct_scanned * $max_scan_segments) >= 1)) {\n\t\t\t\t\t\t\t\t\t\t// file likely contains < $max_frames_scan, just scan as one segment\n\t\t\t\t\t\t\t\t\t\t$max_scan_segments = 1;\n\t\t\t\t\t\t\t\t\t\t$frames_scan_per_segment = $max_frames_scan;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$pct_data_scanned += $this_pct_scanned;\n\t\t\t\t\t\t\t\t\t\tbreak;\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($pct_data_scanned > 0) {\n\t\t\t\t\t\t\t$this->warning('too many MPEG audio frames to scan, only scanned '.$frames_scanned.' frames in '.$max_scan_segments.' segments ('.number_format($pct_data_scanned * 100, 1).'% of file) and extrapolated distribution, playtime and bitrate may be incorrect.');\n\t\t\t\t\t\t\tforeach ($info['mpeg']['audio'] as $key1 => $value1) {\n\t\t\t\t\t\t\t\tif (!preg_match('#_distribution$#i', $key1)) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tforeach ($value1 as $key2 => $value2) {\n\t\t\t\t\t\t\t\t\t$info['mpeg']['audio'][$key1][$key2] = round($value2 / $pct_data_scanned);\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\n\t\t\t\t\t\tif ($SynchErrorsFound > 0) {\n\t\t\t\t\t\t\t$this->warning('Found '.$SynchErrorsFound.' synch errors in histogram analysis');\n\t\t\t\t\t\t\t//return false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$bittotal     = 0;\n\t\t\t\t\t\t$framecounter = 0;\n\t\t\t\t\t\tforeach ($info['mpeg']['audio']['bitrate_distribution'] as $bitratevalue => $bitratecount) {\n\t\t\t\t\t\t\t$framecounter += $bitratecount;\n\t\t\t\t\t\t\tif ($bitratevalue != 'free') {\n\t\t\t\t\t\t\t\t$bittotal += ($bitratevalue * $bitratecount);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($framecounter == 0) {\n\t\t\t\t\t\t\t$this->error('Corrupt MP3 file: framecounter == zero');\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$info['mpeg']['audio']['frame_count'] = getid3_lib::CastAsInt($framecounter);\n\t\t\t\t\t\t$info['mpeg']['audio']['bitrate']     = ($bittotal / $framecounter);\n\n\t\t\t\t\t\t$info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate'];\n\n\n\t\t\t\t\t\t// Definitively set VBR vs CBR, even if the Xing/LAME/VBRI header says differently\n\t\t\t\t\t\t$distinct_bitrates = 0;\n\t\t\t\t\t\tforeach ($info['mpeg']['audio']['bitrate_distribution'] as $bitrate_value => $bitrate_count) {\n\t\t\t\t\t\t\tif ($bitrate_count > 0) {\n\t\t\t\t\t\t\t\t$distinct_bitrates++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($distinct_bitrates > 1) {\n\t\t\t\t\t\t\t$info['mpeg']['audio']['bitrate_mode'] = 'vbr';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$info['mpeg']['audio']['bitrate_mode'] = 'cbr';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$info['audio']['bitrate_mode'] = $info['mpeg']['audio']['bitrate_mode'];\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak; // exit while()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$SynchSeekOffset++;\n\t\t\tif (($avdataoffset + $SynchSeekOffset) >= $info['avdataend']) {\n\t\t\t\t// end of file/data\n\n\t\t\t\tif (empty($info['mpeg']['audio'])) {\n\n\t\t\t\t\t$this->error('could not find valid MPEG synch before end of file');\n\t\t\t\t\tif (isset($info['audio']['bitrate'])) {\n\t\t\t\t\t\tunset($info['audio']['bitrate']);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($info['mpeg']['audio'])) {\n\t\t\t\t\t\tunset($info['mpeg']['audio']);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($info['mpeg']) && (!is_array($info['mpeg']) || empty($info['mpeg']))) {\n\t\t\t\t\t\tunset($info['mpeg']);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t\t$info['audio']['channels']        = $info['mpeg']['audio']['channels'];\n\t\t$info['audio']['channelmode']     = $info['mpeg']['audio']['channelmode'];\n\t\t$info['audio']['sample_rate']     = $info['mpeg']['audio']['sample_rate'];\n\t\treturn true;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic static function MPEGaudioVersionArray() {\n\t\tstatic $MPEGaudioVersion = array('2.5', false, '2', '1');\n\t\treturn $MPEGaudioVersion;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic static function MPEGaudioLayerArray() {\n\t\tstatic $MPEGaudioLayer = array(false, 3, 2, 1);\n\t\treturn $MPEGaudioLayer;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic static function MPEGaudioBitrateArray() {\n\t\tstatic $MPEGaudioBitrate;\n\t\tif (empty($MPEGaudioBitrate)) {\n\t\t\t$MPEGaudioBitrate = array (\n\t\t\t\t'1'  =>  array (1 => array('free', 32000, 64000, 96000, 128000, 160000, 192000, 224000, 256000, 288000, 320000, 352000, 384000, 416000, 448000),\n\t\t\t\t\t\t\t\t2 => array('free', 32000, 48000, 56000,  64000,  80000,  96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000, 384000),\n\t\t\t\t\t\t\t\t3 => array('free', 32000, 40000, 48000,  56000,  64000,  80000,  96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000)\n\t\t\t\t\t\t\t   ),\n\n\t\t\t\t'2'  =>  array (1 => array('free', 32000, 48000, 56000,  64000,  80000,  96000, 112000, 128000, 144000, 160000, 176000, 192000, 224000, 256000),\n\t\t\t\t\t\t\t\t2 => array('free',  8000, 16000, 24000,  32000,  40000,  48000,  56000,  64000,  80000,  96000, 112000, 128000, 144000, 160000),\n\t\t\t\t\t\t\t   )\n\t\t\t);\n\t\t\t$MPEGaudioBitrate['2'][3] = $MPEGaudioBitrate['2'][2];\n\t\t\t$MPEGaudioBitrate['2.5']  = $MPEGaudioBitrate['2'];\n\t\t}\n\t\treturn $MPEGaudioBitrate;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic static function MPEGaudioFrequencyArray() {\n\t\tstatic $MPEGaudioFrequency;\n\t\tif (empty($MPEGaudioFrequency)) {\n\t\t\t$MPEGaudioFrequency = array (\n\t\t\t\t'1'   => array(44100, 48000, 32000),\n\t\t\t\t'2'   => array(22050, 24000, 16000),\n\t\t\t\t'2.5' => array(11025, 12000,  8000)\n\t\t\t);\n\t\t}\n\t\treturn $MPEGaudioFrequency;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic static function MPEGaudioChannelModeArray() {\n\t\tstatic $MPEGaudioChannelMode = array('stereo', 'joint stereo', 'dual channel', 'mono');\n\t\treturn $MPEGaudioChannelMode;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic static function MPEGaudioModeExtensionArray() {\n\t\tstatic $MPEGaudioModeExtension;\n\t\tif (empty($MPEGaudioModeExtension)) {\n\t\t\t$MPEGaudioModeExtension = array (\n\t\t\t\t1 => array('4-31', '8-31', '12-31', '16-31'),\n\t\t\t\t2 => array('4-31', '8-31', '12-31', '16-31'),\n\t\t\t\t3 => array('', 'IS', 'MS', 'IS+MS')\n\t\t\t);\n\t\t}\n\t\treturn $MPEGaudioModeExtension;\n\t}\n\n\t/**\n\t * @return array\n\t */\n\tpublic static function MPEGaudioEmphasisArray() {\n\t\tstatic $MPEGaudioEmphasis = array('none', '50/15ms', false, 'CCIT J.17');\n\t\treturn $MPEGaudioEmphasis;\n\t}\n\n\t/**\n\t * @param string $head4\n\t * @param bool   $allowBitrate15\n\t *\n\t * @return bool\n\t */\n\tpublic static function MPEGaudioHeaderBytesValid($head4, $allowBitrate15=false) {\n\t\treturn self::MPEGaudioHeaderValid(self::MPEGaudioHeaderDecode($head4), false, $allowBitrate15);\n\t}\n\n\t/**\n\t * @param array $rawarray\n\t * @param bool  $echoerrors\n\t * @param bool  $allowBitrate15\n\t *\n\t * @return bool\n\t */\n\tpublic static function MPEGaudioHeaderValid($rawarray, $echoerrors=false, $allowBitrate15=false) {\n\t\tif (!isset($rawarray['synch']) || ($rawarray['synch'] & 0x0FFE) != 0x0FFE) {\n\t\t\treturn false;\n\t\t}\n\n\t\tstatic $MPEGaudioVersionLookup;\n\t\tstatic $MPEGaudioLayerLookup;\n\t\tstatic $MPEGaudioBitrateLookup;\n\t\tstatic $MPEGaudioFrequencyLookup;\n\t\tstatic $MPEGaudioChannelModeLookup;\n\t\tstatic $MPEGaudioModeExtensionLookup;\n\t\tstatic $MPEGaudioEmphasisLookup;\n\t\tif (empty($MPEGaudioVersionLookup)) {\n\t\t\t$MPEGaudioVersionLookup       = self::MPEGaudioVersionArray();\n\t\t\t$MPEGaudioLayerLookup         = self::MPEGaudioLayerArray();\n\t\t\t$MPEGaudioBitrateLookup       = self::MPEGaudioBitrateArray();\n\t\t\t$MPEGaudioFrequencyLookup     = self::MPEGaudioFrequencyArray();\n\t\t\t$MPEGaudioChannelModeLookup   = self::MPEGaudioChannelModeArray();\n\t\t\t$MPEGaudioModeExtensionLookup = self::MPEGaudioModeExtensionArray();\n\t\t\t$MPEGaudioEmphasisLookup      = self::MPEGaudioEmphasisArray();\n\t\t}\n\n\t\tif (isset($MPEGaudioVersionLookup[$rawarray['version']])) {\n\t\t\t$decodedVersion = $MPEGaudioVersionLookup[$rawarray['version']];\n\t\t} else {\n\t\t\techo ($echoerrors ? \"\\n\".'invalid Version ('.$rawarray['version'].')' : '');\n\t\t\treturn false;\n\t\t}\n\t\tif (isset($MPEGaudioLayerLookup[$rawarray['layer']])) {\n\t\t\t$decodedLayer = $MPEGaudioLayerLookup[$rawarray['layer']];\n\t\t} else {\n\t\t\techo ($echoerrors ? \"\\n\".'invalid Layer ('.$rawarray['layer'].')' : '');\n\t\t\treturn false;\n\t\t}\n\t\tif (!isset($MPEGaudioBitrateLookup[$decodedVersion][$decodedLayer][$rawarray['bitrate']])) {\n\t\t\techo ($echoerrors ? \"\\n\".'invalid Bitrate ('.$rawarray['bitrate'].')' : '');\n\t\t\tif ($rawarray['bitrate'] == 15) {\n\t\t\t\t// known issue in LAME 3.90 - 3.93.1 where free-format has bitrate ID of 15 instead of 0\n\t\t\t\t// let it go through here otherwise file will not be identified\n\t\t\t\tif (!$allowBitrate15) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif (!isset($MPEGaudioFrequencyLookup[$decodedVersion][$rawarray['sample_rate']])) {\n\t\t\techo ($echoerrors ? \"\\n\".'invalid Frequency ('.$rawarray['sample_rate'].')' : '');\n\t\t\treturn false;\n\t\t}\n\t\tif (!isset($MPEGaudioChannelModeLookup[$rawarray['channelmode']])) {\n\t\t\techo ($echoerrors ? \"\\n\".'invalid ChannelMode ('.$rawarray['channelmode'].')' : '');\n\t\t\treturn false;\n\t\t}\n\t\tif (!isset($MPEGaudioModeExtensionLookup[$decodedLayer][$rawarray['modeextension']])) {\n\t\t\techo ($echoerrors ? \"\\n\".'invalid Mode Extension ('.$rawarray['modeextension'].')' : '');\n\t\t\treturn false;\n\t\t}\n\t\tif (!isset($MPEGaudioEmphasisLookup[$rawarray['emphasis']])) {\n\t\t\techo ($echoerrors ? \"\\n\".'invalid Emphasis ('.$rawarray['emphasis'].')' : '');\n\t\t\treturn false;\n\t\t}\n\t\t// These are just either set or not set, you can't mess that up :)\n\t\t// $rawarray['protection'];\n\t\t// $rawarray['padding'];\n\t\t// $rawarray['private'];\n\t\t// $rawarray['copyright'];\n\t\t// $rawarray['original'];\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $Header4Bytes\n\t *\n\t * @return array|false\n\t */\n\tpublic static function MPEGaudioHeaderDecode($Header4Bytes) {\n\t\t// AAAA AAAA  AAAB BCCD  EEEE FFGH  IIJJ KLMM\n\t\t// A - Frame sync (all bits set)\n\t\t// B - MPEG Audio version ID\n\t\t// C - Layer description\n\t\t// D - Protection bit\n\t\t// E - Bitrate index\n\t\t// F - Sampling rate frequency index\n\t\t// G - Padding bit\n\t\t// H - Private bit\n\t\t// I - Channel Mode\n\t\t// J - Mode extension (Only if Joint stereo)\n\t\t// K - Copyright\n\t\t// L - Original\n\t\t// M - Emphasis\n\n\t\tif (strlen($Header4Bytes) != 4) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$MPEGrawHeader['synch']         = (getid3_lib::BigEndian2Int(substr($Header4Bytes, 0, 2)) & 0xFFE0) >> 4;\n\t\t$MPEGrawHeader['version']       = (ord($Header4Bytes[1]) & 0x18) >> 3; //    BB\n\t\t$MPEGrawHeader['layer']         = (ord($Header4Bytes[1]) & 0x06) >> 1; //      CC\n\t\t$MPEGrawHeader['protection']    = (ord($Header4Bytes[1]) & 0x01);      //        D\n\t\t$MPEGrawHeader['bitrate']       = (ord($Header4Bytes[2]) & 0xF0) >> 4; // EEEE\n\t\t$MPEGrawHeader['sample_rate']   = (ord($Header4Bytes[2]) & 0x0C) >> 2; //     FF\n\t\t$MPEGrawHeader['padding']       = (ord($Header4Bytes[2]) & 0x02) >> 1; //       G\n\t\t$MPEGrawHeader['private']       = (ord($Header4Bytes[2]) & 0x01);      //        H\n\t\t$MPEGrawHeader['channelmode']   = (ord($Header4Bytes[3]) & 0xC0) >> 6; // II\n\t\t$MPEGrawHeader['modeextension'] = (ord($Header4Bytes[3]) & 0x30) >> 4; //   JJ\n\t\t$MPEGrawHeader['copyright']     = (ord($Header4Bytes[3]) & 0x08) >> 3; //     K\n\t\t$MPEGrawHeader['original']      = (ord($Header4Bytes[3]) & 0x04) >> 2; //      L\n\t\t$MPEGrawHeader['emphasis']      = (ord($Header4Bytes[3]) & 0x03);      //       MM\n\n\t\treturn $MPEGrawHeader;\n\t}\n\n\t/**\n\t * @param int|string $bitrate\n\t * @param string     $version\n\t * @param string     $layer\n\t * @param bool       $padding\n\t * @param int        $samplerate\n\t *\n\t * @return int|false\n\t */\n\tpublic static function MPEGaudioFrameLength(&$bitrate, &$version, &$layer, $padding, &$samplerate) {\n\t\tstatic $AudioFrameLengthCache = array();\n\n\t\tif (!isset($AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate])) {\n\t\t\t$AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate] = false;\n\t\t\tif ($bitrate != 'free') {\n\n\t\t\t\tif ($version == '1') {\n\n\t\t\t\t\tif ($layer == '1') {\n\n\t\t\t\t\t\t// For Layer I slot is 32 bits long\n\t\t\t\t\t\t$FrameLengthCoefficient = 48;\n\t\t\t\t\t\t$SlotLength = 4;\n\n\t\t\t\t\t} else { // Layer 2 / 3\n\n\t\t\t\t\t\t// for Layer 2 and Layer 3 slot is 8 bits long.\n\t\t\t\t\t\t$FrameLengthCoefficient = 144;\n\t\t\t\t\t\t$SlotLength = 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else { // MPEG-2 / MPEG-2.5\n\n\t\t\t\t\tif ($layer == '1') {\n\n\t\t\t\t\t\t// For Layer I slot is 32 bits long\n\t\t\t\t\t\t$FrameLengthCoefficient = 24;\n\t\t\t\t\t\t$SlotLength = 4;\n\n\t\t\t\t\t} elseif ($layer == '2') {\n\n\t\t\t\t\t\t// for Layer 2 and Layer 3 slot is 8 bits long.\n\t\t\t\t\t\t$FrameLengthCoefficient = 144;\n\t\t\t\t\t\t$SlotLength = 1;\n\n\t\t\t\t\t} else { // layer 3\n\n\t\t\t\t\t\t// for Layer 2 and Layer 3 slot is 8 bits long.\n\t\t\t\t\t\t$FrameLengthCoefficient = 72;\n\t\t\t\t\t\t$SlotLength = 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// FrameLengthInBytes = ((Coefficient * BitRate) / SampleRate) + Padding\n\t\t\t\tif ($samplerate > 0) {\n\t\t\t\t\t$NewFramelength  = ($FrameLengthCoefficient * $bitrate) / $samplerate;\n\t\t\t\t\t$NewFramelength  = floor($NewFramelength / $SlotLength) * $SlotLength; // round to next-lower multiple of SlotLength (1 byte for Layer 2/3, 4 bytes for Layer I)\n\t\t\t\t\tif ($padding) {\n\t\t\t\t\t\t$NewFramelength += $SlotLength;\n\t\t\t\t\t}\n\t\t\t\t\t$AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate] = (int) $NewFramelength;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate];\n\t}\n\n\t/**\n\t * @param float|int $bit_rate\n\t *\n\t * @return int|float|string\n\t */\n\tpublic static function ClosestStandardMP3Bitrate($bit_rate) {\n\t\tstatic $standard_bit_rates = array (320000, 256000, 224000, 192000, 160000, 128000, 112000, 96000, 80000, 64000, 56000, 48000, 40000, 32000, 24000, 16000, 8000);\n\t\tstatic $bit_rate_table = array (0=>'-');\n\t\t$round_bit_rate = intval(round($bit_rate, -3));\n\t\tif (!isset($bit_rate_table[$round_bit_rate])) {\n\t\t\tif ($round_bit_rate > max($standard_bit_rates)) {\n\t\t\t\t$bit_rate_table[$round_bit_rate] = round($bit_rate, 2 - strlen($bit_rate));\n\t\t\t} else {\n\t\t\t\t$bit_rate_table[$round_bit_rate] = max($standard_bit_rates);\n\t\t\t\tforeach ($standard_bit_rates as $standard_bit_rate) {\n\t\t\t\t\tif ($round_bit_rate >= $standard_bit_rate + (($bit_rate_table[$round_bit_rate] - $standard_bit_rate) / 2)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$bit_rate_table[$round_bit_rate] = $standard_bit_rate;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $bit_rate_table[$round_bit_rate];\n\t}\n\n\t/**\n\t * @param string $version\n\t * @param string $channelmode\n\t *\n\t * @return int\n\t */\n\tpublic static function XingVBRidOffset($version, $channelmode) {\n\t\tstatic $XingVBRidOffsetCache = array();\n\t\tif (empty($XingVBRidOffsetCache)) {\n\t\t\t$XingVBRidOffsetCache = array (\n\t\t\t\t'1'   => array ('mono'          => 0x15, // 4 + 17 = 21\n\t\t\t\t\t\t\t\t'stereo'        => 0x24, // 4 + 32 = 36\n\t\t\t\t\t\t\t\t'joint stereo'  => 0x24,\n\t\t\t\t\t\t\t\t'dual channel'  => 0x24\n\t\t\t\t\t\t\t   ),\n\n\t\t\t\t'2'   => array ('mono'          => 0x0D, // 4 +  9 = 13\n\t\t\t\t\t\t\t\t'stereo'        => 0x15, // 4 + 17 = 21\n\t\t\t\t\t\t\t\t'joint stereo'  => 0x15,\n\t\t\t\t\t\t\t\t'dual channel'  => 0x15\n\t\t\t\t\t\t\t   ),\n\n\t\t\t\t'2.5' => array ('mono'          => 0x15,\n\t\t\t\t\t\t\t\t'stereo'        => 0x15,\n\t\t\t\t\t\t\t\t'joint stereo'  => 0x15,\n\t\t\t\t\t\t\t\t'dual channel'  => 0x15\n\t\t\t\t\t\t\t   )\n\t\t\t);\n\t\t}\n\t\treturn $XingVBRidOffsetCache[$version][$channelmode];\n\t}\n\n\t/**\n\t * @param int $VBRmethodID\n\t *\n\t * @return string\n\t */\n\tpublic static function LAMEvbrMethodLookup($VBRmethodID) {\n\t\tstatic $LAMEvbrMethodLookup = array(\n\t\t\t0x00 => 'unknown',\n\t\t\t0x01 => 'cbr',\n\t\t\t0x02 => 'abr',\n\t\t\t0x03 => 'vbr-old / vbr-rh',\n\t\t\t0x04 => 'vbr-new / vbr-mtrh',\n\t\t\t0x05 => 'vbr-mt',\n\t\t\t0x06 => 'vbr (full vbr method 4)',\n\t\t\t0x08 => 'cbr (constant bitrate 2 pass)',\n\t\t\t0x09 => 'abr (2 pass)',\n\t\t\t0x0F => 'reserved'\n\t\t);\n\t\treturn (isset($LAMEvbrMethodLookup[$VBRmethodID]) ? $LAMEvbrMethodLookup[$VBRmethodID] : '');\n\t}\n\n\t/**\n\t * @param int $StereoModeID\n\t *\n\t * @return string\n\t */\n\tpublic static function LAMEmiscStereoModeLookup($StereoModeID) {\n\t\tstatic $LAMEmiscStereoModeLookup = array(\n\t\t\t0 => 'mono',\n\t\t\t1 => 'stereo',\n\t\t\t2 => 'dual mono',\n\t\t\t3 => 'joint stereo',\n\t\t\t4 => 'forced stereo',\n\t\t\t5 => 'auto',\n\t\t\t6 => 'intensity stereo',\n\t\t\t7 => 'other'\n\t\t);\n\t\treturn (isset($LAMEmiscStereoModeLookup[$StereoModeID]) ? $LAMEmiscStereoModeLookup[$StereoModeID] : '');\n\t}\n\n\t/**\n\t * @param int $SourceSampleFrequencyID\n\t *\n\t * @return string\n\t */\n\tpublic static function LAMEmiscSourceSampleFrequencyLookup($SourceSampleFrequencyID) {\n\t\tstatic $LAMEmiscSourceSampleFrequencyLookup = array(\n\t\t\t0 => '<= 32 kHz',\n\t\t\t1 => '44.1 kHz',\n\t\t\t2 => '48 kHz',\n\t\t\t3 => '> 48kHz'\n\t\t);\n\t\treturn (isset($LAMEmiscSourceSampleFrequencyLookup[$SourceSampleFrequencyID]) ? $LAMEmiscSourceSampleFrequencyLookup[$SourceSampleFrequencyID] : '');\n\t}\n\n\t/**\n\t * @param int $SurroundInfoID\n\t *\n\t * @return string\n\t */\n\tpublic static function LAMEsurroundInfoLookup($SurroundInfoID) {\n\t\tstatic $LAMEsurroundInfoLookup = array(\n\t\t\t0 => 'no surround info',\n\t\t\t1 => 'DPL encoding',\n\t\t\t2 => 'DPL2 encoding',\n\t\t\t3 => 'Ambisonic encoding'\n\t\t);\n\t\treturn (isset($LAMEsurroundInfoLookup[$SurroundInfoID]) ? $LAMEsurroundInfoLookup[$SurroundInfoID] : 'reserved');\n\t}\n\n\t/**\n\t * @param array $LAMEtag\n\t *\n\t * @return string\n\t */\n\tpublic static function LAMEpresetUsedLookup($LAMEtag) {\n\n\t\tif ($LAMEtag['preset_used_id'] == 0) {\n\t\t\t// no preset used (LAME >=3.93)\n\t\t\t// no preset recorded (LAME <3.93)\n\t\t\treturn '';\n\t\t}\n\t\t$LAMEpresetUsedLookup = array();\n\n\t\t/////  THIS PART CANNOT BE STATIC .\n\t\tfor ($i = 8; $i <= 320; $i++) {\n\t\t\tswitch ($LAMEtag['vbr_method']) {\n\t\t\t\tcase 'cbr':\n\t\t\t\t\t$LAMEpresetUsedLookup[$i] = '--alt-preset '.$LAMEtag['vbr_method'].' '.$i;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'abr':\n\t\t\t\tdefault: // other VBR modes shouldn't be here(?)\n\t\t\t\t\t$LAMEpresetUsedLookup[$i] = '--alt-preset '.$i;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// named old-style presets (studio, phone, voice, etc) are handled in GuessEncoderOptions()\n\n\t\t// named alt-presets\n\t\t$LAMEpresetUsedLookup[1000] = '--r3mix';\n\t\t$LAMEpresetUsedLookup[1001] = '--alt-preset standard';\n\t\t$LAMEpresetUsedLookup[1002] = '--alt-preset extreme';\n\t\t$LAMEpresetUsedLookup[1003] = '--alt-preset insane';\n\t\t$LAMEpresetUsedLookup[1004] = '--alt-preset fast standard';\n\t\t$LAMEpresetUsedLookup[1005] = '--alt-preset fast extreme';\n\t\t$LAMEpresetUsedLookup[1006] = '--alt-preset medium';\n\t\t$LAMEpresetUsedLookup[1007] = '--alt-preset fast medium';\n\n\t\t// LAME 3.94 additions/changes\n\t\t$LAMEpresetUsedLookup[1010] = '--preset portable';                                                           // 3.94a15 Oct 21 2003\n\t\t$LAMEpresetUsedLookup[1015] = '--preset radio';                                                              // 3.94a15 Oct 21 2003\n\n\t\t$LAMEpresetUsedLookup[320]  = '--preset insane';                                                             // 3.94a15 Nov 12 2003\n\t\t$LAMEpresetUsedLookup[410]  = '-V9';\n\t\t$LAMEpresetUsedLookup[420]  = '-V8';\n\t\t$LAMEpresetUsedLookup[440]  = '-V6';\n\t\t$LAMEpresetUsedLookup[430]  = '--preset radio';                                                              // 3.94a15 Nov 12 2003\n\t\t$LAMEpresetUsedLookup[450]  = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'portable';  // 3.94a15 Nov 12 2003\n\t\t$LAMEpresetUsedLookup[460]  = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'medium';    // 3.94a15 Nov 12 2003\n\t\t$LAMEpresetUsedLookup[470]  = '--r3mix';                                                                     // 3.94b1  Dec 18 2003\n\t\t$LAMEpresetUsedLookup[480]  = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'standard';  // 3.94a15 Nov 12 2003\n\t\t$LAMEpresetUsedLookup[490]  = '-V1';\n\t\t$LAMEpresetUsedLookup[500]  = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'extreme';   // 3.94a15 Nov 12 2003\n\n\t\treturn (isset($LAMEpresetUsedLookup[$LAMEtag['preset_used_id']]) ? $LAMEpresetUsedLookup[$LAMEtag['preset_used_id']] : 'new/unknown preset: '.$LAMEtag['preset_used_id'].' - report to info@getid3.org');\n\t}\n\n}\n", "num_lines": 2163}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/////////////////////////////////////////////////////////////////\n/// getID3() by James Heinrich <info@getid3.org>               //\n//  available at https://github.com/JamesHeinrich/getID3       //\n//            or https://www.getid3.org                        //\n//            or http://getid3.sourceforge.net                 //\n//  see readme.txt for more details                            //\n/////////////////////////////////////////////////////////////////\n//                                                             //\n// module.audio.ogg.php                                        //\n// module for analyzing Ogg Vorbis, OggFLAC and Speex files    //\n// dependencies: module.audio.flac.php                         //\n//                                                            ///\n/////////////////////////////////////////////////////////////////\n\nif (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers\n\texit;\n}\ngetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.flac.php', __FILE__, true);\n\nclass getid3_ogg extends getid3_handler\n{\n\t/**\n\t * @link http://xiph.org/vorbis/doc/Vorbis_I_spec.html\n\t *\n\t * @return bool\n\t */\n\tpublic function Analyze() {\n\t\t$info = &$this->getid3->info;\n\n\t\t$info['fileformat'] = 'ogg';\n\n\t\t// Warn about illegal tags - only vorbiscomments are allowed\n\t\tif (isset($info['id3v2'])) {\n\t\t\t$this->warning('Illegal ID3v2 tag present.');\n\t\t}\n\t\tif (isset($info['id3v1'])) {\n\t\t\t$this->warning('Illegal ID3v1 tag present.');\n\t\t}\n\t\tif (isset($info['ape'])) {\n\t\t\t$this->warning('Illegal APE tag present.');\n\t\t}\n\n\n\t\t// Page 1 - Stream Header\n\n\t\t$this->fseek($info['avdataoffset']);\n\n\t\t$oggpageinfo = $this->ParseOggPageHeader();\n\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo;\n\n\t\tif ($this->ftell() >= $this->getid3->fread_buffer_size()) {\n\t\t\t$this->error('Could not find start of Ogg page in the first '.$this->getid3->fread_buffer_size().' bytes (this might not be an Ogg-Vorbis file?)');\n\t\t\tunset($info['fileformat']);\n\t\t\tunset($info['ogg']);\n\t\t\treturn false;\n\t\t}\n\n\t\t$filedata = $this->fread($oggpageinfo['page_length']);\n\t\t$filedataoffset = 0;\n\n\t\tif (substr($filedata, 0, 4) == 'fLaC') {\n\n\t\t\t$info['audio']['dataformat']   = 'flac';\n\t\t\t$info['audio']['bitrate_mode'] = 'vbr';\n\t\t\t$info['audio']['lossless']     = true;\n\n\t\t} elseif (substr($filedata, 1, 6) == 'vorbis') {\n\n\t\t\t$this->ParseVorbisPageHeader($filedata, $filedataoffset, $oggpageinfo);\n\n\t\t} elseif (substr($filedata, 0, 8) == 'OpusHead') {\n\n\t\t\tif ($this->ParseOpusPageHeader($filedata, $filedataoffset, $oggpageinfo) === false) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t} elseif (substr($filedata, 0, 8) == 'Speex   ') {\n\n\t\t\t// http://www.speex.org/manual/node10.html\n\n\t\t\t$info['audio']['dataformat']   = 'speex';\n\t\t\t$info['mime_type']             = 'audio/speex';\n\t\t\t$info['audio']['bitrate_mode'] = 'abr';\n\t\t\t$info['audio']['lossless']     = false;\n\n\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_string']           =                              substr($filedata, $filedataoffset, 8); // hard-coded to 'Speex   '\n\t\t\t$filedataoffset += 8;\n\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version']          =                              substr($filedata, $filedataoffset, 20);\n\t\t\t$filedataoffset += 20;\n\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version_id']       = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t\t$filedataoffset += 4;\n\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['header_size']            = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t\t$filedataoffset += 4;\n\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['rate']                   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t\t$filedataoffset += 4;\n\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode']                   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t\t$filedataoffset += 4;\n\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode_bitstream_version'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t\t$filedataoffset += 4;\n\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['nb_channels']            = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t\t$filedataoffset += 4;\n\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['bitrate']                = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t\t$filedataoffset += 4;\n\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['framesize']              = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t\t$filedataoffset += 4;\n\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['vbr']                    = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t\t$filedataoffset += 4;\n\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['frames_per_packet']      = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t\t$filedataoffset += 4;\n\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['extra_headers']          = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t\t$filedataoffset += 4;\n\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['reserved1']              = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t\t$filedataoffset += 4;\n\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['reserved2']              = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t\t$filedataoffset += 4;\n\n\t\t\t$info['speex']['speex_version'] = trim($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version']);\n\t\t\t$info['speex']['sample_rate']   = $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['rate'];\n\t\t\t$info['speex']['channels']      = $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['nb_channels'];\n\t\t\t$info['speex']['vbr']           = (bool) $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['vbr'];\n\t\t\t$info['speex']['band_type']     = $this->SpeexBandModeLookup($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode']);\n\n\t\t\t$info['audio']['sample_rate']   = $info['speex']['sample_rate'];\n\t\t\t$info['audio']['channels']      = $info['speex']['channels'];\n\t\t\tif ($info['speex']['vbr']) {\n\t\t\t\t$info['audio']['bitrate_mode'] = 'vbr';\n\t\t\t}\n\n\t\t} elseif (substr($filedata, 0, 7) == \"\\x80\".'theora') {\n\n\t\t\t// http://www.theora.org/doc/Theora.pdf (section 6.2)\n\n\t\t\t$info['ogg']['pageheader']['theora']['theora_magic']             =                           substr($filedata, $filedataoffset,  7); // hard-coded to \"\\x80.'theora'\n\t\t\t$filedataoffset += 7;\n\t\t\t$info['ogg']['pageheader']['theora']['version_major']            = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset,  1));\n\t\t\t$filedataoffset += 1;\n\t\t\t$info['ogg']['pageheader']['theora']['version_minor']            = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset,  1));\n\t\t\t$filedataoffset += 1;\n\t\t\t$info['ogg']['pageheader']['theora']['version_revision']         = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset,  1));\n\t\t\t$filedataoffset += 1;\n\t\t\t$info['ogg']['pageheader']['theora']['frame_width_macroblocks']  = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset,  2));\n\t\t\t$filedataoffset += 2;\n\t\t\t$info['ogg']['pageheader']['theora']['frame_height_macroblocks'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset,  2));\n\t\t\t$filedataoffset += 2;\n\t\t\t$info['ogg']['pageheader']['theora']['resolution_x']             = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset,  3));\n\t\t\t$filedataoffset += 3;\n\t\t\t$info['ogg']['pageheader']['theora']['resolution_y']             = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset,  3));\n\t\t\t$filedataoffset += 3;\n\t\t\t$info['ogg']['pageheader']['theora']['picture_offset_x']         = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset,  1));\n\t\t\t$filedataoffset += 1;\n\t\t\t$info['ogg']['pageheader']['theora']['picture_offset_y']         = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset,  1));\n\t\t\t$filedataoffset += 1;\n\t\t\t$info['ogg']['pageheader']['theora']['frame_rate_numerator']     = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset,  4));\n\t\t\t$filedataoffset += 4;\n\t\t\t$info['ogg']['pageheader']['theora']['frame_rate_denominator']   = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset,  4));\n\t\t\t$filedataoffset += 4;\n\t\t\t$info['ogg']['pageheader']['theora']['pixel_aspect_numerator']   = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset,  3));\n\t\t\t$filedataoffset += 3;\n\t\t\t$info['ogg']['pageheader']['theora']['pixel_aspect_denominator'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset,  3));\n\t\t\t$filedataoffset += 3;\n\t\t\t$info['ogg']['pageheader']['theora']['color_space_id']           = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset,  1));\n\t\t\t$filedataoffset += 1;\n\t\t\t$info['ogg']['pageheader']['theora']['nominal_bitrate']          = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset,  3));\n\t\t\t$filedataoffset += 3;\n\t\t\t$info['ogg']['pageheader']['theora']['flags']                    = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset,  2));\n\t\t\t$filedataoffset += 2;\n\n\t\t\t$info['ogg']['pageheader']['theora']['quality']         = ($info['ogg']['pageheader']['theora']['flags'] & 0xFC00) >> 10;\n\t\t\t$info['ogg']['pageheader']['theora']['kfg_shift']       = ($info['ogg']['pageheader']['theora']['flags'] & 0x03E0) >>  5;\n\t\t\t$info['ogg']['pageheader']['theora']['pixel_format_id'] = ($info['ogg']['pageheader']['theora']['flags'] & 0x0018) >>  3;\n\t\t\t$info['ogg']['pageheader']['theora']['reserved']        = ($info['ogg']['pageheader']['theora']['flags'] & 0x0007) >>  0; // should be 0\n\t\t\t$info['ogg']['pageheader']['theora']['color_space']     = self::TheoraColorSpace($info['ogg']['pageheader']['theora']['color_space_id']);\n\t\t\t$info['ogg']['pageheader']['theora']['pixel_format']    = self::TheoraPixelFormat($info['ogg']['pageheader']['theora']['pixel_format_id']);\n\n\t\t\t$info['video']['dataformat']   = 'theora';\n\t\t\t$info['mime_type']             = 'video/ogg';\n\t\t\t//$info['audio']['bitrate_mode'] = 'abr';\n\t\t\t//$info['audio']['lossless']     = false;\n\t\t\t$info['video']['resolution_x'] = $info['ogg']['pageheader']['theora']['resolution_x'];\n\t\t\t$info['video']['resolution_y'] = $info['ogg']['pageheader']['theora']['resolution_y'];\n\t\t\tif ($info['ogg']['pageheader']['theora']['frame_rate_denominator'] > 0) {\n\t\t\t\t$info['video']['frame_rate'] = (float) $info['ogg']['pageheader']['theora']['frame_rate_numerator'] / $info['ogg']['pageheader']['theora']['frame_rate_denominator'];\n\t\t\t}\n\t\t\tif ($info['ogg']['pageheader']['theora']['pixel_aspect_denominator'] > 0) {\n\t\t\t\t$info['video']['pixel_aspect_ratio'] = (float) $info['ogg']['pageheader']['theora']['pixel_aspect_numerator'] / $info['ogg']['pageheader']['theora']['pixel_aspect_denominator'];\n\t\t\t}\n\t\t\t$this->warning('Ogg Theora (v3) not fully supported in this version of getID3 ['.$this->getid3->version().'] -- bitrate, playtime and all audio data are currently unavailable');\n\n\n\t\t} elseif (substr($filedata, 0, 8) == \"fishead\\x00\") {\n\n\t\t\t// Ogg Skeleton version 3.0 Format Specification\n\t\t\t// http://xiph.org/ogg/doc/skeleton.html\n\t\t\t$filedataoffset += 8;\n\t\t\t$info['ogg']['skeleton']['fishead']['raw']['version_major']                = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  2));\n\t\t\t$filedataoffset += 2;\n\t\t\t$info['ogg']['skeleton']['fishead']['raw']['version_minor']                = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  2));\n\t\t\t$filedataoffset += 2;\n\t\t\t$info['ogg']['skeleton']['fishead']['raw']['presentationtime_numerator']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));\n\t\t\t$filedataoffset += 8;\n\t\t\t$info['ogg']['skeleton']['fishead']['raw']['presentationtime_denominator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));\n\t\t\t$filedataoffset += 8;\n\t\t\t$info['ogg']['skeleton']['fishead']['raw']['basetime_numerator']           = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));\n\t\t\t$filedataoffset += 8;\n\t\t\t$info['ogg']['skeleton']['fishead']['raw']['basetime_denominator']         = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));\n\t\t\t$filedataoffset += 8;\n\t\t\t$info['ogg']['skeleton']['fishead']['raw']['utc']                          = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 20));\n\t\t\t$filedataoffset += 20;\n\n\t\t\t$info['ogg']['skeleton']['fishead']['version']          = $info['ogg']['skeleton']['fishead']['raw']['version_major'].'.'.$info['ogg']['skeleton']['fishead']['raw']['version_minor'];\n\t\t\t$info['ogg']['skeleton']['fishead']['presentationtime'] = $info['ogg']['skeleton']['fishead']['raw']['presentationtime_numerator'] / $info['ogg']['skeleton']['fishead']['raw']['presentationtime_denominator'];\n\t\t\t$info['ogg']['skeleton']['fishead']['basetime']         = $info['ogg']['skeleton']['fishead']['raw']['basetime_numerator']         / $info['ogg']['skeleton']['fishead']['raw']['basetime_denominator'];\n\t\t\t$info['ogg']['skeleton']['fishead']['utc']              = $info['ogg']['skeleton']['fishead']['raw']['utc'];\n\n\n\t\t\t$counter = 0;\n\t\t\tdo {\n\t\t\t\t$oggpageinfo = $this->ParseOggPageHeader();\n\t\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno'].'.'.$counter++] = $oggpageinfo;\n\t\t\t\t$filedata = $this->fread($oggpageinfo['page_length']);\n\t\t\t\t$this->fseek($oggpageinfo['page_end_offset']);\n\n\t\t\t\tif (substr($filedata, 0, 8) == \"fisbone\\x00\") {\n\n\t\t\t\t\t$filedataoffset = 8;\n\t\t\t\t\t$info['ogg']['skeleton']['fisbone']['raw']['message_header_offset']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));\n\t\t\t\t\t$filedataoffset += 4;\n\t\t\t\t\t$info['ogg']['skeleton']['fisbone']['raw']['serial_number']           = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));\n\t\t\t\t\t$filedataoffset += 4;\n\t\t\t\t\t$info['ogg']['skeleton']['fisbone']['raw']['number_header_packets']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));\n\t\t\t\t\t$filedataoffset += 4;\n\t\t\t\t\t$info['ogg']['skeleton']['fisbone']['raw']['granulerate_numerator']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));\n\t\t\t\t\t$filedataoffset += 8;\n\t\t\t\t\t$info['ogg']['skeleton']['fisbone']['raw']['granulerate_denominator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));\n\t\t\t\t\t$filedataoffset += 8;\n\t\t\t\t\t$info['ogg']['skeleton']['fisbone']['raw']['basegranule']             = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));\n\t\t\t\t\t$filedataoffset += 8;\n\t\t\t\t\t$info['ogg']['skeleton']['fisbone']['raw']['preroll']                 = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));\n\t\t\t\t\t$filedataoffset += 4;\n\t\t\t\t\t$info['ogg']['skeleton']['fisbone']['raw']['granuleshift']            = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  1));\n\t\t\t\t\t$filedataoffset += 1;\n\t\t\t\t\t$info['ogg']['skeleton']['fisbone']['raw']['padding']                 =                              substr($filedata, $filedataoffset,  3);\n\t\t\t\t\t$filedataoffset += 3;\n\n\t\t\t\t} elseif (substr($filedata, 1, 6) == 'theora') {\n\n\t\t\t\t\t$info['video']['dataformat'] = 'theora1';\n\t\t\t\t\t$this->error('Ogg Theora (v1) not correctly handled in this version of getID3 ['.$this->getid3->version().']');\n\t\t\t\t\t//break;\n\n\t\t\t\t} elseif (substr($filedata, 1, 6) == 'vorbis') {\n\n\t\t\t\t\t$this->ParseVorbisPageHeader($filedata, $filedataoffset, $oggpageinfo);\n\n\t\t\t\t} else {\n\t\t\t\t\t$this->error('unexpected');\n\t\t\t\t\t//break;\n\t\t\t\t}\n\t\t\t//} while ($oggpageinfo['page_seqno'] == 0);\n\t\t\t} while (($oggpageinfo['page_seqno'] == 0) && (substr($filedata, 0, 8) != \"fisbone\\x00\"));\n\n\t\t\t$this->fseek($oggpageinfo['page_start_offset']);\n\n\t\t\t$this->error('Ogg Skeleton not correctly handled in this version of getID3 ['.$this->getid3->version().']');\n\t\t\t//return false;\n\n\t\t} elseif (substr($filedata, 0, 5) == \"\\x7F\".'FLAC') {\n\t\t\t// https://xiph.org/flac/ogg_mapping.html\n\n\t\t\t$info['audio']['dataformat']   = 'flac';\n\t\t\t$info['audio']['bitrate_mode'] = 'vbr';\n\t\t\t$info['audio']['lossless']     = true;\n\n\t\t\t$info['ogg']['flac']['header']['version_major']  =                         ord(substr($filedata,  5, 1));\n\t\t\t$info['ogg']['flac']['header']['version_minor']  =                         ord(substr($filedata,  6, 1));\n\t\t\t$info['ogg']['flac']['header']['header_packets'] =   getid3_lib::BigEndian2Int(substr($filedata,  7, 2)) + 1; // \"A two-byte, big-endian binary number signifying the number of header (non-audio) packets, not including this one. This number may be zero (0x0000) to signify 'unknown' but be aware that some decoders may not be able to handle such streams.\"\n\t\t\t$info['ogg']['flac']['header']['magic']          =                             substr($filedata,  9, 4);\n\t\t\tif ($info['ogg']['flac']['header']['magic'] != 'fLaC') {\n\t\t\t\t$this->error('Ogg-FLAC expecting \"fLaC\", found \"'.$info['ogg']['flac']['header']['magic'].'\" ('.trim(getid3_lib::PrintHexBytes($info['ogg']['flac']['header']['magic'])).')');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$info['ogg']['flac']['header']['STREAMINFO_bytes'] = getid3_lib::BigEndian2Int(substr($filedata, 13, 4));\n\t\t\t$info['flac']['STREAMINFO'] = getid3_flac::parseSTREAMINFOdata(substr($filedata, 17, 34));\n\t\t\tif (!empty($info['flac']['STREAMINFO']['sample_rate'])) {\n\t\t\t\t$info['audio']['bitrate_mode']    = 'vbr';\n\t\t\t\t$info['audio']['sample_rate']     = $info['flac']['STREAMINFO']['sample_rate'];\n\t\t\t\t$info['audio']['channels']        = $info['flac']['STREAMINFO']['channels'];\n\t\t\t\t$info['audio']['bits_per_sample'] = $info['flac']['STREAMINFO']['bits_per_sample'];\n\t\t\t\t$info['playtime_seconds']         = $info['flac']['STREAMINFO']['samples_stream'] / $info['flac']['STREAMINFO']['sample_rate'];\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$this->error('Expecting one of \"vorbis\", \"Speex\", \"OpusHead\", \"vorbis\", \"fishhead\", \"theora\", \"fLaC\" identifier strings, found \"'.substr($filedata, 0, 8).'\"');\n\t\t\tunset($info['ogg']);\n\t\t\tunset($info['mime_type']);\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// Page 2 - Comment Header\n\t\t$oggpageinfo = $this->ParseOggPageHeader();\n\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo;\n\n\t\tswitch ($info['audio']['dataformat']) {\n\t\t\tcase 'vorbis':\n\t\t\t\t$filedata = $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']);\n\t\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['packet_type'] = getid3_lib::LittleEndian2Int(substr($filedata, 0, 1));\n\t\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] =                              substr($filedata, 1, 6); // hard-coded to 'vorbis'\n\n\t\t\t\t$this->ParseVorbisComments();\n\t\t\t\tbreak;\n\n\t\t\tcase 'flac':\n\t\t\t\t$flac = new getid3_flac($this->getid3);\n\t\t\t\tif (!$flac->parseMETAdata()) {\n\t\t\t\t\t$this->error('Failed to parse FLAC headers');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tunset($flac);\n\t\t\t\tbreak;\n\n\t\t\tcase 'speex':\n\t\t\t\t$this->fseek($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length'], SEEK_CUR);\n\t\t\t\t$this->ParseVorbisComments();\n\t\t\t\tbreak;\n\n\t\t\tcase 'opus':\n\t\t\t\t$filedata = $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']);\n\t\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] = substr($filedata, 0, 8); // hard-coded to 'OpusTags'\n\t\t\t\tif(substr($filedata, 0, 8)  != 'OpusTags') {\n\t\t\t\t\t$this->error('Expected \"OpusTags\" as header but got \"'.substr($filedata, 0, 8).'\"');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t$this->ParseVorbisComments();\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\t// Last Page - Number of Samples\n\t\tif (!getid3_lib::intValueSupported($info['avdataend'])) {\n\n\t\t\t$this->warning('Unable to parse Ogg end chunk file (PHP does not support file operations beyond '.round(PHP_INT_MAX / 1073741824).'GB)');\n\n\t\t} else {\n\n\t\t\t$this->fseek(max($info['avdataend'] - $this->getid3->fread_buffer_size(), 0));\n\t\t\t$LastChunkOfOgg = strrev($this->fread($this->getid3->fread_buffer_size()));\n\t\t\tif ($LastOggSpostion = strpos($LastChunkOfOgg, 'SggO')) {\n\t\t\t\t$this->fseek($info['avdataend'] - ($LastOggSpostion + strlen('SggO')));\n\t\t\t\t$info['avdataend'] = $this->ftell();\n\t\t\t\t$info['ogg']['pageheader']['eos'] = $this->ParseOggPageHeader();\n\t\t\t\t$info['ogg']['samples']   = $info['ogg']['pageheader']['eos']['pcm_abs_position'];\n\t\t\t\tif ($info['ogg']['samples'] == 0) {\n\t\t\t\t\t$this->error('Corrupt Ogg file: eos.number of samples == zero');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (!empty($info['audio']['sample_rate'])) {\n\t\t\t\t\t$info['ogg']['bitrate_average'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / ($info['ogg']['samples'] / $info['audio']['sample_rate']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (!empty($info['ogg']['bitrate_average'])) {\n\t\t\t$info['audio']['bitrate'] = $info['ogg']['bitrate_average'];\n\t\t} elseif (!empty($info['ogg']['bitrate_nominal'])) {\n\t\t\t$info['audio']['bitrate'] = $info['ogg']['bitrate_nominal'];\n\t\t} elseif (!empty($info['ogg']['bitrate_min']) && !empty($info['ogg']['bitrate_max'])) {\n\t\t\t$info['audio']['bitrate'] = ($info['ogg']['bitrate_min'] + $info['ogg']['bitrate_max']) / 2;\n\t\t}\n\t\tif (isset($info['audio']['bitrate']) && !isset($info['playtime_seconds'])) {\n\t\t\tif ($info['audio']['bitrate'] == 0) {\n\t\t\t\t$this->error('Corrupt Ogg file: bitrate_audio == zero');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) / $info['audio']['bitrate']);\n\t\t}\n\n\t\tif (isset($info['ogg']['vendor'])) {\n\t\t\t$info['audio']['encoder'] = preg_replace('/^Encoded with /', '', $info['ogg']['vendor']);\n\n\t\t\t// Vorbis only\n\t\t\tif ($info['audio']['dataformat'] == 'vorbis') {\n\n\t\t\t\t// Vorbis 1.0 starts with Xiph.Org\n\t\t\t\tif  (preg_match('/^Xiph.Org/', $info['audio']['encoder'])) {\n\n\t\t\t\t\tif ($info['audio']['bitrate_mode'] == 'abr') {\n\n\t\t\t\t\t\t// Set -b 128 on abr files\n\t\t\t\t\t\t$info['audio']['encoder_options'] = '-b '.round($info['ogg']['bitrate_nominal'] / 1000);\n\n\t\t\t\t\t} elseif (($info['audio']['bitrate_mode'] == 'vbr') && ($info['audio']['channels'] == 2) && ($info['audio']['sample_rate'] >= 44100) && ($info['audio']['sample_rate'] <= 48000)) {\n\t\t\t\t\t\t// Set -q N on vbr files\n\t\t\t\t\t\t$info['audio']['encoder_options'] = '-q '.$this->get_quality_from_nominal_bitrate($info['ogg']['bitrate_nominal']);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (empty($info['audio']['encoder_options']) && !empty($info['ogg']['bitrate_nominal'])) {\n\t\t\t\t\t$info['audio']['encoder_options'] = 'Nominal bitrate: '.intval(round($info['ogg']['bitrate_nominal'] / 1000)).'kbps';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $filedata\n\t * @param int    $filedataoffset\n\t * @param array  $oggpageinfo\n\t *\n\t * @return bool\n\t */\n\tpublic function ParseVorbisPageHeader(&$filedata, &$filedataoffset, &$oggpageinfo) {\n\t\t$info = &$this->getid3->info;\n\t\t$info['audio']['dataformat'] = 'vorbis';\n\t\t$info['audio']['lossless']   = false;\n\n\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['packet_type'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1));\n\t\t$filedataoffset += 1;\n\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] = substr($filedata, $filedataoffset, 6); // hard-coded to 'vorbis'\n\t\t$filedataoffset += 6;\n\t\t$info['ogg']['bitstreamversion'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t$filedataoffset += 4;\n\t\t$info['ogg']['numberofchannels'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1));\n\t\t$filedataoffset += 1;\n\t\t$info['audio']['channels']       = $info['ogg']['numberofchannels'];\n\t\t$info['ogg']['samplerate']       = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t$filedataoffset += 4;\n\t\tif ($info['ogg']['samplerate'] == 0) {\n\t\t\t$this->error('Corrupt Ogg file: sample rate == zero');\n\t\t\treturn false;\n\t\t}\n\t\t$info['audio']['sample_rate']    = $info['ogg']['samplerate'];\n\t\t$info['ogg']['samples']          = 0; // filled in later\n\t\t$info['ogg']['bitrate_average']  = 0; // filled in later\n\t\t$info['ogg']['bitrate_max']      = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t$filedataoffset += 4;\n\t\t$info['ogg']['bitrate_nominal']  = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t$filedataoffset += 4;\n\t\t$info['ogg']['bitrate_min']      = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t$filedataoffset += 4;\n\t\t$info['ogg']['blocksize_small']  = pow(2,  getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)) & 0x0F);\n\t\t$info['ogg']['blocksize_large']  = pow(2, (getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)) & 0xF0) >> 4);\n\t\t$info['ogg']['stop_bit']         = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); // must be 1, marks end of packet\n\n\t\t$info['audio']['bitrate_mode'] = 'vbr'; // overridden if actually abr\n\t\tif ($info['ogg']['bitrate_max'] == 0xFFFFFFFF) {\n\t\t\tunset($info['ogg']['bitrate_max']);\n\t\t\t$info['audio']['bitrate_mode'] = 'abr';\n\t\t}\n\t\tif ($info['ogg']['bitrate_nominal'] == 0xFFFFFFFF) {\n\t\t\tunset($info['ogg']['bitrate_nominal']);\n\t\t}\n\t\tif ($info['ogg']['bitrate_min'] == 0xFFFFFFFF) {\n\t\t\tunset($info['ogg']['bitrate_min']);\n\t\t\t$info['audio']['bitrate_mode'] = 'abr';\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @link http://tools.ietf.org/html/draft-ietf-codec-oggopus-03\n\t *\n\t * @param string $filedata\n\t * @param int    $filedataoffset\n\t * @param array  $oggpageinfo\n\t *\n\t * @return bool\n\t */\n\tpublic function ParseOpusPageHeader(&$filedata, &$filedataoffset, &$oggpageinfo) {\n\t\t$info = &$this->getid3->info;\n\t\t$info['audio']['dataformat']   = 'opus';\n\t\t$info['mime_type']             = 'audio/ogg; codecs=opus';\n\n\t\t/** @todo find a usable way to detect abr (vbr that is padded to be abr) */\n\t\t$info['audio']['bitrate_mode'] = 'vbr';\n\n\t\t$info['audio']['lossless']     = false;\n\n\t\t$info['ogg']['pageheader']['opus']['opus_magic'] = substr($filedata, $filedataoffset, 8); // hard-coded to 'OpusHead'\n\t\t$filedataoffset += 8;\n\t\t$info['ogg']['pageheader']['opus']['version']    = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  1));\n\t\t$filedataoffset += 1;\n\n\t\tif ($info['ogg']['pageheader']['opus']['version'] < 1 || $info['ogg']['pageheader']['opus']['version'] > 15) {\n\t\t\t$this->error('Unknown opus version number (only accepting 1-15)');\n\t\t\treturn false;\n\t\t}\n\n\t\t$info['ogg']['pageheader']['opus']['out_channel_count'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  1));\n\t\t$filedataoffset += 1;\n\n\t\tif ($info['ogg']['pageheader']['opus']['out_channel_count'] == 0) {\n\t\t\t$this->error('Invalid channel count in opus header (must not be zero)');\n\t\t\treturn false;\n\t\t}\n\n\t\t$info['ogg']['pageheader']['opus']['pre_skip'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  2));\n\t\t$filedataoffset += 2;\n\n\t\t$info['ogg']['pageheader']['opus']['input_sample_rate'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));\n\t\t$filedataoffset += 4;\n\n\t\t//$info['ogg']['pageheader']['opus']['output_gain'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  2));\n\t\t//$filedataoffset += 2;\n\n\t\t//$info['ogg']['pageheader']['opus']['channel_mapping_family'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  1));\n\t\t//$filedataoffset += 1;\n\n\t\t$info['opus']['opus_version']       = $info['ogg']['pageheader']['opus']['version'];\n\t\t$info['opus']['sample_rate_input']  = $info['ogg']['pageheader']['opus']['input_sample_rate'];\n\t\t$info['opus']['out_channel_count']  = $info['ogg']['pageheader']['opus']['out_channel_count'];\n\n\t\t$info['audio']['channels']          = $info['opus']['out_channel_count'];\n\t\t$info['audio']['sample_rate_input'] = $info['opus']['sample_rate_input'];\n\t\t$info['audio']['sample_rate']       = 48000; // \"All Opus audio is coded at 48 kHz, and should also be decoded at 48 kHz for playback (unless the target hardware does not support this sampling rate). However, this field may be used to resample the audio back to the original sampling rate, for example, when saving the output to a file.\" -- https://mf4.xiph.org/jenkins/view/opus/job/opusfile-unix/ws/doc/html/structOpusHead.html\n\t\treturn true;\n\t}\n\n\t/**\n\t * @return array|false\n\t */\n\tpublic function ParseOggPageHeader() {\n\t\t// http://xiph.org/ogg/vorbis/doc/framing.html\n\t\t$oggheader['page_start_offset'] = $this->ftell(); // where we started from in the file\n\n\t\t$filedata = $this->fread($this->getid3->fread_buffer_size());\n\t\t$filedataoffset = 0;\n\t\twhile ((substr($filedata, $filedataoffset++, 4) != 'OggS')) {\n\t\t\tif (($this->ftell() - $oggheader['page_start_offset']) >= $this->getid3->fread_buffer_size()) {\n\t\t\t\t// should be found before here\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ((($filedataoffset + 28) > strlen($filedata)) || (strlen($filedata) < 28)) {\n\t\t\t\tif ($this->feof() || (($filedata .= $this->fread($this->getid3->fread_buffer_size())) === '')) {\n\t\t\t\t\t// get some more data, unless eof, in which case fail\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$filedataoffset += strlen('OggS') - 1; // page, delimited by 'OggS'\n\n\t\t$oggheader['stream_structver']  = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1));\n\t\t$filedataoffset += 1;\n\t\t$oggheader['flags_raw']         = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1));\n\t\t$filedataoffset += 1;\n\t\t$oggheader['flags']['fresh']    = (bool) ($oggheader['flags_raw'] & 0x01); // fresh packet\n\t\t$oggheader['flags']['bos']      = (bool) ($oggheader['flags_raw'] & 0x02); // first page of logical bitstream (bos)\n\t\t$oggheader['flags']['eos']      = (bool) ($oggheader['flags_raw'] & 0x04); // last page of logical bitstream (eos)\n\n\t\t$oggheader['pcm_abs_position']  = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8));\n\t\t$filedataoffset += 8;\n\t\t$oggheader['stream_serialno']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t$filedataoffset += 4;\n\t\t$oggheader['page_seqno']        = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t$filedataoffset += 4;\n\t\t$oggheader['page_checksum']     = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));\n\t\t$filedataoffset += 4;\n\t\t$oggheader['page_segments']     = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1));\n\t\t$filedataoffset += 1;\n\t\t$oggheader['page_length'] = 0;\n\t\tfor ($i = 0; $i < $oggheader['page_segments']; $i++) {\n\t\t\t$oggheader['segment_table'][$i] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1));\n\t\t\t$filedataoffset += 1;\n\t\t\t$oggheader['page_length'] += $oggheader['segment_table'][$i];\n\t\t}\n\t\t$oggheader['header_end_offset'] = $oggheader['page_start_offset'] + $filedataoffset;\n\t\t$oggheader['page_end_offset']   = $oggheader['header_end_offset'] + $oggheader['page_length'];\n\t\t$this->fseek($oggheader['header_end_offset']);\n\n\t\treturn $oggheader;\n\t}\n\n\t/**\n\t * @link http://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-810005\n\t *\n\t * @return bool\n\t */\n\tpublic function ParseVorbisComments() {\n\t\t$info = &$this->getid3->info;\n\n\t\t$OriginalOffset = $this->ftell();\n\t\t$commentdata = null;\n\t\t$commentdataoffset = 0;\n\t\t$VorbisCommentPage = 1;\n\t\t$CommentStartOffset = 0;\n\n\t\tswitch ($info['audio']['dataformat']) {\n\t\t\tcase 'vorbis':\n\t\t\tcase 'speex':\n\t\t\tcase 'opus':\n\t\t\t\t$CommentStartOffset = $info['ogg']['pageheader'][$VorbisCommentPage]['page_start_offset'];  // Second Ogg page, after header block\n\t\t\t\t$this->fseek($CommentStartOffset);\n\t\t\t\t$commentdataoffset = 27 + $info['ogg']['pageheader'][$VorbisCommentPage]['page_segments'];\n\t\t\t\t$commentdata = $this->fread(self::OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1) + $commentdataoffset);\n\n\t\t\t\tif ($info['audio']['dataformat'] == 'vorbis') {\n\t\t\t\t\t$commentdataoffset += (strlen('vorbis') + 1);\n\t\t\t\t}\n\t\t\t\telse if ($info['audio']['dataformat'] == 'opus') {\n\t\t\t\t\t$commentdataoffset += strlen('OpusTags');\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'flac':\n\t\t\t\t$CommentStartOffset = $info['flac']['VORBIS_COMMENT']['raw']['offset'] + 4;\n\t\t\t\t$this->fseek($CommentStartOffset);\n\t\t\t\t$commentdata = $this->fread($info['flac']['VORBIS_COMMENT']['raw']['block_length']);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\n\t\t$VendorSize = getid3_lib::LittleEndian2Int(substr($commentdata, $commentdataoffset, 4));\n\t\t$commentdataoffset += 4;\n\n\t\t$info['ogg']['vendor'] = substr($commentdata, $commentdataoffset, $VendorSize);\n\t\t$commentdataoffset += $VendorSize;\n\n\t\t$CommentsCount = getid3_lib::LittleEndian2Int(substr($commentdata, $commentdataoffset, 4));\n\t\t$commentdataoffset += 4;\n\t\t$info['avdataoffset'] = $CommentStartOffset + $commentdataoffset;\n\n\t\t$basicfields = array('TITLE', 'ARTIST', 'ALBUM', 'TRACKNUMBER', 'GENRE', 'DATE', 'DESCRIPTION', 'COMMENT');\n\t\t$ThisFileInfo_ogg_comments_raw = &$info['ogg']['comments_raw'];\n\t\tfor ($i = 0; $i < $CommentsCount; $i++) {\n\n\t\t\tif ($i >= 10000) {\n\t\t\t\t// https://github.com/owncloud/music/issues/212#issuecomment-43082336\n\t\t\t\t$this->warning('Unexpectedly large number ('.$CommentsCount.') of Ogg comments - breaking after reading '.$i.' comments');\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$ThisFileInfo_ogg_comments_raw[$i]['dataoffset'] = $CommentStartOffset + $commentdataoffset;\n\n\t\t\tif ($this->ftell() < ($ThisFileInfo_ogg_comments_raw[$i]['dataoffset'] + 4)) {\n\t\t\t\tif ($oggpageinfo = $this->ParseOggPageHeader()) {\n\t\t\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo;\n\n\t\t\t\t\t$VorbisCommentPage++;\n\n\t\t\t\t\t// First, save what we haven't read yet\n\t\t\t\t\t$AsYetUnusedData = substr($commentdata, $commentdataoffset);\n\n\t\t\t\t\t// Then take that data off the end\n\t\t\t\t\t$commentdata     = substr($commentdata, 0, $commentdataoffset);\n\n\t\t\t\t\t// Add [headerlength] bytes of dummy data for the Ogg Page Header, just to keep absolute offsets correct\n\t\t\t\t\t$commentdata .= str_repeat(\"\\x00\", 27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']);\n\t\t\t\t\t$commentdataoffset += (27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']);\n\n\t\t\t\t\t// Finally, stick the unused data back on the end\n\t\t\t\t\t$commentdata .= $AsYetUnusedData;\n\n\t\t\t\t\t//$commentdata .= $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']);\n\t\t\t\t\t$commentdata .= $this->fread($this->OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1));\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t$ThisFileInfo_ogg_comments_raw[$i]['size'] = getid3_lib::LittleEndian2Int(substr($commentdata, $commentdataoffset, 4));\n\n\t\t\t// replace avdataoffset with position just after the last vorbiscomment\n\t\t\t$info['avdataoffset'] = $ThisFileInfo_ogg_comments_raw[$i]['dataoffset'] + $ThisFileInfo_ogg_comments_raw[$i]['size'] + 4;\n\n\t\t\t$commentdataoffset += 4;\n\t\t\twhile ((strlen($commentdata) - $commentdataoffset) < $ThisFileInfo_ogg_comments_raw[$i]['size']) {\n\t\t\t\tif (($ThisFileInfo_ogg_comments_raw[$i]['size'] > $info['avdataend']) || ($ThisFileInfo_ogg_comments_raw[$i]['size'] < 0)) {\n\t\t\t\t\t$this->warning('Invalid Ogg comment size (comment #'.$i.', claims to be '.number_format($ThisFileInfo_ogg_comments_raw[$i]['size']).' bytes) - aborting reading comments');\n\t\t\t\t\tbreak 2;\n\t\t\t\t}\n\n\t\t\t\t$VorbisCommentPage++;\n\n\t\t\t\t$oggpageinfo = $this->ParseOggPageHeader();\n\t\t\t\t$info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo;\n\n\t\t\t\t// First, save what we haven't read yet\n\t\t\t\t$AsYetUnusedData = substr($commentdata, $commentdataoffset);\n\n\t\t\t\t// Then take that data off the end\n\t\t\t\t$commentdata     = substr($commentdata, 0, $commentdataoffset);\n\n\t\t\t\t// Add [headerlength] bytes of dummy data for the Ogg Page Header, just to keep absolute offsets correct\n\t\t\t\t$commentdata .= str_repeat(\"\\x00\", 27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']);\n\t\t\t\t$commentdataoffset += (27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']);\n\n\t\t\t\t// Finally, stick the unused data back on the end\n\t\t\t\t$commentdata .= $AsYetUnusedData;\n\n\t\t\t\t//$commentdata .= $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']);\n\t\t\t\tif (!isset($info['ogg']['pageheader'][$VorbisCommentPage])) {\n\t\t\t\t\t$this->warning('undefined Vorbis Comment page \"'.$VorbisCommentPage.'\" at offset '.$this->ftell());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$readlength = self::OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1);\n\t\t\t\tif ($readlength <= 0) {\n\t\t\t\t\t$this->warning('invalid length Vorbis Comment page \"'.$VorbisCommentPage.'\" at offset '.$this->ftell());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$commentdata .= $this->fread($readlength);\n\n\t\t\t\t//$filebaseoffset += $oggpageinfo['header_end_offset'] - $oggpageinfo['page_start_offset'];\n\t\t\t}\n\t\t\t$ThisFileInfo_ogg_comments_raw[$i]['offset'] = $commentdataoffset;\n\t\t\t$commentstring = substr($commentdata, $commentdataoffset, $ThisFileInfo_ogg_comments_raw[$i]['size']);\n\t\t\t$commentdataoffset += $ThisFileInfo_ogg_comments_raw[$i]['size'];\n\n\t\t\tif (!$commentstring) {\n\n\t\t\t\t// no comment?\n\t\t\t\t$this->warning('Blank Ogg comment ['.$i.']');\n\n\t\t\t} elseif (strstr($commentstring, '=')) {\n\n\t\t\t\t$commentexploded = explode('=', $commentstring, 2);\n\t\t\t\t$ThisFileInfo_ogg_comments_raw[$i]['key']   = strtoupper($commentexploded[0]);\n\t\t\t\t$ThisFileInfo_ogg_comments_raw[$i]['value'] = (isset($commentexploded[1]) ? $commentexploded[1] : '');\n\n\t\t\t\tif ($ThisFileInfo_ogg_comments_raw[$i]['key'] == 'METADATA_BLOCK_PICTURE') {\n\n\t\t\t\t\t// http://wiki.xiph.org/VorbisComment#METADATA_BLOCK_PICTURE\n\t\t\t\t\t// The unencoded format is that of the FLAC picture block. The fields are stored in big endian order as in FLAC, picture data is stored according to the relevant standard.\n\t\t\t\t\t// http://flac.sourceforge.net/format.html#metadata_block_picture\n\t\t\t\t\t$flac = new getid3_flac($this->getid3);\n\t\t\t\t\t$flac->setStringMode(base64_decode($ThisFileInfo_ogg_comments_raw[$i]['value']));\n\t\t\t\t\t$flac->parsePICTURE();\n\t\t\t\t\t$info['ogg']['comments']['picture'][] = $flac->getid3->info['flac']['PICTURE'][0];\n\t\t\t\t\tunset($flac);\n\n\t\t\t\t} elseif ($ThisFileInfo_ogg_comments_raw[$i]['key'] == 'COVERART') {\n\n\t\t\t\t\t$data = base64_decode($ThisFileInfo_ogg_comments_raw[$i]['value']);\n\t\t\t\t\t$this->notice('Found deprecated COVERART tag, it should be replaced in honor of METADATA_BLOCK_PICTURE structure');\n\t\t\t\t\t/** @todo use 'coverartmime' where available */\n\t\t\t\t\t$imageinfo = getid3_lib::GetDataImageSize($data);\n\t\t\t\t\tif ($imageinfo === false || !isset($imageinfo['mime'])) {\n\t\t\t\t\t\t$this->warning('COVERART vorbiscomment tag contains invalid image');\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$ogg = new self($this->getid3);\n\t\t\t\t\t$ogg->setStringMode($data);\n\t\t\t\t\t$info['ogg']['comments']['picture'][] = array(\n\t\t\t\t\t\t'image_mime'   => $imageinfo['mime'],\n\t\t\t\t\t\t'datalength'   => strlen($data),\n\t\t\t\t\t\t'picturetype'  => 'cover art',\n\t\t\t\t\t\t'image_height' => $imageinfo['height'],\n\t\t\t\t\t\t'image_width'  => $imageinfo['width'],\n\t\t\t\t\t\t'data'         => $ogg->saveAttachment('coverart', 0, strlen($data), $imageinfo['mime']),\n\t\t\t\t\t);\n\t\t\t\t\tunset($ogg);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$info['ogg']['comments'][strtolower($ThisFileInfo_ogg_comments_raw[$i]['key'])][] = $ThisFileInfo_ogg_comments_raw[$i]['value'];\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t$this->warning('[known problem with CDex >= v1.40, < v1.50b7] Invalid Ogg comment name/value pair ['.$i.']: '.$commentstring);\n\n\t\t\t}\n\t\t\tunset($ThisFileInfo_ogg_comments_raw[$i]);\n\t\t}\n\t\tunset($ThisFileInfo_ogg_comments_raw);\n\n\n\t\t// Replay Gain Adjustment\n\t\t// http://privatewww.essex.ac.uk/~djmrob/replaygain/\n\t\tif (isset($info['ogg']['comments']) && is_array($info['ogg']['comments'])) {\n\t\t\tforeach ($info['ogg']['comments'] as $index => $commentvalue) {\n\t\t\t\tswitch ($index) {\n\t\t\t\t\tcase 'rg_audiophile':\n\t\t\t\t\tcase 'replaygain_album_gain':\n\t\t\t\t\t\t$info['replay_gain']['album']['adjustment'] = (double) $commentvalue[0];\n\t\t\t\t\t\tunset($info['ogg']['comments'][$index]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'rg_radio':\n\t\t\t\t\tcase 'replaygain_track_gain':\n\t\t\t\t\t\t$info['replay_gain']['track']['adjustment'] = (double) $commentvalue[0];\n\t\t\t\t\t\tunset($info['ogg']['comments'][$index]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'replaygain_album_peak':\n\t\t\t\t\t\t$info['replay_gain']['album']['peak'] = (double) $commentvalue[0];\n\t\t\t\t\t\tunset($info['ogg']['comments'][$index]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'rg_peak':\n\t\t\t\t\tcase 'replaygain_track_peak':\n\t\t\t\t\t\t$info['replay_gain']['track']['peak'] = (double) $commentvalue[0];\n\t\t\t\t\t\tunset($info['ogg']['comments'][$index]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'replaygain_reference_loudness':\n\t\t\t\t\t\t$info['replay_gain']['reference_volume'] = (double) $commentvalue[0];\n\t\t\t\t\t\tunset($info['ogg']['comments'][$index]);\n\t\t\t\t\t\tbreak;\n\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\n\t\t$this->fseek($OriginalOffset);\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param int $mode\n\t *\n\t * @return string|null\n\t */\n\tpublic static function SpeexBandModeLookup($mode) {\n\t\tstatic $SpeexBandModeLookup = array();\n\t\tif (empty($SpeexBandModeLookup)) {\n\t\t\t$SpeexBandModeLookup[0] = 'narrow';\n\t\t\t$SpeexBandModeLookup[1] = 'wide';\n\t\t\t$SpeexBandModeLookup[2] = 'ultra-wide';\n\t\t}\n\t\treturn (isset($SpeexBandModeLookup[$mode]) ? $SpeexBandModeLookup[$mode] : null);\n\t}\n\n\t/**\n\t * @param array $OggInfoArray\n\t * @param int   $SegmentNumber\n\t *\n\t * @return int\n\t */\n\tpublic static function OggPageSegmentLength($OggInfoArray, $SegmentNumber=1) {\n\t\t$segmentlength = 0;\n\t\tfor ($i = 0; $i < $SegmentNumber; $i++) {\n\t\t\t$segmentlength = 0;\n\t\t\tforeach ($OggInfoArray['segment_table'] as $key => $value) {\n\t\t\t\t$segmentlength += $value;\n\t\t\t\tif ($value < 255) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $segmentlength;\n\t}\n\n\t/**\n\t * @param int $nominal_bitrate\n\t *\n\t * @return float\n\t */\n\tpublic static function get_quality_from_nominal_bitrate($nominal_bitrate) {\n\n\t\t// decrease precision\n\t\t$nominal_bitrate = $nominal_bitrate / 1000;\n\n\t\tif ($nominal_bitrate < 128) {\n\t\t\t// q-1 to q4\n\t\t\t$qval = ($nominal_bitrate - 64) / 16;\n\t\t} elseif ($nominal_bitrate < 256) {\n\t\t\t// q4 to q8\n\t\t\t$qval = $nominal_bitrate / 32;\n\t\t} elseif ($nominal_bitrate < 320) {\n\t\t\t// q8 to q9\n\t\t\t$qval = ($nominal_bitrate + 256) / 64;\n\t\t} else {\n\t\t\t// q9 to q10\n\t\t\t$qval = ($nominal_bitrate + 1300) / 180;\n\t\t}\n\t\t//return $qval; // 5.031324\n\t\t//return intval($qval); // 5\n\t\treturn round($qval, 1); // 5 or 4.9\n\t}\n\n\t/**\n\t * @param int $colorspace_id\n\t *\n\t * @return string|null\n\t */\n\tpublic static function TheoraColorSpace($colorspace_id) {\n\t\t// http://www.theora.org/doc/Theora.pdf (table 6.3)\n\t\tstatic $TheoraColorSpaceLookup = array();\n\t\tif (empty($TheoraColorSpaceLookup)) {\n\t\t\t$TheoraColorSpaceLookup[0] = 'Undefined';\n\t\t\t$TheoraColorSpaceLookup[1] = 'Rec. 470M';\n\t\t\t$TheoraColorSpaceLookup[2] = 'Rec. 470BG';\n\t\t\t$TheoraColorSpaceLookup[3] = 'Reserved';\n\t\t}\n\t\treturn (isset($TheoraColorSpaceLookup[$colorspace_id]) ? $TheoraColorSpaceLookup[$colorspace_id] : null);\n\t}\n\n\t/**\n\t * @param int $pixelformat_id\n\t *\n\t * @return string|null\n\t */\n\tpublic static function TheoraPixelFormat($pixelformat_id) {\n\t\t// http://www.theora.org/doc/Theora.pdf (table 6.4)\n\t\tstatic $TheoraPixelFormatLookup = array();\n\t\tif (empty($TheoraPixelFormatLookup)) {\n\t\t\t$TheoraPixelFormatLookup[0] = '4:2:0';\n\t\t\t$TheoraPixelFormatLookup[1] = 'Reserved';\n\t\t\t$TheoraPixelFormatLookup[2] = '4:2:2';\n\t\t\t$TheoraPixelFormatLookup[3] = '4:4:4';\n\t\t}\n\t\treturn (isset($TheoraPixelFormatLookup[$pixelformat_id]) ? $TheoraPixelFormatLookup[$pixelformat_id] : null);\n\t}\n\n}\n", "num_lines": 921}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/////////////////////////////////////////////////////////////////\n/// getID3() by James Heinrich <info@getid3.org>               //\n//  available at https://github.com/JamesHeinrich/getID3       //\n//            or https://www.getid3.org                        //\n//            or http://getid3.sourceforge.net                 //\n//  see readme.txt for more details                            //\n/////////////////////////////////////////////////////////////////\n//                                                             //\n// module.tag.apetag.php                                       //\n// module for analyzing APE tags                               //\n// dependencies: NONE                                          //\n//                                                            ///\n/////////////////////////////////////////////////////////////////\n\nif (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers\n\texit;\n}\n\nclass getid3_apetag extends getid3_handler\n{\n\t/**\n\t * true: return full data for all attachments;\n\t * false: return no data for all attachments;\n\t * integer: return data for attachments <= than this;\n\t * string: save as file to this directory.\n\t *\n\t * @var int|bool|string\n\t */\n\tpublic $inline_attachments = true;\n\n\tpublic $overrideendoffset  = 0;\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function Analyze() {\n\t\t$info = &$this->getid3->info;\n\n\t\tif (!getid3_lib::intValueSupported($info['filesize'])) {\n\t\t\t$this->warning('Unable to check for APEtags because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB');\n\t\t\treturn false;\n\t\t}\n\n\t\t$id3v1tagsize     = 128;\n\t\t$apetagheadersize = 32;\n\t\t$lyrics3tagsize   = 10;\n\n\t\tif ($this->overrideendoffset == 0) {\n\n\t\t\t$this->fseek(0 - $id3v1tagsize - $apetagheadersize - $lyrics3tagsize, SEEK_END);\n\t\t\t$APEfooterID3v1 = $this->fread($id3v1tagsize + $apetagheadersize + $lyrics3tagsize);\n\n\t\t\t//if (preg_match('/APETAGEX.{24}TAG.{125}$/i', $APEfooterID3v1)) {\n\t\t\tif (substr($APEfooterID3v1, strlen($APEfooterID3v1) - $id3v1tagsize - $apetagheadersize, 8) == 'APETAGEX') {\n\n\t\t\t\t// APE tag found before ID3v1\n\t\t\t\t$info['ape']['tag_offset_end'] = $info['filesize'] - $id3v1tagsize;\n\n\t\t\t//} elseif (preg_match('/APETAGEX.{24}$/i', $APEfooterID3v1)) {\n\t\t\t} elseif (substr($APEfooterID3v1, strlen($APEfooterID3v1) - $apetagheadersize, 8) == 'APETAGEX') {\n\n\t\t\t\t// APE tag found, no ID3v1\n\t\t\t\t$info['ape']['tag_offset_end'] = $info['filesize'];\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$this->fseek($this->overrideendoffset - $apetagheadersize);\n\t\t\tif ($this->fread(8) == 'APETAGEX') {\n\t\t\t\t$info['ape']['tag_offset_end'] = $this->overrideendoffset;\n\t\t\t}\n\n\t\t}\n\t\tif (!isset($info['ape']['tag_offset_end'])) {\n\n\t\t\t// APE tag not found\n\t\t\tunset($info['ape']);\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// shortcut\n\t\t$thisfile_ape = &$info['ape'];\n\n\t\t$this->fseek($thisfile_ape['tag_offset_end'] - $apetagheadersize);\n\t\t$APEfooterData = $this->fread(32);\n\t\tif (!($thisfile_ape['footer'] = $this->parseAPEheaderFooter($APEfooterData))) {\n\t\t\t$this->error('Error parsing APE footer at offset '.$thisfile_ape['tag_offset_end']);\n\t\t\treturn false;\n\t\t}\n\n\t\tif (isset($thisfile_ape['footer']['flags']['header']) && $thisfile_ape['footer']['flags']['header']) {\n\t\t\t$this->fseek($thisfile_ape['tag_offset_end'] - $thisfile_ape['footer']['raw']['tagsize'] - $apetagheadersize);\n\t\t\t$thisfile_ape['tag_offset_start'] = $this->ftell();\n\t\t\t$APEtagData = $this->fread($thisfile_ape['footer']['raw']['tagsize'] + $apetagheadersize);\n\t\t} else {\n\t\t\t$thisfile_ape['tag_offset_start'] = $thisfile_ape['tag_offset_end'] - $thisfile_ape['footer']['raw']['tagsize'];\n\t\t\t$this->fseek($thisfile_ape['tag_offset_start']);\n\t\t\t$APEtagData = $this->fread($thisfile_ape['footer']['raw']['tagsize']);\n\t\t}\n\t\t$info['avdataend'] = $thisfile_ape['tag_offset_start'];\n\n\t\tif (isset($info['id3v1']['tag_offset_start']) && ($info['id3v1']['tag_offset_start'] < $thisfile_ape['tag_offset_end'])) {\n\t\t\t$this->warning('ID3v1 tag information ignored since it appears to be a false synch in APEtag data');\n\t\t\tunset($info['id3v1']);\n\t\t\tforeach ($info['warning'] as $key => $value) {\n\t\t\t\tif ($value == 'Some ID3v1 fields do not use NULL characters for padding') {\n\t\t\t\t\tunset($info['warning'][$key]);\n\t\t\t\t\tsort($info['warning']);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$offset = 0;\n\t\tif (isset($thisfile_ape['footer']['flags']['header']) && $thisfile_ape['footer']['flags']['header']) {\n\t\t\tif ($thisfile_ape['header'] = $this->parseAPEheaderFooter(substr($APEtagData, 0, $apetagheadersize))) {\n\t\t\t\t$offset += $apetagheadersize;\n\t\t\t} else {\n\t\t\t\t$this->error('Error parsing APE header at offset '.$thisfile_ape['tag_offset_start']);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// shortcut\n\t\t$info['replay_gain'] = array();\n\t\t$thisfile_replaygain = &$info['replay_gain'];\n\n\t\tfor ($i = 0; $i < $thisfile_ape['footer']['raw']['tag_items']; $i++) {\n\t\t\t$value_size = getid3_lib::LittleEndian2Int(substr($APEtagData, $offset, 4));\n\t\t\t$offset += 4;\n\t\t\t$item_flags = getid3_lib::LittleEndian2Int(substr($APEtagData, $offset, 4));\n\t\t\t$offset += 4;\n\t\t\tif (strstr(substr($APEtagData, $offset), \"\\x00\") === false) {\n\t\t\t\t$this->error('Cannot find null-byte (0x00) separator between ItemKey #'.$i.' and value. ItemKey starts '.$offset.' bytes into the APE tag, at file offset '.($thisfile_ape['tag_offset_start'] + $offset));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$ItemKeyLength = strpos($APEtagData, \"\\x00\", $offset) - $offset;\n\t\t\t$item_key      = strtolower(substr($APEtagData, $offset, $ItemKeyLength));\n\n\t\t\t// shortcut\n\t\t\t$thisfile_ape['items'][$item_key] = array();\n\t\t\t$thisfile_ape_items_current = &$thisfile_ape['items'][$item_key];\n\n\t\t\t$thisfile_ape_items_current['offset'] = $thisfile_ape['tag_offset_start'] + $offset;\n\n\t\t\t$offset += ($ItemKeyLength + 1); // skip 0x00 terminator\n\t\t\t$thisfile_ape_items_current['data'] = substr($APEtagData, $offset, $value_size);\n\t\t\t$offset += $value_size;\n\n\t\t\t$thisfile_ape_items_current['flags'] = $this->parseAPEtagFlags($item_flags);\n\t\t\tswitch ($thisfile_ape_items_current['flags']['item_contents_raw']) {\n\t\t\t\tcase 0: // UTF-8\n\t\t\t\tcase 2: // Locator (URL, filename, etc), UTF-8 encoded\n\t\t\t\t\t$thisfile_ape_items_current['data'] = explode(\"\\x00\", $thisfile_ape_items_current['data']);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 1:  // binary data\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tswitch (strtolower($item_key)) {\n\t\t\t\t// http://wiki.hydrogenaud.io/index.php?title=ReplayGain#MP3Gain\n\t\t\t\tcase 'replaygain_track_gain':\n\t\t\t\t\tif (preg_match('#^([\\\\-\\\\+][0-9\\\\.,]{8})( dB)?$#', $thisfile_ape_items_current['data'][0], $matches)) {\n\t\t\t\t\t\t$thisfile_replaygain['track']['adjustment'] = (float) str_replace(',', '.', $matches[1]); // float casting will see \"0,95\" as zero!\n\t\t\t\t\t\t$thisfile_replaygain['track']['originator'] = 'unspecified';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('MP3gainTrackGain value in APEtag appears invalid: \"'.$thisfile_ape_items_current['data'][0].'\"');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'replaygain_track_peak':\n\t\t\t\t\tif (preg_match('#^([0-9\\\\.,]{8})$#', $thisfile_ape_items_current['data'][0], $matches)) {\n\t\t\t\t\t\t$thisfile_replaygain['track']['peak']       = (float) str_replace(',', '.', $matches[1]); // float casting will see \"0,95\" as zero!\n\t\t\t\t\t\t$thisfile_replaygain['track']['originator'] = 'unspecified';\n\t\t\t\t\t\tif ($thisfile_replaygain['track']['peak'] <= 0) {\n\t\t\t\t\t\t\t$this->warning('ReplayGain Track peak from APEtag appears invalid: '.$thisfile_replaygain['track']['peak'].' (original value = \"'.$thisfile_ape_items_current['data'][0].'\")');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('MP3gainTrackPeak value in APEtag appears invalid: \"'.$thisfile_ape_items_current['data'][0].'\"');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'replaygain_album_gain':\n\t\t\t\t\tif (preg_match('#^([\\\\-\\\\+][0-9\\\\.,]{8})( dB)?$#', $thisfile_ape_items_current['data'][0], $matches)) {\n\t\t\t\t\t\t$thisfile_replaygain['album']['adjustment'] = (float) str_replace(',', '.', $matches[1]); // float casting will see \"0,95\" as zero!\n\t\t\t\t\t\t$thisfile_replaygain['album']['originator'] = 'unspecified';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('MP3gainAlbumGain value in APEtag appears invalid: \"'.$thisfile_ape_items_current['data'][0].'\"');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'replaygain_album_peak':\n\t\t\t\t\tif (preg_match('#^([0-9\\\\.,]{8})$#', $thisfile_ape_items_current['data'][0], $matches)) {\n\t\t\t\t\t\t$thisfile_replaygain['album']['peak']       = (float) str_replace(',', '.', $matches[1]); // float casting will see \"0,95\" as zero!\n\t\t\t\t\t\t$thisfile_replaygain['album']['originator'] = 'unspecified';\n\t\t\t\t\t\tif ($thisfile_replaygain['album']['peak'] <= 0) {\n\t\t\t\t\t\t\t$this->warning('ReplayGain Album peak from APEtag appears invalid: '.$thisfile_replaygain['album']['peak'].' (original value = \"'.$thisfile_ape_items_current['data'][0].'\")');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('MP3gainAlbumPeak value in APEtag appears invalid: \"'.$thisfile_ape_items_current['data'][0].'\"');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'mp3gain_undo':\n\t\t\t\t\tif (preg_match('#^[\\\\-\\\\+][0-9]{3},[\\\\-\\\\+][0-9]{3},[NW]$#', $thisfile_ape_items_current['data'][0])) {\n\t\t\t\t\t\tlist($mp3gain_undo_left, $mp3gain_undo_right, $mp3gain_undo_wrap) = explode(',', $thisfile_ape_items_current['data'][0]);\n\t\t\t\t\t\t$thisfile_replaygain['mp3gain']['undo_left']  = intval($mp3gain_undo_left);\n\t\t\t\t\t\t$thisfile_replaygain['mp3gain']['undo_right'] = intval($mp3gain_undo_right);\n\t\t\t\t\t\t$thisfile_replaygain['mp3gain']['undo_wrap']  = (($mp3gain_undo_wrap == 'Y') ? true : false);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('MP3gainUndo value in APEtag appears invalid: \"'.$thisfile_ape_items_current['data'][0].'\"');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'mp3gain_minmax':\n\t\t\t\t\tif (preg_match('#^[0-9]{3},[0-9]{3}$#', $thisfile_ape_items_current['data'][0])) {\n\t\t\t\t\t\tlist($mp3gain_globalgain_min, $mp3gain_globalgain_max) = explode(',', $thisfile_ape_items_current['data'][0]);\n\t\t\t\t\t\t$thisfile_replaygain['mp3gain']['globalgain_track_min'] = intval($mp3gain_globalgain_min);\n\t\t\t\t\t\t$thisfile_replaygain['mp3gain']['globalgain_track_max'] = intval($mp3gain_globalgain_max);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('MP3gainMinMax value in APEtag appears invalid: \"'.$thisfile_ape_items_current['data'][0].'\"');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'mp3gain_album_minmax':\n\t\t\t\t\tif (preg_match('#^[0-9]{3},[0-9]{3}$#', $thisfile_ape_items_current['data'][0])) {\n\t\t\t\t\t\tlist($mp3gain_globalgain_album_min, $mp3gain_globalgain_album_max) = explode(',', $thisfile_ape_items_current['data'][0]);\n\t\t\t\t\t\t$thisfile_replaygain['mp3gain']['globalgain_album_min'] = intval($mp3gain_globalgain_album_min);\n\t\t\t\t\t\t$thisfile_replaygain['mp3gain']['globalgain_album_max'] = intval($mp3gain_globalgain_album_max);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('MP3gainAlbumMinMax value in APEtag appears invalid: \"'.$thisfile_ape_items_current['data'][0].'\"');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'tracknumber':\n\t\t\t\t\tif (is_array($thisfile_ape_items_current['data'])) {\n\t\t\t\t\t\tforeach ($thisfile_ape_items_current['data'] as $comment) {\n\t\t\t\t\t\t\t$thisfile_ape['comments']['track_number'][] = $comment;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'cover art (artist)':\n\t\t\t\tcase 'cover art (back)':\n\t\t\t\tcase 'cover art (band logo)':\n\t\t\t\tcase 'cover art (band)':\n\t\t\t\tcase 'cover art (colored fish)':\n\t\t\t\tcase 'cover art (composer)':\n\t\t\t\tcase 'cover art (conductor)':\n\t\t\t\tcase 'cover art (front)':\n\t\t\t\tcase 'cover art (icon)':\n\t\t\t\tcase 'cover art (illustration)':\n\t\t\t\tcase 'cover art (lead)':\n\t\t\t\tcase 'cover art (leaflet)':\n\t\t\t\tcase 'cover art (lyricist)':\n\t\t\t\tcase 'cover art (media)':\n\t\t\t\tcase 'cover art (movie scene)':\n\t\t\t\tcase 'cover art (other icon)':\n\t\t\t\tcase 'cover art (other)':\n\t\t\t\tcase 'cover art (performance)':\n\t\t\t\tcase 'cover art (publisher logo)':\n\t\t\t\tcase 'cover art (recording)':\n\t\t\t\tcase 'cover art (studio)':\n\t\t\t\t\t// list of possible cover arts from http://taglib-sharp.sourcearchive.com/documentation/2.0.3.0-2/Ape_2Tag_8cs-source.html\n\t\t\t\t\tif (is_array($thisfile_ape_items_current['data'])) {\n\t\t\t\t\t\t$this->warning('APEtag \"'.$item_key.'\" should be flagged as Binary data, but was incorrectly flagged as UTF-8');\n\t\t\t\t\t\t$thisfile_ape_items_current['data'] = implode(\"\\x00\", $thisfile_ape_items_current['data']);\n\t\t\t\t\t}\n\t\t\t\t\tlist($thisfile_ape_items_current['filename'], $thisfile_ape_items_current['data']) = explode(\"\\x00\", $thisfile_ape_items_current['data'], 2);\n\t\t\t\t\t$thisfile_ape_items_current['data_offset'] = $thisfile_ape_items_current['offset'] + strlen($thisfile_ape_items_current['filename'].\"\\x00\");\n\t\t\t\t\t$thisfile_ape_items_current['data_length'] = strlen($thisfile_ape_items_current['data']);\n\n\t\t\t\t\tdo {\n\t\t\t\t\t\t$thisfile_ape_items_current['image_mime'] = '';\n\t\t\t\t\t\t$imageinfo = array();\n\t\t\t\t\t\t$imagechunkcheck = getid3_lib::GetDataImageSize($thisfile_ape_items_current['data'], $imageinfo);\n\t\t\t\t\t\tif (($imagechunkcheck === false) || !isset($imagechunkcheck[2])) {\n\t\t\t\t\t\t\t$this->warning('APEtag \"'.$item_key.'\" contains invalid image data');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$thisfile_ape_items_current['image_mime'] = image_type_to_mime_type($imagechunkcheck[2]);\n\n\t\t\t\t\t\tif ($this->inline_attachments === false) {\n\t\t\t\t\t\t\t// skip entirely\n\t\t\t\t\t\t\tunset($thisfile_ape_items_current['data']);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->inline_attachments === true) {\n\t\t\t\t\t\t\t// great\n\t\t\t\t\t\t} elseif (is_int($this->inline_attachments)) {\n\t\t\t\t\t\t\tif ($this->inline_attachments < $thisfile_ape_items_current['data_length']) {\n\t\t\t\t\t\t\t\t// too big, skip\n\t\t\t\t\t\t\t\t$this->warning('attachment at '.$thisfile_ape_items_current['offset'].' is too large to process inline ('.number_format($thisfile_ape_items_current['data_length']).' bytes)');\n\t\t\t\t\t\t\t\tunset($thisfile_ape_items_current['data']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif (is_string($this->inline_attachments)) {\n\t\t\t\t\t\t\t$this->inline_attachments = rtrim(str_replace(array('/', '\\\\'), DIRECTORY_SEPARATOR, $this->inline_attachments), DIRECTORY_SEPARATOR);\n\t\t\t\t\t\t\tif (!is_dir($this->inline_attachments) || !getID3::is_writable($this->inline_attachments)) {\n\t\t\t\t\t\t\t\t// cannot write, skip\n\t\t\t\t\t\t\t\t$this->warning('attachment at '.$thisfile_ape_items_current['offset'].' cannot be saved to \"'.$this->inline_attachments.'\" (not writable)');\n\t\t\t\t\t\t\t\tunset($thisfile_ape_items_current['data']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// if we get this far, must be OK\n\t\t\t\t\t\tif (is_string($this->inline_attachments)) {\n\t\t\t\t\t\t\t$destination_filename = $this->inline_attachments.DIRECTORY_SEPARATOR.md5($info['filenamepath']).'_'.$thisfile_ape_items_current['data_offset'];\n\t\t\t\t\t\t\tif (!file_exists($destination_filename) || getID3::is_writable($destination_filename)) {\n\t\t\t\t\t\t\t\tfile_put_contents($destination_filename, $thisfile_ape_items_current['data']);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->warning('attachment at '.$thisfile_ape_items_current['offset'].' cannot be saved to \"'.$destination_filename.'\" (not writable)');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$thisfile_ape_items_current['data_filename'] = $destination_filename;\n\t\t\t\t\t\t\tunset($thisfile_ape_items_current['data']);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (!isset($info['ape']['comments']['picture'])) {\n\t\t\t\t\t\t\t\t$info['ape']['comments']['picture'] = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$comments_picture_data = array();\n\t\t\t\t\t\t\tforeach (array('data', 'image_mime', 'image_width', 'image_height', 'imagetype', 'picturetype', 'description', 'datalength') as $picture_key) {\n\t\t\t\t\t\t\t\tif (isset($thisfile_ape_items_current[$picture_key])) {\n\t\t\t\t\t\t\t\t\t$comments_picture_data[$picture_key] = $thisfile_ape_items_current[$picture_key];\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$info['ape']['comments']['picture'][] = $comments_picture_data;\n\t\t\t\t\t\t\tunset($comments_picture_data);\n\t\t\t\t\t\t}\n\t\t\t\t\t} while (false);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tif (is_array($thisfile_ape_items_current['data'])) {\n\t\t\t\t\t\tforeach ($thisfile_ape_items_current['data'] as $comment) {\n\t\t\t\t\t\t\t$thisfile_ape['comments'][strtolower($item_key)][] = $comment;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t\tif (empty($thisfile_replaygain)) {\n\t\t\tunset($info['replay_gain']);\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $APEheaderFooterData\n\t *\n\t * @return array|false\n\t */\n\tpublic function parseAPEheaderFooter($APEheaderFooterData) {\n\t\t// http://www.uni-jena.de/~pfk/mpp/sv8/apeheader.html\n\n\t\t// shortcut\n\t\t$headerfooterinfo['raw'] = array();\n\t\t$headerfooterinfo_raw = &$headerfooterinfo['raw'];\n\n\t\t$headerfooterinfo_raw['footer_tag']   =                  substr($APEheaderFooterData,  0, 8);\n\t\tif ($headerfooterinfo_raw['footer_tag'] != 'APETAGEX') {\n\t\t\treturn false;\n\t\t}\n\t\t$headerfooterinfo_raw['version']      = getid3_lib::LittleEndian2Int(substr($APEheaderFooterData,  8, 4));\n\t\t$headerfooterinfo_raw['tagsize']      = getid3_lib::LittleEndian2Int(substr($APEheaderFooterData, 12, 4));\n\t\t$headerfooterinfo_raw['tag_items']    = getid3_lib::LittleEndian2Int(substr($APEheaderFooterData, 16, 4));\n\t\t$headerfooterinfo_raw['global_flags'] = getid3_lib::LittleEndian2Int(substr($APEheaderFooterData, 20, 4));\n\t\t$headerfooterinfo_raw['reserved']     =                              substr($APEheaderFooterData, 24, 8);\n\n\t\t$headerfooterinfo['tag_version']         = $headerfooterinfo_raw['version'] / 1000;\n\t\tif ($headerfooterinfo['tag_version'] >= 2) {\n\t\t\t$headerfooterinfo['flags'] = $this->parseAPEtagFlags($headerfooterinfo_raw['global_flags']);\n\t\t}\n\t\treturn $headerfooterinfo;\n\t}\n\n\t/**\n\t * @param int $rawflagint\n\t *\n\t * @return array\n\t */\n\tpublic function parseAPEtagFlags($rawflagint) {\n\t\t// \"Note: APE Tags 1.0 do not use any of the APE Tag flags.\n\t\t// All are set to zero on creation and ignored on reading.\"\n\t\t// http://wiki.hydrogenaud.io/index.php?title=Ape_Tags_Flags\n\t\t$flags['header']            = (bool) ($rawflagint & 0x80000000);\n\t\t$flags['footer']            = (bool) ($rawflagint & 0x40000000);\n\t\t$flags['this_is_header']    = (bool) ($rawflagint & 0x20000000);\n\t\t$flags['item_contents_raw'] =        ($rawflagint & 0x00000006) >> 1;\n\t\t$flags['read_only']         = (bool) ($rawflagint & 0x00000001);\n\n\t\t$flags['item_contents']     = $this->APEcontentTypeFlagLookup($flags['item_contents_raw']);\n\n\t\treturn $flags;\n\t}\n\n\t/**\n\t * @param int $contenttypeid\n\t *\n\t * @return string\n\t */\n\tpublic function APEcontentTypeFlagLookup($contenttypeid) {\n\t\tstatic $APEcontentTypeFlagLookup = array(\n\t\t\t0 => 'utf-8',\n\t\t\t1 => 'binary',\n\t\t\t2 => 'external',\n\t\t\t3 => 'reserved'\n\t\t);\n\t\treturn (isset($APEcontentTypeFlagLookup[$contenttypeid]) ? $APEcontentTypeFlagLookup[$contenttypeid] : 'invalid');\n\t}\n\n\t/**\n\t * @param string $itemkey\n\t *\n\t * @return bool\n\t */\n\tpublic function APEtagItemIsUTF8Lookup($itemkey) {\n\t\tstatic $APEtagItemIsUTF8Lookup = array(\n\t\t\t'title',\n\t\t\t'subtitle',\n\t\t\t'artist',\n\t\t\t'album',\n\t\t\t'debut album',\n\t\t\t'publisher',\n\t\t\t'conductor',\n\t\t\t'track',\n\t\t\t'composer',\n\t\t\t'comment',\n\t\t\t'copyright',\n\t\t\t'publicationright',\n\t\t\t'file',\n\t\t\t'year',\n\t\t\t'record date',\n\t\t\t'record location',\n\t\t\t'genre',\n\t\t\t'media',\n\t\t\t'related',\n\t\t\t'isrc',\n\t\t\t'abstract',\n\t\t\t'language',\n\t\t\t'bibliography'\n\t\t);\n\t\treturn in_array(strtolower($itemkey), $APEtagItemIsUTF8Lookup);\n\t}\n\n}\n", "num_lines": 453}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/////////////////////////////////////////////////////////////////\n/// getID3() by James Heinrich <info@getid3.org>               //\n//  available at https://github.com/JamesHeinrich/getID3       //\n//            or https://www.getid3.org                        //\n//            or http://getid3.sourceforge.net                 //\n//  see readme.txt for more details                            //\n/////////////////////////////////////////////////////////////////\n//                                                             //\n// module.tag.id3v1.php                                        //\n// module for analyzing ID3v1 tags                             //\n// dependencies: NONE                                          //\n//                                                            ///\n/////////////////////////////////////////////////////////////////\n\nif (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers\n\texit;\n}\n\nclass getid3_id3v1 extends getid3_handler\n{\n\t/**\n\t * @return bool\n\t */\n\tpublic function Analyze() {\n\t\t$info = &$this->getid3->info;\n\n\t\tif (!getid3_lib::intValueSupported($info['filesize'])) {\n\t\t\t$this->warning('Unable to check for ID3v1 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB');\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->fseek(-256, SEEK_END);\n\t\t$preid3v1 = $this->fread(128);\n\t\t$id3v1tag = $this->fread(128);\n\n\t\tif (substr($id3v1tag, 0, 3) == 'TAG') {\n\n\t\t\t$info['avdataend'] = $info['filesize'] - 128;\n\n\t\t\t$ParsedID3v1['title']   = $this->cutfield(substr($id3v1tag,   3, 30));\n\t\t\t$ParsedID3v1['artist']  = $this->cutfield(substr($id3v1tag,  33, 30));\n\t\t\t$ParsedID3v1['album']   = $this->cutfield(substr($id3v1tag,  63, 30));\n\t\t\t$ParsedID3v1['year']    = $this->cutfield(substr($id3v1tag,  93,  4));\n\t\t\t$ParsedID3v1['comment'] =                 substr($id3v1tag,  97, 30);  // can't remove nulls yet, track detection depends on them\n\t\t\t$ParsedID3v1['genreid'] =             ord(substr($id3v1tag, 127,  1));\n\n\t\t\t// If second-last byte of comment field is null and last byte of comment field is non-null\n\t\t\t// then this is ID3v1.1 and the comment field is 28 bytes long and the 30th byte is the track number\n\t\t\tif (($id3v1tag[125] === \"\\x00\") && ($id3v1tag[126] !== \"\\x00\")) {\n\t\t\t\t$ParsedID3v1['track_number'] = ord(substr($ParsedID3v1['comment'], 29,  1));\n\t\t\t\t$ParsedID3v1['comment']      =     substr($ParsedID3v1['comment'],  0, 28);\n\t\t\t}\n\t\t\t$ParsedID3v1['comment'] = $this->cutfield($ParsedID3v1['comment']);\n\n\t\t\t$ParsedID3v1['genre'] = $this->LookupGenreName($ParsedID3v1['genreid']);\n\t\t\tif (!empty($ParsedID3v1['genre'])) {\n\t\t\t\tunset($ParsedID3v1['genreid']);\n\t\t\t}\n\t\t\tif (isset($ParsedID3v1['genre']) && (empty($ParsedID3v1['genre']) || ($ParsedID3v1['genre'] == 'Unknown'))) {\n\t\t\t\tunset($ParsedID3v1['genre']);\n\t\t\t}\n\n\t\t\tforeach ($ParsedID3v1 as $key => $value) {\n\t\t\t\t$ParsedID3v1['comments'][$key][0] = $value;\n\t\t\t}\n\t\t\t$ID3v1encoding = $this->getid3->encoding_id3v1;\n\t\t\tif ($this->getid3->encoding_id3v1_autodetect) {\n\t\t\t\t// ID3v1 encoding detection hack START\n\t\t\t\t// ID3v1 is defined as always using ISO-8859-1 encoding, but it is not uncommon to find files tagged with ID3v1 using Windows-1251 or other character sets\n\t\t\t\t// Since ID3v1 has no concept of character sets there is no certain way to know we have the correct non-ISO-8859-1 character set, but we can guess\n\t\t\t\tforeach ($ParsedID3v1['comments'] as $tag_key => $valuearray) {\n\t\t\t\t\tforeach ($valuearray as $key => $value) {\n\t\t\t\t\t\tif (preg_match('#^[\\\\x00-\\\\x40\\\\x80-\\\\xFF]+$#', $value) && !ctype_digit((string) $value)) { // check for strings with only characters above chr(128) and punctuation/numbers, but not just numeric strings (e.g. track numbers or years)\n\t\t\t\t\t\t\tforeach (array('Windows-1251', 'KOI8-R') as $id3v1_bad_encoding) {\n\t\t\t\t\t\t\t\tif (function_exists('mb_convert_encoding') && @mb_convert_encoding($value, $id3v1_bad_encoding, $id3v1_bad_encoding) === $value) {\n\t\t\t\t\t\t\t\t\t$ID3v1encoding = $id3v1_bad_encoding;\n\t\t\t\t\t\t\t\t\t$this->warning('ID3v1 detected as '.$id3v1_bad_encoding.' text encoding in '.$tag_key);\n\t\t\t\t\t\t\t\t\tbreak 3;\n\t\t\t\t\t\t\t\t} elseif (function_exists('iconv') && @iconv($id3v1_bad_encoding, $id3v1_bad_encoding, $value) === $value) {\n\t\t\t\t\t\t\t\t\t$ID3v1encoding = $id3v1_bad_encoding;\n\t\t\t\t\t\t\t\t\t$this->warning('ID3v1 detected as '.$id3v1_bad_encoding.' text encoding in '.$tag_key);\n\t\t\t\t\t\t\t\t\tbreak 3;\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\t\t\t\t// ID3v1 encoding detection hack END\n\t\t\t}\n\n\t\t\t// ID3v1 data is supposed to be padded with NULL characters, but some taggers pad with spaces\n\t\t\t$GoodFormatID3v1tag = $this->GenerateID3v1Tag(\n\t\t\t\t\t\t\t\t\t\t\t$ParsedID3v1['title'],\n\t\t\t\t\t\t\t\t\t\t\t$ParsedID3v1['artist'],\n\t\t\t\t\t\t\t\t\t\t\t$ParsedID3v1['album'],\n\t\t\t\t\t\t\t\t\t\t\t$ParsedID3v1['year'],\n\t\t\t\t\t\t\t\t\t\t\t(isset($ParsedID3v1['genre']) ? $this->LookupGenreID($ParsedID3v1['genre']) : false),\n\t\t\t\t\t\t\t\t\t\t\t$ParsedID3v1['comment'],\n\t\t\t\t\t\t\t\t\t\t\t(!empty($ParsedID3v1['track_number']) ? $ParsedID3v1['track_number'] : ''));\n\t\t\t$ParsedID3v1['padding_valid'] = true;\n\t\t\tif ($id3v1tag !== $GoodFormatID3v1tag) {\n\t\t\t\t$ParsedID3v1['padding_valid'] = false;\n\t\t\t\t$this->warning('Some ID3v1 fields do not use NULL characters for padding');\n\t\t\t}\n\n\t\t\t$ParsedID3v1['tag_offset_end']   = $info['filesize'];\n\t\t\t$ParsedID3v1['tag_offset_start'] = $ParsedID3v1['tag_offset_end'] - 128;\n\n\t\t\t$info['id3v1'] = $ParsedID3v1;\n\t\t\t$info['id3v1']['encoding'] = $ID3v1encoding;\n\t\t}\n\n\t\tif (substr($preid3v1, 0, 3) == 'TAG') {\n\t\t\t// The way iTunes handles tags is, well, brain-damaged.\n\t\t\t// It completely ignores v1 if ID3v2 is present.\n\t\t\t// This goes as far as adding a new v1 tag *even if there already is one*\n\n\t\t\t// A suspected double-ID3v1 tag has been detected, but it could be that\n\t\t\t// the \"TAG\" identifier is a legitimate part of an APE or Lyrics3 tag\n\t\t\tif (substr($preid3v1, 96, 8) == 'APETAGEX') {\n\t\t\t\t// an APE tag footer was found before the last ID3v1, assume false \"TAG\" synch\n\t\t\t} elseif (substr($preid3v1, 119, 6) == 'LYRICS') {\n\t\t\t\t// a Lyrics3 tag footer was found before the last ID3v1, assume false \"TAG\" synch\n\t\t\t} else {\n\t\t\t\t// APE and Lyrics3 footers not found - assume double ID3v1\n\t\t\t\t$this->warning('Duplicate ID3v1 tag detected - this has been known to happen with iTunes');\n\t\t\t\t$info['avdataend'] -= 128;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $str\n\t *\n\t * @return string\n\t */\n\tpublic static function cutfield($str) {\n\t\treturn trim(substr($str, 0, strcspn($str, \"\\x00\")));\n\t}\n\n\t/**\n\t * @param bool $allowSCMPXextended\n\t *\n\t * @return string[]\n\t */\n\tpublic static function ArrayOfGenres($allowSCMPXextended=false) {\n\t\tstatic $GenreLookup = array(\n\t\t\t0    => 'Blues',\n\t\t\t1    => 'Classic Rock',\n\t\t\t2    => 'Country',\n\t\t\t3    => 'Dance',\n\t\t\t4    => 'Disco',\n\t\t\t5    => 'Funk',\n\t\t\t6    => 'Grunge',\n\t\t\t7    => 'Hip-Hop',\n\t\t\t8    => 'Jazz',\n\t\t\t9    => 'Metal',\n\t\t\t10   => 'New Age',\n\t\t\t11   => 'Oldies',\n\t\t\t12   => 'Other',\n\t\t\t13   => 'Pop',\n\t\t\t14   => 'R&B',\n\t\t\t15   => 'Rap',\n\t\t\t16   => 'Reggae',\n\t\t\t17   => 'Rock',\n\t\t\t18   => 'Techno',\n\t\t\t19   => 'Industrial',\n\t\t\t20   => 'Alternative',\n\t\t\t21   => 'Ska',\n\t\t\t22   => 'Death Metal',\n\t\t\t23   => 'Pranks',\n\t\t\t24   => 'Soundtrack',\n\t\t\t25   => 'Euro-Techno',\n\t\t\t26   => 'Ambient',\n\t\t\t27   => 'Trip-Hop',\n\t\t\t28   => 'Vocal',\n\t\t\t29   => 'Jazz+Funk',\n\t\t\t30   => 'Fusion',\n\t\t\t31   => 'Trance',\n\t\t\t32   => 'Classical',\n\t\t\t33   => 'Instrumental',\n\t\t\t34   => 'Acid',\n\t\t\t35   => 'House',\n\t\t\t36   => 'Game',\n\t\t\t37   => 'Sound Clip',\n\t\t\t38   => 'Gospel',\n\t\t\t39   => 'Noise',\n\t\t\t40   => 'Alt. Rock',\n\t\t\t41   => 'Bass',\n\t\t\t42   => 'Soul',\n\t\t\t43   => 'Punk',\n\t\t\t44   => 'Space',\n\t\t\t45   => 'Meditative',\n\t\t\t46   => 'Instrumental Pop',\n\t\t\t47   => 'Instrumental Rock',\n\t\t\t48   => 'Ethnic',\n\t\t\t49   => 'Gothic',\n\t\t\t50   => 'Darkwave',\n\t\t\t51   => 'Techno-Industrial',\n\t\t\t52   => 'Electronic',\n\t\t\t53   => 'Pop-Folk',\n\t\t\t54   => 'Eurodance',\n\t\t\t55   => 'Dream',\n\t\t\t56   => 'Southern Rock',\n\t\t\t57   => 'Comedy',\n\t\t\t58   => 'Cult',\n\t\t\t59   => 'Gangsta Rap',\n\t\t\t60   => 'Top 40',\n\t\t\t61   => 'Christian Rap',\n\t\t\t62   => 'Pop/Funk',\n\t\t\t63   => 'Jungle',\n\t\t\t64   => 'Native American',\n\t\t\t65   => 'Cabaret',\n\t\t\t66   => 'New Wave',\n\t\t\t67   => 'Psychedelic',\n\t\t\t68   => 'Rave',\n\t\t\t69   => 'Showtunes',\n\t\t\t70   => 'Trailer',\n\t\t\t71   => 'Lo-Fi',\n\t\t\t72   => 'Tribal',\n\t\t\t73   => 'Acid Punk',\n\t\t\t74   => 'Acid Jazz',\n\t\t\t75   => 'Polka',\n\t\t\t76   => 'Retro',\n\t\t\t77   => 'Musical',\n\t\t\t78   => 'Rock & Roll',\n\t\t\t79   => 'Hard Rock',\n\t\t\t80   => 'Folk',\n\t\t\t81   => 'Folk/Rock',\n\t\t\t82   => 'National Folk',\n\t\t\t83   => 'Swing',\n\t\t\t84   => 'Fast-Fusion',\n\t\t\t85   => 'Bebob',\n\t\t\t86   => 'Latin',\n\t\t\t87   => 'Revival',\n\t\t\t88   => 'Celtic',\n\t\t\t89   => 'Bluegrass',\n\t\t\t90   => 'Avantgarde',\n\t\t\t91   => 'Gothic Rock',\n\t\t\t92   => 'Progressive Rock',\n\t\t\t93   => 'Psychedelic Rock',\n\t\t\t94   => 'Symphonic Rock',\n\t\t\t95   => 'Slow Rock',\n\t\t\t96   => 'Big Band',\n\t\t\t97   => 'Chorus',\n\t\t\t98   => 'Easy Listening',\n\t\t\t99   => 'Acoustic',\n\t\t\t100  => 'Humour',\n\t\t\t101  => 'Speech',\n\t\t\t102  => 'Chanson',\n\t\t\t103  => 'Opera',\n\t\t\t104  => 'Chamber Music',\n\t\t\t105  => 'Sonata',\n\t\t\t106  => 'Symphony',\n\t\t\t107  => 'Booty Bass',\n\t\t\t108  => 'Primus',\n\t\t\t109  => 'Porn Groove',\n\t\t\t110  => 'Satire',\n\t\t\t111  => 'Slow Jam',\n\t\t\t112  => 'Club',\n\t\t\t113  => 'Tango',\n\t\t\t114  => 'Samba',\n\t\t\t115  => 'Folklore',\n\t\t\t116  => 'Ballad',\n\t\t\t117  => 'Power Ballad',\n\t\t\t118  => 'Rhythmic Soul',\n\t\t\t119  => 'Freestyle',\n\t\t\t120  => 'Duet',\n\t\t\t121  => 'Punk Rock',\n\t\t\t122  => 'Drum Solo',\n\t\t\t123  => 'A Cappella',\n\t\t\t124  => 'Euro-House',\n\t\t\t125  => 'Dance Hall',\n\t\t\t126  => 'Goa',\n\t\t\t127  => 'Drum & Bass',\n\t\t\t128  => 'Club-House',\n\t\t\t129  => 'Hardcore',\n\t\t\t130  => 'Terror',\n\t\t\t131  => 'Indie',\n\t\t\t132  => 'BritPop',\n\t\t\t133  => 'Negerpunk',\n\t\t\t134  => 'Polsk Punk',\n\t\t\t135  => 'Beat',\n\t\t\t136  => 'Christian Gangsta Rap',\n\t\t\t137  => 'Heavy Metal',\n\t\t\t138  => 'Black Metal',\n\t\t\t139  => 'Crossover',\n\t\t\t140  => 'Contemporary Christian',\n\t\t\t141  => 'Christian Rock',\n\t\t\t142  => 'Merengue',\n\t\t\t143  => 'Salsa',\n\t\t\t144  => 'Thrash Metal',\n\t\t\t145  => 'Anime',\n\t\t\t146  => 'JPop',\n\t\t\t147  => 'Synthpop',\n\n\t\t\t255  => 'Unknown',\n\n\t\t\t'CR' => 'Cover',\n\t\t\t'RX' => 'Remix'\n\t\t);\n\n\t\tstatic $GenreLookupSCMPX = array();\n\t\tif ($allowSCMPXextended && empty($GenreLookupSCMPX)) {\n\t\t\t$GenreLookupSCMPX = $GenreLookup;\n\t\t\t// http://www.geocities.co.jp/SiliconValley-Oakland/3664/alittle.html#GenreExtended\n\t\t\t// Extended ID3v1 genres invented by SCMPX\n\t\t\t// Note that 255 \"Japanese Anime\" conflicts with standard \"Unknown\"\n\t\t\t$GenreLookupSCMPX[240] = 'Sacred';\n\t\t\t$GenreLookupSCMPX[241] = 'Northern Europe';\n\t\t\t$GenreLookupSCMPX[242] = 'Irish & Scottish';\n\t\t\t$GenreLookupSCMPX[243] = 'Scotland';\n\t\t\t$GenreLookupSCMPX[244] = 'Ethnic Europe';\n\t\t\t$GenreLookupSCMPX[245] = 'Enka';\n\t\t\t$GenreLookupSCMPX[246] = 'Children\\'s Song';\n\t\t\t$GenreLookupSCMPX[247] = 'Japanese Sky';\n\t\t\t$GenreLookupSCMPX[248] = 'Japanese Heavy Rock';\n\t\t\t$GenreLookupSCMPX[249] = 'Japanese Doom Rock';\n\t\t\t$GenreLookupSCMPX[250] = 'Japanese J-POP';\n\t\t\t$GenreLookupSCMPX[251] = 'Japanese Seiyu';\n\t\t\t$GenreLookupSCMPX[252] = 'Japanese Ambient Techno';\n\t\t\t$GenreLookupSCMPX[253] = 'Japanese Moemoe';\n\t\t\t$GenreLookupSCMPX[254] = 'Japanese Tokusatsu';\n\t\t\t//$GenreLookupSCMPX[255] = 'Japanese Anime';\n\t\t}\n\n\t\treturn ($allowSCMPXextended ? $GenreLookupSCMPX : $GenreLookup);\n\t}\n\n\t/**\n\t * @param string $genreid\n\t * @param bool   $allowSCMPXextended\n\t *\n\t * @return string|false\n\t */\n\tpublic static function LookupGenreName($genreid, $allowSCMPXextended=true) {\n\t\tswitch ($genreid) {\n\t\t\tcase 'RX':\n\t\t\tcase 'CR':\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif (!is_numeric($genreid)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$genreid = intval($genreid); // to handle 3 or '3' or '03'\n\t\t\t\tbreak;\n\t\t}\n\t\t$GenreLookup = self::ArrayOfGenres($allowSCMPXextended);\n\t\treturn (isset($GenreLookup[$genreid]) ? $GenreLookup[$genreid] : false);\n\t}\n\n\t/**\n\t * @param string $genre\n\t * @param bool   $allowSCMPXextended\n\t *\n\t * @return string|false\n\t */\n\tpublic static function LookupGenreID($genre, $allowSCMPXextended=false) {\n\t\t$GenreLookup = self::ArrayOfGenres($allowSCMPXextended);\n\t\t$LowerCaseNoSpaceSearchTerm = strtolower(str_replace(' ', '', $genre));\n\t\tforeach ($GenreLookup as $key => $value) {\n\t\t\tif (strtolower(str_replace(' ', '', $value)) == $LowerCaseNoSpaceSearchTerm) {\n\t\t\t\treturn $key;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * @param string $OriginalGenre\n\t *\n\t * @return string|false\n\t */\n\tpublic static function StandardiseID3v1GenreName($OriginalGenre) {\n\t\tif (($GenreID = self::LookupGenreID($OriginalGenre)) !== false) {\n\t\t\treturn self::LookupGenreName($GenreID);\n\t\t}\n\t\treturn $OriginalGenre;\n\t}\n\n\t/**\n\t * @param string     $title\n\t * @param string     $artist\n\t * @param string     $album\n\t * @param string     $year\n\t * @param int        $genreid\n\t * @param string     $comment\n\t * @param int|string $track\n\t *\n\t * @return string\n\t */\n\tpublic static function GenerateID3v1Tag($title, $artist, $album, $year, $genreid, $comment, $track='') {\n\t\t$ID3v1Tag  = 'TAG';\n\t\t$ID3v1Tag .= str_pad(trim(substr($title,  0, 30)), 30, \"\\x00\", STR_PAD_RIGHT);\n\t\t$ID3v1Tag .= str_pad(trim(substr($artist, 0, 30)), 30, \"\\x00\", STR_PAD_RIGHT);\n\t\t$ID3v1Tag .= str_pad(trim(substr($album,  0, 30)), 30, \"\\x00\", STR_PAD_RIGHT);\n\t\t$ID3v1Tag .= str_pad(trim(substr($year,   0,  4)),  4, \"\\x00\", STR_PAD_LEFT);\n\t\tif (!empty($track) && ($track > 0) && ($track <= 255)) {\n\t\t\t$ID3v1Tag .= str_pad(trim(substr($comment, 0, 28)), 28, \"\\x00\", STR_PAD_RIGHT);\n\t\t\t$ID3v1Tag .= \"\\x00\";\n\t\t\tif (gettype($track) == 'string') {\n\t\t\t\t$track = (int) $track;\n\t\t\t}\n\t\t\t$ID3v1Tag .= chr($track);\n\t\t} else {\n\t\t\t$ID3v1Tag .= str_pad(trim(substr($comment, 0, 30)), 30, \"\\x00\", STR_PAD_RIGHT);\n\t\t}\n\t\tif (($genreid < 0) || ($genreid > 147)) {\n\t\t\t$genreid = 255; // 'unknown' genre\n\t\t}\n\t\tswitch (gettype($genreid)) {\n\t\t\tcase 'string':\n\t\t\tcase 'integer':\n\t\t\t\t$ID3v1Tag .= chr(intval($genreid));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$ID3v1Tag .= chr(255); // 'unknown' genre\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $ID3v1Tag;\n\t}\n\n}\n", "num_lines": 429}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/////////////////////////////////////////////////////////////////\n/// getID3() by James Heinrich <info@getid3.org>               //\n//  available at https://github.com/JamesHeinrich/getID3       //\n//            or https://www.getid3.org                        //\n//            or http://getid3.sourceforge.net                 //\n//  see readme.txt for more details                            //\n/////////////////////////////////////////////////////////////////\n///                                                            //\n// module.tag.id3v2.php                                        //\n// module for analyzing ID3v2 tags                             //\n// dependencies: module.tag.id3v1.php                          //\n//                                                            ///\n/////////////////////////////////////////////////////////////////\n\nif (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers\n\texit;\n}\ngetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v1.php', __FILE__, true);\n\nclass getid3_id3v2 extends getid3_handler\n{\n\tpublic $StartingOffset = 0;\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function Analyze() {\n\t\t$info = &$this->getid3->info;\n\n\t\t//    Overall tag structure:\n\t\t//        +-----------------------------+\n\t\t//        |      Header (10 bytes)      |\n\t\t//        +-----------------------------+\n\t\t//        |       Extended Header       |\n\t\t//        | (variable length, OPTIONAL) |\n\t\t//        +-----------------------------+\n\t\t//        |   Frames (variable length)  |\n\t\t//        +-----------------------------+\n\t\t//        |           Padding           |\n\t\t//        | (variable length, OPTIONAL) |\n\t\t//        +-----------------------------+\n\t\t//        | Footer (10 bytes, OPTIONAL) |\n\t\t//        +-----------------------------+\n\n\t\t//    Header\n\t\t//        ID3v2/file identifier      \"ID3\"\n\t\t//        ID3v2 version              $04 00\n\t\t//        ID3v2 flags                (%ab000000 in v2.2, %abc00000 in v2.3, %abcd0000 in v2.4.x)\n\t\t//        ID3v2 size             4 * %0xxxxxxx\n\n\n\t\t// shortcuts\n\t\t$info['id3v2']['header'] = true;\n\t\t$thisfile_id3v2                  = &$info['id3v2'];\n\t\t$thisfile_id3v2['flags']         =  array();\n\t\t$thisfile_id3v2_flags            = &$thisfile_id3v2['flags'];\n\n\n\t\t$this->fseek($this->StartingOffset);\n\t\t$header = $this->fread(10);\n\t\tif (substr($header, 0, 3) == 'ID3'  &&  strlen($header) == 10) {\n\n\t\t\t$thisfile_id3v2['majorversion'] = ord($header[3]);\n\t\t\t$thisfile_id3v2['minorversion'] = ord($header[4]);\n\n\t\t\t// shortcut\n\t\t\t$id3v2_majorversion = &$thisfile_id3v2['majorversion'];\n\n\t\t} else {\n\n\t\t\tunset($info['id3v2']);\n\t\t\treturn false;\n\n\t\t}\n\n\t\tif ($id3v2_majorversion > 4) { // this script probably won't correctly parse ID3v2.5.x and above (if it ever exists)\n\n\t\t\t$this->error('this script only parses up to ID3v2.4.x - this tag is ID3v2.'.$id3v2_majorversion.'.'.$thisfile_id3v2['minorversion']);\n\t\t\treturn false;\n\n\t\t}\n\n\t\t$id3_flags = ord($header[5]);\n\t\tswitch ($id3v2_majorversion) {\n\t\t\tcase 2:\n\t\t\t\t// %ab000000 in v2.2\n\t\t\t\t$thisfile_id3v2_flags['unsynch']     = (bool) ($id3_flags & 0x80); // a - Unsynchronisation\n\t\t\t\t$thisfile_id3v2_flags['compression'] = (bool) ($id3_flags & 0x40); // b - Compression\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\t// %abc00000 in v2.3\n\t\t\t\t$thisfile_id3v2_flags['unsynch']     = (bool) ($id3_flags & 0x80); // a - Unsynchronisation\n\t\t\t\t$thisfile_id3v2_flags['exthead']     = (bool) ($id3_flags & 0x40); // b - Extended header\n\t\t\t\t$thisfile_id3v2_flags['experim']     = (bool) ($id3_flags & 0x20); // c - Experimental indicator\n\t\t\t\tbreak;\n\n\t\t\tcase 4:\n\t\t\t\t// %abcd0000 in v2.4\n\t\t\t\t$thisfile_id3v2_flags['unsynch']     = (bool) ($id3_flags & 0x80); // a - Unsynchronisation\n\t\t\t\t$thisfile_id3v2_flags['exthead']     = (bool) ($id3_flags & 0x40); // b - Extended header\n\t\t\t\t$thisfile_id3v2_flags['experim']     = (bool) ($id3_flags & 0x20); // c - Experimental indicator\n\t\t\t\t$thisfile_id3v2_flags['isfooter']    = (bool) ($id3_flags & 0x10); // d - Footer present\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$thisfile_id3v2['headerlength'] = getid3_lib::BigEndian2Int(substr($header, 6, 4), 1) + 10; // length of ID3v2 tag in 10-byte header doesn't include 10-byte header length\n\n\t\t$thisfile_id3v2['tag_offset_start'] = $this->StartingOffset;\n\t\t$thisfile_id3v2['tag_offset_end']   = $thisfile_id3v2['tag_offset_start'] + $thisfile_id3v2['headerlength'];\n\n\n\n\t\t// create 'encoding' key - used by getid3::HandleAllTags()\n\t\t// in ID3v2 every field can have it's own encoding type\n\t\t// so force everything to UTF-8 so it can be handled consistantly\n\t\t$thisfile_id3v2['encoding'] = 'UTF-8';\n\n\n\t//    Frames\n\n\t//        All ID3v2 frames consists of one frame header followed by one or more\n\t//        fields containing the actual information. The header is always 10\n\t//        bytes and laid out as follows:\n\t//\n\t//        Frame ID      $xx xx xx xx  (four characters)\n\t//        Size      4 * %0xxxxxxx\n\t//        Flags         $xx xx\n\n\t\t$sizeofframes = $thisfile_id3v2['headerlength'] - 10; // not including 10-byte initial header\n\t\tif (!empty($thisfile_id3v2['exthead']['length'])) {\n\t\t\t$sizeofframes -= ($thisfile_id3v2['exthead']['length'] + 4);\n\t\t}\n\t\tif (!empty($thisfile_id3v2_flags['isfooter'])) {\n\t\t\t$sizeofframes -= 10; // footer takes last 10 bytes of ID3v2 header, after frame data, before audio\n\t\t}\n\t\tif ($sizeofframes > 0) {\n\n\t\t\t$framedata = $this->fread($sizeofframes); // read all frames from file into $framedata variable\n\n\t\t\t//    if entire frame data is unsynched, de-unsynch it now (ID3v2.3.x)\n\t\t\tif (!empty($thisfile_id3v2_flags['unsynch']) && ($id3v2_majorversion <= 3)) {\n\t\t\t\t$framedata = $this->DeUnsynchronise($framedata);\n\t\t\t}\n\t\t\t//        [in ID3v2.4.0] Unsynchronisation [S:6.1] is done on frame level, instead\n\t\t\t//        of on tag level, making it easier to skip frames, increasing the streamability\n\t\t\t//        of the tag. The unsynchronisation flag in the header [S:3.1] indicates that\n\t\t\t//        there exists an unsynchronised frame, while the new unsynchronisation flag in\n\t\t\t//        the frame header [S:4.1.2] indicates unsynchronisation.\n\n\n\t\t\t//$framedataoffset = 10 + ($thisfile_id3v2['exthead']['length'] ? $thisfile_id3v2['exthead']['length'] + 4 : 0); // how many bytes into the stream - start from after the 10-byte header (and extended header length+4, if present)\n\t\t\t$framedataoffset = 10; // how many bytes into the stream - start from after the 10-byte header\n\n\n\t\t\t//    Extended Header\n\t\t\tif (!empty($thisfile_id3v2_flags['exthead'])) {\n\t\t\t\t$extended_header_offset = 0;\n\n\t\t\t\tif ($id3v2_majorversion == 3) {\n\n\t\t\t\t\t// v2.3 definition:\n\t\t\t\t\t//Extended header size  $xx xx xx xx   // 32-bit integer\n\t\t\t\t\t//Extended Flags        $xx xx\n\t\t\t\t\t//     %x0000000 %00000000 // v2.3\n\t\t\t\t\t//     x - CRC data present\n\t\t\t\t\t//Size of padding       $xx xx xx xx\n\n\t\t\t\t\t$thisfile_id3v2['exthead']['length'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 4), 0);\n\t\t\t\t\t$extended_header_offset += 4;\n\n\t\t\t\t\t$thisfile_id3v2['exthead']['flag_bytes'] = 2;\n\t\t\t\t\t$thisfile_id3v2['exthead']['flag_raw'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, $thisfile_id3v2['exthead']['flag_bytes']));\n\t\t\t\t\t$extended_header_offset += $thisfile_id3v2['exthead']['flag_bytes'];\n\n\t\t\t\t\t$thisfile_id3v2['exthead']['flags']['crc'] = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x8000);\n\n\t\t\t\t\t$thisfile_id3v2['exthead']['padding_size'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 4));\n\t\t\t\t\t$extended_header_offset += 4;\n\n\t\t\t\t\tif ($thisfile_id3v2['exthead']['flags']['crc']) {\n\t\t\t\t\t\t$thisfile_id3v2['exthead']['flag_data']['crc'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 4));\n\t\t\t\t\t\t$extended_header_offset += 4;\n\t\t\t\t\t}\n\t\t\t\t\t$extended_header_offset += $thisfile_id3v2['exthead']['padding_size'];\n\n\t\t\t\t} elseif ($id3v2_majorversion == 4) {\n\n\t\t\t\t\t// v2.4 definition:\n\t\t\t\t\t//Extended header size   4 * %0xxxxxxx // 28-bit synchsafe integer\n\t\t\t\t\t//Number of flag bytes       $01\n\t\t\t\t\t//Extended Flags             $xx\n\t\t\t\t\t//     %0bcd0000 // v2.4\n\t\t\t\t\t//     b - Tag is an update\n\t\t\t\t\t//         Flag data length       $00\n\t\t\t\t\t//     c - CRC data present\n\t\t\t\t\t//         Flag data length       $05\n\t\t\t\t\t//         Total frame CRC    5 * %0xxxxxxx\n\t\t\t\t\t//     d - Tag restrictions\n\t\t\t\t\t//         Flag data length       $01\n\n\t\t\t\t\t$thisfile_id3v2['exthead']['length'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 4), true);\n\t\t\t\t\t$extended_header_offset += 4;\n\n\t\t\t\t\t$thisfile_id3v2['exthead']['flag_bytes'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should always be 1\n\t\t\t\t\t$extended_header_offset += 1;\n\n\t\t\t\t\t$thisfile_id3v2['exthead']['flag_raw'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, $thisfile_id3v2['exthead']['flag_bytes']));\n\t\t\t\t\t$extended_header_offset += $thisfile_id3v2['exthead']['flag_bytes'];\n\n\t\t\t\t\t$thisfile_id3v2['exthead']['flags']['update']       = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x40);\n\t\t\t\t\t$thisfile_id3v2['exthead']['flags']['crc']          = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x20);\n\t\t\t\t\t$thisfile_id3v2['exthead']['flags']['restrictions'] = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x10);\n\n\t\t\t\t\tif ($thisfile_id3v2['exthead']['flags']['update']) {\n\t\t\t\t\t\t$ext_header_chunk_length = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should be 0\n\t\t\t\t\t\t$extended_header_offset += 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($thisfile_id3v2['exthead']['flags']['crc']) {\n\t\t\t\t\t\t$ext_header_chunk_length = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should be 5\n\t\t\t\t\t\t$extended_header_offset += 1;\n\t\t\t\t\t\t$thisfile_id3v2['exthead']['flag_data']['crc'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, $ext_header_chunk_length), true, false);\n\t\t\t\t\t\t$extended_header_offset += $ext_header_chunk_length;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($thisfile_id3v2['exthead']['flags']['restrictions']) {\n\t\t\t\t\t\t$ext_header_chunk_length = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should be 1\n\t\t\t\t\t\t$extended_header_offset += 1;\n\n\t\t\t\t\t\t// %ppqrrstt\n\t\t\t\t\t\t$restrictions_raw = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1));\n\t\t\t\t\t\t$extended_header_offset += 1;\n\t\t\t\t\t\t$thisfile_id3v2['exthead']['flags']['restrictions']['tagsize']  = ($restrictions_raw & 0xC0) >> 6; // p - Tag size restrictions\n\t\t\t\t\t\t$thisfile_id3v2['exthead']['flags']['restrictions']['textenc']  = ($restrictions_raw & 0x20) >> 5; // q - Text encoding restrictions\n\t\t\t\t\t\t$thisfile_id3v2['exthead']['flags']['restrictions']['textsize'] = ($restrictions_raw & 0x18) >> 3; // r - Text fields size restrictions\n\t\t\t\t\t\t$thisfile_id3v2['exthead']['flags']['restrictions']['imgenc']   = ($restrictions_raw & 0x04) >> 2; // s - Image encoding restrictions\n\t\t\t\t\t\t$thisfile_id3v2['exthead']['flags']['restrictions']['imgsize']  = ($restrictions_raw & 0x03) >> 0; // t - Image size restrictions\n\n\t\t\t\t\t\t$thisfile_id3v2['exthead']['flags']['restrictions_text']['tagsize']  = $this->LookupExtendedHeaderRestrictionsTagSizeLimits($thisfile_id3v2['exthead']['flags']['restrictions']['tagsize']);\n\t\t\t\t\t\t$thisfile_id3v2['exthead']['flags']['restrictions_text']['textenc']  = $this->LookupExtendedHeaderRestrictionsTextEncodings($thisfile_id3v2['exthead']['flags']['restrictions']['textenc']);\n\t\t\t\t\t\t$thisfile_id3v2['exthead']['flags']['restrictions_text']['textsize'] = $this->LookupExtendedHeaderRestrictionsTextFieldSize($thisfile_id3v2['exthead']['flags']['restrictions']['textsize']);\n\t\t\t\t\t\t$thisfile_id3v2['exthead']['flags']['restrictions_text']['imgenc']   = $this->LookupExtendedHeaderRestrictionsImageEncoding($thisfile_id3v2['exthead']['flags']['restrictions']['imgenc']);\n\t\t\t\t\t\t$thisfile_id3v2['exthead']['flags']['restrictions_text']['imgsize']  = $this->LookupExtendedHeaderRestrictionsImageSizeSize($thisfile_id3v2['exthead']['flags']['restrictions']['imgsize']);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($thisfile_id3v2['exthead']['length'] != $extended_header_offset) {\n\t\t\t\t\t\t$this->warning('ID3v2.4 extended header length mismatch (expecting '.intval($thisfile_id3v2['exthead']['length']).', found '.intval($extended_header_offset).')');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$framedataoffset += $extended_header_offset;\n\t\t\t\t$framedata = substr($framedata, $extended_header_offset);\n\t\t\t} // end extended header\n\n\n\t\t\twhile (isset($framedata) && (strlen($framedata) > 0)) { // cycle through until no more frame data is left to parse\n\t\t\t\tif (strlen($framedata) <= $this->ID3v2HeaderLength($id3v2_majorversion)) {\n\t\t\t\t\t// insufficient room left in ID3v2 header for actual data - must be padding\n\t\t\t\t\t$thisfile_id3v2['padding']['start']  = $framedataoffset;\n\t\t\t\t\t$thisfile_id3v2['padding']['length'] = strlen($framedata);\n\t\t\t\t\t$thisfile_id3v2['padding']['valid']  = true;\n\t\t\t\t\tfor ($i = 0; $i < $thisfile_id3v2['padding']['length']; $i++) {\n\t\t\t\t\t\tif ($framedata[$i] != \"\\x00\") {\n\t\t\t\t\t\t\t$thisfile_id3v2['padding']['valid'] = false;\n\t\t\t\t\t\t\t$thisfile_id3v2['padding']['errorpos'] = $thisfile_id3v2['padding']['start'] + $i;\n\t\t\t\t\t\t\t$this->warning('Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak; // skip rest of ID3v2 header\n\t\t\t\t}\n\t\t\t\t$frame_header = null;\n\t\t\t\t$frame_name   = null;\n\t\t\t\t$frame_size   = null;\n\t\t\t\t$frame_flags  = null;\n\t\t\t\tif ($id3v2_majorversion == 2) {\n\t\t\t\t\t// Frame ID  $xx xx xx (three characters)\n\t\t\t\t\t// Size      $xx xx xx (24-bit integer)\n\t\t\t\t\t// Flags     $xx xx\n\n\t\t\t\t\t$frame_header = substr($framedata, 0, 6); // take next 6 bytes for header\n\t\t\t\t\t$framedata    = substr($framedata, 6);    // and leave the rest in $framedata\n\t\t\t\t\t$frame_name   = substr($frame_header, 0, 3);\n\t\t\t\t\t$frame_size   = getid3_lib::BigEndian2Int(substr($frame_header, 3, 3), 0);\n\t\t\t\t\t$frame_flags  = 0; // not used for anything in ID3v2.2, just set to avoid E_NOTICEs\n\n\t\t\t\t} elseif ($id3v2_majorversion > 2) {\n\n\t\t\t\t\t// Frame ID  $xx xx xx xx (four characters)\n\t\t\t\t\t// Size      $xx xx xx xx (32-bit integer in v2.3, 28-bit synchsafe in v2.4+)\n\t\t\t\t\t// Flags     $xx xx\n\n\t\t\t\t\t$frame_header = substr($framedata, 0, 10); // take next 10 bytes for header\n\t\t\t\t\t$framedata    = substr($framedata, 10);    // and leave the rest in $framedata\n\n\t\t\t\t\t$frame_name = substr($frame_header, 0, 4);\n\t\t\t\t\tif ($id3v2_majorversion == 3) {\n\t\t\t\t\t\t$frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0); // 32-bit integer\n\t\t\t\t\t} else { // ID3v2.4+\n\t\t\t\t\t\t$frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 1); // 32-bit synchsafe integer (28-bit value)\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($frame_size < (strlen($framedata) + 4)) {\n\t\t\t\t\t\t$nextFrameID = substr($framedata, $frame_size, 4);\n\t\t\t\t\t\tif ($this->IsValidID3v2FrameName($nextFrameID, $id3v2_majorversion)) {\n\t\t\t\t\t\t\t// next frame is OK\n\t\t\t\t\t\t} elseif (($frame_name == \"\\x00\".'MP3') || ($frame_name == \"\\x00\\x00\".'MP') || ($frame_name == ' MP3') || ($frame_name == 'MP3e')) {\n\t\t\t\t\t\t\t// MP3ext known broken frames - \"ok\" for the purposes of this test\n\t\t\t\t\t\t} elseif (($id3v2_majorversion == 4) && ($this->IsValidID3v2FrameName(substr($framedata, getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0), 4), 3))) {\n\t\t\t\t\t\t\t$this->warning('ID3v2 tag written as ID3v2.4, but with non-synchsafe integers (ID3v2.3 style). Older versions of (Helium2; iTunes) are known culprits of this. Tag has been parsed as ID3v2.3');\n\t\t\t\t\t\t\t$id3v2_majorversion = 3;\n\t\t\t\t\t\t\t$frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0); // 32-bit integer\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$frame_flags = getid3_lib::BigEndian2Int(substr($frame_header, 8, 2));\n\t\t\t\t}\n\n\t\t\t\tif ((($id3v2_majorversion == 2) && ($frame_name == \"\\x00\\x00\\x00\")) || ($frame_name == \"\\x00\\x00\\x00\\x00\")) {\n\t\t\t\t\t// padding encountered\n\n\t\t\t\t\t$thisfile_id3v2['padding']['start']  = $framedataoffset;\n\t\t\t\t\t$thisfile_id3v2['padding']['length'] = strlen($frame_header) + strlen($framedata);\n\t\t\t\t\t$thisfile_id3v2['padding']['valid']  = true;\n\n\t\t\t\t\t$len = strlen($framedata);\n\t\t\t\t\tfor ($i = 0; $i < $len; $i++) {\n\t\t\t\t\t\tif ($framedata[$i] != \"\\x00\") {\n\t\t\t\t\t\t\t$thisfile_id3v2['padding']['valid'] = false;\n\t\t\t\t\t\t\t$thisfile_id3v2['padding']['errorpos'] = $thisfile_id3v2['padding']['start'] + $i;\n\t\t\t\t\t\t\t$this->warning('Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak; // skip rest of ID3v2 header\n\t\t\t\t}\n\n\t\t\t\tif ($iTunesBrokenFrameNameFixed = self::ID3v22iTunesBrokenFrameName($frame_name)) {\n\t\t\t\t\t$this->warning('error parsing \"'.$frame_name.'\" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: IsValidID3v2FrameName(\"'.str_replace(\"\\x00\", ' ', $frame_name).'\", '.$id3v2_majorversion.'))). [Note: this particular error has been known to happen with tags edited by iTunes (versions \"X v2.0.3\", \"v3.0.1\", \"v7.0.0.70\" are known-guilty, probably others too)]. Translated frame name from \"'.str_replace(\"\\x00\", ' ', $frame_name).'\" to \"'.$iTunesBrokenFrameNameFixed.'\" for parsing.');\n\t\t\t\t\t$frame_name = $iTunesBrokenFrameNameFixed;\n\t\t\t\t}\n\t\t\t\tif (($frame_size <= strlen($framedata)) && ($this->IsValidID3v2FrameName($frame_name, $id3v2_majorversion))) {\n\n\t\t\t\t\tunset($parsedFrame);\n\t\t\t\t\t$parsedFrame['frame_name']      = $frame_name;\n\t\t\t\t\t$parsedFrame['frame_flags_raw'] = $frame_flags;\n\t\t\t\t\t$parsedFrame['data']            = substr($framedata, 0, $frame_size);\n\t\t\t\t\t$parsedFrame['datalength']      = getid3_lib::CastAsInt($frame_size);\n\t\t\t\t\t$parsedFrame['dataoffset']      = $framedataoffset;\n\n\t\t\t\t\t$this->ParseID3v2Frame($parsedFrame);\n\t\t\t\t\t$thisfile_id3v2[$frame_name][] = $parsedFrame;\n\n\t\t\t\t\t$framedata = substr($framedata, $frame_size);\n\n\t\t\t\t} else { // invalid frame length or FrameID\n\n\t\t\t\t\tif ($frame_size <= strlen($framedata)) {\n\n\t\t\t\t\t\tif ($this->IsValidID3v2FrameName(substr($framedata, $frame_size, 4), $id3v2_majorversion)) {\n\n\t\t\t\t\t\t\t// next frame is valid, just skip the current frame\n\t\t\t\t\t\t\t$framedata = substr($framedata, $frame_size);\n\t\t\t\t\t\t\t$this->warning('Next ID3v2 frame is valid, skipping current frame.');\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// next frame is invalid too, abort processing\n\t\t\t\t\t\t\t//unset($framedata);\n\t\t\t\t\t\t\t$framedata = null;\n\t\t\t\t\t\t\t$this->error('Next ID3v2 frame is also invalid, aborting processing.');\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} elseif ($frame_size == strlen($framedata)) {\n\n\t\t\t\t\t\t// this is the last frame, just skip\n\t\t\t\t\t\t$this->warning('This was the last ID3v2 frame.');\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// next frame is invalid too, abort processing\n\t\t\t\t\t\t//unset($framedata);\n\t\t\t\t\t\t$framedata = null;\n\t\t\t\t\t\t$this->warning('Invalid ID3v2 frame size, aborting.');\n\n\t\t\t\t\t}\n\t\t\t\t\tif (!$this->IsValidID3v2FrameName($frame_name, $id3v2_majorversion)) {\n\n\t\t\t\t\t\tswitch ($frame_name) {\n\t\t\t\t\t\t\tcase \"\\x00\\x00\".'MP':\n\t\t\t\t\t\t\tcase \"\\x00\".'MP3':\n\t\t\t\t\t\t\tcase ' MP3':\n\t\t\t\t\t\t\tcase 'MP3e':\n\t\t\t\t\t\t\tcase \"\\x00\".'MP':\n\t\t\t\t\t\t\tcase ' MP':\n\t\t\t\t\t\t\tcase 'MP3':\n\t\t\t\t\t\t\t\t$this->warning('error parsing \"'.$frame_name.'\" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: !IsValidID3v2FrameName(\"'.str_replace(\"\\x00\", ' ', $frame_name).'\", '.$id3v2_majorversion.'))). [Note: this particular error has been known to happen with tags edited by \"MP3ext (www.mutschler.de/mp3ext/)\"]');\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$this->warning('error parsing \"'.$frame_name.'\" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: !IsValidID3v2FrameName(\"'.str_replace(\"\\x00\", ' ', $frame_name).'\", '.$id3v2_majorversion.'))).');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} elseif (!isset($framedata) || ($frame_size > strlen($framedata))) {\n\n\t\t\t\t\t\t$this->error('error parsing \"'.$frame_name.'\" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: $frame_size ('.$frame_size.') > strlen($framedata) ('.(isset($framedata) ? strlen($framedata) : 'null').')).');\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t$this->error('error parsing \"'.$frame_name.'\" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag).');\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t$framedataoffset += ($frame_size + $this->ID3v2HeaderLength($id3v2_majorversion));\n\n\t\t\t}\n\n\t\t}\n\n\n\t//    Footer\n\n\t//    The footer is a copy of the header, but with a different identifier.\n\t//        ID3v2 identifier           \"3DI\"\n\t//        ID3v2 version              $04 00\n\t//        ID3v2 flags                %abcd0000\n\t//        ID3v2 size             4 * %0xxxxxxx\n\n\t\tif (isset($thisfile_id3v2_flags['isfooter']) && $thisfile_id3v2_flags['isfooter']) {\n\t\t\t$footer = $this->fread(10);\n\t\t\tif (substr($footer, 0, 3) == '3DI') {\n\t\t\t\t$thisfile_id3v2['footer'] = true;\n\t\t\t\t$thisfile_id3v2['majorversion_footer'] = ord($footer[3]);\n\t\t\t\t$thisfile_id3v2['minorversion_footer'] = ord($footer[4]);\n\t\t\t}\n\t\t\tif ($thisfile_id3v2['majorversion_footer'] <= 4) {\n\t\t\t\t$id3_flags = ord($footer[5]);\n\t\t\t\t$thisfile_id3v2_flags['unsynch_footer']  = (bool) ($id3_flags & 0x80);\n\t\t\t\t$thisfile_id3v2_flags['extfoot_footer']  = (bool) ($id3_flags & 0x40);\n\t\t\t\t$thisfile_id3v2_flags['experim_footer']  = (bool) ($id3_flags & 0x20);\n\t\t\t\t$thisfile_id3v2_flags['isfooter_footer'] = (bool) ($id3_flags & 0x10);\n\n\t\t\t\t$thisfile_id3v2['footerlength'] = getid3_lib::BigEndian2Int(substr($footer, 6, 4), 1);\n\t\t\t}\n\t\t} // end footer\n\n\t\tif (isset($thisfile_id3v2['comments']['genre'])) {\n\t\t\t$genres = array();\n\t\t\tforeach ($thisfile_id3v2['comments']['genre'] as $key => $value) {\n\t\t\t\tforeach ($this->ParseID3v2GenreString($value) as $genre) {\n\t\t\t\t\t$genres[] = $genre;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$thisfile_id3v2['comments']['genre'] = array_unique($genres);\n\t\t\tunset($key, $value, $genres, $genre);\n\t\t}\n\n\t\tif (isset($thisfile_id3v2['comments']['track_number'])) {\n\t\t\tforeach ($thisfile_id3v2['comments']['track_number'] as $key => $value) {\n\t\t\t\tif (strstr($value, '/')) {\n\t\t\t\t\tlist($thisfile_id3v2['comments']['track_number'][$key], $thisfile_id3v2['comments']['totaltracks'][$key]) = explode('/', $thisfile_id3v2['comments']['track_number'][$key]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!isset($thisfile_id3v2['comments']['year']) && !empty($thisfile_id3v2['comments']['recording_time'][0]) && preg_match('#^([0-9]{4})#', trim($thisfile_id3v2['comments']['recording_time'][0]), $matches)) {\n\t\t\t$thisfile_id3v2['comments']['year'] = array($matches[1]);\n\t\t}\n\n\n\t\tif (!empty($thisfile_id3v2['TXXX'])) {\n\t\t\t// MediaMonkey does this, maybe others: write a blank RGAD frame, but put replay-gain adjustment values in TXXX frames\n\t\t\tforeach ($thisfile_id3v2['TXXX'] as $txxx_array) {\n\t\t\t\tswitch ($txxx_array['description']) {\n\t\t\t\t\tcase 'replaygain_track_gain':\n\t\t\t\t\t\tif (empty($info['replay_gain']['track']['adjustment']) && !empty($txxx_array['data'])) {\n\t\t\t\t\t\t\t$info['replay_gain']['track']['adjustment'] = floatval(trim(str_replace('dB', '', $txxx_array['data'])));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'replaygain_track_peak':\n\t\t\t\t\t\tif (empty($info['replay_gain']['track']['peak']) && !empty($txxx_array['data'])) {\n\t\t\t\t\t\t\t$info['replay_gain']['track']['peak'] = floatval($txxx_array['data']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'replaygain_album_gain':\n\t\t\t\t\t\tif (empty($info['replay_gain']['album']['adjustment']) && !empty($txxx_array['data'])) {\n\t\t\t\t\t\t\t$info['replay_gain']['album']['adjustment'] = floatval(trim(str_replace('dB', '', $txxx_array['data'])));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// Set avdataoffset\n\t\t$info['avdataoffset'] = $thisfile_id3v2['headerlength'];\n\t\tif (isset($thisfile_id3v2['footer'])) {\n\t\t\t$info['avdataoffset'] += 10;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $genrestring\n\t *\n\t * @return array\n\t */\n\tpublic function ParseID3v2GenreString($genrestring) {\n\t\t// Parse genres into arrays of genreName and genreID\n\t\t// ID3v2.2.x, ID3v2.3.x: '(21)' or '(4)Eurodisco' or '(51)(39)' or '(55)((I think...)'\n\t\t// ID3v2.4.x: '21' $00 'Eurodisco' $00\n\t\t$clean_genres = array();\n\n\t\t// hack-fixes for some badly-written ID3v2.3 taggers, while trying not to break correctly-written tags\n\t\tif (($this->getid3->info['id3v2']['majorversion'] == 3) && !preg_match('#[\\x00]#', $genrestring)) {\n\t\t\t// note: MusicBrainz Picard incorrectly stores plaintext genres separated by \"/\" when writing in ID3v2.3 mode, hack-fix here:\n\t\t\t// replace / with NULL, then replace back the two ID3v1 genres that legitimately have \"/\" as part of the single genre name\n\t\t\tif (strpos($genrestring, '/') !== false) {\n\t\t\t\t$LegitimateSlashedGenreList = array(  // https://github.com/JamesHeinrich/getID3/issues/223\n\t\t\t\t\t'Pop/Funk',    // ID3v1 genre #62 - https://en.wikipedia.org/wiki/ID3#standard\n\t\t\t\t\t'Cut-up/DJ',   // Discogs - https://www.discogs.com/style/cut-up/dj\n\t\t\t\t\t'RnB/Swing',   // Discogs - https://www.discogs.com/style/rnb/swing\n\t\t\t\t\t'Funk / Soul', // Discogs (note spaces) - https://www.discogs.com/genre/funk+%2F+soul\n\t\t\t\t);\n\t\t\t\t$genrestring = str_replace('/', \"\\x00\", $genrestring);\n\t\t\t\tforeach ($LegitimateSlashedGenreList as $SlashedGenre) {\n\t\t\t\t\t$genrestring = str_ireplace(str_replace('/', \"\\x00\", $SlashedGenre), $SlashedGenre, $genrestring);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// some other taggers separate multiple genres with semicolon, e.g. \"Heavy Metal;Thrash Metal;Metal\"\n\t\t\tif (strpos($genrestring, ';') !== false) {\n\t\t\t\t$genrestring = str_replace(';', \"\\x00\", $genrestring);\n\t\t\t}\n\t\t}\n\n\n\t\tif (strpos($genrestring, \"\\x00\") === false) {\n\t\t\t$genrestring = preg_replace('#\\(([0-9]{1,3})\\)#', '$1'.\"\\x00\", $genrestring);\n\t\t}\n\n\t\t$genre_elements = explode(\"\\x00\", $genrestring);\n\t\tforeach ($genre_elements as $element) {\n\t\t\t$element = trim($element);\n\t\t\tif ($element) {\n\t\t\t\tif (preg_match('#^[0-9]{1,3}$#', $element)) {\n\t\t\t\t\t$clean_genres[] = getid3_id3v1::LookupGenreName($element);\n\t\t\t\t} else {\n\t\t\t\t\t$clean_genres[] = str_replace('((', '(', $element);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $clean_genres;\n\t}\n\n\t/**\n\t * @param array $parsedFrame\n\t *\n\t * @return bool\n\t */\n\tpublic function ParseID3v2Frame(&$parsedFrame) {\n\n\t\t// shortcuts\n\t\t$info = &$this->getid3->info;\n\t\t$id3v2_majorversion = $info['id3v2']['majorversion'];\n\n\t\t$parsedFrame['framenamelong']  = $this->FrameNameLongLookup($parsedFrame['frame_name']);\n\t\tif (empty($parsedFrame['framenamelong'])) {\n\t\t\tunset($parsedFrame['framenamelong']);\n\t\t}\n\t\t$parsedFrame['framenameshort'] = $this->FrameNameShortLookup($parsedFrame['frame_name']);\n\t\tif (empty($parsedFrame['framenameshort'])) {\n\t\t\tunset($parsedFrame['framenameshort']);\n\t\t}\n\n\t\tif ($id3v2_majorversion >= 3) { // frame flags are not part of the ID3v2.2 standard\n\t\t\tif ($id3v2_majorversion == 3) {\n\t\t\t\t//    Frame Header Flags\n\t\t\t\t//    %abc00000 %ijk00000\n\t\t\t\t$parsedFrame['flags']['TagAlterPreservation']  = (bool) ($parsedFrame['frame_flags_raw'] & 0x8000); // a - Tag alter preservation\n\t\t\t\t$parsedFrame['flags']['FileAlterPreservation'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x4000); // b - File alter preservation\n\t\t\t\t$parsedFrame['flags']['ReadOnly']              = (bool) ($parsedFrame['frame_flags_raw'] & 0x2000); // c - Read only\n\t\t\t\t$parsedFrame['flags']['compression']           = (bool) ($parsedFrame['frame_flags_raw'] & 0x0080); // i - Compression\n\t\t\t\t$parsedFrame['flags']['Encryption']            = (bool) ($parsedFrame['frame_flags_raw'] & 0x0040); // j - Encryption\n\t\t\t\t$parsedFrame['flags']['GroupingIdentity']      = (bool) ($parsedFrame['frame_flags_raw'] & 0x0020); // k - Grouping identity\n\n\t\t\t} elseif ($id3v2_majorversion == 4) {\n\t\t\t\t//    Frame Header Flags\n\t\t\t\t//    %0abc0000 %0h00kmnp\n\t\t\t\t$parsedFrame['flags']['TagAlterPreservation']  = (bool) ($parsedFrame['frame_flags_raw'] & 0x4000); // a - Tag alter preservation\n\t\t\t\t$parsedFrame['flags']['FileAlterPreservation'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x2000); // b - File alter preservation\n\t\t\t\t$parsedFrame['flags']['ReadOnly']              = (bool) ($parsedFrame['frame_flags_raw'] & 0x1000); // c - Read only\n\t\t\t\t$parsedFrame['flags']['GroupingIdentity']      = (bool) ($parsedFrame['frame_flags_raw'] & 0x0040); // h - Grouping identity\n\t\t\t\t$parsedFrame['flags']['compression']           = (bool) ($parsedFrame['frame_flags_raw'] & 0x0008); // k - Compression\n\t\t\t\t$parsedFrame['flags']['Encryption']            = (bool) ($parsedFrame['frame_flags_raw'] & 0x0004); // m - Encryption\n\t\t\t\t$parsedFrame['flags']['Unsynchronisation']     = (bool) ($parsedFrame['frame_flags_raw'] & 0x0002); // n - Unsynchronisation\n\t\t\t\t$parsedFrame['flags']['DataLengthIndicator']   = (bool) ($parsedFrame['frame_flags_raw'] & 0x0001); // p - Data length indicator\n\n\t\t\t\t// Frame-level de-unsynchronisation - ID3v2.4\n\t\t\t\tif ($parsedFrame['flags']['Unsynchronisation']) {\n\t\t\t\t\t$parsedFrame['data'] = $this->DeUnsynchronise($parsedFrame['data']);\n\t\t\t\t}\n\n\t\t\t\tif ($parsedFrame['flags']['DataLengthIndicator']) {\n\t\t\t\t\t$parsedFrame['data_length_indicator'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 0, 4), 1);\n\t\t\t\t\t$parsedFrame['data']                  =                           substr($parsedFrame['data'], 4);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//    Frame-level de-compression\n\t\t\tif ($parsedFrame['flags']['compression']) {\n\t\t\t\t$parsedFrame['decompressed_size'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 0, 4));\n\t\t\t\tif (!function_exists('gzuncompress')) {\n\t\t\t\t\t$this->warning('gzuncompress() support required to decompress ID3v2 frame \"'.$parsedFrame['frame_name'].'\"');\n\t\t\t\t} else {\n\t\t\t\t\tif ($decompresseddata = @gzuncompress(substr($parsedFrame['data'], 4))) {\n\t\t\t\t\t//if ($decompresseddata = @gzuncompress($parsedFrame['data'])) {\n\t\t\t\t\t\t$parsedFrame['data'] = $decompresseddata;\n\t\t\t\t\t\tunset($decompresseddata);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('gzuncompress() failed on compressed contents of ID3v2 frame \"'.$parsedFrame['frame_name'].'\"');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($parsedFrame['flags']['DataLengthIndicator'])) {\n\t\t\tif ($parsedFrame['data_length_indicator'] != strlen($parsedFrame['data'])) {\n\t\t\t\t$this->warning('ID3v2 frame \"'.$parsedFrame['frame_name'].'\" should be '.$parsedFrame['data_length_indicator'].' bytes long according to DataLengthIndicator, but found '.strlen($parsedFrame['data']).' bytes of data');\n\t\t\t}\n\t\t}\n\n\t\tif (isset($parsedFrame['datalength']) && ($parsedFrame['datalength'] == 0)) {\n\n\t\t\t$warning = 'Frame \"'.$parsedFrame['frame_name'].'\" at offset '.$parsedFrame['dataoffset'].' has no data portion';\n\t\t\tswitch ($parsedFrame['frame_name']) {\n\t\t\t\tcase 'WCOM':\n\t\t\t\t\t$warning .= ' (this is known to happen with files tagged by RioPort)';\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->warning($warning);\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'UFID')) || // 4.1   UFID Unique file identifier\n\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'UFI'))) {  // 4.1   UFI  Unique file identifier\n\t\t\t//   There may be more than one 'UFID' frame in a tag,\n\t\t\t//   but only one with the same 'Owner identifier'.\n\t\t\t// <Header for 'Unique file identifier', ID: 'UFID'>\n\t\t\t// Owner identifier        <text string> $00\n\t\t\t// Identifier              <up to 64 bytes binary data>\n\t\t\t$exploded = explode(\"\\x00\", $parsedFrame['data'], 2);\n\t\t\t$parsedFrame['ownerid'] = (isset($exploded[0]) ? $exploded[0] : '');\n\t\t\t$parsedFrame['data']    = (isset($exploded[1]) ? $exploded[1] : '');\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'TXXX')) || // 4.2.2 TXXX User defined text information frame\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'TXX'))) {    // 4.2.2 TXX  User defined text information frame\n\t\t\t//   There may be more than one 'TXXX' frame in each tag,\n\t\t\t//   but only one with the same description.\n\t\t\t// <Header for 'User defined text information frame', ID: 'TXXX'>\n\t\t\t// Text encoding     $xx\n\t\t\t// Description       <text string according to encoding> $00 (00)\n\t\t\t// Value             <text string according to encoding>\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);\n\t\t\tif ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {\n\t\t\t\t$this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame \"'.$parsedFrame['frame_name'].'\" - defaulting to ISO-8859-1 encoding');\n\t\t\t\t$frame_textencoding_terminator = \"\\x00\";\n\t\t\t}\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);\n\t\t\tif (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {\n\t\t\t\t$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00\n\t\t\t}\n\t\t\t$parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\t$parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']);\n\t\t\t$parsedFrame['encodingid']  = $frame_textencoding;\n\t\t\t$parsedFrame['encoding']    = $this->TextEncodingNameLookup($frame_textencoding);\n\n\t\t\t$parsedFrame['description'] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['description']));\n\t\t\t$parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator));\n\t\t\t$parsedFrame['data'] = $this->RemoveStringTerminator($parsedFrame['data'], $frame_textencoding_terminator);\n\t\t\tif (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {\n\t\t\t\t$commentkey = ($parsedFrame['description'] ? $parsedFrame['description'] : (isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) ? count($info['id3v2']['comments'][$parsedFrame['framenameshort']]) : 0));\n\t\t\t\tif (!isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) || !array_key_exists($commentkey, $info['id3v2']['comments'][$parsedFrame['framenameshort']])) {\n\t\t\t\t\t$info['id3v2']['comments'][$parsedFrame['framenameshort']][$commentkey] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']));\n\t\t\t\t} else {\n\t\t\t\t\t$info['id3v2']['comments'][$parsedFrame['framenameshort']][]            = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']));\n\t\t\t\t}\n\t\t\t}\n\t\t\t//unset($parsedFrame['data']); do not unset, may be needed elsewhere, e.g. for replaygain\n\n\n\t\t} elseif ($parsedFrame['frame_name'][0] == 'T') { // 4.2. T??[?] Text information frame\n\t\t\t//   There may only be one text information frame of its kind in an tag.\n\t\t\t// <Header for 'Text information frame', ID: 'T000' - 'TZZZ',\n\t\t\t// excluding 'TXXX' described in 4.2.6.>\n\t\t\t// Text encoding                $xx\n\t\t\t// Information                  <text string(s) according to encoding>\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\tif ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {\n\t\t\t\t$this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame \"'.$parsedFrame['frame_name'].'\" - defaulting to ISO-8859-1 encoding');\n\t\t\t}\n\n\t\t\t$parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset);\n\t\t\t$parsedFrame['data'] = $this->RemoveStringTerminator($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding));\n\n\t\t\t$parsedFrame['encodingid'] = $frame_textencoding;\n\t\t\t$parsedFrame['encoding']   = $this->TextEncodingNameLookup($frame_textencoding);\n\t\t\tif (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {\n\t\t\t\t// ID3v2.3 specs say that TPE1 (and others) can contain multiple artist values separated with /\n\t\t\t\t// This of course breaks when an artist name contains slash character, e.g. \"AC/DC\"\n\t\t\t\t// MP3tag (maybe others) implement alternative system where multiple artists are null-separated, which makes more sense\n\t\t\t\t// getID3 will split null-separated artists into multiple artists and leave slash-separated ones to the user\n\t\t\t\tswitch ($parsedFrame['encoding']) {\n\t\t\t\t\tcase 'UTF-16':\n\t\t\t\t\tcase 'UTF-16BE':\n\t\t\t\t\tcase 'UTF-16LE':\n\t\t\t\t\t\t$wordsize = 2;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ISO-8859-1':\n\t\t\t\t\tcase 'UTF-8':\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$wordsize = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$Txxx_elements = array();\n\t\t\t\t$Txxx_elements_start_offset = 0;\n\t\t\t\tfor ($i = 0; $i < strlen($parsedFrame['data']); $i += $wordsize) {\n\t\t\t\t\tif (substr($parsedFrame['data'], $i, $wordsize) == str_repeat(\"\\x00\", $wordsize)) {\n\t\t\t\t\t\t$Txxx_elements[] = substr($parsedFrame['data'], $Txxx_elements_start_offset, $i - $Txxx_elements_start_offset);\n\t\t\t\t\t\t$Txxx_elements_start_offset = $i + $wordsize;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$Txxx_elements[] = substr($parsedFrame['data'], $Txxx_elements_start_offset, $i - $Txxx_elements_start_offset);\n\t\t\t\tforeach ($Txxx_elements as $Txxx_element) {\n\t\t\t\t\t$string = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $Txxx_element);\n\t\t\t\t\tif (!empty($string)) {\n\t\t\t\t\t\t$info['id3v2']['comments'][$parsedFrame['framenameshort']][] = $string;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tunset($string, $wordsize, $i, $Txxx_elements, $Txxx_element, $Txxx_elements_start_offset);\n\t\t\t}\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'WXXX')) || // 4.3.2 WXXX User defined URL link frame\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'WXX'))) {    // 4.3.2 WXX  User defined URL link frame\n\t\t\t//   There may be more than one 'WXXX' frame in each tag,\n\t\t\t//   but only one with the same description\n\t\t\t// <Header for 'User defined URL link frame', ID: 'WXXX'>\n\t\t\t// Text encoding     $xx\n\t\t\t// Description       <text string according to encoding> $00 (00)\n\t\t\t// URL               <text string>\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);\n\t\t\tif ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {\n\t\t\t\t$this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame \"'.$parsedFrame['frame_name'].'\" - defaulting to ISO-8859-1 encoding');\n\t\t\t\t$frame_textencoding_terminator = \"\\x00\";\n\t\t\t}\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);\n\t\t\tif (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {\n\t\t\t\t$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00\n\t\t\t}\n\t\t\t$parsedFrame['encodingid']  = $frame_textencoding;\n\t\t\t$parsedFrame['encoding']    = $this->TextEncodingNameLookup($frame_textencoding);\n\t\t\t$parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);           // according to the frame text encoding\n\t\t\t$parsedFrame['url']         = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator)); // always ISO-8859-1\n\t\t\t$parsedFrame['description'] = $this->RemoveStringTerminator($parsedFrame['description'], $frame_textencoding_terminator);\n\t\t\t$parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']);\n\n\t\t\tif (!empty($parsedFrame['framenameshort']) && $parsedFrame['url']) {\n\t\t\t\t$info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback('ISO-8859-1', $info['id3v2']['encoding'], $parsedFrame['url']);\n\t\t\t}\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif ($parsedFrame['frame_name'][0] == 'W') { // 4.3. W??? URL link frames\n\t\t\t//   There may only be one URL link frame of its kind in a tag,\n\t\t\t//   except when stated otherwise in the frame description\n\t\t\t// <Header for 'URL link frame', ID: 'W000' - 'WZZZ', excluding 'WXXX'\n\t\t\t// described in 4.3.2.>\n\t\t\t// URL              <text string>\n\n\t\t\t$parsedFrame['url'] = trim($parsedFrame['data']); // always ISO-8859-1\n\t\t\tif (!empty($parsedFrame['framenameshort']) && $parsedFrame['url']) {\n\t\t\t\t$info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback('ISO-8859-1', $info['id3v2']['encoding'], $parsedFrame['url']);\n\t\t\t}\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif ((($id3v2_majorversion == 3) && ($parsedFrame['frame_name'] == 'IPLS')) || // 4.4  IPLS Involved people list (ID3v2.3 only)\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'IPL'))) {     // 4.4  IPL  Involved people list (ID3v2.2 only)\n\t\t\t// http://id3.org/id3v2.3.0#sec4.4\n\t\t\t//   There may only be one 'IPL' frame in each tag\n\t\t\t// <Header for 'User defined URL link frame', ID: 'IPL'>\n\t\t\t// Text encoding     $xx\n\t\t\t// People list strings    <textstrings>\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\tif ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {\n\t\t\t\t$this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame \"'.$parsedFrame['frame_name'].'\" - defaulting to ISO-8859-1 encoding');\n\t\t\t}\n\t\t\t$parsedFrame['encodingid'] = $frame_textencoding;\n\t\t\t$parsedFrame['encoding']   = $this->TextEncodingNameLookup($parsedFrame['encodingid']);\n\t\t\t$parsedFrame['data_raw']   = (string) substr($parsedFrame['data'], $frame_offset);\n\n\t\t\t// https://www.getid3.org/phpBB3/viewtopic.php?t=1369\n\t\t\t// \"this tag typically contains null terminated strings, which are associated in pairs\"\n\t\t\t// \"there are users that use the tag incorrectly\"\n\t\t\t$IPLS_parts = array();\n\t\t\tif (strpos($parsedFrame['data_raw'], \"\\x00\") !== false) {\n\t\t\t\t$IPLS_parts_unsorted = array();\n\t\t\t\tif (((strlen($parsedFrame['data_raw']) % 2) == 0) && ((substr($parsedFrame['data_raw'], 0, 2) == \"\\xFF\\xFE\") || (substr($parsedFrame['data_raw'], 0, 2) == \"\\xFE\\xFF\"))) {\n\t\t\t\t\t// UTF-16, be careful looking for null bytes since most 2-byte characters may contain one; you need to find twin null bytes, and on even padding\n\t\t\t\t\t$thisILPS  = '';\n\t\t\t\t\tfor ($i = 0; $i < strlen($parsedFrame['data_raw']); $i += 2) {\n\t\t\t\t\t\t$twobytes = substr($parsedFrame['data_raw'], $i, 2);\n\t\t\t\t\t\tif ($twobytes === \"\\x00\\x00\") {\n\t\t\t\t\t\t\t$IPLS_parts_unsorted[] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $thisILPS);\n\t\t\t\t\t\t\t$thisILPS  = '';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$thisILPS .= $twobytes;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (strlen($thisILPS) > 2) { // 2-byte BOM\n\t\t\t\t\t\t$IPLS_parts_unsorted[] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $thisILPS);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// ISO-8859-1 or UTF-8 or other single-byte-null character set\n\t\t\t\t\t$IPLS_parts_unsorted = explode(\"\\x00\", $parsedFrame['data_raw']);\n\t\t\t\t}\n\t\t\t\tif (count($IPLS_parts_unsorted) == 1) {\n\t\t\t\t\t// just a list of names, e.g. \"Dino Baptiste, Jimmy Copley, John Gordon, Bernie Marsden, Sharon Watson\"\n\t\t\t\t\tforeach ($IPLS_parts_unsorted as $key => $value) {\n\t\t\t\t\t\t$IPLS_parts_sorted = preg_split('#[;,\\\\r\\\\n\\\\t]#', $value);\n\t\t\t\t\t\t$position = '';\n\t\t\t\t\t\tforeach ($IPLS_parts_sorted as $person) {\n\t\t\t\t\t\t\t$IPLS_parts[] = array('position'=>$position, 'person'=>$person);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} elseif ((count($IPLS_parts_unsorted) % 2) == 0) {\n\t\t\t\t\t$position = '';\n\t\t\t\t\t$person   = '';\n\t\t\t\t\tforeach ($IPLS_parts_unsorted as $key => $value) {\n\t\t\t\t\t\tif (($key % 2) == 0) {\n\t\t\t\t\t\t\t$position = $value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$person   = $value;\n\t\t\t\t\t\t\t$IPLS_parts[] = array('position'=>$position, 'person'=>$person);\n\t\t\t\t\t\t\t$position = '';\n\t\t\t\t\t\t\t$person   = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tforeach ($IPLS_parts_unsorted as $key => $value) {\n\t\t\t\t\t\t$IPLS_parts[] = array($value);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t$IPLS_parts = preg_split('#[;,\\\\r\\\\n\\\\t]#', $parsedFrame['data_raw']);\n\t\t\t}\n\t\t\t$parsedFrame['data'] = $IPLS_parts;\n\n\t\t\tif (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {\n\t\t\t\t$info['id3v2']['comments'][$parsedFrame['framenameshort']][] = $parsedFrame['data'];\n\t\t\t}\n\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'MCDI')) || // 4.4   MCDI Music CD identifier\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'MCI'))) {     // 4.5   MCI  Music CD identifier\n\t\t\t//   There may only be one 'MCDI' frame in each tag\n\t\t\t// <Header for 'Music CD identifier', ID: 'MCDI'>\n\t\t\t// CD TOC                <binary data>\n\n\t\t\tif (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {\n\t\t\t\t$info['id3v2']['comments'][$parsedFrame['framenameshort']][] = $parsedFrame['data'];\n\t\t\t}\n\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'ETCO')) || // 4.5   ETCO Event timing codes\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'ETC'))) {     // 4.6   ETC  Event timing codes\n\t\t\t//   There may only be one 'ETCO' frame in each tag\n\t\t\t// <Header for 'Event timing codes', ID: 'ETCO'>\n\t\t\t// Time stamp format    $xx\n\t\t\t//   Where time stamp format is:\n\t\t\t// $01  (32-bit value) MPEG frames from beginning of file\n\t\t\t// $02  (32-bit value) milliseconds from beginning of file\n\t\t\t//   Followed by a list of key events in the following format:\n\t\t\t// Type of event   $xx\n\t\t\t// Time stamp      $xx (xx ...)\n\t\t\t//   The 'Time stamp' is set to zero if directly at the beginning of the sound\n\t\t\t//   or after the previous event. All events MUST be sorted in chronological order.\n\n\t\t\t$frame_offset = 0;\n\t\t\t$parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\n\t\t\twhile ($frame_offset < strlen($parsedFrame['data'])) {\n\t\t\t\t$parsedFrame['typeid']    = substr($parsedFrame['data'], $frame_offset++, 1);\n\t\t\t\t$parsedFrame['type']      = $this->ETCOEventLookup($parsedFrame['typeid']);\n\t\t\t\t$parsedFrame['timestamp'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));\n\t\t\t\t$frame_offset += 4;\n\t\t\t}\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'MLLT')) || // 4.6   MLLT MPEG location lookup table\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'MLL'))) {     // 4.7   MLL MPEG location lookup table\n\t\t\t//   There may only be one 'MLLT' frame in each tag\n\t\t\t// <Header for 'Location lookup table', ID: 'MLLT'>\n\t\t\t// MPEG frames between reference  $xx xx\n\t\t\t// Bytes between reference        $xx xx xx\n\t\t\t// Milliseconds between reference $xx xx xx\n\t\t\t// Bits for bytes deviation       $xx\n\t\t\t// Bits for milliseconds dev.     $xx\n\t\t\t//   Then for every reference the following data is included;\n\t\t\t// Deviation in bytes         %xxx....\n\t\t\t// Deviation in milliseconds  %xxx....\n\n\t\t\t$frame_offset = 0;\n\t\t\t$parsedFrame['framesbetweenreferences'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 0, 2));\n\t\t\t$parsedFrame['bytesbetweenreferences']  = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 2, 3));\n\t\t\t$parsedFrame['msbetweenreferences']     = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 5, 3));\n\t\t\t$parsedFrame['bitsforbytesdeviation']   = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 8, 1));\n\t\t\t$parsedFrame['bitsformsdeviation']      = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 9, 1));\n\t\t\t$parsedFrame['data'] = substr($parsedFrame['data'], 10);\n\t\t\t$deviationbitstream = '';\n\t\t\twhile ($frame_offset < strlen($parsedFrame['data'])) {\n\t\t\t\t$deviationbitstream .= getid3_lib::BigEndian2Bin(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t}\n\t\t\t$reference_counter = 0;\n\t\t\twhile (strlen($deviationbitstream) > 0) {\n\t\t\t\t$parsedFrame[$reference_counter]['bytedeviation'] = bindec(substr($deviationbitstream, 0, $parsedFrame['bitsforbytesdeviation']));\n\t\t\t\t$parsedFrame[$reference_counter]['msdeviation']   = bindec(substr($deviationbitstream, $parsedFrame['bitsforbytesdeviation'], $parsedFrame['bitsformsdeviation']));\n\t\t\t\t$deviationbitstream = substr($deviationbitstream, $parsedFrame['bitsforbytesdeviation'] + $parsedFrame['bitsformsdeviation']);\n\t\t\t\t$reference_counter++;\n\t\t\t}\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'SYTC')) || // 4.7   SYTC Synchronised tempo codes\n\t\t\t\t  (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'STC'))) {  // 4.8   STC  Synchronised tempo codes\n\t\t\t//   There may only be one 'SYTC' frame in each tag\n\t\t\t// <Header for 'Synchronised tempo codes', ID: 'SYTC'>\n\t\t\t// Time stamp format   $xx\n\t\t\t// Tempo data          <binary data>\n\t\t\t//   Where time stamp format is:\n\t\t\t// $01  (32-bit value) MPEG frames from beginning of file\n\t\t\t// $02  (32-bit value) milliseconds from beginning of file\n\n\t\t\t$frame_offset = 0;\n\t\t\t$parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$timestamp_counter = 0;\n\t\t\twhile ($frame_offset < strlen($parsedFrame['data'])) {\n\t\t\t\t$parsedFrame[$timestamp_counter]['tempo'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t\tif ($parsedFrame[$timestamp_counter]['tempo'] == 255) {\n\t\t\t\t\t$parsedFrame[$timestamp_counter]['tempo'] += ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t\t}\n\t\t\t\t$parsedFrame[$timestamp_counter]['timestamp'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));\n\t\t\t\t$frame_offset += 4;\n\t\t\t\t$timestamp_counter++;\n\t\t\t}\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'USLT')) || // 4.8   USLT Unsynchronised lyric/text transcription\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'ULT'))) {     // 4.9   ULT  Unsynchronised lyric/text transcription\n\t\t\t//   There may be more than one 'Unsynchronised lyrics/text transcription' frame\n\t\t\t//   in each tag, but only one with the same language and content descriptor.\n\t\t\t// <Header for 'Unsynchronised lyrics/text transcription', ID: 'USLT'>\n\t\t\t// Text encoding        $xx\n\t\t\t// Language             $xx xx xx\n\t\t\t// Content descriptor   <text string according to encoding> $00 (00)\n\t\t\t// Lyrics/text          <full text string according to encoding>\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);\n\t\t\tif ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {\n\t\t\t\t$this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame \"'.$parsedFrame['frame_name'].'\" - defaulting to ISO-8859-1 encoding');\n\t\t\t\t$frame_textencoding_terminator = \"\\x00\";\n\t\t\t}\n\t\t\t$frame_language = substr($parsedFrame['data'], $frame_offset, 3);\n\t\t\t$frame_offset += 3;\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);\n\t\t\tif (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {\n\t\t\t\t$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00\n\t\t\t}\n\t\t\t$parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\t$parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']);\n\t\t\t$parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator));\n\t\t\t$parsedFrame['data'] = $this->RemoveStringTerminator($parsedFrame['data'], $frame_textencoding_terminator);\n\n\t\t\t$parsedFrame['encodingid']   = $frame_textencoding;\n\t\t\t$parsedFrame['encoding']     = $this->TextEncodingNameLookup($frame_textencoding);\n\n\t\t\t$parsedFrame['language']     = $frame_language;\n\t\t\t$parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false);\n\t\t\tif (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {\n\t\t\t\t$info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']);\n\t\t\t}\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'SYLT')) || // 4.9   SYLT Synchronised lyric/text\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'SLT'))) {     // 4.10  SLT  Synchronised lyric/text\n\t\t\t//   There may be more than one 'SYLT' frame in each tag,\n\t\t\t//   but only one with the same language and content descriptor.\n\t\t\t// <Header for 'Synchronised lyrics/text', ID: 'SYLT'>\n\t\t\t// Text encoding        $xx\n\t\t\t// Language             $xx xx xx\n\t\t\t// Time stamp format    $xx\n\t\t\t//   $01  (32-bit value) MPEG frames from beginning of file\n\t\t\t//   $02  (32-bit value) milliseconds from beginning of file\n\t\t\t// Content type         $xx\n\t\t\t// Content descriptor   <text string according to encoding> $00 (00)\n\t\t\t//   Terminated text to be synced (typically a syllable)\n\t\t\t//   Sync identifier (terminator to above string)   $00 (00)\n\t\t\t//   Time stamp                                     $xx (xx ...)\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);\n\t\t\tif ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {\n\t\t\t\t$this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame \"'.$parsedFrame['frame_name'].'\" - defaulting to ISO-8859-1 encoding');\n\t\t\t\t$frame_textencoding_terminator = \"\\x00\";\n\t\t\t}\n\t\t\t$frame_language = substr($parsedFrame['data'], $frame_offset, 3);\n\t\t\t$frame_offset += 3;\n\t\t\t$parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$parsedFrame['contenttypeid']   = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$parsedFrame['contenttype']     = $this->SYTLContentTypeLookup($parsedFrame['contenttypeid']);\n\t\t\t$parsedFrame['encodingid']      = $frame_textencoding;\n\t\t\t$parsedFrame['encoding']        = $this->TextEncodingNameLookup($frame_textencoding);\n\n\t\t\t$parsedFrame['language']        = $frame_language;\n\t\t\t$parsedFrame['languagename']    = $this->LanguageLookup($frame_language, false);\n\n\t\t\t$timestampindex = 0;\n\t\t\t$frame_remainingdata = substr($parsedFrame['data'], $frame_offset);\n\t\t\twhile (strlen($frame_remainingdata)) {\n\t\t\t\t$frame_offset = 0;\n\t\t\t\t$frame_terminatorpos = strpos($frame_remainingdata, $frame_textencoding_terminator);\n\t\t\t\tif ($frame_terminatorpos === false) {\n\t\t\t\t\t$frame_remainingdata = '';\n\t\t\t\t} else {\n\t\t\t\t\tif (ord(substr($frame_remainingdata, $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {\n\t\t\t\t\t\t$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00\n\t\t\t\t\t}\n\t\t\t\t\t$parsedFrame['lyrics'][$timestampindex]['data'] = substr($frame_remainingdata, $frame_offset, $frame_terminatorpos - $frame_offset);\n\n\t\t\t\t\t$frame_remainingdata = substr($frame_remainingdata, $frame_terminatorpos + strlen($frame_textencoding_terminator));\n\t\t\t\t\tif (($timestampindex == 0) && (ord($frame_remainingdata[0]) != 0)) {\n\t\t\t\t\t\t// timestamp probably omitted for first data item\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$parsedFrame['lyrics'][$timestampindex]['timestamp'] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 0, 4));\n\t\t\t\t\t\t$frame_remainingdata = substr($frame_remainingdata, 4);\n\t\t\t\t\t}\n\t\t\t\t\t$timestampindex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'COMM')) || // 4.10  COMM Comments\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'COM'))) {     // 4.11  COM  Comments\n\t\t\t//   There may be more than one comment frame in each tag,\n\t\t\t//   but only one with the same language and content descriptor.\n\t\t\t// <Header for 'Comment', ID: 'COMM'>\n\t\t\t// Text encoding          $xx\n\t\t\t// Language               $xx xx xx\n\t\t\t// Short content descrip. <text string according to encoding> $00 (00)\n\t\t\t// The actual text        <full text string according to encoding>\n\n\t\t\tif (strlen($parsedFrame['data']) < 5) {\n\n\t\t\t\t$this->warning('Invalid data (too short) for \"'.$parsedFrame['frame_name'].'\" frame at offset '.$parsedFrame['dataoffset']);\n\n\t\t\t} else {\n\n\t\t\t\t$frame_offset = 0;\n\t\t\t\t$frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t\t$frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);\n\t\t\t\tif ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {\n\t\t\t\t\t$this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame \"'.$parsedFrame['frame_name'].'\" - defaulting to ISO-8859-1 encoding');\n\t\t\t\t\t$frame_textencoding_terminator = \"\\x00\";\n\t\t\t\t}\n\t\t\t\t$frame_language = substr($parsedFrame['data'], $frame_offset, 3);\n\t\t\t\t$frame_offset += 3;\n\t\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);\n\t\t\t\tif (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {\n\t\t\t\t\t$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00\n\t\t\t\t}\n\t\t\t\t$parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\t\t$parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']);\n\t\t\t\t$frame_text = (string) substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator));\n\t\t\t\t$frame_text = $this->RemoveStringTerminator($frame_text, $frame_textencoding_terminator);\n\n\t\t\t\t$parsedFrame['encodingid']   = $frame_textencoding;\n\t\t\t\t$parsedFrame['encoding']     = $this->TextEncodingNameLookup($frame_textencoding);\n\n\t\t\t\t$parsedFrame['language']     = $frame_language;\n\t\t\t\t$parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false);\n\t\t\t\t$parsedFrame['data']         = $frame_text;\n\t\t\t\tif (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {\n\t\t\t\t\t$commentkey = ($parsedFrame['description'] ? $parsedFrame['description'] : (!empty($info['id3v2']['comments'][$parsedFrame['framenameshort']]) ? count($info['id3v2']['comments'][$parsedFrame['framenameshort']]) : 0));\n\t\t\t\t\tif (!isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) || !array_key_exists($commentkey, $info['id3v2']['comments'][$parsedFrame['framenameshort']])) {\n\t\t\t\t\t\t$info['id3v2']['comments'][$parsedFrame['framenameshort']][$commentkey] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$info['id3v2']['comments'][$parsedFrame['framenameshort']][]            = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'RVA2')) { // 4.11  RVA2 Relative volume adjustment (2) (ID3v2.4+ only)\n\t\t\t//   There may be more than one 'RVA2' frame in each tag,\n\t\t\t//   but only one with the same identification string\n\t\t\t// <Header for 'Relative volume adjustment (2)', ID: 'RVA2'>\n\t\t\t// Identification          <text string> $00\n\t\t\t//   The 'identification' string is used to identify the situation and/or\n\t\t\t//   device where this adjustment should apply. The following is then\n\t\t\t//   repeated for every channel:\n\t\t\t// Type of channel         $xx\n\t\t\t// Volume adjustment       $xx xx\n\t\t\t// Bits representing peak  $xx\n\t\t\t// Peak volume             $xx (xx ...)\n\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\");\n\t\t\t$frame_idstring = substr($parsedFrame['data'], 0, $frame_terminatorpos);\n\t\t\tif (ord($frame_idstring) === 0) {\n\t\t\t\t$frame_idstring = '';\n\t\t\t}\n\t\t\t$frame_remainingdata = substr($parsedFrame['data'], $frame_terminatorpos + strlen(\"\\x00\"));\n\t\t\t$parsedFrame['description'] = $frame_idstring;\n\t\t\t$RVA2channelcounter = 0;\n\t\t\twhile (strlen($frame_remainingdata) >= 5) {\n\t\t\t\t$frame_offset = 0;\n\t\t\t\t$frame_channeltypeid = ord(substr($frame_remainingdata, $frame_offset++, 1));\n\t\t\t\t$parsedFrame[$RVA2channelcounter]['channeltypeid']  = $frame_channeltypeid;\n\t\t\t\t$parsedFrame[$RVA2channelcounter]['channeltype']    = $this->RVA2ChannelTypeLookup($frame_channeltypeid);\n\t\t\t\t$parsedFrame[$RVA2channelcounter]['volumeadjust']   = getid3_lib::BigEndian2Int(substr($frame_remainingdata, $frame_offset, 2), false, true); // 16-bit signed\n\t\t\t\t$frame_offset += 2;\n\t\t\t\t$parsedFrame[$RVA2channelcounter]['bitspeakvolume'] = ord(substr($frame_remainingdata, $frame_offset++, 1));\n\t\t\t\tif (($parsedFrame[$RVA2channelcounter]['bitspeakvolume'] < 1) || ($parsedFrame[$RVA2channelcounter]['bitspeakvolume'] > 4)) {\n\t\t\t\t\t$this->warning('ID3v2::RVA2 frame['.$RVA2channelcounter.'] contains invalid '.$parsedFrame[$RVA2channelcounter]['bitspeakvolume'].'-byte bits-representing-peak value');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$frame_bytespeakvolume = ceil($parsedFrame[$RVA2channelcounter]['bitspeakvolume'] / 8);\n\t\t\t\t$parsedFrame[$RVA2channelcounter]['peakvolume']     = getid3_lib::BigEndian2Int(substr($frame_remainingdata, $frame_offset, $frame_bytespeakvolume));\n\t\t\t\t$frame_remainingdata = substr($frame_remainingdata, $frame_offset + $frame_bytespeakvolume);\n\t\t\t\t$RVA2channelcounter++;\n\t\t\t}\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif ((($id3v2_majorversion == 3) && ($parsedFrame['frame_name'] == 'RVAD')) || // 4.12  RVAD Relative volume adjustment (ID3v2.3 only)\n\t\t\t\t  (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'RVA'))) {  // 4.12  RVA  Relative volume adjustment (ID3v2.2 only)\n\t\t\t//   There may only be one 'RVA' frame in each tag\n\t\t\t// <Header for 'Relative volume adjustment', ID: 'RVA'>\n\t\t\t// ID3v2.2 => Increment/decrement     %000000ba\n\t\t\t// ID3v2.3 => Increment/decrement     %00fedcba\n\t\t\t// Bits used for volume descr.        $xx\n\t\t\t// Relative volume change, right      $xx xx (xx ...) // a\n\t\t\t// Relative volume change, left       $xx xx (xx ...) // b\n\t\t\t// Peak volume right                  $xx xx (xx ...)\n\t\t\t// Peak volume left                   $xx xx (xx ...)\n\t\t\t//   ID3v2.3 only, optional (not present in ID3v2.2):\n\t\t\t// Relative volume change, right back $xx xx (xx ...) // c\n\t\t\t// Relative volume change, left back  $xx xx (xx ...) // d\n\t\t\t// Peak volume right back             $xx xx (xx ...)\n\t\t\t// Peak volume left back              $xx xx (xx ...)\n\t\t\t//   ID3v2.3 only, optional (not present in ID3v2.2):\n\t\t\t// Relative volume change, center     $xx xx (xx ...) // e\n\t\t\t// Peak volume center                 $xx xx (xx ...)\n\t\t\t//   ID3v2.3 only, optional (not present in ID3v2.2):\n\t\t\t// Relative volume change, bass       $xx xx (xx ...) // f\n\t\t\t// Peak volume bass                   $xx xx (xx ...)\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_incrdecrflags = getid3_lib::BigEndian2Bin(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$parsedFrame['incdec']['right'] = (bool) substr($frame_incrdecrflags, 6, 1);\n\t\t\t$parsedFrame['incdec']['left']  = (bool) substr($frame_incrdecrflags, 7, 1);\n\t\t\t$parsedFrame['bitsvolume'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$frame_bytesvolume = ceil($parsedFrame['bitsvolume'] / 8);\n\t\t\t$parsedFrame['volumechange']['right'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));\n\t\t\tif ($parsedFrame['incdec']['right'] === false) {\n\t\t\t\t$parsedFrame['volumechange']['right'] *= -1;\n\t\t\t}\n\t\t\t$frame_offset += $frame_bytesvolume;\n\t\t\t$parsedFrame['volumechange']['left'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));\n\t\t\tif ($parsedFrame['incdec']['left'] === false) {\n\t\t\t\t$parsedFrame['volumechange']['left'] *= -1;\n\t\t\t}\n\t\t\t$frame_offset += $frame_bytesvolume;\n\t\t\t$parsedFrame['peakvolume']['right'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));\n\t\t\t$frame_offset += $frame_bytesvolume;\n\t\t\t$parsedFrame['peakvolume']['left']  = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));\n\t\t\t$frame_offset += $frame_bytesvolume;\n\t\t\tif ($id3v2_majorversion == 3) {\n\t\t\t\t$parsedFrame['data'] = substr($parsedFrame['data'], $frame_offset);\n\t\t\t\tif (strlen($parsedFrame['data']) > 0) {\n\t\t\t\t\t$parsedFrame['incdec']['rightrear'] = (bool) substr($frame_incrdecrflags, 4, 1);\n\t\t\t\t\t$parsedFrame['incdec']['leftrear']  = (bool) substr($frame_incrdecrflags, 5, 1);\n\t\t\t\t\t$parsedFrame['volumechange']['rightrear'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));\n\t\t\t\t\tif ($parsedFrame['incdec']['rightrear'] === false) {\n\t\t\t\t\t\t$parsedFrame['volumechange']['rightrear'] *= -1;\n\t\t\t\t\t}\n\t\t\t\t\t$frame_offset += $frame_bytesvolume;\n\t\t\t\t\t$parsedFrame['volumechange']['leftrear'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));\n\t\t\t\t\tif ($parsedFrame['incdec']['leftrear'] === false) {\n\t\t\t\t\t\t$parsedFrame['volumechange']['leftrear'] *= -1;\n\t\t\t\t\t}\n\t\t\t\t\t$frame_offset += $frame_bytesvolume;\n\t\t\t\t\t$parsedFrame['peakvolume']['rightrear'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));\n\t\t\t\t\t$frame_offset += $frame_bytesvolume;\n\t\t\t\t\t$parsedFrame['peakvolume']['leftrear']  = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));\n\t\t\t\t\t$frame_offset += $frame_bytesvolume;\n\t\t\t\t}\n\t\t\t\t$parsedFrame['data'] = substr($parsedFrame['data'], $frame_offset);\n\t\t\t\tif (strlen($parsedFrame['data']) > 0) {\n\t\t\t\t\t$parsedFrame['incdec']['center'] = (bool) substr($frame_incrdecrflags, 3, 1);\n\t\t\t\t\t$parsedFrame['volumechange']['center'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));\n\t\t\t\t\tif ($parsedFrame['incdec']['center'] === false) {\n\t\t\t\t\t\t$parsedFrame['volumechange']['center'] *= -1;\n\t\t\t\t\t}\n\t\t\t\t\t$frame_offset += $frame_bytesvolume;\n\t\t\t\t\t$parsedFrame['peakvolume']['center'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));\n\t\t\t\t\t$frame_offset += $frame_bytesvolume;\n\t\t\t\t}\n\t\t\t\t$parsedFrame['data'] = substr($parsedFrame['data'], $frame_offset);\n\t\t\t\tif (strlen($parsedFrame['data']) > 0) {\n\t\t\t\t\t$parsedFrame['incdec']['bass'] = (bool) substr($frame_incrdecrflags, 2, 1);\n\t\t\t\t\t$parsedFrame['volumechange']['bass'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));\n\t\t\t\t\tif ($parsedFrame['incdec']['bass'] === false) {\n\t\t\t\t\t\t$parsedFrame['volumechange']['bass'] *= -1;\n\t\t\t\t\t}\n\t\t\t\t\t$frame_offset += $frame_bytesvolume;\n\t\t\t\t\t$parsedFrame['peakvolume']['bass'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));\n\t\t\t\t\t$frame_offset += $frame_bytesvolume;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'EQU2')) { // 4.12  EQU2 Equalisation (2) (ID3v2.4+ only)\n\t\t\t//   There may be more than one 'EQU2' frame in each tag,\n\t\t\t//   but only one with the same identification string\n\t\t\t// <Header of 'Equalisation (2)', ID: 'EQU2'>\n\t\t\t// Interpolation method  $xx\n\t\t\t//   $00  Band\n\t\t\t//   $01  Linear\n\t\t\t// Identification        <text string> $00\n\t\t\t//   The following is then repeated for every adjustment point\n\t\t\t// Frequency          $xx xx\n\t\t\t// Volume adjustment  $xx xx\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_interpolationmethod = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t$frame_idstring = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\tif (ord($frame_idstring) === 0) {\n\t\t\t\t$frame_idstring = '';\n\t\t\t}\n\t\t\t$parsedFrame['description'] = $frame_idstring;\n\t\t\t$frame_remainingdata = substr($parsedFrame['data'], $frame_terminatorpos + strlen(\"\\x00\"));\n\t\t\twhile (strlen($frame_remainingdata)) {\n\t\t\t\t$frame_frequency = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 0, 2)) / 2;\n\t\t\t\t$parsedFrame['data'][$frame_frequency] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 2, 2), false, true);\n\t\t\t\t$frame_remainingdata = substr($frame_remainingdata, 4);\n\t\t\t}\n\t\t\t$parsedFrame['interpolationmethod'] = $frame_interpolationmethod;\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif ((($id3v2_majorversion == 3) && ($parsedFrame['frame_name'] == 'EQUA')) || // 4.12  EQUA Equalisation (ID3v2.3 only)\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'EQU'))) {     // 4.13  EQU  Equalisation (ID3v2.2 only)\n\t\t\t//   There may only be one 'EQUA' frame in each tag\n\t\t\t// <Header for 'Relative volume adjustment', ID: 'EQU'>\n\t\t\t// Adjustment bits    $xx\n\t\t\t//   This is followed by 2 bytes + ('adjustment bits' rounded up to the\n\t\t\t//   nearest byte) for every equalisation band in the following format,\n\t\t\t//   giving a frequency range of 0 - 32767Hz:\n\t\t\t// Increment/decrement   %x (MSB of the Frequency)\n\t\t\t// Frequency             (lower 15 bits)\n\t\t\t// Adjustment            $xx (xx ...)\n\n\t\t\t$frame_offset = 0;\n\t\t\t$parsedFrame['adjustmentbits'] = substr($parsedFrame['data'], $frame_offset++, 1);\n\t\t\t$frame_adjustmentbytes = ceil($parsedFrame['adjustmentbits'] / 8);\n\n\t\t\t$frame_remainingdata = (string) substr($parsedFrame['data'], $frame_offset);\n\t\t\twhile (strlen($frame_remainingdata) > 0) {\n\t\t\t\t$frame_frequencystr = getid3_lib::BigEndian2Bin(substr($frame_remainingdata, 0, 2));\n\t\t\t\t$frame_incdec    = (bool) substr($frame_frequencystr, 0, 1);\n\t\t\t\t$frame_frequency = bindec(substr($frame_frequencystr, 1, 15));\n\t\t\t\t$parsedFrame[$frame_frequency]['incdec'] = $frame_incdec;\n\t\t\t\t$parsedFrame[$frame_frequency]['adjustment'] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 2, $frame_adjustmentbytes));\n\t\t\t\tif ($parsedFrame[$frame_frequency]['incdec'] === false) {\n\t\t\t\t\t$parsedFrame[$frame_frequency]['adjustment'] *= -1;\n\t\t\t\t}\n\t\t\t\t$frame_remainingdata = substr($frame_remainingdata, 2 + $frame_adjustmentbytes);\n\t\t\t}\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'RVRB')) || // 4.13  RVRB Reverb\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'REV'))) {     // 4.14  REV  Reverb\n\t\t\t//   There may only be one 'RVRB' frame in each tag.\n\t\t\t// <Header for 'Reverb', ID: 'RVRB'>\n\t\t\t// Reverb left (ms)                 $xx xx\n\t\t\t// Reverb right (ms)                $xx xx\n\t\t\t// Reverb bounces, left             $xx\n\t\t\t// Reverb bounces, right            $xx\n\t\t\t// Reverb feedback, left to left    $xx\n\t\t\t// Reverb feedback, left to right   $xx\n\t\t\t// Reverb feedback, right to right  $xx\n\t\t\t// Reverb feedback, right to left   $xx\n\t\t\t// Premix left to right             $xx\n\t\t\t// Premix right to left             $xx\n\n\t\t\t$frame_offset = 0;\n\t\t\t$parsedFrame['left']  = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));\n\t\t\t$frame_offset += 2;\n\t\t\t$parsedFrame['right'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));\n\t\t\t$frame_offset += 2;\n\t\t\t$parsedFrame['bouncesL']      = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$parsedFrame['bouncesR']      = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$parsedFrame['feedbackLL']    = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$parsedFrame['feedbackLR']    = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$parsedFrame['feedbackRR']    = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$parsedFrame['feedbackRL']    = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$parsedFrame['premixLR']      = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$parsedFrame['premixRL']      = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'APIC')) || // 4.14  APIC Attached picture\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'PIC'))) {     // 4.15  PIC  Attached picture\n\t\t\t//   There may be several pictures attached to one file,\n\t\t\t//   each in their individual 'APIC' frame, but only one\n\t\t\t//   with the same content descriptor\n\t\t\t// <Header for 'Attached picture', ID: 'APIC'>\n\t\t\t// Text encoding      $xx\n\t\t\t// ID3v2.3+ => MIME type          <text string> $00\n\t\t\t// ID3v2.2  => Image format       $xx xx xx\n\t\t\t// Picture type       $xx\n\t\t\t// Description        <text string according to encoding> $00 (00)\n\t\t\t// Picture data       <binary data>\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);\n\t\t\tif ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {\n\t\t\t\t$this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame \"'.$parsedFrame['frame_name'].'\" - defaulting to ISO-8859-1 encoding');\n\t\t\t\t$frame_textencoding_terminator = \"\\x00\";\n\t\t\t}\n\n\t\t\tif ($id3v2_majorversion == 2 && strlen($parsedFrame['data']) > $frame_offset) {\n\t\t\t\t$frame_imagetype = substr($parsedFrame['data'], $frame_offset, 3);\n\t\t\t\tif (strtolower($frame_imagetype) == 'ima') {\n\t\t\t\t\t// complete hack for mp3Rage (www.chaoticsoftware.com) that puts ID3v2.3-formatted\n\t\t\t\t\t// MIME type instead of 3-char ID3v2.2-format image type  (thanks xbhoff\u00c3\u02dcpacbell*net)\n\t\t\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t\t\t$frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\t\t\tif (ord($frame_mimetype) === 0) {\n\t\t\t\t\t\t$frame_mimetype = '';\n\t\t\t\t\t}\n\t\t\t\t\t$frame_imagetype = strtoupper(str_replace('image/', '', strtolower($frame_mimetype)));\n\t\t\t\t\tif ($frame_imagetype == 'JPEG') {\n\t\t\t\t\t\t$frame_imagetype = 'JPG';\n\t\t\t\t\t}\n\t\t\t\t\t$frame_offset = $frame_terminatorpos + strlen(\"\\x00\");\n\t\t\t\t} else {\n\t\t\t\t\t$frame_offset += 3;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($id3v2_majorversion > 2 && strlen($parsedFrame['data']) > $frame_offset) {\n\t\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t\t$frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\t\tif (ord($frame_mimetype) === 0) {\n\t\t\t\t\t$frame_mimetype = '';\n\t\t\t\t}\n\t\t\t\t$frame_offset = $frame_terminatorpos + strlen(\"\\x00\");\n\t\t\t}\n\n\t\t\t$frame_picturetype = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\n\t\t\tif ($frame_offset >= $parsedFrame['datalength']) {\n\t\t\t\t$this->warning('data portion of APIC frame is missing at offset '.($parsedFrame['dataoffset'] + 8 + $frame_offset));\n\t\t\t} else {\n\t\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);\n\t\t\t\tif (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {\n\t\t\t\t\t$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00\n\t\t\t\t}\n\t\t\t\t$parsedFrame['description']   = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\t\t$parsedFrame['description']   = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']);\n\t\t\t\t$parsedFrame['encodingid']    = $frame_textencoding;\n\t\t\t\t$parsedFrame['encoding']      = $this->TextEncodingNameLookup($frame_textencoding);\n\n\t\t\t\tif ($id3v2_majorversion == 2) {\n\t\t\t\t\t$parsedFrame['imagetype'] = isset($frame_imagetype) ? $frame_imagetype : null;\n\t\t\t\t} else {\n\t\t\t\t\t$parsedFrame['mime']      = isset($frame_mimetype) ? $frame_mimetype : null;\n\t\t\t\t}\n\t\t\t\t$parsedFrame['picturetypeid'] = $frame_picturetype;\n\t\t\t\t$parsedFrame['picturetype']   = $this->APICPictureTypeLookup($frame_picturetype);\n\t\t\t\t$parsedFrame['data']          = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator));\n\t\t\t\t$parsedFrame['datalength']    = strlen($parsedFrame['data']);\n\n\t\t\t\t$parsedFrame['image_mime']    = '';\n\t\t\t\t$imageinfo = array();\n\t\t\t\tif ($imagechunkcheck = getid3_lib::GetDataImageSize($parsedFrame['data'], $imageinfo)) {\n\t\t\t\t\tif (($imagechunkcheck[2] >= 1) && ($imagechunkcheck[2] <= 3)) {\n\t\t\t\t\t\t$parsedFrame['image_mime']       = image_type_to_mime_type($imagechunkcheck[2]);\n\t\t\t\t\t\tif ($imagechunkcheck[0]) {\n\t\t\t\t\t\t\t$parsedFrame['image_width']  = $imagechunkcheck[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($imagechunkcheck[1]) {\n\t\t\t\t\t\t\t$parsedFrame['image_height'] = $imagechunkcheck[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdo {\n\t\t\t\t\tif ($this->getid3->option_save_attachments === false) {\n\t\t\t\t\t\t// skip entirely\n\t\t\t\t\t\tunset($parsedFrame['data']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$dir = '';\n\t\t\t\t\tif ($this->getid3->option_save_attachments === true) {\n\t\t\t\t\t\t// great\n/*\n\t\t\t\t\t} elseif (is_int($this->getid3->option_save_attachments)) {\n\t\t\t\t\t\tif ($this->getid3->option_save_attachments < $parsedFrame['data_length']) {\n\t\t\t\t\t\t\t// too big, skip\n\t\t\t\t\t\t\t$this->warning('attachment at '.$frame_offset.' is too large to process inline ('.number_format($parsedFrame['data_length']).' bytes)');\n\t\t\t\t\t\t\tunset($parsedFrame['data']);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n*/\n\t\t\t\t\t} elseif (is_string($this->getid3->option_save_attachments)) {\n\t\t\t\t\t\t$dir = rtrim(str_replace(array('/', '\\\\'), DIRECTORY_SEPARATOR, $this->getid3->option_save_attachments), DIRECTORY_SEPARATOR);\n\t\t\t\t\t\tif (!is_dir($dir) || !getID3::is_writable($dir)) {\n\t\t\t\t\t\t\t// cannot write, skip\n\t\t\t\t\t\t\t$this->warning('attachment at '.$frame_offset.' cannot be saved to \"'.$dir.'\" (not writable)');\n\t\t\t\t\t\t\tunset($parsedFrame['data']);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// if we get this far, must be OK\n\t\t\t\t\tif (is_string($this->getid3->option_save_attachments)) {\n\t\t\t\t\t\t$destination_filename = $dir.DIRECTORY_SEPARATOR.md5($info['filenamepath']).'_'.$frame_offset;\n\t\t\t\t\t\tif (!file_exists($destination_filename) || getID3::is_writable($destination_filename)) {\n\t\t\t\t\t\t\tfile_put_contents($destination_filename, $parsedFrame['data']);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->warning('attachment at '.$frame_offset.' cannot be saved to \"'.$destination_filename.'\" (not writable)');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$parsedFrame['data_filename'] = $destination_filename;\n\t\t\t\t\t\tunset($parsedFrame['data']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {\n\t\t\t\t\t\t\tif (!isset($info['id3v2']['comments']['picture'])) {\n\t\t\t\t\t\t\t\t$info['id3v2']['comments']['picture'] = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$comments_picture_data = array();\n\t\t\t\t\t\t\tforeach (array('data', 'image_mime', 'image_width', 'image_height', 'imagetype', 'picturetype', 'description', 'datalength') as $picture_key) {\n\t\t\t\t\t\t\t\tif (isset($parsedFrame[$picture_key])) {\n\t\t\t\t\t\t\t\t\t$comments_picture_data[$picture_key] = $parsedFrame[$picture_key];\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$info['id3v2']['comments']['picture'][] = $comments_picture_data;\n\t\t\t\t\t\t\tunset($comments_picture_data);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} while (false);\n\t\t\t}\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'GEOB')) || // 4.15  GEOB General encapsulated object\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'GEO'))) {     // 4.16  GEO  General encapsulated object\n\t\t\t//   There may be more than one 'GEOB' frame in each tag,\n\t\t\t//   but only one with the same content descriptor\n\t\t\t// <Header for 'General encapsulated object', ID: 'GEOB'>\n\t\t\t// Text encoding          $xx\n\t\t\t// MIME type              <text string> $00\n\t\t\t// Filename               <text string according to encoding> $00 (00)\n\t\t\t// Content description    <text string according to encoding> $00 (00)\n\t\t\t// Encapsulated object    <binary data>\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);\n\t\t\tif ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {\n\t\t\t\t$this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame \"'.$parsedFrame['frame_name'].'\" - defaulting to ISO-8859-1 encoding');\n\t\t\t\t$frame_textencoding_terminator = \"\\x00\";\n\t\t\t}\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t$frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\tif (ord($frame_mimetype) === 0) {\n\t\t\t\t$frame_mimetype = '';\n\t\t\t}\n\t\t\t$frame_offset = $frame_terminatorpos + strlen(\"\\x00\");\n\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);\n\t\t\tif (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {\n\t\t\t\t$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00\n\t\t\t}\n\t\t\t$frame_filename = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\tif (ord($frame_filename) === 0) {\n\t\t\t\t$frame_filename = '';\n\t\t\t}\n\t\t\t$frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator);\n\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);\n\t\t\tif (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {\n\t\t\t\t$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00\n\t\t\t}\n\t\t\t$parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\t$parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']);\n\t\t\t$frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator);\n\n\t\t\t$parsedFrame['objectdata']  = (string) substr($parsedFrame['data'], $frame_offset);\n\t\t\t$parsedFrame['encodingid']  = $frame_textencoding;\n\t\t\t$parsedFrame['encoding']    = $this->TextEncodingNameLookup($frame_textencoding);\n\n\t\t\t$parsedFrame['mime']        = $frame_mimetype;\n\t\t\t$parsedFrame['filename']    = $frame_filename;\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'PCNT')) || // 4.16  PCNT Play counter\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'CNT'))) {     // 4.17  CNT  Play counter\n\t\t\t//   There may only be one 'PCNT' frame in each tag.\n\t\t\t//   When the counter reaches all one's, one byte is inserted in\n\t\t\t//   front of the counter thus making the counter eight bits bigger\n\t\t\t// <Header for 'Play counter', ID: 'PCNT'>\n\t\t\t// Counter        $xx xx xx xx (xx ...)\n\n\t\t\t$parsedFrame['data']          = getid3_lib::BigEndian2Int($parsedFrame['data']);\n\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'POPM')) || // 4.17  POPM Popularimeter\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'POP'))) {    // 4.18  POP  Popularimeter\n\t\t\t//   There may be more than one 'POPM' frame in each tag,\n\t\t\t//   but only one with the same email address\n\t\t\t// <Header for 'Popularimeter', ID: 'POPM'>\n\t\t\t// Email to user   <text string> $00\n\t\t\t// Rating          $xx\n\t\t\t// Counter         $xx xx xx xx (xx ...)\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t$frame_emailaddress = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\tif (ord($frame_emailaddress) === 0) {\n\t\t\t\t$frame_emailaddress = '';\n\t\t\t}\n\t\t\t$frame_offset = $frame_terminatorpos + strlen(\"\\x00\");\n\t\t\t$frame_rating = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$parsedFrame['counter'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset));\n\t\t\t$parsedFrame['email']   = $frame_emailaddress;\n\t\t\t$parsedFrame['rating']  = $frame_rating;\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'RBUF')) || // 4.18  RBUF Recommended buffer size\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'BUF'))) {     // 4.19  BUF  Recommended buffer size\n\t\t\t//   There may only be one 'RBUF' frame in each tag\n\t\t\t// <Header for 'Recommended buffer size', ID: 'RBUF'>\n\t\t\t// Buffer size               $xx xx xx\n\t\t\t// Embedded info flag        %0000000x\n\t\t\t// Offset to next tag        $xx xx xx xx\n\n\t\t\t$frame_offset = 0;\n\t\t\t$parsedFrame['buffersize'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 3));\n\t\t\t$frame_offset += 3;\n\n\t\t\t$frame_embeddedinfoflags = getid3_lib::BigEndian2Bin(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$parsedFrame['flags']['embededinfo'] = (bool) substr($frame_embeddedinfoflags, 7, 1);\n\t\t\t$parsedFrame['nexttagoffset'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'CRM')) { // 4.20  Encrypted meta frame (ID3v2.2 only)\n\t\t\t//   There may be more than one 'CRM' frame in a tag,\n\t\t\t//   but only one with the same 'owner identifier'\n\t\t\t// <Header for 'Encrypted meta frame', ID: 'CRM'>\n\t\t\t// Owner identifier      <textstring> $00 (00)\n\t\t\t// Content/explanation   <textstring> $00 (00)\n\t\t\t// Encrypted datablock   <binary data>\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t$frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\t$frame_offset = $frame_terminatorpos + strlen(\"\\x00\");\n\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t$parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\t$parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']);\n\t\t\t$frame_offset = $frame_terminatorpos + strlen(\"\\x00\");\n\n\t\t\t$parsedFrame['ownerid']     = $frame_ownerid;\n\t\t\t$parsedFrame['data']        = (string) substr($parsedFrame['data'], $frame_offset);\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'AENC')) || // 4.19  AENC Audio encryption\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'CRA'))) {     // 4.21  CRA  Audio encryption\n\t\t\t//   There may be more than one 'AENC' frames in a tag,\n\t\t\t//   but only one with the same 'Owner identifier'\n\t\t\t// <Header for 'Audio encryption', ID: 'AENC'>\n\t\t\t// Owner identifier   <text string> $00\n\t\t\t// Preview start      $xx xx\n\t\t\t// Preview length     $xx xx\n\t\t\t// Encryption info    <binary data>\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t$frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\tif (ord($frame_ownerid) === 0) {\n\t\t\t\t$frame_ownerid = '';\n\t\t\t}\n\t\t\t$frame_offset = $frame_terminatorpos + strlen(\"\\x00\");\n\t\t\t$parsedFrame['ownerid'] = $frame_ownerid;\n\t\t\t$parsedFrame['previewstart'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));\n\t\t\t$frame_offset += 2;\n\t\t\t$parsedFrame['previewlength'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));\n\t\t\t$frame_offset += 2;\n\t\t\t$parsedFrame['encryptioninfo'] = (string) substr($parsedFrame['data'], $frame_offset);\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'LINK')) || // 4.20  LINK Linked information\n\t\t\t\t(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'LNK'))) {    // 4.22  LNK  Linked information\n\t\t\t//   There may be more than one 'LINK' frame in a tag,\n\t\t\t//   but only one with the same contents\n\t\t\t// <Header for 'Linked information', ID: 'LINK'>\n\t\t\t// ID3v2.3+ => Frame identifier   $xx xx xx xx\n\t\t\t// ID3v2.2  => Frame identifier   $xx xx xx\n\t\t\t// URL                            <text string> $00\n\t\t\t// ID and additional data         <text string(s)>\n\n\t\t\t$frame_offset = 0;\n\t\t\tif ($id3v2_majorversion == 2) {\n\t\t\t\t$parsedFrame['frameid'] = substr($parsedFrame['data'], $frame_offset, 3);\n\t\t\t\t$frame_offset += 3;\n\t\t\t} else {\n\t\t\t\t$parsedFrame['frameid'] = substr($parsedFrame['data'], $frame_offset, 4);\n\t\t\t\t$frame_offset += 4;\n\t\t\t}\n\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t$frame_url = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\tif (ord($frame_url) === 0) {\n\t\t\t\t$frame_url = '';\n\t\t\t}\n\t\t\t$frame_offset = $frame_terminatorpos + strlen(\"\\x00\");\n\t\t\t$parsedFrame['url'] = $frame_url;\n\n\t\t\t$parsedFrame['additionaldata'] = (string) substr($parsedFrame['data'], $frame_offset);\n\t\t\tif (!empty($parsedFrame['framenameshort']) && $parsedFrame['url']) {\n\t\t\t\t$info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback_iso88591_utf8($parsedFrame['url']);\n\t\t\t}\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'POSS')) { // 4.21  POSS Position synchronisation frame (ID3v2.3+ only)\n\t\t\t//   There may only be one 'POSS' frame in each tag\n\t\t\t// <Head for 'Position synchronisation', ID: 'POSS'>\n\t\t\t// Time stamp format         $xx\n\t\t\t// Position                  $xx (xx ...)\n\n\t\t\t$frame_offset = 0;\n\t\t\t$parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$parsedFrame['position']        = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset));\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'USER')) { // 4.22  USER Terms of use (ID3v2.3+ only)\n\t\t\t//   There may be more than one 'Terms of use' frame in a tag,\n\t\t\t//   but only one with the same 'Language'\n\t\t\t// <Header for 'Terms of use frame', ID: 'USER'>\n\t\t\t// Text encoding        $xx\n\t\t\t// Language             $xx xx xx\n\t\t\t// The actual text      <text string according to encoding>\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\tif ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {\n\t\t\t\t$this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame \"'.$parsedFrame['frame_name'].'\" - defaulting to ISO-8859-1 encoding');\n\t\t\t}\n\t\t\t$frame_language = substr($parsedFrame['data'], $frame_offset, 3);\n\t\t\t$frame_offset += 3;\n\t\t\t$parsedFrame['language']     = $frame_language;\n\t\t\t$parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false);\n\t\t\t$parsedFrame['encodingid']   = $frame_textencoding;\n\t\t\t$parsedFrame['encoding']     = $this->TextEncodingNameLookup($frame_textencoding);\n\n\t\t\t$parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset);\n\t\t\t$parsedFrame['data'] = $this->RemoveStringTerminator($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding));\n\t\t\tif (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {\n\t\t\t\t$info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']);\n\t\t\t}\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'OWNE')) { // 4.23  OWNE Ownership frame (ID3v2.3+ only)\n\t\t\t//   There may only be one 'OWNE' frame in a tag\n\t\t\t// <Header for 'Ownership frame', ID: 'OWNE'>\n\t\t\t// Text encoding     $xx\n\t\t\t// Price paid        <text string> $00\n\t\t\t// Date of purch.    <text string>\n\t\t\t// Seller            <text string according to encoding>\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\tif ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {\n\t\t\t\t$this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame \"'.$parsedFrame['frame_name'].'\" - defaulting to ISO-8859-1 encoding');\n\t\t\t}\n\t\t\t$parsedFrame['encodingid'] = $frame_textencoding;\n\t\t\t$parsedFrame['encoding']   = $this->TextEncodingNameLookup($frame_textencoding);\n\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t$frame_pricepaid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\t$frame_offset = $frame_terminatorpos + strlen(\"\\x00\");\n\n\t\t\t$parsedFrame['pricepaid']['currencyid'] = substr($frame_pricepaid, 0, 3);\n\t\t\t$parsedFrame['pricepaid']['currency']   = $this->LookupCurrencyUnits($parsedFrame['pricepaid']['currencyid']);\n\t\t\t$parsedFrame['pricepaid']['value']      = substr($frame_pricepaid, 3);\n\n\t\t\t$parsedFrame['purchasedate'] = substr($parsedFrame['data'], $frame_offset, 8);\n\t\t\tif ($this->IsValidDateStampString($parsedFrame['purchasedate'])) {\n\t\t\t\t$parsedFrame['purchasedateunix'] = mktime (0, 0, 0, substr($parsedFrame['purchasedate'], 4, 2), substr($parsedFrame['purchasedate'], 6, 2), substr($parsedFrame['purchasedate'], 0, 4));\n\t\t\t}\n\t\t\t$frame_offset += 8;\n\n\t\t\t$parsedFrame['seller'] = (string) substr($parsedFrame['data'], $frame_offset);\n\t\t\t$parsedFrame['seller'] = $this->RemoveStringTerminator($parsedFrame['seller'], $this->TextEncodingTerminatorLookup($frame_textencoding));\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'COMR')) { // 4.24  COMR Commercial frame (ID3v2.3+ only)\n\t\t\t//   There may be more than one 'commercial frame' in a tag,\n\t\t\t//   but no two may be identical\n\t\t\t// <Header for 'Commercial frame', ID: 'COMR'>\n\t\t\t// Text encoding      $xx\n\t\t\t// Price string       <text string> $00\n\t\t\t// Valid until        <text string>\n\t\t\t// Contact URL        <text string> $00\n\t\t\t// Received as        $xx\n\t\t\t// Name of seller     <text string according to encoding> $00 (00)\n\t\t\t// Description        <text string according to encoding> $00 (00)\n\t\t\t// Picture MIME type  <string> $00\n\t\t\t// Seller logo        <binary data>\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);\n\t\t\tif ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {\n\t\t\t\t$this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame \"'.$parsedFrame['frame_name'].'\" - defaulting to ISO-8859-1 encoding');\n\t\t\t\t$frame_textencoding_terminator = \"\\x00\";\n\t\t\t}\n\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t$frame_pricestring = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\t$frame_offset = $frame_terminatorpos + strlen(\"\\x00\");\n\t\t\t$frame_rawpricearray = explode('/', $frame_pricestring);\n\t\t\tforeach ($frame_rawpricearray as $key => $val) {\n\t\t\t\t$frame_currencyid = substr($val, 0, 3);\n\t\t\t\t$parsedFrame['price'][$frame_currencyid]['currency'] = $this->LookupCurrencyUnits($frame_currencyid);\n\t\t\t\t$parsedFrame['price'][$frame_currencyid]['value']    = substr($val, 3);\n\t\t\t}\n\n\t\t\t$frame_datestring = substr($parsedFrame['data'], $frame_offset, 8);\n\t\t\t$frame_offset += 8;\n\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t$frame_contacturl = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\t$frame_offset = $frame_terminatorpos + strlen(\"\\x00\");\n\n\t\t\t$frame_receivedasid = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);\n\t\t\tif (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {\n\t\t\t\t$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00\n\t\t\t}\n\t\t\t$frame_sellername = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\tif (ord($frame_sellername) === 0) {\n\t\t\t\t$frame_sellername = '';\n\t\t\t}\n\t\t\t$frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator);\n\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);\n\t\t\tif (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {\n\t\t\t\t$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00\n\t\t\t}\n\t\t\t$parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\t$parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']);\n\t\t\t$frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator);\n\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t$frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\t$frame_offset = $frame_terminatorpos + strlen(\"\\x00\");\n\n\t\t\t$frame_sellerlogo = substr($parsedFrame['data'], $frame_offset);\n\n\t\t\t$parsedFrame['encodingid']        = $frame_textencoding;\n\t\t\t$parsedFrame['encoding']          = $this->TextEncodingNameLookup($frame_textencoding);\n\n\t\t\t$parsedFrame['pricevaliduntil']   = $frame_datestring;\n\t\t\t$parsedFrame['contacturl']        = $frame_contacturl;\n\t\t\t$parsedFrame['receivedasid']      = $frame_receivedasid;\n\t\t\t$parsedFrame['receivedas']        = $this->COMRReceivedAsLookup($frame_receivedasid);\n\t\t\t$parsedFrame['sellername']        = $frame_sellername;\n\t\t\t$parsedFrame['mime']              = $frame_mimetype;\n\t\t\t$parsedFrame['logo']              = $frame_sellerlogo;\n\t\t\tunset($parsedFrame['data']);\n\n\n\t\t} elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'ENCR')) { // 4.25  ENCR Encryption method registration (ID3v2.3+ only)\n\t\t\t//   There may be several 'ENCR' frames in a tag,\n\t\t\t//   but only one containing the same symbol\n\t\t\t//   and only one containing the same owner identifier\n\t\t\t// <Header for 'Encryption method registration', ID: 'ENCR'>\n\t\t\t// Owner identifier    <text string> $00\n\t\t\t// Method symbol       $xx\n\t\t\t// Encryption data     <binary data>\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t$frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\tif (ord($frame_ownerid) === 0) {\n\t\t\t\t$frame_ownerid = '';\n\t\t\t}\n\t\t\t$frame_offset = $frame_terminatorpos + strlen(\"\\x00\");\n\n\t\t\t$parsedFrame['ownerid']      = $frame_ownerid;\n\t\t\t$parsedFrame['methodsymbol'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$parsedFrame['data']         = (string) substr($parsedFrame['data'], $frame_offset);\n\n\n\t\t} elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'GRID')) { // 4.26  GRID Group identification registration (ID3v2.3+ only)\n\n\t\t\t//   There may be several 'GRID' frames in a tag,\n\t\t\t//   but only one containing the same symbol\n\t\t\t//   and only one containing the same owner identifier\n\t\t\t// <Header for 'Group ID registration', ID: 'GRID'>\n\t\t\t// Owner identifier      <text string> $00\n\t\t\t// Group symbol          $xx\n\t\t\t// Group dependent data  <binary data>\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t$frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\tif (ord($frame_ownerid) === 0) {\n\t\t\t\t$frame_ownerid = '';\n\t\t\t}\n\t\t\t$frame_offset = $frame_terminatorpos + strlen(\"\\x00\");\n\n\t\t\t$parsedFrame['ownerid']       = $frame_ownerid;\n\t\t\t$parsedFrame['groupsymbol']   = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$parsedFrame['data']          = (string) substr($parsedFrame['data'], $frame_offset);\n\n\n\t\t} elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'PRIV')) { // 4.27  PRIV Private frame (ID3v2.3+ only)\n\t\t\t//   The tag may contain more than one 'PRIV' frame\n\t\t\t//   but only with different contents\n\t\t\t// <Header for 'Private frame', ID: 'PRIV'>\n\t\t\t// Owner identifier      <text string> $00\n\t\t\t// The private data      <binary data>\n\n\t\t\t$frame_offset = 0;\n\t\t\t$frame_terminatorpos = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t$frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);\n\t\t\tif (ord($frame_ownerid) === 0) {\n\t\t\t\t$frame_ownerid = '';\n\t\t\t}\n\t\t\t$frame_offset = $frame_terminatorpos + strlen(\"\\x00\");\n\n\t\t\t$parsedFrame['ownerid'] = $frame_ownerid;\n\t\t\t$parsedFrame['data']    = (string) substr($parsedFrame['data'], $frame_offset);\n\n\n\t\t} elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'SIGN')) { // 4.28  SIGN Signature frame (ID3v2.4+ only)\n\t\t\t//   There may be more than one 'signature frame' in a tag,\n\t\t\t//   but no two may be identical\n\t\t\t// <Header for 'Signature frame', ID: 'SIGN'>\n\t\t\t// Group symbol      $xx\n\t\t\t// Signature         <binary data>\n\n\t\t\t$frame_offset = 0;\n\t\t\t$parsedFrame['groupsymbol'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$parsedFrame['data']        = (string) substr($parsedFrame['data'], $frame_offset);\n\n\n\t\t} elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'SEEK')) { // 4.29  SEEK Seek frame (ID3v2.4+ only)\n\t\t\t//   There may only be one 'seek frame' in a tag\n\t\t\t// <Header for 'Seek frame', ID: 'SEEK'>\n\t\t\t// Minimum offset to next tag       $xx xx xx xx\n\n\t\t\t$frame_offset = 0;\n\t\t\t$parsedFrame['data']          = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));\n\n\n\t\t} elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'ASPI')) { // 4.30  ASPI Audio seek point index (ID3v2.4+ only)\n\t\t\t//   There may only be one 'audio seek point index' frame in a tag\n\t\t\t// <Header for 'Seek Point Index', ID: 'ASPI'>\n\t\t\t// Indexed data start (S)         $xx xx xx xx\n\t\t\t// Indexed data length (L)        $xx xx xx xx\n\t\t\t// Number of index points (N)     $xx xx\n\t\t\t// Bits per index point (b)       $xx\n\t\t\t//   Then for every index point the following data is included:\n\t\t\t// Fraction at index (Fi)          $xx (xx)\n\n\t\t\t$frame_offset = 0;\n\t\t\t$parsedFrame['datastart'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));\n\t\t\t$frame_offset += 4;\n\t\t\t$parsedFrame['indexeddatalength'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));\n\t\t\t$frame_offset += 4;\n\t\t\t$parsedFrame['indexpoints'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));\n\t\t\t$frame_offset += 2;\n\t\t\t$parsedFrame['bitsperpoint'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));\n\t\t\t$frame_bytesperpoint = ceil($parsedFrame['bitsperpoint'] / 8);\n\t\t\tfor ($i = 0; $i < $parsedFrame['indexpoints']; $i++) {\n\t\t\t\t$parsedFrame['indexes'][$i] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesperpoint));\n\t\t\t\t$frame_offset += $frame_bytesperpoint;\n\t\t\t}\n\t\t\tunset($parsedFrame['data']);\n\n\t\t} elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'RGAD')) { // Replay Gain Adjustment\n\t\t\t// http://privatewww.essex.ac.uk/~djmrob/replaygain/file_format_id3v2.html\n\t\t\t//   There may only be one 'RGAD' frame in a tag\n\t\t\t// <Header for 'Replay Gain Adjustment', ID: 'RGAD'>\n\t\t\t// Peak Amplitude                      $xx $xx $xx $xx\n\t\t\t// Radio Replay Gain Adjustment        %aaabbbcd %dddddddd\n\t\t\t// Audiophile Replay Gain Adjustment   %aaabbbcd %dddddddd\n\t\t\t//   a - name code\n\t\t\t//   b - originator code\n\t\t\t//   c - sign bit\n\t\t\t//   d - replay gain adjustment\n\n\t\t\t$frame_offset = 0;\n\t\t\t$parsedFrame['peakamplitude'] = getid3_lib::BigEndian2Float(substr($parsedFrame['data'], $frame_offset, 4));\n\t\t\t$frame_offset += 4;\n\t\t\t$rg_track_adjustment = getid3_lib::Dec2Bin(substr($parsedFrame['data'], $frame_offset, 2));\n\t\t\t$frame_offset += 2;\n\t\t\t$rg_album_adjustment = getid3_lib::Dec2Bin(substr($parsedFrame['data'], $frame_offset, 2));\n\t\t\t$frame_offset += 2;\n\t\t\t$parsedFrame['raw']['track']['name']       = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 0, 3));\n\t\t\t$parsedFrame['raw']['track']['originator'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 3, 3));\n\t\t\t$parsedFrame['raw']['track']['signbit']    = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 6, 1));\n\t\t\t$parsedFrame['raw']['track']['adjustment'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 7, 9));\n\t\t\t$parsedFrame['raw']['album']['name']       = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 0, 3));\n\t\t\t$parsedFrame['raw']['album']['originator'] = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 3, 3));\n\t\t\t$parsedFrame['raw']['album']['signbit']    = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 6, 1));\n\t\t\t$parsedFrame['raw']['album']['adjustment'] = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 7, 9));\n\t\t\t$parsedFrame['track']['name']       = getid3_lib::RGADnameLookup($parsedFrame['raw']['track']['name']);\n\t\t\t$parsedFrame['track']['originator'] = getid3_lib::RGADoriginatorLookup($parsedFrame['raw']['track']['originator']);\n\t\t\t$parsedFrame['track']['adjustment'] = getid3_lib::RGADadjustmentLookup($parsedFrame['raw']['track']['adjustment'], $parsedFrame['raw']['track']['signbit']);\n\t\t\t$parsedFrame['album']['name']       = getid3_lib::RGADnameLookup($parsedFrame['raw']['album']['name']);\n\t\t\t$parsedFrame['album']['originator'] = getid3_lib::RGADoriginatorLookup($parsedFrame['raw']['album']['originator']);\n\t\t\t$parsedFrame['album']['adjustment'] = getid3_lib::RGADadjustmentLookup($parsedFrame['raw']['album']['adjustment'], $parsedFrame['raw']['album']['signbit']);\n\n\t\t\t$info['replay_gain']['track']['peak']       = $parsedFrame['peakamplitude'];\n\t\t\t$info['replay_gain']['track']['originator'] = $parsedFrame['track']['originator'];\n\t\t\t$info['replay_gain']['track']['adjustment'] = $parsedFrame['track']['adjustment'];\n\t\t\t$info['replay_gain']['album']['originator'] = $parsedFrame['album']['originator'];\n\t\t\t$info['replay_gain']['album']['adjustment'] = $parsedFrame['album']['adjustment'];\n\n\t\t\tunset($parsedFrame['data']);\n\n\t\t} elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'CHAP')) { // CHAP Chapters frame (ID3v2.3+ only)\n\t\t\t// http://id3.org/id3v2-chapters-1.0\n\t\t\t// <ID3v2.3 or ID3v2.4 frame header, ID: \"CHAP\">           (10 bytes)\n\t\t\t// Element ID      <text string> $00\n\t\t\t// Start time      $xx xx xx xx\n\t\t\t// End time        $xx xx xx xx\n\t\t\t// Start offset    $xx xx xx xx\n\t\t\t// End offset      $xx xx xx xx\n\t\t\t// <Optional embedded sub-frames>\n\n\t\t\t$frame_offset = 0;\n\t\t\t@list($parsedFrame['element_id']) = explode(\"\\x00\", $parsedFrame['data'], 2);\n\t\t\t$frame_offset += strlen($parsedFrame['element_id'].\"\\x00\");\n\t\t\t$parsedFrame['time_begin'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));\n\t\t\t$frame_offset += 4;\n\t\t\t$parsedFrame['time_end']   = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));\n\t\t\t$frame_offset += 4;\n\t\t\tif (substr($parsedFrame['data'], $frame_offset, 4) != \"\\xFF\\xFF\\xFF\\xFF\") {\n\t\t\t\t// \"If these bytes are all set to 0xFF then the value should be ignored and the start time value should be utilized.\"\n\t\t\t\t$parsedFrame['offset_begin'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));\n\t\t\t}\n\t\t\t$frame_offset += 4;\n\t\t\tif (substr($parsedFrame['data'], $frame_offset, 4) != \"\\xFF\\xFF\\xFF\\xFF\") {\n\t\t\t\t// \"If these bytes are all set to 0xFF then the value should be ignored and the start time value should be utilized.\"\n\t\t\t\t$parsedFrame['offset_end']   = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));\n\t\t\t}\n\t\t\t$frame_offset += 4;\n\n\t\t\tif ($frame_offset < strlen($parsedFrame['data'])) {\n\t\t\t\t$parsedFrame['subframes'] = array();\n\t\t\t\twhile ($frame_offset < strlen($parsedFrame['data'])) {\n\t\t\t\t\t// <Optional embedded sub-frames>\n\t\t\t\t\t$subframe = array();\n\t\t\t\t\t$subframe['name']      =                           substr($parsedFrame['data'], $frame_offset, 4);\n\t\t\t\t\t$frame_offset += 4;\n\t\t\t\t\t$subframe['size']      = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));\n\t\t\t\t\t$frame_offset += 4;\n\t\t\t\t\t$subframe['flags_raw'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));\n\t\t\t\t\t$frame_offset += 2;\n\t\t\t\t\tif ($subframe['size'] > (strlen($parsedFrame['data']) - $frame_offset)) {\n\t\t\t\t\t\t$this->warning('CHAP subframe \"'.$subframe['name'].'\" at frame offset '.$frame_offset.' claims to be \"'.$subframe['size'].'\" bytes, which is more than the available data ('.(strlen($parsedFrame['data']) - $frame_offset).' bytes)');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$subframe_rawdata = substr($parsedFrame['data'], $frame_offset, $subframe['size']);\n\t\t\t\t\t$frame_offset += $subframe['size'];\n\n\t\t\t\t\t$subframe['encodingid'] = ord(substr($subframe_rawdata, 0, 1));\n\t\t\t\t\t$subframe['text']       =     substr($subframe_rawdata, 1);\n\t\t\t\t\t$subframe['encoding']   = $this->TextEncodingNameLookup($subframe['encodingid']);\n\t\t\t\t\t$encoding_converted_text = trim(getid3_lib::iconv_fallback($subframe['encoding'], $info['encoding'], $subframe['text']));\n\t\t\t\t\tswitch (substr($encoding_converted_text, 0, 2)) {\n\t\t\t\t\t\tcase \"\\xFF\\xFE\":\n\t\t\t\t\t\tcase \"\\xFE\\xFF\":\n\t\t\t\t\t\t\tswitch (strtoupper($info['id3v2']['encoding'])) {\n\t\t\t\t\t\t\t\tcase 'ISO-8859-1':\n\t\t\t\t\t\t\t\tcase 'UTF-8':\n\t\t\t\t\t\t\t\t\t$encoding_converted_text = substr($encoding_converted_text, 2);\n\t\t\t\t\t\t\t\t\t// remove unwanted byte-order-marks\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t// ignore\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t// do not remove BOM\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch ($subframe['name']) {\n\t\t\t\t\t\tcase 'TIT2':\n\t\t\t\t\t\t\t$parsedFrame['chapter_name']        = $encoding_converted_text;\n\t\t\t\t\t\t\t$parsedFrame['subframes'][] = $subframe;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'TIT3':\n\t\t\t\t\t\t\t$parsedFrame['chapter_description'] = $encoding_converted_text;\n\t\t\t\t\t\t\t$parsedFrame['subframes'][] = $subframe;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'WXXX':\n\t\t\t\t\t\t\tlist($subframe['chapter_url_description'], $subframe['chapter_url']) = explode(\"\\x00\", $encoding_converted_text, 2);\n\t\t\t\t\t\t\t$parsedFrame['chapter_url'][$subframe['chapter_url_description']] = $subframe['chapter_url'];\n\t\t\t\t\t\t\t$parsedFrame['subframes'][] = $subframe;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'APIC':\n\t\t\t\t\t\t\tif (preg_match('#^([^\\\\x00]+)*\\\\x00(.)([^\\\\x00]+)*\\\\x00(.+)$#s', $subframe['text'], $matches)) {\n\t\t\t\t\t\t\t\tlist($dummy, $subframe_apic_mime, $subframe_apic_picturetype, $subframe_apic_description, $subframe_apic_picturedata) = $matches;\n\t\t\t\t\t\t\t\t$subframe['image_mime']   = trim(getid3_lib::iconv_fallback($subframe['encoding'], $info['encoding'], $subframe_apic_mime));\n\t\t\t\t\t\t\t\t$subframe['picture_type'] = $this->APICPictureTypeLookup($subframe_apic_picturetype);\n\t\t\t\t\t\t\t\t$subframe['description']  = trim(getid3_lib::iconv_fallback($subframe['encoding'], $info['encoding'], $subframe_apic_description));\n\t\t\t\t\t\t\t\tif (strlen($this->TextEncodingTerminatorLookup($subframe['encoding'])) == 2) {\n\t\t\t\t\t\t\t\t\t// the null terminator between \"description\" and \"picture data\" could be either 1 byte (ISO-8859-1, UTF-8) or two bytes (UTF-16)\n\t\t\t\t\t\t\t\t\t// the above regex assumes one byte, if it's actually two then strip the second one here\n\t\t\t\t\t\t\t\t\t$subframe_apic_picturedata = substr($subframe_apic_picturedata, 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$subframe['data'] = $subframe_apic_picturedata;\n\t\t\t\t\t\t\t\tunset($dummy, $subframe_apic_mime, $subframe_apic_picturetype, $subframe_apic_description, $subframe_apic_picturedata);\n\t\t\t\t\t\t\t\tunset($subframe['text'], $parsedFrame['text']);\n\t\t\t\t\t\t\t\t$parsedFrame['subframes'][] = $subframe;\n\t\t\t\t\t\t\t\t$parsedFrame['picture_present'] = true;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->warning('ID3v2.CHAP subframe #'.(count($parsedFrame['subframes']) + 1).' \"'.$subframe['name'].'\" not in expected format');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$this->warning('ID3v2.CHAP subframe \"'.$subframe['name'].'\" not handled (supported: TIT2, TIT3, WXXX, APIC)');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tunset($subframe_rawdata, $subframe, $encoding_converted_text);\n\t\t\t\tunset($parsedFrame['data']); // debatable whether this this be here, without it the returned structure may contain a large amount of duplicate data if chapters contain APIC\n\t\t\t}\n\n\t\t\t$id3v2_chapter_entry = array();\n\t\t\tforeach (array('id', 'time_begin', 'time_end', 'offset_begin', 'offset_end', 'chapter_name', 'chapter_description', 'chapter_url', 'picture_present') as $id3v2_chapter_key) {\n\t\t\t\tif (isset($parsedFrame[$id3v2_chapter_key])) {\n\t\t\t\t\t$id3v2_chapter_entry[$id3v2_chapter_key] = $parsedFrame[$id3v2_chapter_key];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!isset($info['id3v2']['chapters'])) {\n\t\t\t\t$info['id3v2']['chapters'] = array();\n\t\t\t}\n\t\t\t$info['id3v2']['chapters'][] = $id3v2_chapter_entry;\n\t\t\tunset($id3v2_chapter_entry, $id3v2_chapter_key);\n\n\n\t\t} elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'CTOC')) { // CTOC Chapters Table Of Contents frame (ID3v2.3+ only)\n\t\t\t// http://id3.org/id3v2-chapters-1.0\n\t\t\t// <ID3v2.3 or ID3v2.4 frame header, ID: \"CTOC\">           (10 bytes)\n\t\t\t// Element ID      <text string> $00\n\t\t\t// CTOC flags        %xx\n\t\t\t// Entry count       $xx\n\t\t\t// Child Element ID  <string>$00   /* zero or more child CHAP or CTOC entries */\n\t\t\t// <Optional embedded sub-frames>\n\n\t\t\t$frame_offset = 0;\n\t\t\t@list($parsedFrame['element_id']) = explode(\"\\x00\", $parsedFrame['data'], 2);\n\t\t\t$frame_offset += strlen($parsedFrame['element_id'].\"\\x00\");\n\t\t\t$ctoc_flags_raw = ord(substr($parsedFrame['data'], $frame_offset, 1));\n\t\t\t$frame_offset += 1;\n\t\t\t$parsedFrame['entry_count'] = ord(substr($parsedFrame['data'], $frame_offset, 1));\n\t\t\t$frame_offset += 1;\n\n\t\t\t$terminator_position = null;\n\t\t\tfor ($i = 0; $i < $parsedFrame['entry_count']; $i++) {\n\t\t\t\t$terminator_position = strpos($parsedFrame['data'], \"\\x00\", $frame_offset);\n\t\t\t\t$parsedFrame['child_element_ids'][$i] = substr($parsedFrame['data'], $frame_offset, $terminator_position - $frame_offset);\n\t\t\t\t$frame_offset = $terminator_position + 1;\n\t\t\t}\n\n\t\t\t$parsedFrame['ctoc_flags']['ordered']   = (bool) ($ctoc_flags_raw & 0x01);\n\t\t\t$parsedFrame['ctoc_flags']['top_level'] = (bool) ($ctoc_flags_raw & 0x03);\n\n\t\t\tunset($ctoc_flags_raw, $terminator_position);\n\n\t\t\tif ($frame_offset < strlen($parsedFrame['data'])) {\n\t\t\t\t$parsedFrame['subframes'] = array();\n\t\t\t\twhile ($frame_offset < strlen($parsedFrame['data'])) {\n\t\t\t\t\t// <Optional embedded sub-frames>\n\t\t\t\t\t$subframe = array();\n\t\t\t\t\t$subframe['name']      =                           substr($parsedFrame['data'], $frame_offset, 4);\n\t\t\t\t\t$frame_offset += 4;\n\t\t\t\t\t$subframe['size']      = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));\n\t\t\t\t\t$frame_offset += 4;\n\t\t\t\t\t$subframe['flags_raw'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));\n\t\t\t\t\t$frame_offset += 2;\n\t\t\t\t\tif ($subframe['size'] > (strlen($parsedFrame['data']) - $frame_offset)) {\n\t\t\t\t\t\t$this->warning('CTOS subframe \"'.$subframe['name'].'\" at frame offset '.$frame_offset.' claims to be \"'.$subframe['size'].'\" bytes, which is more than the available data ('.(strlen($parsedFrame['data']) - $frame_offset).' bytes)');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$subframe_rawdata = substr($parsedFrame['data'], $frame_offset, $subframe['size']);\n\t\t\t\t\t$frame_offset += $subframe['size'];\n\n\t\t\t\t\t$subframe['encodingid'] = ord(substr($subframe_rawdata, 0, 1));\n\t\t\t\t\t$subframe['text']       =     substr($subframe_rawdata, 1);\n\t\t\t\t\t$subframe['encoding']   = $this->TextEncodingNameLookup($subframe['encodingid']);\n\t\t\t\t\t$encoding_converted_text = trim(getid3_lib::iconv_fallback($subframe['encoding'], $info['encoding'], $subframe['text']));;\n\t\t\t\t\tswitch (substr($encoding_converted_text, 0, 2)) {\n\t\t\t\t\t\tcase \"\\xFF\\xFE\":\n\t\t\t\t\t\tcase \"\\xFE\\xFF\":\n\t\t\t\t\t\t\tswitch (strtoupper($info['id3v2']['encoding'])) {\n\t\t\t\t\t\t\t\tcase 'ISO-8859-1':\n\t\t\t\t\t\t\t\tcase 'UTF-8':\n\t\t\t\t\t\t\t\t\t$encoding_converted_text = substr($encoding_converted_text, 2);\n\t\t\t\t\t\t\t\t\t// remove unwanted byte-order-marks\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t// ignore\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t// do not remove BOM\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (($subframe['name'] == 'TIT2') || ($subframe['name'] == 'TIT3')) {\n\t\t\t\t\t\tif ($subframe['name'] == 'TIT2') {\n\t\t\t\t\t\t\t$parsedFrame['toc_name']        = $encoding_converted_text;\n\t\t\t\t\t\t} elseif ($subframe['name'] == 'TIT3') {\n\t\t\t\t\t\t\t$parsedFrame['toc_description'] = $encoding_converted_text;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$parsedFrame['subframes'][] = $subframe;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->warning('ID3v2.CTOC subframe \"'.$subframe['name'].'\" not handled (only TIT2 and TIT3)');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tunset($subframe_rawdata, $subframe, $encoding_converted_text);\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $data\n\t *\n\t * @return string\n\t */\n\tpublic function DeUnsynchronise($data) {\n\t\treturn str_replace(\"\\xFF\\x00\", \"\\xFF\", $data);\n\t}\n\n\t/**\n\t * @param int $index\n\t *\n\t * @return string\n\t */\n\tpublic function LookupExtendedHeaderRestrictionsTagSizeLimits($index) {\n\t\tstatic $LookupExtendedHeaderRestrictionsTagSizeLimits = array(\n\t\t\t0x00 => 'No more than 128 frames and 1 MB total tag size',\n\t\t\t0x01 => 'No more than 64 frames and 128 KB total tag size',\n\t\t\t0x02 => 'No more than 32 frames and 40 KB total tag size',\n\t\t\t0x03 => 'No more than 32 frames and 4 KB total tag size',\n\t\t);\n\t\treturn (isset($LookupExtendedHeaderRestrictionsTagSizeLimits[$index]) ? $LookupExtendedHeaderRestrictionsTagSizeLimits[$index] : '');\n\t}\n\n\t/**\n\t * @param int $index\n\t *\n\t * @return string\n\t */\n\tpublic function LookupExtendedHeaderRestrictionsTextEncodings($index) {\n\t\tstatic $LookupExtendedHeaderRestrictionsTextEncodings = array(\n\t\t\t0x00 => 'No restrictions',\n\t\t\t0x01 => 'Strings are only encoded with ISO-8859-1 or UTF-8',\n\t\t);\n\t\treturn (isset($LookupExtendedHeaderRestrictionsTextEncodings[$index]) ? $LookupExtendedHeaderRestrictionsTextEncodings[$index] : '');\n\t}\n\n\t/**\n\t * @param int $index\n\t *\n\t * @return string\n\t */\n\tpublic function LookupExtendedHeaderRestrictionsTextFieldSize($index) {\n\t\tstatic $LookupExtendedHeaderRestrictionsTextFieldSize = array(\n\t\t\t0x00 => 'No restrictions',\n\t\t\t0x01 => 'No string is longer than 1024 characters',\n\t\t\t0x02 => 'No string is longer than 128 characters',\n\t\t\t0x03 => 'No string is longer than 30 characters',\n\t\t);\n\t\treturn (isset($LookupExtendedHeaderRestrictionsTextFieldSize[$index]) ? $LookupExtendedHeaderRestrictionsTextFieldSize[$index] : '');\n\t}\n\n\t/**\n\t * @param int $index\n\t *\n\t * @return string\n\t */\n\tpublic function LookupExtendedHeaderRestrictionsImageEncoding($index) {\n\t\tstatic $LookupExtendedHeaderRestrictionsImageEncoding = array(\n\t\t\t0x00 => 'No restrictions',\n\t\t\t0x01 => 'Images are encoded only with PNG or JPEG',\n\t\t);\n\t\treturn (isset($LookupExtendedHeaderRestrictionsImageEncoding[$index]) ? $LookupExtendedHeaderRestrictionsImageEncoding[$index] : '');\n\t}\n\n\t/**\n\t * @param int $index\n\t *\n\t * @return string\n\t */\n\tpublic function LookupExtendedHeaderRestrictionsImageSizeSize($index) {\n\t\tstatic $LookupExtendedHeaderRestrictionsImageSizeSize = array(\n\t\t\t0x00 => 'No restrictions',\n\t\t\t0x01 => 'All images are 256x256 pixels or smaller',\n\t\t\t0x02 => 'All images are 64x64 pixels or smaller',\n\t\t\t0x03 => 'All images are exactly 64x64 pixels, unless required otherwise',\n\t\t);\n\t\treturn (isset($LookupExtendedHeaderRestrictionsImageSizeSize[$index]) ? $LookupExtendedHeaderRestrictionsImageSizeSize[$index] : '');\n\t}\n\n\t/**\n\t * @param string $currencyid\n\t *\n\t * @return string\n\t */\n\tpublic function LookupCurrencyUnits($currencyid) {\n\n\t\t$begin = __LINE__;\n\n\t\t/** This is not a comment!\n\n\n\t\t\tAED\tDirhams\n\t\t\tAFA\tAfghanis\n\t\t\tALL\tLeke\n\t\t\tAMD\tDrams\n\t\t\tANG\tGuilders\n\t\t\tAOA\tKwanza\n\t\t\tARS\tPesos\n\t\t\tATS\tSchillings\n\t\t\tAUD\tDollars\n\t\t\tAWG\tGuilders\n\t\t\tAZM\tManats\n\t\t\tBAM\tConvertible Marka\n\t\t\tBBD\tDollars\n\t\t\tBDT\tTaka\n\t\t\tBEF\tFrancs\n\t\t\tBGL\tLeva\n\t\t\tBHD\tDinars\n\t\t\tBIF\tFrancs\n\t\t\tBMD\tDollars\n\t\t\tBND\tDollars\n\t\t\tBOB\tBolivianos\n\t\t\tBRL\tBrazil Real\n\t\t\tBSD\tDollars\n\t\t\tBTN\tNgultrum\n\t\t\tBWP\tPulas\n\t\t\tBYR\tRubles\n\t\t\tBZD\tDollars\n\t\t\tCAD\tDollars\n\t\t\tCDF\tCongolese Francs\n\t\t\tCHF\tFrancs\n\t\t\tCLP\tPesos\n\t\t\tCNY\tYuan Renminbi\n\t\t\tCOP\tPesos\n\t\t\tCRC\tColones\n\t\t\tCUP\tPesos\n\t\t\tCVE\tEscudos\n\t\t\tCYP\tPounds\n\t\t\tCZK\tKoruny\n\t\t\tDEM\tDeutsche Marks\n\t\t\tDJF\tFrancs\n\t\t\tDKK\tKroner\n\t\t\tDOP\tPesos\n\t\t\tDZD\tAlgeria Dinars\n\t\t\tEEK\tKrooni\n\t\t\tEGP\tPounds\n\t\t\tERN\tNakfa\n\t\t\tESP\tPesetas\n\t\t\tETB\tBirr\n\t\t\tEUR\tEuro\n\t\t\tFIM\tMarkkaa\n\t\t\tFJD\tDollars\n\t\t\tFKP\tPounds\n\t\t\tFRF\tFrancs\n\t\t\tGBP\tPounds\n\t\t\tGEL\tLari\n\t\t\tGGP\tPounds\n\t\t\tGHC\tCedis\n\t\t\tGIP\tPounds\n\t\t\tGMD\tDalasi\n\t\t\tGNF\tFrancs\n\t\t\tGRD\tDrachmae\n\t\t\tGTQ\tQuetzales\n\t\t\tGYD\tDollars\n\t\t\tHKD\tDollars\n\t\t\tHNL\tLempiras\n\t\t\tHRK\tKuna\n\t\t\tHTG\tGourdes\n\t\t\tHUF\tForints\n\t\t\tIDR\tRupiahs\n\t\t\tIEP\tPounds\n\t\t\tILS\tNew Shekels\n\t\t\tIMP\tPounds\n\t\t\tINR\tRupees\n\t\t\tIQD\tDinars\n\t\t\tIRR\tRials\n\t\t\tISK\tKronur\n\t\t\tITL\tLire\n\t\t\tJEP\tPounds\n\t\t\tJMD\tDollars\n\t\t\tJOD\tDinars\n\t\t\tJPY\tYen\n\t\t\tKES\tShillings\n\t\t\tKGS\tSoms\n\t\t\tKHR\tRiels\n\t\t\tKMF\tFrancs\n\t\t\tKPW\tWon\n\t\t\tKWD\tDinars\n\t\t\tKYD\tDollars\n\t\t\tKZT\tTenge\n\t\t\tLAK\tKips\n\t\t\tLBP\tPounds\n\t\t\tLKR\tRupees\n\t\t\tLRD\tDollars\n\t\t\tLSL\tMaloti\n\t\t\tLTL\tLitai\n\t\t\tLUF\tFrancs\n\t\t\tLVL\tLati\n\t\t\tLYD\tDinars\n\t\t\tMAD\tDirhams\n\t\t\tMDL\tLei\n\t\t\tMGF\tMalagasy Francs\n\t\t\tMKD\tDenars\n\t\t\tMMK\tKyats\n\t\t\tMNT\tTugriks\n\t\t\tMOP\tPatacas\n\t\t\tMRO\tOuguiyas\n\t\t\tMTL\tLiri\n\t\t\tMUR\tRupees\n\t\t\tMVR\tRufiyaa\n\t\t\tMWK\tKwachas\n\t\t\tMXN\tPesos\n\t\t\tMYR\tRinggits\n\t\t\tMZM\tMeticais\n\t\t\tNAD\tDollars\n\t\t\tNGN\tNairas\n\t\t\tNIO\tGold Cordobas\n\t\t\tNLG\tGuilders\n\t\t\tNOK\tKrone\n\t\t\tNPR\tNepal Rupees\n\t\t\tNZD\tDollars\n\t\t\tOMR\tRials\n\t\t\tPAB\tBalboa\n\t\t\tPEN\tNuevos Soles\n\t\t\tPGK\tKina\n\t\t\tPHP\tPesos\n\t\t\tPKR\tRupees\n\t\t\tPLN\tZlotych\n\t\t\tPTE\tEscudos\n\t\t\tPYG\tGuarani\n\t\t\tQAR\tRials\n\t\t\tROL\tLei\n\t\t\tRUR\tRubles\n\t\t\tRWF\tRwanda Francs\n\t\t\tSAR\tRiyals\n\t\t\tSBD\tDollars\n\t\t\tSCR\tRupees\n\t\t\tSDD\tDinars\n\t\t\tSEK\tKronor\n\t\t\tSGD\tDollars\n\t\t\tSHP\tPounds\n\t\t\tSIT\tTolars\n\t\t\tSKK\tKoruny\n\t\t\tSLL\tLeones\n\t\t\tSOS\tShillings\n\t\t\tSPL\tLuigini\n\t\t\tSRG\tGuilders\n\t\t\tSTD\tDobras\n\t\t\tSVC\tColones\n\t\t\tSYP\tPounds\n\t\t\tSZL\tEmalangeni\n\t\t\tTHB\tBaht\n\t\t\tTJR\tRubles\n\t\t\tTMM\tManats\n\t\t\tTND\tDinars\n\t\t\tTOP\tPa'anga\n\t\t\tTRL\tLiras\n\t\t\tTTD\tDollars\n\t\t\tTVD\tTuvalu Dollars\n\t\t\tTWD\tNew Dollars\n\t\t\tTZS\tShillings\n\t\t\tUAH\tHryvnia\n\t\t\tUGX\tShillings\n\t\t\tUSD\tDollars\n\t\t\tUYU\tPesos\n\t\t\tUZS\tSums\n\t\t\tVAL\tLire\n\t\t\tVEB\tBolivares\n\t\t\tVND\tDong\n\t\t\tVUV\tVatu\n\t\t\tWST\tTala\n\t\t\tXAF\tFrancs\n\t\t\tXAG\tOunces\n\t\t\tXAU\tOunces\n\t\t\tXCD\tDollars\n\t\t\tXDR\tSpecial Drawing Rights\n\t\t\tXPD\tOunces\n\t\t\tXPF\tFrancs\n\t\t\tXPT\tOunces\n\t\t\tYER\tRials\n\t\t\tYUM\tNew Dinars\n\t\t\tZAR\tRand\n\t\t\tZMK\tKwacha\n\t\t\tZWD\tZimbabwe Dollars\n\n\t\t*/\n\n\t\treturn getid3_lib::EmbeddedLookup($currencyid, $begin, __LINE__, __FILE__, 'id3v2-currency-units');\n\t}\n\n\t/**\n\t * @param string $currencyid\n\t *\n\t * @return string\n\t */\n\tpublic function LookupCurrencyCountry($currencyid) {\n\n\t\t$begin = __LINE__;\n\n\t\t/** This is not a comment!\n\n\t\t\tAED\tUnited Arab Emirates\n\t\t\tAFA\tAfghanistan\n\t\t\tALL\tAlbania\n\t\t\tAMD\tArmenia\n\t\t\tANG\tNetherlands Antilles\n\t\t\tAOA\tAngola\n\t\t\tARS\tArgentina\n\t\t\tATS\tAustria\n\t\t\tAUD\tAustralia\n\t\t\tAWG\tAruba\n\t\t\tAZM\tAzerbaijan\n\t\t\tBAM\tBosnia and Herzegovina\n\t\t\tBBD\tBarbados\n\t\t\tBDT\tBangladesh\n\t\t\tBEF\tBelgium\n\t\t\tBGL\tBulgaria\n\t\t\tBHD\tBahrain\n\t\t\tBIF\tBurundi\n\t\t\tBMD\tBermuda\n\t\t\tBND\tBrunei Darussalam\n\t\t\tBOB\tBolivia\n\t\t\tBRL\tBrazil\n\t\t\tBSD\tBahamas\n\t\t\tBTN\tBhutan\n\t\t\tBWP\tBotswana\n\t\t\tBYR\tBelarus\n\t\t\tBZD\tBelize\n\t\t\tCAD\tCanada\n\t\t\tCDF\tCongo/Kinshasa\n\t\t\tCHF\tSwitzerland\n\t\t\tCLP\tChile\n\t\t\tCNY\tChina\n\t\t\tCOP\tColombia\n\t\t\tCRC\tCosta Rica\n\t\t\tCUP\tCuba\n\t\t\tCVE\tCape Verde\n\t\t\tCYP\tCyprus\n\t\t\tCZK\tCzech Republic\n\t\t\tDEM\tGermany\n\t\t\tDJF\tDjibouti\n\t\t\tDKK\tDenmark\n\t\t\tDOP\tDominican Republic\n\t\t\tDZD\tAlgeria\n\t\t\tEEK\tEstonia\n\t\t\tEGP\tEgypt\n\t\t\tERN\tEritrea\n\t\t\tESP\tSpain\n\t\t\tETB\tEthiopia\n\t\t\tEUR\tEuro Member Countries\n\t\t\tFIM\tFinland\n\t\t\tFJD\tFiji\n\t\t\tFKP\tFalkland Islands (Malvinas)\n\t\t\tFRF\tFrance\n\t\t\tGBP\tUnited Kingdom\n\t\t\tGEL\tGeorgia\n\t\t\tGGP\tGuernsey\n\t\t\tGHC\tGhana\n\t\t\tGIP\tGibraltar\n\t\t\tGMD\tGambia\n\t\t\tGNF\tGuinea\n\t\t\tGRD\tGreece\n\t\t\tGTQ\tGuatemala\n\t\t\tGYD\tGuyana\n\t\t\tHKD\tHong Kong\n\t\t\tHNL\tHonduras\n\t\t\tHRK\tCroatia\n\t\t\tHTG\tHaiti\n\t\t\tHUF\tHungary\n\t\t\tIDR\tIndonesia\n\t\t\tIEP\tIreland (Eire)\n\t\t\tILS\tIsrael\n\t\t\tIMP\tIsle of Man\n\t\t\tINR\tIndia\n\t\t\tIQD\tIraq\n\t\t\tIRR\tIran\n\t\t\tISK\tIceland\n\t\t\tITL\tItaly\n\t\t\tJEP\tJersey\n\t\t\tJMD\tJamaica\n\t\t\tJOD\tJordan\n\t\t\tJPY\tJapan\n\t\t\tKES\tKenya\n\t\t\tKGS\tKyrgyzstan\n\t\t\tKHR\tCambodia\n\t\t\tKMF\tComoros\n\t\t\tKPW\tKorea\n\t\t\tKWD\tKuwait\n\t\t\tKYD\tCayman Islands\n\t\t\tKZT\tKazakstan\n\t\t\tLAK\tLaos\n\t\t\tLBP\tLebanon\n\t\t\tLKR\tSri Lanka\n\t\t\tLRD\tLiberia\n\t\t\tLSL\tLesotho\n\t\t\tLTL\tLithuania\n\t\t\tLUF\tLuxembourg\n\t\t\tLVL\tLatvia\n\t\t\tLYD\tLibya\n\t\t\tMAD\tMorocco\n\t\t\tMDL\tMoldova\n\t\t\tMGF\tMadagascar\n\t\t\tMKD\tMacedonia\n\t\t\tMMK\tMyanmar (Burma)\n\t\t\tMNT\tMongolia\n\t\t\tMOP\tMacau\n\t\t\tMRO\tMauritania\n\t\t\tMTL\tMalta\n\t\t\tMUR\tMauritius\n\t\t\tMVR\tMaldives (Maldive Islands)\n\t\t\tMWK\tMalawi\n\t\t\tMXN\tMexico\n\t\t\tMYR\tMalaysia\n\t\t\tMZM\tMozambique\n\t\t\tNAD\tNamibia\n\t\t\tNGN\tNigeria\n\t\t\tNIO\tNicaragua\n\t\t\tNLG\tNetherlands (Holland)\n\t\t\tNOK\tNorway\n\t\t\tNPR\tNepal\n\t\t\tNZD\tNew Zealand\n\t\t\tOMR\tOman\n\t\t\tPAB\tPanama\n\t\t\tPEN\tPeru\n\t\t\tPGK\tPapua New Guinea\n\t\t\tPHP\tPhilippines\n\t\t\tPKR\tPakistan\n\t\t\tPLN\tPoland\n\t\t\tPTE\tPortugal\n\t\t\tPYG\tParaguay\n\t\t\tQAR\tQatar\n\t\t\tROL\tRomania\n\t\t\tRUR\tRussia\n\t\t\tRWF\tRwanda\n\t\t\tSAR\tSaudi Arabia\n\t\t\tSBD\tSolomon Islands\n\t\t\tSCR\tSeychelles\n\t\t\tSDD\tSudan\n\t\t\tSEK\tSweden\n\t\t\tSGD\tSingapore\n\t\t\tSHP\tSaint Helena\n\t\t\tSIT\tSlovenia\n\t\t\tSKK\tSlovakia\n\t\t\tSLL\tSierra Leone\n\t\t\tSOS\tSomalia\n\t\t\tSPL\tSeborga\n\t\t\tSRG\tSuriname\n\t\t\tSTD\tS\u00c3\u00a3o Tome and Principe\n\t\t\tSVC\tEl Salvador\n\t\t\tSYP\tSyria\n\t\t\tSZL\tSwaziland\n\t\t\tTHB\tThailand\n\t\t\tTJR\tTajikistan\n\t\t\tTMM\tTurkmenistan\n\t\t\tTND\tTunisia\n\t\t\tTOP\tTonga\n\t\t\tTRL\tTurkey\n\t\t\tTTD\tTrinidad and Tobago\n\t\t\tTVD\tTuvalu\n\t\t\tTWD\tTaiwan\n\t\t\tTZS\tTanzania\n\t\t\tUAH\tUkraine\n\t\t\tUGX\tUganda\n\t\t\tUSD\tUnited States of America\n\t\t\tUYU\tUruguay\n\t\t\tUZS\tUzbekistan\n\t\t\tVAL\tVatican City\n\t\t\tVEB\tVenezuela\n\t\t\tVND\tViet Nam\n\t\t\tVUV\tVanuatu\n\t\t\tWST\tSamoa\n\t\t\tXAF\tCommunaut\u00c3\u00a9 Financi\u00c3\u00a8re Africaine\n\t\t\tXAG\tSilver\n\t\t\tXAU\tGold\n\t\t\tXCD\tEast Caribbean\n\t\t\tXDR\tInternational Monetary Fund\n\t\t\tXPD\tPalladium\n\t\t\tXPF\tComptoirs Fran\u00c3\u00a7ais du Pacifique\n\t\t\tXPT\tPlatinum\n\t\t\tYER\tYemen\n\t\t\tYUM\tYugoslavia\n\t\t\tZAR\tSouth Africa\n\t\t\tZMK\tZambia\n\t\t\tZWD\tZimbabwe\n\n\t\t*/\n\n\t\treturn getid3_lib::EmbeddedLookup($currencyid, $begin, __LINE__, __FILE__, 'id3v2-currency-country');\n\t}\n\n\t/**\n\t * @param string $languagecode\n\t * @param bool   $casesensitive\n\t *\n\t * @return string\n\t */\n\tpublic static function LanguageLookup($languagecode, $casesensitive=false) {\n\n\t\tif (!$casesensitive) {\n\t\t\t$languagecode = strtolower($languagecode);\n\t\t}\n\n\t\t// http://www.id3.org/id3v2.4.0-structure.txt\n\t\t// [4.   ID3v2 frame overview]\n\t\t// The three byte language field, present in several frames, is used to\n\t\t// describe the language of the frame's content, according to ISO-639-2\n\t\t// [ISO-639-2]. The language should be represented in lower case. If the\n\t\t// language is not known the string \"XXX\" should be used.\n\n\n\t\t// ISO 639-2 - http://www.id3.org/iso639-2.html\n\n\t\t$begin = __LINE__;\n\n\t\t/** This is not a comment!\n\n\t\t\tXXX\tunknown\n\t\t\txxx\tunknown\n\t\t\taar\tAfar\n\t\t\tabk\tAbkhazian\n\t\t\tace\tAchinese\n\t\t\tach\tAcoli\n\t\t\tada\tAdangme\n\t\t\tafa\tAfro-Asiatic (Other)\n\t\t\tafh\tAfrihili\n\t\t\tafr\tAfrikaans\n\t\t\taka\tAkan\n\t\t\takk\tAkkadian\n\t\t\talb\tAlbanian\n\t\t\tale\tAleut\n\t\t\talg\tAlgonquian Languages\n\t\t\tamh\tAmharic\n\t\t\tang\tEnglish, Old (ca. 450-1100)\n\t\t\tapa\tApache Languages\n\t\t\tara\tArabic\n\t\t\tarc\tAramaic\n\t\t\tarm\tArmenian\n\t\t\tarn\tAraucanian\n\t\t\tarp\tArapaho\n\t\t\tart\tArtificial (Other)\n\t\t\tarw\tArawak\n\t\t\tasm\tAssamese\n\t\t\tath\tAthapascan Languages\n\t\t\tava\tAvaric\n\t\t\tave\tAvestan\n\t\t\tawa\tAwadhi\n\t\t\taym\tAymara\n\t\t\taze\tAzerbaijani\n\t\t\tbad\tBanda\n\t\t\tbai\tBamileke Languages\n\t\t\tbak\tBashkir\n\t\t\tbal\tBaluchi\n\t\t\tbam\tBambara\n\t\t\tban\tBalinese\n\t\t\tbaq\tBasque\n\t\t\tbas\tBasa\n\t\t\tbat\tBaltic (Other)\n\t\t\tbej\tBeja\n\t\t\tbel\tByelorussian\n\t\t\tbem\tBemba\n\t\t\tben\tBengali\n\t\t\tber\tBerber (Other)\n\t\t\tbho\tBhojpuri\n\t\t\tbih\tBihari\n\t\t\tbik\tBikol\n\t\t\tbin\tBini\n\t\t\tbis\tBislama\n\t\t\tbla\tSiksika\n\t\t\tbnt\tBantu (Other)\n\t\t\tbod\tTibetan\n\t\t\tbra\tBraj\n\t\t\tbre\tBreton\n\t\t\tbua\tBuriat\n\t\t\tbug\tBuginese\n\t\t\tbul\tBulgarian\n\t\t\tbur\tBurmese\n\t\t\tcad\tCaddo\n\t\t\tcai\tCentral American Indian (Other)\n\t\t\tcar\tCarib\n\t\t\tcat\tCatalan\n\t\t\tcau\tCaucasian (Other)\n\t\t\tceb\tCebuano\n\t\t\tcel\tCeltic (Other)\n\t\t\tces\tCzech\n\t\t\tcha\tChamorro\n\t\t\tchb\tChibcha\n\t\t\tche\tChechen\n\t\t\tchg\tChagatai\n\t\t\tchi\tChinese\n\t\t\tchm\tMari\n\t\t\tchn\tChinook jargon\n\t\t\tcho\tChoctaw\n\t\t\tchr\tCherokee\n\t\t\tchu\tChurch Slavic\n\t\t\tchv\tChuvash\n\t\t\tchy\tCheyenne\n\t\t\tcop\tCoptic\n\t\t\tcor\tCornish\n\t\t\tcos\tCorsican\n\t\t\tcpe\tCreoles and Pidgins, English-based (Other)\n\t\t\tcpf\tCreoles and Pidgins, French-based (Other)\n\t\t\tcpp\tCreoles and Pidgins, Portuguese-based (Other)\n\t\t\tcre\tCree\n\t\t\tcrp\tCreoles and Pidgins (Other)\n\t\t\tcus\tCushitic (Other)\n\t\t\tcym\tWelsh\n\t\t\tcze\tCzech\n\t\t\tdak\tDakota\n\t\t\tdan\tDanish\n\t\t\tdel\tDelaware\n\t\t\tdeu\tGerman\n\t\t\tdin\tDinka\n\t\t\tdiv\tDivehi\n\t\t\tdoi\tDogri\n\t\t\tdra\tDravidian (Other)\n\t\t\tdua\tDuala\n\t\t\tdum\tDutch, Middle (ca. 1050-1350)\n\t\t\tdut\tDutch\n\t\t\tdyu\tDyula\n\t\t\tdzo\tDzongkha\n\t\t\tefi\tEfik\n\t\t\tegy\tEgyptian (Ancient)\n\t\t\teka\tEkajuk\n\t\t\tell\tGreek, Modern (1453-)\n\t\t\telx\tElamite\n\t\t\teng\tEnglish\n\t\t\tenm\tEnglish, Middle (ca. 1100-1500)\n\t\t\tepo\tEsperanto\n\t\t\tesk\tEskimo (Other)\n\t\t\tesl\tSpanish\n\t\t\test\tEstonian\n\t\t\teus\tBasque\n\t\t\tewe\tEwe\n\t\t\tewo\tEwondo\n\t\t\tfan\tFang\n\t\t\tfao\tFaroese\n\t\t\tfas\tPersian\n\t\t\tfat\tFanti\n\t\t\tfij\tFijian\n\t\t\tfin\tFinnish\n\t\t\tfiu\tFinno-Ugrian (Other)\n\t\t\tfon\tFon\n\t\t\tfra\tFrench\n\t\t\tfre\tFrench\n\t\t\tfrm\tFrench, Middle (ca. 1400-1600)\n\t\t\tfro\tFrench, Old (842- ca. 1400)\n\t\t\tfry\tFrisian\n\t\t\tful\tFulah\n\t\t\tgaa\tGa\n\t\t\tgae\tGaelic (Scots)\n\t\t\tgai\tIrish\n\t\t\tgay\tGayo\n\t\t\tgdh\tGaelic (Scots)\n\t\t\tgem\tGermanic (Other)\n\t\t\tgeo\tGeorgian\n\t\t\tger\tGerman\n\t\t\tgez\tGeez\n\t\t\tgil\tGilbertese\n\t\t\tglg\tGallegan\n\t\t\tgmh\tGerman, Middle High (ca. 1050-1500)\n\t\t\tgoh\tGerman, Old High (ca. 750-1050)\n\t\t\tgon\tGondi\n\t\t\tgot\tGothic\n\t\t\tgrb\tGrebo\n\t\t\tgrc\tGreek, Ancient (to 1453)\n\t\t\tgre\tGreek, Modern (1453-)\n\t\t\tgrn\tGuarani\n\t\t\tguj\tGujarati\n\t\t\thai\tHaida\n\t\t\thau\tHausa\n\t\t\thaw\tHawaiian\n\t\t\theb\tHebrew\n\t\t\ther\tHerero\n\t\t\thil\tHiligaynon\n\t\t\thim\tHimachali\n\t\t\thin\tHindi\n\t\t\thmo\tHiri Motu\n\t\t\thun\tHungarian\n\t\t\thup\tHupa\n\t\t\thye\tArmenian\n\t\t\tiba\tIban\n\t\t\tibo\tIgbo\n\t\t\tice\tIcelandic\n\t\t\tijo\tIjo\n\t\t\tiku\tInuktitut\n\t\t\tilo\tIloko\n\t\t\tina\tInterlingua (International Auxiliary language Association)\n\t\t\tinc\tIndic (Other)\n\t\t\tind\tIndonesian\n\t\t\tine\tIndo-European (Other)\n\t\t\tine\tInterlingue\n\t\t\tipk\tInupiak\n\t\t\tira\tIranian (Other)\n\t\t\tiri\tIrish\n\t\t\tiro\tIroquoian uages\n\t\t\tisl\tIcelandic\n\t\t\tita\tItalian\n\t\t\tjav\tJavanese\n\t\t\tjaw\tJavanese\n\t\t\tjpn\tJapanese\n\t\t\tjpr\tJudeo-Persian\n\t\t\tjrb\tJudeo-Arabic\n\t\t\tkaa\tKara-Kalpak\n\t\t\tkab\tKabyle\n\t\t\tkac\tKachin\n\t\t\tkal\tGreenlandic\n\t\t\tkam\tKamba\n\t\t\tkan\tKannada\n\t\t\tkar\tKaren\n\t\t\tkas\tKashmiri\n\t\t\tkat\tGeorgian\n\t\t\tkau\tKanuri\n\t\t\tkaw\tKawi\n\t\t\tkaz\tKazakh\n\t\t\tkha\tKhasi\n\t\t\tkhi\tKhoisan (Other)\n\t\t\tkhm\tKhmer\n\t\t\tkho\tKhotanese\n\t\t\tkik\tKikuyu\n\t\t\tkin\tKinyarwanda\n\t\t\tkir\tKirghiz\n\t\t\tkok\tKonkani\n\t\t\tkom\tKomi\n\t\t\tkon\tKongo\n\t\t\tkor\tKorean\n\t\t\tkpe\tKpelle\n\t\t\tkro\tKru\n\t\t\tkru\tKurukh\n\t\t\tkua\tKuanyama\n\t\t\tkum\tKumyk\n\t\t\tkur\tKurdish\n\t\t\tkus\tKusaie\n\t\t\tkut\tKutenai\n\t\t\tlad\tLadino\n\t\t\tlah\tLahnda\n\t\t\tlam\tLamba\n\t\t\tlao\tLao\n\t\t\tlat\tLatin\n\t\t\tlav\tLatvian\n\t\t\tlez\tLezghian\n\t\t\tlin\tLingala\n\t\t\tlit\tLithuanian\n\t\t\tlol\tMongo\n\t\t\tloz\tLozi\n\t\t\tltz\tLetzeburgesch\n\t\t\tlub\tLuba-Katanga\n\t\t\tlug\tGanda\n\t\t\tlui\tLuiseno\n\t\t\tlun\tLunda\n\t\t\tluo\tLuo (Kenya and Tanzania)\n\t\t\tmac\tMacedonian\n\t\t\tmad\tMadurese\n\t\t\tmag\tMagahi\n\t\t\tmah\tMarshall\n\t\t\tmai\tMaithili\n\t\t\tmak\tMacedonian\n\t\t\tmak\tMakasar\n\t\t\tmal\tMalayalam\n\t\t\tman\tMandingo\n\t\t\tmao\tMaori\n\t\t\tmap\tAustronesian (Other)\n\t\t\tmar\tMarathi\n\t\t\tmas\tMasai\n\t\t\tmax\tManx\n\t\t\tmay\tMalay\n\t\t\tmen\tMende\n\t\t\tmga\tIrish, Middle (900 - 1200)\n\t\t\tmic\tMicmac\n\t\t\tmin\tMinangkabau\n\t\t\tmis\tMiscellaneous (Other)\n\t\t\tmkh\tMon-Kmer (Other)\n\t\t\tmlg\tMalagasy\n\t\t\tmlt\tMaltese\n\t\t\tmni\tManipuri\n\t\t\tmno\tManobo Languages\n\t\t\tmoh\tMohawk\n\t\t\tmol\tMoldavian\n\t\t\tmon\tMongolian\n\t\t\tmos\tMossi\n\t\t\tmri\tMaori\n\t\t\tmsa\tMalay\n\t\t\tmul\tMultiple Languages\n\t\t\tmun\tMunda Languages\n\t\t\tmus\tCreek\n\t\t\tmwr\tMarwari\n\t\t\tmya\tBurmese\n\t\t\tmyn\tMayan Languages\n\t\t\tnah\tAztec\n\t\t\tnai\tNorth American Indian (Other)\n\t\t\tnau\tNauru\n\t\t\tnav\tNavajo\n\t\t\tnbl\tNdebele, South\n\t\t\tnde\tNdebele, North\n\t\t\tndo\tNdongo\n\t\t\tnep\tNepali\n\t\t\tnew\tNewari\n\t\t\tnic\tNiger-Kordofanian (Other)\n\t\t\tniu\tNiuean\n\t\t\tnla\tDutch\n\t\t\tnno\tNorwegian (Nynorsk)\n\t\t\tnon\tNorse, Old\n\t\t\tnor\tNorwegian\n\t\t\tnso\tSotho, Northern\n\t\t\tnub\tNubian Languages\n\t\t\tnya\tNyanja\n\t\t\tnym\tNyamwezi\n\t\t\tnyn\tNyankole\n\t\t\tnyo\tNyoro\n\t\t\tnzi\tNzima\n\t\t\toci\tLangue d'Oc (post 1500)\n\t\t\toji\tOjibwa\n\t\t\tori\tOriya\n\t\t\torm\tOromo\n\t\t\tosa\tOsage\n\t\t\toss\tOssetic\n\t\t\tota\tTurkish, Ottoman (1500 - 1928)\n\t\t\toto\tOtomian Languages\n\t\t\tpaa\tPapuan-Australian (Other)\n\t\t\tpag\tPangasinan\n\t\t\tpal\tPahlavi\n\t\t\tpam\tPampanga\n\t\t\tpan\tPanjabi\n\t\t\tpap\tPapiamento\n\t\t\tpau\tPalauan\n\t\t\tpeo\tPersian, Old (ca 600 - 400 B.C.)\n\t\t\tper\tPersian\n\t\t\tphn\tPhoenician\n\t\t\tpli\tPali\n\t\t\tpol\tPolish\n\t\t\tpon\tPonape\n\t\t\tpor\tPortuguese\n\t\t\tpra\tPrakrit uages\n\t\t\tpro\tProvencal, Old (to 1500)\n\t\t\tpus\tPushto\n\t\t\tque\tQuechua\n\t\t\traj\tRajasthani\n\t\t\trar\tRarotongan\n\t\t\troa\tRomance (Other)\n\t\t\troh\tRhaeto-Romance\n\t\t\trom\tRomany\n\t\t\tron\tRomanian\n\t\t\trum\tRomanian\n\t\t\trun\tRundi\n\t\t\trus\tRussian\n\t\t\tsad\tSandawe\n\t\t\tsag\tSango\n\t\t\tsah\tYakut\n\t\t\tsai\tSouth American Indian (Other)\n\t\t\tsal\tSalishan Languages\n\t\t\tsam\tSamaritan Aramaic\n\t\t\tsan\tSanskrit\n\t\t\tsco\tScots\n\t\t\tscr\tSerbo-Croatian\n\t\t\tsel\tSelkup\n\t\t\tsem\tSemitic (Other)\n\t\t\tsga\tIrish, Old (to 900)\n\t\t\tshn\tShan\n\t\t\tsid\tSidamo\n\t\t\tsin\tSinghalese\n\t\t\tsio\tSiouan Languages\n\t\t\tsit\tSino-Tibetan (Other)\n\t\t\tsla\tSlavic (Other)\n\t\t\tslk\tSlovak\n\t\t\tslo\tSlovak\n\t\t\tslv\tSlovenian\n\t\t\tsmi\tSami Languages\n\t\t\tsmo\tSamoan\n\t\t\tsna\tShona\n\t\t\tsnd\tSindhi\n\t\t\tsog\tSogdian\n\t\t\tsom\tSomali\n\t\t\tson\tSonghai\n\t\t\tsot\tSotho, Southern\n\t\t\tspa\tSpanish\n\t\t\tsqi\tAlbanian\n\t\t\tsrd\tSardinian\n\t\t\tsrr\tSerer\n\t\t\tssa\tNilo-Saharan (Other)\n\t\t\tssw\tSiswant\n\t\t\tssw\tSwazi\n\t\t\tsuk\tSukuma\n\t\t\tsun\tSudanese\n\t\t\tsus\tSusu\n\t\t\tsux\tSumerian\n\t\t\tsve\tSwedish\n\t\t\tswa\tSwahili\n\t\t\tswe\tSwedish\n\t\t\tsyr\tSyriac\n\t\t\ttah\tTahitian\n\t\t\ttam\tTamil\n\t\t\ttat\tTatar\n\t\t\ttel\tTelugu\n\t\t\ttem\tTimne\n\t\t\tter\tTereno\n\t\t\ttgk\tTajik\n\t\t\ttgl\tTagalog\n\t\t\ttha\tThai\n\t\t\ttib\tTibetan\n\t\t\ttig\tTigre\n\t\t\ttir\tTigrinya\n\t\t\ttiv\tTivi\n\t\t\ttli\tTlingit\n\t\t\ttmh\tTamashek\n\t\t\ttog\tTonga (Nyasa)\n\t\t\tton\tTonga (Tonga Islands)\n\t\t\ttru\tTruk\n\t\t\ttsi\tTsimshian\n\t\t\ttsn\tTswana\n\t\t\ttso\tTsonga\n\t\t\ttuk\tTurkmen\n\t\t\ttum\tTumbuka\n\t\t\ttur\tTurkish\n\t\t\ttut\tAltaic (Other)\n\t\t\ttwi\tTwi\n\t\t\ttyv\tTuvinian\n\t\t\tuga\tUgaritic\n\t\t\tuig\tUighur\n\t\t\tukr\tUkrainian\n\t\t\tumb\tUmbundu\n\t\t\tund\tUndetermined\n\t\t\turd\tUrdu\n\t\t\tuzb\tUzbek\n\t\t\tvai\tVai\n\t\t\tven\tVenda\n\t\t\tvie\tVietnamese\n\t\t\tvol\tVolap\u00c3\u00bck\n\t\t\tvot\tVotic\n\t\t\twak\tWakashan Languages\n\t\t\twal\tWalamo\n\t\t\twar\tWaray\n\t\t\twas\tWasho\n\t\t\twel\tWelsh\n\t\t\twen\tSorbian Languages\n\t\t\twol\tWolof\n\t\t\txho\tXhosa\n\t\t\tyao\tYao\n\t\t\tyap\tYap\n\t\t\tyid\tYiddish\n\t\t\tyor\tYoruba\n\t\t\tzap\tZapotec\n\t\t\tzen\tZenaga\n\t\t\tzha\tZhuang\n\t\t\tzho\tChinese\n\t\t\tzul\tZulu\n\t\t\tzun\tZuni\n\n\t\t*/\n\n\t\treturn getid3_lib::EmbeddedLookup($languagecode, $begin, __LINE__, __FILE__, 'id3v2-languagecode');\n\t}\n\n\t/**\n\t * @param int $index\n\t *\n\t * @return string\n\t */\n\tpublic static function ETCOEventLookup($index) {\n\t\tif (($index >= 0x17) && ($index <= 0xDF)) {\n\t\t\treturn 'reserved for future use';\n\t\t}\n\t\tif (($index >= 0xE0) && ($index <= 0xEF)) {\n\t\t\treturn 'not predefined synch 0-F';\n\t\t}\n\t\tif (($index >= 0xF0) && ($index <= 0xFC)) {\n\t\t\treturn 'reserved for future use';\n\t\t}\n\n\t\tstatic $EventLookup = array(\n\t\t\t0x00 => 'padding (has no meaning)',\n\t\t\t0x01 => 'end of initial silence',\n\t\t\t0x02 => 'intro start',\n\t\t\t0x03 => 'main part start',\n\t\t\t0x04 => 'outro start',\n\t\t\t0x05 => 'outro end',\n\t\t\t0x06 => 'verse start',\n\t\t\t0x07 => 'refrain start',\n\t\t\t0x08 => 'interlude start',\n\t\t\t0x09 => 'theme start',\n\t\t\t0x0A => 'variation start',\n\t\t\t0x0B => 'key change',\n\t\t\t0x0C => 'time change',\n\t\t\t0x0D => 'momentary unwanted noise (Snap, Crackle & Pop)',\n\t\t\t0x0E => 'sustained noise',\n\t\t\t0x0F => 'sustained noise end',\n\t\t\t0x10 => 'intro end',\n\t\t\t0x11 => 'main part end',\n\t\t\t0x12 => 'verse end',\n\t\t\t0x13 => 'refrain end',\n\t\t\t0x14 => 'theme end',\n\t\t\t0x15 => 'profanity',\n\t\t\t0x16 => 'profanity end',\n\t\t\t0xFD => 'audio end (start of silence)',\n\t\t\t0xFE => 'audio file ends',\n\t\t\t0xFF => 'one more byte of events follows'\n\t\t);\n\n\t\treturn (isset($EventLookup[$index]) ? $EventLookup[$index] : '');\n\t}\n\n\t/**\n\t * @param int $index\n\t *\n\t * @return string\n\t */\n\tpublic static function SYTLContentTypeLookup($index) {\n\t\tstatic $SYTLContentTypeLookup = array(\n\t\t\t0x00 => 'other',\n\t\t\t0x01 => 'lyrics',\n\t\t\t0x02 => 'text transcription',\n\t\t\t0x03 => 'movement/part name', // (e.g. 'Adagio')\n\t\t\t0x04 => 'events',             // (e.g. 'Don Quijote enters the stage')\n\t\t\t0x05 => 'chord',              // (e.g. 'Bb F Fsus')\n\t\t\t0x06 => 'trivia/\\'pop up\\' information',\n\t\t\t0x07 => 'URLs to webpages',\n\t\t\t0x08 => 'URLs to images'\n\t\t);\n\n\t\treturn (isset($SYTLContentTypeLookup[$index]) ? $SYTLContentTypeLookup[$index] : '');\n\t}\n\n\t/**\n\t * @param int   $index\n\t * @param bool $returnarray\n\t *\n\t * @return array|string\n\t */\n\tpublic static function APICPictureTypeLookup($index, $returnarray=false) {\n\t\tstatic $APICPictureTypeLookup = array(\n\t\t\t0x00 => 'Other',\n\t\t\t0x01 => '32x32 pixels \\'file icon\\' (PNG only)',\n\t\t\t0x02 => 'Other file icon',\n\t\t\t0x03 => 'Cover (front)',\n\t\t\t0x04 => 'Cover (back)',\n\t\t\t0x05 => 'Leaflet page',\n\t\t\t0x06 => 'Media (e.g. label side of CD)',\n\t\t\t0x07 => 'Lead artist/lead performer/soloist',\n\t\t\t0x08 => 'Artist/performer',\n\t\t\t0x09 => 'Conductor',\n\t\t\t0x0A => 'Band/Orchestra',\n\t\t\t0x0B => 'Composer',\n\t\t\t0x0C => 'Lyricist/text writer',\n\t\t\t0x0D => 'Recording Location',\n\t\t\t0x0E => 'During recording',\n\t\t\t0x0F => 'During performance',\n\t\t\t0x10 => 'Movie/video screen capture',\n\t\t\t0x11 => 'A bright coloured fish',\n\t\t\t0x12 => 'Illustration',\n\t\t\t0x13 => 'Band/artist logotype',\n\t\t\t0x14 => 'Publisher/Studio logotype'\n\t\t);\n\t\tif ($returnarray) {\n\t\t\treturn $APICPictureTypeLookup;\n\t\t}\n\t\treturn (isset($APICPictureTypeLookup[$index]) ? $APICPictureTypeLookup[$index] : '');\n\t}\n\n\t/**\n\t * @param int $index\n\t *\n\t * @return string\n\t */\n\tpublic static function COMRReceivedAsLookup($index) {\n\t\tstatic $COMRReceivedAsLookup = array(\n\t\t\t0x00 => 'Other',\n\t\t\t0x01 => 'Standard CD album with other songs',\n\t\t\t0x02 => 'Compressed audio on CD',\n\t\t\t0x03 => 'File over the Internet',\n\t\t\t0x04 => 'Stream over the Internet',\n\t\t\t0x05 => 'As note sheets',\n\t\t\t0x06 => 'As note sheets in a book with other sheets',\n\t\t\t0x07 => 'Music on other media',\n\t\t\t0x08 => 'Non-musical merchandise'\n\t\t);\n\n\t\treturn (isset($COMRReceivedAsLookup[$index]) ? $COMRReceivedAsLookup[$index] : '');\n\t}\n\n\t/**\n\t * @param int $index\n\t *\n\t * @return string\n\t */\n\tpublic static function RVA2ChannelTypeLookup($index) {\n\t\tstatic $RVA2ChannelTypeLookup = array(\n\t\t\t0x00 => 'Other',\n\t\t\t0x01 => 'Master volume',\n\t\t\t0x02 => 'Front right',\n\t\t\t0x03 => 'Front left',\n\t\t\t0x04 => 'Back right',\n\t\t\t0x05 => 'Back left',\n\t\t\t0x06 => 'Front centre',\n\t\t\t0x07 => 'Back centre',\n\t\t\t0x08 => 'Subwoofer'\n\t\t);\n\n\t\treturn (isset($RVA2ChannelTypeLookup[$index]) ? $RVA2ChannelTypeLookup[$index] : '');\n\t}\n\n\t/**\n\t * @param string $framename\n\t *\n\t * @return string\n\t */\n\tpublic static function FrameNameLongLookup($framename) {\n\n\t\t$begin = __LINE__;\n\n\t\t/** This is not a comment!\n\n\t\t\tAENC\tAudio encryption\n\t\t\tAPIC\tAttached picture\n\t\t\tASPI\tAudio seek point index\n\t\t\tBUF\tRecommended buffer size\n\t\t\tCNT\tPlay counter\n\t\t\tCOM\tComments\n\t\t\tCOMM\tComments\n\t\t\tCOMR\tCommercial frame\n\t\t\tCRA\tAudio encryption\n\t\t\tCRM\tEncrypted meta frame\n\t\t\tENCR\tEncryption method registration\n\t\t\tEQU\tEqualisation\n\t\t\tEQU2\tEqualisation (2)\n\t\t\tEQUA\tEqualisation\n\t\t\tETC\tEvent timing codes\n\t\t\tETCO\tEvent timing codes\n\t\t\tGEO\tGeneral encapsulated object\n\t\t\tGEOB\tGeneral encapsulated object\n\t\t\tGRID\tGroup identification registration\n\t\t\tIPL\tInvolved people list\n\t\t\tIPLS\tInvolved people list\n\t\t\tLINK\tLinked information\n\t\t\tLNK\tLinked information\n\t\t\tMCDI\tMusic CD identifier\n\t\t\tMCI\tMusic CD Identifier\n\t\t\tMLL\tMPEG location lookup table\n\t\t\tMLLT\tMPEG location lookup table\n\t\t\tOWNE\tOwnership frame\n\t\t\tPCNT\tPlay counter\n\t\t\tPIC\tAttached picture\n\t\t\tPOP\tPopularimeter\n\t\t\tPOPM\tPopularimeter\n\t\t\tPOSS\tPosition synchronisation frame\n\t\t\tPRIV\tPrivate frame\n\t\t\tRBUF\tRecommended buffer size\n\t\t\tREV\tReverb\n\t\t\tRVA\tRelative volume adjustment\n\t\t\tRVA2\tRelative volume adjustment (2)\n\t\t\tRVAD\tRelative volume adjustment\n\t\t\tRVRB\tReverb\n\t\t\tSEEK\tSeek frame\n\t\t\tSIGN\tSignature frame\n\t\t\tSLT\tSynchronised lyric/text\n\t\t\tSTC\tSynced tempo codes\n\t\t\tSYLT\tSynchronised lyric/text\n\t\t\tSYTC\tSynchronised tempo codes\n\t\t\tTAL\tAlbum/Movie/Show title\n\t\t\tTALB\tAlbum/Movie/Show title\n\t\t\tTBP\tBPM (Beats Per Minute)\n\t\t\tTBPM\tBPM (beats per minute)\n\t\t\tTCM\tComposer\n\t\t\tTCMP\tPart of a compilation\n\t\t\tTCO\tContent type\n\t\t\tTCOM\tComposer\n\t\t\tTCON\tContent type\n\t\t\tTCOP\tCopyright message\n\t\t\tTCP\tPart of a compilation\n\t\t\tTCR\tCopyright message\n\t\t\tTDA\tDate\n\t\t\tTDAT\tDate\n\t\t\tTDEN\tEncoding time\n\t\t\tTDLY\tPlaylist delay\n\t\t\tTDOR\tOriginal release time\n\t\t\tTDRC\tRecording time\n\t\t\tTDRL\tRelease time\n\t\t\tTDTG\tTagging time\n\t\t\tTDY\tPlaylist delay\n\t\t\tTEN\tEncoded by\n\t\t\tTENC\tEncoded by\n\t\t\tTEXT\tLyricist/Text writer\n\t\t\tTFLT\tFile type\n\t\t\tTFT\tFile type\n\t\t\tTIM\tTime\n\t\t\tTIME\tTime\n\t\t\tTIPL\tInvolved people list\n\t\t\tTIT1\tContent group description\n\t\t\tTIT2\tTitle/songname/content description\n\t\t\tTIT3\tSubtitle/Description refinement\n\t\t\tTKE\tInitial key\n\t\t\tTKEY\tInitial key\n\t\t\tTLA\tLanguage(s)\n\t\t\tTLAN\tLanguage(s)\n\t\t\tTLE\tLength\n\t\t\tTLEN\tLength\n\t\t\tTMCL\tMusician credits list\n\t\t\tTMED\tMedia type\n\t\t\tTMOO\tMood\n\t\t\tTMT\tMedia type\n\t\t\tTOA\tOriginal artist(s)/performer(s)\n\t\t\tTOAL\tOriginal album/movie/show title\n\t\t\tTOF\tOriginal filename\n\t\t\tTOFN\tOriginal filename\n\t\t\tTOL\tOriginal Lyricist(s)/text writer(s)\n\t\t\tTOLY\tOriginal lyricist(s)/text writer(s)\n\t\t\tTOPE\tOriginal artist(s)/performer(s)\n\t\t\tTOR\tOriginal release year\n\t\t\tTORY\tOriginal release year\n\t\t\tTOT\tOriginal album/Movie/Show title\n\t\t\tTOWN\tFile owner/licensee\n\t\t\tTP1\tLead artist(s)/Lead performer(s)/Soloist(s)/Performing group\n\t\t\tTP2\tBand/Orchestra/Accompaniment\n\t\t\tTP3\tConductor/Performer refinement\n\t\t\tTP4\tInterpreted, remixed, or otherwise modified by\n\t\t\tTPA\tPart of a set\n\t\t\tTPB\tPublisher\n\t\t\tTPE1\tLead performer(s)/Soloist(s)\n\t\t\tTPE2\tBand/orchestra/accompaniment\n\t\t\tTPE3\tConductor/performer refinement\n\t\t\tTPE4\tInterpreted, remixed, or otherwise modified by\n\t\t\tTPOS\tPart of a set\n\t\t\tTPRO\tProduced notice\n\t\t\tTPUB\tPublisher\n\t\t\tTRC\tISRC (International Standard Recording Code)\n\t\t\tTRCK\tTrack number/Position in set\n\t\t\tTRD\tRecording dates\n\t\t\tTRDA\tRecording dates\n\t\t\tTRK\tTrack number/Position in set\n\t\t\tTRSN\tInternet radio station name\n\t\t\tTRSO\tInternet radio station owner\n\t\t\tTS2\tAlbum-Artist sort order\n\t\t\tTSA\tAlbum sort order\n\t\t\tTSC\tComposer sort order\n\t\t\tTSI\tSize\n\t\t\tTSIZ\tSize\n\t\t\tTSO2\tAlbum-Artist sort order\n\t\t\tTSOA\tAlbum sort order\n\t\t\tTSOC\tComposer sort order\n\t\t\tTSOP\tPerformer sort order\n\t\t\tTSOT\tTitle sort order\n\t\t\tTSP\tPerformer sort order\n\t\t\tTSRC\tISRC (international standard recording code)\n\t\t\tTSS\tSoftware/hardware and settings used for encoding\n\t\t\tTSSE\tSoftware/Hardware and settings used for encoding\n\t\t\tTSST\tSet subtitle\n\t\t\tTST\tTitle sort order\n\t\t\tTT1\tContent group description\n\t\t\tTT2\tTitle/Songname/Content description\n\t\t\tTT3\tSubtitle/Description refinement\n\t\t\tTXT\tLyricist/text writer\n\t\t\tTXX\tUser defined text information frame\n\t\t\tTXXX\tUser defined text information frame\n\t\t\tTYE\tYear\n\t\t\tTYER\tYear\n\t\t\tUFI\tUnique file identifier\n\t\t\tUFID\tUnique file identifier\n\t\t\tULT\tUnsynchronised lyric/text transcription\n\t\t\tUSER\tTerms of use\n\t\t\tUSLT\tUnsynchronised lyric/text transcription\n\t\t\tWAF\tOfficial audio file webpage\n\t\t\tWAR\tOfficial artist/performer webpage\n\t\t\tWAS\tOfficial audio source webpage\n\t\t\tWCM\tCommercial information\n\t\t\tWCOM\tCommercial information\n\t\t\tWCOP\tCopyright/Legal information\n\t\t\tWCP\tCopyright/Legal information\n\t\t\tWOAF\tOfficial audio file webpage\n\t\t\tWOAR\tOfficial artist/performer webpage\n\t\t\tWOAS\tOfficial audio source webpage\n\t\t\tWORS\tOfficial Internet radio station homepage\n\t\t\tWPAY\tPayment\n\t\t\tWPB\tPublishers official webpage\n\t\t\tWPUB\tPublishers official webpage\n\t\t\tWXX\tUser defined URL link frame\n\t\t\tWXXX\tUser defined URL link frame\n\t\t\tTFEA\tFeatured Artist\n\t\t\tTSTU\tRecording Studio\n\t\t\trgad\tReplay Gain Adjustment\n\n\t\t*/\n\n\t\treturn getid3_lib::EmbeddedLookup($framename, $begin, __LINE__, __FILE__, 'id3v2-framename_long');\n\n\t\t// Last three:\n\t\t// from Helium2 [www.helium2.com]\n\t\t// from http://privatewww.essex.ac.uk/~djmrob/replaygain/file_format_id3v2.html\n\t}\n\n\t/**\n\t * @param string $framename\n\t *\n\t * @return string\n\t */\n\tpublic static function FrameNameShortLookup($framename) {\n\n\t\t$begin = __LINE__;\n\n\t\t/** This is not a comment!\n\n\t\t\tAENC\taudio_encryption\n\t\t\tAPIC\tattached_picture\n\t\t\tASPI\taudio_seek_point_index\n\t\t\tBUF\trecommended_buffer_size\n\t\t\tCNT\tplay_counter\n\t\t\tCOM\tcomment\n\t\t\tCOMM\tcomment\n\t\t\tCOMR\tcommercial_frame\n\t\t\tCRA\taudio_encryption\n\t\t\tCRM\tencrypted_meta_frame\n\t\t\tENCR\tencryption_method_registration\n\t\t\tEQU\tequalisation\n\t\t\tEQU2\tequalisation\n\t\t\tEQUA\tequalisation\n\t\t\tETC\tevent_timing_codes\n\t\t\tETCO\tevent_timing_codes\n\t\t\tGEO\tgeneral_encapsulated_object\n\t\t\tGEOB\tgeneral_encapsulated_object\n\t\t\tGRID\tgroup_identification_registration\n\t\t\tIPL\tinvolved_people_list\n\t\t\tIPLS\tinvolved_people_list\n\t\t\tLINK\tlinked_information\n\t\t\tLNK\tlinked_information\n\t\t\tMCDI\tmusic_cd_identifier\n\t\t\tMCI\tmusic_cd_identifier\n\t\t\tMLL\tmpeg_location_lookup_table\n\t\t\tMLLT\tmpeg_location_lookup_table\n\t\t\tOWNE\townership_frame\n\t\t\tPCNT\tplay_counter\n\t\t\tPIC\tattached_picture\n\t\t\tPOP\tpopularimeter\n\t\t\tPOPM\tpopularimeter\n\t\t\tPOSS\tposition_synchronisation_frame\n\t\t\tPRIV\tprivate_frame\n\t\t\tRBUF\trecommended_buffer_size\n\t\t\tREV\treverb\n\t\t\tRVA\trelative_volume_adjustment\n\t\t\tRVA2\trelative_volume_adjustment\n\t\t\tRVAD\trelative_volume_adjustment\n\t\t\tRVRB\treverb\n\t\t\tSEEK\tseek_frame\n\t\t\tSIGN\tsignature_frame\n\t\t\tSLT\tsynchronised_lyric\n\t\t\tSTC\tsynced_tempo_codes\n\t\t\tSYLT\tsynchronised_lyric\n\t\t\tSYTC\tsynchronised_tempo_codes\n\t\t\tTAL\talbum\n\t\t\tTALB\talbum\n\t\t\tTBP\tbpm\n\t\t\tTBPM\tbpm\n\t\t\tTCM\tcomposer\n\t\t\tTCMP\tpart_of_a_compilation\n\t\t\tTCO\tgenre\n\t\t\tTCOM\tcomposer\n\t\t\tTCON\tgenre\n\t\t\tTCOP\tcopyright_message\n\t\t\tTCP\tpart_of_a_compilation\n\t\t\tTCR\tcopyright_message\n\t\t\tTDA\tdate\n\t\t\tTDAT\tdate\n\t\t\tTDEN\tencoding_time\n\t\t\tTDLY\tplaylist_delay\n\t\t\tTDOR\toriginal_release_time\n\t\t\tTDRC\trecording_time\n\t\t\tTDRL\trelease_time\n\t\t\tTDTG\ttagging_time\n\t\t\tTDY\tplaylist_delay\n\t\t\tTEN\tencoded_by\n\t\t\tTENC\tencoded_by\n\t\t\tTEXT\tlyricist\n\t\t\tTFLT\tfile_type\n\t\t\tTFT\tfile_type\n\t\t\tTIM\ttime\n\t\t\tTIME\ttime\n\t\t\tTIPL\tinvolved_people_list\n\t\t\tTIT1\tcontent_group_description\n\t\t\tTIT2\ttitle\n\t\t\tTIT3\tsubtitle\n\t\t\tTKE\tinitial_key\n\t\t\tTKEY\tinitial_key\n\t\t\tTLA\tlanguage\n\t\t\tTLAN\tlanguage\n\t\t\tTLE\tlength\n\t\t\tTLEN\tlength\n\t\t\tTMCL\tmusician_credits_list\n\t\t\tTMED\tmedia_type\n\t\t\tTMOO\tmood\n\t\t\tTMT\tmedia_type\n\t\t\tTOA\toriginal_artist\n\t\t\tTOAL\toriginal_album\n\t\t\tTOF\toriginal_filename\n\t\t\tTOFN\toriginal_filename\n\t\t\tTOL\toriginal_lyricist\n\t\t\tTOLY\toriginal_lyricist\n\t\t\tTOPE\toriginal_artist\n\t\t\tTOR\toriginal_year\n\t\t\tTORY\toriginal_year\n\t\t\tTOT\toriginal_album\n\t\t\tTOWN\tfile_owner\n\t\t\tTP1\tartist\n\t\t\tTP2\tband\n\t\t\tTP3\tconductor\n\t\t\tTP4\tremixer\n\t\t\tTPA\tpart_of_a_set\n\t\t\tTPB\tpublisher\n\t\t\tTPE1\tartist\n\t\t\tTPE2\tband\n\t\t\tTPE3\tconductor\n\t\t\tTPE4\tremixer\n\t\t\tTPOS\tpart_of_a_set\n\t\t\tTPRO\tproduced_notice\n\t\t\tTPUB\tpublisher\n\t\t\tTRC\tisrc\n\t\t\tTRCK\ttrack_number\n\t\t\tTRD\trecording_dates\n\t\t\tTRDA\trecording_dates\n\t\t\tTRK\ttrack_number\n\t\t\tTRSN\tinternet_radio_station_name\n\t\t\tTRSO\tinternet_radio_station_owner\n\t\t\tTS2\talbum_artist_sort_order\n\t\t\tTSA\talbum_sort_order\n\t\t\tTSC\tcomposer_sort_order\n\t\t\tTSI\tsize\n\t\t\tTSIZ\tsize\n\t\t\tTSO2\talbum_artist_sort_order\n\t\t\tTSOA\talbum_sort_order\n\t\t\tTSOC\tcomposer_sort_order\n\t\t\tTSOP\tperformer_sort_order\n\t\t\tTSOT\ttitle_sort_order\n\t\t\tTSP\tperformer_sort_order\n\t\t\tTSRC\tisrc\n\t\t\tTSS\tencoder_settings\n\t\t\tTSSE\tencoder_settings\n\t\t\tTSST\tset_subtitle\n\t\t\tTST\ttitle_sort_order\n\t\t\tTT1\tcontent_group_description\n\t\t\tTT2\ttitle\n\t\t\tTT3\tsubtitle\n\t\t\tTXT\tlyricist\n\t\t\tTXX\ttext\n\t\t\tTXXX\ttext\n\t\t\tTYE\tyear\n\t\t\tTYER\tyear\n\t\t\tUFI\tunique_file_identifier\n\t\t\tUFID\tunique_file_identifier\n\t\t\tULT\tunsynchronised_lyric\n\t\t\tUSER\tterms_of_use\n\t\t\tUSLT\tunsynchronised_lyric\n\t\t\tWAF\turl_file\n\t\t\tWAR\turl_artist\n\t\t\tWAS\turl_source\n\t\t\tWCM\tcommercial_information\n\t\t\tWCOM\tcommercial_information\n\t\t\tWCOP\tcopyright\n\t\t\tWCP\tcopyright\n\t\t\tWOAF\turl_file\n\t\t\tWOAR\turl_artist\n\t\t\tWOAS\turl_source\n\t\t\tWORS\turl_station\n\t\t\tWPAY\turl_payment\n\t\t\tWPB\turl_publisher\n\t\t\tWPUB\turl_publisher\n\t\t\tWXX\turl_user\n\t\t\tWXXX\turl_user\n\t\t\tTFEA\tfeatured_artist\n\t\t\tTSTU\trecording_studio\n\t\t\trgad\treplay_gain_adjustment\n\n\t\t*/\n\n\t\treturn getid3_lib::EmbeddedLookup($framename, $begin, __LINE__, __FILE__, 'id3v2-framename_short');\n\t}\n\n\t/**\n\t * @param string $encoding\n\t *\n\t * @return string\n\t */\n\tpublic static function TextEncodingTerminatorLookup($encoding) {\n\t\t// http://www.id3.org/id3v2.4.0-structure.txt\n\t\t// Frames that allow different types of text encoding contains a text encoding description byte. Possible encodings:\n\t\tstatic $TextEncodingTerminatorLookup = array(\n\t\t\t0   => \"\\x00\",     // $00  ISO-8859-1. Terminated with $00.\n\t\t\t1   => \"\\x00\\x00\", // $01  UTF-16 encoded Unicode with BOM. All strings in the same frame SHALL have the same byteorder. Terminated with $00 00.\n\t\t\t2   => \"\\x00\\x00\", // $02  UTF-16BE encoded Unicode without BOM. Terminated with $00 00.\n\t\t\t3   => \"\\x00\",     // $03  UTF-8 encoded Unicode. Terminated with $00.\n\t\t\t255 => \"\\x00\\x00\"\n\t\t);\n\t\treturn (isset($TextEncodingTerminatorLookup[$encoding]) ? $TextEncodingTerminatorLookup[$encoding] : \"\\x00\");\n\t}\n\n\t/**\n\t * @param int $encoding\n\t *\n\t * @return string\n\t */\n\tpublic static function TextEncodingNameLookup($encoding) {\n\t\t// http://www.id3.org/id3v2.4.0-structure.txt\n\t\t// Frames that allow different types of text encoding contains a text encoding description byte. Possible encodings:\n\t\tstatic $TextEncodingNameLookup = array(\n\t\t\t0   => 'ISO-8859-1', // $00  ISO-8859-1. Terminated with $00.\n\t\t\t1   => 'UTF-16',     // $01  UTF-16 encoded Unicode with BOM. All strings in the same frame SHALL have the same byteorder. Terminated with $00 00.\n\t\t\t2   => 'UTF-16BE',   // $02  UTF-16BE encoded Unicode without BOM. Terminated with $00 00.\n\t\t\t3   => 'UTF-8',      // $03  UTF-8 encoded Unicode. Terminated with $00.\n\t\t\t255 => 'UTF-16BE'\n\t\t);\n\t\treturn (isset($TextEncodingNameLookup[$encoding]) ? $TextEncodingNameLookup[$encoding] : 'ISO-8859-1');\n\t}\n\n\t/**\n\t * @param string $string\n\t * @param string $terminator\n\t *\n\t * @return string\n\t */\n\tpublic static function RemoveStringTerminator($string, $terminator) {\n\t\t// Null terminator at end of comment string is somewhat ambiguous in the specification, may or may not be implemented by various taggers. Remove terminator only if present.\n\t\t// https://github.com/JamesHeinrich/getID3/issues/121\n\t\t// https://community.mp3tag.de/t/x-trailing-nulls-in-id3v2-comments/19227\n\t\tif (substr($string, -strlen($terminator), strlen($terminator)) === $terminator) {\n\t\t\t$string = substr($string, 0, -strlen($terminator));\n\t\t}\n\t\treturn $string;\n\t}\n\n\t/**\n\t * @param string $string\n\t *\n\t * @return string\n\t */\n\tpublic static function MakeUTF16emptyStringEmpty($string) {\n\t\tif (in_array($string, array(\"\\x00\", \"\\x00\\x00\", \"\\xFF\\xFE\", \"\\xFE\\xFF\"))) {\n\t\t\t// if string only contains a BOM or terminator then make it actually an empty string\n\t\t\t$string = '';\n\t\t}\n\t\treturn $string;\n\t}\n\n\t/**\n\t * @param string $framename\n\t * @param int    $id3v2majorversion\n\t *\n\t * @return bool|int\n\t */\n\tpublic static function IsValidID3v2FrameName($framename, $id3v2majorversion) {\n\t\tswitch ($id3v2majorversion) {\n\t\t\tcase 2:\n\t\t\t\treturn preg_match('#[A-Z][A-Z0-9]{2}#', $framename);\n\n\t\t\tcase 3:\n\t\t\tcase 4:\n\t\t\t\treturn preg_match('#[A-Z][A-Z0-9]{3}#', $framename);\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * @param string $numberstring\n\t * @param bool   $allowdecimal\n\t * @param bool   $allownegative\n\t *\n\t * @return bool\n\t */\n\tpublic static function IsANumber($numberstring, $allowdecimal=false, $allownegative=false) {\n\t\tfor ($i = 0; $i < strlen($numberstring); $i++) {\n\t\t\tif ((chr($numberstring[$i]) < chr('0')) || (chr($numberstring[$i]) > chr('9'))) {\n\t\t\t\tif (($numberstring[$i] == '.') && $allowdecimal) {\n\t\t\t\t\t// allowed\n\t\t\t\t} elseif (($numberstring[$i] == '-') && $allownegative && ($i == 0)) {\n\t\t\t\t\t// allowed\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $datestamp\n\t *\n\t * @return bool\n\t */\n\tpublic static function IsValidDateStampString($datestamp) {\n\t\tif (strlen($datestamp) != 8) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!self::IsANumber($datestamp, false)) {\n\t\t\treturn false;\n\t\t}\n\t\t$year  = substr($datestamp, 0, 4);\n\t\t$month = substr($datestamp, 4, 2);\n\t\t$day   = substr($datestamp, 6, 2);\n\t\tif (($year == 0) || ($month == 0) || ($day == 0)) {\n\t\t\treturn false;\n\t\t}\n\t\tif ($month > 12) {\n\t\t\treturn false;\n\t\t}\n\t\tif ($day > 31) {\n\t\t\treturn false;\n\t\t}\n\t\tif (($day > 30) && (($month == 4) || ($month == 6) || ($month == 9) || ($month == 11))) {\n\t\t\treturn false;\n\t\t}\n\t\tif (($day > 29) && ($month == 2)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param int $majorversion\n\t *\n\t * @return int\n\t */\n\tpublic static function ID3v2HeaderLength($majorversion) {\n\t\treturn (($majorversion == 2) ? 6 : 10);\n\t}\n\n\t/**\n\t * @param string $frame_name\n\t *\n\t * @return string|false\n\t */\n\tpublic static function ID3v22iTunesBrokenFrameName($frame_name) {\n\t\t// iTunes (multiple versions) has been known to write ID3v2.3 style frames\n\t\t// but use ID3v2.2 frame names, right-padded using either [space] or [null]\n\t\t// to make them fit in the 4-byte frame name space of the ID3v2.3 frame.\n\t\t// This function will detect and translate the corrupt frame name into ID3v2.3 standard.\n\t\tstatic $ID3v22_iTunes_BrokenFrames = array(\n\t\t\t'BUF' => 'RBUF', // Recommended buffer size\n\t\t\t'CNT' => 'PCNT', // Play counter\n\t\t\t'COM' => 'COMM', // Comments\n\t\t\t'CRA' => 'AENC', // Audio encryption\n\t\t\t'EQU' => 'EQUA', // Equalisation\n\t\t\t'ETC' => 'ETCO', // Event timing codes\n\t\t\t'GEO' => 'GEOB', // General encapsulated object\n\t\t\t'IPL' => 'IPLS', // Involved people list\n\t\t\t'LNK' => 'LINK', // Linked information\n\t\t\t'MCI' => 'MCDI', // Music CD identifier\n\t\t\t'MLL' => 'MLLT', // MPEG location lookup table\n\t\t\t'PIC' => 'APIC', // Attached picture\n\t\t\t'POP' => 'POPM', // Popularimeter\n\t\t\t'REV' => 'RVRB', // Reverb\n\t\t\t'RVA' => 'RVAD', // Relative volume adjustment\n\t\t\t'SLT' => 'SYLT', // Synchronised lyric/text\n\t\t\t'STC' => 'SYTC', // Synchronised tempo codes\n\t\t\t'TAL' => 'TALB', // Album/Movie/Show title\n\t\t\t'TBP' => 'TBPM', // BPM (beats per minute)\n\t\t\t'TCM' => 'TCOM', // Composer\n\t\t\t'TCO' => 'TCON', // Content type\n\t\t\t'TCP' => 'TCMP', // Part of a compilation\n\t\t\t'TCR' => 'TCOP', // Copyright message\n\t\t\t'TDA' => 'TDAT', // Date\n\t\t\t'TDY' => 'TDLY', // Playlist delay\n\t\t\t'TEN' => 'TENC', // Encoded by\n\t\t\t'TFT' => 'TFLT', // File type\n\t\t\t'TIM' => 'TIME', // Time\n\t\t\t'TKE' => 'TKEY', // Initial key\n\t\t\t'TLA' => 'TLAN', // Language(s)\n\t\t\t'TLE' => 'TLEN', // Length\n\t\t\t'TMT' => 'TMED', // Media type\n\t\t\t'TOA' => 'TOPE', // Original artist(s)/performer(s)\n\t\t\t'TOF' => 'TOFN', // Original filename\n\t\t\t'TOL' => 'TOLY', // Original lyricist(s)/text writer(s)\n\t\t\t'TOR' => 'TORY', // Original release year\n\t\t\t'TOT' => 'TOAL', // Original album/movie/show title\n\t\t\t'TP1' => 'TPE1', // Lead performer(s)/Soloist(s)\n\t\t\t'TP2' => 'TPE2', // Band/orchestra/accompaniment\n\t\t\t'TP3' => 'TPE3', // Conductor/performer refinement\n\t\t\t'TP4' => 'TPE4', // Interpreted, remixed, or otherwise modified by\n\t\t\t'TPA' => 'TPOS', // Part of a set\n\t\t\t'TPB' => 'TPUB', // Publisher\n\t\t\t'TRC' => 'TSRC', // ISRC (international standard recording code)\n\t\t\t'TRD' => 'TRDA', // Recording dates\n\t\t\t'TRK' => 'TRCK', // Track number/Position in set\n\t\t\t'TS2' => 'TSO2', // Album-Artist sort order\n\t\t\t'TSA' => 'TSOA', // Album sort order\n\t\t\t'TSC' => 'TSOC', // Composer sort order\n\t\t\t'TSI' => 'TSIZ', // Size\n\t\t\t'TSP' => 'TSOP', // Performer sort order\n\t\t\t'TSS' => 'TSSE', // Software/Hardware and settings used for encoding\n\t\t\t'TST' => 'TSOT', // Title sort order\n\t\t\t'TT1' => 'TIT1', // Content group description\n\t\t\t'TT2' => 'TIT2', // Title/songname/content description\n\t\t\t'TT3' => 'TIT3', // Subtitle/Description refinement\n\t\t\t'TXT' => 'TEXT', // Lyricist/Text writer\n\t\t\t'TXX' => 'TXXX', // User defined text information frame\n\t\t\t'TYE' => 'TYER', // Year\n\t\t\t'UFI' => 'UFID', // Unique file identifier\n\t\t\t'ULT' => 'USLT', // Unsynchronised lyric/text transcription\n\t\t\t'WAF' => 'WOAF', // Official audio file webpage\n\t\t\t'WAR' => 'WOAR', // Official artist/performer webpage\n\t\t\t'WAS' => 'WOAS', // Official audio source webpage\n\t\t\t'WCM' => 'WCOM', // Commercial information\n\t\t\t'WCP' => 'WCOP', // Copyright/Legal information\n\t\t\t'WPB' => 'WPUB', // Publishers official webpage\n\t\t\t'WXX' => 'WXXX', // User defined URL link frame\n\t\t);\n\t\tif (strlen($frame_name) == 4) {\n\t\t\tif ((substr($frame_name, 3, 1) == ' ') || (substr($frame_name, 3, 1) == \"\\x00\")) {\n\t\t\t\tif (isset($ID3v22_iTunes_BrokenFrames[substr($frame_name, 0, 3)])) {\n\t\t\t\t\treturn $ID3v22_iTunes_BrokenFrames[substr($frame_name, 0, 3)];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n}\n\n", "num_lines": 3900}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/////////////////////////////////////////////////////////////////\n/// getID3() by James Heinrich <info@getid3.org>               //\n//  available at https://github.com/JamesHeinrich/getID3       //\n//            or https://www.getid3.org                        //\n//            or http://getid3.sourceforge.net                 //\n//  see readme.txt for more details                            //\n/////////////////////////////////////////////////////////////////\n///                                                            //\n// module.tag.lyrics3.php                                      //\n// module for analyzing Lyrics3 tags                           //\n// dependencies: module.tag.apetag.php (optional)              //\n//                                                            ///\n/////////////////////////////////////////////////////////////////\n\nif (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers\n\texit;\n}\nclass getid3_lyrics3 extends getid3_handler\n{\n\t/**\n\t * @return bool\n\t */\n\tpublic function Analyze() {\n\t\t$info = &$this->getid3->info;\n\n\t\t// http://www.volweb.cz/str/tags.htm\n\n\t\tif (!getid3_lib::intValueSupported($info['filesize'])) {\n\t\t\t$this->warning('Unable to check for Lyrics3 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB');\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->fseek((0 - 128 - 9 - 6), SEEK_END);          // end - ID3v1 - \"LYRICSEND\" - [Lyrics3size]\n\t\t$lyrics3_id3v1 = $this->fread(128 + 9 + 6);\n\t\t$lyrics3lsz    = (int) substr($lyrics3_id3v1, 0, 6); // Lyrics3size\n\t\t$lyrics3end    = substr($lyrics3_id3v1,  6,   9); // LYRICSEND or LYRICS200\n\t\t$id3v1tag      = substr($lyrics3_id3v1, 15, 128); // ID3v1\n\n\t\tif ($lyrics3end == 'LYRICSEND') {\n\t\t\t// Lyrics3v1, ID3v1, no APE\n\n\t\t\t$lyrics3size    = 5100;\n\t\t\t$lyrics3offset  = $info['filesize'] - 128 - $lyrics3size;\n\t\t\t$lyrics3version = 1;\n\n\t\t} elseif ($lyrics3end == 'LYRICS200') {\n\t\t\t// Lyrics3v2, ID3v1, no APE\n\n\t\t\t// LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200'\n\t\t\t$lyrics3size    = $lyrics3lsz + 6 + strlen('LYRICS200');\n\t\t\t$lyrics3offset  = $info['filesize'] - 128 - $lyrics3size;\n\t\t\t$lyrics3version = 2;\n\n\t\t} elseif (substr(strrev($lyrics3_id3v1), 0, 9) == strrev('LYRICSEND')) {\n\t\t\t// Lyrics3v1, no ID3v1, no APE\n\n\t\t\t$lyrics3size    = 5100;\n\t\t\t$lyrics3offset  = $info['filesize'] - $lyrics3size;\n\t\t\t$lyrics3version = 1;\n\t\t\t$lyrics3offset  = $info['filesize'] - $lyrics3size;\n\n\t\t} elseif (substr(strrev($lyrics3_id3v1), 0, 9) == strrev('LYRICS200')) {\n\n\t\t\t// Lyrics3v2, no ID3v1, no APE\n\n\t\t\t$lyrics3size    = (int) strrev(substr(strrev($lyrics3_id3v1), 9, 6)) + 6 + strlen('LYRICS200'); // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200'\n\t\t\t$lyrics3offset  = $info['filesize'] - $lyrics3size;\n\t\t\t$lyrics3version = 2;\n\n\t\t} else {\n\n\t\t\tif (isset($info['ape']['tag_offset_start']) && ($info['ape']['tag_offset_start'] > 15)) {\n\n\t\t\t\t$this->fseek($info['ape']['tag_offset_start'] - 15);\n\t\t\t\t$lyrics3lsz = $this->fread(6);\n\t\t\t\t$lyrics3end = $this->fread(9);\n\n\t\t\t\tif ($lyrics3end == 'LYRICSEND') {\n\t\t\t\t\t// Lyrics3v1, APE, maybe ID3v1\n\n\t\t\t\t\t$lyrics3size    = 5100;\n\t\t\t\t\t$lyrics3offset  = $info['ape']['tag_offset_start'] - $lyrics3size;\n\t\t\t\t\t$info['avdataend'] = $lyrics3offset;\n\t\t\t\t\t$lyrics3version = 1;\n\t\t\t\t\t$this->warning('APE tag located after Lyrics3, will probably break Lyrics3 compatability');\n\n\t\t\t\t} elseif ($lyrics3end == 'LYRICS200') {\n\t\t\t\t\t// Lyrics3v2, APE, maybe ID3v1\n\n\t\t\t\t\t$lyrics3size    = $lyrics3lsz + 6 + strlen('LYRICS200'); // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200'\n\t\t\t\t\t$lyrics3offset  = $info['ape']['tag_offset_start'] - $lyrics3size;\n\t\t\t\t\t$lyrics3version = 2;\n\t\t\t\t\t$this->warning('APE tag located after Lyrics3, will probably break Lyrics3 compatability');\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif (isset($lyrics3offset) && isset($lyrics3version) && isset($lyrics3size)) {\n\t\t\t$info['avdataend'] = $lyrics3offset;\n\t\t\t$this->getLyrics3Data($lyrics3offset, $lyrics3version, $lyrics3size);\n\n\t\t\tif (!isset($info['ape'])) {\n\t\t\t\tif (isset($info['lyrics3']['tag_offset_start'])) {\n\t\t\t\t\t$GETID3_ERRORARRAY = &$info['warning'];\n\t\t\t\t\tgetid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, true);\n\t\t\t\t\t$getid3_temp = new getID3();\n\t\t\t\t\t$getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp);\n\t\t\t\t\t$getid3_apetag = new getid3_apetag($getid3_temp);\n\t\t\t\t\t$getid3_apetag->overrideendoffset = $info['lyrics3']['tag_offset_start'];\n\t\t\t\t\t$getid3_apetag->Analyze();\n\t\t\t\t\tif (!empty($getid3_temp->info['ape'])) {\n\t\t\t\t\t\t$info['ape'] = $getid3_temp->info['ape'];\n\t\t\t\t\t}\n\t\t\t\t\tif (!empty($getid3_temp->info['replay_gain'])) {\n\t\t\t\t\t\t$info['replay_gain'] = $getid3_temp->info['replay_gain'];\n\t\t\t\t\t}\n\t\t\t\t\tunset($getid3_temp, $getid3_apetag);\n\t\t\t\t} else {\n\t\t\t\t\t$this->warning('Lyrics3 and APE tags appear to have become entangled (most likely due to updating the APE tags with a non-Lyrics3-aware tagger)');\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param int $endoffset\n\t * @param int $version\n\t * @param int $length\n\t *\n\t * @return bool\n\t */\n\tpublic function getLyrics3Data($endoffset, $version, $length) {\n\t\t// http://www.volweb.cz/str/tags.htm\n\n\t\t$info = &$this->getid3->info;\n\n\t\tif (!getid3_lib::intValueSupported($endoffset)) {\n\t\t\t$this->warning('Unable to check for Lyrics3 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB');\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->fseek($endoffset);\n\t\tif ($length <= 0) {\n\t\t\treturn false;\n\t\t}\n\t\t$rawdata = $this->fread($length);\n\n\t\t$ParsedLyrics3 = array();\n\n\t\t$ParsedLyrics3['raw']['lyrics3version'] = $version;\n\t\t$ParsedLyrics3['raw']['lyrics3tagsize'] = $length;\n\t\t$ParsedLyrics3['tag_offset_start']      = $endoffset;\n\t\t$ParsedLyrics3['tag_offset_end']        = $endoffset + $length - 1;\n\n\t\tif (substr($rawdata, 0, 11) != 'LYRICSBEGIN') {\n\t\t\tif (strpos($rawdata, 'LYRICSBEGIN') !== false) {\n\n\t\t\t\t$this->warning('\"LYRICSBEGIN\" expected at '.$endoffset.' but actually found at '.($endoffset + strpos($rawdata, 'LYRICSBEGIN')).' - this is invalid for Lyrics3 v'.$version);\n\t\t\t\t$info['avdataend'] = $endoffset + strpos($rawdata, 'LYRICSBEGIN');\n\t\t\t\t$rawdata = substr($rawdata, strpos($rawdata, 'LYRICSBEGIN'));\n\t\t\t\t$length = strlen($rawdata);\n\t\t\t\t$ParsedLyrics3['tag_offset_start'] = $info['avdataend'];\n\t\t\t\t$ParsedLyrics3['raw']['lyrics3tagsize'] = $length;\n\n\t\t\t} else {\n\n\t\t\t\t$this->error('\"LYRICSBEGIN\" expected at '.$endoffset.' but found \"'.substr($rawdata, 0, 11).'\" instead');\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\tswitch ($version) {\n\n\t\t\tcase 1:\n\t\t\t\tif (substr($rawdata, strlen($rawdata) - 9, 9) == 'LYRICSEND') {\n\t\t\t\t\t$ParsedLyrics3['raw']['LYR'] = trim(substr($rawdata, 11, strlen($rawdata) - 11 - 9));\n\t\t\t\t\t$this->Lyrics3LyricsTimestampParse($ParsedLyrics3);\n\t\t\t\t} else {\n\t\t\t\t\t$this->error('\"LYRICSEND\" expected at '.($this->ftell() - 11 + $length - 9).' but found \"'.substr($rawdata, strlen($rawdata) - 9, 9).'\" instead');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tif (substr($rawdata, strlen($rawdata) - 9, 9) == 'LYRICS200') {\n\t\t\t\t\t$ParsedLyrics3['raw']['unparsed'] = substr($rawdata, 11, strlen($rawdata) - 11 - 9 - 6); // LYRICSBEGIN + LYRICS200 + LSZ\n\t\t\t\t\t$rawdata = $ParsedLyrics3['raw']['unparsed'];\n\t\t\t\t\twhile (strlen($rawdata) > 0) {\n\t\t\t\t\t\t$fieldname = substr($rawdata, 0, 3);\n\t\t\t\t\t\t$fieldsize = (int) substr($rawdata, 3, 5);\n\t\t\t\t\t\t$ParsedLyrics3['raw'][$fieldname] = substr($rawdata, 8, $fieldsize);\n\t\t\t\t\t\t$rawdata = substr($rawdata, 3 + 5 + $fieldsize);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($ParsedLyrics3['raw']['IND'])) {\n\t\t\t\t\t\t$i = 0;\n\t\t\t\t\t\t$flagnames = array('lyrics', 'timestamps', 'inhibitrandom');\n\t\t\t\t\t\tforeach ($flagnames as $flagname) {\n\t\t\t\t\t\t\tif (strlen($ParsedLyrics3['raw']['IND']) > $i++) {\n\t\t\t\t\t\t\t\t$ParsedLyrics3['flags'][$flagname] = $this->IntString2Bool(substr($ParsedLyrics3['raw']['IND'], $i, 1 - 1));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$fieldnametranslation = array('ETT'=>'title', 'EAR'=>'artist', 'EAL'=>'album', 'INF'=>'comment', 'AUT'=>'author');\n\t\t\t\t\tforeach ($fieldnametranslation as $key => $value) {\n\t\t\t\t\t\tif (isset($ParsedLyrics3['raw'][$key])) {\n\t\t\t\t\t\t\t$ParsedLyrics3['comments'][$value][] = trim($ParsedLyrics3['raw'][$key]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($ParsedLyrics3['raw']['IMG'])) {\n\t\t\t\t\t\t$imagestrings = explode(\"\\r\\n\", $ParsedLyrics3['raw']['IMG']);\n\t\t\t\t\t\tforeach ($imagestrings as $key => $imagestring) {\n\t\t\t\t\t\t\tif (strpos($imagestring, '||') !== false) {\n\t\t\t\t\t\t\t\t$imagearray = explode('||', $imagestring);\n\t\t\t\t\t\t\t\t$ParsedLyrics3['images'][$key]['filename']     =                                (isset($imagearray[0]) ? $imagearray[0] : '');\n\t\t\t\t\t\t\t\t$ParsedLyrics3['images'][$key]['description']  =                                (isset($imagearray[1]) ? $imagearray[1] : '');\n\t\t\t\t\t\t\t\t$ParsedLyrics3['images'][$key]['timestamp']    = $this->Lyrics3Timestamp2Seconds(isset($imagearray[2]) ? $imagearray[2] : '');\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\tif (isset($ParsedLyrics3['raw']['LYR'])) {\n\t\t\t\t\t\t$this->Lyrics3LyricsTimestampParse($ParsedLyrics3);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->error('\"LYRICS200\" expected at '.($this->ftell() - 11 + $length - 9).' but found \"'.substr($rawdata, strlen($rawdata) - 9, 9).'\" instead');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->error('Cannot process Lyrics3 version '.$version.' (only v1 and v2)');\n\t\t\t\treturn false;\n\t\t}\n\n\n\t\tif (isset($info['id3v1']['tag_offset_start']) && ($info['id3v1']['tag_offset_start'] <= $ParsedLyrics3['tag_offset_end'])) {\n\t\t\t$this->warning('ID3v1 tag information ignored since it appears to be a false synch in Lyrics3 tag data');\n\t\t\tunset($info['id3v1']);\n\t\t\tforeach ($info['warning'] as $key => $value) {\n\t\t\t\tif ($value == 'Some ID3v1 fields do not use NULL characters for padding') {\n\t\t\t\t\tunset($info['warning'][$key]);\n\t\t\t\t\tsort($info['warning']);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$info['lyrics3'] = $ParsedLyrics3;\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $rawtimestamp\n\t *\n\t * @return int|false\n\t */\n\tpublic function Lyrics3Timestamp2Seconds($rawtimestamp) {\n\t\tif (preg_match('#^\\\\[([0-9]{2}):([0-9]{2})\\\\]$#', $rawtimestamp, $regs)) {\n\t\t\treturn (int) (($regs[1] * 60) + $regs[2]);\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * @param array $Lyrics3data\n\t *\n\t * @return bool\n\t */\n\tpublic function Lyrics3LyricsTimestampParse(&$Lyrics3data) {\n\t\t$lyricsarray = explode(\"\\r\\n\", $Lyrics3data['raw']['LYR']);\n\t\t$notimestamplyricsarray = array();\n\t\tforeach ($lyricsarray as $key => $lyricline) {\n\t\t\t$regs = array();\n\t\t\tunset($thislinetimestamps);\n\t\t\twhile (preg_match('#^(\\\\[[0-9]{2}:[0-9]{2}\\\\])#', $lyricline, $regs)) {\n\t\t\t\t$thislinetimestamps[] = $this->Lyrics3Timestamp2Seconds($regs[0]);\n\t\t\t\t$lyricline = str_replace($regs[0], '', $lyricline);\n\t\t\t}\n\t\t\t$notimestamplyricsarray[$key] = $lyricline;\n\t\t\tif (isset($thislinetimestamps) && is_array($thislinetimestamps)) {\n\t\t\t\tsort($thislinetimestamps);\n\t\t\t\tforeach ($thislinetimestamps as $timestampkey => $timestamp) {\n\t\t\t\t\tif (isset($Lyrics3data['synchedlyrics'][$timestamp])) {\n\t\t\t\t\t\t// timestamps only have a 1-second resolution, it's possible that multiple lines\n\t\t\t\t\t\t// could have the same timestamp, if so, append\n\t\t\t\t\t\t$Lyrics3data['synchedlyrics'][$timestamp] .= \"\\r\\n\".$lyricline;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$Lyrics3data['synchedlyrics'][$timestamp] = $lyricline;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$Lyrics3data['unsynchedlyrics'] = implode(\"\\r\\n\", $notimestamplyricsarray);\n\t\tif (isset($Lyrics3data['synchedlyrics']) && is_array($Lyrics3data['synchedlyrics'])) {\n\t\t\tksort($Lyrics3data['synchedlyrics']);\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param string $char\n\t *\n\t * @return bool|null\n\t */\n\tpublic function IntString2Bool($char) {\n\t\tif ($char == '1') {\n\t\t\treturn true;\n\t\t} elseif ($char == '0') {\n\t\t\treturn false;\n\t\t}\n\t\treturn null;\n\t}\n}\n", "num_lines": 327}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * IXR_Base64\n *\n * @package IXR\n * @since 1.5.0\n */\nclass IXR_Base64\n{\n    var $data;\n\n\t/**\n\t * PHP5 constructor.\n\t */\n    function __construct( $data )\n    {\n        $this->data = $data;\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function IXR_Base64( $data ) {\n\t\tself::__construct( $data );\n\t}\n\n    function getXml()\n    {\n        return '<base64>'.base64_encode($this->data).'</base64>';\n    }\n}\n", "num_lines": 33}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * IXR_Client\n *\n * @package IXR\n * @since 1.5.0\n *\n */\nclass IXR_Client\n{\n    var $server;\n    var $port;\n    var $path;\n    var $useragent;\n    var $response;\n    var $message = false;\n    var $debug = false;\n    var $timeout;\n    var $headers = array();\n\n    // Storage place for an error message\n    var $error = false;\n\n\t/**\n\t * PHP5 constructor.\n\t */\n    function __construct( $server, $path = false, $port = 80, $timeout = 15 )\n    {\n        if (!$path) {\n            // Assume we have been given a URL instead\n            $bits = parse_url($server);\n            $this->server = $bits['host'];\n            $this->port = isset($bits['port']) ? $bits['port'] : 80;\n            $this->path = isset($bits['path']) ? $bits['path'] : '/';\n\n            // Make absolutely sure we have a path\n            if (!$this->path) {\n                $this->path = '/';\n            }\n\n            if ( ! empty( $bits['query'] ) ) {\n                $this->path .= '?' . $bits['query'];\n            }\n        } else {\n            $this->server = $server;\n            $this->path = $path;\n            $this->port = $port;\n        }\n        $this->useragent = 'The Incutio XML-RPC PHP Library';\n        $this->timeout = $timeout;\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function IXR_Client( $server, $path = false, $port = 80, $timeout = 15 ) {\n\t\tself::__construct( $server, $path, $port, $timeout );\n\t}\n\n\t/**\n\t * @since 1.5.0\n\t * @since 5.5.0 Formalized the existing `...$args` parameter by adding it\n\t *              to the function signature.\n\t *\n\t * @return bool\n\t */\n    function query( ...$args )\n    {\n        $method = array_shift($args);\n        $request = new IXR_Request($method, $args);\n        $length = $request->getLength();\n        $xml = $request->getXml();\n        $r = \"\\r\\n\";\n        $request  = \"POST {$this->path} HTTP/1.0$r\";\n\n        // Merged from WP #8145 - allow custom headers\n        $this->headers['Host']          = $this->server;\n        $this->headers['Content-Type']  = 'text/xml';\n        $this->headers['User-Agent']    = $this->useragent;\n        $this->headers['Content-Length']= $length;\n\n        foreach( $this->headers as $header => $value ) {\n            $request .= \"{$header}: {$value}{$r}\";\n        }\n        $request .= $r;\n\n        $request .= $xml;\n\n        // Now send the request\n        if ($this->debug) {\n            echo '<pre class=\"ixr_request\">'.htmlspecialchars($request).\"\\n</pre>\\n\\n\";\n        }\n\n        if ($this->timeout) {\n            $fp = @fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout);\n        } else {\n            $fp = @fsockopen($this->server, $this->port, $errno, $errstr);\n        }\n        if (!$fp) {\n            $this->error = new IXR_Error(-32300, 'transport error - could not open socket');\n            return false;\n        }\n        fputs($fp, $request);\n        $contents = '';\n        $debugContents = '';\n        $gotFirstLine = false;\n        $gettingHeaders = true;\n        while (!feof($fp)) {\n            $line = fgets($fp, 4096);\n            if (!$gotFirstLine) {\n                // Check line for '200'\n                if (strstr($line, '200') === false) {\n                    $this->error = new IXR_Error(-32300, 'transport error - HTTP status code was not 200');\n                    return false;\n                }\n                $gotFirstLine = true;\n            }\n            if (trim($line) == '') {\n                $gettingHeaders = false;\n            }\n            if (!$gettingHeaders) {\n            \t// merged from WP #12559 - remove trim\n                $contents .= $line;\n            }\n            if ($this->debug) {\n            \t$debugContents .= $line;\n            }\n        }\n        if ($this->debug) {\n            echo '<pre class=\"ixr_response\">'.htmlspecialchars($debugContents).\"\\n</pre>\\n\\n\";\n        }\n\n        // Now parse what we've got back\n        $this->message = new IXR_Message($contents);\n        if (!$this->message->parse()) {\n            // XML error\n            $this->error = new IXR_Error(-32700, 'parse error. not well formed');\n            return false;\n        }\n\n        // Is the message a fault?\n        if ($this->message->messageType == 'fault') {\n            $this->error = new IXR_Error($this->message->faultCode, $this->message->faultString);\n            return false;\n        }\n\n        // Message must be OK\n        return true;\n    }\n\n    function getResponse()\n    {\n        // methodResponses can only have one param - return that\n        return $this->message->params[0];\n    }\n\n    function isError()\n    {\n        return (is_object($this->error));\n    }\n\n    function getErrorCode()\n    {\n        return $this->error->code;\n    }\n\n    function getErrorMessage()\n    {\n        return $this->error->message;\n    }\n}\n", "num_lines": 173}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * IXR_ClientMulticall\n *\n * @package IXR\n * @since 1.5.0\n */\nclass IXR_ClientMulticall extends IXR_Client\n{\n    var $calls = array();\n\n\t/**\n\t * PHP5 constructor.\n\t */\n    function __construct( $server, $path = false, $port = 80 )\n    {\n        parent::IXR_Client($server, $path, $port);\n        $this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)';\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function IXR_ClientMulticall( $server, $path = false, $port = 80 ) {\n\t\tself::__construct( $server, $path, $port );\n\t}\n\n\t/**\n\t * @since 1.5.0\n\t * @since 5.5.0 Formalized the existing `...$args` parameter by adding it\n\t *              to the function signature.\n\t */\n    function addCall( ...$args )\n    {\n        $methodName = array_shift($args);\n        $struct = array(\n            'methodName' => $methodName,\n            'params' => $args\n        );\n        $this->calls[] = $struct;\n    }\n\n\t/**\n\t * @since 1.5.0\n\t * @since 5.5.0 Formalized the existing `...$args` parameter by adding it\n\t *              to the function signature.\n\t *\n\t * @return bool\n\t */\n    function query( ...$args )\n    {\n        // Prepare multicall, then call the parent::query() method\n        return parent::query('system.multicall', $this->calls);\n    }\n}\n", "num_lines": 56}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * IXR_Date\n *\n * @package IXR\n * @since 1.5.0\n */\nclass IXR_Date {\n    var $year;\n    var $month;\n    var $day;\n    var $hour;\n    var $minute;\n    var $second;\n    var $timezone;\n\n\t/**\n\t * PHP5 constructor.\n\t */\n    function __construct( $time )\n    {\n        // $time can be a PHP timestamp or an ISO one\n        if (is_numeric($time)) {\n            $this->parseTimestamp($time);\n        } else {\n            $this->parseIso($time);\n        }\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function IXR_Date( $time ) {\n\t\tself::__construct( $time );\n\t}\n\n    function parseTimestamp($timestamp)\n    {\n        $this->year = gmdate('Y', $timestamp);\n        $this->month = gmdate('m', $timestamp);\n        $this->day = gmdate('d', $timestamp);\n        $this->hour = gmdate('H', $timestamp);\n        $this->minute = gmdate('i', $timestamp);\n        $this->second = gmdate('s', $timestamp);\n        $this->timezone = '';\n    }\n\n    function parseIso($iso)\n    {\n        $this->year = substr($iso, 0, 4);\n        $this->month = substr($iso, 4, 2);\n        $this->day = substr($iso, 6, 2);\n        $this->hour = substr($iso, 9, 2);\n        $this->minute = substr($iso, 12, 2);\n        $this->second = substr($iso, 15, 2);\n        $this->timezone = substr($iso, 17);\n    }\n\n    function getIso()\n    {\n        return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second.$this->timezone;\n    }\n\n    function getXml()\n    {\n        return '<dateTime.iso8601>'.$this->getIso().'</dateTime.iso8601>';\n    }\n\n    function getTimestamp()\n    {\n        return mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year);\n    }\n}\n", "num_lines": 75}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * IXR_Error\n *\n * @package IXR\n * @since 1.5.0\n */\nclass IXR_Error\n{\n    var $code;\n    var $message;\n\n\t/**\n\t * PHP5 constructor.\n\t */\n    function __construct( $code, $message )\n    {\n        $this->code = $code;\n        $this->message = htmlspecialchars($message);\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function IXR_Error( $code, $message ) {\n\t\tself::__construct( $code, $message );\n\t}\n\n    function getXml()\n    {\n        $xml = <<<EOD\n<methodResponse>\n  <fault>\n    <value>\n      <struct>\n        <member>\n          <name>faultCode</name>\n          <value><int>{$this->code}</int></value>\n        </member>\n        <member>\n          <name>faultString</name>\n          <value><string>{$this->message}</string></value>\n        </member>\n      </struct>\n    </value>\n  </fault>\n</methodResponse>\n\nEOD;\n        return $xml;\n    }\n}\n", "num_lines": 54}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * IXR_IntrospectionServer\n *\n * @package IXR\n * @since 1.5.0\n */\nclass IXR_IntrospectionServer extends IXR_Server\n{\n    var $signatures;\n    var $help;\n\n\t/**\n\t * PHP5 constructor.\n\t */\n    function __construct()\n    {\n        $this->setCallbacks();\n        $this->setCapabilities();\n        $this->capabilities['introspection'] = array(\n            'specUrl' => 'http://xmlrpc.usefulinc.com/doc/reserved.html',\n            'specVersion' => 1\n        );\n        $this->addCallback(\n            'system.methodSignature',\n            'this:methodSignature',\n            array('array', 'string'),\n            'Returns an array describing the return type and required parameters of a method'\n        );\n        $this->addCallback(\n            'system.getCapabilities',\n            'this:getCapabilities',\n            array('struct'),\n            'Returns a struct describing the XML-RPC specifications supported by this server'\n        );\n        $this->addCallback(\n            'system.listMethods',\n            'this:listMethods',\n            array('array'),\n            'Returns an array of available methods on this server'\n        );\n        $this->addCallback(\n            'system.methodHelp',\n            'this:methodHelp',\n            array('string', 'string'),\n            'Returns a documentation string for the specified method'\n        );\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function IXR_IntrospectionServer() {\n\t\tself::__construct();\n\t}\n\n    function addCallback($method, $callback, $args, $help)\n    {\n        $this->callbacks[$method] = $callback;\n        $this->signatures[$method] = $args;\n        $this->help[$method] = $help;\n    }\n\n    function call($methodname, $args)\n    {\n        // Make sure it's in an array\n        if ($args && !is_array($args)) {\n            $args = array($args);\n        }\n\n        // Over-rides default call method, adds signature check\n        if (!$this->hasMethod($methodname)) {\n            return new IXR_Error(-32601, 'server error. requested method \"'.$this->message->methodName.'\" not specified.');\n        }\n        $method = $this->callbacks[$methodname];\n        $signature = $this->signatures[$methodname];\n        $returnType = array_shift($signature);\n\n        // Check the number of arguments\n        if (count($args) != count($signature)) {\n            return new IXR_Error(-32602, 'server error. wrong number of method parameters');\n        }\n\n        // Check the argument types\n        $ok = true;\n        $argsbackup = $args;\n        for ($i = 0, $j = count($args); $i < $j; $i++) {\n            $arg = array_shift($args);\n            $type = array_shift($signature);\n            switch ($type) {\n                case 'int':\n                case 'i4':\n                    if (is_array($arg) || !is_int($arg)) {\n                        $ok = false;\n                    }\n                    break;\n                case 'base64':\n                case 'string':\n                    if (!is_string($arg)) {\n                        $ok = false;\n                    }\n                    break;\n                case 'boolean':\n                    if ($arg !== false && $arg !== true) {\n                        $ok = false;\n                    }\n                    break;\n                case 'float':\n                case 'double':\n                    if (!is_float($arg)) {\n                        $ok = false;\n                    }\n                    break;\n                case 'date':\n                case 'dateTime.iso8601':\n                    if (!is_a($arg, 'IXR_Date')) {\n                        $ok = false;\n                    }\n                    break;\n            }\n            if (!$ok) {\n                return new IXR_Error(-32602, 'server error. invalid method parameters');\n            }\n        }\n        // It passed the test - run the \"real\" method call\n        return parent::call($methodname, $argsbackup);\n    }\n\n    function methodSignature($method)\n    {\n        if (!$this->hasMethod($method)) {\n            return new IXR_Error(-32601, 'server error. requested method \"'.$method.'\" not specified.');\n        }\n        // We should be returning an array of types\n        $types = $this->signatures[$method];\n        $return = array();\n        foreach ($types as $type) {\n            switch ($type) {\n                case 'string':\n                    $return[] = 'string';\n                    break;\n                case 'int':\n                case 'i4':\n                    $return[] = 42;\n                    break;\n                case 'double':\n                    $return[] = 3.1415;\n                    break;\n                case 'dateTime.iso8601':\n                    $return[] = new IXR_Date(time());\n                    break;\n                case 'boolean':\n                    $return[] = true;\n                    break;\n                case 'base64':\n                    $return[] = new IXR_Base64('base64');\n                    break;\n                case 'array':\n                    $return[] = array('array');\n                    break;\n                case 'struct':\n                    $return[] = array('struct' => 'struct');\n                    break;\n            }\n        }\n        return $return;\n    }\n\n    function methodHelp($method)\n    {\n        return $this->help[$method];\n    }\n}\n", "num_lines": 175}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * IXR_MESSAGE\n *\n * @package IXR\n * @since 1.5.0\n *\n */\nclass IXR_Message\n{\n    var $message     = false;\n    var $messageType = false;  // methodCall / methodResponse / fault\n    var $faultCode   = false;\n    var $faultString = false;\n    var $methodName  = '';\n    var $params      = array();\n\n    // Current variable stacks\n    var $_arraystructs = array();   // The stack used to keep track of the current array/struct\n    var $_arraystructstypes = array(); // Stack keeping track of if things are structs or array\n    var $_currentStructName = array();  // A stack as well\n    var $_param;\n    var $_value;\n    var $_currentTag;\n    var $_currentTagContents;\n    // The XML parser\n    var $_parser;\n\n\t/**\n\t * PHP5 constructor.\n\t */\n    function __construct( $message )\n    {\n        $this->message =& $message;\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function IXR_Message( $message ) {\n\t\tself::__construct( $message );\n\t}\n\n    function parse()\n    {\n        if ( ! function_exists( 'xml_parser_create' ) ) {\n            trigger_error( __( \"PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension.\" ) );\n            return false;\n        }\n\n        // first remove the XML declaration\n        // merged from WP #10698 - this method avoids the RAM usage of preg_replace on very large messages\n        $header = preg_replace( '/<\\?xml.*?\\?'.'>/s', '', substr( $this->message, 0, 100 ), 1 );\n        $this->message = trim( substr_replace( $this->message, $header, 0, 100 ) );\n        if ( '' == $this->message ) {\n            return false;\n        }\n\n        // Then remove the DOCTYPE\n        $header = preg_replace( '/^<!DOCTYPE[^>]*+>/i', '', substr( $this->message, 0, 200 ), 1 );\n        $this->message = trim( substr_replace( $this->message, $header, 0, 200 ) );\n        if ( '' == $this->message ) {\n            return false;\n        }\n\n        // Check that the root tag is valid\n        $root_tag = substr( $this->message, 0, strcspn( substr( $this->message, 0, 20 ), \"> \\t\\r\\n\" ) );\n        if ( '<!DOCTYPE' === strtoupper( $root_tag ) ) {\n            return false;\n        }\n        if ( ! in_array( $root_tag, array( '<methodCall', '<methodResponse', '<fault' ) ) ) {\n            return false;\n        }\n\n        // Bail if there are too many elements to parse\n        $element_limit = 30000;\n        if ( function_exists( 'apply_filters' ) ) {\n            /**\n             * Filters the number of elements to parse in an XML-RPC response.\n             *\n             * @since 4.0.0\n             *\n             * @param int $element_limit Default elements limit.\n             */\n            $element_limit = apply_filters( 'xmlrpc_element_limit', $element_limit );\n        }\n        if ( $element_limit && 2 * $element_limit < substr_count( $this->message, '<' ) ) {\n            return false;\n        }\n\n        $this->_parser = xml_parser_create();\n        // Set XML parser to take the case of tags in to account\n        xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false);\n        // Set XML parser callback functions\n        xml_set_object($this->_parser, $this);\n        xml_set_element_handler($this->_parser, 'tag_open', 'tag_close');\n        xml_set_character_data_handler($this->_parser, 'cdata');\n\n        // 256Kb, parse in chunks to avoid the RAM usage on very large messages\n        $chunk_size = 262144;\n\n        /**\n         * Filters the chunk size that can be used to parse an XML-RPC response message.\n         *\n         * @since 4.4.0\n         *\n         * @param int $chunk_size Chunk size to parse in bytes.\n         */\n        $chunk_size = apply_filters( 'xmlrpc_chunk_parsing_size', $chunk_size );\n\n        $final = false;\n\n        do {\n            if (strlen($this->message) <= $chunk_size) {\n                $final = true;\n            }\n\n            $part = substr($this->message, 0, $chunk_size);\n            $this->message = substr($this->message, $chunk_size);\n\n            if (!xml_parse($this->_parser, $part, $final)) {\n                xml_parser_free($this->_parser);\n                unset($this->_parser);\n                return false;\n            }\n\n            if ($final) {\n                break;\n            }\n        } while (true);\n\n        xml_parser_free($this->_parser);\n        unset($this->_parser);\n\n        // Grab the error messages, if any\n        if ($this->messageType == 'fault') {\n            $this->faultCode = $this->params[0]['faultCode'];\n            $this->faultString = $this->params[0]['faultString'];\n        }\n        return true;\n    }\n\n    function tag_open($parser, $tag, $attr)\n    {\n        $this->_currentTagContents = '';\n        $this->currentTag = $tag;\n        switch($tag) {\n            case 'methodCall':\n            case 'methodResponse':\n            case 'fault':\n                $this->messageType = $tag;\n                break;\n                /* Deal with stacks of arrays and structs */\n            case 'data':    // data is to all intents and puposes more interesting than array\n                $this->_arraystructstypes[] = 'array';\n                $this->_arraystructs[] = array();\n                break;\n            case 'struct':\n                $this->_arraystructstypes[] = 'struct';\n                $this->_arraystructs[] = array();\n                break;\n        }\n    }\n\n    function cdata($parser, $cdata)\n    {\n        $this->_currentTagContents .= $cdata;\n    }\n\n    function tag_close($parser, $tag)\n    {\n        $valueFlag = false;\n        switch($tag) {\n            case 'int':\n            case 'i4':\n                $value = (int)trim($this->_currentTagContents);\n                $valueFlag = true;\n                break;\n            case 'double':\n                $value = (double)trim($this->_currentTagContents);\n                $valueFlag = true;\n                break;\n            case 'string':\n                $value = (string)trim($this->_currentTagContents);\n                $valueFlag = true;\n                break;\n            case 'dateTime.iso8601':\n                $value = new IXR_Date(trim($this->_currentTagContents));\n                $valueFlag = true;\n                break;\n            case 'value':\n                // \"If no type is indicated, the type is string.\"\n                if (trim($this->_currentTagContents) != '') {\n                    $value = (string)$this->_currentTagContents;\n                    $valueFlag = true;\n                }\n                break;\n            case 'boolean':\n                $value = (boolean)trim($this->_currentTagContents);\n                $valueFlag = true;\n                break;\n            case 'base64':\n                $value = base64_decode($this->_currentTagContents);\n                $valueFlag = true;\n                break;\n                /* Deal with stacks of arrays and structs */\n            case 'data':\n            case 'struct':\n                $value = array_pop($this->_arraystructs);\n                array_pop($this->_arraystructstypes);\n                $valueFlag = true;\n                break;\n            case 'member':\n                array_pop($this->_currentStructName);\n                break;\n            case 'name':\n                $this->_currentStructName[] = trim($this->_currentTagContents);\n                break;\n            case 'methodName':\n                $this->methodName = trim($this->_currentTagContents);\n                break;\n        }\n\n        if ($valueFlag) {\n            if (count($this->_arraystructs) > 0) {\n                // Add value to struct or array\n                if ($this->_arraystructstypes[count($this->_arraystructstypes)-1] == 'struct') {\n                    // Add to struct\n                    $this->_arraystructs[count($this->_arraystructs)-1][$this->_currentStructName[count($this->_currentStructName)-1]] = $value;\n                } else {\n                    // Add to array\n                    $this->_arraystructs[count($this->_arraystructs)-1][] = $value;\n                }\n            } else {\n                // Just add as a parameter\n                $this->params[] = $value;\n            }\n        }\n        $this->_currentTagContents = '';\n    }\n}\n", "num_lines": 243}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * IXR_Request\n *\n * @package IXR\n * @since 1.5.0\n */\nclass IXR_Request\n{\n    var $method;\n    var $args;\n    var $xml;\n\n\t/**\n\t * PHP5 constructor.\n\t */\n    function __construct($method, $args)\n    {\n        $this->method = $method;\n        $this->args = $args;\n        $this->xml = <<<EOD\n<?xml version=\"1.0\"?>\n<methodCall>\n<methodName>{$this->method}</methodName>\n<params>\n\nEOD;\n        foreach ($this->args as $arg) {\n            $this->xml .= '<param><value>';\n            $v = new IXR_Value($arg);\n            $this->xml .= $v->getXml();\n            $this->xml .= \"</value></param>\\n\";\n        }\n        $this->xml .= '</params></methodCall>';\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function IXR_Request( $method, $args ) {\n\t\tself::__construct( $method, $args );\n\t}\n\n    function getLength()\n    {\n        return strlen($this->xml);\n    }\n\n    function getXml()\n    {\n        return $this->xml;\n    }\n}\n", "num_lines": 55}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * IXR_Server\n *\n * @package IXR\n * @since 1.5.0\n */\nclass IXR_Server\n{\n    var $data;\n    var $callbacks = array();\n    var $message;\n    var $capabilities;\n\n\t/**\n\t * PHP5 constructor.\n\t */\n    function __construct( $callbacks = false, $data = false, $wait = false )\n    {\n        $this->setCapabilities();\n        if ($callbacks) {\n            $this->callbacks = $callbacks;\n        }\n        $this->setCallbacks();\n        if (!$wait) {\n            $this->serve($data);\n        }\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function IXR_Server( $callbacks = false, $data = false, $wait = false ) {\n\t\tself::__construct( $callbacks, $data, $wait );\n\t}\n\n    function serve($data = false)\n    {\n        if (!$data) {\n            if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] !== 'POST') {\n                if ( function_exists( 'status_header' ) ) {\n                    status_header( 405 ); // WP #20986\n                    header( 'Allow: POST' );\n                }\n                header('Content-Type: text/plain'); // merged from WP #9093\n                die('XML-RPC server accepts POST requests only.');\n            }\n\n            $data = file_get_contents('php://input');\n        }\n        $this->message = new IXR_Message($data);\n        if (!$this->message->parse()) {\n            $this->error(-32700, 'parse error. not well formed');\n        }\n        if ($this->message->messageType != 'methodCall') {\n            $this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall');\n        }\n        $result = $this->call($this->message->methodName, $this->message->params);\n\n        // Is the result an error?\n        if (is_a($result, 'IXR_Error')) {\n            $this->error($result);\n        }\n\n        // Encode the result\n        $r = new IXR_Value($result);\n        $resultxml = $r->getXml();\n\n        // Create the XML\n        $xml = <<<EOD\n<methodResponse>\n  <params>\n    <param>\n      <value>\n      $resultxml\n      </value>\n    </param>\n  </params>\n</methodResponse>\n\nEOD;\n      // Send it\n      $this->output($xml);\n    }\n\n    function call($methodname, $args)\n    {\n        if (!$this->hasMethod($methodname)) {\n            return new IXR_Error(-32601, 'server error. requested method '.$methodname.' does not exist.');\n        }\n        $method = $this->callbacks[$methodname];\n\n        // Perform the callback and send the response\n        if (count($args) == 1) {\n            // If only one parameter just send that instead of the whole array\n            $args = $args[0];\n        }\n\n        // Are we dealing with a function or a method?\n        if (is_string($method) && substr($method, 0, 5) == 'this:') {\n            // It's a class method - check it exists\n            $method = substr($method, 5);\n            if (!method_exists($this, $method)) {\n                return new IXR_Error(-32601, 'server error. requested class method \"'.$method.'\" does not exist.');\n            }\n\n            //Call the method\n            $result = $this->$method($args);\n        } else {\n            // It's a function - does it exist?\n            if (is_array($method)) {\n                if (!is_callable(array($method[0], $method[1]))) {\n                    return new IXR_Error(-32601, 'server error. requested object method \"'.$method[1].'\" does not exist.');\n                }\n            } else if (!function_exists($method)) {\n                return new IXR_Error(-32601, 'server error. requested function \"'.$method.'\" does not exist.');\n            }\n\n            // Call the function\n            $result = call_user_func($method, $args);\n        }\n        return $result;\n    }\n\n    function error($error, $message = false)\n    {\n        // Accepts either an error object or an error code and message\n        if ($message && !is_object($error)) {\n            $error = new IXR_Error($error, $message);\n        }\n        $this->output($error->getXml());\n    }\n\n    function output($xml)\n    {\n        $charset = function_exists('get_option') ? get_option('blog_charset') : '';\n        if ($charset)\n            $xml = '<?xml version=\"1.0\" encoding=\"'.$charset.'\"?>'.\"\\n\".$xml;\n        else\n            $xml = '<?xml version=\"1.0\"?>'.\"\\n\".$xml;\n        $length = strlen($xml);\n        header('Connection: close');\n        if ($charset)\n            header('Content-Type: text/xml; charset='.$charset);\n        else\n            header('Content-Type: text/xml');\n        header('Date: '.gmdate('r'));\n        echo $xml;\n        exit;\n    }\n\n    function hasMethod($method)\n    {\n        return in_array($method, array_keys($this->callbacks));\n    }\n\n    function setCapabilities()\n    {\n        // Initialises capabilities array\n        $this->capabilities = array(\n            'xmlrpc' => array(\n                'specUrl' => 'http://www.xmlrpc.com/spec',\n                'specVersion' => 1\n        ),\n            'faults_interop' => array(\n                'specUrl' => 'http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php',\n                'specVersion' => 20010516\n        ),\n            'system.multicall' => array(\n                'specUrl' => 'http://www.xmlrpc.com/discuss/msgReader$1208',\n                'specVersion' => 1\n        ),\n        );\n    }\n\n    function getCapabilities($args)\n    {\n        return $this->capabilities;\n    }\n\n    function setCallbacks()\n    {\n        $this->callbacks['system.getCapabilities'] = 'this:getCapabilities';\n        $this->callbacks['system.listMethods'] = 'this:listMethods';\n        $this->callbacks['system.multicall'] = 'this:multiCall';\n    }\n\n    function listMethods($args)\n    {\n        // Returns a list of methods - uses array_reverse to ensure user defined\n        // methods are listed before server defined methods\n        return array_reverse(array_keys($this->callbacks));\n    }\n\n    function multiCall($methodcalls)\n    {\n        // See http://www.xmlrpc.com/discuss/msgReader$1208\n        $return = array();\n        foreach ($methodcalls as $call) {\n            $method = $call['methodName'];\n            $params = $call['params'];\n            if ($method == 'system.multicall') {\n                $result = new IXR_Error(-32600, 'Recursive calls to system.multicall are forbidden');\n            } else {\n                $result = $this->call($method, $params);\n            }\n            if (is_a($result, 'IXR_Error')) {\n                $return[] = array(\n                    'faultCode' => $result->code,\n                    'faultString' => $result->message\n                );\n            } else {\n                $return[] = array($result);\n            }\n        }\n        return $return;\n    }\n}\n", "num_lines": 220}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * IXR_Value\n *\n * @package IXR\n * @since 1.5.0\n */\nclass IXR_Value {\n    var $data;\n    var $type;\n\n\t/**\n\t * PHP5 constructor.\n\t */\n\tfunction __construct( $data, $type = false )\n    {\n        $this->data = $data;\n        if (!$type) {\n            $type = $this->calculateType();\n        }\n        $this->type = $type;\n        if ($type == 'struct') {\n            // Turn all the values in the array in to new IXR_Value objects\n            foreach ($this->data as $key => $value) {\n                $this->data[$key] = new IXR_Value($value);\n            }\n        }\n        if ($type == 'array') {\n            for ($i = 0, $j = count($this->data); $i < $j; $i++) {\n                $this->data[$i] = new IXR_Value($this->data[$i]);\n            }\n        }\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function IXR_Value( $data, $type = false ) {\n\t\tself::__construct( $data, $type );\n\t}\n\n    function calculateType()\n    {\n        if ($this->data === true || $this->data === false) {\n            return 'boolean';\n        }\n        if (is_integer($this->data)) {\n            return 'int';\n        }\n        if (is_double($this->data)) {\n            return 'double';\n        }\n\n        // Deal with IXR object types base64 and date\n        if (is_object($this->data) && is_a($this->data, 'IXR_Date')) {\n            return 'date';\n        }\n        if (is_object($this->data) && is_a($this->data, 'IXR_Base64')) {\n            return 'base64';\n        }\n\n        // If it is a normal PHP object convert it in to a struct\n        if (is_object($this->data)) {\n            $this->data = get_object_vars($this->data);\n            return 'struct';\n        }\n        if (!is_array($this->data)) {\n            return 'string';\n        }\n\n        // We have an array - is it an array or a struct?\n        if ($this->isStruct($this->data)) {\n            return 'struct';\n        } else {\n            return 'array';\n        }\n    }\n\n    function getXml()\n    {\n        // Return XML for this value\n        switch ($this->type) {\n            case 'boolean':\n                return '<boolean>'.(($this->data) ? '1' : '0').'</boolean>';\n                break;\n            case 'int':\n                return '<int>'.$this->data.'</int>';\n                break;\n            case 'double':\n                return '<double>'.$this->data.'</double>';\n                break;\n            case 'string':\n                return '<string>'.htmlspecialchars($this->data).'</string>';\n                break;\n            case 'array':\n                $return = '<array><data>'.\"\\n\";\n                foreach ($this->data as $item) {\n                    $return .= '  <value>'.$item->getXml().\"</value>\\n\";\n                }\n                $return .= '</data></array>';\n                return $return;\n                break;\n            case 'struct':\n                $return = '<struct>'.\"\\n\";\n                foreach ($this->data as $name => $value) {\n\t\t\t\t\t$name = htmlspecialchars($name);\n                    $return .= \"  <member><name>$name</name><value>\";\n                    $return .= $value->getXml().\"</value></member>\\n\";\n                }\n                $return .= '</struct>';\n                return $return;\n                break;\n            case 'date':\n            case 'base64':\n                return $this->data->getXml();\n                break;\n        }\n        return false;\n    }\n\n    /**\n     * Checks whether or not the supplied array is a struct or not\n     *\n     * @param array $array\n     * @return bool\n     */\n    function isStruct($array)\n    {\n        $expected = 0;\n        foreach ($array as $key => $value) {\n            if ((string)$key !== (string)$expected) {\n                return true;\n            }\n            $expected++;\n        }\n        return false;\n    }\n}\n", "num_lines": 139}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Not used in core since 5.1.\n * This is a back-compat for plugins that may be using this method of loading directly.\n */\n\n/**\n * Disable error reporting\n *\n * Set this to error_reporting( -1 ) for debugging.\n */\nerror_reporting( 0 );\n\n$basepath = __DIR__;\n\nfunction get_file( $path ) {\n\n\tif ( function_exists( 'realpath' ) ) {\n\t\t$path = realpath( $path );\n\t}\n\n\tif ( ! $path || ! @is_file( $path ) ) {\n\t\treturn false;\n\t}\n\n\treturn @file_get_contents( $path );\n}\n\n$expires_offset = 31536000; // 1 year.\n\nheader( 'Content-Type: application/javascript; charset=UTF-8' );\nheader( 'Vary: Accept-Encoding' ); // Handle proxies.\nheader( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' );\nheader( \"Cache-Control: public, max-age=$expires_offset\" );\n\n$file = get_file( $basepath . '/wp-tinymce.js' );\nif ( isset( $_GET['c'] ) && $file ) {\n\techo $file;\n} else {\n\t// Even further back compat.\n\techo get_file( $basepath . '/tinymce.min.js' );\n\techo get_file( $basepath . '/plugins/compat3x/plugin.min.js' );\n}\nexit;\n", "num_lines": 45}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * PHPMailer Exception class.\n * PHP Version 5.5.\n *\n * @see       https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project\n *\n * @author    Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>\n * @author    Jim Jagielski (jimjag) <jimjag@gmail.com>\n * @author    Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>\n * @author    Brent R. Matzelle (original founder)\n * @copyright 2012 - 2017 Marcus Bointon\n * @copyright 2010 - 2012 Jim Jagielski\n * @copyright 2004 - 2009 Andy Prevost\n * @license   http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License\n * @note      This program is distributed in the hope that it will be useful - WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE.\n */\n\nnamespace PHPMailer\\PHPMailer;\n\n/**\n * PHPMailer exception handler.\n *\n * @author Marcus Bointon <phpmailer@synchromedia.co.uk>\n */\nclass Exception extends \\Exception\n{\n    /**\n     * Prettify error message output.\n     *\n     * @return string\n     */\n    public function errorMessage()\n    {\n        return '<strong>' . htmlspecialchars($this->getMessage()) . \"</strong><br />\\n\";\n    }\n}\n", "num_lines": 40}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * PHPMailer - PHP email creation and transport class.\n * PHP Version 5.5.\n *\n * @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project\n *\n * @author    Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>\n * @author    Jim Jagielski (jimjag) <jimjag@gmail.com>\n * @author    Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>\n * @author    Brent R. Matzelle (original founder)\n * @copyright 2012 - 2019 Marcus Bointon\n * @copyright 2010 - 2012 Jim Jagielski\n * @copyright 2004 - 2009 Andy Prevost\n * @license   http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License\n * @note      This program is distributed in the hope that it will be useful - WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE.\n */\n\nnamespace PHPMailer\\PHPMailer;\n\n/**\n * PHPMailer - PHP email creation and transport class.\n *\n * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>\n * @author Jim Jagielski (jimjag) <jimjag@gmail.com>\n * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>\n * @author Brent R. Matzelle (original founder)\n */\nclass PHPMailer\n{\n    const CHARSET_ASCII = 'us-ascii';\n    const CHARSET_ISO88591 = 'iso-8859-1';\n    const CHARSET_UTF8 = 'utf-8';\n\n    const CONTENT_TYPE_PLAINTEXT = 'text/plain';\n    const CONTENT_TYPE_TEXT_CALENDAR = 'text/calendar';\n    const CONTENT_TYPE_TEXT_HTML = 'text/html';\n    const CONTENT_TYPE_MULTIPART_ALTERNATIVE = 'multipart/alternative';\n    const CONTENT_TYPE_MULTIPART_MIXED = 'multipart/mixed';\n    const CONTENT_TYPE_MULTIPART_RELATED = 'multipart/related';\n\n    const ENCODING_7BIT = '7bit';\n    const ENCODING_8BIT = '8bit';\n    const ENCODING_BASE64 = 'base64';\n    const ENCODING_BINARY = 'binary';\n    const ENCODING_QUOTED_PRINTABLE = 'quoted-printable';\n\n    const ENCRYPTION_STARTTLS = 'tls';\n    const ENCRYPTION_SMTPS = 'ssl';\n\n    const ICAL_METHOD_REQUEST = 'REQUEST';\n    const ICAL_METHOD_PUBLISH = 'PUBLISH';\n    const ICAL_METHOD_REPLY = 'REPLY';\n    const ICAL_METHOD_ADD = 'ADD';\n    const ICAL_METHOD_CANCEL = 'CANCEL';\n    const ICAL_METHOD_REFRESH = 'REFRESH';\n    const ICAL_METHOD_COUNTER = 'COUNTER';\n    const ICAL_METHOD_DECLINECOUNTER = 'DECLINECOUNTER';\n\n    /**\n     * Email priority.\n     * Options: null (default), 1 = High, 3 = Normal, 5 = low.\n     * When null, the header is not set at all.\n     *\n     * @var int|null\n     */\n    public $Priority;\n\n    /**\n     * The character set of the message.\n     *\n     * @var string\n     */\n    public $CharSet = self::CHARSET_ISO88591;\n\n    /**\n     * The MIME Content-type of the message.\n     *\n     * @var string\n     */\n    public $ContentType = self::CONTENT_TYPE_PLAINTEXT;\n\n    /**\n     * The message encoding.\n     * Options: \"8bit\", \"7bit\", \"binary\", \"base64\", and \"quoted-printable\".\n     *\n     * @var string\n     */\n    public $Encoding = self::ENCODING_8BIT;\n\n    /**\n     * Holds the most recent mailer error message.\n     *\n     * @var string\n     */\n    public $ErrorInfo = '';\n\n    /**\n     * The From email address for the message.\n     *\n     * @var string\n     */\n    public $From = 'root@localhost';\n\n    /**\n     * The From name of the message.\n     *\n     * @var string\n     */\n    public $FromName = 'Root User';\n\n    /**\n     * The envelope sender of the message.\n     * This will usually be turned into a Return-Path header by the receiver,\n     * and is the address that bounces will be sent to.\n     * If not empty, will be passed via `-f` to sendmail or as the 'MAIL FROM' value over SMTP.\n     *\n     * @var string\n     */\n    public $Sender = '';\n\n    /**\n     * The Subject of the message.\n     *\n     * @var string\n     */\n    public $Subject = '';\n\n    /**\n     * An HTML or plain text message body.\n     * If HTML then call isHTML(true).\n     *\n     * @var string\n     */\n    public $Body = '';\n\n    /**\n     * The plain-text message body.\n     * This body can be read by mail clients that do not have HTML email\n     * capability such as mutt & Eudora.\n     * Clients that can read HTML will view the normal Body.\n     *\n     * @var string\n     */\n    public $AltBody = '';\n\n    /**\n     * An iCal message part body.\n     * Only supported in simple alt or alt_inline message types\n     * To generate iCal event structures, use classes like EasyPeasyICS or iCalcreator.\n     *\n     * @see http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/\n     * @see http://kigkonsult.se/iCalcreator/\n     *\n     * @var string\n     */\n    public $Ical = '';\n\n    /**\n     * Value-array of \"method\" in Contenttype header \"text/calendar\"\n     *\n     * @var string[]\n     */\n    protected static $IcalMethods = [\n        self::ICAL_METHOD_REQUEST,\n        self::ICAL_METHOD_PUBLISH,\n        self::ICAL_METHOD_REPLY,\n        self::ICAL_METHOD_ADD,\n        self::ICAL_METHOD_CANCEL,\n        self::ICAL_METHOD_REFRESH,\n        self::ICAL_METHOD_COUNTER,\n        self::ICAL_METHOD_DECLINECOUNTER,\n    ];\n\n    /**\n     * The complete compiled MIME message body.\n     *\n     * @var string\n     */\n    protected $MIMEBody = '';\n\n    /**\n     * The complete compiled MIME message headers.\n     *\n     * @var string\n     */\n    protected $MIMEHeader = '';\n\n    /**\n     * Extra headers that createHeader() doesn't fold in.\n     *\n     * @var string\n     */\n    protected $mailHeader = '';\n\n    /**\n     * Word-wrap the message body to this number of chars.\n     * Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance.\n     *\n     * @see static::STD_LINE_LENGTH\n     *\n     * @var int\n     */\n    public $WordWrap = 0;\n\n    /**\n     * Which method to use to send mail.\n     * Options: \"mail\", \"sendmail\", or \"smtp\".\n     *\n     * @var string\n     */\n    public $Mailer = 'mail';\n\n    /**\n     * The path to the sendmail program.\n     *\n     * @var string\n     */\n    public $Sendmail = '/usr/sbin/sendmail';\n\n    /**\n     * Whether mail() uses a fully sendmail-compatible MTA.\n     * One which supports sendmail's \"-oi -f\" options.\n     *\n     * @var bool\n     */\n    public $UseSendmailOptions = true;\n\n    /**\n     * The email address that a reading confirmation should be sent to, also known as read receipt.\n     *\n     * @var string\n     */\n    public $ConfirmReadingTo = '';\n\n    /**\n     * The hostname to use in the Message-ID header and as default HELO string.\n     * If empty, PHPMailer attempts to find one with, in order,\n     * $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value\n     * 'localhost.localdomain'.\n     *\n     * @see PHPMailer::$Helo\n     *\n     * @var string\n     */\n    public $Hostname = '';\n\n    /**\n     * An ID to be used in the Message-ID header.\n     * If empty, a unique id will be generated.\n     * You can set your own, but it must be in the format \"<id@domain>\",\n     * as defined in RFC5322 section 3.6.4 or it will be ignored.\n     *\n     * @see https://tools.ietf.org/html/rfc5322#section-3.6.4\n     *\n     * @var string\n     */\n    public $MessageID = '';\n\n    /**\n     * The message Date to be used in the Date header.\n     * If empty, the current date will be added.\n     *\n     * @var string\n     */\n    public $MessageDate = '';\n\n    /**\n     * SMTP hosts.\n     * Either a single hostname or multiple semicolon-delimited hostnames.\n     * You can also specify a different port\n     * for each host by using this format: [hostname:port]\n     * (e.g. \"smtp1.example.com:25;smtp2.example.com\").\n     * You can also specify encryption type, for example:\n     * (e.g. \"tls://smtp1.example.com:587;ssl://smtp2.example.com:465\").\n     * Hosts will be tried in order.\n     *\n     * @var string\n     */\n    public $Host = 'localhost';\n\n    /**\n     * The default SMTP server port.\n     *\n     * @var int\n     */\n    public $Port = 25;\n\n    /**\n     * The SMTP HELO/EHLO name used for the SMTP connection.\n     * Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find\n     * one with the same method described above for $Hostname.\n     *\n     * @see PHPMailer::$Hostname\n     *\n     * @var string\n     */\n    public $Helo = '';\n\n    /**\n     * What kind of encryption to use on the SMTP connection.\n     * Options: '', static::ENCRYPTION_STARTTLS, or static::ENCRYPTION_SMTPS.\n     *\n     * @var string\n     */\n    public $SMTPSecure = '';\n\n    /**\n     * Whether to enable TLS encryption automatically if a server supports it,\n     * even if `SMTPSecure` is not set to 'tls'.\n     * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid.\n     *\n     * @var bool\n     */\n    public $SMTPAutoTLS = true;\n\n    /**\n     * Whether to use SMTP authentication.\n     * Uses the Username and Password properties.\n     *\n     * @see PHPMailer::$Username\n     * @see PHPMailer::$Password\n     *\n     * @var bool\n     */\n    public $SMTPAuth = false;\n\n    /**\n     * Options array passed to stream_context_create when connecting via SMTP.\n     *\n     * @var array\n     */\n    public $SMTPOptions = [];\n\n    /**\n     * SMTP username.\n     *\n     * @var string\n     */\n    public $Username = '';\n\n    /**\n     * SMTP password.\n     *\n     * @var string\n     */\n    public $Password = '';\n\n    /**\n     * SMTP auth type.\n     * Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2, attempted in that order if not specified.\n     *\n     * @var string\n     */\n    public $AuthType = '';\n\n    /**\n     * An instance of the PHPMailer OAuth class.\n     *\n     * @var OAuth\n     */\n    protected $oauth;\n\n    /**\n     * The SMTP server timeout in seconds.\n     * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2.\n     *\n     * @var int\n     */\n    public $Timeout = 300;\n\n    /**\n     * Comma separated list of DSN notifications\n     * 'NEVER' under no circumstances a DSN must be returned to the sender.\n     *         If you use NEVER all other notifications will be ignored.\n     * 'SUCCESS' will notify you when your mail has arrived at its destination.\n     * 'FAILURE' will arrive if an error occurred during delivery.\n     * 'DELAY'   will notify you if there is an unusual delay in delivery, but the actual\n     *           delivery's outcome (success or failure) is not yet decided.\n     *\n     * @see https://tools.ietf.org/html/rfc3461 See section 4.1 for more information about NOTIFY\n     */\n    public $dsn = '';\n\n    /**\n     * SMTP class debug output mode.\n     * Debug output level.\n     * Options:\n     * * SMTP::DEBUG_OFF: No output\n     * * SMTP::DEBUG_CLIENT: Client messages\n     * * SMTP::DEBUG_SERVER: Client and server messages\n     * * SMTP::DEBUG_CONNECTION: As SERVER plus connection status\n     * * SMTP::DEBUG_LOWLEVEL: Noisy, low-level data output, rarely needed\n     *\n     * @see SMTP::$do_debug\n     *\n     * @var int\n     */\n    public $SMTPDebug = 0;\n\n    /**\n     * How to handle debug output.\n     * Options:\n     * * `echo` Output plain-text as-is, appropriate for CLI\n     * * `html` Output escaped, line breaks converted to `<br>`, appropriate for browser output\n     * * `error_log` Output to error log as configured in php.ini\n     * By default PHPMailer will use `echo` if run from a `cli` or `cli-server` SAPI, `html` otherwise.\n     * Alternatively, you can provide a callable expecting two params: a message string and the debug level:\n     *\n     * ```php\n     * $mail->Debugoutput = function($str, $level) {echo \"debug level $level; message: $str\";};\n     * ```\n     *\n     * Alternatively, you can pass in an instance of a PSR-3 compatible logger, though only `debug`\n     * level output is used:\n     *\n     * ```php\n     * $mail->Debugoutput = new myPsr3Logger;\n     * ```\n     *\n     * @see SMTP::$Debugoutput\n     *\n     * @var string|callable|\\Psr\\Log\\LoggerInterface\n     */\n    public $Debugoutput = 'echo';\n\n    /**\n     * Whether to keep SMTP connection open after each message.\n     * If this is set to true then to close the connection\n     * requires an explicit call to smtpClose().\n     *\n     * @var bool\n     */\n    public $SMTPKeepAlive = false;\n\n    /**\n     * Whether to split multiple to addresses into multiple messages\n     * or send them all in one message.\n     * Only supported in `mail` and `sendmail` transports, not in SMTP.\n     *\n     * @var bool\n     */\n    public $SingleTo = false;\n\n    /**\n     * Storage for addresses when SingleTo is enabled.\n     *\n     * @var array\n     */\n    protected $SingleToArray = [];\n\n    /**\n     * Whether to generate VERP addresses on send.\n     * Only applicable when sending via SMTP.\n     *\n     * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path\n     * @see http://www.postfix.org/VERP_README.html Postfix VERP info\n     *\n     * @var bool\n     */\n    public $do_verp = false;\n\n    /**\n     * Whether to allow sending messages with an empty body.\n     *\n     * @var bool\n     */\n    public $AllowEmpty = false;\n\n    /**\n     * DKIM selector.\n     *\n     * @var string\n     */\n    public $DKIM_selector = '';\n\n    /**\n     * DKIM Identity.\n     * Usually the email address used as the source of the email.\n     *\n     * @var string\n     */\n    public $DKIM_identity = '';\n\n    /**\n     * DKIM passphrase.\n     * Used if your key is encrypted.\n     *\n     * @var string\n     */\n    public $DKIM_passphrase = '';\n\n    /**\n     * DKIM signing domain name.\n     *\n     * @example 'example.com'\n     *\n     * @var string\n     */\n    public $DKIM_domain = '';\n\n    /**\n     * DKIM Copy header field values for diagnostic use.\n     *\n     * @var bool\n     */\n    public $DKIM_copyHeaderFields = true;\n\n    /**\n     * DKIM Extra signing headers.\n     *\n     * @example ['List-Unsubscribe', 'List-Help']\n     *\n     * @var array\n     */\n    public $DKIM_extraHeaders = [];\n\n    /**\n     * DKIM private key file path.\n     *\n     * @var string\n     */\n    public $DKIM_private = '';\n\n    /**\n     * DKIM private key string.\n     *\n     * If set, takes precedence over `$DKIM_private`.\n     *\n     * @var string\n     */\n    public $DKIM_private_string = '';\n\n    /**\n     * Callback Action function name.\n     *\n     * The function that handles the result of the send email action.\n     * It is called out by send() for each email sent.\n     *\n     * Value can be any php callable: http://www.php.net/is_callable\n     *\n     * Parameters:\n     *   bool $result        result of the send action\n     *   array   $to            email addresses of the recipients\n     *   array   $cc            cc email addresses\n     *   array   $bcc           bcc email addresses\n     *   string  $subject       the subject\n     *   string  $body          the email body\n     *   string  $from          email address of sender\n     *   string  $extra         extra information of possible use\n     *                          \"smtp_transaction_id' => last smtp transaction id\n     *\n     * @var string\n     */\n    public $action_function = '';\n\n    /**\n     * What to put in the X-Mailer header.\n     * Options: An empty string for PHPMailer default, whitespace/null for none, or a string to use.\n     *\n     * @var string|null\n     */\n    public $XMailer = '';\n\n    /**\n     * Which validator to use by default when validating email addresses.\n     * May be a callable to inject your own validator, but there are several built-in validators.\n     * The default validator uses PHP's FILTER_VALIDATE_EMAIL filter_var option.\n     *\n     * @see PHPMailer::validateAddress()\n     *\n     * @var string|callable\n     */\n    public static $validator = 'php';\n\n    /**\n     * An instance of the SMTP sender class.\n     *\n     * @var SMTP\n     */\n    protected $smtp;\n\n    /**\n     * The array of 'to' names and addresses.\n     *\n     * @var array\n     */\n    protected $to = [];\n\n    /**\n     * The array of 'cc' names and addresses.\n     *\n     * @var array\n     */\n    protected $cc = [];\n\n    /**\n     * The array of 'bcc' names and addresses.\n     *\n     * @var array\n     */\n    protected $bcc = [];\n\n    /**\n     * The array of reply-to names and addresses.\n     *\n     * @var array\n     */\n    protected $ReplyTo = [];\n\n    /**\n     * An array of all kinds of addresses.\n     * Includes all of $to, $cc, $bcc.\n     *\n     * @see PHPMailer::$to\n     * @see PHPMailer::$cc\n     * @see PHPMailer::$bcc\n     *\n     * @var array\n     */\n    protected $all_recipients = [];\n\n    /**\n     * An array of names and addresses queued for validation.\n     * In send(), valid and non duplicate entries are moved to $all_recipients\n     * and one of $to, $cc, or $bcc.\n     * This array is used only for addresses with IDN.\n     *\n     * @see PHPMailer::$to\n     * @see PHPMailer::$cc\n     * @see PHPMailer::$bcc\n     * @see PHPMailer::$all_recipients\n     *\n     * @var array\n     */\n    protected $RecipientsQueue = [];\n\n    /**\n     * An array of reply-to names and addresses queued for validation.\n     * In send(), valid and non duplicate entries are moved to $ReplyTo.\n     * This array is used only for addresses with IDN.\n     *\n     * @see PHPMailer::$ReplyTo\n     *\n     * @var array\n     */\n    protected $ReplyToQueue = [];\n\n    /**\n     * The array of attachments.\n     *\n     * @var array\n     */\n    protected $attachment = [];\n\n    /**\n     * The array of custom headers.\n     *\n     * @var array\n     */\n    protected $CustomHeader = [];\n\n    /**\n     * The most recent Message-ID (including angular brackets).\n     *\n     * @var string\n     */\n    protected $lastMessageID = '';\n\n    /**\n     * The message's MIME type.\n     *\n     * @var string\n     */\n    protected $message_type = '';\n\n    /**\n     * The array of MIME boundary strings.\n     *\n     * @var array\n     */\n    protected $boundary = [];\n\n    /**\n     * The array of available languages.\n     *\n     * @var array\n     */\n    protected $language = [];\n\n    /**\n     * The number of errors encountered.\n     *\n     * @var int\n     */\n    protected $error_count = 0;\n\n    /**\n     * The S/MIME certificate file path.\n     *\n     * @var string\n     */\n    protected $sign_cert_file = '';\n\n    /**\n     * The S/MIME key file path.\n     *\n     * @var string\n     */\n    protected $sign_key_file = '';\n\n    /**\n     * The optional S/MIME extra certificates (\"CA Chain\") file path.\n     *\n     * @var string\n     */\n    protected $sign_extracerts_file = '';\n\n    /**\n     * The S/MIME password for the key.\n     * Used only if the key is encrypted.\n     *\n     * @var string\n     */\n    protected $sign_key_pass = '';\n\n    /**\n     * Whether to throw exceptions for errors.\n     *\n     * @var bool\n     */\n    protected $exceptions = false;\n\n    /**\n     * Unique ID used for message ID and boundaries.\n     *\n     * @var string\n     */\n    protected $uniqueid = '';\n\n    /**\n     * The PHPMailer Version number.\n     *\n     * @var string\n     */\n    const VERSION = '6.1.6';\n\n    /**\n     * Error severity: message only, continue processing.\n     *\n     * @var int\n     */\n    const STOP_MESSAGE = 0;\n\n    /**\n     * Error severity: message, likely ok to continue processing.\n     *\n     * @var int\n     */\n    const STOP_CONTINUE = 1;\n\n    /**\n     * Error severity: message, plus full stop, critical error reached.\n     *\n     * @var int\n     */\n    const STOP_CRITICAL = 2;\n\n    /**\n     * The SMTP standard CRLF line break.\n     * If you want to change line break format, change static::$LE, not this.\n     */\n    const CRLF = \"\\r\\n\";\n\n    /**\n     * \"Folding White Space\" a white space string used for line folding.\n     */\n    const FWS = ' ';\n\n    /**\n     * SMTP RFC standard line ending; Carriage Return, Line Feed.\n     *\n     * @var string\n     */\n    protected static $LE = self::CRLF;\n\n    /**\n     * The maximum line length supported by mail().\n     *\n     * Background: mail() will sometimes corrupt messages\n     * with headers headers longer than 65 chars, see #818.\n     *\n     * @var int\n     */\n    const MAIL_MAX_LINE_LENGTH = 63;\n\n    /**\n     * The maximum line length allowed by RFC 2822 section 2.1.1.\n     *\n     * @var int\n     */\n    const MAX_LINE_LENGTH = 998;\n\n    /**\n     * The lower maximum line length allowed by RFC 2822 section 2.1.1.\n     * This length does NOT include the line break\n     * 76 means that lines will be 77 or 78 chars depending on whether\n     * the line break format is LF or CRLF; both are valid.\n     *\n     * @var int\n     */\n    const STD_LINE_LENGTH = 76;\n\n    /**\n     * Constructor.\n     *\n     * @param bool $exceptions Should we throw external exceptions?\n     */\n    public function __construct($exceptions = null)\n    {\n        if (null !== $exceptions) {\n            $this->exceptions = (bool) $exceptions;\n        }\n        //Pick an appropriate debug output format automatically\n        $this->Debugoutput = (strpos(PHP_SAPI, 'cli') !== false ? 'echo' : 'html');\n    }\n\n    /**\n     * Destructor.\n     */\n    public function __destruct()\n    {\n        //Close any open SMTP connection nicely\n        $this->smtpClose();\n    }\n\n    /**\n     * Call mail() in a safe_mode-aware fashion.\n     * Also, unless sendmail_path points to sendmail (or something that\n     * claims to be sendmail), don't pass params (not a perfect fix,\n     * but it will do).\n     *\n     * @param string      $to      To\n     * @param string      $subject Subject\n     * @param string      $body    Message Body\n     * @param string      $header  Additional Header(s)\n     * @param string|null $params  Params\n     *\n     * @return bool\n     */\n    private function mailPassthru($to, $subject, $body, $header, $params)\n    {\n        //Check overloading of mail function to avoid double-encoding\n        if (ini_get('mbstring.func_overload') & 1) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated\n            $subject = $this->secureHeader($subject);\n        } else {\n            $subject = $this->encodeHeader($this->secureHeader($subject));\n        }\n        //Calling mail() with null params breaks\n        if (!$this->UseSendmailOptions || null === $params) {\n            $result = @mail($to, $subject, $body, $header);\n        } else {\n            $result = @mail($to, $subject, $body, $header, $params);\n        }\n\n        return $result;\n    }\n\n    /**\n     * Output debugging info via user-defined method.\n     * Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug).\n     *\n     * @see PHPMailer::$Debugoutput\n     * @see PHPMailer::$SMTPDebug\n     *\n     * @param string $str\n     */\n    protected function edebug($str)\n    {\n        if ($this->SMTPDebug <= 0) {\n            return;\n        }\n        //Is this a PSR-3 logger?\n        if ($this->Debugoutput instanceof \\Psr\\Log\\LoggerInterface) {\n            $this->Debugoutput->debug($str);\n\n            return;\n        }\n        //Avoid clash with built-in function names\n        if (is_callable($this->Debugoutput) && !in_array($this->Debugoutput, ['error_log', 'html', 'echo'])) {\n            call_user_func($this->Debugoutput, $str, $this->SMTPDebug);\n\n            return;\n        }\n        switch ($this->Debugoutput) {\n            case 'error_log':\n                //Don't output, just log\n                error_log($str);\n                break;\n            case 'html':\n                //Cleans up output a bit for a better looking, HTML-safe output\n                echo htmlentities(\n                    preg_replace('/[\\r\\n]+/', '', $str),\n                    ENT_QUOTES,\n                    'UTF-8'\n                ), \"<br>\\n\";\n                break;\n            case 'echo':\n            default:\n                //Normalize line breaks\n                $str = preg_replace('/\\r\\n|\\r/m', \"\\n\", $str);\n                echo gmdate('Y-m-d H:i:s'),\n                \"\\t\",\n                    //Trim trailing space\n                trim(\n                    //Indent for readability, except for trailing break\n                    str_replace(\n                        \"\\n\",\n                        \"\\n                   \\t                  \",\n                        trim($str)\n                    )\n                ),\n                \"\\n\";\n        }\n    }\n\n    /**\n     * Sets message type to HTML or plain.\n     *\n     * @param bool $isHtml True for HTML mode\n     */\n    public function isHTML($isHtml = true)\n    {\n        if ($isHtml) {\n            $this->ContentType = static::CONTENT_TYPE_TEXT_HTML;\n        } else {\n            $this->ContentType = static::CONTENT_TYPE_PLAINTEXT;\n        }\n    }\n\n    /**\n     * Send messages using SMTP.\n     */\n    public function isSMTP()\n    {\n        $this->Mailer = 'smtp';\n    }\n\n    /**\n     * Send messages using PHP's mail() function.\n     */\n    public function isMail()\n    {\n        $this->Mailer = 'mail';\n    }\n\n    /**\n     * Send messages using $Sendmail.\n     */\n    public function isSendmail()\n    {\n        $ini_sendmail_path = ini_get('sendmail_path');\n\n        if (false === stripos($ini_sendmail_path, 'sendmail')) {\n            $this->Sendmail = '/usr/sbin/sendmail';\n        } else {\n            $this->Sendmail = $ini_sendmail_path;\n        }\n        $this->Mailer = 'sendmail';\n    }\n\n    /**\n     * Send messages using qmail.\n     */\n    public function isQmail()\n    {\n        $ini_sendmail_path = ini_get('sendmail_path');\n\n        if (false === stripos($ini_sendmail_path, 'qmail')) {\n            $this->Sendmail = '/var/qmail/bin/qmail-inject';\n        } else {\n            $this->Sendmail = $ini_sendmail_path;\n        }\n        $this->Mailer = 'qmail';\n    }\n\n    /**\n     * Add a \"To\" address.\n     *\n     * @param string $address The email address to send to\n     * @param string $name\n     *\n     * @throws Exception\n     *\n     * @return bool true on success, false if address already used or invalid in some way\n     */\n    public function addAddress($address, $name = '')\n    {\n        return $this->addOrEnqueueAnAddress('to', $address, $name);\n    }\n\n    /**\n     * Add a \"CC\" address.\n     *\n     * @param string $address The email address to send to\n     * @param string $name\n     *\n     * @throws Exception\n     *\n     * @return bool true on success, false if address already used or invalid in some way\n     */\n    public function addCC($address, $name = '')\n    {\n        return $this->addOrEnqueueAnAddress('cc', $address, $name);\n    }\n\n    /**\n     * Add a \"BCC\" address.\n     *\n     * @param string $address The email address to send to\n     * @param string $name\n     *\n     * @throws Exception\n     *\n     * @return bool true on success, false if address already used or invalid in some way\n     */\n    public function addBCC($address, $name = '')\n    {\n        return $this->addOrEnqueueAnAddress('bcc', $address, $name);\n    }\n\n    /**\n     * Add a \"Reply-To\" address.\n     *\n     * @param string $address The email address to reply to\n     * @param string $name\n     *\n     * @throws Exception\n     *\n     * @return bool true on success, false if address already used or invalid in some way\n     */\n    public function addReplyTo($address, $name = '')\n    {\n        return $this->addOrEnqueueAnAddress('Reply-To', $address, $name);\n    }\n\n    /**\n     * Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer\n     * can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still\n     * be modified after calling this function), addition of such addresses is delayed until send().\n     * Addresses that have been added already return false, but do not throw exceptions.\n     *\n     * @param string $kind    One of 'to', 'cc', 'bcc', or 'ReplyTo'\n     * @param string $address The email address to send, resp. to reply to\n     * @param string $name\n     *\n     * @throws Exception\n     *\n     * @return bool true on success, false if address already used or invalid in some way\n     */\n    protected function addOrEnqueueAnAddress($kind, $address, $name)\n    {\n        $address = trim($address);\n        $name = trim(preg_replace('/[\\r\\n]+/', '', $name)); //Strip breaks and trim\n        $pos = strrpos($address, '@');\n        if (false === $pos) {\n            // At-sign is missing.\n            $error_message = sprintf(\n                '%s (%s): %s',\n                $this->lang('invalid_address'),\n                $kind,\n                $address\n            );\n            $this->setError($error_message);\n            $this->edebug($error_message);\n            if ($this->exceptions) {\n                throw new Exception($error_message);\n            }\n\n            return false;\n        }\n        $params = [$kind, $address, $name];\n        // Enqueue addresses with IDN until we know the PHPMailer::$CharSet.\n        if (static::idnSupported() && $this->has8bitChars(substr($address, ++$pos))) {\n            if ('Reply-To' !== $kind) {\n                if (!array_key_exists($address, $this->RecipientsQueue)) {\n                    $this->RecipientsQueue[$address] = $params;\n\n                    return true;\n                }\n            } elseif (!array_key_exists($address, $this->ReplyToQueue)) {\n                $this->ReplyToQueue[$address] = $params;\n\n                return true;\n            }\n\n            return false;\n        }\n\n        // Immediately add standard addresses without IDN.\n        return call_user_func_array([$this, 'addAnAddress'], $params);\n    }\n\n    /**\n     * Add an address to one of the recipient arrays or to the ReplyTo array.\n     * Addresses that have been added already return false, but do not throw exceptions.\n     *\n     * @param string $kind    One of 'to', 'cc', 'bcc', or 'ReplyTo'\n     * @param string $address The email address to send, resp. to reply to\n     * @param string $name\n     *\n     * @throws Exception\n     *\n     * @return bool true on success, false if address already used or invalid in some way\n     */\n    protected function addAnAddress($kind, $address, $name = '')\n    {\n        if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) {\n            $error_message = sprintf(\n                '%s: %s',\n                $this->lang('Invalid recipient kind'),\n                $kind\n            );\n            $this->setError($error_message);\n            $this->edebug($error_message);\n            if ($this->exceptions) {\n                throw new Exception($error_message);\n            }\n\n            return false;\n        }\n        if (!static::validateAddress($address)) {\n            $error_message = sprintf(\n                '%s (%s): %s',\n                $this->lang('invalid_address'),\n                $kind,\n                $address\n            );\n            $this->setError($error_message);\n            $this->edebug($error_message);\n            if ($this->exceptions) {\n                throw new Exception($error_message);\n            }\n\n            return false;\n        }\n        if ('Reply-To' !== $kind) {\n            if (!array_key_exists(strtolower($address), $this->all_recipients)) {\n                $this->{$kind}[] = [$address, $name];\n                $this->all_recipients[strtolower($address)] = true;\n\n                return true;\n            }\n        } elseif (!array_key_exists(strtolower($address), $this->ReplyTo)) {\n            $this->ReplyTo[strtolower($address)] = [$address, $name];\n\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Parse and validate a string containing one or more RFC822-style comma-separated email addresses\n     * of the form \"display name <address>\" into an array of name/address pairs.\n     * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available.\n     * Note that quotes in the name part are removed.\n     *\n     * @see http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation\n     *\n     * @param string $addrstr The address list string\n     * @param bool   $useimap Whether to use the IMAP extension to parse the list\n     *\n     * @return array\n     */\n    public static function parseAddresses($addrstr, $useimap = true)\n    {\n        $addresses = [];\n        if ($useimap && function_exists('imap_rfc822_parse_adrlist')) {\n            //Use this built-in parser if it's available\n            $list = imap_rfc822_parse_adrlist($addrstr, '');\n            foreach ($list as $address) {\n                if (('.SYNTAX-ERROR.' !== $address->host) && static::validateAddress(\n                    $address->mailbox . '@' . $address->host\n                )) {\n                    $addresses[] = [\n                        'name' => (property_exists($address, 'personal') ? $address->personal : ''),\n                        'address' => $address->mailbox . '@' . $address->host,\n                    ];\n                }\n            }\n        } else {\n            //Use this simpler parser\n            $list = explode(',', $addrstr);\n            foreach ($list as $address) {\n                $address = trim($address);\n                //Is there a separate name part?\n                if (strpos($address, '<') === false) {\n                    //No separate name, just use the whole thing\n                    if (static::validateAddress($address)) {\n                        $addresses[] = [\n                            'name' => '',\n                            'address' => $address,\n                        ];\n                    }\n                } else {\n                    list($name, $email) = explode('<', $address);\n                    $email = trim(str_replace('>', '', $email));\n                    if (static::validateAddress($email)) {\n                        $addresses[] = [\n                            'name' => trim(str_replace(['\"', \"'\"], '', $name)),\n                            'address' => $email,\n                        ];\n                    }\n                }\n            }\n        }\n\n        return $addresses;\n    }\n\n    /**\n     * Set the From and FromName properties.\n     *\n     * @param string $address\n     * @param string $name\n     * @param bool   $auto    Whether to also set the Sender address, defaults to true\n     *\n     * @throws Exception\n     *\n     * @return bool\n     */\n    public function setFrom($address, $name = '', $auto = true)\n    {\n        $address = trim($address);\n        $name = trim(preg_replace('/[\\r\\n]+/', '', $name)); //Strip breaks and trim\n        // Don't validate now addresses with IDN. Will be done in send().\n        $pos = strrpos($address, '@');\n        if ((false === $pos)\n            || ((!$this->has8bitChars(substr($address, ++$pos)) || !static::idnSupported())\n            && !static::validateAddress($address))\n        ) {\n            $error_message = sprintf(\n                '%s (From): %s',\n                $this->lang('invalid_address'),\n                $address\n            );\n            $this->setError($error_message);\n            $this->edebug($error_message);\n            if ($this->exceptions) {\n                throw new Exception($error_message);\n            }\n\n            return false;\n        }\n        $this->From = $address;\n        $this->FromName = $name;\n        if ($auto && empty($this->Sender)) {\n            $this->Sender = $address;\n        }\n\n        return true;\n    }\n\n    /**\n     * Return the Message-ID header of the last email.\n     * Technically this is the value from the last time the headers were created,\n     * but it's also the message ID of the last sent message except in\n     * pathological cases.\n     *\n     * @return string\n     */\n    public function getLastMessageID()\n    {\n        return $this->lastMessageID;\n    }\n\n    /**\n     * Check that a string looks like an email address.\n     * Validation patterns supported:\n     * * `auto` Pick best pattern automatically;\n     * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0;\n     * * `pcre` Use old PCRE implementation;\n     * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL;\n     * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.\n     * * `noregex` Don't use a regex: super fast, really dumb.\n     * Alternatively you may pass in a callable to inject your own validator, for example:\n     *\n     * ```php\n     * PHPMailer::validateAddress('user@example.com', function($address) {\n     *     return (strpos($address, '@') !== false);\n     * });\n     * ```\n     *\n     * You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator.\n     *\n     * @param string          $address       The email address to check\n     * @param string|callable $patternselect Which pattern to use\n     *\n     * @return bool\n     */\n    public static function validateAddress($address, $patternselect = null)\n    {\n        if (null === $patternselect) {\n            $patternselect = static::$validator;\n        }\n        if (is_callable($patternselect)) {\n            return $patternselect($address);\n        }\n        //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321\n        if (strpos($address, \"\\n\") !== false || strpos($address, \"\\r\") !== false) {\n            return false;\n        }\n        switch ($patternselect) {\n            case 'pcre': //Kept for BC\n            case 'pcre8':\n                /*\n                 * A more complex and more permissive version of the RFC5322 regex on which FILTER_VALIDATE_EMAIL\n                 * is based.\n                 * In addition to the addresses allowed by filter_var, also permits:\n                 *  * dotless domains: `a@b`\n                 *  * comments: `1234 @ local(blah) .machine .example`\n                 *  * quoted elements: `'\"test blah\"@example.org'`\n                 *  * numeric TLDs: `a@b.123`\n                 *  * unbracketed IPv4 literals: `a@192.168.0.1`\n                 *  * IPv6 literals: 'first.last@[IPv6:a1::]'\n                 * Not all of these will necessarily work for sending!\n                 *\n                 * @see       http://squiloople.com/2009/12/20/email-address-validation/\n                 * @copyright 2009-2010 Michael Rushton\n                 * Feel free to use and redistribute this code. But please keep this copyright notice.\n                 */\n                return (bool) preg_match(\n                    '/^(?!(?>(?1)\"?(?>\\\\\\[ -~]|[^\"])\"?(?1)){255,})(?!(?>(?1)\"?(?>\\\\\\[ -~]|[^\"])\"?(?1)){65,}@)' .\n                    '((?>(?>(?>((?>(?>(?>\\x0D\\x0A)?[\\t ])+|(?>[\\t ]*\\x0D\\x0A)?[\\t ]+)?)(\\((?>(?2)' .\n                    '(?>[\\x01-\\x08\\x0B\\x0C\\x0E-\\'*-\\[\\]-\\x7F]|\\\\\\[\\x00-\\x7F]|(?3)))*(?2)\\)))+(?2))|(?2))?)' .\n                    '([!#-\\'*+\\/-9=?^-~-]+|\"(?>(?2)(?>[\\x01-\\x08\\x0B\\x0C\\x0E-!#-\\[\\]-\\x7F]|\\\\\\[\\x00-\\x7F]))*' .\n                    '(?2)\")(?>(?1)\\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' .\n                    '(?>(?1)\\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' .\n                    '|(?!(?:.*[a-f0-9][:\\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' .\n                    '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' .\n                    '|[1-9]?[0-9])(?>\\.(?9)){3}))\\])(?1)$/isD',\n                    $address\n                );\n            case 'html5':\n                /*\n                 * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements.\n                 *\n                 * @see http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email)\n                 */\n                return (bool) preg_match(\n                    '/^[a-zA-Z0-9.!#$%&\\'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' .\n                    '[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD',\n                    $address\n                );\n            case 'php':\n            default:\n                return filter_var($address, FILTER_VALIDATE_EMAIL) !== false;\n        }\n    }\n\n    /**\n     * Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the\n     * `intl` and `mbstring` PHP extensions.\n     *\n     * @return bool `true` if required functions for IDN support are present\n     */\n    public static function idnSupported()\n    {\n        return function_exists('idn_to_ascii') && function_exists('mb_convert_encoding');\n    }\n\n    /**\n     * Converts IDN in given email address to its ASCII form, also known as punycode, if possible.\n     * Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet.\n     * This function silently returns unmodified address if:\n     * - No conversion is necessary (i.e. domain name is not an IDN, or is already in ASCII form)\n     * - Conversion to punycode is impossible (e.g. required PHP functions are not available)\n     *   or fails for any reason (e.g. domain contains characters not allowed in an IDN).\n     *\n     * @see PHPMailer::$CharSet\n     *\n     * @param string $address The email address to convert\n     *\n     * @return string The encoded address in ASCII form\n     */\n    public function punyencodeAddress($address)\n    {\n        // Verify we have required functions, CharSet, and at-sign.\n        $pos = strrpos($address, '@');\n        if (!empty($this->CharSet) &&\n            false !== $pos &&\n            static::idnSupported()\n        ) {\n            $domain = substr($address, ++$pos);\n            // Verify CharSet string is a valid one, and domain properly encoded in this CharSet.\n            if ($this->has8bitChars($domain) && @mb_check_encoding($domain, $this->CharSet)) {\n                $domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet);\n                //Ignore IDE complaints about this line - method signature changed in PHP 5.4\n                $errorcode = 0;\n                if (defined('INTL_IDNA_VARIANT_UTS46')) {\n                    // phpcs:ignore PHPCompatibility.ParameterValues.NewIDNVariantDefault.NotSet\n                    $punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_UTS46);\n                } elseif (defined('INTL_IDNA_VARIANT_2003')) {\n                    // phpcs:ignore PHPCompatibility.Constants.RemovedConstants.intl_idna_variant_2003Deprecated\n                    $punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_2003);\n                } else {\n                    // phpcs:ignore PHPCompatibility.ParameterValues.NewIDNVariantDefault.NotSet\n                    $punycode = idn_to_ascii($domain, $errorcode);\n                }\n                if (false !== $punycode) {\n                    return substr($address, 0, $pos) . $punycode;\n                }\n            }\n        }\n\n        return $address;\n    }\n\n    /**\n     * Create a message and send it.\n     * Uses the sending method specified by $Mailer.\n     *\n     * @throws Exception\n     *\n     * @return bool false on error - See the ErrorInfo property for details of the error\n     */\n    public function send()\n    {\n        try {\n            if (!$this->preSend()) {\n                return false;\n            }\n\n            return $this->postSend();\n        } catch (Exception $exc) {\n            $this->mailHeader = '';\n            $this->setError($exc->getMessage());\n            if ($this->exceptions) {\n                throw $exc;\n            }\n\n            return false;\n        }\n    }\n\n    /**\n     * Prepare a message for sending.\n     *\n     * @throws Exception\n     *\n     * @return bool\n     */\n    public function preSend()\n    {\n        if ('smtp' === $this->Mailer\n            || ('mail' === $this->Mailer && stripos(PHP_OS, 'WIN') === 0)\n        ) {\n            //SMTP mandates RFC-compliant line endings\n            //and it's also used with mail() on Windows\n            static::setLE(self::CRLF);\n        } else {\n            //Maintain backward compatibility with legacy Linux command line mailers\n            static::setLE(PHP_EOL);\n        }\n        //Check for buggy PHP versions that add a header with an incorrect line break\n        if ('mail' === $this->Mailer\n            && ((PHP_VERSION_ID >= 70000 && PHP_VERSION_ID < 70017)\n                || (PHP_VERSION_ID >= 70100 && PHP_VERSION_ID < 70103))\n            && ini_get('mail.add_x_header') === '1'\n            && stripos(PHP_OS, 'WIN') === 0\n        ) {\n            trigger_error(\n                'Your version of PHP is affected by a bug that may result in corrupted messages.' .\n                ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' .\n                ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.',\n                E_USER_WARNING\n            );\n        }\n\n        try {\n            $this->error_count = 0; // Reset errors\n            $this->mailHeader = '';\n\n            // Dequeue recipient and Reply-To addresses with IDN\n            foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) {\n                $params[1] = $this->punyencodeAddress($params[1]);\n                call_user_func_array([$this, 'addAnAddress'], $params);\n            }\n            if (count($this->to) + count($this->cc) + count($this->bcc) < 1) {\n                throw new Exception($this->lang('provide_address'), self::STOP_CRITICAL);\n            }\n\n            // Validate From, Sender, and ConfirmReadingTo addresses\n            foreach (['From', 'Sender', 'ConfirmReadingTo'] as $address_kind) {\n                $this->$address_kind = trim($this->$address_kind);\n                if (empty($this->$address_kind)) {\n                    continue;\n                }\n                $this->$address_kind = $this->punyencodeAddress($this->$address_kind);\n                if (!static::validateAddress($this->$address_kind)) {\n                    $error_message = sprintf(\n                        '%s (%s): %s',\n                        $this->lang('invalid_address'),\n                        $address_kind,\n                        $this->$address_kind\n                    );\n                    $this->setError($error_message);\n                    $this->edebug($error_message);\n                    if ($this->exceptions) {\n                        throw new Exception($error_message);\n                    }\n\n                    return false;\n                }\n            }\n\n            // Set whether the message is multipart/alternative\n            if ($this->alternativeExists()) {\n                $this->ContentType = static::CONTENT_TYPE_MULTIPART_ALTERNATIVE;\n            }\n\n            $this->setMessageType();\n            // Refuse to send an empty message unless we are specifically allowing it\n            if (!$this->AllowEmpty && empty($this->Body)) {\n                throw new Exception($this->lang('empty_message'), self::STOP_CRITICAL);\n            }\n\n            //Trim subject consistently\n            $this->Subject = trim($this->Subject);\n            // Create body before headers in case body makes changes to headers (e.g. altering transfer encoding)\n            $this->MIMEHeader = '';\n            $this->MIMEBody = $this->createBody();\n            // createBody may have added some headers, so retain them\n            $tempheaders = $this->MIMEHeader;\n            $this->MIMEHeader = $this->createHeader();\n            $this->MIMEHeader .= $tempheaders;\n\n            // To capture the complete message when using mail(), create\n            // an extra header list which createHeader() doesn't fold in\n            if ('mail' === $this->Mailer) {\n                if (count($this->to) > 0) {\n                    $this->mailHeader .= $this->addrAppend('To', $this->to);\n                } else {\n                    $this->mailHeader .= $this->headerLine('To', 'undisclosed-recipients:;');\n                }\n                $this->mailHeader .= $this->headerLine(\n                    'Subject',\n                    $this->encodeHeader($this->secureHeader($this->Subject))\n                );\n            }\n\n            // Sign with DKIM if enabled\n            if (!empty($this->DKIM_domain)\n                && !empty($this->DKIM_selector)\n                && (!empty($this->DKIM_private_string)\n                    || (!empty($this->DKIM_private)\n                        && static::isPermittedPath($this->DKIM_private)\n                        && file_exists($this->DKIM_private)\n                    )\n                )\n            ) {\n                $header_dkim = $this->DKIM_Add(\n                    $this->MIMEHeader . $this->mailHeader,\n                    $this->encodeHeader($this->secureHeader($this->Subject)),\n                    $this->MIMEBody\n                );\n                $this->MIMEHeader = static::stripTrailingWSP($this->MIMEHeader) . static::$LE .\n                    static::normalizeBreaks($header_dkim) . static::$LE;\n            }\n\n            return true;\n        } catch (Exception $exc) {\n            $this->setError($exc->getMessage());\n            if ($this->exceptions) {\n                throw $exc;\n            }\n\n            return false;\n        }\n    }\n\n    /**\n     * Actually send a message via the selected mechanism.\n     *\n     * @throws Exception\n     *\n     * @return bool\n     */\n    public function postSend()\n    {\n        try {\n            // Choose the mailer and send through it\n            switch ($this->Mailer) {\n                case 'sendmail':\n                case 'qmail':\n                    return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody);\n                case 'smtp':\n                    return $this->smtpSend($this->MIMEHeader, $this->MIMEBody);\n                case 'mail':\n                    return $this->mailSend($this->MIMEHeader, $this->MIMEBody);\n                default:\n                    $sendMethod = $this->Mailer . 'Send';\n                    if (method_exists($this, $sendMethod)) {\n                        return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody);\n                    }\n\n                    return $this->mailSend($this->MIMEHeader, $this->MIMEBody);\n            }\n        } catch (Exception $exc) {\n            $this->setError($exc->getMessage());\n            $this->edebug($exc->getMessage());\n            if ($this->exceptions) {\n                throw $exc;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Send mail using the $Sendmail program.\n     *\n     * @see PHPMailer::$Sendmail\n     *\n     * @param string $header The message headers\n     * @param string $body   The message body\n     *\n     * @throws Exception\n     *\n     * @return bool\n     */\n    protected function sendmailSend($header, $body)\n    {\n        $header = static::stripTrailingWSP($header) . static::$LE . static::$LE;\n\n        // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.\n        if (!empty($this->Sender) && self::isShellSafe($this->Sender)) {\n            if ('qmail' === $this->Mailer) {\n                $sendmailFmt = '%s -f%s';\n            } else {\n                $sendmailFmt = '%s -oi -f%s -t';\n            }\n        } elseif ('qmail' === $this->Mailer) {\n            $sendmailFmt = '%s';\n        } else {\n            $sendmailFmt = '%s -oi -t';\n        }\n\n        $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender);\n\n        if ($this->SingleTo) {\n            foreach ($this->SingleToArray as $toAddr) {\n                $mail = @popen($sendmail, 'w');\n                if (!$mail) {\n                    throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);\n                }\n                fwrite($mail, 'To: ' . $toAddr . \"\\n\");\n                fwrite($mail, $header);\n                fwrite($mail, $body);\n                $result = pclose($mail);\n                $this->doCallback(\n                    ($result === 0),\n                    [$toAddr],\n                    $this->cc,\n                    $this->bcc,\n                    $this->Subject,\n                    $body,\n                    $this->From,\n                    []\n                );\n                if (0 !== $result) {\n                    throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);\n                }\n            }\n        } else {\n            $mail = @popen($sendmail, 'w');\n            if (!$mail) {\n                throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);\n            }\n            fwrite($mail, $header);\n            fwrite($mail, $body);\n            $result = pclose($mail);\n            $this->doCallback(\n                ($result === 0),\n                $this->to,\n                $this->cc,\n                $this->bcc,\n                $this->Subject,\n                $body,\n                $this->From,\n                []\n            );\n            if (0 !== $result) {\n                throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);\n            }\n        }\n\n        return true;\n    }\n\n    /**\n     * Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters.\n     * Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows.\n     *\n     * @see https://github.com/PHPMailer/PHPMailer/issues/924 CVE-2016-10045 bug report\n     *\n     * @param string $string The string to be validated\n     *\n     * @return bool\n     */\n    protected static function isShellSafe($string)\n    {\n        // Future-proof\n        if (escapeshellcmd($string) !== $string\n            || !in_array(escapeshellarg($string), [\"'$string'\", \"\\\"$string\\\"\"])\n        ) {\n            return false;\n        }\n\n        $length = strlen($string);\n\n        for ($i = 0; $i < $length; ++$i) {\n            $c = $string[$i];\n\n            // All other characters have a special meaning in at least one common shell, including = and +.\n            // Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here.\n            // Note that this does permit non-Latin alphanumeric characters based on the current locale.\n            if (!ctype_alnum($c) && strpos('@_-.', $c) === false) {\n                return false;\n            }\n        }\n\n        return true;\n    }\n\n    /**\n     * Check whether a file path is of a permitted type.\n     * Used to reject URLs and phar files from functions that access local file paths,\n     * such as addAttachment.\n     *\n     * @param string $path A relative or absolute path to a file\n     *\n     * @return bool\n     */\n    protected static function isPermittedPath($path)\n    {\n        return !preg_match('#^[a-z]+://#i', $path);\n    }\n\n    /**\n     * Send mail using the PHP mail() function.\n     *\n     * @see http://www.php.net/manual/en/book.mail.php\n     *\n     * @param string $header The message headers\n     * @param string $body   The message body\n     *\n     * @throws Exception\n     *\n     * @return bool\n     */\n    protected function mailSend($header, $body)\n    {\n        $header = static::stripTrailingWSP($header) . static::$LE . static::$LE;\n\n        $toArr = [];\n        foreach ($this->to as $toaddr) {\n            $toArr[] = $this->addrFormat($toaddr);\n        }\n        $to = implode(', ', $toArr);\n\n        $params = null;\n        //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver\n        //A space after `-f` is optional, but there is a long history of its presence\n        //causing problems, so we don't use one\n        //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html\n        //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html\n        //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html\n        //Example problem: https://www.drupal.org/node/1057954\n        // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.\n        if (!empty($this->Sender) && static::validateAddress($this->Sender) && self::isShellSafe($this->Sender)) {\n            $params = sprintf('-f%s', $this->Sender);\n        }\n        if (!empty($this->Sender) && static::validateAddress($this->Sender)) {\n            $old_from = ini_get('sendmail_from');\n            ini_set('sendmail_from', $this->Sender);\n        }\n        $result = false;\n        if ($this->SingleTo && count($toArr) > 1) {\n            foreach ($toArr as $toAddr) {\n                $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);\n                $this->doCallback($result, [$toAddr], $this->cc, $this->bcc, $this->Subject, $body, $this->From, []);\n            }\n        } else {\n            $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params);\n            $this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From, []);\n        }\n        if (isset($old_from)) {\n            ini_set('sendmail_from', $old_from);\n        }\n        if (!$result) {\n            throw new Exception($this->lang('instantiate'), self::STOP_CRITICAL);\n        }\n\n        return true;\n    }\n\n    /**\n     * Get an instance to use for SMTP operations.\n     * Override this function to load your own SMTP implementation,\n     * or set one with setSMTPInstance.\n     *\n     * @return SMTP\n     */\n    public function getSMTPInstance()\n    {\n        if (!is_object($this->smtp)) {\n            $this->smtp = new SMTP();\n        }\n\n        return $this->smtp;\n    }\n\n    /**\n     * Provide an instance to use for SMTP operations.\n     *\n     * @return SMTP\n     */\n    public function setSMTPInstance(SMTP $smtp)\n    {\n        $this->smtp = $smtp;\n\n        return $this->smtp;\n    }\n\n    /**\n     * Send mail via SMTP.\n     * Returns false if there is a bad MAIL FROM, RCPT, or DATA input.\n     *\n     * @see PHPMailer::setSMTPInstance() to use a different class.\n     *\n     * @uses \\PHPMailer\\PHPMailer\\SMTP\n     *\n     * @param string $header The message headers\n     * @param string $body   The message body\n     *\n     * @throws Exception\n     *\n     * @return bool\n     */\n    protected function smtpSend($header, $body)\n    {\n        $header = static::stripTrailingWSP($header) . static::$LE . static::$LE;\n        $bad_rcpt = [];\n        if (!$this->smtpConnect($this->SMTPOptions)) {\n            throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);\n        }\n        //Sender already validated in preSend()\n        if ('' === $this->Sender) {\n            $smtp_from = $this->From;\n        } else {\n            $smtp_from = $this->Sender;\n        }\n        if (!$this->smtp->mail($smtp_from)) {\n            $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));\n            throw new Exception($this->ErrorInfo, self::STOP_CRITICAL);\n        }\n\n        $callbacks = [];\n        // Attempt to send to all recipients\n        foreach ([$this->to, $this->cc, $this->bcc] as $togroup) {\n            foreach ($togroup as $to) {\n                if (!$this->smtp->recipient($to[0], $this->dsn)) {\n                    $error = $this->smtp->getError();\n                    $bad_rcpt[] = ['to' => $to[0], 'error' => $error['detail']];\n                    $isSent = false;\n                } else {\n                    $isSent = true;\n                }\n\n                $callbacks[] = ['issent'=>$isSent, 'to'=>$to[0]];\n            }\n        }\n\n        // Only send the DATA command if we have viable recipients\n        if ((count($this->all_recipients) > count($bad_rcpt)) && !$this->smtp->data($header . $body)) {\n            throw new Exception($this->lang('data_not_accepted'), self::STOP_CRITICAL);\n        }\n\n        $smtp_transaction_id = $this->smtp->getLastTransactionID();\n\n        if ($this->SMTPKeepAlive) {\n            $this->smtp->reset();\n        } else {\n            $this->smtp->quit();\n            $this->smtp->close();\n        }\n\n        foreach ($callbacks as $cb) {\n            $this->doCallback(\n                $cb['issent'],\n                [$cb['to']],\n                [],\n                [],\n                $this->Subject,\n                $body,\n                $this->From,\n                ['smtp_transaction_id' => $smtp_transaction_id]\n            );\n        }\n\n        //Create error message for any bad addresses\n        if (count($bad_rcpt) > 0) {\n            $errstr = '';\n            foreach ($bad_rcpt as $bad) {\n                $errstr .= $bad['to'] . ': ' . $bad['error'];\n            }\n            throw new Exception($this->lang('recipients_failed') . $errstr, self::STOP_CONTINUE);\n        }\n\n        return true;\n    }\n\n    /**\n     * Initiate a connection to an SMTP server.\n     * Returns false if the operation failed.\n     *\n     * @param array $options An array of options compatible with stream_context_create()\n     *\n     * @throws Exception\n     *\n     * @uses \\PHPMailer\\PHPMailer\\SMTP\n     *\n     * @return bool\n     */\n    public function smtpConnect($options = null)\n    {\n        if (null === $this->smtp) {\n            $this->smtp = $this->getSMTPInstance();\n        }\n\n        //If no options are provided, use whatever is set in the instance\n        if (null === $options) {\n            $options = $this->SMTPOptions;\n        }\n\n        // Already connected?\n        if ($this->smtp->connected()) {\n            return true;\n        }\n\n        $this->smtp->setTimeout($this->Timeout);\n        $this->smtp->setDebugLevel($this->SMTPDebug);\n        $this->smtp->setDebugOutput($this->Debugoutput);\n        $this->smtp->setVerp($this->do_verp);\n        $hosts = explode(';', $this->Host);\n        $lastexception = null;\n\n        foreach ($hosts as $hostentry) {\n            $hostinfo = [];\n            if (!preg_match(\n                '/^(?:(ssl|tls):\\/\\/)?(.+?)(?::(\\d+))?$/',\n                trim($hostentry),\n                $hostinfo\n            )) {\n                $this->edebug($this->lang('invalid_hostentry') . ' ' . trim($hostentry));\n                // Not a valid host entry\n                continue;\n            }\n            // $hostinfo[1]: optional ssl or tls prefix\n            // $hostinfo[2]: the hostname\n            // $hostinfo[3]: optional port number\n            // The host string prefix can temporarily override the current setting for SMTPSecure\n            // If it's not specified, the default value is used\n\n            //Check the host name is a valid name or IP address before trying to use it\n            if (!static::isValidHost($hostinfo[2])) {\n                $this->edebug($this->lang('invalid_host') . ' ' . $hostinfo[2]);\n                continue;\n            }\n            $prefix = '';\n            $secure = $this->SMTPSecure;\n            $tls = (static::ENCRYPTION_STARTTLS === $this->SMTPSecure);\n            if ('ssl' === $hostinfo[1] || ('' === $hostinfo[1] && static::ENCRYPTION_SMTPS === $this->SMTPSecure)) {\n                $prefix = 'ssl://';\n                $tls = false; // Can't have SSL and TLS at the same time\n                $secure = static::ENCRYPTION_SMTPS;\n            } elseif ('tls' === $hostinfo[1]) {\n                $tls = true;\n                // tls doesn't use a prefix\n                $secure = static::ENCRYPTION_STARTTLS;\n            }\n            //Do we need the OpenSSL extension?\n            $sslext = defined('OPENSSL_ALGO_SHA256');\n            if (static::ENCRYPTION_STARTTLS === $secure || static::ENCRYPTION_SMTPS === $secure) {\n                //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled\n                if (!$sslext) {\n                    throw new Exception($this->lang('extension_missing') . 'openssl', self::STOP_CRITICAL);\n                }\n            }\n            $host = $hostinfo[2];\n            $port = $this->Port;\n            if (array_key_exists(3, $hostinfo) && is_numeric($hostinfo[3]) && $hostinfo[3] > 0 && $hostinfo[3] < 65536) {\n                $port = (int) $hostinfo[3];\n            }\n            if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) {\n                try {\n                    if ($this->Helo) {\n                        $hello = $this->Helo;\n                    } else {\n                        $hello = $this->serverHostname();\n                    }\n                    $this->smtp->hello($hello);\n                    //Automatically enable TLS encryption if:\n                    // * it's not disabled\n                    // * we have openssl extension\n                    // * we are not already using SSL\n                    // * the server offers STARTTLS\n                    if ($this->SMTPAutoTLS && $sslext && 'ssl' !== $secure && $this->smtp->getServerExt('STARTTLS')) {\n                        $tls = true;\n                    }\n                    if ($tls) {\n                        if (!$this->smtp->startTLS()) {\n                            throw new Exception($this->lang('connect_host'));\n                        }\n                        // We must resend EHLO after TLS negotiation\n                        $this->smtp->hello($hello);\n                    }\n                    if ($this->SMTPAuth && !$this->smtp->authenticate(\n                        $this->Username,\n                        $this->Password,\n                        $this->AuthType,\n                        $this->oauth\n                    )) {\n                        throw new Exception($this->lang('authenticate'));\n                    }\n\n                    return true;\n                } catch (Exception $exc) {\n                    $lastexception = $exc;\n                    $this->edebug($exc->getMessage());\n                    // We must have connected, but then failed TLS or Auth, so close connection nicely\n                    $this->smtp->quit();\n                }\n            }\n        }\n        // If we get here, all connection attempts have failed, so close connection hard\n        $this->smtp->close();\n        // As we've caught all exceptions, just report whatever the last one was\n        if ($this->exceptions && null !== $lastexception) {\n            throw $lastexception;\n        }\n\n        return false;\n    }\n\n    /**\n     * Close the active SMTP session if one exists.\n     */\n    public function smtpClose()\n    {\n        if ((null !== $this->smtp) && $this->smtp->connected()) {\n            $this->smtp->quit();\n            $this->smtp->close();\n        }\n    }\n\n    /**\n     * Set the language for error messages.\n     * Returns false if it cannot load the language file.\n     * The default language is English.\n     *\n     * @param string $langcode  ISO 639-1 2-character language code (e.g. French is \"fr\")\n     * @param string $lang_path Path to the language file directory, with trailing separator (slash)\n     *\n     * @return bool\n     */\n    public function setLanguage($langcode = 'en', $lang_path = '')\n    {\n        // Backwards compatibility for renamed language codes\n        $renamed_langcodes = [\n            'br' => 'pt_br',\n            'cz' => 'cs',\n            'dk' => 'da',\n            'no' => 'nb',\n            'se' => 'sv',\n            'rs' => 'sr',\n            'tg' => 'tl',\n            'am' => 'hy',\n        ];\n\n        if (isset($renamed_langcodes[$langcode])) {\n            $langcode = $renamed_langcodes[$langcode];\n        }\n\n        // Define full set of translatable strings in English\n        $PHPMAILER_LANG = [\n            'authenticate' => 'SMTP Error: Could not authenticate.',\n            'connect_host' => 'SMTP Error: Could not connect to SMTP host.',\n            'data_not_accepted' => 'SMTP Error: data not accepted.',\n            'empty_message' => 'Message body empty',\n            'encoding' => 'Unknown encoding: ',\n            'execute' => 'Could not execute: ',\n            'file_access' => 'Could not access file: ',\n            'file_open' => 'File Error: Could not open file: ',\n            'from_failed' => 'The following From address failed: ',\n            'instantiate' => 'Could not instantiate mail function.',\n            'invalid_address' => 'Invalid address: ',\n            'invalid_hostentry' => 'Invalid hostentry: ',\n            'invalid_host' => 'Invalid host: ',\n            'mailer_not_supported' => ' mailer is not supported.',\n            'provide_address' => 'You must provide at least one recipient email address.',\n            'recipients_failed' => 'SMTP Error: The following recipients failed: ',\n            'signing' => 'Signing Error: ',\n            'smtp_connect_failed' => 'SMTP connect() failed.',\n            'smtp_error' => 'SMTP server error: ',\n            'variable_set' => 'Cannot set or reset variable: ',\n            'extension_missing' => 'Extension missing: ',\n        ];\n        if (empty($lang_path)) {\n            // Calculate an absolute path so it can work if CWD is not here\n            $lang_path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR;\n        }\n        //Validate $langcode\n        if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) {\n            $langcode = 'en';\n        }\n        $foundlang = true;\n        $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php';\n        // There is no English translation file\n        if ('en' !== $langcode) {\n            // Make sure language file path is readable\n            if (!static::isPermittedPath($lang_file) || !file_exists($lang_file)) {\n                $foundlang = false;\n            } else {\n                // Overwrite language-specific strings.\n                // This way we'll never have missing translation keys.\n                $foundlang = include $lang_file;\n            }\n        }\n        $this->language = $PHPMAILER_LANG;\n\n        return (bool) $foundlang; // Returns false if language not found\n    }\n\n    /**\n     * Get the array of strings for the current language.\n     *\n     * @return array\n     */\n    public function getTranslations()\n    {\n        return $this->language;\n    }\n\n    /**\n     * Create recipient headers.\n     *\n     * @param string $type\n     * @param array  $addr An array of recipients,\n     *                     where each recipient is a 2-element indexed array with element 0 containing an address\n     *                     and element 1 containing a name, like:\n     *                     [['joe@example.com', 'Joe User'], ['zoe@example.com', 'Zoe User']]\n     *\n     * @return string\n     */\n    public function addrAppend($type, $addr)\n    {\n        $addresses = [];\n        foreach ($addr as $address) {\n            $addresses[] = $this->addrFormat($address);\n        }\n\n        return $type . ': ' . implode(', ', $addresses) . static::$LE;\n    }\n\n    /**\n     * Format an address for use in a message header.\n     *\n     * @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name like\n     *                    ['joe@example.com', 'Joe User']\n     *\n     * @return string\n     */\n    public function addrFormat($addr)\n    {\n        if (empty($addr[1])) { // No name provided\n            return $this->secureHeader($addr[0]);\n        }\n\n        return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') .\n            ' <' . $this->secureHeader($addr[0]) . '>';\n    }\n\n    /**\n     * Word-wrap message.\n     * For use with mailers that do not automatically perform wrapping\n     * and for quoted-printable encoded messages.\n     * Original written by philippe.\n     *\n     * @param string $message The message to wrap\n     * @param int    $length  The line length to wrap to\n     * @param bool   $qp_mode Whether to run in Quoted-Printable mode\n     *\n     * @return string\n     */\n    public function wrapText($message, $length, $qp_mode = false)\n    {\n        if ($qp_mode) {\n            $soft_break = sprintf(' =%s', static::$LE);\n        } else {\n            $soft_break = static::$LE;\n        }\n        // If utf-8 encoding is used, we will need to make sure we don't\n        // split multibyte characters when we wrap\n        $is_utf8 = static::CHARSET_UTF8 === strtolower($this->CharSet);\n        $lelen = strlen(static::$LE);\n        $crlflen = strlen(static::$LE);\n\n        $message = static::normalizeBreaks($message);\n        //Remove a trailing line break\n        if (substr($message, -$lelen) === static::$LE) {\n            $message = substr($message, 0, -$lelen);\n        }\n\n        //Split message into lines\n        $lines = explode(static::$LE, $message);\n        //Message will be rebuilt in here\n        $message = '';\n        foreach ($lines as $line) {\n            $words = explode(' ', $line);\n            $buf = '';\n            $firstword = true;\n            foreach ($words as $word) {\n                if ($qp_mode && (strlen($word) > $length)) {\n                    $space_left = $length - strlen($buf) - $crlflen;\n                    if (!$firstword) {\n                        if ($space_left > 20) {\n                            $len = $space_left;\n                            if ($is_utf8) {\n                                $len = $this->utf8CharBoundary($word, $len);\n                            } elseif ('=' === substr($word, $len - 1, 1)) {\n                                --$len;\n                            } elseif ('=' === substr($word, $len - 2, 1)) {\n                                $len -= 2;\n                            }\n                            $part = substr($word, 0, $len);\n                            $word = substr($word, $len);\n                            $buf .= ' ' . $part;\n                            $message .= $buf . sprintf('=%s', static::$LE);\n                        } else {\n                            $message .= $buf . $soft_break;\n                        }\n                        $buf = '';\n                    }\n                    while ($word !== '') {\n                        if ($length <= 0) {\n                            break;\n                        }\n                        $len = $length;\n                        if ($is_utf8) {\n                            $len = $this->utf8CharBoundary($word, $len);\n                        } elseif ('=' === substr($word, $len - 1, 1)) {\n                            --$len;\n                        } elseif ('=' === substr($word, $len - 2, 1)) {\n                            $len -= 2;\n                        }\n                        $part = substr($word, 0, $len);\n                        $word = (string) substr($word, $len);\n\n                        if ($word !== '') {\n                            $message .= $part . sprintf('=%s', static::$LE);\n                        } else {\n                            $buf = $part;\n                        }\n                    }\n                } else {\n                    $buf_o = $buf;\n                    if (!$firstword) {\n                        $buf .= ' ';\n                    }\n                    $buf .= $word;\n\n                    if ('' !== $buf_o && strlen($buf) > $length) {\n                        $message .= $buf_o . $soft_break;\n                        $buf = $word;\n                    }\n                }\n                $firstword = false;\n            }\n            $message .= $buf . static::$LE;\n        }\n\n        return $message;\n    }\n\n    /**\n     * Find the last character boundary prior to $maxLength in a utf-8\n     * quoted-printable encoded string.\n     * Original written by Colin Brown.\n     *\n     * @param string $encodedText utf-8 QP text\n     * @param int    $maxLength   Find the last character boundary prior to this length\n     *\n     * @return int\n     */\n    public function utf8CharBoundary($encodedText, $maxLength)\n    {\n        $foundSplitPos = false;\n        $lookBack = 3;\n        while (!$foundSplitPos) {\n            $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);\n            $encodedCharPos = strpos($lastChunk, '=');\n            if (false !== $encodedCharPos) {\n                // Found start of encoded character byte within $lookBack block.\n                // Check the encoded byte value (the 2 chars after the '=')\n                $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);\n                $dec = hexdec($hex);\n                if ($dec < 128) {\n                    // Single byte character.\n                    // If the encoded char was found at pos 0, it will fit\n                    // otherwise reduce maxLength to start of the encoded char\n                    if ($encodedCharPos > 0) {\n                        $maxLength -= $lookBack - $encodedCharPos;\n                    }\n                    $foundSplitPos = true;\n                } elseif ($dec >= 192) {\n                    // First byte of a multi byte character\n                    // Reduce maxLength to split at start of character\n                    $maxLength -= $lookBack - $encodedCharPos;\n                    $foundSplitPos = true;\n                } elseif ($dec < 192) {\n                    // Middle byte of a multi byte character, look further back\n                    $lookBack += 3;\n                }\n            } else {\n                // No encoded character found\n                $foundSplitPos = true;\n            }\n        }\n\n        return $maxLength;\n    }\n\n    /**\n     * Apply word wrapping to the message body.\n     * Wraps the message body to the number of chars set in the WordWrap property.\n     * You should only do this to plain-text bodies as wrapping HTML tags may break them.\n     * This is called automatically by createBody(), so you don't need to call it yourself.\n     */\n    public function setWordWrap()\n    {\n        if ($this->WordWrap < 1) {\n            return;\n        }\n\n        switch ($this->message_type) {\n            case 'alt':\n            case 'alt_inline':\n            case 'alt_attach':\n            case 'alt_inline_attach':\n                $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap);\n                break;\n            default:\n                $this->Body = $this->wrapText($this->Body, $this->WordWrap);\n                break;\n        }\n    }\n\n    /**\n     * Assemble message headers.\n     *\n     * @return string The assembled headers\n     */\n    public function createHeader()\n    {\n        $result = '';\n\n        $result .= $this->headerLine('Date', '' === $this->MessageDate ? self::rfcDate() : $this->MessageDate);\n\n        // To be created automatically by mail()\n        if ($this->SingleTo) {\n            if ('mail' !== $this->Mailer) {\n                foreach ($this->to as $toaddr) {\n                    $this->SingleToArray[] = $this->addrFormat($toaddr);\n                }\n            }\n        } elseif (count($this->to) > 0) {\n            if ('mail' !== $this->Mailer) {\n                $result .= $this->addrAppend('To', $this->to);\n            }\n        } elseif (count($this->cc) === 0) {\n            $result .= $this->headerLine('To', 'undisclosed-recipients:;');\n        }\n\n        $result .= $this->addrAppend('From', [[trim($this->From), $this->FromName]]);\n\n        // sendmail and mail() extract Cc from the header before sending\n        if (count($this->cc) > 0) {\n            $result .= $this->addrAppend('Cc', $this->cc);\n        }\n\n        // sendmail and mail() extract Bcc from the header before sending\n        if ((\n                'sendmail' === $this->Mailer || 'qmail' === $this->Mailer || 'mail' === $this->Mailer\n            )\n            && count($this->bcc) > 0\n        ) {\n            $result .= $this->addrAppend('Bcc', $this->bcc);\n        }\n\n        if (count($this->ReplyTo) > 0) {\n            $result .= $this->addrAppend('Reply-To', $this->ReplyTo);\n        }\n\n        // mail() sets the subject itself\n        if ('mail' !== $this->Mailer) {\n            $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject)));\n        }\n\n        // Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4\n        // https://tools.ietf.org/html/rfc5322#section-3.6.4\n        if ('' !== $this->MessageID && preg_match('/^<.*@.*>$/', $this->MessageID)) {\n            $this->lastMessageID = $this->MessageID;\n        } else {\n            $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname());\n        }\n        $result .= $this->headerLine('Message-ID', $this->lastMessageID);\n        if (null !== $this->Priority) {\n            $result .= $this->headerLine('X-Priority', $this->Priority);\n        }\n        if ('' === $this->XMailer) {\n            $result .= $this->headerLine(\n                'X-Mailer',\n                'PHPMailer ' . self::VERSION . ' (https://github.com/PHPMailer/PHPMailer)'\n            );\n        } else {\n            $myXmailer = trim($this->XMailer);\n            if ($myXmailer) {\n                $result .= $this->headerLine('X-Mailer', $myXmailer);\n            }\n        }\n\n        if ('' !== $this->ConfirmReadingTo) {\n            $result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>');\n        }\n\n        // Add custom headers\n        foreach ($this->CustomHeader as $header) {\n            $result .= $this->headerLine(\n                trim($header[0]),\n                $this->encodeHeader(trim($header[1]))\n            );\n        }\n        if (!$this->sign_key_file) {\n            $result .= $this->headerLine('MIME-Version', '1.0');\n            $result .= $this->getMailMIME();\n        }\n\n        return $result;\n    }\n\n    /**\n     * Get the message MIME type headers.\n     *\n     * @return string\n     */\n    public function getMailMIME()\n    {\n        $result = '';\n        $ismultipart = true;\n        switch ($this->message_type) {\n            case 'inline':\n                $result .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_RELATED . ';');\n                $result .= $this->textLine(' boundary=\"' . $this->boundary[1] . '\"');\n                break;\n            case 'attach':\n            case 'inline_attach':\n            case 'alt_attach':\n            case 'alt_inline_attach':\n                $result .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_MIXED . ';');\n                $result .= $this->textLine(' boundary=\"' . $this->boundary[1] . '\"');\n                break;\n            case 'alt':\n            case 'alt_inline':\n                $result .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_ALTERNATIVE . ';');\n                $result .= $this->textLine(' boundary=\"' . $this->boundary[1] . '\"');\n                break;\n            default:\n                // Catches case 'plain': and case '':\n                $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet);\n                $ismultipart = false;\n                break;\n        }\n        // RFC1341 part 5 says 7bit is assumed if not specified\n        if (static::ENCODING_7BIT !== $this->Encoding) {\n            // RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE\n            if ($ismultipart) {\n                if (static::ENCODING_8BIT === $this->Encoding) {\n                    $result .= $this->headerLine('Content-Transfer-Encoding', static::ENCODING_8BIT);\n                }\n                // The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible\n            } else {\n                $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding);\n            }\n        }\n\n        if ('mail' !== $this->Mailer) {\n//            $result .= static::$LE;\n        }\n\n        return $result;\n    }\n\n    /**\n     * Returns the whole MIME message.\n     * Includes complete headers and body.\n     * Only valid post preSend().\n     *\n     * @see PHPMailer::preSend()\n     *\n     * @return string\n     */\n    public function getSentMIMEMessage()\n    {\n        return static::stripTrailingWSP($this->MIMEHeader . $this->mailHeader) .\n            static::$LE . static::$LE . $this->MIMEBody;\n    }\n\n    /**\n     * Create a unique ID to use for boundaries.\n     *\n     * @return string\n     */\n    protected function generateId()\n    {\n        $len = 32; //32 bytes = 256 bits\n        $bytes = '';\n        if (function_exists('random_bytes')) {\n            try {\n                $bytes = random_bytes($len);\n            } catch (\\Exception $e) {\n                //Do nothing\n            }\n        } elseif (function_exists('openssl_random_pseudo_bytes')) {\n            /** @noinspection CryptographicallySecureRandomnessInspection */\n            $bytes = openssl_random_pseudo_bytes($len);\n        }\n        if ($bytes === '') {\n            //We failed to produce a proper random string, so make do.\n            //Use a hash to force the length to the same as the other methods\n            $bytes = hash('sha256', uniqid((string) mt_rand(), true), true);\n        }\n\n        //We don't care about messing up base64 format here, just want a random string\n        return str_replace(['=', '+', '/'], '', base64_encode(hash('sha256', $bytes, true)));\n    }\n\n    /**\n     * Assemble the message body.\n     * Returns an empty string on failure.\n     *\n     * @throws Exception\n     *\n     * @return string The assembled message body\n     */\n    public function createBody()\n    {\n        $body = '';\n        //Create unique IDs and preset boundaries\n        $this->uniqueid = $this->generateId();\n        $this->boundary[1] = 'b1_' . $this->uniqueid;\n        $this->boundary[2] = 'b2_' . $this->uniqueid;\n        $this->boundary[3] = 'b3_' . $this->uniqueid;\n\n        if ($this->sign_key_file) {\n            $body .= $this->getMailMIME() . static::$LE;\n        }\n\n        $this->setWordWrap();\n\n        $bodyEncoding = $this->Encoding;\n        $bodyCharSet = $this->CharSet;\n        //Can we do a 7-bit downgrade?\n        if (static::ENCODING_8BIT === $bodyEncoding && !$this->has8bitChars($this->Body)) {\n            $bodyEncoding = static::ENCODING_7BIT;\n            //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit\n            $bodyCharSet = static::CHARSET_ASCII;\n        }\n        //If lines are too long, and we're not already using an encoding that will shorten them,\n        //change to quoted-printable transfer encoding for the body part only\n        if (static::ENCODING_BASE64 !== $this->Encoding && static::hasLineLongerThanMax($this->Body)) {\n            $bodyEncoding = static::ENCODING_QUOTED_PRINTABLE;\n        }\n\n        $altBodyEncoding = $this->Encoding;\n        $altBodyCharSet = $this->CharSet;\n        //Can we do a 7-bit downgrade?\n        if (static::ENCODING_8BIT === $altBodyEncoding && !$this->has8bitChars($this->AltBody)) {\n            $altBodyEncoding = static::ENCODING_7BIT;\n            //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit\n            $altBodyCharSet = static::CHARSET_ASCII;\n        }\n        //If lines are too long, and we're not already using an encoding that will shorten them,\n        //change to quoted-printable transfer encoding for the alt body part only\n        if (static::ENCODING_BASE64 !== $altBodyEncoding && static::hasLineLongerThanMax($this->AltBody)) {\n            $altBodyEncoding = static::ENCODING_QUOTED_PRINTABLE;\n        }\n        //Use this as a preamble in all multipart message types\n        $mimepre = 'This is a multi-part message in MIME format.' . static::$LE . static::$LE;\n        switch ($this->message_type) {\n            case 'inline':\n                $body .= $mimepre;\n                $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding);\n                $body .= $this->encodeString($this->Body, $bodyEncoding);\n                $body .= static::$LE;\n                $body .= $this->attachAll('inline', $this->boundary[1]);\n                break;\n            case 'attach':\n                $body .= $mimepre;\n                $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding);\n                $body .= $this->encodeString($this->Body, $bodyEncoding);\n                $body .= static::$LE;\n                $body .= $this->attachAll('attachment', $this->boundary[1]);\n                break;\n            case 'inline_attach':\n                $body .= $mimepre;\n                $body .= $this->textLine('--' . $this->boundary[1]);\n                $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_RELATED . ';');\n                $body .= $this->textLine(' boundary=\"' . $this->boundary[2] . '\";');\n                $body .= $this->textLine(' type=\"' . static::CONTENT_TYPE_TEXT_HTML . '\"');\n                $body .= static::$LE;\n                $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding);\n                $body .= $this->encodeString($this->Body, $bodyEncoding);\n                $body .= static::$LE;\n                $body .= $this->attachAll('inline', $this->boundary[2]);\n                $body .= static::$LE;\n                $body .= $this->attachAll('attachment', $this->boundary[1]);\n                break;\n            case 'alt':\n                $body .= $mimepre;\n                $body .= $this->getBoundary(\n                    $this->boundary[1],\n                    $altBodyCharSet,\n                    static::CONTENT_TYPE_PLAINTEXT,\n                    $altBodyEncoding\n                );\n                $body .= $this->encodeString($this->AltBody, $altBodyEncoding);\n                $body .= static::$LE;\n                $body .= $this->getBoundary(\n                    $this->boundary[1],\n                    $bodyCharSet,\n                    static::CONTENT_TYPE_TEXT_HTML,\n                    $bodyEncoding\n                );\n                $body .= $this->encodeString($this->Body, $bodyEncoding);\n                $body .= static::$LE;\n                if (!empty($this->Ical)) {\n                    $method = static::ICAL_METHOD_REQUEST;\n                    foreach (static::$IcalMethods as $imethod) {\n                        if (stripos($this->Ical, 'METHOD:' . $imethod) !== false) {\n                            $method = $imethod;\n                            break;\n                        }\n                    }\n                    $body .= $this->getBoundary(\n                        $this->boundary[1],\n                        '',\n                        static::CONTENT_TYPE_TEXT_CALENDAR . '; method=' . $method,\n                        ''\n                    );\n                    $body .= $this->encodeString($this->Ical, $this->Encoding);\n                    $body .= static::$LE;\n                }\n                $body .= $this->endBoundary($this->boundary[1]);\n                break;\n            case 'alt_inline':\n                $body .= $mimepre;\n                $body .= $this->getBoundary(\n                    $this->boundary[1],\n                    $altBodyCharSet,\n                    static::CONTENT_TYPE_PLAINTEXT,\n                    $altBodyEncoding\n                );\n                $body .= $this->encodeString($this->AltBody, $altBodyEncoding);\n                $body .= static::$LE;\n                $body .= $this->textLine('--' . $this->boundary[1]);\n                $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_RELATED . ';');\n                $body .= $this->textLine(' boundary=\"' . $this->boundary[2] . '\";');\n                $body .= $this->textLine(' type=\"' . static::CONTENT_TYPE_TEXT_HTML . '\"');\n                $body .= static::$LE;\n                $body .= $this->getBoundary(\n                    $this->boundary[2],\n                    $bodyCharSet,\n                    static::CONTENT_TYPE_TEXT_HTML,\n                    $bodyEncoding\n                );\n                $body .= $this->encodeString($this->Body, $bodyEncoding);\n                $body .= static::$LE;\n                $body .= $this->attachAll('inline', $this->boundary[2]);\n                $body .= static::$LE;\n                $body .= $this->endBoundary($this->boundary[1]);\n                break;\n            case 'alt_attach':\n                $body .= $mimepre;\n                $body .= $this->textLine('--' . $this->boundary[1]);\n                $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_ALTERNATIVE . ';');\n                $body .= $this->textLine(' boundary=\"' . $this->boundary[2] . '\"');\n                $body .= static::$LE;\n                $body .= $this->getBoundary(\n                    $this->boundary[2],\n                    $altBodyCharSet,\n                    static::CONTENT_TYPE_PLAINTEXT,\n                    $altBodyEncoding\n                );\n                $body .= $this->encodeString($this->AltBody, $altBodyEncoding);\n                $body .= static::$LE;\n                $body .= $this->getBoundary(\n                    $this->boundary[2],\n                    $bodyCharSet,\n                    static::CONTENT_TYPE_TEXT_HTML,\n                    $bodyEncoding\n                );\n                $body .= $this->encodeString($this->Body, $bodyEncoding);\n                $body .= static::$LE;\n                if (!empty($this->Ical)) {\n                    $method = static::ICAL_METHOD_REQUEST;\n                    foreach (static::$IcalMethods as $imethod) {\n                        if (stripos($this->Ical, 'METHOD:' . $imethod) !== false) {\n                            $method = $imethod;\n                            break;\n                        }\n                    }\n                    $body .= $this->getBoundary(\n                        $this->boundary[2],\n                        '',\n                        static::CONTENT_TYPE_TEXT_CALENDAR . '; method=' . $method,\n                        ''\n                    );\n                    $body .= $this->encodeString($this->Ical, $this->Encoding);\n                }\n                $body .= $this->endBoundary($this->boundary[2]);\n                $body .= static::$LE;\n                $body .= $this->attachAll('attachment', $this->boundary[1]);\n                break;\n            case 'alt_inline_attach':\n                $body .= $mimepre;\n                $body .= $this->textLine('--' . $this->boundary[1]);\n                $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_ALTERNATIVE . ';');\n                $body .= $this->textLine(' boundary=\"' . $this->boundary[2] . '\"');\n                $body .= static::$LE;\n                $body .= $this->getBoundary(\n                    $this->boundary[2],\n                    $altBodyCharSet,\n                    static::CONTENT_TYPE_PLAINTEXT,\n                    $altBodyEncoding\n                );\n                $body .= $this->encodeString($this->AltBody, $altBodyEncoding);\n                $body .= static::$LE;\n                $body .= $this->textLine('--' . $this->boundary[2]);\n                $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_RELATED . ';');\n                $body .= $this->textLine(' boundary=\"' . $this->boundary[3] . '\";');\n                $body .= $this->textLine(' type=\"' . static::CONTENT_TYPE_TEXT_HTML . '\"');\n                $body .= static::$LE;\n                $body .= $this->getBoundary(\n                    $this->boundary[3],\n                    $bodyCharSet,\n                    static::CONTENT_TYPE_TEXT_HTML,\n                    $bodyEncoding\n                );\n                $body .= $this->encodeString($this->Body, $bodyEncoding);\n                $body .= static::$LE;\n                $body .= $this->attachAll('inline', $this->boundary[3]);\n                $body .= static::$LE;\n                $body .= $this->endBoundary($this->boundary[2]);\n                $body .= static::$LE;\n                $body .= $this->attachAll('attachment', $this->boundary[1]);\n                break;\n            default:\n                // Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types\n                //Reset the `Encoding` property in case we changed it for line length reasons\n                $this->Encoding = $bodyEncoding;\n                $body .= $this->encodeString($this->Body, $this->Encoding);\n                break;\n        }\n\n        if ($this->isError()) {\n            $body = '';\n            if ($this->exceptions) {\n                throw new Exception($this->lang('empty_message'), self::STOP_CRITICAL);\n            }\n        } elseif ($this->sign_key_file) {\n            try {\n                if (!defined('PKCS7_TEXT')) {\n                    throw new Exception($this->lang('extension_missing') . 'openssl');\n                }\n\n                $file = tempnam(sys_get_temp_dir(), 'srcsign');\n                $signed = tempnam(sys_get_temp_dir(), 'mailsign');\n                file_put_contents($file, $body);\n\n                //Workaround for PHP bug https://bugs.php.net/bug.php?id=69197\n                if (empty($this->sign_extracerts_file)) {\n                    $sign = @openssl_pkcs7_sign(\n                        $file,\n                        $signed,\n                        'file://' . realpath($this->sign_cert_file),\n                        ['file://' . realpath($this->sign_key_file), $this->sign_key_pass],\n                        []\n                    );\n                } else {\n                    $sign = @openssl_pkcs7_sign(\n                        $file,\n                        $signed,\n                        'file://' . realpath($this->sign_cert_file),\n                        ['file://' . realpath($this->sign_key_file), $this->sign_key_pass],\n                        [],\n                        PKCS7_DETACHED,\n                        $this->sign_extracerts_file\n                    );\n                }\n\n                @unlink($file);\n                if ($sign) {\n                    $body = file_get_contents($signed);\n                    @unlink($signed);\n                    //The message returned by openssl contains both headers and body, so need to split them up\n                    $parts = explode(\"\\n\\n\", $body, 2);\n                    $this->MIMEHeader .= $parts[0] . static::$LE . static::$LE;\n                    $body = $parts[1];\n                } else {\n                    @unlink($signed);\n                    throw new Exception($this->lang('signing') . openssl_error_string());\n                }\n            } catch (Exception $exc) {\n                $body = '';\n                if ($this->exceptions) {\n                    throw $exc;\n                }\n            }\n        }\n\n        return $body;\n    }\n\n    /**\n     * Return the start of a message boundary.\n     *\n     * @param string $boundary\n     * @param string $charSet\n     * @param string $contentType\n     * @param string $encoding\n     *\n     * @return string\n     */\n    protected function getBoundary($boundary, $charSet, $contentType, $encoding)\n    {\n        $result = '';\n        if ('' === $charSet) {\n            $charSet = $this->CharSet;\n        }\n        if ('' === $contentType) {\n            $contentType = $this->ContentType;\n        }\n        if ('' === $encoding) {\n            $encoding = $this->Encoding;\n        }\n        $result .= $this->textLine('--' . $boundary);\n        $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet);\n        $result .= static::$LE;\n        // RFC1341 part 5 says 7bit is assumed if not specified\n        if (static::ENCODING_7BIT !== $encoding) {\n            $result .= $this->headerLine('Content-Transfer-Encoding', $encoding);\n        }\n        $result .= static::$LE;\n\n        return $result;\n    }\n\n    /**\n     * Return the end of a message boundary.\n     *\n     * @param string $boundary\n     *\n     * @return string\n     */\n    protected function endBoundary($boundary)\n    {\n        return static::$LE . '--' . $boundary . '--' . static::$LE;\n    }\n\n    /**\n     * Set the message type.\n     * PHPMailer only supports some preset message types, not arbitrary MIME structures.\n     */\n    protected function setMessageType()\n    {\n        $type = [];\n        if ($this->alternativeExists()) {\n            $type[] = 'alt';\n        }\n        if ($this->inlineImageExists()) {\n            $type[] = 'inline';\n        }\n        if ($this->attachmentExists()) {\n            $type[] = 'attach';\n        }\n        $this->message_type = implode('_', $type);\n        if ('' === $this->message_type) {\n            //The 'plain' message_type refers to the message having a single body element, not that it is plain-text\n            $this->message_type = 'plain';\n        }\n    }\n\n    /**\n     * Format a header line.\n     *\n     * @param string     $name\n     * @param string|int $value\n     *\n     * @return string\n     */\n    public function headerLine($name, $value)\n    {\n        return $name . ': ' . $value . static::$LE;\n    }\n\n    /**\n     * Return a formatted mail line.\n     *\n     * @param string $value\n     *\n     * @return string\n     */\n    public function textLine($value)\n    {\n        return $value . static::$LE;\n    }\n\n    /**\n     * Add an attachment from a path on the filesystem.\n     * Never use a user-supplied path to a file!\n     * Returns false if the file could not be found or read.\n     * Explicitly *does not* support passing URLs; PHPMailer is not an HTTP client.\n     * If you need to do that, fetch the resource yourself and pass it in via a local file or string.\n     *\n     * @param string $path        Path to the attachment\n     * @param string $name        Overrides the attachment name\n     * @param string $encoding    File encoding (see $Encoding)\n     * @param string $type        File extension (MIME) type\n     * @param string $disposition Disposition to use\n     *\n     * @throws Exception\n     *\n     * @return bool\n     */\n    public function addAttachment(\n        $path,\n        $name = '',\n        $encoding = self::ENCODING_BASE64,\n        $type = '',\n        $disposition = 'attachment'\n    ) {\n        try {\n            if (!static::isPermittedPath($path) || !@is_file($path) || !is_readable($path)) {\n                throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE);\n            }\n\n            // If a MIME type is not specified, try to work it out from the file name\n            if ('' === $type) {\n                $type = static::filenameToType($path);\n            }\n\n            $filename = (string) static::mb_pathinfo($path, PATHINFO_BASENAME);\n            if ('' === $name) {\n                $name = $filename;\n            }\n\n            if (!$this->validateEncoding($encoding)) {\n                throw new Exception($this->lang('encoding') . $encoding);\n            }\n\n            $this->attachment[] = [\n                0 => $path,\n                1 => $filename,\n                2 => $name,\n                3 => $encoding,\n                4 => $type,\n                5 => false, // isStringAttachment\n                6 => $disposition,\n                7 => $name,\n            ];\n        } catch (Exception $exc) {\n            $this->setError($exc->getMessage());\n            $this->edebug($exc->getMessage());\n            if ($this->exceptions) {\n                throw $exc;\n            }\n\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Return the array of attachments.\n     *\n     * @return array\n     */\n    public function getAttachments()\n    {\n        return $this->attachment;\n    }\n\n    /**\n     * Attach all file, string, and binary attachments to the message.\n     * Returns an empty string on failure.\n     *\n     * @param string $disposition_type\n     * @param string $boundary\n     *\n     * @throws Exception\n     *\n     * @return string\n     */\n    protected function attachAll($disposition_type, $boundary)\n    {\n        // Return text of body\n        $mime = [];\n        $cidUniq = [];\n        $incl = [];\n\n        // Add all attachments\n        foreach ($this->attachment as $attachment) {\n            // Check if it is a valid disposition_filter\n            if ($attachment[6] === $disposition_type) {\n                // Check for string attachment\n                $string = '';\n                $path = '';\n                $bString = $attachment[5];\n                if ($bString) {\n                    $string = $attachment[0];\n                } else {\n                    $path = $attachment[0];\n                }\n\n                $inclhash = hash('sha256', serialize($attachment));\n                if (in_array($inclhash, $incl, true)) {\n                    continue;\n                }\n                $incl[] = $inclhash;\n                $name = $attachment[2];\n                $encoding = $attachment[3];\n                $type = $attachment[4];\n                $disposition = $attachment[6];\n                $cid = $attachment[7];\n                if ('inline' === $disposition && array_key_exists($cid, $cidUniq)) {\n                    continue;\n                }\n                $cidUniq[$cid] = true;\n\n                $mime[] = sprintf('--%s%s', $boundary, static::$LE);\n                //Only include a filename property if we have one\n                if (!empty($name)) {\n                    $mime[] = sprintf(\n                        'Content-Type: %s; name=%s%s',\n                        $type,\n                        static::quotedString($this->encodeHeader($this->secureHeader($name))),\n                        static::$LE\n                    );\n                } else {\n                    $mime[] = sprintf(\n                        'Content-Type: %s%s',\n                        $type,\n                        static::$LE\n                    );\n                }\n                // RFC1341 part 5 says 7bit is assumed if not specified\n                if (static::ENCODING_7BIT !== $encoding) {\n                    $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, static::$LE);\n                }\n\n                //Only set Content-IDs on inline attachments\n                if ((string) $cid !== '' && $disposition === 'inline') {\n                    $mime[] = 'Content-ID: <' . $this->encodeHeader($this->secureHeader($cid)) . '>' . static::$LE;\n                }\n\n                // Allow for bypassing the Content-Disposition header\n                if (!empty($disposition)) {\n                    $encoded_name = $this->encodeHeader($this->secureHeader($name));\n                    if (!empty($encoded_name)) {\n                        $mime[] = sprintf(\n                            'Content-Disposition: %s; filename=%s%s',\n                            $disposition,\n                            static::quotedString($encoded_name),\n                            static::$LE . static::$LE\n                        );\n                    } else {\n                        $mime[] = sprintf(\n                            'Content-Disposition: %s%s',\n                            $disposition,\n                            static::$LE . static::$LE\n                        );\n                    }\n                } else {\n                    $mime[] = static::$LE;\n                }\n\n                // Encode as string attachment\n                if ($bString) {\n                    $mime[] = $this->encodeString($string, $encoding);\n                } else {\n                    $mime[] = $this->encodeFile($path, $encoding);\n                }\n                if ($this->isError()) {\n                    return '';\n                }\n                $mime[] = static::$LE;\n            }\n        }\n\n        $mime[] = sprintf('--%s--%s', $boundary, static::$LE);\n\n        return implode('', $mime);\n    }\n\n    /**\n     * Encode a file attachment in requested format.\n     * Returns an empty string on failure.\n     *\n     * @param string $path     The full path to the file\n     * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'\n     *\n     * @return string\n     */\n    protected function encodeFile($path, $encoding = self::ENCODING_BASE64)\n    {\n        try {\n            if (!static::isPermittedPath($path) || !file_exists($path) || !is_readable($path)) {\n                throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE);\n            }\n            $file_buffer = file_get_contents($path);\n            if (false === $file_buffer) {\n                throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE);\n            }\n            $file_buffer = $this->encodeString($file_buffer, $encoding);\n\n            return $file_buffer;\n        } catch (Exception $exc) {\n            $this->setError($exc->getMessage());\n            $this->edebug($exc->getMessage());\n            if ($this->exceptions) {\n                throw $exc;\n            }\n\n            return '';\n        }\n    }\n\n    /**\n     * Encode a string in requested format.\n     * Returns an empty string on failure.\n     *\n     * @param string $str      The text to encode\n     * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'\n     *\n     * @throws Exception\n     *\n     * @return string\n     */\n    public function encodeString($str, $encoding = self::ENCODING_BASE64)\n    {\n        $encoded = '';\n        switch (strtolower($encoding)) {\n            case static::ENCODING_BASE64:\n                $encoded = chunk_split(\n                    base64_encode($str),\n                    static::STD_LINE_LENGTH,\n                    static::$LE\n                );\n                break;\n            case static::ENCODING_7BIT:\n            case static::ENCODING_8BIT:\n                $encoded = static::normalizeBreaks($str);\n                // Make sure it ends with a line break\n                if (substr($encoded, -(strlen(static::$LE))) !== static::$LE) {\n                    $encoded .= static::$LE;\n                }\n                break;\n            case static::ENCODING_BINARY:\n                $encoded = $str;\n                break;\n            case static::ENCODING_QUOTED_PRINTABLE:\n                $encoded = $this->encodeQP($str);\n                break;\n            default:\n                $this->setError($this->lang('encoding') . $encoding);\n                if ($this->exceptions) {\n                    throw new Exception($this->lang('encoding') . $encoding);\n                }\n                break;\n        }\n\n        return $encoded;\n    }\n\n    /**\n     * Encode a header value (not including its label) optimally.\n     * Picks shortest of Q, B, or none. Result includes folding if needed.\n     * See RFC822 definitions for phrase, comment and text positions.\n     *\n     * @param string $str      The header value to encode\n     * @param string $position What context the string will be used in\n     *\n     * @return string\n     */\n    public function encodeHeader($str, $position = 'text')\n    {\n        $matchcount = 0;\n        switch (strtolower($position)) {\n            case 'phrase':\n                if (!preg_match('/[\\200-\\377]/', $str)) {\n                    // Can't use addslashes as we don't know the value of magic_quotes_sybase\n                    $encoded = addcslashes($str, \"\\0..\\37\\177\\\\\\\"\");\n                    if (($str === $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\\'*+\\/=?^_`{|}~ -]/', $str)) {\n                        return $encoded;\n                    }\n\n                    return \"\\\"$encoded\\\"\";\n                }\n                $matchcount = preg_match_all('/[^\\040\\041\\043-\\133\\135-\\176]/', $str, $matches);\n                break;\n            /* @noinspection PhpMissingBreakStatementInspection */\n            case 'comment':\n                $matchcount = preg_match_all('/[()\"]/', $str, $matches);\n            //fallthrough\n            case 'text':\n            default:\n                $matchcount += preg_match_all('/[\\000-\\010\\013\\014\\016-\\037\\177-\\377]/', $str, $matches);\n                break;\n        }\n\n        if ($this->has8bitChars($str)) {\n            $charset = $this->CharSet;\n        } else {\n            $charset = static::CHARSET_ASCII;\n        }\n\n        // Q/B encoding adds 8 chars and the charset (\"` =?<charset>?[QB]?<content>?=`\").\n        $overhead = 8 + strlen($charset);\n\n        if ('mail' === $this->Mailer) {\n            $maxlen = static::MAIL_MAX_LINE_LENGTH - $overhead;\n        } else {\n            $maxlen = static::MAX_LINE_LENGTH - $overhead;\n        }\n\n        // Select the encoding that produces the shortest output and/or prevents corruption.\n        if ($matchcount > strlen($str) / 3) {\n            // More than 1/3 of the content needs encoding, use B-encode.\n            $encoding = 'B';\n        } elseif ($matchcount > 0) {\n            // Less than 1/3 of the content needs encoding, use Q-encode.\n            $encoding = 'Q';\n        } elseif (strlen($str) > $maxlen) {\n            // No encoding needed, but value exceeds max line length, use Q-encode to prevent corruption.\n            $encoding = 'Q';\n        } else {\n            // No reformatting needed\n            $encoding = false;\n        }\n\n        switch ($encoding) {\n            case 'B':\n                if ($this->hasMultiBytes($str)) {\n                    // Use a custom function which correctly encodes and wraps long\n                    // multibyte strings without breaking lines within a character\n                    $encoded = $this->base64EncodeWrapMB($str, \"\\n\");\n                } else {\n                    $encoded = base64_encode($str);\n                    $maxlen -= $maxlen % 4;\n                    $encoded = trim(chunk_split($encoded, $maxlen, \"\\n\"));\n                }\n                $encoded = preg_replace('/^(.*)$/m', ' =?' . $charset . \"?$encoding?\\\\1?=\", $encoded);\n                break;\n            case 'Q':\n                $encoded = $this->encodeQ($str, $position);\n                $encoded = $this->wrapText($encoded, $maxlen, true);\n                $encoded = str_replace('=' . static::$LE, \"\\n\", trim($encoded));\n                $encoded = preg_replace('/^(.*)$/m', ' =?' . $charset . \"?$encoding?\\\\1?=\", $encoded);\n                break;\n            default:\n                return $str;\n        }\n\n        return trim(static::normalizeBreaks($encoded));\n    }\n\n    /**\n     * Check if a string contains multi-byte characters.\n     *\n     * @param string $str multi-byte text to wrap encode\n     *\n     * @return bool\n     */\n    public function hasMultiBytes($str)\n    {\n        if (function_exists('mb_strlen')) {\n            return strlen($str) > mb_strlen($str, $this->CharSet);\n        }\n\n        // Assume no multibytes (we can't handle without mbstring functions anyway)\n        return false;\n    }\n\n    /**\n     * Does a string contain any 8-bit chars (in any charset)?\n     *\n     * @param string $text\n     *\n     * @return bool\n     */\n    public function has8bitChars($text)\n    {\n        return (bool) preg_match('/[\\x80-\\xFF]/', $text);\n    }\n\n    /**\n     * Encode and wrap long multibyte strings for mail headers\n     * without breaking lines within a character.\n     * Adapted from a function by paravoid.\n     *\n     * @see http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283\n     *\n     * @param string $str       multi-byte text to wrap encode\n     * @param string $linebreak string to use as linefeed/end-of-line\n     *\n     * @return string\n     */\n    public function base64EncodeWrapMB($str, $linebreak = null)\n    {\n        $start = '=?' . $this->CharSet . '?B?';\n        $end = '?=';\n        $encoded = '';\n        if (null === $linebreak) {\n            $linebreak = static::$LE;\n        }\n\n        $mb_length = mb_strlen($str, $this->CharSet);\n        // Each line must have length <= 75, including $start and $end\n        $length = 75 - strlen($start) - strlen($end);\n        // Average multi-byte ratio\n        $ratio = $mb_length / strlen($str);\n        // Base64 has a 4:3 ratio\n        $avgLength = floor($length * $ratio * .75);\n\n        $offset = 0;\n        for ($i = 0; $i < $mb_length; $i += $offset) {\n            $lookBack = 0;\n            do {\n                $offset = $avgLength - $lookBack;\n                $chunk = mb_substr($str, $i, $offset, $this->CharSet);\n                $chunk = base64_encode($chunk);\n                ++$lookBack;\n            } while (strlen($chunk) > $length);\n            $encoded .= $chunk . $linebreak;\n        }\n\n        // Chomp the last linefeed\n        return substr($encoded, 0, -strlen($linebreak));\n    }\n\n    /**\n     * Encode a string in quoted-printable format.\n     * According to RFC2045 section 6.7.\n     *\n     * @param string $string The text to encode\n     *\n     * @return string\n     */\n    public function encodeQP($string)\n    {\n        return static::normalizeBreaks(quoted_printable_encode($string));\n    }\n\n    /**\n     * Encode a string using Q encoding.\n     *\n     * @see http://tools.ietf.org/html/rfc2047#section-4.2\n     *\n     * @param string $str      the text to encode\n     * @param string $position Where the text is going to be used, see the RFC for what that means\n     *\n     * @return string\n     */\n    public function encodeQ($str, $position = 'text')\n    {\n        // There should not be any EOL in the string\n        $pattern = '';\n        $encoded = str_replace([\"\\r\", \"\\n\"], '', $str);\n        switch (strtolower($position)) {\n            case 'phrase':\n                // RFC 2047 section 5.3\n                $pattern = '^A-Za-z0-9!*+\\/ -';\n                break;\n            /*\n             * RFC 2047 section 5.2.\n             * Build $pattern without including delimiters and []\n             */\n            /* @noinspection PhpMissingBreakStatementInspection */\n            case 'comment':\n                $pattern = '\\(\\)\"';\n            /* Intentional fall through */\n            case 'text':\n            default:\n                // RFC 2047 section 5.1\n                // Replace every high ascii, control, =, ? and _ characters\n                $pattern = '\\000-\\011\\013\\014\\016-\\037\\075\\077\\137\\177-\\377' . $pattern;\n                break;\n        }\n        $matches = [];\n        if (preg_match_all(\"/[{$pattern}]/\", $encoded, $matches)) {\n            // If the string contains an '=', make sure it's the first thing we replace\n            // so as to avoid double-encoding\n            $eqkey = array_search('=', $matches[0], true);\n            if (false !== $eqkey) {\n                unset($matches[0][$eqkey]);\n                array_unshift($matches[0], '=');\n            }\n            foreach (array_unique($matches[0]) as $char) {\n                $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded);\n            }\n        }\n        // Replace spaces with _ (more readable than =20)\n        // RFC 2047 section 4.2(2)\n        return str_replace(' ', '_', $encoded);\n    }\n\n    /**\n     * Add a string or binary attachment (non-filesystem).\n     * This method can be used to attach ascii or binary data,\n     * such as a BLOB record from a database.\n     *\n     * @param string $string      String attachment data\n     * @param string $filename    Name of the attachment\n     * @param string $encoding    File encoding (see $Encoding)\n     * @param string $type        File extension (MIME) type\n     * @param string $disposition Disposition to use\n     *\n     * @throws Exception\n     *\n     * @return bool True on successfully adding an attachment\n     */\n    public function addStringAttachment(\n        $string,\n        $filename,\n        $encoding = self::ENCODING_BASE64,\n        $type = '',\n        $disposition = 'attachment'\n    ) {\n        try {\n            // If a MIME type is not specified, try to work it out from the file name\n            if ('' === $type) {\n                $type = static::filenameToType($filename);\n            }\n\n            if (!$this->validateEncoding($encoding)) {\n                throw new Exception($this->lang('encoding') . $encoding);\n            }\n\n            // Append to $attachment array\n            $this->attachment[] = [\n                0 => $string,\n                1 => $filename,\n                2 => static::mb_pathinfo($filename, PATHINFO_BASENAME),\n                3 => $encoding,\n                4 => $type,\n                5 => true, // isStringAttachment\n                6 => $disposition,\n                7 => 0,\n            ];\n        } catch (Exception $exc) {\n            $this->setError($exc->getMessage());\n            $this->edebug($exc->getMessage());\n            if ($this->exceptions) {\n                throw $exc;\n            }\n\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Add an embedded (inline) attachment from a file.\n     * This can include images, sounds, and just about any other document type.\n     * These differ from 'regular' attachments in that they are intended to be\n     * displayed inline with the message, not just attached for download.\n     * This is used in HTML messages that embed the images\n     * the HTML refers to using the $cid value.\n     * Never use a user-supplied path to a file!\n     *\n     * @param string $path        Path to the attachment\n     * @param string $cid         Content ID of the attachment; Use this to reference\n     *                            the content when using an embedded image in HTML\n     * @param string $name        Overrides the attachment name\n     * @param string $encoding    File encoding (see $Encoding)\n     * @param string $type        File MIME type\n     * @param string $disposition Disposition to use\n     *\n     * @throws Exception\n     *\n     * @return bool True on successfully adding an attachment\n     */\n    public function addEmbeddedImage(\n        $path,\n        $cid,\n        $name = '',\n        $encoding = self::ENCODING_BASE64,\n        $type = '',\n        $disposition = 'inline'\n    ) {\n        try {\n            if (!static::isPermittedPath($path) || !@is_file($path) || !is_readable($path)) {\n                throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE);\n            }\n\n            // If a MIME type is not specified, try to work it out from the file name\n            if ('' === $type) {\n                $type = static::filenameToType($path);\n            }\n\n            if (!$this->validateEncoding($encoding)) {\n                throw new Exception($this->lang('encoding') . $encoding);\n            }\n\n            $filename = (string) static::mb_pathinfo($path, PATHINFO_BASENAME);\n            if ('' === $name) {\n                $name = $filename;\n            }\n\n            // Append to $attachment array\n            $this->attachment[] = [\n                0 => $path,\n                1 => $filename,\n                2 => $name,\n                3 => $encoding,\n                4 => $type,\n                5 => false, // isStringAttachment\n                6 => $disposition,\n                7 => $cid,\n            ];\n        } catch (Exception $exc) {\n            $this->setError($exc->getMessage());\n            $this->edebug($exc->getMessage());\n            if ($this->exceptions) {\n                throw $exc;\n            }\n\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Add an embedded stringified attachment.\n     * This can include images, sounds, and just about any other document type.\n     * If your filename doesn't contain an extension, be sure to set the $type to an appropriate MIME type.\n     *\n     * @param string $string      The attachment binary data\n     * @param string $cid         Content ID of the attachment; Use this to reference\n     *                            the content when using an embedded image in HTML\n     * @param string $name        A filename for the attachment. If this contains an extension,\n     *                            PHPMailer will attempt to set a MIME type for the attachment.\n     *                            For example 'file.jpg' would get an 'image/jpeg' MIME type.\n     * @param string $encoding    File encoding (see $Encoding), defaults to 'base64'\n     * @param string $type        MIME type - will be used in preference to any automatically derived type\n     * @param string $disposition Disposition to use\n     *\n     * @throws Exception\n     *\n     * @return bool True on successfully adding an attachment\n     */\n    public function addStringEmbeddedImage(\n        $string,\n        $cid,\n        $name = '',\n        $encoding = self::ENCODING_BASE64,\n        $type = '',\n        $disposition = 'inline'\n    ) {\n        try {\n            // If a MIME type is not specified, try to work it out from the name\n            if ('' === $type && !empty($name)) {\n                $type = static::filenameToType($name);\n            }\n\n            if (!$this->validateEncoding($encoding)) {\n                throw new Exception($this->lang('encoding') . $encoding);\n            }\n\n            // Append to $attachment array\n            $this->attachment[] = [\n                0 => $string,\n                1 => $name,\n                2 => $name,\n                3 => $encoding,\n                4 => $type,\n                5 => true, // isStringAttachment\n                6 => $disposition,\n                7 => $cid,\n            ];\n        } catch (Exception $exc) {\n            $this->setError($exc->getMessage());\n            $this->edebug($exc->getMessage());\n            if ($this->exceptions) {\n                throw $exc;\n            }\n\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Validate encodings.\n     *\n     * @param string $encoding\n     *\n     * @return bool\n     */\n    protected function validateEncoding($encoding)\n    {\n        return in_array(\n            $encoding,\n            [\n                self::ENCODING_7BIT,\n                self::ENCODING_QUOTED_PRINTABLE,\n                self::ENCODING_BASE64,\n                self::ENCODING_8BIT,\n                self::ENCODING_BINARY,\n            ],\n            true\n        );\n    }\n\n    /**\n     * Check if an embedded attachment is present with this cid.\n     *\n     * @param string $cid\n     *\n     * @return bool\n     */\n    protected function cidExists($cid)\n    {\n        foreach ($this->attachment as $attachment) {\n            if ('inline' === $attachment[6] && $cid === $attachment[7]) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Check if an inline attachment is present.\n     *\n     * @return bool\n     */\n    public function inlineImageExists()\n    {\n        foreach ($this->attachment as $attachment) {\n            if ('inline' === $attachment[6]) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Check if an attachment (non-inline) is present.\n     *\n     * @return bool\n     */\n    public function attachmentExists()\n    {\n        foreach ($this->attachment as $attachment) {\n            if ('attachment' === $attachment[6]) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Check if this message has an alternative body set.\n     *\n     * @return bool\n     */\n    public function alternativeExists()\n    {\n        return !empty($this->AltBody);\n    }\n\n    /**\n     * Clear queued addresses of given kind.\n     *\n     * @param string $kind 'to', 'cc', or 'bcc'\n     */\n    public function clearQueuedAddresses($kind)\n    {\n        $this->RecipientsQueue = array_filter(\n            $this->RecipientsQueue,\n            static function ($params) use ($kind) {\n                return $params[0] !== $kind;\n            }\n        );\n    }\n\n    /**\n     * Clear all To recipients.\n     */\n    public function clearAddresses()\n    {\n        foreach ($this->to as $to) {\n            unset($this->all_recipients[strtolower($to[0])]);\n        }\n        $this->to = [];\n        $this->clearQueuedAddresses('to');\n    }\n\n    /**\n     * Clear all CC recipients.\n     */\n    public function clearCCs()\n    {\n        foreach ($this->cc as $cc) {\n            unset($this->all_recipients[strtolower($cc[0])]);\n        }\n        $this->cc = [];\n        $this->clearQueuedAddresses('cc');\n    }\n\n    /**\n     * Clear all BCC recipients.\n     */\n    public function clearBCCs()\n    {\n        foreach ($this->bcc as $bcc) {\n            unset($this->all_recipients[strtolower($bcc[0])]);\n        }\n        $this->bcc = [];\n        $this->clearQueuedAddresses('bcc');\n    }\n\n    /**\n     * Clear all ReplyTo recipients.\n     */\n    public function clearReplyTos()\n    {\n        $this->ReplyTo = [];\n        $this->ReplyToQueue = [];\n    }\n\n    /**\n     * Clear all recipient types.\n     */\n    public function clearAllRecipients()\n    {\n        $this->to = [];\n        $this->cc = [];\n        $this->bcc = [];\n        $this->all_recipients = [];\n        $this->RecipientsQueue = [];\n    }\n\n    /**\n     * Clear all filesystem, string, and binary attachments.\n     */\n    public function clearAttachments()\n    {\n        $this->attachment = [];\n    }\n\n    /**\n     * Clear all custom headers.\n     */\n    public function clearCustomHeaders()\n    {\n        $this->CustomHeader = [];\n    }\n\n    /**\n     * Add an error message to the error container.\n     *\n     * @param string $msg\n     */\n    protected function setError($msg)\n    {\n        ++$this->error_count;\n        if ('smtp' === $this->Mailer && null !== $this->smtp) {\n            $lasterror = $this->smtp->getError();\n            if (!empty($lasterror['error'])) {\n                $msg .= $this->lang('smtp_error') . $lasterror['error'];\n                if (!empty($lasterror['detail'])) {\n                    $msg .= ' Detail: ' . $lasterror['detail'];\n                }\n                if (!empty($lasterror['smtp_code'])) {\n                    $msg .= ' SMTP code: ' . $lasterror['smtp_code'];\n                }\n                if (!empty($lasterror['smtp_code_ex'])) {\n                    $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex'];\n                }\n            }\n        }\n        $this->ErrorInfo = $msg;\n    }\n\n    /**\n     * Return an RFC 822 formatted date.\n     *\n     * @return string\n     */\n    public static function rfcDate()\n    {\n        // Set the time zone to whatever the default is to avoid 500 errors\n        // Will default to UTC if it's not set properly in php.ini\n        date_default_timezone_set(@date_default_timezone_get());\n\n        return date('D, j M Y H:i:s O');\n    }\n\n    /**\n     * Get the server hostname.\n     * Returns 'localhost.localdomain' if unknown.\n     *\n     * @return string\n     */\n    protected function serverHostname()\n    {\n        $result = '';\n        if (!empty($this->Hostname)) {\n            $result = $this->Hostname;\n        } elseif (isset($_SERVER) && array_key_exists('SERVER_NAME', $_SERVER)) {\n            $result = $_SERVER['SERVER_NAME'];\n        } elseif (function_exists('gethostname') && gethostname() !== false) {\n            $result = gethostname();\n        } elseif (php_uname('n') !== false) {\n            $result = php_uname('n');\n        }\n        if (!static::isValidHost($result)) {\n            return 'localhost.localdomain';\n        }\n\n        return $result;\n    }\n\n    /**\n     * Validate whether a string contains a valid value to use as a hostname or IP address.\n     * IPv6 addresses must include [], e.g. `[::1]`, not just `::1`.\n     *\n     * @param string $host The host name or IP address to check\n     *\n     * @return bool\n     */\n    public static function isValidHost($host)\n    {\n        //Simple syntax limits\n        if (empty($host)\n            || !is_string($host)\n            || strlen($host) > 256\n            || !preg_match('/^([a-zA-Z\\d.-]*|\\[[a-fA-F\\d:]+])$/', $host)\n        ) {\n            return false;\n        }\n        //Looks like a bracketed IPv6 address\n        if (strlen($host) > 2 && substr($host, 0, 1) === '[' && substr($host, -1, 1) === ']') {\n            return filter_var(substr($host, 1, -1), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false;\n        }\n        //If removing all the dots results in a numeric string, it must be an IPv4 address.\n        //Need to check this first because otherwise things like `999.0.0.0` are considered valid host names\n        if (is_numeric(str_replace('.', '', $host))) {\n            //Is it a valid IPv4 address?\n            return filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false;\n        }\n        if (filter_var('http://' . $host, FILTER_VALIDATE_URL) !== false) {\n            //Is it a syntactically valid hostname?\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Get an error message in the current language.\n     *\n     * @param string $key\n     *\n     * @return string\n     */\n    protected function lang($key)\n    {\n        if (count($this->language) < 1) {\n            $this->setLanguage(); // set the default language\n        }\n\n        if (array_key_exists($key, $this->language)) {\n            if ('smtp_connect_failed' === $key) {\n                //Include a link to troubleshooting docs on SMTP connection failure\n                //this is by far the biggest cause of support questions\n                //but it's usually not PHPMailer's fault.\n                return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting';\n            }\n\n            return $this->language[$key];\n        }\n\n        //Return the key as a fallback\n        return $key;\n    }\n\n    /**\n     * Check if an error occurred.\n     *\n     * @return bool True if an error did occur\n     */\n    public function isError()\n    {\n        return $this->error_count > 0;\n    }\n\n    /**\n     * Add a custom header.\n     * $name value can be overloaded to contain\n     * both header name and value (name:value).\n     *\n     * @param string      $name  Custom header name\n     * @param string|null $value Header value\n     *\n     * @throws Exception\n     */\n    public function addCustomHeader($name, $value = null)\n    {\n        if (null === $value && strpos($name, ':') !== false) {\n            // Value passed in as name:value\n            list($name, $value) = explode(':', $name, 2);\n        }\n        $name = trim($name);\n        $value = trim($value);\n        //Ensure name is not empty, and that neither name nor value contain line breaks\n        if (empty($name) || strpbrk($name . $value, \"\\r\\n\") !== false) {\n            if ($this->exceptions) {\n                throw new Exception('Invalid header name or value');\n            }\n\n            return false;\n        }\n        $this->CustomHeader[] = [$name, $value];\n\n        return true;\n    }\n\n    /**\n     * Returns all custom headers.\n     *\n     * @return array\n     */\n    public function getCustomHeaders()\n    {\n        return $this->CustomHeader;\n    }\n\n    /**\n     * Create a message body from an HTML string.\n     * Automatically inlines images and creates a plain-text version by converting the HTML,\n     * overwriting any existing values in Body and AltBody.\n     * Do not source $message content from user input!\n     * $basedir is prepended when handling relative URLs, e.g. <img src=\"/images/a.png\"> and must not be empty\n     * will look for an image file in $basedir/images/a.png and convert it to inline.\n     * If you don't provide a $basedir, relative paths will be left untouched (and thus probably break in email)\n     * Converts data-uri images into embedded attachments.\n     * If you don't want to apply these transformations to your HTML, just set Body and AltBody directly.\n     *\n     * @param string        $message  HTML message string\n     * @param string        $basedir  Absolute path to a base directory to prepend to relative paths to images\n     * @param bool|callable $advanced Whether to use the internal HTML to text converter\n     *                                or your own custom converter @return string $message The transformed message Body\n     *\n     * @throws Exception\n     *\n     * @see PHPMailer::html2text()\n     */\n    public function msgHTML($message, $basedir = '', $advanced = false)\n    {\n        preg_match_all('/(?<!-)(src|background)=[\"\\'](.*)[\"\\']/Ui', $message, $images);\n        if (array_key_exists(2, $images)) {\n            if (strlen($basedir) > 1 && '/' !== substr($basedir, -1)) {\n                // Ensure $basedir has a trailing /\n                $basedir .= '/';\n            }\n            foreach ($images[2] as $imgindex => $url) {\n                // Convert data URIs into embedded images\n                //e.g. \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"\n                $match = [];\n                if (preg_match('#^data:(image/(?:jpe?g|gif|png));?(base64)?,(.+)#', $url, $match)) {\n                    if (count($match) === 4 && static::ENCODING_BASE64 === $match[2]) {\n                        $data = base64_decode($match[3]);\n                    } elseif ('' === $match[2]) {\n                        $data = rawurldecode($match[3]);\n                    } else {\n                        //Not recognised so leave it alone\n                        continue;\n                    }\n                    //Hash the decoded data, not the URL, so that the same data-URI image used in multiple places\n                    //will only be embedded once, even if it used a different encoding\n                    $cid = substr(hash('sha256', $data), 0, 32) . '@phpmailer.0'; // RFC2392 S 2\n\n                    if (!$this->cidExists($cid)) {\n                        $this->addStringEmbeddedImage(\n                            $data,\n                            $cid,\n                            'embed' . $imgindex,\n                            static::ENCODING_BASE64,\n                            $match[1]\n                        );\n                    }\n                    $message = str_replace(\n                        $images[0][$imgindex],\n                        $images[1][$imgindex] . '=\"cid:' . $cid . '\"',\n                        $message\n                    );\n                    continue;\n                }\n                if (// Only process relative URLs if a basedir is provided (i.e. no absolute local paths)\n                    !empty($basedir)\n                    // Ignore URLs containing parent dir traversal (..)\n                    && (strpos($url, '..') === false)\n                    // Do not change urls that are already inline images\n                    && 0 !== strpos($url, 'cid:')\n                    // Do not change absolute URLs, including anonymous protocol\n                    && !preg_match('#^[a-z][a-z0-9+.-]*:?//#i', $url)\n                ) {\n                    $filename = static::mb_pathinfo($url, PATHINFO_BASENAME);\n                    $directory = dirname($url);\n                    if ('.' === $directory) {\n                        $directory = '';\n                    }\n                    // RFC2392 S 2\n                    $cid = substr(hash('sha256', $url), 0, 32) . '@phpmailer.0';\n                    if (strlen($basedir) > 1 && '/' !== substr($basedir, -1)) {\n                        $basedir .= '/';\n                    }\n                    if (strlen($directory) > 1 && '/' !== substr($directory, -1)) {\n                        $directory .= '/';\n                    }\n                    if ($this->addEmbeddedImage(\n                        $basedir . $directory . $filename,\n                        $cid,\n                        $filename,\n                        static::ENCODING_BASE64,\n                        static::_mime_types((string) static::mb_pathinfo($filename, PATHINFO_EXTENSION))\n                    )\n                    ) {\n                        $message = preg_replace(\n                            '/' . $images[1][$imgindex] . '=[\"\\']' . preg_quote($url, '/') . '[\"\\']/Ui',\n                            $images[1][$imgindex] . '=\"cid:' . $cid . '\"',\n                            $message\n                        );\n                    }\n                }\n            }\n        }\n        $this->isHTML();\n        // Convert all message body line breaks to LE, makes quoted-printable encoding work much better\n        $this->Body = static::normalizeBreaks($message);\n        $this->AltBody = static::normalizeBreaks($this->html2text($message, $advanced));\n        if (!$this->alternativeExists()) {\n            $this->AltBody = 'This is an HTML-only message. To view it, activate HTML in your email application.'\n                . static::$LE;\n        }\n\n        return $this->Body;\n    }\n\n    /**\n     * Convert an HTML string into plain text.\n     * This is used by msgHTML().\n     * Note - older versions of this function used a bundled advanced converter\n     * which was removed for license reasons in #232.\n     * Example usage:\n     *\n     * ```php\n     * // Use default conversion\n     * $plain = $mail->html2text($html);\n     * // Use your own custom converter\n     * $plain = $mail->html2text($html, function($html) {\n     *     $converter = new MyHtml2text($html);\n     *     return $converter->get_text();\n     * });\n     * ```\n     *\n     * @param string        $html     The HTML text to convert\n     * @param bool|callable $advanced Any boolean value to use the internal converter,\n     *                                or provide your own callable for custom conversion\n     *\n     * @return string\n     */\n    public function html2text($html, $advanced = false)\n    {\n        if (is_callable($advanced)) {\n            return $advanced($html);\n        }\n\n        return html_entity_decode(\n            trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\\/\\\\1>/si', '', $html))),\n            ENT_QUOTES,\n            $this->CharSet\n        );\n    }\n\n    /**\n     * Get the MIME type for a file extension.\n     *\n     * @param string $ext File extension\n     *\n     * @return string MIME type of file\n     */\n    public static function _mime_types($ext = '')\n    {\n        $mimes = [\n            'xl' => 'application/excel',\n            'js' => 'application/javascript',\n            'hqx' => 'application/mac-binhex40',\n            'cpt' => 'application/mac-compactpro',\n            'bin' => 'application/macbinary',\n            'doc' => 'application/msword',\n            'word' => 'application/msword',\n            'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n            'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',\n            'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',\n            'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n            'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n            'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',\n            'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n            'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',\n            'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',\n            'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',\n            'class' => 'application/octet-stream',\n            'dll' => 'application/octet-stream',\n            'dms' => 'application/octet-stream',\n            'exe' => 'application/octet-stream',\n            'lha' => 'application/octet-stream',\n            'lzh' => 'application/octet-stream',\n            'psd' => 'application/octet-stream',\n            'sea' => 'application/octet-stream',\n            'so' => 'application/octet-stream',\n            'oda' => 'application/oda',\n            'pdf' => 'application/pdf',\n            'ai' => 'application/postscript',\n            'eps' => 'application/postscript',\n            'ps' => 'application/postscript',\n            'smi' => 'application/smil',\n            'smil' => 'application/smil',\n            'mif' => 'application/vnd.mif',\n            'xls' => 'application/vnd.ms-excel',\n            'ppt' => 'application/vnd.ms-powerpoint',\n            'wbxml' => 'application/vnd.wap.wbxml',\n            'wmlc' => 'application/vnd.wap.wmlc',\n            'dcr' => 'application/x-director',\n            'dir' => 'application/x-director',\n            'dxr' => 'application/x-director',\n            'dvi' => 'application/x-dvi',\n            'gtar' => 'application/x-gtar',\n            'php3' => 'application/x-httpd-php',\n            'php4' => 'application/x-httpd-php',\n            'php' => 'application/x-httpd-php',\n            'phtml' => 'application/x-httpd-php',\n            'phps' => 'application/x-httpd-php-source',\n            'swf' => 'application/x-shockwave-flash',\n            'sit' => 'application/x-stuffit',\n            'tar' => 'application/x-tar',\n            'tgz' => 'application/x-tar',\n            'xht' => 'application/xhtml+xml',\n            'xhtml' => 'application/xhtml+xml',\n            'zip' => 'application/zip',\n            'mid' => 'audio/midi',\n            'midi' => 'audio/midi',\n            'mp2' => 'audio/mpeg',\n            'mp3' => 'audio/mpeg',\n            'm4a' => 'audio/mp4',\n            'mpga' => 'audio/mpeg',\n            'aif' => 'audio/x-aiff',\n            'aifc' => 'audio/x-aiff',\n            'aiff' => 'audio/x-aiff',\n            'ram' => 'audio/x-pn-realaudio',\n            'rm' => 'audio/x-pn-realaudio',\n            'rpm' => 'audio/x-pn-realaudio-plugin',\n            'ra' => 'audio/x-realaudio',\n            'wav' => 'audio/x-wav',\n            'mka' => 'audio/x-matroska',\n            'bmp' => 'image/bmp',\n            'gif' => 'image/gif',\n            'jpeg' => 'image/jpeg',\n            'jpe' => 'image/jpeg',\n            'jpg' => 'image/jpeg',\n            'png' => 'image/png',\n            'tiff' => 'image/tiff',\n            'tif' => 'image/tiff',\n            'webp' => 'image/webp',\n            'heif' => 'image/heif',\n            'heifs' => 'image/heif-sequence',\n            'heic' => 'image/heic',\n            'heics' => 'image/heic-sequence',\n            'eml' => 'message/rfc822',\n            'css' => 'text/css',\n            'html' => 'text/html',\n            'htm' => 'text/html',\n            'shtml' => 'text/html',\n            'log' => 'text/plain',\n            'text' => 'text/plain',\n            'txt' => 'text/plain',\n            'rtx' => 'text/richtext',\n            'rtf' => 'text/rtf',\n            'vcf' => 'text/vcard',\n            'vcard' => 'text/vcard',\n            'ics' => 'text/calendar',\n            'xml' => 'text/xml',\n            'xsl' => 'text/xml',\n            'wmv' => 'video/x-ms-wmv',\n            'mpeg' => 'video/mpeg',\n            'mpe' => 'video/mpeg',\n            'mpg' => 'video/mpeg',\n            'mp4' => 'video/mp4',\n            'm4v' => 'video/mp4',\n            'mov' => 'video/quicktime',\n            'qt' => 'video/quicktime',\n            'rv' => 'video/vnd.rn-realvideo',\n            'avi' => 'video/x-msvideo',\n            'movie' => 'video/x-sgi-movie',\n            'webm' => 'video/webm',\n            'mkv' => 'video/x-matroska',\n        ];\n        $ext = strtolower($ext);\n        if (array_key_exists($ext, $mimes)) {\n            return $mimes[$ext];\n        }\n\n        return 'application/octet-stream';\n    }\n\n    /**\n     * Map a file name to a MIME type.\n     * Defaults to 'application/octet-stream', i.e.. arbitrary binary data.\n     *\n     * @param string $filename A file name or full path, does not need to exist as a file\n     *\n     * @return string\n     */\n    public static function filenameToType($filename)\n    {\n        // In case the path is a URL, strip any query string before getting extension\n        $qpos = strpos($filename, '?');\n        if (false !== $qpos) {\n            $filename = substr($filename, 0, $qpos);\n        }\n        $ext = static::mb_pathinfo($filename, PATHINFO_EXTENSION);\n\n        return static::_mime_types($ext);\n    }\n\n    /**\n     * Multi-byte-safe pathinfo replacement.\n     * Drop-in replacement for pathinfo(), but multibyte- and cross-platform-safe.\n     *\n     * @see http://www.php.net/manual/en/function.pathinfo.php#107461\n     *\n     * @param string     $path    A filename or path, does not need to exist as a file\n     * @param int|string $options Either a PATHINFO_* constant,\n     *                            or a string name to return only the specified piece\n     *\n     * @return string|array\n     */\n    public static function mb_pathinfo($path, $options = null)\n    {\n        $ret = ['dirname' => '', 'basename' => '', 'extension' => '', 'filename' => ''];\n        $pathinfo = [];\n        if (preg_match('#^(.*?)[\\\\\\\\/]*(([^/\\\\\\\\]*?)(\\.([^.\\\\\\\\/]+?)|))[\\\\\\\\/.]*$#m', $path, $pathinfo)) {\n            if (array_key_exists(1, $pathinfo)) {\n                $ret['dirname'] = $pathinfo[1];\n            }\n            if (array_key_exists(2, $pathinfo)) {\n                $ret['basename'] = $pathinfo[2];\n            }\n            if (array_key_exists(5, $pathinfo)) {\n                $ret['extension'] = $pathinfo[5];\n            }\n            if (array_key_exists(3, $pathinfo)) {\n                $ret['filename'] = $pathinfo[3];\n            }\n        }\n        switch ($options) {\n            case PATHINFO_DIRNAME:\n            case 'dirname':\n                return $ret['dirname'];\n            case PATHINFO_BASENAME:\n            case 'basename':\n                return $ret['basename'];\n            case PATHINFO_EXTENSION:\n            case 'extension':\n                return $ret['extension'];\n            case PATHINFO_FILENAME:\n            case 'filename':\n                return $ret['filename'];\n            default:\n                return $ret;\n        }\n    }\n\n    /**\n     * Set or reset instance properties.\n     * You should avoid this function - it's more verbose, less efficient, more error-prone and\n     * harder to debug than setting properties directly.\n     * Usage Example:\n     * `$mail->set('SMTPSecure', static::ENCRYPTION_STARTTLS);`\n     *   is the same as:\n     * `$mail->SMTPSecure = static::ENCRYPTION_STARTTLS;`.\n     *\n     * @param string $name  The property name to set\n     * @param mixed  $value The value to set the property to\n     *\n     * @return bool\n     */\n    public function set($name, $value = '')\n    {\n        if (property_exists($this, $name)) {\n            $this->$name = $value;\n\n            return true;\n        }\n        $this->setError($this->lang('variable_set') . $name);\n\n        return false;\n    }\n\n    /**\n     * Strip newlines to prevent header injection.\n     *\n     * @param string $str\n     *\n     * @return string\n     */\n    public function secureHeader($str)\n    {\n        return trim(str_replace([\"\\r\", \"\\n\"], '', $str));\n    }\n\n    /**\n     * Normalize line breaks in a string.\n     * Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format.\n     * Defaults to CRLF (for message bodies) and preserves consecutive breaks.\n     *\n     * @param string $text\n     * @param string $breaktype What kind of line break to use; defaults to static::$LE\n     *\n     * @return string\n     */\n    public static function normalizeBreaks($text, $breaktype = null)\n    {\n        if (null === $breaktype) {\n            $breaktype = static::$LE;\n        }\n        // Normalise to \\n\n        $text = str_replace([self::CRLF, \"\\r\"], \"\\n\", $text);\n        // Now convert LE as needed\n        if (\"\\n\" !== $breaktype) {\n            $text = str_replace(\"\\n\", $breaktype, $text);\n        }\n\n        return $text;\n    }\n\n    /**\n     * Remove trailing breaks from a string.\n     *\n     * @param string $text\n     *\n     * @return string The text to remove breaks from\n     */\n    public static function stripTrailingWSP($text)\n    {\n        return rtrim($text, \" \\r\\n\\t\");\n    }\n\n    /**\n     * Return the current line break format string.\n     *\n     * @return string\n     */\n    public static function getLE()\n    {\n        return static::$LE;\n    }\n\n    /**\n     * Set the line break format string, e.g. \"\\r\\n\".\n     *\n     * @param string $le\n     */\n    protected static function setLE($le)\n    {\n        static::$LE = $le;\n    }\n\n    /**\n     * Set the public and private key files and password for S/MIME signing.\n     *\n     * @param string $cert_filename\n     * @param string $key_filename\n     * @param string $key_pass            Password for private key\n     * @param string $extracerts_filename Optional path to chain certificate\n     */\n    public function sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '')\n    {\n        $this->sign_cert_file = $cert_filename;\n        $this->sign_key_file = $key_filename;\n        $this->sign_key_pass = $key_pass;\n        $this->sign_extracerts_file = $extracerts_filename;\n    }\n\n    /**\n     * Quoted-Printable-encode a DKIM header.\n     *\n     * @param string $txt\n     *\n     * @return string\n     */\n    public function DKIM_QP($txt)\n    {\n        $line = '';\n        $len = strlen($txt);\n        for ($i = 0; $i < $len; ++$i) {\n            $ord = ord($txt[$i]);\n            if (((0x21 <= $ord) && ($ord <= 0x3A)) || $ord === 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E))) {\n                $line .= $txt[$i];\n            } else {\n                $line .= '=' . sprintf('%02X', $ord);\n            }\n        }\n\n        return $line;\n    }\n\n    /**\n     * Generate a DKIM signature.\n     *\n     * @param string $signHeader\n     *\n     * @throws Exception\n     *\n     * @return string The DKIM signature value\n     */\n    public function DKIM_Sign($signHeader)\n    {\n        if (!defined('PKCS7_TEXT')) {\n            if ($this->exceptions) {\n                throw new Exception($this->lang('extension_missing') . 'openssl');\n            }\n\n            return '';\n        }\n        $privKeyStr = !empty($this->DKIM_private_string) ?\n            $this->DKIM_private_string :\n            file_get_contents($this->DKIM_private);\n        if ('' !== $this->DKIM_passphrase) {\n            $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase);\n        } else {\n            $privKey = openssl_pkey_get_private($privKeyStr);\n        }\n        if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) {\n            openssl_pkey_free($privKey);\n\n            return base64_encode($signature);\n        }\n        openssl_pkey_free($privKey);\n\n        return '';\n    }\n\n    /**\n     * Generate a DKIM canonicalization header.\n     * Uses the 'relaxed' algorithm from RFC6376 section 3.4.2.\n     * Canonicalized headers should *always* use CRLF, regardless of mailer setting.\n     *\n     * @see https://tools.ietf.org/html/rfc6376#section-3.4.2\n     *\n     * @param string $signHeader Header\n     *\n     * @return string\n     */\n    public function DKIM_HeaderC($signHeader)\n    {\n        //Normalize breaks to CRLF (regardless of the mailer)\n        $signHeader = static::normalizeBreaks($signHeader, self::CRLF);\n        //Unfold header lines\n        //Note PCRE \\s is too broad a definition of whitespace; RFC5322 defines it as `[ \\t]`\n        //@see https://tools.ietf.org/html/rfc5322#section-2.2\n        //That means this may break if you do something daft like put vertical tabs in your headers.\n        $signHeader = preg_replace('/\\r\\n[ \\t]+/', ' ', $signHeader);\n        //Break headers out into an array\n        $lines = explode(self::CRLF, $signHeader);\n        foreach ($lines as $key => $line) {\n            //If the header is missing a :, skip it as it's invalid\n            //This is likely to happen because the explode() above will also split\n            //on the trailing LE, leaving an empty line\n            if (strpos($line, ':') === false) {\n                continue;\n            }\n            list($heading, $value) = explode(':', $line, 2);\n            //Lower-case header name\n            $heading = strtolower($heading);\n            //Collapse white space within the value, also convert WSP to space\n            $value = preg_replace('/[ \\t]+/', ' ', $value);\n            //RFC6376 is slightly unclear here - it says to delete space at the *end* of each value\n            //But then says to delete space before and after the colon.\n            //Net result is the same as trimming both ends of the value.\n            //By elimination, the same applies to the field name\n            $lines[$key] = trim($heading, \" \\t\") . ':' . trim($value, \" \\t\");\n        }\n\n        return implode(self::CRLF, $lines);\n    }\n\n    /**\n     * Generate a DKIM canonicalization body.\n     * Uses the 'simple' algorithm from RFC6376 section 3.4.3.\n     * Canonicalized bodies should *always* use CRLF, regardless of mailer setting.\n     *\n     * @see https://tools.ietf.org/html/rfc6376#section-3.4.3\n     *\n     * @param string $body Message Body\n     *\n     * @return string\n     */\n    public function DKIM_BodyC($body)\n    {\n        if (empty($body)) {\n            return self::CRLF;\n        }\n        // Normalize line endings to CRLF\n        $body = static::normalizeBreaks($body, self::CRLF);\n\n        //Reduce multiple trailing line breaks to a single one\n        return static::stripTrailingWSP($body) . self::CRLF;\n    }\n\n    /**\n     * Create the DKIM header and body in a new message header.\n     *\n     * @param string $headers_line Header lines\n     * @param string $subject      Subject\n     * @param string $body         Body\n     *\n     * @throws Exception\n     *\n     * @return string\n     */\n    public function DKIM_Add($headers_line, $subject, $body)\n    {\n        $DKIMsignatureType = 'rsa-sha256'; // Signature & hash algorithms\n        $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization methods of header & body\n        $DKIMquery = 'dns/txt'; // Query method\n        $DKIMtime = time();\n        //Always sign these headers without being asked\n        //Recommended list from https://tools.ietf.org/html/rfc6376#section-5.4.1\n        $autoSignHeaders = [\n            'from',\n            'to',\n            'cc',\n            'date',\n            'subject',\n            'reply-to',\n            'message-id',\n            'content-type',\n            'mime-version',\n            'x-mailer',\n        ];\n        if (stripos($headers_line, 'Subject') === false) {\n            $headers_line .= 'Subject: ' . $subject . static::$LE;\n        }\n        $headerLines = explode(static::$LE, $headers_line);\n        $currentHeaderLabel = '';\n        $currentHeaderValue = '';\n        $parsedHeaders = [];\n        $headerLineIndex = 0;\n        $headerLineCount = count($headerLines);\n        foreach ($headerLines as $headerLine) {\n            $matches = [];\n            if (preg_match('/^([^ \\t]*?)(?::[ \\t]*)(.*)$/', $headerLine, $matches)) {\n                if ($currentHeaderLabel !== '') {\n                    //We were previously in another header; This is the start of a new header, so save the previous one\n                    $parsedHeaders[] = ['label' => $currentHeaderLabel, 'value' => $currentHeaderValue];\n                }\n                $currentHeaderLabel = $matches[1];\n                $currentHeaderValue = $matches[2];\n            } elseif (preg_match('/^[ \\t]+(.*)$/', $headerLine, $matches)) {\n                //This is a folded continuation of the current header, so unfold it\n                $currentHeaderValue .= ' ' . $matches[1];\n            }\n            ++$headerLineIndex;\n            if ($headerLineIndex >= $headerLineCount) {\n                //This was the last line, so finish off this header\n                $parsedHeaders[] = ['label' => $currentHeaderLabel, 'value' => $currentHeaderValue];\n            }\n        }\n        $copiedHeaders = [];\n        $headersToSignKeys = [];\n        $headersToSign = [];\n        foreach ($parsedHeaders as $header) {\n            //Is this header one that must be included in the DKIM signature?\n            if (in_array(strtolower($header['label']), $autoSignHeaders, true)) {\n                $headersToSignKeys[] = $header['label'];\n                $headersToSign[] = $header['label'] . ': ' . $header['value'];\n                if ($this->DKIM_copyHeaderFields) {\n                    $copiedHeaders[] = $header['label'] . ':' . //Note no space after this, as per RFC\n                        str_replace('|', '=7C', $this->DKIM_QP($header['value']));\n                }\n                continue;\n            }\n            //Is this an extra custom header we've been asked to sign?\n            if (in_array($header['label'], $this->DKIM_extraHeaders, true)) {\n                //Find its value in custom headers\n                foreach ($this->CustomHeader as $customHeader) {\n                    if ($customHeader[0] === $header['label']) {\n                        $headersToSignKeys[] = $header['label'];\n                        $headersToSign[] = $header['label'] . ': ' . $header['value'];\n                        if ($this->DKIM_copyHeaderFields) {\n                            $copiedHeaders[] = $header['label'] . ':' . //Note no space after this, as per RFC\n                                str_replace('|', '=7C', $this->DKIM_QP($header['value']));\n                        }\n                        //Skip straight to the next header\n                        continue 2;\n                    }\n                }\n            }\n        }\n        $copiedHeaderFields = '';\n        if ($this->DKIM_copyHeaderFields && count($copiedHeaders) > 0) {\n            //Assemble a DKIM 'z' tag\n            $copiedHeaderFields = ' z=';\n            $first = true;\n            foreach ($copiedHeaders as $copiedHeader) {\n                if (!$first) {\n                    $copiedHeaderFields .= static::$LE . ' |';\n                }\n                //Fold long values\n                if (strlen($copiedHeader) > self::STD_LINE_LENGTH - 3) {\n                    $copiedHeaderFields .= substr(\n                        chunk_split($copiedHeader, self::STD_LINE_LENGTH - 3, static::$LE . self::FWS),\n                        0,\n                        -strlen(static::$LE . self::FWS)\n                    );\n                } else {\n                    $copiedHeaderFields .= $copiedHeader;\n                }\n                $first = false;\n            }\n            $copiedHeaderFields .= ';' . static::$LE;\n        }\n        $headerKeys = ' h=' . implode(':', $headersToSignKeys) . ';' . static::$LE;\n        $headerValues = implode(static::$LE, $headersToSign);\n        $body = $this->DKIM_BodyC($body);\n        $DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body\n        $ident = '';\n        if ('' !== $this->DKIM_identity) {\n            $ident = ' i=' . $this->DKIM_identity . ';' . static::$LE;\n        }\n        //The DKIM-Signature header is included in the signature *except for* the value of the `b` tag\n        //which is appended after calculating the signature\n        //https://tools.ietf.org/html/rfc6376#section-3.5\n        $dkimSignatureHeader = 'DKIM-Signature: v=1;' .\n            ' d=' . $this->DKIM_domain . ';' .\n            ' s=' . $this->DKIM_selector . ';' . static::$LE .\n            ' a=' . $DKIMsignatureType . ';' .\n            ' q=' . $DKIMquery . ';' .\n            ' t=' . $DKIMtime . ';' .\n            ' c=' . $DKIMcanonicalization . ';' . static::$LE .\n            $headerKeys .\n            $ident .\n            $copiedHeaderFields .\n            ' bh=' . $DKIMb64 . ';' . static::$LE .\n            ' b=';\n        //Canonicalize the set of headers\n        $canonicalizedHeaders = $this->DKIM_HeaderC(\n            $headerValues . static::$LE . $dkimSignatureHeader\n        );\n        $signature = $this->DKIM_Sign($canonicalizedHeaders);\n        $signature = trim(chunk_split($signature, self::STD_LINE_LENGTH - 3, static::$LE . self::FWS));\n\n        return static::normalizeBreaks($dkimSignatureHeader . $signature);\n    }\n\n    /**\n     * Detect if a string contains a line longer than the maximum line length\n     * allowed by RFC 2822 section 2.1.1.\n     *\n     * @param string $str\n     *\n     * @return bool\n     */\n    public static function hasLineLongerThanMax($str)\n    {\n        return (bool) preg_match('/^(.{' . (self::MAX_LINE_LENGTH + strlen(static::$LE)) . ',})/m', $str);\n    }\n\n    /**\n     * If a string contains any \"special\" characters, double-quote the name,\n     * and escape any double quotes with a backslash.\n     *\n     * @param string $str\n     *\n     * @return string\n     *\n     * @see RFC822 3.4.1\n     */\n    public static function quotedString($str)\n    {\n        if (preg_match('/[ ()<>@,;:\"\\/\\[\\]?=]/', $str)) {\n            //If the string contains any of these chars, it must be double-quoted\n            //and any double quotes must be escaped with a backslash\n            return '\"' . str_replace('\"', '\\\\\"', $str) . '\"';\n        }\n\n        //Return the string untouched, it doesn't need quoting\n        return $str;\n    }\n\n    /**\n     * Allows for public read access to 'to' property.\n     * Before the send() call, queued addresses (i.e. with IDN) are not yet included.\n     *\n     * @return array\n     */\n    public function getToAddresses()\n    {\n        return $this->to;\n    }\n\n    /**\n     * Allows for public read access to 'cc' property.\n     * Before the send() call, queued addresses (i.e. with IDN) are not yet included.\n     *\n     * @return array\n     */\n    public function getCcAddresses()\n    {\n        return $this->cc;\n    }\n\n    /**\n     * Allows for public read access to 'bcc' property.\n     * Before the send() call, queued addresses (i.e. with IDN) are not yet included.\n     *\n     * @return array\n     */\n    public function getBccAddresses()\n    {\n        return $this->bcc;\n    }\n\n    /**\n     * Allows for public read access to 'ReplyTo' property.\n     * Before the send() call, queued addresses (i.e. with IDN) are not yet included.\n     *\n     * @return array\n     */\n    public function getReplyToAddresses()\n    {\n        return $this->ReplyTo;\n    }\n\n    /**\n     * Allows for public read access to 'all_recipients' property.\n     * Before the send() call, queued addresses (i.e. with IDN) are not yet included.\n     *\n     * @return array\n     */\n    public function getAllRecipientAddresses()\n    {\n        return $this->all_recipients;\n    }\n\n    /**\n     * Perform a callback.\n     *\n     * @param bool   $isSent\n     * @param array  $to\n     * @param array  $cc\n     * @param array  $bcc\n     * @param string $subject\n     * @param string $body\n     * @param string $from\n     * @param array  $extra\n     */\n    protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from, $extra)\n    {\n        if (!empty($this->action_function) && is_callable($this->action_function)) {\n            call_user_func($this->action_function, $isSent, $to, $cc, $bcc, $subject, $body, $from, $extra);\n        }\n    }\n\n    /**\n     * Get the OAuth instance.\n     *\n     * @return OAuth\n     */\n    public function getOAuth()\n    {\n        return $this->oauth;\n    }\n\n    /**\n     * Set an OAuth instance.\n     */\n    public function setOAuth(OAuth $oauth)\n    {\n        $this->oauth = $oauth;\n    }\n}\n", "num_lines": 4838}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * PHPMailer RFC821 SMTP email transport class.\n * PHP Version 5.5.\n *\n * @see       https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project\n *\n * @author    Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>\n * @author    Jim Jagielski (jimjag) <jimjag@gmail.com>\n * @author    Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>\n * @author    Brent R. Matzelle (original founder)\n * @copyright 2012 - 2019 Marcus Bointon\n * @copyright 2010 - 2012 Jim Jagielski\n * @copyright 2004 - 2009 Andy Prevost\n * @license   http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License\n * @note      This program is distributed in the hope that it will be useful - WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE.\n */\n\nnamespace PHPMailer\\PHPMailer;\n\n/**\n * PHPMailer RFC821 SMTP email transport class.\n * Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server.\n *\n * @author Chris Ryan\n * @author Marcus Bointon <phpmailer@synchromedia.co.uk>\n */\nclass SMTP\n{\n    /**\n     * The PHPMailer SMTP version number.\n     *\n     * @var string\n     */\n    const VERSION = '6.1.6';\n\n    /**\n     * SMTP line break constant.\n     *\n     * @var string\n     */\n    const LE = \"\\r\\n\";\n\n    /**\n     * The SMTP port to use if one is not specified.\n     *\n     * @var int\n     */\n    const DEFAULT_PORT = 25;\n\n    /**\n     * The maximum line length allowed by RFC 5321 section 4.5.3.1.6,\n     * *excluding* a trailing CRLF break.\n     *\n     * @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6\n     *\n     * @var int\n     */\n    const MAX_LINE_LENGTH = 998;\n\n    /**\n     * The maximum line length allowed for replies in RFC 5321 section 4.5.3.1.5,\n     * *including* a trailing CRLF line break.\n     *\n     * @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.5\n     *\n     * @var int\n     */\n    const MAX_REPLY_LENGTH = 512;\n\n    /**\n     * Debug level for no output.\n     *\n     * @var int\n     */\n    const DEBUG_OFF = 0;\n\n    /**\n     * Debug level to show client -> server messages.\n     *\n     * @var int\n     */\n    const DEBUG_CLIENT = 1;\n\n    /**\n     * Debug level to show client -> server and server -> client messages.\n     *\n     * @var int\n     */\n    const DEBUG_SERVER = 2;\n\n    /**\n     * Debug level to show connection status, client -> server and server -> client messages.\n     *\n     * @var int\n     */\n    const DEBUG_CONNECTION = 3;\n\n    /**\n     * Debug level to show all messages.\n     *\n     * @var int\n     */\n    const DEBUG_LOWLEVEL = 4;\n\n    /**\n     * Debug output level.\n     * Options:\n     * * self::DEBUG_OFF (`0`) No debug output, default\n     * * self::DEBUG_CLIENT (`1`) Client commands\n     * * self::DEBUG_SERVER (`2`) Client commands and server responses\n     * * self::DEBUG_CONNECTION (`3`) As DEBUG_SERVER plus connection status\n     * * self::DEBUG_LOWLEVEL (`4`) Low-level data output, all messages.\n     *\n     * @var int\n     */\n    public $do_debug = self::DEBUG_OFF;\n\n    /**\n     * How to handle debug output.\n     * Options:\n     * * `echo` Output plain-text as-is, appropriate for CLI\n     * * `html` Output escaped, line breaks converted to `<br>`, appropriate for browser output\n     * * `error_log` Output to error log as configured in php.ini\n     * Alternatively, you can provide a callable expecting two params: a message string and the debug level:\n     *\n     * ```php\n     * $smtp->Debugoutput = function($str, $level) {echo \"debug level $level; message: $str\";};\n     * ```\n     *\n     * Alternatively, you can pass in an instance of a PSR-3 compatible logger, though only `debug`\n     * level output is used:\n     *\n     * ```php\n     * $mail->Debugoutput = new myPsr3Logger;\n     * ```\n     *\n     * @var string|callable|\\Psr\\Log\\LoggerInterface\n     */\n    public $Debugoutput = 'echo';\n\n    /**\n     * Whether to use VERP.\n     *\n     * @see http://en.wikipedia.org/wiki/Variable_envelope_return_path\n     * @see http://www.postfix.org/VERP_README.html Info on VERP\n     *\n     * @var bool\n     */\n    public $do_verp = false;\n\n    /**\n     * The timeout value for connection, in seconds.\n     * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2.\n     * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure.\n     *\n     * @see http://tools.ietf.org/html/rfc2821#section-4.5.3.2\n     *\n     * @var int\n     */\n    public $Timeout = 300;\n\n    /**\n     * How long to wait for commands to complete, in seconds.\n     * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2.\n     *\n     * @var int\n     */\n    public $Timelimit = 300;\n\n    /**\n     * Patterns to extract an SMTP transaction id from reply to a DATA command.\n     * The first capture group in each regex will be used as the ID.\n     * MS ESMTP returns the message ID, which may not be correct for internal tracking.\n     *\n     * @var string[]\n     */\n    protected $smtp_transaction_id_patterns = [\n        'exim' => '/[\\d]{3} OK id=(.*)/',\n        'sendmail' => '/[\\d]{3} 2.0.0 (.*) Message/',\n        'postfix' => '/[\\d]{3} 2.0.0 Ok: queued as (.*)/',\n        'Microsoft_ESMTP' => '/[0-9]{3} 2.[\\d].0 (.*)@(?:.*) Queued mail for delivery/',\n        'Amazon_SES' => '/[\\d]{3} Ok (.*)/',\n        'SendGrid' => '/[\\d]{3} Ok: queued as (.*)/',\n        'CampaignMonitor' => '/[\\d]{3} 2.0.0 OK:([a-zA-Z\\d]{48})/',\n    ];\n\n    /**\n     * The last transaction ID issued in response to a DATA command,\n     * if one was detected.\n     *\n     * @var string|bool|null\n     */\n    protected $last_smtp_transaction_id;\n\n    /**\n     * The socket for the server connection.\n     *\n     * @var ?resource\n     */\n    protected $smtp_conn;\n\n    /**\n     * Error information, if any, for the last SMTP command.\n     *\n     * @var array\n     */\n    protected $error = [\n        'error' => '',\n        'detail' => '',\n        'smtp_code' => '',\n        'smtp_code_ex' => '',\n    ];\n\n    /**\n     * The reply the server sent to us for HELO.\n     * If null, no HELO string has yet been received.\n     *\n     * @var string|null\n     */\n    protected $helo_rply;\n\n    /**\n     * The set of SMTP extensions sent in reply to EHLO command.\n     * Indexes of the array are extension names.\n     * Value at index 'HELO' or 'EHLO' (according to command that was sent)\n     * represents the server name. In case of HELO it is the only element of the array.\n     * Other values can be boolean TRUE or an array containing extension options.\n     * If null, no HELO/EHLO string has yet been received.\n     *\n     * @var array|null\n     */\n    protected $server_caps;\n\n    /**\n     * The most recent reply received from the server.\n     *\n     * @var string\n     */\n    protected $last_reply = '';\n\n    /**\n     * Output debugging info via a user-selected method.\n     *\n     * @param string $str   Debug string to output\n     * @param int    $level The debug level of this message; see DEBUG_* constants\n     *\n     * @see SMTP::$Debugoutput\n     * @see SMTP::$do_debug\n     */\n    protected function edebug($str, $level = 0)\n    {\n        if ($level > $this->do_debug) {\n            return;\n        }\n        //Is this a PSR-3 logger?\n        if ($this->Debugoutput instanceof \\Psr\\Log\\LoggerInterface) {\n            $this->Debugoutput->debug($str);\n\n            return;\n        }\n        //Avoid clash with built-in function names\n        if (is_callable($this->Debugoutput) && !in_array($this->Debugoutput, ['error_log', 'html', 'echo'])) {\n            call_user_func($this->Debugoutput, $str, $level);\n\n            return;\n        }\n        switch ($this->Debugoutput) {\n            case 'error_log':\n                //Don't output, just log\n                error_log($str);\n                break;\n            case 'html':\n                //Cleans up output a bit for a better looking, HTML-safe output\n                echo gmdate('Y-m-d H:i:s'), ' ', htmlentities(\n                    preg_replace('/[\\r\\n]+/', '', $str),\n                    ENT_QUOTES,\n                    'UTF-8'\n                ), \"<br>\\n\";\n                break;\n            case 'echo':\n            default:\n                //Normalize line breaks\n                $str = preg_replace('/\\r\\n|\\r/m', \"\\n\", $str);\n                echo gmdate('Y-m-d H:i:s'),\n                \"\\t\",\n                    //Trim trailing space\n                trim(\n                    //Indent for readability, except for trailing break\n                    str_replace(\n                        \"\\n\",\n                        \"\\n                   \\t                  \",\n                        trim($str)\n                    )\n                ),\n                \"\\n\";\n        }\n    }\n\n    /**\n     * Connect to an SMTP server.\n     *\n     * @param string $host    SMTP server IP or host name\n     * @param int    $port    The port number to connect to\n     * @param int    $timeout How long to wait for the connection to open\n     * @param array  $options An array of options for stream_context_create()\n     *\n     * @return bool\n     */\n    public function connect($host, $port = null, $timeout = 30, $options = [])\n    {\n        static $streamok;\n        //This is enabled by default since 5.0.0 but some providers disable it\n        //Check this once and cache the result\n        if (null === $streamok) {\n            $streamok = function_exists('stream_socket_client');\n        }\n        // Clear errors to avoid confusion\n        $this->setError('');\n        // Make sure we are __not__ connected\n        if ($this->connected()) {\n            // Already connected, generate error\n            $this->setError('Already connected to a server');\n\n            return false;\n        }\n        if (empty($port)) {\n            $port = self::DEFAULT_PORT;\n        }\n        // Connect to the SMTP server\n        $this->edebug(\n            \"Connection: opening to $host:$port, timeout=$timeout, options=\" .\n            (count($options) > 0 ? var_export($options, true) : 'array()'),\n            self::DEBUG_CONNECTION\n        );\n        $errno = 0;\n        $errstr = '';\n        if ($streamok) {\n            $socket_context = stream_context_create($options);\n            set_error_handler([$this, 'errorHandler']);\n            $this->smtp_conn = stream_socket_client(\n                $host . ':' . $port,\n                $errno,\n                $errstr,\n                $timeout,\n                STREAM_CLIENT_CONNECT,\n                $socket_context\n            );\n            restore_error_handler();\n        } else {\n            //Fall back to fsockopen which should work in more places, but is missing some features\n            $this->edebug(\n                'Connection: stream_socket_client not available, falling back to fsockopen',\n                self::DEBUG_CONNECTION\n            );\n            set_error_handler([$this, 'errorHandler']);\n            $this->smtp_conn = fsockopen(\n                $host,\n                $port,\n                $errno,\n                $errstr,\n                $timeout\n            );\n            restore_error_handler();\n        }\n        // Verify we connected properly\n        if (!is_resource($this->smtp_conn)) {\n            $this->setError(\n                'Failed to connect to server',\n                '',\n                (string) $errno,\n                $errstr\n            );\n            $this->edebug(\n                'SMTP ERROR: ' . $this->error['error']\n                . \": $errstr ($errno)\",\n                self::DEBUG_CLIENT\n            );\n\n            return false;\n        }\n        $this->edebug('Connection: opened', self::DEBUG_CONNECTION);\n        // SMTP server can take longer to respond, give longer timeout for first read\n        // Windows does not have support for this timeout function\n        if (strpos(PHP_OS, 'WIN') !== 0) {\n            $max = (int) ini_get('max_execution_time');\n            // Don't bother if unlimited\n            if (0 !== $max && $timeout > $max) {\n                @set_time_limit($timeout);\n            }\n            stream_set_timeout($this->smtp_conn, $timeout, 0);\n        }\n        // Get any announcement\n        $announce = $this->get_lines();\n        $this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER);\n\n        return true;\n    }\n\n    /**\n     * Initiate a TLS (encrypted) session.\n     *\n     * @return bool\n     */\n    public function startTLS()\n    {\n        if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {\n            return false;\n        }\n\n        //Allow the best TLS version(s) we can\n        $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;\n\n        //PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT\n        //so add them back in manually if we can\n        if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {\n            $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;\n            $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;\n        }\n\n        // Begin encrypted connection\n        set_error_handler([$this, 'errorHandler']);\n        $crypto_ok = stream_socket_enable_crypto(\n            $this->smtp_conn,\n            true,\n            $crypto_method\n        );\n        restore_error_handler();\n\n        return (bool) $crypto_ok;\n    }\n\n    /**\n     * Perform SMTP authentication.\n     * Must be run after hello().\n     *\n     * @see    hello()\n     *\n     * @param string $username The user name\n     * @param string $password The password\n     * @param string $authtype The auth type (CRAM-MD5, PLAIN, LOGIN, XOAUTH2)\n     * @param OAuth  $OAuth    An optional OAuth instance for XOAUTH2 authentication\n     *\n     * @return bool True if successfully authenticated\n     */\n    public function authenticate(\n        $username,\n        $password,\n        $authtype = null,\n        $OAuth = null\n    ) {\n        if (!$this->server_caps) {\n            $this->setError('Authentication is not allowed before HELO/EHLO');\n\n            return false;\n        }\n\n        if (array_key_exists('EHLO', $this->server_caps)) {\n            // SMTP extensions are available; try to find a proper authentication method\n            if (!array_key_exists('AUTH', $this->server_caps)) {\n                $this->setError('Authentication is not allowed at this stage');\n                // 'at this stage' means that auth may be allowed after the stage changes\n                // e.g. after STARTTLS\n\n                return false;\n            }\n\n            $this->edebug('Auth method requested: ' . ($authtype ?: 'UNSPECIFIED'), self::DEBUG_LOWLEVEL);\n            $this->edebug(\n                'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']),\n                self::DEBUG_LOWLEVEL\n            );\n\n            //If we have requested a specific auth type, check the server supports it before trying others\n            if (null !== $authtype && !in_array($authtype, $this->server_caps['AUTH'], true)) {\n                $this->edebug('Requested auth method not available: ' . $authtype, self::DEBUG_LOWLEVEL);\n                $authtype = null;\n            }\n\n            if (empty($authtype)) {\n                //If no auth mechanism is specified, attempt to use these, in this order\n                //Try CRAM-MD5 first as it's more secure than the others\n                foreach (['CRAM-MD5', 'LOGIN', 'PLAIN', 'XOAUTH2'] as $method) {\n                    if (in_array($method, $this->server_caps['AUTH'], true)) {\n                        $authtype = $method;\n                        break;\n                    }\n                }\n                if (empty($authtype)) {\n                    $this->setError('No supported authentication methods found');\n\n                    return false;\n                }\n                $this->edebug('Auth method selected: ' . $authtype, self::DEBUG_LOWLEVEL);\n            }\n\n            if (!in_array($authtype, $this->server_caps['AUTH'], true)) {\n                $this->setError(\"The requested authentication method \\\"$authtype\\\" is not supported by the server\");\n\n                return false;\n            }\n        } elseif (empty($authtype)) {\n            $authtype = 'LOGIN';\n        }\n        switch ($authtype) {\n            case 'PLAIN':\n                // Start authentication\n                if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) {\n                    return false;\n                }\n                // Send encoded username and password\n                if (!$this->sendCommand(\n                    'User & Password',\n                    base64_encode(\"\\0\" . $username . \"\\0\" . $password),\n                    235\n                )\n                ) {\n                    return false;\n                }\n                break;\n            case 'LOGIN':\n                // Start authentication\n                if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) {\n                    return false;\n                }\n                if (!$this->sendCommand('Username', base64_encode($username), 334)) {\n                    return false;\n                }\n                if (!$this->sendCommand('Password', base64_encode($password), 235)) {\n                    return false;\n                }\n                break;\n            case 'CRAM-MD5':\n                // Start authentication\n                if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) {\n                    return false;\n                }\n                // Get the challenge\n                $challenge = base64_decode(substr($this->last_reply, 4));\n\n                // Build the response\n                $response = $username . ' ' . $this->hmac($challenge, $password);\n\n                // send encoded credentials\n                return $this->sendCommand('Username', base64_encode($response), 235);\n            case 'XOAUTH2':\n                //The OAuth instance must be set up prior to requesting auth.\n                if (null === $OAuth) {\n                    return false;\n                }\n                $oauth = $OAuth->getOauth64();\n\n                // Start authentication\n                if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) {\n                    return false;\n                }\n                break;\n            default:\n                $this->setError(\"Authentication method \\\"$authtype\\\" is not supported\");\n\n                return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Calculate an MD5 HMAC hash.\n     * Works like hash_hmac('md5', $data, $key)\n     * in case that function is not available.\n     *\n     * @param string $data The data to hash\n     * @param string $key  The key to hash with\n     *\n     * @return string\n     */\n    protected function hmac($data, $key)\n    {\n        if (function_exists('hash_hmac')) {\n            return hash_hmac('md5', $data, $key);\n        }\n\n        // The following borrowed from\n        // http://php.net/manual/en/function.mhash.php#27225\n\n        // RFC 2104 HMAC implementation for php.\n        // Creates an md5 HMAC.\n        // Eliminates the need to install mhash to compute a HMAC\n        // by Lance Rushing\n\n        $bytelen = 64; // byte length for md5\n        if (strlen($key) > $bytelen) {\n            $key = pack('H*', md5($key));\n        }\n        $key = str_pad($key, $bytelen, chr(0x00));\n        $ipad = str_pad('', $bytelen, chr(0x36));\n        $opad = str_pad('', $bytelen, chr(0x5c));\n        $k_ipad = $key ^ $ipad;\n        $k_opad = $key ^ $opad;\n\n        return md5($k_opad . pack('H*', md5($k_ipad . $data)));\n    }\n\n    /**\n     * Check connection state.\n     *\n     * @return bool True if connected\n     */\n    public function connected()\n    {\n        if (is_resource($this->smtp_conn)) {\n            $sock_status = stream_get_meta_data($this->smtp_conn);\n            if ($sock_status['eof']) {\n                // The socket is valid but we are not connected\n                $this->edebug(\n                    'SMTP NOTICE: EOF caught while checking if connected',\n                    self::DEBUG_CLIENT\n                );\n                $this->close();\n\n                return false;\n            }\n\n            return true; // everything looks good\n        }\n\n        return false;\n    }\n\n    /**\n     * Close the socket and clean up the state of the class.\n     * Don't use this function without first trying to use QUIT.\n     *\n     * @see quit()\n     */\n    public function close()\n    {\n        $this->setError('');\n        $this->server_caps = null;\n        $this->helo_rply = null;\n        if (is_resource($this->smtp_conn)) {\n            // close the connection and cleanup\n            fclose($this->smtp_conn);\n            $this->smtp_conn = null; //Makes for cleaner serialization\n            $this->edebug('Connection: closed', self::DEBUG_CONNECTION);\n        }\n    }\n\n    /**\n     * Send an SMTP DATA command.\n     * Issues a data command and sends the msg_data to the server,\n     * finializing the mail transaction. $msg_data is the message\n     * that is to be send with the headers. Each header needs to be\n     * on a single line followed by a <CRLF> with the message headers\n     * and the message body being separated by an additional <CRLF>.\n     * Implements RFC 821: DATA <CRLF>.\n     *\n     * @param string $msg_data Message data to send\n     *\n     * @return bool\n     */\n    public function data($msg_data)\n    {\n        //This will use the standard timelimit\n        if (!$this->sendCommand('DATA', 'DATA', 354)) {\n            return false;\n        }\n\n        /* The server is ready to accept data!\n         * According to rfc821 we should not send more than 1000 characters on a single line (including the LE)\n         * so we will break the data up into lines by \\r and/or \\n then if needed we will break each of those into\n         * smaller lines to fit within the limit.\n         * We will also look for lines that start with a '.' and prepend an additional '.'.\n         * NOTE: this does not count towards line-length limit.\n         */\n\n        // Normalize line breaks before exploding\n        $lines = explode(\"\\n\", str_replace([\"\\r\\n\", \"\\r\"], \"\\n\", $msg_data));\n\n        /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field\n         * of the first line (':' separated) does not contain a space then it _should_ be a header and we will\n         * process all lines before a blank line as headers.\n         */\n\n        $field = substr($lines[0], 0, strpos($lines[0], ':'));\n        $in_headers = false;\n        if (!empty($field) && strpos($field, ' ') === false) {\n            $in_headers = true;\n        }\n\n        foreach ($lines as $line) {\n            $lines_out = [];\n            if ($in_headers && $line === '') {\n                $in_headers = false;\n            }\n            //Break this line up into several smaller lines if it's too long\n            //Micro-optimisation: isset($str[$len]) is faster than (strlen($str) > $len),\n            while (isset($line[self::MAX_LINE_LENGTH])) {\n                //Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on\n                //so as to avoid breaking in the middle of a word\n                $pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' ');\n                //Deliberately matches both false and 0\n                if (!$pos) {\n                    //No nice break found, add a hard break\n                    $pos = self::MAX_LINE_LENGTH - 1;\n                    $lines_out[] = substr($line, 0, $pos);\n                    $line = substr($line, $pos);\n                } else {\n                    //Break at the found point\n                    $lines_out[] = substr($line, 0, $pos);\n                    //Move along by the amount we dealt with\n                    $line = substr($line, $pos + 1);\n                }\n                //If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1\n                if ($in_headers) {\n                    $line = \"\\t\" . $line;\n                }\n            }\n            $lines_out[] = $line;\n\n            //Send the lines to the server\n            foreach ($lines_out as $line_out) {\n                //RFC2821 section 4.5.2\n                if (!empty($line_out) && $line_out[0] === '.') {\n                    $line_out = '.' . $line_out;\n                }\n                $this->client_send($line_out . static::LE, 'DATA');\n            }\n        }\n\n        //Message data has been sent, complete the command\n        //Increase timelimit for end of DATA command\n        $savetimelimit = $this->Timelimit;\n        $this->Timelimit *= 2;\n        $result = $this->sendCommand('DATA END', '.', 250);\n        $this->recordLastTransactionID();\n        //Restore timelimit\n        $this->Timelimit = $savetimelimit;\n\n        return $result;\n    }\n\n    /**\n     * Send an SMTP HELO or EHLO command.\n     * Used to identify the sending server to the receiving server.\n     * This makes sure that client and server are in a known state.\n     * Implements RFC 821: HELO <SP> <domain> <CRLF>\n     * and RFC 2821 EHLO.\n     *\n     * @param string $host The host name or IP to connect to\n     *\n     * @return bool\n     */\n    public function hello($host = '')\n    {\n        //Try extended hello first (RFC 2821)\n        return $this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host);\n    }\n\n    /**\n     * Send an SMTP HELO or EHLO command.\n     * Low-level implementation used by hello().\n     *\n     * @param string $hello The HELO string\n     * @param string $host  The hostname to say we are\n     *\n     * @return bool\n     *\n     * @see hello()\n     */\n    protected function sendHello($hello, $host)\n    {\n        $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250);\n        $this->helo_rply = $this->last_reply;\n        if ($noerror) {\n            $this->parseHelloFields($hello);\n        } else {\n            $this->server_caps = null;\n        }\n\n        return $noerror;\n    }\n\n    /**\n     * Parse a reply to HELO/EHLO command to discover server extensions.\n     * In case of HELO, the only parameter that can be discovered is a server name.\n     *\n     * @param string $type `HELO` or `EHLO`\n     */\n    protected function parseHelloFields($type)\n    {\n        $this->server_caps = [];\n        $lines = explode(\"\\n\", $this->helo_rply);\n\n        foreach ($lines as $n => $s) {\n            //First 4 chars contain response code followed by - or space\n            $s = trim(substr($s, 4));\n            if (empty($s)) {\n                continue;\n            }\n            $fields = explode(' ', $s);\n            if (!empty($fields)) {\n                if (!$n) {\n                    $name = $type;\n                    $fields = $fields[0];\n                } else {\n                    $name = array_shift($fields);\n                    switch ($name) {\n                        case 'SIZE':\n                            $fields = ($fields ? $fields[0] : 0);\n                            break;\n                        case 'AUTH':\n                            if (!is_array($fields)) {\n                                $fields = [];\n                            }\n                            break;\n                        default:\n                            $fields = true;\n                    }\n                }\n                $this->server_caps[$name] = $fields;\n            }\n        }\n    }\n\n    /**\n     * Send an SMTP MAIL command.\n     * Starts a mail transaction from the email address specified in\n     * $from. Returns true if successful or false otherwise. If True\n     * the mail transaction is started and then one or more recipient\n     * commands may be called followed by a data command.\n     * Implements RFC 821: MAIL <SP> FROM:<reverse-path> <CRLF>.\n     *\n     * @param string $from Source address of this message\n     *\n     * @return bool\n     */\n    public function mail($from)\n    {\n        $useVerp = ($this->do_verp ? ' XVERP' : '');\n\n        return $this->sendCommand(\n            'MAIL FROM',\n            'MAIL FROM:<' . $from . '>' . $useVerp,\n            250\n        );\n    }\n\n    /**\n     * Send an SMTP QUIT command.\n     * Closes the socket if there is no error or the $close_on_error argument is true.\n     * Implements from RFC 821: QUIT <CRLF>.\n     *\n     * @param bool $close_on_error Should the connection close if an error occurs?\n     *\n     * @return bool\n     */\n    public function quit($close_on_error = true)\n    {\n        $noerror = $this->sendCommand('QUIT', 'QUIT', 221);\n        $err = $this->error; //Save any error\n        if ($noerror || $close_on_error) {\n            $this->close();\n            $this->error = $err; //Restore any error from the quit command\n        }\n\n        return $noerror;\n    }\n\n    /**\n     * Send an SMTP RCPT command.\n     * Sets the TO argument to $toaddr.\n     * Returns true if the recipient was accepted false if it was rejected.\n     * Implements from RFC 821: RCPT <SP> TO:<forward-path> <CRLF>.\n     *\n     * @param string $address The address the message is being sent to\n     * @param string $dsn     Comma separated list of DSN notifications. NEVER, SUCCESS, FAILURE\n     *                        or DELAY. If you specify NEVER all other notifications are ignored.\n     *\n     * @return bool\n     */\n    public function recipient($address, $dsn = '')\n    {\n        if (empty($dsn)) {\n            $rcpt = 'RCPT TO:<' . $address . '>';\n        } else {\n            $dsn = strtoupper($dsn);\n            $notify = [];\n\n            if (strpos($dsn, 'NEVER') !== false) {\n                $notify[] = 'NEVER';\n            } else {\n                foreach (['SUCCESS', 'FAILURE', 'DELAY'] as $value) {\n                    if (strpos($dsn, $value) !== false) {\n                        $notify[] = $value;\n                    }\n                }\n            }\n\n            $rcpt = 'RCPT TO:<' . $address . '> NOTIFY=' . implode(',', $notify);\n        }\n\n        return $this->sendCommand(\n            'RCPT TO',\n            $rcpt,\n            [250, 251]\n        );\n    }\n\n    /**\n     * Send an SMTP RSET command.\n     * Abort any transaction that is currently in progress.\n     * Implements RFC 821: RSET <CRLF>.\n     *\n     * @return bool True on success\n     */\n    public function reset()\n    {\n        return $this->sendCommand('RSET', 'RSET', 250);\n    }\n\n    /**\n     * Send a command to an SMTP server and check its return code.\n     *\n     * @param string    $command       The command name - not sent to the server\n     * @param string    $commandstring The actual command to send\n     * @param int|array $expect        One or more expected integer success codes\n     *\n     * @return bool True on success\n     */\n    protected function sendCommand($command, $commandstring, $expect)\n    {\n        if (!$this->connected()) {\n            $this->setError(\"Called $command without being connected\");\n\n            return false;\n        }\n        //Reject line breaks in all commands\n        if ((strpos($commandstring, \"\\n\") !== false) || (strpos($commandstring, \"\\r\") !== false)) {\n            $this->setError(\"Command '$command' contained line breaks\");\n\n            return false;\n        }\n        $this->client_send($commandstring . static::LE, $command);\n\n        $this->last_reply = $this->get_lines();\n        // Fetch SMTP code and possible error code explanation\n        $matches = [];\n        if (preg_match('/^([\\d]{3})[ -](?:([\\d]\\\\.[\\d]\\\\.[\\d]{1,2}) )?/', $this->last_reply, $matches)) {\n            $code = (int) $matches[1];\n            $code_ex = (count($matches) > 2 ? $matches[2] : null);\n            // Cut off error code from each response line\n            $detail = preg_replace(\n                \"/{$code}[ -]\" .\n                ($code_ex ? str_replace('.', '\\\\.', $code_ex) . ' ' : '') . '/m',\n                '',\n                $this->last_reply\n            );\n        } else {\n            // Fall back to simple parsing if regex fails\n            $code = (int) substr($this->last_reply, 0, 3);\n            $code_ex = null;\n            $detail = substr($this->last_reply, 4);\n        }\n\n        $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER);\n\n        if (!in_array($code, (array) $expect, true)) {\n            $this->setError(\n                \"$command command failed\",\n                $detail,\n                $code,\n                $code_ex\n            );\n            $this->edebug(\n                'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply,\n                self::DEBUG_CLIENT\n            );\n\n            return false;\n        }\n\n        $this->setError('');\n\n        return true;\n    }\n\n    /**\n     * Send an SMTP SAML command.\n     * Starts a mail transaction from the email address specified in $from.\n     * Returns true if successful or false otherwise. If True\n     * the mail transaction is started and then one or more recipient\n     * commands may be called followed by a data command. This command\n     * will send the message to the users terminal if they are logged\n     * in and send them an email.\n     * Implements RFC 821: SAML <SP> FROM:<reverse-path> <CRLF>.\n     *\n     * @param string $from The address the message is from\n     *\n     * @return bool\n     */\n    public function sendAndMail($from)\n    {\n        return $this->sendCommand('SAML', \"SAML FROM:$from\", 250);\n    }\n\n    /**\n     * Send an SMTP VRFY command.\n     *\n     * @param string $name The name to verify\n     *\n     * @return bool\n     */\n    public function verify($name)\n    {\n        return $this->sendCommand('VRFY', \"VRFY $name\", [250, 251]);\n    }\n\n    /**\n     * Send an SMTP NOOP command.\n     * Used to keep keep-alives alive, doesn't actually do anything.\n     *\n     * @return bool\n     */\n    public function noop()\n    {\n        return $this->sendCommand('NOOP', 'NOOP', 250);\n    }\n\n    /**\n     * Send an SMTP TURN command.\n     * This is an optional command for SMTP that this class does not support.\n     * This method is here to make the RFC821 Definition complete for this class\n     * and _may_ be implemented in future.\n     * Implements from RFC 821: TURN <CRLF>.\n     *\n     * @return bool\n     */\n    public function turn()\n    {\n        $this->setError('The SMTP TURN command is not implemented');\n        $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT);\n\n        return false;\n    }\n\n    /**\n     * Send raw data to the server.\n     *\n     * @param string $data    The data to send\n     * @param string $command Optionally, the command this is part of, used only for controlling debug output\n     *\n     * @return int|bool The number of bytes sent to the server or false on error\n     */\n    public function client_send($data, $command = '')\n    {\n        //If SMTP transcripts are left enabled, or debug output is posted online\n        //it can leak credentials, so hide credentials in all but lowest level\n        if (self::DEBUG_LOWLEVEL > $this->do_debug &&\n            in_array($command, ['User & Password', 'Username', 'Password'], true)) {\n            $this->edebug('CLIENT -> SERVER: [credentials hidden]', self::DEBUG_CLIENT);\n        } else {\n            $this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT);\n        }\n        set_error_handler([$this, 'errorHandler']);\n        $result = fwrite($this->smtp_conn, $data);\n        restore_error_handler();\n\n        return $result;\n    }\n\n    /**\n     * Get the latest error.\n     *\n     * @return array\n     */\n    public function getError()\n    {\n        return $this->error;\n    }\n\n    /**\n     * Get SMTP extensions available on the server.\n     *\n     * @return array|null\n     */\n    public function getServerExtList()\n    {\n        return $this->server_caps;\n    }\n\n    /**\n     * Get metadata about the SMTP server from its HELO/EHLO response.\n     * The method works in three ways, dependent on argument value and current state:\n     *   1. HELO/EHLO has not been sent - returns null and populates $this->error.\n     *   2. HELO has been sent -\n     *     $name == 'HELO': returns server name\n     *     $name == 'EHLO': returns boolean false\n     *     $name == any other string: returns null and populates $this->error\n     *   3. EHLO has been sent -\n     *     $name == 'HELO'|'EHLO': returns the server name\n     *     $name == any other string: if extension $name exists, returns True\n     *       or its options (e.g. AUTH mechanisms supported). Otherwise returns False.\n     *\n     * @param string $name Name of SMTP extension or 'HELO'|'EHLO'\n     *\n     * @return string|bool|null\n     */\n    public function getServerExt($name)\n    {\n        if (!$this->server_caps) {\n            $this->setError('No HELO/EHLO was sent');\n\n            return;\n        }\n\n        if (!array_key_exists($name, $this->server_caps)) {\n            if ('HELO' === $name) {\n                return $this->server_caps['EHLO'];\n            }\n            if ('EHLO' === $name || array_key_exists('EHLO', $this->server_caps)) {\n                return false;\n            }\n            $this->setError('HELO handshake was used; No information about server extensions available');\n\n            return;\n        }\n\n        return $this->server_caps[$name];\n    }\n\n    /**\n     * Get the last reply from the server.\n     *\n     * @return string\n     */\n    public function getLastReply()\n    {\n        return $this->last_reply;\n    }\n\n    /**\n     * Read the SMTP server's response.\n     * Either before eof or socket timeout occurs on the operation.\n     * With SMTP we can tell if we have more lines to read if the\n     * 4th character is '-' symbol. If it is a space then we don't\n     * need to read anything else.\n     *\n     * @return string\n     */\n    protected function get_lines()\n    {\n        // If the connection is bad, give up straight away\n        if (!is_resource($this->smtp_conn)) {\n            return '';\n        }\n        $data = '';\n        $endtime = 0;\n        stream_set_timeout($this->smtp_conn, $this->Timeout);\n        if ($this->Timelimit > 0) {\n            $endtime = time() + $this->Timelimit;\n        }\n        $selR = [$this->smtp_conn];\n        $selW = null;\n        while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) {\n            //Must pass vars in here as params are by reference\n            if (!stream_select($selR, $selW, $selW, $this->Timelimit)) {\n                $this->edebug(\n                    'SMTP -> get_lines(): select timed-out in (' . $this->Timelimit . ' sec)',\n                    self::DEBUG_LOWLEVEL\n                );\n                break;\n            }\n            //Deliberate noise suppression - errors are handled afterwards\n            $str = @fgets($this->smtp_conn, self::MAX_REPLY_LENGTH);\n            $this->edebug('SMTP INBOUND: \"' . trim($str) . '\"', self::DEBUG_LOWLEVEL);\n            $data .= $str;\n            // If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled),\n            // or 4th character is a space or a line break char, we are done reading, break the loop.\n            // String array access is a significant micro-optimisation over strlen\n            if (!isset($str[3]) || $str[3] === ' ' || $str[3] === \"\\r\" || $str[3] === \"\\n\") {\n                break;\n            }\n            // Timed-out? Log and break\n            $info = stream_get_meta_data($this->smtp_conn);\n            if ($info['timed_out']) {\n                $this->edebug(\n                    'SMTP -> get_lines(): stream timed-out (' . $this->Timeout . ' sec)',\n                    self::DEBUG_LOWLEVEL\n                );\n                break;\n            }\n            // Now check if reads took too long\n            if ($endtime && time() > $endtime) {\n                $this->edebug(\n                    'SMTP -> get_lines(): timelimit reached (' .\n                    $this->Timelimit . ' sec)',\n                    self::DEBUG_LOWLEVEL\n                );\n                break;\n            }\n        }\n\n        return $data;\n    }\n\n    /**\n     * Enable or disable VERP address generation.\n     *\n     * @param bool $enabled\n     */\n    public function setVerp($enabled = false)\n    {\n        $this->do_verp = $enabled;\n    }\n\n    /**\n     * Get VERP address generation mode.\n     *\n     * @return bool\n     */\n    public function getVerp()\n    {\n        return $this->do_verp;\n    }\n\n    /**\n     * Set error messages and codes.\n     *\n     * @param string $message      The error message\n     * @param string $detail       Further detail on the error\n     * @param string $smtp_code    An associated SMTP error code\n     * @param string $smtp_code_ex Extended SMTP code\n     */\n    protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '')\n    {\n        $this->error = [\n            'error' => $message,\n            'detail' => $detail,\n            'smtp_code' => $smtp_code,\n            'smtp_code_ex' => $smtp_code_ex,\n        ];\n    }\n\n    /**\n     * Set debug output method.\n     *\n     * @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it\n     */\n    public function setDebugOutput($method = 'echo')\n    {\n        $this->Debugoutput = $method;\n    }\n\n    /**\n     * Get debug output method.\n     *\n     * @return string\n     */\n    public function getDebugOutput()\n    {\n        return $this->Debugoutput;\n    }\n\n    /**\n     * Set debug output level.\n     *\n     * @param int $level\n     */\n    public function setDebugLevel($level = 0)\n    {\n        $this->do_debug = $level;\n    }\n\n    /**\n     * Get debug output level.\n     *\n     * @return int\n     */\n    public function getDebugLevel()\n    {\n        return $this->do_debug;\n    }\n\n    /**\n     * Set SMTP timeout.\n     *\n     * @param int $timeout The timeout duration in seconds\n     */\n    public function setTimeout($timeout = 0)\n    {\n        $this->Timeout = $timeout;\n    }\n\n    /**\n     * Get SMTP timeout.\n     *\n     * @return int\n     */\n    public function getTimeout()\n    {\n        return $this->Timeout;\n    }\n\n    /**\n     * Reports an error number and string.\n     *\n     * @param int    $errno   The error number returned by PHP\n     * @param string $errmsg  The error message returned by PHP\n     * @param string $errfile The file the error occurred in\n     * @param int    $errline The line number the error occurred on\n     */\n    protected function errorHandler($errno, $errmsg, $errfile = '', $errline = 0)\n    {\n        $notice = 'Connection failed.';\n        $this->setError(\n            $notice,\n            $errmsg,\n            (string) $errno\n        );\n        $this->edebug(\n            \"$notice Error #$errno: $errmsg [$errfile line $errline]\",\n            self::DEBUG_CONNECTION\n        );\n    }\n\n    /**\n     * Extract and return the ID of the last SMTP transaction based on\n     * a list of patterns provided in SMTP::$smtp_transaction_id_patterns.\n     * Relies on the host providing the ID in response to a DATA command.\n     * If no reply has been received yet, it will return null.\n     * If no pattern was matched, it will return false.\n     *\n     * @return bool|string|null\n     */\n    protected function recordLastTransactionID()\n    {\n        $reply = $this->getLastReply();\n\n        if (empty($reply)) {\n            $this->last_smtp_transaction_id = null;\n        } else {\n            $this->last_smtp_transaction_id = false;\n            foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) {\n                $matches = [];\n                if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) {\n                    $this->last_smtp_transaction_id = trim($matches[1]);\n                    break;\n                }\n            }\n        }\n\n        return $this->last_smtp_transaction_id;\n    }\n\n    /**\n     * Get the queue/transaction ID of the last SMTP transaction\n     * If no reply has been received yet, it will return null.\n     * If no pattern was matched, it will return false.\n     *\n     * @return bool|string|null\n     *\n     * @see recordLastTransactionID()\n     */\n    public function getLastTransactionID()\n    {\n        return $this->last_smtp_transaction_id;\n    }\n}\n", "num_lines": 1372}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Contains Translation_Entry class\n *\n * @version $Id: entry.php 1157 2015-11-20 04:30:11Z dd32 $\n * @package pomo\n * @subpackage entry\n */\n\nif ( ! class_exists( 'Translation_Entry', false ) ) :\n\t/**\n\t * Translation_Entry class encapsulates a translatable string\n\t */\n\tclass Translation_Entry {\n\n\t\t/**\n\t\t * Whether the entry contains a string and its plural form, default is false\n\t\t *\n\t\t * @var boolean\n\t\t */\n\t\tvar $is_plural = false;\n\n\t\tvar $context             = null;\n\t\tvar $singular            = null;\n\t\tvar $plural              = null;\n\t\tvar $translations        = array();\n\t\tvar $translator_comments = '';\n\t\tvar $extracted_comments  = '';\n\t\tvar $references          = array();\n\t\tvar $flags               = array();\n\n\t\t/**\n\t\t * @param array $args associative array, support following keys:\n\t\t *  - singular (string) -- the string to translate, if omitted and empty entry will be created\n\t\t *  - plural (string) -- the plural form of the string, setting this will set {@link $is_plural} to true\n\t\t *  - translations (array) -- translations of the string and possibly -- its plural forms\n\t\t *  - context (string) -- a string differentiating two equal strings used in different contexts\n\t\t *  - translator_comments (string) -- comments left by translators\n\t\t *  - extracted_comments (string) -- comments left by developers\n\t\t *  - references (array) -- places in the code this strings is used, in relative_to_root_path/file.php:linenum form\n\t\t *  - flags (array) -- flags like php-format\n\t\t */\n\t\tfunction __construct( $args = array() ) {\n\t\t\t// If no singular -- empty object.\n\t\t\tif ( ! isset( $args['singular'] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Get member variable values from args hash.\n\t\t\tforeach ( $args as $varname => $value ) {\n\t\t\t\t$this->$varname = $value;\n\t\t\t}\n\t\t\tif ( isset( $args['plural'] ) && $args['plural'] ) {\n\t\t\t\t$this->is_plural = true;\n\t\t\t}\n\t\t\tif ( ! is_array( $this->translations ) ) {\n\t\t\t\t$this->translations = array();\n\t\t\t}\n\t\t\tif ( ! is_array( $this->references ) ) {\n\t\t\t\t$this->references = array();\n\t\t\t}\n\t\t\tif ( ! is_array( $this->flags ) ) {\n\t\t\t\t$this->flags = array();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * PHP4 constructor.\n\t\t *\n\t\t * @deprecated 5.4.0 Use __construct() instead.\n\t\t *\n\t\t * @see Translation_Entry::__construct()\n\t\t */\n\t\tpublic function Translation_Entry( $args = array() ) {\n\t\t\t_deprecated_constructor( self::class, '5.4.0', static::class );\n\t\t\tself::__construct( $args );\n\t\t}\n\n\t\t/**\n\t\t * Generates a unique key for this entry\n\t\t *\n\t\t * @return string|bool the key or false if the entry is empty\n\t\t */\n\t\tfunction key() {\n\t\t\tif ( null === $this->singular || '' === $this->singular ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Prepend context and EOT, like in MO files.\n\t\t\t$key = ! $this->context ? $this->singular : $this->context . \"\\4\" . $this->singular;\n\t\t\t// Standardize on \\n line endings.\n\t\t\t$key = str_replace( array( \"\\r\\n\", \"\\r\" ), \"\\n\", $key );\n\n\t\t\treturn $key;\n\t\t}\n\n\t\t/**\n\t\t * @param object $other\n\t\t */\n\t\tfunction merge_with( &$other ) {\n\t\t\t$this->flags      = array_unique( array_merge( $this->flags, $other->flags ) );\n\t\t\t$this->references = array_unique( array_merge( $this->references, $other->references ) );\n\t\t\tif ( $this->extracted_comments != $other->extracted_comments ) {\n\t\t\t\t$this->extracted_comments .= $other->extracted_comments;\n\t\t\t}\n\n\t\t}\n\t}\nendif;\n", "num_lines": 109}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Class for working with MO files\n *\n * @version $Id: mo.php 1157 2015-11-20 04:30:11Z dd32 $\n * @package pomo\n * @subpackage mo\n */\n\nrequire_once __DIR__ . '/translations.php';\nrequire_once __DIR__ . '/streams.php';\n\nif ( ! class_exists( 'MO', false ) ) :\n\tclass MO extends Gettext_Translations {\n\n\t\tvar $_nplurals = 2;\n\n\t\t/**\n\t\t * Loaded MO file.\n\t\t *\n\t\t * @var string\n\t\t */\n\t\tprivate $filename = '';\n\n\t\t/**\n\t\t * Returns the loaded MO file.\n\t\t *\n\t\t * @return string The loaded MO file.\n\t\t */\n\t\tpublic function get_filename() {\n\t\t\treturn $this->filename;\n\t\t}\n\n\t\t/**\n\t\t * Fills up with the entries from MO file $filename\n\t\t *\n\t\t * @param string $filename MO file to load\n\t\t * @return bool True if the import from file was successful, otherwise false.\n\t\t */\n\t\tfunction import_from_file( $filename ) {\n\t\t\t$reader = new POMO_FileReader( $filename );\n\n\t\t\tif ( ! $reader->is_resource() ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$this->filename = (string) $filename;\n\n\t\t\treturn $this->import_from_reader( $reader );\n\t\t}\n\n\t\t/**\n\t\t * @param string $filename\n\t\t * @return bool\n\t\t */\n\t\tfunction export_to_file( $filename ) {\n\t\t\t$fh = fopen( $filename, 'wb' );\n\t\t\tif ( ! $fh ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$res = $this->export_to_file_handle( $fh );\n\t\t\tfclose( $fh );\n\t\t\treturn $res;\n\t\t}\n\n\t\t/**\n\t\t * @return string|false\n\t\t */\n\t\tfunction export() {\n\t\t\t$tmp_fh = fopen( 'php://temp', 'r+' );\n\t\t\tif ( ! $tmp_fh ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$this->export_to_file_handle( $tmp_fh );\n\t\t\trewind( $tmp_fh );\n\t\t\treturn stream_get_contents( $tmp_fh );\n\t\t}\n\n\t\t/**\n\t\t * @param Translation_Entry $entry\n\t\t * @return bool\n\t\t */\n\t\tfunction is_entry_good_for_export( $entry ) {\n\t\t\tif ( empty( $entry->translations ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ( ! array_filter( $entry->translations ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * @param resource $fh\n\t\t * @return true\n\t\t */\n\t\tfunction export_to_file_handle( $fh ) {\n\t\t\t$entries = array_filter( $this->entries, array( $this, 'is_entry_good_for_export' ) );\n\t\t\tksort( $entries );\n\t\t\t$magic                     = 0x950412de;\n\t\t\t$revision                  = 0;\n\t\t\t$total                     = count( $entries ) + 1; // All the headers are one entry.\n\t\t\t$originals_lenghts_addr    = 28;\n\t\t\t$translations_lenghts_addr = $originals_lenghts_addr + 8 * $total;\n\t\t\t$size_of_hash              = 0;\n\t\t\t$hash_addr                 = $translations_lenghts_addr + 8 * $total;\n\t\t\t$current_addr              = $hash_addr;\n\t\t\tfwrite(\n\t\t\t\t$fh,\n\t\t\t\tpack(\n\t\t\t\t\t'V*',\n\t\t\t\t\t$magic,\n\t\t\t\t\t$revision,\n\t\t\t\t\t$total,\n\t\t\t\t\t$originals_lenghts_addr,\n\t\t\t\t\t$translations_lenghts_addr,\n\t\t\t\t\t$size_of_hash,\n\t\t\t\t\t$hash_addr\n\t\t\t\t)\n\t\t\t);\n\t\t\tfseek( $fh, $originals_lenghts_addr );\n\n\t\t\t// Headers' msgid is an empty string.\n\t\t\tfwrite( $fh, pack( 'VV', 0, $current_addr ) );\n\t\t\t$current_addr++;\n\t\t\t$originals_table = \"\\0\";\n\n\t\t\t$reader = new POMO_Reader();\n\n\t\t\tforeach ( $entries as $entry ) {\n\t\t\t\t$originals_table .= $this->export_original( $entry ) . \"\\0\";\n\t\t\t\t$length           = $reader->strlen( $this->export_original( $entry ) );\n\t\t\t\tfwrite( $fh, pack( 'VV', $length, $current_addr ) );\n\t\t\t\t$current_addr += $length + 1; // Account for the NULL byte after.\n\t\t\t}\n\n\t\t\t$exported_headers = $this->export_headers();\n\t\t\tfwrite( $fh, pack( 'VV', $reader->strlen( $exported_headers ), $current_addr ) );\n\t\t\t$current_addr      += strlen( $exported_headers ) + 1;\n\t\t\t$translations_table = $exported_headers . \"\\0\";\n\n\t\t\tforeach ( $entries as $entry ) {\n\t\t\t\t$translations_table .= $this->export_translations( $entry ) . \"\\0\";\n\t\t\t\t$length              = $reader->strlen( $this->export_translations( $entry ) );\n\t\t\t\tfwrite( $fh, pack( 'VV', $length, $current_addr ) );\n\t\t\t\t$current_addr += $length + 1;\n\t\t\t}\n\n\t\t\tfwrite( $fh, $originals_table );\n\t\t\tfwrite( $fh, $translations_table );\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * @param Translation_Entry $entry\n\t\t * @return string\n\t\t */\n\t\tfunction export_original( $entry ) {\n\t\t\t// TODO: Warnings for control characters.\n\t\t\t$exported = $entry->singular;\n\t\t\tif ( $entry->is_plural ) {\n\t\t\t\t$exported .= \"\\0\" . $entry->plural;\n\t\t\t}\n\t\t\tif ( $entry->context ) {\n\t\t\t\t$exported = $entry->context . \"\\4\" . $exported;\n\t\t\t}\n\t\t\treturn $exported;\n\t\t}\n\n\t\t/**\n\t\t * @param Translation_Entry $entry\n\t\t * @return string\n\t\t */\n\t\tfunction export_translations( $entry ) {\n\t\t\t// TODO: Warnings for control characters.\n\t\t\treturn $entry->is_plural ? implode( \"\\0\", $entry->translations ) : $entry->translations[0];\n\t\t}\n\n\t\t/**\n\t\t * @return string\n\t\t */\n\t\tfunction export_headers() {\n\t\t\t$exported = '';\n\t\t\tforeach ( $this->headers as $header => $value ) {\n\t\t\t\t$exported .= \"$header: $value\\n\";\n\t\t\t}\n\t\t\treturn $exported;\n\t\t}\n\n\t\t/**\n\t\t * @param int $magic\n\t\t * @return string|false\n\t\t */\n\t\tfunction get_byteorder( $magic ) {\n\t\t\t// The magic is 0x950412de.\n\n\t\t\t// bug in PHP 5.0.2, see https://savannah.nongnu.org/bugs/?func=detailitem&item_id=10565\n\t\t\t$magic_little    = (int) - 1794895138;\n\t\t\t$magic_little_64 = (int) 2500072158;\n\t\t\t// 0xde120495\n\t\t\t$magic_big = ( (int) - 569244523 ) & 0xFFFFFFFF;\n\t\t\tif ( $magic_little == $magic || $magic_little_64 == $magic ) {\n\t\t\t\treturn 'little';\n\t\t\t} elseif ( $magic_big == $magic ) {\n\t\t\t\treturn 'big';\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @param POMO_FileReader $reader\n\t\t * @return bool True if the import was successful, otherwise false.\n\t\t */\n\t\tfunction import_from_reader( $reader ) {\n\t\t\t$endian_string = MO::get_byteorder( $reader->readint32() );\n\t\t\tif ( false === $endian_string ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$reader->setEndian( $endian_string );\n\n\t\t\t$endian = ( 'big' === $endian_string ) ? 'N' : 'V';\n\n\t\t\t$header = $reader->read( 24 );\n\t\t\tif ( $reader->strlen( $header ) != 24 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Parse header.\n\t\t\t$header = unpack( \"{$endian}revision/{$endian}total/{$endian}originals_lenghts_addr/{$endian}translations_lenghts_addr/{$endian}hash_length/{$endian}hash_addr\", $header );\n\t\t\tif ( ! is_array( $header ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Support revision 0 of MO format specs, only.\n\t\t\tif ( 0 != $header['revision'] ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Seek to data blocks.\n\t\t\t$reader->seekto( $header['originals_lenghts_addr'] );\n\n\t\t\t// Read originals' indices.\n\t\t\t$originals_lengths_length = $header['translations_lenghts_addr'] - $header['originals_lenghts_addr'];\n\t\t\tif ( $originals_lengths_length != $header['total'] * 8 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$originals = $reader->read( $originals_lengths_length );\n\t\t\tif ( $reader->strlen( $originals ) != $originals_lengths_length ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Read translations' indices.\n\t\t\t$translations_lenghts_length = $header['hash_addr'] - $header['translations_lenghts_addr'];\n\t\t\tif ( $translations_lenghts_length != $header['total'] * 8 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$translations = $reader->read( $translations_lenghts_length );\n\t\t\tif ( $reader->strlen( $translations ) != $translations_lenghts_length ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Transform raw data into set of indices.\n\t\t\t$originals    = $reader->str_split( $originals, 8 );\n\t\t\t$translations = $reader->str_split( $translations, 8 );\n\n\t\t\t// Skip hash table.\n\t\t\t$strings_addr = $header['hash_addr'] + $header['hash_length'] * 4;\n\n\t\t\t$reader->seekto( $strings_addr );\n\n\t\t\t$strings = $reader->read_all();\n\t\t\t$reader->close();\n\n\t\t\tfor ( $i = 0; $i < $header['total']; $i++ ) {\n\t\t\t\t$o = unpack( \"{$endian}length/{$endian}pos\", $originals[ $i ] );\n\t\t\t\t$t = unpack( \"{$endian}length/{$endian}pos\", $translations[ $i ] );\n\t\t\t\tif ( ! $o || ! $t ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Adjust offset due to reading strings to separate space before.\n\t\t\t\t$o['pos'] -= $strings_addr;\n\t\t\t\t$t['pos'] -= $strings_addr;\n\n\t\t\t\t$original    = $reader->substr( $strings, $o['pos'], $o['length'] );\n\t\t\t\t$translation = $reader->substr( $strings, $t['pos'], $t['length'] );\n\n\t\t\t\tif ( '' === $original ) {\n\t\t\t\t\t$this->set_headers( $this->make_headers( $translation ) );\n\t\t\t\t} else {\n\t\t\t\t\t$entry                          = &$this->make_entry( $original, $translation );\n\t\t\t\t\t$this->entries[ $entry->key() ] = &$entry;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * Build a Translation_Entry from original string and translation strings,\n\t\t * found in a MO file\n\t\t *\n\t\t * @static\n\t\t * @param string $original original string to translate from MO file. Might contain\n\t\t *  0x04 as context separator or 0x00 as singular/plural separator\n\t\t * @param string $translation translation string from MO file. Might contain\n\t\t *  0x00 as a plural translations separator\n\t\t * @return Translation_Entry Entry instance.\n\t\t */\n\t\tfunction &make_entry( $original, $translation ) {\n\t\t\t$entry = new Translation_Entry();\n\t\t\t// Look for context, separated by \\4.\n\t\t\t$parts = explode( \"\\4\", $original );\n\t\t\tif ( isset( $parts[1] ) ) {\n\t\t\t\t$original       = $parts[1];\n\t\t\t\t$entry->context = $parts[0];\n\t\t\t}\n\t\t\t// Look for plural original.\n\t\t\t$parts           = explode( \"\\0\", $original );\n\t\t\t$entry->singular = $parts[0];\n\t\t\tif ( isset( $parts[1] ) ) {\n\t\t\t\t$entry->is_plural = true;\n\t\t\t\t$entry->plural    = $parts[1];\n\t\t\t}\n\t\t\t// Plural translations are also separated by \\0.\n\t\t\t$entry->translations = explode( \"\\0\", $translation );\n\t\t\treturn $entry;\n\t\t}\n\n\t\t/**\n\t\t * @param int $count\n\t\t * @return string\n\t\t */\n\t\tfunction select_plural_form( $count ) {\n\t\t\treturn $this->gettext_select_plural_form( $count );\n\t\t}\n\n\t\t/**\n\t\t * @return int\n\t\t */\n\t\tfunction get_plural_forms_count() {\n\t\t\treturn $this->_nplurals;\n\t\t}\n\t}\nendif;\n", "num_lines": 350}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * A gettext Plural-Forms parser.\n *\n * @since 4.9.0\n */\nclass Plural_Forms {\n\t/**\n\t * Operator characters.\n\t *\n\t * @since 4.9.0\n\t * @var string OP_CHARS Operator characters.\n\t */\n\tconst OP_CHARS = '|&><!=%?:';\n\n\t/**\n\t * Valid number characters.\n\t *\n\t * @since 4.9.0\n\t * @var string NUM_CHARS Valid number characters.\n\t */\n\tconst NUM_CHARS = '0123456789';\n\n\t/**\n\t * Operator precedence.\n\t *\n\t * Operator precedence from highest to lowest. Higher numbers indicate\n\t * higher precedence, and are executed first.\n\t *\n\t * @see https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B#Operator_precedence\n\t *\n\t * @since 4.9.0\n\t * @var array $op_precedence Operator precedence from highest to lowest.\n\t */\n\tprotected static $op_precedence = array(\n\t\t'%'  => 6,\n\n\t\t'<'  => 5,\n\t\t'<=' => 5,\n\t\t'>'  => 5,\n\t\t'>=' => 5,\n\n\t\t'==' => 4,\n\t\t'!=' => 4,\n\n\t\t'&&' => 3,\n\n\t\t'||' => 2,\n\n\t\t'?:' => 1,\n\t\t'?'  => 1,\n\n\t\t'('  => 0,\n\t\t')'  => 0,\n\t);\n\n\t/**\n\t * Tokens generated from the string.\n\t *\n\t * @since 4.9.0\n\t * @var array $tokens List of tokens.\n\t */\n\tprotected $tokens = array();\n\n\t/**\n\t * Cache for repeated calls to the function.\n\t *\n\t * @since 4.9.0\n\t * @var array $cache Map of $n => $result\n\t */\n\tprotected $cache = array();\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param string $str Plural function (just the bit after `plural=` from Plural-Forms)\n\t */\n\tpublic function __construct( $str ) {\n\t\t$this->parse( $str );\n\t}\n\n\t/**\n\t * Parse a Plural-Forms string into tokens.\n\t *\n\t * Uses the shunting-yard algorithm to convert the string to Reverse Polish\n\t * Notation tokens.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param string $str String to parse.\n\t */\n\tprotected function parse( $str ) {\n\t\t$pos = 0;\n\t\t$len = strlen( $str );\n\n\t\t// Convert infix operators to postfix using the shunting-yard algorithm.\n\t\t$output = array();\n\t\t$stack  = array();\n\t\twhile ( $pos < $len ) {\n\t\t\t$next = substr( $str, $pos, 1 );\n\n\t\t\tswitch ( $next ) {\n\t\t\t\t// Ignore whitespace.\n\t\t\t\tcase ' ':\n\t\t\t\tcase \"\\t\":\n\t\t\t\t\t$pos++;\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Variable (n).\n\t\t\t\tcase 'n':\n\t\t\t\t\t$output[] = array( 'var' );\n\t\t\t\t\t$pos++;\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Parentheses.\n\t\t\t\tcase '(':\n\t\t\t\t\t$stack[] = $next;\n\t\t\t\t\t$pos++;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ')':\n\t\t\t\t\t$found = false;\n\t\t\t\t\twhile ( ! empty( $stack ) ) {\n\t\t\t\t\t\t$o2 = $stack[ count( $stack ) - 1 ];\n\t\t\t\t\t\tif ( '(' !== $o2 ) {\n\t\t\t\t\t\t\t$output[] = array( 'op', array_pop( $stack ) );\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Discard open paren.\n\t\t\t\t\t\tarray_pop( $stack );\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! $found ) {\n\t\t\t\t\t\tthrow new Exception( 'Mismatched parentheses' );\n\t\t\t\t\t}\n\n\t\t\t\t\t$pos++;\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Operators.\n\t\t\t\tcase '|':\n\t\t\t\tcase '&':\n\t\t\t\tcase '>':\n\t\t\t\tcase '<':\n\t\t\t\tcase '!':\n\t\t\t\tcase '=':\n\t\t\t\tcase '%':\n\t\t\t\tcase '?':\n\t\t\t\t\t$end_operator = strspn( $str, self::OP_CHARS, $pos );\n\t\t\t\t\t$operator     = substr( $str, $pos, $end_operator );\n\t\t\t\t\tif ( ! array_key_exists( $operator, self::$op_precedence ) ) {\n\t\t\t\t\t\tthrow new Exception( sprintf( 'Unknown operator \"%s\"', $operator ) );\n\t\t\t\t\t}\n\n\t\t\t\t\twhile ( ! empty( $stack ) ) {\n\t\t\t\t\t\t$o2 = $stack[ count( $stack ) - 1 ];\n\n\t\t\t\t\t\t// Ternary is right-associative in C.\n\t\t\t\t\t\tif ( '?:' === $operator || '?' === $operator ) {\n\t\t\t\t\t\t\tif ( self::$op_precedence[ $operator ] >= self::$op_precedence[ $o2 ] ) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif ( self::$op_precedence[ $operator ] > self::$op_precedence[ $o2 ] ) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$output[] = array( 'op', array_pop( $stack ) );\n\t\t\t\t\t}\n\t\t\t\t\t$stack[] = $operator;\n\n\t\t\t\t\t$pos += $end_operator;\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Ternary \"else\".\n\t\t\t\tcase ':':\n\t\t\t\t\t$found = false;\n\t\t\t\t\t$s_pos = count( $stack ) - 1;\n\t\t\t\t\twhile ( $s_pos >= 0 ) {\n\t\t\t\t\t\t$o2 = $stack[ $s_pos ];\n\t\t\t\t\t\tif ( '?' !== $o2 ) {\n\t\t\t\t\t\t\t$output[] = array( 'op', array_pop( $stack ) );\n\t\t\t\t\t\t\t$s_pos--;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Replace.\n\t\t\t\t\t\t$stack[ $s_pos ] = '?:';\n\t\t\t\t\t\t$found           = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! $found ) {\n\t\t\t\t\t\tthrow new Exception( 'Missing starting \"?\" ternary operator' );\n\t\t\t\t\t}\n\t\t\t\t\t$pos++;\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Default - number or invalid.\n\t\t\t\tdefault:\n\t\t\t\t\tif ( $next >= '0' && $next <= '9' ) {\n\t\t\t\t\t\t$span     = strspn( $str, self::NUM_CHARS, $pos );\n\t\t\t\t\t\t$output[] = array( 'value', intval( substr( $str, $pos, $span ) ) );\n\t\t\t\t\t\t$pos     += $span;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tthrow new Exception( sprintf( 'Unknown symbol \"%s\"', $next ) );\n\t\t\t}\n\t\t}\n\n\t\twhile ( ! empty( $stack ) ) {\n\t\t\t$o2 = array_pop( $stack );\n\t\t\tif ( '(' === $o2 || ')' === $o2 ) {\n\t\t\t\tthrow new Exception( 'Mismatched parentheses' );\n\t\t\t}\n\n\t\t\t$output[] = array( 'op', $o2 );\n\t\t}\n\n\t\t$this->tokens = $output;\n\t}\n\n\t/**\n\t * Get the plural form for a number.\n\t *\n\t * Caches the value for repeated calls.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param int $num Number to get plural form for.\n\t * @return int Plural form value.\n\t */\n\tpublic function get( $num ) {\n\t\tif ( isset( $this->cache[ $num ] ) ) {\n\t\t\treturn $this->cache[ $num ];\n\t\t}\n\t\t$this->cache[ $num ] = $this->execute( $num );\n\t\treturn $this->cache[ $num ];\n\t}\n\n\t/**\n\t * Execute the plural form function.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param int $n Variable \"n\" to substitute.\n\t * @return int Plural form value.\n\t */\n\tpublic function execute( $n ) {\n\t\t$stack = array();\n\t\t$i     = 0;\n\t\t$total = count( $this->tokens );\n\t\twhile ( $i < $total ) {\n\t\t\t$next = $this->tokens[ $i ];\n\t\t\t$i++;\n\t\t\tif ( 'var' === $next[0] ) {\n\t\t\t\t$stack[] = $n;\n\t\t\t\tcontinue;\n\t\t\t} elseif ( 'value' === $next[0] ) {\n\t\t\t\t$stack[] = $next[1];\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Only operators left.\n\t\t\tswitch ( $next[1] ) {\n\t\t\t\tcase '%':\n\t\t\t\t\t$v2      = array_pop( $stack );\n\t\t\t\t\t$v1      = array_pop( $stack );\n\t\t\t\t\t$stack[] = $v1 % $v2;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '||':\n\t\t\t\t\t$v2      = array_pop( $stack );\n\t\t\t\t\t$v1      = array_pop( $stack );\n\t\t\t\t\t$stack[] = $v1 || $v2;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '&&':\n\t\t\t\t\t$v2      = array_pop( $stack );\n\t\t\t\t\t$v1      = array_pop( $stack );\n\t\t\t\t\t$stack[] = $v1 && $v2;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '<':\n\t\t\t\t\t$v2      = array_pop( $stack );\n\t\t\t\t\t$v1      = array_pop( $stack );\n\t\t\t\t\t$stack[] = $v1 < $v2;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '<=':\n\t\t\t\t\t$v2      = array_pop( $stack );\n\t\t\t\t\t$v1      = array_pop( $stack );\n\t\t\t\t\t$stack[] = $v1 <= $v2;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '>':\n\t\t\t\t\t$v2      = array_pop( $stack );\n\t\t\t\t\t$v1      = array_pop( $stack );\n\t\t\t\t\t$stack[] = $v1 > $v2;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '>=':\n\t\t\t\t\t$v2      = array_pop( $stack );\n\t\t\t\t\t$v1      = array_pop( $stack );\n\t\t\t\t\t$stack[] = $v1 >= $v2;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '!=':\n\t\t\t\t\t$v2      = array_pop( $stack );\n\t\t\t\t\t$v1      = array_pop( $stack );\n\t\t\t\t\t$stack[] = $v1 != $v2;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '==':\n\t\t\t\t\t$v2      = array_pop( $stack );\n\t\t\t\t\t$v1      = array_pop( $stack );\n\t\t\t\t\t$stack[] = $v1 == $v2;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '?:':\n\t\t\t\t\t$v3      = array_pop( $stack );\n\t\t\t\t\t$v2      = array_pop( $stack );\n\t\t\t\t\t$v1      = array_pop( $stack );\n\t\t\t\t\t$stack[] = $v1 ? $v2 : $v3;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception( sprintf( 'Unknown operator \"%s\"', $next[1] ) );\n\t\t\t}\n\t\t}\n\n\t\tif ( count( $stack ) !== 1 ) {\n\t\t\tthrow new Exception( 'Too many values remaining on the stack' );\n\t\t}\n\n\t\treturn (int) $stack[0];\n\t}\n}\n", "num_lines": 345}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Class for working with PO files\n *\n * @version $Id: po.php 1158 2015-11-20 04:31:23Z dd32 $\n * @package pomo\n * @subpackage po\n */\n\nrequire_once __DIR__ . '/translations.php';\n\nif ( ! defined( 'PO_MAX_LINE_LEN' ) ) {\n\tdefine( 'PO_MAX_LINE_LEN', 79 );\n}\n\nini_set( 'auto_detect_line_endings', 1 );\n\n/**\n * Routines for working with PO files\n */\nif ( ! class_exists( 'PO', false ) ) :\n\tclass PO extends Gettext_Translations {\n\n\t\tvar $comments_before_headers = '';\n\n\t\t/**\n\t\t * Exports headers to a PO entry\n\t\t *\n\t\t * @return string msgid/msgstr PO entry for this PO file headers, doesn't contain newline at the end\n\t\t */\n\t\tfunction export_headers() {\n\t\t\t$header_string = '';\n\t\t\tforeach ( $this->headers as $header => $value ) {\n\t\t\t\t$header_string .= \"$header: $value\\n\";\n\t\t\t}\n\t\t\t$poified = PO::poify( $header_string );\n\t\t\tif ( $this->comments_before_headers ) {\n\t\t\t\t$before_headers = $this->prepend_each_line( rtrim( $this->comments_before_headers ) . \"\\n\", '# ' );\n\t\t\t} else {\n\t\t\t\t$before_headers = '';\n\t\t\t}\n\t\t\treturn rtrim( \"{$before_headers}msgid \\\"\\\"\\nmsgstr $poified\" );\n\t\t}\n\n\t\t/**\n\t\t * Exports all entries to PO format\n\t\t *\n\t\t * @return string sequence of mgsgid/msgstr PO strings, doesn't containt newline at the end\n\t\t */\n\t\tfunction export_entries() {\n\t\t\t// TODO: Sorting.\n\t\t\treturn implode( \"\\n\\n\", array_map( array( 'PO', 'export_entry' ), $this->entries ) );\n\t\t}\n\n\t\t/**\n\t\t * Exports the whole PO file as a string\n\t\t *\n\t\t * @param bool $include_headers whether to include the headers in the export\n\t\t * @return string ready for inclusion in PO file string for headers and all the enrtries\n\t\t */\n\t\tfunction export( $include_headers = true ) {\n\t\t\t$res = '';\n\t\t\tif ( $include_headers ) {\n\t\t\t\t$res .= $this->export_headers();\n\t\t\t\t$res .= \"\\n\\n\";\n\t\t\t}\n\t\t\t$res .= $this->export_entries();\n\t\t\treturn $res;\n\t\t}\n\n\t\t/**\n\t\t * Same as {@link export}, but writes the result to a file\n\t\t *\n\t\t * @param string $filename        Where to write the PO string.\n\t\t * @param bool   $include_headers Whether to include the headers in the export.\n\t\t * @return bool true on success, false on error\n\t\t */\n\t\tfunction export_to_file( $filename, $include_headers = true ) {\n\t\t\t$fh = fopen( $filename, 'w' );\n\t\t\tif ( false === $fh ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$export = $this->export( $include_headers );\n\t\t\t$res    = fwrite( $fh, $export );\n\t\t\tif ( false === $res ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn fclose( $fh );\n\t\t}\n\n\t\t/**\n\t\t * Text to include as a comment before the start of the PO contents\n\t\t *\n\t\t * Doesn't need to include # in the beginning of lines, these are added automatically\n\t\t *\n\t\t * @param string $text Text to include as a comment.\n\t\t */\n\t\tfunction set_comment_before_headers( $text ) {\n\t\t\t$this->comments_before_headers = $text;\n\t\t}\n\n\t\t/**\n\t\t * Formats a string in PO-style\n\t\t *\n\t\t * @param string $string the string to format\n\t\t * @return string the poified string\n\t\t */\n\t\tpublic static function poify( $string ) {\n\t\t\t$quote   = '\"';\n\t\t\t$slash   = '\\\\';\n\t\t\t$newline = \"\\n\";\n\n\t\t\t$replaces = array(\n\t\t\t\t\"$slash\" => \"$slash$slash\",\n\t\t\t\t\"$quote\" => \"$slash$quote\",\n\t\t\t\t\"\\t\"     => '\\t',\n\t\t\t);\n\n\t\t\t$string = str_replace( array_keys( $replaces ), array_values( $replaces ), $string );\n\n\t\t\t$po = $quote . implode( \"${slash}n$quote$newline$quote\", explode( $newline, $string ) ) . $quote;\n\t\t\t// Add empty string on first line for readbility.\n\t\t\tif ( false !== strpos( $string, $newline ) &&\n\t\t\t\t( substr_count( $string, $newline ) > 1 || substr( $string, -strlen( $newline ) ) !== $newline ) ) {\n\t\t\t\t$po = \"$quote$quote$newline$po\";\n\t\t\t}\n\t\t\t// Remove empty strings.\n\t\t\t$po = str_replace( \"$newline$quote$quote\", '', $po );\n\t\t\treturn $po;\n\t\t}\n\n\t\t/**\n\t\t * Gives back the original string from a PO-formatted string\n\t\t *\n\t\t * @param string $string PO-formatted string\n\t\t * @return string enascaped string\n\t\t */\n\t\tpublic static function unpoify( $string ) {\n\t\t\t$escapes               = array(\n\t\t\t\t't'  => \"\\t\",\n\t\t\t\t'n'  => \"\\n\",\n\t\t\t\t'r'  => \"\\r\",\n\t\t\t\t'\\\\' => '\\\\',\n\t\t\t);\n\t\t\t$lines                 = array_map( 'trim', explode( \"\\n\", $string ) );\n\t\t\t$lines                 = array_map( array( 'PO', 'trim_quotes' ), $lines );\n\t\t\t$unpoified             = '';\n\t\t\t$previous_is_backslash = false;\n\t\t\tforeach ( $lines as $line ) {\n\t\t\t\tpreg_match_all( '/./u', $line, $chars );\n\t\t\t\t$chars = $chars[0];\n\t\t\t\tforeach ( $chars as $char ) {\n\t\t\t\t\tif ( ! $previous_is_backslash ) {\n\t\t\t\t\t\tif ( '\\\\' === $char ) {\n\t\t\t\t\t\t\t$previous_is_backslash = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$unpoified .= $char;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$previous_is_backslash = false;\n\t\t\t\t\t\t$unpoified            .= isset( $escapes[ $char ] ) ? $escapes[ $char ] : $char;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Standardise the line endings on imported content, technically PO files shouldn't contain \\r.\n\t\t\t$unpoified = str_replace( array( \"\\r\\n\", \"\\r\" ), \"\\n\", $unpoified );\n\n\t\t\treturn $unpoified;\n\t\t}\n\n\t\t/**\n\t\t * Inserts $with in the beginning of every new line of $string and\n\t\t * returns the modified string\n\t\t *\n\t\t * @param string $string prepend lines in this string\n\t\t * @param string $with prepend lines with this string\n\t\t */\n\t\tpublic static function prepend_each_line( $string, $with ) {\n\t\t\t$lines  = explode( \"\\n\", $string );\n\t\t\t$append = '';\n\t\t\tif ( \"\\n\" === substr( $string, -1 ) && '' === end( $lines ) ) {\n\t\t\t\t/*\n\t\t\t\t * Last line might be empty because $string was terminated\n\t\t\t\t * with a newline, remove it from the $lines array,\n\t\t\t\t * we'll restore state by re-terminating the string at the end.\n\t\t\t\t */\n\t\t\t\tarray_pop( $lines );\n\t\t\t\t$append = \"\\n\";\n\t\t\t}\n\t\t\tforeach ( $lines as &$line ) {\n\t\t\t\t$line = $with . $line;\n\t\t\t}\n\t\t\tunset( $line );\n\t\t\treturn implode( \"\\n\", $lines ) . $append;\n\t\t}\n\n\t\t/**\n\t\t * Prepare a text as a comment -- wraps the lines and prepends #\n\t\t * and a special character to each line\n\t\t *\n\t\t * @access private\n\t\t * @param string $text the comment text\n\t\t * @param string $char character to denote a special PO comment,\n\t\t *  like :, default is a space\n\t\t */\n\t\tpublic static function comment_block( $text, $char = ' ' ) {\n\t\t\t$text = wordwrap( $text, PO_MAX_LINE_LEN - 3 );\n\t\t\treturn PO::prepend_each_line( $text, \"#$char \" );\n\t\t}\n\n\t\t/**\n\t\t * Builds a string from the entry for inclusion in PO file\n\t\t *\n\t\t * @param Translation_Entry $entry the entry to convert to po string (passed by reference).\n\t\t * @return string|false PO-style formatted string for the entry or\n\t\t *  false if the entry is empty\n\t\t */\n\t\tpublic static function export_entry( &$entry ) {\n\t\t\tif ( null === $entry->singular || '' === $entry->singular ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$po = array();\n\t\t\tif ( ! empty( $entry->translator_comments ) ) {\n\t\t\t\t$po[] = PO::comment_block( $entry->translator_comments );\n\t\t\t}\n\t\t\tif ( ! empty( $entry->extracted_comments ) ) {\n\t\t\t\t$po[] = PO::comment_block( $entry->extracted_comments, '.' );\n\t\t\t}\n\t\t\tif ( ! empty( $entry->references ) ) {\n\t\t\t\t$po[] = PO::comment_block( implode( ' ', $entry->references ), ':' );\n\t\t\t}\n\t\t\tif ( ! empty( $entry->flags ) ) {\n\t\t\t\t$po[] = PO::comment_block( implode( ', ', $entry->flags ), ',' );\n\t\t\t}\n\t\t\tif ( $entry->context ) {\n\t\t\t\t$po[] = 'msgctxt ' . PO::poify( $entry->context );\n\t\t\t}\n\t\t\t$po[] = 'msgid ' . PO::poify( $entry->singular );\n\t\t\tif ( ! $entry->is_plural ) {\n\t\t\t\t$translation = empty( $entry->translations ) ? '' : $entry->translations[0];\n\t\t\t\t$translation = PO::match_begin_and_end_newlines( $translation, $entry->singular );\n\t\t\t\t$po[]        = 'msgstr ' . PO::poify( $translation );\n\t\t\t} else {\n\t\t\t\t$po[]         = 'msgid_plural ' . PO::poify( $entry->plural );\n\t\t\t\t$translations = empty( $entry->translations ) ? array( '', '' ) : $entry->translations;\n\t\t\t\tforeach ( $translations as $i => $translation ) {\n\t\t\t\t\t$translation = PO::match_begin_and_end_newlines( $translation, $entry->plural );\n\t\t\t\t\t$po[]        = \"msgstr[$i] \" . PO::poify( $translation );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn implode( \"\\n\", $po );\n\t\t}\n\n\t\tpublic static function match_begin_and_end_newlines( $translation, $original ) {\n\t\t\tif ( '' === $translation ) {\n\t\t\t\treturn $translation;\n\t\t\t}\n\n\t\t\t$original_begin    = \"\\n\" === substr( $original, 0, 1 );\n\t\t\t$original_end      = \"\\n\" === substr( $original, -1 );\n\t\t\t$translation_begin = \"\\n\" === substr( $translation, 0, 1 );\n\t\t\t$translation_end   = \"\\n\" === substr( $translation, -1 );\n\n\t\t\tif ( $original_begin ) {\n\t\t\t\tif ( ! $translation_begin ) {\n\t\t\t\t\t$translation = \"\\n\" . $translation;\n\t\t\t\t}\n\t\t\t} elseif ( $translation_begin ) {\n\t\t\t\t$translation = ltrim( $translation, \"\\n\" );\n\t\t\t}\n\n\t\t\tif ( $original_end ) {\n\t\t\t\tif ( ! $translation_end ) {\n\t\t\t\t\t$translation .= \"\\n\";\n\t\t\t\t}\n\t\t\t} elseif ( $translation_end ) {\n\t\t\t\t$translation = rtrim( $translation, \"\\n\" );\n\t\t\t}\n\n\t\t\treturn $translation;\n\t\t}\n\n\t\t/**\n\t\t * @param string $filename\n\t\t * @return boolean\n\t\t */\n\t\tfunction import_from_file( $filename ) {\n\t\t\t$f = fopen( $filename, 'r' );\n\t\t\tif ( ! $f ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$lineno = 0;\n\t\t\twhile ( true ) {\n\t\t\t\t$res = $this->read_entry( $f, $lineno );\n\t\t\t\tif ( ! $res ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( '' === $res['entry']->singular ) {\n\t\t\t\t\t$this->set_headers( $this->make_headers( $res['entry']->translations[0] ) );\n\t\t\t\t} else {\n\t\t\t\t\t$this->add_entry( $res['entry'] );\n\t\t\t\t}\n\t\t\t}\n\t\t\tPO::read_line( $f, 'clear' );\n\t\t\tif ( false === $res ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ( ! $this->headers && ! $this->entries ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * Helper function for read_entry\n\t\t *\n\t\t * @param string $context\n\t\t * @return bool\n\t\t */\n\t\tprotected static function is_final( $context ) {\n\t\t\treturn ( 'msgstr' === $context ) || ( 'msgstr_plural' === $context );\n\t\t}\n\n\t\t/**\n\t\t * @param resource $f\n\t\t * @param int      $lineno\n\t\t * @return null|false|array\n\t\t */\n\t\tfunction read_entry( $f, $lineno = 0 ) {\n\t\t\t$entry = new Translation_Entry();\n\t\t\t// Where were we in the last step.\n\t\t\t// Can be: comment, msgctxt, msgid, msgid_plural, msgstr, msgstr_plural.\n\t\t\t$context      = '';\n\t\t\t$msgstr_index = 0;\n\t\t\twhile ( true ) {\n\t\t\t\t$lineno++;\n\t\t\t\t$line = PO::read_line( $f );\n\t\t\t\tif ( ! $line ) {\n\t\t\t\t\tif ( feof( $f ) ) {\n\t\t\t\t\t\tif ( self::is_final( $context ) ) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} elseif ( ! $context ) { // We haven't read a line and EOF came.\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( \"\\n\" === $line ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$line = trim( $line );\n\t\t\t\tif ( preg_match( '/^#/', $line, $m ) ) {\n\t\t\t\t\t// The comment is the start of a new entry.\n\t\t\t\t\tif ( self::is_final( $context ) ) {\n\t\t\t\t\t\tPO::read_line( $f, 'put-back' );\n\t\t\t\t\t\t$lineno--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// Comments have to be at the beginning.\n\t\t\t\t\tif ( $context && 'comment' !== $context ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t// Add comment.\n\t\t\t\t\t$this->add_comment_to_entry( $entry, $line );\n\t\t\t\t} elseif ( preg_match( '/^msgctxt\\s+(\".*\")/', $line, $m ) ) {\n\t\t\t\t\tif ( self::is_final( $context ) ) {\n\t\t\t\t\t\tPO::read_line( $f, 'put-back' );\n\t\t\t\t\t\t$lineno--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ( $context && 'comment' !== $context ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t$context         = 'msgctxt';\n\t\t\t\t\t$entry->context .= PO::unpoify( $m[1] );\n\t\t\t\t} elseif ( preg_match( '/^msgid\\s+(\".*\")/', $line, $m ) ) {\n\t\t\t\t\tif ( self::is_final( $context ) ) {\n\t\t\t\t\t\tPO::read_line( $f, 'put-back' );\n\t\t\t\t\t\t$lineno--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ( $context && 'msgctxt' !== $context && 'comment' !== $context ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t$context          = 'msgid';\n\t\t\t\t\t$entry->singular .= PO::unpoify( $m[1] );\n\t\t\t\t} elseif ( preg_match( '/^msgid_plural\\s+(\".*\")/', $line, $m ) ) {\n\t\t\t\t\tif ( 'msgid' !== $context ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t$context          = 'msgid_plural';\n\t\t\t\t\t$entry->is_plural = true;\n\t\t\t\t\t$entry->plural   .= PO::unpoify( $m[1] );\n\t\t\t\t} elseif ( preg_match( '/^msgstr\\s+(\".*\")/', $line, $m ) ) {\n\t\t\t\t\tif ( 'msgid' !== $context ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t$context             = 'msgstr';\n\t\t\t\t\t$entry->translations = array( PO::unpoify( $m[1] ) );\n\t\t\t\t} elseif ( preg_match( '/^msgstr\\[(\\d+)\\]\\s+(\".*\")/', $line, $m ) ) {\n\t\t\t\t\tif ( 'msgid_plural' !== $context && 'msgstr_plural' !== $context ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t$context                      = 'msgstr_plural';\n\t\t\t\t\t$msgstr_index                 = $m[1];\n\t\t\t\t\t$entry->translations[ $m[1] ] = PO::unpoify( $m[2] );\n\t\t\t\t} elseif ( preg_match( '/^\".*\"$/', $line ) ) {\n\t\t\t\t\t$unpoified = PO::unpoify( $line );\n\t\t\t\t\tswitch ( $context ) {\n\t\t\t\t\t\tcase 'msgid':\n\t\t\t\t\t\t\t$entry->singular .= $unpoified;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'msgctxt':\n\t\t\t\t\t\t\t$entry->context .= $unpoified;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'msgid_plural':\n\t\t\t\t\t\t\t$entry->plural .= $unpoified;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'msgstr':\n\t\t\t\t\t\t\t$entry->translations[0] .= $unpoified;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'msgstr_plural':\n\t\t\t\t\t\t\t$entry->translations[ $msgstr_index ] .= $unpoified;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$have_translations = false;\n\t\t\tforeach ( $entry->translations as $t ) {\n\t\t\t\tif ( $t || ( '0' === $t ) ) {\n\t\t\t\t\t$have_translations = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( false === $have_translations ) {\n\t\t\t\t$entry->translations = array();\n\t\t\t}\n\n\t\t\treturn array(\n\t\t\t\t'entry'  => $entry,\n\t\t\t\t'lineno' => $lineno,\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * @param resource $f\n\t\t * @param string   $action\n\t\t * @return boolean\n\t\t */\n\t\tfunction read_line( $f, $action = 'read' ) {\n\t\t\tstatic $last_line     = '';\n\t\t\tstatic $use_last_line = false;\n\t\t\tif ( 'clear' === $action ) {\n\t\t\t\t$last_line = '';\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ( 'put-back' === $action ) {\n\t\t\t\t$use_last_line = true;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t$line          = $use_last_line ? $last_line : fgets( $f );\n\t\t\t$line          = ( \"\\r\\n\" === substr( $line, -2 ) ) ? rtrim( $line, \"\\r\\n\" ) . \"\\n\" : $line;\n\t\t\t$last_line     = $line;\n\t\t\t$use_last_line = false;\n\t\t\treturn $line;\n\t\t}\n\n\t\t/**\n\t\t * @param Translation_Entry $entry\n\t\t * @param string            $po_comment_line\n\t\t */\n\t\tfunction add_comment_to_entry( &$entry, $po_comment_line ) {\n\t\t\t$first_two = substr( $po_comment_line, 0, 2 );\n\t\t\t$comment   = trim( substr( $po_comment_line, 2 ) );\n\t\t\tif ( '#:' === $first_two ) {\n\t\t\t\t$entry->references = array_merge( $entry->references, preg_split( '/\\s+/', $comment ) );\n\t\t\t} elseif ( '#.' === $first_two ) {\n\t\t\t\t$entry->extracted_comments = trim( $entry->extracted_comments . \"\\n\" . $comment );\n\t\t\t} elseif ( '#,' === $first_two ) {\n\t\t\t\t$entry->flags = array_merge( $entry->flags, preg_split( '/,\\s*/', $comment ) );\n\t\t\t} else {\n\t\t\t\t$entry->translator_comments = trim( $entry->translator_comments . \"\\n\" . $comment );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @param string $s\n\t\t * @return string\n\t\t */\n\t\tpublic static function trim_quotes( $s ) {\n\t\t\tif ( '\"' === substr( $s, 0, 1 ) ) {\n\t\t\t\t$s = substr( $s, 1 );\n\t\t\t}\n\t\t\tif ( '\"' === substr( $s, -1, 1 ) ) {\n\t\t\t\t$s = substr( $s, 0, -1 );\n\t\t\t}\n\t\t\treturn $s;\n\t\t}\n\t}\nendif;\n", "num_lines": 510}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Classes, which help reading streams of data from files.\n * Based on the classes from Danilo Segan <danilo@kvota.net>\n *\n * @version $Id: streams.php 1157 2015-11-20 04:30:11Z dd32 $\n * @package pomo\n * @subpackage streams\n */\n\nif ( ! class_exists( 'POMO_Reader', false ) ) :\n\tclass POMO_Reader {\n\n\t\tvar $endian = 'little';\n\t\tvar $_post  = '';\n\n\t\t/**\n\t\t * PHP5 constructor.\n\t\t */\n\t\tfunction __construct() {\n\t\t\t$this->is_overloaded = ( ( ini_get( 'mbstring.func_overload' ) & 2 ) != 0 ) && function_exists( 'mb_substr' ); // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated\n\t\t\t$this->_pos          = 0;\n\t\t}\n\n\t\t/**\n\t\t * PHP4 constructor.\n\t\t *\n\t\t * @deprecated 5.4.0 Use __construct() instead.\n\t\t *\n\t\t * @see POMO_Reader::__construct()\n\t\t */\n\t\tpublic function POMO_Reader() {\n\t\t\t_deprecated_constructor( self::class, '5.4.0', static::class );\n\t\t\tself::__construct();\n\t\t}\n\n\t\t/**\n\t\t * Sets the endianness of the file.\n\t\t *\n\t\t * @param string $endian Set the endianness of the file. Accepts 'big', or 'little'.\n\t\t */\n\t\tfunction setEndian( $endian ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid\n\t\t\t$this->endian = $endian;\n\t\t}\n\n\t\t/**\n\t\t * Reads a 32bit Integer from the Stream\n\t\t *\n\t\t * @return mixed The integer, corresponding to the next 32 bits from\n\t\t *  the stream of false if there are not enough bytes or on error\n\t\t */\n\t\tfunction readint32() {\n\t\t\t$bytes = $this->read( 4 );\n\t\t\tif ( 4 != $this->strlen( $bytes ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$endian_letter = ( 'big' === $this->endian ) ? 'N' : 'V';\n\t\t\t$int           = unpack( $endian_letter, $bytes );\n\t\t\treturn reset( $int );\n\t\t}\n\n\t\t/**\n\t\t * Reads an array of 32-bit Integers from the Stream\n\t\t *\n\t\t * @param integer $count How many elements should be read\n\t\t * @return mixed Array of integers or false if there isn't\n\t\t *  enough data or on error\n\t\t */\n\t\tfunction readint32array( $count ) {\n\t\t\t$bytes = $this->read( 4 * $count );\n\t\t\tif ( 4 * $count != $this->strlen( $bytes ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$endian_letter = ( 'big' === $this->endian ) ? 'N' : 'V';\n\t\t\treturn unpack( $endian_letter . $count, $bytes );\n\t\t}\n\n\t\t/**\n\t\t * @param string $string\n\t\t * @param int    $start\n\t\t * @param int    $length\n\t\t * @return string\n\t\t */\n\t\tfunction substr( $string, $start, $length ) {\n\t\t\tif ( $this->is_overloaded ) {\n\t\t\t\treturn mb_substr( $string, $start, $length, 'ascii' );\n\t\t\t} else {\n\t\t\t\treturn substr( $string, $start, $length );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @param string $string\n\t\t * @return int\n\t\t */\n\t\tfunction strlen( $string ) {\n\t\t\tif ( $this->is_overloaded ) {\n\t\t\t\treturn mb_strlen( $string, 'ascii' );\n\t\t\t} else {\n\t\t\t\treturn strlen( $string );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @param string $string\n\t\t * @param int    $chunk_size\n\t\t * @return array\n\t\t */\n\t\tfunction str_split( $string, $chunk_size ) {\n\t\t\tif ( ! function_exists( 'str_split' ) ) {\n\t\t\t\t$length = $this->strlen( $string );\n\t\t\t\t$out    = array();\n\t\t\t\tfor ( $i = 0; $i < $length; $i += $chunk_size ) {\n\t\t\t\t\t$out[] = $this->substr( $string, $i, $chunk_size );\n\t\t\t\t}\n\t\t\t\treturn $out;\n\t\t\t} else {\n\t\t\t\treturn str_split( $string, $chunk_size );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @return int\n\t\t */\n\t\tfunction pos() {\n\t\t\treturn $this->_pos;\n\t\t}\n\n\t\t/**\n\t\t * @return true\n\t\t */\n\t\tfunction is_resource() {\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * @return true\n\t\t */\n\t\tfunction close() {\n\t\t\treturn true;\n\t\t}\n\t}\nendif;\n\nif ( ! class_exists( 'POMO_FileReader', false ) ) :\n\tclass POMO_FileReader extends POMO_Reader {\n\n\t\t/**\n\t\t * @param string $filename\n\t\t */\n\t\tfunction __construct( $filename ) {\n\t\t\tparent::__construct();\n\t\t\t$this->_f = fopen( $filename, 'rb' );\n\t\t}\n\n\t\t/**\n\t\t * PHP4 constructor.\n\t\t *\n\t\t * @deprecated 5.4.0 Use __construct() instead.\n\t\t *\n\t\t * @see POMO_FileReader::__construct()\n\t\t */\n\t\tpublic function POMO_FileReader( $filename ) {\n\t\t\t_deprecated_constructor( self::class, '5.4.0', static::class );\n\t\t\tself::__construct( $filename );\n\t\t}\n\n\t\t/**\n\t\t * @param int $bytes\n\t\t * @return string|false Returns read string, otherwise false.\n\t\t */\n\t\tfunction read( $bytes ) {\n\t\t\treturn fread( $this->_f, $bytes );\n\t\t}\n\n\t\t/**\n\t\t * @param int $pos\n\t\t * @return boolean\n\t\t */\n\t\tfunction seekto( $pos ) {\n\t\t\tif ( -1 == fseek( $this->_f, $pos, SEEK_SET ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$this->_pos = $pos;\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * @return bool\n\t\t */\n\t\tfunction is_resource() {\n\t\t\treturn is_resource( $this->_f );\n\t\t}\n\n\t\t/**\n\t\t * @return bool\n\t\t */\n\t\tfunction feof() {\n\t\t\treturn feof( $this->_f );\n\t\t}\n\n\t\t/**\n\t\t * @return bool\n\t\t */\n\t\tfunction close() {\n\t\t\treturn fclose( $this->_f );\n\t\t}\n\n\t\t/**\n\t\t * @return string\n\t\t */\n\t\tfunction read_all() {\n\t\t\t$all = '';\n\t\t\twhile ( ! $this->feof() ) {\n\t\t\t\t$all .= $this->read( 4096 );\n\t\t\t}\n\t\t\treturn $all;\n\t\t}\n\t}\nendif;\n\nif ( ! class_exists( 'POMO_StringReader', false ) ) :\n\t/**\n\t * Provides file-like methods for manipulating a string instead\n\t * of a physical file.\n\t */\n\tclass POMO_StringReader extends POMO_Reader {\n\n\t\tvar $_str = '';\n\n\t\t/**\n\t\t * PHP5 constructor.\n\t\t */\n\t\tfunction __construct( $str = '' ) {\n\t\t\tparent::__construct();\n\t\t\t$this->_str = $str;\n\t\t\t$this->_pos = 0;\n\t\t}\n\n\t\t/**\n\t\t * PHP4 constructor.\n\t\t *\n\t\t * @deprecated 5.4.0 Use __construct() instead.\n\t\t *\n\t\t * @see POMO_StringReader::__construct()\n\t\t */\n\t\tpublic function POMO_StringReader( $str = '' ) {\n\t\t\t_deprecated_constructor( self::class, '5.4.0', static::class );\n\t\t\tself::__construct( $str );\n\t\t}\n\n\t\t/**\n\t\t * @param string $bytes\n\t\t * @return string\n\t\t */\n\t\tfunction read( $bytes ) {\n\t\t\t$data        = $this->substr( $this->_str, $this->_pos, $bytes );\n\t\t\t$this->_pos += $bytes;\n\t\t\tif ( $this->strlen( $this->_str ) < $this->_pos ) {\n\t\t\t\t$this->_pos = $this->strlen( $this->_str );\n\t\t\t}\n\t\t\treturn $data;\n\t\t}\n\n\t\t/**\n\t\t * @param int $pos\n\t\t * @return int\n\t\t */\n\t\tfunction seekto( $pos ) {\n\t\t\t$this->_pos = $pos;\n\t\t\tif ( $this->strlen( $this->_str ) < $this->_pos ) {\n\t\t\t\t$this->_pos = $this->strlen( $this->_str );\n\t\t\t}\n\t\t\treturn $this->_pos;\n\t\t}\n\n\t\t/**\n\t\t * @return int\n\t\t */\n\t\tfunction length() {\n\t\t\treturn $this->strlen( $this->_str );\n\t\t}\n\n\t\t/**\n\t\t * @return string\n\t\t */\n\t\tfunction read_all() {\n\t\t\treturn $this->substr( $this->_str, $this->_pos, $this->strlen( $this->_str ) );\n\t\t}\n\n\t}\nendif;\n\nif ( ! class_exists( 'POMO_CachedFileReader', false ) ) :\n\t/**\n\t * Reads the contents of the file in the beginning.\n\t */\n\tclass POMO_CachedFileReader extends POMO_StringReader {\n\t\t/**\n\t\t * PHP5 constructor.\n\t\t */\n\t\tfunction __construct( $filename ) {\n\t\t\tparent::__construct();\n\t\t\t$this->_str = file_get_contents( $filename );\n\t\t\tif ( false === $this->_str ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$this->_pos = 0;\n\t\t}\n\n\t\t/**\n\t\t * PHP4 constructor.\n\t\t *\n\t\t * @deprecated 5.4.0 Use __construct() instead.\n\t\t *\n\t\t * @see POMO_CachedFileReader::__construct()\n\t\t */\n\t\tpublic function POMO_CachedFileReader( $filename ) {\n\t\t\t_deprecated_constructor( self::class, '5.4.0', static::class );\n\t\t\tself::__construct( $filename );\n\t\t}\n\t}\nendif;\n\nif ( ! class_exists( 'POMO_CachedIntFileReader', false ) ) :\n\t/**\n\t * Reads the contents of the file in the beginning.\n\t */\n\tclass POMO_CachedIntFileReader extends POMO_CachedFileReader {\n\t\t/**\n\t\t * PHP5 constructor.\n\t\t */\n\t\tpublic function __construct( $filename ) {\n\t\t\tparent::__construct( $filename );\n\t\t}\n\n\t\t/**\n\t\t * PHP4 constructor.\n\t\t *\n\t\t * @deprecated 5.4.0 Use __construct() instead.\n\t\t *\n\t\t * @see POMO_CachedIntFileReader::__construct()\n\t\t */\n\t\tfunction POMO_CachedIntFileReader( $filename ) {\n\t\t\t_deprecated_constructor( self::class, '5.4.0', static::class );\n\t\t\tself::__construct( $filename );\n\t\t}\n\t}\nendif;\n\n", "num_lines": 351}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Class for a set of entries for translation and their associated headers\n *\n * @version $Id: translations.php 1157 2015-11-20 04:30:11Z dd32 $\n * @package pomo\n * @subpackage translations\n */\n\nrequire_once __DIR__ . '/plural-forms.php';\nrequire_once __DIR__ . '/entry.php';\n\nif ( ! class_exists( 'Translations', false ) ) :\n\tclass Translations {\n\t\tvar $entries = array();\n\t\tvar $headers = array();\n\n\t\t/**\n\t\t * Add entry to the PO structure\n\t\t *\n\t\t * @param array|Translation_Entry $entry\n\t\t * @return bool true on success, false if the entry doesn't have a key\n\t\t */\n\t\tfunction add_entry( $entry ) {\n\t\t\tif ( is_array( $entry ) ) {\n\t\t\t\t$entry = new Translation_Entry( $entry );\n\t\t\t}\n\t\t\t$key = $entry->key();\n\t\t\tif ( false === $key ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$this->entries[ $key ] = &$entry;\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * @param array|Translation_Entry $entry\n\t\t * @return bool\n\t\t */\n\t\tfunction add_entry_or_merge( $entry ) {\n\t\t\tif ( is_array( $entry ) ) {\n\t\t\t\t$entry = new Translation_Entry( $entry );\n\t\t\t}\n\t\t\t$key = $entry->key();\n\t\t\tif ( false === $key ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ( isset( $this->entries[ $key ] ) ) {\n\t\t\t\t$this->entries[ $key ]->merge_with( $entry );\n\t\t\t} else {\n\t\t\t\t$this->entries[ $key ] = &$entry;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * Sets $header PO header to $value\n\t\t *\n\t\t * If the header already exists, it will be overwritten\n\t\t *\n\t\t * TODO: this should be out of this class, it is gettext specific\n\t\t *\n\t\t * @param string $header header name, without trailing :\n\t\t * @param string $value header value, without trailing \\n\n\t\t */\n\t\tfunction set_header( $header, $value ) {\n\t\t\t$this->headers[ $header ] = $value;\n\t\t}\n\n\t\t/**\n\t\t * @param array $headers\n\t\t */\n\t\tfunction set_headers( $headers ) {\n\t\t\tforeach ( $headers as $header => $value ) {\n\t\t\t\t$this->set_header( $header, $value );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @param string $header\n\t\t */\n\t\tfunction get_header( $header ) {\n\t\t\treturn isset( $this->headers[ $header ] ) ? $this->headers[ $header ] : false;\n\t\t}\n\n\t\t/**\n\t\t * @param Translation_Entry $entry\n\t\t */\n\t\tfunction translate_entry( &$entry ) {\n\t\t\t$key = $entry->key();\n\t\t\treturn isset( $this->entries[ $key ] ) ? $this->entries[ $key ] : false;\n\t\t}\n\n\t\t/**\n\t\t * @param string $singular\n\t\t * @param string $context\n\t\t * @return string\n\t\t */\n\t\tfunction translate( $singular, $context = null ) {\n\t\t\t$entry      = new Translation_Entry(\n\t\t\t\tarray(\n\t\t\t\t\t'singular' => $singular,\n\t\t\t\t\t'context'  => $context,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$translated = $this->translate_entry( $entry );\n\t\t\treturn ( $translated && ! empty( $translated->translations ) ) ? $translated->translations[0] : $singular;\n\t\t}\n\n\t\t/**\n\t\t * Given the number of items, returns the 0-based index of the plural form to use\n\t\t *\n\t\t * Here, in the base Translations class, the common logic for English is implemented:\n\t\t *  0 if there is one element, 1 otherwise\n\t\t *\n\t\t * This function should be overridden by the subclasses. For example MO/PO can derive the logic\n\t\t * from their headers.\n\t\t *\n\t\t * @param integer $count number of items\n\t\t */\n\t\tfunction select_plural_form( $count ) {\n\t\t\treturn 1 == $count ? 0 : 1;\n\t\t}\n\n\t\t/**\n\t\t * @return int\n\t\t */\n\t\tfunction get_plural_forms_count() {\n\t\t\treturn 2;\n\t\t}\n\n\t\t/**\n\t\t * @param string $singular\n\t\t * @param string $plural\n\t\t * @param int    $count\n\t\t * @param string $context\n\t\t */\n\t\tfunction translate_plural( $singular, $plural, $count, $context = null ) {\n\t\t\t$entry              = new Translation_Entry(\n\t\t\t\tarray(\n\t\t\t\t\t'singular' => $singular,\n\t\t\t\t\t'plural'   => $plural,\n\t\t\t\t\t'context'  => $context,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$translated         = $this->translate_entry( $entry );\n\t\t\t$index              = $this->select_plural_form( $count );\n\t\t\t$total_plural_forms = $this->get_plural_forms_count();\n\t\t\tif ( $translated && 0 <= $index && $index < $total_plural_forms &&\n\t\t\t\tis_array( $translated->translations ) &&\n\t\t\t\tisset( $translated->translations[ $index ] ) ) {\n\t\t\t\treturn $translated->translations[ $index ];\n\t\t\t} else {\n\t\t\t\treturn 1 == $count ? $singular : $plural;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Merge $other in the current object.\n\t\t *\n\t\t * @param Object $other Another Translation object, whose translations will be merged in this one (passed by reference).\n\t\t * @return void\n\t\t */\n\t\tfunction merge_with( &$other ) {\n\t\t\tforeach ( $other->entries as $entry ) {\n\t\t\t\t$this->entries[ $entry->key() ] = $entry;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @param object $other\n\t\t */\n\t\tfunction merge_originals_with( &$other ) {\n\t\t\tforeach ( $other->entries as $entry ) {\n\t\t\t\tif ( ! isset( $this->entries[ $entry->key() ] ) ) {\n\t\t\t\t\t$this->entries[ $entry->key() ] = $entry;\n\t\t\t\t} else {\n\t\t\t\t\t$this->entries[ $entry->key() ]->merge_with( $entry );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tclass Gettext_Translations extends Translations {\n\t\t/**\n\t\t * The gettext implementation of select_plural_form.\n\t\t *\n\t\t * It lives in this class, because there are more than one descendand, which will use it and\n\t\t * they can't share it effectively.\n\t\t *\n\t\t * @param int $count\n\t\t */\n\t\tfunction gettext_select_plural_form( $count ) {\n\t\t\tif ( ! isset( $this->_gettext_select_plural_form ) || is_null( $this->_gettext_select_plural_form ) ) {\n\t\t\t\tlist( $nplurals, $expression )     = $this->nplurals_and_expression_from_header( $this->get_header( 'Plural-Forms' ) );\n\t\t\t\t$this->_nplurals                   = $nplurals;\n\t\t\t\t$this->_gettext_select_plural_form = $this->make_plural_form_function( $nplurals, $expression );\n\t\t\t}\n\t\t\treturn call_user_func( $this->_gettext_select_plural_form, $count );\n\t\t}\n\n\t\t/**\n\t\t * @param string $header\n\t\t * @return array\n\t\t */\n\t\tfunction nplurals_and_expression_from_header( $header ) {\n\t\t\tif ( preg_match( '/^\\s*nplurals\\s*=\\s*(\\d+)\\s*;\\s+plural\\s*=\\s*(.+)$/', $header, $matches ) ) {\n\t\t\t\t$nplurals   = (int) $matches[1];\n\t\t\t\t$expression = trim( $matches[2] );\n\t\t\t\treturn array( $nplurals, $expression );\n\t\t\t} else {\n\t\t\t\treturn array( 2, 'n != 1' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Makes a function, which will return the right translation index, according to the\n\t\t * plural forms header\n\t\t *\n\t\t * @param int    $nplurals\n\t\t * @param string $expression\n\t\t */\n\t\tfunction make_plural_form_function( $nplurals, $expression ) {\n\t\t\ttry {\n\t\t\t\t$handler = new Plural_Forms( rtrim( $expression, ';' ) );\n\t\t\t\treturn array( $handler, 'get' );\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\t// Fall back to default plural-form function.\n\t\t\t\treturn $this->make_plural_form_function( 2, 'n != 1' );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Adds parentheses to the inner parts of ternary operators in\n\t\t * plural expressions, because PHP evaluates ternary oerators from left to right\n\t\t *\n\t\t * @param string $expression the expression without parentheses\n\t\t * @return string the expression with parentheses added\n\t\t */\n\t\tfunction parenthesize_plural_exression( $expression ) {\n\t\t\t$expression .= ';';\n\t\t\t$res         = '';\n\t\t\t$depth       = 0;\n\t\t\tfor ( $i = 0; $i < strlen( $expression ); ++$i ) {\n\t\t\t\t$char = $expression[ $i ];\n\t\t\t\tswitch ( $char ) {\n\t\t\t\t\tcase '?':\n\t\t\t\t\t\t$res .= ' ? (';\n\t\t\t\t\t\t$depth++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ':':\n\t\t\t\t\t\t$res .= ') : (';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ';':\n\t\t\t\t\t\t$res  .= str_repeat( ')', $depth ) . ';';\n\t\t\t\t\t\t$depth = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$res .= $char;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn rtrim( $res, ';' );\n\t\t}\n\n\t\t/**\n\t\t * @param string $translation\n\t\t * @return array\n\t\t */\n\t\tfunction make_headers( $translation ) {\n\t\t\t$headers = array();\n\t\t\t// Sometimes \\n's are used instead of real new lines.\n\t\t\t$translation = str_replace( '\\n', \"\\n\", $translation );\n\t\t\t$lines       = explode( \"\\n\", $translation );\n\t\t\tforeach ( $lines as $line ) {\n\t\t\t\t$parts = explode( ':', $line, 2 );\n\t\t\t\tif ( ! isset( $parts[1] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$headers[ trim( $parts[0] ) ] = trim( $parts[1] );\n\t\t\t}\n\t\t\treturn $headers;\n\t\t}\n\n\t\t/**\n\t\t * @param string $header\n\t\t * @param string $value\n\t\t */\n\t\tfunction set_header( $header, $value ) {\n\t\t\tparent::set_header( $header, $value );\n\t\t\tif ( 'Plural-Forms' === $header ) {\n\t\t\t\tlist( $nplurals, $expression )     = $this->nplurals_and_expression_from_header( $this->get_header( 'Plural-Forms' ) );\n\t\t\t\t$this->_nplurals                   = $nplurals;\n\t\t\t\t$this->_gettext_select_plural_form = $this->make_plural_form_function( $nplurals, $expression );\n\t\t\t}\n\t\t}\n\t}\nendif;\n\nif ( ! class_exists( 'NOOP_Translations', false ) ) :\n\t/**\n\t * Provides the same interface as Translations, but doesn't do anything\n\t */\n\tclass NOOP_Translations {\n\t\tvar $entries = array();\n\t\tvar $headers = array();\n\n\t\tfunction add_entry( $entry ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * @param string $header\n\t\t * @param string $value\n\t\t */\n\t\tfunction set_header( $header, $value ) {\n\t\t}\n\n\t\t/**\n\t\t * @param array $headers\n\t\t */\n\t\tfunction set_headers( $headers ) {\n\t\t}\n\n\t\t/**\n\t\t * @param string $header\n\t\t * @return false\n\t\t */\n\t\tfunction get_header( $header ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * @param Translation_Entry $entry\n\t\t * @return false\n\t\t */\n\t\tfunction translate_entry( &$entry ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * @param string $singular\n\t\t * @param string $context\n\t\t */\n\t\tfunction translate( $singular, $context = null ) {\n\t\t\treturn $singular;\n\t\t}\n\n\t\t/**\n\t\t * @param int $count\n\t\t * @return bool\n\t\t */\n\t\tfunction select_plural_form( $count ) {\n\t\t\treturn 1 == $count ? 0 : 1;\n\t\t}\n\n\t\t/**\n\t\t * @return int\n\t\t */\n\t\tfunction get_plural_forms_count() {\n\t\t\treturn 2;\n\t\t}\n\n\t\t/**\n\t\t * @param string $singular\n\t\t * @param string $plural\n\t\t * @param int    $count\n\t\t * @param string $context\n\t\t */\n\t\tfunction translate_plural( $singular, $plural, $count, $context = null ) {\n\t\t\treturn 1 == $count ? $singular : $plural;\n\t\t}\n\n\t\t/**\n\t\t * @param object $other\n\t\t */\n\t\tfunction merge_with( &$other ) {\n\t\t}\n\t}\nendif;\n", "num_lines": 380}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Random_* Compatibility Library\n * for using the new PHP 7 random_* API in PHP 5 projects\n *\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 - 2017 Paragon Initiative Enterprises\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nif (!is_callable('RandomCompat_strlen')) {\n    if (\n        defined('MB_OVERLOAD_STRING') &&\n        ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING\n    ) {\n        /**\n         * strlen() implementation that isn't brittle to mbstring.func_overload\n         *\n         * This version uses mb_strlen() in '8bit' mode to treat strings as raw\n         * binary rather than UTF-8, ISO-8859-1, etc\n         *\n         * @param string $binary_string\n         *\n         * @throws TypeError\n         *\n         * @return int\n         */\n        function RandomCompat_strlen($binary_string)\n        {\n            if (!is_string($binary_string)) {\n                throw new TypeError(\n                    'RandomCompat_strlen() expects a string'\n                );\n            }\n\n            return (int) mb_strlen($binary_string, '8bit');\n        }\n\n    } else {\n        /**\n         * strlen() implementation that isn't brittle to mbstring.func_overload\n         *\n         * This version just used the default strlen()\n         *\n         * @param string $binary_string\n         *\n         * @throws TypeError\n         *\n         * @return int\n         */\n        function RandomCompat_strlen($binary_string)\n        {\n            if (!is_string($binary_string)) {\n                throw new TypeError(\n                    'RandomCompat_strlen() expects a string'\n                );\n            }\n            return (int) strlen($binary_string);\n        }\n    }\n}\n\nif (!is_callable('RandomCompat_substr')) {\n\n    if (\n        defined('MB_OVERLOAD_STRING')\n        &&\n        ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING\n    ) {\n        /**\n         * substr() implementation that isn't brittle to mbstring.func_overload\n         *\n         * This version uses mb_substr() in '8bit' mode to treat strings as raw\n         * binary rather than UTF-8, ISO-8859-1, etc\n         *\n         * @param string $binary_string\n         * @param int $start\n         * @param int $length (optional)\n         *\n         * @throws TypeError\n         *\n         * @return string\n         */\n        function RandomCompat_substr($binary_string, $start, $length = null)\n        {\n            if (!is_string($binary_string)) {\n                throw new TypeError(\n                    'RandomCompat_substr(): First argument should be a string'\n                );\n            }\n\n            if (!is_int($start)) {\n                throw new TypeError(\n                    'RandomCompat_substr(): Second argument should be an integer'\n                );\n            }\n\n            if ($length === null) {\n                /**\n                 * mb_substr($str, 0, NULL, '8bit') returns an empty string on\n                 * PHP 5.3, so we have to find the length ourselves.\n                 */\n                $length = RandomCompat_strlen($binary_string) - $start;\n            } elseif (!is_int($length)) {\n                throw new TypeError(\n                    'RandomCompat_substr(): Third argument should be an integer, or omitted'\n                );\n            }\n\n            // Consistency with PHP's behavior\n            if ($start === RandomCompat_strlen($binary_string) && $length === 0) {\n                return '';\n            }\n            if ($start > RandomCompat_strlen($binary_string)) {\n                return '';\n            }\n\n            return (string) mb_substr($binary_string, $start, $length, '8bit');\n        }\n\n    } else {\n\n        /**\n         * substr() implementation that isn't brittle to mbstring.func_overload\n         *\n         * This version just uses the default substr()\n         *\n         * @param string $binary_string\n         * @param int $start\n         * @param int $length (optional)\n         *\n         * @throws TypeError\n         *\n         * @return string\n         */\n        function RandomCompat_substr($binary_string, $start, $length = null)\n        {\n            if (!is_string($binary_string)) {\n                throw new TypeError(\n                    'RandomCompat_substr(): First argument should be a string'\n                );\n            }\n\n            if (!is_int($start)) {\n                throw new TypeError(\n                    'RandomCompat_substr(): Second argument should be an integer'\n                );\n            }\n\n            if ($length !== null) {\n                if (!is_int($length)) {\n                    throw new TypeError(\n                        'RandomCompat_substr(): Third argument should be an integer, or omitted'\n                    );\n                }\n\n                return (string) substr($binary_string, $start, $length);\n            }\n\n            return (string) substr($binary_string, $start);\n        }\n    }\n}\n", "num_lines": 182}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Random_* Compatibility Library\n * for using the new PHP 7 random_* API in PHP 5 projects\n *\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 - 2017 Paragon Initiative Enterprises\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nif (!is_callable('RandomCompat_intval')) {\n    \n    /**\n     * Cast to an integer if we can, safely.\n     * \n     * If you pass it a float in the range (~PHP_INT_MAX, PHP_INT_MAX)\n     * (non-inclusive), it will sanely cast it to an int. If you it's equal to\n     * ~PHP_INT_MAX or PHP_INT_MAX, we let it fail as not an integer. Floats \n     * lose precision, so the <= and => operators might accidentally let a float\n     * through.\n     * \n     * @param int|float $number    The number we want to convert to an int\n     * @param bool      $fail_open Set to true to not throw an exception\n     * \n     * @return float|int\n     * @psalm-suppress InvalidReturnType\n     *\n     * @throws TypeError\n     */\n    function RandomCompat_intval($number, $fail_open = false)\n    {\n        if (is_int($number) || is_float($number)) {\n            $number += 0;\n        } elseif (is_numeric($number)) {\n            $number += 0;\n        }\n\n        if (\n            is_float($number)\n            &&\n            $number > ~PHP_INT_MAX\n            &&\n            $number < PHP_INT_MAX\n        ) {\n            $number = (int) $number;\n        }\n\n        if (is_int($number)) {\n            return (int) $number;\n        } elseif (!$fail_open) {\n            throw new TypeError(\n                'Expected an integer.'\n            );\n        }\n        return $number;\n    }\n}\n", "num_lines": 76}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Random_* Compatibility Library \n * for using the new PHP 7 random_* API in PHP 5 projects\n * \n * The MIT License (MIT)\n *\n * Copyright (c) 2015 - 2017 Paragon Initiative Enterprises\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nif (!class_exists('Error', false)) {\n    // We can't really avoid making this extend Exception in PHP 5.\n    class Error extends Exception\n    {\n        \n    }\n}\n\nif (!class_exists('TypeError', false)) {\n    if (is_subclass_of('Error', 'Exception')) {\n        class TypeError extends Error\n        {\n            \n        }\n    } else {\n        class TypeError extends Exception\n        {\n            \n        }\n    }\n}\n", "num_lines": 50}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Random_* Compatibility Library\n * for using the new PHP 7 random_* API in PHP 5 projects\n *\n * @version 2.0.10\n * @released 2017-03-13\n *\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 - 2017 Paragon Initiative Enterprises\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nif (!defined('PHP_VERSION_ID')) {\n    // This constant was introduced in PHP 5.2.7\n    $RandomCompatversion = array_map('intval', explode('.', PHP_VERSION));\n    define(\n        'PHP_VERSION_ID',\n        $RandomCompatversion[0] * 10000\n        + $RandomCompatversion[1] * 100\n        + $RandomCompatversion[2]\n    );\n    $RandomCompatversion = null;\n}\n\n/**\n * PHP 7.0.0 and newer have these functions natively.\n */\nif (PHP_VERSION_ID >= 70000) {\n    return;\n}\n\nif (!defined('RANDOM_COMPAT_READ_BUFFER')) {\n    define('RANDOM_COMPAT_READ_BUFFER', 8);\n}\n\n$RandomCompatDIR = dirname(__FILE__);\n\nrequire_once $RandomCompatDIR . '/byte_safe_strings.php';\nrequire_once $RandomCompatDIR . '/cast_to_int.php';\nrequire_once $RandomCompatDIR . '/error_polyfill.php';\n\nif (!is_callable('random_bytes')) {\n    /**\n     * PHP 5.2.0 - 5.6.x way to implement random_bytes()\n     *\n     * We use conditional statements here to define the function in accordance\n     * to the operating environment. It's a micro-optimization.\n     *\n     * In order of preference:\n     *   1. Use libsodium if available.\n     *   2. fread() /dev/urandom if available (never on Windows)\n     *   3. mcrypt_create_iv($bytes, MCRYPT_DEV_URANDOM)\n     *   4. COM('CAPICOM.Utilities.1')->GetRandom()\n     *\n     * See RATIONALE.md for our reasoning behind this particular order\n     */\n    if (extension_loaded('libsodium')) {\n        // See random_bytes_libsodium.php\n        if (PHP_VERSION_ID >= 50300 && is_callable('\\\\Sodium\\\\randombytes_buf')) {\n            require_once $RandomCompatDIR . '/random_bytes_libsodium.php';\n        } elseif (method_exists('Sodium', 'randombytes_buf')) {\n            require_once $RandomCompatDIR . '/random_bytes_libsodium_legacy.php';\n        }\n    }\n\n    /**\n     * Reading directly from /dev/urandom:\n     */\n    if (DIRECTORY_SEPARATOR === '/') {\n        // DIRECTORY_SEPARATOR === '/' on Unix-like OSes -- this is a fast\n        // way to exclude Windows.\n        $RandomCompatUrandom = true;\n        $RandomCompat_basedir = ini_get('open_basedir');\n\n        if (!empty($RandomCompat_basedir)) {\n            $RandomCompat_open_basedir = explode(\n                PATH_SEPARATOR,\n                strtolower($RandomCompat_basedir)\n            );\n            $RandomCompatUrandom = (array() !== array_intersect(\n                array('/dev', '/dev/', '/dev/urandom'),\n                $RandomCompat_open_basedir\n            ));\n            $RandomCompat_open_basedir = null;\n        }\n\n        if (\n            !is_callable('random_bytes')\n            &&\n            $RandomCompatUrandom\n            &&\n            @is_readable('/dev/urandom')\n        ) {\n            // Error suppression on is_readable() in case of an open_basedir\n            // or safe_mode failure. All we care about is whether or not we\n            // can read it at this point. If the PHP environment is going to\n            // panic over trying to see if the file can be read in the first\n            // place, that is not helpful to us here.\n\n            // See random_bytes_dev_urandom.php\n            require_once $RandomCompatDIR . '/random_bytes_dev_urandom.php';\n        }\n        // Unset variables after use\n        $RandomCompat_basedir = null;\n    } else {\n        $RandomCompatUrandom = false;\n    }\n\n    /**\n     * mcrypt_create_iv()\n     *\n     * We only want to use mcypt_create_iv() if:\n     *\n     * - random_bytes() hasn't already been defined\n     * - the mcrypt extensions is loaded\n     * - One of these two conditions is true:\n     *   - We're on Windows (DIRECTORY_SEPARATOR !== '/')\n     *   - We're not on Windows and /dev/urandom is readabale\n     *     (i.e. we're not in a chroot jail)\n     * - Special case:\n     *   - If we're not on Windows, but the PHP version is between\n     *     5.6.10 and 5.6.12, we don't want to use mcrypt. It will\n     *     hang indefinitely. This is bad.\n     *   - If we're on Windows, we want to use PHP >= 5.3.7 or else\n     *     we get insufficient entropy errors.\n     */\n    if (\n        !is_callable('random_bytes')\n        &&\n        // Windows on PHP < 5.3.7 is broken, but non-Windows is not known to be.\n        (DIRECTORY_SEPARATOR === '/' || PHP_VERSION_ID >= 50307)\n        &&\n        // Prevent this code from hanging indefinitely on non-Windows;\n        // see https://bugs.php.net/bug.php?id=69833\n        (\n            DIRECTORY_SEPARATOR !== '/' ||\n            (PHP_VERSION_ID <= 50609 || PHP_VERSION_ID >= 50613)\n        )\n        &&\n        extension_loaded('mcrypt')\n    ) {\n        // See random_bytes_mcrypt.php\n        require_once $RandomCompatDIR . '/random_bytes_mcrypt.php';\n    }\n    $RandomCompatUrandom = null;\n\n    /**\n     * This is a Windows-specific fallback, for when the mcrypt extension\n     * isn't loaded.\n     */\n    if (\n        !is_callable('random_bytes')\n        &&\n        extension_loaded('com_dotnet')\n        &&\n        class_exists('COM')\n    ) {\n        $RandomCompat_disabled_classes = preg_split(\n            '#\\s*,\\s*#',\n            strtolower(ini_get('disable_classes'))\n        );\n\n        if (!in_array('com', $RandomCompat_disabled_classes)) {\n            try {\n                $RandomCompatCOMtest = new COM('CAPICOM.Utilities.1');\n                if (method_exists($RandomCompatCOMtest, 'GetRandom')) {\n                    // See random_bytes_com_dotnet.php\n                    require_once $RandomCompatDIR . '/random_bytes_com_dotnet.php';\n                }\n            } catch (com_exception $e) {\n                // Don't try to use it.\n            }\n        }\n        $RandomCompat_disabled_classes = null;\n        $RandomCompatCOMtest = null;\n    }\n\n    /**\n     * throw new Exception\n     */\n    if (!is_callable('random_bytes')) {\n        /**\n         * We don't have any more options, so let's throw an exception right now\n         * and hope the developer won't let it fail silently.\n         *\n         * @param mixed $length\n         * @return void\n         * @throws Exception\n         */\n        function random_bytes($length)\n        {\n            unset($length); // Suppress \"variable not used\" warnings.\n            throw new Exception(\n                'There is no suitable CSPRNG installed on your system'\n            );\n        }\n    }\n}\n\nif (!is_callable('random_int')) {\n    require_once $RandomCompatDIR . '/random_int.php';\n}\n\n$RandomCompatDIR = null;\n", "num_lines": 224}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Random_* Compatibility Library \n * for using the new PHP 7 random_* API in PHP 5 projects\n * \n * The MIT License (MIT)\n * \n * Copyright (c) 2015 - 2017 Paragon Initiative Enterprises\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nif (!is_callable('random_bytes')) {\n    /**\n     * Windows with PHP < 5.3.0 will not have the function\n     * openssl_random_pseudo_bytes() available, so let's use\n     * CAPICOM to work around this deficiency.\n     *\n     * @param int $bytes\n     *\n     * @throws Exception\n     *\n     * @return string\n     */\n    function random_bytes($bytes)\n    {\n        try {\n            $bytes = RandomCompat_intval($bytes);\n        } catch (TypeError $ex) {\n            throw new TypeError(\n                'random_bytes(): $bytes must be an integer'\n            );\n        }\n\n        if ($bytes < 1) {\n            throw new Error(\n                'Length must be greater than 0'\n            );\n        }\n\n        $buf = '';\n        if (!class_exists('COM')) {\n            throw new Error(\n                'COM does not exist'\n            );\n        }\n        $util = new COM('CAPICOM.Utilities.1');\n        $execCount = 0;\n\n        /**\n         * Let's not let it loop forever. If we run N times and fail to\n         * get N bytes of random data, then CAPICOM has failed us.\n         */\n        do {\n            $buf .= base64_decode($util->GetRandom($bytes, 0));\n            if (RandomCompat_strlen($buf) >= $bytes) {\n                /**\n                 * Return our random entropy buffer here:\n                 */\n                return RandomCompat_substr($buf, 0, $bytes);\n            }\n            ++$execCount;\n        } while ($execCount < $bytes);\n\n        /**\n         * If we reach here, PHP has failed us.\n         */\n        throw new Exception(\n            'Could not gather sufficient random data'\n        );\n    }\n}", "num_lines": 88}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Random_* Compatibility Library \n * for using the new PHP 7 random_* API in PHP 5 projects\n * \n * The MIT License (MIT)\n *\n * Copyright (c) 2015 - 2017 Paragon Initiative Enterprises\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nif (!defined('RANDOM_COMPAT_READ_BUFFER')) {\n    define('RANDOM_COMPAT_READ_BUFFER', 8);\n}\n\nif (!is_callable('random_bytes')) {\n    /**\n     * Unless open_basedir is enabled, use /dev/urandom for\n     * random numbers in accordance with best practices\n     *\n     * Why we use /dev/urandom and not /dev/random\n     * @ref http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers\n     *\n     * @param int $bytes\n     *\n     * @throws Exception\n     *\n     * @return string\n     */\n    function random_bytes($bytes)\n    {\n        static $fp = null;\n        /**\n         * This block should only be run once\n         */\n        if (empty($fp)) {\n            /**\n             * We use /dev/urandom if it is a char device.\n             * We never fall back to /dev/random\n             */\n            $fp = fopen('/dev/urandom', 'rb');\n            if (!empty($fp)) {\n                $st = fstat($fp);\n                if (($st['mode'] & 0170000) !== 020000) {\n                    fclose($fp);\n                    $fp = false;\n                }\n            }\n\n            if (!empty($fp)) {\n                /**\n                 * stream_set_read_buffer() does not exist in HHVM\n                 *\n                 * If we don't set the stream's read buffer to 0, PHP will\n                 * internally buffer 8192 bytes, which can waste entropy\n                 *\n                 * stream_set_read_buffer returns 0 on success\n                 */\n                if (is_callable('stream_set_read_buffer')) {\n                    stream_set_read_buffer($fp, RANDOM_COMPAT_READ_BUFFER);\n                }\n                if (is_callable('stream_set_chunk_size')) {\n                    stream_set_chunk_size($fp, RANDOM_COMPAT_READ_BUFFER);\n                }\n            }\n        }\n\n        try {\n            $bytes = RandomCompat_intval($bytes);\n        } catch (TypeError $ex) {\n            throw new TypeError(\n                'random_bytes(): $bytes must be an integer'\n            );\n        }\n\n        if ($bytes < 1) {\n            throw new Error(\n                'Length must be greater than 0'\n            );\n        }\n\n        /**\n         * This if() block only runs if we managed to open a file handle\n         *\n         * It does not belong in an else {} block, because the above\n         * if (empty($fp)) line is logic that should only be run once per\n         * page load.\n         */\n        if (!empty($fp)) {\n            /**\n             * @var int\n             */\n            $remaining = $bytes;\n\n            /**\n             * @var string|bool\n             */\n            $buf = '';\n\n            /**\n             * We use fread() in a loop to protect against partial reads\n             */\n            do {\n                /**\n                 * @var string|bool\n                 */\n                $read = fread($fp, $remaining);\n                if (!is_string($read)) {\n                    if ($read === false) {\n                        /**\n                         * We cannot safely read from the file. Exit the\n                         * do-while loop and trigger the exception condition\n                         *\n                         * @var string|bool\n                         */\n                        $buf = false;\n                        break;\n                    }\n                }\n                /**\n                 * Decrease the number of bytes returned from remaining\n                 */\n                $remaining -= RandomCompat_strlen($read);\n                /**\n                 * @var string|bool\n                 */\n                $buf = $buf . $read;\n            } while ($remaining > 0);\n\n            /**\n             * Is our result valid?\n             */\n            if (is_string($buf)) {\n                if (RandomCompat_strlen($buf) === $bytes) {\n                    /**\n                     * Return our random entropy buffer here:\n                     */\n                    return $buf;\n                }\n            }\n        }\n\n        /**\n         * If we reach here, PHP has failed us.\n         */\n        throw new Exception(\n            'Error reading from source device'\n        );\n    }\n}\n", "num_lines": 168}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Random_* Compatibility Library \n * for using the new PHP 7 random_* API in PHP 5 projects\n * \n * The MIT License (MIT)\n *\n * Copyright (c) 2015 - 2017 Paragon Initiative Enterprises\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nif (!is_callable('random_bytes')) {\n    /**\n     * If the libsodium PHP extension is loaded, we'll use it above any other\n     * solution.\n     *\n     * libsodium-php project:\n     * @ref https://github.com/jedisct1/libsodium-php\n     *\n     * @param int $bytes\n     *\n     * @throws Exception\n     *\n     * @return string\n     */\n    function random_bytes($bytes)\n    {\n        try {\n            $bytes = RandomCompat_intval($bytes);\n        } catch (TypeError $ex) {\n            throw new TypeError(\n                'random_bytes(): $bytes must be an integer'\n            );\n        }\n\n        if ($bytes < 1) {\n            throw new Error(\n                'Length must be greater than 0'\n            );\n        }\n\n        /**\n         * \\Sodium\\randombytes_buf() doesn't allow more than 2147483647 bytes to be\n         * generated in one invocation.\n         */\n        if ($bytes > 2147483647) {\n            $buf = '';\n            for ($i = 0; $i < $bytes; $i += 1073741824) {\n                $n = ($bytes - $i) > 1073741824\n                    ? 1073741824\n                    : $bytes - $i;\n                $buf .= \\Sodium\\randombytes_buf($n);\n            }\n        } else {\n            $buf = \\Sodium\\randombytes_buf($bytes);\n        }\n\n        if ($buf !== false) {\n            if (RandomCompat_strlen($buf) === $bytes) {\n                return $buf;\n            }\n        }\n\n        /**\n         * If we reach here, PHP has failed us.\n         */\n        throw new Exception(\n            'Could not gather sufficient random data'\n        );\n    }\n}\n", "num_lines": 89}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Random_* Compatibility Library \n * for using the new PHP 7 random_* API in PHP 5 projects\n * \n * The MIT License (MIT)\n *\n * Copyright (c) 2015 - 2017 Paragon Initiative Enterprises\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nif (!is_callable('random_bytes')) {\n    /**\n     * If the libsodium PHP extension is loaded, we'll use it above any other\n     * solution.\n     *\n     * libsodium-php project:\n     * @ref https://github.com/jedisct1/libsodium-php\n     *\n     * @param int $bytes\n     *\n     * @throws Exception\n     *\n     * @return string\n     */\n    function random_bytes($bytes)\n    {\n        try {\n            $bytes = RandomCompat_intval($bytes);\n        } catch (TypeError $ex) {\n            throw new TypeError(\n                'random_bytes(): $bytes must be an integer'\n            );\n        }\n\n        if ($bytes < 1) {\n            throw new Error(\n                'Length must be greater than 0'\n            );\n        }\n\n        /**\n         * @var string\n         */\n        $buf = '';\n\n        /**\n         * \\Sodium\\randombytes_buf() doesn't allow more than 2147483647 bytes to be\n         * generated in one invocation.\n         */\n        if ($bytes > 2147483647) {\n            for ($i = 0; $i < $bytes; $i += 1073741824) {\n                $n = ($bytes - $i) > 1073741824\n                    ? 1073741824\n                    : $bytes - $i;\n                $buf .= Sodium::randombytes_buf((int) $n);\n            }\n        } else {\n            $buf .= Sodium::randombytes_buf((int) $bytes);\n        }\n\n        if (is_string($buf)) {\n            if (RandomCompat_strlen($buf) === $bytes) {\n                return $buf;\n            }\n        }\n\n        /**\n         * If we reach here, PHP has failed us.\n         */\n        throw new Exception(\n            'Could not gather sufficient random data'\n        );\n    }\n}\n", "num_lines": 93}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Random_* Compatibility Library \n * for using the new PHP 7 random_* API in PHP 5 projects\n * \n * The MIT License (MIT)\n *\n * Copyright (c) 2015 - 2017 Paragon Initiative Enterprises\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nif (!is_callable('random_bytes')) {\n    /**\n     * Powered by ext/mcrypt (and thankfully NOT libmcrypt)\n     *\n     * @ref https://bugs.php.net/bug.php?id=55169\n     * @ref https://github.com/php/php-src/blob/c568ffe5171d942161fc8dda066bce844bdef676/ext/mcrypt/mcrypt.c#L1321-L1386\n     *\n     * @param int $bytes\n     *\n     * @throws Exception\n     *\n     * @return string\n     */\n    function random_bytes($bytes)\n    {\n        try {\n            $bytes = RandomCompat_intval($bytes);\n        } catch (TypeError $ex) {\n            throw new TypeError(\n                'random_bytes(): $bytes must be an integer'\n            );\n        }\n\n        if ($bytes < 1) {\n            throw new Error(\n                'Length must be greater than 0'\n            );\n        }\n\n        $buf = @mcrypt_create_iv($bytes, MCRYPT_DEV_URANDOM);\n        if (\n            $buf !== false\n            &&\n            RandomCompat_strlen($buf) === $bytes\n        ) {\n            /**\n             * Return our random entropy buffer here:\n             */\n            return $buf;\n        }\n\n        /**\n         * If we reach here, PHP has failed us.\n         */\n        throw new Exception(\n            'Could not gather sufficient random data'\n        );\n    }\n}\n", "num_lines": 78}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (!is_callable('random_int')) {\n    /**\n     * Random_* Compatibility Library\n     * for using the new PHP 7 random_* API in PHP 5 projects\n     *\n     * The MIT License (MIT)\n     *\n     * Copyright (c) 2015 - 2017 Paragon Initiative Enterprises\n     *\n     * Permission is hereby granted, free of charge, to any person obtaining a copy\n     * of this software and associated documentation files (the \"Software\"), to deal\n     * in the Software without restriction, including without limitation the rights\n     * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n     * copies of the Software, and to permit persons to whom the Software is\n     * furnished to do so, subject to the following conditions:\n     *\n     * The above copyright notice and this permission notice shall be included in\n     * all copies or substantial portions of the Software.\n     *\n     * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n     * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n     * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n     * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n     * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n     * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n     * SOFTWARE.\n     */\n\n    /**\n     * Fetch a random integer between $min and $max inclusive\n     *\n     * @param int $min\n     * @param int $max\n     *\n     * @throws Exception\n     *\n     * @return int\n     */\n    function random_int($min, $max)\n    {\n        /**\n         * Type and input logic checks\n         *\n         * If you pass it a float in the range (~PHP_INT_MAX, PHP_INT_MAX)\n         * (non-inclusive), it will sanely cast it to an int. If you it's equal to\n         * ~PHP_INT_MAX or PHP_INT_MAX, we let it fail as not an integer. Floats\n         * lose precision, so the <= and => operators might accidentally let a float\n         * through.\n         */\n\n        try {\n            $min = RandomCompat_intval($min);\n        } catch (TypeError $ex) {\n            throw new TypeError(\n                'random_int(): $min must be an integer'\n            );\n        }\n\n        try {\n            $max = RandomCompat_intval($max);\n        } catch (TypeError $ex) {\n            throw new TypeError(\n                'random_int(): $max must be an integer'\n            );\n        }\n\n        /**\n         * Now that we've verified our weak typing system has given us an integer,\n         * let's validate the logic then we can move forward with generating random\n         * integers along a given range.\n         */\n        if ($min > $max) {\n            throw new Error(\n                'Minimum value must be less than or equal to the maximum value'\n            );\n        }\n\n        if ($max === $min) {\n            return (int) $min;\n        }\n\n        /**\n         * Initialize variables to 0\n         *\n         * We want to store:\n         * $bytes => the number of random bytes we need\n         * $mask => an integer bitmask (for use with the &) operator\n         *          so we can minimize the number of discards\n         */\n        $attempts = $bits = $bytes = $mask = $valueShift = 0;\n\n        /**\n         * At this point, $range is a positive number greater than 0. It might\n         * overflow, however, if $max - $min > PHP_INT_MAX. PHP will cast it to\n         * a float and we will lose some precision.\n         */\n        $range = $max - $min;\n\n        /**\n         * Test for integer overflow:\n         */\n        if (!is_int($range)) {\n\n            /**\n             * Still safely calculate wider ranges.\n             * Provided by @CodesInChaos, @oittaa\n             *\n             * @ref https://gist.github.com/CodesInChaos/03f9ea0b58e8b2b8d435\n             *\n             * We use ~0 as a mask in this case because it generates all 1s\n             *\n             * @ref https://eval.in/400356 (32-bit)\n             * @ref http://3v4l.org/XX9r5  (64-bit)\n             */\n            $bytes = PHP_INT_SIZE;\n            $mask = ~0;\n\n        } else {\n\n            /**\n             * $bits is effectively ceil(log($range, 2)) without dealing with\n             * type juggling\n             */\n            while ($range > 0) {\n                if ($bits % 8 === 0) {\n                    ++$bytes;\n                }\n                ++$bits;\n                $range >>= 1;\n                $mask = $mask << 1 | 1;\n            }\n            $valueShift = $min;\n        }\n\n        $val = 0;\n        /**\n         * Now that we have our parameters set up, let's begin generating\n         * random integers until one falls between $min and $max\n         */\n        do {\n            /**\n             * The rejection probability is at most 0.5, so this corresponds\n             * to a failure probability of 2^-128 for a working RNG\n             */\n            if ($attempts > 128) {\n                throw new Exception(\n                    'random_int: RNG is broken - too many rejections'\n                );\n            }\n\n            /**\n             * Let's grab the necessary number of random bytes\n             */\n            $randomByteString = random_bytes($bytes);\n\n            /**\n             * Let's turn $randomByteString into an integer\n             *\n             * This uses bitwise operators (<< and |) to build an integer\n             * out of the values extracted from ord()\n             *\n             * Example: [9F] | [6D] | [32] | [0C] =>\n             *   159 + 27904 + 3276800 + 201326592 =>\n             *   204631455\n             */\n            $val &= 0;\n            for ($i = 0; $i < $bytes; ++$i) {\n                $val |= ord($randomByteString[$i]) << ($i * 8);\n            }\n\n            /**\n             * Apply mask\n             */\n            $val &= $mask;\n            $val += $valueShift;\n\n            ++$attempts;\n            /**\n             * If $val overflows to a floating point number,\n             * ... or is larger than $max,\n             * ... or smaller than $min,\n             * then try again.\n             */\n        } while (!is_int($val) || $val > $max || $val < $min);\n\n        return (int) $val;\n    }\n}\n", "num_lines": 191}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Authentication provider interface\n *\n * @package Requests\n * @subpackage Authentication\n */\n\n/**\n * Authentication provider interface\n *\n * Implement this interface to act as an authentication provider.\n *\n * Parameters should be passed via the constructor where possible, as this\n * makes it much easier for users to use your provider.\n *\n * @see Requests_Hooks\n * @package Requests\n * @subpackage Authentication\n */\ninterface Requests_Auth {\n\t/**\n\t * Register hooks as needed\n\t *\n\t * This method is called in {@see Requests::request} when the user has set\n\t * an instance as the 'auth' option. Use this callback to register all the\n\t * hooks you'll need.\n\t *\n\t * @see Requests_Hooks::register\n\t * @param Requests_Hooks $hooks Hook system\n\t */\n\tpublic function register(Requests_Hooks &$hooks);\n}", "num_lines": 33}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Cookie storage object\n *\n * @package Requests\n * @subpackage Cookies\n */\n\n/**\n * Cookie storage object\n *\n * @package Requests\n * @subpackage Cookies\n */\nclass Requests_Cookie {\n\t/**\n\t * Cookie name.\n\t *\n\t * @var string\n\t */\n\tpublic $name;\n\n\t/**\n\t * Cookie value.\n\t *\n\t * @var string\n\t */\n\tpublic $value;\n\n\t/**\n\t * Cookie attributes\n\t *\n\t * Valid keys are (currently) path, domain, expires, max-age, secure and\n\t * httponly.\n\t *\n\t * @var Requests_Utility_CaseInsensitiveDictionary|array Array-like object\n\t */\n\tpublic $attributes = array();\n\n\t/**\n\t * Cookie flags\n\t *\n\t * Valid keys are (currently) creation, last-access, persistent and\n\t * host-only.\n\t *\n\t * @var array\n\t */\n\tpublic $flags = array();\n\n\t/**\n\t * Reference time for relative calculations\n\t *\n\t * This is used in place of `time()` when calculating Max-Age expiration and\n\t * checking time validity.\n\t *\n\t * @var int\n\t */\n\tpublic $reference_time = 0;\n\n\t/**\n\t * Create a new cookie object\n\t *\n\t * @param string $name\n\t * @param string $value\n\t * @param array|Requests_Utility_CaseInsensitiveDictionary $attributes Associative array of attribute data\n\t */\n\tpublic function __construct($name, $value, $attributes = array(), $flags = array(), $reference_time = null) {\n\t\t$this->name = $name;\n\t\t$this->value = $value;\n\t\t$this->attributes = $attributes;\n\t\t$default_flags = array(\n\t\t\t'creation' => time(),\n\t\t\t'last-access' => time(),\n\t\t\t'persistent' => false,\n\t\t\t'host-only' => true,\n\t\t);\n\t\t$this->flags = array_merge($default_flags, $flags);\n\n\t\t$this->reference_time = time();\n\t\tif ($reference_time !== null) {\n\t\t\t$this->reference_time = $reference_time;\n\t\t}\n\n\t\t$this->normalize();\n\t}\n\n\t/**\n\t * Check if a cookie is expired.\n\t *\n\t * Checks the age against $this->reference_time to determine if the cookie\n\t * is expired.\n\t *\n\t * @return boolean True if expired, false if time is valid.\n\t */\n\tpublic function is_expired() {\n\t\t// RFC6265, s. 4.1.2.2:\n\t\t// If a cookie has both the Max-Age and the Expires attribute, the Max-\n\t\t// Age attribute has precedence and controls the expiration date of the\n\t\t// cookie.\n\t\tif (isset($this->attributes['max-age'])) {\n\t\t\t$max_age = $this->attributes['max-age'];\n\t\t\treturn $max_age < $this->reference_time;\n\t\t}\n\n\t\tif (isset($this->attributes['expires'])) {\n\t\t\t$expires = $this->attributes['expires'];\n\t\t\treturn $expires < $this->reference_time;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Check if a cookie is valid for a given URI\n\t *\n\t * @param Requests_IRI $uri URI to check\n\t * @return boolean Whether the cookie is valid for the given URI\n\t */\n\tpublic function uri_matches(Requests_IRI $uri) {\n\t\tif (!$this->domain_matches($uri->host)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$this->path_matches($uri->path)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn empty($this->attributes['secure']) || $uri->scheme === 'https';\n\t}\n\n\t/**\n\t * Check if a cookie is valid for a given domain\n\t *\n\t * @param string $string Domain to check\n\t * @return boolean Whether the cookie is valid for the given domain\n\t */\n\tpublic function domain_matches($string) {\n\t\tif (!isset($this->attributes['domain'])) {\n\t\t\t// Cookies created manually; cookies created by Requests will set\n\t\t\t// the domain to the requested domain\n\t\t\treturn true;\n\t\t}\n\n\t\t$domain_string = $this->attributes['domain'];\n\t\tif ($domain_string === $string) {\n\t\t\t// The domain string and the string are identical.\n\t\t\treturn true;\n\t\t}\n\n\t\t// If the cookie is marked as host-only and we don't have an exact\n\t\t// match, reject the cookie\n\t\tif ($this->flags['host-only'] === true) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (strlen($string) <= strlen($domain_string)) {\n\t\t\t// For obvious reasons, the string cannot be a suffix if the domain\n\t\t\t// is shorter than the domain string\n\t\t\treturn false;\n\t\t}\n\n\t\tif (substr($string, -1 * strlen($domain_string)) !== $domain_string) {\n\t\t\t// The domain string should be a suffix of the string.\n\t\t\treturn false;\n\t\t}\n\n\t\t$prefix = substr($string, 0, strlen($string) - strlen($domain_string));\n\t\tif (substr($prefix, -1) !== '.') {\n\t\t\t// The last character of the string that is not included in the\n\t\t\t// domain string should be a %x2E (\".\") character.\n\t\t\treturn false;\n\t\t}\n\n\t\t// The string should be a host name (i.e., not an IP address).\n\t\treturn !preg_match('#^(.+\\.)\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$#', $string);\n\t}\n\n\t/**\n\t * Check if a cookie is valid for a given path\n\t *\n\t * From the path-match check in RFC 6265 section 5.1.4\n\t *\n\t * @param string $request_path Path to check\n\t * @return boolean Whether the cookie is valid for the given path\n\t */\n\tpublic function path_matches($request_path) {\n\t\tif (empty($request_path)) {\n\t\t\t// Normalize empty path to root\n\t\t\t$request_path = '/';\n\t\t}\n\n\t\tif (!isset($this->attributes['path'])) {\n\t\t\t// Cookies created manually; cookies created by Requests will set\n\t\t\t// the path to the requested path\n\t\t\treturn true;\n\t\t}\n\n\t\t$cookie_path = $this->attributes['path'];\n\n\t\tif ($cookie_path === $request_path) {\n\t\t\t// The cookie-path and the request-path are identical.\n\t\t\treturn true;\n\t\t}\n\n\t\tif (strlen($request_path) > strlen($cookie_path) && substr($request_path, 0, strlen($cookie_path)) === $cookie_path) {\n\t\t\tif (substr($cookie_path, -1) === '/') {\n\t\t\t\t// The cookie-path is a prefix of the request-path, and the last\n\t\t\t\t// character of the cookie-path is %x2F (\"/\").\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (substr($request_path, strlen($cookie_path), 1) === '/') {\n\t\t\t\t// The cookie-path is a prefix of the request-path, and the\n\t\t\t\t// first character of the request-path that is not included in\n\t\t\t\t// the cookie-path is a %x2F (\"/\") character.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Normalize cookie and attributes\n\t *\n\t * @return boolean Whether the cookie was successfully normalized\n\t */\n\tpublic function normalize() {\n\t\tforeach ($this->attributes as $key => $value) {\n\t\t\t$orig_value = $value;\n\t\t\t$value = $this->normalize_attribute($key, $value);\n\t\t\tif ($value === null) {\n\t\t\t\tunset($this->attributes[$key]);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($value !== $orig_value) {\n\t\t\t\t$this->attributes[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Parse an individual cookie attribute\n\t *\n\t * Handles parsing individual attributes from the cookie values.\n\t *\n\t * @param string $name Attribute name\n\t * @param string|boolean $value Attribute value (string value, or true if empty/flag)\n\t * @return mixed Value if available, or null if the attribute value is invalid (and should be skipped)\n\t */\n\tprotected function normalize_attribute($name, $value) {\n\t\tswitch (strtolower($name)) {\n\t\t\tcase 'expires':\n\t\t\t\t// Expiration parsing, as per RFC 6265 section 5.2.1\n\t\t\t\tif (is_int($value)) {\n\t\t\t\t\treturn $value;\n\t\t\t\t}\n\n\t\t\t\t$expiry_time = strtotime($value);\n\t\t\t\tif ($expiry_time === false) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn $expiry_time;\n\n\t\t\tcase 'max-age':\n\t\t\t\t// Expiration parsing, as per RFC 6265 section 5.2.2\n\t\t\t\tif (is_int($value)) {\n\t\t\t\t\treturn $value;\n\t\t\t\t}\n\n\t\t\t\t// Check that we have a valid age\n\t\t\t\tif (!preg_match('/^-?\\d+$/', $value)) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t$delta_seconds = (int) $value;\n\t\t\t\tif ($delta_seconds <= 0) {\n\t\t\t\t\t$expiry_time = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$expiry_time = $this->reference_time + $delta_seconds;\n\t\t\t\t}\n\n\t\t\t\treturn $expiry_time;\n\n\t\t\tcase 'domain':\n\t\t\t\t// Domains are not required as per RFC 6265 section 5.2.3\n\t\t\t\tif (empty($value)) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// Domain normalization, as per RFC 6265 section 5.2.3\n\t\t\t\tif ($value[0] === '.') {\n\t\t\t\t\t$value = substr($value, 1);\n\t\t\t\t}\n\n\t\t\t\treturn $value;\n\n\t\t\tdefault:\n\t\t\t\treturn $value;\n\t\t}\n\t}\n\n\t/**\n\t * Format a cookie for a Cookie header\n\t *\n\t * This is used when sending cookies to a server.\n\t *\n\t * @return string Cookie formatted for Cookie header\n\t */\n\tpublic function format_for_header() {\n\t\treturn sprintf('%s=%s', $this->name, $this->value);\n\t}\n\n\t/**\n\t * Format a cookie for a Cookie header\n\t *\n\t * @codeCoverageIgnore\n\t * @deprecated Use {@see Requests_Cookie::format_for_header}\n\t * @return string\n\t */\n\tpublic function formatForHeader() {\n\t\treturn $this->format_for_header();\n\t}\n\n\t/**\n\t * Format a cookie for a Set-Cookie header\n\t *\n\t * This is used when sending cookies to clients. This isn't really\n\t * applicable to client-side usage, but might be handy for debugging.\n\t *\n\t * @return string Cookie formatted for Set-Cookie header\n\t */\n\tpublic function format_for_set_cookie() {\n\t\t$header_value = $this->format_for_header();\n\t\tif (!empty($this->attributes)) {\n\t\t\t$parts = array();\n\t\t\tforeach ($this->attributes as $key => $value) {\n\t\t\t\t// Ignore non-associative attributes\n\t\t\t\tif (is_numeric($key)) {\n\t\t\t\t\t$parts[] = $value;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$parts[] = sprintf('%s=%s', $key, $value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$header_value .= '; ' . implode('; ', $parts);\n\t\t}\n\t\treturn $header_value;\n\t}\n\n\t/**\n\t * Format a cookie for a Set-Cookie header\n\t *\n\t * @codeCoverageIgnore\n\t * @deprecated Use {@see Requests_Cookie::format_for_set_cookie}\n\t * @return string\n\t */\n\tpublic function formatForSetCookie() {\n\t\treturn $this->format_for_set_cookie();\n\t}\n\n\t/**\n\t * Get the cookie value\n\t *\n\t * Attributes and other data can be accessed via methods.\n\t */\n\tpublic function __toString() {\n\t\treturn $this->value;\n\t}\n\n\t/**\n\t * Parse a cookie string into a cookie object\n\t *\n\t * Based on Mozilla's parsing code in Firefox and related projects, which\n\t * is an intentional deviation from RFC 2109 and RFC 2616. RFC 6265\n\t * specifies some of this handling, but not in a thorough manner.\n\t *\n\t * @param string Cookie header value (from a Set-Cookie header)\n\t * @return Requests_Cookie Parsed cookie object\n\t */\n\tpublic static function parse($string, $name = '', $reference_time = null) {\n\t\t$parts = explode(';', $string);\n\t\t$kvparts = array_shift($parts);\n\n\t\tif (!empty($name)) {\n\t\t\t$value = $string;\n\t\t}\n\t\telseif (strpos($kvparts, '=') === false) {\n\t\t\t// Some sites might only have a value without the equals separator.\n\t\t\t// Deviate from RFC 6265 and pretend it was actually a blank name\n\t\t\t// (`=foo`)\n\t\t\t//\n\t\t\t// https://bugzilla.mozilla.org/show_bug.cgi?id=169091\n\t\t\t$name = '';\n\t\t\t$value = $kvparts;\n\t\t}\n\t\telse {\n\t\t\tlist($name, $value) = explode('=', $kvparts, 2);\n\t\t}\n\t\t$name = trim($name);\n\t\t$value = trim($value);\n\n\t\t// Attribute key are handled case-insensitively\n\t\t$attributes = new Requests_Utility_CaseInsensitiveDictionary();\n\n\t\tif (!empty($parts)) {\n\t\t\tforeach ($parts as $part) {\n\t\t\t\tif (strpos($part, '=') === false) {\n\t\t\t\t\t$part_key = $part;\n\t\t\t\t\t$part_value = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tlist($part_key, $part_value) = explode('=', $part, 2);\n\t\t\t\t\t$part_value = trim($part_value);\n\t\t\t\t}\n\n\t\t\t\t$part_key = trim($part_key);\n\t\t\t\t$attributes[$part_key] = $part_value;\n\t\t\t}\n\t\t}\n\n\t\treturn new Requests_Cookie($name, $value, $attributes, array(), $reference_time);\n\t}\n\n\t/**\n\t * Parse all Set-Cookie headers from request headers\n\t *\n\t * @param Requests_Response_Headers $headers Headers to parse from\n\t * @param Requests_IRI|null $origin URI for comparing cookie origins\n\t * @param int|null $time Reference time for expiration calculation\n\t * @return array\n\t */\n\tpublic static function parse_from_headers(Requests_Response_Headers $headers, Requests_IRI $origin = null, $time = null) {\n\t\t$cookie_headers = $headers->getValues('Set-Cookie');\n\t\tif (empty($cookie_headers)) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$cookies = array();\n\t\tforeach ($cookie_headers as $header) {\n\t\t\t$parsed = self::parse($header, '', $time);\n\n\t\t\t// Default domain/path attributes\n\t\t\tif (empty($parsed->attributes['domain']) && !empty($origin)) {\n\t\t\t\t$parsed->attributes['domain'] = $origin->host;\n\t\t\t\t$parsed->flags['host-only'] = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$parsed->flags['host-only'] = false;\n\t\t\t}\n\n\t\t\t$path_is_valid = (!empty($parsed->attributes['path']) && $parsed->attributes['path'][0] === '/');\n\t\t\tif (!$path_is_valid && !empty($origin)) {\n\t\t\t\t$path = $origin->path;\n\n\t\t\t\t// Default path normalization as per RFC 6265 section 5.1.4\n\t\t\t\tif (substr($path, 0, 1) !== '/') {\n\t\t\t\t\t// If the uri-path is empty or if the first character of\n\t\t\t\t\t// the uri-path is not a %x2F (\"/\") character, output\n\t\t\t\t\t// %x2F (\"/\") and skip the remaining steps.\n\t\t\t\t\t$path = '/';\n\t\t\t\t}\n\t\t\t\telseif (substr_count($path, '/') === 1) {\n\t\t\t\t\t// If the uri-path contains no more than one %x2F (\"/\")\n\t\t\t\t\t// character, output %x2F (\"/\") and skip the remaining\n\t\t\t\t\t// step.\n\t\t\t\t\t$path = '/';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Output the characters of the uri-path from the first\n\t\t\t\t\t// character up to, but not including, the right-most\n\t\t\t\t\t// %x2F (\"/\").\n\t\t\t\t\t$path = substr($path, 0, strrpos($path, '/'));\n\t\t\t\t}\n\t\t\t\t$parsed->attributes['path'] = $path;\n\t\t\t}\n\n\t\t\t// Reject invalid cookie domains\n\t\t\tif (!empty($origin) && !$parsed->domain_matches($origin->host)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$cookies[$parsed->name] = $parsed;\n\t\t}\n\n\t\treturn $cookies;\n\t}\n\n\t/**\n\t * Parse all Set-Cookie headers from request headers\n\t *\n\t * @codeCoverageIgnore\n\t * @deprecated Use {@see Requests_Cookie::parse_from_headers}\n\t * @return string\n\t */\n\tpublic static function parseFromHeaders(Requests_Response_Headers $headers) {\n\t\treturn self::parse_from_headers($headers);\n\t}\n}\n", "num_lines": 506}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for HTTP requests\n *\n * @package Requests\n */\n\n/**\n * Exception for HTTP requests\n *\n * @package Requests\n */\nclass Requests_Exception extends Exception {\n\t/**\n\t * Type of exception\n\t *\n\t * @var string\n\t */\n\tprotected $type;\n\n\t/**\n\t * Data associated with the exception\n\t *\n\t * @var mixed\n\t */\n\tprotected $data;\n\n\t/**\n\t * Create a new exception\n\t *\n\t * @param string $message Exception message\n\t * @param string $type Exception type\n\t * @param mixed $data Associated data\n\t * @param integer $code Exception numerical code, if applicable\n\t */\n\tpublic function __construct($message, $type, $data = null, $code = 0) {\n\t\tparent::__construct($message, $code);\n\n\t\t$this->type = $type;\n\t\t$this->data = $data;\n\t}\n\n\t/**\n\t * Like {@see getCode()}, but a string code.\n\t *\n\t * @codeCoverageIgnore\n\t * @return string\n\t */\n\tpublic function getType() {\n\t\treturn $this->type;\n\t}\n\n\t/**\n\t * Gives any relevant data\n\t *\n\t * @codeCoverageIgnore\n\t * @return mixed\n\t */\n\tpublic function getData() {\n\t\treturn $this->data;\n\t}\n}", "num_lines": 62}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Event dispatcher\n *\n * @package Requests\n * @subpackage Utilities\n */\n\n/**\n * Event dispatcher\n *\n * @package Requests\n * @subpackage Utilities\n */\ninterface Requests_Hooker {\n\t/**\n\t * Register a callback for a hook\n\t *\n\t * @param string $hook Hook name\n\t * @param callback $callback Function/method to call on event\n\t * @param int $priority Priority number. <0 is executed earlier, >0 is executed later\n\t */\n\tpublic function register($hook, $callback, $priority = 0);\n\n\t/**\n\t * Dispatch a message\n\t *\n\t * @param string $hook Hook name\n\t * @param array $parameters Parameters to pass to callbacks\n\t * @return boolean Successfulness\n\t */\n\tpublic function dispatch($hook, $parameters = array());\n}", "num_lines": 33}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Handles adding and dispatching events\n *\n * @package Requests\n * @subpackage Utilities\n */\n\n/**\n * Handles adding and dispatching events\n *\n * @package Requests\n * @subpackage Utilities\n */\nclass Requests_Hooks implements Requests_Hooker {\n\t/**\n\t * Registered callbacks for each hook\n\t *\n\t * @var array\n\t */\n\tprotected $hooks = array();\n\n\t/**\n\t * Constructor\n\t */\n\tpublic function __construct() {\n\t\t// pass\n\t}\n\n\t/**\n\t * Register a callback for a hook\n\t *\n\t * @param string $hook Hook name\n\t * @param callback $callback Function/method to call on event\n\t * @param int $priority Priority number. <0 is executed earlier, >0 is executed later\n\t */\n\tpublic function register($hook, $callback, $priority = 0) {\n\t\tif (!isset($this->hooks[$hook])) {\n\t\t\t$this->hooks[$hook] = array();\n\t\t}\n\t\tif (!isset($this->hooks[$hook][$priority])) {\n\t\t\t$this->hooks[$hook][$priority] = array();\n\t\t}\n\n\t\t$this->hooks[$hook][$priority][] = $callback;\n\t}\n\n\t/**\n\t * Dispatch a message\n\t *\n\t * @param string $hook Hook name\n\t * @param array $parameters Parameters to pass to callbacks\n\t * @return boolean Successfulness\n\t */\n\tpublic function dispatch($hook, $parameters = array()) {\n\t\tif (empty($this->hooks[$hook])) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ($this->hooks[$hook] as $priority => $hooked) {\n\t\t\tforeach ($hooked as $callback) {\n\t\t\t\tcall_user_func_array($callback, $parameters);\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n}", "num_lines": 68}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * IDNA URL encoder\n *\n * Note: Not fully compliant, as nameprep does nothing yet.\n *\n * @package Requests\n * @subpackage Utilities\n * @see https://tools.ietf.org/html/rfc3490 IDNA specification\n * @see https://tools.ietf.org/html/rfc3492 Punycode/Bootstrap specification\n */\nclass Requests_IDNAEncoder {\n\t/**\n\t * ACE prefix used for IDNA\n\t *\n\t * @see https://tools.ietf.org/html/rfc3490#section-5\n\t * @var string\n\t */\n\tconst ACE_PREFIX = 'xn--';\n\n\t/**#@+\n\t * Bootstrap constant for Punycode\n\t *\n\t * @see https://tools.ietf.org/html/rfc3492#section-5\n\t * @var int\n\t */\n\tconst BOOTSTRAP_BASE         = 36;\n\tconst BOOTSTRAP_TMIN         = 1;\n\tconst BOOTSTRAP_TMAX         = 26;\n\tconst BOOTSTRAP_SKEW         = 38;\n\tconst BOOTSTRAP_DAMP         = 700;\n\tconst BOOTSTRAP_INITIAL_BIAS = 72;\n\tconst BOOTSTRAP_INITIAL_N    = 128;\n\t/**#@-*/\n\n\t/**\n\t * Encode a hostname using Punycode\n\t *\n\t * @param string $string Hostname\n\t * @return string Punycode-encoded hostname\n\t */\n\tpublic static function encode($string) {\n\t\t$parts = explode('.', $string);\n\t\tforeach ($parts as &$part) {\n\t\t\t$part = self::to_ascii($part);\n\t\t}\n\t\treturn implode('.', $parts);\n\t}\n\n\t/**\n\t * Convert a UTF-8 string to an ASCII string using Punycode\n\t *\n\t * @throws Requests_Exception Provided string longer than 64 ASCII characters (`idna.provided_too_long`)\n\t * @throws Requests_Exception Prepared string longer than 64 ASCII characters (`idna.prepared_too_long`)\n\t * @throws Requests_Exception Provided string already begins with xn-- (`idna.provided_is_prefixed`)\n\t * @throws Requests_Exception Encoded string longer than 64 ASCII characters (`idna.encoded_too_long`)\n\t *\n\t * @param string $string ASCII or UTF-8 string (max length 64 characters)\n\t * @return string ASCII string\n\t */\n\tpublic static function to_ascii($string) {\n\t\t// Step 1: Check if the string is already ASCII\n\t\tif (self::is_ascii($string)) {\n\t\t\t// Skip to step 7\n\t\t\tif (strlen($string) < 64) {\n\t\t\t\treturn $string;\n\t\t\t}\n\n\t\t\tthrow new Requests_Exception('Provided string is too long', 'idna.provided_too_long', $string);\n\t\t}\n\n\t\t// Step 2: nameprep\n\t\t$string = self::nameprep($string);\n\n\t\t// Step 3: UseSTD3ASCIIRules is false, continue\n\t\t// Step 4: Check if it's ASCII now\n\t\tif (self::is_ascii($string)) {\n\t\t\t// Skip to step 7\n\t\t\tif (strlen($string) < 64) {\n\t\t\t\treturn $string;\n\t\t\t}\n\n\t\t\tthrow new Requests_Exception('Prepared string is too long', 'idna.prepared_too_long', $string);\n\t\t}\n\n\t\t// Step 5: Check ACE prefix\n\t\tif (strpos($string, self::ACE_PREFIX) === 0) {\n\t\t\tthrow new Requests_Exception('Provided string begins with ACE prefix', 'idna.provided_is_prefixed', $string);\n\t\t}\n\n\t\t// Step 6: Encode with Punycode\n\t\t$string = self::punycode_encode($string);\n\n\t\t// Step 7: Prepend ACE prefix\n\t\t$string = self::ACE_PREFIX . $string;\n\n\t\t// Step 8: Check size\n\t\tif (strlen($string) < 64) {\n\t\t\treturn $string;\n\t\t}\n\n\t\tthrow new Requests_Exception('Encoded string is too long', 'idna.encoded_too_long', $string);\n\t}\n\n\t/**\n\t * Check whether a given string contains only ASCII characters\n\t *\n\t * @internal (Testing found regex was the fastest implementation)\n\t *\n\t * @param string $string\n\t * @return bool Is the string ASCII-only?\n\t */\n\tprotected static function is_ascii($string) {\n\t\treturn (preg_match('/(?:[^\\x00-\\x7F])/', $string) !== 1);\n\t}\n\n\t/**\n\t * Prepare a string for use as an IDNA name\n\t *\n\t * @todo Implement this based on RFC 3491 and the newer 5891\n\t * @param string $string\n\t * @return string Prepared string\n\t */\n\tprotected static function nameprep($string) {\n\t\treturn $string;\n\t}\n\n\t/**\n\t * Convert a UTF-8 string to a UCS-4 codepoint array\n\t *\n\t * Based on Requests_IRI::replace_invalid_with_pct_encoding()\n\t *\n\t * @throws Requests_Exception Invalid UTF-8 codepoint (`idna.invalidcodepoint`)\n\t * @param string $input\n\t * @return array Unicode code points\n\t */\n\tprotected static function utf8_to_codepoints($input) {\n\t\t$codepoints = array();\n\n\t\t// Get number of bytes\n\t\t$strlen = strlen($input);\n\n\t\tfor ($position = 0; $position < $strlen; $position++) {\n\t\t\t$value = ord($input[$position]);\n\n\t\t\t// One byte sequence:\n\t\t\tif ((~$value & 0x80) === 0x80) {\n\t\t\t\t$character = $value;\n\t\t\t\t$length = 1;\n\t\t\t\t$remaining = 0;\n\t\t\t}\n\t\t\t// Two byte sequence:\n\t\t\telseif (($value & 0xE0) === 0xC0) {\n\t\t\t\t$character = ($value & 0x1F) << 6;\n\t\t\t\t$length = 2;\n\t\t\t\t$remaining = 1;\n\t\t\t}\n\t\t\t// Three byte sequence:\n\t\t\telseif (($value & 0xF0) === 0xE0) {\n\t\t\t\t$character = ($value & 0x0F) << 12;\n\t\t\t\t$length = 3;\n\t\t\t\t$remaining = 2;\n\t\t\t}\n\t\t\t// Four byte sequence:\n\t\t\telseif (($value & 0xF8) === 0xF0) {\n\t\t\t\t$character = ($value & 0x07) << 18;\n\t\t\t\t$length = 4;\n\t\t\t\t$remaining = 3;\n\t\t\t}\n\t\t\t// Invalid byte:\n\t\t\telse {\n\t\t\t\tthrow new Requests_Exception('Invalid Unicode codepoint', 'idna.invalidcodepoint', $value);\n\t\t\t}\n\n\t\t\tif ($remaining > 0) {\n\t\t\t\tif ($position + $length > $strlen) {\n\t\t\t\t\tthrow new Requests_Exception('Invalid Unicode codepoint', 'idna.invalidcodepoint', $character);\n\t\t\t\t}\n\t\t\t\tfor ($position++; $remaining > 0; $position++) {\n\t\t\t\t\t$value = ord($input[$position]);\n\n\t\t\t\t\t// If it is invalid, count the sequence as invalid and reprocess the current byte:\n\t\t\t\t\tif (($value & 0xC0) !== 0x80) {\n\t\t\t\t\t\tthrow new Requests_Exception('Invalid Unicode codepoint', 'idna.invalidcodepoint', $character);\n\t\t\t\t\t}\n\n\t\t\t\t\t$character |= ($value & 0x3F) << (--$remaining * 6);\n\t\t\t\t}\n\t\t\t\t$position--;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// Non-shortest form sequences are invalid\n\t\t\t\t   $length > 1 && $character <= 0x7F\n\t\t\t\t|| $length > 2 && $character <= 0x7FF\n\t\t\t\t|| $length > 3 && $character <= 0xFFFF\n\t\t\t\t// Outside of range of ucschar codepoints\n\t\t\t\t// Noncharacters\n\t\t\t\t|| ($character & 0xFFFE) === 0xFFFE\n\t\t\t\t|| $character >= 0xFDD0 && $character <= 0xFDEF\n\t\t\t\t|| (\n\t\t\t\t\t// Everything else not in ucschar\n\t\t\t\t\t   $character > 0xD7FF && $character < 0xF900\n\t\t\t\t\t|| $character < 0x20\n\t\t\t\t\t|| $character > 0x7E && $character < 0xA0\n\t\t\t\t\t|| $character > 0xEFFFD\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tthrow new Requests_Exception('Invalid Unicode codepoint', 'idna.invalidcodepoint', $character);\n\t\t\t}\n\n\t\t\t$codepoints[] = $character;\n\t\t}\n\n\t\treturn $codepoints;\n\t}\n\n\t/**\n\t * RFC3492-compliant encoder\n\t *\n\t * @internal Pseudo-code from Section 6.3 is commented with \"#\" next to relevant code\n\t * @throws Requests_Exception On character outside of the domain (never happens with Punycode) (`idna.character_outside_domain`)\n\t *\n\t * @param string $input UTF-8 encoded string to encode\n\t * @return string Punycode-encoded string\n\t */\n\tpublic static function punycode_encode($input) {\n\t\t$output = '';\n#\t\tlet n = initial_n\n\t\t$n = self::BOOTSTRAP_INITIAL_N;\n#\t\tlet delta = 0\n\t\t$delta = 0;\n#\t\tlet bias = initial_bias\n\t\t$bias = self::BOOTSTRAP_INITIAL_BIAS;\n#\t\tlet h = b = the number of basic code points in the input\n\t\t$h = $b = 0; // see loop\n#\t\tcopy them to the output in order\n\t\t$codepoints = self::utf8_to_codepoints($input);\n\t\t$extended = array();\n\n\t\tforeach ($codepoints as $char) {\n\t\t\tif ($char < 128) {\n\t\t\t\t// Character is valid ASCII\n\t\t\t\t// TODO: this should also check if it's valid for a URL\n\t\t\t\t$output .= chr($char);\n\t\t\t\t$h++;\n\t\t\t}\n\t\t\t// Check if the character is non-ASCII, but below initial n\n\t\t\t// This never occurs for Punycode, so ignore in coverage\n\t\t\t// @codeCoverageIgnoreStart\n\t\t\telseif ($char < $n) {\n\t\t\t\tthrow new Requests_Exception('Invalid character', 'idna.character_outside_domain', $char);\n\t\t\t}\n\t\t\t// @codeCoverageIgnoreEnd\n\t\t\telse {\n\t\t\t\t$extended[$char] = true;\n\t\t\t}\n\t\t}\n\t\t$extended = array_keys($extended);\n\t\tsort($extended);\n\t\t$b = $h;\n#\t\t[copy them] followed by a delimiter if b > 0\n\t\tif (strlen($output) > 0) {\n\t\t\t$output .= '-';\n\t\t}\n#\t\t{if the input contains a non-basic code point < n then fail}\n#\t\twhile h < length(input) do begin\n\t\twhile ($h < count($codepoints)) {\n#\t\t\tlet m = the minimum code point >= n in the input\n\t\t\t$m = array_shift($extended);\n\t\t\t//printf('next code point to insert is %s' . PHP_EOL, dechex($m));\n#\t\t\tlet delta = delta + (m - n) * (h + 1), fail on overflow\n\t\t\t$delta += ($m - $n) * ($h + 1);\n#\t\t\tlet n = m\n\t\t\t$n = $m;\n#\t\t\tfor each code point c in the input (in order) do begin\n\t\t\tfor ($num = 0; $num < count($codepoints); $num++) {\n\t\t\t\t$c = $codepoints[$num];\n#\t\t\t\tif c < n then increment delta, fail on overflow\n\t\t\t\tif ($c < $n) {\n\t\t\t\t\t$delta++;\n\t\t\t\t}\n#\t\t\t\tif c == n then begin\n\t\t\t\telseif ($c === $n) {\n#\t\t\t\t\tlet q = delta\n\t\t\t\t\t$q = $delta;\n#\t\t\t\t\tfor k = base to infinity in steps of base do begin\n\t\t\t\t\tfor ($k = self::BOOTSTRAP_BASE; ; $k += self::BOOTSTRAP_BASE) {\n#\t\t\t\t\t\tlet t = tmin if k <= bias {+ tmin}, or\n#\t\t\t\t\t\t\t\ttmax if k >= bias + tmax, or k - bias otherwise\n\t\t\t\t\t\tif ($k <= ($bias + self::BOOTSTRAP_TMIN)) {\n\t\t\t\t\t\t\t$t = self::BOOTSTRAP_TMIN;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($k >= ($bias + self::BOOTSTRAP_TMAX)) {\n\t\t\t\t\t\t\t$t = self::BOOTSTRAP_TMAX;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$t = $k - $bias;\n\t\t\t\t\t\t}\n#\t\t\t\t\t\tif q < t then break\n\t\t\t\t\t\tif ($q < $t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n#\t\t\t\t\t\toutput the code point for digit t + ((q - t) mod (base - t))\n\t\t\t\t\t\t$digit = $t + (($q - $t) % (self::BOOTSTRAP_BASE - $t));\n\t\t\t\t\t\t$output .= self::digit_to_char($digit);\n#\t\t\t\t\t\tlet q = (q - t) div (base - t)\n\t\t\t\t\t\t$q = floor(($q - $t) / (self::BOOTSTRAP_BASE - $t));\n#\t\t\t\t\tend\n\t\t\t\t\t}\n#\t\t\t\t\toutput the code point for digit q\n\t\t\t\t\t$output .= self::digit_to_char($q);\n#\t\t\t\t\tlet bias = adapt(delta, h + 1, test h equals b?)\n\t\t\t\t\t$bias = self::adapt($delta, $h + 1, $h === $b);\n#\t\t\t\t\tlet delta = 0\n\t\t\t\t\t$delta = 0;\n#\t\t\t\t\tincrement h\n\t\t\t\t\t$h++;\n#\t\t\t\tend\n\t\t\t\t}\n#\t\t\tend\n\t\t\t}\n#\t\t\tincrement delta and n\n\t\t\t$delta++;\n\t\t\t$n++;\n#\t\tend\n\t\t}\n\n\t\treturn $output;\n\t}\n\n\t/**\n\t * Convert a digit to its respective character\n\t *\n\t * @see https://tools.ietf.org/html/rfc3492#section-5\n\t * @throws Requests_Exception On invalid digit (`idna.invalid_digit`)\n\t *\n\t * @param int $digit Digit in the range 0-35\n\t * @return string Single character corresponding to digit\n\t */\n\tprotected static function digit_to_char($digit) {\n\t\t// @codeCoverageIgnoreStart\n\t\t// As far as I know, this never happens, but still good to be sure.\n\t\tif ($digit < 0 || $digit > 35) {\n\t\t\tthrow new Requests_Exception(sprintf('Invalid digit %d', $digit), 'idna.invalid_digit', $digit);\n\t\t}\n\t\t// @codeCoverageIgnoreEnd\n\t\t$digits = 'abcdefghijklmnopqrstuvwxyz0123456789';\n\t\treturn substr($digits, $digit, 1);\n\t}\n\n\t/**\n\t * Adapt the bias\n\t *\n\t * @see https://tools.ietf.org/html/rfc3492#section-6.1\n\t * @param int $delta\n\t * @param int $numpoints\n\t * @param bool $firsttime\n\t * @return int New bias\n\t */\n\tprotected static function adapt($delta, $numpoints, $firsttime) {\n#\tfunction adapt(delta,numpoints,firsttime):\n#\t\tif firsttime then let delta = delta div damp\n\t\tif ($firsttime) {\n\t\t\t$delta = floor($delta / self::BOOTSTRAP_DAMP);\n\t\t}\n#\t\telse let delta = delta div 2\n\t\telse {\n\t\t\t$delta = floor($delta / 2);\n\t\t}\n#\t\tlet delta = delta + (delta div numpoints)\n\t\t$delta += floor($delta / $numpoints);\n#\t\tlet k = 0\n\t\t$k = 0;\n#\t\twhile delta > ((base - tmin) * tmax) div 2 do begin\n\t\t$max = floor(((self::BOOTSTRAP_BASE - self::BOOTSTRAP_TMIN) * self::BOOTSTRAP_TMAX) / 2);\n\t\twhile ($delta > $max) {\n#\t\t\tlet delta = delta div (base - tmin)\n\t\t\t$delta = floor($delta / (self::BOOTSTRAP_BASE - self::BOOTSTRAP_TMIN));\n#\t\t\tlet k = k + base\n\t\t\t$k += self::BOOTSTRAP_BASE;\n#\t\tend\n\t\t}\n#\t\treturn k + (((base - tmin + 1) * delta) div (delta + skew))\n\t\treturn $k + floor(((self::BOOTSTRAP_BASE - self::BOOTSTRAP_TMIN + 1) * $delta) / ($delta + self::BOOTSTRAP_SKEW));\n\t}\n}", "num_lines": 388}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Class to validate and to work with IPv6 addresses\n *\n * @package Requests\n * @subpackage Utilities\n */\n\n/**\n * Class to validate and to work with IPv6 addresses\n *\n * This was originally based on the PEAR class of the same name, but has been\n * entirely rewritten.\n *\n * @package Requests\n * @subpackage Utilities\n */\nclass Requests_IPv6 {\n\t/**\n\t * Uncompresses an IPv6 address\n\t *\n\t * RFC 4291 allows you to compress consecutive zero pieces in an address to\n\t * '::'. This method expects a valid IPv6 address and expands the '::' to\n\t * the required number of zero pieces.\n\t *\n\t * Example:  FF01::101   ->  FF01:0:0:0:0:0:0:101\n\t *           ::1         ->  0:0:0:0:0:0:0:1\n\t *\n\t * @author Alexander Merz <alexander.merz@web.de>\n\t * @author elfrink at introweb dot nl\n\t * @author Josh Peck <jmp at joshpeck dot org>\n\t * @copyright 2003-2005 The PHP Group\n\t * @license http://www.opensource.org/licenses/bsd-license.php\n\t * @param string $ip An IPv6 address\n\t * @return string The uncompressed IPv6 address\n\t */\n\tpublic static function uncompress($ip) {\n\t\tif (substr_count($ip, '::') !== 1) {\n\t\t\treturn $ip;\n\t\t}\n\n\t\tlist($ip1, $ip2) = explode('::', $ip);\n\t\t$c1 = ($ip1 === '') ? -1 : substr_count($ip1, ':');\n\t\t$c2 = ($ip2 === '') ? -1 : substr_count($ip2, ':');\n\n\t\tif (strpos($ip2, '.') !== false) {\n\t\t\t$c2++;\n\t\t}\n\t\t// ::\n\t\tif ($c1 === -1 && $c2 === -1) {\n\t\t\t$ip = '0:0:0:0:0:0:0:0';\n\t\t}\n\t\t// ::xxx\n\t\telse if ($c1 === -1) {\n\t\t\t$fill = str_repeat('0:', 7 - $c2);\n\t\t\t$ip = str_replace('::', $fill, $ip);\n\t\t}\n\t\t// xxx::\n\t\telse if ($c2 === -1) {\n\t\t\t$fill = str_repeat(':0', 7 - $c1);\n\t\t\t$ip = str_replace('::', $fill, $ip);\n\t\t}\n\t\t// xxx::xxx\n\t\telse {\n\t\t\t$fill = ':' . str_repeat('0:', 6 - $c2 - $c1);\n\t\t\t$ip = str_replace('::', $fill, $ip);\n\t\t}\n\t\treturn $ip;\n\t}\n\n\t/**\n\t * Compresses an IPv6 address\n\t *\n\t * RFC 4291 allows you to compress consecutive zero pieces in an address to\n\t * '::'. This method expects a valid IPv6 address and compresses consecutive\n\t * zero pieces to '::'.\n\t *\n\t * Example:  FF01:0:0:0:0:0:0:101   ->  FF01::101\n\t *           0:0:0:0:0:0:0:1        ->  ::1\n\t *\n\t * @see uncompress()\n\t * @param string $ip An IPv6 address\n\t * @return string The compressed IPv6 address\n\t */\n\tpublic static function compress($ip) {\n\t\t// Prepare the IP to be compressed\n\t\t$ip = self::uncompress($ip);\n\t\t$ip_parts = self::split_v6_v4($ip);\n\n\t\t// Replace all leading zeros\n\t\t$ip_parts[0] = preg_replace('/(^|:)0+([0-9])/', '\\1\\2', $ip_parts[0]);\n\n\t\t// Find bunches of zeros\n\t\tif (preg_match_all('/(?:^|:)(?:0(?::|$))+/', $ip_parts[0], $matches, PREG_OFFSET_CAPTURE)) {\n\t\t\t$max = 0;\n\t\t\t$pos = null;\n\t\t\tforeach ($matches[0] as $match) {\n\t\t\t\tif (strlen($match[0]) > $max) {\n\t\t\t\t\t$max = strlen($match[0]);\n\t\t\t\t\t$pos = $match[1];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$ip_parts[0] = substr_replace($ip_parts[0], '::', $pos, $max);\n\t\t}\n\n\t\tif ($ip_parts[1] !== '') {\n\t\t\treturn implode(':', $ip_parts);\n\t\t}\n\t\telse {\n\t\t\treturn $ip_parts[0];\n\t\t}\n\t}\n\n\t/**\n\t * Splits an IPv6 address into the IPv6 and IPv4 representation parts\n\t *\n\t * RFC 4291 allows you to represent the last two parts of an IPv6 address\n\t * using the standard IPv4 representation\n\t *\n\t * Example:  0:0:0:0:0:0:13.1.68.3\n\t *           0:0:0:0:0:FFFF:129.144.52.38\n\t *\n\t * @param string $ip An IPv6 address\n\t * @return string[] [0] contains the IPv6 represented part, and [1] the IPv4 represented part\n\t */\n\tprotected static function split_v6_v4($ip) {\n\t\tif (strpos($ip, '.') !== false) {\n\t\t\t$pos = strrpos($ip, ':');\n\t\t\t$ipv6_part = substr($ip, 0, $pos);\n\t\t\t$ipv4_part = substr($ip, $pos + 1);\n\t\t\treturn array($ipv6_part, $ipv4_part);\n\t\t}\n\t\telse {\n\t\t\treturn array($ip, '');\n\t\t}\n\t}\n\n\t/**\n\t * Checks an IPv6 address\n\t *\n\t * Checks if the given IP is a valid IPv6 address\n\t *\n\t * @param string $ip An IPv6 address\n\t * @return bool true if $ip is a valid IPv6 address\n\t */\n\tpublic static function check_ipv6($ip) {\n\t\t$ip = self::uncompress($ip);\n\t\tlist($ipv6, $ipv4) = self::split_v6_v4($ip);\n\t\t$ipv6 = explode(':', $ipv6);\n\t\t$ipv4 = explode('.', $ipv4);\n\t\tif (count($ipv6) === 8 && count($ipv4) === 1 || count($ipv6) === 6 && count($ipv4) === 4) {\n\t\t\tforeach ($ipv6 as $ipv6_part) {\n\t\t\t\t// The section can't be empty\n\t\t\t\tif ($ipv6_part === '') {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Nor can it be over four characters\n\t\t\t\tif (strlen($ipv6_part) > 4) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Remove leading zeros (this is safe because of the above)\n\t\t\t\t$ipv6_part = ltrim($ipv6_part, '0');\n\t\t\t\tif ($ipv6_part === '') {\n\t\t\t\t\t$ipv6_part = '0';\n\t\t\t\t}\n\n\t\t\t\t// Check the value is valid\n\t\t\t\t$value = hexdec($ipv6_part);\n\t\t\t\tif (dechex($value) !== strtolower($ipv6_part) || $value < 0 || $value > 0xFFFF) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (count($ipv4) === 4) {\n\t\t\t\tforeach ($ipv4 as $ipv4_part) {\n\t\t\t\t\t$value = (int) $ipv4_part;\n\t\t\t\t\tif ((string) $value !== $ipv4_part || $value < 0 || $value > 0xFF) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}\n}\n", "num_lines": 191}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * IRI parser/serialiser/normaliser\n *\n * @package Requests\n * @subpackage Utilities\n */\n\n/**\n * IRI parser/serialiser/normaliser\n *\n * Copyright (c) 2007-2010, Geoffrey Sneddon and Steve Minutillo.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n *  * Redistributions of source code must retain the above copyright notice,\n *       this list of conditions and the following disclaimer.\n *\n *  * Redistributions in binary form must reproduce the above copyright notice,\n *       this list of conditions and the following disclaimer in the documentation\n *       and/or other materials provided with the distribution.\n *\n *  * Neither the name of the SimplePie Team nor the names of its contributors\n *       may be used to endorse or promote products derived from this software\n *       without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package Requests\n * @subpackage Utilities\n * @author Geoffrey Sneddon\n * @author Steve Minutillo\n * @copyright 2007-2009 Geoffrey Sneddon and Steve Minutillo\n * @license http://www.opensource.org/licenses/bsd-license.php\n * @link http://hg.gsnedders.com/iri/\n *\n * @property string $iri IRI we're working with\n * @property-read string $uri IRI in URI form, {@see to_uri}\n * @property string $scheme Scheme part of the IRI\n * @property string $authority Authority part, formatted for a URI (userinfo + host + port)\n * @property string $iauthority Authority part of the IRI (userinfo + host + port)\n * @property string $userinfo Userinfo part, formatted for a URI (after '://' and before '@')\n * @property string $iuserinfo Userinfo part of the IRI (after '://' and before '@')\n * @property string $host Host part, formatted for a URI\n * @property string $ihost Host part of the IRI\n * @property string $port Port part of the IRI (after ':')\n * @property string $path Path part, formatted for a URI (after first '/')\n * @property string $ipath Path part of the IRI (after first '/')\n * @property string $query Query part, formatted for a URI (after '?')\n * @property string $iquery Query part of the IRI (after '?')\n * @property string $fragment Fragment, formatted for a URI (after '#')\n * @property string $ifragment Fragment part of the IRI (after '#')\n */\nclass Requests_IRI {\n\t/**\n\t * Scheme\n\t *\n\t * @var string\n\t */\n\tprotected $scheme = null;\n\n\t/**\n\t * User Information\n\t *\n\t * @var string\n\t */\n\tprotected $iuserinfo = null;\n\n\t/**\n\t * ihost\n\t *\n\t * @var string\n\t */\n\tprotected $ihost = null;\n\n\t/**\n\t * Port\n\t *\n\t * @var string\n\t */\n\tprotected $port = null;\n\n\t/**\n\t * ipath\n\t *\n\t * @var string\n\t */\n\tprotected $ipath = '';\n\n\t/**\n\t * iquery\n\t *\n\t * @var string\n\t */\n\tprotected $iquery = null;\n\n\t/**\n\t * ifragment\n\t *\n\t * @var string\n\t */\n\tprotected $ifragment = null;\n\n\t/**\n\t * Normalization database\n\t *\n\t * Each key is the scheme, each value is an array with each key as the IRI\n\t * part and value as the default value for that part.\n\t */\n\tprotected $normalization = array(\n\t\t'acap' => array(\n\t\t\t'port' => 674\n\t\t),\n\t\t'dict' => array(\n\t\t\t'port' => 2628\n\t\t),\n\t\t'file' => array(\n\t\t\t'ihost' => 'localhost'\n\t\t),\n\t\t'http' => array(\n\t\t\t'port' => 80,\n\t\t),\n\t\t'https' => array(\n\t\t\t'port' => 443,\n\t\t),\n\t);\n\n\t/**\n\t * Return the entire IRI when you try and read the object as a string\n\t *\n\t * @return string\n\t */\n\tpublic function __toString() {\n\t\treturn $this->get_iri();\n\t}\n\n\t/**\n\t * Overload __set() to provide access via properties\n\t *\n\t * @param string $name Property name\n\t * @param mixed $value Property value\n\t */\n\tpublic function __set($name, $value) {\n\t\tif (method_exists($this, 'set_' . $name)) {\n\t\t\tcall_user_func(array($this, 'set_' . $name), $value);\n\t\t}\n\t\telseif (\n\t\t\t   $name === 'iauthority'\n\t\t\t|| $name === 'iuserinfo'\n\t\t\t|| $name === 'ihost'\n\t\t\t|| $name === 'ipath'\n\t\t\t|| $name === 'iquery'\n\t\t\t|| $name === 'ifragment'\n\t\t) {\n\t\t\tcall_user_func(array($this, 'set_' . substr($name, 1)), $value);\n\t\t}\n\t}\n\n\t/**\n\t * Overload __get() to provide access via properties\n\t *\n\t * @param string $name Property name\n\t * @return mixed\n\t */\n\tpublic function __get($name) {\n\t\t// isset() returns false for null, we don't want to do that\n\t\t// Also why we use array_key_exists below instead of isset()\n\t\t$props = get_object_vars($this);\n\n\t\tif (\n\t\t\t$name === 'iri' ||\n\t\t\t$name === 'uri' ||\n\t\t\t$name === 'iauthority' ||\n\t\t\t$name === 'authority'\n\t\t) {\n\t\t\t$method = 'get_' . $name;\n\t\t\t$return = $this->$method();\n\t\t}\n\t\telseif (array_key_exists($name, $props)) {\n\t\t\t$return = $this->$name;\n\t\t}\n\t\t// host -> ihost\n\t\telseif (($prop = 'i' . $name) && array_key_exists($prop, $props)) {\n\t\t\t$name = $prop;\n\t\t\t$return = $this->$prop;\n\t\t}\n\t\t// ischeme -> scheme\n\t\telseif (($prop = substr($name, 1)) && array_key_exists($prop, $props)) {\n\t\t\t$name = $prop;\n\t\t\t$return = $this->$prop;\n\t\t}\n\t\telse {\n\t\t\ttrigger_error('Undefined property: ' . get_class($this) . '::' . $name, E_USER_NOTICE);\n\t\t\t$return = null;\n\t\t}\n\n\t\tif ($return === null && isset($this->normalization[$this->scheme][$name])) {\n\t\t\treturn $this->normalization[$this->scheme][$name];\n\t\t}\n\t\telse {\n\t\t\treturn $return;\n\t\t}\n\t}\n\n\t/**\n\t * Overload __isset() to provide access via properties\n\t *\n\t * @param string $name Property name\n\t * @return bool\n\t */\n\tpublic function __isset($name) {\n\t\treturn (method_exists($this, 'get_' . $name) || isset($this->$name));\n\t}\n\n\t/**\n\t * Overload __unset() to provide access via properties\n\t *\n\t * @param string $name Property name\n\t */\n\tpublic function __unset($name) {\n\t\tif (method_exists($this, 'set_' . $name)) {\n\t\t\tcall_user_func(array($this, 'set_' . $name), '');\n\t\t}\n\t}\n\n\t/**\n\t * Create a new IRI object, from a specified string\n\t *\n\t * @param string|null $iri\n\t */\n\tpublic function __construct($iri = null) {\n\t\t$this->set_iri($iri);\n\t}\n\n\t/**\n\t * Create a new IRI object by resolving a relative IRI\n\t *\n\t * Returns false if $base is not absolute, otherwise an IRI.\n\t *\n\t * @param IRI|string $base (Absolute) Base IRI\n\t * @param IRI|string $relative Relative IRI\n\t * @return IRI|false\n\t */\n\tpublic static function absolutize($base, $relative) {\n\t\tif (!($relative instanceof Requests_IRI)) {\n\t\t\t$relative = new Requests_IRI($relative);\n\t\t}\n\t\tif (!$relative->is_valid()) {\n\t\t\treturn false;\n\t\t}\n\t\telseif ($relative->scheme !== null) {\n\t\t\treturn clone $relative;\n\t\t}\n\n\t\tif (!($base instanceof Requests_IRI)) {\n\t\t\t$base = new Requests_IRI($base);\n\t\t}\n\t\tif ($base->scheme === null || !$base->is_valid()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($relative->get_iri() !== '') {\n\t\t\tif ($relative->iuserinfo !== null || $relative->ihost !== null || $relative->port !== null) {\n\t\t\t\t$target = clone $relative;\n\t\t\t\t$target->scheme = $base->scheme;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$target = new Requests_IRI;\n\t\t\t\t$target->scheme = $base->scheme;\n\t\t\t\t$target->iuserinfo = $base->iuserinfo;\n\t\t\t\t$target->ihost = $base->ihost;\n\t\t\t\t$target->port = $base->port;\n\t\t\t\tif ($relative->ipath !== '') {\n\t\t\t\t\tif ($relative->ipath[0] === '/') {\n\t\t\t\t\t\t$target->ipath = $relative->ipath;\n\t\t\t\t\t}\n\t\t\t\t\telseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '') {\n\t\t\t\t\t\t$target->ipath = '/' . $relative->ipath;\n\t\t\t\t\t}\n\t\t\t\t\telseif (($last_segment = strrpos($base->ipath, '/')) !== false) {\n\t\t\t\t\t\t$target->ipath = substr($base->ipath, 0, $last_segment + 1) . $relative->ipath;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$target->ipath = $relative->ipath;\n\t\t\t\t\t}\n\t\t\t\t\t$target->ipath = $target->remove_dot_segments($target->ipath);\n\t\t\t\t\t$target->iquery = $relative->iquery;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$target->ipath = $base->ipath;\n\t\t\t\t\tif ($relative->iquery !== null) {\n\t\t\t\t\t\t$target->iquery = $relative->iquery;\n\t\t\t\t\t}\n\t\t\t\t\telseif ($base->iquery !== null) {\n\t\t\t\t\t\t$target->iquery = $base->iquery;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$target->ifragment = $relative->ifragment;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$target = clone $base;\n\t\t\t$target->ifragment = null;\n\t\t}\n\t\t$target->scheme_normalization();\n\t\treturn $target;\n\t}\n\n\t/**\n\t * Parse an IRI into scheme/authority/path/query/fragment segments\n\t *\n\t * @param string $iri\n\t * @return array\n\t */\n\tprotected function parse_iri($iri) {\n\t\t$iri = trim($iri, \"\\x20\\x09\\x0A\\x0C\\x0D\");\n\t\t$has_match = preg_match('/^((?P<scheme>[^:\\/?#]+):)?(\\/\\/(?P<authority>[^\\/?#]*))?(?P<path>[^?#]*)(\\?(?P<query>[^#]*))?(#(?P<fragment>.*))?$/', $iri, $match);\n\t\tif (!$has_match) {\n\t\t\tthrow new Requests_Exception('Cannot parse supplied IRI', 'iri.cannot_parse', $iri);\n\t\t}\n\n\t\tif ($match[1] === '') {\n\t\t\t$match['scheme'] = null;\n\t\t}\n\t\tif (!isset($match[3]) || $match[3] === '') {\n\t\t\t$match['authority'] = null;\n\t\t}\n\t\tif (!isset($match[5])) {\n\t\t\t$match['path'] = '';\n\t\t}\n\t\tif (!isset($match[6]) || $match[6] === '') {\n\t\t\t$match['query'] = null;\n\t\t}\n\t\tif (!isset($match[8]) || $match[8] === '') {\n\t\t\t$match['fragment'] = null;\n\t\t}\n\t\treturn $match;\n\t}\n\n\t/**\n\t * Remove dot segments from a path\n\t *\n\t * @param string $input\n\t * @return string\n\t */\n\tprotected function remove_dot_segments($input) {\n\t\t$output = '';\n\t\twhile (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..') {\n\t\t\t// A: If the input buffer begins with a prefix of \"../\" or \"./\",\n\t\t\t// then remove that prefix from the input buffer; otherwise,\n\t\t\tif (strpos($input, '../') === 0) {\n\t\t\t\t$input = substr($input, 3);\n\t\t\t}\n\t\t\telseif (strpos($input, './') === 0) {\n\t\t\t\t$input = substr($input, 2);\n\t\t\t}\n\t\t\t// B: if the input buffer begins with a prefix of \"/./\" or \"/.\",\n\t\t\t// where \".\" is a complete path segment, then replace that prefix\n\t\t\t// with \"/\" in the input buffer; otherwise,\n\t\t\telseif (strpos($input, '/./') === 0) {\n\t\t\t\t$input = substr($input, 2);\n\t\t\t}\n\t\t\telseif ($input === '/.') {\n\t\t\t\t$input = '/';\n\t\t\t}\n\t\t\t// C: if the input buffer begins with a prefix of \"/../\" or \"/..\",\n\t\t\t// where \"..\" is a complete path segment, then replace that prefix\n\t\t\t// with \"/\" in the input buffer and remove the last segment and its\n\t\t\t// preceding \"/\" (if any) from the output buffer; otherwise,\n\t\t\telseif (strpos($input, '/../') === 0) {\n\t\t\t\t$input = substr($input, 3);\n\t\t\t\t$output = substr_replace($output, '', strrpos($output, '/'));\n\t\t\t}\n\t\t\telseif ($input === '/..') {\n\t\t\t\t$input = '/';\n\t\t\t\t$output = substr_replace($output, '', strrpos($output, '/'));\n\t\t\t}\n\t\t\t// D: if the input buffer consists only of \".\" or \"..\", then remove\n\t\t\t// that from the input buffer; otherwise,\n\t\t\telseif ($input === '.' || $input === '..') {\n\t\t\t\t$input = '';\n\t\t\t}\n\t\t\t// E: move the first path segment in the input buffer to the end of\n\t\t\t// the output buffer, including the initial \"/\" character (if any)\n\t\t\t// and any subsequent characters up to, but not including, the next\n\t\t\t// \"/\" character or the end of the input buffer\n\t\t\telseif (($pos = strpos($input, '/', 1)) !== false) {\n\t\t\t\t$output .= substr($input, 0, $pos);\n\t\t\t\t$input = substr_replace($input, '', 0, $pos);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$output .= $input;\n\t\t\t\t$input = '';\n\t\t\t}\n\t\t}\n\t\treturn $output . $input;\n\t}\n\n\t/**\n\t * Replace invalid character with percent encoding\n\t *\n\t * @param string $string Input string\n\t * @param string $extra_chars Valid characters not in iunreserved or\n\t *                            iprivate (this is ASCII-only)\n\t * @param bool $iprivate Allow iprivate\n\t * @return string\n\t */\n\tprotected function replace_invalid_with_pct_encoding($string, $extra_chars, $iprivate = false) {\n\t\t// Normalize as many pct-encoded sections as possible\n\t\t$string = preg_replace_callback('/(?:%[A-Fa-f0-9]{2})+/', array(&$this, 'remove_iunreserved_percent_encoded'), $string);\n\n\t\t// Replace invalid percent characters\n\t\t$string = preg_replace('/%(?![A-Fa-f0-9]{2})/', '%25', $string);\n\n\t\t// Add unreserved and % to $extra_chars (the latter is safe because all\n\t\t// pct-encoded sections are now valid).\n\t\t$extra_chars .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~%';\n\n\t\t// Now replace any bytes that aren't allowed with their pct-encoded versions\n\t\t$position = 0;\n\t\t$strlen = strlen($string);\n\t\twhile (($position += strspn($string, $extra_chars, $position)) < $strlen) {\n\t\t\t$value = ord($string[$position]);\n\n\t\t\t// Start position\n\t\t\t$start = $position;\n\n\t\t\t// By default we are valid\n\t\t\t$valid = true;\n\n\t\t\t// No one byte sequences are valid due to the while.\n\t\t\t// Two byte sequence:\n\t\t\tif (($value & 0xE0) === 0xC0) {\n\t\t\t\t$character = ($value & 0x1F) << 6;\n\t\t\t\t$length = 2;\n\t\t\t\t$remaining = 1;\n\t\t\t}\n\t\t\t// Three byte sequence:\n\t\t\telseif (($value & 0xF0) === 0xE0) {\n\t\t\t\t$character = ($value & 0x0F) << 12;\n\t\t\t\t$length = 3;\n\t\t\t\t$remaining = 2;\n\t\t\t}\n\t\t\t// Four byte sequence:\n\t\t\telseif (($value & 0xF8) === 0xF0) {\n\t\t\t\t$character = ($value & 0x07) << 18;\n\t\t\t\t$length = 4;\n\t\t\t\t$remaining = 3;\n\t\t\t}\n\t\t\t// Invalid byte:\n\t\t\telse {\n\t\t\t\t$valid = false;\n\t\t\t\t$length = 1;\n\t\t\t\t$remaining = 0;\n\t\t\t}\n\n\t\t\tif ($remaining) {\n\t\t\t\tif ($position + $length <= $strlen) {\n\t\t\t\t\tfor ($position++; $remaining; $position++) {\n\t\t\t\t\t\t$value = ord($string[$position]);\n\n\t\t\t\t\t\t// Check that the byte is valid, then add it to the character:\n\t\t\t\t\t\tif (($value & 0xC0) === 0x80) {\n\t\t\t\t\t\t\t$character |= ($value & 0x3F) << (--$remaining * 6);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If it is invalid, count the sequence as invalid and reprocess the current byte:\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$valid = false;\n\t\t\t\t\t\t\t$position--;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$position = $strlen - 1;\n\t\t\t\t\t$valid = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Percent encode anything invalid or not in ucschar\n\t\t\tif (\n\t\t\t\t// Invalid sequences\n\t\t\t\t!$valid\n\t\t\t\t// Non-shortest form sequences are invalid\n\t\t\t\t|| $length > 1 && $character <= 0x7F\n\t\t\t\t|| $length > 2 && $character <= 0x7FF\n\t\t\t\t|| $length > 3 && $character <= 0xFFFF\n\t\t\t\t// Outside of range of ucschar codepoints\n\t\t\t\t// Noncharacters\n\t\t\t\t|| ($character & 0xFFFE) === 0xFFFE\n\t\t\t\t|| $character >= 0xFDD0 && $character <= 0xFDEF\n\t\t\t\t|| (\n\t\t\t\t\t// Everything else not in ucschar\n\t\t\t\t\t   $character > 0xD7FF && $character < 0xF900\n\t\t\t\t\t|| $character < 0xA0\n\t\t\t\t\t|| $character > 0xEFFFD\n\t\t\t\t)\n\t\t\t\t&& (\n\t\t\t\t\t// Everything not in iprivate, if it applies\n\t\t\t\t\t   !$iprivate\n\t\t\t\t\t|| $character < 0xE000\n\t\t\t\t\t|| $character > 0x10FFFD\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// If we were a character, pretend we weren't, but rather an error.\n\t\t\t\tif ($valid) {\n\t\t\t\t\t$position--;\n\t\t\t\t}\n\n\t\t\t\tfor ($j = $start; $j <= $position; $j++) {\n\t\t\t\t\t$string = substr_replace($string, sprintf('%%%02X', ord($string[$j])), $j, 1);\n\t\t\t\t\t$j += 2;\n\t\t\t\t\t$position += 2;\n\t\t\t\t\t$strlen += 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $string;\n\t}\n\n\t/**\n\t * Callback function for preg_replace_callback.\n\t *\n\t * Removes sequences of percent encoded bytes that represent UTF-8\n\t * encoded characters in iunreserved\n\t *\n\t * @param array $match PCRE match\n\t * @return string Replacement\n\t */\n\tprotected function remove_iunreserved_percent_encoded($match) {\n\t\t// As we just have valid percent encoded sequences we can just explode\n\t\t// and ignore the first member of the returned array (an empty string).\n\t\t$bytes = explode('%', $match[0]);\n\n\t\t// Initialize the new string (this is what will be returned) and that\n\t\t// there are no bytes remaining in the current sequence (unsurprising\n\t\t// at the first byte!).\n\t\t$string = '';\n\t\t$remaining = 0;\n\n\t\t// Loop over each and every byte, and set $value to its value\n\t\tfor ($i = 1, $len = count($bytes); $i < $len; $i++) {\n\t\t\t$value = hexdec($bytes[$i]);\n\n\t\t\t// If we're the first byte of sequence:\n\t\t\tif (!$remaining) {\n\t\t\t\t// Start position\n\t\t\t\t$start = $i;\n\n\t\t\t\t// By default we are valid\n\t\t\t\t$valid = true;\n\n\t\t\t\t// One byte sequence:\n\t\t\t\tif ($value <= 0x7F) {\n\t\t\t\t\t$character = $value;\n\t\t\t\t\t$length = 1;\n\t\t\t\t}\n\t\t\t\t// Two byte sequence:\n\t\t\t\telseif (($value & 0xE0) === 0xC0) {\n\t\t\t\t\t$character = ($value & 0x1F) << 6;\n\t\t\t\t\t$length = 2;\n\t\t\t\t\t$remaining = 1;\n\t\t\t\t}\n\t\t\t\t// Three byte sequence:\n\t\t\t\telseif (($value & 0xF0) === 0xE0) {\n\t\t\t\t\t$character = ($value & 0x0F) << 12;\n\t\t\t\t\t$length = 3;\n\t\t\t\t\t$remaining = 2;\n\t\t\t\t}\n\t\t\t\t// Four byte sequence:\n\t\t\t\telseif (($value & 0xF8) === 0xF0) {\n\t\t\t\t\t$character = ($value & 0x07) << 18;\n\t\t\t\t\t$length = 4;\n\t\t\t\t\t$remaining = 3;\n\t\t\t\t}\n\t\t\t\t// Invalid byte:\n\t\t\t\telse {\n\t\t\t\t\t$valid = false;\n\t\t\t\t\t$remaining = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Continuation byte:\n\t\t\telse {\n\t\t\t\t// Check that the byte is valid, then add it to the character:\n\t\t\t\tif (($value & 0xC0) === 0x80) {\n\t\t\t\t\t$remaining--;\n\t\t\t\t\t$character |= ($value & 0x3F) << ($remaining * 6);\n\t\t\t\t}\n\t\t\t\t// If it is invalid, count the sequence as invalid and reprocess the current byte as the start of a sequence:\n\t\t\t\telse {\n\t\t\t\t\t$valid = false;\n\t\t\t\t\t$remaining = 0;\n\t\t\t\t\t$i--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we've reached the end of the current byte sequence, append it to Unicode::$data\n\t\t\tif (!$remaining) {\n\t\t\t\t// Percent encode anything invalid or not in iunreserved\n\t\t\t\tif (\n\t\t\t\t\t// Invalid sequences\n\t\t\t\t\t!$valid\n\t\t\t\t\t// Non-shortest form sequences are invalid\n\t\t\t\t\t|| $length > 1 && $character <= 0x7F\n\t\t\t\t\t|| $length > 2 && $character <= 0x7FF\n\t\t\t\t\t|| $length > 3 && $character <= 0xFFFF\n\t\t\t\t\t// Outside of range of iunreserved codepoints\n\t\t\t\t\t|| $character < 0x2D\n\t\t\t\t\t|| $character > 0xEFFFD\n\t\t\t\t\t// Noncharacters\n\t\t\t\t\t|| ($character & 0xFFFE) === 0xFFFE\n\t\t\t\t\t|| $character >= 0xFDD0 && $character <= 0xFDEF\n\t\t\t\t\t// Everything else not in iunreserved (this is all BMP)\n\t\t\t\t\t|| $character === 0x2F\n\t\t\t\t\t|| $character > 0x39 && $character < 0x41\n\t\t\t\t\t|| $character > 0x5A && $character < 0x61\n\t\t\t\t\t|| $character > 0x7A && $character < 0x7E\n\t\t\t\t\t|| $character > 0x7E && $character < 0xA0\n\t\t\t\t\t|| $character > 0xD7FF && $character < 0xF900\n\t\t\t\t) {\n\t\t\t\t\tfor ($j = $start; $j <= $i; $j++) {\n\t\t\t\t\t\t$string .= '%' . strtoupper($bytes[$j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfor ($j = $start; $j <= $i; $j++) {\n\t\t\t\t\t\t$string .= chr(hexdec($bytes[$j]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If we have any bytes left over they are invalid (i.e., we are\n\t\t// mid-way through a multi-byte sequence)\n\t\tif ($remaining) {\n\t\t\tfor ($j = $start; $j < $len; $j++) {\n\t\t\t\t$string .= '%' . strtoupper($bytes[$j]);\n\t\t\t}\n\t\t}\n\n\t\treturn $string;\n\t}\n\n\tprotected function scheme_normalization() {\n\t\tif (isset($this->normalization[$this->scheme]['iuserinfo']) && $this->iuserinfo === $this->normalization[$this->scheme]['iuserinfo']) {\n\t\t\t$this->iuserinfo = null;\n\t\t}\n\t\tif (isset($this->normalization[$this->scheme]['ihost']) && $this->ihost === $this->normalization[$this->scheme]['ihost']) {\n\t\t\t$this->ihost = null;\n\t\t}\n\t\tif (isset($this->normalization[$this->scheme]['port']) && $this->port === $this->normalization[$this->scheme]['port']) {\n\t\t\t$this->port = null;\n\t\t}\n\t\tif (isset($this->normalization[$this->scheme]['ipath']) && $this->ipath === $this->normalization[$this->scheme]['ipath']) {\n\t\t\t$this->ipath = '';\n\t\t}\n\t\tif (isset($this->ihost) && empty($this->ipath)) {\n\t\t\t$this->ipath = '/';\n\t\t}\n\t\tif (isset($this->normalization[$this->scheme]['iquery']) && $this->iquery === $this->normalization[$this->scheme]['iquery']) {\n\t\t\t$this->iquery = null;\n\t\t}\n\t\tif (isset($this->normalization[$this->scheme]['ifragment']) && $this->ifragment === $this->normalization[$this->scheme]['ifragment']) {\n\t\t\t$this->ifragment = null;\n\t\t}\n\t}\n\n\t/**\n\t * Check if the object represents a valid IRI. This needs to be done on each\n\t * call as some things change depending on another part of the IRI.\n\t *\n\t * @return bool\n\t */\n\tpublic function is_valid() {\n\t\t$isauthority = $this->iuserinfo !== null || $this->ihost !== null || $this->port !== null;\n\t\tif ($this->ipath !== '' &&\n\t\t\t(\n\t\t\t\t$isauthority && $this->ipath[0] !== '/' ||\n\t\t\t\t(\n\t\t\t\t\t$this->scheme === null &&\n\t\t\t\t\t!$isauthority &&\n\t\t\t\t\tstrpos($this->ipath, ':') !== false &&\n\t\t\t\t\t(strpos($this->ipath, '/') === false ? true : strpos($this->ipath, ':') < strpos($this->ipath, '/'))\n\t\t\t\t)\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set the entire IRI. Returns true on success, false on failure (if there\n\t * are any invalid characters).\n\t *\n\t * @param string $iri\n\t * @return bool\n\t */\n\tprotected function set_iri($iri) {\n\t\tstatic $cache;\n\t\tif (!$cache) {\n\t\t\t$cache = array();\n\t\t}\n\n\t\tif ($iri === null) {\n\t\t\treturn true;\n\t\t}\n\t\tif (isset($cache[$iri])) {\n\t\t\tlist($this->scheme,\n\t\t\t\t $this->iuserinfo,\n\t\t\t\t $this->ihost,\n\t\t\t\t $this->port,\n\t\t\t\t $this->ipath,\n\t\t\t\t $this->iquery,\n\t\t\t\t $this->ifragment,\n\t\t\t\t $return) = $cache[$iri];\n\t\t\treturn $return;\n\t\t}\n\n\t\t$parsed = $this->parse_iri((string) $iri);\n\n\t\t$return = $this->set_scheme($parsed['scheme'])\n\t\t\t&& $this->set_authority($parsed['authority'])\n\t\t\t&& $this->set_path($parsed['path'])\n\t\t\t&& $this->set_query($parsed['query'])\n\t\t\t&& $this->set_fragment($parsed['fragment']);\n\n\t\t$cache[$iri] = array($this->scheme,\n\t\t\t\t\t\t\t $this->iuserinfo,\n\t\t\t\t\t\t\t $this->ihost,\n\t\t\t\t\t\t\t $this->port,\n\t\t\t\t\t\t\t $this->ipath,\n\t\t\t\t\t\t\t $this->iquery,\n\t\t\t\t\t\t\t $this->ifragment,\n\t\t\t\t\t\t\t $return);\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Set the scheme. Returns true on success, false on failure (if there are\n\t * any invalid characters).\n\t *\n\t * @param string $scheme\n\t * @return bool\n\t */\n\tprotected function set_scheme($scheme) {\n\t\tif ($scheme === null) {\n\t\t\t$this->scheme = null;\n\t\t}\n\t\telseif (!preg_match('/^[A-Za-z][0-9A-Za-z+\\-.]*$/', $scheme)) {\n\t\t\t$this->scheme = null;\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\t$this->scheme = strtolower($scheme);\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set the authority. Returns true on success, false on failure (if there are\n\t * any invalid characters).\n\t *\n\t * @param string $authority\n\t * @return bool\n\t */\n\tprotected function set_authority($authority) {\n\t\tstatic $cache;\n\t\tif (!$cache) {\n\t\t\t$cache = array();\n\t\t}\n\n\t\tif ($authority === null) {\n\t\t\t$this->iuserinfo = null;\n\t\t\t$this->ihost = null;\n\t\t\t$this->port = null;\n\t\t\treturn true;\n\t\t}\n\t\tif (isset($cache[$authority])) {\n\t\t\tlist($this->iuserinfo,\n\t\t\t\t $this->ihost,\n\t\t\t\t $this->port,\n\t\t\t\t $return) = $cache[$authority];\n\n\t\t\treturn $return;\n\t\t}\n\n\t\t$remaining = $authority;\n\t\tif (($iuserinfo_end = strrpos($remaining, '@')) !== false) {\n\t\t\t$iuserinfo = substr($remaining, 0, $iuserinfo_end);\n\t\t\t$remaining = substr($remaining, $iuserinfo_end + 1);\n\t\t}\n\t\telse {\n\t\t\t$iuserinfo = null;\n\t\t}\n\t\tif (($port_start = strpos($remaining, ':', strpos($remaining, ']'))) !== false) {\n\t\t\t$port = substr($remaining, $port_start + 1);\n\t\t\tif ($port === false || $port === '') {\n\t\t\t\t$port = null;\n\t\t\t}\n\t\t\t$remaining = substr($remaining, 0, $port_start);\n\t\t}\n\t\telse {\n\t\t\t$port = null;\n\t\t}\n\n\t\t$return = $this->set_userinfo($iuserinfo) &&\n\t\t\t\t  $this->set_host($remaining) &&\n\t\t\t\t  $this->set_port($port);\n\n\t\t$cache[$authority] = array($this->iuserinfo,\n\t\t\t\t\t\t\t\t   $this->ihost,\n\t\t\t\t\t\t\t\t   $this->port,\n\t\t\t\t\t\t\t\t   $return);\n\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Set the iuserinfo.\n\t *\n\t * @param string $iuserinfo\n\t * @return bool\n\t */\n\tprotected function set_userinfo($iuserinfo) {\n\t\tif ($iuserinfo === null) {\n\t\t\t$this->iuserinfo = null;\n\t\t}\n\t\telse {\n\t\t\t$this->iuserinfo = $this->replace_invalid_with_pct_encoding($iuserinfo, '!$&\\'()*+,;=:');\n\t\t\t$this->scheme_normalization();\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set the ihost. Returns true on success, false on failure (if there are\n\t * any invalid characters).\n\t *\n\t * @param string $ihost\n\t * @return bool\n\t */\n\tprotected function set_host($ihost) {\n\t\tif ($ihost === null) {\n\t\t\t$this->ihost = null;\n\t\t\treturn true;\n\t\t}\n\t\tif (substr($ihost, 0, 1) === '[' && substr($ihost, -1) === ']') {\n\t\t\tif (Requests_IPv6::check_ipv6(substr($ihost, 1, -1))) {\n\t\t\t\t$this->ihost = '[' . Requests_IPv6::compress(substr($ihost, 1, -1)) . ']';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->ihost = null;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$ihost = $this->replace_invalid_with_pct_encoding($ihost, '!$&\\'()*+,;=');\n\n\t\t\t// Lowercase, but ignore pct-encoded sections (as they should\n\t\t\t// remain uppercase). This must be done after the previous step\n\t\t\t// as that can add unescaped characters.\n\t\t\t$position = 0;\n\t\t\t$strlen = strlen($ihost);\n\t\t\twhile (($position += strcspn($ihost, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ%', $position)) < $strlen) {\n\t\t\t\tif ($ihost[$position] === '%') {\n\t\t\t\t\t$position += 3;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$ihost[$position] = strtolower($ihost[$position]);\n\t\t\t\t\t$position++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->ihost = $ihost;\n\t\t}\n\n\t\t$this->scheme_normalization();\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set the port. Returns true on success, false on failure (if there are\n\t * any invalid characters).\n\t *\n\t * @param string $port\n\t * @return bool\n\t */\n\tprotected function set_port($port) {\n\t\tif ($port === null) {\n\t\t\t$this->port = null;\n\t\t\treturn true;\n\t\t}\n\n\t\tif (strspn($port, '0123456789') === strlen($port)) {\n\t\t\t$this->port = (int) $port;\n\t\t\t$this->scheme_normalization();\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->port = null;\n\t\treturn false;\n\t}\n\n\t/**\n\t * Set the ipath.\n\t *\n\t * @param string $ipath\n\t * @return bool\n\t */\n\tprotected function set_path($ipath) {\n\t\tstatic $cache;\n\t\tif (!$cache) {\n\t\t\t$cache = array();\n\t\t}\n\n\t\t$ipath = (string) $ipath;\n\n\t\tif (isset($cache[$ipath])) {\n\t\t\t$this->ipath = $cache[$ipath][(int) ($this->scheme !== null)];\n\t\t}\n\t\telse {\n\t\t\t$valid = $this->replace_invalid_with_pct_encoding($ipath, '!$&\\'()*+,;=@:/');\n\t\t\t$removed = $this->remove_dot_segments($valid);\n\n\t\t\t$cache[$ipath] = array($valid, $removed);\n\t\t\t$this->ipath = ($this->scheme !== null) ? $removed : $valid;\n\t\t}\n\t\t$this->scheme_normalization();\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set the iquery.\n\t *\n\t * @param string $iquery\n\t * @return bool\n\t */\n\tprotected function set_query($iquery) {\n\t\tif ($iquery === null) {\n\t\t\t$this->iquery = null;\n\t\t}\n\t\telse {\n\t\t\t$this->iquery = $this->replace_invalid_with_pct_encoding($iquery, '!$&\\'()*+,;=:@/?', true);\n\t\t\t$this->scheme_normalization();\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set the ifragment.\n\t *\n\t * @param string $ifragment\n\t * @return bool\n\t */\n\tprotected function set_fragment($ifragment) {\n\t\tif ($ifragment === null) {\n\t\t\t$this->ifragment = null;\n\t\t}\n\t\telse {\n\t\t\t$this->ifragment = $this->replace_invalid_with_pct_encoding($ifragment, '!$&\\'()*+,;=:@/?');\n\t\t\t$this->scheme_normalization();\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Convert an IRI to a URI (or parts thereof)\n\t *\n\t * @param string|bool IRI to convert (or false from {@see get_iri})\n\t * @return string|false URI if IRI is valid, false otherwise.\n\t */\n\tprotected function to_uri($string) {\n\t\tif (!is_string($string)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tstatic $non_ascii;\n\t\tif (!$non_ascii) {\n\t\t\t$non_ascii = implode('', range(\"\\x80\", \"\\xFF\"));\n\t\t}\n\n\t\t$position = 0;\n\t\t$strlen = strlen($string);\n\t\twhile (($position += strcspn($string, $non_ascii, $position)) < $strlen) {\n\t\t\t$string = substr_replace($string, sprintf('%%%02X', ord($string[$position])), $position, 1);\n\t\t\t$position += 3;\n\t\t\t$strlen += 2;\n\t\t}\n\n\t\treturn $string;\n\t}\n\n\t/**\n\t * Get the complete IRI\n\t *\n\t * @return string\n\t */\n\tprotected function get_iri() {\n\t\tif (!$this->is_valid()) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$iri = '';\n\t\tif ($this->scheme !== null) {\n\t\t\t$iri .= $this->scheme . ':';\n\t\t}\n\t\tif (($iauthority = $this->get_iauthority()) !== null) {\n\t\t\t$iri .= '//' . $iauthority;\n\t\t}\n\t\t$iri .= $this->ipath;\n\t\tif ($this->iquery !== null) {\n\t\t\t$iri .= '?' . $this->iquery;\n\t\t}\n\t\tif ($this->ifragment !== null) {\n\t\t\t$iri .= '#' . $this->ifragment;\n\t\t}\n\n\t\treturn $iri;\n\t}\n\n\t/**\n\t * Get the complete URI\n\t *\n\t * @return string\n\t */\n\tprotected function get_uri() {\n\t\treturn $this->to_uri($this->get_iri());\n\t}\n\n\t/**\n\t * Get the complete iauthority\n\t *\n\t * @return string\n\t */\n\tprotected function get_iauthority() {\n\t\tif ($this->iuserinfo === null && $this->ihost === null && $this->port === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$iauthority = '';\n\t\tif ($this->iuserinfo !== null) {\n\t\t\t$iauthority .= $this->iuserinfo . '@';\n\t\t}\n\t\tif ($this->ihost !== null) {\n\t\t\t$iauthority .= $this->ihost;\n\t\t}\n\t\tif ($this->port !== null) {\n\t\t\t$iauthority .= ':' . $this->port;\n\t\t}\n\t\treturn $iauthority;\n\t}\n\n\t/**\n\t * Get the complete authority\n\t *\n\t * @return string\n\t */\n\tprotected function get_authority() {\n\t\t$iauthority = $this->get_iauthority();\n\t\tif (is_string($iauthority)) {\n\t\t\treturn $this->to_uri($iauthority);\n\t\t}\n\t\telse {\n\t\t\treturn $iauthority;\n\t\t}\n\t}\n}\n", "num_lines": 1085}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Proxy connection interface\n *\n * @package Requests\n * @subpackage Proxy\n * @since 1.6\n */\n\n/**\n * Proxy connection interface\n *\n * Implement this interface to handle proxy settings and authentication\n *\n * Parameters should be passed via the constructor where possible, as this\n * makes it much easier for users to use your provider.\n *\n * @see Requests_Hooks\n * @package Requests\n * @subpackage Proxy\n * @since 1.6\n */\ninterface Requests_Proxy {\n\t/**\n\t * Register hooks as needed\n\t *\n\t * This method is called in {@see Requests::request} when the user has set\n\t * an instance as the 'auth' option. Use this callback to register all the\n\t * hooks you'll need.\n\t *\n\t * @see Requests_Hooks::register\n\t * @param Requests_Hooks $hooks Hook system\n\t */\n\tpublic function register(Requests_Hooks &$hooks);\n}", "num_lines": 35}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * HTTP response class\n *\n * Contains a response from Requests::request()\n * @package Requests\n */\n\n/**\n * HTTP response class\n *\n * Contains a response from Requests::request()\n * @package Requests\n */\nclass Requests_Response {\n\t/**\n\t * Constructor\n\t */\n\tpublic function __construct() {\n\t\t$this->headers = new Requests_Response_Headers();\n\t\t$this->cookies = new Requests_Cookie_Jar();\n\t}\n\n\t/**\n\t * Response body\n\t *\n\t * @var string\n\t */\n\tpublic $body = '';\n\n\t/**\n\t * Raw HTTP data from the transport\n\t *\n\t * @var string\n\t */\n\tpublic $raw = '';\n\n\t/**\n\t * Headers, as an associative array\n\t *\n\t * @var Requests_Response_Headers Array-like object representing headers\n\t */\n\tpublic $headers = array();\n\n\t/**\n\t * Status code, false if non-blocking\n\t *\n\t * @var integer|boolean\n\t */\n\tpublic $status_code = false;\n\n\t/**\n\t * Protocol version, false if non-blocking\n\t * @var float|boolean\n\t */\n\tpublic $protocol_version = false;\n\n\t/**\n\t * Whether the request succeeded or not\n\t *\n\t * @var boolean\n\t */\n\tpublic $success = false;\n\n\t/**\n\t * Number of redirects the request used\n\t *\n\t * @var integer\n\t */\n\tpublic $redirects = 0;\n\n\t/**\n\t * URL requested\n\t *\n\t * @var string\n\t */\n\tpublic $url = '';\n\n\t/**\n\t * Previous requests (from redirects)\n\t *\n\t * @var array Array of Requests_Response objects\n\t */\n\tpublic $history = array();\n\n\t/**\n\t * Cookies from the request\n\t *\n\t * @var Requests_Cookie_Jar Array-like object representing a cookie jar\n\t */\n\tpublic $cookies = array();\n\n\t/**\n\t * Is the response a redirect?\n\t *\n\t * @return boolean True if redirect (3xx status), false if not.\n\t */\n\tpublic function is_redirect() {\n\t\t$code = $this->status_code;\n\t\treturn in_array($code, array(300, 301, 302, 303, 307)) || $code > 307 && $code < 400;\n\t}\n\n\t/**\n\t * Throws an exception if the request was not successful\n\t *\n\t * @throws Requests_Exception If `$allow_redirects` is false, and code is 3xx (`response.no_redirects`)\n\t * @throws Requests_Exception_HTTP On non-successful status code. Exception class corresponds to code (e.g. {@see Requests_Exception_HTTP_404})\n\t * @param boolean $allow_redirects Set to false to throw on a 3xx as well\n\t */\n\tpublic function throw_for_status($allow_redirects = true) {\n\t\tif ($this->is_redirect()) {\n\t\t\tif (!$allow_redirects) {\n\t\t\t\tthrow new Requests_Exception('Redirection not allowed', 'response.no_redirects', $this);\n\t\t\t}\n\t\t}\n\t\telseif (!$this->success) {\n\t\t\t$exception = Requests_Exception_HTTP::get_class($this->status_code);\n\t\t\tthrow new $exception(null, $this);\n\t\t}\n\t}\n}\n", "num_lines": 122}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Session handler for persistent requests and default parameters\n *\n * @package Requests\n * @subpackage Session Handler\n */\n\n/**\n * Session handler for persistent requests and default parameters\n *\n * Allows various options to be set as default values, and merges both the\n * options and URL properties together. A base URL can be set for all requests,\n * with all subrequests resolved from this. Base options can be set (including\n * a shared cookie jar), then overridden for individual requests.\n *\n * @package Requests\n * @subpackage Session Handler\n */\nclass Requests_Session {\n\t/**\n\t * Base URL for requests\n\t *\n\t * URLs will be made absolute using this as the base\n\t * @var string|null\n\t */\n\tpublic $url = null;\n\n\t/**\n\t * Base headers for requests\n\t * @var array\n\t */\n\tpublic $headers = array();\n\n\t/**\n\t * Base data for requests\n\t *\n\t * If both the base data and the per-request data are arrays, the data will\n\t * be merged before sending the request.\n\t *\n\t * @var array\n\t */\n\tpublic $data = array();\n\n\t/**\n\t * Base options for requests\n\t *\n\t * The base options are merged with the per-request data for each request.\n\t * The only default option is a shared cookie jar between requests.\n\t *\n\t * Values here can also be set directly via properties on the Session\n\t * object, e.g. `$session->useragent = 'X';`\n\t *\n\t * @var array\n\t */\n\tpublic $options = array();\n\n\t/**\n\t * Create a new session\n\t *\n\t * @param string|null $url Base URL for requests\n\t * @param array $headers Default headers for requests\n\t * @param array $data Default data for requests\n\t * @param array $options Default options for requests\n\t */\n\tpublic function __construct($url = null, $headers = array(), $data = array(), $options = array()) {\n\t\t$this->url = $url;\n\t\t$this->headers = $headers;\n\t\t$this->data = $data;\n\t\t$this->options = $options;\n\n\t\tif (empty($this->options['cookies'])) {\n\t\t\t$this->options['cookies'] = new Requests_Cookie_Jar();\n\t\t}\n\t}\n\n\t/**\n\t * Get a property's value\n\t *\n\t * @param string $key Property key\n\t * @return mixed|null Property value, null if none found\n\t */\n\tpublic function __get($key) {\n\t\tif (isset($this->options[$key])) {\n\t\t\treturn $this->options[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Set a property's value\n\t *\n\t * @param string $key Property key\n\t * @param mixed $value Property value\n\t */\n\tpublic function __set($key, $value) {\n\t\t$this->options[$key] = $value;\n\t}\n\n\t/**\n\t * Remove a property's value\n\t *\n\t * @param string $key Property key\n\t */\n\tpublic function __isset($key) {\n\t\treturn isset($this->options[$key]);\n\t}\n\n\t/**\n\t * Remove a property's value\n\t *\n\t * @param string $key Property key\n\t */\n\tpublic function __unset($key) {\n\t\tif (isset($this->options[$key])) {\n\t\t\tunset($this->options[$key]);\n\t\t}\n\t}\n\n\t/**#@+\n\t * @see request()\n\t * @param string $url\n\t * @param array $headers\n\t * @param array $options\n\t * @return Requests_Response\n\t */\n\t/**\n\t * Send a GET request\n\t */\n\tpublic function get($url, $headers = array(), $options = array()) {\n\t\treturn $this->request($url, $headers, null, Requests::GET, $options);\n\t}\n\n\t/**\n\t * Send a HEAD request\n\t */\n\tpublic function head($url, $headers = array(), $options = array()) {\n\t\treturn $this->request($url, $headers, null, Requests::HEAD, $options);\n\t}\n\n\t/**\n\t * Send a DELETE request\n\t */\n\tpublic function delete($url, $headers = array(), $options = array()) {\n\t\treturn $this->request($url, $headers, null, Requests::DELETE, $options);\n\t}\n\t/**#@-*/\n\n\t/**#@+\n\t * @see request()\n\t * @param string $url\n\t * @param array $headers\n\t * @param array $data\n\t * @param array $options\n\t * @return Requests_Response\n\t */\n\t/**\n\t * Send a POST request\n\t */\n\tpublic function post($url, $headers = array(), $data = array(), $options = array()) {\n\t\treturn $this->request($url, $headers, $data, Requests::POST, $options);\n\t}\n\n\t/**\n\t * Send a PUT request\n\t */\n\tpublic function put($url, $headers = array(), $data = array(), $options = array()) {\n\t\treturn $this->request($url, $headers, $data, Requests::PUT, $options);\n\t}\n\n\t/**\n\t * Send a PATCH request\n\t *\n\t * Note: Unlike {@see post} and {@see put}, `$headers` is required, as the\n\t * specification recommends that should send an ETag\n\t *\n\t * @link https://tools.ietf.org/html/rfc5789\n\t */\n\tpublic function patch($url, $headers, $data = array(), $options = array()) {\n\t\treturn $this->request($url, $headers, $data, Requests::PATCH, $options);\n\t}\n\t/**#@-*/\n\n\t/**\n\t * Main interface for HTTP requests\n\t *\n\t * This method initiates a request and sends it via a transport before\n\t * parsing.\n\t *\n\t * @see Requests::request()\n\t *\n\t * @throws Requests_Exception On invalid URLs (`nonhttp`)\n\t *\n\t * @param string $url URL to request\n\t * @param array $headers Extra headers to send with the request\n\t * @param array|null $data Data to send either as a query string for GET/HEAD requests, or in the body for POST requests\n\t * @param string $type HTTP request type (use Requests constants)\n\t * @param array $options Options for the request (see {@see Requests::request})\n\t * @return Requests_Response\n\t */\n\tpublic function request($url, $headers = array(), $data = array(), $type = Requests::GET, $options = array()) {\n\t\t$request = $this->merge_request(compact('url', 'headers', 'data', 'options'));\n\n\t\treturn Requests::request($request['url'], $request['headers'], $request['data'], $type, $request['options']);\n\t}\n\n\t/**\n\t * Send multiple HTTP requests simultaneously\n\t *\n\t * @see Requests::request_multiple()\n\t *\n\t * @param array $requests Requests data (see {@see Requests::request_multiple})\n\t * @param array $options Global and default options (see {@see Requests::request})\n\t * @return array Responses (either Requests_Response or a Requests_Exception object)\n\t */\n\tpublic function request_multiple($requests, $options = array()) {\n\t\tforeach ($requests as $key => $request) {\n\t\t\t$requests[$key] = $this->merge_request($request, false);\n\t\t}\n\n\t\t$options = array_merge($this->options, $options);\n\n\t\t// Disallow forcing the type, as that's a per request setting\n\t\tunset($options['type']);\n\n\t\treturn Requests::request_multiple($requests, $options);\n\t}\n\n\t/**\n\t * Merge a request's data with the default data\n\t *\n\t * @param array $request Request data (same form as {@see request_multiple})\n\t * @param boolean $merge_options Should we merge options as well?\n\t * @return array Request data\n\t */\n\tprotected function merge_request($request, $merge_options = true) {\n\t\tif ($this->url !== null) {\n\t\t\t$request['url'] = Requests_IRI::absolutize($this->url, $request['url']);\n\t\t\t$request['url'] = $request['url']->uri;\n\t\t}\n\n\t\tif (empty($request['headers'])) {\n\t\t\t$request['headers'] = array();\n\t\t}\n\t\t$request['headers'] = array_merge($this->headers, $request['headers']);\n\n\t\tif (empty($request['data'])) {\n\t\t\tif (is_array($this->data)) {\n\t\t\t\t$request['data'] = $this->data;\n\t\t\t}\n\t\t}\n\t\telseif (is_array($request['data']) && is_array($this->data)) {\n\t\t\t$request['data'] = array_merge($this->data, $request['data']);\n\t\t}\n\n\t\tif ($merge_options !== false) {\n\t\t\t$request['options'] = array_merge($this->options, $request['options']);\n\n\t\t\t// Disallow forcing the type, as that's a per request setting\n\t\t\tunset($request['options']['type']);\n\t\t}\n\n\t\treturn $request;\n\t}\n}\n", "num_lines": 267}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SSL utilities for Requests\n *\n * @package Requests\n * @subpackage Utilities\n */\n\n/**\n * SSL utilities for Requests\n *\n * Collection of utilities for working with and verifying SSL certificates.\n *\n * @package Requests\n * @subpackage Utilities\n */\nclass Requests_SSL {\n\t/**\n\t * Verify the certificate against common name and subject alternative names\n\t *\n\t * Unfortunately, PHP doesn't check the certificate against the alternative\n\t * names, leading things like 'https://www.github.com/' to be invalid.\n\t * Instead\n\t *\n\t * @see https://tools.ietf.org/html/rfc2818#section-3.1 RFC2818, Section 3.1\n\t *\n\t * @throws Requests_Exception On not obtaining a match for the host (`fsockopen.ssl.no_match`)\n\t * @param string $host Host name to verify against\n\t * @param array $cert Certificate data from openssl_x509_parse()\n\t * @return bool\n\t */\n\tpublic static function verify_certificate($host, $cert) {\n\t\t// Calculate the valid wildcard match if the host is not an IP address\n\t\t$parts = explode('.', $host);\n\t\tif (ip2long($host) === false) {\n\t\t\t$parts[0] = '*';\n\t\t}\n\t\t$wildcard = implode('.', $parts);\n\n\t\t$has_dns_alt = false;\n\n\t\t// Check the subjectAltName\n\t\tif (!empty($cert['extensions']) && !empty($cert['extensions']['subjectAltName'])) {\n\t\t\t$altnames = explode(',', $cert['extensions']['subjectAltName']);\n\t\t\tforeach ($altnames as $altname) {\n\t\t\t\t$altname = trim($altname);\n\t\t\t\tif (strpos($altname, 'DNS:') !== 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$has_dns_alt = true;\n\n\t\t\t\t// Strip the 'DNS:' prefix and trim whitespace\n\t\t\t\t$altname = trim(substr($altname, 4));\n\n\t\t\t\t// Check for a match\n\t\t\t\tif (self::match_domain($host, $altname) === true) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Fall back to checking the common name if we didn't get any dNSName\n\t\t// alt names, as per RFC2818\n\t\tif (!$has_dns_alt && !empty($cert['subject']['CN'])) {\n\t\t\t// Check for a match\n\t\t\tif (self::match_domain($host, $cert['subject']['CN']) === true) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Verify that a reference name is valid\n\t *\n\t * Verifies a dNSName for HTTPS usage, (almost) as per Firefox's rules:\n\t * - Wildcards can only occur in a name with more than 3 components\n\t * - Wildcards can only occur as the last character in the first\n\t *   component\n\t * - Wildcards may be preceded by additional characters\n\t *\n\t * We modify these rules to be a bit stricter and only allow the wildcard\n\t * character to be the full first component; that is, with the exclusion of\n\t * the third rule.\n\t *\n\t * @param string $reference Reference dNSName\n\t * @return boolean Is the name valid?\n\t */\n\tpublic static function verify_reference_name($reference) {\n\t\t$parts = explode('.', $reference);\n\n\t\t// Check the first part of the name\n\t\t$first = array_shift($parts);\n\n\t\tif (strpos($first, '*') !== false) {\n\t\t\t// Check that the wildcard is the full part\n\t\t\tif ($first !== '*') {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Check that we have at least 3 components (including first)\n\t\t\tif (count($parts) < 2) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Check the remaining parts\n\t\tforeach ($parts as $part) {\n\t\t\tif (strpos($part, '*') !== false) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Nothing found, verified!\n\t\treturn true;\n\t}\n\n\t/**\n\t * Match a hostname against a dNSName reference\n\t *\n\t * @param string $host Requested host\n\t * @param string $reference dNSName to match against\n\t * @return boolean Does the domain match?\n\t */\n\tpublic static function match_domain($host, $reference) {\n\t\t// Check if the reference is blocklisted first\n\t\tif (self::verify_reference_name($reference) !== true) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check for a direct match\n\t\tif ($host === $reference) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Calculate the valid wildcard match if the host is not an IP address\n\t\t// Also validates that the host has 3 parts or more, as per Firefox's\n\t\t// ruleset.\n\t\tif (ip2long($host) === false) {\n\t\t\t$parts = explode('.', $host);\n\t\t\t$parts[0] = '*';\n\t\t\t$wildcard = implode('.', $parts);\n\t\t\tif ($wildcard === $reference) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n}\n", "num_lines": 153}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Base HTTP transport\n *\n * @package Requests\n * @subpackage Transport\n */\n\n/**\n * Base HTTP transport\n *\n * @package Requests\n * @subpackage Transport\n */\ninterface Requests_Transport {\n\t/**\n\t * Perform a request\n\t *\n\t * @param string $url URL to request\n\t * @param array $headers Associative array of request headers\n\t * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD\n\t * @param array $options Request options, see {@see Requests::response()} for documentation\n\t * @return string Raw HTTP result\n\t */\n\tpublic function request($url, $headers = array(), $data = array(), $options = array());\n\n\t/**\n\t * Send multiple requests simultaneously\n\t *\n\t * @param array $requests Request data (array of 'url', 'headers', 'data', 'options') as per {@see Requests_Transport::request}\n\t * @param array $options Global options, see {@see Requests::response()} for documentation\n\t * @return array Array of Requests_Response objects (may contain Requests_Exception or string responses as well)\n\t */\n\tpublic function request_multiple($requests, $options);\n\n\t/**\n\t * Self-test whether the transport can be used\n\t * @return bool\n\t */\n\tpublic static function test();\n}", "num_lines": 41}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Basic Authentication provider\n *\n * @package Requests\n * @subpackage Authentication\n */\n\n/**\n * Basic Authentication provider\n *\n * Provides a handler for Basic HTTP authentication via the Authorization\n * header.\n *\n * @package Requests\n * @subpackage Authentication\n */\nclass Requests_Auth_Basic implements Requests_Auth {\n\t/**\n\t * Username\n\t *\n\t * @var string\n\t */\n\tpublic $user;\n\n\t/**\n\t * Password\n\t *\n\t * @var string\n\t */\n\tpublic $pass;\n\n\t/**\n\t * Constructor\n\t *\n\t * @throws Requests_Exception On incorrect number of arguments (`authbasicbadargs`)\n\t * @param array|null $args Array of user and password. Must have exactly two elements\n\t */\n\tpublic function __construct($args = null) {\n\t\tif (is_array($args)) {\n\t\t\tif (count($args) !== 2) {\n\t\t\t\tthrow new Requests_Exception('Invalid number of arguments', 'authbasicbadargs');\n\t\t\t}\n\n\t\t\tlist($this->user, $this->pass) = $args;\n\t\t}\n\t}\n\n\t/**\n\t * Register the necessary callbacks\n\t *\n\t * @see curl_before_send\n\t * @see fsockopen_header\n\t * @param Requests_Hooks $hooks Hook system\n\t */\n\tpublic function register(Requests_Hooks &$hooks) {\n\t\t$hooks->register('curl.before_send', array(&$this, 'curl_before_send'));\n\t\t$hooks->register('fsockopen.after_headers', array(&$this, 'fsockopen_header'));\n\t}\n\n\t/**\n\t * Set cURL parameters before the data is sent\n\t *\n\t * @param resource $handle cURL resource\n\t */\n\tpublic function curl_before_send(&$handle) {\n\t\tcurl_setopt($handle, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\t\tcurl_setopt($handle, CURLOPT_USERPWD, $this->getAuthString());\n\t}\n\n\t/**\n\t * Add extra headers to the request before sending\n\t *\n\t * @param string $out HTTP header string\n\t */\n\tpublic function fsockopen_header(&$out) {\n\t\t$out .= sprintf(\"Authorization: Basic %s\\r\\n\", base64_encode($this->getAuthString()));\n\t}\n\n\t/**\n\t * Get the authentication string (user:pass)\n\t *\n\t * @return string\n\t */\n\tpublic function getAuthString() {\n\t\treturn $this->user . ':' . $this->pass;\n\t}\n}", "num_lines": 88}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Cookie holder object\n *\n * @package Requests\n * @subpackage Cookies\n */\n\n/**\n * Cookie holder object\n *\n * @package Requests\n * @subpackage Cookies\n */\nclass Requests_Cookie_Jar implements ArrayAccess, IteratorAggregate {\n\t/**\n\t * Actual item data\n\t *\n\t * @var array\n\t */\n\tprotected $cookies = array();\n\n\t/**\n\t * Create a new jar\n\t *\n\t * @param array $cookies Existing cookie values\n\t */\n\tpublic function __construct($cookies = array()) {\n\t\t$this->cookies = $cookies;\n\t}\n\n\t/**\n\t * Normalise cookie data into a Requests_Cookie\n\t *\n\t * @param string|Requests_Cookie $cookie\n\t * @return Requests_Cookie\n\t */\n\tpublic function normalize_cookie($cookie, $key = null) {\n\t\tif ($cookie instanceof Requests_Cookie) {\n\t\t\treturn $cookie;\n\t\t}\n\n\t\treturn Requests_Cookie::parse($cookie, $key);\n\t}\n\n\t/**\n\t * Normalise cookie data into a Requests_Cookie\n\t *\n\t * @codeCoverageIgnore\n\t * @deprecated Use {@see Requests_Cookie_Jar::normalize_cookie}\n\t * @return Requests_Cookie\n\t */\n\tpublic function normalizeCookie($cookie, $key = null) {\n\t\treturn $this->normalize_cookie($cookie, $key);\n\t}\n\n\t/**\n\t * Check if the given item exists\n\t *\n\t * @param string $key Item key\n\t * @return boolean Does the item exist?\n\t */\n\tpublic function offsetExists($key) {\n\t\treturn isset($this->cookies[$key]);\n\t}\n\n\t/**\n\t * Get the value for the item\n\t *\n\t * @param string $key Item key\n\t * @return string Item value\n\t */\n\tpublic function offsetGet($key) {\n\t\tif (!isset($this->cookies[$key])) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->cookies[$key];\n\t}\n\n\t/**\n\t * Set the given item\n\t *\n\t * @throws Requests_Exception On attempting to use dictionary as list (`invalidset`)\n\t *\n\t * @param string $key Item name\n\t * @param string $value Item value\n\t */\n\tpublic function offsetSet($key, $value) {\n\t\tif ($key === null) {\n\t\t\tthrow new Requests_Exception('Object is a dictionary, not a list', 'invalidset');\n\t\t}\n\n\t\t$this->cookies[$key] = $value;\n\t}\n\n\t/**\n\t * Unset the given header\n\t *\n\t * @param string $key\n\t */\n\tpublic function offsetUnset($key) {\n\t\tunset($this->cookies[$key]);\n\t}\n\n\t/**\n\t * Get an iterator for the data\n\t *\n\t * @return ArrayIterator\n\t */\n\tpublic function getIterator() {\n\t\treturn new ArrayIterator($this->cookies);\n\t}\n\n\t/**\n\t * Register the cookie handler with the request's hooking system\n\t *\n\t * @param Requests_Hooker $hooks Hooking system\n\t */\n\tpublic function register(Requests_Hooker $hooks) {\n\t\t$hooks->register('requests.before_request', array($this, 'before_request'));\n\t\t$hooks->register('requests.before_redirect_check', array($this, 'before_redirect_check'));\n\t}\n\n\t/**\n\t * Add Cookie header to a request if we have any\n\t *\n\t * As per RFC 6265, cookies are separated by '; '\n\t *\n\t * @param string $url\n\t * @param array $headers\n\t * @param array $data\n\t * @param string $type\n\t * @param array $options\n\t */\n\tpublic function before_request($url, &$headers, &$data, &$type, &$options) {\n\t\tif (!$url instanceof Requests_IRI) {\n\t\t\t$url = new Requests_IRI($url);\n\t\t}\n\n\t\tif (!empty($this->cookies)) {\n\t\t\t$cookies = array();\n\t\t\tforeach ($this->cookies as $key => $cookie) {\n\t\t\t\t$cookie = $this->normalize_cookie($cookie, $key);\n\n\t\t\t\t// Skip expired cookies\n\t\t\t\tif ($cookie->is_expired()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ($cookie->domain_matches($url->host)) {\n\t\t\t\t\t$cookies[] = $cookie->format_for_header();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$headers['Cookie'] = implode('; ', $cookies);\n\t\t}\n\t}\n\n\t/**\n\t * Parse all cookies from a response and attach them to the response\n\t *\n\t * @var Requests_Response $response\n\t */\n\tpublic function before_redirect_check(Requests_Response &$return) {\n\t\t$url = $return->url;\n\t\tif (!$url instanceof Requests_IRI) {\n\t\t\t$url = new Requests_IRI($url);\n\t\t}\n\n\t\t$cookies = Requests_Cookie::parse_from_headers($return->headers, $url);\n\t\t$this->cookies = array_merge($this->cookies, $cookies);\n\t\t$return->cookies = $this;\n\t}\n}", "num_lines": 175}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception based on HTTP response\n *\n * @package Requests\n */\n\n/**\n * Exception based on HTTP response\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP extends Requests_Exception {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 0;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Unknown';\n\n\t/**\n\t * Create a new exception\n\t *\n\t * There is no mechanism to pass in the status code, as this is set by the\n\t * subclass used. Reason phrases can vary, however.\n\t *\n\t * @param string|null $reason Reason phrase\n\t * @param mixed $data Associated data\n\t */\n\tpublic function __construct($reason = null, $data = null) {\n\t\tif ($reason !== null) {\n\t\t\t$this->reason = $reason;\n\t\t}\n\n\t\t$message = sprintf('%d %s', $this->code, $this->reason);\n\t\tparent::__construct($message, 'httpresponse', $data, $this->code);\n\t}\n\n\t/**\n\t * Get the status message\n\t */\n\tpublic function getReason() {\n\t\treturn $this->reason;\n\t}\n\n\t/**\n\t * Get the correct exception class for a given error code\n\t *\n\t * @param int|bool $code HTTP status code, or false if unavailable\n\t * @return string Exception class name to use\n\t */\n\tpublic static function get_class($code) {\n\t\tif (!$code) {\n\t\t\treturn 'Requests_Exception_HTTP_Unknown';\n\t\t}\n\n\t\t$class = sprintf('Requests_Exception_HTTP_%d', $code);\n\t\tif (class_exists($class)) {\n\t\t\treturn $class;\n\t\t}\n\n\t\treturn 'Requests_Exception_HTTP_Unknown';\n\t}\n}", "num_lines": 71}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nclass Requests_Exception_Transport extends Requests_Exception {\n\n}\n", "num_lines": 6}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 304 Not Modified responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 304 Not Modified responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_304 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 304;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Not Modified';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 305 Use Proxy responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 305 Use Proxy responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_305 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 305;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Use Proxy';\n}\n", "num_lines": 28}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 306 Switch Proxy responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 306 Switch Proxy responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_306 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 306;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Switch Proxy';\n}\n", "num_lines": 28}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 400 Bad Request responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 400 Bad Request responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_400 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 400;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Bad Request';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 401 Unauthorized responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 401 Unauthorized responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_401 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 401;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Unauthorized';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 402 Payment Required responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 402 Payment Required responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_402 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 402;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Payment Required';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 403 Forbidden responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 403 Forbidden responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_403 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 403;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Forbidden';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 404 Not Found responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 404 Not Found responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_404 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 404;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Not Found';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 405 Method Not Allowed responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 405 Method Not Allowed responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_405 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 405;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Method Not Allowed';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 406 Not Acceptable responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 406 Not Acceptable responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_406 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 406;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Not Acceptable';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 407 Proxy Authentication Required responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 407 Proxy Authentication Required responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_407 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 407;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Proxy Authentication Required';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 408 Request Timeout responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 408 Request Timeout responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_408 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 408;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Request Timeout';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 409 Conflict responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 409 Conflict responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_409 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 409;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Conflict';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 410 Gone responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 410 Gone responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_410 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 410;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Gone';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 411 Length Required responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 411 Length Required responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_411 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 411;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Length Required';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 412 Precondition Failed responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 412 Precondition Failed responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_412 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 412;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Precondition Failed';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 413 Request Entity Too Large responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 413 Request Entity Too Large responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_413 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 413;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Request Entity Too Large';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 414 Request-URI Too Large responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 414 Request-URI Too Large responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_414 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 414;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Request-URI Too Large';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 415 Unsupported Media Type responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 415 Unsupported Media Type responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_415 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 415;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Unsupported Media Type';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 416 Requested Range Not Satisfiable responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 416 Requested Range Not Satisfiable responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_416 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 416;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Requested Range Not Satisfiable';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 417 Expectation Failed responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 417 Expectation Failed responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_417 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 417;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Expectation Failed';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 418 I'm A Teapot responses\n *\n * @see https://tools.ietf.org/html/rfc2324\n * @package Requests\n */\n\n/**\n * Exception for 418 I'm A Teapot responses\n *\n * @see https://tools.ietf.org/html/rfc2324\n * @package Requests\n */\nclass Requests_Exception_HTTP_418 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 418;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = \"I'm A Teapot\";\n}", "num_lines": 29}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 428 Precondition Required responses\n *\n * @see https://tools.ietf.org/html/rfc6585\n * @package Requests\n */\n\n/**\n * Exception for 428 Precondition Required responses\n *\n * @see https://tools.ietf.org/html/rfc6585\n * @package Requests\n */\nclass Requests_Exception_HTTP_428 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 428;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Precondition Required';\n}", "num_lines": 29}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 429 Too Many Requests responses\n *\n * @see https://tools.ietf.org/html/draft-nottingham-http-new-status-04\n * @package Requests\n */\n\n/**\n * Exception for 429 Too Many Requests responses\n *\n * @see https://tools.ietf.org/html/draft-nottingham-http-new-status-04\n * @package Requests\n */\nclass Requests_Exception_HTTP_429 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 429;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Too Many Requests';\n}", "num_lines": 29}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 431 Request Header Fields Too Large responses\n *\n * @see https://tools.ietf.org/html/rfc6585\n * @package Requests\n */\n\n/**\n * Exception for 431 Request Header Fields Too Large responses\n *\n * @see https://tools.ietf.org/html/rfc6585\n * @package Requests\n */\nclass Requests_Exception_HTTP_431 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 431;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Request Header Fields Too Large';\n}", "num_lines": 29}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 500 Internal Server Error responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 500 Internal Server Error responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_500 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 500;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Internal Server Error';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 501 Not Implemented responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 501 Not Implemented responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_501 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 501;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Not Implemented';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 502 Bad Gateway responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 502 Bad Gateway responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_502 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 502;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Bad Gateway';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 503 Service Unavailable responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 503 Service Unavailable responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_503 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 503;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Service Unavailable';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 504 Gateway Timeout responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 504 Gateway Timeout responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_504 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 504;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Gateway Timeout';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 505 HTTP Version Not Supported responses\n *\n * @package Requests\n */\n\n/**\n * Exception for 505 HTTP Version Not Supported responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_505 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 505;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'HTTP Version Not Supported';\n}", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for 511 Network Authentication Required responses\n *\n * @see https://tools.ietf.org/html/rfc6585\n * @package Requests\n */\n\n/**\n * Exception for 511 Network Authentication Required responses\n *\n * @see https://tools.ietf.org/html/rfc6585\n * @package Requests\n */\nclass Requests_Exception_HTTP_511 extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = 511;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Network Authentication Required';\n}", "num_lines": 29}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Exception for unknown status responses\n *\n * @package Requests\n */\n\n/**\n * Exception for unknown status responses\n *\n * @package Requests\n */\nclass Requests_Exception_HTTP_Unknown extends Requests_Exception_HTTP {\n\t/**\n\t * HTTP status code\n\t *\n\t * @var integer|bool Code if available, false if an error occurred\n\t */\n\tprotected $code = 0;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Unknown';\n\n\t/**\n\t * Create a new exception\n\t *\n\t * If `$data` is an instance of {@see Requests_Response}, uses the status\n\t * code from it. Otherwise, sets as 0\n\t *\n\t * @param string|null $reason Reason phrase\n\t * @param mixed $data Associated data\n\t */\n\tpublic function __construct($reason = null, $data = null) {\n\t\tif ($data instanceof Requests_Response) {\n\t\t\t$this->code = $data->status_code;\n\t\t}\n\n\t\tparent::__construct($reason, $data);\n\t}\n}", "num_lines": 44}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nclass Requests_Exception_Transport_cURL extends Requests_Exception_Transport {\n\n\tconst EASY = 'cURLEasy';\n\tconst MULTI = 'cURLMulti';\n\tconst SHARE = 'cURLShare';\n\n\t/**\n\t * cURL error code\n\t *\n\t * @var integer\n\t */\n\tprotected $code = -1;\n\n\t/**\n\t * Which type of cURL error\n\t *\n\t * EASY|MULTI|SHARE\n\t *\n\t * @var string\n\t */\n\tprotected $type = 'Unknown';\n\n\t/**\n\t * Clear text error message\n\t *\n\t * @var string\n\t */\n\tprotected $reason = 'Unknown';\n\n\tpublic function __construct($message, $type, $data = null, $code = 0) {\n\t\tif ($type !== null) {\n\t\t\t$this->type = $type;\n\t\t}\n\n\t\tif ($code !== null) {\n\t\t\t$this->code = $code;\n\t\t}\n\n\t\tif ($message !== null) {\n\t\t\t$this->reason = $message;\n\t\t}\n\n\t\t$message = sprintf('%d %s', $this->code, $this->reason);\n\t\tparent::__construct($message, $this->type, $data, $this->code);\n\t}\n\n\t/**\n\t * Get the error message\n\t */\n\tpublic function getReason() {\n\t\treturn $this->reason;\n\t}\n\n}\n", "num_lines": 57}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * HTTP Proxy connection interface\n *\n * @package Requests\n * @subpackage Proxy\n * @since 1.6\n */\n\n/**\n * HTTP Proxy connection interface\n *\n * Provides a handler for connection via an HTTP proxy\n *\n * @package Requests\n * @subpackage Proxy\n * @since 1.6\n */\nclass Requests_Proxy_HTTP implements Requests_Proxy {\n\t/**\n\t * Proxy host and port\n\t *\n\t * Notation: \"host:port\" (eg 127.0.0.1:8080 or someproxy.com:3128)\n\t *\n\t * @var string\n\t */\n\tpublic $proxy;\n\n\t/**\n\t * Username\n\t *\n\t * @var string\n\t */\n\tpublic $user;\n\n\t/**\n\t * Password\n\t *\n\t * @var string\n\t */\n\tpublic $pass;\n\n\t/**\n\t * Do we need to authenticate? (ie username & password have been provided)\n\t *\n\t * @var boolean\n\t */\n\tpublic $use_authentication;\n\n\t/**\n\t * Constructor\n\t *\n\t * @since 1.6\n\t * @throws Requests_Exception On incorrect number of arguments (`authbasicbadargs`)\n\t * @param array|null $args Array of user and password. Must have exactly two elements\n\t */\n\tpublic function __construct($args = null) {\n\t\tif (is_string($args)) {\n\t\t\t$this->proxy = $args;\n\t\t}\n\t\telseif (is_array($args)) {\n\t\t\tif (count($args) == 1) {\n\t\t\t\tlist($this->proxy) = $args;\n\t\t\t}\n\t\t\telseif (count($args) == 3) {\n\t\t\t\tlist($this->proxy, $this->user, $this->pass) = $args;\n\t\t\t\t$this->use_authentication = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new Requests_Exception('Invalid number of arguments', 'proxyhttpbadargs');\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Register the necessary callbacks\n\t *\n\t * @since 1.6\n\t * @see curl_before_send\n\t * @see fsockopen_remote_socket\n\t * @see fsockopen_remote_host_path\n\t * @see fsockopen_header\n\t * @param Requests_Hooks $hooks Hook system\n\t */\n\tpublic function register(Requests_Hooks &$hooks) {\n\t\t$hooks->register('curl.before_send', array(&$this, 'curl_before_send'));\n\n\t\t$hooks->register('fsockopen.remote_socket', array(&$this, 'fsockopen_remote_socket'));\n\t\t$hooks->register('fsockopen.remote_host_path', array(&$this, 'fsockopen_remote_host_path'));\n\t\tif ($this->use_authentication) {\n\t\t\t$hooks->register('fsockopen.after_headers', array(&$this, 'fsockopen_header'));\n\t\t}\n\t}\n\n\t/**\n\t * Set cURL parameters before the data is sent\n\t *\n\t * @since 1.6\n\t * @param resource $handle cURL resource\n\t */\n\tpublic function curl_before_send(&$handle) {\n\t\tcurl_setopt($handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);\n\t\tcurl_setopt($handle, CURLOPT_PROXY, $this->proxy);\n\n\t\tif ($this->use_authentication) {\n\t\t\tcurl_setopt($handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY);\n\t\t\tcurl_setopt($handle, CURLOPT_PROXYUSERPWD, $this->get_auth_string());\n\t\t}\n\t}\n\n\t/**\n\t * Alter remote socket information before opening socket connection\n\t *\n\t * @since 1.6\n\t * @param string $remote_socket Socket connection string\n\t */\n\tpublic function fsockopen_remote_socket(&$remote_socket) {\n\t\t$remote_socket = $this->proxy;\n\t}\n\n\t/**\n\t * Alter remote path before getting stream data\n\t *\n\t * @since 1.6\n\t * @param string $path Path to send in HTTP request string (\"GET ...\")\n\t * @param string $url Full URL we're requesting\n\t */\n\tpublic function fsockopen_remote_host_path(&$path, $url) {\n\t\t$path = $url;\n\t}\n\n\t/**\n\t * Add extra headers to the request before sending\n\t *\n\t * @since 1.6\n\t * @param string $out HTTP header string\n\t */\n\tpublic function fsockopen_header(&$out) {\n\t\t$out .= sprintf(\"Proxy-Authorization: Basic %s\\r\\n\", base64_encode($this->get_auth_string()));\n\t}\n\n\t/**\n\t * Get the authentication string (user:pass)\n\t *\n\t * @since 1.6\n\t * @return string\n\t */\n\tpublic function get_auth_string() {\n\t\treturn $this->user . ':' . $this->pass;\n\t}\n}", "num_lines": 151}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Case-insensitive dictionary, suitable for HTTP headers\n *\n * @package Requests\n */\n\n/**\n * Case-insensitive dictionary, suitable for HTTP headers\n *\n * @package Requests\n */\nclass Requests_Response_Headers extends Requests_Utility_CaseInsensitiveDictionary {\n\t/**\n\t * Get the given header\n\t *\n\t * Unlike {@see self::getValues()}, this returns a string. If there are\n\t * multiple values, it concatenates them with a comma as per RFC2616.\n\t *\n\t * Avoid using this where commas may be used unquoted in values, such as\n\t * Set-Cookie headers.\n\t *\n\t * @param string $key\n\t * @return string Header value\n\t */\n\tpublic function offsetGet($key) {\n\t\t$key = strtolower($key);\n\t\tif (!isset($this->data[$key])) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->flatten($this->data[$key]);\n\t}\n\n\t/**\n\t * Set the given item\n\t *\n\t * @throws Requests_Exception On attempting to use dictionary as list (`invalidset`)\n\t *\n\t * @param string $key Item name\n\t * @param string $value Item value\n\t */\n\tpublic function offsetSet($key, $value) {\n\t\tif ($key === null) {\n\t\t\tthrow new Requests_Exception('Object is a dictionary, not a list', 'invalidset');\n\t\t}\n\n\t\t$key = strtolower($key);\n\n\t\tif (!isset($this->data[$key])) {\n\t\t\t$this->data[$key] = array();\n\t\t}\n\n\t\t$this->data[$key][] = $value;\n\t}\n\n\t/**\n\t * Get all values for a given header\n\t *\n\t * @param string $key\n\t * @return array Header values\n\t */\n\tpublic function getValues($key) {\n\t\t$key = strtolower($key);\n\t\tif (!isset($this->data[$key])) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->data[$key];\n\t}\n\n\t/**\n\t * Flattens a value into a string\n\t *\n\t * Converts an array into a string by imploding values with a comma, as per\n\t * RFC2616's rules for folding headers.\n\t *\n\t * @param string|array $value Value to flatten\n\t * @return string Flattened value\n\t */\n\tpublic function flatten($value) {\n\t\tif (is_array($value)) {\n\t\t\t$value = implode(',', $value);\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Get an iterator for the data\n\t *\n\t * Converts the internal\n\t * @return ArrayIterator\n\t */\n\tpublic function getIterator() {\n\t\treturn new Requests_Utility_FilteredIterator($this->data, array($this, 'flatten'));\n\t}\n}\n", "num_lines": 99}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * cURL HTTP transport\n *\n * @package Requests\n * @subpackage Transport\n */\n\n/**\n * cURL HTTP transport\n *\n * @package Requests\n * @subpackage Transport\n */\nclass Requests_Transport_cURL implements Requests_Transport {\n\tconst CURL_7_10_5 = 0x070A05;\n\tconst CURL_7_16_2 = 0x071002;\n\n\t/**\n\t * Raw HTTP data\n\t *\n\t * @var string\n\t */\n\tpublic $headers = '';\n\n\t/**\n\t * Raw body data\n\t *\n\t * @var string\n\t */\n\tpublic $response_data = '';\n\n\t/**\n\t * Information on the current request\n\t *\n\t * @var array cURL information array, see {@see https://secure.php.net/curl_getinfo}\n\t */\n\tpublic $info;\n\n\t/**\n\t * Version string\n\t *\n\t * @var long\n\t */\n\tpublic $version;\n\n\t/**\n\t * cURL handle\n\t *\n\t * @var resource\n\t */\n\tprotected $handle;\n\n\t/**\n\t * Hook dispatcher instance\n\t *\n\t * @var Requests_Hooks\n\t */\n\tprotected $hooks;\n\n\t/**\n\t * Have we finished the headers yet?\n\t *\n\t * @var boolean\n\t */\n\tprotected $done_headers = false;\n\n\t/**\n\t * If streaming to a file, keep the file pointer\n\t *\n\t * @var resource\n\t */\n\tprotected $stream_handle;\n\n\t/**\n\t * How many bytes are in the response body?\n\t *\n\t * @var int\n\t */\n\tprotected $response_bytes;\n\n\t/**\n\t * What's the maximum number of bytes we should keep?\n\t *\n\t * @var int|bool Byte count, or false if no limit.\n\t */\n\tprotected $response_byte_limit;\n\n\t/**\n\t * Constructor\n\t */\n\tpublic function __construct() {\n\t\t$curl = curl_version();\n\t\t$this->version = $curl['version_number'];\n\t\t$this->handle = curl_init();\n\n\t\tcurl_setopt($this->handle, CURLOPT_HEADER, false);\n\t\tcurl_setopt($this->handle, CURLOPT_RETURNTRANSFER, 1);\n\t\tif ($this->version >= self::CURL_7_10_5) {\n\t\t\tcurl_setopt($this->handle, CURLOPT_ENCODING, '');\n\t\t}\n\t\tif (defined('CURLOPT_PROTOCOLS')) {\n\t\t\tcurl_setopt($this->handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);\n\t\t}\n\t\tif (defined('CURLOPT_REDIR_PROTOCOLS')) {\n\t\t\tcurl_setopt($this->handle, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);\n\t\t}\n\t}\n\n\t/**\n\t * Destructor\n\t */\n\tpublic function __destruct() {\n\t\tif (is_resource($this->handle)) {\n\t\t\tcurl_close($this->handle);\n\t\t}\n\t}\n\n\t/**\n\t * Perform a request\n\t *\n\t * @throws Requests_Exception On a cURL error (`curlerror`)\n\t *\n\t * @param string $url URL to request\n\t * @param array $headers Associative array of request headers\n\t * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD\n\t * @param array $options Request options, see {@see Requests::response()} for documentation\n\t * @return string Raw HTTP result\n\t */\n\tpublic function request($url, $headers = array(), $data = array(), $options = array()) {\n\t\t$this->hooks = $options['hooks'];\n\n\t\t$this->setup_handle($url, $headers, $data, $options);\n\n\t\t$options['hooks']->dispatch('curl.before_send', array(&$this->handle));\n\n\t\tif ($options['filename'] !== false) {\n\t\t\t$this->stream_handle = fopen($options['filename'], 'wb');\n\t\t}\n\n\t\t$this->response_data = '';\n\t\t$this->response_bytes = 0;\n\t\t$this->response_byte_limit = false;\n\t\tif ($options['max_bytes'] !== false) {\n\t\t\t$this->response_byte_limit = $options['max_bytes'];\n\t\t}\n\n\t\tif (isset($options['verify'])) {\n\t\t\tif ($options['verify'] === false) {\n\t\t\t\tcurl_setopt($this->handle, CURLOPT_SSL_VERIFYHOST, 0);\n\t\t\t\tcurl_setopt($this->handle, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t\t}\n\t\t\telseif (is_string($options['verify'])) {\n\t\t\t\tcurl_setopt($this->handle, CURLOPT_CAINFO, $options['verify']);\n\t\t\t}\n\t\t}\n\n\t\tif (isset($options['verifyname']) && $options['verifyname'] === false) {\n\t\t\tcurl_setopt($this->handle, CURLOPT_SSL_VERIFYHOST, 0);\n\t\t}\n\n\t\tcurl_exec($this->handle);\n\t\t$response = $this->response_data;\n\n\t\t$options['hooks']->dispatch('curl.after_send', array());\n\n\t\tif (curl_errno($this->handle) === 23 || curl_errno($this->handle) === 61) {\n\t\t\t// Reset encoding and try again\n\t\t\tcurl_setopt($this->handle, CURLOPT_ENCODING, 'none');\n\n\t\t\t$this->response_data = '';\n\t\t\t$this->response_bytes = 0;\n\t\t\tcurl_exec($this->handle);\n\t\t\t$response = $this->response_data;\n\t\t}\n\n\t\t$this->process_response($response, $options);\n\n\t\t// Need to remove the $this reference from the curl handle.\n\t\t// Otherwise Requests_Transport_cURL wont be garbage collected and the curl_close() will never be called.\n\t\tcurl_setopt($this->handle, CURLOPT_HEADERFUNCTION, null);\n\t\tcurl_setopt($this->handle, CURLOPT_WRITEFUNCTION, null);\n\n\t\treturn $this->headers;\n\t}\n\n\t/**\n\t * Send multiple requests simultaneously\n\t *\n\t * @param array $requests Request data\n\t * @param array $options Global options\n\t * @return array Array of Requests_Response objects (may contain Requests_Exception or string responses as well)\n\t */\n\tpublic function request_multiple($requests, $options) {\n\t\t// If you're not requesting, we can't get any responses \u00c2\u00af\\_(\u00e3\u0192\u201e)_/\u00c2\u00af\n\t\tif (empty($requests)) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$multihandle = curl_multi_init();\n\t\t$subrequests = array();\n\t\t$subhandles = array();\n\n\t\t$class = get_class($this);\n\t\tforeach ($requests as $id => $request) {\n\t\t\t$subrequests[$id] = new $class();\n\t\t\t$subhandles[$id] = $subrequests[$id]->get_subrequest_handle($request['url'], $request['headers'], $request['data'], $request['options']);\n\t\t\t$request['options']['hooks']->dispatch('curl.before_multi_add', array(&$subhandles[$id]));\n\t\t\tcurl_multi_add_handle($multihandle, $subhandles[$id]);\n\t\t}\n\n\t\t$completed = 0;\n\t\t$responses = array();\n\n\t\t$request['options']['hooks']->dispatch('curl.before_multi_exec', array(&$multihandle));\n\n\t\tdo {\n\t\t\t$active = false;\n\n\t\t\tdo {\n\t\t\t\t$status = curl_multi_exec($multihandle, $active);\n\t\t\t}\n\t\t\twhile ($status === CURLM_CALL_MULTI_PERFORM);\n\n\t\t\t$to_process = array();\n\n\t\t\t// Read the information as needed\n\t\t\twhile ($done = curl_multi_info_read($multihandle)) {\n\t\t\t\t$key = array_search($done['handle'], $subhandles, true);\n\t\t\t\tif (!isset($to_process[$key])) {\n\t\t\t\t\t$to_process[$key] = $done;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Parse the finished requests before we start getting the new ones\n\t\t\tforeach ($to_process as $key => $done) {\n\t\t\t\t$options = $requests[$key]['options'];\n\t\t\t\tif (CURLE_OK !== $done['result']) {\n\t\t\t\t\t//get error string for handle.\n\t\t\t\t\t$reason = curl_error($done['handle']);\n\t\t\t\t\t$exception = new Requests_Exception_Transport_cURL(\n\t\t\t\t\t\t\t\t\t$reason,\n\t\t\t\t\t\t\t\t\tRequests_Exception_Transport_cURL::EASY,\n\t\t\t\t\t\t\t\t\t$done['handle'],\n\t\t\t\t\t\t\t\t\t$done['result']\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t$responses[$key] = $exception;\n\t\t\t\t\t$options['hooks']->dispatch('transport.internal.parse_error', array(&$responses[$key], $requests[$key]));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$responses[$key] = $subrequests[$key]->process_response($subrequests[$key]->response_data, $options);\n\n\t\t\t\t\t$options['hooks']->dispatch('transport.internal.parse_response', array(&$responses[$key], $requests[$key]));\n\t\t\t\t}\n\n\t\t\t\tcurl_multi_remove_handle($multihandle, $done['handle']);\n\t\t\t\tcurl_close($done['handle']);\n\n\t\t\t\tif (!is_string($responses[$key])) {\n\t\t\t\t\t$options['hooks']->dispatch('multiple.request.complete', array(&$responses[$key], $key));\n\t\t\t\t}\n\t\t\t\t$completed++;\n\t\t\t}\n\t\t}\n\t\twhile ($active || $completed < count($subrequests));\n\n\t\t$request['options']['hooks']->dispatch('curl.after_multi_exec', array(&$multihandle));\n\n\t\tcurl_multi_close($multihandle);\n\n\t\treturn $responses;\n\t}\n\n\t/**\n\t * Get the cURL handle for use in a multi-request\n\t *\n\t * @param string $url URL to request\n\t * @param array $headers Associative array of request headers\n\t * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD\n\t * @param array $options Request options, see {@see Requests::response()} for documentation\n\t * @return resource Subrequest's cURL handle\n\t */\n\tpublic function &get_subrequest_handle($url, $headers, $data, $options) {\n\t\t$this->setup_handle($url, $headers, $data, $options);\n\n\t\tif ($options['filename'] !== false) {\n\t\t\t$this->stream_handle = fopen($options['filename'], 'wb');\n\t\t}\n\n\t\t$this->response_data = '';\n\t\t$this->response_bytes = 0;\n\t\t$this->response_byte_limit = false;\n\t\tif ($options['max_bytes'] !== false) {\n\t\t\t$this->response_byte_limit = $options['max_bytes'];\n\t\t}\n\t\t$this->hooks = $options['hooks'];\n\n\t\treturn $this->handle;\n\t}\n\n\t/**\n\t * Setup the cURL handle for the given data\n\t *\n\t * @param string $url URL to request\n\t * @param array $headers Associative array of request headers\n\t * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD\n\t * @param array $options Request options, see {@see Requests::response()} for documentation\n\t */\n\tprotected function setup_handle($url, $headers, $data, $options) {\n\t\t$options['hooks']->dispatch('curl.before_request', array(&$this->handle));\n\n\t\t// Force closing the connection for old versions of cURL (<7.22).\n\t\tif ( ! isset( $headers['Connection'] ) ) {\n\t\t\t$headers['Connection'] = 'close';\n\t\t}\n\n\t\t$headers = Requests::flatten($headers);\n\n\t\tif (!empty($data)) {\n\t\t\t$data_format = $options['data_format'];\n\n\t\t\tif ($data_format === 'query') {\n\t\t\t\t$url = self::format_get($url, $data);\n\t\t\t\t$data = '';\n\t\t\t}\n\t\t\telseif (!is_string($data)) {\n\t\t\t\t$data = http_build_query($data, null, '&');\n\t\t\t}\n\t\t}\n\n\t\tswitch ($options['type']) {\n\t\t\tcase Requests::POST:\n\t\t\t\tcurl_setopt($this->handle, CURLOPT_POST, true);\n\t\t\t\tcurl_setopt($this->handle, CURLOPT_POSTFIELDS, $data);\n\t\t\t\tbreak;\n\t\t\tcase Requests::HEAD:\n\t\t\t\tcurl_setopt($this->handle, CURLOPT_CUSTOMREQUEST, $options['type']);\n\t\t\t\tcurl_setopt($this->handle, CURLOPT_NOBODY, true);\n\t\t\t\tbreak;\n\t\t\tcase Requests::TRACE:\n\t\t\t\tcurl_setopt($this->handle, CURLOPT_CUSTOMREQUEST, $options['type']);\n\t\t\t\tbreak;\n\t\t\tcase Requests::PATCH:\n\t\t\tcase Requests::PUT:\n\t\t\tcase Requests::DELETE:\n\t\t\tcase Requests::OPTIONS:\n\t\t\tdefault:\n\t\t\t\tcurl_setopt($this->handle, CURLOPT_CUSTOMREQUEST, $options['type']);\n\t\t\t\tif (!empty($data)) {\n\t\t\t\t\tcurl_setopt($this->handle, CURLOPT_POSTFIELDS, $data);\n\t\t\t\t}\n\t\t}\n\n\t\t// cURL requires a minimum timeout of 1 second when using the system\n\t\t// DNS resolver, as it uses `alarm()`, which is second resolution only.\n\t\t// There's no way to detect which DNS resolver is being used from our\n\t\t// end, so we need to round up regardless of the supplied timeout.\n\t\t//\n\t\t// https://github.com/curl/curl/blob/4f45240bc84a9aa648c8f7243be7b79e9f9323a5/lib/hostip.c#L606-L609\n\t\t$timeout = max($options['timeout'], 1);\n\n\t\tif (is_int($timeout) || $this->version < self::CURL_7_16_2) {\n\t\t\tcurl_setopt($this->handle, CURLOPT_TIMEOUT, ceil($timeout));\n\t\t}\n\t\telse {\n\t\t\tcurl_setopt($this->handle, CURLOPT_TIMEOUT_MS, round($timeout * 1000));\n\t\t}\n\n\t\tif (is_int($options['connect_timeout']) || $this->version < self::CURL_7_16_2) {\n\t\t\tcurl_setopt($this->handle, CURLOPT_CONNECTTIMEOUT, ceil($options['connect_timeout']));\n\t\t}\n\t\telse {\n\t\t\tcurl_setopt($this->handle, CURLOPT_CONNECTTIMEOUT_MS, round($options['connect_timeout'] * 1000));\n\t\t}\n\t\tcurl_setopt($this->handle, CURLOPT_URL, $url);\n\t\tcurl_setopt($this->handle, CURLOPT_REFERER, $url);\n\t\tcurl_setopt($this->handle, CURLOPT_USERAGENT, $options['useragent']);\n\t\tif (!empty($headers)) {\n\t\t\tcurl_setopt($this->handle, CURLOPT_HTTPHEADER, $headers);\n\t\t}\n\t\tif ($options['protocol_version'] === 1.1) {\n\t\t\tcurl_setopt($this->handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n\t\t}\n\t\telse {\n\t\t\tcurl_setopt($this->handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\n\t\t}\n\n\t\tif (true === $options['blocking']) {\n\t\t\tcurl_setopt($this->handle, CURLOPT_HEADERFUNCTION, array(&$this, 'stream_headers'));\n\t\t\tcurl_setopt($this->handle, CURLOPT_WRITEFUNCTION, array(&$this, 'stream_body'));\n\t\t\tcurl_setopt($this->handle, CURLOPT_BUFFERSIZE, Requests::BUFFER_SIZE);\n\t\t}\n\t}\n\n\t/**\n\t * Process a response\n\t *\n\t * @param string $response Response data from the body\n\t * @param array $options Request options\n\t * @return string HTTP response data including headers\n\t */\n\tpublic function process_response($response, $options) {\n\t\tif ($options['blocking'] === false) {\n\t\t\t$fake_headers = '';\n\t\t\t$options['hooks']->dispatch('curl.after_request', array(&$fake_headers));\n\t\t\treturn false;\n\t\t}\n\t\tif ($options['filename'] !== false) {\n\t\t\tfclose($this->stream_handle);\n\t\t\t$this->headers = trim($this->headers);\n\t\t}\n\t\telse {\n\t\t\t$this->headers .= $response;\n\t\t}\n\n\t\tif (curl_errno($this->handle)) {\n\t\t\t$error = sprintf(\n\t\t\t\t'cURL error %s: %s',\n\t\t\t\tcurl_errno($this->handle),\n\t\t\t\tcurl_error($this->handle)\n\t\t\t);\n\t\t\tthrow new Requests_Exception($error, 'curlerror', $this->handle);\n\t\t}\n\t\t$this->info = curl_getinfo($this->handle);\n\n\t\t$options['hooks']->dispatch('curl.after_request', array(&$this->headers, &$this->info));\n\t\treturn $this->headers;\n\t}\n\n\t/**\n\t * Collect the headers as they are received\n\t *\n\t * @param resource $handle cURL resource\n\t * @param string $headers Header string\n\t * @return integer Length of provided header\n\t */\n\tpublic function stream_headers($handle, $headers) {\n\t\t// Why do we do this? cURL will send both the final response and any\n\t\t// interim responses, such as a 100 Continue. We don't need that.\n\t\t// (We may want to keep this somewhere just in case)\n\t\tif ($this->done_headers) {\n\t\t\t$this->headers = '';\n\t\t\t$this->done_headers = false;\n\t\t}\n\t\t$this->headers .= $headers;\n\n\t\tif ($headers === \"\\r\\n\") {\n\t\t\t$this->done_headers = true;\n\t\t}\n\t\treturn strlen($headers);\n\t}\n\n\t/**\n\t * Collect data as it's received\n\t *\n\t * @since 1.6.1\n\t *\n\t * @param resource $handle cURL resource\n\t * @param string $data Body data\n\t * @return integer Length of provided data\n\t */\n\tpublic function stream_body($handle, $data) {\n\t\t$this->hooks->dispatch('request.progress', array($data, $this->response_bytes, $this->response_byte_limit));\n\t\t$data_length = strlen($data);\n\n\t\t// Are we limiting the response size?\n\t\tif ($this->response_byte_limit) {\n\t\t\tif ($this->response_bytes === $this->response_byte_limit) {\n\t\t\t\t// Already at maximum, move on\n\t\t\t\treturn $data_length;\n\t\t\t}\n\n\t\t\tif (($this->response_bytes + $data_length) > $this->response_byte_limit) {\n\t\t\t\t// Limit the length\n\t\t\t\t$limited_length = ($this->response_byte_limit - $this->response_bytes);\n\t\t\t\t$data = substr($data, 0, $limited_length);\n\t\t\t}\n\t\t}\n\n\t\tif ($this->stream_handle) {\n\t\t\tfwrite($this->stream_handle, $data);\n\t\t}\n\t\telse {\n\t\t\t$this->response_data .= $data;\n\t\t}\n\n\t\t$this->response_bytes += strlen($data);\n\t\treturn $data_length;\n\t}\n\n\t/**\n\t * Format a URL given GET data\n\t *\n\t * @param string $url\n\t * @param array|object $data Data to build query using, see {@see https://secure.php.net/http_build_query}\n\t * @return string URL with data\n\t */\n\tprotected static function format_get($url, $data) {\n\t\tif (!empty($data)) {\n\t\t\t$url_parts = parse_url($url);\n\t\t\tif (empty($url_parts['query'])) {\n\t\t\t\t$query = $url_parts['query'] = '';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$query = $url_parts['query'];\n\t\t\t}\n\n\t\t\t$query .= '&' . http_build_query($data, null, '&');\n\t\t\t$query = trim($query, '&');\n\n\t\t\tif (empty($url_parts['query'])) {\n\t\t\t\t$url .= '?' . $query;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$url = str_replace($url_parts['query'], $query, $url);\n\t\t\t}\n\t\t}\n\t\treturn $url;\n\t}\n\n\t/**\n\t * Whether this transport is valid\n\t *\n\t * @codeCoverageIgnore\n\t * @return boolean True if the transport is valid, false otherwise.\n\t */\n\tpublic static function test($capabilities = array()) {\n\t\tif (!function_exists('curl_init') || !function_exists('curl_exec')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If needed, check that our installed curl version supports SSL\n\t\tif (isset($capabilities['ssl']) && $capabilities['ssl']) {\n\t\t\t$curl_version = curl_version();\n\t\t\tif (!(CURL_VERSION_SSL & $curl_version['features'])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n}\n", "num_lines": 543}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * fsockopen HTTP transport\n *\n * @package Requests\n * @subpackage Transport\n */\n\n/**\n * fsockopen HTTP transport\n *\n * @package Requests\n * @subpackage Transport\n */\nclass Requests_Transport_fsockopen implements Requests_Transport {\n\t/**\n\t * Second to microsecond conversion\n\t *\n\t * @var integer\n\t */\n\tconst SECOND_IN_MICROSECONDS = 1000000;\n\n\t/**\n\t * Raw HTTP data\n\t *\n\t * @var string\n\t */\n\tpublic $headers = '';\n\n\t/**\n\t * Stream metadata\n\t *\n\t * @var array Associative array of properties, see {@see https://secure.php.net/stream_get_meta_data}\n\t */\n\tpublic $info;\n\n\t/**\n\t * What's the maximum number of bytes we should keep?\n\t *\n\t * @var int|bool Byte count, or false if no limit.\n\t */\n\tprotected $max_bytes = false;\n\n\tprotected $connect_error = '';\n\n\t/**\n\t * Perform a request\n\t *\n\t * @throws Requests_Exception On failure to connect to socket (`fsockopenerror`)\n\t * @throws Requests_Exception On socket timeout (`timeout`)\n\t *\n\t * @param string $url URL to request\n\t * @param array $headers Associative array of request headers\n\t * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD\n\t * @param array $options Request options, see {@see Requests::response()} for documentation\n\t * @return string Raw HTTP result\n\t */\n\tpublic function request($url, $headers = array(), $data = array(), $options = array()) {\n\t\t$options['hooks']->dispatch('fsockopen.before_request');\n\n\t\t$url_parts = parse_url($url);\n\t\tif (empty($url_parts)) {\n\t\t\tthrow new Requests_Exception('Invalid URL.', 'invalidurl', $url);\n\t\t}\n\t\t$host = $url_parts['host'];\n\t\t$context = stream_context_create();\n\t\t$verifyname = false;\n\t\t$case_insensitive_headers = new Requests_Utility_CaseInsensitiveDictionary($headers);\n\n\t\t// HTTPS support\n\t\tif (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https') {\n\t\t\t$remote_socket = 'ssl://' . $host;\n\t\t\tif (!isset($url_parts['port'])) {\n\t\t\t\t$url_parts['port'] = 443;\n\t\t\t}\n\n\t\t\t$context_options = array(\n\t\t\t\t'verify_peer' => true,\n\t\t\t\t// 'CN_match' => $host,\n\t\t\t\t'capture_peer_cert' => true\n\t\t\t);\n\t\t\t$verifyname = true;\n\n\t\t\t// SNI, if enabled (OpenSSL >=0.9.8j)\n\t\t\tif (defined('OPENSSL_TLSEXT_SERVER_NAME') && OPENSSL_TLSEXT_SERVER_NAME) {\n\t\t\t\t$context_options['SNI_enabled'] = true;\n\t\t\t\tif (isset($options['verifyname']) && $options['verifyname'] === false) {\n\t\t\t\t\t$context_options['SNI_enabled'] = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($options['verify'])) {\n\t\t\t\tif ($options['verify'] === false) {\n\t\t\t\t\t$context_options['verify_peer'] = false;\n\t\t\t\t}\n\t\t\t\telseif (is_string($options['verify'])) {\n\t\t\t\t\t$context_options['cafile'] = $options['verify'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($options['verifyname']) && $options['verifyname'] === false) {\n\t\t\t\t$context_options['verify_peer_name'] = false;\n\t\t\t\t$verifyname = false;\n\t\t\t}\n\n\t\t\tstream_context_set_option($context, array('ssl' => $context_options));\n\t\t}\n\t\telse {\n\t\t\t$remote_socket = 'tcp://' . $host;\n\t\t}\n\n\t\t$this->max_bytes = $options['max_bytes'];\n\n\t\tif (!isset($url_parts['port'])) {\n\t\t\t$url_parts['port'] = 80;\n\t\t}\n\t\t$remote_socket .= ':' . $url_parts['port'];\n\n\t\tset_error_handler(array($this, 'connect_error_handler'), E_WARNING | E_NOTICE);\n\n\t\t$options['hooks']->dispatch('fsockopen.remote_socket', array(&$remote_socket));\n\n\t\t$socket = stream_socket_client($remote_socket, $errno, $errstr, ceil($options['connect_timeout']), STREAM_CLIENT_CONNECT, $context);\n\n\t\trestore_error_handler();\n\n\t\tif ($verifyname && !$this->verify_certificate_from_context($host, $context)) {\n\t\t\tthrow new Requests_Exception('SSL certificate did not match the requested domain name', 'ssl.no_match');\n\t\t}\n\n\t\tif (!$socket) {\n\t\t\tif ($errno === 0) {\n\t\t\t\t// Connection issue\n\t\t\t\tthrow new Requests_Exception(rtrim($this->connect_error), 'fsockopen.connect_error');\n\t\t\t}\n\n\t\t\tthrow new Requests_Exception($errstr, 'fsockopenerror', null, $errno);\n\t\t}\n\n\t\t$data_format = $options['data_format'];\n\n\t\tif ($data_format === 'query') {\n\t\t\t$path = self::format_get($url_parts, $data);\n\t\t\t$data = '';\n\t\t}\n\t\telse {\n\t\t\t$path = self::format_get($url_parts, array());\n\t\t}\n\n\t\t$options['hooks']->dispatch('fsockopen.remote_host_path', array(&$path, $url));\n\n\t\t$request_body = '';\n\t\t$out = sprintf(\"%s %s HTTP/%.1F\\r\\n\", $options['type'], $path, $options['protocol_version']);\n\n\t\tif ($options['type'] !== Requests::TRACE) {\n\t\t\tif (is_array($data)) {\n\t\t\t\t$request_body = http_build_query($data, null, '&');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$request_body = $data;\n\t\t\t}\n\n\t\t\tif (!empty($data)) {\n\t\t\t\tif (!isset($case_insensitive_headers['Content-Length'])) {\n\t\t\t\t\t$headers['Content-Length'] = strlen($request_body);\n\t\t\t\t}\n\n\t\t\t\tif (!isset($case_insensitive_headers['Content-Type'])) {\n\t\t\t\t\t$headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!isset($case_insensitive_headers['Host'])) {\n\t\t\t$out .= sprintf('Host: %s', $url_parts['host']);\n\n\t\t\tif (( 'http' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 80 ) || ( 'https' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 443 )) {\n\t\t\t\t$out .= ':' . $url_parts['port'];\n\t\t\t}\n\t\t\t$out .= \"\\r\\n\";\n\t\t}\n\n\t\tif (!isset($case_insensitive_headers['User-Agent'])) {\n\t\t\t$out .= sprintf(\"User-Agent: %s\\r\\n\", $options['useragent']);\n\t\t}\n\n\t\t$accept_encoding = $this->accept_encoding();\n\t\tif (!isset($case_insensitive_headers['Accept-Encoding']) && !empty($accept_encoding)) {\n\t\t\t$out .= sprintf(\"Accept-Encoding: %s\\r\\n\", $accept_encoding);\n\t\t}\n\n\t\t$headers = Requests::flatten($headers);\n\n\t\tif (!empty($headers)) {\n\t\t\t$out .= implode(\"\\r\\n\", $headers) . \"\\r\\n\";\n\t\t}\n\n\t\t$options['hooks']->dispatch('fsockopen.after_headers', array(&$out));\n\n\t\tif (substr($out, -2) !== \"\\r\\n\") {\n\t\t\t$out .= \"\\r\\n\";\n\t\t}\n\n\t\tif (!isset($case_insensitive_headers['Connection'])) {\n\t\t\t$out .= \"Connection: Close\\r\\n\";\n\t\t}\n\n\t\t$out .= \"\\r\\n\" . $request_body;\n\n\t\t$options['hooks']->dispatch('fsockopen.before_send', array(&$out));\n\n\t\tfwrite($socket, $out);\n\t\t$options['hooks']->dispatch('fsockopen.after_send', array($out));\n\n\t\tif (!$options['blocking']) {\n\t\t\tfclose($socket);\n\t\t\t$fake_headers = '';\n\t\t\t$options['hooks']->dispatch('fsockopen.after_request', array(&$fake_headers));\n\t\t\treturn '';\n\t\t}\n\n\t\t$timeout_sec = (int) floor($options['timeout']);\n\t\tif ($timeout_sec == $options['timeout']) {\n\t\t\t$timeout_msec = 0;\n\t\t}\n\t\telse {\n\t\t\t$timeout_msec = self::SECOND_IN_MICROSECONDS * $options['timeout'] % self::SECOND_IN_MICROSECONDS;\n\t\t}\n\t\tstream_set_timeout($socket, $timeout_sec, $timeout_msec);\n\n\t\t$response = $body = $headers = '';\n\t\t$this->info = stream_get_meta_data($socket);\n\t\t$size = 0;\n\t\t$doingbody = false;\n\t\t$download = false;\n\t\tif ($options['filename']) {\n\t\t\t$download = fopen($options['filename'], 'wb');\n\t\t}\n\n\t\twhile (!feof($socket)) {\n\t\t\t$this->info = stream_get_meta_data($socket);\n\t\t\tif ($this->info['timed_out']) {\n\t\t\t\tthrow new Requests_Exception('fsocket timed out', 'timeout');\n\t\t\t}\n\n\t\t\t$block = fread($socket, Requests::BUFFER_SIZE);\n\t\t\tif (!$doingbody) {\n\t\t\t\t$response .= $block;\n\t\t\t\tif (strpos($response, \"\\r\\n\\r\\n\")) {\n\t\t\t\t\tlist($headers, $block) = explode(\"\\r\\n\\r\\n\", $response, 2);\n\t\t\t\t\t$doingbody = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Are we in body mode now?\n\t\t\tif ($doingbody) {\n\t\t\t\t$options['hooks']->dispatch('request.progress', array($block, $size, $this->max_bytes));\n\t\t\t\t$data_length = strlen($block);\n\t\t\t\tif ($this->max_bytes) {\n\t\t\t\t\t// Have we already hit a limit?\n\t\t\t\t\tif ($size === $this->max_bytes) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (($size + $data_length) > $this->max_bytes) {\n\t\t\t\t\t\t// Limit the length\n\t\t\t\t\t\t$limited_length = ($this->max_bytes - $size);\n\t\t\t\t\t\t$block = substr($block, 0, $limited_length);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$size += strlen($block);\n\t\t\t\tif ($download) {\n\t\t\t\t\tfwrite($download, $block);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$body .= $block;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->headers = $headers;\n\n\t\tif ($download) {\n\t\t\tfclose($download);\n\t\t}\n\t\telse {\n\t\t\t$this->headers .= \"\\r\\n\\r\\n\" . $body;\n\t\t}\n\t\tfclose($socket);\n\n\t\t$options['hooks']->dispatch('fsockopen.after_request', array(&$this->headers, &$this->info));\n\t\treturn $this->headers;\n\t}\n\n\t/**\n\t * Send multiple requests simultaneously\n\t *\n\t * @param array $requests Request data (array of 'url', 'headers', 'data', 'options') as per {@see Requests_Transport::request}\n\t * @param array $options Global options, see {@see Requests::response()} for documentation\n\t * @return array Array of Requests_Response objects (may contain Requests_Exception or string responses as well)\n\t */\n\tpublic function request_multiple($requests, $options) {\n\t\t$responses = array();\n\t\t$class = get_class($this);\n\t\tforeach ($requests as $id => $request) {\n\t\t\ttry {\n\t\t\t\t$handler = new $class();\n\t\t\t\t$responses[$id] = $handler->request($request['url'], $request['headers'], $request['data'], $request['options']);\n\n\t\t\t\t$request['options']['hooks']->dispatch('transport.internal.parse_response', array(&$responses[$id], $request));\n\t\t\t}\n\t\t\tcatch (Requests_Exception $e) {\n\t\t\t\t$responses[$id] = $e;\n\t\t\t}\n\n\t\t\tif (!is_string($responses[$id])) {\n\t\t\t\t$request['options']['hooks']->dispatch('multiple.request.complete', array(&$responses[$id], $id));\n\t\t\t}\n\t\t}\n\n\t\treturn $responses;\n\t}\n\n\t/**\n\t * Retrieve the encodings we can accept\n\t *\n\t * @return string Accept-Encoding header value\n\t */\n\tprotected static function accept_encoding() {\n\t\t$type = array();\n\t\tif (function_exists('gzinflate')) {\n\t\t\t$type[] = 'deflate;q=1.0';\n\t\t}\n\n\t\tif (function_exists('gzuncompress')) {\n\t\t\t$type[] = 'compress;q=0.5';\n\t\t}\n\n\t\t$type[] = 'gzip;q=0.5';\n\n\t\treturn implode(', ', $type);\n\t}\n\n\t/**\n\t * Format a URL given GET data\n\t *\n\t * @param array $url_parts\n\t * @param array|object $data Data to build query using, see {@see https://secure.php.net/http_build_query}\n\t * @return string URL with data\n\t */\n\tprotected static function format_get($url_parts, $data) {\n\t\tif (!empty($data)) {\n\t\t\tif (empty($url_parts['query'])) {\n\t\t\t\t$url_parts['query'] = '';\n\t\t\t}\n\n\t\t\t$url_parts['query'] .= '&' . http_build_query($data, null, '&');\n\t\t\t$url_parts['query'] = trim($url_parts['query'], '&');\n\t\t}\n\t\tif (isset($url_parts['path'])) {\n\t\t\tif (isset($url_parts['query'])) {\n\t\t\t\t$get = $url_parts['path'] . '?' . $url_parts['query'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$get = $url_parts['path'];\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$get = '/';\n\t\t}\n\t\treturn $get;\n\t}\n\n\t/**\n\t * Error handler for stream_socket_client()\n\t *\n\t * @param int $errno Error number (e.g. E_WARNING)\n\t * @param string $errstr Error message\n\t */\n\tpublic function connect_error_handler($errno, $errstr) {\n\t\t// Double-check we can handle it\n\t\tif (($errno & E_WARNING) === 0 && ($errno & E_NOTICE) === 0) {\n\t\t\t// Return false to indicate the default error handler should engage\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->connect_error .= $errstr . \"\\n\";\n\t\treturn true;\n\t}\n\n\t/**\n\t * Verify the certificate against common name and subject alternative names\n\t *\n\t * Unfortunately, PHP doesn't check the certificate against the alternative\n\t * names, leading things like 'https://www.github.com/' to be invalid.\n\t * Instead\n\t *\n\t * @see https://tools.ietf.org/html/rfc2818#section-3.1 RFC2818, Section 3.1\n\t *\n\t * @throws Requests_Exception On failure to connect via TLS (`fsockopen.ssl.connect_error`)\n\t * @throws Requests_Exception On not obtaining a match for the host (`fsockopen.ssl.no_match`)\n\t * @param string $host Host name to verify against\n\t * @param resource $context Stream context\n\t * @return bool\n\t */\n\tpublic function verify_certificate_from_context($host, $context) {\n\t\t$meta = stream_context_get_options($context);\n\n\t\t// If we don't have SSL options, then we couldn't make the connection at\n\t\t// all\n\t\tif (empty($meta) || empty($meta['ssl']) || empty($meta['ssl']['peer_certificate'])) {\n\t\t\tthrow new Requests_Exception(rtrim($this->connect_error), 'ssl.connect_error');\n\t\t}\n\n\t\t$cert = openssl_x509_parse($meta['ssl']['peer_certificate']);\n\n\t\treturn Requests_SSL::verify_certificate($host, $cert);\n\t}\n\n\t/**\n\t * Whether this transport is valid\n\t *\n\t * @codeCoverageIgnore\n\t * @return boolean True if the transport is valid, false otherwise.\n\t */\n\tpublic static function test($capabilities = array()) {\n\t\tif (!function_exists('fsockopen')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If needed, check that streams support SSL\n\t\tif (isset($capabilities['ssl']) && $capabilities['ssl']) {\n\t\t\tif (!extension_loaded('openssl') || !function_exists('openssl_x509_parse')) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Currently broken, thanks to https://github.com/facebook/hhvm/issues/2156\n\t\t\tif (defined('HHVM_VERSION')) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n}\n", "num_lines": 445}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Case-insensitive dictionary, suitable for HTTP headers\n *\n * @package Requests\n * @subpackage Utilities\n */\n\n/**\n * Case-insensitive dictionary, suitable for HTTP headers\n *\n * @package Requests\n * @subpackage Utilities\n */\nclass Requests_Utility_CaseInsensitiveDictionary implements ArrayAccess, IteratorAggregate {\n\t/**\n\t * Actual item data\n\t *\n\t * @var array\n\t */\n\tprotected $data = array();\n\n\t/**\n\t * Creates a case insensitive dictionary.\n\t *\n\t * @param array $data Dictionary/map to convert to case-insensitive\n\t */\n\tpublic function __construct(array $data = array()) {\n\t\tforeach ($data as $key => $value) {\n\t\t\t$this->offsetSet($key, $value);\n\t\t}\n\t}\n\n\t/**\n\t * Check if the given item exists\n\t *\n\t * @param string $key Item key\n\t * @return boolean Does the item exist?\n\t */\n\tpublic function offsetExists($key) {\n\t\t$key = strtolower($key);\n\t\treturn isset($this->data[$key]);\n\t}\n\n\t/**\n\t * Get the value for the item\n\t *\n\t * @param string $key Item key\n\t * @return string Item value\n\t */\n\tpublic function offsetGet($key) {\n\t\t$key = strtolower($key);\n\t\tif (!isset($this->data[$key])) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->data[$key];\n\t}\n\n\t/**\n\t * Set the given item\n\t *\n\t * @throws Requests_Exception On attempting to use dictionary as list (`invalidset`)\n\t *\n\t * @param string $key Item name\n\t * @param string $value Item value\n\t */\n\tpublic function offsetSet($key, $value) {\n\t\tif ($key === null) {\n\t\t\tthrow new Requests_Exception('Object is a dictionary, not a list', 'invalidset');\n\t\t}\n\n\t\t$key = strtolower($key);\n\t\t$this->data[$key] = $value;\n\t}\n\n\t/**\n\t * Unset the given header\n\t *\n\t * @param string $key\n\t */\n\tpublic function offsetUnset($key) {\n\t\tunset($this->data[strtolower($key)]);\n\t}\n\n\t/**\n\t * Get an iterator for the data\n\t *\n\t * @return ArrayIterator\n\t */\n\tpublic function getIterator() {\n\t\treturn new ArrayIterator($this->data);\n\t}\n\n\t/**\n\t * Get the headers as an array\n\t *\n\t * @return array Header data\n\t */\n\tpublic function getAll() {\n\t\treturn $this->data;\n\t}\n}\n", "num_lines": 104}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Iterator for arrays requiring filtered values\n *\n * @package Requests\n * @subpackage Utilities\n */\n\n/**\n * Iterator for arrays requiring filtered values\n *\n * @package Requests\n * @subpackage Utilities\n */\nclass Requests_Utility_FilteredIterator extends ArrayIterator {\n\t/**\n\t * Callback to run as a filter\n\t *\n\t * @var callable\n\t */\n\tprotected $callback;\n\n\t/**\n\t * Create a new iterator\n\t *\n\t * @param array $data\n\t * @param callable $callback Callback to be called on each value\n\t */\n\tpublic function __construct($data, $callback) {\n\t\tparent::__construct($data);\n\n\t\t$this->callback = $callback;\n\t}\n\n\t/**\n\t * Get the current item's value after filtering\n\t *\n\t * @return string\n\t */\n\tpublic function current() {\n\t\t$value = parent::current();\n\t\t$value = call_user_func($this->callback, $value);\n\t\treturn $value;\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\tpublic function unserialize( $serialized ) {\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\tpublic function __unserialize( $serialized ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound\n\t}\n\n\tpublic function __wakeup() { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__wakeupFound\n\t\tunset( $this->callback );\n\t}\n}\n", "num_lines": 62}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Request class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement a REST request object.\n *\n * Contains data from the request, to be passed to the callback.\n *\n * Note: This implements ArrayAccess, and acts as an array of parameters when\n * used in that manner. It does not use ArrayObject (as we cannot rely on SPL),\n * so be aware it may have non-array behaviour in some cases.\n *\n * Note: When using features provided by ArrayAccess, be aware that WordPress deliberately\n * does not distinguish between arguments of the same name for different request methods.\n * For instance, in a request with `GET id=1` and `POST id=2`, `$request['id']` will equal\n * 2 (`POST`) not 1 (`GET`). For more precision between request methods, use\n * WP_REST_Request::get_body_params(), WP_REST_Request::get_url_params(), etc.\n *\n * @since 4.4.0\n *\n * @link https://www.php.net/manual/en/class.arrayaccess.php\n */\nclass WP_REST_Request implements ArrayAccess {\n\n\t/**\n\t * HTTP method.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tprotected $method = '';\n\n\t/**\n\t * Parameters passed to the request.\n\t *\n\t * These typically come from the `$_GET`, `$_POST` and `$_FILES`\n\t * superglobals when being created from the global scope.\n\t *\n\t * @since 4.4.0\n\t * @var array Contains GET, POST and FILES keys mapping to arrays of data.\n\t */\n\tprotected $params;\n\n\t/**\n\t * HTTP headers for the request.\n\t *\n\t * @since 4.4.0\n\t * @var array Map of key to value. Key is always lowercase, as per HTTP specification.\n\t */\n\tprotected $headers = array();\n\n\t/**\n\t * Body data.\n\t *\n\t * @since 4.4.0\n\t * @var string Binary data from the request.\n\t */\n\tprotected $body = null;\n\n\t/**\n\t * Route matched for the request.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tprotected $route;\n\n\t/**\n\t * Attributes (options) for the route that was matched.\n\t *\n\t * This is the options array used when the route was registered, typically\n\t * containing the callback as well as the valid methods for the route.\n\t *\n\t * @since 4.4.0\n\t * @var array Attributes for the request.\n\t */\n\tprotected $attributes = array();\n\n\t/**\n\t * Used to determine if the JSON data has been parsed yet.\n\t *\n\t * Allows lazy-parsing of JSON data where possible.\n\t *\n\t * @since 4.4.0\n\t * @var bool\n\t */\n\tprotected $parsed_json = false;\n\n\t/**\n\t * Used to determine if the body data has been parsed yet.\n\t *\n\t * @since 4.4.0\n\t * @var bool\n\t */\n\tprotected $parsed_body = false;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $method     Optional. Request method. Default empty.\n\t * @param string $route      Optional. Request route. Default empty.\n\t * @param array  $attributes Optional. Request attributes. Default empty array.\n\t */\n\tpublic function __construct( $method = '', $route = '', $attributes = array() ) {\n\t\t$this->params = array(\n\t\t\t'URL'      => array(),\n\t\t\t'GET'      => array(),\n\t\t\t'POST'     => array(),\n\t\t\t'FILES'    => array(),\n\n\t\t\t// See parse_json_params.\n\t\t\t'JSON'     => null,\n\n\t\t\t'defaults' => array(),\n\t\t);\n\n\t\t$this->set_method( $method );\n\t\t$this->set_route( $route );\n\t\t$this->set_attributes( $attributes );\n\t}\n\n\t/**\n\t * Retrieves the HTTP method for the request.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return string HTTP method.\n\t */\n\tpublic function get_method() {\n\t\treturn $this->method;\n\t}\n\n\t/**\n\t * Sets HTTP method for the request.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $method HTTP method.\n\t */\n\tpublic function set_method( $method ) {\n\t\t$this->method = strtoupper( $method );\n\t}\n\n\t/**\n\t * Retrieves all headers from the request.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return array Map of key to value. Key is always lowercase, as per HTTP specification.\n\t */\n\tpublic function get_headers() {\n\t\treturn $this->headers;\n\t}\n\n\t/**\n\t * Canonicalizes the header name.\n\t *\n\t * Ensures that header names are always treated the same regardless of\n\t * source. Header names are always case insensitive.\n\t *\n\t * Note that we treat `-` (dashes) and `_` (underscores) as the same\n\t * character, as per header parsing rules in both Apache and nginx.\n\t *\n\t * @link https://stackoverflow.com/q/18185366\n\t * @link https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#missing-disappearing-http-headers\n\t * @link https://nginx.org/en/docs/http/ngx_http_core_module.html#underscores_in_headers\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $key Header name.\n\t * @return string Canonicalized name.\n\t */\n\tpublic static function canonicalize_header_name( $key ) {\n\t\t$key = strtolower( $key );\n\t\t$key = str_replace( '-', '_', $key );\n\n\t\treturn $key;\n\t}\n\n\t/**\n\t * Retrieves the given header from the request.\n\t *\n\t * If the header has multiple values, they will be concatenated with a comma\n\t * as per the HTTP specification. Be aware that some non-compliant headers\n\t * (notably cookie headers) cannot be joined this way.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $key Header name, will be canonicalized to lowercase.\n\t * @return string|null String value if set, null otherwise.\n\t */\n\tpublic function get_header( $key ) {\n\t\t$key = $this->canonicalize_header_name( $key );\n\n\t\tif ( ! isset( $this->headers[ $key ] ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn implode( ',', $this->headers[ $key ] );\n\t}\n\n\t/**\n\t * Retrieves header values from the request.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $key Header name, will be canonicalized to lowercase.\n\t * @return array|null List of string values if set, null otherwise.\n\t */\n\tpublic function get_header_as_array( $key ) {\n\t\t$key = $this->canonicalize_header_name( $key );\n\n\t\tif ( ! isset( $this->headers[ $key ] ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->headers[ $key ];\n\t}\n\n\t/**\n\t * Sets the header on request.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $key   Header name.\n\t * @param string $value Header value, or list of values.\n\t */\n\tpublic function set_header( $key, $value ) {\n\t\t$key   = $this->canonicalize_header_name( $key );\n\t\t$value = (array) $value;\n\n\t\t$this->headers[ $key ] = $value;\n\t}\n\n\t/**\n\t * Appends a header value for the given header.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $key   Header name.\n\t * @param string $value Header value, or list of values.\n\t */\n\tpublic function add_header( $key, $value ) {\n\t\t$key   = $this->canonicalize_header_name( $key );\n\t\t$value = (array) $value;\n\n\t\tif ( ! isset( $this->headers[ $key ] ) ) {\n\t\t\t$this->headers[ $key ] = array();\n\t\t}\n\n\t\t$this->headers[ $key ] = array_merge( $this->headers[ $key ], $value );\n\t}\n\n\t/**\n\t * Removes all values for a header.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $key Header name.\n\t */\n\tpublic function remove_header( $key ) {\n\t\t$key = $this->canonicalize_header_name( $key );\n\t\tunset( $this->headers[ $key ] );\n\t}\n\n\t/**\n\t * Sets headers on the request.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $headers  Map of header name to value.\n\t * @param bool  $override If true, replace the request's headers. Otherwise, merge with existing.\n\t */\n\tpublic function set_headers( $headers, $override = true ) {\n\t\tif ( true === $override ) {\n\t\t\t$this->headers = array();\n\t\t}\n\n\t\tforeach ( $headers as $key => $value ) {\n\t\t\t$this->set_header( $key, $value );\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the content-type of the request.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return array|null Map containing 'value' and 'parameters' keys\n\t *                    or null when no valid content-type header was\n\t *                    available.\n\t */\n\tpublic function get_content_type() {\n\t\t$value = $this->get_header( 'content-type' );\n\t\tif ( empty( $value ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$parameters = '';\n\t\tif ( strpos( $value, ';' ) ) {\n\t\t\tlist( $value, $parameters ) = explode( ';', $value, 2 );\n\t\t}\n\n\t\t$value = strtolower( $value );\n\t\tif ( false === strpos( $value, '/' ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Parse type and subtype out.\n\t\tlist( $type, $subtype ) = explode( '/', $value, 2 );\n\n\t\t$data = compact( 'value', 'type', 'subtype', 'parameters' );\n\t\t$data = array_map( 'trim', $data );\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Retrieves the parameter priority order.\n\t *\n\t * Used when checking parameters in get_param().\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return string[] Array of types to check, in order of priority.\n\t */\n\tprotected function get_parameter_order() {\n\t\t$order = array();\n\n\t\t$content_type = $this->get_content_type();\n\t\tif ( isset( $content_type['value'] ) && 'application/json' === $content_type['value'] ) {\n\t\t\t$order[] = 'JSON';\n\t\t}\n\n\t\t$this->parse_json_params();\n\n\t\t// Ensure we parse the body data.\n\t\t$body = $this->get_body();\n\n\t\tif ( 'POST' !== $this->method && ! empty( $body ) ) {\n\t\t\t$this->parse_body_params();\n\t\t}\n\n\t\t$accepts_body_data = array( 'POST', 'PUT', 'PATCH', 'DELETE' );\n\t\tif ( in_array( $this->method, $accepts_body_data, true ) ) {\n\t\t\t$order[] = 'POST';\n\t\t}\n\n\t\t$order[] = 'GET';\n\t\t$order[] = 'URL';\n\t\t$order[] = 'defaults';\n\n\t\t/**\n\t\t * Filters the parameter order.\n\t\t *\n\t\t * The order affects which parameters are checked when using get_param() and family.\n\t\t * This acts similarly to PHP's `request_order` setting.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param string[]        $order Array of types to check, in order of priority.\n\t\t * @param WP_REST_Request $this  The request object.\n\t\t */\n\t\treturn apply_filters( 'rest_request_parameter_order', $order, $this );\n\t}\n\n\t/**\n\t * Retrieves a parameter from the request.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $key Parameter name.\n\t * @return mixed|null Value if set, null otherwise.\n\t */\n\tpublic function get_param( $key ) {\n\t\t$order = $this->get_parameter_order();\n\n\t\tforeach ( $order as $type ) {\n\t\t\t// Determine if we have the parameter for this type.\n\t\t\tif ( isset( $this->params[ $type ][ $key ] ) ) {\n\t\t\t\treturn $this->params[ $type ][ $key ];\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Checks if a parameter exists in the request.\n\t *\n\t * This allows distinguishing between an omitted parameter,\n\t * and a parameter specifically set to null.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param string $key Parameter name.\n\t * @return bool True if a param exists for the given key.\n\t */\n\tpublic function has_param( $key ) {\n\t\t$order = $this->get_parameter_order();\n\n\t\tforeach ( $order as $type ) {\n\t\t\tif ( is_array( $this->params[ $type ] ) && array_key_exists( $key, $this->params[ $type ] ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Sets a parameter on the request.\n\t *\n\t * If the given parameter key exists in any parameter type an update will take place,\n\t * otherwise a new param will be created in the first parameter type (respecting\n\t * get_parameter_order()).\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $key   Parameter name.\n\t * @param mixed  $value Parameter value.\n\t */\n\tpublic function set_param( $key, $value ) {\n\t\t$order     = $this->get_parameter_order();\n\t\t$found_key = false;\n\n\t\tforeach ( $order as $type ) {\n\t\t\tif ( 'defaults' !== $type && is_array( $this->params[ $type ] ) && array_key_exists( $key, $this->params[ $type ] ) ) {\n\t\t\t\t$this->params[ $type ][ $key ] = $value;\n\t\t\t\t$found_key                     = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $found_key ) {\n\t\t\t$this->params[ $order[0] ][ $key ] = $value;\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves merged parameters from the request.\n\t *\n\t * The equivalent of get_param(), but returns all parameters for the request.\n\t * Handles merging all the available values into a single array.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return array Map of key to value.\n\t */\n\tpublic function get_params() {\n\t\t$order = $this->get_parameter_order();\n\t\t$order = array_reverse( $order, true );\n\n\t\t$params = array();\n\t\tforeach ( $order as $type ) {\n\t\t\t// array_merge() / the \"+\" operator will mess up\n\t\t\t// numeric keys, so instead do a manual foreach.\n\t\t\tforeach ( (array) $this->params[ $type ] as $key => $value ) {\n\t\t\t\t$params[ $key ] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $params;\n\t}\n\n\t/**\n\t * Retrieves parameters from the route itself.\n\t *\n\t * These are parsed from the URL using the regex.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return array Parameter map of key to value.\n\t */\n\tpublic function get_url_params() {\n\t\treturn $this->params['URL'];\n\t}\n\n\t/**\n\t * Sets parameters from the route.\n\t *\n\t * Typically, this is set after parsing the URL.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $params Parameter map of key to value.\n\t */\n\tpublic function set_url_params( $params ) {\n\t\t$this->params['URL'] = $params;\n\t}\n\n\t/**\n\t * Retrieves parameters from the query string.\n\t *\n\t * These are the parameters you'd typically find in `$_GET`.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return array Parameter map of key to value\n\t */\n\tpublic function get_query_params() {\n\t\treturn $this->params['GET'];\n\t}\n\n\t/**\n\t * Sets parameters from the query string.\n\t *\n\t * Typically, this is set from `$_GET`.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $params Parameter map of key to value.\n\t */\n\tpublic function set_query_params( $params ) {\n\t\t$this->params['GET'] = $params;\n\t}\n\n\t/**\n\t * Retrieves parameters from the body.\n\t *\n\t * These are the parameters you'd typically find in `$_POST`.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return array Parameter map of key to value.\n\t */\n\tpublic function get_body_params() {\n\t\treturn $this->params['POST'];\n\t}\n\n\t/**\n\t * Sets parameters from the body.\n\t *\n\t * Typically, this is set from `$_POST`.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $params Parameter map of key to value.\n\t */\n\tpublic function set_body_params( $params ) {\n\t\t$this->params['POST'] = $params;\n\t}\n\n\t/**\n\t * Retrieves multipart file parameters from the body.\n\t *\n\t * These are the parameters you'd typically find in `$_FILES`.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return array Parameter map of key to value\n\t */\n\tpublic function get_file_params() {\n\t\treturn $this->params['FILES'];\n\t}\n\n\t/**\n\t * Sets multipart file parameters from the body.\n\t *\n\t * Typically, this is set from `$_FILES`.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $params Parameter map of key to value.\n\t */\n\tpublic function set_file_params( $params ) {\n\t\t$this->params['FILES'] = $params;\n\t}\n\n\t/**\n\t * Retrieves the default parameters.\n\t *\n\t * These are the parameters set in the route registration.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return array Parameter map of key to value\n\t */\n\tpublic function get_default_params() {\n\t\treturn $this->params['defaults'];\n\t}\n\n\t/**\n\t * Sets default parameters.\n\t *\n\t * These are the parameters set in the route registration.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $params Parameter map of key to value.\n\t */\n\tpublic function set_default_params( $params ) {\n\t\t$this->params['defaults'] = $params;\n\t}\n\n\t/**\n\t * Retrieves the request body content.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return string Binary data from the request body.\n\t */\n\tpublic function get_body() {\n\t\treturn $this->body;\n\t}\n\n\t/**\n\t * Sets body content.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $data Binary data from the request body.\n\t */\n\tpublic function set_body( $data ) {\n\t\t$this->body = $data;\n\n\t\t// Enable lazy parsing.\n\t\t$this->parsed_json    = false;\n\t\t$this->parsed_body    = false;\n\t\t$this->params['JSON'] = null;\n\t}\n\n\t/**\n\t * Retrieves the parameters from a JSON-formatted body.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return array Parameter map of key to value.\n\t */\n\tpublic function get_json_params() {\n\t\t// Ensure the parameters have been parsed out.\n\t\t$this->parse_json_params();\n\n\t\treturn $this->params['JSON'];\n\t}\n\n\t/**\n\t * Parses the JSON parameters.\n\t *\n\t * Avoids parsing the JSON data until we need to access it.\n\t *\n\t * @since 4.4.0\n\t * @since 4.7.0 Returns error instance if value cannot be decoded.\n\t * @return true|WP_Error True if the JSON data was passed or no JSON data was provided, WP_Error if invalid JSON was passed.\n\t */\n\tprotected function parse_json_params() {\n\t\tif ( $this->parsed_json ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->parsed_json = true;\n\n\t\t// Check that we actually got JSON.\n\t\t$content_type = $this->get_content_type();\n\n\t\tif ( empty( $content_type ) || 'application/json' !== $content_type['value'] ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$body = $this->get_body();\n\t\tif ( empty( $body ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$params = json_decode( $body, true );\n\n\t\t/*\n\t\t * Check for a parsing error.\n\t\t */\n\t\tif ( null === $params && JSON_ERROR_NONE !== json_last_error() ) {\n\t\t\t// Ensure subsequent calls receive error instance.\n\t\t\t$this->parsed_json = false;\n\n\t\t\t$error_data = array(\n\t\t\t\t'status'             => WP_Http::BAD_REQUEST,\n\t\t\t\t'json_error_code'    => json_last_error(),\n\t\t\t\t'json_error_message' => json_last_error_msg(),\n\t\t\t);\n\n\t\t\treturn new WP_Error( 'rest_invalid_json', __( 'Invalid JSON body passed.' ), $error_data );\n\t\t}\n\n\t\t$this->params['JSON'] = $params;\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Parses the request body parameters.\n\t *\n\t * Parses out URL-encoded bodies for request methods that aren't supported\n\t * natively by PHP. In PHP 5.x, only POST has these parsed automatically.\n\t *\n\t * @since 4.4.0\n\t */\n\tprotected function parse_body_params() {\n\t\tif ( $this->parsed_body ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->parsed_body = true;\n\n\t\t/*\n\t\t * Check that we got URL-encoded. Treat a missing content-type as\n\t\t * URL-encoded for maximum compatibility.\n\t\t */\n\t\t$content_type = $this->get_content_type();\n\n\t\tif ( ! empty( $content_type ) && 'application/x-www-form-urlencoded' !== $content_type['value'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tparse_str( $this->get_body(), $params );\n\n\t\t/*\n\t\t * Add to the POST parameters stored internally. If a user has already\n\t\t * set these manually (via `set_body_params`), don't override them.\n\t\t */\n\t\t$this->params['POST'] = array_merge( $params, $this->params['POST'] );\n\t}\n\n\t/**\n\t * Retrieves the route that matched the request.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return string Route matching regex.\n\t */\n\tpublic function get_route() {\n\t\treturn $this->route;\n\t}\n\n\t/**\n\t * Sets the route that matched the request.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $route Route matching regex.\n\t */\n\tpublic function set_route( $route ) {\n\t\t$this->route = $route;\n\t}\n\n\t/**\n\t * Retrieves the attributes for the request.\n\t *\n\t * These are the options for the route that was matched.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return array Attributes for the request.\n\t */\n\tpublic function get_attributes() {\n\t\treturn $this->attributes;\n\t}\n\n\t/**\n\t * Sets the attributes for the request.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $attributes Attributes for the request.\n\t */\n\tpublic function set_attributes( $attributes ) {\n\t\t$this->attributes = $attributes;\n\t}\n\n\t/**\n\t * Sanitizes (where possible) the params on the request.\n\t *\n\t * This is primarily based off the sanitize_callback param on each registered\n\t * argument.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return true|WP_Error True if parameters were sanitized, WP_Error if an error occurred during sanitization.\n\t */\n\tpublic function sanitize_params() {\n\t\t$attributes = $this->get_attributes();\n\n\t\t// No arguments set, skip sanitizing.\n\t\tif ( empty( $attributes['args'] ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$order = $this->get_parameter_order();\n\n\t\t$invalid_params = array();\n\n\t\tforeach ( $order as $type ) {\n\t\t\tif ( empty( $this->params[ $type ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ( $this->params[ $type ] as $key => $value ) {\n\t\t\t\tif ( ! isset( $attributes['args'][ $key ] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$param_args = $attributes['args'][ $key ];\n\n\t\t\t\t// If the arg has a type but no sanitize_callback attribute, default to rest_parse_request_arg.\n\t\t\t\tif ( ! array_key_exists( 'sanitize_callback', $param_args ) && ! empty( $param_args['type'] ) ) {\n\t\t\t\t\t$param_args['sanitize_callback'] = 'rest_parse_request_arg';\n\t\t\t\t}\n\t\t\t\t// If there's still no sanitize_callback, nothing to do here.\n\t\t\t\tif ( empty( $param_args['sanitize_callback'] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$sanitized_value = call_user_func( $param_args['sanitize_callback'], $value, $this, $key );\n\n\t\t\t\tif ( is_wp_error( $sanitized_value ) ) {\n\t\t\t\t\t$invalid_params[ $key ] = $sanitized_value->get_error_message();\n\t\t\t\t} else {\n\t\t\t\t\t$this->params[ $type ][ $key ] = $sanitized_value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( $invalid_params ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_invalid_param',\n\t\t\t\t/* translators: %s: List of invalid parameters. */\n\t\t\t\tsprintf( __( 'Invalid parameter(s): %s' ), implode( ', ', array_keys( $invalid_params ) ) ),\n\t\t\t\tarray(\n\t\t\t\t\t'status' => 400,\n\t\t\t\t\t'params' => $invalid_params,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks whether this request is valid according to its attributes.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return bool|WP_Error True if there are no parameters to validate or if all pass validation,\n\t *                       WP_Error if required parameters are missing.\n\t */\n\tpublic function has_valid_params() {\n\t\t// If JSON data was passed, check for errors.\n\t\t$json_error = $this->parse_json_params();\n\t\tif ( is_wp_error( $json_error ) ) {\n\t\t\treturn $json_error;\n\t\t}\n\n\t\t$attributes = $this->get_attributes();\n\t\t$required   = array();\n\n\t\t// No arguments set, skip validation.\n\t\tif ( empty( $attributes['args'] ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tforeach ( $attributes['args'] as $key => $arg ) {\n\n\t\t\t$param = $this->get_param( $key );\n\t\t\tif ( isset( $arg['required'] ) && true === $arg['required'] && null === $param ) {\n\t\t\t\t$required[] = $key;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $required ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_missing_callback_param',\n\t\t\t\t/* translators: %s: List of required parameters. */\n\t\t\t\tsprintf( __( 'Missing parameter(s): %s' ), implode( ', ', $required ) ),\n\t\t\t\tarray(\n\t\t\t\t\t'status' => 400,\n\t\t\t\t\t'params' => $required,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/*\n\t\t * Check the validation callbacks for each registered arg.\n\t\t *\n\t\t * This is done after required checking as required checking is cheaper.\n\t\t */\n\t\t$invalid_params = array();\n\n\t\tforeach ( $attributes['args'] as $key => $arg ) {\n\n\t\t\t$param = $this->get_param( $key );\n\n\t\t\tif ( null !== $param && ! empty( $arg['validate_callback'] ) ) {\n\t\t\t\t$valid_check = call_user_func( $arg['validate_callback'], $param, $this, $key );\n\n\t\t\t\tif ( false === $valid_check ) {\n\t\t\t\t\t$invalid_params[ $key ] = __( 'Invalid parameter.' );\n\t\t\t\t}\n\n\t\t\t\tif ( is_wp_error( $valid_check ) ) {\n\t\t\t\t\t$invalid_params[ $key ] = $valid_check->get_error_message();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( $invalid_params ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_invalid_param',\n\t\t\t\t/* translators: %s: List of invalid parameters. */\n\t\t\t\tsprintf( __( 'Invalid parameter(s): %s' ), implode( ', ', array_keys( $invalid_params ) ) ),\n\t\t\t\tarray(\n\t\t\t\t\t'status' => 400,\n\t\t\t\t\t'params' => $invalid_params,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\t/**\n\t * Checks if a parameter is set.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $offset Parameter name.\n\t * @return bool Whether the parameter is set.\n\t */\n\tpublic function offsetExists( $offset ) {\n\t\t$order = $this->get_parameter_order();\n\n\t\tforeach ( $order as $type ) {\n\t\t\tif ( isset( $this->params[ $type ][ $offset ] ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Retrieves a parameter from the request.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $offset Parameter name.\n\t * @return mixed|null Value if set, null otherwise.\n\t */\n\tpublic function offsetGet( $offset ) {\n\t\treturn $this->get_param( $offset );\n\t}\n\n\t/**\n\t * Sets a parameter on the request.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $offset Parameter name.\n\t * @param mixed  $value  Parameter value.\n\t */\n\tpublic function offsetSet( $offset, $value ) {\n\t\t$this->set_param( $offset, $value );\n\t}\n\n\t/**\n\t * Removes a parameter from the request.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $offset Parameter name.\n\t */\n\tpublic function offsetUnset( $offset ) {\n\t\t$order = $this->get_parameter_order();\n\n\t\t// Remove the offset from every group.\n\t\tforeach ( $order as $type ) {\n\t\t\tunset( $this->params[ $type ][ $offset ] );\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves a WP_REST_Request object from a full URL.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param string $url URL with protocol, domain, path and query args.\n\t * @return WP_REST_Request|false WP_REST_Request object on success, false on failure.\n\t */\n\tpublic static function from_url( $url ) {\n\t\t$bits         = parse_url( $url );\n\t\t$query_params = array();\n\n\t\tif ( ! empty( $bits['query'] ) ) {\n\t\t\twp_parse_str( $bits['query'], $query_params );\n\t\t}\n\n\t\t$api_root = rest_url();\n\t\tif ( get_option( 'permalink_structure' ) && 0 === strpos( $url, $api_root ) ) {\n\t\t\t// Pretty permalinks on, and URL is under the API root.\n\t\t\t$api_url_part = substr( $url, strlen( untrailingslashit( $api_root ) ) );\n\t\t\t$route        = parse_url( $api_url_part, PHP_URL_PATH );\n\t\t} elseif ( ! empty( $query_params['rest_route'] ) ) {\n\t\t\t// ?rest_route=... set directly.\n\t\t\t$route = $query_params['rest_route'];\n\t\t\tunset( $query_params['rest_route'] );\n\t\t}\n\n\t\t$request = false;\n\t\tif ( ! empty( $route ) ) {\n\t\t\t$request = new WP_REST_Request( 'GET', $route );\n\t\t\t$request->set_query_params( $query_params );\n\t\t}\n\n\t\t/**\n\t\t * Filters the request generated from a URL.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @param WP_REST_Request|false $request Generated request object, or false if URL\n\t\t *                                       could not be parsed.\n\t\t * @param string                $url     URL the request was generated from.\n\t\t */\n\t\treturn apply_filters( 'rest_request_from_url', $request, $url );\n\t}\n}\n", "num_lines": 1031}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Response class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement a REST response object.\n *\n * @since 4.4.0\n *\n * @see WP_HTTP_Response\n */\nclass WP_REST_Response extends WP_HTTP_Response {\n\n\t/**\n\t * Links related to the response.\n\t *\n\t * @since 4.4.0\n\t * @var array\n\t */\n\tprotected $links = array();\n\n\t/**\n\t * The route that was to create the response.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tprotected $matched_route = '';\n\n\t/**\n\t * The handler that was used to create the response.\n\t *\n\t * @since 4.4.0\n\t * @var null|array\n\t */\n\tprotected $matched_handler = null;\n\n\t/**\n\t * Adds a link to the response.\n\t *\n\t * @internal The $rel parameter is first, as this looks nicer when sending multiple.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @link https://tools.ietf.org/html/rfc5988\n\t * @link https://www.iana.org/assignments/link-relations/link-relations.xml\n\t *\n\t * @param string $rel        Link relation. Either an IANA registered type,\n\t *                           or an absolute URL.\n\t * @param string $href       Target URI for the link.\n\t * @param array  $attributes Optional. Link parameters to send along with the URL. Default empty array.\n\t */\n\tpublic function add_link( $rel, $href, $attributes = array() ) {\n\t\tif ( empty( $this->links[ $rel ] ) ) {\n\t\t\t$this->links[ $rel ] = array();\n\t\t}\n\n\t\tif ( isset( $attributes['href'] ) ) {\n\t\t\t// Remove the href attribute, as it's used for the main URL.\n\t\t\tunset( $attributes['href'] );\n\t\t}\n\n\t\t$this->links[ $rel ][] = array(\n\t\t\t'href'       => $href,\n\t\t\t'attributes' => $attributes,\n\t\t);\n\t}\n\n\t/**\n\t * Removes a link from the response.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $rel  Link relation. Either an IANA registered type, or an absolute URL.\n\t * @param string $href Optional. Only remove links for the relation matching the given href.\n\t *                     Default null.\n\t */\n\tpublic function remove_link( $rel, $href = null ) {\n\t\tif ( ! isset( $this->links[ $rel ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $href ) {\n\t\t\t$this->links[ $rel ] = wp_list_filter( $this->links[ $rel ], array( 'href' => $href ), 'NOT' );\n\t\t} else {\n\t\t\t$this->links[ $rel ] = array();\n\t\t}\n\n\t\tif ( ! $this->links[ $rel ] ) {\n\t\t\tunset( $this->links[ $rel ] );\n\t\t}\n\t}\n\n\t/**\n\t * Adds multiple links to the response.\n\t *\n\t * Link data should be an associative array with link relation as the key.\n\t * The value can either be an associative array of link attributes\n\t * (including `href` with the URL for the response), or a list of these\n\t * associative arrays.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $links Map of link relation to list of links.\n\t */\n\tpublic function add_links( $links ) {\n\t\tforeach ( $links as $rel => $set ) {\n\t\t\t// If it's a single link, wrap with an array for consistent handling.\n\t\t\tif ( isset( $set['href'] ) ) {\n\t\t\t\t$set = array( $set );\n\t\t\t}\n\n\t\t\tforeach ( $set as $attributes ) {\n\t\t\t\t$this->add_link( $rel, $attributes['href'], $attributes );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves links for the response.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return array List of links.\n\t */\n\tpublic function get_links() {\n\t\treturn $this->links;\n\t}\n\n\t/**\n\t * Sets a single link header.\n\t *\n\t * @internal The $rel parameter is first, as this looks nicer when sending multiple.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @link https://tools.ietf.org/html/rfc5988\n\t * @link https://www.iana.org/assignments/link-relations/link-relations.xml\n\t *\n\t * @param string $rel   Link relation. Either an IANA registered type, or an absolute URL.\n\t * @param string $link  Target IRI for the link.\n\t * @param array  $other Optional. Other parameters to send, as an assocative array.\n\t *                      Default empty array.\n\t */\n\tpublic function link_header( $rel, $link, $other = array() ) {\n\t\t$header = '<' . $link . '>; rel=\"' . $rel . '\"';\n\n\t\tforeach ( $other as $key => $value ) {\n\t\t\tif ( 'title' === $key ) {\n\t\t\t\t$value = '\"' . $value . '\"';\n\t\t\t}\n\n\t\t\t$header .= '; ' . $key . '=' . $value;\n\t\t}\n\t\t$this->header( 'Link', $header, false );\n\t}\n\n\t/**\n\t * Retrieves the route that was used.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return string The matched route.\n\t */\n\tpublic function get_matched_route() {\n\t\treturn $this->matched_route;\n\t}\n\n\t/**\n\t * Sets the route (regex for path) that caused the response.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $route Route name.\n\t */\n\tpublic function set_matched_route( $route ) {\n\t\t$this->matched_route = $route;\n\t}\n\n\t/**\n\t * Retrieves the handler that was used to generate the response.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return null|array The handler that was used to create the response.\n\t */\n\tpublic function get_matched_handler() {\n\t\treturn $this->matched_handler;\n\t}\n\n\t/**\n\t * Sets the handler that was responsible for generating the response.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $handler The matched handler.\n\t */\n\tpublic function set_matched_handler( $handler ) {\n\t\t$this->matched_handler = $handler;\n\t}\n\n\t/**\n\t * Checks if the response is an error, i.e. >= 400 response code.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return bool Whether the response is an error.\n\t */\n\tpublic function is_error() {\n\t\treturn $this->get_status() >= 400;\n\t}\n\n\t/**\n\t * Retrieves a WP_Error object from the response.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return WP_Error|null WP_Error or null on not an errored response.\n\t */\n\tpublic function as_error() {\n\t\tif ( ! $this->is_error() ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$error = new WP_Error;\n\n\t\tif ( is_array( $this->get_data() ) ) {\n\t\t\t$data = $this->get_data();\n\t\t\t$error->add( $data['code'], $data['message'], $data['data'] );\n\n\t\t\tif ( ! empty( $data['additional_errors'] ) ) {\n\t\t\t\tforeach ( $data['additional_errors'] as $err ) {\n\t\t\t\t\t$error->add( $err['code'], $err['message'], $err['data'] );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$error->add( $this->get_status(), '', array( 'status' => $this->get_status() ) );\n\t\t}\n\n\t\treturn $error;\n\t}\n\n\t/**\n\t * Retrieves the CURIEs (compact URIs) used for relations.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @return array Compact URIs.\n\t */\n\tpublic function get_curies() {\n\t\t$curies = array(\n\t\t\tarray(\n\t\t\t\t'name'      => 'wp',\n\t\t\t\t'href'      => 'https://api.w.org/{rel}',\n\t\t\t\t'templated' => true,\n\t\t\t),\n\t\t);\n\n\t\t/**\n\t\t * Filters extra CURIEs available on API responses.\n\t\t *\n\t\t * CURIEs allow a shortened version of URI relations. This allows a more\n\t\t * usable form for custom relations than using the full URI. These work\n\t\t * similarly to how XML namespaces work.\n\t\t *\n\t\t * Registered CURIES need to specify a name and URI template. This will\n\t\t * automatically transform URI relations into their shortened version.\n\t\t * The shortened relation follows the format `{name}:{rel}`. `{rel}` in\n\t\t * the URI template will be replaced with the `{rel}` part of the\n\t\t * shortened relation.\n\t\t *\n\t\t * For example, a CURIE with name `example` and URI template\n\t\t * `http://w.org/{rel}` would transform a `http://w.org/term` relation\n\t\t * into `example:term`.\n\t\t *\n\t\t * Well-behaved clients should expand and normalise these back to their\n\t\t * full URI relation, however some naive clients may not resolve these\n\t\t * correctly, so adding new CURIEs may break backward compatibility.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @param array $additional Additional CURIEs to register with the API.\n\t\t */\n\t\t$additional = apply_filters( 'rest_response_link_curies', array() );\n\n\t\treturn array_merge( $curies, $additional );\n\t}\n}\n", "num_lines": 294}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Server class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement the WordPress REST API server.\n *\n * @since 4.4.0\n */\nclass WP_REST_Server {\n\n\t/**\n\t * Alias for GET transport method.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tconst READABLE = 'GET';\n\n\t/**\n\t * Alias for POST transport method.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tconst CREATABLE = 'POST';\n\n\t/**\n\t * Alias for POST, PUT, PATCH transport methods together.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tconst EDITABLE = 'POST, PUT, PATCH';\n\n\t/**\n\t * Alias for DELETE transport method.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tconst DELETABLE = 'DELETE';\n\n\t/**\n\t * Alias for GET, POST, PUT, PATCH & DELETE transport methods together.\n\t *\n\t * @since 4.4.0\n\t * @var string\n\t */\n\tconst ALLMETHODS = 'GET, POST, PUT, PATCH, DELETE';\n\n\t/**\n\t * Namespaces registered to the server.\n\t *\n\t * @since 4.4.0\n\t * @var array\n\t */\n\tprotected $namespaces = array();\n\n\t/**\n\t * Endpoints registered to the server.\n\t *\n\t * @since 4.4.0\n\t * @var array\n\t */\n\tprotected $endpoints = array();\n\n\t/**\n\t * Options defined for the routes.\n\t *\n\t * @since 4.4.0\n\t * @var array\n\t */\n\tprotected $route_options = array();\n\n\t/**\n\t * Caches embedded requests.\n\t *\n\t * @since 5.4.0\n\t * @var array\n\t */\n\tprotected $embed_cache = array();\n\n\t/**\n\t * Instantiates the REST server.\n\t *\n\t * @since 4.4.0\n\t */\n\tpublic function __construct() {\n\t\t$this->endpoints = array(\n\t\t\t// Meta endpoints.\n\t\t\t'/' => array(\n\t\t\t\t'callback' => array( $this, 'get_index' ),\n\t\t\t\t'methods'  => 'GET',\n\t\t\t\t'args'     => array(\n\t\t\t\t\t'context' => array(\n\t\t\t\t\t\t'default' => 'view',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}\n\n\n\t/**\n\t * Checks the authentication headers if supplied.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return WP_Error|null WP_Error indicates unsuccessful login, null indicates successful\n\t *                       or no authentication provided\n\t */\n\tpublic function check_authentication() {\n\t\t/**\n\t\t * Filters REST authentication errors.\n\t\t *\n\t\t * This is used to pass a WP_Error from an authentication method back to\n\t\t * the API.\n\t\t *\n\t\t * Authentication methods should check first if they're being used, as\n\t\t * multiple authentication methods can be enabled on a site (cookies,\n\t\t * HTTP basic auth, OAuth). If the authentication method hooked in is\n\t\t * not actually being attempted, null should be returned to indicate\n\t\t * another authentication method should check instead. Similarly,\n\t\t * callbacks should ensure the value is `null` before checking for\n\t\t * errors.\n\t\t *\n\t\t * A WP_Error instance can be returned if an error occurs, and this should\n\t\t * match the format used by API methods internally (that is, the `status`\n\t\t * data should be used). A callback can return `true` to indicate that\n\t\t * the authentication method was used, and it succeeded.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param WP_Error|null|true $errors WP_Error if authentication error, null if authentication\n\t\t *                                   method wasn't used, true if authentication succeeded.\n\t\t */\n\t\treturn apply_filters( 'rest_authentication_errors', null );\n\t}\n\n\t/**\n\t * Converts an error to a response object.\n\t *\n\t * This iterates over all error codes and messages to change it into a flat\n\t * array. This enables simpler client behaviour, as it is represented as a\n\t * list in JSON rather than an object/map.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param WP_Error $error WP_Error instance.\n\t * @return WP_REST_Response List of associative arrays with code and message keys.\n\t */\n\tprotected function error_to_response( $error ) {\n\t\t$error_data = $error->get_error_data();\n\n\t\tif ( is_array( $error_data ) && isset( $error_data['status'] ) ) {\n\t\t\t$status = $error_data['status'];\n\t\t} else {\n\t\t\t$status = 500;\n\t\t}\n\n\t\t$errors = array();\n\n\t\tforeach ( (array) $error->errors as $code => $messages ) {\n\t\t\tforeach ( (array) $messages as $message ) {\n\t\t\t\t$errors[] = array(\n\t\t\t\t\t'code'    => $code,\n\t\t\t\t\t'message' => $message,\n\t\t\t\t\t'data'    => $error->get_error_data( $code ),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$data = $errors[0];\n\t\tif ( count( $errors ) > 1 ) {\n\t\t\t// Remove the primary error.\n\t\t\tarray_shift( $errors );\n\t\t\t$data['additional_errors'] = $errors;\n\t\t}\n\n\t\t$response = new WP_REST_Response( $data, $status );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Retrieves an appropriate error representation in JSON.\n\t *\n\t * Note: This should only be used in WP_REST_Server::serve_request(), as it\n\t * cannot handle WP_Error internally. All callbacks and other internal methods\n\t * should instead return a WP_Error with the data set to an array that includes\n\t * a 'status' key, with the value being the HTTP status to send.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $code    WP_Error-style code.\n\t * @param string $message Human-readable message.\n\t * @param int    $status  Optional. HTTP status code to send. Default null.\n\t * @return string JSON representation of the error\n\t */\n\tprotected function json_error( $code, $message, $status = null ) {\n\t\tif ( $status ) {\n\t\t\t$this->set_status( $status );\n\t\t}\n\n\t\t$error = compact( 'code', 'message' );\n\n\t\treturn wp_json_encode( $error );\n\t}\n\n\t/**\n\t * Handles serving an API request.\n\t *\n\t * Matches the current server URI to a route and runs the first matching\n\t * callback then outputs a JSON representation of the returned value.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @see WP_REST_Server::dispatch()\n\t *\n\t * @param string $path Optional. The request route. If not set, `$_SERVER['PATH_INFO']` will be used.\n\t *                     Default null.\n\t * @return null|false Null if not served and a HEAD request, false otherwise.\n\t */\n\tpublic function serve_request( $path = null ) {\n\t\t$content_type = isset( $_GET['_jsonp'] ) ? 'application/javascript' : 'application/json';\n\t\t$this->send_header( 'Content-Type', $content_type . '; charset=' . get_option( 'blog_charset' ) );\n\t\t$this->send_header( 'X-Robots-Tag', 'noindex' );\n\n\t\t$api_root = get_rest_url();\n\t\tif ( ! empty( $api_root ) ) {\n\t\t\t$this->send_header( 'Link', '<' . esc_url_raw( $api_root ) . '>; rel=\"https://api.w.org/\"' );\n\t\t}\n\n\t\t/*\n\t\t * Mitigate possible JSONP Flash attacks.\n\t\t *\n\t\t * https://miki.it/blog/2014/7/8/abusing-jsonp-with-rosetta-flash/\n\t\t */\n\t\t$this->send_header( 'X-Content-Type-Options', 'nosniff' );\n\t\t$expose_headers = array( 'X-WP-Total', 'X-WP-TotalPages', 'Link' );\n\n\t\t/**\n\t\t * Filters the list of response headers that are exposed to CORS requests.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param string[] $expose_headers The list of headers to expose.\n\t\t */\n\t\t$expose_headers = apply_filters( 'rest_exposed_cors_headers', $expose_headers );\n\n\t\t$this->send_header( 'Access-Control-Expose-Headers', implode( ', ', $expose_headers ) );\n\n\t\t$allow_headers = array(\n\t\t\t'Authorization',\n\t\t\t'X-WP-Nonce',\n\t\t\t'Content-Disposition',\n\t\t\t'Content-MD5',\n\t\t\t'Content-Type',\n\t\t);\n\n\t\t/**\n\t\t * Filters the list of request headers that are allowed for CORS requests.\n\t\t *\n\t\t * The allowed headers are passed to the browser to specify which\n\t\t * headers can be passed to the REST API. By default, we allow the\n\t\t * Content-* headers needed to upload files to the media endpoints.\n\t\t * As well as the Authorization and Nonce headers for allowing authentication.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param string[] $allow_headers The list of headers to allow.\n\t\t */\n\t\t$allow_headers = apply_filters( 'rest_allowed_cors_headers', $allow_headers );\n\n\t\t$this->send_header( 'Access-Control-Allow-Headers', implode( ', ', $allow_headers ) );\n\n\t\t/**\n\t\t * Send nocache headers on authenticated requests.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param bool $rest_send_nocache_headers Whether to send no-cache headers.\n\t\t */\n\t\t$send_no_cache_headers = apply_filters( 'rest_send_nocache_headers', is_user_logged_in() );\n\t\tif ( $send_no_cache_headers ) {\n\t\t\tforeach ( wp_get_nocache_headers() as $header => $header_value ) {\n\t\t\t\tif ( empty( $header_value ) ) {\n\t\t\t\t\t$this->remove_header( $header );\n\t\t\t\t} else {\n\t\t\t\t\t$this->send_header( $header, $header_value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters whether the REST API is enabled.\n\t\t *\n\t\t * @since 4.4.0\n\t\t * @deprecated 4.7.0 Use the {@see 'rest_authentication_errors'} filter to\n\t\t *                   restrict access to the API.\n\t\t *\n\t\t * @param bool $rest_enabled Whether the REST API is enabled. Default true.\n\t\t */\n\t\tapply_filters_deprecated(\n\t\t\t'rest_enabled',\n\t\t\tarray( true ),\n\t\t\t'4.7.0',\n\t\t\t'rest_authentication_errors',\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: rest_authentication_errors */\n\t\t\t\t__( 'The REST API can no longer be completely disabled, the %s filter can be used to restrict access to the API, instead.' ),\n\t\t\t\t'rest_authentication_errors'\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Filters whether jsonp is enabled.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param bool $jsonp_enabled Whether jsonp is enabled. Default true.\n\t\t */\n\t\t$jsonp_enabled = apply_filters( 'rest_jsonp_enabled', true );\n\n\t\t$jsonp_callback = null;\n\n\t\tif ( isset( $_GET['_jsonp'] ) ) {\n\t\t\tif ( ! $jsonp_enabled ) {\n\t\t\t\techo $this->json_error( 'rest_callback_disabled', __( 'JSONP support is disabled on this site.' ), 400 );\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$jsonp_callback = $_GET['_jsonp'];\n\t\t\tif ( ! wp_check_jsonp_callback( $jsonp_callback ) ) {\n\t\t\t\techo $this->json_error( 'rest_callback_invalid', __( 'Invalid JSONP callback function.' ), 400 );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $path ) ) {\n\t\t\tif ( isset( $_SERVER['PATH_INFO'] ) ) {\n\t\t\t\t$path = $_SERVER['PATH_INFO'];\n\t\t\t} else {\n\t\t\t\t$path = '/';\n\t\t\t}\n\t\t}\n\n\t\t$request = new WP_REST_Request( $_SERVER['REQUEST_METHOD'], $path );\n\n\t\t$request->set_query_params( wp_unslash( $_GET ) );\n\t\t$request->set_body_params( wp_unslash( $_POST ) );\n\t\t$request->set_file_params( $_FILES );\n\t\t$request->set_headers( $this->get_headers( wp_unslash( $_SERVER ) ) );\n\t\t$request->set_body( self::get_raw_data() );\n\n\t\t/*\n\t\t * HTTP method override for clients that can't use PUT/PATCH/DELETE. First, we check\n\t\t * $_GET['_method']. If that is not set, we check for the HTTP_X_HTTP_METHOD_OVERRIDE\n\t\t * header.\n\t\t */\n\t\tif ( isset( $_GET['_method'] ) ) {\n\t\t\t$request->set_method( $_GET['_method'] );\n\t\t} elseif ( isset( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ) ) {\n\t\t\t$request->set_method( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] );\n\t\t}\n\n\t\t$result = $this->check_authentication();\n\n\t\tif ( ! is_wp_error( $result ) ) {\n\t\t\t$result = $this->dispatch( $request );\n\t\t}\n\n\t\t// Normalize to either WP_Error or WP_REST_Response...\n\t\t$result = rest_ensure_response( $result );\n\n\t\t// ...then convert WP_Error across.\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\t$result = $this->error_to_response( $result );\n\t\t}\n\n\t\t/**\n\t\t * Filters the API response.\n\t\t *\n\t\t * Allows modification of the response before returning.\n\t\t *\n\t\t * @since 4.4.0\n\t\t * @since 4.5.0 Applied to embedded responses.\n\t\t *\n\t\t * @param WP_HTTP_Response $result  Result to send to the client. Usually a WP_REST_Response.\n\t\t * @param WP_REST_Server   $this    Server instance.\n\t\t * @param WP_REST_Request  $request Request used to generate the response.\n\t\t */\n\t\t$result = apply_filters( 'rest_post_dispatch', rest_ensure_response( $result ), $this, $request );\n\n\t\t// Wrap the response in an envelope if asked for.\n\t\tif ( isset( $_GET['_envelope'] ) ) {\n\t\t\t$result = $this->envelope_response( $result, isset( $_GET['_embed'] ) );\n\t\t}\n\n\t\t// Send extra data from response objects.\n\t\t$headers = $result->get_headers();\n\t\t$this->send_headers( $headers );\n\n\t\t$code = $result->get_status();\n\t\t$this->set_status( $code );\n\n\t\t/**\n\t\t * Filters whether the request has already been served.\n\t\t *\n\t\t * Allow sending the request manually - by returning true, the API result\n\t\t * will not be sent to the client.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param bool             $served  Whether the request has already been served.\n\t\t *                                           Default false.\n\t\t * @param WP_HTTP_Response $result  Result to send to the client. Usually a WP_REST_Response.\n\t\t * @param WP_REST_Request  $request Request used to generate the response.\n\t\t * @param WP_REST_Server   $this    Server instance.\n\t\t */\n\t\t$served = apply_filters( 'rest_pre_serve_request', false, $result, $request, $this );\n\n\t\tif ( ! $served ) {\n\t\t\tif ( 'HEAD' === $request->get_method() ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Embed links inside the request.\n\t\t\t$embed  = isset( $_GET['_embed'] ) ? rest_parse_embed_param( $_GET['_embed'] ) : false;\n\t\t\t$result = $this->response_to_data( $result, $embed );\n\n\t\t\t/**\n\t\t\t * Filters the API response.\n\t\t\t *\n\t\t\t * Allows modification of the response data after inserting\n\t\t\t * embedded data (if any) and before echoing the response data.\n\t\t\t *\n\t\t\t * @since 4.8.1\n\t\t\t *\n\t\t\t * @param array            $result  Response data to send to the client.\n\t\t\t * @param WP_REST_Server   $this    Server instance.\n\t\t\t * @param WP_REST_Request  $request Request used to generate the response.\n\t\t\t */\n\t\t\t$result = apply_filters( 'rest_pre_echo_response', $result, $this, $request );\n\n\t\t\t// The 204 response shouldn't have a body.\n\t\t\tif ( 204 === $code || null === $result ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$result = wp_json_encode( $result );\n\n\t\t\t$json_error_message = $this->get_json_last_error();\n\n\t\t\tif ( $json_error_message ) {\n\t\t\t\t$json_error_obj = new WP_Error(\n\t\t\t\t\t'rest_encode_error',\n\t\t\t\t\t$json_error_message,\n\t\t\t\t\tarray( 'status' => 500 )\n\t\t\t\t);\n\n\t\t\t\t$result = $this->error_to_response( $json_error_obj );\n\t\t\t\t$result = wp_json_encode( $result->data[0] );\n\t\t\t}\n\n\t\t\tif ( $jsonp_callback ) {\n\t\t\t\t// Prepend '/**/' to mitigate possible JSONP Flash attacks.\n\t\t\t\t// https://miki.it/blog/2014/7/8/abusing-jsonp-with-rosetta-flash/\n\t\t\t\techo '/**/' . $jsonp_callback . '(' . $result . ')';\n\t\t\t} else {\n\t\t\t\techo $result;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Converts a response to data to send.\n\t *\n\t * @since 4.4.0\n\t * @since 5.4.0 The $embed parameter can now contain a list of link relations to include.\n\t *\n\t * @param WP_REST_Response $response Response object.\n\t * @param bool|string[]    $embed    Whether to embed all links, a filtered list of link relations, or no links.\n\t * @return array {\n\t *     Data with sub-requests embedded.\n\t *\n\t *     @type array $_links    Links.\n\t *     @type array $_embedded Embeddeds.\n\t * }\n\t */\n\tpublic function response_to_data( $response, $embed ) {\n\t\t$data  = $response->get_data();\n\t\t$links = self::get_compact_response_links( $response );\n\n\t\tif ( ! empty( $links ) ) {\n\t\t\t// Convert links to part of the data.\n\t\t\t$data['_links'] = $links;\n\t\t}\n\n\t\tif ( $embed ) {\n\t\t\t$this->embed_cache = array();\n\t\t\t// Determine if this is a numeric array.\n\t\t\tif ( wp_is_numeric_array( $data ) ) {\n\t\t\t\tforeach ( $data as $key => $item ) {\n\t\t\t\t\t$data[ $key ] = $this->embed_links( $item, $embed );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$data = $this->embed_links( $data, $embed );\n\t\t\t}\n\t\t\t$this->embed_cache = array();\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Retrieves links from a response.\n\t *\n\t * Extracts the links from a response into a structured hash, suitable for\n\t * direct output.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param WP_REST_Response $response Response to extract links from.\n\t * @return array Map of link relation to list of link hashes.\n\t */\n\tpublic static function get_response_links( $response ) {\n\t\t$links = $response->get_links();\n\n\t\tif ( empty( $links ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t// Convert links to part of the data.\n\t\t$data = array();\n\t\tforeach ( $links as $rel => $items ) {\n\t\t\t$data[ $rel ] = array();\n\n\t\t\tforeach ( $items as $item ) {\n\t\t\t\t$attributes         = $item['attributes'];\n\t\t\t\t$attributes['href'] = $item['href'];\n\t\t\t\t$data[ $rel ][]     = $attributes;\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Retrieves the CURIEs (compact URIs) used for relations.\n\t *\n\t * Extracts the links from a response into a structured hash, suitable for\n\t * direct output.\n\t *\n\t * @since 4.5.0\n\t *\n\t * @param WP_REST_Response $response Response to extract links from.\n\t * @return array Map of link relation to list of link hashes.\n\t */\n\tpublic static function get_compact_response_links( $response ) {\n\t\t$links = self::get_response_links( $response );\n\n\t\tif ( empty( $links ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$curies      = $response->get_curies();\n\t\t$used_curies = array();\n\n\t\tforeach ( $links as $rel => $items ) {\n\n\t\t\t// Convert $rel URIs to their compact versions if they exist.\n\t\t\tforeach ( $curies as $curie ) {\n\t\t\t\t$href_prefix = substr( $curie['href'], 0, strpos( $curie['href'], '{rel}' ) );\n\t\t\t\tif ( strpos( $rel, $href_prefix ) !== 0 ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Relation now changes from '$uri' to '$curie:$relation'.\n\t\t\t\t$rel_regex = str_replace( '\\{rel\\}', '(.+)', preg_quote( $curie['href'], '!' ) );\n\t\t\t\tpreg_match( '!' . $rel_regex . '!', $rel, $matches );\n\t\t\t\tif ( $matches ) {\n\t\t\t\t\t$new_rel                       = $curie['name'] . ':' . $matches[1];\n\t\t\t\t\t$used_curies[ $curie['name'] ] = $curie;\n\t\t\t\t\t$links[ $new_rel ]             = $items;\n\t\t\t\t\tunset( $links[ $rel ] );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Push the curies onto the start of the links array.\n\t\tif ( $used_curies ) {\n\t\t\t$links['curies'] = array_values( $used_curies );\n\t\t}\n\n\t\treturn $links;\n\t}\n\n\t/**\n\t * Embeds the links from the data into the request.\n\t *\n\t * @since 4.4.0\n\t * @since 5.4.0 The $embed parameter can now contain a list of link relations to include.\n\t *\n\t * @param array         $data  Data from the request.\n\t * @param bool|string[] $embed Whether to embed all links or a filtered list of link relations.\n\t * @return array {\n\t *     Data with sub-requests embedded.\n\t *\n\t *     @type array $_links    Links.\n\t *     @type array $_embedded Embeddeds.\n\t * }\n\t */\n\tprotected function embed_links( $data, $embed = true ) {\n\t\tif ( empty( $data['_links'] ) ) {\n\t\t\treturn $data;\n\t\t}\n\n\t\t$embedded = array();\n\n\t\tforeach ( $data['_links'] as $rel => $links ) {\n\t\t\t// If a list of relations was specified, and the link relation\n\t\t\t// is not in the list of allowed relations, don't process the link.\n\t\t\tif ( is_array( $embed ) && ! in_array( $rel, $embed, true ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$embeds = array();\n\n\t\t\tforeach ( $links as $item ) {\n\t\t\t\t// Determine if the link is embeddable.\n\t\t\t\tif ( empty( $item['embeddable'] ) ) {\n\t\t\t\t\t// Ensure we keep the same order.\n\t\t\t\t\t$embeds[] = array();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( ! array_key_exists( $item['href'], $this->embed_cache ) ) {\n\t\t\t\t\t// Run through our internal routing and serve.\n\t\t\t\t\t$request = WP_REST_Request::from_url( $item['href'] );\n\t\t\t\t\tif ( ! $request ) {\n\t\t\t\t\t\t$embeds[] = array();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Embedded resources get passed context=embed.\n\t\t\t\t\tif ( empty( $request['context'] ) ) {\n\t\t\t\t\t\t$request['context'] = 'embed';\n\t\t\t\t\t}\n\n\t\t\t\t\t$response = $this->dispatch( $request );\n\n\t\t\t\t\t/** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */\n\t\t\t\t\t$response = apply_filters( 'rest_post_dispatch', rest_ensure_response( $response ), $this, $request );\n\n\t\t\t\t\t$this->embed_cache[ $item['href'] ] = $this->response_to_data( $response, false );\n\t\t\t\t}\n\n\t\t\t\t$embeds[] = $this->embed_cache[ $item['href'] ];\n\t\t\t}\n\n\t\t\t// Determine if any real links were found.\n\t\t\t$has_links = count( array_filter( $embeds ) );\n\n\t\t\tif ( $has_links ) {\n\t\t\t\t$embedded[ $rel ] = $embeds;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $embedded ) ) {\n\t\t\t$data['_embedded'] = $embedded;\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Wraps the response in an envelope.\n\t *\n\t * The enveloping technique is used to work around browser/client\n\t * compatibility issues. Essentially, it converts the full HTTP response to\n\t * data instead.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param WP_REST_Response $response Response object.\n\t * @param bool             $embed    Whether links should be embedded.\n\t * @return WP_REST_Response New response with wrapped data\n\t */\n\tpublic function envelope_response( $response, $embed ) {\n\t\t$envelope = array(\n\t\t\t'body'    => $this->response_to_data( $response, $embed ),\n\t\t\t'status'  => $response->get_status(),\n\t\t\t'headers' => $response->get_headers(),\n\t\t);\n\n\t\t/**\n\t\t * Filters the enveloped form of a response.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param array            $envelope Envelope data.\n\t\t * @param WP_REST_Response $response Original response data.\n\t\t */\n\t\t$envelope = apply_filters( 'rest_envelope_response', $envelope, $response );\n\n\t\t// Ensure it's still a response and return.\n\t\treturn rest_ensure_response( $envelope );\n\t}\n\n\t/**\n\t * Registers a route to the server.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $namespace  Namespace.\n\t * @param string $route      The REST route.\n\t * @param array  $route_args Route arguments.\n\t * @param bool   $override   Optional. Whether the route should be overridden if it already exists.\n\t *                           Default false.\n\t */\n\tpublic function register_route( $namespace, $route, $route_args, $override = false ) {\n\t\tif ( ! isset( $this->namespaces[ $namespace ] ) ) {\n\t\t\t$this->namespaces[ $namespace ] = array();\n\n\t\t\t$this->register_route(\n\t\t\t\t$namespace,\n\t\t\t\t'/' . $namespace,\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods'  => self::READABLE,\n\t\t\t\t\t\t'callback' => array( $this, 'get_namespace_index' ),\n\t\t\t\t\t\t'args'     => array(\n\t\t\t\t\t\t\t'namespace' => array(\n\t\t\t\t\t\t\t\t'default' => $namespace,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'context'   => array(\n\t\t\t\t\t\t\t\t'default' => 'view',\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\t\t\t);\n\t\t}\n\n\t\t// Associative to avoid double-registration.\n\t\t$this->namespaces[ $namespace ][ $route ] = true;\n\t\t$route_args['namespace']                  = $namespace;\n\n\t\tif ( $override || empty( $this->endpoints[ $route ] ) ) {\n\t\t\t$this->endpoints[ $route ] = $route_args;\n\t\t} else {\n\t\t\t$this->endpoints[ $route ] = array_merge( $this->endpoints[ $route ], $route_args );\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the route map.\n\t *\n\t * The route map is an associative array with path regexes as the keys. The\n\t * value is an indexed array with the callback function/method as the first\n\t * item, and a bitmask of HTTP methods as the second item (see the class\n\t * constants).\n\t *\n\t * Each route can be mapped to more than one callback by using an array of\n\t * the indexed arrays. This allows mapping e.g. GET requests to one callback\n\t * and POST requests to another.\n\t *\n\t * Note that the path regexes (array keys) must have @ escaped, as this is\n\t * used as the delimiter with preg_match()\n\t *\n\t * @since 4.4.0\n\t * @since 5.4.0 Add $namespace parameter.\n\t *\n\t * @param string $namespace Optionally, only return routes in the given namespace.\n\t * @return array `'/path/regex' => array( $callback, $bitmask )` or\n\t *               `'/path/regex' => array( array( $callback, $bitmask ), ...)`.\n\t */\n\tpublic function get_routes( $namespace = '' ) {\n\t\t$endpoints = $this->endpoints;\n\n\t\tif ( $namespace ) {\n\t\t\t$endpoints = wp_list_filter( $endpoints, array( 'namespace' => $namespace ) );\n\t\t}\n\n\t\t/**\n\t\t * Filters the array of available endpoints.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param array $endpoints The available endpoints. An array of matching regex patterns, each mapped\n\t\t *                         to an array of callbacks for the endpoint. These take the format\n\t\t *                         `'/path/regex' => array( $callback, $bitmask )` or\n\t\t *                         `'/path/regex' => array( array( $callback, $bitmask ).\n\t\t */\n\t\t$endpoints = apply_filters( 'rest_endpoints', $endpoints );\n\n\t\t// Normalise the endpoints.\n\t\t$defaults = array(\n\t\t\t'methods'       => '',\n\t\t\t'accept_json'   => false,\n\t\t\t'accept_raw'    => false,\n\t\t\t'show_in_index' => true,\n\t\t\t'args'          => array(),\n\t\t);\n\n\t\tforeach ( $endpoints as $route => &$handlers ) {\n\n\t\t\tif ( isset( $handlers['callback'] ) ) {\n\t\t\t\t// Single endpoint, add one deeper.\n\t\t\t\t$handlers = array( $handlers );\n\t\t\t}\n\n\t\t\tif ( ! isset( $this->route_options[ $route ] ) ) {\n\t\t\t\t$this->route_options[ $route ] = array();\n\t\t\t}\n\n\t\t\tforeach ( $handlers as $key => &$handler ) {\n\n\t\t\t\tif ( ! is_numeric( $key ) ) {\n\t\t\t\t\t// Route option, move it to the options.\n\t\t\t\t\t$this->route_options[ $route ][ $key ] = $handler;\n\t\t\t\t\tunset( $handlers[ $key ] );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$handler = wp_parse_args( $handler, $defaults );\n\n\t\t\t\t// Allow comma-separated HTTP methods.\n\t\t\t\tif ( is_string( $handler['methods'] ) ) {\n\t\t\t\t\t$methods = explode( ',', $handler['methods'] );\n\t\t\t\t} elseif ( is_array( $handler['methods'] ) ) {\n\t\t\t\t\t$methods = $handler['methods'];\n\t\t\t\t} else {\n\t\t\t\t\t$methods = array();\n\t\t\t\t}\n\n\t\t\t\t$handler['methods'] = array();\n\n\t\t\t\tforeach ( $methods as $method ) {\n\t\t\t\t\t$method                        = strtoupper( trim( $method ) );\n\t\t\t\t\t$handler['methods'][ $method ] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $endpoints;\n\t}\n\n\t/**\n\t * Retrieves namespaces registered on the server.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return string[] List of registered namespaces.\n\t */\n\tpublic function get_namespaces() {\n\t\treturn array_keys( $this->namespaces );\n\t}\n\n\t/**\n\t * Retrieves specified options for a route.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $route Route pattern to fetch options for.\n\t * @return array|null Data as an associative array if found, or null if not found.\n\t */\n\tpublic function get_route_options( $route ) {\n\t\tif ( ! isset( $this->route_options[ $route ] ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->route_options[ $route ];\n\t}\n\n\t/**\n\t * Matches the request to a callback and call it.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param WP_REST_Request $request Request to attempt dispatching.\n\t * @return WP_REST_Response Response returned by the callback.\n\t */\n\tpublic function dispatch( $request ) {\n\t\t/**\n\t\t * Filters the pre-calculated result of a REST dispatch request.\n\t\t *\n\t\t * Allow hijacking the request before dispatching by returning a non-empty. The returned value\n\t\t * will be used to serve the request instead.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param mixed           $result  Response to replace the requested version with. Can be anything\n\t\t *                                 a normal endpoint can return, or null to not hijack the request.\n\t\t * @param WP_REST_Server  $this    Server instance.\n\t\t * @param WP_REST_Request $request Request used to generate the response.\n\t\t */\n\t\t$result = apply_filters( 'rest_pre_dispatch', null, $this, $request );\n\n\t\tif ( ! empty( $result ) ) {\n\t\t\treturn $result;\n\t\t}\n\n\t\t$method = $request->get_method();\n\t\t$path   = $request->get_route();\n\n\t\t$with_namespace = array();\n\n\t\tforeach ( $this->get_namespaces() as $namespace ) {\n\t\t\tif ( 0 === strpos( trailingslashit( ltrim( $path, '/' ) ), $namespace ) ) {\n\t\t\t\t$with_namespace[] = $this->get_routes( $namespace );\n\t\t\t}\n\t\t}\n\n\t\tif ( $with_namespace ) {\n\t\t\t$routes = array_merge( ...$with_namespace );\n\t\t} else {\n\t\t\t$routes = $this->get_routes();\n\t\t}\n\n\t\tforeach ( $routes as $route => $handlers ) {\n\t\t\t$match = preg_match( '@^' . $route . '$@i', $path, $matches );\n\n\t\t\tif ( ! $match ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$args = array();\n\n\t\t\tforeach ( $matches as $param => $value ) {\n\t\t\t\tif ( ! is_int( $param ) ) {\n\t\t\t\t\t$args[ $param ] = $value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ( $handlers as $handler ) {\n\t\t\t\t$callback = $handler['callback'];\n\t\t\t\t$response = null;\n\n\t\t\t\t// Fallback to GET method if no HEAD method is registered.\n\t\t\t\t$checked_method = $method;\n\t\t\t\tif ( 'HEAD' === $method && empty( $handler['methods']['HEAD'] ) ) {\n\t\t\t\t\t$checked_method = 'GET';\n\t\t\t\t}\n\t\t\t\tif ( empty( $handler['methods'][ $checked_method ] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( ! is_callable( $callback ) ) {\n\t\t\t\t\t$response = new WP_Error(\n\t\t\t\t\t\t'rest_invalid_handler',\n\t\t\t\t\t\t__( 'The handler for the route is invalid' ),\n\t\t\t\t\t\tarray( 'status' => 500 )\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( ! is_wp_error( $response ) ) {\n\t\t\t\t\t// Remove the redundant preg_match argument.\n\t\t\t\t\tunset( $args[0] );\n\n\t\t\t\t\t$request->set_url_params( $args );\n\t\t\t\t\t$request->set_attributes( $handler );\n\n\t\t\t\t\t$defaults = array();\n\n\t\t\t\t\tforeach ( $handler['args'] as $arg => $options ) {\n\t\t\t\t\t\tif ( isset( $options['default'] ) ) {\n\t\t\t\t\t\t\t$defaults[ $arg ] = $options['default'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$request->set_default_params( $defaults );\n\n\t\t\t\t\t$check_required = $request->has_valid_params();\n\t\t\t\t\tif ( is_wp_error( $check_required ) ) {\n\t\t\t\t\t\t$response = $check_required;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$check_sanitized = $request->sanitize_params();\n\t\t\t\t\t\tif ( is_wp_error( $check_sanitized ) ) {\n\t\t\t\t\t\t\t$response = $check_sanitized;\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\t * Filters the response before executing any REST API callbacks.\n\t\t\t\t *\n\t\t\t\t * Allows plugins to perform additional validation after a\n\t\t\t\t * request is initialized and matched to a registered route,\n\t\t\t\t * but before it is executed.\n\t\t\t\t *\n\t\t\t\t * Note that this filter will not be called for requests that\n\t\t\t\t * fail to authenticate or match to a registered route.\n\t\t\t\t *\n\t\t\t\t * @since 4.7.0\n\t\t\t\t *\n\t\t\t\t * @param WP_REST_Response|WP_HTTP_Response|WP_Error|mixed $response Result to send to the client. Usually a WP_REST_Response or WP_Error.\n\t\t\t\t * @param array                                            $handler  Route handler used for the request.\n\t\t\t\t * @param WP_REST_Request                                  $request  Request used to generate the response.\n\t\t\t\t */\n\t\t\t\t$response = apply_filters( 'rest_request_before_callbacks', $response, $handler, $request );\n\n\t\t\t\tif ( ! is_wp_error( $response ) ) {\n\t\t\t\t\t// Check permission specified on the route.\n\t\t\t\t\tif ( ! empty( $handler['permission_callback'] ) ) {\n\t\t\t\t\t\t$permission = call_user_func( $handler['permission_callback'], $request );\n\n\t\t\t\t\t\tif ( is_wp_error( $permission ) ) {\n\t\t\t\t\t\t\t$response = $permission;\n\t\t\t\t\t\t} elseif ( false === $permission || null === $permission ) {\n\t\t\t\t\t\t\t$response = new WP_Error(\n\t\t\t\t\t\t\t\t'rest_forbidden',\n\t\t\t\t\t\t\t\t__( 'Sorry, you are not allowed to do that.' ),\n\t\t\t\t\t\t\t\tarray( 'status' => rest_authorization_required_code() )\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\tif ( ! is_wp_error( $response ) ) {\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters the REST dispatch request result.\n\t\t\t\t\t *\n\t\t\t\t\t * Allow plugins to override dispatching the request.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 4.4.0\n\t\t\t\t\t * @since 4.5.0 Added `$route` and `$handler` parameters.\n\t\t\t\t\t *\n\t\t\t\t\t * @param mixed           $dispatch_result Dispatch result, will be used if not empty.\n\t\t\t\t\t * @param WP_REST_Request $request         Request used to generate the response.\n\t\t\t\t\t * @param string          $route           Route matched for the request.\n\t\t\t\t\t * @param array           $handler         Route handler used for the request.\n\t\t\t\t\t */\n\t\t\t\t\t$dispatch_result = apply_filters( 'rest_dispatch_request', null, $request, $route, $handler );\n\n\t\t\t\t\t// Allow plugins to halt the request via this filter.\n\t\t\t\t\tif ( null !== $dispatch_result ) {\n\t\t\t\t\t\t$response = $dispatch_result;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response = call_user_func( $callback, $request );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Filters the response immediately after executing any REST API\n\t\t\t\t * callbacks.\n\t\t\t\t *\n\t\t\t\t * Allows plugins to perform any needed cleanup, for example,\n\t\t\t\t * to undo changes made during the {@see 'rest_request_before_callbacks'}\n\t\t\t\t * filter.\n\t\t\t\t *\n\t\t\t\t * Note that this filter will not be called for requests that\n\t\t\t\t * fail to authenticate or match to a registered route.\n\t\t\t\t *\n\t\t\t\t * Note that an endpoint's `permission_callback` can still be\n\t\t\t\t * called after this filter - see `rest_send_allow_header()`.\n\t\t\t\t *\n\t\t\t\t * @since 4.7.0\n\t\t\t\t *\n\t\t\t\t * @param WP_REST_Response|WP_HTTP_Response|WP_Error|mixed $response Result to send to the client. Usually a WP_REST_Response or WP_Error.\n\t\t\t\t * @param array                                            $handler  Route handler used for the request.\n\t\t\t\t * @param WP_REST_Request                                  $request  Request used to generate the response.\n\t\t\t\t */\n\t\t\t\t$response = apply_filters( 'rest_request_after_callbacks', $response, $handler, $request );\n\n\t\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\t\t$response = $this->error_to_response( $response );\n\t\t\t\t} else {\n\t\t\t\t\t$response = rest_ensure_response( $response );\n\t\t\t\t}\n\n\t\t\t\t$response->set_matched_route( $route );\n\t\t\t\t$response->set_matched_handler( $handler );\n\n\t\t\t\treturn $response;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->error_to_response(\n\t\t\tnew WP_Error(\n\t\t\t\t'rest_no_route',\n\t\t\t\t__( 'No route was found matching the URL and request method' ),\n\t\t\t\tarray( 'status' => 404 )\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Returns if an error occurred during most recent JSON encode/decode.\n\t *\n\t * Strings to be translated will be in format like\n\t * \"Encoding error: Maximum stack depth exceeded\".\n\t *\n\t * @since 4.4.0\n\t *\n\t * @return bool|string Boolean false or string error message.\n\t */\n\tprotected function get_json_last_error() {\n\t\t$last_error_code = json_last_error();\n\n\t\tif ( JSON_ERROR_NONE === $last_error_code || empty( $last_error_code ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn json_last_error_msg();\n\t}\n\n\t/**\n\t * Retrieves the site index.\n\t *\n\t * This endpoint describes the capabilities of the site.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $request {\n\t *     Request.\n\t *\n\t *     @type string $context Context.\n\t * }\n\t * @return WP_REST_Response The API root index data.\n\t */\n\tpublic function get_index( $request ) {\n\t\t// General site data.\n\t\t$available = array(\n\t\t\t'name'            => get_option( 'blogname' ),\n\t\t\t'description'     => get_option( 'blogdescription' ),\n\t\t\t'url'             => get_option( 'siteurl' ),\n\t\t\t'home'            => home_url(),\n\t\t\t'gmt_offset'      => get_option( 'gmt_offset' ),\n\t\t\t'timezone_string' => get_option( 'timezone_string' ),\n\t\t\t'namespaces'      => array_keys( $this->namespaces ),\n\t\t\t'authentication'  => array(),\n\t\t\t'routes'          => $this->get_data_for_routes( $this->get_routes(), $request['context'] ),\n\t\t);\n\n\t\t$response = new WP_REST_Response( $available );\n\n\t\t$response->add_link( 'help', 'http://v2.wp-api.org/' );\n\n\t\t/**\n\t\t * Filters the API root index data.\n\t\t *\n\t\t * This contains the data describing the API. This includes information\n\t\t * about supported authentication schemes, supported namespaces, routes\n\t\t * available on the API, and a small amount of data about the site.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param WP_REST_Response $response Response data.\n\t\t */\n\t\treturn apply_filters( 'rest_index', $response );\n\t}\n\n\t/**\n\t * Retrieves the index for a namespace.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param WP_REST_Request $request REST request instance.\n\t * @return WP_REST_Response|WP_Error WP_REST_Response instance if the index was found,\n\t *                                   WP_Error if the namespace isn't set.\n\t */\n\tpublic function get_namespace_index( $request ) {\n\t\t$namespace = $request['namespace'];\n\n\t\tif ( ! isset( $this->namespaces[ $namespace ] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_invalid_namespace',\n\t\t\t\t__( 'The specified namespace could not be found.' ),\n\t\t\t\tarray( 'status' => 404 )\n\t\t\t);\n\t\t}\n\n\t\t$routes    = $this->namespaces[ $namespace ];\n\t\t$endpoints = array_intersect_key( $this->get_routes(), $routes );\n\n\t\t$data     = array(\n\t\t\t'namespace' => $namespace,\n\t\t\t'routes'    => $this->get_data_for_routes( $endpoints, $request['context'] ),\n\t\t);\n\t\t$response = rest_ensure_response( $data );\n\n\t\t// Link to the root index.\n\t\t$response->add_link( 'up', rest_url( '/' ) );\n\n\t\t/**\n\t\t * Filters the namespace index data.\n\t\t *\n\t\t * This typically is just the route data for the namespace, but you can\n\t\t * add any data you'd like here.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param WP_REST_Response $response Response data.\n\t\t * @param WP_REST_Request  $request  Request data. The namespace is passed as the 'namespace' parameter.\n\t\t */\n\t\treturn apply_filters( 'rest_namespace_index', $response, $request );\n\t}\n\n\t/**\n\t * Retrieves the publicly-visible data for routes.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array  $routes  Routes to get data for.\n\t * @param string $context Optional. Context for data. Accepts 'view' or 'help'. Default 'view'.\n\t * @return array[] Route data to expose in indexes, keyed by route.\n\t */\n\tpublic function get_data_for_routes( $routes, $context = 'view' ) {\n\t\t$available = array();\n\n\t\t// Find the available routes.\n\t\tforeach ( $routes as $route => $callbacks ) {\n\t\t\t$data = $this->get_data_for_route( $route, $callbacks, $context );\n\t\t\tif ( empty( $data ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the REST endpoint data.\n\t\t\t *\n\t\t\t * @since 4.4.0\n\t\t\t *\n\t\t\t * @param WP_REST_Request $request Request data. The namespace is passed as the 'namespace' parameter.\n\t\t\t */\n\t\t\t$available[ $route ] = apply_filters( 'rest_endpoints_description', $data );\n\t\t}\n\n\t\t/**\n\t\t * Filters the publicly-visible data for routes.\n\t\t *\n\t\t * This data is exposed on indexes and can be used by clients or\n\t\t * developers to investigate the site and find out how to use it. It\n\t\t * acts as a form of self-documentation.\n\t\t *\n\t\t * @since 4.4.0\n\t\t *\n\t\t * @param array[] $available Route data to expose in indexes, keyed by route.\n\t\t * @param array   $routes    Internal route data as an associative array.\n\t\t */\n\t\treturn apply_filters( 'rest_route_data', $available, $routes );\n\t}\n\n\t/**\n\t * Retrieves publicly-visible data for the route.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $route     Route to get data for.\n\t * @param array  $callbacks Callbacks to convert to data.\n\t * @param string $context   Optional. Context for the data. Accepts 'view' or 'help'. Default 'view'.\n\t * @return array|null Data for the route, or null if no publicly-visible data.\n\t */\n\tpublic function get_data_for_route( $route, $callbacks, $context = 'view' ) {\n\t\t$data = array(\n\t\t\t'namespace' => '',\n\t\t\t'methods'   => array(),\n\t\t\t'endpoints' => array(),\n\t\t);\n\n\t\tif ( isset( $this->route_options[ $route ] ) ) {\n\t\t\t$options = $this->route_options[ $route ];\n\n\t\t\tif ( isset( $options['namespace'] ) ) {\n\t\t\t\t$data['namespace'] = $options['namespace'];\n\t\t\t}\n\n\t\t\tif ( isset( $options['schema'] ) && 'help' === $context ) {\n\t\t\t\t$data['schema'] = call_user_func( $options['schema'] );\n\t\t\t}\n\t\t}\n\n\t\t$route = preg_replace( '#\\(\\?P<(\\w+?)>.*?\\)#', '{$1}', $route );\n\n\t\tforeach ( $callbacks as $callback ) {\n\t\t\t// Skip to the next route if any callback is hidden.\n\t\t\tif ( empty( $callback['show_in_index'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$data['methods'] = array_merge( $data['methods'], array_keys( $callback['methods'] ) );\n\t\t\t$endpoint_data   = array(\n\t\t\t\t'methods' => array_keys( $callback['methods'] ),\n\t\t\t);\n\n\t\t\tif ( isset( $callback['args'] ) ) {\n\t\t\t\t$endpoint_data['args'] = array();\n\n\t\t\t\tforeach ( $callback['args'] as $key => $opts ) {\n\t\t\t\t\t$arg_data = array(\n\t\t\t\t\t\t'required' => ! empty( $opts['required'] ),\n\t\t\t\t\t);\n\t\t\t\t\tif ( isset( $opts['default'] ) ) {\n\t\t\t\t\t\t$arg_data['default'] = $opts['default'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( isset( $opts['enum'] ) ) {\n\t\t\t\t\t\t$arg_data['enum'] = $opts['enum'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( isset( $opts['description'] ) ) {\n\t\t\t\t\t\t$arg_data['description'] = $opts['description'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( isset( $opts['type'] ) ) {\n\t\t\t\t\t\t$arg_data['type'] = $opts['type'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( isset( $opts['items'] ) ) {\n\t\t\t\t\t\t$arg_data['items'] = $opts['items'];\n\t\t\t\t\t}\n\t\t\t\t\t$endpoint_data['args'][ $key ] = $arg_data;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$data['endpoints'][] = $endpoint_data;\n\n\t\t\t// For non-variable routes, generate links.\n\t\t\tif ( strpos( $route, '{' ) === false ) {\n\t\t\t\t$data['_links'] = array(\n\t\t\t\t\t'self' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'href' => rest_url( $route ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $data['methods'] ) ) {\n\t\t\t// No methods supported, hide the route.\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Sends an HTTP status code.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param int $code HTTP status.\n\t */\n\tprotected function set_status( $code ) {\n\t\tstatus_header( $code );\n\t}\n\n\t/**\n\t * Sends an HTTP header.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $key Header key.\n\t * @param string $value Header value.\n\t */\n\tpublic function send_header( $key, $value ) {\n\t\t/*\n\t\t * Sanitize as per RFC2616 (Section 4.2):\n\t\t *\n\t\t * Any LWS that occurs between field-content MAY be replaced with a\n\t\t * single SP before interpreting the field value or forwarding the\n\t\t * message downstream.\n\t\t */\n\t\t$value = preg_replace( '/\\s+/', ' ', $value );\n\t\theader( sprintf( '%s: %s', $key, $value ) );\n\t}\n\n\t/**\n\t * Sends multiple HTTP headers.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $headers Map of header name to header value.\n\t */\n\tpublic function send_headers( $headers ) {\n\t\tforeach ( $headers as $key => $value ) {\n\t\t\t$this->send_header( $key, $value );\n\t\t}\n\t}\n\n\t/**\n\t * Removes an HTTP header from the current response.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param string $key Header key.\n\t */\n\tpublic function remove_header( $key ) {\n\t\theader_remove( $key );\n\t}\n\n\t/**\n\t * Retrieves the raw request entity (body).\n\t *\n\t * @since 4.4.0\n\t *\n\t * @global string $HTTP_RAW_POST_DATA Raw post data.\n\t *\n\t * @return string Raw request data.\n\t */\n\tpublic static function get_raw_data() {\n\t\t// phpcs:disable PHPCompatibility.Variables.RemovedPredefinedGlobalVariables.http_raw_post_dataDeprecatedRemoved\n\t\tglobal $HTTP_RAW_POST_DATA;\n\n\t\t// $HTTP_RAW_POST_DATA was deprecated in PHP 5.6 and removed in PHP 7.0.\n\t\tif ( ! isset( $HTTP_RAW_POST_DATA ) ) {\n\t\t\t$HTTP_RAW_POST_DATA = file_get_contents( 'php://input' );\n\t\t}\n\n\t\treturn $HTTP_RAW_POST_DATA;\n\t\t// phpcs:enable\n\t}\n\n\t/**\n\t * Extracts headers from a PHP-style $_SERVER array.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $server Associative array similar to `$_SERVER`.\n\t * @return array Headers extracted from the input.\n\t */\n\tpublic function get_headers( $server ) {\n\t\t$headers = array();\n\n\t\t// CONTENT_* headers are not prefixed with HTTP_.\n\t\t$additional = array(\n\t\t\t'CONTENT_LENGTH' => true,\n\t\t\t'CONTENT_MD5'    => true,\n\t\t\t'CONTENT_TYPE'   => true,\n\t\t);\n\n\t\tforeach ( $server as $key => $value ) {\n\t\t\tif ( strpos( $key, 'HTTP_' ) === 0 ) {\n\t\t\t\t$headers[ substr( $key, 5 ) ] = $value;\n\t\t\t} elseif ( 'REDIRECT_HTTP_AUTHORIZATION' === $key && empty( $server['HTTP_AUTHORIZATION'] ) ) {\n\t\t\t\t/*\n\t\t\t\t * In some server configurations, the authorization header is passed in this alternate location.\n\t\t\t\t * Since it would not be passed in in both places we do not check for both headers and resolve.\n\t\t\t\t */\n\t\t\t\t$headers['AUTHORIZATION'] = $value;\n\t\t\t} elseif ( isset( $additional[ $key ] ) ) {\n\t\t\t\t$headers[ $key ] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $headers;\n\t}\n}\n", "num_lines": 1456}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Attachments_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.7.0\n */\n\n/**\n * Core controller used to access attachments via the REST API.\n *\n * @since 4.7.0\n *\n * @see WP_REST_Posts_Controller\n */\nclass WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {\n\n\t/**\n\t * Registers the routes for attachments.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @see register_rest_route()\n\t */\n\tpublic function register_routes() {\n\t\tparent::register_routes();\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base . '/(?P<id>[\\d]+)/post-process',\n\t\t\tarray(\n\t\t\t\t'methods'             => WP_REST_Server::CREATABLE,\n\t\t\t\t'callback'            => array( $this, 'post_process_item' ),\n\t\t\t\t'permission_callback' => array( $this, 'post_process_item_permissions_check' ),\n\t\t\t\t'args'                => array(\n\t\t\t\t\t'id'     => array(\n\t\t\t\t\t\t'description' => __( 'Unique identifier for the object.' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t),\n\t\t\t\t\t'action' => array(\n\t\t\t\t\t\t'type'     => 'string',\n\t\t\t\t\t\t'enum'     => array( 'create-image-subsizes' ),\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base . '/(?P<id>[\\d]+)/edit',\n\t\t\tarray(\n\t\t\t\t'methods'             => WP_REST_Server::CREATABLE,\n\t\t\t\t'callback'            => array( $this, 'edit_media_item' ),\n\t\t\t\t'permission_callback' => array( $this, 'edit_media_item_permissions_check' ),\n\t\t\t\t'args'                => $this->get_edit_media_item_args(),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Determines the allowed query_vars for a get_items() response and\n\t * prepares for WP_Query.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array           $prepared_args Optional. Array of prepared arguments. Default empty array.\n\t * @param WP_REST_Request $request       Optional. Request to prepare items for.\n\t * @return array Array of query arguments.\n\t */\n\tprotected function prepare_items_query( $prepared_args = array(), $request = null ) {\n\t\t$query_args = parent::prepare_items_query( $prepared_args, $request );\n\n\t\tif ( empty( $query_args['post_status'] ) ) {\n\t\t\t$query_args['post_status'] = 'inherit';\n\t\t}\n\n\t\t$media_types = $this->get_media_types();\n\n\t\tif ( ! empty( $request['media_type'] ) && isset( $media_types[ $request['media_type'] ] ) ) {\n\t\t\t$query_args['post_mime_type'] = $media_types[ $request['media_type'] ];\n\t\t}\n\n\t\tif ( ! empty( $request['mime_type'] ) ) {\n\t\t\t$parts = explode( '/', $request['mime_type'] );\n\t\t\tif ( isset( $media_types[ $parts[0] ] ) && in_array( $request['mime_type'], $media_types[ $parts[0] ], true ) ) {\n\t\t\t\t$query_args['post_mime_type'] = $request['mime_type'];\n\t\t\t}\n\t\t}\n\n\t\t// Filter query clauses to include filenames.\n\t\tif ( isset( $query_args['s'] ) ) {\n\t\t\tadd_filter( 'posts_clauses', '_filter_query_attachment_filenames' );\n\t\t}\n\n\t\treturn $query_args;\n\t}\n\n\t/**\n\t * Checks if a given request has access to create an attachment.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error Boolean true if the attachment may be created, or a WP_Error if not.\n\t */\n\tpublic function create_item_permissions_check( $request ) {\n\t\t$ret = parent::create_item_permissions_check( $request );\n\n\t\tif ( ! $ret || is_wp_error( $ret ) ) {\n\t\t\treturn $ret;\n\t\t}\n\n\t\tif ( ! current_user_can( 'upload_files' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_create',\n\t\t\t\t__( 'Sorry, you are not allowed to upload media on this site.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t// Attaching media to a post requires ability to edit said post.\n\t\tif ( ! empty( $request['post'] ) && ! current_user_can( 'edit_post', (int) $request['post'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_edit',\n\t\t\t\t__( 'Sorry, you are not allowed to upload media to this post.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Creates a single attachment.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, WP_Error object on failure.\n\t */\n\tpublic function create_item( $request ) {\n\t\tif ( ! empty( $request['post'] ) && in_array( get_post_type( $request['post'] ), array( 'revision', 'attachment' ), true ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_invalid_param',\n\t\t\t\t__( 'Invalid parent type.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t$insert = $this->insert_attachment( $request );\n\n\t\tif ( is_wp_error( $insert ) ) {\n\t\t\treturn $insert;\n\t\t}\n\n\t\t$schema = $this->get_item_schema();\n\n\t\t// Extract by name.\n\t\t$attachment_id = $insert['attachment_id'];\n\t\t$file          = $insert['file'];\n\n\t\tif ( isset( $request['alt_text'] ) ) {\n\t\t\tupdate_post_meta( $attachment_id, '_wp_attachment_image_alt', sanitize_text_field( $request['alt_text'] ) );\n\t\t}\n\n\t\tif ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) {\n\t\t\t$meta_update = $this->meta->update_value( $request['meta'], $attachment_id );\n\n\t\t\tif ( is_wp_error( $meta_update ) ) {\n\t\t\t\treturn $meta_update;\n\t\t\t}\n\t\t}\n\n\t\t$attachment    = get_post( $attachment_id );\n\t\t$fields_update = $this->update_additional_fields_for_object( $attachment, $request );\n\n\t\tif ( is_wp_error( $fields_update ) ) {\n\t\t\treturn $fields_update;\n\t\t}\n\n\t\t$request->set_param( 'context', 'edit' );\n\n\t\t/**\n\t\t * Fires after a single attachment is completely created or updated via the REST API.\n\t\t *\n\t\t * @since 5.0.0\n\t\t *\n\t\t * @param WP_Post         $attachment Inserted or updated attachment object.\n\t\t * @param WP_REST_Request $request    Request object.\n\t\t * @param bool            $creating   True when creating an attachment, false when updating.\n\t\t */\n\t\tdo_action( 'rest_after_insert_attachment', $attachment, $request, true );\n\n\t\tif ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {\n\t\t\t// Set a custom header with the attachment_id.\n\t\t\t// Used by the browser/client to resume creating image sub-sizes after a PHP fatal error.\n\t\t\theader( 'X-WP-Upload-Attachment-ID: ' . $attachment_id );\n\t\t}\n\n\t\t// Include media and image functions to get access to wp_generate_attachment_metadata().\n\t\trequire_once ABSPATH . 'wp-admin/includes/media.php';\n\t\trequire_once ABSPATH . 'wp-admin/includes/image.php';\n\n\t\t// Post-process the upload (create image sub-sizes, make PDF thumbnails, etc.) and insert attachment meta.\n\t\t// At this point the server may run out of resources and post-processing of uploaded images may fail.\n\t\twp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) );\n\n\t\t$response = $this->prepare_item_for_response( $attachment, $request );\n\t\t$response = rest_ensure_response( $response );\n\t\t$response->set_status( 201 );\n\t\t$response->header( 'Location', rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $attachment_id ) ) );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Inserts the attachment post in the database. Does not update the attachment meta.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param WP_REST_Request $request\n\t * @return array|WP_Error\n\t */\n\tprotected function insert_attachment( $request ) {\n\t\t// Get the file via $_FILES or raw data.\n\t\t$files   = $request->get_file_params();\n\t\t$headers = $request->get_headers();\n\n\t\tif ( ! empty( $files ) ) {\n\t\t\t$file = $this->upload_from_file( $files, $headers );\n\t\t} else {\n\t\t\t$file = $this->upload_from_data( $request->get_body(), $headers );\n\t\t}\n\n\t\tif ( is_wp_error( $file ) ) {\n\t\t\treturn $file;\n\t\t}\n\n\t\t$name       = wp_basename( $file['file'] );\n\t\t$name_parts = pathinfo( $name );\n\t\t$name       = trim( substr( $name, 0, -( 1 + strlen( $name_parts['extension'] ) ) ) );\n\n\t\t$url  = $file['url'];\n\t\t$type = $file['type'];\n\t\t$file = $file['file'];\n\n\t\t// Include image functions to get access to wp_read_image_metadata().\n\t\trequire_once ABSPATH . 'wp-admin/includes/image.php';\n\n\t\t// Use image exif/iptc data for title and caption defaults if possible.\n\t\t$image_meta = wp_read_image_metadata( $file );\n\n\t\tif ( ! empty( $image_meta ) ) {\n\t\t\tif ( empty( $request['title'] ) && trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {\n\t\t\t\t$request['title'] = $image_meta['title'];\n\t\t\t}\n\n\t\t\tif ( empty( $request['caption'] ) && trim( $image_meta['caption'] ) ) {\n\t\t\t\t$request['caption'] = $image_meta['caption'];\n\t\t\t}\n\t\t}\n\n\t\t$attachment = $this->prepare_item_for_database( $request );\n\n\t\t$attachment->post_mime_type = $type;\n\t\t$attachment->guid           = $url;\n\n\t\tif ( empty( $attachment->post_title ) ) {\n\t\t\t$attachment->post_title = preg_replace( '/\\.[^.]+$/', '', wp_basename( $file ) );\n\t\t}\n\n\t\t// $post_parent is inherited from $attachment['post_parent'].\n\t\t$id = wp_insert_attachment( wp_slash( (array) $attachment ), $file, 0, true );\n\n\t\tif ( is_wp_error( $id ) ) {\n\t\t\tif ( 'db_update_error' === $id->get_error_code() ) {\n\t\t\t\t$id->add_data( array( 'status' => 500 ) );\n\t\t\t} else {\n\t\t\t\t$id->add_data( array( 'status' => 400 ) );\n\t\t\t}\n\n\t\t\treturn $id;\n\t\t}\n\n\t\t$attachment = get_post( $id );\n\n\t\t/**\n\t\t * Fires after a single attachment is created or updated via the REST API.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_Post         $attachment Inserted or updated attachment\n\t\t *                                    object.\n\t\t * @param WP_REST_Request $request    The request sent to the API.\n\t\t * @param bool            $creating   True when creating an attachment, false when updating.\n\t\t */\n\t\tdo_action( 'rest_insert_attachment', $attachment, $request, true );\n\n\t\treturn array(\n\t\t\t'attachment_id' => $id,\n\t\t\t'file'          => $file,\n\t\t);\n\t}\n\n\t/**\n\t * Updates a single attachment.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, WP_Error object on failure.\n\t */\n\tpublic function update_item( $request ) {\n\t\tif ( ! empty( $request['post'] ) && in_array( get_post_type( $request['post'] ), array( 'revision', 'attachment' ), true ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_invalid_param',\n\t\t\t\t__( 'Invalid parent type.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t$response = parent::update_item( $request );\n\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\treturn $response;\n\t\t}\n\n\t\t$response = rest_ensure_response( $response );\n\t\t$data     = $response->get_data();\n\n\t\tif ( isset( $request['alt_text'] ) ) {\n\t\t\tupdate_post_meta( $data['id'], '_wp_attachment_image_alt', $request['alt_text'] );\n\t\t}\n\n\t\t$attachment = get_post( $request['id'] );\n\n\t\t$fields_update = $this->update_additional_fields_for_object( $attachment, $request );\n\n\t\tif ( is_wp_error( $fields_update ) ) {\n\t\t\treturn $fields_update;\n\t\t}\n\n\t\t$request->set_param( 'context', 'edit' );\n\n\t\t/** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php */\n\t\tdo_action( 'rest_after_insert_attachment', $attachment, $request, false );\n\n\t\t$response = $this->prepare_item_for_response( $attachment, $request );\n\t\t$response = rest_ensure_response( $response );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Performs post processing on an attachment.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, WP_Error object on failure.\n\t */\n\tpublic function post_process_item( $request ) {\n\t\tswitch ( $request['action'] ) {\n\t\t\tcase 'create-image-subsizes':\n\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/image.php';\n\t\t\t\twp_update_image_subsizes( $request['id'] );\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$request['context'] = 'edit';\n\n\t\treturn $this->prepare_item_for_response( get_post( $request['id'] ), $request );\n\t}\n\n\t/**\n\t * Checks if a given request can perform post processing on an attachment.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise.\n\t */\n\tpublic function post_process_item_permissions_check( $request ) {\n\t\treturn $this->update_item_permissions_check( $request );\n\t}\n\n\t/**\n\t * Checks if a given request has access to editing media.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access, WP_Error object otherwise.\n\t */\n\tpublic function edit_media_item_permissions_check( $request ) {\n\t\tif ( ! current_user_can( 'upload_files' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_edit_image',\n\t\t\t\t__( 'Sorry, you are not allowed to upload media on this site.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn $this->update_item_permissions_check( $request );\n\t}\n\n\t/**\n\t * Applies edits to a media item and creates a new attachment record.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, WP_Error object on failure.\n\t */\n\tpublic function edit_media_item( $request ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/image.php';\n\n\t\t$attachment_id = $request['id'];\n\n\t\t// This also confirms the attachment is an image.\n\t\t$image_file = wp_get_original_image_path( $attachment_id );\n\t\t$image_meta = wp_get_attachment_metadata( $attachment_id );\n\n\t\tif (\n\t\t\t! $image_meta ||\n\t\t\t! $image_file ||\n\t\t\t! wp_image_file_matches_image_meta( $request['src'], $image_meta, $attachment_id )\n\t\t) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_unknown_attachment',\n\t\t\t\t__( 'Unable to get meta information for file.' ),\n\t\t\t\tarray( 'status' => 404 )\n\t\t\t);\n\t\t}\n\n\t\t$supported_types = array( 'image/jpeg', 'image/png', 'image/gif' );\n\t\t$mime_type       = get_post_mime_type( $attachment_id );\n\t\tif ( ! in_array( $mime_type, $supported_types, true ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_edit_file_type',\n\t\t\t\t__( 'This type of file cannot be edited.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t// Check if we need to do anything.\n\t\t$rotate = 0;\n\t\t$crop   = false;\n\n\t\tif ( ! empty( $request['rotation'] ) ) {\n\t\t\t// Rotation direction: clockwise vs. counter clockwise.\n\t\t\t$rotate = 0 - (int) $request['rotation'];\n\t\t}\n\n\t\tif ( isset( $request['x'], $request['y'], $request['width'], $request['height'] ) ) {\n\t\t\t$crop = true;\n\t\t}\n\n\t\tif ( ! $rotate && ! $crop ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_image_not_edited',\n\t\t\t\t__( 'The image was not edited. Edit the image before applying the changes.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t/*\n\t\t * If the file doesn't exist, attempt a URL fopen on the src link.\n\t\t * This can occur with certain file replication plugins.\n\t\t * Keep the original file path to get a modified name later.\n\t\t */\n\t\t$image_file_to_edit = $image_file;\n\t\tif ( ! file_exists( $image_file_to_edit ) ) {\n\t\t\t$image_file_to_edit = _load_image_to_edit_path( $attachment_id );\n\t\t}\n\n\t\t$image_editor = wp_get_image_editor( $image_file_to_edit );\n\n\t\tif ( is_wp_error( $image_editor ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_unknown_image_file_type',\n\t\t\t\t__( 'Unable to edit this image.' ),\n\t\t\t\tarray( 'status' => 500 )\n\t\t\t);\n\t\t}\n\n\t\tif ( 0 !== $rotate ) {\n\t\t\t$result = $image_editor->rotate( $rotate );\n\n\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_image_rotation_failed',\n\t\t\t\t\t__( 'Unable to rotate this image.' ),\n\t\t\t\t\tarray( 'status' => 500 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( $crop ) {\n\t\t\t$size = $image_editor->get_size();\n\n\t\t\t$crop_x = round( ( $size['width'] * floatval( $request['x'] ) ) / 100.0 );\n\t\t\t$crop_y = round( ( $size['height'] * floatval( $request['y'] ) ) / 100.0 );\n\t\t\t$width  = round( ( $size['width'] * floatval( $request['width'] ) ) / 100.0 );\n\t\t\t$height = round( ( $size['height'] * floatval( $request['height'] ) ) / 100.0 );\n\n\t\t\t$result = $image_editor->crop( $crop_x, $crop_y, $width, $height );\n\n\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_image_crop_failed',\n\t\t\t\t\t__( 'Unable to crop this image.' ),\n\t\t\t\t\tarray( 'status' => 500 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Calculate the file name.\n\t\t$image_ext  = pathinfo( $image_file, PATHINFO_EXTENSION );\n\t\t$image_name = wp_basename( $image_file, \".{$image_ext}\" );\n\n\t\t// Do not append multiple `-edited` to the file name.\n\t\t// The user may be editing a previously edited image.\n\t\tif ( preg_match( '/-edited(-\\d+)?$/', $image_name ) ) {\n\t\t\t// Remove any `-1`, `-2`, etc. `wp_unique_filename()` will add the proper number.\n\t\t\t$image_name = preg_replace( '/-edited(-\\d+)?$/', '-edited', $image_name );\n\t\t} else {\n\t\t\t// Append `-edited` before the extension.\n\t\t\t$image_name .= '-edited';\n\t\t}\n\n\t\t$filename = \"{$image_name}.{$image_ext}\";\n\n\t\t// Create the uploads sub-directory if needed.\n\t\t$uploads = wp_upload_dir();\n\n\t\t// Make the file name unique in the (new) upload directory.\n\t\t$filename = wp_unique_filename( $uploads['path'], $filename );\n\n\t\t// Save to disk.\n\t\t$saved = $image_editor->save( $uploads['path'] . \"/$filename\" );\n\n\t\tif ( is_wp_error( $saved ) ) {\n\t\t\treturn $saved;\n\t\t}\n\n\t\t// Create new attachment post.\n\t\t$new_attachment_post = array(\n\t\t\t'post_mime_type' => $saved['mime-type'],\n\t\t\t'guid'           => $uploads['url'] . \"/$filename\",\n\t\t\t'post_title'     => $image_name,\n\t\t\t'post_content'   => '',\n\t\t);\n\n\t\t// Copy post_content, post_excerpt, and post_title from the edited image's attachment post.\n\t\t$attachment_post = get_post( $attachment_id );\n\n\t\tif ( $attachment_post ) {\n\t\t\t$new_attachment_post['post_content'] = $attachment_post->post_content;\n\t\t\t$new_attachment_post['post_excerpt'] = $attachment_post->post_excerpt;\n\t\t\t$new_attachment_post['post_title']   = $attachment_post->post_title;\n\t\t}\n\n\t\t$new_attachment_id = wp_insert_attachment( wp_slash( $new_attachment_post ), $saved['path'], 0, true );\n\n\t\tif ( is_wp_error( $new_attachment_id ) ) {\n\t\t\tif ( 'db_update_error' === $new_attachment_id->get_error_code() ) {\n\t\t\t\t$new_attachment_id->add_data( array( 'status' => 500 ) );\n\t\t\t} else {\n\t\t\t\t$new_attachment_id->add_data( array( 'status' => 400 ) );\n\t\t\t}\n\n\t\t\treturn $new_attachment_id;\n\t\t}\n\n\t\t// Copy the image alt text from the edited image.\n\t\t$image_alt = get_post_meta( $attachment_id, '_wp_attachment_image_alt', true );\n\n\t\tif ( ! empty( $image_alt ) ) {\n\t\t\t// update_post_meta() expects slashed.\n\t\t\tupdate_post_meta( $new_attachment_id, '_wp_attachment_image_alt', wp_slash( $image_alt ) );\n\t\t}\n\n\t\tif ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {\n\t\t\t// Set a custom header with the attachment_id.\n\t\t\t// Used by the browser/client to resume creating image sub-sizes after a PHP fatal error.\n\t\t\theader( 'X-WP-Upload-Attachment-ID: ' . $new_attachment_id );\n\t\t}\n\n\t\t// Generate image sub-sizes and meta.\n\t\t$new_image_meta = wp_generate_attachment_metadata( $new_attachment_id, $saved['path'] );\n\n\t\t// Copy the EXIF metadata from the original attachment if not generated for the edited image.\n\t\tif ( isset( $image_meta['image_meta'] ) && isset( $new_image_meta['image_meta'] ) && is_array( $new_image_meta['image_meta'] ) ) {\n\t\t\t// Merge but skip empty values.\n\t\t\tforeach ( (array) $image_meta['image_meta'] as $key => $value ) {\n\t\t\t\tif ( empty( $new_image_meta['image_meta'][ $key ] ) && ! empty( $value ) ) {\n\t\t\t\t\t$new_image_meta['image_meta'][ $key ] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Reset orientation. At this point the image is edited and orientation is correct.\n\t\tif ( ! empty( $new_image_meta['image_meta']['orientation'] ) ) {\n\t\t\t$new_image_meta['image_meta']['orientation'] = 1;\n\t\t}\n\n\t\t// The attachment_id may change if the site is exported and imported.\n\t\t$new_image_meta['parent_image'] = array(\n\t\t\t'attachment_id' => $attachment_id,\n\t\t\t// Path to the originally uploaded image file relative to the uploads directory.\n\t\t\t'file'          => _wp_relative_upload_path( $image_file ),\n\t\t);\n\n\t\t/**\n\t\t * Filters the meta data for the new image created by editing an existing image.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param array $new_image_meta    Meta data for the new image.\n\t\t * @param int   $new_attachment_id Attachment post ID for the new image.\n\t\t * @param int   $attachment_id     Attachment post ID for the edited (parent) image.\n\t\t */\n\t\t$new_image_meta = apply_filters( 'wp_edited_image_metadata', $new_image_meta, $new_attachment_id, $attachment_id );\n\n\t\twp_update_attachment_metadata( $new_attachment_id, $new_image_meta );\n\n\t\t$response = $this->prepare_item_for_response( get_post( $new_attachment_id ), $request );\n\t\t$response->set_status( 201 );\n\t\t$response->header( 'Location', rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $new_attachment_id ) ) );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Prepares a single attachment for create or update.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Request object.\n\t * @return stdClass|WP_Error Post object.\n\t */\n\tprotected function prepare_item_for_database( $request ) {\n\t\t$prepared_attachment = parent::prepare_item_for_database( $request );\n\n\t\t// Attachment caption (post_excerpt internally).\n\t\tif ( isset( $request['caption'] ) ) {\n\t\t\tif ( is_string( $request['caption'] ) ) {\n\t\t\t\t$prepared_attachment->post_excerpt = $request['caption'];\n\t\t\t} elseif ( isset( $request['caption']['raw'] ) ) {\n\t\t\t\t$prepared_attachment->post_excerpt = $request['caption']['raw'];\n\t\t\t}\n\t\t}\n\n\t\t// Attachment description (post_content internally).\n\t\tif ( isset( $request['description'] ) ) {\n\t\t\tif ( is_string( $request['description'] ) ) {\n\t\t\t\t$prepared_attachment->post_content = $request['description'];\n\t\t\t} elseif ( isset( $request['description']['raw'] ) ) {\n\t\t\t\t$prepared_attachment->post_content = $request['description']['raw'];\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $request['post'] ) ) {\n\t\t\t$prepared_attachment->post_parent = (int) $request['post'];\n\t\t}\n\n\t\treturn $prepared_attachment;\n\t}\n\n\t/**\n\t * Prepares a single attachment output for response.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Post         $post    Attachment object.\n\t * @param WP_REST_Request $request Request object.\n\t * @return WP_REST_Response Response object.\n\t */\n\tpublic function prepare_item_for_response( $post, $request ) {\n\t\t$response = parent::prepare_item_for_response( $post, $request );\n\t\t$fields   = $this->get_fields_for_response( $request );\n\t\t$data     = $response->get_data();\n\n\t\tif ( in_array( 'description', $fields, true ) ) {\n\t\t\t$data['description'] = array(\n\t\t\t\t'raw'      => $post->post_content,\n\t\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t\t'rendered' => apply_filters( 'the_content', $post->post_content ),\n\t\t\t);\n\t\t}\n\n\t\tif ( in_array( 'caption', $fields, true ) ) {\n\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t$caption = apply_filters( 'get_the_excerpt', $post->post_excerpt, $post );\n\n\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t$caption = apply_filters( 'the_excerpt', $caption );\n\n\t\t\t$data['caption'] = array(\n\t\t\t\t'raw'      => $post->post_excerpt,\n\t\t\t\t'rendered' => $caption,\n\t\t\t);\n\t\t}\n\n\t\tif ( in_array( 'alt_text', $fields, true ) ) {\n\t\t\t$data['alt_text'] = get_post_meta( $post->ID, '_wp_attachment_image_alt', true );\n\t\t}\n\n\t\tif ( in_array( 'media_type', $fields, true ) ) {\n\t\t\t$data['media_type'] = wp_attachment_is_image( $post->ID ) ? 'image' : 'file';\n\t\t}\n\n\t\tif ( in_array( 'mime_type', $fields, true ) ) {\n\t\t\t$data['mime_type'] = $post->post_mime_type;\n\t\t}\n\n\t\tif ( in_array( 'media_details', $fields, true ) ) {\n\t\t\t$data['media_details'] = wp_get_attachment_metadata( $post->ID );\n\n\t\t\t// Ensure empty details is an empty object.\n\t\t\tif ( empty( $data['media_details'] ) ) {\n\t\t\t\t$data['media_details'] = new stdClass;\n\t\t\t} elseif ( ! empty( $data['media_details']['sizes'] ) ) {\n\n\t\t\t\tforeach ( $data['media_details']['sizes'] as $size => &$size_data ) {\n\n\t\t\t\t\tif ( isset( $size_data['mime-type'] ) ) {\n\t\t\t\t\t\t$size_data['mime_type'] = $size_data['mime-type'];\n\t\t\t\t\t\tunset( $size_data['mime-type'] );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Use the same method image_downsize() does.\n\t\t\t\t\t$image_src = wp_get_attachment_image_src( $post->ID, $size );\n\t\t\t\t\tif ( ! $image_src ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$size_data['source_url'] = $image_src[0];\n\t\t\t\t}\n\n\t\t\t\t$full_src = wp_get_attachment_image_src( $post->ID, 'full' );\n\n\t\t\t\tif ( ! empty( $full_src ) ) {\n\t\t\t\t\t$data['media_details']['sizes']['full'] = array(\n\t\t\t\t\t\t'file'       => wp_basename( $full_src[0] ),\n\t\t\t\t\t\t'width'      => $full_src[1],\n\t\t\t\t\t\t'height'     => $full_src[2],\n\t\t\t\t\t\t'mime_type'  => $post->post_mime_type,\n\t\t\t\t\t\t'source_url' => $full_src[0],\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$data['media_details']['sizes'] = new stdClass;\n\t\t\t}\n\t\t}\n\n\t\tif ( in_array( 'post', $fields, true ) ) {\n\t\t\t$data['post'] = ! empty( $post->post_parent ) ? (int) $post->post_parent : null;\n\t\t}\n\n\t\tif ( in_array( 'source_url', $fields, true ) ) {\n\t\t\t$data['source_url'] = wp_get_attachment_url( $post->ID );\n\t\t}\n\n\t\tif ( in_array( 'missing_image_sizes', $fields, true ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/image.php';\n\t\t\t$data['missing_image_sizes'] = array_keys( wp_get_missing_image_subsizes( $post->ID ) );\n\t\t}\n\n\t\t$context = ! empty( $request['context'] ) ? $request['context'] : 'view';\n\n\t\t$data = $this->filter_response_by_context( $data, $context );\n\n\t\t$links = $response->get_links();\n\n\t\t// Wrap the data in a response object.\n\t\t$response = rest_ensure_response( $data );\n\n\t\tforeach ( $links as $rel => $rel_links ) {\n\t\t\tforeach ( $rel_links as $link ) {\n\t\t\t\t$response->add_link( $rel, $link['href'], $link['attributes'] );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters an attachment returned from the REST API.\n\t\t *\n\t\t * Allows modification of the attachment right before it is returned.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_REST_Response $response The response object.\n\t\t * @param WP_Post          $post     The original attachment post.\n\t\t * @param WP_REST_Request  $request  Request used to generate the response.\n\t\t */\n\t\treturn apply_filters( 'rest_prepare_attachment', $response, $post, $request );\n\t}\n\n\t/**\n\t * Retrieves the attachment's schema, conforming to JSON Schema.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Item schema as an array.\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$schema = parent::get_item_schema();\n\n\t\t$schema['properties']['alt_text'] = array(\n\t\t\t'description' => __( 'Alternative text to display when attachment is not displayed.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t'arg_options' => array(\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t),\n\t\t);\n\n\t\t$schema['properties']['caption'] = array(\n\t\t\t'description' => __( 'The attachment caption.' ),\n\t\t\t'type'        => 'object',\n\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t'arg_options' => array(\n\t\t\t\t'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database().\n\t\t\t\t'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database().\n\t\t\t),\n\t\t\t'properties'  => array(\n\t\t\t\t'raw'      => array(\n\t\t\t\t\t'description' => __( 'Caption for the attachment, as it exists in the database.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t),\n\t\t\t\t'rendered' => array(\n\t\t\t\t\t'description' => __( 'HTML caption for the attachment, transformed for display.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$schema['properties']['description'] = array(\n\t\t\t'description' => __( 'The attachment description.' ),\n\t\t\t'type'        => 'object',\n\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t'arg_options' => array(\n\t\t\t\t'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database().\n\t\t\t\t'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database().\n\t\t\t),\n\t\t\t'properties'  => array(\n\t\t\t\t'raw'      => array(\n\t\t\t\t\t'description' => __( 'Description for the object, as it exists in the database.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t),\n\t\t\t\t'rendered' => array(\n\t\t\t\t\t'description' => __( 'HTML description for the object, transformed for display.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$schema['properties']['media_type'] = array(\n\t\t\t'description' => __( 'Attachment type.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'enum'        => array( 'image', 'file' ),\n\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t'readonly'    => true,\n\t\t);\n\n\t\t$schema['properties']['mime_type'] = array(\n\t\t\t'description' => __( 'The attachment MIME type.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t'readonly'    => true,\n\t\t);\n\n\t\t$schema['properties']['media_details'] = array(\n\t\t\t'description' => __( 'Details about the media file, specific to its type.' ),\n\t\t\t'type'        => 'object',\n\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t'readonly'    => true,\n\t\t);\n\n\t\t$schema['properties']['post'] = array(\n\t\t\t'description' => __( 'The ID for the associated post of the attachment.' ),\n\t\t\t'type'        => 'integer',\n\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t);\n\n\t\t$schema['properties']['source_url'] = array(\n\t\t\t'description' => __( 'URL to the original attachment file.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'format'      => 'uri',\n\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t'readonly'    => true,\n\t\t);\n\n\t\t$schema['properties']['missing_image_sizes'] = array(\n\t\t\t'description' => __( 'List of the missing image sizes of the attachment.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array( 'type' => 'string' ),\n\t\t\t'context'     => array( 'edit' ),\n\t\t\t'readonly'    => true,\n\t\t);\n\n\t\tunset( $schema['properties']['password'] );\n\n\t\t$this->schema = $schema;\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}\n\n\t/**\n\t * Handles an upload via raw POST data.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $data    Supplied file data.\n\t * @param array $headers HTTP headers from the request.\n\t * @return array|WP_Error Data from wp_handle_sideload().\n\t */\n\tprotected function upload_from_data( $data, $headers ) {\n\t\tif ( empty( $data ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_upload_no_data',\n\t\t\t\t__( 'No data supplied.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\tif ( empty( $headers['content_type'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_upload_no_content_type',\n\t\t\t\t__( 'No Content-Type supplied.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\tif ( empty( $headers['content_disposition'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_upload_no_content_disposition',\n\t\t\t\t__( 'No Content-Disposition supplied.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t$filename = self::get_filename_from_disposition( $headers['content_disposition'] );\n\n\t\tif ( empty( $filename ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_upload_invalid_disposition',\n\t\t\t\t__( 'Invalid Content-Disposition supplied. Content-Disposition needs to be formatted as `attachment; filename=\"image.png\"` or similar.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $headers['content_md5'] ) ) {\n\t\t\t$content_md5 = array_shift( $headers['content_md5'] );\n\t\t\t$expected    = trim( $content_md5 );\n\t\t\t$actual      = md5( $data );\n\n\t\t\tif ( $expected !== $actual ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_upload_hash_mismatch',\n\t\t\t\t\t__( 'Content hash did not match expected.' ),\n\t\t\t\t\tarray( 'status' => 412 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Get the content-type.\n\t\t$type = array_shift( $headers['content_type'] );\n\n\t\t// Include filesystem functions to get access to wp_tempnam() and wp_handle_sideload().\n\t\trequire_once ABSPATH . 'wp-admin/includes/file.php';\n\n\t\t// Save the file.\n\t\t$tmpfname = wp_tempnam( $filename );\n\n\t\t$fp = fopen( $tmpfname, 'w+' );\n\n\t\tif ( ! $fp ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_upload_file_error',\n\t\t\t\t__( 'Could not open file handle.' ),\n\t\t\t\tarray( 'status' => 500 )\n\t\t\t);\n\t\t}\n\n\t\tfwrite( $fp, $data );\n\t\tfclose( $fp );\n\n\t\t// Now, sideload it in.\n\t\t$file_data = array(\n\t\t\t'error'    => null,\n\t\t\t'tmp_name' => $tmpfname,\n\t\t\t'name'     => $filename,\n\t\t\t'type'     => $type,\n\t\t);\n\n\t\t$size_check = self::check_upload_size( $file_data );\n\t\tif ( is_wp_error( $size_check ) ) {\n\t\t\treturn $size_check;\n\t\t}\n\n\t\t$overrides = array(\n\t\t\t'test_form' => false,\n\t\t);\n\n\t\t$sideloaded = wp_handle_sideload( $file_data, $overrides );\n\n\t\tif ( isset( $sideloaded['error'] ) ) {\n\t\t\t@unlink( $tmpfname );\n\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_upload_sideload_error',\n\t\t\t\t$sideloaded['error'],\n\t\t\t\tarray( 'status' => 500 )\n\t\t\t);\n\t\t}\n\n\t\treturn $sideloaded;\n\t}\n\n\t/**\n\t * Parses filename from a Content-Disposition header value.\n\t *\n\t * As per RFC6266:\n\t *\n\t *     content-disposition = \"Content-Disposition\" \":\"\n\t *                            disposition-type *( \";\" disposition-parm )\n\t *\n\t *     disposition-type    = \"inline\" | \"attachment\" | disp-ext-type\n\t *                         ; case-insensitive\n\t *     disp-ext-type       = token\n\t *\n\t *     disposition-parm    = filename-parm | disp-ext-parm\n\t *\n\t *     filename-parm       = \"filename\" \"=\" value\n\t *                         | \"filename*\" \"=\" ext-value\n\t *\n\t *     disp-ext-parm       = token \"=\" value\n\t *                         | ext-token \"=\" ext-value\n\t *     ext-token           = <the characters in token, followed by \"*\">\n\t *\n\t * @since 4.7.0\n\t *\n\t * @link https://tools.ietf.org/html/rfc2388\n\t * @link https://tools.ietf.org/html/rfc6266\n\t *\n\t * @param string[] $disposition_header List of Content-Disposition header values.\n\t * @return string|null Filename if available, or null if not found.\n\t */\n\tpublic static function get_filename_from_disposition( $disposition_header ) {\n\t\t// Get the filename.\n\t\t$filename = null;\n\n\t\tforeach ( $disposition_header as $value ) {\n\t\t\t$value = trim( $value );\n\n\t\t\tif ( strpos( $value, ';' ) === false ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlist( $type, $attr_parts ) = explode( ';', $value, 2 );\n\n\t\t\t$attr_parts = explode( ';', $attr_parts );\n\t\t\t$attributes = array();\n\n\t\t\tforeach ( $attr_parts as $part ) {\n\t\t\t\tif ( strpos( $part, '=' ) === false ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tlist( $key, $value ) = explode( '=', $part, 2 );\n\n\t\t\t\t$attributes[ trim( $key ) ] = trim( $value );\n\t\t\t}\n\n\t\t\tif ( empty( $attributes['filename'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$filename = trim( $attributes['filename'] );\n\n\t\t\t// Unquote quoted filename, but after trimming.\n\t\t\tif ( substr( $filename, 0, 1 ) === '\"' && substr( $filename, -1, 1 ) === '\"' ) {\n\t\t\t\t$filename = substr( $filename, 1, -1 );\n\t\t\t}\n\t\t}\n\n\t\treturn $filename;\n\t}\n\n\t/**\n\t * Retrieves the query params for collections of attachments.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Query parameters for the attachment collection as an array.\n\t */\n\tpublic function get_collection_params() {\n\t\t$params                            = parent::get_collection_params();\n\t\t$params['status']['default']       = 'inherit';\n\t\t$params['status']['items']['enum'] = array( 'inherit', 'private', 'trash' );\n\t\t$media_types                       = $this->get_media_types();\n\n\t\t$params['media_type'] = array(\n\t\t\t'default'     => null,\n\t\t\t'description' => __( 'Limit result set to attachments of a particular media type.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'enum'        => array_keys( $media_types ),\n\t\t);\n\n\t\t$params['mime_type'] = array(\n\t\t\t'default'     => null,\n\t\t\t'description' => __( 'Limit result set to attachments of a particular MIME type.' ),\n\t\t\t'type'        => 'string',\n\t\t);\n\n\t\treturn $params;\n\t}\n\n\t/**\n\t * Handles an upload via multipart/form-data ($_FILES).\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $files   Data from the `$_FILES` superglobal.\n\t * @param array $headers HTTP headers from the request.\n\t * @return array|WP_Error Data from wp_handle_upload().\n\t */\n\tprotected function upload_from_file( $files, $headers ) {\n\t\tif ( empty( $files ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_upload_no_data',\n\t\t\t\t__( 'No data supplied.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t// Verify hash, if given.\n\t\tif ( ! empty( $headers['content_md5'] ) ) {\n\t\t\t$content_md5 = array_shift( $headers['content_md5'] );\n\t\t\t$expected    = trim( $content_md5 );\n\t\t\t$actual      = md5_file( $files['file']['tmp_name'] );\n\n\t\t\tif ( $expected !== $actual ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_upload_hash_mismatch',\n\t\t\t\t\t__( 'Content hash did not match expected.' ),\n\t\t\t\t\tarray( 'status' => 412 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Pass off to WP to handle the actual upload.\n\t\t$overrides = array(\n\t\t\t'test_form' => false,\n\t\t);\n\n\t\t// Bypasses is_uploaded_file() when running unit tests.\n\t\tif ( defined( 'DIR_TESTDATA' ) && DIR_TESTDATA ) {\n\t\t\t$overrides['action'] = 'wp_handle_mock_upload';\n\t\t}\n\n\t\t$size_check = self::check_upload_size( $files['file'] );\n\t\tif ( is_wp_error( $size_check ) ) {\n\t\t\treturn $size_check;\n\t\t}\n\n\t\t// Include filesystem functions to get access to wp_handle_upload().\n\t\trequire_once ABSPATH . 'wp-admin/includes/file.php';\n\n\t\t$file = wp_handle_upload( $files['file'], $overrides );\n\n\t\tif ( isset( $file['error'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_upload_unknown_error',\n\t\t\t\t$file['error'],\n\t\t\t\tarray( 'status' => 500 )\n\t\t\t);\n\t\t}\n\n\t\treturn $file;\n\t}\n\n\t/**\n\t * Retrieves the supported media types.\n\t *\n\t * Media types are considered the MIME type category.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Array of supported media types.\n\t */\n\tprotected function get_media_types() {\n\t\t$media_types = array();\n\n\t\tforeach ( get_allowed_mime_types() as $mime_type ) {\n\t\t\t$parts = explode( '/', $mime_type );\n\n\t\t\tif ( ! isset( $media_types[ $parts[0] ] ) ) {\n\t\t\t\t$media_types[ $parts[0] ] = array();\n\t\t\t}\n\n\t\t\t$media_types[ $parts[0] ][] = $mime_type;\n\t\t}\n\n\t\treturn $media_types;\n\t}\n\n\t/**\n\t * Determine if uploaded file exceeds space quota on multisite.\n\t *\n\t * Replicates check_upload_size().\n\t *\n\t * @since 4.9.8\n\t *\n\t * @param array $file $_FILES array for a given file.\n\t * @return true|WP_Error True if can upload, error for errors.\n\t */\n\tprotected function check_upload_size( $file ) {\n\t\tif ( ! is_multisite() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( get_site_option( 'upload_space_check_disabled' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$space_left = get_upload_space_available();\n\n\t\t$file_size = filesize( $file['tmp_name'] );\n\n\t\tif ( $space_left < $file_size ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_upload_limited_space',\n\t\t\t\t/* translators: %s: Required disk space in kilobytes. */\n\t\t\t\tsprintf( __( 'Not enough space to upload. %s KB needed.' ), number_format( ( $file_size - $space_left ) / KB_IN_BYTES ) ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\tif ( $file_size > ( KB_IN_BYTES * get_site_option( 'fileupload_maxk', 1500 ) ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_upload_file_too_big',\n\t\t\t\t/* translators: %s: Maximum allowed file size in kilobytes. */\n\t\t\t\tsprintf( __( 'This file is too big. Files must be less than %s KB in size.' ), get_site_option( 'fileupload_maxk', 1500 ) ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t// Include multisite admin functions to get access to upload_is_user_over_quota().\n\t\trequire_once ABSPATH . 'wp-admin/includes/ms.php';\n\n\t\tif ( upload_is_user_over_quota( false ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_upload_user_quota_exceeded',\n\t\t\t\t__( 'You have used your space quota. Please delete files before uploading.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Gets the request args for the edit item route.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array\n\t */\n\tprotected function get_edit_media_item_args() {\n\t\treturn array(\n\t\t\t'rotation' => array(\n\t\t\t\t'description'      => __( 'The amount to rotate the image clockwise in degrees.' ),\n\t\t\t\t'type'             => 'integer',\n\t\t\t\t'minimum'          => 0,\n\t\t\t\t'exclusiveMinimum' => true,\n\t\t\t\t'maximum'          => 360,\n\t\t\t\t'exclusiveMaximum' => true,\n\t\t\t),\n\t\t\t'x'        => array(\n\t\t\t\t'description' => __( 'As a percentage of the image, the x position to start the crop from.' ),\n\t\t\t\t'type'        => 'number',\n\t\t\t\t'minimum'     => 0,\n\t\t\t\t'maximum'     => 100,\n\t\t\t),\n\t\t\t'y'        => array(\n\t\t\t\t'description' => __( 'As a percentage of the image, the y position to start the crop from.' ),\n\t\t\t\t'type'        => 'number',\n\t\t\t\t'minimum'     => 0,\n\t\t\t\t'maximum'     => 100,\n\t\t\t),\n\t\t\t'width'    => array(\n\t\t\t\t'description' => __( 'As a percentage of the image, the width to crop the image to.' ),\n\t\t\t\t'type'        => 'number',\n\t\t\t\t'minimum'     => 0,\n\t\t\t\t'maximum'     => 100,\n\t\t\t),\n\t\t\t'height'   => array(\n\t\t\t\t'description' => __( 'As a percentage of the image, the height to crop the image to.' ),\n\t\t\t\t'type'        => 'number',\n\t\t\t\t'minimum'     => 0,\n\t\t\t\t'maximum'     => 100,\n\t\t\t),\n\t\t\t'src'      => array(\n\t\t\t\t'description' => __( 'URL to the edited image file.' ),\n\t\t\t\t'type'        => 'string',\n\t\t\t\t'format'      => 'uri',\n\t\t\t\t'required'    => true,\n\t\t\t),\n\t\t);\n\t}\n\n}\n", "num_lines": 1326}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Autosaves_Controller class.\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 5.0.0\n */\n\n/**\n * Core class used to access autosaves via the REST API.\n *\n * @since 5.0.0\n *\n * @see WP_REST_Revisions_Controller\n * @see WP_REST_Controller\n */\nclass WP_REST_Autosaves_Controller extends WP_REST_Revisions_Controller {\n\n\t/**\n\t * Parent post type.\n\t *\n\t * @since 5.0.0\n\t * @var string\n\t */\n\tprivate $parent_post_type;\n\n\t/**\n\t * Parent post controller.\n\t *\n\t * @since 5.0.0\n\t * @var WP_REST_Controller\n\t */\n\tprivate $parent_controller;\n\n\t/**\n\t * Revision controller.\n\t *\n\t * @since 5.0.0\n\t * @var WP_REST_Controller\n\t */\n\tprivate $revisions_controller;\n\n\t/**\n\t * The base of the parent controller's route.\n\t *\n\t * @since 5.0.0\n\t * @var string\n\t */\n\tprivate $parent_base;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param string $parent_post_type Post type of the parent.\n\t */\n\tpublic function __construct( $parent_post_type ) {\n\t\t$this->parent_post_type = $parent_post_type;\n\t\t$post_type_object       = get_post_type_object( $parent_post_type );\n\t\t$parent_controller      = $post_type_object->get_rest_controller();\n\n\t\tif ( ! $parent_controller ) {\n\t\t\t$parent_controller = new WP_REST_Posts_Controller( $parent_post_type );\n\t\t}\n\n\t\t$this->parent_controller    = $parent_controller;\n\t\t$this->revisions_controller = new WP_REST_Revisions_Controller( $parent_post_type );\n\t\t$this->rest_namespace       = 'wp/v2';\n\t\t$this->rest_base            = 'autosaves';\n\t\t$this->parent_base          = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name;\n\t}\n\n\t/**\n\t * Registers the routes for autosaves.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @see register_rest_route()\n\t */\n\tpublic function register_routes() {\n\t\tregister_rest_route(\n\t\t\t$this->rest_namespace,\n\t\t\t'/' . $this->parent_base . '/(?P<id>[\\d]+)/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\t'args'   => array(\n\t\t\t\t\t'parent' => array(\n\t\t\t\t\t\t'description' => __( 'The ID for the parent of the object.' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_items' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::CREATABLE,\n\t\t\t\t\t'callback'            => array( $this, 'create_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'create_item_permissions_check' ),\n\t\t\t\t\t'args'                => $this->parent_controller->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t\tregister_rest_route(\n\t\t\t$this->rest_namespace,\n\t\t\t'/' . $this->parent_base . '/(?P<parent>[\\d]+)/' . $this->rest_base . '/(?P<id>[\\d]+)',\n\t\t\tarray(\n\t\t\t\t'args'   => array(\n\t\t\t\t\t'parent' => array(\n\t\t\t\t\t\t'description' => __( 'The ID for the parent of the object.' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t),\n\t\t\t\t\t'id'     => array(\n\t\t\t\t\t\t'description' => __( 'The ID for the object.' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_item' ),\n\t\t\t\t\t'permission_callback' => array( $this->revisions_controller, 'get_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t}\n\n\t/**\n\t * Get the parent post.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param int $parent_id Supplied ID.\n\t * @return WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise.\n\t */\n\tprotected function get_parent( $parent_id ) {\n\t\treturn $this->revisions_controller->get_parent( $parent_id );\n\t}\n\n\t/**\n\t * Checks if a given request has access to get autosaves.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access, WP_Error object otherwise.\n\t */\n\tpublic function get_items_permissions_check( $request ) {\n\t\t$parent = $this->get_parent( $request['id'] );\n\t\tif ( is_wp_error( $parent ) ) {\n\t\t\treturn $parent;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $parent->ID ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_read',\n\t\t\t\t__( 'Sorry, you are not allowed to view autosaves of this post.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks if a given request has access to create an autosave revision.\n\t *\n\t * Autosave revisions inherit permissions from the parent post,\n\t * check if the current user has permission to edit the post.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to create the item, WP_Error object otherwise.\n\t */\n\tpublic function create_item_permissions_check( $request ) {\n\t\t$id = $request->get_param( 'id' );\n\n\t\tif ( empty( $id ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_post_invalid_id',\n\t\t\t\t__( 'Invalid item ID.' ),\n\t\t\t\tarray( 'status' => 404 )\n\t\t\t);\n\t\t}\n\n\t\treturn $this->parent_controller->update_item_permissions_check( $request );\n\t}\n\n\t/**\n\t * Creates, updates or deletes an autosave revision.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function create_item( $request ) {\n\n\t\tif ( ! defined( 'DOING_AUTOSAVE' ) ) {\n\t\t\tdefine( 'DOING_AUTOSAVE', true );\n\t\t}\n\n\t\t$post = get_post( $request['id'] );\n\n\t\tif ( is_wp_error( $post ) ) {\n\t\t\treturn $post;\n\t\t}\n\n\t\t$prepared_post     = $this->parent_controller->prepare_item_for_database( $request );\n\t\t$prepared_post->ID = $post->ID;\n\t\t$user_id           = get_current_user_id();\n\n\t\tif ( ( 'draft' === $post->post_status || 'auto-draft' === $post->post_status ) && $post->post_author == $user_id ) {\n\t\t\t// Draft posts for the same author: autosaving updates the post and does not create a revision.\n\t\t\t// Convert the post object to an array and add slashes, wp_update_post() expects escaped array.\n\t\t\t$autosave_id = wp_update_post( wp_slash( (array) $prepared_post ), true );\n\t\t} else {\n\t\t\t// Non-draft posts: create or update the post autosave.\n\t\t\t$autosave_id = $this->create_post_autosave( (array) $prepared_post );\n\t\t}\n\n\t\tif ( is_wp_error( $autosave_id ) ) {\n\t\t\treturn $autosave_id;\n\t\t}\n\n\t\t$autosave = get_post( $autosave_id );\n\t\t$request->set_param( 'context', 'edit' );\n\n\t\t$response = $this->prepare_item_for_response( $autosave, $request );\n\t\t$response = rest_ensure_response( $response );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Get the autosave, if the ID is valid.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_Post|WP_Error Revision post object if ID is valid, WP_Error otherwise.\n\t */\n\tpublic function get_item( $request ) {\n\t\t$parent_id = (int) $request->get_param( 'parent' );\n\n\t\tif ( $parent_id <= 0 ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_post_invalid_id',\n\t\t\t\t__( 'Invalid post parent ID.' ),\n\t\t\t\tarray( 'status' => 404 )\n\t\t\t);\n\t\t}\n\n\t\t$autosave = wp_get_post_autosave( $parent_id );\n\n\t\tif ( ! $autosave ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_post_no_autosave',\n\t\t\t\t__( 'There is no autosave revision for this post.' ),\n\t\t\t\tarray( 'status' => 404 )\n\t\t\t);\n\t\t}\n\n\t\t$response = $this->prepare_item_for_response( $autosave, $request );\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Gets a collection of autosaves using wp_get_post_autosave.\n\t *\n\t * Contains the user's autosave, for empty if it doesn't exist.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_items( $request ) {\n\t\t$parent = $this->get_parent( $request['id'] );\n\t\tif ( is_wp_error( $parent ) ) {\n\t\t\treturn $parent;\n\t\t}\n\n\t\t$response  = array();\n\t\t$parent_id = $parent->ID;\n\t\t$revisions = wp_get_post_revisions( $parent_id, array( 'check_enabled' => false ) );\n\n\t\tforeach ( $revisions as $revision ) {\n\t\t\tif ( false !== strpos( $revision->post_name, \"{$parent_id}-autosave\" ) ) {\n\t\t\t\t$data       = $this->prepare_item_for_response( $revision, $request );\n\t\t\t\t$response[] = $this->prepare_response_for_collection( $data );\n\t\t\t}\n\t\t}\n\n\t\treturn rest_ensure_response( $response );\n\t}\n\n\n\t/**\n\t * Retrieves the autosave's schema, conforming to JSON Schema.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$schema = $this->revisions_controller->get_item_schema();\n\n\t\t$schema['properties']['preview_link'] = array(\n\t\t\t'description' => __( 'Preview link for the post.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'format'      => 'uri',\n\t\t\t'context'     => array( 'edit' ),\n\t\t\t'readonly'    => true,\n\t\t);\n\n\t\t$this->schema = $schema;\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}\n\n\t/**\n\t * Creates autosave for the specified post.\n\t *\n\t * From wp-admin/post.php.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param array $post_data Associative array containing the post data.\n\t * @return mixed The autosave revision ID or WP_Error.\n\t */\n\tpublic function create_post_autosave( $post_data ) {\n\n\t\t$post_id = (int) $post_data['ID'];\n\t\t$post    = get_post( $post_id );\n\n\t\tif ( is_wp_error( $post ) ) {\n\t\t\treturn $post;\n\t\t}\n\n\t\t$user_id = get_current_user_id();\n\n\t\t// Store one autosave per author. If there is already an autosave, overwrite it.\n\t\t$old_autosave = wp_get_post_autosave( $post_id, $user_id );\n\n\t\tif ( $old_autosave ) {\n\t\t\t$new_autosave                = _wp_post_revision_data( $post_data, true );\n\t\t\t$new_autosave['ID']          = $old_autosave->ID;\n\t\t\t$new_autosave['post_author'] = $user_id;\n\n\t\t\t// If the new autosave has the same content as the post, delete the autosave.\n\t\t\t$autosave_is_different = false;\n\n\t\t\tforeach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields( $post ) ) ) as $field ) {\n\t\t\t\tif ( normalize_whitespace( $new_autosave[ $field ] ) !== normalize_whitespace( $post->$field ) ) {\n\t\t\t\t\t$autosave_is_different = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! $autosave_is_different ) {\n\t\t\t\twp_delete_post_revision( $old_autosave->ID );\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_autosave_no_changes',\n\t\t\t\t\t__( 'There is nothing to save. The autosave and the post content are the same.' ),\n\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/** This filter is documented in wp-admin/post.php */\n\t\t\tdo_action( 'wp_creating_autosave', $new_autosave );\n\n\t\t\t// wp_update_post() expects escaped array.\n\t\t\treturn wp_update_post( wp_slash( $new_autosave ) );\n\t\t}\n\n\t\t// Create the new autosave as a special post revision.\n\t\treturn _wp_put_post_revision( $post_data, true );\n\t}\n\n\t/**\n\t * Prepares the revision for the REST response.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_Post         $post    Post revision object.\n\t * @param WP_REST_Request $request Request object.\n\t * @return WP_REST_Response Response object.\n\t */\n\tpublic function prepare_item_for_response( $post, $request ) {\n\n\t\t$response = $this->revisions_controller->prepare_item_for_response( $post, $request );\n\n\t\t$fields = $this->get_fields_for_response( $request );\n\n\t\tif ( in_array( 'preview_link', $fields, true ) ) {\n\t\t\t$parent_id          = wp_is_post_autosave( $post );\n\t\t\t$preview_post_id    = false === $parent_id ? $post->ID : $parent_id;\n\t\t\t$preview_query_args = array();\n\n\t\t\tif ( false !== $parent_id ) {\n\t\t\t\t$preview_query_args['preview_id']    = $parent_id;\n\t\t\t\t$preview_query_args['preview_nonce'] = wp_create_nonce( 'post_preview_' . $parent_id );\n\t\t\t}\n\n\t\t\t$response->data['preview_link'] = get_preview_post_link( $preview_post_id, $preview_query_args );\n\t\t}\n\n\t\t$context        = ! empty( $request['context'] ) ? $request['context'] : 'view';\n\t\t$response->data = $this->add_additional_fields_to_object( $response->data, $request );\n\t\t$response->data = $this->filter_response_by_context( $response->data, $context );\n\n\t\t/**\n\t\t * Filters a revision returned from the API.\n\t\t *\n\t\t * Allows modification of the revision right before it is returned.\n\t\t *\n\t\t * @since 5.0.0\n\t\t *\n\t\t * @param WP_REST_Response $response The response object.\n\t\t * @param WP_Post          $post     The original revision object.\n\t\t * @param WP_REST_Request  $request  Request used to generate the response.\n\t\t */\n\t\treturn apply_filters( 'rest_prepare_autosave', $response, $post, $request );\n\t}\n\n\t/**\n\t * Retrieves the query params for the autosaves collection.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @return array Collection parameters.\n\t */\n\tpublic function get_collection_params() {\n\t\treturn array(\n\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t);\n\t}\n}\n", "num_lines": 454}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Block_Directory_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 5.5.0\n */\n\n/**\n * Controller which provides REST endpoint for the blocks.\n *\n * @since 5.5.0\n *\n * @see WP_REST_Controller\n */\nclass WP_REST_Block_Directory_Controller extends WP_REST_Controller {\n\n\t/**\n\t * Constructs the controller.\n\t */\n\tpublic function __construct() {\n\t\t$this->namespace = 'wp/v2';\n\t\t$this->rest_base = 'block-directory';\n\t}\n\n\t/**\n\t * Registers the necessary REST API routes.\n\t */\n\tpublic function register_routes() {\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base . '/search',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_items' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether a given request has permission to install and activate plugins.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t *\n\t * @return WP_Error|bool True if the request has permission, WP_Error object otherwise.\n\t */\n\tpublic function get_items_permissions_check( $request ) {\n\t\tif ( ! current_user_can( 'install_plugins' ) || ! current_user_can( 'activate_plugins' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_block_directory_cannot_view',\n\t\t\t\t__( 'Sorry, you are not allowed to browse the block directory.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Search and retrieve blocks metadata\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t *\n\t * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_items( $request ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/plugin-install.php';\n\t\trequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\n\t\t$response = plugins_api(\n\t\t\t'query_plugins',\n\t\t\tarray(\n\t\t\t\t'block'    => $request['term'],\n\t\t\t\t'per_page' => $request['per_page'],\n\t\t\t\t'page'     => $request['page'],\n\t\t\t)\n\t\t);\n\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\t$response->add_data( array( 'status' => 500 ) );\n\n\t\t\treturn $response;\n\t\t}\n\n\t\t$result = array();\n\n\t\tforeach ( $response->plugins as $plugin ) {\n\t\t\t// If the API returned a plugin with empty data for 'blocks', skip it.\n\t\t\tif ( empty( $plugin['blocks'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$data     = $this->prepare_item_for_response( $plugin, $request );\n\t\t\t$result[] = $this->prepare_response_for_collection( $data );\n\t\t}\n\n\t\treturn rest_ensure_response( $result );\n\t}\n\n\t/**\n\t * Parse block metadata for a block, and prepare it for an API repsonse.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param array           $plugin  The plugin metadata.\n\t * @param WP_REST_Request $request Request object.\n\t *\n\t * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function prepare_item_for_response( $plugin, $request ) {\n\t\t// There might be multiple blocks in a plugin. Only the first block is mapped.\n\t\t$block_data = reset( $plugin['blocks'] );\n\n\t\t// A data array containing the properties we'll return.\n\t\t$block = array(\n\t\t\t'name'                => $block_data['name'],\n\t\t\t'title'               => ( $block_data['title'] ? $block_data['title'] : $plugin['name'] ),\n\t\t\t'description'         => wp_trim_words( $plugin['description'], 30, '...' ),\n\t\t\t'id'                  => $plugin['slug'],\n\t\t\t'rating'              => $plugin['rating'] / 20,\n\t\t\t'rating_count'        => intval( $plugin['num_ratings'] ),\n\t\t\t'active_installs'     => intval( $plugin['active_installs'] ),\n\t\t\t'author_block_rating' => $plugin['author_block_rating'] / 20,\n\t\t\t'author_block_count'  => intval( $plugin['author_block_count'] ),\n\t\t\t'author'              => wp_strip_all_tags( $plugin['author'] ),\n\t\t\t'icon'                => ( isset( $plugin['icons']['1x'] ) ? $plugin['icons']['1x'] : 'block-default' ),\n\t\t\t'last_updated'        => gmdate( 'Y-m-d\\TH:i:s', strtotime( $plugin['last_updated'] ) ),\n\t\t\t'humanized_updated'   => sprintf(\n\t\t\t\t/* translators: %s: Human-readable time difference. */\n\t\t\t\t__( '%s ago' ),\n\t\t\t\thuman_time_diff( strtotime( $plugin['last_updated'] ) )\n\t\t\t),\n\t\t);\n\n\t\t$this->add_additional_fields_to_object( $block, $request );\n\n\t\t$response = new WP_REST_Response( $block );\n\t\t$response->add_links( $this->prepare_links( $plugin ) );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Generates a list of links to include in the response for the plugin.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param array $plugin The plugin data from WordPress.org.\n\t *\n\t * @return array\n\t */\n\tprotected function prepare_links( $plugin ) {\n\t\t$links = array(\n\t\t\t'https://api.w.org/install-plugin' => array(\n\t\t\t\t'href' => add_query_arg( 'slug', urlencode( $plugin['slug'] ), rest_url( 'wp/v2/plugins' ) ),\n\t\t\t),\n\t\t);\n\n\t\t$plugin_file = $this->find_plugin_for_slug( $plugin['slug'] );\n\n\t\tif ( $plugin_file ) {\n\t\t\t$links['https://api.w.org/plugin'] = array(\n\t\t\t\t'href'       => rest_url( 'wp/v2/plugins/' . substr( $plugin_file, 0, - 4 ) ),\n\t\t\t\t'embeddable' => true,\n\t\t\t);\n\t\t}\n\n\t\treturn $links;\n\t}\n\n\t/**\n\t * Finds an installed plugin for the given slug.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $slug The WordPress.org directory slug for a plugin.\n\t *\n\t * @return string The plugin file found matching it.\n\t */\n\tprotected function find_plugin_for_slug( $slug ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\n\t\t$plugin_files = get_plugins( '/' . $slug );\n\n\t\tif ( ! $plugin_files ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$plugin_files = array_keys( $plugin_files );\n\n\t\treturn $slug . '/' . reset( $plugin_files );\n\t}\n\n\t/**\n\t * Retrieves the theme's schema, conforming to JSON Schema.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$this->schema = array(\n\t\t\t'$schema'    => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title'      => 'block-directory-item',\n\t\t\t'type'       => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'name'                => array(\n\t\t\t\t\t'description' => __( 'The block name, in namespace/block-name format.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view' ),\n\t\t\t\t),\n\t\t\t\t'title'               => array(\n\t\t\t\t\t'description' => __( 'The block title, in human readable format.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view' ),\n\t\t\t\t),\n\t\t\t\t'description'         => array(\n\t\t\t\t\t'description' => __( 'A short description of the block, in human readable format.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view' ),\n\t\t\t\t),\n\t\t\t\t'id'                  => array(\n\t\t\t\t\t'description' => __( 'The block slug.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view' ),\n\t\t\t\t),\n\t\t\t\t'rating'              => array(\n\t\t\t\t\t'description' => __( 'The star rating of the block.' ),\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'context'     => array( 'view' ),\n\t\t\t\t),\n\t\t\t\t'rating_count'        => array(\n\t\t\t\t\t'description' => __( 'The number of ratings.' ),\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'context'     => array( 'view' ),\n\t\t\t\t),\n\t\t\t\t'active_installs'     => array(\n\t\t\t\t\t'description' => __( 'The number sites that have activated this block.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view' ),\n\t\t\t\t),\n\t\t\t\t'author_block_rating' => array(\n\t\t\t\t\t'description' => __( 'The average rating of blocks published by the same author.' ),\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'context'     => array( 'view' ),\n\t\t\t\t),\n\t\t\t\t'author_block_count'  => array(\n\t\t\t\t\t'description' => __( 'The number of blocks published by the same author.' ),\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'context'     => array( 'view' ),\n\t\t\t\t),\n\t\t\t\t'author'              => array(\n\t\t\t\t\t'description' => __( 'The WordPress.org username of the block author.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view' ),\n\t\t\t\t),\n\t\t\t\t'icon'                => array(\n\t\t\t\t\t'description' => __( 'The block icon.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t'context'     => array( 'view' ),\n\t\t\t\t),\n\t\t\t\t'last_updated'        => array(\n\t\t\t\t\t'description' => __( 'The date when the block was last updated, in fuzzy human readable format.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'date-time',\n\t\t\t\t\t'context'     => array( 'view' ),\n\t\t\t\t),\n\t\t\t\t'humanized_updated'   => array(\n\t\t\t\t\t'description' => __( 'The date when the block was last updated, in fuzzy human readable format.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}\n\n\t/**\n\t * Retrieves the search params for the blocks collection.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array Collection parameters.\n\t */\n\tpublic function get_collection_params() {\n\t\t$query_params = parent::get_collection_params();\n\n\t\t$query_params['context']['default'] = 'view';\n\n\t\t$query_params['term'] = array(\n\t\t\t'description' => __( 'Limit result set to blocks matching the search term.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'required'    => true,\n\t\t\t'minLength'   => 1,\n\t\t);\n\n\t\tunset( $query_params['search'] );\n\n\t\t/**\n\t\t * Filter collection parameters for the block directory controller.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param array $query_params JSON Schema-formatted collection parameters.\n\t\t */\n\t\treturn apply_filters( 'rest_block_directory_collection_params', $query_params );\n\t}\n}\n", "num_lines": 325}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Block Renderer REST API: WP_REST_Block_Renderer_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 5.0.0\n */\n\n/**\n * Controller which provides REST endpoint for rendering a block.\n *\n * @since 5.0.0\n *\n * @see WP_REST_Controller\n */\nclass WP_REST_Block_Renderer_Controller extends WP_REST_Controller {\n\n\t/**\n\t * Constructs the controller.\n\t *\n\t * @since 5.0.0\n\t */\n\tpublic function __construct() {\n\t\t$this->namespace = 'wp/v2';\n\t\t$this->rest_base = 'block-renderer';\n\t}\n\n\t/**\n\t * Registers the necessary REST API routes, one for each dynamic block.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @see register_rest_route()\n\t */\n\tpublic function register_routes() {\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base . '/(?P<name>[a-z0-9-]+/[a-z0-9-]+)',\n\t\t\tarray(\n\t\t\t\t'args'   => array(\n\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t'description' => __( 'Unique registered name for the block.' ),\n\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => array( WP_REST_Server::READABLE, WP_REST_Server::CREATABLE ),\n\t\t\t\t\t'callback'            => array( $this, 'get_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'context'    => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t\t\t\t'attributes' => array(\n\t\t\t\t\t\t\t'description'       => __( 'Attributes for the block' ),\n\t\t\t\t\t\t\t'type'              => 'object',\n\t\t\t\t\t\t\t'default'           => array(),\n\t\t\t\t\t\t\t'validate_callback' => static function ( $value, $request ) {\n\t\t\t\t\t\t\t\t$block = WP_Block_Type_Registry::get_instance()->get_registered( $request['name'] );\n\n\t\t\t\t\t\t\t\tif ( ! $block ) {\n\t\t\t\t\t\t\t\t\t// This will get rejected in ::get_item().\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$schema = array(\n\t\t\t\t\t\t\t\t\t'type'                 => 'object',\n\t\t\t\t\t\t\t\t\t'properties'           => $block->get_attributes(),\n\t\t\t\t\t\t\t\t\t'additionalProperties' => false,\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\treturn rest_validate_value_from_schema( $value, $schema );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t'sanitize_callback' => static function ( $value, $request ) {\n\t\t\t\t\t\t\t\t$block = WP_Block_Type_Registry::get_instance()->get_registered( $request['name'] );\n\n\t\t\t\t\t\t\t\tif ( ! $block ) {\n\t\t\t\t\t\t\t\t\t// This will get rejected in ::get_item().\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$schema = array(\n\t\t\t\t\t\t\t\t\t'type'                 => 'object',\n\t\t\t\t\t\t\t\t\t'properties'           => $block->get_attributes(),\n\t\t\t\t\t\t\t\t\t'additionalProperties' => false,\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\treturn rest_sanitize_value_from_schema( $value, $schema );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'post_id'    => array(\n\t\t\t\t\t\t\t'description' => __( 'ID of the post context.' ),\n\t\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Checks if a given request has access to read blocks.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_REST_Request $request Request.\n\t * @return true|WP_Error True if the request has read access, WP_Error object otherwise.\n\t */\n\tpublic function get_item_permissions_check( $request ) {\n\t\tglobal $post;\n\n\t\t$post_id = isset( $request['post_id'] ) ? intval( $request['post_id'] ) : 0;\n\n\t\tif ( 0 < $post_id ) {\n\t\t\t$post = get_post( $post_id );\n\n\t\t\tif ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'block_cannot_read',\n\t\t\t\t\t__( 'Sorry, you are not allowed to read blocks of this post.' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'status' => rest_authorization_required_code(),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'block_cannot_read',\n\t\t\t\t\t__( 'Sorry, you are not allowed to read blocks as this user.' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'status' => rest_authorization_required_code(),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Returns block output from block's registered render_callback.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_item( $request ) {\n\t\tglobal $post;\n\n\t\t$post_id = isset( $request['post_id'] ) ? intval( $request['post_id'] ) : 0;\n\n\t\tif ( 0 < $post_id ) {\n\t\t\t$post = get_post( $post_id );\n\n\t\t\t// Set up postdata since this will be needed if post_id was set.\n\t\t\tsetup_postdata( $post );\n\t\t}\n\n\t\t$registry   = WP_Block_Type_Registry::get_instance();\n\t\t$registered = $registry->get_registered( $request['name'] );\n\n\t\tif ( null === $registered || ! $registered->is_dynamic() ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'block_invalid',\n\t\t\t\t__( 'Invalid block.' ),\n\t\t\t\tarray(\n\t\t\t\t\t'status' => 404,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$attributes = $request->get_param( 'attributes' );\n\n\t\t// Create an array representation simulating the output of parse_blocks.\n\t\t$block = array(\n\t\t\t'blockName'    => $request['name'],\n\t\t\t'attrs'        => $attributes,\n\t\t\t'innerHTML'    => '',\n\t\t\t'innerContent' => array(),\n\t\t);\n\n\t\t// Render using render_block to ensure all relevant filters are used.\n\t\t$data = array(\n\t\t\t'rendered' => render_block( $block ),\n\t\t);\n\n\t\treturn rest_ensure_response( $data );\n\t}\n\n\t/**\n\t * Retrieves block's output schema, conforming to JSON Schema.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->schema;\n\t\t}\n\n\t\t$this->schema = array(\n\t\t\t'$schema'    => 'http://json-schema.org/schema#',\n\t\t\t'title'      => 'rendered-block',\n\t\t\t'type'       => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'rendered' => array(\n\t\t\t\t\t'description' => __( 'The rendered block.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'required'    => true,\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $this->schema;\n\t}\n}\n", "num_lines": 221}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Block_Types_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 5.5.0\n */\n\n/**\n * Core class used to access block types via the REST API.\n *\n * @since 5.5.0\n *\n * @see WP_REST_Controller\n */\nclass WP_REST_Block_Types_Controller extends WP_REST_Controller {\n\n\t/**\n\t * Instance of WP_Block_Type_Registry.\n\t *\n\t * @since 5.5.0\n\t * @var WP_Block_Type_Registry\n\t */\n\tprotected $block_registry;\n\n\t/**\n\t * Instance of WP_Block_Styles_Registry.\n\t *\n\t * @since 5.5.0\n\t * @var WP_Block_Styles_Registry\n\t */\n\tprotected $style_registry;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 5.5.0\n\t */\n\tpublic function __construct() {\n\t\t$this->namespace      = 'wp/v2';\n\t\t$this->rest_base      = 'block-types';\n\t\t$this->block_registry = WP_Block_Type_Registry::get_instance();\n\t\t$this->style_registry = WP_Block_Styles_Registry::get_instance();\n\t}\n\n\t/**\n\t * Registers the routes for the objects of the controller.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @see register_rest_route()\n\t */\n\tpublic function register_routes() {\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_items' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base . '/(?P<namespace>[a-zA-Z0-9_-]+)',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_items' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base . '/(?P<namespace>[a-zA-Z0-9_-]+)/(?P<name>[a-zA-Z0-9_-]+)',\n\t\t\tarray(\n\t\t\t\t'args'   => array(\n\t\t\t\t\t'name'      => array(\n\t\t\t\t\t\t'description' => __( 'Block name' ),\n\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t),\n\t\t\t\t\t'namespace' => array(\n\t\t\t\t\t\t'description' => __( 'Block namespace' ),\n\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether a given request has permission to read post block types.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_Error|bool True if the request has read access, WP_Error object otherwise.\n\t */\n\tpublic function get_items_permissions_check( $request ) {\n\t\treturn $this->check_read_permission();\n\t}\n\n\t/**\n\t * Retrieves all post block types, depending on user context.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_items( $request ) {\n\t\t$data        = array();\n\t\t$block_types = $this->block_registry->get_all_registered();\n\n\t\t// Retrieve the list of registered collection query parameters.\n\t\t$registered = $this->get_collection_params();\n\t\t$namespace  = '';\n\t\tif ( isset( $registered['namespace'] ) && ! empty( $request['namespace'] ) ) {\n\t\t\t$namespace = $request['namespace'];\n\t\t}\n\n\t\tforeach ( $block_types as $slug => $obj ) {\n\t\t\tif ( $namespace ) {\n\t\t\t\tlist ( $block_namespace ) = explode( '/', $obj->name );\n\n\t\t\t\tif ( $namespace !== $block_namespace ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$block_type = $this->prepare_item_for_response( $obj, $request );\n\t\t\t$data[]     = $this->prepare_response_for_collection( $block_type );\n\t\t}\n\n\t\treturn rest_ensure_response( $data );\n\t}\n\n\t/**\n\t * Checks if a given request has access to read a block type.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_Error|bool True if the request has read access for the item, WP_Error object otherwise.\n\t */\n\tpublic function get_item_permissions_check( $request ) {\n\t\t$check = $this->check_read_permission();\n\t\tif ( is_wp_error( $check ) ) {\n\t\t\treturn $check;\n\t\t}\n\t\t$block_name = sprintf( '%s/%s', $request['namespace'], $request['name'] );\n\t\t$block_type = $this->get_block( $block_name );\n\t\tif ( is_wp_error( $block_type ) ) {\n\t\t\treturn $block_type;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks whether a given block type should be visible.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return WP_Error|bool True if the block type is visible, WP_Error otherwise.\n\t */\n\tprotected function check_read_permission() {\n\t\tif ( current_user_can( 'edit_posts' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\tforeach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) {\n\t\t\tif ( current_user_can( $post_type->cap->edit_posts ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn new WP_Error( 'rest_block_type_cannot_view', __( 'Sorry, you are not allowed to manage block types.' ), array( 'status' => rest_authorization_required_code() ) );\n\t}\n\n\t/**\n\t * Get the block, if the name is valid.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $name Block name.\n\t * @return WP_Block_Type|WP_Error Block type object if name is valid, WP_Error otherwise.\n\t */\n\tprotected function get_block( $name ) {\n\t\t$block_type = $this->block_registry->get_registered( $name );\n\t\tif ( empty( $block_type ) ) {\n\t\t\treturn new WP_Error( 'rest_block_type_invalid', __( 'Invalid block type.' ), array( 'status' => 404 ) );\n\t\t}\n\n\t\treturn $block_type;\n\t}\n\n\t/**\n\t * Retrieves a specific block type.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_item( $request ) {\n\t\t$block_name = sprintf( '%s/%s', $request['namespace'], $request['name'] );\n\t\t$block_type = $this->get_block( $block_name );\n\t\tif ( is_wp_error( $block_type ) ) {\n\t\t\treturn $block_type;\n\t\t}\n\t\t$data = $this->prepare_item_for_response( $block_type, $request );\n\n\t\treturn rest_ensure_response( $data );\n\t}\n\n\t/**\n\t * Prepares a block type object for serialization.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_Block_Type   $block_type Block type data.\n\t * @param WP_REST_Request $request    Full details about the request.\n\t * @return WP_REST_Response Block type data.\n\t */\n\tpublic function prepare_item_for_response( $block_type, $request ) {\n\n\t\t$fields = $this->get_fields_for_response( $request );\n\t\t$data   = array();\n\n\t\tif ( rest_is_field_included( 'attributes', $fields ) ) {\n\t\t\t$data['attributes'] = $block_type->get_attributes();\n\t\t}\n\n\t\tif ( rest_is_field_included( 'is_dynamic', $fields ) ) {\n\t\t\t$data['is_dynamic'] = $block_type->is_dynamic();\n\t\t}\n\n\t\t$schema       = $this->get_item_schema();\n\t\t$extra_fields = array(\n\t\t\t'name',\n\t\t\t'title',\n\t\t\t'description',\n\t\t\t'icon',\n\t\t\t'category',\n\t\t\t'keywords',\n\t\t\t'parent',\n\t\t\t'provides_context',\n\t\t\t'uses_context',\n\t\t\t'supports',\n\t\t\t'styles',\n\t\t\t'textdomain',\n\t\t\t'example',\n\t\t\t'editor_script',\n\t\t\t'script',\n\t\t\t'editor_style',\n\t\t\t'style',\n\t\t);\n\t\tforeach ( $extra_fields as $extra_field ) {\n\t\t\tif ( rest_is_field_included( $extra_field, $fields ) ) {\n\t\t\t\tif ( isset( $block_type->$extra_field ) ) {\n\t\t\t\t\t$field = $block_type->$extra_field;\n\t\t\t\t} elseif ( array_key_exists( 'default', $schema['properties'][ $extra_field ] ) ) {\n\t\t\t\t\t$field = $schema['properties'][ $extra_field ]['default'];\n\t\t\t\t} else {\n\t\t\t\t\t$field = '';\n\t\t\t\t}\n\t\t\t\t$data[ $extra_field ] = rest_sanitize_value_from_schema( $field, $schema['properties'][ $extra_field ] );\n\t\t\t}\n\t\t}\n\n\t\tif ( rest_is_field_included( 'styles', $fields ) ) {\n\t\t\t$styles         = $this->style_registry->get_registered_styles_for_block( $block_type->name );\n\t\t\t$styles         = array_values( $styles );\n\t\t\t$data['styles'] = wp_parse_args( $styles, $data['styles'] );\n\t\t\t$data['styles'] = array_filter( $data['styles'] );\n\t\t}\n\n\t\t$context = ! empty( $request['context'] ) ? $request['context'] : 'view';\n\t\t$data    = $this->add_additional_fields_to_object( $data, $request );\n\t\t$data    = $this->filter_response_by_context( $data, $context );\n\n\t\t$response = rest_ensure_response( $data );\n\n\t\t$response->add_links( $this->prepare_links( $block_type ) );\n\n\t\t/**\n\t\t * Filters a block type returned from the REST API.\n\t\t *\n\t\t * Allows modification of the block type data right before it is returned.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param WP_REST_Response $response   The response object.\n\t\t * @param WP_Block_Type    $block_type The original block type object.\n\t\t * @param WP_REST_Request  $request    Request used to generate the response.\n\t\t */\n\t\treturn apply_filters( 'rest_prepare_block_type', $response, $block_type, $request );\n\t}\n\n\t/**\n\t * Prepares links for the request.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_Block_Type $block_type Block type data.\n\t * @return array Links for the given block type.\n\t */\n\tprotected function prepare_links( $block_type ) {\n\t\tlist( $namespace ) = explode( '/', $block_type->name );\n\n\t\t$links = array(\n\t\t\t'collection' => array(\n\t\t\t\t'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),\n\t\t\t),\n\t\t\t'self'       => array(\n\t\t\t\t'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $block_type->name ) ),\n\t\t\t),\n\t\t\t'up'         => array(\n\t\t\t\t'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $namespace ) ),\n\t\t\t),\n\t\t);\n\n\t\tif ( $block_type->is_dynamic() ) {\n\t\t\t$links['https://api.w.org/render-block'] = array(\n\t\t\t\t'href' => add_query_arg( 'context', 'edit', rest_url( sprintf( '%s/%s/%s', 'wp/v2', 'block-renderer', $block_type->name ) ) ),\n\t\t\t);\n\t\t}\n\n\t\treturn $links;\n\t}\n\n\t/**\n\t * Retrieves the block type' schema, conforming to JSON Schema.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$schema = array(\n\t\t\t'$schema'    => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title'      => 'block-type',\n\t\t\t'type'       => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'title'            => array(\n\t\t\t\t\t'description' => __( 'Title of block type.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'default'     => '',\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'name'             => array(\n\t\t\t\t\t'description' => __( 'Unique name identifying the block type.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'default'     => '',\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'description'      => array(\n\t\t\t\t\t'description' => __( 'Description of block type.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'default'     => '',\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'icon'             => array(\n\t\t\t\t\t'description' => __( 'Icon of block type.' ),\n\t\t\t\t\t'type'        => array( 'string', 'null' ),\n\t\t\t\t\t'default'     => null,\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'attributes'       => array(\n\t\t\t\t\t'description'          => __( 'Block attributes.' ),\n\t\t\t\t\t'type'                 => array( 'object', 'null' ),\n\t\t\t\t\t'properties'           => array(),\n\t\t\t\t\t'default'              => null,\n\t\t\t\t\t'additionalProperties' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t),\n\t\t\t\t\t'context'              => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'             => true,\n\t\t\t\t),\n\t\t\t\t'provides_context' => array(\n\t\t\t\t\t'description'          => __( 'Context provided by blocks of this type.' ),\n\t\t\t\t\t'type'                 => 'object',\n\t\t\t\t\t'properties'           => array(),\n\t\t\t\t\t'additionalProperties' => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t\t'default'              => array(),\n\t\t\t\t\t'context'              => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'             => true,\n\t\t\t\t),\n\t\t\t\t'uses_context'     => array(\n\t\t\t\t\t'description' => __( 'Context values inherited by blocks of this type.' ),\n\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t'default'     => array(),\n\t\t\t\t\t'items'       => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'supports'         => array(\n\t\t\t\t\t'description' => __( 'Block supports.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'default'     => array(),\n\t\t\t\t\t'properties'  => array(),\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'category'         => array(\n\t\t\t\t\t'description' => __( 'Block category.' ),\n\t\t\t\t\t'type'        => array( 'string', 'null' ),\n\t\t\t\t\t'default'     => null,\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'is_dynamic'       => array(\n\t\t\t\t\t'description' => __( 'Is the block dynamically rendered.' ),\n\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t'default'     => false,\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'editor_script'    => array(\n\t\t\t\t\t'description' => __( 'Editor script handle.' ),\n\t\t\t\t\t'type'        => array( 'string', 'null' ),\n\t\t\t\t\t'default'     => null,\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'script'           => array(\n\t\t\t\t\t'description' => __( 'Public facing script handle.' ),\n\t\t\t\t\t'type'        => array( 'string', 'null' ),\n\t\t\t\t\t'default'     => null,\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'editor_style'     => array(\n\t\t\t\t\t'description' => __( 'Editor style handle.' ),\n\t\t\t\t\t'type'        => array( 'string', 'null' ),\n\t\t\t\t\t'default'     => null,\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'style'            => array(\n\t\t\t\t\t'description' => __( 'Public facing style handle.' ),\n\t\t\t\t\t'type'        => array( 'string', 'null' ),\n\t\t\t\t\t'default'     => null,\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'styles'           => array(\n\t\t\t\t\t'description' => __( 'Block style variations.' ),\n\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t'items'       => array(\n\t\t\t\t\t\t'type'       => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'name'         => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Unique name identifying the style.' ),\n\t\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t\t'required'    => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'label'        => array(\n\t\t\t\t\t\t\t\t'description' => __( 'The human-readable label for the style.' ),\n\t\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'inline_style' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Inline CSS code that registers the CSS class required for the style.' ),\n\t\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'style_handle' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Contains the handle that defines the block style.' ),\n\t\t\t\t\t\t\t\t'type'        => 'string',\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'default'     => array(),\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'textdomain'       => array(\n\t\t\t\t\t'description' => __( 'Public text domain.' ),\n\t\t\t\t\t'type'        => array( 'string', 'null' ),\n\t\t\t\t\t'default'     => null,\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'parent'           => array(\n\t\t\t\t\t'description' => __( 'Parent blocks.' ),\n\t\t\t\t\t'type'        => array( 'array', 'null' ),\n\t\t\t\t\t'items'       => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t\t'default'     => null,\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'keywords'         => array(\n\t\t\t\t\t'description' => __( 'Block keywords.' ),\n\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t'items'       => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t\t'default'     => array(),\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'example'          => array(\n\t\t\t\t\t'description' => __( 'Block example.' ),\n\t\t\t\t\t'type'        => array( 'object', 'null' ),\n\t\t\t\t\t'default'     => null,\n\t\t\t\t\t'properties'  => array(\n\t\t\t\t\t\t'attributes'  => array(\n\t\t\t\t\t\t\t'description' => __( 'The attributes used in the example.' ),\n\t\t\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'innerBlocks' => array(\n\t\t\t\t\t\t\t'description' => __( 'The list of inner blocks used in the example.' ),\n\t\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t\t'items'       => array(\n\t\t\t\t\t\t\t\t'type'       => 'object',\n\t\t\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t\t\t'name'        => array(\n\t\t\t\t\t\t\t\t\t\t'description' => __( 'The name of the inner block.' ),\n\t\t\t\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'attributes'  => array(\n\t\t\t\t\t\t\t\t\t\t'description' => __( 'The attributes of the inner block.' ),\n\t\t\t\t\t\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'innerBlocks' => array(\n\t\t\t\t\t\t\t\t\t\t'description' => __( \"A list of the inner block's own inner blocks. This is a recursive definition following the parent innerBlocks schema.\" ),\n\t\t\t\t\t\t\t\t\t\t'type'        => 'array',\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),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->schema = $schema;\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}\n\n\t/**\n\t * Retrieves the query params for collections.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array Collection parameters.\n\t */\n\tpublic function get_collection_params() {\n\t\treturn array(\n\t\t\t'context'   => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t'namespace' => array(\n\t\t\t\t'description' => __( 'Block namespace.' ),\n\t\t\t\t'type'        => 'string',\n\t\t\t),\n\t\t);\n\t}\n\n}\n", "num_lines": 594}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Reusable blocks REST API: WP_REST_Blocks_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 5.0.0\n */\n\n/**\n * Controller which provides a REST endpoint for the editor to read, create,\n * edit and delete reusable blocks. Blocks are stored as posts with the wp_block\n * post type.\n *\n * @since 5.0.0\n *\n * @see WP_REST_Posts_Controller\n * @see WP_REST_Controller\n */\nclass WP_REST_Blocks_Controller extends WP_REST_Posts_Controller {\n\n\t/**\n\t * Checks if a block can be read.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_Post $post Post object that backs the block.\n\t * @return bool Whether the block can be read.\n\t */\n\tpublic function check_read_permission( $post ) {\n\t\t// By default the read_post capability is mapped to edit_posts.\n\t\tif ( ! current_user_can( 'read_post', $post->ID ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn parent::check_read_permission( $post );\n\t}\n\n\t/**\n\t * Filters a response based on the context defined in the schema.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param array  $data    Response data to fiter.\n\t * @param string $context Context defined in the schema.\n\t * @return array Filtered response.\n\t */\n\tpublic function filter_response_by_context( $data, $context ) {\n\t\t$data = parent::filter_response_by_context( $data, $context );\n\n\t\t/*\n\t\t * Remove `title.rendered` and `content.rendered` from the response. It\n\t\t * doesn't make sense for a reusable block to have rendered content on its\n\t\t * own, since rendering a block requires it to be inside a post or a page.\n\t\t */\n\t\tunset( $data['title']['rendered'] );\n\t\tunset( $data['content']['rendered'] );\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Retrieves the block's schema, conforming to JSON Schema.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\t// Do not cache this schema because all properties are derived from parent controller.\n\t\t$schema = parent::get_item_schema();\n\n\t\t/*\n\t\t * Allow all contexts to access `title.raw` and `content.raw`. Clients always\n\t\t * need the raw markup of a reusable block to do anything useful, e.g. parse\n\t\t * it or display it in an editor.\n\t\t */\n\t\t$schema['properties']['title']['properties']['raw']['context']   = array( 'view', 'edit' );\n\t\t$schema['properties']['content']['properties']['raw']['context'] = array( 'view', 'edit' );\n\n\t\t/*\n\t\t * Remove `title.rendered` and `content.rendered` from the schema. It doesn\u00e2\u20ac\u2122t\n\t\t * make sense for a reusable block to have rendered content on its own, since\n\t\t * rendering a block requires it to be inside a post or a page.\n\t\t */\n\t\tunset( $schema['properties']['title']['properties']['rendered'] );\n\t\tunset( $schema['properties']['content']['properties']['rendered'] );\n\n\t\treturn $schema;\n\t}\n\n}\n", "num_lines": 93}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Comments_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.7.0\n */\n\n/**\n * Core controller used to access comments via the REST API.\n *\n * @since 4.7.0\n *\n * @see WP_REST_Controller\n */\nclass WP_REST_Comments_Controller extends WP_REST_Controller {\n\n\t/**\n\t * Instance of a comment meta fields object.\n\t *\n\t * @since 4.7.0\n\t * @var WP_REST_Comment_Meta_Fields\n\t */\n\tprotected $meta;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.7.0\n\t */\n\tpublic function __construct() {\n\t\t$this->namespace = 'wp/v2';\n\t\t$this->rest_base = 'comments';\n\n\t\t$this->meta = new WP_REST_Comment_Meta_Fields();\n\t}\n\n\t/**\n\t * Registers the routes for the objects of the controller.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see register_rest_route()\n\t */\n\tpublic function register_routes() {\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_items' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::CREATABLE,\n\t\t\t\t\t'callback'            => array( $this, 'create_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'create_item_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base . '/(?P<id>[\\d]+)',\n\t\t\tarray(\n\t\t\t\t'args'   => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'description' => __( 'Unique identifier for the object.' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'context'  => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t\t\t\t'password' => array(\n\t\t\t\t\t\t\t'description' => __( 'The password for the parent post of the comment (if the post is password protected).' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::EDITABLE,\n\t\t\t\t\t'callback'            => array( $this, 'update_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'update_item_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::DELETABLE,\n\t\t\t\t\t'callback'            => array( $this, 'delete_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'delete_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'force'    => array(\n\t\t\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t\t\t'default'     => false,\n\t\t\t\t\t\t\t'description' => __( 'Whether to bypass Trash and force deletion.' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'password' => array(\n\t\t\t\t\t\t\t'description' => __( 'The password for the parent post of the comment (if the post is password protected).' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Checks if a given request has access to read comments.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access, error object otherwise.\n\t */\n\tpublic function get_items_permissions_check( $request ) {\n\n\t\tif ( ! empty( $request['post'] ) ) {\n\t\t\tforeach ( (array) $request['post'] as $post_id ) {\n\t\t\t\t$post = get_post( $post_id );\n\n\t\t\t\tif ( ! empty( $post_id ) && $post && ! $this->check_read_post_permission( $post, $request ) ) {\n\t\t\t\t\treturn new WP_Error(\n\t\t\t\t\t\t'rest_cannot_read_post',\n\t\t\t\t\t\t__( 'Sorry, you are not allowed to read the post for this comment.' ),\n\t\t\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t\t\t);\n\t\t\t\t} elseif ( 0 === $post_id && ! current_user_can( 'moderate_comments' ) ) {\n\t\t\t\t\treturn new WP_Error(\n\t\t\t\t\t\t'rest_cannot_read',\n\t\t\t\t\t\t__( 'Sorry, you are not allowed to read comments without a post.' ),\n\t\t\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $request['context'] ) && 'edit' === $request['context'] && ! current_user_can( 'moderate_comments' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_forbidden_context',\n\t\t\t\t__( 'Sorry, you are not allowed to edit comments.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\t\t$protected_params = array( 'author', 'author_exclude', 'author_email', 'type', 'status' );\n\t\t\t$forbidden_params = array();\n\n\t\t\tforeach ( $protected_params as $param ) {\n\t\t\t\tif ( 'status' === $param ) {\n\t\t\t\t\tif ( 'approve' !== $request[ $param ] ) {\n\t\t\t\t\t\t$forbidden_params[] = $param;\n\t\t\t\t\t}\n\t\t\t\t} elseif ( 'type' === $param ) {\n\t\t\t\t\tif ( 'comment' !== $request[ $param ] ) {\n\t\t\t\t\t\t$forbidden_params[] = $param;\n\t\t\t\t\t}\n\t\t\t\t} elseif ( ! empty( $request[ $param ] ) ) {\n\t\t\t\t\t$forbidden_params[] = $param;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty( $forbidden_params ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_forbidden_param',\n\t\t\t\t\t/* translators: %s: List of forbidden parameters. */\n\t\t\t\t\tsprintf( __( 'Query parameter not permitted: %s' ), implode( ', ', $forbidden_params ) ),\n\t\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves a list of comment items.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or error object on failure.\n\t */\n\tpublic function get_items( $request ) {\n\n\t\t// Retrieve the list of registered collection query parameters.\n\t\t$registered = $this->get_collection_params();\n\n\t\t/*\n\t\t * This array defines mappings between public API query parameters whose\n\t\t * values are accepted as-passed, and their internal WP_Query parameter\n\t\t * name equivalents (some are the same). Only values which are also\n\t\t * present in $registered will be set.\n\t\t */\n\t\t$parameter_mappings = array(\n\t\t\t'author'         => 'author__in',\n\t\t\t'author_email'   => 'author_email',\n\t\t\t'author_exclude' => 'author__not_in',\n\t\t\t'exclude'        => 'comment__not_in',\n\t\t\t'include'        => 'comment__in',\n\t\t\t'offset'         => 'offset',\n\t\t\t'order'          => 'order',\n\t\t\t'parent'         => 'parent__in',\n\t\t\t'parent_exclude' => 'parent__not_in',\n\t\t\t'per_page'       => 'number',\n\t\t\t'post'           => 'post__in',\n\t\t\t'search'         => 'search',\n\t\t\t'status'         => 'status',\n\t\t\t'type'           => 'type',\n\t\t);\n\n\t\t$prepared_args = array();\n\n\t\t/*\n\t\t * For each known parameter which is both registered and present in the request,\n\t\t * set the parameter's value on the query $prepared_args.\n\t\t */\n\t\tforeach ( $parameter_mappings as $api_param => $wp_param ) {\n\t\t\tif ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) {\n\t\t\t\t$prepared_args[ $wp_param ] = $request[ $api_param ];\n\t\t\t}\n\t\t}\n\n\t\t// Ensure certain parameter values default to empty strings.\n\t\tforeach ( array( 'author_email', 'search' ) as $param ) {\n\t\t\tif ( ! isset( $prepared_args[ $param ] ) ) {\n\t\t\t\t$prepared_args[ $param ] = '';\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $registered['orderby'] ) ) {\n\t\t\t$prepared_args['orderby'] = $this->normalize_query_param( $request['orderby'] );\n\t\t}\n\n\t\t$prepared_args['no_found_rows'] = false;\n\n\t\t$prepared_args['date_query'] = array();\n\n\t\t// Set before into date query. Date query must be specified as an array of an array.\n\t\tif ( isset( $registered['before'], $request['before'] ) ) {\n\t\t\t$prepared_args['date_query'][0]['before'] = $request['before'];\n\t\t}\n\n\t\t// Set after into date query. Date query must be specified as an array of an array.\n\t\tif ( isset( $registered['after'], $request['after'] ) ) {\n\t\t\t$prepared_args['date_query'][0]['after'] = $request['after'];\n\t\t}\n\n\t\tif ( isset( $registered['page'] ) && empty( $request['offset'] ) ) {\n\t\t\t$prepared_args['offset'] = $prepared_args['number'] * ( absint( $request['page'] ) - 1 );\n\t\t}\n\n\t\t/**\n\t\t * Filters arguments, before passing to WP_Comment_Query, when querying comments via the REST API.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @link https://developer.wordpress.org/reference/classes/wp_comment_query/\n\t\t *\n\t\t * @param array           $prepared_args Array of arguments for WP_Comment_Query.\n\t\t * @param WP_REST_Request $request       The current request.\n\t\t */\n\t\t$prepared_args = apply_filters( 'rest_comment_query', $prepared_args, $request );\n\n\t\t$query        = new WP_Comment_Query;\n\t\t$query_result = $query->query( $prepared_args );\n\n\t\t$comments = array();\n\n\t\tforeach ( $query_result as $comment ) {\n\t\t\tif ( ! $this->check_read_permission( $comment, $request ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$data       = $this->prepare_item_for_response( $comment, $request );\n\t\t\t$comments[] = $this->prepare_response_for_collection( $data );\n\t\t}\n\n\t\t$total_comments = (int) $query->found_comments;\n\t\t$max_pages      = (int) $query->max_num_pages;\n\n\t\tif ( $total_comments < 1 ) {\n\t\t\t// Out-of-bounds, run the query again without LIMIT for total count.\n\t\t\tunset( $prepared_args['number'], $prepared_args['offset'] );\n\n\t\t\t$query                  = new WP_Comment_Query;\n\t\t\t$prepared_args['count'] = true;\n\n\t\t\t$total_comments = $query->query( $prepared_args );\n\t\t\t$max_pages      = ceil( $total_comments / $request['per_page'] );\n\t\t}\n\n\t\t$response = rest_ensure_response( $comments );\n\t\t$response->header( 'X-WP-Total', $total_comments );\n\t\t$response->header( 'X-WP-TotalPages', $max_pages );\n\n\t\t$base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );\n\n\t\tif ( $request['page'] > 1 ) {\n\t\t\t$prev_page = $request['page'] - 1;\n\n\t\t\tif ( $prev_page > $max_pages ) {\n\t\t\t\t$prev_page = $max_pages;\n\t\t\t}\n\n\t\t\t$prev_link = add_query_arg( 'page', $prev_page, $base );\n\t\t\t$response->link_header( 'prev', $prev_link );\n\t\t}\n\n\t\tif ( $max_pages > $request['page'] ) {\n\t\t\t$next_page = $request['page'] + 1;\n\t\t\t$next_link = add_query_arg( 'page', $next_page, $base );\n\n\t\t\t$response->link_header( 'next', $next_link );\n\t\t}\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Get the comment, if the ID is valid.\n\t *\n\t * @since 4.7.2\n\t *\n\t * @param int $id Supplied ID.\n\t * @return WP_Comment|WP_Error Comment object if ID is valid, WP_Error otherwise.\n\t */\n\tprotected function get_comment( $id ) {\n\t\t$error = new WP_Error(\n\t\t\t'rest_comment_invalid_id',\n\t\t\t__( 'Invalid comment ID.' ),\n\t\t\tarray( 'status' => 404 )\n\t\t);\n\n\t\tif ( (int) $id <= 0 ) {\n\t\t\treturn $error;\n\t\t}\n\n\t\t$id      = (int) $id;\n\t\t$comment = get_comment( $id );\n\t\tif ( empty( $comment ) ) {\n\t\t\treturn $error;\n\t\t}\n\n\t\tif ( ! empty( $comment->comment_post_ID ) ) {\n\t\t\t$post = get_post( (int) $comment->comment_post_ID );\n\n\t\t\tif ( empty( $post ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_post_invalid_id',\n\t\t\t\t\t__( 'Invalid post ID.' ),\n\t\t\t\t\tarray( 'status' => 404 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $comment;\n\t}\n\n\t/**\n\t * Checks if a given request has access to read the comment.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access for the item, error object otherwise.\n\t */\n\tpublic function get_item_permissions_check( $request ) {\n\t\t$comment = $this->get_comment( $request['id'] );\n\t\tif ( is_wp_error( $comment ) ) {\n\t\t\treturn $comment;\n\t\t}\n\n\t\tif ( ! empty( $request['context'] ) && 'edit' === $request['context'] && ! current_user_can( 'moderate_comments' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_forbidden_context',\n\t\t\t\t__( 'Sorry, you are not allowed to edit comments.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\t$post = get_post( $comment->comment_post_ID );\n\n\t\tif ( ! $this->check_read_permission( $comment, $request ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_read',\n\t\t\t\t__( 'Sorry, you are not allowed to read this comment.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( $post && ! $this->check_read_post_permission( $post, $request ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_read_post',\n\t\t\t\t__( 'Sorry, you are not allowed to read the post for this comment.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves a comment.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or error object on failure.\n\t */\n\tpublic function get_item( $request ) {\n\t\t$comment = $this->get_comment( $request['id'] );\n\t\tif ( is_wp_error( $comment ) ) {\n\t\t\treturn $comment;\n\t\t}\n\n\t\t$data     = $this->prepare_item_for_response( $comment, $request );\n\t\t$response = rest_ensure_response( $data );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Checks if a given request has access to create a comment.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to create items, error object otherwise.\n\t */\n\tpublic function create_item_permissions_check( $request ) {\n\t\tif ( ! is_user_logged_in() ) {\n\t\t\tif ( get_option( 'comment_registration' ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_comment_login_required',\n\t\t\t\t\t__( 'Sorry, you must be logged in to comment.' ),\n\t\t\t\t\tarray( 'status' => 401 )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filter whether comments can be created without authentication.\n\t\t\t *\n\t\t\t * Enables creating comments for anonymous users.\n\t\t\t *\n\t\t\t * @since 4.7.0\n\t\t\t *\n\t\t\t * @param bool $allow_anonymous Whether to allow anonymous comments to\n\t\t\t *                              be created. Default `false`.\n\t\t\t * @param WP_REST_Request $request Request used to generate the\n\t\t\t *                                 response.\n\t\t\t */\n\t\t\t$allow_anonymous = apply_filters( 'rest_allow_anonymous_comments', false, $request );\n\n\t\t\tif ( ! $allow_anonymous ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_comment_login_required',\n\t\t\t\t\t__( 'Sorry, you must be logged in to comment.' ),\n\t\t\t\t\tarray( 'status' => 401 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Limit who can set comment `author`, `author_ip` or `status` to anything other than the default.\n\t\tif ( isset( $request['author'] ) && get_current_user_id() !== $request['author'] && ! current_user_can( 'moderate_comments' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_comment_invalid_author',\n\t\t\t\t/* translators: %s: Request parameter. */\n\t\t\t\tsprintf( __( \"Sorry, you are not allowed to edit '%s' for comments.\" ), 'author' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( isset( $request['author_ip'] ) && ! current_user_can( 'moderate_comments' ) ) {\n\t\t\tif ( empty( $_SERVER['REMOTE_ADDR'] ) || $request['author_ip'] !== $_SERVER['REMOTE_ADDR'] ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_comment_invalid_author_ip',\n\t\t\t\t\t/* translators: %s: Request parameter. */\n\t\t\t\t\tsprintf( __( \"Sorry, you are not allowed to edit '%s' for comments.\" ), 'author_ip' ),\n\t\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $request['status'] ) && ! current_user_can( 'moderate_comments' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_comment_invalid_status',\n\t\t\t\t/* translators: %s: Request parameter. */\n\t\t\t\tsprintf( __( \"Sorry, you are not allowed to edit '%s' for comments.\" ), 'status' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( empty( $request['post'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_comment_invalid_post_id',\n\t\t\t\t__( 'Sorry, you are not allowed to create this comment without a post.' ),\n\t\t\t\tarray( 'status' => 403 )\n\t\t\t);\n\t\t}\n\n\t\t$post = get_post( (int) $request['post'] );\n\n\t\tif ( ! $post ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_comment_invalid_post_id',\n\t\t\t\t__( 'Sorry, you are not allowed to create this comment without a post.' ),\n\t\t\t\tarray( 'status' => 403 )\n\t\t\t);\n\t\t}\n\n\t\tif ( 'draft' === $post->post_status ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_comment_draft_post',\n\t\t\t\t__( 'Sorry, you are not allowed to create a comment on this post.' ),\n\t\t\t\tarray( 'status' => 403 )\n\t\t\t);\n\t\t}\n\n\t\tif ( 'trash' === $post->post_status ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_comment_trash_post',\n\t\t\t\t__( 'Sorry, you are not allowed to create a comment on this post.' ),\n\t\t\t\tarray( 'status' => 403 )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! $this->check_read_post_permission( $post, $request ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_read_post',\n\t\t\t\t__( 'Sorry, you are not allowed to read the post for this comment.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! comments_open( $post->ID ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_comment_closed',\n\t\t\t\t__( 'Sorry, comments are closed for this item.' ),\n\t\t\t\tarray( 'status' => 403 )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Creates a comment.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or error object on failure.\n\t */\n\tpublic function create_item( $request ) {\n\t\tif ( ! empty( $request['id'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_comment_exists',\n\t\t\t\t__( 'Cannot create existing comment.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t// Do not allow comments to be created with a non-default type.\n\t\tif ( ! empty( $request['type'] ) && 'comment' !== $request['type'] ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_invalid_comment_type',\n\t\t\t\t__( 'Cannot create a comment with that type.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t$prepared_comment = $this->prepare_item_for_database( $request );\n\t\tif ( is_wp_error( $prepared_comment ) ) {\n\t\t\treturn $prepared_comment;\n\t\t}\n\n\t\t$prepared_comment['comment_type'] = 'comment';\n\n\t\t/*\n\t\t * Do not allow a comment to be created with missing or empty\n\t\t * comment_content. See wp_handle_comment_submission().\n\t\t */\n\t\tif ( empty( $prepared_comment['comment_content'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_comment_content_invalid',\n\t\t\t\t__( 'Invalid comment content.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t// Setting remaining values before wp_insert_comment so we can use wp_allow_comment().\n\t\tif ( ! isset( $prepared_comment['comment_date_gmt'] ) ) {\n\t\t\t$prepared_comment['comment_date_gmt'] = current_time( 'mysql', true );\n\t\t}\n\n\t\t// Set author data if the user's logged in.\n\t\t$missing_author = empty( $prepared_comment['user_id'] )\n\t\t\t&& empty( $prepared_comment['comment_author'] )\n\t\t\t&& empty( $prepared_comment['comment_author_email'] )\n\t\t\t&& empty( $prepared_comment['comment_author_url'] );\n\n\t\tif ( is_user_logged_in() && $missing_author ) {\n\t\t\t$user = wp_get_current_user();\n\n\t\t\t$prepared_comment['user_id']              = $user->ID;\n\t\t\t$prepared_comment['comment_author']       = $user->display_name;\n\t\t\t$prepared_comment['comment_author_email'] = $user->user_email;\n\t\t\t$prepared_comment['comment_author_url']   = $user->user_url;\n\t\t}\n\n\t\t// Honor the discussion setting that requires a name and email address of the comment author.\n\t\tif ( get_option( 'require_name_email' ) ) {\n\t\t\tif ( empty( $prepared_comment['comment_author'] ) || empty( $prepared_comment['comment_author_email'] ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_comment_author_data_required',\n\t\t\t\t\t__( 'Creating a comment requires valid author name and email values.' ),\n\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( ! isset( $prepared_comment['comment_author_email'] ) ) {\n\t\t\t$prepared_comment['comment_author_email'] = '';\n\t\t}\n\n\t\tif ( ! isset( $prepared_comment['comment_author_url'] ) ) {\n\t\t\t$prepared_comment['comment_author_url'] = '';\n\t\t}\n\n\t\tif ( ! isset( $prepared_comment['comment_agent'] ) ) {\n\t\t\t$prepared_comment['comment_agent'] = '';\n\t\t}\n\n\t\t$check_comment_lengths = wp_check_comment_data_max_lengths( $prepared_comment );\n\n\t\tif ( is_wp_error( $check_comment_lengths ) ) {\n\t\t\t$error_code = $check_comment_lengths->get_error_code();\n\t\t\treturn new WP_Error(\n\t\t\t\t$error_code,\n\t\t\t\t__( 'Comment field exceeds maximum length allowed.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t$prepared_comment['comment_approved'] = wp_allow_comment( $prepared_comment, true );\n\n\t\tif ( is_wp_error( $prepared_comment['comment_approved'] ) ) {\n\t\t\t$error_code    = $prepared_comment['comment_approved']->get_error_code();\n\t\t\t$error_message = $prepared_comment['comment_approved']->get_error_message();\n\n\t\t\tif ( 'comment_duplicate' === $error_code ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t$error_code,\n\t\t\t\t\t$error_message,\n\t\t\t\t\tarray( 'status' => 409 )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( 'comment_flood' === $error_code ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t$error_code,\n\t\t\t\t\t$error_message,\n\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $prepared_comment['comment_approved'];\n\t\t}\n\n\t\t/**\n\t\t * Filters a comment before it is inserted via the REST API.\n\t\t *\n\t\t * Allows modification of the comment right before it is inserted via wp_insert_comment().\n\t\t * Returning a WP_Error value from the filter will short-circuit insertion and allow\n\t\t * skipping further processing.\n\t\t *\n\t\t * @since 4.7.0\n\t\t * @since 4.8.0 `$prepared_comment` can now be a WP_Error to short-circuit insertion.\n\t\t *\n\t\t * @param array|WP_Error  $prepared_comment The prepared comment data for wp_insert_comment().\n\t\t * @param WP_REST_Request $request          Request used to insert the comment.\n\t\t */\n\t\t$prepared_comment = apply_filters( 'rest_pre_insert_comment', $prepared_comment, $request );\n\t\tif ( is_wp_error( $prepared_comment ) ) {\n\t\t\treturn $prepared_comment;\n\t\t}\n\n\t\t$comment_id = wp_insert_comment( wp_filter_comment( wp_slash( (array) $prepared_comment ) ) );\n\n\t\tif ( ! $comment_id ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_comment_failed_create',\n\t\t\t\t__( 'Creating comment failed.' ),\n\t\t\t\tarray( 'status' => 500 )\n\t\t\t);\n\t\t}\n\n\t\tif ( isset( $request['status'] ) ) {\n\t\t\t$this->handle_status_param( $request['status'], $comment_id );\n\t\t}\n\n\t\t$comment = get_comment( $comment_id );\n\n\t\t/**\n\t\t * Fires after a comment is created or updated via the REST API.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_Comment      $comment  Inserted or updated comment object.\n\t\t * @param WP_REST_Request $request  Request object.\n\t\t * @param bool            $creating True when creating a comment, false\n\t\t *                                  when updating.\n\t\t */\n\t\tdo_action( 'rest_insert_comment', $comment, $request, true );\n\n\t\t$schema = $this->get_item_schema();\n\n\t\tif ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) {\n\t\t\t$meta_update = $this->meta->update_value( $request['meta'], $comment_id );\n\n\t\t\tif ( is_wp_error( $meta_update ) ) {\n\t\t\t\treturn $meta_update;\n\t\t\t}\n\t\t}\n\n\t\t$fields_update = $this->update_additional_fields_for_object( $comment, $request );\n\n\t\tif ( is_wp_error( $fields_update ) ) {\n\t\t\treturn $fields_update;\n\t\t}\n\n\t\t$context = current_user_can( 'moderate_comments' ) ? 'edit' : 'view';\n\t\t$request->set_param( 'context', $context );\n\n\t\t/**\n\t\t * Fires completely after a comment is created or updated via the REST API.\n\t\t *\n\t\t * @since 5.0.0\n\t\t *\n\t\t * @param WP_Comment      $comment  Inserted or updated comment object.\n\t\t * @param WP_REST_Request $request  Request object.\n\t\t * @param bool            $creating True when creating a comment, false\n\t\t *                                  when updating.\n\t\t */\n\t\tdo_action( 'rest_after_insert_comment', $comment, $request, true );\n\n\t\t$response = $this->prepare_item_for_response( $comment, $request );\n\t\t$response = rest_ensure_response( $response );\n\n\t\t$response->set_status( 201 );\n\t\t$response->header( 'Location', rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $comment_id ) ) );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Checks if a given REST request has access to update a comment.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to update the item, error object otherwise.\n\t */\n\tpublic function update_item_permissions_check( $request ) {\n\t\t$comment = $this->get_comment( $request['id'] );\n\t\tif ( is_wp_error( $comment ) ) {\n\t\t\treturn $comment;\n\t\t}\n\n\t\tif ( ! $this->check_edit_permission( $comment ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_edit',\n\t\t\t\t__( 'Sorry, you are not allowed to edit this comment.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Updates a comment.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or error object on failure.\n\t */\n\tpublic function update_item( $request ) {\n\t\t$comment = $this->get_comment( $request['id'] );\n\t\tif ( is_wp_error( $comment ) ) {\n\t\t\treturn $comment;\n\t\t}\n\n\t\t$id = $comment->comment_ID;\n\n\t\tif ( isset( $request['type'] ) && get_comment_type( $id ) !== $request['type'] ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_comment_invalid_type',\n\t\t\t\t__( 'Sorry, you are not allowed to change the comment type.' ),\n\t\t\t\tarray( 'status' => 404 )\n\t\t\t);\n\t\t}\n\n\t\t$prepared_args = $this->prepare_item_for_database( $request );\n\n\t\tif ( is_wp_error( $prepared_args ) ) {\n\t\t\treturn $prepared_args;\n\t\t}\n\n\t\tif ( ! empty( $prepared_args['comment_post_ID'] ) ) {\n\t\t\t$post = get_post( $prepared_args['comment_post_ID'] );\n\n\t\t\tif ( empty( $post ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_comment_invalid_post_id',\n\t\t\t\t\t__( 'Invalid post ID.' ),\n\t\t\t\t\tarray( 'status' => 403 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $prepared_args ) && isset( $request['status'] ) ) {\n\t\t\t// Only the comment status is being changed.\n\t\t\t$change = $this->handle_status_param( $request['status'], $id );\n\n\t\t\tif ( ! $change ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_comment_failed_edit',\n\t\t\t\t\t__( 'Updating comment status failed.' ),\n\t\t\t\t\tarray( 'status' => 500 )\n\t\t\t\t);\n\t\t\t}\n\t\t} elseif ( ! empty( $prepared_args ) ) {\n\t\t\tif ( is_wp_error( $prepared_args ) ) {\n\t\t\t\treturn $prepared_args;\n\t\t\t}\n\n\t\t\tif ( isset( $prepared_args['comment_content'] ) && empty( $prepared_args['comment_content'] ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_comment_content_invalid',\n\t\t\t\t\t__( 'Invalid comment content.' ),\n\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$prepared_args['comment_ID'] = $id;\n\n\t\t\t$check_comment_lengths = wp_check_comment_data_max_lengths( $prepared_args );\n\n\t\t\tif ( is_wp_error( $check_comment_lengths ) ) {\n\t\t\t\t$error_code = $check_comment_lengths->get_error_code();\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t$error_code,\n\t\t\t\t\t__( 'Comment field exceeds maximum length allowed.' ),\n\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$updated = wp_update_comment( wp_slash( (array) $prepared_args ), true );\n\n\t\t\tif ( is_wp_error( $updated ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_comment_failed_edit',\n\t\t\t\t\t__( 'Updating comment failed.' ),\n\t\t\t\t\tarray( 'status' => 500 )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( isset( $request['status'] ) ) {\n\t\t\t\t$this->handle_status_param( $request['status'], $id );\n\t\t\t}\n\t\t}\n\n\t\t$comment = get_comment( $id );\n\n\t\t/** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php */\n\t\tdo_action( 'rest_insert_comment', $comment, $request, false );\n\n\t\t$schema = $this->get_item_schema();\n\n\t\tif ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) {\n\t\t\t$meta_update = $this->meta->update_value( $request['meta'], $id );\n\n\t\t\tif ( is_wp_error( $meta_update ) ) {\n\t\t\t\treturn $meta_update;\n\t\t\t}\n\t\t}\n\n\t\t$fields_update = $this->update_additional_fields_for_object( $comment, $request );\n\n\t\tif ( is_wp_error( $fields_update ) ) {\n\t\t\treturn $fields_update;\n\t\t}\n\n\t\t$request->set_param( 'context', 'edit' );\n\n\t\t/** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php */\n\t\tdo_action( 'rest_after_insert_comment', $comment, $request, false );\n\n\t\t$response = $this->prepare_item_for_response( $comment, $request );\n\n\t\treturn rest_ensure_response( $response );\n\t}\n\n\t/**\n\t * Checks if a given request has access to delete a comment.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to delete the item, error object otherwise.\n\t */\n\tpublic function delete_item_permissions_check( $request ) {\n\t\t$comment = $this->get_comment( $request['id'] );\n\t\tif ( is_wp_error( $comment ) ) {\n\t\t\treturn $comment;\n\t\t}\n\n\t\tif ( ! $this->check_edit_permission( $comment ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_delete',\n\t\t\t\t__( 'Sorry, you are not allowed to delete this comment.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Deletes a comment.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or error object on failure.\n\t */\n\tpublic function delete_item( $request ) {\n\t\t$comment = $this->get_comment( $request['id'] );\n\t\tif ( is_wp_error( $comment ) ) {\n\t\t\treturn $comment;\n\t\t}\n\n\t\t$force = isset( $request['force'] ) ? (bool) $request['force'] : false;\n\n\t\t/**\n\t\t * Filters whether a comment can be trashed.\n\t\t *\n\t\t * Return false to disable Trash support for the post.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param bool    $supports_trash Whether the post type support trashing.\n\t\t * @param WP_Post $comment        The comment object being considered for trashing support.\n\t\t */\n\t\t$supports_trash = apply_filters( 'rest_comment_trashable', ( EMPTY_TRASH_DAYS > 0 ), $comment );\n\n\t\t$request->set_param( 'context', 'edit' );\n\n\t\tif ( $force ) {\n\t\t\t$previous = $this->prepare_item_for_response( $comment, $request );\n\t\t\t$result   = wp_delete_comment( $comment->comment_ID, true );\n\t\t\t$response = new WP_REST_Response();\n\t\t\t$response->set_data(\n\t\t\t\tarray(\n\t\t\t\t\t'deleted'  => true,\n\t\t\t\t\t'previous' => $previous->get_data(),\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t// If this type doesn't support trashing, error out.\n\t\t\tif ( ! $supports_trash ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_trash_not_supported',\n\t\t\t\t\t/* translators: %s: force=true */\n\t\t\t\t\tsprintf( __( \"The comment does not support trashing. Set '%s' to delete.\" ), 'force=true' ),\n\t\t\t\t\tarray( 'status' => 501 )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( 'trash' === $comment->comment_approved ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_already_trashed',\n\t\t\t\t\t__( 'The comment has already been trashed.' ),\n\t\t\t\t\tarray( 'status' => 410 )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$result   = wp_trash_comment( $comment->comment_ID );\n\t\t\t$comment  = get_comment( $comment->comment_ID );\n\t\t\t$response = $this->prepare_item_for_response( $comment, $request );\n\t\t}\n\n\t\tif ( ! $result ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_delete',\n\t\t\t\t__( 'The comment cannot be deleted.' ),\n\t\t\t\tarray( 'status' => 500 )\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Fires after a comment is deleted via the REST API.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_Comment       $comment  The deleted comment data.\n\t\t * @param WP_REST_Response $response The response returned from the API.\n\t\t * @param WP_REST_Request  $request  The request sent to the API.\n\t\t */\n\t\tdo_action( 'rest_delete_comment', $comment, $response, $request );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Prepares a single comment output for response.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Comment      $comment Comment object.\n\t * @param WP_REST_Request $request Request object.\n\t * @return WP_REST_Response Response object.\n\t */\n\tpublic function prepare_item_for_response( $comment, $request ) {\n\n\t\t$fields = $this->get_fields_for_response( $request );\n\t\t$data   = array();\n\n\t\tif ( in_array( 'id', $fields, true ) ) {\n\t\t\t$data['id'] = (int) $comment->comment_ID;\n\t\t}\n\n\t\tif ( in_array( 'post', $fields, true ) ) {\n\t\t\t$data['post'] = (int) $comment->comment_post_ID;\n\t\t}\n\n\t\tif ( in_array( 'parent', $fields, true ) ) {\n\t\t\t$data['parent'] = (int) $comment->comment_parent;\n\t\t}\n\n\t\tif ( in_array( 'author', $fields, true ) ) {\n\t\t\t$data['author'] = (int) $comment->user_id;\n\t\t}\n\n\t\tif ( in_array( 'author_name', $fields, true ) ) {\n\t\t\t$data['author_name'] = $comment->comment_author;\n\t\t}\n\n\t\tif ( in_array( 'author_email', $fields, true ) ) {\n\t\t\t$data['author_email'] = $comment->comment_author_email;\n\t\t}\n\n\t\tif ( in_array( 'author_url', $fields, true ) ) {\n\t\t\t$data['author_url'] = $comment->comment_author_url;\n\t\t}\n\n\t\tif ( in_array( 'author_ip', $fields, true ) ) {\n\t\t\t$data['author_ip'] = $comment->comment_author_IP;\n\t\t}\n\n\t\tif ( in_array( 'author_user_agent', $fields, true ) ) {\n\t\t\t$data['author_user_agent'] = $comment->comment_agent;\n\t\t}\n\n\t\tif ( in_array( 'date', $fields, true ) ) {\n\t\t\t$data['date'] = mysql_to_rfc3339( $comment->comment_date );\n\t\t}\n\n\t\tif ( in_array( 'date_gmt', $fields, true ) ) {\n\t\t\t$data['date_gmt'] = mysql_to_rfc3339( $comment->comment_date_gmt );\n\t\t}\n\n\t\tif ( in_array( 'content', $fields, true ) ) {\n\t\t\t$data['content'] = array(\n\t\t\t\t/** This filter is documented in wp-includes/comment-template.php */\n\t\t\t\t'rendered' => apply_filters( 'comment_text', $comment->comment_content, $comment ),\n\t\t\t\t'raw'      => $comment->comment_content,\n\t\t\t);\n\t\t}\n\n\t\tif ( in_array( 'link', $fields, true ) ) {\n\t\t\t$data['link'] = get_comment_link( $comment );\n\t\t}\n\n\t\tif ( in_array( 'status', $fields, true ) ) {\n\t\t\t$data['status'] = $this->prepare_status_response( $comment->comment_approved );\n\t\t}\n\n\t\tif ( in_array( 'type', $fields, true ) ) {\n\t\t\t$data['type'] = get_comment_type( $comment->comment_ID );\n\t\t}\n\n\t\tif ( in_array( 'author_avatar_urls', $fields, true ) ) {\n\t\t\t$data['author_avatar_urls'] = rest_get_avatar_urls( $comment );\n\t\t}\n\n\t\tif ( in_array( 'meta', $fields, true ) ) {\n\t\t\t$data['meta'] = $this->meta->get_value( $comment->comment_ID, $request );\n\t\t}\n\n\t\t$context = ! empty( $request['context'] ) ? $request['context'] : 'view';\n\t\t$data    = $this->add_additional_fields_to_object( $data, $request );\n\t\t$data    = $this->filter_response_by_context( $data, $context );\n\n\t\t// Wrap the data in a response object.\n\t\t$response = rest_ensure_response( $data );\n\n\t\t$response->add_links( $this->prepare_links( $comment ) );\n\n\t\t/**\n\t\t * Filters a comment returned from the API.\n\t\t *\n\t\t * Allows modification of the comment right before it is returned.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_REST_Response  $response The response object.\n\t\t * @param WP_Comment        $comment  The original comment object.\n\t\t * @param WP_REST_Request   $request  Request used to generate the response.\n\t\t */\n\t\treturn apply_filters( 'rest_prepare_comment', $response, $comment, $request );\n\t}\n\n\t/**\n\t * Prepares links for the request.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Comment $comment Comment object.\n\t * @return array Links for the given comment.\n\t */\n\tprotected function prepare_links( $comment ) {\n\t\t$links = array(\n\t\t\t'self'       => array(\n\t\t\t\t'href' => rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $comment->comment_ID ) ),\n\t\t\t),\n\t\t\t'collection' => array(\n\t\t\t\t'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),\n\t\t\t),\n\t\t);\n\n\t\tif ( 0 !== (int) $comment->user_id ) {\n\t\t\t$links['author'] = array(\n\t\t\t\t'href'       => rest_url( 'wp/v2/users/' . $comment->user_id ),\n\t\t\t\t'embeddable' => true,\n\t\t\t);\n\t\t}\n\n\t\tif ( 0 !== (int) $comment->comment_post_ID ) {\n\t\t\t$post = get_post( $comment->comment_post_ID );\n\n\t\t\tif ( ! empty( $post->ID ) ) {\n\t\t\t\t$obj  = get_post_type_object( $post->post_type );\n\t\t\t\t$base = ! empty( $obj->rest_base ) ? $obj->rest_base : $obj->name;\n\n\t\t\t\t$links['up'] = array(\n\t\t\t\t\t'href'       => rest_url( 'wp/v2/' . $base . '/' . $comment->comment_post_ID ),\n\t\t\t\t\t'embeddable' => true,\n\t\t\t\t\t'post_type'  => $post->post_type,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( 0 !== (int) $comment->comment_parent ) {\n\t\t\t$links['in-reply-to'] = array(\n\t\t\t\t'href'       => rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $comment->comment_parent ) ),\n\t\t\t\t'embeddable' => true,\n\t\t\t);\n\t\t}\n\n\t\t// Only grab one comment to verify the comment has children.\n\t\t$comment_children = $comment->get_children(\n\t\t\tarray(\n\t\t\t\t'number' => 1,\n\t\t\t\t'count'  => true,\n\t\t\t)\n\t\t);\n\n\t\tif ( ! empty( $comment_children ) ) {\n\t\t\t$args = array(\n\t\t\t\t'parent' => $comment->comment_ID,\n\t\t\t);\n\n\t\t\t$rest_url = add_query_arg( $args, rest_url( $this->namespace . '/' . $this->rest_base ) );\n\n\t\t\t$links['children'] = array(\n\t\t\t\t'href' => $rest_url,\n\t\t\t);\n\t\t}\n\n\t\treturn $links;\n\t}\n\n\t/**\n\t * Prepends internal property prefix to query parameters to match our response fields.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $query_param Query parameter.\n\t * @return string The normalized query parameter.\n\t */\n\tprotected function normalize_query_param( $query_param ) {\n\t\t$prefix = 'comment_';\n\n\t\tswitch ( $query_param ) {\n\t\t\tcase 'id':\n\t\t\t\t$normalized = $prefix . 'ID';\n\t\t\t\tbreak;\n\t\t\tcase 'post':\n\t\t\t\t$normalized = $prefix . 'post_ID';\n\t\t\t\tbreak;\n\t\t\tcase 'parent':\n\t\t\t\t$normalized = $prefix . 'parent';\n\t\t\t\tbreak;\n\t\t\tcase 'include':\n\t\t\t\t$normalized = 'comment__in';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$normalized = $prefix . $query_param;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $normalized;\n\t}\n\n\t/**\n\t * Checks comment_approved to set comment status for single comment output.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string|int $comment_approved comment status.\n\t * @return string Comment status.\n\t */\n\tprotected function prepare_status_response( $comment_approved ) {\n\n\t\tswitch ( $comment_approved ) {\n\t\t\tcase 'hold':\n\t\t\tcase '0':\n\t\t\t\t$status = 'hold';\n\t\t\t\tbreak;\n\n\t\t\tcase 'approve':\n\t\t\tcase '1':\n\t\t\t\t$status = 'approved';\n\t\t\t\tbreak;\n\n\t\t\tcase 'spam':\n\t\t\tcase 'trash':\n\t\t\tdefault:\n\t\t\t\t$status = $comment_approved;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $status;\n\t}\n\n\t/**\n\t * Prepares a single comment to be inserted into the database.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Request object.\n\t * @return array|WP_Error Prepared comment, otherwise WP_Error object.\n\t */\n\tprotected function prepare_item_for_database( $request ) {\n\t\t$prepared_comment = array();\n\n\t\t/*\n\t\t * Allow the comment_content to be set via the 'content' or\n\t\t * the 'content.raw' properties of the Request object.\n\t\t */\n\t\tif ( isset( $request['content'] ) && is_string( $request['content'] ) ) {\n\t\t\t$prepared_comment['comment_content'] = $request['content'];\n\t\t} elseif ( isset( $request['content']['raw'] ) && is_string( $request['content']['raw'] ) ) {\n\t\t\t$prepared_comment['comment_content'] = $request['content']['raw'];\n\t\t}\n\n\t\tif ( isset( $request['post'] ) ) {\n\t\t\t$prepared_comment['comment_post_ID'] = (int) $request['post'];\n\t\t}\n\n\t\tif ( isset( $request['parent'] ) ) {\n\t\t\t$prepared_comment['comment_parent'] = $request['parent'];\n\t\t}\n\n\t\tif ( isset( $request['author'] ) ) {\n\t\t\t$user = new WP_User( $request['author'] );\n\n\t\t\tif ( $user->exists() ) {\n\t\t\t\t$prepared_comment['user_id']              = $user->ID;\n\t\t\t\t$prepared_comment['comment_author']       = $user->display_name;\n\t\t\t\t$prepared_comment['comment_author_email'] = $user->user_email;\n\t\t\t\t$prepared_comment['comment_author_url']   = $user->user_url;\n\t\t\t} else {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_comment_author_invalid',\n\t\t\t\t\t__( 'Invalid comment author ID.' ),\n\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $request['author_name'] ) ) {\n\t\t\t$prepared_comment['comment_author'] = $request['author_name'];\n\t\t}\n\n\t\tif ( isset( $request['author_email'] ) ) {\n\t\t\t$prepared_comment['comment_author_email'] = $request['author_email'];\n\t\t}\n\n\t\tif ( isset( $request['author_url'] ) ) {\n\t\t\t$prepared_comment['comment_author_url'] = $request['author_url'];\n\t\t}\n\n\t\tif ( isset( $request['author_ip'] ) && current_user_can( 'moderate_comments' ) ) {\n\t\t\t$prepared_comment['comment_author_IP'] = $request['author_ip'];\n\t\t} elseif ( ! empty( $_SERVER['REMOTE_ADDR'] ) && rest_is_ip_address( $_SERVER['REMOTE_ADDR'] ) ) {\n\t\t\t$prepared_comment['comment_author_IP'] = $_SERVER['REMOTE_ADDR'];\n\t\t} else {\n\t\t\t$prepared_comment['comment_author_IP'] = '127.0.0.1';\n\t\t}\n\n\t\tif ( ! empty( $request['author_user_agent'] ) ) {\n\t\t\t$prepared_comment['comment_agent'] = $request['author_user_agent'];\n\t\t} elseif ( $request->get_header( 'user_agent' ) ) {\n\t\t\t$prepared_comment['comment_agent'] = $request->get_header( 'user_agent' );\n\t\t}\n\n\t\tif ( ! empty( $request['date'] ) ) {\n\t\t\t$date_data = rest_get_date_with_gmt( $request['date'] );\n\n\t\t\tif ( ! empty( $date_data ) ) {\n\t\t\t\tlist( $prepared_comment['comment_date'], $prepared_comment['comment_date_gmt'] ) = $date_data;\n\t\t\t}\n\t\t} elseif ( ! empty( $request['date_gmt'] ) ) {\n\t\t\t$date_data = rest_get_date_with_gmt( $request['date_gmt'], true );\n\n\t\t\tif ( ! empty( $date_data ) ) {\n\t\t\t\tlist( $prepared_comment['comment_date'], $prepared_comment['comment_date_gmt'] ) = $date_data;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters a comment after it is prepared for the database.\n\t\t *\n\t\t * Allows modification of the comment right after it is prepared for the database.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param array           $prepared_comment The prepared comment data for `wp_insert_comment`.\n\t\t * @param WP_REST_Request $request          The current request.\n\t\t */\n\t\treturn apply_filters( 'rest_preprocess_comment', $prepared_comment, $request );\n\t}\n\n\t/**\n\t * Retrieves the comment's schema, conforming to JSON Schema.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$schema = array(\n\t\t\t'$schema'    => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title'      => 'comment',\n\t\t\t'type'       => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'id'                => array(\n\t\t\t\t\t'description' => __( 'Unique identifier for the object.' ),\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'author'            => array(\n\t\t\t\t\t'description' => __( 'The ID of the user object, if author was a user.' ),\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t\t'author_email'      => array(\n\t\t\t\t\t'description' => __( 'Email address for the object author.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'email',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => array( $this, 'check_comment_author_email' ),\n\t\t\t\t\t\t'validate_callback' => null, // Skip built-in validation of 'email'.\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'author_ip'         => array(\n\t\t\t\t\t'description' => __( 'IP address for the object author.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'ip',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t),\n\t\t\t\t'author_name'       => array(\n\t\t\t\t\t'description' => __( 'Display name for the object author.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'author_url'        => array(\n\t\t\t\t\t'description' => __( 'URL for the object author.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t\t'author_user_agent' => array(\n\t\t\t\t\t'description' => __( 'User agent for the object author.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'content'           => array(\n\t\t\t\t\t'description' => __( 'The content for the object.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database().\n\t\t\t\t\t\t'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database().\n\t\t\t\t\t),\n\t\t\t\t\t'properties'  => array(\n\t\t\t\t\t\t'raw'      => array(\n\t\t\t\t\t\t\t'description' => __( 'Content for the object, as it exists in the database.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'rendered' => array(\n\t\t\t\t\t\t\t'description' => __( 'HTML content for the object, transformed for display.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'date'              => array(\n\t\t\t\t\t'description' => __( \"The date the object was published, in the site's timezone.\" ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'date-time',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t\t'date_gmt'          => array(\n\t\t\t\t\t'description' => __( 'The date the object was published, as GMT.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'date-time',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'link'              => array(\n\t\t\t\t\t'description' => __( 'URL to the object.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'parent'            => array(\n\t\t\t\t\t'description' => __( 'The ID for the parent of the object.' ),\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'default'     => 0,\n\t\t\t\t),\n\t\t\t\t'post'              => array(\n\t\t\t\t\t'description' => __( 'The ID of the associated post object.' ),\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'default'     => 0,\n\t\t\t\t),\n\t\t\t\t'status'            => array(\n\t\t\t\t\t'description' => __( 'State of the object.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'sanitize_key',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'type'              => array(\n\t\t\t\t\t'description' => __( 'Type of Comment for the object.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\tif ( get_option( 'show_avatars' ) ) {\n\t\t\t$avatar_properties = array();\n\n\t\t\t$avatar_sizes = rest_get_avatar_sizes();\n\n\t\t\tforeach ( $avatar_sizes as $size ) {\n\t\t\t\t$avatar_properties[ $size ] = array(\n\t\t\t\t\t/* translators: %d: Avatar image size in pixels. */\n\t\t\t\t\t'description' => sprintf( __( 'Avatar URL with image size of %d pixels.' ), $size ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$schema['properties']['author_avatar_urls'] = array(\n\t\t\t\t'description' => __( 'Avatar URLs for the object author.' ),\n\t\t\t\t'type'        => 'object',\n\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t'readonly'    => true,\n\t\t\t\t'properties'  => $avatar_properties,\n\t\t\t);\n\t\t}\n\n\t\t$schema['properties']['meta'] = $this->meta->get_field_schema();\n\n\t\t$this->schema = $schema;\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}\n\n\t/**\n\t * Retrieves the query params for collections.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Comments collection parameters.\n\t */\n\tpublic function get_collection_params() {\n\t\t$query_params = parent::get_collection_params();\n\n\t\t$query_params['context']['default'] = 'view';\n\n\t\t$query_params['after'] = array(\n\t\t\t'description' => __( 'Limit response to comments published after a given ISO8601 compliant date.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'format'      => 'date-time',\n\t\t);\n\n\t\t$query_params['author'] = array(\n\t\t\t'description' => __( 'Limit result set to comments assigned to specific user IDs. Requires authorization.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t);\n\n\t\t$query_params['author_exclude'] = array(\n\t\t\t'description' => __( 'Ensure result set excludes comments assigned to specific user IDs. Requires authorization.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t);\n\n\t\t$query_params['author_email'] = array(\n\t\t\t'default'     => null,\n\t\t\t'description' => __( 'Limit result set to that from a specific author email. Requires authorization.' ),\n\t\t\t'format'      => 'email',\n\t\t\t'type'        => 'string',\n\t\t);\n\n\t\t$query_params['before'] = array(\n\t\t\t'description' => __( 'Limit response to comments published before a given ISO8601 compliant date.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'format'      => 'date-time',\n\t\t);\n\n\t\t$query_params['exclude'] = array(\n\t\t\t'description' => __( 'Ensure result set excludes specific IDs.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'default'     => array(),\n\t\t);\n\n\t\t$query_params['include'] = array(\n\t\t\t'description' => __( 'Limit result set to specific IDs.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'default'     => array(),\n\t\t);\n\n\t\t$query_params['offset'] = array(\n\t\t\t'description' => __( 'Offset the result set by a specific number of items.' ),\n\t\t\t'type'        => 'integer',\n\t\t);\n\n\t\t$query_params['order'] = array(\n\t\t\t'description' => __( 'Order sort attribute ascending or descending.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'default'     => 'desc',\n\t\t\t'enum'        => array(\n\t\t\t\t'asc',\n\t\t\t\t'desc',\n\t\t\t),\n\t\t);\n\n\t\t$query_params['orderby'] = array(\n\t\t\t'description' => __( 'Sort collection by object attribute.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'default'     => 'date_gmt',\n\t\t\t'enum'        => array(\n\t\t\t\t'date',\n\t\t\t\t'date_gmt',\n\t\t\t\t'id',\n\t\t\t\t'include',\n\t\t\t\t'post',\n\t\t\t\t'parent',\n\t\t\t\t'type',\n\t\t\t),\n\t\t);\n\n\t\t$query_params['parent'] = array(\n\t\t\t'default'     => array(),\n\t\t\t'description' => __( 'Limit result set to comments of specific parent IDs.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t);\n\n\t\t$query_params['parent_exclude'] = array(\n\t\t\t'default'     => array(),\n\t\t\t'description' => __( 'Ensure result set excludes specific parent IDs.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t);\n\n\t\t$query_params['post'] = array(\n\t\t\t'default'     => array(),\n\t\t\t'description' => __( 'Limit result set to comments assigned to specific post IDs.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t);\n\n\t\t$query_params['status'] = array(\n\t\t\t'default'           => 'approve',\n\t\t\t'description'       => __( 'Limit result set to comments assigned a specific status. Requires authorization.' ),\n\t\t\t'sanitize_callback' => 'sanitize_key',\n\t\t\t'type'              => 'string',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$query_params['type'] = array(\n\t\t\t'default'           => 'comment',\n\t\t\t'description'       => __( 'Limit result set to comments assigned a specific type. Requires authorization.' ),\n\t\t\t'sanitize_callback' => 'sanitize_key',\n\t\t\t'type'              => 'string',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$query_params['password'] = array(\n\t\t\t'description' => __( 'The password for the post if it is password protected.' ),\n\t\t\t'type'        => 'string',\n\t\t);\n\n\t\t/**\n\t\t * Filter collection parameters for the comments controller.\n\t\t *\n\t\t * This filter registers the collection parameter, but does not map the\n\t\t * collection parameter to an internal WP_Comment_Query parameter. Use the\n\t\t * `rest_comment_query` filter to set WP_Comment_Query parameters.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param array $query_params JSON Schema-formatted collection parameters.\n\t\t */\n\t\treturn apply_filters( 'rest_comment_collection_params', $query_params );\n\t}\n\n\t/**\n\t * Sets the comment_status of a given comment object when creating or updating a comment.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string|int $new_status New comment status.\n\t * @param int        $comment_id Comment ID.\n\t * @return bool Whether the status was changed.\n\t */\n\tprotected function handle_status_param( $new_status, $comment_id ) {\n\t\t$old_status = wp_get_comment_status( $comment_id );\n\n\t\tif ( $new_status === $old_status ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch ( $new_status ) {\n\t\t\tcase 'approved':\n\t\t\tcase 'approve':\n\t\t\tcase '1':\n\t\t\t\t$changed = wp_set_comment_status( $comment_id, 'approve' );\n\t\t\t\tbreak;\n\t\t\tcase 'hold':\n\t\t\tcase '0':\n\t\t\t\t$changed = wp_set_comment_status( $comment_id, 'hold' );\n\t\t\t\tbreak;\n\t\t\tcase 'spam':\n\t\t\t\t$changed = wp_spam_comment( $comment_id );\n\t\t\t\tbreak;\n\t\t\tcase 'unspam':\n\t\t\t\t$changed = wp_unspam_comment( $comment_id );\n\t\t\t\tbreak;\n\t\t\tcase 'trash':\n\t\t\t\t$changed = wp_trash_comment( $comment_id );\n\t\t\t\tbreak;\n\t\t\tcase 'untrash':\n\t\t\t\t$changed = wp_untrash_comment( $comment_id );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$changed = false;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $changed;\n\t}\n\n\t/**\n\t * Checks if the post can be read.\n\t *\n\t * Correctly handles posts with the inherit status.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Post         $post    Post object.\n\t * @param WP_REST_Request $request Request data to check.\n\t * @return bool Whether post can be read.\n\t */\n\tprotected function check_read_post_permission( $post, $request ) {\n\t\t$post_type = get_post_type_object( $post->post_type );\n\n\t\t// Return false if custom post type doesn't exist\n\t\tif ( ! $post_type ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$posts_controller = $post_type->get_rest_controller();\n\n\t\t// Ensure the posts controller is specifically a WP_REST_Posts_Controller instance\n\t\t// before using methods specific to that controller.\n\t\tif ( ! $posts_controller instanceof WP_REST_Posts_Controller ) {\n\t\t\t$posts_controller = new WP_REST_Posts_Controller( $post->post_type );\n\t\t}\n\n\t\t$has_password_filter = false;\n\n\t\t// Only check password if a specific post was queried for or a single comment\n\t\t$requested_post    = ! empty( $request['post'] ) && ( ! is_array( $request['post'] ) || 1 === count( $request['post'] ) );\n\t\t$requested_comment = ! empty( $request['id'] );\n\t\tif ( ( $requested_post || $requested_comment ) && $posts_controller->can_access_password_content( $post, $request ) ) {\n\t\t\tadd_filter( 'post_password_required', '__return_false' );\n\n\t\t\t$has_password_filter = true;\n\t\t}\n\n\t\tif ( post_password_required( $post ) ) {\n\t\t\t$result = current_user_can( 'edit_post', $post->ID );\n\t\t} else {\n\t\t\t$result = $posts_controller->check_read_permission( $post );\n\t\t}\n\n\t\tif ( $has_password_filter ) {\n\t\t\tremove_filter( 'post_password_required', '__return_false' );\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Checks if the comment can be read.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Comment      $comment Comment object.\n\t * @param WP_REST_Request $request Request data to check.\n\t * @return bool Whether the comment can be read.\n\t */\n\tprotected function check_read_permission( $comment, $request ) {\n\t\tif ( ! empty( $comment->comment_post_ID ) ) {\n\t\t\t$post = get_post( $comment->comment_post_ID );\n\t\t\tif ( $post ) {\n\t\t\t\tif ( $this->check_read_post_permission( $post, $request ) && 1 === (int) $comment->comment_approved ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( 0 === get_current_user_id() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( empty( $comment->comment_post_ID ) && ! current_user_can( 'moderate_comments' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! empty( $comment->user_id ) && get_current_user_id() === (int) $comment->user_id ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn current_user_can( 'edit_comment', $comment->comment_ID );\n\t}\n\n\t/**\n\t * Checks if a comment can be edited or deleted.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Comment $comment Comment object.\n\t * @return bool Whether the comment can be edited or deleted.\n\t */\n\tprotected function check_edit_permission( $comment ) {\n\t\tif ( 0 === (int) get_current_user_id() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( current_user_can( 'moderate_comments' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn current_user_can( 'edit_comment', $comment->comment_ID );\n\t}\n\n\t/**\n\t * Checks a comment author email for validity.\n\t *\n\t * Accepts either a valid email address or empty string as a valid comment\n\t * author email address. Setting the comment author email to an empty\n\t * string is allowed when a comment is being updated.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string          $value   Author email value submitted.\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @param string          $param   The parameter name.\n\t * @return string|WP_Error The sanitized email address, if valid,\n\t *                         otherwise an error.\n\t */\n\tpublic function check_comment_author_email( $value, $request, $param ) {\n\t\t$email = (string) $value;\n\t\tif ( empty( $email ) ) {\n\t\t\treturn $email;\n\t\t}\n\n\t\t$check_email = rest_validate_request_arg( $email, $request, $param );\n\t\tif ( is_wp_error( $check_email ) ) {\n\t\t\treturn $check_email;\n\t\t}\n\n\t\treturn $email;\n\t}\n}\n", "num_lines": 1872}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.7.0\n */\n\n/**\n * Core base controller for managing and interacting with REST API items.\n *\n * @since 4.7.0\n */\nabstract class WP_REST_Controller {\n\n\t/**\n\t * The namespace of this controller's route.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tprotected $namespace;\n\n\t/**\n\t * The base of this controller's route.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tprotected $rest_base;\n\n\t/**\n\t * Cached results of get_item_schema.\n\t *\n\t * @since 5.3.0\n\t * @var array\n\t */\n\tprotected $schema;\n\n\t/**\n\t * Registers the routes for the objects of the controller.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see register_rest_route()\n\t */\n\tpublic function register_routes() {\n\t\t_doing_it_wrong(\n\t\t\t'WP_REST_Controller::register_routes',\n\t\t\t/* translators: %s: register_routes() */\n\t\t\tsprintf( __( \"Method '%s' must be overridden.\" ), __METHOD__ ),\n\t\t\t'4.7'\n\t\t);\n\t}\n\n\t/**\n\t * Checks if a given request has access to get items.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access, WP_Error object otherwise.\n\t */\n\tpublic function get_items_permissions_check( $request ) {\n\t\treturn new WP_Error(\n\t\t\t'invalid-method',\n\t\t\t/* translators: %s: Method name. */\n\t\t\tsprintf( __( \"Method '%s' not implemented. Must be overridden in subclass.\" ), __METHOD__ ),\n\t\t\tarray( 'status' => 405 )\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves a collection of items.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_items( $request ) {\n\t\treturn new WP_Error(\n\t\t\t'invalid-method',\n\t\t\t/* translators: %s: Method name. */\n\t\t\tsprintf( __( \"Method '%s' not implemented. Must be overridden in subclass.\" ), __METHOD__ ),\n\t\t\tarray( 'status' => 405 )\n\t\t);\n\t}\n\n\t/**\n\t * Checks if a given request has access to get a specific item.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.\n\t */\n\tpublic function get_item_permissions_check( $request ) {\n\t\treturn new WP_Error(\n\t\t\t'invalid-method',\n\t\t\t/* translators: %s: Method name. */\n\t\t\tsprintf( __( \"Method '%s' not implemented. Must be overridden in subclass.\" ), __METHOD__ ),\n\t\t\tarray( 'status' => 405 )\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves one item from the collection.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_item( $request ) {\n\t\treturn new WP_Error(\n\t\t\t'invalid-method',\n\t\t\t/* translators: %s: Method name. */\n\t\t\tsprintf( __( \"Method '%s' not implemented. Must be overridden in subclass.\" ), __METHOD__ ),\n\t\t\tarray( 'status' => 405 )\n\t\t);\n\t}\n\n\t/**\n\t * Checks if a given request has access to create items.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to create items, WP_Error object otherwise.\n\t */\n\tpublic function create_item_permissions_check( $request ) {\n\t\treturn new WP_Error(\n\t\t\t'invalid-method',\n\t\t\t/* translators: %s: Method name. */\n\t\t\tsprintf( __( \"Method '%s' not implemented. Must be overridden in subclass.\" ), __METHOD__ ),\n\t\t\tarray( 'status' => 405 )\n\t\t);\n\t}\n\n\t/**\n\t * Creates one item from the collection.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function create_item( $request ) {\n\t\treturn new WP_Error(\n\t\t\t'invalid-method',\n\t\t\t/* translators: %s: Method name. */\n\t\t\tsprintf( __( \"Method '%s' not implemented. Must be overridden in subclass.\" ), __METHOD__ ),\n\t\t\tarray( 'status' => 405 )\n\t\t);\n\t}\n\n\t/**\n\t * Checks if a given request has access to update a specific item.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise.\n\t */\n\tpublic function update_item_permissions_check( $request ) {\n\t\treturn new WP_Error(\n\t\t\t'invalid-method',\n\t\t\t/* translators: %s: Method name. */\n\t\t\tsprintf( __( \"Method '%s' not implemented. Must be overridden in subclass.\" ), __METHOD__ ),\n\t\t\tarray( 'status' => 405 )\n\t\t);\n\t}\n\n\t/**\n\t * Updates one item from the collection.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function update_item( $request ) {\n\t\treturn new WP_Error(\n\t\t\t'invalid-method',\n\t\t\t/* translators: %s: Method name. */\n\t\t\tsprintf( __( \"Method '%s' not implemented. Must be overridden in subclass.\" ), __METHOD__ ),\n\t\t\tarray( 'status' => 405 )\n\t\t);\n\t}\n\n\t/**\n\t * Checks if a given request has access to delete a specific item.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise.\n\t */\n\tpublic function delete_item_permissions_check( $request ) {\n\t\treturn new WP_Error(\n\t\t\t'invalid-method',\n\t\t\t/* translators: %s: Method name. */\n\t\t\tsprintf( __( \"Method '%s' not implemented. Must be overridden in subclass.\" ), __METHOD__ ),\n\t\t\tarray( 'status' => 405 )\n\t\t);\n\t}\n\n\t/**\n\t * Deletes one item from the collection.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function delete_item( $request ) {\n\t\treturn new WP_Error(\n\t\t\t'invalid-method',\n\t\t\t/* translators: %s: Method name. */\n\t\t\tsprintf( __( \"Method '%s' not implemented. Must be overridden in subclass.\" ), __METHOD__ ),\n\t\t\tarray( 'status' => 405 )\n\t\t);\n\t}\n\n\t/**\n\t * Prepares one item for create or update operation.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Request object.\n\t * @return object|WP_Error The prepared item, or WP_Error object on failure.\n\t */\n\tprotected function prepare_item_for_database( $request ) {\n\t\treturn new WP_Error(\n\t\t\t'invalid-method',\n\t\t\t/* translators: %s: Method name. */\n\t\t\tsprintf( __( \"Method '%s' not implemented. Must be overridden in subclass.\" ), __METHOD__ ),\n\t\t\tarray( 'status' => 405 )\n\t\t);\n\t}\n\n\t/**\n\t * Prepares the item for the REST response.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param mixed           $item    WordPress representation of the item.\n\t * @param WP_REST_Request $request Request object.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function prepare_item_for_response( $item, $request ) {\n\t\treturn new WP_Error(\n\t\t\t'invalid-method',\n\t\t\t/* translators: %s: Method name. */\n\t\t\tsprintf( __( \"Method '%s' not implemented. Must be overridden in subclass.\" ), __METHOD__ ),\n\t\t\tarray( 'status' => 405 )\n\t\t);\n\t}\n\n\t/**\n\t * Prepares a response for insertion into a collection.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Response $response Response object.\n\t * @return array|mixed Response data, ready for insertion into collection data.\n\t */\n\tpublic function prepare_response_for_collection( $response ) {\n\t\tif ( ! ( $response instanceof WP_REST_Response ) ) {\n\t\t\treturn $response;\n\t\t}\n\n\t\t$data   = (array) $response->get_data();\n\t\t$server = rest_get_server();\n\t\t$links  = $server::get_compact_response_links( $response );\n\n\t\tif ( ! empty( $links ) ) {\n\t\t\t$data['_links'] = $links;\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Filters a response based on the context defined in the schema.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array  $data    Response data to filter.\n\t * @param string $context Context defined in the schema.\n\t * @return array Filtered response.\n\t */\n\tpublic function filter_response_by_context( $data, $context ) {\n\n\t\t$schema = $this->get_item_schema();\n\n\t\treturn rest_filter_response_by_context( $data, $schema, $context );\n\t}\n\n\t/**\n\t * Retrieves the item's schema, conforming to JSON Schema.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\treturn $this->add_additional_fields_schema( array() );\n\t}\n\n\t/**\n\t * Retrieves the item's schema for display / public consumption purposes.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Public item schema data.\n\t */\n\tpublic function get_public_item_schema() {\n\n\t\t$schema = $this->get_item_schema();\n\n\t\tif ( ! empty( $schema['properties'] ) ) {\n\t\t\tforeach ( $schema['properties'] as &$property ) {\n\t\t\t\tunset( $property['arg_options'] );\n\t\t\t}\n\t\t}\n\n\t\treturn $schema;\n\t}\n\n\t/**\n\t * Retrieves the query params for the collections.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Query parameters for the collection.\n\t */\n\tpublic function get_collection_params() {\n\t\treturn array(\n\t\t\t'context'  => $this->get_context_param(),\n\t\t\t'page'     => array(\n\t\t\t\t'description'       => __( 'Current page of the collection.' ),\n\t\t\t\t'type'              => 'integer',\n\t\t\t\t'default'           => 1,\n\t\t\t\t'sanitize_callback' => 'absint',\n\t\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t\t\t'minimum'           => 1,\n\t\t\t),\n\t\t\t'per_page' => array(\n\t\t\t\t'description'       => __( 'Maximum number of items to be returned in result set.' ),\n\t\t\t\t'type'              => 'integer',\n\t\t\t\t'default'           => 10,\n\t\t\t\t'minimum'           => 1,\n\t\t\t\t'maximum'           => 100,\n\t\t\t\t'sanitize_callback' => 'absint',\n\t\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t\t),\n\t\t\t'search'   => array(\n\t\t\t\t'description'       => __( 'Limit results to those matching a string.' ),\n\t\t\t\t'type'              => 'string',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t\t),\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves the magical context param.\n\t *\n\t * Ensures consistent descriptions between endpoints, and populates enum from schema.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $args Optional. Additional arguments for context parameter. Default empty array.\n\t * @return array Context parameter details.\n\t */\n\tpublic function get_context_param( $args = array() ) {\n\t\t$param_details = array(\n\t\t\t'description'       => __( 'Scope under which the request is made; determines fields present in response.' ),\n\t\t\t'type'              => 'string',\n\t\t\t'sanitize_callback' => 'sanitize_key',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$schema = $this->get_item_schema();\n\n\t\tif ( empty( $schema['properties'] ) ) {\n\t\t\treturn array_merge( $param_details, $args );\n\t\t}\n\n\t\t$contexts = array();\n\n\t\tforeach ( $schema['properties'] as $attributes ) {\n\t\t\tif ( ! empty( $attributes['context'] ) ) {\n\t\t\t\t$contexts = array_merge( $contexts, $attributes['context'] );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $contexts ) ) {\n\t\t\t$param_details['enum'] = array_unique( $contexts );\n\t\t\trsort( $param_details['enum'] );\n\t\t}\n\n\t\treturn array_merge( $param_details, $args );\n\t}\n\n\t/**\n\t * Adds the values from additional fields to a data object.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array           $prepared Prepared response array.\n\t * @param WP_REST_Request $request  Full details about the request.\n\t * @return array Modified data object with additional fields.\n\t */\n\tprotected function add_additional_fields_to_object( $prepared, $request ) {\n\n\t\t$additional_fields = $this->get_additional_fields();\n\n\t\t$requested_fields = $this->get_fields_for_response( $request );\n\n\t\tforeach ( $additional_fields as $field_name => $field_options ) {\n\t\t\tif ( ! $field_options['get_callback'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! rest_is_field_included( $field_name, $requested_fields ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$prepared[ $field_name ] = call_user_func( $field_options['get_callback'], $prepared, $field_name, $request, $this->get_object_type() );\n\t\t}\n\n\t\treturn $prepared;\n\t}\n\n\t/**\n\t * Updates the values of additional fields added to a data object.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param object          $object  Data model like WP_Term or WP_Post.\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return bool|WP_Error True on success, WP_Error object if a field cannot be updated.\n\t */\n\tprotected function update_additional_fields_for_object( $object, $request ) {\n\t\t$additional_fields = $this->get_additional_fields();\n\n\t\tforeach ( $additional_fields as $field_name => $field_options ) {\n\t\t\tif ( ! $field_options['update_callback'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Don't run the update callbacks if the data wasn't passed in the request.\n\t\t\tif ( ! isset( $request[ $field_name ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$result = call_user_func( $field_options['update_callback'], $request[ $field_name ], $object, $field_name, $request, $this->get_object_type() );\n\n\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Adds the schema from additional fields to a schema array.\n\t *\n\t * The type of object is inferred from the passed schema.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $schema Schema array.\n\t * @return array Modified Schema array.\n\t */\n\tprotected function add_additional_fields_schema( $schema ) {\n\t\tif ( empty( $schema['title'] ) ) {\n\t\t\treturn $schema;\n\t\t}\n\n\t\t// Can't use $this->get_object_type otherwise we cause an inf loop.\n\t\t$object_type = $schema['title'];\n\n\t\t$additional_fields = $this->get_additional_fields( $object_type );\n\n\t\tforeach ( $additional_fields as $field_name => $field_options ) {\n\t\t\tif ( ! $field_options['schema'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$schema['properties'][ $field_name ] = $field_options['schema'];\n\t\t}\n\n\t\treturn $schema;\n\t}\n\n\t/**\n\t * Retrieves all of the registered additional fields for a given object-type.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $object_type Optional. The object type.\n\t * @return array Registered additional fields (if any), empty array if none or if the object type could\n\t *               not be inferred.\n\t */\n\tprotected function get_additional_fields( $object_type = null ) {\n\n\t\tif ( ! $object_type ) {\n\t\t\t$object_type = $this->get_object_type();\n\t\t}\n\n\t\tif ( ! $object_type ) {\n\t\t\treturn array();\n\t\t}\n\n\t\tglobal $wp_rest_additional_fields;\n\n\t\tif ( ! $wp_rest_additional_fields || ! isset( $wp_rest_additional_fields[ $object_type ] ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\treturn $wp_rest_additional_fields[ $object_type ];\n\t}\n\n\t/**\n\t * Retrieves the object type this controller is responsible for managing.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return string Object type for the controller.\n\t */\n\tprotected function get_object_type() {\n\t\t$schema = $this->get_item_schema();\n\n\t\tif ( ! $schema || ! isset( $schema['title'] ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $schema['title'];\n\t}\n\n\t/**\n\t * Gets an array of fields to be included on the response.\n\t *\n\t * Included fields are based on item schema and `_fields=` request argument.\n\t *\n\t * @since 4.9.6\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return array Fields to be included in the response.\n\t */\n\tpublic function get_fields_for_response( $request ) {\n\t\t$schema     = $this->get_item_schema();\n\t\t$properties = isset( $schema['properties'] ) ? $schema['properties'] : array();\n\n\t\t$additional_fields = $this->get_additional_fields();\n\n\t\tforeach ( $additional_fields as $field_name => $field_options ) {\n\t\t\t// For back-compat, include any field with an empty schema\n\t\t\t// because it won't be present in $this->get_item_schema().\n\t\t\tif ( is_null( $field_options['schema'] ) ) {\n\t\t\t\t$properties[ $field_name ] = $field_options;\n\t\t\t}\n\t\t}\n\n\t\t// Exclude fields that specify a different context than the request context.\n\t\t$context = $request['context'];\n\t\tif ( $context ) {\n\t\t\tforeach ( $properties as $name => $options ) {\n\t\t\t\tif ( ! empty( $options['context'] ) && ! in_array( $context, $options['context'], true ) ) {\n\t\t\t\t\tunset( $properties[ $name ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$fields = array_keys( $properties );\n\n\t\tif ( ! isset( $request['_fields'] ) ) {\n\t\t\treturn $fields;\n\t\t}\n\t\t$requested_fields = wp_parse_list( $request['_fields'] );\n\t\tif ( 0 === count( $requested_fields ) ) {\n\t\t\treturn $fields;\n\t\t}\n\t\t// Trim off outside whitespace from the comma delimited list.\n\t\t$requested_fields = array_map( 'trim', $requested_fields );\n\t\t// Always persist 'id', because it can be needed for add_additional_fields_to_object().\n\t\tif ( in_array( 'id', $fields, true ) ) {\n\t\t\t$requested_fields[] = 'id';\n\t\t}\n\t\t// Return the list of all requested fields which appear in the schema.\n\t\treturn array_reduce(\n\t\t\t$requested_fields,\n\t\t\tfunction( $response_fields, $field ) use ( $fields ) {\n\t\t\t\tif ( in_array( $field, $fields, true ) ) {\n\t\t\t\t\t$response_fields[] = $field;\n\t\t\t\t\treturn $response_fields;\n\t\t\t\t}\n\t\t\t\t// Check for nested fields if $field is not a direct match.\n\t\t\t\t$nested_fields = explode( '.', $field );\n\t\t\t\t// A nested field is included so long as its top-level property\n\t\t\t\t// is present in the schema.\n\t\t\t\tif ( in_array( $nested_fields[0], $fields, true ) ) {\n\t\t\t\t\t$response_fields[] = $field;\n\t\t\t\t}\n\t\t\t\treturn $response_fields;\n\t\t\t},\n\t\t\tarray()\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves an array of endpoint arguments from the item schema for the controller.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $method Optional. HTTP method of the request. The arguments for `CREATABLE` requests are\n\t *                       checked for required values and may fall-back to a given default, this is not done\n\t *                       on `EDITABLE` requests. Default WP_REST_Server::CREATABLE.\n\t * @return array Endpoint arguments.\n\t */\n\tpublic function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {\n\n\t\t$schema                  = $this->get_item_schema();\n\t\t$schema_properties       = ! empty( $schema['properties'] ) ? $schema['properties'] : array();\n\t\t$endpoint_args           = array();\n\t\t$valid_schema_properties = array(\n\t\t\t'type',\n\t\t\t'format',\n\t\t\t'enum',\n\t\t\t'items',\n\t\t\t'properties',\n\t\t\t'additionalProperties',\n\t\t\t'minimum',\n\t\t\t'maximum',\n\t\t\t'exclusiveMinimum',\n\t\t\t'exclusiveMaximum',\n\t\t\t'minLength',\n\t\t\t'maxLength',\n\t\t\t'pattern',\n\t\t\t'minItems',\n\t\t\t'maxItems',\n\t\t\t'uniqueItems',\n\t\t);\n\n\t\tforeach ( $schema_properties as $field_id => $params ) {\n\n\t\t\t// Arguments specified as `readonly` are not allowed to be set.\n\t\t\tif ( ! empty( $params['readonly'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$endpoint_args[ $field_id ] = array(\n\t\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t\t\t'sanitize_callback' => 'rest_sanitize_request_arg',\n\t\t\t);\n\n\t\t\tif ( isset( $params['description'] ) ) {\n\t\t\t\t$endpoint_args[ $field_id ]['description'] = $params['description'];\n\t\t\t}\n\n\t\t\tif ( WP_REST_Server::CREATABLE === $method && isset( $params['default'] ) ) {\n\t\t\t\t$endpoint_args[ $field_id ]['default'] = $params['default'];\n\t\t\t}\n\n\t\t\tif ( WP_REST_Server::CREATABLE === $method && ! empty( $params['required'] ) ) {\n\t\t\t\t$endpoint_args[ $field_id ]['required'] = true;\n\t\t\t}\n\n\t\t\tforeach ( $valid_schema_properties as $schema_prop ) {\n\t\t\t\tif ( isset( $params[ $schema_prop ] ) ) {\n\t\t\t\t\t$endpoint_args[ $field_id ][ $schema_prop ] = $params[ $schema_prop ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Merge in any options provided by the schema property.\n\t\t\tif ( isset( $params['arg_options'] ) ) {\n\n\t\t\t\t// Only use required / default from arg_options on CREATABLE endpoints.\n\t\t\t\tif ( WP_REST_Server::CREATABLE !== $method ) {\n\t\t\t\t\t$params['arg_options'] = array_diff_key(\n\t\t\t\t\t\t$params['arg_options'],\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t'default'  => '',\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$endpoint_args[ $field_id ] = array_merge( $endpoint_args[ $field_id ], $params['arg_options'] );\n\t\t\t}\n\t\t}\n\n\t\treturn $endpoint_args;\n\t}\n\n\t/**\n\t * Sanitizes the slug value.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @internal We can't use sanitize_title() directly, as the second\n\t * parameter is the fallback title, which would end up being set to the\n\t * request object.\n\t *\n\t * @see https://github.com/WP-API/WP-API/issues/1585\n\t *\n\t * @todo Remove this in favour of https://core.trac.wordpress.org/ticket/34659\n\t *\n\t * @param string $slug Slug value passed in request.\n\t * @return string Sanitized value for the slug.\n\t */\n\tpublic function sanitize_slug( $slug ) {\n\t\treturn sanitize_title( $slug );\n\t}\n}\n", "num_lines": 722}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Plugins_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 5.5.0\n */\n\n/**\n * Core class to access plugins via the REST API.\n *\n * @since 5.5.0\n *\n * @see WP_REST_Controller\n */\nclass WP_REST_Plugins_Controller extends WP_REST_Controller {\n\n\tconst PATTERN = '[^.\\/]+(?:\\/[^.\\/]+)?';\n\n\t/**\n\t * Plugins controller constructor.\n\t *\n\t * @since 5.5.0\n\t */\n\tpublic function __construct() {\n\t\t$this->namespace = 'wp/v2';\n\t\t$this->rest_base = 'plugins';\n\t}\n\n\t/**\n\t * Registers the routes for the plugins controller.\n\t *\n\t * @since 5.5.0\n\t */\n\tpublic function register_routes() {\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_items' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::CREATABLE,\n\t\t\t\t\t'callback'            => array( $this, 'create_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'create_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'slug'   => array(\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t'required'    => true,\n\t\t\t\t\t\t\t'description' => __( 'WordPress.org plugin directory slug.' ),\n\t\t\t\t\t\t\t'pattern'     => '[\\w\\-]+',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'status' => array(\n\t\t\t\t\t\t\t'description' => __( 'The plugin activation status.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t'enum'        => is_multisite() ? array( 'inactive', 'active', 'network-active' ) : array( 'inactive', 'active' ),\n\t\t\t\t\t\t\t'default'     => 'inactive',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base . '/(?P<plugin>' . self::PATTERN . ')',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::EDITABLE,\n\t\t\t\t\t'callback'            => array( $this, 'update_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'update_item_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::DELETABLE,\n\t\t\t\t\t'callback'            => array( $this, 'delete_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'delete_item_permissions_check' ),\n\t\t\t\t),\n\t\t\t\t'args'   => array(\n\t\t\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t\t\t'plugin'  => array(\n\t\t\t\t\t\t'type'              => 'string',\n\t\t\t\t\t\t'pattern'           => self::PATTERN,\n\t\t\t\t\t\t'validate_callback' => array( $this, 'validate_plugin_param' ),\n\t\t\t\t\t\t'sanitize_callback' => array( $this, 'sanitize_plugin_param' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Checks if a given request has access to get plugins.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access, WP_Error object otherwise.\n\t */\n\tpublic function get_items_permissions_check( $request ) {\n\t\tif ( ! current_user_can( 'activate_plugins' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_view_plugins',\n\t\t\t\t__( 'Sorry, you are not allowed to manage plugins for this site.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves a collection of plugins.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_items( $request ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\n\t\t$plugins = array();\n\n\t\tforeach ( get_plugins() as $file => $data ) {\n\t\t\tif ( is_wp_error( $this->check_read_permission( $file ) ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$data['_file'] = $file;\n\n\t\t\tif ( ! $this->does_plugin_match_request( $request, $data ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$plugins[] = $this->prepare_response_for_collection( $this->prepare_item_for_response( $data, $request ) );\n\t\t}\n\n\t\treturn new WP_REST_Response( $plugins );\n\t}\n\n\t/**\n\t * Checks if a given request has access to get a specific plugin.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.\n\t */\n\tpublic function get_item_permissions_check( $request ) {\n\t\tif ( ! current_user_can( 'activate_plugins' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_view_plugin',\n\t\t\t\t__( 'Sorry, you are not allowed to manage plugins for this site.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\t$can_read = $this->check_read_permission( $request['plugin'] );\n\n\t\tif ( is_wp_error( $can_read ) ) {\n\t\t\treturn $can_read;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves one plugin from the site.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_item( $request ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\n\t\t$data = $this->get_plugin_data( $request['plugin'] );\n\n\t\tif ( is_wp_error( $data ) ) {\n\t\t\treturn $data;\n\t\t}\n\n\t\treturn $this->prepare_item_for_response( $data, $request );\n\t}\n\n\t/**\n\t * Checks if the given plugin can be viewed by the current user.\n\t *\n\t * On multisite, this hides non-active network only plugins if the user does not have permission\n\t * to manage network plugins.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $plugin The plugin file to check.\n\t * @return true|WP_Error True if can read, a WP_Error instance otherwise.\n\t */\n\tprotected function check_read_permission( $plugin ) {\n\t\tif ( ! $this->is_plugin_installed( $plugin ) ) {\n\t\t\treturn new WP_Error( 'rest_plugin_not_found', __( 'Plugin not found.' ), array( 'status' => 404 ) );\n\t\t}\n\n\t\tif ( ! is_multisite() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! is_network_only_plugin( $plugin ) || is_plugin_active( $plugin ) || current_user_can( 'manage_network_plugins' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn new WP_Error(\n\t\t\t'rest_cannot_view_plugin',\n\t\t\t__( 'Sorry, you are not allowed to manage this plugin.' ),\n\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t);\n\t}\n\n\t/**\n\t * Checks if a given request has access to upload plugins.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to create items, WP_Error object otherwise.\n\t */\n\tpublic function create_item_permissions_check( $request ) {\n\t\tif ( ! current_user_can( 'install_plugins' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_install_plugin',\n\t\t\t\t__( 'Sorry, you are not allowed to install plugins on this site.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( 'inactive' !== $request['status'] && ! current_user_can( 'activate_plugins' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_activate_plugin',\n\t\t\t\t__( 'Sorry, you are not allowed to activate plugins.' ),\n\t\t\t\tarray(\n\t\t\t\t\t'status' => rest_authorization_required_code(),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Uploads a plugin and optionally activates it.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function create_item( $request ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/file.php';\n\t\trequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\t\trequire_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\t\trequire_once ABSPATH . 'wp-admin/includes/plugin-install.php';\n\n\t\t$slug = $request['slug'];\n\n\t\t// Verify filesystem is accessible first.\n\t\t$filesystem_available = $this->is_filesystem_available();\n\t\tif ( is_wp_error( $filesystem_available ) ) {\n\t\t\treturn $filesystem_available;\n\t\t}\n\n\t\t$api = plugins_api(\n\t\t\t'plugin_information',\n\t\t\tarray(\n\t\t\t\t'slug'   => $slug,\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'sections'       => false,\n\t\t\t\t\t'language_packs' => true,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\tif ( is_wp_error( $api ) ) {\n\t\t\tif ( false !== strpos( $api->get_error_message(), 'Plugin not found.' ) ) {\n\t\t\t\t$api->add_data( array( 'status' => 404 ) );\n\t\t\t} else {\n\t\t\t\t$api->add_data( array( 'status' => 500 ) );\n\t\t\t}\n\n\t\t\treturn $api;\n\t\t}\n\n\t\t$skin     = new WP_Ajax_Upgrader_Skin();\n\t\t$upgrader = new Plugin_Upgrader( $skin );\n\n\t\t$result = $upgrader->install( $api->download_link );\n\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\t$result->add_data( array( 'status' => 500 ) );\n\n\t\t\treturn $result;\n\t\t}\n\n\t\t// This should be the same as $result above.\n\t\tif ( is_wp_error( $skin->result ) ) {\n\t\t\t$skin->result->add_data( array( 'status' => 500 ) );\n\n\t\t\treturn $skin->result;\n\t\t}\n\n\t\tif ( $skin->get_errors()->has_errors() ) {\n\t\t\t$error = $skin->get_errors();\n\t\t\t$error->add_data( array( 'status' => 500 ) );\n\n\t\t\treturn $error;\n\t\t}\n\n\t\tif ( is_null( $result ) ) {\n\t\t\tglobal $wp_filesystem;\n\t\t\t// Pass through the error from WP_Filesystem if one was raised.\n\t\t\tif ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {\n\t\t\t\treturn new WP_Error( 'unable_to_connect_to_filesystem', $wp_filesystem->errors->get_error_message(), array( 'status' => 500 ) );\n\t\t\t}\n\n\t\t\treturn new WP_Error( 'unable_to_connect_to_filesystem', __( 'Unable to connect to the filesystem. Please confirm your credentials.' ), array( 'status' => 500 ) );\n\t\t}\n\n\t\t$file = $upgrader->plugin_info();\n\n\t\tif ( ! $file ) {\n\t\t\treturn new WP_Error( 'unable_to_determine_installed_plugin', __( 'Unable to determine what plugin was installed.' ), array( 'status' => 500 ) );\n\t\t}\n\n\t\tif ( 'inactive' !== $request['status'] ) {\n\t\t\t$can_change_status = $this->plugin_status_permission_check( $file, $request['status'], 'inactive' );\n\n\t\t\tif ( is_wp_error( $can_change_status ) ) {\n\t\t\t\treturn $can_change_status;\n\t\t\t}\n\n\t\t\t$changed_status = $this->handle_plugin_status( $file, $request['status'], 'inactive' );\n\n\t\t\tif ( is_wp_error( $changed_status ) ) {\n\t\t\t\treturn $changed_status;\n\t\t\t}\n\t\t}\n\n\t\t// Install translations.\n\t\t$installed_locales = array_values( get_available_languages() );\n\t\t/** This filter is documented in wp-includes/update.php */\n\t\t$installed_locales = apply_filters( 'plugins_update_check_locales', $installed_locales );\n\n\t\t$language_packs = array_map(\n\t\t\tfunction( $item ) {\n\t\t\t\treturn (object) $item;\n\t\t\t},\n\t\t\t$api->language_packs\n\t\t);\n\n\t\t$language_packs = array_filter(\n\t\t\t$language_packs,\n\t\t\tfunction( $pack ) use ( $installed_locales ) {\n\t\t\t\treturn in_array( $pack->language, $installed_locales, true );\n\t\t\t}\n\t\t);\n\n\t\tif ( $language_packs ) {\n\t\t\t$lp_upgrader = new Language_Pack_Upgrader( $skin );\n\n\t\t\t// Install all applicable language packs for the plugin.\n\t\t\t$lp_upgrader->bulk_upgrade( $language_packs );\n\t\t}\n\n\t\t$path          = WP_PLUGIN_DIR . '/' . $file;\n\t\t$data          = get_plugin_data( $path, false, false );\n\t\t$data['_file'] = $file;\n\n\t\t$response = $this->prepare_item_for_response( $data, $request );\n\t\t$response->set_status( 201 );\n\t\t$response->header( 'Location', rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, substr( $file, 0, - 4 ) ) ) );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Checks if a given request has access to update a specific plugin.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise.\n\t */\n\tpublic function update_item_permissions_check( $request ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\n\t\tif ( ! current_user_can( 'activate_plugins' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_manage_plugins',\n\t\t\t\t__( 'Sorry, you are not allowed to manage plugins for this site.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\t$can_read = $this->check_read_permission( $request['plugin'] );\n\n\t\tif ( is_wp_error( $can_read ) ) {\n\t\t\treturn $can_read;\n\t\t}\n\n\t\t$status = $this->get_plugin_status( $request['plugin'] );\n\n\t\tif ( $request['status'] && $status !== $request['status'] ) {\n\t\t\t$can_change_status = $this->plugin_status_permission_check( $request['plugin'], $request['status'], $status );\n\n\t\t\tif ( is_wp_error( $can_change_status ) ) {\n\t\t\t\treturn $can_change_status;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Updates one plugin.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function update_item( $request ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\n\t\t$data = $this->get_plugin_data( $request['plugin'] );\n\n\t\tif ( is_wp_error( $data ) ) {\n\t\t\treturn $data;\n\t\t}\n\n\t\t$status = $this->get_plugin_status( $request['plugin'] );\n\n\t\tif ( $request['status'] && $status !== $request['status'] ) {\n\t\t\t$handled = $this->handle_plugin_status( $request['plugin'], $request['status'], $status );\n\n\t\t\tif ( is_wp_error( $handled ) ) {\n\t\t\t\treturn $handled;\n\t\t\t}\n\t\t}\n\n\t\t$this->update_additional_fields_for_object( $data, $request );\n\n\t\t$request['context'] = 'edit';\n\n\t\treturn $this->prepare_item_for_response( $data, $request );\n\t}\n\n\t/**\n\t * Checks if a given request has access to delete a specific plugin.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise.\n\t */\n\tpublic function delete_item_permissions_check( $request ) {\n\t\tif ( ! current_user_can( 'activate_plugins' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_manage_plugins',\n\t\t\t\t__( 'Sorry, you are not allowed to manage plugins for this site.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! current_user_can( 'delete_plugins' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_manage_plugins',\n\t\t\t\t__( 'Sorry, you are not allowed to delete plugins for this site.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\t$can_read = $this->check_read_permission( $request['plugin'] );\n\n\t\tif ( is_wp_error( $can_read ) ) {\n\t\t\treturn $can_read;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Deletes one plugin from the site.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function delete_item( $request ) {\n\t\trequire_once ABSPATH . 'wp-admin/includes/file.php';\n\t\trequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\n\t\t$data = $this->get_plugin_data( $request['plugin'] );\n\n\t\tif ( is_wp_error( $data ) ) {\n\t\t\treturn $data;\n\t\t}\n\n\t\tif ( is_plugin_active( $request['plugin'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_delete_active_plugin',\n\t\t\t\t__( 'Cannot delete an active plugin. Please deactivate it first.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t$filesystem_available = $this->is_filesystem_available();\n\t\tif ( is_wp_error( $filesystem_available ) ) {\n\t\t\treturn $filesystem_available;\n\t\t}\n\n\t\t$prepared = $this->prepare_item_for_response( $data, $request );\n\t\t$deleted  = delete_plugins( array( $request['plugin'] ) );\n\n\t\tif ( is_wp_error( $deleted ) ) {\n\t\t\t$deleted->add_data( array( 'status' => 500 ) );\n\n\t\t\treturn $deleted;\n\t\t}\n\n\t\treturn new WP_REST_Response(\n\t\t\tarray(\n\t\t\t\t'deleted'  => true,\n\t\t\t\t'previous' => $prepared->get_data(),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Prepares the plugin for the REST response.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param mixed           $item    Unmarked up and untranslated plugin data from {@see get_plugin_data()}.\n\t * @param WP_REST_Request $request Request object.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function prepare_item_for_response( $item, $request ) {\n\t\t$item   = _get_plugin_data_markup_translate( $item['_file'], $item, false );\n\t\t$marked = _get_plugin_data_markup_translate( $item['_file'], $item, true );\n\n\t\t$data = array(\n\t\t\t'plugin'       => substr( $item['_file'], 0, - 4 ),\n\t\t\t'status'       => $this->get_plugin_status( $item['_file'] ),\n\t\t\t'name'         => $item['Name'],\n\t\t\t'plugin_uri'   => $item['PluginURI'],\n\t\t\t'author'       => $item['Author'],\n\t\t\t'author_uri'   => $item['AuthorURI'],\n\t\t\t'description'  => array(\n\t\t\t\t'raw'      => $item['Description'],\n\t\t\t\t'rendered' => $marked['Description'],\n\t\t\t),\n\t\t\t'version'      => $item['Version'],\n\t\t\t'network_only' => $item['Network'],\n\t\t\t'requires_wp'  => $item['RequiresWP'],\n\t\t\t'requires_php' => $item['RequiresPHP'],\n\t\t\t'textdomain'   => $item['TextDomain'],\n\t\t);\n\n\t\t$data = $this->add_additional_fields_to_object( $data, $request );\n\n\t\t$response = new WP_REST_Response( $data );\n\t\t$response->add_links( $this->prepare_links( $item ) );\n\n\t\t/**\n\t\t * Filters the plugin data for a response.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param WP_REST_Response $response The response object.\n\t\t * @param array            $item     The plugin item from {@see get_plugin_data()}.\n\t\t * @param WP_REST_Request  $request  The request object.\n\t\t */\n\t\treturn apply_filters( 'rest_prepare_plugin', $response, $item, $request );\n\t}\n\n\t/**\n\t * Prepares links for the request.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param array $item The plugin item.\n\t * @return array[]\n\t */\n\tprotected function prepare_links( $item ) {\n\t\treturn array(\n\t\t\t'self' => array(\n\t\t\t\t'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, substr( $item['_file'], 0, - 4 ) ) ),\n\t\t\t),\n\t\t);\n\t}\n\n\t/**\n\t * Gets the plugin header data for a plugin.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $plugin The plugin file to get data for.\n\t * @return array|WP_Error The plugin data, or a WP_Error if the plugin is not installed.\n\t */\n\tprotected function get_plugin_data( $plugin ) {\n\t\t$plugins = get_plugins();\n\n\t\tif ( ! isset( $plugins[ $plugin ] ) ) {\n\t\t\treturn new WP_Error( 'rest_plugin_not_found', __( 'Plugin not found.' ), array( 'status' => 404 ) );\n\t\t}\n\n\t\t$data          = $plugins[ $plugin ];\n\t\t$data['_file'] = $plugin;\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Get's the activation status for a plugin.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $plugin The plugin file to check.\n\t * @return string Either 'network-active', 'active' or 'inactive'.\n\t */\n\tprotected function get_plugin_status( $plugin ) {\n\t\tif ( is_plugin_active_for_network( $plugin ) ) {\n\t\t\treturn 'network-active';\n\t\t}\n\n\t\tif ( is_plugin_active( $plugin ) ) {\n\t\t\treturn 'active';\n\t\t}\n\n\t\treturn 'inactive';\n\t}\n\n\t/**\n\t * Handle updating a plugin's status.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $plugin         The plugin file to update.\n\t * @param string $new_status     The plugin's new status.\n\t * @param string $current_status The plugin's current status.\n\t *\n\t * @return true|WP_Error\n\t */\n\tprotected function plugin_status_permission_check( $plugin, $new_status, $current_status ) {\n\t\tif ( is_multisite() && ( 'network-active' === $current_status || 'network-active' === $new_status ) && ! current_user_can( 'manage_network_plugins' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_manage_network_plugins',\n\t\t\t\t__( 'Sorry, you are not allowed to manage network plugins.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( ( 'active' === $new_status || 'network-active' === $new_status ) && ! current_user_can( 'activate_plugin', $plugin ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_activate_plugin',\n\t\t\t\t__( 'Sorry, you are not allowed to activate this plugin.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( 'inactive' === $new_status && ! current_user_can( 'deactivate_plugin', $plugin ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_deactivate_plugin',\n\t\t\t\t__( 'Sorry, you are not allowed to deactivate this plugin.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Handle updating a plugin's status.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $plugin         The plugin file to update.\n\t * @param string $new_status     The plugin's new status.\n\t * @param string $current_status The plugin's current status.\n\t * @return true|WP_Error\n\t */\n\tprotected function handle_plugin_status( $plugin, $new_status, $current_status ) {\n\t\tif ( 'inactive' === $new_status ) {\n\t\t\tdeactivate_plugins( $plugin, false, 'network-active' === $current_status );\n\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( 'active' === $new_status && 'network-active' === $current_status ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$network_activate = 'network-active' === $new_status;\n\n\t\tif ( is_multisite() && ! $network_activate && is_network_only_plugin( $plugin ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_network_only_plugin',\n\t\t\t\t__( 'Network only plugin must be network activated.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t$activated = activate_plugin( $plugin, '', $network_activate );\n\n\t\tif ( is_wp_error( $activated ) ) {\n\t\t\t$activated->add_data( array( 'status' => 500 ) );\n\n\t\t\treturn $activated;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks that the \"plugin\" parameter is a valid path.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $file The plugin file parameter.\n\t * @return bool\n\t */\n\tpublic function validate_plugin_param( $file ) {\n\t\tif ( ! is_string( $file ) || ! preg_match( '/' . self::PATTERN . '/u', $file ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$validated = validate_file( plugin_basename( $file ) );\n\n\t\treturn 0 === $validated;\n\t}\n\n\t/**\n\t * Sanitizes the \"plugin\" parameter to be a proper plugin file with \".php\" appended.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $file The plugin file parameter.\n\t * @return string\n\t */\n\tpublic function sanitize_plugin_param( $file ) {\n\t\treturn plugin_basename( sanitize_text_field( $file . '.php' ) );\n\t}\n\n\t/**\n\t * Checks if the plugin matches the requested parameters.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_REST_Request $request The request to require the plugin matches against.\n\t * @param array           $item    The plugin item.\n\t *\n\t * @return bool\n\t */\n\tprotected function does_plugin_match_request( $request, $item ) {\n\t\t$search = $request['search'];\n\n\t\tif ( $search ) {\n\t\t\t$matched_search = false;\n\n\t\t\tforeach ( $item as $field ) {\n\t\t\t\tif ( is_string( $field ) && false !== strpos( strip_tags( $field ), $search ) ) {\n\t\t\t\t\t$matched_search = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! $matched_search ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$status = $request['status'];\n\n\t\tif ( $status && ! in_array( $this->get_plugin_status( $item['_file'] ), $status, true ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks if the plugin is installed.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $plugin The plugin file.\n\t * @return bool\n\t */\n\tprotected function is_plugin_installed( $plugin ) {\n\t\treturn file_exists( WP_PLUGIN_DIR . '/' . $plugin );\n\t}\n\n\t/**\n\t * Determine if the endpoints are available.\n\t *\n\t * Only the 'Direct' filesystem transport, and SSH/FTP when credentials are stored are supported at present.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return true|WP_Error True if filesystem is available, WP_Error otherwise.\n\t */\n\tprotected function is_filesystem_available() {\n\t\t$filesystem_method = get_filesystem_method();\n\n\t\tif ( 'direct' === $filesystem_method ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tob_start();\n\t\t$filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() );\n\t\tob_end_clean();\n\n\t\tif ( $filesystem_credentials_are_stored ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn new WP_Error( 'fs_unavailable', __( 'The filesystem is currently unavailable for managing plugins.' ), array( 'status' => 500 ) );\n\t}\n\n\t/**\n\t * Retrieves the plugin's schema, conforming to JSON Schema.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$this->schema = array(\n\t\t\t'$schema'    => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title'      => 'plugin',\n\t\t\t'type'       => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'plugin'       => array(\n\t\t\t\t\t'description' => __( 'The plugin file.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'pattern'     => self::PATTERN,\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t\t'status'       => array(\n\t\t\t\t\t'description' => __( 'The plugin activation status.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'enum'        => is_multisite() ? array( 'inactive', 'active', 'network-active' ) : array( 'inactive', 'active' ),\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t\t'name'         => array(\n\t\t\t\t\t'description' => __( 'The plugin name.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t\t'plugin_uri'   => array(\n\t\t\t\t\t'description' => __( 'The plugin\\'s website address.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'author'       => array(\n\t\t\t\t\t'description' => __( 'The plugin author.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'author_uri'   => array(\n\t\t\t\t\t'description' => __( 'Plugin author\\'s website address.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'description'  => array(\n\t\t\t\t\t'description' => __( 'The plugin description.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'properties'  => array(\n\t\t\t\t\t\t'raw'      => array(\n\t\t\t\t\t\t\t'description' => __( 'The raw plugin description.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'rendered' => array(\n\t\t\t\t\t\t\t'description' => __( 'The plugin description formatted for display.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'version'      => array(\n\t\t\t\t\t'description' => __( 'The plugin version number.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'network_only' => array(\n\t\t\t\t\t'description' => __( 'Whether the plugin can only be activated network-wide.' ),\n\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t\t'requires_wp'  => array(\n\t\t\t\t\t'description' => __( 'Minimum required version of WordPress.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t\t'requires_php' => array(\n\t\t\t\t\t'description' => __( 'Minimum required version of PHP.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t\t'textdomain'   => array(\n\t\t\t\t\t'description' => __( 'The plugin\\'s text domain.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}\n\n\t/**\n\t * Retrieves the query params for the collections.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array Query parameters for the collection.\n\t */\n\tpublic function get_collection_params() {\n\t\t$query_params = parent::get_collection_params();\n\n\t\t$query_params['context']['default'] = 'view';\n\n\t\t$query_params['status'] = array(\n\t\t\t'description' => __( 'Limits results to plugins with the given status.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'string',\n\t\t\t\t'enum' => is_multisite() ? array( 'inactive', 'active', 'network-active' ) : array( 'inactive', 'active' ),\n\t\t\t),\n\t\t);\n\n\t\tunset( $query_params['page'], $query_params['per_page'] );\n\n\t\treturn $query_params;\n\t}\n}\n", "num_lines": 976}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Post_Statuses_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.7.0\n */\n\n/**\n * Core class used to access post statuses via the REST API.\n *\n * @since 4.7.0\n *\n * @see WP_REST_Controller\n */\nclass WP_REST_Post_Statuses_Controller extends WP_REST_Controller {\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.7.0\n\t */\n\tpublic function __construct() {\n\t\t$this->namespace = 'wp/v2';\n\t\t$this->rest_base = 'statuses';\n\t}\n\n\t/**\n\t * Registers the routes for the objects of the controller.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see register_rest_route()\n\t */\n\tpublic function register_routes() {\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_items' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base . '/(?P<status>[\\w-]+)',\n\t\t\tarray(\n\t\t\t\t'args'   => array(\n\t\t\t\t\t'status' => array(\n\t\t\t\t\t\t'description' => __( 'An alphanumeric identifier for the status.' ),\n\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether a given request has permission to read post statuses.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access, WP_Error object otherwise.\n\t */\n\tpublic function get_items_permissions_check( $request ) {\n\t\tif ( 'edit' === $request['context'] ) {\n\t\t\t$types = get_post_types( array( 'show_in_rest' => true ), 'objects' );\n\n\t\t\tforeach ( $types as $type ) {\n\t\t\t\tif ( current_user_can( $type->cap->edit_posts ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_view',\n\t\t\t\t__( 'Sorry, you are not allowed to manage post statuses.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves all post statuses, depending on user context.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_items( $request ) {\n\t\t$data              = array();\n\t\t$statuses          = get_post_stati( array( 'internal' => false ), 'object' );\n\t\t$statuses['trash'] = get_post_status_object( 'trash' );\n\n\t\tforeach ( $statuses as $slug => $obj ) {\n\t\t\t$ret = $this->check_read_permission( $obj );\n\n\t\t\tif ( ! $ret ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$status             = $this->prepare_item_for_response( $obj, $request );\n\t\t\t$data[ $obj->name ] = $this->prepare_response_for_collection( $status );\n\t\t}\n\n\t\treturn rest_ensure_response( $data );\n\t}\n\n\t/**\n\t * Checks if a given request has access to read a post status.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.\n\t */\n\tpublic function get_item_permissions_check( $request ) {\n\t\t$status = get_post_status_object( $request['status'] );\n\n\t\tif ( empty( $status ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_status_invalid',\n\t\t\t\t__( 'Invalid status.' ),\n\t\t\t\tarray( 'status' => 404 )\n\t\t\t);\n\t\t}\n\n\t\t$check = $this->check_read_permission( $status );\n\n\t\tif ( ! $check ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_read_status',\n\t\t\t\t__( 'Cannot view status.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks whether a given post status should be visible.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param object $status Post status.\n\t * @return bool True if the post status is visible, otherwise false.\n\t */\n\tprotected function check_read_permission( $status ) {\n\t\tif ( true === $status->public ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( false === $status->internal || 'trash' === $status->name ) {\n\t\t\t$types = get_post_types( array( 'show_in_rest' => true ), 'objects' );\n\n\t\t\tforeach ( $types as $type ) {\n\t\t\t\tif ( current_user_can( $type->cap->edit_posts ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Retrieves a specific post status.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_item( $request ) {\n\t\t$obj = get_post_status_object( $request['status'] );\n\n\t\tif ( empty( $obj ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_status_invalid',\n\t\t\t\t__( 'Invalid status.' ),\n\t\t\t\tarray( 'status' => 404 )\n\t\t\t);\n\t\t}\n\n\t\t$data = $this->prepare_item_for_response( $obj, $request );\n\n\t\treturn rest_ensure_response( $data );\n\t}\n\n\t/**\n\t * Prepares a post status object for serialization.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param stdClass        $status  Post status data.\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response Post status data.\n\t */\n\tpublic function prepare_item_for_response( $status, $request ) {\n\n\t\t$fields = $this->get_fields_for_response( $request );\n\t\t$data   = array();\n\n\t\tif ( in_array( 'name', $fields, true ) ) {\n\t\t\t$data['name'] = $status->label;\n\t\t}\n\n\t\tif ( in_array( 'private', $fields, true ) ) {\n\t\t\t$data['private'] = (bool) $status->private;\n\t\t}\n\n\t\tif ( in_array( 'protected', $fields, true ) ) {\n\t\t\t$data['protected'] = (bool) $status->protected;\n\t\t}\n\n\t\tif ( in_array( 'public', $fields, true ) ) {\n\t\t\t$data['public'] = (bool) $status->public;\n\t\t}\n\n\t\tif ( in_array( 'queryable', $fields, true ) ) {\n\t\t\t$data['queryable'] = (bool) $status->publicly_queryable;\n\t\t}\n\n\t\tif ( in_array( 'show_in_list', $fields, true ) ) {\n\t\t\t$data['show_in_list'] = (bool) $status->show_in_admin_all_list;\n\t\t}\n\n\t\tif ( in_array( 'slug', $fields, true ) ) {\n\t\t\t$data['slug'] = $status->name;\n\t\t}\n\n\t\tif ( in_array( 'date_floating', $fields, true ) ) {\n\t\t\t$data['date_floating'] = $status->date_floating;\n\t\t}\n\n\t\t$context = ! empty( $request['context'] ) ? $request['context'] : 'view';\n\t\t$data    = $this->add_additional_fields_to_object( $data, $request );\n\t\t$data    = $this->filter_response_by_context( $data, $context );\n\n\t\t$response = rest_ensure_response( $data );\n\n\t\tif ( 'publish' === $status->name ) {\n\t\t\t$response->add_link( 'archives', rest_url( 'wp/v2/posts' ) );\n\t\t} else {\n\t\t\t$response->add_link( 'archives', add_query_arg( 'status', $status->name, rest_url( 'wp/v2/posts' ) ) );\n\t\t}\n\n\t\t/**\n\t\t * Filters a status returned from the REST API.\n\t\t *\n\t\t * Allows modification of the status data right before it is returned.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_REST_Response $response The response object.\n\t\t * @param object           $status   The original status object.\n\t\t * @param WP_REST_Request  $request  Request used to generate the response.\n\t\t */\n\t\treturn apply_filters( 'rest_prepare_status', $response, $status, $request );\n\t}\n\n\t/**\n\t * Retrieves the post status' schema, conforming to JSON Schema.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$schema = array(\n\t\t\t'$schema'    => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title'      => 'status',\n\t\t\t'type'       => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'name'          => array(\n\t\t\t\t\t'description' => __( 'The title for the status.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'private'       => array(\n\t\t\t\t\t'description' => __( 'Whether posts with this status should be private.' ),\n\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'protected'     => array(\n\t\t\t\t\t'description' => __( 'Whether posts with this status should be protected.' ),\n\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'public'        => array(\n\t\t\t\t\t'description' => __( 'Whether posts of this status should be shown in the front end of the site.' ),\n\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'queryable'     => array(\n\t\t\t\t\t'description' => __( 'Whether posts with this status should be publicly-queryable.' ),\n\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'show_in_list'  => array(\n\t\t\t\t\t'description' => __( 'Whether to include posts in the edit listing for their post type.' ),\n\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'slug'          => array(\n\t\t\t\t\t'description' => __( 'An alphanumeric identifier for the status.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'date_floating' => array(\n\t\t\t\t\t'description' => __( 'Whether posts of this status may have floating published dates.' ),\n\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->schema = $schema;\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}\n\n\t/**\n\t * Retrieves the query params for collections.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Collection parameters.\n\t */\n\tpublic function get_collection_params() {\n\t\treturn array(\n\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t);\n\t}\n\n}\n", "num_lines": 371}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Post_Types_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.7.0\n */\n\n/**\n * Core class to access post types via the REST API.\n *\n * @since 4.7.0\n *\n * @see WP_REST_Controller\n */\nclass WP_REST_Post_Types_Controller extends WP_REST_Controller {\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.7.0\n\t */\n\tpublic function __construct() {\n\t\t$this->namespace = 'wp/v2';\n\t\t$this->rest_base = 'types';\n\t}\n\n\t/**\n\t * Registers the routes for the objects of the controller.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see register_rest_route()\n\t */\n\tpublic function register_routes() {\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_items' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base . '/(?P<type>[\\w-]+)',\n\t\t\tarray(\n\t\t\t\t'args'   => array(\n\t\t\t\t\t'type' => array(\n\t\t\t\t\t\t'description' => __( 'An alphanumeric identifier for the post type.' ),\n\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_item' ),\n\t\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether a given request has permission to read types.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access, WP_Error object otherwise.\n\t */\n\tpublic function get_items_permissions_check( $request ) {\n\t\tif ( 'edit' === $request['context'] ) {\n\t\t\t$types = get_post_types( array( 'show_in_rest' => true ), 'objects' );\n\n\t\t\tforeach ( $types as $type ) {\n\t\t\t\tif ( current_user_can( $type->cap->edit_posts ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_view',\n\t\t\t\t__( 'Sorry, you are not allowed to edit posts in this post type.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves all public post types.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_items( $request ) {\n\t\t$data  = array();\n\t\t$types = get_post_types( array( 'show_in_rest' => true ), 'objects' );\n\n\t\tforeach ( $types as $type ) {\n\t\t\tif ( 'edit' === $request['context'] && ! current_user_can( $type->cap->edit_posts ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$post_type           = $this->prepare_item_for_response( $type, $request );\n\t\t\t$data[ $type->name ] = $this->prepare_response_for_collection( $post_type );\n\t\t}\n\n\t\treturn rest_ensure_response( $data );\n\t}\n\n\t/**\n\t * Retrieves a specific post type.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_item( $request ) {\n\t\t$obj = get_post_type_object( $request['type'] );\n\n\t\tif ( empty( $obj ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_type_invalid',\n\t\t\t\t__( 'Invalid post type.' ),\n\t\t\t\tarray( 'status' => 404 )\n\t\t\t);\n\t\t}\n\n\t\tif ( empty( $obj->show_in_rest ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_read_type',\n\t\t\t\t__( 'Cannot view post type.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( 'edit' === $request['context'] && ! current_user_can( $obj->cap->edit_posts ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_forbidden_context',\n\t\t\t\t__( 'Sorry, you are not allowed to edit posts in this post type.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\t$data = $this->prepare_item_for_response( $obj, $request );\n\n\t\treturn rest_ensure_response( $data );\n\t}\n\n\t/**\n\t * Prepares a post type object for serialization.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Post_Type    $post_type Post type object.\n\t * @param WP_REST_Request $request   Full details about the request.\n\t * @return WP_REST_Response Response object.\n\t */\n\tpublic function prepare_item_for_response( $post_type, $request ) {\n\t\t$taxonomies = wp_list_filter( get_object_taxonomies( $post_type->name, 'objects' ), array( 'show_in_rest' => true ) );\n\t\t$taxonomies = wp_list_pluck( $taxonomies, 'name' );\n\t\t$base       = ! empty( $post_type->rest_base ) ? $post_type->rest_base : $post_type->name;\n\t\t$supports   = get_all_post_type_supports( $post_type->name );\n\n\t\t$fields = $this->get_fields_for_response( $request );\n\t\t$data   = array();\n\n\t\tif ( in_array( 'capabilities', $fields, true ) ) {\n\t\t\t$data['capabilities'] = $post_type->cap;\n\t\t}\n\n\t\tif ( in_array( 'description', $fields, true ) ) {\n\t\t\t$data['description'] = $post_type->description;\n\t\t}\n\n\t\tif ( in_array( 'hierarchical', $fields, true ) ) {\n\t\t\t$data['hierarchical'] = $post_type->hierarchical;\n\t\t}\n\n\t\tif ( in_array( 'viewable', $fields, true ) ) {\n\t\t\t$data['viewable'] = is_post_type_viewable( $post_type );\n\t\t}\n\n\t\tif ( in_array( 'labels', $fields, true ) ) {\n\t\t\t$data['labels'] = $post_type->labels;\n\t\t}\n\n\t\tif ( in_array( 'name', $fields, true ) ) {\n\t\t\t$data['name'] = $post_type->label;\n\t\t}\n\n\t\tif ( in_array( 'slug', $fields, true ) ) {\n\t\t\t$data['slug'] = $post_type->name;\n\t\t}\n\n\t\tif ( in_array( 'supports', $fields, true ) ) {\n\t\t\t$data['supports'] = $supports;\n\t\t}\n\n\t\tif ( in_array( 'taxonomies', $fields, true ) ) {\n\t\t\t$data['taxonomies'] = array_values( $taxonomies );\n\t\t}\n\n\t\tif ( in_array( 'rest_base', $fields, true ) ) {\n\t\t\t$data['rest_base'] = $base;\n\t\t}\n\n\t\t$context = ! empty( $request['context'] ) ? $request['context'] : 'view';\n\t\t$data    = $this->add_additional_fields_to_object( $data, $request );\n\t\t$data    = $this->filter_response_by_context( $data, $context );\n\n\t\t// Wrap the data in a response object.\n\t\t$response = rest_ensure_response( $data );\n\n\t\t$response->add_links(\n\t\t\tarray(\n\t\t\t\t'collection'              => array(\n\t\t\t\t\t'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),\n\t\t\t\t),\n\t\t\t\t'https://api.w.org/items' => array(\n\t\t\t\t\t'href' => rest_url( sprintf( 'wp/v2/%s', $base ) ),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Filters a post type returned from the API.\n\t\t *\n\t\t * Allows modification of the post type data right before it is returned.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_REST_Response $response  The response object.\n\t\t * @param WP_Post_Type     $post_type The original post type object.\n\t\t * @param WP_REST_Request  $request   Request used to generate the response.\n\t\t */\n\t\treturn apply_filters( 'rest_prepare_post_type', $response, $post_type, $request );\n\t}\n\n\t/**\n\t * Retrieves the post type's schema, conforming to JSON Schema.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$schema = array(\n\t\t\t'$schema'    => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title'      => 'type',\n\t\t\t'type'       => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'capabilities' => array(\n\t\t\t\t\t'description' => __( 'All capabilities used by the post type.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'description'  => array(\n\t\t\t\t\t'description' => __( 'A human-readable description of the post type.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'hierarchical' => array(\n\t\t\t\t\t'description' => __( 'Whether or not the post type should have children.' ),\n\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'viewable'     => array(\n\t\t\t\t\t'description' => __( 'Whether or not the post type can be viewed.' ),\n\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'labels'       => array(\n\t\t\t\t\t'description' => __( 'Human-readable labels for the post type for various contexts.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'name'         => array(\n\t\t\t\t\t'description' => __( 'The title for the post type.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'slug'         => array(\n\t\t\t\t\t'description' => __( 'An alphanumeric identifier for the post type.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'supports'     => array(\n\t\t\t\t\t'description' => __( 'All features, supported by the post type.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'taxonomies'   => array(\n\t\t\t\t\t'description' => __( 'Taxonomies associated with post type.' ),\n\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t'items'       => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'rest_base'    => array(\n\t\t\t\t\t'description' => __( 'REST base route for the post type.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->schema = $schema;\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}\n\n\t/**\n\t * Retrieves the query params for collections.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Collection parameters.\n\t */\n\tpublic function get_collection_params() {\n\t\treturn array(\n\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t);\n\t}\n\n}\n", "num_lines": 359}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Posts_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.7.0\n */\n\n/**\n * Core class to access posts via the REST API.\n *\n * @since 4.7.0\n *\n * @see WP_REST_Controller\n */\nclass WP_REST_Posts_Controller extends WP_REST_Controller {\n\t/**\n\t * Post type.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tprotected $post_type;\n\n\t/**\n\t * Instance of a post meta fields object.\n\t *\n\t * @since 4.7.0\n\t * @var WP_REST_Post_Meta_Fields\n\t */\n\tprotected $meta;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $post_type Post type.\n\t */\n\tpublic function __construct( $post_type ) {\n\t\t$this->post_type = $post_type;\n\t\t$this->namespace = 'wp/v2';\n\t\t$obj             = get_post_type_object( $post_type );\n\t\t$this->rest_base = ! empty( $obj->rest_base ) ? $obj->rest_base : $obj->name;\n\n\t\t$this->meta = new WP_REST_Post_Meta_Fields( $this->post_type );\n\t}\n\n\t/**\n\t * Registers the routes for the objects of the controller.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see register_rest_route()\n\t */\n\tpublic function register_routes() {\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_items' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::CREATABLE,\n\t\t\t\t\t'callback'            => array( $this, 'create_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'create_item_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t\t$schema        = $this->get_item_schema();\n\t\t$get_item_args = array(\n\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t);\n\t\tif ( isset( $schema['properties']['password'] ) ) {\n\t\t\t$get_item_args['password'] = array(\n\t\t\t\t'description' => __( 'The password for the post if it is password protected.' ),\n\t\t\t\t'type'        => 'string',\n\t\t\t);\n\t\t}\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base . '/(?P<id>[\\d]+)',\n\t\t\tarray(\n\t\t\t\t'args'   => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'description' => __( 'Unique identifier for the object.' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t\t\t'args'                => $get_item_args,\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::EDITABLE,\n\t\t\t\t\t'callback'            => array( $this, 'update_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'update_item_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::DELETABLE,\n\t\t\t\t\t'callback'            => array( $this, 'delete_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'delete_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'force' => array(\n\t\t\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t\t\t'default'     => false,\n\t\t\t\t\t\t\t'description' => __( 'Whether to bypass Trash and force deletion.' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Checks if a given request has access to read posts.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access, WP_Error object otherwise.\n\t */\n\tpublic function get_items_permissions_check( $request ) {\n\n\t\t$post_type = get_post_type_object( $this->post_type );\n\n\t\tif ( 'edit' === $request['context'] && ! current_user_can( $post_type->cap->edit_posts ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_forbidden_context',\n\t\t\t\t__( 'Sorry, you are not allowed to edit posts in this post type.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves a collection of posts.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_items( $request ) {\n\n\t\t// Ensure a search string is set in case the orderby is set to 'relevance'.\n\t\tif ( ! empty( $request['orderby'] ) && 'relevance' === $request['orderby'] && empty( $request['search'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_no_search_term_defined',\n\t\t\t\t__( 'You need to define a search term to order by relevance.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t// Ensure an include parameter is set in case the orderby is set to 'include'.\n\t\tif ( ! empty( $request['orderby'] ) && 'include' === $request['orderby'] && empty( $request['include'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_orderby_include_missing_include',\n\t\t\t\t__( 'You need to define an include parameter to order by include.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t// Retrieve the list of registered collection query parameters.\n\t\t$registered = $this->get_collection_params();\n\t\t$args       = array();\n\n\t\t/*\n\t\t * This array defines mappings between public API query parameters whose\n\t\t * values are accepted as-passed, and their internal WP_Query parameter\n\t\t * name equivalents (some are the same). Only values which are also\n\t\t * present in $registered will be set.\n\t\t */\n\t\t$parameter_mappings = array(\n\t\t\t'author'         => 'author__in',\n\t\t\t'author_exclude' => 'author__not_in',\n\t\t\t'exclude'        => 'post__not_in',\n\t\t\t'include'        => 'post__in',\n\t\t\t'menu_order'     => 'menu_order',\n\t\t\t'offset'         => 'offset',\n\t\t\t'order'          => 'order',\n\t\t\t'orderby'        => 'orderby',\n\t\t\t'page'           => 'paged',\n\t\t\t'parent'         => 'post_parent__in',\n\t\t\t'parent_exclude' => 'post_parent__not_in',\n\t\t\t'search'         => 's',\n\t\t\t'slug'           => 'post_name__in',\n\t\t\t'status'         => 'post_status',\n\t\t);\n\n\t\t/*\n\t\t * For each known parameter which is both registered and present in the request,\n\t\t * set the parameter's value on the query $args.\n\t\t */\n\t\tforeach ( $parameter_mappings as $api_param => $wp_param ) {\n\t\t\tif ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) {\n\t\t\t\t$args[ $wp_param ] = $request[ $api_param ];\n\t\t\t}\n\t\t}\n\n\t\t// Check for & assign any parameters which require special handling or setting.\n\t\t$args['date_query'] = array();\n\n\t\t// Set before into date query. Date query must be specified as an array of an array.\n\t\tif ( isset( $registered['before'], $request['before'] ) ) {\n\t\t\t$args['date_query'][0]['before'] = $request['before'];\n\t\t}\n\n\t\t// Set after into date query. Date query must be specified as an array of an array.\n\t\tif ( isset( $registered['after'], $request['after'] ) ) {\n\t\t\t$args['date_query'][0]['after'] = $request['after'];\n\t\t}\n\n\t\t// Ensure our per_page parameter overrides any provided posts_per_page filter.\n\t\tif ( isset( $registered['per_page'] ) ) {\n\t\t\t$args['posts_per_page'] = $request['per_page'];\n\t\t}\n\n\t\tif ( isset( $registered['sticky'], $request['sticky'] ) ) {\n\t\t\t$sticky_posts = get_option( 'sticky_posts', array() );\n\t\t\tif ( ! is_array( $sticky_posts ) ) {\n\t\t\t\t$sticky_posts = array();\n\t\t\t}\n\t\t\tif ( $request['sticky'] ) {\n\t\t\t\t/*\n\t\t\t\t * As post__in will be used to only get sticky posts,\n\t\t\t\t * we have to support the case where post__in was already\n\t\t\t\t * specified.\n\t\t\t\t */\n\t\t\t\t$args['post__in'] = $args['post__in'] ? array_intersect( $sticky_posts, $args['post__in'] ) : $sticky_posts;\n\n\t\t\t\t/*\n\t\t\t\t * If we intersected, but there are no post IDs in common,\n\t\t\t\t * WP_Query won't return \"no posts\" for post__in = array()\n\t\t\t\t * so we have to fake it a bit.\n\t\t\t\t */\n\t\t\t\tif ( ! $args['post__in'] ) {\n\t\t\t\t\t$args['post__in'] = array( 0 );\n\t\t\t\t}\n\t\t\t} elseif ( $sticky_posts ) {\n\t\t\t\t/*\n\t\t\t\t * As post___not_in will be used to only get posts that\n\t\t\t\t * are not sticky, we have to support the case where post__not_in\n\t\t\t\t * was already specified.\n\t\t\t\t */\n\t\t\t\t$args['post__not_in'] = array_merge( $args['post__not_in'], $sticky_posts );\n\t\t\t}\n\t\t}\n\n\t\t// Force the post_type argument, since it's not a user input variable.\n\t\t$args['post_type'] = $this->post_type;\n\n\t\t/**\n\t\t * Filters the query arguments for a request.\n\t\t *\n\t\t * Enables adding extra arguments or setting defaults for a post collection request.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @link https://developer.wordpress.org/reference/classes/wp_query/\n\t\t *\n\t\t * @param array           $args    Key value array of query var to query value.\n\t\t * @param WP_REST_Request $request The request used.\n\t\t */\n\t\t$args       = apply_filters( \"rest_{$this->post_type}_query\", $args, $request );\n\t\t$query_args = $this->prepare_items_query( $args, $request );\n\n\t\t$taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) );\n\n\t\tif ( ! empty( $request['tax_relation'] ) ) {\n\t\t\t$query_args['tax_query'] = array( 'relation' => $request['tax_relation'] );\n\t\t}\n\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t$base        = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name;\n\t\t\t$tax_exclude = $base . '_exclude';\n\n\t\t\tif ( ! empty( $request[ $base ] ) ) {\n\t\t\t\t$query_args['tax_query'][] = array(\n\t\t\t\t\t'taxonomy'         => $taxonomy->name,\n\t\t\t\t\t'field'            => 'term_id',\n\t\t\t\t\t'terms'            => $request[ $base ],\n\t\t\t\t\t'include_children' => false,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( ! empty( $request[ $tax_exclude ] ) ) {\n\t\t\t\t$query_args['tax_query'][] = array(\n\t\t\t\t\t'taxonomy'         => $taxonomy->name,\n\t\t\t\t\t'field'            => 'term_id',\n\t\t\t\t\t'terms'            => $request[ $tax_exclude ],\n\t\t\t\t\t'include_children' => false,\n\t\t\t\t\t'operator'         => 'NOT IN',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$posts_query  = new WP_Query();\n\t\t$query_result = $posts_query->query( $query_args );\n\n\t\t// Allow access to all password protected posts if the context is edit.\n\t\tif ( 'edit' === $request['context'] ) {\n\t\t\tadd_filter( 'post_password_required', '__return_false' );\n\t\t}\n\n\t\t$posts = array();\n\n\t\tforeach ( $query_result as $post ) {\n\t\t\tif ( ! $this->check_read_permission( $post ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$data    = $this->prepare_item_for_response( $post, $request );\n\t\t\t$posts[] = $this->prepare_response_for_collection( $data );\n\t\t}\n\n\t\t// Reset filter.\n\t\tif ( 'edit' === $request['context'] ) {\n\t\t\tremove_filter( 'post_password_required', '__return_false' );\n\t\t}\n\n\t\t$page        = (int) $query_args['paged'];\n\t\t$total_posts = $posts_query->found_posts;\n\n\t\tif ( $total_posts < 1 ) {\n\t\t\t// Out-of-bounds, run the query again without LIMIT for total count.\n\t\t\tunset( $query_args['paged'] );\n\n\t\t\t$count_query = new WP_Query();\n\t\t\t$count_query->query( $query_args );\n\t\t\t$total_posts = $count_query->found_posts;\n\t\t}\n\n\t\t$max_pages = ceil( $total_posts / (int) $posts_query->query_vars['posts_per_page'] );\n\n\t\tif ( $page > $max_pages && $total_posts > 0 ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_post_invalid_page_number',\n\t\t\t\t__( 'The page number requested is larger than the number of pages available.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t$response = rest_ensure_response( $posts );\n\n\t\t$response->header( 'X-WP-Total', (int) $total_posts );\n\t\t$response->header( 'X-WP-TotalPages', (int) $max_pages );\n\n\t\t$request_params = $request->get_query_params();\n\t\t$base           = add_query_arg( urlencode_deep( $request_params ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );\n\n\t\tif ( $page > 1 ) {\n\t\t\t$prev_page = $page - 1;\n\n\t\t\tif ( $prev_page > $max_pages ) {\n\t\t\t\t$prev_page = $max_pages;\n\t\t\t}\n\n\t\t\t$prev_link = add_query_arg( 'page', $prev_page, $base );\n\t\t\t$response->link_header( 'prev', $prev_link );\n\t\t}\n\t\tif ( $max_pages > $page ) {\n\t\t\t$next_page = $page + 1;\n\t\t\t$next_link = add_query_arg( 'page', $next_page, $base );\n\n\t\t\t$response->link_header( 'next', $next_link );\n\t\t}\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Get the post, if the ID is valid.\n\t *\n\t * @since 4.7.2\n\t *\n\t * @param int $id Supplied ID.\n\t * @return WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise.\n\t */\n\tprotected function get_post( $id ) {\n\t\t$error = new WP_Error(\n\t\t\t'rest_post_invalid_id',\n\t\t\t__( 'Invalid post ID.' ),\n\t\t\tarray( 'status' => 404 )\n\t\t);\n\n\t\tif ( (int) $id <= 0 ) {\n\t\t\treturn $error;\n\t\t}\n\n\t\t$post = get_post( (int) $id );\n\t\tif ( empty( $post ) || empty( $post->ID ) || $this->post_type !== $post->post_type ) {\n\t\t\treturn $error;\n\t\t}\n\n\t\treturn $post;\n\t}\n\n\t/**\n\t * Checks if a given request has access to read a post.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return bool|WP_Error True if the request has read access for the item, WP_Error object otherwise.\n\t */\n\tpublic function get_item_permissions_check( $request ) {\n\t\t$post = $this->get_post( $request['id'] );\n\t\tif ( is_wp_error( $post ) ) {\n\t\t\treturn $post;\n\t\t}\n\n\t\tif ( 'edit' === $request['context'] && $post && ! $this->check_update_permission( $post ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_forbidden_context',\n\t\t\t\t__( 'Sorry, you are not allowed to edit this post.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( $post && ! empty( $request['password'] ) ) {\n\t\t\t// Check post password, and return error if invalid.\n\t\t\tif ( ! hash_equals( $post->post_password, $request['password'] ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_post_incorrect_password',\n\t\t\t\t\t__( 'Incorrect post password.' ),\n\t\t\t\t\tarray( 'status' => 403 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Allow access to all password protected posts if the context is edit.\n\t\tif ( 'edit' === $request['context'] ) {\n\t\t\tadd_filter( 'post_password_required', '__return_false' );\n\t\t}\n\n\t\tif ( $post ) {\n\t\t\treturn $this->check_read_permission( $post );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks if the user can access password-protected content.\n\t *\n\t * This method determines whether we need to override the regular password\n\t * check in core with a filter.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Post         $post    Post to check against.\n\t * @param WP_REST_Request $request Request data to check.\n\t * @return bool True if the user can access password-protected content, otherwise false.\n\t */\n\tpublic function can_access_password_content( $post, $request ) {\n\t\tif ( empty( $post->post_password ) ) {\n\t\t\t// No filter required.\n\t\t\treturn false;\n\t\t}\n\n\t\t// Edit context always gets access to password-protected posts.\n\t\tif ( 'edit' === $request['context'] ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// No password, no auth.\n\t\tif ( empty( $request['password'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Double-check the request password.\n\t\treturn hash_equals( $post->post_password, $request['password'] );\n\t}\n\n\t/**\n\t * Retrieves a single post.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_item( $request ) {\n\t\t$post = $this->get_post( $request['id'] );\n\t\tif ( is_wp_error( $post ) ) {\n\t\t\treturn $post;\n\t\t}\n\n\t\t$data     = $this->prepare_item_for_response( $post, $request );\n\t\t$response = rest_ensure_response( $data );\n\n\t\tif ( is_post_type_viewable( get_post_type_object( $post->post_type ) ) ) {\n\t\t\t$response->link_header( 'alternate', get_permalink( $post->ID ), array( 'type' => 'text/html' ) );\n\t\t}\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Checks if a given request has access to create a post.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to create items, WP_Error object otherwise.\n\t */\n\tpublic function create_item_permissions_check( $request ) {\n\t\tif ( ! empty( $request['id'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_post_exists',\n\t\t\t\t__( 'Cannot create existing post.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t$post_type = get_post_type_object( $this->post_type );\n\n\t\tif ( ! empty( $request['author'] ) && get_current_user_id() !== $request['author'] && ! current_user_can( $post_type->cap->edit_others_posts ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_edit_others',\n\t\t\t\t__( 'Sorry, you are not allowed to create posts as this user.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) && ! current_user_can( $post_type->cap->publish_posts ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_assign_sticky',\n\t\t\t\t__( 'Sorry, you are not allowed to make posts sticky.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! current_user_can( $post_type->cap->create_posts ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_create',\n\t\t\t\t__( 'Sorry, you are not allowed to create posts as this user.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! $this->check_assign_terms_permission( $request ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_assign_term',\n\t\t\t\t__( 'Sorry, you are not allowed to assign the provided terms.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Creates a single post.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function create_item( $request ) {\n\t\tif ( ! empty( $request['id'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_post_exists',\n\t\t\t\t__( 'Cannot create existing post.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t$prepared_post = $this->prepare_item_for_database( $request );\n\n\t\tif ( is_wp_error( $prepared_post ) ) {\n\t\t\treturn $prepared_post;\n\t\t}\n\n\t\t$prepared_post->post_type = $this->post_type;\n\n\t\t$post_id = wp_insert_post( wp_slash( (array) $prepared_post ), true );\n\n\t\tif ( is_wp_error( $post_id ) ) {\n\n\t\t\tif ( 'db_insert_error' === $post_id->get_error_code() ) {\n\t\t\t\t$post_id->add_data( array( 'status' => 500 ) );\n\t\t\t} else {\n\t\t\t\t$post_id->add_data( array( 'status' => 400 ) );\n\t\t\t}\n\n\t\t\treturn $post_id;\n\t\t}\n\n\t\t$post = get_post( $post_id );\n\n\t\t/**\n\t\t * Fires after a single post is created or updated via the REST API.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_Post         $post     Inserted or updated post object.\n\t\t * @param WP_REST_Request $request  Request object.\n\t\t * @param bool            $creating True when creating a post, false when updating.\n\t\t */\n\t\tdo_action( \"rest_insert_{$this->post_type}\", $post, $request, true );\n\n\t\t$schema = $this->get_item_schema();\n\n\t\tif ( ! empty( $schema['properties']['sticky'] ) ) {\n\t\t\tif ( ! empty( $request['sticky'] ) ) {\n\t\t\t\tstick_post( $post_id );\n\t\t\t} else {\n\t\t\t\tunstick_post( $post_id );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $schema['properties']['featured_media'] ) && isset( $request['featured_media'] ) ) {\n\t\t\t$this->handle_featured_media( $request['featured_media'], $post_id );\n\t\t}\n\n\t\tif ( ! empty( $schema['properties']['format'] ) && ! empty( $request['format'] ) ) {\n\t\t\tset_post_format( $post, $request['format'] );\n\t\t}\n\n\t\tif ( ! empty( $schema['properties']['template'] ) && isset( $request['template'] ) ) {\n\t\t\t$this->handle_template( $request['template'], $post_id, true );\n\t\t}\n\n\t\t$terms_update = $this->handle_terms( $post_id, $request );\n\n\t\tif ( is_wp_error( $terms_update ) ) {\n\t\t\treturn $terms_update;\n\t\t}\n\n\t\tif ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) {\n\t\t\t$meta_update = $this->meta->update_value( $request['meta'], $post_id );\n\n\t\t\tif ( is_wp_error( $meta_update ) ) {\n\t\t\t\treturn $meta_update;\n\t\t\t}\n\t\t}\n\n\t\t$post          = get_post( $post_id );\n\t\t$fields_update = $this->update_additional_fields_for_object( $post, $request );\n\n\t\tif ( is_wp_error( $fields_update ) ) {\n\t\t\treturn $fields_update;\n\t\t}\n\n\t\t$request->set_param( 'context', 'edit' );\n\n\t\t/**\n\t\t * Fires after a single post is completely created or updated via the REST API.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.\n\t\t *\n\t\t * @since 5.0.0\n\t\t *\n\t\t * @param WP_Post         $post     Inserted or updated post object.\n\t\t * @param WP_REST_Request $request  Request object.\n\t\t * @param bool            $creating True when creating a post, false when updating.\n\t\t */\n\t\tdo_action( \"rest_after_insert_{$this->post_type}\", $post, $request, true );\n\n\t\t$response = $this->prepare_item_for_response( $post, $request );\n\t\t$response = rest_ensure_response( $response );\n\n\t\t$response->set_status( 201 );\n\t\t$response->header( 'Location', rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $post_id ) ) );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Checks if a given request has access to update a post.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise.\n\t */\n\tpublic function update_item_permissions_check( $request ) {\n\t\t$post = $this->get_post( $request['id'] );\n\t\tif ( is_wp_error( $post ) ) {\n\t\t\treturn $post;\n\t\t}\n\n\t\t$post_type = get_post_type_object( $this->post_type );\n\n\t\tif ( $post && ! $this->check_update_permission( $post ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_edit',\n\t\t\t\t__( 'Sorry, you are not allowed to edit this post.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $request['author'] ) && get_current_user_id() !== $request['author'] && ! current_user_can( $post_type->cap->edit_others_posts ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_edit_others',\n\t\t\t\t__( 'Sorry, you are not allowed to update posts as this user.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) && ! current_user_can( $post_type->cap->publish_posts ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_assign_sticky',\n\t\t\t\t__( 'Sorry, you are not allowed to make posts sticky.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! $this->check_assign_terms_permission( $request ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_assign_term',\n\t\t\t\t__( 'Sorry, you are not allowed to assign the provided terms.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Updates a single post.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function update_item( $request ) {\n\t\t$valid_check = $this->get_post( $request['id'] );\n\t\tif ( is_wp_error( $valid_check ) ) {\n\t\t\treturn $valid_check;\n\t\t}\n\n\t\t$post = $this->prepare_item_for_database( $request );\n\n\t\tif ( is_wp_error( $post ) ) {\n\t\t\treturn $post;\n\t\t}\n\n\t\t// Convert the post object to an array, otherwise wp_update_post() will expect non-escaped input.\n\t\t$post_id = wp_update_post( wp_slash( (array) $post ), true );\n\n\t\tif ( is_wp_error( $post_id ) ) {\n\t\t\tif ( 'db_update_error' === $post_id->get_error_code() ) {\n\t\t\t\t$post_id->add_data( array( 'status' => 500 ) );\n\t\t\t} else {\n\t\t\t\t$post_id->add_data( array( 'status' => 400 ) );\n\t\t\t}\n\t\t\treturn $post_id;\n\t\t}\n\n\t\t$post = get_post( $post_id );\n\n\t\t/** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */\n\t\tdo_action( \"rest_insert_{$this->post_type}\", $post, $request, false );\n\n\t\t$schema = $this->get_item_schema();\n\n\t\tif ( ! empty( $schema['properties']['format'] ) && ! empty( $request['format'] ) ) {\n\t\t\tset_post_format( $post, $request['format'] );\n\t\t}\n\n\t\tif ( ! empty( $schema['properties']['featured_media'] ) && isset( $request['featured_media'] ) ) {\n\t\t\t$this->handle_featured_media( $request['featured_media'], $post_id );\n\t\t}\n\n\t\tif ( ! empty( $schema['properties']['sticky'] ) && isset( $request['sticky'] ) ) {\n\t\t\tif ( ! empty( $request['sticky'] ) ) {\n\t\t\t\tstick_post( $post_id );\n\t\t\t} else {\n\t\t\t\tunstick_post( $post_id );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $schema['properties']['template'] ) && isset( $request['template'] ) ) {\n\t\t\t$this->handle_template( $request['template'], $post->ID );\n\t\t}\n\n\t\t$terms_update = $this->handle_terms( $post->ID, $request );\n\n\t\tif ( is_wp_error( $terms_update ) ) {\n\t\t\treturn $terms_update;\n\t\t}\n\n\t\tif ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) {\n\t\t\t$meta_update = $this->meta->update_value( $request['meta'], $post->ID );\n\n\t\t\tif ( is_wp_error( $meta_update ) ) {\n\t\t\t\treturn $meta_update;\n\t\t\t}\n\t\t}\n\n\t\t$post          = get_post( $post_id );\n\t\t$fields_update = $this->update_additional_fields_for_object( $post, $request );\n\n\t\tif ( is_wp_error( $fields_update ) ) {\n\t\t\treturn $fields_update;\n\t\t}\n\n\t\t$request->set_param( 'context', 'edit' );\n\n\t\t// Filter is fired in WP_REST_Attachments_Controller subclass.\n\t\tif ( 'attachment' === $this->post_type ) {\n\t\t\t$response = $this->prepare_item_for_response( $post, $request );\n\t\t\treturn rest_ensure_response( $response );\n\t\t}\n\n\t\t/** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */\n\t\tdo_action( \"rest_after_insert_{$this->post_type}\", $post, $request, false );\n\n\t\t$response = $this->prepare_item_for_response( $post, $request );\n\n\t\treturn rest_ensure_response( $response );\n\t}\n\n\t/**\n\t * Checks if a given request has access to delete a post.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise.\n\t */\n\tpublic function delete_item_permissions_check( $request ) {\n\t\t$post = $this->get_post( $request['id'] );\n\t\tif ( is_wp_error( $post ) ) {\n\t\t\treturn $post;\n\t\t}\n\n\t\tif ( $post && ! $this->check_delete_permission( $post ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_delete',\n\t\t\t\t__( 'Sorry, you are not allowed to delete this post.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Deletes a single post.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function delete_item( $request ) {\n\t\t$post = $this->get_post( $request['id'] );\n\t\tif ( is_wp_error( $post ) ) {\n\t\t\treturn $post;\n\t\t}\n\n\t\t$id    = $post->ID;\n\t\t$force = (bool) $request['force'];\n\n\t\t$supports_trash = ( EMPTY_TRASH_DAYS > 0 );\n\n\t\tif ( 'attachment' === $post->post_type ) {\n\t\t\t$supports_trash = $supports_trash && MEDIA_TRASH;\n\t\t}\n\n\t\t/**\n\t\t * Filters whether a post is trashable.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.\n\t\t *\n\t\t * Pass false to disable Trash support for the post.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param bool    $supports_trash Whether the post type support trashing.\n\t\t * @param WP_Post $post           The Post object being considered for trashing support.\n\t\t */\n\t\t$supports_trash = apply_filters( \"rest_{$this->post_type}_trashable\", $supports_trash, $post );\n\n\t\tif ( ! $this->check_delete_permission( $post ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_user_cannot_delete_post',\n\t\t\t\t__( 'Sorry, you are not allowed to delete this post.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\t$request->set_param( 'context', 'edit' );\n\n\t\t// If we're forcing, then delete permanently.\n\t\tif ( $force ) {\n\t\t\t$previous = $this->prepare_item_for_response( $post, $request );\n\t\t\t$result   = wp_delete_post( $id, true );\n\t\t\t$response = new WP_REST_Response();\n\t\t\t$response->set_data(\n\t\t\t\tarray(\n\t\t\t\t\t'deleted'  => true,\n\t\t\t\t\t'previous' => $previous->get_data(),\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t// If we don't support trashing for this type, error out.\n\t\t\tif ( ! $supports_trash ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_trash_not_supported',\n\t\t\t\t\t/* translators: %s: force=true */\n\t\t\t\t\tsprintf( __( \"The post does not support trashing. Set '%s' to delete.\" ), 'force=true' ),\n\t\t\t\t\tarray( 'status' => 501 )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Otherwise, only trash if we haven't already.\n\t\t\tif ( 'trash' === $post->post_status ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_already_trashed',\n\t\t\t\t\t__( 'The post has already been deleted.' ),\n\t\t\t\t\tarray( 'status' => 410 )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// (Note that internally this falls through to `wp_delete_post()`\n\t\t\t// if the Trash is disabled.)\n\t\t\t$result   = wp_trash_post( $id );\n\t\t\t$post     = get_post( $id );\n\t\t\t$response = $this->prepare_item_for_response( $post, $request );\n\t\t}\n\n\t\tif ( ! $result ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_delete',\n\t\t\t\t__( 'The post cannot be deleted.' ),\n\t\t\t\tarray( 'status' => 500 )\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Fires immediately after a single post is deleted or trashed via the REST API.\n\t\t *\n\t\t * They dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_Post          $post     The deleted or trashed post.\n\t\t * @param WP_REST_Response $response The response data.\n\t\t * @param WP_REST_Request  $request  The request sent to the API.\n\t\t */\n\t\tdo_action( \"rest_delete_{$this->post_type}\", $post, $response, $request );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Determines the allowed query_vars for a get_items() response and prepares\n\t * them for WP_Query.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array           $prepared_args Optional. Prepared WP_Query arguments. Default empty array.\n\t * @param WP_REST_Request $request       Optional. Full details about the request.\n\t * @return array Items query arguments.\n\t */\n\tprotected function prepare_items_query( $prepared_args = array(), $request = null ) {\n\t\t$query_args = array();\n\n\t\tforeach ( $prepared_args as $key => $value ) {\n\t\t\t/**\n\t\t\t * Filters the query_vars used in get_items() for the constructed query.\n\t\t\t *\n\t\t\t * The dynamic portion of the hook name, `$key`, refers to the query_var key.\n\t\t\t *\n\t\t\t * @since 4.7.0\n\t\t\t *\n\t\t\t * @param string $value The query_var value.\n\t\t\t */\n\t\t\t$query_args[ $key ] = apply_filters( \"rest_query_var-{$key}\", $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t\t}\n\n\t\tif ( 'post' !== $this->post_type || ! isset( $query_args['ignore_sticky_posts'] ) ) {\n\t\t\t$query_args['ignore_sticky_posts'] = true;\n\t\t}\n\n\t\t// Map to proper WP_Query orderby param.\n\t\tif ( isset( $query_args['orderby'] ) && isset( $request['orderby'] ) ) {\n\t\t\t$orderby_mappings = array(\n\t\t\t\t'id'            => 'ID',\n\t\t\t\t'include'       => 'post__in',\n\t\t\t\t'slug'          => 'post_name',\n\t\t\t\t'include_slugs' => 'post_name__in',\n\t\t\t);\n\n\t\t\tif ( isset( $orderby_mappings[ $request['orderby'] ] ) ) {\n\t\t\t\t$query_args['orderby'] = $orderby_mappings[ $request['orderby'] ];\n\t\t\t}\n\t\t}\n\n\t\treturn $query_args;\n\t}\n\n\t/**\n\t * Checks the post_date_gmt or modified_gmt and prepare any post or\n\t * modified date for single post output.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string      $date_gmt GMT publication time.\n\t * @param string|null $date     Optional. Local publication time. Default null.\n\t * @return string|null ISO8601/RFC3339 formatted datetime.\n\t */\n\tprotected function prepare_date_response( $date_gmt, $date = null ) {\n\t\t// Use the date if passed.\n\t\tif ( isset( $date ) ) {\n\t\t\treturn mysql_to_rfc3339( $date );\n\t\t}\n\n\t\t// Return null if $date_gmt is empty/zeros.\n\t\tif ( '0000-00-00 00:00:00' === $date_gmt ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Return the formatted datetime.\n\t\treturn mysql_to_rfc3339( $date_gmt );\n\t}\n\n\t/**\n\t * Prepares a single post for create or update.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Request object.\n\t * @return stdClass|WP_Error Post object or WP_Error.\n\t */\n\tprotected function prepare_item_for_database( $request ) {\n\t\t$prepared_post = new stdClass();\n\n\t\t// Post ID.\n\t\tif ( isset( $request['id'] ) ) {\n\t\t\t$existing_post = $this->get_post( $request['id'] );\n\t\t\tif ( is_wp_error( $existing_post ) ) {\n\t\t\t\treturn $existing_post;\n\t\t\t}\n\n\t\t\t$prepared_post->ID = $existing_post->ID;\n\t\t}\n\n\t\t$schema = $this->get_item_schema();\n\n\t\t// Post title.\n\t\tif ( ! empty( $schema['properties']['title'] ) && isset( $request['title'] ) ) {\n\t\t\tif ( is_string( $request['title'] ) ) {\n\t\t\t\t$prepared_post->post_title = $request['title'];\n\t\t\t} elseif ( ! empty( $request['title']['raw'] ) ) {\n\t\t\t\t$prepared_post->post_title = $request['title']['raw'];\n\t\t\t}\n\t\t}\n\n\t\t// Post content.\n\t\tif ( ! empty( $schema['properties']['content'] ) && isset( $request['content'] ) ) {\n\t\t\tif ( is_string( $request['content'] ) ) {\n\t\t\t\t$prepared_post->post_content = $request['content'];\n\t\t\t} elseif ( isset( $request['content']['raw'] ) ) {\n\t\t\t\t$prepared_post->post_content = $request['content']['raw'];\n\t\t\t}\n\t\t}\n\n\t\t// Post excerpt.\n\t\tif ( ! empty( $schema['properties']['excerpt'] ) && isset( $request['excerpt'] ) ) {\n\t\t\tif ( is_string( $request['excerpt'] ) ) {\n\t\t\t\t$prepared_post->post_excerpt = $request['excerpt'];\n\t\t\t} elseif ( isset( $request['excerpt']['raw'] ) ) {\n\t\t\t\t$prepared_post->post_excerpt = $request['excerpt']['raw'];\n\t\t\t}\n\t\t}\n\n\t\t// Post type.\n\t\tif ( empty( $request['id'] ) ) {\n\t\t\t// Creating new post, use default type for the controller.\n\t\t\t$prepared_post->post_type = $this->post_type;\n\t\t} else {\n\t\t\t// Updating a post, use previous type.\n\t\t\t$prepared_post->post_type = get_post_type( $request['id'] );\n\t\t}\n\n\t\t$post_type = get_post_type_object( $prepared_post->post_type );\n\n\t\t// Post status.\n\t\tif ( ! empty( $schema['properties']['status'] ) && isset( $request['status'] ) ) {\n\t\t\t$status = $this->handle_status_param( $request['status'], $post_type );\n\n\t\t\tif ( is_wp_error( $status ) ) {\n\t\t\t\treturn $status;\n\t\t\t}\n\n\t\t\t$prepared_post->post_status = $status;\n\t\t}\n\n\t\t// Post date.\n\t\tif ( ! empty( $schema['properties']['date'] ) && ! empty( $request['date'] ) ) {\n\t\t\t$current_date = isset( $prepared_post->ID ) ? get_post( $prepared_post->ID )->post_date : false;\n\t\t\t$date_data    = rest_get_date_with_gmt( $request['date'] );\n\n\t\t\tif ( ! empty( $date_data ) && $current_date !== $date_data[0] ) {\n\t\t\t\tlist( $prepared_post->post_date, $prepared_post->post_date_gmt ) = $date_data;\n\t\t\t\t$prepared_post->edit_date                                        = true;\n\t\t\t}\n\t\t} elseif ( ! empty( $schema['properties']['date_gmt'] ) && ! empty( $request['date_gmt'] ) ) {\n\t\t\t$current_date = isset( $prepared_post->ID ) ? get_post( $prepared_post->ID )->post_date_gmt : false;\n\t\t\t$date_data    = rest_get_date_with_gmt( $request['date_gmt'], true );\n\n\t\t\tif ( ! empty( $date_data ) && $current_date !== $date_data[1] ) {\n\t\t\t\tlist( $prepared_post->post_date, $prepared_post->post_date_gmt ) = $date_data;\n\t\t\t\t$prepared_post->edit_date                                        = true;\n\t\t\t}\n\t\t}\n\n\t\t// Sending a null date or date_gmt value resets date and date_gmt to their\n\t\t// default values (`0000-00-00 00:00:00`).\n\t\tif (\n\t\t\t( ! empty( $schema['properties']['date_gmt'] ) && $request->has_param( 'date_gmt' ) && null === $request['date_gmt'] ) ||\n\t\t\t( ! empty( $schema['properties']['date'] ) && $request->has_param( 'date' ) && null === $request['date'] )\n\t\t) {\n\t\t\t$prepared_post->post_date_gmt = null;\n\t\t\t$prepared_post->post_date     = null;\n\t\t}\n\n\t\t// Post slug.\n\t\tif ( ! empty( $schema['properties']['slug'] ) && isset( $request['slug'] ) ) {\n\t\t\t$prepared_post->post_name = $request['slug'];\n\t\t}\n\n\t\t// Author.\n\t\tif ( ! empty( $schema['properties']['author'] ) && ! empty( $request['author'] ) ) {\n\t\t\t$post_author = (int) $request['author'];\n\n\t\t\tif ( get_current_user_id() !== $post_author ) {\n\t\t\t\t$user_obj = get_userdata( $post_author );\n\n\t\t\t\tif ( ! $user_obj ) {\n\t\t\t\t\treturn new WP_Error(\n\t\t\t\t\t\t'rest_invalid_author',\n\t\t\t\t\t\t__( 'Invalid author ID.' ),\n\t\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$prepared_post->post_author = $post_author;\n\t\t}\n\n\t\t// Post password.\n\t\tif ( ! empty( $schema['properties']['password'] ) && isset( $request['password'] ) ) {\n\t\t\t$prepared_post->post_password = $request['password'];\n\n\t\t\tif ( '' !== $request['password'] ) {\n\t\t\t\tif ( ! empty( $schema['properties']['sticky'] ) && ! empty( $request['sticky'] ) ) {\n\t\t\t\t\treturn new WP_Error(\n\t\t\t\t\t\t'rest_invalid_field',\n\t\t\t\t\t\t__( 'A post can not be sticky and have a password.' ),\n\t\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $prepared_post->ID ) && is_sticky( $prepared_post->ID ) ) {\n\t\t\t\t\treturn new WP_Error(\n\t\t\t\t\t\t'rest_invalid_field',\n\t\t\t\t\t\t__( 'A sticky post can not be password protected.' ),\n\t\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $schema['properties']['sticky'] ) && ! empty( $request['sticky'] ) ) {\n\t\t\tif ( ! empty( $prepared_post->ID ) && post_password_required( $prepared_post->ID ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_invalid_field',\n\t\t\t\t\t__( 'A password protected post can not be set to sticky.' ),\n\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Parent.\n\t\tif ( ! empty( $schema['properties']['parent'] ) && isset( $request['parent'] ) ) {\n\t\t\tif ( 0 === (int) $request['parent'] ) {\n\t\t\t\t$prepared_post->post_parent = 0;\n\t\t\t} else {\n\t\t\t\t$parent = get_post( (int) $request['parent'] );\n\n\t\t\t\tif ( empty( $parent ) ) {\n\t\t\t\t\treturn new WP_Error(\n\t\t\t\t\t\t'rest_post_invalid_id',\n\t\t\t\t\t\t__( 'Invalid post parent ID.' ),\n\t\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$prepared_post->post_parent = (int) $parent->ID;\n\t\t\t}\n\t\t}\n\n\t\t// Menu order.\n\t\tif ( ! empty( $schema['properties']['menu_order'] ) && isset( $request['menu_order'] ) ) {\n\t\t\t$prepared_post->menu_order = (int) $request['menu_order'];\n\t\t}\n\n\t\t// Comment status.\n\t\tif ( ! empty( $schema['properties']['comment_status'] ) && ! empty( $request['comment_status'] ) ) {\n\t\t\t$prepared_post->comment_status = $request['comment_status'];\n\t\t}\n\n\t\t// Ping status.\n\t\tif ( ! empty( $schema['properties']['ping_status'] ) && ! empty( $request['ping_status'] ) ) {\n\t\t\t$prepared_post->ping_status = $request['ping_status'];\n\t\t}\n\n\t\tif ( ! empty( $schema['properties']['template'] ) ) {\n\t\t\t// Force template to null so that it can be handled exclusively by the REST controller.\n\t\t\t$prepared_post->page_template = null;\n\t\t}\n\n\t\t/**\n\t\t * Filters a post before it is inserted via the REST API.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param stdClass        $prepared_post An object representing a single post prepared\n\t\t *                                       for inserting or updating the database.\n\t\t * @param WP_REST_Request $request       Request object.\n\t\t */\n\t\treturn apply_filters( \"rest_pre_insert_{$this->post_type}\", $prepared_post, $request );\n\n\t}\n\n\t/**\n\t * Determines validity and normalizes the given status parameter.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string       $post_status Post status.\n\t * @param WP_Post_Type $post_type   Post type.\n\t * @return string|WP_Error Post status or WP_Error if lacking the proper permission.\n\t */\n\tprotected function handle_status_param( $post_status, $post_type ) {\n\n\t\tswitch ( $post_status ) {\n\t\t\tcase 'draft':\n\t\t\tcase 'pending':\n\t\t\t\tbreak;\n\t\t\tcase 'private':\n\t\t\t\tif ( ! current_user_can( $post_type->cap->publish_posts ) ) {\n\t\t\t\t\treturn new WP_Error(\n\t\t\t\t\t\t'rest_cannot_publish',\n\t\t\t\t\t\t__( 'Sorry, you are not allowed to create private posts in this post type.' ),\n\t\t\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'publish':\n\t\t\tcase 'future':\n\t\t\t\tif ( ! current_user_can( $post_type->cap->publish_posts ) ) {\n\t\t\t\t\treturn new WP_Error(\n\t\t\t\t\t\t'rest_cannot_publish',\n\t\t\t\t\t\t__( 'Sorry, you are not allowed to publish posts in this post type.' ),\n\t\t\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif ( ! get_post_status_object( $post_status ) ) {\n\t\t\t\t\t$post_status = 'draft';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $post_status;\n\t}\n\n\t/**\n\t * Determines the featured media based on a request param.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param int $featured_media Featured Media ID.\n\t * @param int $post_id        Post ID.\n\t * @return bool|WP_Error Whether the post thumbnail was successfully deleted, otherwise WP_Error.\n\t */\n\tprotected function handle_featured_media( $featured_media, $post_id ) {\n\n\t\t$featured_media = (int) $featured_media;\n\t\tif ( $featured_media ) {\n\t\t\t$result = set_post_thumbnail( $post_id, $featured_media );\n\t\t\tif ( $result ) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_invalid_featured_media',\n\t\t\t\t\t__( 'Invalid featured media ID.' ),\n\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\treturn delete_post_thumbnail( $post_id );\n\t\t}\n\n\t}\n\n\t/**\n\t * Check whether the template is valid for the given post.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param string          $template Page template filename.\n\t * @param WP_REST_Request $request  Request.\n\t * @return bool|WP_Error True if template is still valid or if the same as existing value, or false if template not supported.\n\t */\n\tpublic function check_template( $template, $request ) {\n\n\t\tif ( ! $template ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( $request['id'] ) {\n\t\t\t$current_template = get_page_template_slug( $request['id'] );\n\t\t} else {\n\t\t\t$current_template = '';\n\t\t}\n\n\t\t// Always allow for updating a post to the same template, even if that template is no longer supported.\n\t\tif ( $template === $current_template ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// If this is a create request, get_post() will return null and wp theme will fallback to the passed post type.\n\t\t$allowed_templates = wp_get_theme()->get_page_templates( get_post( $request['id'] ), $this->post_type );\n\n\t\tif ( isset( $allowed_templates[ $template ] ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn new WP_Error(\n\t\t\t'rest_invalid_param',\n\t\t\t/* translators: 1: Parameter, 2: List of valid values. */\n\t\t\tsprintf( __( '%1$s is not one of %2$s.' ), 'template', implode( ', ', array_keys( $allowed_templates ) ) )\n\t\t);\n\t}\n\n\t/**\n\t * Sets the template for a post.\n\t *\n\t * @since 4.7.0\n\t * @since 4.9.0 Added the `$validate` parameter.\n\t *\n\t * @param string  $template Page template filename.\n\t * @param integer $post_id  Post ID.\n\t * @param bool    $validate Whether to validate that the template selected is valid.\n\t */\n\tpublic function handle_template( $template, $post_id, $validate = false ) {\n\n\t\tif ( $validate && ! array_key_exists( $template, wp_get_theme()->get_page_templates( get_post( $post_id ) ) ) ) {\n\t\t\t$template = '';\n\t\t}\n\n\t\tupdate_post_meta( $post_id, '_wp_page_template', $template );\n\t}\n\n\t/**\n\t * Updates the post's terms from a REST request.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param int             $post_id The post ID to update the terms form.\n\t * @param WP_REST_Request $request The request object with post and terms data.\n\t * @return null|WP_Error WP_Error on an error assigning any of the terms, otherwise null.\n\t */\n\tprotected function handle_terms( $post_id, $request ) {\n\t\t$taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) );\n\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t$base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name;\n\n\t\t\tif ( ! isset( $request[ $base ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$result = wp_set_object_terms( $post_id, $request[ $base ], $taxonomy->name );\n\n\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether current user can assign all terms sent with the current request.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request The request object with post and terms data.\n\t * @return bool Whether the current user can assign the provided terms.\n\t */\n\tprotected function check_assign_terms_permission( $request ) {\n\t\t$taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) );\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t$base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name;\n\n\t\t\tif ( ! isset( $request[ $base ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ( $request[ $base ] as $term_id ) {\n\t\t\t\t// Invalid terms will be rejected later.\n\t\t\t\tif ( ! get_term( $term_id, $taxonomy->name ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( ! current_user_can( 'assign_term', (int) $term_id ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks if a given post type can be viewed or managed.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Post_Type|string $post_type Post type name or object.\n\t * @return bool Whether the post type is allowed in REST.\n\t */\n\tprotected function check_is_post_type_allowed( $post_type ) {\n\t\tif ( ! is_object( $post_type ) ) {\n\t\t\t$post_type = get_post_type_object( $post_type );\n\t\t}\n\n\t\tif ( ! empty( $post_type ) && ! empty( $post_type->show_in_rest ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks if a post can be read.\n\t *\n\t * Correctly handles posts with the inherit status.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Post $post Post object.\n\t * @return bool Whether the post can be read.\n\t */\n\tpublic function check_read_permission( $post ) {\n\t\t$post_type = get_post_type_object( $post->post_type );\n\t\tif ( ! $this->check_is_post_type_allowed( $post_type ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Is the post readable?\n\t\tif ( 'publish' === $post->post_status || current_user_can( 'read_post', $post->ID ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$post_status_obj = get_post_status_object( $post->post_status );\n\t\tif ( $post_status_obj && $post_status_obj->public ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Can we read the parent if we're inheriting?\n\t\tif ( 'inherit' === $post->post_status && $post->post_parent > 0 ) {\n\t\t\t$parent = get_post( $post->post_parent );\n\t\t\tif ( $parent ) {\n\t\t\t\treturn $this->check_read_permission( $parent );\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * If there isn't a parent, but the status is set to inherit, assume\n\t\t * it's published (as per get_post_status()).\n\t\t */\n\t\tif ( 'inherit' === $post->post_status ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks if a post can be edited.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Post $post Post object.\n\t * @return bool Whether the post can be edited.\n\t */\n\tprotected function check_update_permission( $post ) {\n\t\t$post_type = get_post_type_object( $post->post_type );\n\n\t\tif ( ! $this->check_is_post_type_allowed( $post_type ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn current_user_can( 'edit_post', $post->ID );\n\t}\n\n\t/**\n\t * Checks if a post can be created.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Post $post Post object.\n\t * @return bool Whether the post can be created.\n\t */\n\tprotected function check_create_permission( $post ) {\n\t\t$post_type = get_post_type_object( $post->post_type );\n\n\t\tif ( ! $this->check_is_post_type_allowed( $post_type ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn current_user_can( $post_type->cap->create_posts );\n\t}\n\n\t/**\n\t * Checks if a post can be deleted.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Post $post Post object.\n\t * @return bool Whether the post can be deleted.\n\t */\n\tprotected function check_delete_permission( $post ) {\n\t\t$post_type = get_post_type_object( $post->post_type );\n\n\t\tif ( ! $this->check_is_post_type_allowed( $post_type ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn current_user_can( 'delete_post', $post->ID );\n\t}\n\n\t/**\n\t * Prepares a single post output for response.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Post         $post    Post object.\n\t * @param WP_REST_Request $request Request object.\n\t * @return WP_REST_Response Response object.\n\t */\n\tpublic function prepare_item_for_response( $post, $request ) {\n\t\t$GLOBALS['post'] = $post;\n\n\t\tsetup_postdata( $post );\n\n\t\t$fields = $this->get_fields_for_response( $request );\n\n\t\t// Base fields for every post.\n\t\t$data = array();\n\n\t\tif ( rest_is_field_included( 'id', $fields ) ) {\n\t\t\t$data['id'] = $post->ID;\n\t\t}\n\n\t\tif ( rest_is_field_included( 'date', $fields ) ) {\n\t\t\t$data['date'] = $this->prepare_date_response( $post->post_date_gmt, $post->post_date );\n\t\t}\n\n\t\tif ( rest_is_field_included( 'date_gmt', $fields ) ) {\n\t\t\t/*\n\t\t\t * For drafts, `post_date_gmt` may not be set, indicating that the date\n\t\t\t * of the draft should be updated each time it is saved (see #38883).\n\t\t\t * In this case, shim the value based on the `post_date` field\n\t\t\t * with the site's timezone offset applied.\n\t\t\t */\n\t\t\tif ( '0000-00-00 00:00:00' === $post->post_date_gmt ) {\n\t\t\t\t$post_date_gmt = get_gmt_from_date( $post->post_date );\n\t\t\t} else {\n\t\t\t\t$post_date_gmt = $post->post_date_gmt;\n\t\t\t}\n\t\t\t$data['date_gmt'] = $this->prepare_date_response( $post_date_gmt );\n\t\t}\n\n\t\tif ( rest_is_field_included( 'guid', $fields ) ) {\n\t\t\t$data['guid'] = array(\n\t\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t\t'rendered' => apply_filters( 'get_the_guid', $post->guid, $post->ID ),\n\t\t\t\t'raw'      => $post->guid,\n\t\t\t);\n\t\t}\n\n\t\tif ( rest_is_field_included( 'modified', $fields ) ) {\n\t\t\t$data['modified'] = $this->prepare_date_response( $post->post_modified_gmt, $post->post_modified );\n\t\t}\n\n\t\tif ( rest_is_field_included( 'modified_gmt', $fields ) ) {\n\t\t\t/*\n\t\t\t * For drafts, `post_modified_gmt` may not be set (see `post_date_gmt` comments\n\t\t\t * above). In this case, shim the value based on the `post_modified` field\n\t\t\t * with the site's timezone offset applied.\n\t\t\t */\n\t\t\tif ( '0000-00-00 00:00:00' === $post->post_modified_gmt ) {\n\t\t\t\t$post_modified_gmt = gmdate( 'Y-m-d H:i:s', strtotime( $post->post_modified ) - ( get_option( 'gmt_offset' ) * 3600 ) );\n\t\t\t} else {\n\t\t\t\t$post_modified_gmt = $post->post_modified_gmt;\n\t\t\t}\n\t\t\t$data['modified_gmt'] = $this->prepare_date_response( $post_modified_gmt );\n\t\t}\n\n\t\tif ( rest_is_field_included( 'password', $fields ) ) {\n\t\t\t$data['password'] = $post->post_password;\n\t\t}\n\n\t\tif ( rest_is_field_included( 'slug', $fields ) ) {\n\t\t\t$data['slug'] = $post->post_name;\n\t\t}\n\n\t\tif ( rest_is_field_included( 'status', $fields ) ) {\n\t\t\t$data['status'] = $post->post_status;\n\t\t}\n\n\t\tif ( rest_is_field_included( 'type', $fields ) ) {\n\t\t\t$data['type'] = $post->post_type;\n\t\t}\n\n\t\tif ( rest_is_field_included( 'link', $fields ) ) {\n\t\t\t$data['link'] = get_permalink( $post->ID );\n\t\t}\n\n\t\tif ( rest_is_field_included( 'title', $fields ) ) {\n\t\t\t$data['title'] = array();\n\t\t}\n\t\tif ( rest_is_field_included( 'title.raw', $fields ) ) {\n\t\t\t$data['title']['raw'] = $post->post_title;\n\t\t}\n\t\tif ( rest_is_field_included( 'title.rendered', $fields ) ) {\n\t\t\tadd_filter( 'protected_title_format', array( $this, 'protected_title_format' ) );\n\n\t\t\t$data['title']['rendered'] = get_the_title( $post->ID );\n\n\t\t\tremove_filter( 'protected_title_format', array( $this, 'protected_title_format' ) );\n\t\t}\n\n\t\t$has_password_filter = false;\n\n\t\tif ( $this->can_access_password_content( $post, $request ) ) {\n\t\t\t// Allow access to the post, permissions already checked before.\n\t\t\tadd_filter( 'post_password_required', '__return_false' );\n\n\t\t\t$has_password_filter = true;\n\t\t}\n\n\t\tif ( rest_is_field_included( 'content', $fields ) ) {\n\t\t\t$data['content'] = array();\n\t\t}\n\t\tif ( rest_is_field_included( 'content.raw', $fields ) ) {\n\t\t\t$data['content']['raw'] = $post->post_content;\n\t\t}\n\t\tif ( rest_is_field_included( 'content.rendered', $fields ) ) {\n\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t$data['content']['rendered'] = post_password_required( $post ) ? '' : apply_filters( 'the_content', $post->post_content );\n\t\t}\n\t\tif ( rest_is_field_included( 'content.protected', $fields ) ) {\n\t\t\t$data['content']['protected'] = (bool) $post->post_password;\n\t\t}\n\t\tif ( rest_is_field_included( 'content.block_version', $fields ) ) {\n\t\t\t$data['content']['block_version'] = block_version( $post->post_content );\n\t\t}\n\n\t\tif ( rest_is_field_included( 'excerpt', $fields ) ) {\n\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t$excerpt = apply_filters( 'get_the_excerpt', $post->post_excerpt, $post );\n\n\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t$excerpt = apply_filters( 'the_excerpt', $excerpt );\n\n\t\t\t$data['excerpt'] = array(\n\t\t\t\t'raw'       => $post->post_excerpt,\n\t\t\t\t'rendered'  => post_password_required( $post ) ? '' : $excerpt,\n\t\t\t\t'protected' => (bool) $post->post_password,\n\t\t\t);\n\t\t}\n\n\t\tif ( $has_password_filter ) {\n\t\t\t// Reset filter.\n\t\t\tremove_filter( 'post_password_required', '__return_false' );\n\t\t}\n\n\t\tif ( rest_is_field_included( 'author', $fields ) ) {\n\t\t\t$data['author'] = (int) $post->post_author;\n\t\t}\n\n\t\tif ( rest_is_field_included( 'featured_media', $fields ) ) {\n\t\t\t$data['featured_media'] = (int) get_post_thumbnail_id( $post->ID );\n\t\t}\n\n\t\tif ( rest_is_field_included( 'parent', $fields ) ) {\n\t\t\t$data['parent'] = (int) $post->post_parent;\n\t\t}\n\n\t\tif ( rest_is_field_included( 'menu_order', $fields ) ) {\n\t\t\t$data['menu_order'] = (int) $post->menu_order;\n\t\t}\n\n\t\tif ( rest_is_field_included( 'comment_status', $fields ) ) {\n\t\t\t$data['comment_status'] = $post->comment_status;\n\t\t}\n\n\t\tif ( rest_is_field_included( 'ping_status', $fields ) ) {\n\t\t\t$data['ping_status'] = $post->ping_status;\n\t\t}\n\n\t\tif ( rest_is_field_included( 'sticky', $fields ) ) {\n\t\t\t$data['sticky'] = is_sticky( $post->ID );\n\t\t}\n\n\t\tif ( rest_is_field_included( 'template', $fields ) ) {\n\t\t\t$template = get_page_template_slug( $post->ID );\n\t\t\tif ( $template ) {\n\t\t\t\t$data['template'] = $template;\n\t\t\t} else {\n\t\t\t\t$data['template'] = '';\n\t\t\t}\n\t\t}\n\n\t\tif ( rest_is_field_included( 'format', $fields ) ) {\n\t\t\t$data['format'] = get_post_format( $post->ID );\n\n\t\t\t// Fill in blank post format.\n\t\t\tif ( empty( $data['format'] ) ) {\n\t\t\t\t$data['format'] = 'standard';\n\t\t\t}\n\t\t}\n\n\t\tif ( rest_is_field_included( 'meta', $fields ) ) {\n\t\t\t$data['meta'] = $this->meta->get_value( $post->ID, $request );\n\t\t}\n\n\t\t$taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) );\n\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t$base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name;\n\n\t\t\tif ( rest_is_field_included( $base, $fields ) ) {\n\t\t\t\t$terms         = get_the_terms( $post, $taxonomy->name );\n\t\t\t\t$data[ $base ] = $terms ? array_values( wp_list_pluck( $terms, 'term_id' ) ) : array();\n\t\t\t}\n\t\t}\n\n\t\t$post_type_obj = get_post_type_object( $post->post_type );\n\t\tif ( is_post_type_viewable( $post_type_obj ) && $post_type_obj->public ) {\n\t\t\t$permalink_template_requested = rest_is_field_included( 'permalink_template', $fields );\n\t\t\t$generated_slug_requested     = rest_is_field_included( 'generated_slug', $fields );\n\n\t\t\tif ( $permalink_template_requested || $generated_slug_requested ) {\n\t\t\t\tif ( ! function_exists( 'get_sample_permalink' ) ) {\n\t\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/post.php';\n\t\t\t\t}\n\n\t\t\t\t$sample_permalink = get_sample_permalink( $post->ID, $post->post_title, '' );\n\n\t\t\t\tif ( $permalink_template_requested ) {\n\t\t\t\t\t$data['permalink_template'] = $sample_permalink[0];\n\t\t\t\t}\n\n\t\t\t\tif ( $generated_slug_requested ) {\n\t\t\t\t\t$data['generated_slug'] = $sample_permalink[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$context = ! empty( $request['context'] ) ? $request['context'] : 'view';\n\t\t$data    = $this->add_additional_fields_to_object( $data, $request );\n\t\t$data    = $this->filter_response_by_context( $data, $context );\n\n\t\t// Wrap the data in a response object.\n\t\t$response = rest_ensure_response( $data );\n\n\t\t$links = $this->prepare_links( $post );\n\t\t$response->add_links( $links );\n\n\t\tif ( ! empty( $links['self']['href'] ) ) {\n\t\t\t$actions = $this->get_available_actions( $post, $request );\n\n\t\t\t$self = $links['self']['href'];\n\n\t\t\tforeach ( $actions as $rel ) {\n\t\t\t\t$response->add_link( $rel, $self );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the post data for a response.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_REST_Response $response The response object.\n\t\t * @param WP_Post          $post     Post object.\n\t\t * @param WP_REST_Request  $request  Request object.\n\t\t */\n\t\treturn apply_filters( \"rest_prepare_{$this->post_type}\", $response, $post, $request );\n\t}\n\n\t/**\n\t * Overwrites the default protected title format.\n\t *\n\t * By default, WordPress will show password protected posts with a title of\n\t * \"Protected: %s\", as the REST API communicates the protected status of a post\n\t * in a machine readable format, we remove the \"Protected: \" prefix.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return string Protected title format.\n\t */\n\tpublic function protected_title_format() {\n\t\treturn '%s';\n\t}\n\n\t/**\n\t * Prepares links for the request.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Post $post Post object.\n\t * @return array Links for the given post.\n\t */\n\tprotected function prepare_links( $post ) {\n\t\t$base = sprintf( '%s/%s', $this->namespace, $this->rest_base );\n\n\t\t// Entity meta.\n\t\t$links = array(\n\t\t\t'self'       => array(\n\t\t\t\t'href' => rest_url( trailingslashit( $base ) . $post->ID ),\n\t\t\t),\n\t\t\t'collection' => array(\n\t\t\t\t'href' => rest_url( $base ),\n\t\t\t),\n\t\t\t'about'      => array(\n\t\t\t\t'href' => rest_url( 'wp/v2/types/' . $this->post_type ),\n\t\t\t),\n\t\t);\n\n\t\tif ( ( in_array( $post->post_type, array( 'post', 'page' ), true ) || post_type_supports( $post->post_type, 'author' ) )\n\t\t\t&& ! empty( $post->post_author ) ) {\n\t\t\t$links['author'] = array(\n\t\t\t\t'href'       => rest_url( 'wp/v2/users/' . $post->post_author ),\n\t\t\t\t'embeddable' => true,\n\t\t\t);\n\t\t}\n\n\t\tif ( in_array( $post->post_type, array( 'post', 'page' ), true ) || post_type_supports( $post->post_type, 'comments' ) ) {\n\t\t\t$replies_url = rest_url( 'wp/v2/comments' );\n\t\t\t$replies_url = add_query_arg( 'post', $post->ID, $replies_url );\n\n\t\t\t$links['replies'] = array(\n\t\t\t\t'href'       => $replies_url,\n\t\t\t\t'embeddable' => true,\n\t\t\t);\n\t\t}\n\n\t\tif ( in_array( $post->post_type, array( 'post', 'page' ), true ) || post_type_supports( $post->post_type, 'revisions' ) ) {\n\t\t\t$revisions       = wp_get_post_revisions( $post->ID, array( 'fields' => 'ids' ) );\n\t\t\t$revisions_count = count( $revisions );\n\n\t\t\t$links['version-history'] = array(\n\t\t\t\t'href'  => rest_url( trailingslashit( $base ) . $post->ID . '/revisions' ),\n\t\t\t\t'count' => $revisions_count,\n\t\t\t);\n\n\t\t\tif ( $revisions_count > 0 ) {\n\t\t\t\t$last_revision = array_shift( $revisions );\n\n\t\t\t\t$links['predecessor-version'] = array(\n\t\t\t\t\t'href' => rest_url( trailingslashit( $base ) . $post->ID . '/revisions/' . $last_revision ),\n\t\t\t\t\t'id'   => $last_revision,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$post_type_obj = get_post_type_object( $post->post_type );\n\n\t\tif ( $post_type_obj->hierarchical && ! empty( $post->post_parent ) ) {\n\t\t\t$links['up'] = array(\n\t\t\t\t'href'       => rest_url( trailingslashit( $base ) . (int) $post->post_parent ),\n\t\t\t\t'embeddable' => true,\n\t\t\t);\n\t\t}\n\n\t\t// If we have a featured media, add that.\n\t\t$featured_media = get_post_thumbnail_id( $post->ID );\n\t\tif ( $featured_media ) {\n\t\t\t$image_url = rest_url( 'wp/v2/media/' . $featured_media );\n\n\t\t\t$links['https://api.w.org/featuredmedia'] = array(\n\t\t\t\t'href'       => $image_url,\n\t\t\t\t'embeddable' => true,\n\t\t\t);\n\t\t}\n\n\t\tif ( ! in_array( $post->post_type, array( 'attachment', 'nav_menu_item', 'revision' ), true ) ) {\n\t\t\t$attachments_url = rest_url( 'wp/v2/media' );\n\t\t\t$attachments_url = add_query_arg( 'parent', $post->ID, $attachments_url );\n\n\t\t\t$links['https://api.w.org/attachment'] = array(\n\t\t\t\t'href' => $attachments_url,\n\t\t\t);\n\t\t}\n\n\t\t$taxonomies = get_object_taxonomies( $post->post_type );\n\n\t\tif ( ! empty( $taxonomies ) ) {\n\t\t\t$links['https://api.w.org/term'] = array();\n\n\t\t\tforeach ( $taxonomies as $tax ) {\n\t\t\t\t$taxonomy_obj = get_taxonomy( $tax );\n\n\t\t\t\t// Skip taxonomies that are not public.\n\t\t\t\tif ( empty( $taxonomy_obj->show_in_rest ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$tax_base = ! empty( $taxonomy_obj->rest_base ) ? $taxonomy_obj->rest_base : $tax;\n\n\t\t\t\t$terms_url = add_query_arg(\n\t\t\t\t\t'post',\n\t\t\t\t\t$post->ID,\n\t\t\t\t\trest_url( 'wp/v2/' . $tax_base )\n\t\t\t\t);\n\n\t\t\t\t$links['https://api.w.org/term'][] = array(\n\t\t\t\t\t'href'       => $terms_url,\n\t\t\t\t\t'taxonomy'   => $tax,\n\t\t\t\t\t'embeddable' => true,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $links;\n\t}\n\n\t/**\n\t * Get the link relations available for the post and current user.\n\t *\n\t * @since 4.9.8\n\t *\n\t * @param WP_Post         $post    Post object.\n\t * @param WP_REST_Request $request Request object.\n\t * @return array List of link relations.\n\t */\n\tprotected function get_available_actions( $post, $request ) {\n\n\t\tif ( 'edit' !== $request['context'] ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$rels = array();\n\n\t\t$post_type = get_post_type_object( $post->post_type );\n\n\t\tif ( 'attachment' !== $this->post_type && current_user_can( $post_type->cap->publish_posts ) ) {\n\t\t\t$rels[] = 'https://api.w.org/action-publish';\n\t\t}\n\n\t\tif ( current_user_can( 'unfiltered_html' ) ) {\n\t\t\t$rels[] = 'https://api.w.org/action-unfiltered-html';\n\t\t}\n\n\t\tif ( 'post' === $post_type->name ) {\n\t\t\tif ( current_user_can( $post_type->cap->edit_others_posts ) && current_user_can( $post_type->cap->publish_posts ) ) {\n\t\t\t\t$rels[] = 'https://api.w.org/action-sticky';\n\t\t\t}\n\t\t}\n\n\t\tif ( post_type_supports( $post_type->name, 'author' ) ) {\n\t\t\tif ( current_user_can( $post_type->cap->edit_others_posts ) ) {\n\t\t\t\t$rels[] = 'https://api.w.org/action-assign-author';\n\t\t\t}\n\t\t}\n\n\t\t$taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) );\n\n\t\tforeach ( $taxonomies as $tax ) {\n\t\t\t$tax_base   = ! empty( $tax->rest_base ) ? $tax->rest_base : $tax->name;\n\t\t\t$create_cap = is_taxonomy_hierarchical( $tax->name ) ? $tax->cap->edit_terms : $tax->cap->assign_terms;\n\n\t\t\tif ( current_user_can( $create_cap ) ) {\n\t\t\t\t$rels[] = 'https://api.w.org/action-create-' . $tax_base;\n\t\t\t}\n\n\t\t\tif ( current_user_can( $tax->cap->assign_terms ) ) {\n\t\t\t\t$rels[] = 'https://api.w.org/action-assign-' . $tax_base;\n\t\t\t}\n\t\t}\n\n\t\treturn $rels;\n\t}\n\n\t/**\n\t * Retrieves the post's schema, conforming to JSON Schema.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$schema = array(\n\t\t\t'$schema'    => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title'      => $this->post_type,\n\t\t\t'type'       => 'object',\n\t\t\t// Base properties for every Post.\n\t\t\t'properties' => array(\n\t\t\t\t'date'         => array(\n\t\t\t\t\t'description' => __( \"The date the object was published, in the site's timezone.\" ),\n\t\t\t\t\t'type'        => array( 'string', 'null' ),\n\t\t\t\t\t'format'      => 'date-time',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t\t'date_gmt'     => array(\n\t\t\t\t\t'description' => __( 'The date the object was published, as GMT.' ),\n\t\t\t\t\t'type'        => array( 'string', 'null' ),\n\t\t\t\t\t'format'      => 'date-time',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'guid'         => array(\n\t\t\t\t\t'description' => __( 'The globally unique identifier for the object.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'properties'  => array(\n\t\t\t\t\t\t'raw'      => array(\n\t\t\t\t\t\t\t'description' => __( 'GUID for the object, as it exists in the database.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'rendered' => array(\n\t\t\t\t\t\t\t'description' => __( 'GUID for the object, transformed for display.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'id'           => array(\n\t\t\t\t\t'description' => __( 'Unique identifier for the object.' ),\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'link'         => array(\n\t\t\t\t\t'description' => __( 'URL to the object.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'modified'     => array(\n\t\t\t\t\t'description' => __( \"The date the object was last modified, in the site's timezone.\" ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'date-time',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'modified_gmt' => array(\n\t\t\t\t\t'description' => __( 'The date the object was last modified, as GMT.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'date-time',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'slug'         => array(\n\t\t\t\t\t'description' => __( 'An alphanumeric identifier for the object unique to its type.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => array( $this, 'sanitize_slug' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'status'       => array(\n\t\t\t\t\t'description' => __( 'A named status for the object.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'enum'        => array_keys( get_post_stati( array( 'internal' => false ) ) ),\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'type'         => array(\n\t\t\t\t\t'description' => __( 'Type of Post for the object.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'password'     => array(\n\t\t\t\t\t'description' => __( 'A password to protect access to the content and excerpt.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$post_type_obj = get_post_type_object( $this->post_type );\n\t\tif ( is_post_type_viewable( $post_type_obj ) && $post_type_obj->public ) {\n\t\t\t$schema['properties']['permalink_template'] = array(\n\t\t\t\t'description' => __( 'Permalink template for the object.' ),\n\t\t\t\t'type'        => 'string',\n\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t'readonly'    => true,\n\t\t\t);\n\n\t\t\t$schema['properties']['generated_slug'] = array(\n\t\t\t\t'description' => __( 'Slug automatically generated from the object title.' ),\n\t\t\t\t'type'        => 'string',\n\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t'readonly'    => true,\n\t\t\t);\n\t\t}\n\n\t\tif ( $post_type_obj->hierarchical ) {\n\t\t\t$schema['properties']['parent'] = array(\n\t\t\t\t'description' => __( 'The ID for the parent of the object.' ),\n\t\t\t\t'type'        => 'integer',\n\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t);\n\t\t}\n\n\t\t$post_type_attributes = array(\n\t\t\t'title',\n\t\t\t'editor',\n\t\t\t'author',\n\t\t\t'excerpt',\n\t\t\t'thumbnail',\n\t\t\t'comments',\n\t\t\t'revisions',\n\t\t\t'page-attributes',\n\t\t\t'post-formats',\n\t\t\t'custom-fields',\n\t\t);\n\t\t$fixed_schemas        = array(\n\t\t\t'post'       => array(\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t\t'author',\n\t\t\t\t'excerpt',\n\t\t\t\t'thumbnail',\n\t\t\t\t'comments',\n\t\t\t\t'revisions',\n\t\t\t\t'post-formats',\n\t\t\t\t'custom-fields',\n\t\t\t),\n\t\t\t'page'       => array(\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t\t'author',\n\t\t\t\t'excerpt',\n\t\t\t\t'thumbnail',\n\t\t\t\t'comments',\n\t\t\t\t'revisions',\n\t\t\t\t'page-attributes',\n\t\t\t\t'custom-fields',\n\t\t\t),\n\t\t\t'attachment' => array(\n\t\t\t\t'title',\n\t\t\t\t'author',\n\t\t\t\t'comments',\n\t\t\t\t'revisions',\n\t\t\t\t'custom-fields',\n\t\t\t),\n\t\t);\n\n\t\tforeach ( $post_type_attributes as $attribute ) {\n\t\t\tif ( isset( $fixed_schemas[ $this->post_type ] ) && ! in_array( $attribute, $fixed_schemas[ $this->post_type ], true ) ) {\n\t\t\t\tcontinue;\n\t\t\t} elseif ( ! isset( $fixed_schemas[ $this->post_type ] ) && ! post_type_supports( $this->post_type, $attribute ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch ( $attribute ) {\n\n\t\t\t\tcase 'title':\n\t\t\t\t\t$schema['properties']['title'] = array(\n\t\t\t\t\t\t'description' => __( 'The title for the object.' ),\n\t\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database().\n\t\t\t\t\t\t\t'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database().\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'properties'  => array(\n\t\t\t\t\t\t\t'raw'      => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Title for the object, as it exists in the database.' ),\n\t\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'rendered' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'HTML title for the object, transformed for display.' ),\n\t\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t\t\t\t'readonly'    => true,\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\tbreak;\n\n\t\t\t\tcase 'editor':\n\t\t\t\t\t$schema['properties']['content'] = array(\n\t\t\t\t\t\t'description' => __( 'The content for the object.' ),\n\t\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database().\n\t\t\t\t\t\t\t'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database().\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'properties'  => array(\n\t\t\t\t\t\t\t'raw'           => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Content for the object, as it exists in the database.' ),\n\t\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'rendered'      => array(\n\t\t\t\t\t\t\t\t'description' => __( 'HTML content for the object, transformed for display.' ),\n\t\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'block_version' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Version of the content block format used by the object.' ),\n\t\t\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'protected'     => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Whether the content is protected with a password.' ),\n\t\t\t\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t\t\t\t'readonly'    => true,\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\tbreak;\n\n\t\t\t\tcase 'author':\n\t\t\t\t\t$schema['properties']['author'] = array(\n\t\t\t\t\t\t'description' => __( 'The ID for the author of the object.' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'excerpt':\n\t\t\t\t\t$schema['properties']['excerpt'] = array(\n\t\t\t\t\t\t'description' => __( 'The excerpt for the object.' ),\n\t\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t\t'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database().\n\t\t\t\t\t\t\t'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database().\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'properties'  => array(\n\t\t\t\t\t\t\t'raw'       => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Excerpt for the object, as it exists in the database.' ),\n\t\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'rendered'  => array(\n\t\t\t\t\t\t\t\t'description' => __( 'HTML excerpt for the object, transformed for display.' ),\n\t\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'protected' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Whether the excerpt is protected with a password.' ),\n\t\t\t\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t\t\t\t'readonly'    => true,\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\tbreak;\n\n\t\t\t\tcase 'thumbnail':\n\t\t\t\t\t$schema['properties']['featured_media'] = array(\n\t\t\t\t\t\t'description' => __( 'The ID of the featured media for the object.' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'comments':\n\t\t\t\t\t$schema['properties']['comment_status'] = array(\n\t\t\t\t\t\t'description' => __( 'Whether or not comments are open on the object.' ),\n\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t'enum'        => array( 'open', 'closed' ),\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t);\n\t\t\t\t\t$schema['properties']['ping_status']    = array(\n\t\t\t\t\t\t'description' => __( 'Whether or not the object can be pinged.' ),\n\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t'enum'        => array( 'open', 'closed' ),\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'page-attributes':\n\t\t\t\t\t$schema['properties']['menu_order'] = array(\n\t\t\t\t\t\t'description' => __( 'The order of the object in relation to other object of its type.' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'post-formats':\n\t\t\t\t\t// Get the native post formats and remove the array keys.\n\t\t\t\t\t$formats = array_values( get_post_format_slugs() );\n\n\t\t\t\t\t$schema['properties']['format'] = array(\n\t\t\t\t\t\t'description' => __( 'The format for the object.' ),\n\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t'enum'        => $formats,\n\t\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'custom-fields':\n\t\t\t\t\t$schema['properties']['meta'] = $this->meta->get_field_schema();\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}\n\n\t\tif ( 'post' === $this->post_type ) {\n\t\t\t$schema['properties']['sticky'] = array(\n\t\t\t\t'description' => __( 'Whether or not the object should be treated as sticky.' ),\n\t\t\t\t'type'        => 'boolean',\n\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t);\n\t\t}\n\n\t\t$schema['properties']['template'] = array(\n\t\t\t'description' => __( 'The theme file to use to display the object.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t'arg_options' => array(\n\t\t\t\t'validate_callback' => array( $this, 'check_template' ),\n\t\t\t),\n\t\t);\n\n\t\t$taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) );\n\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t$base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name;\n\n\t\t\tif ( array_key_exists( $base, $schema['properties'] ) ) {\n\t\t\t\t$taxonomy_field_name_with_conflict = ! empty( $taxonomy->rest_base ) ? 'rest_base' : 'name';\n\t\t\t\t_doing_it_wrong(\n\t\t\t\t\t'register_taxonomy',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: 1. The taxonomy name, 2. The property name, either 'rest_base' or 'name', 3. The conflicting value. */\n\t\t\t\t\t\t__( 'The \"%1$s\" taxonomy \"%2$s\" property (%3$s) conflicts with an existing property on the REST API Posts Controller. Specify a custom \"rest_base\" when registering the taxonomy to avoid this error.' ),\n\t\t\t\t\t\t$taxonomy->name,\n\t\t\t\t\t\t$taxonomy_field_name_with_conflict,\n\t\t\t\t\t\t$base\n\t\t\t\t\t),\n\t\t\t\t\t'5.4.0'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$schema['properties'][ $base ] = array(\n\t\t\t\t/* translators: %s: Taxonomy name. */\n\t\t\t\t'description' => sprintf( __( 'The terms assigned to the object in the %s taxonomy.' ), $taxonomy->name ),\n\t\t\t\t'type'        => 'array',\n\t\t\t\t'items'       => array(\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t),\n\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t);\n\t\t}\n\n\t\t$schema_links = $this->get_schema_links();\n\n\t\tif ( $schema_links ) {\n\t\t\t$schema['links'] = $schema_links;\n\t\t}\n\n\t\t// Take a snapshot of which fields are in the schema pre-filtering.\n\t\t$schema_fields = array_keys( $schema['properties'] );\n\n\t\t/**\n\t\t * Filter the post's schema.\n\t\t *\n\t\t * The dynamic portion of the filter, `$this->post_type`, refers to the\n\t\t * post type slug for the controller.\n\t\t *\n\t\t * @since 5.4.0\n\t\t *\n\t\t * @param array $schema Item schema data.\n\t\t */\n\t\t$schema = apply_filters( \"rest_{$this->post_type}_item_schema\", $schema );\n\n\t\t// Emit a _doing_it_wrong warning if user tries to add new properties using this filter.\n\t\t$new_fields = array_diff( array_keys( $schema['properties'] ), $schema_fields );\n\t\tif ( count( $new_fields ) > 0 ) {\n\t\t\t_doing_it_wrong(\n\t\t\t\t__METHOD__,\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: register_rest_field */\n\t\t\t\t\t__( 'Please use %s to add new schema properties.' ),\n\t\t\t\t\t'register_rest_field'\n\t\t\t\t),\n\t\t\t\t'5.4.0'\n\t\t\t);\n\t\t}\n\n\t\t$this->schema = $schema;\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}\n\n\t/**\n\t * Retrieve Link Description Objects that should be added to the Schema for the posts collection.\n\t *\n\t * @since 4.9.8\n\t *\n\t * @return array\n\t */\n\tprotected function get_schema_links() {\n\n\t\t$href = rest_url( \"{$this->namespace}/{$this->rest_base}/{id}\" );\n\n\t\t$links = array();\n\n\t\tif ( 'attachment' !== $this->post_type ) {\n\t\t\t$links[] = array(\n\t\t\t\t'rel'          => 'https://api.w.org/action-publish',\n\t\t\t\t'title'        => __( 'The current user can publish this post.' ),\n\t\t\t\t'href'         => $href,\n\t\t\t\t'targetSchema' => array(\n\t\t\t\t\t'type'       => 'object',\n\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t'status' => array(\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t'enum' => array( 'publish', 'future' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\t$links[] = array(\n\t\t\t'rel'          => 'https://api.w.org/action-unfiltered-html',\n\t\t\t'title'        => __( 'The current user can post unfiltered HTML markup and JavaScript.' ),\n\t\t\t'href'         => $href,\n\t\t\t'targetSchema' => array(\n\t\t\t\t'type'       => 'object',\n\t\t\t\t'properties' => array(\n\t\t\t\t\t'content' => array(\n\t\t\t\t\t\t'raw' => array(\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\tif ( 'post' === $this->post_type ) {\n\t\t\t$links[] = array(\n\t\t\t\t'rel'          => 'https://api.w.org/action-sticky',\n\t\t\t\t'title'        => __( 'The current user can sticky this post.' ),\n\t\t\t\t'href'         => $href,\n\t\t\t\t'targetSchema' => array(\n\t\t\t\t\t'type'       => 'object',\n\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t'sticky' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\tif ( post_type_supports( $this->post_type, 'author' ) ) {\n\t\t\t$links[] = array(\n\t\t\t\t'rel'          => 'https://api.w.org/action-assign-author',\n\t\t\t\t'title'        => __( 'The current user can change the author on this post.' ),\n\t\t\t\t'href'         => $href,\n\t\t\t\t'targetSchema' => array(\n\t\t\t\t\t'type'       => 'object',\n\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t'author' => array(\n\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\t$taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) );\n\n\t\tforeach ( $taxonomies as $tax ) {\n\t\t\t$tax_base = ! empty( $tax->rest_base ) ? $tax->rest_base : $tax->name;\n\n\t\t\t/* translators: %s: Taxonomy name. */\n\t\t\t$assign_title = sprintf( __( 'The current user can assign terms in the %s taxonomy.' ), $tax->name );\n\t\t\t/* translators: %s: Taxonomy name. */\n\t\t\t$create_title = sprintf( __( 'The current user can create terms in the %s taxonomy.' ), $tax->name );\n\n\t\t\t$links[] = array(\n\t\t\t\t'rel'          => 'https://api.w.org/action-assign-' . $tax_base,\n\t\t\t\t'title'        => $assign_title,\n\t\t\t\t'href'         => $href,\n\t\t\t\t'targetSchema' => array(\n\t\t\t\t\t'type'       => 'object',\n\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t$tax_base => array(\n\t\t\t\t\t\t\t'type'  => 'array',\n\t\t\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t\t\t'type' => 'integer',\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\t\t\t);\n\n\t\t\t$links[] = array(\n\t\t\t\t'rel'          => 'https://api.w.org/action-create-' . $tax_base,\n\t\t\t\t'title'        => $create_title,\n\t\t\t\t'href'         => $href,\n\t\t\t\t'targetSchema' => array(\n\t\t\t\t\t'type'       => 'object',\n\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t$tax_base => array(\n\t\t\t\t\t\t\t'type'  => 'array',\n\t\t\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t\t\t'type' => 'integer',\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\t\t\t);\n\t\t}\n\n\t\treturn $links;\n\t}\n\n\t/**\n\t * Retrieves the query params for the posts collection.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Collection parameters.\n\t */\n\tpublic function get_collection_params() {\n\t\t$query_params = parent::get_collection_params();\n\n\t\t$query_params['context']['default'] = 'view';\n\n\t\t$query_params['after'] = array(\n\t\t\t'description' => __( 'Limit response to posts published after a given ISO8601 compliant date.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'format'      => 'date-time',\n\t\t);\n\n\t\tif ( post_type_supports( $this->post_type, 'author' ) ) {\n\t\t\t$query_params['author']         = array(\n\t\t\t\t'description' => __( 'Limit result set to posts assigned to specific authors.' ),\n\t\t\t\t'type'        => 'array',\n\t\t\t\t'items'       => array(\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t),\n\t\t\t\t'default'     => array(),\n\t\t\t);\n\t\t\t$query_params['author_exclude'] = array(\n\t\t\t\t'description' => __( 'Ensure result set excludes posts assigned to specific authors.' ),\n\t\t\t\t'type'        => 'array',\n\t\t\t\t'items'       => array(\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t),\n\t\t\t\t'default'     => array(),\n\t\t\t);\n\t\t}\n\n\t\t$query_params['before'] = array(\n\t\t\t'description' => __( 'Limit response to posts published before a given ISO8601 compliant date.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'format'      => 'date-time',\n\t\t);\n\n\t\t$query_params['exclude'] = array(\n\t\t\t'description' => __( 'Ensure result set excludes specific IDs.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'default'     => array(),\n\t\t);\n\n\t\t$query_params['include'] = array(\n\t\t\t'description' => __( 'Limit result set to specific IDs.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'default'     => array(),\n\t\t);\n\n\t\tif ( 'page' === $this->post_type || post_type_supports( $this->post_type, 'page-attributes' ) ) {\n\t\t\t$query_params['menu_order'] = array(\n\t\t\t\t'description' => __( 'Limit result set to posts with a specific menu_order value.' ),\n\t\t\t\t'type'        => 'integer',\n\t\t\t);\n\t\t}\n\n\t\t$query_params['offset'] = array(\n\t\t\t'description' => __( 'Offset the result set by a specific number of items.' ),\n\t\t\t'type'        => 'integer',\n\t\t);\n\n\t\t$query_params['order'] = array(\n\t\t\t'description' => __( 'Order sort attribute ascending or descending.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'default'     => 'desc',\n\t\t\t'enum'        => array( 'asc', 'desc' ),\n\t\t);\n\n\t\t$query_params['orderby'] = array(\n\t\t\t'description' => __( 'Sort collection by object attribute.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'default'     => 'date',\n\t\t\t'enum'        => array(\n\t\t\t\t'author',\n\t\t\t\t'date',\n\t\t\t\t'id',\n\t\t\t\t'include',\n\t\t\t\t'modified',\n\t\t\t\t'parent',\n\t\t\t\t'relevance',\n\t\t\t\t'slug',\n\t\t\t\t'include_slugs',\n\t\t\t\t'title',\n\t\t\t),\n\t\t);\n\n\t\tif ( 'page' === $this->post_type || post_type_supports( $this->post_type, 'page-attributes' ) ) {\n\t\t\t$query_params['orderby']['enum'][] = 'menu_order';\n\t\t}\n\n\t\t$post_type = get_post_type_object( $this->post_type );\n\n\t\tif ( $post_type->hierarchical || 'attachment' === $this->post_type ) {\n\t\t\t$query_params['parent']         = array(\n\t\t\t\t'description' => __( 'Limit result set to items with particular parent IDs.' ),\n\t\t\t\t'type'        => 'array',\n\t\t\t\t'items'       => array(\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t),\n\t\t\t\t'default'     => array(),\n\t\t\t);\n\t\t\t$query_params['parent_exclude'] = array(\n\t\t\t\t'description' => __( 'Limit result set to all items except those of a particular parent ID.' ),\n\t\t\t\t'type'        => 'array',\n\t\t\t\t'items'       => array(\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t),\n\t\t\t\t'default'     => array(),\n\t\t\t);\n\t\t}\n\n\t\t$query_params['slug'] = array(\n\t\t\t'description'       => __( 'Limit result set to posts with one or more specific slugs.' ),\n\t\t\t'type'              => 'array',\n\t\t\t'items'             => array(\n\t\t\t\t'type' => 'string',\n\t\t\t),\n\t\t\t'sanitize_callback' => 'wp_parse_slug_list',\n\t\t);\n\n\t\t$query_params['status'] = array(\n\t\t\t'default'           => 'publish',\n\t\t\t'description'       => __( 'Limit result set to posts assigned one or more statuses.' ),\n\t\t\t'type'              => 'array',\n\t\t\t'items'             => array(\n\t\t\t\t'enum' => array_merge( array_keys( get_post_stati() ), array( 'any' ) ),\n\t\t\t\t'type' => 'string',\n\t\t\t),\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_post_statuses' ),\n\t\t);\n\n\t\t$taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) );\n\n\t\tif ( ! empty( $taxonomies ) ) {\n\t\t\t$query_params['tax_relation'] = array(\n\t\t\t\t'description' => __( 'Limit result set based on relationship between multiple taxonomies.' ),\n\t\t\t\t'type'        => 'string',\n\t\t\t\t'enum'        => array( 'AND', 'OR' ),\n\t\t\t);\n\t\t}\n\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t$base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name;\n\n\t\t\t$query_params[ $base ] = array(\n\t\t\t\t/* translators: %s: Taxonomy name. */\n\t\t\t\t'description' => sprintf( __( 'Limit result set to all items that have the specified term assigned in the %s taxonomy.' ), $base ),\n\t\t\t\t'type'        => 'array',\n\t\t\t\t'items'       => array(\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t),\n\t\t\t\t'default'     => array(),\n\t\t\t);\n\n\t\t\t$query_params[ $base . '_exclude' ] = array(\n\t\t\t\t/* translators: %s: Taxonomy name. */\n\t\t\t\t'description' => sprintf( __( 'Limit result set to all items except those that have the specified term assigned in the %s taxonomy.' ), $base ),\n\t\t\t\t'type'        => 'array',\n\t\t\t\t'items'       => array(\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t),\n\t\t\t\t'default'     => array(),\n\t\t\t);\n\t\t}\n\n\t\tif ( 'post' === $this->post_type ) {\n\t\t\t$query_params['sticky'] = array(\n\t\t\t\t'description' => __( 'Limit result set to items that are sticky.' ),\n\t\t\t\t'type'        => 'boolean',\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Filter collection parameters for the posts controller.\n\t\t *\n\t\t * The dynamic part of the filter `$this->post_type` refers to the post\n\t\t * type slug for the controller.\n\t\t *\n\t\t * This filter registers the collection parameter, but does not map the\n\t\t * collection parameter to an internal WP_Query parameter. Use the\n\t\t * `rest_{$this->post_type}_query` filter to set WP_Query parameters.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param array        $query_params JSON Schema-formatted collection parameters.\n\t\t * @param WP_Post_Type $post_type    Post type object.\n\t\t */\n\t\treturn apply_filters( \"rest_{$this->post_type}_collection_params\", $query_params, $post_type );\n\t}\n\n\t/**\n\t * Sanitizes and validates the list of post statuses, including whether the\n\t * user can query private statuses.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string|array    $statuses  One or more post statuses.\n\t * @param WP_REST_Request $request   Full details about the request.\n\t * @param string          $parameter Additional parameter to pass to validation.\n\t * @return array|WP_Error A list of valid statuses, otherwise WP_Error object.\n\t */\n\tpublic function sanitize_post_statuses( $statuses, $request, $parameter ) {\n\t\t$statuses = wp_parse_slug_list( $statuses );\n\n\t\t// The default status is different in WP_REST_Attachments_Controller.\n\t\t$attributes     = $request->get_attributes();\n\t\t$default_status = $attributes['args']['status']['default'];\n\n\t\tforeach ( $statuses as $status ) {\n\t\t\tif ( $status === $default_status ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$post_type_obj = get_post_type_object( $this->post_type );\n\n\t\t\tif ( current_user_can( $post_type_obj->cap->edit_posts ) || 'private' === $status && current_user_can( $post_type_obj->cap->read_private_posts ) ) {\n\t\t\t\t$result = rest_validate_request_arg( $status, $request, $parameter );\n\t\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\t\treturn $result;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_forbidden_status',\n\t\t\t\t\t__( 'Status is forbidden.' ),\n\t\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $statuses;\n\t}\n}\n", "num_lines": 2814}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Revisions_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.7.0\n */\n\n/**\n * Core class used to access revisions via the REST API.\n *\n * @since 4.7.0\n *\n * @see WP_REST_Controller\n */\nclass WP_REST_Revisions_Controller extends WP_REST_Controller {\n\n\t/**\n\t * Parent post type.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tprivate $parent_post_type;\n\n\t/**\n\t * Parent controller.\n\t *\n\t * @since 4.7.0\n\t * @var WP_REST_Controller\n\t */\n\tprivate $parent_controller;\n\n\t/**\n\t * The base of the parent controller's route.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tprivate $parent_base;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $parent_post_type Post type of the parent.\n\t */\n\tpublic function __construct( $parent_post_type ) {\n\t\t$this->parent_post_type  = $parent_post_type;\n\t\t$this->namespace         = 'wp/v2';\n\t\t$this->rest_base         = 'revisions';\n\t\t$post_type_object        = get_post_type_object( $parent_post_type );\n\t\t$this->parent_base       = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name;\n\t\t$this->parent_controller = $post_type_object->get_rest_controller();\n\n\t\tif ( ! $this->parent_controller ) {\n\t\t\t$this->parent_controller = new WP_REST_Posts_Controller( $parent_post_type );\n\t\t}\n\t}\n\n\t/**\n\t * Registers the routes for revisions based on post types supporting revisions.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see register_rest_route()\n\t */\n\tpublic function register_routes() {\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->parent_base . '/(?P<parent>[\\d]+)/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\t'args'   => array(\n\t\t\t\t\t'parent' => array(\n\t\t\t\t\t\t'description' => __( 'The ID for the parent of the object.' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_items' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->parent_base . '/(?P<parent>[\\d]+)/' . $this->rest_base . '/(?P<id>[\\d]+)',\n\t\t\tarray(\n\t\t\t\t'args'   => array(\n\t\t\t\t\t'parent' => array(\n\t\t\t\t\t\t'description' => __( 'The ID for the parent of the object.' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t),\n\t\t\t\t\t'id'     => array(\n\t\t\t\t\t\t'description' => __( 'Unique identifier for the object.' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::DELETABLE,\n\t\t\t\t\t'callback'            => array( $this, 'delete_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'delete_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'force' => array(\n\t\t\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t\t\t'default'     => false,\n\t\t\t\t\t\t\t'description' => __( 'Required to be true, as revisions do not support trashing.' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t}\n\n\t/**\n\t * Get the parent post, if the ID is valid.\n\t *\n\t * @since 4.7.2\n\t *\n\t * @param int $parent Supplied ID.\n\t * @return WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise.\n\t */\n\tprotected function get_parent( $parent ) {\n\t\t$error = new WP_Error(\n\t\t\t'rest_post_invalid_parent',\n\t\t\t__( 'Invalid post parent ID.' ),\n\t\t\tarray( 'status' => 404 )\n\t\t);\n\t\tif ( (int) $parent <= 0 ) {\n\t\t\treturn $error;\n\t\t}\n\n\t\t$parent = get_post( (int) $parent );\n\t\tif ( empty( $parent ) || empty( $parent->ID ) || $this->parent_post_type !== $parent->post_type ) {\n\t\t\treturn $error;\n\t\t}\n\n\t\treturn $parent;\n\t}\n\n\t/**\n\t * Checks if a given request has access to get revisions.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access, WP_Error object otherwise.\n\t */\n\tpublic function get_items_permissions_check( $request ) {\n\t\t$parent = $this->get_parent( $request['parent'] );\n\t\tif ( is_wp_error( $parent ) ) {\n\t\t\treturn $parent;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $parent->ID ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_read',\n\t\t\t\t__( 'Sorry, you are not allowed to view revisions of this post.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Get the revision, if the ID is valid.\n\t *\n\t * @since 4.7.2\n\t *\n\t * @param int $id Supplied ID.\n\t * @return WP_Post|WP_Error Revision post object if ID is valid, WP_Error otherwise.\n\t */\n\tprotected function get_revision( $id ) {\n\t\t$error = new WP_Error(\n\t\t\t'rest_post_invalid_id',\n\t\t\t__( 'Invalid revision ID.' ),\n\t\t\tarray( 'status' => 404 )\n\t\t);\n\n\t\tif ( (int) $id <= 0 ) {\n\t\t\treturn $error;\n\t\t}\n\n\t\t$revision = get_post( (int) $id );\n\t\tif ( empty( $revision ) || empty( $revision->ID ) || 'revision' !== $revision->post_type ) {\n\t\t\treturn $error;\n\t\t}\n\n\t\treturn $revision;\n\t}\n\n\t/**\n\t * Gets a collection of revisions.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_items( $request ) {\n\t\t$parent = $this->get_parent( $request['parent'] );\n\t\tif ( is_wp_error( $parent ) ) {\n\t\t\treturn $parent;\n\t\t}\n\n\t\t// Ensure a search string is set in case the orderby is set to 'relevance'.\n\t\tif ( ! empty( $request['orderby'] ) && 'relevance' === $request['orderby'] && empty( $request['search'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_no_search_term_defined',\n\t\t\t\t__( 'You need to define a search term to order by relevance.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t// Ensure an include parameter is set in case the orderby is set to 'include'.\n\t\tif ( ! empty( $request['orderby'] ) && 'include' === $request['orderby'] && empty( $request['include'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_orderby_include_missing_include',\n\t\t\t\t__( 'You need to define an include parameter to order by include.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\tif ( wp_revisions_enabled( $parent ) ) {\n\t\t\t$registered = $this->get_collection_params();\n\t\t\t$args       = array(\n\t\t\t\t'post_parent'      => $parent->ID,\n\t\t\t\t'post_type'        => 'revision',\n\t\t\t\t'post_status'      => 'inherit',\n\t\t\t\t'posts_per_page'   => -1,\n\t\t\t\t'orderby'          => 'date ID',\n\t\t\t\t'order'            => 'DESC',\n\t\t\t\t'suppress_filters' => true,\n\t\t\t);\n\n\t\t\t$parameter_mappings = array(\n\t\t\t\t'exclude'  => 'post__not_in',\n\t\t\t\t'include'  => 'post__in',\n\t\t\t\t'offset'   => 'offset',\n\t\t\t\t'order'    => 'order',\n\t\t\t\t'orderby'  => 'orderby',\n\t\t\t\t'page'     => 'paged',\n\t\t\t\t'per_page' => 'posts_per_page',\n\t\t\t\t'search'   => 's',\n\t\t\t);\n\n\t\t\tforeach ( $parameter_mappings as $api_param => $wp_param ) {\n\t\t\t\tif ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) {\n\t\t\t\t\t$args[ $wp_param ] = $request[ $api_param ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// For backward-compatibility, 'date' needs to resolve to 'date ID'.\n\t\t\tif ( isset( $args['orderby'] ) && 'date' === $args['orderby'] ) {\n\t\t\t\t$args['orderby'] = 'date ID';\n\t\t\t}\n\n\t\t\t/** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */\n\t\t\t$args       = apply_filters( 'rest_revision_query', $args, $request );\n\t\t\t$query_args = $this->prepare_items_query( $args, $request );\n\n\t\t\t$revisions_query = new WP_Query();\n\t\t\t$revisions       = $revisions_query->query( $query_args );\n\t\t\t$offset          = isset( $query_args['offset'] ) ? (int) $query_args['offset'] : 0;\n\t\t\t$page            = (int) $query_args['paged'];\n\t\t\t$total_revisions = $revisions_query->found_posts;\n\n\t\t\tif ( $total_revisions < 1 ) {\n\t\t\t\t// Out-of-bounds, run the query again without LIMIT for total count.\n\t\t\t\tunset( $query_args['paged'], $query_args['offset'] );\n\n\t\t\t\t$count_query = new WP_Query();\n\t\t\t\t$count_query->query( $query_args );\n\n\t\t\t\t$total_revisions = $count_query->found_posts;\n\t\t\t}\n\n\t\t\tif ( $revisions_query->query_vars['posts_per_page'] > 0 ) {\n\t\t\t\t$max_pages = ceil( $total_revisions / (int) $revisions_query->query_vars['posts_per_page'] );\n\t\t\t} else {\n\t\t\t\t$max_pages = $total_revisions > 0 ? 1 : 0;\n\t\t\t}\n\n\t\t\tif ( $total_revisions > 0 ) {\n\t\t\t\tif ( $offset >= $total_revisions ) {\n\t\t\t\t\treturn new WP_Error(\n\t\t\t\t\t\t'rest_revision_invalid_offset_number',\n\t\t\t\t\t\t__( 'The offset number requested is larger than or equal to the number of available revisions.' ),\n\t\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t\t);\n\t\t\t\t} elseif ( ! $offset && $page > $max_pages ) {\n\t\t\t\t\treturn new WP_Error(\n\t\t\t\t\t\t'rest_revision_invalid_page_number',\n\t\t\t\t\t\t__( 'The page number requested is larger than the number of pages available.' ),\n\t\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$revisions       = array();\n\t\t\t$total_revisions = 0;\n\t\t\t$max_pages       = 0;\n\t\t\t$page            = (int) $request['page'];\n\t\t}\n\n\t\t$response = array();\n\n\t\tforeach ( $revisions as $revision ) {\n\t\t\t$data       = $this->prepare_item_for_response( $revision, $request );\n\t\t\t$response[] = $this->prepare_response_for_collection( $data );\n\t\t}\n\n\t\t$response = rest_ensure_response( $response );\n\n\t\t$response->header( 'X-WP-Total', (int) $total_revisions );\n\t\t$response->header( 'X-WP-TotalPages', (int) $max_pages );\n\n\t\t$request_params = $request->get_query_params();\n\t\t$base           = add_query_arg( urlencode_deep( $request_params ), rest_url( sprintf( '%s/%s/%d/%s', $this->namespace, $this->parent_base, $request['parent'], $this->rest_base ) ) );\n\n\t\tif ( $page > 1 ) {\n\t\t\t$prev_page = $page - 1;\n\n\t\t\tif ( $prev_page > $max_pages ) {\n\t\t\t\t$prev_page = $max_pages;\n\t\t\t}\n\n\t\t\t$prev_link = add_query_arg( 'page', $prev_page, $base );\n\t\t\t$response->link_header( 'prev', $prev_link );\n\t\t}\n\t\tif ( $max_pages > $page ) {\n\t\t\t$next_page = $page + 1;\n\t\t\t$next_link = add_query_arg( 'page', $next_page, $base );\n\n\t\t\t$response->link_header( 'next', $next_link );\n\t\t}\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Checks if a given request has access to get a specific revision.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return bool|WP_Error True if the request has read access for the item, WP_Error object otherwise.\n\t */\n\tpublic function get_item_permissions_check( $request ) {\n\t\treturn $this->get_items_permissions_check( $request );\n\t}\n\n\t/**\n\t * Retrieves one revision from the collection.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_item( $request ) {\n\t\t$parent = $this->get_parent( $request['parent'] );\n\t\tif ( is_wp_error( $parent ) ) {\n\t\t\treturn $parent;\n\t\t}\n\n\t\t$revision = $this->get_revision( $request['id'] );\n\t\tif ( is_wp_error( $revision ) ) {\n\t\t\treturn $revision;\n\t\t}\n\n\t\t$response = $this->prepare_item_for_response( $revision, $request );\n\t\treturn rest_ensure_response( $response );\n\t}\n\n\t/**\n\t * Checks if a given request has access to delete a revision.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return bool|WP_Error True if the request has access to delete the item, WP_Error object otherwise.\n\t */\n\tpublic function delete_item_permissions_check( $request ) {\n\t\t$parent = $this->get_parent( $request['parent'] );\n\t\tif ( is_wp_error( $parent ) ) {\n\t\t\treturn $parent;\n\t\t}\n\n\t\t$parent_post_type = get_post_type_object( $parent->post_type );\n\n\t\tif ( ! current_user_can( 'delete_post', $parent->ID ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_delete',\n\t\t\t\t__( 'Sorry, you are not allowed to delete revisions of this post.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\t$revision = $this->get_revision( $request['id'] );\n\t\tif ( is_wp_error( $revision ) ) {\n\t\t\treturn $revision;\n\t\t}\n\n\t\t$response = $this->get_items_permissions_check( $request );\n\t\tif ( ! $response || is_wp_error( $response ) ) {\n\t\t\treturn $response;\n\t\t}\n\n\t\tif ( ! current_user_can( 'delete_post', $revision->ID ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_delete',\n\t\t\t\t__( 'Sorry, you are not allowed to delete this revision.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Deletes a single revision.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function delete_item( $request ) {\n\t\t$revision = $this->get_revision( $request['id'] );\n\t\tif ( is_wp_error( $revision ) ) {\n\t\t\treturn $revision;\n\t\t}\n\n\t\t$force = isset( $request['force'] ) ? (bool) $request['force'] : false;\n\n\t\t// We don't support trashing for revisions.\n\t\tif ( ! $force ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_trash_not_supported',\n\t\t\t\t/* translators: %s: force=true */\n\t\t\t\tsprintf( __( \"Revisions do not support trashing. Set '%s' to delete.\" ), 'force=true' ),\n\t\t\t\tarray( 'status' => 501 )\n\t\t\t);\n\t\t}\n\n\t\t$previous = $this->prepare_item_for_response( $revision, $request );\n\n\t\t$result = wp_delete_post( $request['id'], true );\n\n\t\t/**\n\t\t * Fires after a revision is deleted via the REST API.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_Post|false|null $result The revision object (if it was deleted or moved to the Trash successfully)\n\t\t *                                   or false or null (failure). If the revision was moved to the Trash, $result represents\n\t\t *                                   its new state; if it was deleted, $result represents its state before deletion.\n\t\t * @param WP_REST_Request $request The request sent to the API.\n\t\t */\n\t\tdo_action( 'rest_delete_revision', $result, $request );\n\n\t\tif ( ! $result ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_delete',\n\t\t\t\t__( 'The post cannot be deleted.' ),\n\t\t\t\tarray( 'status' => 500 )\n\t\t\t);\n\t\t}\n\n\t\t$response = new WP_REST_Response();\n\t\t$response->set_data(\n\t\t\tarray(\n\t\t\t\t'deleted'  => true,\n\t\t\t\t'previous' => $previous->get_data(),\n\t\t\t)\n\t\t);\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Determines the allowed query_vars for a get_items() response and prepares\n\t * them for WP_Query.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param array           $prepared_args Optional. Prepared WP_Query arguments. Default empty array.\n\t * @param WP_REST_Request $request       Optional. Full details about the request.\n\t * @return array Items query arguments.\n\t */\n\tprotected function prepare_items_query( $prepared_args = array(), $request = null ) {\n\t\t$query_args = array();\n\n\t\tforeach ( $prepared_args as $key => $value ) {\n\t\t\t/** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */\n\t\t\t$query_args[ $key ] = apply_filters( \"rest_query_var-{$key}\", $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores\n\t\t}\n\n\t\t// Map to proper WP_Query orderby param.\n\t\tif ( isset( $query_args['orderby'] ) && isset( $request['orderby'] ) ) {\n\t\t\t$orderby_mappings = array(\n\t\t\t\t'id'            => 'ID',\n\t\t\t\t'include'       => 'post__in',\n\t\t\t\t'slug'          => 'post_name',\n\t\t\t\t'include_slugs' => 'post_name__in',\n\t\t\t);\n\n\t\t\tif ( isset( $orderby_mappings[ $request['orderby'] ] ) ) {\n\t\t\t\t$query_args['orderby'] = $orderby_mappings[ $request['orderby'] ];\n\t\t\t}\n\t\t}\n\n\t\treturn $query_args;\n\t}\n\n\t/**\n\t * Prepares the revision for the REST response.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Post         $post    Post revision object.\n\t * @param WP_REST_Request $request Request object.\n\t * @return WP_REST_Response Response object.\n\t */\n\tpublic function prepare_item_for_response( $post, $request ) {\n\t\t$GLOBALS['post'] = $post;\n\n\t\tsetup_postdata( $post );\n\n\t\t$fields = $this->get_fields_for_response( $request );\n\t\t$data   = array();\n\n\t\tif ( in_array( 'author', $fields, true ) ) {\n\t\t\t$data['author'] = (int) $post->post_author;\n\t\t}\n\n\t\tif ( in_array( 'date', $fields, true ) ) {\n\t\t\t$data['date'] = $this->prepare_date_response( $post->post_date_gmt, $post->post_date );\n\t\t}\n\n\t\tif ( in_array( 'date_gmt', $fields, true ) ) {\n\t\t\t$data['date_gmt'] = $this->prepare_date_response( $post->post_date_gmt );\n\t\t}\n\n\t\tif ( in_array( 'id', $fields, true ) ) {\n\t\t\t$data['id'] = $post->ID;\n\t\t}\n\n\t\tif ( in_array( 'modified', $fields, true ) ) {\n\t\t\t$data['modified'] = $this->prepare_date_response( $post->post_modified_gmt, $post->post_modified );\n\t\t}\n\n\t\tif ( in_array( 'modified_gmt', $fields, true ) ) {\n\t\t\t$data['modified_gmt'] = $this->prepare_date_response( $post->post_modified_gmt );\n\t\t}\n\n\t\tif ( in_array( 'parent', $fields, true ) ) {\n\t\t\t$data['parent'] = (int) $post->post_parent;\n\t\t}\n\n\t\tif ( in_array( 'slug', $fields, true ) ) {\n\t\t\t$data['slug'] = $post->post_name;\n\t\t}\n\n\t\tif ( in_array( 'guid', $fields, true ) ) {\n\t\t\t$data['guid'] = array(\n\t\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t\t'rendered' => apply_filters( 'get_the_guid', $post->guid, $post->ID ),\n\t\t\t\t'raw'      => $post->guid,\n\t\t\t);\n\t\t}\n\n\t\tif ( in_array( 'title', $fields, true ) ) {\n\t\t\t$data['title'] = array(\n\t\t\t\t'raw'      => $post->post_title,\n\t\t\t\t'rendered' => get_the_title( $post->ID ),\n\t\t\t);\n\t\t}\n\n\t\tif ( in_array( 'content', $fields, true ) ) {\n\n\t\t\t$data['content'] = array(\n\t\t\t\t'raw'      => $post->post_content,\n\t\t\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t\t\t'rendered' => apply_filters( 'the_content', $post->post_content ),\n\t\t\t);\n\t\t}\n\n\t\tif ( in_array( 'excerpt', $fields, true ) ) {\n\t\t\t$data['excerpt'] = array(\n\t\t\t\t'raw'      => $post->post_excerpt,\n\t\t\t\t'rendered' => $this->prepare_excerpt_response( $post->post_excerpt, $post ),\n\t\t\t);\n\t\t}\n\n\t\t$context  = ! empty( $request['context'] ) ? $request['context'] : 'view';\n\t\t$data     = $this->add_additional_fields_to_object( $data, $request );\n\t\t$data     = $this->filter_response_by_context( $data, $context );\n\t\t$response = rest_ensure_response( $data );\n\n\t\tif ( ! empty( $data['parent'] ) ) {\n\t\t\t$response->add_link( 'parent', rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->parent_base, $data['parent'] ) ) );\n\t\t}\n\n\t\t/**\n\t\t * Filters a revision returned from the API.\n\t\t *\n\t\t * Allows modification of the revision right before it is returned.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_REST_Response $response The response object.\n\t\t * @param WP_Post          $post     The original revision object.\n\t\t * @param WP_REST_Request  $request  Request used to generate the response.\n\t\t */\n\t\treturn apply_filters( 'rest_prepare_revision', $response, $post, $request );\n\t}\n\n\t/**\n\t * Checks the post_date_gmt or modified_gmt and prepare any post or\n\t * modified date for single post output.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string      $date_gmt GMT publication time.\n\t * @param string|null $date     Optional. Local publication time. Default null.\n\t * @return string|null ISO8601/RFC3339 formatted datetime, otherwise null.\n\t */\n\tprotected function prepare_date_response( $date_gmt, $date = null ) {\n\t\tif ( '0000-00-00 00:00:00' === $date_gmt ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( isset( $date ) ) {\n\t\t\treturn mysql_to_rfc3339( $date );\n\t\t}\n\n\t\treturn mysql_to_rfc3339( $date_gmt );\n\t}\n\n\t/**\n\t * Retrieves the revision's schema, conforming to JSON Schema.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$schema = array(\n\t\t\t'$schema'    => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title'      => \"{$this->parent_post_type}-revision\",\n\t\t\t'type'       => 'object',\n\t\t\t// Base properties for every Revision.\n\t\t\t'properties' => array(\n\t\t\t\t'author'       => array(\n\t\t\t\t\t'description' => __( 'The ID for the author of the object.' ),\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t\t'date'         => array(\n\t\t\t\t\t'description' => __( \"The date the object was published, in the site's timezone.\" ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'date-time',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t\t'date_gmt'     => array(\n\t\t\t\t\t'description' => __( 'The date the object was published, as GMT.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'date-time',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'guid'         => array(\n\t\t\t\t\t'description' => __( 'GUID for the object, as it exists in the database.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'id'           => array(\n\t\t\t\t\t'description' => __( 'Unique identifier for the object.' ),\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t\t'modified'     => array(\n\t\t\t\t\t'description' => __( \"The date the object was last modified, in the site's timezone.\" ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'date-time',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'modified_gmt' => array(\n\t\t\t\t\t'description' => __( 'The date the object was last modified, as GMT.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'date-time',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'parent'       => array(\n\t\t\t\t\t'description' => __( 'The ID for the parent of the object.' ),\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t\t'slug'         => array(\n\t\t\t\t\t'description' => __( 'An alphanumeric identifier for the object unique to its type.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$parent_schema = $this->parent_controller->get_item_schema();\n\n\t\tif ( ! empty( $parent_schema['properties']['title'] ) ) {\n\t\t\t$schema['properties']['title'] = $parent_schema['properties']['title'];\n\t\t}\n\n\t\tif ( ! empty( $parent_schema['properties']['content'] ) ) {\n\t\t\t$schema['properties']['content'] = $parent_schema['properties']['content'];\n\t\t}\n\n\t\tif ( ! empty( $parent_schema['properties']['excerpt'] ) ) {\n\t\t\t$schema['properties']['excerpt'] = $parent_schema['properties']['excerpt'];\n\t\t}\n\n\t\tif ( ! empty( $parent_schema['properties']['guid'] ) ) {\n\t\t\t$schema['properties']['guid'] = $parent_schema['properties']['guid'];\n\t\t}\n\n\t\t$this->schema = $schema;\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}\n\n\t/**\n\t * Retrieves the query params for collections.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Collection parameters.\n\t */\n\tpublic function get_collection_params() {\n\t\t$query_params = parent::get_collection_params();\n\n\t\t$query_params['context']['default'] = 'view';\n\n\t\tunset( $query_params['per_page']['default'] );\n\n\t\t$query_params['exclude'] = array(\n\t\t\t'description' => __( 'Ensure result set excludes specific IDs.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'default'     => array(),\n\t\t);\n\n\t\t$query_params['include'] = array(\n\t\t\t'description' => __( 'Limit result set to specific IDs.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'default'     => array(),\n\t\t);\n\n\t\t$query_params['offset'] = array(\n\t\t\t'description' => __( 'Offset the result set by a specific number of items.' ),\n\t\t\t'type'        => 'integer',\n\t\t);\n\n\t\t$query_params['order'] = array(\n\t\t\t'description' => __( 'Order sort attribute ascending or descending.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'default'     => 'desc',\n\t\t\t'enum'        => array( 'asc', 'desc' ),\n\t\t);\n\n\t\t$query_params['orderby'] = array(\n\t\t\t'description' => __( 'Sort collection by object attribute.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'default'     => 'date',\n\t\t\t'enum'        => array(\n\t\t\t\t'date',\n\t\t\t\t'id',\n\t\t\t\t'include',\n\t\t\t\t'relevance',\n\t\t\t\t'slug',\n\t\t\t\t'include_slugs',\n\t\t\t\t'title',\n\t\t\t),\n\t\t);\n\n\t\treturn $query_params;\n\t}\n\n\t/**\n\t * Checks the post excerpt and prepare it for single post output.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string  $excerpt The post excerpt.\n\t * @param WP_Post $post    Post revision object.\n\t * @return string Prepared excerpt or empty string.\n\t */\n\tprotected function prepare_excerpt_response( $excerpt, $post ) {\n\n\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t$excerpt = apply_filters( 'the_excerpt', $excerpt, $post );\n\n\t\tif ( empty( $excerpt ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $excerpt;\n\t}\n}\n", "num_lines": 835}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Search_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 5.0.0\n */\n\n/**\n * Core class to search through all WordPress content via the REST API.\n *\n * @since 5.0.0\n *\n * @see WP_REST_Controller\n */\nclass WP_REST_Search_Controller extends WP_REST_Controller {\n\n\t/**\n\t * ID property name.\n\t */\n\tconst PROP_ID = 'id';\n\n\t/**\n\t * Title property name.\n\t */\n\tconst PROP_TITLE = 'title';\n\n\t/**\n\t * URL property name.\n\t */\n\tconst PROP_URL = 'url';\n\n\t/**\n\t * Type property name.\n\t */\n\tconst PROP_TYPE = 'type';\n\n\t/**\n\t * Subtype property name.\n\t */\n\tconst PROP_SUBTYPE = 'subtype';\n\n\t/**\n\t * Identifier for the 'any' type.\n\t */\n\tconst TYPE_ANY = 'any';\n\n\t/**\n\t * Search handlers used by the controller.\n\t *\n\t * @since 5.0.0\n\t * @var array\n\t */\n\tprotected $search_handlers = array();\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param array $search_handlers List of search handlers to use in the controller. Each search\n\t *                               handler instance must extend the `WP_REST_Search_Handler` class.\n\t */\n\tpublic function __construct( array $search_handlers ) {\n\t\t$this->namespace = 'wp/v2';\n\t\t$this->rest_base = 'search';\n\n\t\tforeach ( $search_handlers as $search_handler ) {\n\t\t\tif ( ! $search_handler instanceof WP_REST_Search_Handler ) {\n\t\t\t\t_doing_it_wrong(\n\t\t\t\t\t__METHOD__,\n\t\t\t\t\t/* translators: %s: PHP class name. */\n\t\t\t\t\tsprintf( __( 'REST search handlers must extend the %s class.' ), 'WP_REST_Search_Handler' ),\n\t\t\t\t\t'5.0.0'\n\t\t\t\t);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->search_handlers[ $search_handler->get_type() ] = $search_handler;\n\t\t}\n\t}\n\n\t/**\n\t * Registers the routes for the objects of the controller.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @see register_rest_route()\n\t */\n\tpublic function register_routes() {\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_items' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_items_permission_check' ),\n\t\t\t\t\t'args'                => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Checks if a given request has access to search content.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has search access, WP_Error object otherwise.\n\t */\n\tpublic function get_items_permission_check( $request ) {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves a collection of search results.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_items( $request ) {\n\t\t$handler = $this->get_search_handler( $request );\n\t\tif ( is_wp_error( $handler ) ) {\n\t\t\treturn $handler;\n\t\t}\n\n\t\t$result = $handler->search_items( $request );\n\n\t\tif ( ! isset( $result[ WP_REST_Search_Handler::RESULT_IDS ] ) || ! is_array( $result[ WP_REST_Search_Handler::RESULT_IDS ] ) || ! isset( $result[ WP_REST_Search_Handler::RESULT_TOTAL ] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_search_handler_error',\n\t\t\t\t__( 'Internal search handler error.' ),\n\t\t\t\tarray( 'status' => 500 )\n\t\t\t);\n\t\t}\n\n\t\t$ids = array_map( 'absint', $result[ WP_REST_Search_Handler::RESULT_IDS ] );\n\n\t\t$results = array();\n\n\t\tforeach ( $ids as $id ) {\n\t\t\t$data      = $this->prepare_item_for_response( $id, $request );\n\t\t\t$results[] = $this->prepare_response_for_collection( $data );\n\t\t}\n\n\t\t$total     = (int) $result[ WP_REST_Search_Handler::RESULT_TOTAL ];\n\t\t$page      = (int) $request['page'];\n\t\t$per_page  = (int) $request['per_page'];\n\t\t$max_pages = ceil( $total / $per_page );\n\n\t\tif ( $page > $max_pages && $total > 0 ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_search_invalid_page_number',\n\t\t\t\t__( 'The page number requested is larger than the number of pages available.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t$response = rest_ensure_response( $results );\n\t\t$response->header( 'X-WP-Total', $total );\n\t\t$response->header( 'X-WP-TotalPages', $max_pages );\n\n\t\t$request_params = $request->get_query_params();\n\t\t$base           = add_query_arg( urlencode_deep( $request_params ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );\n\n\t\tif ( $page > 1 ) {\n\t\t\t$prev_link = add_query_arg( 'page', $page - 1, $base );\n\t\t\t$response->link_header( 'prev', $prev_link );\n\t\t}\n\t\tif ( $page < $max_pages ) {\n\t\t\t$next_link = add_query_arg( 'page', $page + 1, $base );\n\t\t\t$response->link_header( 'next', $next_link );\n\t\t}\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Prepares a single search result for response.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param int             $id      ID of the item to prepare.\n\t * @param WP_REST_Request $request Request object.\n\t * @return WP_REST_Response Response object.\n\t */\n\tpublic function prepare_item_for_response( $id, $request ) {\n\t\t$handler = $this->get_search_handler( $request );\n\t\tif ( is_wp_error( $handler ) ) {\n\t\t\treturn new WP_REST_Response();\n\t\t}\n\n\t\t$fields = $this->get_fields_for_response( $request );\n\n\t\t$data = $handler->prepare_item( $id, $fields );\n\t\t$data = $this->add_additional_fields_to_object( $data, $request );\n\n\t\t$context = ! empty( $request['context'] ) ? $request['context'] : 'view';\n\t\t$data    = $this->filter_response_by_context( $data, $context );\n\n\t\t$response = rest_ensure_response( $data );\n\n\t\t$links               = $handler->prepare_item_links( $id );\n\t\t$links['collection'] = array(\n\t\t\t'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),\n\t\t);\n\t\t$response->add_links( $links );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Retrieves the item schema, conforming to JSON Schema.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$types    = array();\n\t\t$subtypes = array();\n\n\t\tforeach ( $this->search_handlers as $search_handler ) {\n\t\t\t$types[]  = $search_handler->get_type();\n\t\t\t$subtypes = array_merge( $subtypes, $search_handler->get_subtypes() );\n\t\t}\n\n\t\t$types    = array_unique( $types );\n\t\t$subtypes = array_unique( $subtypes );\n\n\t\t$schema = array(\n\t\t\t'$schema'    => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title'      => 'search-result',\n\t\t\t'type'       => 'object',\n\t\t\t'properties' => array(\n\t\t\t\tself::PROP_ID      => array(\n\t\t\t\t\t'description' => __( 'Unique identifier for the object.' ),\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'context'     => array( 'view', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\tself::PROP_TITLE   => array(\n\t\t\t\t\t'description' => __( 'The title for the object.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\tself::PROP_URL     => array(\n\t\t\t\t\t'description' => __( 'URL to the object.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t'context'     => array( 'view', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\tself::PROP_TYPE    => array(\n\t\t\t\t\t'description' => __( 'Object type.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'enum'        => $types,\n\t\t\t\t\t'context'     => array( 'view', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\tself::PROP_SUBTYPE => array(\n\t\t\t\t\t'description' => __( 'Object subtype.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'enum'        => $subtypes,\n\t\t\t\t\t'context'     => array( 'view', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->schema = $schema;\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}\n\n\t/**\n\t * Retrieves the query params for the search results collection.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @return array Collection parameters.\n\t */\n\tpublic function get_collection_params() {\n\t\t$types    = array();\n\t\t$subtypes = array();\n\n\t\tforeach ( $this->search_handlers as $search_handler ) {\n\t\t\t$types[]  = $search_handler->get_type();\n\t\t\t$subtypes = array_merge( $subtypes, $search_handler->get_subtypes() );\n\t\t}\n\n\t\t$types    = array_unique( $types );\n\t\t$subtypes = array_unique( $subtypes );\n\n\t\t$query_params = parent::get_collection_params();\n\n\t\t$query_params['context']['default'] = 'view';\n\n\t\t$query_params[ self::PROP_TYPE ] = array(\n\t\t\t'default'     => $types[0],\n\t\t\t'description' => __( 'Limit results to items of an object type.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'enum'        => $types,\n\t\t);\n\n\t\t$query_params[ self::PROP_SUBTYPE ] = array(\n\t\t\t'default'           => self::TYPE_ANY,\n\t\t\t'description'       => __( 'Limit results to items of one or more object subtypes.' ),\n\t\t\t'type'              => 'array',\n\t\t\t'items'             => array(\n\t\t\t\t'enum' => array_merge( $subtypes, array( self::TYPE_ANY ) ),\n\t\t\t\t'type' => 'string',\n\t\t\t),\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_subtypes' ),\n\t\t);\n\n\t\treturn $query_params;\n\t}\n\n\t/**\n\t * Sanitizes the list of subtypes, to ensure only subtypes of the passed type are included.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param string|array    $subtypes  One or more subtypes.\n\t * @param WP_REST_Request $request   Full details about the request.\n\t * @param string          $parameter Parameter name.\n\t * @return array|WP_Error List of valid subtypes, or WP_Error object on failure.\n\t */\n\tpublic function sanitize_subtypes( $subtypes, $request, $parameter ) {\n\t\t$subtypes = wp_parse_slug_list( $subtypes );\n\n\t\t$subtypes = rest_parse_request_arg( $subtypes, $request, $parameter );\n\t\tif ( is_wp_error( $subtypes ) ) {\n\t\t\treturn $subtypes;\n\t\t}\n\n\t\t// 'any' overrides any other subtype.\n\t\tif ( in_array( self::TYPE_ANY, $subtypes, true ) ) {\n\t\t\treturn array( self::TYPE_ANY );\n\t\t}\n\n\t\t$handler = $this->get_search_handler( $request );\n\t\tif ( is_wp_error( $handler ) ) {\n\t\t\treturn $handler;\n\t\t}\n\n\t\treturn array_intersect( $subtypes, $handler->get_subtypes() );\n\t}\n\n\t/**\n\t * Gets the search handler to handle the current request.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Search_Handler|WP_Error Search handler for the request type, or WP_Error object on failure.\n\t */\n\tprotected function get_search_handler( $request ) {\n\t\t$type = $request->get_param( self::PROP_TYPE );\n\n\t\tif ( ! $type || ! isset( $this->search_handlers[ $type ] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_search_invalid_type',\n\t\t\t\t__( 'Invalid type parameter.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\treturn $this->search_handlers[ $type ];\n\t}\n}\n", "num_lines": 384}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Settings_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.7.0\n */\n\n/**\n * Core class used to manage a site's settings via the REST API.\n *\n * @since 4.7.0\n *\n * @see WP_REST_Controller\n */\nclass WP_REST_Settings_Controller extends WP_REST_Controller {\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.7.0\n\t */\n\tpublic function __construct() {\n\t\t$this->namespace = 'wp/v2';\n\t\t$this->rest_base = 'settings';\n\t}\n\n\t/**\n\t * Registers the routes for the objects of the controller.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see register_rest_route()\n\t */\n\tpublic function register_routes() {\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_item' ),\n\t\t\t\t\t'args'                => array(),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::EDITABLE,\n\t\t\t\t\t'callback'            => array( $this, 'update_item' ),\n\t\t\t\t\t'args'                => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t}\n\n\t/**\n\t * Checks if a given request has access to read and manage settings.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return bool True if the request has read access for the item, otherwise false.\n\t */\n\tpublic function get_item_permissions_check( $request ) {\n\t\treturn current_user_can( 'manage_options' );\n\t}\n\n\t/**\n\t * Retrieves the settings.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return array|WP_Error Array on success, or WP_Error object on failure.\n\t */\n\tpublic function get_item( $request ) {\n\t\t$options  = $this->get_registered_options();\n\t\t$response = array();\n\n\t\tforeach ( $options as $name => $args ) {\n\t\t\t/**\n\t\t\t * Filters the value of a setting recognized by the REST API.\n\t\t\t *\n\t\t\t * Allow hijacking the setting value and overriding the built-in behavior by returning a\n\t\t\t * non-null value.  The returned value will be presented as the setting value instead.\n\t\t\t *\n\t\t\t * @since 4.7.0\n\t\t\t *\n\t\t\t * @param mixed  $result Value to use for the requested setting. Can be a scalar\n\t\t\t *                       matching the registered schema for the setting, or null to\n\t\t\t *                       follow the default get_option() behavior.\n\t\t\t * @param string $name   Setting name (as shown in REST API responses).\n\t\t\t * @param array  $args   Arguments passed to register_setting() for this setting.\n\t\t\t */\n\t\t\t$response[ $name ] = apply_filters( 'rest_pre_get_setting', null, $name, $args );\n\n\t\t\tif ( is_null( $response[ $name ] ) ) {\n\t\t\t\t// Default to a null value as \"null\" in the response means \"not set\".\n\t\t\t\t$response[ $name ] = get_option( $args['option_name'], $args['schema']['default'] );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Because get_option() is lossy, we have to\n\t\t\t * cast values to the type they are registered with.\n\t\t\t */\n\t\t\t$response[ $name ] = $this->prepare_value( $response[ $name ], $args['schema'] );\n\t\t}\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Prepares a value for output based off a schema array.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param mixed $value  Value to prepare.\n\t * @param array $schema Schema to match.\n\t * @return mixed The prepared value.\n\t */\n\tprotected function prepare_value( $value, $schema ) {\n\t\t/*\n\t\t * If the value is not valid by the schema, set the value to null.\n\t\t * Null values are specifically non-destructive, so this will not cause\n\t\t * overwriting the current invalid value to null.\n\t\t */\n\t\tif ( is_wp_error( rest_validate_value_from_schema( $value, $schema ) ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn rest_sanitize_value_from_schema( $value, $schema );\n\t}\n\n\t/**\n\t * Updates settings for the settings object.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return array|WP_Error Array on success, or error object on failure.\n\t */\n\tpublic function update_item( $request ) {\n\t\t$options = $this->get_registered_options();\n\n\t\t$params = $request->get_params();\n\n\t\tforeach ( $options as $name => $args ) {\n\t\t\tif ( ! array_key_exists( $name, $params ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters whether to preempt a setting value update.\n\t\t\t *\n\t\t\t * Allows hijacking the setting update logic and overriding the built-in behavior by\n\t\t\t * returning true.\n\t\t\t *\n\t\t\t * @since 4.7.0\n\t\t\t *\n\t\t\t * @param bool   $result Whether to override the default behavior for updating the\n\t\t\t *                       value of a setting.\n\t\t\t * @param string $name   Setting name (as shown in REST API responses).\n\t\t\t * @param mixed  $value  Updated setting value.\n\t\t\t * @param array  $args   Arguments passed to register_setting() for this setting.\n\t\t\t */\n\t\t\t$updated = apply_filters( 'rest_pre_update_setting', false, $name, $request[ $name ], $args );\n\n\t\t\tif ( $updated ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * A null value for an option would have the same effect as\n\t\t\t * deleting the option from the database, and relying on the\n\t\t\t * default value.\n\t\t\t */\n\t\t\tif ( is_null( $request[ $name ] ) ) {\n\t\t\t\t/*\n\t\t\t\t * A null value is returned in the response for any option\n\t\t\t\t * that has a non-scalar value.\n\t\t\t\t *\n\t\t\t\t * To protect clients from accidentally including the null\n\t\t\t\t * values from a response object in a request, we do not allow\n\t\t\t\t * options with values that don't pass validation to be updated to null.\n\t\t\t\t * Without this added protection a client could mistakenly\n\t\t\t\t * delete all options that have invalid values from the\n\t\t\t\t * database.\n\t\t\t\t */\n\t\t\t\tif ( is_wp_error( rest_validate_value_from_schema( get_option( $args['option_name'], false ), $args['schema'] ) ) ) {\n\t\t\t\t\treturn new WP_Error(\n\t\t\t\t\t\t'rest_invalid_stored_value',\n\t\t\t\t\t\t/* translators: %s: Property name. */\n\t\t\t\t\t\tsprintf( __( 'The %s property has an invalid stored value, and cannot be updated to null.' ), $name ),\n\t\t\t\t\t\tarray( 'status' => 500 )\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tdelete_option( $args['option_name'] );\n\t\t\t} else {\n\t\t\t\tupdate_option( $args['option_name'], $request[ $name ] );\n\t\t\t}\n\t\t}\n\n\t\treturn $this->get_item( $request );\n\t}\n\n\t/**\n\t * Retrieves all of the registered options for the Settings API.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Array of registered options.\n\t */\n\tprotected function get_registered_options() {\n\t\t$rest_options = array();\n\n\t\tforeach ( get_registered_settings() as $name => $args ) {\n\t\t\tif ( empty( $args['show_in_rest'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$rest_args = array();\n\n\t\t\tif ( is_array( $args['show_in_rest'] ) ) {\n\t\t\t\t$rest_args = $args['show_in_rest'];\n\t\t\t}\n\n\t\t\t$defaults = array(\n\t\t\t\t'name'   => ! empty( $rest_args['name'] ) ? $rest_args['name'] : $name,\n\t\t\t\t'schema' => array(),\n\t\t\t);\n\n\t\t\t$rest_args = array_merge( $defaults, $rest_args );\n\n\t\t\t$default_schema = array(\n\t\t\t\t'type'        => empty( $args['type'] ) ? null : $args['type'],\n\t\t\t\t'description' => empty( $args['description'] ) ? '' : $args['description'],\n\t\t\t\t'default'     => isset( $args['default'] ) ? $args['default'] : null,\n\t\t\t);\n\n\t\t\t$rest_args['schema']      = array_merge( $default_schema, $rest_args['schema'] );\n\t\t\t$rest_args['option_name'] = $name;\n\n\t\t\t// Skip over settings that don't have a defined type in the schema.\n\t\t\tif ( empty( $rest_args['schema']['type'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Allow the supported types for settings, as we don't want invalid types\n\t\t\t * to be updated with arbitrary values that we can't do decent sanitizing for.\n\t\t\t */\n\t\t\tif ( ! in_array( $rest_args['schema']['type'], array( 'number', 'integer', 'string', 'boolean', 'array', 'object' ), true ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$rest_args['schema'] = $this->set_additional_properties_to_false( $rest_args['schema'] );\n\n\t\t\t$rest_options[ $rest_args['name'] ] = $rest_args;\n\t\t}\n\n\t\treturn $rest_options;\n\t}\n\n\t/**\n\t * Retrieves the site setting schema, conforming to JSON Schema.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$options = $this->get_registered_options();\n\n\t\t$schema = array(\n\t\t\t'$schema'    => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title'      => 'settings',\n\t\t\t'type'       => 'object',\n\t\t\t'properties' => array(),\n\t\t);\n\n\t\tforeach ( $options as $option_name => $option ) {\n\t\t\t$schema['properties'][ $option_name ]                = $option['schema'];\n\t\t\t$schema['properties'][ $option_name ]['arg_options'] = array(\n\t\t\t\t'sanitize_callback' => array( $this, 'sanitize_callback' ),\n\t\t\t);\n\t\t}\n\n\t\t$this->schema = $schema;\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}\n\n\t/**\n\t * Custom sanitize callback used for all options to allow the use of 'null'.\n\t *\n\t * By default, the schema of settings will throw an error if a value is set to\n\t * `null` as it's not a valid value for something like \"type => string\". We\n\t * provide a wrapper sanitizer to allow the use of `null`.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param mixed           $value   The value for the setting.\n\t * @param WP_REST_Request $request The request object.\n\t * @param string          $param   The parameter name.\n\t * @return mixed|WP_Error\n\t */\n\tpublic function sanitize_callback( $value, $request, $param ) {\n\t\tif ( is_null( $value ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\treturn rest_parse_request_arg( $value, $request, $param );\n\t}\n\n\t/**\n\t * Recursively add additionalProperties = false to all objects in a schema.\n\t *\n\t * This is need to restrict properties of objects in settings values to only\n\t * registered items, as the REST API will allow additional properties by\n\t * default.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param array $schema The schema array.\n\t * @return array\n\t */\n\tprotected function set_additional_properties_to_false( $schema ) {\n\t\tswitch ( $schema['type'] ) {\n\t\t\tcase 'object':\n\t\t\t\tforeach ( $schema['properties'] as $key => $child_schema ) {\n\t\t\t\t\t$schema['properties'][ $key ] = $this->set_additional_properties_to_false( $child_schema );\n\t\t\t\t}\n\n\t\t\t\t$schema['additionalProperties'] = false;\n\t\t\t\tbreak;\n\t\t\tcase 'array':\n\t\t\t\t$schema['items'] = $this->set_additional_properties_to_false( $schema['items'] );\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $schema;\n\t}\n}\n", "num_lines": 353}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Taxonomies_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.7.0\n */\n\n/**\n * Core class used to manage taxonomies via the REST API.\n *\n * @since 4.7.0\n *\n * @see WP_REST_Controller\n */\nclass WP_REST_Taxonomies_Controller extends WP_REST_Controller {\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.7.0\n\t */\n\tpublic function __construct() {\n\t\t$this->namespace = 'wp/v2';\n\t\t$this->rest_base = 'taxonomies';\n\t}\n\n\t/**\n\t * Registers the routes for the objects of the controller.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see register_rest_route()\n\t */\n\tpublic function register_routes() {\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_items' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base . '/(?P<taxonomy>[\\w-]+)',\n\t\t\tarray(\n\t\t\t\t'args'   => array(\n\t\t\t\t\t'taxonomy' => array(\n\t\t\t\t\t\t'description' => __( 'An alphanumeric identifier for the taxonomy.' ),\n\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether a given request has permission to read taxonomies.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access, WP_Error object otherwise.\n\t */\n\tpublic function get_items_permissions_check( $request ) {\n\t\tif ( 'edit' === $request['context'] ) {\n\t\t\tif ( ! empty( $request['type'] ) ) {\n\t\t\t\t$taxonomies = get_object_taxonomies( $request['type'], 'objects' );\n\t\t\t} else {\n\t\t\t\t$taxonomies = get_taxonomies( '', 'objects' );\n\t\t\t}\n\n\t\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t\tif ( ! empty( $taxonomy->show_in_rest ) && current_user_can( $taxonomy->cap->assign_terms ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_view',\n\t\t\t\t__( 'Sorry, you are not allowed to manage terms in this taxonomy.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves all public taxonomies.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_items( $request ) {\n\n\t\t// Retrieve the list of registered collection query parameters.\n\t\t$registered = $this->get_collection_params();\n\n\t\tif ( isset( $registered['type'] ) && ! empty( $request['type'] ) ) {\n\t\t\t$taxonomies = get_object_taxonomies( $request['type'], 'objects' );\n\t\t} else {\n\t\t\t$taxonomies = get_taxonomies( '', 'objects' );\n\t\t}\n\n\t\t$data = array();\n\n\t\tforeach ( $taxonomies as $tax_type => $value ) {\n\t\t\tif ( empty( $value->show_in_rest ) || ( 'edit' === $request['context'] && ! current_user_can( $value->cap->assign_terms ) ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$tax               = $this->prepare_item_for_response( $value, $request );\n\t\t\t$tax               = $this->prepare_response_for_collection( $tax );\n\t\t\t$data[ $tax_type ] = $tax;\n\t\t}\n\n\t\tif ( empty( $data ) ) {\n\t\t\t// Response should still be returned as a JSON object when it is empty.\n\t\t\t$data = (object) $data;\n\t\t}\n\n\t\treturn rest_ensure_response( $data );\n\t}\n\n\t/**\n\t * Checks if a given request has access to a taxonomy.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access for the item, otherwise false or WP_Error object.\n\t */\n\tpublic function get_item_permissions_check( $request ) {\n\n\t\t$tax_obj = get_taxonomy( $request['taxonomy'] );\n\n\t\tif ( $tax_obj ) {\n\t\t\tif ( empty( $tax_obj->show_in_rest ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->assign_terms ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_forbidden_context',\n\t\t\t\t\t__( 'Sorry, you are not allowed to manage terms in this taxonomy.' ),\n\t\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves a specific taxonomy.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_item( $request ) {\n\t\t$tax_obj = get_taxonomy( $request['taxonomy'] );\n\n\t\tif ( empty( $tax_obj ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_taxonomy_invalid',\n\t\t\t\t__( 'Invalid taxonomy.' ),\n\t\t\t\tarray( 'status' => 404 )\n\t\t\t);\n\t\t}\n\n\t\t$data = $this->prepare_item_for_response( $tax_obj, $request );\n\n\t\treturn rest_ensure_response( $data );\n\t}\n\n\t/**\n\t * Prepares a taxonomy object for serialization.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Taxonomy     $taxonomy Taxonomy data.\n\t * @param WP_REST_Request $request  Full details about the request.\n\t * @return WP_REST_Response Response object.\n\t */\n\tpublic function prepare_item_for_response( $taxonomy, $request ) {\n\t\t$base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name;\n\n\t\t$fields = $this->get_fields_for_response( $request );\n\t\t$data   = array();\n\n\t\tif ( in_array( 'name', $fields, true ) ) {\n\t\t\t$data['name'] = $taxonomy->label;\n\t\t}\n\n\t\tif ( in_array( 'slug', $fields, true ) ) {\n\t\t\t$data['slug'] = $taxonomy->name;\n\t\t}\n\n\t\tif ( in_array( 'capabilities', $fields, true ) ) {\n\t\t\t$data['capabilities'] = $taxonomy->cap;\n\t\t}\n\n\t\tif ( in_array( 'description', $fields, true ) ) {\n\t\t\t$data['description'] = $taxonomy->description;\n\t\t}\n\n\t\tif ( in_array( 'labels', $fields, true ) ) {\n\t\t\t$data['labels'] = $taxonomy->labels;\n\t\t}\n\n\t\tif ( in_array( 'types', $fields, true ) ) {\n\t\t\t$data['types'] = array_values( $taxonomy->object_type );\n\t\t}\n\n\t\tif ( in_array( 'show_cloud', $fields, true ) ) {\n\t\t\t$data['show_cloud'] = $taxonomy->show_tagcloud;\n\t\t}\n\n\t\tif ( in_array( 'hierarchical', $fields, true ) ) {\n\t\t\t$data['hierarchical'] = $taxonomy->hierarchical;\n\t\t}\n\n\t\tif ( in_array( 'rest_base', $fields, true ) ) {\n\t\t\t$data['rest_base'] = $base;\n\t\t}\n\n\t\tif ( in_array( 'visibility', $fields, true ) ) {\n\t\t\t$data['visibility'] = array(\n\t\t\t\t'public'             => (bool) $taxonomy->public,\n\t\t\t\t'publicly_queryable' => (bool) $taxonomy->publicly_queryable,\n\t\t\t\t'show_admin_column'  => (bool) $taxonomy->show_admin_column,\n\t\t\t\t'show_in_nav_menus'  => (bool) $taxonomy->show_in_nav_menus,\n\t\t\t\t'show_in_quick_edit' => (bool) $taxonomy->show_in_quick_edit,\n\t\t\t\t'show_ui'            => (bool) $taxonomy->show_ui,\n\t\t\t);\n\t\t}\n\n\t\t$context = ! empty( $request['context'] ) ? $request['context'] : 'view';\n\t\t$data    = $this->add_additional_fields_to_object( $data, $request );\n\t\t$data    = $this->filter_response_by_context( $data, $context );\n\n\t\t// Wrap the data in a response object.\n\t\t$response = rest_ensure_response( $data );\n\n\t\t$response->add_links(\n\t\t\tarray(\n\t\t\t\t'collection'              => array(\n\t\t\t\t\t'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),\n\t\t\t\t),\n\t\t\t\t'https://api.w.org/items' => array(\n\t\t\t\t\t'href' => rest_url( sprintf( 'wp/v2/%s', $base ) ),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Filters a taxonomy returned from the REST API.\n\t\t *\n\t\t * Allows modification of the taxonomy data right before it is returned.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_REST_Response $response The response object.\n\t\t * @param WP_Taxonomy      $item     The original taxonomy object.\n\t\t * @param WP_REST_Request  $request  Request used to generate the response.\n\t\t */\n\t\treturn apply_filters( 'rest_prepare_taxonomy', $response, $taxonomy, $request );\n\t}\n\n\t/**\n\t * Retrieves the taxonomy's schema, conforming to JSON Schema.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$schema = array(\n\t\t\t'$schema'    => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title'      => 'taxonomy',\n\t\t\t'type'       => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'capabilities' => array(\n\t\t\t\t\t'description' => __( 'All capabilities used by the taxonomy.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'description'  => array(\n\t\t\t\t\t'description' => __( 'A human-readable description of the taxonomy.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'hierarchical' => array(\n\t\t\t\t\t'description' => __( 'Whether or not the taxonomy should have children.' ),\n\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'labels'       => array(\n\t\t\t\t\t'description' => __( 'Human-readable labels for the taxonomy for various contexts.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'name'         => array(\n\t\t\t\t\t'description' => __( 'The title for the taxonomy.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'slug'         => array(\n\t\t\t\t\t'description' => __( 'An alphanumeric identifier for the taxonomy.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'show_cloud'   => array(\n\t\t\t\t\t'description' => __( 'Whether or not the term cloud should be displayed.' ),\n\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'types'        => array(\n\t\t\t\t\t'description' => __( 'Types associated with the taxonomy.' ),\n\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t'items'       => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'rest_base'    => array(\n\t\t\t\t\t'description' => __( 'REST base route for the taxonomy.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'visibility'   => array(\n\t\t\t\t\t'description' => __( 'The visibility settings for the taxonomy.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'properties'  => array(\n\t\t\t\t\t\t'public'             => array(\n\t\t\t\t\t\t\t'description' => __( 'Whether a taxonomy is intended for use publicly either via the admin interface or by front-end users.' ),\n\t\t\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'publicly_queryable' => array(\n\t\t\t\t\t\t\t'description' => __( 'Whether the taxonomy is publicly queryable.' ),\n\t\t\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'show_ui'            => array(\n\t\t\t\t\t\t\t'description' => __( 'Whether to generate a default UI for managing this taxonomy.' ),\n\t\t\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'show_admin_column'  => array(\n\t\t\t\t\t\t\t'description' => __( 'Whether to allow automatic creation of taxonomy columns on associated post-types table.' ),\n\t\t\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'show_in_nav_menus'  => array(\n\t\t\t\t\t\t\t'description' => __( 'Whether to make the taxonomy available for selection in navigation menus.' ),\n\t\t\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'show_in_quick_edit' => array(\n\t\t\t\t\t\t\t'description' => __( 'Whether to show the taxonomy in the quick/bulk edit panel.' ),\n\t\t\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t\t),\n\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->schema = $schema;\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}\n\n\t/**\n\t * Retrieves the query params for collections.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Collection parameters.\n\t */\n\tpublic function get_collection_params() {\n\t\t$new_params            = array();\n\t\t$new_params['context'] = $this->get_context_param( array( 'default' => 'view' ) );\n\t\t$new_params['type']    = array(\n\t\t\t'description' => __( 'Limit results to taxonomies associated with a specific post type.' ),\n\t\t\t'type'        => 'string',\n\t\t);\n\t\treturn $new_params;\n\t}\n\n}\n", "num_lines": 426}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Terms_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.7.0\n */\n\n/**\n * Core class used to managed terms associated with a taxonomy via the REST API.\n *\n * @since 4.7.0\n *\n * @see WP_REST_Controller\n */\nclass WP_REST_Terms_Controller extends WP_REST_Controller {\n\n\t/**\n\t * Taxonomy key.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tprotected $taxonomy;\n\n\t/**\n\t * Instance of a term meta fields object.\n\t *\n\t * @since 4.7.0\n\t * @var WP_REST_Term_Meta_Fields\n\t */\n\tprotected $meta;\n\n\t/**\n\t * Column to have the terms be sorted by.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tprotected $sort_column;\n\n\t/**\n\t * Number of terms that were found.\n\t *\n\t * @since 4.7.0\n\t * @var int\n\t */\n\tprotected $total_terms;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $taxonomy Taxonomy key.\n\t */\n\tpublic function __construct( $taxonomy ) {\n\t\t$this->taxonomy  = $taxonomy;\n\t\t$this->namespace = 'wp/v2';\n\t\t$tax_obj         = get_taxonomy( $taxonomy );\n\t\t$this->rest_base = ! empty( $tax_obj->rest_base ) ? $tax_obj->rest_base : $tax_obj->name;\n\n\t\t$this->meta = new WP_REST_Term_Meta_Fields( $taxonomy );\n\t}\n\n\t/**\n\t * Registers the routes for the objects of the controller.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see register_rest_route()\n\t */\n\tpublic function register_routes() {\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_items' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::CREATABLE,\n\t\t\t\t\t'callback'            => array( $this, 'create_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'create_item_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base . '/(?P<id>[\\d]+)',\n\t\t\tarray(\n\t\t\t\t'args'   => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'description' => __( 'Unique identifier for the term.' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::EDITABLE,\n\t\t\t\t\t'callback'            => array( $this, 'update_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'update_item_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::DELETABLE,\n\t\t\t\t\t'callback'            => array( $this, 'delete_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'delete_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'force' => array(\n\t\t\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t\t\t'default'     => false,\n\t\t\t\t\t\t\t'description' => __( 'Required to be true, as terms do not support trashing.' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Checks if a request has access to read terms in the specified taxonomy.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return bool|WP_Error True if the request has read access, otherwise false or WP_Error object.\n\t */\n\tpublic function get_items_permissions_check( $request ) {\n\t\t$tax_obj = get_taxonomy( $this->taxonomy );\n\n\t\tif ( ! $tax_obj || ! $this->check_is_taxonomy_allowed( $this->taxonomy ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->edit_terms ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_forbidden_context',\n\t\t\t\t__( 'Sorry, you are not allowed to edit terms in this taxonomy.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves terms associated with a taxonomy.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_items( $request ) {\n\n\t\t// Retrieve the list of registered collection query parameters.\n\t\t$registered = $this->get_collection_params();\n\n\t\t/*\n\t\t * This array defines mappings between public API query parameters whose\n\t\t * values are accepted as-passed, and their internal WP_Query parameter\n\t\t * name equivalents (some are the same). Only values which are also\n\t\t * present in $registered will be set.\n\t\t */\n\t\t$parameter_mappings = array(\n\t\t\t'exclude'    => 'exclude',\n\t\t\t'include'    => 'include',\n\t\t\t'order'      => 'order',\n\t\t\t'orderby'    => 'orderby',\n\t\t\t'post'       => 'post',\n\t\t\t'hide_empty' => 'hide_empty',\n\t\t\t'per_page'   => 'number',\n\t\t\t'search'     => 'search',\n\t\t\t'slug'       => 'slug',\n\t\t);\n\n\t\t$prepared_args = array( 'taxonomy' => $this->taxonomy );\n\n\t\t/*\n\t\t * For each known parameter which is both registered and present in the request,\n\t\t * set the parameter's value on the query $prepared_args.\n\t\t */\n\t\tforeach ( $parameter_mappings as $api_param => $wp_param ) {\n\t\t\tif ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) {\n\t\t\t\t$prepared_args[ $wp_param ] = $request[ $api_param ];\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $prepared_args['orderby'] ) && isset( $request['orderby'] ) ) {\n\t\t\t$orderby_mappings = array(\n\t\t\t\t'include_slugs' => 'slug__in',\n\t\t\t);\n\n\t\t\tif ( isset( $orderby_mappings[ $request['orderby'] ] ) ) {\n\t\t\t\t$prepared_args['orderby'] = $orderby_mappings[ $request['orderby'] ];\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $registered['offset'] ) && ! empty( $request['offset'] ) ) {\n\t\t\t$prepared_args['offset'] = $request['offset'];\n\t\t} else {\n\t\t\t$prepared_args['offset'] = ( $request['page'] - 1 ) * $prepared_args['number'];\n\t\t}\n\n\t\t$taxonomy_obj = get_taxonomy( $this->taxonomy );\n\n\t\tif ( $taxonomy_obj->hierarchical && isset( $registered['parent'], $request['parent'] ) ) {\n\t\t\tif ( 0 === $request['parent'] ) {\n\t\t\t\t// Only query top-level terms.\n\t\t\t\t$prepared_args['parent'] = 0;\n\t\t\t} else {\n\t\t\t\tif ( $request['parent'] ) {\n\t\t\t\t\t$prepared_args['parent'] = $request['parent'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filters the query arguments before passing them to get_terms().\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.\n\t\t *\n\t\t * Enables adding extra arguments or setting defaults for a terms\n\t\t * collection request.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @link https://developer.wordpress.org/reference/functions/get_terms/\n\t\t *\n\t\t * @param array           $prepared_args Array of arguments to be\n\t\t *                                       passed to get_terms().\n\t\t * @param WP_REST_Request $request       The current request.\n\t\t */\n\t\t$prepared_args = apply_filters( \"rest_{$this->taxonomy}_query\", $prepared_args, $request );\n\n\t\tif ( ! empty( $prepared_args['post'] ) ) {\n\t\t\t$query_result = wp_get_object_terms( $prepared_args['post'], $this->taxonomy, $prepared_args );\n\n\t\t\t// Used when calling wp_count_terms() below.\n\t\t\t$prepared_args['object_ids'] = $prepared_args['post'];\n\t\t} else {\n\t\t\t$query_result = get_terms( $prepared_args );\n\t\t}\n\n\t\t$count_args = $prepared_args;\n\n\t\tunset( $count_args['number'], $count_args['offset'] );\n\n\t\t$total_terms = wp_count_terms( $this->taxonomy, $count_args );\n\n\t\t// wp_count_terms() can return a falsey value when the term has no children.\n\t\tif ( ! $total_terms ) {\n\t\t\t$total_terms = 0;\n\t\t}\n\n\t\t$response = array();\n\n\t\tforeach ( $query_result as $term ) {\n\t\t\t$data       = $this->prepare_item_for_response( $term, $request );\n\t\t\t$response[] = $this->prepare_response_for_collection( $data );\n\t\t}\n\n\t\t$response = rest_ensure_response( $response );\n\n\t\t// Store pagination values for headers.\n\t\t$per_page = (int) $prepared_args['number'];\n\t\t$page     = ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 );\n\n\t\t$response->header( 'X-WP-Total', (int) $total_terms );\n\n\t\t$max_pages = ceil( $total_terms / $per_page );\n\n\t\t$response->header( 'X-WP-TotalPages', (int) $max_pages );\n\n\t\t$base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( $this->namespace . '/' . $this->rest_base ) );\n\t\tif ( $page > 1 ) {\n\t\t\t$prev_page = $page - 1;\n\n\t\t\tif ( $prev_page > $max_pages ) {\n\t\t\t\t$prev_page = $max_pages;\n\t\t\t}\n\n\t\t\t$prev_link = add_query_arg( 'page', $prev_page, $base );\n\t\t\t$response->link_header( 'prev', $prev_link );\n\t\t}\n\t\tif ( $max_pages > $page ) {\n\t\t\t$next_page = $page + 1;\n\t\t\t$next_link = add_query_arg( 'page', $next_page, $base );\n\n\t\t\t$response->link_header( 'next', $next_link );\n\t\t}\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Get the term, if the ID is valid.\n\t *\n\t * @since 4.7.2\n\t *\n\t * @param int $id Supplied ID.\n\t * @return WP_Term|WP_Error Term object if ID is valid, WP_Error otherwise.\n\t */\n\tprotected function get_term( $id ) {\n\t\t$error = new WP_Error(\n\t\t\t'rest_term_invalid',\n\t\t\t__( 'Term does not exist.' ),\n\t\t\tarray( 'status' => 404 )\n\t\t);\n\n\t\tif ( ! $this->check_is_taxonomy_allowed( $this->taxonomy ) ) {\n\t\t\treturn $error;\n\t\t}\n\n\t\tif ( (int) $id <= 0 ) {\n\t\t\treturn $error;\n\t\t}\n\n\t\t$term = get_term( (int) $id, $this->taxonomy );\n\t\tif ( empty( $term ) || $term->taxonomy !== $this->taxonomy ) {\n\t\t\treturn $error;\n\t\t}\n\n\t\treturn $term;\n\t}\n\n\t/**\n\t * Checks if a request has access to read or edit the specified term.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return bool|WP_Error True if the request has read access for the item, otherwise false or WP_Error object.\n\t */\n\tpublic function get_item_permissions_check( $request ) {\n\t\t$term = $this->get_term( $request['id'] );\n\n\t\tif ( is_wp_error( $term ) ) {\n\t\t\treturn $term;\n\t\t}\n\n\t\tif ( 'edit' === $request['context'] && ! current_user_can( 'edit_term', $term->term_id ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_forbidden_context',\n\t\t\t\t__( 'Sorry, you are not allowed to edit this term.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Gets a single term from a taxonomy.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_item( $request ) {\n\t\t$term = $this->get_term( $request['id'] );\n\t\tif ( is_wp_error( $term ) ) {\n\t\t\treturn $term;\n\t\t}\n\n\t\t$response = $this->prepare_item_for_response( $term, $request );\n\n\t\treturn rest_ensure_response( $response );\n\t}\n\n\t/**\n\t * Checks if a request has access to create a term.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return bool|WP_Error True if the request has access to create items, false or WP_Error object otherwise.\n\t */\n\tpublic function create_item_permissions_check( $request ) {\n\n\t\tif ( ! $this->check_is_taxonomy_allowed( $this->taxonomy ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$taxonomy_obj = get_taxonomy( $this->taxonomy );\n\n\t\tif ( ( is_taxonomy_hierarchical( $this->taxonomy )\n\t\t\t\t&& ! current_user_can( $taxonomy_obj->cap->edit_terms ) )\n\t\t\t|| ( ! is_taxonomy_hierarchical( $this->taxonomy )\n\t\t\t\t&& ! current_user_can( $taxonomy_obj->cap->assign_terms ) ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_create',\n\t\t\t\t__( 'Sorry, you are not allowed to create terms in this taxonomy.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Creates a single term in a taxonomy.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function create_item( $request ) {\n\t\tif ( isset( $request['parent'] ) ) {\n\t\t\tif ( ! is_taxonomy_hierarchical( $this->taxonomy ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_taxonomy_not_hierarchical',\n\t\t\t\t\t__( 'Cannot set parent term, taxonomy is not hierarchical.' ),\n\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$parent = get_term( (int) $request['parent'], $this->taxonomy );\n\n\t\t\tif ( ! $parent ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_term_invalid',\n\t\t\t\t\t__( 'Parent term does not exist.' ),\n\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$prepared_term = $this->prepare_item_for_database( $request );\n\n\t\t$term = wp_insert_term( wp_slash( $prepared_term->name ), $this->taxonomy, wp_slash( (array) $prepared_term ) );\n\t\tif ( is_wp_error( $term ) ) {\n\t\t\t/*\n\t\t\t * If we're going to inform the client that the term already exists,\n\t\t\t * give them the identifier for future use.\n\t\t\t */\n\t\t\t$term_id = $term->get_error_data( 'term_exists' );\n\t\t\tif ( $term_id ) {\n\t\t\t\t$existing_term = get_term( $term_id, $this->taxonomy );\n\t\t\t\t$term->add_data( $existing_term->term_id, 'term_exists' );\n\t\t\t\t$term->add_data(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'status'  => 400,\n\t\t\t\t\t\t'term_id' => $term_id,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $term;\n\t\t}\n\n\t\t$term = get_term( $term['term_id'], $this->taxonomy );\n\n\t\t/**\n\t\t * Fires after a single term is created or updated via the REST API.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_Term         $term     Inserted or updated term object.\n\t\t * @param WP_REST_Request $request  Request object.\n\t\t * @param bool            $creating True when creating a term, false when updating.\n\t\t */\n\t\tdo_action( \"rest_insert_{$this->taxonomy}\", $term, $request, true );\n\n\t\t$schema = $this->get_item_schema();\n\t\tif ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) {\n\t\t\t$meta_update = $this->meta->update_value( $request['meta'], $term->term_id );\n\n\t\t\tif ( is_wp_error( $meta_update ) ) {\n\t\t\t\treturn $meta_update;\n\t\t\t}\n\t\t}\n\n\t\t$fields_update = $this->update_additional_fields_for_object( $term, $request );\n\n\t\tif ( is_wp_error( $fields_update ) ) {\n\t\t\treturn $fields_update;\n\t\t}\n\n\t\t$request->set_param( 'context', 'edit' );\n\n\t\t/**\n\t\t * Fires after a single term is completely created or updated via the REST API.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.\n\t\t *\n\t\t * @since 5.0.0\n\t\t *\n\t\t * @param WP_Term         $term     Inserted or updated term object.\n\t\t * @param WP_REST_Request $request  Request object.\n\t\t * @param bool            $creating True when creating a term, false when updating.\n\t\t */\n\t\tdo_action( \"rest_after_insert_{$this->taxonomy}\", $term, $request, true );\n\n\t\t$response = $this->prepare_item_for_response( $term, $request );\n\t\t$response = rest_ensure_response( $response );\n\n\t\t$response->set_status( 201 );\n\t\t$response->header( 'Location', rest_url( $this->namespace . '/' . $this->rest_base . '/' . $term->term_id ) );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Checks if a request has access to update the specified term.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return bool|WP_Error True if the request has access to update the item, false or WP_Error object otherwise.\n\t */\n\tpublic function update_item_permissions_check( $request ) {\n\t\t$term = $this->get_term( $request['id'] );\n\n\t\tif ( is_wp_error( $term ) ) {\n\t\t\treturn $term;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_term', $term->term_id ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_update',\n\t\t\t\t__( 'Sorry, you are not allowed to edit this term.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Updates a single term from a taxonomy.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function update_item( $request ) {\n\t\t$term = $this->get_term( $request['id'] );\n\t\tif ( is_wp_error( $term ) ) {\n\t\t\treturn $term;\n\t\t}\n\n\t\tif ( isset( $request['parent'] ) ) {\n\t\t\tif ( ! is_taxonomy_hierarchical( $this->taxonomy ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_taxonomy_not_hierarchical',\n\t\t\t\t\t__( 'Cannot set parent term, taxonomy is not hierarchical.' ),\n\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$parent = get_term( (int) $request['parent'], $this->taxonomy );\n\n\t\t\tif ( ! $parent ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_term_invalid',\n\t\t\t\t\t__( 'Parent term does not exist.' ),\n\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$prepared_term = $this->prepare_item_for_database( $request );\n\n\t\t// Only update the term if we have something to update.\n\t\tif ( ! empty( $prepared_term ) ) {\n\t\t\t$update = wp_update_term( $term->term_id, $term->taxonomy, wp_slash( (array) $prepared_term ) );\n\n\t\t\tif ( is_wp_error( $update ) ) {\n\t\t\t\treturn $update;\n\t\t\t}\n\t\t}\n\n\t\t$term = get_term( $term->term_id, $this->taxonomy );\n\n\t\t/** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php */\n\t\tdo_action( \"rest_insert_{$this->taxonomy}\", $term, $request, false );\n\n\t\t$schema = $this->get_item_schema();\n\t\tif ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) {\n\t\t\t$meta_update = $this->meta->update_value( $request['meta'], $term->term_id );\n\n\t\t\tif ( is_wp_error( $meta_update ) ) {\n\t\t\t\treturn $meta_update;\n\t\t\t}\n\t\t}\n\n\t\t$fields_update = $this->update_additional_fields_for_object( $term, $request );\n\n\t\tif ( is_wp_error( $fields_update ) ) {\n\t\t\treturn $fields_update;\n\t\t}\n\n\t\t$request->set_param( 'context', 'edit' );\n\n\t\t/** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php */\n\t\tdo_action( \"rest_after_insert_{$this->taxonomy}\", $term, $request, false );\n\n\t\t$response = $this->prepare_item_for_response( $term, $request );\n\n\t\treturn rest_ensure_response( $response );\n\t}\n\n\t/**\n\t * Checks if a request has access to delete the specified term.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return bool|WP_Error True if the request has access to delete the item, otherwise false or WP_Error object.\n\t */\n\tpublic function delete_item_permissions_check( $request ) {\n\t\t$term = $this->get_term( $request['id'] );\n\n\t\tif ( is_wp_error( $term ) ) {\n\t\t\treturn $term;\n\t\t}\n\n\t\tif ( ! current_user_can( 'delete_term', $term->term_id ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_delete',\n\t\t\t\t__( 'Sorry, you are not allowed to delete this term.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Deletes a single term from a taxonomy.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function delete_item( $request ) {\n\t\t$term = $this->get_term( $request['id'] );\n\t\tif ( is_wp_error( $term ) ) {\n\t\t\treturn $term;\n\t\t}\n\n\t\t$force = isset( $request['force'] ) ? (bool) $request['force'] : false;\n\n\t\t// We don't support trashing for terms.\n\t\tif ( ! $force ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_trash_not_supported',\n\t\t\t\t/* translators: %s: force=true */\n\t\t\t\tsprintf( __( \"Terms do not support trashing. Set '%s' to delete.\" ), 'force=true' ),\n\t\t\t\tarray( 'status' => 501 )\n\t\t\t);\n\t\t}\n\n\t\t$request->set_param( 'context', 'view' );\n\n\t\t$previous = $this->prepare_item_for_response( $term, $request );\n\n\t\t$retval = wp_delete_term( $term->term_id, $term->taxonomy );\n\n\t\tif ( ! $retval ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_delete',\n\t\t\t\t__( 'The term cannot be deleted.' ),\n\t\t\t\tarray( 'status' => 500 )\n\t\t\t);\n\t\t}\n\n\t\t$response = new WP_REST_Response();\n\t\t$response->set_data(\n\t\t\tarray(\n\t\t\t\t'deleted'  => true,\n\t\t\t\t'previous' => $previous->get_data(),\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Fires after a single term is deleted via the REST API.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_Term          $term     The deleted term.\n\t\t * @param WP_REST_Response $response The response data.\n\t\t * @param WP_REST_Request  $request  The request sent to the API.\n\t\t */\n\t\tdo_action( \"rest_delete_{$this->taxonomy}\", $term, $response, $request );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Prepares a single term for create or update.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Request object.\n\t * @return object Term object.\n\t */\n\tpublic function prepare_item_for_database( $request ) {\n\t\t$prepared_term = new stdClass;\n\n\t\t$schema = $this->get_item_schema();\n\t\tif ( isset( $request['name'] ) && ! empty( $schema['properties']['name'] ) ) {\n\t\t\t$prepared_term->name = $request['name'];\n\t\t}\n\n\t\tif ( isset( $request['slug'] ) && ! empty( $schema['properties']['slug'] ) ) {\n\t\t\t$prepared_term->slug = $request['slug'];\n\t\t}\n\n\t\tif ( isset( $request['taxonomy'] ) && ! empty( $schema['properties']['taxonomy'] ) ) {\n\t\t\t$prepared_term->taxonomy = $request['taxonomy'];\n\t\t}\n\n\t\tif ( isset( $request['description'] ) && ! empty( $schema['properties']['description'] ) ) {\n\t\t\t$prepared_term->description = $request['description'];\n\t\t}\n\n\t\tif ( isset( $request['parent'] ) && ! empty( $schema['properties']['parent'] ) ) {\n\t\t\t$parent_term_id   = 0;\n\t\t\t$requested_parent = (int) $request['parent'];\n\n\t\t\tif ( $requested_parent ) {\n\t\t\t\t$parent_term = get_term( $requested_parent, $this->taxonomy );\n\n\t\t\t\tif ( $parent_term instanceof WP_Term ) {\n\t\t\t\t\t$parent_term_id = $parent_term->term_id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$prepared_term->parent = $parent_term_id;\n\t\t}\n\n\t\t/**\n\t\t * Filters term data before inserting term via the REST API.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param object          $prepared_term Term object.\n\t\t * @param WP_REST_Request $request       Request object.\n\t\t */\n\t\treturn apply_filters( \"rest_pre_insert_{$this->taxonomy}\", $prepared_term, $request );\n\t}\n\n\t/**\n\t * Prepares a single term output for response.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Term         $item    Term object.\n\t * @param WP_REST_Request $request Request object.\n\t * @return WP_REST_Response Response object.\n\t */\n\tpublic function prepare_item_for_response( $item, $request ) {\n\n\t\t$fields = $this->get_fields_for_response( $request );\n\t\t$data   = array();\n\n\t\tif ( in_array( 'id', $fields, true ) ) {\n\t\t\t$data['id'] = (int) $item->term_id;\n\t\t}\n\n\t\tif ( in_array( 'count', $fields, true ) ) {\n\t\t\t$data['count'] = (int) $item->count;\n\t\t}\n\n\t\tif ( in_array( 'description', $fields, true ) ) {\n\t\t\t$data['description'] = $item->description;\n\t\t}\n\n\t\tif ( in_array( 'link', $fields, true ) ) {\n\t\t\t$data['link'] = get_term_link( $item );\n\t\t}\n\n\t\tif ( in_array( 'name', $fields, true ) ) {\n\t\t\t$data['name'] = $item->name;\n\t\t}\n\n\t\tif ( in_array( 'slug', $fields, true ) ) {\n\t\t\t$data['slug'] = $item->slug;\n\t\t}\n\n\t\tif ( in_array( 'taxonomy', $fields, true ) ) {\n\t\t\t$data['taxonomy'] = $item->taxonomy;\n\t\t}\n\n\t\tif ( in_array( 'parent', $fields, true ) ) {\n\t\t\t$data['parent'] = (int) $item->parent;\n\t\t}\n\n\t\tif ( in_array( 'meta', $fields, true ) ) {\n\t\t\t$data['meta'] = $this->meta->get_value( $item->term_id, $request );\n\t\t}\n\n\t\t$context = ! empty( $request['context'] ) ? $request['context'] : 'view';\n\t\t$data    = $this->add_additional_fields_to_object( $data, $request );\n\t\t$data    = $this->filter_response_by_context( $data, $context );\n\n\t\t$response = rest_ensure_response( $data );\n\n\t\t$response->add_links( $this->prepare_links( $item ) );\n\n\t\t/**\n\t\t * Filters a term item returned from the API.\n\t\t *\n\t\t * The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.\n\t\t *\n\t\t * Allows modification of the term data right before it is returned.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_REST_Response  $response  The response object.\n\t\t * @param WP_Term           $item      The original term object.\n\t\t * @param WP_REST_Request   $request   Request used to generate the response.\n\t\t */\n\t\treturn apply_filters( \"rest_prepare_{$this->taxonomy}\", $response, $item, $request );\n\t}\n\n\t/**\n\t * Prepares links for the request.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Term $term Term object.\n\t * @return array Links for the given term.\n\t */\n\tprotected function prepare_links( $term ) {\n\t\t$base  = $this->namespace . '/' . $this->rest_base;\n\t\t$links = array(\n\t\t\t'self'       => array(\n\t\t\t\t'href' => rest_url( trailingslashit( $base ) . $term->term_id ),\n\t\t\t),\n\t\t\t'collection' => array(\n\t\t\t\t'href' => rest_url( $base ),\n\t\t\t),\n\t\t\t'about'      => array(\n\t\t\t\t'href' => rest_url( sprintf( 'wp/v2/taxonomies/%s', $this->taxonomy ) ),\n\t\t\t),\n\t\t);\n\n\t\tif ( $term->parent ) {\n\t\t\t$parent_term = get_term( (int) $term->parent, $term->taxonomy );\n\n\t\t\tif ( $parent_term ) {\n\t\t\t\t$links['up'] = array(\n\t\t\t\t\t'href'       => rest_url( trailingslashit( $base ) . $parent_term->term_id ),\n\t\t\t\t\t'embeddable' => true,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$taxonomy_obj = get_taxonomy( $term->taxonomy );\n\n\t\tif ( empty( $taxonomy_obj->object_type ) ) {\n\t\t\treturn $links;\n\t\t}\n\n\t\t$post_type_links = array();\n\n\t\tforeach ( $taxonomy_obj->object_type as $type ) {\n\t\t\t$post_type_object = get_post_type_object( $type );\n\n\t\t\tif ( empty( $post_type_object->show_in_rest ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$rest_base         = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name;\n\t\t\t$post_type_links[] = array(\n\t\t\t\t'href' => add_query_arg( $this->rest_base, $term->term_id, rest_url( sprintf( 'wp/v2/%s', $rest_base ) ) ),\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $post_type_links ) ) {\n\t\t\t$links['https://api.w.org/post_type'] = $post_type_links;\n\t\t}\n\n\t\treturn $links;\n\t}\n\n\t/**\n\t * Retrieves the term's schema, conforming to JSON Schema.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$schema = array(\n\t\t\t'$schema'    => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title'      => 'post_tag' === $this->taxonomy ? 'tag' : $this->taxonomy,\n\t\t\t'type'       => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'id'          => array(\n\t\t\t\t\t'description' => __( 'Unique identifier for the term.' ),\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'context'     => array( 'view', 'embed', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'count'       => array(\n\t\t\t\t\t'description' => __( 'Number of published posts for the term.' ),\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t'description' => __( 'HTML description of the term.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'link'        => array(\n\t\t\t\t\t'description' => __( 'URL of the term.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t'context'     => array( 'view', 'embed', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'name'        => array(\n\t\t\t\t\t'description' => __( 'HTML title for the term.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'embed', 'edit' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t),\n\t\t\t\t\t'required'    => true,\n\t\t\t\t),\n\t\t\t\t'slug'        => array(\n\t\t\t\t\t'description' => __( 'An alphanumeric identifier for the term unique to its type.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'view', 'embed', 'edit' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => array( $this, 'sanitize_slug' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'taxonomy'    => array(\n\t\t\t\t\t'description' => __( 'Type attribution for the term.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'enum'        => array_keys( get_taxonomies() ),\n\t\t\t\t\t'context'     => array( 'view', 'embed', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$taxonomy = get_taxonomy( $this->taxonomy );\n\n\t\tif ( $taxonomy->hierarchical ) {\n\t\t\t$schema['properties']['parent'] = array(\n\t\t\t\t'description' => __( 'The parent term ID.' ),\n\t\t\t\t'type'        => 'integer',\n\t\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t);\n\t\t}\n\n\t\t$schema['properties']['meta'] = $this->meta->get_field_schema();\n\n\t\t$this->schema = $schema;\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}\n\n\t/**\n\t * Retrieves the query params for collections.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Collection parameters.\n\t */\n\tpublic function get_collection_params() {\n\t\t$query_params = parent::get_collection_params();\n\t\t$taxonomy     = get_taxonomy( $this->taxonomy );\n\n\t\t$query_params['context']['default'] = 'view';\n\n\t\t$query_params['exclude'] = array(\n\t\t\t'description' => __( 'Ensure result set excludes specific IDs.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'default'     => array(),\n\t\t);\n\n\t\t$query_params['include'] = array(\n\t\t\t'description' => __( 'Limit result set to specific IDs.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'default'     => array(),\n\t\t);\n\n\t\tif ( ! $taxonomy->hierarchical ) {\n\t\t\t$query_params['offset'] = array(\n\t\t\t\t'description' => __( 'Offset the result set by a specific number of items.' ),\n\t\t\t\t'type'        => 'integer',\n\t\t\t);\n\t\t}\n\n\t\t$query_params['order'] = array(\n\t\t\t'description' => __( 'Order sort attribute ascending or descending.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'default'     => 'asc',\n\t\t\t'enum'        => array(\n\t\t\t\t'asc',\n\t\t\t\t'desc',\n\t\t\t),\n\t\t);\n\n\t\t$query_params['orderby'] = array(\n\t\t\t'description' => __( 'Sort collection by term attribute.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'default'     => 'name',\n\t\t\t'enum'        => array(\n\t\t\t\t'id',\n\t\t\t\t'include',\n\t\t\t\t'name',\n\t\t\t\t'slug',\n\t\t\t\t'include_slugs',\n\t\t\t\t'term_group',\n\t\t\t\t'description',\n\t\t\t\t'count',\n\t\t\t),\n\t\t);\n\n\t\t$query_params['hide_empty'] = array(\n\t\t\t'description' => __( 'Whether to hide terms not assigned to any posts.' ),\n\t\t\t'type'        => 'boolean',\n\t\t\t'default'     => false,\n\t\t);\n\n\t\tif ( $taxonomy->hierarchical ) {\n\t\t\t$query_params['parent'] = array(\n\t\t\t\t'description' => __( 'Limit result set to terms assigned to a specific parent.' ),\n\t\t\t\t'type'        => 'integer',\n\t\t\t);\n\t\t}\n\n\t\t$query_params['post'] = array(\n\t\t\t'description' => __( 'Limit result set to terms assigned to a specific post.' ),\n\t\t\t'type'        => 'integer',\n\t\t\t'default'     => null,\n\t\t);\n\n\t\t$query_params['slug'] = array(\n\t\t\t'description' => __( 'Limit result set to terms with one or more specific slugs.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'string',\n\t\t\t),\n\t\t);\n\n\t\t/**\n\t\t * Filter collection parameters for the terms controller.\n\t\t *\n\t\t * The dynamic part of the filter `$this->taxonomy` refers to the taxonomy\n\t\t * slug for the controller.\n\t\t *\n\t\t * This filter registers the collection parameter, but does not map the\n\t\t * collection parameter to an internal WP_Term_Query parameter.  Use the\n\t\t * `rest_{$this->taxonomy}_query` filter to set WP_Term_Query parameters.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param array       $query_params JSON Schema-formatted collection parameters.\n\t\t * @param WP_Taxonomy $taxonomy     Taxonomy object.\n\t\t */\n\t\treturn apply_filters( \"rest_{$this->taxonomy}_collection_params\", $query_params, $taxonomy );\n\t}\n\n\t/**\n\t * Checks that the taxonomy is valid.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $taxonomy Taxonomy to check.\n\t * @return bool Whether the taxonomy is allowed for REST management.\n\t */\n\tprotected function check_is_taxonomy_allowed( $taxonomy ) {\n\t\t$taxonomy_obj = get_taxonomy( $taxonomy );\n\t\tif ( $taxonomy_obj && ! empty( $taxonomy_obj->show_in_rest ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}\n", "num_lines": 1117}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Themes_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 5.0.0\n */\n\n/**\n * Core class used to manage themes via the REST API.\n *\n * @since 5.0.0\n *\n * @see WP_REST_Controller\n */\nclass WP_REST_Themes_Controller extends WP_REST_Controller {\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 5.0.0\n\t */\n\tpublic function __construct() {\n\t\t$this->namespace = 'wp/v2';\n\t\t$this->rest_base = 'themes';\n\t}\n\n\t/**\n\t * Registers the routes for the objects of the controller.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @see register_rest_route()\n\t */\n\tpublic function register_routes() {\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_items' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_item_schema' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Checks if a given request has access to read the theme.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access for the item, otherwise WP_Error object.\n\t */\n\tpublic function get_items_permissions_check( $request ) {\n\t\tif ( current_user_can( 'edit_posts' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tforeach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) {\n\t\t\tif ( current_user_can( $post_type->cap->edit_posts ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn new WP_Error(\n\t\t\t'rest_user_cannot_view',\n\t\t\t__( 'Sorry, you are not allowed to view themes.' ),\n\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves a collection of themes.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_items( $request ) {\n\t\t// Retrieve the list of registered collection query parameters.\n\t\t$registered = $this->get_collection_params();\n\t\t$themes     = array();\n\n\t\tif ( isset( $registered['status'], $request['status'] ) && in_array( 'active', $request['status'], true ) ) {\n\t\t\t$active_theme = wp_get_theme();\n\t\t\t$active_theme = $this->prepare_item_for_response( $active_theme, $request );\n\t\t\t$themes[]     = $this->prepare_response_for_collection( $active_theme );\n\t\t}\n\n\t\t$response = rest_ensure_response( $themes );\n\n\t\t$response->header( 'X-WP-Total', count( $themes ) );\n\t\t$response->header( 'X-WP-TotalPages', count( $themes ) );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Prepares a single theme output for response.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_Theme        $theme   Theme object.\n\t * @param WP_REST_Request $request Request object.\n\t * @return WP_REST_Response Response object.\n\t */\n\tpublic function prepare_item_for_response( $theme, $request ) {\n\t\t$data   = array();\n\t\t$fields = $this->get_fields_for_response( $request );\n\n\t\tif ( rest_is_field_included( 'stylesheet', $fields ) ) {\n\t\t\t$data['stylesheet'] = $theme->get_stylesheet();\n\t\t}\n\n\t\tif ( rest_is_field_included( 'template', $fields ) ) {\n\t\t\t/**\n\t\t\t * Use the get_template() method, not the 'Template' header, for finding the template.\n\t\t\t * The 'Template' header is only good for what was written in the style.css, while\n\t\t\t * get_template() takes into account where WordPress actually located the theme and\n\t\t\t * whether it is actually valid.\n\t\t\t */\n\t\t\t$data['template'] = $theme->get_template();\n\t\t}\n\n\t\t$plain_field_mappings = array(\n\t\t\t'requires_php' => 'RequiresPHP',\n\t\t\t'requires_wp'  => 'RequiresWP',\n\t\t\t'textdomain'   => 'TextDomain',\n\t\t\t'version'      => 'Version',\n\t\t);\n\n\t\tforeach ( $plain_field_mappings as $field => $header ) {\n\t\t\tif ( rest_is_field_included( $field, $fields ) ) {\n\t\t\t\t$data[ $field ] = $theme->get( $header );\n\t\t\t}\n\t\t}\n\n\t\tif ( rest_is_field_included( 'screenshot', $fields ) ) {\n\t\t\t// Using $theme->get_screenshot() with no args to get absolute URL.\n\t\t\t$data['screenshot'] = $theme->get_screenshot() ? $theme->get_screenshot() : '';\n\t\t}\n\n\t\t$rich_field_mappings = array(\n\t\t\t'author'      => 'Author',\n\t\t\t'author_uri'  => 'AuthorURI',\n\t\t\t'description' => 'Description',\n\t\t\t'name'        => 'Name',\n\t\t\t'tags'        => 'Tags',\n\t\t\t'theme_uri'   => 'ThemeURI',\n\t\t);\n\n\t\tforeach ( $rich_field_mappings as $field => $header ) {\n\t\t\tif ( rest_is_field_included( \"{$field}.raw\", $fields ) ) {\n\t\t\t\t$data[ $field ]['raw'] = $theme->display( $header, false, true );\n\t\t\t}\n\n\t\t\tif ( rest_is_field_included( \"{$field}.rendered\", $fields ) ) {\n\t\t\t\t$data[ $field ]['rendered'] = $theme->display( $header );\n\t\t\t}\n\t\t}\n\n\t\tif ( rest_is_field_included( 'theme_supports', $fields ) ) {\n\t\t\tforeach ( get_registered_theme_features() as $feature => $config ) {\n\t\t\t\tif ( ! is_array( $config['show_in_rest'] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$name = $config['show_in_rest']['name'];\n\n\t\t\t\tif ( ! rest_is_field_included( \"theme_supports.{$name}\", $fields ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( ! current_theme_supports( $feature ) ) {\n\t\t\t\t\t$data['theme_supports'][ $name ] = $config['show_in_rest']['schema']['default'];\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$support = get_theme_support( $feature );\n\n\t\t\t\tif ( isset( $config['show_in_rest']['prepare_callback'] ) ) {\n\t\t\t\t\t$prepare = $config['show_in_rest']['prepare_callback'];\n\t\t\t\t} else {\n\t\t\t\t\t$prepare = array( $this, 'prepare_theme_support' );\n\t\t\t\t}\n\n\t\t\t\t$prepared = $prepare( $support, $config, $feature, $request );\n\n\t\t\t\tif ( is_wp_error( $prepared ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$data['theme_supports'][ $name ] = $prepared;\n\t\t\t}\n\t\t}\n\n\t\t$data = $this->add_additional_fields_to_object( $data, $request );\n\n\t\t// Wrap the data in a response object.\n\t\t$response = rest_ensure_response( $data );\n\n\t\t/**\n\t\t * Filters theme data returned from the REST API.\n\t\t *\n\t\t * @since 5.0.0\n\t\t *\n\t\t * @param WP_REST_Response $response The response object.\n\t\t * @param WP_Theme         $theme    Theme object used to create response.\n\t\t * @param WP_REST_Request  $request  Request object.\n\t\t */\n\t\treturn apply_filters( 'rest_prepare_theme', $response, $theme, $request );\n\t}\n\n\t/**\n\t * Prepares the theme support value for inclusion in the REST API response.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param mixed           $support The raw value from get_theme_support().\n\t * @param array           $args    The feature's registration args.\n\t * @param string          $feature The feature name.\n\t * @param WP_REST_Request $request The request object.\n\t * @return mixed The prepared support value.\n\t */\n\tprotected function prepare_theme_support( $support, $args, $feature, $request ) {\n\t\t$schema = $args['show_in_rest']['schema'];\n\n\t\tif ( 'boolean' === $schema['type'] ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( is_array( $support ) && ! $args['variadic'] ) {\n\t\t\t$support = $support[0];\n\t\t}\n\n\t\treturn rest_sanitize_value_from_schema( $support, $schema );\n\t}\n\n\t/**\n\t * Retrieves the theme's schema, conforming to JSON Schema.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$schema = array(\n\t\t\t'$schema'    => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title'      => 'theme',\n\t\t\t'type'       => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'stylesheet'     => array(\n\t\t\t\t\t'description' => __( 'The theme\\'s stylesheet. This uniquely identifies the theme.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'template'       => array(\n\t\t\t\t\t'description' => __( 'The theme\\'s template. If this is a child theme, this refers to the parent theme, otherwise this is the same as the theme\\'s stylesheet.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'author'         => array(\n\t\t\t\t\t'description' => __( 'The theme author.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'properties'  => array(\n\t\t\t\t\t\t'raw'      => array(\n\t\t\t\t\t\t\t'description' => __( 'The theme author\\'s name, as found in the theme header.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'rendered' => array(\n\t\t\t\t\t\t\t'description' => __( 'HTML for the theme author, transformed for display.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'author_uri'     => array(\n\t\t\t\t\t'description' => __( 'The website of the theme author.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'properties'  => array(\n\t\t\t\t\t\t'raw'      => array(\n\t\t\t\t\t\t\t'description' => __( 'The website of the theme author, as found in the theme header.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'rendered' => array(\n\t\t\t\t\t\t\t'description' => __( 'The website of the theme author, transformed for display.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'description'    => array(\n\t\t\t\t\t'description' => __( 'A description of the theme.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'properties'  => array(\n\t\t\t\t\t\t'raw'      => array(\n\t\t\t\t\t\t\t'description' => __( 'The theme description, as found in the theme header.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'rendered' => array(\n\t\t\t\t\t\t\t'description' => __( 'The theme description, transformed for display.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'name'           => array(\n\t\t\t\t\t'description' => __( 'The name of the theme.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'properties'  => array(\n\t\t\t\t\t\t'raw'      => array(\n\t\t\t\t\t\t\t'description' => __( 'The theme name, as found in the theme header.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'rendered' => array(\n\t\t\t\t\t\t\t'description' => __( 'The theme name, transformed for display.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'requires_php'   => array(\n\t\t\t\t\t'description' => __( 'The minimum PHP version required for the theme to work.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'requires_wp'    => array(\n\t\t\t\t\t'description' => __( 'The minimum WordPress version required for the theme to work.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'screenshot'     => array(\n\t\t\t\t\t'description' => __( 'The theme\\'s screenshot URL.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'tags'           => array(\n\t\t\t\t\t'description' => __( 'Tags indicating styles and features of the theme.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'properties'  => array(\n\t\t\t\t\t\t'raw'      => array(\n\t\t\t\t\t\t\t'description' => __( 'The theme tags, as found in the theme header.' ),\n\t\t\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t\t\t'items'       => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'rendered' => array(\n\t\t\t\t\t\t\t'description' => __( 'The theme tags, transformed for display.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'textdomain'     => array(\n\t\t\t\t\t'description' => __( 'The theme\\'s text domain.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'theme_supports' => array(\n\t\t\t\t\t'description' => __( 'Features supported by this theme.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'properties'  => array(),\n\t\t\t\t),\n\t\t\t\t'theme_uri'      => array(\n\t\t\t\t\t'description' => __( 'The URI of the theme\\'s webpage.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t\t'properties'  => array(\n\t\t\t\t\t\t'raw'      => array(\n\t\t\t\t\t\t\t'description' => __( 'The URI of the theme\\'s webpage, as found in the theme header.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'rendered' => array(\n\t\t\t\t\t\t\t'description' => __( 'The URI of the theme\\'s webpage, transformed for display.' ),\n\t\t\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'version'        => array(\n\t\t\t\t\t'description' => __( 'The theme\\'s current version.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\tforeach ( get_registered_theme_features() as $feature => $config ) {\n\t\t\tif ( ! is_array( $config['show_in_rest'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$name = $config['show_in_rest']['name'];\n\n\t\t\t$schema['properties']['theme_supports']['properties'][ $name ] = $config['show_in_rest']['schema'];\n\t\t}\n\n\t\t$this->schema = $schema;\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}\n\n\t/**\n\t * Retrieves the search params for the themes collection.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @return array Collection parameters.\n\t */\n\tpublic function get_collection_params() {\n\t\t$query_params = parent::get_collection_params();\n\n\t\t$query_params['status'] = array(\n\t\t\t'description'       => __( 'Limit result set to themes assigned one or more statuses.' ),\n\t\t\t'type'              => 'array',\n\t\t\t'items'             => array(\n\t\t\t\t'enum' => array( 'active' ),\n\t\t\t\t'type' => 'string',\n\t\t\t),\n\t\t\t'required'          => true,\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_theme_status' ),\n\t\t);\n\n\t\t/**\n\t\t * Filter collection parameters for the themes controller.\n\t\t *\n\t\t * @since 5.0.0\n\t\t *\n\t\t * @param array $query_params JSON Schema-formatted collection parameters.\n\t\t */\n\t\treturn apply_filters( 'rest_themes_collection_params', $query_params );\n\t}\n\n\t/**\n\t * Sanitizes and validates the list of theme status.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param string|array    $statuses  One or more theme statuses.\n\t * @param WP_REST_Request $request   Full details about the request.\n\t * @param string          $parameter Additional parameter to pass to validation.\n\t * @return array|WP_Error A list of valid statuses, otherwise WP_Error object.\n\t */\n\tpublic function sanitize_theme_status( $statuses, $request, $parameter ) {\n\t\t$statuses = wp_parse_slug_list( $statuses );\n\n\t\tforeach ( $statuses as $status ) {\n\t\t\t$result = rest_validate_request_arg( $status, $request, $parameter );\n\n\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\n\t\treturn $statuses;\n\t}\n}\n", "num_lines": 475}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Users_Controller class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.7.0\n */\n\n/**\n * Core class used to manage users via the REST API.\n *\n * @since 4.7.0\n *\n * @see WP_REST_Controller\n */\nclass WP_REST_Users_Controller extends WP_REST_Controller {\n\n\t/**\n\t * Instance of a user meta fields object.\n\t *\n\t * @since 4.7.0\n\t * @var WP_REST_User_Meta_Fields\n\t */\n\tprotected $meta;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.7.0\n\t */\n\tpublic function __construct() {\n\t\t$this->namespace = 'wp/v2';\n\t\t$this->rest_base = 'users';\n\n\t\t$this->meta = new WP_REST_User_Meta_Fields();\n\t}\n\n\t/**\n\t * Registers the routes for the objects of the controller.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see register_rest_route()\n\t */\n\tpublic function register_routes() {\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_items' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_collection_params(),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::CREATABLE,\n\t\t\t\t\t'callback'            => array( $this, 'create_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'create_item_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base . '/(?P<id>[\\d]+)',\n\t\t\tarray(\n\t\t\t\t'args'   => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'description' => __( 'Unique identifier for the user.' ),\n\t\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback'            => array( $this, 'get_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::EDITABLE,\n\t\t\t\t\t'callback'            => array( $this, 'update_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'update_item_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::DELETABLE,\n\t\t\t\t\t'callback'            => array( $this, 'delete_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'delete_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'force'    => array(\n\t\t\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t\t\t'default'     => false,\n\t\t\t\t\t\t\t'description' => __( 'Required to be true, as users do not support trashing.' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'reassign' => array(\n\t\t\t\t\t\t\t'type'              => 'integer',\n\t\t\t\t\t\t\t'description'       => __( 'Reassign the deleted user\\'s posts and links to this user ID.' ),\n\t\t\t\t\t\t\t'required'          => true,\n\t\t\t\t\t\t\t'sanitize_callback' => array( $this, 'check_reassign' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base . '/me',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::READABLE,\n\t\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t\t'callback'            => array( $this, 'get_current_item' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::EDITABLE,\n\t\t\t\t\t'callback'            => array( $this, 'update_current_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'update_current_item_permissions_check' ),\n\t\t\t\t\t'args'                => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods'             => WP_REST_Server::DELETABLE,\n\t\t\t\t\t'callback'            => array( $this, 'delete_current_item' ),\n\t\t\t\t\t'permission_callback' => array( $this, 'delete_current_item_permissions_check' ),\n\t\t\t\t\t'args'                => array(\n\t\t\t\t\t\t'force'    => array(\n\t\t\t\t\t\t\t'type'        => 'boolean',\n\t\t\t\t\t\t\t'default'     => false,\n\t\t\t\t\t\t\t'description' => __( 'Required to be true, as users do not support trashing.' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'reassign' => array(\n\t\t\t\t\t\t\t'type'              => 'integer',\n\t\t\t\t\t\t\t'description'       => __( 'Reassign the deleted user\\'s posts and links to this user ID.' ),\n\t\t\t\t\t\t\t'required'          => true,\n\t\t\t\t\t\t\t'sanitize_callback' => array( $this, 'check_reassign' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Checks for a valid value for the reassign parameter when deleting users.\n\t *\n\t * The value can be an integer, 'false', false, or ''.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param int|bool        $value   The value passed to the reassign parameter.\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @param string          $param   The parameter that is being sanitized.\n\t * @return int|bool|WP_Error\n\t */\n\tpublic function check_reassign( $value, $request, $param ) {\n\t\tif ( is_numeric( $value ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\tif ( empty( $value ) || false === $value || 'false' === $value ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn new WP_Error(\n\t\t\t'rest_invalid_param',\n\t\t\t__( 'Invalid user parameter(s).' ),\n\t\t\tarray( 'status' => 400 )\n\t\t);\n\t}\n\n\t/**\n\t * Permissions check for getting all users.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access, otherwise WP_Error object.\n\t */\n\tpublic function get_items_permissions_check( $request ) {\n\t\t// Check if roles is specified in GET request and if user can list users.\n\t\tif ( ! empty( $request['roles'] ) && ! current_user_can( 'list_users' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_user_cannot_view',\n\t\t\t\t__( 'Sorry, you are not allowed to filter users by role.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( 'edit' === $request['context'] && ! current_user_can( 'list_users' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_forbidden_context',\n\t\t\t\t__( 'Sorry, you are not allowed to list users.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( in_array( $request['orderby'], array( 'email', 'registered_date' ), true ) && ! current_user_can( 'list_users' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_forbidden_orderby',\n\t\t\t\t__( 'Sorry, you are not allowed to order users by this parameter.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\tif ( 'authors' === $request['who'] ) {\n\t\t\t$types = get_post_types( array( 'show_in_rest' => true ), 'objects' );\n\n\t\t\tforeach ( $types as $type ) {\n\t\t\t\tif ( post_type_supports( $type->name, 'author' )\n\t\t\t\t\t&& current_user_can( $type->cap->edit_posts ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_forbidden_who',\n\t\t\t\t__( 'Sorry, you are not allowed to query users by this parameter.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves all users.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_items( $request ) {\n\n\t\t// Retrieve the list of registered collection query parameters.\n\t\t$registered = $this->get_collection_params();\n\n\t\t/*\n\t\t * This array defines mappings between public API query parameters whose\n\t\t * values are accepted as-passed, and their internal WP_Query parameter\n\t\t * name equivalents (some are the same). Only values which are also\n\t\t * present in $registered will be set.\n\t\t */\n\t\t$parameter_mappings = array(\n\t\t\t'exclude'  => 'exclude',\n\t\t\t'include'  => 'include',\n\t\t\t'order'    => 'order',\n\t\t\t'per_page' => 'number',\n\t\t\t'search'   => 'search',\n\t\t\t'roles'    => 'role__in',\n\t\t\t'slug'     => 'nicename__in',\n\t\t);\n\n\t\t$prepared_args = array();\n\n\t\t/*\n\t\t * For each known parameter which is both registered and present in the request,\n\t\t * set the parameter's value on the query $prepared_args.\n\t\t */\n\t\tforeach ( $parameter_mappings as $api_param => $wp_param ) {\n\t\t\tif ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) {\n\t\t\t\t$prepared_args[ $wp_param ] = $request[ $api_param ];\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $registered['offset'] ) && ! empty( $request['offset'] ) ) {\n\t\t\t$prepared_args['offset'] = $request['offset'];\n\t\t} else {\n\t\t\t$prepared_args['offset'] = ( $request['page'] - 1 ) * $prepared_args['number'];\n\t\t}\n\n\t\tif ( isset( $registered['orderby'] ) ) {\n\t\t\t$orderby_possibles        = array(\n\t\t\t\t'id'              => 'ID',\n\t\t\t\t'include'         => 'include',\n\t\t\t\t'name'            => 'display_name',\n\t\t\t\t'registered_date' => 'registered',\n\t\t\t\t'slug'            => 'user_nicename',\n\t\t\t\t'include_slugs'   => 'nicename__in',\n\t\t\t\t'email'           => 'user_email',\n\t\t\t\t'url'             => 'user_url',\n\t\t\t);\n\t\t\t$prepared_args['orderby'] = $orderby_possibles[ $request['orderby'] ];\n\t\t}\n\n\t\tif ( isset( $registered['who'] ) && ! empty( $request['who'] ) && 'authors' === $request['who'] ) {\n\t\t\t$prepared_args['who'] = 'authors';\n\t\t} elseif ( ! current_user_can( 'list_users' ) ) {\n\t\t\t$prepared_args['has_published_posts'] = get_post_types( array( 'show_in_rest' => true ), 'names' );\n\t\t}\n\n\t\tif ( ! empty( $prepared_args['search'] ) ) {\n\t\t\t$prepared_args['search'] = '*' . $prepared_args['search'] . '*';\n\t\t}\n\t\t/**\n\t\t * Filters WP_User_Query arguments when querying users via the REST API.\n\t\t *\n\t\t * @link https://developer.wordpress.org/reference/classes/wp_user_query/\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param array           $prepared_args Array of arguments for WP_User_Query.\n\t\t * @param WP_REST_Request $request       The current request.\n\t\t */\n\t\t$prepared_args = apply_filters( 'rest_user_query', $prepared_args, $request );\n\n\t\t$query = new WP_User_Query( $prepared_args );\n\n\t\t$users = array();\n\n\t\tforeach ( $query->results as $user ) {\n\t\t\t$data    = $this->prepare_item_for_response( $user, $request );\n\t\t\t$users[] = $this->prepare_response_for_collection( $data );\n\t\t}\n\n\t\t$response = rest_ensure_response( $users );\n\n\t\t// Store pagination values for headers then unset for count query.\n\t\t$per_page = (int) $prepared_args['number'];\n\t\t$page     = ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 );\n\n\t\t$prepared_args['fields'] = 'ID';\n\n\t\t$total_users = $query->get_total();\n\n\t\tif ( $total_users < 1 ) {\n\t\t\t// Out-of-bounds, run the query again without LIMIT for total count.\n\t\t\tunset( $prepared_args['number'], $prepared_args['offset'] );\n\t\t\t$count_query = new WP_User_Query( $prepared_args );\n\t\t\t$total_users = $count_query->get_total();\n\t\t}\n\n\t\t$response->header( 'X-WP-Total', (int) $total_users );\n\n\t\t$max_pages = ceil( $total_users / $per_page );\n\n\t\t$response->header( 'X-WP-TotalPages', (int) $max_pages );\n\n\t\t$base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );\n\t\tif ( $page > 1 ) {\n\t\t\t$prev_page = $page - 1;\n\n\t\t\tif ( $prev_page > $max_pages ) {\n\t\t\t\t$prev_page = $max_pages;\n\t\t\t}\n\n\t\t\t$prev_link = add_query_arg( 'page', $prev_page, $base );\n\t\t\t$response->link_header( 'prev', $prev_link );\n\t\t}\n\t\tif ( $max_pages > $page ) {\n\t\t\t$next_page = $page + 1;\n\t\t\t$next_link = add_query_arg( 'page', $next_page, $base );\n\n\t\t\t$response->link_header( 'next', $next_link );\n\t\t}\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Get the user, if the ID is valid.\n\t *\n\t * @since 4.7.2\n\t *\n\t * @param int $id Supplied ID.\n\t * @return WP_User|WP_Error True if ID is valid, WP_Error otherwise.\n\t */\n\tprotected function get_user( $id ) {\n\t\t$error = new WP_Error(\n\t\t\t'rest_user_invalid_id',\n\t\t\t__( 'Invalid user ID.' ),\n\t\t\tarray( 'status' => 404 )\n\t\t);\n\n\t\tif ( (int) $id <= 0 ) {\n\t\t\treturn $error;\n\t\t}\n\n\t\t$user = get_userdata( (int) $id );\n\t\tif ( empty( $user ) || ! $user->exists() ) {\n\t\t\treturn $error;\n\t\t}\n\n\t\tif ( is_multisite() && ! is_user_member_of_blog( $user->ID ) ) {\n\t\t\treturn $error;\n\t\t}\n\n\t\treturn $user;\n\t}\n\n\t/**\n\t * Checks if a given request has access to read a user.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has read access for the item, otherwise WP_Error object.\n\t */\n\tpublic function get_item_permissions_check( $request ) {\n\t\t$user = $this->get_user( $request['id'] );\n\t\tif ( is_wp_error( $user ) ) {\n\t\t\treturn $user;\n\t\t}\n\n\t\t$types = get_post_types( array( 'show_in_rest' => true ), 'names' );\n\n\t\tif ( get_current_user_id() === $user->ID ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( 'edit' === $request['context'] && ! current_user_can( 'list_users' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_user_cannot_view',\n\t\t\t\t__( 'Sorry, you are not allowed to list users.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t} elseif ( ! count_user_posts( $user->ID, $types ) && ! current_user_can( 'edit_user', $user->ID ) && ! current_user_can( 'list_users' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_user_cannot_view',\n\t\t\t\t__( 'Sorry, you are not allowed to list users.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Retrieves a single user.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_item( $request ) {\n\t\t$user = $this->get_user( $request['id'] );\n\t\tif ( is_wp_error( $user ) ) {\n\t\t\treturn $user;\n\t\t}\n\n\t\t$user     = $this->prepare_item_for_response( $user, $request );\n\t\t$response = rest_ensure_response( $user );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Retrieves the current user.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function get_current_item( $request ) {\n\t\t$current_user_id = get_current_user_id();\n\n\t\tif ( empty( $current_user_id ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_not_logged_in',\n\t\t\t\t__( 'You are not currently logged in.' ),\n\t\t\t\tarray( 'status' => 401 )\n\t\t\t);\n\t\t}\n\n\t\t$user     = wp_get_current_user();\n\t\t$response = $this->prepare_item_for_response( $user, $request );\n\t\t$response = rest_ensure_response( $response );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Checks if a given request has access create users.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to create items, WP_Error object otherwise.\n\t */\n\tpublic function create_item_permissions_check( $request ) {\n\n\t\tif ( ! current_user_can( 'create_users' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_create_user',\n\t\t\t\t__( 'Sorry, you are not allowed to create new users.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Creates a single user.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function create_item( $request ) {\n\t\tif ( ! empty( $request['id'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_user_exists',\n\t\t\t\t__( 'Cannot create existing user.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t$schema = $this->get_item_schema();\n\n\t\tif ( ! empty( $request['roles'] ) && ! empty( $schema['properties']['roles'] ) ) {\n\t\t\t$check_permission = $this->check_role_update( $request['id'], $request['roles'] );\n\n\t\t\tif ( is_wp_error( $check_permission ) ) {\n\t\t\t\treturn $check_permission;\n\t\t\t}\n\t\t}\n\n\t\t$user = $this->prepare_item_for_database( $request );\n\n\t\tif ( is_multisite() ) {\n\t\t\t$ret = wpmu_validate_user_signup( $user->user_login, $user->user_email );\n\n\t\t\tif ( is_wp_error( $ret['errors'] ) && $ret['errors']->has_errors() ) {\n\t\t\t\t$error = new WP_Error(\n\t\t\t\t\t'rest_invalid_param',\n\t\t\t\t\t__( 'Invalid user parameter(s).' ),\n\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t);\n\n\t\t\t\tforeach ( $ret['errors']->errors as $code => $messages ) {\n\t\t\t\t\tforeach ( $messages as $message ) {\n\t\t\t\t\t\t$error->add( $code, $message );\n\t\t\t\t\t}\n\n\t\t\t\t\t$error_data = $error->get_error_data( $code );\n\n\t\t\t\t\tif ( $error_data ) {\n\t\t\t\t\t\t$error->add_data( $error_data, $code );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $error;\n\t\t\t}\n\t\t}\n\n\t\tif ( is_multisite() ) {\n\t\t\t$user_id = wpmu_create_user( $user->user_login, $user->user_pass, $user->user_email );\n\n\t\t\tif ( ! $user_id ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_user_create',\n\t\t\t\t\t__( 'Error creating new user.' ),\n\t\t\t\t\tarray( 'status' => 500 )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$user->ID = $user_id;\n\t\t\t$user_id  = wp_update_user( wp_slash( (array) $user ) );\n\n\t\t\tif ( is_wp_error( $user_id ) ) {\n\t\t\t\treturn $user_id;\n\t\t\t}\n\n\t\t\t$result = add_user_to_blog( get_site()->id, $user_id, '' );\n\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t} else {\n\t\t\t$user_id = wp_insert_user( wp_slash( (array) $user ) );\n\n\t\t\tif ( is_wp_error( $user_id ) ) {\n\t\t\t\treturn $user_id;\n\t\t\t}\n\t\t}\n\n\t\t$user = get_user_by( 'id', $user_id );\n\n\t\t/**\n\t\t * Fires immediately after a user is created or updated via the REST API.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_User         $user     Inserted or updated user object.\n\t\t * @param WP_REST_Request $request  Request object.\n\t\t * @param bool            $creating True when creating a user, false when updating.\n\t\t */\n\t\tdo_action( 'rest_insert_user', $user, $request, true );\n\n\t\tif ( ! empty( $request['roles'] ) && ! empty( $schema['properties']['roles'] ) ) {\n\t\t\tarray_map( array( $user, 'add_role' ), $request['roles'] );\n\t\t}\n\n\t\tif ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) {\n\t\t\t$meta_update = $this->meta->update_value( $request['meta'], $user_id );\n\n\t\t\tif ( is_wp_error( $meta_update ) ) {\n\t\t\t\treturn $meta_update;\n\t\t\t}\n\t\t}\n\n\t\t$user          = get_user_by( 'id', $user_id );\n\t\t$fields_update = $this->update_additional_fields_for_object( $user, $request );\n\n\t\tif ( is_wp_error( $fields_update ) ) {\n\t\t\treturn $fields_update;\n\t\t}\n\n\t\t$request->set_param( 'context', 'edit' );\n\n\t\t/**\n\t\t * Fires after a user is completely created or updated via the REST API.\n\t\t *\n\t\t * @since 5.0.0\n\t\t *\n\t\t * @param WP_User         $user     Inserted or updated user object.\n\t\t * @param WP_REST_Request $request  Request object.\n\t\t * @param bool            $creating True when creating a user, false when updating.\n\t\t */\n\t\tdo_action( 'rest_after_insert_user', $user, $request, true );\n\n\t\t$response = $this->prepare_item_for_response( $user, $request );\n\t\t$response = rest_ensure_response( $response );\n\n\t\t$response->set_status( 201 );\n\t\t$response->header( 'Location', rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $user_id ) ) );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Checks if a given request has access to update a user.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise.\n\t */\n\tpublic function update_item_permissions_check( $request ) {\n\t\t$user = $this->get_user( $request['id'] );\n\t\tif ( is_wp_error( $user ) ) {\n\t\t\treturn $user;\n\t\t}\n\n\t\tif ( ! empty( $request['roles'] ) ) {\n\t\t\tif ( ! current_user_can( 'promote_user', $user->ID ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_cannot_edit_roles',\n\t\t\t\t\t__( 'Sorry, you are not allowed to edit roles of this user.' ),\n\t\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$request_params = array_keys( $request->get_params() );\n\t\t\tsort( $request_params );\n\t\t\t// If only 'id' and 'roles' are specified (we are only trying to\n\t\t\t// edit roles), then only the 'promote_user' cap is required.\n\t\t\tif ( array( 'id', 'roles' ) === $request_params ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_user', $user->ID ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_edit',\n\t\t\t\t__( 'Sorry, you are not allowed to edit this user.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Updates a single user.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function update_item( $request ) {\n\t\t$user = $this->get_user( $request['id'] );\n\t\tif ( is_wp_error( $user ) ) {\n\t\t\treturn $user;\n\t\t}\n\n\t\t$id = $user->ID;\n\n\t\tif ( ! $user ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_user_invalid_id',\n\t\t\t\t__( 'Invalid user ID.' ),\n\t\t\t\tarray( 'status' => 404 )\n\t\t\t);\n\t\t}\n\n\t\t$owner_id = email_exists( $request['email'] );\n\n\t\tif ( $owner_id && $owner_id !== $id ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_user_invalid_email',\n\t\t\t\t__( 'Invalid email address.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $request['username'] ) && $request['username'] !== $user->user_login ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_user_invalid_argument',\n\t\t\t\t__( \"Username isn't editable.\" ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $request['slug'] ) && $request['slug'] !== $user->user_nicename && get_user_by( 'slug', $request['slug'] ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_user_invalid_slug',\n\t\t\t\t__( 'Invalid slug.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $request['roles'] ) ) {\n\t\t\t$check_permission = $this->check_role_update( $id, $request['roles'] );\n\n\t\t\tif ( is_wp_error( $check_permission ) ) {\n\t\t\t\treturn $check_permission;\n\t\t\t}\n\t\t}\n\n\t\t$user = $this->prepare_item_for_database( $request );\n\n\t\t// Ensure we're operating on the same user we already checked.\n\t\t$user->ID = $id;\n\n\t\t$user_id = wp_update_user( wp_slash( (array) $user ) );\n\n\t\tif ( is_wp_error( $user_id ) ) {\n\t\t\treturn $user_id;\n\t\t}\n\n\t\t$user = get_user_by( 'id', $user_id );\n\n\t\t/** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php */\n\t\tdo_action( 'rest_insert_user', $user, $request, false );\n\n\t\tif ( ! empty( $request['roles'] ) ) {\n\t\t\tarray_map( array( $user, 'add_role' ), $request['roles'] );\n\t\t}\n\n\t\t$schema = $this->get_item_schema();\n\n\t\tif ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) {\n\t\t\t$meta_update = $this->meta->update_value( $request['meta'], $id );\n\n\t\t\tif ( is_wp_error( $meta_update ) ) {\n\t\t\t\treturn $meta_update;\n\t\t\t}\n\t\t}\n\n\t\t$user          = get_user_by( 'id', $user_id );\n\t\t$fields_update = $this->update_additional_fields_for_object( $user, $request );\n\n\t\tif ( is_wp_error( $fields_update ) ) {\n\t\t\treturn $fields_update;\n\t\t}\n\n\t\t$request->set_param( 'context', 'edit' );\n\n\t\t/** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php */\n\t\tdo_action( 'rest_after_insert_user', $user, $request, false );\n\n\t\t$response = $this->prepare_item_for_response( $user, $request );\n\t\t$response = rest_ensure_response( $response );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Checks if a given request has access to update the current user.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise.\n\t */\n\tpublic function update_current_item_permissions_check( $request ) {\n\t\t$request['id'] = get_current_user_id();\n\n\t\treturn $this->update_item_permissions_check( $request );\n\t}\n\n\t/**\n\t * Updates the current user.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function update_current_item( $request ) {\n\t\t$request['id'] = get_current_user_id();\n\n\t\treturn $this->update_item( $request );\n\t}\n\n\t/**\n\t * Checks if a given request has access delete a user.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise.\n\t */\n\tpublic function delete_item_permissions_check( $request ) {\n\t\t$user = $this->get_user( $request['id'] );\n\t\tif ( is_wp_error( $user ) ) {\n\t\t\treturn $user;\n\t\t}\n\n\t\tif ( ! current_user_can( 'delete_user', $user->ID ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_user_cannot_delete',\n\t\t\t\t__( 'Sorry, you are not allowed to delete this user.' ),\n\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Deletes a single user.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function delete_item( $request ) {\n\t\t// We don't support delete requests in multisite.\n\t\tif ( is_multisite() ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_delete',\n\t\t\t\t__( 'The user cannot be deleted.' ),\n\t\t\t\tarray( 'status' => 501 )\n\t\t\t);\n\t\t}\n\n\t\t$user = $this->get_user( $request['id'] );\n\n\t\tif ( is_wp_error( $user ) ) {\n\t\t\treturn $user;\n\t\t}\n\n\t\t$id       = $user->ID;\n\t\t$reassign = false === $request['reassign'] ? null : absint( $request['reassign'] );\n\t\t$force    = isset( $request['force'] ) ? (bool) $request['force'] : false;\n\n\t\t// We don't support trashing for users.\n\t\tif ( ! $force ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_trash_not_supported',\n\t\t\t\t/* translators: %s: force=true */\n\t\t\t\tsprintf( __( \"Users do not support trashing. Set '%s' to delete.\" ), 'force=true' ),\n\t\t\t\tarray( 'status' => 501 )\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $reassign ) ) {\n\t\t\tif ( $reassign === $id || ! get_userdata( $reassign ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_user_invalid_reassign',\n\t\t\t\t\t__( 'Invalid user ID for reassignment.' ),\n\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$request->set_param( 'context', 'edit' );\n\n\t\t$previous = $this->prepare_item_for_response( $user, $request );\n\n\t\t// Include user admin functions to get access to wp_delete_user().\n\t\trequire_once ABSPATH . 'wp-admin/includes/user.php';\n\n\t\t$result = wp_delete_user( $id, $reassign );\n\n\t\tif ( ! $result ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_delete',\n\t\t\t\t__( 'The user cannot be deleted.' ),\n\t\t\t\tarray( 'status' => 500 )\n\t\t\t);\n\t\t}\n\n\t\t$response = new WP_REST_Response();\n\t\t$response->set_data(\n\t\t\tarray(\n\t\t\t\t'deleted'  => true,\n\t\t\t\t'previous' => $previous->get_data(),\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Fires immediately after a user is deleted via the REST API.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_User          $user     The user data.\n\t\t * @param WP_REST_Response $response The response returned from the API.\n\t\t * @param WP_REST_Request  $request  The request sent to the API.\n\t\t */\n\t\tdo_action( 'rest_delete_user', $user, $response, $request );\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Checks if a given request has access to delete the current user.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise.\n\t */\n\tpublic function delete_current_item_permissions_check( $request ) {\n\t\t$request['id'] = get_current_user_id();\n\n\t\treturn $this->delete_item_permissions_check( $request );\n\t}\n\n\t/**\n\t * Deletes the current user.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.\n\t */\n\tpublic function delete_current_item( $request ) {\n\t\t$request['id'] = get_current_user_id();\n\n\t\treturn $this->delete_item( $request );\n\t}\n\n\t/**\n\t * Prepares a single user output for response.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_User         $user    User object.\n\t * @param WP_REST_Request $request Request object.\n\t * @return WP_REST_Response Response object.\n\t */\n\tpublic function prepare_item_for_response( $user, $request ) {\n\n\t\t$data   = array();\n\t\t$fields = $this->get_fields_for_response( $request );\n\n\t\tif ( in_array( 'id', $fields, true ) ) {\n\t\t\t$data['id'] = $user->ID;\n\t\t}\n\n\t\tif ( in_array( 'username', $fields, true ) ) {\n\t\t\t$data['username'] = $user->user_login;\n\t\t}\n\n\t\tif ( in_array( 'name', $fields, true ) ) {\n\t\t\t$data['name'] = $user->display_name;\n\t\t}\n\n\t\tif ( in_array( 'first_name', $fields, true ) ) {\n\t\t\t$data['first_name'] = $user->first_name;\n\t\t}\n\n\t\tif ( in_array( 'last_name', $fields, true ) ) {\n\t\t\t$data['last_name'] = $user->last_name;\n\t\t}\n\n\t\tif ( in_array( 'email', $fields, true ) ) {\n\t\t\t$data['email'] = $user->user_email;\n\t\t}\n\n\t\tif ( in_array( 'url', $fields, true ) ) {\n\t\t\t$data['url'] = $user->user_url;\n\t\t}\n\n\t\tif ( in_array( 'description', $fields, true ) ) {\n\t\t\t$data['description'] = $user->description;\n\t\t}\n\n\t\tif ( in_array( 'link', $fields, true ) ) {\n\t\t\t$data['link'] = get_author_posts_url( $user->ID, $user->user_nicename );\n\t\t}\n\n\t\tif ( in_array( 'locale', $fields, true ) ) {\n\t\t\t$data['locale'] = get_user_locale( $user );\n\t\t}\n\n\t\tif ( in_array( 'nickname', $fields, true ) ) {\n\t\t\t$data['nickname'] = $user->nickname;\n\t\t}\n\n\t\tif ( in_array( 'slug', $fields, true ) ) {\n\t\t\t$data['slug'] = $user->user_nicename;\n\t\t}\n\n\t\tif ( in_array( 'roles', $fields, true ) ) {\n\t\t\t// Defensively call array_values() to ensure an array is returned.\n\t\t\t$data['roles'] = array_values( $user->roles );\n\t\t}\n\n\t\tif ( in_array( 'registered_date', $fields, true ) ) {\n\t\t\t$data['registered_date'] = gmdate( 'c', strtotime( $user->user_registered ) );\n\t\t}\n\n\t\tif ( in_array( 'capabilities', $fields, true ) ) {\n\t\t\t$data['capabilities'] = (object) $user->allcaps;\n\t\t}\n\n\t\tif ( in_array( 'extra_capabilities', $fields, true ) ) {\n\t\t\t$data['extra_capabilities'] = (object) $user->caps;\n\t\t}\n\n\t\tif ( in_array( 'avatar_urls', $fields, true ) ) {\n\t\t\t$data['avatar_urls'] = rest_get_avatar_urls( $user );\n\t\t}\n\n\t\tif ( in_array( 'meta', $fields, true ) ) {\n\t\t\t$data['meta'] = $this->meta->get_value( $user->ID, $request );\n\t\t}\n\n\t\t$context = ! empty( $request['context'] ) ? $request['context'] : 'embed';\n\n\t\t$data = $this->add_additional_fields_to_object( $data, $request );\n\t\t$data = $this->filter_response_by_context( $data, $context );\n\n\t\t// Wrap the data in a response object.\n\t\t$response = rest_ensure_response( $data );\n\n\t\t$response->add_links( $this->prepare_links( $user ) );\n\n\t\t/**\n\t\t * Filters user data returned from the REST API.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param WP_REST_Response $response The response object.\n\t\t * @param WP_User          $user     User object used to create response.\n\t\t * @param WP_REST_Request  $request  Request object.\n\t\t */\n\t\treturn apply_filters( 'rest_prepare_user', $response, $user, $request );\n\t}\n\n\t/**\n\t * Prepares links for the user request.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_Post $user User object.\n\t * @return array Links for the given user.\n\t */\n\tprotected function prepare_links( $user ) {\n\t\t$links = array(\n\t\t\t'self'       => array(\n\t\t\t\t'href' => rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $user->ID ) ),\n\t\t\t),\n\t\t\t'collection' => array(\n\t\t\t\t'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),\n\t\t\t),\n\t\t);\n\n\t\treturn $links;\n\t}\n\n\t/**\n\t * Prepares a single user for creation or update.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param WP_REST_Request $request Request object.\n\t * @return object User object.\n\t */\n\tprotected function prepare_item_for_database( $request ) {\n\t\t$prepared_user = new stdClass;\n\n\t\t$schema = $this->get_item_schema();\n\n\t\t// Required arguments.\n\t\tif ( isset( $request['email'] ) && ! empty( $schema['properties']['email'] ) ) {\n\t\t\t$prepared_user->user_email = $request['email'];\n\t\t}\n\n\t\tif ( isset( $request['username'] ) && ! empty( $schema['properties']['username'] ) ) {\n\t\t\t$prepared_user->user_login = $request['username'];\n\t\t}\n\n\t\tif ( isset( $request['password'] ) && ! empty( $schema['properties']['password'] ) ) {\n\t\t\t$prepared_user->user_pass = $request['password'];\n\t\t}\n\n\t\t// Optional arguments.\n\t\tif ( isset( $request['id'] ) ) {\n\t\t\t$prepared_user->ID = absint( $request['id'] );\n\t\t}\n\n\t\tif ( isset( $request['name'] ) && ! empty( $schema['properties']['name'] ) ) {\n\t\t\t$prepared_user->display_name = $request['name'];\n\t\t}\n\n\t\tif ( isset( $request['first_name'] ) && ! empty( $schema['properties']['first_name'] ) ) {\n\t\t\t$prepared_user->first_name = $request['first_name'];\n\t\t}\n\n\t\tif ( isset( $request['last_name'] ) && ! empty( $schema['properties']['last_name'] ) ) {\n\t\t\t$prepared_user->last_name = $request['last_name'];\n\t\t}\n\n\t\tif ( isset( $request['nickname'] ) && ! empty( $schema['properties']['nickname'] ) ) {\n\t\t\t$prepared_user->nickname = $request['nickname'];\n\t\t}\n\n\t\tif ( isset( $request['slug'] ) && ! empty( $schema['properties']['slug'] ) ) {\n\t\t\t$prepared_user->user_nicename = $request['slug'];\n\t\t}\n\n\t\tif ( isset( $request['description'] ) && ! empty( $schema['properties']['description'] ) ) {\n\t\t\t$prepared_user->description = $request['description'];\n\t\t}\n\n\t\tif ( isset( $request['url'] ) && ! empty( $schema['properties']['url'] ) ) {\n\t\t\t$prepared_user->user_url = $request['url'];\n\t\t}\n\n\t\tif ( isset( $request['locale'] ) && ! empty( $schema['properties']['locale'] ) ) {\n\t\t\t$prepared_user->locale = $request['locale'];\n\t\t}\n\n\t\t// Setting roles will be handled outside of this function.\n\t\tif ( isset( $request['roles'] ) ) {\n\t\t\t$prepared_user->role = false;\n\t\t}\n\n\t\t/**\n\t\t * Filters user data before insertion via the REST API.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param object          $prepared_user User object.\n\t\t * @param WP_REST_Request $request       Request object.\n\t\t */\n\t\treturn apply_filters( 'rest_pre_insert_user', $prepared_user, $request );\n\t}\n\n\t/**\n\t * Determines if the current user is allowed to make the desired roles change.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param integer $user_id User ID.\n\t * @param array   $roles   New user roles.\n\t * @return true|WP_Error True if the current user is allowed to make the role change,\n\t *                       otherwise a WP_Error object.\n\t */\n\tprotected function check_role_update( $user_id, $roles ) {\n\t\tglobal $wp_roles;\n\n\t\tforeach ( $roles as $role ) {\n\n\t\t\tif ( ! isset( $wp_roles->role_objects[ $role ] ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_user_invalid_role',\n\t\t\t\t\t/* translators: %s: Role key. */\n\t\t\t\t\tsprintf( __( 'The role %s does not exist.' ), $role ),\n\t\t\t\t\tarray( 'status' => 400 )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$potential_role = $wp_roles->role_objects[ $role ];\n\n\t\t\t/*\n\t\t\t * Don't let anyone with 'edit_users' (admins) edit their own role to something without it.\n\t\t\t * Multisite super admins can freely edit their blog roles -- they possess all caps.\n\t\t\t */\n\t\t\tif ( ! ( is_multisite()\n\t\t\t\t&& current_user_can( 'manage_sites' ) )\n\t\t\t\t&& get_current_user_id() === $user_id\n\t\t\t\t&& ! $potential_role->has_cap( 'edit_users' )\n\t\t\t) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_user_invalid_role',\n\t\t\t\t\t__( 'Sorry, you are not allowed to give users that role.' ),\n\t\t\t\t\tarray( 'status' => rest_authorization_required_code() )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Include user admin functions to get access to get_editable_roles().\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/user.php';\n\n\t\t\t// The new role must be editable by the logged-in user.\n\t\t\t$editable_roles = get_editable_roles();\n\n\t\t\tif ( empty( $editable_roles[ $role ] ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_user_invalid_role',\n\t\t\t\t\t__( 'Sorry, you are not allowed to give users that role.' ),\n\t\t\t\t\tarray( 'status' => 403 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Check a username for the REST API.\n\t *\n\t * Performs a couple of checks like edit_user() in wp-admin/includes/user.php.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string          $value   The username submitted in the request.\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @param string          $param   The parameter name.\n\t * @return string|WP_Error The sanitized username, if valid, otherwise an error.\n\t */\n\tpublic function check_username( $value, $request, $param ) {\n\t\t$username = (string) $value;\n\n\t\tif ( ! validate_username( $username ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_user_invalid_username',\n\t\t\t\t__( 'This username is invalid because it uses illegal characters. Please enter a valid username.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/user.php */\n\t\t$illegal_logins = (array) apply_filters( 'illegal_user_logins', array() );\n\n\t\tif ( in_array( strtolower( $username ), array_map( 'strtolower', $illegal_logins ), true ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_user_invalid_username',\n\t\t\t\t__( 'Sorry, that username is not allowed.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\treturn $username;\n\t}\n\n\t/**\n\t * Check a user password for the REST API.\n\t *\n\t * Performs a couple of checks like edit_user() in wp-admin/includes/user.php.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string          $value   The password submitted in the request.\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @param string          $param   The parameter name.\n\t * @return string|WP_Error The sanitized password, if valid, otherwise an error.\n\t */\n\tpublic function check_user_password( $value, $request, $param ) {\n\t\t$password = (string) $value;\n\n\t\tif ( empty( $password ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_user_invalid_password',\n\t\t\t\t__( 'Passwords cannot be empty.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\tif ( false !== strpos( $password, '\\\\' ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_user_invalid_password',\n\t\t\t\t__( 'Passwords cannot contain the \"\\\\\" character.' ),\n\t\t\t\tarray( 'status' => 400 )\n\t\t\t);\n\t\t}\n\n\t\treturn $password;\n\t}\n\n\t/**\n\t * Retrieves the user's schema, conforming to JSON Schema.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Item schema data.\n\t */\n\tpublic function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$schema = array(\n\t\t\t'$schema'    => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title'      => 'user',\n\t\t\t'type'       => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'id'                 => array(\n\t\t\t\t\t'description' => __( 'Unique identifier for the user.' ),\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'username'           => array(\n\t\t\t\t\t'description' => __( 'Login name for the user.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'required'    => true,\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => array( $this, 'check_username' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'name'               => array(\n\t\t\t\t\t'description' => __( 'Display name for the user.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'first_name'         => array(\n\t\t\t\t\t'description' => __( 'First name for the user.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'last_name'          => array(\n\t\t\t\t\t'description' => __( 'Last name for the user.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'email'              => array(\n\t\t\t\t\t'description' => __( 'The email address for the user.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'email',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'required'    => true,\n\t\t\t\t),\n\t\t\t\t'url'                => array(\n\t\t\t\t\t'description' => __( 'URL of the user.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'description'        => array(\n\t\t\t\t\t'description' => __( 'Description of the user.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'link'               => array(\n\t\t\t\t\t'description' => __( 'Author URL of the user.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'locale'             => array(\n\t\t\t\t\t'description' => __( 'Locale for the user.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'enum'        => array_merge( array( '', 'en_US' ), get_available_languages() ),\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t),\n\t\t\t\t'nickname'           => array(\n\t\t\t\t\t'description' => __( 'The nickname for the user.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'slug'               => array(\n\t\t\t\t\t'description' => __( 'An alphanumeric identifier for the user.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => array( $this, 'sanitize_slug' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'registered_date'    => array(\n\t\t\t\t\t'description' => __( 'Registration date for the user.' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'date-time',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'roles'              => array(\n\t\t\t\t\t'description' => __( 'Roles assigned to the user.' ),\n\t\t\t\t\t'type'        => 'array',\n\t\t\t\t\t'items'       => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t),\n\t\t\t\t'password'           => array(\n\t\t\t\t\t'description' => __( 'Password for the user (never included).' ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'context'     => array(), // Password is never displayed.\n\t\t\t\t\t'required'    => true,\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => array( $this, 'check_user_password' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'capabilities'       => array(\n\t\t\t\t\t'description' => __( 'All capabilities assigned to the user.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t\t'extra_capabilities' => array(\n\t\t\t\t\t'description' => __( 'Any extra capabilities assigned to the user.' ),\n\t\t\t\t\t'type'        => 'object',\n\t\t\t\t\t'context'     => array( 'edit' ),\n\t\t\t\t\t'readonly'    => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\tif ( get_option( 'show_avatars' ) ) {\n\t\t\t$avatar_properties = array();\n\n\t\t\t$avatar_sizes = rest_get_avatar_sizes();\n\n\t\t\tforeach ( $avatar_sizes as $size ) {\n\t\t\t\t$avatar_properties[ $size ] = array(\n\t\t\t\t\t/* translators: %d: Avatar image size in pixels. */\n\t\t\t\t\t'description' => sprintf( __( 'Avatar URL with image size of %d pixels.' ), $size ),\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'format'      => 'uri',\n\t\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$schema['properties']['avatar_urls'] = array(\n\t\t\t\t'description' => __( 'Avatar URLs for the user.' ),\n\t\t\t\t'type'        => 'object',\n\t\t\t\t'context'     => array( 'embed', 'view', 'edit' ),\n\t\t\t\t'readonly'    => true,\n\t\t\t\t'properties'  => $avatar_properties,\n\t\t\t);\n\t\t}\n\n\t\t$schema['properties']['meta'] = $this->meta->get_field_schema();\n\n\t\t$this->schema = $schema;\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}\n\n\t/**\n\t * Retrieves the query params for collections.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Collection parameters.\n\t */\n\tpublic function get_collection_params() {\n\t\t$query_params = parent::get_collection_params();\n\n\t\t$query_params['context']['default'] = 'view';\n\n\t\t$query_params['exclude'] = array(\n\t\t\t'description' => __( 'Ensure result set excludes specific IDs.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'default'     => array(),\n\t\t);\n\n\t\t$query_params['include'] = array(\n\t\t\t'description' => __( 'Limit result set to specific IDs.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'default'     => array(),\n\t\t);\n\n\t\t$query_params['offset'] = array(\n\t\t\t'description' => __( 'Offset the result set by a specific number of items.' ),\n\t\t\t'type'        => 'integer',\n\t\t);\n\n\t\t$query_params['order'] = array(\n\t\t\t'default'     => 'asc',\n\t\t\t'description' => __( 'Order sort attribute ascending or descending.' ),\n\t\t\t'enum'        => array( 'asc', 'desc' ),\n\t\t\t'type'        => 'string',\n\t\t);\n\n\t\t$query_params['orderby'] = array(\n\t\t\t'default'     => 'name',\n\t\t\t'description' => __( 'Sort collection by object attribute.' ),\n\t\t\t'enum'        => array(\n\t\t\t\t'id',\n\t\t\t\t'include',\n\t\t\t\t'name',\n\t\t\t\t'registered_date',\n\t\t\t\t'slug',\n\t\t\t\t'include_slugs',\n\t\t\t\t'email',\n\t\t\t\t'url',\n\t\t\t),\n\t\t\t'type'        => 'string',\n\t\t);\n\n\t\t$query_params['slug'] = array(\n\t\t\t'description' => __( 'Limit result set to users with one or more specific slugs.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'string',\n\t\t\t),\n\t\t);\n\n\t\t$query_params['roles'] = array(\n\t\t\t'description' => __( 'Limit result set to users matching at least one specific role provided. Accepts csv list or single role.' ),\n\t\t\t'type'        => 'array',\n\t\t\t'items'       => array(\n\t\t\t\t'type' => 'string',\n\t\t\t),\n\t\t);\n\n\t\t$query_params['who'] = array(\n\t\t\t'description' => __( 'Limit result set to users who are considered authors.' ),\n\t\t\t'type'        => 'string',\n\t\t\t'enum'        => array(\n\t\t\t\t'authors',\n\t\t\t),\n\t\t);\n\n\t\t/**\n\t\t * Filter collection parameters for the users controller.\n\t\t *\n\t\t * This filter registers the collection parameter, but does not map the\n\t\t * collection parameter to an internal WP_User_Query parameter.  Use the\n\t\t * `rest_user_query` filter to set WP_User_Query arguments.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param array $query_params JSON Schema-formatted collection parameters.\n\t\t */\n\t\treturn apply_filters( 'rest_user_collection_params', $query_params );\n\t}\n}\n", "num_lines": 1571}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Comment_Meta_Fields class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.7.0\n */\n\n/**\n * Core class to manage comment meta via the REST API.\n *\n * @since 4.7.0\n *\n * @see WP_REST_Meta_Fields\n */\nclass WP_REST_Comment_Meta_Fields extends WP_REST_Meta_Fields {\n\n\t/**\n\t * Retrieves the object type for comment meta.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return string The meta type.\n\t */\n\tprotected function get_meta_type() {\n\t\treturn 'comment';\n\t}\n\n\t/**\n\t * Retrieves the object meta subtype.\n\t *\n\t * @since 4.9.8\n\t *\n\t * @return string 'comment' There are no subtypes.\n\t */\n\tprotected function get_meta_subtype() {\n\t\treturn 'comment';\n\t}\n\n\t/**\n\t * Retrieves the type for register_rest_field() in the context of comments.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return string The REST field type.\n\t */\n\tpublic function get_rest_field_type() {\n\t\treturn 'comment';\n\t}\n}\n", "num_lines": 52}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Meta_Fields class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.7.0\n */\n\n/**\n * Core class to manage meta values for an object via the REST API.\n *\n * @since 4.7.0\n */\nabstract class WP_REST_Meta_Fields {\n\n\t/**\n\t * Retrieves the object meta type.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return string One of 'post', 'comment', 'term', 'user', or anything\n\t *                else supported by `_get_meta_table()`.\n\t */\n\tabstract protected function get_meta_type();\n\n\t/**\n\t * Retrieves the object meta subtype.\n\t *\n\t * @since 4.9.8\n\t *\n\t * @return string Subtype for the meta type, or empty string if no specific subtype.\n\t */\n\tprotected function get_meta_subtype() {\n\t\treturn '';\n\t}\n\n\t/**\n\t * Retrieves the object type for register_rest_field().\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return string The REST field type, such as post type name, taxonomy name, 'comment', or `user`.\n\t */\n\tabstract protected function get_rest_field_type();\n\n\t/**\n\t * Registers the meta field.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see register_rest_field()\n\t */\n\tpublic function register_field() {\n\t\tregister_rest_field(\n\t\t\t$this->get_rest_field_type(),\n\t\t\t'meta',\n\t\t\tarray(\n\t\t\t\t'get_callback'    => array( $this, 'get_value' ),\n\t\t\t\t'update_callback' => array( $this, 'update_value' ),\n\t\t\t\t'schema'          => $this->get_field_schema(),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves the meta field value.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param int             $object_id Object ID to fetch meta for.\n\t * @param WP_REST_Request $request   Full details about the request.\n\t * @return array Array containing the meta values keyed by name.\n\t */\n\tpublic function get_value( $object_id, $request ) {\n\t\t$fields   = $this->get_registered_fields();\n\t\t$response = array();\n\n\t\tforeach ( $fields as $meta_key => $args ) {\n\t\t\t$name       = $args['name'];\n\t\t\t$all_values = get_metadata( $this->get_meta_type(), $object_id, $meta_key, false );\n\n\t\t\tif ( $args['single'] ) {\n\t\t\t\tif ( empty( $all_values ) ) {\n\t\t\t\t\t$value = $args['schema']['default'];\n\t\t\t\t} else {\n\t\t\t\t\t$value = $all_values[0];\n\t\t\t\t}\n\n\t\t\t\t$value = $this->prepare_value_for_response( $value, $request, $args );\n\t\t\t} else {\n\t\t\t\t$value = array();\n\n\t\t\t\tforeach ( $all_values as $row ) {\n\t\t\t\t\t$value[] = $this->prepare_value_for_response( $row, $request, $args );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$response[ $name ] = $value;\n\t\t}\n\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Prepares a meta value for a response.\n\t *\n\t * This is required because some native types cannot be stored correctly\n\t * in the database, such as booleans. We need to cast back to the relevant\n\t * type before passing back to JSON.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param mixed           $value   Meta value to prepare.\n\t * @param WP_REST_Request $request Current request object.\n\t * @param array           $args    Options for the field.\n\t * @return mixed Prepared value.\n\t */\n\tprotected function prepare_value_for_response( $value, $request, $args ) {\n\t\tif ( ! empty( $args['prepare_callback'] ) ) {\n\t\t\t$value = call_user_func( $args['prepare_callback'], $value, $request, $args );\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Updates meta values.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param array $meta      Array of meta parsed from the request.\n\t * @param int   $object_id Object ID to fetch meta for.\n\t * @return null|WP_Error Null on success, WP_Error object on failure.\n\t */\n\tpublic function update_value( $meta, $object_id ) {\n\t\t$fields = $this->get_registered_fields();\n\n\t\tforeach ( $fields as $meta_key => $args ) {\n\t\t\t$name = $args['name'];\n\t\t\tif ( ! array_key_exists( $name, $meta ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * A null value means reset the field, which is essentially deleting it\n\t\t\t * from the database and then relying on the default value.\n\t\t\t */\n\t\t\tif ( is_null( $meta[ $name ] ) ) {\n\t\t\t\t$args = $this->get_registered_fields()[ $meta_key ];\n\n\t\t\t\tif ( $args['single'] ) {\n\t\t\t\t\t$current = get_metadata( $this->get_meta_type(), $object_id, $meta_key, true );\n\n\t\t\t\t\tif ( is_wp_error( rest_validate_value_from_schema( $current, $args['schema'] ) ) ) {\n\t\t\t\t\t\treturn new WP_Error(\n\t\t\t\t\t\t\t'rest_invalid_stored_value',\n\t\t\t\t\t\t\t/* translators: %s: Custom field key. */\n\t\t\t\t\t\t\tsprintf( __( 'The %s property has an invalid stored value, and cannot be updated to null.' ), $name ),\n\t\t\t\t\t\t\tarray( 'status' => 500 )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$result = $this->delete_meta_value( $object_id, $meta_key, $name );\n\t\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\t\treturn $result;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$value = $meta[ $name ];\n\n\t\t\tif ( ! $args['single'] && is_array( $value ) && count( array_filter( $value, 'is_null' ) ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_invalid_stored_value',\n\t\t\t\t\t/* translators: %s: Custom field key. */\n\t\t\t\t\tsprintf( __( 'The %s property has an invalid stored value, and cannot be updated to null.' ), $name ),\n\t\t\t\t\tarray( 'status' => 500 )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$is_valid = rest_validate_value_from_schema( $value, $args['schema'], 'meta.' . $name );\n\t\t\tif ( is_wp_error( $is_valid ) ) {\n\t\t\t\t$is_valid->add_data( array( 'status' => 400 ) );\n\t\t\t\treturn $is_valid;\n\t\t\t}\n\n\t\t\t$value = rest_sanitize_value_from_schema( $value, $args['schema'] );\n\n\t\t\tif ( $args['single'] ) {\n\t\t\t\t$result = $this->update_meta_value( $object_id, $meta_key, $name, $value );\n\t\t\t} else {\n\t\t\t\t$result = $this->update_multi_meta_value( $object_id, $meta_key, $name, $value );\n\t\t\t}\n\n\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Deletes a meta value for an object.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param int    $object_id Object ID the field belongs to.\n\t * @param string $meta_key  Key for the field.\n\t * @param string $name      Name for the field that is exposed in the REST API.\n\t * @return bool|WP_Error True if meta field is deleted, WP_Error otherwise.\n\t */\n\tprotected function delete_meta_value( $object_id, $meta_key, $name ) {\n\t\t$meta_type = $this->get_meta_type();\n\n\t\tif ( ! current_user_can( \"delete_{$meta_type}_meta\", $object_id, $meta_key ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_delete',\n\t\t\t\t/* translators: %s: Custom field key. */\n\t\t\t\tsprintf( __( 'Sorry, you are not allowed to edit the %s custom field.' ), $name ),\n\t\t\t\tarray(\n\t\t\t\t\t'key'    => $name,\n\t\t\t\t\t'status' => rest_authorization_required_code(),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( ! delete_metadata( $meta_type, $object_id, wp_slash( $meta_key ) ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_meta_database_error',\n\t\t\t\t__( 'Could not delete meta value from database.' ),\n\t\t\t\tarray(\n\t\t\t\t\t'key'    => $name,\n\t\t\t\t\t'status' => WP_Http::INTERNAL_SERVER_ERROR,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Updates multiple meta values for an object.\n\t *\n\t * Alters the list of values in the database to match the list of provided values.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param int    $object_id Object ID to update.\n\t * @param string $meta_key  Key for the custom field.\n\t * @param string $name      Name for the field that is exposed in the REST API.\n\t * @param array  $values    List of values to update to.\n\t * @return bool|WP_Error True if meta fields are updated, WP_Error otherwise.\n\t */\n\tprotected function update_multi_meta_value( $object_id, $meta_key, $name, $values ) {\n\t\t$meta_type = $this->get_meta_type();\n\n\t\tif ( ! current_user_can( \"edit_{$meta_type}_meta\", $object_id, $meta_key ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_update',\n\t\t\t\t/* translators: %s: Custom field key. */\n\t\t\t\tsprintf( __( 'Sorry, you are not allowed to edit the %s custom field.' ), $name ),\n\t\t\t\tarray(\n\t\t\t\t\t'key'    => $name,\n\t\t\t\t\t'status' => rest_authorization_required_code(),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$current_values = get_metadata( $meta_type, $object_id, $meta_key, false );\n\t\t$subtype        = get_object_subtype( $meta_type, $object_id );\n\n\t\t$to_remove = $current_values;\n\t\t$to_add    = $values;\n\n\t\tforeach ( $to_add as $add_key => $value ) {\n\t\t\t$remove_keys = array_keys(\n\t\t\t\tarray_filter(\n\t\t\t\t\t$current_values,\n\t\t\t\t\tfunction ( $stored_value ) use ( $meta_key, $subtype, $value ) {\n\t\t\t\t\t\treturn $this->is_meta_value_same_as_stored_value( $meta_key, $subtype, $stored_value, $value );\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( empty( $remove_keys ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( count( $remove_keys ) > 1 ) {\n\t\t\t\t// To remove, we need to remove first, then add, so don't touch.\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$remove_key = $remove_keys[0];\n\n\t\t\tunset( $to_remove[ $remove_key ] );\n\t\t\tunset( $to_add[ $add_key ] );\n\t\t}\n\n\t\t/*\n\t\t * `delete_metadata` removes _all_ instances of the value, so only call once. Otherwise,\n\t\t * `delete_metadata` will return false for subsequent calls of the same value.\n\t\t * Use serialization to produce a predictable string that can be used by array_unique.\n\t\t */\n\t\t$to_remove = array_map( 'maybe_unserialize', array_unique( array_map( 'maybe_serialize', $to_remove ) ) );\n\n\t\tforeach ( $to_remove as $value ) {\n\t\t\tif ( ! delete_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash( $value ) ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_meta_database_error',\n\t\t\t\t\t/* translators: %s: Custom field key. */\n\t\t\t\t\tsprintf( __( 'Could not update the meta value of %s in database.' ), $meta_key ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'    => $name,\n\t\t\t\t\t\t'status' => WP_Http::INTERNAL_SERVER_ERROR,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $to_add as $value ) {\n\t\t\tif ( ! add_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash( $value ) ) ) {\n\t\t\t\treturn new WP_Error(\n\t\t\t\t\t'rest_meta_database_error',\n\t\t\t\t\t/* translators: %s: Custom field key. */\n\t\t\t\t\tsprintf( __( 'Could not update the meta value of %s in database.' ), $meta_key ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'    => $name,\n\t\t\t\t\t\t'status' => WP_Http::INTERNAL_SERVER_ERROR,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Updates a meta value for an object.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param int    $object_id Object ID to update.\n\t * @param string $meta_key  Key for the custom field.\n\t * @param string $name      Name for the field that is exposed in the REST API.\n\t * @param mixed  $value     Updated value.\n\t * @return bool|WP_Error True if the meta field was updated, WP_Error otherwise.\n\t */\n\tprotected function update_meta_value( $object_id, $meta_key, $name, $value ) {\n\t\t$meta_type = $this->get_meta_type();\n\n\t\tif ( ! current_user_can( \"edit_{$meta_type}_meta\", $object_id, $meta_key ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_cannot_update',\n\t\t\t\t/* translators: %s: Custom field key. */\n\t\t\t\tsprintf( __( 'Sorry, you are not allowed to edit the %s custom field.' ), $name ),\n\t\t\t\tarray(\n\t\t\t\t\t'key'    => $name,\n\t\t\t\t\t'status' => rest_authorization_required_code(),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// Do the exact same check for a duplicate value as in update_metadata() to avoid update_metadata() returning false.\n\t\t$old_value = get_metadata( $meta_type, $object_id, $meta_key );\n\t\t$subtype   = get_object_subtype( $meta_type, $object_id );\n\n\t\tif ( 1 === count( $old_value ) && $this->is_meta_value_same_as_stored_value( $meta_key, $subtype, $old_value[0], $value ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! update_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash_strings_only( $value ) ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'rest_meta_database_error',\n\t\t\t\t/* translators: %s: Custom field key. */\n\t\t\t\tsprintf( __( 'Could not update the meta value of %s in database.' ), $meta_key ),\n\t\t\t\tarray(\n\t\t\t\t\t'key'    => $name,\n\t\t\t\t\t'status' => WP_Http::INTERNAL_SERVER_ERROR,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks if the user provided value is equivalent to a stored value for the given meta key.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $meta_key     The meta key being checked.\n\t * @param string $subtype      The object subtype.\n\t * @param mixed  $stored_value The currently stored value retrieved from get_metadata().\n\t * @param mixed  $user_value   The value provided by the user.\n\t * @return bool\n\t */\n\tprotected function is_meta_value_same_as_stored_value( $meta_key, $subtype, $stored_value, $user_value ) {\n\t\t$args      = $this->get_registered_fields()[ $meta_key ];\n\t\t$sanitized = sanitize_meta( $meta_key, $user_value, $this->get_meta_type(), $subtype );\n\n\t\tif ( in_array( $args['type'], array( 'string', 'number', 'integer', 'boolean' ), true ) ) {\n\t\t\t// The return value of get_metadata will always be a string for scalar types.\n\t\t\t$sanitized = (string) $sanitized;\n\t\t}\n\n\t\treturn $sanitized === $stored_value;\n\t}\n\n\t/**\n\t * Retrieves all the registered meta fields.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Registered fields.\n\t */\n\tprotected function get_registered_fields() {\n\t\t$registered = array();\n\n\t\t$meta_type    = $this->get_meta_type();\n\t\t$meta_subtype = $this->get_meta_subtype();\n\n\t\t$meta_keys = get_registered_meta_keys( $meta_type );\n\t\tif ( ! empty( $meta_subtype ) ) {\n\t\t\t$meta_keys = array_merge( $meta_keys, get_registered_meta_keys( $meta_type, $meta_subtype ) );\n\t\t}\n\n\t\tforeach ( $meta_keys as $name => $args ) {\n\t\t\tif ( empty( $args['show_in_rest'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$rest_args = array();\n\n\t\t\tif ( is_array( $args['show_in_rest'] ) ) {\n\t\t\t\t$rest_args = $args['show_in_rest'];\n\t\t\t}\n\n\t\t\t$default_args = array(\n\t\t\t\t'name'             => $name,\n\t\t\t\t'single'           => $args['single'],\n\t\t\t\t'type'             => ! empty( $args['type'] ) ? $args['type'] : null,\n\t\t\t\t'schema'           => array(),\n\t\t\t\t'prepare_callback' => array( $this, 'prepare_value' ),\n\t\t\t);\n\n\t\t\t$default_schema = array(\n\t\t\t\t'type'        => $default_args['type'],\n\t\t\t\t'description' => empty( $args['description'] ) ? '' : $args['description'],\n\t\t\t\t'default'     => isset( $args['default'] ) ? $args['default'] : null,\n\t\t\t);\n\n\t\t\t$rest_args           = array_merge( $default_args, $rest_args );\n\t\t\t$rest_args['schema'] = array_merge( $default_schema, $rest_args['schema'] );\n\n\t\t\t$type = ! empty( $rest_args['type'] ) ? $rest_args['type'] : null;\n\t\t\t$type = ! empty( $rest_args['schema']['type'] ) ? $rest_args['schema']['type'] : $type;\n\n\t\t\tif ( null === $rest_args['schema']['default'] ) {\n\t\t\t\t$rest_args['schema']['default'] = static::get_empty_value_for_type( $type );\n\t\t\t}\n\n\t\t\t$rest_args['schema'] = $this->default_additional_properties_to_false( $rest_args['schema'] );\n\n\t\t\tif ( ! in_array( $type, array( 'string', 'boolean', 'integer', 'number', 'array', 'object' ), true ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( empty( $rest_args['single'] ) ) {\n\t\t\t\t$rest_args['schema'] = array(\n\t\t\t\t\t'type'  => 'array',\n\t\t\t\t\t'items' => $rest_args['schema'],\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$registered[ $name ] = $rest_args;\n\t\t}\n\n\t\treturn $registered;\n\t}\n\n\t/**\n\t * Retrieves the object's meta schema, conforming to JSON Schema.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return array Field schema data.\n\t */\n\tpublic function get_field_schema() {\n\t\t$fields = $this->get_registered_fields();\n\n\t\t$schema = array(\n\t\t\t'description' => __( 'Meta fields.' ),\n\t\t\t'type'        => 'object',\n\t\t\t'context'     => array( 'view', 'edit' ),\n\t\t\t'properties'  => array(),\n\t\t\t'arg_options' => array(\n\t\t\t\t'sanitize_callback' => null,\n\t\t\t\t'validate_callback' => array( $this, 'check_meta_is_array' ),\n\t\t\t),\n\t\t);\n\n\t\tforeach ( $fields as $args ) {\n\t\t\t$schema['properties'][ $args['name'] ] = $args['schema'];\n\t\t}\n\n\t\treturn $schema;\n\t}\n\n\t/**\n\t * Prepares a meta value for output.\n\t *\n\t * Default preparation for meta fields. Override by passing the\n\t * `prepare_callback` in your `show_in_rest` options.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param mixed           $value   Meta value from the database.\n\t * @param WP_REST_Request $request Request object.\n\t * @param array           $args    REST-specific options for the meta key.\n\t * @return mixed Value prepared for output. If a non-JsonSerializable object, null.\n\t */\n\tpublic static function prepare_value( $value, $request, $args ) {\n\t\tif ( $args['single'] ) {\n\t\t\t$schema = $args['schema'];\n\t\t} else {\n\t\t\t$schema = $args['schema']['items'];\n\t\t}\n\n\t\tif ( '' === $value && in_array( $schema['type'], array( 'boolean', 'integer', 'number' ), true ) ) {\n\t\t\t$value = static::get_empty_value_for_type( $schema['type'] );\n\t\t}\n\n\t\tif ( is_wp_error( rest_validate_value_from_schema( $value, $schema ) ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn rest_sanitize_value_from_schema( $value, $schema );\n\t}\n\n\t/**\n\t * Check the 'meta' value of a request is an associative array.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param mixed           $value   The meta value submitted in the request.\n\t * @param WP_REST_Request $request Full details about the request.\n\t * @param string          $param   The parameter name.\n\t * @return array|false The meta array, if valid, false otherwise.\n\t */\n\tpublic function check_meta_is_array( $value, $request, $param ) {\n\t\tif ( ! is_array( $value ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $value;\n\t}\n\n\t/**\n\t * Recursively add additionalProperties = false to all objects in a schema if no additionalProperties setting\n\t * is specified.\n\t *\n\t * This is needed to restrict properties of objects in meta values to only\n\t * registered items, as the REST API will allow additional properties by\n\t * default.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param array $schema The schema array.\n\t * @return array\n\t */\n\tprotected function default_additional_properties_to_false( $schema ) {\n\t\tswitch ( $schema['type'] ) {\n\t\t\tcase 'object':\n\t\t\t\tforeach ( $schema['properties'] as $key => $child_schema ) {\n\t\t\t\t\t$schema['properties'][ $key ] = $this->default_additional_properties_to_false( $child_schema );\n\t\t\t\t}\n\n\t\t\t\tif ( ! isset( $schema['additionalProperties'] ) ) {\n\t\t\t\t\t$schema['additionalProperties'] = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'array':\n\t\t\t\t$schema['items'] = $this->default_additional_properties_to_false( $schema['items'] );\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $schema;\n\t}\n\n\t/**\n\t * Gets the empty value for a schema type.\n\t *\n\t * @since 5.3.0\n\t *\n\t * @param string $type The schema type.\n\t * @return mixed\n\t */\n\tprotected static function get_empty_value_for_type( $type ) {\n\t\tswitch ( $type ) {\n\t\t\tcase 'string':\n\t\t\t\treturn '';\n\t\t\tcase 'boolean':\n\t\t\t\treturn false;\n\t\t\tcase 'integer':\n\t\t\t\treturn 0;\n\t\t\tcase 'number':\n\t\t\t\treturn 0.0;\n\t\t\tcase 'array':\n\t\t\tcase 'object':\n\t\t\t\treturn array();\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\t}\n}\n", "num_lines": 620}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Post_Meta_Fields class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.7.0\n */\n\n/**\n * Core class used to manage meta values for posts via the REST API.\n *\n * @since 4.7.0\n *\n * @see WP_REST_Meta_Fields\n */\nclass WP_REST_Post_Meta_Fields extends WP_REST_Meta_Fields {\n\n\t/**\n\t * Post type to register fields for.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tprotected $post_type;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $post_type Post type to register fields for.\n\t */\n\tpublic function __construct( $post_type ) {\n\t\t$this->post_type = $post_type;\n\t}\n\n\t/**\n\t * Retrieves the object meta type.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return string The meta type.\n\t */\n\tprotected function get_meta_type() {\n\t\treturn 'post';\n\t}\n\n\t/**\n\t * Retrieves the object meta subtype.\n\t *\n\t * @since 4.9.8\n\t *\n\t * @return string Subtype for the meta type, or empty string if no specific subtype.\n\t */\n\tprotected function get_meta_subtype() {\n\t\treturn $this->post_type;\n\t}\n\n\t/**\n\t * Retrieves the type for register_rest_field().\n\t *\n\t * @since 4.7.0\n\t *\n\t * @see register_rest_field()\n\t *\n\t * @return string The REST field type.\n\t */\n\tpublic function get_rest_field_type() {\n\t\treturn $this->post_type;\n\t}\n}\n", "num_lines": 73}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Term_Meta_Fields class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.7.0\n */\n\n/**\n * Core class used to manage meta values for terms via the REST API.\n *\n * @since 4.7.0\n *\n * @see WP_REST_Meta_Fields\n */\nclass WP_REST_Term_Meta_Fields extends WP_REST_Meta_Fields {\n\n\t/**\n\t * Taxonomy to register fields for.\n\t *\n\t * @since 4.7.0\n\t * @var string\n\t */\n\tprotected $taxonomy;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @param string $taxonomy Taxonomy to register fields for.\n\t */\n\tpublic function __construct( $taxonomy ) {\n\t\t$this->taxonomy = $taxonomy;\n\t}\n\n\t/**\n\t * Retrieves the object meta type.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return string The meta type.\n\t */\n\tprotected function get_meta_type() {\n\t\treturn 'term';\n\t}\n\n\t/**\n\t * Retrieves the object meta subtype.\n\t *\n\t * @since 4.9.8\n\t *\n\t * @return string Subtype for the meta type, or empty string if no specific subtype.\n\t */\n\tprotected function get_meta_subtype() {\n\t\treturn $this->taxonomy;\n\t}\n\n\t/**\n\t * Retrieves the type for register_rest_field().\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return string The REST field type.\n\t */\n\tpublic function get_rest_field_type() {\n\t\treturn 'post_tag' === $this->taxonomy ? 'tag' : $this->taxonomy;\n\t}\n}\n", "num_lines": 71}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_User_Meta_Fields class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 4.7.0\n */\n\n/**\n * Core class used to manage meta values for users via the REST API.\n *\n * @since 4.7.0\n *\n * @see WP_REST_Meta_Fields\n */\nclass WP_REST_User_Meta_Fields extends WP_REST_Meta_Fields {\n\n\t/**\n\t * Retrieves the object meta type.\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return string The user meta type.\n\t */\n\tprotected function get_meta_type() {\n\t\treturn 'user';\n\t}\n\n\t/**\n\t * Retrieves the object meta subtype.\n\t *\n\t * @since 4.9.8\n\t *\n\t * @return string 'user' There are no subtypes.\n\t */\n\tprotected function get_meta_subtype() {\n\t\treturn 'user';\n\t}\n\n\t/**\n\t * Retrieves the type for register_rest_field().\n\t *\n\t * @since 4.7.0\n\t *\n\t * @return string The user REST field type.\n\t */\n\tpublic function get_rest_field_type() {\n\t\treturn 'user';\n\t}\n}\n", "num_lines": 52}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Post_Search_Handler class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 5.0.0\n */\n\n/**\n * Core class representing a search handler for posts in the REST API.\n *\n * @since 5.0.0\n *\n * @see WP_REST_Search_Handler\n */\nclass WP_REST_Post_Search_Handler extends WP_REST_Search_Handler {\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 5.0.0\n\t */\n\tpublic function __construct() {\n\t\t$this->type = 'post';\n\n\t\t// Support all public post types except attachments.\n\t\t$this->subtypes = array_diff(\n\t\t\tarray_values(\n\t\t\t\tget_post_types(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'public'       => true,\n\t\t\t\t\t\t'show_in_rest' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'names'\n\t\t\t\t)\n\t\t\t),\n\t\t\tarray( 'attachment' )\n\t\t);\n\t}\n\n\t/**\n\t * Searches the object type content for a given search request.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_REST_Request $request Full REST request.\n\t * @return array Associative array containing an `WP_REST_Search_Handler::RESULT_IDS` containing\n\t *               an array of found IDs and `WP_REST_Search_Handler::RESULT_TOTAL` containing the\n\t *               total count for the matching search results.\n\t */\n\tpublic function search_items( WP_REST_Request $request ) {\n\n\t\t// Get the post types to search for the current request.\n\t\t$post_types = $request[ WP_REST_Search_Controller::PROP_SUBTYPE ];\n\t\tif ( in_array( WP_REST_Search_Controller::TYPE_ANY, $post_types, true ) ) {\n\t\t\t$post_types = $this->subtypes;\n\t\t}\n\n\t\t$query_args = array(\n\t\t\t'post_type'           => $post_types,\n\t\t\t'post_status'         => 'publish',\n\t\t\t'paged'               => (int) $request['page'],\n\t\t\t'posts_per_page'      => (int) $request['per_page'],\n\t\t\t'ignore_sticky_posts' => true,\n\t\t\t'fields'              => 'ids',\n\t\t);\n\n\t\tif ( ! empty( $request['search'] ) ) {\n\t\t\t$query_args['s'] = $request['search'];\n\t\t}\n\n\t\t/**\n\t\t * Filters the query arguments for a search request.\n\t\t *\n\t\t * Enables adding extra arguments or setting defaults for a post search request.\n\t\t *\n\t\t * @since 5.1.0\n\t\t *\n\t\t * @param array           $query_args Key value array of query var to query value.\n\t\t * @param WP_REST_Request $request    The request used.\n\t\t */\n\t\t$query_args = apply_filters( 'rest_post_search_query', $query_args, $request );\n\n\t\t$query     = new WP_Query();\n\t\t$found_ids = $query->query( $query_args );\n\t\t$total     = $query->found_posts;\n\n\t\treturn array(\n\t\t\tself::RESULT_IDS   => $found_ids,\n\t\t\tself::RESULT_TOTAL => $total,\n\t\t);\n\t}\n\n\t/**\n\t * Prepares the search result for a given ID.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param int   $id     Item ID.\n\t * @param array $fields Fields to include for the item.\n\t * @return array Associative array containing all fields for the item.\n\t */\n\tpublic function prepare_item( $id, array $fields ) {\n\t\t$post = get_post( $id );\n\n\t\t$data = array();\n\n\t\tif ( in_array( WP_REST_Search_Controller::PROP_ID, $fields, true ) ) {\n\t\t\t$data[ WP_REST_Search_Controller::PROP_ID ] = (int) $post->ID;\n\t\t}\n\n\t\tif ( in_array( WP_REST_Search_Controller::PROP_TITLE, $fields, true ) ) {\n\t\t\tif ( post_type_supports( $post->post_type, 'title' ) ) {\n\t\t\t\tadd_filter( 'protected_title_format', array( $this, 'protected_title_format' ) );\n\t\t\t\t$data[ WP_REST_Search_Controller::PROP_TITLE ] = get_the_title( $post->ID );\n\t\t\t\tremove_filter( 'protected_title_format', array( $this, 'protected_title_format' ) );\n\t\t\t} else {\n\t\t\t\t$data[ WP_REST_Search_Controller::PROP_TITLE ] = '';\n\t\t\t}\n\t\t}\n\n\t\tif ( in_array( WP_REST_Search_Controller::PROP_URL, $fields, true ) ) {\n\t\t\t$data[ WP_REST_Search_Controller::PROP_URL ] = get_permalink( $post->ID );\n\t\t}\n\n\t\tif ( in_array( WP_REST_Search_Controller::PROP_TYPE, $fields, true ) ) {\n\t\t\t$data[ WP_REST_Search_Controller::PROP_TYPE ] = $this->type;\n\t\t}\n\n\t\tif ( in_array( WP_REST_Search_Controller::PROP_SUBTYPE, $fields, true ) ) {\n\t\t\t$data[ WP_REST_Search_Controller::PROP_SUBTYPE ] = $post->post_type;\n\t\t}\n\n\t\treturn $data;\n\t}\n\n\t/**\n\t * Prepares links for the search result of a given ID.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param int $id Item ID.\n\t * @return array Links for the given item.\n\t */\n\tpublic function prepare_item_links( $id ) {\n\t\t$post = get_post( $id );\n\n\t\t$links = array();\n\n\t\t$item_route = rest_get_route_for_post( $post );\n\t\tif ( ! empty( $item_route ) ) {\n\t\t\t$links['self'] = array(\n\t\t\t\t'href'       => rest_url( $item_route ),\n\t\t\t\t'embeddable' => true,\n\t\t\t);\n\t\t}\n\n\t\t$links['about'] = array(\n\t\t\t'href' => rest_url( 'wp/v2/types/' . $post->post_type ),\n\t\t);\n\n\t\treturn $links;\n\t}\n\n\t/**\n\t * Overwrites the default protected title format.\n\t *\n\t * By default, WordPress will show password protected posts with a title of\n\t * \"Protected: %s\". As the REST API communicates the protected status of a post\n\t * in a machine readable format, we remove the \"Protected: \" prefix.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @return string Protected title format.\n\t */\n\tpublic function protected_title_format() {\n\t\treturn '%s';\n\t}\n\n\t/**\n\t * Attempts to detect the route to access a single item.\n\t *\n\t * @since 5.0.0\n\t * @deprecated 5.5.0 Use rest_get_route_for_post()\n\t * @see rest_get_route_for_post()\n\t *\n\t * @param WP_Post $post Post object.\n\t * @return string REST route relative to the REST base URI, or empty string if unknown.\n\t */\n\tprotected function detect_rest_item_route( $post ) {\n\t\t_deprecated_function( __METHOD__, '5.5.0', 'rest_get_route_for_post()' );\n\n\t\treturn rest_get_route_for_post( $post );\n\t}\n\n}\n", "num_lines": 198}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * REST API: WP_REST_Search_Handler class\n *\n * @package WordPress\n * @subpackage REST_API\n * @since 5.0.0\n */\n\n/**\n * Core base class representing a search handler for an object type in the REST API.\n *\n * @since 5.0.0\n */\nabstract class WP_REST_Search_Handler {\n\n\t/**\n\t * Field containing the IDs in the search result.\n\t */\n\tconst RESULT_IDS = 'ids';\n\n\t/**\n\t * Field containing the total count in the search result.\n\t */\n\tconst RESULT_TOTAL = 'total';\n\n\t/**\n\t * Object type managed by this search handler.\n\t *\n\t * @since 5.0.0\n\t * @var string\n\t */\n\tprotected $type = '';\n\n\t/**\n\t * Object subtypes managed by this search handler.\n\t *\n\t * @since 5.0.0\n\t * @var array\n\t */\n\tprotected $subtypes = array();\n\n\t/**\n\t * Gets the object type managed by this search handler.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @return string Object type identifier.\n\t */\n\tpublic function get_type() {\n\t\treturn $this->type;\n\t}\n\n\t/**\n\t * Gets the object subtypes managed by this search handler.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @return array Array of object subtype identifiers.\n\t */\n\tpublic function get_subtypes() {\n\t\treturn $this->subtypes;\n\t}\n\n\t/**\n\t * Searches the object type content for a given search request.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param WP_REST_Request $request Full REST request.\n\t * @return array Associative array containing an `WP_REST_Search_Handler::RESULT_IDS` containing\n\t *               an array of found IDs and `WP_REST_Search_Handler::RESULT_TOTAL` containing the\n\t *               total count for the matching search results.\n\t */\n\tabstract public function search_items( WP_REST_Request $request );\n\n\t/**\n\t * Prepares the search result for a given ID.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param int   $id     Item ID.\n\t * @param array $fields Fields to include for the item.\n\t * @return array Associative array containing all fields for the item.\n\t */\n\tabstract public function prepare_item( $id, array $fields );\n\n\t/**\n\t * Prepares links for the search result of a given ID.\n\t *\n\t * @since 5.0.0\n\t *\n\t * @param int $id Item ID.\n\t * @return array Links for the given item.\n\t */\n\tabstract public function prepare_item_links( $id );\n}\n", "num_lines": 98}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Manages all author-related data\n *\n * Used by {@see SimplePie_Item::get_author()} and {@see SimplePie::get_authors()}\n *\n * This class can be overloaded with {@see SimplePie::set_author_class()}\n *\n * @package SimplePie\n * @subpackage API\n */\nclass SimplePie_Author\n{\n\t/**\n\t * Author's name\n\t *\n\t * @var string\n\t * @see get_name()\n\t */\n\tvar $name;\n\n\t/**\n\t * Author's link\n\t *\n\t * @var string\n\t * @see get_link()\n\t */\n\tvar $link;\n\n\t/**\n\t * Author's email address\n\t *\n\t * @var string\n\t * @see get_email()\n\t */\n\tvar $email;\n\n\t/**\n\t * Constructor, used to input the data\n\t *\n\t * @param string $name\n\t * @param string $link\n\t * @param string $email\n\t */\n\tpublic function __construct($name = null, $link = null, $email = null)\n\t{\n\t\t$this->name = $name;\n\t\t$this->link = $link;\n\t\t$this->email = $email;\n\t}\n\n\t/**\n\t * String-ified version\n\t *\n\t * @return string\n\t */\n\tpublic function __toString()\n\t{\n\t\t// There is no $this->data here\n\t\treturn md5(serialize($this));\n\t}\n\n\t/**\n\t * Author's name\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_name()\n\t{\n\t\tif ($this->name !== null)\n\t\t{\n\t\t\treturn $this->name;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Author's link\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_link()\n\t{\n\t\tif ($this->link !== null)\n\t\t{\n\t\t\treturn $this->link;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Author's email address\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_email()\n\t{\n\t\tif ($this->email !== null)\n\t\t{\n\t\t\treturn $this->email;\n\t\t}\n\n\t\treturn null;\n\t}\n}\n", "num_lines": 150}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Used to create cache objects\n *\n * This class can be overloaded with {@see SimplePie::set_cache_class()},\n * although the preferred way is to create your own handler\n * via {@see register()}\n *\n * @package SimplePie\n * @subpackage Caching\n */\nclass SimplePie_Cache\n{\n\t/**\n\t * Cache handler classes\n\t *\n\t * These receive 3 parameters to their constructor, as documented in\n\t * {@see register()}\n\t * @var array\n\t */\n\tprotected static $handlers = array(\n\t\t'mysql'     => 'SimplePie_Cache_MySQL',\n\t\t'memcache'  => 'SimplePie_Cache_Memcache',\n\t\t'memcached' => 'SimplePie_Cache_Memcached',\n\t\t'redis'     => 'SimplePie_Cache_Redis'\n\t);\n\n\t/**\n\t * Don't call the constructor. Please.\n\t */\n\tprivate function __construct() { }\n\n\t/**\n\t * Create a new SimplePie_Cache object\n\t *\n\t * @param string $location URL location (scheme is used to determine handler)\n\t * @param string $filename Unique identifier for cache object\n\t * @param string $extension 'spi' or 'spc'\n\t * @return SimplePie_Cache_Base Type of object depends on scheme of `$location`\n\t */\n\tpublic static function get_handler($location, $filename, $extension)\n\t{\n\t\t$type = explode(':', $location, 2);\n\t\t$type = $type[0];\n\t\tif (!empty(self::$handlers[$type]))\n\t\t{\n\t\t\t$class = self::$handlers[$type];\n\t\t\treturn new $class($location, $filename, $extension);\n\t\t}\n\n\t\treturn new SimplePie_Cache_File($location, $filename, $extension);\n\t}\n\n\t/**\n\t * Create a new SimplePie_Cache object\n\t *\n\t * @deprecated Use {@see get_handler} instead\n\t */\n\tpublic function create($location, $filename, $extension)\n\t{\n\t\ttrigger_error('Cache::create() has been replaced with Cache::get_handler(). Switch to the registry system to use this.', E_USER_DEPRECATED);\n\t\treturn self::get_handler($location, $filename, $extension);\n\t}\n\n\t/**\n\t * Register a handler\n\t *\n\t * @param string $type DSN type to register for\n\t * @param string $class Name of handler class. Must implement SimplePie_Cache_Base\n\t */\n\tpublic static function register($type, $class)\n\t{\n\t\tself::$handlers[$type] = $class;\n\t}\n\n\t/**\n\t * Parse a URL into an array\n\t *\n\t * @param string $url\n\t * @return array\n\t */\n\tpublic static function parse_URL($url)\n\t{\n\t\t$params = parse_url($url);\n\t\t$params['extras'] = array();\n\t\tif (isset($params['query']))\n\t\t{\n\t\t\tparse_str($params['query'], $params['extras']);\n\t\t}\n\t\treturn $params;\n\t}\n}\n", "num_lines": 135}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n\n/**\n * Handles `<media:text>` captions as defined in Media RSS.\n *\n * Used by {@see SimplePie_Enclosure::get_caption()} and {@see SimplePie_Enclosure::get_captions()}\n *\n * This class can be overloaded with {@see SimplePie::set_caption_class()}\n *\n * @package SimplePie\n * @subpackage API\n */\nclass SimplePie_Caption\n{\n\t/**\n\t * Content type\n\t *\n\t * @var string\n\t * @see get_type()\n\t */\n\tvar $type;\n\n\t/**\n\t * Language\n\t *\n\t * @var string\n\t * @see get_language()\n\t */\n\tvar $lang;\n\n\t/**\n\t * Start time\n\t *\n\t * @var string\n\t * @see get_starttime()\n\t */\n\tvar $startTime;\n\n\t/**\n\t * End time\n\t *\n\t * @var string\n\t * @see get_endtime()\n\t */\n\tvar $endTime;\n\n\t/**\n\t * Caption text\n\t *\n\t * @var string\n\t * @see get_text()\n\t */\n\tvar $text;\n\n\t/**\n\t * Constructor, used to input the data\n\t *\n\t * For documentation on all the parameters, see the corresponding\n\t * properties and their accessors\n\t */\n\tpublic function __construct($type = null, $lang = null, $startTime = null, $endTime = null, $text = null)\n\t{\n\t\t$this->type = $type;\n\t\t$this->lang = $lang;\n\t\t$this->startTime = $startTime;\n\t\t$this->endTime = $endTime;\n\t\t$this->text = $text;\n\t}\n\n\t/**\n\t * String-ified version\n\t *\n\t * @return string\n\t */\n\tpublic function __toString()\n\t{\n\t\t// There is no $this->data here\n\t\treturn md5(serialize($this));\n\t}\n\n\t/**\n\t * Get the end time\n\t *\n\t * @return string|null Time in the format 'hh:mm:ss.SSS'\n\t */\n\tpublic function get_endtime()\n\t{\n\t\tif ($this->endTime !== null)\n\t\t{\n\t\t\treturn $this->endTime;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the language\n\t *\n\t * @link http://tools.ietf.org/html/rfc3066\n\t * @return string|null Language code as per RFC 3066\n\t */\n\tpublic function get_language()\n\t{\n\t\tif ($this->lang !== null)\n\t\t{\n\t\t\treturn $this->lang;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the start time\n\t *\n\t * @return string|null Time in the format 'hh:mm:ss.SSS'\n\t */\n\tpublic function get_starttime()\n\t{\n\t\tif ($this->startTime !== null)\n\t\t{\n\t\t\treturn $this->startTime;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the text of the caption\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_text()\n\t{\n\t\tif ($this->text !== null)\n\t\t{\n\t\t\treturn $this->text;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the content type (not MIME type)\n\t *\n\t * @return string|null Either 'text' or 'html'\n\t */\n\tpublic function get_type()\n\t{\n\t\tif ($this->type !== null)\n\t\t{\n\t\t\treturn $this->type;\n\t\t}\n\n\t\treturn null;\n\t}\n}\n", "num_lines": 199}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Manages all category-related data\n *\n * Used by {@see SimplePie_Item::get_category()} and {@see SimplePie_Item::get_categories()}\n *\n * This class can be overloaded with {@see SimplePie::set_category_class()}\n *\n * @package SimplePie\n * @subpackage API\n */\nclass SimplePie_Category\n{\n\t/**\n\t * Category identifier\n\t *\n\t * @var string|null\n\t * @see get_term\n\t */\n\tvar $term;\n\n\t/**\n\t * Categorization scheme identifier\n\t *\n\t * @var string|null\n\t * @see get_scheme()\n\t */\n\tvar $scheme;\n\n\t/**\n\t * Human readable label\n\t *\n\t * @var string|null\n\t * @see get_label()\n\t */\n\tvar $label;\n\n\t/**\n\t * Category type\n\t * \n\t * category for <category>\n\t * subject for <dc:subject>\n\t *\n\t * @var string|null\n\t * @see get_type()\n\t */\n\tvar $type;\n\n\t/**\n\t * Constructor, used to input the data\n\t *\n\t * @param string|null $term\n\t * @param string|null $scheme\n\t * @param string|null $label\n\t * @param string|null $type\n\t */\n\tpublic function __construct($term = null, $scheme = null, $label = null, $type = null)\n\t{\n\t\t$this->term = $term;\n\t\t$this->scheme = $scheme;\n\t\t$this->label = $label;\n\t\t$this->type = $type;\n\t}\n\n\t/**\n\t * String-ified version\n\t *\n\t * @return string\n\t */\n\tpublic function __toString()\n\t{\n\t\t// There is no $this->data here\n\t\treturn md5(serialize($this));\n\t}\n\n\t/**\n\t * Get the category identifier\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_term()\n\t{\n\t\treturn $this->term;\n\t}\n\n\t/**\n\t * Get the categorization scheme identifier\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_scheme()\n\t{\n\t\treturn $this->scheme;\n\t}\n\n\t/**\n\t * Get the human readable label\n\t *\n\t * @param bool $strict\n\t * @return string|null\n\t */\n\tpublic function get_label($strict = false)\n\t{\n\t\tif ($this->label === null && $strict !== true)\n\t\t{\n\t\t\treturn $this->get_term();\n\t\t}\n\t\treturn $this->label;\n\t}\n\n\t/**\n\t * Get the category type\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_type()\n\t{\n\t\treturn $this->type;\n\t}\n}\n\n", "num_lines": 164}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Manages `<media:copyright>` copyright tags as defined in Media RSS\n *\n * Used by {@see SimplePie_Enclosure::get_copyright()}\n *\n * This class can be overloaded with {@see SimplePie::set_copyright_class()}\n *\n * @package SimplePie\n * @subpackage API\n */\nclass SimplePie_Copyright\n{\n\t/**\n\t * Copyright URL\n\t *\n\t * @var string\n\t * @see get_url()\n\t */\n\tvar $url;\n\n\t/**\n\t * Attribution\n\t *\n\t * @var string\n\t * @see get_attribution()\n\t */\n\tvar $label;\n\n\t/**\n\t * Constructor, used to input the data\n\t *\n\t * For documentation on all the parameters, see the corresponding\n\t * properties and their accessors\n\t */\n\tpublic function __construct($url = null, $label = null)\n\t{\n\t\t$this->url = $url;\n\t\t$this->label = $label;\n\t}\n\n\t/**\n\t * String-ified version\n\t *\n\t * @return string\n\t */\n\tpublic function __toString()\n\t{\n\t\t// There is no $this->data here\n\t\treturn md5(serialize($this));\n\t}\n\n\t/**\n\t * Get the copyright URL\n\t *\n\t * @return string|null URL to copyright information\n\t */\n\tpublic function get_url()\n\t{\n\t\tif ($this->url !== null)\n\t\t{\n\t\t\treturn $this->url;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the attribution text\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_attribution()\n\t{\n\t\tif ($this->label !== null)\n\t\t{\n\t\t\treturn $this->label;\n\t\t}\n\n\t\treturn null;\n\t}\n}\n", "num_lines": 125}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * SimplePie class.\n *\n * Class for backward compatibility.\n *\n * @deprecated Use {@see SimplePie} directly\n * @package SimplePie\n * @subpackage API\n */\nclass SimplePie_Core extends SimplePie\n{\n\n}", "num_lines": 56}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Handles `<media:credit>` as defined in Media RSS\n *\n * Used by {@see SimplePie_Enclosure::get_credit()} and {@see SimplePie_Enclosure::get_credits()}\n *\n * This class can be overloaded with {@see SimplePie::set_credit_class()}\n *\n * @package SimplePie\n * @subpackage API\n */\nclass SimplePie_Credit\n{\n\t/**\n\t * Credited role\n\t *\n\t * @var string\n\t * @see get_role()\n\t */\n\tvar $role;\n\n\t/**\n\t * Organizational scheme\n\t *\n\t * @var string\n\t * @see get_scheme()\n\t */\n\tvar $scheme;\n\n\t/**\n\t * Credited name\n\t *\n\t * @var string\n\t * @see get_name()\n\t */\n\tvar $name;\n\n\t/**\n\t * Constructor, used to input the data\n\t *\n\t * For documentation on all the parameters, see the corresponding\n\t * properties and their accessors\n\t */\n\tpublic function __construct($role = null, $scheme = null, $name = null)\n\t{\n\t\t$this->role = $role;\n\t\t$this->scheme = $scheme;\n\t\t$this->name = $name;\n\t}\n\n\t/**\n\t * String-ified version\n\t *\n\t * @return string\n\t */\n\tpublic function __toString()\n\t{\n\t\t// There is no $this->data here\n\t\treturn md5(serialize($this));\n\t}\n\n\t/**\n\t * Get the role of the person receiving credit\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_role()\n\t{\n\t\tif ($this->role !== null)\n\t\t{\n\t\t\treturn $this->role;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the organizational scheme\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_scheme()\n\t{\n\t\tif ($this->scheme !== null)\n\t\t{\n\t\t\treturn $this->scheme;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the credited person/entity's name\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_name()\n\t{\n\t\tif ($this->name !== null)\n\t\t{\n\t\t\treturn $this->name;\n\t\t}\n\n\t\treturn null;\n\t}\n}\n", "num_lines": 149}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Handles everything related to enclosures (including Media RSS and iTunes RSS)\n *\n * Used by {@see SimplePie_Item::get_enclosure()} and {@see SimplePie_Item::get_enclosures()}\n *\n * This class can be overloaded with {@see SimplePie::set_enclosure_class()}\n *\n * @package SimplePie\n * @subpackage API\n */\nclass SimplePie_Enclosure\n{\n\t/**\n\t * @var string\n\t * @see get_bitrate()\n\t */\n\tvar $bitrate;\n\n\t/**\n\t * @var array\n\t * @see get_captions()\n\t */\n\tvar $captions;\n\n\t/**\n\t * @var array\n\t * @see get_categories()\n\t */\n\tvar $categories;\n\n\t/**\n\t * @var int\n\t * @see get_channels()\n\t */\n\tvar $channels;\n\n\t/**\n\t * @var SimplePie_Copyright\n\t * @see get_copyright()\n\t */\n\tvar $copyright;\n\n\t/**\n\t * @var array\n\t * @see get_credits()\n\t */\n\tvar $credits;\n\n\t/**\n\t * @var string\n\t * @see get_description()\n\t */\n\tvar $description;\n\n\t/**\n\t * @var int\n\t * @see get_duration()\n\t */\n\tvar $duration;\n\n\t/**\n\t * @var string\n\t * @see get_expression()\n\t */\n\tvar $expression;\n\n\t/**\n\t * @var string\n\t * @see get_framerate()\n\t */\n\tvar $framerate;\n\n\t/**\n\t * @var string\n\t * @see get_handler()\n\t */\n\tvar $handler;\n\n\t/**\n\t * @var array\n\t * @see get_hashes()\n\t */\n\tvar $hashes;\n\n\t/**\n\t * @var string\n\t * @see get_height()\n\t */\n\tvar $height;\n\n\t/**\n\t * @deprecated\n\t * @var null\n\t */\n\tvar $javascript;\n\n\t/**\n\t * @var array\n\t * @see get_keywords()\n\t */\n\tvar $keywords;\n\n\t/**\n\t * @var string\n\t * @see get_language()\n\t */\n\tvar $lang;\n\n\t/**\n\t * @var string\n\t * @see get_length()\n\t */\n\tvar $length;\n\n\t/**\n\t * @var string\n\t * @see get_link()\n\t */\n\tvar $link;\n\n\t/**\n\t * @var string\n\t * @see get_medium()\n\t */\n\tvar $medium;\n\n\t/**\n\t * @var string\n\t * @see get_player()\n\t */\n\tvar $player;\n\n\t/**\n\t * @var array\n\t * @see get_ratings()\n\t */\n\tvar $ratings;\n\n\t/**\n\t * @var array\n\t * @see get_restrictions()\n\t */\n\tvar $restrictions;\n\n\t/**\n\t * @var string\n\t * @see get_sampling_rate()\n\t */\n\tvar $samplingrate;\n\n\t/**\n\t * @var array\n\t * @see get_thumbnails()\n\t */\n\tvar $thumbnails;\n\n\t/**\n\t * @var string\n\t * @see get_title()\n\t */\n\tvar $title;\n\n\t/**\n\t * @var string\n\t * @see get_type()\n\t */\n\tvar $type;\n\n\t/**\n\t * @var string\n\t * @see get_width()\n\t */\n\tvar $width;\n\n\t/**\n\t * Constructor, used to input the data\n\t *\n\t * For documentation on all the parameters, see the corresponding\n\t * properties and their accessors\n\t *\n\t * @uses idna_convert If available, this will convert an IDN\n\t */\n\tpublic function __construct($link = null, $type = null, $length = null, $javascript = null, $bitrate = null, $captions = null, $categories = null, $channels = null, $copyright = null, $credits = null, $description = null, $duration = null, $expression = null, $framerate = null, $hashes = null, $height = null, $keywords = null, $lang = null, $medium = null, $player = null, $ratings = null, $restrictions = null, $samplingrate = null, $thumbnails = null, $title = null, $width = null)\n\t{\n\t\t$this->bitrate = $bitrate;\n\t\t$this->captions = $captions;\n\t\t$this->categories = $categories;\n\t\t$this->channels = $channels;\n\t\t$this->copyright = $copyright;\n\t\t$this->credits = $credits;\n\t\t$this->description = $description;\n\t\t$this->duration = $duration;\n\t\t$this->expression = $expression;\n\t\t$this->framerate = $framerate;\n\t\t$this->hashes = $hashes;\n\t\t$this->height = $height;\n\t\t$this->keywords = $keywords;\n\t\t$this->lang = $lang;\n\t\t$this->length = $length;\n\t\t$this->link = $link;\n\t\t$this->medium = $medium;\n\t\t$this->player = $player;\n\t\t$this->ratings = $ratings;\n\t\t$this->restrictions = $restrictions;\n\t\t$this->samplingrate = $samplingrate;\n\t\t$this->thumbnails = $thumbnails;\n\t\t$this->title = $title;\n\t\t$this->type = $type;\n\t\t$this->width = $width;\n\n\t\tif (class_exists('idna_convert'))\n\t\t{\n\t\t\t$idn = new idna_convert();\n\t\t\t$parsed = SimplePie_Misc::parse_url($link);\n\t\t\t$this->link = SimplePie_Misc::compress_parse_url($parsed['scheme'], $idn->encode($parsed['authority']), $parsed['path'], $parsed['query'], $parsed['fragment']);\n\t\t}\n\t\t$this->handler = $this->get_handler(); // Needs to load last\n\t}\n\n\t/**\n\t * String-ified version\n\t *\n\t * @return string\n\t */\n\tpublic function __toString()\n\t{\n\t\t// There is no $this->data here\n\t\treturn md5(serialize($this));\n\t}\n\n\t/**\n\t * Get the bitrate\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_bitrate()\n\t{\n\t\tif ($this->bitrate !== null)\n\t\t{\n\t\t\treturn $this->bitrate;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get a single caption\n\t *\n\t * @param int $key\n\t * @return SimplePie_Caption|null\n\t */\n\tpublic function get_caption($key = 0)\n\t{\n\t\t$captions = $this->get_captions();\n\t\tif (isset($captions[$key]))\n\t\t{\n\t\t\treturn $captions[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all captions\n\t *\n\t * @return array|null Array of {@see SimplePie_Caption} objects\n\t */\n\tpublic function get_captions()\n\t{\n\t\tif ($this->captions !== null)\n\t\t{\n\t\t\treturn $this->captions;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get a single category\n\t *\n\t * @param int $key\n\t * @return SimplePie_Category|null\n\t */\n\tpublic function get_category($key = 0)\n\t{\n\t\t$categories = $this->get_categories();\n\t\tif (isset($categories[$key]))\n\t\t{\n\t\t\treturn $categories[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all categories\n\t *\n\t * @return array|null Array of {@see SimplePie_Category} objects\n\t */\n\tpublic function get_categories()\n\t{\n\t\tif ($this->categories !== null)\n\t\t{\n\t\t\treturn $this->categories;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the number of audio channels\n\t *\n\t * @return int|null\n\t */\n\tpublic function get_channels()\n\t{\n\t\tif ($this->channels !== null)\n\t\t{\n\t\t\treturn $this->channels;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the copyright information\n\t *\n\t * @return SimplePie_Copyright|null\n\t */\n\tpublic function get_copyright()\n\t{\n\t\tif ($this->copyright !== null)\n\t\t{\n\t\t\treturn $this->copyright;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get a single credit\n\t *\n\t * @param int $key\n\t * @return SimplePie_Credit|null\n\t */\n\tpublic function get_credit($key = 0)\n\t{\n\t\t$credits = $this->get_credits();\n\t\tif (isset($credits[$key]))\n\t\t{\n\t\t\treturn $credits[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all credits\n\t *\n\t * @return array|null Array of {@see SimplePie_Credit} objects\n\t */\n\tpublic function get_credits()\n\t{\n\t\tif ($this->credits !== null)\n\t\t{\n\t\t\treturn $this->credits;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the description of the enclosure\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_description()\n\t{\n\t\tif ($this->description !== null)\n\t\t{\n\t\t\treturn $this->description;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the duration of the enclosure\n\t *\n\t * @param bool $convert Convert seconds into hh:mm:ss\n\t * @return string|int|null 'hh:mm:ss' string if `$convert` was specified, otherwise integer (or null if none found)\n\t */\n\tpublic function get_duration($convert = false)\n\t{\n\t\tif ($this->duration !== null)\n\t\t{\n\t\t\tif ($convert)\n\t\t\t{\n\t\t\t\t$time = SimplePie_Misc::time_hms($this->duration);\n\t\t\t\treturn $time;\n\t\t\t}\n\n\t\t\treturn $this->duration;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the expression\n\t *\n\t * @return string Probably one of 'sample', 'full', 'nonstop', 'clip'. Defaults to 'full'\n\t */\n\tpublic function get_expression()\n\t{\n\t\tif ($this->expression !== null)\n\t\t{\n\t\t\treturn $this->expression;\n\t\t}\n\n\t\treturn 'full';\n\t}\n\n\t/**\n\t * Get the file extension\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_extension()\n\t{\n\t\tif ($this->link !== null)\n\t\t{\n\t\t\t$url = SimplePie_Misc::parse_url($this->link);\n\t\t\tif ($url['path'] !== '')\n\t\t\t{\n\t\t\t\treturn pathinfo($url['path'], PATHINFO_EXTENSION);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the framerate (in frames-per-second)\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_framerate()\n\t{\n\t\tif ($this->framerate !== null)\n\t\t{\n\t\t\treturn $this->framerate;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the preferred handler\n\t *\n\t * @return string|null One of 'flash', 'fmedia', 'quicktime', 'wmedia', 'mp3'\n\t */\n\tpublic function get_handler()\n\t{\n\t\treturn $this->get_real_type(true);\n\t}\n\n\t/**\n\t * Get a single hash\n\t *\n\t * @link http://www.rssboard.org/media-rss#media-hash\n\t * @param int $key\n\t * @return string|null Hash as per `media:hash`, prefixed with \"$algo:\"\n\t */\n\tpublic function get_hash($key = 0)\n\t{\n\t\t$hashes = $this->get_hashes();\n\t\tif (isset($hashes[$key]))\n\t\t{\n\t\t\treturn $hashes[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all credits\n\t *\n\t * @return array|null Array of strings, see {@see get_hash()}\n\t */\n\tpublic function get_hashes()\n\t{\n\t\tif ($this->hashes !== null)\n\t\t{\n\t\t\treturn $this->hashes;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the height\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_height()\n\t{\n\t\tif ($this->height !== null)\n\t\t{\n\t\t\treturn $this->height;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the language\n\t *\n\t * @link http://tools.ietf.org/html/rfc3066\n\t * @return string|null Language code as per RFC 3066\n\t */\n\tpublic function get_language()\n\t{\n\t\tif ($this->lang !== null)\n\t\t{\n\t\t\treturn $this->lang;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get a single keyword\n\t *\n\t * @param int $key\n\t * @return string|null\n\t */\n\tpublic function get_keyword($key = 0)\n\t{\n\t\t$keywords = $this->get_keywords();\n\t\tif (isset($keywords[$key]))\n\t\t{\n\t\t\treturn $keywords[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all keywords\n\t *\n\t * @return array|null Array of strings\n\t */\n\tpublic function get_keywords()\n\t{\n\t\tif ($this->keywords !== null)\n\t\t{\n\t\t\treturn $this->keywords;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get length\n\t *\n\t * @return float Length in bytes\n\t */\n\tpublic function get_length()\n\t{\n\t\tif ($this->length !== null)\n\t\t{\n\t\t\treturn $this->length;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the URL\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_link()\n\t{\n\t\tif ($this->link !== null)\n\t\t{\n\t\t\treturn urldecode($this->link);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the medium\n\t *\n\t * @link http://www.rssboard.org/media-rss#media-content\n\t * @return string|null Should be one of 'image', 'audio', 'video', 'document', 'executable'\n\t */\n\tpublic function get_medium()\n\t{\n\t\tif ($this->medium !== null)\n\t\t{\n\t\t\treturn $this->medium;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the player URL\n\t *\n\t * Typically the same as {@see get_permalink()}\n\t * @return string|null Player URL\n\t */\n\tpublic function get_player()\n\t{\n\t\tif ($this->player !== null)\n\t\t{\n\t\t\treturn $this->player;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get a single rating\n\t *\n\t * @param int $key\n\t * @return SimplePie_Rating|null\n\t */\n\tpublic function get_rating($key = 0)\n\t{\n\t\t$ratings = $this->get_ratings();\n\t\tif (isset($ratings[$key]))\n\t\t{\n\t\t\treturn $ratings[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all ratings\n\t *\n\t * @return array|null Array of {@see SimplePie_Rating} objects\n\t */\n\tpublic function get_ratings()\n\t{\n\t\tif ($this->ratings !== null)\n\t\t{\n\t\t\treturn $this->ratings;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get a single restriction\n\t *\n\t * @param int $key\n\t * @return SimplePie_Restriction|null\n\t */\n\tpublic function get_restriction($key = 0)\n\t{\n\t\t$restrictions = $this->get_restrictions();\n\t\tif (isset($restrictions[$key]))\n\t\t{\n\t\t\treturn $restrictions[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all restrictions\n\t *\n\t * @return array|null Array of {@see SimplePie_Restriction} objects\n\t */\n\tpublic function get_restrictions()\n\t{\n\t\tif ($this->restrictions !== null)\n\t\t{\n\t\t\treturn $this->restrictions;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the sampling rate (in kHz)\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_sampling_rate()\n\t{\n\t\tif ($this->samplingrate !== null)\n\t\t{\n\t\t\treturn $this->samplingrate;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the file size (in MiB)\n\t *\n\t * @return float|null File size in mebibytes (1048 bytes)\n\t */\n\tpublic function get_size()\n\t{\n\t\t$length = $this->get_length();\n\t\tif ($length !== null)\n\t\t{\n\t\t\treturn round($length/1048576, 2);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get a single thumbnail\n\t *\n\t * @param int $key\n\t * @return string|null Thumbnail URL\n\t */\n\tpublic function get_thumbnail($key = 0)\n\t{\n\t\t$thumbnails = $this->get_thumbnails();\n\t\tif (isset($thumbnails[$key]))\n\t\t{\n\t\t\treturn $thumbnails[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all thumbnails\n\t *\n\t * @return array|null Array of thumbnail URLs\n\t */\n\tpublic function get_thumbnails()\n\t{\n\t\tif ($this->thumbnails !== null)\n\t\t{\n\t\t\treturn $this->thumbnails;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the title\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_title()\n\t{\n\t\tif ($this->title !== null)\n\t\t{\n\t\t\treturn $this->title;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get mimetype of the enclosure\n\t *\n\t * @see get_real_type()\n\t * @return string|null MIME type\n\t */\n\tpublic function get_type()\n\t{\n\t\tif ($this->type !== null)\n\t\t{\n\t\t\treturn $this->type;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the width\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_width()\n\t{\n\t\tif ($this->width !== null)\n\t\t{\n\t\t\treturn $this->width;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Embed the enclosure using `<embed>`\n\t *\n\t * @deprecated Use the second parameter to {@see embed} instead\n\t *\n\t * @param array|string $options See first paramter to {@see embed}\n\t * @return string HTML string to output\n\t */\n\tpublic function native_embed($options='')\n\t{\n\t\treturn $this->embed($options, true);\n\t}\n\n\t/**\n\t * Embed the enclosure using Javascript\n\t *\n\t * `$options` is an array or comma-separated key:value string, with the\n\t * following properties:\n\t *\n\t * - `alt` (string): Alternate content for when an end-user does not have\n\t *    the appropriate handler installed or when a file type is\n\t *    unsupported. Can be any text or HTML. Defaults to blank.\n\t * - `altclass` (string): If a file type is unsupported, the end-user will\n\t *    see the alt text (above) linked directly to the content. That link\n\t *    will have this value as its class name. Defaults to blank.\n\t * - `audio` (string): This is an image that should be used as a\n\t *    placeholder for audio files before they're loaded (QuickTime-only).\n\t *    Can be any relative or absolute URL. Defaults to blank.\n\t * - `bgcolor` (string): The background color for the media, if not\n\t *    already transparent. Defaults to `#ffffff`.\n\t * - `height` (integer): The height of the embedded media. Accepts any\n\t *    numeric pixel value (such as `360`) or `auto`. Defaults to `auto`,\n\t *    and it is recommended that you use this default.\n\t * - `loop` (boolean): Do you want the media to loop when it's done?\n\t *    Defaults to `false`.\n\t * - `mediaplayer` (string): The location of the included\n\t *    `mediaplayer.swf` file. This allows for the playback of Flash Video\n\t *    (`.flv`) files, and is the default handler for non-Odeo MP3's.\n\t *    Defaults to blank.\n\t * - `video` (string): This is an image that should be used as a\n\t *    placeholder for video files before they're loaded (QuickTime-only).\n\t *    Can be any relative or absolute URL. Defaults to blank.\n\t * - `width` (integer): The width of the embedded media. Accepts any\n\t *    numeric pixel value (such as `480`) or `auto`. Defaults to `auto`,\n\t *    and it is recommended that you use this default.\n\t * - `widescreen` (boolean): Is the enclosure widescreen or standard?\n\t *    This applies only to video enclosures, and will automatically resize\n\t *    the content appropriately.  Defaults to `false`, implying 4:3 mode.\n\t *\n\t * Note: Non-widescreen (4:3) mode with `width` and `height` set to `auto`\n\t * will default to 480x360 video resolution.  Widescreen (16:9) mode with\n\t * `width` and `height` set to `auto` will default to 480x270 video resolution.\n\t *\n\t * @todo If the dimensions for media:content are defined, use them when width/height are set to 'auto'.\n\t * @param array|string $options Comma-separated key:value list, or array\n\t * @param bool $native Use `<embed>`\n\t * @return string HTML string to output\n\t */\n\tpublic function embed($options = '', $native = false)\n\t{\n\t\t// Set up defaults\n\t\t$audio = '';\n\t\t$video = '';\n\t\t$alt = '';\n\t\t$altclass = '';\n\t\t$loop = 'false';\n\t\t$width = 'auto';\n\t\t$height = 'auto';\n\t\t$bgcolor = '#ffffff';\n\t\t$mediaplayer = '';\n\t\t$widescreen = false;\n\t\t$handler = $this->get_handler();\n\t\t$type = $this->get_real_type();\n\n\t\t// Process options and reassign values as necessary\n\t\tif (is_array($options))\n\t\t{\n\t\t\textract($options);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$options = explode(',', $options);\n\t\t\tforeach($options as $option)\n\t\t\t{\n\t\t\t\t$opt = explode(':', $option, 2);\n\t\t\t\tif (isset($opt[0], $opt[1]))\n\t\t\t\t{\n\t\t\t\t\t$opt[0] = trim($opt[0]);\n\t\t\t\t\t$opt[1] = trim($opt[1]);\n\t\t\t\t\tswitch ($opt[0])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'audio':\n\t\t\t\t\t\t\t$audio = $opt[1];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'video':\n\t\t\t\t\t\t\t$video = $opt[1];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'alt':\n\t\t\t\t\t\t\t$alt = $opt[1];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'altclass':\n\t\t\t\t\t\t\t$altclass = $opt[1];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'loop':\n\t\t\t\t\t\t\t$loop = $opt[1];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'width':\n\t\t\t\t\t\t\t$width = $opt[1];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'height':\n\t\t\t\t\t\t\t$height = $opt[1];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'bgcolor':\n\t\t\t\t\t\t\t$bgcolor = $opt[1];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'mediaplayer':\n\t\t\t\t\t\t\t$mediaplayer = $opt[1];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'widescreen':\n\t\t\t\t\t\t\t$widescreen = $opt[1];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$mime = explode('/', $type, 2);\n\t\t$mime = $mime[0];\n\n\t\t// Process values for 'auto'\n\t\tif ($width === 'auto')\n\t\t{\n\t\t\tif ($mime === 'video')\n\t\t\t{\n\t\t\t\tif ($height === 'auto')\n\t\t\t\t{\n\t\t\t\t\t$width = 480;\n\t\t\t\t}\n\t\t\t\telseif ($widescreen)\n\t\t\t\t{\n\t\t\t\t\t$width = round((intval($height)/9)*16);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$width = round((intval($height)/3)*4);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$width = '100%';\n\t\t\t}\n\t\t}\n\n\t\tif ($height === 'auto')\n\t\t{\n\t\t\tif ($mime === 'audio')\n\t\t\t{\n\t\t\t\t$height = 0;\n\t\t\t}\n\t\t\telseif ($mime === 'video')\n\t\t\t{\n\t\t\t\tif ($width === 'auto')\n\t\t\t\t{\n\t\t\t\t\tif ($widescreen)\n\t\t\t\t\t{\n\t\t\t\t\t\t$height = 270;\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$height = 360;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif ($widescreen)\n\t\t\t\t{\n\t\t\t\t\t$height = round((intval($width)/16)*9);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$height = round((intval($width)/4)*3);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$height = 376;\n\t\t\t}\n\t\t}\n\t\telseif ($mime === 'audio')\n\t\t{\n\t\t\t$height = 0;\n\t\t}\n\n\t\t// Set proper placeholder value\n\t\tif ($mime === 'audio')\n\t\t{\n\t\t\t$placeholder = $audio;\n\t\t}\n\t\telseif ($mime === 'video')\n\t\t{\n\t\t\t$placeholder = $video;\n\t\t}\n\n\t\t$embed = '';\n\n\t\t// Flash\n\t\tif ($handler === 'flash')\n\t\t{\n\t\t\tif ($native)\n\t\t\t{\n\t\t\t\t$embed .= \"<embed src=\\\"\" . $this->get_link() . \"\\\" pluginspage=\\\"http://adobe.com/go/getflashplayer\\\" type=\\\"$type\\\" quality=\\\"high\\\" width=\\\"$width\\\" height=\\\"$height\\\" bgcolor=\\\"$bgcolor\\\" loop=\\\"$loop\\\"></embed>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$embed .= \"<script type='text/javascript'>embed_flash('$bgcolor', '$width', '$height', '\" . $this->get_link() . \"', '$loop', '$type');</script>\";\n\t\t\t}\n\t\t}\n\n\t\t// Flash Media Player file types.\n\t\t// Preferred handler for MP3 file types.\n\t\telseif ($handler === 'fmedia' || ($handler === 'mp3' && $mediaplayer !== ''))\n\t\t{\n\t\t\t$height += 20;\n\t\t\tif ($native)\n\t\t\t{\n\t\t\t\t$embed .= \"<embed src=\\\"$mediaplayer\\\" pluginspage=\\\"http://adobe.com/go/getflashplayer\\\" type=\\\"application/x-shockwave-flash\\\" quality=\\\"high\\\" width=\\\"$width\\\" height=\\\"$height\\\" wmode=\\\"transparent\\\" flashvars=\\\"file=\" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . \"&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\\\"></embed>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$embed .= \"<script type='text/javascript'>embed_flv('$width', '$height', '\" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . \"', '$placeholder', '$loop', '$mediaplayer');</script>\";\n\t\t\t}\n\t\t}\n\n\t\t// QuickTime 7 file types.  Need to test with QuickTime 6.\n\t\t// Only handle MP3's if the Flash Media Player is not present.\n\t\telseif ($handler === 'quicktime' || ($handler === 'mp3' && $mediaplayer === ''))\n\t\t{\n\t\t\t$height += 16;\n\t\t\tif ($native)\n\t\t\t{\n\t\t\t\tif ($placeholder !== '')\n\t\t\t\t{\n\t\t\t\t\t$embed .= \"<embed type=\\\"$type\\\" style=\\\"cursor:hand; cursor:pointer;\\\" href=\\\"\" . $this->get_link() . \"\\\" src=\\\"$placeholder\\\" width=\\\"$width\\\" height=\\\"$height\\\" autoplay=\\\"false\\\" target=\\\"myself\\\" controller=\\\"false\\\" loop=\\\"$loop\\\" scale=\\\"aspect\\\" bgcolor=\\\"$bgcolor\\\" pluginspage=\\\"http://apple.com/quicktime/download/\\\"></embed>\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$embed .= \"<embed type=\\\"$type\\\" style=\\\"cursor:hand; cursor:pointer;\\\" src=\\\"\" . $this->get_link() . \"\\\" width=\\\"$width\\\" height=\\\"$height\\\" autoplay=\\\"false\\\" target=\\\"myself\\\" controller=\\\"true\\\" loop=\\\"$loop\\\" scale=\\\"aspect\\\" bgcolor=\\\"$bgcolor\\\" pluginspage=\\\"http://apple.com/quicktime/download/\\\"></embed>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$embed .= \"<script type='text/javascript'>embed_quicktime('$type', '$bgcolor', '$width', '$height', '\" . $this->get_link() . \"', '$placeholder', '$loop');</script>\";\n\t\t\t}\n\t\t}\n\n\t\t// Windows Media\n\t\telseif ($handler === 'wmedia')\n\t\t{\n\t\t\t$height += 45;\n\t\t\tif ($native)\n\t\t\t{\n\t\t\t\t$embed .= \"<embed type=\\\"application/x-mplayer2\\\" src=\\\"\" . $this->get_link() . \"\\\" autosize=\\\"1\\\" width=\\\"$width\\\" height=\\\"$height\\\" showcontrols=\\\"1\\\" showstatusbar=\\\"0\\\" showdisplay=\\\"0\\\" autostart=\\\"0\\\"></embed>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$embed .= \"<script type='text/javascript'>embed_wmedia('$width', '$height', '\" . $this->get_link() . \"');</script>\";\n\t\t\t}\n\t\t}\n\n\t\t// Everything else\n\t\telse $embed .= '<a href=\"' . $this->get_link() . '\" class=\"' . $altclass . '\">' . $alt . '</a>';\n\n\t\treturn $embed;\n\t}\n\n\t/**\n\t * Get the real media type\n\t *\n\t * Often, feeds lie to us, necessitating a bit of deeper inspection. This\n\t * converts types to their canonical representations based on the file\n\t * extension\n\t *\n\t * @see get_type()\n\t * @param bool $find_handler Internal use only, use {@see get_handler()} instead\n\t * @return string MIME type\n\t */\n\tpublic function get_real_type($find_handler = false)\n\t{\n\t\t// Mime-types by handler.\n\t\t$types_flash = array('application/x-shockwave-flash', 'application/futuresplash'); // Flash\n\t\t$types_fmedia = array('video/flv', 'video/x-flv','flv-application/octet-stream'); // Flash Media Player\n\t\t$types_quicktime = array('audio/3gpp', 'audio/3gpp2', 'audio/aac', 'audio/x-aac', 'audio/aiff', 'audio/x-aiff', 'audio/mid', 'audio/midi', 'audio/x-midi', 'audio/mp4', 'audio/m4a', 'audio/x-m4a', 'audio/wav', 'audio/x-wav', 'video/3gpp', 'video/3gpp2', 'video/m4v', 'video/x-m4v', 'video/mp4', 'video/mpeg', 'video/x-mpeg', 'video/quicktime', 'video/sd-video'); // QuickTime\n\t\t$types_wmedia = array('application/asx', 'application/x-mplayer2', 'audio/x-ms-wma', 'audio/x-ms-wax', 'video/x-ms-asf-plugin', 'video/x-ms-asf', 'video/x-ms-wm', 'video/x-ms-wmv', 'video/x-ms-wvx'); // Windows Media\n\t\t$types_mp3 = array('audio/mp3', 'audio/x-mp3', 'audio/mpeg', 'audio/x-mpeg'); // MP3\n\n\t\tif ($this->get_type() !== null)\n\t\t{\n\t\t\t$type = strtolower($this->type);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$type = null;\n\t\t}\n\n\t\t// If we encounter an unsupported mime-type, check the file extension and guess intelligently.\n\t\tif (!in_array($type, array_merge($types_flash, $types_fmedia, $types_quicktime, $types_wmedia, $types_mp3)))\n\t\t{\n\t\t\tswitch (strtolower($this->get_extension()))\n\t\t\t{\n\t\t\t\t// Audio mime-types\n\t\t\t\tcase 'aac':\n\t\t\t\tcase 'adts':\n\t\t\t\t\t$type = 'audio/acc';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'aif':\n\t\t\t\tcase 'aifc':\n\t\t\t\tcase 'aiff':\n\t\t\t\tcase 'cdda':\n\t\t\t\t\t$type = 'audio/aiff';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'bwf':\n\t\t\t\t\t$type = 'audio/wav';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'kar':\n\t\t\t\tcase 'mid':\n\t\t\t\tcase 'midi':\n\t\t\t\tcase 'smf':\n\t\t\t\t\t$type = 'audio/midi';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'm4a':\n\t\t\t\t\t$type = 'audio/x-m4a';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'mp3':\n\t\t\t\tcase 'swa':\n\t\t\t\t\t$type = 'audio/mp3';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'wav':\n\t\t\t\t\t$type = 'audio/wav';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'wax':\n\t\t\t\t\t$type = 'audio/x-ms-wax';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'wma':\n\t\t\t\t\t$type = 'audio/x-ms-wma';\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Video mime-types\n\t\t\t\tcase '3gp':\n\t\t\t\tcase '3gpp':\n\t\t\t\t\t$type = 'video/3gpp';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '3g2':\n\t\t\t\tcase '3gp2':\n\t\t\t\t\t$type = 'video/3gpp2';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'asf':\n\t\t\t\t\t$type = 'video/x-ms-asf';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'flv':\n\t\t\t\t\t$type = 'video/x-flv';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'm1a':\n\t\t\t\tcase 'm1s':\n\t\t\t\tcase 'm1v':\n\t\t\t\tcase 'm15':\n\t\t\t\tcase 'm75':\n\t\t\t\tcase 'mp2':\n\t\t\t\tcase 'mpa':\n\t\t\t\tcase 'mpeg':\n\t\t\t\tcase 'mpg':\n\t\t\t\tcase 'mpm':\n\t\t\t\tcase 'mpv':\n\t\t\t\t\t$type = 'video/mpeg';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'm4v':\n\t\t\t\t\t$type = 'video/x-m4v';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'mov':\n\t\t\t\tcase 'qt':\n\t\t\t\t\t$type = 'video/quicktime';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'mp4':\n\t\t\t\tcase 'mpg4':\n\t\t\t\t\t$type = 'video/mp4';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'sdv':\n\t\t\t\t\t$type = 'video/sd-video';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'wm':\n\t\t\t\t\t$type = 'video/x-ms-wm';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'wmv':\n\t\t\t\t\t$type = 'video/x-ms-wmv';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'wvx':\n\t\t\t\t\t$type = 'video/x-ms-wvx';\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Flash mime-types\n\t\t\t\tcase 'spl':\n\t\t\t\t\t$type = 'application/futuresplash';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'swf':\n\t\t\t\t\t$type = 'application/x-shockwave-flash';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($find_handler)\n\t\t{\n\t\t\tif (in_array($type, $types_flash))\n\t\t\t{\n\t\t\t\treturn 'flash';\n\t\t\t}\n\t\t\telseif (in_array($type, $types_fmedia))\n\t\t\t{\n\t\t\t\treturn 'fmedia';\n\t\t\t}\n\t\t\telseif (in_array($type, $types_quicktime))\n\t\t\t{\n\t\t\t\treturn 'quicktime';\n\t\t\t}\n\t\t\telseif (in_array($type, $types_wmedia))\n\t\t\t{\n\t\t\t\treturn 'wmedia';\n\t\t\t}\n\t\t\telseif (in_array($type, $types_mp3))\n\t\t\t{\n\t\t\t\treturn 'mp3';\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $type;\n\t}\n}\n", "num_lines": 1305}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * General SimplePie exception class\n *\n * @package SimplePie\n */\nclass SimplePie_Exception extends Exception\n{\n}", "num_lines": 51}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Used for fetching remote files and reading local files\n *\n * Supports HTTP 1.0 via cURL or fsockopen, with spotty HTTP 1.1 support\n *\n * This class can be overloaded with {@see SimplePie::set_file_class()}\n *\n * @package SimplePie\n * @subpackage HTTP\n * @todo Move to properly supporting RFC2616 (HTTP/1.1)\n */\nclass SimplePie_File\n{\n\tvar $url;\n\tvar $useragent;\n\tvar $success = true;\n\tvar $headers = array();\n\tvar $body;\n\tvar $status_code;\n\tvar $redirects = 0;\n\tvar $error;\n\tvar $method = SIMPLEPIE_FILE_SOURCE_NONE;\n\tvar $permanent_url;\n\n\tpublic function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false, $curl_options = array())\n\t{\n\t\tif (class_exists('idna_convert'))\n\t\t{\n\t\t\t$idn = new idna_convert();\n\t\t\t$parsed = SimplePie_Misc::parse_url($url);\n\t\t\t$url = SimplePie_Misc::compress_parse_url($parsed['scheme'], $idn->encode($parsed['authority']), $parsed['path'], $parsed['query'], NULL);\n\t\t}\n\t\t$this->url = $url;\n\t\t$this->permanent_url = $url;\n\t\t$this->useragent = $useragent;\n\t\tif (preg_match('/^http(s)?:\\/\\//i', $url))\n\t\t{\n\t\t\tif ($useragent === null)\n\t\t\t{\n\t\t\t\t$useragent = ini_get('user_agent');\n\t\t\t\t$this->useragent = $useragent;\n\t\t\t}\n\t\t\tif (!is_array($headers))\n\t\t\t{\n\t\t\t\t$headers = array();\n\t\t\t}\n\t\t\tif (!$force_fsockopen && function_exists('curl_exec'))\n\t\t\t{\n\t\t\t\t$this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_CURL;\n\t\t\t\t$fp = curl_init();\n\t\t\t\t$headers2 = array();\n\t\t\t\tforeach ($headers as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$headers2[] = \"$key: $value\";\n\t\t\t\t}\n\t\t\t\tif (version_compare(SimplePie_Misc::get_curl_version(), '7.10.5', '>='))\n\t\t\t\t{\n\t\t\t\t\tcurl_setopt($fp, CURLOPT_ENCODING, '');\n\t\t\t\t}\n\t\t\t\tcurl_setopt($fp, CURLOPT_URL, $url);\n\t\t\t\tcurl_setopt($fp, CURLOPT_HEADER, 1);\n\t\t\t\tcurl_setopt($fp, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t\tcurl_setopt($fp, CURLOPT_FAILONERROR, 1);\n\t\t\t\tcurl_setopt($fp, CURLOPT_TIMEOUT, $timeout);\n\t\t\t\tcurl_setopt($fp, CURLOPT_CONNECTTIMEOUT, $timeout);\n\t\t\t\tcurl_setopt($fp, CURLOPT_REFERER, $url);\n\t\t\t\tcurl_setopt($fp, CURLOPT_USERAGENT, $useragent);\n\t\t\t\tcurl_setopt($fp, CURLOPT_HTTPHEADER, $headers2);\n\t\t\t\tif (!ini_get('open_basedir') && version_compare(SimplePie_Misc::get_curl_version(), '7.15.2', '>='))\n\t\t\t\t{\n\t\t\t\t\tcurl_setopt($fp, CURLOPT_FOLLOWLOCATION, 1);\n\t\t\t\t\tcurl_setopt($fp, CURLOPT_MAXREDIRS, $redirects);\n\t\t\t\t}\n\t\t\t\tforeach ($curl_options as $curl_param => $curl_value) {\n\t\t\t\t\tcurl_setopt($fp, $curl_param, $curl_value);\n\t\t\t\t}\n\n\t\t\t\t$this->headers = curl_exec($fp);\n\t\t\t\tif (curl_errno($fp) === 23 || curl_errno($fp) === 61)\n\t\t\t\t{\n\t\t\t\t\tcurl_setopt($fp, CURLOPT_ENCODING, 'none');\n\t\t\t\t\t$this->headers = curl_exec($fp);\n\t\t\t\t}\n\t\t\t\tif (curl_errno($fp))\n\t\t\t\t{\n\t\t\t\t\t$this->error = 'cURL error ' . curl_errno($fp) . ': ' . curl_error($fp);\n\t\t\t\t\t$this->success = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Use the updated url provided by curl_getinfo after any redirects.\n\t\t\t\t\tif ($info = curl_getinfo($fp)) {\n\t\t\t\t\t\t$this->url = $info['url'];\n\t\t\t\t\t}\n\t\t\t\t\tcurl_close($fp);\n\t\t\t\t\t$this->headers = SimplePie_HTTP_Parser::prepareHeaders($this->headers, $info['redirect_count'] + 1);\n\t\t\t\t\t$parser = new SimplePie_HTTP_Parser($this->headers);\n\t\t\t\t\tif ($parser->parse())\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->headers = $parser->headers;\n\t\t\t\t\t\t$this->body = trim($parser->body);\n\t\t\t\t\t\t$this->status_code = $parser->status_code;\n\t\t\t\t\t\tif ((in_array($this->status_code, array(300, 301, 302, 303, 307)) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->redirects++;\n\t\t\t\t\t\t\t$location = SimplePie_Misc::absolutize_url($this->headers['location'], $url);\n\t\t\t\t\t\t\t$previousStatusCode = $this->status_code;\n\t\t\t\t\t\t\t$this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen);\n\t\t\t\t\t\t\t$this->permanent_url = ($previousStatusCode == 301) ? $location : $url;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_FSOCKOPEN;\n\t\t\t\t$url_parts = parse_url($url);\n\t\t\t\t$socket_host = $url_parts['host'];\n\t\t\t\tif (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https')\n\t\t\t\t{\n\t\t\t\t\t$socket_host = \"ssl://$url_parts[host]\";\n\t\t\t\t\t$url_parts['port'] = 443;\n\t\t\t\t}\n\t\t\t\tif (!isset($url_parts['port']))\n\t\t\t\t{\n\t\t\t\t\t$url_parts['port'] = 80;\n\t\t\t\t}\n\t\t\t\t$fp = @fsockopen($socket_host, $url_parts['port'], $errno, $errstr, $timeout);\n\t\t\t\tif (!$fp)\n\t\t\t\t{\n\t\t\t\t\t$this->error = 'fsockopen error: ' . $errstr;\n\t\t\t\t\t$this->success = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tstream_set_timeout($fp, $timeout);\n\t\t\t\t\tif (isset($url_parts['path']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (isset($url_parts['query']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$get = \"$url_parts[path]?$url_parts[query]\";\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$get = $url_parts['path'];\n\t\t\t\t\t\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$get = '/';\n\t\t\t\t\t}\n\t\t\t\t\t$out = \"GET $get HTTP/1.1\\r\\n\";\n\t\t\t\t\t$out .= \"Host: $url_parts[host]\\r\\n\";\n\t\t\t\t\t$out .= \"User-Agent: $useragent\\r\\n\";\n\t\t\t\t\tif (extension_loaded('zlib'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$out .= \"Accept-Encoding: x-gzip,gzip,deflate\\r\\n\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($url_parts['user']) && isset($url_parts['pass']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$out .= \"Authorization: Basic \" . base64_encode(\"$url_parts[user]:$url_parts[pass]\") . \"\\r\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tforeach ($headers as $key => $value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$out .= \"$key: $value\\r\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t$out .= \"Connection: Close\\r\\n\\r\\n\";\n\t\t\t\t\tfwrite($fp, $out);\n\n\t\t\t\t\t$info = stream_get_meta_data($fp);\n\n\t\t\t\t\t$this->headers = '';\n\t\t\t\t\twhile (!$info['eof'] && !$info['timed_out'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->headers .= fread($fp, 1160);\n\t\t\t\t\t\t$info = stream_get_meta_data($fp);\n\t\t\t\t\t}\n\t\t\t\t\tif (!$info['timed_out'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$parser = new SimplePie_HTTP_Parser($this->headers);\n\t\t\t\t\t\tif ($parser->parse())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->headers = $parser->headers;\n\t\t\t\t\t\t\t$this->body = $parser->body;\n\t\t\t\t\t\t\t$this->status_code = $parser->status_code;\n\t\t\t\t\t\t\tif ((in_array($this->status_code, array(300, 301, 302, 303, 307)) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->redirects++;\n\t\t\t\t\t\t\t\t$location = SimplePie_Misc::absolutize_url($this->headers['location'], $url);\n\t\t\t\t\t\t\t\t$previousStatusCode = $this->status_code;\n\t\t\t\t\t\t\t\t$this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen);\n\t\t\t\t\t\t\t\t$this->permanent_url = ($previousStatusCode == 301) ? $location : $url;\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isset($this->headers['content-encoding']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Hey, we act dumb elsewhere, so let's do that here too\n\t\t\t\t\t\t\t\tswitch (strtolower(trim($this->headers['content-encoding'], \"\\x09\\x0A\\x0D\\x20\")))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcase 'gzip':\n\t\t\t\t\t\t\t\t\tcase 'x-gzip':\n\t\t\t\t\t\t\t\t\t\t$decoder = new SimplePie_gzdecode($this->body);\n\t\t\t\t\t\t\t\t\t\tif (!$decoder->parse())\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$this->error = 'Unable to decode HTTP \"gzip\" stream';\n\t\t\t\t\t\t\t\t\t\t\t$this->success = false;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$this->body = trim($decoder->data);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'deflate':\n\t\t\t\t\t\t\t\t\t\tif (($decompressed = gzinflate($this->body)) !== false)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$this->body = $decompressed;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (($decompressed = gzuncompress($this->body)) !== false)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$this->body = $decompressed;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (function_exists('gzdecode') && ($decompressed = gzdecode($this->body)) !== false)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$this->body = $decompressed;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$this->error = 'Unable to decode HTTP \"deflate\" stream';\n\t\t\t\t\t\t\t\t\t\t\t$this->success = false;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t$this->error = 'Unknown content coding';\n\t\t\t\t\t\t\t\t\t\t$this->success = false;\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\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->error = 'fsocket timed out';\n\t\t\t\t\t\t$this->success = false;\n\t\t\t\t\t}\n\t\t\t\t\tfclose($fp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->method = SIMPLEPIE_FILE_SOURCE_LOCAL | SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS;\n\t\t\tif (empty($url) || !($this->body = trim(file_get_contents($url))))\n\t\t\t{\n\t\t\t\t$this->error = 'file_get_contents could not read the file';\n\t\t\t\t$this->success = false;\n\t\t\t}\n\t\t}\n\t}\n}\n", "num_lines": 306}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n\n/**\n * Decode 'gzip' encoded HTTP data\n *\n * @package SimplePie\n * @subpackage HTTP\n * @link http://www.gzip.org/format.txt\n */\nclass SimplePie_gzdecode\n{\n\t/**\n\t * Compressed data\n\t *\n\t * @access private\n\t * @var string\n\t * @see gzdecode::$data\n\t */\n\tvar $compressed_data;\n\n\t/**\n\t * Size of compressed data\n\t *\n\t * @access private\n\t * @var int\n\t */\n\tvar $compressed_size;\n\n\t/**\n\t * Minimum size of a valid gzip string\n\t *\n\t * @access private\n\t * @var int\n\t */\n\tvar $min_compressed_size = 18;\n\n\t/**\n\t * Current position of pointer\n\t *\n\t * @access private\n\t * @var int\n\t */\n\tvar $position = 0;\n\n\t/**\n\t * Flags (FLG)\n\t *\n\t * @access private\n\t * @var int\n\t */\n\tvar $flags;\n\n\t/**\n\t * Uncompressed data\n\t *\n\t * @access public\n\t * @see gzdecode::$compressed_data\n\t * @var string\n\t */\n\tvar $data;\n\n\t/**\n\t * Modified time\n\t *\n\t * @access public\n\t * @var int\n\t */\n\tvar $MTIME;\n\n\t/**\n\t * Extra Flags\n\t *\n\t * @access public\n\t * @var int\n\t */\n\tvar $XFL;\n\n\t/**\n\t * Operating System\n\t *\n\t * @access public\n\t * @var int\n\t */\n\tvar $OS;\n\n\t/**\n\t * Subfield ID 1\n\t *\n\t * @access public\n\t * @see gzdecode::$extra_field\n\t * @see gzdecode::$SI2\n\t * @var string\n\t */\n\tvar $SI1;\n\n\t/**\n\t * Subfield ID 2\n\t *\n\t * @access public\n\t * @see gzdecode::$extra_field\n\t * @see gzdecode::$SI1\n\t * @var string\n\t */\n\tvar $SI2;\n\n\t/**\n\t * Extra field content\n\t *\n\t * @access public\n\t * @see gzdecode::$SI1\n\t * @see gzdecode::$SI2\n\t * @var string\n\t */\n\tvar $extra_field;\n\n\t/**\n\t * Original filename\n\t *\n\t * @access public\n\t * @var string\n\t */\n\tvar $filename;\n\n\t/**\n\t * Human readable comment\n\t *\n\t * @access public\n\t * @var string\n\t */\n\tvar $comment;\n\n\t/**\n\t * Don't allow anything to be set\n\t *\n\t * @param string $name\n\t * @param mixed $value\n\t */\n\tpublic function __set($name, $value)\n\t{\n\t\ttrigger_error(\"Cannot write property $name\", E_USER_ERROR);\n\t}\n\n\t/**\n\t * Set the compressed string and related properties\n\t *\n\t * @param string $data\n\t */\n\tpublic function __construct($data)\n\t{\n\t\t$this->compressed_data = $data;\n\t\t$this->compressed_size = strlen($data);\n\t}\n\n\t/**\n\t * Decode the GZIP stream\n\t *\n\t * @return bool Successfulness\n\t */\n\tpublic function parse()\n\t{\n\t\tif ($this->compressed_size >= $this->min_compressed_size)\n\t\t{\n\t\t\t// Check ID1, ID2, and CM\n\t\t\tif (substr($this->compressed_data, 0, 3) !== \"\\x1F\\x8B\\x08\")\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Get the FLG (FLaGs)\n\t\t\t$this->flags = ord($this->compressed_data[3]);\n\n\t\t\t// FLG bits above (1 << 4) are reserved\n\t\t\tif ($this->flags > 0x1F)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Advance the pointer after the above\n\t\t\t$this->position += 4;\n\n\t\t\t// MTIME\n\t\t\t$mtime = substr($this->compressed_data, $this->position, 4);\n\t\t\t// Reverse the string if we're on a big-endian arch because l is the only signed long and is machine endianness\n\t\t\tif (current(unpack('S', \"\\x00\\x01\")) === 1)\n\t\t\t{\n\t\t\t\t$mtime = strrev($mtime);\n\t\t\t}\n\t\t\t$this->MTIME = current(unpack('l', $mtime));\n\t\t\t$this->position += 4;\n\n\t\t\t// Get the XFL (eXtra FLags)\n\t\t\t$this->XFL = ord($this->compressed_data[$this->position++]);\n\n\t\t\t// Get the OS (Operating System)\n\t\t\t$this->OS = ord($this->compressed_data[$this->position++]);\n\n\t\t\t// Parse the FEXTRA\n\t\t\tif ($this->flags & 4)\n\t\t\t{\n\t\t\t\t// Read subfield IDs\n\t\t\t\t$this->SI1 = $this->compressed_data[$this->position++];\n\t\t\t\t$this->SI2 = $this->compressed_data[$this->position++];\n\n\t\t\t\t// SI2 set to zero is reserved for future use\n\t\t\t\tif ($this->SI2 === \"\\x00\")\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Get the length of the extra field\n\t\t\t\t$len = current(unpack('v', substr($this->compressed_data, $this->position, 2)));\n\t\t\t\t$this->position += 2;\n\n\t\t\t\t// Check the length of the string is still valid\n\t\t\t\t$this->min_compressed_size += $len + 4;\n\t\t\t\tif ($this->compressed_size >= $this->min_compressed_size)\n\t\t\t\t{\n\t\t\t\t\t// Set the extra field to the given data\n\t\t\t\t\t$this->extra_field = substr($this->compressed_data, $this->position, $len);\n\t\t\t\t\t$this->position += $len;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Parse the FNAME\n\t\t\tif ($this->flags & 8)\n\t\t\t{\n\t\t\t\t// Get the length of the filename\n\t\t\t\t$len = strcspn($this->compressed_data, \"\\x00\", $this->position);\n\n\t\t\t\t// Check the length of the string is still valid\n\t\t\t\t$this->min_compressed_size += $len + 1;\n\t\t\t\tif ($this->compressed_size >= $this->min_compressed_size)\n\t\t\t\t{\n\t\t\t\t\t// Set the original filename to the given string\n\t\t\t\t\t$this->filename = substr($this->compressed_data, $this->position, $len);\n\t\t\t\t\t$this->position += $len + 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Parse the FCOMMENT\n\t\t\tif ($this->flags & 16)\n\t\t\t{\n\t\t\t\t// Get the length of the comment\n\t\t\t\t$len = strcspn($this->compressed_data, \"\\x00\", $this->position);\n\n\t\t\t\t// Check the length of the string is still valid\n\t\t\t\t$this->min_compressed_size += $len + 1;\n\t\t\t\tif ($this->compressed_size >= $this->min_compressed_size)\n\t\t\t\t{\n\t\t\t\t\t// Set the original comment to the given string\n\t\t\t\t\t$this->comment = substr($this->compressed_data, $this->position, $len);\n\t\t\t\t\t$this->position += $len + 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Parse the FHCRC\n\t\t\tif ($this->flags & 2)\n\t\t\t{\n\t\t\t\t// Check the length of the string is still valid\n\t\t\t\t$this->min_compressed_size += $len + 2;\n\t\t\t\tif ($this->compressed_size >= $this->min_compressed_size)\n\t\t\t\t{\n\t\t\t\t\t// Read the CRC\n\t\t\t\t\t$crc = current(unpack('v', substr($this->compressed_data, $this->position, 2)));\n\n\t\t\t\t\t// Check the CRC matches\n\t\t\t\t\tif ((crc32(substr($this->compressed_data, 0, $this->position)) & 0xFFFF) === $crc)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->position += 2;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\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\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Decompress the actual data\n\t\t\tif (($this->data = gzinflate(substr($this->compressed_data, $this->position, -8))) === false)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$this->position = $this->compressed_size - 8;\n\n\t\t\t// Check CRC of data\n\t\t\t$crc = current(unpack('V', substr($this->compressed_data, $this->position, 4)));\n\t\t\t$this->position += 4;\n\t\t\t/*if (extension_loaded('hash') && sprintf('%u', current(unpack('V', hash('crc32b', $this->data)))) !== sprintf('%u', $crc))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}*/\n\n\t\t\t// Check ISIZE of data\n\t\t\t$isize = current(unpack('V', substr($this->compressed_data, $this->position, 4)));\n\t\t\t$this->position += 4;\n\t\t\tif (sprintf('%u', strlen($this->data) & 0xFFFFFFFF) !== sprintf('%u', $isize))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Wow, against all odds, we've actually got a valid gzip string\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n}\n", "num_lines": 367}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * IRI parser/serialiser/normaliser\n *\n * @package SimplePie\n * @subpackage HTTP\n * @author Sam Sneddon\n * @author Steve Minutillo\n * @author Ryan McCue\n * @copyright 2007-2012 Sam Sneddon, Steve Minutillo, Ryan McCue\n * @license http://www.opensource.org/licenses/bsd-license.php\n */\nclass SimplePie_IRI\n{\n\t/**\n\t * Scheme\n\t *\n\t * @var string\n\t */\n\tprotected $scheme = null;\n\n\t/**\n\t * User Information\n\t *\n\t * @var string\n\t */\n\tprotected $iuserinfo = null;\n\n\t/**\n\t * ihost\n\t *\n\t * @var string\n\t */\n\tprotected $ihost = null;\n\n\t/**\n\t * Port\n\t *\n\t * @var string\n\t */\n\tprotected $port = null;\n\n\t/**\n\t * ipath\n\t *\n\t * @var string\n\t */\n\tprotected $ipath = '';\n\n\t/**\n\t * iquery\n\t *\n\t * @var string\n\t */\n\tprotected $iquery = null;\n\n\t/**\n\t * ifragment\n\t *\n\t * @var string\n\t */\n\tprotected $ifragment = null;\n\n\t/**\n\t * Normalization database\n\t *\n\t * Each key is the scheme, each value is an array with each key as the IRI\n\t * part and value as the default value for that part.\n\t */\n\tprotected $normalization = array(\n\t\t'acap' => array(\n\t\t\t'port' => 674\n\t\t),\n\t\t'dict' => array(\n\t\t\t'port' => 2628\n\t\t),\n\t\t'file' => array(\n\t\t\t'ihost' => 'localhost'\n\t\t),\n\t\t'http' => array(\n\t\t\t'port' => 80,\n\t\t\t'ipath' => '/'\n\t\t),\n\t\t'https' => array(\n\t\t\t'port' => 443,\n\t\t\t'ipath' => '/'\n\t\t),\n\t);\n\n\t/**\n\t * Return the entire IRI when you try and read the object as a string\n\t *\n\t * @return string\n\t */\n\tpublic function __toString()\n\t{\n\t\treturn $this->get_iri();\n\t}\n\n\t/**\n\t * Overload __set() to provide access via properties\n\t *\n\t * @param string $name Property name\n\t * @param mixed $value Property value\n\t */\n\tpublic function __set($name, $value)\n\t{\n\t\tif (method_exists($this, 'set_' . $name))\n\t\t{\n\t\t\tcall_user_func(array($this, 'set_' . $name), $value);\n\t\t}\n\t\telseif (\n\t\t\t   $name === 'iauthority'\n\t\t\t|| $name === 'iuserinfo'\n\t\t\t|| $name === 'ihost'\n\t\t\t|| $name === 'ipath'\n\t\t\t|| $name === 'iquery'\n\t\t\t|| $name === 'ifragment'\n\t\t)\n\t\t{\n\t\t\tcall_user_func(array($this, 'set_' . substr($name, 1)), $value);\n\t\t}\n\t}\n\n\t/**\n\t * Overload __get() to provide access via properties\n\t *\n\t * @param string $name Property name\n\t * @return mixed\n\t */\n\tpublic function __get($name)\n\t{\n\t\t// isset() returns false for null, we don't want to do that\n\t\t// Also why we use array_key_exists below instead of isset()\n\t\t$props = get_object_vars($this);\n\n\t\tif (\n\t\t\t$name === 'iri' ||\n\t\t\t$name === 'uri' ||\n\t\t\t$name === 'iauthority' ||\n\t\t\t$name === 'authority'\n\t\t)\n\t\t{\n\t\t\t$return = $this->{\"get_$name\"}();\n\t\t}\n\t\telseif (array_key_exists($name, $props))\n\t\t{\n\t\t\t$return = $this->$name;\n\t\t}\n\t\t// host -> ihost\n\t\telseif (($prop = 'i' . $name) && array_key_exists($prop, $props))\n\t\t{\n\t\t\t$name = $prop;\n\t\t\t$return = $this->$prop;\n\t\t}\n\t\t// ischeme -> scheme\n\t\telseif (($prop = substr($name, 1)) && array_key_exists($prop, $props))\n\t\t{\n\t\t\t$name = $prop;\n\t\t\t$return = $this->$prop;\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttrigger_error('Undefined property: ' . get_class($this) . '::' . $name, E_USER_NOTICE);\n\t\t\t$return = null;\n\t\t}\n\n\t\tif ($return === null && isset($this->normalization[$this->scheme][$name]))\n\t\t{\n\t\t\treturn $this->normalization[$this->scheme][$name];\n\t\t}\n\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Overload __isset() to provide access via properties\n\t *\n\t * @param string $name Property name\n\t * @return bool\n\t */\n\tpublic function __isset($name)\n\t{\n\t\treturn method_exists($this, 'get_' . $name) || isset($this->$name);\n\t}\n\n\t/**\n\t * Overload __unset() to provide access via properties\n\t *\n\t * @param string $name Property name\n\t */\n\tpublic function __unset($name)\n\t{\n\t\tif (method_exists($this, 'set_' . $name))\n\t\t{\n\t\t\tcall_user_func(array($this, 'set_' . $name), '');\n\t\t}\n\t}\n\n\t/**\n\t * Create a new IRI object, from a specified string\n\t *\n\t * @param string $iri\n\t */\n\tpublic function __construct($iri = null)\n\t{\n\t\t$this->set_iri($iri);\n\t}\n\n\t/**\n\t * Clean up\n\t */\n\tpublic function __destruct() {\n\t    $this->set_iri(null, true);\n\t    $this->set_path(null, true);\n\t    $this->set_authority(null, true);\n\t}\n\n\t/**\n\t * Create a new IRI object by resolving a relative IRI\n\t *\n\t * Returns false if $base is not absolute, otherwise an IRI.\n\t *\n\t * @param IRI|string $base (Absolute) Base IRI\n\t * @param IRI|string $relative Relative IRI\n\t * @return IRI|false\n\t */\n\tpublic static function absolutize($base, $relative)\n\t{\n\t\tif (!($relative instanceof SimplePie_IRI))\n\t\t{\n\t\t\t$relative = new SimplePie_IRI($relative);\n\t\t}\n\t\tif (!$relative->is_valid())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telseif ($relative->scheme !== null)\n\t\t{\n\t\t\treturn clone $relative;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!($base instanceof SimplePie_IRI))\n\t\t\t{\n\t\t\t\t$base = new SimplePie_IRI($base);\n\t\t\t}\n\t\t\tif ($base->scheme !== null && $base->is_valid())\n\t\t\t{\n\t\t\t\tif ($relative->get_iri() !== '')\n\t\t\t\t{\n\t\t\t\t\tif ($relative->iuserinfo !== null || $relative->ihost !== null || $relative->port !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\t$target = clone $relative;\n\t\t\t\t\t\t$target->scheme = $base->scheme;\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$target = new SimplePie_IRI;\n\t\t\t\t\t\t$target->scheme = $base->scheme;\n\t\t\t\t\t\t$target->iuserinfo = $base->iuserinfo;\n\t\t\t\t\t\t$target->ihost = $base->ihost;\n\t\t\t\t\t\t$target->port = $base->port;\n\t\t\t\t\t\tif ($relative->ipath !== '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($relative->ipath[0] === '/')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$target->ipath = $relative->ipath;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$target->ipath = '/' . $relative->ipath;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (($last_segment = strrpos($base->ipath, '/')) !== false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$target->ipath = substr($base->ipath, 0, $last_segment + 1) . $relative->ipath;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$target->ipath = $relative->ipath;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$target->ipath = $target->remove_dot_segments($target->ipath);\n\t\t\t\t\t\t\t$target->iquery = $relative->iquery;\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$target->ipath = $base->ipath;\n\t\t\t\t\t\t\tif ($relative->iquery !== null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$target->iquery = $relative->iquery;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif ($base->iquery !== null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$target->iquery = $base->iquery;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$target->ifragment = $relative->ifragment;\n\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$target = clone $base;\n\t\t\t\t\t$target->ifragment = null;\n\t\t\t\t}\n\t\t\t\t$target->scheme_normalization();\n\t\t\t\treturn $target;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Parse an IRI into scheme/authority/path/query/fragment segments\n\t *\n\t * @param string $iri\n\t * @return array\n\t */\n\tprotected function parse_iri($iri)\n\t{\n\t\t$iri = trim($iri, \"\\x20\\x09\\x0A\\x0C\\x0D\");\n\t\tif (preg_match('/^((?P<scheme>[^:\\/?#]+):)?(\\/\\/(?P<authority>[^\\/?#]*))?(?P<path>[^?#]*)(\\?(?P<query>[^#]*))?(#(?P<fragment>.*))?$/', $iri, $match))\n\t\t{\n\t\t\tif ($match[1] === '')\n\t\t\t{\n\t\t\t\t$match['scheme'] = null;\n\t\t\t}\n\t\t\tif (!isset($match[3]) || $match[3] === '')\n\t\t\t{\n\t\t\t\t$match['authority'] = null;\n\t\t\t}\n\t\t\tif (!isset($match[5]))\n\t\t\t{\n\t\t\t\t$match['path'] = '';\n\t\t\t}\n\t\t\tif (!isset($match[6]) || $match[6] === '')\n\t\t\t{\n\t\t\t\t$match['query'] = null;\n\t\t\t}\n\t\t\tif (!isset($match[8]) || $match[8] === '')\n\t\t\t{\n\t\t\t\t$match['fragment'] = null;\n\t\t\t}\n\t\t\treturn $match;\n\t\t}\n\n\t\t// This can occur when a paragraph is accidentally parsed as a URI\n\t\treturn false;\n\t}\n\n\t/**\n\t * Remove dot segments from a path\n\t *\n\t * @param string $input\n\t * @return string\n\t */\n\tprotected function remove_dot_segments($input)\n\t{\n\t\t$output = '';\n\t\twhile (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..')\n\t\t{\n\t\t\t// A: If the input buffer begins with a prefix of \"../\" or \"./\", then remove that prefix from the input buffer; otherwise,\n\t\t\tif (strpos($input, '../') === 0)\n\t\t\t{\n\t\t\t\t$input = substr($input, 3);\n\t\t\t}\n\t\t\telseif (strpos($input, './') === 0)\n\t\t\t{\n\t\t\t\t$input = substr($input, 2);\n\t\t\t}\n\t\t\t// B: if the input buffer begins with a prefix of \"/./\" or \"/.\", where \".\" is a complete path segment, then replace that prefix with \"/\" in the input buffer; otherwise,\n\t\t\telseif (strpos($input, '/./') === 0)\n\t\t\t{\n\t\t\t\t$input = substr($input, 2);\n\t\t\t}\n\t\t\telseif ($input === '/.')\n\t\t\t{\n\t\t\t\t$input = '/';\n\t\t\t}\n\t\t\t// C: if the input buffer begins with a prefix of \"/../\" or \"/..\", where \"..\" is a complete path segment, then replace that prefix with \"/\" in the input buffer and remove the last segment and its preceding \"/\" (if any) from the output buffer; otherwise,\n\t\t\telseif (strpos($input, '/../') === 0)\n\t\t\t{\n\t\t\t\t$input = substr($input, 3);\n\t\t\t\t$output = substr_replace($output, '', strrpos($output, '/'));\n\t\t\t}\n\t\t\telseif ($input === '/..')\n\t\t\t{\n\t\t\t\t$input = '/';\n\t\t\t\t$output = substr_replace($output, '', strrpos($output, '/'));\n\t\t\t}\n\t\t\t// D: if the input buffer consists only of \".\" or \"..\", then remove that from the input buffer; otherwise,\n\t\t\telseif ($input === '.' || $input === '..')\n\t\t\t{\n\t\t\t\t$input = '';\n\t\t\t}\n\t\t\t// E: move the first path segment in the input buffer to the end of the output buffer, including the initial \"/\" character (if any) and any subsequent characters up to, but not including, the next \"/\" character or the end of the input buffer\n\t\t\telseif (($pos = strpos($input, '/', 1)) !== false)\n\t\t\t{\n\t\t\t\t$output .= substr($input, 0, $pos);\n\t\t\t\t$input = substr_replace($input, '', 0, $pos);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$output .= $input;\n\t\t\t\t$input = '';\n\t\t\t}\n\t\t}\n\t\treturn $output . $input;\n\t}\n\n\t/**\n\t * Replace invalid character with percent encoding\n\t *\n\t * @param string $string Input string\n\t * @param string $extra_chars Valid characters not in iunreserved or\n\t *                            iprivate (this is ASCII-only)\n\t * @param bool $iprivate Allow iprivate\n\t * @return string\n\t */\n\tprotected function replace_invalid_with_pct_encoding($string, $extra_chars, $iprivate = false)\n\t{\n\t\t// Normalize as many pct-encoded sections as possible\n\t\t$string = preg_replace_callback('/(?:%[A-Fa-f0-9]{2})+/', array($this, 'remove_iunreserved_percent_encoded'), $string);\n\n\t\t// Replace invalid percent characters\n\t\t$string = preg_replace('/%(?![A-Fa-f0-9]{2})/', '%25', $string);\n\n\t\t// Add unreserved and % to $extra_chars (the latter is safe because all\n\t\t// pct-encoded sections are now valid).\n\t\t$extra_chars .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~%';\n\n\t\t// Now replace any bytes that aren't allowed with their pct-encoded versions\n\t\t$position = 0;\n\t\t$strlen = strlen($string);\n\t\twhile (($position += strspn($string, $extra_chars, $position)) < $strlen)\n\t\t{\n\t\t\t$value = ord($string[$position]);\n\n\t\t\t// Start position\n\t\t\t$start = $position;\n\n\t\t\t// By default we are valid\n\t\t\t$valid = true;\n\n\t\t\t// No one byte sequences are valid due to the while.\n\t\t\t// Two byte sequence:\n\t\t\tif (($value & 0xE0) === 0xC0)\n\t\t\t{\n\t\t\t\t$character = ($value & 0x1F) << 6;\n\t\t\t\t$length = 2;\n\t\t\t\t$remaining = 1;\n\t\t\t}\n\t\t\t// Three byte sequence:\n\t\t\telseif (($value & 0xF0) === 0xE0)\n\t\t\t{\n\t\t\t\t$character = ($value & 0x0F) << 12;\n\t\t\t\t$length = 3;\n\t\t\t\t$remaining = 2;\n\t\t\t}\n\t\t\t// Four byte sequence:\n\t\t\telseif (($value & 0xF8) === 0xF0)\n\t\t\t{\n\t\t\t\t$character = ($value & 0x07) << 18;\n\t\t\t\t$length = 4;\n\t\t\t\t$remaining = 3;\n\t\t\t}\n\t\t\t// Invalid byte:\n\t\t\telse\n\t\t\t{\n\t\t\t\t$valid = false;\n\t\t\t\t$length = 1;\n\t\t\t\t$remaining = 0;\n\t\t\t}\n\n\t\t\tif ($remaining)\n\t\t\t{\n\t\t\t\tif ($position + $length <= $strlen)\n\t\t\t\t{\n\t\t\t\t\tfor ($position++; $remaining; $position++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$value = ord($string[$position]);\n\n\t\t\t\t\t\t// Check that the byte is valid, then add it to the character:\n\t\t\t\t\t\tif (($value & 0xC0) === 0x80)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$character |= ($value & 0x3F) << (--$remaining * 6);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If it is invalid, count the sequence as invalid and reprocess the current byte:\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$valid = false;\n\t\t\t\t\t\t\t$position--;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\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$position = $strlen - 1;\n\t\t\t\t\t$valid = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Percent encode anything invalid or not in ucschar\n\t\t\tif (\n\t\t\t\t// Invalid sequences\n\t\t\t\t!$valid\n\t\t\t\t// Non-shortest form sequences are invalid\n\t\t\t\t|| $length > 1 && $character <= 0x7F\n\t\t\t\t|| $length > 2 && $character <= 0x7FF\n\t\t\t\t|| $length > 3 && $character <= 0xFFFF\n\t\t\t\t// Outside of range of ucschar codepoints\n\t\t\t\t// Noncharacters\n\t\t\t\t|| ($character & 0xFFFE) === 0xFFFE\n\t\t\t\t|| $character >= 0xFDD0 && $character <= 0xFDEF\n\t\t\t\t|| (\n\t\t\t\t\t// Everything else not in ucschar\n\t\t\t\t\t   $character > 0xD7FF && $character < 0xF900\n\t\t\t\t\t|| $character < 0xA0\n\t\t\t\t\t|| $character > 0xEFFFD\n\t\t\t\t)\n\t\t\t\t&& (\n\t\t\t\t\t// Everything not in iprivate, if it applies\n\t\t\t\t\t   !$iprivate\n\t\t\t\t\t|| $character < 0xE000\n\t\t\t\t\t|| $character > 0x10FFFD\n\t\t\t\t)\n\t\t\t)\n\t\t\t{\n\t\t\t\t// If we were a character, pretend we weren't, but rather an error.\n\t\t\t\tif ($valid)\n\t\t\t\t\t$position--;\n\n\t\t\t\tfor ($j = $start; $j <= $position; $j++)\n\t\t\t\t{\n\t\t\t\t\t$string = substr_replace($string, sprintf('%%%02X', ord($string[$j])), $j, 1);\n\t\t\t\t\t$j += 2;\n\t\t\t\t\t$position += 2;\n\t\t\t\t\t$strlen += 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $string;\n\t}\n\n\t/**\n\t * Callback function for preg_replace_callback.\n\t *\n\t * Removes sequences of percent encoded bytes that represent UTF-8\n\t * encoded characters in iunreserved\n\t *\n\t * @param array $match PCRE match\n\t * @return string Replacement\n\t */\n\tprotected function remove_iunreserved_percent_encoded($match)\n\t{\n\t\t// As we just have valid percent encoded sequences we can just explode\n\t\t// and ignore the first member of the returned array (an empty string).\n\t\t$bytes = explode('%', $match[0]);\n\n\t\t// Initialize the new string (this is what will be returned) and that\n\t\t// there are no bytes remaining in the current sequence (unsurprising\n\t\t// at the first byte!).\n\t\t$string = '';\n\t\t$remaining = 0;\n\n\t\t// Loop over each and every byte, and set $value to its value\n\t\tfor ($i = 1, $len = count($bytes); $i < $len; $i++)\n\t\t{\n\t\t\t$value = hexdec($bytes[$i]);\n\n\t\t\t// If we're the first byte of sequence:\n\t\t\tif (!$remaining)\n\t\t\t{\n\t\t\t\t// Start position\n\t\t\t\t$start = $i;\n\n\t\t\t\t// By default we are valid\n\t\t\t\t$valid = true;\n\n\t\t\t\t// One byte sequence:\n\t\t\t\tif ($value <= 0x7F)\n\t\t\t\t{\n\t\t\t\t\t$character = $value;\n\t\t\t\t\t$length = 1;\n\t\t\t\t}\n\t\t\t\t// Two byte sequence:\n\t\t\t\telseif (($value & 0xE0) === 0xC0)\n\t\t\t\t{\n\t\t\t\t\t$character = ($value & 0x1F) << 6;\n\t\t\t\t\t$length = 2;\n\t\t\t\t\t$remaining = 1;\n\t\t\t\t}\n\t\t\t\t// Three byte sequence:\n\t\t\t\telseif (($value & 0xF0) === 0xE0)\n\t\t\t\t{\n\t\t\t\t\t$character = ($value & 0x0F) << 12;\n\t\t\t\t\t$length = 3;\n\t\t\t\t\t$remaining = 2;\n\t\t\t\t}\n\t\t\t\t// Four byte sequence:\n\t\t\t\telseif (($value & 0xF8) === 0xF0)\n\t\t\t\t{\n\t\t\t\t\t$character = ($value & 0x07) << 18;\n\t\t\t\t\t$length = 4;\n\t\t\t\t\t$remaining = 3;\n\t\t\t\t}\n\t\t\t\t// Invalid byte:\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$valid = false;\n\t\t\t\t\t$remaining = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Continuation byte:\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Check that the byte is valid, then add it to the character:\n\t\t\t\tif (($value & 0xC0) === 0x80)\n\t\t\t\t{\n\t\t\t\t\t$remaining--;\n\t\t\t\t\t$character |= ($value & 0x3F) << ($remaining * 6);\n\t\t\t\t}\n\t\t\t\t// If it is invalid, count the sequence as invalid and reprocess the current byte as the start of a sequence:\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$valid = false;\n\t\t\t\t\t$remaining = 0;\n\t\t\t\t\t$i--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we've reached the end of the current byte sequence, append it to Unicode::$data\n\t\t\tif (!$remaining)\n\t\t\t{\n\t\t\t\t// Percent encode anything invalid or not in iunreserved\n\t\t\t\tif (\n\t\t\t\t\t// Invalid sequences\n\t\t\t\t\t!$valid\n\t\t\t\t\t// Non-shortest form sequences are invalid\n\t\t\t\t\t|| $length > 1 && $character <= 0x7F\n\t\t\t\t\t|| $length > 2 && $character <= 0x7FF\n\t\t\t\t\t|| $length > 3 && $character <= 0xFFFF\n\t\t\t\t\t// Outside of range of iunreserved codepoints\n\t\t\t\t\t|| $character < 0x2D\n\t\t\t\t\t|| $character > 0xEFFFD\n\t\t\t\t\t// Noncharacters\n\t\t\t\t\t|| ($character & 0xFFFE) === 0xFFFE\n\t\t\t\t\t|| $character >= 0xFDD0 && $character <= 0xFDEF\n\t\t\t\t\t// Everything else not in iunreserved (this is all BMP)\n\t\t\t\t\t|| $character === 0x2F\n\t\t\t\t\t|| $character > 0x39 && $character < 0x41\n\t\t\t\t\t|| $character > 0x5A && $character < 0x61\n\t\t\t\t\t|| $character > 0x7A && $character < 0x7E\n\t\t\t\t\t|| $character > 0x7E && $character < 0xA0\n\t\t\t\t\t|| $character > 0xD7FF && $character < 0xF900\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\tfor ($j = $start; $j <= $i; $j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$string .= '%' . strtoupper($bytes[$j]);\n\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\tfor ($j = $start; $j <= $i; $j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$string .= chr(hexdec($bytes[$j]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If we have any bytes left over they are invalid (i.e., we are\n\t\t// mid-way through a multi-byte sequence)\n\t\tif ($remaining)\n\t\t{\n\t\t\tfor ($j = $start; $j < $len; $j++)\n\t\t\t{\n\t\t\t\t$string .= '%' . strtoupper($bytes[$j]);\n\t\t\t}\n\t\t}\n\n\t\treturn $string;\n\t}\n\n\tprotected function scheme_normalization()\n\t{\n\t\tif (isset($this->normalization[$this->scheme]['iuserinfo']) && $this->iuserinfo === $this->normalization[$this->scheme]['iuserinfo'])\n\t\t{\n\t\t\t$this->iuserinfo = null;\n\t\t}\n\t\tif (isset($this->normalization[$this->scheme]['ihost']) && $this->ihost === $this->normalization[$this->scheme]['ihost'])\n\t\t{\n\t\t\t$this->ihost = null;\n\t\t}\n\t\tif (isset($this->normalization[$this->scheme]['port']) && $this->port === $this->normalization[$this->scheme]['port'])\n\t\t{\n\t\t\t$this->port = null;\n\t\t}\n\t\tif (isset($this->normalization[$this->scheme]['ipath']) && $this->ipath === $this->normalization[$this->scheme]['ipath'])\n\t\t{\n\t\t\t$this->ipath = '';\n\t\t}\n\t\tif (isset($this->normalization[$this->scheme]['iquery']) && $this->iquery === $this->normalization[$this->scheme]['iquery'])\n\t\t{\n\t\t\t$this->iquery = null;\n\t\t}\n\t\tif (isset($this->normalization[$this->scheme]['ifragment']) && $this->ifragment === $this->normalization[$this->scheme]['ifragment'])\n\t\t{\n\t\t\t$this->ifragment = null;\n\t\t}\n\t}\n\n\t/**\n\t * Check if the object represents a valid IRI. This needs to be done on each\n\t * call as some things change depending on another part of the IRI.\n\t *\n\t * @return bool\n\t */\n\tpublic function is_valid()\n\t{\n\t\tif ($this->ipath === '') return true;\n\n\t\t$isauthority = $this->iuserinfo !== null || $this->ihost !== null ||\n\t\t\t$this->port !== null;\n\t\tif ($isauthority && $this->ipath[0] === '/') return true;\n\n\t\tif (!$isauthority && (substr($this->ipath, 0, 2) === '//')) return false;\n\n\t\t// Relative urls cannot have a colon in the first path segment (and the\n\t\t// slashes themselves are not included so skip the first character).\n\t\tif (!$this->scheme && !$isauthority &&\n\t\t    strpos($this->ipath, ':') !== false &&\n\t\t    strpos($this->ipath, '/', 1) !== false &&\n\t\t    strpos($this->ipath, ':') < strpos($this->ipath, '/', 1)) return false;\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set the entire IRI. Returns true on success, false on failure (if there\n\t * are any invalid characters).\n\t *\n\t * @param string $iri\n\t * @return bool\n\t */\n\tpublic function set_iri($iri, $clear_cache = false)\n\t{\n\t\tstatic $cache;\n\t\tif ($clear_cache)\n\t\t{\n\t\t\t$cache = null;\n\t\t\treturn;\n\t\t}\n\t\tif (!$cache)\n\t\t{\n\t\t\t$cache = array();\n\t\t}\n\n\t\tif ($iri === null)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telseif (isset($cache[$iri]))\n\t\t{\n\t\t\tlist($this->scheme,\n\t\t\t\t $this->iuserinfo,\n\t\t\t\t $this->ihost,\n\t\t\t\t $this->port,\n\t\t\t\t $this->ipath,\n\t\t\t\t $this->iquery,\n\t\t\t\t $this->ifragment,\n\t\t\t\t $return) = $cache[$iri];\n\t\t\treturn $return;\n\t\t}\n\n\t\t$parsed = $this->parse_iri((string) $iri);\n\t\tif (!$parsed)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$return = $this->set_scheme($parsed['scheme'])\n\t\t\t&& $this->set_authority($parsed['authority'])\n\t\t\t&& $this->set_path($parsed['path'])\n\t\t\t&& $this->set_query($parsed['query'])\n\t\t\t&& $this->set_fragment($parsed['fragment']);\n\n\t\t$cache[$iri] = array($this->scheme,\n\t\t\t\t\t\t\t $this->iuserinfo,\n\t\t\t\t\t\t\t $this->ihost,\n\t\t\t\t\t\t\t $this->port,\n\t\t\t\t\t\t\t $this->ipath,\n\t\t\t\t\t\t\t $this->iquery,\n\t\t\t\t\t\t\t $this->ifragment,\n\t\t\t\t\t\t\t $return);\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Set the scheme. Returns true on success, false on failure (if there are\n\t * any invalid characters).\n\t *\n\t * @param string $scheme\n\t * @return bool\n\t */\n\tpublic function set_scheme($scheme)\n\t{\n\t\tif ($scheme === null)\n\t\t{\n\t\t\t$this->scheme = null;\n\t\t}\n\t\telseif (!preg_match('/^[A-Za-z][0-9A-Za-z+\\-.]*$/', $scheme))\n\t\t{\n\t\t\t$this->scheme = null;\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->scheme = strtolower($scheme);\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set the authority. Returns true on success, false on failure (if there are\n\t * any invalid characters).\n\t *\n\t * @param string $authority\n\t * @return bool\n\t */\n\tpublic function set_authority($authority, $clear_cache = false)\n\t{\n\t\tstatic $cache;\n\t\tif ($clear_cache)\n\t\t{\n\t\t\t$cache = null;\n\t\t\treturn;\n\t\t}\n\t\tif (!$cache)\n\t\t\t$cache = array();\n\n\t\tif ($authority === null)\n\t\t{\n\t\t\t$this->iuserinfo = null;\n\t\t\t$this->ihost = null;\n\t\t\t$this->port = null;\n\t\t\treturn true;\n\t\t}\n\t\telseif (isset($cache[$authority]))\n\t\t{\n\t\t\tlist($this->iuserinfo,\n\t\t\t\t $this->ihost,\n\t\t\t\t $this->port,\n\t\t\t\t $return) = $cache[$authority];\n\n\t\t\treturn $return;\n\t\t}\n\n\t\t$remaining = $authority;\n\t\tif (($iuserinfo_end = strrpos($remaining, '@')) !== false)\n\t\t{\n\t\t\t$iuserinfo = substr($remaining, 0, $iuserinfo_end);\n\t\t\t$remaining = substr($remaining, $iuserinfo_end + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$iuserinfo = null;\n\t\t}\n\t\tif (($port_start = strpos($remaining, ':', strpos($remaining, ']'))) !== false)\n\t\t{\n\t\t\tif (($port = substr($remaining, $port_start + 1)) === false)\n\t\t\t{\n\t\t\t\t$port = null;\n\t\t\t}\n\t\t\t$remaining = substr($remaining, 0, $port_start);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$port = null;\n\t\t}\n\n\t\t$return = $this->set_userinfo($iuserinfo) &&\n\t\t\t\t  $this->set_host($remaining) &&\n\t\t\t\t  $this->set_port($port);\n\n\t\t$cache[$authority] = array($this->iuserinfo,\n\t\t\t\t\t\t\t\t   $this->ihost,\n\t\t\t\t\t\t\t\t   $this->port,\n\t\t\t\t\t\t\t\t   $return);\n\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Set the iuserinfo.\n\t *\n\t * @param string $iuserinfo\n\t * @return bool\n\t */\n\tpublic function set_userinfo($iuserinfo)\n\t{\n\t\tif ($iuserinfo === null)\n\t\t{\n\t\t\t$this->iuserinfo = null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->iuserinfo = $this->replace_invalid_with_pct_encoding($iuserinfo, '!$&\\'()*+,;=:');\n\t\t\t$this->scheme_normalization();\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set the ihost. Returns true on success, false on failure (if there are\n\t * any invalid characters).\n\t *\n\t * @param string $ihost\n\t * @return bool\n\t */\n\tpublic function set_host($ihost)\n\t{\n\t\tif ($ihost === null)\n\t\t{\n\t\t\t$this->ihost = null;\n\t\t\treturn true;\n\t\t}\n\t\telseif (substr($ihost, 0, 1) === '[' && substr($ihost, -1) === ']')\n\t\t{\n\t\t\tif (SimplePie_Net_IPv6::check_ipv6(substr($ihost, 1, -1)))\n\t\t\t{\n\t\t\t\t$this->ihost = '[' . SimplePie_Net_IPv6::compress(substr($ihost, 1, -1)) . ']';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->ihost = null;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ihost = $this->replace_invalid_with_pct_encoding($ihost, '!$&\\'()*+,;=');\n\n\t\t\t// Lowercase, but ignore pct-encoded sections (as they should\n\t\t\t// remain uppercase). This must be done after the previous step\n\t\t\t// as that can add unescaped characters.\n\t\t\t$position = 0;\n\t\t\t$strlen = strlen($ihost);\n\t\t\twhile (($position += strcspn($ihost, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ%', $position)) < $strlen)\n\t\t\t{\n\t\t\t\tif ($ihost[$position] === '%')\n\t\t\t\t{\n\t\t\t\t\t$position += 3;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$ihost[$position] = strtolower($ihost[$position]);\n\t\t\t\t\t$position++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->ihost = $ihost;\n\t\t}\n\n\t\t$this->scheme_normalization();\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set the port. Returns true on success, false on failure (if there are\n\t * any invalid characters).\n\t *\n\t * @param string $port\n\t * @return bool\n\t */\n\tpublic function set_port($port)\n\t{\n\t\tif ($port === null)\n\t\t{\n\t\t\t$this->port = null;\n\t\t\treturn true;\n\t\t}\n\t\telseif (strspn($port, '0123456789') === strlen($port))\n\t\t{\n\t\t\t$this->port = (int) $port;\n\t\t\t$this->scheme_normalization();\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->port = null;\n\t\treturn false;\n\t}\n\n\t/**\n\t * Set the ipath.\n\t *\n\t * @param string $ipath\n\t * @return bool\n\t */\n\tpublic function set_path($ipath, $clear_cache = false)\n\t{\n\t\tstatic $cache;\n\t\tif ($clear_cache)\n\t\t{\n\t\t\t$cache = null;\n\t\t\treturn;\n\t\t}\n\t\tif (!$cache)\n\t\t{\n\t\t\t$cache = array();\n\t\t}\n\n\t\t$ipath = (string) $ipath;\n\n\t\tif (isset($cache[$ipath]))\n\t\t{\n\t\t\t$this->ipath = $cache[$ipath][(int) ($this->scheme !== null)];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$valid = $this->replace_invalid_with_pct_encoding($ipath, '!$&\\'()*+,;=@:/');\n\t\t\t$removed = $this->remove_dot_segments($valid);\n\n\t\t\t$cache[$ipath] = array($valid, $removed);\n\t\t\t$this->ipath =  ($this->scheme !== null) ? $removed : $valid;\n\t\t}\n\n\t\t$this->scheme_normalization();\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set the iquery.\n\t *\n\t * @param string $iquery\n\t * @return bool\n\t */\n\tpublic function set_query($iquery)\n\t{\n\t\tif ($iquery === null)\n\t\t{\n\t\t\t$this->iquery = null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->iquery = $this->replace_invalid_with_pct_encoding($iquery, '!$&\\'()*+,;=:@/?', true);\n\t\t\t$this->scheme_normalization();\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set the ifragment.\n\t *\n\t * @param string $ifragment\n\t * @return bool\n\t */\n\tpublic function set_fragment($ifragment)\n\t{\n\t\tif ($ifragment === null)\n\t\t{\n\t\t\t$this->ifragment = null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ifragment = $this->replace_invalid_with_pct_encoding($ifragment, '!$&\\'()*+,;=:@/?');\n\t\t\t$this->scheme_normalization();\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Convert an IRI to a URI (or parts thereof)\n\t *\n\t * @return string\n\t */\n\tpublic function to_uri($string)\n\t{\n\t\tstatic $non_ascii;\n\t\tif (!$non_ascii)\n\t\t{\n\t\t\t$non_ascii = implode('', range(\"\\x80\", \"\\xFF\"));\n\t\t}\n\n\t\t$position = 0;\n\t\t$strlen = strlen($string);\n\t\twhile (($position += strcspn($string, $non_ascii, $position)) < $strlen)\n\t\t{\n\t\t\t$string = substr_replace($string, sprintf('%%%02X', ord($string[$position])), $position, 1);\n\t\t\t$position += 3;\n\t\t\t$strlen += 2;\n\t\t}\n\n\t\treturn $string;\n\t}\n\n\t/**\n\t * Get the complete IRI\n\t *\n\t * @return string\n\t */\n\tpublic function get_iri()\n\t{\n\t\tif (!$this->is_valid())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$iri = '';\n\t\tif ($this->scheme !== null)\n\t\t{\n\t\t\t$iri .= $this->scheme . ':';\n\t\t}\n\t\tif (($iauthority = $this->get_iauthority()) !== null)\n\t\t{\n\t\t\t$iri .= '//' . $iauthority;\n\t\t}\n\t\tif ($this->ipath !== '')\n\t\t{\n\t\t\t$iri .= $this->ipath;\n\t\t}\n        elseif (!empty($this->normalization[$this->scheme]['ipath']) && $iauthority !== null && $iauthority !== '')\n\t\t{\n\t\t\t$iri .= $this->normalization[$this->scheme]['ipath'];\n\t\t}\n\t\tif ($this->iquery !== null)\n\t\t{\n\t\t\t$iri .= '?' . $this->iquery;\n\t\t}\n\t\tif ($this->ifragment !== null)\n\t\t{\n\t\t\t$iri .= '#' . $this->ifragment;\n\t\t}\n\n\t\treturn $iri;\n\t}\n\n\t/**\n\t * Get the complete URI\n\t *\n\t * @return string\n\t */\n\tpublic function get_uri()\n\t{\n\t\treturn $this->to_uri($this->get_iri());\n\t}\n\n\t/**\n\t * Get the complete iauthority\n\t *\n\t * @return string\n\t */\n\tprotected function get_iauthority()\n\t{\n\t\tif ($this->iuserinfo !== null || $this->ihost !== null || $this->port !== null)\n\t\t{\n\t\t\t$iauthority = '';\n\t\t\tif ($this->iuserinfo !== null)\n\t\t\t{\n\t\t\t\t$iauthority .= $this->iuserinfo . '@';\n\t\t\t}\n\t\t\tif ($this->ihost !== null)\n\t\t\t{\n\t\t\t\t$iauthority .= $this->ihost;\n\t\t\t}\n            if ($this->port !== null && $this->port !== 0)\n\t\t\t{\n\t\t\t\t$iauthority .= ':' . $this->port;\n\t\t\t}\n\t\t\treturn $iauthority;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the complete authority\n\t *\n\t * @return string\n\t */\n\tprotected function get_authority()\n\t{\n\t\t$iauthority = $this->get_iauthority();\n\t\tif (is_string($iauthority))\n\t\t\treturn $this->to_uri($iauthority);\n\n\t\treturn $iauthority;\n\t}\n}\n", "num_lines": 1237}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n\n/**\n * Manages all item-related data\n *\n * Used by {@see SimplePie::get_item()} and {@see SimplePie::get_items()}\n *\n * This class can be overloaded with {@see SimplePie::set_item_class()}\n *\n * @package SimplePie\n * @subpackage API\n */\nclass SimplePie_Item\n{\n\t/**\n\t * Parent feed\n\t *\n\t * @access private\n\t * @var SimplePie\n\t */\n\tvar $feed;\n\n\t/**\n\t * Raw data\n\t *\n\t * @access private\n\t * @var array\n\t */\n\tvar $data = array();\n\n\t/**\n\t * Registry object\n\t *\n\t * @see set_registry\n\t * @var SimplePie_Registry\n\t */\n\tprotected $registry;\n\n\t/**\n\t * Create a new item object\n\t *\n\t * This is usually used by {@see SimplePie::get_items} and\n\t * {@see SimplePie::get_item}. Avoid creating this manually.\n\t *\n\t * @param SimplePie $feed Parent feed\n\t * @param array $data Raw data\n\t */\n\tpublic function __construct($feed, $data)\n\t{\n\t\t$this->feed = $feed;\n\t\t$this->data = $data;\n\t}\n\n\t/**\n\t * Set the registry handler\n\t *\n\t * This is usually used by {@see SimplePie_Registry::create}\n\t *\n\t * @since 1.3\n\t * @param SimplePie_Registry $registry\n\t */\n\tpublic function set_registry(SimplePie_Registry $registry)\n\t{\n\t\t$this->registry = $registry;\n\t}\n\n\t/**\n\t * Get a string representation of the item\n\t *\n\t * @return string\n\t */\n\tpublic function __toString()\n\t{\n\t\treturn md5(serialize($this->data));\n\t}\n\n\t/**\n\t * Remove items that link back to this before destroying this object\n\t */\n\tpublic function __destruct()\n\t{\n\t\tif (!gc_enabled())\n\t\t{\n\t\t\tunset($this->feed);\n\t\t}\n\t}\n\n\t/**\n\t * Get data for an item-level element\n\t *\n\t * This method allows you to get access to ANY element/attribute that is a\n\t * sub-element of the item/entry tag.\n\t *\n\t * See {@see SimplePie::get_feed_tags()} for a description of the return value\n\t *\n\t * @since 1.0\n\t * @see http://simplepie.org/wiki/faq/supported_xml_namespaces\n\t * @param string $namespace The URL of the XML namespace of the elements you're trying to access\n\t * @param string $tag Tag name\n\t * @return array\n\t */\n\tpublic function get_item_tags($namespace, $tag)\n\t{\n\t\tif (isset($this->data['child'][$namespace][$tag]))\n\t\t{\n\t\t\treturn $this->data['child'][$namespace][$tag];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the base URL value from the parent feed\n\t *\n\t * Uses `<xml:base>`\n\t *\n\t * @param array $element\n\t * @return string\n\t */\n\tpublic function get_base($element = array())\n\t{\n\t\treturn $this->feed->get_base($element);\n\t}\n\n\t/**\n\t * Sanitize feed data\n\t *\n\t * @access private\n\t * @see SimplePie::sanitize()\n\t * @param string $data Data to sanitize\n\t * @param int $type One of the SIMPLEPIE_CONSTRUCT_* constants\n\t * @param string $base Base URL to resolve URLs against\n\t * @return string Sanitized data\n\t */\n\tpublic function sanitize($data, $type, $base = '')\n\t{\n\t\treturn $this->feed->sanitize($data, $type, $base);\n\t}\n\n\t/**\n\t * Get the parent feed\n\t *\n\t * Note: this may not work as you think for multifeeds!\n\t *\n\t * @link http://simplepie.org/faq/typical_multifeed_gotchas#missing_data_from_feed\n\t * @since 1.0\n\t * @return SimplePie\n\t */\n\tpublic function get_feed()\n\t{\n\t\treturn $this->feed;\n\t}\n\n\t/**\n\t * Get the unique identifier for the item\n\t *\n\t * This is usually used when writing code to check for new items in a feed.\n\t *\n\t * Uses `<atom:id>`, `<guid>`, `<dc:identifier>` or the `about` attribute\n\t * for RDF. If none of these are supplied (or `$hash` is true), creates an\n\t * MD5 hash based on the permalink, title and content.\n\t *\n\t * @since Beta 2\n\t * @param boolean $hash Should we force using a hash instead of the supplied ID?\n\t * @param string|false $fn User-supplied function to generate an hash\n\t * @return string|null\n\t */\n\tpublic function get_id($hash = false, $fn = 'md5')\n\t{\n\t\tif (!$hash)\n\t\t{\n\t\t\tif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'id'))\n\t\t\t{\n\t\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'id'))\n\t\t\t{\n\t\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid'))\n\t\t\t{\n\t\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'identifier'))\n\t\t\t{\n\t\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'identifier'))\n\t\t\t{\n\t\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\telseif (isset($this->data['attribs'][SIMPLEPIE_NAMESPACE_RDF]['about']))\n\t\t\t{\n\t\t\t\treturn $this->sanitize($this->data['attribs'][SIMPLEPIE_NAMESPACE_RDF]['about'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t}\n\t\tif ($fn === false)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\telseif (!is_callable($fn))\n\t\t{\n\t\t\ttrigger_error('User-supplied function $fn must be callable', E_USER_WARNING);\n\t\t\t$fn = 'md5';\n\t\t}\n\t\treturn call_user_func($fn,\n\t\t       $this->get_permalink().$this->get_title().$this->get_content());\n\t}\n\n\t/**\n\t * Get the title of the item\n\t *\n\t * Uses `<atom:title>`, `<title>` or `<dc:title>`\n\t *\n\t * @since Beta 2 (previously called `get_item_title` since 0.8)\n\t * @return string|null\n\t */\n\tpublic function get_title()\n\t{\n\t\tif (!isset($this->data['title']))\n\t\t{\n\t\t\tif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))\n\t\t\t{\n\t\t\t\t$this->data['title'] = $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title'))\n\t\t\t{\n\t\t\t\t$this->data['title'] = $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title'))\n\t\t\t{\n\t\t\t\t$this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title'))\n\t\t\t{\n\t\t\t\t$this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))\n\t\t\t{\n\t\t\t\t$this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title'))\n\t\t\t{\n\t\t\t\t$this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title'))\n\t\t\t{\n\t\t\t\t$this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->data['title'] = null;\n\t\t\t}\n\t\t}\n\t\treturn $this->data['title'];\n\t}\n\n\t/**\n\t * Get the content for the item\n\t *\n\t * Prefers summaries over full content , but will return full content if a\n\t * summary does not exist.\n\t *\n\t * To prefer full content instead, use {@see get_content}\n\t *\n\t * Uses `<atom:summary>`, `<description>`, `<dc:description>` or\n\t * `<itunes:subtitle>`\n\t *\n\t * @since 0.8\n\t * @param boolean $description_only Should we avoid falling back to the content?\n\t * @return string|null\n\t */\n\tpublic function get_description($description_only = false)\n\t{\n\t\tif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'summary')) &&\n\t\t    ($return = $this->sanitize($tags[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($tags[0]['attribs'])), $this->get_base($tags[0]))))\n\t\t{\n\t\t\treturn $return;\n\t\t}\n\t\telseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'summary')) &&\n\t\t        ($return = $this->sanitize($tags[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($tags[0]['attribs'])), $this->get_base($tags[0]))))\n\t\t{\n\t\t\treturn $return;\n\t\t}\n\t\telseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description')) &&\n\t\t        ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($tags[0]))))\n\t\t{\n\t\t\treturn $return;\n\t\t}\n\t\telseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) &&\n\t\t        ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($tags[0]))))\n\t\t{\n\t\t\treturn $return;\n\t\t}\n\t\telseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description')) &&\n\t\t        ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)))\n\t\t{\n\t\t\treturn $return;\n\t\t}\n\t\telseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description')) &&\n\t\t        ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)))\n\t\t{\n\t\t\treturn $return;\n\t\t}\n\t\telseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary')) &&\n\t\t        ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($tags[0]))))\n\t\t{\n\t\t\treturn $return;\n\t\t}\n\t\telseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle')) &&\n\t\t        ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)))\n\t\t{\n\t\t\treturn $return;\n\t\t}\n\t\telseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description')) &&\n\t\t        ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_HTML)))\n\t\t{\n\t\t\treturn $return;\n\t\t}\n\n\t\telseif (!$description_only)\n\t\t{\n\t\t\treturn $this->get_content(true);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the content for the item\n\t *\n\t * Prefers full content over summaries, but will return a summary if full\n\t * content does not exist.\n\t *\n\t * To prefer summaries instead, use {@see get_description}\n\t *\n\t * Uses `<atom:content>` or `<content:encoded>` (RSS 1.0 Content Module)\n\t *\n\t * @since 1.0\n\t * @param boolean $content_only Should we avoid falling back to the description?\n\t * @return string|null\n\t */\n\tpublic function get_content($content_only = false)\n\t{\n\t\tif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'content')) &&\n\t\t    ($return = $this->sanitize($tags[0]['data'], $this->registry->call('Misc', 'atom_10_content_construct_type', array($tags[0]['attribs'])), $this->get_base($tags[0]))))\n\t\t{\n\t\t\treturn $return;\n\t\t}\n\t\telseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'content')) &&\n\t\t        ($return = $this->sanitize($tags[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($tags[0]['attribs'])), $this->get_base($tags[0]))))\n\t\t{\n\t\t\treturn $return;\n\t\t}\n\t\telseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT, 'encoded')) &&\n\t\t        ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($tags[0]))))\n\t\t{\n\t\t\treturn $return;\n\t\t}\n\t\telseif (!$content_only)\n\t\t{\n\t\t\treturn $this->get_description(true);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the media:thumbnail of the item\n\t *\n\t * Uses `<media:thumbnail>`\n\t *\n\t *\n\t * @return array|null\n\t */\n\tpublic function get_thumbnail()\n\t{\n\t\tif (!isset($this->data['thumbnail']))\n\t\t{\n\t\t\tif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail'))\n\t\t\t{\n\t\t\t\t$this->data['thumbnail'] = $return[0]['attribs'][''];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->data['thumbnail'] = null;\n\t\t\t}\n\t\t}\n\t\treturn $this->data['thumbnail'];\n\t}\n\n\t/**\n\t * Get a category for the item\n\t *\n\t * @since Beta 3 (previously called `get_categories()` since Beta 2)\n\t * @param int $key The category that you want to return.  Remember that arrays begin with 0, not 1\n\t * @return SimplePie_Category|null\n\t */\n\tpublic function get_category($key = 0)\n\t{\n\t\t$categories = $this->get_categories();\n\t\tif (isset($categories[$key]))\n\t\t{\n\t\t\treturn $categories[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all categories for the item\n\t *\n\t * Uses `<atom:category>`, `<category>` or `<dc:subject>`\n\t *\n\t * @since Beta 3\n\t * @return SimplePie_Category[]|null List of {@see SimplePie_Category} objects\n\t */\n\tpublic function get_categories()\n\t{\n\t\t$categories = array();\n\n\t\t$type = 'category';\n\t\tforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, $type) as $category)\n\t\t{\n\t\t\t$term = null;\n\t\t\t$scheme = null;\n\t\t\t$label = null;\n\t\t\tif (isset($category['attribs']['']['term']))\n\t\t\t{\n\t\t\t\t$term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($category['attribs']['']['scheme']))\n\t\t\t{\n\t\t\t\t$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($category['attribs']['']['label']))\n\t\t\t{\n\t\t\t\t$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\t$categories[] = $this->registry->create('Category', array($term, $scheme, $label, $type));\n\t\t}\n\t\tforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, $type) as $category)\n\t\t{\n\t\t\t// This is really the label, but keep this as the term also for BC.\n\t\t\t// Label will also work on retrieving because that falls back to term.\n\t\t\t$term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\tif (isset($category['attribs']['']['domain']))\n\t\t\t{\n\t\t\t\t$scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$scheme = null;\n\t\t\t}\n\t\t\t$categories[] = $this->registry->create('Category', array($term, $scheme, null, $type));\n\t\t}\n\n\t\t$type = 'subject';\n\t\tforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, $type) as $category)\n\t\t{\n\t\t\t$categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null, $type));\n\t\t}\n\t\tforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, $type) as $category)\n\t\t{\n\t\t\t$categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null, $type));\n\t\t}\n\n\t\tif (!empty($categories))\n\t\t{\n\t\t\treturn array_unique($categories);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get an author for the item\n\t *\n\t * @since Beta 2\n\t * @param int $key The author that you want to return.  Remember that arrays begin with 0, not 1\n\t * @return SimplePie_Author|null\n\t */\n\tpublic function get_author($key = 0)\n\t{\n\t\t$authors = $this->get_authors();\n\t\tif (isset($authors[$key]))\n\t\t{\n\t\t\treturn $authors[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get a contributor for the item\n\t *\n\t * @since 1.1\n\t * @param int $key The contrbutor that you want to return.  Remember that arrays begin with 0, not 1\n\t * @return SimplePie_Author|null\n\t */\n\tpublic function get_contributor($key = 0)\n\t{\n\t\t$contributors = $this->get_contributors();\n\t\tif (isset($contributors[$key]))\n\t\t{\n\t\t\treturn $contributors[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all contributors for the item\n\t *\n\t * Uses `<atom:contributor>`\n\t *\n\t * @since 1.1\n\t * @return SimplePie_Author[]|null List of {@see SimplePie_Author} objects\n\t */\n\tpublic function get_contributors()\n\t{\n\t\t$contributors = array();\n\t\tforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor)\n\t\t{\n\t\t\t$name = null;\n\t\t\t$uri = null;\n\t\t\t$email = null;\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))\n\t\t\t{\n\t\t\t\t$name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))\n\t\t\t{\n\t\t\t\t$uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));\n\t\t\t}\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))\n\t\t\t{\n\t\t\t\t$email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif ($name !== null || $email !== null || $uri !== null)\n\t\t\t{\n\t\t\t\t$contributors[] = $this->registry->create('Author', array($name, $uri, $email));\n\t\t\t}\n\t\t}\n\t\tforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor)\n\t\t{\n\t\t\t$name = null;\n\t\t\t$url = null;\n\t\t\t$email = null;\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))\n\t\t\t{\n\t\t\t\t$name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))\n\t\t\t{\n\t\t\t\t$url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));\n\t\t\t}\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))\n\t\t\t{\n\t\t\t\t$email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif ($name !== null || $email !== null || $url !== null)\n\t\t\t{\n\t\t\t\t$contributors[] = $this->registry->create('Author', array($name, $url, $email));\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($contributors))\n\t\t{\n\t\t\treturn array_unique($contributors);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all authors for the item\n\t *\n\t * Uses `<atom:author>`, `<author>`, `<dc:creator>` or `<itunes:author>`\n\t *\n\t * @since Beta 2\n\t * @return SimplePie_Author[]|null List of {@see SimplePie_Author} objects\n\t */\n\tpublic function get_authors()\n\t{\n\t\t$authors = array();\n\t\tforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author)\n\t\t{\n\t\t\t$name = null;\n\t\t\t$uri = null;\n\t\t\t$email = null;\n\t\t\tif (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))\n\t\t\t{\n\t\t\t\t$name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))\n\t\t\t{\n\t\t\t\t$uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));\n\t\t\t}\n\t\t\tif (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))\n\t\t\t{\n\t\t\t\t$email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif ($name !== null || $email !== null || $uri !== null)\n\t\t\t{\n\t\t\t\t$authors[] = $this->registry->create('Author', array($name, $uri, $email));\n\t\t\t}\n\t\t}\n\t\tif ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))\n\t\t{\n\t\t\t$name = null;\n\t\t\t$url = null;\n\t\t\t$email = null;\n\t\t\tif (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))\n\t\t\t{\n\t\t\t\t$name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))\n\t\t\t{\n\t\t\t\t$url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));\n\t\t\t}\n\t\t\tif (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))\n\t\t\t{\n\t\t\t\t$email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif ($name !== null || $email !== null || $url !== null)\n\t\t\t{\n\t\t\t\t$authors[] = $this->registry->create('Author', array($name, $url, $email));\n\t\t\t}\n\t\t}\n\t\tif ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'author'))\n\t\t{\n\t\t\t$authors[] = $this->registry->create('Author', array(null, null, $this->sanitize($author[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)));\n\t\t}\n\t\tforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author)\n\t\t{\n\t\t\t$authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));\n\t\t}\n\t\tforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author)\n\t\t{\n\t\t\t$authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));\n\t\t}\n\t\tforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author)\n\t\t{\n\t\t\t$authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));\n\t\t}\n\n\t\tif (!empty($authors))\n\t\t{\n\t\t\treturn array_unique($authors);\n\t\t}\n\t\telseif (($source = $this->get_source()) && ($authors = $source->get_authors()))\n\t\t{\n\t\t\treturn $authors;\n\t\t}\n\t\telseif ($authors = $this->feed->get_authors())\n\t\t{\n\t\t\treturn $authors;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the copyright info for the item\n\t *\n\t * Uses `<atom:rights>` or `<dc:rights>`\n\t *\n\t * @since 1.1\n\t * @return string\n\t */\n\tpublic function get_copyright()\n\t{\n\t\tif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the posting date/time for the item\n\t *\n\t * Uses `<atom:published>`, `<atom:updated>`, `<atom:issued>`,\n\t * `<atom:modified>`, `<pubDate>` or `<dc:date>`\n\t *\n\t * Note: obeys PHP's timezone setting. To get a UTC date/time, use\n\t * {@see get_gmdate}\n\t *\n\t * @since Beta 2 (previously called `get_item_date` since 0.8)\n\t *\n\t * @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data)\n\t * @return int|string|null\n\t */\n\tpublic function get_date($date_format = 'j F Y, g:i a')\n\t{\n\t\tif (!isset($this->data['date']))\n\t\t{\n\t\t\tif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'published'))\n\t\t\t{\n\t\t\t\t$this->data['date']['raw'] = $return[0]['data'];\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pubDate'))\n\t\t\t{\n\t\t\t\t$this->data['date']['raw'] = $return[0]['data'];\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'date'))\n\t\t\t{\n\t\t\t\t$this->data['date']['raw'] = $return[0]['data'];\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'date'))\n\t\t\t{\n\t\t\t\t$this->data['date']['raw'] = $return[0]['data'];\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated'))\n\t\t\t{\n\t\t\t\t$this->data['date']['raw'] = $return[0]['data'];\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'issued'))\n\t\t\t{\n\t\t\t\t$this->data['date']['raw'] = $return[0]['data'];\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'created'))\n\t\t\t{\n\t\t\t\t$this->data['date']['raw'] = $return[0]['data'];\n\t\t\t}\n\t\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'modified'))\n\t\t\t{\n\t\t\t\t$this->data['date']['raw'] = $return[0]['data'];\n\t\t\t}\n\n\t\t\tif (!empty($this->data['date']['raw']))\n\t\t\t{\n\t\t\t\t$parser = $this->registry->call('Parse_Date', 'get');\n\t\t\t\t$this->data['date']['parsed'] = $parser->parse($this->data['date']['raw']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->data['date'] = null;\n\t\t\t}\n\t\t}\n\t\tif ($this->data['date'])\n\t\t{\n\t\t\t$date_format = (string) $date_format;\n\t\t\tswitch ($date_format)\n\t\t\t{\n\t\t\t\tcase '':\n\t\t\t\t\treturn $this->sanitize($this->data['date']['raw'], SIMPLEPIE_CONSTRUCT_TEXT);\n\n\t\t\t\tcase 'U':\n\t\t\t\t\treturn $this->data['date']['parsed'];\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn date($date_format, $this->data['date']['parsed']);\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the update date/time for the item\n\t *\n\t * Uses `<atom:updated>`\n\t *\n\t * Note: obeys PHP's timezone setting. To get a UTC date/time, use\n\t * {@see get_gmdate}\n\t *\n\t * @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data)\n\t * @return int|string|null\n\t */\n\tpublic function get_updated_date($date_format = 'j F Y, g:i a')\n\t{\n\t\tif (!isset($this->data['updated']))\n\t\t{\n\t\t\tif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated'))\n\t\t\t{\n\t\t\t\t$this->data['updated']['raw'] = $return[0]['data'];\n\t\t\t}\n\n\t\t\tif (!empty($this->data['updated']['raw']))\n\t\t\t{\n\t\t\t\t$parser = $this->registry->call('Parse_Date', 'get');\n\t\t\t\t$this->data['updated']['parsed'] = $parser->parse($this->data['updated']['raw']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->data['updated'] = null;\n\t\t\t}\n\t\t}\n\t\tif ($this->data['updated'])\n\t\t{\n\t\t\t$date_format = (string) $date_format;\n\t\t\tswitch ($date_format)\n\t\t\t{\n\t\t\t\tcase '':\n\t\t\t\t\treturn $this->sanitize($this->data['updated']['raw'], SIMPLEPIE_CONSTRUCT_TEXT);\n\n\t\t\t\tcase 'U':\n\t\t\t\t\treturn $this->data['updated']['parsed'];\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn date($date_format, $this->data['updated']['parsed']);\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the localized posting date/time for the item\n\t *\n\t * Returns the date formatted in the localized language. To display in\n\t * languages other than the server's default, you need to change the locale\n\t * with {@link http://php.net/setlocale setlocale()}. The available\n\t * localizations depend on which ones are installed on your web server.\n\t *\n\t * @since 1.0\n\t *\n\t * @param string $date_format Supports any PHP date format from {@see http://php.net/strftime} (empty for the raw data)\n\t * @return int|string|null\n\t */\n\tpublic function get_local_date($date_format = '%c')\n\t{\n\t\tif (!$date_format)\n\t\t{\n\t\t\treturn $this->sanitize($this->get_date(''), SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif (($date = $this->get_date('U')) !== null && $date !== false)\n\t\t{\n\t\t\treturn strftime($date_format, $date);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the posting date/time for the item (UTC time)\n\t *\n\t * @see get_date\n\t * @param string $date_format Supports any PHP date format from {@see http://php.net/date}\n\t * @return int|string|null\n\t */\n\tpublic function get_gmdate($date_format = 'j F Y, g:i a')\n\t{\n\t\t$date = $this->get_date('U');\n\t\tif ($date === null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\treturn gmdate($date_format, $date);\n\t}\n\n\t/**\n\t * Get the update date/time for the item (UTC time)\n\t *\n\t * @see get_updated_date\n\t * @param string $date_format Supports any PHP date format from {@see http://php.net/date}\n\t * @return int|string|null\n\t */\n\tpublic function get_updated_gmdate($date_format = 'j F Y, g:i a')\n\t{\n\t\t$date = $this->get_updated_date('U');\n\t\tif ($date === null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\treturn gmdate($date_format, $date);\n\t}\n\n\t/**\n\t * Get the permalink for the item\n\t *\n\t * Returns the first link available with a relationship of \"alternate\".\n\t * Identical to {@see get_link()} with key 0\n\t *\n\t * @see get_link\n\t * @since 0.8\n\t * @return string|null Permalink URL\n\t */\n\tpublic function get_permalink()\n\t{\n\t\t$link = $this->get_link();\n\t\t$enclosure = $this->get_enclosure(0);\n\t\tif ($link !== null)\n\t\t{\n\t\t\treturn $link;\n\t\t}\n\t\telseif ($enclosure !== null)\n\t\t{\n\t\t\treturn $enclosure->get_link();\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get a single link for the item\n\t *\n\t * @since Beta 3\n\t * @param int $key The link that you want to return.  Remember that arrays begin with 0, not 1\n\t * @param string $rel The relationship of the link to return\n\t * @return string|null Link URL\n\t */\n\tpublic function get_link($key = 0, $rel = 'alternate')\n\t{\n\t\t$links = $this->get_links($rel);\n\t\tif ($links && $links[$key] !== null)\n\t\t{\n\t\t\treturn $links[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all links for the item\n\t *\n\t * Uses `<atom:link>`, `<link>` or `<guid>`\n\t *\n\t * @since Beta 2\n\t * @param string $rel The relationship of links to return\n\t * @return array|null Links found for the item (strings)\n\t */\n\tpublic function get_links($rel = 'alternate')\n\t{\n\t\tif (!isset($this->data['links']))\n\t\t{\n\t\t\t$this->data['links'] = array();\n\t\t\tforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link)\n\t\t\t{\n\t\t\t\tif (isset($link['attribs']['']['href']))\n\t\t\t\t{\n\t\t\t\t\t$link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';\n\t\t\t\t\t$this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link)\n\t\t\t{\n\t\t\t\tif (isset($link['attribs']['']['href']))\n\t\t\t\t{\n\t\t\t\t\t$link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';\n\t\t\t\t\t$this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link'))\n\t\t\t{\n\t\t\t\t$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));\n\t\t\t}\n\t\t\tif ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link'))\n\t\t\t{\n\t\t\t\t$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));\n\t\t\t}\n\t\t\tif ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))\n\t\t\t{\n\t\t\t\t$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));\n\t\t\t}\n\t\t\tif ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid'))\n\t\t\t{\n\t\t\t\tif (!isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) === 'true')\n\t\t\t\t{\n\t\t\t\t\t$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$keys = array_keys($this->data['links']);\n\t\t\tforeach ($keys as $key)\n\t\t\t{\n\t\t\t\tif ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))\n\t\t\t\t{\n\t\t\t\t\tif (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]);\n\t\t\t\t\t\t$this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key];\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->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)\n\t\t\t\t{\n\t\t\t\t\t$this->data['links'][substr($key, 41)] =& $this->data['links'][$key];\n\t\t\t\t}\n\t\t\t\t$this->data['links'][$key] = array_unique($this->data['links'][$key]);\n\t\t\t}\n\t\t}\n\t\tif (isset($this->data['links'][$rel]))\n\t\t{\n\t\t\treturn $this->data['links'][$rel];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get an enclosure from the item\n\t *\n\t * Supports the <enclosure> RSS tag, as well as Media RSS and iTunes RSS.\n\t *\n\t * @since Beta 2\n\t * @todo Add ability to prefer one type of content over another (in a media group).\n\t * @param int $key The enclosure that you want to return.  Remember that arrays begin with 0, not 1\n\t * @return SimplePie_Enclosure|null\n\t */\n\tpublic function get_enclosure($key = 0, $prefer = null)\n\t{\n\t\t$enclosures = $this->get_enclosures();\n\t\tif (isset($enclosures[$key]))\n\t\t{\n\t\t\treturn $enclosures[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get all available enclosures (podcasts, etc.)\n\t *\n\t * Supports the <enclosure> RSS tag, as well as Media RSS and iTunes RSS.\n\t *\n\t * At this point, we're pretty much assuming that all enclosures for an item\n\t * are the same content.  Anything else is too complicated to\n\t * properly support.\n\t *\n\t * @since Beta 2\n\t * @todo Add support for end-user defined sorting of enclosures by type/handler (so we can prefer the faster-loading FLV over MP4).\n\t * @todo If an element exists at a level, but its value is empty, we should fall back to the value from the parent (if it exists).\n\t * @return SimplePie_Enclosure[]|null List of SimplePie_Enclosure items\n\t */\n\tpublic function get_enclosures()\n\t{\n\t\tif (!isset($this->data['enclosures']))\n\t\t{\n\t\t\t$this->data['enclosures'] = array();\n\n\t\t\t// Elements\n\t\t\t$captions_parent = null;\n\t\t\t$categories_parent = null;\n\t\t\t$copyrights_parent = null;\n\t\t\t$credits_parent = null;\n\t\t\t$description_parent = null;\n\t\t\t$duration_parent = null;\n\t\t\t$hashes_parent = null;\n\t\t\t$keywords_parent = null;\n\t\t\t$player_parent = null;\n\t\t\t$ratings_parent = null;\n\t\t\t$restrictions_parent = null;\n\t\t\t$thumbnails_parent = null;\n\t\t\t$title_parent = null;\n\n\t\t\t// Let's do the channel and item-level ones first, and just re-use them if we need to.\n\t\t\t$parent = $this->get_feed();\n\n\t\t\t// CAPTIONS\n\t\t\tif ($captions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text'))\n\t\t\t{\n\t\t\t\tforeach ($captions as $caption)\n\t\t\t\t{\n\t\t\t\t\t$caption_type = null;\n\t\t\t\t\t$caption_lang = null;\n\t\t\t\t\t$caption_startTime = null;\n\t\t\t\t\t$caption_endTime = null;\n\t\t\t\t\t$caption_text = null;\n\t\t\t\t\tif (isset($caption['attribs']['']['type']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($caption['attribs']['']['lang']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($caption['attribs']['']['start']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($caption['attribs']['']['end']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($caption['data']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\t$captions_parent[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($captions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text'))\n\t\t\t{\n\t\t\t\tforeach ($captions as $caption)\n\t\t\t\t{\n\t\t\t\t\t$caption_type = null;\n\t\t\t\t\t$caption_lang = null;\n\t\t\t\t\t$caption_startTime = null;\n\t\t\t\t\t$caption_endTime = null;\n\t\t\t\t\t$caption_text = null;\n\t\t\t\t\tif (isset($caption['attribs']['']['type']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($caption['attribs']['']['lang']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($caption['attribs']['']['start']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($caption['attribs']['']['end']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($caption['data']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\t$captions_parent[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (is_array($captions_parent))\n\t\t\t{\n\t\t\t\t$captions_parent = array_values(array_unique($captions_parent));\n\t\t\t}\n\n\t\t\t// CATEGORIES\n\t\t\tforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'category') as $category)\n\t\t\t{\n\t\t\t\t$term = null;\n\t\t\t\t$scheme = null;\n\t\t\t\t$label = null;\n\t\t\t\tif (isset($category['data']))\n\t\t\t\t{\n\t\t\t\t\t$term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t}\n\t\t\t\tif (isset($category['attribs']['']['scheme']))\n\t\t\t\t{\n\t\t\t\t\t$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$scheme = 'http://search.yahoo.com/mrss/category_schema';\n\t\t\t\t}\n\t\t\t\tif (isset($category['attribs']['']['label']))\n\t\t\t\t{\n\t\t\t\t\t$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t}\n\t\t\t\t$categories_parent[] = $this->registry->create('Category', array($term, $scheme, $label));\n\t\t\t}\n\t\t\tforeach ((array) $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'category') as $category)\n\t\t\t{\n\t\t\t\t$term = null;\n\t\t\t\t$scheme = null;\n\t\t\t\t$label = null;\n\t\t\t\tif (isset($category['data']))\n\t\t\t\t{\n\t\t\t\t\t$term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t}\n\t\t\t\tif (isset($category['attribs']['']['scheme']))\n\t\t\t\t{\n\t\t\t\t\t$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$scheme = 'http://search.yahoo.com/mrss/category_schema';\n\t\t\t\t}\n\t\t\t\tif (isset($category['attribs']['']['label']))\n\t\t\t\t{\n\t\t\t\t\t$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t}\n\t\t\t\t$categories_parent[] = $this->registry->create('Category', array($term, $scheme, $label));\n\t\t\t}\n\t\t\tforeach ((array) $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'category') as $category)\n\t\t\t{\n\t\t\t\t$term = null;\n\t\t\t\t$scheme = 'http://www.itunes.com/dtds/podcast-1.0.dtd';\n\t\t\t\t$label = null;\n\t\t\t\tif (isset($category['attribs']['']['text']))\n\t\t\t\t{\n\t\t\t\t\t$label = $this->sanitize($category['attribs']['']['text'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t}\n\t\t\t\t$categories_parent[] = $this->registry->create('Category', array($term, $scheme, $label));\n\n\t\t\t\tif (isset($category['child'][SIMPLEPIE_NAMESPACE_ITUNES]['category']))\n\t\t\t\t{\n\t\t\t\t\tforeach ((array) $category['child'][SIMPLEPIE_NAMESPACE_ITUNES]['category'] as $subcategory)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (isset($subcategory['attribs']['']['text']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$label = $this->sanitize($subcategory['attribs']['']['text'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$categories_parent[] = $this->registry->create('Category', array($term, $scheme, $label));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (is_array($categories_parent))\n\t\t\t{\n\t\t\t\t$categories_parent = array_values(array_unique($categories_parent));\n\t\t\t}\n\n\t\t\t// COPYRIGHT\n\t\t\tif ($copyright = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'copyright'))\n\t\t\t{\n\t\t\t\t$copyright_url = null;\n\t\t\t\t$copyright_label = null;\n\t\t\t\tif (isset($copyright[0]['attribs']['']['url']))\n\t\t\t\t{\n\t\t\t\t\t$copyright_url = $this->sanitize($copyright[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t}\n\t\t\t\tif (isset($copyright[0]['data']))\n\t\t\t\t{\n\t\t\t\t\t$copyright_label = $this->sanitize($copyright[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t}\n\t\t\t\t$copyrights_parent = $this->registry->create('Copyright', array($copyright_url, $copyright_label));\n\t\t\t}\n\t\t\telseif ($copyright = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'copyright'))\n\t\t\t{\n\t\t\t\t$copyright_url = null;\n\t\t\t\t$copyright_label = null;\n\t\t\t\tif (isset($copyright[0]['attribs']['']['url']))\n\t\t\t\t{\n\t\t\t\t\t$copyright_url = $this->sanitize($copyright[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t}\n\t\t\t\tif (isset($copyright[0]['data']))\n\t\t\t\t{\n\t\t\t\t\t$copyright_label = $this->sanitize($copyright[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t}\n\t\t\t\t$copyrights_parent = $this->registry->create('Copyright', array($copyright_url, $copyright_label));\n\t\t\t}\n\n\t\t\t// CREDITS\n\t\t\tif ($credits = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit'))\n\t\t\t{\n\t\t\t\tforeach ($credits as $credit)\n\t\t\t\t{\n\t\t\t\t\t$credit_role = null;\n\t\t\t\t\t$credit_scheme = null;\n\t\t\t\t\t$credit_name = null;\n\t\t\t\t\tif (isset($credit['attribs']['']['role']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($credit['attribs']['']['scheme']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\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$credit_scheme = 'urn:ebu';\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($credit['data']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\t$credits_parent[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($credits = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit'))\n\t\t\t{\n\t\t\t\tforeach ($credits as $credit)\n\t\t\t\t{\n\t\t\t\t\t$credit_role = null;\n\t\t\t\t\t$credit_scheme = null;\n\t\t\t\t\t$credit_name = null;\n\t\t\t\t\tif (isset($credit['attribs']['']['role']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($credit['attribs']['']['scheme']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\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$credit_scheme = 'urn:ebu';\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($credit['data']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\t$credits_parent[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (is_array($credits_parent))\n\t\t\t{\n\t\t\t\t$credits_parent = array_values(array_unique($credits_parent));\n\t\t\t}\n\n\t\t\t// DESCRIPTION\n\t\t\tif ($description_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'description'))\n\t\t\t{\n\t\t\t\tif (isset($description_parent[0]['data']))\n\t\t\t\t{\n\t\t\t\t\t$description_parent = $this->sanitize($description_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($description_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'description'))\n\t\t\t{\n\t\t\t\tif (isset($description_parent[0]['data']))\n\t\t\t\t{\n\t\t\t\t\t$description_parent = $this->sanitize($description_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// DURATION\n\t\t\tif ($duration_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'duration'))\n\t\t\t{\n\t\t\t\t$seconds = null;\n\t\t\t\t$minutes = null;\n\t\t\t\t$hours = null;\n\t\t\t\tif (isset($duration_parent[0]['data']))\n\t\t\t\t{\n\t\t\t\t\t$temp = explode(':', $this->sanitize($duration_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));\n\t\t\t\t\tif (sizeof($temp) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$seconds = (int) array_pop($temp);\n\t\t\t\t\t}\n\t\t\t\t\tif (sizeof($temp) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$minutes = (int) array_pop($temp);\n\t\t\t\t\t\t$seconds += $minutes * 60;\n\t\t\t\t\t}\n\t\t\t\t\tif (sizeof($temp) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$hours = (int) array_pop($temp);\n\t\t\t\t\t\t$seconds += $hours * 3600;\n\t\t\t\t\t}\n\t\t\t\t\tunset($temp);\n\t\t\t\t\t$duration_parent = $seconds;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// HASHES\n\t\t\tif ($hashes_iterator = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'hash'))\n\t\t\t{\n\t\t\t\tforeach ($hashes_iterator as $hash)\n\t\t\t\t{\n\t\t\t\t\t$value = null;\n\t\t\t\t\t$algo = null;\n\t\t\t\t\tif (isset($hash['data']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($hash['attribs']['']['algo']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);\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$algo = 'md5';\n\t\t\t\t\t}\n\t\t\t\t\t$hashes_parent[] = $algo.':'.$value;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($hashes_iterator = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'hash'))\n\t\t\t{\n\t\t\t\tforeach ($hashes_iterator as $hash)\n\t\t\t\t{\n\t\t\t\t\t$value = null;\n\t\t\t\t\t$algo = null;\n\t\t\t\t\tif (isset($hash['data']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($hash['attribs']['']['algo']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);\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$algo = 'md5';\n\t\t\t\t\t}\n\t\t\t\t\t$hashes_parent[] = $algo.':'.$value;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (is_array($hashes_parent))\n\t\t\t{\n\t\t\t\t$hashes_parent = array_values(array_unique($hashes_parent));\n\t\t\t}\n\n\t\t\t// KEYWORDS\n\t\t\tif ($keywords = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'keywords'))\n\t\t\t{\n\t\t\t\tif (isset($keywords[0]['data']))\n\t\t\t\t{\n\t\t\t\t\t$temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));\n\t\t\t\t\tforeach ($temp as $word)\n\t\t\t\t\t{\n\t\t\t\t\t\t$keywords_parent[] = trim($word);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tunset($temp);\n\t\t\t}\n\t\t\telseif ($keywords = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords'))\n\t\t\t{\n\t\t\t\tif (isset($keywords[0]['data']))\n\t\t\t\t{\n\t\t\t\t\t$temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));\n\t\t\t\t\tforeach ($temp as $word)\n\t\t\t\t\t{\n\t\t\t\t\t\t$keywords_parent[] = trim($word);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tunset($temp);\n\t\t\t}\n\t\t\telseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'keywords'))\n\t\t\t{\n\t\t\t\tif (isset($keywords[0]['data']))\n\t\t\t\t{\n\t\t\t\t\t$temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));\n\t\t\t\t\tforeach ($temp as $word)\n\t\t\t\t\t{\n\t\t\t\t\t\t$keywords_parent[] = trim($word);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tunset($temp);\n\t\t\t}\n\t\t\telseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords'))\n\t\t\t{\n\t\t\t\tif (isset($keywords[0]['data']))\n\t\t\t\t{\n\t\t\t\t\t$temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));\n\t\t\t\t\tforeach ($temp as $word)\n\t\t\t\t\t{\n\t\t\t\t\t\t$keywords_parent[] = trim($word);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tunset($temp);\n\t\t\t}\n\t\t\tif (is_array($keywords_parent))\n\t\t\t{\n\t\t\t\t$keywords_parent = array_values(array_unique($keywords_parent));\n\t\t\t}\n\n\t\t\t// PLAYER\n\t\t\tif ($player_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'player'))\n\t\t\t{\n\t\t\t\tif (isset($player_parent[0]['attribs']['']['url']))\n\t\t\t\t{\n\t\t\t\t\t$player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($player_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'player'))\n\t\t\t{\n\t\t\t\tif (isset($player_parent[0]['attribs']['']['url']))\n\t\t\t\t{\n\t\t\t\t\t$player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// RATINGS\n\t\t\tif ($ratings = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'rating'))\n\t\t\t{\n\t\t\t\tforeach ($ratings as $rating)\n\t\t\t\t{\n\t\t\t\t\t$rating_scheme = null;\n\t\t\t\t\t$rating_value = null;\n\t\t\t\t\tif (isset($rating['attribs']['']['scheme']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\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$rating_scheme = 'urn:simple';\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($rating['data']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\t$ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($ratings = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit'))\n\t\t\t{\n\t\t\t\tforeach ($ratings as $rating)\n\t\t\t\t{\n\t\t\t\t\t$rating_scheme = 'urn:itunes';\n\t\t\t\t\t$rating_value = null;\n\t\t\t\t\tif (isset($rating['data']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\t$ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'rating'))\n\t\t\t{\n\t\t\t\tforeach ($ratings as $rating)\n\t\t\t\t{\n\t\t\t\t\t$rating_scheme = null;\n\t\t\t\t\t$rating_value = null;\n\t\t\t\t\tif (isset($rating['attribs']['']['scheme']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\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$rating_scheme = 'urn:simple';\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($rating['data']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\t$ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit'))\n\t\t\t{\n\t\t\t\tforeach ($ratings as $rating)\n\t\t\t\t{\n\t\t\t\t\t$rating_scheme = 'urn:itunes';\n\t\t\t\t\t$rating_value = null;\n\t\t\t\t\tif (isset($rating['data']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\t$ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (is_array($ratings_parent))\n\t\t\t{\n\t\t\t\t$ratings_parent = array_values(array_unique($ratings_parent));\n\t\t\t}\n\n\t\t\t// RESTRICTIONS\n\t\t\tif ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'restriction'))\n\t\t\t{\n\t\t\t\tforeach ($restrictions as $restriction)\n\t\t\t\t{\n\t\t\t\t\t$restriction_relationship = null;\n\t\t\t\t\t$restriction_type = null;\n\t\t\t\t\t$restriction_value = null;\n\t\t\t\t\tif (isset($restriction['attribs']['']['relationship']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($restriction['attribs']['']['type']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($restriction['data']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\t$restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block'))\n\t\t\t{\n\t\t\t\tforeach ($restrictions as $restriction)\n\t\t\t\t{\n\t\t\t\t\t$restriction_relationship = 'allow';\n\t\t\t\t\t$restriction_type = null;\n\t\t\t\t\t$restriction_value = 'itunes';\n\t\t\t\t\tif (isset($restriction['data']) && strtolower($restriction['data']) === 'yes')\n\t\t\t\t\t{\n\t\t\t\t\t\t$restriction_relationship = 'deny';\n\t\t\t\t\t}\n\t\t\t\t\t$restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'restriction'))\n\t\t\t{\n\t\t\t\tforeach ($restrictions as $restriction)\n\t\t\t\t{\n\t\t\t\t\t$restriction_relationship = null;\n\t\t\t\t\t$restriction_type = null;\n\t\t\t\t\t$restriction_value = null;\n\t\t\t\t\tif (isset($restriction['attribs']['']['relationship']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($restriction['attribs']['']['type']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($restriction['data']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\t$restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block'))\n\t\t\t{\n\t\t\t\tforeach ($restrictions as $restriction)\n\t\t\t\t{\n\t\t\t\t\t$restriction_relationship = 'allow';\n\t\t\t\t\t$restriction_type = null;\n\t\t\t\t\t$restriction_value = 'itunes';\n\t\t\t\t\tif (isset($restriction['data']) && strtolower($restriction['data']) === 'yes')\n\t\t\t\t\t{\n\t\t\t\t\t\t$restriction_relationship = 'deny';\n\t\t\t\t\t}\n\t\t\t\t\t$restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (is_array($restrictions_parent))\n\t\t\t{\n\t\t\t\t$restrictions_parent = array_values(array_unique($restrictions_parent));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$restrictions_parent = array(new SimplePie_Restriction('allow', null, 'default'));\n\t\t\t}\n\n\t\t\t// THUMBNAILS\n\t\t\tif ($thumbnails = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail'))\n\t\t\t{\n\t\t\t\tforeach ($thumbnails as $thumbnail)\n\t\t\t\t{\n\t\t\t\t\tif (isset($thumbnail['attribs']['']['url']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($thumbnails = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail'))\n\t\t\t{\n\t\t\t\tforeach ($thumbnails as $thumbnail)\n\t\t\t\t{\n\t\t\t\t\tif (isset($thumbnail['attribs']['']['url']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TITLES\n\t\t\tif ($title_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'title'))\n\t\t\t{\n\t\t\t\tif (isset($title_parent[0]['data']))\n\t\t\t\t{\n\t\t\t\t\t$title_parent = $this->sanitize($title_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($title_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'title'))\n\t\t\t{\n\t\t\t\tif (isset($title_parent[0]['data']))\n\t\t\t\t{\n\t\t\t\t\t$title_parent = $this->sanitize($title_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Clear the memory\n\t\t\tunset($parent);\n\n\t\t\t// Attributes\n\t\t\t$bitrate = null;\n\t\t\t$channels = null;\n\t\t\t$duration = null;\n\t\t\t$expression = null;\n\t\t\t$framerate = null;\n\t\t\t$height = null;\n\t\t\t$javascript = null;\n\t\t\t$lang = null;\n\t\t\t$length = null;\n\t\t\t$medium = null;\n\t\t\t$samplingrate = null;\n\t\t\t$type = null;\n\t\t\t$url = null;\n\t\t\t$width = null;\n\n\t\t\t// Elements\n\t\t\t$captions = null;\n\t\t\t$categories = null;\n\t\t\t$copyrights = null;\n\t\t\t$credits = null;\n\t\t\t$description = null;\n\t\t\t$hashes = null;\n\t\t\t$keywords = null;\n\t\t\t$player = null;\n\t\t\t$ratings = null;\n\t\t\t$restrictions = null;\n\t\t\t$thumbnails = null;\n\t\t\t$title = null;\n\n\t\t\t// If we have media:group tags, loop through them.\n\t\t\tforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group') as $group)\n\t\t\t{\n\t\t\t\tif(isset($group['child']) && isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content']))\n\t\t\t\t{\n\t\t\t\t\t// If we have media:content tags, loop through them.\n\t\t\t\t\tforeach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'] as $content)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (isset($content['attribs']['']['url']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Attributes\n\t\t\t\t\t\t\t$bitrate = null;\n\t\t\t\t\t\t\t$channels = null;\n\t\t\t\t\t\t\t$duration = null;\n\t\t\t\t\t\t\t$expression = null;\n\t\t\t\t\t\t\t$framerate = null;\n\t\t\t\t\t\t\t$height = null;\n\t\t\t\t\t\t\t$javascript = null;\n\t\t\t\t\t\t\t$lang = null;\n\t\t\t\t\t\t\t$length = null;\n\t\t\t\t\t\t\t$medium = null;\n\t\t\t\t\t\t\t$samplingrate = null;\n\t\t\t\t\t\t\t$type = null;\n\t\t\t\t\t\t\t$url = null;\n\t\t\t\t\t\t\t$width = null;\n\n\t\t\t\t\t\t\t// Elements\n\t\t\t\t\t\t\t$captions = null;\n\t\t\t\t\t\t\t$categories = null;\n\t\t\t\t\t\t\t$copyrights = null;\n\t\t\t\t\t\t\t$credits = null;\n\t\t\t\t\t\t\t$description = null;\n\t\t\t\t\t\t\t$hashes = null;\n\t\t\t\t\t\t\t$keywords = null;\n\t\t\t\t\t\t\t$player = null;\n\t\t\t\t\t\t\t$ratings = null;\n\t\t\t\t\t\t\t$restrictions = null;\n\t\t\t\t\t\t\t$thumbnails = null;\n\t\t\t\t\t\t\t$title = null;\n\n\t\t\t\t\t\t\t// Start checking the attributes of media:content\n\t\t\t\t\t\t\tif (isset($content['attribs']['']['bitrate']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$bitrate = $this->sanitize($content['attribs']['']['bitrate'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isset($content['attribs']['']['channels']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channels = $this->sanitize($content['attribs']['']['channels'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isset($content['attribs']['']['duration']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$duration = $this->sanitize($content['attribs']['']['duration'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$duration = $duration_parent;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isset($content['attribs']['']['expression']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$expression = $this->sanitize($content['attribs']['']['expression'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isset($content['attribs']['']['framerate']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$framerate = $this->sanitize($content['attribs']['']['framerate'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isset($content['attribs']['']['height']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$height = $this->sanitize($content['attribs']['']['height'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isset($content['attribs']['']['lang']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$lang = $this->sanitize($content['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isset($content['attribs']['']['fileSize']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$length = ceil($content['attribs']['']['fileSize']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isset($content['attribs']['']['medium']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$medium = $this->sanitize($content['attribs']['']['medium'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isset($content['attribs']['']['samplingrate']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$samplingrate = $this->sanitize($content['attribs']['']['samplingrate'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isset($content['attribs']['']['type']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$type = $this->sanitize($content['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isset($content['attribs']['']['width']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$width = $this->sanitize($content['attribs']['']['width'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$url = $this->sanitize($content['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n\n\t\t\t\t\t\t\t// Checking the other optional media: elements. Priority: media:content, media:group, item, channel\n\n\t\t\t\t\t\t\t// CAPTIONS\n\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$caption_type = null;\n\t\t\t\t\t\t\t\t\t$caption_lang = null;\n\t\t\t\t\t\t\t\t\t$caption_startTime = null;\n\t\t\t\t\t\t\t\t\t$caption_endTime = null;\n\t\t\t\t\t\t\t\t\t$caption_text = null;\n\t\t\t\t\t\t\t\t\tif (isset($caption['attribs']['']['type']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($caption['attribs']['']['lang']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($caption['attribs']['']['start']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($caption['attribs']['']['end']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($caption['data']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$captions[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (is_array($captions))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$captions = array_values(array_unique($captions));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$caption_type = null;\n\t\t\t\t\t\t\t\t\t$caption_lang = null;\n\t\t\t\t\t\t\t\t\t$caption_startTime = null;\n\t\t\t\t\t\t\t\t\t$caption_endTime = null;\n\t\t\t\t\t\t\t\t\t$caption_text = null;\n\t\t\t\t\t\t\t\t\tif (isset($caption['attribs']['']['type']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($caption['attribs']['']['lang']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($caption['attribs']['']['start']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($caption['attribs']['']['end']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($caption['data']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$captions[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (is_array($captions))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$captions = array_values(array_unique($captions));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$captions = $captions_parent;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// CATEGORIES\n\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ((array) $content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$term = null;\n\t\t\t\t\t\t\t\t\t$scheme = null;\n\t\t\t\t\t\t\t\t\t$label = null;\n\t\t\t\t\t\t\t\t\tif (isset($category['data']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($category['attribs']['']['scheme']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$scheme = 'http://search.yahoo.com/mrss/category_schema';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($category['attribs']['']['label']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$categories[] = $this->registry->create('Category', array($term, $scheme, $label));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$term = null;\n\t\t\t\t\t\t\t\t\t$scheme = null;\n\t\t\t\t\t\t\t\t\t$label = null;\n\t\t\t\t\t\t\t\t\tif (isset($category['data']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($category['attribs']['']['scheme']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$scheme = 'http://search.yahoo.com/mrss/category_schema';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($category['attribs']['']['label']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$categories[] = $this->registry->create('Category', array($term, $scheme, $label));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (is_array($categories) && is_array($categories_parent))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$categories = array_values(array_unique(array_merge($categories, $categories_parent)));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (is_array($categories))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$categories = array_values(array_unique($categories));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (is_array($categories_parent))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$categories = array_values(array_unique($categories_parent));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// COPYRIGHTS\n\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$copyright_url = null;\n\t\t\t\t\t\t\t\t$copyright_label = null;\n\t\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$copyright_url = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$copyright_url = null;\n\t\t\t\t\t\t\t\t$copyright_label = null;\n\t\t\t\t\t\t\t\tif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$copyright_url = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$copyright_label = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$copyrights = $copyrights_parent;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// CREDITS\n\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$credit_role = null;\n\t\t\t\t\t\t\t\t\t$credit_scheme = null;\n\t\t\t\t\t\t\t\t\t$credit_name = null;\n\t\t\t\t\t\t\t\t\tif (isset($credit['attribs']['']['role']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($credit['attribs']['']['scheme']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$credit_scheme = 'urn:ebu';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($credit['data']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$credits[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (is_array($credits))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$credits = array_values(array_unique($credits));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$credit_role = null;\n\t\t\t\t\t\t\t\t\t$credit_scheme = null;\n\t\t\t\t\t\t\t\t\t$credit_name = null;\n\t\t\t\t\t\t\t\t\tif (isset($credit['attribs']['']['role']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($credit['attribs']['']['scheme']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$credit_scheme = 'urn:ebu';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($credit['data']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$credits[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (is_array($credits))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$credits = array_values(array_unique($credits));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$credits = $credits_parent;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// DESCRIPTION\n\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$description = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$description = $description_parent;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// HASHES\n\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$value = null;\n\t\t\t\t\t\t\t\t\t$algo = null;\n\t\t\t\t\t\t\t\t\tif (isset($hash['data']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($hash['attribs']['']['algo']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$algo = 'md5';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$hashes[] = $algo.':'.$value;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (is_array($hashes))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$hashes = array_values(array_unique($hashes));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$value = null;\n\t\t\t\t\t\t\t\t\t$algo = null;\n\t\t\t\t\t\t\t\t\tif (isset($hash['data']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($hash['attribs']['']['algo']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$algo = 'md5';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$hashes[] = $algo.':'.$value;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (is_array($hashes))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$hashes = array_values(array_unique($hashes));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hashes = $hashes_parent;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// KEYWORDS\n\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$temp = explode(',', $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));\n\t\t\t\t\t\t\t\t\tforeach ($temp as $word)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$keywords[] = trim($word);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tunset($temp);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (is_array($keywords))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$keywords = array_values(array_unique($keywords));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$temp = explode(',', $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));\n\t\t\t\t\t\t\t\t\tforeach ($temp as $word)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$keywords[] = trim($word);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tunset($temp);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (is_array($keywords))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$keywords = array_values(array_unique($keywords));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$keywords = $keywords_parent;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// PLAYER\n\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$player = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$player = $player_parent;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// RATINGS\n\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$rating_scheme = null;\n\t\t\t\t\t\t\t\t\t$rating_value = null;\n\t\t\t\t\t\t\t\t\tif (isset($rating['attribs']['']['scheme']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$rating_scheme = 'urn:simple';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($rating['data']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$ratings[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (is_array($ratings))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$ratings = array_values(array_unique($ratings));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$rating_scheme = null;\n\t\t\t\t\t\t\t\t\t$rating_value = null;\n\t\t\t\t\t\t\t\t\tif (isset($rating['attribs']['']['scheme']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$rating_scheme = 'urn:simple';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($rating['data']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$ratings[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (is_array($ratings))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$ratings = array_values(array_unique($ratings));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ratings = $ratings_parent;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// RESTRICTIONS\n\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$restriction_relationship = null;\n\t\t\t\t\t\t\t\t\t$restriction_type = null;\n\t\t\t\t\t\t\t\t\t$restriction_value = null;\n\t\t\t\t\t\t\t\t\tif (isset($restriction['attribs']['']['relationship']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($restriction['attribs']['']['type']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($restriction['data']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$restrictions[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (is_array($restrictions))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$restrictions = array_values(array_unique($restrictions));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$restriction_relationship = null;\n\t\t\t\t\t\t\t\t\t$restriction_type = null;\n\t\t\t\t\t\t\t\t\t$restriction_value = null;\n\t\t\t\t\t\t\t\t\tif (isset($restriction['attribs']['']['relationship']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($restriction['attribs']['']['type']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($restriction['data']))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$restrictions[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (is_array($restrictions))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$restrictions = array_values(array_unique($restrictions));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$restrictions = $restrictions_parent;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// THUMBNAILS\n\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (is_array($thumbnails))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$thumbnails = array_values(array_unique($thumbnails));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (is_array($thumbnails))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$thumbnails = array_values(array_unique($thumbnails));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$thumbnails = $thumbnails_parent;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// TITLES\n\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$title = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$title = $title_parent;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we have standalone media:content tags, loop through them.\n\t\t\tif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content']))\n\t\t\t{\n\t\t\t\tforeach ((array) $this->data['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'] as $content)\n\t\t\t\t{\n\t\t\t\t\tif (isset($content['attribs']['']['url']) || isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Attributes\n\t\t\t\t\t\t$bitrate = null;\n\t\t\t\t\t\t$channels = null;\n\t\t\t\t\t\t$duration = null;\n\t\t\t\t\t\t$expression = null;\n\t\t\t\t\t\t$framerate = null;\n\t\t\t\t\t\t$height = null;\n\t\t\t\t\t\t$javascript = null;\n\t\t\t\t\t\t$lang = null;\n\t\t\t\t\t\t$length = null;\n\t\t\t\t\t\t$medium = null;\n\t\t\t\t\t\t$samplingrate = null;\n\t\t\t\t\t\t$type = null;\n\t\t\t\t\t\t$url = null;\n\t\t\t\t\t\t$width = null;\n\n\t\t\t\t\t\t// Elements\n\t\t\t\t\t\t$captions = null;\n\t\t\t\t\t\t$categories = null;\n\t\t\t\t\t\t$copyrights = null;\n\t\t\t\t\t\t$credits = null;\n\t\t\t\t\t\t$description = null;\n\t\t\t\t\t\t$hashes = null;\n\t\t\t\t\t\t$keywords = null;\n\t\t\t\t\t\t$player = null;\n\t\t\t\t\t\t$ratings = null;\n\t\t\t\t\t\t$restrictions = null;\n\t\t\t\t\t\t$thumbnails = null;\n\t\t\t\t\t\t$title = null;\n\n\t\t\t\t\t\t// Start checking the attributes of media:content\n\t\t\t\t\t\tif (isset($content['attribs']['']['bitrate']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$bitrate = $this->sanitize($content['attribs']['']['bitrate'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($content['attribs']['']['channels']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channels = $this->sanitize($content['attribs']['']['channels'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($content['attribs']['']['duration']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$duration = $this->sanitize($content['attribs']['']['duration'], SIMPLEPIE_CONSTRUCT_TEXT);\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$duration = $duration_parent;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($content['attribs']['']['expression']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$expression = $this->sanitize($content['attribs']['']['expression'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($content['attribs']['']['framerate']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$framerate = $this->sanitize($content['attribs']['']['framerate'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($content['attribs']['']['height']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$height = $this->sanitize($content['attribs']['']['height'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($content['attribs']['']['lang']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$lang = $this->sanitize($content['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($content['attribs']['']['fileSize']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$length = ceil($content['attribs']['']['fileSize']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($content['attribs']['']['medium']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$medium = $this->sanitize($content['attribs']['']['medium'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($content['attribs']['']['samplingrate']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$samplingrate = $this->sanitize($content['attribs']['']['samplingrate'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($content['attribs']['']['type']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$type = $this->sanitize($content['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($content['attribs']['']['width']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$width = $this->sanitize($content['attribs']['']['width'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($content['attribs']['']['url']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$url = $this->sanitize($content['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Checking the other optional media: elements. Priority: media:content, media:group, item, channel\n\n\t\t\t\t\t\t// CAPTIONS\n\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$caption_type = null;\n\t\t\t\t\t\t\t\t$caption_lang = null;\n\t\t\t\t\t\t\t\t$caption_startTime = null;\n\t\t\t\t\t\t\t\t$caption_endTime = null;\n\t\t\t\t\t\t\t\t$caption_text = null;\n\t\t\t\t\t\t\t\tif (isset($caption['attribs']['']['type']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (isset($caption['attribs']['']['lang']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (isset($caption['attribs']['']['start']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (isset($caption['attribs']['']['end']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (isset($caption['data']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$captions[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (is_array($captions))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$captions = array_values(array_unique($captions));\n\t\t\t\t\t\t\t}\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$captions = $captions_parent;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// CATEGORIES\n\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ((array) $content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$term = null;\n\t\t\t\t\t\t\t\t$scheme = null;\n\t\t\t\t\t\t\t\t$label = null;\n\t\t\t\t\t\t\t\tif (isset($category['data']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (isset($category['attribs']['']['scheme']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$scheme = 'http://search.yahoo.com/mrss/category_schema';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (isset($category['attribs']['']['label']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$categories[] = $this->registry->create('Category', array($term, $scheme, $label));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (is_array($categories) && is_array($categories_parent))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$categories = array_values(array_unique(array_merge($categories, $categories_parent)));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (is_array($categories))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$categories = array_values(array_unique($categories));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (is_array($categories_parent))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$categories = array_values(array_unique($categories_parent));\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$categories = null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// COPYRIGHTS\n\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$copyright_url = null;\n\t\t\t\t\t\t\t$copyright_label = null;\n\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$copyright_url = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label));\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$copyrights = $copyrights_parent;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// CREDITS\n\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$credit_role = null;\n\t\t\t\t\t\t\t\t$credit_scheme = null;\n\t\t\t\t\t\t\t\t$credit_name = null;\n\t\t\t\t\t\t\t\tif (isset($credit['attribs']['']['role']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (isset($credit['attribs']['']['scheme']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$credit_scheme = 'urn:ebu';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (isset($credit['data']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$credits[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (is_array($credits))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$credits = array_values(array_unique($credits));\n\t\t\t\t\t\t\t}\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$credits = $credits_parent;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// DESCRIPTION\n\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\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$description = $description_parent;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HASHES\n\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$value = null;\n\t\t\t\t\t\t\t\t$algo = null;\n\t\t\t\t\t\t\t\tif (isset($hash['data']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (isset($hash['attribs']['']['algo']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$algo = 'md5';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$hashes[] = $algo.':'.$value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (is_array($hashes))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hashes = array_values(array_unique($hashes));\n\t\t\t\t\t\t\t}\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$hashes = $hashes_parent;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// KEYWORDS\n\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp = explode(',', $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));\n\t\t\t\t\t\t\t\tforeach ($temp as $word)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$keywords[] = trim($word);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tunset($temp);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (is_array($keywords))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$keywords = array_values(array_unique($keywords));\n\t\t\t\t\t\t\t}\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$keywords = $keywords_parent;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// PLAYER\n\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'])) {\n\t\t\t\t\t\t\t\t$player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n\t\t\t\t\t\t\t}\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$player = $player_parent;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// RATINGS\n\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$rating_scheme = null;\n\t\t\t\t\t\t\t\t$rating_value = null;\n\t\t\t\t\t\t\t\tif (isset($rating['attribs']['']['scheme']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$rating_scheme = 'urn:simple';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (isset($rating['data']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$ratings[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (is_array($ratings))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ratings = array_values(array_unique($ratings));\n\t\t\t\t\t\t\t}\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$ratings = $ratings_parent;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// RESTRICTIONS\n\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$restriction_relationship = null;\n\t\t\t\t\t\t\t\t$restriction_type = null;\n\t\t\t\t\t\t\t\t$restriction_value = null;\n\t\t\t\t\t\t\t\tif (isset($restriction['attribs']['']['relationship']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (isset($restriction['attribs']['']['type']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (isset($restriction['data']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$restrictions[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (is_array($restrictions))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$restrictions = array_values(array_unique($restrictions));\n\t\t\t\t\t\t\t}\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$restrictions = $restrictions_parent;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// THUMBNAILS\n\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (isset($thumbnail['attribs']['']['url'])) {\n\t\t\t\t\t\t\t\t\t$thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (is_array($thumbnails))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$thumbnails = array_values(array_unique($thumbnails));\n\t\t\t\t\t\t\t}\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$thumbnails = $thumbnails_parent;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// TITLES\n\t\t\t\t\t\tif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\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$title = $title_parent;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link)\n\t\t\t{\n\t\t\t\tif (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure')\n\t\t\t\t{\n\t\t\t\t\t// Attributes\n\t\t\t\t\t$bitrate = null;\n\t\t\t\t\t$channels = null;\n\t\t\t\t\t$duration = null;\n\t\t\t\t\t$expression = null;\n\t\t\t\t\t$framerate = null;\n\t\t\t\t\t$height = null;\n\t\t\t\t\t$javascript = null;\n\t\t\t\t\t$lang = null;\n\t\t\t\t\t$length = null;\n\t\t\t\t\t$medium = null;\n\t\t\t\t\t$samplingrate = null;\n\t\t\t\t\t$type = null;\n\t\t\t\t\t$url = null;\n\t\t\t\t\t$width = null;\n\n\t\t\t\t\t$url = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));\n\t\t\t\t\tif (isset($link['attribs']['']['type']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$type = $this->sanitize($link['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($link['attribs']['']['length']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$length = ceil($link['attribs']['']['length']);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($link['attribs']['']['title']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$title = $this->sanitize($link['attribs']['']['title'], SIMPLEPIE_CONSTRUCT_TEXT);\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$title = $title_parent;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor\n\t\t\t\t\t$this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title, $width));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link)\n\t\t\t{\n\t\t\t\tif (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure')\n\t\t\t\t{\n\t\t\t\t\t// Attributes\n\t\t\t\t\t$bitrate = null;\n\t\t\t\t\t$channels = null;\n\t\t\t\t\t$duration = null;\n\t\t\t\t\t$expression = null;\n\t\t\t\t\t$framerate = null;\n\t\t\t\t\t$height = null;\n\t\t\t\t\t$javascript = null;\n\t\t\t\t\t$lang = null;\n\t\t\t\t\t$length = null;\n\t\t\t\t\t$medium = null;\n\t\t\t\t\t$samplingrate = null;\n\t\t\t\t\t$type = null;\n\t\t\t\t\t$url = null;\n\t\t\t\t\t$width = null;\n\n\t\t\t\t\t$url = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));\n\t\t\t\t\tif (isset($link['attribs']['']['type']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$type = $this->sanitize($link['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($link['attribs']['']['length']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$length = ceil($link['attribs']['']['length']);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor\n\t\t\t\t\t$this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($enclosure = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'enclosure'))\n\t\t\t{\n\t\t\t\tif (isset($enclosure[0]['attribs']['']['url']))\n\t\t\t\t{\n\t\t\t\t\t// Attributes\n\t\t\t\t\t$bitrate = null;\n\t\t\t\t\t$channels = null;\n\t\t\t\t\t$duration = null;\n\t\t\t\t\t$expression = null;\n\t\t\t\t\t$framerate = null;\n\t\t\t\t\t$height = null;\n\t\t\t\t\t$javascript = null;\n\t\t\t\t\t$lang = null;\n\t\t\t\t\t$length = null;\n\t\t\t\t\t$medium = null;\n\t\t\t\t\t$samplingrate = null;\n\t\t\t\t\t$type = null;\n\t\t\t\t\t$url = null;\n\t\t\t\t\t$width = null;\n\n\t\t\t\t\t$url = $this->sanitize($enclosure[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($enclosure[0]));\n\t\t\t\t\tif (isset($enclosure[0]['attribs']['']['type']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$type = $this->sanitize($enclosure[0]['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($enclosure[0]['attribs']['']['length']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$length = ceil($enclosure[0]['attribs']['']['length']);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor\n\t\t\t\t\t$this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (sizeof($this->data['enclosures']) === 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width))\n\t\t\t{\n\t\t\t\t// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor\n\t\t\t\t$this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width));\n\t\t\t}\n\n\t\t\t$this->data['enclosures'] = array_values(array_unique($this->data['enclosures']));\n\t\t}\n\t\tif (!empty($this->data['enclosures']))\n\t\t{\n\t\t\treturn $this->data['enclosures'];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the latitude coordinates for the item\n\t *\n\t * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications\n\t *\n\t * Uses `<geo:lat>` or `<georss:point>`\n\t *\n\t * @since 1.0\n\t * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo\n\t * @link http://www.georss.org/ GeoRSS\n\t * @return string|null\n\t */\n\tpublic function get_latitude()\n\t{\n\t\tif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat'))\n\t\t{\n\t\t\treturn (float) $return[0]['data'];\n\t\t}\n\t\telseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\\.[0-9]+)) ((?:-)?[0-9]+(?:\\.[0-9]+))$/', trim($return[0]['data']), $match))\n\t\t{\n\t\t\treturn (float) $match[1];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the longitude coordinates for the item\n\t *\n\t * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications\n\t *\n\t * Uses `<geo:long>`, `<geo:lon>` or `<georss:point>`\n\t *\n\t * @since 1.0\n\t * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo\n\t * @link http://www.georss.org/ GeoRSS\n\t * @return string|null\n\t */\n\tpublic function get_longitude()\n\t{\n\t\tif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long'))\n\t\t{\n\t\t\treturn (float) $return[0]['data'];\n\t\t}\n\t\telseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon'))\n\t\t{\n\t\t\treturn (float) $return[0]['data'];\n\t\t}\n\t\telseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\\.[0-9]+)) ((?:-)?[0-9]+(?:\\.[0-9]+))$/', trim($return[0]['data']), $match))\n\t\t{\n\t\t\treturn (float) $match[2];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the `<atom:source>` for the item\n\t *\n\t * @since 1.1\n\t * @return SimplePie_Source|null\n\t */\n\tpublic function get_source()\n\t{\n\t\tif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'source'))\n\t\t{\n\t\t\treturn $this->registry->create('Source', array($this, $return[0]));\n\t\t}\n\n\t\treturn null;\n\t}\n}\n", "num_lines": 2967}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Used for feed auto-discovery\n *\n *\n * This class can be overloaded with {@see SimplePie::set_locator_class()}\n *\n * @package SimplePie\n */\nclass SimplePie_Locator\n{\n\tvar $useragent;\n\tvar $timeout;\n\tvar $file;\n\tvar $local = array();\n\tvar $elsewhere = array();\n\tvar $cached_entities = array();\n\tvar $http_base;\n\tvar $base;\n\tvar $base_location = 0;\n\tvar $checked_feeds = 0;\n\tvar $max_checked_feeds = 10;\n\tvar $force_fsockopen = false;\n\tvar $curl_options = array();\n\tprotected $registry;\n\n\tpublic function __construct(SimplePie_File $file, $timeout = 10, $useragent = null, $max_checked_feeds = 10, $force_fsockopen = false, $curl_options = array())\n\t{\n\t\t$this->file = $file;\n\t\t$this->useragent = $useragent;\n\t\t$this->timeout = $timeout;\n\t\t$this->max_checked_feeds = $max_checked_feeds;\n\t\t$this->force_fsockopen = $force_fsockopen;\n\t\t$this->curl_options = $curl_options;\n\n\t\tif (class_exists('DOMDocument'))\n\t\t{\n\t\t\t$this->dom = new DOMDocument();\n\n\t\t\tset_error_handler(array('SimplePie_Misc', 'silence_errors'));\n\t\t\t$this->dom->loadHTML($this->file->body);\n\t\t\trestore_error_handler();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->dom = null;\n\t\t}\n\t}\n\n\tpublic function set_registry(SimplePie_Registry $registry)\n\t{\n\t\t$this->registry = $registry;\n\t}\n\n\tpublic function find($type = SIMPLEPIE_LOCATOR_ALL, &$working)\n\t{\n\t\tif ($this->is_feed($this->file))\n\t\t{\n\t\t\treturn $this->file;\n\t\t}\n\n\t\tif ($this->file->method & SIMPLEPIE_FILE_SOURCE_REMOTE)\n\t\t{\n\t\t\t$sniffer = $this->registry->create('Content_Type_Sniffer', array($this->file));\n\t\t\tif ($sniffer->get_type() !== 'text/html')\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tif ($type & ~SIMPLEPIE_LOCATOR_NONE)\n\t\t{\n\t\t\t$this->get_base();\n\t\t}\n\n\t\tif ($type & SIMPLEPIE_LOCATOR_AUTODISCOVERY && $working = $this->autodiscovery())\n\t\t{\n\t\t\treturn $working[0];\n\t\t}\n\n\t\tif ($type & (SIMPLEPIE_LOCATOR_LOCAL_EXTENSION | SIMPLEPIE_LOCATOR_LOCAL_BODY | SIMPLEPIE_LOCATOR_REMOTE_EXTENSION | SIMPLEPIE_LOCATOR_REMOTE_BODY) && $this->get_links())\n\t\t{\n\t\t\tif ($type & SIMPLEPIE_LOCATOR_LOCAL_EXTENSION && $working = $this->extension($this->local))\n\t\t\t{\n\t\t\t\treturn $working[0];\n\t\t\t}\n\n\t\t\tif ($type & SIMPLEPIE_LOCATOR_LOCAL_BODY && $working = $this->body($this->local))\n\t\t\t{\n\t\t\t\treturn $working[0];\n\t\t\t}\n\n\t\t\tif ($type & SIMPLEPIE_LOCATOR_REMOTE_EXTENSION && $working = $this->extension($this->elsewhere))\n\t\t\t{\n\t\t\t\treturn $working[0];\n\t\t\t}\n\n\t\t\tif ($type & SIMPLEPIE_LOCATOR_REMOTE_BODY && $working = $this->body($this->elsewhere))\n\t\t\t{\n\t\t\t\treturn $working[0];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic function is_feed($file, $check_html = false)\n\t{\n\t\tif ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE)\n\t\t{\n\t\t\t$sniffer = $this->registry->create('Content_Type_Sniffer', array($file));\n\t\t\t$sniffed = $sniffer->get_type();\n\t\t\t$mime_types = array('application/rss+xml', 'application/rdf+xml',\n\t\t\t                    'text/rdf', 'application/atom+xml', 'text/xml',\n\t\t\t                    'application/xml', 'application/x-rss+xml');\n\t\t\tif ($check_html)\n\t\t\t{\n\t\t\t\t$mime_types[] = 'text/html';\n\t\t\t}\n\n\t\t\treturn in_array($sniffed, $mime_types);\n\t\t}\n\t\telseif ($file->method & SIMPLEPIE_FILE_SOURCE_LOCAL)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tpublic function get_base()\n\t{\n\t\tif ($this->dom === null)\n\t\t{\n\t\t\tthrow new SimplePie_Exception('DOMDocument not found, unable to use locator');\n\t\t}\n\t\t$this->http_base = $this->file->url;\n\t\t$this->base = $this->http_base;\n\t\t$elements = $this->dom->getElementsByTagName('base');\n\t\tforeach ($elements as $element)\n\t\t{\n\t\t\tif ($element->hasAttribute('href'))\n\t\t\t{\n\t\t\t\t$base = $this->registry->call('Misc', 'absolutize_url', array(trim($element->getAttribute('href')), $this->http_base));\n\t\t\t\tif ($base === false)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$this->base = $base;\n\t\t\t\t$this->base_location = method_exists($element, 'getLineNo') ? $element->getLineNo() : 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic function autodiscovery()\n\t{\n\t\t$done = array();\n\t\t$feeds = array();\n\t\t$feeds = array_merge($feeds, $this->search_elements_by_tag('link', $done, $feeds));\n\t\t$feeds = array_merge($feeds, $this->search_elements_by_tag('a', $done, $feeds));\n\t\t$feeds = array_merge($feeds, $this->search_elements_by_tag('area', $done, $feeds));\n\n\t\tif (!empty($feeds))\n\t\t{\n\t\t\treturn array_values($feeds);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprotected function search_elements_by_tag($name, &$done, $feeds)\n\t{\n\t\tif ($this->dom === null)\n\t\t{\n\t\t\tthrow new SimplePie_Exception('DOMDocument not found, unable to use locator');\n\t\t}\n\n\t\t$links = $this->dom->getElementsByTagName($name);\n\t\tforeach ($links as $link)\n\t\t{\n\t\t\tif ($this->checked_feeds === $this->max_checked_feeds)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ($link->hasAttribute('href') && $link->hasAttribute('rel'))\n\t\t\t{\n\t\t\t\t$rel = array_unique($this->registry->call('Misc', 'space_separated_tokens', array(strtolower($link->getAttribute('rel')))));\n\t\t\t\t$line = method_exists($link, 'getLineNo') ? $link->getLineNo() : 1;\n\n\t\t\t\tif ($this->base_location < $line)\n\t\t\t\t{\n\t\t\t\t\t$href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->base));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base));\n\t\t\t\t}\n\t\t\t\tif ($href === false)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !in_array('stylesheet', $rel) && $link->hasAttribute('type') && in_array(strtolower($this->registry->call('Misc', 'parse_mime', array($link->getAttribute('type')))), array('text/html', 'application/rss+xml', 'application/atom+xml'))) && !isset($feeds[$href]))\n\t\t\t\t{\n\t\t\t\t\t$this->checked_feeds++;\n\t\t\t\t\t$headers = array(\n\t\t\t\t\t\t'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1',\n\t\t\t\t\t);\n\t\t\t\t\t$feed = $this->registry->create('File', array($href, $this->timeout, 5, $headers, $this->useragent, $this->force_fsockopen, $this->curl_options));\n\t\t\t\t\tif ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed, true))\n\t\t\t\t\t{\n\t\t\t\t\t\t$feeds[$href] = $feed;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$done[] = $href;\n\t\t\t}\n\t\t}\n\n\t\treturn $feeds;\n\t}\n\n\tpublic function get_links()\n\t{\n\t\tif ($this->dom === null)\n\t\t{\n\t\t\tthrow new SimplePie_Exception('DOMDocument not found, unable to use locator');\n\t\t}\n\n\t\t$links = $this->dom->getElementsByTagName('a');\n\t\tforeach ($links as $link)\n\t\t{\n\t\t\tif ($link->hasAttribute('href'))\n\t\t\t{\n\t\t\t\t$href = trim($link->getAttribute('href'));\n\t\t\t\t$parsed = $this->registry->call('Misc', 'parse_url', array($href));\n\t\t\t\tif ($parsed['scheme'] === '' || preg_match('/^(https?|feed)?$/i', $parsed['scheme']))\n\t\t\t\t{\n\t\t\t\t\tif (method_exists($link, 'getLineNo') && $this->base_location < $link->getLineNo())\n\t\t\t\t\t{\n\t\t\t\t\t\t$href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->base));\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$href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base));\n\t\t\t\t\t}\n\t\t\t\t\tif ($href === false)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$current = $this->registry->call('Misc', 'parse_url', array($this->file->url));\n\n\t\t\t\t\tif ($parsed['authority'] === '' || $parsed['authority'] === $current['authority'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->local[] = $href;\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->elsewhere[] = $href;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->local = array_unique($this->local);\n\t\t$this->elsewhere = array_unique($this->elsewhere);\n\t\tif (!empty($this->local) || !empty($this->elsewhere))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic function get_rel_link($rel)\n\t{\n\t\tif ($this->dom === null)\n\t\t{\n\t\t\tthrow new SimplePie_Exception('DOMDocument not found, unable to use '.\n\t\t\t                              'locator');\n\t\t}\n\t\tif (!class_exists('DOMXpath'))\n\t\t{\n\t\t\tthrow new SimplePie_Exception('DOMXpath not found, unable to use '.\n\t\t\t                              'get_rel_link');\n\t\t}\n\n\t\t$xpath = new DOMXpath($this->dom);\n\t\t$query = '//a[@rel and @href] | //link[@rel and @href]';\n\t\tforeach ($xpath->query($query) as $link)\n\t\t{\n\t\t\t$href = trim($link->getAttribute('href'));\n\t\t\t$parsed = $this->registry->call('Misc', 'parse_url', array($href));\n\t\t\tif ($parsed['scheme'] === '' ||\n\t\t\t    preg_match('/^https?$/i', $parsed['scheme']))\n\t\t\t{\n\t\t\t\tif (method_exists($link, 'getLineNo') &&\n\t\t\t\t    $this->base_location < $link->getLineNo())\n\t\t\t\t{\n\t\t\t\t\t$href =\n\t\t\t\t\t\t$this->registry->call('Misc', 'absolutize_url',\n\t\t\t\t\t\t                      array(trim($link->getAttribute('href')),\n\t\t\t\t\t\t                            $this->base));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$href =\n\t\t\t\t\t\t$this->registry->call('Misc', 'absolutize_url',\n\t\t\t\t\t\t                      array(trim($link->getAttribute('href')),\n\t\t\t\t\t\t                            $this->http_base));\n\t\t\t\t}\n\t\t\t\tif ($href === false)\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t$rel_values = explode(' ', strtolower($link->getAttribute('rel')));\n\t\t\t\tif (in_array($rel, $rel_values))\n\t\t\t\t{\n\t\t\t\t\treturn $href;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic function extension(&$array)\n\t{\n\t\tforeach ($array as $key => $value)\n\t\t{\n\t\t\tif ($this->checked_feeds === $this->max_checked_feeds)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (in_array(strtolower(strrchr($value, '.')), array('.rss', '.rdf', '.atom', '.xml')))\n\t\t\t{\n\t\t\t\t$this->checked_feeds++;\n\n\t\t\t\t$headers = array(\n\t\t\t\t\t'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1',\n\t\t\t\t);\n\t\t\t\t$feed = $this->registry->create('File', array($value, $this->timeout, 5, $headers, $this->useragent, $this->force_fsockopen, $this->curl_options));\n\t\t\t\tif ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed))\n\t\t\t\t{\n\t\t\t\t\treturn array($feed);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tunset($array[$key]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic function body(&$array)\n\t{\n\t\tforeach ($array as $key => $value)\n\t\t{\n\t\t\tif ($this->checked_feeds === $this->max_checked_feeds)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (preg_match('/(feed|rss|rdf|atom|xml)/i', $value))\n\t\t\t{\n\t\t\t\t$this->checked_feeds++;\n\t\t\t\t$headers = array(\n\t\t\t\t\t'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1',\n\t\t\t\t);\n\t\t\t\t$feed = $this->registry->create('File', array($value, $this->timeout, 5, null, $this->useragent, $this->force_fsockopen, $this->curl_options));\n\t\t\t\tif ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed))\n\t\t\t\t{\n\t\t\t\t\treturn array($feed);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tunset($array[$key]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n}\n", "num_lines": 425}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Miscellanous utilities\n *\n * @package SimplePie\n */\nclass SimplePie_Misc\n{\n\tpublic static function time_hms($seconds)\n\t{\n\t\t$time = '';\n\n\t\t$hours = floor($seconds / 3600);\n\t\t$remainder = $seconds % 3600;\n\t\tif ($hours > 0)\n\t\t{\n\t\t\t$time .= $hours.':';\n\t\t}\n\n\t\t$minutes = floor($remainder / 60);\n\t\t$seconds = $remainder % 60;\n\t\tif ($minutes < 10 && $hours > 0)\n\t\t{\n\t\t\t$minutes = '0' . $minutes;\n\t\t}\n\t\tif ($seconds < 10)\n\t\t{\n\t\t\t$seconds = '0' . $seconds;\n\t\t}\n\n\t\t$time .= $minutes.':';\n\t\t$time .= $seconds;\n\n\t\treturn $time;\n\t}\n\n\tpublic static function absolutize_url($relative, $base)\n\t{\n\t\t$iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative);\n\t\tif ($iri === false)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn $iri->get_uri();\n\t}\n\n\t/**\n\t * Get a HTML/XML element from a HTML string\n\t *\n\t * @deprecated Use DOMDocument instead (parsing HTML with regex is bad!)\n\t * @param string $realname Element name (including namespace prefix if applicable)\n\t * @param string $string HTML document\n\t * @return array\n\t */\n\tpublic static function get_element($realname, $string)\n\t{\n\t\t$return = array();\n\t\t$name = preg_quote($realname, '/');\n\t\tif (preg_match_all(\"/<($name)\" . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . \"(>(.*)<\\/$name>|(\\/)?>)/siU\", $string, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE))\n\t\t{\n\t\t\tfor ($i = 0, $total_matches = count($matches); $i < $total_matches; $i++)\n\t\t\t{\n\t\t\t\t$return[$i]['tag'] = $realname;\n\t\t\t\t$return[$i]['full'] = $matches[$i][0][0];\n\t\t\t\t$return[$i]['offset'] = $matches[$i][0][1];\n\t\t\t\tif (strlen($matches[$i][3][0]) <= 2)\n\t\t\t\t{\n\t\t\t\t\t$return[$i]['self_closing'] = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$return[$i]['self_closing'] = false;\n\t\t\t\t\t$return[$i]['content'] = $matches[$i][4][0];\n\t\t\t\t}\n\t\t\t\t$return[$i]['attribs'] = array();\n\t\t\t\tif (isset($matches[$i][2][0]) && preg_match_all('/[\\x09\\x0A\\x0B\\x0C\\x0D\\x20]+([^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x2F\\x3E][^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x2F\\x3D\\x3E]*)(?:[\\x09\\x0A\\x0B\\x0C\\x0D\\x20]*=[\\x09\\x0A\\x0B\\x0C\\x0D\\x20]*(?:\"([^\"]*)\"|\\'([^\\']*)\\'|([^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x22\\x27\\x3E][^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x3E]*)?))?/', ' ' . $matches[$i][2][0] . ' ', $attribs, PREG_SET_ORDER))\n\t\t\t\t{\n\t\t\t\t\tfor ($j = 0, $total_attribs = count($attribs); $j < $total_attribs; $j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (count($attribs[$j]) === 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$attribs[$j][2] = $attribs[$j][1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$return[$i]['attribs'][strtolower($attribs[$j][1])]['data'] = SimplePie_Misc::entities_decode(end($attribs[$j]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $return;\n\t}\n\n\tpublic static function element_implode($element)\n\t{\n\t\t$full = \"<$element[tag]\";\n\t\tforeach ($element['attribs'] as $key => $value)\n\t\t{\n\t\t\t$key = strtolower($key);\n\t\t\t$full .= \" $key=\\\"\" . htmlspecialchars($value['data'], ENT_COMPAT, 'UTF-8') . '\"';\n\t\t}\n\t\tif ($element['self_closing'])\n\t\t{\n\t\t\t$full .= ' />';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$full .= \">$element[content]</$element[tag]>\";\n\t\t}\n\t\treturn $full;\n\t}\n\n\tpublic static function error($message, $level, $file, $line)\n\t{\n\t\tif ((ini_get('error_reporting') & $level) > 0)\n\t\t{\n\t\t\tswitch ($level)\n\t\t\t{\n\t\t\t\tcase E_USER_ERROR:\n\t\t\t\t\t$note = 'PHP Error';\n\t\t\t\t\tbreak;\n\t\t\t\tcase E_USER_WARNING:\n\t\t\t\t\t$note = 'PHP Warning';\n\t\t\t\t\tbreak;\n\t\t\t\tcase E_USER_NOTICE:\n\t\t\t\t\t$note = 'PHP Notice';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$note = 'Unknown Error';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$log_error = true;\n\t\t\tif (!function_exists('error_log'))\n\t\t\t{\n\t\t\t\t$log_error = false;\n\t\t\t}\n\n\t\t\t$log_file = @ini_get('error_log');\n\t\t\tif (!empty($log_file) && ('syslog' !== $log_file) && !@is_writable($log_file))\n\t\t\t{\n\t\t\t\t$log_error = false;\n\t\t\t}\n\n\t\t\tif ($log_error)\n\t\t\t{\n\t\t\t\t@error_log(\"$note: $message in $file on line $line\", 0);\n\t\t\t}\n\t\t}\n\n\t\treturn $message;\n\t}\n\n\tpublic static function fix_protocol($url, $http = 1)\n\t{\n\t\t$url = SimplePie_Misc::normalize_url($url);\n\t\t$parsed = SimplePie_Misc::parse_url($url);\n\t\tif ($parsed['scheme'] !== '' && $parsed['scheme'] !== 'http' && $parsed['scheme'] !== 'https')\n\t\t{\n\t\t\treturn SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['authority'], $parsed['path'], $parsed['query'], $parsed['fragment']), $http);\n\t\t}\n\n\t\tif ($parsed['scheme'] === '' && $parsed['authority'] === '' && !file_exists($url))\n\t\t{\n\t\t\treturn SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['path'], '', $parsed['query'], $parsed['fragment']), $http);\n\t\t}\n\n\t\tif ($http === 2 && $parsed['scheme'] !== '')\n\t\t{\n\t\t\treturn \"feed:$url\";\n\t\t}\n\t\telseif ($http === 3 && strtolower($parsed['scheme']) === 'http')\n\t\t{\n\t\t\treturn substr_replace($url, 'podcast', 0, 4);\n\t\t}\n\t\telseif ($http === 4 && strtolower($parsed['scheme']) === 'http')\n\t\t{\n\t\t\treturn substr_replace($url, 'itpc', 0, 4);\n\t\t}\n\n\t\treturn $url;\n\t}\n\n\tpublic static function array_merge_recursive($array1, $array2)\n\t{\n\t\tforeach ($array2 as $key => $value)\n\t\t{\n\t\t\tif (is_array($value))\n\t\t\t{\n\t\t\t\t$array1[$key] = SimplePie_Misc::array_merge_recursive($array1[$key], $value);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$array1[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $array1;\n\t}\n\n\tpublic static function parse_url($url)\n\t{\n\t\t$iri = new SimplePie_IRI($url);\n\t\treturn array(\n\t\t\t'scheme' => (string) $iri->scheme,\n\t\t\t'authority' => (string) $iri->authority,\n\t\t\t'path' => (string) $iri->path,\n\t\t\t'query' => (string) $iri->query,\n\t\t\t'fragment' => (string) $iri->fragment\n\t\t);\n\t}\n\n\tpublic static function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '')\n\t{\n\t\t$iri = new SimplePie_IRI('');\n\t\t$iri->scheme = $scheme;\n\t\t$iri->authority = $authority;\n\t\t$iri->path = $path;\n\t\t$iri->query = $query;\n\t\t$iri->fragment = $fragment;\n\t\treturn $iri->get_uri();\n\t}\n\n\tpublic static function normalize_url($url)\n\t{\n\t\t$iri = new SimplePie_IRI($url);\n\t\treturn $iri->get_uri();\n\t}\n\n\tpublic static function percent_encoding_normalization($match)\n\t{\n\t\t$integer = hexdec($match[1]);\n\t\tif ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E)\n\t\t{\n\t\t\treturn chr($integer);\n\t\t}\n\n\t\treturn strtoupper($match[0]);\n\t}\n\n\t/**\n\t * Converts a Windows-1252 encoded string to a UTF-8 encoded string\n\t *\n\t * @static\n\t * @param string $string Windows-1252 encoded string\n\t * @return string UTF-8 encoded string\n\t */\n\tpublic static function windows_1252_to_utf8($string)\n\t{\n\t\tstatic $convert_table = array(\"\\x80\" => \"\\xE2\\x82\\xAC\", \"\\x81\" => \"\\xEF\\xBF\\xBD\", \"\\x82\" => \"\\xE2\\x80\\x9A\", \"\\x83\" => \"\\xC6\\x92\", \"\\x84\" => \"\\xE2\\x80\\x9E\", \"\\x85\" => \"\\xE2\\x80\\xA6\", \"\\x86\" => \"\\xE2\\x80\\xA0\", \"\\x87\" => \"\\xE2\\x80\\xA1\", \"\\x88\" => \"\\xCB\\x86\", \"\\x89\" => \"\\xE2\\x80\\xB0\", \"\\x8A\" => \"\\xC5\\xA0\", \"\\x8B\" => \"\\xE2\\x80\\xB9\", \"\\x8C\" => \"\\xC5\\x92\", \"\\x8D\" => \"\\xEF\\xBF\\xBD\", \"\\x8E\" => \"\\xC5\\xBD\", \"\\x8F\" => \"\\xEF\\xBF\\xBD\", \"\\x90\" => \"\\xEF\\xBF\\xBD\", \"\\x91\" => \"\\xE2\\x80\\x98\", \"\\x92\" => \"\\xE2\\x80\\x99\", \"\\x93\" => \"\\xE2\\x80\\x9C\", \"\\x94\" => \"\\xE2\\x80\\x9D\", \"\\x95\" => \"\\xE2\\x80\\xA2\", \"\\x96\" => \"\\xE2\\x80\\x93\", \"\\x97\" => \"\\xE2\\x80\\x94\", \"\\x98\" => \"\\xCB\\x9C\", \"\\x99\" => \"\\xE2\\x84\\xA2\", \"\\x9A\" => \"\\xC5\\xA1\", \"\\x9B\" => \"\\xE2\\x80\\xBA\", \"\\x9C\" => \"\\xC5\\x93\", \"\\x9D\" => \"\\xEF\\xBF\\xBD\", \"\\x9E\" => \"\\xC5\\xBE\", \"\\x9F\" => \"\\xC5\\xB8\", \"\\xA0\" => \"\\xC2\\xA0\", \"\\xA1\" => \"\\xC2\\xA1\", \"\\xA2\" => \"\\xC2\\xA2\", \"\\xA3\" => \"\\xC2\\xA3\", \"\\xA4\" => \"\\xC2\\xA4\", \"\\xA5\" => \"\\xC2\\xA5\", \"\\xA6\" => \"\\xC2\\xA6\", \"\\xA7\" => \"\\xC2\\xA7\", \"\\xA8\" => \"\\xC2\\xA8\", \"\\xA9\" => \"\\xC2\\xA9\", \"\\xAA\" => \"\\xC2\\xAA\", \"\\xAB\" => \"\\xC2\\xAB\", \"\\xAC\" => \"\\xC2\\xAC\", \"\\xAD\" => \"\\xC2\\xAD\", \"\\xAE\" => \"\\xC2\\xAE\", \"\\xAF\" => \"\\xC2\\xAF\", \"\\xB0\" => \"\\xC2\\xB0\", \"\\xB1\" => \"\\xC2\\xB1\", \"\\xB2\" => \"\\xC2\\xB2\", \"\\xB3\" => \"\\xC2\\xB3\", \"\\xB4\" => \"\\xC2\\xB4\", \"\\xB5\" => \"\\xC2\\xB5\", \"\\xB6\" => \"\\xC2\\xB6\", \"\\xB7\" => \"\\xC2\\xB7\", \"\\xB8\" => \"\\xC2\\xB8\", \"\\xB9\" => \"\\xC2\\xB9\", \"\\xBA\" => \"\\xC2\\xBA\", \"\\xBB\" => \"\\xC2\\xBB\", \"\\xBC\" => \"\\xC2\\xBC\", \"\\xBD\" => \"\\xC2\\xBD\", \"\\xBE\" => \"\\xC2\\xBE\", \"\\xBF\" => \"\\xC2\\xBF\", \"\\xC0\" => \"\\xC3\\x80\", \"\\xC1\" => \"\\xC3\\x81\", \"\\xC2\" => \"\\xC3\\x82\", \"\\xC3\" => \"\\xC3\\x83\", \"\\xC4\" => \"\\xC3\\x84\", \"\\xC5\" => \"\\xC3\\x85\", \"\\xC6\" => \"\\xC3\\x86\", \"\\xC7\" => \"\\xC3\\x87\", \"\\xC8\" => \"\\xC3\\x88\", \"\\xC9\" => \"\\xC3\\x89\", \"\\xCA\" => \"\\xC3\\x8A\", \"\\xCB\" => \"\\xC3\\x8B\", \"\\xCC\" => \"\\xC3\\x8C\", \"\\xCD\" => \"\\xC3\\x8D\", \"\\xCE\" => \"\\xC3\\x8E\", \"\\xCF\" => \"\\xC3\\x8F\", \"\\xD0\" => \"\\xC3\\x90\", \"\\xD1\" => \"\\xC3\\x91\", \"\\xD2\" => \"\\xC3\\x92\", \"\\xD3\" => \"\\xC3\\x93\", \"\\xD4\" => \"\\xC3\\x94\", \"\\xD5\" => \"\\xC3\\x95\", \"\\xD6\" => \"\\xC3\\x96\", \"\\xD7\" => \"\\xC3\\x97\", \"\\xD8\" => \"\\xC3\\x98\", \"\\xD9\" => \"\\xC3\\x99\", \"\\xDA\" => \"\\xC3\\x9A\", \"\\xDB\" => \"\\xC3\\x9B\", \"\\xDC\" => \"\\xC3\\x9C\", \"\\xDD\" => \"\\xC3\\x9D\", \"\\xDE\" => \"\\xC3\\x9E\", \"\\xDF\" => \"\\xC3\\x9F\", \"\\xE0\" => \"\\xC3\\xA0\", \"\\xE1\" => \"\\xC3\\xA1\", \"\\xE2\" => \"\\xC3\\xA2\", \"\\xE3\" => \"\\xC3\\xA3\", \"\\xE4\" => \"\\xC3\\xA4\", \"\\xE5\" => \"\\xC3\\xA5\", \"\\xE6\" => \"\\xC3\\xA6\", \"\\xE7\" => \"\\xC3\\xA7\", \"\\xE8\" => \"\\xC3\\xA8\", \"\\xE9\" => \"\\xC3\\xA9\", \"\\xEA\" => \"\\xC3\\xAA\", \"\\xEB\" => \"\\xC3\\xAB\", \"\\xEC\" => \"\\xC3\\xAC\", \"\\xED\" => \"\\xC3\\xAD\", \"\\xEE\" => \"\\xC3\\xAE\", \"\\xEF\" => \"\\xC3\\xAF\", \"\\xF0\" => \"\\xC3\\xB0\", \"\\xF1\" => \"\\xC3\\xB1\", \"\\xF2\" => \"\\xC3\\xB2\", \"\\xF3\" => \"\\xC3\\xB3\", \"\\xF4\" => \"\\xC3\\xB4\", \"\\xF5\" => \"\\xC3\\xB5\", \"\\xF6\" => \"\\xC3\\xB6\", \"\\xF7\" => \"\\xC3\\xB7\", \"\\xF8\" => \"\\xC3\\xB8\", \"\\xF9\" => \"\\xC3\\xB9\", \"\\xFA\" => \"\\xC3\\xBA\", \"\\xFB\" => \"\\xC3\\xBB\", \"\\xFC\" => \"\\xC3\\xBC\", \"\\xFD\" => \"\\xC3\\xBD\", \"\\xFE\" => \"\\xC3\\xBE\", \"\\xFF\" => \"\\xC3\\xBF\");\n\n\t\treturn strtr($string, $convert_table);\n\t}\n\n\t/**\n\t * Change a string from one encoding to another\n\t *\n\t * @param string $data Raw data in $input encoding\n\t * @param string $input Encoding of $data\n\t * @param string $output Encoding you want\n\t * @return string|boolean False if we can't convert it\n\t */\n\tpublic static function change_encoding($data, $input, $output)\n\t{\n\t\t$input = SimplePie_Misc::encoding($input);\n\t\t$output = SimplePie_Misc::encoding($output);\n\n\t\t// We fail to fail on non US-ASCII bytes\n\t\tif ($input === 'US-ASCII')\n\t\t{\n\t\t\tstatic $non_ascii_octects = '';\n\t\t\tif (!$non_ascii_octects)\n\t\t\t{\n\t\t\t\tfor ($i = 0x80; $i <= 0xFF; $i++)\n\t\t\t\t{\n\t\t\t\t\t$non_ascii_octects .= chr($i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = substr($data, 0, strcspn($data, $non_ascii_octects));\n\t\t}\n\n\t\t// This is first, as behaviour of this is completely predictable\n\t\tif ($input === 'windows-1252' && $output === 'UTF-8')\n\t\t{\n\t\t\treturn SimplePie_Misc::windows_1252_to_utf8($data);\n\t\t}\n\t\t// This is second, as behaviour of this varies only with PHP version (the middle part of this expression checks the encoding is supported).\n\t\telseif (function_exists('mb_convert_encoding') && ($return = SimplePie_Misc::change_encoding_mbstring($data, $input, $output)))\n\t\t{\n\t\t\treturn $return;\n \t\t}\n\t\t// This is third, as behaviour of this varies with OS userland and PHP version\n\t\telseif (function_exists('iconv') && ($return = SimplePie_Misc::change_encoding_iconv($data, $input, $output)))\n\t\t{\n\t\t\treturn $return;\n\t\t}\n\t\t// This is last, as behaviour of this varies with OS userland and PHP version\n\t\telseif (class_exists('\\UConverter') && ($return = SimplePie_Misc::change_encoding_uconverter($data, $input, $output)))\n\t\t{\n\t\t\treturn $return;\n\t\t}\n\n\t\t// If we can't do anything, just fail\n\t\treturn false;\n\t}\n\n\tprotected static function change_encoding_mbstring($data, $input, $output)\n\t{\n\t\tif ($input === 'windows-949')\n\t\t{\n\t\t\t$input = 'EUC-KR';\n\t\t}\n\t\tif ($output === 'windows-949')\n\t\t{\n\t\t\t$output = 'EUC-KR';\n\t\t}\n\t\tif ($input === 'Windows-31J')\n\t\t{\n\t\t\t$input = 'SJIS';\n\t\t}\n\t\tif ($output === 'Windows-31J')\n\t\t{\n\t\t\t$output = 'SJIS';\n\t\t}\n\n\t\t// Check that the encoding is supported\n\t\tif (@mb_convert_encoding(\"\\x80\", 'UTF-16BE', $input) === \"\\x00\\x80\")\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (!in_array($input, mb_list_encodings()))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Let's do some conversion\n\t\tif ($return = @mb_convert_encoding($data, $output, $input))\n\t\t{\n\t\t\treturn $return;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprotected static function change_encoding_iconv($data, $input, $output)\n\t{\n\t\treturn @iconv($input, $output, $data);\n\t}\n\n\t/**\n\t * @param string $data\n\t * @param string $input\n\t * @param string $output\n\t * @return string|false\n\t */\n\tprotected static function change_encoding_uconverter($data, $input, $output)\n\t{\n\t\treturn @\\UConverter::transcode($data, $output, $input);\n\t}\n\n\t/**\n\t * Normalize an encoding name\n\t *\n\t * This is automatically generated by create.php\n\t *\n\t * To generate it, run `php create.php` on the command line, and copy the\n\t * output to replace this function.\n\t *\n\t * @param string $charset Character set to standardise\n\t * @return string Standardised name\n\t */\n\tpublic static function encoding($charset)\n\t{\n\t\t// Normalization from UTS #22\n\t\tswitch (strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\\1', $charset)))\n\t\t{\n\t\t\tcase 'adobestandardencoding':\n\t\t\tcase 'csadobestandardencoding':\n\t\t\t\treturn 'Adobe-Standard-Encoding';\n\n\t\t\tcase 'adobesymbolencoding':\n\t\t\tcase 'cshppsmath':\n\t\t\t\treturn 'Adobe-Symbol-Encoding';\n\n\t\t\tcase 'ami1251':\n\t\t\tcase 'amiga1251':\n\t\t\t\treturn 'Amiga-1251';\n\n\t\t\tcase 'ansix31101983':\n\t\t\tcase 'csat5001983':\n\t\t\tcase 'csiso99naplps':\n\t\t\tcase 'isoir99':\n\t\t\tcase 'naplps':\n\t\t\t\treturn 'ANSI_X3.110-1983';\n\n\t\t\tcase 'arabic7':\n\t\t\tcase 'asmo449':\n\t\t\tcase 'csiso89asmo449':\n\t\t\tcase 'iso9036':\n\t\t\tcase 'isoir89':\n\t\t\t\treturn 'ASMO_449';\n\n\t\t\tcase 'big5':\n\t\t\tcase 'csbig5':\n\t\t\t\treturn 'Big5';\n\n\t\t\tcase 'big5hkscs':\n\t\t\t\treturn 'Big5-HKSCS';\n\n\t\t\tcase 'bocu1':\n\t\t\tcase 'csbocu1':\n\t\t\t\treturn 'BOCU-1';\n\n\t\t\tcase 'brf':\n\t\t\tcase 'csbrf':\n\t\t\t\treturn 'BRF';\n\n\t\t\tcase 'bs4730':\n\t\t\tcase 'csiso4unitedkingdom':\n\t\t\tcase 'gb':\n\t\t\tcase 'iso646gb':\n\t\t\tcase 'isoir4':\n\t\t\tcase 'uk':\n\t\t\t\treturn 'BS_4730';\n\n\t\t\tcase 'bsviewdata':\n\t\t\tcase 'csiso47bsviewdata':\n\t\t\tcase 'isoir47':\n\t\t\t\treturn 'BS_viewdata';\n\n\t\t\tcase 'cesu8':\n\t\t\tcase 'cscesu8':\n\t\t\t\treturn 'CESU-8';\n\n\t\t\tcase 'ca':\n\t\t\tcase 'csa71':\n\t\t\tcase 'csaz243419851':\n\t\t\tcase 'csiso121canadian1':\n\t\t\tcase 'iso646ca':\n\t\t\tcase 'isoir121':\n\t\t\t\treturn 'CSA_Z243.4-1985-1';\n\n\t\t\tcase 'csa72':\n\t\t\tcase 'csaz243419852':\n\t\t\tcase 'csiso122canadian2':\n\t\t\tcase 'iso646ca2':\n\t\t\tcase 'isoir122':\n\t\t\t\treturn 'CSA_Z243.4-1985-2';\n\n\t\t\tcase 'csaz24341985gr':\n\t\t\tcase 'csiso123csaz24341985gr':\n\t\t\tcase 'isoir123':\n\t\t\t\treturn 'CSA_Z243.4-1985-gr';\n\n\t\t\tcase 'csiso139csn369103':\n\t\t\tcase 'csn369103':\n\t\t\tcase 'isoir139':\n\t\t\t\treturn 'CSN_369103';\n\n\t\t\tcase 'csdecmcs':\n\t\t\tcase 'dec':\n\t\t\tcase 'decmcs':\n\t\t\t\treturn 'DEC-MCS';\n\n\t\t\tcase 'csiso21german':\n\t\t\tcase 'de':\n\t\t\tcase 'din66003':\n\t\t\tcase 'iso646de':\n\t\t\tcase 'isoir21':\n\t\t\t\treturn 'DIN_66003';\n\n\t\t\tcase 'csdkus':\n\t\t\tcase 'dkus':\n\t\t\t\treturn 'dk-us';\n\n\t\t\tcase 'csiso646danish':\n\t\t\tcase 'dk':\n\t\t\tcase 'ds2089':\n\t\t\tcase 'iso646dk':\n\t\t\t\treturn 'DS_2089';\n\n\t\t\tcase 'csibmebcdicatde':\n\t\t\tcase 'ebcdicatde':\n\t\t\t\treturn 'EBCDIC-AT-DE';\n\n\t\t\tcase 'csebcdicatdea':\n\t\t\tcase 'ebcdicatdea':\n\t\t\t\treturn 'EBCDIC-AT-DE-A';\n\n\t\t\tcase 'csebcdiccafr':\n\t\t\tcase 'ebcdiccafr':\n\t\t\t\treturn 'EBCDIC-CA-FR';\n\n\t\t\tcase 'csebcdicdkno':\n\t\t\tcase 'ebcdicdkno':\n\t\t\t\treturn 'EBCDIC-DK-NO';\n\n\t\t\tcase 'csebcdicdknoa':\n\t\t\tcase 'ebcdicdknoa':\n\t\t\t\treturn 'EBCDIC-DK-NO-A';\n\n\t\t\tcase 'csebcdices':\n\t\t\tcase 'ebcdices':\n\t\t\t\treturn 'EBCDIC-ES';\n\n\t\t\tcase 'csebcdicesa':\n\t\t\tcase 'ebcdicesa':\n\t\t\t\treturn 'EBCDIC-ES-A';\n\n\t\t\tcase 'csebcdicess':\n\t\t\tcase 'ebcdicess':\n\t\t\t\treturn 'EBCDIC-ES-S';\n\n\t\t\tcase 'csebcdicfise':\n\t\t\tcase 'ebcdicfise':\n\t\t\t\treturn 'EBCDIC-FI-SE';\n\n\t\t\tcase 'csebcdicfisea':\n\t\t\tcase 'ebcdicfisea':\n\t\t\t\treturn 'EBCDIC-FI-SE-A';\n\n\t\t\tcase 'csebcdicfr':\n\t\t\tcase 'ebcdicfr':\n\t\t\t\treturn 'EBCDIC-FR';\n\n\t\t\tcase 'csebcdicit':\n\t\t\tcase 'ebcdicit':\n\t\t\t\treturn 'EBCDIC-IT';\n\n\t\t\tcase 'csebcdicpt':\n\t\t\tcase 'ebcdicpt':\n\t\t\t\treturn 'EBCDIC-PT';\n\n\t\t\tcase 'csebcdicuk':\n\t\t\tcase 'ebcdicuk':\n\t\t\t\treturn 'EBCDIC-UK';\n\n\t\t\tcase 'csebcdicus':\n\t\t\tcase 'ebcdicus':\n\t\t\t\treturn 'EBCDIC-US';\n\n\t\t\tcase 'csiso111ecmacyrillic':\n\t\t\tcase 'ecmacyrillic':\n\t\t\tcase 'isoir111':\n\t\t\tcase 'koi8e':\n\t\t\t\treturn 'ECMA-cyrillic';\n\n\t\t\tcase 'csiso17spanish':\n\t\t\tcase 'es':\n\t\t\tcase 'iso646es':\n\t\t\tcase 'isoir17':\n\t\t\t\treturn 'ES';\n\n\t\t\tcase 'csiso85spanish2':\n\t\t\tcase 'es2':\n\t\t\tcase 'iso646es2':\n\t\t\tcase 'isoir85':\n\t\t\t\treturn 'ES2';\n\n\t\t\tcase 'cseucpkdfmtjapanese':\n\t\t\tcase 'eucjp':\n\t\t\tcase 'extendedunixcodepackedformatforjapanese':\n\t\t\t\treturn 'EUC-JP';\n\n\t\t\tcase 'cseucfixwidjapanese':\n\t\t\tcase 'extendedunixcodefixedwidthforjapanese':\n\t\t\t\treturn 'Extended_UNIX_Code_Fixed_Width_for_Japanese';\n\n\t\t\tcase 'gb18030':\n\t\t\t\treturn 'GB18030';\n\n\t\t\tcase 'chinese':\n\t\t\tcase 'cp936':\n\t\t\tcase 'csgb2312':\n\t\t\tcase 'csiso58gb231280':\n\t\t\tcase 'gb2312':\n\t\t\tcase 'gb231280':\n\t\t\tcase 'gbk':\n\t\t\tcase 'isoir58':\n\t\t\tcase 'ms936':\n\t\t\tcase 'windows936':\n\t\t\t\treturn 'GBK';\n\n\t\t\tcase 'cn':\n\t\t\tcase 'csiso57gb1988':\n\t\t\tcase 'gb198880':\n\t\t\tcase 'iso646cn':\n\t\t\tcase 'isoir57':\n\t\t\t\treturn 'GB_1988-80';\n\n\t\t\tcase 'csiso153gost1976874':\n\t\t\tcase 'gost1976874':\n\t\t\tcase 'isoir153':\n\t\t\tcase 'stsev35888':\n\t\t\t\treturn 'GOST_19768-74';\n\n\t\t\tcase 'csiso150':\n\t\t\tcase 'csiso150greekccitt':\n\t\t\tcase 'greekccitt':\n\t\t\tcase 'isoir150':\n\t\t\t\treturn 'greek-ccitt';\n\n\t\t\tcase 'csiso88greek7':\n\t\t\tcase 'greek7':\n\t\t\tcase 'isoir88':\n\t\t\t\treturn 'greek7';\n\n\t\t\tcase 'csiso18greek7old':\n\t\t\tcase 'greek7old':\n\t\t\tcase 'isoir18':\n\t\t\t\treturn 'greek7-old';\n\n\t\t\tcase 'cshpdesktop':\n\t\t\tcase 'hpdesktop':\n\t\t\t\treturn 'HP-DeskTop';\n\n\t\t\tcase 'cshplegal':\n\t\t\tcase 'hplegal':\n\t\t\t\treturn 'HP-Legal';\n\n\t\t\tcase 'cshpmath8':\n\t\t\tcase 'hpmath8':\n\t\t\t\treturn 'HP-Math8';\n\n\t\t\tcase 'cshppifont':\n\t\t\tcase 'hppifont':\n\t\t\t\treturn 'HP-Pi-font';\n\n\t\t\tcase 'cshproman8':\n\t\t\tcase 'hproman8':\n\t\t\tcase 'r8':\n\t\t\tcase 'roman8':\n\t\t\t\treturn 'hp-roman8';\n\n\t\t\tcase 'hzgb2312':\n\t\t\t\treturn 'HZ-GB-2312';\n\n\t\t\tcase 'csibmsymbols':\n\t\t\tcase 'ibmsymbols':\n\t\t\t\treturn 'IBM-Symbols';\n\n\t\t\tcase 'csibmthai':\n\t\t\tcase 'ibmthai':\n\t\t\t\treturn 'IBM-Thai';\n\n\t\t\tcase 'cp37':\n\t\t\tcase 'csibm37':\n\t\t\tcase 'ebcdiccpca':\n\t\t\tcase 'ebcdiccpnl':\n\t\t\tcase 'ebcdiccpus':\n\t\t\tcase 'ebcdiccpwt':\n\t\t\tcase 'ibm37':\n\t\t\t\treturn 'IBM037';\n\n\t\t\tcase 'cp38':\n\t\t\tcase 'csibm38':\n\t\t\tcase 'ebcdicint':\n\t\t\tcase 'ibm38':\n\t\t\t\treturn 'IBM038';\n\n\t\t\tcase 'cp273':\n\t\t\tcase 'csibm273':\n\t\t\tcase 'ibm273':\n\t\t\t\treturn 'IBM273';\n\n\t\t\tcase 'cp274':\n\t\t\tcase 'csibm274':\n\t\t\tcase 'ebcdicbe':\n\t\t\tcase 'ibm274':\n\t\t\t\treturn 'IBM274';\n\n\t\t\tcase 'cp275':\n\t\t\tcase 'csibm275':\n\t\t\tcase 'ebcdicbr':\n\t\t\tcase 'ibm275':\n\t\t\t\treturn 'IBM275';\n\n\t\t\tcase 'csibm277':\n\t\t\tcase 'ebcdiccpdk':\n\t\t\tcase 'ebcdiccpno':\n\t\t\tcase 'ibm277':\n\t\t\t\treturn 'IBM277';\n\n\t\t\tcase 'cp278':\n\t\t\tcase 'csibm278':\n\t\t\tcase 'ebcdiccpfi':\n\t\t\tcase 'ebcdiccpse':\n\t\t\tcase 'ibm278':\n\t\t\t\treturn 'IBM278';\n\n\t\t\tcase 'cp280':\n\t\t\tcase 'csibm280':\n\t\t\tcase 'ebcdiccpit':\n\t\t\tcase 'ibm280':\n\t\t\t\treturn 'IBM280';\n\n\t\t\tcase 'cp281':\n\t\t\tcase 'csibm281':\n\t\t\tcase 'ebcdicjpe':\n\t\t\tcase 'ibm281':\n\t\t\t\treturn 'IBM281';\n\n\t\t\tcase 'cp284':\n\t\t\tcase 'csibm284':\n\t\t\tcase 'ebcdiccpes':\n\t\t\tcase 'ibm284':\n\t\t\t\treturn 'IBM284';\n\n\t\t\tcase 'cp285':\n\t\t\tcase 'csibm285':\n\t\t\tcase 'ebcdiccpgb':\n\t\t\tcase 'ibm285':\n\t\t\t\treturn 'IBM285';\n\n\t\t\tcase 'cp290':\n\t\t\tcase 'csibm290':\n\t\t\tcase 'ebcdicjpkana':\n\t\t\tcase 'ibm290':\n\t\t\t\treturn 'IBM290';\n\n\t\t\tcase 'cp297':\n\t\t\tcase 'csibm297':\n\t\t\tcase 'ebcdiccpfr':\n\t\t\tcase 'ibm297':\n\t\t\t\treturn 'IBM297';\n\n\t\t\tcase 'cp420':\n\t\t\tcase 'csibm420':\n\t\t\tcase 'ebcdiccpar1':\n\t\t\tcase 'ibm420':\n\t\t\t\treturn 'IBM420';\n\n\t\t\tcase 'cp423':\n\t\t\tcase 'csibm423':\n\t\t\tcase 'ebcdiccpgr':\n\t\t\tcase 'ibm423':\n\t\t\t\treturn 'IBM423';\n\n\t\t\tcase 'cp424':\n\t\t\tcase 'csibm424':\n\t\t\tcase 'ebcdiccphe':\n\t\t\tcase 'ibm424':\n\t\t\t\treturn 'IBM424';\n\n\t\t\tcase '437':\n\t\t\tcase 'cp437':\n\t\t\tcase 'cspc8codepage437':\n\t\t\tcase 'ibm437':\n\t\t\t\treturn 'IBM437';\n\n\t\t\tcase 'cp500':\n\t\t\tcase 'csibm500':\n\t\t\tcase 'ebcdiccpbe':\n\t\t\tcase 'ebcdiccpch':\n\t\t\tcase 'ibm500':\n\t\t\t\treturn 'IBM500';\n\n\t\t\tcase 'cp775':\n\t\t\tcase 'cspc775baltic':\n\t\t\tcase 'ibm775':\n\t\t\t\treturn 'IBM775';\n\n\t\t\tcase '850':\n\t\t\tcase 'cp850':\n\t\t\tcase 'cspc850multilingual':\n\t\t\tcase 'ibm850':\n\t\t\t\treturn 'IBM850';\n\n\t\t\tcase '851':\n\t\t\tcase 'cp851':\n\t\t\tcase 'csibm851':\n\t\t\tcase 'ibm851':\n\t\t\t\treturn 'IBM851';\n\n\t\t\tcase '852':\n\t\t\tcase 'cp852':\n\t\t\tcase 'cspcp852':\n\t\t\tcase 'ibm852':\n\t\t\t\treturn 'IBM852';\n\n\t\t\tcase '855':\n\t\t\tcase 'cp855':\n\t\t\tcase 'csibm855':\n\t\t\tcase 'ibm855':\n\t\t\t\treturn 'IBM855';\n\n\t\t\tcase '857':\n\t\t\tcase 'cp857':\n\t\t\tcase 'csibm857':\n\t\t\tcase 'ibm857':\n\t\t\t\treturn 'IBM857';\n\n\t\t\tcase 'ccsid858':\n\t\t\tcase 'cp858':\n\t\t\tcase 'ibm858':\n\t\t\tcase 'pcmultilingual850euro':\n\t\t\t\treturn 'IBM00858';\n\n\t\t\tcase '860':\n\t\t\tcase 'cp860':\n\t\t\tcase 'csibm860':\n\t\t\tcase 'ibm860':\n\t\t\t\treturn 'IBM860';\n\n\t\t\tcase '861':\n\t\t\tcase 'cp861':\n\t\t\tcase 'cpis':\n\t\t\tcase 'csibm861':\n\t\t\tcase 'ibm861':\n\t\t\t\treturn 'IBM861';\n\n\t\t\tcase '862':\n\t\t\tcase 'cp862':\n\t\t\tcase 'cspc862latinhebrew':\n\t\t\tcase 'ibm862':\n\t\t\t\treturn 'IBM862';\n\n\t\t\tcase '863':\n\t\t\tcase 'cp863':\n\t\t\tcase 'csibm863':\n\t\t\tcase 'ibm863':\n\t\t\t\treturn 'IBM863';\n\n\t\t\tcase 'cp864':\n\t\t\tcase 'csibm864':\n\t\t\tcase 'ibm864':\n\t\t\t\treturn 'IBM864';\n\n\t\t\tcase '865':\n\t\t\tcase 'cp865':\n\t\t\tcase 'csibm865':\n\t\t\tcase 'ibm865':\n\t\t\t\treturn 'IBM865';\n\n\t\t\tcase '866':\n\t\t\tcase 'cp866':\n\t\t\tcase 'csibm866':\n\t\t\tcase 'ibm866':\n\t\t\t\treturn 'IBM866';\n\n\t\t\tcase 'cp868':\n\t\t\tcase 'cpar':\n\t\t\tcase 'csibm868':\n\t\t\tcase 'ibm868':\n\t\t\t\treturn 'IBM868';\n\n\t\t\tcase '869':\n\t\t\tcase 'cp869':\n\t\t\tcase 'cpgr':\n\t\t\tcase 'csibm869':\n\t\t\tcase 'ibm869':\n\t\t\t\treturn 'IBM869';\n\n\t\t\tcase 'cp870':\n\t\t\tcase 'csibm870':\n\t\t\tcase 'ebcdiccproece':\n\t\t\tcase 'ebcdiccpyu':\n\t\t\tcase 'ibm870':\n\t\t\t\treturn 'IBM870';\n\n\t\t\tcase 'cp871':\n\t\t\tcase 'csibm871':\n\t\t\tcase 'ebcdiccpis':\n\t\t\tcase 'ibm871':\n\t\t\t\treturn 'IBM871';\n\n\t\t\tcase 'cp880':\n\t\t\tcase 'csibm880':\n\t\t\tcase 'ebcdiccyrillic':\n\t\t\tcase 'ibm880':\n\t\t\t\treturn 'IBM880';\n\n\t\t\tcase 'cp891':\n\t\t\tcase 'csibm891':\n\t\t\tcase 'ibm891':\n\t\t\t\treturn 'IBM891';\n\n\t\t\tcase 'cp903':\n\t\t\tcase 'csibm903':\n\t\t\tcase 'ibm903':\n\t\t\t\treturn 'IBM903';\n\n\t\t\tcase '904':\n\t\t\tcase 'cp904':\n\t\t\tcase 'csibbm904':\n\t\t\tcase 'ibm904':\n\t\t\t\treturn 'IBM904';\n\n\t\t\tcase 'cp905':\n\t\t\tcase 'csibm905':\n\t\t\tcase 'ebcdiccptr':\n\t\t\tcase 'ibm905':\n\t\t\t\treturn 'IBM905';\n\n\t\t\tcase 'cp918':\n\t\t\tcase 'csibm918':\n\t\t\tcase 'ebcdiccpar2':\n\t\t\tcase 'ibm918':\n\t\t\t\treturn 'IBM918';\n\n\t\t\tcase 'ccsid924':\n\t\t\tcase 'cp924':\n\t\t\tcase 'ebcdiclatin9euro':\n\t\t\tcase 'ibm924':\n\t\t\t\treturn 'IBM00924';\n\n\t\t\tcase 'cp1026':\n\t\t\tcase 'csibm1026':\n\t\t\tcase 'ibm1026':\n\t\t\t\treturn 'IBM1026';\n\n\t\t\tcase 'ibm1047':\n\t\t\t\treturn 'IBM1047';\n\n\t\t\tcase 'ccsid1140':\n\t\t\tcase 'cp1140':\n\t\t\tcase 'ebcdicus37euro':\n\t\t\tcase 'ibm1140':\n\t\t\t\treturn 'IBM01140';\n\n\t\t\tcase 'ccsid1141':\n\t\t\tcase 'cp1141':\n\t\t\tcase 'ebcdicde273euro':\n\t\t\tcase 'ibm1141':\n\t\t\t\treturn 'IBM01141';\n\n\t\t\tcase 'ccsid1142':\n\t\t\tcase 'cp1142':\n\t\t\tcase 'ebcdicdk277euro':\n\t\t\tcase 'ebcdicno277euro':\n\t\t\tcase 'ibm1142':\n\t\t\t\treturn 'IBM01142';\n\n\t\t\tcase 'ccsid1143':\n\t\t\tcase 'cp1143':\n\t\t\tcase 'ebcdicfi278euro':\n\t\t\tcase 'ebcdicse278euro':\n\t\t\tcase 'ibm1143':\n\t\t\t\treturn 'IBM01143';\n\n\t\t\tcase 'ccsid1144':\n\t\t\tcase 'cp1144':\n\t\t\tcase 'ebcdicit280euro':\n\t\t\tcase 'ibm1144':\n\t\t\t\treturn 'IBM01144';\n\n\t\t\tcase 'ccsid1145':\n\t\t\tcase 'cp1145':\n\t\t\tcase 'ebcdices284euro':\n\t\t\tcase 'ibm1145':\n\t\t\t\treturn 'IBM01145';\n\n\t\t\tcase 'ccsid1146':\n\t\t\tcase 'cp1146':\n\t\t\tcase 'ebcdicgb285euro':\n\t\t\tcase 'ibm1146':\n\t\t\t\treturn 'IBM01146';\n\n\t\t\tcase 'ccsid1147':\n\t\t\tcase 'cp1147':\n\t\t\tcase 'ebcdicfr297euro':\n\t\t\tcase 'ibm1147':\n\t\t\t\treturn 'IBM01147';\n\n\t\t\tcase 'ccsid1148':\n\t\t\tcase 'cp1148':\n\t\t\tcase 'ebcdicinternational500euro':\n\t\t\tcase 'ibm1148':\n\t\t\t\treturn 'IBM01148';\n\n\t\t\tcase 'ccsid1149':\n\t\t\tcase 'cp1149':\n\t\t\tcase 'ebcdicis871euro':\n\t\t\tcase 'ibm1149':\n\t\t\t\treturn 'IBM01149';\n\n\t\t\tcase 'csiso143iecp271':\n\t\t\tcase 'iecp271':\n\t\t\tcase 'isoir143':\n\t\t\t\treturn 'IEC_P27-1';\n\n\t\t\tcase 'csiso49inis':\n\t\t\tcase 'inis':\n\t\t\tcase 'isoir49':\n\t\t\t\treturn 'INIS';\n\n\t\t\tcase 'csiso50inis8':\n\t\t\tcase 'inis8':\n\t\t\tcase 'isoir50':\n\t\t\t\treturn 'INIS-8';\n\n\t\t\tcase 'csiso51iniscyrillic':\n\t\t\tcase 'iniscyrillic':\n\t\t\tcase 'isoir51':\n\t\t\t\treturn 'INIS-cyrillic';\n\n\t\t\tcase 'csinvariant':\n\t\t\tcase 'invariant':\n\t\t\t\treturn 'INVARIANT';\n\n\t\t\tcase 'iso2022cn':\n\t\t\t\treturn 'ISO-2022-CN';\n\n\t\t\tcase 'iso2022cnext':\n\t\t\t\treturn 'ISO-2022-CN-EXT';\n\n\t\t\tcase 'csiso2022jp':\n\t\t\tcase 'iso2022jp':\n\t\t\t\treturn 'ISO-2022-JP';\n\n\t\t\tcase 'csiso2022jp2':\n\t\t\tcase 'iso2022jp2':\n\t\t\t\treturn 'ISO-2022-JP-2';\n\n\t\t\tcase 'csiso2022kr':\n\t\t\tcase 'iso2022kr':\n\t\t\t\treturn 'ISO-2022-KR';\n\n\t\t\tcase 'cswindows30latin1':\n\t\t\tcase 'iso88591windows30latin1':\n\t\t\t\treturn 'ISO-8859-1-Windows-3.0-Latin-1';\n\n\t\t\tcase 'cswindows31latin1':\n\t\t\tcase 'iso88591windows31latin1':\n\t\t\t\treturn 'ISO-8859-1-Windows-3.1-Latin-1';\n\n\t\t\tcase 'csisolatin2':\n\t\t\tcase 'iso88592':\n\t\t\tcase 'iso885921987':\n\t\t\tcase 'isoir101':\n\t\t\tcase 'l2':\n\t\t\tcase 'latin2':\n\t\t\t\treturn 'ISO-8859-2';\n\n\t\t\tcase 'cswindows31latin2':\n\t\t\tcase 'iso88592windowslatin2':\n\t\t\t\treturn 'ISO-8859-2-Windows-Latin-2';\n\n\t\t\tcase 'csisolatin3':\n\t\t\tcase 'iso88593':\n\t\t\tcase 'iso885931988':\n\t\t\tcase 'isoir109':\n\t\t\tcase 'l3':\n\t\t\tcase 'latin3':\n\t\t\t\treturn 'ISO-8859-3';\n\n\t\t\tcase 'csisolatin4':\n\t\t\tcase 'iso88594':\n\t\t\tcase 'iso885941988':\n\t\t\tcase 'isoir110':\n\t\t\tcase 'l4':\n\t\t\tcase 'latin4':\n\t\t\t\treturn 'ISO-8859-4';\n\n\t\t\tcase 'csisolatincyrillic':\n\t\t\tcase 'cyrillic':\n\t\t\tcase 'iso88595':\n\t\t\tcase 'iso885951988':\n\t\t\tcase 'isoir144':\n\t\t\t\treturn 'ISO-8859-5';\n\n\t\t\tcase 'arabic':\n\t\t\tcase 'asmo708':\n\t\t\tcase 'csisolatinarabic':\n\t\t\tcase 'ecma114':\n\t\t\tcase 'iso88596':\n\t\t\tcase 'iso885961987':\n\t\t\tcase 'isoir127':\n\t\t\t\treturn 'ISO-8859-6';\n\n\t\t\tcase 'csiso88596e':\n\t\t\tcase 'iso88596e':\n\t\t\t\treturn 'ISO-8859-6-E';\n\n\t\t\tcase 'csiso88596i':\n\t\t\tcase 'iso88596i':\n\t\t\t\treturn 'ISO-8859-6-I';\n\n\t\t\tcase 'csisolatingreek':\n\t\t\tcase 'ecma118':\n\t\t\tcase 'elot928':\n\t\t\tcase 'greek':\n\t\t\tcase 'greek8':\n\t\t\tcase 'iso88597':\n\t\t\tcase 'iso885971987':\n\t\t\tcase 'isoir126':\n\t\t\t\treturn 'ISO-8859-7';\n\n\t\t\tcase 'csisolatinhebrew':\n\t\t\tcase 'hebrew':\n\t\t\tcase 'iso88598':\n\t\t\tcase 'iso885981988':\n\t\t\tcase 'isoir138':\n\t\t\t\treturn 'ISO-8859-8';\n\n\t\t\tcase 'csiso88598e':\n\t\t\tcase 'iso88598e':\n\t\t\t\treturn 'ISO-8859-8-E';\n\n\t\t\tcase 'csiso88598i':\n\t\t\tcase 'iso88598i':\n\t\t\t\treturn 'ISO-8859-8-I';\n\n\t\t\tcase 'cswindows31latin5':\n\t\t\tcase 'iso88599windowslatin5':\n\t\t\t\treturn 'ISO-8859-9-Windows-Latin-5';\n\n\t\t\tcase 'csisolatin6':\n\t\t\tcase 'iso885910':\n\t\t\tcase 'iso8859101992':\n\t\t\tcase 'isoir157':\n\t\t\tcase 'l6':\n\t\t\tcase 'latin6':\n\t\t\t\treturn 'ISO-8859-10';\n\n\t\t\tcase 'iso885913':\n\t\t\t\treturn 'ISO-8859-13';\n\n\t\t\tcase 'iso885914':\n\t\t\tcase 'iso8859141998':\n\t\t\tcase 'isoceltic':\n\t\t\tcase 'isoir199':\n\t\t\tcase 'l8':\n\t\t\tcase 'latin8':\n\t\t\t\treturn 'ISO-8859-14';\n\n\t\t\tcase 'iso885915':\n\t\t\tcase 'latin9':\n\t\t\t\treturn 'ISO-8859-15';\n\n\t\t\tcase 'iso885916':\n\t\t\tcase 'iso8859162001':\n\t\t\tcase 'isoir226':\n\t\t\tcase 'l10':\n\t\t\tcase 'latin10':\n\t\t\t\treturn 'ISO-8859-16';\n\n\t\t\tcase 'iso10646j1':\n\t\t\t\treturn 'ISO-10646-J-1';\n\n\t\t\tcase 'csunicode':\n\t\t\tcase 'iso10646ucs2':\n\t\t\t\treturn 'ISO-10646-UCS-2';\n\n\t\t\tcase 'csucs4':\n\t\t\tcase 'iso10646ucs4':\n\t\t\t\treturn 'ISO-10646-UCS-4';\n\n\t\t\tcase 'csunicodeascii':\n\t\t\tcase 'iso10646ucsbasic':\n\t\t\t\treturn 'ISO-10646-UCS-Basic';\n\n\t\t\tcase 'csunicodelatin1':\n\t\t\tcase 'iso10646':\n\t\t\tcase 'iso10646unicodelatin1':\n\t\t\t\treturn 'ISO-10646-Unicode-Latin1';\n\n\t\t\tcase 'csiso10646utf1':\n\t\t\tcase 'iso10646utf1':\n\t\t\t\treturn 'ISO-10646-UTF-1';\n\n\t\t\tcase 'csiso115481':\n\t\t\tcase 'iso115481':\n\t\t\tcase 'isotr115481':\n\t\t\t\treturn 'ISO-11548-1';\n\n\t\t\tcase 'csiso90':\n\t\t\tcase 'isoir90':\n\t\t\t\treturn 'iso-ir-90';\n\n\t\t\tcase 'csunicodeibm1261':\n\t\t\tcase 'isounicodeibm1261':\n\t\t\t\treturn 'ISO-Unicode-IBM-1261';\n\n\t\t\tcase 'csunicodeibm1264':\n\t\t\tcase 'isounicodeibm1264':\n\t\t\t\treturn 'ISO-Unicode-IBM-1264';\n\n\t\t\tcase 'csunicodeibm1265':\n\t\t\tcase 'isounicodeibm1265':\n\t\t\t\treturn 'ISO-Unicode-IBM-1265';\n\n\t\t\tcase 'csunicodeibm1268':\n\t\t\tcase 'isounicodeibm1268':\n\t\t\t\treturn 'ISO-Unicode-IBM-1268';\n\n\t\t\tcase 'csunicodeibm1276':\n\t\t\tcase 'isounicodeibm1276':\n\t\t\t\treturn 'ISO-Unicode-IBM-1276';\n\n\t\t\tcase 'csiso646basic1983':\n\t\t\tcase 'iso646basic1983':\n\t\t\tcase 'ref':\n\t\t\t\treturn 'ISO_646.basic:1983';\n\n\t\t\tcase 'csiso2intlrefversion':\n\t\t\tcase 'irv':\n\t\t\tcase 'iso646irv1983':\n\t\t\tcase 'isoir2':\n\t\t\t\treturn 'ISO_646.irv:1983';\n\n\t\t\tcase 'csiso2033':\n\t\t\tcase 'e13b':\n\t\t\tcase 'iso20331983':\n\t\t\tcase 'isoir98':\n\t\t\t\treturn 'ISO_2033-1983';\n\n\t\t\tcase 'csiso5427cyrillic':\n\t\t\tcase 'iso5427':\n\t\t\tcase 'isoir37':\n\t\t\t\treturn 'ISO_5427';\n\n\t\t\tcase 'iso5427cyrillic1981':\n\t\t\tcase 'iso54271981':\n\t\t\tcase 'isoir54':\n\t\t\t\treturn 'ISO_5427:1981';\n\n\t\t\tcase 'csiso5428greek':\n\t\t\tcase 'iso54281980':\n\t\t\tcase 'isoir55':\n\t\t\t\treturn 'ISO_5428:1980';\n\n\t\t\tcase 'csiso6937add':\n\t\t\tcase 'iso6937225':\n\t\t\tcase 'isoir152':\n\t\t\t\treturn 'ISO_6937-2-25';\n\n\t\t\tcase 'csisotextcomm':\n\t\t\tcase 'iso69372add':\n\t\t\tcase 'isoir142':\n\t\t\t\treturn 'ISO_6937-2-add';\n\n\t\t\tcase 'csiso8859supp':\n\t\t\tcase 'iso8859supp':\n\t\t\tcase 'isoir154':\n\t\t\tcase 'latin125':\n\t\t\t\treturn 'ISO_8859-supp';\n\n\t\t\tcase 'csiso10367box':\n\t\t\tcase 'iso10367box':\n\t\t\tcase 'isoir155':\n\t\t\t\treturn 'ISO_10367-box';\n\n\t\t\tcase 'csiso15italian':\n\t\t\tcase 'iso646it':\n\t\t\tcase 'isoir15':\n\t\t\tcase 'it':\n\t\t\t\treturn 'IT';\n\n\t\t\tcase 'csiso13jisc6220jp':\n\t\t\tcase 'isoir13':\n\t\t\tcase 'jisc62201969':\n\t\t\tcase 'jisc62201969jp':\n\t\t\tcase 'katakana':\n\t\t\tcase 'x2017':\n\t\t\t\treturn 'JIS_C6220-1969-jp';\n\n\t\t\tcase 'csiso14jisc6220ro':\n\t\t\tcase 'iso646jp':\n\t\t\tcase 'isoir14':\n\t\t\tcase 'jisc62201969ro':\n\t\t\tcase 'jp':\n\t\t\t\treturn 'JIS_C6220-1969-ro';\n\n\t\t\tcase 'csiso42jisc62261978':\n\t\t\tcase 'isoir42':\n\t\t\tcase 'jisc62261978':\n\t\t\t\treturn 'JIS_C6226-1978';\n\n\t\t\tcase 'csiso87jisx208':\n\t\t\tcase 'isoir87':\n\t\t\tcase 'jisc62261983':\n\t\t\tcase 'jisx2081983':\n\t\t\tcase 'x208':\n\t\t\t\treturn 'JIS_C6226-1983';\n\n\t\t\tcase 'csiso91jisc62291984a':\n\t\t\tcase 'isoir91':\n\t\t\tcase 'jisc62291984a':\n\t\t\tcase 'jpocra':\n\t\t\t\treturn 'JIS_C6229-1984-a';\n\n\t\t\tcase 'csiso92jisc62991984b':\n\t\t\tcase 'iso646jpocrb':\n\t\t\tcase 'isoir92':\n\t\t\tcase 'jisc62291984b':\n\t\t\tcase 'jpocrb':\n\t\t\t\treturn 'JIS_C6229-1984-b';\n\n\t\t\tcase 'csiso93jis62291984badd':\n\t\t\tcase 'isoir93':\n\t\t\tcase 'jisc62291984badd':\n\t\t\tcase 'jpocrbadd':\n\t\t\t\treturn 'JIS_C6229-1984-b-add';\n\n\t\t\tcase 'csiso94jis62291984hand':\n\t\t\tcase 'isoir94':\n\t\t\tcase 'jisc62291984hand':\n\t\t\tcase 'jpocrhand':\n\t\t\t\treturn 'JIS_C6229-1984-hand';\n\n\t\t\tcase 'csiso95jis62291984handadd':\n\t\t\tcase 'isoir95':\n\t\t\tcase 'jisc62291984handadd':\n\t\t\tcase 'jpocrhandadd':\n\t\t\t\treturn 'JIS_C6229-1984-hand-add';\n\n\t\t\tcase 'csiso96jisc62291984kana':\n\t\t\tcase 'isoir96':\n\t\t\tcase 'jisc62291984kana':\n\t\t\t\treturn 'JIS_C6229-1984-kana';\n\n\t\t\tcase 'csjisencoding':\n\t\t\tcase 'jisencoding':\n\t\t\t\treturn 'JIS_Encoding';\n\n\t\t\tcase 'cshalfwidthkatakana':\n\t\t\tcase 'jisx201':\n\t\t\tcase 'x201':\n\t\t\t\treturn 'JIS_X0201';\n\n\t\t\tcase 'csiso159jisx2121990':\n\t\t\tcase 'isoir159':\n\t\t\tcase 'jisx2121990':\n\t\t\tcase 'x212':\n\t\t\t\treturn 'JIS_X0212-1990';\n\n\t\t\tcase 'csiso141jusib1002':\n\t\t\tcase 'iso646yu':\n\t\t\tcase 'isoir141':\n\t\t\tcase 'js':\n\t\t\tcase 'jusib1002':\n\t\t\tcase 'yu':\n\t\t\t\treturn 'JUS_I.B1.002';\n\n\t\t\tcase 'csiso147macedonian':\n\t\t\tcase 'isoir147':\n\t\t\tcase 'jusib1003mac':\n\t\t\tcase 'macedonian':\n\t\t\t\treturn 'JUS_I.B1.003-mac';\n\n\t\t\tcase 'csiso146serbian':\n\t\t\tcase 'isoir146':\n\t\t\tcase 'jusib1003serb':\n\t\t\tcase 'serbian':\n\t\t\t\treturn 'JUS_I.B1.003-serb';\n\n\t\t\tcase 'koi7switched':\n\t\t\t\treturn 'KOI7-switched';\n\n\t\t\tcase 'cskoi8r':\n\t\t\tcase 'koi8r':\n\t\t\t\treturn 'KOI8-R';\n\n\t\t\tcase 'koi8u':\n\t\t\t\treturn 'KOI8-U';\n\n\t\t\tcase 'csksc5636':\n\t\t\tcase 'iso646kr':\n\t\t\tcase 'ksc5636':\n\t\t\t\treturn 'KSC5636';\n\n\t\t\tcase 'cskz1048':\n\t\t\tcase 'kz1048':\n\t\t\tcase 'rk1048':\n\t\t\tcase 'strk10482002':\n\t\t\t\treturn 'KZ-1048';\n\n\t\t\tcase 'csiso19latingreek':\n\t\t\tcase 'isoir19':\n\t\t\tcase 'latingreek':\n\t\t\t\treturn 'latin-greek';\n\n\t\t\tcase 'csiso27latingreek1':\n\t\t\tcase 'isoir27':\n\t\t\tcase 'latingreek1':\n\t\t\t\treturn 'Latin-greek-1';\n\n\t\t\tcase 'csiso158lap':\n\t\t\tcase 'isoir158':\n\t\t\tcase 'lap':\n\t\t\tcase 'latinlap':\n\t\t\t\treturn 'latin-lap';\n\n\t\t\tcase 'csmacintosh':\n\t\t\tcase 'mac':\n\t\t\tcase 'macintosh':\n\t\t\t\treturn 'macintosh';\n\n\t\t\tcase 'csmicrosoftpublishing':\n\t\t\tcase 'microsoftpublishing':\n\t\t\t\treturn 'Microsoft-Publishing';\n\n\t\t\tcase 'csmnem':\n\t\t\tcase 'mnem':\n\t\t\t\treturn 'MNEM';\n\n\t\t\tcase 'csmnemonic':\n\t\t\tcase 'mnemonic':\n\t\t\t\treturn 'MNEMONIC';\n\n\t\t\tcase 'csiso86hungarian':\n\t\t\tcase 'hu':\n\t\t\tcase 'iso646hu':\n\t\t\tcase 'isoir86':\n\t\t\tcase 'msz77953':\n\t\t\t\treturn 'MSZ_7795.3';\n\n\t\t\tcase 'csnatsdano':\n\t\t\tcase 'isoir91':\n\t\t\tcase 'natsdano':\n\t\t\t\treturn 'NATS-DANO';\n\n\t\t\tcase 'csnatsdanoadd':\n\t\t\tcase 'isoir92':\n\t\t\tcase 'natsdanoadd':\n\t\t\t\treturn 'NATS-DANO-ADD';\n\n\t\t\tcase 'csnatssefi':\n\t\t\tcase 'isoir81':\n\t\t\tcase 'natssefi':\n\t\t\t\treturn 'NATS-SEFI';\n\n\t\t\tcase 'csnatssefiadd':\n\t\t\tcase 'isoir82':\n\t\t\tcase 'natssefiadd':\n\t\t\t\treturn 'NATS-SEFI-ADD';\n\n\t\t\tcase 'csiso151cuba':\n\t\t\tcase 'cuba':\n\t\t\tcase 'iso646cu':\n\t\t\tcase 'isoir151':\n\t\t\tcase 'ncnc1081':\n\t\t\t\treturn 'NC_NC00-10:81';\n\n\t\t\tcase 'csiso69french':\n\t\t\tcase 'fr':\n\t\t\tcase 'iso646fr':\n\t\t\tcase 'isoir69':\n\t\t\tcase 'nfz62010':\n\t\t\t\treturn 'NF_Z_62-010';\n\n\t\t\tcase 'csiso25french':\n\t\t\tcase 'iso646fr1':\n\t\t\tcase 'isoir25':\n\t\t\tcase 'nfz620101973':\n\t\t\t\treturn 'NF_Z_62-010_(1973)';\n\n\t\t\tcase 'csiso60danishnorwegian':\n\t\t\tcase 'csiso60norwegian1':\n\t\t\tcase 'iso646no':\n\t\t\tcase 'isoir60':\n\t\t\tcase 'no':\n\t\t\tcase 'ns45511':\n\t\t\t\treturn 'NS_4551-1';\n\n\t\t\tcase 'csiso61norwegian2':\n\t\t\tcase 'iso646no2':\n\t\t\tcase 'isoir61':\n\t\t\tcase 'no2':\n\t\t\tcase 'ns45512':\n\t\t\t\treturn 'NS_4551-2';\n\n\t\t\tcase 'osdebcdicdf3irv':\n\t\t\t\treturn 'OSD_EBCDIC_DF03_IRV';\n\n\t\t\tcase 'osdebcdicdf41':\n\t\t\t\treturn 'OSD_EBCDIC_DF04_1';\n\n\t\t\tcase 'osdebcdicdf415':\n\t\t\t\treturn 'OSD_EBCDIC_DF04_15';\n\n\t\t\tcase 'cspc8danishnorwegian':\n\t\t\tcase 'pc8danishnorwegian':\n\t\t\t\treturn 'PC8-Danish-Norwegian';\n\n\t\t\tcase 'cspc8turkish':\n\t\t\tcase 'pc8turkish':\n\t\t\t\treturn 'PC8-Turkish';\n\n\t\t\tcase 'csiso16portuguese':\n\t\t\tcase 'iso646pt':\n\t\t\tcase 'isoir16':\n\t\t\tcase 'pt':\n\t\t\t\treturn 'PT';\n\n\t\t\tcase 'csiso84portuguese2':\n\t\t\tcase 'iso646pt2':\n\t\t\tcase 'isoir84':\n\t\t\tcase 'pt2':\n\t\t\t\treturn 'PT2';\n\n\t\t\tcase 'cp154':\n\t\t\tcase 'csptcp154':\n\t\t\tcase 'cyrillicasian':\n\t\t\tcase 'pt154':\n\t\t\tcase 'ptcp154':\n\t\t\t\treturn 'PTCP154';\n\n\t\t\tcase 'scsu':\n\t\t\t\treturn 'SCSU';\n\n\t\t\tcase 'csiso10swedish':\n\t\t\tcase 'fi':\n\t\t\tcase 'iso646fi':\n\t\t\tcase 'iso646se':\n\t\t\tcase 'isoir10':\n\t\t\tcase 'se':\n\t\t\tcase 'sen850200b':\n\t\t\t\treturn 'SEN_850200_B';\n\n\t\t\tcase 'csiso11swedishfornames':\n\t\t\tcase 'iso646se2':\n\t\t\tcase 'isoir11':\n\t\t\tcase 'se2':\n\t\t\tcase 'sen850200c':\n\t\t\t\treturn 'SEN_850200_C';\n\n\t\t\tcase 'csiso102t617bit':\n\t\t\tcase 'isoir102':\n\t\t\tcase 't617bit':\n\t\t\t\treturn 'T.61-7bit';\n\n\t\t\tcase 'csiso103t618bit':\n\t\t\tcase 'isoir103':\n\t\t\tcase 't61':\n\t\t\tcase 't618bit':\n\t\t\t\treturn 'T.61-8bit';\n\n\t\t\tcase 'csiso128t101g2':\n\t\t\tcase 'isoir128':\n\t\t\tcase 't101g2':\n\t\t\t\treturn 'T.101-G2';\n\n\t\t\tcase 'cstscii':\n\t\t\tcase 'tscii':\n\t\t\t\treturn 'TSCII';\n\n\t\t\tcase 'csunicode11':\n\t\t\tcase 'unicode11':\n\t\t\t\treturn 'UNICODE-1-1';\n\n\t\t\tcase 'csunicode11utf7':\n\t\t\tcase 'unicode11utf7':\n\t\t\t\treturn 'UNICODE-1-1-UTF-7';\n\n\t\t\tcase 'csunknown8bit':\n\t\t\tcase 'unknown8bit':\n\t\t\t\treturn 'UNKNOWN-8BIT';\n\n\t\t\tcase 'ansix341968':\n\t\t\tcase 'ansix341986':\n\t\t\tcase 'ascii':\n\t\t\tcase 'cp367':\n\t\t\tcase 'csascii':\n\t\t\tcase 'ibm367':\n\t\t\tcase 'iso646irv1991':\n\t\t\tcase 'iso646us':\n\t\t\tcase 'isoir6':\n\t\t\tcase 'us':\n\t\t\tcase 'usascii':\n\t\t\t\treturn 'US-ASCII';\n\n\t\t\tcase 'csusdk':\n\t\t\tcase 'usdk':\n\t\t\t\treturn 'us-dk';\n\n\t\t\tcase 'utf7':\n\t\t\t\treturn 'UTF-7';\n\n\t\t\tcase 'utf8':\n\t\t\t\treturn 'UTF-8';\n\n\t\t\tcase 'utf16':\n\t\t\t\treturn 'UTF-16';\n\n\t\t\tcase 'utf16be':\n\t\t\t\treturn 'UTF-16BE';\n\n\t\t\tcase 'utf16le':\n\t\t\t\treturn 'UTF-16LE';\n\n\t\t\tcase 'utf32':\n\t\t\t\treturn 'UTF-32';\n\n\t\t\tcase 'utf32be':\n\t\t\t\treturn 'UTF-32BE';\n\n\t\t\tcase 'utf32le':\n\t\t\t\treturn 'UTF-32LE';\n\n\t\t\tcase 'csventurainternational':\n\t\t\tcase 'venturainternational':\n\t\t\t\treturn 'Ventura-International';\n\n\t\t\tcase 'csventuramath':\n\t\t\tcase 'venturamath':\n\t\t\t\treturn 'Ventura-Math';\n\n\t\t\tcase 'csventuraus':\n\t\t\tcase 'venturaus':\n\t\t\t\treturn 'Ventura-US';\n\n\t\t\tcase 'csiso70videotexsupp1':\n\t\t\tcase 'isoir70':\n\t\t\tcase 'videotexsuppl':\n\t\t\t\treturn 'videotex-suppl';\n\n\t\t\tcase 'csviqr':\n\t\t\tcase 'viqr':\n\t\t\t\treturn 'VIQR';\n\n\t\t\tcase 'csviscii':\n\t\t\tcase 'viscii':\n\t\t\t\treturn 'VISCII';\n\n\t\t\tcase 'csshiftjis':\n\t\t\tcase 'cswindows31j':\n\t\t\tcase 'mskanji':\n\t\t\tcase 'shiftjis':\n\t\t\tcase 'windows31j':\n\t\t\t\treturn 'Windows-31J';\n\n\t\t\tcase 'iso885911':\n\t\t\tcase 'tis620':\n\t\t\t\treturn 'windows-874';\n\n\t\t\tcase 'cseuckr':\n\t\t\tcase 'csksc56011987':\n\t\t\tcase 'euckr':\n\t\t\tcase 'isoir149':\n\t\t\tcase 'korean':\n\t\t\tcase 'ksc5601':\n\t\t\tcase 'ksc56011987':\n\t\t\tcase 'ksc56011989':\n\t\t\tcase 'windows949':\n\t\t\t\treturn 'windows-949';\n\n\t\t\tcase 'windows1250':\n\t\t\t\treturn 'windows-1250';\n\n\t\t\tcase 'windows1251':\n\t\t\t\treturn 'windows-1251';\n\n\t\t\tcase 'cp819':\n\t\t\tcase 'csisolatin1':\n\t\t\tcase 'ibm819':\n\t\t\tcase 'iso88591':\n\t\t\tcase 'iso885911987':\n\t\t\tcase 'isoir100':\n\t\t\tcase 'l1':\n\t\t\tcase 'latin1':\n\t\t\tcase 'windows1252':\n\t\t\t\treturn 'windows-1252';\n\n\t\t\tcase 'windows1253':\n\t\t\t\treturn 'windows-1253';\n\n\t\t\tcase 'csisolatin5':\n\t\t\tcase 'iso88599':\n\t\t\tcase 'iso885991989':\n\t\t\tcase 'isoir148':\n\t\t\tcase 'l5':\n\t\t\tcase 'latin5':\n\t\t\tcase 'windows1254':\n\t\t\t\treturn 'windows-1254';\n\n\t\t\tcase 'windows1255':\n\t\t\t\treturn 'windows-1255';\n\n\t\t\tcase 'windows1256':\n\t\t\t\treturn 'windows-1256';\n\n\t\t\tcase 'windows1257':\n\t\t\t\treturn 'windows-1257';\n\n\t\t\tcase 'windows1258':\n\t\t\t\treturn 'windows-1258';\n\n\t\t\tdefault:\n\t\t\t\treturn $charset;\n\t\t}\n\t}\n\n\tpublic static function get_curl_version()\n\t{\n\t\tif (is_array($curl = curl_version()))\n\t\t{\n\t\t\t$curl = $curl['version'];\n\t\t}\n\t\telseif (substr($curl, 0, 5) === 'curl/')\n\t\t{\n\t\t\t$curl = substr($curl, 5, strcspn($curl, \"\\x09\\x0A\\x0B\\x0C\\x0D\", 5));\n\t\t}\n\t\telseif (substr($curl, 0, 8) === 'libcurl/')\n\t\t{\n\t\t\t$curl = substr($curl, 8, strcspn($curl, \"\\x09\\x0A\\x0B\\x0C\\x0D\", 8));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$curl = 0;\n\t\t}\n\t\treturn $curl;\n\t}\n\n\t/**\n\t * Strip HTML comments\n\t *\n\t * @param string $data Data to strip comments from\n\t * @return string Comment stripped string\n\t */\n\tpublic static function strip_comments($data)\n\t{\n\t\t$output = '';\n\t\twhile (($start = strpos($data, '<!--')) !== false)\n\t\t{\n\t\t\t$output .= substr($data, 0, $start);\n\t\t\tif (($end = strpos($data, '-->', $start)) !== false)\n\t\t\t{\n\t\t\t\t$data = substr_replace($data, '', 0, $end + 3);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data = '';\n\t\t\t}\n\t\t}\n\t\treturn $output . $data;\n\t}\n\n\tpublic static function parse_date($dt)\n\t{\n\t\t$parser = SimplePie_Parse_Date::get();\n\t\treturn $parser->parse($dt);\n\t}\n\n\t/**\n\t * Decode HTML entities\n\t *\n\t * @deprecated Use DOMDocument instead\n\t * @param string $data Input data\n\t * @return string Output data\n\t */\n\tpublic static function entities_decode($data)\n\t{\n\t\t$decoder = new SimplePie_Decode_HTML_Entities($data);\n\t\treturn $decoder->parse();\n\t}\n\n\t/**\n\t * Remove RFC822 comments\n\t *\n\t * @param string $data Data to strip comments from\n\t * @return string Comment stripped string\n\t */\n\tpublic static function uncomment_rfc822($string)\n\t{\n\t\t$string = (string) $string;\n\t\t$position = 0;\n\t\t$length = strlen($string);\n\t\t$depth = 0;\n\n\t\t$output = '';\n\n\t\twhile ($position < $length && ($pos = strpos($string, '(', $position)) !== false)\n\t\t{\n\t\t\t$output .= substr($string, $position, $pos - $position);\n\t\t\t$position = $pos + 1;\n\t\t\tif ($string[$pos - 1] !== '\\\\')\n\t\t\t{\n\t\t\t\t$depth++;\n\t\t\t\twhile ($depth && $position < $length)\n\t\t\t\t{\n\t\t\t\t\t$position += strcspn($string, '()', $position);\n\t\t\t\t\tif ($string[$position - 1] === '\\\\')\n\t\t\t\t\t{\n\t\t\t\t\t\t$position++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\telseif (isset($string[$position]))\n\t\t\t\t\t{\n\t\t\t\t\t\tswitch ($string[$position])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase '(':\n\t\t\t\t\t\t\t\t$depth++;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase ')':\n\t\t\t\t\t\t\t\t$depth--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$position++;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$output .= '(';\n\t\t\t}\n\t\t}\n\t\t$output .= substr($string, $position);\n\n\t\treturn $output;\n\t}\n\n\tpublic static function parse_mime($mime)\n\t{\n\t\tif (($pos = strpos($mime, ';')) === false)\n\t\t{\n\t\t\treturn trim($mime);\n\t\t}\n\n\t\treturn trim(substr($mime, 0, $pos));\n\t}\n\n\tpublic static function atom_03_construct_type($attribs)\n\t{\n\t\tif (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64'))\n\t\t{\n\t\t\t$mode = SIMPLEPIE_CONSTRUCT_BASE64;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$mode = SIMPLEPIE_CONSTRUCT_NONE;\n\t\t}\n\t\tif (isset($attribs['']['type']))\n\t\t{\n\t\t\tswitch (strtolower(trim($attribs['']['type'])))\n\t\t\t{\n\t\t\t\tcase 'text':\n\t\t\t\tcase 'text/plain':\n\t\t\t\t\treturn SIMPLEPIE_CONSTRUCT_TEXT | $mode;\n\n\t\t\t\tcase 'html':\n\t\t\t\tcase 'text/html':\n\t\t\t\t\treturn SIMPLEPIE_CONSTRUCT_HTML | $mode;\n\n\t\t\t\tcase 'xhtml':\n\t\t\t\tcase 'application/xhtml+xml':\n\t\t\t\t\treturn SIMPLEPIE_CONSTRUCT_XHTML | $mode;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn SIMPLEPIE_CONSTRUCT_NONE | $mode;\n\t\t\t}\n\t\t}\n\n\t\treturn SIMPLEPIE_CONSTRUCT_TEXT | $mode;\n\t}\n\n\tpublic static function atom_10_construct_type($attribs)\n\t{\n\t\tif (isset($attribs['']['type']))\n\t\t{\n\t\t\tswitch (strtolower(trim($attribs['']['type'])))\n\t\t\t{\n\t\t\t\tcase 'text':\n\t\t\t\t\treturn SIMPLEPIE_CONSTRUCT_TEXT;\n\n\t\t\t\tcase 'html':\n\t\t\t\t\treturn SIMPLEPIE_CONSTRUCT_HTML;\n\n\t\t\t\tcase 'xhtml':\n\t\t\t\t\treturn SIMPLEPIE_CONSTRUCT_XHTML;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn SIMPLEPIE_CONSTRUCT_NONE;\n\t\t\t}\n\t\t}\n\t\treturn SIMPLEPIE_CONSTRUCT_TEXT;\n\t}\n\n\tpublic static function atom_10_content_construct_type($attribs)\n\t{\n\t\tif (isset($attribs['']['type']))\n\t\t{\n\t\t\t$type = strtolower(trim($attribs['']['type']));\n\t\t\tswitch ($type)\n\t\t\t{\n\t\t\t\tcase 'text':\n\t\t\t\t\treturn SIMPLEPIE_CONSTRUCT_TEXT;\n\n\t\t\t\tcase 'html':\n\t\t\t\t\treturn SIMPLEPIE_CONSTRUCT_HTML;\n\n\t\t\t\tcase 'xhtml':\n\t\t\t\t\treturn SIMPLEPIE_CONSTRUCT_XHTML;\n\t\t\t}\n\t\t\tif (in_array(substr($type, -4), array('+xml', '/xml')) || substr($type, 0, 5) === 'text/')\n\t\t\t{\n\t\t\t\treturn SIMPLEPIE_CONSTRUCT_NONE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn SIMPLEPIE_CONSTRUCT_BASE64;\n\t\t\t}\n\t\t}\n\n\t\treturn SIMPLEPIE_CONSTRUCT_TEXT;\n\t}\n\n\tpublic static function is_isegment_nz_nc($string)\n\t{\n\t\treturn (bool) preg_match('/^([A-Za-z0-9\\-._~\\x{A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}\\x{10000}-\\x{1FFFD}\\x{20000}-\\x{2FFFD}\\x{30000}-\\x{3FFFD}\\x{40000}-\\x{4FFFD}\\x{50000}-\\x{5FFFD}\\x{60000}-\\x{6FFFD}\\x{70000}-\\x{7FFFD}\\x{80000}-\\x{8FFFD}\\x{90000}-\\x{9FFFD}\\x{A0000}-\\x{AFFFD}\\x{B0000}-\\x{BFFFD}\\x{C0000}-\\x{CFFFD}\\x{D0000}-\\x{DFFFD}\\x{E1000}-\\x{EFFFD}!$&\\'()*+,;=@]|(%[0-9ABCDEF]{2}))+$/u', $string);\n\t}\n\n\tpublic static function space_separated_tokens($string)\n\t{\n\t\t$space_characters = \"\\x20\\x09\\x0A\\x0B\\x0C\\x0D\";\n\t\t$string_length = strlen($string);\n\n\t\t$position = strspn($string, $space_characters);\n\t\t$tokens = array();\n\n\t\twhile ($position < $string_length)\n\t\t{\n\t\t\t$len = strcspn($string, $space_characters, $position);\n\t\t\t$tokens[] = substr($string, $position, $len);\n\t\t\t$position += $len;\n\t\t\t$position += strspn($string, $space_characters, $position);\n\t\t}\n\n\t\treturn $tokens;\n\t}\n\n\t/**\n\t * Converts a unicode codepoint to a UTF-8 character\n\t *\n\t * @static\n\t * @param int $codepoint Unicode codepoint\n\t * @return string UTF-8 character\n\t */\n\tpublic static function codepoint_to_utf8($codepoint)\n\t{\n\t\t$codepoint = (int) $codepoint;\n\t\tif ($codepoint < 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse if ($codepoint <= 0x7f)\n\t\t{\n\t\t\treturn chr($codepoint);\n\t\t}\n\t\telse if ($codepoint <= 0x7ff)\n\t\t{\n\t\t\treturn chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));\n\t\t}\n\t\telse if ($codepoint <= 0xffff)\n\t\t{\n\t\t\treturn chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));\n\t\t}\n\t\telse if ($codepoint <= 0x10ffff)\n\t\t{\n\t\t\treturn chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));\n\t\t}\n\n\t\t// U+FFFD REPLACEMENT CHARACTER\n\t\treturn \"\\xEF\\xBF\\xBD\";\n\t}\n\n\t/**\n\t * Similar to parse_str()\n\t *\n\t * Returns an associative array of name/value pairs, where the value is an\n\t * array of values that have used the same name\n\t *\n\t * @static\n\t * @param string $str The input string.\n\t * @return array\n\t */\n\tpublic static function parse_str($str)\n\t{\n\t\t$return = array();\n\t\t$str = explode('&', $str);\n\n\t\tforeach ($str as $section)\n\t\t{\n\t\t\tif (strpos($section, '=') !== false)\n\t\t\t{\n\t\t\t\tlist($name, $value) = explode('=', $section, 2);\n\t\t\t\t$return[urldecode($name)][] = urldecode($value);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$return[urldecode($section)][] = null;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}\n\n\t/**\n\t * Detect XML encoding, as per XML 1.0 Appendix F.1\n\t *\n\t * @todo Add support for EBCDIC\n\t * @param string $data XML data\n\t * @param SimplePie_Registry $registry Class registry\n\t * @return array Possible encodings\n\t */\n\tpublic static function xml_encoding($data, $registry)\n\t{\n\t\t// UTF-32 Big Endian BOM\n\t\tif (substr($data, 0, 4) === \"\\x00\\x00\\xFE\\xFF\")\n\t\t{\n\t\t\t$encoding[] = 'UTF-32BE';\n\t\t}\n\t\t// UTF-32 Little Endian BOM\n\t\telseif (substr($data, 0, 4) === \"\\xFF\\xFE\\x00\\x00\")\n\t\t{\n\t\t\t$encoding[] = 'UTF-32LE';\n\t\t}\n\t\t// UTF-16 Big Endian BOM\n\t\telseif (substr($data, 0, 2) === \"\\xFE\\xFF\")\n\t\t{\n\t\t\t$encoding[] = 'UTF-16BE';\n\t\t}\n\t\t// UTF-16 Little Endian BOM\n\t\telseif (substr($data, 0, 2) === \"\\xFF\\xFE\")\n\t\t{\n\t\t\t$encoding[] = 'UTF-16LE';\n\t\t}\n\t\t// UTF-8 BOM\n\t\telseif (substr($data, 0, 3) === \"\\xEF\\xBB\\xBF\")\n\t\t{\n\t\t\t$encoding[] = 'UTF-8';\n\t\t}\n\t\t// UTF-32 Big Endian Without BOM\n\t\telseif (substr($data, 0, 20) === \"\\x00\\x00\\x00\\x3C\\x00\\x00\\x00\\x3F\\x00\\x00\\x00\\x78\\x00\\x00\\x00\\x6D\\x00\\x00\\x00\\x6C\")\n\t\t{\n\t\t\tif ($pos = strpos($data, \"\\x00\\x00\\x00\\x3F\\x00\\x00\\x00\\x3E\"))\n\t\t\t{\n\t\t\t\t$parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32BE', 'UTF-8')));\n\t\t\t\tif ($parser->parse())\n\t\t\t\t{\n\t\t\t\t\t$encoding[] = $parser->encoding;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$encoding[] = 'UTF-32BE';\n\t\t}\n\t\t// UTF-32 Little Endian Without BOM\n\t\telseif (substr($data, 0, 20) === \"\\x3C\\x00\\x00\\x00\\x3F\\x00\\x00\\x00\\x78\\x00\\x00\\x00\\x6D\\x00\\x00\\x00\\x6C\\x00\\x00\\x00\")\n\t\t{\n\t\t\tif ($pos = strpos($data, \"\\x3F\\x00\\x00\\x00\\x3E\\x00\\x00\\x00\"))\n\t\t\t{\n\t\t\t\t$parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32LE', 'UTF-8')));\n\t\t\t\tif ($parser->parse())\n\t\t\t\t{\n\t\t\t\t\t$encoding[] = $parser->encoding;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$encoding[] = 'UTF-32LE';\n\t\t}\n\t\t// UTF-16 Big Endian Without BOM\n\t\telseif (substr($data, 0, 10) === \"\\x00\\x3C\\x00\\x3F\\x00\\x78\\x00\\x6D\\x00\\x6C\")\n\t\t{\n\t\t\tif ($pos = strpos($data, \"\\x00\\x3F\\x00\\x3E\"))\n\t\t\t{\n\t\t\t\t$parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16BE', 'UTF-8')));\n\t\t\t\tif ($parser->parse())\n\t\t\t\t{\n\t\t\t\t\t$encoding[] = $parser->encoding;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$encoding[] = 'UTF-16BE';\n\t\t}\n\t\t// UTF-16 Little Endian Without BOM\n\t\telseif (substr($data, 0, 10) === \"\\x3C\\x00\\x3F\\x00\\x78\\x00\\x6D\\x00\\x6C\\x00\")\n\t\t{\n\t\t\tif ($pos = strpos($data, \"\\x3F\\x00\\x3E\\x00\"))\n\t\t\t{\n\t\t\t\t$parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16LE', 'UTF-8')));\n\t\t\t\tif ($parser->parse())\n\t\t\t\t{\n\t\t\t\t\t$encoding[] = $parser->encoding;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$encoding[] = 'UTF-16LE';\n\t\t}\n\t\t// US-ASCII (or superset)\n\t\telseif (substr($data, 0, 5) === \"\\x3C\\x3F\\x78\\x6D\\x6C\")\n\t\t{\n\t\t\tif ($pos = strpos($data, \"\\x3F\\x3E\"))\n\t\t\t{\n\t\t\t\t$parser = $registry->create('XML_Declaration_Parser', array(substr($data, 5, $pos - 5)));\n\t\t\t\tif ($parser->parse())\n\t\t\t\t{\n\t\t\t\t\t$encoding[] = $parser->encoding;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$encoding[] = 'UTF-8';\n\t\t}\n\t\t// Fallback to UTF-8\n\t\telse\n\t\t{\n\t\t\t$encoding[] = 'UTF-8';\n\t\t}\n\t\treturn $encoding;\n\t}\n\n\tpublic static function output_javascript()\n\t{\n\t\tif (function_exists('ob_gzhandler'))\n\t\t{\n\t\t\tob_start('ob_gzhandler');\n\t\t}\n\t\theader('Content-type: text/javascript; charset: UTF-8');\n\t\theader('Cache-Control: must-revalidate');\n\t\theader('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days\n\t\t?>\nfunction embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) {\n\tif (placeholder != '') {\n\t\tdocument.writeln('<embed type=\"'+type+'\" style=\"cursor:hand; cursor:pointer;\" href=\"'+link+'\" src=\"'+placeholder+'\" width=\"'+width+'\" height=\"'+height+'\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"'+loop+'\" scale=\"aspect\" bgcolor=\"'+bgcolor+'\" pluginspage=\"http://www.apple.com/quicktime/download/\"></embed>');\n\t}\n\telse {\n\t\tdocument.writeln('<embed type=\"'+type+'\" style=\"cursor:hand; cursor:pointer;\" src=\"'+link+'\" width=\"'+width+'\" height=\"'+height+'\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"'+loop+'\" scale=\"aspect\" bgcolor=\"'+bgcolor+'\" pluginspage=\"http://www.apple.com/quicktime/download/\"></embed>');\n\t}\n}\n\nfunction embed_flash(bgcolor, width, height, link, loop, type) {\n\tdocument.writeln('<embed src=\"'+link+'\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"'+type+'\" quality=\"high\" width=\"'+width+'\" height=\"'+height+'\" bgcolor=\"'+bgcolor+'\" loop=\"'+loop+'\"></embed>');\n}\n\nfunction embed_flv(width, height, link, placeholder, loop, player) {\n\tdocument.writeln('<embed src=\"'+player+'\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"'+width+'\" height=\"'+height+'\" wmode=\"transparent\" flashvars=\"file='+link+'&autostart=false&repeat='+loop+'&showdigits=true&showfsbutton=false\"></embed>');\n}\n\nfunction embed_wmedia(width, height, link) {\n\tdocument.writeln('<embed type=\"application/x-mplayer2\" src=\"'+link+'\" autosize=\"1\" width=\"'+width+'\" height=\"'+height+'\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\"></embed>');\n}\n\t\t<?php\n\t}\n\n\t/**\n\t * Get the SimplePie build timestamp\n\t *\n\t * Uses the git index if it exists, otherwise uses the modification time\n\t * of the newest file.\n\t */\n\tpublic static function get_build()\n\t{\n\t\t$root = dirname(dirname(__FILE__));\n\t\tif (file_exists($root . '/.git/index'))\n\t\t{\n\t\t\treturn filemtime($root . '/.git/index');\n\t\t}\n\t\telseif (file_exists($root . '/SimplePie'))\n\t\t{\n\t\t\t$time = 0;\n\t\t\tforeach (glob($root . '/SimplePie/*.php') as $file)\n\t\t\t{\n\t\t\t\tif (($mtime = filemtime($file)) > $time)\n\t\t\t\t{\n\t\t\t\t\t$time = $mtime;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $time;\n\t\t}\n\t\telseif (file_exists(dirname(__FILE__) . '/Core.php'))\n\t\t{\n\t\t\treturn filemtime(dirname(__FILE__) . '/Core.php');\n\t\t}\n\n\t\treturn filemtime(__FILE__);\n\t}\n\n\t/**\n\t * Format debugging information\n\t */\n\tpublic static function debug(&$sp)\n\t{\n\t\t$info = 'SimplePie ' . SIMPLEPIE_VERSION . ' Build ' . SIMPLEPIE_BUILD . \"\\n\";\n\t\t$info .= 'PHP ' . PHP_VERSION . \"\\n\";\n\t\tif ($sp->error() !== null)\n\t\t{\n\t\t\t$info .= 'Error occurred: ' . $sp->error() . \"\\n\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$info .= \"No error found.\\n\";\n\t\t}\n\t\t$info .= \"Extensions:\\n\";\n\t\t$extensions = array('pcre', 'curl', 'zlib', 'mbstring', 'iconv', 'xmlreader', 'xml');\n\t\tforeach ($extensions as $ext)\n\t\t{\n\t\t\tif (extension_loaded($ext))\n\t\t\t{\n\t\t\t\t$info .= \"    $ext loaded\\n\";\n\t\t\t\tswitch ($ext)\n\t\t\t\t{\n\t\t\t\t\tcase 'pcre':\n\t\t\t\t\t\t$info .= '      Version ' . PCRE_VERSION . \"\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'curl':\n\t\t\t\t\t\t$version = curl_version();\n\t\t\t\t\t\t$info .= '      Version ' . $version['version'] . \"\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'mbstring':\n\t\t\t\t\t\t$info .= '      Overloading: ' . mb_get_info('func_overload') . \"\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'iconv':\n\t\t\t\t\t\t$info .= '      Version ' . ICONV_VERSION . \"\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'xml':\n\t\t\t\t\t\t$info .= '      Version ' . LIBXML_DOTTED_VERSION . \"\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$info .= \"    $ext not loaded\\n\";\n\t\t\t}\n\t\t}\n\t\treturn $info;\n\t}\n\n\tpublic static function silence_errors($num, $str)\n\t{\n\t\t// No-op\n\t}\n}\n", "num_lines": 2263}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Parses XML into something sane\n *\n *\n * This class can be overloaded with {@see SimplePie::set_parser_class()}\n *\n * @package SimplePie\n * @subpackage Parsing\n */\nclass SimplePie_Parser\n{\n\tvar $error_code;\n\tvar $error_string;\n\tvar $current_line;\n\tvar $current_column;\n\tvar $current_byte;\n\tvar $separator = ' ';\n\tvar $namespace = array('');\n\tvar $element = array('');\n\tvar $xml_base = array('');\n\tvar $xml_base_explicit = array(false);\n\tvar $xml_lang = array('');\n\tvar $data = array();\n\tvar $datas = array(array());\n\tvar $current_xhtml_construct = -1;\n\tvar $encoding;\n\tprotected $registry;\n\n\tpublic function set_registry(SimplePie_Registry $registry)\n\t{\n\t\t$this->registry = $registry;\n\t}\n\n\tpublic function parse(&$data, $encoding, $url = '')\n\t{\n\t\tif (class_exists('DOMXpath') && function_exists('Mf2\\parse')) {\n\t\t\t$doc = new DOMDocument();\n\t\t\t@$doc->loadHTML($data);\n\t\t\t$xpath = new DOMXpath($doc);\n\t\t\t// Check for both h-feed and h-entry, as both a feed with no entries\n\t\t\t// and a list of entries without an h-feed wrapper are both valid.\n\t\t\t$query = '//*[contains(concat(\" \", @class, \" \"), \" h-feed \") or '.\n\t\t\t\t'contains(concat(\" \", @class, \" \"), \" h-entry \")]';\n\t\t\t$result = $xpath->query($query);\n\t\t\tif ($result->length !== 0) {\n\t\t\t\treturn $this->parse_microformats($data, $url);\n\t\t\t}\n\t\t}\n\n\t\t// Use UTF-8 if we get passed US-ASCII, as every US-ASCII character is a UTF-8 character\n\t\tif (strtoupper($encoding) === 'US-ASCII')\n\t\t{\n\t\t\t$this->encoding = 'UTF-8';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->encoding = $encoding;\n\t\t}\n\n\t\t// Strip BOM:\n\t\t// UTF-32 Big Endian BOM\n\t\tif (substr($data, 0, 4) === \"\\x00\\x00\\xFE\\xFF\")\n\t\t{\n\t\t\t$data = substr($data, 4);\n\t\t}\n\t\t// UTF-32 Little Endian BOM\n\t\telseif (substr($data, 0, 4) === \"\\xFF\\xFE\\x00\\x00\")\n\t\t{\n\t\t\t$data = substr($data, 4);\n\t\t}\n\t\t// UTF-16 Big Endian BOM\n\t\telseif (substr($data, 0, 2) === \"\\xFE\\xFF\")\n\t\t{\n\t\t\t$data = substr($data, 2);\n\t\t}\n\t\t// UTF-16 Little Endian BOM\n\t\telseif (substr($data, 0, 2) === \"\\xFF\\xFE\")\n\t\t{\n\t\t\t$data = substr($data, 2);\n\t\t}\n\t\t// UTF-8 BOM\n\t\telseif (substr($data, 0, 3) === \"\\xEF\\xBB\\xBF\")\n\t\t{\n\t\t\t$data = substr($data, 3);\n\t\t}\n\n\t\tif (substr($data, 0, 5) === '<?xml' && strspn(substr($data, 5, 1), \"\\x09\\x0A\\x0D\\x20\") && ($pos = strpos($data, '?>')) !== false)\n\t\t{\n\t\t\t$declaration = $this->registry->create('XML_Declaration_Parser', array(substr($data, 5, $pos - 5)));\n\t\t\tif ($declaration->parse())\n\t\t\t{\n\t\t\t\t$data = substr($data, $pos + 2);\n\t\t\t\t$data = '<?xml version=\"' . $declaration->version . '\" encoding=\"' . $encoding . '\" standalone=\"' . (($declaration->standalone) ? 'yes' : 'no') . '\"?>' .\"\\n\". $this->declare_html_entities() . $data;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->error_string = 'SimplePie bug! Please report this!';\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$return = true;\n\n\t\tstatic $xml_is_sane = null;\n\t\tif ($xml_is_sane === null)\n\t\t{\n\t\t\t$parser_check = xml_parser_create();\n\t\t\txml_parse_into_struct($parser_check, '<foo>&amp;</foo>', $values);\n\t\t\txml_parser_free($parser_check);\n\t\t\t$xml_is_sane = isset($values[0]['value']);\n\t\t}\n\n\t\t// Create the parser\n\t\tif ($xml_is_sane)\n\t\t{\n\t\t\t$xml = xml_parser_create_ns($this->encoding, $this->separator);\n\t\t\txml_parser_set_option($xml, XML_OPTION_SKIP_WHITE, 1);\n\t\t\txml_parser_set_option($xml, XML_OPTION_CASE_FOLDING, 0);\n\t\t\txml_set_object($xml, $this);\n\t\t\txml_set_character_data_handler($xml, 'cdata');\n\t\t\txml_set_element_handler($xml, 'tag_open', 'tag_close');\n\n\t\t\t// Parse!\n\t\t\tif (!xml_parse($xml, $data, true))\n\t\t\t{\n\t\t\t\t$this->error_code = xml_get_error_code($xml);\n\t\t\t\t$this->error_string = xml_error_string($this->error_code);\n\t\t\t\t$return = false;\n\t\t\t}\n\t\t\t$this->current_line = xml_get_current_line_number($xml);\n\t\t\t$this->current_column = xml_get_current_column_number($xml);\n\t\t\t$this->current_byte = xml_get_current_byte_index($xml);\n\t\t\txml_parser_free($xml);\n\t\t\treturn $return;\n\t\t}\n\n\t\tlibxml_clear_errors();\n\t\t$xml = new XMLReader();\n\t\t$xml->xml($data);\n\t\twhile (@$xml->read())\n\t\t{\n\t\t\tswitch ($xml->nodeType)\n\t\t\t{\n\n\t\t\t\tcase constant('XMLReader::END_ELEMENT'):\n\t\t\t\t\tif ($xml->namespaceURI !== '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$tagName = $xml->namespaceURI . $this->separator . $xml->localName;\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$tagName = $xml->localName;\n\t\t\t\t\t}\n\t\t\t\t\t$this->tag_close(null, $tagName);\n\t\t\t\t\tbreak;\n\t\t\t\tcase constant('XMLReader::ELEMENT'):\n\t\t\t\t\t$empty = $xml->isEmptyElement;\n\t\t\t\t\tif ($xml->namespaceURI !== '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$tagName = $xml->namespaceURI . $this->separator . $xml->localName;\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$tagName = $xml->localName;\n\t\t\t\t\t}\n\t\t\t\t\t$attributes = array();\n\t\t\t\t\twhile ($xml->moveToNextAttribute())\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($xml->namespaceURI !== '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$attrName = $xml->namespaceURI . $this->separator . $xml->localName;\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$attrName = $xml->localName;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$attributes[$attrName] = $xml->value;\n\t\t\t\t\t}\n\t\t\t\t\t$this->tag_open(null, $tagName, $attributes);\n\t\t\t\t\tif ($empty)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->tag_close(null, $tagName);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase constant('XMLReader::TEXT'):\n\n\t\t\t\tcase constant('XMLReader::CDATA'):\n\t\t\t\t\t$this->cdata(null, $xml->value);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ($error = libxml_get_last_error())\n\t\t{\n\t\t\t$this->error_code = $error->code;\n\t\t\t$this->error_string = $error->message;\n\t\t\t$this->current_line = $error->line;\n\t\t\t$this->current_column = $error->column;\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic function get_error_code()\n\t{\n\t\treturn $this->error_code;\n\t}\n\n\tpublic function get_error_string()\n\t{\n\t\treturn $this->error_string;\n\t}\n\n\tpublic function get_current_line()\n\t{\n\t\treturn $this->current_line;\n\t}\n\n\tpublic function get_current_column()\n\t{\n\t\treturn $this->current_column;\n\t}\n\n\tpublic function get_current_byte()\n\t{\n\t\treturn $this->current_byte;\n\t}\n\n\tpublic function get_data()\n\t{\n\t\treturn $this->data;\n\t}\n\n\tpublic function tag_open($parser, $tag, $attributes)\n\t{\n\t\tlist($this->namespace[], $this->element[]) = $this->split_ns($tag);\n\n\t\t$attribs = array();\n\t\tforeach ($attributes as $name => $value)\n\t\t{\n\t\t\tlist($attrib_namespace, $attribute) = $this->split_ns($name);\n\t\t\t$attribs[$attrib_namespace][$attribute] = $value;\n\t\t}\n\n\t\tif (isset($attribs[SIMPLEPIE_NAMESPACE_XML]['base']))\n\t\t{\n\t\t\t$base = $this->registry->call('Misc', 'absolutize_url', array($attribs[SIMPLEPIE_NAMESPACE_XML]['base'], end($this->xml_base)));\n\t\t\tif ($base !== false)\n\t\t\t{\n\t\t\t\t$this->xml_base[] = $base;\n\t\t\t\t$this->xml_base_explicit[] = true;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->xml_base[] = end($this->xml_base);\n\t\t\t$this->xml_base_explicit[] = end($this->xml_base_explicit);\n\t\t}\n\n\t\tif (isset($attribs[SIMPLEPIE_NAMESPACE_XML]['lang']))\n\t\t{\n\t\t\t$this->xml_lang[] = $attribs[SIMPLEPIE_NAMESPACE_XML]['lang'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->xml_lang[] = end($this->xml_lang);\n\t\t}\n\n\t\tif ($this->current_xhtml_construct >= 0)\n\t\t{\n\t\t\t$this->current_xhtml_construct++;\n\t\t\tif (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML)\n\t\t\t{\n\t\t\t\t$this->data['data'] .= '<' . end($this->element);\n\t\t\t\tif (isset($attribs['']))\n\t\t\t\t{\n\t\t\t\t\tforeach ($attribs[''] as $name => $value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->data['data'] .= ' ' . $name . '=\"' . htmlspecialchars($value, ENT_COMPAT, $this->encoding) . '\"';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->data['data'] .= '>';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->datas[] =& $this->data;\n\t\t\t$this->data =& $this->data['child'][end($this->namespace)][end($this->element)][];\n\t\t\t$this->data = array('data' => '', 'attribs' => $attribs, 'xml_base' => end($this->xml_base), 'xml_base_explicit' => end($this->xml_base_explicit), 'xml_lang' => end($this->xml_lang));\n\t\t\tif ((end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml')\n\t\t\t|| (end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml')\n\t\t\t|| (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_20 && in_array(end($this->element), array('title')))\n\t\t\t|| (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_090 && in_array(end($this->element), array('title')))\n\t\t\t|| (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_10 && in_array(end($this->element), array('title'))))\n\t\t\t{\n\t\t\t\t$this->current_xhtml_construct = 0;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic function cdata($parser, $cdata)\n\t{\n\t\tif ($this->current_xhtml_construct >= 0)\n\t\t{\n\t\t\t$this->data['data'] .= htmlspecialchars($cdata, ENT_QUOTES, $this->encoding);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->data['data'] .= $cdata;\n\t\t}\n\t}\n\n\tpublic function tag_close($parser, $tag)\n\t{\n\t\tif ($this->current_xhtml_construct >= 0)\n\t\t{\n\t\t\t$this->current_xhtml_construct--;\n\t\t\tif (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML && !in_array(end($this->element), array('area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param')))\n\t\t\t{\n\t\t\t\t$this->data['data'] .= '</' . end($this->element) . '>';\n\t\t\t}\n\t\t}\n\t\tif ($this->current_xhtml_construct === -1)\n\t\t{\n\t\t\t$this->data =& $this->datas[count($this->datas) - 1];\n\t\t\tarray_pop($this->datas);\n\t\t}\n\n\t\tarray_pop($this->element);\n\t\tarray_pop($this->namespace);\n\t\tarray_pop($this->xml_base);\n\t\tarray_pop($this->xml_base_explicit);\n\t\tarray_pop($this->xml_lang);\n\t}\n\n\tpublic function split_ns($string)\n\t{\n\t\tstatic $cache = array();\n\t\tif (!isset($cache[$string]))\n\t\t{\n\t\t\tif ($pos = strpos($string, $this->separator))\n\t\t\t{\n\t\t\t\tstatic $separator_length;\n\t\t\t\tif (!$separator_length)\n\t\t\t\t{\n\t\t\t\t\t$separator_length = strlen($this->separator);\n\t\t\t\t}\n\t\t\t\t$namespace = substr($string, 0, $pos);\n\t\t\t\t$local_name = substr($string, $pos + $separator_length);\n\t\t\t\tif (strtolower($namespace) === SIMPLEPIE_NAMESPACE_ITUNES)\n\t\t\t\t{\n\t\t\t\t\t$namespace = SIMPLEPIE_NAMESPACE_ITUNES;\n\t\t\t\t}\n\n\t\t\t\t// Normalize the Media RSS namespaces\n\t\t\t\tif ($namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG ||\n\t\t\t\t\t$namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG2 ||\n\t\t\t\t\t$namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG3 ||\n\t\t\t\t\t$namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG4 ||\n\t\t\t\t\t$namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG5 )\n\t\t\t\t{\n\t\t\t\t\t$namespace = SIMPLEPIE_NAMESPACE_MEDIARSS;\n\t\t\t\t}\n\t\t\t\t$cache[$string] = array($namespace, $local_name);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$cache[$string] = array('', $string);\n\t\t\t}\n\t\t}\n\t\treturn $cache[$string];\n\t}\n\n\tprivate function parse_hcard($data, $category = false) {\n\t\t$name = '';\n\t\t$link = '';\n\t\t// Check if h-card is set and pass that information on in the link.\n\t\tif (isset($data['type']) && in_array('h-card', $data['type'])) {\n\t\t\tif (isset($data['properties']['name'][0])) {\n\t\t\t\t$name = $data['properties']['name'][0];\n\t\t\t}\n\t\t\tif (isset($data['properties']['url'][0])) {\n\t\t\t\t$link = $data['properties']['url'][0];\n\t\t\t\tif ($name === '') {\n\t\t\t\t\t$name = $link;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// can't have commas in categories.\n\t\t\t\t\t$name = str_replace(',', '', $name);\n\t\t\t\t}\n\t\t\t\t$person_tag = $category ? '<span class=\"person-tag\"></span>' : '';\n\t\t\t\treturn '<a class=\"h-card\" href=\"'.$link.'\">'.$person_tag.$name.'</a>';\n\t\t\t}\n\t\t}\n\t\treturn isset($data['value']) ? $data['value'] : '';\n\t}\n\n\tprivate function parse_microformats(&$data, $url) {\n\t\t$feed_title = '';\n\t\t$feed_author = NULL;\n\t\t$author_cache = array();\n\t\t$items = array();\n\t\t$entries = array();\n\t\t$mf = Mf2\\parse($data, $url);\n\t\t// First look for an h-feed.\n\t\t$h_feed = array();\n\t\tforeach ($mf['items'] as $mf_item) {\n\t\t\tif (in_array('h-feed', $mf_item['type'])) {\n\t\t\t\t$h_feed = $mf_item;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Also look for h-feed or h-entry in the children of each top level item.\n\t\t\tif (!isset($mf_item['children'][0]['type'])) continue;\n\t\t\tif (in_array('h-feed', $mf_item['children'][0]['type'])) {\n\t\t\t\t$h_feed = $mf_item['children'][0];\n\t\t\t\t// In this case the parent of the h-feed may be an h-card, so use it as\n\t\t\t\t// the feed_author.\n\t\t\t\tif (in_array('h-card', $mf_item['type'])) $feed_author = $mf_item;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (in_array('h-entry', $mf_item['children'][0]['type'])) {\n\t\t\t\t$entries = $mf_item['children'];\n\t\t\t\t// In this case the parent of the h-entry list may be an h-card, so use\n\t\t\t\t// it as the feed_author.\n\t\t\t\tif (in_array('h-card', $mf_item['type'])) $feed_author = $mf_item;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (isset($h_feed['children'])) {\n\t\t\t$entries = $h_feed['children'];\n\t\t\t// Also set the feed title and store author from the h-feed if available.\n\t\t\tif (isset($mf['items'][0]['properties']['name'][0])) {\n\t\t\t\t$feed_title = $mf['items'][0]['properties']['name'][0];\n\t\t\t}\n\t\t\tif (isset($mf['items'][0]['properties']['author'][0])) {\n\t\t\t\t$feed_author = $mf['items'][0]['properties']['author'][0];\n\t\t\t}\n\t\t}\n\t\telse if (count($entries) === 0) {\n\t\t\t$entries = $mf['items'];\n\t\t}\n\t\tfor ($i = 0; $i < count($entries); $i++) {\n\t\t\t$entry = $entries[$i];\n\t\t\tif (in_array('h-entry', $entry['type'])) {\n\t\t\t\t$item = array();\n\t\t\t\t$title = '';\n\t\t\t\t$description = '';\n\t\t\t\tif (isset($entry['properties']['url'][0])) {\n\t\t\t\t\t$link = $entry['properties']['url'][0];\n\t\t\t\t\tif (isset($link['value'])) $link = $link['value'];\n\t\t\t\t\t$item['link'] = array(array('data' => $link));\n\t\t\t\t}\n\t\t\t\tif (isset($entry['properties']['uid'][0])) {\n\t\t\t\t\t$guid = $entry['properties']['uid'][0];\n\t\t\t\t\tif (isset($guid['value'])) $guid = $guid['value'];\n\t\t\t\t\t$item['guid'] = array(array('data' => $guid));\n\t\t\t\t}\n\t\t\t\tif (isset($entry['properties']['name'][0])) {\n\t\t\t\t\t$title = $entry['properties']['name'][0];\n\t\t\t\t\tif (isset($title['value'])) $title = $title['value'];\n\t\t\t\t\t$item['title'] = array(array('data' => $title));\n\t\t\t\t}\n\t\t\t\tif (isset($entry['properties']['author'][0]) || isset($feed_author)) {\n\t\t\t\t\t// author is a special case, it can be plain text or an h-card array.\n\t\t\t\t\t// If it's plain text it can also be a url that should be followed to\n\t\t\t\t\t// get the actual h-card.\n\t\t\t\t\t$author = isset($entry['properties']['author'][0]) ?\n\t\t\t\t\t\t$entry['properties']['author'][0] : $feed_author;\n\t\t\t\t\tif (!is_string($author)) {\n\t\t\t\t\t\t$author = $this->parse_hcard($author);\n\t\t\t\t\t}\n\t\t\t\t\telse if (strpos($author, 'http') === 0) {\n\t\t\t\t\t\tif (isset($author_cache[$author])) {\n\t\t\t\t\t\t\t$author = $author_cache[$author];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$mf = Mf2\\fetch($author);\n\t\t\t\t\t\t\tforeach ($mf['items'] as $hcard) {\n\t\t\t\t\t\t\t\t// Only interested in an h-card by itself in this case.\n\t\t\t\t\t\t\t\tif (!in_array('h-card', $hcard['type'])) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// It must have a url property matching what we fetched.\n\t\t\t\t\t\t\t\tif (!isset($hcard['properties']['url']) ||\n\t\t\t\t\t\t\t\t\t\t!(in_array($author, $hcard['properties']['url']))) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Save parse_hcard the trouble of finding the correct url.\n\t\t\t\t\t\t\t\t$hcard['properties']['url'][0] = $author;\n\t\t\t\t\t\t\t\t// Cache this h-card for the next h-entry to check.\n\t\t\t\t\t\t\t\t$author_cache[$author] = $this->parse_hcard($hcard);\n\t\t\t\t\t\t\t\t$author = $author_cache[$author];\n\t\t\t\t\t\t\t\tbreak;\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$item['author'] = array(array('data' => $author));\n\t\t\t\t}\n\t\t\t\tif (isset($entry['properties']['photo'][0])) {\n\t\t\t\t\t// If a photo is also in content, don't need to add it again here.\n\t\t\t\t\t$content = '';\n\t\t\t\t\tif (isset($entry['properties']['content'][0]['html'])) {\n\t\t\t\t\t\t$content = $entry['properties']['content'][0]['html'];\n\t\t\t\t\t}\n\t\t\t\t\t$photo_list = array();\n\t\t\t\t\tfor ($j = 0; $j < count($entry['properties']['photo']); $j++) {\n\t\t\t\t\t\t$photo = $entry['properties']['photo'][$j];\n\t\t\t\t\t\tif (!empty($photo) && strpos($content, $photo) === false) {\n\t\t\t\t\t\t\t$photo_list[] = $photo;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// When there's more than one photo show the first and use a lightbox.\n\t\t\t\t\t// Need a permanent, unique name for the image set, but don't have\n\t\t\t\t\t// anything unique except for the content itself, so use that.\n\t\t\t\t\t$count = count($photo_list);\n\t\t\t\t\tif ($count > 1) {\n\t\t\t\t\t\t$image_set_id = preg_replace('/[[:^alnum:]]/', '', $photo_list[0]);\n\t\t\t\t\t\t$description = '<p>';\n\t\t\t\t\t\tfor ($j = 0; $j < $count; $j++) {\n\t\t\t\t\t\t\t$hidden = $j === 0 ? '' : 'class=\"hidden\" ';\n\t\t\t\t\t\t\t$description .= '<a href=\"'.$photo_list[$j].'\" '.$hidden.\n\t\t\t\t\t\t\t\t'data-lightbox=\"image-set-'.$image_set_id.'\">'.\n\t\t\t\t\t\t\t\t'<img src=\"'.$photo_list[$j].'\"></a>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$description .= '<br><b>'.$count.' photos</b></p>';\n\t\t\t\t\t}\n\t\t\t\t\telse if ($count == 1) {\n\t\t\t\t\t\t$description = '<p><img src=\"'.$photo_list[0].'\"></p>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isset($entry['properties']['content'][0]['html'])) {\n\t\t\t\t\t// e-content['value'] is the same as p-name when they are on the same\n\t\t\t\t\t// element. Use this to replace title with a strip_tags version so\n\t\t\t\t\t// that alt text from images is not included in the title.\n\t\t\t\t\tif ($entry['properties']['content'][0]['value'] === $title) {\n\t\t\t\t\t\t$title = strip_tags($entry['properties']['content'][0]['html']);\n\t\t\t\t\t\t$item['title'] = array(array('data' => $title));\n\t\t\t\t\t}\n\t\t\t\t\t$description .= $entry['properties']['content'][0]['html'];\n\t\t\t\t\tif (isset($entry['properties']['in-reply-to'][0])) {\n\t\t\t\t\t\t$in_reply_to = '';\n\t\t\t\t\t\tif (is_string($entry['properties']['in-reply-to'][0])) {\n\t\t\t\t\t\t\t$in_reply_to = $entry['properties']['in-reply-to'][0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (isset($entry['properties']['in-reply-to'][0]['value'])) {\n\t\t\t\t\t\t\t$in_reply_to = $entry['properties']['in-reply-to'][0]['value'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($in_reply_to !== '') {\n\t\t\t\t\t\t\t$description .= '<p><span class=\"in-reply-to\"></span> '.\n\t\t\t\t\t\t\t\t'<a href=\"'.$in_reply_to.'\">'.$in_reply_to.'</a><p>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$item['description'] = array(array('data' => $description));\n\t\t\t\t}\n\t\t\t\tif (isset($entry['properties']['category'])) {\n\t\t\t\t\t$category_csv = '';\n\t\t\t\t\t// Categories can also contain h-cards.\n\t\t\t\t\tforeach ($entry['properties']['category'] as $category) {\n\t\t\t\t\t\tif ($category_csv !== '') $category_csv .= ', ';\n\t\t\t\t\t\tif (is_string($category)) {\n\t\t\t\t\t\t\t// Can't have commas in categories.\n\t\t\t\t\t\t\t$category_csv .= str_replace(',', '', $category);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$category_csv .= $this->parse_hcard($category, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$item['category'] = array(array('data' => $category_csv));\n\t\t\t\t}\n\t\t\t\tif (isset($entry['properties']['published'][0])) {\n\t\t\t\t\t$timestamp = strtotime($entry['properties']['published'][0]);\n\t\t\t\t\t$pub_date = date('F j Y g:ia', $timestamp).' GMT';\n\t\t\t\t\t$item['pubDate'] = array(array('data' => $pub_date));\n\t\t\t\t}\n\t\t\t\t// The title and description are set to the empty string to represent\n\t\t\t\t// a deleted item (which also makes it an invalid rss item).\n\t\t\t\tif (isset($entry['properties']['deleted'][0])) {\n\t\t\t\t\t$item['title'] = array(array('data' => ''));\n\t\t\t\t\t$item['description'] = array(array('data' => ''));\n\t\t\t\t}\n\t\t\t\t$items[] = array('child' => array('' => $item));\n\t\t\t}\n\t\t}\n\t\t// Mimic RSS data format when storing microformats.\n\t\t$link = array(array('data' => $url));\n\t\t$image = '';\n\t\tif (!is_string($feed_author) &&\n\t\t\t\tisset($feed_author['properties']['photo'][0])) {\n\t\t\t$image = array(array('child' => array('' => array('url' =>\n\t\t\t\tarray(array('data' => $feed_author['properties']['photo'][0]))))));\n\t\t}\n\t\t// Use the name given for the h-feed, or get the title from the html.\n\t\tif ($feed_title !== '') {\n\t\t\t$feed_title = array(array('data' => htmlspecialchars($feed_title)));\n\t\t}\n\t\telse if ($position = strpos($data, '<title>')) {\n\t\t\t$start = $position < 200 ? 0 : $position - 200;\n\t\t\t$check = substr($data, $start, 400);\n\t\t\t$matches = array();\n\t\t\tif (preg_match('/<title>(.+)<\\/title>/', $check, $matches)) {\n\t\t\t\t$feed_title = array(array('data' => htmlspecialchars($matches[1])));\n\t\t\t}\n\t\t}\n\t\t$channel = array('channel' => array(array('child' => array('' =>\n\t\t\tarray('link' => $link, 'image' => $image, 'title' => $feed_title,\n\t\t\t      'item' => $items)))));\n\t\t$rss = array(array('attribs' => array('' => array('version' => '2.0')),\n\t\t                   'child' => array('' => $channel)));\n\t\t$this->data = array('child' => array('' => array('rss' => $rss)));\n\t\treturn true;\n\t}\n\n\tprivate function declare_html_entities() {\n\t\t// This is required because the RSS specification says that entity-encoded\n\t\t// html is allowed, but the xml specification says they must be declared.\n\t\treturn '<!DOCTYPE html [ <!ENTITY nbsp \"&#x00A0;\"> <!ENTITY iexcl \"&#x00A1;\"> <!ENTITY cent \"&#x00A2;\"> <!ENTITY pound \"&#x00A3;\"> <!ENTITY curren \"&#x00A4;\"> <!ENTITY yen \"&#x00A5;\"> <!ENTITY brvbar \"&#x00A6;\"> <!ENTITY sect \"&#x00A7;\"> <!ENTITY uml \"&#x00A8;\"> <!ENTITY copy \"&#x00A9;\"> <!ENTITY ordf \"&#x00AA;\"> <!ENTITY laquo \"&#x00AB;\"> <!ENTITY not \"&#x00AC;\"> <!ENTITY shy \"&#x00AD;\"> <!ENTITY reg \"&#x00AE;\"> <!ENTITY macr \"&#x00AF;\"> <!ENTITY deg \"&#x00B0;\"> <!ENTITY plusmn \"&#x00B1;\"> <!ENTITY sup2 \"&#x00B2;\"> <!ENTITY sup3 \"&#x00B3;\"> <!ENTITY acute \"&#x00B4;\"> <!ENTITY micro \"&#x00B5;\"> <!ENTITY para \"&#x00B6;\"> <!ENTITY middot \"&#x00B7;\"> <!ENTITY cedil \"&#x00B8;\"> <!ENTITY sup1 \"&#x00B9;\"> <!ENTITY ordm \"&#x00BA;\"> <!ENTITY raquo \"&#x00BB;\"> <!ENTITY frac14 \"&#x00BC;\"> <!ENTITY frac12 \"&#x00BD;\"> <!ENTITY frac34 \"&#x00BE;\"> <!ENTITY iquest \"&#x00BF;\"> <!ENTITY Agrave \"&#x00C0;\"> <!ENTITY Aacute \"&#x00C1;\"> <!ENTITY Acirc \"&#x00C2;\"> <!ENTITY Atilde \"&#x00C3;\"> <!ENTITY Auml \"&#x00C4;\"> <!ENTITY Aring \"&#x00C5;\"> <!ENTITY AElig \"&#x00C6;\"> <!ENTITY Ccedil \"&#x00C7;\"> <!ENTITY Egrave \"&#x00C8;\"> <!ENTITY Eacute \"&#x00C9;\"> <!ENTITY Ecirc \"&#x00CA;\"> <!ENTITY Euml \"&#x00CB;\"> <!ENTITY Igrave \"&#x00CC;\"> <!ENTITY Iacute \"&#x00CD;\"> <!ENTITY Icirc \"&#x00CE;\"> <!ENTITY Iuml \"&#x00CF;\"> <!ENTITY ETH \"&#x00D0;\"> <!ENTITY Ntilde \"&#x00D1;\"> <!ENTITY Ograve \"&#x00D2;\"> <!ENTITY Oacute \"&#x00D3;\"> <!ENTITY Ocirc \"&#x00D4;\"> <!ENTITY Otilde \"&#x00D5;\"> <!ENTITY Ouml \"&#x00D6;\"> <!ENTITY times \"&#x00D7;\"> <!ENTITY Oslash \"&#x00D8;\"> <!ENTITY Ugrave \"&#x00D9;\"> <!ENTITY Uacute \"&#x00DA;\"> <!ENTITY Ucirc \"&#x00DB;\"> <!ENTITY Uuml \"&#x00DC;\"> <!ENTITY Yacute \"&#x00DD;\"> <!ENTITY THORN \"&#x00DE;\"> <!ENTITY szlig \"&#x00DF;\"> <!ENTITY agrave \"&#x00E0;\"> <!ENTITY aacute \"&#x00E1;\"> <!ENTITY acirc \"&#x00E2;\"> <!ENTITY atilde \"&#x00E3;\"> <!ENTITY auml \"&#x00E4;\"> <!ENTITY aring \"&#x00E5;\"> <!ENTITY aelig \"&#x00E6;\"> <!ENTITY ccedil \"&#x00E7;\"> <!ENTITY egrave \"&#x00E8;\"> <!ENTITY eacute \"&#x00E9;\"> <!ENTITY ecirc \"&#x00EA;\"> <!ENTITY euml \"&#x00EB;\"> <!ENTITY igrave \"&#x00EC;\"> <!ENTITY iacute \"&#x00ED;\"> <!ENTITY icirc \"&#x00EE;\"> <!ENTITY iuml \"&#x00EF;\"> <!ENTITY eth \"&#x00F0;\"> <!ENTITY ntilde \"&#x00F1;\"> <!ENTITY ograve \"&#x00F2;\"> <!ENTITY oacute \"&#x00F3;\"> <!ENTITY ocirc \"&#x00F4;\"> <!ENTITY otilde \"&#x00F5;\"> <!ENTITY ouml \"&#x00F6;\"> <!ENTITY divide \"&#x00F7;\"> <!ENTITY oslash \"&#x00F8;\"> <!ENTITY ugrave \"&#x00F9;\"> <!ENTITY uacute \"&#x00FA;\"> <!ENTITY ucirc \"&#x00FB;\"> <!ENTITY uuml \"&#x00FC;\"> <!ENTITY yacute \"&#x00FD;\"> <!ENTITY thorn \"&#x00FE;\"> <!ENTITY yuml \"&#x00FF;\"> <!ENTITY OElig \"&#x0152;\"> <!ENTITY oelig \"&#x0153;\"> <!ENTITY Scaron \"&#x0160;\"> <!ENTITY scaron \"&#x0161;\"> <!ENTITY Yuml \"&#x0178;\"> <!ENTITY fnof \"&#x0192;\"> <!ENTITY circ \"&#x02C6;\"> <!ENTITY tilde \"&#x02DC;\"> <!ENTITY Alpha \"&#x0391;\"> <!ENTITY Beta \"&#x0392;\"> <!ENTITY Gamma \"&#x0393;\"> <!ENTITY Epsilon \"&#x0395;\"> <!ENTITY Zeta \"&#x0396;\"> <!ENTITY Eta \"&#x0397;\"> <!ENTITY Theta \"&#x0398;\"> <!ENTITY Iota \"&#x0399;\"> <!ENTITY Kappa \"&#x039A;\"> <!ENTITY Lambda \"&#x039B;\"> <!ENTITY Mu \"&#x039C;\"> <!ENTITY Nu \"&#x039D;\"> <!ENTITY Xi \"&#x039E;\"> <!ENTITY Omicron \"&#x039F;\"> <!ENTITY Pi \"&#x03A0;\"> <!ENTITY Rho \"&#x03A1;\"> <!ENTITY Sigma \"&#x03A3;\"> <!ENTITY Tau \"&#x03A4;\"> <!ENTITY Upsilon \"&#x03A5;\"> <!ENTITY Phi \"&#x03A6;\"> <!ENTITY Chi \"&#x03A7;\"> <!ENTITY Psi \"&#x03A8;\"> <!ENTITY Omega \"&#x03A9;\"> <!ENTITY alpha \"&#x03B1;\"> <!ENTITY beta \"&#x03B2;\"> <!ENTITY gamma \"&#x03B3;\"> <!ENTITY delta \"&#x03B4;\"> <!ENTITY epsilon \"&#x03B5;\"> <!ENTITY zeta \"&#x03B6;\"> <!ENTITY eta \"&#x03B7;\"> <!ENTITY theta \"&#x03B8;\"> <!ENTITY iota \"&#x03B9;\"> <!ENTITY kappa \"&#x03BA;\"> <!ENTITY lambda \"&#x03BB;\"> <!ENTITY mu \"&#x03BC;\"> <!ENTITY nu \"&#x03BD;\"> <!ENTITY xi \"&#x03BE;\"> <!ENTITY omicron \"&#x03BF;\"> <!ENTITY pi \"&#x03C0;\"> <!ENTITY rho \"&#x03C1;\"> <!ENTITY sigmaf \"&#x03C2;\"> <!ENTITY sigma \"&#x03C3;\"> <!ENTITY tau \"&#x03C4;\"> <!ENTITY upsilon \"&#x03C5;\"> <!ENTITY phi \"&#x03C6;\"> <!ENTITY chi \"&#x03C7;\"> <!ENTITY psi \"&#x03C8;\"> <!ENTITY omega \"&#x03C9;\"> <!ENTITY thetasym \"&#x03D1;\"> <!ENTITY upsih \"&#x03D2;\"> <!ENTITY piv \"&#x03D6;\"> <!ENTITY ensp \"&#x2002;\"> <!ENTITY emsp \"&#x2003;\"> <!ENTITY thinsp \"&#x2009;\"> <!ENTITY zwnj \"&#x200C;\"> <!ENTITY zwj \"&#x200D;\"> <!ENTITY lrm \"&#x200E;\"> <!ENTITY rlm \"&#x200F;\"> <!ENTITY ndash \"&#x2013;\"> <!ENTITY mdash \"&#x2014;\"> <!ENTITY lsquo \"&#x2018;\"> <!ENTITY rsquo \"&#x2019;\"> <!ENTITY sbquo \"&#x201A;\"> <!ENTITY ldquo \"&#x201C;\"> <!ENTITY rdquo \"&#x201D;\"> <!ENTITY bdquo \"&#x201E;\"> <!ENTITY dagger \"&#x2020;\"> <!ENTITY Dagger \"&#x2021;\"> <!ENTITY bull \"&#x2022;\"> <!ENTITY hellip \"&#x2026;\"> <!ENTITY permil \"&#x2030;\"> <!ENTITY prime \"&#x2032;\"> <!ENTITY Prime \"&#x2033;\"> <!ENTITY lsaquo \"&#x2039;\"> <!ENTITY rsaquo \"&#x203A;\"> <!ENTITY oline \"&#x203E;\"> <!ENTITY frasl \"&#x2044;\"> <!ENTITY euro \"&#x20AC;\"> <!ENTITY image \"&#x2111;\"> <!ENTITY weierp \"&#x2118;\"> <!ENTITY real \"&#x211C;\"> <!ENTITY trade \"&#x2122;\"> <!ENTITY alefsym \"&#x2135;\"> <!ENTITY larr \"&#x2190;\"> <!ENTITY uarr \"&#x2191;\"> <!ENTITY rarr \"&#x2192;\"> <!ENTITY darr \"&#x2193;\"> <!ENTITY harr \"&#x2194;\"> <!ENTITY crarr \"&#x21B5;\"> <!ENTITY lArr \"&#x21D0;\"> <!ENTITY uArr \"&#x21D1;\"> <!ENTITY rArr \"&#x21D2;\"> <!ENTITY dArr \"&#x21D3;\"> <!ENTITY hArr \"&#x21D4;\"> <!ENTITY forall \"&#x2200;\"> <!ENTITY part \"&#x2202;\"> <!ENTITY exist \"&#x2203;\"> <!ENTITY empty \"&#x2205;\"> <!ENTITY nabla \"&#x2207;\"> <!ENTITY isin \"&#x2208;\"> <!ENTITY notin \"&#x2209;\"> <!ENTITY ni \"&#x220B;\"> <!ENTITY prod \"&#x220F;\"> <!ENTITY sum \"&#x2211;\"> <!ENTITY minus \"&#x2212;\"> <!ENTITY lowast \"&#x2217;\"> <!ENTITY radic \"&#x221A;\"> <!ENTITY prop \"&#x221D;\"> <!ENTITY infin \"&#x221E;\"> <!ENTITY ang \"&#x2220;\"> <!ENTITY and \"&#x2227;\"> <!ENTITY or \"&#x2228;\"> <!ENTITY cap \"&#x2229;\"> <!ENTITY cup \"&#x222A;\"> <!ENTITY int \"&#x222B;\"> <!ENTITY there4 \"&#x2234;\"> <!ENTITY sim \"&#x223C;\"> <!ENTITY cong \"&#x2245;\"> <!ENTITY asymp \"&#x2248;\"> <!ENTITY ne \"&#x2260;\"> <!ENTITY equiv \"&#x2261;\"> <!ENTITY le \"&#x2264;\"> <!ENTITY ge \"&#x2265;\"> <!ENTITY sub \"&#x2282;\"> <!ENTITY sup \"&#x2283;\"> <!ENTITY nsub \"&#x2284;\"> <!ENTITY sube \"&#x2286;\"> <!ENTITY supe \"&#x2287;\"> <!ENTITY oplus \"&#x2295;\"> <!ENTITY otimes \"&#x2297;\"> <!ENTITY perp \"&#x22A5;\"> <!ENTITY sdot \"&#x22C5;\"> <!ENTITY lceil \"&#x2308;\"> <!ENTITY rceil \"&#x2309;\"> <!ENTITY lfloor \"&#x230A;\"> <!ENTITY rfloor \"&#x230B;\"> <!ENTITY lang \"&#x2329;\"> <!ENTITY rang \"&#x232A;\"> <!ENTITY loz \"&#x25CA;\"> <!ENTITY spades \"&#x2660;\"> <!ENTITY clubs \"&#x2663;\"> <!ENTITY hearts \"&#x2665;\"> <!ENTITY diams \"&#x2666;\"> ]>';\n\t}\n}\n", "num_lines": 662}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Handles `<media:rating>` or `<itunes:explicit>` tags as defined in Media RSS and iTunes RSS respectively\n *\n * Used by {@see SimplePie_Enclosure::get_rating()} and {@see SimplePie_Enclosure::get_ratings()}\n *\n * This class can be overloaded with {@see SimplePie::set_rating_class()}\n *\n * @package SimplePie\n * @subpackage API\n */\nclass SimplePie_Rating\n{\n\t/**\n\t * Rating scheme\n\t *\n\t * @var string\n\t * @see get_scheme()\n\t */\n\tvar $scheme;\n\n\t/**\n\t * Rating value\n\t *\n\t * @var string\n\t * @see get_value()\n\t */\n\tvar $value;\n\n\t/**\n\t * Constructor, used to input the data\n\t *\n\t * For documentation on all the parameters, see the corresponding\n\t * properties and their accessors\n\t */\n\tpublic function __construct($scheme = null, $value = null)\n\t{\n\t\t$this->scheme = $scheme;\n\t\t$this->value = $value;\n\t}\n\n\t/**\n\t * String-ified version\n\t *\n\t * @return string\n\t */\n\tpublic function __toString()\n\t{\n\t\t// There is no $this->data here\n\t\treturn md5(serialize($this));\n\t}\n\n\t/**\n\t * Get the organizational scheme for the rating\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_scheme()\n\t{\n\t\tif ($this->scheme !== null)\n\t\t{\n\t\t\treturn $this->scheme;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the value of the rating\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_value()\n\t{\n\t\tif ($this->value !== null)\n\t\t{\n\t\t\treturn $this->value;\n\t\t}\n\n\t\treturn null;\n\t}\n}\n", "num_lines": 125}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Handles creating objects and calling methods\n *\n * Access this via {@see SimplePie::get_registry()}\n *\n * @package SimplePie\n */\nclass SimplePie_Registry\n{\n\t/**\n\t * Default class mapping\n\t *\n\t * Overriding classes *must* subclass these.\n\t *\n\t * @var array\n\t */\n\tprotected $default = array(\n\t\t'Cache' => 'SimplePie_Cache',\n\t\t'Locator' => 'SimplePie_Locator',\n\t\t'Parser' => 'SimplePie_Parser',\n\t\t'File' => 'SimplePie_File',\n\t\t'Sanitize' => 'SimplePie_Sanitize',\n\t\t'Item' => 'SimplePie_Item',\n\t\t'Author' => 'SimplePie_Author',\n\t\t'Category' => 'SimplePie_Category',\n\t\t'Enclosure' => 'SimplePie_Enclosure',\n\t\t'Caption' => 'SimplePie_Caption',\n\t\t'Copyright' => 'SimplePie_Copyright',\n\t\t'Credit' => 'SimplePie_Credit',\n\t\t'Rating' => 'SimplePie_Rating',\n\t\t'Restriction' => 'SimplePie_Restriction',\n\t\t'Content_Type_Sniffer' => 'SimplePie_Content_Type_Sniffer',\n\t\t'Source' => 'SimplePie_Source',\n\t\t'Misc' => 'SimplePie_Misc',\n\t\t'XML_Declaration_Parser' => 'SimplePie_XML_Declaration_Parser',\n\t\t'Parse_Date' => 'SimplePie_Parse_Date',\n\t);\n\n\t/**\n\t * Class mapping\n\t *\n\t * @see register()\n\t * @var array\n\t */\n\tprotected $classes = array();\n\n\t/**\n\t * Legacy classes\n\t *\n\t * @see register()\n\t * @var array\n\t */\n\tprotected $legacy = array();\n\n\t/**\n\t * Constructor\n\t *\n\t * No-op\n\t */\n\tpublic function __construct() { }\n\n\t/**\n\t * Register a class\n\t *\n\t * @param string $type See {@see $default} for names\n\t * @param string $class Class name, must subclass the corresponding default\n\t * @param bool $legacy Whether to enable legacy support for this class\n\t * @return bool Successfulness\n\t */\n\tpublic function register($type, $class, $legacy = false)\n\t{\n\t\tif (!@is_subclass_of($class, $this->default[$type]))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->classes[$type] = $class;\n\n\t\tif ($legacy)\n\t\t{\n\t\t\t$this->legacy[] = $class;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Get the class registered for a type\n\t *\n\t * Where possible, use {@see create()} or {@see call()} instead\n\t *\n\t * @param string $type\n\t * @return string|null\n\t */\n\tpublic function get_class($type)\n\t{\n\t\tif (!empty($this->classes[$type]))\n\t\t{\n\t\t\treturn $this->classes[$type];\n\t\t}\n\t\tif (!empty($this->default[$type]))\n\t\t{\n\t\t\treturn $this->default[$type];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Create a new instance of a given type\n\t *\n\t * @param string $type\n\t * @param array $parameters Parameters to pass to the constructor\n\t * @return object Instance of class\n\t */\n\tpublic function &create($type, $parameters = array())\n\t{\n\t\t$class = $this->get_class($type);\n\n\t\tif (in_array($class, $this->legacy))\n\t\t{\n\t\t\tswitch ($type)\n\t\t\t{\n\t\t\t\tcase 'locator':\n\t\t\t\t\t// Legacy: file, timeout, useragent, file_class, max_checked_feeds, content_type_sniffer_class\n\t\t\t\t\t// Specified: file, timeout, useragent, max_checked_feeds\n\t\t\t\t\t$replacement = array($this->get_class('file'), $parameters[3], $this->get_class('content_type_sniffer'));\n\t\t\t\t\tarray_splice($parameters, 3, 1, $replacement);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!method_exists($class, '__construct'))\n\t\t{\n\t\t\t$instance = new $class;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$reflector = new ReflectionClass($class);\n\t\t\t$instance = $reflector->newInstanceArgs($parameters);\n\t\t}\n\n\t\tif (method_exists($instance, 'set_registry'))\n\t\t{\n\t\t\t$instance->set_registry($this);\n\t\t}\n\t\treturn $instance;\n\t}\n\n\t/**\n\t * Call a static method for a type\n\t *\n\t * @param string $type\n\t * @param string $method\n\t * @param array $parameters\n\t * @return mixed\n\t */\n\tpublic function &call($type, $method, $parameters = array())\n\t{\n\t\t$class = $this->get_class($type);\n\n\t\tif (in_array($class, $this->legacy))\n\t\t{\n\t\t\tswitch ($type)\n\t\t\t{\n\t\t\t\tcase 'Cache':\n\t\t\t\t\t// For backwards compatibility with old non-static\n\t\t\t\t\t// Cache::create() methods\n\t\t\t\t\tif ($method === 'get_handler')\n\t\t\t\t\t{\n\t\t\t\t\t\t$result = @call_user_func_array(array($class, 'create'), $parameters);\n\t\t\t\t\t\treturn $result;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$result = call_user_func_array(array($class, $method), $parameters);\n\t\treturn $result;\n\t}\n}\n", "num_lines": 225}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Handles `<media:restriction>` as defined in Media RSS\n *\n * Used by {@see SimplePie_Enclosure::get_restriction()} and {@see SimplePie_Enclosure::get_restrictions()}\n *\n * This class can be overloaded with {@see SimplePie::set_restriction_class()}\n *\n * @package SimplePie\n * @subpackage API\n */\nclass SimplePie_Restriction\n{\n\t/**\n\t * Relationship ('allow'/'deny')\n\t *\n\t * @var string\n\t * @see get_relationship()\n\t */\n\tvar $relationship;\n\n\t/**\n\t * Type of restriction\n\t *\n\t * @var string\n\t * @see get_type()\n\t */\n\tvar $type;\n\n\t/**\n\t * Restricted values\n\t *\n\t * @var string\n\t * @see get_value()\n\t */\n\tvar $value;\n\n\t/**\n\t * Constructor, used to input the data\n\t *\n\t * For documentation on all the parameters, see the corresponding\n\t * properties and their accessors\n\t */\n\tpublic function __construct($relationship = null, $type = null, $value = null)\n\t{\n\t\t$this->relationship = $relationship;\n\t\t$this->type = $type;\n\t\t$this->value = $value;\n\t}\n\n\t/**\n\t * String-ified version\n\t *\n\t * @return string\n\t */\n\tpublic function __toString()\n\t{\n\t\t// There is no $this->data here\n\t\treturn md5(serialize($this));\n\t}\n\n\t/**\n\t * Get the relationship\n\t *\n\t * @return string|null Either 'allow' or 'deny'\n\t */\n\tpublic function get_relationship()\n\t{\n\t\tif ($this->relationship !== null)\n\t\t{\n\t\t\treturn $this->relationship;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the type\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_type()\n\t{\n\t\tif ($this->type !== null)\n\t\t{\n\t\t\treturn $this->type;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Get the list of restricted things\n\t *\n\t * @return string|null\n\t */\n\tpublic function get_value()\n\t{\n\t\tif ($this->value !== null)\n\t\t{\n\t\t\treturn $this->value;\n\t\t}\n\n\t\treturn null;\n\t}\n}\n", "num_lines": 149}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Used for data cleanup and post-processing\n *\n *\n * This class can be overloaded with {@see SimplePie::set_sanitize_class()}\n *\n * @package SimplePie\n * @todo Move to using an actual HTML parser (this will allow tags to be properly stripped, and to switch between HTML and XHTML), this will also make it easier to shorten a string while preserving HTML tags\n */\nclass SimplePie_Sanitize\n{\n\t// Private vars\n\tvar $base;\n\n\t// Options\n\tvar $remove_div = true;\n\tvar $image_handler = '';\n\tvar $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style');\n\tvar $encode_instead_of_strip = false;\n\tvar $strip_attributes = array('bgsound', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc');\n\tvar $add_attributes = array('audio' => array('preload' => 'none'), 'iframe' => array('sandbox' => 'allow-scripts allow-same-origin'), 'video' => array('preload' => 'none'));\n\tvar $strip_comments = false;\n\tvar $output_encoding = 'UTF-8';\n\tvar $enable_cache = true;\n\tvar $cache_location = './cache';\n\tvar $cache_name_function = 'md5';\n\tvar $timeout = 10;\n\tvar $useragent = '';\n\tvar $force_fsockopen = false;\n\tvar $replace_url_attributes = null;\n\n\tpublic function __construct()\n\t{\n\t\t// Set defaults\n\t\t$this->set_url_replacements(null);\n\t}\n\n\tpublic function remove_div($enable = true)\n\t{\n\t\t$this->remove_div = (bool) $enable;\n\t}\n\n\tpublic function set_image_handler($page = false)\n\t{\n\t\tif ($page)\n\t\t{\n\t\t\t$this->image_handler = (string) $page;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->image_handler = false;\n\t\t}\n\t}\n\n\tpublic function set_registry(SimplePie_Registry $registry)\n\t{\n\t\t$this->registry = $registry;\n\t}\n\n\tpublic function pass_cache_data($enable_cache = true, $cache_location = './cache', $cache_name_function = 'md5', $cache_class = 'SimplePie_Cache')\n\t{\n\t\tif (isset($enable_cache))\n\t\t{\n\t\t\t$this->enable_cache = (bool) $enable_cache;\n\t\t}\n\n\t\tif ($cache_location)\n\t\t{\n\t\t\t$this->cache_location = (string) $cache_location;\n\t\t}\n\n\t\tif ($cache_name_function)\n\t\t{\n\t\t\t$this->cache_name_function = (string) $cache_name_function;\n\t\t}\n\t}\n\n\tpublic function pass_file_data($file_class = 'SimplePie_File', $timeout = 10, $useragent = '', $force_fsockopen = false)\n\t{\n\t\tif ($timeout)\n\t\t{\n\t\t\t$this->timeout = (string) $timeout;\n\t\t}\n\n\t\tif ($useragent)\n\t\t{\n\t\t\t$this->useragent = (string) $useragent;\n\t\t}\n\n\t\tif ($force_fsockopen)\n\t\t{\n\t\t\t$this->force_fsockopen = (string) $force_fsockopen;\n\t\t}\n\t}\n\n\tpublic function strip_htmltags($tags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style'))\n\t{\n\t\tif ($tags)\n\t\t{\n\t\t\tif (is_array($tags))\n\t\t\t{\n\t\t\t\t$this->strip_htmltags = $tags;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->strip_htmltags = explode(',', $tags);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->strip_htmltags = false;\n\t\t}\n\t}\n\n\tpublic function encode_instead_of_strip($encode = false)\n\t{\n\t\t$this->encode_instead_of_strip = (bool) $encode;\n\t}\n\n\tpublic function strip_attributes($attribs = array('bgsound', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc'))\n\t{\n\t\tif ($attribs)\n\t\t{\n\t\t\tif (is_array($attribs))\n\t\t\t{\n\t\t\t\t$this->strip_attributes = $attribs;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->strip_attributes = explode(',', $attribs);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->strip_attributes = false;\n\t\t}\n\t}\n\n\tpublic function add_attributes($attribs = array('audio' => array('preload' => 'none'), 'iframe' => array('sandbox' => 'allow-scripts allow-same-origin'), 'video' => array('preload' => 'none')))\n\t{\n\t\tif ($attribs)\n\t\t{\n\t\t\tif (is_array($attribs))\n\t\t\t{\n\t\t\t\t$this->add_attributes = $attribs;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->add_attributes = explode(',', $attribs);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->add_attributes = false;\n\t\t}\n\t}\n\n\tpublic function strip_comments($strip = false)\n\t{\n\t\t$this->strip_comments = (bool) $strip;\n\t}\n\n\tpublic function set_output_encoding($encoding = 'UTF-8')\n\t{\n\t\t$this->output_encoding = (string) $encoding;\n\t}\n\n\t/**\n\t * Set element/attribute key/value pairs of HTML attributes\n\t * containing URLs that need to be resolved relative to the feed\n\t *\n\t * Defaults to |a|@href, |area|@href, |blockquote|@cite, |del|@cite,\n\t * |form|@action, |img|@longdesc, |img|@src, |input|@src, |ins|@cite,\n\t * |q|@cite\n\t *\n\t * @since 1.0\n\t * @param array|null $element_attribute Element/attribute key/value pairs, null for default\n\t */\n\tpublic function set_url_replacements($element_attribute = null)\n\t{\n\t\tif ($element_attribute === null)\n\t\t{\n\t\t\t$element_attribute = array(\n\t\t\t\t'a' => 'href',\n\t\t\t\t'area' => 'href',\n\t\t\t\t'blockquote' => 'cite',\n\t\t\t\t'del' => 'cite',\n\t\t\t\t'form' => 'action',\n\t\t\t\t'img' => array(\n\t\t\t\t\t'longdesc',\n\t\t\t\t\t'src'\n\t\t\t\t),\n\t\t\t\t'input' => 'src',\n\t\t\t\t'ins' => 'cite',\n\t\t\t\t'q' => 'cite'\n\t\t\t);\n\t\t}\n\t\t$this->replace_url_attributes = (array) $element_attribute;\n\t}\n\n\tpublic function sanitize($data, $type, $base = '')\n\t{\n\t\t$data = trim($data);\n\t\tif ($data !== '' || $type & SIMPLEPIE_CONSTRUCT_IRI)\n\t\t{\n\t\t\tif ($type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML)\n\t\t\t{\n\t\t\t\tif (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\\/[A-Za-z][^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x2F\\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data))\n\t\t\t\t{\n\t\t\t\t\t$type |= SIMPLEPIE_CONSTRUCT_HTML;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$type |= SIMPLEPIE_CONSTRUCT_TEXT;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($type & SIMPLEPIE_CONSTRUCT_BASE64)\n\t\t\t{\n\t\t\t\t$data = base64_decode($data);\n\t\t\t}\n\n\t\t\tif ($type & (SIMPLEPIE_CONSTRUCT_HTML | SIMPLEPIE_CONSTRUCT_XHTML))\n\t\t\t{\n\n\t\t\t\tif (!class_exists('DOMDocument'))\n\t\t\t\t{\n\t\t\t\t\tthrow new SimplePie_Exception('DOMDocument not found, unable to use sanitizer');\n\t\t\t\t}\n\t\t\t\t$document = new DOMDocument();\n\t\t\t\t$document->encoding = 'UTF-8';\n\n\t\t\t\t$data = $this->preprocess($data, $type);\n\n\t\t\t\tset_error_handler(array('SimplePie_Misc', 'silence_errors'));\n\t\t\t\t$document->loadHTML($data);\n\t\t\t\trestore_error_handler();\n\n\t\t\t\t$xpath = new DOMXPath($document);\n\n\t\t\t\t// Strip comments\n\t\t\t\tif ($this->strip_comments)\n\t\t\t\t{\n\t\t\t\t\t$comments = $xpath->query('//comment()');\n\n\t\t\t\t\tforeach ($comments as $comment)\n\t\t\t\t\t{\n\t\t\t\t\t\t$comment->parentNode->removeChild($comment);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Strip out HTML tags and attributes that might cause various security problems.\n\t\t\t\t// Based on recommendations by Mark Pilgrim at:\n\t\t\t\t// http://diveintomark.org/archives/2003/06/12/how_to_consume_rss_safely\n\t\t\t\tif ($this->strip_htmltags)\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->strip_htmltags as $tag)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->strip_tag($tag, $document, $xpath, $type);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($this->strip_attributes)\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->strip_attributes as $attrib)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->strip_attr($attrib, $xpath);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($this->add_attributes)\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->add_attributes as $tag => $valuePairs)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->add_attr($tag, $valuePairs, $document);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Replace relative URLs\n\t\t\t\t$this->base = $base;\n\t\t\t\tforeach ($this->replace_url_attributes as $element => $attributes)\n\t\t\t\t{\n\t\t\t\t\t$this->replace_urls($document, $element, $attributes);\n\t\t\t\t}\n\n\t\t\t\t// If image handling (caching, etc.) is enabled, cache and rewrite all the image tags.\n\t\t\t\tif (isset($this->image_handler) && ((string) $this->image_handler) !== '' && $this->enable_cache)\n\t\t\t\t{\n\t\t\t\t\t$images = $document->getElementsByTagName('img');\n\t\t\t\t\tforeach ($images as $img)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($img->hasAttribute('src'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$image_url = call_user_func($this->cache_name_function, $img->getAttribute('src'));\n\t\t\t\t\t\t\t$cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, $image_url, 'spi'));\n\n\t\t\t\t\t\t\tif ($cache->load())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$img->setAttribute('src', $this->image_handler . $image_url);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$file = $this->registry->create('File', array($img->getAttribute('src'), $this->timeout, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen));\n\t\t\t\t\t\t\t\t$headers = $file->headers;\n\n\t\t\t\t\t\t\t\tif ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($cache->save(array('headers' => $file->headers, 'body' => $file->body)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$img->setAttribute('src', $this->image_handler . $image_url);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttrigger_error(\"$this->cache_location is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.\", E_USER_WARNING);\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Get content node\n\t\t\t\t$div = $document->getElementsByTagName('body')->item(0)->firstChild;\n\t\t\t\t// Finally, convert to a HTML string\n\t\t\t\t$data = trim($document->saveHTML($div));\n\n\t\t\t\tif ($this->remove_div)\n\t\t\t\t{\n\t\t\t\t\t$data = preg_replace('/^<div' . SIMPLEPIE_PCRE_XML_ATTRIBUTE . '>/', '', $data);\n\t\t\t\t\t$data = preg_replace('/<\\/div>$/', '', $data);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data = preg_replace('/^<div' . SIMPLEPIE_PCRE_XML_ATTRIBUTE . '>/', '<div>', $data);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($type & SIMPLEPIE_CONSTRUCT_IRI)\n\t\t\t{\n\t\t\t\t$absolute = $this->registry->call('Misc', 'absolutize_url', array($data, $base));\n\t\t\t\tif ($absolute !== false)\n\t\t\t\t{\n\t\t\t\t\t$data = $absolute;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($type & (SIMPLEPIE_CONSTRUCT_TEXT | SIMPLEPIE_CONSTRUCT_IRI))\n\t\t\t{\n\t\t\t\t$data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8');\n\t\t\t}\n\n\t\t\tif ($this->output_encoding !== 'UTF-8')\n\t\t\t{\n\t\t\t\t$data = $this->registry->call('Misc', 'change_encoding', array($data, 'UTF-8', $this->output_encoding));\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}\n\n\tprotected function preprocess($html, $type)\n\t{\n\t\t$ret = '';\n\t\t$html = preg_replace('%</?(?:html|body)[^>]*?'.'>%is', '', $html);\n\t\tif ($type & ~SIMPLEPIE_CONSTRUCT_XHTML)\n\t\t{\n\t\t\t// Atom XHTML constructs are wrapped with a div by default\n\t\t\t// Note: No protection if $html contains a stray </div>!\n\t\t\t$html = '<div>' . $html . '</div>';\n\t\t\t$ret .= '<!DOCTYPE html>';\n\t\t\t$content_type = 'text/html';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ret .= '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">';\n\t\t\t$content_type = 'application/xhtml+xml';\n\t\t}\n\n\t\t$ret .= '<html><head>';\n\t\t$ret .= '<meta http-equiv=\"Content-Type\" content=\"' . $content_type . '; charset=utf-8\" />';\n\t\t$ret .= '</head><body>' . $html . '</body></html>';\n\t\treturn $ret;\n\t}\n\n\tpublic function replace_urls($document, $tag, $attributes)\n\t{\n\t\tif (!is_array($attributes))\n\t\t{\n\t\t\t$attributes = array($attributes);\n\t\t}\n\n\t\tif (!is_array($this->strip_htmltags) || !in_array($tag, $this->strip_htmltags))\n\t\t{\n\t\t\t$elements = $document->getElementsByTagName($tag);\n\t\t\tforeach ($elements as $element)\n\t\t\t{\n\t\t\t\tforeach ($attributes as $attribute)\n\t\t\t\t{\n\t\t\t\t\tif ($element->hasAttribute($attribute))\n\t\t\t\t\t{\n\t\t\t\t\t\t$value = $this->registry->call('Misc', 'absolutize_url', array($element->getAttribute($attribute), $this->base));\n\t\t\t\t\t\tif ($value !== false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$element->setAttribute($attribute, $value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic function do_strip_htmltags($match)\n\t{\n\t\tif ($this->encode_instead_of_strip)\n\t\t{\n\t\t\tif (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style')))\n\t\t\t{\n\t\t\t\t$match[1] = htmlspecialchars($match[1], ENT_COMPAT, 'UTF-8');\n\t\t\t\t$match[2] = htmlspecialchars($match[2], ENT_COMPAT, 'UTF-8');\n\t\t\t\treturn \"&lt;$match[1]$match[2]&gt;$match[3]&lt;/$match[1]&gt;\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn htmlspecialchars($match[0], ENT_COMPAT, 'UTF-8');\n\t\t\t}\n\t\t}\n\t\telseif (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style')))\n\t\t{\n\t\t\treturn $match[4];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t}\n\n\tprotected function strip_tag($tag, $document, $xpath, $type)\n\t{\n\t\t$elements = $xpath->query('body//' . $tag);\n\t\tif ($this->encode_instead_of_strip)\n\t\t{\n\t\t\tforeach ($elements as $element)\n\t\t\t{\n\t\t\t\t$fragment = $document->createDocumentFragment();\n\n\t\t\t\t// For elements which aren't script or style, include the tag itself\n\t\t\t\tif (!in_array($tag, array('script', 'style')))\n\t\t\t\t{\n\t\t\t\t\t$text = '<' . $tag;\n\t\t\t\t\tif ($element->hasAttributes())\n\t\t\t\t\t{\n\t\t\t\t\t\t$attrs = array();\n\t\t\t\t\t\tforeach ($element->attributes as $name => $attr)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$value = $attr->value;\n\n\t\t\t\t\t\t\t// In XHTML, empty values should never exist, so we repeat the value\n\t\t\t\t\t\t\tif (empty($value) && ($type & SIMPLEPIE_CONSTRUCT_XHTML))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$value = $name;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// For HTML, empty is fine\n\t\t\t\t\t\t\telseif (empty($value) && ($type & SIMPLEPIE_CONSTRUCT_HTML))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$attrs[] = $name;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Standard attribute text\n\t\t\t\t\t\t\t$attrs[] = $name . '=\"' . $attr->value . '\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$text .= ' ' . implode(' ', $attrs);\n\t\t\t\t\t}\n\t\t\t\t\t$text .= '>';\n\t\t\t\t\t$fragment->appendChild(new DOMText($text));\n\t\t\t\t}\n\n\t\t\t\t$number = $element->childNodes->length;\n\t\t\t\tfor ($i = $number; $i > 0; $i--)\n\t\t\t\t{\n\t\t\t\t\t$child = $element->childNodes->item(0);\n\t\t\t\t\t$fragment->appendChild($child);\n\t\t\t\t}\n\n\t\t\t\tif (!in_array($tag, array('script', 'style')))\n\t\t\t\t{\n\t\t\t\t\t$fragment->appendChild(new DOMText('</' . $tag . '>'));\n\t\t\t\t}\n\n\t\t\t\t$element->parentNode->replaceChild($fragment, $element);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t\telseif (in_array($tag, array('script', 'style')))\n\t\t{\n\t\t\tforeach ($elements as $element)\n\t\t\t{\n\t\t\t\t$element->parentNode->removeChild($element);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach ($elements as $element)\n\t\t\t{\n\t\t\t\t$fragment = $document->createDocumentFragment();\n\t\t\t\t$number = $element->childNodes->length;\n\t\t\t\tfor ($i = $number; $i > 0; $i--)\n\t\t\t\t{\n\t\t\t\t\t$child = $element->childNodes->item(0);\n\t\t\t\t\t$fragment->appendChild($child);\n\t\t\t\t}\n\n\t\t\t\t$element->parentNode->replaceChild($fragment, $element);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected function strip_attr($attrib, $xpath)\n\t{\n\t\t$elements = $xpath->query('//*[@' . $attrib . ']');\n\n\t\tforeach ($elements as $element)\n\t\t{\n\t\t\t$element->removeAttribute($attrib);\n\t\t}\n\t}\n\n\tprotected function add_attr($tag, $valuePairs, $document)\n\t{\n\t\t$elements = $document->getElementsByTagName($tag);\n\t\tforeach ($elements as $element)\n\t\t{\n\t\t\tforeach ($valuePairs as $attrib => $value)\n\t\t\t{\n\t\t\t\t$element->setAttribute($attrib, $value);\n\t\t\t}\n\t\t}\n\t}\n}\n", "num_lines": 585}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Handles `<atom:source>`\n *\n * Used by {@see SimplePie_Item::get_source()}\n *\n * This class can be overloaded with {@see SimplePie::set_source_class()}\n *\n * @package SimplePie\n * @subpackage API\n */\nclass SimplePie_Source\n{\n\tvar $item;\n\tvar $data = array();\n\tprotected $registry;\n\n\tpublic function __construct($item, $data)\n\t{\n\t\t$this->item = $item;\n\t\t$this->data = $data;\n\t}\n\n\tpublic function set_registry(SimplePie_Registry $registry)\n\t{\n\t\t$this->registry = $registry;\n\t}\n\n\tpublic function __toString()\n\t{\n\t\treturn md5(serialize($this->data));\n\t}\n\n\tpublic function get_source_tags($namespace, $tag)\n\t{\n\t\tif (isset($this->data['child'][$namespace][$tag]))\n\t\t{\n\t\t\treturn $this->data['child'][$namespace][$tag];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic function get_base($element = array())\n\t{\n\t\treturn $this->item->get_base($element);\n\t}\n\n\tpublic function sanitize($data, $type, $base = '')\n\t{\n\t\treturn $this->item->sanitize($data, $type, $base);\n\t}\n\n\tpublic function get_item()\n\t{\n\t\treturn $this->item;\n\t}\n\n\tpublic function get_title()\n\t{\n\t\tif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic function get_category($key = 0)\n\t{\n\t\t$categories = $this->get_categories();\n\t\tif (isset($categories[$key]))\n\t\t{\n\t\t\treturn $categories[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic function get_categories()\n\t{\n\t\t$categories = array();\n\n\t\tforeach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category)\n\t\t{\n\t\t\t$term = null;\n\t\t\t$scheme = null;\n\t\t\t$label = null;\n\t\t\tif (isset($category['attribs']['']['term']))\n\t\t\t{\n\t\t\t\t$term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($category['attribs']['']['scheme']))\n\t\t\t{\n\t\t\t\t$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($category['attribs']['']['label']))\n\t\t\t{\n\t\t\t\t$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\t$categories[] = $this->registry->create('Category', array($term, $scheme, $label));\n\t\t}\n\t\tforeach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category)\n\t\t{\n\t\t\t// This is really the label, but keep this as the term also for BC.\n\t\t\t// Label will also work on retrieving because that falls back to term.\n\t\t\t$term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\tif (isset($category['attribs']['']['domain']))\n\t\t\t{\n\t\t\t\t$scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$scheme = null;\n\t\t\t}\n\t\t\t$categories[] = $this->registry->create('Category', array($term, $scheme, null));\n\t\t}\n\t\tforeach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category)\n\t\t{\n\t\t\t$categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));\n\t\t}\n\t\tforeach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'subject') as $category)\n\t\t{\n\t\t\t$categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));\n\t\t}\n\n\t\tif (!empty($categories))\n\t\t{\n\t\t\treturn array_unique($categories);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic function get_author($key = 0)\n\t{\n\t\t$authors = $this->get_authors();\n\t\tif (isset($authors[$key]))\n\t\t{\n\t\t\treturn $authors[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic function get_authors()\n\t{\n\t\t$authors = array();\n\t\tforeach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author)\n\t\t{\n\t\t\t$name = null;\n\t\t\t$uri = null;\n\t\t\t$email = null;\n\t\t\tif (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))\n\t\t\t{\n\t\t\t\t$name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))\n\t\t\t{\n\t\t\t\t$uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));\n\t\t\t}\n\t\t\tif (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))\n\t\t\t{\n\t\t\t\t$email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif ($name !== null || $email !== null || $uri !== null)\n\t\t\t{\n\t\t\t\t$authors[] = $this->registry->create('Author', array($name, $uri, $email));\n\t\t\t}\n\t\t}\n\t\tif ($author = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))\n\t\t{\n\t\t\t$name = null;\n\t\t\t$url = null;\n\t\t\t$email = null;\n\t\t\tif (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))\n\t\t\t{\n\t\t\t\t$name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))\n\t\t\t{\n\t\t\t\t$url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));\n\t\t\t}\n\t\t\tif (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))\n\t\t\t{\n\t\t\t\t$email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif ($name !== null || $email !== null || $url !== null)\n\t\t\t{\n\t\t\t\t$authors[] = $this->registry->create('Author', array($name, $url, $email));\n\t\t\t}\n\t\t}\n\t\tforeach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author)\n\t\t{\n\t\t\t$authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));\n\t\t}\n\t\tforeach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author)\n\t\t{\n\t\t\t$authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));\n\t\t}\n\t\tforeach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author)\n\t\t{\n\t\t\t$authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));\n\t\t}\n\n\t\tif (!empty($authors))\n\t\t{\n\t\t\treturn array_unique($authors);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic function get_contributor($key = 0)\n\t{\n\t\t$contributors = $this->get_contributors();\n\t\tif (isset($contributors[$key]))\n\t\t{\n\t\t\treturn $contributors[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic function get_contributors()\n\t{\n\t\t$contributors = array();\n\t\tforeach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor)\n\t\t{\n\t\t\t$name = null;\n\t\t\t$uri = null;\n\t\t\t$email = null;\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))\n\t\t\t{\n\t\t\t\t$name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))\n\t\t\t{\n\t\t\t\t$uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));\n\t\t\t}\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))\n\t\t\t{\n\t\t\t\t$email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif ($name !== null || $email !== null || $uri !== null)\n\t\t\t{\n\t\t\t\t$contributors[] = $this->registry->create('Author', array($name, $uri, $email));\n\t\t\t}\n\t\t}\n\t\tforeach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor)\n\t\t{\n\t\t\t$name = null;\n\t\t\t$url = null;\n\t\t\t$email = null;\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))\n\t\t\t{\n\t\t\t\t$name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))\n\t\t\t{\n\t\t\t\t$url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));\n\t\t\t}\n\t\t\tif (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))\n\t\t\t{\n\t\t\t\t$email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t\t}\n\t\t\tif ($name !== null || $email !== null || $url !== null)\n\t\t\t{\n\t\t\t\t$contributors[] = $this->registry->create('Author', array($name, $url, $email));\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($contributors))\n\t\t{\n\t\t\treturn array_unique($contributors);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic function get_link($key = 0, $rel = 'alternate')\n\t{\n\t\t$links = $this->get_links($rel);\n\t\tif (isset($links[$key]))\n\t\t{\n\t\t\treturn $links[$key];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Added for parity between the parent-level and the item/entry-level.\n\t */\n\tpublic function get_permalink()\n\t{\n\t\treturn $this->get_link(0);\n\t}\n\n\tpublic function get_links($rel = 'alternate')\n\t{\n\t\tif (!isset($this->data['links']))\n\t\t{\n\t\t\t$this->data['links'] = array();\n\t\t\tif ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link'))\n\t\t\t{\n\t\t\t\tforeach ($links as $link)\n\t\t\t\t{\n\t\t\t\t\tif (isset($link['attribs']['']['href']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';\n\t\t\t\t\t\t$this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link'))\n\t\t\t{\n\t\t\t\tforeach ($links as $link)\n\t\t\t\t{\n\t\t\t\t\tif (isset($link['attribs']['']['href']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';\n\t\t\t\t\t\t$this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link'))\n\t\t\t{\n\t\t\t\t$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));\n\t\t\t}\n\t\t\tif ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link'))\n\t\t\t{\n\t\t\t\t$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));\n\t\t\t}\n\t\t\tif ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))\n\t\t\t{\n\t\t\t\t$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));\n\t\t\t}\n\n\t\t\t$keys = array_keys($this->data['links']);\n\t\t\tforeach ($keys as $key)\n\t\t\t{\n\t\t\t\tif ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))\n\t\t\t\t{\n\t\t\t\t\tif (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]);\n\t\t\t\t\t\t$this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key];\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->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)\n\t\t\t\t{\n\t\t\t\t\t$this->data['links'][substr($key, 41)] =& $this->data['links'][$key];\n\t\t\t\t}\n\t\t\t\t$this->data['links'][$key] = array_unique($this->data['links'][$key]);\n\t\t\t}\n\t\t}\n\n\t\tif (isset($this->data['links'][$rel]))\n\t\t{\n\t\t\treturn $this->data['links'][$rel];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic function get_description()\n\t{\n\t\tif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'tagline'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic function get_copyright()\n\t{\n\t\tif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'copyright'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic function get_language()\n\t{\n\t\tif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'language'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'language'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\t\telseif (isset($this->data['xml_lang']))\n\t\t{\n\t\t\treturn $this->sanitize($this->data['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic function get_latitude()\n\t{\n\t\tif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat'))\n\t\t{\n\t\t\treturn (float) $return[0]['data'];\n\t\t}\n\t\telseif (($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\\.[0-9]+)) ((?:-)?[0-9]+(?:\\.[0-9]+))$/', trim($return[0]['data']), $match))\n\t\t{\n\t\t\treturn (float) $match[1];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic function get_longitude()\n\t{\n\t\tif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long'))\n\t\t{\n\t\t\treturn (float) $return[0]['data'];\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon'))\n\t\t{\n\t\t\treturn (float) $return[0]['data'];\n\t\t}\n\t\telseif (($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\\.[0-9]+)) ((?:-)?[0-9]+(?:\\.[0-9]+))$/', trim($return[0]['data']), $match))\n\t\t{\n\t\t\treturn (float) $match[2];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic function get_image_url()\n\t{\n\t\tif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'image'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI);\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'logo'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));\n\t\t}\n\t\telseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'icon'))\n\t\t{\n\t\t\treturn $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));\n\t\t}\n\n\t\treturn null;\n\t}\n}\n", "num_lines": 578}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Base for cache objects\n *\n * Classes to be used with {@see SimplePie_Cache::register()} are expected\n * to implement this interface.\n *\n * @package SimplePie\n * @subpackage Caching\n */\ninterface SimplePie_Cache_Base\n{\n\t/**\n\t * Feed cache type\n\t *\n\t * @var string\n\t */\n\tconst TYPE_FEED = 'spc';\n\n\t/**\n\t * Image cache type\n\t *\n\t * @var string\n\t */\n\tconst TYPE_IMAGE = 'spi';\n\n\t/**\n\t * Create a new cache object\n\t *\n\t * @param string $location Location string (from SimplePie::$cache_location)\n\t * @param string $name Unique ID for the cache\n\t * @param string $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data\n\t */\n\tpublic function __construct($location, $name, $type);\n\n\t/**\n\t * Save data to the cache\n\t *\n\t * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property\n\t * @return bool Successfulness\n\t */\n\tpublic function save($data);\n\n\t/**\n\t * Retrieve the data saved to the cache\n\t *\n\t * @return array Data for SimplePie::$data\n\t */\n\tpublic function load();\n\n\t/**\n\t * Retrieve the last modified time for the cache\n\t *\n\t * @return int Timestamp\n\t */\n\tpublic function mtime();\n\n\t/**\n\t * Set the last modified time to the current time\n\t *\n\t * @return bool Success status\n\t */\n\tpublic function touch();\n\n\t/**\n\t * Remove the cache\n\t *\n\t * @return bool Success status\n\t */\n\tpublic function unlink();\n}\n", "num_lines": 114}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Base class for database-based caches\n *\n * @package SimplePie\n * @subpackage Caching\n */\nabstract class SimplePie_Cache_DB implements SimplePie_Cache_Base\n{\n\t/**\n\t * Helper for database conversion\n\t *\n\t * Converts a given {@see SimplePie} object into data to be stored\n\t *\n\t * @param SimplePie $data\n\t * @return array First item is the serialized data for storage, second item is the unique ID for this item\n\t */\n\tprotected static function prepare_simplepie_object_for_cache($data)\n\t{\n\t\t$items = $data->get_items();\n\t\t$items_by_id = array();\n\n\t\tif (!empty($items))\n\t\t{\n\t\t\tforeach ($items as $item)\n\t\t\t{\n\t\t\t\t$items_by_id[$item->get_id()] = $item;\n\t\t\t}\n\n\t\t\tif (count($items_by_id) !== count($items))\n\t\t\t{\n\t\t\t\t$items_by_id = array();\n\t\t\t\tforeach ($items as $item)\n\t\t\t\t{\n\t\t\t\t\t$items_by_id[$item->get_id(true)] = $item;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]))\n\t\t\t{\n\t\t\t\t$channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0];\n\t\t\t}\n\t\t\telseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]))\n\t\t\t{\n\t\t\t\t$channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0];\n\t\t\t}\n\t\t\telseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]))\n\t\t\t{\n\t\t\t\t$channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0];\n\t\t\t}\n\t\t\telseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0]))\n\t\t\t{\n\t\t\t\t$channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$channel = null;\n\t\t\t}\n\n\t\t\tif ($channel !== null)\n\t\t\t{\n\t\t\t\tif (isset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry']))\n\t\t\t\t{\n\t\t\t\t\tunset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry']);\n\t\t\t\t}\n\t\t\t\tif (isset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['entry']))\n\t\t\t\t{\n\t\t\t\t\tunset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['entry']);\n\t\t\t\t}\n\t\t\t\tif (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item']))\n\t\t\t\t{\n\t\t\t\t\tunset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item']);\n\t\t\t\t}\n\t\t\t\tif (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item']))\n\t\t\t\t{\n\t\t\t\t\tunset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item']);\n\t\t\t\t}\n\t\t\t\tif (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_20]['item']))\n\t\t\t\t{\n\t\t\t\t\tunset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_20]['item']);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($data->data['items']))\n\t\t\t{\n\t\t\t\tunset($data->data['items']);\n\t\t\t}\n\t\t\tif (isset($data->data['ordered_items']))\n\t\t\t{\n\t\t\t\tunset($data->data['ordered_items']);\n\t\t\t}\n\t\t}\n\t\treturn array(serialize($data->data), $items_by_id);\n\t}\n}\n", "num_lines": 137}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Caches data to the filesystem\n *\n * @package SimplePie\n * @subpackage Caching\n */\nclass SimplePie_Cache_File implements SimplePie_Cache_Base\n{\n\t/**\n\t * Location string\n\t *\n\t * @see SimplePie::$cache_location\n\t * @var string\n\t */\n\tprotected $location;\n\n\t/**\n\t * Filename\n\t *\n\t * @var string\n\t */\n\tprotected $filename;\n\n\t/**\n\t * File extension\n\t *\n\t * @var string\n\t */\n\tprotected $extension;\n\n\t/**\n\t * File path\n\t *\n\t * @var string\n\t */\n\tprotected $name;\n\n\t/**\n\t * Create a new cache object\n\t *\n\t * @param string $location Location string (from SimplePie::$cache_location)\n\t * @param string $name Unique ID for the cache\n\t * @param string $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data\n\t */\n\tpublic function __construct($location, $name, $type)\n\t{\n\t\t$this->location = $location;\n\t\t$this->filename = $name;\n\t\t$this->extension = $type;\n\t\t$this->name = \"$this->location/$this->filename.$this->extension\";\n\t}\n\n\t/**\n\t * Save data to the cache\n\t *\n\t * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property\n\t * @return bool Successfulness\n\t */\n\tpublic function save($data)\n\t{\n\t\tif (file_exists($this->name) && is_writable($this->name) || file_exists($this->location) && is_writable($this->location))\n\t\t{\n\t\t\tif ($data instanceof SimplePie)\n\t\t\t{\n\t\t\t\t$data = $data->data;\n\t\t\t}\n\n\t\t\t$data = serialize($data);\n\t\t\treturn (bool) file_put_contents($this->name, $data);\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Retrieve the data saved to the cache\n\t *\n\t * @return array Data for SimplePie::$data\n\t */\n\tpublic function load()\n\t{\n\t\tif (file_exists($this->name) && is_readable($this->name))\n\t\t{\n\t\t\treturn unserialize(file_get_contents($this->name));\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Retrieve the last modified time for the cache\n\t *\n\t * @return int Timestamp\n\t */\n\tpublic function mtime()\n\t{\n\t\treturn @filemtime($this->name);\n\t}\n\n\t/**\n\t * Set the last modified time to the current time\n\t *\n\t * @return bool Success status\n\t */\n\tpublic function touch()\n\t{\n\t\treturn @touch($this->name);\n\t}\n\n\t/**\n\t * Remove the cache\n\t *\n\t * @return bool Success status\n\t */\n\tpublic function unlink()\n\t{\n\t\tif (file_exists($this->name))\n\t\t{\n\t\t\treturn unlink($this->name);\n\t\t}\n\t\treturn false;\n\t}\n}\n", "num_lines": 165}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Caches data to memcache\n *\n * Registered for URLs with the \"memcache\" protocol\n *\n * For example, `memcache://localhost:11211/?timeout=3600&prefix=sp_` will\n * connect to memcache on `localhost` on port 11211. All tables will be\n * prefixed with `sp_` and data will expire after 3600 seconds\n *\n * @package SimplePie\n * @subpackage Caching\n * @uses Memcache\n */\nclass SimplePie_Cache_Memcache implements SimplePie_Cache_Base\n{\n\t/**\n\t * Memcache instance\n\t *\n\t * @var Memcache\n\t */\n\tprotected $cache;\n\n\t/**\n\t * Options\n\t *\n\t * @var array\n\t */\n\tprotected $options;\n\n\t/**\n\t * Cache name\n\t *\n\t * @var string\n\t */\n\tprotected $name;\n\n\t/**\n\t * Create a new cache object\n\t *\n\t * @param string $location Location string (from SimplePie::$cache_location)\n\t * @param string $name Unique ID for the cache\n\t * @param string $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data\n\t */\n\tpublic function __construct($location, $name, $type)\n\t{\n\t\t$this->options = array(\n\t\t\t'host' => '127.0.0.1',\n\t\t\t'port' => 11211,\n\t\t\t'extras' => array(\n\t\t\t\t'timeout' => 3600, // one hour\n\t\t\t\t'prefix' => 'simplepie_',\n\t\t\t),\n\t\t);\n\t\t$this->options = SimplePie_Misc::array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location));\n\n\t\t$this->name = $this->options['extras']['prefix'] . md5(\"$name:$type\");\n\n\t\t$this->cache = new Memcache();\n\t\t$this->cache->addServer($this->options['host'], (int) $this->options['port']);\n\t}\n\n\t/**\n\t * Save data to the cache\n\t *\n\t * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property\n\t * @return bool Successfulness\n\t */\n\tpublic function save($data)\n\t{\n\t\tif ($data instanceof SimplePie)\n\t\t{\n\t\t\t$data = $data->data;\n\t\t}\n\t\treturn $this->cache->set($this->name, serialize($data), MEMCACHE_COMPRESSED, (int) $this->options['extras']['timeout']);\n\t}\n\n\t/**\n\t * Retrieve the data saved to the cache\n\t *\n\t * @return array Data for SimplePie::$data\n\t */\n\tpublic function load()\n\t{\n\t\t$data = $this->cache->get($this->name);\n\n\t\tif ($data !== false)\n\t\t{\n\t\t\treturn unserialize($data);\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Retrieve the last modified time for the cache\n\t *\n\t * @return int Timestamp\n\t */\n\tpublic function mtime()\n\t{\n\t\t$data = $this->cache->get($this->name);\n\n\t\tif ($data !== false)\n\t\t{\n\t\t\t// essentially ignore the mtime because Memcache expires on its own\n\t\t\treturn time();\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Set the last modified time to the current time\n\t *\n\t * @return bool Success status\n\t */\n\tpublic function touch()\n\t{\n\t\t$data = $this->cache->get($this->name);\n\n\t\tif ($data !== false)\n\t\t{\n\t\t\treturn $this->cache->set($this->name, $data, MEMCACHE_COMPRESSED, (int) $this->options['extras']['timeout']);\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Remove the cache\n\t *\n\t * @return bool Success status\n\t */\n\tpublic function unlink()\n\t{\n\t\treturn $this->cache->delete($this->name, 0);\n\t}\n}\n", "num_lines": 181}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Caches data to memcached\n *\n * Registered for URLs with the \"memcached\" protocol\n *\n * For example, `memcached://localhost:11211/?timeout=3600&prefix=sp_` will\n * connect to memcached on `localhost` on port 11211. All tables will be\n * prefixed with `sp_` and data will expire after 3600 seconds\n *\n * @package    SimplePie\n * @subpackage Caching\n * @author     Paul L. McNeely\n * @uses       Memcached\n */\nclass SimplePie_Cache_Memcached implements SimplePie_Cache_Base\n{\n    /**\n     * Memcached instance\n     * @var Memcached\n     */\n    protected $cache;\n\n    /**\n     * Options\n     * @var array\n     */\n    protected $options;\n\n    /**\n     * Cache name\n     * @var string\n     */\n    protected $name;\n\n    /**\n     * Create a new cache object\n     * @param string $location Location string (from SimplePie::$cache_location)\n     * @param string $name     Unique ID for the cache\n     * @param string $type     Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data\n     */\n    public function __construct($location, $name, $type) {\n        $this->options = array(\n            'host'   => '127.0.0.1',\n            'port'   => 11211,\n            'extras' => array(\n                'timeout' => 3600, // one hour\n                'prefix'  => 'simplepie_',\n            ),\n        );\n        $this->options = SimplePie_Misc::array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location));\n\n        $this->name = $this->options['extras']['prefix'] . md5(\"$name:$type\");\n\n        $this->cache = new Memcached();\n        $this->cache->addServer($this->options['host'], (int)$this->options['port']);\n    }\n\n    /**\n     * Save data to the cache\n     * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property\n     * @return bool Successfulness\n     */\n    public function save($data) {\n        if ($data instanceof SimplePie) {\n            $data = $data->data;\n        }\n\n        return $this->setData(serialize($data));\n    }\n\n    /**\n     * Retrieve the data saved to the cache\n     * @return array Data for SimplePie::$data\n     */\n    public function load() {\n        $data = $this->cache->get($this->name);\n\n        if ($data !== false) {\n            return unserialize($data);\n        }\n        return false;\n    }\n\n    /**\n     * Retrieve the last modified time for the cache\n     * @return int Timestamp\n     */\n    public function mtime() {\n        $data = $this->cache->get($this->name . '_mtime');\n        return (int) $data;\n    }\n\n    /**\n     * Set the last modified time to the current time\n     * @return bool Success status\n     */\n    public function touch() {\n        $data = $this->cache->get($this->name);\n        return $this->setData($data);\n    }\n\n    /**\n     * Remove the cache\n     * @return bool Success status\n     */\n    public function unlink() {\n        return $this->cache->delete($this->name, 0);\n    }\n\n    /**\n     * Set the last modified time and data to Memcached\n     * @return bool Success status\n     */\n    private function setData($data) {\n\n        if ($data !== false) {\n            $this->cache->set($this->name . '_mtime', time(), (int)$this->options['extras']['timeout']);\n            return $this->cache->set($this->name, $data, (int)$this->options['extras']['timeout']);\n        }\n\n        return false;\n    }\n}\n", "num_lines": 167}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n/**\n * Caches data to a MySQL database\n *\n * Registered for URLs with the \"mysql\" protocol\n *\n * For example, `mysql://root:password@localhost:3306/mydb?prefix=sp_` will\n * connect to the `mydb` database on `localhost` on port 3306, with the user\n * `root` and the password `password`. All tables will be prefixed with `sp_`\n *\n * @package SimplePie\n * @subpackage Caching\n */\nclass SimplePie_Cache_MySQL extends SimplePie_Cache_DB\n{\n\t/**\n\t * PDO instance\n\t *\n\t * @var PDO\n\t */\n\tprotected $mysql;\n\n\t/**\n\t * Options\n\t *\n\t * @var array\n\t */\n\tprotected $options;\n\n\t/**\n\t * Cache ID\n\t *\n\t * @var string\n\t */\n\tprotected $id;\n\n\t/**\n\t * Create a new cache object\n\t *\n\t * @param string $location Location string (from SimplePie::$cache_location)\n\t * @param string $name Unique ID for the cache\n\t * @param string $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data\n\t */\n\tpublic function __construct($location, $name, $type)\n\t{\n\t\t$this->options = array(\n\t\t\t'user' => null,\n\t\t\t'pass' => null,\n\t\t\t'host' => '127.0.0.1',\n\t\t\t'port' => '3306',\n\t\t\t'path' => '',\n\t\t\t'extras' => array(\n\t\t\t\t'prefix' => '',\n\t\t\t\t'cache_purge_time' => 2592000\n\t\t\t),\n\t\t);\n\n\t\t$this->options = SimplePie_Misc::array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location));\n\n\t\t// Path is prefixed with a \"/\"\n\t\t$this->options['dbname'] = substr($this->options['path'], 1);\n\n\t\ttry\n\t\t{\n\t\t\t$this->mysql = new PDO(\"mysql:dbname={$this->options['dbname']};host={$this->options['host']};port={$this->options['port']}\", $this->options['user'], $this->options['pass'], array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));\n\t\t}\n\t\tcatch (PDOException $e)\n\t\t{\n\t\t\t$this->mysql = null;\n\t\t\treturn;\n\t\t}\n\n\t\t$this->id = $name . $type;\n\n\t\tif (!$query = $this->mysql->query('SHOW TABLES'))\n\t\t{\n\t\t\t$this->mysql = null;\n\t\t\treturn;\n\t\t}\n\n\t\t$db = array();\n\t\twhile ($row = $query->fetchColumn())\n\t\t{\n\t\t\t$db[] = $row;\n\t\t}\n\n\t\tif (!in_array($this->options['extras']['prefix'] . 'cache_data', $db))\n\t\t{\n\t\t\t$query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'cache_data` (`id` TEXT CHARACTER SET utf8 NOT NULL, `items` SMALLINT NOT NULL DEFAULT 0, `data` BLOB NOT NULL, `mtime` INT UNSIGNED NOT NULL, UNIQUE (`id`(125)))');\n\t\t\tif ($query === false)\n\t\t\t{\n\t\t\t\ttrigger_error(\"Can't create \" . $this->options['extras']['prefix'] . \"cache_data table, check permissions\", E_USER_WARNING);\n\t\t\t\t$this->mysql = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (!in_array($this->options['extras']['prefix'] . 'items', $db))\n\t\t{\n\t\t\t$query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'items` (`feed_id` TEXT CHARACTER SET utf8 NOT NULL, `id` TEXT CHARACTER SET utf8 NOT NULL, `data` MEDIUMBLOB NOT NULL, `posted` INT UNSIGNED NOT NULL, INDEX `feed_id` (`feed_id`(125)))');\n\t\t\tif ($query === false)\n\t\t\t{\n\t\t\t\ttrigger_error(\"Can't create \" . $this->options['extras']['prefix'] . \"items table, check permissions\", E_USER_WARNING);\n\t\t\t\t$this->mysql = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Save data to the cache\n\t *\n\t * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property\n\t * @return bool Successfulness\n\t */\n\tpublic function save($data)\n\t{\n\t\tif ($this->mysql === null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$query = $this->mysql->prepare('DELETE i, cd FROM `' . $this->options['extras']['prefix'] . 'cache_data` cd, ' .\n\t\t\t'`' . $this->options['extras']['prefix'] . 'items` i ' .\n\t\t\t'WHERE cd.id = i.feed_id ' .\n\t\t\t'AND cd.mtime < (unix_timestamp() - :purge_time)');\n\t\t$query->bindValue(':purge_time', $this->options['extras']['cache_purge_time']);\n\n\t\tif (!$query->execute())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($data instanceof SimplePie)\n\t\t{\n\t\t\t$data = clone $data;\n\n\t\t\t$prepared = self::prepare_simplepie_object_for_cache($data);\n\n\t\t\t$query = $this->mysql->prepare('SELECT COUNT(*) FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :feed');\n\t\t\t$query->bindValue(':feed', $this->id);\n\t\t\tif ($query->execute())\n\t\t\t{\n\t\t\t\tif ($query->fetchColumn() > 0)\n\t\t\t\t{\n\t\t\t\t\t$items = count($prepared[1]);\n\t\t\t\t\tif ($items)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql = 'UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `items` = :items, `data` = :data, `mtime` = :time WHERE `id` = :feed';\n\t\t\t\t\t\t$query = $this->mysql->prepare($sql);\n\t\t\t\t\t\t$query->bindValue(':items', $items);\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$sql = 'UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `data` = :data, `mtime` = :time WHERE `id` = :feed';\n\t\t\t\t\t\t$query = $this->mysql->prepare($sql);\n\t\t\t\t\t}\n\n\t\t\t\t\t$query->bindValue(':data', $prepared[0]);\n\t\t\t\t\t$query->bindValue(':time', time());\n\t\t\t\t\t$query->bindValue(':feed', $this->id);\n\t\t\t\t\tif (!$query->execute())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\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$query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:feed, :count, :data, :time)');\n\t\t\t\t\t$query->bindValue(':feed', $this->id);\n\t\t\t\t\t$query->bindValue(':count', count($prepared[1]));\n\t\t\t\t\t$query->bindValue(':data', $prepared[0]);\n\t\t\t\t\t$query->bindValue(':time', time());\n\t\t\t\t\tif (!$query->execute())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$ids = array_keys($prepared[1]);\n\t\t\t\tif (!empty($ids))\n\t\t\t\t{\n\t\t\t\t\tforeach ($ids as $id)\n\t\t\t\t\t{\n\t\t\t\t\t\t$database_ids[] = $this->mysql->quote($id);\n\t\t\t\t\t}\n\n\t\t\t\t\t$query = $this->mysql->prepare('SELECT `id` FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `id` = ' . implode(' OR `id` = ', $database_ids) . ' AND `feed_id` = :feed');\n\t\t\t\t\t$query->bindValue(':feed', $this->id);\n\n\t\t\t\t\tif ($query->execute())\n\t\t\t\t\t{\n\t\t\t\t\t\t$existing_ids = array();\n\t\t\t\t\t\twhile ($row = $query->fetchColumn())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$existing_ids[] = $row;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$new_ids = array_diff($ids, $existing_ids);\n\n\t\t\t\t\t\tforeach ($new_ids as $new_id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!($date = $prepared[1][$new_id]->get_date('U')))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$date = time();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'items` (`feed_id`, `id`, `data`, `posted`) VALUES(:feed, :id, :data, :date)');\n\t\t\t\t\t\t\t$query->bindValue(':feed', $this->id);\n\t\t\t\t\t\t\t$query->bindValue(':id', $new_id);\n\t\t\t\t\t\t\t$query->bindValue(':data', serialize($prepared[1][$new_id]->data));\n\t\t\t\t\t\t\t$query->bindValue(':date', $date);\n\t\t\t\t\t\t\tif (!$query->execute())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn true;\n\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\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->mysql->prepare('SELECT `id` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :feed');\n\t\t\t$query->bindValue(':feed', $this->id);\n\t\t\tif ($query->execute())\n\t\t\t{\n\t\t\t\tif ($query->rowCount() > 0)\n\t\t\t\t{\n\t\t\t\t\t$query = $this->mysql->prepare('UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `items` = 0, `data` = :data, `mtime` = :time WHERE `id` = :feed');\n\t\t\t\t\t$query->bindValue(':data', serialize($data));\n\t\t\t\t\t$query->bindValue(':time', time());\n\t\t\t\t\t$query->bindValue(':feed', $this->id);\n\t\t\t\t\tif ($this->execute())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn true;\n\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$query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:id, 0, :data, :time)');\n\t\t\t\t\t$query->bindValue(':id', $this->id);\n\t\t\t\t\t$query->bindValue(':data', serialize($data));\n\t\t\t\t\t$query->bindValue(':time', time());\n\t\t\t\t\tif ($query->execute())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Retrieve the data saved to the cache\n\t *\n\t * @return array Data for SimplePie::$data\n\t */\n\tpublic function load()\n\t{\n\t\tif ($this->mysql === null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$query = $this->mysql->prepare('SELECT `items`, `data` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id');\n\t\t$query->bindValue(':id', $this->id);\n\t\tif ($query->execute() && ($row = $query->fetch()))\n\t\t{\n\t\t\t$data = unserialize($row[1]);\n\n\t\t\tif (isset($this->options['items'][0]))\n\t\t\t{\n\t\t\t\t$items = (int) $this->options['items'][0];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$items = (int) $row[0];\n\t\t\t}\n\n\t\t\tif ($items !== 0)\n\t\t\t{\n\t\t\t\tif (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]))\n\t\t\t\t{\n\t\t\t\t\t$feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0];\n\t\t\t\t}\n\t\t\t\telseif (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]))\n\t\t\t\t{\n\t\t\t\t\t$feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0];\n\t\t\t\t}\n\t\t\t\telseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]))\n\t\t\t\t{\n\t\t\t\t\t$feed =& $data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0];\n\t\t\t\t}\n\t\t\t\telseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]))\n\t\t\t\t{\n\t\t\t\t\t$feed =& $data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$feed = null;\n\t\t\t\t}\n\n\t\t\t\tif ($feed !== null)\n\t\t\t\t{\n\t\t\t\t\t$sql = 'SELECT `data` FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :feed ORDER BY `posted` DESC';\n\t\t\t\t\tif ($items > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql .= ' LIMIT ' . $items;\n\t\t\t\t\t}\n\n\t\t\t\t\t$query = $this->mysql->prepare($sql);\n\t\t\t\t\t$query->bindValue(':feed', $this->id);\n\t\t\t\t\tif ($query->execute())\n\t\t\t\t\t{\n\t\t\t\t\t\twhile ($row = $query->fetchColumn())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$feed['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry'][] = unserialize($row);\n\t\t\t\t\t\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\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $data;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Retrieve the last modified time for the cache\n\t *\n\t * @return int Timestamp\n\t */\n\tpublic function mtime()\n\t{\n\t\tif ($this->mysql === null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$query = $this->mysql->prepare('SELECT `mtime` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id');\n\t\t$query->bindValue(':id', $this->id);\n\t\tif ($query->execute() && ($time = $query->fetchColumn()))\n\t\t{\n\t\t\treturn $time;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Set the last modified time to the current time\n\t *\n\t * @return bool Success status\n\t */\n\tpublic function touch()\n\t{\n\t\tif ($this->mysql === null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$query = $this->mysql->prepare('UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `mtime` = :time WHERE `id` = :id');\n\t\t$query->bindValue(':time', time());\n\t\t$query->bindValue(':id', $this->id);\n\n\t\treturn $query->execute() && $query->rowCount() > 0;\n\t}\n\n\t/**\n\t * Remove the cache\n\t *\n\t * @return bool Success status\n\t */\n\tpublic function unlink()\n\t{\n\t\tif ($this->mysql === null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$query = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id');\n\t\t$query->bindValue(':id', $this->id);\n\t\t$query2 = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :id');\n\t\t$query2->bindValue(':id', $this->id);\n\n\t\treturn $query->execute() && $query2->execute();\n\t}\n}\n", "num_lines": 441}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * SimplePie Redis Cache Extension\n *\n * @package SimplePie\n * @author Jan Kozak <galvani78@gmail.com>\n * @link http://galvani.cz/\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n * @version 0.2.9\n */\n\n\n/**\n * Caches data to redis\n *\n * Registered for URLs with the \"redis\" protocol\n *\n * For example, `redis://localhost:6379/?timeout=3600&prefix=sp_&dbIndex=0` will\n * connect to redis on `localhost` on port 6379. All tables will be\n * prefixed with `simple_primary-` and data will expire after 3600 seconds\n *\n * @package SimplePie\n * @subpackage Caching\n * @uses Redis\n */\nclass SimplePie_Cache_Redis implements SimplePie_Cache_Base {\n    /**\n     * Redis instance\n     *\n     * @var \\Redis\n     */\n    protected $cache;\n\n    /**\n     * Options\n     *\n     * @var array\n     */\n    protected $options;\n\n    /**\n     * Cache name\n     *\n     * @var string\n     */\n    protected $name;\n\n    /**\n     * Cache Data\n     *\n     * @var type\n     */\n    protected $data;\n\n    /**\n     * Create a new cache object\n     *\n     * @param string $location Location string (from SimplePie::$cache_location)\n     * @param string $name Unique ID for the cache\n     * @param string $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data\n     */\n    public function __construct($location, $name, $options = null) {\n        //$this->cache = \\flow\\simple\\cache\\Redis::getRedisClientInstance();\n        $parsed = SimplePie_Cache::parse_URL($location);\n        $redis = new Redis();\n        $redis->connect($parsed['host'], $parsed['port']);\n        if (isset($parsed['pass'])) {\n            $redis->auth($parsed['pass']);\n        }\n        if (isset($parsed['path'])) {\n            $redis->select((int)substr($parsed['path'], 1));\n        }\n        $this->cache = $redis;\n\n        if (!is_null($options) && is_array($options)) {\n            $this->options = $options;\n        } else {\n            $this->options = array (\n                'prefix' => 'rss:simple_primary:',\n                'expire' => 0,\n            );\n        }\n\n        $this->name = $this->options['prefix'] . $name;\n    }\n\n    /**\n     * @param \\Redis $cache\n     */\n    public function setRedisClient(\\Redis $cache) {\n        $this->cache = $cache;\n    }\n\n    /**\n     * Save data to the cache\n     *\n     * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property\n     * @return bool Successfulness\n     */\n    public function save($data) {\n        if ($data instanceof SimplePie) {\n            $data = $data->data;\n        }\n        $response = $this->cache->set($this->name, serialize($data));\n        if ($this->options['expire']) {\n            $this->cache->expire($this->name, $this->options['expire']);\n        }\n\n        return $response;\n    }\n\n    /**\n     * Retrieve the data saved to the cache\n     *\n     * @return array Data for SimplePie::$data\n     */\n    public function load() {\n        $data = $this->cache->get($this->name);\n\n        if ($data !== false) {\n            return unserialize($data);\n        }\n        return false;\n    }\n\n    /**\n     * Retrieve the last modified time for the cache\n     *\n     * @return int Timestamp\n     */\n    public function mtime() {\n\n        $data = $this->cache->get($this->name);\n\n        if ($data !== false) {\n            return time();\n        }\n\n        return false;\n    }\n\n    /**\n     * Set the last modified time to the current time\n     *\n     * @return bool Success status\n     */\n    public function touch() {\n\n        $data = $this->cache->get($this->name);\n\n        if ($data !== false) {\n            $return = $this->cache->set($this->name, $data);\n            if ($this->options['expire']) {\n                return $this->cache->expire($this->name, $this->ttl);\n            }\n            return $return;\n        }\n\n        return false;\n    }\n\n    /**\n     * Remove the cache\n     *\n     * @return bool Success status\n     */\n    public function unlink() {\n        return $this->cache->set($this->name, null);\n    }\n\n}\n", "num_lines": 173}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n\n/**\n * Content-type sniffing\n *\n * Based on the rules in http://tools.ietf.org/html/draft-abarth-mime-sniff-06\n *\n * This is used since we can't always trust Content-Type headers, and is based\n * upon the HTML5 parsing rules.\n *\n *\n * This class can be overloaded with {@see SimplePie::set_content_type_sniffer_class()}\n *\n * @package SimplePie\n * @subpackage HTTP\n */\nclass SimplePie_Content_Type_Sniffer\n{\n\t/**\n\t * File object\n\t *\n\t * @var SimplePie_File\n\t */\n\tvar $file;\n\n\t/**\n\t * Create an instance of the class with the input file\n\t *\n\t * @param SimplePie_Content_Type_Sniffer $file Input file\n\t */\n\tpublic function __construct($file)\n\t{\n\t\t$this->file = $file;\n\t}\n\n\t/**\n\t * Get the Content-Type of the specified file\n\t *\n\t * @return string Actual Content-Type\n\t */\n\tpublic function get_type()\n\t{\n\t\tif (isset($this->file->headers['content-type']))\n\t\t{\n\t\t\tif (!isset($this->file->headers['content-encoding'])\n\t\t\t\t&& ($this->file->headers['content-type'] === 'text/plain'\n\t\t\t\t\t|| $this->file->headers['content-type'] === 'text/plain; charset=ISO-8859-1'\n\t\t\t\t\t|| $this->file->headers['content-type'] === 'text/plain; charset=iso-8859-1'\n\t\t\t\t\t|| $this->file->headers['content-type'] === 'text/plain; charset=UTF-8'))\n\t\t\t{\n\t\t\t\treturn $this->text_or_binary();\n\t\t\t}\n\n\t\t\tif (($pos = strpos($this->file->headers['content-type'], ';')) !== false)\n\t\t\t{\n\t\t\t\t$official = substr($this->file->headers['content-type'], 0, $pos);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$official = $this->file->headers['content-type'];\n\t\t\t}\n\t\t\t$official = trim(strtolower($official));\n\n\t\t\tif ($official === 'unknown/unknown'\n\t\t\t\t|| $official === 'application/unknown')\n\t\t\t{\n\t\t\t\treturn $this->unknown();\n\t\t\t}\n\t\t\telseif (substr($official, -4) === '+xml'\n\t\t\t\t|| $official === 'text/xml'\n\t\t\t\t|| $official === 'application/xml')\n\t\t\t{\n\t\t\t\treturn $official;\n\t\t\t}\n\t\t\telseif (substr($official, 0, 6) === 'image/')\n\t\t\t{\n\t\t\t\tif ($return = $this->image())\n\t\t\t\t{\n\t\t\t\t\treturn $return;\n\t\t\t\t}\n\n\t\t\t\treturn $official;\n\t\t\t}\n\t\t\telseif ($official === 'text/html')\n\t\t\t{\n\t\t\t\treturn $this->feed_or_html();\n\t\t\t}\n\n\t\t\treturn $official;\n\t\t}\n\n\t\treturn $this->unknown();\n\t}\n\n\t/**\n\t * Sniff text or binary\n\t *\n\t * @return string Actual Content-Type\n\t */\n\tpublic function text_or_binary()\n\t{\n\t\tif (substr($this->file->body, 0, 2) === \"\\xFE\\xFF\"\n\t\t\t|| substr($this->file->body, 0, 2) === \"\\xFF\\xFE\"\n\t\t\t|| substr($this->file->body, 0, 4) === \"\\x00\\x00\\xFE\\xFF\"\n\t\t\t|| substr($this->file->body, 0, 3) === \"\\xEF\\xBB\\xBF\")\n\t\t{\n\t\t\treturn 'text/plain';\n\t\t}\n\t\telseif (preg_match('/[\\x00-\\x08\\x0E-\\x1A\\x1C-\\x1F]/', $this->file->body))\n\t\t{\n\t\t\treturn 'application/octect-stream';\n\t\t}\n\n\t\treturn 'text/plain';\n\t}\n\n\t/**\n\t * Sniff unknown\n\t *\n\t * @return string Actual Content-Type\n\t */\n\tpublic function unknown()\n\t{\n\t\t$ws = strspn($this->file->body, \"\\x09\\x0A\\x0B\\x0C\\x0D\\x20\");\n\t\tif (strtolower(substr($this->file->body, $ws, 14)) === '<!doctype html'\n\t\t\t|| strtolower(substr($this->file->body, $ws, 5)) === '<html'\n\t\t\t|| strtolower(substr($this->file->body, $ws, 7)) === '<script')\n\t\t{\n\t\t\treturn 'text/html';\n\t\t}\n\t\telseif (substr($this->file->body, 0, 5) === '%PDF-')\n\t\t{\n\t\t\treturn 'application/pdf';\n\t\t}\n\t\telseif (substr($this->file->body, 0, 11) === '%!PS-Adobe-')\n\t\t{\n\t\t\treturn 'application/postscript';\n\t\t}\n\t\telseif (substr($this->file->body, 0, 6) === 'GIF87a'\n\t\t\t|| substr($this->file->body, 0, 6) === 'GIF89a')\n\t\t{\n\t\t\treturn 'image/gif';\n\t\t}\n\t\telseif (substr($this->file->body, 0, 8) === \"\\x89\\x50\\x4E\\x47\\x0D\\x0A\\x1A\\x0A\")\n\t\t{\n\t\t\treturn 'image/png';\n\t\t}\n\t\telseif (substr($this->file->body, 0, 3) === \"\\xFF\\xD8\\xFF\")\n\t\t{\n\t\t\treturn 'image/jpeg';\n\t\t}\n\t\telseif (substr($this->file->body, 0, 2) === \"\\x42\\x4D\")\n\t\t{\n\t\t\treturn 'image/bmp';\n\t\t}\n\t\telseif (substr($this->file->body, 0, 4) === \"\\x00\\x00\\x01\\x00\")\n\t\t{\n\t\t\treturn 'image/vnd.microsoft.icon';\n\t\t}\n\n\t\treturn $this->text_or_binary();\n\t}\n\n\t/**\n\t * Sniff images\n\t *\n\t * @return string Actual Content-Type\n\t */\n\tpublic function image()\n\t{\n\t\tif (substr($this->file->body, 0, 6) === 'GIF87a'\n\t\t\t|| substr($this->file->body, 0, 6) === 'GIF89a')\n\t\t{\n\t\t\treturn 'image/gif';\n\t\t}\n\t\telseif (substr($this->file->body, 0, 8) === \"\\x89\\x50\\x4E\\x47\\x0D\\x0A\\x1A\\x0A\")\n\t\t{\n\t\t\treturn 'image/png';\n\t\t}\n\t\telseif (substr($this->file->body, 0, 3) === \"\\xFF\\xD8\\xFF\")\n\t\t{\n\t\t\treturn 'image/jpeg';\n\t\t}\n\t\telseif (substr($this->file->body, 0, 2) === \"\\x42\\x4D\")\n\t\t{\n\t\t\treturn 'image/bmp';\n\t\t}\n\t\telseif (substr($this->file->body, 0, 4) === \"\\x00\\x00\\x01\\x00\")\n\t\t{\n\t\t\treturn 'image/vnd.microsoft.icon';\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Sniff HTML\n\t *\n\t * @return string Actual Content-Type\n\t */\n\tpublic function feed_or_html()\n\t{\n\t\t$len = strlen($this->file->body);\n\t\t$pos = strspn($this->file->body, \"\\x09\\x0A\\x0D\\x20\\xEF\\xBB\\xBF\");\n\n\t\twhile ($pos < $len)\n\t\t{\n\t\t\tswitch ($this->file->body[$pos])\n\t\t\t{\n\t\t\t\tcase \"\\x09\":\n\t\t\t\tcase \"\\x0A\":\n\t\t\t\tcase \"\\x0D\":\n\t\t\t\tcase \"\\x20\":\n\t\t\t\t\t$pos += strspn($this->file->body, \"\\x09\\x0A\\x0D\\x20\", $pos);\n\t\t\t\t\tcontinue 2;\n\n\t\t\t\tcase '<':\n\t\t\t\t\t$pos++;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn 'text/html';\n\t\t\t}\n\n\t\t\tif (substr($this->file->body, $pos, 3) === '!--')\n\t\t\t{\n\t\t\t\t$pos += 3;\n\t\t\t\tif ($pos < $len && ($pos = strpos($this->file->body, '-->', $pos)) !== false)\n\t\t\t\t{\n\t\t\t\t\t$pos += 3;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn 'text/html';\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif (substr($this->file->body, $pos, 1) === '!')\n\t\t\t{\n\t\t\t\tif ($pos < $len && ($pos = strpos($this->file->body, '>', $pos)) !== false)\n\t\t\t\t{\n\t\t\t\t\t$pos++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn 'text/html';\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif (substr($this->file->body, $pos, 1) === '?')\n\t\t\t{\n\t\t\t\tif ($pos < $len && ($pos = strpos($this->file->body, '?>', $pos)) !== false)\n\t\t\t\t{\n\t\t\t\t\t$pos += 2;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn 'text/html';\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif (substr($this->file->body, $pos, 3) === 'rss'\n\t\t\t\t|| substr($this->file->body, $pos, 7) === 'rdf:RDF')\n\t\t\t{\n\t\t\t\treturn 'application/rss+xml';\n\t\t\t}\n\t\t\telseif (substr($this->file->body, $pos, 4) === 'feed')\n\t\t\t{\n\t\t\t\treturn 'application/atom+xml';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 'text/html';\n\t\t\t}\n\t\t}\n\n\t\treturn 'text/html';\n\t}\n}\n", "num_lines": 319}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n\n/**\n * Decode HTML Entities\n *\n * This implements HTML5 as of revision 967 (2007-06-28)\n *\n * @deprecated Use DOMDocument instead!\n * @package SimplePie\n */\nclass SimplePie_Decode_HTML_Entities\n{\n\t/**\n\t * Data to be parsed\n\t *\n\t * @access private\n\t * @var string\n\t */\n\tvar $data = '';\n\n\t/**\n\t * Currently consumed bytes\n\t *\n\t * @access private\n\t * @var string\n\t */\n\tvar $consumed = '';\n\n\t/**\n\t * Position of the current byte being parsed\n\t *\n\t * @access private\n\t * @var int\n\t */\n\tvar $position = 0;\n\n\t/**\n\t * Create an instance of the class with the input data\n\t *\n\t * @access public\n\t * @param string $data Input data\n\t */\n\tpublic function __construct($data)\n\t{\n\t\t$this->data = $data;\n\t}\n\n\t/**\n\t * Parse the input data\n\t *\n\t * @access public\n\t * @return string Output data\n\t */\n\tpublic function parse()\n\t{\n\t\twhile (($this->position = strpos($this->data, '&', $this->position)) !== false)\n\t\t{\n\t\t\t$this->consume();\n\t\t\t$this->entity();\n\t\t\t$this->consumed = '';\n\t\t}\n\t\treturn $this->data;\n\t}\n\n\t/**\n\t * Consume the next byte\n\t *\n\t * @access private\n\t * @return mixed The next byte, or false, if there is no more data\n\t */\n\tpublic function consume()\n\t{\n\t\tif (isset($this->data[$this->position]))\n\t\t{\n\t\t\t$this->consumed .= $this->data[$this->position];\n\t\t\treturn $this->data[$this->position++];\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Consume a range of characters\n\t *\n\t * @access private\n\t * @param string $chars Characters to consume\n\t * @return mixed A series of characters that match the range, or false\n\t */\n\tpublic function consume_range($chars)\n\t{\n\t\tif ($len = strspn($this->data, $chars, $this->position))\n\t\t{\n\t\t\t$data = substr($this->data, $this->position, $len);\n\t\t\t$this->consumed .= $data;\n\t\t\t$this->position += $len;\n\t\t\treturn $data;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Unconsume one byte\n\t *\n\t * @access private\n\t */\n\tpublic function unconsume()\n\t{\n\t\t$this->consumed = substr($this->consumed, 0, -1);\n\t\t$this->position--;\n\t}\n\n\t/**\n\t * Decode an entity\n\t *\n\t * @access private\n\t */\n\tpublic function entity()\n\t{\n\t\tswitch ($this->consume())\n\t\t{\n\t\t\tcase \"\\x09\":\n\t\t\tcase \"\\x0A\":\n\t\t\tcase \"\\x0B\":\n\t\t\tcase \"\\x0C\":\n\t\t\tcase \"\\x20\":\n\t\t\tcase \"\\x3C\":\n\t\t\tcase \"\\x26\":\n\t\t\tcase false:\n\t\t\t\tbreak;\n\n\t\t\tcase \"\\x23\":\n\t\t\t\tswitch ($this->consume())\n\t\t\t\t{\n\t\t\t\t\tcase \"\\x78\":\n\t\t\t\t\tcase \"\\x58\":\n\t\t\t\t\t\t$range = '0123456789ABCDEFabcdef';\n\t\t\t\t\t\t$hex = true;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$range = '0123456789';\n\t\t\t\t\t\t$hex = false;\n\t\t\t\t\t\t$this->unconsume();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ($codepoint = $this->consume_range($range))\n\t\t\t\t{\n\t\t\t\t\tstatic $windows_1252_specials = array(0x0D => \"\\x0A\", 0x80 => \"\\xE2\\x82\\xAC\", 0x81 => \"\\xEF\\xBF\\xBD\", 0x82 => \"\\xE2\\x80\\x9A\", 0x83 => \"\\xC6\\x92\", 0x84 => \"\\xE2\\x80\\x9E\", 0x85 => \"\\xE2\\x80\\xA6\", 0x86 => \"\\xE2\\x80\\xA0\", 0x87 => \"\\xE2\\x80\\xA1\", 0x88 => \"\\xCB\\x86\", 0x89 => \"\\xE2\\x80\\xB0\", 0x8A => \"\\xC5\\xA0\", 0x8B => \"\\xE2\\x80\\xB9\", 0x8C => \"\\xC5\\x92\", 0x8D => \"\\xEF\\xBF\\xBD\", 0x8E => \"\\xC5\\xBD\", 0x8F => \"\\xEF\\xBF\\xBD\", 0x90 => \"\\xEF\\xBF\\xBD\", 0x91 => \"\\xE2\\x80\\x98\", 0x92 => \"\\xE2\\x80\\x99\", 0x93 => \"\\xE2\\x80\\x9C\", 0x94 => \"\\xE2\\x80\\x9D\", 0x95 => \"\\xE2\\x80\\xA2\", 0x96 => \"\\xE2\\x80\\x93\", 0x97 => \"\\xE2\\x80\\x94\", 0x98 => \"\\xCB\\x9C\", 0x99 => \"\\xE2\\x84\\xA2\", 0x9A => \"\\xC5\\xA1\", 0x9B => \"\\xE2\\x80\\xBA\", 0x9C => \"\\xC5\\x93\", 0x9D => \"\\xEF\\xBF\\xBD\", 0x9E => \"\\xC5\\xBE\", 0x9F => \"\\xC5\\xB8\");\n\n\t\t\t\t\tif ($hex)\n\t\t\t\t\t{\n\t\t\t\t\t\t$codepoint = hexdec($codepoint);\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$codepoint = intval($codepoint);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($windows_1252_specials[$codepoint]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$replacement = $windows_1252_specials[$codepoint];\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$replacement = SimplePie_Misc::codepoint_to_utf8($codepoint);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!in_array($this->consume(), array(';', false), true))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->unconsume();\n\t\t\t\t\t}\n\n\t\t\t\t\t$consumed_length = strlen($this->consumed);\n\t\t\t\t\t$this->data = substr_replace($this->data, $replacement, $this->position - $consumed_length, $consumed_length);\n\t\t\t\t\t$this->position += strlen($replacement) - $consumed_length;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tstatic $entities = array(\n\t\t\t\t\t'Aacute' => \"\\xC3\\x81\",\n\t\t\t\t\t'aacute' => \"\\xC3\\xA1\",\n\t\t\t\t\t'Aacute;' => \"\\xC3\\x81\",\n\t\t\t\t\t'aacute;' => \"\\xC3\\xA1\",\n\t\t\t\t\t'Acirc' => \"\\xC3\\x82\",\n\t\t\t\t\t'acirc' => \"\\xC3\\xA2\",\n\t\t\t\t\t'Acirc;' => \"\\xC3\\x82\",\n\t\t\t\t\t'acirc;' => \"\\xC3\\xA2\",\n\t\t\t\t\t'acute' => \"\\xC2\\xB4\",\n\t\t\t\t\t'acute;' => \"\\xC2\\xB4\",\n\t\t\t\t\t'AElig' => \"\\xC3\\x86\",\n\t\t\t\t\t'aelig' => \"\\xC3\\xA6\",\n\t\t\t\t\t'AElig;' => \"\\xC3\\x86\",\n\t\t\t\t\t'aelig;' => \"\\xC3\\xA6\",\n\t\t\t\t\t'Agrave' => \"\\xC3\\x80\",\n\t\t\t\t\t'agrave' => \"\\xC3\\xA0\",\n\t\t\t\t\t'Agrave;' => \"\\xC3\\x80\",\n\t\t\t\t\t'agrave;' => \"\\xC3\\xA0\",\n\t\t\t\t\t'alefsym;' => \"\\xE2\\x84\\xB5\",\n\t\t\t\t\t'Alpha;' => \"\\xCE\\x91\",\n\t\t\t\t\t'alpha;' => \"\\xCE\\xB1\",\n\t\t\t\t\t'AMP' => \"\\x26\",\n\t\t\t\t\t'amp' => \"\\x26\",\n\t\t\t\t\t'AMP;' => \"\\x26\",\n\t\t\t\t\t'amp;' => \"\\x26\",\n\t\t\t\t\t'and;' => \"\\xE2\\x88\\xA7\",\n\t\t\t\t\t'ang;' => \"\\xE2\\x88\\xA0\",\n\t\t\t\t\t'apos;' => \"\\x27\",\n\t\t\t\t\t'Aring' => \"\\xC3\\x85\",\n\t\t\t\t\t'aring' => \"\\xC3\\xA5\",\n\t\t\t\t\t'Aring;' => \"\\xC3\\x85\",\n\t\t\t\t\t'aring;' => \"\\xC3\\xA5\",\n\t\t\t\t\t'asymp;' => \"\\xE2\\x89\\x88\",\n\t\t\t\t\t'Atilde' => \"\\xC3\\x83\",\n\t\t\t\t\t'atilde' => \"\\xC3\\xA3\",\n\t\t\t\t\t'Atilde;' => \"\\xC3\\x83\",\n\t\t\t\t\t'atilde;' => \"\\xC3\\xA3\",\n\t\t\t\t\t'Auml' => \"\\xC3\\x84\",\n\t\t\t\t\t'auml' => \"\\xC3\\xA4\",\n\t\t\t\t\t'Auml;' => \"\\xC3\\x84\",\n\t\t\t\t\t'auml;' => \"\\xC3\\xA4\",\n\t\t\t\t\t'bdquo;' => \"\\xE2\\x80\\x9E\",\n\t\t\t\t\t'Beta;' => \"\\xCE\\x92\",\n\t\t\t\t\t'beta;' => \"\\xCE\\xB2\",\n\t\t\t\t\t'brvbar' => \"\\xC2\\xA6\",\n\t\t\t\t\t'brvbar;' => \"\\xC2\\xA6\",\n\t\t\t\t\t'bull;' => \"\\xE2\\x80\\xA2\",\n\t\t\t\t\t'cap;' => \"\\xE2\\x88\\xA9\",\n\t\t\t\t\t'Ccedil' => \"\\xC3\\x87\",\n\t\t\t\t\t'ccedil' => \"\\xC3\\xA7\",\n\t\t\t\t\t'Ccedil;' => \"\\xC3\\x87\",\n\t\t\t\t\t'ccedil;' => \"\\xC3\\xA7\",\n\t\t\t\t\t'cedil' => \"\\xC2\\xB8\",\n\t\t\t\t\t'cedil;' => \"\\xC2\\xB8\",\n\t\t\t\t\t'cent' => \"\\xC2\\xA2\",\n\t\t\t\t\t'cent;' => \"\\xC2\\xA2\",\n\t\t\t\t\t'Chi;' => \"\\xCE\\xA7\",\n\t\t\t\t\t'chi;' => \"\\xCF\\x87\",\n\t\t\t\t\t'circ;' => \"\\xCB\\x86\",\n\t\t\t\t\t'clubs;' => \"\\xE2\\x99\\xA3\",\n\t\t\t\t\t'cong;' => \"\\xE2\\x89\\x85\",\n\t\t\t\t\t'COPY' => \"\\xC2\\xA9\",\n\t\t\t\t\t'copy' => \"\\xC2\\xA9\",\n\t\t\t\t\t'COPY;' => \"\\xC2\\xA9\",\n\t\t\t\t\t'copy;' => \"\\xC2\\xA9\",\n\t\t\t\t\t'crarr;' => \"\\xE2\\x86\\xB5\",\n\t\t\t\t\t'cup;' => \"\\xE2\\x88\\xAA\",\n\t\t\t\t\t'curren' => \"\\xC2\\xA4\",\n\t\t\t\t\t'curren;' => \"\\xC2\\xA4\",\n\t\t\t\t\t'Dagger;' => \"\\xE2\\x80\\xA1\",\n\t\t\t\t\t'dagger;' => \"\\xE2\\x80\\xA0\",\n\t\t\t\t\t'dArr;' => \"\\xE2\\x87\\x93\",\n\t\t\t\t\t'darr;' => \"\\xE2\\x86\\x93\",\n\t\t\t\t\t'deg' => \"\\xC2\\xB0\",\n\t\t\t\t\t'deg;' => \"\\xC2\\xB0\",\n\t\t\t\t\t'Delta;' => \"\\xCE\\x94\",\n\t\t\t\t\t'delta;' => \"\\xCE\\xB4\",\n\t\t\t\t\t'diams;' => \"\\xE2\\x99\\xA6\",\n\t\t\t\t\t'divide' => \"\\xC3\\xB7\",\n\t\t\t\t\t'divide;' => \"\\xC3\\xB7\",\n\t\t\t\t\t'Eacute' => \"\\xC3\\x89\",\n\t\t\t\t\t'eacute' => \"\\xC3\\xA9\",\n\t\t\t\t\t'Eacute;' => \"\\xC3\\x89\",\n\t\t\t\t\t'eacute;' => \"\\xC3\\xA9\",\n\t\t\t\t\t'Ecirc' => \"\\xC3\\x8A\",\n\t\t\t\t\t'ecirc' => \"\\xC3\\xAA\",\n\t\t\t\t\t'Ecirc;' => \"\\xC3\\x8A\",\n\t\t\t\t\t'ecirc;' => \"\\xC3\\xAA\",\n\t\t\t\t\t'Egrave' => \"\\xC3\\x88\",\n\t\t\t\t\t'egrave' => \"\\xC3\\xA8\",\n\t\t\t\t\t'Egrave;' => \"\\xC3\\x88\",\n\t\t\t\t\t'egrave;' => \"\\xC3\\xA8\",\n\t\t\t\t\t'empty;' => \"\\xE2\\x88\\x85\",\n\t\t\t\t\t'emsp;' => \"\\xE2\\x80\\x83\",\n\t\t\t\t\t'ensp;' => \"\\xE2\\x80\\x82\",\n\t\t\t\t\t'Epsilon;' => \"\\xCE\\x95\",\n\t\t\t\t\t'epsilon;' => \"\\xCE\\xB5\",\n\t\t\t\t\t'equiv;' => \"\\xE2\\x89\\xA1\",\n\t\t\t\t\t'Eta;' => \"\\xCE\\x97\",\n\t\t\t\t\t'eta;' => \"\\xCE\\xB7\",\n\t\t\t\t\t'ETH' => \"\\xC3\\x90\",\n\t\t\t\t\t'eth' => \"\\xC3\\xB0\",\n\t\t\t\t\t'ETH;' => \"\\xC3\\x90\",\n\t\t\t\t\t'eth;' => \"\\xC3\\xB0\",\n\t\t\t\t\t'Euml' => \"\\xC3\\x8B\",\n\t\t\t\t\t'euml' => \"\\xC3\\xAB\",\n\t\t\t\t\t'Euml;' => \"\\xC3\\x8B\",\n\t\t\t\t\t'euml;' => \"\\xC3\\xAB\",\n\t\t\t\t\t'euro;' => \"\\xE2\\x82\\xAC\",\n\t\t\t\t\t'exist;' => \"\\xE2\\x88\\x83\",\n\t\t\t\t\t'fnof;' => \"\\xC6\\x92\",\n\t\t\t\t\t'forall;' => \"\\xE2\\x88\\x80\",\n\t\t\t\t\t'frac12' => \"\\xC2\\xBD\",\n\t\t\t\t\t'frac12;' => \"\\xC2\\xBD\",\n\t\t\t\t\t'frac14' => \"\\xC2\\xBC\",\n\t\t\t\t\t'frac14;' => \"\\xC2\\xBC\",\n\t\t\t\t\t'frac34' => \"\\xC2\\xBE\",\n\t\t\t\t\t'frac34;' => \"\\xC2\\xBE\",\n\t\t\t\t\t'frasl;' => \"\\xE2\\x81\\x84\",\n\t\t\t\t\t'Gamma;' => \"\\xCE\\x93\",\n\t\t\t\t\t'gamma;' => \"\\xCE\\xB3\",\n\t\t\t\t\t'ge;' => \"\\xE2\\x89\\xA5\",\n\t\t\t\t\t'GT' => \"\\x3E\",\n\t\t\t\t\t'gt' => \"\\x3E\",\n\t\t\t\t\t'GT;' => \"\\x3E\",\n\t\t\t\t\t'gt;' => \"\\x3E\",\n\t\t\t\t\t'hArr;' => \"\\xE2\\x87\\x94\",\n\t\t\t\t\t'harr;' => \"\\xE2\\x86\\x94\",\n\t\t\t\t\t'hearts;' => \"\\xE2\\x99\\xA5\",\n\t\t\t\t\t'hellip;' => \"\\xE2\\x80\\xA6\",\n\t\t\t\t\t'Iacute' => \"\\xC3\\x8D\",\n\t\t\t\t\t'iacute' => \"\\xC3\\xAD\",\n\t\t\t\t\t'Iacute;' => \"\\xC3\\x8D\",\n\t\t\t\t\t'iacute;' => \"\\xC3\\xAD\",\n\t\t\t\t\t'Icirc' => \"\\xC3\\x8E\",\n\t\t\t\t\t'icirc' => \"\\xC3\\xAE\",\n\t\t\t\t\t'Icirc;' => \"\\xC3\\x8E\",\n\t\t\t\t\t'icirc;' => \"\\xC3\\xAE\",\n\t\t\t\t\t'iexcl' => \"\\xC2\\xA1\",\n\t\t\t\t\t'iexcl;' => \"\\xC2\\xA1\",\n\t\t\t\t\t'Igrave' => \"\\xC3\\x8C\",\n\t\t\t\t\t'igrave' => \"\\xC3\\xAC\",\n\t\t\t\t\t'Igrave;' => \"\\xC3\\x8C\",\n\t\t\t\t\t'igrave;' => \"\\xC3\\xAC\",\n\t\t\t\t\t'image;' => \"\\xE2\\x84\\x91\",\n\t\t\t\t\t'infin;' => \"\\xE2\\x88\\x9E\",\n\t\t\t\t\t'int;' => \"\\xE2\\x88\\xAB\",\n\t\t\t\t\t'Iota;' => \"\\xCE\\x99\",\n\t\t\t\t\t'iota;' => \"\\xCE\\xB9\",\n\t\t\t\t\t'iquest' => \"\\xC2\\xBF\",\n\t\t\t\t\t'iquest;' => \"\\xC2\\xBF\",\n\t\t\t\t\t'isin;' => \"\\xE2\\x88\\x88\",\n\t\t\t\t\t'Iuml' => \"\\xC3\\x8F\",\n\t\t\t\t\t'iuml' => \"\\xC3\\xAF\",\n\t\t\t\t\t'Iuml;' => \"\\xC3\\x8F\",\n\t\t\t\t\t'iuml;' => \"\\xC3\\xAF\",\n\t\t\t\t\t'Kappa;' => \"\\xCE\\x9A\",\n\t\t\t\t\t'kappa;' => \"\\xCE\\xBA\",\n\t\t\t\t\t'Lambda;' => \"\\xCE\\x9B\",\n\t\t\t\t\t'lambda;' => \"\\xCE\\xBB\",\n\t\t\t\t\t'lang;' => \"\\xE3\\x80\\x88\",\n\t\t\t\t\t'laquo' => \"\\xC2\\xAB\",\n\t\t\t\t\t'laquo;' => \"\\xC2\\xAB\",\n\t\t\t\t\t'lArr;' => \"\\xE2\\x87\\x90\",\n\t\t\t\t\t'larr;' => \"\\xE2\\x86\\x90\",\n\t\t\t\t\t'lceil;' => \"\\xE2\\x8C\\x88\",\n\t\t\t\t\t'ldquo;' => \"\\xE2\\x80\\x9C\",\n\t\t\t\t\t'le;' => \"\\xE2\\x89\\xA4\",\n\t\t\t\t\t'lfloor;' => \"\\xE2\\x8C\\x8A\",\n\t\t\t\t\t'lowast;' => \"\\xE2\\x88\\x97\",\n\t\t\t\t\t'loz;' => \"\\xE2\\x97\\x8A\",\n\t\t\t\t\t'lrm;' => \"\\xE2\\x80\\x8E\",\n\t\t\t\t\t'lsaquo;' => \"\\xE2\\x80\\xB9\",\n\t\t\t\t\t'lsquo;' => \"\\xE2\\x80\\x98\",\n\t\t\t\t\t'LT' => \"\\x3C\",\n\t\t\t\t\t'lt' => \"\\x3C\",\n\t\t\t\t\t'LT;' => \"\\x3C\",\n\t\t\t\t\t'lt;' => \"\\x3C\",\n\t\t\t\t\t'macr' => \"\\xC2\\xAF\",\n\t\t\t\t\t'macr;' => \"\\xC2\\xAF\",\n\t\t\t\t\t'mdash;' => \"\\xE2\\x80\\x94\",\n\t\t\t\t\t'micro' => \"\\xC2\\xB5\",\n\t\t\t\t\t'micro;' => \"\\xC2\\xB5\",\n\t\t\t\t\t'middot' => \"\\xC2\\xB7\",\n\t\t\t\t\t'middot;' => \"\\xC2\\xB7\",\n\t\t\t\t\t'minus;' => \"\\xE2\\x88\\x92\",\n\t\t\t\t\t'Mu;' => \"\\xCE\\x9C\",\n\t\t\t\t\t'mu;' => \"\\xCE\\xBC\",\n\t\t\t\t\t'nabla;' => \"\\xE2\\x88\\x87\",\n\t\t\t\t\t'nbsp' => \"\\xC2\\xA0\",\n\t\t\t\t\t'nbsp;' => \"\\xC2\\xA0\",\n\t\t\t\t\t'ndash;' => \"\\xE2\\x80\\x93\",\n\t\t\t\t\t'ne;' => \"\\xE2\\x89\\xA0\",\n\t\t\t\t\t'ni;' => \"\\xE2\\x88\\x8B\",\n\t\t\t\t\t'not' => \"\\xC2\\xAC\",\n\t\t\t\t\t'not;' => \"\\xC2\\xAC\",\n\t\t\t\t\t'notin;' => \"\\xE2\\x88\\x89\",\n\t\t\t\t\t'nsub;' => \"\\xE2\\x8A\\x84\",\n\t\t\t\t\t'Ntilde' => \"\\xC3\\x91\",\n\t\t\t\t\t'ntilde' => \"\\xC3\\xB1\",\n\t\t\t\t\t'Ntilde;' => \"\\xC3\\x91\",\n\t\t\t\t\t'ntilde;' => \"\\xC3\\xB1\",\n\t\t\t\t\t'Nu;' => \"\\xCE\\x9D\",\n\t\t\t\t\t'nu;' => \"\\xCE\\xBD\",\n\t\t\t\t\t'Oacute' => \"\\xC3\\x93\",\n\t\t\t\t\t'oacute' => \"\\xC3\\xB3\",\n\t\t\t\t\t'Oacute;' => \"\\xC3\\x93\",\n\t\t\t\t\t'oacute;' => \"\\xC3\\xB3\",\n\t\t\t\t\t'Ocirc' => \"\\xC3\\x94\",\n\t\t\t\t\t'ocirc' => \"\\xC3\\xB4\",\n\t\t\t\t\t'Ocirc;' => \"\\xC3\\x94\",\n\t\t\t\t\t'ocirc;' => \"\\xC3\\xB4\",\n\t\t\t\t\t'OElig;' => \"\\xC5\\x92\",\n\t\t\t\t\t'oelig;' => \"\\xC5\\x93\",\n\t\t\t\t\t'Ograve' => \"\\xC3\\x92\",\n\t\t\t\t\t'ograve' => \"\\xC3\\xB2\",\n\t\t\t\t\t'Ograve;' => \"\\xC3\\x92\",\n\t\t\t\t\t'ograve;' => \"\\xC3\\xB2\",\n\t\t\t\t\t'oline;' => \"\\xE2\\x80\\xBE\",\n\t\t\t\t\t'Omega;' => \"\\xCE\\xA9\",\n\t\t\t\t\t'omega;' => \"\\xCF\\x89\",\n\t\t\t\t\t'Omicron;' => \"\\xCE\\x9F\",\n\t\t\t\t\t'omicron;' => \"\\xCE\\xBF\",\n\t\t\t\t\t'oplus;' => \"\\xE2\\x8A\\x95\",\n\t\t\t\t\t'or;' => \"\\xE2\\x88\\xA8\",\n\t\t\t\t\t'ordf' => \"\\xC2\\xAA\",\n\t\t\t\t\t'ordf;' => \"\\xC2\\xAA\",\n\t\t\t\t\t'ordm' => \"\\xC2\\xBA\",\n\t\t\t\t\t'ordm;' => \"\\xC2\\xBA\",\n\t\t\t\t\t'Oslash' => \"\\xC3\\x98\",\n\t\t\t\t\t'oslash' => \"\\xC3\\xB8\",\n\t\t\t\t\t'Oslash;' => \"\\xC3\\x98\",\n\t\t\t\t\t'oslash;' => \"\\xC3\\xB8\",\n\t\t\t\t\t'Otilde' => \"\\xC3\\x95\",\n\t\t\t\t\t'otilde' => \"\\xC3\\xB5\",\n\t\t\t\t\t'Otilde;' => \"\\xC3\\x95\",\n\t\t\t\t\t'otilde;' => \"\\xC3\\xB5\",\n\t\t\t\t\t'otimes;' => \"\\xE2\\x8A\\x97\",\n\t\t\t\t\t'Ouml' => \"\\xC3\\x96\",\n\t\t\t\t\t'ouml' => \"\\xC3\\xB6\",\n\t\t\t\t\t'Ouml;' => \"\\xC3\\x96\",\n\t\t\t\t\t'ouml;' => \"\\xC3\\xB6\",\n\t\t\t\t\t'para' => \"\\xC2\\xB6\",\n\t\t\t\t\t'para;' => \"\\xC2\\xB6\",\n\t\t\t\t\t'part;' => \"\\xE2\\x88\\x82\",\n\t\t\t\t\t'permil;' => \"\\xE2\\x80\\xB0\",\n\t\t\t\t\t'perp;' => \"\\xE2\\x8A\\xA5\",\n\t\t\t\t\t'Phi;' => \"\\xCE\\xA6\",\n\t\t\t\t\t'phi;' => \"\\xCF\\x86\",\n\t\t\t\t\t'Pi;' => \"\\xCE\\xA0\",\n\t\t\t\t\t'pi;' => \"\\xCF\\x80\",\n\t\t\t\t\t'piv;' => \"\\xCF\\x96\",\n\t\t\t\t\t'plusmn' => \"\\xC2\\xB1\",\n\t\t\t\t\t'plusmn;' => \"\\xC2\\xB1\",\n\t\t\t\t\t'pound' => \"\\xC2\\xA3\",\n\t\t\t\t\t'pound;' => \"\\xC2\\xA3\",\n\t\t\t\t\t'Prime;' => \"\\xE2\\x80\\xB3\",\n\t\t\t\t\t'prime;' => \"\\xE2\\x80\\xB2\",\n\t\t\t\t\t'prod;' => \"\\xE2\\x88\\x8F\",\n\t\t\t\t\t'prop;' => \"\\xE2\\x88\\x9D\",\n\t\t\t\t\t'Psi;' => \"\\xCE\\xA8\",\n\t\t\t\t\t'psi;' => \"\\xCF\\x88\",\n\t\t\t\t\t'QUOT' => \"\\x22\",\n\t\t\t\t\t'quot' => \"\\x22\",\n\t\t\t\t\t'QUOT;' => \"\\x22\",\n\t\t\t\t\t'quot;' => \"\\x22\",\n\t\t\t\t\t'radic;' => \"\\xE2\\x88\\x9A\",\n\t\t\t\t\t'rang;' => \"\\xE3\\x80\\x89\",\n\t\t\t\t\t'raquo' => \"\\xC2\\xBB\",\n\t\t\t\t\t'raquo;' => \"\\xC2\\xBB\",\n\t\t\t\t\t'rArr;' => \"\\xE2\\x87\\x92\",\n\t\t\t\t\t'rarr;' => \"\\xE2\\x86\\x92\",\n\t\t\t\t\t'rceil;' => \"\\xE2\\x8C\\x89\",\n\t\t\t\t\t'rdquo;' => \"\\xE2\\x80\\x9D\",\n\t\t\t\t\t'real;' => \"\\xE2\\x84\\x9C\",\n\t\t\t\t\t'REG' => \"\\xC2\\xAE\",\n\t\t\t\t\t'reg' => \"\\xC2\\xAE\",\n\t\t\t\t\t'REG;' => \"\\xC2\\xAE\",\n\t\t\t\t\t'reg;' => \"\\xC2\\xAE\",\n\t\t\t\t\t'rfloor;' => \"\\xE2\\x8C\\x8B\",\n\t\t\t\t\t'Rho;' => \"\\xCE\\xA1\",\n\t\t\t\t\t'rho;' => \"\\xCF\\x81\",\n\t\t\t\t\t'rlm;' => \"\\xE2\\x80\\x8F\",\n\t\t\t\t\t'rsaquo;' => \"\\xE2\\x80\\xBA\",\n\t\t\t\t\t'rsquo;' => \"\\xE2\\x80\\x99\",\n\t\t\t\t\t'sbquo;' => \"\\xE2\\x80\\x9A\",\n\t\t\t\t\t'Scaron;' => \"\\xC5\\xA0\",\n\t\t\t\t\t'scaron;' => \"\\xC5\\xA1\",\n\t\t\t\t\t'sdot;' => \"\\xE2\\x8B\\x85\",\n\t\t\t\t\t'sect' => \"\\xC2\\xA7\",\n\t\t\t\t\t'sect;' => \"\\xC2\\xA7\",\n\t\t\t\t\t'shy' => \"\\xC2\\xAD\",\n\t\t\t\t\t'shy;' => \"\\xC2\\xAD\",\n\t\t\t\t\t'Sigma;' => \"\\xCE\\xA3\",\n\t\t\t\t\t'sigma;' => \"\\xCF\\x83\",\n\t\t\t\t\t'sigmaf;' => \"\\xCF\\x82\",\n\t\t\t\t\t'sim;' => \"\\xE2\\x88\\xBC\",\n\t\t\t\t\t'spades;' => \"\\xE2\\x99\\xA0\",\n\t\t\t\t\t'sub;' => \"\\xE2\\x8A\\x82\",\n\t\t\t\t\t'sube;' => \"\\xE2\\x8A\\x86\",\n\t\t\t\t\t'sum;' => \"\\xE2\\x88\\x91\",\n\t\t\t\t\t'sup;' => \"\\xE2\\x8A\\x83\",\n\t\t\t\t\t'sup1' => \"\\xC2\\xB9\",\n\t\t\t\t\t'sup1;' => \"\\xC2\\xB9\",\n\t\t\t\t\t'sup2' => \"\\xC2\\xB2\",\n\t\t\t\t\t'sup2;' => \"\\xC2\\xB2\",\n\t\t\t\t\t'sup3' => \"\\xC2\\xB3\",\n\t\t\t\t\t'sup3;' => \"\\xC2\\xB3\",\n\t\t\t\t\t'supe;' => \"\\xE2\\x8A\\x87\",\n\t\t\t\t\t'szlig' => \"\\xC3\\x9F\",\n\t\t\t\t\t'szlig;' => \"\\xC3\\x9F\",\n\t\t\t\t\t'Tau;' => \"\\xCE\\xA4\",\n\t\t\t\t\t'tau;' => \"\\xCF\\x84\",\n\t\t\t\t\t'there4;' => \"\\xE2\\x88\\xB4\",\n\t\t\t\t\t'Theta;' => \"\\xCE\\x98\",\n\t\t\t\t\t'theta;' => \"\\xCE\\xB8\",\n\t\t\t\t\t'thetasym;' => \"\\xCF\\x91\",\n\t\t\t\t\t'thinsp;' => \"\\xE2\\x80\\x89\",\n\t\t\t\t\t'THORN' => \"\\xC3\\x9E\",\n\t\t\t\t\t'thorn' => \"\\xC3\\xBE\",\n\t\t\t\t\t'THORN;' => \"\\xC3\\x9E\",\n\t\t\t\t\t'thorn;' => \"\\xC3\\xBE\",\n\t\t\t\t\t'tilde;' => \"\\xCB\\x9C\",\n\t\t\t\t\t'times' => \"\\xC3\\x97\",\n\t\t\t\t\t'times;' => \"\\xC3\\x97\",\n\t\t\t\t\t'TRADE;' => \"\\xE2\\x84\\xA2\",\n\t\t\t\t\t'trade;' => \"\\xE2\\x84\\xA2\",\n\t\t\t\t\t'Uacute' => \"\\xC3\\x9A\",\n\t\t\t\t\t'uacute' => \"\\xC3\\xBA\",\n\t\t\t\t\t'Uacute;' => \"\\xC3\\x9A\",\n\t\t\t\t\t'uacute;' => \"\\xC3\\xBA\",\n\t\t\t\t\t'uArr;' => \"\\xE2\\x87\\x91\",\n\t\t\t\t\t'uarr;' => \"\\xE2\\x86\\x91\",\n\t\t\t\t\t'Ucirc' => \"\\xC3\\x9B\",\n\t\t\t\t\t'ucirc' => \"\\xC3\\xBB\",\n\t\t\t\t\t'Ucirc;' => \"\\xC3\\x9B\",\n\t\t\t\t\t'ucirc;' => \"\\xC3\\xBB\",\n\t\t\t\t\t'Ugrave' => \"\\xC3\\x99\",\n\t\t\t\t\t'ugrave' => \"\\xC3\\xB9\",\n\t\t\t\t\t'Ugrave;' => \"\\xC3\\x99\",\n\t\t\t\t\t'ugrave;' => \"\\xC3\\xB9\",\n\t\t\t\t\t'uml' => \"\\xC2\\xA8\",\n\t\t\t\t\t'uml;' => \"\\xC2\\xA8\",\n\t\t\t\t\t'upsih;' => \"\\xCF\\x92\",\n\t\t\t\t\t'Upsilon;' => \"\\xCE\\xA5\",\n\t\t\t\t\t'upsilon;' => \"\\xCF\\x85\",\n\t\t\t\t\t'Uuml' => \"\\xC3\\x9C\",\n\t\t\t\t\t'uuml' => \"\\xC3\\xBC\",\n\t\t\t\t\t'Uuml;' => \"\\xC3\\x9C\",\n\t\t\t\t\t'uuml;' => \"\\xC3\\xBC\",\n\t\t\t\t\t'weierp;' => \"\\xE2\\x84\\x98\",\n\t\t\t\t\t'Xi;' => \"\\xCE\\x9E\",\n\t\t\t\t\t'xi;' => \"\\xCE\\xBE\",\n\t\t\t\t\t'Yacute' => \"\\xC3\\x9D\",\n\t\t\t\t\t'yacute' => \"\\xC3\\xBD\",\n\t\t\t\t\t'Yacute;' => \"\\xC3\\x9D\",\n\t\t\t\t\t'yacute;' => \"\\xC3\\xBD\",\n\t\t\t\t\t'yen' => \"\\xC2\\xA5\",\n\t\t\t\t\t'yen;' => \"\\xC2\\xA5\",\n\t\t\t\t\t'yuml' => \"\\xC3\\xBF\",\n\t\t\t\t\t'Yuml;' => \"\\xC5\\xB8\",\n\t\t\t\t\t'yuml;' => \"\\xC3\\xBF\",\n\t\t\t\t\t'Zeta;' => \"\\xCE\\x96\",\n\t\t\t\t\t'zeta;' => \"\\xCE\\xB6\",\n\t\t\t\t\t'zwj;' => \"\\xE2\\x80\\x8D\",\n\t\t\t\t\t'zwnj;' => \"\\xE2\\x80\\x8C\"\n\t\t\t\t);\n\n\t\t\t\tfor ($i = 0, $match = null; $i < 9 && $this->consume() !== false; $i++)\n\t\t\t\t{\n\t\t\t\t\t$consumed = substr($this->consumed, 1);\n\t\t\t\t\tif (isset($entities[$consumed]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$match = $consumed;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($match !== null)\n\t\t\t\t{\n \t\t\t\t\t$this->data = substr_replace($this->data, $entities[$match], $this->position - strlen($consumed) - 1, strlen($match) + 1);\n\t\t\t\t\t$this->position += strlen($entities[$match]) - strlen($consumed) - 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n", "num_lines": 611}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n\n/**\n * HTTP Response Parser\n *\n * @package SimplePie\n * @subpackage HTTP\n */\nclass SimplePie_HTTP_Parser\n{\n\t/**\n\t * HTTP Version\n\t *\n\t * @var float\n\t */\n\tpublic $http_version = 0.0;\n\n\t/**\n\t * Status code\n\t *\n\t * @var int\n\t */\n\tpublic $status_code = 0;\n\n\t/**\n\t * Reason phrase\n\t *\n\t * @var string\n\t */\n\tpublic $reason = '';\n\n\t/**\n\t * Key/value pairs of the headers\n\t *\n\t * @var array\n\t */\n\tpublic $headers = array();\n\n\t/**\n\t * Body of the response\n\t *\n\t * @var string\n\t */\n\tpublic $body = '';\n\n\t/**\n\t * Current state of the state machine\n\t *\n\t * @var string\n\t */\n\tprotected $state = 'http_version';\n\n\t/**\n\t * Input data\n\t *\n\t * @var string\n\t */\n\tprotected $data = '';\n\n\t/**\n\t * Input data length (to avoid calling strlen() everytime this is needed)\n\t *\n\t * @var int\n\t */\n\tprotected $data_length = 0;\n\n\t/**\n\t * Current position of the pointer\n\t *\n\t * @var int\n\t */\n\tprotected $position = 0;\n\n\t/**\n\t * Name of the hedaer currently being parsed\n\t *\n\t * @var string\n\t */\n\tprotected $name = '';\n\n\t/**\n\t * Value of the hedaer currently being parsed\n\t *\n\t * @var string\n\t */\n\tprotected $value = '';\n\n\t/**\n\t * Create an instance of the class with the input data\n\t *\n\t * @param string $data Input data\n\t */\n\tpublic function __construct($data)\n\t{\n\t\t$this->data = $data;\n\t\t$this->data_length = strlen($this->data);\n\t}\n\n\t/**\n\t * Parse the input data\n\t *\n\t * @return bool true on success, false on failure\n\t */\n\tpublic function parse()\n\t{\n\t\twhile ($this->state && $this->state !== 'emit' && $this->has_data())\n\t\t{\n\t\t\t$state = $this->state;\n\t\t\t$this->$state();\n\t\t}\n\t\t$this->data = '';\n\t\tif ($this->state === 'emit' || $this->state === 'body')\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->http_version = '';\n\t\t$this->status_code = '';\n\t\t$this->reason = '';\n\t\t$this->headers = array();\n\t\t$this->body = '';\n\t\treturn false;\n\t}\n\n\t/**\n\t * Check whether there is data beyond the pointer\n\t *\n\t * @return bool true if there is further data, false if not\n\t */\n\tprotected function has_data()\n\t{\n\t\treturn (bool) ($this->position < $this->data_length);\n\t}\n\n\t/**\n\t * See if the next character is LWS\n\t *\n\t * @return bool true if the next character is LWS, false if not\n\t */\n\tprotected function is_linear_whitespace()\n\t{\n\t\treturn (bool) ($this->data[$this->position] === \"\\x09\"\n\t\t\t|| $this->data[$this->position] === \"\\x20\"\n\t\t\t|| ($this->data[$this->position] === \"\\x0A\"\n\t\t\t\t&& isset($this->data[$this->position + 1])\n\t\t\t\t&& ($this->data[$this->position + 1] === \"\\x09\" || $this->data[$this->position + 1] === \"\\x20\")));\n\t}\n\n\t/**\n\t * Parse the HTTP version\n\t */\n\tprotected function http_version()\n\t{\n\t\tif (strpos($this->data, \"\\x0A\") !== false && strtoupper(substr($this->data, 0, 5)) === 'HTTP/')\n\t\t{\n\t\t\t$len = strspn($this->data, '0123456789.', 5);\n\t\t\t$this->http_version = substr($this->data, 5, $len);\n\t\t\t$this->position += 5 + $len;\n\t\t\tif (substr_count($this->http_version, '.') <= 1)\n\t\t\t{\n\t\t\t\t$this->http_version = (float) $this->http_version;\n\t\t\t\t$this->position += strspn($this->data, \"\\x09\\x20\", $this->position);\n\t\t\t\t$this->state = 'status';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->state = false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state = false;\n\t\t}\n\t}\n\n\t/**\n\t * Parse the status code\n\t */\n\tprotected function status()\n\t{\n\t\tif ($len = strspn($this->data, '0123456789', $this->position))\n\t\t{\n\t\t\t$this->status_code = (int) substr($this->data, $this->position, $len);\n\t\t\t$this->position += $len;\n\t\t\t$this->state = 'reason';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state = false;\n\t\t}\n\t}\n\n\t/**\n\t * Parse the reason phrase\n\t */\n\tprotected function reason()\n\t{\n\t\t$len = strcspn($this->data, \"\\x0A\", $this->position);\n\t\t$this->reason = trim(substr($this->data, $this->position, $len), \"\\x09\\x0D\\x20\");\n\t\t$this->position += $len + 1;\n\t\t$this->state = 'new_line';\n\t}\n\n\t/**\n\t * Deal with a new line, shifting data around as needed\n\t */\n\tprotected function new_line()\n\t{\n\t\t$this->value = trim($this->value, \"\\x0D\\x20\");\n\t\tif ($this->name !== '' && $this->value !== '')\n\t\t{\n\t\t\t$this->name = strtolower($this->name);\n\t\t\t// We should only use the last Content-Type header. c.f. issue #1\n\t\t\tif (isset($this->headers[$this->name]) && $this->name !== 'content-type')\n\t\t\t{\n\t\t\t\t$this->headers[$this->name] .= ', ' . $this->value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->headers[$this->name] = $this->value;\n\t\t\t}\n\t\t}\n\t\t$this->name = '';\n\t\t$this->value = '';\n\t\tif (substr($this->data[$this->position], 0, 2) === \"\\x0D\\x0A\")\n\t\t{\n\t\t\t$this->position += 2;\n\t\t\t$this->state = 'body';\n\t\t}\n\t\telseif ($this->data[$this->position] === \"\\x0A\")\n\t\t{\n\t\t\t$this->position++;\n\t\t\t$this->state = 'body';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state = 'name';\n\t\t}\n\t}\n\n\t/**\n\t * Parse a header name\n\t */\n\tprotected function name()\n\t{\n\t\t$len = strcspn($this->data, \"\\x0A:\", $this->position);\n\t\tif (isset($this->data[$this->position + $len]))\n\t\t{\n\t\t\tif ($this->data[$this->position + $len] === \"\\x0A\")\n\t\t\t{\n\t\t\t\t$this->position += $len;\n\t\t\t\t$this->state = 'new_line';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->name = substr($this->data, $this->position, $len);\n\t\t\t\t$this->position += $len + 1;\n\t\t\t\t$this->state = 'value';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state = false;\n\t\t}\n\t}\n\n\t/**\n\t * Parse LWS, replacing consecutive LWS characters with a single space\n\t */\n\tprotected function linear_whitespace()\n\t{\n\t\tdo\n\t\t{\n\t\t\tif (substr($this->data, $this->position, 2) === \"\\x0D\\x0A\")\n\t\t\t{\n\t\t\t\t$this->position += 2;\n\t\t\t}\n\t\t\telseif ($this->data[$this->position] === \"\\x0A\")\n\t\t\t{\n\t\t\t\t$this->position++;\n\t\t\t}\n\t\t\t$this->position += strspn($this->data, \"\\x09\\x20\", $this->position);\n\t\t} while ($this->has_data() && $this->is_linear_whitespace());\n\t\t$this->value .= \"\\x20\";\n\t}\n\n\t/**\n\t * See what state to move to while within non-quoted header values\n\t */\n\tprotected function value()\n\t{\n\t\tif ($this->is_linear_whitespace())\n\t\t{\n\t\t\t$this->linear_whitespace();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tswitch ($this->data[$this->position])\n\t\t\t{\n\t\t\t\tcase '\"':\n\t\t\t\t\t// Workaround for ETags: we have to include the quotes as\n\t\t\t\t\t// part of the tag.\n\t\t\t\t\tif (strtolower($this->name) === 'etag')\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->value .= '\"';\n\t\t\t\t\t\t$this->position++;\n\t\t\t\t\t\t$this->state = 'value_char';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$this->position++;\n\t\t\t\t\t$this->state = 'quote';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"\\x0A\":\n\t\t\t\t\t$this->position++;\n\t\t\t\t\t$this->state = 'new_line';\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->state = 'value_char';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Parse a header value while outside quotes\n\t */\n\tprotected function value_char()\n\t{\n\t\t$len = strcspn($this->data, \"\\x09\\x20\\x0A\\\"\", $this->position);\n\t\t$this->value .= substr($this->data, $this->position, $len);\n\t\t$this->position += $len;\n\t\t$this->state = 'value';\n\t}\n\n\t/**\n\t * See what state to move to while within quoted header values\n\t */\n\tprotected function quote()\n\t{\n\t\tif ($this->is_linear_whitespace())\n\t\t{\n\t\t\t$this->linear_whitespace();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tswitch ($this->data[$this->position])\n\t\t\t{\n\t\t\t\tcase '\"':\n\t\t\t\t\t$this->position++;\n\t\t\t\t\t$this->state = 'value';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"\\x0A\":\n\t\t\t\t\t$this->position++;\n\t\t\t\t\t$this->state = 'new_line';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\t$this->position++;\n\t\t\t\t\t$this->state = 'quote_escaped';\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->state = 'quote_char';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Parse a header value while within quotes\n\t */\n\tprotected function quote_char()\n\t{\n\t\t$len = strcspn($this->data, \"\\x09\\x20\\x0A\\\"\\\\\", $this->position);\n\t\t$this->value .= substr($this->data, $this->position, $len);\n\t\t$this->position += $len;\n\t\t$this->state = 'value';\n\t}\n\n\t/**\n\t * Parse an escaped character within quotes\n\t */\n\tprotected function quote_escaped()\n\t{\n\t\t$this->value .= $this->data[$this->position];\n\t\t$this->position++;\n\t\t$this->state = 'quote';\n\t}\n\n\t/**\n\t * Parse the body\n\t */\n\tprotected function body()\n\t{\n\t\t$this->body = substr($this->data, $this->position);\n\t\tif (!empty($this->headers['transfer-encoding']))\n\t\t{\n\t\t\tunset($this->headers['transfer-encoding']);\n\t\t\t$this->state = 'chunked';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state = 'emit';\n\t\t}\n\t}\n\n\t/**\n\t * Parsed a \"Transfer-Encoding: chunked\" body\n\t */\n\tprotected function chunked()\n\t{\n\t\tif (!preg_match('/^([0-9a-f]+)[^\\r\\n]*\\r\\n/i', trim($this->body)))\n\t\t{\n\t\t\t$this->state = 'emit';\n\t\t\treturn;\n\t\t}\n\n\t\t$decoded = '';\n\t\t$encoded = $this->body;\n\n\t\twhile (true)\n\t\t{\n\t\t\t$is_chunked = (bool) preg_match( '/^([0-9a-f]+)[^\\r\\n]*\\r\\n/i', $encoded, $matches );\n\t\t\tif (!$is_chunked)\n\t\t\t{\n\t\t\t\t// Looks like it's not chunked after all\n\t\t\t\t$this->state = 'emit';\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$length = hexdec(trim($matches[1]));\n\t\t\tif ($length === 0)\n\t\t\t{\n\t\t\t\t// Ignore trailer headers\n\t\t\t\t$this->state = 'emit';\n\t\t\t\t$this->body = $decoded;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$chunk_length = strlen($matches[0]);\n\t\t\t$decoded .= $part = substr($encoded, $chunk_length, $length);\n\t\t\t$encoded = substr($encoded, $chunk_length + $length + 2);\n\n\t\t\tif (trim($encoded) === '0' || empty($encoded))\n\t\t\t{\n\t\t\t\t$this->state = 'emit';\n\t\t\t\t$this->body = $decoded;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Prepare headers (take care of proxies headers)\n\t *\n\t * @param string  $headers Raw headers\n\t * @param integer $count   Redirection count. Default to 1.\n\t *\n\t * @return string\n\t */\n\tstatic public function prepareHeaders($headers, $count = 1)\n\t{\n\t\t$data = explode(\"\\r\\n\\r\\n\", $headers, $count);\n\t\t$data = array_pop($data);\n\t\tif (false !== stripos($data, \"HTTP/1.0 200 Connection established\\r\\n\\r\\n\")) {\n\t\t\t$data = str_ireplace(\"HTTP/1.0 200 Connection established\\r\\n\\r\\n\", '', $data);\n\t\t}\n\t\tif (false !== stripos($data, \"HTTP/1.1 200 Connection established\\r\\n\\r\\n\")) {\n\t\t\t$data = str_ireplace(\"HTTP/1.1 200 Connection established\\r\\n\\r\\n\", '', $data);\n\t\t}\n\t\treturn $data;\n\t}\n}\n", "num_lines": 519}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n\n/**\n * Class to validate and to work with IPv6 addresses.\n *\n * @package SimplePie\n * @subpackage HTTP\n * @copyright 2003-2005 The PHP Group\n * @license http://www.opensource.org/licenses/bsd-license.php\n * @link http://pear.php.net/package/Net_IPv6\n * @author Alexander Merz <alexander.merz@web.de>\n * @author elfrink at introweb dot nl\n * @author Josh Peck <jmp at joshpeck dot org>\n * @author Sam Sneddon <geoffers@gmail.com>\n */\nclass SimplePie_Net_IPv6\n{\n\t/**\n\t * Uncompresses an IPv6 address\n\t *\n\t * RFC 4291 allows you to compress concecutive zero pieces in an address to\n\t * '::'. This method expects a valid IPv6 address and expands the '::' to\n\t * the required number of zero pieces.\n\t *\n\t * Example:  FF01::101   ->  FF01:0:0:0:0:0:0:101\n\t *           ::1         ->  0:0:0:0:0:0:0:1\n\t *\n\t * @author Alexander Merz <alexander.merz@web.de>\n\t * @author elfrink at introweb dot nl\n\t * @author Josh Peck <jmp at joshpeck dot org>\n\t * @copyright 2003-2005 The PHP Group\n\t * @license http://www.opensource.org/licenses/bsd-license.php\n\t * @param string $ip An IPv6 address\n\t * @return string The uncompressed IPv6 address\n\t */\n\tpublic static function uncompress($ip)\n\t{\n\t\t$c1 = -1;\n\t\t$c2 = -1;\n\t\tif (substr_count($ip, '::') === 1)\n\t\t{\n\t\t\tlist($ip1, $ip2) = explode('::', $ip);\n\t\t\tif ($ip1 === '')\n\t\t\t{\n\t\t\t\t$c1 = -1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$c1 = substr_count($ip1, ':');\n\t\t\t}\n\t\t\tif ($ip2 === '')\n\t\t\t{\n\t\t\t\t$c2 = -1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$c2 = substr_count($ip2, ':');\n\t\t\t}\n\t\t\tif (strpos($ip2, '.') !== false)\n\t\t\t{\n\t\t\t\t$c2++;\n\t\t\t}\n\t\t\t// ::\n\t\t\tif ($c1 === -1 && $c2 === -1)\n\t\t\t{\n\t\t\t\t$ip = '0:0:0:0:0:0:0:0';\n\t\t\t}\n\t\t\t// ::xxx\n\t\t\telse if ($c1 === -1)\n\t\t\t{\n\t\t\t\t$fill = str_repeat('0:', 7 - $c2);\n\t\t\t\t$ip = str_replace('::', $fill, $ip);\n\t\t\t}\n\t\t\t// xxx::\n\t\t\telse if ($c2 === -1)\n\t\t\t{\n\t\t\t\t$fill = str_repeat(':0', 7 - $c1);\n\t\t\t\t$ip = str_replace('::', $fill, $ip);\n\t\t\t}\n\t\t\t// xxx::xxx\n\t\t\telse\n\t\t\t{\n\t\t\t\t$fill = ':' . str_repeat('0:', 6 - $c2 - $c1);\n\t\t\t\t$ip = str_replace('::', $fill, $ip);\n\t\t\t}\n\t\t}\n\t\treturn $ip;\n\t}\n\n\t/**\n\t * Compresses an IPv6 address\n\t *\n\t * RFC 4291 allows you to compress concecutive zero pieces in an address to\n\t * '::'. This method expects a valid IPv6 address and compresses consecutive\n\t * zero pieces to '::'.\n\t *\n\t * Example:  FF01:0:0:0:0:0:0:101   ->  FF01::101\n\t *           0:0:0:0:0:0:0:1        ->  ::1\n\t *\n\t * @see uncompress()\n\t * @param string $ip An IPv6 address\n\t * @return string The compressed IPv6 address\n\t */\n\tpublic static function compress($ip)\n\t{\n\t\t// Prepare the IP to be compressed\n\t\t$ip = self::uncompress($ip);\n\t\t$ip_parts = self::split_v6_v4($ip);\n\n\t\t// Replace all leading zeros\n\t\t$ip_parts[0] = preg_replace('/(^|:)0+([0-9])/', '\\1\\2', $ip_parts[0]);\n\n\t\t// Find bunches of zeros\n\t\tif (preg_match_all('/(?:^|:)(?:0(?::|$))+/', $ip_parts[0], $matches, PREG_OFFSET_CAPTURE))\n\t\t{\n\t\t\t$max = 0;\n\t\t\t$pos = null;\n\t\t\tforeach ($matches[0] as $match)\n\t\t\t{\n\t\t\t\tif (strlen($match[0]) > $max)\n\t\t\t\t{\n\t\t\t\t\t$max = strlen($match[0]);\n\t\t\t\t\t$pos = $match[1];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$ip_parts[0] = substr_replace($ip_parts[0], '::', $pos, $max);\n\t\t}\n\n\t\tif ($ip_parts[1] !== '')\n\t\t{\n\t\t\treturn implode(':', $ip_parts);\n\t\t}\n\n\t\treturn $ip_parts[0];\n\t}\n\n\t/**\n\t * Splits an IPv6 address into the IPv6 and IPv4 representation parts\n\t *\n\t * RFC 4291 allows you to represent the last two parts of an IPv6 address\n\t * using the standard IPv4 representation\n\t *\n\t * Example:  0:0:0:0:0:0:13.1.68.3\n\t *           0:0:0:0:0:FFFF:129.144.52.38\n\t *\n\t * @param string $ip An IPv6 address\n\t * @return array [0] contains the IPv6 represented part, and [1] the IPv4 represented part\n\t */\n\tprivate static function split_v6_v4($ip)\n\t{\n\t\tif (strpos($ip, '.') !== false)\n\t\t{\n\t\t\t$pos = strrpos($ip, ':');\n\t\t\t$ipv6_part = substr($ip, 0, $pos);\n\t\t\t$ipv4_part = substr($ip, $pos + 1);\n\t\t\treturn array($ipv6_part, $ipv4_part);\n\t\t}\n\n\t\treturn array($ip, '');\n\t}\n\n\t/**\n\t * Checks an IPv6 address\n\t *\n\t * Checks if the given IP is a valid IPv6 address\n\t *\n\t * @param string $ip An IPv6 address\n\t * @return bool true if $ip is a valid IPv6 address\n\t */\n\tpublic static function check_ipv6($ip)\n\t{\n\t\t$ip = self::uncompress($ip);\n\t\tlist($ipv6, $ipv4) = self::split_v6_v4($ip);\n\t\t$ipv6 = explode(':', $ipv6);\n\t\t$ipv4 = explode('.', $ipv4);\n\t\tif (count($ipv6) === 8 && count($ipv4) === 1 || count($ipv6) === 6 && count($ipv4) === 4)\n\t\t{\n\t\t\tforeach ($ipv6 as $ipv6_part)\n\t\t\t{\n\t\t\t\t// The section can't be empty\n\t\t\t\tif ($ipv6_part === '')\n\t\t\t\t\treturn false;\n\n\t\t\t\t// Nor can it be over four characters\n\t\t\t\tif (strlen($ipv6_part) > 4)\n\t\t\t\t\treturn false;\n\n\t\t\t\t// Remove leading zeros (this is safe because of the above)\n\t\t\t\t$ipv6_part = ltrim($ipv6_part, '0');\n\t\t\t\tif ($ipv6_part === '')\n\t\t\t\t\t$ipv6_part = '0';\n\n\t\t\t\t// Check the value is valid\n\t\t\t\t$value = hexdec($ipv6_part);\n\t\t\t\tif (dechex($value) !== strtolower($ipv6_part) || $value < 0 || $value > 0xFFFF)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (count($ipv4) === 4)\n\t\t\t{\n\t\t\t\tforeach ($ipv4 as $ipv4_part)\n\t\t\t\t{\n\t\t\t\t\t$value = (int) $ipv4_part;\n\t\t\t\t\tif ((string) $value !== $ipv4_part || $value < 0 || $value > 0xFF)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks if the given IP is a valid IPv6 address\n\t *\n\t * @codeCoverageIgnore\n\t * @deprecated Use {@see SimplePie_Net_IPv6::check_ipv6()} instead\n\t * @see check_ipv6\n\t * @param string $ip An IPv6 address\n\t * @return bool true if $ip is a valid IPv6 address\n\t */\n\tpublic static function checkIPv6($ip)\n\t{\n\t\treturn self::check_ipv6($ip);\n\t}\n}\n", "num_lines": 270}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * SimplePie\n *\n * A PHP-Based RSS and Atom Feed Framework.\n * Takes the hard work out of managing a complete RSS/Atom solution.\n *\n * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * \t* Redistributions of source code must retain the above copyright notice, this list of\n * \t  conditions and the following disclaimer.\n *\n * \t* Redistributions in binary form must reproduce the above copyright notice, this list\n * \t  of conditions and the following disclaimer in the documentation and/or other materials\n * \t  provided with the distribution.\n *\n * \t* Neither the name of the SimplePie Team nor the names of its contributors may be used\n * \t  to endorse or promote products derived from this software without specific prior\n * \t  written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS\n * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @package SimplePie\n * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue\n * @author Ryan Parman\n * @author Sam Sneddon\n * @author Ryan McCue\n * @link http://simplepie.org/ SimplePie\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n */\n\n\n/**\n * Parses the XML Declaration\n *\n * @package SimplePie\n * @subpackage Parsing\n */\nclass SimplePie_XML_Declaration_Parser\n{\n\t/**\n\t * XML Version\n\t *\n\t * @access public\n\t * @var string\n\t */\n\tvar $version = '1.0';\n\n\t/**\n\t * Encoding\n\t *\n\t * @access public\n\t * @var string\n\t */\n\tvar $encoding = 'UTF-8';\n\n\t/**\n\t * Standalone\n\t *\n\t * @access public\n\t * @var bool\n\t */\n\tvar $standalone = false;\n\n\t/**\n\t * Current state of the state machine\n\t *\n\t * @access private\n\t * @var string\n\t */\n\tvar $state = 'before_version_name';\n\n\t/**\n\t * Input data\n\t *\n\t * @access private\n\t * @var string\n\t */\n\tvar $data = '';\n\n\t/**\n\t * Input data length (to avoid calling strlen() everytime this is needed)\n\t *\n\t * @access private\n\t * @var int\n\t */\n\tvar $data_length = 0;\n\n\t/**\n\t * Current position of the pointer\n\t *\n\t * @var int\n\t * @access private\n\t */\n\tvar $position = 0;\n\n\t/**\n\t * Create an instance of the class with the input data\n\t *\n\t * @access public\n\t * @param string $data Input data\n\t */\n\tpublic function __construct($data)\n\t{\n\t\t$this->data = $data;\n\t\t$this->data_length = strlen($this->data);\n\t}\n\n\t/**\n\t * Parse the input data\n\t *\n\t * @access public\n\t * @return bool true on success, false on failure\n\t */\n\tpublic function parse()\n\t{\n\t\twhile ($this->state && $this->state !== 'emit' && $this->has_data())\n\t\t{\n\t\t\t$state = $this->state;\n\t\t\t$this->$state();\n\t\t}\n\t\t$this->data = '';\n\t\tif ($this->state === 'emit')\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->version = '';\n\t\t$this->encoding = '';\n\t\t$this->standalone = '';\n\t\treturn false;\n\t}\n\n\t/**\n\t * Check whether there is data beyond the pointer\n\t *\n\t * @access private\n\t * @return bool true if there is further data, false if not\n\t */\n\tpublic function has_data()\n\t{\n\t\treturn (bool) ($this->position < $this->data_length);\n\t}\n\n\t/**\n\t * Advance past any whitespace\n\t *\n\t * @return int Number of whitespace characters passed\n\t */\n\tpublic function skip_whitespace()\n\t{\n\t\t$whitespace = strspn($this->data, \"\\x09\\x0A\\x0D\\x20\", $this->position);\n\t\t$this->position += $whitespace;\n\t\treturn $whitespace;\n\t}\n\n\t/**\n\t * Read value\n\t */\n\tpublic function get_value()\n\t{\n\t\t$quote = substr($this->data, $this->position, 1);\n\t\tif ($quote === '\"' || $quote === \"'\")\n\t\t{\n\t\t\t$this->position++;\n\t\t\t$len = strcspn($this->data, $quote, $this->position);\n\t\t\tif ($this->has_data())\n\t\t\t{\n\t\t\t\t$value = substr($this->data, $this->position, $len);\n\t\t\t\t$this->position += $len + 1;\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic function before_version_name()\n\t{\n\t\tif ($this->skip_whitespace())\n\t\t{\n\t\t\t$this->state = 'version_name';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state = false;\n\t\t}\n\t}\n\n\tpublic function version_name()\n\t{\n\t\tif (substr($this->data, $this->position, 7) === 'version')\n\t\t{\n\t\t\t$this->position += 7;\n\t\t\t$this->skip_whitespace();\n\t\t\t$this->state = 'version_equals';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state = false;\n\t\t}\n\t}\n\n\tpublic function version_equals()\n\t{\n\t\tif (substr($this->data, $this->position, 1) === '=')\n\t\t{\n\t\t\t$this->position++;\n\t\t\t$this->skip_whitespace();\n\t\t\t$this->state = 'version_value';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state = false;\n\t\t}\n\t}\n\n\tpublic function version_value()\n\t{\n\t\tif ($this->version = $this->get_value())\n\t\t{\n\t\t\t$this->skip_whitespace();\n\t\t\tif ($this->has_data())\n\t\t\t{\n\t\t\t\t$this->state = 'encoding_name';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->state = 'emit';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state = false;\n\t\t}\n\t}\n\n\tpublic function encoding_name()\n\t{\n\t\tif (substr($this->data, $this->position, 8) === 'encoding')\n\t\t{\n\t\t\t$this->position += 8;\n\t\t\t$this->skip_whitespace();\n\t\t\t$this->state = 'encoding_equals';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state = 'standalone_name';\n\t\t}\n\t}\n\n\tpublic function encoding_equals()\n\t{\n\t\tif (substr($this->data, $this->position, 1) === '=')\n\t\t{\n\t\t\t$this->position++;\n\t\t\t$this->skip_whitespace();\n\t\t\t$this->state = 'encoding_value';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state = false;\n\t\t}\n\t}\n\n\tpublic function encoding_value()\n\t{\n\t\tif ($this->encoding = $this->get_value())\n\t\t{\n\t\t\t$this->skip_whitespace();\n\t\t\tif ($this->has_data())\n\t\t\t{\n\t\t\t\t$this->state = 'standalone_name';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->state = 'emit';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state = false;\n\t\t}\n\t}\n\n\tpublic function standalone_name()\n\t{\n\t\tif (substr($this->data, $this->position, 10) === 'standalone')\n\t\t{\n\t\t\t$this->position += 10;\n\t\t\t$this->skip_whitespace();\n\t\t\t$this->state = 'standalone_equals';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state = false;\n\t\t}\n\t}\n\n\tpublic function standalone_equals()\n\t{\n\t\tif (substr($this->data, $this->position, 1) === '=')\n\t\t{\n\t\t\t$this->position++;\n\t\t\t$this->skip_whitespace();\n\t\t\t$this->state = 'standalone_value';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state = false;\n\t\t}\n\t}\n\n\tpublic function standalone_value()\n\t{\n\t\tif ($standalone = $this->get_value())\n\t\t{\n\t\t\tswitch ($standalone)\n\t\t\t{\n\t\t\t\tcase 'yes':\n\t\t\t\t\t$this->standalone = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'no':\n\t\t\t\t\t$this->standalone = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->state = false;\n\t\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$this->skip_whitespace();\n\t\t\tif ($this->has_data())\n\t\t\t{\n\t\t\t\t$this->state = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->state = 'emit';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state = false;\n\t\t}\n\t}\n}\n", "num_lines": 360}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Sitemaps: WP_Sitemaps_Index class.\n *\n * Generates the sitemap index.\n *\n * @package WordPress\n * @subpackage Sitemaps\n * @since 5.5.0\n */\n\n/**\n * Class WP_Sitemaps_Index.\n * Builds the sitemap index page that lists the links to all of the sitemaps.\n *\n * @since 5.5.0\n */\nclass WP_Sitemaps_Index {\n\t/**\n\t * The main registry of supported sitemaps.\n\t *\n\t * @since 5.5.0\n\t * @var WP_Sitemaps_Registry\n\t */\n\tprotected $registry;\n\n\t/**\n\t * Maximum number of sitemaps to include in an index.\n\t *\n\t * @sincee 5.5.0\n\t *\n\t * @var int Maximum number of sitemaps.\n\t */\n\tprivate $max_sitemaps = 50000;\n\n\t/**\n\t * WP_Sitemaps_Index constructor.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param WP_Sitemaps_Registry $registry Sitemap provider registry.\n\t */\n\tpublic function __construct( WP_Sitemaps_Registry $registry ) {\n\t\t$this->registry = $registry;\n\t}\n\n\t/**\n\t * Gets a sitemap list for the index.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array[] Array of all sitemaps.\n\t */\n\tpublic function get_sitemap_list() {\n\t\t$sitemaps = array();\n\n\t\t$providers = $this->registry->get_providers();\n\t\t/* @var WP_Sitemaps_Provider $provider */\n\t\tforeach ( $providers as $name => $provider ) {\n\t\t\t$sitemap_entries = $provider->get_sitemap_entries();\n\n\t\t\t// Prevent issues with array_push and empty arrays on PHP < 7.3.\n\t\t\tif ( ! $sitemap_entries ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Using array_push is more efficient than array_merge in a loop.\n\t\t\tarray_push( $sitemaps, ...$sitemap_entries );\n\t\t\tif ( count( $sitemaps ) >= $this->max_sitemaps ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn array_slice( $sitemaps, 0, $this->max_sitemaps, true );\n\t}\n\n\t/**\n\t * Builds the URL for the sitemap index.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n\t *\n\t * @return string The sitemap index URL.\n\t */\n\tpublic function get_index_url() {\n\t\tglobal $wp_rewrite;\n\n\t\tif ( ! $wp_rewrite->using_permalinks() ) {\n\t\t\treturn home_url( '/?sitemap=index' );\n\t\t}\n\n\t\treturn home_url( '/wp-sitemap.xml' );\n\t}\n}\n", "num_lines": 96}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Sitemaps: WP_Sitemaps_Provider class\n *\n * This class is a base class for other sitemap providers to extend and contains shared functionality.\n *\n * @package WordPress\n * @subpackage Sitemaps\n * @since 5.5.0\n */\n\n/**\n * Class WP_Sitemaps_Provider.\n *\n * @since 5.5.0\n */\nabstract class WP_Sitemaps_Provider {\n\t/**\n\t * Provider name.\n\t *\n\t * This will also be used as the public-facing name in URLs.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @var string\n\t */\n\tprotected $name = '';\n\n\t/**\n\t * Object type name (e.g. 'post', 'term', 'user').\n\t *\n\t * @since 5.5.0\n\t *\n\t * @var string\n\t */\n\tprotected $object_type = '';\n\n\t/**\n\t * Gets a URL list for a sitemap.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param int    $page_num       Page of results.\n\t * @param string $object_subtype Optional. Object subtype name. Default empty.\n\t * @return array Array of URLs for a sitemap.\n\t */\n\tabstract public function get_url_list( $page_num, $object_subtype = '' );\n\n\t/**\n\t * Gets the max number of pages available for the object type.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $object_subtype Optional. Object subtype. Default empty.\n\t * @return int Total number of pages.\n\t */\n\tabstract public function get_max_num_pages( $object_subtype = '' );\n\n\t/**\n\t * Gets data about each sitemap type.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array[] Array of sitemap types including object subtype name and number of pages.\n\t */\n\tpublic function get_sitemap_type_data() {\n\t\t$sitemap_data = array();\n\n\t\t$object_subtypes = $this->get_object_subtypes();\n\n\t\t// If there are no object subtypes, include a single sitemap for the\n\t\t// entire object type.\n\t\tif ( empty( $object_subtypes ) ) {\n\t\t\t$sitemap_data[] = array(\n\t\t\t\t'name'  => '',\n\t\t\t\t'pages' => $this->get_max_num_pages(),\n\t\t\t);\n\t\t\treturn $sitemap_data;\n\t\t}\n\n\t\t// Otherwise, include individual sitemaps for every object subtype.\n\t\tforeach ( $object_subtypes as $object_subtype_name => $data ) {\n\t\t\t$object_subtype_name = (string) $object_subtype_name;\n\n\t\t\t$sitemap_data[] = array(\n\t\t\t\t'name'  => $object_subtype_name,\n\t\t\t\t'pages' => $this->get_max_num_pages( $object_subtype_name ),\n\t\t\t);\n\t\t}\n\n\t\treturn $sitemap_data;\n\t}\n\n\t/**\n\t * Lists sitemap pages exposed by this provider.\n\t *\n\t * The returned data is used to populate the sitemap entries of the index.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array[] Array of sitemap entries.\n\t */\n\tpublic function get_sitemap_entries() {\n\t\t$sitemaps = array();\n\n\t\t$sitemap_types = $this->get_sitemap_type_data();\n\n\t\tforeach ( $sitemap_types as $type ) {\n\t\t\tfor ( $page = 1; $page <= $type['pages']; $page ++ ) {\n\t\t\t\t$sitemap_entry = array(\n\t\t\t\t\t'loc' => $this->get_sitemap_url( $type['name'], $page ),\n\t\t\t\t);\n\n\t\t\t\t/**\n\t\t\t\t * Filters the sitemap entry for the sitemap index.\n\t\t\t\t *\n\t\t\t\t * @since 5.5.0\n\t\t\t\t *\n\t\t\t\t * @param array  $sitemap_entry  Sitemap entry for the post.\n\t\t\t\t * @param string $object_type    Object empty name.\n\t\t\t\t * @param string $object_subtype Object subtype name.\n\t\t\t\t *                               Empty string if the object type does not support subtypes.\n\t\t\t\t * @param int    $page           Page number of results.\n\t\t\t\t */\n\t\t\t\t$sitemap_entry = apply_filters( 'wp_sitemaps_index_entry', $sitemap_entry, $this->object_type, $type['name'], $page );\n\n\t\t\t\t$sitemaps[] = $sitemap_entry;\n\t\t\t}\n\t\t}\n\n\t\treturn $sitemaps;\n\t}\n\n\t/**\n\t * Gets the URL of a sitemap entry.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n\t *\n\t * @param string $name The name of the sitemap.\n\t * @param int    $page The page of the sitemap.\n\t * @return string The composed URL for a sitemap entry.\n\t */\n\tpublic function get_sitemap_url( $name, $page ) {\n\t\tglobal $wp_rewrite;\n\n\t\t// Accounts for cases where name is not included, ex: sitemaps-users-1.xml.\n\t\t$params = array_filter(\n\t\t\tarray(\n\t\t\t\t'sitemap'         => $this->name,\n\t\t\t\t'sitemap-subtype' => $name,\n\t\t\t\t'paged'           => $page,\n\t\t\t)\n\t\t);\n\n\t\t$basename = sprintf(\n\t\t\t'/wp-sitemap-%1$s.xml',\n\t\t\timplode( '-', $params )\n\t\t);\n\n\t\tif ( ! $wp_rewrite->using_permalinks() ) {\n\t\t\t$basename = '/?' . http_build_query( $params, null, '&' );\n\t\t}\n\n\t\treturn home_url( $basename );\n\t}\n\n\t/**\n\t * Returns the list of supported object subtypes exposed by the provider.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array List of object subtypes objects keyed by their name.\n\t */\n\tpublic function get_object_subtypes() {\n\t\treturn array();\n\t}\n}\n", "num_lines": 180}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Sitemaps: WP_Sitemaps_Registry class\n *\n * Handles registering sitemap providers.\n *\n * @package WordPress\n * @subpackage Sitemaps\n * @since 5.5.0\n */\n\n/**\n * Class WP_Sitemaps_Registry.\n *\n * @since 5.5.0\n */\nclass WP_Sitemaps_Registry {\n\t/**\n\t * Registered sitemap providers.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @var WP_Sitemaps_Provider[] Array of registered sitemap providers.\n\t */\n\tprivate $providers = array();\n\n\t/**\n\t * Adds a new sitemap provider.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string               $name     Name of the sitemap provider.\n\t * @param WP_Sitemaps_Provider $provider Instance of a WP_Sitemaps_Provider.\n\t * @return bool Whether the provider was added successfully.\n\t */\n\tpublic function add_provider( $name, WP_Sitemaps_Provider $provider ) {\n\t\tif ( isset( $this->providers[ $name ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * Filters the sitemap provider before it is added.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param WP_Sitemaps_Provider $provider Instance of a WP_Sitemaps_Provider.\n\t\t * @param string               $name     Name of the sitemap provider.\n\t\t */\n\t\t$provider = apply_filters( 'wp_sitemaps_add_provider', $provider, $name );\n\t\tif ( ! $provider instanceof WP_Sitemaps_Provider ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->providers[ $name ] = $provider;\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Returns a single registered sitemap provider.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $name Sitemap provider name.\n\t * @return WP_Sitemaps_Provider|null Sitemap provider if it exists, null otherwise.\n\t */\n\tpublic function get_provider( $name ) {\n\t\tif ( ! isset( $this->providers[ $name ] ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $this->providers[ $name ];\n\t}\n\n\t/**\n\t * Returns all registered sitemap providers.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return WP_Sitemaps_Provider[] Array of sitemap providers.\n\t */\n\tpublic function get_providers() {\n\t\treturn $this->providers;\n\t}\n}\n", "num_lines": 86}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Sitemaps: WP_Sitemaps_Renderer class\n *\n * Responsible for rendering Sitemaps data to XML in accordance with sitemap protocol.\n *\n * @package WordPress\n * @subpackage Sitemaps\n * @since 5.5.0\n */\n\n/**\n * Class WP_Sitemaps_Renderer\n *\n * @since 5.5.0\n */\nclass WP_Sitemaps_Renderer {\n\t/**\n\t * XSL stylesheet for styling a sitemap for web browsers.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @var string\n\t */\n\tprotected $stylesheet = '';\n\n\t/**\n\t * XSL stylesheet for styling a sitemap for web browsers.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @var string\n\t */\n\tprotected $stylesheet_index = '';\n\n\t/**\n\t * WP_Sitemaps_Renderer constructor.\n\t *\n\t * @since 5.5.0\n\t */\n\tpublic function __construct() {\n\t\t$stylesheet_url = $this->get_sitemap_stylesheet_url();\n\n\t\tif ( $stylesheet_url ) {\n\t\t\t$this->stylesheet = '<?xml-stylesheet type=\"text/xsl\" href=\"' . esc_url( $stylesheet_url ) . '\" ?>';\n\t\t}\n\n\t\t$stylesheet_index_url = $this->get_sitemap_index_stylesheet_url();\n\n\t\tif ( $stylesheet_index_url ) {\n\t\t\t$this->stylesheet_index = '<?xml-stylesheet type=\"text/xsl\" href=\"' . esc_url( $stylesheet_index_url ) . '\" ?>';\n\t\t}\n\t}\n\n\t/**\n\t * Gets the URL for the sitemap stylesheet.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n\t *\n\t * @return string The sitemap stylesheet URL.\n\t */\n\tpublic function get_sitemap_stylesheet_url() {\n\t\tglobal $wp_rewrite;\n\n\t\t$sitemap_url = home_url( '/wp-sitemap.xsl' );\n\n\t\tif ( ! $wp_rewrite->using_permalinks() ) {\n\t\t\t$sitemap_url = home_url( '/?sitemap-stylesheet=sitemap' );\n\t\t}\n\n\t\t/**\n\t\t * Filters the URL for the sitemap stylesheet.\n\t\t *\n\t\t * If a falsey value is returned, no stylesheet will be used and\n\t\t * the \"raw\" XML of the sitemap will be displayed.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param string $sitemap_url Full URL for the sitemaps XSL file.\n\t\t */\n\t\treturn apply_filters( 'wp_sitemaps_stylesheet_url', $sitemap_url );\n\t}\n\n\t/**\n\t * Gets the URL for the sitemap index stylesheet.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @global WP_Rewrite $wp_rewrite WordPress rewrite component.\n\t *\n\t * @return string The sitemap index stylesheet URL.\n\t */\n\tpublic function get_sitemap_index_stylesheet_url() {\n\t\tglobal $wp_rewrite;\n\n\t\t$sitemap_url = home_url( '/wp-sitemap-index.xsl' );\n\n\t\tif ( ! $wp_rewrite->using_permalinks() ) {\n\t\t\t$sitemap_url = home_url( '/?sitemap-stylesheet=index' );\n\t\t}\n\n\t\t/**\n\t\t * Filters the URL for the sitemap index stylesheet.\n\t\t *\n\t\t * If a falsey value is returned, no stylesheet will be used and\n\t\t * the \"raw\" XML of the sitemap index will be displayed.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param string $sitemap_url Full URL for the sitemaps index XSL file.\n\t\t */\n\t\treturn apply_filters( 'wp_sitemaps_stylesheet_index_url', $sitemap_url );\n\t}\n\n\t/**\n\t * Renders a sitemap index.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param array $sitemaps Array of sitemap URLs.\n\t */\n\tpublic function render_index( $sitemaps ) {\n\t\theader( 'Content-type: application/xml; charset=UTF-8' );\n\n\t\t$this->check_for_simple_xml_availability();\n\n\t\t$index_xml = $this->get_sitemap_index_xml( $sitemaps );\n\n\t\tif ( ! empty( $index_xml ) ) {\n\t\t\t// All output is escaped within get_sitemap_index_xml().\n\t\t\t// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\techo $index_xml;\n\t\t}\n\t}\n\n\t/**\n\t * Gets XML for a sitemap index.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param array $sitemaps Array of sitemap URLs.\n\t * @return string|false A well-formed XML string for a sitemap index. False on error.\n\t */\n\tpublic function get_sitemap_index_xml( $sitemaps ) {\n\t\t$sitemap_index = new SimpleXMLElement(\n\t\t\tsprintf(\n\t\t\t\t'%1$s%2$s%3$s',\n\t\t\t\t'<?xml version=\"1.0\" encoding=\"UTF-8\" ?>',\n\t\t\t\t$this->stylesheet_index,\n\t\t\t\t'<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" />'\n\t\t\t)\n\t\t);\n\n\t\tforeach ( $sitemaps as $entry ) {\n\t\t\t$sitemap = $sitemap_index->addChild( 'sitemap' );\n\n\t\t\t// Add each element as a child node to the <sitemap> entry.\n\t\t\tforeach ( $entry as $name => $value ) {\n\t\t\t\tif ( 'loc' === $name ) {\n\t\t\t\t\t$sitemap->addChild( $name, esc_url( $value ) );\n\t\t\t\t} elseif ( 'lastmod' === $name ) {\n\t\t\t\t\t$sitemap->addChild( $name, esc_xml( $value ) );\n\t\t\t\t} else {\n\t\t\t\t\t_doing_it_wrong(\n\t\t\t\t\t\t__METHOD__,\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: List of element names. */\n\t\t\t\t\t\t\t__( 'Fields other than %s are not currently supported for the sitemap index.' ),\n\t\t\t\t\t\t\timplode( ',', array( 'loc', 'lastmod' ) )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'5.5.0'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $sitemap_index->asXML();\n\t}\n\n\t/**\n\t * Renders a sitemap.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param array $url_list Array of URLs for a sitemap.\n\t */\n\tpublic function render_sitemap( $url_list ) {\n\t\theader( 'Content-type: application/xml; charset=UTF-8' );\n\n\t\t$this->check_for_simple_xml_availability();\n\n\t\t$sitemap_xml = $this->get_sitemap_xml( $url_list );\n\n\t\tif ( ! empty( $sitemap_xml ) ) {\n\t\t\t// All output is escaped within get_sitemap_xml().\n\t\t\t// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\techo $sitemap_xml;\n\t\t}\n\t}\n\n\t/**\n\t * Gets XML for a sitemap.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param array $url_list Array of URLs for a sitemap.\n\t * @return string|false A well-formed XML string for a sitemap index. False on error.\n\t */\n\tpublic function get_sitemap_xml( $url_list ) {\n\t\t$urlset = new SimpleXMLElement(\n\t\t\tsprintf(\n\t\t\t\t'%1$s%2$s%3$s',\n\t\t\t\t'<?xml version=\"1.0\" encoding=\"UTF-8\" ?>',\n\t\t\t\t$this->stylesheet,\n\t\t\t\t'<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" />'\n\t\t\t)\n\t\t);\n\n\t\tforeach ( $url_list as $url_item ) {\n\t\t\t$url = $urlset->addChild( 'url' );\n\n\t\t\t// Add each element as a child node to the <url> entry.\n\t\t\tforeach ( $url_item as $name => $value ) {\n\t\t\t\tif ( 'loc' === $name ) {\n\t\t\t\t\t$url->addChild( $name, esc_url( $value ) );\n\t\t\t\t} elseif ( in_array( $name, array( 'lastmod', 'changefreq', 'priority' ), true ) ) {\n\t\t\t\t\t$url->addChild( $name, esc_xml( $value ) );\n\t\t\t\t} else {\n\t\t\t\t\t_doing_it_wrong(\n\t\t\t\t\t\t__METHOD__,\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: List of element names. */\n\t\t\t\t\t\t\t__( 'Fields other than %s are not currently supported for sitemaps.' ),\n\t\t\t\t\t\t\timplode( ',', array( 'loc', 'lastmod', 'changefreq', 'priority' ) )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'5.5.0'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $urlset->asXML();\n\t}\n\n\t/**\n\t * Checks for the availability of the SimpleXML extension and errors if missing.\n\t *\n\t * @since 5.5.0\n\t */\n\tprivate function check_for_simple_xml_availability() {\n\t\tif ( ! class_exists( 'SimpleXMLElement' ) ) {\n\t\t\tadd_filter(\n\t\t\t\t'wp_die_handler',\n\t\t\t\tstatic function () {\n\t\t\t\t\treturn '_xml_wp_die_handler';\n\t\t\t\t}\n\t\t\t);\n\n\t\t\twp_die(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: SimpleXML */\n\t\t\t\t\tesc_xml( __( 'Could not generate XML sitemap due to missing %s extension' ) ),\n\t\t\t\t\t'SimpleXML'\n\t\t\t\t),\n\t\t\t\tesc_xml( __( 'WordPress &rsaquo; Error' ) ),\n\t\t\t\tarray(\n\t\t\t\t\t'response' => 501, // \"Not implemented\".\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n}\n", "num_lines": 275}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Sitemaps: WP_Sitemaps_Stylesheet class\n *\n * This class provides the XSL stylesheets to style all sitemaps.\n *\n * @package WordPress\n * @subpackage Sitemaps\n * @since 5.5.0\n */\n\n/**\n * Stylesheet provider class.\n *\n * @since 5.5.0\n */\nclass WP_Sitemaps_Stylesheet {\n\t/**\n\t * Renders the XSL stylesheet depending on whether it's the sitemap index or not.\n\t *\n\t * @param string $type Stylesheet type. Either 'sitemap' or 'index'.\n\t */\n\tpublic function render_stylesheet( $type ) {\n\t\theader( 'Content-type: application/xml; charset=UTF-8' );\n\n\t\tif ( 'sitemap' === $type ) {\n\t\t\t// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- All content escaped below.\n\t\t\techo $this->get_sitemap_stylesheet();\n\t\t}\n\n\t\tif ( 'index' === $type ) {\n\t\t\t// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- All content escaped below.\n\t\t\techo $this->get_sitemap_index_stylesheet();\n\t\t}\n\n\t\texit;\n\t}\n\n\t/**\n\t * Returns the escaped XSL for all sitemaps, except index.\n\t *\n\t * @since 5.5.0\n\t */\n\tpublic function get_sitemap_stylesheet() {\n\t\t$css         = $this->get_stylesheet_css();\n\t\t$title       = esc_xml( __( 'XML Sitemap' ) );\n\t\t$description = esc_xml( __( 'This XML Sitemap is generated by WordPress to make your content more visible for search engines.' ) );\n\t\t$learn_more  = sprintf(\n\t\t\t'<a href=\"%s\">%s</a>',\n\t\t\tesc_url( __( 'https://www.sitemaps.org/' ) ),\n\t\t\tesc_xml( __( 'Learn more about XML sitemaps.' ) )\n\t\t);\n\n\t\t$text = sprintf(\n\t\t\t/* translators: %s: Number of URLs. */\n\t\t\tesc_xml( __( 'Number of URLs in this XML Sitemap: %s.' ) ),\n\t\t\t'<xsl:value-of select=\"count( sitemap:urlset/sitemap:url )\" />'\n\t\t);\n\n\t\t$lang       = get_language_attributes( 'html' );\n\t\t$url        = esc_xml( __( 'URL' ) );\n\t\t$lastmod    = esc_xml( __( 'Last Modified' ) );\n\t\t$changefreq = esc_xml( __( 'Change Frequency' ) );\n\t\t$priority   = esc_xml( __( 'Priority' ) );\n\n\t\t$xsl_content = <<<XSL\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xsl:stylesheet\n\t\tversion=\"1.0\"\n\t\txmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n\t\txmlns:sitemap=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\n\t\texclude-result-prefixes=\"sitemap\"\n\t\t>\n\n\t<xsl:output method=\"html\" encoding=\"UTF-8\" indent=\"yes\"/>\n\n\t<!--\n\t  Set variables for whether lastmod, changefreq or priority occur for any url in the sitemap.\n\t  We do this up front because it can be expensive in a large sitemap.\n\t  -->\n\t<xsl:variable name=\"has-lastmod\"    select=\"count( /sitemap:urlset/sitemap:url/sitemap:lastmod )\"    />\n\t<xsl:variable name=\"has-changefreq\" select=\"count( /sitemap:urlset/sitemap:url/sitemap:changefreq )\" />\n\t<xsl:variable name=\"has-priority\"   select=\"count( /sitemap:urlset/sitemap:url/sitemap:priority )\"   />\n\n\t<xsl:template match=\"/\">\n\t\t<html {$lang}>\n\t\t\t<head>\n\t\t\t\t<title>{$title}</title>\n\t\t\t\t<style>\n\t\t\t\t\t{$css}\n\t\t\t\t</style>\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<div id=\"sitemap\">\n\t\t\t\t\t<div id=\"sitemap__header\">\n\t\t\t\t\t\t<h1>{$title}</h1>\n\t\t\t\t\t\t<p>{$description}</p>\n\t\t\t\t\t\t<p>{$learn_more}</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id=\"sitemap__content\">\n\t\t\t\t\t\t<p class=\"text\">{$text}</p>\n\t\t\t\t\t\t<table id=\"sitemap__table\">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th class=\"loc\">{$url}</th>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"\\$has-lastmod\">\n\t\t\t\t\t\t\t\t\t\t<th class=\"lastmod\">{$lastmod}</th>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"\\$has-changefreq\">\n\t\t\t\t\t\t\t\t\t\t<th class=\"changefreq\">{$changefreq}</th>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"\\$has-priority\">\n\t\t\t\t\t\t\t\t\t\t<th class=\"priority\">{$priority}</th>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"sitemap:urlset/sitemap:url\">\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td class=\"loc\"><a href=\"{sitemap:loc}\"><xsl:value-of select=\"sitemap:loc\" /></a></td>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"\\$has-lastmod\">\n\t\t\t\t\t\t\t\t\t\t\t<td class=\"lastmod\"><xsl:value-of select=\"sitemap:lastmod\" /></td>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"\\$has-changefreq\">\n\t\t\t\t\t\t\t\t\t\t\t<td class=\"changefreq\"><xsl:value-of select=\"sitemap:changefreq\" /></td>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"\\$has-priority\">\n\t\t\t\t\t\t\t\t\t\t\t<td class=\"priority\"><xsl:value-of select=\"sitemap:priority\" /></td>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</body>\n\t\t</html>\n\t</xsl:template>\n</xsl:stylesheet>\n\nXSL;\n\n\t\t/**\n\t\t * Filters the content of the sitemap stylesheet.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param string $xsl_content Full content for the XML stylesheet.\n\t\t */\n\t\treturn apply_filters( 'wp_sitemaps_stylesheet_content', $xsl_content );\n\t}\n\n\t/**\n\t * Returns the escaped XSL for the index sitemaps.\n\t *\n\t * @since 5.5.0\n\t */\n\tpublic function get_sitemap_index_stylesheet() {\n\t\t$css         = $this->get_stylesheet_css();\n\t\t$title       = esc_xml( __( 'XML Sitemap' ) );\n\t\t$description = esc_xml( __( 'This XML Sitemap is generated by WordPress to make your content more visible for search engines.' ) );\n\t\t$learn_more  = sprintf(\n\t\t\t'<a href=\"%s\">%s</a>',\n\t\t\tesc_url( __( 'https://www.sitemaps.org/' ) ),\n\t\t\tesc_xml( __( 'Learn more about XML sitemaps.' ) )\n\t\t);\n\n\t\t$text = sprintf(\n\t\t\t/* translators: %s: Number of URLs. */\n\t\t\tesc_xml( __( 'Number of URLs in this XML Sitemap: %s.' ) ),\n\t\t\t'<xsl:value-of select=\"count( sitemap:sitemapindex/sitemap:sitemap )\" />'\n\t\t);\n\n\t\t$lang    = get_language_attributes( 'html' );\n\t\t$url     = esc_xml( __( 'URL' ) );\n\t\t$lastmod = esc_xml( __( 'Last Modified' ) );\n\n\t\t$xsl_content = <<<XSL\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xsl:stylesheet\n\t\tversion=\"1.0\"\n\t\txmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n\t\txmlns:sitemap=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\n\t\texclude-result-prefixes=\"sitemap\"\n\t\t>\n\n\t<xsl:output method=\"html\" encoding=\"UTF-8\" indent=\"yes\" />\n\n\t<!--\n\t  Set variables for whether lastmod occurs for any sitemap in the index.\n\t  We do this up front because it can be expensive in a large sitemap.\n\t  -->\n\t<xsl:variable name=\"has-lastmod\" select=\"count( /sitemap:sitemapindex/sitemap:sitemap/sitemap:lastmod )\" />\n\n\t<xsl:template match=\"/\">\n\t\t<html {$lang}>\n\t\t\t<head>\n\t\t\t\t<title>{$title}</title>\n\t\t\t\t<style>\n\t\t\t\t\t{$css}\n\t\t\t\t</style>\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<div id=\"sitemap\">\n\t\t\t\t\t<div id=\"sitemap__header\">\n\t\t\t\t\t\t<h1>{$title}</h1>\n\t\t\t\t\t\t<p>{$description}</p>\n\t\t\t\t\t\t<p>{$learn_more}</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id=\"sitemap__content\">\n\t\t\t\t\t\t<p class=\"text\">{$text}</p>\n\t\t\t\t\t\t<table id=\"sitemap__table\">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th class=\"loc\">{$url}</th>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"\\$has-lastmod\">\n\t\t\t\t\t\t\t\t\t\t<th class=\"lastmod\">{$lastmod}</th>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"sitemap:sitemapindex/sitemap:sitemap\">\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td class=\"loc\"><a href=\"{sitemap:loc}\"><xsl:value-of select=\"sitemap:loc\" /></a></td>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"\\$has-lastmod\">\n\t\t\t\t\t\t\t\t\t\t\t<td class=\"lastmod\"><xsl:value-of select=\"sitemap:lastmod\" /></td>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</body>\n\t\t</html>\n\t</xsl:template>\n</xsl:stylesheet>\n\nXSL;\n\n\t\t/**\n\t\t * Filters the content of the sitemap index stylesheet.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param string $xsl_content Full content for the XML stylesheet.\n\t\t */\n\t\treturn apply_filters( 'wp_sitemaps_stylesheet_index_content', $xsl_content );\n\t}\n\n\t/**\n\t * Gets the CSS to be included in sitemap XSL stylesheets.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return string The CSS.\n\t */\n\tpublic function get_stylesheet_css() {\n\t\t$text_align = is_rtl() ? 'right' : 'left';\n\n\t\t$css = <<<EOF\n\n\t\t\t\t\tbody {\n\t\t\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\t\t\t\t\tcolor: #444;\n\t\t\t\t\t}\n\n\t\t\t\t\t#sitemap__table {\n\t\t\t\t\t\tborder: solid 1px #ccc;\n\t\t\t\t\t\tborder-collapse: collapse;\n\t\t\t\t\t}\n\n\t\t\t \t\t#sitemap__table tr td.loc {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * URLs should always be LTR.\n\t\t\t\t\t\t * See https://core.trac.wordpress.org/ticket/16834\n\t\t\t\t\t\t * and https://core.trac.wordpress.org/ticket/49949\n\t\t\t\t\t\t */\n\t\t\t\t\t\tdirection: ltr;\n\t\t\t\t\t}\n\n\t\t\t\t\t#sitemap__table tr th {\n\t\t\t\t\t\ttext-align: {$text_align};\n\t\t\t\t\t}\n\n\t\t\t\t\t#sitemap__table tr td,\n\t\t\t\t\t#sitemap__table tr th {\n\t\t\t\t\t\tpadding: 10px;\n\t\t\t\t\t}\n\n\t\t\t\t\t#sitemap__table tr:nth-child(odd) td {\n\t\t\t\t\t\tbackground-color: #eee;\n\t\t\t\t\t}\n\n\t\t\t\t\ta:hover {\n\t\t\t\t\t\ttext-decoration: none;\n\t\t\t\t\t}\n\nEOF;\n\n\t\t/**\n\t\t * Filters the CSS only for the sitemap stylesheet.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param string $css CSS to be applied to default XSL file.\n\t\t */\n\t\treturn apply_filters( 'wp_sitemaps_stylesheet_css', $css );\n\t}\n}\n", "num_lines": 311}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Sitemaps: WP_Sitemaps class\n *\n * This is the main class integrating all other classes.\n *\n * @package WordPress\n * @subpackage Sitemaps\n * @since 5.5.0\n */\n\n/**\n * Class WP_Sitemaps.\n *\n * @since 5.5.0\n */\nclass WP_Sitemaps {\n\t/**\n\t * The main index of supported sitemaps.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @var WP_Sitemaps_Index\n\t */\n\tpublic $index;\n\n\t/**\n\t * The main registry of supported sitemaps.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @var WP_Sitemaps_Registry\n\t */\n\tpublic $registry;\n\n\t/**\n\t * An instance of the renderer class.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @var WP_Sitemaps_Renderer\n\t */\n\tpublic $renderer;\n\n\t/**\n\t * WP_Sitemaps constructor.\n\t *\n\t * @since 5.5.0\n\t */\n\tpublic function __construct() {\n\t\t$this->registry = new WP_Sitemaps_Registry();\n\t\t$this->renderer = new WP_Sitemaps_Renderer();\n\t\t$this->index    = new WP_Sitemaps_Index( $this->registry );\n\t}\n\n\t/**\n\t * Initiates all sitemap functionality.\n\t *\n\t * If sitemaps are disabled, only the rewrite rules will be registered\n\t * by this method, in order to properly send 404s.\n\t *\n\t * @since 5.5.0\n\t */\n\tpublic function init() {\n\t\t// These will all fire on the init hook.\n\t\t$this->register_rewrites();\n\n\t\tadd_action( 'template_redirect', array( $this, 'render_sitemaps' ) );\n\n\t\tif ( ! $this->sitemaps_enabled() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->register_sitemaps();\n\n\t\t// Add additional action callbacks.\n\t\tadd_filter( 'pre_handle_404', array( $this, 'redirect_sitemapxml' ), 10, 2 );\n\t\tadd_filter( 'robots_txt', array( $this, 'add_robots' ), 0, 2 );\n\t}\n\n\t/**\n\t * Determines whether sitemaps are enabled or not.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return bool Whether sitemaps are enabled.\n\t */\n\tpublic function sitemaps_enabled() {\n\t\t$is_enabled = (bool) get_option( 'blog_public' );\n\n\t\t/**\n\t\t * Filters whether XML Sitemaps are enabled or not.\n\t\t *\n\t\t * When XML Sitemaps are disabled via this filter, rewrite rules are still\n\t\t * in place to ensure a 404 is returned.\n\t\t *\n\t\t * @see WP_Sitemaps::register_rewrites()\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param bool $is_enabled Whether XML Sitemaps are enabled or not. Defaults\n\t\t * to true for public sites.\n\t\t */\n\t\treturn (bool) apply_filters( 'wp_sitemaps_enabled', $is_enabled );\n\t}\n\n\t/**\n\t * Registers and sets up the functionality for all supported sitemaps.\n\t *\n\t * @since 5.5.0\n\t */\n\tpublic function register_sitemaps() {\n\t\t$providers = array(\n\t\t\t'posts'      => new WP_Sitemaps_Posts(),\n\t\t\t'taxonomies' => new WP_Sitemaps_Taxonomies(),\n\t\t\t'users'      => new WP_Sitemaps_Users(),\n\t\t);\n\n\t\t/* @var WP_Sitemaps_Provider $provider */\n\t\tforeach ( $providers as $name => $provider ) {\n\t\t\t$this->registry->add_provider( $name, $provider );\n\t\t}\n\t}\n\n\t/**\n\t * Registers sitemap rewrite tags and routing rules.\n\t *\n\t * @since 5.5.0\n\t */\n\tpublic function register_rewrites() {\n\t\t// Add rewrite tags.\n\t\tadd_rewrite_tag( '%sitemap%', '([^?]+)' );\n\t\tadd_rewrite_tag( '%sitemap-subtype%', '([^?]+)' );\n\n\t\t// Register index route.\n\t\tadd_rewrite_rule( '^wp-sitemap\\.xml$', 'index.php?sitemap=index', 'top' );\n\n\t\t// Register rewrites for the XSL stylesheet.\n\t\tadd_rewrite_tag( '%sitemap-stylesheet%', '([^?]+)' );\n\t\tadd_rewrite_rule( '^wp-sitemap\\.xsl$', 'index.php?sitemap-stylesheet=sitemap', 'top' );\n\t\tadd_rewrite_rule( '^wp-sitemap-index\\.xsl$', 'index.php?sitemap-stylesheet=index', 'top' );\n\n\t\t// Register routes for providers.\n\t\tadd_rewrite_rule(\n\t\t\t'^wp-sitemap-([a-z]+?)-([a-z\\d_-]+?)-(\\d+?)\\.xml$',\n\t\t\t'index.php?sitemap=$matches[1]&sitemap-subtype=$matches[2]&paged=$matches[3]',\n\t\t\t'top'\n\t\t);\n\t\tadd_rewrite_rule(\n\t\t\t'^wp-sitemap-([a-z]+?)-(\\d+?)\\.xml$',\n\t\t\t'index.php?sitemap=$matches[1]&paged=$matches[2]',\n\t\t\t'top'\n\t\t);\n\t}\n\n\t/**\n\t * Renders sitemap templates based on rewrite rules.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @global WP_Query $wp_query WordPress Query object.\n\t */\n\tpublic function render_sitemaps() {\n\t\tglobal $wp_query;\n\n\t\t$sitemap         = sanitize_text_field( get_query_var( 'sitemap' ) );\n\t\t$object_subtype  = sanitize_text_field( get_query_var( 'sitemap-subtype' ) );\n\t\t$stylesheet_type = sanitize_text_field( get_query_var( 'sitemap-stylesheet' ) );\n\t\t$paged           = absint( get_query_var( 'paged' ) );\n\n\t\t// Bail early if this isn't a sitemap or stylesheet route.\n\t\tif ( ! ( $sitemap || $stylesheet_type ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $this->sitemaps_enabled() ) {\n\t\t\t$wp_query->set_404();\n\t\t\tstatus_header( 404 );\n\t\t\treturn;\n\t\t}\n\n\t\t// Render stylesheet if this is stylesheet route.\n\t\tif ( $stylesheet_type ) {\n\t\t\t$stylesheet = new WP_Sitemaps_Stylesheet();\n\n\t\t\t$stylesheet->render_stylesheet( $stylesheet_type );\n\t\t\texit;\n\t\t}\n\n\t\t// Render the index.\n\t\tif ( 'index' === $sitemap ) {\n\t\t\t$sitemap_list = $this->index->get_sitemap_list();\n\n\t\t\t$this->renderer->render_index( $sitemap_list );\n\t\t\texit;\n\t\t}\n\n\t\t$provider = $this->registry->get_provider( $sitemap );\n\n\t\tif ( ! $provider ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( empty( $paged ) ) {\n\t\t\t$paged = 1;\n\t\t}\n\n\t\t$url_list = $provider->get_url_list( $paged, $object_subtype );\n\n\t\t// Force a 404 and bail early if no URLs are present.\n\t\tif ( empty( $url_list ) ) {\n\t\t\t$wp_query->set_404();\n\t\t\tstatus_header( 404 );\n\t\t\treturn;\n\t\t}\n\n\t\t$this->renderer->render_sitemap( $url_list );\n\t\texit;\n\t}\n\n\t/**\n\t * Redirects a URL to the wp-sitemap.xml\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param bool     $bypass Pass-through of the pre_handle_404 filter value.\n\t * @param WP_Query $query  The WP_Query object.\n\t * @return bool Bypass value.\n\t */\n\tpublic function redirect_sitemapxml( $bypass, $query ) {\n\t\t// If a plugin has already utilized the pre_handle_404 function, return without action to avoid conflicts.\n\t\tif ( $bypass ) {\n\t\t\treturn $bypass;\n\t\t}\n\n\t\t// 'pagename' is for most permalink types, name is for when the %postname% is used as a top-level field.\n\t\tif ( 'sitemap-xml' === $query->get( 'pagename' )\n\t\t\t|| 'sitemap-xml' === $query->get( 'name' )\n\t\t) {\n\t\t\twp_safe_redirect( $this->index->get_index_url() );\n\t\t\texit();\n\t\t}\n\n\t\treturn $bypass;\n\t}\n\n\t/**\n\t * Adds the sitemap index to robots.txt.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $output robots.txt output.\n\t * @param bool   $public Whether the site is public.\n\t * @return string The robots.txt output.\n\t */\n\tpublic function add_robots( $output, $public ) {\n\t\tif ( $public ) {\n\t\t\t$output .= \"\\nSitemap: \" . esc_url( $this->index->get_index_url() ) . \"\\n\";\n\t\t}\n\n\t\treturn $output;\n\t}\n}\n", "num_lines": 264}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Sitemaps: WP_Sitemaps_Posts class\n *\n * Builds the sitemaps for the 'post' object type.\n *\n * @package WordPress\n * @subpackage Sitemaps\n * @since 5.5.0\n */\n\n/**\n * Posts XML sitemap provider.\n *\n * @since 5.5.0\n */\nclass WP_Sitemaps_Posts extends WP_Sitemaps_Provider {\n\t/**\n\t * WP_Sitemaps_Posts constructor.\n\t *\n\t * @since 5.5.0\n\t */\n\tpublic function __construct() {\n\t\t$this->name        = 'posts';\n\t\t$this->object_type = 'post';\n\t}\n\n\t/**\n\t * Returns the public post types, which excludes nav_items and similar types.\n\t * Attachments are also excluded. This includes custom post types with public = true.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return WP_Post_Type[] Array of registered post type objects keyed by their name.\n\t */\n\tpublic function get_object_subtypes() {\n\t\t$post_types = get_post_types( array( 'public' => true ), 'objects' );\n\t\tunset( $post_types['attachment'] );\n\n\t\t$post_types = array_filter( $post_types, 'is_post_type_viewable' );\n\n\t\t/**\n\t\t * Filters the list of post object sub types available within the sitemap.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param WP_Post_Type[] $post_types Array of registered post type objects keyed by their name.\n\t\t */\n\t\treturn apply_filters( 'wp_sitemaps_post_types', $post_types );\n\t}\n\n\t/**\n\t * Gets a URL list for a post type sitemap.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param int    $page_num  Page of results.\n\t * @param string $post_type Optional. Post type name. Default empty.\n\t * @return array Array of URLs for a sitemap.\n\t */\n\tpublic function get_url_list( $page_num, $post_type = '' ) {\n\t\t// Bail early if the queried post type is not supported.\n\t\t$supported_types = $this->get_object_subtypes();\n\n\t\tif ( ! isset( $supported_types[ $post_type ] ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t/**\n\t\t * Filters the posts URL list before it is generated.\n\t\t *\n\t\t * Passing a non-null value will effectively short-circuit the generation,\n\t\t * returning that value instead.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param array  $url_list  The URL list. Default null.\n\t\t * @param string $post_type Post type name.\n\t\t * @param int    $page_num  Page of results.\n\t\t */\n\t\t$url_list = apply_filters(\n\t\t\t'wp_sitemaps_posts_pre_url_list',\n\t\t\tnull,\n\t\t\t$post_type,\n\t\t\t$page_num\n\t\t);\n\n\t\tif ( null !== $url_list ) {\n\t\t\treturn $url_list;\n\t\t}\n\n\t\t$args          = $this->get_posts_query_args( $post_type );\n\t\t$args['paged'] = $page_num;\n\n\t\t$query = new WP_Query( $args );\n\n\t\t$url_list = array();\n\n\t\t/*\n\t\t * Add a URL for the homepage in the pages sitemap.\n\t\t * Shows only on the first page if the reading settings are set to display latest posts.\n\t\t */\n\t\tif ( 'page' === $post_type && 1 === $page_num && 'posts' === get_option( 'show_on_front' ) ) {\n\t\t\t// Extract the data needed for home URL to add to the array.\n\t\t\t$sitemap_entry = array(\n\t\t\t\t'loc' => home_url( '/' ),\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Filters the sitemap entry for the home page when the 'show_on_front' option equals 'posts'.\n\t\t\t *\n\t\t\t * @since 5.5.0\n\t\t\t *\n\t\t\t * @param array $sitemap_entry Sitemap entry for the home page.\n\t\t\t */\n\t\t\t$sitemap_entry = apply_filters( 'wp_sitemaps_posts_show_on_front_entry', $sitemap_entry );\n\t\t\t$url_list[]    = $sitemap_entry;\n\t\t}\n\n\t\tforeach ( $query->posts as $post ) {\n\t\t\t$sitemap_entry = array(\n\t\t\t\t'loc' => get_permalink( $post ),\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Filters the sitemap entry for an individual post.\n\t\t\t *\n\t\t\t * @since 5.5.0\n\t\t\t *\n\t\t\t * @param array   $sitemap_entry Sitemap entry for the post.\n\t\t\t * @param WP_Post $post          Post object.\n\t\t\t * @param string  $post_type     Name of the post_type.\n\t\t\t */\n\t\t\t$sitemap_entry = apply_filters( 'wp_sitemaps_posts_entry', $sitemap_entry, $post, $post_type );\n\t\t\t$url_list[]    = $sitemap_entry;\n\t\t}\n\n\t\treturn $url_list;\n\t}\n\n\t/**\n\t * Gets the max number of pages available for the object type.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $post_type Optional. Post type name. Default empty.\n\t * @return int Total number of pages.\n\t */\n\tpublic function get_max_num_pages( $post_type = '' ) {\n\t\tif ( empty( $post_type ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * Filters the max number of pages before it is generated.\n\t\t *\n\t\t * Passing a non-null value will short-circuit the generation,\n\t\t * returning that value instead.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param int|null $max_num_pages The maximum number of pages. Default null.\n\t\t * @param string   $post_type     Post type name.\n\t\t */\n\t\t$max_num_pages = apply_filters( 'wp_sitemaps_posts_pre_max_num_pages', null, $post_type );\n\n\t\tif ( null !== $max_num_pages ) {\n\t\t\treturn $max_num_pages;\n\t\t}\n\n\t\t$args                  = $this->get_posts_query_args( $post_type );\n\t\t$args['fields']        = 'ids';\n\t\t$args['no_found_rows'] = false;\n\n\t\t$query = new WP_Query( $args );\n\n\t\t$min_num_pages = ( 'page' === $post_type && 'posts' === get_option( 'show_on_front' ) ) ? 1 : 0;\n\t\treturn isset( $query->max_num_pages ) ? max( $min_num_pages, $query->max_num_pages ) : 1;\n\t}\n\n\t/**\n\t * Returns the query args for retrieving posts to list in the sitemap.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $post_type Post type name.\n\t * @return array Array of WP_Query arguments.\n\t */\n\tprotected function get_posts_query_args( $post_type ) {\n\t\t/**\n\t\t * Filters the query arguments for post type sitemap queries.\n\t\t *\n\t\t * @see WP_Query for a full list of arguments.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param array  $args      Array of WP_Query arguments.\n\t\t * @param string $post_type Post type name.\n\t\t */\n\t\t$args = apply_filters(\n\t\t\t'wp_sitemaps_posts_query_args',\n\t\t\tarray(\n\t\t\t\t'orderby'                => 'ID',\n\t\t\t\t'order'                  => 'ASC',\n\t\t\t\t'post_type'              => $post_type,\n\t\t\t\t'posts_per_page'         => wp_sitemaps_get_max_urls( $this->object_type ),\n\t\t\t\t'post_status'            => array( 'publish' ),\n\t\t\t\t'no_found_rows'          => true,\n\t\t\t\t'update_post_term_cache' => false,\n\t\t\t\t'update_post_meta_cache' => false,\n\t\t\t),\n\t\t\t$post_type\n\t\t);\n\n\t\treturn $args;\n\t}\n}\n", "num_lines": 218}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Sitemaps: WP_Sitemaps_Taxonomies class\n *\n * Builds the sitemaps for the 'taxonomy' object type.\n *\n * @package WordPress\n * @subpackage Sitemaps\n * @since 5.5.0\n */\n\n/**\n * Taxonomies XML sitemap provider.\n *\n * @since 5.5.0\n */\nclass WP_Sitemaps_Taxonomies extends WP_Sitemaps_Provider {\n\t/**\n\t * WP_Sitemaps_Taxonomies constructor.\n\t *\n\t * @since 5.5.0\n\t */\n\tpublic function __construct() {\n\t\t$this->name        = 'taxonomies';\n\t\t$this->object_type = 'term';\n\t}\n\n\t/**\n\t * Returns all public, registered taxonomies.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return WP_Taxonomy[] Array of registered taxonomy objects keyed by their name.\n\t */\n\tpublic function get_object_subtypes() {\n\t\t$taxonomies = get_taxonomies( array( 'public' => true ), 'objects' );\n\n\t\t$taxonomies = array_filter( $taxonomies, 'is_taxonomy_viewable' );\n\n\t\t/**\n\t\t * Filter the list of taxonomy object subtypes available within the sitemap.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param WP_Taxonomy[] $taxonomies Array of registered taxonomy objects keyed by their name.\n\t\t */\n\t\treturn apply_filters( 'wp_sitemaps_taxonomies', $taxonomies );\n\t}\n\n\t/**\n\t * Gets a URL list for a taxonomy sitemap.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param int    $page_num Page of results.\n\t * @param string $taxonomy Optional. Taxonomy name. Default empty.\n\t * @return array Array of URLs for a sitemap.\n\t */\n\tpublic function get_url_list( $page_num, $taxonomy = '' ) {\n\t\t$supported_types = $this->get_object_subtypes();\n\n\t\t// Bail early if the queried taxonomy is not supported.\n\t\tif ( ! isset( $supported_types[ $taxonomy ] ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t/**\n\t\t * Filters the taxonomies URL list before it is generated.\n\t\t *\n\t\t * Passing a non-null value will effectively short-circuit the generation,\n\t\t * returning that value instead.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param array  $url_list The URL list. Default null.\n\t\t * @param string $taxonomy Taxonomy name.\n\t\t * @param int    $page_num Page of results.\n\t\t */\n\t\t$url_list = apply_filters(\n\t\t\t'wp_sitemaps_taxonomies_pre_url_list',\n\t\t\tnull,\n\t\t\t$taxonomy,\n\t\t\t$page_num\n\t\t);\n\n\t\tif ( null !== $url_list ) {\n\t\t\treturn $url_list;\n\t\t}\n\n\t\t$url_list = array();\n\n\t\t// Offset by how many terms should be included in previous pages.\n\t\t$offset = ( $page_num - 1 ) * wp_sitemaps_get_max_urls( $this->object_type );\n\n\t\t$args           = $this->get_taxonomies_query_args( $taxonomy );\n\t\t$args['offset'] = $offset;\n\n\t\t$taxonomy_terms = new WP_Term_Query( $args );\n\n\t\tif ( ! empty( $taxonomy_terms->terms ) ) {\n\t\t\tforeach ( $taxonomy_terms->terms as $term ) {\n\t\t\t\t$sitemap_entry = array(\n\t\t\t\t\t'loc' => get_term_link( $term ),\n\t\t\t\t);\n\n\t\t\t\t/**\n\t\t\t\t * Filters the sitemap entry for an individual term.\n\t\t\t\t *\n\t\t\t\t * @since 5.5.0\n\t\t\t\t *\n\t\t\t\t * @param array   $sitemap_entry Sitemap entry for the term.\n\t\t\t\t * @param WP_Term $term          Term object.\n\t\t\t\t * @param string  $taxonomy      Taxonomy name.\n\t\t\t\t */\n\t\t\t\t$sitemap_entry = apply_filters( 'wp_sitemaps_taxonomies_entry', $sitemap_entry, $term, $taxonomy );\n\t\t\t\t$url_list[]    = $sitemap_entry;\n\t\t\t}\n\t\t}\n\n\t\treturn $url_list;\n\t}\n\n\t/**\n\t * Gets the max number of pages available for the object type.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $taxonomy Taxonomy name.\n\t * @return int Total number of pages.\n\t */\n\tpublic function get_max_num_pages( $taxonomy = '' ) {\n\t\tif ( empty( $taxonomy ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * Filters the max number of pages before it is generated.\n\t\t *\n\t\t * Passing a non-null value will short-circuit the generation,\n\t\t * returning that value instead.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param int    $max_num_pages The maximum number of pages. Default null.\n\t\t * @param string $taxonomy      Taxonomy name.\n\t\t */\n\t\t$max_num_pages = apply_filters( 'wp_sitemaps_taxonomies_pre_max_num_pages', null, $taxonomy );\n\n\t\tif ( null !== $max_num_pages ) {\n\t\t\treturn $max_num_pages;\n\t\t}\n\n\t\t$term_count = wp_count_terms( $taxonomy, $this->get_taxonomies_query_args( $taxonomy ) );\n\n\t\treturn (int) ceil( $term_count / wp_sitemaps_get_max_urls( $this->object_type ) );\n\t}\n\n\t/**\n\t * Returns the query args for retrieving taxonomy terms to list in the sitemap.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param string $taxonomy Taxonomy name.\n\t * @return array Array of WP_Term_Query arguments.\n\t */\n\tprotected function get_taxonomies_query_args( $taxonomy ) {\n\t\t/**\n\t\t * Filters the taxonomy terms query arguments.\n\t\t *\n\t\t * Allows modification of the taxonomy query arguments before querying.\n\t\t *\n\t\t * @see WP_Term_Query for a full list of arguments\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param array  $args     Array of WP_Term_Query arguments.\n\t\t * @param string $taxonomy Taxonomy name.\n\t\t */\n\t\t$args = apply_filters(\n\t\t\t'wp_sitemaps_taxonomies_query_args',\n\t\t\tarray(\n\t\t\t\t'fields'                 => 'ids',\n\t\t\t\t'taxonomy'               => $taxonomy,\n\t\t\t\t'orderby'                => 'term_order',\n\t\t\t\t'number'                 => wp_sitemaps_get_max_urls( $this->object_type ),\n\t\t\t\t'hide_empty'             => true,\n\t\t\t\t'hierarchical'           => false,\n\t\t\t\t'update_term_meta_cache' => false,\n\t\t\t),\n\t\t\t$taxonomy\n\t\t);\n\n\t\treturn $args;\n\t}\n}\n", "num_lines": 196}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Sitemaps: WP_Sitemaps_Users class\n *\n * Builds the sitemaps for the 'user' object type.\n *\n * @package WordPress\n * @subpackage Sitemaps\n * @since 5.5.0\n */\n\n/**\n * Users XML sitemap provider.\n *\n * @since 5.5.0\n */\nclass WP_Sitemaps_Users extends WP_Sitemaps_Provider {\n\t/**\n\t * WP_Sitemaps_Users constructor.\n\t *\n\t * @since 5.5.0\n\t */\n\tpublic function __construct() {\n\t\t$this->name        = 'users';\n\t\t$this->object_type = 'user';\n\t}\n\n\t/**\n\t * Gets a URL list for a user sitemap.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @param int    $page_num       Page of results.\n\t * @param string $object_subtype Optional. Not applicable for Users but\n\t *                               required for compatibility with the parent\n\t *                               provider class. Default empty.\n\t * @return array Array of URLs for a sitemap.\n\t */\n\tpublic function get_url_list( $page_num, $object_subtype = '' ) {\n\t\t/**\n\t\t * Filters the users URL list before it is generated.\n\t\t *\n\t\t * Passing a non-null value will effectively short-circuit the generation,\n\t\t * returning that value instead.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param array  $url_list The URL list. Default null.\n\t\t * @param int    $page_num Page of results.\n\t\t */\n\t\t$url_list = apply_filters(\n\t\t\t'wp_sitemaps_users_pre_url_list',\n\t\t\tnull,\n\t\t\t$page_num\n\t\t);\n\n\t\tif ( null !== $url_list ) {\n\t\t\treturn $url_list;\n\t\t}\n\n\t\t$args          = $this->get_users_query_args();\n\t\t$args['paged'] = $page_num;\n\n\t\t$query    = new WP_User_Query( $args );\n\t\t$users    = $query->get_results();\n\t\t$url_list = array();\n\n\t\tforeach ( $users as $user ) {\n\t\t\t$sitemap_entry = array(\n\t\t\t\t'loc' => get_author_posts_url( $user->ID ),\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Filters the sitemap entry for an individual user.\n\t\t\t *\n\t\t\t * @since 5.5.0\n\t\t\t *\n\t\t\t * @param array   $sitemap_entry Sitemap entry for the user.\n\t\t\t * @param WP_User $user          User object.\n\t\t\t */\n\t\t\t$sitemap_entry = apply_filters( 'wp_sitemaps_users_entry', $sitemap_entry, $user );\n\t\t\t$url_list[]    = $sitemap_entry;\n\t\t}\n\n\t\treturn $url_list;\n\t}\n\n\t/**\n\t * Gets the max number of pages available for the object type.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @see WP_Sitemaps_Provider::max_num_pages\n\t *\n\t * @param string $object_subtype Optional. Not applicable for Users but\n\t *                               required for compatibility with the parent\n\t *                               provider class. Default empty.\n\t * @return int Total page count.\n\t */\n\tpublic function get_max_num_pages( $object_subtype = '' ) {\n\t\t/**\n\t\t * Filters the max number of pages before it is generated.\n\t\t *\n\t\t * Passing a non-null value will effectively short-circuit the generation,\n\t\t * returning that value instead.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param int $max_num_pages The maximum number of pages. Default null.\n\t\t */\n\t\t$max_num_pages = apply_filters( 'wp_sitemaps_users_pre_max_num_pages', null );\n\n\t\tif ( null !== $max_num_pages ) {\n\t\t\treturn $max_num_pages;\n\t\t}\n\n\t\t$args  = $this->get_users_query_args();\n\t\t$query = new WP_User_Query( $args );\n\n\t\t$total_users = $query->get_total();\n\n\t\treturn (int) ceil( $total_users / wp_sitemaps_get_max_urls( $this->object_type ) );\n\t}\n\n\t/**\n\t * Returns the query args for retrieving users to list in the sitemap.\n\t *\n\t * @since 5.5.0\n\t *\n\t * @return array Array of WP_User_Query arguments.\n\t */\n\tprotected function get_users_query_args() {\n\t\t$public_post_types = get_post_types(\n\t\t\tarray(\n\t\t\t\t'public' => true,\n\t\t\t)\n\t\t);\n\n\t\t// We're not supporting sitemaps for author pages for attachments.\n\t\tunset( $public_post_types['attachment'] );\n\n\t\t/**\n\t\t * Filters the query arguments for authors with public posts.\n\t\t *\n\t\t * Allows modification of the authors query arguments before querying.\n\t\t *\n\t\t * @see WP_User_Query for a full list of arguments\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param array $args Array of WP_User_Query arguments.\n\t\t */\n\t\t$args = apply_filters(\n\t\t\t'wp_sitemaps_users_query_args',\n\t\t\tarray(\n\t\t\t\t'has_published_posts' => array_keys( $public_post_types ),\n\t\t\t\t'number'              => wp_sitemaps_get_max_urls( $this->object_type ),\n\t\t\t)\n\t\t);\n\n\t\treturn $args;\n\t}\n}\n", "num_lines": 164}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (!is_callable('sodiumCompatAutoloader')) {\n    /**\n     * Sodium_Compat autoloader.\n     *\n     * @param string $class Class name to be autoloaded.\n     *\n     * @return bool         Stop autoloading?\n     */\n    function sodiumCompatAutoloader($class)\n    {\n        $namespace = 'ParagonIE_Sodium_';\n        // Does the class use the namespace prefix?\n        $len = strlen($namespace);\n        if (strncmp($namespace, $class, $len) !== 0) {\n            // no, move to the next registered autoloader\n            return false;\n        }\n\n        // Get the relative class name\n        $relative_class = substr($class, $len);\n\n        // Replace the namespace prefix with the base directory, replace namespace\n        // separators with directory separators in the relative class name, append\n        // with .php\n        $file = dirname(__FILE__) . '/src/' . str_replace('_', '/', $relative_class) . '.php';\n        // if the file exists, require it\n        if (file_exists($file)) {\n            require_once $file;\n            return true;\n        }\n        return false;\n    }\n\n    // Now that we have an autoloader, let's register it!\n    spl_autoload_register('sodiumCompatAutoloader');\n}\n\nrequire_once dirname(__FILE__) . '/src/SodiumException.php';\nif (PHP_VERSION_ID >= 50300) {\n    // Namespaces didn't exist before 5.3.0, so don't even try to use this\n    // unless PHP >= 5.3.0\n    require_once dirname(__FILE__) . '/lib/namespaced.php';\n    require_once dirname(__FILE__) . '/lib/sodium_compat.php';\n} else {\n    require_once dirname(__FILE__) . '/src/PHP52/SplFixedArray.php';\n}\nif (PHP_VERSION_ID < 70200 || !extension_loaded('sodium')) {\n    if (PHP_VERSION_ID >= 50300 && !defined('SODIUM_CRYPTO_SCALARMULT_BYTES')) {\n        require_once dirname(__FILE__) . '/lib/php72compat_const.php';\n    }\n    if (PHP_VERSION_ID >= 70000) {\n        assert(class_exists('ParagonIE_Sodium_Compat'), 'Possible filesystem/autoloader bug?');\n    } else {\n        assert(class_exists('ParagonIE_Sodium_Compat'));\n    }\n    require_once (dirname(__FILE__) . '/lib/php72compat.php');\n}\n", "num_lines": 60}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace Sodium;\n\nrequire_once dirname(dirname(__FILE__)) . '/autoload.php';\n\nuse ParagonIE_Sodium_Compat;\n\nconst CRYPTO_AEAD_AES256GCM_KEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_AES256GCM_KEYBYTES;\nconst CRYPTO_AEAD_AES256GCM_NSECBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_AES256GCM_NSECBYTES;\nconst CRYPTO_AEAD_AES256GCM_NPUBBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_AES256GCM_NPUBBYTES;\nconst CRYPTO_AEAD_AES256GCM_ABYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_AES256GCM_ABYTES;\nconst CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES;\nconst CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES;\nconst CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES;\nconst CRYPTO_AEAD_CHACHA20POLY1305_ABYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_CHACHA20POLY1305_ABYTES;\nconst CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES;\nconst CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES;\nconst CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES;\nconst CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES;\nconst CRYPTO_AUTH_BYTES = ParagonIE_Sodium_Compat::CRYPTO_AUTH_BYTES;\nconst CRYPTO_AUTH_KEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_AUTH_KEYBYTES;\nconst CRYPTO_BOX_SEALBYTES = ParagonIE_Sodium_Compat::CRYPTO_BOX_SEALBYTES;\nconst CRYPTO_BOX_SECRETKEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES;\nconst CRYPTO_BOX_PUBLICKEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_BOX_PUBLICKEYBYTES;\nconst CRYPTO_BOX_KEYPAIRBYTES = ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES;\nconst CRYPTO_BOX_MACBYTES = ParagonIE_Sodium_Compat::CRYPTO_BOX_MACBYTES;\nconst CRYPTO_BOX_NONCEBYTES = ParagonIE_Sodium_Compat::CRYPTO_BOX_NONCEBYTES;\nconst CRYPTO_BOX_SEEDBYTES = ParagonIE_Sodium_Compat::CRYPTO_BOX_SEEDBYTES;\nconst CRYPTO_KX_BYTES = ParagonIE_Sodium_Compat::CRYPTO_KX_BYTES;\nconst CRYPTO_KX_SEEDBYTES = ParagonIE_Sodium_Compat::CRYPTO_KX_SEEDBYTES;\nconst CRYPTO_KX_PUBLICKEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_KX_PUBLICKEYBYTES;\nconst CRYPTO_KX_SECRETKEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_KX_SECRETKEYBYTES;\nconst CRYPTO_GENERICHASH_BYTES = ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_BYTES;\nconst CRYPTO_GENERICHASH_BYTES_MIN = ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_BYTES_MIN;\nconst CRYPTO_GENERICHASH_BYTES_MAX = ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_BYTES_MAX;\nconst CRYPTO_GENERICHASH_KEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_KEYBYTES;\nconst CRYPTO_GENERICHASH_KEYBYTES_MIN = ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_KEYBYTES_MIN;\nconst CRYPTO_GENERICHASH_KEYBYTES_MAX = ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_KEYBYTES_MAX;\nconst CRYPTO_SCALARMULT_BYTES = ParagonIE_Sodium_Compat::CRYPTO_SCALARMULT_BYTES;\nconst CRYPTO_SCALARMULT_SCALARBYTES = ParagonIE_Sodium_Compat::CRYPTO_SCALARMULT_SCALARBYTES;\nconst CRYPTO_SHORTHASH_BYTES = ParagonIE_Sodium_Compat::CRYPTO_SHORTHASH_BYTES;\nconst CRYPTO_SHORTHASH_KEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_SHORTHASH_KEYBYTES;\nconst CRYPTO_SECRETBOX_KEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_KEYBYTES;\nconst CRYPTO_SECRETBOX_MACBYTES = ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_MACBYTES;\nconst CRYPTO_SECRETBOX_NONCEBYTES = ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_NONCEBYTES;\nconst CRYPTO_SIGN_BYTES = ParagonIE_Sodium_Compat::CRYPTO_SIGN_BYTES;\nconst CRYPTO_SIGN_SEEDBYTES = ParagonIE_Sodium_Compat::CRYPTO_SIGN_SEEDBYTES;\nconst CRYPTO_SIGN_PUBLICKEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_SIGN_PUBLICKEYBYTES;\nconst CRYPTO_SIGN_SECRETKEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_SIGN_SECRETKEYBYTES;\nconst CRYPTO_SIGN_KEYPAIRBYTES = ParagonIE_Sodium_Compat::CRYPTO_SIGN_KEYPAIRBYTES;\nconst CRYPTO_STREAM_KEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_STREAM_KEYBYTES;\nconst CRYPTO_STREAM_NONCEBYTES = ParagonIE_Sodium_Compat::CRYPTO_STREAM_NONCEBYTES;\n", "num_lines": 53}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nrequire_once dirname(dirname(__FILE__)) . '/autoload.php';\n\nif (PHP_VERSION_ID < 50300) {\n    return;\n}\n\n/*\n * This file is just for convenience, to allow developers to reduce verbosity when\n * they add this project to their libraries.\n *\n * Replace this:\n *\n * $x = ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_encrypt(...$args);\n *\n * with this:\n *\n * use ParagonIE\\Sodium\\Compat;\n *\n * $x = Compat::crypto_aead_xchacha20poly1305_encrypt(...$args);\n */\nspl_autoload_register(function ($class) {\n    if ($class[0] === '\\\\') {\n        $class = substr($class, 1);\n    }\n    $namespace = 'ParagonIE\\\\Sodium';\n    // Does the class use the namespace prefix?\n    $len = strlen($namespace);\n    if (strncmp($namespace, $class, $len) !== 0) {\n        // no, move to the next registered autoloader\n        return false;\n    }\n\n    // Get the relative class name\n    $relative_class = substr($class, $len);\n\n    // Replace the namespace prefix with the base directory, replace namespace\n    // separators with directory separators in the relative class name, append\n    // with .php\n    $file = dirname(dirname(__FILE__)) . '/namespaced/' . str_replace('\\\\', '/', $relative_class) . '.php';\n    // if the file exists, require it\n    if (file_exists($file)) {\n        require_once $file;\n        return true;\n    }\n    return false;\n});\n", "num_lines": 49}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nrequire_once dirname(dirname(__FILE__)) . '/autoload.php';\n\n/**\n * This file will monkey patch the pure-PHP implementation in place of the\n * PECL functions and constants, but only if they do not already exist.\n *\n * Thus, the functions or constants just proxy to the appropriate\n * ParagonIE_Sodium_Compat method or class constant, respectively.\n */\nforeach (array(\n    'BASE64_VARIANT_ORIGINAL',\n    'BASE64_VARIANT_ORIGINAL_NO_PADDING',\n    'BASE64_VARIANT_URLSAFE',\n    'BASE64_VARIANT_URLSAFE_NO_PADDING',\n    'CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES',\n    'CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES',\n    'CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES',\n    'CRYPTO_AEAD_CHACHA20POLY1305_ABYTES',\n    'CRYPTO_AEAD_AES256GCM_KEYBYTES',\n    'CRYPTO_AEAD_AES256GCM_NSECBYTES',\n    'CRYPTO_AEAD_AES256GCM_NPUBBYTES',\n    'CRYPTO_AEAD_AES256GCM_ABYTES',\n    'CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES',\n    'CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES',\n    'CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES',\n    'CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES',\n    'CRYPTO_AUTH_BYTES',\n    'CRYPTO_AUTH_KEYBYTES',\n    'CRYPTO_BOX_SEALBYTES',\n    'CRYPTO_BOX_SECRETKEYBYTES',\n    'CRYPTO_BOX_PUBLICKEYBYTES',\n    'CRYPTO_BOX_KEYPAIRBYTES',\n    'CRYPTO_BOX_MACBYTES',\n    'CRYPTO_BOX_NONCEBYTES',\n    'CRYPTO_BOX_SEEDBYTES',\n    'CRYPTO_KDF_BYTES_MIN',\n    'CRYPTO_KDF_BYTES_MAX',\n    'CRYPTO_KDF_CONTEXTBYTES',\n    'CRYPTO_KDF_KEYBYTES',\n    'CRYPTO_KX_BYTES',\n    'CRYPTO_KX_KEYPAIRBYTES',\n    'CRYPTO_KX_PRIMITIVE',\n    'CRYPTO_KX_SEEDBYTES',\n    'CRYPTO_KX_PUBLICKEYBYTES',\n    'CRYPTO_KX_SECRETKEYBYTES',\n    'CRYPTO_KX_SESSIONKEYBYTES',\n    'CRYPTO_GENERICHASH_BYTES',\n    'CRYPTO_GENERICHASH_BYTES_MIN',\n    'CRYPTO_GENERICHASH_BYTES_MAX',\n    'CRYPTO_GENERICHASH_KEYBYTES',\n    'CRYPTO_GENERICHASH_KEYBYTES_MIN',\n    'CRYPTO_GENERICHASH_KEYBYTES_MAX',\n    'CRYPTO_PWHASH_SALTBYTES',\n    'CRYPTO_PWHASH_STRPREFIX',\n    'CRYPTO_PWHASH_ALG_ARGON2I13',\n    'CRYPTO_PWHASH_ALG_ARGON2ID13',\n    'CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE',\n    'CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE',\n    'CRYPTO_PWHASH_MEMLIMIT_MODERATE',\n    'CRYPTO_PWHASH_OPSLIMIT_MODERATE',\n    'CRYPTO_PWHASH_MEMLIMIT_SENSITIVE',\n    'CRYPTO_PWHASH_OPSLIMIT_SENSITIVE',\n    'CRYPTO_SCALARMULT_BYTES',\n    'CRYPTO_SCALARMULT_SCALARBYTES',\n    'CRYPTO_SHORTHASH_BYTES',\n    'CRYPTO_SHORTHASH_KEYBYTES',\n    'CRYPTO_SECRETBOX_KEYBYTES',\n    'CRYPTO_SECRETBOX_MACBYTES',\n    'CRYPTO_SECRETBOX_NONCEBYTES',\n    'CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES',\n    'CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES',\n    'CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES',\n    'CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH',\n    'CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL',\n    'CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY',\n    'CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL',\n    'CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX',\n    'CRYPTO_SIGN_BYTES',\n    'CRYPTO_SIGN_SEEDBYTES',\n    'CRYPTO_SIGN_PUBLICKEYBYTES',\n    'CRYPTO_SIGN_SECRETKEYBYTES',\n    'CRYPTO_SIGN_KEYPAIRBYTES',\n    'CRYPTO_STREAM_KEYBYTES',\n    'CRYPTO_STREAM_NONCEBYTES',\n    'LIBRARY_VERSION_MAJOR',\n    'LIBRARY_VERSION_MINOR',\n    'VERSION_STRING'\n    ) as $constant\n) {\n    if (!defined(\"SODIUM_$constant\") && defined(\"ParagonIE_Sodium_Compat::$constant\")) {\n        define(\"SODIUM_$constant\", constant(\"ParagonIE_Sodium_Compat::$constant\"));\n    }\n}\nif (!is_callable('sodium_add')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::add()\n     * @param string $val\n     * @param string $addv\n     * @return void\n     * @throws SodiumException\n     */\n    function sodium_add(&$val, $addv)\n    {\n        ParagonIE_Sodium_Compat::add($val, $addv);\n    }\n}\nif (!is_callable('sodium_base642bin')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::bin2base64()\n     * @param string $string\n     * @param int $variant\n     * @param string $ignore\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_base642bin($string, $variant, $ignore ='')\n    {\n        return ParagonIE_Sodium_Compat::base642bin($string, $variant, $ignore);\n    }\n}\nif (!is_callable('sodium_bin2base64')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::bin2base64()\n     * @param string $string\n     * @param int $variant\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_bin2base64($string, $variant)\n    {\n        return ParagonIE_Sodium_Compat::bin2base64($string, $variant);\n    }\n}\nif (!is_callable('sodium_bin2hex')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::hex2bin()\n     * @param string $string\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_bin2hex($string)\n    {\n        return ParagonIE_Sodium_Compat::bin2hex($string);\n    }\n}\nif (!is_callable('sodium_compare')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::compare()\n     * @param string $a\n     * @param string $b\n     * @return int\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_compare($a, $b)\n    {\n        return ParagonIE_Sodium_Compat::compare($a, $b);\n    }\n}\nif (!is_callable('sodium_crypto_aead_aes256gcm_decrypt')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt()\n     * @param string $message\n     * @param string $assocData\n     * @param string $nonce\n     * @param string $key\n     * @return string|bool\n     */\n    function sodium_crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key)\n    {\n        try {\n            return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key);\n        } catch (Error $ex) {\n            return false;\n        } catch (Exception $ex) {\n            return false;\n        }\n    }\n}\nif (!is_callable('sodium_crypto_aead_aes256gcm_encrypt')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt()\n     * @param string $message\n     * @param string $assocData\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_aead_aes256gcm_encrypt($message, $assocData, $nonce, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt($message, $assocData, $nonce, $key);\n    }\n}\nif (!is_callable('sodium_crypto_aead_aes256gcm_is_available')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_is_available()\n     * @return bool\n     */\n    function sodium_crypto_aead_aes256gcm_is_available()\n    {\n        return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_is_available();\n    }\n}\nif (!is_callable('sodium_crypto_aead_chacha20poly1305_decrypt')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt()\n     * @param string $message\n     * @param string $assocData\n     * @param string $nonce\n     * @param string $key\n     * @return string|bool\n     */\n    function sodium_crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key)\n    {\n        try {\n            return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key);\n        } catch (Error $ex) {\n            return false;\n        } catch (Exception $ex) {\n            return false;\n        }\n    }\n}\nif (!is_callable('sodium_crypto_aead_chacha20poly1305_encrypt')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt()\n     * @param string $message\n     * @param string $assocData\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_aead_chacha20poly1305_encrypt($message, $assocData, $nonce, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt($message, $assocData, $nonce, $key);\n    }\n}\nif (!is_callable('sodium_crypto_aead_chacha20poly1305_keygen')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_keygen()\n     * @return string\n     * @throws Exception\n     */\n    function sodium_crypto_aead_chacha20poly1305_keygen()\n    {\n        return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_keygen();\n    }\n}\nif (!is_callable('sodium_crypto_aead_chacha20poly1305_ietf_decrypt')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt()\n     * @param string $message\n     * @param string $assocData\n     * @param string $nonce\n     * @param string $key\n     * @return string|bool\n     */\n    function sodium_crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key)\n    {\n        try {\n            return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key);\n        } catch (Error $ex) {\n            return false;\n        } catch (Exception $ex) {\n            return false;\n        }\n    }\n}\nif (!is_callable('sodium_crypto_aead_chacha20poly1305_ietf_encrypt')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt()\n     * @param string $message\n     * @param string $assocData\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_aead_chacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key);\n    }\n}\nif (!is_callable('sodium_crypto_aead_chacha20poly1305_ietf_keygen')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_keygen()\n     * @return string\n     * @throws Exception\n     */\n    function sodium_crypto_aead_chacha20poly1305_ietf_keygen()\n    {\n        return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_keygen();\n    }\n}\nif (!is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_decrypt')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_decrypt()\n     * @param string $message\n     * @param string $assocData\n     * @param string $nonce\n     * @param string $key\n     * @return string|bool\n     */\n    function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key)\n    {\n        try {\n            return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key, true);\n        } catch (Error $ex) {\n            return false;\n        } catch (Exception $ex) {\n            return false;\n        }\n    }\n}\nif (!is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_encrypt')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_encrypt()\n     * @param string $message\n     * @param string $assocData\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_aead_xchacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key, true);\n    }\n}\nif (!is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_keygen')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_keygen()\n     * @return string\n     * @throws Exception\n     */\n    function sodium_crypto_aead_xchacha20poly1305_ietf_keygen()\n    {\n        return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_keygen();\n    }\n}\nif (!is_callable('sodium_crypto_auth')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_auth()\n     * @param string $message\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_auth($message, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_auth($message, $key);\n    }\n}\nif (!is_callable('sodium_crypto_auth_keygen')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_auth_keygen()\n     * @return string\n     * @throws Exception\n     */\n    function sodium_crypto_auth_keygen()\n    {\n        return ParagonIE_Sodium_Compat::crypto_auth_keygen();\n    }\n}\nif (!is_callable('sodium_crypto_auth_verify')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_auth_verify()\n     * @param string $mac\n     * @param string $message\n     * @param string $key\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_auth_verify($mac, $message, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_auth_verify($mac, $message, $key);\n    }\n}\nif (!is_callable('sodium_crypto_box')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box()\n     * @param string $message\n     * @param string $nonce\n     * @param string $kp\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_box($message, $nonce, $kp)\n    {\n        return ParagonIE_Sodium_Compat::crypto_box($message, $nonce, $kp);\n    }\n}\nif (!is_callable('sodium_crypto_box_keypair')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_keypair()\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_box_keypair()\n    {\n        return ParagonIE_Sodium_Compat::crypto_box_keypair();\n    }\n}\nif (!is_callable('sodium_crypto_box_keypair_from_secretkey_and_publickey')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey()\n     * @param string $sk\n     * @param string $pk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_box_keypair_from_secretkey_and_publickey($sk, $pk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey($sk, $pk);\n    }\n}\nif (!is_callable('sodium_crypto_box_open')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_open()\n     * @param string $message\n     * @param string $nonce\n     * @param string $kp\n     * @return string|bool\n     */\n    function sodium_crypto_box_open($message, $nonce, $kp)\n    {\n        try {\n            return ParagonIE_Sodium_Compat::crypto_box_open($message, $nonce, $kp);\n        } catch (Error $ex) {\n            return false;\n        } catch (Exception $ex) {\n            return false;\n        }\n    }\n}\nif (!is_callable('sodium_crypto_box_publickey')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_publickey()\n     * @param string $keypair\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_box_publickey($keypair)\n    {\n        return ParagonIE_Sodium_Compat::crypto_box_publickey($keypair);\n    }\n}\nif (!is_callable('sodium_crypto_box_publickey_from_secretkey')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey()\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_box_publickey_from_secretkey($sk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey($sk);\n    }\n}\nif (!is_callable('sodium_crypto_box_seal')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_seal()\n     * @param string $message\n     * @param string $publicKey\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_box_seal($message, $publicKey)\n    {\n        return ParagonIE_Sodium_Compat::crypto_box_seal($message, $publicKey);\n    }\n}\nif (!is_callable('sodium_crypto_box_seal_open')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_seal_open()\n     * @param string $message\n     * @param string $kp\n     * @return string|bool\n     * @throws SodiumException\n     */\n    function sodium_crypto_box_seal_open($message, $kp)\n    {\n        try {\n            return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $kp);\n        } catch (SodiumException $ex) {\n            if ($ex->getMessage() === 'Argument 2 must be CRYPTO_BOX_KEYPAIRBYTES long.') {\n                throw $ex;\n            }\n            return false;\n        }\n    }\n}\nif (!is_callable('sodium_crypto_box_secretkey')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_secretkey()\n     * @param string $keypair\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_box_secretkey($keypair)\n    {\n        return ParagonIE_Sodium_Compat::crypto_box_secretkey($keypair);\n    }\n}\nif (!is_callable('sodium_crypto_box_seed_keypair')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_seed_keypair()\n     * @param string $seed\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_box_seed_keypair($seed)\n    {\n        return ParagonIE_Sodium_Compat::crypto_box_seed_keypair($seed);\n    }\n}\nif (!is_callable('sodium_crypto_generichash')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_generichash()\n     * @param string $message\n     * @param string|null $key\n     * @param int $outLen\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_generichash($message, $key = null, $outLen = 32)\n    {\n        return ParagonIE_Sodium_Compat::crypto_generichash($message, $key, $outLen);\n    }\n}\nif (!is_callable('sodium_crypto_generichash_final')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_generichash_final()\n     * @param string|null $ctx\n     * @param int $outputLength\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_generichash_final(&$ctx, $outputLength = 32)\n    {\n        return ParagonIE_Sodium_Compat::crypto_generichash_final($ctx, $outputLength);\n    }\n}\nif (!is_callable('sodium_crypto_generichash_init')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_generichash_init()\n     * @param string|null $key\n     * @param int $outLen\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_generichash_init($key = null, $outLen = 32)\n    {\n        return ParagonIE_Sodium_Compat::crypto_generichash_init($key, $outLen);\n    }\n}\nif (!is_callable('sodium_crypto_generichash_keygen')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_generichash_keygen()\n     * @return string\n     * @throws Exception\n     */\n    function sodium_crypto_generichash_keygen()\n    {\n        return ParagonIE_Sodium_Compat::crypto_generichash_keygen();\n    }\n}\nif (!is_callable('sodium_crypto_generichash_update')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_generichash_update()\n     * @param string|null $ctx\n     * @param string $message\n     * @return void\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_generichash_update(&$ctx, $message = '')\n    {\n        ParagonIE_Sodium_Compat::crypto_generichash_update($ctx, $message);\n    }\n}\nif (!is_callable('sodium_crypto_kdf_keygen')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_kdf_keygen()\n     * @return string\n     * @throws Exception\n     */\n    function sodium_crypto_kdf_keygen()\n    {\n        return ParagonIE_Sodium_Compat::crypto_kdf_keygen();\n    }\n}\nif (!is_callable('sodium_crypto_kdf_derive_from_key')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_kdf_derive_from_key()\n     * @param int $subkey_len\n     * @param int $subkey_id\n     * @param string $context\n     * @param string $key\n     * @return string\n     * @throws Exception\n     */\n    function sodium_crypto_kdf_derive_from_key($subkey_len, $subkey_id, $context, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_kdf_derive_from_key(\n            $subkey_len,\n            $subkey_id,\n            $context,\n            $key\n        );\n    }\n}\nif (!is_callable('sodium_crypto_kx')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_kx()\n     * @param string $my_secret\n     * @param string $their_public\n     * @param string $client_public\n     * @param string $server_public\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_kx($my_secret, $their_public, $client_public, $server_public)\n    {\n        return ParagonIE_Sodium_Compat::crypto_kx(\n            $my_secret,\n            $their_public,\n            $client_public,\n            $server_public\n        );\n    }\n}\nif (!is_callable('sodium_crypto_kx_seed_keypair')) {\n    /**\n     * @param string $seed\n     * @return string\n     * @throws Exception\n     */\n    function sodium_crypto_kx_seed_keypair($seed)\n    {\n        return ParagonIE_Sodium_Compat::crypto_kx_seed_keypair($seed);\n    }\n}\nif (!is_callable('sodium_crypto_kx_keypair')) {\n    /**\n     * @return string\n     * @throws Exception\n     */\n    function sodium_crypto_kx_keypair()\n    {\n        return ParagonIE_Sodium_Compat::crypto_kx_keypair();\n    }\n}\nif (!is_callable('sodium_crypto_kx_client_session_keys')) {\n    /**\n     * @param string $keypair\n     * @param string $serverPublicKey\n     * @return array{0: string, 1: string}\n     * @throws SodiumException\n     */\n    function sodium_crypto_kx_client_session_keys($keypair, $serverPublicKey)\n    {\n        return ParagonIE_Sodium_Compat::crypto_kx_client_session_keys($keypair, $serverPublicKey);\n    }\n}\nif (!is_callable('sodium_crypto_kx_server_session_keys')) {\n    /**\n     * @param string $keypair\n     * @param string $clientPublicKey\n     * @return array{0: string, 1: string}\n     * @throws SodiumException\n     */\n    function sodium_crypto_kx_server_session_keys($keypair, $clientPublicKey)\n    {\n        return ParagonIE_Sodium_Compat::crypto_kx_server_session_keys($keypair, $clientPublicKey);\n    }\n}\nif (!is_callable('sodium_crypto_kx_secretkey')) {\n    /**\n     * @param string $keypair\n     * @return string\n     * @throws Exception\n     */\n    function sodium_crypto_kx_secretkey($keypair)\n    {\n        return ParagonIE_Sodium_Compat::crypto_kx_secretkey($keypair);\n    }\n}\nif (!is_callable('sodium_crypto_kx_publickey')) {\n    /**\n     * @param string $keypair\n     * @return string\n     * @throws Exception\n     */\n    function sodium_crypto_kx_publickey($keypair)\n    {\n        return ParagonIE_Sodium_Compat::crypto_kx_publickey($keypair);\n    }\n}\nif (!is_callable('sodium_crypto_pwhash')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_pwhash()\n     * @param int $outlen\n     * @param string $passwd\n     * @param string $salt\n     * @param int $opslimit\n     * @param int $memlimit\n     * @param int|null $algo\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $algo = null)\n    {\n        return ParagonIE_Sodium_Compat::crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $algo);\n    }\n}\nif (!is_callable('sodium_crypto_pwhash_str')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_pwhash_str()\n     * @param string $passwd\n     * @param int $opslimit\n     * @param int $memlimit\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_pwhash_str($passwd, $opslimit, $memlimit)\n    {\n        return ParagonIE_Sodium_Compat::crypto_pwhash_str($passwd, $opslimit, $memlimit);\n    }\n}\nif (!is_callable('sodium_crypto_pwhash_str_needs_rehash')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_pwhash_str_needs_rehash()\n     * @param string $hash\n     * @param int $opslimit\n     * @param int $memlimit\n     * @return bool\n     *\n     * @throws SodiumException\n     */\n    function sodium_crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit)\n    {\n        return ParagonIE_Sodium_Compat::crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit);\n    }\n}\nif (!is_callable('sodium_crypto_pwhash_str_verify')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_pwhash_str_verify()\n     * @param string $passwd\n     * @param string $hash\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_pwhash_str_verify($passwd, $hash)\n    {\n        return ParagonIE_Sodium_Compat::crypto_pwhash_str_verify($passwd, $hash);\n    }\n}\nif (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256()\n     * @param int $outlen\n     * @param string $passwd\n     * @param string $salt\n     * @param int $opslimit\n     * @param int $memlimit\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit)\n    {\n        return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit);\n    }\n}\nif (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256_str')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str()\n     * @param string $passwd\n     * @param int $opslimit\n     * @param int $memlimit\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit)\n    {\n        return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit);\n    }\n}\nif (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256_str_verify')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify()\n     * @param string $passwd\n     * @param string $hash\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash)\n    {\n        return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash);\n    }\n}\nif (!is_callable('sodium_crypto_scalarmult')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_scalarmult()\n     * @param string $n\n     * @param string $p\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_scalarmult($n, $p)\n    {\n        return ParagonIE_Sodium_Compat::crypto_scalarmult($n, $p);\n    }\n}\nif (!is_callable('sodium_crypto_scalarmult_base')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_scalarmult_base()\n     * @param string $n\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_scalarmult_base($n)\n    {\n        return ParagonIE_Sodium_Compat::crypto_scalarmult_base($n);\n    }\n}\nif (!is_callable('sodium_crypto_secretbox')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_secretbox()\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_secretbox($message, $nonce, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_secretbox($message, $nonce, $key);\n    }\n}\nif (!is_callable('sodium_crypto_secretbox_keygen')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_secretbox_keygen()\n     * @return string\n     * @throws Exception\n     */\n    function sodium_crypto_secretbox_keygen()\n    {\n        return ParagonIE_Sodium_Compat::crypto_secretbox_keygen();\n    }\n}\nif (!is_callable('sodium_crypto_secretbox_open')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_secretbox_open()\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @return string|bool\n     */\n    function sodium_crypto_secretbox_open($message, $nonce, $key)\n    {\n        try {\n            return ParagonIE_Sodium_Compat::crypto_secretbox_open($message, $nonce, $key);\n        } catch (Error $ex) {\n            return false;\n        } catch (Exception $ex) {\n            return false;\n        }\n    }\n}\nif (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_init_push')) {\n    /**\n     * @param string $key\n     * @return array<int, string>\n     * @throws SodiumException\n     */\n    function sodium_crypto_secretstream_xchacha20poly1305_init_push($key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_init_push($key);\n    }\n}\nif (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_push')) {\n    /**\n     * @param string $state\n     * @param string $msg\n     * @param string $aad\n     * @param int $tag\n     * @return string\n     * @throws SodiumException\n     */\n    function sodium_crypto_secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0)\n    {\n        return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_push($state, $msg, $aad, $tag);\n    }\n}\nif (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_init_pull')) {\n    /**\n     * @param string $header\n     * @param string $key\n     * @return string\n     * @throws Exception\n     */\n    function sodium_crypto_secretstream_xchacha20poly1305_init_pull($header, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_init_pull($header, $key);\n    }\n}\nif (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_pull')) {\n    /**\n     * @param string $state\n     * @param string $cipher\n     * @param string $aad\n     * @return bool|array{0: string, 1: int}\n     * @throws SodiumException\n     */\n    function sodium_crypto_secretstream_xchacha20poly1305_pull(&$state, $cipher, $aad = '')\n    {\n        return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_pull($state, $cipher, $aad);\n    }\n}\nif (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_rekey')) {\n    /**\n     * @param string $state\n     * @return void\n     * @throws SodiumException\n     */\n    function sodium_crypto_secretstream_xchacha20poly1305_rekey(&$state)\n    {\n        ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_rekey($state);\n    }\n}\nif (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_keygen')) {\n    /**\n     * @return string\n     * @throws Exception\n     */\n    function sodium_crypto_secretstream_xchacha20poly1305_keygen()\n    {\n        return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_keygen();\n    }\n}\nif (!is_callable('sodium_crypto_shorthash')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_shorthash()\n     * @param string $message\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_shorthash($message, $key = '')\n    {\n        return ParagonIE_Sodium_Compat::crypto_shorthash($message, $key);\n    }\n}\nif (!is_callable('sodium_crypto_shorthash_keygen')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_shorthash_keygen()\n     * @return string\n     * @throws Exception\n     */\n    function sodium_crypto_shorthash_keygen()\n    {\n        return ParagonIE_Sodium_Compat::crypto_shorthash_keygen();\n    }\n}\nif (!is_callable('sodium_crypto_sign')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign()\n     * @param string $message\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_sign($message, $sk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign($message, $sk);\n    }\n}\nif (!is_callable('sodium_crypto_sign_detached')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_detached()\n     * @param string $message\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_sign_detached($message, $sk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_detached($message, $sk);\n    }\n}\nif (!is_callable('sodium_crypto_sign_keypair_from_secretkey_and_publickey')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_keypair_from_secretkey_and_publickey()\n     * @param string $sk\n     * @param string $pk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk);\n    }\n}\nif (!is_callable('sodium_crypto_sign_keypair')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_keypair()\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_sign_keypair()\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_keypair();\n    }\n}\nif (!is_callable('sodium_crypto_sign_open')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_open()\n     * @param string $signedMessage\n     * @param string $pk\n     * @return string|bool\n     */\n    function sodium_crypto_sign_open($signedMessage, $pk)\n    {\n        try {\n            return ParagonIE_Sodium_Compat::crypto_sign_open($signedMessage, $pk);\n        } catch (Error $ex) {\n            return false;\n        } catch (Exception $ex) {\n            return false;\n        }\n    }\n}\nif (!is_callable('sodium_crypto_sign_publickey')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_publickey()\n     * @param string $keypair\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_sign_publickey($keypair)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_publickey($keypair);\n    }\n}\nif (!is_callable('sodium_crypto_sign_publickey_from_secretkey')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey()\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_sign_publickey_from_secretkey($sk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey($sk);\n    }\n}\nif (!is_callable('sodium_crypto_sign_secretkey')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_secretkey()\n     * @param string $keypair\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_sign_secretkey($keypair)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_secretkey($keypair);\n    }\n}\nif (!is_callable('sodium_crypto_sign_seed_keypair')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_seed_keypair()\n     * @param string $seed\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_sign_seed_keypair($seed)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_seed_keypair($seed);\n    }\n}\nif (!is_callable('sodium_crypto_sign_verify_detached')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_verify_detached()\n     * @param string $signature\n     * @param string $message\n     * @param string $pk\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_sign_verify_detached($signature, $message, $pk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $message, $pk);\n    }\n}\nif (!is_callable('sodium_crypto_sign_ed25519_pk_to_curve25519')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519()\n     * @param string $pk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_sign_ed25519_pk_to_curve25519($pk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519($pk);\n    }\n}\nif (!is_callable('sodium_crypto_sign_ed25519_sk_to_curve25519')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519()\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_sign_ed25519_sk_to_curve25519($sk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519($sk);\n    }\n}\nif (!is_callable('sodium_crypto_stream')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_stream()\n     * @param int $len\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_stream($len, $nonce, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_stream($len, $nonce, $key);\n    }\n}\nif (!is_callable('sodium_crypto_stream_keygen')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_stream_keygen()\n     * @return string\n     * @throws Exception\n     */\n    function sodium_crypto_stream_keygen()\n    {\n        return ParagonIE_Sodium_Compat::crypto_stream_keygen();\n    }\n}\nif (!is_callable('sodium_crypto_stream_xor')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_stream_xor()\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_crypto_stream_xor($message, $nonce, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_stream_xor($message, $nonce, $key);\n    }\n}\nif (!is_callable('sodium_hex2bin')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::hex2bin()\n     * @param string $string\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_hex2bin($string)\n    {\n        return ParagonIE_Sodium_Compat::hex2bin($string);\n    }\n}\nif (!is_callable('sodium_increment')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::increment()\n     * @param string $string\n     * @return void\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_increment(&$string)\n    {\n        ParagonIE_Sodium_Compat::increment($string);\n    }\n}\nif (!is_callable('sodium_library_version_major')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::library_version_major()\n     * @return int\n     */\n    function sodium_library_version_major()\n    {\n        return ParagonIE_Sodium_Compat::library_version_major();\n    }\n}\nif (!is_callable('sodium_library_version_minor')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::library_version_minor()\n     * @return int\n     */\n    function sodium_library_version_minor()\n    {\n        return ParagonIE_Sodium_Compat::library_version_minor();\n    }\n}\nif (!is_callable('sodium_version_string')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::version_string()\n     * @return string\n     */\n    function sodium_version_string()\n    {\n        return ParagonIE_Sodium_Compat::version_string();\n    }\n}\nif (!is_callable('sodium_memcmp')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::memcmp()\n     * @param string $a\n     * @param string $b\n     * @return int\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_memcmp($a, $b)\n    {\n        return ParagonIE_Sodium_Compat::memcmp($a, $b);\n    }\n}\nif (!is_callable('sodium_memzero')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::memzero()\n     * @param string $str\n     * @return void\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_memzero(&$str)\n    {\n        ParagonIE_Sodium_Compat::memzero($str);\n    }\n}\nif (!is_callable('sodium_pad')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::pad()\n     * @param string $unpadded\n     * @param int $blockSize\n     * @return int\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_pad($unpadded, $blockSize)\n    {\n        return ParagonIE_Sodium_Compat::pad($unpadded, $blockSize, true);\n    }\n}\nif (!is_callable('sodium_unpad')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::pad()\n     * @param string $padded\n     * @param int $blockSize\n     * @return int\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    function sodium_unpad($padded, $blockSize)\n    {\n        return ParagonIE_Sodium_Compat::unpad($padded, $blockSize, true);\n    }\n}\nif (!is_callable('sodium_randombytes_buf')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::randombytes_buf()\n     * @param int $amount\n     * @return string\n     * @throws Exception\n     */\n    function sodium_randombytes_buf($amount)\n    {\n        return ParagonIE_Sodium_Compat::randombytes_buf($amount);\n    }\n}\n\nif (!is_callable('sodium_randombytes_uniform')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::randombytes_uniform()\n     * @param int $upperLimit\n     * @return int\n     * @throws Exception\n     */\n    function sodium_randombytes_uniform($upperLimit)\n    {\n        return ParagonIE_Sodium_Compat::randombytes_uniform($upperLimit);\n    }\n}\n\nif (!is_callable('sodium_randombytes_random16')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::randombytes_random16()\n     * @return int\n     * @throws Exception\n     */\n    function sodium_randombytes_random16()\n    {\n        return ParagonIE_Sodium_Compat::randombytes_random16();\n    }\n}\n", "num_lines": 1355}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nconst SODIUM_LIBRARY_MAJOR_VERSION = 9;\nconst SODIUM_LIBRARY_MINOR_VERSION = 1;\nconst SODIUM_LIBRARY_VERSION = '1.0.8';\n\nconst SODIUM_BASE64_VARIANT_ORIGINAL = 1;\nconst SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING = 3;\nconst SODIUM_BASE64_VARIANT_URLSAFE = 5;\nconst SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING = 7;\nconst SODIUM_CRYPTO_AEAD_AES256GCM_KEYBYTES = 32;\nconst SODIUM_CRYPTO_AEAD_AES256GCM_NSECBYTES = 0;\nconst SODIUM_CRYPTO_AEAD_AES256GCM_NPUBBYTES = 12;\nconst SODIUM_CRYPTO_AEAD_AES256GCM_ABYTES = 16;\nconst SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES = 32;\nconst SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES = 0;\nconst SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES = 8;\nconst SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_ABYTES = 16;\nconst SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES = 32;\nconst SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES = 0;\nconst SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES = 12;\nconst SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES = 16;\nconst SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES = 32;\nconst SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES = 0;\nconst SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES = 24;\nconst SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES = 16;\nconst SODIUM_CRYPTO_AUTH_BYTES = 32;\nconst SODIUM_CRYPTO_AUTH_KEYBYTES = 32;\nconst SODIUM_CRYPTO_BOX_SEALBYTES = 16;\nconst SODIUM_CRYPTO_BOX_SECRETKEYBYTES = 32;\nconst SODIUM_CRYPTO_BOX_PUBLICKEYBYTES = 32;\nconst SODIUM_CRYPTO_BOX_KEYPAIRBYTES = 64;\nconst SODIUM_CRYPTO_BOX_MACBYTES = 16;\nconst SODIUM_CRYPTO_BOX_NONCEBYTES = 24;\nconst SODIUM_CRYPTO_BOX_SEEDBYTES = 32;\nconst SODIUM_CRYPTO_KDF_BYTES_MIN = 16;\nconst SODIUM_CRYPTO_KDF_BYTES_MAX = 64;\nconst SODIUM_CRYPTO_KDF_CONTEXTBYTES = 8;\nconst SODIUM_CRYPTO_KDF_KEYBYTES = 32;\nconst SODIUM_CRYPTO_KX_BYTES = 32;\nconst SODIUM_CRYPTO_KX_PRIMITIVE = 'x25519blake2b';\nconst SODIUM_CRYPTO_KX_SEEDBYTES = 32;\nconst SODIUM_CRYPTO_KX_KEYPAIRBYTES = 64;\nconst SODIUM_CRYPTO_KX_PUBLICKEYBYTES = 32;\nconst SODIUM_CRYPTO_KX_SECRETKEYBYTES = 32;\nconst SODIUM_CRYPTO_KX_SESSIONKEYBYTES = 32;\nconst SODIUM_CRYPTO_GENERICHASH_BYTES = 32;\nconst SODIUM_CRYPTO_GENERICHASH_BYTES_MIN = 16;\nconst SODIUM_CRYPTO_GENERICHASH_BYTES_MAX = 64;\nconst SODIUM_CRYPTO_GENERICHASH_KEYBYTES = 32;\nconst SODIUM_CRYPTO_GENERICHASH_KEYBYTES_MIN = 16;\nconst SODIUM_CRYPTO_GENERICHASH_KEYBYTES_MAX = 64;\nconst SODIUM_CRYPTO_PWHASH_SALTBYTES = 16;\nconst SODIUM_CRYPTO_PWHASH_STRPREFIX = '$argon2id$';\nconst SODIUM_CRYPTO_PWHASH_ALG_ARGON2I13 = 1;\nconst SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13 = 2;\nconst SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE = 33554432;\nconst SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE = 4;\nconst SODIUM_CRYPTO_PWHASH_MEMLIMIT_MODERATE = 134217728;\nconst SODIUM_CRYPTO_PWHASH_OPSLIMIT_MODERATE = 6;\nconst SODIUM_CRYPTO_PWHASH_MEMLIMIT_SENSITIVE = 536870912;\nconst SODIUM_CRYPTO_PWHASH_OPSLIMIT_SENSITIVE = 8;\nconst SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_SALTBYTES = 32;\nconst SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_STRPREFIX = '$7$';\nconst SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_INTERACTIVE = 534288;\nconst SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_INTERACTIVE = 16777216;\nconst SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_SENSITIVE = 33554432;\nconst SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_SENSITIVE = 1073741824;\nconst SODIUM_CRYPTO_SCALARMULT_BYTES = 32;\nconst SODIUM_CRYPTO_SCALARMULT_SCALARBYTES = 32;\nconst SODIUM_CRYPTO_SHORTHASH_BYTES = 8;\nconst SODIUM_CRYPTO_SHORTHASH_KEYBYTES = 16;\nconst SODIUM_CRYPTO_SECRETBOX_KEYBYTES = 32;\nconst SODIUM_CRYPTO_SECRETBOX_MACBYTES = 16;\nconst SODIUM_CRYPTO_SECRETBOX_NONCEBYTES = 24;\nconst SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES = 17;\nconst SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES = 24;\nconst SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES = 32;\nconst SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH = 0;\nconst SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL = 1;\nconst SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY = 2;\nconst SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL = 3;\nconst SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX = 0x3fffffff80;\nconst SODIUM_CRYPTO_SIGN_BYTES = 64;\nconst SODIUM_CRYPTO_SIGN_SEEDBYTES = 32;\nconst SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES = 32;\nconst SODIUM_CRYPTO_SIGN_SECRETKEYBYTES = 64;\nconst SODIUM_CRYPTO_SIGN_KEYPAIRBYTES = 96;\nconst SODIUM_CRYPTO_STREAM_KEYBYTES = 32;\nconst SODIUM_CRYPTO_STREAM_NONCEBYTES = 24;\n", "num_lines": 91}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace Sodium;\n\nrequire_once dirname(dirname(__FILE__)) . '/autoload.php';\n\nuse ParagonIE_Sodium_Compat;\n\n/**\n * This file will monkey patch the pure-PHP implementation in place of the\n * PECL functions, but only if they do not already exist.\n *\n * Thus, the functions just proxy to the appropriate ParagonIE_Sodium_Compat\n * method.\n */\nif (!is_callable('\\\\Sodium\\\\bin2hex')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::bin2hex()\n     * @param string $string\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function bin2hex($string)\n    {\n        return ParagonIE_Sodium_Compat::bin2hex($string);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\compare')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::compare()\n     * @param string $a\n     * @param string $b\n     * @return int\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function compare($a, $b)\n    {\n        return ParagonIE_Sodium_Compat::compare($a, $b);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_aead_aes256gcm_decrypt')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt()\n     * @param string $message\n     * @param string $assocData\n     * @param string $nonce\n     * @param string $key\n     * @return string|bool\n     */\n    function crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key)\n    {\n        try {\n            return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key);\n        } catch (\\TypeError $ex) {\n            return false;\n        } catch (\\SodiumException $ex) {\n            return false;\n        }\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_aead_aes256gcm_encrypt')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt()\n     * @param string $message\n     * @param string $assocData\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_aead_aes256gcm_encrypt($message, $assocData, $nonce, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt($message, $assocData, $nonce, $key);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_aead_aes256gcm_is_available')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_is_available()\n     * @return bool\n     */\n    function crypto_aead_aes256gcm_is_available()\n    {\n        return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_is_available();\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_aead_chacha20poly1305_decrypt')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt()\n     * @param string $message\n     * @param string $assocData\n     * @param string $nonce\n     * @param string $key\n     * @return string|bool\n     */\n    function crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key)\n    {\n        try {\n            return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key);\n        } catch (\\TypeError $ex) {\n            return false;\n        } catch (\\SodiumException $ex) {\n            return false;\n        }\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_aead_chacha20poly1305_encrypt')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt()\n     * @param string $message\n     * @param string $assocData\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_aead_chacha20poly1305_encrypt($message, $assocData, $nonce, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt($message, $assocData, $nonce, $key);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_aead_chacha20poly1305_ietf_decrypt')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt()\n     * @param string $message\n     * @param string $assocData\n     * @param string $nonce\n     * @param string $key\n     * @return string|bool\n     */\n    function crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key)\n    {\n        try {\n            return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key);\n        } catch (\\TypeError $ex) {\n            return false;\n        } catch (\\SodiumException $ex) {\n            return false;\n        }\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_aead_chacha20poly1305_ietf_encrypt')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt()\n     * @param string $message\n     * @param string $assocData\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_aead_chacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_auth')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_auth()\n     * @param string $message\n     * @param string $key\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_auth($message, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_auth($message, $key);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_auth_verify')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_auth_verify()\n     * @param string $mac\n     * @param string $message\n     * @param string $key\n     * @return bool\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_auth_verify($mac, $message, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_auth_verify($mac, $message, $key);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_box')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box()\n     * @param string $message\n     * @param string $nonce\n     * @param string $kp\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_box($message, $nonce, $kp)\n    {\n        return ParagonIE_Sodium_Compat::crypto_box($message, $nonce, $kp);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_box_keypair')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_keypair()\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_box_keypair()\n    {\n        return ParagonIE_Sodium_Compat::crypto_box_keypair();\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_box_keypair_from_secretkey_and_publickey')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey()\n     * @param string $sk\n     * @param string $pk\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_box_keypair_from_secretkey_and_publickey($sk, $pk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey($sk, $pk);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_box_open')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_open()\n     * @param string $message\n     * @param string $nonce\n     * @param string $kp\n     * @return string|bool\n     */\n    function crypto_box_open($message, $nonce, $kp)\n    {\n        try {\n            return ParagonIE_Sodium_Compat::crypto_box_open($message, $nonce, $kp);\n        } catch (\\TypeError $ex) {\n            return false;\n        } catch (\\SodiumException $ex) {\n            return false;\n        }\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_box_publickey')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_publickey()\n     * @param string $keypair\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_box_publickey($keypair)\n    {\n        return ParagonIE_Sodium_Compat::crypto_box_publickey($keypair);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_box_publickey_from_secretkey')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey()\n     * @param string $sk\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_box_publickey_from_secretkey($sk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey($sk);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_box_seal')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_seal_open()\n     * @param string $message\n     * @param string $publicKey\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_box_seal($message, $publicKey)\n    {\n        return ParagonIE_Sodium_Compat::crypto_box_seal($message, $publicKey);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_box_seal_open')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_seal_open()\n     * @param string $message\n     * @param string $kp\n     * @return string|bool\n     */\n    function crypto_box_seal_open($message, $kp)\n    {\n        try {\n            return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $kp);\n        } catch (\\TypeError $ex) {\n            return false;\n        } catch (\\SodiumException $ex) {\n            return false;\n        }\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_box_secretkey')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_box_secretkey()\n     * @param string $keypair\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_box_secretkey($keypair)\n    {\n        return ParagonIE_Sodium_Compat::crypto_box_secretkey($keypair);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_generichash')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_generichash()\n     * @param string $message\n     * @param string|null $key\n     * @param int $outLen\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_generichash($message, $key = null, $outLen = 32)\n    {\n        return ParagonIE_Sodium_Compat::crypto_generichash($message, $key, $outLen);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_generichash_final')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_generichash_final()\n     * @param string|null $ctx\n     * @param int $outputLength\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_generichash_final(&$ctx, $outputLength = 32)\n    {\n        return ParagonIE_Sodium_Compat::crypto_generichash_final($ctx, $outputLength);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_generichash_init')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_generichash_init()\n     * @param string|null $key\n     * @param int $outLen\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_generichash_init($key = null, $outLen = 32)\n    {\n        return ParagonIE_Sodium_Compat::crypto_generichash_init($key, $outLen);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_generichash_update')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_generichash_update()\n     * @param string|null $ctx\n     * @param string $message\n     * @return void\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_generichash_update(&$ctx, $message = '')\n    {\n        ParagonIE_Sodium_Compat::crypto_generichash_update($ctx, $message);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_kx')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_kx()\n     * @param string $my_secret\n     * @param string $their_public\n     * @param string $client_public\n     * @param string $server_public\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_kx($my_secret, $their_public, $client_public, $server_public)\n    {\n        return ParagonIE_Sodium_Compat::crypto_kx(\n            $my_secret,\n            $their_public,\n            $client_public,\n            $server_public\n        );\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_pwhash')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_pwhash()\n     * @param int $outlen\n     * @param string $passwd\n     * @param string $salt\n     * @param int $opslimit\n     * @param int $memlimit\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit)\n    {\n        return ParagonIE_Sodium_Compat::crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_pwhash_str')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_pwhash_str()\n     * @param string $passwd\n     * @param int $opslimit\n     * @param int $memlimit\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_pwhash_str($passwd, $opslimit, $memlimit)\n    {\n        return ParagonIE_Sodium_Compat::crypto_pwhash_str($passwd, $opslimit, $memlimit);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_pwhash_str_verify')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_pwhash_str_verify()\n     * @param string $passwd\n     * @param string $hash\n     * @return bool\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_pwhash_str_verify($passwd, $hash)\n    {\n        return ParagonIE_Sodium_Compat::crypto_pwhash_str_verify($passwd, $hash);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_pwhash_scryptsalsa208sha256')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256()\n     * @param int $outlen\n     * @param string $passwd\n     * @param string $salt\n     * @param int $opslimit\n     * @param int $memlimit\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit)\n    {\n        return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_pwhash_scryptsalsa208sha256_str')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str()\n     * @param string $passwd\n     * @param int $opslimit\n     * @param int $memlimit\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit)\n    {\n        return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_pwhash_scryptsalsa208sha256_str_verify')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify()\n     * @param string $passwd\n     * @param string $hash\n     * @return bool\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash)\n    {\n        return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_scalarmult')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_scalarmult()\n     * @param string $n\n     * @param string $p\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_scalarmult($n, $p)\n    {\n        return ParagonIE_Sodium_Compat::crypto_scalarmult($n, $p);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_scalarmult_base')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_scalarmult_base()\n     * @param string $n\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_scalarmult_base($n)\n    {\n        return ParagonIE_Sodium_Compat::crypto_scalarmult_base($n);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_secretbox')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_secretbox()\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_secretbox($message, $nonce, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_secretbox($message, $nonce, $key);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_secretbox_open')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_secretbox_open()\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @return string|bool\n     */\n    function crypto_secretbox_open($message, $nonce, $key)\n    {\n        try {\n            return ParagonIE_Sodium_Compat::crypto_secretbox_open($message, $nonce, $key);\n        } catch (\\TypeError $ex) {\n            return false;\n        } catch (\\SodiumException $ex) {\n            return false;\n        }\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_shorthash')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_shorthash()\n     * @param string $message\n     * @param string $key\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_shorthash($message, $key = '')\n    {\n        return ParagonIE_Sodium_Compat::crypto_shorthash($message, $key);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_sign')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign()\n     * @param string $message\n     * @param string $sk\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_sign($message, $sk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign($message, $sk);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_sign_detached')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_detached()\n     * @param string $message\n     * @param string $sk\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_sign_detached($message, $sk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_detached($message, $sk);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_sign_keypair')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_keypair()\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_sign_keypair()\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_keypair();\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_sign_open')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_open()\n     * @param string $signedMessage\n     * @param string $pk\n     * @return string|bool\n     */\n    function crypto_sign_open($signedMessage, $pk)\n    {\n        try {\n            return ParagonIE_Sodium_Compat::crypto_sign_open($signedMessage, $pk);\n        } catch (\\TypeError $ex) {\n            return false;\n        } catch (\\SodiumException $ex) {\n            return false;\n        }\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_sign_publickey')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_publickey()\n     * @param string $keypair\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_sign_publickey($keypair)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_publickey($keypair);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_sign_publickey_from_secretkey')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey()\n     * @param string $sk\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_sign_publickey_from_secretkey($sk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey($sk);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_sign_secretkey')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_secretkey()\n     * @param string $keypair\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_sign_secretkey($keypair)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_secretkey($keypair);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_sign_seed_keypair')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_seed_keypair()\n     * @param string $seed\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_sign_seed_keypair($seed)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_seed_keypair($seed);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_sign_verify_detached')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_verify_detached()\n     * @param string $signature\n     * @param string $message\n     * @param string $pk\n     * @return bool\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_sign_verify_detached($signature, $message, $pk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $message, $pk);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_sign_ed25519_pk_to_curve25519')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519()\n     * @param string $pk\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_sign_ed25519_pk_to_curve25519($pk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519($pk);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_sign_ed25519_sk_to_curve25519')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519()\n     * @param string $sk\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_sign_ed25519_sk_to_curve25519($sk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519($sk);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_stream')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_stream()\n     * @param int $len\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_stream($len, $nonce, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_stream($len, $nonce, $key);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\crypto_stream_xor')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::crypto_stream_xor()\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function crypto_stream_xor($message, $nonce, $key)\n    {\n        return ParagonIE_Sodium_Compat::crypto_stream_xor($message, $nonce, $key);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\hex2bin')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::hex2bin()\n     * @param string $string\n     * @return string\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function hex2bin($string)\n    {\n        return ParagonIE_Sodium_Compat::hex2bin($string);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\memcmp')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::memcmp()\n     * @param string $a\n     * @param string $b\n     * @return int\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function memcmp($a, $b)\n    {\n        return ParagonIE_Sodium_Compat::memcmp($a, $b);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\memzero')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::memzero()\n     * @param string $str\n     * @return void\n     * @throws \\SodiumException\n     * @throws \\TypeError\n     */\n    function memzero(&$str)\n    {\n        ParagonIE_Sodium_Compat::memzero($str);\n    }\n}\nif (!is_callable('\\\\Sodium\\\\randombytes_buf')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::randombytes_buf()\n     * @param int $amount\n     * @return string\n     * @throws \\TypeError\n     */\n    function randombytes_buf($amount)\n    {\n        return ParagonIE_Sodium_Compat::randombytes_buf($amount);\n    }\n}\n\nif (!is_callable('\\\\Sodium\\\\randombytes_uniform')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::randombytes_uniform()\n     * @param int $upperLimit\n     * @return int\n     * @throws \\SodiumException\n     * @throws \\Error\n     */\n    function randombytes_uniform($upperLimit)\n    {\n        return ParagonIE_Sodium_Compat::randombytes_uniform($upperLimit);\n    }\n}\n\nif (!is_callable('\\\\Sodium\\\\randombytes_random16')) {\n    /**\n     * @see ParagonIE_Sodium_Compat::randombytes_random16()\n     * @return int\n     */\n    function randombytes_random16()\n    {\n        return ParagonIE_Sodium_Compat::randombytes_random16();\n    }\n}\n\nif (!defined('\\\\Sodium\\\\CRYPTO_AUTH_BYTES')) {\n    require_once dirname(__FILE__) . '/constants.php';\n}\n", "num_lines": 827}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium;\n\nclass Compat extends \\ParagonIE_Sodium_Compat\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium;\n\nclass Crypto extends \\ParagonIE_Sodium_Crypto\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium;\n\nclass File extends \\ParagonIE_Sodium_File\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core;\n\nclass BLAKE2b extends \\ParagonIE_Sodium_Core_BLAKE2b\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core;\n\nclass ChaCha20 extends \\ParagonIE_Sodium_Core_ChaCha20\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core;\n\nclass Curve25519 extends \\ParagonIE_Sodium_Core_Curve25519\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core;\n\nclass Ed25519 extends \\ParagonIE_Sodium_Core_Ed25519\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core;\n\nclass HChaCha20 extends \\ParagonIE_Sodium_Core_HChaCha20\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core;\n\nclass HSalsa20 extends \\ParagonIE_Sodium_Core_HSalsa20\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core;\n\nclass Poly1305 extends \\ParagonIE_Sodium_Core_Poly1305\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core;\n\nclass Salsa20 extends \\ParagonIE_Sodium_Core_Salsa20\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core;\n\nclass SipHash extends \\ParagonIE_Sodium_Core_SipHash\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core;\n\nclass Util extends \\ParagonIE_Sodium_Core_Util\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core;\n\nclass X25519 extends \\ParagonIE_Sodium_Core_X25519\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core;\n\nclass XChaCha20 extends \\ParagonIE_Sodium_Core_XChaCha20\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core;\n\nclass Xsalsa20 extends \\ParagonIE_Sodium_Core_XSalsa20\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core\\ChaCha20;\n\nclass Ctx extends \\ParagonIE_Sodium_Core_ChaCha20_Ctx\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core\\ChaCha20;\n\nclass IetfCtx extends \\ParagonIE_Sodium_Core_ChaCha20_IetfCtx\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core\\Curve25519;\n\nclass Fe extends \\ParagonIE_Sodium_Core_Curve25519_Fe\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core\\Curve25519;\n\nclass H extends \\ParagonIE_Sodium_Core_Curve25519_H\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core\\Curve25519\\Ge;\n\nclass Cached extends \\ParagonIE_Sodium_Core_Curve25519_Ge_Cached\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core\\Curve25519\\Ge;\n\nclass P1p1 extends \\ParagonIE_Sodium_Core_Curve25519_Ge_P1p1\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core\\Curve25519\\Ge;\n\nclass P2 extends \\ParagonIE_Sodium_Core_Curve25519_Ge_P2\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core\\Curve25519\\Ge;\n\nclass P3 extends \\ParagonIE_Sodium_Core_Curve25519_Ge_P3\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core\\Curve25519\\Ge;\n\nclass Precomp extends \\ParagonIE_Sodium_Core_Curve25519_Ge_Precomp\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nnamespace ParagonIE\\Sodium\\Core\\Poly1305;\n\nclass State extends \\ParagonIE_Sodium_Core_Poly1305_State\n{\n\n}\n", "num_lines": 8}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * Libsodium compatibility layer\n *\n * This is the only class you should be interfacing with, as a user of\n * sodium_compat.\n *\n * If the PHP extension for libsodium is installed, it will always use that\n * instead of our implementations. You get better performance and stronger\n * guarantees against side-channels that way.\n *\n * However, if your users don't have the PHP extension installed, we offer a\n * compatible interface here. It will give you the correct results as if the\n * PHP extension was installed. It won't be as fast, of course.\n *\n * CAUTION * CAUTION * CAUTION * CAUTION * CAUTION * CAUTION * CAUTION * CAUTION *\n *                                                                               *\n *     Until audited, this is probably not safe to use! DANGER WILL ROBINSON     *\n *                                                                               *\n * CAUTION * CAUTION * CAUTION * CAUTION * CAUTION * CAUTION * CAUTION * CAUTION *\n */\n\nif (class_exists('ParagonIE_Sodium_Compat', false)) {\n    return;\n}\n\nclass ParagonIE_Sodium_Compat\n{\n    /**\n     * This parameter prevents the use of the PECL extension.\n     * It should only be used for unit testing.\n     *\n     * @var bool\n     */\n    public static $disableFallbackForUnitTests = false;\n\n    /**\n     * Use fast multiplication rather than our constant-time multiplication\n     * implementation. Can be enabled at runtime. Only enable this if you\n     * are absolutely certain that there is no timing leak on your platform.\n     *\n     * @var bool\n     */\n    public static $fastMult = false;\n\n    const LIBRARY_VERSION_MAJOR = 9;\n    const LIBRARY_VERSION_MINOR = 1;\n    const VERSION_STRING = 'polyfill-1.0.8';\n\n    // From libsodium\n    const BASE64_VARIANT_ORIGINAL = 1;\n    const BASE64_VARIANT_ORIGINAL_NO_PADDING = 3;\n    const BASE64_VARIANT_URLSAFE = 5;\n    const BASE64_VARIANT_URLSAFE_NO_PADDING = 7;\n    const CRYPTO_AEAD_AES256GCM_KEYBYTES = 32;\n    const CRYPTO_AEAD_AES256GCM_NSECBYTES = 0;\n    const CRYPTO_AEAD_AES256GCM_NPUBBYTES = 12;\n    const CRYPTO_AEAD_AES256GCM_ABYTES = 16;\n    const CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES = 32;\n    const CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES = 0;\n    const CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES = 8;\n    const CRYPTO_AEAD_CHACHA20POLY1305_ABYTES = 16;\n    const CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES = 32;\n    const CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES = 0;\n    const CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES = 12;\n    const CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES = 16;\n    const CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES = 32;\n    const CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES = 0;\n    const CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES = 24;\n    const CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES = 16;\n    const CRYPTO_AUTH_BYTES = 32;\n    const CRYPTO_AUTH_KEYBYTES = 32;\n    const CRYPTO_BOX_SEALBYTES = 16;\n    const CRYPTO_BOX_SECRETKEYBYTES = 32;\n    const CRYPTO_BOX_PUBLICKEYBYTES = 32;\n    const CRYPTO_BOX_KEYPAIRBYTES = 64;\n    const CRYPTO_BOX_MACBYTES = 16;\n    const CRYPTO_BOX_NONCEBYTES = 24;\n    const CRYPTO_BOX_SEEDBYTES = 32;\n    const CRYPTO_KDF_BYTES_MIN = 16;\n    const CRYPTO_KDF_BYTES_MAX = 64;\n    const CRYPTO_KDF_CONTEXTBYTES = 8;\n    const CRYPTO_KDF_KEYBYTES = 32;\n    const CRYPTO_KX_BYTES = 32;\n    const CRYPTO_KX_PRIMITIVE = 'x25519blake2b';\n    const CRYPTO_KX_SEEDBYTES = 32;\n    const CRYPTO_KX_KEYPAIRBYTES = 64;\n    const CRYPTO_KX_PUBLICKEYBYTES = 32;\n    const CRYPTO_KX_SECRETKEYBYTES = 32;\n    const CRYPTO_KX_SESSIONKEYBYTES = 32;\n    const CRYPTO_GENERICHASH_BYTES = 32;\n    const CRYPTO_GENERICHASH_BYTES_MIN = 16;\n    const CRYPTO_GENERICHASH_BYTES_MAX = 64;\n    const CRYPTO_GENERICHASH_KEYBYTES = 32;\n    const CRYPTO_GENERICHASH_KEYBYTES_MIN = 16;\n    const CRYPTO_GENERICHASH_KEYBYTES_MAX = 64;\n    const CRYPTO_PWHASH_SALTBYTES = 16;\n    const CRYPTO_PWHASH_STRPREFIX = '$argon2id$';\n    const CRYPTO_PWHASH_ALG_ARGON2I13 = 1;\n    const CRYPTO_PWHASH_ALG_ARGON2ID13 = 2;\n    const CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE = 33554432;\n    const CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE = 4;\n    const CRYPTO_PWHASH_MEMLIMIT_MODERATE = 134217728;\n    const CRYPTO_PWHASH_OPSLIMIT_MODERATE = 6;\n    const CRYPTO_PWHASH_MEMLIMIT_SENSITIVE = 536870912;\n    const CRYPTO_PWHASH_OPSLIMIT_SENSITIVE = 8;\n    const CRYPTO_PWHASH_SCRYPTSALSA208SHA256_SALTBYTES = 32;\n    const CRYPTO_PWHASH_SCRYPTSALSA208SHA256_STRPREFIX = '$7$';\n    const CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_INTERACTIVE = 534288;\n    const CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_INTERACTIVE = 16777216;\n    const CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_SENSITIVE = 33554432;\n    const CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_SENSITIVE = 1073741824;\n    const CRYPTO_SCALARMULT_BYTES = 32;\n    const CRYPTO_SCALARMULT_SCALARBYTES = 32;\n    const CRYPTO_SHORTHASH_BYTES = 8;\n    const CRYPTO_SHORTHASH_KEYBYTES = 16;\n    const CRYPTO_SECRETBOX_KEYBYTES = 32;\n    const CRYPTO_SECRETBOX_MACBYTES = 16;\n    const CRYPTO_SECRETBOX_NONCEBYTES = 24;\n    const CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES = 17;\n    const CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES = 24;\n    const CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES = 32;\n    const CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH = 0;\n    const CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL = 1;\n    const CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY = 2;\n    const CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL = 3;\n    const CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX = 0x3fffffff80;\n    const CRYPTO_SIGN_BYTES = 64;\n    const CRYPTO_SIGN_SEEDBYTES = 32;\n    const CRYPTO_SIGN_PUBLICKEYBYTES = 32;\n    const CRYPTO_SIGN_SECRETKEYBYTES = 64;\n    const CRYPTO_SIGN_KEYPAIRBYTES = 96;\n    const CRYPTO_STREAM_KEYBYTES = 32;\n    const CRYPTO_STREAM_NONCEBYTES = 24;\n\n    /**\n     * Add two numbers (little-endian unsigned), storing the value in the first\n     * parameter.\n     *\n     * This mutates $val.\n     *\n     * @param string $val\n     * @param string $addv\n     * @return void\n     * @throws SodiumException\n     */\n    public static function add(&$val, $addv)\n    {\n        $val_len = ParagonIE_Sodium_Core_Util::strlen($val);\n        $addv_len = ParagonIE_Sodium_Core_Util::strlen($addv);\n        if ($val_len !== $addv_len) {\n            throw new SodiumException('values must have the same length');\n        }\n        $A = ParagonIE_Sodium_Core_Util::stringToIntArray($val);\n        $B = ParagonIE_Sodium_Core_Util::stringToIntArray($addv);\n\n        $c = 0;\n        for ($i = 0; $i < $val_len; $i++) {\n            $c += ($A[$i] + $B[$i]);\n            $A[$i] = ($c & 0xff);\n            $c >>= 8;\n        }\n        $val = ParagonIE_Sodium_Core_Util::intArrayToString($A);\n    }\n\n    /**\n     * @param string $encoded\n     * @param int $variant\n     * @param string $ignore\n     * @return string\n     * @throws SodiumException\n     */\n    public static function base642bin($encoded, $variant, $ignore = '')\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($encoded, 'string', 1);\n\n        /** @var string $encoded */\n        $encoded = (string) $encoded;\n        if (ParagonIE_Sodium_Core_Util::strlen($encoded) === 0) {\n            return '';\n        }\n\n        // Just strip before decoding\n        if (!empty($ignore)) {\n            $encoded = str_replace($ignore, '', $encoded);\n        }\n\n        try {\n            switch ($variant) {\n                case self::BASE64_VARIANT_ORIGINAL:\n                    return ParagonIE_Sodium_Core_Base64_Original::decode($encoded, true);\n                case self::BASE64_VARIANT_ORIGINAL_NO_PADDING:\n                    return ParagonIE_Sodium_Core_Base64_Original::decode($encoded, false);\n                case self::BASE64_VARIANT_URLSAFE:\n                    return ParagonIE_Sodium_Core_Base64_UrlSafe::decode($encoded, true);\n                case self::BASE64_VARIANT_URLSAFE_NO_PADDING:\n                    return ParagonIE_Sodium_Core_Base64_UrlSafe::decode($encoded, false);\n                default:\n                    throw new SodiumException('invalid base64 variant identifier');\n            }\n        } catch (Exception $ex) {\n            if ($ex instanceof SodiumException) {\n                throw $ex;\n            }\n            throw new SodiumException('invalid base64 string');\n        }\n    }\n\n    /**\n     * @param string $decoded\n     * @param int $variant\n     * @return string\n     * @throws SodiumException\n     */\n    public static function bin2base64($decoded, $variant)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($decoded, 'string', 1);\n        /** @var string $decoded */\n        $decoded = (string) $decoded;\n        if (ParagonIE_Sodium_Core_Util::strlen($decoded) === 0) {\n            return '';\n        }\n\n        switch ($variant) {\n            case self::BASE64_VARIANT_ORIGINAL:\n                return ParagonIE_Sodium_Core_Base64_Original::encode($decoded);\n            case self::BASE64_VARIANT_ORIGINAL_NO_PADDING:\n                return ParagonIE_Sodium_Core_Base64_Original::encodeUnpadded($decoded);\n            case self::BASE64_VARIANT_URLSAFE:\n                return ParagonIE_Sodium_Core_Base64_UrlSafe::encode($decoded);\n            case self::BASE64_VARIANT_URLSAFE_NO_PADDING:\n                return ParagonIE_Sodium_Core_Base64_UrlSafe::encodeUnpadded($decoded);\n            default:\n                throw new SodiumException('invalid base64 variant identifier');\n        }\n    }\n\n    /**\n     * Cache-timing-safe implementation of bin2hex().\n     *\n     * @param string $string A string (probably raw binary)\n     * @return string        A hexadecimal-encoded string\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function bin2hex($string)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($string, 'string', 1);\n\n        if (self::useNewSodiumAPI()) {\n            return (string) sodium_bin2hex($string);\n        }\n        if (self::use_fallback('bin2hex')) {\n            return (string) call_user_func('\\\\Sodium\\\\bin2hex', $string);\n        }\n        return ParagonIE_Sodium_Core_Util::bin2hex($string);\n    }\n\n    /**\n     * Compare two strings, in constant-time.\n     * Compared to memcmp(), compare() is more useful for sorting.\n     *\n     * @param string $left  The left operand; must be a string\n     * @param string $right The right operand; must be a string\n     * @return int          If < 0 if the left operand is less than the right\n     *                      If = 0 if both strings are equal\n     *                      If > 0 if the right operand is less than the left\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function compare($left, $right)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($left, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($right, 'string', 2);\n\n        if (self::useNewSodiumAPI()) {\n            return (int) sodium_compare($left, $right);\n        }\n        if (self::use_fallback('compare')) {\n            return (int) call_user_func('\\\\Sodium\\\\compare', $left, $right);\n        }\n        return ParagonIE_Sodium_Core_Util::compare($left, $right);\n    }\n\n    /**\n     * Is AES-256-GCM even available to use?\n     *\n     * @return bool\n     * @psalm-suppress UndefinedFunction\n     * @psalm-suppress MixedInferredReturnType\n     * @psalm-suppress MixedReturnStatement\n     */\n    public static function crypto_aead_aes256gcm_is_available()\n    {\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_aead_aes256gcm_is_available();\n        }\n        if (self::use_fallback('crypto_aead_aes256gcm_is_available')) {\n            return call_user_func('\\\\Sodium\\\\crypto_aead_aes256gcm_is_available');\n        }\n        if (PHP_VERSION_ID < 70100) {\n            // OpenSSL doesn't support AEAD before 7.1.0\n            return false;\n        }\n        if (!is_callable('openssl_encrypt') || !is_callable('openssl_decrypt')) {\n            // OpenSSL isn't installed\n            return false;\n        }\n        return (bool) in_array('aes-256-gcm', openssl_get_cipher_methods());\n    }\n\n    /**\n     * Authenticated Encryption with Associated Data: Decryption\n     *\n     * Algorithm:\n     *     AES-256-GCM\n     *\n     * This mode uses a 64-bit random nonce with a 64-bit counter.\n     * IETF mode uses a 96-bit random nonce with a 32-bit counter.\n     *\n     * @param string $ciphertext Encrypted message (with Poly1305 MAC appended)\n     * @param string $assocData  Authenticated Associated Data (unencrypted)\n     * @param string $nonce      Number to be used only Once; must be 8 bytes\n     * @param string $key        Encryption key\n     *\n     * @return string|bool       The original plaintext message\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedInferredReturnType\n     * @psalm-suppress MixedReturnStatement\n     */\n    public static function crypto_aead_aes256gcm_decrypt(\n        $ciphertext = '',\n        $assocData = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        if (!self::crypto_aead_aes256gcm_is_available()) {\n            throw new SodiumException('AES-256-GCM is not available');\n        }\n        ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_AES256GCM_NPUBBYTES) {\n            throw new SodiumException('Nonce must be CRYPTO_AEAD_AES256GCM_NPUBBYTES long');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_AES256GCM_KEYBYTES) {\n            throw new SodiumException('Key must be CRYPTO_AEAD_AES256GCM_KEYBYTES long');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($ciphertext) < self::CRYPTO_AEAD_AES256GCM_ABYTES) {\n            throw new SodiumException('Message must be at least CRYPTO_AEAD_AES256GCM_ABYTES long');\n        }\n        if (!is_callable('openssl_decrypt')) {\n            throw new SodiumException('The OpenSSL extension is not installed, or openssl_decrypt() is not available');\n        }\n\n        /** @var string $ctext */\n        $ctext = ParagonIE_Sodium_Core_Util::substr($ciphertext, 0, -self::CRYPTO_AEAD_AES256GCM_ABYTES);\n        /** @var string $authTag */\n        $authTag = ParagonIE_Sodium_Core_Util::substr($ciphertext, -self::CRYPTO_AEAD_AES256GCM_ABYTES, 16);\n        return openssl_decrypt(\n            $ctext,\n            'aes-256-gcm',\n            $key,\n            OPENSSL_RAW_DATA,\n            $nonce,\n            $authTag,\n            $assocData\n        );\n    }\n\n    /**\n     * Authenticated Encryption with Associated Data: Encryption\n     *\n     * Algorithm:\n     *     AES-256-GCM\n     *\n     * @param string $plaintext Message to be encrypted\n     * @param string $assocData Authenticated Associated Data (unencrypted)\n     * @param string $nonce     Number to be used only Once; must be 8 bytes\n     * @param string $key       Encryption key\n     *\n     * @return string           Ciphertext with a 16-byte GCM message\n     *                          authentication code appended\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_aead_aes256gcm_encrypt(\n        $plaintext = '',\n        $assocData = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        if (!self::crypto_aead_aes256gcm_is_available()) {\n            throw new SodiumException('AES-256-GCM is not available');\n        }\n        ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_AES256GCM_NPUBBYTES) {\n            throw new SodiumException('Nonce must be CRYPTO_AEAD_AES256GCM_NPUBBYTES long');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_AES256GCM_KEYBYTES) {\n            throw new SodiumException('Key must be CRYPTO_AEAD_AES256GCM_KEYBYTES long');\n        }\n\n        if (!is_callable('openssl_encrypt')) {\n            throw new SodiumException('The OpenSSL extension is not installed, or openssl_encrypt() is not available');\n        }\n\n        $authTag = '';\n        $ciphertext = openssl_encrypt(\n            $plaintext,\n            'aes-256-gcm',\n            $key,\n            OPENSSL_RAW_DATA,\n            $nonce,\n            $authTag,\n            $assocData\n        );\n        return $ciphertext . $authTag;\n    }\n\n    /**\n     * Return a secure random key for use with the AES-256-GCM\n     * symmetric AEAD interface.\n     *\n     * @return string\n     * @throws Exception\n     * @throws Error\n     */\n    public static function crypto_aead_aes256gcm_keygen()\n    {\n        return random_bytes(self::CRYPTO_AEAD_AES256GCM_KEYBYTES);\n    }\n\n    /**\n     * Authenticated Encryption with Associated Data: Decryption\n     *\n     * Algorithm:\n     *     ChaCha20-Poly1305\n     *\n     * This mode uses a 64-bit random nonce with a 64-bit counter.\n     * IETF mode uses a 96-bit random nonce with a 32-bit counter.\n     *\n     * @param string $ciphertext Encrypted message (with Poly1305 MAC appended)\n     * @param string $assocData  Authenticated Associated Data (unencrypted)\n     * @param string $nonce      Number to be used only Once; must be 8 bytes\n     * @param string $key        Encryption key\n     *\n     * @return string            The original plaintext message\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedInferredReturnType\n     * @psalm-suppress MixedReturnStatement\n     */\n    public static function crypto_aead_chacha20poly1305_decrypt(\n        $ciphertext = '',\n        $assocData = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES) {\n            throw new SodiumException('Nonce must be CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES long');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES) {\n            throw new SodiumException('Key must be CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES long');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($ciphertext) < self::CRYPTO_AEAD_CHACHA20POLY1305_ABYTES) {\n            throw new SodiumException('Message must be at least CRYPTO_AEAD_CHACHA20POLY1305_ABYTES long');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            /**\n             * @psalm-suppress InvalidReturnStatement\n             * @psalm-suppress FalsableReturnStatement\n             */\n            return sodium_crypto_aead_chacha20poly1305_decrypt(\n                $ciphertext,\n                $assocData,\n                $nonce,\n                $key\n            );\n        }\n        if (self::use_fallback('crypto_aead_chacha20poly1305_decrypt')) {\n            return call_user_func(\n                '\\\\Sodium\\\\crypto_aead_chacha20poly1305_decrypt',\n                $ciphertext,\n                $assocData,\n                $nonce,\n                $key\n            );\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::aead_chacha20poly1305_decrypt(\n                $ciphertext,\n                $assocData,\n                $nonce,\n                $key\n            );\n        }\n        return ParagonIE_Sodium_Crypto::aead_chacha20poly1305_decrypt(\n            $ciphertext,\n            $assocData,\n            $nonce,\n            $key\n        );\n    }\n\n    /**\n     * Authenticated Encryption with Associated Data\n     *\n     * Algorithm:\n     *     ChaCha20-Poly1305\n     *\n     * This mode uses a 64-bit random nonce with a 64-bit counter.\n     * IETF mode uses a 96-bit random nonce with a 32-bit counter.\n     *\n     * @param string $plaintext Message to be encrypted\n     * @param string $assocData Authenticated Associated Data (unencrypted)\n     * @param string $nonce     Number to be used only Once; must be 8 bytes\n     * @param string $key       Encryption key\n     *\n     * @return string           Ciphertext with a 16-byte Poly1305 message\n     *                          authentication code appended\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_aead_chacha20poly1305_encrypt(\n        $plaintext = '',\n        $assocData = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES) {\n            throw new SodiumException('Nonce must be CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES long');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES) {\n            throw new SodiumException('Key must be CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES long');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return (string) sodium_crypto_aead_chacha20poly1305_encrypt(\n                $plaintext,\n                $assocData,\n                $nonce,\n                $key\n            );\n        }\n        if (self::use_fallback('crypto_aead_chacha20poly1305_encrypt')) {\n            return (string) call_user_func(\n                '\\\\Sodium\\\\crypto_aead_chacha20poly1305_encrypt',\n                $plaintext,\n                $assocData,\n                $nonce,\n                $key\n            );\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::aead_chacha20poly1305_encrypt(\n                $plaintext,\n                $assocData,\n                $nonce,\n                $key\n            );\n        }\n        return ParagonIE_Sodium_Crypto::aead_chacha20poly1305_encrypt(\n            $plaintext,\n            $assocData,\n            $nonce,\n            $key\n        );\n    }\n\n    /**\n     * Authenticated Encryption with Associated Data: Decryption\n     *\n     * Algorithm:\n     *     ChaCha20-Poly1305\n     *\n     * IETF mode uses a 96-bit random nonce with a 32-bit counter.\n     * Regular mode uses a 64-bit random nonce with a 64-bit counter.\n     *\n     * @param string $ciphertext Encrypted message (with Poly1305 MAC appended)\n     * @param string $assocData  Authenticated Associated Data (unencrypted)\n     * @param string $nonce      Number to be used only Once; must be 12 bytes\n     * @param string $key        Encryption key\n     *\n     * @return string            The original plaintext message\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedInferredReturnType\n     * @psalm-suppress MixedReturnStatement\n     */\n    public static function crypto_aead_chacha20poly1305_ietf_decrypt(\n        $ciphertext = '',\n        $assocData = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES) {\n            throw new SodiumException('Nonce must be CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES long');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES) {\n            throw new SodiumException('Key must be CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES long');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($ciphertext) < self::CRYPTO_AEAD_CHACHA20POLY1305_ABYTES) {\n            throw new SodiumException('Message must be at least CRYPTO_AEAD_CHACHA20POLY1305_ABYTES long');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            /**\n             * @psalm-suppress InvalidReturnStatement\n             * @psalm-suppress FalsableReturnStatement\n             */\n            return sodium_crypto_aead_chacha20poly1305_ietf_decrypt(\n                $ciphertext,\n                $assocData,\n                $nonce,\n                $key\n            );\n        }\n        if (self::use_fallback('crypto_aead_chacha20poly1305_ietf_decrypt')) {\n            return call_user_func(\n                '\\\\Sodium\\\\crypto_aead_chacha20poly1305_ietf_decrypt',\n                $ciphertext,\n                $assocData,\n                $nonce,\n                $key\n            );\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::aead_chacha20poly1305_ietf_decrypt(\n                $ciphertext,\n                $assocData,\n                $nonce,\n                $key\n            );\n        }\n        return ParagonIE_Sodium_Crypto::aead_chacha20poly1305_ietf_decrypt(\n            $ciphertext,\n            $assocData,\n            $nonce,\n            $key\n        );\n    }\n\n    /**\n     * Return a secure random key for use with the ChaCha20-Poly1305\n     * symmetric AEAD interface.\n     *\n     * @return string\n     * @throws Exception\n     * @throws Error\n     */\n    public static function crypto_aead_chacha20poly1305_keygen()\n    {\n        return random_bytes(self::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES);\n    }\n\n    /**\n     * Authenticated Encryption with Associated Data\n     *\n     * Algorithm:\n     *     ChaCha20-Poly1305\n     *\n     * IETF mode uses a 96-bit random nonce with a 32-bit counter.\n     * Regular mode uses a 64-bit random nonce with a 64-bit counter.\n     *\n     * @param string $plaintext Message to be encrypted\n     * @param string $assocData Authenticated Associated Data (unencrypted)\n     * @param string $nonce Number to be used only Once; must be 8 bytes\n     * @param string $key Encryption key\n     *\n     * @return string           Ciphertext with a 16-byte Poly1305 message\n     *                          authentication code appended\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_aead_chacha20poly1305_ietf_encrypt(\n        $plaintext = '',\n        $assocData = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES) {\n            throw new SodiumException('Nonce must be CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES long');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES) {\n            throw new SodiumException('Key must be CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES long');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return (string) sodium_crypto_aead_chacha20poly1305_ietf_encrypt(\n                $plaintext,\n                $assocData,\n                $nonce,\n                $key\n            );\n        }\n        if (self::use_fallback('crypto_aead_chacha20poly1305_ietf_encrypt')) {\n            return (string) call_user_func(\n                '\\\\Sodium\\\\crypto_aead_chacha20poly1305_ietf_encrypt',\n                $plaintext,\n                $assocData,\n                $nonce,\n                $key\n            );\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::aead_chacha20poly1305_ietf_encrypt(\n                $plaintext,\n                $assocData,\n                $nonce,\n                $key\n            );\n        }\n        return ParagonIE_Sodium_Crypto::aead_chacha20poly1305_ietf_encrypt(\n            $plaintext,\n            $assocData,\n            $nonce,\n            $key\n        );\n    }\n\n    /**\n     * Return a secure random key for use with the ChaCha20-Poly1305\n     * symmetric AEAD interface. (IETF version)\n     *\n     * @return string\n     * @throws Exception\n     * @throws Error\n     */\n    public static function crypto_aead_chacha20poly1305_ietf_keygen()\n    {\n        return random_bytes(self::CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES);\n    }\n\n    /**\n     * Authenticated Encryption with Associated Data: Decryption\n     *\n     * Algorithm:\n     *     XChaCha20-Poly1305\n     *\n     * This mode uses a 64-bit random nonce with a 64-bit counter.\n     * IETF mode uses a 96-bit random nonce with a 32-bit counter.\n     *\n     * @param string $ciphertext   Encrypted message (with Poly1305 MAC appended)\n     * @param string $assocData    Authenticated Associated Data (unencrypted)\n     * @param string $nonce        Number to be used only Once; must be 8 bytes\n     * @param string $key          Encryption key\n     * @param bool   $dontFallback Don't fallback to ext/sodium\n     *\n     * @return string|bool         The original plaintext message\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_aead_xchacha20poly1305_ietf_decrypt(\n        $ciphertext = '',\n        $assocData = '',\n        $nonce = '',\n        $key = '',\n        $dontFallback = false\n    ) {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES) {\n            throw new SodiumException('Nonce must be CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES long');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES) {\n            throw new SodiumException('Key must be CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES long');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($ciphertext) < self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES) {\n            throw new SodiumException('Message must be at least CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES long');\n        }\n        if (self::useNewSodiumAPI() && !$dontFallback) {\n            if (is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_decrypt')) {\n                return sodium_crypto_aead_xchacha20poly1305_ietf_decrypt(\n                    $ciphertext,\n                    $assocData,\n                    $nonce,\n                    $key\n                );\n            }\n        }\n\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::aead_xchacha20poly1305_ietf_decrypt(\n                $ciphertext,\n                $assocData,\n                $nonce,\n                $key\n            );\n        }\n        return ParagonIE_Sodium_Crypto::aead_xchacha20poly1305_ietf_decrypt(\n            $ciphertext,\n            $assocData,\n            $nonce,\n            $key\n        );\n    }\n\n    /**\n     * Authenticated Encryption with Associated Data\n     *\n     * Algorithm:\n     *     XChaCha20-Poly1305\n     *\n     * This mode uses a 64-bit random nonce with a 64-bit counter.\n     * IETF mode uses a 96-bit random nonce with a 32-bit counter.\n     *\n     * @param string $plaintext    Message to be encrypted\n     * @param string $assocData    Authenticated Associated Data (unencrypted)\n     * @param string $nonce        Number to be used only Once; must be 8 bytes\n     * @param string $key          Encryption key\n     * @param bool   $dontFallback Don't fallback to ext/sodium\n     *\n     * @return string           Ciphertext with a 16-byte Poly1305 message\n     *                          authentication code appended\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_aead_xchacha20poly1305_ietf_encrypt(\n        $plaintext = '',\n        $assocData = '',\n        $nonce = '',\n        $key = '',\n        $dontFallback = false\n    ) {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES) {\n            throw new SodiumException('Nonce must be CRYPTO_AEAD_XCHACHA20POLY1305_NPUBBYTES long');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES) {\n            throw new SodiumException('Key must be CRYPTO_AEAD_XCHACHA20POLY1305_KEYBYTES long');\n        }\n        if (self::useNewSodiumAPI() && !$dontFallback) {\n            if (is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_encrypt')) {\n                return sodium_crypto_aead_xchacha20poly1305_ietf_encrypt(\n                    $plaintext,\n                    $assocData,\n                    $nonce,\n                    $key\n                );\n            }\n        }\n\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::aead_xchacha20poly1305_ietf_encrypt(\n                $plaintext,\n                $assocData,\n                $nonce,\n                $key\n            );\n        }\n        return ParagonIE_Sodium_Crypto::aead_xchacha20poly1305_ietf_encrypt(\n            $plaintext,\n            $assocData,\n            $nonce,\n            $key\n        );\n    }\n\n    /**\n     * Return a secure random key for use with the XChaCha20-Poly1305\n     * symmetric AEAD interface.\n     *\n     * @return string\n     * @throws Exception\n     * @throws Error\n     */\n    public static function crypto_aead_xchacha20poly1305_ietf_keygen()\n    {\n        return random_bytes(self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES);\n    }\n\n    /**\n     * Authenticate a message. Uses symmetric-key cryptography.\n     *\n     * Algorithm:\n     *     HMAC-SHA512-256. Which is HMAC-SHA-512 truncated to 256 bits.\n     *     Not to be confused with HMAC-SHA-512/256 which would use the\n     *     SHA-512/256 hash function (uses different initial parameters\n     *     but still truncates to 256 bits to sidestep length-extension\n     *     attacks).\n     *\n     * @param string $message Message to be authenticated\n     * @param string $key Symmetric authentication key\n     * @return string         Message authentication code\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_auth($message, $key)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 2);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AUTH_KEYBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_AUTH_KEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return (string) sodium_crypto_auth($message, $key);\n        }\n        if (self::use_fallback('crypto_auth')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_auth', $message, $key);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::auth($message, $key);\n        }\n        return ParagonIE_Sodium_Crypto::auth($message, $key);\n    }\n\n    /**\n     * @return string\n     * @throws Exception\n     * @throws Error\n     */\n    public static function crypto_auth_keygen()\n    {\n        return random_bytes(self::CRYPTO_AUTH_KEYBYTES);\n    }\n\n    /**\n     * Verify the MAC of a message previously authenticated with crypto_auth.\n     *\n     * @param string $mac Message authentication code\n     * @param string $message Message whose authenticity you are attempting to\n     *                        verify (with a given MAC and key)\n     * @param string $key Symmetric authentication key\n     * @return bool           TRUE if authenticated, FALSE otherwise\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_auth_verify($mac, $message, $key)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($mac, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($mac) !== self::CRYPTO_AUTH_BYTES) {\n            throw new SodiumException('Argument 1 must be CRYPTO_AUTH_BYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AUTH_KEYBYTES) {\n            throw new SodiumException('Argument 3 must be CRYPTO_AUTH_KEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return (bool) sodium_crypto_auth_verify($mac, $message, $key);\n        }\n        if (self::use_fallback('crypto_auth_verify')) {\n            return (bool) call_user_func('\\\\Sodium\\\\crypto_auth_verify', $mac, $message, $key);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::auth_verify($mac, $message, $key);\n        }\n        return ParagonIE_Sodium_Crypto::auth_verify($mac, $message, $key);\n    }\n\n    /**\n     * Authenticated asymmetric-key encryption. Both the sender and recipient\n     * may decrypt messages.\n     *\n     * Algorithm: X25519-XSalsa20-Poly1305.\n     *     X25519: Elliptic-Curve Diffie Hellman over Curve25519.\n     *     XSalsa20: Extended-nonce variant of salsa20.\n     *     Poyl1305: Polynomial MAC for one-time message authentication.\n     *\n     * @param string $plaintext The message to be encrypted\n     * @param string $nonce A Number to only be used Once; must be 24 bytes\n     * @param string $keypair Your secret key and your recipient's public key\n     * @return string           Ciphertext with 16-byte Poly1305 MAC\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_box($plaintext, $nonce, $keypair)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 3);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_BOX_NONCEBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_BOX_NONCEBYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES) {\n            throw new SodiumException('Argument 3 must be CRYPTO_BOX_KEYPAIRBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return (string) sodium_crypto_box($plaintext, $nonce, $keypair);\n        }\n        if (self::use_fallback('crypto_box')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_box', $plaintext, $nonce, $keypair);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::box($plaintext, $nonce, $keypair);\n        }\n        return ParagonIE_Sodium_Crypto::box($plaintext, $nonce, $keypair);\n    }\n\n    /**\n     * Anonymous public-key encryption. Only the recipient may decrypt messages.\n     *\n     * Algorithm: X25519-XSalsa20-Poly1305, as with crypto_box.\n     *     The sender's X25519 keypair is ephemeral.\n     *     Nonce is generated from the BLAKE2b hash of both public keys.\n     *\n     * This provides ciphertext integrity.\n     *\n     * @param string $plaintext Message to be sealed\n     * @param string $publicKey Your recipient's public key\n     * @return string           Sealed message that only your recipient can\n     *                          decrypt\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_box_seal($plaintext, $publicKey)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_BOX_PUBLICKEYBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_BOX_PUBLICKEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return (string) sodium_crypto_box_seal($plaintext, $publicKey);\n        }\n        if (self::use_fallback('crypto_box_seal')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_box_seal', $plaintext, $publicKey);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::box_seal($plaintext, $publicKey);\n        }\n        return ParagonIE_Sodium_Crypto::box_seal($plaintext, $publicKey);\n    }\n\n    /**\n     * Opens a message encrypted with crypto_box_seal(). Requires\n     * the recipient's keypair (sk || pk) to decrypt successfully.\n     *\n     * This validates ciphertext integrity.\n     *\n     * @param string $ciphertext Sealed message to be opened\n     * @param string $keypair    Your crypto_box keypair\n     * @return string            The original plaintext message\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedInferredReturnType\n     * @psalm-suppress MixedReturnStatement\n     */\n    public static function crypto_box_seal_open($ciphertext, $keypair)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 2);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_BOX_KEYPAIRBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            /**\n             * @psalm-suppress InvalidReturnStatement\n             * @psalm-suppress FalsableReturnStatement\n             */\n            return sodium_crypto_box_seal_open($ciphertext, $keypair);\n        }\n        if (self::use_fallback('crypto_box_seal_open')) {\n            return call_user_func('\\\\Sodium\\\\crypto_box_seal_open', $ciphertext, $keypair);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::box_seal_open($ciphertext, $keypair);\n        }\n        return ParagonIE_Sodium_Crypto::box_seal_open($ciphertext, $keypair);\n    }\n\n    /**\n     * Generate a new random X25519 keypair.\n     *\n     * @return string A 64-byte string; the first 32 are your secret key, while\n     *                the last 32 are your public key. crypto_box_secretkey()\n     *                and crypto_box_publickey() exist to separate them so you\n     *                don't accidentally get them mixed up!\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_box_keypair()\n    {\n        if (self::useNewSodiumAPI()) {\n            return (string) sodium_crypto_box_keypair();\n        }\n        if (self::use_fallback('crypto_box_keypair')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_box_keypair');\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::box_keypair();\n        }\n        return ParagonIE_Sodium_Crypto::box_keypair();\n    }\n\n    /**\n     * Combine two keys into a keypair for use in library methods that expect\n     * a keypair. This doesn't necessarily have to be the same person's keys.\n     *\n     * @param string $secretKey Secret key\n     * @param string $publicKey Public key\n     * @return string    Keypair\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_box_keypair_from_secretkey_and_publickey($secretKey, $publicKey)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_BOX_SECRETKEYBYTES) {\n            throw new SodiumException('Argument 1 must be CRYPTO_BOX_SECRETKEYBYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_BOX_PUBLICKEYBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_BOX_PUBLICKEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return (string) sodium_crypto_box_keypair_from_secretkey_and_publickey($secretKey, $publicKey);\n        }\n        if (self::use_fallback('crypto_box_keypair_from_secretkey_and_publickey')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_box_keypair_from_secretkey_and_publickey', $secretKey, $publicKey);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::box_keypair_from_secretkey_and_publickey($secretKey, $publicKey);\n        }\n        return ParagonIE_Sodium_Crypto::box_keypair_from_secretkey_and_publickey($secretKey, $publicKey);\n    }\n\n    /**\n     * Decrypt a message previously encrypted with crypto_box().\n     *\n     * @param string $ciphertext Encrypted message\n     * @param string $nonce      Number to only be used Once; must be 24 bytes\n     * @param string $keypair    Your secret key and the sender's public key\n     * @return string            The original plaintext message\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedInferredReturnType\n     * @psalm-suppress MixedReturnStatement\n     */\n    public static function crypto_box_open($ciphertext, $nonce, $keypair)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 3);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($ciphertext) < self::CRYPTO_BOX_MACBYTES) {\n            throw new SodiumException('Argument 1 must be at least CRYPTO_BOX_MACBYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_BOX_NONCEBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_BOX_NONCEBYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES) {\n            throw new SodiumException('Argument 3 must be CRYPTO_BOX_KEYPAIRBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            /**\n             * @psalm-suppress InvalidReturnStatement\n             * @psalm-suppress FalsableReturnStatement\n             */\n            return sodium_crypto_box_open($ciphertext, $nonce, $keypair);\n        }\n        if (self::use_fallback('crypto_box_open')) {\n            return call_user_func('\\\\Sodium\\\\crypto_box_open', $ciphertext, $nonce, $keypair);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::box_open($ciphertext, $nonce, $keypair);\n        }\n        return ParagonIE_Sodium_Crypto::box_open($ciphertext, $nonce, $keypair);\n    }\n\n    /**\n     * Extract the public key from a crypto_box keypair.\n     *\n     * @param string $keypair Keypair containing secret and public key\n     * @return string         Your crypto_box public key\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_box_publickey($keypair)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES) {\n            throw new SodiumException('Argument 1 must be CRYPTO_BOX_KEYPAIRBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return (string) sodium_crypto_box_publickey($keypair);\n        }\n        if (self::use_fallback('crypto_box_publickey')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_box_publickey', $keypair);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::box_publickey($keypair);\n        }\n        return ParagonIE_Sodium_Crypto::box_publickey($keypair);\n    }\n\n    /**\n     * Calculate the X25519 public key from a given X25519 secret key.\n     *\n     * @param string $secretKey Any X25519 secret key\n     * @return string           The corresponding X25519 public key\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_box_publickey_from_secretkey($secretKey)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_BOX_SECRETKEYBYTES) {\n            throw new SodiumException('Argument 1 must be CRYPTO_BOX_SECRETKEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return (string) sodium_crypto_box_publickey_from_secretkey($secretKey);\n        }\n        if (self::use_fallback('crypto_box_publickey_from_secretkey')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_box_publickey_from_secretkey', $secretKey);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::box_publickey_from_secretkey($secretKey);\n        }\n        return ParagonIE_Sodium_Crypto::box_publickey_from_secretkey($secretKey);\n    }\n\n    /**\n     * Extract the secret key from a crypto_box keypair.\n     *\n     * @param string $keypair\n     * @return string         Your crypto_box secret key\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_box_secretkey($keypair)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES) {\n            throw new SodiumException('Argument 1 must be CRYPTO_BOX_KEYPAIRBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return (string) sodium_crypto_box_secretkey($keypair);\n        }\n        if (self::use_fallback('crypto_box_secretkey')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_box_secretkey', $keypair);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::box_secretkey($keypair);\n        }\n        return ParagonIE_Sodium_Crypto::box_secretkey($keypair);\n    }\n\n    /**\n     * Generate an X25519 keypair from a seed.\n     *\n     * @param string $seed\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress UndefinedFunction\n     */\n    public static function crypto_box_seed_keypair($seed)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($seed, 'string', 1);\n\n        if (self::useNewSodiumAPI()) {\n            return (string) sodium_crypto_box_seed_keypair($seed);\n        }\n        if (self::use_fallback('crypto_box_seed_keypair')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_box_seed_keypair', $seed);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::box_seed_keypair($seed);\n        }\n        return ParagonIE_Sodium_Crypto::box_seed_keypair($seed);\n    }\n\n    /**\n     * Calculates a BLAKE2b hash, with an optional key.\n     *\n     * @param string      $message The message to be hashed\n     * @param string|null $key     If specified, must be a string between 16\n     *                             and 64 bytes long\n     * @param int         $length  Output length in bytes; must be between 16\n     *                             and 64 (default = 32)\n     * @return string              Raw binary\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_generichash($message, $key = '', $length = self::CRYPTO_GENERICHASH_BYTES)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1);\n        if (is_null($key)) {\n            $key = '';\n        }\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($length, 'int', 3);\n\n        /* Input validation: */\n        if (!empty($key)) {\n            if (ParagonIE_Sodium_Core_Util::strlen($key) < self::CRYPTO_GENERICHASH_KEYBYTES_MIN) {\n                throw new SodiumException('Unsupported key size. Must be at least CRYPTO_GENERICHASH_KEYBYTES_MIN bytes long.');\n            }\n            if (ParagonIE_Sodium_Core_Util::strlen($key) > self::CRYPTO_GENERICHASH_KEYBYTES_MAX) {\n                throw new SodiumException('Unsupported key size. Must be at most CRYPTO_GENERICHASH_KEYBYTES_MAX bytes long.');\n            }\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return (string) sodium_crypto_generichash($message, $key, $length);\n        }\n        if (self::use_fallback('crypto_generichash')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_generichash', $message, $key, $length);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::generichash($message, $key, $length);\n        }\n        return ParagonIE_Sodium_Crypto::generichash($message, $key, $length);\n    }\n\n    /**\n     * Get the final BLAKE2b hash output for a given context.\n     *\n     * @param string $ctx BLAKE2 hashing context. Generated by crypto_generichash_init().\n     * @param int $length Hash output size.\n     * @return string     Final BLAKE2b hash.\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress ReferenceConstraintViolation\n     * @psalm-suppress ConflictingReferenceConstraint\n     */\n    public static function crypto_generichash_final(&$ctx, $length = self::CRYPTO_GENERICHASH_BYTES)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($ctx, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($length, 'int', 2);\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_generichash_final($ctx, $length);\n        }\n        if (self::use_fallback('crypto_generichash_final')) {\n            $func = '\\\\Sodium\\\\crypto_generichash_final';\n            return (string) $func($ctx, $length);\n        }\n        if ($length < 1) {\n            try {\n                self::memzero($ctx);\n            } catch (SodiumException $ex) {\n                unset($ctx);\n            }\n            return '';\n        }\n        if (PHP_INT_SIZE === 4) {\n            $result = ParagonIE_Sodium_Crypto32::generichash_final($ctx, $length);\n        } else {\n            $result = ParagonIE_Sodium_Crypto::generichash_final($ctx, $length);\n        }\n        try {\n            self::memzero($ctx);\n        } catch (SodiumException $ex) {\n            unset($ctx);\n        }\n        return $result;\n    }\n\n    /**\n     * Initialize a BLAKE2b hashing context, for use in a streaming interface.\n     *\n     * @param string|null $key If specified must be a string between 16 and 64 bytes\n     * @param int $length      The size of the desired hash output\n     * @return string          A BLAKE2 hashing context, encoded as a string\n     *                         (To be 100% compatible with ext/libsodium)\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_generichash_init($key = '', $length = self::CRYPTO_GENERICHASH_BYTES)\n    {\n        /* Type checks: */\n        if (is_null($key)) {\n            $key = '';\n        }\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($length, 'int', 2);\n\n        /* Input validation: */\n        if (!empty($key)) {\n            if (ParagonIE_Sodium_Core_Util::strlen($key) < self::CRYPTO_GENERICHASH_KEYBYTES_MIN) {\n                throw new SodiumException('Unsupported key size. Must be at least CRYPTO_GENERICHASH_KEYBYTES_MIN bytes long.');\n            }\n            if (ParagonIE_Sodium_Core_Util::strlen($key) > self::CRYPTO_GENERICHASH_KEYBYTES_MAX) {\n                throw new SodiumException('Unsupported key size. Must be at most CRYPTO_GENERICHASH_KEYBYTES_MAX bytes long.');\n            }\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_generichash_init($key, $length);\n        }\n        if (self::use_fallback('crypto_generichash_init')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_generichash_init', $key, $length);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::generichash_init($key, $length);\n        }\n        return ParagonIE_Sodium_Crypto::generichash_init($key, $length);\n    }\n\n    /**\n     * Initialize a BLAKE2b hashing context, for use in a streaming interface.\n     *\n     * @param string|null $key If specified must be a string between 16 and 64 bytes\n     * @param int $length      The size of the desired hash output\n     * @param string $salt     Salt (up to 16 bytes)\n     * @param string $personal Personalization string (up to 16 bytes)\n     * @return string          A BLAKE2 hashing context, encoded as a string\n     *                         (To be 100% compatible with ext/libsodium)\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_generichash_init_salt_personal(\n        $key = '',\n        $length = self::CRYPTO_GENERICHASH_BYTES,\n        $salt = '',\n        $personal = ''\n    ) {\n        /* Type checks: */\n        if (is_null($key)) {\n            $key = '';\n        }\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($length, 'int', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($salt, 'string', 3);\n        ParagonIE_Sodium_Core_Util::declareScalarType($personal, 'string', 4);\n        $salt = str_pad($salt, 16, \"\\0\", STR_PAD_RIGHT);\n        $personal = str_pad($personal, 16, \"\\0\", STR_PAD_RIGHT);\n\n        /* Input validation: */\n        if (!empty($key)) {\n            /*\n            if (ParagonIE_Sodium_Core_Util::strlen($key) < self::CRYPTO_GENERICHASH_KEYBYTES_MIN) {\n                throw new SodiumException('Unsupported key size. Must be at least CRYPTO_GENERICHASH_KEYBYTES_MIN bytes long.');\n            }\n            */\n            if (ParagonIE_Sodium_Core_Util::strlen($key) > self::CRYPTO_GENERICHASH_KEYBYTES_MAX) {\n                throw new SodiumException('Unsupported key size. Must be at most CRYPTO_GENERICHASH_KEYBYTES_MAX bytes long.');\n            }\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::generichash_init_salt_personal($key, $length, $salt, $personal);\n        }\n        return ParagonIE_Sodium_Crypto::generichash_init_salt_personal($key, $length, $salt, $personal);\n    }\n\n    /**\n     * Update a BLAKE2b hashing context with additional data.\n     *\n     * @param string $ctx    BLAKE2 hashing context. Generated by crypto_generichash_init().\n     *                       $ctx is passed by reference and gets updated in-place.\n     * @param-out string $ctx\n     * @param string $message The message to append to the existing hash state.\n     * @return void\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress ReferenceConstraintViolation\n     */\n    public static function crypto_generichash_update(&$ctx, $message)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($ctx, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 2);\n\n        if (self::useNewSodiumAPI()) {\n            sodium_crypto_generichash_update($ctx, $message);\n            return;\n        }\n        if (self::use_fallback('crypto_generichash_update')) {\n            $func = '\\\\Sodium\\\\crypto_generichash_update';\n            $func($ctx, $message);\n            return;\n        }\n        if (PHP_INT_SIZE === 4) {\n            $ctx = ParagonIE_Sodium_Crypto32::generichash_update($ctx, $message);\n        } else {\n            $ctx = ParagonIE_Sodium_Crypto::generichash_update($ctx, $message);\n        }\n    }\n\n    /**\n     * @return string\n     * @throws Exception\n     * @throws Error\n     */\n    public static function crypto_generichash_keygen()\n    {\n        return random_bytes(self::CRYPTO_GENERICHASH_KEYBYTES);\n    }\n\n    /**\n     * @param int $subkey_len\n     * @param int $subkey_id\n     * @param string $context\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     */\n    public static function crypto_kdf_derive_from_key(\n        $subkey_len,\n        $subkey_id,\n        $context,\n        $key\n    ) {\n        ParagonIE_Sodium_Core_Util::declareScalarType($subkey_len, 'int', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($subkey_id, 'int', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($context, 'string', 3);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4);\n        $subkey_id = (int) $subkey_id;\n        $subkey_len = (int) $subkey_len;\n        $context = (string) $context;\n        $key = (string) $key;\n\n        if ($subkey_len < self::CRYPTO_KDF_BYTES_MIN) {\n            throw new SodiumException('subkey cannot be smaller than SODIUM_CRYPTO_KDF_BYTES_MIN');\n        }\n        if ($subkey_len > self::CRYPTO_KDF_BYTES_MAX) {\n            throw new SodiumException('subkey cannot be larger than SODIUM_CRYPTO_KDF_BYTES_MAX');\n        }\n        if ($subkey_id < 0) {\n            throw new SodiumException('subkey_id cannot be negative');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($context) !== self::CRYPTO_KDF_CONTEXTBYTES) {\n            throw new SodiumException('context should be SODIUM_CRYPTO_KDF_CONTEXTBYTES bytes');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_KDF_KEYBYTES) {\n            throw new SodiumException('key should be SODIUM_CRYPTO_KDF_KEYBYTES bytes');\n        }\n\n        $salt = ParagonIE_Sodium_Core_Util::store64_le($subkey_id);\n        $state = self::crypto_generichash_init_salt_personal(\n            $key,\n            $subkey_len,\n            $salt,\n            $context\n        );\n        return self::crypto_generichash_final($state, $subkey_len);\n    }\n\n    /**\n     * @return string\n     * @throws Exception\n     * @throws Error\n     */\n    public static function crypto_kdf_keygen()\n    {\n        return random_bytes(self::CRYPTO_KDF_KEYBYTES);\n    }\n\n    /**\n     * Perform a key exchange, between a designated client and a server.\n     *\n     * Typically, you would designate one machine to be the client and the\n     * other to be the server. The first two keys are what you'd expect for\n     * scalarmult() below, but the latter two public keys don't swap places.\n     *\n     * | ALICE                          | BOB                                 |\n     * | Client                         | Server                              |\n     * |--------------------------------|-------------------------------------|\n     * | shared = crypto_kx(            | shared = crypto_kx(                 |\n     * |     alice_sk,                  |     bob_sk,                         | <- contextual\n     * |     bob_pk,                    |     alice_pk,                       | <- contextual\n     * |     alice_pk,                  |     alice_pk,                       | <----- static\n     * |     bob_pk                     |     bob_pk                          | <----- static\n     * | )                              | )                                   |\n     *\n     * They are used along with the scalarmult product to generate a 256-bit\n     * BLAKE2b hash unique to the client and server keys.\n     *\n     * @param string $my_secret\n     * @param string $their_public\n     * @param string $client_public\n     * @param string $server_public\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_kx($my_secret, $their_public, $client_public, $server_public)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($my_secret, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($their_public, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($client_public, 'string', 3);\n        ParagonIE_Sodium_Core_Util::declareScalarType($server_public, 'string', 4);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($my_secret) !== self::CRYPTO_BOX_SECRETKEYBYTES) {\n            throw new SodiumException('Argument 1 must be CRYPTO_BOX_SECRETKEYBYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($their_public) !== self::CRYPTO_BOX_PUBLICKEYBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_BOX_PUBLICKEYBYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($client_public) !== self::CRYPTO_BOX_PUBLICKEYBYTES) {\n            throw new SodiumException('Argument 3 must be CRYPTO_BOX_PUBLICKEYBYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($server_public) !== self::CRYPTO_BOX_PUBLICKEYBYTES) {\n            throw new SodiumException('Argument 4 must be CRYPTO_BOX_PUBLICKEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            if (is_callable('sodium_crypto_kx')) {\n                return (string) sodium_crypto_kx(\n                    $my_secret,\n                    $their_public,\n                    $client_public,\n                    $server_public\n                );\n            }\n        }\n        if (self::use_fallback('crypto_kx')) {\n            return (string) call_user_func(\n                '\\\\Sodium\\\\crypto_kx',\n                $my_secret,\n                $their_public,\n                $client_public,\n                $server_public\n            );\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::keyExchange(\n                $my_secret,\n                $their_public,\n                $client_public,\n                $server_public\n            );\n        }\n        return ParagonIE_Sodium_Crypto::keyExchange(\n            $my_secret,\n            $their_public,\n            $client_public,\n            $server_public\n        );\n    }\n\n    /**\n     * @param string $seed\n     * @return string\n     * @throws SodiumException\n     */\n    public static function crypto_kx_seed_keypair($seed)\n    {\n        ParagonIE_Sodium_Core_Util::declareScalarType($seed, 'string', 1);\n\n        $seed = (string) $seed;\n\n        if (ParagonIE_Sodium_Core_Util::strlen($seed) !== self::CRYPTO_KX_SEEDBYTES) {\n            throw new SodiumException('seed must be SODIUM_CRYPTO_KX_SEEDBYTES bytes');\n        }\n\n        $sk = self::crypto_generichash($seed, '', self::CRYPTO_KX_SECRETKEYBYTES);\n        $pk = self::crypto_scalarmult_base($sk);\n        return $sk . $pk;\n    }\n\n    /**\n     * @return string\n     * @throws Exception\n     */\n    public static function crypto_kx_keypair()\n    {\n        $sk = self::randombytes_buf(self::CRYPTO_KX_SECRETKEYBYTES);\n        $pk = self::crypto_scalarmult_base($sk);\n        return $sk . $pk;\n    }\n\n    /**\n     * @param string $keypair\n     * @param string $serverPublicKey\n     * @return array{0: string, 1: string}\n     * @throws SodiumException\n     */\n    public static function crypto_kx_client_session_keys($keypair, $serverPublicKey)\n    {\n        ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($serverPublicKey, 'string', 2);\n\n        $keypair = (string) $keypair;\n        $serverPublicKey = (string) $serverPublicKey;\n\n        if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_KX_KEYPAIRBYTES) {\n            throw new SodiumException('keypair should be SODIUM_CRYPTO_KX_KEYPAIRBYTES bytes');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($serverPublicKey) !== self::CRYPTO_KX_PUBLICKEYBYTES) {\n            throw new SodiumException('public keys must be SODIUM_CRYPTO_KX_PUBLICKEYBYTES bytes');\n        }\n\n        $sk = self::crypto_kx_secretkey($keypair);\n        $pk = self::crypto_kx_publickey($keypair);\n        $h = self::crypto_generichash_init(null, self::CRYPTO_KX_SESSIONKEYBYTES * 2);\n        self::crypto_generichash_update($h, self::crypto_scalarmult($sk, $serverPublicKey));\n        self::crypto_generichash_update($h, $pk);\n        self::crypto_generichash_update($h, $serverPublicKey);\n        $sessionKeys = self::crypto_generichash_final($h, self::CRYPTO_KX_SESSIONKEYBYTES * 2);\n        return array(\n            ParagonIE_Sodium_Core_Util::substr(\n                $sessionKeys,\n                0,\n                self::CRYPTO_KX_SESSIONKEYBYTES\n            ),\n            ParagonIE_Sodium_Core_Util::substr(\n                $sessionKeys,\n                self::CRYPTO_KX_SESSIONKEYBYTES,\n                self::CRYPTO_KX_SESSIONKEYBYTES\n            )\n        );\n    }\n\n    /**\n     * @param string $keypair\n     * @param string $clientPublicKey\n     * @return array{0: string, 1: string}\n     * @throws SodiumException\n     */\n    public static function crypto_kx_server_session_keys($keypair, $clientPublicKey)\n    {\n        ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($clientPublicKey, 'string', 2);\n\n        $keypair = (string) $keypair;\n        $clientPublicKey = (string) $clientPublicKey;\n\n        if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_KX_KEYPAIRBYTES) {\n            throw new SodiumException('keypair should be SODIUM_CRYPTO_KX_KEYPAIRBYTES bytes');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($clientPublicKey) !== self::CRYPTO_KX_PUBLICKEYBYTES) {\n            throw new SodiumException('public keys must be SODIUM_CRYPTO_KX_PUBLICKEYBYTES bytes');\n        }\n\n        $sk = self::crypto_kx_secretkey($keypair);\n        $pk = self::crypto_kx_publickey($keypair);\n        $h = self::crypto_generichash_init(null, self::CRYPTO_KX_SESSIONKEYBYTES * 2);\n        self::crypto_generichash_update($h, self::crypto_scalarmult($sk, $clientPublicKey));\n        self::crypto_generichash_update($h, $clientPublicKey);\n        self::crypto_generichash_update($h, $pk);\n        $sessionKeys = self::crypto_generichash_final($h, self::CRYPTO_KX_SESSIONKEYBYTES * 2);\n        return array(\n            ParagonIE_Sodium_Core_Util::substr(\n                $sessionKeys,\n                self::CRYPTO_KX_SESSIONKEYBYTES,\n                self::CRYPTO_KX_SESSIONKEYBYTES\n            ),\n            ParagonIE_Sodium_Core_Util::substr(\n                $sessionKeys,\n                0,\n                self::CRYPTO_KX_SESSIONKEYBYTES\n            )\n        );\n    }\n\n    /**\n     * @param string $kp\n     * @return string\n     * @throws SodiumException\n     */\n    public static function crypto_kx_secretkey($kp)\n    {\n        return ParagonIE_Sodium_Core_Util::substr(\n            $kp,\n            0,\n            self::CRYPTO_KX_SECRETKEYBYTES\n        );\n    }\n\n    /**\n     * @param string $kp\n     * @return string\n     * @throws SodiumException\n     */\n    public static function crypto_kx_publickey($kp)\n    {\n        return ParagonIE_Sodium_Core_Util::substr(\n            $kp,\n            self::CRYPTO_KX_SECRETKEYBYTES,\n            self::CRYPTO_KX_PUBLICKEYBYTES\n        );\n    }\n\n    /**\n     * @param int $outlen\n     * @param string $passwd\n     * @param string $salt\n     * @param int $opslimit\n     * @param int $memlimit\n     * @param int|null $alg\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $alg = null)\n    {\n        ParagonIE_Sodium_Core_Util::declareScalarType($outlen, 'int', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($salt,  'string', 3);\n        ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 4);\n        ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 5);\n\n        if (self::useNewSodiumAPI()) {\n            if (!is_null($alg)) {\n                ParagonIE_Sodium_Core_Util::declareScalarType($alg, 'int', 6);\n                return sodium_crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $alg);\n            }\n            return sodium_crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit);\n        }\n        if (self::use_fallback('crypto_pwhash')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_pwhash', $outlen, $passwd, $salt, $opslimit, $memlimit);\n        }\n        // This is the best we can do.\n        throw new SodiumException(\n            'This is not implemented, as it is not possible to implement Argon2i with acceptable performance in pure-PHP'\n        );\n    }\n\n    /**\n     * !Exclusive to sodium_compat!\n     *\n     * This returns TRUE if the native crypto_pwhash API is available by libsodium.\n     * This returns FALSE if only sodium_compat is available.\n     *\n     * @return bool\n     */\n    public static function crypto_pwhash_is_available()\n    {\n        if (self::useNewSodiumAPI()) {\n            return true;\n        }\n        if (self::use_fallback('crypto_pwhash')) {\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * @param string $passwd\n     * @param int $opslimit\n     * @param int $memlimit\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_pwhash_str($passwd, $opslimit, $memlimit)\n    {\n        ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 3);\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_pwhash_str($passwd, $opslimit, $memlimit);\n        }\n        if (self::use_fallback('crypto_pwhash_str')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_pwhash_str', $passwd, $opslimit, $memlimit);\n        }\n        // This is the best we can do.\n        throw new SodiumException(\n            'This is not implemented, as it is not possible to implement Argon2i with acceptable performance in pure-PHP'\n        );\n    }\n\n    /**\n     * Do we need to rehash this password?\n     *\n     * @param string $hash\n     * @param int $opslimit\n     * @param int $memlimit\n     * @return bool\n     * @throws SodiumException\n     */\n    public static function crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit)\n    {\n        ParagonIE_Sodium_Core_Util::declareScalarType($hash, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 3);\n\n        // Just grab the first 4 pieces.\n        $pieces = explode('$', (string) $hash);\n        $prefix = implode('$', array_slice($pieces, 0, 4));\n\n        // Rebuild the expected header.\n        /** @var int $ops */\n        $ops = (int) $opslimit;\n        /** @var int $mem */\n        $mem = (int) $memlimit >> 10;\n        $encoded = self::CRYPTO_PWHASH_STRPREFIX . 'v=19$m=' . $mem . ',t=' . $ops . ',p=1';\n\n        // Do they match? If so, we don't need to rehash, so return false.\n        return !ParagonIE_Sodium_Core_Util::hashEquals($encoded, $prefix);\n    }\n\n    /**\n     * @param string $passwd\n     * @param string $hash\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_pwhash_str_verify($passwd, $hash)\n    {\n        ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($hash, 'string', 2);\n\n        if (self::useNewSodiumAPI()) {\n            return (bool) sodium_crypto_pwhash_str_verify($passwd, $hash);\n        }\n        if (self::use_fallback('crypto_pwhash_str_verify')) {\n            return (bool) call_user_func('\\\\Sodium\\\\crypto_pwhash_str_verify', $passwd, $hash);\n        }\n        // This is the best we can do.\n        throw new SodiumException(\n            'This is not implemented, as it is not possible to implement Argon2i with acceptable performance in pure-PHP'\n        );\n    }\n\n    /**\n     * @param int $outlen\n     * @param string $passwd\n     * @param string $salt\n     * @param int $opslimit\n     * @param int $memlimit\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit)\n    {\n        ParagonIE_Sodium_Core_Util::declareScalarType($outlen, 'int', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($salt,  'string', 3);\n        ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 4);\n        ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 5);\n\n        if (self::useNewSodiumAPI()) {\n            return (string) sodium_crypto_pwhash_scryptsalsa208sha256(\n                (int) $outlen,\n                (string) $passwd,\n                (string) $salt,\n                (int) $opslimit,\n                (int) $memlimit\n            );\n        }\n        if (self::use_fallback('crypto_pwhash_scryptsalsa208sha256')) {\n            return (string) call_user_func(\n                '\\\\Sodium\\\\crypto_pwhash_scryptsalsa208sha256',\n                (int) $outlen,\n                (string) $passwd,\n                (string) $salt,\n                (int) $opslimit,\n                (int) $memlimit\n            );\n        }\n        // This is the best we can do.\n        throw new SodiumException(\n            'This is not implemented, as it is not possible to implement Scrypt with acceptable performance in pure-PHP'\n        );\n    }\n\n    /**\n     * !Exclusive to sodium_compat!\n     *\n     * This returns TRUE if the native crypto_pwhash API is available by libsodium.\n     * This returns FALSE if only sodium_compat is available.\n     *\n     * @return bool\n     */\n    public static function crypto_pwhash_scryptsalsa208sha256_is_available()\n    {\n        if (self::useNewSodiumAPI()) {\n            return true;\n        }\n        if (self::use_fallback('crypto_pwhash_scryptsalsa208sha256')) {\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * @param string $passwd\n     * @param int $opslimit\n     * @param int $memlimit\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit)\n    {\n        ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 3);\n\n        if (self::useNewSodiumAPI()) {\n            return (string) sodium_crypto_pwhash_scryptsalsa208sha256_str(\n                (string) $passwd,\n                (int) $opslimit,\n                (int) $memlimit\n            );\n        }\n        if (self::use_fallback('crypto_pwhash_scryptsalsa208sha256_str')) {\n            return (string) call_user_func(\n                '\\\\Sodium\\\\crypto_pwhash_scryptsalsa208sha256_str',\n                (string) $passwd,\n                (int) $opslimit,\n                (int) $memlimit\n            );\n        }\n        // This is the best we can do.\n        throw new SodiumException(\n            'This is not implemented, as it is not possible to implement Scrypt with acceptable performance in pure-PHP'\n        );\n    }\n\n    /**\n     * @param string $passwd\n     * @param string $hash\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash)\n    {\n        ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($hash, 'string', 2);\n\n        if (self::useNewSodiumAPI()) {\n            return (bool) sodium_crypto_pwhash_scryptsalsa208sha256_str_verify(\n                (string) $passwd,\n                (string) $hash\n            );\n        }\n        if (self::use_fallback('crypto_pwhash_scryptsalsa208sha256_str_verify')) {\n            return (bool) call_user_func(\n                '\\\\Sodium\\\\crypto_pwhash_scryptsalsa208sha256_str_verify',\n                (string) $passwd,\n                (string) $hash\n            );\n        }\n        // This is the best we can do.\n        throw new SodiumException(\n            'This is not implemented, as it is not possible to implement Scrypt with acceptable performance in pure-PHP'\n        );\n    }\n\n    /**\n     * Calculate the shared secret between your secret key and your\n     * recipient's public key.\n     *\n     * Algorithm: X25519 (ECDH over Curve25519)\n     *\n     * @param string $secretKey\n     * @param string $publicKey\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_scalarmult($secretKey, $publicKey)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_BOX_SECRETKEYBYTES) {\n            throw new SodiumException('Argument 1 must be CRYPTO_BOX_SECRETKEYBYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_BOX_PUBLICKEYBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_BOX_PUBLICKEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_scalarmult($secretKey, $publicKey);\n        }\n        if (self::use_fallback('crypto_scalarmult')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_scalarmult', $secretKey, $publicKey);\n        }\n\n        /* Output validation: Forbid all-zero keys */\n        if (ParagonIE_Sodium_Core_Util::hashEquals($secretKey, str_repeat(\"\\0\", self::CRYPTO_BOX_SECRETKEYBYTES))) {\n            throw new SodiumException('Zero secret key is not allowed');\n        }\n        if (ParagonIE_Sodium_Core_Util::hashEquals($publicKey, str_repeat(\"\\0\", self::CRYPTO_BOX_PUBLICKEYBYTES))) {\n            throw new SodiumException('Zero public key is not allowed');\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::scalarmult($secretKey, $publicKey);\n        }\n        return ParagonIE_Sodium_Crypto::scalarmult($secretKey, $publicKey);\n    }\n\n    /**\n     * Calculate an X25519 public key from an X25519 secret key.\n     *\n     * @param string $secretKey\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress TooFewArguments\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_scalarmult_base($secretKey)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_BOX_SECRETKEYBYTES) {\n            throw new SodiumException('Argument 1 must be CRYPTO_BOX_SECRETKEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_scalarmult_base($secretKey);\n        }\n        if (self::use_fallback('crypto_scalarmult_base')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_scalarmult_base', $secretKey);\n        }\n        if (ParagonIE_Sodium_Core_Util::hashEquals($secretKey, str_repeat(\"\\0\", self::CRYPTO_BOX_SECRETKEYBYTES))) {\n            throw new SodiumException('Zero secret key is not allowed');\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::scalarmult_base($secretKey);\n        }\n        return ParagonIE_Sodium_Crypto::scalarmult_base($secretKey);\n    }\n\n    /**\n     * Authenticated symmetric-key encryption.\n     *\n     * Algorithm: XSalsa20-Poly1305\n     *\n     * @param string $plaintext The message you're encrypting\n     * @param string $nonce A Number to be used Once; must be 24 bytes\n     * @param string $key Symmetric encryption key\n     * @return string           Ciphertext with Poly1305 MAC\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_secretbox($plaintext, $nonce, $key)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_SECRETBOX_NONCEBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_SECRETBOX_KEYBYTES) {\n            throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_KEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_secretbox($plaintext, $nonce, $key);\n        }\n        if (self::use_fallback('crypto_secretbox')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_secretbox', $plaintext, $nonce, $key);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::secretbox($plaintext, $nonce, $key);\n        }\n        return ParagonIE_Sodium_Crypto::secretbox($plaintext, $nonce, $key);\n    }\n\n    /**\n     * Decrypts a message previously encrypted with crypto_secretbox().\n     *\n     * @param string $ciphertext Ciphertext with Poly1305 MAC\n     * @param string $nonce      A Number to be used Once; must be 24 bytes\n     * @param string $key        Symmetric encryption key\n     * @return string            Original plaintext message\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedInferredReturnType\n     * @psalm-suppress MixedReturnStatement\n     */\n    public static function crypto_secretbox_open($ciphertext, $nonce, $key)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_SECRETBOX_NONCEBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_SECRETBOX_KEYBYTES) {\n            throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_KEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            /**\n             * @psalm-suppress InvalidReturnStatement\n             * @psalm-suppress FalsableReturnStatement\n             */\n            return sodium_crypto_secretbox_open($ciphertext, $nonce, $key);\n        }\n        if (self::use_fallback('crypto_secretbox_open')) {\n            return call_user_func('\\\\Sodium\\\\crypto_secretbox_open', $ciphertext, $nonce, $key);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::secretbox_open($ciphertext, $nonce, $key);\n        }\n        return ParagonIE_Sodium_Crypto::secretbox_open($ciphertext, $nonce, $key);\n    }\n\n    /**\n     * Return a secure random key for use with crypto_secretbox\n     *\n     * @return string\n     * @throws Exception\n     * @throws Error\n     */\n    public static function crypto_secretbox_keygen()\n    {\n        return random_bytes(self::CRYPTO_SECRETBOX_KEYBYTES);\n    }\n\n    /**\n     * Authenticated symmetric-key encryption.\n     *\n     * Algorithm: XChaCha20-Poly1305\n     *\n     * @param string $plaintext The message you're encrypting\n     * @param string $nonce     A Number to be used Once; must be 24 bytes\n     * @param string $key       Symmetric encryption key\n     * @return string           Ciphertext with Poly1305 MAC\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_secretbox_xchacha20poly1305($plaintext, $nonce, $key)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_SECRETBOX_NONCEBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_SECRETBOX_KEYBYTES) {\n            throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_KEYBYTES long.');\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::secretbox_xchacha20poly1305($plaintext, $nonce, $key);\n        }\n        return ParagonIE_Sodium_Crypto::secretbox_xchacha20poly1305($plaintext, $nonce, $key);\n    }\n    /**\n     * Decrypts a message previously encrypted with crypto_secretbox_xchacha20poly1305().\n     *\n     * @param string $ciphertext Ciphertext with Poly1305 MAC\n     * @param string $nonce      A Number to be used Once; must be 24 bytes\n     * @param string $key        Symmetric encryption key\n     * @return string            Original plaintext message\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_SECRETBOX_NONCEBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_SECRETBOX_KEYBYTES) {\n            throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_KEYBYTES long.');\n        }\n\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key);\n        }\n        return ParagonIE_Sodium_Crypto::secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key);\n    }\n\n    /**\n     * @param string $key\n     * @return array<int, string> Returns a state and a header.\n     * @throws Exception\n     * @throws SodiumException\n     */\n    public static function crypto_secretstream_xchacha20poly1305_init_push($key)\n    {\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_init_push($key);\n        }\n        return ParagonIE_Sodium_Crypto::secretstream_xchacha20poly1305_init_push($key);\n    }\n\n    /**\n     * @param string $header\n     * @param string $key\n     * @return string Returns a state.\n     * @throws Exception\n     */\n    public static function crypto_secretstream_xchacha20poly1305_init_pull($header, $key)\n    {\n        if (ParagonIE_Sodium_Core_Util::strlen($header) < self::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES) {\n            throw new SodiumException(\n                'header size should be SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES bytes'\n            );\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_init_pull($key, $header);\n        }\n        return ParagonIE_Sodium_Crypto::secretstream_xchacha20poly1305_init_pull($key, $header);\n    }\n\n    /**\n     * @param string $state\n     * @param string $msg\n     * @param string $aad\n     * @param int $tag\n     * @return string\n     * @throws SodiumException\n     */\n    public static function crypto_secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0)\n    {\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_push(\n                $state,\n                $msg,\n                $aad,\n                $tag\n            );\n        }\n        return ParagonIE_Sodium_Crypto::secretstream_xchacha20poly1305_push(\n            $state,\n            $msg,\n            $aad,\n            $tag\n        );\n    }\n\n    /**\n     * @param string $state\n     * @param string $msg\n     * @param string $aad\n     * @return bool|array{0: string, 1: int}\n     * @throws SodiumException\n     */\n    public static function crypto_secretstream_xchacha20poly1305_pull(&$state, $msg, $aad = '')\n    {\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_pull(\n                $state,\n                $msg,\n                $aad\n            );\n        }\n        return ParagonIE_Sodium_Crypto::secretstream_xchacha20poly1305_pull(\n            $state,\n            $msg,\n            $aad\n        );\n    }\n\n    /**\n     * @return string\n     * @throws Exception\n     */\n    public static function crypto_secretstream_xchacha20poly1305_keygen()\n    {\n        return random_bytes(self::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES);\n    }\n\n    /**\n     * @param string $state\n     * @return void\n     * @throws SodiumException\n     */\n    public static function crypto_secretstream_xchacha20poly1305_rekey(&$state)\n    {\n        if (PHP_INT_SIZE === 4) {\n            ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_rekey($state);\n        } else {\n            ParagonIE_Sodium_Crypto::secretstream_xchacha20poly1305_rekey($state);\n        }\n    }\n\n    /**\n     * Calculates a SipHash-2-4 hash of a message for a given key.\n     *\n     * @param string $message Input message\n     * @param string $key SipHash-2-4 key\n     * @return string         Hash\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedInferredReturnType\n     * @psalm-suppress MixedReturnStatement\n     */\n    public static function crypto_shorthash($message, $key)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 2);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_SHORTHASH_KEYBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_SHORTHASH_KEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_shorthash($message, $key);\n        }\n        if (self::use_fallback('crypto_shorthash')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_shorthash', $message, $key);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Core32_SipHash::sipHash24($message, $key);\n        }\n        return ParagonIE_Sodium_Core_SipHash::sipHash24($message, $key);\n    }\n\n    /**\n     * Return a secure random key for use with crypto_shorthash\n     *\n     * @return string\n     * @throws Exception\n     * @throws Error\n     */\n    public static function crypto_shorthash_keygen()\n    {\n        return random_bytes(self::CRYPTO_SHORTHASH_KEYBYTES);\n    }\n\n    /**\n     * Returns a signed message. You probably want crypto_sign_detached()\n     * instead, which only returns the signature.\n     *\n     * Algorithm: Ed25519 (EdDSA over Curve25519)\n     *\n     * @param string $message Message to be signed.\n     * @param string $secretKey Secret signing key.\n     * @return string           Signed message (signature is prefixed).\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedInferredReturnType\n     * @psalm-suppress MixedReturnStatement\n     */\n    public static function crypto_sign($message, $secretKey)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 2);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_SIGN_SECRETKEYBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_SIGN_SECRETKEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_sign($message, $secretKey);\n        }\n        if (self::use_fallback('crypto_sign')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_sign', $message, $secretKey);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::sign($message, $secretKey);\n        }\n        return ParagonIE_Sodium_Crypto::sign($message, $secretKey);\n    }\n\n    /**\n     * Validates a signed message then returns the message.\n     *\n     * @param string $signedMessage A signed message\n     * @param string $publicKey A public key\n     * @return string               The original message (if the signature is\n     *                              valid for this public key)\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedInferredReturnType\n     * @psalm-suppress MixedReturnStatement\n     */\n    public static function crypto_sign_open($signedMessage, $publicKey)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($signedMessage, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($signedMessage) < self::CRYPTO_SIGN_BYTES) {\n            throw new SodiumException('Argument 1 must be at least CRYPTO_SIGN_BYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_SIGN_PUBLICKEYBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_SIGN_PUBLICKEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            /**\n             * @psalm-suppress InvalidReturnStatement\n             * @psalm-suppress FalsableReturnStatement\n             */\n            return sodium_crypto_sign_open($signedMessage, $publicKey);\n        }\n        if (self::use_fallback('crypto_sign_open')) {\n            return call_user_func('\\\\Sodium\\\\crypto_sign_open', $signedMessage, $publicKey);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::sign_open($signedMessage, $publicKey);\n        }\n        return ParagonIE_Sodium_Crypto::sign_open($signedMessage, $publicKey);\n    }\n\n    /**\n     * Generate a new random Ed25519 keypair.\n     *\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function crypto_sign_keypair()\n    {\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_sign_keypair();\n        }\n        if (self::use_fallback('crypto_sign_keypair')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_sign_keypair');\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Core32_Ed25519::keypair();\n        }\n        return ParagonIE_Sodium_Core_Ed25519::keypair();\n    }\n\n    /**\n     * @param string $sk\n     * @param string $pk\n     * @return string\n     * @throws SodiumException\n     */\n    public static function crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk)\n    {\n        ParagonIE_Sodium_Core_Util::declareScalarType($sk, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($pk, 'string', 1);\n        $sk = (string) $sk;\n        $pk = (string) $pk;\n\n        if (ParagonIE_Sodium_Core_Util::strlen($sk) !== self::CRYPTO_SIGN_SECRETKEYBYTES) {\n            throw new SodiumException('secretkey should be SODIUM_CRYPTO_SIGN_SECRETKEYBYTES bytes');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($pk) !== self::CRYPTO_SIGN_PUBLICKEYBYTES) {\n            throw new SodiumException('publickey should be SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES bytes');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk);\n        }\n        return $sk . $pk;\n    }\n\n    /**\n     * Generate an Ed25519 keypair from a seed.\n     *\n     * @param string $seed Input seed\n     * @return string      Keypair\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_sign_seed_keypair($seed)\n    {\n        ParagonIE_Sodium_Core_Util::declareScalarType($seed, 'string', 1);\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_sign_seed_keypair($seed);\n        }\n        if (self::use_fallback('crypto_sign_keypair')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_sign_seed_keypair', $seed);\n        }\n        $publicKey = '';\n        $secretKey = '';\n        if (PHP_INT_SIZE === 4) {\n            ParagonIE_Sodium_Core32_Ed25519::seed_keypair($publicKey, $secretKey, $seed);\n        } else {\n            ParagonIE_Sodium_Core_Ed25519::seed_keypair($publicKey, $secretKey, $seed);\n        }\n        return $secretKey . $publicKey;\n    }\n\n    /**\n     * Extract an Ed25519 public key from an Ed25519 keypair.\n     *\n     * @param string $keypair Keypair\n     * @return string         Public key\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_sign_publickey($keypair)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_SIGN_KEYPAIRBYTES) {\n            throw new SodiumException('Argument 1 must be CRYPTO_SIGN_KEYPAIRBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_sign_publickey($keypair);\n        }\n        if (self::use_fallback('crypto_sign_publickey')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_sign_publickey', $keypair);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Core32_Ed25519::publickey($keypair);\n        }\n        return ParagonIE_Sodium_Core_Ed25519::publickey($keypair);\n    }\n\n    /**\n     * Calculate an Ed25519 public key from an Ed25519 secret key.\n     *\n     * @param string $secretKey Your Ed25519 secret key\n     * @return string           The corresponding Ed25519 public key\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_sign_publickey_from_secretkey($secretKey)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_SIGN_SECRETKEYBYTES) {\n            throw new SodiumException('Argument 1 must be CRYPTO_SIGN_SECRETKEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_sign_publickey_from_secretkey($secretKey);\n        }\n        if (self::use_fallback('crypto_sign_publickey_from_secretkey')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_sign_publickey_from_secretkey', $secretKey);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Core32_Ed25519::publickey_from_secretkey($secretKey);\n        }\n        return ParagonIE_Sodium_Core_Ed25519::publickey_from_secretkey($secretKey);\n    }\n\n    /**\n     * Extract an Ed25519 secret key from an Ed25519 keypair.\n     *\n     * @param string $keypair Keypair\n     * @return string         Secret key\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_sign_secretkey($keypair)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_SIGN_KEYPAIRBYTES) {\n            throw new SodiumException('Argument 1 must be CRYPTO_SIGN_KEYPAIRBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_sign_secretkey($keypair);\n        }\n        if (self::use_fallback('crypto_sign_secretkey')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_sign_secretkey', $keypair);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Core32_Ed25519::secretkey($keypair);\n        }\n        return ParagonIE_Sodium_Core_Ed25519::secretkey($keypair);\n    }\n\n    /**\n     * Calculate the Ed25519 signature of a message and return ONLY the signature.\n     *\n     * Algorithm: Ed25519 (EdDSA over Curve25519)\n     *\n     * @param string $message Message to be signed\n     * @param string $secretKey Secret signing key\n     * @return string           Digital signature\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_sign_detached($message, $secretKey)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 2);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_SIGN_SECRETKEYBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_SIGN_SECRETKEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_sign_detached($message, $secretKey);\n        }\n        if (self::use_fallback('crypto_sign_detached')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_sign_detached', $message, $secretKey);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::sign_detached($message, $secretKey);\n        }\n        return ParagonIE_Sodium_Crypto::sign_detached($message, $secretKey);\n    }\n\n    /**\n     * Verify the Ed25519 signature of a message.\n     *\n     * @param string $signature Digital sginature\n     * @param string $message Message to be verified\n     * @param string $publicKey Public key\n     * @return bool             TRUE if this signature is good for this public key;\n     *                          FALSE otherwise\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_sign_verify_detached($signature, $message, $publicKey)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($signature, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 3);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($signature) !== self::CRYPTO_SIGN_BYTES) {\n            throw new SodiumException('Argument 1 must be CRYPTO_SIGN_BYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_SIGN_PUBLICKEYBYTES) {\n            throw new SodiumException('Argument 3 must be CRYPTO_SIGN_PUBLICKEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_sign_verify_detached($signature, $message, $publicKey);\n        }\n        if (self::use_fallback('crypto_sign_verify_detached')) {\n            return (bool) call_user_func(\n                '\\\\Sodium\\\\crypto_sign_verify_detached',\n                $signature,\n                $message,\n                $publicKey\n            );\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Crypto32::sign_verify_detached($signature, $message, $publicKey);\n        }\n        return ParagonIE_Sodium_Crypto::sign_verify_detached($signature, $message, $publicKey);\n    }\n\n    /**\n     * Convert an Ed25519 public key to a Curve25519 public key\n     *\n     * @param string $pk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_sign_ed25519_pk_to_curve25519($pk)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($pk, 'string', 1);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($pk) < self::CRYPTO_SIGN_PUBLICKEYBYTES) {\n            throw new SodiumException('Argument 1 must be at least CRYPTO_SIGN_PUBLICKEYBYTES long.');\n        }\n        if (self::useNewSodiumAPI()) {\n            if (is_callable('crypto_sign_ed25519_pk_to_curve25519')) {\n                return (string) sodium_crypto_sign_ed25519_pk_to_curve25519($pk);\n            }\n        }\n        if (self::use_fallback('crypto_sign_ed25519_pk_to_curve25519')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_sign_ed25519_pk_to_curve25519', $pk);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Core32_Ed25519::pk_to_curve25519($pk);\n        }\n        return ParagonIE_Sodium_Core_Ed25519::pk_to_curve25519($pk);\n    }\n\n    /**\n     * Convert an Ed25519 secret key to a Curve25519 secret key\n     *\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_sign_ed25519_sk_to_curve25519($sk)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($sk, 'string', 1);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($sk) < self::CRYPTO_SIGN_SEEDBYTES) {\n            throw new SodiumException('Argument 1 must be at least CRYPTO_SIGN_SEEDBYTES long.');\n        }\n        if (self::useNewSodiumAPI()) {\n            if (is_callable('crypto_sign_ed25519_sk_to_curve25519')) {\n                return sodium_crypto_sign_ed25519_sk_to_curve25519($sk);\n            }\n        }\n        if (self::use_fallback('crypto_sign_ed25519_sk_to_curve25519')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_sign_ed25519_sk_to_curve25519', $sk);\n        }\n\n        $h = hash('sha512', ParagonIE_Sodium_Core_Util::substr($sk, 0, 32), true);\n        $h[0] = ParagonIE_Sodium_Core_Util::intToChr(\n            ParagonIE_Sodium_Core_Util::chrToInt($h[0]) & 248\n        );\n        $h[31] = ParagonIE_Sodium_Core_Util::intToChr(\n            (ParagonIE_Sodium_Core_Util::chrToInt($h[31]) & 127) | 64\n        );\n        return ParagonIE_Sodium_Core_Util::substr($h, 0, 32);\n    }\n\n    /**\n     * Expand a key and nonce into a keystream of pseudorandom bytes.\n     *\n     * @param int $len Number of bytes desired\n     * @param string $nonce Number to be used Once; must be 24 bytes\n     * @param string $key XSalsa20 key\n     * @return string       Pseudorandom stream that can be XORed with messages\n     *                      to provide encryption (but not authentication; see\n     *                      Poly1305 or crypto_auth() for that, which is not\n     *                      optional for security)\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_stream($len, $nonce, $key)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($len, 'int', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_STREAM_NONCEBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_STREAM_KEYBYTES) {\n            throw new SodiumException('Argument 3 must be CRYPTO_STREAM_KEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_stream($len, $nonce, $key);\n        }\n        if (self::use_fallback('crypto_stream')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_stream', $len, $nonce, $key);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Core32_XSalsa20::xsalsa20($len, $nonce, $key);\n        }\n        return ParagonIE_Sodium_Core_XSalsa20::xsalsa20($len, $nonce, $key);\n    }\n\n    /**\n     * DANGER! UNAUTHENTICATED ENCRYPTION!\n     *\n     * Unless you are following expert advice, do not used this feature.\n     *\n     * Algorithm: XSalsa20\n     *\n     * This DOES NOT provide ciphertext integrity.\n     *\n     * @param string $message Plaintext message\n     * @param string $nonce Number to be used Once; must be 24 bytes\n     * @param string $key Encryption key\n     * @return string         Encrypted text which is vulnerable to chosen-\n     *                        ciphertext attacks unless you implement some\n     *                        other mitigation to the ciphertext (i.e.\n     *                        Encrypt then MAC)\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function crypto_stream_xor($message, $nonce, $key)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);\n        ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3);\n\n        /* Input validation: */\n        if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_STREAM_NONCEBYTES) {\n            throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.');\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_STREAM_KEYBYTES) {\n            throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_KEYBYTES long.');\n        }\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_crypto_stream_xor($message, $nonce, $key);\n        }\n        if (self::use_fallback('crypto_stream_xor')) {\n            return (string) call_user_func('\\\\Sodium\\\\crypto_stream_xor', $message, $nonce, $key);\n        }\n        if (PHP_INT_SIZE === 4) {\n            return ParagonIE_Sodium_Core32_XSalsa20::xsalsa20_xor($message, $nonce, $key);\n        }\n        return ParagonIE_Sodium_Core_XSalsa20::xsalsa20_xor($message, $nonce, $key);\n    }\n\n    /**\n     * Return a secure random key for use with crypto_stream\n     *\n     * @return string\n     * @throws Exception\n     * @throws Error\n     */\n    public static function crypto_stream_keygen()\n    {\n        return random_bytes(self::CRYPTO_STREAM_KEYBYTES);\n    }\n\n    /**\n     * Cache-timing-safe implementation of hex2bin().\n     *\n     * @param string $string Hexadecimal string\n     * @return string        Raw binary string\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress TooFewArguments\n     * @psalm-suppress MixedArgument\n     */\n    public static function hex2bin($string)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($string, 'string', 1);\n\n        if (self::useNewSodiumAPI()) {\n            if (is_callable('sodium_hex2bin')) {\n                return (string) sodium_hex2bin($string);\n            }\n        }\n        if (self::use_fallback('hex2bin')) {\n            return (string) call_user_func('\\\\Sodium\\\\hex2bin', $string);\n        }\n        return ParagonIE_Sodium_Core_Util::hex2bin($string);\n    }\n\n    /**\n     * Increase a string (little endian)\n     *\n     * @param string $var\n     *\n     * @return void\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function increment(&$var)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($var, 'string', 1);\n\n        if (self::useNewSodiumAPI()) {\n            sodium_increment($var);\n            return;\n        }\n        if (self::use_fallback('increment')) {\n            $func = '\\\\Sodium\\\\increment';\n            $func($var);\n            return;\n        }\n\n        $len = ParagonIE_Sodium_Core_Util::strlen($var);\n        $c = 1;\n        $copy = '';\n        for ($i = 0; $i < $len; ++$i) {\n            $c += ParagonIE_Sodium_Core_Util::chrToInt(\n                ParagonIE_Sodium_Core_Util::substr($var, $i, 1)\n            );\n            $copy .= ParagonIE_Sodium_Core_Util::intToChr($c);\n            $c >>= 8;\n        }\n        $var = $copy;\n    }\n\n    /**\n     * The equivalent to the libsodium minor version we aim to be compatible\n     * with (sans pwhash and memzero).\n     *\n     * @return int\n     * @psalm-suppress MixedInferredReturnType\n     * @psalm-suppress UndefinedFunction\n     */\n    public static function library_version_major()\n    {\n        if (self::useNewSodiumAPI()) {\n            return sodium_library_version_major();\n        }\n        if (self::use_fallback('library_version_major')) {\n            return (int) call_user_func('\\\\Sodium\\\\library_version_major');\n        }\n        return self::LIBRARY_VERSION_MAJOR;\n    }\n\n    /**\n     * The equivalent to the libsodium minor version we aim to be compatible\n     * with (sans pwhash and memzero).\n     *\n     * @return int\n     * @psalm-suppress MixedInferredReturnType\n     * @psalm-suppress UndefinedFunction\n     */\n    public static function library_version_minor()\n    {\n        if (self::useNewSodiumAPI()) {\n            return sodium_library_version_minor();\n        }\n        if (self::use_fallback('library_version_minor')) {\n            return (int) call_user_func('\\\\Sodium\\\\library_version_minor');\n        }\n        return self::LIBRARY_VERSION_MINOR;\n    }\n\n    /**\n     * Compare two strings.\n     *\n     * @param string $left\n     * @param string $right\n     * @return int\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     */\n    public static function memcmp($left, $right)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($left, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($right, 'string', 2);\n\n        if (self::useNewSodiumAPI()) {\n            return sodium_memcmp($left, $right);\n        }\n        if (self::use_fallback('memcmp')) {\n            return (int) call_user_func('\\\\Sodium\\\\memcmp', $left, $right);\n        }\n        /** @var string $left */\n        /** @var string $right */\n        return ParagonIE_Sodium_Core_Util::memcmp($left, $right);\n    }\n\n    /**\n     * It's actually not possible to zero memory buffers in PHP. You need the\n     * native library for that.\n     *\n     * @param string|null $var\n     * @param-out string|null $var\n     *\n     * @return void\n     * @throws SodiumException (Unless libsodium is installed)\n     * @throws TypeError\n     * @psalm-suppress TooFewArguments\n     */\n    public static function memzero(&$var)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($var, 'string', 1);\n\n        if (self::useNewSodiumAPI()) {\n            /** @psalm-suppress MixedArgument */\n            sodium_memzero($var);\n            return;\n        }\n        if (self::use_fallback('memzero')) {\n            $func = '\\\\Sodium\\\\memzero';\n            $func($var);\n            if ($var === null) {\n                return;\n            }\n        }\n        // This is the best we can do.\n        throw new SodiumException(\n            'This is not implemented in sodium_compat, as it is not possible to securely wipe memory from PHP. ' .\n            'To fix this error, make sure libsodium is installed and the PHP extension is enabled.'\n        );\n    }\n\n    /**\n     * @param string $unpadded\n     * @param int $blockSize\n     * @param bool $dontFallback\n     * @return string\n     * @throws SodiumException\n     */\n    public static function pad($unpadded, $blockSize, $dontFallback = false)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($unpadded, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($blockSize, 'int', 2);\n\n        $unpadded = (string) $unpadded;\n        $blockSize = (int) $blockSize;\n\n        if (self::useNewSodiumAPI() && !$dontFallback) {\n            return (string) sodium_pad($unpadded, $blockSize);\n        }\n\n        if ($blockSize <= 0) {\n            throw new SodiumException(\n                'block size cannot be less than 1'\n            );\n        }\n        $unpadded_len = ParagonIE_Sodium_Core_Util::strlen($unpadded);\n        $xpadlen = ($blockSize - 1);\n        if (($blockSize & ($blockSize - 1)) === 0) {\n            $xpadlen -= $unpadded_len & ($blockSize - 1);\n        } else {\n            $xpadlen -= $unpadded_len % $blockSize;\n        }\n\n        $xpadded_len = $unpadded_len + $xpadlen;\n        $padded = str_repeat(\"\\0\", $xpadded_len - 1);\n        if ($unpadded_len > 0) {\n            $st = 1;\n            $i = 0;\n            $k = $unpadded_len;\n            for ($j = 0; $j <= $xpadded_len; ++$j) {\n                $i = (int) $i;\n                $k = (int) $k;\n                $st = (int) $st;\n                if ($j >= $unpadded_len) {\n                    $padded[$j] = \"\\0\";\n                } else {\n                    $padded[$j] = $unpadded[$j];\n                }\n                /** @var int $k */\n                $k -= $st;\n                $st = (int) (~(\n                            (\n                                (\n                                    ($k >> 48)\n                                        |\n                                    ($k >> 32)\n                                        |\n                                    ($k >> 16)\n                                        |\n                                    $k\n                                ) - 1\n                            ) >> 16\n                        )\n                    ) & 1;\n                $i += $st;\n            }\n        }\n\n        $mask = 0;\n        $tail = $xpadded_len;\n        for ($i = 0; $i < $blockSize; ++$i) {\n            # barrier_mask = (unsigned char)\n            #     (((i ^ xpadlen) - 1U) >> ((sizeof(size_t) - 1U) * CHAR_BIT));\n            $barrier_mask = (($i ^ $xpadlen) -1) >> ((PHP_INT_SIZE << 3) - 1);\n            # tail[-i] = (tail[-i] & mask) | (0x80 & barrier_mask);\n            $padded[$tail - $i] = ParagonIE_Sodium_Core_Util::intToChr(\n                (ParagonIE_Sodium_Core_Util::chrToInt($padded[$tail - $i]) & $mask)\n                    |\n                (0x80 & $barrier_mask)\n            );\n            # mask |= barrier_mask;\n            $mask |= $barrier_mask;\n        }\n        return $padded;\n    }\n\n    /**\n     * @param string $padded\n     * @param int $blockSize\n     * @param bool $dontFallback\n     * @return string\n     * @throws SodiumException\n     */\n    public static function unpad($padded, $blockSize, $dontFallback = false)\n    {\n        /* Type checks: */\n        ParagonIE_Sodium_Core_Util::declareScalarType($padded, 'string', 1);\n        ParagonIE_Sodium_Core_Util::declareScalarType($blockSize, 'int', 2);\n\n        $padded = (string) $padded;\n        $blockSize = (int) $blockSize;\n\n        if (self::useNewSodiumAPI() && !$dontFallback) {\n            return (string) sodium_unpad($padded, $blockSize);\n        }\n        if ($blockSize <= 0) {\n            throw new SodiumException('block size cannot be less than 1');\n        }\n        $padded_len = ParagonIE_Sodium_Core_Util::strlen($padded);\n        if ($padded_len < $blockSize) {\n            throw new SodiumException('invalid padding');\n        }\n\n        # tail = &padded[padded_len - 1U];\n        $tail = $padded_len - 1;\n\n        $acc = 0;\n        $valid = 0;\n        $pad_len = 0;\n\n        $found = 0;\n        for ($i = 0; $i < $blockSize; ++$i) {\n            # c = tail[-i];\n            $c = ParagonIE_Sodium_Core_Util::chrToInt($padded[$tail - $i]);\n\n            # is_barrier =\n            #     (( (acc - 1U) & (pad_len - 1U) & ((c ^ 0x80) - 1U) ) >> 8) & 1U;\n            $is_barrier = (\n                (\n                    ($acc - 1) & ($pad_len - 1) & (($c ^ 80) - 1)\n                ) >> 7\n            ) & 1;\n            $is_barrier &= ~$found;\n            $found |= $is_barrier;\n\n            # acc |= c;\n            $acc |= $c;\n\n            # pad_len |= i & (1U + ~is_barrier);\n            $pad_len |= $i & (1 + ~$is_barrier);\n\n            # valid |= (unsigned char) is_barrier;\n            $valid |= ($is_barrier & 0xff);\n        }\n        # unpadded_len = padded_len - 1U - pad_len;\n        $unpadded_len = $padded_len - 1 - $pad_len;\n        if ($valid !== 1) {\n            throw new SodiumException('invalid padding');\n        }\n        return ParagonIE_Sodium_Core_Util::substr($padded, 0, $unpadded_len);\n    }\n\n    /**\n     * Will sodium_compat run fast on the current hardware and PHP configuration?\n     *\n     * @return bool\n     */\n    public static function polyfill_is_fast()\n    {\n        if (extension_loaded('sodium')) {\n            return true;\n        }\n        if (extension_loaded('libsodium')) {\n            return true;\n        }\n        return PHP_INT_SIZE === 8;\n    }\n\n    /**\n     * Generate a string of bytes from the kernel's CSPRNG.\n     * Proudly uses /dev/urandom (if getrandom(2) is not available).\n     *\n     * @param int $numBytes\n     * @return string\n     * @throws Exception\n     * @throws TypeError\n     */\n    public static function randombytes_buf($numBytes)\n    {\n        /* Type checks: */\n        if (!is_int($numBytes)) {\n            if (is_numeric($numBytes)) {\n                $numBytes = (int) $numBytes;\n            } else {\n                throw new TypeError(\n                    'Argument 1 must be an integer, ' . gettype($numBytes) . ' given.'\n                );\n            }\n        }\n        if (self::use_fallback('randombytes_buf')) {\n            return (string) call_user_func('\\\\Sodium\\\\randombytes_buf', $numBytes);\n        }\n        return random_bytes($numBytes);\n    }\n\n    /**\n     * Generate an integer between 0 and $range (non-inclusive).\n     *\n     * @param int $range\n     * @return int\n     * @throws Exception\n     * @throws Error\n     * @throws TypeError\n     */\n    public static function randombytes_uniform($range)\n    {\n        /* Type checks: */\n        if (!is_int($range)) {\n            if (is_numeric($range)) {\n                $range = (int) $range;\n            } else {\n                throw new TypeError(\n                    'Argument 1 must be an integer, ' . gettype($range) . ' given.'\n                );\n            }\n        }\n        if (self::use_fallback('randombytes_uniform')) {\n            return (int) call_user_func('\\\\Sodium\\\\randombytes_uniform', $range);\n        }\n        return random_int(0, $range - 1);\n    }\n\n    /**\n     * Generate a random 16-bit integer.\n     *\n     * @return int\n     * @throws Exception\n     * @throws Error\n     * @throws TypeError\n     */\n    public static function randombytes_random16()\n    {\n        if (self::use_fallback('randombytes_random16')) {\n            return (int) call_user_func('\\\\Sodium\\\\randombytes_random16');\n        }\n        return random_int(0, 65535);\n    }\n\n    /**\n     * Runtime testing method for 32-bit platforms.\n     *\n     * Usage: If runtime_speed_test() returns FALSE, then our 32-bit\n     *        implementation is to slow to use safely without risking timeouts.\n     *        If this happens, install sodium from PECL to get acceptable\n     *        performance.\n     *\n     * @param int $iterations Number of multiplications to attempt\n     * @param int $maxTimeout Milliseconds\n     * @return bool           TRUE if we're fast enough, FALSE is not\n     * @throws SodiumException\n     */\n    public static function runtime_speed_test($iterations, $maxTimeout)\n    {\n        if (self::polyfill_is_fast()) {\n            return true;\n        }\n        /** @var float $end */\n        $end = 0.0;\n        /** @var float $start */\n        $start = microtime(true);\n        /** @var ParagonIE_Sodium_Core32_Int64 $a */\n        $a = ParagonIE_Sodium_Core32_Int64::fromInt(random_int(3, 1 << 16));\n        for ($i = 0; $i < $iterations; ++$i) {\n            /** @var ParagonIE_Sodium_Core32_Int64 $b */\n            $b = ParagonIE_Sodium_Core32_Int64::fromInt(random_int(3, 1 << 16));\n            $a->mulInt64($b);\n        }\n        /** @var float $end */\n        $end = microtime(true);\n        /** @var int $diff */\n        $diff = (int) ceil(($end - $start) * 1000);\n        return $diff < $maxTimeout;\n    }\n\n    /**\n     * This emulates libsodium's version_string() function, except ours is\n     * prefixed with 'polyfill-'.\n     *\n     * @return string\n     * @psalm-suppress MixedInferredReturnType\n     * @psalm-suppress UndefinedFunction\n     */\n    public static function version_string()\n    {\n        if (self::useNewSodiumAPI()) {\n            return (string) sodium_version_string();\n        }\n        if (self::use_fallback('version_string')) {\n            return (string) call_user_func('\\\\Sodium\\\\version_string');\n        }\n        return (string) self::VERSION_STRING;\n    }\n\n    /**\n     * Should we use the libsodium core function instead?\n     * This is always a good idea, if it's available. (Unless we're in the\n     * middle of running our unit test suite.)\n     *\n     * If ext/libsodium is available, use it. Return TRUE.\n     * Otherwise, we have to use the code provided herein. Return FALSE.\n     *\n     * @param string $sodium_func_name\n     *\n     * @return bool\n     */\n    protected static function use_fallback($sodium_func_name = '')\n    {\n        static $res = null;\n        if ($res === null) {\n            $res = extension_loaded('libsodium') && PHP_VERSION_ID >= 50300;\n        }\n        if ($res === false) {\n            // No libsodium installed\n            return false;\n        }\n        if (self::$disableFallbackForUnitTests) {\n            // Don't fallback. Use the PHP implementation.\n            return false;\n        }\n        if (!empty($sodium_func_name)) {\n            return is_callable('\\\\Sodium\\\\' . $sodium_func_name);\n        }\n        return true;\n    }\n\n    /**\n     * Libsodium as implemented in PHP 7.2\n     * and/or ext/sodium (via PECL)\n     *\n     * @ref https://wiki.php.net/rfc/libsodium\n     * @return bool\n     */\n    protected static function useNewSodiumAPI()\n    {\n        static $res = null;\n        if ($res === null) {\n            $res = PHP_VERSION_ID >= 70000 && extension_loaded('sodium');\n        }\n        if (self::$disableFallbackForUnitTests) {\n            // Don't fallback. Use the PHP implementation.\n            return false;\n        }\n        return (bool) $res;\n    }\n}\n", "num_lines": 3561}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Crypto', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Crypto\n *\n * ATTENTION!\n *\n * If you are using this library, you should be using\n * ParagonIE_Sodium_Compat in your code, not this class.\n */\nabstract class ParagonIE_Sodium_Crypto\n{\n    const aead_chacha20poly1305_KEYBYTES = 32;\n    const aead_chacha20poly1305_NSECBYTES = 0;\n    const aead_chacha20poly1305_NPUBBYTES = 8;\n    const aead_chacha20poly1305_ABYTES = 16;\n\n    const aead_chacha20poly1305_IETF_KEYBYTES = 32;\n    const aead_chacha20poly1305_IETF_NSECBYTES = 0;\n    const aead_chacha20poly1305_IETF_NPUBBYTES = 12;\n    const aead_chacha20poly1305_IETF_ABYTES = 16;\n\n    const aead_xchacha20poly1305_IETF_KEYBYTES = 32;\n    const aead_xchacha20poly1305_IETF_NSECBYTES = 0;\n    const aead_xchacha20poly1305_IETF_NPUBBYTES = 24;\n    const aead_xchacha20poly1305_IETF_ABYTES = 16;\n\n    const box_curve25519xsalsa20poly1305_SEEDBYTES = 32;\n    const box_curve25519xsalsa20poly1305_PUBLICKEYBYTES = 32;\n    const box_curve25519xsalsa20poly1305_SECRETKEYBYTES = 32;\n    const box_curve25519xsalsa20poly1305_BEFORENMBYTES = 32;\n    const box_curve25519xsalsa20poly1305_NONCEBYTES = 24;\n    const box_curve25519xsalsa20poly1305_MACBYTES = 16;\n    const box_curve25519xsalsa20poly1305_BOXZEROBYTES = 16;\n    const box_curve25519xsalsa20poly1305_ZEROBYTES = 32;\n\n    const onetimeauth_poly1305_BYTES = 16;\n    const onetimeauth_poly1305_KEYBYTES = 32;\n\n    const secretbox_xsalsa20poly1305_KEYBYTES = 32;\n    const secretbox_xsalsa20poly1305_NONCEBYTES = 24;\n    const secretbox_xsalsa20poly1305_MACBYTES = 16;\n    const secretbox_xsalsa20poly1305_BOXZEROBYTES = 16;\n    const secretbox_xsalsa20poly1305_ZEROBYTES = 32;\n\n    const secretbox_xchacha20poly1305_KEYBYTES = 32;\n    const secretbox_xchacha20poly1305_NONCEBYTES = 24;\n    const secretbox_xchacha20poly1305_MACBYTES = 16;\n    const secretbox_xchacha20poly1305_BOXZEROBYTES = 16;\n    const secretbox_xchacha20poly1305_ZEROBYTES = 32;\n\n    const stream_salsa20_KEYBYTES = 32;\n\n    /**\n     * AEAD Decryption with ChaCha20-Poly1305\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $ad\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function aead_chacha20poly1305_decrypt(\n        $message = '',\n        $ad = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        /** @var int $len - Length of message (ciphertext + MAC) */\n        $len = ParagonIE_Sodium_Core_Util::strlen($message);\n\n        /** @var int  $clen - Length of ciphertext */\n        $clen = $len - self::aead_chacha20poly1305_ABYTES;\n\n        /** @var int $adlen - Length of associated data */\n        $adlen = ParagonIE_Sodium_Core_Util::strlen($ad);\n\n        /** @var string $mac - Message authentication code */\n        $mac = ParagonIE_Sodium_Core_Util::substr(\n            $message,\n            $clen,\n            self::aead_chacha20poly1305_ABYTES\n        );\n\n        /** @var string $ciphertext - The encrypted message (sans MAC) */\n        $ciphertext = ParagonIE_Sodium_Core_Util::substr($message, 0, $clen);\n\n        /** @var string The first block of the chacha20 keystream, used as a poly1305 key */\n        $block0 = ParagonIE_Sodium_Core_ChaCha20::stream(\n            32,\n            $nonce,\n            $key\n        );\n\n        /* Recalculate the Poly1305 authentication tag (MAC): */\n        $state = new ParagonIE_Sodium_Core_Poly1305_State($block0);\n        try {\n            ParagonIE_Sodium_Compat::memzero($block0);\n        } catch (SodiumException $ex) {\n            $block0 = null;\n        }\n        $state->update($ad);\n        $state->update(ParagonIE_Sodium_Core_Util::store64_le($adlen));\n        $state->update($ciphertext);\n        $state->update(ParagonIE_Sodium_Core_Util::store64_le($clen));\n        $computed_mac = $state->finish();\n\n        /* Compare the given MAC with the recalculated MAC: */\n        if (!ParagonIE_Sodium_Core_Util::verify_16($computed_mac, $mac)) {\n            throw new SodiumException('Invalid MAC');\n        }\n\n        // Here, we know that the MAC is valid, so we decrypt and return the plaintext\n        return ParagonIE_Sodium_Core_ChaCha20::streamXorIc(\n            $ciphertext,\n            $nonce,\n            $key,\n            ParagonIE_Sodium_Core_Util::store64_le(1)\n        );\n    }\n\n    /**\n     * AEAD Encryption with ChaCha20-Poly1305\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $ad\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function aead_chacha20poly1305_encrypt(\n        $message = '',\n        $ad = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        /** @var int $len - Length of the plaintext message */\n        $len = ParagonIE_Sodium_Core_Util::strlen($message);\n\n        /** @var int $adlen - Length of the associated data */\n        $adlen = ParagonIE_Sodium_Core_Util::strlen($ad);\n\n        /** @var string The first block of the chacha20 keystream, used as a poly1305 key */\n        $block0 = ParagonIE_Sodium_Core_ChaCha20::stream(\n            32,\n            $nonce,\n            $key\n        );\n        $state = new ParagonIE_Sodium_Core_Poly1305_State($block0);\n        try {\n            ParagonIE_Sodium_Compat::memzero($block0);\n        } catch (SodiumException $ex) {\n            $block0 = null;\n        }\n\n        /** @var string $ciphertext - Raw encrypted data */\n        $ciphertext = ParagonIE_Sodium_Core_ChaCha20::streamXorIc(\n            $message,\n            $nonce,\n            $key,\n            ParagonIE_Sodium_Core_Util::store64_le(1)\n        );\n\n        $state->update($ad);\n        $state->update(ParagonIE_Sodium_Core_Util::store64_le($adlen));\n        $state->update($ciphertext);\n        $state->update(ParagonIE_Sodium_Core_Util::store64_le($len));\n        return $ciphertext . $state->finish();\n    }\n\n    /**\n     * AEAD Decryption with ChaCha20-Poly1305, IETF mode (96-bit nonce)\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $ad\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function aead_chacha20poly1305_ietf_decrypt(\n        $message = '',\n        $ad = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        /** @var int $adlen - Length of associated data */\n        $adlen = ParagonIE_Sodium_Core_Util::strlen($ad);\n\n        /** @var int $len - Length of message (ciphertext + MAC) */\n        $len = ParagonIE_Sodium_Core_Util::strlen($message);\n\n        /** @var int  $clen - Length of ciphertext */\n        $clen = $len - self::aead_chacha20poly1305_IETF_ABYTES;\n\n        /** @var string The first block of the chacha20 keystream, used as a poly1305 key */\n        $block0 = ParagonIE_Sodium_Core_ChaCha20::ietfStream(\n            32,\n            $nonce,\n            $key\n        );\n\n        /** @var string $mac - Message authentication code */\n        $mac = ParagonIE_Sodium_Core_Util::substr(\n            $message,\n            $len - self::aead_chacha20poly1305_IETF_ABYTES,\n            self::aead_chacha20poly1305_IETF_ABYTES\n        );\n\n        /** @var string $ciphertext - The encrypted message (sans MAC) */\n        $ciphertext = ParagonIE_Sodium_Core_Util::substr(\n            $message,\n            0,\n            $len - self::aead_chacha20poly1305_IETF_ABYTES\n        );\n\n        /* Recalculate the Poly1305 authentication tag (MAC): */\n        $state = new ParagonIE_Sodium_Core_Poly1305_State($block0);\n        try {\n            ParagonIE_Sodium_Compat::memzero($block0);\n        } catch (SodiumException $ex) {\n            $block0 = null;\n        }\n        $state->update($ad);\n        $state->update(str_repeat(\"\\x00\", ((0x10 - $adlen) & 0xf)));\n        $state->update($ciphertext);\n        $state->update(str_repeat(\"\\x00\", (0x10 - $clen) & 0xf));\n        $state->update(ParagonIE_Sodium_Core_Util::store64_le($adlen));\n        $state->update(ParagonIE_Sodium_Core_Util::store64_le($clen));\n        $computed_mac = $state->finish();\n\n        /* Compare the given MAC with the recalculated MAC: */\n        if (!ParagonIE_Sodium_Core_Util::verify_16($computed_mac, $mac)) {\n            throw new SodiumException('Invalid MAC');\n        }\n\n        // Here, we know that the MAC is valid, so we decrypt and return the plaintext\n        return ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc(\n            $ciphertext,\n            $nonce,\n            $key,\n            ParagonIE_Sodium_Core_Util::store64_le(1)\n        );\n    }\n\n    /**\n     * AEAD Encryption with ChaCha20-Poly1305, IETF mode (96-bit nonce)\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $ad\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function aead_chacha20poly1305_ietf_encrypt(\n        $message = '',\n        $ad = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        /** @var int $len - Length of the plaintext message */\n        $len = ParagonIE_Sodium_Core_Util::strlen($message);\n\n        /** @var int $adlen - Length of the associated data */\n        $adlen = ParagonIE_Sodium_Core_Util::strlen($ad);\n\n        /** @var string The first block of the chacha20 keystream, used as a poly1305 key */\n        $block0 = ParagonIE_Sodium_Core_ChaCha20::ietfStream(\n            32,\n            $nonce,\n            $key\n        );\n        $state = new ParagonIE_Sodium_Core_Poly1305_State($block0);\n        try {\n            ParagonIE_Sodium_Compat::memzero($block0);\n        } catch (SodiumException $ex) {\n            $block0 = null;\n        }\n\n        /** @var string $ciphertext - Raw encrypted data */\n        $ciphertext = ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc(\n            $message,\n            $nonce,\n            $key,\n            ParagonIE_Sodium_Core_Util::store64_le(1)\n        );\n\n        $state->update($ad);\n        $state->update(str_repeat(\"\\x00\", ((0x10 - $adlen) & 0xf)));\n        $state->update($ciphertext);\n        $state->update(str_repeat(\"\\x00\", ((0x10 - $len) & 0xf)));\n        $state->update(ParagonIE_Sodium_Core_Util::store64_le($adlen));\n        $state->update(ParagonIE_Sodium_Core_Util::store64_le($len));\n        return $ciphertext . $state->finish();\n    }\n\n    /**\n     * AEAD Decryption with ChaCha20-Poly1305, IETF mode (96-bit nonce)\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $ad\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function aead_xchacha20poly1305_ietf_decrypt(\n        $message = '',\n        $ad = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20(\n            ParagonIE_Sodium_Core_Util::substr($nonce, 0, 16),\n            $key\n        );\n        $nonceLast = \"\\x00\\x00\\x00\\x00\" .\n            ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8);\n\n        return self::aead_chacha20poly1305_ietf_decrypt($message, $ad, $nonceLast, $subkey);\n    }\n\n    /**\n     * AEAD Encryption with ChaCha20-Poly1305, IETF mode (96-bit nonce)\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $ad\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function aead_xchacha20poly1305_ietf_encrypt(\n        $message = '',\n        $ad = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20(\n            ParagonIE_Sodium_Core_Util::substr($nonce, 0, 16),\n            $key\n        );\n        $nonceLast = \"\\x00\\x00\\x00\\x00\" .\n            ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8);\n\n        return self::aead_chacha20poly1305_ietf_encrypt($message, $ad, $nonceLast, $subkey);\n    }\n\n    /**\n     * HMAC-SHA-512-256 (a.k.a. the leftmost 256 bits of HMAC-SHA-512)\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $key\n     * @return string\n     * @throws TypeError\n     */\n    public static function auth($message, $key)\n    {\n        return ParagonIE_Sodium_Core_Util::substr(\n            hash_hmac('sha512', $message, $key, true),\n            0,\n            32\n        );\n    }\n\n    /**\n     * HMAC-SHA-512-256 validation. Constant-time via hash_equals().\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $mac\n     * @param string $message\n     * @param string $key\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function auth_verify($mac, $message, $key)\n    {\n        return ParagonIE_Sodium_Core_Util::hashEquals(\n            $mac,\n            self::auth($message, $key)\n        );\n    }\n\n    /**\n     * X25519 key exchange followed by XSalsa20Poly1305 symmetric encryption\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $plaintext\n     * @param string $nonce\n     * @param string $keypair\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box($plaintext, $nonce, $keypair)\n    {\n        $c = self::secretbox(\n            $plaintext,\n            $nonce,\n            self::box_beforenm(\n                self::box_secretkey($keypair),\n                self::box_publickey($keypair)\n            )\n        );\n        return $c;\n    }\n\n    /**\n     * X25519-XSalsa20-Poly1305 with one ephemeral X25519 keypair.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $publicKey\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_seal($message, $publicKey)\n    {\n        /** @var string $ephemeralKeypair */\n        $ephemeralKeypair = self::box_keypair();\n\n        /** @var string $ephemeralSK */\n        $ephemeralSK = self::box_secretkey($ephemeralKeypair);\n\n        /** @var string $ephemeralPK */\n        $ephemeralPK = self::box_publickey($ephemeralKeypair);\n\n        /** @var string $nonce */\n        $nonce = self::generichash(\n            $ephemeralPK . $publicKey,\n            '',\n            24\n        );\n\n        /** @var string $keypair - The combined keypair used in crypto_box() */\n        $keypair = self::box_keypair_from_secretkey_and_publickey($ephemeralSK, $publicKey);\n\n        /** @var string $ciphertext Ciphertext + MAC from crypto_box */\n        $ciphertext = self::box($message, $nonce, $keypair);\n        try {\n            ParagonIE_Sodium_Compat::memzero($ephemeralKeypair);\n            ParagonIE_Sodium_Compat::memzero($ephemeralSK);\n            ParagonIE_Sodium_Compat::memzero($nonce);\n        } catch (SodiumException $ex) {\n            $ephemeralKeypair = null;\n            $ephemeralSK = null;\n            $nonce = null;\n        }\n        return $ephemeralPK . $ciphertext;\n    }\n\n    /**\n     * Opens a message encrypted via box_seal().\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $keypair\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_seal_open($message, $keypair)\n    {\n        /** @var string $ephemeralPK */\n        $ephemeralPK = ParagonIE_Sodium_Core_Util::substr($message, 0, 32);\n\n        /** @var string $ciphertext (ciphertext + MAC) */\n        $ciphertext = ParagonIE_Sodium_Core_Util::substr($message, 32);\n\n        /** @var string $secretKey */\n        $secretKey = self::box_secretkey($keypair);\n\n        /** @var string $publicKey */\n        $publicKey = self::box_publickey($keypair);\n\n        /** @var string $nonce */\n        $nonce = self::generichash(\n            $ephemeralPK . $publicKey,\n            '',\n            24\n        );\n\n        /** @var string $keypair */\n        $keypair = self::box_keypair_from_secretkey_and_publickey($secretKey, $ephemeralPK);\n\n        /** @var string $m */\n        $m = self::box_open($ciphertext, $nonce, $keypair);\n        try {\n            ParagonIE_Sodium_Compat::memzero($secretKey);\n            ParagonIE_Sodium_Compat::memzero($ephemeralPK);\n            ParagonIE_Sodium_Compat::memzero($nonce);\n        } catch (SodiumException $ex) {\n            $secretKey = null;\n            $ephemeralPK = null;\n            $nonce = null;\n        }\n        return $m;\n    }\n\n    /**\n     * Used by crypto_box() to get the crypto_secretbox() key.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $sk\n     * @param string $pk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_beforenm($sk, $pk)\n    {\n        return ParagonIE_Sodium_Core_HSalsa20::hsalsa20(\n            str_repeat(\"\\x00\", 16),\n            self::scalarmult($sk, $pk)\n        );\n    }\n\n    /**\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @return string\n     * @throws Exception\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_keypair()\n    {\n        $sKey = random_bytes(32);\n        $pKey = self::scalarmult_base($sKey);\n        return $sKey . $pKey;\n    }\n\n    /**\n     * @param string $seed\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_seed_keypair($seed)\n    {\n        $sKey = ParagonIE_Sodium_Core_Util::substr(\n            hash('sha512', $seed, true),\n            0,\n            32\n        );\n        $pKey = self::scalarmult_base($sKey);\n        return $sKey . $pKey;\n    }\n\n    /**\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $sKey\n     * @param string $pKey\n     * @return string\n     * @throws TypeError\n     */\n    public static function box_keypair_from_secretkey_and_publickey($sKey, $pKey)\n    {\n        return ParagonIE_Sodium_Core_Util::substr($sKey, 0, 32) .\n            ParagonIE_Sodium_Core_Util::substr($pKey, 0, 32);\n    }\n\n    /**\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $keypair\n     * @return string\n     * @throws RangeException\n     * @throws TypeError\n     */\n    public static function box_secretkey($keypair)\n    {\n        if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== 64) {\n            throw new RangeException(\n                'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES bytes long.'\n            );\n        }\n        return ParagonIE_Sodium_Core_Util::substr($keypair, 0, 32);\n    }\n\n    /**\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $keypair\n     * @return string\n     * @throws RangeException\n     * @throws TypeError\n     */\n    public static function box_publickey($keypair)\n    {\n        if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES) {\n            throw new RangeException(\n                'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES bytes long.'\n            );\n        }\n        return ParagonIE_Sodium_Core_Util::substr($keypair, 32, 32);\n    }\n\n    /**\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $sKey\n     * @return string\n     * @throws RangeException\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_publickey_from_secretkey($sKey)\n    {\n        if (ParagonIE_Sodium_Core_Util::strlen($sKey) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES) {\n            throw new RangeException(\n                'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES bytes long.'\n            );\n        }\n        return self::scalarmult_base($sKey);\n    }\n\n    /**\n     * Decrypt a message encrypted with box().\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $ciphertext\n     * @param string $nonce\n     * @param string $keypair\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_open($ciphertext, $nonce, $keypair)\n    {\n        return self::secretbox_open(\n            $ciphertext,\n            $nonce,\n            self::box_beforenm(\n                self::box_secretkey($keypair),\n                self::box_publickey($keypair)\n            )\n        );\n    }\n\n    /**\n     * Calculate a BLAKE2b hash.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string|null $key\n     * @param int $outlen\n     * @return string\n     * @throws RangeException\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function generichash($message, $key = '', $outlen = 32)\n    {\n        // This ensures that ParagonIE_Sodium_Core_BLAKE2b::$iv is initialized\n        ParagonIE_Sodium_Core_BLAKE2b::pseudoConstructor();\n\n        $k = null;\n        if (!empty($key)) {\n            /** @var SplFixedArray $k */\n            $k = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($key);\n            if ($k->count() > ParagonIE_Sodium_Core_BLAKE2b::KEYBYTES) {\n                throw new RangeException('Invalid key size');\n            }\n        }\n\n        /** @var SplFixedArray $in */\n        $in = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($message);\n\n        /** @var SplFixedArray $ctx */\n        $ctx = ParagonIE_Sodium_Core_BLAKE2b::init($k, $outlen);\n        ParagonIE_Sodium_Core_BLAKE2b::update($ctx, $in, $in->count());\n\n        /** @var SplFixedArray $out */\n        $out = new SplFixedArray($outlen);\n        $out = ParagonIE_Sodium_Core_BLAKE2b::finish($ctx, $out);\n\n        /** @var array<int, int> */\n        $outArray = $out->toArray();\n        return ParagonIE_Sodium_Core_Util::intArrayToString($outArray);\n    }\n\n    /**\n     * Finalize a BLAKE2b hashing context, returning the hash.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $ctx\n     * @param int $outlen\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function generichash_final($ctx, $outlen = 32)\n    {\n        if (!is_string($ctx)) {\n            throw new TypeError('Context must be a string');\n        }\n        $out = new SplFixedArray($outlen);\n\n        /** @var SplFixedArray $context */\n        $context = ParagonIE_Sodium_Core_BLAKE2b::stringToContext($ctx);\n\n        /** @var SplFixedArray $out */\n        $out = ParagonIE_Sodium_Core_BLAKE2b::finish($context, $out);\n\n        /** @var array<int, int> */\n        $outArray = $out->toArray();\n        return ParagonIE_Sodium_Core_Util::intArrayToString($outArray);\n    }\n\n    /**\n     * Initialize a hashing context for BLAKE2b.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $key\n     * @param int $outputLength\n     * @return string\n     * @throws RangeException\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function generichash_init($key = '', $outputLength = 32)\n    {\n        // This ensures that ParagonIE_Sodium_Core_BLAKE2b::$iv is initialized\n        ParagonIE_Sodium_Core_BLAKE2b::pseudoConstructor();\n\n        $k = null;\n        if (!empty($key)) {\n            $k = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($key);\n            if ($k->count() > ParagonIE_Sodium_Core_BLAKE2b::KEYBYTES) {\n                throw new RangeException('Invalid key size');\n            }\n        }\n\n        /** @var SplFixedArray $ctx */\n        $ctx = ParagonIE_Sodium_Core_BLAKE2b::init($k, $outputLength);\n\n        return ParagonIE_Sodium_Core_BLAKE2b::contextToString($ctx);\n    }\n\n    /**\n     * Initialize a hashing context for BLAKE2b.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $key\n     * @param int $outputLength\n     * @param string $salt\n     * @param string $personal\n     * @return string\n     * @throws RangeException\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function generichash_init_salt_personal(\n        $key = '',\n        $outputLength = 32,\n        $salt = '',\n        $personal = ''\n    ) {\n        // This ensures that ParagonIE_Sodium_Core_BLAKE2b::$iv is initialized\n        ParagonIE_Sodium_Core_BLAKE2b::pseudoConstructor();\n\n        $k = null;\n        if (!empty($key)) {\n            $k = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($key);\n            if ($k->count() > ParagonIE_Sodium_Core_BLAKE2b::KEYBYTES) {\n                throw new RangeException('Invalid key size');\n            }\n        }\n        if (!empty($salt)) {\n            $s = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($salt);\n        } else {\n            $s = null;\n        }\n        if (!empty($salt)) {\n            $p = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($personal);\n        } else {\n            $p = null;\n        }\n\n        /** @var SplFixedArray $ctx */\n        $ctx = ParagonIE_Sodium_Core_BLAKE2b::init($k, $outputLength, $s, $p);\n\n        return ParagonIE_Sodium_Core_BLAKE2b::contextToString($ctx);\n    }\n\n    /**\n     * Update a hashing context for BLAKE2b with $message\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $ctx\n     * @param string $message\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function generichash_update($ctx, $message)\n    {\n        // This ensures that ParagonIE_Sodium_Core_BLAKE2b::$iv is initialized\n        ParagonIE_Sodium_Core_BLAKE2b::pseudoConstructor();\n\n        /** @var SplFixedArray $context */\n        $context = ParagonIE_Sodium_Core_BLAKE2b::stringToContext($ctx);\n\n        /** @var SplFixedArray $in */\n        $in = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($message);\n\n        ParagonIE_Sodium_Core_BLAKE2b::update($context, $in, $in->count());\n\n        return ParagonIE_Sodium_Core_BLAKE2b::contextToString($context);\n    }\n\n    /**\n     * Libsodium's crypto_kx().\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $my_sk\n     * @param string $their_pk\n     * @param string $client_pk\n     * @param string $server_pk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function keyExchange($my_sk, $their_pk, $client_pk, $server_pk)\n    {\n        return ParagonIE_Sodium_Compat::crypto_generichash(\n            ParagonIE_Sodium_Compat::crypto_scalarmult($my_sk, $their_pk) .\n            $client_pk .\n            $server_pk\n        );\n    }\n\n    /**\n     * ECDH over Curve25519\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $sKey\n     * @param string $pKey\n     * @return string\n     *\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function scalarmult($sKey, $pKey)\n    {\n        $q = ParagonIE_Sodium_Core_X25519::crypto_scalarmult_curve25519_ref10($sKey, $pKey);\n        self::scalarmult_throw_if_zero($q);\n        return $q;\n    }\n\n    /**\n     * ECDH over Curve25519, using the basepoint.\n     * Used to get a secret key from a public key.\n     *\n     * @param string $secret\n     * @return string\n     *\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function scalarmult_base($secret)\n    {\n        $q = ParagonIE_Sodium_Core_X25519::crypto_scalarmult_curve25519_ref10_base($secret);\n        self::scalarmult_throw_if_zero($q);\n        return $q;\n    }\n\n    /**\n     * This throws an Error if a zero public key was passed to the function.\n     *\n     * @param string $q\n     * @return void\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    protected static function scalarmult_throw_if_zero($q)\n    {\n        $d = 0;\n        for ($i = 0; $i < self::box_curve25519xsalsa20poly1305_SECRETKEYBYTES; ++$i) {\n            $d |= ParagonIE_Sodium_Core_Util::chrToInt($q[$i]);\n        }\n\n        /* branch-free variant of === 0 */\n        if (-(1 & (($d - 1) >> 8))) {\n            throw new SodiumException('Zero public key is not allowed');\n        }\n    }\n\n    /**\n     * XSalsa20-Poly1305 authenticated symmetric-key encryption.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $plaintext\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function secretbox($plaintext, $nonce, $key)\n    {\n        /** @var string $subkey */\n        $subkey = ParagonIE_Sodium_Core_HSalsa20::hsalsa20($nonce, $key);\n\n        /** @var string $block0 */\n        $block0 = str_repeat(\"\\x00\", 32);\n\n        /** @var int $mlen - Length of the plaintext message */\n        $mlen = ParagonIE_Sodium_Core_Util::strlen($plaintext);\n        $mlen0 = $mlen;\n        if ($mlen0 > 64 - self::secretbox_xsalsa20poly1305_ZEROBYTES) {\n            $mlen0 = 64 - self::secretbox_xsalsa20poly1305_ZEROBYTES;\n        }\n        $block0 .= ParagonIE_Sodium_Core_Util::substr($plaintext, 0, $mlen0);\n\n        /** @var string $block0 */\n        $block0 = ParagonIE_Sodium_Core_Salsa20::salsa20_xor(\n            $block0,\n            ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8),\n            $subkey\n        );\n\n        /** @var string $c */\n        $c = ParagonIE_Sodium_Core_Util::substr(\n            $block0,\n            self::secretbox_xsalsa20poly1305_ZEROBYTES\n        );\n        if ($mlen > $mlen0) {\n            $c .= ParagonIE_Sodium_Core_Salsa20::salsa20_xor_ic(\n                ParagonIE_Sodium_Core_Util::substr(\n                    $plaintext,\n                    self::secretbox_xsalsa20poly1305_ZEROBYTES\n                ),\n                ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8),\n                1,\n                $subkey\n            );\n        }\n        $state = new ParagonIE_Sodium_Core_Poly1305_State(\n            ParagonIE_Sodium_Core_Util::substr(\n                $block0,\n                0,\n                self::onetimeauth_poly1305_KEYBYTES\n            )\n        );\n        try {\n            ParagonIE_Sodium_Compat::memzero($block0);\n            ParagonIE_Sodium_Compat::memzero($subkey);\n        } catch (SodiumException $ex) {\n            $block0 = null;\n            $subkey = null;\n        }\n\n        $state->update($c);\n\n        /** @var string $c - MAC || ciphertext */\n        $c = $state->finish() . $c;\n        unset($state);\n\n        return $c;\n    }\n\n    /**\n     * Decrypt a ciphertext generated via secretbox().\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $ciphertext\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function secretbox_open($ciphertext, $nonce, $key)\n    {\n        /** @var string $mac */\n        $mac = ParagonIE_Sodium_Core_Util::substr(\n            $ciphertext,\n            0,\n            self::secretbox_xsalsa20poly1305_MACBYTES\n        );\n\n        /** @var string $c */\n        $c = ParagonIE_Sodium_Core_Util::substr(\n            $ciphertext,\n            self::secretbox_xsalsa20poly1305_MACBYTES\n        );\n\n        /** @var int $clen */\n        $clen = ParagonIE_Sodium_Core_Util::strlen($c);\n\n        /** @var string $subkey */\n        $subkey = ParagonIE_Sodium_Core_HSalsa20::hsalsa20($nonce, $key);\n\n        /** @var string $block0 */\n        $block0 = ParagonIE_Sodium_Core_Salsa20::salsa20(\n            64,\n            ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8),\n            $subkey\n        );\n        $verified = ParagonIE_Sodium_Core_Poly1305::onetimeauth_verify(\n            $mac,\n            $c,\n            ParagonIE_Sodium_Core_Util::substr($block0, 0, 32)\n        );\n        if (!$verified) {\n            try {\n                ParagonIE_Sodium_Compat::memzero($subkey);\n            } catch (SodiumException $ex) {\n                $subkey = null;\n            }\n            throw new SodiumException('Invalid MAC');\n        }\n\n        /** @var string $m - Decrypted message */\n        $m = ParagonIE_Sodium_Core_Util::xorStrings(\n            ParagonIE_Sodium_Core_Util::substr($block0, self::secretbox_xsalsa20poly1305_ZEROBYTES),\n            ParagonIE_Sodium_Core_Util::substr($c, 0, self::secretbox_xsalsa20poly1305_ZEROBYTES)\n        );\n        if ($clen > self::secretbox_xsalsa20poly1305_ZEROBYTES) {\n            // We had more than 1 block, so let's continue to decrypt the rest.\n            $m .= ParagonIE_Sodium_Core_Salsa20::salsa20_xor_ic(\n                ParagonIE_Sodium_Core_Util::substr(\n                    $c,\n                    self::secretbox_xsalsa20poly1305_ZEROBYTES\n                ),\n                ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8),\n                1,\n                (string) $subkey\n            );\n        }\n        return $m;\n    }\n\n    /**\n     * XChaCha20-Poly1305 authenticated symmetric-key encryption.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $plaintext\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function secretbox_xchacha20poly1305($plaintext, $nonce, $key)\n    {\n        /** @var string $subkey */\n        $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20(\n            ParagonIE_Sodium_Core_Util::substr($nonce, 0, 16),\n            $key\n        );\n        $nonceLast = ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8);\n\n        /** @var string $block0 */\n        $block0 = str_repeat(\"\\x00\", 32);\n\n        /** @var int $mlen - Length of the plaintext message */\n        $mlen = ParagonIE_Sodium_Core_Util::strlen($plaintext);\n        $mlen0 = $mlen;\n        if ($mlen0 > 64 - self::secretbox_xchacha20poly1305_ZEROBYTES) {\n            $mlen0 = 64 - self::secretbox_xchacha20poly1305_ZEROBYTES;\n        }\n        $block0 .= ParagonIE_Sodium_Core_Util::substr($plaintext, 0, $mlen0);\n\n        /** @var string $block0 */\n        $block0 = ParagonIE_Sodium_Core_ChaCha20::streamXorIc(\n            $block0,\n            $nonceLast,\n            $subkey\n        );\n\n        /** @var string $c */\n        $c = ParagonIE_Sodium_Core_Util::substr(\n            $block0,\n            self::secretbox_xchacha20poly1305_ZEROBYTES\n        );\n        if ($mlen > $mlen0) {\n            $c .= ParagonIE_Sodium_Core_ChaCha20::streamXorIc(\n                ParagonIE_Sodium_Core_Util::substr(\n                    $plaintext,\n                    self::secretbox_xchacha20poly1305_ZEROBYTES\n                ),\n                $nonceLast,\n                $subkey,\n                ParagonIE_Sodium_Core_Util::store64_le(1)\n            );\n        }\n        $state = new ParagonIE_Sodium_Core_Poly1305_State(\n            ParagonIE_Sodium_Core_Util::substr(\n                $block0,\n                0,\n                self::onetimeauth_poly1305_KEYBYTES\n            )\n        );\n        try {\n            ParagonIE_Sodium_Compat::memzero($block0);\n            ParagonIE_Sodium_Compat::memzero($subkey);\n        } catch (SodiumException $ex) {\n            $block0 = null;\n            $subkey = null;\n        }\n\n        $state->update($c);\n\n        /** @var string $c - MAC || ciphertext */\n        $c = $state->finish() . $c;\n        unset($state);\n\n        return $c;\n    }\n\n    /**\n     * Decrypt a ciphertext generated via secretbox_xchacha20poly1305().\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $ciphertext\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key)\n    {\n        /** @var string $mac */\n        $mac = ParagonIE_Sodium_Core_Util::substr(\n            $ciphertext,\n            0,\n            self::secretbox_xchacha20poly1305_MACBYTES\n        );\n\n        /** @var string $c */\n        $c = ParagonIE_Sodium_Core_Util::substr(\n            $ciphertext,\n            self::secretbox_xchacha20poly1305_MACBYTES\n        );\n\n        /** @var int $clen */\n        $clen = ParagonIE_Sodium_Core_Util::strlen($c);\n\n        /** @var string $subkey */\n        $subkey = ParagonIE_Sodium_Core_HChaCha20::hchacha20($nonce, $key);\n\n        /** @var string $block0 */\n        $block0 = ParagonIE_Sodium_Core_ChaCha20::stream(\n            64,\n            ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8),\n            $subkey\n        );\n        $verified = ParagonIE_Sodium_Core_Poly1305::onetimeauth_verify(\n            $mac,\n            $c,\n            ParagonIE_Sodium_Core_Util::substr($block0, 0, 32)\n        );\n\n        if (!$verified) {\n            try {\n                ParagonIE_Sodium_Compat::memzero($subkey);\n            } catch (SodiumException $ex) {\n                $subkey = null;\n            }\n            throw new SodiumException('Invalid MAC');\n        }\n\n        /** @var string $m - Decrypted message */\n        $m = ParagonIE_Sodium_Core_Util::xorStrings(\n            ParagonIE_Sodium_Core_Util::substr($block0, self::secretbox_xchacha20poly1305_ZEROBYTES),\n            ParagonIE_Sodium_Core_Util::substr($c, 0, self::secretbox_xchacha20poly1305_ZEROBYTES)\n        );\n\n        if ($clen > self::secretbox_xchacha20poly1305_ZEROBYTES) {\n            // We had more than 1 block, so let's continue to decrypt the rest.\n            $m .= ParagonIE_Sodium_Core_ChaCha20::streamXorIc(\n                ParagonIE_Sodium_Core_Util::substr(\n                    $c,\n                    self::secretbox_xchacha20poly1305_ZEROBYTES\n                ),\n                ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8),\n                (string) $subkey,\n                ParagonIE_Sodium_Core_Util::store64_le(1)\n            );\n        }\n        return $m;\n    }\n\n    /**\n     * @param string $key\n     * @return array<int, string> Returns a state and a header.\n     * @throws Exception\n     * @throws SodiumException\n     */\n    public static function secretstream_xchacha20poly1305_init_push($key)\n    {\n        # randombytes_buf(out, crypto_secretstream_xchacha20poly1305_HEADERBYTES);\n        $out = random_bytes(24);\n\n        # crypto_core_hchacha20(state->k, out, k, NULL);\n        $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20($out, $key);\n        $state = new ParagonIE_Sodium_Core_SecretStream_State(\n            $subkey,\n            ParagonIE_Sodium_Core_Util::substr($out, 16, 8) . str_repeat(\"\\0\", 4)\n        );\n\n        # _crypto_secretstream_xchacha20poly1305_counter_reset(state);\n        $state->counterReset();\n\n        # memcpy(STATE_INONCE(state), out + crypto_core_hchacha20_INPUTBYTES,\n        #        crypto_secretstream_xchacha20poly1305_INONCEBYTES);\n        # memset(state->_pad, 0, sizeof state->_pad);\n        return array(\n            $state->toString(),\n            $out\n        );\n    }\n\n    /**\n     * @param string $key\n     * @param string $header\n     * @return string Returns a state.\n     * @throws Exception\n     */\n    public static function secretstream_xchacha20poly1305_init_pull($key, $header)\n    {\n        # crypto_core_hchacha20(state->k, in, k, NULL);\n        $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20(\n            ParagonIE_Sodium_Core_Util::substr($header, 0, 16),\n            $key\n        );\n        $state = new ParagonIE_Sodium_Core_SecretStream_State(\n            $subkey,\n            ParagonIE_Sodium_Core_Util::substr($header, 16)\n        );\n        $state->counterReset();\n        # memcpy(STATE_INONCE(state), in + crypto_core_hchacha20_INPUTBYTES,\n        #     crypto_secretstream_xchacha20poly1305_INONCEBYTES);\n        # memset(state->_pad, 0, sizeof state->_pad);\n        # return 0;\n        return $state->toString();\n    }\n\n    /**\n     * @param string $state\n     * @param string $msg\n     * @param string $aad\n     * @param int $tag\n     * @return string\n     * @throws SodiumException\n     */\n    public static function secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0)\n    {\n        $st = ParagonIE_Sodium_Core_SecretStream_State::fromString($state);\n        # crypto_onetimeauth_poly1305_state poly1305_state;\n        # unsigned char                     block[64U];\n        # unsigned char                     slen[8U];\n        # unsigned char                    *c;\n        # unsigned char                    *mac;\n\n        $msglen = ParagonIE_Sodium_Core_Util::strlen($msg);\n        $aadlen = ParagonIE_Sodium_Core_Util::strlen($aad);\n\n        if ((($msglen + 63) >> 6) > 0xfffffffe) {\n            throw new SodiumException(\n                'message cannot be larger than SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX bytes'\n            );\n        }\n\n        # if (outlen_p != NULL) {\n        #     *outlen_p = 0U;\n        # }\n        # if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX) {\n        #     sodium_misuse();\n        # }\n\n        # crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k);\n        # crypto_onetimeauth_poly1305_init(&poly1305_state, block);\n        # sodium_memzero(block, sizeof block);\n        $auth = new ParagonIE_Sodium_Core_Poly1305_State(\n            ParagonIE_Sodium_Core_ChaCha20::ietfStream(32, $st->getCombinedNonce(), $st->getKey())\n        );\n\n        # crypto_onetimeauth_poly1305_update(&poly1305_state, ad, adlen);\n        $auth->update($aad);\n\n        # crypto_onetimeauth_poly1305_update(&poly1305_state, _pad0,\n        #     (0x10 - adlen) & 0xf);\n        $auth->update(str_repeat(\"\\0\", ((0x10 - $aadlen) & 0xf)));\n\n        # memset(block, 0, sizeof block);\n        # block[0] = tag;\n        # crypto_stream_chacha20_ietf_xor_ic(block, block, sizeof block,\n        #                                    state->nonce, 1U, state->k);\n        $block = ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc(\n            ParagonIE_Sodium_Core_Util::intToChr($tag) . str_repeat(\"\\0\", 63),\n            $st->getCombinedNonce(),\n            $st->getKey(),\n            ParagonIE_Sodium_Core_Util::store64_le(1)\n        );\n\n        # crypto_onetimeauth_poly1305_update(&poly1305_state, block, sizeof block);\n        $auth->update($block);\n\n        # out[0] = block[0];\n        $out = $block[0];\n        # c = out + (sizeof tag);\n        # crypto_stream_chacha20_ietf_xor_ic(c, m, mlen, state->nonce, 2U, state->k);\n        $cipher = ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc(\n            $msg,\n            $st->getCombinedNonce(),\n            $st->getKey(),\n            ParagonIE_Sodium_Core_Util::store64_le(2)\n        );\n\n        # crypto_onetimeauth_poly1305_update(&poly1305_state, c, mlen);\n        $auth->update($cipher);\n\n        $out .= $cipher;\n        unset($cipher);\n\n        # crypto_onetimeauth_poly1305_update\n        # (&poly1305_state, _pad0, (0x10 - (sizeof block) + mlen) & 0xf);\n        $auth->update(str_repeat(\"\\0\", ((0x10 - 64 + $msglen) & 0xf)));\n\n        # STORE64_LE(slen, (uint64_t) adlen);\n        $slen = ParagonIE_Sodium_Core_Util::store64_le($aadlen);\n\n        # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen);\n        $auth->update($slen);\n\n        # STORE64_LE(slen, (sizeof block) + mlen);\n        $slen = ParagonIE_Sodium_Core_Util::store64_le(64 + $msglen);\n\n        # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen);\n        $auth->update($slen);\n\n        # mac = c + mlen;\n        # crypto_onetimeauth_poly1305_final(&poly1305_state, mac);\n        $mac = $auth->finish();\n        $out .= $mac;\n\n        # sodium_memzero(&poly1305_state, sizeof poly1305_state);\n        unset($auth);\n\n\n        # XOR_BUF(STATE_INONCE(state), mac,\n        #     crypto_secretstream_xchacha20poly1305_INONCEBYTES);\n        $st->xorNonce($mac);\n\n        # sodium_increment(STATE_COUNTER(state),\n        #     crypto_secretstream_xchacha20poly1305_COUNTERBYTES);\n        $st->incrementCounter();\n        // Overwrite by reference:\n        $state = $st->toString();\n\n        /** @var bool $rekey */\n        $rekey = ($tag & ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY) !== 0;\n        # if ((tag & crypto_secretstream_xchacha20poly1305_TAG_REKEY) != 0 ||\n        #     sodium_is_zero(STATE_COUNTER(state),\n        #         crypto_secretstream_xchacha20poly1305_COUNTERBYTES)) {\n        #     crypto_secretstream_xchacha20poly1305_rekey(state);\n        # }\n        if ($rekey || $st->needsRekey()) {\n            // DO REKEY\n            self::secretstream_xchacha20poly1305_rekey($state);\n        }\n        # if (outlen_p != NULL) {\n        #     *outlen_p = crypto_secretstream_xchacha20poly1305_ABYTES + mlen;\n        # }\n        return $out;\n    }\n\n    /**\n     * @param string $state\n     * @param string $cipher\n     * @param string $aad\n     * @return bool|array{0: string, 1: int}\n     * @throws SodiumException\n     */\n    public static function secretstream_xchacha20poly1305_pull(&$state, $cipher, $aad = '')\n    {\n        $st = ParagonIE_Sodium_Core_SecretStream_State::fromString($state);\n\n        $cipherlen = ParagonIE_Sodium_Core_Util::strlen($cipher);\n        #     mlen = inlen - crypto_secretstream_xchacha20poly1305_ABYTES;\n        $msglen = $cipherlen - ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES;\n        $aadlen = ParagonIE_Sodium_Core_Util::strlen($aad);\n\n        #     if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX) {\n        #         sodium_misuse();\n        #     }\n        if ((($msglen + 63) >> 6) > 0xfffffffe) {\n            throw new SodiumException(\n                'message cannot be larger than SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX bytes'\n            );\n        }\n\n        #     crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k);\n        #     crypto_onetimeauth_poly1305_init(&poly1305_state, block);\n        #     sodium_memzero(block, sizeof block);\n        $auth = new ParagonIE_Sodium_Core_Poly1305_State(\n            ParagonIE_Sodium_Core_ChaCha20::ietfStream(32, $st->getCombinedNonce(), $st->getKey())\n        );\n\n        #     crypto_onetimeauth_poly1305_update(&poly1305_state, ad, adlen);\n        $auth->update($aad);\n\n        #     crypto_onetimeauth_poly1305_update(&poly1305_state, _pad0,\n        #         (0x10 - adlen) & 0xf);\n        $auth->update(str_repeat(\"\\0\", ((0x10 - $aadlen) & 0xf)));\n\n\n        #     memset(block, 0, sizeof block);\n        #     block[0] = in[0];\n        #     crypto_stream_chacha20_ietf_xor_ic(block, block, sizeof block,\n        #                                        state->nonce, 1U, state->k);\n        $block = ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc(\n            $cipher[0] . str_repeat(\"\\0\", 63),\n            $st->getCombinedNonce(),\n            $st->getKey(),\n            ParagonIE_Sodium_Core_Util::store64_le(1)\n        );\n        #     tag = block[0];\n        #     block[0] = in[0];\n        #     crypto_onetimeauth_poly1305_update(&poly1305_state, block, sizeof block);\n        $tag = ParagonIE_Sodium_Core_Util::chrToInt($block[0]);\n        $block[0] = $cipher[0];\n        $auth->update($block);\n\n\n        #     c = in + (sizeof tag);\n        #     crypto_onetimeauth_poly1305_update(&poly1305_state, c, mlen);\n        $auth->update(ParagonIE_Sodium_Core_Util::substr($cipher, 1, $msglen));\n\n        #     crypto_onetimeauth_poly1305_update\n        #     (&poly1305_state, _pad0, (0x10 - (sizeof block) + mlen) & 0xf);\n        $auth->update(str_repeat(\"\\0\", ((0x10 - 64 + $msglen) & 0xf)));\n\n        #     STORE64_LE(slen, (uint64_t) adlen);\n        #     crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen);\n        $slen = ParagonIE_Sodium_Core_Util::store64_le($aadlen);\n        $auth->update($slen);\n\n        #     STORE64_LE(slen, (sizeof block) + mlen);\n        #     crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen);\n        $slen = ParagonIE_Sodium_Core_Util::store64_le(64 + $msglen);\n        $auth->update($slen);\n\n        #     crypto_onetimeauth_poly1305_final(&poly1305_state, mac);\n        #     sodium_memzero(&poly1305_state, sizeof poly1305_state);\n        $mac = $auth->finish();\n\n        #     stored_mac = c + mlen;\n        #     if (sodium_memcmp(mac, stored_mac, sizeof mac) != 0) {\n        #     sodium_memzero(mac, sizeof mac);\n        #         return -1;\n        #     }\n\n        $stored = ParagonIE_Sodium_Core_Util::substr($cipher, $msglen + 1, 16);\n        if (!ParagonIE_Sodium_Core_Util::hashEquals($mac, $stored)) {\n            return false;\n        }\n\n        #     crypto_stream_chacha20_ietf_xor_ic(m, c, mlen, state->nonce, 2U, state->k);\n        $out = ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc(\n            ParagonIE_Sodium_Core_Util::substr($cipher, 1, $msglen),\n            $st->getCombinedNonce(),\n            $st->getKey(),\n            ParagonIE_Sodium_Core_Util::store64_le(2)\n        );\n\n        #     XOR_BUF(STATE_INONCE(state), mac,\n        #         crypto_secretstream_xchacha20poly1305_INONCEBYTES);\n        $st->xorNonce($mac);\n\n        #     sodium_increment(STATE_COUNTER(state),\n        #         crypto_secretstream_xchacha20poly1305_COUNTERBYTES);\n        $st->incrementCounter();\n\n        #     if ((tag & crypto_secretstream_xchacha20poly1305_TAG_REKEY) != 0 ||\n        #         sodium_is_zero(STATE_COUNTER(state),\n        #             crypto_secretstream_xchacha20poly1305_COUNTERBYTES)) {\n        #         crypto_secretstream_xchacha20poly1305_rekey(state);\n        #     }\n\n        // Overwrite by reference:\n        $state = $st->toString();\n\n        /** @var bool $rekey */\n        $rekey = ($tag & ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY) !== 0;\n        if ($rekey || $st->needsRekey()) {\n            // DO REKEY\n            self::secretstream_xchacha20poly1305_rekey($state);\n        }\n        return array($out, $tag);\n    }\n\n    /**\n     * @param string $state\n     * @return void\n     * @throws SodiumException\n     */\n    public static function secretstream_xchacha20poly1305_rekey(&$state)\n    {\n        $st = ParagonIE_Sodium_Core_SecretStream_State::fromString($state);\n        # unsigned char new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES +\n        # crypto_secretstream_xchacha20poly1305_INONCEBYTES];\n        # size_t        i;\n        # for (i = 0U; i < crypto_stream_chacha20_ietf_KEYBYTES; i++) {\n        #     new_key_and_inonce[i] = state->k[i];\n        # }\n        $new_key_and_inonce = $st->getKey();\n\n        # for (i = 0U; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) {\n        #     new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + i] =\n        #         STATE_INONCE(state)[i];\n        # }\n        $new_key_and_inonce .= ParagonIE_Sodium_Core_Util::substR($st->getNonce(), 0, 8);\n\n        # crypto_stream_chacha20_ietf_xor(new_key_and_inonce, new_key_and_inonce,\n        #                                 sizeof new_key_and_inonce,\n        #                                 state->nonce, state->k);\n\n        $st->rekey(ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc(\n            $new_key_and_inonce,\n            $st->getCombinedNonce(),\n            $st->getKey(),\n            ParagonIE_Sodium_Core_Util::store64_le(0)\n        ));\n\n        # for (i = 0U; i < crypto_stream_chacha20_ietf_KEYBYTES; i++) {\n        #     state->k[i] = new_key_and_inonce[i];\n        # }\n        # for (i = 0U; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) {\n        #     STATE_INONCE(state)[i] =\n        #          new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + i];\n        # }\n        # _crypto_secretstream_xchacha20poly1305_counter_reset(state);\n        $st->counterReset();\n\n        $state = $st->toString();\n    }\n\n    /**\n     * Detached Ed25519 signature.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sign_detached($message, $sk)\n    {\n        return ParagonIE_Sodium_Core_Ed25519::sign_detached($message, $sk);\n    }\n\n    /**\n     * Attached Ed25519 signature. (Returns a signed message.)\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sign($message, $sk)\n    {\n        return ParagonIE_Sodium_Core_Ed25519::sign($message, $sk);\n    }\n\n    /**\n     * Opens a signed message. If valid, returns the message.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $signedMessage\n     * @param string $pk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sign_open($signedMessage, $pk)\n    {\n        return ParagonIE_Sodium_Core_Ed25519::sign_open($signedMessage, $pk);\n    }\n\n    /**\n     * Verify a detached signature of a given message and public key.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $signature\n     * @param string $message\n     * @param string $pk\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sign_verify_detached($signature, $message, $pk)\n    {\n        return ParagonIE_Sodium_Core_Ed25519::verify_detached($signature, $message, $pk);\n    }\n}\n", "num_lines": 1656}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Crypto32', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Crypto\n *\n * ATTENTION!\n *\n * If you are using this library, you should be using\n * ParagonIE_Sodium_Compat in your code, not this class.\n */\nabstract class ParagonIE_Sodium_Crypto32\n{\n    const aead_chacha20poly1305_KEYBYTES = 32;\n    const aead_chacha20poly1305_NSECBYTES = 0;\n    const aead_chacha20poly1305_NPUBBYTES = 8;\n    const aead_chacha20poly1305_ABYTES = 16;\n\n    const aead_chacha20poly1305_IETF_KEYBYTES = 32;\n    const aead_chacha20poly1305_IETF_NSECBYTES = 0;\n    const aead_chacha20poly1305_IETF_NPUBBYTES = 12;\n    const aead_chacha20poly1305_IETF_ABYTES = 16;\n\n    const aead_xchacha20poly1305_IETF_KEYBYTES = 32;\n    const aead_xchacha20poly1305_IETF_NSECBYTES = 0;\n    const aead_xchacha20poly1305_IETF_NPUBBYTES = 24;\n    const aead_xchacha20poly1305_IETF_ABYTES = 16;\n\n    const box_curve25519xsalsa20poly1305_SEEDBYTES = 32;\n    const box_curve25519xsalsa20poly1305_PUBLICKEYBYTES = 32;\n    const box_curve25519xsalsa20poly1305_SECRETKEYBYTES = 32;\n    const box_curve25519xsalsa20poly1305_BEFORENMBYTES = 32;\n    const box_curve25519xsalsa20poly1305_NONCEBYTES = 24;\n    const box_curve25519xsalsa20poly1305_MACBYTES = 16;\n    const box_curve25519xsalsa20poly1305_BOXZEROBYTES = 16;\n    const box_curve25519xsalsa20poly1305_ZEROBYTES = 32;\n\n    const onetimeauth_poly1305_BYTES = 16;\n    const onetimeauth_poly1305_KEYBYTES = 32;\n\n    const secretbox_xsalsa20poly1305_KEYBYTES = 32;\n    const secretbox_xsalsa20poly1305_NONCEBYTES = 24;\n    const secretbox_xsalsa20poly1305_MACBYTES = 16;\n    const secretbox_xsalsa20poly1305_BOXZEROBYTES = 16;\n    const secretbox_xsalsa20poly1305_ZEROBYTES = 32;\n\n    const secretbox_xchacha20poly1305_KEYBYTES = 32;\n    const secretbox_xchacha20poly1305_NONCEBYTES = 24;\n    const secretbox_xchacha20poly1305_MACBYTES = 16;\n    const secretbox_xchacha20poly1305_BOXZEROBYTES = 16;\n    const secretbox_xchacha20poly1305_ZEROBYTES = 32;\n\n    const stream_salsa20_KEYBYTES = 32;\n\n    /**\n     * AEAD Decryption with ChaCha20-Poly1305\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $ad\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function aead_chacha20poly1305_decrypt(\n        $message = '',\n        $ad = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        /** @var int $len - Length of message (ciphertext + MAC) */\n        $len = ParagonIE_Sodium_Core32_Util::strlen($message);\n\n        /** @var int  $clen - Length of ciphertext */\n        $clen = $len - self::aead_chacha20poly1305_ABYTES;\n\n        /** @var int $adlen - Length of associated data */\n        $adlen = ParagonIE_Sodium_Core32_Util::strlen($ad);\n\n        /** @var string $mac - Message authentication code */\n        $mac = ParagonIE_Sodium_Core32_Util::substr(\n            $message,\n            $clen,\n            self::aead_chacha20poly1305_ABYTES\n        );\n\n        /** @var string $ciphertext - The encrypted message (sans MAC) */\n        $ciphertext = ParagonIE_Sodium_Core32_Util::substr($message, 0, $clen);\n\n        /** @var string The first block of the chacha20 keystream, used as a poly1305 key */\n        $block0 = ParagonIE_Sodium_Core32_ChaCha20::stream(\n            32,\n            $nonce,\n            $key\n        );\n\n        /* Recalculate the Poly1305 authentication tag (MAC): */\n        $state = new ParagonIE_Sodium_Core32_Poly1305_State($block0);\n        try {\n            ParagonIE_Sodium_Compat::memzero($block0);\n        } catch (SodiumException $ex) {\n            $block0 = null;\n        }\n        $state->update($ad);\n        $state->update(ParagonIE_Sodium_Core32_Util::store64_le($adlen));\n        $state->update($ciphertext);\n        $state->update(ParagonIE_Sodium_Core32_Util::store64_le($clen));\n        $computed_mac = $state->finish();\n\n        /* Compare the given MAC with the recalculated MAC: */\n        if (!ParagonIE_Sodium_Core32_Util::verify_16($computed_mac, $mac)) {\n            throw new SodiumException('Invalid MAC');\n        }\n\n        // Here, we know that the MAC is valid, so we decrypt and return the plaintext\n        return ParagonIE_Sodium_Core32_ChaCha20::streamXorIc(\n            $ciphertext,\n            $nonce,\n            $key,\n            ParagonIE_Sodium_Core32_Util::store64_le(1)\n        );\n    }\n\n    /**\n     * AEAD Encryption with ChaCha20-Poly1305\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $ad\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function aead_chacha20poly1305_encrypt(\n        $message = '',\n        $ad = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        /** @var int $len - Length of the plaintext message */\n        $len = ParagonIE_Sodium_Core32_Util::strlen($message);\n\n        /** @var int $adlen - Length of the associated data */\n        $adlen = ParagonIE_Sodium_Core32_Util::strlen($ad);\n\n        /** @var string The first block of the chacha20 keystream, used as a poly1305 key */\n        $block0 = ParagonIE_Sodium_Core32_ChaCha20::stream(\n            32,\n            $nonce,\n            $key\n        );\n        $state = new ParagonIE_Sodium_Core32_Poly1305_State($block0);\n        try {\n            ParagonIE_Sodium_Compat::memzero($block0);\n        } catch (SodiumException $ex) {\n            $block0 = null;\n        }\n\n        /** @var string $ciphertext - Raw encrypted data */\n        $ciphertext = ParagonIE_Sodium_Core32_ChaCha20::streamXorIc(\n            $message,\n            $nonce,\n            $key,\n            ParagonIE_Sodium_Core32_Util::store64_le(1)\n        );\n\n        $state->update($ad);\n        $state->update(ParagonIE_Sodium_Core32_Util::store64_le($adlen));\n        $state->update($ciphertext);\n        $state->update(ParagonIE_Sodium_Core32_Util::store64_le($len));\n        return $ciphertext . $state->finish();\n    }\n\n    /**\n     * AEAD Decryption with ChaCha20-Poly1305, IETF mode (96-bit nonce)\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $ad\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function aead_chacha20poly1305_ietf_decrypt(\n        $message = '',\n        $ad = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        /** @var int $adlen - Length of associated data */\n        $adlen = ParagonIE_Sodium_Core32_Util::strlen($ad);\n\n        /** @var int $len - Length of message (ciphertext + MAC) */\n        $len = ParagonIE_Sodium_Core32_Util::strlen($message);\n\n        /** @var int  $clen - Length of ciphertext */\n        $clen = $len - self::aead_chacha20poly1305_IETF_ABYTES;\n\n        /** @var string The first block of the chacha20 keystream, used as a poly1305 key */\n        $block0 = ParagonIE_Sodium_Core32_ChaCha20::ietfStream(\n            32,\n            $nonce,\n            $key\n        );\n\n        /** @var string $mac - Message authentication code */\n        $mac = ParagonIE_Sodium_Core32_Util::substr(\n            $message,\n            $len - self::aead_chacha20poly1305_IETF_ABYTES,\n            self::aead_chacha20poly1305_IETF_ABYTES\n        );\n\n        /** @var string $ciphertext - The encrypted message (sans MAC) */\n        $ciphertext = ParagonIE_Sodium_Core32_Util::substr(\n            $message,\n            0,\n            $len - self::aead_chacha20poly1305_IETF_ABYTES\n        );\n\n        /* Recalculate the Poly1305 authentication tag (MAC): */\n        $state = new ParagonIE_Sodium_Core32_Poly1305_State($block0);\n        try {\n            ParagonIE_Sodium_Compat::memzero($block0);\n        } catch (SodiumException $ex) {\n            $block0 = null;\n        }\n        $state->update($ad);\n        $state->update(str_repeat(\"\\x00\", ((0x10 - $adlen) & 0xf)));\n        $state->update($ciphertext);\n        $state->update(str_repeat(\"\\x00\", (0x10 - $clen) & 0xf));\n        $state->update(ParagonIE_Sodium_Core32_Util::store64_le($adlen));\n        $state->update(ParagonIE_Sodium_Core32_Util::store64_le($clen));\n        $computed_mac = $state->finish();\n\n        /* Compare the given MAC with the recalculated MAC: */\n        if (!ParagonIE_Sodium_Core32_Util::verify_16($computed_mac, $mac)) {\n            throw new SodiumException('Invalid MAC');\n        }\n\n        // Here, we know that the MAC is valid, so we decrypt and return the plaintext\n        return ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc(\n            $ciphertext,\n            $nonce,\n            $key,\n            ParagonIE_Sodium_Core32_Util::store64_le(1)\n        );\n    }\n\n    /**\n     * AEAD Encryption with ChaCha20-Poly1305, IETF mode (96-bit nonce)\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $ad\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function aead_chacha20poly1305_ietf_encrypt(\n        $message = '',\n        $ad = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        /** @var int $len - Length of the plaintext message */\n        $len = ParagonIE_Sodium_Core32_Util::strlen($message);\n\n        /** @var int $adlen - Length of the associated data */\n        $adlen = ParagonIE_Sodium_Core32_Util::strlen($ad);\n\n        /** @var string The first block of the chacha20 keystream, used as a poly1305 key */\n        $block0 = ParagonIE_Sodium_Core32_ChaCha20::ietfStream(\n            32,\n            $nonce,\n            $key\n        );\n        $state = new ParagonIE_Sodium_Core32_Poly1305_State($block0);\n        try {\n            ParagonIE_Sodium_Compat::memzero($block0);\n        } catch (SodiumException $ex) {\n            $block0 = null;\n        }\n\n        /** @var string $ciphertext - Raw encrypted data */\n        $ciphertext = ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc(\n            $message,\n            $nonce,\n            $key,\n            ParagonIE_Sodium_Core32_Util::store64_le(1)\n        );\n\n        $state->update($ad);\n        $state->update(str_repeat(\"\\x00\", ((0x10 - $adlen) & 0xf)));\n        $state->update($ciphertext);\n        $state->update(str_repeat(\"\\x00\", ((0x10 - $len) & 0xf)));\n        $state->update(ParagonIE_Sodium_Core32_Util::store64_le($adlen));\n        $state->update(ParagonIE_Sodium_Core32_Util::store64_le($len));\n        return $ciphertext . $state->finish();\n    }\n\n    /**\n     * AEAD Decryption with ChaCha20-Poly1305, IETF mode (96-bit nonce)\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $ad\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function aead_xchacha20poly1305_ietf_decrypt(\n        $message = '',\n        $ad = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        $subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20(\n            ParagonIE_Sodium_Core32_Util::substr($nonce, 0, 16),\n            $key\n        );\n        $nonceLast = \"\\x00\\x00\\x00\\x00\" .\n            ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8);\n\n        return self::aead_chacha20poly1305_ietf_decrypt($message, $ad, $nonceLast, $subkey);\n    }\n\n    /**\n     * AEAD Encryption with ChaCha20-Poly1305, IETF mode (96-bit nonce)\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $ad\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function aead_xchacha20poly1305_ietf_encrypt(\n        $message = '',\n        $ad = '',\n        $nonce = '',\n        $key = ''\n    ) {\n        $subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20(\n            ParagonIE_Sodium_Core32_Util::substr($nonce, 0, 16),\n            $key\n        );\n        $nonceLast = \"\\x00\\x00\\x00\\x00\" .\n            ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8);\n\n        return self::aead_chacha20poly1305_ietf_encrypt($message, $ad, $nonceLast, $subkey);\n    }\n\n    /**\n     * HMAC-SHA-512-256 (a.k.a. the leftmost 256 bits of HMAC-SHA-512)\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $key\n     * @return string\n     * @throws TypeError\n     */\n    public static function auth($message, $key)\n    {\n        return ParagonIE_Sodium_Core32_Util::substr(\n            hash_hmac('sha512', $message, $key, true),\n            0,\n            32\n        );\n    }\n\n    /**\n     * HMAC-SHA-512-256 validation. Constant-time via hash_equals().\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $mac\n     * @param string $message\n     * @param string $key\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function auth_verify($mac, $message, $key)\n    {\n        return ParagonIE_Sodium_Core32_Util::hashEquals(\n            $mac,\n            self::auth($message, $key)\n        );\n    }\n\n    /**\n     * X25519 key exchange followed by XSalsa20Poly1305 symmetric encryption\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $plaintext\n     * @param string $nonce\n     * @param string $keypair\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box($plaintext, $nonce, $keypair)\n    {\n        return self::secretbox(\n            $plaintext,\n            $nonce,\n            self::box_beforenm(\n                self::box_secretkey($keypair),\n                self::box_publickey($keypair)\n            )\n        );\n    }\n\n    /**\n     * X25519-XSalsa20-Poly1305 with one ephemeral X25519 keypair.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $publicKey\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_seal($message, $publicKey)\n    {\n        /** @var string $ephemeralKeypair */\n        $ephemeralKeypair = self::box_keypair();\n\n        /** @var string $ephemeralSK */\n        $ephemeralSK = self::box_secretkey($ephemeralKeypair);\n\n        /** @var string $ephemeralPK */\n        $ephemeralPK = self::box_publickey($ephemeralKeypair);\n\n        /** @var string $nonce */\n        $nonce = self::generichash(\n            $ephemeralPK . $publicKey,\n            '',\n            24\n        );\n\n        /** @var string $keypair - The combined keypair used in crypto_box() */\n        $keypair = self::box_keypair_from_secretkey_and_publickey($ephemeralSK, $publicKey);\n\n        /** @var string $ciphertext Ciphertext + MAC from crypto_box */\n        $ciphertext = self::box($message, $nonce, $keypair);\n        try {\n            ParagonIE_Sodium_Compat::memzero($ephemeralKeypair);\n            ParagonIE_Sodium_Compat::memzero($ephemeralSK);\n            ParagonIE_Sodium_Compat::memzero($nonce);\n        } catch (SodiumException $ex) {\n            $ephemeralKeypair = null;\n            $ephemeralSK = null;\n            $nonce = null;\n        }\n        return $ephemeralPK . $ciphertext;\n    }\n\n    /**\n     * Opens a message encrypted via box_seal().\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $keypair\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_seal_open($message, $keypair)\n    {\n        /** @var string $ephemeralPK */\n        $ephemeralPK = ParagonIE_Sodium_Core32_Util::substr($message, 0, 32);\n\n        /** @var string $ciphertext (ciphertext + MAC) */\n        $ciphertext = ParagonIE_Sodium_Core32_Util::substr($message, 32);\n\n        /** @var string $secretKey */\n        $secretKey = self::box_secretkey($keypair);\n\n        /** @var string $publicKey */\n        $publicKey = self::box_publickey($keypair);\n\n        /** @var string $nonce */\n        $nonce = self::generichash(\n            $ephemeralPK . $publicKey,\n            '',\n            24\n        );\n\n        /** @var string $keypair */\n        $keypair = self::box_keypair_from_secretkey_and_publickey($secretKey, $ephemeralPK);\n\n        /** @var string $m */\n        $m = self::box_open($ciphertext, $nonce, $keypair);\n        try {\n            ParagonIE_Sodium_Compat::memzero($secretKey);\n            ParagonIE_Sodium_Compat::memzero($ephemeralPK);\n            ParagonIE_Sodium_Compat::memzero($nonce);\n        } catch (SodiumException $ex) {\n            $secretKey = null;\n            $ephemeralPK = null;\n            $nonce = null;\n        }\n        return $m;\n    }\n\n    /**\n     * Used by crypto_box() to get the crypto_secretbox() key.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $sk\n     * @param string $pk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_beforenm($sk, $pk)\n    {\n        return ParagonIE_Sodium_Core32_HSalsa20::hsalsa20(\n            str_repeat(\"\\x00\", 16),\n            self::scalarmult($sk, $pk)\n        );\n    }\n\n    /**\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @return string\n     * @throws Exception\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_keypair()\n    {\n        $sKey = random_bytes(32);\n        $pKey = self::scalarmult_base($sKey);\n        return $sKey . $pKey;\n    }\n\n    /**\n     * @param string $seed\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_seed_keypair($seed)\n    {\n        $sKey = ParagonIE_Sodium_Core32_Util::substr(\n            hash('sha512', $seed, true),\n            0,\n            32\n        );\n        $pKey = self::scalarmult_base($sKey);\n        return $sKey . $pKey;\n    }\n\n    /**\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $sKey\n     * @param string $pKey\n     * @return string\n     * @throws TypeError\n     */\n    public static function box_keypair_from_secretkey_and_publickey($sKey, $pKey)\n    {\n        return ParagonIE_Sodium_Core32_Util::substr($sKey, 0, 32) .\n            ParagonIE_Sodium_Core32_Util::substr($pKey, 0, 32);\n    }\n\n    /**\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $keypair\n     * @return string\n     * @throws RangeException\n     * @throws TypeError\n     */\n    public static function box_secretkey($keypair)\n    {\n        if (ParagonIE_Sodium_Core32_Util::strlen($keypair) !== 64) {\n            throw new RangeException(\n                'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES bytes long.'\n            );\n        }\n        return ParagonIE_Sodium_Core32_Util::substr($keypair, 0, 32);\n    }\n\n    /**\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $keypair\n     * @return string\n     * @throws RangeException\n     * @throws TypeError\n     */\n    public static function box_publickey($keypair)\n    {\n        if (ParagonIE_Sodium_Core32_Util::strlen($keypair) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES) {\n            throw new RangeException(\n                'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES bytes long.'\n            );\n        }\n        return ParagonIE_Sodium_Core32_Util::substr($keypair, 32, 32);\n    }\n\n    /**\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $sKey\n     * @return string\n     * @throws RangeException\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_publickey_from_secretkey($sKey)\n    {\n        if (ParagonIE_Sodium_Core32_Util::strlen($sKey) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES) {\n            throw new RangeException(\n                'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES bytes long.'\n            );\n        }\n        return self::scalarmult_base($sKey);\n    }\n\n    /**\n     * Decrypt a message encrypted with box().\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $ciphertext\n     * @param string $nonce\n     * @param string $keypair\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_open($ciphertext, $nonce, $keypair)\n    {\n        return self::secretbox_open(\n            $ciphertext,\n            $nonce,\n            self::box_beforenm(\n                self::box_secretkey($keypair),\n                self::box_publickey($keypair)\n            )\n        );\n    }\n\n    /**\n     * Calculate a BLAKE2b hash.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string|null $key\n     * @param int $outlen\n     * @return string\n     * @throws RangeException\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function generichash($message, $key = '', $outlen = 32)\n    {\n        // This ensures that ParagonIE_Sodium_Core32_BLAKE2b::$iv is initialized\n        ParagonIE_Sodium_Core32_BLAKE2b::pseudoConstructor();\n\n        $k = null;\n        if (!empty($key)) {\n            /** @var SplFixedArray $k */\n            $k = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($key);\n            if ($k->count() > ParagonIE_Sodium_Core32_BLAKE2b::KEYBYTES) {\n                throw new RangeException('Invalid key size');\n            }\n        }\n\n        /** @var SplFixedArray $in */\n        $in = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($message);\n\n        /** @var SplFixedArray $ctx */\n        $ctx = ParagonIE_Sodium_Core32_BLAKE2b::init($k, $outlen);\n        ParagonIE_Sodium_Core32_BLAKE2b::update($ctx, $in, $in->count());\n\n        /** @var SplFixedArray $out */\n        $out = new SplFixedArray($outlen);\n        $out = ParagonIE_Sodium_Core32_BLAKE2b::finish($ctx, $out);\n\n        /** @var array<int, int> */\n        $outArray = $out->toArray();\n        return ParagonIE_Sodium_Core32_Util::intArrayToString($outArray);\n    }\n\n    /**\n     * Finalize a BLAKE2b hashing context, returning the hash.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $ctx\n     * @param int $outlen\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function generichash_final($ctx, $outlen = 32)\n    {\n        if (!is_string($ctx)) {\n            throw new TypeError('Context must be a string');\n        }\n        $out = new SplFixedArray($outlen);\n\n        /** @var SplFixedArray $context */\n        $context = ParagonIE_Sodium_Core32_BLAKE2b::stringToContext($ctx);\n\n        /** @var SplFixedArray $out */\n        $out = ParagonIE_Sodium_Core32_BLAKE2b::finish($context, $out);\n\n        /** @var array<int, int> */\n        $outArray = $out->toArray();\n        return ParagonIE_Sodium_Core32_Util::intArrayToString($outArray);\n    }\n\n    /**\n     * Initialize a hashing context for BLAKE2b.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $key\n     * @param int $outputLength\n     * @return string\n     * @throws RangeException\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function generichash_init($key = '', $outputLength = 32)\n    {\n        // This ensures that ParagonIE_Sodium_Core32_BLAKE2b::$iv is initialized\n        ParagonIE_Sodium_Core32_BLAKE2b::pseudoConstructor();\n\n        $k = null;\n        if (!empty($key)) {\n            $k = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($key);\n            if ($k->count() > ParagonIE_Sodium_Core32_BLAKE2b::KEYBYTES) {\n                throw new RangeException('Invalid key size');\n            }\n        }\n\n        /** @var SplFixedArray $ctx */\n        $ctx = ParagonIE_Sodium_Core32_BLAKE2b::init($k, $outputLength);\n\n        return ParagonIE_Sodium_Core32_BLAKE2b::contextToString($ctx);\n    }\n\n    /**\n     * Initialize a hashing context for BLAKE2b.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $key\n     * @param int $outputLength\n     * @param string $salt\n     * @param string $personal\n     * @return string\n     * @throws RangeException\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function generichash_init_salt_personal(\n        $key = '',\n        $outputLength = 32,\n        $salt = '',\n        $personal = ''\n    ) {\n        // This ensures that ParagonIE_Sodium_Core32_BLAKE2b::$iv is initialized\n        ParagonIE_Sodium_Core32_BLAKE2b::pseudoConstructor();\n\n        $k = null;\n        if (!empty($key)) {\n            $k = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($key);\n            if ($k->count() > ParagonIE_Sodium_Core32_BLAKE2b::KEYBYTES) {\n                throw new RangeException('Invalid key size');\n            }\n        }\n        if (!empty($salt)) {\n            $s = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($salt);\n        } else {\n            $s = null;\n        }\n        if (!empty($salt)) {\n            $p = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($personal);\n        } else {\n            $p = null;\n        }\n\n        /** @var SplFixedArray $ctx */\n        $ctx = ParagonIE_Sodium_Core32_BLAKE2b::init($k, $outputLength, $s, $p);\n\n        return ParagonIE_Sodium_Core32_BLAKE2b::contextToString($ctx);\n    }\n\n    /**\n     * Update a hashing context for BLAKE2b with $message\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $ctx\n     * @param string $message\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function generichash_update($ctx, $message)\n    {\n        // This ensures that ParagonIE_Sodium_Core32_BLAKE2b::$iv is initialized\n        ParagonIE_Sodium_Core32_BLAKE2b::pseudoConstructor();\n\n        /** @var SplFixedArray $context */\n        $context = ParagonIE_Sodium_Core32_BLAKE2b::stringToContext($ctx);\n\n        /** @var SplFixedArray $in */\n        $in = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($message);\n\n        ParagonIE_Sodium_Core32_BLAKE2b::update($context, $in, $in->count());\n\n        return ParagonIE_Sodium_Core32_BLAKE2b::contextToString($context);\n    }\n\n    /**\n     * Libsodium's crypto_kx().\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $my_sk\n     * @param string $their_pk\n     * @param string $client_pk\n     * @param string $server_pk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function keyExchange($my_sk, $their_pk, $client_pk, $server_pk)\n    {\n        return self::generichash(\n            self::scalarmult($my_sk, $their_pk) .\n            $client_pk .\n            $server_pk\n        );\n    }\n\n    /**\n     * ECDH over Curve25519\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $sKey\n     * @param string $pKey\n     * @return string\n     *\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function scalarmult($sKey, $pKey)\n    {\n        $q = ParagonIE_Sodium_Core32_X25519::crypto_scalarmult_curve25519_ref10($sKey, $pKey);\n        self::scalarmult_throw_if_zero($q);\n        return $q;\n    }\n\n    /**\n     * ECDH over Curve25519, using the basepoint.\n     * Used to get a secret key from a public key.\n     *\n     * @param string $secret\n     * @return string\n     *\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function scalarmult_base($secret)\n    {\n        $q = ParagonIE_Sodium_Core32_X25519::crypto_scalarmult_curve25519_ref10_base($secret);\n        self::scalarmult_throw_if_zero($q);\n        return $q;\n    }\n\n    /**\n     * This throws an Error if a zero public key was passed to the function.\n     *\n     * @param string $q\n     * @return void\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    protected static function scalarmult_throw_if_zero($q)\n    {\n        $d = 0;\n        for ($i = 0; $i < self::box_curve25519xsalsa20poly1305_SECRETKEYBYTES; ++$i) {\n            $d |= ParagonIE_Sodium_Core32_Util::chrToInt($q[$i]);\n        }\n\n        /* branch-free variant of === 0 */\n        if (-(1 & (($d - 1) >> 8))) {\n            throw new SodiumException('Zero public key is not allowed');\n        }\n    }\n\n    /**\n     * XSalsa20-Poly1305 authenticated symmetric-key encryption.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $plaintext\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function secretbox($plaintext, $nonce, $key)\n    {\n        /** @var string $subkey */\n        $subkey = ParagonIE_Sodium_Core32_HSalsa20::hsalsa20($nonce, $key);\n\n        /** @var string $block0 */\n        $block0 = str_repeat(\"\\x00\", 32);\n\n        /** @var int $mlen - Length of the plaintext message */\n        $mlen = ParagonIE_Sodium_Core32_Util::strlen($plaintext);\n        $mlen0 = $mlen;\n        if ($mlen0 > 64 - self::secretbox_xsalsa20poly1305_ZEROBYTES) {\n            $mlen0 = 64 - self::secretbox_xsalsa20poly1305_ZEROBYTES;\n        }\n        $block0 .= ParagonIE_Sodium_Core32_Util::substr($plaintext, 0, $mlen0);\n\n        /** @var string $block0 */\n        $block0 = ParagonIE_Sodium_Core32_Salsa20::salsa20_xor(\n            $block0,\n            ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8),\n            $subkey\n        );\n\n        /** @var string $c */\n        $c = ParagonIE_Sodium_Core32_Util::substr(\n            $block0,\n            self::secretbox_xsalsa20poly1305_ZEROBYTES\n        );\n        if ($mlen > $mlen0) {\n            $c .= ParagonIE_Sodium_Core32_Salsa20::salsa20_xor_ic(\n                ParagonIE_Sodium_Core32_Util::substr(\n                    $plaintext,\n                    self::secretbox_xsalsa20poly1305_ZEROBYTES\n                ),\n                ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8),\n                1,\n                $subkey\n            );\n        }\n        $state = new ParagonIE_Sodium_Core32_Poly1305_State(\n            ParagonIE_Sodium_Core32_Util::substr(\n                $block0,\n                0,\n                self::onetimeauth_poly1305_KEYBYTES\n            )\n        );\n        try {\n            ParagonIE_Sodium_Compat::memzero($block0);\n            ParagonIE_Sodium_Compat::memzero($subkey);\n        } catch (SodiumException $ex) {\n            $block0 = null;\n            $subkey = null;\n        }\n\n        $state->update($c);\n\n        /** @var string $c - MAC || ciphertext */\n        $c = $state->finish() . $c;\n        unset($state);\n\n        return $c;\n    }\n\n    /**\n     * Decrypt a ciphertext generated via secretbox().\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $ciphertext\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function secretbox_open($ciphertext, $nonce, $key)\n    {\n        /** @var string $mac */\n        $mac = ParagonIE_Sodium_Core32_Util::substr(\n            $ciphertext,\n            0,\n            self::secretbox_xsalsa20poly1305_MACBYTES\n        );\n\n        /** @var string $c */\n        $c = ParagonIE_Sodium_Core32_Util::substr(\n            $ciphertext,\n            self::secretbox_xsalsa20poly1305_MACBYTES\n        );\n\n        /** @var int $clen */\n        $clen = ParagonIE_Sodium_Core32_Util::strlen($c);\n\n        /** @var string $subkey */\n        $subkey = ParagonIE_Sodium_Core32_HSalsa20::hsalsa20($nonce, $key);\n\n        /** @var string $block0 */\n        $block0 = ParagonIE_Sodium_Core32_Salsa20::salsa20(\n            64,\n            ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8),\n            $subkey\n        );\n        $verified = ParagonIE_Sodium_Core32_Poly1305::onetimeauth_verify(\n            $mac,\n            $c,\n            ParagonIE_Sodium_Core32_Util::substr($block0, 0, 32)\n        );\n        if (!$verified) {\n            try {\n                ParagonIE_Sodium_Compat::memzero($subkey);\n            } catch (SodiumException $ex) {\n                $subkey = null;\n            }\n            throw new SodiumException('Invalid MAC');\n        }\n\n        /** @var string $m - Decrypted message */\n        $m = ParagonIE_Sodium_Core32_Util::xorStrings(\n            ParagonIE_Sodium_Core32_Util::substr($block0, self::secretbox_xsalsa20poly1305_ZEROBYTES),\n            ParagonIE_Sodium_Core32_Util::substr($c, 0, self::secretbox_xsalsa20poly1305_ZEROBYTES)\n        );\n        if ($clen > self::secretbox_xsalsa20poly1305_ZEROBYTES) {\n            // We had more than 1 block, so let's continue to decrypt the rest.\n            $m .= ParagonIE_Sodium_Core32_Salsa20::salsa20_xor_ic(\n                ParagonIE_Sodium_Core32_Util::substr(\n                    $c,\n                    self::secretbox_xsalsa20poly1305_ZEROBYTES\n                ),\n                ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8),\n                1,\n                (string) $subkey\n            );\n        }\n        return $m;\n    }\n\n    /**\n     * XChaCha20-Poly1305 authenticated symmetric-key encryption.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $plaintext\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function secretbox_xchacha20poly1305($plaintext, $nonce, $key)\n    {\n        /** @var string $subkey */\n        $subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20(\n            ParagonIE_Sodium_Core32_Util::substr($nonce, 0, 16),\n            $key\n        );\n        $nonceLast = ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8);\n\n        /** @var string $block0 */\n        $block0 = str_repeat(\"\\x00\", 32);\n\n        /** @var int $mlen - Length of the plaintext message */\n        $mlen = ParagonIE_Sodium_Core32_Util::strlen($plaintext);\n        $mlen0 = $mlen;\n        if ($mlen0 > 64 - self::secretbox_xchacha20poly1305_ZEROBYTES) {\n            $mlen0 = 64 - self::secretbox_xchacha20poly1305_ZEROBYTES;\n        }\n        $block0 .= ParagonIE_Sodium_Core32_Util::substr($plaintext, 0, $mlen0);\n\n        /** @var string $block0 */\n        $block0 = ParagonIE_Sodium_Core32_ChaCha20::streamXorIc(\n            $block0,\n            $nonceLast,\n            $subkey\n        );\n\n        /** @var string $c */\n        $c = ParagonIE_Sodium_Core32_Util::substr(\n            $block0,\n            self::secretbox_xchacha20poly1305_ZEROBYTES\n        );\n        if ($mlen > $mlen0) {\n            $c .= ParagonIE_Sodium_Core32_ChaCha20::streamXorIc(\n                ParagonIE_Sodium_Core32_Util::substr(\n                    $plaintext,\n                    self::secretbox_xchacha20poly1305_ZEROBYTES\n                ),\n                $nonceLast,\n                $subkey,\n                ParagonIE_Sodium_Core32_Util::store64_le(1)\n            );\n        }\n        $state = new ParagonIE_Sodium_Core32_Poly1305_State(\n            ParagonIE_Sodium_Core32_Util::substr(\n                $block0,\n                0,\n                self::onetimeauth_poly1305_KEYBYTES\n            )\n        );\n        try {\n            ParagonIE_Sodium_Compat::memzero($block0);\n            ParagonIE_Sodium_Compat::memzero($subkey);\n        } catch (SodiumException $ex) {\n            $block0 = null;\n            $subkey = null;\n        }\n\n        $state->update($c);\n\n        /** @var string $c - MAC || ciphertext */\n        $c = $state->finish() . $c;\n        unset($state);\n\n        return $c;\n    }\n\n    /**\n     * Decrypt a ciphertext generated via secretbox_xchacha20poly1305().\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $ciphertext\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key)\n    {\n        /** @var string $mac */\n        $mac = ParagonIE_Sodium_Core32_Util::substr(\n            $ciphertext,\n            0,\n            self::secretbox_xchacha20poly1305_MACBYTES\n        );\n\n        /** @var string $c */\n        $c = ParagonIE_Sodium_Core32_Util::substr(\n            $ciphertext,\n            self::secretbox_xchacha20poly1305_MACBYTES\n        );\n\n        /** @var int $clen */\n        $clen = ParagonIE_Sodium_Core32_Util::strlen($c);\n\n        /** @var string $subkey */\n        $subkey = ParagonIE_Sodium_Core32_HChaCha20::hchacha20($nonce, $key);\n\n        /** @var string $block0 */\n        $block0 = ParagonIE_Sodium_Core32_ChaCha20::stream(\n            64,\n            ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8),\n            $subkey\n        );\n        $verified = ParagonIE_Sodium_Core32_Poly1305::onetimeauth_verify(\n            $mac,\n            $c,\n            ParagonIE_Sodium_Core32_Util::substr($block0, 0, 32)\n        );\n\n        if (!$verified) {\n            try {\n                ParagonIE_Sodium_Compat::memzero($subkey);\n            } catch (SodiumException $ex) {\n                $subkey = null;\n            }\n            throw new SodiumException('Invalid MAC');\n        }\n\n        /** @var string $m - Decrypted message */\n        $m = ParagonIE_Sodium_Core32_Util::xorStrings(\n            ParagonIE_Sodium_Core32_Util::substr($block0, self::secretbox_xchacha20poly1305_ZEROBYTES),\n            ParagonIE_Sodium_Core32_Util::substr($c, 0, self::secretbox_xchacha20poly1305_ZEROBYTES)\n        );\n\n        if ($clen > self::secretbox_xchacha20poly1305_ZEROBYTES) {\n            // We had more than 1 block, so let's continue to decrypt the rest.\n            $m .= ParagonIE_Sodium_Core32_ChaCha20::streamXorIc(\n                ParagonIE_Sodium_Core32_Util::substr(\n                    $c,\n                    self::secretbox_xchacha20poly1305_ZEROBYTES\n                ),\n                ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8),\n                (string) $subkey,\n                ParagonIE_Sodium_Core32_Util::store64_le(1)\n            );\n        }\n        return $m;\n    }\n\n    /**\n     * @param string $key\n     * @return array<int, string> Returns a state and a header.\n     * @throws Exception\n     * @throws SodiumException\n     */\n    public static function secretstream_xchacha20poly1305_init_push($key)\n    {\n        # randombytes_buf(out, crypto_secretstream_xchacha20poly1305_HEADERBYTES);\n        $out = random_bytes(24);\n\n        # crypto_core_hchacha20(state->k, out, k, NULL);\n        $subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20($out, $key);\n        $state = new ParagonIE_Sodium_Core32_SecretStream_State(\n            $subkey,\n            ParagonIE_Sodium_Core32_Util::substr($out, 16, 8) . str_repeat(\"\\0\", 4)\n        );\n\n        # _crypto_secretstream_xchacha20poly1305_counter_reset(state);\n        $state->counterReset();\n\n        # memcpy(STATE_INONCE(state), out + crypto_core_hchacha20_INPUTBYTES,\n        #        crypto_secretstream_xchacha20poly1305_INONCEBYTES);\n        # memset(state->_pad, 0, sizeof state->_pad);\n        return array(\n            $state->toString(),\n            $out\n        );\n    }\n\n    /**\n     * @param string $key\n     * @param string $header\n     * @return string Returns a state.\n     * @throws Exception\n     */\n    public static function secretstream_xchacha20poly1305_init_pull($key, $header)\n    {\n        # crypto_core_hchacha20(state->k, in, k, NULL);\n        $subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20(\n            ParagonIE_Sodium_Core32_Util::substr($header, 0, 16),\n            $key\n        );\n        $state = new ParagonIE_Sodium_Core32_SecretStream_State(\n            $subkey,\n            ParagonIE_Sodium_Core32_Util::substr($header, 16)\n        );\n        $state->counterReset();\n        # memcpy(STATE_INONCE(state), in + crypto_core_hchacha20_INPUTBYTES,\n        #     crypto_secretstream_xchacha20poly1305_INONCEBYTES);\n        # memset(state->_pad, 0, sizeof state->_pad);\n        # return 0;\n        return $state->toString();\n    }\n\n    /**\n     * @param string $state\n     * @param string $msg\n     * @param string $aad\n     * @param int $tag\n     * @return string\n     * @throws SodiumException\n     */\n    public static function secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0)\n    {\n        $st = ParagonIE_Sodium_Core32_SecretStream_State::fromString($state);\n        # crypto_onetimeauth_poly1305_state poly1305_state;\n        # unsigned char                     block[64U];\n        # unsigned char                     slen[8U];\n        # unsigned char                    *c;\n        # unsigned char                    *mac;\n\n        $msglen = ParagonIE_Sodium_Core32_Util::strlen($msg);\n        $aadlen = ParagonIE_Sodium_Core32_Util::strlen($aad);\n\n        if ((($msglen + 63) >> 6) > 0xfffffffe) {\n            throw new SodiumException(\n                'message cannot be larger than SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX bytes'\n            );\n        }\n\n        # if (outlen_p != NULL) {\n        #     *outlen_p = 0U;\n        # }\n        # if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX) {\n        #     sodium_misuse();\n        # }\n\n        # crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k);\n        # crypto_onetimeauth_poly1305_init(&poly1305_state, block);\n        # sodium_memzero(block, sizeof block);\n        $auth = new ParagonIE_Sodium_Core32_Poly1305_State(\n            ParagonIE_Sodium_Core32_ChaCha20::ietfStream(32, $st->getCombinedNonce(), $st->getKey())\n        );\n\n        # crypto_onetimeauth_poly1305_update(&poly1305_state, ad, adlen);\n        $auth->update($aad);\n\n        # crypto_onetimeauth_poly1305_update(&poly1305_state, _pad0,\n        #     (0x10 - adlen) & 0xf);\n        $auth->update(str_repeat(\"\\0\", ((0x10 - $aadlen) & 0xf)));\n\n        # memset(block, 0, sizeof block);\n        # block[0] = tag;\n        # crypto_stream_chacha20_ietf_xor_ic(block, block, sizeof block,\n        #                                    state->nonce, 1U, state->k);\n        $block = ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc(\n            ParagonIE_Sodium_Core32_Util::intToChr($tag) . str_repeat(\"\\0\", 63),\n            $st->getCombinedNonce(),\n            $st->getKey(),\n            ParagonIE_Sodium_Core32_Util::store64_le(1)\n        );\n\n        # crypto_onetimeauth_poly1305_update(&poly1305_state, block, sizeof block);\n        $auth->update($block);\n\n        # out[0] = block[0];\n        $out = $block[0];\n        # c = out + (sizeof tag);\n        # crypto_stream_chacha20_ietf_xor_ic(c, m, mlen, state->nonce, 2U, state->k);\n        $cipher = ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc(\n            $msg,\n            $st->getCombinedNonce(),\n            $st->getKey(),\n            ParagonIE_Sodium_Core32_Util::store64_le(2)\n        );\n\n        # crypto_onetimeauth_poly1305_update(&poly1305_state, c, mlen);\n        $auth->update($cipher);\n\n        $out .= $cipher;\n        unset($cipher);\n\n        # crypto_onetimeauth_poly1305_update\n        # (&poly1305_state, _pad0, (0x10 - (sizeof block) + mlen) & 0xf);\n        $auth->update(str_repeat(\"\\0\", ((0x10 - 64 + $msglen) & 0xf)));\n\n        # STORE64_LE(slen, (uint64_t) adlen);\n        $slen = ParagonIE_Sodium_Core32_Util::store64_le($aadlen);\n\n        # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen);\n        $auth->update($slen);\n\n        # STORE64_LE(slen, (sizeof block) + mlen);\n        $slen = ParagonIE_Sodium_Core32_Util::store64_le(64 + $msglen);\n\n        # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen);\n        $auth->update($slen);\n\n        # mac = c + mlen;\n        # crypto_onetimeauth_poly1305_final(&poly1305_state, mac);\n        $mac = $auth->finish();\n        $out .= $mac;\n\n        # sodium_memzero(&poly1305_state, sizeof poly1305_state);\n        unset($auth);\n\n\n        # XOR_BUF(STATE_INONCE(state), mac,\n        #     crypto_secretstream_xchacha20poly1305_INONCEBYTES);\n        $st->xorNonce($mac);\n\n        # sodium_increment(STATE_COUNTER(state),\n        #     crypto_secretstream_xchacha20poly1305_COUNTERBYTES);\n        $st->incrementCounter();\n        // Overwrite by reference:\n        $state = $st->toString();\n\n        /** @var bool $rekey */\n        $rekey = ($tag & ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY) !== 0;\n        # if ((tag & crypto_secretstream_xchacha20poly1305_TAG_REKEY) != 0 ||\n        #     sodium_is_zero(STATE_COUNTER(state),\n        #         crypto_secretstream_xchacha20poly1305_COUNTERBYTES)) {\n        #     crypto_secretstream_xchacha20poly1305_rekey(state);\n        # }\n        if ($rekey || $st->needsRekey()) {\n            // DO REKEY\n            self::secretstream_xchacha20poly1305_rekey($state);\n        }\n        # if (outlen_p != NULL) {\n        #     *outlen_p = crypto_secretstream_xchacha20poly1305_ABYTES + mlen;\n        # }\n        return $out;\n    }\n\n    /**\n     * @param string $state\n     * @param string $cipher\n     * @param string $aad\n     * @return bool|array{0: string, 1: int}\n     * @throws SodiumException\n     */\n    public static function secretstream_xchacha20poly1305_pull(&$state, $cipher, $aad = '')\n    {\n        $st = ParagonIE_Sodium_Core32_SecretStream_State::fromString($state);\n\n        $cipherlen = ParagonIE_Sodium_Core32_Util::strlen($cipher);\n        #     mlen = inlen - crypto_secretstream_xchacha20poly1305_ABYTES;\n        $msglen = $cipherlen - ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES;\n        $aadlen = ParagonIE_Sodium_Core32_Util::strlen($aad);\n\n        #     if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX) {\n        #         sodium_misuse();\n        #     }\n        if ((($msglen + 63) >> 6) > 0xfffffffe) {\n            throw new SodiumException(\n                'message cannot be larger than SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX bytes'\n            );\n        }\n\n        #     crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k);\n        #     crypto_onetimeauth_poly1305_init(&poly1305_state, block);\n        #     sodium_memzero(block, sizeof block);\n        $auth = new ParagonIE_Sodium_Core32_Poly1305_State(\n            ParagonIE_Sodium_Core32_ChaCha20::ietfStream(32, $st->getCombinedNonce(), $st->getKey())\n        );\n\n        #     crypto_onetimeauth_poly1305_update(&poly1305_state, ad, adlen);\n        $auth->update($aad);\n\n        #     crypto_onetimeauth_poly1305_update(&poly1305_state, _pad0,\n        #         (0x10 - adlen) & 0xf);\n        $auth->update(str_repeat(\"\\0\", ((0x10 - $aadlen) & 0xf)));\n\n\n        #     memset(block, 0, sizeof block);\n        #     block[0] = in[0];\n        #     crypto_stream_chacha20_ietf_xor_ic(block, block, sizeof block,\n        #                                        state->nonce, 1U, state->k);\n        $block = ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc(\n            $cipher[0] . str_repeat(\"\\0\", 63),\n            $st->getCombinedNonce(),\n            $st->getKey(),\n            ParagonIE_Sodium_Core32_Util::store64_le(1)\n        );\n        #     tag = block[0];\n        #     block[0] = in[0];\n        #     crypto_onetimeauth_poly1305_update(&poly1305_state, block, sizeof block);\n        $tag = ParagonIE_Sodium_Core32_Util::chrToInt($block[0]);\n        $block[0] = $cipher[0];\n        $auth->update($block);\n\n\n        #     c = in + (sizeof tag);\n        #     crypto_onetimeauth_poly1305_update(&poly1305_state, c, mlen);\n        $auth->update(ParagonIE_Sodium_Core32_Util::substr($cipher, 1, $msglen));\n\n        #     crypto_onetimeauth_poly1305_update\n        #     (&poly1305_state, _pad0, (0x10 - (sizeof block) + mlen) & 0xf);\n        $auth->update(str_repeat(\"\\0\", ((0x10 - 64 + $msglen) & 0xf)));\n\n        #     STORE64_LE(slen, (uint64_t) adlen);\n        #     crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen);\n        $slen = ParagonIE_Sodium_Core32_Util::store64_le($aadlen);\n        $auth->update($slen);\n\n        #     STORE64_LE(slen, (sizeof block) + mlen);\n        #     crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen);\n        $slen = ParagonIE_Sodium_Core32_Util::store64_le(64 + $msglen);\n        $auth->update($slen);\n\n        #     crypto_onetimeauth_poly1305_final(&poly1305_state, mac);\n        #     sodium_memzero(&poly1305_state, sizeof poly1305_state);\n        $mac = $auth->finish();\n\n        #     stored_mac = c + mlen;\n        #     if (sodium_memcmp(mac, stored_mac, sizeof mac) != 0) {\n        #     sodium_memzero(mac, sizeof mac);\n        #         return -1;\n        #     }\n\n        $stored = ParagonIE_Sodium_Core32_Util::substr($cipher, $msglen + 1, 16);\n        if (!ParagonIE_Sodium_Core32_Util::hashEquals($mac, $stored)) {\n            return false;\n        }\n\n        #     crypto_stream_chacha20_ietf_xor_ic(m, c, mlen, state->nonce, 2U, state->k);\n        $out = ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc(\n            ParagonIE_Sodium_Core32_Util::substr($cipher, 1, $msglen),\n            $st->getCombinedNonce(),\n            $st->getKey(),\n            ParagonIE_Sodium_Core32_Util::store64_le(2)\n        );\n\n        #     XOR_BUF(STATE_INONCE(state), mac,\n        #         crypto_secretstream_xchacha20poly1305_INONCEBYTES);\n        $st->xorNonce($mac);\n\n        #     sodium_increment(STATE_COUNTER(state),\n        #         crypto_secretstream_xchacha20poly1305_COUNTERBYTES);\n        $st->incrementCounter();\n\n        #     if ((tag & crypto_secretstream_xchacha20poly1305_TAG_REKEY) != 0 ||\n        #         sodium_is_zero(STATE_COUNTER(state),\n        #             crypto_secretstream_xchacha20poly1305_COUNTERBYTES)) {\n        #         crypto_secretstream_xchacha20poly1305_rekey(state);\n        #     }\n\n        // Overwrite by reference:\n        $state = $st->toString();\n\n        /** @var bool $rekey */\n        $rekey = ($tag & ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY) !== 0;\n        if ($rekey || $st->needsRekey()) {\n            // DO REKEY\n            self::secretstream_xchacha20poly1305_rekey($state);\n        }\n        return array($out, $tag);\n    }\n\n    /**\n     * @param string $state\n     * @return void\n     * @throws SodiumException\n     */\n    public static function secretstream_xchacha20poly1305_rekey(&$state)\n    {\n        $st = ParagonIE_Sodium_Core32_SecretStream_State::fromString($state);\n        # unsigned char new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES +\n        # crypto_secretstream_xchacha20poly1305_INONCEBYTES];\n        # size_t        i;\n        # for (i = 0U; i < crypto_stream_chacha20_ietf_KEYBYTES; i++) {\n        #     new_key_and_inonce[i] = state->k[i];\n        # }\n        $new_key_and_inonce = $st->getKey();\n\n        # for (i = 0U; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) {\n        #     new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + i] =\n        #         STATE_INONCE(state)[i];\n        # }\n        $new_key_and_inonce .= ParagonIE_Sodium_Core32_Util::substR($st->getNonce(), 0, 8);\n\n        # crypto_stream_chacha20_ietf_xor(new_key_and_inonce, new_key_and_inonce,\n        #                                 sizeof new_key_and_inonce,\n        #                                 state->nonce, state->k);\n\n        $st->rekey(ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc(\n            $new_key_and_inonce,\n            $st->getCombinedNonce(),\n            $st->getKey(),\n            ParagonIE_Sodium_Core32_Util::store64_le(0)\n        ));\n\n        # for (i = 0U; i < crypto_stream_chacha20_ietf_KEYBYTES; i++) {\n        #     state->k[i] = new_key_and_inonce[i];\n        # }\n        # for (i = 0U; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) {\n        #     STATE_INONCE(state)[i] =\n        #          new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + i];\n        # }\n        # _crypto_secretstream_xchacha20poly1305_counter_reset(state);\n        $st->counterReset();\n\n        $state = $st->toString();\n    }\n\n    /**\n     * Detached Ed25519 signature.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sign_detached($message, $sk)\n    {\n        return ParagonIE_Sodium_Core32_Ed25519::sign_detached($message, $sk);\n    }\n\n    /**\n     * Attached Ed25519 signature. (Returns a signed message.)\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $message\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sign($message, $sk)\n    {\n        return ParagonIE_Sodium_Core32_Ed25519::sign($message, $sk);\n    }\n\n    /**\n     * Opens a signed message. If valid, returns the message.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $signedMessage\n     * @param string $pk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sign_open($signedMessage, $pk)\n    {\n        return ParagonIE_Sodium_Core32_Ed25519::sign_open($signedMessage, $pk);\n    }\n\n    /**\n     * Verify a detached signature of a given message and public key.\n     *\n     * @internal Do not use this directly. Use ParagonIE_Sodium_Compat.\n     *\n     * @param string $signature\n     * @param string $message\n     * @param string $pk\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sign_verify_detached($signature, $message, $pk)\n    {\n        return ParagonIE_Sodium_Core32_Ed25519::verify_detached($signature, $message, $pk);\n    }\n}\n", "num_lines": 1655}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_File', false)) {\n    return;\n}\n/**\n * Class ParagonIE_Sodium_File\n */\nclass ParagonIE_Sodium_File extends ParagonIE_Sodium_Core_Util\n{\n    /* PHP's default buffer size is 8192 for fread()/fwrite(). */\n    const BUFFER_SIZE = 8192;\n\n    /**\n     * Box a file (rather than a string). Uses less memory than\n     * ParagonIE_Sodium_Compat::crypto_box(), but produces\n     * the same result.\n     *\n     * @param string $inputFile  Absolute path to a file on the filesystem\n     * @param string $outputFile Absolute path to a file on the filesystem\n     * @param string $nonce      Number to be used only once\n     * @param string $keyPair    ECDH secret key and ECDH public key concatenated\n     *\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box($inputFile, $outputFile, $nonce, $keyPair)\n    {\n        /* Type checks: */\n        if (!is_string($inputFile)) {\n            throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.');\n        }\n        if (!is_string($outputFile)) {\n            throw new TypeError('Argument 2 must be a string, ' . gettype($outputFile) . ' given.');\n        }\n        if (!is_string($nonce)) {\n            throw new TypeError('Argument 3 must be a string, ' . gettype($nonce) . ' given.');\n        }\n\n        /* Input validation: */\n        if (!is_string($keyPair)) {\n            throw new TypeError('Argument 4 must be a string, ' . gettype($keyPair) . ' given.');\n        }\n        if (self::strlen($nonce) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_NONCEBYTES) {\n            throw new TypeError('Argument 3 must be CRYPTO_BOX_NONCEBYTES bytes');\n        }\n        if (self::strlen($keyPair) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES) {\n            throw new TypeError('Argument 4 must be CRYPTO_BOX_KEYPAIRBYTES bytes');\n        }\n\n        /** @var int $size */\n        $size = filesize($inputFile);\n        if (!is_int($size)) {\n            throw new SodiumException('Could not obtain the file size');\n        }\n\n        /** @var resource $ifp */\n        $ifp = fopen($inputFile, 'rb');\n        if (!is_resource($ifp)) {\n            throw new SodiumException('Could not open input file for reading');\n        }\n\n        /** @var resource $ofp */\n        $ofp = fopen($outputFile, 'wb');\n        if (!is_resource($ofp)) {\n            fclose($ifp);\n            throw new SodiumException('Could not open output file for writing');\n        }\n\n        $res = self::box_encrypt($ifp, $ofp, $size, $nonce, $keyPair);\n        fclose($ifp);\n        fclose($ofp);\n        return $res;\n    }\n\n    /**\n     * Open a boxed file (rather than a string). Uses less memory than\n     * ParagonIE_Sodium_Compat::crypto_box_open(), but produces\n     * the same result.\n     *\n     * Warning: Does not protect against TOCTOU attacks. You should\n     * just load the file into memory and use crypto_box_open() if\n     * you are worried about those.\n     *\n     * @param string $inputFile\n     * @param string $outputFile\n     * @param string $nonce\n     * @param string $keypair\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_open($inputFile, $outputFile, $nonce, $keypair)\n    {\n        /* Type checks: */\n        if (!is_string($inputFile)) {\n            throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.');\n        }\n        if (!is_string($outputFile)) {\n            throw new TypeError('Argument 2 must be a string, ' . gettype($outputFile) . ' given.');\n        }\n        if (!is_string($nonce)) {\n            throw new TypeError('Argument 3 must be a string, ' . gettype($nonce) . ' given.');\n        }\n        if (!is_string($keypair)) {\n            throw new TypeError('Argument 4 must be a string, ' . gettype($keypair) . ' given.');\n        }\n\n        /* Input validation: */\n        if (self::strlen($nonce) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_NONCEBYTES) {\n            throw new TypeError('Argument 4 must be CRYPTO_BOX_NONCEBYTES bytes');\n        }\n        if (self::strlen($keypair) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES) {\n            throw new TypeError('Argument 4 must be CRYPTO_BOX_KEYPAIRBYTES bytes');\n        }\n\n        /** @var int $size */\n        $size = filesize($inputFile);\n        if (!is_int($size)) {\n            throw new SodiumException('Could not obtain the file size');\n        }\n\n        /** @var resource $ifp */\n        $ifp = fopen($inputFile, 'rb');\n        if (!is_resource($ifp)) {\n            throw new SodiumException('Could not open input file for reading');\n        }\n\n        /** @var resource $ofp */\n        $ofp = fopen($outputFile, 'wb');\n        if (!is_resource($ofp)) {\n            fclose($ifp);\n            throw new SodiumException('Could not open output file for writing');\n        }\n\n        $res = self::box_decrypt($ifp, $ofp, $size, $nonce, $keypair);\n        fclose($ifp);\n        fclose($ofp);\n        try {\n            ParagonIE_Sodium_Compat::memzero($nonce);\n            ParagonIE_Sodium_Compat::memzero($ephKeypair);\n        } catch (SodiumException $ex) {\n            unset($ephKeypair);\n        }\n        return $res;\n    }\n\n    /**\n     * Seal a file (rather than a string). Uses less memory than\n     * ParagonIE_Sodium_Compat::crypto_box_seal(), but produces\n     * the same result.\n     *\n     * @param string $inputFile  Absolute path to a file on the filesystem\n     * @param string $outputFile Absolute path to a file on the filesystem\n     * @param string $publicKey  ECDH public key\n     *\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_seal($inputFile, $outputFile, $publicKey)\n    {\n        /* Type checks: */\n        if (!is_string($inputFile)) {\n            throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.');\n        }\n        if (!is_string($outputFile)) {\n            throw new TypeError('Argument 2 must be a string, ' . gettype($outputFile) . ' given.');\n        }\n        if (!is_string($publicKey)) {\n            throw new TypeError('Argument 3 must be a string, ' . gettype($publicKey) . ' given.');\n        }\n\n        /* Input validation: */\n        if (self::strlen($publicKey) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_PUBLICKEYBYTES) {\n            throw new TypeError('Argument 3 must be CRYPTO_BOX_PUBLICKEYBYTES bytes');\n        }\n\n        /** @var int $size */\n        $size = filesize($inputFile);\n        if (!is_int($size)) {\n            throw new SodiumException('Could not obtain the file size');\n        }\n\n        /** @var resource $ifp */\n        $ifp = fopen($inputFile, 'rb');\n        if (!is_resource($ifp)) {\n            throw new SodiumException('Could not open input file for reading');\n        }\n\n        /** @var resource $ofp */\n        $ofp = fopen($outputFile, 'wb');\n        if (!is_resource($ofp)) {\n            fclose($ifp);\n            throw new SodiumException('Could not open output file for writing');\n        }\n\n        /** @var string $ephKeypair */\n        $ephKeypair = ParagonIE_Sodium_Compat::crypto_box_keypair();\n\n        /** @var string $msgKeypair */\n        $msgKeypair = ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey(\n            ParagonIE_Sodium_Compat::crypto_box_secretkey($ephKeypair),\n            $publicKey\n        );\n\n        /** @var string $ephemeralPK */\n        $ephemeralPK = ParagonIE_Sodium_Compat::crypto_box_publickey($ephKeypair);\n\n        /** @var string $nonce */\n        $nonce = ParagonIE_Sodium_Compat::crypto_generichash(\n            $ephemeralPK . $publicKey,\n            '',\n            24\n        );\n\n        /** @var int $firstWrite */\n        $firstWrite = fwrite(\n            $ofp,\n            $ephemeralPK,\n            ParagonIE_Sodium_Compat::CRYPTO_BOX_PUBLICKEYBYTES\n        );\n        if (!is_int($firstWrite)) {\n            fclose($ifp);\n            fclose($ofp);\n            ParagonIE_Sodium_Compat::memzero($ephKeypair);\n            throw new SodiumException('Could not write to output file');\n        }\n        if ($firstWrite !== ParagonIE_Sodium_Compat::CRYPTO_BOX_PUBLICKEYBYTES) {\n            ParagonIE_Sodium_Compat::memzero($ephKeypair);\n            fclose($ifp);\n            fclose($ofp);\n            throw new SodiumException('Error writing public key to output file');\n        }\n\n        $res = self::box_encrypt($ifp, $ofp, $size, $nonce, $msgKeypair);\n        fclose($ifp);\n        fclose($ofp);\n        try {\n            ParagonIE_Sodium_Compat::memzero($nonce);\n            ParagonIE_Sodium_Compat::memzero($ephKeypair);\n        } catch (SodiumException $ex) {\n            unset($ephKeypair);\n        }\n        return $res;\n    }\n\n    /**\n     * Open a sealed file (rather than a string). Uses less memory than\n     * ParagonIE_Sodium_Compat::crypto_box_seal_open(), but produces\n     * the same result.\n     *\n     * Warning: Does not protect against TOCTOU attacks. You should\n     * just load the file into memory and use crypto_box_seal_open() if\n     * you are worried about those.\n     *\n     * @param string $inputFile\n     * @param string $outputFile\n     * @param string $ecdhKeypair\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function box_seal_open($inputFile, $outputFile, $ecdhKeypair)\n    {\n        /* Type checks: */\n        if (!is_string($inputFile)) {\n            throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.');\n        }\n        if (!is_string($outputFile)) {\n            throw new TypeError('Argument 2 must be a string, ' . gettype($outputFile) . ' given.');\n        }\n        if (!is_string($ecdhKeypair)) {\n            throw new TypeError('Argument 3 must be a string, ' . gettype($ecdhKeypair) . ' given.');\n        }\n\n        /* Input validation: */\n        if (self::strlen($ecdhKeypair) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES) {\n            throw new TypeError('Argument 3 must be CRYPTO_BOX_KEYPAIRBYTES bytes');\n        }\n\n        $publicKey = ParagonIE_Sodium_Compat::crypto_box_publickey($ecdhKeypair);\n\n        /** @var int $size */\n        $size = filesize($inputFile);\n        if (!is_int($size)) {\n            throw new SodiumException('Could not obtain the file size');\n        }\n\n        /** @var resource $ifp */\n        $ifp = fopen($inputFile, 'rb');\n        if (!is_resource($ifp)) {\n            throw new SodiumException('Could not open input file for reading');\n        }\n\n        /** @var resource $ofp */\n        $ofp = fopen($outputFile, 'wb');\n        if (!is_resource($ofp)) {\n            fclose($ifp);\n            throw new SodiumException('Could not open output file for writing');\n        }\n\n        $ephemeralPK = fread($ifp, ParagonIE_Sodium_Compat::CRYPTO_BOX_PUBLICKEYBYTES);\n        if (!is_string($ephemeralPK)) {\n            throw new SodiumException('Could not read input file');\n        }\n        if (self::strlen($ephemeralPK) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_PUBLICKEYBYTES) {\n            fclose($ifp);\n            fclose($ofp);\n            throw new SodiumException('Could not read public key from sealed file');\n        }\n\n        $nonce = ParagonIE_Sodium_Compat::crypto_generichash(\n            $ephemeralPK . $publicKey,\n            '',\n            24\n        );\n        $msgKeypair = ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey(\n            ParagonIE_Sodium_Compat::crypto_box_secretkey($ecdhKeypair),\n            $ephemeralPK\n        );\n\n        $res = self::box_decrypt($ifp, $ofp, $size, $nonce, $msgKeypair);\n        fclose($ifp);\n        fclose($ofp);\n        try {\n            ParagonIE_Sodium_Compat::memzero($nonce);\n            ParagonIE_Sodium_Compat::memzero($ephKeypair);\n        } catch (SodiumException $ex) {\n            unset($ephKeypair);\n        }\n        return $res;\n    }\n\n    /**\n     * Calculate the BLAKE2b hash of a file.\n     *\n     * @param string      $filePath     Absolute path to a file on the filesystem\n     * @param string|null $key          BLAKE2b key\n     * @param int         $outputLength Length of hash output\n     *\n     * @return string                   BLAKE2b hash\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress FailedTypeResolution\n     */\n    public static function generichash($filePath, $key = '', $outputLength = 32)\n    {\n        /* Type checks: */\n        if (!is_string($filePath)) {\n            throw new TypeError('Argument 1 must be a string, ' . gettype($filePath) . ' given.');\n        }\n        if (!is_string($key)) {\n            if (is_null($key)) {\n                $key = '';\n            } else {\n                throw new TypeError('Argument 2 must be a string, ' . gettype($key) . ' given.');\n            }\n        }\n        if (!is_int($outputLength)) {\n            if (!is_numeric($outputLength)) {\n                throw new TypeError('Argument 3 must be an integer, ' . gettype($outputLength) . ' given.');\n            }\n            $outputLength = (int) $outputLength;\n        }\n\n        /* Input validation: */\n        if (!empty($key)) {\n            if (self::strlen($key) < ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_KEYBYTES_MIN) {\n                throw new TypeError('Argument 2 must be at least CRYPTO_GENERICHASH_KEYBYTES_MIN bytes');\n            }\n            if (self::strlen($key) > ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_KEYBYTES_MAX) {\n                throw new TypeError('Argument 2 must be at most CRYPTO_GENERICHASH_KEYBYTES_MAX bytes');\n            }\n        }\n        if ($outputLength < ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_BYTES_MIN) {\n            throw new SodiumException('Argument 3 must be at least CRYPTO_GENERICHASH_BYTES_MIN');\n        }\n        if ($outputLength > ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_BYTES_MAX) {\n            throw new SodiumException('Argument 3 must be at least CRYPTO_GENERICHASH_BYTES_MAX');\n        }\n\n        /** @var int $size */\n        $size = filesize($filePath);\n        if (!is_int($size)) {\n            throw new SodiumException('Could not obtain the file size');\n        }\n\n        /** @var resource $fp */\n        $fp = fopen($filePath, 'rb');\n        if (!is_resource($fp)) {\n            throw new SodiumException('Could not open input file for reading');\n        }\n        $ctx = ParagonIE_Sodium_Compat::crypto_generichash_init($key, $outputLength);\n        while ($size > 0) {\n            $blockSize = $size > 64\n                ? 64\n                : $size;\n            $read = fread($fp, $blockSize);\n            if (!is_string($read)) {\n                throw new SodiumException('Could not read input file');\n            }\n            ParagonIE_Sodium_Compat::crypto_generichash_update($ctx, $read);\n            $size -= $blockSize;\n        }\n\n        fclose($fp);\n        return ParagonIE_Sodium_Compat::crypto_generichash_final($ctx, $outputLength);\n    }\n\n    /**\n     * Encrypt a file (rather than a string). Uses less memory than\n     * ParagonIE_Sodium_Compat::crypto_secretbox(), but produces\n     * the same result.\n     *\n     * @param string $inputFile  Absolute path to a file on the filesystem\n     * @param string $outputFile Absolute path to a file on the filesystem\n     * @param string $nonce      Number to be used only once\n     * @param string $key        Encryption key\n     *\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function secretbox($inputFile, $outputFile, $nonce, $key)\n    {\n        /* Type checks: */\n        if (!is_string($inputFile)) {\n            throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given..');\n        }\n        if (!is_string($outputFile)) {\n            throw new TypeError('Argument 2 must be a string, ' . gettype($outputFile) . ' given.');\n        }\n        if (!is_string($nonce)) {\n            throw new TypeError('Argument 3 must be a string, ' . gettype($nonce) . ' given.');\n        }\n\n        /* Input validation: */\n        if (self::strlen($nonce) !== ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_NONCEBYTES) {\n            throw new TypeError('Argument 3 must be CRYPTO_SECRETBOX_NONCEBYTES bytes');\n        }\n        if (!is_string($key)) {\n            throw new TypeError('Argument 4 must be a string, ' . gettype($key) . ' given.');\n        }\n        if (self::strlen($key) !== ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_KEYBYTES) {\n            throw new TypeError('Argument 4 must be CRYPTO_SECRETBOX_KEYBYTES bytes');\n        }\n\n        /** @var int $size */\n        $size = filesize($inputFile);\n        if (!is_int($size)) {\n            throw new SodiumException('Could not obtain the file size');\n        }\n\n        /** @var resource $ifp */\n        $ifp = fopen($inputFile, 'rb');\n        if (!is_resource($ifp)) {\n            throw new SodiumException('Could not open input file for reading');\n        }\n\n        /** @var resource $ofp */\n        $ofp = fopen($outputFile, 'wb');\n        if (!is_resource($ofp)) {\n            fclose($ifp);\n            throw new SodiumException('Could not open output file for writing');\n        }\n\n        $res = self::secretbox_encrypt($ifp, $ofp, $size, $nonce, $key);\n        fclose($ifp);\n        fclose($ofp);\n        return $res;\n    }\n    /**\n     * Seal a file (rather than a string). Uses less memory than\n     * ParagonIE_Sodium_Compat::crypto_secretbox_open(), but produces\n     * the same result.\n     *\n     * Warning: Does not protect against TOCTOU attacks. You should\n     * just load the file into memory and use crypto_secretbox_open() if\n     * you are worried about those.\n     *\n     * @param string $inputFile\n     * @param string $outputFile\n     * @param string $nonce\n     * @param string $key\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function secretbox_open($inputFile, $outputFile, $nonce, $key)\n    {\n        /* Type checks: */\n        if (!is_string($inputFile)) {\n            throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.');\n        }\n        if (!is_string($outputFile)) {\n            throw new TypeError('Argument 2 must be a string, ' . gettype($outputFile) . ' given.');\n        }\n        if (!is_string($nonce)) {\n            throw new TypeError('Argument 3 must be a string, ' . gettype($nonce) . ' given.');\n        }\n        if (!is_string($key)) {\n            throw new TypeError('Argument 4 must be a string, ' . gettype($key) . ' given.');\n        }\n\n        /* Input validation: */\n        if (self::strlen($nonce) !== ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_NONCEBYTES) {\n            throw new TypeError('Argument 4 must be CRYPTO_SECRETBOX_NONCEBYTES bytes');\n        }\n        if (self::strlen($key) !== ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_KEYBYTES) {\n            throw new TypeError('Argument 4 must be CRYPTO_SECRETBOXBOX_KEYBYTES bytes');\n        }\n\n        /** @var int $size */\n        $size = filesize($inputFile);\n        if (!is_int($size)) {\n            throw new SodiumException('Could not obtain the file size');\n        }\n\n        /** @var resource $ifp */\n        $ifp = fopen($inputFile, 'rb');\n        if (!is_resource($ifp)) {\n            throw new SodiumException('Could not open input file for reading');\n        }\n\n        /** @var resource $ofp */\n        $ofp = fopen($outputFile, 'wb');\n        if (!is_resource($ofp)) {\n            fclose($ifp);\n            throw new SodiumException('Could not open output file for writing');\n        }\n\n        $res = self::secretbox_decrypt($ifp, $ofp, $size, $nonce, $key);\n        fclose($ifp);\n        fclose($ofp);\n        try {\n            ParagonIE_Sodium_Compat::memzero($key);\n        } catch (SodiumException $ex) {\n            unset($key);\n        }\n        return $res;\n    }\n\n    /**\n     * Sign a file (rather than a string). Uses less memory than\n     * ParagonIE_Sodium_Compat::crypto_sign_detached(), but produces\n     * the same result.\n     *\n     * @param string $filePath  Absolute path to a file on the filesystem\n     * @param string $secretKey Secret signing key\n     *\n     * @return string           Ed25519 signature\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sign($filePath, $secretKey)\n    {\n        /* Type checks: */\n        if (!is_string($filePath)) {\n            throw new TypeError('Argument 1 must be a string, ' . gettype($filePath) . ' given.');\n        }\n        if (!is_string($secretKey)) {\n            throw new TypeError('Argument 2 must be a string, ' . gettype($secretKey) . ' given.');\n        }\n\n        /* Input validation: */\n        if (self::strlen($secretKey) !== ParagonIE_Sodium_Compat::CRYPTO_SIGN_SECRETKEYBYTES) {\n            throw new TypeError('Argument 2 must be CRYPTO_SIGN_SECRETKEYBYTES bytes');\n        }\n        if (PHP_INT_SIZE === 4) {\n            return self::sign_core32($filePath, $secretKey);\n        }\n\n        /** @var int $size */\n        $size = filesize($filePath);\n        if (!is_int($size)) {\n            throw new SodiumException('Could not obtain the file size');\n        }\n\n        /** @var resource $fp */\n        $fp = fopen($filePath, 'rb');\n        if (!is_resource($fp)) {\n            throw new SodiumException('Could not open input file for reading');\n        }\n\n        /** @var string $az */\n        $az = hash('sha512', self::substr($secretKey, 0, 32), true);\n\n        $az[0] = self::intToChr(self::chrToInt($az[0]) & 248);\n        $az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64);\n\n        $hs = hash_init('sha512');\n        hash_update($hs, self::substr($az, 32, 32));\n        /** @var resource $hs */\n        $hs = self::updateHashWithFile($hs, $fp, $size);\n\n        /** @var string $nonceHash */\n        $nonceHash = hash_final($hs, true);\n\n        /** @var string $pk */\n        $pk = self::substr($secretKey, 32, 32);\n\n        /** @var string $nonce */\n        $nonce = ParagonIE_Sodium_Core_Ed25519::sc_reduce($nonceHash) . self::substr($nonceHash, 32);\n\n        /** @var string $sig */\n        $sig = ParagonIE_Sodium_Core_Ed25519::ge_p3_tobytes(\n            ParagonIE_Sodium_Core_Ed25519::ge_scalarmult_base($nonce)\n        );\n\n        $hs = hash_init('sha512');\n        hash_update($hs, self::substr($sig, 0, 32));\n        hash_update($hs, self::substr($pk, 0, 32));\n        /** @var resource $hs */\n        $hs = self::updateHashWithFile($hs, $fp, $size);\n\n        /** @var string $hramHash */\n        $hramHash = hash_final($hs, true);\n\n        /** @var string $hram */\n        $hram = ParagonIE_Sodium_Core_Ed25519::sc_reduce($hramHash);\n\n        /** @var string $sigAfter */\n        $sigAfter = ParagonIE_Sodium_Core_Ed25519::sc_muladd($hram, $az, $nonce);\n\n        /** @var string $sig */\n        $sig = self::substr($sig, 0, 32) . self::substr($sigAfter, 0, 32);\n\n        try {\n            ParagonIE_Sodium_Compat::memzero($az);\n        } catch (SodiumException $ex) {\n            $az = null;\n        }\n        fclose($fp);\n        return $sig;\n    }\n\n    /**\n     * Verify a file (rather than a string). Uses less memory than\n     * ParagonIE_Sodium_Compat::crypto_sign_verify_detached(), but\n     * produces the same result.\n     *\n     * @param string $sig       Ed25519 signature\n     * @param string $filePath  Absolute path to a file on the filesystem\n     * @param string $publicKey Signing public key\n     *\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     * @throws Exception\n     */\n    public static function verify($sig, $filePath, $publicKey)\n    {\n        /* Type checks: */\n        if (!is_string($sig)) {\n            throw new TypeError('Argument 1 must be a string, ' . gettype($sig) . ' given.');\n        }\n        if (!is_string($filePath)) {\n            throw new TypeError('Argument 2 must be a string, ' . gettype($filePath) . ' given.');\n        }\n        if (!is_string($publicKey)) {\n            throw new TypeError('Argument 3 must be a string, ' . gettype($publicKey) . ' given.');\n        }\n\n        /* Input validation: */\n        if (self::strlen($sig) !== ParagonIE_Sodium_Compat::CRYPTO_SIGN_BYTES) {\n            throw new TypeError('Argument 1 must be CRYPTO_SIGN_BYTES bytes');\n        }\n        if (self::strlen($publicKey) !== ParagonIE_Sodium_Compat::CRYPTO_SIGN_PUBLICKEYBYTES) {\n            throw new TypeError('Argument 3 must be CRYPTO_SIGN_PUBLICKEYBYTES bytes');\n        }\n        if (self::strlen($sig) < 64) {\n            throw new SodiumException('Signature is too short');\n        }\n\n        if (PHP_INT_SIZE === 4) {\n            return self::verify_core32($sig, $filePath, $publicKey);\n        }\n\n        /* Security checks */\n        if (\n            (ParagonIE_Sodium_Core_Ed25519::chrToInt($sig[63]) & 240)\n                &&\n            ParagonIE_Sodium_Core_Ed25519::check_S_lt_L(self::substr($sig, 32, 32))\n        ) {\n            throw new SodiumException('S < L - Invalid signature');\n        }\n        if (ParagonIE_Sodium_Core_Ed25519::small_order($sig)) {\n            throw new SodiumException('Signature is on too small of an order');\n        }\n        if ((self::chrToInt($sig[63]) & 224) !== 0) {\n            throw new SodiumException('Invalid signature');\n        }\n        $d = 0;\n        for ($i = 0; $i < 32; ++$i) {\n            $d |= self::chrToInt($publicKey[$i]);\n        }\n        if ($d === 0) {\n            throw new SodiumException('All zero public key');\n        }\n\n        /** @var int $size */\n        $size = filesize($filePath);\n        if (!is_int($size)) {\n            throw new SodiumException('Could not obtain the file size');\n        }\n\n        /** @var resource $fp */\n        $fp = fopen($filePath, 'rb');\n        if (!is_resource($fp)) {\n            throw new SodiumException('Could not open input file for reading');\n        }\n\n        /** @var bool The original value of ParagonIE_Sodium_Compat::$fastMult */\n        $orig = ParagonIE_Sodium_Compat::$fastMult;\n\n        // Set ParagonIE_Sodium_Compat::$fastMult to true to speed up verification.\n        ParagonIE_Sodium_Compat::$fastMult = true;\n\n        /** @var ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A */\n        $A = ParagonIE_Sodium_Core_Ed25519::ge_frombytes_negate_vartime($publicKey);\n\n        $hs = hash_init('sha512');\n        hash_update($hs, self::substr($sig, 0, 32));\n        hash_update($hs, self::substr($publicKey, 0, 32));\n        /** @var resource $hs */\n        $hs = self::updateHashWithFile($hs, $fp, $size);\n        /** @var string $hDigest */\n        $hDigest = hash_final($hs, true);\n\n        /** @var string $h */\n        $h = ParagonIE_Sodium_Core_Ed25519::sc_reduce($hDigest) . self::substr($hDigest, 32);\n\n        /** @var ParagonIE_Sodium_Core_Curve25519_Ge_P2 $R */\n        $R = ParagonIE_Sodium_Core_Ed25519::ge_double_scalarmult_vartime(\n            $h,\n            $A,\n            self::substr($sig, 32)\n        );\n\n        /** @var string $rcheck */\n        $rcheck = ParagonIE_Sodium_Core_Ed25519::ge_tobytes($R);\n\n        // Close the file handle\n        fclose($fp);\n\n        // Reset ParagonIE_Sodium_Compat::$fastMult to what it was before.\n        ParagonIE_Sodium_Compat::$fastMult = $orig;\n        return self::verify_32($rcheck, self::substr($sig, 0, 32));\n    }\n\n    /**\n     * @param resource $ifp\n     * @param resource $ofp\n     * @param int      $mlen\n     * @param string   $nonce\n     * @param string   $boxKeypair\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    protected static function box_encrypt($ifp, $ofp, $mlen, $nonce, $boxKeypair)\n    {\n        if (PHP_INT_SIZE === 4) {\n            return self::secretbox_encrypt(\n                $ifp,\n                $ofp,\n                $mlen,\n                $nonce,\n                ParagonIE_Sodium_Crypto32::box_beforenm(\n                    ParagonIE_Sodium_Crypto32::box_secretkey($boxKeypair),\n                    ParagonIE_Sodium_Crypto32::box_publickey($boxKeypair)\n                )\n            );\n        }\n        return self::secretbox_encrypt(\n            $ifp,\n            $ofp,\n            $mlen,\n            $nonce,\n            ParagonIE_Sodium_Crypto::box_beforenm(\n                ParagonIE_Sodium_Crypto::box_secretkey($boxKeypair),\n                ParagonIE_Sodium_Crypto::box_publickey($boxKeypair)\n            )\n        );\n    }\n\n\n    /**\n     * @param resource $ifp\n     * @param resource $ofp\n     * @param int      $mlen\n     * @param string   $nonce\n     * @param string   $boxKeypair\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    protected static function box_decrypt($ifp, $ofp, $mlen, $nonce, $boxKeypair)\n    {\n        if (PHP_INT_SIZE === 4) {\n            return self::secretbox_decrypt(\n                $ifp,\n                $ofp,\n                $mlen,\n                $nonce,\n                ParagonIE_Sodium_Crypto32::box_beforenm(\n                    ParagonIE_Sodium_Crypto32::box_secretkey($boxKeypair),\n                    ParagonIE_Sodium_Crypto32::box_publickey($boxKeypair)\n                )\n            );\n        }\n        return self::secretbox_decrypt(\n            $ifp,\n            $ofp,\n            $mlen,\n            $nonce,\n            ParagonIE_Sodium_Crypto::box_beforenm(\n                ParagonIE_Sodium_Crypto::box_secretkey($boxKeypair),\n                ParagonIE_Sodium_Crypto::box_publickey($boxKeypair)\n            )\n        );\n    }\n\n    /**\n     * Encrypt a file\n     *\n     * @param resource $ifp\n     * @param resource $ofp\n     * @param int $mlen\n     * @param string $nonce\n     * @param string $key\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    protected static function secretbox_encrypt($ifp, $ofp, $mlen, $nonce, $key)\n    {\n        if (PHP_INT_SIZE === 4) {\n            return self::secretbox_encrypt_core32($ifp, $ofp, $mlen, $nonce, $key);\n        }\n\n        $plaintext = fread($ifp, 32);\n        if (!is_string($plaintext)) {\n            throw new SodiumException('Could not read input file');\n        }\n        $first32 = self::ftell($ifp);\n\n        /** @var string $subkey */\n        $subkey = ParagonIE_Sodium_Core_HSalsa20::hsalsa20($nonce, $key);\n\n        /** @var string $realNonce */\n        $realNonce = ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8);\n\n        /** @var string $block0 */\n        $block0 = str_repeat(\"\\x00\", 32);\n\n        /** @var int $mlen - Length of the plaintext message */\n        $mlen0 = $mlen;\n        if ($mlen0 > 64 - ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES) {\n            $mlen0 = 64 - ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES;\n        }\n        $block0 .= ParagonIE_Sodium_Core_Util::substr($plaintext, 0, $mlen0);\n\n        /** @var string $block0 */\n        $block0 = ParagonIE_Sodium_Core_Salsa20::salsa20_xor(\n            $block0,\n            $realNonce,\n            $subkey\n        );\n\n        $state = new ParagonIE_Sodium_Core_Poly1305_State(\n            ParagonIE_Sodium_Core_Util::substr(\n                $block0,\n                0,\n                ParagonIE_Sodium_Crypto::onetimeauth_poly1305_KEYBYTES\n            )\n        );\n\n        // Pre-write 16 blank bytes for the Poly1305 tag\n        $start = self::ftell($ofp);\n        fwrite($ofp, str_repeat(\"\\x00\", 16));\n\n        /** @var string $c */\n        $cBlock = ParagonIE_Sodium_Core_Util::substr(\n            $block0,\n            ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES\n        );\n        $state->update($cBlock);\n        fwrite($ofp, $cBlock);\n        $mlen -= 32;\n\n        /** @var int $iter */\n        $iter = 1;\n\n        /** @var int $incr */\n        $incr = self::BUFFER_SIZE >> 6;\n\n        /*\n         * Set the cursor to the end of the first half-block. All future bytes will\n         * generated from salsa20_xor_ic, starting from 1 (second block).\n         */\n        fseek($ifp, $first32, SEEK_SET);\n\n        while ($mlen > 0) {\n            $blockSize = $mlen > self::BUFFER_SIZE\n                ? self::BUFFER_SIZE\n                : $mlen;\n            $plaintext = fread($ifp, $blockSize);\n            if (!is_string($plaintext)) {\n                throw new SodiumException('Could not read input file');\n            }\n            $cBlock = ParagonIE_Sodium_Core_Salsa20::salsa20_xor_ic(\n                $plaintext,\n                $realNonce,\n                $iter,\n                $subkey\n            );\n            fwrite($ofp, $cBlock, $blockSize);\n            $state->update($cBlock);\n\n            $mlen -= $blockSize;\n            $iter += $incr;\n        }\n        try {\n            ParagonIE_Sodium_Compat::memzero($block0);\n            ParagonIE_Sodium_Compat::memzero($subkey);\n        } catch (SodiumException $ex) {\n            $block0 = null;\n            $subkey = null;\n        }\n        $end = self::ftell($ofp);\n\n        /*\n         * Write the Poly1305 authentication tag that provides integrity\n         * over the ciphertext (encrypt-then-MAC)\n         */\n        fseek($ofp, $start, SEEK_SET);\n        fwrite($ofp, $state->finish(), ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_MACBYTES);\n        fseek($ofp, $end, SEEK_SET);\n        unset($state);\n\n        return true;\n    }\n\n    /**\n     * Decrypt a file\n     *\n     * @param resource $ifp\n     * @param resource $ofp\n     * @param int $mlen\n     * @param string $nonce\n     * @param string $key\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    protected static function secretbox_decrypt($ifp, $ofp, $mlen, $nonce, $key)\n    {\n        if (PHP_INT_SIZE === 4) {\n            return self::secretbox_decrypt_core32($ifp, $ofp, $mlen, $nonce, $key);\n        }\n        $tag = fread($ifp, 16);\n        if (!is_string($tag)) {\n            throw new SodiumException('Could not read input file');\n        }\n\n        /** @var string $subkey */\n        $subkey = ParagonIE_Sodium_Core_HSalsa20::hsalsa20($nonce, $key);\n\n        /** @var string $realNonce */\n        $realNonce = ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8);\n\n        /** @var string $block0 */\n        $block0 = ParagonIE_Sodium_Core_Salsa20::salsa20(\n            64,\n            ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8),\n            $subkey\n        );\n\n        /* Verify the Poly1305 MAC -before- attempting to decrypt! */\n        $state = new ParagonIE_Sodium_Core_Poly1305_State(self::substr($block0, 0, 32));\n        if (!self::onetimeauth_verify($state, $ifp, $tag, $mlen)) {\n            throw new SodiumException('Invalid MAC');\n        }\n\n        /*\n         * Set the cursor to the end of the first half-block. All future bytes will\n         * generated from salsa20_xor_ic, starting from 1 (second block).\n         */\n        $first32 = fread($ifp, 32);\n        if (!is_string($first32)) {\n            throw new SodiumException('Could not read input file');\n        }\n        $first32len = self::strlen($first32);\n        fwrite(\n            $ofp,\n            self::xorStrings(\n                self::substr($block0, 32, $first32len),\n                self::substr($first32, 0, $first32len)\n            )\n        );\n        $mlen -= 32;\n\n        /** @var int $iter */\n        $iter = 1;\n\n        /** @var int $incr */\n        $incr = self::BUFFER_SIZE >> 6;\n\n        /* Decrypts ciphertext, writes to output file. */\n        while ($mlen > 0) {\n            $blockSize = $mlen > self::BUFFER_SIZE\n                ? self::BUFFER_SIZE\n                : $mlen;\n            $ciphertext = fread($ifp, $blockSize);\n            if (!is_string($ciphertext)) {\n                throw new SodiumException('Could not read input file');\n            }\n            $pBlock = ParagonIE_Sodium_Core_Salsa20::salsa20_xor_ic(\n                $ciphertext,\n                $realNonce,\n                $iter,\n                $subkey\n            );\n            fwrite($ofp, $pBlock, $blockSize);\n            $mlen -= $blockSize;\n            $iter += $incr;\n        }\n        return true;\n    }\n\n    /**\n     * @param ParagonIE_Sodium_Core_Poly1305_State $state\n     * @param resource $ifp\n     * @param string $tag\n     * @param int $mlen\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    protected static function onetimeauth_verify(\n        ParagonIE_Sodium_Core_Poly1305_State $state,\n        $ifp,\n        $tag = '',\n        $mlen = 0\n    ) {\n        /** @var int $pos */\n        $pos = self::ftell($ifp);\n\n        /** @var int $iter */\n        $iter = 1;\n\n        /** @var int $incr */\n        $incr = self::BUFFER_SIZE >> 6;\n\n        while ($mlen > 0) {\n            $blockSize = $mlen > self::BUFFER_SIZE\n                ? self::BUFFER_SIZE\n                : $mlen;\n            $ciphertext = fread($ifp, $blockSize);\n            if (!is_string($ciphertext)) {\n                throw new SodiumException('Could not read input file');\n            }\n            $state->update($ciphertext);\n            $mlen -= $blockSize;\n            $iter += $incr;\n        }\n        $res = ParagonIE_Sodium_Core_Util::verify_16($tag, $state->finish());\n\n        fseek($ifp, $pos, SEEK_SET);\n        return $res;\n    }\n\n    /**\n     * Update a hash context with the contents of a file, without\n     * loading the entire file into memory.\n     *\n     * @param resource|object $hash\n     * @param resource $fp\n     * @param int $size\n     * @return resource|object Resource on PHP < 7.2, HashContext object on PHP >= 7.2\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress PossiblyInvalidArgument\n     *                 PHP 7.2 changes from a resource to an object,\n     *                 which causes Psalm to complain about an error.\n     * @psalm-suppress TypeCoercion\n     *                 Ditto.\n     */\n    public static function updateHashWithFile($hash, $fp, $size = 0)\n    {\n        /* Type checks: */\n        if (PHP_VERSION_ID < 70200) {\n            if (!is_resource($hash)) {\n                throw new TypeError('Argument 1 must be a resource, ' . gettype($hash) . ' given.');\n            }\n        } else {\n            if (!is_object($hash)) {\n                throw new TypeError('Argument 1 must be an object (PHP 7.2+), ' . gettype($hash) . ' given.');\n            }\n        }\n\n        if (!is_resource($fp)) {\n            throw new TypeError('Argument 2 must be a resource, ' . gettype($fp) . ' given.');\n        }\n        if (!is_int($size)) {\n            throw new TypeError('Argument 3 must be an integer, ' . gettype($size) . ' given.');\n        }\n\n        /** @var int $originalPosition */\n        $originalPosition = self::ftell($fp);\n\n        // Move file pointer to beginning of file\n        fseek($fp, 0, SEEK_SET);\n        for ($i = 0; $i < $size; $i += self::BUFFER_SIZE) {\n            /** @var string|bool $message */\n            $message = fread(\n                $fp,\n                ($size - $i) > self::BUFFER_SIZE\n                    ? $size - $i\n                    : self::BUFFER_SIZE\n            );\n            if (!is_string($message)) {\n                throw new SodiumException('Unexpected error reading from file.');\n            }\n            /** @var string $message */\n            /** @psalm-suppress InvalidArgument */\n            hash_update($hash, $message);\n        }\n        // Reset file pointer's position\n        fseek($fp, $originalPosition, SEEK_SET);\n        return $hash;\n    }\n\n    /**\n     * Sign a file (rather than a string). Uses less memory than\n     * ParagonIE_Sodium_Compat::crypto_sign_detached(), but produces\n     * the same result. (32-bit)\n     *\n     * @param string $filePath  Absolute path to a file on the filesystem\n     * @param string $secretKey Secret signing key\n     *\n     * @return string           Ed25519 signature\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    private static function sign_core32($filePath, $secretKey)\n    {\n        /** @var int|bool $size */\n        $size = filesize($filePath);\n        if (!is_int($size)) {\n            throw new SodiumException('Could not obtain the file size');\n        }\n        /** @var int $size */\n\n        /** @var resource|bool $fp */\n        $fp = fopen($filePath, 'rb');\n        if (!is_resource($fp)) {\n            throw new SodiumException('Could not open input file for reading');\n        }\n        /** @var resource $fp */\n\n        /** @var string $az */\n        $az = hash('sha512', self::substr($secretKey, 0, 32), true);\n\n        $az[0] = self::intToChr(self::chrToInt($az[0]) & 248);\n        $az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64);\n\n        $hs = hash_init('sha512');\n        hash_update($hs, self::substr($az, 32, 32));\n        /** @var resource $hs */\n        $hs = self::updateHashWithFile($hs, $fp, $size);\n\n        /** @var string $nonceHash */\n        $nonceHash = hash_final($hs, true);\n\n        /** @var string $pk */\n        $pk = self::substr($secretKey, 32, 32);\n\n        /** @var string $nonce */\n        $nonce = ParagonIE_Sodium_Core32_Ed25519::sc_reduce($nonceHash) . self::substr($nonceHash, 32);\n\n        /** @var string $sig */\n        $sig = ParagonIE_Sodium_Core32_Ed25519::ge_p3_tobytes(\n            ParagonIE_Sodium_Core32_Ed25519::ge_scalarmult_base($nonce)\n        );\n\n        $hs = hash_init('sha512');\n        hash_update($hs, self::substr($sig, 0, 32));\n        hash_update($hs, self::substr($pk, 0, 32));\n        /** @var resource $hs */\n        $hs = self::updateHashWithFile($hs, $fp, $size);\n\n        /** @var string $hramHash */\n        $hramHash = hash_final($hs, true);\n\n        /** @var string $hram */\n        $hram = ParagonIE_Sodium_Core32_Ed25519::sc_reduce($hramHash);\n\n        /** @var string $sigAfter */\n        $sigAfter = ParagonIE_Sodium_Core32_Ed25519::sc_muladd($hram, $az, $nonce);\n\n        /** @var string $sig */\n        $sig = self::substr($sig, 0, 32) . self::substr($sigAfter, 0, 32);\n\n        try {\n            ParagonIE_Sodium_Compat::memzero($az);\n        } catch (SodiumException $ex) {\n            $az = null;\n        }\n        fclose($fp);\n        return $sig;\n    }\n\n    /**\n     *\n     * Verify a file (rather than a string). Uses less memory than\n     * ParagonIE_Sodium_Compat::crypto_sign_verify_detached(), but\n     * produces the same result. (32-bit)\n     *\n     * @param string $sig       Ed25519 signature\n     * @param string $filePath  Absolute path to a file on the filesystem\n     * @param string $publicKey Signing public key\n     *\n     * @return bool\n     * @throws SodiumException\n     * @throws Exception\n     */\n    public static function verify_core32($sig, $filePath, $publicKey)\n    {\n        /* Security checks */\n        if (ParagonIE_Sodium_Core32_Ed25519::check_S_lt_L(self::substr($sig, 32, 32))) {\n            throw new SodiumException('S < L - Invalid signature');\n        }\n        if (ParagonIE_Sodium_Core32_Ed25519::small_order($sig)) {\n            throw new SodiumException('Signature is on too small of an order');\n        }\n        if ((self::chrToInt($sig[63]) & 224) !== 0) {\n            throw new SodiumException('Invalid signature');\n        }\n        $d = 0;\n        for ($i = 0; $i < 32; ++$i) {\n            $d |= self::chrToInt($publicKey[$i]);\n        }\n        if ($d === 0) {\n            throw new SodiumException('All zero public key');\n        }\n\n        /** @var int|bool $size */\n        $size = filesize($filePath);\n        if (!is_int($size)) {\n            throw new SodiumException('Could not obtain the file size');\n        }\n        /** @var int $size */\n\n        /** @var resource|bool $fp */\n        $fp = fopen($filePath, 'rb');\n        if (!is_resource($fp)) {\n            throw new SodiumException('Could not open input file for reading');\n        }\n        /** @var resource $fp */\n\n        /** @var bool The original value of ParagonIE_Sodium_Compat::$fastMult */\n        $orig = ParagonIE_Sodium_Compat::$fastMult;\n\n        // Set ParagonIE_Sodium_Compat::$fastMult to true to speed up verification.\n        ParagonIE_Sodium_Compat::$fastMult = true;\n\n        /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A */\n        $A = ParagonIE_Sodium_Core32_Ed25519::ge_frombytes_negate_vartime($publicKey);\n\n        $hs = hash_init('sha512');\n        hash_update($hs, self::substr($sig, 0, 32));\n        hash_update($hs, self::substr($publicKey, 0, 32));\n        /** @var resource $hs */\n        $hs = self::updateHashWithFile($hs, $fp, $size);\n        /** @var string $hDigest */\n        $hDigest = hash_final($hs, true);\n\n        /** @var string $h */\n        $h = ParagonIE_Sodium_Core32_Ed25519::sc_reduce($hDigest) . self::substr($hDigest, 32);\n\n        /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $R */\n        $R = ParagonIE_Sodium_Core32_Ed25519::ge_double_scalarmult_vartime(\n            $h,\n            $A,\n            self::substr($sig, 32)\n        );\n\n        /** @var string $rcheck */\n        $rcheck = ParagonIE_Sodium_Core32_Ed25519::ge_tobytes($R);\n\n        // Close the file handle\n        fclose($fp);\n\n        // Reset ParagonIE_Sodium_Compat::$fastMult to what it was before.\n        ParagonIE_Sodium_Compat::$fastMult = $orig;\n        return self::verify_32($rcheck, self::substr($sig, 0, 32));\n    }\n\n    /**\n     * Encrypt a file (32-bit)\n     *\n     * @param resource $ifp\n     * @param resource $ofp\n     * @param int $mlen\n     * @param string $nonce\n     * @param string $key\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    protected static function secretbox_encrypt_core32($ifp, $ofp, $mlen, $nonce, $key)\n    {\n        $plaintext = fread($ifp, 32);\n        if (!is_string($plaintext)) {\n            throw new SodiumException('Could not read input file');\n        }\n        $first32 = self::ftell($ifp);\n\n        /** @var string $subkey */\n        $subkey = ParagonIE_Sodium_Core32_HSalsa20::hsalsa20($nonce, $key);\n\n        /** @var string $realNonce */\n        $realNonce = ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8);\n\n        /** @var string $block0 */\n        $block0 = str_repeat(\"\\x00\", 32);\n\n        /** @var int $mlen - Length of the plaintext message */\n        $mlen0 = $mlen;\n        if ($mlen0 > 64 - ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES) {\n            $mlen0 = 64 - ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES;\n        }\n        $block0 .= ParagonIE_Sodium_Core32_Util::substr($plaintext, 0, $mlen0);\n\n        /** @var string $block0 */\n        $block0 = ParagonIE_Sodium_Core32_Salsa20::salsa20_xor(\n            $block0,\n            $realNonce,\n            $subkey\n        );\n\n        $state = new ParagonIE_Sodium_Core32_Poly1305_State(\n            ParagonIE_Sodium_Core32_Util::substr(\n                $block0,\n                0,\n                ParagonIE_Sodium_Crypto::onetimeauth_poly1305_KEYBYTES\n            )\n        );\n\n        // Pre-write 16 blank bytes for the Poly1305 tag\n        $start = self::ftell($ofp);\n        fwrite($ofp, str_repeat(\"\\x00\", 16));\n\n        /** @var string $c */\n        $cBlock = ParagonIE_Sodium_Core32_Util::substr(\n            $block0,\n            ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES\n        );\n        $state->update($cBlock);\n        fwrite($ofp, $cBlock);\n        $mlen -= 32;\n\n        /** @var int $iter */\n        $iter = 1;\n\n        /** @var int $incr */\n        $incr = self::BUFFER_SIZE >> 6;\n\n        /*\n         * Set the cursor to the end of the first half-block. All future bytes will\n         * generated from salsa20_xor_ic, starting from 1 (second block).\n         */\n        fseek($ifp, $first32, SEEK_SET);\n\n        while ($mlen > 0) {\n            $blockSize = $mlen > self::BUFFER_SIZE\n                ? self::BUFFER_SIZE\n                : $mlen;\n            $plaintext = fread($ifp, $blockSize);\n            if (!is_string($plaintext)) {\n                throw new SodiumException('Could not read input file');\n            }\n            $cBlock = ParagonIE_Sodium_Core32_Salsa20::salsa20_xor_ic(\n                $plaintext,\n                $realNonce,\n                $iter,\n                $subkey\n            );\n            fwrite($ofp, $cBlock, $blockSize);\n            $state->update($cBlock);\n\n            $mlen -= $blockSize;\n            $iter += $incr;\n        }\n        try {\n            ParagonIE_Sodium_Compat::memzero($block0);\n            ParagonIE_Sodium_Compat::memzero($subkey);\n        } catch (SodiumException $ex) {\n            $block0 = null;\n            $subkey = null;\n        }\n        $end = self::ftell($ofp);\n\n        /*\n         * Write the Poly1305 authentication tag that provides integrity\n         * over the ciphertext (encrypt-then-MAC)\n         */\n        fseek($ofp, $start, SEEK_SET);\n        fwrite($ofp, $state->finish(), ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_MACBYTES);\n        fseek($ofp, $end, SEEK_SET);\n        unset($state);\n\n        return true;\n    }\n\n    /**\n     * Decrypt a file (32-bit)\n     *\n     * @param resource $ifp\n     * @param resource $ofp\n     * @param int $mlen\n     * @param string $nonce\n     * @param string $key\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    protected static function secretbox_decrypt_core32($ifp, $ofp, $mlen, $nonce, $key)\n    {\n        $tag = fread($ifp, 16);\n        if (!is_string($tag)) {\n            throw new SodiumException('Could not read input file');\n        }\n\n        /** @var string $subkey */\n        $subkey = ParagonIE_Sodium_Core32_HSalsa20::hsalsa20($nonce, $key);\n\n        /** @var string $realNonce */\n        $realNonce = ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8);\n\n        /** @var string $block0 */\n        $block0 = ParagonIE_Sodium_Core32_Salsa20::salsa20(\n            64,\n            ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8),\n            $subkey\n        );\n\n        /* Verify the Poly1305 MAC -before- attempting to decrypt! */\n        $state = new ParagonIE_Sodium_Core32_Poly1305_State(self::substr($block0, 0, 32));\n        if (!self::onetimeauth_verify_core32($state, $ifp, $tag, $mlen)) {\n            throw new SodiumException('Invalid MAC');\n        }\n\n        /*\n         * Set the cursor to the end of the first half-block. All future bytes will\n         * generated from salsa20_xor_ic, starting from 1 (second block).\n         */\n        $first32 = fread($ifp, 32);\n        if (!is_string($first32)) {\n            throw new SodiumException('Could not read input file');\n        }\n        $first32len = self::strlen($first32);\n        fwrite(\n            $ofp,\n            self::xorStrings(\n                self::substr($block0, 32, $first32len),\n                self::substr($first32, 0, $first32len)\n            )\n        );\n        $mlen -= 32;\n\n        /** @var int $iter */\n        $iter = 1;\n\n        /** @var int $incr */\n        $incr = self::BUFFER_SIZE >> 6;\n\n        /* Decrypts ciphertext, writes to output file. */\n        while ($mlen > 0) {\n            $blockSize = $mlen > self::BUFFER_SIZE\n                ? self::BUFFER_SIZE\n                : $mlen;\n            $ciphertext = fread($ifp, $blockSize);\n            if (!is_string($ciphertext)) {\n                throw new SodiumException('Could not read input file');\n            }\n            $pBlock = ParagonIE_Sodium_Core32_Salsa20::salsa20_xor_ic(\n                $ciphertext,\n                $realNonce,\n                $iter,\n                $subkey\n            );\n            fwrite($ofp, $pBlock, $blockSize);\n            $mlen -= $blockSize;\n            $iter += $incr;\n        }\n        return true;\n    }\n\n    /**\n     * One-time message authentication for 32-bit systems\n     *\n     * @param ParagonIE_Sodium_Core32_Poly1305_State $state\n     * @param resource $ifp\n     * @param string $tag\n     * @param int $mlen\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    protected static function onetimeauth_verify_core32(\n        ParagonIE_Sodium_Core32_Poly1305_State $state,\n        $ifp,\n        $tag = '',\n        $mlen = 0\n    ) {\n        /** @var int $pos */\n        $pos = self::ftell($ifp);\n\n        /** @var int $iter */\n        $iter = 1;\n\n        /** @var int $incr */\n        $incr = self::BUFFER_SIZE >> 6;\n\n        while ($mlen > 0) {\n            $blockSize = $mlen > self::BUFFER_SIZE\n                ? self::BUFFER_SIZE\n                : $mlen;\n            $ciphertext = fread($ifp, $blockSize);\n            if (!is_string($ciphertext)) {\n                throw new SodiumException('Could not read input file');\n            }\n            $state->update($ciphertext);\n            $mlen -= $blockSize;\n            $iter += $incr;\n        }\n        $res = ParagonIE_Sodium_Core32_Util::verify_16($tag, $state->finish());\n\n        fseek($ifp, $pos, SEEK_SET);\n        return $res;\n    }\n\n    /**\n     * @param resource $resource\n     * @return int\n     * @throws SodiumException\n     */\n    private static function ftell($resource)\n    {\n        $return = ftell($resource);\n        if (!is_int($return)) {\n            throw new SodiumException('ftell() returned false');\n        }\n        return (int) $return;\n    }\n}\n", "num_lines": 1562}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (!class_exists('SodiumException', false)) {\n    /**\n     * Class SodiumException\n     */\n    class SodiumException extends Exception\n    {\n\n    }\n}\n", "num_lines": 12}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_BLAKE2b', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_BLAKE2b\n *\n * Based on the work of Devi Mandiri in devi/salt.\n */\nabstract class ParagonIE_Sodium_Core_BLAKE2b extends ParagonIE_Sodium_Core_Util\n{\n    /**\n     * @var SplFixedArray\n     */\n    protected static $iv;\n\n    /**\n     * @var array<int, array<int, int>>\n     */\n    protected static $sigma = array(\n        array(  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15),\n        array( 14, 10,  4,  8,  9, 15, 13,  6,  1, 12,  0,  2, 11,  7,  5,  3),\n        array( 11,  8, 12,  0,  5,  2, 15, 13, 10, 14,  3,  6,  7,  1,  9,  4),\n        array(  7,  9,  3,  1, 13, 12, 11, 14,  2,  6,  5, 10,  4,  0, 15,  8),\n        array(  9,  0,  5,  7,  2,  4, 10, 15, 14,  1, 11, 12,  6,  8,  3, 13),\n        array(  2, 12,  6, 10,  0, 11,  8,  3,  4, 13,  7,  5, 15, 14,  1,  9),\n        array( 12,  5,  1, 15, 14, 13,  4, 10,  0,  7,  6,  3,  9,  2,  8, 11),\n        array( 13, 11,  7, 14, 12,  1,  3,  9,  5,  0, 15,  4,  8,  6,  2, 10),\n        array(  6, 15, 14,  9, 11,  3,  0,  8, 12,  2, 13,  7,  1,  4, 10,  5),\n        array( 10,  2,  8,  4,  7,  6,  1,  5, 15, 11,  9, 14,  3, 12, 13 , 0),\n        array(  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15),\n        array( 14, 10,  4,  8,  9, 15, 13,  6,  1, 12,  0,  2, 11,  7,  5,  3)\n    );\n\n    const BLOCKBYTES = 128;\n    const OUTBYTES   = 64;\n    const KEYBYTES   = 64;\n\n    /**\n     * Turn two 32-bit integers into a fixed array representing a 64-bit integer.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param int $high\n     * @param int $low\n     * @return SplFixedArray\n     * @psalm-suppress MixedAssignment\n     */\n    public static function new64($high, $low)\n    {\n        $i64 = new SplFixedArray(2);\n        $i64[0] = $high & 0xffffffff;\n        $i64[1] = $low & 0xffffffff;\n        return $i64;\n    }\n\n    /**\n     * Convert an arbitrary number into an SplFixedArray of two 32-bit integers\n     * that represents a 64-bit integer.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param int $num\n     * @return SplFixedArray\n     */\n    protected static function to64($num)\n    {\n        list($hi, $lo) = self::numericTo64BitInteger($num);\n        return self::new64($hi, $lo);\n    }\n\n    /**\n     * Adds two 64-bit integers together, returning their sum as a SplFixedArray\n     * containing two 32-bit integers (representing a 64-bit integer).\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $x\n     * @param SplFixedArray $y\n     * @return SplFixedArray\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedOperand\n     */\n    protected static function add64($x, $y)\n    {\n        $l = ($x[1] + $y[1]) & 0xffffffff;\n        return self::new64(\n            (int) ($x[0] + $y[0] + (\n                ($l < $x[1]) ? 1 : 0\n            )),\n            (int) $l\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $x\n     * @param SplFixedArray $y\n     * @param SplFixedArray $z\n     * @return SplFixedArray\n     */\n    protected static function add364($x, $y, $z)\n    {\n        return self::add64($x, self::add64($y, $z));\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $x\n     * @param SplFixedArray $y\n     * @return SplFixedArray\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    protected static function xor64(SplFixedArray $x, SplFixedArray $y)\n    {\n        if (!is_numeric($x[0])) {\n            throw new SodiumException('x[0] is not an integer');\n        }\n        if (!is_numeric($x[1])) {\n            throw new SodiumException('x[1] is not an integer');\n        }\n        if (!is_numeric($y[0])) {\n            throw new SodiumException('y[0] is not an integer');\n        }\n        if (!is_numeric($y[1])) {\n            throw new SodiumException('y[1] is not an integer');\n        }\n        return self::new64(\n            (int) (($x[0] ^ $y[0]) & 0xffffffff),\n            (int) (($x[1] ^ $y[1]) & 0xffffffff)\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $x\n     * @param int $c\n     * @return SplFixedArray\n     * @psalm-suppress MixedAssignment\n     */\n    public static function rotr64($x, $c)\n    {\n        if ($c >= 64) {\n            $c %= 64;\n        }\n        if ($c >= 32) {\n            /** @var int $tmp */\n            $tmp = $x[0];\n            $x[0] = $x[1];\n            $x[1] = $tmp;\n            $c -= 32;\n        }\n        if ($c === 0) {\n            return $x;\n        }\n\n        $l0 = 0;\n        $c = 64 - $c;\n\n        if ($c < 32) {\n            /** @var int $h0 */\n            $h0 = ((int) ($x[0]) << $c) | (\n                (\n                    (int) ($x[1]) & ((1 << $c) - 1)\n                        <<\n                    (32 - $c)\n                ) >> (32 - $c)\n            );\n            /** @var int $l0 */\n            $l0 = (int) ($x[1]) << $c;\n        } else {\n            /** @var int $h0 */\n            $h0 = (int) ($x[1]) << ($c - 32);\n        }\n\n        $h1 = 0;\n        $c1 = 64 - $c;\n\n        if ($c1 < 32) {\n            /** @var int $h1 */\n            $h1 = (int) ($x[0]) >> $c1;\n            /** @var int $l1 */\n            $l1 = ((int) ($x[1]) >> $c1) | ((int) ($x[0]) & ((1 << $c1) - 1)) << (32 - $c1);\n        } else {\n            /** @var int $l1 */\n            $l1 = (int) ($x[0]) >> ($c1 - 32);\n        }\n\n        return self::new64($h0 | $h1, $l0 | $l1);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $x\n     * @return int\n     * @psalm-suppress MixedOperand\n     */\n    protected static function flatten64($x)\n    {\n        return (int) ($x[0] * 4294967296 + $x[1]);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $x\n     * @param int $i\n     * @return SplFixedArray\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedArrayOffset\n     */\n    protected static function load64(SplFixedArray $x, $i)\n    {\n        /** @var int $l */\n        $l = (int) ($x[$i])\n             | ((int) ($x[$i+1]) << 8)\n             | ((int) ($x[$i+2]) << 16)\n             | ((int) ($x[$i+3]) << 24);\n        /** @var int $h */\n        $h = (int) ($x[$i+4])\n             | ((int) ($x[$i+5]) << 8)\n             | ((int) ($x[$i+6]) << 16)\n             | ((int) ($x[$i+7]) << 24);\n        return self::new64($h, $l);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $x\n     * @param int $i\n     * @param SplFixedArray $u\n     * @return void\n     * @psalm-suppress MixedAssignment\n     */\n    protected static function store64(SplFixedArray $x, $i, SplFixedArray $u)\n    {\n        $maxLength = $x->getSize() - 1;\n        for ($j = 0; $j < 8; ++$j) {\n            /*\n               [0, 1, 2, 3, 4, 5, 6, 7]\n                    ... becomes ...\n               [0, 0, 0, 0, 1, 1, 1, 1]\n            */\n            /** @var int $uIdx */\n            $uIdx = ((7 - $j) & 4) >> 2;\n            $x[$i]   = ((int) ($u[$uIdx]) & 0xff);\n            if (++$i > $maxLength) {\n                return;\n            }\n            /** @psalm-suppress MixedOperand */\n            $u[$uIdx] >>= 8;\n        }\n    }\n\n    /**\n     * This just sets the $iv static variable.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @return void\n     */\n    public static function pseudoConstructor()\n    {\n        static $called = false;\n        if ($called) {\n            return;\n        }\n        self::$iv = new SplFixedArray(8);\n        self::$iv[0] = self::new64(0x6a09e667, 0xf3bcc908);\n        self::$iv[1] = self::new64(0xbb67ae85, 0x84caa73b);\n        self::$iv[2] = self::new64(0x3c6ef372, 0xfe94f82b);\n        self::$iv[3] = self::new64(0xa54ff53a, 0x5f1d36f1);\n        self::$iv[4] = self::new64(0x510e527f, 0xade682d1);\n        self::$iv[5] = self::new64(0x9b05688c, 0x2b3e6c1f);\n        self::$iv[6] = self::new64(0x1f83d9ab, 0xfb41bd6b);\n        self::$iv[7] = self::new64(0x5be0cd19, 0x137e2179);\n\n        $called = true;\n    }\n\n    /**\n     * Returns a fresh BLAKE2 context.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @return SplFixedArray\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayAssignment\n     */\n    protected static function context()\n    {\n        $ctx    = new SplFixedArray(6);\n        $ctx[0] = new SplFixedArray(8);   // h\n        $ctx[1] = new SplFixedArray(2);   // t\n        $ctx[2] = new SplFixedArray(2);   // f\n        $ctx[3] = new SplFixedArray(256); // buf\n        $ctx[4] = 0;                      // buflen\n        $ctx[5] = 0;                      // last_node (uint8_t)\n\n        for ($i = 8; $i--;) {\n            $ctx[0][$i] = self::$iv[$i];\n        }\n        for ($i = 256; $i--;) {\n            $ctx[3][$i] = 0;\n        }\n\n        $zero = self::new64(0, 0);\n        $ctx[1][0] = $zero;\n        $ctx[1][1] = $zero;\n        $ctx[2][0] = $zero;\n        $ctx[2][1] = $zero;\n\n        return $ctx;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $ctx\n     * @param SplFixedArray $buf\n     * @return void\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayAssignment\n     * @psalm-suppress MixedArrayOffset\n     */\n    protected static function compress(SplFixedArray $ctx, SplFixedArray $buf)\n    {\n        $m = new SplFixedArray(16);\n        $v = new SplFixedArray(16);\n\n        for ($i = 16; $i--;) {\n            $m[$i] = self::load64($buf, $i << 3);\n        }\n\n        for ($i = 8; $i--;) {\n            $v[$i] = $ctx[0][$i];\n        }\n\n        $v[ 8] = self::$iv[0];\n        $v[ 9] = self::$iv[1];\n        $v[10] = self::$iv[2];\n        $v[11] = self::$iv[3];\n\n        $v[12] = self::xor64($ctx[1][0], self::$iv[4]);\n        $v[13] = self::xor64($ctx[1][1], self::$iv[5]);\n        $v[14] = self::xor64($ctx[2][0], self::$iv[6]);\n        $v[15] = self::xor64($ctx[2][1], self::$iv[7]);\n\n        for ($r = 0; $r < 12; ++$r) {\n            $v = self::G($r, 0, 0, 4, 8, 12, $v, $m);\n            $v = self::G($r, 1, 1, 5, 9, 13, $v, $m);\n            $v = self::G($r, 2, 2, 6, 10, 14, $v, $m);\n            $v = self::G($r, 3, 3, 7, 11, 15, $v, $m);\n            $v = self::G($r, 4, 0, 5, 10, 15, $v, $m);\n            $v = self::G($r, 5, 1, 6, 11, 12, $v, $m);\n            $v = self::G($r, 6, 2, 7, 8, 13, $v, $m);\n            $v = self::G($r, 7, 3, 4, 9, 14, $v, $m);\n        }\n\n        for ($i = 8; $i--;) {\n            $ctx[0][$i] = self::xor64(\n                $ctx[0][$i], self::xor64($v[$i], $v[$i+8])\n            );\n        }\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $r\n     * @param int $i\n     * @param int $a\n     * @param int $b\n     * @param int $c\n     * @param int $d\n     * @param SplFixedArray $v\n     * @param SplFixedArray $m\n     * @return SplFixedArray\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedArrayOffset\n     */\n    public static function G($r, $i, $a, $b, $c, $d, SplFixedArray $v, SplFixedArray $m)\n    {\n        $v[$a] = self::add364($v[$a], $v[$b], $m[self::$sigma[$r][$i << 1]]);\n        $v[$d] = self::rotr64(self::xor64($v[$d], $v[$a]), 32);\n        $v[$c] = self::add64($v[$c], $v[$d]);\n        $v[$b] = self::rotr64(self::xor64($v[$b], $v[$c]), 24);\n        $v[$a] = self::add364($v[$a], $v[$b], $m[self::$sigma[$r][($i << 1) + 1]]);\n        $v[$d] = self::rotr64(self::xor64($v[$d], $v[$a]), 16);\n        $v[$c] = self::add64($v[$c], $v[$d]);\n        $v[$b] = self::rotr64(self::xor64($v[$b], $v[$c]), 63);\n        return $v;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $ctx\n     * @param int $inc\n     * @return void\n     * @throws SodiumException\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayAssignment\n     */\n    public static function increment_counter($ctx, $inc)\n    {\n        if ($inc < 0) {\n            throw new SodiumException('Increasing by a negative number makes no sense.');\n        }\n        $t = self::to64($inc);\n        # S->t is $ctx[1] in our implementation\n\n        # S->t[0] = ( uint64_t )( t >> 0 );\n        $ctx[1][0] = self::add64($ctx[1][0], $t);\n\n        # S->t[1] += ( S->t[0] < inc );\n        if (self::flatten64($ctx[1][0]) < $inc) {\n            $ctx[1][1] = self::add64($ctx[1][1], self::to64(1));\n        }\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $ctx\n     * @param SplFixedArray $p\n     * @param int $plen\n     * @return void\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayAssignment\n     * @psalm-suppress MixedArrayOffset\n     * @psalm-suppress MixedOperand\n     */\n    public static function update(SplFixedArray $ctx, SplFixedArray $p, $plen)\n    {\n        self::pseudoConstructor();\n\n        $offset = 0;\n        while ($plen > 0) {\n            $left = $ctx[4];\n            $fill = 256 - $left;\n\n            if ($plen > $fill) {\n                # memcpy( S->buf + left, in, fill ); /* Fill buffer */\n                for ($i = $fill; $i--;) {\n                    $ctx[3][$i + $left] = $p[$i + $offset];\n                }\n\n                # S->buflen += fill;\n                $ctx[4] += $fill;\n\n                # blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );\n                self::increment_counter($ctx, 128);\n\n                # blake2b_compress( S, S->buf ); /* Compress */\n                self::compress($ctx, $ctx[3]);\n\n                # memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES ); /* Shift buffer left */\n                for ($i = 128; $i--;) {\n                    $ctx[3][$i] = $ctx[3][$i + 128];\n                }\n\n                # S->buflen -= BLAKE2B_BLOCKBYTES;\n                $ctx[4] -= 128;\n\n                # in += fill;\n                $offset += $fill;\n\n                # inlen -= fill;\n                $plen -= $fill;\n            } else {\n                for ($i = $plen; $i--;) {\n                    $ctx[3][$i + $left] = $p[$i + $offset];\n                }\n                $ctx[4] += $plen;\n                $offset += $plen;\n                $plen -= $plen;\n            }\n        }\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $ctx\n     * @param SplFixedArray $out\n     * @return SplFixedArray\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayAssignment\n     * @psalm-suppress MixedArrayOffset\n     * @psalm-suppress MixedOperand\n     */\n    public static function finish(SplFixedArray $ctx, SplFixedArray $out)\n    {\n        self::pseudoConstructor();\n        if ($ctx[4] > 128) {\n            self::increment_counter($ctx, 128);\n            self::compress($ctx, $ctx[3]);\n            $ctx[4] -= 128;\n            if ($ctx[4] > 128) {\n                throw new SodiumException('Failed to assert that buflen <= 128 bytes');\n            }\n            for ($i = $ctx[4]; $i--;) {\n                $ctx[3][$i] = $ctx[3][$i + 128];\n            }\n        }\n\n        self::increment_counter($ctx, $ctx[4]);\n        $ctx[2][0] = self::new64(0xffffffff, 0xffffffff);\n\n        for ($i = 256 - $ctx[4]; $i--;) {\n            $ctx[3][$i+$ctx[4]] = 0;\n        }\n\n        self::compress($ctx, $ctx[3]);\n\n        $i = (int) (($out->getSize() - 1) / 8);\n        for (; $i >= 0; --$i) {\n            self::store64($out, $i << 3, $ctx[0][$i]);\n        }\n        return $out;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray|null $key\n     * @param int $outlen\n     * @param SplFixedArray|null $salt\n     * @param SplFixedArray|null $personal\n     * @return SplFixedArray\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayAssignment\n     * @psalm-suppress MixedArrayOffset\n     */\n    public static function init(\n        $key = null,\n        $outlen = 64,\n        $salt = null,\n        $personal = null\n    ) {\n        self::pseudoConstructor();\n        $klen = 0;\n\n        if ($key !== null) {\n            if (count($key) > 64) {\n                throw new SodiumException('Invalid key size');\n            }\n            $klen = count($key);\n        }\n\n        if ($outlen > 64) {\n            throw new SodiumException('Invalid output size');\n        }\n\n        $ctx = self::context();\n\n        $p = new SplFixedArray(64);\n        // Zero our param buffer...\n        for ($i = 64; --$i;) {\n            $p[$i] = 0;\n        }\n\n        $p[0] = $outlen; // digest_length\n        $p[1] = $klen;   // key_length\n        $p[2] = 1;       // fanout\n        $p[3] = 1;       // depth\n\n        if ($salt instanceof SplFixedArray) {\n            // salt: [32] through [47]\n            for ($i = 0; $i < 16; ++$i) {\n                $p[32 + $i] = (int) $salt[$i];\n            }\n        }\n        if ($personal instanceof SplFixedArray) {\n            // personal: [48] through [63]\n            for ($i = 0; $i < 16; ++$i) {\n                $p[48 + $i] = (int) $personal[$i];\n            }\n        }\n\n        $ctx[0][0] = self::xor64(\n            $ctx[0][0],\n            self::load64($p, 0)\n        );\n        if ($salt instanceof SplFixedArray || $personal instanceof SplFixedArray) {\n            // We need to do what blake2b_init_param() does:\n            for ($i = 1; $i < 8; ++$i) {\n                $ctx[0][$i] = self::xor64(\n                    $ctx[0][$i],\n                    self::load64($p, $i << 3)\n                );\n            }\n        }\n\n        if ($klen > 0 && $key instanceof SplFixedArray) {\n            $block = new SplFixedArray(128);\n            for ($i = 128; $i--;) {\n                $block[$i] = 0;\n            }\n            for ($i = $klen; $i--;) {\n                $block[$i] = $key[$i];\n            }\n            self::update($ctx, $block, 128);\n            $ctx[4] = 128;\n        }\n\n        return $ctx;\n    }\n\n    /**\n     * Convert a string into an SplFixedArray of integers\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $str\n     * @return SplFixedArray\n     */\n    public static function stringToSplFixedArray($str = '')\n    {\n        $values = unpack('C*', $str);\n        return SplFixedArray::fromArray(array_values($values));\n    }\n\n    /**\n     * Convert an SplFixedArray of integers into a string\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $a\n     * @return string\n     * @throws TypeError\n     */\n    public static function SplFixedArrayToString(SplFixedArray $a)\n    {\n        /**\n         * @var array<int, int|string> $arr\n         */\n        $arr = $a->toArray();\n        $c = $a->count();\n        array_unshift($arr, str_repeat('C', $c));\n        return (string) (call_user_func_array('pack', $arr));\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $ctx\n     * @return string\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayAssignment\n     * @psalm-suppress MixedArrayOffset\n     * @psalm-suppress MixedMethodCall\n     */\n    public static function contextToString(SplFixedArray $ctx)\n    {\n        $str = '';\n        /** @var array<int, array<int, int>> $ctxA */\n        $ctxA = $ctx[0]->toArray();\n\n        # uint64_t h[8];\n        for ($i = 0; $i < 8; ++$i) {\n            $str .= self::store32_le($ctxA[$i][1]);\n            $str .= self::store32_le($ctxA[$i][0]);\n        }\n\n        # uint64_t t[2];\n        # uint64_t f[2];\n        for ($i = 1; $i < 3; ++$i) {\n            $ctxA = $ctx[$i]->toArray();\n            $str .= self::store32_le($ctxA[0][1]);\n            $str .= self::store32_le($ctxA[0][0]);\n            $str .= self::store32_le($ctxA[1][1]);\n            $str .= self::store32_le($ctxA[1][0]);\n        }\n\n        # uint8_t buf[2 * 128];\n        $str .= self::SplFixedArrayToString($ctx[3]);\n\n        /** @var int $ctx4 */\n        $ctx4 = (int) $ctx[4];\n\n        # size_t buflen;\n        $str .= implode('', array(\n            self::intToChr($ctx4 & 0xff),\n            self::intToChr(($ctx4 >> 8) & 0xff),\n            self::intToChr(($ctx4 >> 16) & 0xff),\n            self::intToChr(($ctx4 >> 24) & 0xff),\n            self::intToChr(($ctx4 >> 32) & 0xff),\n            self::intToChr(($ctx4 >> 40) & 0xff),\n            self::intToChr(($ctx4 >> 48) & 0xff),\n            self::intToChr(($ctx4 >> 56) & 0xff)\n        ));\n        # uint8_t last_node;\n        return $str . self::intToChr($ctx[5]) . str_repeat(\"\\x00\", 23);\n    }\n\n    /**\n     * Creates an SplFixedArray containing other SplFixedArray elements, from\n     * a string (compatible with \\Sodium\\crypto_generichash_{init, update, final})\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $string\n     * @return SplFixedArray\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArrayAssignment\n     */\n    public static function stringToContext($string)\n    {\n        $ctx = self::context();\n\n        # uint64_t h[8];\n        for ($i = 0; $i < 8; ++$i) {\n            $ctx[0][$i] = SplFixedArray::fromArray(\n                array(\n                    self::load_4(\n                        self::substr($string, (($i << 3) + 4), 4)\n                    ),\n                    self::load_4(\n                        self::substr($string, (($i << 3) + 0), 4)\n                    )\n                )\n            );\n        }\n\n        # uint64_t t[2];\n        # uint64_t f[2];\n        for ($i = 1; $i < 3; ++$i) {\n            $ctx[$i][1] = SplFixedArray::fromArray(\n                array(\n                    self::load_4(self::substr($string, 76 + (($i - 1) << 4), 4)),\n                    self::load_4(self::substr($string, 72 + (($i - 1) << 4), 4))\n                )\n            );\n            $ctx[$i][0] = SplFixedArray::fromArray(\n                array(\n                    self::load_4(self::substr($string, 68 + (($i - 1) << 4), 4)),\n                    self::load_4(self::substr($string, 64 + (($i - 1) << 4), 4))\n                )\n            );\n        }\n\n        # uint8_t buf[2 * 128];\n        $ctx[3] = self::stringToSplFixedArray(self::substr($string, 96, 256));\n\n        # uint8_t buf[2 * 128];\n        $int = 0;\n        for ($i = 0; $i < 8; ++$i) {\n            $int |= self::chrToInt($string[352 + $i]) << ($i << 3);\n        }\n        $ctx[4] = $int;\n\n        return $ctx;\n    }\n}\n", "num_lines": 790}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_ChaCha20', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_ChaCha20\n */\nclass ParagonIE_Sodium_Core_ChaCha20 extends ParagonIE_Sodium_Core_Util\n{\n    /**\n     * Bitwise left rotation\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param int $v\n     * @param int $n\n     * @return int\n     */\n    public static function rotate($v, $n)\n    {\n        $v &= 0xffffffff;\n        $n &= 31;\n        return (int) (\n            0xffffffff & (\n                ($v << $n)\n                    |\n                ($v >> (32 - $n))\n            )\n        );\n    }\n\n    /**\n     * The ChaCha20 quarter round function. Works on four 32-bit integers.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param int $a\n     * @param int $b\n     * @param int $c\n     * @param int $d\n     * @return array<int, int>\n     */\n    protected static function quarterRound($a, $b, $c, $d)\n    {\n        # a = PLUS(a,b); d = ROTATE(XOR(d,a),16);\n        /** @var int $a */\n        $a = ($a + $b) & 0xffffffff;\n        $d = self::rotate($d ^ $a, 16);\n\n        # c = PLUS(c,d); b = ROTATE(XOR(b,c),12);\n        /** @var int $c */\n        $c = ($c + $d) & 0xffffffff;\n        $b = self::rotate($b ^ $c, 12);\n\n        # a = PLUS(a,b); d = ROTATE(XOR(d,a), 8);\n        /** @var int $a */\n        $a = ($a + $b) & 0xffffffff;\n        $d = self::rotate($d ^ $a, 8);\n\n        # c = PLUS(c,d); b = ROTATE(XOR(b,c), 7);\n        /** @var int $c */\n        $c = ($c + $d) & 0xffffffff;\n        $b = self::rotate($b ^ $c, 7);\n        return array((int) $a, (int) $b, (int) $c, (int) $d);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_ChaCha20_Ctx $ctx\n     * @param string $message\n     *\n     * @return string\n     * @throws TypeError\n     * @throws SodiumException\n     */\n    public static function encryptBytes(\n        ParagonIE_Sodium_Core_ChaCha20_Ctx $ctx,\n        $message = ''\n    ) {\n        $bytes = self::strlen($message);\n\n        /*\n        j0 = ctx->input[0];\n        j1 = ctx->input[1];\n        j2 = ctx->input[2];\n        j3 = ctx->input[3];\n        j4 = ctx->input[4];\n        j5 = ctx->input[5];\n        j6 = ctx->input[6];\n        j7 = ctx->input[7];\n        j8 = ctx->input[8];\n        j9 = ctx->input[9];\n        j10 = ctx->input[10];\n        j11 = ctx->input[11];\n        j12 = ctx->input[12];\n        j13 = ctx->input[13];\n        j14 = ctx->input[14];\n        j15 = ctx->input[15];\n        */\n        $j0  = (int) $ctx[0];\n        $j1  = (int) $ctx[1];\n        $j2  = (int) $ctx[2];\n        $j3  = (int) $ctx[3];\n        $j4  = (int) $ctx[4];\n        $j5  = (int) $ctx[5];\n        $j6  = (int) $ctx[6];\n        $j7  = (int) $ctx[7];\n        $j8  = (int) $ctx[8];\n        $j9  = (int) $ctx[9];\n        $j10 = (int) $ctx[10];\n        $j11 = (int) $ctx[11];\n        $j12 = (int) $ctx[12];\n        $j13 = (int) $ctx[13];\n        $j14 = (int) $ctx[14];\n        $j15 = (int) $ctx[15];\n\n        $c = '';\n        for (;;) {\n            if ($bytes < 64) {\n                $message .= str_repeat(\"\\x00\", 64 - $bytes);\n            }\n\n            $x0 =  (int) $j0;\n            $x1 =  (int) $j1;\n            $x2 =  (int) $j2;\n            $x3 =  (int) $j3;\n            $x4 =  (int) $j4;\n            $x5 =  (int) $j5;\n            $x6 =  (int) $j6;\n            $x7 =  (int) $j7;\n            $x8 =  (int) $j8;\n            $x9 =  (int) $j9;\n            $x10 = (int) $j10;\n            $x11 = (int) $j11;\n            $x12 = (int) $j12;\n            $x13 = (int) $j13;\n            $x14 = (int) $j14;\n            $x15 = (int) $j15;\n\n            # for (i = 20; i > 0; i -= 2) {\n            for ($i = 20; $i > 0; $i -= 2) {\n                # QUARTERROUND( x0,  x4,  x8,  x12)\n                list($x0, $x4, $x8, $x12) = self::quarterRound($x0, $x4, $x8, $x12);\n\n                # QUARTERROUND( x1,  x5,  x9,  x13)\n                list($x1, $x5, $x9, $x13) = self::quarterRound($x1, $x5, $x9, $x13);\n\n                # QUARTERROUND( x2,  x6,  x10,  x14)\n                list($x2, $x6, $x10, $x14) = self::quarterRound($x2, $x6, $x10, $x14);\n\n                # QUARTERROUND( x3,  x7,  x11,  x15)\n                list($x3, $x7, $x11, $x15) = self::quarterRound($x3, $x7, $x11, $x15);\n\n                # QUARTERROUND( x0,  x5,  x10,  x15)\n                list($x0, $x5, $x10, $x15) = self::quarterRound($x0, $x5, $x10, $x15);\n\n                # QUARTERROUND( x1,  x6,  x11,  x12)\n                list($x1, $x6, $x11, $x12) = self::quarterRound($x1, $x6, $x11, $x12);\n\n                # QUARTERROUND( x2,  x7,  x8,  x13)\n                list($x2, $x7, $x8, $x13) = self::quarterRound($x2, $x7, $x8, $x13);\n\n                # QUARTERROUND( x3,  x4,  x9,  x14)\n                list($x3, $x4, $x9, $x14) = self::quarterRound($x3, $x4, $x9, $x14);\n            }\n            /*\n            x0 = PLUS(x0, j0);\n            x1 = PLUS(x1, j1);\n            x2 = PLUS(x2, j2);\n            x3 = PLUS(x3, j3);\n            x4 = PLUS(x4, j4);\n            x5 = PLUS(x5, j5);\n            x6 = PLUS(x6, j6);\n            x7 = PLUS(x7, j7);\n            x8 = PLUS(x8, j8);\n            x9 = PLUS(x9, j9);\n            x10 = PLUS(x10, j10);\n            x11 = PLUS(x11, j11);\n            x12 = PLUS(x12, j12);\n            x13 = PLUS(x13, j13);\n            x14 = PLUS(x14, j14);\n            x15 = PLUS(x15, j15);\n            */\n            /** @var int $x0 */\n            $x0  = ($x0 & 0xffffffff) + $j0;\n            /** @var int $x1 */\n            $x1  = ($x1 & 0xffffffff) + $j1;\n            /** @var int $x2 */\n            $x2  = ($x2 & 0xffffffff) + $j2;\n            /** @var int $x3 */\n            $x3  = ($x3 & 0xffffffff) + $j3;\n            /** @var int $x4 */\n            $x4  = ($x4 & 0xffffffff) + $j4;\n            /** @var int $x5 */\n            $x5  = ($x5 & 0xffffffff) + $j5;\n            /** @var int $x6 */\n            $x6  = ($x6 & 0xffffffff) + $j6;\n            /** @var int $x7 */\n            $x7  = ($x7 & 0xffffffff) + $j7;\n            /** @var int $x8 */\n            $x8  = ($x8 & 0xffffffff) + $j8;\n            /** @var int $x9 */\n            $x9  = ($x9 & 0xffffffff) + $j9;\n            /** @var int $x10 */\n            $x10 = ($x10 & 0xffffffff) + $j10;\n            /** @var int $x11 */\n            $x11 = ($x11 & 0xffffffff) + $j11;\n            /** @var int $x12 */\n            $x12 = ($x12 & 0xffffffff) + $j12;\n            /** @var int $x13 */\n            $x13 = ($x13 & 0xffffffff) + $j13;\n            /** @var int $x14 */\n            $x14 = ($x14 & 0xffffffff) + $j14;\n            /** @var int $x15 */\n            $x15 = ($x15 & 0xffffffff) + $j15;\n\n            /*\n            x0 = XOR(x0, LOAD32_LE(m + 0));\n            x1 = XOR(x1, LOAD32_LE(m + 4));\n            x2 = XOR(x2, LOAD32_LE(m + 8));\n            x3 = XOR(x3, LOAD32_LE(m + 12));\n            x4 = XOR(x4, LOAD32_LE(m + 16));\n            x5 = XOR(x5, LOAD32_LE(m + 20));\n            x6 = XOR(x6, LOAD32_LE(m + 24));\n            x7 = XOR(x7, LOAD32_LE(m + 28));\n            x8 = XOR(x8, LOAD32_LE(m + 32));\n            x9 = XOR(x9, LOAD32_LE(m + 36));\n            x10 = XOR(x10, LOAD32_LE(m + 40));\n            x11 = XOR(x11, LOAD32_LE(m + 44));\n            x12 = XOR(x12, LOAD32_LE(m + 48));\n            x13 = XOR(x13, LOAD32_LE(m + 52));\n            x14 = XOR(x14, LOAD32_LE(m + 56));\n            x15 = XOR(x15, LOAD32_LE(m + 60));\n            */\n            $x0  ^= self::load_4(self::substr($message, 0, 4));\n            $x1  ^= self::load_4(self::substr($message, 4, 4));\n            $x2  ^= self::load_4(self::substr($message, 8, 4));\n            $x3  ^= self::load_4(self::substr($message, 12, 4));\n            $x4  ^= self::load_4(self::substr($message, 16, 4));\n            $x5  ^= self::load_4(self::substr($message, 20, 4));\n            $x6  ^= self::load_4(self::substr($message, 24, 4));\n            $x7  ^= self::load_4(self::substr($message, 28, 4));\n            $x8  ^= self::load_4(self::substr($message, 32, 4));\n            $x9  ^= self::load_4(self::substr($message, 36, 4));\n            $x10 ^= self::load_4(self::substr($message, 40, 4));\n            $x11 ^= self::load_4(self::substr($message, 44, 4));\n            $x12 ^= self::load_4(self::substr($message, 48, 4));\n            $x13 ^= self::load_4(self::substr($message, 52, 4));\n            $x14 ^= self::load_4(self::substr($message, 56, 4));\n            $x15 ^= self::load_4(self::substr($message, 60, 4));\n\n            /*\n                j12 = PLUSONE(j12);\n                if (!j12) {\n                    j13 = PLUSONE(j13);\n                }\n             */\n            ++$j12;\n            if ($j12 & 0xf0000000) {\n                throw new SodiumException('Overflow');\n            }\n\n            /*\n            STORE32_LE(c + 0, x0);\n            STORE32_LE(c + 4, x1);\n            STORE32_LE(c + 8, x2);\n            STORE32_LE(c + 12, x3);\n            STORE32_LE(c + 16, x4);\n            STORE32_LE(c + 20, x5);\n            STORE32_LE(c + 24, x6);\n            STORE32_LE(c + 28, x7);\n            STORE32_LE(c + 32, x8);\n            STORE32_LE(c + 36, x9);\n            STORE32_LE(c + 40, x10);\n            STORE32_LE(c + 44, x11);\n            STORE32_LE(c + 48, x12);\n            STORE32_LE(c + 52, x13);\n            STORE32_LE(c + 56, x14);\n            STORE32_LE(c + 60, x15);\n            */\n            $block = self::store32_le((int) ($x0  & 0xffffffff)) .\n                 self::store32_le((int) ($x1  & 0xffffffff)) .\n                 self::store32_le((int) ($x2  & 0xffffffff)) .\n                 self::store32_le((int) ($x3  & 0xffffffff)) .\n                 self::store32_le((int) ($x4  & 0xffffffff)) .\n                 self::store32_le((int) ($x5  & 0xffffffff)) .\n                 self::store32_le((int) ($x6  & 0xffffffff)) .\n                 self::store32_le((int) ($x7  & 0xffffffff)) .\n                 self::store32_le((int) ($x8  & 0xffffffff)) .\n                 self::store32_le((int) ($x9  & 0xffffffff)) .\n                 self::store32_le((int) ($x10 & 0xffffffff)) .\n                 self::store32_le((int) ($x11 & 0xffffffff)) .\n                 self::store32_le((int) ($x12 & 0xffffffff)) .\n                 self::store32_le((int) ($x13 & 0xffffffff)) .\n                 self::store32_le((int) ($x14 & 0xffffffff)) .\n                 self::store32_le((int) ($x15 & 0xffffffff));\n\n            /* Partial block */\n            if ($bytes < 64) {\n                $c .= self::substr($block, 0, $bytes);\n                break;\n            }\n\n            /* Full block */\n            $c .= $block;\n            $bytes -= 64;\n            if ($bytes <= 0) {\n                break;\n            }\n            $message = self::substr($message, 64);\n        }\n        /* end for(;;) loop */\n\n        $ctx[12] = $j12;\n        $ctx[13] = $j13;\n        return $c;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $len\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function stream($len = 64, $nonce = '', $key = '')\n    {\n        return self::encryptBytes(\n            new ParagonIE_Sodium_Core_ChaCha20_Ctx($key, $nonce),\n            str_repeat(\"\\x00\", $len)\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $len\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ietfStream($len, $nonce = '', $key = '')\n    {\n        return self::encryptBytes(\n            new ParagonIE_Sodium_Core_ChaCha20_IetfCtx($key, $nonce),\n            str_repeat(\"\\x00\", $len)\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @param string $ic\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ietfStreamXorIc($message, $nonce = '', $key = '', $ic = '')\n    {\n        return self::encryptBytes(\n            new ParagonIE_Sodium_Core_ChaCha20_IetfCtx($key, $nonce, $ic),\n            $message\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @param string $ic\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function streamXorIc($message, $nonce = '', $key = '', $ic = '')\n    {\n        return self::encryptBytes(\n            new ParagonIE_Sodium_Core_ChaCha20_Ctx($key, $nonce, $ic),\n            $message\n        );\n    }\n}\n", "num_lines": 396}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_Curve25519', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_Curve25519\n *\n * Implements Curve25519 core functions\n *\n * Based on the ref10 curve25519 code provided by libsodium\n *\n * @ref https://github.com/jedisct1/libsodium/blob/master/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c\n */\nabstract class ParagonIE_Sodium_Core_Curve25519 extends ParagonIE_Sodium_Core_Curve25519_H\n{\n    /**\n     * Get a field element of size 10 with a value of 0\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @return ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public static function fe_0()\n    {\n        return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(\n            array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\n        );\n    }\n\n    /**\n     * Get a field element of size 10 with a value of 1\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @return ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public static function fe_1()\n    {\n        return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(\n            array(1, 0, 0, 0, 0, 0, 0, 0, 0, 0)\n        );\n    }\n\n    /**\n     * Add two field elements.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $f\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $g\n     * @return ParagonIE_Sodium_Core_Curve25519_Fe\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedOperand\n     */\n    public static function fe_add(\n        ParagonIE_Sodium_Core_Curve25519_Fe $f,\n        ParagonIE_Sodium_Core_Curve25519_Fe $g\n    ) {\n        /** @var array<int, int> $arr */\n        $arr = array();\n        for ($i = 0; $i < 10; ++$i) {\n            $arr[$i] = (int) ($f[$i] + $g[$i]);\n        }\n        return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($arr);\n    }\n\n    /**\n     * Constant-time conditional move.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $f\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $g\n     * @param int $b\n     * @return ParagonIE_Sodium_Core_Curve25519_Fe\n     * @psalm-suppress MixedAssignment\n     */\n    public static function fe_cmov(\n        ParagonIE_Sodium_Core_Curve25519_Fe $f,\n        ParagonIE_Sodium_Core_Curve25519_Fe $g,\n        $b = 0\n    ) {\n        /** @var array<int, int> $h */\n        $h = array();\n        $b *= -1;\n        for ($i = 0; $i < 10; ++$i) {\n            /** @var int $x */\n            $x = (($f[$i] ^ $g[$i]) & $b);\n            $h[$i] = (int) ((int) ($f[$i]) ^ $x);\n        }\n        return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($h);\n    }\n\n    /**\n     * Create a copy of a field element.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $f\n     * @return ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public static function fe_copy(ParagonIE_Sodium_Core_Curve25519_Fe $f)\n    {\n        $h = clone $f;\n        return $h;\n    }\n\n    /**\n     * Give: 32-byte string.\n     * Receive: A field element object to use for internal calculations.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $s\n     * @return ParagonIE_Sodium_Core_Curve25519_Fe\n     * @throws RangeException\n     * @throws TypeError\n     */\n    public static function fe_frombytes($s)\n    {\n        if (self::strlen($s) !== 32) {\n            throw new RangeException('Expected a 32-byte string.');\n        }\n        /** @var int $h0 */\n        $h0 = self::load_4($s);\n        /** @var int $h1 */\n        $h1 = self::load_3(self::substr($s, 4, 3)) << 6;\n        /** @var int $h2 */\n        $h2 = self::load_3(self::substr($s, 7, 3)) << 5;\n        /** @var int $h3 */\n        $h3 = self::load_3(self::substr($s, 10, 3)) << 3;\n        /** @var int $h4 */\n        $h4 = self::load_3(self::substr($s, 13, 3)) << 2;\n        /** @var int $h5 */\n        $h5 = self::load_4(self::substr($s, 16, 4));\n        /** @var int $h6 */\n        $h6 = self::load_3(self::substr($s, 20, 3)) << 7;\n        /** @var int $h7 */\n        $h7 = self::load_3(self::substr($s, 23, 3)) << 5;\n        /** @var int $h8 */\n        $h8 = self::load_3(self::substr($s, 26, 3)) << 4;\n        /** @var int $h9 */\n        $h9 = (self::load_3(self::substr($s, 29, 3)) & 8388607) << 2;\n\n        /** @var int $carry9 */\n        $carry9 = ($h9 + (1 << 24)) >> 25;\n        $h0 += self::mul($carry9, 19, 5);\n        $h9 -= $carry9 << 25;\n        /** @var int $carry1 */\n        $carry1 = ($h1 + (1 << 24)) >> 25;\n        $h2 += $carry1;\n        $h1 -= $carry1 << 25;\n        /** @var int $carry3 */\n        $carry3 = ($h3 + (1 << 24)) >> 25;\n        $h4 += $carry3;\n        $h3 -= $carry3 << 25;\n        /** @var int $carry5 */\n        $carry5 = ($h5 + (1 << 24)) >> 25;\n        $h6 += $carry5;\n        $h5 -= $carry5 << 25;\n        /** @var int $carry7 */\n        $carry7 = ($h7 + (1 << 24)) >> 25;\n        $h8 += $carry7;\n        $h7 -= $carry7 << 25;\n\n        /** @var int $carry0 */\n        $carry0 = ($h0 + (1 << 25)) >> 26;\n        $h1 += $carry0;\n        $h0 -= $carry0 << 26;\n        /** @var int $carry2 */\n        $carry2 = ($h2 + (1 << 25)) >> 26;\n        $h3 += $carry2;\n        $h2 -= $carry2 << 26;\n        /** @var int $carry4 */\n        $carry4 = ($h4 + (1 << 25)) >> 26;\n        $h5 += $carry4;\n        $h4 -= $carry4 << 26;\n        /** @var int $carry6 */\n        $carry6 = ($h6 + (1 << 25)) >> 26;\n        $h7 += $carry6;\n        $h6 -= $carry6 << 26;\n        /** @var int $carry8 */\n        $carry8 = ($h8 + (1 << 25)) >> 26;\n        $h9 += $carry8;\n        $h8 -= $carry8 << 26;\n\n        return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(\n            array(\n                (int) $h0,\n                (int) $h1,\n                (int) $h2,\n                (int) $h3,\n                (int) $h4,\n                (int) $h5,\n                (int) $h6,\n                (int) $h7,\n                (int) $h8,\n                (int) $h9\n            )\n        );\n    }\n\n    /**\n     * Convert a field element to a byte string.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $h\n     * @return string\n     */\n    public static function fe_tobytes(ParagonIE_Sodium_Core_Curve25519_Fe $h)\n    {\n        /** @var int $h0 */\n        $h0 = (int) $h[0];\n        /** @var int $h1 */\n        $h1 = (int) $h[1];\n        /** @var int $h2 */\n        $h2 = (int) $h[2];\n        /** @var int $h3 */\n        $h3 = (int) $h[3];\n        /** @var int $h4 */\n        $h4 = (int) $h[4];\n        /** @var int $h5 */\n        $h5 = (int) $h[5];\n        /** @var int $h6 */\n        $h6 = (int) $h[6];\n        /** @var int $h7 */\n        $h7 = (int) $h[7];\n        /** @var int $h8 */\n        $h8 = (int) $h[8];\n        /** @var int $h9 */\n        $h9 = (int) $h[9];\n\n        /** @var int $q */\n        $q = (self::mul($h9, 19, 5) + (1 << 24)) >> 25;\n        /** @var int $q */\n        $q = ($h0 + $q) >> 26;\n        /** @var int $q */\n        $q = ($h1 + $q) >> 25;\n        /** @var int $q */\n        $q = ($h2 + $q) >> 26;\n        /** @var int $q */\n        $q = ($h3 + $q) >> 25;\n        /** @var int $q */\n        $q = ($h4 + $q) >> 26;\n        /** @var int $q */\n        $q = ($h5 + $q) >> 25;\n        /** @var int $q */\n        $q = ($h6 + $q) >> 26;\n        /** @var int $q */\n        $q = ($h7 + $q) >> 25;\n        /** @var int $q */\n        $q = ($h8 + $q) >> 26;\n        /** @var int $q */\n        $q = ($h9 + $q) >> 25;\n\n        $h0 += self::mul($q, 19, 5);\n\n        /** @var int $carry0 */\n        $carry0 = $h0 >> 26;\n        $h1 += $carry0;\n        $h0 -= $carry0 << 26;\n        /** @var int $carry1 */\n        $carry1 = $h1 >> 25;\n        $h2 += $carry1;\n        $h1 -= $carry1 << 25;\n        /** @var int $carry2 */\n        $carry2 = $h2 >> 26;\n        $h3 += $carry2;\n        $h2 -= $carry2 << 26;\n        /** @var int $carry3 */\n        $carry3 = $h3 >> 25;\n        $h4 += $carry3;\n        $h3 -= $carry3 << 25;\n        /** @var int $carry4 */\n        $carry4 = $h4 >> 26;\n        $h5 += $carry4;\n        $h4 -= $carry4 << 26;\n        /** @var int $carry5 */\n        $carry5 = $h5 >> 25;\n        $h6 += $carry5;\n        $h5 -= $carry5 << 25;\n        /** @var int $carry6 */\n        $carry6 = $h6 >> 26;\n        $h7 += $carry6;\n        $h6 -= $carry6 << 26;\n        /** @var int $carry7 */\n        $carry7 = $h7 >> 25;\n        $h8 += $carry7;\n        $h7 -= $carry7 << 25;\n        /** @var int $carry8 */\n        $carry8 = $h8 >> 26;\n        $h9 += $carry8;\n        $h8 -= $carry8 << 26;\n        /** @var int $carry9 */\n        $carry9 = $h9 >> 25;\n        $h9 -= $carry9 << 25;\n\n        /**\n         * @var array<int, int>\n         */\n        $s = array(\n            (int) (($h0 >> 0) & 0xff),\n            (int) (($h0 >> 8) & 0xff),\n            (int) (($h0 >> 16) & 0xff),\n            (int) ((($h0 >> 24) | ($h1 << 2)) & 0xff),\n            (int) (($h1 >> 6) & 0xff),\n            (int) (($h1 >> 14) & 0xff),\n            (int) ((($h1 >> 22) | ($h2 << 3)) & 0xff),\n            (int) (($h2 >> 5) & 0xff),\n            (int) (($h2 >> 13) & 0xff),\n            (int) ((($h2 >> 21) | ($h3 << 5)) & 0xff),\n            (int) (($h3 >> 3) & 0xff),\n            (int) (($h3 >> 11) & 0xff),\n            (int) ((($h3 >> 19) | ($h4 << 6)) & 0xff),\n            (int) (($h4 >> 2) & 0xff),\n            (int) (($h4 >> 10) & 0xff),\n            (int) (($h4 >> 18) & 0xff),\n            (int) (($h5 >> 0) & 0xff),\n            (int) (($h5 >> 8) & 0xff),\n            (int) (($h5 >> 16) & 0xff),\n            (int) ((($h5 >> 24) | ($h6 << 1)) & 0xff),\n            (int) (($h6 >> 7) & 0xff),\n            (int) (($h6 >> 15) & 0xff),\n            (int) ((($h6 >> 23) | ($h7 << 3)) & 0xff),\n            (int) (($h7 >> 5) & 0xff),\n            (int) (($h7 >> 13) & 0xff),\n            (int) ((($h7 >> 21) | ($h8 << 4)) & 0xff),\n            (int) (($h8 >> 4) & 0xff),\n            (int) (($h8 >> 12) & 0xff),\n            (int) ((($h8 >> 20) | ($h9 << 6)) & 0xff),\n            (int) (($h9 >> 2) & 0xff),\n            (int) (($h9 >> 10) & 0xff),\n            (int) (($h9 >> 18) & 0xff)\n        );\n        return self::intArrayToString($s);\n    }\n\n    /**\n     * Is a field element negative? (1 = yes, 0 = no. Used in calculations.)\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $f\n     * @return int\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fe_isnegative(ParagonIE_Sodium_Core_Curve25519_Fe $f)\n    {\n        $str = self::fe_tobytes($f);\n        return (int) (self::chrToInt($str[0]) & 1);\n    }\n\n    /**\n     * Returns 0 if this field element results in all NUL bytes.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $f\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fe_isnonzero(ParagonIE_Sodium_Core_Curve25519_Fe $f)\n    {\n        static $zero;\n        if ($zero === null) {\n            $zero = str_repeat(\"\\x00\", 32);\n        }\n        /** @var string $zero */\n        /** @var string $str */\n        $str = self::fe_tobytes($f);\n        return !self::verify_32($str, (string) $zero);\n    }\n\n    /**\n     * Multiply two field elements\n     *\n     * h = f * g\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @security Is multiplication a source of timing leaks? If so, can we do\n     *           anything to prevent that from happening?\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $f\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $g\n     * @return ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public static function fe_mul(\n        ParagonIE_Sodium_Core_Curve25519_Fe $f,\n        ParagonIE_Sodium_Core_Curve25519_Fe $g\n    ) {\n        /** @var int $f0 */\n        $f0 = $f[0];\n        /** @var int $f1 */\n        $f1 = $f[1];\n        /** @var int $f2 */\n        $f2 = $f[2];\n        /** @var int $f3 */\n        $f3 = $f[3];\n        /** @var int $f4 */\n        $f4 = $f[4];\n        /** @var int $f5 */\n        $f5 = $f[5];\n        /** @var int $f6 */\n        $f6 = $f[6];\n        /** @var int $f7 */\n        $f7 = $f[7];\n        /** @var int $f8 */\n        $f8 = $f[8];\n        /** @var int $f9 */\n        $f9 = $f[9];\n        /** @var int $g0 */\n        $g0 = $g[0];\n        /** @var int $g1 */\n        $g1 = $g[1];\n        /** @var int $g2 */\n        $g2 = $g[2];\n        /** @var int $g3 */\n        $g3 = $g[3];\n        /** @var int $g4 */\n        $g4 = $g[4];\n        /** @var int $g5 */\n        $g5 = $g[5];\n        /** @var int $g6 */\n        $g6 = $g[6];\n        /** @var int $g7 */\n        $g7 = $g[7];\n        /** @var int $g8 */\n        $g8 = $g[8];\n        /** @var int $g9 */\n        $g9 = $g[9];\n        $g1_19 = self::mul($g1, 19, 5);\n        $g2_19 = self::mul($g2, 19, 5);\n        $g3_19 = self::mul($g3, 19, 5);\n        $g4_19 = self::mul($g4, 19, 5);\n        $g5_19 = self::mul($g5, 19, 5);\n        $g6_19 = self::mul($g6, 19, 5);\n        $g7_19 = self::mul($g7, 19, 5);\n        $g8_19 = self::mul($g8, 19, 5);\n        $g9_19 = self::mul($g9, 19, 5);\n        /** @var int $f1_2 */\n        $f1_2 = $f1 << 1;\n        /** @var int $f3_2 */\n        $f3_2 = $f3 << 1;\n        /** @var int $f5_2 */\n        $f5_2 = $f5 << 1;\n        /** @var int $f7_2 */\n        $f7_2 = $f7 << 1;\n        /** @var int $f9_2 */\n        $f9_2 = $f9 << 1;\n        $f0g0    = self::mul($f0,    $g0, 26);\n        $f0g1    = self::mul($f0,    $g1, 25);\n        $f0g2    = self::mul($f0,    $g2, 26);\n        $f0g3    = self::mul($f0,    $g3, 25);\n        $f0g4    = self::mul($f0,    $g4, 26);\n        $f0g5    = self::mul($f0,    $g5, 25);\n        $f0g6    = self::mul($f0,    $g6, 26);\n        $f0g7    = self::mul($f0,    $g7, 25);\n        $f0g8    = self::mul($f0,    $g8, 26);\n        $f0g9    = self::mul($f0,    $g9, 26);\n        $f1g0    = self::mul($f1,    $g0, 26);\n        $f1g1_2  = self::mul($f1_2,  $g1, 25);\n        $f1g2    = self::mul($f1,    $g2, 26);\n        $f1g3_2  = self::mul($f1_2,  $g3, 25);\n        $f1g4    = self::mul($f1,    $g4, 26);\n        $f1g5_2  = self::mul($f1_2,  $g5, 25);\n        $f1g6    = self::mul($f1,    $g6, 26);\n        $f1g7_2  = self::mul($f1_2,  $g7, 25);\n        $f1g8    = self::mul($f1,    $g8, 26);\n        $f1g9_38 = self::mul($g9_19, $f1_2, 26);\n        $f2g0    = self::mul($f2,    $g0, 26);\n        $f2g1    = self::mul($f2,    $g1, 25);\n        $f2g2    = self::mul($f2,    $g2, 26);\n        $f2g3    = self::mul($f2,    $g3, 25);\n        $f2g4    = self::mul($f2,    $g4, 26);\n        $f2g5    = self::mul($f2,    $g5, 25);\n        $f2g6    = self::mul($f2,    $g6, 26);\n        $f2g7    = self::mul($f2,    $g7, 25);\n        $f2g8_19 = self::mul($g8_19, $f2, 26);\n        $f2g9_19 = self::mul($g9_19, $f2, 26);\n        $f3g0    = self::mul($f3,    $g0, 26);\n        $f3g1_2  = self::mul($f3_2,  $g1, 25);\n        $f3g2    = self::mul($f3,    $g2, 26);\n        $f3g3_2  = self::mul($f3_2,  $g3, 25);\n        $f3g4    = self::mul($f3,    $g4, 26);\n        $f3g5_2  = self::mul($f3_2,  $g5, 25);\n        $f3g6    = self::mul($f3,    $g6, 26);\n        $f3g7_38 = self::mul($g7_19, $f3_2, 26);\n        $f3g8_19 = self::mul($g8_19, $f3, 25);\n        $f3g9_38 = self::mul($g9_19, $f3_2, 26);\n        $f4g0    = self::mul($f4,    $g0, 26);\n        $f4g1    = self::mul($f4,    $g1, 25);\n        $f4g2    = self::mul($f4,    $g2, 26);\n        $f4g3    = self::mul($f4,    $g3, 25);\n        $f4g4    = self::mul($f4,    $g4, 26);\n        $f4g5    = self::mul($f4,    $g5, 25);\n        $f4g6_19 = self::mul($g6_19, $f4, 26);\n        $f4g7_19 = self::mul($g7_19, $f4, 26);\n        $f4g8_19 = self::mul($g8_19, $f4, 26);\n        $f4g9_19 = self::mul($g9_19, $f4, 26);\n        $f5g0    = self::mul($f5,    $g0, 26);\n        $f5g1_2  = self::mul($f5_2,  $g1, 25);\n        $f5g2    = self::mul($f5,    $g2, 26);\n        $f5g3_2  = self::mul($f5_2,  $g3, 25);\n        $f5g4    = self::mul($f5,    $g4, 26);\n        $f5g5_38 = self::mul($g5_19, $f5_2, 26);\n        $f5g6_19 = self::mul($g6_19, $f5, 25);\n        $f5g7_38 = self::mul($g7_19, $f5_2, 26);\n        $f5g8_19 = self::mul($g8_19, $f5, 25);\n        $f5g9_38 = self::mul($g9_19, $f5_2, 26);\n        $f6g0    = self::mul($f6,    $g0, 26);\n        $f6g1    = self::mul($f6,    $g1, 25);\n        $f6g2    = self::mul($f6,    $g2, 26);\n        $f6g3    = self::mul($f6,    $g3, 25);\n        $f6g4_19 = self::mul($g4_19, $f6, 26);\n        $f6g5_19 = self::mul($g5_19, $f6, 26);\n        $f6g6_19 = self::mul($g6_19, $f6, 26);\n        $f6g7_19 = self::mul($g7_19, $f6, 26);\n        $f6g8_19 = self::mul($g8_19, $f6, 26);\n        $f6g9_19 = self::mul($g9_19, $f6, 26);\n        $f7g0    = self::mul($f7,    $g0, 26);\n        $f7g1_2  = self::mul($f7_2,  $g1, 25);\n        $f7g2    = self::mul($f7,    $g2, 26);\n        $f7g3_38 = self::mul($g3_19, $f7_2, 26);\n        $f7g4_19 = self::mul($g4_19, $f7, 26);\n        $f7g5_38 = self::mul($g5_19, $f7_2, 26);\n        $f7g6_19 = self::mul($g6_19, $f7, 25);\n        $f7g7_38 = self::mul($g7_19, $f7_2, 26);\n        $f7g8_19 = self::mul($g8_19, $f7, 25);\n        $f7g9_38 = self::mul($g9_19,$f7_2, 26);\n        $f8g0    = self::mul($f8,    $g0, 26);\n        $f8g1    = self::mul($f8,    $g1, 25);\n        $f8g2_19 = self::mul($g2_19, $f8, 26);\n        $f8g3_19 = self::mul($g3_19, $f8, 26);\n        $f8g4_19 = self::mul($g4_19, $f8, 26);\n        $f8g5_19 = self::mul($g5_19, $f8, 26);\n        $f8g6_19 = self::mul($g6_19, $f8, 26);\n        $f8g7_19 = self::mul($g7_19, $f8, 26);\n        $f8g8_19 = self::mul($g8_19, $f8, 26);\n        $f8g9_19 = self::mul($g9_19, $f8, 26);\n        $f9g0    = self::mul($f9,    $g0, 26);\n        $f9g1_38 = self::mul($g1_19, $f9_2, 26);\n        $f9g2_19 = self::mul($g2_19, $f9, 25);\n        $f9g3_38 = self::mul($g3_19, $f9_2, 26);\n        $f9g4_19 = self::mul($g4_19, $f9, 25);\n        $f9g5_38 = self::mul($g5_19, $f9_2, 26);\n        $f9g6_19 = self::mul($g6_19, $f9, 25);\n        $f9g7_38 = self::mul($g7_19, $f9_2, 26);\n        $f9g8_19 = self::mul($g8_19, $f9, 25);\n        $f9g9_38 = self::mul($g9_19, $f9_2, 26);\n        $h0 = $f0g0 + $f1g9_38 + $f2g8_19 + $f3g7_38 + $f4g6_19 + $f5g5_38 + $f6g4_19 + $f7g3_38 + $f8g2_19 + $f9g1_38;\n        $h1 = $f0g1 + $f1g0    + $f2g9_19 + $f3g8_19 + $f4g7_19 + $f5g6_19 + $f6g5_19 + $f7g4_19 + $f8g3_19 + $f9g2_19;\n        $h2 = $f0g2 + $f1g1_2  + $f2g0    + $f3g9_38 + $f4g8_19 + $f5g7_38 + $f6g6_19 + $f7g5_38 + $f8g4_19 + $f9g3_38;\n        $h3 = $f0g3 + $f1g2    + $f2g1    + $f3g0    + $f4g9_19 + $f5g8_19 + $f6g7_19 + $f7g6_19 + $f8g5_19 + $f9g4_19;\n        $h4 = $f0g4 + $f1g3_2  + $f2g2    + $f3g1_2  + $f4g0    + $f5g9_38 + $f6g8_19 + $f7g7_38 + $f8g6_19 + $f9g5_38;\n        $h5 = $f0g5 + $f1g4    + $f2g3    + $f3g2    + $f4g1    + $f5g0    + $f6g9_19 + $f7g8_19 + $f8g7_19 + $f9g6_19;\n        $h6 = $f0g6 + $f1g5_2  + $f2g4    + $f3g3_2  + $f4g2    + $f5g1_2  + $f6g0    + $f7g9_38 + $f8g8_19 + $f9g7_38;\n        $h7 = $f0g7 + $f1g6    + $f2g5    + $f3g4    + $f4g3    + $f5g2    + $f6g1    + $f7g0    + $f8g9_19 + $f9g8_19;\n        $h8 = $f0g8 + $f1g7_2  + $f2g6    + $f3g5_2  + $f4g4    + $f5g3_2  + $f6g2    + $f7g1_2  + $f8g0    + $f9g9_38;\n        $h9 = $f0g9 + $f1g8    + $f2g7    + $f3g6    + $f4g5    + $f5g4    + $f6g3    + $f7g2    + $f8g1    + $f9g0   ;\n\n        /** @var int $carry0 */\n        $carry0 = ($h0 + (1 << 25)) >> 26;\n        $h1 += $carry0;\n        $h0 -= $carry0 << 26;\n        /** @var int $carry4 */\n        $carry4 = ($h4 + (1 << 25)) >> 26;\n        $h5 += $carry4;\n        $h4 -= $carry4 << 26;\n\n        /** @var int $carry1 */\n        $carry1 = ($h1 + (1 << 24)) >> 25;\n        $h2 += $carry1;\n        $h1 -= $carry1 << 25;\n        /** @var int $carry5 */\n        $carry5 = ($h5 + (1 << 24)) >> 25;\n        $h6 += $carry5;\n        $h5 -= $carry5 << 25;\n\n        /** @var int $carry2 */\n        $carry2 = ($h2 + (1 << 25)) >> 26;\n        $h3 += $carry2;\n        $h2 -= $carry2 << 26;\n        /** @var int $carry6 */\n        $carry6 = ($h6 + (1 << 25)) >> 26;\n        $h7 += $carry6;\n        $h6 -= $carry6 << 26;\n\n        /** @var int $carry3 */\n        $carry3 = ($h3 + (1 << 24)) >> 25;\n        $h4 += $carry3;\n        $h3 -= $carry3 << 25;\n        /** @var int $carry7 */\n        $carry7 = ($h7 + (1 << 24)) >> 25;\n        $h8 += $carry7;\n        $h7 -= $carry7 << 25;\n\n        /** @var int $carry4 */\n        $carry4 = ($h4 + (1 << 25)) >> 26;\n        $h5 += $carry4;\n        $h4 -= $carry4 << 26;\n        /** @var int $carry8 */\n        $carry8 = ($h8 + (1 << 25)) >> 26;\n        $h9 += $carry8;\n        $h8 -= $carry8 << 26;\n\n        /** @var int $carry9 */\n        $carry9 = ($h9 + (1 << 24)) >> 25;\n        $h0 += self::mul($carry9, 19, 5);\n        $h9 -= $carry9 << 25;\n\n        /** @var int $carry0 */\n        $carry0 = ($h0 + (1 << 25)) >> 26;\n        $h1 += $carry0;\n        $h0 -= $carry0 << 26;\n\n        return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(\n            array(\n                (int) $h0,\n                (int) $h1,\n                (int) $h2,\n                (int) $h3,\n                (int) $h4,\n                (int) $h5,\n                (int) $h6,\n                (int) $h7,\n                (int) $h8,\n                (int) $h9\n            )\n        );\n    }\n\n    /**\n     * Get the negative values for each piece of the field element.\n     *\n     * h = -f\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $f\n     * @return ParagonIE_Sodium_Core_Curve25519_Fe\n     * @psalm-suppress MixedAssignment\n     */\n    public static function fe_neg(ParagonIE_Sodium_Core_Curve25519_Fe $f)\n    {\n        $h = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        for ($i = 0; $i < 10; ++$i) {\n            $h[$i] = -$f[$i];\n        }\n        return $h;\n    }\n\n    /**\n     * Square a field element\n     *\n     * h = f * f\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $f\n     * @return ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public static function fe_sq(ParagonIE_Sodium_Core_Curve25519_Fe $f)\n    {\n        $f0 = (int) $f[0];\n        $f1 = (int) $f[1];\n        $f2 = (int) $f[2];\n        $f3 = (int) $f[3];\n        $f4 = (int) $f[4];\n        $f5 = (int) $f[5];\n        $f6 = (int) $f[6];\n        $f7 = (int) $f[7];\n        $f8 = (int) $f[8];\n        $f9 = (int) $f[9];\n\n        /** @var int $f0_2 */\n        $f0_2 = $f0 << 1;\n        /** @var int $f1_2 */\n        $f1_2 = $f1 << 1;\n        /** @var int $f2_2 */\n        $f2_2 = $f2 << 1;\n        /** @var int $f3_2 */\n        $f3_2 = $f3 << 1;\n        /** @var int $f4_2 */\n        $f4_2 = $f4 << 1;\n        /** @var int $f5_2 */\n        $f5_2 = $f5 << 1;\n        /** @var int $f6_2 */\n        $f6_2 = $f6 << 1;\n        /** @var int $f7_2 */\n        $f7_2 = $f7 << 1;\n        $f5_38 = self::mul($f5, 38, 6);\n        $f6_19 = self::mul($f6, 19, 5);\n        $f7_38 = self::mul($f7, 38, 6);\n        $f8_19 = self::mul($f8, 19, 5);\n        $f9_38 = self::mul($f9, 38, 6);\n        $f0f0    = self::mul($f0,    $f0,    25);\n        $f0f1_2  = self::mul($f0_2,  $f1,    24);\n        $f0f2_2  = self::mul($f0_2,  $f2,    25);\n        $f0f3_2  = self::mul($f0_2,  $f3,    24);\n        $f0f4_2  = self::mul($f0_2,  $f4,    25);\n        $f0f5_2  = self::mul($f0_2,  $f5,    25);\n        $f0f6_2  = self::mul($f0_2,  $f6,    25);\n        $f0f7_2  = self::mul($f0_2,  $f7,    24);\n        $f0f8_2  = self::mul($f0_2,  $f8,    25);\n        $f0f9_2  = self::mul($f0_2,  $f9,    25);\n        $f1f1_2  = self::mul($f1_2,  $f1,    24);\n        $f1f2_2  = self::mul($f1_2,  $f2,    25);\n        $f1f3_4  = self::mul($f1_2,  $f3_2,  25);\n        $f1f4_2  = self::mul($f1_2,  $f4,    25);\n        $f1f5_4  = self::mul($f1_2,  $f5_2,  26);\n        $f1f6_2  = self::mul($f1_2,  $f6,    25);\n        $f1f7_4  = self::mul($f1_2,  $f7_2,  25);\n        $f1f8_2  = self::mul($f1_2,  $f8,    25);\n        $f1f9_76 = self::mul($f9_38, $f1_2,  25);\n        $f2f2    = self::mul($f2,    $f2,    25);\n        $f2f3_2  = self::mul($f2_2,  $f3,    24);\n        $f2f4_2  = self::mul($f2_2,  $f4,    25);\n        $f2f5_2  = self::mul($f2_2,  $f5,    25);\n        $f2f6_2  = self::mul($f2_2,  $f6,    25);\n        $f2f7_2  = self::mul($f2_2,  $f7,    24);\n        $f2f8_38 = self::mul($f8_19, $f2_2,  26);\n        $f2f9_38 = self::mul($f9_38, $f2,    25);\n        $f3f3_2  = self::mul($f3_2,  $f3,    24);\n        $f3f4_2  = self::mul($f3_2,  $f4,    25);\n        $f3f5_4  = self::mul($f3_2,  $f5_2,  26);\n        $f3f6_2  = self::mul($f3_2,  $f6,    25);\n        $f3f7_76 = self::mul($f7_38, $f3_2,  25);\n        $f3f8_38 = self::mul($f8_19, $f3_2,  25);\n        $f3f9_76 = self::mul($f9_38, $f3_2,  25);\n        $f4f4    = self::mul($f4,    $f4,    25);\n        $f4f5_2  = self::mul($f4_2,  $f5,    25);\n        $f4f6_38 = self::mul($f6_19, $f4_2,  26);\n        $f4f7_38 = self::mul($f7_38, $f4,    25);\n        $f4f8_38 = self::mul($f8_19, $f4_2,  26);\n        $f4f9_38 = self::mul($f9_38, $f4,    25);\n        $f5f5_38 = self::mul($f5_38, $f5,    25);\n        $f5f6_38 = self::mul($f6_19, $f5_2,  26);\n        $f5f7_76 = self::mul($f7_38, $f5_2,  26);\n        $f5f8_38 = self::mul($f8_19, $f5_2,  26);\n        $f5f9_76 = self::mul($f9_38, $f5_2,  26);\n        $f6f6_19 = self::mul($f6_19, $f6,    25);\n        $f6f7_38 = self::mul($f7_38, $f6,    25);\n        $f6f8_38 = self::mul($f8_19, $f6_2,  26);\n        $f6f9_38 = self::mul($f9_38, $f6,    25);\n        $f7f7_38 = self::mul($f7_38, $f7,    24);\n        $f7f8_38 = self::mul($f8_19, $f7_2,  25);\n        $f7f9_76 = self::mul($f9_38, $f7_2,  25);\n        $f8f8_19 = self::mul($f8_19, $f8,    25);\n        $f8f9_38 = self::mul($f9_38, $f8,    25);\n        $f9f9_38 = self::mul($f9_38, $f9,    25);\n        $h0 = $f0f0   + $f1f9_76 + $f2f8_38 + $f3f7_76 + $f4f6_38 + $f5f5_38;\n        $h1 = $f0f1_2 + $f2f9_38 + $f3f8_38 + $f4f7_38 + $f5f6_38;\n        $h2 = $f0f2_2 + $f1f1_2  + $f3f9_76 + $f4f8_38 + $f5f7_76 + $f6f6_19;\n        $h3 = $f0f3_2 + $f1f2_2  + $f4f9_38 + $f5f8_38 + $f6f7_38;\n        $h4 = $f0f4_2 + $f1f3_4  + $f2f2    + $f5f9_76 + $f6f8_38 + $f7f7_38;\n        $h5 = $f0f5_2 + $f1f4_2  + $f2f3_2  + $f6f9_38 + $f7f8_38;\n        $h6 = $f0f6_2 + $f1f5_4  + $f2f4_2  + $f3f3_2  + $f7f9_76 + $f8f8_19;\n        $h7 = $f0f7_2 + $f1f6_2  + $f2f5_2  + $f3f4_2  + $f8f9_38;\n        $h8 = $f0f8_2 + $f1f7_4  + $f2f6_2  + $f3f5_4  + $f4f4    + $f9f9_38;\n        $h9 = $f0f9_2 + $f1f8_2  + $f2f7_2  + $f3f6_2  + $f4f5_2;\n\n        /** @var int $carry0 */\n        $carry0 = ($h0 + (1 << 25)) >> 26;\n        $h1 += $carry0;\n        $h0 -= $carry0 << 26;\n        /** @var int $carry4 */\n        $carry4 = ($h4 + (1 << 25)) >> 26;\n        $h5 += $carry4;\n        $h4 -= $carry4 << 26;\n\n        /** @var int $carry1 */\n        $carry1 = ($h1 + (1 << 24)) >> 25;\n        $h2 += $carry1;\n        $h1 -= $carry1 << 25;\n        /** @var int $carry5 */\n        $carry5 = ($h5 + (1 << 24)) >> 25;\n        $h6 += $carry5;\n        $h5 -= $carry5 << 25;\n\n        /** @var int $carry2 */\n        $carry2 = ($h2 + (1 << 25)) >> 26;\n        $h3 += $carry2;\n        $h2 -= $carry2 << 26;\n        /** @var int $carry6 */\n        $carry6 = ($h6 + (1 << 25)) >> 26;\n        $h7 += $carry6;\n        $h6 -= $carry6 << 26;\n\n        /** @var int $carry3 */\n        $carry3 = ($h3 + (1 << 24)) >> 25;\n        $h4 += $carry3;\n        $h3 -= $carry3 << 25;\n        /** @var int $carry7 */\n        $carry7 = ($h7 + (1 << 24)) >> 25;\n        $h8 += $carry7;\n        $h7 -= $carry7 << 25;\n\n        /** @var int $carry4 */\n        $carry4 = ($h4 + (1 << 25)) >> 26;\n        $h5 += $carry4;\n        $h4 -= $carry4 << 26;\n        /** @var int $carry8 */\n        $carry8 = ($h8 + (1 << 25)) >> 26;\n        $h9 += $carry8;\n        $h8 -= $carry8 << 26;\n\n        /** @var int $carry9 */\n        $carry9 = ($h9 + (1 << 24)) >> 25;\n        $h0 += self::mul($carry9, 19, 5);\n        $h9 -= $carry9 << 25;\n\n        /** @var int $carry0 */\n        $carry0 = ($h0 + (1 << 25)) >> 26;\n        $h1 += $carry0;\n        $h0 -= $carry0 << 26;\n\n        return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(\n            array(\n                (int) $h0,\n                (int) $h1,\n                (int) $h2,\n                (int) $h3,\n                (int) $h4,\n                (int) $h5,\n                (int) $h6,\n                (int) $h7,\n                (int) $h8,\n                (int) $h9\n            )\n        );\n    }\n\n\n    /**\n     * Square and double a field element\n     *\n     * h = 2 * f * f\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $f\n     * @return ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public static function fe_sq2(ParagonIE_Sodium_Core_Curve25519_Fe $f)\n    {\n        $f0 = (int) $f[0];\n        $f1 = (int) $f[1];\n        $f2 = (int) $f[2];\n        $f3 = (int) $f[3];\n        $f4 = (int) $f[4];\n        $f5 = (int) $f[5];\n        $f6 = (int) $f[6];\n        $f7 = (int) $f[7];\n        $f8 = (int) $f[8];\n        $f9 = (int) $f[9];\n\n        /** @var int $f0_2 */\n        $f0_2 = $f0 << 1;\n        /** @var int $f1_2 */\n        $f1_2 = $f1 << 1;\n        /** @var int $f2_2 */\n        $f2_2 = $f2 << 1;\n        /** @var int $f3_2 */\n        $f3_2 = $f3 << 1;\n        /** @var int $f4_2 */\n        $f4_2 = $f4 << 1;\n        /** @var int $f5_2 */\n        $f5_2 = $f5 << 1;\n        /** @var int $f6_2 */\n        $f6_2 = $f6 << 1;\n        /** @var int $f7_2 */\n        $f7_2 = $f7 << 1;\n        $f5_38 = self::mul($f5, 38, 6); /* 1.959375*2^30 */\n        $f6_19 = self::mul($f6, 19, 5); /* 1.959375*2^30 */\n        $f7_38 = self::mul($f7, 38, 6); /* 1.959375*2^30 */\n        $f8_19 = self::mul($f8, 19, 5); /* 1.959375*2^30 */\n        $f9_38 = self::mul($f9, 38, 6); /* 1.959375*2^30 */\n        $f0f0 = self::mul($f0, $f0, 24);\n        $f0f1_2 = self::mul($f0_2, $f1, 24);\n        $f0f2_2 = self::mul($f0_2, $f2, 24);\n        $f0f3_2 = self::mul($f0_2, $f3, 24);\n        $f0f4_2 = self::mul($f0_2, $f4, 24);\n        $f0f5_2 = self::mul($f0_2, $f5, 24);\n        $f0f6_2 = self::mul($f0_2, $f6, 24);\n        $f0f7_2 = self::mul($f0_2, $f7, 24);\n        $f0f8_2 = self::mul($f0_2, $f8, 24);\n        $f0f9_2 = self::mul($f0_2, $f9, 24);\n        $f1f1_2 = self::mul($f1_2,  $f1, 24);\n        $f1f2_2 = self::mul($f1_2,  $f2, 24);\n        $f1f3_4 = self::mul($f1_2,  $f3_2, 24);\n        $f1f4_2 = self::mul($f1_2,  $f4, 24);\n        $f1f5_4 = self::mul($f1_2,  $f5_2, 24);\n        $f1f6_2 = self::mul($f1_2,  $f6, 24);\n        $f1f7_4 = self::mul($f1_2,  $f7_2, 24);\n        $f1f8_2 = self::mul($f1_2,  $f8, 24);\n        $f1f9_76 = self::mul($f9_38, $f1_2, 24);\n        $f2f2 = self::mul($f2,  $f2, 24);\n        $f2f3_2 = self::mul($f2_2,  $f3, 24);\n        $f2f4_2 = self::mul($f2_2,  $f4, 24);\n        $f2f5_2 = self::mul($f2_2,  $f5, 24);\n        $f2f6_2 = self::mul($f2_2,  $f6, 24);\n        $f2f7_2 = self::mul($f2_2,  $f7, 24);\n        $f2f8_38 = self::mul($f8_19, $f2_2, 25);\n        $f2f9_38 = self::mul($f9_38, $f2, 24);\n        $f3f3_2 = self::mul($f3_2,  $f3, 24);\n        $f3f4_2 = self::mul($f3_2,  $f4, 24);\n        $f3f5_4 = self::mul($f3_2,  $f5_2, 24);\n        $f3f6_2 = self::mul($f3_2,  $f6, 24);\n        $f3f7_76 = self::mul($f7_38, $f3_2, 24);\n        $f3f8_38 = self::mul($f8_19, $f3_2, 24);\n        $f3f9_76 = self::mul($f9_38, $f3_2, 24);\n        $f4f4 = self::mul($f4,  $f4, 24);\n        $f4f5_2 = self::mul($f4_2,  $f5, 24);\n        $f4f6_38 = self::mul($f6_19, $f4_2, 25);\n        $f4f7_38 = self::mul($f7_38, $f4, 24);\n        $f4f8_38 = self::mul($f8_19, $f4_2, 25);\n        $f4f9_38 = self::mul($f9_38, $f4, 24);\n        $f5f5_38 = self::mul($f5_38, $f5, 24);\n        $f5f6_38 = self::mul($f6_19, $f5_2, 24);\n        $f5f7_76 = self::mul($f7_38, $f5_2, 24);\n        $f5f8_38 = self::mul($f8_19, $f5_2, 24);\n        $f5f9_76 = self::mul($f9_38, $f5_2, 24);\n        $f6f6_19 = self::mul($f6_19, $f6, 24);\n        $f6f7_38 = self::mul($f7_38, $f6, 24);\n        $f6f8_38 = self::mul($f8_19, $f6_2, 25);\n        $f6f9_38 = self::mul($f9_38, $f6, 24);\n        $f7f7_38 = self::mul($f7_38, $f7, 24);\n        $f7f8_38 = self::mul($f8_19, $f7_2, 24);\n        $f7f9_76 = self::mul($f9_38, $f7_2, 24);\n        $f8f8_19 = self::mul($f8_19, $f8, 24);\n        $f8f9_38 = self::mul($f9_38, $f8, 24);\n        $f9f9_38 = self::mul($f9_38, $f9, 24);\n\n        /** @var int $h0 */\n        $h0 = (int) ($f0f0 + $f1f9_76 + $f2f8_38 + $f3f7_76 + $f4f6_38 + $f5f5_38) << 1;\n        /** @var int $h1 */\n        $h1 = (int) ($f0f1_2 + $f2f9_38 + $f3f8_38 + $f4f7_38 + $f5f6_38) << 1;\n        /** @var int $h2 */\n        $h2 = (int) ($f0f2_2 + $f1f1_2  + $f3f9_76 + $f4f8_38 + $f5f7_76 + $f6f6_19) << 1;\n        /** @var int $h3 */\n        $h3 = (int) ($f0f3_2 + $f1f2_2  + $f4f9_38 + $f5f8_38 + $f6f7_38) << 1;\n        /** @var int $h4 */\n        $h4 = (int) ($f0f4_2 + $f1f3_4  + $f2f2    + $f5f9_76 + $f6f8_38 + $f7f7_38) << 1;\n        /** @var int $h5 */\n        $h5 = (int) ($f0f5_2 + $f1f4_2  + $f2f3_2  + $f6f9_38 + $f7f8_38) << 1;\n        /** @var int $h6 */\n        $h6 = (int) ($f0f6_2 + $f1f5_4  + $f2f4_2  + $f3f3_2  + $f7f9_76 + $f8f8_19) << 1;\n        /** @var int $h7 */\n        $h7 = (int) ($f0f7_2 + $f1f6_2  + $f2f5_2  + $f3f4_2  + $f8f9_38) << 1;\n        /** @var int $h8 */\n        $h8 = (int) ($f0f8_2 + $f1f7_4  + $f2f6_2  + $f3f5_4  + $f4f4    + $f9f9_38) << 1;\n        /** @var int $h9 */\n        $h9 = (int) ($f0f9_2 + $f1f8_2  + $f2f7_2  + $f3f6_2  + $f4f5_2) << 1;\n\n        /** @var int $carry0 */\n        $carry0 = ($h0 + (1 << 25)) >> 26;\n        $h1 += $carry0;\n        $h0 -= $carry0 << 26;\n        /** @var int $carry4 */\n        $carry4 = ($h4 + (1 << 25)) >> 26;\n        $h5 += $carry4;\n        $h4 -= $carry4 << 26;\n\n        /** @var int $carry1 */\n        $carry1 = ($h1 + (1 << 24)) >> 25;\n        $h2 += $carry1;\n        $h1 -= $carry1 << 25;\n        /** @var int $carry5 */\n        $carry5 = ($h5 + (1 << 24)) >> 25;\n        $h6 += $carry5;\n        $h5 -= $carry5 << 25;\n\n        /** @var int $carry2 */\n        $carry2 = ($h2 + (1 << 25)) >> 26;\n        $h3 += $carry2;\n        $h2 -= $carry2 << 26;\n        /** @var int $carry6 */\n        $carry6 = ($h6 + (1 << 25)) >> 26;\n        $h7 += $carry6;\n        $h6 -= $carry6 << 26;\n\n        /** @var int $carry3 */\n        $carry3 = ($h3 + (1 << 24)) >> 25;\n        $h4 += $carry3;\n        $h3 -= $carry3 << 25;\n        /** @var int $carry7 */\n        $carry7 = ($h7 + (1 << 24)) >> 25;\n        $h8 += $carry7;\n        $h7 -= $carry7 << 25;\n\n        /** @var int $carry4 */\n        $carry4 = ($h4 + (1 << 25)) >> 26;\n        $h5 += $carry4;\n        $h4 -= $carry4 << 26;\n        /** @var int $carry8 */\n        $carry8 = ($h8 + (1 << 25)) >> 26;\n        $h9 += $carry8;\n        $h8 -= $carry8 << 26;\n\n        /** @var int $carry9 */\n        $carry9 = ($h9 + (1 << 24)) >> 25;\n        $h0 += self::mul($carry9, 19, 5);\n        $h9 -= $carry9 << 25;\n\n        /** @var int $carry0 */\n        $carry0 = ($h0 + (1 << 25)) >> 26;\n        $h1 += $carry0;\n        $h0 -= $carry0 << 26;\n\n        return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(\n            array(\n                (int) $h0,\n                (int) $h1,\n                (int) $h2,\n                (int) $h3,\n                (int) $h4,\n                (int) $h5,\n                (int) $h6,\n                (int) $h7,\n                (int) $h8,\n                (int) $h9\n            )\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $Z\n     * @return ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public static function fe_invert(ParagonIE_Sodium_Core_Curve25519_Fe $Z)\n    {\n        $z = clone $Z;\n        $t0 = self::fe_sq($z);\n        $t1 = self::fe_sq($t0);\n        $t1 = self::fe_sq($t1);\n        $t1 = self::fe_mul($z, $t1);\n        $t0 = self::fe_mul($t0, $t1);\n        $t2 = self::fe_sq($t0);\n        $t1 = self::fe_mul($t1, $t2);\n        $t2 = self::fe_sq($t1);\n        for ($i = 1; $i < 5; ++$i) {\n            $t2 = self::fe_sq($t2);\n        }\n        $t1 = self::fe_mul($t2, $t1);\n        $t2 = self::fe_sq($t1);\n        for ($i = 1; $i < 10; ++$i) {\n            $t2 = self::fe_sq($t2);\n        }\n        $t2 = self::fe_mul($t2, $t1);\n        $t3 = self::fe_sq($t2);\n        for ($i = 1; $i < 20; ++$i) {\n            $t3 = self::fe_sq($t3);\n        }\n        $t2 = self::fe_mul($t3, $t2);\n        $t2 = self::fe_sq($t2);\n        for ($i = 1; $i < 10; ++$i) {\n            $t2 = self::fe_sq($t2);\n        }\n        $t1 = self::fe_mul($t2, $t1);\n        $t2 = self::fe_sq($t1);\n        for ($i = 1; $i < 50; ++$i) {\n            $t2 = self::fe_sq($t2);\n        }\n        $t2 = self::fe_mul($t2, $t1);\n        $t3 = self::fe_sq($t2);\n        for ($i = 1; $i < 100; ++$i) {\n            $t3 = self::fe_sq($t3);\n        }\n        $t2 = self::fe_mul($t3, $t2);\n        $t2 = self::fe_sq($t2);\n        for ($i = 1; $i < 50; ++$i) {\n            $t2 = self::fe_sq($t2);\n        }\n        $t1 = self::fe_mul($t2, $t1);\n        $t1 = self::fe_sq($t1);\n        for ($i = 1; $i < 5; ++$i) {\n            $t1 = self::fe_sq($t1);\n        }\n        return self::fe_mul($t1, $t0);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @ref https://github.com/jedisct1/libsodium/blob/68564326e1e9dc57ef03746f85734232d20ca6fb/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c#L1054-L1106\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $z\n     * @return ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public static function fe_pow22523(ParagonIE_Sodium_Core_Curve25519_Fe $z)\n    {\n        # fe_sq(t0, z);\n        # fe_sq(t1, t0);\n        # fe_sq(t1, t1);\n        # fe_mul(t1, z, t1);\n        # fe_mul(t0, t0, t1);\n        # fe_sq(t0, t0);\n        # fe_mul(t0, t1, t0);\n        # fe_sq(t1, t0);\n        $t0 = self::fe_sq($z);\n        $t1 = self::fe_sq($t0);\n        $t1 = self::fe_sq($t1);\n        $t1 = self::fe_mul($z, $t1);\n        $t0 = self::fe_mul($t0, $t1);\n        $t0 = self::fe_sq($t0);\n        $t0 = self::fe_mul($t1, $t0);\n        $t1 = self::fe_sq($t0);\n\n        # for (i = 1; i < 5; ++i) {\n        #     fe_sq(t1, t1);\n        # }\n        for ($i = 1; $i < 5; ++$i) {\n            $t1 = self::fe_sq($t1);\n        }\n\n        # fe_mul(t0, t1, t0);\n        # fe_sq(t1, t0);\n        $t0 = self::fe_mul($t1, $t0);\n        $t1 = self::fe_sq($t0);\n\n        # for (i = 1; i < 10; ++i) {\n        #     fe_sq(t1, t1);\n        # }\n        for ($i = 1; $i < 10; ++$i) {\n            $t1 = self::fe_sq($t1);\n        }\n\n        # fe_mul(t1, t1, t0);\n        # fe_sq(t2, t1);\n        $t1 = self::fe_mul($t1, $t0);\n        $t2 = self::fe_sq($t1);\n\n        # for (i = 1; i < 20; ++i) {\n        #     fe_sq(t2, t2);\n        # }\n        for ($i = 1; $i < 20; ++$i) {\n            $t2 = self::fe_sq($t2);\n        }\n\n        # fe_mul(t1, t2, t1);\n        # fe_sq(t1, t1);\n        $t1 = self::fe_mul($t2, $t1);\n        $t1 = self::fe_sq($t1);\n\n        # for (i = 1; i < 10; ++i) {\n        #     fe_sq(t1, t1);\n        # }\n        for ($i = 1; $i < 10; ++$i) {\n            $t1 = self::fe_sq($t1);\n        }\n\n        # fe_mul(t0, t1, t0);\n        # fe_sq(t1, t0);\n        $t0 = self::fe_mul($t1, $t0);\n        $t1 = self::fe_sq($t0);\n\n        # for (i = 1; i < 50; ++i) {\n        #     fe_sq(t1, t1);\n        # }\n        for ($i = 1; $i < 50; ++$i) {\n            $t1 = self::fe_sq($t1);\n        }\n\n        # fe_mul(t1, t1, t0);\n        # fe_sq(t2, t1);\n        $t1 = self::fe_mul($t1, $t0);\n        $t2 = self::fe_sq($t1);\n\n        # for (i = 1; i < 100; ++i) {\n        #     fe_sq(t2, t2);\n        # }\n        for ($i = 1; $i < 100; ++$i) {\n            $t2 = self::fe_sq($t2);\n        }\n\n        # fe_mul(t1, t2, t1);\n        # fe_sq(t1, t1);\n        $t1 = self::fe_mul($t2, $t1);\n        $t1 = self::fe_sq($t1);\n\n        # for (i = 1; i < 50; ++i) {\n        #     fe_sq(t1, t1);\n        # }\n        for ($i = 1; $i < 50; ++$i) {\n            $t1 = self::fe_sq($t1);\n        }\n\n        # fe_mul(t0, t1, t0);\n        # fe_sq(t0, t0);\n        # fe_sq(t0, t0);\n        # fe_mul(out, t0, z);\n        $t0 = self::fe_mul($t1, $t0);\n        $t0 = self::fe_sq($t0);\n        $t0 = self::fe_sq($t0);\n        return self::fe_mul($t0, $z);\n    }\n\n    /**\n     * Subtract two field elements.\n     *\n     * h = f - g\n     *\n     * Preconditions:\n     * |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.\n     * |g| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.\n     *\n     * Postconditions:\n     * |h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $f\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $g\n     * @return ParagonIE_Sodium_Core_Curve25519_Fe\n     * @psalm-suppress MixedOperand\n     */\n    public static function fe_sub(ParagonIE_Sodium_Core_Curve25519_Fe $f, ParagonIE_Sodium_Core_Curve25519_Fe $g)\n    {\n        return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(\n            array(\n                (int) ($f[0] - $g[0]),\n                (int) ($f[1] - $g[1]),\n                (int) ($f[2] - $g[2]),\n                (int) ($f[3] - $g[3]),\n                (int) ($f[4] - $g[4]),\n                (int) ($f[5] - $g[5]),\n                (int) ($f[6] - $g[6]),\n                (int) ($f[7] - $g[7]),\n                (int) ($f[8] - $g[8]),\n                (int) ($f[9] - $g[9])\n            )\n        );\n    }\n\n    /**\n     * Add two group elements.\n     *\n     * r = p + q\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_Cached $q\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1\n     */\n    public static function ge_add(\n        ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p,\n        ParagonIE_Sodium_Core_Curve25519_Ge_Cached $q\n    ) {\n        $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1();\n        $r->X = self::fe_add($p->Y, $p->X);\n        $r->Y = self::fe_sub($p->Y, $p->X);\n        $r->Z = self::fe_mul($r->X, $q->YplusX);\n        $r->Y = self::fe_mul($r->Y, $q->YminusX);\n        $r->T = self::fe_mul($q->T2d, $p->T);\n        $r->X = self::fe_mul($p->Z, $q->Z);\n        $t0   = self::fe_add($r->X, $r->X);\n        $r->X = self::fe_sub($r->Z, $r->Y);\n        $r->Y = self::fe_add($r->Z, $r->Y);\n        $r->Z = self::fe_add($t0, $r->T);\n        $r->T = self::fe_sub($t0, $r->T);\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @ref https://github.com/jedisct1/libsodium/blob/157c4a80c13b117608aeae12178b2d38825f9f8f/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c#L1185-L1215\n     * @param string $a\n     * @return array<int, mixed>\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function slide($a)\n    {\n        if (self::strlen($a) < 256) {\n            if (self::strlen($a) < 16) {\n                $a = str_pad($a, 256, '0', STR_PAD_RIGHT);\n            }\n        }\n        /** @var array<int, int> $r */\n        $r = array();\n\n        /** @var int $i */\n        for ($i = 0; $i < 256; ++$i) {\n            $r[$i] = (int) (\n                1 & (\n                    self::chrToInt($a[(int) ($i >> 3)])\n                        >>\n                    ($i & 7)\n                )\n            );\n        }\n\n        for ($i = 0;$i < 256;++$i) {\n            if ($r[$i]) {\n                for ($b = 1;$b <= 6 && $i + $b < 256;++$b) {\n                    if ($r[$i + $b]) {\n                        if ($r[$i] + ($r[$i + $b] << $b) <= 15) {\n                            $r[$i] += $r[$i + $b] << $b;\n                            $r[$i + $b] = 0;\n                        } elseif ($r[$i] - ($r[$i + $b] << $b) >= -15) {\n                            $r[$i] -= $r[$i + $b] << $b;\n                            for ($k = $i + $b; $k < 256; ++$k) {\n                                if (!$r[$k]) {\n                                    $r[$k] = 1;\n                                    break;\n                                }\n                                $r[$k] = 0;\n                            }\n                        } else {\n                            break;\n                        }\n                    }\n                }\n            }\n        }\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $s\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_frombytes_negate_vartime($s)\n    {\n        static $d = null;\n        if (!$d) {\n            $d = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$d);\n        }\n\n        # fe_frombytes(h->Y,s);\n        # fe_1(h->Z);\n        $h = new ParagonIE_Sodium_Core_Curve25519_Ge_P3(\n            self::fe_0(),\n            self::fe_frombytes($s),\n            self::fe_1()\n        );\n\n        # fe_sq(u,h->Y);\n        # fe_mul(v,u,d);\n        # fe_sub(u,u,h->Z);       /* u = y^2-1 */\n        # fe_add(v,v,h->Z);       /* v = dy^2+1 */\n        $u = self::fe_sq($h->Y);\n        /** @var ParagonIE_Sodium_Core_Curve25519_Fe $d */\n        $v = self::fe_mul($u, $d);\n        $u = self::fe_sub($u, $h->Z); /* u =  y^2 - 1 */\n        $v = self::fe_add($v, $h->Z); /* v = dy^2 + 1 */\n\n        # fe_sq(v3,v);\n        # fe_mul(v3,v3,v);        /* v3 = v^3 */\n        # fe_sq(h->X,v3);\n        # fe_mul(h->X,h->X,v);\n        # fe_mul(h->X,h->X,u);    /* x = uv^7 */\n        $v3 = self::fe_sq($v);\n        $v3 = self::fe_mul($v3, $v); /* v3 = v^3 */\n        $h->X = self::fe_sq($v3);\n        $h->X = self::fe_mul($h->X, $v);\n        $h->X = self::fe_mul($h->X, $u); /* x = uv^7 */\n\n        # fe_pow22523(h->X,h->X); /* x = (uv^7)^((q-5)/8) */\n        # fe_mul(h->X,h->X,v3);\n        # fe_mul(h->X,h->X,u);    /* x = uv^3(uv^7)^((q-5)/8) */\n        $h->X = self::fe_pow22523($h->X); /* x = (uv^7)^((q-5)/8) */\n        $h->X = self::fe_mul($h->X, $v3);\n        $h->X = self::fe_mul($h->X, $u); /* x = uv^3(uv^7)^((q-5)/8) */\n\n        # fe_sq(vxx,h->X);\n        # fe_mul(vxx,vxx,v);\n        # fe_sub(check,vxx,u);    /* vx^2-u */\n        $vxx = self::fe_sq($h->X);\n        $vxx = self::fe_mul($vxx, $v);\n        $check = self::fe_sub($vxx, $u); /* vx^2 - u */\n\n        # if (fe_isnonzero(check)) {\n        #     fe_add(check,vxx,u);  /* vx^2+u */\n        #     if (fe_isnonzero(check)) {\n        #         return -1;\n        #     }\n        #     fe_mul(h->X,h->X,sqrtm1);\n        # }\n        if (self::fe_isnonzero($check)) {\n            $check = self::fe_add($vxx, $u); /* vx^2 + u */\n            if (self::fe_isnonzero($check)) {\n                throw new RangeException('Internal check failed.');\n            }\n            $h->X = self::fe_mul(\n                $h->X,\n                ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$sqrtm1)\n            );\n        }\n\n        # if (fe_isnegative(h->X) == (s[31] >> 7)) {\n        #     fe_neg(h->X,h->X);\n        # }\n        $i = self::chrToInt($s[31]);\n        if (self::fe_isnegative($h->X) === ($i >> 7)) {\n            $h->X = self::fe_neg($h->X);\n        }\n\n        # fe_mul(h->T,h->X,h->Y);\n        $h->T = self::fe_mul($h->X, $h->Y);\n        return $h;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $R\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $q\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1\n     */\n    public static function ge_madd(\n        ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $R,\n        ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p,\n        ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $q\n    ) {\n        $r = clone $R;\n        $r->X = self::fe_add($p->Y, $p->X);\n        $r->Y = self::fe_sub($p->Y, $p->X);\n        $r->Z = self::fe_mul($r->X, $q->yplusx);\n        $r->Y = self::fe_mul($r->Y, $q->yminusx);\n        $r->T = self::fe_mul($q->xy2d, $p->T);\n        $t0 = self::fe_add(clone $p->Z, clone $p->Z);\n        $r->X = self::fe_sub($r->Z, $r->Y);\n        $r->Y = self::fe_add($r->Z, $r->Y);\n        $r->Z = self::fe_add($t0, $r->T);\n        $r->T = self::fe_sub($t0, $r->T);\n\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $R\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $q\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1\n     */\n    public static function ge_msub(\n        ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $R,\n        ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p,\n        ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $q\n    ) {\n        $r = clone $R;\n\n        $r->X = self::fe_add($p->Y, $p->X);\n        $r->Y = self::fe_sub($p->Y, $p->X);\n        $r->Z = self::fe_mul($r->X, $q->yminusx);\n        $r->Y = self::fe_mul($r->Y, $q->yplusx);\n        $r->T = self::fe_mul($q->xy2d, $p->T);\n        $t0 = self::fe_add($p->Z, $p->Z);\n        $r->X = self::fe_sub($r->Z, $r->Y);\n        $r->Y = self::fe_add($r->Z, $r->Y);\n        $r->Z = self::fe_sub($t0, $r->T);\n        $r->T = self::fe_add($t0, $r->T);\n\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $p\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_P2\n     */\n    public static function ge_p1p1_to_p2(ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $p)\n    {\n        $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P2();\n        $r->X = self::fe_mul($p->X, $p->T);\n        $r->Y = self::fe_mul($p->Y, $p->Z);\n        $r->Z = self::fe_mul($p->Z, $p->T);\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $p\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3\n     */\n    public static function ge_p1p1_to_p3(ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $p)\n    {\n        $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P3();\n        $r->X = self::fe_mul($p->X, $p->T);\n        $r->Y = self::fe_mul($p->Y, $p->Z);\n        $r->Z = self::fe_mul($p->Z, $p->T);\n        $r->T = self::fe_mul($p->X, $p->Y);\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_P2\n     */\n    public static function ge_p2_0()\n    {\n        return new ParagonIE_Sodium_Core_Curve25519_Ge_P2(\n            self::fe_0(),\n            self::fe_1(),\n            self::fe_1()\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_P2 $p\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1\n     */\n    public static function ge_p2_dbl(ParagonIE_Sodium_Core_Curve25519_Ge_P2 $p)\n    {\n        $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1();\n\n        $r->X = self::fe_sq($p->X);\n        $r->Z = self::fe_sq($p->Y);\n        $r->T = self::fe_sq2($p->Z);\n        $r->Y = self::fe_add($p->X, $p->Y);\n        $t0   = self::fe_sq($r->Y);\n        $r->Y = self::fe_add($r->Z, $r->X);\n        $r->Z = self::fe_sub($r->Z, $r->X);\n        $r->X = self::fe_sub($t0, $r->Y);\n        $r->T = self::fe_sub($r->T, $r->Z);\n\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3\n     */\n    public static function ge_p3_0()\n    {\n        return new ParagonIE_Sodium_Core_Curve25519_Ge_P3(\n            self::fe_0(),\n            self::fe_1(),\n            self::fe_1(),\n            self::fe_0()\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_Cached\n     */\n    public static function ge_p3_to_cached(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p)\n    {\n        static $d2 = null;\n        if ($d2 === null) {\n            $d2 = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$d2);\n        }\n        /** @var ParagonIE_Sodium_Core_Curve25519_Fe $d2 */\n        $r = new ParagonIE_Sodium_Core_Curve25519_Ge_Cached();\n        $r->YplusX = self::fe_add($p->Y, $p->X);\n        $r->YminusX = self::fe_sub($p->Y, $p->X);\n        $r->Z = self::fe_copy($p->Z);\n        $r->T2d = self::fe_mul($p->T, $d2);\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_P2\n     */\n    public static function ge_p3_to_p2(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p)\n    {\n        return new ParagonIE_Sodium_Core_Curve25519_Ge_P2(\n            $p->X,\n            $p->Y,\n            $p->Z\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $h\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_p3_tobytes(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $h)\n    {\n        $recip = self::fe_invert($h->Z);\n        $x = self::fe_mul($h->X, $recip);\n        $y = self::fe_mul($h->Y, $recip);\n        $s = self::fe_tobytes($y);\n        $s[31] = self::intToChr(\n            self::chrToInt($s[31]) ^ (self::fe_isnegative($x) << 7)\n        );\n        return $s;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1\n     */\n    public static function ge_p3_dbl(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p)\n    {\n        $q = self::ge_p3_to_p2($p);\n        return self::ge_p2_dbl($q);\n    }\n\n    /**\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_Precomp\n     */\n    public static function ge_precomp_0()\n    {\n        return new ParagonIE_Sodium_Core_Curve25519_Ge_Precomp(\n            self::fe_1(),\n            self::fe_1(),\n            self::fe_0()\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $b\n     * @param int $c\n     * @return int\n     */\n    public static function equal($b, $c)\n    {\n        return (int) ((($b ^ $c) - 1 & 0xffffffff) >> 31);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int|string $char\n     * @return int (1 = yes, 0 = no)\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function negative($char)\n    {\n        if (is_int($char)) {\n            return $char < 0 ? 1 : 0;\n        }\n        $x = self::chrToInt(self::substr($char, 0, 1));\n        return (int) ($x >> 63);\n    }\n\n    /**\n     * Conditional move\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $t\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $u\n     * @param int $b\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_Precomp\n     */\n    public static function cmov(\n        ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $t,\n        ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $u,\n        $b\n    ) {\n        if (!is_int($b)) {\n            throw new InvalidArgumentException('Expected an integer.');\n        }\n        return new ParagonIE_Sodium_Core_Curve25519_Ge_Precomp(\n            self::fe_cmov($t->yplusx, $u->yplusx, $b),\n            self::fe_cmov($t->yminusx, $u->yminusx, $b),\n            self::fe_cmov($t->xy2d, $u->xy2d, $b)\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $pos\n     * @param int $b\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_Precomp\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayOffset\n     */\n    public static function ge_select($pos = 0, $b = 0)\n    {\n        static $base = null;\n        if ($base === null) {\n            $base = array();\n            /** @var int $i */\n            foreach (self::$base as $i => $bas) {\n                for ($j = 0; $j < 8; ++$j) {\n                    $base[$i][$j] = new ParagonIE_Sodium_Core_Curve25519_Ge_Precomp(\n                        ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($bas[$j][0]),\n                        ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($bas[$j][1]),\n                        ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($bas[$j][2])\n                    );\n                }\n            }\n        }\n        /** @var array<int, array<int, ParagonIE_Sodium_Core_Curve25519_Ge_Precomp>> $base */\n        if (!is_int($pos)) {\n            throw new InvalidArgumentException('Position must be an integer');\n        }\n        if ($pos < 0 || $pos > 31) {\n            throw new RangeException('Position is out of range [0, 31]');\n        }\n\n        /** @var int $bnegative */\n        $bnegative = self::negative($b);\n        /** @var int $babs */\n        $babs = $b - (((-$bnegative) & $b) << 1);\n\n        $t = self::ge_precomp_0();\n        for ($i = 0; $i < 8; ++$i) {\n            $t = self::cmov(\n                $t,\n                $base[$pos][$i],\n                self::equal($babs, $i + 1)\n            );\n        }\n        $minusT = new ParagonIE_Sodium_Core_Curve25519_Ge_Precomp(\n            self::fe_copy($t->yminusx),\n            self::fe_copy($t->yplusx),\n            self::fe_neg($t->xy2d)\n        );\n        return self::cmov($t, $minusT, $bnegative);\n    }\n\n    /**\n     * Subtract two group elements.\n     *\n     * r = p - q\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_Cached $q\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1\n     */\n    public static function ge_sub(\n        ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p,\n        ParagonIE_Sodium_Core_Curve25519_Ge_Cached $q\n    ) {\n        $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1();\n\n        $r->X = self::fe_add($p->Y, $p->X);\n        $r->Y = self::fe_sub($p->Y, $p->X);\n        $r->Z = self::fe_mul($r->X, $q->YminusX);\n        $r->Y = self::fe_mul($r->Y, $q->YplusX);\n        $r->T = self::fe_mul($q->T2d, $p->T);\n        $r->X = self::fe_mul($p->Z, $q->Z);\n        $t0 = self::fe_add($r->X, $r->X);\n        $r->X = self::fe_sub($r->Z, $r->Y);\n        $r->Y = self::fe_add($r->Z, $r->Y);\n        $r->Z = self::fe_sub($t0, $r->T);\n        $r->T = self::fe_add($t0, $r->T);\n\n        return $r;\n    }\n\n    /**\n     * Convert a group element to a byte string.\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_P2 $h\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_tobytes(ParagonIE_Sodium_Core_Curve25519_Ge_P2 $h)\n    {\n        $recip = self::fe_invert($h->Z);\n        $x = self::fe_mul($h->X, $recip);\n        $y = self::fe_mul($h->Y, $recip);\n        $s = self::fe_tobytes($y);\n        $s[31] = self::intToChr(\n            self::chrToInt($s[31]) ^ (self::fe_isnegative($x) << 7)\n        );\n        return $s;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $a\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A\n     * @param string $b\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_P2\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedArrayAccess\n     */\n    public static function ge_double_scalarmult_vartime(\n        $a,\n        ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A,\n        $b\n    ) {\n        /** @var array<int, ParagonIE_Sodium_Core_Curve25519_Ge_Cached> $Ai */\n        $Ai = array();\n\n        /** @var array<int, ParagonIE_Sodium_Core_Curve25519_Ge_Precomp> $Bi */\n        static $Bi = array();\n        if (!$Bi) {\n            for ($i = 0; $i < 8; ++$i) {\n                $Bi[$i] = new ParagonIE_Sodium_Core_Curve25519_Ge_Precomp(\n                    ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$base2[$i][0]),\n                    ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$base2[$i][1]),\n                    ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$base2[$i][2])\n                );\n            }\n        }\n        for ($i = 0; $i < 8; ++$i) {\n            $Ai[$i] = new ParagonIE_Sodium_Core_Curve25519_Ge_Cached(\n                self::fe_0(),\n                self::fe_0(),\n                self::fe_0(),\n                self::fe_0()\n            );\n        }\n\n        # slide(aslide,a);\n        # slide(bslide,b);\n        /** @var array<int, int> $aslide */\n        $aslide = self::slide($a);\n        /** @var array<int, int> $bslide */\n        $bslide = self::slide($b);\n\n        # ge_p3_to_cached(&Ai[0],A);\n        # ge_p3_dbl(&t,A); ge_p1p1_to_p3(&A2,&t);\n        $Ai[0] = self::ge_p3_to_cached($A);\n        $t = self::ge_p3_dbl($A);\n        $A2 = self::ge_p1p1_to_p3($t);\n\n        # ge_add(&t,&A2,&Ai[0]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[1],&u);\n        # ge_add(&t,&A2,&Ai[1]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[2],&u);\n        # ge_add(&t,&A2,&Ai[2]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[3],&u);\n        # ge_add(&t,&A2,&Ai[3]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[4],&u);\n        # ge_add(&t,&A2,&Ai[4]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[5],&u);\n        # ge_add(&t,&A2,&Ai[5]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[6],&u);\n        # ge_add(&t,&A2,&Ai[6]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[7],&u);\n        for ($i = 0; $i < 7; ++$i) {\n            $t = self::ge_add($A2, $Ai[$i]);\n            $u = self::ge_p1p1_to_p3($t);\n            $Ai[$i + 1] = self::ge_p3_to_cached($u);\n        }\n\n        # ge_p2_0(r);\n        $r = self::ge_p2_0();\n\n        # for (i = 255;i >= 0;--i) {\n        #     if (aslide[i] || bslide[i]) break;\n        # }\n        $i = 255;\n        for (; $i >= 0; --$i) {\n            if ($aslide[$i] || $bslide[$i]) {\n                break;\n            }\n        }\n\n        # for (;i >= 0;--i) {\n        for (; $i >= 0; --$i) {\n            # ge_p2_dbl(&t,r);\n            $t = self::ge_p2_dbl($r);\n\n            # if (aslide[i] > 0) {\n            if ($aslide[$i] > 0) {\n                # ge_p1p1_to_p3(&u,&t);\n                # ge_add(&t,&u,&Ai[aslide[i]/2]);\n                $u = self::ge_p1p1_to_p3($t);\n                $t = self::ge_add(\n                    $u,\n                    $Ai[(int) floor($aslide[$i] / 2)]\n                );\n            # } else if (aslide[i] < 0) {\n            } elseif ($aslide[$i] < 0) {\n                # ge_p1p1_to_p3(&u,&t);\n                # ge_sub(&t,&u,&Ai[(-aslide[i])/2]);\n                $u = self::ge_p1p1_to_p3($t);\n                $t = self::ge_sub(\n                    $u,\n                    $Ai[(int) floor(-$aslide[$i] / 2)]\n                );\n            }\n\n            # if (bslide[i] > 0) {\n            if ($bslide[$i] > 0) {\n                /** @var int $index */\n                $index = (int) floor($bslide[$i] / 2);\n                # ge_p1p1_to_p3(&u,&t);\n                # ge_madd(&t,&u,&Bi[bslide[i]/2]);\n                $u = self::ge_p1p1_to_p3($t);\n                $t = self::ge_madd($t, $u, $Bi[$index]);\n            # } else if (bslide[i] < 0) {\n            } elseif ($bslide[$i] < 0) {\n                /** @var int $index */\n                $index = (int) floor(-$bslide[$i] / 2);\n                # ge_p1p1_to_p3(&u,&t);\n                # ge_msub(&t,&u,&Bi[(-bslide[i])/2]);\n                $u = self::ge_p1p1_to_p3($t);\n                $t = self::ge_msub($t, $u, $Bi[$index]);\n            }\n            # ge_p1p1_to_p2(r,&t);\n            $r = self::ge_p1p1_to_p2($t);\n        }\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $a\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedOperand\n     */\n    public static function ge_scalarmult_base($a)\n    {\n        /** @var array<int, int> $e */\n        $e = array();\n        $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1();\n\n        for ($i = 0; $i < 32; ++$i) {\n            /** @var int $dbl */\n            $dbl = (int) $i << 1;\n            $e[$dbl] = (int) self::chrToInt($a[$i]) & 15;\n            $e[$dbl + 1] = (int) (self::chrToInt($a[$i]) >> 4) & 15;\n        }\n\n        /** @var int $carry */\n        $carry = 0;\n        for ($i = 0; $i < 63; ++$i) {\n            $e[$i] += $carry;\n            /** @var int $carry */\n            $carry = $e[$i] + 8;\n            /** @var int $carry */\n            $carry >>= 4;\n            $e[$i] -= $carry << 4;\n        }\n        /** @var array<int, int> $e */\n        $e[63] += (int) $carry;\n\n        $h = self::ge_p3_0();\n\n        for ($i = 1; $i < 64; $i += 2) {\n            $t = self::ge_select((int) floor($i / 2), (int) $e[$i]);\n            $r = self::ge_madd($r, $h, $t);\n            $h = self::ge_p1p1_to_p3($r);\n        }\n\n        $r = self::ge_p3_dbl($h);\n\n        $s = self::ge_p1p1_to_p2($r);\n        $r = self::ge_p2_dbl($s);\n        $s = self::ge_p1p1_to_p2($r);\n        $r = self::ge_p2_dbl($s);\n        $s = self::ge_p1p1_to_p2($r);\n        $r = self::ge_p2_dbl($s);\n\n        $h = self::ge_p1p1_to_p3($r);\n\n        for ($i = 0; $i < 64; $i += 2) {\n            $t = self::ge_select($i >> 1, (int) $e[$i]);\n            $r = self::ge_madd($r, $h, $t);\n            $h = self::ge_p1p1_to_p3($r);\n        }\n        return $h;\n    }\n\n    /**\n     * Calculates (ab + c) mod l\n     * where l = 2^252 + 27742317777372353535851937790883648493\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $a\n     * @param string $b\n     * @param string $c\n     * @return string\n     * @throws TypeError\n     */\n    public static function sc_muladd($a, $b, $c)\n    {\n        /** @var int $a0 */\n        $a0 = 2097151 & self::load_3(self::substr($a, 0, 3));\n        /** @var int $a1 */\n        $a1 = 2097151 & (self::load_4(self::substr($a, 2, 4)) >> 5);\n        /** @var int $a2 */\n        $a2 = 2097151 & (self::load_3(self::substr($a, 5, 3)) >> 2);\n        /** @var int $a3 */\n        $a3 = 2097151 & (self::load_4(self::substr($a, 7, 4)) >> 7);\n        /** @var int $a4 */\n        $a4 = 2097151 & (self::load_4(self::substr($a, 10, 4)) >> 4);\n        /** @var int $a5 */\n        $a5 = 2097151 & (self::load_3(self::substr($a, 13, 3)) >> 1);\n        /** @var int $a6 */\n        $a6 = 2097151 & (self::load_4(self::substr($a, 15, 4)) >> 6);\n        /** @var int $a7 */\n        $a7 = 2097151 & (self::load_3(self::substr($a, 18, 3)) >> 3);\n        /** @var int $a8 */\n        $a8 = 2097151 & self::load_3(self::substr($a, 21, 3));\n        /** @var int $a9 */\n        $a9 = 2097151 & (self::load_4(self::substr($a, 23, 4)) >> 5);\n        /** @var int $a10 */\n        $a10 = 2097151 & (self::load_3(self::substr($a, 26, 3)) >> 2);\n        /** @var int $a11 */\n        $a11 = (self::load_4(self::substr($a, 28, 4)) >> 7);\n\n        /** @var int $b0 */\n        $b0 = 2097151 & self::load_3(self::substr($b, 0, 3));\n        /** @var int $b1 */\n        $b1 = 2097151 & (self::load_4(self::substr($b, 2, 4)) >> 5);\n        /** @var int $b2 */\n        $b2 = 2097151 & (self::load_3(self::substr($b, 5, 3)) >> 2);\n        /** @var int $b3 */\n        $b3 = 2097151 & (self::load_4(self::substr($b, 7, 4)) >> 7);\n        /** @var int $b4 */\n        $b4 = 2097151 & (self::load_4(self::substr($b, 10, 4)) >> 4);\n        /** @var int $b5 */\n        $b5 = 2097151 & (self::load_3(self::substr($b, 13, 3)) >> 1);\n        /** @var int $b6 */\n        $b6 = 2097151 & (self::load_4(self::substr($b, 15, 4)) >> 6);\n        /** @var int $b7 */\n        $b7 = 2097151 & (self::load_3(self::substr($b, 18, 3)) >> 3);\n        /** @var int $b8 */\n        $b8 = 2097151 & self::load_3(self::substr($b, 21, 3));\n        /** @var int $b9 */\n        $b9 = 2097151 & (self::load_4(self::substr($b, 23, 4)) >> 5);\n        /** @var int $b10 */\n        $b10 = 2097151 & (self::load_3(self::substr($b, 26, 3)) >> 2);\n        /** @var int $b11 */\n        $b11 = (self::load_4(self::substr($b, 28, 4)) >> 7);\n\n        /** @var int $c0 */\n        $c0 = 2097151 & self::load_3(self::substr($c, 0, 3));\n        /** @var int $c1 */\n        $c1 = 2097151 & (self::load_4(self::substr($c, 2, 4)) >> 5);\n        /** @var int $c2 */\n        $c2 = 2097151 & (self::load_3(self::substr($c, 5, 3)) >> 2);\n        /** @var int $c3 */\n        $c3 = 2097151 & (self::load_4(self::substr($c, 7, 4)) >> 7);\n        /** @var int $c4 */\n        $c4 = 2097151 & (self::load_4(self::substr($c, 10, 4)) >> 4);\n        /** @var int $c5 */\n        $c5 = 2097151 & (self::load_3(self::substr($c, 13, 3)) >> 1);\n        /** @var int $c6 */\n        $c6 = 2097151 & (self::load_4(self::substr($c, 15, 4)) >> 6);\n        /** @var int $c7 */\n        $c7 = 2097151 & (self::load_3(self::substr($c, 18, 3)) >> 3);\n        /** @var int $c8 */\n        $c8 = 2097151 & self::load_3(self::substr($c, 21, 3));\n        /** @var int $c9 */\n        $c9 = 2097151 & (self::load_4(self::substr($c, 23, 4)) >> 5);\n        /** @var int $c10 */\n        $c10 = 2097151 & (self::load_3(self::substr($c, 26, 3)) >> 2);\n        /** @var int $c11 */\n        $c11 = (self::load_4(self::substr($c, 28, 4)) >> 7);\n\n        /* Can't really avoid the pyramid here: */\n        $s0 = $c0 + self::mul($a0, $b0, 24);\n        $s1 = $c1 + self::mul($a0, $b1, 24) + self::mul($a1, $b0, 24);\n        $s2 = $c2 + self::mul($a0, $b2, 24) + self::mul($a1, $b1, 24) + self::mul($a2, $b0, 24);\n        $s3 = $c3 + self::mul($a0, $b3, 24) + self::mul($a1, $b2, 24) + self::mul($a2, $b1, 24) + self::mul($a3, $b0, 24);\n        $s4 = $c4 + self::mul($a0, $b4, 24) + self::mul($a1, $b3, 24) + self::mul($a2, $b2, 24) + self::mul($a3, $b1, 24) +\n               self::mul($a4, $b0, 24);\n        $s5 = $c5 + self::mul($a0, $b5, 24) + self::mul($a1, $b4, 24) + self::mul($a2, $b3, 24) + self::mul($a3, $b2, 24) +\n               self::mul($a4, $b1, 24) + self::mul($a5, $b0, 24);\n        $s6 = $c6 + self::mul($a0, $b6, 24) + self::mul($a1, $b5, 24) + self::mul($a2, $b4, 24) + self::mul($a3, $b3, 24) +\n               self::mul($a4, $b2, 24) + self::mul($a5, $b1, 24) + self::mul($a6, $b0, 24);\n        $s7 = $c7 + self::mul($a0, $b7, 24) + self::mul($a1, $b6, 24) + self::mul($a2, $b5, 24) + self::mul($a3, $b4, 24) +\n               self::mul($a4, $b3, 24) + self::mul($a5, $b2, 24) + self::mul($a6, $b1, 24) + self::mul($a7, $b0, 24);\n        $s8 = $c8 + self::mul($a0, $b8, 24) + self::mul($a1, $b7, 24) + self::mul($a2, $b6, 24) + self::mul($a3, $b5, 24) +\n               self::mul($a4, $b4, 24) + self::mul($a5, $b3, 24) + self::mul($a6, $b2, 24) + self::mul($a7, $b1, 24) +\n               self::mul($a8, $b0, 24);\n        $s9 = $c9 + self::mul($a0, $b9, 24) + self::mul($a1, $b8, 24) + self::mul($a2, $b7, 24) + self::mul($a3, $b6, 24) +\n               self::mul($a4, $b5, 24) + self::mul($a5, $b4, 24) + self::mul($a6, $b3, 24) + self::mul($a7, $b2, 24) +\n               self::mul($a8, $b1, 24) + self::mul($a9, $b0, 24);\n        $s10 = $c10 + self::mul($a0, $b10, 24) + self::mul($a1, $b9, 24) + self::mul($a2, $b8, 24) + self::mul($a3, $b7, 24) +\n               self::mul($a4, $b6, 24) + self::mul($a5, $b5, 24) + self::mul($a6, $b4, 24) + self::mul($a7, $b3, 24) +\n               self::mul($a8, $b2, 24) + self::mul($a9, $b1, 24) + self::mul($a10, $b0, 24);\n        $s11 = $c11 + self::mul($a0, $b11, 24) + self::mul($a1, $b10, 24) + self::mul($a2, $b9, 24) + self::mul($a3, $b8, 24) +\n               self::mul($a4, $b7, 24) + self::mul($a5, $b6, 24) + self::mul($a6, $b5, 24) + self::mul($a7, $b4, 24) +\n               self::mul($a8, $b3, 24) + self::mul($a9, $b2, 24) + self::mul($a10, $b1, 24) + self::mul($a11, $b0, 24);\n        $s12 = self::mul($a1, $b11, 24) + self::mul($a2, $b10, 24) + self::mul($a3, $b9, 24) + self::mul($a4, $b8, 24) +\n               self::mul($a5, $b7, 24) + self::mul($a6, $b6, 24) + self::mul($a7, $b5, 24) + self::mul($a8, $b4, 24) +\n               self::mul($a9, $b3, 24) + self::mul($a10, $b2, 24) + self::mul($a11, $b1, 24);\n        $s13 = self::mul($a2, $b11, 24) + self::mul($a3, $b10, 24) + self::mul($a4, $b9, 24) + self::mul($a5, $b8, 24) +\n               self::mul($a6, $b7, 24) + self::mul($a7, $b6, 24) + self::mul($a8, $b5, 24) + self::mul($a9, $b4, 24) +\n               self::mul($a10, $b3, 24) + self::mul($a11, $b2, 24);\n        $s14 = self::mul($a3, $b11, 24) + self::mul($a4, $b10, 24) + self::mul($a5, $b9, 24) + self::mul($a6, $b8, 24) +\n               self::mul($a7, $b7, 24) + self::mul($a8, $b6, 24) + self::mul($a9, $b5, 24) + self::mul($a10, $b4, 24) +\n               self::mul($a11, $b3, 24);\n        $s15 = self::mul($a4, $b11, 24) + self::mul($a5, $b10, 24) + self::mul($a6, $b9, 24) + self::mul($a7, $b8, 24) +\n               self::mul($a8, $b7, 24) + self::mul($a9, $b6, 24) + self::mul($a10, $b5, 24) + self::mul($a11, $b4, 24);\n        $s16 = self::mul($a5, $b11, 24) + self::mul($a6, $b10, 24) + self::mul($a7, $b9, 24) + self::mul($a8, $b8, 24) +\n               self::mul($a9, $b7, 24) + self::mul($a10, $b6, 24) + self::mul($a11, $b5, 24);\n        $s17 = self::mul($a6, $b11, 24) + self::mul($a7, $b10, 24) + self::mul($a8, $b9, 24) + self::mul($a9, $b8, 24) +\n               self::mul($a10, $b7, 24) + self::mul($a11, $b6, 24);\n        $s18 = self::mul($a7, $b11, 24) + self::mul($a8, $b10, 24) + self::mul($a9, $b9, 24) + self::mul($a10, $b8, 24) +\n               self::mul($a11, $b7, 24);\n        $s19 = self::mul($a8, $b11, 24) + self::mul($a9, $b10, 24) + self::mul($a10, $b9, 24) + self::mul($a11, $b8, 24);\n        $s20 = self::mul($a9, $b11, 24) + self::mul($a10, $b10, 24) + self::mul($a11, $b9, 24);\n        $s21 = self::mul($a10, $b11, 24) + self::mul($a11, $b10, 24);\n        $s22 = self::mul($a11, $b11, 24);\n        $s23 = 0;\n\n        /** @var int $carry0 */\n        $carry0 = ($s0 + (1 << 20)) >> 21;\n        $s1 += $carry0;\n        $s0 -= $carry0 << 21;\n        /** @var int $carry2 */\n        $carry2 = ($s2 + (1 << 20)) >> 21;\n        $s3 += $carry2;\n        $s2 -= $carry2 << 21;\n        /** @var int $carry4 */\n        $carry4 = ($s4 + (1 << 20)) >> 21;\n        $s5 += $carry4;\n        $s4 -= $carry4 << 21;\n        /** @var int $carry6 */\n        $carry6 = ($s6 + (1 << 20)) >> 21;\n        $s7 += $carry6;\n        $s6 -= $carry6 << 21;\n        /** @var int $carry8 */\n        $carry8 = ($s8 + (1 << 20)) >> 21;\n        $s9 += $carry8;\n        $s8 -= $carry8 << 21;\n        /** @var int $carry10 */\n        $carry10 = ($s10 + (1 << 20)) >> 21;\n        $s11 += $carry10;\n        $s10 -= $carry10 << 21;\n        /** @var int $carry12 */\n        $carry12 = ($s12 + (1 << 20)) >> 21;\n        $s13 += $carry12;\n        $s12 -= $carry12 << 21;\n        /** @var int $carry14 */\n        $carry14 = ($s14 + (1 << 20)) >> 21;\n        $s15 += $carry14;\n        $s14 -= $carry14 << 21;\n        /** @var int $carry16 */\n        $carry16 = ($s16 + (1 << 20)) >> 21;\n        $s17 += $carry16;\n        $s16 -= $carry16 << 21;\n        /** @var int $carry18 */\n        $carry18 = ($s18 + (1 << 20)) >> 21;\n        $s19 += $carry18;\n        $s18 -= $carry18 << 21;\n        /** @var int $carry20 */\n        $carry20 = ($s20 + (1 << 20)) >> 21;\n        $s21 += $carry20;\n        $s20 -= $carry20 << 21;\n        /** @var int $carry22 */\n        $carry22 = ($s22 + (1 << 20)) >> 21;\n        $s23 += $carry22;\n        $s22 -= $carry22 << 21;\n\n        /** @var int $carry1 */\n        $carry1 = ($s1 + (1 << 20)) >> 21;\n        $s2 += $carry1;\n        $s1 -= $carry1 << 21;\n        /** @var int $carry3 */\n        $carry3 = ($s3 + (1 << 20)) >> 21;\n        $s4 += $carry3;\n        $s3 -= $carry3 << 21;\n        /** @var int $carry5 */\n        $carry5 = ($s5 + (1 << 20)) >> 21;\n        $s6 += $carry5;\n        $s5 -= $carry5 << 21;\n        /** @var int $carry7 */\n        $carry7 = ($s7 + (1 << 20)) >> 21;\n        $s8 += $carry7;\n        $s7 -= $carry7 << 21;\n        /** @var int $carry9 */\n        $carry9 = ($s9 + (1 << 20)) >> 21;\n        $s10 += $carry9;\n        $s9 -= $carry9 << 21;\n        /** @var int $carry11 */\n        $carry11 = ($s11 + (1 << 20)) >> 21;\n        $s12 += $carry11;\n        $s11 -= $carry11 << 21;\n        /** @var int $carry13 */\n        $carry13 = ($s13 + (1 << 20)) >> 21;\n        $s14 += $carry13;\n        $s13 -= $carry13 << 21;\n        /** @var int $carry15 */\n        $carry15 = ($s15 + (1 << 20)) >> 21;\n        $s16 += $carry15;\n        $s15 -= $carry15 << 21;\n        /** @var int $carry17 */\n        $carry17 = ($s17 + (1 << 20)) >> 21;\n        $s18 += $carry17;\n        $s17 -= $carry17 << 21;\n        /** @var int $carry19 */\n        $carry19 = ($s19 + (1 << 20)) >> 21;\n        $s20 += $carry19;\n        $s19 -= $carry19 << 21;\n        /** @var int $carry21 */\n        $carry21 = ($s21 + (1 << 20)) >> 21;\n        $s22 += $carry21;\n        $s21 -= $carry21 << 21;\n\n        $s11 += self::mul($s23, 666643, 20);\n        $s12 += self::mul($s23, 470296, 19);\n        $s13 += self::mul($s23, 654183, 20);\n        $s14 -= self::mul($s23, 997805, 20);\n        $s15 += self::mul($s23, 136657, 18);\n        $s16 -= self::mul($s23, 683901, 20);\n\n        $s10 += self::mul($s22, 666643, 20);\n        $s11 += self::mul($s22, 470296, 19);\n        $s12 += self::mul($s22, 654183, 20);\n        $s13 -= self::mul($s22, 997805, 20);\n        $s14 += self::mul($s22, 136657, 18);\n        $s15 -= self::mul($s22, 683901, 20);\n\n        $s9  += self::mul($s21,  666643, 20);\n        $s10 += self::mul($s21,  470296, 19);\n        $s11 += self::mul($s21,  654183, 20);\n        $s12 -= self::mul($s21,  997805, 20);\n        $s13 += self::mul($s21,  136657, 18);\n        $s14 -= self::mul($s21,  683901, 20);\n\n        $s8  += self::mul($s20,  666643, 20);\n        $s9  += self::mul($s20,  470296, 19);\n        $s10 += self::mul($s20,  654183, 20);\n        $s11 -= self::mul($s20,  997805, 20);\n        $s12 += self::mul($s20,  136657, 18);\n        $s13 -= self::mul($s20,  683901, 20);\n\n        $s7  += self::mul($s19,  666643, 20);\n        $s8  += self::mul($s19,  470296, 19);\n        $s9  += self::mul($s19,  654183, 20);\n        $s10 -= self::mul($s19,  997805, 20);\n        $s11 += self::mul($s19,  136657, 18);\n        $s12 -= self::mul($s19,  683901, 20);\n\n        $s6  += self::mul($s18,  666643, 20);\n        $s7  += self::mul($s18,  470296, 19);\n        $s8  += self::mul($s18,  654183, 20);\n        $s9  -= self::mul($s18,  997805, 20);\n        $s10 += self::mul($s18,  136657, 18);\n        $s11 -= self::mul($s18,  683901, 20);\n\n        /** @var int $carry6 */\n        $carry6 = ($s6 + (1 << 20)) >> 21;\n        $s7 += $carry6;\n        $s6 -= $carry6 << 21;\n        /** @var int $carry8 */\n        $carry8 = ($s8 + (1 << 20)) >> 21;\n        $s9 += $carry8;\n        $s8 -= $carry8 << 21;\n        /** @var int $carry10 */\n        $carry10 = ($s10 + (1 << 20)) >> 21;\n        $s11 += $carry10;\n        $s10 -= $carry10 << 21;\n        /** @var int $carry12 */\n        $carry12 = ($s12 + (1 << 20)) >> 21;\n        $s13 += $carry12;\n        $s12 -= $carry12 << 21;\n        /** @var int $carry14 */\n        $carry14 = ($s14 + (1 << 20)) >> 21;\n        $s15 += $carry14;\n        $s14 -= $carry14 << 21;\n        /** @var int $carry16 */\n        $carry16 = ($s16 + (1 << 20)) >> 21;\n        $s17 += $carry16;\n        $s16 -= $carry16 << 21;\n\n        /** @var int $carry7 */\n        $carry7 = ($s7 + (1 << 20)) >> 21;\n        $s8 += $carry7;\n        $s7 -= $carry7 << 21;\n        /** @var int $carry9 */\n        $carry9 = ($s9 + (1 << 20)) >> 21;\n        $s10 += $carry9;\n        $s9 -= $carry9 << 21;\n        /** @var int $carry11 */\n        $carry11 = ($s11 + (1 << 20)) >> 21;\n        $s12 += $carry11;\n        $s11 -= $carry11 << 21;\n        /** @var int $carry13 */\n        $carry13 = ($s13 + (1 << 20)) >> 21;\n        $s14 += $carry13;\n        $s13 -= $carry13 << 21;\n        /** @var int $carry15 */\n        $carry15 = ($s15 + (1 << 20)) >> 21;\n        $s16 += $carry15;\n        $s15 -= $carry15 << 21;\n\n        $s5  += self::mul($s17,  666643, 20);\n        $s6  += self::mul($s17,  470296, 19);\n        $s7  += self::mul($s17,  654183, 20);\n        $s8  -= self::mul($s17,  997805, 20);\n        $s9  += self::mul($s17,  136657, 18);\n        $s10 -= self::mul($s17,  683901, 20);\n\n        $s4 += self::mul($s16,  666643, 20);\n        $s5 += self::mul($s16,  470296, 19);\n        $s6 += self::mul($s16,  654183, 20);\n        $s7 -= self::mul($s16,  997805, 20);\n        $s8 += self::mul($s16,  136657, 18);\n        $s9 -= self::mul($s16,  683901, 20);\n\n        $s3 += self::mul($s15,  666643, 20);\n        $s4 += self::mul($s15,  470296, 19);\n        $s5 += self::mul($s15,  654183, 20);\n        $s6 -= self::mul($s15,  997805, 20);\n        $s7 += self::mul($s15,  136657, 18);\n        $s8 -= self::mul($s15,  683901, 20);\n\n        $s2 += self::mul($s14,  666643, 20);\n        $s3 += self::mul($s14,  470296, 19);\n        $s4 += self::mul($s14,  654183, 20);\n        $s5 -= self::mul($s14,  997805, 20);\n        $s6 += self::mul($s14,  136657, 18);\n        $s7 -= self::mul($s14,  683901, 20);\n\n        $s1 += self::mul($s13,  666643, 20);\n        $s2 += self::mul($s13,  470296, 19);\n        $s3 += self::mul($s13,  654183, 20);\n        $s4 -= self::mul($s13,  997805, 20);\n        $s5 += self::mul($s13,  136657, 18);\n        $s6 -= self::mul($s13,  683901, 20);\n\n        $s0 += self::mul($s12,  666643, 20);\n        $s1 += self::mul($s12,  470296, 19);\n        $s2 += self::mul($s12,  654183, 20);\n        $s3 -= self::mul($s12,  997805, 20);\n        $s4 += self::mul($s12,  136657, 18);\n        $s5 -= self::mul($s12,  683901, 20);\n        $s12 = 0;\n\n        /** @var int $carry0 */\n        $carry0 = ($s0 + (1 << 20)) >> 21;\n        $s1 += $carry0;\n        $s0 -= $carry0 << 21;\n        /** @var int $carry2 */\n        $carry2 = ($s2 + (1 << 20)) >> 21;\n        $s3 += $carry2;\n        $s2 -= $carry2 << 21;\n        /** @var int $carry4 */\n        $carry4 = ($s4 + (1 << 20)) >> 21;\n        $s5 += $carry4;\n        $s4 -= $carry4 << 21;\n        /** @var int $carry6 */\n        $carry6 = ($s6 + (1 << 20)) >> 21;\n        $s7 += $carry6;\n        $s6 -= $carry6 << 21;\n        /** @var int $carry8 */\n        $carry8 = ($s8 + (1 << 20)) >> 21;\n        $s9 += $carry8;\n        $s8 -= $carry8 << 21;\n        /** @var int $carry10 */\n        $carry10 = ($s10 + (1 << 20)) >> 21;\n        $s11 += $carry10;\n        $s10 -= $carry10 << 21;\n\n        /** @var int $carry1 */\n        $carry1 = ($s1 + (1 << 20)) >> 21;\n        $s2 += $carry1;\n        $s1 -= $carry1 << 21;\n        /** @var int $carry3 */\n        $carry3 = ($s3 + (1 << 20)) >> 21;\n        $s4 += $carry3;\n        $s3 -= $carry3 << 21;\n        /** @var int $carry5 */\n        $carry5 = ($s5 + (1 << 20)) >> 21;\n        $s6 += $carry5;\n        $s5 -= $carry5 << 21;\n        /** @var int $carry7 */\n        $carry7 = ($s7 + (1 << 20)) >> 21;\n        $s8 += $carry7;\n        $s7 -= $carry7 << 21;\n        /** @var int $carry9 */\n        $carry9 = ($s9 + (1 << 20)) >> 21;\n        $s10 += $carry9;\n        $s9 -= $carry9 << 21;\n        /** @var int $carry11 */\n        $carry11 = ($s11 + (1 << 20)) >> 21;\n        $s12 += $carry11;\n        $s11 -= $carry11 << 21;\n\n        $s0 += self::mul($s12,  666643, 20);\n        $s1 += self::mul($s12,  470296, 19);\n        $s2 += self::mul($s12,  654183, 20);\n        $s3 -= self::mul($s12,  997805, 20);\n        $s4 += self::mul($s12,  136657, 18);\n        $s5 -= self::mul($s12,  683901, 20);\n        $s12 = 0;\n\n        /** @var int $carry0 */\n        $carry0 = $s0 >> 21;\n        $s1 += $carry0;\n        $s0 -= $carry0 << 21;\n        /** @var int $carry1 */\n        $carry1 = $s1 >> 21;\n        $s2 += $carry1;\n        $s1 -= $carry1 << 21;\n        /** @var int $carry2 */\n        $carry2 = $s2 >> 21;\n        $s3 += $carry2;\n        $s2 -= $carry2 << 21;\n        /** @var int $carry3 */\n        $carry3 = $s3 >> 21;\n        $s4 += $carry3;\n        $s3 -= $carry3 << 21;\n        /** @var int $carry4 */\n        $carry4 = $s4 >> 21;\n        $s5 += $carry4;\n        $s4 -= $carry4 << 21;\n        /** @var int $carry5 */\n        $carry5 = $s5 >> 21;\n        $s6 += $carry5;\n        $s5 -= $carry5 << 21;\n        /** @var int $carry6 */\n        $carry6 = $s6 >> 21;\n        $s7 += $carry6;\n        $s6 -= $carry6 << 21;\n        /** @var int $carry7 */\n        $carry7 = $s7 >> 21;\n        $s8 += $carry7;\n        $s7 -= $carry7 << 21;\n        /** @var int $carry8 */\n        $carry8 = $s8 >> 21;\n        $s9 += $carry8;\n        $s8 -= $carry8 << 21;\n        /** @var int $carry9 */\n        $carry9 = $s9 >> 21;\n        $s10 += $carry9;\n        $s9 -= $carry9 << 21;\n        /** @var int $carry10 */\n        $carry10 = $s10 >> 21;\n        $s11 += $carry10;\n        $s10 -= $carry10 << 21;\n        /** @var int $carry11 */\n        $carry11 = $s11 >> 21;\n        $s12 += $carry11;\n        $s11 -= $carry11 << 21;\n\n        $s0 += self::mul($s12,  666643, 20);\n        $s1 += self::mul($s12,  470296, 19);\n        $s2 += self::mul($s12,  654183, 20);\n        $s3 -= self::mul($s12,  997805, 20);\n        $s4 += self::mul($s12,  136657, 18);\n        $s5 -= self::mul($s12,  683901, 20);\n\n        /** @var int $carry0 */\n        $carry0 = $s0 >> 21;\n        $s1 += $carry0;\n        $s0 -= $carry0 << 21;\n        /** @var int $carry1 */\n        $carry1 = $s1 >> 21;\n        $s2 += $carry1;\n        $s1 -= $carry1 << 21;\n        /** @var int $carry2 */\n        $carry2 = $s2 >> 21;\n        $s3 += $carry2;\n        $s2 -= $carry2 << 21;\n        /** @var int $carry3 */\n        $carry3 = $s3 >> 21;\n        $s4 += $carry3;\n        $s3 -= $carry3 << 21;\n        /** @var int $carry4 */\n        $carry4 = $s4 >> 21;\n        $s5 += $carry4;\n        $s4 -= $carry4 << 21;\n        /** @var int $carry5 */\n        $carry5 = $s5 >> 21;\n        $s6 += $carry5;\n        $s5 -= $carry5 << 21;\n        /** @var int $carry6 */\n        $carry6 = $s6 >> 21;\n        $s7 += $carry6;\n        $s6 -= $carry6 << 21;\n        /** @var int $carry7 */\n        $carry7 = $s7 >> 21;\n        $s8 += $carry7;\n        $s7 -= $carry7 << 21;\n        /** @var int $carry8 */\n        $carry8 = $s8 >> 21;\n        $s9 += $carry8;\n        $s8 -= $carry8 << 21;\n        /** @var int $carry9 */\n        $carry9 = $s9 >> 21;\n        $s10 += $carry9;\n        $s9 -= $carry9 << 21;\n        /** @var int $carry10 */\n        $carry10 = $s10 >> 21;\n        $s11 += $carry10;\n        $s10 -= $carry10 << 21;\n\n        /**\n         * @var array<int, int>\n         */\n        $arr = array(\n            (int) (0xff & ($s0 >> 0)),\n            (int) (0xff & ($s0 >> 8)),\n            (int) (0xff & (($s0 >> 16) | $s1 << 5)),\n            (int) (0xff & ($s1 >> 3)),\n            (int) (0xff & ($s1 >> 11)),\n            (int) (0xff & (($s1 >> 19) | $s2 << 2)),\n            (int) (0xff & ($s2 >> 6)),\n            (int) (0xff & (($s2 >> 14) | $s3 << 7)),\n            (int) (0xff & ($s3 >> 1)),\n            (int) (0xff & ($s3 >> 9)),\n            (int) (0xff & (($s3 >> 17) | $s4 << 4)),\n            (int) (0xff & ($s4 >> 4)),\n            (int) (0xff & ($s4 >> 12)),\n            (int) (0xff & (($s4 >> 20) | $s5 << 1)),\n            (int) (0xff & ($s5 >> 7)),\n            (int) (0xff & (($s5 >> 15) | $s6 << 6)),\n            (int) (0xff & ($s6 >> 2)),\n            (int) (0xff & ($s6 >> 10)),\n            (int) (0xff & (($s6 >> 18) | $s7 << 3)),\n            (int) (0xff & ($s7 >> 5)),\n            (int) (0xff & ($s7 >> 13)),\n            (int) (0xff & ($s8 >> 0)),\n            (int) (0xff & ($s8 >> 8)),\n            (int) (0xff & (($s8 >> 16) | $s9 << 5)),\n            (int) (0xff & ($s9 >> 3)),\n            (int) (0xff & ($s9 >> 11)),\n            (int) (0xff & (($s9 >> 19) | $s10 << 2)),\n            (int) (0xff & ($s10 >> 6)),\n            (int) (0xff & (($s10 >> 14) | $s11 << 7)),\n            (int) (0xff & ($s11 >> 1)),\n            (int) (0xff & ($s11 >> 9)),\n            0xff & ($s11 >> 17)\n        );\n        return self::intArrayToString($arr);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $s\n     * @return string\n     * @throws TypeError\n     */\n    public static function sc_reduce($s)\n    {\n        /** @var int $s0 */\n        $s0 = 2097151 & self::load_3(self::substr($s, 0, 3));\n        /** @var int $s1 */\n        $s1 = 2097151 & (self::load_4(self::substr($s, 2, 4)) >> 5);\n        /** @var int $s2 */\n        $s2 = 2097151 & (self::load_3(self::substr($s, 5, 3)) >> 2);\n        /** @var int $s3 */\n        $s3 = 2097151 & (self::load_4(self::substr($s, 7, 4)) >> 7);\n        /** @var int $s4 */\n        $s4 = 2097151 & (self::load_4(self::substr($s, 10, 4)) >> 4);\n        /** @var int $s5 */\n        $s5 = 2097151 & (self::load_3(self::substr($s, 13, 3)) >> 1);\n        /** @var int $s6 */\n        $s6 = 2097151 & (self::load_4(self::substr($s, 15, 4)) >> 6);\n        /** @var int $s7 */\n        $s7 = 2097151 & (self::load_3(self::substr($s, 18, 4)) >> 3);\n        /** @var int $s8 */\n        $s8 = 2097151 & self::load_3(self::substr($s, 21, 3));\n        /** @var int $s9 */\n        $s9 = 2097151 & (self::load_4(self::substr($s, 23, 4)) >> 5);\n        /** @var int $s10 */\n        $s10 = 2097151 & (self::load_3(self::substr($s, 26, 3)) >> 2);\n        /** @var int $s11 */\n        $s11 = 2097151 & (self::load_4(self::substr($s, 28, 4)) >> 7);\n        /** @var int $s12 */\n        $s12 = 2097151 & (self::load_4(self::substr($s, 31, 4)) >> 4);\n        /** @var int $s13 */\n        $s13 = 2097151 & (self::load_3(self::substr($s, 34, 3)) >> 1);\n        /** @var int $s14 */\n        $s14 = 2097151 & (self::load_4(self::substr($s, 36, 4)) >> 6);\n        /** @var int $s15 */\n        $s15 = 2097151 & (self::load_3(self::substr($s, 39, 4)) >> 3);\n        /** @var int $s16 */\n        $s16 = 2097151 & self::load_3(self::substr($s, 42, 3));\n        /** @var int $s17 */\n        $s17 = 2097151 & (self::load_4(self::substr($s, 44, 4)) >> 5);\n        /** @var int $s18 */\n        $s18 = 2097151 & (self::load_3(self::substr($s, 47, 3)) >> 2);\n        /** @var int $s19 */\n        $s19 = 2097151 & (self::load_4(self::substr($s, 49, 4)) >> 7);\n        /** @var int $s20 */\n        $s20 = 2097151 & (self::load_4(self::substr($s, 52, 4)) >> 4);\n        /** @var int $s21 */\n        $s21 = 2097151 & (self::load_3(self::substr($s, 55, 3)) >> 1);\n        /** @var int $s22 */\n        $s22 = 2097151 & (self::load_4(self::substr($s, 57, 4)) >> 6);\n        /** @var int $s23 */\n        $s23 = (self::load_4(self::substr($s, 60, 4)) >> 3);\n\n        $s11 += self::mul($s23,  666643, 20);\n        $s12 += self::mul($s23,  470296, 19);\n        $s13 += self::mul($s23,  654183, 20);\n        $s14 -= self::mul($s23,  997805, 20);\n        $s15 += self::mul($s23,  136657, 18);\n        $s16 -= self::mul($s23,  683901, 20);\n\n        $s10 += self::mul($s22,  666643, 20);\n        $s11 += self::mul($s22,  470296, 19);\n        $s12 += self::mul($s22,  654183, 20);\n        $s13 -= self::mul($s22,  997805, 20);\n        $s14 += self::mul($s22,  136657, 18);\n        $s15 -= self::mul($s22,  683901, 20);\n\n        $s9  += self::mul($s21,  666643, 20);\n        $s10 += self::mul($s21,  470296, 19);\n        $s11 += self::mul($s21,  654183, 20);\n        $s12 -= self::mul($s21,  997805, 20);\n        $s13 += self::mul($s21,  136657, 18);\n        $s14 -= self::mul($s21,  683901, 20);\n\n        $s8  += self::mul($s20,  666643, 20);\n        $s9  += self::mul($s20,  470296, 19);\n        $s10 += self::mul($s20,  654183, 20);\n        $s11 -= self::mul($s20,  997805, 20);\n        $s12 += self::mul($s20,  136657, 18);\n        $s13 -= self::mul($s20,  683901, 20);\n\n        $s7  += self::mul($s19,  666643, 20);\n        $s8  += self::mul($s19,  470296, 19);\n        $s9  += self::mul($s19,  654183, 20);\n        $s10 -= self::mul($s19,  997805, 20);\n        $s11 += self::mul($s19,  136657, 18);\n        $s12 -= self::mul($s19,  683901, 20);\n\n        $s6  += self::mul($s18,  666643, 20);\n        $s7  += self::mul($s18,  470296, 19);\n        $s8  += self::mul($s18,  654183, 20);\n        $s9  -= self::mul($s18,  997805, 20);\n        $s10 += self::mul($s18,  136657, 18);\n        $s11 -= self::mul($s18,  683901, 20);\n\n        /** @var int $carry6 */\n        $carry6 = ($s6 + (1 << 20)) >> 21;\n        $s7 += $carry6;\n        $s6 -= $carry6 << 21;\n        /** @var int $carry8 */\n        $carry8 = ($s8 + (1 << 20)) >> 21;\n        $s9 += $carry8;\n        $s8 -= $carry8 << 21;\n        /** @var int $carry10 */\n        $carry10 = ($s10 + (1 << 20)) >> 21;\n        $s11 += $carry10;\n        $s10 -= $carry10 << 21;\n        /** @var int $carry12 */\n        $carry12 = ($s12 + (1 << 20)) >> 21;\n        $s13 += $carry12;\n        $s12 -= $carry12 << 21;\n        /** @var int $carry14 */\n        $carry14 = ($s14 + (1 << 20)) >> 21;\n        $s15 += $carry14;\n        $s14 -= $carry14 << 21;\n        /** @var int $carry16 */\n        $carry16 = ($s16 + (1 << 20)) >> 21;\n        $s17 += $carry16;\n        $s16 -= $carry16 << 21;\n\n        /** @var int $carry7 */\n        $carry7 = ($s7 + (1 << 20)) >> 21;\n        $s8 += $carry7;\n        $s7 -= $carry7 << 21;\n        /** @var int $carry9 */\n        $carry9 = ($s9 + (1 << 20)) >> 21;\n        $s10 += $carry9;\n        $s9 -= $carry9 << 21;\n        /** @var int $carry11 */\n        $carry11 = ($s11 + (1 << 20)) >> 21;\n        $s12 += $carry11;\n        $s11 -= $carry11 << 21;\n        /** @var int $carry13 */\n        $carry13 = ($s13 + (1 << 20)) >> 21;\n        $s14 += $carry13;\n        $s13 -= $carry13 << 21;\n        /** @var int $carry15 */\n        $carry15 = ($s15 + (1 << 20)) >> 21;\n        $s16 += $carry15;\n        $s15 -= $carry15 << 21;\n\n        $s5  += self::mul($s17,  666643, 20);\n        $s6  += self::mul($s17,  470296, 19);\n        $s7  += self::mul($s17,  654183, 20);\n        $s8  -= self::mul($s17,  997805, 20);\n        $s9  += self::mul($s17,  136657, 18);\n        $s10 -= self::mul($s17,  683901, 20);\n\n        $s4 += self::mul($s16,  666643, 20);\n        $s5 += self::mul($s16,  470296, 19);\n        $s6 += self::mul($s16,  654183, 20);\n        $s7 -= self::mul($s16,  997805, 20);\n        $s8 += self::mul($s16,  136657, 18);\n        $s9 -= self::mul($s16,  683901, 20);\n\n        $s3 += self::mul($s15,  666643, 20);\n        $s4 += self::mul($s15,  470296, 19);\n        $s5 += self::mul($s15,  654183, 20);\n        $s6 -= self::mul($s15,  997805, 20);\n        $s7 += self::mul($s15,  136657, 18);\n        $s8 -= self::mul($s15,  683901, 20);\n\n        $s2 += self::mul($s14,  666643, 20);\n        $s3 += self::mul($s14,  470296, 19);\n        $s4 += self::mul($s14,  654183, 20);\n        $s5 -= self::mul($s14,  997805, 20);\n        $s6 += self::mul($s14,  136657, 18);\n        $s7 -= self::mul($s14,  683901, 20);\n\n        $s1 += self::mul($s13,  666643, 20);\n        $s2 += self::mul($s13,  470296, 19);\n        $s3 += self::mul($s13,  654183, 20);\n        $s4 -= self::mul($s13,  997805, 20);\n        $s5 += self::mul($s13,  136657, 18);\n        $s6 -= self::mul($s13,  683901, 20);\n\n        $s0 += self::mul($s12,  666643, 20);\n        $s1 += self::mul($s12,  470296, 19);\n        $s2 += self::mul($s12,  654183, 20);\n        $s3 -= self::mul($s12,  997805, 20);\n        $s4 += self::mul($s12,  136657, 18);\n        $s5 -= self::mul($s12,  683901, 20);\n        $s12 = 0;\n\n        /** @var int $carry0 */\n        $carry0 = ($s0 + (1 << 20)) >> 21;\n        $s1 += $carry0;\n        $s0 -= $carry0 << 21;\n        /** @var int $carry2 */\n        $carry2 = ($s2 + (1 << 20)) >> 21;\n        $s3 += $carry2;\n        $s2 -= $carry2 << 21;\n        /** @var int $carry4 */\n        $carry4 = ($s4 + (1 << 20)) >> 21;\n        $s5 += $carry4;\n        $s4 -= $carry4 << 21;\n        /** @var int $carry6 */\n        $carry6 = ($s6 + (1 << 20)) >> 21;\n        $s7 += $carry6;\n        $s6 -= $carry6 << 21;\n        /** @var int $carry8 */\n        $carry8 = ($s8 + (1 << 20)) >> 21;\n        $s9 += $carry8;\n        $s8 -= $carry8 << 21;\n        /** @var int $carry10 */\n        $carry10 = ($s10 + (1 << 20)) >> 21;\n        $s11 += $carry10;\n        $s10 -= $carry10 << 21;\n\n        /** @var int $carry1 */\n        $carry1 = ($s1 + (1 << 20)) >> 21;\n        $s2 += $carry1;\n        $s1 -= $carry1 << 21;\n        /** @var int $carry3 */\n        $carry3 = ($s3 + (1 << 20)) >> 21;\n        $s4 += $carry3;\n        $s3 -= $carry3 << 21;\n        /** @var int $carry5 */\n        $carry5 = ($s5 + (1 << 20)) >> 21;\n        $s6 += $carry5;\n        $s5 -= $carry5 << 21;\n        /** @var int $carry7 */\n        $carry7 = ($s7 + (1 << 20)) >> 21;\n        $s8 += $carry7;\n        $s7 -= $carry7 << 21;\n        /** @var int $carry9 */\n        $carry9 = ($s9 + (1 << 20)) >> 21;\n        $s10 += $carry9;\n        $s9 -= $carry9 << 21;\n        /** @var int $carry11 */\n        $carry11 = ($s11 + (1 << 20)) >> 21;\n        $s12 += $carry11;\n        $s11 -= $carry11 << 21;\n\n        $s0 += self::mul($s12,  666643, 20);\n        $s1 += self::mul($s12,  470296, 19);\n        $s2 += self::mul($s12,  654183, 20);\n        $s3 -= self::mul($s12,  997805, 20);\n        $s4 += self::mul($s12,  136657, 18);\n        $s5 -= self::mul($s12,  683901, 20);\n        $s12 = 0;\n\n        /** @var int $carry0 */\n        $carry0 = $s0 >> 21;\n        $s1 += $carry0;\n        $s0 -= $carry0 << 21;\n        /** @var int $carry1 */\n        $carry1 = $s1 >> 21;\n        $s2 += $carry1;\n        $s1 -= $carry1 << 21;\n        /** @var int $carry2 */\n        $carry2 = $s2 >> 21;\n        $s3 += $carry2;\n        $s2 -= $carry2 << 21;\n        /** @var int $carry3 */\n        $carry3 = $s3 >> 21;\n        $s4 += $carry3;\n        $s3 -= $carry3 << 21;\n        /** @var int $carry4 */\n        $carry4 = $s4 >> 21;\n        $s5 += $carry4;\n        $s4 -= $carry4 << 21;\n        /** @var int $carry5 */\n        $carry5 = $s5 >> 21;\n        $s6 += $carry5;\n        $s5 -= $carry5 << 21;\n        /** @var int $carry6 */\n        $carry6 = $s6 >> 21;\n        $s7 += $carry6;\n        $s6 -= $carry6 << 21;\n        /** @var int $carry7 */\n        $carry7 = $s7 >> 21;\n        $s8 += $carry7;\n        $s7 -= $carry7 << 21;\n        /** @var int $carry8 */\n        $carry8 = $s8 >> 21;\n        $s9 += $carry8;\n        $s8 -= $carry8 << 21;\n        /** @var int $carry9 */\n        $carry9 = $s9 >> 21;\n        $s10 += $carry9;\n        $s9 -= $carry9 << 21;\n        /** @var int $carry10 */\n        $carry10 = $s10 >> 21;\n        $s11 += $carry10;\n        $s10 -= $carry10 << 21;\n        /** @var int $carry11 */\n        $carry11 = $s11 >> 21;\n        $s12 += $carry11;\n        $s11 -= $carry11 << 21;\n\n        $s0 += self::mul($s12,  666643, 20);\n        $s1 += self::mul($s12,  470296, 19);\n        $s2 += self::mul($s12,  654183, 20);\n        $s3 -= self::mul($s12,  997805, 20);\n        $s4 += self::mul($s12,  136657, 18);\n        $s5 -= self::mul($s12,  683901, 20);\n\n        /** @var int $carry0 */\n        $carry0 = $s0 >> 21;\n        $s1 += $carry0;\n        $s0 -= $carry0 << 21;\n        /** @var int $carry1 */\n        $carry1 = $s1 >> 21;\n        $s2 += $carry1;\n        $s1 -= $carry1 << 21;\n        /** @var int $carry2 */\n        $carry2 = $s2 >> 21;\n        $s3 += $carry2;\n        $s2 -= $carry2 << 21;\n        /** @var int $carry3 */\n        $carry3 = $s3 >> 21;\n        $s4 += $carry3;\n        $s3 -= $carry3 << 21;\n        /** @var int $carry4 */\n        $carry4 = $s4 >> 21;\n        $s5 += $carry4;\n        $s4 -= $carry4 << 21;\n        /** @var int $carry5 */\n        $carry5 = $s5 >> 21;\n        $s6 += $carry5;\n        $s5 -= $carry5 << 21;\n        /** @var int $carry6 */\n        $carry6 = $s6 >> 21;\n        $s7 += $carry6;\n        $s6 -= $carry6 << 21;\n        /** @var int $carry7 */\n        $carry7 = $s7 >> 21;\n        $s8 += $carry7;\n        $s7 -= $carry7 << 21;\n        /** @var int $carry8 */\n        $carry8 = $s8 >> 21;\n        $s9 += $carry8;\n        $s8 -= $carry8 << 21;\n        /** @var int $carry9 */\n        $carry9 = $s9 >> 21;\n        $s10 += $carry9;\n        $s9 -= $carry9 << 21;\n        /** @var int $carry10 */\n        $carry10 = $s10 >> 21;\n        $s11 += $carry10;\n        $s10 -= $carry10 << 21;\n\n        /**\n         * @var array<int, int>\n         */\n        $arr = array(\n            (int) ($s0 >> 0),\n            (int) ($s0 >> 8),\n            (int) (($s0 >> 16) | $s1 << 5),\n            (int) ($s1 >> 3),\n            (int) ($s1 >> 11),\n            (int) (($s1 >> 19) | $s2 << 2),\n            (int) ($s2 >> 6),\n            (int) (($s2 >> 14) | $s3 << 7),\n            (int) ($s3 >> 1),\n            (int) ($s3 >> 9),\n            (int) (($s3 >> 17) | $s4 << 4),\n            (int) ($s4 >> 4),\n            (int) ($s4 >> 12),\n            (int) (($s4 >> 20) | $s5 << 1),\n            (int) ($s5 >> 7),\n            (int) (($s5 >> 15) | $s6 << 6),\n            (int) ($s6 >> 2),\n            (int) ($s6 >> 10),\n            (int) (($s6 >> 18) | $s7 << 3),\n            (int) ($s7 >> 5),\n            (int) ($s7 >> 13),\n            (int) ($s8 >> 0),\n            (int) ($s8 >> 8),\n            (int) (($s8 >> 16) | $s9 << 5),\n            (int) ($s9 >> 3),\n            (int) ($s9 >> 11),\n            (int) (($s9 >> 19) | $s10 << 2),\n            (int) ($s10 >> 6),\n            (int) (($s10 >> 14) | $s11 << 7),\n            (int) ($s11 >> 1),\n            (int) ($s11 >> 9),\n            (int) $s11 >> 17\n        );\n        return self::intArrayToString($arr);\n    }\n\n    /**\n     * multiply by the order of the main subgroup l = 2^252+27742317777372353535851937790883648493\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A\n     * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3\n     */\n    public static function ge_mul_l(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A)\n    {\n        /** @var array<int, int> $aslide */\n        $aslide = array(\n            13, 0, 0, 0, 0, -1, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0,\n            0, 0, 0, -3, 0, 0, 0, 0, -13, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 3, 0,\n            0, 0, 0, -13, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0,\n            0, 0, 11, 0, 0, 0, 0, -13, 0, 0, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, -1,\n            0, 0, 0, 0, 3, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0,\n            0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 5, 0, 0, 0, 0,\n            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1\n        );\n\n        /** @var array<int, ParagonIE_Sodium_Core_Curve25519_Ge_Cached> $Ai size 8 */\n        $Ai = array();\n\n        # ge_p3_to_cached(&Ai[0], A);\n        $Ai[0] = self::ge_p3_to_cached($A);\n        # ge_p3_dbl(&t, A);\n        $t = self::ge_p3_dbl($A);\n        # ge_p1p1_to_p3(&A2, &t);\n        $A2 = self::ge_p1p1_to_p3($t);\n\n        for ($i = 1; $i < 8; ++$i) {\n            # ge_add(&t, &A2, &Ai[0]);\n            $t = self::ge_add($A2, $Ai[$i - 1]);\n            # ge_p1p1_to_p3(&u, &t);\n            $u = self::ge_p1p1_to_p3($t);\n            # ge_p3_to_cached(&Ai[i], &u);\n            $Ai[$i] = self::ge_p3_to_cached($u);\n        }\n\n        $r = self::ge_p3_0();\n        for ($i = 252; $i >= 0; --$i) {\n            $t = self::ge_p3_dbl($r);\n            if ($aslide[$i] > 0) {\n                # ge_p1p1_to_p3(&u, &t);\n                $u = self::ge_p1p1_to_p3($t);\n                # ge_add(&t, &u, &Ai[aslide[i] / 2]);\n                $t = self::ge_add($u, $Ai[(int)($aslide[$i] / 2)]);\n            } elseif ($aslide[$i] < 0) {\n                # ge_p1p1_to_p3(&u, &t);\n                $u = self::ge_p1p1_to_p3($t);\n                # ge_sub(&t, &u, &Ai[(-aslide[i]) / 2]);\n                $t = self::ge_sub($u, $Ai[(int)(-$aslide[$i] / 2)]);\n            }\n        }\n\n        # ge_p1p1_to_p3(r, &t);\n        return self::ge_p1p1_to_p3($t);\n    }\n}\n", "num_lines": 3003}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_Ed25519', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_Ed25519\n */\nabstract class ParagonIE_Sodium_Core_Ed25519 extends ParagonIE_Sodium_Core_Curve25519\n{\n    const KEYPAIR_BYTES = 96;\n    const SEED_BYTES = 32;\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @return string (96 bytes)\n     * @throws Exception\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function keypair()\n    {\n        $seed = random_bytes(self::SEED_BYTES);\n        $pk = '';\n        $sk = '';\n        self::seed_keypair($pk, $sk, $seed);\n        return $sk . $pk;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $pk\n     * @param string $sk\n     * @param string $seed\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function seed_keypair(&$pk, &$sk, $seed)\n    {\n        if (self::strlen($seed) !== self::SEED_BYTES) {\n            throw new RangeException('crypto_sign keypair seed must be 32 bytes long');\n        }\n\n        /** @var string $pk */\n        $pk = self::publickey_from_secretkey($seed);\n        $sk = $seed . $pk;\n        return $sk;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $keypair\n     * @return string\n     * @throws TypeError\n     */\n    public static function secretkey($keypair)\n    {\n        if (self::strlen($keypair) !== self::KEYPAIR_BYTES) {\n            throw new RangeException('crypto_sign keypair must be 96 bytes long');\n        }\n        return self::substr($keypair, 0, 64);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $keypair\n     * @return string\n     * @throws TypeError\n     */\n    public static function publickey($keypair)\n    {\n        if (self::strlen($keypair) !== self::KEYPAIR_BYTES) {\n            throw new RangeException('crypto_sign keypair must be 96 bytes long');\n        }\n        return self::substr($keypair, 64, 32);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function publickey_from_secretkey($sk)\n    {\n        /** @var string $sk */\n        $sk = hash('sha512', self::substr($sk, 0, 32), true);\n        $sk[0] = self::intToChr(\n            self::chrToInt($sk[0]) & 248\n        );\n        $sk[31] = self::intToChr(\n            (self::chrToInt($sk[31]) & 63) | 64\n        );\n        return self::sk_to_pk($sk);\n    }\n\n    /**\n     * @param string $pk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function pk_to_curve25519($pk)\n    {\n        if (self::small_order($pk)) {\n            throw new SodiumException('Public key is on a small order');\n        }\n        $A = self::ge_frombytes_negate_vartime(self::substr($pk, 0, 32));\n        $p1 = self::ge_mul_l($A);\n        if (!self::fe_isnonzero($p1->X)) {\n            throw new SodiumException('Unexpected zero result');\n        }\n\n        # fe_1(one_minus_y);\n        # fe_sub(one_minus_y, one_minus_y, A.Y);\n        # fe_invert(one_minus_y, one_minus_y);\n        $one_minux_y = self::fe_invert(\n            self::fe_sub(\n                self::fe_1(),\n                $A->Y\n            )\n        );\n\n        # fe_1(x);\n        # fe_add(x, x, A.Y);\n        # fe_mul(x, x, one_minus_y);\n        $x = self::fe_mul(\n            self::fe_add(self::fe_1(), $A->Y),\n            $one_minux_y\n        );\n\n        # fe_tobytes(curve25519_pk, x);\n        return self::fe_tobytes($x);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sk_to_pk($sk)\n    {\n        return self::ge_p3_tobytes(\n            self::ge_scalarmult_base(\n                self::substr($sk, 0, 32)\n            )\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sign($message, $sk)\n    {\n        /** @var string $signature */\n        $signature = self::sign_detached($message, $sk);\n        return $signature . $message;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message A signed message\n     * @param string $pk      Public key\n     * @return string         Message (without signature)\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sign_open($message, $pk)\n    {\n        /** @var string $signature */\n        $signature = self::substr($message, 0, 64);\n\n        /** @var string $message */\n        $message = self::substr($message, 64);\n\n        if (self::verify_detached($signature, $message, $pk)) {\n            return $message;\n        }\n        throw new SodiumException('Invalid signature');\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sign_detached($message, $sk)\n    {\n        # crypto_hash_sha512(az, sk, 32);\n        $az =  hash('sha512', self::substr($sk, 0, 32), true);\n\n        # az[0] &= 248;\n        # az[31] &= 63;\n        # az[31] |= 64;\n        $az[0] = self::intToChr(self::chrToInt($az[0]) & 248);\n        $az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64);\n\n        # crypto_hash_sha512_init(&hs);\n        # crypto_hash_sha512_update(&hs, az + 32, 32);\n        # crypto_hash_sha512_update(&hs, m, mlen);\n        # crypto_hash_sha512_final(&hs, nonce);\n        $hs = hash_init('sha512');\n        hash_update($hs, self::substr($az, 32, 32));\n        hash_update($hs, $message);\n        $nonceHash = hash_final($hs, true);\n\n        # memmove(sig + 32, sk + 32, 32);\n        $pk = self::substr($sk, 32, 32);\n\n        # sc_reduce(nonce);\n        # ge_scalarmult_base(&R, nonce);\n        # ge_p3_tobytes(sig, &R);\n        $nonce = self::sc_reduce($nonceHash) . self::substr($nonceHash, 32);\n        $sig = self::ge_p3_tobytes(\n            self::ge_scalarmult_base($nonce)\n        );\n\n        # crypto_hash_sha512_init(&hs);\n        # crypto_hash_sha512_update(&hs, sig, 64);\n        # crypto_hash_sha512_update(&hs, m, mlen);\n        # crypto_hash_sha512_final(&hs, hram);\n        $hs = hash_init('sha512');\n        hash_update($hs, self::substr($sig, 0, 32));\n        hash_update($hs, self::substr($pk, 0, 32));\n        hash_update($hs, $message);\n        $hramHash = hash_final($hs, true);\n\n        # sc_reduce(hram);\n        # sc_muladd(sig + 32, hram, az, nonce);\n        $hram = self::sc_reduce($hramHash);\n        $sigAfter = self::sc_muladd($hram, $az, $nonce);\n        $sig = self::substr($sig, 0, 32) . self::substr($sigAfter, 0, 32);\n\n        try {\n            ParagonIE_Sodium_Compat::memzero($az);\n        } catch (SodiumException $ex) {\n            $az = null;\n        }\n        return $sig;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $sig\n     * @param string $message\n     * @param string $pk\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function verify_detached($sig, $message, $pk)\n    {\n        if (self::strlen($sig) < 64) {\n            throw new SodiumException('Signature is too short');\n        }\n        if ((self::chrToInt($sig[63]) & 240) && self::check_S_lt_L(self::substr($sig, 32, 32))) {\n            throw new SodiumException('S < L - Invalid signature');\n        }\n        if (self::small_order($sig)) {\n            throw new SodiumException('Signature is on too small of an order');\n        }\n        if ((self::chrToInt($sig[63]) & 224) !== 0) {\n            throw new SodiumException('Invalid signature');\n        }\n        $d = 0;\n        for ($i = 0; $i < 32; ++$i) {\n            $d |= self::chrToInt($pk[$i]);\n        }\n        if ($d === 0) {\n            throw new SodiumException('All zero public key');\n        }\n\n        /** @var bool The original value of ParagonIE_Sodium_Compat::$fastMult */\n        $orig = ParagonIE_Sodium_Compat::$fastMult;\n\n        // Set ParagonIE_Sodium_Compat::$fastMult to true to speed up verification.\n        ParagonIE_Sodium_Compat::$fastMult = true;\n\n        /** @var ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A */\n        $A = self::ge_frombytes_negate_vartime($pk);\n\n        /** @var string $hDigest */\n        $hDigest = hash(\n            'sha512',\n            self::substr($sig, 0, 32) .\n                self::substr($pk, 0, 32) .\n                $message,\n            true\n        );\n\n        /** @var string $h */\n        $h = self::sc_reduce($hDigest) . self::substr($hDigest, 32);\n\n        /** @var ParagonIE_Sodium_Core_Curve25519_Ge_P2 $R */\n        $R = self::ge_double_scalarmult_vartime(\n            $h,\n            $A,\n            self::substr($sig, 32)\n        );\n\n        /** @var string $rcheck */\n        $rcheck = self::ge_tobytes($R);\n\n        // Reset ParagonIE_Sodium_Compat::$fastMult to what it was before.\n        ParagonIE_Sodium_Compat::$fastMult = $orig;\n\n        return self::verify_32($rcheck, self::substr($sig, 0, 32));\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $S\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function check_S_lt_L($S)\n    {\n        if (self::strlen($S) < 32) {\n            throw new SodiumException('Signature must be 32 bytes');\n        }\n        $L = array(\n            0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58,\n            0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10\n        );\n        $c = 0;\n        $n = 1;\n        $i = 32;\n\n        /** @var array<int, int> $L */\n        do {\n            --$i;\n            $x = self::chrToInt($S[$i]);\n            $c |= (\n                (($x - $L[$i]) >> 8) & $n\n            );\n            $n &= (\n                (($x ^ $L[$i]) - 1) >> 8\n            );\n        } while ($i !== 0);\n\n        return $c === 0;\n    }\n\n    /**\n     * @param string $R\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function small_order($R)\n    {\n        /** @var array<int, array<int, int>> $blocklist */\n        $blocklist = array(\n            /* 0 (order 4) */\n            array(\n                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n            ),\n            /* 1 (order 1) */\n            array(\n                0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n            ),\n            /* 2707385501144840649318225287225658788936804267575313519463743609750303402022 (order 8) */\n            array(\n                0x26, 0xe8, 0x95, 0x8f, 0xc2, 0xb2, 0x27, 0xb0,\n                0x45, 0xc3, 0xf4, 0x89, 0xf2, 0xef, 0x98, 0xf0,\n                0xd5, 0xdf, 0xac, 0x05, 0xd3, 0xc6, 0x33, 0x39,\n                0xb1, 0x38, 0x02, 0x88, 0x6d, 0x53, 0xfc, 0x05\n            ),\n            /* 55188659117513257062467267217118295137698188065244968500265048394206261417927 (order 8) */\n            array(\n                0xc7, 0x17, 0x6a, 0x70, 0x3d, 0x4d, 0xd8, 0x4f,\n                0xba, 0x3c, 0x0b, 0x76, 0x0d, 0x10, 0x67, 0x0f,\n                0x2a, 0x20, 0x53, 0xfa, 0x2c, 0x39, 0xcc, 0xc6,\n                0x4e, 0xc7, 0xfd, 0x77, 0x92, 0xac, 0x03, 0x7a\n            ),\n            /* p-1 (order 2) */\n            array(\n                0x13, 0xe8, 0x95, 0x8f, 0xc2, 0xb2, 0x27, 0xb0,\n                0x45, 0xc3, 0xf4, 0x89, 0xf2, 0xef, 0x98, 0xf0,\n                0xd5, 0xdf, 0xac, 0x05, 0xd3, 0xc6, 0x33, 0x39,\n                0xb1, 0x38, 0x02, 0x88, 0x6d, 0x53, 0xfc, 0x85\n            ),\n            /* p (order 4) */\n            array(\n                0xb4, 0x17, 0x6a, 0x70, 0x3d, 0x4d, 0xd8, 0x4f,\n                0xba, 0x3c, 0x0b, 0x76, 0x0d, 0x10, 0x67, 0x0f,\n                0x2a, 0x20, 0x53, 0xfa, 0x2c, 0x39, 0xcc, 0xc6,\n                0x4e, 0xc7, 0xfd, 0x77, 0x92, 0xac, 0x03, 0xfa\n            ),\n            /* p+1 (order 1) */\n            array(\n                0xec, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f\n            ),\n            /* p+2707385501144840649318225287225658788936804267575313519463743609750303402022 (order 8) */\n            array(\n                0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f\n            ),\n            /* p+55188659117513257062467267217118295137698188065244968500265048394206261417927 (order 8) */\n            array(\n                0xee, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f\n            ),\n            /* 2p-1 (order 2) */\n            array(\n                0xd9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff\n            ),\n            /* 2p (order 4) */\n            array(\n                0xda, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff\n            ),\n            /* 2p+1 (order 1) */\n            array(\n                0xdb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff\n            )\n        );\n        /** @var int $countBlocklist */\n        $countBlocklist = count($blocklist);\n\n        for ($i = 0; $i < $countBlocklist; ++$i) {\n            $c = 0;\n            for ($j = 0; $j < 32; ++$j) {\n                $c |= self::chrToInt($R[$j]) ^ (int) $blocklist[$i][$j];\n            }\n            if ($c === 0) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n", "num_lines": 481}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_HChaCha20', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_HChaCha20\n */\nclass ParagonIE_Sodium_Core_HChaCha20 extends ParagonIE_Sodium_Core_ChaCha20\n{\n    /**\n     * @param string $in\n     * @param string $key\n     * @param string|null $c\n     * @return string\n     * @throws TypeError\n     */\n    public static function hChaCha20($in = '', $key = '', $c = null)\n    {\n        $ctx = array();\n\n        if ($c === null) {\n            $ctx[0] = 0x61707865;\n            $ctx[1] = 0x3320646e;\n            $ctx[2] = 0x79622d32;\n            $ctx[3] = 0x6b206574;\n        } else {\n            $ctx[0] = self::load_4(self::substr($c,  0, 4));\n            $ctx[1] = self::load_4(self::substr($c,  4, 4));\n            $ctx[2] = self::load_4(self::substr($c,  8, 4));\n            $ctx[3] = self::load_4(self::substr($c, 12, 4));\n        }\n        $ctx[4]  = self::load_4(self::substr($key,  0, 4));\n        $ctx[5]  = self::load_4(self::substr($key,  4, 4));\n        $ctx[6]  = self::load_4(self::substr($key,  8, 4));\n        $ctx[7]  = self::load_4(self::substr($key, 12, 4));\n        $ctx[8]  = self::load_4(self::substr($key, 16, 4));\n        $ctx[9]  = self::load_4(self::substr($key, 20, 4));\n        $ctx[10] = self::load_4(self::substr($key, 24, 4));\n        $ctx[11] = self::load_4(self::substr($key, 28, 4));\n        $ctx[12] = self::load_4(self::substr($in,   0, 4));\n        $ctx[13] = self::load_4(self::substr($in,   4, 4));\n        $ctx[14] = self::load_4(self::substr($in,   8, 4));\n        $ctx[15] = self::load_4(self::substr($in,  12, 4));\n        return self::hChaCha20Bytes($ctx);\n    }\n\n    /**\n     * @param array $ctx\n     * @return string\n     * @throws TypeError\n     */\n    protected static function hChaCha20Bytes(array $ctx)\n    {\n        $x0  = (int) $ctx[0];\n        $x1  = (int) $ctx[1];\n        $x2  = (int) $ctx[2];\n        $x3  = (int) $ctx[3];\n        $x4  = (int) $ctx[4];\n        $x5  = (int) $ctx[5];\n        $x6  = (int) $ctx[6];\n        $x7  = (int) $ctx[7];\n        $x8  = (int) $ctx[8];\n        $x9  = (int) $ctx[9];\n        $x10 = (int) $ctx[10];\n        $x11 = (int) $ctx[11];\n        $x12 = (int) $ctx[12];\n        $x13 = (int) $ctx[13];\n        $x14 = (int) $ctx[14];\n        $x15 = (int) $ctx[15];\n\n        for ($i = 0; $i < 10; ++$i) {\n            # QUARTERROUND( x0,  x4,  x8,  x12)\n            list($x0, $x4, $x8, $x12) = self::quarterRound($x0, $x4, $x8, $x12);\n\n            # QUARTERROUND( x1,  x5,  x9,  x13)\n            list($x1, $x5, $x9, $x13) = self::quarterRound($x1, $x5, $x9, $x13);\n\n            # QUARTERROUND( x2,  x6,  x10,  x14)\n            list($x2, $x6, $x10, $x14) = self::quarterRound($x2, $x6, $x10, $x14);\n\n            # QUARTERROUND( x3,  x7,  x11,  x15)\n            list($x3, $x7, $x11, $x15) = self::quarterRound($x3, $x7, $x11, $x15);\n\n            # QUARTERROUND( x0,  x5,  x10,  x15)\n            list($x0, $x5, $x10, $x15) = self::quarterRound($x0, $x5, $x10, $x15);\n\n            # QUARTERROUND( x1,  x6,  x11,  x12)\n            list($x1, $x6, $x11, $x12) = self::quarterRound($x1, $x6, $x11, $x12);\n\n            # QUARTERROUND( x2,  x7,  x8,  x13)\n            list($x2, $x7, $x8, $x13) = self::quarterRound($x2, $x7, $x8, $x13);\n\n            # QUARTERROUND( x3,  x4,  x9,  x14)\n            list($x3, $x4, $x9, $x14) = self::quarterRound($x3, $x4, $x9, $x14);\n        }\n\n        return self::store32_le((int) ($x0  & 0xffffffff)) .\n            self::store32_le((int) ($x1  & 0xffffffff)) .\n            self::store32_le((int) ($x2  & 0xffffffff)) .\n            self::store32_le((int) ($x3  & 0xffffffff)) .\n            self::store32_le((int) ($x12 & 0xffffffff)) .\n            self::store32_le((int) ($x13 & 0xffffffff)) .\n            self::store32_le((int) ($x14 & 0xffffffff)) .\n            self::store32_le((int) ($x15 & 0xffffffff));\n    }\n}\n", "num_lines": 109}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_HSalsa20', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_HSalsa20\n */\nabstract class ParagonIE_Sodium_Core_HSalsa20 extends ParagonIE_Sodium_Core_Salsa20\n{\n    /**\n     * Calculate an hsalsa20 hash of a single block\n     *\n     * HSalsa20 doesn't have a counter and will never be used for more than\n     * one block (used to derive a subkey for xsalsa20).\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $in\n     * @param string $k\n     * @param string|null $c\n     * @return string\n     * @throws TypeError\n     */\n    public static function hsalsa20($in, $k, $c = null)\n    {\n        if ($c === null) {\n            $x0  = 0x61707865;\n            $x5  = 0x3320646e;\n            $x10 = 0x79622d32;\n            $x15 = 0x6b206574;\n        } else {\n            $x0  = self::load_4(self::substr($c, 0, 4));\n            $x5  = self::load_4(self::substr($c, 4, 4));\n            $x10 = self::load_4(self::substr($c, 8, 4));\n            $x15 = self::load_4(self::substr($c, 12, 4));\n        }\n        $x1  = self::load_4(self::substr($k, 0, 4));\n        $x2  = self::load_4(self::substr($k, 4, 4));\n        $x3  = self::load_4(self::substr($k, 8, 4));\n        $x4  = self::load_4(self::substr($k, 12, 4));\n        $x11 = self::load_4(self::substr($k, 16, 4));\n        $x12 = self::load_4(self::substr($k, 20, 4));\n        $x13 = self::load_4(self::substr($k, 24, 4));\n        $x14 = self::load_4(self::substr($k, 28, 4));\n        $x6  = self::load_4(self::substr($in, 0, 4));\n        $x7  = self::load_4(self::substr($in, 4, 4));\n        $x8  = self::load_4(self::substr($in, 8, 4));\n        $x9  = self::load_4(self::substr($in, 12, 4));\n\n        for ($i = self::ROUNDS; $i > 0; $i -= 2) {\n            $x4 ^= self::rotate($x0 + $x12, 7);\n            $x8 ^= self::rotate($x4 + $x0, 9);\n            $x12 ^= self::rotate($x8 + $x4, 13);\n            $x0 ^= self::rotate($x12 + $x8, 18);\n            $x9 ^= self::rotate($x5 + $x1, 7);\n            $x13 ^= self::rotate($x9 + $x5, 9);\n            $x1 ^= self::rotate($x13 + $x9, 13);\n            $x5 ^= self::rotate($x1 + $x13, 18);\n            $x14 ^= self::rotate($x10 + $x6, 7);\n            $x2 ^= self::rotate($x14 + $x10, 9);\n            $x6 ^= self::rotate($x2 + $x14, 13);\n            $x10 ^= self::rotate($x6 + $x2, 18);\n            $x3 ^= self::rotate($x15 + $x11, 7);\n            $x7 ^= self::rotate($x3 + $x15, 9);\n            $x11 ^= self::rotate($x7 + $x3, 13);\n            $x15 ^= self::rotate($x11 + $x7, 18);\n            $x1 ^= self::rotate($x0 + $x3, 7);\n            $x2 ^= self::rotate($x1 + $x0, 9);\n            $x3 ^= self::rotate($x2 + $x1, 13);\n            $x0 ^= self::rotate($x3 + $x2, 18);\n            $x6 ^= self::rotate($x5 + $x4, 7);\n            $x7 ^= self::rotate($x6 + $x5, 9);\n            $x4 ^= self::rotate($x7 + $x6, 13);\n            $x5 ^= self::rotate($x4 + $x7, 18);\n            $x11 ^= self::rotate($x10 + $x9, 7);\n            $x8 ^= self::rotate($x11 + $x10, 9);\n            $x9 ^= self::rotate($x8 + $x11, 13);\n            $x10 ^= self::rotate($x9 + $x8, 18);\n            $x12 ^= self::rotate($x15 + $x14, 7);\n            $x13 ^= self::rotate($x12 + $x15, 9);\n            $x14 ^= self::rotate($x13 + $x12, 13);\n            $x15 ^= self::rotate($x14 + $x13, 18);\n        }\n\n        return self::store32_le($x0) .\n            self::store32_le($x5) .\n            self::store32_le($x10) .\n            self::store32_le($x15) .\n            self::store32_le($x6) .\n            self::store32_le($x7) .\n            self::store32_le($x8) .\n            self::store32_le($x9);\n    }\n}\n", "num_lines": 97}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_Poly1305', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_Poly1305\n */\nabstract class ParagonIE_Sodium_Core_Poly1305 extends ParagonIE_Sodium_Core_Util\n{\n    const BLOCK_SIZE = 16;\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $m\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function onetimeauth($m, $key)\n    {\n        if (self::strlen($key) < 32) {\n            throw new InvalidArgumentException(\n                'Key must be 32 bytes long.'\n            );\n        }\n        $state = new ParagonIE_Sodium_Core_Poly1305_State(\n            self::substr($key, 0, 32)\n        );\n        return $state\n            ->update($m)\n            ->finish();\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $mac\n     * @param string $m\n     * @param string $key\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function onetimeauth_verify($mac, $m, $key)\n    {\n        if (self::strlen($key) < 32) {\n            throw new InvalidArgumentException(\n                'Key must be 32 bytes long.'\n            );\n        }\n        $state = new ParagonIE_Sodium_Core_Poly1305_State(\n            self::substr($key, 0, 32)\n        );\n        $calc = $state\n            ->update($m)\n            ->finish();\n        return self::verify_16($calc, $mac);\n    }\n}\n", "num_lines": 64}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_Salsa20', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_Salsa20\n */\nabstract class ParagonIE_Sodium_Core_Salsa20 extends ParagonIE_Sodium_Core_Util\n{\n    const ROUNDS = 20;\n\n    /**\n     * Calculate an salsa20 hash of a single block\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $in\n     * @param string $k\n     * @param string|null $c\n     * @return string\n     * @throws TypeError\n     */\n    public static function core_salsa20($in, $k, $c = null)\n    {\n        if (self::strlen($k) < 32) {\n            throw new RangeException('Key must be 32 bytes long');\n        }\n        if ($c === null) {\n            $j0  = $x0  = 0x61707865;\n            $j5  = $x5  = 0x3320646e;\n            $j10 = $x10 = 0x79622d32;\n            $j15 = $x15 = 0x6b206574;\n        } else {\n            $j0  = $x0  = self::load_4(self::substr($c, 0, 4));\n            $j5  = $x5  = self::load_4(self::substr($c, 4, 4));\n            $j10 = $x10 = self::load_4(self::substr($c, 8, 4));\n            $j15 = $x15 = self::load_4(self::substr($c, 12, 4));\n        }\n        $j1  = $x1  = self::load_4(self::substr($k, 0, 4));\n        $j2  = $x2  = self::load_4(self::substr($k, 4, 4));\n        $j3  = $x3  = self::load_4(self::substr($k, 8, 4));\n        $j4  = $x4  = self::load_4(self::substr($k, 12, 4));\n        $j6  = $x6  = self::load_4(self::substr($in, 0, 4));\n        $j7  = $x7  = self::load_4(self::substr($in, 4, 4));\n        $j8  = $x8  = self::load_4(self::substr($in, 8, 4));\n        $j9  = $x9  = self::load_4(self::substr($in, 12, 4));\n        $j11 = $x11 = self::load_4(self::substr($k, 16, 4));\n        $j12 = $x12 = self::load_4(self::substr($k, 20, 4));\n        $j13 = $x13 = self::load_4(self::substr($k, 24, 4));\n        $j14 = $x14 = self::load_4(self::substr($k, 28, 4));\n\n        for ($i = self::ROUNDS; $i > 0; $i -= 2) {\n            $x4 ^= self::rotate($x0 + $x12, 7);\n            $x8 ^= self::rotate($x4 + $x0, 9);\n            $x12 ^= self::rotate($x8 + $x4, 13);\n            $x0 ^= self::rotate($x12 + $x8, 18);\n\n            $x9 ^= self::rotate($x5 + $x1, 7);\n            $x13 ^= self::rotate($x9 + $x5, 9);\n            $x1 ^= self::rotate($x13 + $x9, 13);\n            $x5 ^= self::rotate($x1 + $x13, 18);\n\n            $x14 ^= self::rotate($x10 + $x6, 7);\n            $x2 ^= self::rotate($x14 + $x10, 9);\n            $x6 ^= self::rotate($x2 + $x14, 13);\n            $x10 ^= self::rotate($x6 + $x2, 18);\n\n            $x3 ^= self::rotate($x15 + $x11, 7);\n            $x7 ^= self::rotate($x3 + $x15, 9);\n            $x11 ^= self::rotate($x7 + $x3, 13);\n            $x15 ^= self::rotate($x11 + $x7, 18);\n\n            $x1 ^= self::rotate($x0 + $x3, 7);\n            $x2 ^= self::rotate($x1 + $x0, 9);\n            $x3 ^= self::rotate($x2 + $x1, 13);\n            $x0 ^= self::rotate($x3 + $x2, 18);\n\n            $x6 ^= self::rotate($x5 + $x4, 7);\n            $x7 ^= self::rotate($x6 + $x5, 9);\n            $x4 ^= self::rotate($x7 + $x6, 13);\n            $x5 ^= self::rotate($x4 + $x7, 18);\n\n            $x11 ^= self::rotate($x10 + $x9, 7);\n            $x8 ^= self::rotate($x11 + $x10, 9);\n            $x9 ^= self::rotate($x8 + $x11, 13);\n            $x10 ^= self::rotate($x9 + $x8, 18);\n\n            $x12 ^= self::rotate($x15 + $x14, 7);\n            $x13 ^= self::rotate($x12 + $x15, 9);\n            $x14 ^= self::rotate($x13 + $x12, 13);\n            $x15 ^= self::rotate($x14 + $x13, 18);\n        }\n\n        $x0  += $j0;\n        $x1  += $j1;\n        $x2  += $j2;\n        $x3  += $j3;\n        $x4  += $j4;\n        $x5  += $j5;\n        $x6  += $j6;\n        $x7  += $j7;\n        $x8  += $j8;\n        $x9  += $j9;\n        $x10 += $j10;\n        $x11 += $j11;\n        $x12 += $j12;\n        $x13 += $j13;\n        $x14 += $j14;\n        $x15 += $j15;\n\n        return self::store32_le($x0) .\n            self::store32_le($x1) .\n            self::store32_le($x2) .\n            self::store32_le($x3) .\n            self::store32_le($x4) .\n            self::store32_le($x5) .\n            self::store32_le($x6) .\n            self::store32_le($x7) .\n            self::store32_le($x8) .\n            self::store32_le($x9) .\n            self::store32_le($x10) .\n            self::store32_le($x11) .\n            self::store32_le($x12) .\n            self::store32_le($x13) .\n            self::store32_le($x14) .\n            self::store32_le($x15);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $len\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function salsa20($len, $nonce, $key)\n    {\n        if (self::strlen($key) !== 32) {\n            throw new RangeException('Key must be 32 bytes long');\n        }\n        $kcopy = '' . $key;\n        $in = self::substr($nonce, 0, 8) . str_repeat(\"\\0\", 8);\n        $c = '';\n        while ($len >= 64) {\n            $c .= self::core_salsa20($in, $kcopy, null);\n            $u = 1;\n            // Internal counter.\n            for ($i = 8; $i < 16; ++$i) {\n                $u += self::chrToInt($in[$i]);\n                $in[$i] = self::intToChr($u & 0xff);\n                $u >>= 8;\n            }\n            $len -= 64;\n        }\n        if ($len > 0) {\n            $c .= self::substr(\n                self::core_salsa20($in, $kcopy, null),\n                0,\n                $len\n            );\n        }\n        try {\n            ParagonIE_Sodium_Compat::memzero($kcopy);\n        } catch (SodiumException $ex) {\n            $kcopy = null;\n        }\n        return $c;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $m\n     * @param string $n\n     * @param int $ic\n     * @param string $k\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function salsa20_xor_ic($m, $n, $ic, $k)\n    {\n        $mlen = self::strlen($m);\n        if ($mlen < 1) {\n            return '';\n        }\n        $kcopy = self::substr($k, 0, 32);\n        $in = self::substr($n, 0, 8);\n        // Initialize the counter\n        $in .= ParagonIE_Sodium_Core_Util::store64_le($ic);\n\n        $c = '';\n        while ($mlen >= 64) {\n            $block = self::core_salsa20($in, $kcopy, null);\n            $c .= self::xorStrings(\n                self::substr($m, 0, 64),\n                self::substr($block, 0, 64)\n            );\n            $u = 1;\n            for ($i = 8; $i < 16; ++$i) {\n                $u += self::chrToInt($in[$i]);\n                $in[$i] = self::intToChr($u & 0xff);\n                $u >>= 8;\n            }\n\n            $mlen -= 64;\n            $m = self::substr($m, 64);\n        }\n\n        if ($mlen) {\n            $block = self::core_salsa20($in, $kcopy, null);\n            $c .= self::xorStrings(\n                self::substr($m, 0, $mlen),\n                self::substr($block, 0, $mlen)\n            );\n        }\n        try {\n            ParagonIE_Sodium_Compat::memzero($block);\n            ParagonIE_Sodium_Compat::memzero($kcopy);\n        } catch (SodiumException $ex) {\n            $block = null;\n            $kcopy = null;\n        }\n\n        return $c;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function salsa20_xor($message, $nonce, $key)\n    {\n        return self::xorStrings(\n            $message,\n            self::salsa20(\n                self::strlen($message),\n                $nonce,\n                $key\n            )\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $u\n     * @param int $c\n     * @return int\n     */\n    public static function rotate($u, $c)\n    {\n        $u &= 0xffffffff;\n        $c %= 32;\n        return (int) (0xffffffff & (\n                ($u << $c)\n                    |\n                ($u >> (32 - $c))\n            )\n        );\n    }\n}\n", "num_lines": 274}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_SipHash', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_SodiumCompat_Core_SipHash\n *\n * Only uses 32-bit arithmetic, while the original SipHash used 64-bit integers\n */\nclass ParagonIE_Sodium_Core_SipHash extends ParagonIE_Sodium_Core_Util\n{\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int[] $v\n     * @return int[]\n     */\n    public static function sipRound(array $v)\n    {\n        # v0 += v1;\n        list($v[0], $v[1]) = self::add(\n            array($v[0], $v[1]),\n            array($v[2], $v[3])\n        );\n\n        #  v1=ROTL(v1,13);\n        list($v[2], $v[3]) = self::rotl_64($v[2], $v[3], 13);\n\n        #  v1 ^= v0;\n        $v[2] ^= $v[0];\n        $v[3] ^= $v[1];\n\n        #  v0=ROTL(v0,32);\n        list($v[0], $v[1]) = self::rotl_64((int) $v[0], (int) $v[1], 32);\n\n        # v2 += v3;\n        list($v[4], $v[5]) = self::add(\n            array($v[4], $v[5]),\n            array($v[6], $v[7])\n        );\n\n        # v3=ROTL(v3,16);\n        list($v[6], $v[7]) = self::rotl_64($v[6], $v[7], 16);\n\n        #  v3 ^= v2;\n        $v[6] ^= $v[4];\n        $v[7] ^= $v[5];\n\n        # v0 += v3;\n        list($v[0], $v[1]) = self::add(\n            array((int) $v[0], (int) $v[1]),\n            array((int) $v[6], (int) $v[7])\n        );\n\n        # v3=ROTL(v3,21);\n        list($v[6], $v[7]) = self::rotl_64((int) $v[6], (int) $v[7], 21);\n\n        # v3 ^= v0;\n        $v[6] ^= $v[0];\n        $v[7] ^= $v[1];\n\n        # v2 += v1;\n        list($v[4], $v[5]) = self::add(\n            array((int) $v[4], (int) $v[5]),\n            array((int) $v[2], (int) $v[3])\n        );\n\n        # v1=ROTL(v1,17);\n        list($v[2], $v[3]) = self::rotl_64((int) $v[2], (int) $v[3], 17);\n\n        #  v1 ^= v2;;\n        $v[2] ^= $v[4];\n        $v[3] ^= $v[5];\n\n        # v2=ROTL(v2,32)\n        list($v[4], $v[5]) = self::rotl_64((int) $v[4], (int) $v[5], 32);\n\n        return $v;\n    }\n\n    /**\n     * Add two 32 bit integers representing a 64-bit integer.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param int[] $a\n     * @param int[] $b\n     * @return array<int, mixed>\n     */\n    public static function add(array $a, array $b)\n    {\n        /** @var int $x1 */\n        $x1 = $a[1] + $b[1];\n        /** @var int $c */\n        $c = $x1 >> 32; // Carry if ($a + $b) > 0xffffffff\n        /** @var int $x0 */\n        $x0 = $a[0] + $b[0] + $c;\n        return array(\n            $x0 & 0xffffffff,\n            $x1 & 0xffffffff\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $int0\n     * @param int $int1\n     * @param int $c\n     * @return array<int, mixed>\n     */\n    public static function rotl_64($int0, $int1, $c)\n    {\n        $int0 &= 0xffffffff;\n        $int1 &= 0xffffffff;\n        $c &= 63;\n        if ($c === 32) {\n            return array($int1, $int0);\n        }\n        if ($c > 31) {\n            $tmp = $int1;\n            $int1 = $int0;\n            $int0 = $tmp;\n            $c &= 31;\n        }\n        if ($c === 0) {\n            return array($int0, $int1);\n        }\n        return array(\n            0xffffffff & (\n                ($int0 << $c)\n                    |\n                ($int1 >> (32 - $c))\n            ),\n            0xffffffff & (\n                ($int1 << $c)\n                    |\n                ($int0 >> (32 - $c))\n            ),\n        );\n    }\n\n    /**\n     * Implements Siphash-2-4 using only 32-bit numbers.\n     *\n     * When we split an int into two, the higher bits go to the lower index.\n     * e.g. 0xDEADBEEFAB10C92D becomes [\n     *     0 => 0xDEADBEEF,\n     *     1 => 0xAB10C92D\n     * ].\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $in\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sipHash24($in, $key)\n    {\n        $inlen = self::strlen($in);\n\n        # /* \"somepseudorandomlygeneratedbytes\" */\n        # u64 v0 = 0x736f6d6570736575ULL;\n        # u64 v1 = 0x646f72616e646f6dULL;\n        # u64 v2 = 0x6c7967656e657261ULL;\n        # u64 v3 = 0x7465646279746573ULL;\n        $v = array(\n            0x736f6d65, // 0\n            0x70736575, // 1\n            0x646f7261, // 2\n            0x6e646f6d, // 3\n            0x6c796765, // 4\n            0x6e657261, // 5\n            0x74656462, // 6\n            0x79746573  // 7\n        );\n        // v0 => $v[0], $v[1]\n        // v1 => $v[2], $v[3]\n        // v2 => $v[4], $v[5]\n        // v3 => $v[6], $v[7]\n\n        # u64 k0 = LOAD64_LE( k );\n        # u64 k1 = LOAD64_LE( k + 8 );\n        $k = array(\n            self::load_4(self::substr($key, 4, 4)),\n            self::load_4(self::substr($key, 0, 4)),\n            self::load_4(self::substr($key, 12, 4)),\n            self::load_4(self::substr($key, 8, 4))\n        );\n        // k0 => $k[0], $k[1]\n        // k1 => $k[2], $k[3]\n\n        # b = ( ( u64 )inlen ) << 56;\n        $b = array(\n            $inlen << 24,\n            0\n        );\n        // See docblock for why the 0th index gets the higher bits.\n\n        # v3 ^= k1;\n        $v[6] ^= $k[2];\n        $v[7] ^= $k[3];\n        # v2 ^= k0;\n        $v[4] ^= $k[0];\n        $v[5] ^= $k[1];\n        # v1 ^= k1;\n        $v[2] ^= $k[2];\n        $v[3] ^= $k[3];\n        # v0 ^= k0;\n        $v[0] ^= $k[0];\n        $v[1] ^= $k[1];\n\n        $left = $inlen;\n        # for ( ; in != end; in += 8 )\n        while ($left >= 8) {\n            # m = LOAD64_LE( in );\n            $m = array(\n                self::load_4(self::substr($in, 4, 4)),\n                self::load_4(self::substr($in, 0, 4))\n            );\n\n            # v3 ^= m;\n            $v[6] ^= $m[0];\n            $v[7] ^= $m[1];\n\n            # SIPROUND;\n            # SIPROUND;\n            $v = self::sipRound($v);\n            $v = self::sipRound($v);\n\n            # v0 ^= m;\n            $v[0] ^= $m[0];\n            $v[1] ^= $m[1];\n\n            $in = self::substr($in, 8);\n            $left -= 8;\n        }\n\n        # switch( left )\n        #  {\n        #     case 7: b |= ( ( u64 )in[ 6] )  << 48;\n        #     case 6: b |= ( ( u64 )in[ 5] )  << 40;\n        #     case 5: b |= ( ( u64 )in[ 4] )  << 32;\n        #     case 4: b |= ( ( u64 )in[ 3] )  << 24;\n        #     case 3: b |= ( ( u64 )in[ 2] )  << 16;\n        #     case 2: b |= ( ( u64 )in[ 1] )  <<  8;\n        #     case 1: b |= ( ( u64 )in[ 0] ); break;\n        #     case 0: break;\n        # }\n        switch ($left) {\n            case 7:\n                $b[0] |= self::chrToInt($in[6]) << 16;\n            case 6:\n                $b[0] |= self::chrToInt($in[5]) << 8;\n            case 5:\n                $b[0] |= self::chrToInt($in[4]);\n            case 4:\n                $b[1] |= self::chrToInt($in[3]) << 24;\n            case 3:\n                $b[1] |= self::chrToInt($in[2]) << 16;\n            case 2:\n                $b[1] |= self::chrToInt($in[1]) << 8;\n            case 1:\n                $b[1] |= self::chrToInt($in[0]);\n            case 0:\n                break;\n        }\n        // See docblock for why the 0th index gets the higher bits.\n\n        # v3 ^= b;\n        $v[6] ^= $b[0];\n        $v[7] ^= $b[1];\n\n        # SIPROUND;\n        # SIPROUND;\n        $v = self::sipRound($v);\n        $v = self::sipRound($v);\n\n        # v0 ^= b;\n        $v[0] ^= $b[0];\n        $v[1] ^= $b[1];\n\n        // Flip the lower 8 bits of v2 which is ($v[4], $v[5]) in our implementation\n        # v2 ^= 0xff;\n        $v[5] ^= 0xff;\n\n        # SIPROUND;\n        # SIPROUND;\n        # SIPROUND;\n        # SIPROUND;\n        $v = self::sipRound($v);\n        $v = self::sipRound($v);\n        $v = self::sipRound($v);\n        $v = self::sipRound($v);\n\n        # b = v0 ^ v1 ^ v2 ^ v3;\n        # STORE64_LE( out, b );\n        return  self::store32_le($v[1] ^ $v[3] ^ $v[5] ^ $v[7]) .\n            self::store32_le($v[0] ^ $v[2] ^ $v[4] ^ $v[6]);\n    }\n}\n", "num_lines": 306}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_Util', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_Util\n */\nabstract class ParagonIE_Sodium_Core_Util\n{\n    /**\n     * @param int $integer\n     * @param int $size (16, 32, 64)\n     * @return int\n     */\n    public static function abs($integer, $size = 0)\n    {\n        /** @var int $realSize */\n        $realSize = (PHP_INT_SIZE << 3) - 1;\n        if ($size) {\n            --$size;\n        } else {\n            /** @var int $size */\n            $size = $realSize;\n        }\n\n        $negative = -(($integer >> $size) & 1);\n        return (int) (\n            ($integer ^ $negative)\n                +\n            (($negative >> $realSize) & 1)\n        );\n    }\n\n    /**\n     * Convert a binary string into a hexadecimal string without cache-timing\n     * leaks\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $binaryString (raw binary)\n     * @return string\n     * @throws TypeError\n     */\n    public static function bin2hex($binaryString)\n    {\n        /* Type checks: */\n        if (!is_string($binaryString)) {\n            throw new TypeError('Argument 1 must be a string, ' . gettype($binaryString) . ' given.');\n        }\n\n        $hex = '';\n        $len = self::strlen($binaryString);\n        for ($i = 0; $i < $len; ++$i) {\n            /** @var array<int, int> $chunk */\n            $chunk = unpack('C', $binaryString[$i]);\n            /** @var int $c */\n            $c = $chunk[1] & 0xf;\n            /** @var int $b */\n            $b = $chunk[1] >> 4;\n            $hex .= pack(\n                'CC',\n                (87 + $b + ((($b - 10) >> 8) & ~38)),\n                (87 + $c + ((($c - 10) >> 8) & ~38))\n            );\n        }\n        return $hex;\n    }\n\n    /**\n     * Convert a binary string into a hexadecimal string without cache-timing\n     * leaks, returning uppercase letters (as per RFC 4648)\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $bin_string (raw binary)\n     * @return string\n     * @throws TypeError\n     */\n    public static function bin2hexUpper($bin_string)\n    {\n        $hex = '';\n        $len = self::strlen($bin_string);\n        for ($i = 0; $i < $len; ++$i) {\n            /** @var array<int, int> $chunk */\n            $chunk = unpack('C', $bin_string[$i]);\n            /**\n             * Lower 16 bits\n             *\n             * @var int $c\n             */\n            $c = $chunk[1] & 0xf;\n\n            /**\n             * Upper 16 bits\n             * @var int $b\n             */\n            $b = $chunk[1] >> 4;\n\n            /**\n             * Use pack() and binary operators to turn the two integers\n             * into hexadecimal characters. We don't use chr() here, because\n             * it uses a lookup table internally and we want to avoid\n             * cache-timing side-channels.\n             */\n            $hex .= pack(\n                'CC',\n                (55 + $b + ((($b - 10) >> 8) & ~6)),\n                (55 + $c + ((($c - 10) >> 8) & ~6))\n            );\n        }\n        return $hex;\n    }\n\n    /**\n     * Cache-timing-safe variant of ord()\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $chr\n     * @return int\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function chrToInt($chr)\n    {\n        /* Type checks: */\n        if (!is_string($chr)) {\n            throw new TypeError('Argument 1 must be a string, ' . gettype($chr) . ' given.');\n        }\n        if (self::strlen($chr) !== 1) {\n            throw new SodiumException('chrToInt() expects a string that is exactly 1 character long');\n        }\n        /** @var array<int, int> $chunk */\n        $chunk = unpack('C', $chr);\n        return (int) ($chunk[1]);\n    }\n\n    /**\n     * Compares two strings.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $left\n     * @param string $right\n     * @param int $len\n     * @return int\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function compare($left, $right, $len = null)\n    {\n        $leftLen = self::strlen($left);\n        $rightLen = self::strlen($right);\n        if ($len === null) {\n            $len = max($leftLen, $rightLen);\n            $left = str_pad($left, $len, \"\\x00\", STR_PAD_RIGHT);\n            $right = str_pad($right, $len, \"\\x00\", STR_PAD_RIGHT);\n        }\n\n        $gt = 0;\n        $eq = 1;\n        $i = $len;\n        while ($i !== 0) {\n            --$i;\n            $gt |= ((self::chrToInt($right[$i]) - self::chrToInt($left[$i])) >> 8) & $eq;\n            $eq &= ((self::chrToInt($right[$i]) ^ self::chrToInt($left[$i])) - 1) >> 8;\n        }\n        return ($gt + $gt + $eq) - 1;\n    }\n\n    /**\n     * If a variable does not match a given type, throw a TypeError.\n     *\n     * @param mixed $mixedVar\n     * @param string $type\n     * @param int $argumentIndex\n     * @throws TypeError\n     * @throws SodiumException\n     * @return void\n     */\n    public static function declareScalarType(&$mixedVar = null, $type = 'void', $argumentIndex = 0)\n    {\n        if (func_num_args() === 0) {\n            /* Tautology, by default */\n            return;\n        }\n        if (func_num_args() === 1) {\n            throw new TypeError('Declared void, but passed a variable');\n        }\n        $realType = strtolower(gettype($mixedVar));\n        $type = strtolower($type);\n        switch ($type) {\n            case 'null':\n                if ($mixedVar !== null) {\n                    throw new TypeError('Argument ' . $argumentIndex . ' must be null, ' . $realType . ' given.');\n                }\n                break;\n            case 'integer':\n            case 'int':\n                $allow = array('int', 'integer');\n                if (!in_array($type, $allow)) {\n                    throw new TypeError('Argument ' . $argumentIndex . ' must be an integer, ' . $realType . ' given.');\n                }\n                $mixedVar = (int) $mixedVar;\n                break;\n            case 'boolean':\n            case 'bool':\n                $allow = array('bool', 'boolean');\n                if (!in_array($type, $allow)) {\n                    throw new TypeError('Argument ' . $argumentIndex . ' must be a boolean, ' . $realType . ' given.');\n                }\n                $mixedVar = (bool) $mixedVar;\n                break;\n            case 'string':\n                if (!is_string($mixedVar)) {\n                    throw new TypeError('Argument ' . $argumentIndex . ' must be a string, ' . $realType . ' given.');\n                }\n                $mixedVar = (string) $mixedVar;\n                break;\n            case 'decimal':\n            case 'double':\n            case 'float':\n                $allow = array('decimal', 'double', 'float');\n                if (!in_array($type, $allow)) {\n                    throw new TypeError('Argument ' . $argumentIndex . ' must be a float, ' . $realType . ' given.');\n                }\n                $mixedVar = (float) $mixedVar;\n                break;\n            case 'object':\n                if (!is_object($mixedVar)) {\n                    throw new TypeError('Argument ' . $argumentIndex . ' must be an object, ' . $realType . ' given.');\n                }\n                break;\n            case 'array':\n                if (!is_array($mixedVar)) {\n                    if (is_object($mixedVar)) {\n                        if ($mixedVar instanceof ArrayAccess) {\n                            return;\n                        }\n                    }\n                    throw new TypeError('Argument ' . $argumentIndex . ' must be an array, ' . $realType . ' given.');\n                }\n                break;\n            default:\n                throw new SodiumException('Unknown type (' . $realType .') does not match expect type (' . $type . ')');\n        }\n    }\n\n    /**\n     * Evaluate whether or not two strings are equal (in constant-time)\n     *\n     * @param string $left\n     * @param string $right\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function hashEquals($left, $right)\n    {\n        /* Type checks: */\n        if (!is_string($left)) {\n            throw new TypeError('Argument 1 must be a string, ' . gettype($left) . ' given.');\n        }\n        if (!is_string($right)) {\n            throw new TypeError('Argument 2 must be a string, ' . gettype($right) . ' given.');\n        }\n\n        if (is_callable('hash_equals')) {\n            return hash_equals($left, $right);\n        }\n        $d = 0;\n        /** @var int $len */\n        $len = self::strlen($left);\n        if ($len !== self::strlen($right)) {\n            return false;\n        }\n        for ($i = 0; $i < $len; ++$i) {\n            $d |= self::chrToInt($left[$i]) ^ self::chrToInt($right[$i]);\n        }\n\n        if ($d !== 0) {\n            return false;\n        }\n        return $left === $right;\n    }\n\n    /**\n     * Convert a hexadecimal string into a binary string without cache-timing\n     * leaks\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $hexString\n     * @param bool $strictPadding\n     * @return string (raw binary)\n     * @throws RangeException\n     * @throws TypeError\n     */\n    public static function hex2bin($hexString, $strictPadding = false)\n    {\n        /* Type checks: */\n        if (!is_string($hexString)) {\n            throw new TypeError('Argument 1 must be a string, ' . gettype($hexString) . ' given.');\n        }\n\n        /** @var int $hex_pos */\n        $hex_pos = 0;\n        /** @var string $bin */\n        $bin = '';\n        /** @var int $c_acc */\n        $c_acc = 0;\n        /** @var int $hex_len */\n        $hex_len = self::strlen($hexString);\n        /** @var int $state */\n        $state = 0;\n        if (($hex_len & 1) !== 0) {\n            if ($strictPadding) {\n                throw new RangeException(\n                    'Expected an even number of hexadecimal characters'\n                );\n            } else {\n                $hexString = '0' . $hexString;\n                ++$hex_len;\n            }\n        }\n\n        $chunk = unpack('C*', $hexString);\n        while ($hex_pos < $hex_len) {\n            ++$hex_pos;\n            /** @var int $c */\n            $c = $chunk[$hex_pos];\n            /** @var int $c_num */\n            $c_num = $c ^ 48;\n            /** @var int $c_num0 */\n            $c_num0 = ($c_num - 10) >> 8;\n            /** @var int $c_alpha */\n            $c_alpha = ($c & ~32) - 55;\n            /** @var int $c_alpha0 */\n            $c_alpha0 = (($c_alpha - 10) ^ ($c_alpha - 16)) >> 8;\n            if (($c_num0 | $c_alpha0) === 0) {\n                throw new RangeException(\n                    'hex2bin() only expects hexadecimal characters'\n                );\n            }\n            /** @var int $c_val */\n            $c_val = ($c_num0 & $c_num) | ($c_alpha & $c_alpha0);\n            if ($state === 0) {\n                $c_acc = $c_val * 16;\n            } else {\n                $bin .= pack('C', $c_acc | $c_val);\n            }\n            $state ^= 1;\n        }\n        return $bin;\n    }\n\n    /**\n     * Turn an array of integers into a string\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param array<int, int> $ints\n     * @return string\n     */\n    public static function intArrayToString(array $ints)\n    {\n        /** @var array<int, int> $args */\n        $args = $ints;\n        foreach ($args as $i => $v) {\n            $args[$i] = (int) ($v & 0xff);\n        }\n        array_unshift($args, str_repeat('C', count($ints)));\n        return (string) (call_user_func_array('pack', $args));\n    }\n\n    /**\n     * Cache-timing-safe variant of ord()\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param int $int\n     * @return string\n     * @throws TypeError\n     */\n    public static function intToChr($int)\n    {\n        return pack('C', $int);\n    }\n\n    /**\n     * Load a 3 character substring into an integer\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $string\n     * @return int\n     * @throws RangeException\n     * @throws TypeError\n     */\n    public static function load_3($string)\n    {\n        /* Type checks: */\n        if (!is_string($string)) {\n            throw new TypeError('Argument 1 must be a string, ' . gettype($string) . ' given.');\n        }\n\n        /* Input validation: */\n        if (self::strlen($string) < 3) {\n            throw new RangeException(\n                'String must be 3 bytes or more; ' . self::strlen($string) . ' given.'\n            );\n        }\n        /** @var array<int, int> $unpacked */\n        $unpacked = unpack('V', $string . \"\\0\");\n        return (int) ($unpacked[1] & 0xffffff);\n    }\n\n    /**\n     * Load a 4 character substring into an integer\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $string\n     * @return int\n     * @throws RangeException\n     * @throws TypeError\n     */\n    public static function load_4($string)\n    {\n        /* Type checks: */\n        if (!is_string($string)) {\n            throw new TypeError('Argument 1 must be a string, ' . gettype($string) . ' given.');\n        }\n\n        /* Input validation: */\n        if (self::strlen($string) < 4) {\n            throw new RangeException(\n                'String must be 4 bytes or more; ' . self::strlen($string) . ' given.'\n            );\n        }\n        /** @var array<int, int> $unpacked */\n        $unpacked = unpack('V', $string);\n        return (int) ($unpacked[1] & 0xffffffff);\n    }\n\n    /**\n     * Load a 8 character substring into an integer\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $string\n     * @return int\n     * @throws RangeException\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function load64_le($string)\n    {\n        /* Type checks: */\n        if (!is_string($string)) {\n            throw new TypeError('Argument 1 must be a string, ' . gettype($string) . ' given.');\n        }\n\n        /* Input validation: */\n        if (self::strlen($string) < 4) {\n            throw new RangeException(\n                'String must be 4 bytes or more; ' . self::strlen($string) . ' given.'\n            );\n        }\n        if (PHP_VERSION_ID >= 50603 && PHP_INT_SIZE === 8) {\n            /** @var array<int, int> $unpacked */\n            $unpacked = unpack('P', $string);\n            return (int) $unpacked[1];\n        }\n\n        /** @var int $result */\n        $result  = (self::chrToInt($string[0]) & 0xff);\n        $result |= (self::chrToInt($string[1]) & 0xff) <<  8;\n        $result |= (self::chrToInt($string[2]) & 0xff) << 16;\n        $result |= (self::chrToInt($string[3]) & 0xff) << 24;\n        $result |= (self::chrToInt($string[4]) & 0xff) << 32;\n        $result |= (self::chrToInt($string[5]) & 0xff) << 40;\n        $result |= (self::chrToInt($string[6]) & 0xff) << 48;\n        $result |= (self::chrToInt($string[7]) & 0xff) << 56;\n        return (int) $result;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $left\n     * @param string $right\n     * @return int\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function memcmp($left, $right)\n    {\n        if (self::hashEquals($left, $right)) {\n            return 0;\n        }\n        return -1;\n    }\n\n    /**\n     * Multiply two integers in constant-time\n     *\n     * Micro-architecture timing side-channels caused by how your CPU\n     * implements multiplication are best prevented by never using the\n     * multiplication operators and ensuring that our code always takes\n     * the same number of operations to complete, regardless of the values\n     * of $a and $b.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param int $a\n     * @param int $b\n     * @param int $size Limits the number of operations (useful for small,\n     *                  constant operands)\n     * @return int\n     */\n    public static function mul($a, $b, $size = 0)\n    {\n        if (ParagonIE_Sodium_Compat::$fastMult) {\n            return (int) ($a * $b);\n        }\n\n        static $defaultSize = null;\n        /** @var int $defaultSize */\n        if (!$defaultSize) {\n            /** @var int $defaultSize */\n            $defaultSize = (PHP_INT_SIZE << 3) - 1;\n        }\n        if ($size < 1) {\n            /** @var int $size */\n            $size = $defaultSize;\n        }\n        /** @var int $size */\n\n        $c = 0;\n\n        /**\n         * Mask is either -1 or 0.\n         *\n         * -1 in binary looks like 0x1111 ... 1111\n         *  0 in binary looks like 0x0000 ... 0000\n         *\n         * @var int\n         */\n        $mask = -(($b >> ((int) $defaultSize)) & 1);\n\n        /**\n         * Ensure $b is a positive integer, without creating\n         * a branching side-channel\n         *\n         * @var int $b\n         */\n        $b = ($b & ~$mask) | ($mask & -$b);\n\n        /**\n         * Unless $size is provided:\n         *\n         * This loop always runs 32 times when PHP_INT_SIZE is 4.\n         * This loop always runs 64 times when PHP_INT_SIZE is 8.\n         */\n        for ($i = $size; $i >= 0; --$i) {\n            $c += (int) ($a & -($b & 1));\n            $a <<= 1;\n            $b >>= 1;\n        }\n\n        /**\n         * If $b was negative, we then apply the same value to $c here.\n         * It doesn't matter much if $a was negative; the $c += above would\n         * have produced a negative integer to begin with. But a negative $b\n         * makes $b >>= 1 never return 0, so we would end up with incorrect\n         * results.\n         *\n         * The end result is what we'd expect from integer multiplication.\n         */\n        return (int) (($c & ~$mask) | ($mask & -$c));\n    }\n\n    /**\n     * Convert any arbitrary numbers into two 32-bit integers that represent\n     * a 64-bit integer.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param int|float $num\n     * @return array<int, int>\n     */\n    public static function numericTo64BitInteger($num)\n    {\n        $high = 0;\n        /** @var int $low */\n        $low = $num & 0xffffffff;\n\n        if ((+(abs($num))) >= 1) {\n            if ($num > 0) {\n                /** @var int $high */\n                $high = min((+(floor($num/4294967296))), 4294967295);\n            } else {\n                /** @var int $high */\n                $high = ~~((+(ceil(($num - (+((~~($num)))))/4294967296))));\n            }\n        }\n        return array((int) $high, (int) $low);\n    }\n\n    /**\n     * Store a 24-bit integer into a string, treating it as big-endian.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param int $int\n     * @return string\n     * @throws TypeError\n     */\n    public static function store_3($int)\n    {\n        /* Type checks: */\n        if (!is_int($int)) {\n            if (is_numeric($int)) {\n                $int = (int) $int;\n            } else {\n                throw new TypeError('Argument 1 must be an integer, ' . gettype($int) . ' given.');\n            }\n        }\n        /** @var string $packed */\n        $packed = pack('N', $int);\n        return self::substr($packed, 1, 3);\n    }\n\n    /**\n     * Store a 32-bit integer into a string, treating it as little-endian.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param int $int\n     * @return string\n     * @throws TypeError\n     */\n    public static function store32_le($int)\n    {\n        /* Type checks: */\n        if (!is_int($int)) {\n            if (is_numeric($int)) {\n                $int = (int) $int;\n            } else {\n                throw new TypeError('Argument 1 must be an integer, ' . gettype($int) . ' given.');\n            }\n        }\n\n        /** @var string $packed */\n        $packed = pack('V', $int);\n        return $packed;\n    }\n\n    /**\n     * Store a 32-bit integer into a string, treating it as big-endian.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param int $int\n     * @return string\n     * @throws TypeError\n     */\n    public static function store_4($int)\n    {\n        /* Type checks: */\n        if (!is_int($int)) {\n            if (is_numeric($int)) {\n                $int = (int) $int;\n            } else {\n                throw new TypeError('Argument 1 must be an integer, ' . gettype($int) . ' given.');\n            }\n        }\n\n        /** @var string $packed */\n        $packed = pack('N', $int);\n        return $packed;\n    }\n\n    /**\n     * Stores a 64-bit integer as an string, treating it as little-endian.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param int $int\n     * @return string\n     * @throws TypeError\n     */\n    public static function store64_le($int)\n    {\n        /* Type checks: */\n        if (!is_int($int)) {\n            if (is_numeric($int)) {\n                $int = (int) $int;\n            } else {\n                throw new TypeError('Argument 1 must be an integer, ' . gettype($int) . ' given.');\n            }\n        }\n\n        if (PHP_INT_SIZE === 8) {\n            if (PHP_VERSION_ID >= 50603) {\n                /** @var string $packed */\n                $packed = pack('P', $int);\n                return $packed;\n            }\n            return self::intToChr($int & 0xff) .\n                self::intToChr(($int >>  8) & 0xff) .\n                self::intToChr(($int >> 16) & 0xff) .\n                self::intToChr(($int >> 24) & 0xff) .\n                self::intToChr(($int >> 32) & 0xff) .\n                self::intToChr(($int >> 40) & 0xff) .\n                self::intToChr(($int >> 48) & 0xff) .\n                self::intToChr(($int >> 56) & 0xff);\n        }\n        if ($int > PHP_INT_MAX) {\n            list($hiB, $int) = self::numericTo64BitInteger($int);\n        } else {\n            $hiB = 0;\n        }\n        return\n            self::intToChr(($int      ) & 0xff) .\n            self::intToChr(($int >>  8) & 0xff) .\n            self::intToChr(($int >> 16) & 0xff) .\n            self::intToChr(($int >> 24) & 0xff) .\n            self::intToChr($hiB & 0xff) .\n            self::intToChr(($hiB >>  8) & 0xff) .\n            self::intToChr(($hiB >> 16) & 0xff) .\n            self::intToChr(($hiB >> 24) & 0xff);\n    }\n\n    /**\n     * Safe string length\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @ref mbstring.func_overload\n     *\n     * @param string $str\n     * @return int\n     * @throws TypeError\n     */\n    public static function strlen($str)\n    {\n        /* Type checks: */\n        if (!is_string($str)) {\n            throw new TypeError('String expected');\n        }\n\n        return (int) (\n        self::isMbStringOverride()\n            ? mb_strlen($str, '8bit')\n            : strlen($str)\n        );\n    }\n\n    /**\n     * Turn a string into an array of integers\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $string\n     * @return array<int, int>\n     * @throws TypeError\n     */\n    public static function stringToIntArray($string)\n    {\n        if (!is_string($string)) {\n            throw new TypeError('String expected');\n        }\n        /**\n         * @var array<int, int>\n         */\n        $values = array_values(\n            unpack('C*', $string)\n        );\n        return $values;\n    }\n\n    /**\n     * Safe substring\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @ref mbstring.func_overload\n     *\n     * @param string $str\n     * @param int $start\n     * @param int $length\n     * @return string\n     * @throws TypeError\n     */\n    public static function substr($str, $start = 0, $length = null)\n    {\n        /* Type checks: */\n        if (!is_string($str)) {\n            throw new TypeError('String expected');\n        }\n\n        if ($length === 0) {\n            return '';\n        }\n\n        if (self::isMbStringOverride()) {\n            if (PHP_VERSION_ID < 50400 && $length === null) {\n                $length = self::strlen($str);\n            }\n            $sub = (string) mb_substr($str, $start, $length, '8bit');\n        } elseif ($length === null) {\n            $sub = (string) substr($str, $start);\n        } else {\n            $sub = (string) substr($str, $start, $length);\n        }\n        if ($sub !== '') {\n            return $sub;\n        }\n        return '';\n    }\n\n    /**\n     * Compare a 16-character byte string in constant time.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $a\n     * @param string $b\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function verify_16($a, $b)\n    {\n        /* Type checks: */\n        if (!is_string($a)) {\n            throw new TypeError('String expected');\n        }\n        if (!is_string($b)) {\n            throw new TypeError('String expected');\n        }\n        return self::hashEquals(\n            self::substr($a, 0, 16),\n            self::substr($b, 0, 16)\n        );\n    }\n\n    /**\n     * Compare a 32-character byte string in constant time.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $a\n     * @param string $b\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function verify_32($a, $b)\n    {\n        /* Type checks: */\n        if (!is_string($a)) {\n            throw new TypeError('String expected');\n        }\n        if (!is_string($b)) {\n            throw new TypeError('String expected');\n        }\n        return self::hashEquals(\n            self::substr($a, 0, 32),\n            self::substr($b, 0, 32)\n        );\n    }\n\n    /**\n     * Calculate $a ^ $b for two strings.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $a\n     * @param string $b\n     * @return string\n     * @throws TypeError\n     */\n    public static function xorStrings($a, $b)\n    {\n        /* Type checks: */\n        if (!is_string($a)) {\n            throw new TypeError('Argument 1 must be a string');\n        }\n        if (!is_string($b)) {\n            throw new TypeError('Argument 2 must be a string');\n        }\n\n        return (string) ($a ^ $b);\n    }\n\n    /**\n     * Returns whether or not mbstring.func_overload is in effect.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @return bool\n     */\n    protected static function isMbStringOverride()\n    {\n        static $mbstring = null;\n\n        if ($mbstring === null) {\n            $mbstring = extension_loaded('mbstring')\n                &&\n            ((int) (ini_get('mbstring.func_overload')) & MB_OVERLOAD_STRING);\n        }\n        /** @var bool $mbstring */\n\n        return $mbstring;\n    }\n}\n", "num_lines": 922}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_X25519', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_X25519\n */\nabstract class ParagonIE_Sodium_Core_X25519 extends ParagonIE_Sodium_Core_Curve25519\n{\n    /**\n     * Alters the objects passed to this method in place.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $f\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $g\n     * @param int $b\n     * @return void\n     * @psalm-suppress MixedAssignment\n     */\n    public static function fe_cswap(\n        ParagonIE_Sodium_Core_Curve25519_Fe $f,\n        ParagonIE_Sodium_Core_Curve25519_Fe $g,\n        $b = 0\n    ) {\n        $f0 = (int) $f[0];\n        $f1 = (int) $f[1];\n        $f2 = (int) $f[2];\n        $f3 = (int) $f[3];\n        $f4 = (int) $f[4];\n        $f5 = (int) $f[5];\n        $f6 = (int) $f[6];\n        $f7 = (int) $f[7];\n        $f8 = (int) $f[8];\n        $f9 = (int) $f[9];\n        $g0 = (int) $g[0];\n        $g1 = (int) $g[1];\n        $g2 = (int) $g[2];\n        $g3 = (int) $g[3];\n        $g4 = (int) $g[4];\n        $g5 = (int) $g[5];\n        $g6 = (int) $g[6];\n        $g7 = (int) $g[7];\n        $g8 = (int) $g[8];\n        $g9 = (int) $g[9];\n        $b = -$b;\n        $x0 = ($f0 ^ $g0) & $b;\n        $x1 = ($f1 ^ $g1) & $b;\n        $x2 = ($f2 ^ $g2) & $b;\n        $x3 = ($f3 ^ $g3) & $b;\n        $x4 = ($f4 ^ $g4) & $b;\n        $x5 = ($f5 ^ $g5) & $b;\n        $x6 = ($f6 ^ $g6) & $b;\n        $x7 = ($f7 ^ $g7) & $b;\n        $x8 = ($f8 ^ $g8) & $b;\n        $x9 = ($f9 ^ $g9) & $b;\n        $f[0] = $f0 ^ $x0;\n        $f[1] = $f1 ^ $x1;\n        $f[2] = $f2 ^ $x2;\n        $f[3] = $f3 ^ $x3;\n        $f[4] = $f4 ^ $x4;\n        $f[5] = $f5 ^ $x5;\n        $f[6] = $f6 ^ $x6;\n        $f[7] = $f7 ^ $x7;\n        $f[8] = $f8 ^ $x8;\n        $f[9] = $f9 ^ $x9;\n        $g[0] = $g0 ^ $x0;\n        $g[1] = $g1 ^ $x1;\n        $g[2] = $g2 ^ $x2;\n        $g[3] = $g3 ^ $x3;\n        $g[4] = $g4 ^ $x4;\n        $g[5] = $g5 ^ $x5;\n        $g[6] = $g6 ^ $x6;\n        $g[7] = $g7 ^ $x7;\n        $g[8] = $g8 ^ $x8;\n        $g[9] = $g9 ^ $x9;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $f\n     * @return ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public static function fe_mul121666(ParagonIE_Sodium_Core_Curve25519_Fe $f)\n    {\n        $h = array(\n            self::mul((int) $f[0], 121666, 17),\n            self::mul((int) $f[1], 121666, 17),\n            self::mul((int) $f[2], 121666, 17),\n            self::mul((int) $f[3], 121666, 17),\n            self::mul((int) $f[4], 121666, 17),\n            self::mul((int) $f[5], 121666, 17),\n            self::mul((int) $f[6], 121666, 17),\n            self::mul((int) $f[7], 121666, 17),\n            self::mul((int) $f[8], 121666, 17),\n            self::mul((int) $f[9], 121666, 17)\n        );\n\n        /** @var int $carry9 */\n        $carry9 = ($h[9] + (1 << 24)) >> 25;\n        $h[0] += self::mul($carry9, 19, 5);\n        $h[9] -= $carry9 << 25;\n        /** @var int $carry1 */\n        $carry1 = ($h[1] + (1 << 24)) >> 25;\n        $h[2] += $carry1;\n        $h[1] -= $carry1 << 25;\n        /** @var int $carry3 */\n        $carry3 = ($h[3] + (1 << 24)) >> 25;\n        $h[4] += $carry3;\n        $h[3] -= $carry3 << 25;\n        /** @var int $carry5 */\n        $carry5 = ($h[5] + (1 << 24)) >> 25;\n        $h[6] += $carry5;\n        $h[5] -= $carry5 << 25;\n        /** @var int $carry7 */\n        $carry7 = ($h[7] + (1 << 24)) >> 25;\n        $h[8] += $carry7;\n        $h[7] -= $carry7 << 25;\n\n        /** @var int $carry0 */\n        $carry0 = ($h[0] + (1 << 25)) >> 26;\n        $h[1] += $carry0;\n        $h[0] -= $carry0 << 26;\n        /** @var int $carry2 */\n        $carry2 = ($h[2] + (1 << 25)) >> 26;\n        $h[3] += $carry2;\n        $h[2] -= $carry2 << 26;\n        /** @var int $carry4 */\n        $carry4 = ($h[4] + (1 << 25)) >> 26;\n        $h[5] += $carry4;\n        $h[4] -= $carry4 << 26;\n        /** @var int $carry6 */\n        $carry6 = ($h[6] + (1 << 25)) >> 26;\n        $h[7] += $carry6;\n        $h[6] -= $carry6 << 26;\n        /** @var int $carry8 */\n        $carry8 = ($h[8] + (1 << 25)) >> 26;\n        $h[9] += $carry8;\n        $h[8] -= $carry8 << 26;\n\n        foreach ($h as $i => $value) {\n            $h[$i] = (int) $value;\n        }\n        return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($h);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * Inline comments preceded by # are from libsodium's ref10 code.\n     *\n     * @param string $n\n     * @param string $p\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function crypto_scalarmult_curve25519_ref10($n, $p)\n    {\n        # for (i = 0;i < 32;++i) e[i] = n[i];\n        $e = '' . $n;\n        # e[0] &= 248;\n        $e[0] = self::intToChr(\n            self::chrToInt($e[0]) & 248\n        );\n        # e[31] &= 127;\n        # e[31] |= 64;\n        $e[31] = self::intToChr(\n            (self::chrToInt($e[31]) & 127) | 64\n        );\n        # fe_frombytes(x1,p);\n        $x1 = self::fe_frombytes($p);\n        # fe_1(x2);\n        $x2 = self::fe_1();\n        # fe_0(z2);\n        $z2 = self::fe_0();\n        # fe_copy(x3,x1);\n        $x3 = self::fe_copy($x1);\n        # fe_1(z3);\n        $z3 = self::fe_1();\n\n        # swap = 0;\n        /** @var int $swap */\n        $swap = 0;\n\n        # for (pos = 254;pos >= 0;--pos) {\n        for ($pos = 254; $pos >= 0; --$pos) {\n            # b = e[pos / 8] >> (pos & 7);\n            /** @var int $b */\n            $b = self::chrToInt(\n                    $e[(int) floor($pos / 8)]\n                ) >> ($pos & 7);\n            # b &= 1;\n            $b &= 1;\n            # swap ^= b;\n            $swap ^= $b;\n            # fe_cswap(x2,x3,swap);\n            self::fe_cswap($x2, $x3, $swap);\n            # fe_cswap(z2,z3,swap);\n            self::fe_cswap($z2, $z3, $swap);\n            # swap = b;\n            $swap = $b;\n            # fe_sub(tmp0,x3,z3);\n            $tmp0 = self::fe_sub($x3, $z3);\n            # fe_sub(tmp1,x2,z2);\n            $tmp1 = self::fe_sub($x2, $z2);\n\n            # fe_add(x2,x2,z2);\n            $x2 = self::fe_add($x2, $z2);\n\n            # fe_add(z2,x3,z3);\n            $z2 = self::fe_add($x3, $z3);\n\n            # fe_mul(z3,tmp0,x2);\n            $z3 = self::fe_mul($tmp0, $x2);\n\n            # fe_mul(z2,z2,tmp1);\n            $z2 = self::fe_mul($z2, $tmp1);\n\n            # fe_sq(tmp0,tmp1);\n            $tmp0 = self::fe_sq($tmp1);\n\n            # fe_sq(tmp1,x2);\n            $tmp1 = self::fe_sq($x2);\n\n            # fe_add(x3,z3,z2);\n            $x3 = self::fe_add($z3, $z2);\n\n            # fe_sub(z2,z3,z2);\n            $z2 = self::fe_sub($z3, $z2);\n\n            # fe_mul(x2,tmp1,tmp0);\n            $x2 = self::fe_mul($tmp1, $tmp0);\n\n            # fe_sub(tmp1,tmp1,tmp0);\n            $tmp1 = self::fe_sub($tmp1, $tmp0);\n\n            # fe_sq(z2,z2);\n            $z2 = self::fe_sq($z2);\n\n            # fe_mul121666(z3,tmp1);\n            $z3 = self::fe_mul121666($tmp1);\n\n            # fe_sq(x3,x3);\n            $x3 = self::fe_sq($x3);\n\n            # fe_add(tmp0,tmp0,z3);\n            $tmp0 = self::fe_add($tmp0, $z3);\n\n            # fe_mul(z3,x1,z2);\n            $z3 = self::fe_mul($x1, $z2);\n\n            # fe_mul(z2,tmp1,tmp0);\n            $z2 = self::fe_mul($tmp1, $tmp0);\n        }\n\n        # fe_cswap(x2,x3,swap);\n        self::fe_cswap($x2, $x3, $swap);\n\n        # fe_cswap(z2,z3,swap);\n        self::fe_cswap($z2, $z3, $swap);\n\n        # fe_invert(z2,z2);\n        $z2 = self::fe_invert($z2);\n\n        # fe_mul(x2,x2,z2);\n        $x2 = self::fe_mul($x2, $z2);\n        # fe_tobytes(q,x2);\n        return self::fe_tobytes($x2);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $edwardsY\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $edwardsZ\n     * @return ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public static function edwards_to_montgomery(\n        ParagonIE_Sodium_Core_Curve25519_Fe $edwardsY,\n        ParagonIE_Sodium_Core_Curve25519_Fe $edwardsZ\n    ) {\n        $tempX = self::fe_add($edwardsZ, $edwardsY);\n        $tempZ = self::fe_sub($edwardsZ, $edwardsY);\n        $tempZ = self::fe_invert($tempZ);\n        return self::fe_mul($tempX, $tempZ);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $n\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function crypto_scalarmult_curve25519_ref10_base($n)\n    {\n        # for (i = 0;i < 32;++i) e[i] = n[i];\n        $e = '' . $n;\n\n        # e[0] &= 248;\n        $e[0] = self::intToChr(\n            self::chrToInt($e[0]) & 248\n        );\n\n        # e[31] &= 127;\n        # e[31] |= 64;\n        $e[31] = self::intToChr(\n            (self::chrToInt($e[31]) & 127) | 64\n        );\n\n        $A = self::ge_scalarmult_base($e);\n        if (\n            !($A->Y instanceof ParagonIE_Sodium_Core_Curve25519_Fe)\n                ||\n            !($A->Z instanceof ParagonIE_Sodium_Core_Curve25519_Fe)\n        ) {\n            throw new TypeError('Null points encountered');\n        }\n        $pk = self::edwards_to_montgomery($A->Y, $A->Z);\n        return self::fe_tobytes($pk);\n    }\n}\n", "num_lines": 328}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_XChaCha20', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_XChaCha20\n */\nclass ParagonIE_Sodium_Core_XChaCha20 extends ParagonIE_Sodium_Core_HChaCha20\n{\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $len\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function stream($len = 64, $nonce = '', $key = '')\n    {\n        if (self::strlen($nonce) !== 24) {\n            throw new SodiumException('Nonce must be 24 bytes long');\n        }\n        return self::encryptBytes(\n            new ParagonIE_Sodium_Core_ChaCha20_Ctx(\n                self::hChaCha20(\n                    self::substr($nonce, 0, 16),\n                    $key\n                ),\n                self::substr($nonce, 16, 8)\n            ),\n            str_repeat(\"\\x00\", $len)\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $len\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ietfStream($len = 64, $nonce = '', $key = '')\n    {\n        if (self::strlen($nonce) !== 24) {\n            throw new SodiumException('Nonce must be 24 bytes long');\n        }\n        return self::encryptBytes(\n            new ParagonIE_Sodium_Core_ChaCha20_IetfCtx(\n                self::hChaCha20(\n                    self::substr($nonce, 0, 16),\n                    $key\n                ),\n                \"\\x00\\x00\\x00\\x00\" . self::substr($nonce, 16, 8)\n            ),\n            str_repeat(\"\\x00\", $len)\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @param string $ic\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function streamXorIc($message, $nonce = '', $key = '', $ic = '')\n    {\n        if (self::strlen($nonce) !== 24) {\n            throw new SodiumException('Nonce must be 24 bytes long');\n        }\n        return self::encryptBytes(\n            new ParagonIE_Sodium_Core_ChaCha20_Ctx(\n                self::hChaCha20(self::substr($nonce, 0, 16), $key),\n                self::substr($nonce, 16, 8),\n                $ic\n            ),\n            $message\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @param string $ic\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ietfStreamXorIc($message, $nonce = '', $key = '', $ic = '')\n    {\n        if (self::strlen($nonce) !== 24) {\n            throw new SodiumException('Nonce must be 24 bytes long');\n        }\n        return self::encryptBytes(\n            new ParagonIE_Sodium_Core_ChaCha20_IetfCtx(\n                self::hChaCha20(self::substr($nonce, 0, 16), $key),\n                \"\\x00\\x00\\x00\\x00\" . self::substr($nonce, 16, 8),\n                $ic\n            ),\n            $message\n        );\n    }\n}\n", "num_lines": 118}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_XSalsa20', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_XSalsa20\n */\nabstract class ParagonIE_Sodium_Core_XSalsa20 extends ParagonIE_Sodium_Core_HSalsa20\n{\n    /**\n     * Expand a key and nonce into an xsalsa20 keystream.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param int $len\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function xsalsa20($len, $nonce, $key)\n    {\n        $ret = self::salsa20(\n            $len,\n            self::substr($nonce, 16, 8),\n            self::hsalsa20($nonce, $key)\n        );\n        return $ret;\n    }\n\n    /**\n     * Encrypt a string with XSalsa20. Doesn't provide integrity.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function xsalsa20_xor($message, $nonce, $key)\n    {\n        return self::xorStrings(\n            $message,\n            self::xsalsa20(\n                self::strlen($message),\n                $nonce,\n                $key\n            )\n        );\n    }\n}\n", "num_lines": 58}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * Class ParagonIE_Sodium_Core_Base64\n *\n *  Copyright (c) 2016 - 2018 Paragon Initiative Enterprises.\n *  Copyright (c) 2014 Steve \"Sc00bz\" Thomas (steve at tobtu dot com)\n *\n * We have to copy/paste the contents into the variant files because PHP 5.2\n * doesn't support late static binding, and we have no better workaround\n * available that won't break PHP 7+. Therefore, we're forced to duplicate code.\n */\nabstract class ParagonIE_Sodium_Core_Base64_Common\n{\n    /**\n     * Encode into Base64\n     *\n     * Base64 character set \"[A-Z][a-z][0-9]+/\"\n     *\n     * @param string $src\n     * @return string\n     * @throws TypeError\n     */\n    public static function encode($src)\n    {\n        return self::doEncode($src, true);\n    }\n\n    /**\n     * Encode into Base64, no = padding\n     *\n     * Base64 character set \"[A-Z][a-z][0-9]+/\"\n     *\n     * @param string $src\n     * @return string\n     * @throws TypeError\n     */\n    public static function encodeUnpadded($src)\n    {\n        return self::doEncode($src, false);\n    }\n\n    /**\n     * @param string $src\n     * @param bool $pad   Include = padding?\n     * @return string\n     * @throws TypeError\n     */\n    protected static function doEncode($src, $pad = true)\n    {\n        $dest = '';\n        $srcLen = ParagonIE_Sodium_Core_Util::strlen($src);\n        // Main loop (no padding):\n        for ($i = 0; $i + 3 <= $srcLen; $i += 3) {\n            /** @var array<int, int> $chunk */\n            $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 3));\n            $b0 = $chunk[1];\n            $b1 = $chunk[2];\n            $b2 = $chunk[3];\n\n            $dest .=\n                self::encode6Bits(               $b0 >> 2       ) .\n                self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) .\n                self::encode6Bits((($b1 << 2) | ($b2 >> 6)) & 63) .\n                self::encode6Bits(  $b2                     & 63);\n        }\n        // The last chunk, which may have padding:\n        if ($i < $srcLen) {\n            /** @var array<int, int> $chunk */\n            $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i));\n            $b0 = $chunk[1];\n            if ($i + 1 < $srcLen) {\n                $b1 = $chunk[2];\n                $dest .=\n                    self::encode6Bits($b0 >> 2) .\n                    self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) .\n                    self::encode6Bits(($b1 << 2) & 63);\n                if ($pad) {\n                    $dest .= '=';\n                }\n            } else {\n                $dest .=\n                    self::encode6Bits( $b0 >> 2) .\n                    self::encode6Bits(($b0 << 4) & 63);\n                if ($pad) {\n                    $dest .= '==';\n                }\n            }\n        }\n        return $dest;\n    }\n\n    /**\n     * decode from base64 into binary\n     *\n     * Base64 character set \"./[A-Z][a-z][0-9]\"\n     *\n     * @param string $src\n     * @param bool $strictPadding\n     * @return string\n     * @throws RangeException\n     * @throws TypeError\n     * @psalm-suppress RedundantCondition\n     */\n    public static function decode($src, $strictPadding = false)\n    {\n        // Remove padding\n        $srcLen = ParagonIE_Sodium_Core_Util::strlen($src);\n        if ($srcLen === 0) {\n            return '';\n        }\n\n        if ($strictPadding) {\n            if (($srcLen & 3) === 0) {\n                if ($src[$srcLen - 1] === '=') {\n                    $srcLen--;\n                    if ($src[$srcLen - 1] === '=') {\n                        $srcLen--;\n                    }\n                }\n            }\n            if (($srcLen & 3) === 1) {\n                throw new RangeException(\n                    'Incorrect padding'\n                );\n            }\n            if ($src[$srcLen - 1] === '=') {\n                throw new RangeException(\n                    'Incorrect padding'\n                );\n            }\n        } else {\n            $src = rtrim($src, '=');\n            $srcLen = ParagonIE_Sodium_Core_Util::strlen($src);\n        }\n\n        $err = 0;\n        $dest = '';\n        // Main loop (no padding):\n        for ($i = 0; $i + 4 <= $srcLen; $i += 4) {\n            /** @var array<int, int> $chunk */\n            $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 4));\n            $c0 = self::decode6Bits($chunk[1]);\n            $c1 = self::decode6Bits($chunk[2]);\n            $c2 = self::decode6Bits($chunk[3]);\n            $c3 = self::decode6Bits($chunk[4]);\n\n            $dest .= pack(\n                'CCC',\n                ((($c0 << 2) | ($c1 >> 4)) & 0xff),\n                ((($c1 << 4) | ($c2 >> 2)) & 0xff),\n                ((($c2 << 6) |  $c3      ) & 0xff)\n            );\n            $err |= ($c0 | $c1 | $c2 | $c3) >> 8;\n        }\n        // The last chunk, which may have padding:\n        if ($i < $srcLen) {\n            /** @var array<int, int> $chunk */\n            $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i));\n            $c0 = self::decode6Bits($chunk[1]);\n\n            if ($i + 2 < $srcLen) {\n                $c1 = self::decode6Bits($chunk[2]);\n                $c2 = self::decode6Bits($chunk[3]);\n                $dest .= pack(\n                    'CC',\n                    ((($c0 << 2) | ($c1 >> 4)) & 0xff),\n                    ((($c1 << 4) | ($c2 >> 2)) & 0xff)\n                );\n                $err |= ($c0 | $c1 | $c2) >> 8;\n            } elseif ($i + 1 < $srcLen) {\n                $c1 = self::decode6Bits($chunk[2]);\n                $dest .= pack(\n                    'C',\n                    ((($c0 << 2) | ($c1 >> 4)) & 0xff)\n                );\n                $err |= ($c0 | $c1) >> 8;\n            } elseif ($i < $srcLen && $strictPadding) {\n                $err |= 1;\n            }\n        }\n        /** @var bool $check */\n        $check = ($err === 0);\n        if (!$check) {\n            throw new RangeException(\n                'Base64::decode() only expects characters in the correct base64 alphabet'\n            );\n        }\n        return $dest;\n    }\n\n    /**\n     * Uses bitwise operators instead of table-lookups to turn 6-bit integers\n     * into 8-bit integers.\n     *\n     * Base64 character set:\n     * [A-Z]      [a-z]      [0-9]      +     /\n     * 0x41-0x5a, 0x61-0x7a, 0x30-0x39, 0x2b, 0x2f\n     *\n     * @param int $src\n     * @return int\n     */\n    abstract protected static function decode6Bits($src);\n\n    /**\n     * Uses bitwise operators instead of table-lookups to turn 8-bit integers\n     * into 6-bit integers.\n     *\n     * @param int $src\n     * @return string\n     */\n    abstract protected static function encode6Bits($src);\n}\n", "num_lines": 214}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * Class ParagonIE_Sodium_Core_Base64\n *\n *  Copyright (c) 2016 - 2018 Paragon Initiative Enterprises.\n *  Copyright (c) 2014 Steve \"Sc00bz\" Thomas (steve at tobtu dot com)\n */\nclass ParagonIE_Sodium_Core_Base64_Original\n{\n    // COPY ParagonIE_Sodium_Core_Base64_Common STARTING HERE\n    /**\n     * Encode into Base64\n     *\n     * Base64 character set \"[A-Z][a-z][0-9]+/\"\n     *\n     * @param string $src\n     * @return string\n     * @throws TypeError\n     */\n    public static function encode($src)\n    {\n        return self::doEncode($src, true);\n    }\n\n    /**\n     * Encode into Base64, no = padding\n     *\n     * Base64 character set \"[A-Z][a-z][0-9]+/\"\n     *\n     * @param string $src\n     * @return string\n     * @throws TypeError\n     */\n    public static function encodeUnpadded($src)\n    {\n        return self::doEncode($src, false);\n    }\n\n    /**\n     * @param string $src\n     * @param bool $pad   Include = padding?\n     * @return string\n     * @throws TypeError\n     */\n    protected static function doEncode($src, $pad = true)\n    {\n        $dest = '';\n        $srcLen = ParagonIE_Sodium_Core_Util::strlen($src);\n        // Main loop (no padding):\n        for ($i = 0; $i + 3 <= $srcLen; $i += 3) {\n            /** @var array<int, int> $chunk */\n            $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 3));\n            $b0 = $chunk[1];\n            $b1 = $chunk[2];\n            $b2 = $chunk[3];\n\n            $dest .=\n                self::encode6Bits(               $b0 >> 2       ) .\n                self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) .\n                self::encode6Bits((($b1 << 2) | ($b2 >> 6)) & 63) .\n                self::encode6Bits(  $b2                     & 63);\n        }\n        // The last chunk, which may have padding:\n        if ($i < $srcLen) {\n            /** @var array<int, int> $chunk */\n            $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i));\n            $b0 = $chunk[1];\n            if ($i + 1 < $srcLen) {\n                $b1 = $chunk[2];\n                $dest .=\n                    self::encode6Bits($b0 >> 2) .\n                    self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) .\n                    self::encode6Bits(($b1 << 2) & 63);\n                if ($pad) {\n                    $dest .= '=';\n                }\n            } else {\n                $dest .=\n                    self::encode6Bits( $b0 >> 2) .\n                    self::encode6Bits(($b0 << 4) & 63);\n                if ($pad) {\n                    $dest .= '==';\n                }\n            }\n        }\n        return $dest;\n    }\n\n    /**\n     * decode from base64 into binary\n     *\n     * Base64 character set \"./[A-Z][a-z][0-9]\"\n     *\n     * @param string $src\n     * @param bool $strictPadding\n     * @return string\n     * @throws RangeException\n     * @throws TypeError\n     * @psalm-suppress RedundantCondition\n     */\n    public static function decode($src, $strictPadding = false)\n    {\n        // Remove padding\n        $srcLen = ParagonIE_Sodium_Core_Util::strlen($src);\n        if ($srcLen === 0) {\n            return '';\n        }\n\n        if ($strictPadding) {\n            if (($srcLen & 3) === 0) {\n                if ($src[$srcLen - 1] === '=') {\n                    $srcLen--;\n                    if ($src[$srcLen - 1] === '=') {\n                        $srcLen--;\n                    }\n                }\n            }\n            if (($srcLen & 3) === 1) {\n                throw new RangeException(\n                    'Incorrect padding'\n                );\n            }\n            if ($src[$srcLen - 1] === '=') {\n                throw new RangeException(\n                    'Incorrect padding'\n                );\n            }\n        } else {\n            $src = rtrim($src, '=');\n            $srcLen =  ParagonIE_Sodium_Core_Util::strlen($src);\n        }\n\n        $err = 0;\n        $dest = '';\n        // Main loop (no padding):\n        for ($i = 0; $i + 4 <= $srcLen; $i += 4) {\n            /** @var array<int, int> $chunk */\n            $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 4));\n            $c0 = self::decode6Bits($chunk[1]);\n            $c1 = self::decode6Bits($chunk[2]);\n            $c2 = self::decode6Bits($chunk[3]);\n            $c3 = self::decode6Bits($chunk[4]);\n\n            $dest .= pack(\n                'CCC',\n                ((($c0 << 2) | ($c1 >> 4)) & 0xff),\n                ((($c1 << 4) | ($c2 >> 2)) & 0xff),\n                ((($c2 << 6) | $c3) & 0xff)\n            );\n            $err |= ($c0 | $c1 | $c2 | $c3) >> 8;\n        }\n        // The last chunk, which may have padding:\n        if ($i < $srcLen) {\n            /** @var array<int, int> $chunk */\n            $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i));\n            $c0 = self::decode6Bits($chunk[1]);\n\n            if ($i + 2 < $srcLen) {\n                $c1 = self::decode6Bits($chunk[2]);\n                $c2 = self::decode6Bits($chunk[3]);\n                $dest .= pack(\n                    'CC',\n                    ((($c0 << 2) | ($c1 >> 4)) & 0xff),\n                    ((($c1 << 4) | ($c2 >> 2)) & 0xff)\n                );\n                $err |= ($c0 | $c1 | $c2) >> 8;\n            } elseif ($i + 1 < $srcLen) {\n                $c1 = self::decode6Bits($chunk[2]);\n                $dest .= pack(\n                    'C',\n                    ((($c0 << 2) | ($c1 >> 4)) & 0xff)\n                );\n                $err |= ($c0 | $c1) >> 8;\n            } elseif ($i < $srcLen && $strictPadding) {\n                $err |= 1;\n            }\n        }\n        /** @var bool $check */\n        $check = ($err === 0);\n        if (!$check) {\n            throw new RangeException(\n                'Base64::decode() only expects characters in the correct base64 alphabet'\n            );\n        }\n        return $dest;\n    }\n    // COPY ParagonIE_Sodium_Core_Base64_Common ENDING HERE\n\n    /**\n     * Uses bitwise operators instead of table-lookups to turn 6-bit integers\n     * into 8-bit integers.\n     *\n     * Base64 character set:\n     * [A-Z]      [a-z]      [0-9]      +     /\n     * 0x41-0x5a, 0x61-0x7a, 0x30-0x39, 0x2b, 0x2f\n     *\n     * @param int $src\n     * @return int\n     */\n    protected static function decode6Bits($src)\n    {\n        $ret = -1;\n\n        // if ($src > 0x40 && $src < 0x5b) $ret += $src - 0x41 + 1; // -64\n        $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 64);\n\n        // if ($src > 0x60 && $src < 0x7b) $ret += $src - 0x61 + 26 + 1; // -70\n        $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 70);\n\n        // if ($src > 0x2f && $src < 0x3a) $ret += $src - 0x30 + 52 + 1; // 5\n        $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src + 5);\n\n        // if ($src == 0x2b) $ret += 62 + 1;\n        $ret += (((0x2a - $src) & ($src - 0x2c)) >> 8) & 63;\n\n        // if ($src == 0x2f) ret += 63 + 1;\n        $ret += (((0x2e - $src) & ($src - 0x30)) >> 8) & 64;\n\n        return $ret;\n    }\n\n    /**\n     * Uses bitwise operators instead of table-lookups to turn 8-bit integers\n     * into 6-bit integers.\n     *\n     * @param int $src\n     * @return string\n     */\n    protected static function encode6Bits($src)\n    {\n        $diff = 0x41;\n\n        // if ($src > 25) $diff += 0x61 - 0x41 - 26; // 6\n        $diff += ((25 - $src) >> 8) & 6;\n\n        // if ($src > 51) $diff += 0x30 - 0x61 - 26; // -75\n        $diff -= ((51 - $src) >> 8) & 75;\n\n        // if ($src > 61) $diff += 0x2b - 0x30 - 10; // -15\n        $diff -= ((61 - $src) >> 8) & 15;\n\n        // if ($src > 62) $diff += 0x2f - 0x2b - 1; // 3\n        $diff += ((62 - $src) >> 8) & 3;\n\n        return pack('C', $src + $diff);\n    }\n}\n", "num_lines": 249}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * Class ParagonIE_Sodium_Core_Base64UrlSafe\n *\n *  Copyright (c) 2016 - 2018 Paragon Initiative Enterprises.\n *  Copyright (c) 2014 Steve \"Sc00bz\" Thomas (steve at tobtu dot com)\n */\nclass ParagonIE_Sodium_Core_Base64_UrlSafe\n{\n    // COPY ParagonIE_Sodium_Core_Base64_Common STARTING HERE\n    /**\n     * Encode into Base64\n     *\n     * Base64 character set \"[A-Z][a-z][0-9]+/\"\n     *\n     * @param string $src\n     * @return string\n     * @throws TypeError\n     */\n    public static function encode($src)\n    {\n        return self::doEncode($src, true);\n    }\n\n    /**\n     * Encode into Base64, no = padding\n     *\n     * Base64 character set \"[A-Z][a-z][0-9]+/\"\n     *\n     * @param string $src\n     * @return string\n     * @throws TypeError\n     */\n    public static function encodeUnpadded($src)\n    {\n        return self::doEncode($src, false);\n    }\n\n    /**\n     * @param string $src\n     * @param bool $pad   Include = padding?\n     * @return string\n     * @throws TypeError\n     */\n    protected static function doEncode($src, $pad = true)\n    {\n        $dest = '';\n        $srcLen = ParagonIE_Sodium_Core_Util::strlen($src);\n        // Main loop (no padding):\n        for ($i = 0; $i + 3 <= $srcLen; $i += 3) {\n            /** @var array<int, int> $chunk */\n            $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 3));\n            $b0 = $chunk[1];\n            $b1 = $chunk[2];\n            $b2 = $chunk[3];\n\n            $dest .=\n                self::encode6Bits(               $b0 >> 2       ) .\n                self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) .\n                self::encode6Bits((($b1 << 2) | ($b2 >> 6)) & 63) .\n                self::encode6Bits(  $b2                     & 63);\n        }\n        // The last chunk, which may have padding:\n        if ($i < $srcLen) {\n            /** @var array<int, int> $chunk */\n            $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i));\n            $b0 = $chunk[1];\n            if ($i + 1 < $srcLen) {\n                $b1 = $chunk[2];\n                $dest .=\n                    self::encode6Bits($b0 >> 2) .\n                    self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) .\n                    self::encode6Bits(($b1 << 2) & 63);\n                if ($pad) {\n                    $dest .= '=';\n                }\n            } else {\n                $dest .=\n                    self::encode6Bits( $b0 >> 2) .\n                    self::encode6Bits(($b0 << 4) & 63);\n                if ($pad) {\n                    $dest .= '==';\n                }\n            }\n        }\n        return $dest;\n    }\n\n    /**\n     * decode from base64 into binary\n     *\n     * Base64 character set \"./[A-Z][a-z][0-9]\"\n     *\n     * @param string $src\n     * @param bool $strictPadding\n     * @return string\n     * @throws RangeException\n     * @throws TypeError\n     * @psalm-suppress RedundantCondition\n     */\n    public static function decode($src, $strictPadding = false)\n    {\n        // Remove padding\n        $srcLen = ParagonIE_Sodium_Core_Util::strlen($src);\n        if ($srcLen === 0) {\n            return '';\n        }\n\n        if ($strictPadding) {\n            if (($srcLen & 3) === 0) {\n                if ($src[$srcLen - 1] === '=') {\n                    $srcLen--;\n                    if ($src[$srcLen - 1] === '=') {\n                        $srcLen--;\n                    }\n                }\n            }\n            if (($srcLen & 3) === 1) {\n                throw new RangeException(\n                    'Incorrect padding'\n                );\n            }\n            if ($src[$srcLen - 1] === '=') {\n                throw new RangeException(\n                    'Incorrect padding'\n                );\n            }\n        } else {\n            $src = rtrim($src, '=');\n            $srcLen =  ParagonIE_Sodium_Core_Util::strlen($src);\n        }\n\n        $err = 0;\n        $dest = '';\n        // Main loop (no padding):\n        for ($i = 0; $i + 4 <= $srcLen; $i += 4) {\n            /** @var array<int, int> $chunk */\n            $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 4));\n            $c0 = self::decode6Bits($chunk[1]);\n            $c1 = self::decode6Bits($chunk[2]);\n            $c2 = self::decode6Bits($chunk[3]);\n            $c3 = self::decode6Bits($chunk[4]);\n\n            $dest .= pack(\n                'CCC',\n                ((($c0 << 2) | ($c1 >> 4)) & 0xff),\n                ((($c1 << 4) | ($c2 >> 2)) & 0xff),\n                ((($c2 << 6) | $c3) & 0xff)\n            );\n            $err |= ($c0 | $c1 | $c2 | $c3) >> 8;\n        }\n        // The last chunk, which may have padding:\n        if ($i < $srcLen) {\n            /** @var array<int, int> $chunk */\n            $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i));\n            $c0 = self::decode6Bits($chunk[1]);\n\n            if ($i + 2 < $srcLen) {\n                $c1 = self::decode6Bits($chunk[2]);\n                $c2 = self::decode6Bits($chunk[3]);\n                $dest .= pack(\n                    'CC',\n                    ((($c0 << 2) | ($c1 >> 4)) & 0xff),\n                    ((($c1 << 4) | ($c2 >> 2)) & 0xff)\n                );\n                $err |= ($c0 | $c1 | $c2) >> 8;\n            } elseif ($i + 1 < $srcLen) {\n                $c1 = self::decode6Bits($chunk[2]);\n                $dest .= pack(\n                    'C',\n                    ((($c0 << 2) | ($c1 >> 4)) & 0xff)\n                );\n                $err |= ($c0 | $c1) >> 8;\n            } elseif ($i < $srcLen && $strictPadding) {\n                $err |= 1;\n            }\n        }\n        /** @var bool $check */\n        $check = ($err === 0);\n        if (!$check) {\n            throw new RangeException(\n                'Base64::decode() only expects characters in the correct base64 alphabet'\n            );\n        }\n        return $dest;\n    }\n    // COPY ParagonIE_Sodium_Core_Base64_Common ENDING HERE\n    /**\n     * Uses bitwise operators instead of table-lookups to turn 6-bit integers\n     * into 8-bit integers.\n     *\n     * Base64 character set:\n     * [A-Z]      [a-z]      [0-9]      +     /\n     * 0x41-0x5a, 0x61-0x7a, 0x30-0x39, 0x2b, 0x2f\n     *\n     * @param int $src\n     * @return int\n     */\n    protected static function decode6Bits($src)\n    {\n        $ret = -1;\n\n        // if ($src > 0x40 && $src < 0x5b) $ret += $src - 0x41 + 1; // -64\n        $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 64);\n\n        // if ($src > 0x60 && $src < 0x7b) $ret += $src - 0x61 + 26 + 1; // -70\n        $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 70);\n\n        // if ($src > 0x2f && $src < 0x3a) $ret += $src - 0x30 + 52 + 1; // 5\n        $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src + 5);\n\n        // if ($src == 0x2c) $ret += 62 + 1;\n        $ret += (((0x2c - $src) & ($src - 0x2e)) >> 8) & 63;\n\n        // if ($src == 0x5f) ret += 63 + 1;\n        $ret += (((0x5e - $src) & ($src - 0x60)) >> 8) & 64;\n\n        return $ret;\n    }\n\n    /**\n     * Uses bitwise operators instead of table-lookups to turn 8-bit integers\n     * into 6-bit integers.\n     *\n     * @param int $src\n     * @return string\n     */\n    protected static function encode6Bits($src)\n    {\n        $diff = 0x41;\n\n        // if ($src > 25) $diff += 0x61 - 0x41 - 26; // 6\n        $diff += ((25 - $src) >> 8) & 6;\n\n        // if ($src > 51) $diff += 0x30 - 0x61 - 26; // -75\n        $diff -= ((51 - $src) >> 8) & 75;\n\n        // if ($src > 61) $diff += 0x2d - 0x30 - 10; // -13\n        $diff -= ((61 - $src) >> 8) & 13;\n\n        // if ($src > 62) $diff += 0x5f - 0x2b - 1; // 3\n        $diff += ((62 - $src) >> 8) & 49;\n\n        return pack('C', $src + $diff);\n    }\n}\n", "num_lines": 248}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_ChaCha20_Ctx', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_ChaCha20_Ctx\n */\nclass ParagonIE_Sodium_Core_ChaCha20_Ctx extends ParagonIE_Sodium_Core_Util implements ArrayAccess\n{\n    /**\n     * @var SplFixedArray internally, <int, int>\n     */\n    protected $container;\n\n    /**\n     * ParagonIE_Sodium_Core_ChaCha20_Ctx constructor.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $key     ChaCha20 key.\n     * @param string $iv      Initialization Vector (a.k.a. nonce).\n     * @param string $counter The initial counter value.\n     *                        Defaults to 8 0x00 bytes.\n     * @throws InvalidArgumentException\n     * @throws TypeError\n     */\n    public function __construct($key = '', $iv = '', $counter = '')\n    {\n        if (self::strlen($key) !== 32) {\n            throw new InvalidArgumentException('ChaCha20 expects a 256-bit key.');\n        }\n        if (self::strlen($iv) !== 8) {\n            throw new InvalidArgumentException('ChaCha20 expects a 64-bit nonce.');\n        }\n        $this->container = new SplFixedArray(16);\n\n        /* \"expand 32-byte k\" as per ChaCha20 spec */\n        $this->container[0]  = 0x61707865;\n        $this->container[1]  = 0x3320646e;\n        $this->container[2]  = 0x79622d32;\n        $this->container[3]  = 0x6b206574;\n        $this->container[4]  = self::load_4(self::substr($key, 0, 4));\n        $this->container[5]  = self::load_4(self::substr($key, 4, 4));\n        $this->container[6]  = self::load_4(self::substr($key, 8, 4));\n        $this->container[7]  = self::load_4(self::substr($key, 12, 4));\n        $this->container[8]  = self::load_4(self::substr($key, 16, 4));\n        $this->container[9]  = self::load_4(self::substr($key, 20, 4));\n        $this->container[10] = self::load_4(self::substr($key, 24, 4));\n        $this->container[11] = self::load_4(self::substr($key, 28, 4));\n\n        if (empty($counter)) {\n            $this->container[12] = 0;\n            $this->container[13] = 0;\n        } else {\n            $this->container[12] = self::load_4(self::substr($counter, 0, 4));\n            $this->container[13] = self::load_4(self::substr($counter, 4, 4));\n        }\n        $this->container[14] = self::load_4(self::substr($iv, 0, 4));\n        $this->container[15] = self::load_4(self::substr($iv, 4, 4));\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $offset\n     * @param int $value\n     * @return void\n     * @psalm-suppress MixedArrayOffset\n     */\n    public function offsetSet($offset, $value)\n    {\n        if (!is_int($offset)) {\n            throw new InvalidArgumentException('Expected an integer');\n        }\n        if (!is_int($value)) {\n            throw new InvalidArgumentException('Expected an integer');\n        }\n        $this->container[$offset] = $value;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $offset\n     * @return bool\n     */\n    public function offsetExists($offset)\n    {\n        return isset($this->container[$offset]);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $offset\n     * @return void\n     * @psalm-suppress MixedArrayOffset\n     */\n    public function offsetUnset($offset)\n    {\n        unset($this->container[$offset]);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $offset\n     * @return mixed|null\n     * @psalm-suppress MixedArrayOffset\n     */\n    public function offsetGet($offset)\n    {\n        return isset($this->container[$offset])\n            ? $this->container[$offset]\n            : null;\n    }\n}\n", "num_lines": 120}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_ChaCha20_IetfCtx', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_ChaCha20_IetfCtx\n */\nclass ParagonIE_Sodium_Core_ChaCha20_IetfCtx extends ParagonIE_Sodium_Core_ChaCha20_Ctx\n{\n    /**\n     * ParagonIE_Sodium_Core_ChaCha20_IetfCtx constructor.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $key     ChaCha20 key.\n     * @param string $iv      Initialization Vector (a.k.a. nonce).\n     * @param string $counter The initial counter value.\n     *                        Defaults to 4 0x00 bytes.\n     * @throws InvalidArgumentException\n     * @throws TypeError\n     */\n    public function __construct($key = '', $iv = '', $counter = '')\n    {\n        if (self::strlen($iv) !== 12) {\n            throw new InvalidArgumentException('ChaCha20 expects a 96-bit nonce in IETF mode.');\n        }\n        parent::__construct($key, self::substr($iv, 0, 8), $counter);\n\n        if (!empty($counter)) {\n            $this->container[12] = self::load_4(self::substr($counter, 0, 4));\n        }\n        $this->container[13] = self::load_4(self::substr($iv, 0, 4));\n        $this->container[14] = self::load_4(self::substr($iv, 4, 4));\n        $this->container[15] = self::load_4(self::substr($iv, 8, 4));\n    }\n}\n", "num_lines": 39}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_Curve25519_Fe', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_Curve25519_Fe\n *\n * This represents a Field Element\n */\nclass ParagonIE_Sodium_Core_Curve25519_Fe implements ArrayAccess\n{\n    /**\n     * @var array<int, int>\n     */\n    protected $container = array();\n\n    /**\n     * @var int\n     */\n    protected $size = 10;\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param array<int, int> $array\n     * @param bool $save_indexes\n     * @return self\n     */\n    public static function fromArray($array, $save_indexes = null)\n    {\n        $count = count($array);\n        if ($save_indexes) {\n            $keys = array_keys($array);\n        } else {\n            $keys = range(0, $count - 1);\n        }\n        $array = array_values($array);\n        /** @var array<int, int> $keys */\n\n        $obj = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        if ($save_indexes) {\n            for ($i = 0; $i < $count; ++$i) {\n                $obj->offsetSet($keys[$i], $array[$i]);\n            }\n        } else {\n            for ($i = 0; $i < $count; ++$i) {\n                $obj->offsetSet($i, $array[$i]);\n            }\n        }\n        return $obj;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int|null $offset\n     * @param int $value\n     * @return void\n     * @psalm-suppress MixedArrayOffset\n     */\n    public function offsetSet($offset, $value)\n    {\n        if (!is_int($value)) {\n            throw new InvalidArgumentException('Expected an integer');\n        }\n        if (is_null($offset)) {\n            $this->container[] = $value;\n        } else {\n            $this->container[$offset] = $value;\n        }\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $offset\n     * @return bool\n     * @psalm-suppress MixedArrayOffset\n     */\n    public function offsetExists($offset)\n    {\n        return isset($this->container[$offset]);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $offset\n     * @return void\n     * @psalm-suppress MixedArrayOffset\n     */\n    public function offsetUnset($offset)\n    {\n        unset($this->container[$offset]);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $offset\n     * @return int\n     * @psalm-suppress MixedArrayOffset\n     */\n    public function offsetGet($offset)\n    {\n        if (!isset($this->container[$offset])) {\n            $this->container[$offset] = 0;\n        }\n        return (int) ($this->container[$offset]);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @return array\n     */\n    public function __debugInfo()\n    {\n        return array(implode(', ', $this->container));\n    }\n}\n", "num_lines": 124}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_Curve25519_H', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_Curve25519_H\n *\n * This just contains the constants in the ref10/base.h file\n */\nclass ParagonIE_Sodium_Core_Curve25519_H extends ParagonIE_Sodium_Core_Util\n{\n    /**\n     * See: libsodium's crypto_core/curve25519/ref10/base.h\n     *\n     * @var array<int, array<int, array<int, array<int, int>>>> Basically, int[32][8][3][10]\n     */\n    protected static $base = array(\n        array(\n            array(\n                array(25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605),\n                array(-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378),\n                array(-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546),\n            ),\n            array(\n                array(-12815894, -12976347, -21581243, 11784320, -25355658, -2750717, -11717903, -3814571, -358445, -10211303),\n                array(-21703237, 6903825, 27185491, 6451973, -29577724, -9554005, -15616551, 11189268, -26829678, -5319081),\n                array(26966642, 11152617, 32442495, 15396054, 14353839, -12752335, -3128826, -9541118, -15472047, -4166697),\n            ),\n            array(\n                array(15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024),\n                array(16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574),\n                array(30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357),\n            ),\n            array(\n                array(-17036878, 13921892, 10945806, -6033431, 27105052, -16084379, -28926210, 15006023, 3284568, -6276540),\n                array(23599295, -8306047, -11193664, -7687416, 13236774, 10506355, 7464579, 9656445, 13059162, 10374397),\n                array(7798556, 16710257, 3033922, 2874086, 28997861, 2835604, 32406664, -3839045, -641708, -101325),\n            ),\n            array(\n                array(10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380),\n                array(4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306),\n                array(19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942),\n            ),\n            array(\n                array(-15371964, -12862754, 32573250, 4720197, -26436522, 5875511, -19188627, -15224819, -9818940, -12085777),\n                array(-8549212, 109983, 15149363, 2178705, 22900618, 4543417, 3044240, -15689887, 1762328, 14866737),\n                array(-18199695, -15951423, -10473290, 1707278, -17185920, 3916101, -28236412, 3959421, 27914454, 4383652),\n            ),\n            array(\n                array(5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766),\n                array(-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701),\n                array(28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300),\n            ),\n            array(\n                array(14499471, -2729599, -33191113, -4254652, 28494862, 14271267, 30290735, 10876454, -33154098, 2381726),\n                array(-7195431, -2655363, -14730155, 462251, -27724326, 3941372, -6236617, 3696005, -32300832, 15351955),\n                array(27431194, 8222322, 16448760, -3907995, -18707002, 11938355, -32961401, -2970515, 29551813, 10109425),\n            ),\n        ),\n        array(\n            array(\n                array(-13657040, -13155431, -31283750, 11777098, 21447386, 6519384, -2378284, -1627556, 10092783, -4764171),\n                array(27939166, 14210322, 4677035, 16277044, -22964462, -12398139, -32508754, 12005538, -17810127, 12803510),\n                array(17228999, -15661624, -1233527, 300140, -1224870, -11714777, 30364213, -9038194, 18016357, 4397660),\n            ),\n            array(\n                array(-10958843, -7690207, 4776341, -14954238, 27850028, -15602212, -26619106, 14544525, -17477504, 982639),\n                array(29253598, 15796703, -2863982, -9908884, 10057023, 3163536, 7332899, -4120128, -21047696, 9934963),\n                array(5793303, 16271923, -24131614, -10116404, 29188560, 1206517, -14747930, 4559895, -30123922, -10897950),\n            ),\n            array(\n                array(-27643952, -11493006, 16282657, -11036493, 28414021, -15012264, 24191034, 4541697, -13338309, 5500568),\n                array(12650548, -1497113, 9052871, 11355358, -17680037, -8400164, -17430592, 12264343, 10874051, 13524335),\n                array(25556948, -3045990, 714651, 2510400, 23394682, -10415330, 33119038, 5080568, -22528059, 5376628),\n            ),\n            array(\n                array(-26088264, -4011052, -17013699, -3537628, -6726793, 1920897, -22321305, -9447443, 4535768, 1569007),\n                array(-2255422, 14606630, -21692440, -8039818, 28430649, 8775819, -30494562, 3044290, 31848280, 12543772),\n                array(-22028579, 2943893, -31857513, 6777306, 13784462, -4292203, -27377195, -2062731, 7718482, 14474653),\n            ),\n            array(\n                array(2385315, 2454213, -22631320, 46603, -4437935, -15680415, 656965, -7236665, 24316168, -5253567),\n                array(13741529, 10911568, -33233417, -8603737, -20177830, -1033297, 33040651, -13424532, -20729456, 8321686),\n                array(21060490, -2212744, 15712757, -4336099, 1639040, 10656336, 23845965, -11874838, -9984458, 608372),\n            ),\n            array(\n                array(-13672732, -15087586, -10889693, -7557059, -6036909, 11305547, 1123968, -6780577, 27229399, 23887),\n                array(-23244140, -294205, -11744728, 14712571, -29465699, -2029617, 12797024, -6440308, -1633405, 16678954),\n                array(-29500620, 4770662, -16054387, 14001338, 7830047, 9564805, -1508144, -4795045, -17169265, 4904953),\n            ),\n            array(\n                array(24059557, 14617003, 19037157, -15039908, 19766093, -14906429, 5169211, 16191880, 2128236, -4326833),\n                array(-16981152, 4124966, -8540610, -10653797, 30336522, -14105247, -29806336, 916033, -6882542, -2986532),\n                array(-22630907, 12419372, -7134229, -7473371, -16478904, 16739175, 285431, 2763829, 15736322, 4143876),\n            ),\n            array(\n                array(2379352, 11839345, -4110402, -5988665, 11274298, 794957, 212801, -14594663, 23527084, -16458268),\n                array(33431127, -11130478, -17838966, -15626900, 8909499, 8376530, -32625340, 4087881, -15188911, -14416214),\n                array(1767683, 7197987, -13205226, -2022635, -13091350, 448826, 5799055, 4357868, -4774191, -16323038),\n            ),\n        ),\n        array(\n            array(\n                array(6721966, 13833823, -23523388, -1551314, 26354293, -11863321, 23365147, -3949732, 7390890, 2759800),\n                array(4409041, 2052381, 23373853, 10530217, 7676779, -12885954, 21302353, -4264057, 1244380, -12919645),\n                array(-4421239, 7169619, 4982368, -2957590, 30256825, -2777540, 14086413, 9208236, 15886429, 16489664),\n            ),\n            array(\n                array(1996075, 10375649, 14346367, 13311202, -6874135, -16438411, -13693198, 398369, -30606455, -712933),\n                array(-25307465, 9795880, -2777414, 14878809, -33531835, 14780363, 13348553, 12076947, -30836462, 5113182),\n                array(-17770784, 11797796, 31950843, 13929123, -25888302, 12288344, -30341101, -7336386, 13847711, 5387222),\n            ),\n            array(\n                array(-18582163, -3416217, 17824843, -2340966, 22744343, -10442611, 8763061, 3617786, -19600662, 10370991),\n                array(20246567, -14369378, 22358229, -543712, 18507283, -10413996, 14554437, -8746092, 32232924, 16763880),\n                array(9648505, 10094563, 26416693, 14745928, -30374318, -6472621, 11094161, 15689506, 3140038, -16510092),\n            ),\n            array(\n                array(-16160072, 5472695, 31895588, 4744994, 8823515, 10365685, -27224800, 9448613, -28774454, 366295),\n                array(19153450, 11523972, -11096490, -6503142, -24647631, 5420647, 28344573, 8041113, 719605, 11671788),\n                array(8678025, 2694440, -6808014, 2517372, 4964326, 11152271, -15432916, -15266516, 27000813, -10195553),\n            ),\n            array(\n                array(-15157904, 7134312, 8639287, -2814877, -7235688, 10421742, 564065, 5336097, 6750977, -14521026),\n                array(11836410, -3979488, 26297894, 16080799, 23455045, 15735944, 1695823, -8819122, 8169720, 16220347),\n                array(-18115838, 8653647, 17578566, -6092619, -8025777, -16012763, -11144307, -2627664, -5990708, -14166033),\n            ),\n            array(\n                array(-23308498, -10968312, 15213228, -10081214, -30853605, -11050004, 27884329, 2847284, 2655861, 1738395),\n                array(-27537433, -14253021, -25336301, -8002780, -9370762, 8129821, 21651608, -3239336, -19087449, -11005278),\n                array(1533110, 3437855, 23735889, 459276, 29970501, 11335377, 26030092, 5821408, 10478196, 8544890),\n            ),\n            array(\n                array(32173121, -16129311, 24896207, 3921497, 22579056, -3410854, 19270449, 12217473, 17789017, -3395995),\n                array(-30552961, -2228401, -15578829, -10147201, 13243889, 517024, 15479401, -3853233, 30460520, 1052596),\n                array(-11614875, 13323618, 32618793, 8175907, -15230173, 12596687, 27491595, -4612359, 3179268, -9478891),\n            ),\n            array(\n                array(31947069, -14366651, -4640583, -15339921, -15125977, -6039709, -14756777, -16411740, 19072640, -9511060),\n                array(11685058, 11822410, 3158003, -13952594, 33402194, -4165066, 5977896, -5215017, 473099, 5040608),\n                array(-20290863, 8198642, -27410132, 11602123, 1290375, -2799760, 28326862, 1721092, -19558642, -3131606),\n            ),\n        ),\n        array(\n            array(\n                array(7881532, 10687937, 7578723, 7738378, -18951012, -2553952, 21820786, 8076149, -27868496, 11538389),\n                array(-19935666, 3899861, 18283497, -6801568, -15728660, -11249211, 8754525, 7446702, -5676054, 5797016),\n                array(-11295600, -3793569, -15782110, -7964573, 12708869, -8456199, 2014099, -9050574, -2369172, -5877341),\n            ),\n            array(\n                array(-22472376, -11568741, -27682020, 1146375, 18956691, 16640559, 1192730, -3714199, 15123619, 10811505),\n                array(14352098, -3419715, -18942044, 10822655, 32750596, 4699007, -70363, 15776356, -28886779, -11974553),\n                array(-28241164, -8072475, -4978962, -5315317, 29416931, 1847569, -20654173, -16484855, 4714547, -9600655),\n            ),\n            array(\n                array(15200332, 8368572, 19679101, 15970074, -31872674, 1959451, 24611599, -4543832, -11745876, 12340220),\n                array(12876937, -10480056, 33134381, 6590940, -6307776, 14872440, 9613953, 8241152, 15370987, 9608631),\n                array(-4143277, -12014408, 8446281, -391603, 4407738, 13629032, -7724868, 15866074, -28210621, -8814099),\n            ),\n            array(\n                array(26660628, -15677655, 8393734, 358047, -7401291, 992988, -23904233, 858697, 20571223, 8420556),\n                array(14620715, 13067227, -15447274, 8264467, 14106269, 15080814, 33531827, 12516406, -21574435, -12476749),\n                array(236881, 10476226, 57258, -14677024, 6472998, 2466984, 17258519, 7256740, 8791136, 15069930),\n            ),\n            array(\n                array(1276410, -9371918, 22949635, -16322807, -23493039, -5702186, 14711875, 4874229, -30663140, -2331391),\n                array(5855666, 4990204, -13711848, 7294284, -7804282, 1924647, -1423175, -7912378, -33069337, 9234253),\n                array(20590503, -9018988, 31529744, -7352666, -2706834, 10650548, 31559055, -11609587, 18979186, 13396066),\n            ),\n            array(\n                array(24474287, 4968103, 22267082, 4407354, 24063882, -8325180, -18816887, 13594782, 33514650, 7021958),\n                array(-11566906, -6565505, -21365085, 15928892, -26158305, 4315421, -25948728, -3916677, -21480480, 12868082),\n                array(-28635013, 13504661, 19988037, -2132761, 21078225, 6443208, -21446107, 2244500, -12455797, -8089383),\n            ),\n            array(\n                array(-30595528, 13793479, -5852820, 319136, -25723172, -6263899, 33086546, 8957937, -15233648, 5540521),\n                array(-11630176, -11503902, -8119500, -7643073, 2620056, 1022908, -23710744, -1568984, -16128528, -14962807),\n                array(23152971, 775386, 27395463, 14006635, -9701118, 4649512, 1689819, 892185, -11513277, -15205948),\n            ),\n            array(\n                array(9770129, 9586738, 26496094, 4324120, 1556511, -3550024, 27453819, 4763127, -19179614, 5867134),\n                array(-32765025, 1927590, 31726409, -4753295, 23962434, -16019500, 27846559, 5931263, -29749703, -16108455),\n                array(27461885, -2977536, 22380810, 1815854, -23033753, -3031938, 7283490, -15148073, -19526700, 7734629),\n            ),\n        ),\n        array(\n            array(\n                array(-8010264, -9590817, -11120403, 6196038, 29344158, -13430885, 7585295, -3176626, 18549497, 15302069),\n                array(-32658337, -6171222, -7672793, -11051681, 6258878, 13504381, 10458790, -6418461, -8872242, 8424746),\n                array(24687205, 8613276, -30667046, -3233545, 1863892, -1830544, 19206234, 7134917, -11284482, -828919),\n            ),\n            array(\n                array(11334899, -9218022, 8025293, 12707519, 17523892, -10476071, 10243738, -14685461, -5066034, 16498837),\n                array(8911542, 6887158, -9584260, -6958590, 11145641, -9543680, 17303925, -14124238, 6536641, 10543906),\n                array(-28946384, 15479763, -17466835, 568876, -1497683, 11223454, -2669190, -16625574, -27235709, 8876771),\n            ),\n            array(\n                array(-25742899, -12566864, -15649966, -846607, -33026686, -796288, -33481822, 15824474, -604426, -9039817),\n                array(10330056, 70051, 7957388, -9002667, 9764902, 15609756, 27698697, -4890037, 1657394, 3084098),\n                array(10477963, -7470260, 12119566, -13250805, 29016247, -5365589, 31280319, 14396151, -30233575, 15272409),\n            ),\n            array(\n                array(-12288309, 3169463, 28813183, 16658753, 25116432, -5630466, -25173957, -12636138, -25014757, 1950504),\n                array(-26180358, 9489187, 11053416, -14746161, -31053720, 5825630, -8384306, -8767532, 15341279, 8373727),\n                array(28685821, 7759505, -14378516, -12002860, -31971820, 4079242, 298136, -10232602, -2878207, 15190420),\n            ),\n            array(\n                array(-32932876, 13806336, -14337485, -15794431, -24004620, 10940928, 8669718, 2742393, -26033313, -6875003),\n                array(-1580388, -11729417, -25979658, -11445023, -17411874, -10912854, 9291594, -16247779, -12154742, 6048605),\n                array(-30305315, 14843444, 1539301, 11864366, 20201677, 1900163, 13934231, 5128323, 11213262, 9168384),\n            ),\n            array(\n                array(-26280513, 11007847, 19408960, -940758, -18592965, -4328580, -5088060, -11105150, 20470157, -16398701),\n                array(-23136053, 9282192, 14855179, -15390078, -7362815, -14408560, -22783952, 14461608, 14042978, 5230683),\n                array(29969567, -2741594, -16711867, -8552442, 9175486, -2468974, 21556951, 3506042, -5933891, -12449708),\n            ),\n            array(\n                array(-3144746, 8744661, 19704003, 4581278, -20430686, 6830683, -21284170, 8971513, -28539189, 15326563),\n                array(-19464629, 10110288, -17262528, -3503892, -23500387, 1355669, -15523050, 15300988, -20514118, 9168260),\n                array(-5353335, 4488613, -23803248, 16314347, 7780487, -15638939, -28948358, 9601605, 33087103, -9011387),\n            ),\n            array(\n                array(-19443170, -15512900, -20797467, -12445323, -29824447, 10229461, -27444329, -15000531, -5996870, 15664672),\n                array(23294591, -16632613, -22650781, -8470978, 27844204, 11461195, 13099750, -2460356, 18151676, 13417686),\n                array(-24722913, -4176517, -31150679, 5988919, -26858785, 6685065, 1661597, -12551441, 15271676, -15452665),\n            ),\n        ),\n        array(\n            array(\n                array(11433042, -13228665, 8239631, -5279517, -1985436, -725718, -18698764, 2167544, -6921301, -13440182),\n                array(-31436171, 15575146, 30436815, 12192228, -22463353, 9395379, -9917708, -8638997, 12215110, 12028277),\n                array(14098400, 6555944, 23007258, 5757252, -15427832, -12950502, 30123440, 4617780, -16900089, -655628),\n            ),\n            array(\n                array(-4026201, -15240835, 11893168, 13718664, -14809462, 1847385, -15819999, 10154009, 23973261, -12684474),\n                array(-26531820, -3695990, -1908898, 2534301, -31870557, -16550355, 18341390, -11419951, 32013174, -10103539),\n                array(-25479301, 10876443, -11771086, -14625140, -12369567, 1838104, 21911214, 6354752, 4425632, -837822),\n            ),\n            array(\n                array(-10433389, -14612966, 22229858, -3091047, -13191166, 776729, -17415375, -12020462, 4725005, 14044970),\n                array(19268650, -7304421, 1555349, 8692754, -21474059, -9910664, 6347390, -1411784, -19522291, -16109756),\n                array(-24864089, 12986008, -10898878, -5558584, -11312371, -148526, 19541418, 8180106, 9282262, 10282508),\n            ),\n            array(\n                array(-26205082, 4428547, -8661196, -13194263, 4098402, -14165257, 15522535, 8372215, 5542595, -10702683),\n                array(-10562541, 14895633, 26814552, -16673850, -17480754, -2489360, -2781891, 6993761, -18093885, 10114655),\n                array(-20107055, -929418, 31422704, 10427861, -7110749, 6150669, -29091755, -11529146, 25953725, -106158),\n            ),\n            array(\n                array(-4234397, -8039292, -9119125, 3046000, 2101609, -12607294, 19390020, 6094296, -3315279, 12831125),\n                array(-15998678, 7578152, 5310217, 14408357, -33548620, -224739, 31575954, 6326196, 7381791, -2421839),\n                array(-20902779, 3296811, 24736065, -16328389, 18374254, 7318640, 6295303, 8082724, -15362489, 12339664),\n            ),\n            array(\n                array(27724736, 2291157, 6088201, -14184798, 1792727, 5857634, 13848414, 15768922, 25091167, 14856294),\n                array(-18866652, 8331043, 24373479, 8541013, -701998, -9269457, 12927300, -12695493, -22182473, -9012899),\n                array(-11423429, -5421590, 11632845, 3405020, 30536730, -11674039, -27260765, 13866390, 30146206, 9142070),\n            ),\n            array(\n                array(3924129, -15307516, -13817122, -10054960, 12291820, -668366, -27702774, 9326384, -8237858, 4171294),\n                array(-15921940, 16037937, 6713787, 16606682, -21612135, 2790944, 26396185, 3731949, 345228, -5462949),\n                array(-21327538, 13448259, 25284571, 1143661, 20614966, -8849387, 2031539, -12391231, -16253183, -13582083),\n            ),\n            array(\n                array(31016211, -16722429, 26371392, -14451233, -5027349, 14854137, 17477601, 3842657, 28012650, -16405420),\n                array(-5075835, 9368966, -8562079, -4600902, -15249953, 6970560, -9189873, 16292057, -8867157, 3507940),\n                array(29439664, 3537914, 23333589, 6997794, -17555561, -11018068, -15209202, -15051267, -9164929, 6580396),\n            ),\n        ),\n        array(\n            array(\n                array(-12185861, -7679788, 16438269, 10826160, -8696817, -6235611, 17860444, -9273846, -2095802, 9304567),\n                array(20714564, -4336911, 29088195, 7406487, 11426967, -5095705, 14792667, -14608617, 5289421, -477127),\n                array(-16665533, -10650790, -6160345, -13305760, 9192020, -1802462, 17271490, 12349094, 26939669, -3752294),\n            ),\n            array(\n                array(-12889898, 9373458, 31595848, 16374215, 21471720, 13221525, -27283495, -12348559, -3698806, 117887),\n                array(22263325, -6560050, 3984570, -11174646, -15114008, -566785, 28311253, 5358056, -23319780, 541964),\n                array(16259219, 3261970, 2309254, -15534474, -16885711, -4581916, 24134070, -16705829, -13337066, -13552195),\n            ),\n            array(\n                array(9378160, -13140186, -22845982, -12745264, 28198281, -7244098, -2399684, -717351, 690426, 14876244),\n                array(24977353, -314384, -8223969, -13465086, 28432343, -1176353, -13068804, -12297348, -22380984, 6618999),\n                array(-1538174, 11685646, 12944378, 13682314, -24389511, -14413193, 8044829, -13817328, 32239829, -5652762),\n            ),\n            array(\n                array(-18603066, 4762990, -926250, 8885304, -28412480, -3187315, 9781647, -10350059, 32779359, 5095274),\n                array(-33008130, -5214506, -32264887, -3685216, 9460461, -9327423, -24601656, 14506724, 21639561, -2630236),\n                array(-16400943, -13112215, 25239338, 15531969, 3987758, -4499318, -1289502, -6863535, 17874574, 558605),\n            ),\n            array(\n                array(-13600129, 10240081, 9171883, 16131053, -20869254, 9599700, 33499487, 5080151, 2085892, 5119761),\n                array(-22205145, -2519528, -16381601, 414691, -25019550, 2170430, 30634760, -8363614, -31999993, -5759884),\n                array(-6845704, 15791202, 8550074, -1312654, 29928809, -12092256, 27534430, -7192145, -22351378, 12961482),\n            ),\n            array(\n                array(-24492060, -9570771, 10368194, 11582341, -23397293, -2245287, 16533930, 8206996, -30194652, -5159638),\n                array(-11121496, -3382234, 2307366, 6362031, -135455, 8868177, -16835630, 7031275, 7589640, 8945490),\n                array(-32152748, 8917967, 6661220, -11677616, -1192060, -15793393, 7251489, -11182180, 24099109, -14456170),\n            ),\n            array(\n                array(5019558, -7907470, 4244127, -14714356, -26933272, 6453165, -19118182, -13289025, -6231896, -10280736),\n                array(10853594, 10721687, 26480089, 5861829, -22995819, 1972175, -1866647, -10557898, -3363451, -6441124),\n                array(-17002408, 5906790, 221599, -6563147, 7828208, -13248918, 24362661, -2008168, -13866408, 7421392),\n            ),\n            array(\n                array(8139927, -6546497, 32257646, -5890546, 30375719, 1886181, -21175108, 15441252, 28826358, -4123029),\n                array(6267086, 9695052, 7709135, -16603597, -32869068, -1886135, 14795160, -7840124, 13746021, -1742048),\n                array(28584902, 7787108, -6732942, -15050729, 22846041, -7571236, -3181936, -363524, 4771362, -8419958),\n            ),\n        ),\n        array(\n            array(\n                array(24949256, 6376279, -27466481, -8174608, -18646154, -9930606, 33543569, -12141695, 3569627, 11342593),\n                array(26514989, 4740088, 27912651, 3697550, 19331575, -11472339, 6809886, 4608608, 7325975, -14801071),\n                array(-11618399, -14554430, -24321212, 7655128, -1369274, 5214312, -27400540, 10258390, -17646694, -8186692),\n            ),\n            array(\n                array(11431204, 15823007, 26570245, 14329124, 18029990, 4796082, -31446179, 15580664, 9280358, -3973687),\n                array(-160783, -10326257, -22855316, -4304997, -20861367, -13621002, -32810901, -11181622, -15545091, 4387441),\n                array(-20799378, 12194512, 3937617, -5805892, -27154820, 9340370, -24513992, 8548137, 20617071, -7482001),\n            ),\n            array(\n                array(-938825, -3930586, -8714311, 16124718, 24603125, -6225393, -13775352, -11875822, 24345683, 10325460),\n                array(-19855277, -1568885, -22202708, 8714034, 14007766, 6928528, 16318175, -1010689, 4766743, 3552007),\n                array(-21751364, -16730916, 1351763, -803421, -4009670, 3950935, 3217514, 14481909, 10988822, -3994762),\n            ),\n            array(\n                array(15564307, -14311570, 3101243, 5684148, 30446780, -8051356, 12677127, -6505343, -8295852, 13296005),\n                array(-9442290, 6624296, -30298964, -11913677, -4670981, -2057379, 31521204, 9614054, -30000824, 12074674),\n                array(4771191, -135239, 14290749, -13089852, 27992298, 14998318, -1413936, -1556716, 29832613, -16391035),\n            ),\n            array(\n                array(7064884, -7541174, -19161962, -5067537, -18891269, -2912736, 25825242, 5293297, -27122660, 13101590),\n                array(-2298563, 2439670, -7466610, 1719965, -27267541, -16328445, 32512469, -5317593, -30356070, -4190957),\n                array(-30006540, 10162316, -33180176, 3981723, -16482138, -13070044, 14413974, 9515896, 19568978, 9628812),\n            ),\n            array(\n                array(33053803, 199357, 15894591, 1583059, 27380243, -4580435, -17838894, -6106839, -6291786, 3437740),\n                array(-18978877, 3884493, 19469877, 12726490, 15913552, 13614290, -22961733, 70104, 7463304, 4176122),\n                array(-27124001, 10659917, 11482427, -16070381, 12771467, -6635117, -32719404, -5322751, 24216882, 5944158),\n            ),\n            array(\n                array(8894125, 7450974, -2664149, -9765752, -28080517, -12389115, 19345746, 14680796, 11632993, 5847885),\n                array(26942781, -2315317, 9129564, -4906607, 26024105, 11769399, -11518837, 6367194, -9727230, 4782140),\n                array(19916461, -4828410, -22910704, -11414391, 25606324, -5972441, 33253853, 8220911, 6358847, -1873857),\n            ),\n            array(\n                array(801428, -2081702, 16569428, 11065167, 29875704, 96627, 7908388, -4480480, -13538503, 1387155),\n                array(19646058, 5720633, -11416706, 12814209, 11607948, 12749789, 14147075, 15156355, -21866831, 11835260),\n                array(19299512, 1155910, 28703737, 14890794, 2925026, 7269399, 26121523, 15467869, -26560550, 5052483),\n            ),\n        ),\n        array(\n            array(\n                array(-3017432, 10058206, 1980837, 3964243, 22160966, 12322533, -6431123, -12618185, 12228557, -7003677),\n                array(32944382, 14922211, -22844894, 5188528, 21913450, -8719943, 4001465, 13238564, -6114803, 8653815),\n                array(22865569, -4652735, 27603668, -12545395, 14348958, 8234005, 24808405, 5719875, 28483275, 2841751),\n            ),\n            array(\n                array(-16420968, -1113305, -327719, -12107856, 21886282, -15552774, -1887966, -315658, 19932058, -12739203),\n                array(-11656086, 10087521, -8864888, -5536143, -19278573, -3055912, 3999228, 13239134, -4777469, -13910208),\n                array(1382174, -11694719, 17266790, 9194690, -13324356, 9720081, 20403944, 11284705, -14013818, 3093230),\n            ),\n            array(\n                array(16650921, -11037932, -1064178, 1570629, -8329746, 7352753, -302424, 16271225, -24049421, -6691850),\n                array(-21911077, -5927941, -4611316, -5560156, -31744103, -10785293, 24123614, 15193618, -21652117, -16739389),\n                array(-9935934, -4289447, -25279823, 4372842, 2087473, 10399484, 31870908, 14690798, 17361620, 11864968),\n            ),\n            array(\n                array(-11307610, 6210372, 13206574, 5806320, -29017692, -13967200, -12331205, -7486601, -25578460, -16240689),\n                array(14668462, -12270235, 26039039, 15305210, 25515617, 4542480, 10453892, 6577524, 9145645, -6443880),\n                array(5974874, 3053895, -9433049, -10385191, -31865124, 3225009, -7972642, 3936128, -5652273, -3050304),\n            ),\n            array(\n                array(30625386, -4729400, -25555961, -12792866, -20484575, 7695099, 17097188, -16303496, -27999779, 1803632),\n                array(-3553091, 9865099, -5228566, 4272701, -5673832, -16689700, 14911344, 12196514, -21405489, 7047412),\n                array(20093277, 9920966, -11138194, -5343857, 13161587, 12044805, -32856851, 4124601, -32343828, -10257566),\n            ),\n            array(\n                array(-20788824, 14084654, -13531713, 7842147, 19119038, -13822605, 4752377, -8714640, -21679658, 2288038),\n                array(-26819236, -3283715, 29965059, 3039786, -14473765, 2540457, 29457502, 14625692, -24819617, 12570232),\n                array(-1063558, -11551823, 16920318, 12494842, 1278292, -5869109, -21159943, -3498680, -11974704, 4724943),\n            ),\n            array(\n                array(17960970, -11775534, -4140968, -9702530, -8876562, -1410617, -12907383, -8659932, -29576300, 1903856),\n                array(23134274, -14279132, -10681997, -1611936, 20684485, 15770816, -12989750, 3190296, 26955097, 14109738),\n                array(15308788, 5320727, -30113809, -14318877, 22902008, 7767164, 29425325, -11277562, 31960942, 11934971),\n            ),\n            array(\n                array(-27395711, 8435796, 4109644, 12222639, -24627868, 14818669, 20638173, 4875028, 10491392, 1379718),\n                array(-13159415, 9197841, 3875503, -8936108, -1383712, -5879801, 33518459, 16176658, 21432314, 12180697),\n                array(-11787308, 11500838, 13787581, -13832590, -22430679, 10140205, 1465425, 12689540, -10301319, -13872883),\n            ),\n        ),\n        array(\n            array(\n                array(5414091, -15386041, -21007664, 9643570, 12834970, 1186149, -2622916, -1342231, 26128231, 6032912),\n                array(-26337395, -13766162, 32496025, -13653919, 17847801, -12669156, 3604025, 8316894, -25875034, -10437358),\n                array(3296484, 6223048, 24680646, -12246460, -23052020, 5903205, -8862297, -4639164, 12376617, 3188849),\n            ),\n            array(\n                array(29190488, -14659046, 27549113, -1183516, 3520066, -10697301, 32049515, -7309113, -16109234, -9852307),\n                array(-14744486, -9309156, 735818, -598978, -20407687, -5057904, 25246078, -15795669, 18640741, -960977),\n                array(-6928835, -16430795, 10361374, 5642961, 4910474, 12345252, -31638386, -494430, 10530747, 1053335),\n            ),\n            array(\n                array(-29265967, -14186805, -13538216, -12117373, -19457059, -10655384, -31462369, -2948985, 24018831, 15026644),\n                array(-22592535, -3145277, -2289276, 5953843, -13440189, 9425631, 25310643, 13003497, -2314791, -15145616),\n                array(-27419985, -603321, -8043984, -1669117, -26092265, 13987819, -27297622, 187899, -23166419, -2531735),\n            ),\n            array(\n                array(-21744398, -13810475, 1844840, 5021428, -10434399, -15911473, 9716667, 16266922, -5070217, 726099),\n                array(29370922, -6053998, 7334071, -15342259, 9385287, 2247707, -13661962, -4839461, 30007388, -15823341),\n                array(-936379, 16086691, 23751945, -543318, -1167538, -5189036, 9137109, 730663, 9835848, 4555336),\n            ),\n            array(\n                array(-23376435, 1410446, -22253753, -12899614, 30867635, 15826977, 17693930, 544696, -11985298, 12422646),\n                array(31117226, -12215734, -13502838, 6561947, -9876867, -12757670, -5118685, -4096706, 29120153, 13924425),\n                array(-17400879, -14233209, 19675799, -2734756, -11006962, -5858820, -9383939, -11317700, 7240931, -237388),\n            ),\n            array(\n                array(-31361739, -11346780, -15007447, -5856218, -22453340, -12152771, 1222336, 4389483, 3293637, -15551743),\n                array(-16684801, -14444245, 11038544, 11054958, -13801175, -3338533, -24319580, 7733547, 12796905, -6335822),\n                array(-8759414, -10817836, -25418864, 10783769, -30615557, -9746811, -28253339, 3647836, 3222231, -11160462),\n            ),\n            array(\n                array(18606113, 1693100, -25448386, -15170272, 4112353, 10045021, 23603893, -2048234, -7550776, 2484985),\n                array(9255317, -3131197, -12156162, -1004256, 13098013, -9214866, 16377220, -2102812, -19802075, -3034702),\n                array(-22729289, 7496160, -5742199, 11329249, 19991973, -3347502, -31718148, 9936966, -30097688, -10618797),\n            ),\n            array(\n                array(21878590, -5001297, 4338336, 13643897, -3036865, 13160960, 19708896, 5415497, -7360503, -4109293),\n                array(27736861, 10103576, 12500508, 8502413, -3413016, -9633558, 10436918, -1550276, -23659143, -8132100),\n                array(19492550, -12104365, -29681976, -852630, -3208171, 12403437, 30066266, 8367329, 13243957, 8709688),\n            ),\n        ),\n        array(\n            array(\n                array(12015105, 2801261, 28198131, 10151021, 24818120, -4743133, -11194191, -5645734, 5150968, 7274186),\n                array(2831366, -12492146, 1478975, 6122054, 23825128, -12733586, 31097299, 6083058, 31021603, -9793610),\n                array(-2529932, -2229646, 445613, 10720828, -13849527, -11505937, -23507731, 16354465, 15067285, -14147707),\n            ),\n            array(\n                array(7840942, 14037873, -33364863, 15934016, -728213, -3642706, 21403988, 1057586, -19379462, -12403220),\n                array(915865, -16469274, 15608285, -8789130, -24357026, 6060030, -17371319, 8410997, -7220461, 16527025),\n                array(32922597, -556987, 20336074, -16184568, 10903705, -5384487, 16957574, 52992, 23834301, 6588044),\n            ),\n            array(\n                array(32752030, 11232950, 3381995, -8714866, 22652988, -10744103, 17159699, 16689107, -20314580, -1305992),\n                array(-4689649, 9166776, -25710296, -10847306, 11576752, 12733943, 7924251, -2752281, 1976123, -7249027),\n                array(21251222, 16309901, -2983015, -6783122, 30810597, 12967303, 156041, -3371252, 12331345, -8237197),\n            ),\n            array(\n                array(8651614, -4477032, -16085636, -4996994, 13002507, 2950805, 29054427, -5106970, 10008136, -4667901),\n                array(31486080, 15114593, -14261250, 12951354, 14369431, -7387845, 16347321, -13662089, 8684155, -10532952),\n                array(19443825, 11385320, 24468943, -9659068, -23919258, 2187569, -26263207, -6086921, 31316348, 14219878),\n            ),\n            array(\n                array(-28594490, 1193785, 32245219, 11392485, 31092169, 15722801, 27146014, 6992409, 29126555, 9207390),\n                array(32382935, 1110093, 18477781, 11028262, -27411763, -7548111, -4980517, 10843782, -7957600, -14435730),\n                array(2814918, 7836403, 27519878, -7868156, -20894015, -11553689, -21494559, 8550130, 28346258, 1994730),\n            ),\n            array(\n                array(-19578299, 8085545, -14000519, -3948622, 2785838, -16231307, -19516951, 7174894, 22628102, 8115180),\n                array(-30405132, 955511, -11133838, -15078069, -32447087, -13278079, -25651578, 3317160, -9943017, 930272),\n                array(-15303681, -6833769, 28856490, 1357446, 23421993, 1057177, 24091212, -1388970, -22765376, -10650715),\n            ),\n            array(\n                array(-22751231, -5303997, -12907607, -12768866, -15811511, -7797053, -14839018, -16554220, -1867018, 8398970),\n                array(-31969310, 2106403, -4736360, 1362501, 12813763, 16200670, 22981545, -6291273, 18009408, -15772772),\n                array(-17220923, -9545221, -27784654, 14166835, 29815394, 7444469, 29551787, -3727419, 19288549, 1325865),\n            ),\n            array(\n                array(15100157, -15835752, -23923978, -1005098, -26450192, 15509408, 12376730, -3479146, 33166107, -8042750),\n                array(20909231, 13023121, -9209752, 16251778, -5778415, -8094914, 12412151, 10018715, 2213263, -13878373),\n                array(32529814, -11074689, 30361439, -16689753, -9135940, 1513226, 22922121, 6382134, -5766928, 8371348),\n            ),\n        ),\n        array(\n            array(\n                array(9923462, 11271500, 12616794, 3544722, -29998368, -1721626, 12891687, -8193132, -26442943, 10486144),\n                array(-22597207, -7012665, 8587003, -8257861, 4084309, -12970062, 361726, 2610596, -23921530, -11455195),\n                array(5408411, -1136691, -4969122, 10561668, 24145918, 14240566, 31319731, -4235541, 19985175, -3436086),\n            ),\n            array(\n                array(-13994457, 16616821, 14549246, 3341099, 32155958, 13648976, -17577068, 8849297, 65030, 8370684),\n                array(-8320926, -12049626, 31204563, 5839400, -20627288, -1057277, -19442942, 6922164, 12743482, -9800518),\n                array(-2361371, 12678785, 28815050, 4759974, -23893047, 4884717, 23783145, 11038569, 18800704, 255233),\n            ),\n            array(\n                array(-5269658, -1773886, 13957886, 7990715, 23132995, 728773, 13393847, 9066957, 19258688, -14753793),\n                array(-2936654, -10827535, -10432089, 14516793, -3640786, 4372541, -31934921, 2209390, -1524053, 2055794),\n                array(580882, 16705327, 5468415, -2683018, -30926419, -14696000, -7203346, -8994389, -30021019, 7394435),\n            ),\n            array(\n                array(23838809, 1822728, -15738443, 15242727, 8318092, -3733104, -21672180, -3492205, -4821741, 14799921),\n                array(13345610, 9759151, 3371034, -16137791, 16353039, 8577942, 31129804, 13496856, -9056018, 7402518),\n                array(2286874, -4435931, -20042458, -2008336, -13696227, 5038122, 11006906, -15760352, 8205061, 1607563),\n            ),\n            array(\n                array(14414086, -8002132, 3331830, -3208217, 22249151, -5594188, 18364661, -2906958, 30019587, -9029278),\n                array(-27688051, 1585953, -10775053, 931069, -29120221, -11002319, -14410829, 12029093, 9944378, 8024),\n                array(4368715, -3709630, 29874200, -15022983, -20230386, -11410704, -16114594, -999085, -8142388, 5640030),\n            ),\n            array(\n                array(10299610, 13746483, 11661824, 16234854, 7630238, 5998374, 9809887, -16694564, 15219798, -14327783),\n                array(27425505, -5719081, 3055006, 10660664, 23458024, 595578, -15398605, -1173195, -18342183, 9742717),\n                array(6744077, 2427284, 26042789, 2720740, -847906, 1118974, 32324614, 7406442, 12420155, 1994844),\n            ),\n            array(\n                array(14012521, -5024720, -18384453, -9578469, -26485342, -3936439, -13033478, -10909803, 24319929, -6446333),\n                array(16412690, -4507367, 10772641, 15929391, -17068788, -4658621, 10555945, -10484049, -30102368, -4739048),\n                array(22397382, -7767684, -9293161, -12792868, 17166287, -9755136, -27333065, 6199366, 21880021, -12250760),\n            ),\n            array(\n                array(-4283307, 5368523, -31117018, 8163389, -30323063, 3209128, 16557151, 8890729, 8840445, 4957760),\n                array(-15447727, 709327, -6919446, -10870178, -29777922, 6522332, -21720181, 12130072, -14796503, 5005757),\n                array(-2114751, -14308128, 23019042, 15765735, -25269683, 6002752, 10183197, -13239326, -16395286, -2176112),\n            ),\n        ),\n        array(\n            array(\n                array(-19025756, 1632005, 13466291, -7995100, -23640451, 16573537, -32013908, -3057104, 22208662, 2000468),\n                array(3065073, -1412761, -25598674, -361432, -17683065, -5703415, -8164212, 11248527, -3691214, -7414184),\n                array(10379208, -6045554, 8877319, 1473647, -29291284, -12507580, 16690915, 2553332, -3132688, 16400289),\n            ),\n            array(\n                array(15716668, 1254266, -18472690, 7446274, -8448918, 6344164, -22097271, -7285580, 26894937, 9132066),\n                array(24158887, 12938817, 11085297, -8177598, -28063478, -4457083, -30576463, 64452, -6817084, -2692882),\n                array(13488534, 7794716, 22236231, 5989356, 25426474, -12578208, 2350710, -3418511, -4688006, 2364226),\n            ),\n            array(\n                array(16335052, 9132434, 25640582, 6678888, 1725628, 8517937, -11807024, -11697457, 15445875, -7798101),\n                array(29004207, -7867081, 28661402, -640412, -12794003, -7943086, 31863255, -4135540, -278050, -15759279),\n                array(-6122061, -14866665, -28614905, 14569919, -10857999, -3591829, 10343412, -6976290, -29828287, -10815811),\n            ),\n            array(\n                array(27081650, 3463984, 14099042, -4517604, 1616303, -6205604, 29542636, 15372179, 17293797, 960709),\n                array(20263915, 11434237, -5765435, 11236810, 13505955, -10857102, -16111345, 6493122, -19384511, 7639714),\n                array(-2830798, -14839232, 25403038, -8215196, -8317012, -16173699, 18006287, -16043750, 29994677, -15808121),\n            ),\n            array(\n                array(9769828, 5202651, -24157398, -13631392, -28051003, -11561624, -24613141, -13860782, -31184575, 709464),\n                array(12286395, 13076066, -21775189, -1176622, -25003198, 4057652, -32018128, -8890874, 16102007, 13205847),\n                array(13733362, 5599946, 10557076, 3195751, -5557991, 8536970, -25540170, 8525972, 10151379, 10394400),\n            ),\n            array(\n                array(4024660, -16137551, 22436262, 12276534, -9099015, -2686099, 19698229, 11743039, -33302334, 8934414),\n                array(-15879800, -4525240, -8580747, -2934061, 14634845, -698278, -9449077, 3137094, -11536886, 11721158),\n                array(17555939, -5013938, 8268606, 2331751, -22738815, 9761013, 9319229, 8835153, -9205489, -1280045),\n            ),\n            array(\n                array(-461409, -7830014, 20614118, 16688288, -7514766, -4807119, 22300304, 505429, 6108462, -6183415),\n                array(-5070281, 12367917, -30663534, 3234473, 32617080, -8422642, 29880583, -13483331, -26898490, -7867459),\n                array(-31975283, 5726539, 26934134, 10237677, -3173717, -605053, 24199304, 3795095, 7592688, -14992079),\n            ),\n            array(\n                array(21594432, -14964228, 17466408, -4077222, 32537084, 2739898, 6407723, 12018833, -28256052, 4298412),\n                array(-20650503, -11961496, -27236275, 570498, 3767144, -1717540, 13891942, -1569194, 13717174, 10805743),\n                array(-14676630, -15644296, 15287174, 11927123, 24177847, -8175568, -796431, 14860609, -26938930, -5863836),\n            ),\n        ),\n        array(\n            array(\n                array(12962541, 5311799, -10060768, 11658280, 18855286, -7954201, 13286263, -12808704, -4381056, 9882022),\n                array(18512079, 11319350, -20123124, 15090309, 18818594, 5271736, -22727904, 3666879, -23967430, -3299429),\n                array(-6789020, -3146043, 16192429, 13241070, 15898607, -14206114, -10084880, -6661110, -2403099, 5276065),\n            ),\n            array(\n                array(30169808, -5317648, 26306206, -11750859, 27814964, 7069267, 7152851, 3684982, 1449224, 13082861),\n                array(10342826, 3098505, 2119311, 193222, 25702612, 12233820, 23697382, 15056736, -21016438, -8202000),\n                array(-33150110, 3261608, 22745853, 7948688, 19370557, -15177665, -26171976, 6482814, -10300080, -11060101),\n            ),\n            array(\n                array(32869458, -5408545, 25609743, 15678670, -10687769, -15471071, 26112421, 2521008, -22664288, 6904815),\n                array(29506923, 4457497, 3377935, -9796444, -30510046, 12935080, 1561737, 3841096, -29003639, -6657642),\n                array(10340844, -6630377, -18656632, -2278430, 12621151, -13339055, 30878497, -11824370, -25584551, 5181966),\n            ),\n            array(\n                array(25940115, -12658025, 17324188, -10307374, -8671468, 15029094, 24396252, -16450922, -2322852, -12388574),\n                array(-21765684, 9916823, -1300409, 4079498, -1028346, 11909559, 1782390, 12641087, 20603771, -6561742),\n                array(-18882287, -11673380, 24849422, 11501709, 13161720, -4768874, 1925523, 11914390, 4662781, 7820689),\n            ),\n            array(\n                array(12241050, -425982, 8132691, 9393934, 32846760, -1599620, 29749456, 12172924, 16136752, 15264020),\n                array(-10349955, -14680563, -8211979, 2330220, -17662549, -14545780, 10658213, 6671822, 19012087, 3772772),\n                array(3753511, -3421066, 10617074, 2028709, 14841030, -6721664, 28718732, -15762884, 20527771, 12988982),\n            ),\n            array(\n                array(-14822485, -5797269, -3707987, 12689773, -898983, -10914866, -24183046, -10564943, 3299665, -12424953),\n                array(-16777703, -15253301, -9642417, 4978983, 3308785, 8755439, 6943197, 6461331, -25583147, 8991218),\n                array(-17226263, 1816362, -1673288, -6086439, 31783888, -8175991, -32948145, 7417950, -30242287, 1507265),\n            ),\n            array(\n                array(29692663, 6829891, -10498800, 4334896, 20945975, -11906496, -28887608, 8209391, 14606362, -10647073),\n                array(-3481570, 8707081, 32188102, 5672294, 22096700, 1711240, -33020695, 9761487, 4170404, -2085325),\n                array(-11587470, 14855945, -4127778, -1531857, -26649089, 15084046, 22186522, 16002000, -14276837, -8400798),\n            ),\n            array(\n                array(-4811456, 13761029, -31703877, -2483919, -3312471, 7869047, -7113572, -9620092, 13240845, 10965870),\n                array(-7742563, -8256762, -14768334, -13656260, -23232383, 12387166, 4498947, 14147411, 29514390, 4302863),\n                array(-13413405, -12407859, 20757302, -13801832, 14785143, 8976368, -5061276, -2144373, 17846988, -13971927),\n            ),\n        ),\n        array(\n            array(\n                array(-2244452, -754728, -4597030, -1066309, -6247172, 1455299, -21647728, -9214789, -5222701, 12650267),\n                array(-9906797, -16070310, 21134160, 12198166, -27064575, 708126, 387813, 13770293, -19134326, 10958663),\n                array(22470984, 12369526, 23446014, -5441109, -21520802, -9698723, -11772496, -11574455, -25083830, 4271862),\n            ),\n            array(\n                array(-25169565, -10053642, -19909332, 15361595, -5984358, 2159192, 75375, -4278529, -32526221, 8469673),\n                array(15854970, 4148314, -8893890, 7259002, 11666551, 13824734, -30531198, 2697372, 24154791, -9460943),\n                array(15446137, -15806644, 29759747, 14019369, 30811221, -9610191, -31582008, 12840104, 24913809, 9815020),\n            ),\n            array(\n                array(-4709286, -5614269, -31841498, -12288893, -14443537, 10799414, -9103676, 13438769, 18735128, 9466238),\n                array(11933045, 9281483, 5081055, -5183824, -2628162, -4905629, -7727821, -10896103, -22728655, 16199064),\n                array(14576810, 379472, -26786533, -8317236, -29426508, -10812974, -102766, 1876699, 30801119, 2164795),\n            ),\n            array(\n                array(15995086, 3199873, 13672555, 13712240, -19378835, -4647646, -13081610, -15496269, -13492807, 1268052),\n                array(-10290614, -3659039, -3286592, 10948818, 23037027, 3794475, -3470338, -12600221, -17055369, 3565904),\n                array(29210088, -9419337, -5919792, -4952785, 10834811, -13327726, -16512102, -10820713, -27162222, -14030531),\n            ),\n            array(\n                array(-13161890, 15508588, 16663704, -8156150, -28349942, 9019123, -29183421, -3769423, 2244111, -14001979),\n                array(-5152875, -3800936, -9306475, -6071583, 16243069, 14684434, -25673088, -16180800, 13491506, 4641841),\n                array(10813417, 643330, -19188515, -728916, 30292062, -16600078, 27548447, -7721242, 14476989, -12767431),\n            ),\n            array(\n                array(10292079, 9984945, 6481436, 8279905, -7251514, 7032743, 27282937, -1644259, -27912810, 12651324),\n                array(-31185513, -813383, 22271204, 11835308, 10201545, 15351028, 17099662, 3988035, 21721536, -3148940),\n                array(10202177, -6545839, -31373232, -9574638, -32150642, -8119683, -12906320, 3852694, 13216206, 14842320),\n            ),\n            array(\n                array(-15815640, -10601066, -6538952, -7258995, -6984659, -6581778, -31500847, 13765824, -27434397, 9900184),\n                array(14465505, -13833331, -32133984, -14738873, -27443187, 12990492, 33046193, 15796406, -7051866, -8040114),\n                array(30924417, -8279620, 6359016, -12816335, 16508377, 9071735, -25488601, 15413635, 9524356, -7018878),\n            ),\n            array(\n                array(12274201, -13175547, 32627641, -1785326, 6736625, 13267305, 5237659, -5109483, 15663516, 4035784),\n                array(-2951309, 8903985, 17349946, 601635, -16432815, -4612556, -13732739, -15889334, -22258478, 4659091),\n                array(-16916263, -4952973, -30393711, -15158821, 20774812, 15897498, 5736189, 15026997, -2178256, -13455585),\n            ),\n        ),\n        array(\n            array(\n                array(-8858980, -2219056, 28571666, -10155518, -474467, -10105698, -3801496, 278095, 23440562, -290208),\n                array(10226241, -5928702, 15139956, 120818, -14867693, 5218603, 32937275, 11551483, -16571960, -7442864),\n                array(17932739, -12437276, -24039557, 10749060, 11316803, 7535897, 22503767, 5561594, -3646624, 3898661),\n            ),\n            array(\n                array(7749907, -969567, -16339731, -16464, -25018111, 15122143, -1573531, 7152530, 21831162, 1245233),\n                array(26958459, -14658026, 4314586, 8346991, -5677764, 11960072, -32589295, -620035, -30402091, -16716212),\n                array(-12165896, 9166947, 33491384, 13673479, 29787085, 13096535, 6280834, 14587357, -22338025, 13987525),\n            ),\n            array(\n                array(-24349909, 7778775, 21116000, 15572597, -4833266, -5357778, -4300898, -5124639, -7469781, -2858068),\n                array(9681908, -6737123, -31951644, 13591838, -6883821, 386950, 31622781, 6439245, -14581012, 4091397),\n                array(-8426427, 1470727, -28109679, -1596990, 3978627, -5123623, -19622683, 12092163, 29077877, -14741988),\n            ),\n            array(\n                array(5269168, -6859726, -13230211, -8020715, 25932563, 1763552, -5606110, -5505881, -20017847, 2357889),\n                array(32264008, -15407652, -5387735, -1160093, -2091322, -3946900, 23104804, -12869908, 5727338, 189038),\n                array(14609123, -8954470, -6000566, -16622781, -14577387, -7743898, -26745169, 10942115, -25888931, -14884697),\n            ),\n            array(\n                array(20513500, 5557931, -15604613, 7829531, 26413943, -2019404, -21378968, 7471781, 13913677, -5137875),\n                array(-25574376, 11967826, 29233242, 12948236, -6754465, 4713227, -8940970, 14059180, 12878652, 8511905),\n                array(-25656801, 3393631, -2955415, -7075526, -2250709, 9366908, -30223418, 6812974, 5568676, -3127656),\n            ),\n            array(\n                array(11630004, 12144454, 2116339, 13606037, 27378885, 15676917, -17408753, -13504373, -14395196, 8070818),\n                array(27117696, -10007378, -31282771, -5570088, 1127282, 12772488, -29845906, 10483306, -11552749, -1028714),\n                array(10637467, -5688064, 5674781, 1072708, -26343588, -6982302, -1683975, 9177853, -27493162, 15431203),\n            ),\n            array(\n                array(20525145, 10892566, -12742472, 12779443, -29493034, 16150075, -28240519, 14943142, -15056790, -7935931),\n                array(-30024462, 5626926, -551567, -9981087, 753598, 11981191, 25244767, -3239766, -3356550, 9594024),\n                array(-23752644, 2636870, -5163910, -10103818, 585134, 7877383, 11345683, -6492290, 13352335, -10977084),\n            ),\n            array(\n                array(-1931799, -5407458, 3304649, -12884869, 17015806, -4877091, -29783850, -7752482, -13215537, -319204),\n                array(20239939, 6607058, 6203985, 3483793, -18386976, -779229, -20723742, 15077870, -22750759, 14523817),\n                array(27406042, -6041657, 27423596, -4497394, 4996214, 10002360, -28842031, -4545494, -30172742, -4805667),\n            ),\n        ),\n        array(\n            array(\n                array(11374242, 12660715, 17861383, -12540833, 10935568, 1099227, -13886076, -9091740, -27727044, 11358504),\n                array(-12730809, 10311867, 1510375, 10778093, -2119455, -9145702, 32676003, 11149336, -26123651, 4985768),\n                array(-19096303, 341147, -6197485, -239033, 15756973, -8796662, -983043, 13794114, -19414307, -15621255),\n            ),\n            array(\n                array(6490081, 11940286, 25495923, -7726360, 8668373, -8751316, 3367603, 6970005, -1691065, -9004790),\n                array(1656497, 13457317, 15370807, 6364910, 13605745, 8362338, -19174622, -5475723, -16796596, -5031438),\n                array(-22273315, -13524424, -64685, -4334223, -18605636, -10921968, -20571065, -7007978, -99853, -10237333),\n            ),\n            array(\n                array(17747465, 10039260, 19368299, -4050591, -20630635, -16041286, 31992683, -15857976, -29260363, -5511971),\n                array(31932027, -4986141, -19612382, 16366580, 22023614, 88450, 11371999, -3744247, 4882242, -10626905),\n                array(29796507, 37186, 19818052, 10115756, -11829032, 3352736, 18551198, 3272828, -5190932, -4162409),\n            ),\n            array(\n                array(12501286, 4044383, -8612957, -13392385, -32430052, 5136599, -19230378, -3529697, 330070, -3659409),\n                array(6384877, 2899513, 17807477, 7663917, -2358888, 12363165, 25366522, -8573892, -271295, 12071499),\n                array(-8365515, -4042521, 25133448, -4517355, -6211027, 2265927, -32769618, 1936675, -5159697, 3829363),\n            ),\n            array(\n                array(28425966, -5835433, -577090, -4697198, -14217555, 6870930, 7921550, -6567787, 26333140, 14267664),\n                array(-11067219, 11871231, 27385719, -10559544, -4585914, -11189312, 10004786, -8709488, -21761224, 8930324),\n                array(-21197785, -16396035, 25654216, -1725397, 12282012, 11008919, 1541940, 4757911, -26491501, -16408940),\n            ),\n            array(\n                array(13537262, -7759490, -20604840, 10961927, -5922820, -13218065, -13156584, 6217254, -15943699, 13814990),\n                array(-17422573, 15157790, 18705543, 29619, 24409717, -260476, 27361681, 9257833, -1956526, -1776914),\n                array(-25045300, -10191966, 15366585, 15166509, -13105086, 8423556, -29171540, 12361135, -18685978, 4578290),\n            ),\n            array(\n                array(24579768, 3711570, 1342322, -11180126, -27005135, 14124956, -22544529, 14074919, 21964432, 8235257),\n                array(-6528613, -2411497, 9442966, -5925588, 12025640, -1487420, -2981514, -1669206, 13006806, 2355433),\n                array(-16304899, -13605259, -6632427, -5142349, 16974359, -10911083, 27202044, 1719366, 1141648, -12796236),\n            ),\n            array(\n                array(-12863944, -13219986, -8318266, -11018091, -6810145, -4843894, 13475066, -3133972, 32674895, 13715045),\n                array(11423335, -5468059, 32344216, 8962751, 24989809, 9241752, -13265253, 16086212, -28740881, -15642093),\n                array(-1409668, 12530728, -6368726, 10847387, 19531186, -14132160, -11709148, 7791794, -27245943, 4383347),\n            ),\n        ),\n        array(\n            array(\n                array(-28970898, 5271447, -1266009, -9736989, -12455236, 16732599, -4862407, -4906449, 27193557, 6245191),\n                array(-15193956, 5362278, -1783893, 2695834, 4960227, 12840725, 23061898, 3260492, 22510453, 8577507),\n                array(-12632451, 11257346, -32692994, 13548177, -721004, 10879011, 31168030, 13952092, -29571492, -3635906),\n            ),\n            array(\n                array(3877321, -9572739, 32416692, 5405324, -11004407, -13656635, 3759769, 11935320, 5611860, 8164018),\n                array(-16275802, 14667797, 15906460, 12155291, -22111149, -9039718, 32003002, -8832289, 5773085, -8422109),\n                array(-23788118, -8254300, 1950875, 8937633, 18686727, 16459170, -905725, 12376320, 31632953, 190926),\n            ),\n            array(\n                array(-24593607, -16138885, -8423991, 13378746, 14162407, 6901328, -8288749, 4508564, -25341555, -3627528),\n                array(8884438, -5884009, 6023974, 10104341, -6881569, -4941533, 18722941, -14786005, -1672488, 827625),\n                array(-32720583, -16289296, -32503547, 7101210, 13354605, 2659080, -1800575, -14108036, -24878478, 1541286),\n            ),\n            array(\n                array(2901347, -1117687, 3880376, -10059388, -17620940, -3612781, -21802117, -3567481, 20456845, -1885033),\n                array(27019610, 12299467, -13658288, -1603234, -12861660, -4861471, -19540150, -5016058, 29439641, 15138866),\n                array(21536104, -6626420, -32447818, -10690208, -22408077, 5175814, -5420040, -16361163, 7779328, 109896),\n            ),\n            array(\n                array(30279744, 14648750, -8044871, 6425558, 13639621, -743509, 28698390, 12180118, 23177719, -554075),\n                array(26572847, 3405927, -31701700, 12890905, -19265668, 5335866, -6493768, 2378492, 4439158, -13279347),\n                array(-22716706, 3489070, -9225266, -332753, 18875722, -1140095, 14819434, -12731527, -17717757, -5461437),\n            ),\n            array(\n                array(-5056483, 16566551, 15953661, 3767752, -10436499, 15627060, -820954, 2177225, 8550082, -15114165),\n                array(-18473302, 16596775, -381660, 15663611, 22860960, 15585581, -27844109, -3582739, -23260460, -8428588),\n                array(-32480551, 15707275, -8205912, -5652081, 29464558, 2713815, -22725137, 15860482, -21902570, 1494193),\n            ),\n            array(\n                array(-19562091, -14087393, -25583872, -9299552, 13127842, 759709, 21923482, 16529112, 8742704, 12967017),\n                array(-28464899, 1553205, 32536856, -10473729, -24691605, -406174, -8914625, -2933896, -29903758, 15553883),\n                array(21877909, 3230008, 9881174, 10539357, -4797115, 2841332, 11543572, 14513274, 19375923, -12647961),\n            ),\n            array(\n                array(8832269, -14495485, 13253511, 5137575, 5037871, 4078777, 24880818, -6222716, 2862653, 9455043),\n                array(29306751, 5123106, 20245049, -14149889, 9592566, 8447059, -2077124, -2990080, 15511449, 4789663),\n                array(-20679756, 7004547, 8824831, -9434977, -4045704, -3750736, -5754762, 108893, 23513200, 16652362),\n            ),\n        ),\n        array(\n            array(\n                array(-33256173, 4144782, -4476029, -6579123, 10770039, -7155542, -6650416, -12936300, -18319198, 10212860),\n                array(2756081, 8598110, 7383731, -6859892, 22312759, -1105012, 21179801, 2600940, -9988298, -12506466),\n                array(-24645692, 13317462, -30449259, -15653928, 21365574, -10869657, 11344424, 864440, -2499677, -16710063),\n            ),\n            array(\n                array(-26432803, 6148329, -17184412, -14474154, 18782929, -275997, -22561534, 211300, 2719757, 4940997),\n                array(-1323882, 3911313, -6948744, 14759765, -30027150, 7851207, 21690126, 8518463, 26699843, 5276295),\n                array(-13149873, -6429067, 9396249, 365013, 24703301, -10488939, 1321586, 149635, -15452774, 7159369),\n            ),\n            array(\n                array(9987780, -3404759, 17507962, 9505530, 9731535, -2165514, 22356009, 8312176, 22477218, -8403385),\n                array(18155857, -16504990, 19744716, 9006923, 15154154, -10538976, 24256460, -4864995, -22548173, 9334109),\n                array(2986088, -4911893, 10776628, -3473844, 10620590, -7083203, -21413845, 14253545, -22587149, 536906),\n            ),\n            array(\n                array(4377756, 8115836, 24567078, 15495314, 11625074, 13064599, 7390551, 10589625, 10838060, -15420424),\n                array(-19342404, 867880, 9277171, -3218459, -14431572, -1986443, 19295826, -15796950, 6378260, 699185),\n                array(7895026, 4057113, -7081772, -13077756, -17886831, -323126, -716039, 15693155, -5045064, -13373962),\n            ),\n            array(\n                array(-7737563, -5869402, -14566319, -7406919, 11385654, 13201616, 31730678, -10962840, -3918636, -9669325),\n                array(10188286, -15770834, -7336361, 13427543, 22223443, 14896287, 30743455, 7116568, -21786507, 5427593),\n                array(696102, 13206899, 27047647, -10632082, 15285305, -9853179, 10798490, -4578720, 19236243, 12477404),\n            ),\n            array(\n                array(-11229439, 11243796, -17054270, -8040865, -788228, -8167967, -3897669, 11180504, -23169516, 7733644),\n                array(17800790, -14036179, -27000429, -11766671, 23887827, 3149671, 23466177, -10538171, 10322027, 15313801),\n                array(26246234, 11968874, 32263343, -5468728, 6830755, -13323031, -15794704, -101982, -24449242, 10890804),\n            ),\n            array(\n                array(-31365647, 10271363, -12660625, -6267268, 16690207, -13062544, -14982212, 16484931, 25180797, -5334884),\n                array(-586574, 10376444, -32586414, -11286356, 19801893, 10997610, 2276632, 9482883, 316878, 13820577),\n                array(-9882808, -4510367, -2115506, 16457136, -11100081, 11674996, 30756178, -7515054, 30696930, -3712849),\n            ),\n            array(\n                array(32988917, -9603412, 12499366, 7910787, -10617257, -11931514, -7342816, -9985397, -32349517, 7392473),\n                array(-8855661, 15927861, 9866406, -3649411, -2396914, -16655781, -30409476, -9134995, 25112947, -2926644),\n                array(-2504044, -436966, 25621774, -5678772, 15085042, -5479877, -24884878, -13526194, 5537438, -13914319),\n            ),\n        ),\n        array(\n            array(\n                array(-11225584, 2320285, -9584280, 10149187, -33444663, 5808648, -14876251, -1729667, 31234590, 6090599),\n                array(-9633316, 116426, 26083934, 2897444, -6364437, -2688086, 609721, 15878753, -6970405, -9034768),\n                array(-27757857, 247744, -15194774, -9002551, 23288161, -10011936, -23869595, 6503646, 20650474, 1804084),\n            ),\n            array(\n                array(-27589786, 15456424, 8972517, 8469608, 15640622, 4439847, 3121995, -10329713, 27842616, -202328),\n                array(-15306973, 2839644, 22530074, 10026331, 4602058, 5048462, 28248656, 5031932, -11375082, 12714369),\n                array(20807691, -7270825, 29286141, 11421711, -27876523, -13868230, -21227475, 1035546, -19733229, 12796920),\n            ),\n            array(\n                array(12076899, -14301286, -8785001, -11848922, -25012791, 16400684, -17591495, -12899438, 3480665, -15182815),\n                array(-32361549, 5457597, 28548107, 7833186, 7303070, -11953545, -24363064, -15921875, -33374054, 2771025),\n                array(-21389266, 421932, 26597266, 6860826, 22486084, -6737172, -17137485, -4210226, -24552282, 15673397),\n            ),\n            array(\n                array(-20184622, 2338216, 19788685, -9620956, -4001265, -8740893, -20271184, 4733254, 3727144, -12934448),\n                array(6120119, 814863, -11794402, -622716, 6812205, -15747771, 2019594, 7975683, 31123697, -10958981),\n                array(30069250, -11435332, 30434654, 2958439, 18399564, -976289, 12296869, 9204260, -16432438, 9648165),\n            ),\n            array(\n                array(32705432, -1550977, 30705658, 7451065, -11805606, 9631813, 3305266, 5248604, -26008332, -11377501),\n                array(17219865, 2375039, -31570947, -5575615, -19459679, 9219903, 294711, 15298639, 2662509, -16297073),\n                array(-1172927, -7558695, -4366770, -4287744, -21346413, -8434326, 32087529, -1222777, 32247248, -14389861),\n            ),\n            array(\n                array(14312628, 1221556, 17395390, -8700143, -4945741, -8684635, -28197744, -9637817, -16027623, -13378845),\n                array(-1428825, -9678990, -9235681, 6549687, -7383069, -468664, 23046502, 9803137, 17597934, 2346211),\n                array(18510800, 15337574, 26171504, 981392, -22241552, 7827556, -23491134, -11323352, 3059833, -11782870),\n            ),\n            array(\n                array(10141598, 6082907, 17829293, -1947643, 9830092, 13613136, -25556636, -5544586, -33502212, 3592096),\n                array(33114168, -15889352, -26525686, -13343397, 33076705, 8716171, 1151462, 1521897, -982665, -6837803),\n                array(-32939165, -4255815, 23947181, -324178, -33072974, -12305637, -16637686, 3891704, 26353178, 693168),\n            ),\n            array(\n                array(30374239, 1595580, -16884039, 13186931, 4600344, 406904, 9585294, -400668, 31375464, 14369965),\n                array(-14370654, -7772529, 1510301, 6434173, -18784789, -6262728, 32732230, -13108839, 17901441, 16011505),\n                array(18171223, -11934626, -12500402, 15197122, -11038147, -15230035, -19172240, -16046376, 8764035, 12309598),\n            ),\n        ),\n        array(\n            array(\n                array(5975908, -5243188, -19459362, -9681747, -11541277, 14015782, -23665757, 1228319, 17544096, -10593782),\n                array(5811932, -1715293, 3442887, -2269310, -18367348, -8359541, -18044043, -15410127, -5565381, 12348900),\n                array(-31399660, 11407555, 25755363, 6891399, -3256938, 14872274, -24849353, 8141295, -10632534, -585479),\n            ),\n            array(\n                array(-12675304, 694026, -5076145, 13300344, 14015258, -14451394, -9698672, -11329050, 30944593, 1130208),\n                array(8247766, -6710942, -26562381, -7709309, -14401939, -14648910, 4652152, 2488540, 23550156, -271232),\n                array(17294316, -3788438, 7026748, 15626851, 22990044, 113481, 2267737, -5908146, -408818, -137719),\n            ),\n            array(\n                array(16091085, -16253926, 18599252, 7340678, 2137637, -1221657, -3364161, 14550936, 3260525, -7166271),\n                array(-4910104, -13332887, 18550887, 10864893, -16459325, -7291596, -23028869, -13204905, -12748722, 2701326),\n                array(-8574695, 16099415, 4629974, -16340524, -20786213, -6005432, -10018363, 9276971, 11329923, 1862132),\n            ),\n            array(\n                array(14763076, -15903608, -30918270, 3689867, 3511892, 10313526, -21951088, 12219231, -9037963, -940300),\n                array(8894987, -3446094, 6150753, 3013931, 301220, 15693451, -31981216, -2909717, -15438168, 11595570),\n                array(15214962, 3537601, -26238722, -14058872, 4418657, -15230761, 13947276, 10730794, -13489462, -4363670),\n            ),\n            array(\n                array(-2538306, 7682793, 32759013, 263109, -29984731, -7955452, -22332124, -10188635, 977108, 699994),\n                array(-12466472, 4195084, -9211532, 550904, -15565337, 12917920, 19118110, -439841, -30534533, -14337913),\n                array(31788461, -14507657, 4799989, 7372237, 8808585, -14747943, 9408237, -10051775, 12493932, -5409317),\n            ),\n            array(\n                array(-25680606, 5260744, -19235809, -6284470, -3695942, 16566087, 27218280, 2607121, 29375955, 6024730),\n                array(842132, -2794693, -4763381, -8722815, 26332018, -12405641, 11831880, 6985184, -9940361, 2854096),\n                array(-4847262, -7969331, 2516242, -5847713, 9695691, -7221186, 16512645, 960770, 12121869, 16648078),\n            ),\n            array(\n                array(-15218652, 14667096, -13336229, 2013717, 30598287, -464137, -31504922, -7882064, 20237806, 2838411),\n                array(-19288047, 4453152, 15298546, -16178388, 22115043, -15972604, 12544294, -13470457, 1068881, -12499905),\n                array(-9558883, -16518835, 33238498, 13506958, 30505848, -1114596, -8486907, -2630053, 12521378, 4845654),\n            ),\n            array(\n                array(-28198521, 10744108, -2958380, 10199664, 7759311, -13088600, 3409348, -873400, -6482306, -12885870),\n                array(-23561822, 6230156, -20382013, 10655314, -24040585, -11621172, 10477734, -1240216, -3113227, 13974498),\n                array(12966261, 15550616, -32038948, -1615346, 21025980, -629444, 5642325, 7188737, 18895762, 12629579),\n            ),\n        ),\n        array(\n            array(\n                array(14741879, -14946887, 22177208, -11721237, 1279741, 8058600, 11758140, 789443, 32195181, 3895677),\n                array(10758205, 15755439, -4509950, 9243698, -4879422, 6879879, -2204575, -3566119, -8982069, 4429647),\n                array(-2453894, 15725973, -20436342, -10410672, -5803908, -11040220, -7135870, -11642895, 18047436, -15281743),\n            ),\n            array(\n                array(-25173001, -11307165, 29759956, 11776784, -22262383, -15820455, 10993114, -12850837, -17620701, -9408468),\n                array(21987233, 700364, -24505048, 14972008, -7774265, -5718395, 32155026, 2581431, -29958985, 8773375),\n                array(-25568350, 454463, -13211935, 16126715, 25240068, 8594567, 20656846, 12017935, -7874389, -13920155),\n            ),\n            array(\n                array(6028182, 6263078, -31011806, -11301710, -818919, 2461772, -31841174, -5468042, -1721788, -2776725),\n                array(-12278994, 16624277, 987579, -5922598, 32908203, 1248608, 7719845, -4166698, 28408820, 6816612),\n                array(-10358094, -8237829, 19549651, -12169222, 22082623, 16147817, 20613181, 13982702, -10339570, 5067943),\n            ),\n            array(\n                array(-30505967, -3821767, 12074681, 13582412, -19877972, 2443951, -19719286, 12746132, 5331210, -10105944),\n                array(30528811, 3601899, -1957090, 4619785, -27361822, -15436388, 24180793, -12570394, 27679908, -1648928),\n                array(9402404, -13957065, 32834043, 10838634, -26580150, -13237195, 26653274, -8685565, 22611444, -12715406),\n            ),\n            array(\n                array(22190590, 1118029, 22736441, 15130463, -30460692, -5991321, 19189625, -4648942, 4854859, 6622139),\n                array(-8310738, -2953450, -8262579, -3388049, -10401731, -271929, 13424426, -3567227, 26404409, 13001963),\n                array(-31241838, -15415700, -2994250, 8939346, 11562230, -12840670, -26064365, -11621720, -15405155, 11020693),\n            ),\n            array(\n                array(1866042, -7949489, -7898649, -10301010, 12483315, 13477547, 3175636, -12424163, 28761762, 1406734),\n                array(-448555, -1777666, 13018551, 3194501, -9580420, -11161737, 24760585, -4347088, 25577411, -13378680),\n                array(-24290378, 4759345, -690653, -1852816, 2066747, 10693769, -29595790, 9884936, -9368926, 4745410),\n            ),\n            array(\n                array(-9141284, 6049714, -19531061, -4341411, -31260798, 9944276, -15462008, -11311852, 10931924, -11931931),\n                array(-16561513, 14112680, -8012645, 4817318, -8040464, -11414606, -22853429, 10856641, -20470770, 13434654),\n                array(22759489, -10073434, -16766264, -1871422, 13637442, -10168091, 1765144, -12654326, 28445307, -5364710),\n            ),\n            array(\n                array(29875063, 12493613, 2795536, -3786330, 1710620, 15181182, -10195717, -8788675, 9074234, 1167180),\n                array(-26205683, 11014233, -9842651, -2635485, -26908120, 7532294, -18716888, -9535498, 3843903, 9367684),\n                array(-10969595, -6403711, 9591134, 9582310, 11349256, 108879, 16235123, 8601684, -139197, 4242895),\n            ),\n        ),\n        array(\n            array(\n                array(22092954, -13191123, -2042793, -11968512, 32186753, -11517388, -6574341, 2470660, -27417366, 16625501),\n                array(-11057722, 3042016, 13770083, -9257922, 584236, -544855, -7770857, 2602725, -27351616, 14247413),\n                array(6314175, -10264892, -32772502, 15957557, -10157730, 168750, -8618807, 14290061, 27108877, -1180880),\n            ),\n            array(\n                array(-8586597, -7170966, 13241782, 10960156, -32991015, -13794596, 33547976, -11058889, -27148451, 981874),\n                array(22833440, 9293594, -32649448, -13618667, -9136966, 14756819, -22928859, -13970780, -10479804, -16197962),\n                array(-7768587, 3326786, -28111797, 10783824, 19178761, 14905060, 22680049, 13906969, -15933690, 3797899),\n            ),\n            array(\n                array(21721356, -4212746, -12206123, 9310182, -3882239, -13653110, 23740224, -2709232, 20491983, -8042152),\n                array(9209270, -15135055, -13256557, -6167798, -731016, 15289673, 25947805, 15286587, 30997318, -6703063),\n                array(7392032, 16618386, 23946583, -8039892, -13265164, -1533858, -14197445, -2321576, 17649998, -250080),\n            ),\n            array(\n                array(-9301088, -14193827, 30609526, -3049543, -25175069, -1283752, -15241566, -9525724, -2233253, 7662146),\n                array(-17558673, 1763594, -33114336, 15908610, -30040870, -12174295, 7335080, -8472199, -3174674, 3440183),\n                array(-19889700, -5977008, -24111293, -9688870, 10799743, -16571957, 40450, -4431835, 4862400, 1133),\n            ),\n            array(\n                array(-32856209, -7873957, -5422389, 14860950, -16319031, 7956142, 7258061, 311861, -30594991, -7379421),\n                array(-3773428, -1565936, 28985340, 7499440, 24445838, 9325937, 29727763, 16527196, 18278453, 15405622),\n                array(-4381906, 8508652, -19898366, -3674424, -5984453, 15149970, -13313598, 843523, -21875062, 13626197),\n            ),\n            array(\n                array(2281448, -13487055, -10915418, -2609910, 1879358, 16164207, -10783882, 3953792, 13340839, 15928663),\n                array(31727126, -7179855, -18437503, -8283652, 2875793, -16390330, -25269894, -7014826, -23452306, 5964753),\n                array(4100420, -5959452, -17179337, 6017714, -18705837, 12227141, -26684835, 11344144, 2538215, -7570755),\n            ),\n            array(\n                array(-9433605, 6123113, 11159803, -2156608, 30016280, 14966241, -20474983, 1485421, -629256, -15958862),\n                array(-26804558, 4260919, 11851389, 9658551, -32017107, 16367492, -20205425, -13191288, 11659922, -11115118),\n                array(26180396, 10015009, -30844224, -8581293, 5418197, 9480663, 2231568, -10170080, 33100372, -1306171),\n            ),\n            array(\n                array(15121113, -5201871, -10389905, 15427821, -27509937, -15992507, 21670947, 4486675, -5931810, -14466380),\n                array(16166486, -9483733, -11104130, 6023908, -31926798, -1364923, 2340060, -16254968, -10735770, -10039824),\n                array(28042865, -3557089, -12126526, 12259706, -3717498, -6945899, 6766453, -8689599, 18036436, 5803270),\n            ),\n        ),\n        array(\n            array(\n                array(-817581, 6763912, 11803561, 1585585, 10958447, -2671165, 23855391, 4598332, -6159431, -14117438),\n                array(-31031306, -14256194, 17332029, -2383520, 31312682, -5967183, 696309, 50292, -20095739, 11763584),\n                array(-594563, -2514283, -32234153, 12643980, 12650761, 14811489, 665117, -12613632, -19773211, -10713562),\n            ),\n            array(\n                array(30464590, -11262872, -4127476, -12734478, 19835327, -7105613, -24396175, 2075773, -17020157, 992471),\n                array(18357185, -6994433, 7766382, 16342475, -29324918, 411174, 14578841, 8080033, -11574335, -10601610),\n                array(19598397, 10334610, 12555054, 2555664, 18821899, -10339780, 21873263, 16014234, 26224780, 16452269),\n            ),\n            array(\n                array(-30223925, 5145196, 5944548, 16385966, 3976735, 2009897, -11377804, -7618186, -20533829, 3698650),\n                array(14187449, 3448569, -10636236, -10810935, -22663880, -3433596, 7268410, -10890444, 27394301, 12015369),\n                array(19695761, 16087646, 28032085, 12999827, 6817792, 11427614, 20244189, -1312777, -13259127, -3402461),\n            ),\n            array(\n                array(30860103, 12735208, -1888245, -4699734, -16974906, 2256940, -8166013, 12298312, -8550524, -10393462),\n                array(-5719826, -11245325, -1910649, 15569035, 26642876, -7587760, -5789354, -15118654, -4976164, 12651793),\n                array(-2848395, 9953421, 11531313, -5282879, 26895123, -12697089, -13118820, -16517902, 9768698, -2533218),\n            ),\n            array(\n                array(-24719459, 1894651, -287698, -4704085, 15348719, -8156530, 32767513, 12765450, 4940095, 10678226),\n                array(18860224, 15980149, -18987240, -1562570, -26233012, -11071856, -7843882, 13944024, -24372348, 16582019),\n                array(-15504260, 4970268, -29893044, 4175593, -20993212, -2199756, -11704054, 15444560, -11003761, 7989037),\n            ),\n            array(\n                array(31490452, 5568061, -2412803, 2182383, -32336847, 4531686, -32078269, 6200206, -19686113, -14800171),\n                array(-17308668, -15879940, -31522777, -2831, -32887382, 16375549, 8680158, -16371713, 28550068, -6857132),\n                array(-28126887, -5688091, 16837845, -1820458, -6850681, 12700016, -30039981, 4364038, 1155602, 5988841),\n            ),\n            array(\n                array(21890435, -13272907, -12624011, 12154349, -7831873, 15300496, 23148983, -4470481, 24618407, 8283181),\n                array(-33136107, -10512751, 9975416, 6841041, -31559793, 16356536, 3070187, -7025928, 1466169, 10740210),\n                array(-1509399, -15488185, -13503385, -10655916, 32799044, 909394, -13938903, -5779719, -32164649, -15327040),\n            ),\n            array(\n                array(3960823, -14267803, -28026090, -15918051, -19404858, 13146868, 15567327, 951507, -3260321, -573935),\n                array(24740841, 5052253, -30094131, 8961361, 25877428, 6165135, -24368180, 14397372, -7380369, -6144105),\n                array(-28888365, 3510803, -28103278, -1158478, -11238128, -10631454, -15441463, -14453128, -1625486, -6494814),\n            ),\n        ),\n        array(\n            array(\n                array(793299, -9230478, 8836302, -6235707, -27360908, -2369593, 33152843, -4885251, -9906200, -621852),\n                array(5666233, 525582, 20782575, -8038419, -24538499, 14657740, 16099374, 1468826, -6171428, -15186581),\n                array(-4859255, -3779343, -2917758, -6748019, 7778750, 11688288, -30404353, -9871238, -1558923, -9863646),\n            ),\n            array(\n                array(10896332, -7719704, 824275, 472601, -19460308, 3009587, 25248958, 14783338, -30581476, -15757844),\n                array(10566929, 12612572, -31944212, 11118703, -12633376, 12362879, 21752402, 8822496, 24003793, 14264025),\n                array(27713862, -7355973, -11008240, 9227530, 27050101, 2504721, 23886875, -13117525, 13958495, -5732453),\n            ),\n            array(\n                array(-23481610, 4867226, -27247128, 3900521, 29838369, -8212291, -31889399, -10041781, 7340521, -15410068),\n                array(4646514, -8011124, -22766023, -11532654, 23184553, 8566613, 31366726, -1381061, -15066784, -10375192),\n                array(-17270517, 12723032, -16993061, 14878794, 21619651, -6197576, 27584817, 3093888, -8843694, 3849921),\n            ),\n            array(\n                array(-9064912, 2103172, 25561640, -15125738, -5239824, 9582958, 32477045, -9017955, 5002294, -15550259),\n                array(-12057553, -11177906, 21115585, -13365155, 8808712, -12030708, 16489530, 13378448, -25845716, 12741426),\n                array(-5946367, 10645103, -30911586, 15390284, -3286982, -7118677, 24306472, 15852464, 28834118, -7646072),\n            ),\n            array(\n                array(-17335748, -9107057, -24531279, 9434953, -8472084, -583362, -13090771, 455841, 20461858, 5491305),\n                array(13669248, -16095482, -12481974, -10203039, -14569770, -11893198, -24995986, 11293807, -28588204, -9421832),\n                array(28497928, 6272777, -33022994, 14470570, 8906179, -1225630, 18504674, -14165166, 29867745, -8795943),\n            ),\n            array(\n                array(-16207023, 13517196, -27799630, -13697798, 24009064, -6373891, -6367600, -13175392, 22853429, -4012011),\n                array(24191378, 16712145, -13931797, 15217831, 14542237, 1646131, 18603514, -11037887, 12876623, -2112447),\n                array(17902668, 4518229, -411702, -2829247, 26878217, 5258055, -12860753, 608397, 16031844, 3723494),\n            ),\n            array(\n                array(-28632773, 12763728, -20446446, 7577504, 33001348, -13017745, 17558842, -7872890, 23896954, -4314245),\n                array(-20005381, -12011952, 31520464, 605201, 2543521, 5991821, -2945064, 7229064, -9919646, -8826859),\n                array(28816045, 298879, -28165016, -15920938, 19000928, -1665890, -12680833, -2949325, -18051778, -2082915),\n            ),\n            array(\n                array(16000882, -344896, 3493092, -11447198, -29504595, -13159789, 12577740, 16041268, -19715240, 7847707),\n                array(10151868, 10572098, 27312476, 7922682, 14825339, 4723128, -32855931, -6519018, -10020567, 3852848),\n                array(-11430470, 15697596, -21121557, -4420647, 5386314, 15063598, 16514493, -15932110, 29330899, -15076224),\n            ),\n        ),\n        array(\n            array(\n                array(-25499735, -4378794, -15222908, -6901211, 16615731, 2051784, 3303702, 15490, -27548796, 12314391),\n                array(15683520, -6003043, 18109120, -9980648, 15337968, -5997823, -16717435, 15921866, 16103996, -3731215),\n                array(-23169824, -10781249, 13588192, -1628807, -3798557, -1074929, -19273607, 5402699, -29815713, -9841101),\n            ),\n            array(\n                array(23190676, 2384583, -32714340, 3462154, -29903655, -1529132, -11266856, 8911517, -25205859, 2739713),\n                array(21374101, -3554250, -33524649, 9874411, 15377179, 11831242, -33529904, 6134907, 4931255, 11987849),\n                array(-7732, -2978858, -16223486, 7277597, 105524, -322051, -31480539, 13861388, -30076310, 10117930),\n            ),\n            array(\n                array(-29501170, -10744872, -26163768, 13051539, -25625564, 5089643, -6325503, 6704079, 12890019, 15728940),\n                array(-21972360, -11771379, -951059, -4418840, 14704840, 2695116, 903376, -10428139, 12885167, 8311031),\n                array(-17516482, 5352194, 10384213, -13811658, 7506451, 13453191, 26423267, 4384730, 1888765, -5435404),\n            ),\n            array(\n                array(-25817338, -3107312, -13494599, -3182506, 30896459, -13921729, -32251644, -12707869, -19464434, -3340243),\n                array(-23607977, -2665774, -526091, 4651136, 5765089, 4618330, 6092245, 14845197, 17151279, -9854116),\n                array(-24830458, -12733720, -15165978, 10367250, -29530908, -265356, 22825805, -7087279, -16866484, 16176525),\n            ),\n            array(\n                array(-23583256, 6564961, 20063689, 3798228, -4740178, 7359225, 2006182, -10363426, -28746253, -10197509),\n                array(-10626600, -4486402, -13320562, -5125317, 3432136, -6393229, 23632037, -1940610, 32808310, 1099883),\n                array(15030977, 5768825, -27451236, -2887299, -6427378, -15361371, -15277896, -6809350, 2051441, -15225865),\n            ),\n            array(\n                array(-3362323, -7239372, 7517890, 9824992, 23555850, 295369, 5148398, -14154188, -22686354, 16633660),\n                array(4577086, -16752288, 13249841, -15304328, 19958763, -14537274, 18559670, -10759549, 8402478, -9864273),\n                array(-28406330, -1051581, -26790155, -907698, -17212414, -11030789, 9453451, -14980072, 17983010, 9967138),\n            ),\n            array(\n                array(-25762494, 6524722, 26585488, 9969270, 24709298, 1220360, -1677990, 7806337, 17507396, 3651560),\n                array(-10420457, -4118111, 14584639, 15971087, -15768321, 8861010, 26556809, -5574557, -18553322, -11357135),\n                array(2839101, 14284142, 4029895, 3472686, 14402957, 12689363, -26642121, 8459447, -5605463, -7621941),\n            ),\n            array(\n                array(-4839289, -3535444, 9744961, 2871048, 25113978, 3187018, -25110813, -849066, 17258084, -7977739),\n                array(18164541, -10595176, -17154882, -1542417, 19237078, -9745295, 23357533, -15217008, 26908270, 12150756),\n                array(-30264870, -7647865, 5112249, -7036672, -1499807, -6974257, 43168, -5537701, -32302074, 16215819),\n            ),\n        ),\n        array(\n            array(\n                array(-6898905, 9824394, -12304779, -4401089, -31397141, -6276835, 32574489, 12532905, -7503072, -8675347),\n                array(-27343522, -16515468, -27151524, -10722951, 946346, 16291093, 254968, 7168080, 21676107, -1943028),\n                array(21260961, -8424752, -16831886, -11920822, -23677961, 3968121, -3651949, -6215466, -3556191, -7913075),\n            ),\n            array(\n                array(16544754, 13250366, -16804428, 15546242, -4583003, 12757258, -2462308, -8680336, -18907032, -9662799),\n                array(-2415239, -15577728, 18312303, 4964443, -15272530, -12653564, 26820651, 16690659, 25459437, -4564609),\n                array(-25144690, 11425020, 28423002, -11020557, -6144921, -15826224, 9142795, -2391602, -6432418, -1644817),\n            ),\n            array(\n                array(-23104652, 6253476, 16964147, -3768872, -25113972, -12296437, -27457225, -16344658, 6335692, 7249989),\n                array(-30333227, 13979675, 7503222, -12368314, -11956721, -4621693, -30272269, 2682242, 25993170, -12478523),\n                array(4364628, 5930691, 32304656, -10044554, -8054781, 15091131, 22857016, -10598955, 31820368, 15075278),\n            ),\n            array(\n                array(31879134, -8918693, 17258761, 90626, -8041836, -4917709, 24162788, -9650886, -17970238, 12833045),\n                array(19073683, 14851414, -24403169, -11860168, 7625278, 11091125, -19619190, 2074449, -9413939, 14905377),\n                array(24483667, -11935567, -2518866, -11547418, -1553130, 15355506, -25282080, 9253129, 27628530, -7555480),\n            ),\n            array(\n                array(17597607, 8340603, 19355617, 552187, 26198470, -3176583, 4593324, -9157582, -14110875, 15297016),\n                array(510886, 14337390, -31785257, 16638632, 6328095, 2713355, -20217417, -11864220, 8683221, 2921426),\n                array(18606791, 11874196, 27155355, -5281482, -24031742, 6265446, -25178240, -1278924, 4674690, 13890525),\n            ),\n            array(\n                array(13609624, 13069022, -27372361, -13055908, 24360586, 9592974, 14977157, 9835105, 4389687, 288396),\n                array(9922506, -519394, 13613107, 5883594, -18758345, -434263, -12304062, 8317628, 23388070, 16052080),\n                array(12720016, 11937594, -31970060, -5028689, 26900120, 8561328, -20155687, -11632979, -14754271, -10812892),\n            ),\n            array(\n                array(15961858, 14150409, 26716931, -665832, -22794328, 13603569, 11829573, 7467844, -28822128, 929275),\n                array(11038231, -11582396, -27310482, -7316562, -10498527, -16307831, -23479533, -9371869, -21393143, 2465074),\n                array(20017163, -4323226, 27915242, 1529148, 12396362, 15675764, 13817261, -9658066, 2463391, -4622140),\n            ),\n            array(\n                array(-16358878, -12663911, -12065183, 4996454, -1256422, 1073572, 9583558, 12851107, 4003896, 12673717),\n                array(-1731589, -15155870, -3262930, 16143082, 19294135, 13385325, 14741514, -9103726, 7903886, 2348101),\n                array(24536016, -16515207, 12715592, -3862155, 1511293, 10047386, -3842346, -7129159, -28377538, 10048127),\n            ),\n        ),\n        array(\n            array(\n                array(-12622226, -6204820, 30718825, 2591312, -10617028, 12192840, 18873298, -7297090, -32297756, 15221632),\n                array(-26478122, -11103864, 11546244, -1852483, 9180880, 7656409, -21343950, 2095755, 29769758, 6593415),\n                array(-31994208, -2907461, 4176912, 3264766, 12538965, -868111, 26312345, -6118678, 30958054, 8292160),\n            ),\n            array(\n                array(31429822, -13959116, 29173532, 15632448, 12174511, -2760094, 32808831, 3977186, 26143136, -3148876),\n                array(22648901, 1402143, -22799984, 13746059, 7936347, 365344, -8668633, -1674433, -3758243, -2304625),\n                array(-15491917, 8012313, -2514730, -12702462, -23965846, -10254029, -1612713, -1535569, -16664475, 8194478),\n            ),\n            array(\n                array(27338066, -7507420, -7414224, 10140405, -19026427, -6589889, 27277191, 8855376, 28572286, 3005164),\n                array(26287124, 4821776, 25476601, -4145903, -3764513, -15788984, -18008582, 1182479, -26094821, -13079595),\n                array(-7171154, 3178080, 23970071, 6201893, -17195577, -4489192, -21876275, -13982627, 32208683, -1198248),\n            ),\n            array(\n                array(-16657702, 2817643, -10286362, 14811298, 6024667, 13349505, -27315504, -10497842, -27672585, -11539858),\n                array(15941029, -9405932, -21367050, 8062055, 31876073, -238629, -15278393, -1444429, 15397331, -4130193),\n                array(8934485, -13485467, -23286397, -13423241, -32446090, 14047986, 31170398, -1441021, -27505566, 15087184),\n            ),\n            array(\n                array(-18357243, -2156491, 24524913, -16677868, 15520427, -6360776, -15502406, 11461896, 16788528, -5868942),\n                array(-1947386, 16013773, 21750665, 3714552, -17401782, -16055433, -3770287, -10323320, 31322514, -11615635),\n                array(21426655, -5650218, -13648287, -5347537, -28812189, -4920970, -18275391, -14621414, 13040862, -12112948),\n            ),\n            array(\n                array(11293895, 12478086, -27136401, 15083750, -29307421, 14748872, 14555558, -13417103, 1613711, 4896935),\n                array(-25894883, 15323294, -8489791, -8057900, 25967126, -13425460, 2825960, -4897045, -23971776, -11267415),\n                array(-15924766, -5229880, -17443532, 6410664, 3622847, 10243618, 20615400, 12405433, -23753030, -8436416),\n            ),\n            array(\n                array(-7091295, 12556208, -20191352, 9025187, -17072479, 4333801, 4378436, 2432030, 23097949, -566018),\n                array(4565804, -16025654, 20084412, -7842817, 1724999, 189254, 24767264, 10103221, -18512313, 2424778),\n                array(366633, -11976806, 8173090, -6890119, 30788634, 5745705, -7168678, 1344109, -3642553, 12412659),\n            ),\n            array(\n                array(-24001791, 7690286, 14929416, -168257, -32210835, -13412986, 24162697, -15326504, -3141501, 11179385),\n                array(18289522, -14724954, 8056945, 16430056, -21729724, 7842514, -6001441, -1486897, -18684645, -11443503),\n                array(476239, 6601091, -6152790, -9723375, 17503545, -4863900, 27672959, 13403813, 11052904, 5219329),\n            ),\n        ),\n        array(\n            array(\n                array(20678546, -8375738, -32671898, 8849123, -5009758, 14574752, 31186971, -3973730, 9014762, -8579056),\n                array(-13644050, -10350239, -15962508, 5075808, -1514661, -11534600, -33102500, 9160280, 8473550, -3256838),\n                array(24900749, 14435722, 17209120, -15292541, -22592275, 9878983, -7689309, -16335821, -24568481, 11788948),\n            ),\n            array(\n                array(-3118155, -11395194, -13802089, 14797441, 9652448, -6845904, -20037437, 10410733, -24568470, -1458691),\n                array(-15659161, 16736706, -22467150, 10215878, -9097177, 7563911, 11871841, -12505194, -18513325, 8464118),\n                array(-23400612, 8348507, -14585951, -861714, -3950205, -6373419, 14325289, 8628612, 33313881, -8370517),\n            ),\n            array(\n                array(-20186973, -4967935, 22367356, 5271547, -1097117, -4788838, -24805667, -10236854, -8940735, -5818269),\n                array(-6948785, -1795212, -32625683, -16021179, 32635414, -7374245, 15989197, -12838188, 28358192, -4253904),\n                array(-23561781, -2799059, -32351682, -1661963, -9147719, 10429267, -16637684, 4072016, -5351664, 5596589),\n            ),\n            array(\n                array(-28236598, -3390048, 12312896, 6213178, 3117142, 16078565, 29266239, 2557221, 1768301, 15373193),\n                array(-7243358, -3246960, -4593467, -7553353, -127927, -912245, -1090902, -4504991, -24660491, 3442910),\n                array(-30210571, 5124043, 14181784, 8197961, 18964734, -11939093, 22597931, 7176455, -18585478, 13365930),\n            ),\n            array(\n                array(-7877390, -1499958, 8324673, 4690079, 6261860, 890446, 24538107, -8570186, -9689599, -3031667),\n                array(25008904, -10771599, -4305031, -9638010, 16265036, 15721635, 683793, -11823784, 15723479, -15163481),\n                array(-9660625, 12374379, -27006999, -7026148, -7724114, -12314514, 11879682, 5400171, 519526, -1235876),\n            ),\n            array(\n                array(22258397, -16332233, -7869817, 14613016, -22520255, -2950923, -20353881, 7315967, 16648397, 7605640),\n                array(-8081308, -8464597, -8223311, 9719710, 19259459, -15348212, 23994942, -5281555, -9468848, 4763278),\n                array(-21699244, 9220969, -15730624, 1084137, -25476107, -2852390, 31088447, -7764523, -11356529, 728112),\n            ),\n            array(\n                array(26047220, -11751471, -6900323, -16521798, 24092068, 9158119, -4273545, -12555558, -29365436, -5498272),\n                array(17510331, -322857, 5854289, 8403524, 17133918, -3112612, -28111007, 12327945, 10750447, 10014012),\n                array(-10312768, 3936952, 9156313, -8897683, 16498692, -994647, -27481051, -666732, 3424691, 7540221),\n            ),\n            array(\n                array(30322361, -6964110, 11361005, -4143317, 7433304, 4989748, -7071422, -16317219, -9244265, 15258046),\n                array(13054562, -2779497, 19155474, 469045, -12482797, 4566042, 5631406, 2711395, 1062915, -5136345),\n                array(-19240248, -11254599, -29509029, -7499965, -5835763, 13005411, -6066489, 12194497, 32960380, 1459310),\n            ),\n        ),\n        array(\n            array(\n                array(19852034, 7027924, 23669353, 10020366, 8586503, -6657907, 394197, -6101885, 18638003, -11174937),\n                array(31395534, 15098109, 26581030, 8030562, -16527914, -5007134, 9012486, -7584354, -6643087, -5442636),\n                array(-9192165, -2347377, -1997099, 4529534, 25766844, 607986, -13222, 9677543, -32294889, -6456008),\n            ),\n            array(\n                array(-2444496, -149937, 29348902, 8186665, 1873760, 12489863, -30934579, -7839692, -7852844, -8138429),\n                array(-15236356, -15433509, 7766470, 746860, 26346930, -10221762, -27333451, 10754588, -9431476, 5203576),\n                array(31834314, 14135496, -770007, 5159118, 20917671, -16768096, -7467973, -7337524, 31809243, 7347066),\n            ),\n            array(\n                array(-9606723, -11874240, 20414459, 13033986, 13716524, -11691881, 19797970, -12211255, 15192876, -2087490),\n                array(-12663563, -2181719, 1168162, -3804809, 26747877, -14138091, 10609330, 12694420, 33473243, -13382104),\n                array(33184999, 11180355, 15832085, -11385430, -1633671, 225884, 15089336, -11023903, -6135662, 14480053),\n            ),\n            array(\n                array(31308717, -5619998, 31030840, -1897099, 15674547, -6582883, 5496208, 13685227, 27595050, 8737275),\n                array(-20318852, -15150239, 10933843, -16178022, 8335352, -7546022, -31008351, -12610604, 26498114, 66511),\n                array(22644454, -8761729, -16671776, 4884562, -3105614, -13559366, 30540766, -4286747, -13327787, -7515095),\n            ),\n            array(\n                array(-28017847, 9834845, 18617207, -2681312, -3401956, -13307506, 8205540, 13585437, -17127465, 15115439),\n                array(23711543, -672915, 31206561, -8362711, 6164647, -9709987, -33535882, -1426096, 8236921, 16492939),\n                array(-23910559, -13515526, -26299483, -4503841, 25005590, -7687270, 19574902, 10071562, 6708380, -6222424),\n            ),\n            array(\n                array(2101391, -4930054, 19702731, 2367575, -15427167, 1047675, 5301017, 9328700, 29955601, -11678310),\n                array(3096359, 9271816, -21620864, -15521844, -14847996, -7592937, -25892142, -12635595, -9917575, 6216608),\n                array(-32615849, 338663, -25195611, 2510422, -29213566, -13820213, 24822830, -6146567, -26767480, 7525079),\n            ),\n            array(\n                array(-23066649, -13985623, 16133487, -7896178, -3389565, 778788, -910336, -2782495, -19386633, 11994101),\n                array(21691500, -13624626, -641331, -14367021, 3285881, -3483596, -25064666, 9718258, -7477437, 13381418),\n                array(18445390, -4202236, 14979846, 11622458, -1727110, -3582980, 23111648, -6375247, 28535282, 15779576),\n            ),\n            array(\n                array(30098053, 3089662, -9234387, 16662135, -21306940, 11308411, -14068454, 12021730, 9955285, -16303356),\n                array(9734894, -14576830, -7473633, -9138735, 2060392, 11313496, -18426029, 9924399, 20194861, 13380996),\n                array(-26378102, -7965207, -22167821, 15789297, -18055342, -6168792, -1984914, 15707771, 26342023, 10146099),\n            ),\n        ),\n        array(\n            array(\n                array(-26016874, -219943, 21339191, -41388, 19745256, -2878700, -29637280, 2227040, 21612326, -545728),\n                array(-13077387, 1184228, 23562814, -5970442, -20351244, -6348714, 25764461, 12243797, -20856566, 11649658),\n                array(-10031494, 11262626, 27384172, 2271902, 26947504, -15997771, 39944, 6114064, 33514190, 2333242),\n            ),\n            array(\n                array(-21433588, -12421821, 8119782, 7219913, -21830522, -9016134, -6679750, -12670638, 24350578, -13450001),\n                array(-4116307, -11271533, -23886186, 4843615, -30088339, 690623, -31536088, -10406836, 8317860, 12352766),\n                array(18200138, -14475911, -33087759, -2696619, -23702521, -9102511, -23552096, -2287550, 20712163, 6719373),\n            ),\n            array(\n                array(26656208, 6075253, -7858556, 1886072, -28344043, 4262326, 11117530, -3763210, 26224235, -3297458),\n                array(-17168938, -14854097, -3395676, -16369877, -19954045, 14050420, 21728352, 9493610, 18620611, -16428628),\n                array(-13323321, 13325349, 11432106, 5964811, 18609221, 6062965, -5269471, -9725556, -30701573, -16479657),\n            ),\n            array(\n                array(-23860538, -11233159, 26961357, 1640861, -32413112, -16737940, 12248509, -5240639, 13735342, 1934062),\n                array(25089769, 6742589, 17081145, -13406266, 21909293, -16067981, -15136294, -3765346, -21277997, 5473616),\n                array(31883677, -7961101, 1083432, -11572403, 22828471, 13290673, -7125085, 12469656, 29111212, -5451014),\n            ),\n            array(\n                array(24244947, -15050407, -26262976, 2791540, -14997599, 16666678, 24367466, 6388839, -10295587, 452383),\n                array(-25640782, -3417841, 5217916, 16224624, 19987036, -4082269, -24236251, -5915248, 15766062, 8407814),\n                array(-20406999, 13990231, 15495425, 16395525, 5377168, 15166495, -8917023, -4388953, -8067909, 2276718),\n            ),\n            array(\n                array(30157918, 12924066, -17712050, 9245753, 19895028, 3368142, -23827587, 5096219, 22740376, -7303417),\n                array(2041139, -14256350, 7783687, 13876377, -25946985, -13352459, 24051124, 13742383, -15637599, 13295222),\n                array(33338237, -8505733, 12532113, 7977527, 9106186, -1715251, -17720195, -4612972, -4451357, -14669444),\n            ),\n            array(\n                array(-20045281, 5454097, -14346548, 6447146, 28862071, 1883651, -2469266, -4141880, 7770569, 9620597),\n                array(23208068, 7979712, 33071466, 8149229, 1758231, -10834995, 30945528, -1694323, -33502340, -14767970),\n                array(1439958, -16270480, -1079989, -793782, 4625402, 10647766, -5043801, 1220118, 30494170, -11440799),\n            ),\n            array(\n                array(-5037580, -13028295, -2970559, -3061767, 15640974, -6701666, -26739026, 926050, -1684339, -13333647),\n                array(13908495, -3549272, 30919928, -6273825, -21521863, 7989039, 9021034, 9078865, 3353509, 4033511),\n                array(-29663431, -15113610, 32259991, -344482, 24295849, -12912123, 23161163, 8839127, 27485041, 7356032),\n            ),\n        ),\n        array(\n            array(\n                array(9661027, 705443, 11980065, -5370154, -1628543, 14661173, -6346142, 2625015, 28431036, -16771834),\n                array(-23839233, -8311415, -25945511, 7480958, -17681669, -8354183, -22545972, 14150565, 15970762, 4099461),\n                array(29262576, 16756590, 26350592, -8793563, 8529671, -11208050, 13617293, -9937143, 11465739, 8317062),\n            ),\n            array(\n                array(-25493081, -6962928, 32500200, -9419051, -23038724, -2302222, 14898637, 3848455, 20969334, -5157516),\n                array(-20384450, -14347713, -18336405, 13884722, -33039454, 2842114, -21610826, -3649888, 11177095, 14989547),\n                array(-24496721, -11716016, 16959896, 2278463, 12066309, 10137771, 13515641, 2581286, -28487508, 9930240),\n            ),\n            array(\n                array(-17751622, -2097826, 16544300, -13009300, -15914807, -14949081, 18345767, -13403753, 16291481, -5314038),\n                array(-33229194, 2553288, 32678213, 9875984, 8534129, 6889387, -9676774, 6957617, 4368891, 9788741),\n                array(16660756, 7281060, -10830758, 12911820, 20108584, -8101676, -21722536, -8613148, 16250552, -11111103),\n            ),\n            array(\n                array(-19765507, 2390526, -16551031, 14161980, 1905286, 6414907, 4689584, 10604807, -30190403, 4782747),\n                array(-1354539, 14736941, -7367442, -13292886, 7710542, -14155590, -9981571, 4383045, 22546403, 437323),\n                array(31665577, -12180464, -16186830, 1491339, -18368625, 3294682, 27343084, 2786261, -30633590, -14097016),\n            ),\n            array(\n                array(-14467279, -683715, -33374107, 7448552, 19294360, 14334329, -19690631, 2355319, -19284671, -6114373),\n                array(15121312, -15796162, 6377020, -6031361, -10798111, -12957845, 18952177, 15496498, -29380133, 11754228),\n                array(-2637277, -13483075, 8488727, -14303896, 12728761, -1622493, 7141596, 11724556, 22761615, -10134141),\n            ),\n            array(\n                array(16918416, 11729663, -18083579, 3022987, -31015732, -13339659, -28741185, -12227393, 32851222, 11717399),\n                array(11166634, 7338049, -6722523, 4531520, -29468672, -7302055, 31474879, 3483633, -1193175, -4030831),\n                array(-185635, 9921305, 31456609, -13536438, -12013818, 13348923, 33142652, 6546660, -19985279, -3948376),\n            ),\n            array(\n                array(-32460596, 11266712, -11197107, -7899103, 31703694, 3855903, -8537131, -12833048, -30772034, -15486313),\n                array(-18006477, 12709068, 3991746, -6479188, -21491523, -10550425, -31135347, -16049879, 10928917, 3011958),\n                array(-6957757, -15594337, 31696059, 334240, 29576716, 14796075, -30831056, -12805180, 18008031, 10258577),\n            ),\n            array(\n                array(-22448644, 15655569, 7018479, -4410003, -30314266, -1201591, -1853465, 1367120, 25127874, 6671743),\n                array(29701166, -14373934, -10878120, 9279288, -17568, 13127210, 21382910, 11042292, 25838796, 4642684),\n                array(-20430234, 14955537, -24126347, 8124619, -5369288, -5990470, 30468147, -13900640, 18423289, 4177476),\n            ),\n        )\n    );\n\n    /**\n     * See: libsodium's crypto_core/curve25519/ref10/base2.h\n     *\n     * @var array basically int[8][3]\n     */\n    protected static $base2 = array(\n        array(\n            array(25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605),\n            array(-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378),\n            array(-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546),\n        ),\n        array(\n            array(15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024),\n            array(16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574),\n            array(30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357),\n        ),\n        array(\n            array(10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380),\n            array(4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306),\n            array(19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942),\n        ),\n        array(\n            array(5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766),\n            array(-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701),\n            array(28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300),\n        ),\n        array(\n            array(-22518993, -6692182, 14201702, -8745502, -23510406, 8844726, 18474211, -1361450, -13062696, 13821877),\n            array(-6455177, -7839871, 3374702, -4740862, -27098617, -10571707, 31655028, -7212327, 18853322, -14220951),\n            array(4566830, -12963868, -28974889, -12240689, -7602672, -2830569, -8514358, -10431137, 2207753, -3209784),\n        ),\n        array(\n            array(-25154831, -4185821, 29681144, 7868801, -6854661, -9423865, -12437364, -663000, -31111463, -16132436),\n            array(25576264, -2703214, 7349804, -11814844, 16472782, 9300885, 3844789, 15725684, 171356, 6466918),\n            array(23103977, 13316479, 9739013, -16149481, 817875, -15038942, 8965339, -14088058, -30714912, 16193877),\n        ),\n        array(\n            array(-33521811, 3180713, -2394130, 14003687, -16903474, -16270840, 17238398, 4729455, -18074513, 9256800),\n            array(-25182317, -4174131, 32336398, 5036987, -21236817, 11360617, 22616405, 9761698, -19827198, 630305),\n            array(-13720693, 2639453, -24237460, -7406481, 9494427, -5774029, -6554551, -15960994, -2449256, -14291300),\n        ),\n        array(\n            array(-3151181, -5046075, 9282714, 6866145, -31907062, -863023, -18940575, 15033784, 25105118, -7894876),\n            array(-24326370, 15950226, -31801215, -14592823, -11662737, -5090925, 1573892, -2625887, 2198790, -15804619),\n            array(-3099351, 10324967, -2241613, 7453183, -5446979, -2735503, -13812022, -16236442, -32461234, -12290683),\n        )\n    );\n\n    /**\n     * 37095705934669439343138083508754565189542113879843219016388785533085940283555\n     *\n     * @var array<int, int>\n     */\n    protected static $d = array(\n        -10913610,\n        13857413,\n        -15372611,\n        6949391,\n        114729,\n        -8787816,\n        -6275908,\n        -3247719,\n        -18696448,\n        -12055116\n    );\n\n    /**\n     * 2 * d = 16295367250680780974490674513165176452449235426866156013048779062215315747161\n     *\n     * @var array<int, int>\n     */\n    protected static $d2 = array(\n        -21827239,\n        -5839606,\n        -30745221,\n        13898782,\n        229458,\n        15978800,\n        -12551817,\n        -6495438,\n        29715968,\n        9444199\n    );\n\n    /**\n     * sqrt(-1)\n     *\n     * @var array<int, int>\n     */\n    protected static $sqrtm1 = array(\n        -32595792,\n        -7943725,\n        9377950,\n        3500415,\n        12389472,\n        -272473,\n        -25146209,\n        -2005654,\n        326686,\n        11406482\n    );\n}\n", "num_lines": 1468}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n\nif (class_exists('ParagonIE_Sodium_Core_Curve25519_Ge_Cached', false)) {\n    return;\n}\n/**\n * Class ParagonIE_Sodium_Core_Curve25519_Ge_Cached\n */\nclass ParagonIE_Sodium_Core_Curve25519_Ge_Cached\n{\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $YplusX;\n\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $YminusX;\n\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $Z;\n\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $T2d;\n\n    /**\n     * ParagonIE_Sodium_Core_Curve25519_Ge_Cached constructor.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $YplusX\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $YminusX\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $Z\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $T2d\n     */\n    public function __construct(\n        ParagonIE_Sodium_Core_Curve25519_Fe $YplusX = null,\n        ParagonIE_Sodium_Core_Curve25519_Fe $YminusX = null,\n        ParagonIE_Sodium_Core_Curve25519_Fe $Z = null,\n        ParagonIE_Sodium_Core_Curve25519_Fe $T2d = null\n    ) {\n        if ($YplusX === null) {\n            $YplusX = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->YplusX = $YplusX;\n        if ($YminusX === null) {\n            $YminusX = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->YminusX = $YminusX;\n        if ($Z === null) {\n            $Z = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->Z = $Z;\n        if ($T2d === null) {\n            $T2d = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->T2d = $T2d;\n    }\n}\n", "num_lines": 66}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_Curve25519_Ge_P1p1', false)) {\n    return;\n}\n/**\n * Class ParagonIE_Sodium_Core_Curve25519_Ge_P1p1\n */\nclass ParagonIE_Sodium_Core_Curve25519_Ge_P1p1\n{\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $X;\n\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $Y;\n\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $Z;\n\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $T;\n\n    /**\n     * ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 constructor.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $x\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $y\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $z\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $t\n     */\n    public function __construct(\n        ParagonIE_Sodium_Core_Curve25519_Fe $x = null,\n        ParagonIE_Sodium_Core_Curve25519_Fe $y = null,\n        ParagonIE_Sodium_Core_Curve25519_Fe $z = null,\n        ParagonIE_Sodium_Core_Curve25519_Fe $t = null\n    ) {\n        if ($x === null) {\n            $x = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->X = $x;\n        if ($y === null) {\n            $y = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->Y = $y;\n        if ($z === null) {\n            $z = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->Z = $z;\n        if ($t === null) {\n            $t = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->T = $t;\n    }\n}\n", "num_lines": 65}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_Curve25519_Ge_P2', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_Curve25519_Ge_P2\n */\nclass ParagonIE_Sodium_Core_Curve25519_Ge_P2\n{\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $X;\n\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $Y;\n\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $Z;\n\n    /**\n     * ParagonIE_Sodium_Core_Curve25519_Ge_P2 constructor.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $x\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $y\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $z\n     */\n    public function __construct(\n        ParagonIE_Sodium_Core_Curve25519_Fe $x = null,\n        ParagonIE_Sodium_Core_Curve25519_Fe $y = null,\n        ParagonIE_Sodium_Core_Curve25519_Fe $z = null\n    ) {\n        if ($x === null) {\n            $x = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->X = $x;\n        if ($y === null) {\n            $y = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->Y = $y;\n        if ($z === null) {\n            $z = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->Z = $z;\n    }\n}\n", "num_lines": 55}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_Curve25519_Ge_P3', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_Curve25519_Ge_P3\n */\nclass ParagonIE_Sodium_Core_Curve25519_Ge_P3\n{\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $X;\n\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $Y;\n\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $Z;\n\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $T;\n\n    /**\n     * ParagonIE_Sodium_Core_Curve25519_Ge_P3 constructor.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $x\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $y\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $z\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $t\n     */\n    public function __construct(\n        ParagonIE_Sodium_Core_Curve25519_Fe $x = null,\n        ParagonIE_Sodium_Core_Curve25519_Fe $y = null,\n        ParagonIE_Sodium_Core_Curve25519_Fe $z = null,\n        ParagonIE_Sodium_Core_Curve25519_Fe $t = null\n    ) {\n        if ($x === null) {\n            $x = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->X = $x;\n        if ($y === null) {\n            $y = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->Y = $y;\n        if ($z === null) {\n            $z = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->Z = $z;\n        if ($t === null) {\n            $t = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->T = $t;\n    }\n}\n", "num_lines": 66}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_Curve25519_Ge_Precomp', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_Curve25519_Ge_Precomp\n */\nclass ParagonIE_Sodium_Core_Curve25519_Ge_Precomp\n{\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $yplusx;\n\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $yminusx;\n\n    /**\n     * @var ParagonIE_Sodium_Core_Curve25519_Fe\n     */\n    public $xy2d;\n\n    /**\n     * ParagonIE_Sodium_Core_Curve25519_Ge_Precomp constructor.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $yplusx\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $yminusx\n     * @param ParagonIE_Sodium_Core_Curve25519_Fe $xy2d\n     */\n    public function __construct(\n        ParagonIE_Sodium_Core_Curve25519_Fe $yplusx = null,\n        ParagonIE_Sodium_Core_Curve25519_Fe $yminusx = null,\n        ParagonIE_Sodium_Core_Curve25519_Fe $xy2d = null\n    ) {\n        if ($yplusx === null) {\n            $yplusx = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->yplusx = $yplusx;\n        if ($yminusx === null) {\n            $yminusx = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->yminusx = $yminusx;\n        if ($xy2d === null) {\n            $xy2d = new ParagonIE_Sodium_Core_Curve25519_Fe();\n        }\n        $this->xy2d = $xy2d;\n    }\n}\n", "num_lines": 55}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_Poly1305_State', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_Poly1305_State\n */\nclass ParagonIE_Sodium_Core_Poly1305_State extends ParagonIE_Sodium_Core_Util\n{\n    /**\n     * @var array<int, int>\n     */\n    protected $buffer = array();\n\n    /**\n     * @var bool\n     */\n    protected $final = false;\n\n    /**\n     * @var array<int, int>\n     */\n    public $h;\n\n    /**\n     * @var int\n     */\n    protected $leftover = 0;\n\n    /**\n     * @var int[]\n     */\n    public $r;\n\n    /**\n     * @var int[]\n     */\n    public $pad;\n\n    /**\n     * ParagonIE_Sodium_Core_Poly1305_State constructor.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $key\n     * @throws InvalidArgumentException\n     * @throws TypeError\n     */\n    public function __construct($key = '')\n    {\n        if (self::strlen($key) < 32) {\n            throw new InvalidArgumentException(\n                'Poly1305 requires a 32-byte key'\n            );\n        }\n        /* r &= 0xffffffc0ffffffc0ffffffc0fffffff */\n        $this->r = array(\n            (int) ((self::load_4(self::substr($key, 0, 4))) & 0x3ffffff),\n            (int) ((self::load_4(self::substr($key, 3, 4)) >> 2) & 0x3ffff03),\n            (int) ((self::load_4(self::substr($key, 6, 4)) >> 4) & 0x3ffc0ff),\n            (int) ((self::load_4(self::substr($key, 9, 4)) >> 6) & 0x3f03fff),\n            (int) ((self::load_4(self::substr($key, 12, 4)) >> 8) & 0x00fffff)\n        );\n\n        /* h = 0 */\n        $this->h = array(0, 0, 0, 0, 0);\n\n        /* save pad for later */\n        $this->pad = array(\n            self::load_4(self::substr($key, 16, 4)),\n            self::load_4(self::substr($key, 20, 4)),\n            self::load_4(self::substr($key, 24, 4)),\n            self::load_4(self::substr($key, 28, 4)),\n        );\n\n        $this->leftover = 0;\n        $this->final = false;\n    }\n\n    /**\n     * Zero internal buffer upon destruction\n     */\n    public function __destruct()\n    {\n        $this->r[0] ^= $this->r[0];\n        $this->r[1] ^= $this->r[1];\n        $this->r[2] ^= $this->r[2];\n        $this->r[3] ^= $this->r[3];\n        $this->r[4] ^= $this->r[4];\n        $this->h[0] ^= $this->h[0];\n        $this->h[1] ^= $this->h[1];\n        $this->h[2] ^= $this->h[2];\n        $this->h[3] ^= $this->h[3];\n        $this->h[4] ^= $this->h[4];\n        $this->pad[0] ^= $this->pad[0];\n        $this->pad[1] ^= $this->pad[1];\n        $this->pad[2] ^= $this->pad[2];\n        $this->pad[3] ^= $this->pad[3];\n        $this->leftover = 0;\n        $this->final = true;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @return self\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function update($message = '')\n    {\n        $bytes = self::strlen($message);\n        if ($bytes < 1) {\n            return $this;\n        }\n\n        /* handle leftover */\n        if ($this->leftover) {\n            $want = ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE - $this->leftover;\n            if ($want > $bytes) {\n                $want = $bytes;\n            }\n            for ($i = 0; $i < $want; ++$i) {\n                $mi = self::chrToInt($message[$i]);\n                $this->buffer[$this->leftover + $i] = $mi;\n            }\n            // We snip off the leftmost bytes.\n            $message = self::substr($message, $want);\n            $bytes = self::strlen($message);\n            $this->leftover += $want;\n            if ($this->leftover < ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE) {\n                // We still don't have enough to run $this->blocks()\n                return $this;\n            }\n\n            $this->blocks(\n                self::intArrayToString($this->buffer),\n                ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE\n            );\n            $this->leftover = 0;\n        }\n\n        /* process full blocks */\n        if ($bytes >= ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE) {\n            /** @var int $want */\n            $want = $bytes & ~(ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE - 1);\n            if ($want >= ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE) {\n                $block = self::substr($message, 0, $want);\n                if (self::strlen($block) >= ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE) {\n                    $this->blocks($block, $want);\n                    $message = self::substr($message, $want);\n                    $bytes = self::strlen($message);\n                }\n            }\n        }\n\n        /* store leftover */\n        if ($bytes) {\n            for ($i = 0; $i < $bytes; ++$i) {\n                $mi = self::chrToInt($message[$i]);\n                $this->buffer[$this->leftover + $i] = $mi;\n            }\n            $this->leftover = (int) $this->leftover + $bytes;\n        }\n        return $this;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param int $bytes\n     * @return self\n     * @throws TypeError\n     */\n    public function blocks($message, $bytes)\n    {\n        if (self::strlen($message) < 16) {\n            $message = str_pad($message, 16, \"\\x00\", STR_PAD_RIGHT);\n        }\n        /** @var int $hibit */\n        $hibit = $this->final ? 0 : 1 << 24; /* 1 << 128 */\n        $r0 = (int) $this->r[0];\n        $r1 = (int) $this->r[1];\n        $r2 = (int) $this->r[2];\n        $r3 = (int) $this->r[3];\n        $r4 = (int) $this->r[4];\n\n        $s1 = self::mul($r1, 5, 3);\n        $s2 = self::mul($r2, 5, 3);\n        $s3 = self::mul($r3, 5, 3);\n        $s4 = self::mul($r4, 5, 3);\n\n        $h0 = $this->h[0];\n        $h1 = $this->h[1];\n        $h2 = $this->h[2];\n        $h3 = $this->h[3];\n        $h4 = $this->h[4];\n\n        while ($bytes >= ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE) {\n            /* h += m[i] */\n            $h0 +=  self::load_4(self::substr($message, 0, 4))       & 0x3ffffff;\n            $h1 += (self::load_4(self::substr($message, 3, 4)) >> 2) & 0x3ffffff;\n            $h2 += (self::load_4(self::substr($message, 6, 4)) >> 4) & 0x3ffffff;\n            $h3 += (self::load_4(self::substr($message, 9, 4)) >> 6) & 0x3ffffff;\n            $h4 += (self::load_4(self::substr($message, 12, 4)) >> 8) | $hibit;\n\n            /* h *= r */\n            $d0 = (\n                self::mul($h0, $r0, 25) +\n                self::mul($s4, $h1, 26) +\n                self::mul($s3, $h2, 26) +\n                self::mul($s2, $h3, 26) +\n                self::mul($s1, $h4, 26)\n            );\n\n            $d1 = (\n                self::mul($h0, $r1, 25) +\n                self::mul($h1, $r0, 25) +\n                self::mul($s4, $h2, 26) +\n                self::mul($s3, $h3, 26) +\n                self::mul($s2, $h4, 26)\n            );\n\n            $d2 = (\n                self::mul($h0, $r2, 25) +\n                self::mul($h1, $r1, 25) +\n                self::mul($h2, $r0, 25) +\n                self::mul($s4, $h3, 26) +\n                self::mul($s3, $h4, 26)\n            );\n\n            $d3 = (\n                self::mul($h0, $r3, 25) +\n                self::mul($h1, $r2, 25) +\n                self::mul($h2, $r1, 25) +\n                self::mul($h3, $r0, 25) +\n                self::mul($s4, $h4, 26)\n            );\n\n            $d4 = (\n                self::mul($h0, $r4, 25) +\n                self::mul($h1, $r3, 25) +\n                self::mul($h2, $r2, 25) +\n                self::mul($h3, $r1, 25) +\n                self::mul($h4, $r0, 25)\n            );\n\n            /* (partial) h %= p */\n            /** @var int $c */\n            $c = $d0 >> 26;\n            /** @var int $h0 */\n            $h0 = $d0 & 0x3ffffff;\n            $d1 += $c;\n\n            /** @var int $c */\n            $c = $d1 >> 26;\n            /** @var int $h1 */\n            $h1 = $d1 & 0x3ffffff;\n            $d2 += $c;\n\n            /** @var int $c */\n            $c = $d2 >> 26;\n            /** @var int $h2  */\n            $h2 = $d2 & 0x3ffffff;\n            $d3 += $c;\n\n            /** @var int $c */\n            $c = $d3 >> 26;\n            /** @var int $h3 */\n            $h3 = $d3 & 0x3ffffff;\n            $d4 += $c;\n\n            /** @var int $c */\n            $c = $d4 >> 26;\n            /** @var int $h4 */\n            $h4 = $d4 & 0x3ffffff;\n            $h0 += (int) self::mul($c, 5, 3);\n\n            /** @var int $c */\n            $c = $h0 >> 26;\n            /** @var int $h0 */\n            $h0 &= 0x3ffffff;\n            $h1 += $c;\n\n            // Chop off the left 32 bytes.\n            $message = self::substr(\n                $message,\n                ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE\n            );\n            $bytes -= ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE;\n        }\n\n        $this->h = array(\n            (int) ($h0 & 0xffffffff),\n            (int) ($h1 & 0xffffffff),\n            (int) ($h2 & 0xffffffff),\n            (int) ($h3 & 0xffffffff),\n            (int) ($h4 & 0xffffffff)\n        );\n        return $this;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @return string\n     * @throws TypeError\n     */\n    public function finish()\n    {\n        /* process the remaining block */\n        if ($this->leftover) {\n            $i = $this->leftover;\n            $this->buffer[$i++] = 1;\n            for (; $i < ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE; ++$i) {\n                $this->buffer[$i] = 0;\n            }\n            $this->final = true;\n            $this->blocks(\n                self::substr(\n                    self::intArrayToString($this->buffer),\n                    0,\n                    ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE\n                ),\n                ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE\n            );\n        }\n\n        $h0 = (int) $this->h[0];\n        $h1 = (int) $this->h[1];\n        $h2 = (int) $this->h[2];\n        $h3 = (int) $this->h[3];\n        $h4 = (int) $this->h[4];\n\n        /** @var int $c */\n        $c = $h1 >> 26;\n        /** @var int $h1 */\n        $h1 &= 0x3ffffff;\n        /** @var int $h2 */\n        $h2 += $c;\n        /** @var int $c */\n        $c = $h2 >> 26;\n        /** @var int $h2 */\n        $h2 &= 0x3ffffff;\n        $h3 += $c;\n        /** @var int $c */\n        $c = $h3 >> 26;\n        $h3 &= 0x3ffffff;\n        $h4 += $c;\n        /** @var int $c */\n        $c = $h4 >> 26;\n        $h4 &= 0x3ffffff;\n        /** @var int $h0 */\n        $h0 += self::mul($c, 5, 3);\n        /** @var int $c */\n        $c = $h0 >> 26;\n        /** @var int $h0 */\n        $h0 &= 0x3ffffff;\n        /** @var int $h1 */\n        $h1 += $c;\n\n        /* compute h + -p */\n        /** @var int $g0 */\n        $g0 = $h0 + 5;\n        /** @var int $c */\n        $c = $g0 >> 26;\n        /** @var int $g0 */\n        $g0 &= 0x3ffffff;\n\n        /** @var int $g1 */\n        $g1 = $h1 + $c;\n        /** @var int $c */\n        $c = $g1 >> 26;\n        $g1 &= 0x3ffffff;\n\n        /** @var int $g2 */\n        $g2 = $h2 + $c;\n        /** @var int $c */\n        $c = $g2 >> 26;\n        /** @var int $g2 */\n        $g2 &= 0x3ffffff;\n\n        /** @var int $g3 */\n        $g3 = $h3 + $c;\n        /** @var int $c */\n        $c = $g3 >> 26;\n        /** @var int $g3 */\n        $g3 &= 0x3ffffff;\n\n        /** @var int $g4 */\n        $g4 = ($h4 + $c - (1 << 26)) & 0xffffffff;\n\n        /* select h if h < p, or h + -p if h >= p */\n        /** @var int $mask */\n        $mask = ($g4 >> 31) - 1;\n\n        $g0 &= $mask;\n        $g1 &= $mask;\n        $g2 &= $mask;\n        $g3 &= $mask;\n        $g4 &= $mask;\n\n        /** @var int $mask */\n        $mask = ~$mask & 0xffffffff;\n        /** @var int $h0 */\n        $h0 = ($h0 & $mask) | $g0;\n        /** @var int $h1 */\n        $h1 = ($h1 & $mask) | $g1;\n        /** @var int $h2 */\n        $h2 = ($h2 & $mask) | $g2;\n        /** @var int $h3 */\n        $h3 = ($h3 & $mask) | $g3;\n        /** @var int $h4 */\n        $h4 = ($h4 & $mask) | $g4;\n\n        /* h = h % (2^128) */\n        /** @var int $h0 */\n        $h0 = (($h0) | ($h1 << 26)) & 0xffffffff;\n        /** @var int $h1 */\n        $h1 = (($h1 >>  6) | ($h2 << 20)) & 0xffffffff;\n        /** @var int $h2 */\n        $h2 = (($h2 >> 12) | ($h3 << 14)) & 0xffffffff;\n        /** @var int $h3 */\n        $h3 = (($h3 >> 18) | ($h4 <<  8)) & 0xffffffff;\n\n        /* mac = (h + pad) % (2^128) */\n        $f = (int) ($h0 + $this->pad[0]);\n        $h0 = (int) $f;\n        $f = (int) ($h1 + $this->pad[1] + ($f >> 32));\n        $h1 = (int) $f;\n        $f = (int) ($h2 + $this->pad[2] + ($f >> 32));\n        $h2 = (int) $f;\n        $f = (int) ($h3 + $this->pad[3] + ($f >> 32));\n        $h3 = (int) $f;\n\n        return self::store32_le($h0 & 0xffffffff) .\n            self::store32_le($h1 & 0xffffffff) .\n            self::store32_le($h2 & 0xffffffff) .\n            self::store32_le($h3 & 0xffffffff);\n    }\n}\n", "num_lines": 446}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * Class ParagonIE_Sodium_Core_SecretStream_State\n */\nclass ParagonIE_Sodium_Core_SecretStream_State\n{\n    /** @var string $key */\n    protected $key;\n\n    /** @var int $counter */\n    protected $counter;\n\n    /** @var string $nonce */\n    protected $nonce;\n\n    /** @var string $_pad */\n    protected $_pad;\n\n    /**\n     * ParagonIE_Sodium_Core_SecretStream_State constructor.\n     * @param string $key\n     * @param string|null $nonce\n     */\n    public function __construct($key, $nonce = null)\n    {\n        $this->key = $key;\n        $this->counter = 1;\n        if (is_null($nonce)) {\n            $nonce = str_repeat(\"\\0\", 12);\n        }\n        $this->nonce = str_pad($nonce, 12, \"\\0\", STR_PAD_RIGHT);;\n        $this->_pad = str_repeat(\"\\0\", 4);\n    }\n\n    /**\n     * @return self\n     */\n    public function counterReset()\n    {\n        $this->counter = 1;\n        $this->_pad = str_repeat(\"\\0\", 4);\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getKey()\n    {\n        return $this->key;\n    }\n\n    /**\n     * @return string\n     */\n    public function getCounter()\n    {\n        return ParagonIE_Sodium_Core_Util::store32_le($this->counter);\n    }\n\n    /**\n     * @return string\n     */\n    public function getNonce()\n    {\n        if (!is_string($this->nonce)) {\n            $this->nonce = str_repeat(\"\\0\", 12);\n        }\n        if (ParagonIE_Sodium_Core_Util::strlen($this->nonce) !== 12) {\n            $this->nonce = str_pad($this->nonce, 12, \"\\0\", STR_PAD_RIGHT);\n        }\n        return $this->nonce;\n    }\n\n    /**\n     * @return string\n     */\n    public function getCombinedNonce()\n    {\n        return $this->getCounter() .\n            ParagonIE_Sodium_Core_Util::substr($this->getNonce(), 0, 8);\n    }\n\n    /**\n     * @return self\n     */\n    public function incrementCounter()\n    {\n        ++$this->counter;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function needsRekey()\n    {\n        return ($this->counter & 0xffff) === 0;\n    }\n\n    /**\n     * @param string $newKeyAndNonce\n     * @return self\n     */\n    public function rekey($newKeyAndNonce)\n    {\n        $this->key = ParagonIE_Sodium_Core_Util::substr($newKeyAndNonce, 0, 32);\n        $this->nonce = str_pad(\n            ParagonIE_Sodium_Core_Util::substr($newKeyAndNonce, 32),\n            12,\n            \"\\0\",\n            STR_PAD_RIGHT\n        );\n        return $this;\n    }\n\n    /**\n     * @param string $str\n     * @return self\n     */\n    public function xorNonce($str)\n    {\n        $this->nonce = ParagonIE_Sodium_Core_Util::xorStrings(\n            $this->getNonce(),\n            str_pad(\n                ParagonIE_Sodium_Core_Util::substr($str, 0, 8),\n                12,\n                \"\\0\",\n                STR_PAD_RIGHT\n            )\n        );\n        return $this;\n    }\n\n    /**\n     * @param string $string\n     * @return self\n     */\n    public static function fromString($string)\n    {\n        $state = new ParagonIE_Sodium_Core_SecretStream_State(\n            ParagonIE_Sodium_Core_Util::substr($string, 0, 32)\n        );\n        $state->counter = ParagonIE_Sodium_Core_Util::load_4(\n            ParagonIE_Sodium_Core_Util::substr($string, 32, 4)\n        );\n        $state->nonce = ParagonIE_Sodium_Core_Util::substr($string, 36, 12);\n        $state->_pad = ParagonIE_Sodium_Core_Util::substr($string, 48, 8);\n        return $state;\n    }\n\n    /**\n     * @return string\n     */\n    public function toString()\n    {\n        return $this->key .\n            $this->getCounter() .\n            $this->nonce .\n            $this->_pad;\n    }\n}\n", "num_lines": 164}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_BLAKE2b', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_BLAKE2b\n *\n * Based on the work of Devi Mandiri in devi/salt.\n */\nabstract class ParagonIE_Sodium_Core32_BLAKE2b extends ParagonIE_Sodium_Core_Util\n{\n    /**\n     * @var SplFixedArray\n     */\n    public static $iv;\n\n    /**\n     * @var array<int, array<int, int>>\n     */\n    public static $sigma = array(\n        array(  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15),\n        array( 14, 10,  4,  8,  9, 15, 13,  6,  1, 12,  0,  2, 11,  7,  5,  3),\n        array( 11,  8, 12,  0,  5,  2, 15, 13, 10, 14,  3,  6,  7,  1,  9,  4),\n        array(  7,  9,  3,  1, 13, 12, 11, 14,  2,  6,  5, 10,  4,  0, 15,  8),\n        array(  9,  0,  5,  7,  2,  4, 10, 15, 14,  1, 11, 12,  6,  8,  3, 13),\n        array(  2, 12,  6, 10,  0, 11,  8,  3,  4, 13,  7,  5, 15, 14,  1,  9),\n        array( 12,  5,  1, 15, 14, 13,  4, 10,  0,  7,  6,  3,  9,  2,  8, 11),\n        array( 13, 11,  7, 14, 12,  1,  3,  9,  5,  0, 15,  4,  8,  6,  2, 10),\n        array(  6, 15, 14,  9, 11,  3,  0,  8, 12,  2, 13,  7,  1,  4, 10,  5),\n        array( 10,  2,  8,  4,  7,  6,  1,  5, 15, 11,  9, 14,  3, 12, 13 , 0),\n        array(  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15),\n        array( 14, 10,  4,  8,  9, 15, 13,  6,  1, 12,  0,  2, 11,  7,  5,  3)\n    );\n\n    const BLOCKBYTES = 128;\n    const OUTBYTES   = 64;\n    const KEYBYTES   = 64;\n\n    /**\n     * Turn two 32-bit integers into a fixed array representing a 64-bit integer.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param int $high\n     * @param int $low\n     * @return ParagonIE_Sodium_Core32_Int64\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function new64($high, $low)\n    {\n        return ParagonIE_Sodium_Core32_Int64::fromInts($low, $high);\n    }\n\n    /**\n     * Convert an arbitrary number into an SplFixedArray of two 32-bit integers\n     * that represents a 64-bit integer.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param int $num\n     * @return ParagonIE_Sodium_Core32_Int64\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    protected static function to64($num)\n    {\n        list($hi, $lo) = self::numericTo64BitInteger($num);\n        return self::new64($hi, $lo);\n    }\n\n    /**\n     * Adds two 64-bit integers together, returning their sum as a SplFixedArray\n     * containing two 32-bit integers (representing a 64-bit integer).\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Int64 $x\n     * @param ParagonIE_Sodium_Core32_Int64 $y\n     * @return ParagonIE_Sodium_Core32_Int64\n     */\n    protected static function add64($x, $y)\n    {\n        return $x->addInt64($y);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Int64 $x\n     * @param ParagonIE_Sodium_Core32_Int64 $y\n     * @param ParagonIE_Sodium_Core32_Int64 $z\n     * @return ParagonIE_Sodium_Core32_Int64\n     */\n    public static function add364($x, $y, $z)\n    {\n        return $x->addInt64($y)->addInt64($z);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Int64 $x\n     * @param ParagonIE_Sodium_Core32_Int64 $y\n     * @return ParagonIE_Sodium_Core32_Int64\n     * @throws TypeError\n     */\n    public static function xor64(ParagonIE_Sodium_Core32_Int64 $x, ParagonIE_Sodium_Core32_Int64 $y)\n    {\n        return $x->xorInt64($y);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Int64 $x\n     * @param int $c\n     * @return ParagonIE_Sodium_Core32_Int64\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function rotr64(ParagonIE_Sodium_Core32_Int64 $x, $c)\n    {\n        return $x->rotateRight($c);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $x\n     * @param int $i\n     * @return ParagonIE_Sodium_Core32_Int64\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function load64($x, $i)\n    {\n        /** @var int $l */\n        $l = (int) ($x[$i])\n             | ((int) ($x[$i+1]) << 8)\n             | ((int) ($x[$i+2]) << 16)\n             | ((int) ($x[$i+3]) << 24);\n        /** @var int $h */\n        $h = (int) ($x[$i+4])\n             | ((int) ($x[$i+5]) << 8)\n             | ((int) ($x[$i+6]) << 16)\n             | ((int) ($x[$i+7]) << 24);\n        return self::new64($h, $l);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $x\n     * @param int $i\n     * @param ParagonIE_Sodium_Core32_Int64 $u\n     * @return void\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayAssignment\n     * @psalm-suppress MixedArrayOffset\n     */\n    public static function store64(SplFixedArray $x, $i, ParagonIE_Sodium_Core32_Int64 $u)\n    {\n        $v = clone $u;\n        $maxLength = $x->getSize() - 1;\n        for ($j = 0; $j < 8; ++$j) {\n            $k = 3 - ($j >> 1);\n            $x[$i] = $v->limbs[$k] & 0xff;\n            if (++$i > $maxLength) {\n                return;\n            }\n            $v->limbs[$k] >>= 8;\n        }\n    }\n\n    /**\n     * This just sets the $iv static variable.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @return void\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function pseudoConstructor()\n    {\n        static $called = false;\n        if ($called) {\n            return;\n        }\n        self::$iv = new SplFixedArray(8);\n        self::$iv[0] = self::new64(0x6a09e667, 0xf3bcc908);\n        self::$iv[1] = self::new64(0xbb67ae85, 0x84caa73b);\n        self::$iv[2] = self::new64(0x3c6ef372, 0xfe94f82b);\n        self::$iv[3] = self::new64(0xa54ff53a, 0x5f1d36f1);\n        self::$iv[4] = self::new64(0x510e527f, 0xade682d1);\n        self::$iv[5] = self::new64(0x9b05688c, 0x2b3e6c1f);\n        self::$iv[6] = self::new64(0x1f83d9ab, 0xfb41bd6b);\n        self::$iv[7] = self::new64(0x5be0cd19, 0x137e2179);\n\n        $called = true;\n    }\n\n    /**\n     * Returns a fresh BLAKE2 context.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @return SplFixedArray\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayAssignment\n     * @psalm-suppress MixedArrayOffset\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    protected static function context()\n    {\n        $ctx    = new SplFixedArray(6);\n        $ctx[0] = new SplFixedArray(8);   // h\n        $ctx[1] = new SplFixedArray(2);   // t\n        $ctx[2] = new SplFixedArray(2);   // f\n        $ctx[3] = new SplFixedArray(256); // buf\n        $ctx[4] = 0;                      // buflen\n        $ctx[5] = 0;                      // last_node (uint8_t)\n\n        for ($i = 8; $i--;) {\n            $ctx[0][$i] = self::$iv[$i];\n        }\n        for ($i = 256; $i--;) {\n            $ctx[3][$i] = 0;\n        }\n\n        $zero = self::new64(0, 0);\n        $ctx[1][0] = $zero;\n        $ctx[1][1] = $zero;\n        $ctx[2][0] = $zero;\n        $ctx[2][1] = $zero;\n\n        return $ctx;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $ctx\n     * @param SplFixedArray $buf\n     * @return void\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayAssignment\n     * @psalm-suppress MixedAssignment\n     */\n    protected static function compress(SplFixedArray $ctx, SplFixedArray $buf)\n    {\n        $m = new SplFixedArray(16);\n        $v = new SplFixedArray(16);\n\n        for ($i = 16; $i--;) {\n            $m[$i] = self::load64($buf, $i << 3);\n        }\n\n        for ($i = 8; $i--;) {\n            $v[$i] = $ctx[0][$i];\n        }\n\n        $v[ 8] = self::$iv[0];\n        $v[ 9] = self::$iv[1];\n        $v[10] = self::$iv[2];\n        $v[11] = self::$iv[3];\n\n        $v[12] = self::xor64($ctx[1][0], self::$iv[4]);\n        $v[13] = self::xor64($ctx[1][1], self::$iv[5]);\n        $v[14] = self::xor64($ctx[2][0], self::$iv[6]);\n        $v[15] = self::xor64($ctx[2][1], self::$iv[7]);\n\n        for ($r = 0; $r < 12; ++$r) {\n            $v = self::G($r, 0, 0, 4, 8, 12, $v, $m);\n            $v = self::G($r, 1, 1, 5, 9, 13, $v, $m);\n            $v = self::G($r, 2, 2, 6, 10, 14, $v, $m);\n            $v = self::G($r, 3, 3, 7, 11, 15, $v, $m);\n            $v = self::G($r, 4, 0, 5, 10, 15, $v, $m);\n            $v = self::G($r, 5, 1, 6, 11, 12, $v, $m);\n            $v = self::G($r, 6, 2, 7, 8, 13, $v, $m);\n            $v = self::G($r, 7, 3, 4, 9, 14, $v, $m);\n        }\n\n        for ($i = 8; $i--;) {\n            $ctx[0][$i] = self::xor64(\n                $ctx[0][$i], self::xor64($v[$i], $v[$i+8])\n            );\n        }\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $r\n     * @param int $i\n     * @param int $a\n     * @param int $b\n     * @param int $c\n     * @param int $d\n     * @param SplFixedArray $v\n     * @param SplFixedArray $m\n     * @return SplFixedArray\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedArrayOffset\n     */\n    public static function G($r, $i, $a, $b, $c, $d, SplFixedArray $v, SplFixedArray $m)\n    {\n        $v[$a] = self::add364($v[$a], $v[$b], $m[self::$sigma[$r][$i << 1]]);\n        $v[$d] = self::rotr64(self::xor64($v[$d], $v[$a]), 32);\n        $v[$c] = self::add64($v[$c], $v[$d]);\n        $v[$b] = self::rotr64(self::xor64($v[$b], $v[$c]), 24);\n        $v[$a] = self::add364($v[$a], $v[$b], $m[self::$sigma[$r][($i << 1) + 1]]);\n        $v[$d] = self::rotr64(self::xor64($v[$d], $v[$a]), 16);\n        $v[$c] = self::add64($v[$c], $v[$d]);\n        $v[$b] = self::rotr64(self::xor64($v[$b], $v[$c]), 63);\n        return $v;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $ctx\n     * @param int $inc\n     * @return void\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayAssignment\n     */\n    public static function increment_counter($ctx, $inc)\n    {\n        if ($inc < 0) {\n            throw new SodiumException('Increasing by a negative number makes no sense.');\n        }\n        $t = self::to64($inc);\n        # S->t is $ctx[1] in our implementation\n\n        # S->t[0] = ( uint64_t )( t >> 0 );\n        $ctx[1][0] = self::add64($ctx[1][0], $t);\n\n        # S->t[1] += ( S->t[0] < inc );\n        if (!($ctx[1][0] instanceof ParagonIE_Sodium_Core32_Int64)) {\n            throw new TypeError('Not an int64');\n        }\n        /** @var ParagonIE_Sodium_Core32_Int64 $c*/\n        $c = $ctx[1][0];\n        if ($c->isLessThanInt($inc)) {\n            $ctx[1][1] = self::add64($ctx[1][1], self::to64(1));\n        }\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $ctx\n     * @param SplFixedArray $p\n     * @param int $plen\n     * @return void\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayAssignment\n     * @psalm-suppress MixedArrayOffset\n     * @psalm-suppress MixedMethodCall\n     * @psalm-suppress MixedOperand\n     */\n    public static function update(SplFixedArray $ctx, SplFixedArray $p, $plen)\n    {\n        self::pseudoConstructor();\n\n        $offset = 0;\n        while ($plen > 0) {\n            $left = $ctx[4];\n            $fill = 256 - $left;\n\n            if ($plen > $fill) {\n                # memcpy( S->buf + left, in, fill ); /* Fill buffer */\n                for ($i = $fill; $i--;) {\n                    $ctx[3][$i + $left] = $p[$i + $offset];\n                }\n\n                # S->buflen += fill;\n                $ctx[4] += $fill;\n\n                # blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );\n                self::increment_counter($ctx, 128);\n\n                # blake2b_compress( S, S->buf ); /* Compress */\n                self::compress($ctx, $ctx[3]);\n\n                # memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES ); /* Shift buffer left */\n                for ($i = 128; $i--;) {\n                    $ctx[3][$i] = $ctx[3][$i + 128];\n                }\n\n                # S->buflen -= BLAKE2B_BLOCKBYTES;\n                $ctx[4] -= 128;\n\n                # in += fill;\n                $offset += $fill;\n\n                # inlen -= fill;\n                $plen -= $fill;\n            } else {\n                for ($i = $plen; $i--;) {\n                    $ctx[3][$i + $left] = $p[$i + $offset];\n                }\n                $ctx[4] += $plen;\n                $offset += $plen;\n                $plen -= $plen;\n            }\n        }\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $ctx\n     * @param SplFixedArray $out\n     * @return SplFixedArray\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayAssignment\n     * @psalm-suppress MixedArrayOffset\n     * @psalm-suppress MixedMethodCall\n     * @psalm-suppress MixedOperand\n     */\n    public static function finish(SplFixedArray $ctx, SplFixedArray $out)\n    {\n        self::pseudoConstructor();\n        if ($ctx[4] > 128) {\n            self::increment_counter($ctx, 128);\n            self::compress($ctx, $ctx[3]);\n            $ctx[4] -= 128;\n            if ($ctx[4] > 128) {\n                throw new SodiumException('Failed to assert that buflen <= 128 bytes');\n            }\n            for ($i = $ctx[4]; $i--;) {\n                $ctx[3][$i] = $ctx[3][$i + 128];\n            }\n        }\n\n        self::increment_counter($ctx, $ctx[4]);\n        $ctx[2][0] = self::new64(0xffffffff, 0xffffffff);\n\n        for ($i = 256 - $ctx[4]; $i--;) {\n            /** @var int $i */\n            $ctx[3][$i + $ctx[4]] = 0;\n        }\n\n        self::compress($ctx, $ctx[3]);\n\n        $i = (int) (($out->getSize() - 1) / 8);\n        for (; $i >= 0; --$i) {\n            self::store64($out, $i << 3, $ctx[0][$i]);\n        }\n        return $out;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray|null $key\n     * @param int $outlen\n     * @param SplFixedArray|null $salt\n     * @param SplFixedArray|null $personal\n     * @return SplFixedArray\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayAssignment\n     * @psalm-suppress MixedMethodCall\n     */\n    public static function init(\n        $key = null,\n        $outlen = 64,\n        $salt = null,\n        $personal = null\n    ) {\n        self::pseudoConstructor();\n        $klen = 0;\n\n        if ($key !== null) {\n            if (count($key) > 64) {\n                throw new SodiumException('Invalid key size');\n            }\n            $klen = count($key);\n        }\n\n        if ($outlen > 64) {\n            throw new SodiumException('Invalid output size');\n        }\n\n        $ctx = self::context();\n\n        $p = new SplFixedArray(64);\n        // Zero our param buffer...\n        for ($i = 64; --$i;) {\n            $p[$i] = 0;\n        }\n\n        $p[0] = $outlen; // digest_length\n        $p[1] = $klen;   // key_length\n        $p[2] = 1;       // fanout\n        $p[3] = 1;       // depth\n\n        if ($salt instanceof SplFixedArray) {\n            // salt: [32] through [47]\n            for ($i = 0; $i < 16; ++$i) {\n                $p[32 + $i] = (int) $salt[$i];\n            }\n        }\n        if ($personal instanceof SplFixedArray) {\n            // personal: [48] through [63]\n            for ($i = 0; $i < 16; ++$i) {\n                $p[48 + $i] = (int) $personal[$i];\n            }\n        }\n\n        $ctx[0][0] = self::xor64(\n            $ctx[0][0],\n            self::load64($p, 0)\n        );\n\n        if ($salt instanceof SplFixedArray || $personal instanceof SplFixedArray) {\n            // We need to do what blake2b_init_param() does:\n            for ($i = 1; $i < 8; ++$i) {\n                $ctx[0][$i] = self::xor64(\n                    $ctx[0][$i],\n                    self::load64($p, $i << 3)\n                );\n            }\n        }\n\n        if ($klen > 0 && $key instanceof SplFixedArray) {\n            $block = new SplFixedArray(128);\n            for ($i = 128; $i--;) {\n                $block[$i] = 0;\n            }\n            for ($i = $klen; $i--;) {\n                $block[$i] = $key[$i];\n            }\n            self::update($ctx, $block, 128);\n            $ctx[4] = 128;\n        }\n\n        return $ctx;\n    }\n\n    /**\n     * Convert a string into an SplFixedArray of integers\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $str\n     * @return SplFixedArray\n     */\n    public static function stringToSplFixedArray($str = '')\n    {\n        $values = unpack('C*', $str);\n        return SplFixedArray::fromArray(array_values($values));\n    }\n\n    /**\n     * Convert an SplFixedArray of integers into a string\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $a\n     * @return string\n     */\n    public static function SplFixedArrayToString(SplFixedArray $a)\n    {\n        /**\n         * @var array<int, string|int>\n         */\n        $arr = $a->toArray();\n        $c = $a->count();\n        array_unshift($arr, str_repeat('C', $c));\n        return (string) (call_user_func_array('pack', $arr));\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param SplFixedArray $ctx\n     * @return string\n     * @throws TypeError\n     * @psalm-suppress MixedArgument\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayAssignment\n     * @psalm-suppress MixedMethodCall\n     */\n    public static function contextToString(SplFixedArray $ctx)\n    {\n        $str = '';\n        /** @var array<int, ParagonIE_Sodium_Core32_Int64> $ctxA */\n        $ctxA = $ctx[0]->toArray();\n\n        # uint64_t h[8];\n        for ($i = 0; $i < 8; ++$i) {\n            if (!($ctxA[$i] instanceof ParagonIE_Sodium_Core32_Int64)) {\n                throw new TypeError('Not an instance of Int64');\n            }\n            /** @var ParagonIE_Sodium_Core32_Int64 $ctxAi */\n            $ctxAi = $ctxA[$i];\n            $str .= $ctxAi->toReverseString();\n        }\n\n        # uint64_t t[2];\n        # uint64_t f[2];\n        for ($i = 1; $i < 3; ++$i) {\n            /** @var array<int, ParagonIE_Sodium_Core32_Int64> $ctxA */\n            $ctxA = $ctx[$i]->toArray();\n            /** @var ParagonIE_Sodium_Core32_Int64 $ctxA1 */\n            $ctxA1 = $ctxA[0];\n            /** @var ParagonIE_Sodium_Core32_Int64 $ctxA2 */\n            $ctxA2 = $ctxA[1];\n\n            $str .= $ctxA1->toReverseString();\n            $str .= $ctxA2->toReverseString();\n        }\n\n        # uint8_t buf[2 * 128];\n        $str .= self::SplFixedArrayToString($ctx[3]);\n\n        /** @var int $ctx4 */\n        $ctx4 = $ctx[4];\n\n        # size_t buflen;\n        $str .= implode('', array(\n            self::intToChr($ctx4 & 0xff),\n            self::intToChr(($ctx4 >> 8) & 0xff),\n            self::intToChr(($ctx4 >> 16) & 0xff),\n            self::intToChr(($ctx4 >> 24) & 0xff),\n            \"\\x00\\x00\\x00\\x00\"\n            /*\n            self::intToChr(($ctx4 >> 32) & 0xff),\n            self::intToChr(($ctx4 >> 40) & 0xff),\n            self::intToChr(($ctx4 >> 48) & 0xff),\n            self::intToChr(($ctx4 >> 56) & 0xff)\n            */\n        ));\n        # uint8_t last_node;\n        return $str . self::intToChr($ctx[5]) . str_repeat(\"\\x00\", 23);\n    }\n\n    /**\n     * Creates an SplFixedArray containing other SplFixedArray elements, from\n     * a string (compatible with \\Sodium\\crypto_generichash_{init, update, final})\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $string\n     * @return SplFixedArray\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayAssignment\n     */\n    public static function stringToContext($string)\n    {\n        $ctx = self::context();\n\n        # uint64_t h[8];\n        for ($i = 0; $i < 8; ++$i) {\n            $ctx[0][$i] = ParagonIE_Sodium_Core32_Int64::fromReverseString(\n                self::substr($string, (($i << 3) + 0), 8)\n            );\n        }\n\n        # uint64_t t[2];\n        # uint64_t f[2];\n        for ($i = 1; $i < 3; ++$i) {\n            $ctx[$i][1] = ParagonIE_Sodium_Core32_Int64::fromReverseString(\n                self::substr($string, 72 + (($i - 1) << 4), 8)\n            );\n            $ctx[$i][0] = ParagonIE_Sodium_Core32_Int64::fromReverseString(\n                self::substr($string, 64 + (($i - 1) << 4), 8)\n            );\n        }\n\n        # uint8_t buf[2 * 128];\n        $ctx[3] = self::stringToSplFixedArray(self::substr($string, 96, 256));\n\n        # uint8_t buf[2 * 128];\n        $int = 0;\n        for ($i = 0; $i < 8; ++$i) {\n            $int |= self::chrToInt($string[352 + $i]) << ($i << 3);\n        }\n        $ctx[4] = $int;\n\n        return $ctx;\n    }\n}\n", "num_lines": 719}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_ChaCha20', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_ChaCha20\n */\nclass ParagonIE_Sodium_Core32_ChaCha20 extends ParagonIE_Sodium_Core32_Util\n{\n    /**\n     * The ChaCha20 quarter round function. Works on four 32-bit integers.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Int32 $a\n     * @param ParagonIE_Sodium_Core32_Int32 $b\n     * @param ParagonIE_Sodium_Core32_Int32 $c\n     * @param ParagonIE_Sodium_Core32_Int32 $d\n     * @return array<int, ParagonIE_Sodium_Core32_Int32>\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    protected static function quarterRound(\n        ParagonIE_Sodium_Core32_Int32 $a,\n        ParagonIE_Sodium_Core32_Int32 $b,\n        ParagonIE_Sodium_Core32_Int32 $c,\n        ParagonIE_Sodium_Core32_Int32 $d\n    ) {\n        /** @var ParagonIE_Sodium_Core32_Int32 $a */\n        /** @var ParagonIE_Sodium_Core32_Int32 $b */\n        /** @var ParagonIE_Sodium_Core32_Int32 $c */\n        /** @var ParagonIE_Sodium_Core32_Int32 $d */\n\n        # a = PLUS(a,b); d = ROTATE(XOR(d,a),16);\n        $a = $a->addInt32($b);\n        $d = $d->xorInt32($a)->rotateLeft(16);\n\n        # c = PLUS(c,d); b = ROTATE(XOR(b,c),12);\n        $c = $c->addInt32($d);\n        $b = $b->xorInt32($c)->rotateLeft(12);\n\n        # a = PLUS(a,b); d = ROTATE(XOR(d,a), 8);\n        $a = $a->addInt32($b);\n        $d = $d->xorInt32($a)->rotateLeft(8);\n\n        # c = PLUS(c,d); b = ROTATE(XOR(b,c), 7);\n        $c = $c->addInt32($d);\n        $b = $b->xorInt32($c)->rotateLeft(7);\n\n        return array($a, $b, $c, $d);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_ChaCha20_Ctx $ctx\n     * @param string $message\n     *\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function encryptBytes(\n        ParagonIE_Sodium_Core32_ChaCha20_Ctx $ctx,\n        $message = ''\n    ) {\n        $bytes = self::strlen($message);\n\n        /** @var ParagonIE_Sodium_Core32_Int32 $x0 */\n        /** @var ParagonIE_Sodium_Core32_Int32 $x1 */\n        /** @var ParagonIE_Sodium_Core32_Int32 $x2 */\n        /** @var ParagonIE_Sodium_Core32_Int32 $x3 */\n        /** @var ParagonIE_Sodium_Core32_Int32 $x4 */\n        /** @var ParagonIE_Sodium_Core32_Int32 $x5 */\n        /** @var ParagonIE_Sodium_Core32_Int32 $x6 */\n        /** @var ParagonIE_Sodium_Core32_Int32 $x7 */\n        /** @var ParagonIE_Sodium_Core32_Int32 $x8 */\n        /** @var ParagonIE_Sodium_Core32_Int32 $x9 */\n        /** @var ParagonIE_Sodium_Core32_Int32 $x10 */\n        /** @var ParagonIE_Sodium_Core32_Int32 $x11 */\n        /** @var ParagonIE_Sodium_Core32_Int32 $x12 */\n        /** @var ParagonIE_Sodium_Core32_Int32 $x13 */\n        /** @var ParagonIE_Sodium_Core32_Int32 $x14 */\n        /** @var ParagonIE_Sodium_Core32_Int32 $x15 */\n\n        /*\n        j0 = ctx->input[0];\n        j1 = ctx->input[1];\n        j2 = ctx->input[2];\n        j3 = ctx->input[3];\n        j4 = ctx->input[4];\n        j5 = ctx->input[5];\n        j6 = ctx->input[6];\n        j7 = ctx->input[7];\n        j8 = ctx->input[8];\n        j9 = ctx->input[9];\n        j10 = ctx->input[10];\n        j11 = ctx->input[11];\n        j12 = ctx->input[12];\n        j13 = ctx->input[13];\n        j14 = ctx->input[14];\n        j15 = ctx->input[15];\n        */\n        /** @var ParagonIE_Sodium_Core32_Int32 $j0 */\n        $j0  = $ctx[0];\n        /** @var ParagonIE_Sodium_Core32_Int32 $j1 */\n        $j1  = $ctx[1];\n        /** @var ParagonIE_Sodium_Core32_Int32 $j2 */\n        $j2  = $ctx[2];\n        /** @var ParagonIE_Sodium_Core32_Int32 $j3 */\n        $j3  = $ctx[3];\n        /** @var ParagonIE_Sodium_Core32_Int32 $j4 */\n        $j4  = $ctx[4];\n        /** @var ParagonIE_Sodium_Core32_Int32 $j5 */\n        $j5  = $ctx[5];\n        /** @var ParagonIE_Sodium_Core32_Int32 $j6 */\n        $j6  = $ctx[6];\n        /** @var ParagonIE_Sodium_Core32_Int32 $j7 */\n        $j7  = $ctx[7];\n        /** @var ParagonIE_Sodium_Core32_Int32 $j8 */\n        $j8  = $ctx[8];\n        /** @var ParagonIE_Sodium_Core32_Int32 $j9 */\n        $j9  = $ctx[9];\n        /** @var ParagonIE_Sodium_Core32_Int32 $j10 */\n        $j10 = $ctx[10];\n        /** @var ParagonIE_Sodium_Core32_Int32 $j11 */\n        $j11 = $ctx[11];\n        /** @var ParagonIE_Sodium_Core32_Int32 $j12 */\n        $j12 = $ctx[12];\n        /** @var ParagonIE_Sodium_Core32_Int32 $j13 */\n        $j13 = $ctx[13];\n        /** @var ParagonIE_Sodium_Core32_Int32 $j14 */\n        $j14 = $ctx[14];\n        /** @var ParagonIE_Sodium_Core32_Int32 $j15 */\n        $j15 = $ctx[15];\n\n        $c = '';\n        for (;;) {\n            if ($bytes < 64) {\n                $message .= str_repeat(\"\\x00\", 64 - $bytes);\n            }\n\n            $x0 =  clone $j0;\n            $x1 =  clone $j1;\n            $x2 =  clone $j2;\n            $x3 =  clone $j3;\n            $x4 =  clone $j4;\n            $x5 =  clone $j5;\n            $x6 =  clone $j6;\n            $x7 =  clone $j7;\n            $x8 =  clone $j8;\n            $x9 =  clone $j9;\n            $x10 = clone $j10;\n            $x11 = clone $j11;\n            $x12 = clone $j12;\n            $x13 = clone $j13;\n            $x14 = clone $j14;\n            $x15 = clone $j15;\n\n            # for (i = 20; i > 0; i -= 2) {\n            for ($i = 20; $i > 0; $i -= 2) {\n                # QUARTERROUND( x0,  x4,  x8,  x12)\n                list($x0, $x4, $x8, $x12) = self::quarterRound($x0, $x4, $x8, $x12);\n\n                # QUARTERROUND( x1,  x5,  x9,  x13)\n                list($x1, $x5, $x9, $x13) = self::quarterRound($x1, $x5, $x9, $x13);\n\n                # QUARTERROUND( x2,  x6,  x10,  x14)\n                list($x2, $x6, $x10, $x14) = self::quarterRound($x2, $x6, $x10, $x14);\n\n                # QUARTERROUND( x3,  x7,  x11,  x15)\n                list($x3, $x7, $x11, $x15) = self::quarterRound($x3, $x7, $x11, $x15);\n\n                # QUARTERROUND( x0,  x5,  x10,  x15)\n                list($x0, $x5, $x10, $x15) = self::quarterRound($x0, $x5, $x10, $x15);\n\n                # QUARTERROUND( x1,  x6,  x11,  x12)\n                list($x1, $x6, $x11, $x12) = self::quarterRound($x1, $x6, $x11, $x12);\n\n                # QUARTERROUND( x2,  x7,  x8,  x13)\n                list($x2, $x7, $x8, $x13) = self::quarterRound($x2, $x7, $x8, $x13);\n\n                # QUARTERROUND( x3,  x4,  x9,  x14)\n                list($x3, $x4, $x9, $x14) = self::quarterRound($x3, $x4, $x9, $x14);\n            }\n            /*\n            x0 = PLUS(x0, j0);\n            x1 = PLUS(x1, j1);\n            x2 = PLUS(x2, j2);\n            x3 = PLUS(x3, j3);\n            x4 = PLUS(x4, j4);\n            x5 = PLUS(x5, j5);\n            x6 = PLUS(x6, j6);\n            x7 = PLUS(x7, j7);\n            x8 = PLUS(x8, j8);\n            x9 = PLUS(x9, j9);\n            x10 = PLUS(x10, j10);\n            x11 = PLUS(x11, j11);\n            x12 = PLUS(x12, j12);\n            x13 = PLUS(x13, j13);\n            x14 = PLUS(x14, j14);\n            x15 = PLUS(x15, j15);\n            */\n            $x0 = $x0->addInt32($j0);\n            $x1 = $x1->addInt32($j1);\n            $x2 = $x2->addInt32($j2);\n            $x3 = $x3->addInt32($j3);\n            $x4 = $x4->addInt32($j4);\n            $x5 = $x5->addInt32($j5);\n            $x6 = $x6->addInt32($j6);\n            $x7 = $x7->addInt32($j7);\n            $x8 = $x8->addInt32($j8);\n            $x9 = $x9->addInt32($j9);\n            $x10 = $x10->addInt32($j10);\n            $x11 = $x11->addInt32($j11);\n            $x12 = $x12->addInt32($j12);\n            $x13 = $x13->addInt32($j13);\n            $x14 = $x14->addInt32($j14);\n            $x15 = $x15->addInt32($j15);\n\n            /*\n            x0 = XOR(x0, LOAD32_LE(m + 0));\n            x1 = XOR(x1, LOAD32_LE(m + 4));\n            x2 = XOR(x2, LOAD32_LE(m + 8));\n            x3 = XOR(x3, LOAD32_LE(m + 12));\n            x4 = XOR(x4, LOAD32_LE(m + 16));\n            x5 = XOR(x5, LOAD32_LE(m + 20));\n            x6 = XOR(x6, LOAD32_LE(m + 24));\n            x7 = XOR(x7, LOAD32_LE(m + 28));\n            x8 = XOR(x8, LOAD32_LE(m + 32));\n            x9 = XOR(x9, LOAD32_LE(m + 36));\n            x10 = XOR(x10, LOAD32_LE(m + 40));\n            x11 = XOR(x11, LOAD32_LE(m + 44));\n            x12 = XOR(x12, LOAD32_LE(m + 48));\n            x13 = XOR(x13, LOAD32_LE(m + 52));\n            x14 = XOR(x14, LOAD32_LE(m + 56));\n            x15 = XOR(x15, LOAD32_LE(m + 60));\n            */\n            $x0  =  $x0->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message,  0, 4)));\n            $x1  =  $x1->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message,  4, 4)));\n            $x2  =  $x2->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message,  8, 4)));\n            $x3  =  $x3->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 12, 4)));\n            $x4  =  $x4->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 16, 4)));\n            $x5  =  $x5->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 20, 4)));\n            $x6  =  $x6->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 24, 4)));\n            $x7  =  $x7->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 28, 4)));\n            $x8  =  $x8->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 32, 4)));\n            $x9  =  $x9->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 36, 4)));\n            $x10 = $x10->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 40, 4)));\n            $x11 = $x11->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 44, 4)));\n            $x12 = $x12->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 48, 4)));\n            $x13 = $x13->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 52, 4)));\n            $x14 = $x14->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 56, 4)));\n            $x15 = $x15->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 60, 4)));\n\n            /*\n                j12 = PLUSONE(j12);\n                if (!j12) {\n                    j13 = PLUSONE(j13);\n                }\n             */\n            /** @var ParagonIE_Sodium_Core32_Int32 $j12 */\n            $j12 = $j12->addInt(1);\n            if ($j12->limbs[0] === 0 && $j12->limbs[1] === 0) {\n                $j13 = $j13->addInt(1);\n            }\n\n            /*\n            STORE32_LE(c + 0, x0);\n            STORE32_LE(c + 4, x1);\n            STORE32_LE(c + 8, x2);\n            STORE32_LE(c + 12, x3);\n            STORE32_LE(c + 16, x4);\n            STORE32_LE(c + 20, x5);\n            STORE32_LE(c + 24, x6);\n            STORE32_LE(c + 28, x7);\n            STORE32_LE(c + 32, x8);\n            STORE32_LE(c + 36, x9);\n            STORE32_LE(c + 40, x10);\n            STORE32_LE(c + 44, x11);\n            STORE32_LE(c + 48, x12);\n            STORE32_LE(c + 52, x13);\n            STORE32_LE(c + 56, x14);\n            STORE32_LE(c + 60, x15);\n            */\n\n            $block = $x0->toReverseString() .\n                $x1->toReverseString() .\n                $x2->toReverseString() .\n                $x3->toReverseString() .\n                $x4->toReverseString() .\n                $x5->toReverseString() .\n                $x6->toReverseString() .\n                $x7->toReverseString() .\n                $x8->toReverseString() .\n                $x9->toReverseString() .\n                $x10->toReverseString() .\n                $x11->toReverseString() .\n                $x12->toReverseString() .\n                $x13->toReverseString() .\n                $x14->toReverseString() .\n                $x15->toReverseString();\n\n            /* Partial block */\n            if ($bytes < 64) {\n                $c .= self::substr($block, 0, $bytes);\n                break;\n            }\n\n            /* Full block */\n            $c .= $block;\n            $bytes -= 64;\n            if ($bytes <= 0) {\n                break;\n            }\n            $message = self::substr($message, 64);\n        }\n        /* end for(;;) loop */\n\n        $ctx[12] = $j12;\n        $ctx[13] = $j13;\n        return $c;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $len\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function stream($len = 64, $nonce = '', $key = '')\n    {\n        return self::encryptBytes(\n            new ParagonIE_Sodium_Core32_ChaCha20_Ctx($key, $nonce),\n            str_repeat(\"\\x00\", $len)\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $len\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ietfStream($len, $nonce = '', $key = '')\n    {\n        return self::encryptBytes(\n            new ParagonIE_Sodium_Core32_ChaCha20_IetfCtx($key, $nonce),\n            str_repeat(\"\\x00\", $len)\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @param string $ic\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ietfStreamXorIc($message, $nonce = '', $key = '', $ic = '')\n    {\n        return self::encryptBytes(\n            new ParagonIE_Sodium_Core32_ChaCha20_IetfCtx($key, $nonce, $ic),\n            $message\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @param string $ic\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function streamXorIc($message, $nonce = '', $key = '', $ic = '')\n    {\n        return self::encryptBytes(\n            new ParagonIE_Sodium_Core32_ChaCha20_Ctx($key, $nonce, $ic),\n            $message\n        );\n    }\n}\n", "num_lines": 401}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_Curve25519', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_Curve25519\n *\n * Implements Curve25519 core functions\n *\n * Based on the ref10 curve25519 code provided by libsodium\n *\n * @ref https://github.com/jedisct1/libsodium/blob/master/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c\n */\nabstract class ParagonIE_Sodium_Core32_Curve25519 extends ParagonIE_Sodium_Core32_Curve25519_H\n{\n    /**\n     * Get a field element of size 10 with a value of 0\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @return ParagonIE_Sodium_Core32_Curve25519_Fe\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fe_0()\n    {\n        return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(\n            array(\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32()\n            )\n        );\n    }\n\n    /**\n     * Get a field element of size 10 with a value of 1\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @return ParagonIE_Sodium_Core32_Curve25519_Fe\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fe_1()\n    {\n        return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(\n            array(\n                ParagonIE_Sodium_Core32_Int32::fromInt(1),\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32(),\n                new ParagonIE_Sodium_Core32_Int32()\n            )\n        );\n    }\n\n    /**\n     * Add two field elements.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $g\n     * @return ParagonIE_Sodium_Core32_Curve25519_Fe\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedMethodCall\n     */\n    public static function fe_add(\n        ParagonIE_Sodium_Core32_Curve25519_Fe $f,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $g\n    ) {\n        $arr = array();\n        for ($i = 0; $i < 10; ++$i) {\n            $arr[$i] = $f[$i]->addInt32($g[$i]);\n        }\n        /** @var array<int, ParagonIE_Sodium_Core32_Int32> $arr */\n        return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray($arr);\n    }\n\n    /**\n     * Constant-time conditional move.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $g\n     * @param int $b\n     * @return ParagonIE_Sodium_Core32_Curve25519_Fe\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedMethodCall\n     */\n    public static function fe_cmov(\n        ParagonIE_Sodium_Core32_Curve25519_Fe $f,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $g,\n        $b = 0\n    ) {\n        /** @var array<int, ParagonIE_Sodium_Core32_Int32> $h */\n        $h = array();\n        for ($i = 0; $i < 10; ++$i) {\n            if (!($f[$i] instanceof ParagonIE_Sodium_Core32_Int32)) {\n                throw new TypeError('Expected Int32');\n            }\n            if (!($g[$i] instanceof ParagonIE_Sodium_Core32_Int32)) {\n                throw new TypeError('Expected Int32');\n            }\n            $h[$i] = $f[$i]->xorInt32(\n                $f[$i]->xorInt32($g[$i])->mask($b)\n            );\n        }\n        /** @var array<int, ParagonIE_Sodium_Core32_Int32> $h */\n        return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray($h);\n    }\n\n    /**\n     * Create a copy of a field element.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f\n     * @return ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public static function fe_copy(ParagonIE_Sodium_Core32_Curve25519_Fe $f)\n    {\n        $h = clone $f;\n        return $h;\n    }\n\n    /**\n     * Give: 32-byte string.\n     * Receive: A field element object to use for internal calculations.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $s\n     * @return ParagonIE_Sodium_Core32_Curve25519_Fe\n     * @throws RangeException\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedMethodCall\n     */\n    public static function fe_frombytes($s)\n    {\n        if (self::strlen($s) !== 32) {\n            throw new RangeException('Expected a 32-byte string.');\n        }\n        /** @var ParagonIE_Sodium_Core32_Int32 $h0 */\n        $h0 = ParagonIE_Sodium_Core32_Int32::fromInt(\n            self::load_4($s)\n        );\n        /** @var ParagonIE_Sodium_Core32_Int32 $h1 */\n        $h1 = ParagonIE_Sodium_Core32_Int32::fromInt(\n            self::load_3(self::substr($s, 4, 3)) << 6\n        );\n        /** @var ParagonIE_Sodium_Core32_Int32 $h2 */\n        $h2 = ParagonIE_Sodium_Core32_Int32::fromInt(\n            self::load_3(self::substr($s, 7, 3)) << 5\n        );\n        /** @var ParagonIE_Sodium_Core32_Int32 $h3 */\n        $h3 = ParagonIE_Sodium_Core32_Int32::fromInt(\n            self::load_3(self::substr($s, 10, 3)) << 3\n        );\n        /** @var ParagonIE_Sodium_Core32_Int32 $h4 */\n        $h4 = ParagonIE_Sodium_Core32_Int32::fromInt(\n            self::load_3(self::substr($s, 13, 3)) << 2\n        );\n        /** @var ParagonIE_Sodium_Core32_Int32 $h5 */\n        $h5 = ParagonIE_Sodium_Core32_Int32::fromInt(\n            self::load_4(self::substr($s, 16, 4))\n        );\n        /** @var ParagonIE_Sodium_Core32_Int32 $h6 */\n        $h6 = ParagonIE_Sodium_Core32_Int32::fromInt(\n            self::load_3(self::substr($s, 20, 3)) << 7\n        );\n        /** @var ParagonIE_Sodium_Core32_Int32 $h7 */\n        $h7 = ParagonIE_Sodium_Core32_Int32::fromInt(\n            self::load_3(self::substr($s, 23, 3)) << 5\n        );\n        /** @var ParagonIE_Sodium_Core32_Int32 $h8 */\n        $h8 = ParagonIE_Sodium_Core32_Int32::fromInt(\n            self::load_3(self::substr($s, 26, 3)) << 4\n        );\n        /** @var ParagonIE_Sodium_Core32_Int32 $h9 */\n        $h9 = ParagonIE_Sodium_Core32_Int32::fromInt(\n            (self::load_3(self::substr($s, 29, 3)) & 8388607) << 2\n        );\n\n        $carry9 = $h9->addInt(1 << 24)->shiftRight(25);\n        $h0 = $h0->addInt32($carry9->mulInt(19, 5));\n        $h9 = $h9->subInt32($carry9->shiftLeft(25));\n\n        $carry1 = $h1->addInt(1 << 24)->shiftRight(25);\n        $h2 = $h2->addInt32($carry1);\n        $h1 = $h1->subInt32($carry1->shiftLeft(25));\n\n        $carry3 = $h3->addInt(1 << 24)->shiftRight(25);\n        $h4 = $h4->addInt32($carry3);\n        $h3 = $h3->subInt32($carry3->shiftLeft(25));\n\n        $carry5 = $h5->addInt(1 << 24)->shiftRight(25);\n        $h6 = $h6->addInt32($carry5);\n        $h5 = $h5->subInt32($carry5->shiftLeft(25));\n\n        $carry7 = $h7->addInt(1 << 24)->shiftRight(25);\n        $h8 = $h8->addInt32($carry7);\n        $h7 = $h7->subInt32($carry7->shiftLeft(25));\n\n        $carry0 = $h0->addInt(1 << 25)->shiftRight(26);\n        $h1 = $h1->addInt32($carry0);\n        $h0 = $h0->subInt32($carry0->shiftLeft(26));\n\n        $carry2 = $h2->addInt(1 << 25)->shiftRight(26);\n        $h3 = $h3->addInt32($carry2);\n        $h2 = $h2->subInt32($carry2->shiftLeft(26));\n\n        $carry4 = $h4->addInt(1 << 25)->shiftRight(26);\n        $h5 = $h5->addInt32($carry4);\n        $h4 = $h4->subInt32($carry4->shiftLeft(26));\n\n        $carry6 = $h6->addInt(1 << 25)->shiftRight(26);\n        $h7 = $h7->addInt32($carry6);\n        $h6 = $h6->subInt32($carry6->shiftLeft(26));\n\n        $carry8 = $h8->addInt(1 << 25)->shiftRight(26);\n        $h9 = $h9->addInt32($carry8);\n        $h8 = $h8->subInt32($carry8->shiftLeft(26));\n\n        return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(\n            array($h0, $h1, $h2,$h3, $h4, $h5, $h6, $h7, $h8, $h9)\n        );\n    }\n\n    /**\n     * Convert a field element to a byte string.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $h\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedMethodCall\n     */\n    public static function fe_tobytes(ParagonIE_Sodium_Core32_Curve25519_Fe $h)\n    {\n        /**\n         * @var ParagonIE_Sodium_Core32_Int64[] $f\n         * @var ParagonIE_Sodium_Core32_Int64 $q\n         */\n        $f = array();\n\n        for ($i = 0; $i < 10; ++$i) {\n            $f[$i] = $h[$i]->toInt64();\n        }\n\n        $q = $f[9]->mulInt(19, 5)->addInt(1 << 14)->shiftRight(25)\n            ->addInt64($f[0])->shiftRight(26)\n            ->addInt64($f[1])->shiftRight(25)\n            ->addInt64($f[2])->shiftRight(26)\n            ->addInt64($f[3])->shiftRight(25)\n            ->addInt64($f[4])->shiftRight(26)\n            ->addInt64($f[5])->shiftRight(25)\n            ->addInt64($f[6])->shiftRight(26)\n            ->addInt64($f[7])->shiftRight(25)\n            ->addInt64($f[8])->shiftRight(26)\n            ->addInt64($f[9])->shiftRight(25);\n\n        $f[0] = $f[0]->addInt64($q->mulInt(19, 5));\n\n        $carry0 = $f[0]->shiftRight(26);\n        $f[1] = $f[1]->addInt64($carry0);\n        $f[0] = $f[0]->subInt64($carry0->shiftLeft(26));\n\n        $carry1 = $f[1]->shiftRight(25);\n        $f[2] = $f[2]->addInt64($carry1);\n        $f[1] = $f[1]->subInt64($carry1->shiftLeft(25));\n\n        $carry2 = $f[2]->shiftRight(26);\n        $f[3] = $f[3]->addInt64($carry2);\n        $f[2] = $f[2]->subInt64($carry2->shiftLeft(26));\n\n        $carry3 = $f[3]->shiftRight(25);\n        $f[4] = $f[4]->addInt64($carry3);\n        $f[3] = $f[3]->subInt64($carry3->shiftLeft(25));\n\n        $carry4 = $f[4]->shiftRight(26);\n        $f[5] = $f[5]->addInt64($carry4);\n        $f[4] = $f[4]->subInt64($carry4->shiftLeft(26));\n\n        $carry5 = $f[5]->shiftRight(25);\n        $f[6] = $f[6]->addInt64($carry5);\n        $f[5] = $f[5]->subInt64($carry5->shiftLeft(25));\n\n        $carry6 = $f[6]->shiftRight(26);\n        $f[7] = $f[7]->addInt64($carry6);\n        $f[6] = $f[6]->subInt64($carry6->shiftLeft(26));\n\n        $carry7 = $f[7]->shiftRight(25);\n        $f[8] = $f[8]->addInt64($carry7);\n        $f[7] = $f[7]->subInt64($carry7->shiftLeft(25));\n\n        $carry8 = $f[8]->shiftRight(26);\n        $f[9] = $f[9]->addInt64($carry8);\n        $f[8] = $f[8]->subInt64($carry8->shiftLeft(26));\n\n        $carry9 = $f[9]->shiftRight(25);\n        $f[9] = $f[9]->subInt64($carry9->shiftLeft(25));\n\n        /** @var int $h0 */\n        $h0 = $f[0]->toInt32()->toInt();\n        /** @var int $h1 */\n        $h1 = $f[1]->toInt32()->toInt();\n        /** @var int $h2 */\n        $h2 = $f[2]->toInt32()->toInt();\n        /** @var int $h3 */\n        $h3 = $f[3]->toInt32()->toInt();\n        /** @var int $h4 */\n        $h4 = $f[4]->toInt32()->toInt();\n        /** @var int $h5 */\n        $h5 = $f[5]->toInt32()->toInt();\n        /** @var int $h6 */\n        $h6 = $f[6]->toInt32()->toInt();\n        /** @var int $h7 */\n        $h7 = $f[7]->toInt32()->toInt();\n        /** @var int $h8 */\n        $h8 = $f[8]->toInt32()->toInt();\n        /** @var int $h9 */\n        $h9 = $f[9]->toInt32()->toInt();\n\n        /**\n         * @var array<int, int>\n         */\n        $s = array(\n            (int) (($h0 >> 0) & 0xff),\n            (int) (($h0 >> 8) & 0xff),\n            (int) (($h0 >> 16) & 0xff),\n            (int) ((($h0 >> 24) | ($h1 << 2)) & 0xff),\n            (int) (($h1 >> 6) & 0xff),\n            (int) (($h1 >> 14) & 0xff),\n            (int) ((($h1 >> 22) | ($h2 << 3)) & 0xff),\n            (int) (($h2 >> 5) & 0xff),\n            (int) (($h2 >> 13) & 0xff),\n            (int) ((($h2 >> 21) | ($h3 << 5)) & 0xff),\n            (int) (($h3 >> 3) & 0xff),\n            (int) (($h3 >> 11) & 0xff),\n            (int) ((($h3 >> 19) | ($h4 << 6)) & 0xff),\n            (int) (($h4 >> 2) & 0xff),\n            (int) (($h4 >> 10) & 0xff),\n            (int) (($h4 >> 18) & 0xff),\n            (int) (($h5 >> 0) & 0xff),\n            (int) (($h5 >> 8) & 0xff),\n            (int) (($h5 >> 16) & 0xff),\n            (int) ((($h5 >> 24) | ($h6 << 1)) & 0xff),\n            (int) (($h6 >> 7) & 0xff),\n            (int) (($h6 >> 15) & 0xff),\n            (int) ((($h6 >> 23) | ($h7 << 3)) & 0xff),\n            (int) (($h7 >> 5) & 0xff),\n            (int) (($h7 >> 13) & 0xff),\n            (int) ((($h7 >> 21) | ($h8 << 4)) & 0xff),\n            (int) (($h8 >> 4) & 0xff),\n            (int) (($h8 >> 12) & 0xff),\n            (int) ((($h8 >> 20) | ($h9 << 6)) & 0xff),\n            (int) (($h9 >> 2) & 0xff),\n            (int) (($h9 >> 10) & 0xff),\n            (int) (($h9 >> 18) & 0xff)\n        );\n        return self::intArrayToString($s);\n    }\n\n    /**\n     * Is a field element negative? (1 = yes, 0 = no. Used in calculations.)\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f\n     * @return int\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fe_isnegative(ParagonIE_Sodium_Core32_Curve25519_Fe $f)\n    {\n        $str = self::fe_tobytes($f);\n        return (int) (self::chrToInt($str[0]) & 1);\n    }\n\n    /**\n     * Returns 0 if this field element results in all NUL bytes.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fe_isnonzero(ParagonIE_Sodium_Core32_Curve25519_Fe $f)\n    {\n        static $zero;\n        if ($zero === null) {\n            $zero = str_repeat(\"\\x00\", 32);\n        }\n        /** @var string $str */\n        $str = self::fe_tobytes($f);\n        /** @var string $zero */\n        return !self::verify_32($str, $zero);\n    }\n\n    /**\n     * Multiply two field elements\n     *\n     * h = f * g\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @security Is multiplication a source of timing leaks? If so, can we do\n     *           anything to prevent that from happening?\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $g\n     * @return ParagonIE_Sodium_Core32_Curve25519_Fe\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fe_mul(\n        ParagonIE_Sodium_Core32_Curve25519_Fe $f,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $g\n    ) {\n        /**\n         * @var ParagonIE_Sodium_Core32_Int32[] $f\n         * @var ParagonIE_Sodium_Core32_Int32[] $g\n         * @var ParagonIE_Sodium_Core32_Int64 $f0\n         * @var ParagonIE_Sodium_Core32_Int64 $f1\n         * @var ParagonIE_Sodium_Core32_Int64 $f2\n         * @var ParagonIE_Sodium_Core32_Int64 $f3\n         * @var ParagonIE_Sodium_Core32_Int64 $f4\n         * @var ParagonIE_Sodium_Core32_Int64 $f5\n         * @var ParagonIE_Sodium_Core32_Int64 $f6\n         * @var ParagonIE_Sodium_Core32_Int64 $f7\n         * @var ParagonIE_Sodium_Core32_Int64 $f8\n         * @var ParagonIE_Sodium_Core32_Int64 $f9\n         * @var ParagonIE_Sodium_Core32_Int64 $g0\n         * @var ParagonIE_Sodium_Core32_Int64 $g1\n         * @var ParagonIE_Sodium_Core32_Int64 $g2\n         * @var ParagonIE_Sodium_Core32_Int64 $g3\n         * @var ParagonIE_Sodium_Core32_Int64 $g4\n         * @var ParagonIE_Sodium_Core32_Int64 $g5\n         * @var ParagonIE_Sodium_Core32_Int64 $g6\n         * @var ParagonIE_Sodium_Core32_Int64 $g7\n         * @var ParagonIE_Sodium_Core32_Int64 $g8\n         * @var ParagonIE_Sodium_Core32_Int64 $g9\n         */\n        $f0 = $f[0]->toInt64();\n        $f1 = $f[1]->toInt64();\n        $f2 = $f[2]->toInt64();\n        $f3 = $f[3]->toInt64();\n        $f4 = $f[4]->toInt64();\n        $f5 = $f[5]->toInt64();\n        $f6 = $f[6]->toInt64();\n        $f7 = $f[7]->toInt64();\n        $f8 = $f[8]->toInt64();\n        $f9 = $f[9]->toInt64();\n        $g0 = $g[0]->toInt64();\n        $g1 = $g[1]->toInt64();\n        $g2 = $g[2]->toInt64();\n        $g3 = $g[3]->toInt64();\n        $g4 = $g[4]->toInt64();\n        $g5 = $g[5]->toInt64();\n        $g6 = $g[6]->toInt64();\n        $g7 = $g[7]->toInt64();\n        $g8 = $g[8]->toInt64();\n        $g9 = $g[9]->toInt64();\n        $g1_19 = $g1->mulInt(19, 5); /* 2^4 <= 19 <= 2^5, but we only want 5 bits */\n        $g2_19 = $g2->mulInt(19, 5);\n        $g3_19 = $g3->mulInt(19, 5);\n        $g4_19 = $g4->mulInt(19, 5);\n        $g5_19 = $g5->mulInt(19, 5);\n        $g6_19 = $g6->mulInt(19, 5);\n        $g7_19 = $g7->mulInt(19, 5);\n        $g8_19 = $g8->mulInt(19, 5);\n        $g9_19 = $g9->mulInt(19, 5);\n        /** @var ParagonIE_Sodium_Core32_Int64 $f1_2 */\n        $f1_2 = $f1->shiftLeft(1);\n        /** @var ParagonIE_Sodium_Core32_Int64 $f3_2 */\n        $f3_2 = $f3->shiftLeft(1);\n        /** @var ParagonIE_Sodium_Core32_Int64 $f5_2 */\n        $f5_2 = $f5->shiftLeft(1);\n        /** @var ParagonIE_Sodium_Core32_Int64 $f7_2 */\n        $f7_2 = $f7->shiftLeft(1);\n        /** @var ParagonIE_Sodium_Core32_Int64 $f9_2 */\n        $f9_2 = $f9->shiftLeft(1);\n        $f0g0    = $f0->mulInt64($g0, 27);\n        $f0g1    = $f0->mulInt64($g1, 27);\n        $f0g2    = $f0->mulInt64($g2, 27);\n        $f0g3    = $f0->mulInt64($g3, 27);\n        $f0g4    = $f0->mulInt64($g4, 27);\n        $f0g5    = $f0->mulInt64($g5, 27);\n        $f0g6    = $f0->mulInt64($g6, 27);\n        $f0g7    = $f0->mulInt64($g7, 27);\n        $f0g8    = $f0->mulInt64($g8, 27);\n        $f0g9    = $f0->mulInt64($g9, 27);\n        $f1g0    = $f1->mulInt64($g0, 27);\n        $f1g1_2  = $f1_2->mulInt64($g1, 27);\n        $f1g2    = $f1->mulInt64($g2, 27);\n        $f1g3_2  = $f1_2->mulInt64($g3, 27);\n        $f1g4    = $f1->mulInt64($g4, 30);\n        $f1g5_2  = $f1_2->mulInt64($g5, 30);\n        $f1g6    = $f1->mulInt64($g6, 30);\n        $f1g7_2  = $f1_2->mulInt64($g7, 30);\n        $f1g8    = $f1->mulInt64($g8, 30);\n        $f1g9_38 = $g9_19->mulInt64($f1_2, 30);\n        $f2g0    = $f2->mulInt64($g0, 30);\n        $f2g1    = $f2->mulInt64($g1, 29);\n        $f2g2    = $f2->mulInt64($g2, 30);\n        $f2g3    = $f2->mulInt64($g3, 29);\n        $f2g4    = $f2->mulInt64($g4, 30);\n        $f2g5    = $f2->mulInt64($g5, 29);\n        $f2g6    = $f2->mulInt64($g6, 30);\n        $f2g7    = $f2->mulInt64($g7, 29);\n        $f2g8_19 = $g8_19->mulInt64($f2, 30);\n        $f2g9_19 = $g9_19->mulInt64($f2, 30);\n        $f3g0    = $f3->mulInt64($g0, 30);\n        $f3g1_2  = $f3_2->mulInt64($g1, 30);\n        $f3g2    = $f3->mulInt64($g2, 30);\n        $f3g3_2  = $f3_2->mulInt64($g3, 30);\n        $f3g4    = $f3->mulInt64($g4, 30);\n        $f3g5_2  = $f3_2->mulInt64($g5, 30);\n        $f3g6    = $f3->mulInt64($g6, 30);\n        $f3g7_38 = $g7_19->mulInt64($f3_2, 30);\n        $f3g8_19 = $g8_19->mulInt64($f3, 30);\n        $f3g9_38 = $g9_19->mulInt64($f3_2, 30);\n        $f4g0    = $f4->mulInt64($g0, 30);\n        $f4g1    = $f4->mulInt64($g1, 30);\n        $f4g2    = $f4->mulInt64($g2, 30);\n        $f4g3    = $f4->mulInt64($g3, 30);\n        $f4g4    = $f4->mulInt64($g4, 30);\n        $f4g5    = $f4->mulInt64($g5, 30);\n        $f4g6_19 = $g6_19->mulInt64($f4, 30);\n        $f4g7_19 = $g7_19->mulInt64($f4, 30);\n        $f4g8_19 = $g8_19->mulInt64($f4, 30);\n        $f4g9_19 = $g9_19->mulInt64($f4, 30);\n        $f5g0    = $f5->mulInt64($g0, 30);\n        $f5g1_2  = $f5_2->mulInt64($g1, 30);\n        $f5g2    = $f5->mulInt64($g2, 30);\n        $f5g3_2  = $f5_2->mulInt64($g3, 30);\n        $f5g4    = $f5->mulInt64($g4, 30);\n        $f5g5_38 = $g5_19->mulInt64($f5_2, 30);\n        $f5g6_19 = $g6_19->mulInt64($f5, 30);\n        $f5g7_38 = $g7_19->mulInt64($f5_2, 30);\n        $f5g8_19 = $g8_19->mulInt64($f5, 30);\n        $f5g9_38 = $g9_19->mulInt64($f5_2, 30);\n        $f6g0    = $f6->mulInt64($g0, 30);\n        $f6g1    = $f6->mulInt64($g1, 30);\n        $f6g2    = $f6->mulInt64($g2, 30);\n        $f6g3    = $f6->mulInt64($g3, 30);\n        $f6g4_19 = $g4_19->mulInt64($f6, 30);\n        $f6g5_19 = $g5_19->mulInt64($f6, 30);\n        $f6g6_19 = $g6_19->mulInt64($f6, 30);\n        $f6g7_19 = $g7_19->mulInt64($f6, 30);\n        $f6g8_19 = $g8_19->mulInt64($f6, 30);\n        $f6g9_19 = $g9_19->mulInt64($f6, 30);\n        $f7g0    = $f7->mulInt64($g0, 30);\n        $f7g1_2  = $g1->mulInt64($f7_2, 30);\n        $f7g2    = $f7->mulInt64($g2, 30);\n        $f7g3_38 = $g3_19->mulInt64($f7_2, 30);\n        $f7g4_19 = $g4_19->mulInt64($f7, 30);\n        $f7g5_38 = $g5_19->mulInt64($f7_2, 30);\n        $f7g6_19 = $g6_19->mulInt64($f7, 30);\n        $f7g7_38 = $g7_19->mulInt64($f7_2, 30);\n        $f7g8_19 = $g8_19->mulInt64($f7, 30);\n        $f7g9_38 = $g9_19->mulInt64($f7_2, 30);\n        $f8g0    = $f8->mulInt64($g0, 30);\n        $f8g1    = $f8->mulInt64($g1, 29);\n        $f8g2_19 = $g2_19->mulInt64($f8, 30);\n        $f8g3_19 = $g3_19->mulInt64($f8, 30);\n        $f8g4_19 = $g4_19->mulInt64($f8, 30);\n        $f8g5_19 = $g5_19->mulInt64($f8, 30);\n        $f8g6_19 = $g6_19->mulInt64($f8, 30);\n        $f8g7_19 = $g7_19->mulInt64($f8, 30);\n        $f8g8_19 = $g8_19->mulInt64($f8, 30);\n        $f8g9_19 = $g9_19->mulInt64($f8, 30);\n        $f9g0    = $f9->mulInt64($g0, 30);\n        $f9g1_38 = $g1_19->mulInt64($f9_2, 30);\n        $f9g2_19 = $g2_19->mulInt64($f9, 30);\n        $f9g3_38 = $g3_19->mulInt64($f9_2, 30);\n        $f9g4_19 = $g4_19->mulInt64($f9, 30);\n        $f9g5_38 = $g5_19->mulInt64($f9_2, 30);\n        $f9g6_19 = $g6_19->mulInt64($f9, 30);\n        $f9g7_38 = $g7_19->mulInt64($f9_2, 30);\n        $f9g8_19 = $g8_19->mulInt64($f9, 30);\n        $f9g9_38 = $g9_19->mulInt64($f9_2, 30);\n\n        // $h0 = $f0g0 + $f1g9_38 + $f2g8_19 + $f3g7_38 + $f4g6_19 + $f5g5_38 + $f6g4_19 + $f7g3_38 + $f8g2_19 + $f9g1_38;\n        $h0 = $f0g0->addInt64($f1g9_38)->addInt64($f2g8_19)->addInt64($f3g7_38)\n            ->addInt64($f4g6_19)->addInt64($f5g5_38)->addInt64($f6g4_19)\n            ->addInt64($f7g3_38)->addInt64($f8g2_19)->addInt64($f9g1_38);\n\n        // $h1 = $f0g1 + $f1g0    + $f2g9_19 + $f3g8_19 + $f4g7_19 + $f5g6_19 + $f6g5_19 + $f7g4_19 + $f8g3_19 + $f9g2_19;\n        $h1 = $f0g1->addInt64($f1g0)->addInt64($f2g9_19)->addInt64($f3g8_19)\n            ->addInt64($f4g7_19)->addInt64($f5g6_19)->addInt64($f6g5_19)\n            ->addInt64($f7g4_19)->addInt64($f8g3_19)->addInt64($f9g2_19);\n\n        // $h2 = $f0g2 + $f1g1_2  + $f2g0    + $f3g9_38 + $f4g8_19 + $f5g7_38 + $f6g6_19 + $f7g5_38 + $f8g4_19 + $f9g3_38;\n        $h2 = $f0g2->addInt64($f1g1_2)->addInt64($f2g0)->addInt64($f3g9_38)\n            ->addInt64($f4g8_19)->addInt64($f5g7_38)->addInt64($f6g6_19)\n            ->addInt64($f7g5_38)->addInt64($f8g4_19)->addInt64($f9g3_38);\n\n        // $h3 = $f0g3 + $f1g2    + $f2g1    + $f3g0    + $f4g9_19 + $f5g8_19 + $f6g7_19 + $f7g6_19 + $f8g5_19 + $f9g4_19;\n        $h3 = $f0g3->addInt64($f1g2)->addInt64($f2g1)->addInt64($f3g0)\n            ->addInt64($f4g9_19)->addInt64($f5g8_19)->addInt64($f6g7_19)\n            ->addInt64($f7g6_19)->addInt64($f8g5_19)->addInt64($f9g4_19);\n\n        // $h4 = $f0g4 + $f1g3_2  + $f2g2    + $f3g1_2  + $f4g0    + $f5g9_38 + $f6g8_19 + $f7g7_38 + $f8g6_19 + $f9g5_38;\n        $h4 = $f0g4->addInt64($f1g3_2)->addInt64($f2g2)->addInt64($f3g1_2)\n            ->addInt64($f4g0)->addInt64($f5g9_38)->addInt64($f6g8_19)\n            ->addInt64($f7g7_38)->addInt64($f8g6_19)->addInt64($f9g5_38);\n\n        // $h5 = $f0g5 + $f1g4    + $f2g3    + $f3g2    + $f4g1    + $f5g0    + $f6g9_19 + $f7g8_19 + $f8g7_19 + $f9g6_19;\n        $h5 = $f0g5->addInt64($f1g4)->addInt64($f2g3)->addInt64($f3g2)\n            ->addInt64($f4g1)->addInt64($f5g0)->addInt64($f6g9_19)\n            ->addInt64($f7g8_19)->addInt64($f8g7_19)->addInt64($f9g6_19);\n\n        // $h6 = $f0g6 + $f1g5_2  + $f2g4    + $f3g3_2  + $f4g2    + $f5g1_2  + $f6g0    + $f7g9_38 + $f8g8_19 + $f9g7_38;\n        $h6 = $f0g6->addInt64($f1g5_2)->addInt64($f2g4)->addInt64($f3g3_2)\n            ->addInt64($f4g2)->addInt64($f5g1_2)->addInt64($f6g0)\n            ->addInt64($f7g9_38)->addInt64($f8g8_19)->addInt64($f9g7_38);\n\n        // $h7 = $f0g7 + $f1g6    + $f2g5    + $f3g4    + $f4g3    + $f5g2    + $f6g1    + $f7g0    + $f8g9_19 + $f9g8_19;\n        $h7 = $f0g7->addInt64($f1g6)->addInt64($f2g5)->addInt64($f3g4)\n            ->addInt64($f4g3)->addInt64($f5g2)->addInt64($f6g1)\n            ->addInt64($f7g0)->addInt64($f8g9_19)->addInt64($f9g8_19);\n\n        // $h8 = $f0g8 + $f1g7_2  + $f2g6    + $f3g5_2  + $f4g4    + $f5g3_2  + $f6g2    + $f7g1_2  + $f8g0    + $f9g9_38;\n        $h8 = $f0g8->addInt64($f1g7_2)->addInt64($f2g6)->addInt64($f3g5_2)\n            ->addInt64($f4g4)->addInt64($f5g3_2)->addInt64($f6g2)\n            ->addInt64($f7g1_2)->addInt64($f8g0)->addInt64($f9g9_38);\n\n        // $h9 = $f0g9 + $f1g8    + $f2g7    + $f3g6    + $f4g5    + $f5g4    + $f6g3    + $f7g2    + $f8g1    + $f9g0   ;\n        $h9 = $f0g9->addInt64($f1g8)->addInt64($f2g7)->addInt64($f3g6)\n            ->addInt64($f4g5)->addInt64($f5g4)->addInt64($f6g3)\n            ->addInt64($f7g2)->addInt64($f8g1)->addInt64($f9g0);\n\n        /**\n         * @var ParagonIE_Sodium_Core32_Int64 $h0\n         * @var ParagonIE_Sodium_Core32_Int64 $h1\n         * @var ParagonIE_Sodium_Core32_Int64 $h2\n         * @var ParagonIE_Sodium_Core32_Int64 $h3\n         * @var ParagonIE_Sodium_Core32_Int64 $h4\n         * @var ParagonIE_Sodium_Core32_Int64 $h5\n         * @var ParagonIE_Sodium_Core32_Int64 $h6\n         * @var ParagonIE_Sodium_Core32_Int64 $h7\n         * @var ParagonIE_Sodium_Core32_Int64 $h8\n         * @var ParagonIE_Sodium_Core32_Int64 $h9\n         * @var ParagonIE_Sodium_Core32_Int64 $carry0\n         * @var ParagonIE_Sodium_Core32_Int64 $carry1\n         * @var ParagonIE_Sodium_Core32_Int64 $carry2\n         * @var ParagonIE_Sodium_Core32_Int64 $carry3\n         * @var ParagonIE_Sodium_Core32_Int64 $carry4\n         * @var ParagonIE_Sodium_Core32_Int64 $carry5\n         * @var ParagonIE_Sodium_Core32_Int64 $carry6\n         * @var ParagonIE_Sodium_Core32_Int64 $carry7\n         * @var ParagonIE_Sodium_Core32_Int64 $carry8\n         * @var ParagonIE_Sodium_Core32_Int64 $carry9\n         */\n        $carry0 = $h0->addInt(1 << 25)->shiftRight(26);\n        $h1 = $h1->addInt64($carry0);\n        $h0 = $h0->subInt64($carry0->shiftLeft(26));\n        $carry4 = $h4->addInt(1 << 25)->shiftRight(26);\n        $h5 = $h5->addInt64($carry4);\n        $h4 = $h4->subInt64($carry4->shiftLeft(26));\n\n        $carry1 = $h1->addInt(1 << 24)->shiftRight(25);\n        $h2 = $h2->addInt64($carry1);\n        $h1 = $h1->subInt64($carry1->shiftLeft(25));\n        $carry5 = $h5->addInt(1 << 24)->shiftRight(25);\n        $h6 = $h6->addInt64($carry5);\n        $h5 = $h5->subInt64($carry5->shiftLeft(25));\n\n        $carry2 = $h2->addInt(1 << 25)->shiftRight(26);\n        $h3 = $h3->addInt64($carry2);\n        $h2 = $h2->subInt64($carry2->shiftLeft(26));\n        $carry6 = $h6->addInt(1 << 25)->shiftRight(26);\n        $h7 = $h7->addInt64($carry6);\n        $h6 = $h6->subInt64($carry6->shiftLeft(26));\n\n        $carry3 = $h3->addInt(1 << 24)->shiftRight(25);\n        $h4 = $h4->addInt64($carry3);\n        $h3 = $h3->subInt64($carry3->shiftLeft(25));\n        $carry7 = $h7->addInt(1 << 24)->shiftRight(25);\n        $h8 = $h8->addInt64($carry7);\n        $h7 = $h7->subInt64($carry7->shiftLeft(25));\n\n        $carry4 = $h4->addInt(1 << 25)->shiftRight(26);\n        $h5 = $h5->addInt64($carry4);\n        $h4 = $h4->subInt64($carry4->shiftLeft(26));\n        $carry8 = $h8->addInt(1 << 25)->shiftRight(26);\n        $h9 = $h9->addInt64($carry8);\n        $h8 = $h8->subInt64($carry8->shiftLeft(26));\n\n        $carry9 = $h9->addInt(1 << 24)->shiftRight(25);\n        $h0 = $h0->addInt64($carry9->mulInt(19, 5));\n        $h9 = $h9->subInt64($carry9->shiftLeft(25));\n\n        $carry0 = $h0->addInt(1 << 25)->shiftRight(26);\n        $h1 = $h1->addInt64($carry0);\n        $h0 = $h0->subInt64($carry0->shiftLeft(26));\n\n        return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(\n            array(\n                $h0->toInt32(),\n                $h1->toInt32(),\n                $h2->toInt32(),\n                $h3->toInt32(),\n                $h4->toInt32(),\n                $h5->toInt32(),\n                $h6->toInt32(),\n                $h7->toInt32(),\n                $h8->toInt32(),\n                $h9->toInt32()\n            )\n        );\n    }\n\n    /**\n     * Get the negative values for each piece of the field element.\n     *\n     * h = -f\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f\n     * @return ParagonIE_Sodium_Core32_Curve25519_Fe\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedMethodCall\n     */\n    public static function fe_neg(ParagonIE_Sodium_Core32_Curve25519_Fe $f)\n    {\n        $h = new ParagonIE_Sodium_Core32_Curve25519_Fe();\n        for ($i = 0; $i < 10; ++$i) {\n            $h[$i] = $h[$i]->subInt32($f[$i]);\n        }\n        return $h;\n    }\n\n    /**\n     * Square a field element\n     *\n     * h = f * f\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f\n     * @return ParagonIE_Sodium_Core32_Curve25519_Fe\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedMethodCall\n     */\n    public static function fe_sq(ParagonIE_Sodium_Core32_Curve25519_Fe $f)\n    {\n        /** @var ParagonIE_Sodium_Core32_Int64 $f0 */\n        $f0 = $f[0]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f1 */\n        $f1 = $f[1]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f2 */\n        $f2 = $f[2]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f3 */\n        $f3 = $f[3]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f4 */\n        $f4 = $f[4]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f5 */\n        $f5 = $f[5]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f6 */\n        $f6 = $f[6]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f7 */\n        $f7 = $f[7]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f8 */\n        $f8 = $f[8]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f9 */\n        $f9 = $f[9]->toInt64();\n\n        /** @var ParagonIE_Sodium_Core32_Int64 $f0_2 */\n        $f0_2 = $f0->shiftLeft(1);\n        $f1_2 = $f1->shiftLeft(1);\n        $f2_2 = $f2->shiftLeft(1);\n        $f3_2 = $f3->shiftLeft(1);\n        $f4_2 = $f4->shiftLeft(1);\n        $f5_2 = $f5->shiftLeft(1);\n        $f6_2 = $f6->shiftLeft(1);\n        $f7_2 = $f7->shiftLeft(1);\n        $f5_38 = $f5->mulInt(38, 6);\n        $f6_19 = $f6->mulInt(19, 5);\n        $f7_38 = $f7->mulInt(38, 6);\n        $f8_19 = $f8->mulInt(19, 5);\n        $f9_38 = $f9->mulInt(38, 6);\n        /** @var ParagonIE_Sodium_Core32_Int64 $f0f0*/\n        $f0f0    = $f0->mulInt64($f0, 28);\n        $f0f1_2  = $f0_2->mulInt64($f1, 28);\n        $f0f2_2 =  $f0_2->mulInt64($f2, 28);\n        $f0f3_2 =  $f0_2->mulInt64($f3, 28);\n        $f0f4_2 =  $f0_2->mulInt64($f4, 28);\n        $f0f5_2 =  $f0_2->mulInt64($f5, 28);\n        $f0f6_2 =  $f0_2->mulInt64($f6, 28);\n        $f0f7_2 =  $f0_2->mulInt64($f7, 28);\n        $f0f8_2 =  $f0_2->mulInt64($f8, 28);\n        $f0f9_2 =  $f0_2->mulInt64($f9, 28);\n\n        $f1f1_2 = $f1_2->mulInt64($f1, 28);\n        $f1f2_2 = $f1_2->mulInt64($f2, 28);\n        $f1f3_4 = $f1_2->mulInt64($f3_2, 28);\n        $f1f4_2 = $f1_2->mulInt64($f4, 28);\n        $f1f5_4 = $f1_2->mulInt64($f5_2, 30);\n        $f1f6_2 = $f1_2->mulInt64($f6, 28);\n        $f1f7_4 = $f1_2->mulInt64($f7_2, 28);\n        $f1f8_2 = $f1_2->mulInt64($f8, 28);\n        $f1f9_76 = $f9_38->mulInt64($f1_2, 30);\n\n        $f2f2 = $f2->mulInt64($f2, 28);\n        $f2f3_2 = $f2_2->mulInt64($f3, 28);\n        $f2f4_2 = $f2_2->mulInt64($f4, 28);\n        $f2f5_2 = $f2_2->mulInt64($f5, 28);\n        $f2f6_2 = $f2_2->mulInt64($f6, 28);\n        $f2f7_2 = $f2_2->mulInt64($f7, 28);\n        $f2f8_38 = $f8_19->mulInt64($f2_2, 30);\n        $f2f9_38 = $f9_38->mulInt64($f2, 30);\n\n        $f3f3_2 = $f3_2->mulInt64($f3, 28);\n        $f3f4_2 = $f3_2->mulInt64($f4, 28);\n        $f3f5_4 = $f3_2->mulInt64($f5_2, 30);\n        $f3f6_2 = $f3_2->mulInt64($f6, 28);\n        $f3f7_76 = $f7_38->mulInt64($f3_2, 30);\n        $f3f8_38 = $f8_19->mulInt64($f3_2, 30);\n        $f3f9_76 = $f9_38->mulInt64($f3_2, 30);\n\n        $f4f4 = $f4->mulInt64($f4, 28);\n        $f4f5_2 = $f4_2->mulInt64($f5, 28);\n        $f4f6_38 = $f6_19->mulInt64($f4_2, 30);\n        $f4f7_38 = $f7_38->mulInt64($f4, 30);\n        $f4f8_38 = $f8_19->mulInt64($f4_2, 30);\n        $f4f9_38 = $f9_38->mulInt64($f4, 30);\n\n        $f5f5_38 = $f5_38->mulInt64($f5, 30);\n        $f5f6_38 = $f6_19->mulInt64($f5_2, 30);\n        $f5f7_76 = $f7_38->mulInt64($f5_2, 30);\n        $f5f8_38 = $f8_19->mulInt64($f5_2, 30);\n        $f5f9_76 = $f9_38->mulInt64($f5_2, 30);\n\n        $f6f6_19 = $f6_19->mulInt64($f6, 30);\n        $f6f7_38 = $f7_38->mulInt64($f6, 30);\n        $f6f8_38 = $f8_19->mulInt64($f6_2, 30);\n        $f6f9_38 = $f9_38->mulInt64($f6, 30);\n\n        $f7f7_38 = $f7_38->mulInt64($f7, 28);\n        $f7f8_38 = $f8_19->mulInt64($f7_2, 30);\n        $f7f9_76 = $f9_38->mulInt64($f7_2, 30);\n\n        $f8f8_19 = $f8_19->mulInt64($f8, 30);\n        $f8f9_38 = $f9_38->mulInt64($f8, 30);\n\n        $f9f9_38 = $f9_38->mulInt64($f9, 28);\n\n        $h0 = $f0f0->addInt64($f1f9_76)->addInt64($f2f8_38)->addInt64($f3f7_76)->addInt64($f4f6_38)->addInt64($f5f5_38);\n        $h1 = $f0f1_2->addInt64($f2f9_38)->addInt64($f3f8_38)->addInt64($f4f7_38)->addInt64($f5f6_38);\n        $h2 = $f0f2_2->addInt64($f1f1_2)->addInt64($f3f9_76)->addInt64($f4f8_38)->addInt64($f5f7_76)->addInt64($f6f6_19);\n        $h3 = $f0f3_2->addInt64($f1f2_2)->addInt64($f4f9_38)->addInt64($f5f8_38)->addInt64($f6f7_38);\n        $h4 = $f0f4_2->addInt64($f1f3_4)->addInt64($f2f2)->addInt64($f5f9_76)->addInt64($f6f8_38)->addInt64($f7f7_38);\n        $h5 = $f0f5_2->addInt64($f1f4_2)->addInt64($f2f3_2)->addInt64($f6f9_38)->addInt64($f7f8_38);\n        $h6 = $f0f6_2->addInt64($f1f5_4)->addInt64($f2f4_2)->addInt64($f3f3_2)->addInt64($f7f9_76)->addInt64($f8f8_19);\n        $h7 = $f0f7_2->addInt64($f1f6_2)->addInt64($f2f5_2)->addInt64($f3f4_2)->addInt64($f8f9_38);\n        $h8 = $f0f8_2->addInt64($f1f7_4)->addInt64($f2f6_2)->addInt64($f3f5_4)->addInt64($f4f4)->addInt64($f9f9_38);\n        $h9 = $f0f9_2->addInt64($f1f8_2)->addInt64($f2f7_2)->addInt64($f3f6_2)->addInt64($f4f5_2);\n\n        /**\n         * @var ParagonIE_Sodium_Core32_Int64 $h0\n         * @var ParagonIE_Sodium_Core32_Int64 $h1\n         * @var ParagonIE_Sodium_Core32_Int64 $h2\n         * @var ParagonIE_Sodium_Core32_Int64 $h3\n         * @var ParagonIE_Sodium_Core32_Int64 $h4\n         * @var ParagonIE_Sodium_Core32_Int64 $h5\n         * @var ParagonIE_Sodium_Core32_Int64 $h6\n         * @var ParagonIE_Sodium_Core32_Int64 $h7\n         * @var ParagonIE_Sodium_Core32_Int64 $h8\n         * @var ParagonIE_Sodium_Core32_Int64 $h9\n         */\n\n        $carry0 = $h0->addInt(1 << 25)->shiftRight(26);\n        $h1 = $h1->addInt64($carry0);\n        $h0 = $h0->subInt64($carry0->shiftLeft(26));\n\n        $carry4 = $h4->addInt(1 << 25)->shiftRight(26);\n        $h5 = $h5->addInt64($carry4);\n        $h4 = $h4->subInt64($carry4->shiftLeft(26));\n\n        $carry1 = $h1->addInt(1 << 24)->shiftRight(25);\n        $h2 = $h2->addInt64($carry1);\n        $h1 = $h1->subInt64($carry1->shiftLeft(25));\n\n        $carry5 = $h5->addInt(1 << 24)->shiftRight(25);\n        $h6 = $h6->addInt64($carry5);\n        $h5 = $h5->subInt64($carry5->shiftLeft(25));\n\n        $carry2 = $h2->addInt(1 << 25)->shiftRight(26);\n        $h3 = $h3->addInt64($carry2);\n        $h2 = $h2->subInt64($carry2->shiftLeft(26));\n\n        $carry6 = $h6->addInt(1 << 25)->shiftRight(26);\n        $h7 = $h7->addInt64($carry6);\n        $h6 = $h6->subInt64($carry6->shiftLeft(26));\n\n        $carry3 = $h3->addInt(1 << 24)->shiftRight(25);\n        $h4 = $h4->addInt64($carry3);\n        $h3 = $h3->subInt64($carry3->shiftLeft(25));\n\n        $carry7 = $h7->addInt(1 << 24)->shiftRight(25);\n        $h8 = $h8->addInt64($carry7);\n        $h7 = $h7->subInt64($carry7->shiftLeft(25));\n\n        $carry4 = $h4->addInt(1 << 25)->shiftRight(26);\n        $h5 = $h5->addInt64($carry4);\n        $h4 = $h4->subInt64($carry4->shiftLeft(26));\n\n        $carry8 = $h8->addInt(1 << 25)->shiftRight(26);\n        $h9 = $h9->addInt64($carry8);\n        $h8 = $h8->subInt64($carry8->shiftLeft(26));\n\n        $carry9 = $h9->addInt(1 << 24)->shiftRight(25);\n        $h0 = $h0->addInt64($carry9->mulInt(19, 5));\n        $h9 = $h9->subInt64($carry9->shiftLeft(25));\n\n        $carry0 = $h0->addInt(1 << 25)->shiftRight(26);\n        $h1 = $h1->addInt64($carry0);\n        $h0 = $h0->subInt64($carry0->shiftLeft(26));\n\n        return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(\n            array(\n                $h0->toInt32(),\n                $h1->toInt32(),\n                $h2->toInt32(),\n                $h3->toInt32(),\n                $h4->toInt32(),\n                $h5->toInt32(),\n                $h6->toInt32(),\n                $h7->toInt32(),\n                $h8->toInt32(),\n                $h9->toInt32()\n            )\n        );\n    }\n\n    /**\n     * Square and double a field element\n     *\n     * h = 2 * f * f\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f\n     * @return ParagonIE_Sodium_Core32_Curve25519_Fe\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedMethodCall\n     */\n    public static function fe_sq2(ParagonIE_Sodium_Core32_Curve25519_Fe $f)\n    {\n        /** @var ParagonIE_Sodium_Core32_Int64 $f0 */\n        $f0 = $f[0]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f1 */\n        $f1 = $f[1]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f2 */\n        $f2 = $f[2]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f3 */\n        $f3 = $f[3]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f4 */\n        $f4 = $f[4]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f5 */\n        $f5 = $f[5]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f6 */\n        $f6 = $f[6]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f7 */\n        $f7 = $f[7]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f8 */\n        $f8 = $f[8]->toInt64();\n        /** @var ParagonIE_Sodium_Core32_Int64 $f9 */\n        $f9 = $f[9]->toInt64();\n\n        $f0_2 = $f0->shiftLeft(1);\n        $f1_2 = $f1->shiftLeft(1);\n        $f2_2 = $f2->shiftLeft(1);\n        $f3_2 = $f3->shiftLeft(1);\n        $f4_2 = $f4->shiftLeft(1);\n        $f5_2 = $f5->shiftLeft(1);\n        $f6_2 = $f6->shiftLeft(1);\n        $f7_2 = $f7->shiftLeft(1);\n        $f5_38 = $f5->mulInt(38, 6); /* 1.959375*2^30 */\n        $f6_19 = $f6->mulInt(19, 5); /* 1.959375*2^30 */\n        $f7_38 = $f7->mulInt(38, 6); /* 1.959375*2^30 */\n        $f8_19 = $f8->mulInt(19, 5); /* 1.959375*2^30 */\n        $f9_38 = $f9->mulInt(38, 6); /* 1.959375*2^30 */\n        $f0f0 = $f0->mulInt64($f0, 28);\n        $f0f1_2 = $f0_2->mulInt64($f1, 28);\n        $f0f2_2 = $f0_2->mulInt64($f2, 28);\n        $f0f3_2 = $f0_2->mulInt64($f3, 28);\n        $f0f4_2 = $f0_2->mulInt64($f4, 28);\n        $f0f5_2 = $f0_2->mulInt64($f5, 28);\n        $f0f6_2 = $f0_2->mulInt64($f6, 28);\n        $f0f7_2 = $f0_2->mulInt64($f7, 28);\n        $f0f8_2 = $f0_2->mulInt64($f8, 28);\n        $f0f9_2 = $f0_2->mulInt64($f9, 28);\n        $f1f1_2 = $f1_2->mulInt64($f1, 28);\n        $f1f2_2 = $f1_2->mulInt64($f2, 28);\n        $f1f3_4 = $f1_2->mulInt64($f3_2, 29);\n        $f1f4_2 = $f1_2->mulInt64($f4, 28);\n        $f1f5_4 = $f1_2->mulInt64($f5_2, 29);\n        $f1f6_2 = $f1_2->mulInt64($f6, 28);\n        $f1f7_4 = $f1_2->mulInt64($f7_2, 29);\n        $f1f8_2 = $f1_2->mulInt64($f8, 28);\n        $f1f9_76 = $f9_38->mulInt64($f1_2, 29);\n        $f2f2 = $f2->mulInt64($f2, 28);\n        $f2f3_2 = $f2_2->mulInt64($f3, 28);\n        $f2f4_2 = $f2_2->mulInt64($f4, 28);\n        $f2f5_2 = $f2_2->mulInt64($f5, 28);\n        $f2f6_2 = $f2_2->mulInt64($f6, 28);\n        $f2f7_2 = $f2_2->mulInt64($f7, 28);\n        $f2f8_38 = $f8_19->mulInt64($f2_2, 29);\n        $f2f9_38 = $f9_38->mulInt64($f2, 29);\n        $f3f3_2 = $f3_2->mulInt64($f3, 28);\n        $f3f4_2 = $f3_2->mulInt64($f4, 28);\n        $f3f5_4 = $f3_2->mulInt64($f5_2, 28);\n        $f3f6_2 = $f3_2->mulInt64($f6, 28);\n        $f3f7_76 = $f7_38->mulInt64($f3_2, 29);\n        $f3f8_38 = $f8_19->mulInt64($f3_2, 29);\n        $f3f9_76 = $f9_38->mulInt64($f3_2, 29);\n        $f4f4 = $f4->mulInt64($f4, 28);\n        $f4f5_2 = $f4_2->mulInt64($f5, 28);\n        $f4f6_38 = $f6_19->mulInt64($f4_2, 29);\n        $f4f7_38 = $f7_38->mulInt64($f4, 29);\n        $f4f8_38 = $f8_19->mulInt64($f4_2, 29);\n        $f4f9_38 = $f9_38->mulInt64($f4, 29);\n        $f5f5_38 = $f5_38->mulInt64($f5, 29);\n        $f5f6_38 = $f6_19->mulInt64($f5_2, 29);\n        $f5f7_76 = $f7_38->mulInt64($f5_2, 29);\n        $f5f8_38 = $f8_19->mulInt64($f5_2, 29);\n        $f5f9_76 = $f9_38->mulInt64($f5_2, 29);\n        $f6f6_19 = $f6_19->mulInt64($f6, 29);\n        $f6f7_38 = $f7_38->mulInt64($f6, 29);\n        $f6f8_38 = $f8_19->mulInt64($f6_2, 29);\n        $f6f9_38 = $f9_38->mulInt64($f6, 29);\n        $f7f7_38 = $f7_38->mulInt64($f7, 29);\n        $f7f8_38 = $f8_19->mulInt64($f7_2, 29);\n        $f7f9_76 = $f9_38->mulInt64($f7_2, 29);\n        $f8f8_19 = $f8_19->mulInt64($f8, 29);\n        $f8f9_38 = $f9_38->mulInt64($f8, 29);\n        $f9f9_38 = $f9_38->mulInt64($f9, 29);\n\n        $h0 = $f0f0->addInt64($f1f9_76)->addInt64($f2f8_38)->addInt64($f3f7_76)->addInt64($f4f6_38)->addInt64($f5f5_38);\n        $h1 = $f0f1_2->addInt64($f2f9_38)->addInt64($f3f8_38)->addInt64($f4f7_38)->addInt64($f5f6_38);\n        $h2 = $f0f2_2->addInt64($f1f1_2)->addInt64($f3f9_76)->addInt64($f4f8_38)->addInt64($f5f7_76)->addInt64($f6f6_19);\n        $h3 = $f0f3_2->addInt64($f1f2_2)->addInt64($f4f9_38)->addInt64($f5f8_38)->addInt64($f6f7_38);\n        $h4 = $f0f4_2->addInt64($f1f3_4)->addInt64($f2f2)->addInt64($f5f9_76)->addInt64($f6f8_38)->addInt64($f7f7_38);\n        $h5 = $f0f5_2->addInt64($f1f4_2)->addInt64($f2f3_2)->addInt64($f6f9_38)->addInt64($f7f8_38);\n        $h6 = $f0f6_2->addInt64($f1f5_4)->addInt64($f2f4_2)->addInt64($f3f3_2)->addInt64($f7f9_76)->addInt64($f8f8_19);\n        $h7 = $f0f7_2->addInt64($f1f6_2)->addInt64($f2f5_2)->addInt64($f3f4_2)->addInt64($f8f9_38);\n        $h8 = $f0f8_2->addInt64($f1f7_4)->addInt64($f2f6_2)->addInt64($f3f5_4)->addInt64($f4f4)->addInt64($f9f9_38);\n        $h9 = $f0f9_2->addInt64($f1f8_2)->addInt64($f2f7_2)->addInt64($f3f6_2)->addInt64($f4f5_2);\n\n        /**\n         * @var ParagonIE_Sodium_Core32_Int64 $h0\n         * @var ParagonIE_Sodium_Core32_Int64 $h1\n         * @var ParagonIE_Sodium_Core32_Int64 $h2\n         * @var ParagonIE_Sodium_Core32_Int64 $h3\n         * @var ParagonIE_Sodium_Core32_Int64 $h4\n         * @var ParagonIE_Sodium_Core32_Int64 $h5\n         * @var ParagonIE_Sodium_Core32_Int64 $h6\n         * @var ParagonIE_Sodium_Core32_Int64 $h7\n         * @var ParagonIE_Sodium_Core32_Int64 $h8\n         * @var ParagonIE_Sodium_Core32_Int64 $h9\n         */\n        $h0 = $h0->shiftLeft(1);\n        $h1 = $h1->shiftLeft(1);\n        $h2 = $h2->shiftLeft(1);\n        $h3 = $h3->shiftLeft(1);\n        $h4 = $h4->shiftLeft(1);\n        $h5 = $h5->shiftLeft(1);\n        $h6 = $h6->shiftLeft(1);\n        $h7 = $h7->shiftLeft(1);\n        $h8 = $h8->shiftLeft(1);\n        $h9 = $h9->shiftLeft(1);\n\n        $carry0 = $h0->addInt(1 << 25)->shiftRight(26);\n        $h1 = $h1->addInt64($carry0);\n        $h0 = $h0->subInt64($carry0->shiftLeft(26));\n        $carry4 = $h4->addInt(1 << 25)->shiftRight(26);\n        $h5 = $h5->addInt64($carry4);\n        $h4 = $h4->subInt64($carry4->shiftLeft(26));\n\n        $carry1 = $h1->addInt(1 << 24)->shiftRight(25);\n        $h2 = $h2->addInt64($carry1);\n        $h1 = $h1->subInt64($carry1->shiftLeft(25));\n        $carry5 = $h5->addInt(1 << 24)->shiftRight(25);\n        $h6 = $h6->addInt64($carry5);\n        $h5 = $h5->subInt64($carry5->shiftLeft(25));\n\n        $carry2 = $h2->addInt(1 << 25)->shiftRight(26);\n        $h3 = $h3->addInt64($carry2);\n        $h2 = $h2->subInt64($carry2->shiftLeft(26));\n        $carry6 = $h6->addInt(1 << 25)->shiftRight(26);\n        $h7 = $h7->addInt64($carry6);\n        $h6 = $h6->subInt64($carry6->shiftLeft(26));\n\n        $carry3 = $h3->addInt(1 << 24)->shiftRight(25);\n        $h4 = $h4->addInt64($carry3);\n        $h3 = $h3->subInt64($carry3->shiftLeft(25));\n        $carry7 = $h7->addInt(1 << 24)->shiftRight(25);\n        $h8 = $h8->addInt64($carry7);\n        $h7 = $h7->subInt64($carry7->shiftLeft(25));\n\n        $carry4 = $h4->addInt(1 << 25)->shiftRight(26);\n        $h5 = $h5->addInt64($carry4);\n        $h4 = $h4->subInt64($carry4->shiftLeft(26));\n        $carry8 = $h8->addInt(1 << 25)->shiftRight(26);\n        $h9 = $h9->addInt64($carry8);\n        $h8 = $h8->subInt64($carry8->shiftLeft(26));\n\n        $carry9 = $h9->addInt(1 << 24)->shiftRight(25);\n        $h0 = $h0->addInt64($carry9->mulInt(19, 5));\n        $h9 = $h9->subInt64($carry9->shiftLeft(25));\n\n        $carry0 = $h0->addInt(1 << 25)->shiftRight(26);\n        $h1 = $h1->addInt64($carry0);\n        $h0 = $h0->subInt64($carry0->shiftLeft(26));\n\n        return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(\n            array(\n                $h0->toInt32(),\n                $h1->toInt32(),\n                $h2->toInt32(),\n                $h3->toInt32(),\n                $h4->toInt32(),\n                $h5->toInt32(),\n                $h6->toInt32(),\n                $h7->toInt32(),\n                $h8->toInt32(),\n                $h9->toInt32()\n            )\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $Z\n     * @return ParagonIE_Sodium_Core32_Curve25519_Fe\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fe_invert(ParagonIE_Sodium_Core32_Curve25519_Fe $Z)\n    {\n        $z = clone $Z;\n        $t0 = self::fe_sq($z);\n        $t1 = self::fe_sq($t0);\n        $t1 = self::fe_sq($t1);\n        $t1 = self::fe_mul($z, $t1);\n        $t0 = self::fe_mul($t0, $t1);\n        $t2 = self::fe_sq($t0);\n        $t1 = self::fe_mul($t1, $t2);\n        $t2 = self::fe_sq($t1);\n        for ($i = 1; $i < 5; ++$i) {\n            $t2 = self::fe_sq($t2);\n        }\n        $t1 = self::fe_mul($t2, $t1);\n        $t2 = self::fe_sq($t1);\n        for ($i = 1; $i < 10; ++$i) {\n            $t2 = self::fe_sq($t2);\n        }\n        $t2 = self::fe_mul($t2, $t1);\n        $t3 = self::fe_sq($t2);\n        for ($i = 1; $i < 20; ++$i) {\n            $t3 = self::fe_sq($t3);\n        }\n        $t2 = self::fe_mul($t3, $t2);\n        $t2 = self::fe_sq($t2);\n        for ($i = 1; $i < 10; ++$i) {\n            $t2 = self::fe_sq($t2);\n        }\n        $t1 = self::fe_mul($t2, $t1);\n        $t2 = self::fe_sq($t1);\n        for ($i = 1; $i < 50; ++$i) {\n            $t2 = self::fe_sq($t2);\n        }\n        $t2 = self::fe_mul($t2, $t1);\n        $t3 = self::fe_sq($t2);\n        for ($i = 1; $i < 100; ++$i) {\n            $t3 = self::fe_sq($t3);\n        }\n        $t2 = self::fe_mul($t3, $t2);\n        $t2 = self::fe_sq($t2);\n        for ($i = 1; $i < 50; ++$i) {\n            $t2 = self::fe_sq($t2);\n        }\n        $t1 = self::fe_mul($t2, $t1);\n        $t1 = self::fe_sq($t1);\n        for ($i = 1; $i < 5; ++$i) {\n            $t1 = self::fe_sq($t1);\n        }\n        return self::fe_mul($t1, $t0);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @ref https://github.com/jedisct1/libsodium/blob/68564326e1e9dc57ef03746f85734232d20ca6fb/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c#L1054-L1106\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $z\n     * @return ParagonIE_Sodium_Core32_Curve25519_Fe\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fe_pow22523(ParagonIE_Sodium_Core32_Curve25519_Fe $z)\n    {\n        # fe_sq(t0, z);\n        # fe_sq(t1, t0);\n        # fe_sq(t1, t1);\n        # fe_mul(t1, z, t1);\n        # fe_mul(t0, t0, t1);\n        # fe_sq(t0, t0);\n        # fe_mul(t0, t1, t0);\n        # fe_sq(t1, t0);\n        $t0 = self::fe_sq($z);\n        $t1 = self::fe_sq($t0);\n        $t1 = self::fe_sq($t1);\n        $t1 = self::fe_mul($z, $t1);\n        $t0 = self::fe_mul($t0, $t1);\n        $t0 = self::fe_sq($t0);\n        $t0 = self::fe_mul($t1, $t0);\n        $t1 = self::fe_sq($t0);\n\n        # for (i = 1; i < 5; ++i) {\n        #     fe_sq(t1, t1);\n        # }\n        for ($i = 1; $i < 5; ++$i) {\n            $t1 = self::fe_sq($t1);\n        }\n\n        # fe_mul(t0, t1, t0);\n        # fe_sq(t1, t0);\n        $t0 = self::fe_mul($t1, $t0);\n        $t1 = self::fe_sq($t0);\n\n        # for (i = 1; i < 10; ++i) {\n        #     fe_sq(t1, t1);\n        # }\n        for ($i = 1; $i < 10; ++$i) {\n            $t1 = self::fe_sq($t1);\n        }\n\n        # fe_mul(t1, t1, t0);\n        # fe_sq(t2, t1);\n        $t1 = self::fe_mul($t1, $t0);\n        $t2 = self::fe_sq($t1);\n\n        # for (i = 1; i < 20; ++i) {\n        #     fe_sq(t2, t2);\n        # }\n        for ($i = 1; $i < 20; ++$i) {\n            $t2 = self::fe_sq($t2);\n        }\n\n        # fe_mul(t1, t2, t1);\n        # fe_sq(t1, t1);\n        $t1 = self::fe_mul($t2, $t1);\n        $t1 = self::fe_sq($t1);\n\n        # for (i = 1; i < 10; ++i) {\n        #     fe_sq(t1, t1);\n        # }\n        for ($i = 1; $i < 10; ++$i) {\n            $t1 = self::fe_sq($t1);\n        }\n\n        # fe_mul(t0, t1, t0);\n        # fe_sq(t1, t0);\n        $t0 = self::fe_mul($t1, $t0);\n        $t1 = self::fe_sq($t0);\n\n        # for (i = 1; i < 50; ++i) {\n        #     fe_sq(t1, t1);\n        # }\n        for ($i = 1; $i < 50; ++$i) {\n            $t1 = self::fe_sq($t1);\n        }\n\n        # fe_mul(t1, t1, t0);\n        # fe_sq(t2, t1);\n        $t1 = self::fe_mul($t1, $t0);\n        $t2 = self::fe_sq($t1);\n\n        # for (i = 1; i < 100; ++i) {\n        #     fe_sq(t2, t2);\n        # }\n        for ($i = 1; $i < 100; ++$i) {\n            $t2 = self::fe_sq($t2);\n        }\n\n        # fe_mul(t1, t2, t1);\n        # fe_sq(t1, t1);\n        $t1 = self::fe_mul($t2, $t1);\n        $t1 = self::fe_sq($t1);\n\n        # for (i = 1; i < 50; ++i) {\n        #     fe_sq(t1, t1);\n        # }\n        for ($i = 1; $i < 50; ++$i) {\n            $t1 = self::fe_sq($t1);\n        }\n\n        # fe_mul(t0, t1, t0);\n        # fe_sq(t0, t0);\n        # fe_sq(t0, t0);\n        # fe_mul(out, t0, z);\n        $t0 = self::fe_mul($t1, $t0);\n        $t0 = self::fe_sq($t0);\n        $t0 = self::fe_sq($t0);\n        return self::fe_mul($t0, $z);\n    }\n\n    /**\n     * Subtract two field elements.\n     *\n     * h = f - g\n     *\n     * Preconditions:\n     * |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.\n     * |g| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.\n     *\n     * Postconditions:\n     * |h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $g\n     * @return ParagonIE_Sodium_Core32_Curve25519_Fe\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedMethodCall\n     * @psalm-suppress MixedTypeCoercion\n     */\n    public static function fe_sub(ParagonIE_Sodium_Core32_Curve25519_Fe $f, ParagonIE_Sodium_Core32_Curve25519_Fe $g)\n    {\n        return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(\n            array(\n                $f[0]->subInt32($g[0]),\n                $f[1]->subInt32($g[1]),\n                $f[2]->subInt32($g[2]),\n                $f[3]->subInt32($g[3]),\n                $f[4]->subInt32($g[4]),\n                $f[5]->subInt32($g[5]),\n                $f[6]->subInt32($g[6]),\n                $f[7]->subInt32($g[7]),\n                $f[8]->subInt32($g[8]),\n                $f[9]->subInt32($g[9])\n            )\n        );\n    }\n\n    /**\n     * Add two group elements.\n     *\n     * r = p + q\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Cached $q\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_add(\n        ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p,\n        ParagonIE_Sodium_Core32_Curve25519_Ge_Cached $q\n    ) {\n        $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1();\n        $r->X = self::fe_add($p->Y, $p->X);\n        $r->Y = self::fe_sub($p->Y, $p->X);\n        $r->Z = self::fe_mul($r->X, $q->YplusX);\n        $r->Y = self::fe_mul($r->Y, $q->YminusX);\n        $r->T = self::fe_mul($q->T2d, $p->T);\n        $r->X = self::fe_mul($p->Z, $q->Z);\n        $t0   = self::fe_add($r->X, $r->X);\n        $r->X = self::fe_sub($r->Z, $r->Y);\n        $r->Y = self::fe_add($r->Z, $r->Y);\n        $r->Z = self::fe_add($t0, $r->T);\n        $r->T = self::fe_sub($t0, $r->T);\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @ref https://github.com/jedisct1/libsodium/blob/157c4a80c13b117608aeae12178b2d38825f9f8f/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c#L1185-L1215\n     * @param string $a\n     * @return array<int, mixed>\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArrayOffset\n     */\n    public static function slide($a)\n    {\n        if (self::strlen($a) < 256) {\n            if (self::strlen($a) < 16) {\n                $a = str_pad($a, 256, '0', STR_PAD_RIGHT);\n            }\n        }\n        /** @var array<int, int> $r */\n        $r = array();\n        for ($i = 0; $i < 256; ++$i) {\n            $r[$i] = (int) (1 &\n                (\n                    self::chrToInt($a[$i >> 3])\n                        >>\n                    ($i & 7)\n                )\n            );\n        }\n\n        for ($i = 0;$i < 256;++$i) {\n            if ($r[$i]) {\n                for ($b = 1;$b <= 6 && $i + $b < 256;++$b) {\n                    if ($r[$i + $b]) {\n                        if ($r[$i] + ($r[$i + $b] << $b) <= 15) {\n                            $r[$i] += $r[$i + $b] << $b;\n                            $r[$i + $b] = 0;\n                        } elseif ($r[$i] - ($r[$i + $b] << $b) >= -15) {\n                            $r[$i] -= $r[$i + $b] << $b;\n                            for ($k = $i + $b; $k < 256; ++$k) {\n                                if (!$r[$k]) {\n                                    $r[$k] = 1;\n                                    break;\n                                }\n                                $r[$k] = 0;\n                            }\n                        } else {\n                            break;\n                        }\n                    }\n                }\n            }\n        }\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $s\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P3\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_frombytes_negate_vartime($s)\n    {\n        static $d = null;\n        if (!$d) {\n            /** @var ParagonIE_Sodium_Core32_Curve25519_Fe $d */\n            $d = ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(\n                array(\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[0]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[1]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[2]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[3]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[4]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[5]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[6]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[7]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[8]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[9])\n                )\n            );\n        }\n\n        # fe_frombytes(h->Y,s);\n        # fe_1(h->Z);\n        $h = new ParagonIE_Sodium_Core32_Curve25519_Ge_P3(\n            self::fe_0(),\n            self::fe_frombytes($s),\n            self::fe_1()\n        );\n\n        # fe_sq(u,h->Y);\n        # fe_mul(v,u,d);\n        # fe_sub(u,u,h->Z);       /* u = y^2-1 */\n        # fe_add(v,v,h->Z);       /* v = dy^2+1 */\n        $u = self::fe_sq($h->Y);\n        /** @var ParagonIE_Sodium_Core32_Curve25519_Fe $d */\n        $v = self::fe_mul($u, $d);\n        $u = self::fe_sub($u, $h->Z); /* u =  y^2 - 1 */\n        $v = self::fe_add($v, $h->Z); /* v = dy^2 + 1 */\n\n        # fe_sq(v3,v);\n        # fe_mul(v3,v3,v);        /* v3 = v^3 */\n        # fe_sq(h->X,v3);\n        # fe_mul(h->X,h->X,v);\n        # fe_mul(h->X,h->X,u);    /* x = uv^7 */\n        $v3 = self::fe_sq($v);\n        $v3 = self::fe_mul($v3, $v); /* v3 = v^3 */\n        $h->X = self::fe_sq($v3);\n        $h->X = self::fe_mul($h->X, $v);\n        $h->X = self::fe_mul($h->X, $u); /* x = uv^7 */\n\n        # fe_pow22523(h->X,h->X); /* x = (uv^7)^((q-5)/8) */\n        # fe_mul(h->X,h->X,v3);\n        # fe_mul(h->X,h->X,u);    /* x = uv^3(uv^7)^((q-5)/8) */\n        $h->X = self::fe_pow22523($h->X); /* x = (uv^7)^((q-5)/8) */\n        $h->X = self::fe_mul($h->X, $v3);\n        $h->X = self::fe_mul($h->X, $u); /* x = uv^3(uv^7)^((q-5)/8) */\n\n        # fe_sq(vxx,h->X);\n        # fe_mul(vxx,vxx,v);\n        # fe_sub(check,vxx,u);    /* vx^2-u */\n        $vxx = self::fe_sq($h->X);\n        $vxx = self::fe_mul($vxx, $v);\n        $check = self::fe_sub($vxx, $u); /* vx^2 - u */\n\n        # if (fe_isnonzero(check)) {\n        #     fe_add(check,vxx,u);  /* vx^2+u */\n        #     if (fe_isnonzero(check)) {\n        #         return -1;\n        #     }\n        #     fe_mul(h->X,h->X,sqrtm1);\n        # }\n        if (self::fe_isnonzero($check)) {\n            $check = self::fe_add($vxx, $u); /* vx^2 + u */\n            if (self::fe_isnonzero($check)) {\n                throw new RangeException('Internal check failed.');\n            }\n            $h->X = self::fe_mul(\n                $h->X,\n                ParagonIE_Sodium_Core32_Curve25519_Fe::fromIntArray(self::$sqrtm1)\n            );\n        }\n\n        # if (fe_isnegative(h->X) == (s[31] >> 7)) {\n        #     fe_neg(h->X,h->X);\n        # }\n        $i = self::chrToInt($s[31]);\n        if (self::fe_isnegative($h->X) === ($i >> 7)) {\n            $h->X = self::fe_neg($h->X);\n        }\n\n        # fe_mul(h->T,h->X,h->Y);\n        $h->T = self::fe_mul($h->X, $h->Y);\n        return $h;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $R\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $q\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_madd(\n        ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $R,\n        ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p,\n        ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $q\n    ) {\n        $r = clone $R;\n        $r->X = self::fe_add($p->Y, $p->X);\n        $r->Y = self::fe_sub($p->Y, $p->X);\n        $r->Z = self::fe_mul($r->X, $q->yplusx);\n        $r->Y = self::fe_mul($r->Y, $q->yminusx);\n        $r->T = self::fe_mul($q->xy2d, $p->T);\n        $t0 = self::fe_add(clone $p->Z, clone $p->Z);\n        $r->X = self::fe_sub($r->Z, $r->Y);\n        $r->Y = self::fe_add($r->Z, $r->Y);\n        $r->Z = self::fe_add($t0, $r->T);\n        $r->T = self::fe_sub($t0, $r->T);\n\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $R\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $q\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_msub(\n        ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $R,\n        ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p,\n        ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $q\n    ) {\n        $r = clone $R;\n\n        $r->X = self::fe_add($p->Y, $p->X);\n        $r->Y = self::fe_sub($p->Y, $p->X);\n        $r->Z = self::fe_mul($r->X, $q->yminusx);\n        $r->Y = self::fe_mul($r->Y, $q->yplusx);\n        $r->T = self::fe_mul($q->xy2d, $p->T);\n        $t0 = self::fe_add($p->Z, $p->Z);\n        $r->X = self::fe_sub($r->Z, $r->Y);\n        $r->Y = self::fe_add($r->Z, $r->Y);\n        $r->Z = self::fe_sub($t0, $r->T);\n        $r->T = self::fe_add($t0, $r->T);\n\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $p\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P2\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_p1p1_to_p2(ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $p)\n    {\n        $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P2();\n        $r->X = self::fe_mul($p->X, $p->T);\n        $r->Y = self::fe_mul($p->Y, $p->Z);\n        $r->Z = self::fe_mul($p->Z, $p->T);\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $p\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P3\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_p1p1_to_p3(ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $p)\n    {\n        $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P3();\n        $r->X = self::fe_mul($p->X, $p->T);\n        $r->Y = self::fe_mul($p->Y, $p->Z);\n        $r->Z = self::fe_mul($p->Z, $p->T);\n        $r->T = self::fe_mul($p->X, $p->Y);\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P2\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_p2_0()\n    {\n        return new ParagonIE_Sodium_Core32_Curve25519_Ge_P2(\n            self::fe_0(),\n            self::fe_1(),\n            self::fe_1()\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $p\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_p2_dbl(ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $p)\n    {\n        $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1();\n\n        $r->X = self::fe_sq($p->X);\n        $r->Z = self::fe_sq($p->Y);\n        $r->T = self::fe_sq2($p->Z);\n        $r->Y = self::fe_add($p->X, $p->Y);\n        $t0   = self::fe_sq($r->Y);\n        $r->Y = self::fe_add($r->Z, $r->X);\n        $r->Z = self::fe_sub($r->Z, $r->X);\n        $r->X = self::fe_sub($t0, $r->Y);\n        $r->T = self::fe_sub($r->T, $r->Z);\n\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P3\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_p3_0()\n    {\n        return new ParagonIE_Sodium_Core32_Curve25519_Ge_P3(\n            self::fe_0(),\n            self::fe_1(),\n            self::fe_1(),\n            self::fe_0()\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_Cached\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_p3_to_cached(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p)\n    {\n        static $d2 = null;\n        if ($d2 === null) {\n            $d2 = ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(\n                array(\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[0]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[1]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[2]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[3]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[4]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[5]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[6]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[7]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[8]),\n                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[9])\n                )\n            );\n        }\n        /** @var ParagonIE_Sodium_Core32_Curve25519_Fe $d2 */\n        $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_Cached();\n        $r->YplusX = self::fe_add($p->Y, $p->X);\n        $r->YminusX = self::fe_sub($p->Y, $p->X);\n        $r->Z = self::fe_copy($p->Z);\n        $r->T2d = self::fe_mul($p->T, $d2);\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P2\n     */\n    public static function ge_p3_to_p2(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p)\n    {\n        return new ParagonIE_Sodium_Core32_Curve25519_Ge_P2(\n            $p->X,\n            $p->Y,\n            $p->Z\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $h\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_p3_tobytes(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $h)\n    {\n        $recip = self::fe_invert($h->Z);\n        $x = self::fe_mul($h->X, $recip);\n        $y = self::fe_mul($h->Y, $recip);\n        $s = self::fe_tobytes($y);\n        $s[31] = self::intToChr(\n            self::chrToInt($s[31]) ^ (self::fe_isnegative($x) << 7)\n        );\n        return $s;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_p3_dbl(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p)\n    {\n        $q = self::ge_p3_to_p2($p);\n        return self::ge_p2_dbl($q);\n    }\n\n    /**\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_precomp_0()\n    {\n        return new ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp(\n            self::fe_1(),\n            self::fe_1(),\n            self::fe_0()\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $b\n     * @param int $c\n     * @return int\n     * @psalm-suppress MixedReturnStatement\n     */\n    public static function equal($b, $c)\n    {\n        return (int) ((($b ^ $c) - 1 & 0xffffffff) >> 31);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string|int $char\n     * @return int (1 = yes, 0 = no)\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function negative($char)\n    {\n        if (is_int($char)) {\n            return $char < 0 ? 1 : 0;\n        }\n        /** @var string $char */\n        /** @var int $x */\n        $x = self::chrToInt(self::substr($char, 0, 1));\n        return (int) ($x >> 31);\n    }\n\n    /**\n     * Conditional move\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $t\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $u\n     * @param int $b\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function cmov(\n        ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $t,\n        ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $u,\n        $b\n    ) {\n        if (!is_int($b)) {\n            throw new InvalidArgumentException('Expected an integer.');\n        }\n        return new ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp(\n            self::fe_cmov($t->yplusx, $u->yplusx, $b),\n            self::fe_cmov($t->yminusx, $u->yminusx, $b),\n            self::fe_cmov($t->xy2d, $u->xy2d, $b)\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $pos\n     * @param int $b\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArrayAccess\n     * @psalm-suppress MixedArrayOffset\n     * @psalm-suppress MixedArgument\n     */\n    public static function ge_select($pos = 0, $b = 0)\n    {\n        static $base = null;\n        if ($base === null) {\n            $base = array();\n            foreach (self::$base as $i => $bas) {\n                for ($j = 0; $j < 8; ++$j) {\n                    $base[$i][$j] = new ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp(\n                        ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(\n                            array(\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][0]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][1]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][2]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][3]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][4]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][5]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][6]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][7]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][8]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][9])\n                            )\n                        ),\n                        ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(\n                            array(\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][0]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][1]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][2]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][3]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][4]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][5]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][6]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][7]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][8]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][9])\n                            )\n                        ),\n                        ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(\n                            array(\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][0]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][1]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][2]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][3]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][4]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][5]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][6]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][7]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][8]),\n                                ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][9])\n                            )\n                        )\n                    );\n                }\n            }\n        }\n        if (!is_int($pos)) {\n            throw new InvalidArgumentException('Position must be an integer');\n        }\n        if ($pos < 0 || $pos > 31) {\n            throw new RangeException('Position is out of range [0, 31]');\n        }\n\n        $bnegative = self::negative($b);\n        /** @var int $babs */\n        $babs = $b - (((-$bnegative) & $b) << 1);\n\n        $t = self::ge_precomp_0();\n        for ($i = 0; $i < 8; ++$i) {\n            $t = self::cmov(\n                $t,\n                $base[$pos][$i],\n                self::equal($babs, $i + 1)\n            );\n        }\n        $minusT = new ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp(\n            self::fe_copy($t->yminusx),\n            self::fe_copy($t->yplusx),\n            self::fe_neg($t->xy2d)\n        );\n        return self::cmov($t, $minusT, -$bnegative);\n    }\n\n    /**\n     * Subtract two group elements.\n     *\n     * r = p - q\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Cached $q\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_sub(\n        ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p,\n        ParagonIE_Sodium_Core32_Curve25519_Ge_Cached $q\n    ) {\n        $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1();\n\n        $r->X = self::fe_add($p->Y, $p->X);\n        $r->Y = self::fe_sub($p->Y, $p->X);\n        $r->Z = self::fe_mul($r->X, $q->YminusX);\n        $r->Y = self::fe_mul($r->Y, $q->YplusX);\n        $r->T = self::fe_mul($q->T2d, $p->T);\n        $r->X = self::fe_mul($p->Z, $q->Z);\n        $t0 = self::fe_add($r->X, $r->X);\n        $r->X = self::fe_sub($r->Z, $r->Y);\n        $r->Y = self::fe_add($r->Z, $r->Y);\n        $r->Z = self::fe_sub($t0, $r->T);\n        $r->T = self::fe_add($t0, $r->T);\n\n        return $r;\n    }\n\n    /**\n     * Convert a group element to a byte string.\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $h\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_tobytes(ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $h)\n    {\n        $recip = self::fe_invert($h->Z);\n        $x = self::fe_mul($h->X, $recip);\n        $y = self::fe_mul($h->Y, $recip);\n        $s = self::fe_tobytes($y);\n        $s[31] = self::intToChr(\n            self::chrToInt($s[31]) ^ (self::fe_isnegative($x) << 7)\n        );\n        return $s;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $a\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A\n     * @param string $b\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P2\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArrayAccess\n     */\n    public static function ge_double_scalarmult_vartime(\n        $a,\n        ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A,\n        $b\n    ) {\n        /** @var array<int, ParagonIE_Sodium_Core32_Curve25519_Ge_Cached> $Ai */\n        $Ai = array();\n\n        static $Bi = array();\n        /** @var array<int, ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp> $Bi */\n        if (!$Bi) {\n            for ($i = 0; $i < 8; ++$i) {\n                $Bi[$i] = new ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp(\n                    ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(\n                        array(\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][0]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][1]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][2]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][3]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][4]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][5]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][6]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][7]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][8]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][9])\n                        )\n                    ),\n                    ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(\n                        array(\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][0]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][1]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][2]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][3]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][4]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][5]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][6]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][7]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][8]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][9])\n                        )\n                    ),\n                    ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(\n                        array(\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][0]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][1]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][2]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][3]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][4]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][5]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][6]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][7]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][8]),\n                            ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][9])\n                        )\n                    )\n                );\n            }\n        }\n\n        for ($i = 0; $i < 8; ++$i) {\n            $Ai[$i] = new ParagonIE_Sodium_Core32_Curve25519_Ge_Cached(\n                self::fe_0(),\n                self::fe_0(),\n                self::fe_0(),\n                self::fe_0()\n            );\n        }\n        /** @var array<int, ParagonIE_Sodium_Core32_Curve25519_Ge_Cached> $Ai */\n\n        # slide(aslide,a);\n        # slide(bslide,b);\n        /** @var array<int, int> $aslide */\n        $aslide = self::slide($a);\n        /** @var array<int, int> $bslide */\n        $bslide = self::slide($b);\n\n        # ge_p3_to_cached(&Ai[0],A);\n        # ge_p3_dbl(&t,A); ge_p1p1_to_p3(&A2,&t);\n        $Ai[0] = self::ge_p3_to_cached($A);\n        $t = self::ge_p3_dbl($A);\n        $A2 = self::ge_p1p1_to_p3($t);\n\n        # ge_add(&t,&A2,&Ai[0]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[1],&u);\n        # ge_add(&t,&A2,&Ai[1]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[2],&u);\n        # ge_add(&t,&A2,&Ai[2]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[3],&u);\n        # ge_add(&t,&A2,&Ai[3]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[4],&u);\n        # ge_add(&t,&A2,&Ai[4]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[5],&u);\n        # ge_add(&t,&A2,&Ai[5]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[6],&u);\n        # ge_add(&t,&A2,&Ai[6]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[7],&u);\n        for ($i = 0; $i < 7; ++$i) {\n            $t = self::ge_add($A2, $Ai[$i]);\n            $u = self::ge_p1p1_to_p3($t);\n            $Ai[$i + 1] = self::ge_p3_to_cached($u);\n        }\n\n        # ge_p2_0(r);\n        $r = self::ge_p2_0();\n\n        # for (i = 255;i >= 0;--i) {\n        #     if (aslide[i] || bslide[i]) break;\n        # }\n        $i = 255;\n        for (; $i >= 0; --$i) {\n            if ($aslide[$i] || $bslide[$i]) {\n                break;\n            }\n        }\n\n        # for (;i >= 0;--i) {\n        for (; $i >= 0; --$i) {\n            # ge_p2_dbl(&t,r);\n            $t = self::ge_p2_dbl($r);\n\n            # if (aslide[i] > 0) {\n            if ($aslide[$i] > 0) {\n                # ge_p1p1_to_p3(&u,&t);\n                # ge_add(&t,&u,&Ai[aslide[i]/2]);\n                $u = self::ge_p1p1_to_p3($t);\n                $t = self::ge_add(\n                    $u,\n                    $Ai[(int) floor($aslide[$i] / 2)]\n                );\n                # } else if (aslide[i] < 0) {\n            } elseif ($aslide[$i] < 0) {\n                # ge_p1p1_to_p3(&u,&t);\n                # ge_sub(&t,&u,&Ai[(-aslide[i])/2]);\n                $u = self::ge_p1p1_to_p3($t);\n                $t = self::ge_sub(\n                    $u,\n                    $Ai[(int) floor(-$aslide[$i] / 2)]\n                );\n            }\n            /** @var array<int, ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp> $Bi */\n\n            # if (bslide[i] > 0) {\n            if ($bslide[$i] > 0) {\n                # ge_p1p1_to_p3(&u,&t);\n                # ge_madd(&t,&u,&Bi[bslide[i]/2]);\n                $u = self::ge_p1p1_to_p3($t);\n                /** @var int $index */\n                $index = (int) floor($bslide[$i] / 2);\n                /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $thisB */\n                $thisB = $Bi[$index];\n                $t = self::ge_madd($t, $u, $thisB);\n                # } else if (bslide[i] < 0) {\n            } elseif ($bslide[$i] < 0) {\n                # ge_p1p1_to_p3(&u,&t);\n                # ge_msub(&t,&u,&Bi[(-bslide[i])/2]);\n                $u = self::ge_p1p1_to_p3($t);\n\n                /** @var int $index */\n                $index = (int) floor(-$bslide[$i] / 2);\n\n                /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $thisB */\n                $thisB = $Bi[$index];\n                $t = self::ge_msub($t, $u, $thisB);\n            }\n            # ge_p1p1_to_p2(r,&t);\n            $r = self::ge_p1p1_to_p2($t);\n        }\n        return $r;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $a\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P3\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedOperand\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_scalarmult_base($a)\n    {\n        /** @var array<int, int> $e */\n        $e = array();\n        $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1();\n\n        for ($i = 0; $i < 32; ++$i) {\n            /** @var int $dbl */\n            $dbl = (int) $i << 1;\n            $e[$dbl] = (int) self::chrToInt($a[$i]) & 15;\n            $e[$dbl + 1] = (int) (self::chrToInt($a[$i]) >> 4) & 15;\n        }\n\n        /** @var int $carry */\n        $carry = 0;\n        for ($i = 0; $i < 63; ++$i) {\n            $e[$i] += $carry;\n            /** @var int $carry */\n            $carry = $e[$i] + 8;\n            /** @var int $carry */\n            $carry >>= 4;\n            $e[$i] -= $carry << 4;\n        }\n\n        /** @var array<int, int> $e */\n        $e[63] += (int) $carry;\n\n        $h = self::ge_p3_0();\n\n        for ($i = 1; $i < 64; $i += 2) {\n            $t = self::ge_select((int) floor($i / 2), (int) $e[$i]);\n            $r = self::ge_madd($r, $h, $t);\n            $h = self::ge_p1p1_to_p3($r);\n        }\n\n        $r = self::ge_p3_dbl($h);\n\n        $s = self::ge_p1p1_to_p2($r);\n        $r = self::ge_p2_dbl($s);\n        $s = self::ge_p1p1_to_p2($r);\n        $r = self::ge_p2_dbl($s);\n        $s = self::ge_p1p1_to_p2($r);\n        $r = self::ge_p2_dbl($s);\n\n        $h = self::ge_p1p1_to_p3($r);\n\n        for ($i = 0; $i < 64; $i += 2) {\n            $t = self::ge_select($i >> 1, (int) $e[$i]);\n            $r = self::ge_madd($r, $h, $t);\n            $h = self::ge_p1p1_to_p3($r);\n        }\n        return $h;\n    }\n\n    /**\n     * Calculates (ab + c) mod l\n     * where l = 2^252 + 27742317777372353535851937790883648493\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $a\n     * @param string $b\n     * @param string $c\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sc_muladd($a, $b, $c)\n    {\n        $a0 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($a, 0, 3)));\n        $a1 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($a, 2, 4)) >> 5));\n        $a2 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($a, 5, 3)) >> 2));\n        $a3 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($a, 7, 4)) >> 7));\n        $a4 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($a, 10, 4)) >> 4));\n        $a5 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($a, 13, 3)) >> 1));\n        $a6 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($a, 15, 4)) >> 6));\n        $a7 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($a, 18, 3)) >> 3));\n        $a8 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($a, 21, 3)));\n        $a9 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($a, 23, 4)) >> 5));\n        $a10 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($a, 26, 3)) >> 2));\n        $a11 = ParagonIE_Sodium_Core32_Int64::fromInt(0x1fffffff & (self::load_4(self::substr($a, 28, 4)) >> 7));\n        $b0 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($b, 0, 3)));\n        $b1 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($b, 2, 4)) >> 5));\n        $b2 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($b, 5, 3)) >> 2));\n        $b3 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($b, 7, 4)) >> 7));\n        $b4 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($b, 10, 4)) >> 4));\n        $b5 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($b, 13, 3)) >> 1));\n        $b6 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($b, 15, 4)) >> 6));\n        $b7 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($b, 18, 3)) >> 3));\n        $b8 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($b, 21, 3)));\n        $b9 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($b, 23, 4)) >> 5));\n        $b10 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($b, 26, 3)) >> 2));\n        $b11 = ParagonIE_Sodium_Core32_Int64::fromInt(0x1fffffff & (self::load_4(self::substr($b, 28, 4)) >> 7));\n        $c0 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($c, 0, 3)));\n        $c1 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($c, 2, 4)) >> 5));\n        $c2 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($c, 5, 3)) >> 2));\n        $c3 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($c, 7, 4)) >> 7));\n        $c4 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($c, 10, 4)) >> 4));\n        $c5 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($c, 13, 3)) >> 1));\n        $c6 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($c, 15, 4)) >> 6));\n        $c7 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($c, 18, 3)) >> 3));\n        $c8 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($c, 21, 3)));\n        $c9 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($c, 23, 4)) >> 5));\n        $c10 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($c, 26, 3)) >> 2));\n        $c11 = ParagonIE_Sodium_Core32_Int64::fromInt(0x1fffffff & (self::load_4(self::substr($c, 28, 4)) >> 7));\n\n        /* Can't really avoid the pyramid here: */\n        /**\n         * @var ParagonIE_Sodium_Core32_Int64 $s0\n         * @var ParagonIE_Sodium_Core32_Int64 $s1\n         * @var ParagonIE_Sodium_Core32_Int64 $s2\n         * @var ParagonIE_Sodium_Core32_Int64 $s3\n         * @var ParagonIE_Sodium_Core32_Int64 $s4\n         * @var ParagonIE_Sodium_Core32_Int64 $s5\n         * @var ParagonIE_Sodium_Core32_Int64 $s6\n         * @var ParagonIE_Sodium_Core32_Int64 $s7\n         * @var ParagonIE_Sodium_Core32_Int64 $s8\n         * @var ParagonIE_Sodium_Core32_Int64 $s9\n         * @var ParagonIE_Sodium_Core32_Int64 $s10\n         * @var ParagonIE_Sodium_Core32_Int64 $s11\n         * @var ParagonIE_Sodium_Core32_Int64 $s12\n         * @var ParagonIE_Sodium_Core32_Int64 $s13\n         * @var ParagonIE_Sodium_Core32_Int64 $s14\n         * @var ParagonIE_Sodium_Core32_Int64 $s15\n         * @var ParagonIE_Sodium_Core32_Int64 $s16\n         * @var ParagonIE_Sodium_Core32_Int64 $s17\n         * @var ParagonIE_Sodium_Core32_Int64 $s18\n         * @var ParagonIE_Sodium_Core32_Int64 $s19\n         * @var ParagonIE_Sodium_Core32_Int64 $s20\n         * @var ParagonIE_Sodium_Core32_Int64 $s21\n         * @var ParagonIE_Sodium_Core32_Int64 $s22\n         * @var ParagonIE_Sodium_Core32_Int64 $s23\n         */\n\n        $s0 = $c0->addInt64($a0->mulInt64($b0, 24));\n        $s1 = $c1->addInt64($a0->mulInt64($b1, 24))->addInt64($a1->mulInt64($b0, 24));\n        $s2 = $c2->addInt64($a0->mulInt64($b2, 24))->addInt64($a1->mulInt64($b1, 24))->addInt64($a2->mulInt64($b0, 24));\n        $s3 = $c3->addInt64($a0->mulInt64($b3, 24))->addInt64($a1->mulInt64($b2, 24))->addInt64($a2->mulInt64($b1, 24))\n                 ->addInt64($a3->mulInt64($b0, 24));\n        $s4 = $c4->addInt64($a0->mulInt64($b4, 24))->addInt64($a1->mulInt64($b3, 24))->addInt64($a2->mulInt64($b2, 24))\n                 ->addInt64($a3->mulInt64($b1, 24))->addInt64($a4->mulInt64($b0, 24));\n        $s5 = $c5->addInt64($a0->mulInt64($b5, 24))->addInt64($a1->mulInt64($b4, 24))->addInt64($a2->mulInt64($b3, 24))\n                 ->addInt64($a3->mulInt64($b2, 24))->addInt64($a4->mulInt64($b1, 24))->addInt64($a5->mulInt64($b0, 24));\n        $s6 = $c6->addInt64($a0->mulInt64($b6, 24))->addInt64($a1->mulInt64($b5, 24))->addInt64($a2->mulInt64($b4, 24))\n                 ->addInt64($a3->mulInt64($b3, 24))->addInt64($a4->mulInt64($b2, 24))->addInt64($a5->mulInt64($b1, 24))\n                 ->addInt64($a6->mulInt64($b0, 24));\n        $s7 = $c7->addInt64($a0->mulInt64($b7, 24))->addInt64($a1->mulInt64($b6, 24))->addInt64($a2->mulInt64($b5, 24))\n                 ->addInt64($a3->mulInt64($b4, 24))->addInt64($a4->mulInt64($b3, 24))->addInt64($a5->mulInt64($b2, 24))\n                 ->addInt64($a6->mulInt64($b1, 24))->addInt64($a7->mulInt64($b0, 24));\n        $s8 = $c8->addInt64($a0->mulInt64($b8, 24))->addInt64($a1->mulInt64($b7, 24))->addInt64($a2->mulInt64($b6, 24))\n                 ->addInt64($a3->mulInt64($b5, 24))->addInt64($a4->mulInt64($b4, 24))->addInt64($a5->mulInt64($b3, 24))\n                 ->addInt64($a6->mulInt64($b2, 24))->addInt64($a7->mulInt64($b1, 24))->addInt64($a8->mulInt64($b0, 24));\n        $s9 = $c9->addInt64($a0->mulInt64($b9, 24))->addInt64($a1->mulInt64($b8, 24))->addInt64($a2->mulInt64($b7, 24))\n                 ->addInt64($a3->mulInt64($b6, 24))->addInt64($a4->mulInt64($b5, 24))->addInt64($a5->mulInt64($b4, 24))\n                 ->addInt64($a6->mulInt64($b3, 24))->addInt64($a7->mulInt64($b2, 24))->addInt64($a8->mulInt64($b1, 24))\n                 ->addInt64($a9->mulInt64($b0, 24));\n        $s10 = $c10->addInt64($a0->mulInt64($b10, 24))->addInt64($a1->mulInt64($b9, 24))->addInt64($a2->mulInt64($b8, 24))\n                   ->addInt64($a3->mulInt64($b7, 24))->addInt64($a4->mulInt64($b6, 24))->addInt64($a5->mulInt64($b5, 24))\n                   ->addInt64($a6->mulInt64($b4, 24))->addInt64($a7->mulInt64($b3, 24))->addInt64($a8->mulInt64($b2, 24))\n                   ->addInt64($a9->mulInt64($b1, 24))->addInt64($a10->mulInt64($b0, 24));\n        $s11 = $c11->addInt64($a0->mulInt64($b11, 24))->addInt64($a1->mulInt64($b10, 24))->addInt64($a2->mulInt64($b9, 24))\n                   ->addInt64($a3->mulInt64($b8, 24))->addInt64($a4->mulInt64($b7, 24))->addInt64($a5->mulInt64($b6, 24))\n                   ->addInt64($a6->mulInt64($b5, 24))->addInt64($a7->mulInt64($b4, 24))->addInt64($a8->mulInt64($b3, 24))\n                   ->addInt64($a9->mulInt64($b2, 24))->addInt64($a10->mulInt64($b1, 24))->addInt64($a11->mulInt64($b0, 24));\n        $s12 = $a1->mulInt64($b11, 24)->addInt64($a2->mulInt64($b10, 24))->addInt64($a3->mulInt64($b9, 24))\n                  ->addInt64($a4->mulInt64($b8, 24))->addInt64($a5->mulInt64($b7, 24))->addInt64($a6->mulInt64($b6, 24))\n                  ->addInt64($a7->mulInt64($b5, 24))->addInt64($a8->mulInt64($b4, 24))->addInt64($a9->mulInt64($b3, 24))\n                  ->addInt64($a10->mulInt64($b2, 24))->addInt64($a11->mulInt64($b1, 24));\n        $s13 = $a2->mulInt64($b11, 24)->addInt64($a3->mulInt64($b10, 24))->addInt64($a4->mulInt64($b9, 24))\n                  ->addInt64($a5->mulInt64($b8, 24))->addInt64($a6->mulInt64($b7, 24))->addInt64($a7->mulInt64($b6, 24))\n                  ->addInt64($a8->mulInt64($b5, 24))->addInt64($a9->mulInt64($b4, 24))->addInt64($a10->mulInt64($b3, 24))\n                  ->addInt64($a11->mulInt64($b2, 24));\n        $s14 = $a3->mulInt64($b11, 24)->addInt64($a4->mulInt64($b10, 24))->addInt64($a5->mulInt64($b9, 24))\n                  ->addInt64($a6->mulInt64($b8, 24))->addInt64($a7->mulInt64($b7, 24))->addInt64($a8->mulInt64($b6, 24))\n                  ->addInt64($a9->mulInt64($b5, 24))->addInt64($a10->mulInt64($b4, 24))->addInt64($a11->mulInt64($b3, 24));\n        $s15 = $a4->mulInt64($b11, 24)->addInt64($a5->mulInt64($b10, 24))->addInt64($a6->mulInt64($b9, 24))\n                  ->addInt64($a7->mulInt64($b8, 24))->addInt64($a8->mulInt64($b7, 24))->addInt64($a9->mulInt64($b6, 24))\n                  ->addInt64($a10->mulInt64($b5, 24))->addInt64($a11->mulInt64($b4, 24));\n        $s16 = $a5->mulInt64($b11, 24)->addInt64($a6->mulInt64($b10, 24))->addInt64($a7->mulInt64($b9, 24))\n                  ->addInt64($a8->mulInt64($b8, 24))->addInt64($a9->mulInt64($b7, 24))->addInt64($a10->mulInt64($b6, 24))\n                  ->addInt64($a11->mulInt64($b5, 24));\n        $s17 = $a6->mulInt64($b11, 24)->addInt64($a7->mulInt64($b10, 24))->addInt64($a8->mulInt64($b9, 24))\n                  ->addInt64($a9->mulInt64($b8, 24))->addInt64($a10->mulInt64($b7, 24))->addInt64($a11->mulInt64($b6, 24));\n        $s18 = $a7->mulInt64($b11, 24)->addInt64($a8->mulInt64($b10, 24))->addInt64($a9->mulInt64($b9, 24))\n                  ->addInt64($a10->mulInt64($b8, 24))->addInt64($a11->mulInt64($b7, 24));\n        $s19 = $a8->mulInt64($b11, 24)->addInt64($a9->mulInt64($b10, 24))->addInt64($a10->mulInt64($b9, 24))\n                  ->addInt64($a11->mulInt64($b8, 24));\n        $s20 = $a9->mulInt64($b11, 24)->addInt64($a10->mulInt64($b10, 24))->addInt64($a11->mulInt64($b9, 24));\n        $s21 = $a10->mulInt64($b11, 24)->addInt64($a11->mulInt64($b10, 24));\n        $s22 = $a11->mulInt64($b11, 24);\n        $s23 = new ParagonIE_Sodium_Core32_Int64();\n\n        $carry0 = $s0->addInt(1 << 20)->shiftRight(21);\n        $s1 = $s1->addInt64($carry0);\n        $s0 = $s0->subInt64($carry0->shiftLeft(21));\n        $carry2 = $s2->addInt(1 << 20)->shiftRight(21);\n        $s3 = $s3->addInt64($carry2);\n        $s2 = $s2->subInt64($carry2->shiftLeft(21));\n        $carry4 = $s4->addInt(1 << 20)->shiftRight(21);\n        $s5 = $s5->addInt64($carry4);\n        $s4 = $s4->subInt64($carry4->shiftLeft(21));\n        $carry6 = $s6->addInt(1 << 20)->shiftRight(21);\n        $s7 = $s7->addInt64($carry6);\n        $s6 = $s6->subInt64($carry6->shiftLeft(21));\n        $carry8 = $s8->addInt(1 << 20)->shiftRight(21);\n        $s9 = $s9->addInt64($carry8);\n        $s8 = $s8->subInt64($carry8->shiftLeft(21));\n        $carry10 = $s10->addInt(1 << 20)->shiftRight(21);\n        $s11 = $s11->addInt64($carry10);\n        $s10 = $s10->subInt64($carry10->shiftLeft(21));\n        $carry12 = $s12->addInt(1 << 20)->shiftRight(21);\n        $s13 = $s13->addInt64($carry12);\n        $s12 = $s12->subInt64($carry12->shiftLeft(21));\n        $carry14 = $s14->addInt(1 << 20)->shiftRight(21);\n        $s15 = $s15->addInt64($carry14);\n        $s14 = $s14->subInt64($carry14->shiftLeft(21));\n        $carry16 = $s16->addInt(1 << 20)->shiftRight(21);\n        $s17 = $s17->addInt64($carry16);\n        $s16 = $s16->subInt64($carry16->shiftLeft(21));\n        $carry18 = $s18->addInt(1 << 20)->shiftRight(21);\n        $s19 = $s19->addInt64($carry18);\n        $s18 = $s18->subInt64($carry18->shiftLeft(21));\n        $carry20 = $s20->addInt(1 << 20)->shiftRight(21);\n        $s21 = $s21->addInt64($carry20);\n        $s20 = $s20->subInt64($carry20->shiftLeft(21));\n        $carry22 = $s22->addInt(1 << 20)->shiftRight(21);\n        $s23 = $s23->addInt64($carry22);\n        $s22 = $s22->subInt64($carry22->shiftLeft(21));\n\n        $carry1 = $s1->addInt(1 << 20)->shiftRight(21);\n        $s2 = $s2->addInt64($carry1);\n        $s1 = $s1->subInt64($carry1->shiftLeft(21));\n        $carry3 = $s3->addInt(1 << 20)->shiftRight(21);\n        $s4 = $s4->addInt64($carry3);\n        $s3 = $s3->subInt64($carry3->shiftLeft(21));\n        $carry5 = $s5->addInt(1 << 20)->shiftRight(21);\n        $s6 = $s6->addInt64($carry5);\n        $s5 = $s5->subInt64($carry5->shiftLeft(21));\n        $carry7 = $s7->addInt(1 << 20)->shiftRight(21);\n        $s8 = $s8->addInt64($carry7);\n        $s7 = $s7->subInt64($carry7->shiftLeft(21));\n        $carry9 = $s9->addInt(1 << 20)->shiftRight(21);\n        $s10 = $s10->addInt64($carry9);\n        $s9 = $s9->subInt64($carry9->shiftLeft(21));\n        $carry11 = $s11->addInt(1 << 20)->shiftRight(21);\n        $s12 = $s12->addInt64($carry11);\n        $s11 = $s11->subInt64($carry11->shiftLeft(21));\n        $carry13 = $s13->addInt(1 << 20)->shiftRight(21);\n        $s14 = $s14->addInt64($carry13);\n        $s13 = $s13->subInt64($carry13->shiftLeft(21));\n        $carry15 = $s15->addInt(1 << 20)->shiftRight(21);\n        $s16 = $s16->addInt64($carry15);\n        $s15 = $s15->subInt64($carry15->shiftLeft(21));\n        $carry17 = $s17->addInt(1 << 20)->shiftRight(21);\n        $s18 = $s18->addInt64($carry17);\n        $s17 = $s17->subInt64($carry17->shiftLeft(21));\n        $carry19 = $s19->addInt(1 << 20)->shiftRight(21);\n        $s20 = $s20->addInt64($carry19);\n        $s19 = $s19->subInt64($carry19->shiftLeft(21));\n        $carry21 = $s21->addInt(1 << 20)->shiftRight(21);\n        $s22 = $s22->addInt64($carry21);\n        $s21 = $s21->subInt64($carry21->shiftLeft(21));\n\n        $s11 = $s11->addInt64($s23->mulInt(666643, 20));\n        $s12 = $s12->addInt64($s23->mulInt(470296, 19));\n        $s13 = $s13->addInt64($s23->mulInt(654183, 20));\n        $s14 = $s14->subInt64($s23->mulInt(997805, 20));\n        $s15 = $s15->addInt64($s23->mulInt(136657, 18));\n        $s16 = $s16->subInt64($s23->mulInt(683901, 20));\n\n        $s10 = $s10->addInt64($s22->mulInt(666643, 20));\n        $s11 = $s11->addInt64($s22->mulInt(470296, 19));\n        $s12 = $s12->addInt64($s22->mulInt(654183, 20));\n        $s13 = $s13->subInt64($s22->mulInt(997805, 20));\n        $s14 = $s14->addInt64($s22->mulInt(136657, 18));\n        $s15 = $s15->subInt64($s22->mulInt(683901, 20));\n\n        $s9  =  $s9->addInt64($s21->mulInt(666643, 20));\n        $s10 = $s10->addInt64($s21->mulInt(470296, 19));\n        $s11 = $s11->addInt64($s21->mulInt(654183, 20));\n        $s12 = $s12->subInt64($s21->mulInt(997805, 20));\n        $s13 = $s13->addInt64($s21->mulInt(136657, 18));\n        $s14 = $s14->subInt64($s21->mulInt(683901, 20));\n\n        $s8  =  $s8->addInt64($s20->mulInt(666643, 20));\n        $s9  =  $s9->addInt64($s20->mulInt(470296, 19));\n        $s10 = $s10->addInt64($s20->mulInt(654183, 20));\n        $s11 = $s11->subInt64($s20->mulInt(997805, 20));\n        $s12 = $s12->addInt64($s20->mulInt(136657, 18));\n        $s13 = $s13->subInt64($s20->mulInt(683901, 20));\n\n        $s7  =  $s7->addInt64($s19->mulInt(666643, 20));\n        $s8  =  $s8->addInt64($s19->mulInt(470296, 19));\n        $s9  =  $s9->addInt64($s19->mulInt(654183, 20));\n        $s10 = $s10->subInt64($s19->mulInt(997805, 20));\n        $s11 = $s11->addInt64($s19->mulInt(136657, 18));\n        $s12 = $s12->subInt64($s19->mulInt(683901, 20));\n\n        $s6  =  $s6->addInt64($s18->mulInt(666643, 20));\n        $s7  =  $s7->addInt64($s18->mulInt(470296, 19));\n        $s8  =  $s8->addInt64($s18->mulInt(654183, 20));\n        $s9  =  $s9->subInt64($s18->mulInt(997805, 20));\n        $s10 = $s10->addInt64($s18->mulInt(136657, 18));\n        $s11 = $s11->subInt64($s18->mulInt(683901, 20));\n\n        $carry6 = $s6->addInt(1 << 20)->shiftRight(21);\n        $s7 = $s7->addInt64($carry6);\n        $s6 = $s6->subInt64($carry6->shiftLeft(21));\n        $carry8 = $s8->addInt(1 << 20)->shiftRight(21);\n        $s9 = $s9->addInt64($carry8);\n        $s8 = $s8->subInt64($carry8->shiftLeft(21));\n        $carry10 = $s10->addInt(1 << 20)->shiftRight(21);\n        $s11 = $s11->addInt64($carry10);\n        $s10 = $s10->subInt64($carry10->shiftLeft(21));\n        $carry12 = $s12->addInt(1 << 20)->shiftRight(21);\n        $s13 = $s13->addInt64($carry12);\n        $s12 = $s12->subInt64($carry12->shiftLeft(21));\n        $carry14 = $s14->addInt(1 << 20)->shiftRight(21);\n        $s15 = $s15->addInt64($carry14);\n        $s14 = $s14->subInt64($carry14->shiftLeft(21));\n        $carry16 = $s16->addInt(1 << 20)->shiftRight(21);\n        $s17 = $s17->addInt64($carry16);\n        $s16 = $s16->subInt64($carry16->shiftLeft(21));\n\n        $carry7 = $s7->addInt(1 << 20)->shiftRight(21);\n        $s8 = $s8->addInt64($carry7);\n        $s7 = $s7->subInt64($carry7->shiftLeft(21));\n        $carry9 = $s9->addInt(1 << 20)->shiftRight(21);\n        $s10 = $s10->addInt64($carry9);\n        $s9 = $s9->subInt64($carry9->shiftLeft(21));\n        $carry11 = $s11->addInt(1 << 20)->shiftRight(21);\n        $s12 = $s12->addInt64($carry11);\n        $s11 = $s11->subInt64($carry11->shiftLeft(21));\n        $carry13 = $s13->addInt(1 << 20)->shiftRight(21);\n        $s14 = $s14->addInt64($carry13);\n        $s13 = $s13->subInt64($carry13->shiftLeft(21));\n        $carry15 = $s15->addInt(1 << 20)->shiftRight(21);\n        $s16 = $s16->addInt64($carry15);\n        $s15 = $s15->subInt64($carry15->shiftLeft(21));\n\n        $s5  =  $s5->addInt64($s17->mulInt(666643, 20));\n        $s6  =  $s6->addInt64($s17->mulInt(470296, 19));\n        $s7  =  $s7->addInt64($s17->mulInt(654183, 20));\n        $s8  =  $s8->subInt64($s17->mulInt(997805, 20));\n        $s9  =  $s9->addInt64($s17->mulInt(136657, 18));\n        $s10 = $s10->subInt64($s17->mulInt(683901, 20));\n\n        $s4  =  $s4->addInt64($s16->mulInt(666643, 20));\n        $s5  =  $s5->addInt64($s16->mulInt(470296, 19));\n        $s6  =  $s6->addInt64($s16->mulInt(654183, 20));\n        $s7  =  $s7->subInt64($s16->mulInt(997805, 20));\n        $s8  =  $s8->addInt64($s16->mulInt(136657, 18));\n        $s9  =  $s9->subInt64($s16->mulInt(683901, 20));\n\n        $s3  =  $s3->addInt64($s15->mulInt(666643, 20));\n        $s4  =  $s4->addInt64($s15->mulInt(470296, 19));\n        $s5  =  $s5->addInt64($s15->mulInt(654183, 20));\n        $s6  =  $s6->subInt64($s15->mulInt(997805, 20));\n        $s7  =  $s7->addInt64($s15->mulInt(136657, 18));\n        $s8  =  $s8->subInt64($s15->mulInt(683901, 20));\n\n        $s2  =  $s2->addInt64($s14->mulInt(666643, 20));\n        $s3  =  $s3->addInt64($s14->mulInt(470296, 19));\n        $s4  =  $s4->addInt64($s14->mulInt(654183, 20));\n        $s5  =  $s5->subInt64($s14->mulInt(997805, 20));\n        $s6  =  $s6->addInt64($s14->mulInt(136657, 18));\n        $s7  =  $s7->subInt64($s14->mulInt(683901, 20));\n\n        $s1  =  $s1->addInt64($s13->mulInt(666643, 20));\n        $s2  =  $s2->addInt64($s13->mulInt(470296, 19));\n        $s3  =  $s3->addInt64($s13->mulInt(654183, 20));\n        $s4  =  $s4->subInt64($s13->mulInt(997805, 20));\n        $s5  =  $s5->addInt64($s13->mulInt(136657, 18));\n        $s6  =  $s6->subInt64($s13->mulInt(683901, 20));\n\n        $s0  =  $s0->addInt64($s12->mulInt(666643, 20));\n        $s1  =  $s1->addInt64($s12->mulInt(470296, 19));\n        $s2  =  $s2->addInt64($s12->mulInt(654183, 20));\n        $s3  =  $s3->subInt64($s12->mulInt(997805, 20));\n        $s4  =  $s4->addInt64($s12->mulInt(136657, 18));\n        $s5  =  $s5->subInt64($s12->mulInt(683901, 20));\n        $s12 = new ParagonIE_Sodium_Core32_Int64();\n\n        $carry0 = $s0->addInt(1 << 20)->shiftRight(21);\n        $s1 = $s1->addInt64($carry0);\n        $s0 = $s0->subInt64($carry0->shiftLeft(21));\n        $carry2 = $s2->addInt(1 << 20)->shiftRight(21);\n        $s3 = $s3->addInt64($carry2);\n        $s2 = $s2->subInt64($carry2->shiftLeft(21));\n        $carry4 = $s4->addInt(1 << 20)->shiftRight(21);\n        $s5 = $s5->addInt64($carry4);\n        $s4 = $s4->subInt64($carry4->shiftLeft(21));\n        $carry6 = $s6->addInt(1 << 20)->shiftRight(21);\n        $s7 = $s7->addInt64($carry6);\n        $s6 = $s6->subInt64($carry6->shiftLeft(21));\n        $carry8 = $s8->addInt(1 << 20)->shiftRight(21);\n        $s9 = $s9->addInt64($carry8);\n        $s8 = $s8->subInt64($carry8->shiftLeft(21));\n        $carry10 = $s10->addInt(1 << 20)->shiftRight(21);\n        $s11 = $s11->addInt64($carry10);\n        $s10 = $s10->subInt64($carry10->shiftLeft(21));\n\n        $carry1 = $s1->addInt(1 << 20)->shiftRight(21);\n        $s2 = $s2->addInt64($carry1);\n        $s1 = $s1->subInt64($carry1->shiftLeft(21));\n        $carry3 = $s3->addInt(1 << 20)->shiftRight(21);\n        $s4 = $s4->addInt64($carry3);\n        $s3 = $s3->subInt64($carry3->shiftLeft(21));\n        $carry5 = $s5->addInt(1 << 20)->shiftRight(21);\n        $s6 = $s6->addInt64($carry5);\n        $s5 = $s5->subInt64($carry5->shiftLeft(21));\n        $carry7 = $s7->addInt(1 << 20)->shiftRight(21);\n        $s8 = $s8->addInt64($carry7);\n        $s7 = $s7->subInt64($carry7->shiftLeft(21));\n        $carry9 = $s9->addInt(1 << 20)->shiftRight(21);\n        $s10 = $s10->addInt64($carry9);\n        $s9 = $s9->subInt64($carry9->shiftLeft(21));\n        $carry11 = $s11->addInt(1 << 20)->shiftRight(21);\n        $s12 = $s12->addInt64($carry11);\n        $s11 = $s11->subInt64($carry11->shiftLeft(21));\n\n        $s0  =  $s0->addInt64($s12->mulInt(666643, 20));\n        $s1  =  $s1->addInt64($s12->mulInt(470296, 19));\n        $s2  =  $s2->addInt64($s12->mulInt(654183, 20));\n        $s3  =  $s3->subInt64($s12->mulInt(997805, 20));\n        $s4  =  $s4->addInt64($s12->mulInt(136657, 18));\n        $s5  =  $s5->subInt64($s12->mulInt(683901, 20));\n        $s12 = new ParagonIE_Sodium_Core32_Int64();\n\n        $carry0 = $s0->shiftRight(21);\n        $s1 = $s1->addInt64($carry0);\n        $s0 = $s0->subInt64($carry0->shiftLeft(21));\n        $carry1 = $s1->shiftRight(21);\n        $s2 = $s2->addInt64($carry1);\n        $s1 = $s1->subInt64($carry1->shiftLeft(21));\n        $carry2 = $s2->shiftRight(21);\n        $s3 = $s3->addInt64($carry2);\n        $s2 = $s2->subInt64($carry2->shiftLeft(21));\n        $carry3 = $s3->shiftRight(21);\n        $s4 = $s4->addInt64($carry3);\n        $s3 = $s3->subInt64($carry3->shiftLeft(21));\n        $carry4 = $s4->shiftRight(21);\n        $s5 = $s5->addInt64($carry4);\n        $s4 = $s4->subInt64($carry4->shiftLeft(21));\n        $carry5 = $s5->shiftRight(21);\n        $s6 = $s6->addInt64($carry5);\n        $s5 = $s5->subInt64($carry5->shiftLeft(21));\n        $carry6 = $s6->shiftRight(21);\n        $s7 = $s7->addInt64($carry6);\n        $s6 = $s6->subInt64($carry6->shiftLeft(21));\n        $carry7 = $s7->shiftRight(21);\n        $s8 = $s8->addInt64($carry7);\n        $s7 = $s7->subInt64($carry7->shiftLeft(21));\n        $carry8 = $s8->shiftRight(21);\n        $s9 = $s9->addInt64($carry8);\n        $s8 = $s8->subInt64($carry8->shiftLeft(21));\n        $carry9 = $s9->shiftRight(21);\n        $s10 = $s10->addInt64($carry9);\n        $s9 = $s9->subInt64($carry9->shiftLeft(21));\n        $carry10 = $s10->shiftRight(21);\n        $s11 = $s11->addInt64($carry10);\n        $s10 = $s10->subInt64($carry10->shiftLeft(21));\n        $carry11 = $s11->shiftRight(21);\n        $s12 = $s12->addInt64($carry11);\n        $s11 = $s11->subInt64($carry11->shiftLeft(21));\n\n        $s0  =  $s0->addInt64($s12->mulInt(666643, 20));\n        $s1  =  $s1->addInt64($s12->mulInt(470296, 19));\n        $s2  =  $s2->addInt64($s12->mulInt(654183, 20));\n        $s3  =  $s3->subInt64($s12->mulInt(997805, 20));\n        $s4  =  $s4->addInt64($s12->mulInt(136657, 18));\n        $s5  =  $s5->subInt64($s12->mulInt(683901, 20));\n\n        $carry0 = $s0->shiftRight(21);\n        $s1 = $s1->addInt64($carry0);\n        $s0 = $s0->subInt64($carry0->shiftLeft(21));\n        $carry1 = $s1->shiftRight(21);\n        $s2 = $s2->addInt64($carry1);\n        $s1 = $s1->subInt64($carry1->shiftLeft(21));\n        $carry2 = $s2->shiftRight(21);\n        $s3 = $s3->addInt64($carry2);\n        $s2 = $s2->subInt64($carry2->shiftLeft(21));\n        $carry3 = $s3->shiftRight(21);\n        $s4 = $s4->addInt64($carry3);\n        $s3 = $s3->subInt64($carry3->shiftLeft(21));\n        $carry4 = $s4->shiftRight(21);\n        $s5 = $s5->addInt64($carry4);\n        $s4 = $s4->subInt64($carry4->shiftLeft(21));\n        $carry5 = $s5->shiftRight(21);\n        $s6 = $s6->addInt64($carry5);\n        $s5 = $s5->subInt64($carry5->shiftLeft(21));\n        $carry6 = $s6->shiftRight(21);\n        $s7 = $s7->addInt64($carry6);\n        $s6 = $s6->subInt64($carry6->shiftLeft(21));\n        $carry7 = $s7->shiftRight(21);\n        $s8 = $s8->addInt64($carry7);\n        $s7 = $s7->subInt64($carry7->shiftLeft(21));\n        $carry8 = $s10->shiftRight(21);\n        $s9 = $s9->addInt64($carry8);\n        $s8 = $s8->subInt64($carry8->shiftLeft(21));\n        $carry9 = $s9->shiftRight(21);\n        $s10 = $s10->addInt64($carry9);\n        $s9 = $s9->subInt64($carry9->shiftLeft(21));\n        $carry10 = $s10->shiftRight(21);\n        $s11 = $s11->addInt64($carry10);\n        $s10 = $s10->subInt64($carry10->shiftLeft(21));\n\n        $S0  =  $s0->toInt();\n        $S1  =  $s1->toInt();\n        $S2  =  $s2->toInt();\n        $S3  =  $s3->toInt();\n        $S4  =  $s4->toInt();\n        $S5  =  $s5->toInt();\n        $S6  =  $s6->toInt();\n        $S7  =  $s7->toInt();\n        $S8  =  $s8->toInt();\n        $S9  =  $s9->toInt();\n        $S10 = $s10->toInt();\n        $S11 = $s11->toInt();\n\n        /**\n         * @var array<int, int>\n         */\n        $arr = array(\n            (int) (0xff & ($S0 >> 0)),\n            (int) (0xff & ($S0 >> 8)),\n            (int) (0xff & (($S0 >> 16) | ($S1 << 5))),\n            (int) (0xff & ($S1 >> 3)),\n            (int) (0xff & ($S1 >> 11)),\n            (int) (0xff & (($S1 >> 19) | ($S2 << 2))),\n            (int) (0xff & ($S2 >> 6)),\n            (int) (0xff & (($S2 >> 14) | ($S3 << 7))),\n            (int) (0xff & ($S3 >> 1)),\n            (int) (0xff & ($S3 >> 9)),\n            (int) (0xff & (($S3 >> 17) | ($S4 << 4))),\n            (int) (0xff & ($S4 >> 4)),\n            (int) (0xff & ($S4 >> 12)),\n            (int) (0xff & (($S4 >> 20) | ($S5 << 1))),\n            (int) (0xff & ($S5 >> 7)),\n            (int) (0xff & (($S5 >> 15) | ($S6 << 6))),\n            (int) (0xff & ($S6 >> 2)),\n            (int) (0xff & ($S6 >> 10)),\n            (int) (0xff & (($S6 >> 18) | ($S7 << 3))),\n            (int) (0xff & ($S7 >> 5)),\n            (int) (0xff & ($S7 >> 13)),\n            (int) (0xff & ($S8 >> 0)),\n            (int) (0xff & ($S8 >> 8)),\n            (int) (0xff & (($S8 >> 16) | ($S9 << 5))),\n            (int) (0xff & ($S9 >> 3)),\n            (int) (0xff & ($S9 >> 11)),\n            (int) (0xff & (($S9 >> 19) | ($S10 << 2))),\n            (int) (0xff & ($S10 >> 6)),\n            (int) (0xff & (($S10 >> 14) | ($S11 << 7))),\n            (int) (0xff & ($S11 >> 1)),\n            (int) (0xff & ($S11 >> 9)),\n            (int) (0xff & ($S11 >> 17))\n        );\n        return self::intArrayToString($arr);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $s\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sc_reduce($s)\n    {\n        /**\n         * @var ParagonIE_Sodium_Core32_Int64 $s0\n         * @var ParagonIE_Sodium_Core32_Int64 $s1\n         * @var ParagonIE_Sodium_Core32_Int64 $s2\n         * @var ParagonIE_Sodium_Core32_Int64 $s3\n         * @var ParagonIE_Sodium_Core32_Int64 $s4\n         * @var ParagonIE_Sodium_Core32_Int64 $s5\n         * @var ParagonIE_Sodium_Core32_Int64 $s6\n         * @var ParagonIE_Sodium_Core32_Int64 $s7\n         * @var ParagonIE_Sodium_Core32_Int64 $s8\n         * @var ParagonIE_Sodium_Core32_Int64 $s9\n         * @var ParagonIE_Sodium_Core32_Int64 $s10\n         * @var ParagonIE_Sodium_Core32_Int64 $s11\n         * @var ParagonIE_Sodium_Core32_Int64 $s12\n         * @var ParagonIE_Sodium_Core32_Int64 $s13\n         * @var ParagonIE_Sodium_Core32_Int64 $s14\n         * @var ParagonIE_Sodium_Core32_Int64 $s15\n         * @var ParagonIE_Sodium_Core32_Int64 $s16\n         * @var ParagonIE_Sodium_Core32_Int64 $s17\n         * @var ParagonIE_Sodium_Core32_Int64 $s18\n         * @var ParagonIE_Sodium_Core32_Int64 $s19\n         * @var ParagonIE_Sodium_Core32_Int64 $s20\n         * @var ParagonIE_Sodium_Core32_Int64 $s21\n         * @var ParagonIE_Sodium_Core32_Int64 $s22\n         * @var ParagonIE_Sodium_Core32_Int64 $s23\n         */\n        $s0 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($s, 0, 3)));\n        $s1 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 2, 4)) >> 5));\n        $s2 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 5, 3)) >> 2));\n        $s3 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 7, 4)) >> 7));\n        $s4 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 10, 4)) >> 4));\n        $s5 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 13, 3)) >> 1));\n        $s6 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 15, 4)) >> 6));\n        $s7 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 18, 4)) >> 3));\n        $s8 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($s, 21, 3)));\n        $s9 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 23, 4)) >> 5));\n        $s10 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 26, 3)) >> 2));\n        $s11 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 28, 4)) >> 7));\n        $s12 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 31, 4)) >> 4));\n        $s13 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 34, 3)) >> 1));\n        $s14 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 36, 4)) >> 6));\n        $s15 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 39, 4)) >> 3));\n        $s16 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($s, 42, 3)));\n        $s17 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 44, 4)) >> 5));\n        $s18 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 47, 3)) >> 2));\n        $s19 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 49, 4)) >> 7));\n        $s20 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 52, 4)) >> 4));\n        $s21 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 55, 3)) >> 1));\n        $s22 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 57, 4)) >> 6));\n        $s23 = ParagonIE_Sodium_Core32_Int64::fromInt(0x1fffffff & (self::load_4(self::substr($s, 60, 4)) >> 3));\n\n        $s11 = $s11->addInt64($s23->mulInt(666643, 20));\n        $s12 = $s12->addInt64($s23->mulInt(470296, 19));\n        $s13 = $s13->addInt64($s23->mulInt(654183, 20));\n        $s14 = $s14->subInt64($s23->mulInt(997805, 20));\n        $s15 = $s15->addInt64($s23->mulInt(136657, 18));\n        $s16 = $s16->subInt64($s23->mulInt(683901, 20));\n\n        $s10 = $s10->addInt64($s22->mulInt(666643, 20));\n        $s11 = $s11->addInt64($s22->mulInt(470296, 19));\n        $s12 = $s12->addInt64($s22->mulInt(654183, 20));\n        $s13 = $s13->subInt64($s22->mulInt(997805, 20));\n        $s14 = $s14->addInt64($s22->mulInt(136657, 18));\n        $s15 = $s15->subInt64($s22->mulInt(683901, 20));\n\n        $s9  =  $s9->addInt64($s21->mulInt(666643, 20));\n        $s10 = $s10->addInt64($s21->mulInt(470296, 19));\n        $s11 = $s11->addInt64($s21->mulInt(654183, 20));\n        $s12 = $s12->subInt64($s21->mulInt(997805, 20));\n        $s13 = $s13->addInt64($s21->mulInt(136657, 18));\n        $s14 = $s14->subInt64($s21->mulInt(683901, 20));\n\n        $s8  =  $s8->addInt64($s20->mulInt(666643, 20));\n        $s9  =  $s9->addInt64($s20->mulInt(470296, 19));\n        $s10 = $s10->addInt64($s20->mulInt(654183, 20));\n        $s11 = $s11->subInt64($s20->mulInt(997805, 20));\n        $s12 = $s12->addInt64($s20->mulInt(136657, 18));\n        $s13 = $s13->subInt64($s20->mulInt(683901, 20));\n\n        $s7  =  $s7->addInt64($s19->mulInt(666643, 20));\n        $s8  =  $s8->addInt64($s19->mulInt(470296, 19));\n        $s9  =  $s9->addInt64($s19->mulInt(654183, 20));\n        $s10 = $s10->subInt64($s19->mulInt(997805, 20));\n        $s11 = $s11->addInt64($s19->mulInt(136657, 18));\n        $s12 = $s12->subInt64($s19->mulInt(683901, 20));\n\n        $s6  =  $s6->addInt64($s18->mulInt(666643, 20));\n        $s7  =  $s7->addInt64($s18->mulInt(470296, 19));\n        $s8  =  $s8->addInt64($s18->mulInt(654183, 20));\n        $s9  =  $s9->subInt64($s18->mulInt(997805, 20));\n        $s10 = $s10->addInt64($s18->mulInt(136657, 18));\n        $s11 = $s11->subInt64($s18->mulInt(683901, 20));\n\n        $carry6 = $s6->addInt(1 << 20)->shiftRight(21);\n        $s7 = $s7->addInt64($carry6);\n        $s6 = $s6->subInt64($carry6->shiftLeft(21));\n        $carry8 = $s8->addInt(1 << 20)->shiftRight(21);\n        $s9 = $s9->addInt64($carry8);\n        $s8 = $s8->subInt64($carry8->shiftLeft(21));\n        $carry10 = $s10->addInt(1 << 20)->shiftRight(21);\n        $s11 = $s11->addInt64($carry10);\n        $s10 = $s10->subInt64($carry10->shiftLeft(21));\n        $carry12 = $s12->addInt(1 << 20)->shiftRight(21);\n        $s13 = $s13->addInt64($carry12);\n        $s12 = $s12->subInt64($carry12->shiftLeft(21));\n        $carry14 = $s14->addInt(1 << 20)->shiftRight(21);\n        $s15 = $s15->addInt64($carry14);\n        $s14 = $s14->subInt64($carry14->shiftLeft(21));\n        $carry16 = $s16->addInt(1 << 20)->shiftRight(21);\n        $s17 = $s17->addInt64($carry16);\n        $s16 = $s16->subInt64($carry16->shiftLeft(21));\n\n        $carry7 = $s7->addInt(1 << 20)->shiftRight(21);\n        $s8 = $s8->addInt64($carry7);\n        $s7 = $s7->subInt64($carry7->shiftLeft(21));\n        $carry9 = $s9->addInt(1 << 20)->shiftRight(21);\n        $s10 = $s10->addInt64($carry9);\n        $s9 = $s9->subInt64($carry9->shiftLeft(21));\n        $carry11 = $s11->addInt(1 << 20)->shiftRight(21);\n        $s12 = $s12->addInt64($carry11);\n        $s11 = $s11->subInt64($carry11->shiftLeft(21));\n        $carry13 = $s13->addInt(1 << 20)->shiftRight(21);\n        $s14 = $s14->addInt64($carry13);\n        $s13 = $s13->subInt64($carry13->shiftLeft(21));\n        $carry15 = $s15->addInt(1 << 20)->shiftRight(21);\n        $s16 = $s16->addInt64($carry15);\n        $s15 = $s15->subInt64($carry15->shiftLeft(21));\n\n        $s5  =  $s5->addInt64($s17->mulInt(666643, 20));\n        $s6  =  $s6->addInt64($s17->mulInt(470296, 19));\n        $s7  =  $s7->addInt64($s17->mulInt(654183, 20));\n        $s8  =  $s8->subInt64($s17->mulInt(997805, 20));\n        $s9  =  $s9->addInt64($s17->mulInt(136657, 18));\n        $s10 = $s10->subInt64($s17->mulInt(683901, 20));\n\n        $s4  =  $s4->addInt64($s16->mulInt(666643, 20));\n        $s5  =  $s5->addInt64($s16->mulInt(470296, 19));\n        $s6  =  $s6->addInt64($s16->mulInt(654183, 20));\n        $s7  =  $s7->subInt64($s16->mulInt(997805, 20));\n        $s8  =  $s8->addInt64($s16->mulInt(136657, 18));\n        $s9  =  $s9->subInt64($s16->mulInt(683901, 20));\n\n        $s3  =  $s3->addInt64($s15->mulInt(666643, 20));\n        $s4  =  $s4->addInt64($s15->mulInt(470296, 19));\n        $s5  =  $s5->addInt64($s15->mulInt(654183, 20));\n        $s6  =  $s6->subInt64($s15->mulInt(997805, 20));\n        $s7  =  $s7->addInt64($s15->mulInt(136657, 18));\n        $s8  =  $s8->subInt64($s15->mulInt(683901, 20));\n\n        $s2  =  $s2->addInt64($s14->mulInt(666643, 20));\n        $s3  =  $s3->addInt64($s14->mulInt(470296, 19));\n        $s4  =  $s4->addInt64($s14->mulInt(654183, 20));\n        $s5  =  $s5->subInt64($s14->mulInt(997805, 20));\n        $s6  =  $s6->addInt64($s14->mulInt(136657, 18));\n        $s7  =  $s7->subInt64($s14->mulInt(683901, 20));\n\n        $s1  =  $s1->addInt64($s13->mulInt(666643, 20));\n        $s2  =  $s2->addInt64($s13->mulInt(470296, 19));\n        $s3  =  $s3->addInt64($s13->mulInt(654183, 20));\n        $s4  =  $s4->subInt64($s13->mulInt(997805, 20));\n        $s5  =  $s5->addInt64($s13->mulInt(136657, 18));\n        $s6  =  $s6->subInt64($s13->mulInt(683901, 20));\n\n        $s0  =  $s0->addInt64($s12->mulInt(666643, 20));\n        $s1  =  $s1->addInt64($s12->mulInt(470296, 19));\n        $s2  =  $s2->addInt64($s12->mulInt(654183, 20));\n        $s3  =  $s3->subInt64($s12->mulInt(997805, 20));\n        $s4  =  $s4->addInt64($s12->mulInt(136657, 18));\n        $s5  =  $s5->subInt64($s12->mulInt(683901, 20));\n        $s12 = new ParagonIE_Sodium_Core32_Int64();\n\n        $carry0 = $s0->addInt(1 << 20)->shiftRight(21);\n        $s1 = $s1->addInt64($carry0);\n        $s0 = $s0->subInt64($carry0->shiftLeft(21));\n        $carry2 = $s2->addInt(1 << 20)->shiftRight(21);\n        $s3 = $s3->addInt64($carry2);\n        $s2 = $s2->subInt64($carry2->shiftLeft(21));\n        $carry4 = $s4->addInt(1 << 20)->shiftRight(21);\n        $s5 = $s5->addInt64($carry4);\n        $s4 = $s4->subInt64($carry4->shiftLeft(21));\n        $carry6 = $s6->addInt(1 << 20)->shiftRight(21);\n        $s7 = $s7->addInt64($carry6);\n        $s6 = $s6->subInt64($carry6->shiftLeft(21));\n        $carry8 = $s8->addInt(1 << 20)->shiftRight(21);\n        $s9 = $s9->addInt64($carry8);\n        $s8 = $s8->subInt64($carry8->shiftLeft(21));\n        $carry10 = $s10->addInt(1 << 20)->shiftRight(21);\n        $s11 = $s11->addInt64($carry10);\n        $s10 = $s10->subInt64($carry10->shiftLeft(21));\n        $carry1 = $s1->addInt(1 << 20)->shiftRight(21);\n        $s2 = $s2->addInt64($carry1);\n        $s1 = $s1->subInt64($carry1->shiftLeft(21));\n        $carry3 = $s3->addInt(1 << 20)->shiftRight(21);\n        $s4 = $s4->addInt64($carry3);\n        $s3 = $s3->subInt64($carry3->shiftLeft(21));\n        $carry5 = $s5->addInt(1 << 20)->shiftRight(21);\n        $s6 = $s6->addInt64($carry5);\n        $s5 = $s5->subInt64($carry5->shiftLeft(21));\n        $carry7 = $s7->addInt(1 << 20)->shiftRight(21);\n        $s8 = $s8->addInt64($carry7);\n        $s7 = $s7->subInt64($carry7->shiftLeft(21));\n        $carry9 = $s9->addInt(1 << 20)->shiftRight(21);\n        $s10 = $s10->addInt64($carry9);\n        $s9 = $s9->subInt64($carry9->shiftLeft(21));\n        $carry11 = $s11->addInt(1 << 20)->shiftRight(21);\n        $s12 = $s12->addInt64($carry11);\n        $s11 = $s11->subInt64($carry11->shiftLeft(21));\n\n        $s0  =  $s0->addInt64($s12->mulInt(666643, 20));\n        $s1  =  $s1->addInt64($s12->mulInt(470296, 19));\n        $s2  =  $s2->addInt64($s12->mulInt(654183, 20));\n        $s3  =  $s3->subInt64($s12->mulInt(997805, 20));\n        $s4  =  $s4->addInt64($s12->mulInt(136657, 18));\n        $s5  =  $s5->subInt64($s12->mulInt(683901, 20));\n        $s12 = new ParagonIE_Sodium_Core32_Int64();\n\n        $carry0 = $s0->shiftRight(21);\n        $s1 = $s1->addInt64($carry0);\n        $s0 = $s0->subInt64($carry0->shiftLeft(21));\n        $carry1 = $s1->shiftRight(21);\n        $s2 = $s2->addInt64($carry1);\n        $s1 = $s1->subInt64($carry1->shiftLeft(21));\n        $carry2 = $s2->shiftRight(21);\n        $s3 = $s3->addInt64($carry2);\n        $s2 = $s2->subInt64($carry2->shiftLeft(21));\n        $carry3 = $s3->shiftRight(21);\n        $s4 = $s4->addInt64($carry3);\n        $s3 = $s3->subInt64($carry3->shiftLeft(21));\n        $carry4 = $s4->shiftRight(21);\n        $s5 = $s5->addInt64($carry4);\n        $s4 = $s4->subInt64($carry4->shiftLeft(21));\n        $carry5 = $s5->shiftRight(21);\n        $s6 = $s6->addInt64($carry5);\n        $s5 = $s5->subInt64($carry5->shiftLeft(21));\n        $carry6 = $s6->shiftRight(21);\n        $s7 = $s7->addInt64($carry6);\n        $s6 = $s6->subInt64($carry6->shiftLeft(21));\n        $carry7 = $s7->shiftRight(21);\n        $s8 = $s8->addInt64($carry7);\n        $s7 = $s7->subInt64($carry7->shiftLeft(21));\n        $carry8 = $s8->shiftRight(21);\n        $s9 = $s9->addInt64($carry8);\n        $s8 = $s8->subInt64($carry8->shiftLeft(21));\n        $carry9 = $s9->shiftRight(21);\n        $s10 = $s10->addInt64($carry9);\n        $s9 = $s9->subInt64($carry9->shiftLeft(21));\n        $carry10 = $s10->shiftRight(21);\n        $s11 = $s11->addInt64($carry10);\n        $s10 = $s10->subInt64($carry10->shiftLeft(21));\n        $carry11 = $s11->shiftRight(21);\n        $s12 = $s12->addInt64($carry11);\n        $s11 = $s11->subInt64($carry11->shiftLeft(21));\n\n        $s0  =  $s0->addInt64($s12->mulInt(666643, 20));\n        $s1  =  $s1->addInt64($s12->mulInt(470296, 19));\n        $s2  =  $s2->addInt64($s12->mulInt(654183, 20));\n        $s3  =  $s3->subInt64($s12->mulInt(997805, 20));\n        $s4  =  $s4->addInt64($s12->mulInt(136657, 18));\n        $s5  =  $s5->subInt64($s12->mulInt(683901, 20));\n\n        $carry0 = $s0->shiftRight(21);\n        $s1 = $s1->addInt64($carry0);\n        $s0 = $s0->subInt64($carry0->shiftLeft(21));\n        $carry1 = $s1->shiftRight(21);\n        $s2 = $s2->addInt64($carry1);\n        $s1 = $s1->subInt64($carry1->shiftLeft(21));\n        $carry2 = $s2->shiftRight(21);\n        $s3 = $s3->addInt64($carry2);\n        $s2 = $s2->subInt64($carry2->shiftLeft(21));\n        $carry3 = $s3->shiftRight(21);\n        $s4 = $s4->addInt64($carry3);\n        $s3 = $s3->subInt64($carry3->shiftLeft(21));\n        $carry4 = $s4->shiftRight(21);\n        $s5 = $s5->addInt64($carry4);\n        $s4 = $s4->subInt64($carry4->shiftLeft(21));\n        $carry5 = $s5->shiftRight(21);\n        $s6 = $s6->addInt64($carry5);\n        $s5 = $s5->subInt64($carry5->shiftLeft(21));\n        $carry6 = $s6->shiftRight(21);\n        $s7 = $s7->addInt64($carry6);\n        $s6 = $s6->subInt64($carry6->shiftLeft(21));\n        $carry7 = $s7->shiftRight(21);\n        $s8 = $s8->addInt64($carry7);\n        $s7 = $s7->subInt64($carry7->shiftLeft(21));\n        $carry8 = $s8->shiftRight(21);\n        $s9 = $s9->addInt64($carry8);\n        $s8 = $s8->subInt64($carry8->shiftLeft(21));\n        $carry9 = $s9->shiftRight(21);\n        $s10 = $s10->addInt64($carry9);\n        $s9 = $s9->subInt64($carry9->shiftLeft(21));\n        $carry10 = $s10->shiftRight(21);\n        $s11 = $s11->addInt64($carry10);\n        $s10 = $s10->subInt64($carry10->shiftLeft(21));\n\n        $S0 = $s0->toInt32()->toInt();\n        $S1 = $s1->toInt32()->toInt();\n        $S2 = $s2->toInt32()->toInt();\n        $S3 = $s3->toInt32()->toInt();\n        $S4 = $s4->toInt32()->toInt();\n        $S5 = $s5->toInt32()->toInt();\n        $S6 = $s6->toInt32()->toInt();\n        $S7 = $s7->toInt32()->toInt();\n        $S8 = $s8->toInt32()->toInt();\n        $S9 = $s9->toInt32()->toInt();\n        $S10 = $s10->toInt32()->toInt();\n        $S11 = $s11->toInt32()->toInt();\n\n        /**\n         * @var array<int, int>\n         */\n        $arr = array(\n            (int) ($S0 >> 0),\n            (int) ($S0 >> 8),\n            (int) (($S0 >> 16) | ($S1 << 5)),\n            (int) ($S1 >> 3),\n            (int) ($S1 >> 11),\n            (int) (($S1 >> 19) | ($S2 << 2)),\n            (int) ($S2 >> 6),\n            (int) (($S2 >> 14) | ($S3 << 7)),\n            (int) ($S3 >> 1),\n            (int) ($S3 >> 9),\n            (int) (($S3 >> 17) | ($S4 << 4)),\n            (int) ($S4 >> 4),\n            (int) ($S4 >> 12),\n            (int) (($S4 >> 20) | ($S5 << 1)),\n            (int) ($S5 >> 7),\n            (int) (($S5 >> 15) | ($S6 << 6)),\n            (int) ($S6 >> 2),\n            (int) ($S6 >> 10),\n            (int) (($S6 >> 18) | ($S7 << 3)),\n            (int) ($S7 >> 5),\n            (int) ($S7 >> 13),\n            (int) ($S8 >> 0),\n            (int) ($S8 >> 8),\n            (int) (($S8 >> 16) | ($S9 << 5)),\n            (int) ($S9 >> 3),\n            (int) ($S9 >> 11),\n            (int) (($S9 >> 19) | ($S10 << 2)),\n            (int) ($S10 >> 6),\n            (int) (($S10 >> 14) | ($S11 << 7)),\n            (int) ($S11 >> 1),\n            (int) ($S11 >> 9),\n            (int) $S11 >> 17\n        );\n        return self::intArrayToString($arr);\n    }\n\n    /**\n     * multiply by the order of the main subgroup l = 2^252+27742317777372353535851937790883648493\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A\n     * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P3\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function ge_mul_l(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A)\n    {\n        /** @var array<int, int> $aslide */\n        $aslide = array(\n            13, 0, 0, 0, 0, -1, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0,\n            0, 0, 0, -3, 0, 0, 0, 0, -13, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 3, 0,\n            0, 0, 0, -13, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0,\n            0, 0, 11, 0, 0, 0, 0, -13, 0, 0, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, -1,\n            0, 0, 0, 0, 3, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0,\n            0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 5, 0, 0, 0, 0,\n            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1\n        );\n\n        /** @var array<int, ParagonIE_Sodium_Core32_Curve25519_Ge_Cached> $Ai size 8 */\n        $Ai = array();\n\n        # ge_p3_to_cached(&Ai[0], A);\n        $Ai[0] = self::ge_p3_to_cached($A);\n        # ge_p3_dbl(&t, A);\n        $t = self::ge_p3_dbl($A);\n        # ge_p1p1_to_p3(&A2, &t);\n        $A2 = self::ge_p1p1_to_p3($t);\n\n        for ($i = 1; $i < 8; ++$i) {\n            # ge_add(&t, &A2, &Ai[0]);\n            $t = self::ge_add($A2, $Ai[$i - 1]);\n            # ge_p1p1_to_p3(&u, &t);\n            $u = self::ge_p1p1_to_p3($t);\n            # ge_p3_to_cached(&Ai[i], &u);\n            $Ai[$i] = self::ge_p3_to_cached($u);\n        }\n\n        $r = self::ge_p3_0();\n        for ($i = 252; $i >= 0; --$i) {\n            $t = self::ge_p3_dbl($r);\n            if ($aslide[$i] > 0) {\n                # ge_p1p1_to_p3(&u, &t);\n                $u = self::ge_p1p1_to_p3($t);\n                # ge_add(&t, &u, &Ai[aslide[i] / 2]);\n                $t = self::ge_add($u, $Ai[(int)($aslide[$i] / 2)]);\n            } elseif ($aslide[$i] < 0) {\n                # ge_p1p1_to_p3(&u, &t);\n                $u = self::ge_p1p1_to_p3($t);\n                # ge_sub(&t, &u, &Ai[(-aslide[i]) / 2]);\n                $t = self::ge_sub($u, $Ai[(int)(-$aslide[$i] / 2)]);\n            }\n        }\n        # ge_p1p1_to_p3(r, &t);\n        return self::ge_p1p1_to_p3($t);\n    }\n}\n", "num_lines": 3197}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_Ed25519', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_Ed25519\n */\nabstract class ParagonIE_Sodium_Core32_Ed25519 extends ParagonIE_Sodium_Core32_Curve25519\n{\n    const KEYPAIR_BYTES = 96;\n    const SEED_BYTES = 32;\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @return string (96 bytes)\n     * @throws Exception\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function keypair()\n    {\n        $seed = random_bytes(self::SEED_BYTES);\n        $pk = '';\n        $sk = '';\n        self::seed_keypair($pk, $sk, $seed);\n        return $sk . $pk;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $pk\n     * @param string $sk\n     * @param string $seed\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function seed_keypair(&$pk, &$sk, $seed)\n    {\n        if (self::strlen($seed) !== self::SEED_BYTES) {\n            throw new RangeException('crypto_sign keypair seed must be 32 bytes long');\n        }\n\n        /** @var string $pk */\n        $pk = self::publickey_from_secretkey($seed);\n        $sk = $seed . $pk;\n        return $sk;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $keypair\n     * @return string\n     * @throws TypeError\n     */\n    public static function secretkey($keypair)\n    {\n        if (self::strlen($keypair) !== self::KEYPAIR_BYTES) {\n            throw new RangeException('crypto_sign keypair must be 96 bytes long');\n        }\n        return self::substr($keypair, 0, 64);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $keypair\n     * @return string\n     * @throws RangeException\n     * @throws TypeError\n     */\n    public static function publickey($keypair)\n    {\n        if (self::strlen($keypair) !== self::KEYPAIR_BYTES) {\n            throw new RangeException('crypto_sign keypair must be 96 bytes long');\n        }\n        return self::substr($keypair, 64, 32);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function publickey_from_secretkey($sk)\n    {\n        /** @var string $sk */\n        $sk = hash('sha512', self::substr($sk, 0, 32), true);\n        $sk[0] = self::intToChr(\n            self::chrToInt($sk[0]) & 248\n        );\n        $sk[31] = self::intToChr(\n            (self::chrToInt($sk[31]) & 63) | 64\n        );\n        return self::sk_to_pk($sk);\n    }\n\n    /**\n     * @param string $pk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function pk_to_curve25519($pk)\n    {\n        if (self::small_order($pk)) {\n            throw new SodiumException('Public key is on a small order');\n        }\n        $A = self::ge_frombytes_negate_vartime($pk);\n        $p1 = self::ge_mul_l($A);\n        if (!self::fe_isnonzero($p1->X)) {\n            throw new SodiumException('Unexpected zero result');\n        }\n\n        # fe_1(one_minus_y);\n        # fe_sub(one_minus_y, one_minus_y, A.Y);\n        # fe_invert(one_minus_y, one_minus_y);\n        $one_minux_y = self::fe_invert(\n            self::fe_sub(\n                self::fe_1(),\n                $A->Y\n            )\n        );\n\n\n        # fe_1(x);\n        # fe_add(x, x, A.Y);\n        # fe_mul(x, x, one_minus_y);\n        $x = self::fe_mul(\n            self::fe_add(self::fe_1(), $A->Y),\n            $one_minux_y\n        );\n\n        # fe_tobytes(curve25519_pk, x);\n        return self::fe_tobytes($x);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sk_to_pk($sk)\n    {\n        return self::ge_p3_tobytes(\n            self::ge_scalarmult_base(\n                self::substr($sk, 0, 32)\n            )\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sign($message, $sk)\n    {\n        /** @var string $signature */\n        $signature = self::sign_detached($message, $sk);\n        return $signature . $message;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message A signed message\n     * @param string $pk      Public key\n     * @return string         Message (without signature)\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sign_open($message, $pk)\n    {\n        /** @var string $signature */\n        $signature = self::substr($message, 0, 64);\n\n        /** @var string $message */\n        $message = self::substr($message, 64);\n\n        if (self::verify_detached($signature, $message, $pk)) {\n            return $message;\n        }\n        throw new SodiumException('Invalid signature');\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param string $sk\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sign_detached($message, $sk)\n    {\n        # crypto_hash_sha512(az, sk, 32);\n        $az =  hash('sha512', self::substr($sk, 0, 32), true);\n\n        # az[0] &= 248;\n        # az[31] &= 63;\n        # az[31] |= 64;\n        $az[0] = self::intToChr(self::chrToInt($az[0]) & 248);\n        $az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64);\n\n        # crypto_hash_sha512_init(&hs);\n        # crypto_hash_sha512_update(&hs, az + 32, 32);\n        # crypto_hash_sha512_update(&hs, m, mlen);\n        # crypto_hash_sha512_final(&hs, nonce);\n        $hs = hash_init('sha512');\n        hash_update($hs, self::substr($az, 32, 32));\n        hash_update($hs, $message);\n        $nonceHash = hash_final($hs, true);\n\n        # memmove(sig + 32, sk + 32, 32);\n        $pk = self::substr($sk, 32, 32);\n\n        # sc_reduce(nonce);\n        # ge_scalarmult_base(&R, nonce);\n        # ge_p3_tobytes(sig, &R);\n        $nonce = self::sc_reduce($nonceHash) . self::substr($nonceHash, 32);\n        $sig = self::ge_p3_tobytes(\n            self::ge_scalarmult_base($nonce)\n        );\n\n        # crypto_hash_sha512_init(&hs);\n        # crypto_hash_sha512_update(&hs, sig, 64);\n        # crypto_hash_sha512_update(&hs, m, mlen);\n        # crypto_hash_sha512_final(&hs, hram);\n        $hs = hash_init('sha512');\n        hash_update($hs, self::substr($sig, 0, 32));\n        hash_update($hs, self::substr($pk, 0, 32));\n        hash_update($hs, $message);\n        $hramHash = hash_final($hs, true);\n\n        # sc_reduce(hram);\n        # sc_muladd(sig + 32, hram, az, nonce);\n        $hram = self::sc_reduce($hramHash);\n        $sigAfter = self::sc_muladd($hram, $az, $nonce);\n        $sig = self::substr($sig, 0, 32) . self::substr($sigAfter, 0, 32);\n\n        try {\n            ParagonIE_Sodium_Compat::memzero($az);\n        } catch (SodiumException $ex) {\n            $az = null;\n        }\n        return $sig;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $sig\n     * @param string $message\n     * @param string $pk\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function verify_detached($sig, $message, $pk)\n    {\n        if (self::strlen($sig) < 64) {\n            throw new SodiumException('Signature is too short');\n        }\n        if ((self::chrToInt($sig[63]) & 240) && self::check_S_lt_L(self::substr($sig, 32, 32))) {\n            throw new SodiumException('S < L - Invalid signature');\n        }\n        if (self::small_order($sig)) {\n            throw new SodiumException('Signature is on too small of an order');\n        }\n        if ((self::chrToInt($sig[63]) & 224) !== 0) {\n            throw new SodiumException('Invalid signature');\n        }\n        $d = 0;\n        for ($i = 0; $i < 32; ++$i) {\n            $d |= self::chrToInt($pk[$i]);\n        }\n        if ($d === 0) {\n            throw new SodiumException('All zero public key');\n        }\n\n        /** @var bool The original value of ParagonIE_Sodium_Compat::$fastMult */\n        $orig = ParagonIE_Sodium_Compat::$fastMult;\n\n        // Set ParagonIE_Sodium_Compat::$fastMult to true to speed up verification.\n        ParagonIE_Sodium_Compat::$fastMult = true;\n\n        /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A */\n        $A = self::ge_frombytes_negate_vartime($pk);\n\n        /** @var string $hDigest */\n        $hDigest = hash(\n            'sha512',\n            self::substr($sig, 0, 32) .\n            self::substr($pk, 0, 32) .\n            $message,\n            true\n        );\n\n        /** @var string $h */\n        $h = self::sc_reduce($hDigest) . self::substr($hDigest, 32);\n\n        /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $R */\n        $R = self::ge_double_scalarmult_vartime(\n            $h,\n            $A,\n            self::substr($sig, 32)\n        );\n\n        /** @var string $rcheck */\n        $rcheck = self::ge_tobytes($R);\n\n        // Reset ParagonIE_Sodium_Compat::$fastMult to what it was before.\n        ParagonIE_Sodium_Compat::$fastMult = $orig;\n\n        return self::verify_32($rcheck, self::substr($sig, 0, 32));\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $S\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function check_S_lt_L($S)\n    {\n        if (self::strlen($S) < 32) {\n            throw new SodiumException('Signature must be 32 bytes');\n        }\n        static $L = array(\n            0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58,\n            0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10\n        );\n        /** @var array<int, int> $L */\n        $c = 0;\n        $n = 1;\n        $i = 32;\n\n        do {\n            --$i;\n            $x = self::chrToInt($S[$i]);\n            $c |= (\n                (($x - $L[$i]) >> 8) & $n\n            );\n            $n &= (\n                (($x ^ $L[$i]) - 1) >> 8\n            );\n        } while ($i !== 0);\n\n        return $c === 0;\n    }\n\n    /**\n     * @param string $R\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function small_order($R)\n    {\n        static $blocklist = array(\n            /* 0 (order 4) */\n            array(\n                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n            ),\n            /* 1 (order 1) */\n            array(\n                0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n            ),\n            /* 2707385501144840649318225287225658788936804267575313519463743609750303402022 (order 8) */\n            array(\n                0x26, 0xe8, 0x95, 0x8f, 0xc2, 0xb2, 0x27, 0xb0,\n                0x45, 0xc3, 0xf4, 0x89, 0xf2, 0xef, 0x98, 0xf0,\n                0xd5, 0xdf, 0xac, 0x05, 0xd3, 0xc6, 0x33, 0x39,\n                0xb1, 0x38, 0x02, 0x88, 0x6d, 0x53, 0xfc, 0x05\n            ),\n            /* 55188659117513257062467267217118295137698188065244968500265048394206261417927 (order 8) */\n            array(\n                0xc7, 0x17, 0x6a, 0x70, 0x3d, 0x4d, 0xd8, 0x4f,\n                0xba, 0x3c, 0x0b, 0x76, 0x0d, 0x10, 0x67, 0x0f,\n                0x2a, 0x20, 0x53, 0xfa, 0x2c, 0x39, 0xcc, 0xc6,\n                0x4e, 0xc7, 0xfd, 0x77, 0x92, 0xac, 0x03, 0x7a\n            ),\n            /* p-1 (order 2) */\n            array(\n                0x13, 0xe8, 0x95, 0x8f, 0xc2, 0xb2, 0x27, 0xb0,\n                0x45, 0xc3, 0xf4, 0x89, 0xf2, 0xef, 0x98, 0xf0,\n                0xd5, 0xdf, 0xac, 0x05, 0xd3, 0xc6, 0x33, 0x39,\n                0xb1, 0x38, 0x02, 0x88, 0x6d, 0x53, 0xfc, 0x85\n            ),\n            /* p (order 4) */\n            array(\n                0xb4, 0x17, 0x6a, 0x70, 0x3d, 0x4d, 0xd8, 0x4f,\n                0xba, 0x3c, 0x0b, 0x76, 0x0d, 0x10, 0x67, 0x0f,\n                0x2a, 0x20, 0x53, 0xfa, 0x2c, 0x39, 0xcc, 0xc6,\n                0x4e, 0xc7, 0xfd, 0x77, 0x92, 0xac, 0x03, 0xfa\n            ),\n            /* p+1 (order 1) */\n            array(\n                0xec, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f\n            ),\n            /* p+2707385501144840649318225287225658788936804267575313519463743609750303402022 (order 8) */\n            array(\n                0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f\n            ),\n            /* p+55188659117513257062467267217118295137698188065244968500265048394206261417927 (order 8) */\n            array(\n                0xee, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f\n            ),\n            /* 2p-1 (order 2) */\n            array(\n                0xd9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff\n            ),\n            /* 2p (order 4) */\n            array(\n                0xda, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff\n            ),\n            /* 2p+1 (order 1) */\n            array(\n                0xdb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff\n            )\n        );\n        /** @var array<int, array<int, int>> $blocklist */\n        $countBlocklist = count($blocklist);\n\n        for ($i = 0; $i < $countBlocklist; ++$i) {\n            $c = 0;\n            for ($j = 0; $j < 32; ++$j) {\n                $c |= self::chrToInt($R[$j]) ^ $blocklist[$i][$j];\n            }\n            if ($c === 0) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n", "num_lines": 482}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_HChaCha20', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_HChaCha20\n */\nclass ParagonIE_Sodium_Core32_HChaCha20 extends ParagonIE_Sodium_Core32_ChaCha20\n{\n    /**\n     * @param string $in\n     * @param string $key\n     * @param string|null $c\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function hChaCha20($in = '', $key = '', $c = null)\n    {\n        $ctx = array();\n\n        if ($c === null) {\n            $ctx[0] = new ParagonIE_Sodium_Core32_Int32(array(0x6170, 0x7865));\n            $ctx[1] = new ParagonIE_Sodium_Core32_Int32(array(0x3320, 0x646e));\n            $ctx[2] = new ParagonIE_Sodium_Core32_Int32(array(0x7962, 0x2d32));\n            $ctx[3] = new ParagonIE_Sodium_Core32_Int32(array(0x6b20, 0x6574));\n        } else {\n            $ctx[0] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($c, 0, 4));\n            $ctx[1] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($c, 4, 4));\n            $ctx[2] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($c, 8, 4));\n            $ctx[3] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($c, 12, 4));\n        }\n        $ctx[4]  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 0, 4));\n        $ctx[5]  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 4, 4));\n        $ctx[6]  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 8, 4));\n        $ctx[7]  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 12, 4));\n        $ctx[8]  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 16, 4));\n        $ctx[9]  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 20, 4));\n        $ctx[10] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 24, 4));\n        $ctx[11] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 28, 4));\n        $ctx[12] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($in, 0, 4));\n        $ctx[13] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($in, 4, 4));\n        $ctx[14] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($in, 8, 4));\n        $ctx[15] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($in, 12, 4));\n\n        return self::hChaCha20Bytes($ctx);\n    }\n\n    /**\n     * @param array $ctx\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    protected static function hChaCha20Bytes(array $ctx)\n    {\n        /** @var ParagonIE_Sodium_Core32_Int32 $x0 */\n        $x0  = $ctx[0];\n        /** @var ParagonIE_Sodium_Core32_Int32 $x1 */\n        $x1  = $ctx[1];\n        /** @var ParagonIE_Sodium_Core32_Int32 $x2 */\n        $x2  = $ctx[2];\n        /** @var ParagonIE_Sodium_Core32_Int32 $x3 */\n        $x3  = $ctx[3];\n        /** @var ParagonIE_Sodium_Core32_Int32 $x4 */\n        $x4  = $ctx[4];\n        /** @var ParagonIE_Sodium_Core32_Int32 $x5 */\n        $x5  = $ctx[5];\n        /** @var ParagonIE_Sodium_Core32_Int32 $x6 */\n        $x6  = $ctx[6];\n        /** @var ParagonIE_Sodium_Core32_Int32 $x7 */\n        $x7  = $ctx[7];\n        /** @var ParagonIE_Sodium_Core32_Int32 $x8 */\n        $x8  = $ctx[8];\n        /** @var ParagonIE_Sodium_Core32_Int32 $x9 */\n        $x9  = $ctx[9];\n        /** @var ParagonIE_Sodium_Core32_Int32 $x10 */\n        $x10 = $ctx[10];\n        /** @var ParagonIE_Sodium_Core32_Int32 $x11 */\n        $x11 = $ctx[11];\n        /** @var ParagonIE_Sodium_Core32_Int32 $x12 */\n        $x12 = $ctx[12];\n        /** @var ParagonIE_Sodium_Core32_Int32 $x13 */\n        $x13 = $ctx[13];\n        /** @var ParagonIE_Sodium_Core32_Int32 $x14 */\n        $x14 = $ctx[14];\n        /** @var ParagonIE_Sodium_Core32_Int32 $x15 */\n        $x15 = $ctx[15];\n\n        for ($i = 0; $i < 10; ++$i) {\n            # QUARTERROUND( x0,  x4,  x8,  x12)\n            list($x0, $x4, $x8, $x12) = self::quarterRound($x0, $x4, $x8, $x12);\n\n            # QUARTERROUND( x1,  x5,  x9,  x13)\n            list($x1, $x5, $x9, $x13) = self::quarterRound($x1, $x5, $x9, $x13);\n\n            # QUARTERROUND( x2,  x6,  x10,  x14)\n            list($x2, $x6, $x10, $x14) = self::quarterRound($x2, $x6, $x10, $x14);\n\n            # QUARTERROUND( x3,  x7,  x11,  x15)\n            list($x3, $x7, $x11, $x15) = self::quarterRound($x3, $x7, $x11, $x15);\n\n            # QUARTERROUND( x0,  x5,  x10,  x15)\n            list($x0, $x5, $x10, $x15) = self::quarterRound($x0, $x5, $x10, $x15);\n\n            # QUARTERROUND( x1,  x6,  x11,  x12)\n            list($x1, $x6, $x11, $x12) = self::quarterRound($x1, $x6, $x11, $x12);\n\n            # QUARTERROUND( x2,  x7,  x8,  x13)\n            list($x2, $x7, $x8, $x13) = self::quarterRound($x2, $x7, $x8, $x13);\n\n            # QUARTERROUND( x3,  x4,  x9,  x14)\n            list($x3, $x4, $x9, $x14) = self::quarterRound($x3, $x4, $x9, $x14);\n        }\n\n        return $x0->toReverseString() .\n            $x1->toReverseString() .\n            $x2->toReverseString() .\n            $x3->toReverseString() .\n            $x12->toReverseString() .\n            $x13->toReverseString() .\n            $x14->toReverseString() .\n            $x15->toReverseString();\n    }\n}\n", "num_lines": 128}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_HSalsa20', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_HSalsa20\n */\nabstract class ParagonIE_Sodium_Core32_HSalsa20 extends ParagonIE_Sodium_Core32_Salsa20\n{\n    /**\n     * Calculate an hsalsa20 hash of a single block\n     *\n     * HSalsa20 doesn't have a counter and will never be used for more than\n     * one block (used to derive a subkey for xsalsa20).\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $in\n     * @param string $k\n     * @param string|null $c\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function hsalsa20($in, $k, $c = null)\n    {\n        /**\n         * @var ParagonIE_Sodium_Core32_Int32 $x0\n         * @var ParagonIE_Sodium_Core32_Int32 $x1\n         * @var ParagonIE_Sodium_Core32_Int32 $x2\n         * @var ParagonIE_Sodium_Core32_Int32 $x3\n         * @var ParagonIE_Sodium_Core32_Int32 $x4\n         * @var ParagonIE_Sodium_Core32_Int32 $x5\n         * @var ParagonIE_Sodium_Core32_Int32 $x6\n         * @var ParagonIE_Sodium_Core32_Int32 $x7\n         * @var ParagonIE_Sodium_Core32_Int32 $x8\n         * @var ParagonIE_Sodium_Core32_Int32 $x9\n         * @var ParagonIE_Sodium_Core32_Int32 $x10\n         * @var ParagonIE_Sodium_Core32_Int32 $x11\n         * @var ParagonIE_Sodium_Core32_Int32 $x12\n         * @var ParagonIE_Sodium_Core32_Int32 $x13\n         * @var ParagonIE_Sodium_Core32_Int32 $x14\n         * @var ParagonIE_Sodium_Core32_Int32 $x15\n         * @var ParagonIE_Sodium_Core32_Int32 $j0\n         * @var ParagonIE_Sodium_Core32_Int32 $j1\n         * @var ParagonIE_Sodium_Core32_Int32 $j2\n         * @var ParagonIE_Sodium_Core32_Int32 $j3\n         * @var ParagonIE_Sodium_Core32_Int32 $j4\n         * @var ParagonIE_Sodium_Core32_Int32 $j5\n         * @var ParagonIE_Sodium_Core32_Int32 $j6\n         * @var ParagonIE_Sodium_Core32_Int32 $j7\n         * @var ParagonIE_Sodium_Core32_Int32 $j8\n         * @var ParagonIE_Sodium_Core32_Int32 $j9\n         * @var ParagonIE_Sodium_Core32_Int32 $j10\n         * @var ParagonIE_Sodium_Core32_Int32 $j11\n         * @var ParagonIE_Sodium_Core32_Int32 $j12\n         * @var ParagonIE_Sodium_Core32_Int32 $j13\n         * @var ParagonIE_Sodium_Core32_Int32 $j14\n         * @var ParagonIE_Sodium_Core32_Int32 $j15\n         */\n        if (self::strlen($k) < 32) {\n            throw new RangeException('Key must be 32 bytes long');\n        }\n        if ($c === null) {\n            $x0  = new ParagonIE_Sodium_Core32_Int32(array(0x6170, 0x7865));\n            $x5  = new ParagonIE_Sodium_Core32_Int32(array(0x3320, 0x646e));\n            $x10 = new ParagonIE_Sodium_Core32_Int32(array(0x7962, 0x2d32));\n            $x15 = new ParagonIE_Sodium_Core32_Int32(array(0x6b20, 0x6574));\n        } else {\n            $x0  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($c, 0, 4));\n            $x5  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($c, 4, 4));\n            $x10 = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($c, 8, 4));\n            $x15 = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($c, 12, 4));\n        }\n        $x1  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($k, 0, 4));\n        $x2  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($k, 4, 4));\n        $x3  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($k, 8, 4));\n        $x4  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($k, 12, 4));\n        $x6  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($in, 0, 4));\n        $x7  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($in, 4, 4));\n        $x8  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($in, 8, 4));\n        $x9  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($in, 12, 4));\n        $x11 = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($k, 16, 4));\n        $x12 = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($k, 20, 4));\n        $x13 = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($k, 24, 4));\n        $x14 = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($k, 28, 4));\n\n        for ($i = self::ROUNDS; $i > 0; $i -= 2) {\n            $x4  = $x4->xorInt32($x0->addInt32($x12)->rotateLeft(7));\n            $x8  = $x8->xorInt32($x4->addInt32($x0)->rotateLeft(9));\n            $x12 = $x12->xorInt32($x8->addInt32($x4)->rotateLeft(13));\n            $x0  = $x0->xorInt32($x12->addInt32($x8)->rotateLeft(18));\n\n            $x9  = $x9->xorInt32($x5->addInt32($x1)->rotateLeft(7));\n            $x13 = $x13->xorInt32($x9->addInt32($x5)->rotateLeft(9));\n            $x1  = $x1->xorInt32($x13->addInt32($x9)->rotateLeft(13));\n            $x5  = $x5->xorInt32($x1->addInt32($x13)->rotateLeft(18));\n\n            $x14 = $x14->xorInt32($x10->addInt32($x6)->rotateLeft(7));\n            $x2  = $x2->xorInt32($x14->addInt32($x10)->rotateLeft(9));\n            $x6  = $x6->xorInt32($x2->addInt32($x14)->rotateLeft(13));\n            $x10 = $x10->xorInt32($x6->addInt32($x2)->rotateLeft(18));\n\n            $x3  = $x3->xorInt32($x15->addInt32($x11)->rotateLeft(7));\n            $x7  = $x7->xorInt32($x3->addInt32($x15)->rotateLeft(9));\n            $x11 = $x11->xorInt32($x7->addInt32($x3)->rotateLeft(13));\n            $x15 = $x15->xorInt32($x11->addInt32($x7)->rotateLeft(18));\n\n            $x1  = $x1->xorInt32($x0->addInt32($x3)->rotateLeft(7));\n            $x2  = $x2->xorInt32($x1->addInt32($x0)->rotateLeft(9));\n            $x3  = $x3->xorInt32($x2->addInt32($x1)->rotateLeft(13));\n            $x0  = $x0->xorInt32($x3->addInt32($x2)->rotateLeft(18));\n\n            $x6  = $x6->xorInt32($x5->addInt32($x4)->rotateLeft(7));\n            $x7  = $x7->xorInt32($x6->addInt32($x5)->rotateLeft(9));\n            $x4  = $x4->xorInt32($x7->addInt32($x6)->rotateLeft(13));\n            $x5  = $x5->xorInt32($x4->addInt32($x7)->rotateLeft(18));\n\n            $x11 = $x11->xorInt32($x10->addInt32($x9)->rotateLeft(7));\n            $x8  = $x8->xorInt32($x11->addInt32($x10)->rotateLeft(9));\n            $x9  = $x9->xorInt32($x8->addInt32($x11)->rotateLeft(13));\n            $x10 = $x10->xorInt32($x9->addInt32($x8)->rotateLeft(18));\n\n            $x12 = $x12->xorInt32($x15->addInt32($x14)->rotateLeft(7));\n            $x13 = $x13->xorInt32($x12->addInt32($x15)->rotateLeft(9));\n            $x14 = $x14->xorInt32($x13->addInt32($x12)->rotateLeft(13));\n            $x15 = $x15->xorInt32($x14->addInt32($x13)->rotateLeft(18));\n        }\n\n        return $x0->toReverseString() .\n            $x5->toReverseString() .\n            $x10->toReverseString() .\n            $x15->toReverseString() .\n            $x6->toReverseString() .\n            $x7->toReverseString() .\n            $x8->toReverseString() .\n            $x9->toReverseString();\n    }\n}\n", "num_lines": 142}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * Class ParagonIE_Sodium_Core32_Int32\n *\n * Encapsulates a 32-bit integer.\n *\n * These are immutable. It always returns a new instance.\n */\nclass ParagonIE_Sodium_Core32_Int32\n{\n    /**\n     * @var array<int, int> - two 16-bit integers\n     *\n     * 0 is the higher 16 bits\n     * 1 is the lower 16 bits\n     */\n    public $limbs = array(0, 0);\n\n    /**\n     * @var int\n     */\n    public $overflow = 0;\n\n    /**\n     * @var bool\n     */\n    public $unsignedInt = false;\n\n    /**\n     * ParagonIE_Sodium_Core32_Int32 constructor.\n     * @param array $array\n     * @param bool $unsignedInt\n     */\n    public function __construct($array = array(0, 0), $unsignedInt = false)\n    {\n        $this->limbs = array(\n            (int) $array[0],\n            (int) $array[1]\n        );\n        $this->overflow = 0;\n        $this->unsignedInt = $unsignedInt;\n    }\n\n    /**\n     * Adds two int32 objects\n     *\n     * @param ParagonIE_Sodium_Core32_Int32 $addend\n     * @return ParagonIE_Sodium_Core32_Int32\n     */\n    public function addInt32(ParagonIE_Sodium_Core32_Int32 $addend)\n    {\n        $i0 = $this->limbs[0];\n        $i1 = $this->limbs[1];\n        $j0 = $addend->limbs[0];\n        $j1 = $addend->limbs[1];\n\n        $r1 = $i1 + ($j1 & 0xffff);\n        $carry = $r1 >> 16;\n\n        $r0 = $i0 + ($j0 & 0xffff) + $carry;\n        $carry = $r0 >> 16;\n\n        $r0 &= 0xffff;\n        $r1 &= 0xffff;\n\n        $return = new ParagonIE_Sodium_Core32_Int32(\n            array($r0, $r1)\n        );\n        $return->overflow = $carry;\n        $return->unsignedInt = $this->unsignedInt;\n        return $return;\n    }\n\n    /**\n     * Adds a normal integer to an int32 object\n     *\n     * @param int $int\n     * @return ParagonIE_Sodium_Core32_Int32\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function addInt($int)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1);\n        /** @var int $int */\n        $int = (int) $int;\n\n        $int = (int) $int;\n\n        $i0 = $this->limbs[0];\n        $i1 = $this->limbs[1];\n\n        $r1 = $i1 + ($int & 0xffff);\n        $carry = $r1 >> 16;\n\n        $r0 = $i0 + (($int >> 16) & 0xffff) + $carry;\n        $carry = $r0 >> 16;\n        $r0 &= 0xffff;\n        $r1 &= 0xffff;\n        $return = new ParagonIE_Sodium_Core32_Int32(\n            array($r0, $r1)\n        );\n        $return->overflow = $carry;\n        $return->unsignedInt = $this->unsignedInt;\n        return $return;\n    }\n\n    /**\n     * @param int $b\n     * @return int\n     */\n    public function compareInt($b = 0)\n    {\n        $gt = 0;\n        $eq = 1;\n\n        $i = 2;\n        $j = 0;\n        while ($i > 0) {\n            --$i;\n            /** @var int $x1 */\n            $x1 = $this->limbs[$i];\n            /** @var int $x2 */\n            $x2 = ($b >> ($j << 4)) & 0xffff;\n            /** @var int $gt */\n            $gt |= (($x2 - $x1) >> 8) & $eq;\n            /** @var int $eq */\n            $eq &= (($x2 ^ $x1) - 1) >> 8;\n        }\n        return ($gt + $gt - $eq) + 1;\n    }\n\n    /**\n     * @param int $m\n     * @return ParagonIE_Sodium_Core32_Int32\n     */\n    public function mask($m = 0)\n    {\n        /** @var int $hi */\n        $hi = ($m >> 16) & 0xffff;\n        /** @var int $lo */\n        $lo = ($m & 0xffff);\n        return new ParagonIE_Sodium_Core32_Int32(\n            array(\n                (int) ($this->limbs[0] & $hi),\n                (int) ($this->limbs[1] & $lo)\n            ),\n            $this->unsignedInt\n        );\n    }\n\n    /**\n     * @param array<int, int> $a\n     * @param array<int, int> $b\n     * @param int $baseLog2\n     * @return array<int, int>\n     */\n    public function multiplyLong(array $a, array $b, $baseLog2 = 16)\n    {\n        $a_l = count($a);\n        $b_l = count($b);\n        /** @var array<int, int> $r */\n        $r = array_fill(0, $a_l + $b_l + 1, 0);\n        $base = 1 << $baseLog2;\n        for ($i = 0; $i < $a_l; ++$i) {\n            $a_i = $a[$i];\n            for ($j = 0; $j < $a_l; ++$j) {\n                $b_j = $b[$j];\n                $product = ($a_i * $b_j) + $r[$i + $j];\n                $carry = ($product >> $baseLog2 & 0xffff);\n                $r[$i + $j] = ($product - (int) ($carry * $base)) & 0xffff;\n                $r[$i + $j + 1] += $carry;\n            }\n        }\n        return array_slice($r, 0, 5);\n    }\n\n    /**\n     * @param int $int\n     * @return ParagonIE_Sodium_Core32_Int32\n     */\n    public function mulIntFast($int)\n    {\n        // Handle negative numbers\n        $aNeg = ($this->limbs[0] >> 15) & 1;\n        $bNeg = ($int >> 31) & 1;\n        $a = array_reverse($this->limbs);\n        $b = array(\n            $int & 0xffff,\n            ($int >> 16) & 0xffff\n        );\n        if ($aNeg) {\n            for ($i = 0; $i < 2; ++$i) {\n                $a[$i] = ($a[$i] ^ 0xffff) & 0xffff;\n            }\n            ++$a[0];\n        }\n        if ($bNeg) {\n            for ($i = 0; $i < 2; ++$i) {\n                $b[$i] = ($b[$i] ^ 0xffff) & 0xffff;\n            }\n            ++$b[0];\n        }\n        // Multiply\n        $res = $this->multiplyLong($a, $b);\n\n        // Re-apply negation to results\n        if ($aNeg !== $bNeg) {\n            for ($i = 0; $i < 2; ++$i) {\n                $res[$i] = (0xffff ^ $res[$i]) & 0xffff;\n            }\n            // Handle integer overflow\n            $c = 1;\n            for ($i = 0; $i < 2; ++$i) {\n                $res[$i] += $c;\n                $c = $res[$i] >> 16;\n                $res[$i] &= 0xffff;\n            }\n        }\n\n        // Return our values\n        $return = new ParagonIE_Sodium_Core32_Int32();\n        $return->limbs = array(\n            $res[1] & 0xffff,\n            $res[0] & 0xffff\n        );\n        if (count($res) > 2) {\n            $return->overflow = $res[2] & 0xffff;\n        }\n        $return->unsignedInt = $this->unsignedInt;\n        return $return;\n    }\n\n    /**\n     * @param ParagonIE_Sodium_Core32_Int32 $right\n     * @return ParagonIE_Sodium_Core32_Int32\n     */\n    public function mulInt32Fast(ParagonIE_Sodium_Core32_Int32 $right)\n    {\n        $aNeg = ($this->limbs[0] >> 15) & 1;\n        $bNeg = ($right->limbs[0] >> 15) & 1;\n\n        $a = array_reverse($this->limbs);\n        $b = array_reverse($right->limbs);\n        if ($aNeg) {\n            for ($i = 0; $i < 2; ++$i) {\n                $a[$i] = ($a[$i] ^ 0xffff) & 0xffff;\n            }\n            ++$a[0];\n        }\n        if ($bNeg) {\n            for ($i = 0; $i < 2; ++$i) {\n                $b[$i] = ($b[$i] ^ 0xffff) & 0xffff;\n            }\n            ++$b[0];\n        }\n        $res = $this->multiplyLong($a, $b);\n        if ($aNeg !== $bNeg) {\n            if ($aNeg !== $bNeg) {\n                for ($i = 0; $i < 2; ++$i) {\n                    $res[$i] = ($res[$i] ^ 0xffff) & 0xffff;\n                }\n                $c = 1;\n                for ($i = 0; $i < 2; ++$i) {\n                    $res[$i] += $c;\n                    $c = $res[$i] >> 16;\n                    $res[$i] &= 0xffff;\n                }\n            }\n        }\n        $return = new ParagonIE_Sodium_Core32_Int32();\n        $return->limbs = array(\n            $res[1] & 0xffff,\n            $res[0] & 0xffff\n        );\n        if (count($res) > 2) {\n            $return->overflow = $res[2];\n        }\n        return $return;\n    }\n\n    /**\n     * @param int $int\n     * @param int $size\n     * @return ParagonIE_Sodium_Core32_Int32\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function mulInt($int = 0, $size = 0)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1);\n        ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2);\n        if (ParagonIE_Sodium_Compat::$fastMult) {\n            return $this->mulIntFast((int) $int);\n        }\n        /** @var int $int */\n        $int = (int) $int;\n        /** @var int $size */\n        $size = (int) $size;\n\n        if (!$size) {\n            $size = 31;\n        }\n        /** @var int $size */\n\n        $a = clone $this;\n        $return = new ParagonIE_Sodium_Core32_Int32();\n        $return->unsignedInt = $this->unsignedInt;\n\n        // Initialize:\n        $ret0 = 0;\n        $ret1 = 0;\n        $a0 = $a->limbs[0];\n        $a1 = $a->limbs[1];\n\n        /** @var int $size */\n        /** @var int $i */\n        for ($i = $size; $i >= 0; --$i) {\n            $m = (int) (-($int & 1));\n            $x0 = $a0 & $m;\n            $x1 = $a1 & $m;\n\n            $ret1 += $x1;\n            $c = $ret1 >> 16;\n\n            $ret0 += $x0 + $c;\n\n            $ret0 &= 0xffff;\n            $ret1 &= 0xffff;\n\n            $a1 = ($a1 << 1);\n            $x1 = $a1 >> 16;\n            $a0 = ($a0 << 1) | $x1;\n            $a0 &= 0xffff;\n            $a1 &= 0xffff;\n            $int >>= 1;\n        }\n        $return->limbs[0] = $ret0;\n        $return->limbs[1] = $ret1;\n        return $return;\n    }\n\n    /**\n     * @param ParagonIE_Sodium_Core32_Int32 $int\n     * @param int $size\n     * @return ParagonIE_Sodium_Core32_Int32\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function mulInt32(ParagonIE_Sodium_Core32_Int32 $int, $size = 0)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2);\n        if (ParagonIE_Sodium_Compat::$fastMult) {\n            return $this->mulInt32Fast($int);\n        }\n        if (!$size) {\n            $size = 31;\n        }\n        /** @var int $size */\n\n        $a = clone $this;\n        $b = clone $int;\n        $return = new ParagonIE_Sodium_Core32_Int32();\n        $return->unsignedInt = $this->unsignedInt;\n\n        // Initialize:\n        $ret0 = 0;\n        $ret1 = 0;\n        $a0 = $a->limbs[0];\n        $a1 = $a->limbs[1];\n        $b0 = $b->limbs[0];\n        $b1 = $b->limbs[1];\n\n        /** @var int $size */\n        /** @var int $i */\n        for ($i = $size; $i >= 0; --$i) {\n            $m = (int) (-($b1 & 1));\n            $x0 = $a0 & $m;\n            $x1 = $a1 & $m;\n\n            $ret1 += $x1;\n            $c = $ret1 >> 16;\n\n            $ret0 += $x0 + $c;\n\n            $ret0 &= 0xffff;\n            $ret1 &= 0xffff;\n\n            $a1 = ($a1 << 1);\n            $x1 = $a1 >> 16;\n            $a0 = ($a0 << 1) | $x1;\n            $a0 &= 0xffff;\n            $a1 &= 0xffff;\n\n            $x0 = ($b0 & 1) << 16;\n            $b0 = ($b0 >> 1);\n            $b1 = (($b1 | $x0) >> 1);\n\n            $b0 &= 0xffff;\n            $b1 &= 0xffff;\n\n        }\n        $return->limbs[0] = $ret0;\n        $return->limbs[1] = $ret1;\n\n        return $return;\n    }\n\n    /**\n     * OR this 32-bit integer with another.\n     *\n     * @param ParagonIE_Sodium_Core32_Int32 $b\n     * @return ParagonIE_Sodium_Core32_Int32\n     */\n    public function orInt32(ParagonIE_Sodium_Core32_Int32 $b)\n    {\n        $return = new ParagonIE_Sodium_Core32_Int32();\n        $return->unsignedInt = $this->unsignedInt;\n        $return->limbs = array(\n            (int) ($this->limbs[0] | $b->limbs[0]),\n            (int) ($this->limbs[1] | $b->limbs[1])\n        );\n        /** @var int overflow */\n        $return->overflow = $this->overflow | $b->overflow;\n        return $return;\n    }\n\n    /**\n     * @param int $b\n     * @return bool\n     */\n    public function isGreaterThan($b = 0)\n    {\n        return $this->compareInt($b) > 0;\n    }\n\n    /**\n     * @param int $b\n     * @return bool\n     */\n    public function isLessThanInt($b = 0)\n    {\n        return $this->compareInt($b) < 0;\n    }\n\n    /**\n     * @param int $c\n     * @return ParagonIE_Sodium_Core32_Int32\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArrayAccess\n     */\n    public function rotateLeft($c = 0)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1);\n        /** @var int $c */\n        $c = (int) $c;\n\n        $return = new ParagonIE_Sodium_Core32_Int32();\n        $return->unsignedInt = $this->unsignedInt;\n        $c &= 31;\n        if ($c === 0) {\n            // NOP, but we want a copy.\n            $return->limbs = $this->limbs;\n        } else {\n            /** @var int $c */\n\n            /** @var int $idx_shift */\n            $idx_shift = ($c >> 4) & 1;\n\n            /** @var int $sub_shift */\n            $sub_shift = $c & 15;\n\n            /** @var array<int, int> $limbs */\n            $limbs =& $return->limbs;\n\n            /** @var array<int, int> $myLimbs */\n            $myLimbs =& $this->limbs;\n\n            for ($i = 1; $i >= 0; --$i) {\n                /** @var int $j */\n                $j = ($i + $idx_shift) & 1;\n                /** @var int $k */\n                $k = ($i + $idx_shift + 1) & 1;\n                $limbs[$i] = (int) (\n                    (\n                        ((int) ($myLimbs[$j]) << $sub_shift)\n                            |\n                        ((int) ($myLimbs[$k]) >> (16 - $sub_shift))\n                    ) & 0xffff\n                );\n            }\n        }\n        return $return;\n    }\n\n    /**\n     * Rotate to the right\n     *\n     * @param int $c\n     * @return ParagonIE_Sodium_Core32_Int32\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArrayAccess\n     */\n    public function rotateRight($c = 0)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1);\n        /** @var int $c */\n        $c = (int) $c;\n\n        $return = new ParagonIE_Sodium_Core32_Int32();\n        $return->unsignedInt = $this->unsignedInt;\n        $c &= 31;\n        /** @var int $c */\n        if ($c === 0) {\n            // NOP, but we want a copy.\n            $return->limbs = $this->limbs;\n        } else {\n            /** @var int $c */\n\n            /** @var int $idx_shift */\n            $idx_shift = ($c >> 4) & 1;\n\n            /** @var int $sub_shift */\n            $sub_shift = $c & 15;\n\n            /** @var array<int, int> $limbs */\n            $limbs =& $return->limbs;\n\n            /** @var array<int, int> $myLimbs */\n            $myLimbs =& $this->limbs;\n\n            for ($i = 1; $i >= 0; --$i) {\n                /** @var int $j */\n                $j = ($i - $idx_shift) & 1;\n                /** @var int $k */\n                $k = ($i - $idx_shift - 1) & 1;\n                $limbs[$i] = (int) (\n                    (\n                        ((int) ($myLimbs[$j]) >> (int) ($sub_shift))\n                            |\n                        ((int) ($myLimbs[$k]) << (16 - (int) ($sub_shift)))\n                    ) & 0xffff\n                );\n            }\n        }\n        return $return;\n    }\n\n    /**\n     * @param bool $bool\n     * @return self\n     */\n    public function setUnsignedInt($bool = false)\n    {\n        $this->unsignedInt = !empty($bool);\n        return $this;\n    }\n\n    /**\n     * @param int $c\n     * @return ParagonIE_Sodium_Core32_Int32\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function shiftLeft($c = 0)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1);\n        /** @var int $c */\n        $c = (int) $c;\n\n        $return = new ParagonIE_Sodium_Core32_Int32();\n        $return->unsignedInt = $this->unsignedInt;\n        $c &= 63;\n        /** @var int $c */\n        if ($c === 0) {\n            $return->limbs = $this->limbs;\n        } elseif ($c < 0) {\n            /** @var int $c */\n            return $this->shiftRight(-$c);\n        } else {\n            /** @var int $c */\n            /** @var int $tmp */\n            $tmp = $this->limbs[1] << $c;\n            $return->limbs[1] = (int)($tmp & 0xffff);\n            /** @var int $carry */\n            $carry = $tmp >> 16;\n\n            /** @var int $tmp */\n            $tmp = ($this->limbs[0] << $c) | ($carry & 0xffff);\n            $return->limbs[0] = (int) ($tmp & 0xffff);\n        }\n        return $return;\n    }\n\n    /**\n     * @param int $c\n     * @return ParagonIE_Sodium_Core32_Int32\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedOperand\n     */\n    public function shiftRight($c = 0)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1);\n        /** @var int $c */\n        $c = (int) $c;\n\n        $return = new ParagonIE_Sodium_Core32_Int32();\n        $return->unsignedInt = $this->unsignedInt;\n        $c &= 63;\n        /** @var int $c */\n        if ($c >= 16) {\n            $return->limbs = array(\n                (int) ($this->overflow & 0xffff),\n                (int) ($this->limbs[0])\n            );\n            $return->overflow = $this->overflow >> 16;\n            return $return->shiftRight($c & 15);\n        }\n        if ($c === 0) {\n            $return->limbs = $this->limbs;\n        } elseif ($c < 0) {\n            /** @var int $c */\n            return $this->shiftLeft(-$c);\n        } else {\n            if (!is_int($c)) {\n                throw new TypeError();\n            }\n            /** @var int $c */\n            // $return->limbs[0] = (int) (($this->limbs[0] >> $c) & 0xffff);\n            $carryLeft = (int) ($this->overflow & ((1 << ($c + 1)) - 1));\n            $return->limbs[0] = (int) ((($this->limbs[0] >> $c) | ($carryLeft << (16 - $c))) & 0xffff);\n            $carryRight = (int) ($this->limbs[0] & ((1 << ($c + 1)) - 1));\n            $return->limbs[1] = (int) ((($this->limbs[1] >> $c) | ($carryRight << (16 - $c))) & 0xffff);\n            $return->overflow >>= $c;\n        }\n        return $return;\n    }\n\n    /**\n     * Subtract a normal integer from an int32 object.\n     *\n     * @param int $int\n     * @return ParagonIE_Sodium_Core32_Int32\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function subInt($int)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1);\n        /** @var int $int */\n        $int = (int) $int;\n\n        $return = new ParagonIE_Sodium_Core32_Int32();\n        $return->unsignedInt = $this->unsignedInt;\n\n        /** @var int $tmp */\n        $tmp = $this->limbs[1] - ($int & 0xffff);\n        /** @var int $carry */\n        $carry = $tmp >> 16;\n        $return->limbs[1] = (int) ($tmp & 0xffff);\n\n        /** @var int $tmp */\n        $tmp = $this->limbs[0] - (($int >> 16) & 0xffff) + $carry;\n        $return->limbs[0] = (int) ($tmp & 0xffff);\n        return $return;\n    }\n\n    /**\n     * Subtract two int32 objects from each other\n     *\n     * @param ParagonIE_Sodium_Core32_Int32 $b\n     * @return ParagonIE_Sodium_Core32_Int32\n     */\n    public function subInt32(ParagonIE_Sodium_Core32_Int32 $b)\n    {\n        $return = new ParagonIE_Sodium_Core32_Int32();\n        $return->unsignedInt = $this->unsignedInt;\n\n        /** @var int $tmp */\n        $tmp = $this->limbs[1] - ($b->limbs[1] & 0xffff);\n        /** @var int $carry */\n        $carry = $tmp >> 16;\n        $return->limbs[1] = (int) ($tmp & 0xffff);\n\n        /** @var int $tmp */\n        $tmp = $this->limbs[0] - ($b->limbs[0] & 0xffff) + $carry;\n        $return->limbs[0] = (int) ($tmp & 0xffff);\n        return $return;\n    }\n\n    /**\n     * XOR this 32-bit integer with another.\n     *\n     * @param ParagonIE_Sodium_Core32_Int32 $b\n     * @return ParagonIE_Sodium_Core32_Int32\n     */\n    public function xorInt32(ParagonIE_Sodium_Core32_Int32 $b)\n    {\n        $return = new ParagonIE_Sodium_Core32_Int32();\n        $return->unsignedInt = $this->unsignedInt;\n        $return->limbs = array(\n            (int) ($this->limbs[0] ^ $b->limbs[0]),\n            (int) ($this->limbs[1] ^ $b->limbs[1])\n        );\n        return $return;\n    }\n\n    /**\n     * @param int $signed\n     * @return self\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fromInt($signed)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($signed, 'int', 1);;\n        /** @var int $signed */\n        $signed = (int) $signed;\n\n        return new ParagonIE_Sodium_Core32_Int32(\n            array(\n                (int) (($signed >> 16) & 0xffff),\n                (int) ($signed & 0xffff)\n            )\n        );\n    }\n\n    /**\n     * @param string $string\n     * @return self\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fromString($string)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($string, 'string', 1);\n        $string = (string) $string;\n        if (ParagonIE_Sodium_Core32_Util::strlen($string) !== 4) {\n            throw new RangeException(\n                'String must be 4 bytes; ' . ParagonIE_Sodium_Core32_Util::strlen($string) . ' given.'\n            );\n        }\n        $return = new ParagonIE_Sodium_Core32_Int32();\n\n        $return->limbs[0]  = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[0]) & 0xff) << 8);\n        $return->limbs[0] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[1]) & 0xff);\n        $return->limbs[1]  = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[2]) & 0xff) << 8);\n        $return->limbs[1] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[3]) & 0xff);\n        return $return;\n    }\n\n    /**\n     * @param string $string\n     * @return self\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fromReverseString($string)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($string, 'string', 1);\n        $string = (string) $string;\n        if (ParagonIE_Sodium_Core32_Util::strlen($string) !== 4) {\n            throw new RangeException(\n                'String must be 4 bytes; ' . ParagonIE_Sodium_Core32_Util::strlen($string) . ' given.'\n            );\n        }\n        $return = new ParagonIE_Sodium_Core32_Int32();\n\n        $return->limbs[0]  = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[3]) & 0xff) << 8);\n        $return->limbs[0] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[2]) & 0xff);\n        $return->limbs[1]  = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[1]) & 0xff) << 8);\n        $return->limbs[1] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[0]) & 0xff);\n        return $return;\n    }\n\n    /**\n     * @return array<int, int>\n     */\n    public function toArray()\n    {\n        return array((int) ($this->limbs[0] << 16 | $this->limbs[1]));\n    }\n\n    /**\n     * @return string\n     * @throws TypeError\n     */\n    public function toString()\n    {\n        return\n            ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[0] >> 8) & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[0] & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[1] >> 8) & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[1] & 0xff);\n    }\n\n    /**\n     * @return int\n     */\n    public function toInt()\n    {\n        return (int) (\n            (($this->limbs[0] & 0xffff) << 16)\n                |\n            ($this->limbs[1] & 0xffff)\n        );\n    }\n\n    /**\n     * @return ParagonIE_Sodium_Core32_Int32\n     */\n    public function toInt32()\n    {\n        $return = new ParagonIE_Sodium_Core32_Int32();\n        $return->limbs[0] = (int) ($this->limbs[0] & 0xffff);\n        $return->limbs[1] = (int) ($this->limbs[1] & 0xffff);\n        $return->unsignedInt = $this->unsignedInt;\n        $return->overflow = (int) ($this->overflow & 0x7fffffff);\n        return $return;\n    }\n\n    /**\n     * @return ParagonIE_Sodium_Core32_Int64\n     */\n    public function toInt64()\n    {\n        $return = new ParagonIE_Sodium_Core32_Int64();\n        $return->unsignedInt = $this->unsignedInt;\n        if ($this->unsignedInt) {\n            $return->limbs[0] += (($this->overflow >> 16) & 0xffff);\n            $return->limbs[1] += (($this->overflow) & 0xffff);\n        } else {\n            $neg = -(($this->limbs[0] >> 15) & 1);\n            $return->limbs[0] = (int)($neg & 0xffff);\n            $return->limbs[1] = (int)($neg & 0xffff);\n        }\n        $return->limbs[2] = (int) ($this->limbs[0] & 0xffff);\n        $return->limbs[3] = (int) ($this->limbs[1] & 0xffff);\n        return $return;\n    }\n\n    /**\n     * @return string\n     * @throws TypeError\n     */\n    public function toReverseString()\n    {\n        return ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[1] & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[1] >> 8) & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[0] & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[0] >> 8) & 0xff);\n    }\n\n    /**\n     * @return string\n     */\n    public function __toString()\n    {\n        try {\n            return $this->toString();\n        } catch (TypeError $ex) {\n            // PHP engine can't handle exceptions from __toString()\n            return '';\n        }\n    }\n}\n", "num_lines": 872}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * Class ParagonIE_Sodium_Core32_Int64\n *\n * Encapsulates a 64-bit integer.\n *\n * These are immutable. It always returns a new instance.\n */\nclass ParagonIE_Sodium_Core32_Int64\n{\n    /**\n     * @var array<int, int> - four 16-bit integers\n     */\n    public $limbs = array(0, 0, 0, 0);\n\n    /**\n     * @var int\n     */\n    public $overflow = 0;\n\n    /**\n     * @var bool\n     */\n    public $unsignedInt = false;\n\n    /**\n     * ParagonIE_Sodium_Core32_Int64 constructor.\n     * @param array $array\n     * @param bool $unsignedInt\n     */\n    public function __construct($array = array(0, 0, 0, 0), $unsignedInt = false)\n    {\n        $this->limbs = array(\n            (int) $array[0],\n            (int) $array[1],\n            (int) $array[2],\n            (int) $array[3]\n        );\n        $this->overflow = 0;\n        $this->unsignedInt = $unsignedInt;\n    }\n\n    /**\n     * Adds two int64 objects\n     *\n     * @param ParagonIE_Sodium_Core32_Int64 $addend\n     * @return ParagonIE_Sodium_Core32_Int64\n     */\n    public function addInt64(ParagonIE_Sodium_Core32_Int64 $addend)\n    {\n        $i0 = $this->limbs[0];\n        $i1 = $this->limbs[1];\n        $i2 = $this->limbs[2];\n        $i3 = $this->limbs[3];\n        $j0 = $addend->limbs[0];\n        $j1 = $addend->limbs[1];\n        $j2 = $addend->limbs[2];\n        $j3 = $addend->limbs[3];\n\n        $r3 = $i3 + ($j3 & 0xffff);\n        $carry = $r3 >> 16;\n\n        $r2 = $i2 + ($j2 & 0xffff) + $carry;\n        $carry = $r2 >> 16;\n\n        $r1 = $i1 + ($j1 & 0xffff) + $carry;\n        $carry = $r1 >> 16;\n\n        $r0 = $i0 + ($j0 & 0xffff) + $carry;\n        $carry = $r0 >> 16;\n\n        $r0 &= 0xffff;\n        $r1 &= 0xffff;\n        $r2 &= 0xffff;\n        $r3 &= 0xffff;\n\n        $return = new ParagonIE_Sodium_Core32_Int64(\n            array($r0, $r1, $r2, $r3)\n        );\n        $return->overflow = $carry;\n        $return->unsignedInt = $this->unsignedInt;\n        return $return;\n    }\n\n    /**\n     * Adds a normal integer to an int64 object\n     *\n     * @param int $int\n     * @return ParagonIE_Sodium_Core32_Int64\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function addInt($int)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1);\n        /** @var int $int */\n        $int = (int) $int;\n\n        $i0 = $this->limbs[0];\n        $i1 = $this->limbs[1];\n        $i2 = $this->limbs[2];\n        $i3 = $this->limbs[3];\n\n        $r3 = $i3 + ($int & 0xffff);\n        $carry = $r3 >> 16;\n\n        $r2 = $i2 + (($int >> 16) & 0xffff) + $carry;\n        $carry = $r2 >> 16;\n\n        $r1 = $i1 + $carry;\n        $carry = $r1 >> 16;\n\n        $r0 = $i0 + $carry;\n        $carry = $r0 >> 16;\n\n        $r0 &= 0xffff;\n        $r1 &= 0xffff;\n        $r2 &= 0xffff;\n        $r3 &= 0xffff;\n        $return = new ParagonIE_Sodium_Core32_Int64(\n            array($r0, $r1, $r2, $r3)\n        );\n        $return->overflow = $carry;\n        $return->unsignedInt = $this->unsignedInt;\n        return $return;\n    }\n\n    /**\n     * @param int $b\n     * @return int\n     */\n    public function compareInt($b = 0)\n    {\n        $gt = 0;\n        $eq = 1;\n\n        $i = 4;\n        $j = 0;\n        while ($i > 0) {\n            --$i;\n            /** @var int $x1 */\n            $x1 = $this->limbs[$i];\n            /** @var int $x2 */\n            $x2 = ($b >> ($j << 4)) & 0xffff;\n            /** int */\n            $gt |= (($x2 - $x1) >> 8) & $eq;\n            /** int */\n            $eq &= (($x2 ^ $x1) - 1) >> 8;\n        }\n        return ($gt + $gt - $eq) + 1;\n    }\n\n    /**\n     * @param int $b\n     * @return bool\n     */\n    public function isGreaterThan($b = 0)\n    {\n        return $this->compareInt($b) > 0;\n    }\n\n    /**\n     * @param int $b\n     * @return bool\n     */\n    public function isLessThanInt($b = 0)\n    {\n        return $this->compareInt($b) < 0;\n    }\n\n    /**\n     * @param int $hi\n     * @param int $lo\n     * @return ParagonIE_Sodium_Core32_Int64\n     */\n    public function mask64($hi = 0, $lo = 0)\n    {\n        /** @var int $a */\n        $a = ($hi >> 16) & 0xffff;\n        /** @var int $b */\n        $b = ($hi) & 0xffff;\n        /** @var int $c */\n        $c = ($lo >> 16) & 0xffff;\n        /** @var int $d */\n        $d = ($lo & 0xffff);\n        return new ParagonIE_Sodium_Core32_Int64(\n            array(\n                $this->limbs[0] & $a,\n                $this->limbs[1] & $b,\n                $this->limbs[2] & $c,\n                $this->limbs[3] & $d\n            ),\n            $this->unsignedInt\n        );\n    }\n\n    /**\n     * @param int $int\n     * @param int $size\n     * @return ParagonIE_Sodium_Core32_Int64\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedAssignment\n     */\n    public function mulInt($int = 0, $size = 0)\n    {\n        if (ParagonIE_Sodium_Compat::$fastMult) {\n            return $this->mulIntFast($int);\n        }\n        ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1);\n        ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2);\n        /** @var int $int */\n        $int = (int) $int;\n        /** @var int $size */\n        $size = (int) $size;\n\n        if (!$size) {\n            $size = 63;\n        }\n\n        $a = clone $this;\n        $return = new ParagonIE_Sodium_Core32_Int64();\n        $return->unsignedInt = $this->unsignedInt;\n\n        // Initialize:\n        $ret0 = 0;\n        $ret1 = 0;\n        $ret2 = 0;\n        $ret3 = 0;\n        $a0 = $a->limbs[0];\n        $a1 = $a->limbs[1];\n        $a2 = $a->limbs[2];\n        $a3 = $a->limbs[3];\n\n        /** @var int $size */\n        /** @var int $i */\n        for ($i = $size; $i >= 0; --$i) {\n            $mask = -($int & 1);\n            $x0 = $a0 & $mask;\n            $x1 = $a1 & $mask;\n            $x2 = $a2 & $mask;\n            $x3 = $a3 & $mask;\n\n            $ret3 += $x3;\n            $c = $ret3 >> 16;\n\n            $ret2 += $x2 + $c;\n            $c = $ret2 >> 16;\n\n            $ret1 += $x1 + $c;\n            $c = $ret1 >> 16;\n\n            $ret0 += $x0 + $c;\n\n            $ret0 &= 0xffff;\n            $ret1 &= 0xffff;\n            $ret2 &= 0xffff;\n            $ret3 &= 0xffff;\n\n            $a3 = $a3 << 1;\n            $x3 = $a3 >> 16;\n            $a2 = ($a2 << 1) | $x3;\n            $x2 = $a2 >> 16;\n            $a1 = ($a1 << 1) | $x2;\n            $x1 = $a1 >> 16;\n            $a0 = ($a0 << 1) | $x1;\n            $a0 &= 0xffff;\n            $a1 &= 0xffff;\n            $a2 &= 0xffff;\n            $a3 &= 0xffff;\n\n            $int >>= 1;\n        }\n        $return->limbs[0] = $ret0;\n        $return->limbs[1] = $ret1;\n        $return->limbs[2] = $ret2;\n        $return->limbs[3] = $ret3;\n        return $return;\n    }\n\n    /**\n     * @param ParagonIE_Sodium_Core32_Int64 $A\n     * @param ParagonIE_Sodium_Core32_Int64 $B\n     * @return array<int, ParagonIE_Sodium_Core32_Int64>\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedInferredReturnType\n     */\n    public static function ctSelect(\n        ParagonIE_Sodium_Core32_Int64 $A,\n        ParagonIE_Sodium_Core32_Int64 $B\n    ) {\n        $a = clone $A;\n        $b = clone $B;\n        /** @var int $aNeg */\n        $aNeg = ($a->limbs[0] >> 15) & 1;\n        /** @var int $bNeg */\n        $bNeg = ($b->limbs[0] >> 15) & 1;\n        /** @var int $m */\n        $m = (-($aNeg & $bNeg)) | 1;\n        /** @var int $swap */\n        $swap = $bNeg & ~$aNeg;\n        /** @var int $d */\n        $d = -$swap;\n\n        /*\n        if ($bNeg && !$aNeg) {\n            $a = clone $int;\n            $b = clone $this;\n        } elseif($bNeg && $aNeg) {\n            $a = $this->mulInt(-1);\n            $b = $int->mulInt(-1);\n        }\n         */\n        $x = $a->xorInt64($b)->mask64($d, $d);\n        return array(\n            $a->xorInt64($x)->mulInt($m),\n            $b->xorInt64($x)->mulInt($m)\n        );\n    }\n\n    /**\n     * @param array<int, int> $a\n     * @param array<int, int> $b\n     * @param int $baseLog2\n     * @return array<int, int>\n     */\n    public function multiplyLong(array $a, array $b, $baseLog2 = 16)\n    {\n        $a_l = count($a);\n        $b_l = count($b);\n        /** @var array<int, int> $r */\n        $r = array_fill(0, $a_l + $b_l + 1, 0);\n        $base = 1 << $baseLog2;\n        for ($i = 0; $i < $a_l; ++$i) {\n            $a_i = $a[$i];\n            for ($j = 0; $j < $a_l; ++$j) {\n                $b_j = $b[$j];\n                $product = ($a_i * $b_j) + $r[$i + $j];\n                $carry = ($product >> $baseLog2 & 0xffff);\n                $r[$i + $j] = ($product - (int) ($carry * $base)) & 0xffff;\n                $r[$i + $j + 1] += $carry;\n            }\n        }\n        return array_slice($r, 0, 5);\n    }\n\n    /**\n     * @param int $int\n     * @return ParagonIE_Sodium_Core32_Int64\n     */\n    public function mulIntFast($int)\n    {\n        // Handle negative numbers\n        $aNeg = ($this->limbs[0] >> 15) & 1;\n        $bNeg = ($int >> 31) & 1;\n        $a = array_reverse($this->limbs);\n        $b = array(\n            $int & 0xffff,\n            ($int >> 16) & 0xffff,\n            -$bNeg & 0xffff,\n            -$bNeg & 0xffff\n        );\n        if ($aNeg) {\n            for ($i = 0; $i < 4; ++$i) {\n                $a[$i] = ($a[$i] ^ 0xffff) & 0xffff;\n            }\n            ++$a[0];\n        }\n        if ($bNeg) {\n            for ($i = 0; $i < 4; ++$i) {\n                $b[$i] = ($b[$i] ^ 0xffff) & 0xffff;\n            }\n            ++$b[0];\n        }\n        // Multiply\n        $res = $this->multiplyLong($a, $b);\n\n        // Re-apply negation to results\n        if ($aNeg !== $bNeg) {\n            for ($i = 0; $i < 4; ++$i) {\n                $res[$i] = (0xffff ^ $res[$i]) & 0xffff;\n            }\n            // Handle integer overflow\n            $c = 1;\n            for ($i = 0; $i < 4; ++$i) {\n                $res[$i] += $c;\n                $c = $res[$i] >> 16;\n                $res[$i] &= 0xffff;\n            }\n        }\n\n        // Return our values\n        $return = new ParagonIE_Sodium_Core32_Int64();\n        $return->limbs = array(\n            $res[3] & 0xffff,\n            $res[2] & 0xffff,\n            $res[1] & 0xffff,\n            $res[0] & 0xffff\n        );\n        if (count($res) > 4) {\n            $return->overflow = $res[4] & 0xffff;\n        }\n        $return->unsignedInt = $this->unsignedInt;\n        return $return;\n    }\n\n    /**\n     * @param ParagonIE_Sodium_Core32_Int64 $right\n     * @return ParagonIE_Sodium_Core32_Int64\n     */\n    public function mulInt64Fast(ParagonIE_Sodium_Core32_Int64 $right)\n    {\n        $aNeg = ($this->limbs[0] >> 15) & 1;\n        $bNeg = ($right->limbs[0] >> 15) & 1;\n\n        $a = array_reverse($this->limbs);\n        $b = array_reverse($right->limbs);\n        if ($aNeg) {\n            for ($i = 0; $i < 4; ++$i) {\n                $a[$i] = ($a[$i] ^ 0xffff) & 0xffff;\n            }\n            ++$a[0];\n        }\n        if ($bNeg) {\n            for ($i = 0; $i < 4; ++$i) {\n                $b[$i] = ($b[$i] ^ 0xffff) & 0xffff;\n            }\n            ++$b[0];\n        }\n        $res = $this->multiplyLong($a, $b);\n        if ($aNeg !== $bNeg) {\n            if ($aNeg !== $bNeg) {\n                for ($i = 0; $i < 4; ++$i) {\n                    $res[$i] = ($res[$i] ^ 0xffff) & 0xffff;\n                }\n                $c = 1;\n                for ($i = 0; $i < 4; ++$i) {\n                    $res[$i] += $c;\n                    $c = $res[$i] >> 16;\n                    $res[$i] &= 0xffff;\n                }\n            }\n        }\n        $return = new ParagonIE_Sodium_Core32_Int64();\n        $return->limbs = array(\n            $res[3] & 0xffff,\n            $res[2] & 0xffff,\n            $res[1] & 0xffff,\n            $res[0] & 0xffff\n        );\n        if (count($res) > 4) {\n            $return->overflow = $res[4];\n        }\n        return $return;\n    }\n\n    /**\n     * @param ParagonIE_Sodium_Core32_Int64 $int\n     * @param int $size\n     * @return ParagonIE_Sodium_Core32_Int64\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedAssignment\n     */\n    public function mulInt64(ParagonIE_Sodium_Core32_Int64 $int, $size = 0)\n    {\n        if (ParagonIE_Sodium_Compat::$fastMult) {\n            return $this->mulInt64Fast($int);\n        }\n        ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2);\n        if (!$size) {\n            $size = 63;\n        }\n        list($a, $b) = self::ctSelect($this, $int);\n\n        $return = new ParagonIE_Sodium_Core32_Int64();\n        $return->unsignedInt = $this->unsignedInt;\n\n        // Initialize:\n        $ret0 = 0;\n        $ret1 = 0;\n        $ret2 = 0;\n        $ret3 = 0;\n        $a0 = $a->limbs[0];\n        $a1 = $a->limbs[1];\n        $a2 = $a->limbs[2];\n        $a3 = $a->limbs[3];\n        $b0 = $b->limbs[0];\n        $b1 = $b->limbs[1];\n        $b2 = $b->limbs[2];\n        $b3 = $b->limbs[3];\n\n        /** @var int $size */\n        /** @var int $i */\n        for ($i = (int) $size; $i >= 0; --$i) {\n            $mask = -($b3 & 1);\n            $x0 = $a0 & $mask;\n            $x1 = $a1 & $mask;\n            $x2 = $a2 & $mask;\n            $x3 = $a3 & $mask;\n\n            $ret3 += $x3;\n            $c = $ret3 >> 16;\n\n            $ret2 += $x2 + $c;\n            $c = $ret2 >> 16;\n\n            $ret1 += $x1 + $c;\n            $c = $ret1 >> 16;\n\n            $ret0 += $x0 + $c;\n\n            $ret0 &= 0xffff;\n            $ret1 &= 0xffff;\n            $ret2 &= 0xffff;\n            $ret3 &= 0xffff;\n\n            $a3 = $a3 << 1;\n            $x3 = $a3 >> 16;\n            $a2 = ($a2 << 1) | $x3;\n            $x2 = $a2 >> 16;\n            $a1 = ($a1 << 1) | $x2;\n            $x1 = $a1 >> 16;\n            $a0 = ($a0 << 1) | $x1;\n            $a0 &= 0xffff;\n            $a1 &= 0xffff;\n            $a2 &= 0xffff;\n            $a3 &= 0xffff;\n\n            $x0 = ($b0 & 1) << 16;\n            $x1 = ($b1 & 1) << 16;\n            $x2 = ($b2 & 1) << 16;\n\n            $b0 = ($b0 >> 1);\n            $b1 = (($b1 | $x0) >> 1);\n            $b2 = (($b2 | $x1) >> 1);\n            $b3 = (($b3 | $x2) >> 1);\n\n            $b0 &= 0xffff;\n            $b1 &= 0xffff;\n            $b2 &= 0xffff;\n            $b3 &= 0xffff;\n\n        }\n        $return->limbs[0] = $ret0;\n        $return->limbs[1] = $ret1;\n        $return->limbs[2] = $ret2;\n        $return->limbs[3] = $ret3;\n\n        return $return;\n    }\n\n    /**\n     * OR this 64-bit integer with another.\n     *\n     * @param ParagonIE_Sodium_Core32_Int64 $b\n     * @return ParagonIE_Sodium_Core32_Int64\n     */\n    public function orInt64(ParagonIE_Sodium_Core32_Int64 $b)\n    {\n        $return = new ParagonIE_Sodium_Core32_Int64();\n        $return->unsignedInt = $this->unsignedInt;\n        $return->limbs = array(\n            (int) ($this->limbs[0] | $b->limbs[0]),\n            (int) ($this->limbs[1] | $b->limbs[1]),\n            (int) ($this->limbs[2] | $b->limbs[2]),\n            (int) ($this->limbs[3] | $b->limbs[3])\n        );\n        return $return;\n    }\n\n    /**\n     * @param int $c\n     * @return ParagonIE_Sodium_Core32_Int64\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArrayAccess\n     */\n    public function rotateLeft($c = 0)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1);\n        /** @var int $c */\n        $c = (int) $c;\n\n        $return = new ParagonIE_Sodium_Core32_Int64();\n        $return->unsignedInt = $this->unsignedInt;\n        $c &= 63;\n        if ($c === 0) {\n            // NOP, but we want a copy.\n            $return->limbs = $this->limbs;\n        } else {\n            /** @var array<int, int> $limbs */\n            $limbs =& $return->limbs;\n\n            /** @var array<int, int> $myLimbs */\n            $myLimbs =& $this->limbs;\n\n            /** @var int $idx_shift */\n            $idx_shift = ($c >> 4) & 3;\n            /** @var int $sub_shift */\n            $sub_shift = $c & 15;\n\n            for ($i = 3; $i >= 0; --$i) {\n                /** @var int $j */\n                $j = ($i + $idx_shift) & 3;\n                /** @var int $k */\n                $k = ($i + $idx_shift + 1) & 3;\n                $limbs[$i] = (int) (\n                    (\n                        ((int) ($myLimbs[$j]) << $sub_shift)\n                            |\n                        ((int) ($myLimbs[$k]) >> (16 - $sub_shift))\n                    ) & 0xffff\n                );\n            }\n        }\n        return $return;\n    }\n\n    /**\n     * Rotate to the right\n     *\n     * @param int $c\n     * @return ParagonIE_Sodium_Core32_Int64\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedArrayAccess\n     */\n    public function rotateRight($c = 0)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1);\n        /** @var int $c */\n        $c = (int) $c;\n\n        /** @var ParagonIE_Sodium_Core32_Int64 $return */\n        $return = new ParagonIE_Sodium_Core32_Int64();\n        $return->unsignedInt = $this->unsignedInt;\n        $c &= 63;\n        /** @var int $c */\n        if ($c === 0) {\n            // NOP, but we want a copy.\n            $return->limbs = $this->limbs;\n        } else {\n            /** @var array<int, int> $limbs */\n            $limbs =& $return->limbs;\n\n            /** @var array<int, int> $myLimbs */\n            $myLimbs =& $this->limbs;\n\n            /** @var int $idx_shift */\n            $idx_shift = ($c >> 4) & 3;\n            /** @var int $sub_shift */\n            $sub_shift = $c & 15;\n\n            for ($i = 3; $i >= 0; --$i) {\n                /** @var int $j */\n                $j = ($i - $idx_shift) & 3;\n                /** @var int $k */\n                $k = ($i - $idx_shift - 1) & 3;\n                $limbs[$i] = (int) (\n                    (\n                        ((int) ($myLimbs[$j]) >> (int) ($sub_shift))\n                            |\n                        ((int) ($myLimbs[$k]) << (16 - (int) ($sub_shift)))\n                    ) & 0xffff\n                );\n            }\n        }\n        return $return;\n    }\n    /**\n     * @param int $c\n     * @return ParagonIE_Sodium_Core32_Int64\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function shiftLeft($c = 0)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1);\n        /** @var int $c */\n        $c = (int) $c;\n\n        $return = new ParagonIE_Sodium_Core32_Int64();\n        $return->unsignedInt = $this->unsignedInt;\n        $c &= 63;\n\n        if ($c >= 16) {\n            if ($c >= 48) {\n                $return->limbs = array(\n                    $this->limbs[3], 0, 0, 0\n                );\n            } elseif ($c >= 32) {\n                $return->limbs = array(\n                    $this->limbs[2], $this->limbs[3], 0, 0\n                );\n            } else {\n                $return->limbs = array(\n                    $this->limbs[1], $this->limbs[2], $this->limbs[3], 0\n                );\n            }\n            return $return->shiftLeft($c & 15);\n        }\n        if ($c === 0) {\n            $return->limbs = $this->limbs;\n        } elseif ($c < 0) {\n            /** @var int $c */\n            return $this->shiftRight(-$c);\n        } else {\n            if (!is_int($c)) {\n                throw new TypeError();\n            }\n            /** @var int $carry */\n            $carry = 0;\n            for ($i = 3; $i >= 0; --$i) {\n                /** @var int $tmp */\n                $tmp = ($this->limbs[$i] << $c) | ($carry & 0xffff);\n                $return->limbs[$i] = (int) ($tmp & 0xffff);\n                /** @var int $carry */\n                $carry = $tmp >> 16;\n            }\n        }\n        return $return;\n    }\n\n    /**\n     * @param int $c\n     * @return ParagonIE_Sodium_Core32_Int64\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function shiftRight($c = 0)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1);\n        $c = (int) $c;\n        /** @var int $c */\n        $return = new ParagonIE_Sodium_Core32_Int64();\n        $return->unsignedInt = $this->unsignedInt;\n        $c &= 63;\n\n        $negative = -(($this->limbs[0] >> 15) & 1);\n        if ($c >= 16) {\n            if ($c >= 48) {\n                $return->limbs = array(\n                    (int) ($negative & 0xffff),\n                    (int) ($negative & 0xffff),\n                    (int) ($negative & 0xffff),\n                    (int) $this->limbs[0]\n                );\n            } elseif ($c >= 32) {\n                $return->limbs = array(\n                    (int) ($negative & 0xffff),\n                    (int) ($negative & 0xffff),\n                    (int) $this->limbs[0],\n                    (int) $this->limbs[1]\n                );\n            } else {\n                $return->limbs = array(\n                    (int) ($negative & 0xffff),\n                    (int) $this->limbs[0],\n                    (int) $this->limbs[1],\n                    (int) $this->limbs[2]\n                );\n            }\n            return $return->shiftRight($c & 15);\n        }\n\n        if ($c === 0) {\n            $return->limbs = $this->limbs;\n        } elseif ($c < 0) {\n            return $this->shiftLeft(-$c);\n        } else {\n            if (!is_int($c)) {\n                throw new TypeError();\n            }\n            /** @var int $carryRight */\n            $carryRight = ($negative & 0xffff);\n            $mask = (int) (((1 << ($c + 1)) - 1) & 0xffff);\n            for ($i = 0; $i < 4; ++$i) {\n                $return->limbs[$i] = (int) (\n                    (($this->limbs[$i] >> $c) | ($carryRight << (16 - $c))) & 0xffff\n                );\n                $carryRight = (int) ($this->limbs[$i] & $mask);\n            }\n        }\n        return $return;\n    }\n\n\n    /**\n     * Subtract a normal integer from an int64 object.\n     *\n     * @param int $int\n     * @return ParagonIE_Sodium_Core32_Int64\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function subInt($int)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1);\n        $int = (int) $int;\n\n        $return = new ParagonIE_Sodium_Core32_Int64();\n        $return->unsignedInt = $this->unsignedInt;\n\n        /** @var int $carry */\n        $carry = 0;\n        for ($i = 3; $i >= 0; --$i) {\n            /** @var int $tmp */\n            $tmp = $this->limbs[$i] - (($int >> 16) & 0xffff) + $carry;\n            /** @var int $carry */\n            $carry = $tmp >> 16;\n            $return->limbs[$i] = (int) ($tmp & 0xffff);\n        }\n        return $return;\n    }\n\n    /**\n     * The difference between two Int64 objects.\n     *\n     * @param ParagonIE_Sodium_Core32_Int64 $b\n     * @return ParagonIE_Sodium_Core32_Int64\n     */\n    public function subInt64(ParagonIE_Sodium_Core32_Int64 $b)\n    {\n        $return = new ParagonIE_Sodium_Core32_Int64();\n        $return->unsignedInt = $this->unsignedInt;\n        /** @var int $carry */\n        $carry = 0;\n        for ($i = 3; $i >= 0; --$i) {\n            /** @var int $tmp */\n            $tmp = $this->limbs[$i] - $b->limbs[$i] + $carry;\n            /** @var int $carry */\n            $carry = ($tmp >> 16);\n            $return->limbs[$i] = (int) ($tmp & 0xffff);\n        }\n        return $return;\n    }\n\n    /**\n     * XOR this 64-bit integer with another.\n     *\n     * @param ParagonIE_Sodium_Core32_Int64 $b\n     * @return ParagonIE_Sodium_Core32_Int64\n     */\n    public function xorInt64(ParagonIE_Sodium_Core32_Int64 $b)\n    {\n        $return = new ParagonIE_Sodium_Core32_Int64();\n        $return->unsignedInt = $this->unsignedInt;\n        $return->limbs = array(\n            (int) ($this->limbs[0] ^ $b->limbs[0]),\n            (int) ($this->limbs[1] ^ $b->limbs[1]),\n            (int) ($this->limbs[2] ^ $b->limbs[2]),\n            (int) ($this->limbs[3] ^ $b->limbs[3])\n        );\n        return $return;\n    }\n\n    /**\n     * @param int $low\n     * @param int $high\n     * @return self\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fromInts($low, $high)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($low, 'int', 1);\n        ParagonIE_Sodium_Core32_Util::declareScalarType($high, 'int', 2);\n\n        $high = (int) $high;\n        $low = (int) $low;\n        return new ParagonIE_Sodium_Core32_Int64(\n            array(\n                (int) (($high >> 16) & 0xffff),\n                (int) ($high & 0xffff),\n                (int) (($low >> 16) & 0xffff),\n                (int) ($low & 0xffff)\n            )\n        );\n    }\n\n    /**\n     * @param int $low\n     * @return self\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fromInt($low)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($low, 'int', 1);\n        $low = (int) $low;\n\n        return new ParagonIE_Sodium_Core32_Int64(\n            array(\n                0,\n                0,\n                (int) (($low >> 16) & 0xffff),\n                (int) ($low & 0xffff)\n            )\n        );\n    }\n\n    /**\n     * @return int\n     */\n    public function toInt()\n    {\n        return (int) (\n            (($this->limbs[2] & 0xffff) << 16)\n                |\n            ($this->limbs[3] & 0xffff)\n        );\n    }\n\n    /**\n     * @param string $string\n     * @return self\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fromString($string)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($string, 'string', 1);\n        $string = (string) $string;\n        if (ParagonIE_Sodium_Core32_Util::strlen($string) !== 8) {\n            throw new RangeException(\n                'String must be 8 bytes; ' . ParagonIE_Sodium_Core32_Util::strlen($string) . ' given.'\n            );\n        }\n        $return = new ParagonIE_Sodium_Core32_Int64();\n\n        $return->limbs[0]  = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[0]) & 0xff) << 8);\n        $return->limbs[0] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[1]) & 0xff);\n        $return->limbs[1]  = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[2]) & 0xff) << 8);\n        $return->limbs[1] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[3]) & 0xff);\n        $return->limbs[2]  = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[4]) & 0xff) << 8);\n        $return->limbs[2] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[5]) & 0xff);\n        $return->limbs[3]  = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[6]) & 0xff) << 8);\n        $return->limbs[3] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[7]) & 0xff);\n        return $return;\n    }\n\n    /**\n     * @param string $string\n     * @return self\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fromReverseString($string)\n    {\n        ParagonIE_Sodium_Core32_Util::declareScalarType($string, 'string', 1);\n        $string = (string) $string;\n        if (ParagonIE_Sodium_Core32_Util::strlen($string) !== 8) {\n            throw new RangeException(\n                'String must be 8 bytes; ' . ParagonIE_Sodium_Core32_Util::strlen($string) . ' given.'\n            );\n        }\n        $return = new ParagonIE_Sodium_Core32_Int64();\n\n        $return->limbs[0]  = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[7]) & 0xff) << 8);\n        $return->limbs[0] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[6]) & 0xff);\n        $return->limbs[1]  = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[5]) & 0xff) << 8);\n        $return->limbs[1] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[4]) & 0xff);\n        $return->limbs[2]  = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[3]) & 0xff) << 8);\n        $return->limbs[2] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[2]) & 0xff);\n        $return->limbs[3]  = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[1]) & 0xff) << 8);\n        $return->limbs[3] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[0]) & 0xff);\n        return $return;\n    }\n\n    /**\n     * @return array<int, int>\n     */\n    public function toArray()\n    {\n        return array(\n            (int) ((($this->limbs[0] & 0xffff) << 16) | ($this->limbs[1] & 0xffff)),\n            (int) ((($this->limbs[2] & 0xffff) << 16) | ($this->limbs[3] & 0xffff))\n        );\n    }\n\n    /**\n     * @return ParagonIE_Sodium_Core32_Int32\n     */\n    public function toInt32()\n    {\n        $return = new ParagonIE_Sodium_Core32_Int32();\n        $return->limbs[0] = (int) ($this->limbs[2]);\n        $return->limbs[1] = (int) ($this->limbs[3]);\n        $return->unsignedInt = $this->unsignedInt;\n        $return->overflow = (int) (ParagonIE_Sodium_Core32_Util::abs($this->limbs[1], 16) & 0xffff);\n        return $return;\n    }\n\n    /**\n     * @return ParagonIE_Sodium_Core32_Int64\n     */\n    public function toInt64()\n    {\n        $return = new ParagonIE_Sodium_Core32_Int64();\n        $return->limbs[0] = (int) ($this->limbs[0]);\n        $return->limbs[1] = (int) ($this->limbs[1]);\n        $return->limbs[2] = (int) ($this->limbs[2]);\n        $return->limbs[3] = (int) ($this->limbs[3]);\n        $return->unsignedInt = $this->unsignedInt;\n        $return->overflow = ParagonIE_Sodium_Core32_Util::abs($this->overflow);\n        return $return;\n    }\n\n    /**\n     * @param bool $bool\n     * @return self\n     */\n    public function setUnsignedInt($bool = false)\n    {\n        $this->unsignedInt = !empty($bool);\n        return $this;\n    }\n\n    /**\n     * @return string\n     * @throws TypeError\n     */\n    public function toString()\n    {\n        return ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[0] >> 8) & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[0] & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[1] >> 8) & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[1] & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[2] >> 8) & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[2] & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[3] >> 8) & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[3] & 0xff);\n    }\n\n    /**\n     * @return string\n     * @throws TypeError\n     */\n    public function toReverseString()\n    {\n        return ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[3] & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[3] >> 8) & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[2] & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[2] >> 8) & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[1] & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[1] >> 8) & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[0] & 0xff) .\n            ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[0] >> 8) & 0xff);\n    }\n\n    /**\n     * @return string\n     */\n    public function __toString()\n    {\n        try {\n            return $this->toString();\n        } catch (TypeError $ex) {\n            // PHP engine can't handle exceptions from __toString()\n            return '';\n        }\n    }\n}\n", "num_lines": 1067}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_Poly1305', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_Poly1305\n */\nabstract class ParagonIE_Sodium_Core32_Poly1305 extends ParagonIE_Sodium_Core32_Util\n{\n    const BLOCK_SIZE = 16;\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $m\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function onetimeauth($m, $key)\n    {\n        if (self::strlen($key) < 32) {\n            throw new InvalidArgumentException(\n                'Key must be 32 bytes long.'\n            );\n        }\n        $state = new ParagonIE_Sodium_Core32_Poly1305_State(\n            self::substr($key, 0, 32)\n        );\n        return $state\n            ->update($m)\n            ->finish();\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $mac\n     * @param string $m\n     * @param string $key\n     * @return bool\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function onetimeauth_verify($mac, $m, $key)\n    {\n        if (self::strlen($key) < 32) {\n            throw new InvalidArgumentException(\n                'Key must be 32 bytes long.'\n            );\n        }\n        $state = new ParagonIE_Sodium_Core32_Poly1305_State(\n            self::substr($key, 0, 32)\n        );\n        $calc = $state\n            ->update($m)\n            ->finish();\n        return self::verify_16($calc, $mac);\n    }\n}\n", "num_lines": 64}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_Salsa20', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_Salsa20\n */\nabstract class ParagonIE_Sodium_Core32_Salsa20 extends ParagonIE_Sodium_Core32_Util\n{\n    const ROUNDS = 20;\n\n    /**\n     * Calculate an salsa20 hash of a single block\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $in\n     * @param string $k\n     * @param string|null $c\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function core_salsa20($in, $k, $c = null)\n    {\n        /**\n         * @var ParagonIE_Sodium_Core32_Int32 $x0\n         * @var ParagonIE_Sodium_Core32_Int32 $x1\n         * @var ParagonIE_Sodium_Core32_Int32 $x2\n         * @var ParagonIE_Sodium_Core32_Int32 $x3\n         * @var ParagonIE_Sodium_Core32_Int32 $x4\n         * @var ParagonIE_Sodium_Core32_Int32 $x5\n         * @var ParagonIE_Sodium_Core32_Int32 $x6\n         * @var ParagonIE_Sodium_Core32_Int32 $x7\n         * @var ParagonIE_Sodium_Core32_Int32 $x8\n         * @var ParagonIE_Sodium_Core32_Int32 $x9\n         * @var ParagonIE_Sodium_Core32_Int32 $x10\n         * @var ParagonIE_Sodium_Core32_Int32 $x11\n         * @var ParagonIE_Sodium_Core32_Int32 $x12\n         * @var ParagonIE_Sodium_Core32_Int32 $x13\n         * @var ParagonIE_Sodium_Core32_Int32 $x14\n         * @var ParagonIE_Sodium_Core32_Int32 $x15\n         * @var ParagonIE_Sodium_Core32_Int32 $j0\n         * @var ParagonIE_Sodium_Core32_Int32 $j1\n         * @var ParagonIE_Sodium_Core32_Int32 $j2\n         * @var ParagonIE_Sodium_Core32_Int32 $j3\n         * @var ParagonIE_Sodium_Core32_Int32 $j4\n         * @var ParagonIE_Sodium_Core32_Int32 $j5\n         * @var ParagonIE_Sodium_Core32_Int32 $j6\n         * @var ParagonIE_Sodium_Core32_Int32 $j7\n         * @var ParagonIE_Sodium_Core32_Int32 $j8\n         * @var ParagonIE_Sodium_Core32_Int32 $j9\n         * @var ParagonIE_Sodium_Core32_Int32 $j10\n         * @var ParagonIE_Sodium_Core32_Int32 $j11\n         * @var ParagonIE_Sodium_Core32_Int32 $j12\n         * @var ParagonIE_Sodium_Core32_Int32 $j13\n         * @var ParagonIE_Sodium_Core32_Int32 $j14\n         * @var ParagonIE_Sodium_Core32_Int32 $j15\n         */\n        if (self::strlen($k) < 32) {\n            throw new RangeException('Key must be 32 bytes long');\n        }\n        if ($c === null) {\n            $x0  = new ParagonIE_Sodium_Core32_Int32(array(0x6170, 0x7865));\n            $x5  = new ParagonIE_Sodium_Core32_Int32(array(0x3320, 0x646e));\n            $x10 = new ParagonIE_Sodium_Core32_Int32(array(0x7962, 0x2d32));\n            $x15 = new ParagonIE_Sodium_Core32_Int32(array(0x6b20, 0x6574));\n        } else {\n            $x0  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($c, 0, 4));\n            $x5  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($c, 4, 4));\n            $x10 = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($c, 8, 4));\n            $x15 = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($c, 12, 4));\n        }\n        $x1  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($k, 0, 4));\n        $x2  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($k, 4, 4));\n        $x3  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($k, 8, 4));\n        $x4  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($k, 12, 4));\n        $x6  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($in, 0, 4));\n        $x7  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($in, 4, 4));\n        $x8  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($in, 8, 4));\n        $x9  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($in, 12, 4));\n        $x11 = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($k, 16, 4));\n        $x12 = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($k, 20, 4));\n        $x13 = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($k, 24, 4));\n        $x14 = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($k, 28, 4));\n\n        $j0  = clone $x0;\n        $j1  = clone $x1;\n        $j2  = clone $x2;\n        $j3  = clone $x3;\n        $j4  = clone $x4;\n        $j5  = clone $x5;\n        $j6  = clone $x6;\n        $j7  = clone $x7;\n        $j8  = clone $x8;\n        $j9  = clone $x9;\n        $j10  = clone $x10;\n        $j11  = clone $x11;\n        $j12  = clone $x12;\n        $j13  = clone $x13;\n        $j14  = clone $x14;\n        $j15  = clone $x15;\n\n        for ($i = self::ROUNDS; $i > 0; $i -= 2) {\n            $x4  = $x4->xorInt32($x0->addInt32($x12)->rotateLeft(7));\n            $x8  = $x8->xorInt32($x4->addInt32($x0)->rotateLeft(9));\n            $x12 = $x12->xorInt32($x8->addInt32($x4)->rotateLeft(13));\n            $x0  = $x0->xorInt32($x12->addInt32($x8)->rotateLeft(18));\n\n            $x9  = $x9->xorInt32($x5->addInt32($x1)->rotateLeft(7));\n            $x13 = $x13->xorInt32($x9->addInt32($x5)->rotateLeft(9));\n            $x1  = $x1->xorInt32($x13->addInt32($x9)->rotateLeft(13));\n            $x5  = $x5->xorInt32($x1->addInt32($x13)->rotateLeft(18));\n\n            $x14 = $x14->xorInt32($x10->addInt32($x6)->rotateLeft(7));\n            $x2  = $x2->xorInt32($x14->addInt32($x10)->rotateLeft(9));\n            $x6  = $x6->xorInt32($x2->addInt32($x14)->rotateLeft(13));\n            $x10 = $x10->xorInt32($x6->addInt32($x2)->rotateLeft(18));\n\n            $x3  = $x3->xorInt32($x15->addInt32($x11)->rotateLeft(7));\n            $x7  = $x7->xorInt32($x3->addInt32($x15)->rotateLeft(9));\n            $x11 = $x11->xorInt32($x7->addInt32($x3)->rotateLeft(13));\n            $x15 = $x15->xorInt32($x11->addInt32($x7)->rotateLeft(18));\n\n            $x1  = $x1->xorInt32($x0->addInt32($x3)->rotateLeft(7));\n            $x2  = $x2->xorInt32($x1->addInt32($x0)->rotateLeft(9));\n            $x3  = $x3->xorInt32($x2->addInt32($x1)->rotateLeft(13));\n            $x0  = $x0->xorInt32($x3->addInt32($x2)->rotateLeft(18));\n\n            $x6  = $x6->xorInt32($x5->addInt32($x4)->rotateLeft(7));\n            $x7  = $x7->xorInt32($x6->addInt32($x5)->rotateLeft(9));\n            $x4  = $x4->xorInt32($x7->addInt32($x6)->rotateLeft(13));\n            $x5  = $x5->xorInt32($x4->addInt32($x7)->rotateLeft(18));\n\n            $x11 = $x11->xorInt32($x10->addInt32($x9)->rotateLeft(7));\n            $x8  = $x8->xorInt32($x11->addInt32($x10)->rotateLeft(9));\n            $x9  = $x9->xorInt32($x8->addInt32($x11)->rotateLeft(13));\n            $x10 = $x10->xorInt32($x9->addInt32($x8)->rotateLeft(18));\n\n            $x12 = $x12->xorInt32($x15->addInt32($x14)->rotateLeft(7));\n            $x13 = $x13->xorInt32($x12->addInt32($x15)->rotateLeft(9));\n            $x14 = $x14->xorInt32($x13->addInt32($x12)->rotateLeft(13));\n            $x15 = $x15->xorInt32($x14->addInt32($x13)->rotateLeft(18));\n        }\n\n        $x0  = $x0->addInt32($j0);\n        $x1  = $x1->addInt32($j1);\n        $x2  = $x2->addInt32($j2);\n        $x3  = $x3->addInt32($j3);\n        $x4  = $x4->addInt32($j4);\n        $x5  = $x5->addInt32($j5);\n        $x6  = $x6->addInt32($j6);\n        $x7  = $x7->addInt32($j7);\n        $x8  = $x8->addInt32($j8);\n        $x9  = $x9->addInt32($j9);\n        $x10 = $x10->addInt32($j10);\n        $x11 = $x11->addInt32($j11);\n        $x12 = $x12->addInt32($j12);\n        $x13 = $x13->addInt32($j13);\n        $x14 = $x14->addInt32($j14);\n        $x15 = $x15->addInt32($j15);\n\n        return $x0->toReverseString() .\n            $x1->toReverseString() .\n            $x2->toReverseString() .\n            $x3->toReverseString() .\n            $x4->toReverseString() .\n            $x5->toReverseString() .\n            $x6->toReverseString() .\n            $x7->toReverseString() .\n            $x8->toReverseString() .\n            $x9->toReverseString() .\n            $x10->toReverseString() .\n            $x11->toReverseString() .\n            $x12->toReverseString() .\n            $x13->toReverseString() .\n            $x14->toReverseString() .\n            $x15->toReverseString();\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $len\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function salsa20($len, $nonce, $key)\n    {\n        if (self::strlen($key) !== 32) {\n            throw new RangeException('Key must be 32 bytes long');\n        }\n        $kcopy = '' . $key;\n        $in = self::substr($nonce, 0, 8) . str_repeat(\"\\0\", 8);\n        $c = '';\n        while ($len >= 64) {\n            $c .= self::core_salsa20($in, $kcopy, null);\n            $u = 1;\n            // Internal counter.\n            for ($i = 8; $i < 16; ++$i) {\n                $u += self::chrToInt($in[$i]);\n                $in[$i] = self::intToChr($u & 0xff);\n                $u >>= 8;\n            }\n            $len -= 64;\n        }\n        if ($len > 0) {\n            $c .= self::substr(\n                self::core_salsa20($in, $kcopy, null),\n                0,\n                $len\n            );\n        }\n        try {\n            ParagonIE_Sodium_Compat::memzero($kcopy);\n        } catch (SodiumException $ex) {\n            $kcopy = null;\n        }\n        return $c;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $m\n     * @param string $n\n     * @param int $ic\n     * @param string $k\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function salsa20_xor_ic($m, $n, $ic, $k)\n    {\n        $mlen = self::strlen($m);\n        if ($mlen < 1) {\n            return '';\n        }\n        $kcopy = self::substr($k, 0, 32);\n        $in = self::substr($n, 0, 8);\n        // Initialize the counter\n        $in .= ParagonIE_Sodium_Core32_Util::store64_le($ic);\n\n        $c = '';\n        while ($mlen >= 64) {\n            $block = self::core_salsa20($in, $kcopy, null);\n            $c .= self::xorStrings(\n                self::substr($m, 0, 64),\n                self::substr($block, 0, 64)\n            );\n            $u = 1;\n            for ($i = 8; $i < 16; ++$i) {\n                $u += self::chrToInt($in[$i]);\n                $in[$i] = self::intToChr($u & 0xff);\n                $u >>= 8;\n            }\n\n            $mlen -= 64;\n            $m = self::substr($m, 64);\n        }\n\n        if ($mlen) {\n            $block = self::core_salsa20($in, $kcopy, null);\n            $c .= self::xorStrings(\n                self::substr($m, 0, $mlen),\n                self::substr($block, 0, $mlen)\n            );\n        }\n        try {\n            ParagonIE_Sodium_Compat::memzero($block);\n            ParagonIE_Sodium_Compat::memzero($kcopy);\n        } catch (SodiumException $ex) {\n            $block = null;\n            $kcopy = null;\n        }\n\n        return $c;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function salsa20_xor($message, $nonce, $key)\n    {\n        return self::xorStrings(\n            $message,\n            self::salsa20(\n                self::strlen($message),\n                $nonce,\n                $key\n            )\n        );\n    }\n}\n", "num_lines": 307}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_SipHash', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_SodiumCompat_Core32_SipHash\n *\n * Only uses 32-bit arithmetic, while the original SipHash used 64-bit integers\n */\nclass ParagonIE_Sodium_Core32_SipHash extends ParagonIE_Sodium_Core32_Util\n{\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param array<int, ParagonIE_Sodium_Core32_Int64> $v\n     * @return array<int, ParagonIE_Sodium_Core32_Int64>\n     */\n    public static function sipRound(array $v)\n    {\n        # v0 += v1;\n        $v[0] = $v[0]->addInt64($v[1]);\n\n        # v1 = ROTL(v1, 13);\n        $v[1] = $v[1]->rotateLeft(13);\n\n        #  v1 ^= v0;\n        $v[1] = $v[1]->xorInt64($v[0]);\n\n        #  v0=ROTL(v0,32);\n        $v[0] = $v[0]->rotateLeft(32);\n\n        # v2 += v3;\n        $v[2] = $v[2]->addInt64($v[3]);\n\n        # v3=ROTL(v3,16);\n        $v[3] = $v[3]->rotateLeft(16);\n\n        #  v3 ^= v2;\n        $v[3] = $v[3]->xorInt64($v[2]);\n\n        # v0 += v3;\n        $v[0] = $v[0]->addInt64($v[3]);\n\n        # v3=ROTL(v3,21);\n        $v[3] = $v[3]->rotateLeft(21);\n\n        # v3 ^= v0;\n        $v[3] = $v[3]->xorInt64($v[0]);\n\n        # v2 += v1;\n        $v[2] = $v[2]->addInt64($v[1]);\n\n        # v1=ROTL(v1,17);\n        $v[1] = $v[1]->rotateLeft(17);\n\n        #  v1 ^= v2;\n        $v[1] = $v[1]->xorInt64($v[2]);\n\n        # v2=ROTL(v2,32)\n        $v[2] = $v[2]->rotateLeft(32);\n\n        return $v;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $in\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function sipHash24($in, $key)\n    {\n        $inlen = self::strlen($in);\n\n        # /* \"somepseudorandomlygeneratedbytes\" */\n        # u64 v0 = 0x736f6d6570736575ULL;\n        # u64 v1 = 0x646f72616e646f6dULL;\n        # u64 v2 = 0x6c7967656e657261ULL;\n        # u64 v3 = 0x7465646279746573ULL;\n        $v = array(\n            new ParagonIE_Sodium_Core32_Int64(\n                array(0x736f, 0x6d65, 0x7073, 0x6575)\n            ),\n            new ParagonIE_Sodium_Core32_Int64(\n                array(0x646f, 0x7261, 0x6e64, 0x6f6d)\n            ),\n            new ParagonIE_Sodium_Core32_Int64(\n                array(0x6c79, 0x6765, 0x6e65, 0x7261)\n            ),\n            new ParagonIE_Sodium_Core32_Int64(\n                array(0x7465, 0x6462, 0x7974, 0x6573)\n            )\n        );\n\n        # u64 k0 = LOAD64_LE( k );\n        # u64 k1 = LOAD64_LE( k + 8 );\n        $k = array(\n            ParagonIE_Sodium_Core32_Int64::fromReverseString(\n                self::substr($key, 0, 8)\n            ),\n            ParagonIE_Sodium_Core32_Int64::fromReverseString(\n                self::substr($key, 8, 8)\n            )\n        );\n\n        # b = ( ( u64 )inlen ) << 56;\n        $b = new ParagonIE_Sodium_Core32_Int64(\n            array(($inlen << 8) & 0xffff, 0, 0, 0)\n        );\n\n        # v3 ^= k1;\n        $v[3] = $v[3]->xorInt64($k[1]);\n        # v2 ^= k0;\n        $v[2] = $v[2]->xorInt64($k[0]);\n        # v1 ^= k1;\n        $v[1] = $v[1]->xorInt64($k[1]);\n        # v0 ^= k0;\n        $v[0] = $v[0]->xorInt64($k[0]);\n\n        $left = $inlen;\n        # for ( ; in != end; in += 8 )\n        while ($left >= 8) {\n            # m = LOAD64_LE( in );\n            $m = ParagonIE_Sodium_Core32_Int64::fromReverseString(\n                self::substr($in, 0, 8)\n            );\n\n            # v3 ^= m;\n            $v[3] = $v[3]->xorInt64($m);\n\n            # SIPROUND;\n            # SIPROUND;\n            $v = self::sipRound($v);\n            $v = self::sipRound($v);\n\n            # v0 ^= m;\n            $v[0] = $v[0]->xorInt64($m);\n\n            $in = self::substr($in, 8);\n            $left -= 8;\n        }\n\n        # switch( left )\n        #  {\n        #     case 7: b |= ( ( u64 )in[ 6] )  << 48;\n        #     case 6: b |= ( ( u64 )in[ 5] )  << 40;\n        #     case 5: b |= ( ( u64 )in[ 4] )  << 32;\n        #     case 4: b |= ( ( u64 )in[ 3] )  << 24;\n        #     case 3: b |= ( ( u64 )in[ 2] )  << 16;\n        #     case 2: b |= ( ( u64 )in[ 1] )  <<  8;\n        #     case 1: b |= ( ( u64 )in[ 0] ); break;\n        #     case 0: break;\n        # }\n        switch ($left) {\n            case 7:\n                $b = $b->orInt64(\n                    ParagonIE_Sodium_Core32_Int64::fromInts(\n                        0, self::chrToInt($in[6]) << 16\n                    )\n                );\n            case 6:\n                $b = $b->orInt64(\n                    ParagonIE_Sodium_Core32_Int64::fromInts(\n                        0, self::chrToInt($in[5]) << 8\n                    )\n                );\n            case 5:\n                $b = $b->orInt64(\n                    ParagonIE_Sodium_Core32_Int64::fromInts(\n                        0, self::chrToInt($in[4])\n                    )\n                );\n            case 4:\n                $b = $b->orInt64(\n                    ParagonIE_Sodium_Core32_Int64::fromInts(\n                        self::chrToInt($in[3]) << 24, 0\n                    )\n                );\n            case 3:\n                $b = $b->orInt64(\n                    ParagonIE_Sodium_Core32_Int64::fromInts(\n                        self::chrToInt($in[2]) << 16, 0\n                    )\n                );\n            case 2:\n                $b = $b->orInt64(\n                    ParagonIE_Sodium_Core32_Int64::fromInts(\n                        self::chrToInt($in[1]) << 8, 0\n                    )\n                );\n            case 1:\n                $b = $b->orInt64(\n                    ParagonIE_Sodium_Core32_Int64::fromInts(\n                        self::chrToInt($in[0]), 0\n                    )\n                );\n            case 0:\n                break;\n        }\n\n        # v3 ^= b;\n        $v[3] = $v[3]->xorInt64($b);\n\n        # SIPROUND;\n        # SIPROUND;\n        $v = self::sipRound($v);\n        $v = self::sipRound($v);\n\n        # v0 ^= b;\n        $v[0] = $v[0]->xorInt64($b);\n\n        // Flip the lower 8 bits of v2 which is ($v[4], $v[5]) in our implementation\n        # v2 ^= 0xff;\n        $v[2]->limbs[3] ^= 0xff;\n\n        # SIPROUND;\n        # SIPROUND;\n        # SIPROUND;\n        # SIPROUND;\n        $v = self::sipRound($v);\n        $v = self::sipRound($v);\n        $v = self::sipRound($v);\n        $v = self::sipRound($v);\n\n        # b = v0 ^ v1 ^ v2 ^ v3;\n        # STORE64_LE( out, b );\n        return $v[0]\n            ->xorInt64($v[1])\n            ->xorInt64($v[2])\n            ->xorInt64($v[3])\n            ->toReverseString();\n    }\n}\n", "num_lines": 239}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_Util', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core_Util\n */\nabstract class ParagonIE_Sodium_Core32_Util extends ParagonIE_Sodium_Core_Util\n{\n\n}\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_X25519', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_X25519\n */\nabstract class ParagonIE_Sodium_Core32_X25519 extends ParagonIE_Sodium_Core32_Curve25519\n{\n    /**\n     * Alters the objects passed to this method in place.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $g\n     * @param int $b\n     * @return void\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedMethodCall\n     */\n    public static function fe_cswap(\n        ParagonIE_Sodium_Core32_Curve25519_Fe $f,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $g,\n        $b = 0\n    ) {\n        $f0 = (int) $f[0]->toInt();\n        $f1 = (int) $f[1]->toInt();\n        $f2 = (int) $f[2]->toInt();\n        $f3 = (int) $f[3]->toInt();\n        $f4 = (int) $f[4]->toInt();\n        $f5 = (int) $f[5]->toInt();\n        $f6 = (int) $f[6]->toInt();\n        $f7 = (int) $f[7]->toInt();\n        $f8 = (int) $f[8]->toInt();\n        $f9 = (int) $f[9]->toInt();\n        $g0 = (int) $g[0]->toInt();\n        $g1 = (int) $g[1]->toInt();\n        $g2 = (int) $g[2]->toInt();\n        $g3 = (int) $g[3]->toInt();\n        $g4 = (int) $g[4]->toInt();\n        $g5 = (int) $g[5]->toInt();\n        $g6 = (int) $g[6]->toInt();\n        $g7 = (int) $g[7]->toInt();\n        $g8 = (int) $g[8]->toInt();\n        $g9 = (int) $g[9]->toInt();\n        $b = -$b;\n        /** @var int $x0 */\n        $x0 = ($f0 ^ $g0) & $b;\n        /** @var int $x1 */\n        $x1 = ($f1 ^ $g1) & $b;\n        /** @var int $x2 */\n        $x2 = ($f2 ^ $g2) & $b;\n        /** @var int $x3 */\n        $x3 = ($f3 ^ $g3) & $b;\n        /** @var int $x4 */\n        $x4 = ($f4 ^ $g4) & $b;\n        /** @var int $x5 */\n        $x5 = ($f5 ^ $g5) & $b;\n        /** @var int $x6 */\n        $x6 = ($f6 ^ $g6) & $b;\n        /** @var int $x7 */\n        $x7 = ($f7 ^ $g7) & $b;\n        /** @var int $x8 */\n        $x8 = ($f8 ^ $g8) & $b;\n        /** @var int $x9 */\n        $x9 = ($f9 ^ $g9) & $b;\n        $f[0] = ParagonIE_Sodium_Core32_Int32::fromInt($f0 ^ $x0);\n        $f[1] = ParagonIE_Sodium_Core32_Int32::fromInt($f1 ^ $x1);\n        $f[2] = ParagonIE_Sodium_Core32_Int32::fromInt($f2 ^ $x2);\n        $f[3] = ParagonIE_Sodium_Core32_Int32::fromInt($f3 ^ $x3);\n        $f[4] = ParagonIE_Sodium_Core32_Int32::fromInt($f4 ^ $x4);\n        $f[5] = ParagonIE_Sodium_Core32_Int32::fromInt($f5 ^ $x5);\n        $f[6] = ParagonIE_Sodium_Core32_Int32::fromInt($f6 ^ $x6);\n        $f[7] = ParagonIE_Sodium_Core32_Int32::fromInt($f7 ^ $x7);\n        $f[8] = ParagonIE_Sodium_Core32_Int32::fromInt($f8 ^ $x8);\n        $f[9] = ParagonIE_Sodium_Core32_Int32::fromInt($f9 ^ $x9);\n        $g[0] = ParagonIE_Sodium_Core32_Int32::fromInt($g0 ^ $x0);\n        $g[1] = ParagonIE_Sodium_Core32_Int32::fromInt($g1 ^ $x1);\n        $g[2] = ParagonIE_Sodium_Core32_Int32::fromInt($g2 ^ $x2);\n        $g[3] = ParagonIE_Sodium_Core32_Int32::fromInt($g3 ^ $x3);\n        $g[4] = ParagonIE_Sodium_Core32_Int32::fromInt($g4 ^ $x4);\n        $g[5] = ParagonIE_Sodium_Core32_Int32::fromInt($g5 ^ $x5);\n        $g[6] = ParagonIE_Sodium_Core32_Int32::fromInt($g6 ^ $x6);\n        $g[7] = ParagonIE_Sodium_Core32_Int32::fromInt($g7 ^ $x7);\n        $g[8] = ParagonIE_Sodium_Core32_Int32::fromInt($g8 ^ $x8);\n        $g[9] = ParagonIE_Sodium_Core32_Int32::fromInt($g9 ^ $x9);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f\n     * @return ParagonIE_Sodium_Core32_Curve25519_Fe\n     * @throws SodiumException\n     * @throws TypeError\n     * @psalm-suppress MixedAssignment\n     * @psalm-suppress MixedMethodCall\n     */\n    public static function fe_mul121666(ParagonIE_Sodium_Core32_Curve25519_Fe $f)\n    {\n        /** @var array<int, ParagonIE_Sodium_Core32_Int64> $h */\n        $h = array();\n        for ($i = 0; $i < 10; ++$i) {\n            $h[$i] = $f[$i]->toInt64()->mulInt(121666, 17);\n        }\n\n        $carry9 = $h[9]->addInt(1 << 24)->shiftRight(25);\n        $h[0] = $h[0]->addInt64($carry9->mulInt(19, 5));\n        $h[9] = $h[9]->subInt64($carry9->shiftLeft(25));\n\n        $carry1 = $h[1]->addInt(1 << 24)->shiftRight(25);\n        $h[2] = $h[2]->addInt64($carry1);\n        $h[1] = $h[1]->subInt64($carry1->shiftLeft(25));\n\n        $carry3 = $h[3]->addInt(1 << 24)->shiftRight(25);\n        $h[4] = $h[4]->addInt64($carry3);\n        $h[3] = $h[3]->subInt64($carry3->shiftLeft(25));\n\n        $carry5 = $h[5]->addInt(1 << 24)->shiftRight(25);\n        $h[6] = $h[6]->addInt64($carry5);\n        $h[5] = $h[5]->subInt64($carry5->shiftLeft(25));\n\n        $carry7 = $h[7]->addInt(1 << 24)->shiftRight(25);\n        $h[8] = $h[8]->addInt64($carry7);\n        $h[7] = $h[7]->subInt64($carry7->shiftLeft(25));\n\n        $carry0 = $h[0]->addInt(1 << 25)->shiftRight(26);\n        $h[1] = $h[1]->addInt64($carry0);\n        $h[0] = $h[0]->subInt64($carry0->shiftLeft(26));\n\n        $carry2 = $h[2]->addInt(1 << 25)->shiftRight(26);\n        $h[3] = $h[3]->addInt64($carry2);\n        $h[2] = $h[2]->subInt64($carry2->shiftLeft(26));\n\n        $carry4 = $h[4]->addInt(1 << 25)->shiftRight(26);\n        $h[5] = $h[5]->addInt64($carry4);\n        $h[4] = $h[4]->subInt64($carry4->shiftLeft(26));\n\n        $carry6 = $h[6]->addInt(1 << 25)->shiftRight(26);\n        $h[7] = $h[7]->addInt64($carry6);\n        $h[6] = $h[6]->subInt64($carry6->shiftLeft(26));\n\n        $carry8 = $h[8]->addInt(1 << 25)->shiftRight(26);\n        $h[9] = $h[9]->addInt64($carry8);\n        $h[8] = $h[8]->subInt64($carry8->shiftLeft(26));\n\n        for ($i = 0; $i < 10; ++$i) {\n            $h[$i] = $h[$i]->toInt32();\n        }\n        /** @var array<int, ParagonIE_Sodium_Core32_Int32> $h2 */\n        $h2 = $h;\n        return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray($h2);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * Inline comments preceded by # are from libsodium's ref10 code.\n     *\n     * @param string $n\n     * @param string $p\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function crypto_scalarmult_curve25519_ref10($n, $p)\n    {\n        # for (i = 0;i < 32;++i) e[i] = n[i];\n        $e = '' . $n;\n        # e[0] &= 248;\n        $e[0] = self::intToChr(\n            self::chrToInt($e[0]) & 248\n        );\n        # e[31] &= 127;\n        # e[31] |= 64;\n        $e[31] = self::intToChr(\n            (self::chrToInt($e[31]) & 127) | 64\n        );\n        # fe_frombytes(x1,p);\n        $x1 = self::fe_frombytes($p);\n        # fe_1(x2);\n        $x2 = self::fe_1();\n        # fe_0(z2);\n        $z2 = self::fe_0();\n        # fe_copy(x3,x1);\n        $x3 = self::fe_copy($x1);\n        # fe_1(z3);\n        $z3 = self::fe_1();\n\n        # swap = 0;\n        /** @var int $swap */\n        $swap = 0;\n\n        # for (pos = 254;pos >= 0;--pos) {\n        for ($pos = 254; $pos >= 0; --$pos) {\n            # b = e[pos / 8] >> (pos & 7);\n            /** @var int $b */\n            $b = self::chrToInt(\n                    $e[(int) floor($pos / 8)]\n                ) >> ($pos & 7);\n            # b &= 1;\n            $b &= 1;\n\n            # swap ^= b;\n            $swap ^= $b;\n\n            # fe_cswap(x2,x3,swap);\n            self::fe_cswap($x2, $x3, $swap);\n\n            # fe_cswap(z2,z3,swap);\n            self::fe_cswap($z2, $z3, $swap);\n\n            # swap = b;\n            /** @var int $swap */\n            $swap = $b;\n\n            # fe_sub(tmp0,x3,z3);\n            $tmp0 = self::fe_sub($x3, $z3);\n\n            # fe_sub(tmp1,x2,z2);\n            $tmp1 = self::fe_sub($x2, $z2);\n\n            # fe_add(x2,x2,z2);\n            $x2 = self::fe_add($x2, $z2);\n\n            # fe_add(z2,x3,z3);\n            $z2 = self::fe_add($x3, $z3);\n\n            # fe_mul(z3,tmp0,x2);\n            $z3 = self::fe_mul($tmp0, $x2);\n\n            # fe_mul(z2,z2,tmp1);\n            $z2 = self::fe_mul($z2, $tmp1);\n\n            # fe_sq(tmp0,tmp1);\n            $tmp0 = self::fe_sq($tmp1);\n\n            # fe_sq(tmp1,x2);\n            $tmp1 = self::fe_sq($x2);\n\n            # fe_add(x3,z3,z2);\n            $x3 = self::fe_add($z3, $z2);\n\n            # fe_sub(z2,z3,z2);\n            $z2 = self::fe_sub($z3, $z2);\n\n            # fe_mul(x2,tmp1,tmp0);\n            $x2 = self::fe_mul($tmp1, $tmp0);\n\n            # fe_sub(tmp1,tmp1,tmp0);\n            $tmp1 = self::fe_sub($tmp1, $tmp0);\n\n            # fe_sq(z2,z2);\n            $z2 = self::fe_sq($z2);\n\n            # fe_mul121666(z3,tmp1);\n            $z3 = self::fe_mul121666($tmp1);\n\n            # fe_sq(x3,x3);\n            $x3 = self::fe_sq($x3);\n\n            # fe_add(tmp0,tmp0,z3);\n            $tmp0 = self::fe_add($tmp0, $z3);\n\n            # fe_mul(z3,x1,z2);\n            $z3 = self::fe_mul($x1, $z2);\n\n            # fe_mul(z2,tmp1,tmp0);\n            $z2 = self::fe_mul($tmp1, $tmp0);\n        }\n\n        # fe_cswap(x2,x3,swap);\n        self::fe_cswap($x2, $x3, $swap);\n\n        # fe_cswap(z2,z3,swap);\n        self::fe_cswap($z2, $z3, $swap);\n\n        # fe_invert(z2,z2);\n        $z2 = self::fe_invert($z2);\n\n        # fe_mul(x2,x2,z2);\n        $x2 = self::fe_mul($x2, $z2);\n        # fe_tobytes(q,x2);\n        return (string) self::fe_tobytes($x2);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $edwardsY\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $edwardsZ\n     * @return ParagonIE_Sodium_Core32_Curve25519_Fe\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function edwards_to_montgomery(\n        ParagonIE_Sodium_Core32_Curve25519_Fe $edwardsY,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $edwardsZ\n    ) {\n        $tempX = self::fe_add($edwardsZ, $edwardsY);\n        $tempZ = self::fe_sub($edwardsZ, $edwardsY);\n        $tempZ = self::fe_invert($tempZ);\n        return self::fe_mul($tempX, $tempZ);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $n\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function crypto_scalarmult_curve25519_ref10_base($n)\n    {\n        # for (i = 0;i < 32;++i) e[i] = n[i];\n        $e = '' . $n;\n\n        # e[0] &= 248;\n        $e[0] = self::intToChr(\n            self::chrToInt($e[0]) & 248\n        );\n\n        # e[31] &= 127;\n        # e[31] |= 64;\n        $e[31] = self::intToChr(\n            (self::chrToInt($e[31]) & 127) | 64\n        );\n\n        $A = self::ge_scalarmult_base($e);\n        if (\n            !($A->Y instanceof ParagonIE_Sodium_Core32_Curve25519_Fe)\n                ||\n            !($A->Z instanceof ParagonIE_Sodium_Core32_Curve25519_Fe)\n        ) {\n            throw new TypeError('Null points encountered');\n        }\n        $pk = self::edwards_to_montgomery($A->Y, $A->Z);\n        return self::fe_tobytes($pk);\n    }\n}\n", "num_lines": 346}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_XChaCha20', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_XChaCha20\n */\nclass ParagonIE_Sodium_Core32_XChaCha20 extends ParagonIE_Sodium_Core32_HChaCha20\n{\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $len\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function stream($len = 64, $nonce = '', $key = '')\n    {\n        if (self::strlen($nonce) !== 24) {\n            throw new SodiumException('Nonce must be 24 bytes long');\n        }\n        return self::encryptBytes(\n            new ParagonIE_Sodium_Core32_ChaCha20_Ctx(\n                self::hChaCha20(\n                    self::substr($nonce, 0, 16),\n                    $key\n                ),\n                self::substr($nonce, 16, 8)\n            ),\n            str_repeat(\"\\x00\", $len)\n        );\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @param string $ic\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function streamXorIc($message, $nonce = '', $key = '', $ic = '')\n    {\n        if (self::strlen($nonce) !== 24) {\n            throw new SodiumException('Nonce must be 24 bytes long');\n        }\n        return self::encryptBytes(\n            new ParagonIE_Sodium_Core32_ChaCha20_Ctx(\n                self::hChaCha20(self::substr($nonce, 0, 16), $key),\n                self::substr($nonce, 16, 8),\n                $ic\n            ),\n            $message\n        );\n    }\n}\n", "num_lines": 65}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_XSalsa20', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_XSalsa20\n */\nabstract class ParagonIE_Sodium_Core32_XSalsa20 extends ParagonIE_Sodium_Core32_HSalsa20\n{\n    /**\n     * Expand a key and nonce into an xsalsa20 keystream.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param int $len\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function xsalsa20($len, $nonce, $key)\n    {\n        $ret = self::salsa20(\n            $len,\n            self::substr($nonce, 16, 8),\n            self::hsalsa20($nonce, $key)\n        );\n        return $ret;\n    }\n\n    /**\n     * Encrypt a string with XSalsa20. Doesn't provide integrity.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param string $nonce\n     * @param string $key\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function xsalsa20_xor($message, $nonce, $key)\n    {\n        return self::xorStrings(\n            $message,\n            self::xsalsa20(\n                self::strlen($message),\n                $nonce,\n                $key\n            )\n        );\n    }\n}\n", "num_lines": 58}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_ChaCha20_Ctx', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_ChaCha20_Ctx\n */\nclass ParagonIE_Sodium_Core32_ChaCha20_Ctx extends ParagonIE_Sodium_Core32_Util implements ArrayAccess\n{\n    /**\n     * @var SplFixedArray internally, <int, ParagonIE_Sodium_Core32_Int32>\n     */\n    protected $container;\n\n    /**\n     * ParagonIE_Sodium_Core_ChaCha20_Ctx constructor.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $key     ChaCha20 key.\n     * @param string $iv      Initialization Vector (a.k.a. nonce).\n     * @param string $counter The initial counter value.\n     *                        Defaults to 8 0x00 bytes.\n     * @throws InvalidArgumentException\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function __construct($key = '', $iv = '', $counter = '')\n    {\n        if (self::strlen($key) !== 32) {\n            throw new InvalidArgumentException('ChaCha20 expects a 256-bit key.');\n        }\n        if (self::strlen($iv) !== 8) {\n            throw new InvalidArgumentException('ChaCha20 expects a 64-bit nonce.');\n        }\n        $this->container = new SplFixedArray(16);\n\n        /* \"expand 32-byte k\" as per ChaCha20 spec */\n        $this->container[0]  = new ParagonIE_Sodium_Core32_Int32(array(0x6170, 0x7865));\n        $this->container[1]  = new ParagonIE_Sodium_Core32_Int32(array(0x3320, 0x646e));\n        $this->container[2]  = new ParagonIE_Sodium_Core32_Int32(array(0x7962, 0x2d32));\n        $this->container[3]  = new ParagonIE_Sodium_Core32_Int32(array(0x6b20, 0x6574));\n\n        $this->container[4]  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 0, 4));\n        $this->container[5]  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 4, 4));\n        $this->container[6]  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 8, 4));\n        $this->container[7]  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 12, 4));\n        $this->container[8]  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 16, 4));\n        $this->container[9]  = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 20, 4));\n        $this->container[10] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 24, 4));\n        $this->container[11] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 28, 4));\n\n        if (empty($counter)) {\n            $this->container[12] = new ParagonIE_Sodium_Core32_Int32();\n            $this->container[13] = new ParagonIE_Sodium_Core32_Int32();\n        } else {\n            $this->container[12] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($counter, 0, 4));\n            $this->container[13] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($counter, 4, 4));\n        }\n        $this->container[14] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 0, 4));\n        $this->container[15] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 4, 4));\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $offset\n     * @param int|ParagonIE_Sodium_Core32_Int32 $value\n     * @return void\n     */\n    public function offsetSet($offset, $value)\n    {\n        if (!is_int($offset)) {\n            throw new InvalidArgumentException('Expected an integer');\n        }\n        if ($value instanceof ParagonIE_Sodium_Core32_Int32) {\n            /*\n        } elseif (is_int($value)) {\n            $value = ParagonIE_Sodium_Core32_Int32::fromInt($value);\n            */\n        } else {\n            throw new InvalidArgumentException('Expected an integer');\n        }\n        $this->container[$offset] = $value;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $offset\n     * @return bool\n     * @psalm-suppress MixedArrayOffset\n     */\n    public function offsetExists($offset)\n    {\n        return isset($this->container[$offset]);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $offset\n     * @return void\n     * @psalm-suppress MixedArrayOffset\n     */\n    public function offsetUnset($offset)\n    {\n        unset($this->container[$offset]);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param int $offset\n     * @return mixed|null\n     * @psalm-suppress MixedArrayOffset\n     */\n    public function offsetGet($offset)\n    {\n        return isset($this->container[$offset])\n            ? $this->container[$offset]\n            : null;\n    }\n}\n", "num_lines": 127}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core_ChaCha20_IetfCtx', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_ChaCha20_IetfCtx\n */\nclass ParagonIE_Sodium_Core32_ChaCha20_IetfCtx extends ParagonIE_Sodium_Core32_ChaCha20_Ctx\n{\n    /**\n     * ParagonIE_Sodium_Core_ChaCha20_IetfCtx constructor.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $key     ChaCha20 key.\n     * @param string $iv      Initialization Vector (a.k.a. nonce).\n     * @param string $counter The initial counter value.\n     *                        Defaults to 4 0x00 bytes.\n     * @throws InvalidArgumentException\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function __construct($key = '', $iv = '', $counter = '')\n    {\n        if (self::strlen($iv) !== 12) {\n            throw new InvalidArgumentException('ChaCha20 expects a 96-bit nonce in IETF mode.');\n        }\n        parent::__construct($key, self::substr($iv, 0, 8), $counter);\n\n        if (!empty($counter)) {\n            $this->container[12] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($counter, 0, 4));\n        }\n        $this->container[13] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 0, 4));\n        $this->container[14] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 4, 4));\n        $this->container[15] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 8, 4));\n    }\n}\n", "num_lines": 40}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_Curve25519_Fe', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_Curve25519_Fe\n *\n * This represents a Field Element\n */\nclass ParagonIE_Sodium_Core32_Curve25519_Fe implements ArrayAccess\n{\n    /**\n     * @var array<int, ParagonIE_Sodium_Core32_Int32>\n     */\n    protected $container = array();\n\n    /**\n     * @var int\n     */\n    protected $size = 10;\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param array<int, ParagonIE_Sodium_Core32_Int32> $array\n     * @param bool $save_indexes\n     * @return self\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fromArray($array, $save_indexes = null)\n    {\n        $count = count($array);\n        if ($save_indexes) {\n            $keys = array_keys($array);\n        } else {\n            $keys = range(0, $count - 1);\n        }\n        $array = array_values($array);\n\n        $obj = new ParagonIE_Sodium_Core32_Curve25519_Fe();\n        if ($save_indexes) {\n            for ($i = 0; $i < $count; ++$i) {\n                $array[$i]->overflow = 0;\n                $obj->offsetSet($keys[$i], $array[$i]);\n            }\n        } else {\n            for ($i = 0; $i < $count; ++$i) {\n                $array[$i]->overflow = 0;\n                $obj->offsetSet($i, $array[$i]);\n            }\n        }\n        return $obj;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param array<int, int> $array\n     * @param bool $save_indexes\n     * @return self\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public static function fromIntArray($array, $save_indexes = null)\n    {\n        $count = count($array);\n        if ($save_indexes) {\n            $keys = array_keys($array);\n        } else {\n            $keys = range(0, $count - 1);\n        }\n        $array = array_values($array);\n        $set = array();\n        /** @var int $i */\n        /** @var int $v */\n        foreach ($array as $i => $v) {\n            $set[$i] = ParagonIE_Sodium_Core32_Int32::fromInt($v);\n        }\n\n        $obj = new ParagonIE_Sodium_Core32_Curve25519_Fe();\n        if ($save_indexes) {\n            for ($i = 0; $i < $count; ++$i) {\n                $set[$i]->overflow = 0;\n                $obj->offsetSet($keys[$i], $set[$i]);\n            }\n        } else {\n            for ($i = 0; $i < $count; ++$i) {\n                $set[$i]->overflow = 0;\n                $obj->offsetSet($i, $set[$i]);\n            }\n        }\n        return $obj;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param mixed $offset\n     * @param mixed $value\n     * @return void\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function offsetSet($offset, $value)\n    {\n        if (!($value instanceof ParagonIE_Sodium_Core32_Int32)) {\n            throw new InvalidArgumentException('Expected an instance of ParagonIE_Sodium_Core32_Int32');\n        }\n        if (is_null($offset)) {\n            $this->container[] = $value;\n        } else {\n            ParagonIE_Sodium_Core32_Util::declareScalarType($offset, 'int', 1);\n            $this->container[(int) $offset] = $value;\n        }\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param mixed $offset\n     * @return bool\n     * @psalm-suppress MixedArrayOffset\n     */\n    public function offsetExists($offset)\n    {\n        return isset($this->container[$offset]);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param mixed $offset\n     * @return void\n     * @psalm-suppress MixedArrayOffset\n     */\n    public function offsetUnset($offset)\n    {\n        unset($this->container[$offset]);\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param mixed $offset\n     * @return ParagonIE_Sodium_Core32_Int32\n     * @psalm-suppress MixedArrayOffset\n     */\n    public function offsetGet($offset)\n    {\n        if (!isset($this->container[$offset])) {\n            $this->container[(int) $offset] = new ParagonIE_Sodium_Core32_Int32();\n        }\n        /** @var ParagonIE_Sodium_Core32_Int32 $get */\n        $get = $this->container[$offset];\n        return $get;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @return array\n     */\n    public function __debugInfo()\n    {\n        if (empty($this->container)) {\n            return array();\n        }\n        $c = array(\n            (int) ($this->container[0]->toInt()),\n            (int) ($this->container[1]->toInt()),\n            (int) ($this->container[2]->toInt()),\n            (int) ($this->container[3]->toInt()),\n            (int) ($this->container[4]->toInt()),\n            (int) ($this->container[5]->toInt()),\n            (int) ($this->container[6]->toInt()),\n            (int) ($this->container[7]->toInt()),\n            (int) ($this->container[8]->toInt()),\n            (int) ($this->container[9]->toInt())\n        );\n        return array(implode(', ', $c));\n    }\n}\n", "num_lines": 186}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_Curve25519_H', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_Curve25519_H\n *\n * This just contains the constants in the ref10/base.h file\n */\nclass ParagonIE_Sodium_Core32_Curve25519_H extends ParagonIE_Sodium_Core32_Util\n{\n    /**\n     * See: libsodium's crypto_core/curve25519/ref10/base.h\n     *\n     * @var array<int, array<int, array<int, array<int, int>>>> Basically, int[32][8][3][10]\n     */\n    protected static $base = array(\n        array(\n            array(\n                array(25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605),\n                array(-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378),\n                array(-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546),\n            ),\n            array(\n                array(-12815894, -12976347, -21581243, 11784320, -25355658, -2750717, -11717903, -3814571, -358445, -10211303),\n                array(-21703237, 6903825, 27185491, 6451973, -29577724, -9554005, -15616551, 11189268, -26829678, -5319081),\n                array(26966642, 11152617, 32442495, 15396054, 14353839, -12752335, -3128826, -9541118, -15472047, -4166697),\n            ),\n            array(\n                array(15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024),\n                array(16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574),\n                array(30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357),\n            ),\n            array(\n                array(-17036878, 13921892, 10945806, -6033431, 27105052, -16084379, -28926210, 15006023, 3284568, -6276540),\n                array(23599295, -8306047, -11193664, -7687416, 13236774, 10506355, 7464579, 9656445, 13059162, 10374397),\n                array(7798556, 16710257, 3033922, 2874086, 28997861, 2835604, 32406664, -3839045, -641708, -101325),\n            ),\n            array(\n                array(10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380),\n                array(4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306),\n                array(19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942),\n            ),\n            array(\n                array(-15371964, -12862754, 32573250, 4720197, -26436522, 5875511, -19188627, -15224819, -9818940, -12085777),\n                array(-8549212, 109983, 15149363, 2178705, 22900618, 4543417, 3044240, -15689887, 1762328, 14866737),\n                array(-18199695, -15951423, -10473290, 1707278, -17185920, 3916101, -28236412, 3959421, 27914454, 4383652),\n            ),\n            array(\n                array(5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766),\n                array(-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701),\n                array(28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300),\n            ),\n            array(\n                array(14499471, -2729599, -33191113, -4254652, 28494862, 14271267, 30290735, 10876454, -33154098, 2381726),\n                array(-7195431, -2655363, -14730155, 462251, -27724326, 3941372, -6236617, 3696005, -32300832, 15351955),\n                array(27431194, 8222322, 16448760, -3907995, -18707002, 11938355, -32961401, -2970515, 29551813, 10109425),\n            ),\n        ),\n        array(\n            array(\n                array(-13657040, -13155431, -31283750, 11777098, 21447386, 6519384, -2378284, -1627556, 10092783, -4764171),\n                array(27939166, 14210322, 4677035, 16277044, -22964462, -12398139, -32508754, 12005538, -17810127, 12803510),\n                array(17228999, -15661624, -1233527, 300140, -1224870, -11714777, 30364213, -9038194, 18016357, 4397660),\n            ),\n            array(\n                array(-10958843, -7690207, 4776341, -14954238, 27850028, -15602212, -26619106, 14544525, -17477504, 982639),\n                array(29253598, 15796703, -2863982, -9908884, 10057023, 3163536, 7332899, -4120128, -21047696, 9934963),\n                array(5793303, 16271923, -24131614, -10116404, 29188560, 1206517, -14747930, 4559895, -30123922, -10897950),\n            ),\n            array(\n                array(-27643952, -11493006, 16282657, -11036493, 28414021, -15012264, 24191034, 4541697, -13338309, 5500568),\n                array(12650548, -1497113, 9052871, 11355358, -17680037, -8400164, -17430592, 12264343, 10874051, 13524335),\n                array(25556948, -3045990, 714651, 2510400, 23394682, -10415330, 33119038, 5080568, -22528059, 5376628),\n            ),\n            array(\n                array(-26088264, -4011052, -17013699, -3537628, -6726793, 1920897, -22321305, -9447443, 4535768, 1569007),\n                array(-2255422, 14606630, -21692440, -8039818, 28430649, 8775819, -30494562, 3044290, 31848280, 12543772),\n                array(-22028579, 2943893, -31857513, 6777306, 13784462, -4292203, -27377195, -2062731, 7718482, 14474653),\n            ),\n            array(\n                array(2385315, 2454213, -22631320, 46603, -4437935, -15680415, 656965, -7236665, 24316168, -5253567),\n                array(13741529, 10911568, -33233417, -8603737, -20177830, -1033297, 33040651, -13424532, -20729456, 8321686),\n                array(21060490, -2212744, 15712757, -4336099, 1639040, 10656336, 23845965, -11874838, -9984458, 608372),\n            ),\n            array(\n                array(-13672732, -15087586, -10889693, -7557059, -6036909, 11305547, 1123968, -6780577, 27229399, 23887),\n                array(-23244140, -294205, -11744728, 14712571, -29465699, -2029617, 12797024, -6440308, -1633405, 16678954),\n                array(-29500620, 4770662, -16054387, 14001338, 7830047, 9564805, -1508144, -4795045, -17169265, 4904953),\n            ),\n            array(\n                array(24059557, 14617003, 19037157, -15039908, 19766093, -14906429, 5169211, 16191880, 2128236, -4326833),\n                array(-16981152, 4124966, -8540610, -10653797, 30336522, -14105247, -29806336, 916033, -6882542, -2986532),\n                array(-22630907, 12419372, -7134229, -7473371, -16478904, 16739175, 285431, 2763829, 15736322, 4143876),\n            ),\n            array(\n                array(2379352, 11839345, -4110402, -5988665, 11274298, 794957, 212801, -14594663, 23527084, -16458268),\n                array(33431127, -11130478, -17838966, -15626900, 8909499, 8376530, -32625340, 4087881, -15188911, -14416214),\n                array(1767683, 7197987, -13205226, -2022635, -13091350, 448826, 5799055, 4357868, -4774191, -16323038),\n            ),\n        ),\n        array(\n            array(\n                array(6721966, 13833823, -23523388, -1551314, 26354293, -11863321, 23365147, -3949732, 7390890, 2759800),\n                array(4409041, 2052381, 23373853, 10530217, 7676779, -12885954, 21302353, -4264057, 1244380, -12919645),\n                array(-4421239, 7169619, 4982368, -2957590, 30256825, -2777540, 14086413, 9208236, 15886429, 16489664),\n            ),\n            array(\n                array(1996075, 10375649, 14346367, 13311202, -6874135, -16438411, -13693198, 398369, -30606455, -712933),\n                array(-25307465, 9795880, -2777414, 14878809, -33531835, 14780363, 13348553, 12076947, -30836462, 5113182),\n                array(-17770784, 11797796, 31950843, 13929123, -25888302, 12288344, -30341101, -7336386, 13847711, 5387222),\n            ),\n            array(\n                array(-18582163, -3416217, 17824843, -2340966, 22744343, -10442611, 8763061, 3617786, -19600662, 10370991),\n                array(20246567, -14369378, 22358229, -543712, 18507283, -10413996, 14554437, -8746092, 32232924, 16763880),\n                array(9648505, 10094563, 26416693, 14745928, -30374318, -6472621, 11094161, 15689506, 3140038, -16510092),\n            ),\n            array(\n                array(-16160072, 5472695, 31895588, 4744994, 8823515, 10365685, -27224800, 9448613, -28774454, 366295),\n                array(19153450, 11523972, -11096490, -6503142, -24647631, 5420647, 28344573, 8041113, 719605, 11671788),\n                array(8678025, 2694440, -6808014, 2517372, 4964326, 11152271, -15432916, -15266516, 27000813, -10195553),\n            ),\n            array(\n                array(-15157904, 7134312, 8639287, -2814877, -7235688, 10421742, 564065, 5336097, 6750977, -14521026),\n                array(11836410, -3979488, 26297894, 16080799, 23455045, 15735944, 1695823, -8819122, 8169720, 16220347),\n                array(-18115838, 8653647, 17578566, -6092619, -8025777, -16012763, -11144307, -2627664, -5990708, -14166033),\n            ),\n            array(\n                array(-23308498, -10968312, 15213228, -10081214, -30853605, -11050004, 27884329, 2847284, 2655861, 1738395),\n                array(-27537433, -14253021, -25336301, -8002780, -9370762, 8129821, 21651608, -3239336, -19087449, -11005278),\n                array(1533110, 3437855, 23735889, 459276, 29970501, 11335377, 26030092, 5821408, 10478196, 8544890),\n            ),\n            array(\n                array(32173121, -16129311, 24896207, 3921497, 22579056, -3410854, 19270449, 12217473, 17789017, -3395995),\n                array(-30552961, -2228401, -15578829, -10147201, 13243889, 517024, 15479401, -3853233, 30460520, 1052596),\n                array(-11614875, 13323618, 32618793, 8175907, -15230173, 12596687, 27491595, -4612359, 3179268, -9478891),\n            ),\n            array(\n                array(31947069, -14366651, -4640583, -15339921, -15125977, -6039709, -14756777, -16411740, 19072640, -9511060),\n                array(11685058, 11822410, 3158003, -13952594, 33402194, -4165066, 5977896, -5215017, 473099, 5040608),\n                array(-20290863, 8198642, -27410132, 11602123, 1290375, -2799760, 28326862, 1721092, -19558642, -3131606),\n            ),\n        ),\n        array(\n            array(\n                array(7881532, 10687937, 7578723, 7738378, -18951012, -2553952, 21820786, 8076149, -27868496, 11538389),\n                array(-19935666, 3899861, 18283497, -6801568, -15728660, -11249211, 8754525, 7446702, -5676054, 5797016),\n                array(-11295600, -3793569, -15782110, -7964573, 12708869, -8456199, 2014099, -9050574, -2369172, -5877341),\n            ),\n            array(\n                array(-22472376, -11568741, -27682020, 1146375, 18956691, 16640559, 1192730, -3714199, 15123619, 10811505),\n                array(14352098, -3419715, -18942044, 10822655, 32750596, 4699007, -70363, 15776356, -28886779, -11974553),\n                array(-28241164, -8072475, -4978962, -5315317, 29416931, 1847569, -20654173, -16484855, 4714547, -9600655),\n            ),\n            array(\n                array(15200332, 8368572, 19679101, 15970074, -31872674, 1959451, 24611599, -4543832, -11745876, 12340220),\n                array(12876937, -10480056, 33134381, 6590940, -6307776, 14872440, 9613953, 8241152, 15370987, 9608631),\n                array(-4143277, -12014408, 8446281, -391603, 4407738, 13629032, -7724868, 15866074, -28210621, -8814099),\n            ),\n            array(\n                array(26660628, -15677655, 8393734, 358047, -7401291, 992988, -23904233, 858697, 20571223, 8420556),\n                array(14620715, 13067227, -15447274, 8264467, 14106269, 15080814, 33531827, 12516406, -21574435, -12476749),\n                array(236881, 10476226, 57258, -14677024, 6472998, 2466984, 17258519, 7256740, 8791136, 15069930),\n            ),\n            array(\n                array(1276410, -9371918, 22949635, -16322807, -23493039, -5702186, 14711875, 4874229, -30663140, -2331391),\n                array(5855666, 4990204, -13711848, 7294284, -7804282, 1924647, -1423175, -7912378, -33069337, 9234253),\n                array(20590503, -9018988, 31529744, -7352666, -2706834, 10650548, 31559055, -11609587, 18979186, 13396066),\n            ),\n            array(\n                array(24474287, 4968103, 22267082, 4407354, 24063882, -8325180, -18816887, 13594782, 33514650, 7021958),\n                array(-11566906, -6565505, -21365085, 15928892, -26158305, 4315421, -25948728, -3916677, -21480480, 12868082),\n                array(-28635013, 13504661, 19988037, -2132761, 21078225, 6443208, -21446107, 2244500, -12455797, -8089383),\n            ),\n            array(\n                array(-30595528, 13793479, -5852820, 319136, -25723172, -6263899, 33086546, 8957937, -15233648, 5540521),\n                array(-11630176, -11503902, -8119500, -7643073, 2620056, 1022908, -23710744, -1568984, -16128528, -14962807),\n                array(23152971, 775386, 27395463, 14006635, -9701118, 4649512, 1689819, 892185, -11513277, -15205948),\n            ),\n            array(\n                array(9770129, 9586738, 26496094, 4324120, 1556511, -3550024, 27453819, 4763127, -19179614, 5867134),\n                array(-32765025, 1927590, 31726409, -4753295, 23962434, -16019500, 27846559, 5931263, -29749703, -16108455),\n                array(27461885, -2977536, 22380810, 1815854, -23033753, -3031938, 7283490, -15148073, -19526700, 7734629),\n            ),\n        ),\n        array(\n            array(\n                array(-8010264, -9590817, -11120403, 6196038, 29344158, -13430885, 7585295, -3176626, 18549497, 15302069),\n                array(-32658337, -6171222, -7672793, -11051681, 6258878, 13504381, 10458790, -6418461, -8872242, 8424746),\n                array(24687205, 8613276, -30667046, -3233545, 1863892, -1830544, 19206234, 7134917, -11284482, -828919),\n            ),\n            array(\n                array(11334899, -9218022, 8025293, 12707519, 17523892, -10476071, 10243738, -14685461, -5066034, 16498837),\n                array(8911542, 6887158, -9584260, -6958590, 11145641, -9543680, 17303925, -14124238, 6536641, 10543906),\n                array(-28946384, 15479763, -17466835, 568876, -1497683, 11223454, -2669190, -16625574, -27235709, 8876771),\n            ),\n            array(\n                array(-25742899, -12566864, -15649966, -846607, -33026686, -796288, -33481822, 15824474, -604426, -9039817),\n                array(10330056, 70051, 7957388, -9002667, 9764902, 15609756, 27698697, -4890037, 1657394, 3084098),\n                array(10477963, -7470260, 12119566, -13250805, 29016247, -5365589, 31280319, 14396151, -30233575, 15272409),\n            ),\n            array(\n                array(-12288309, 3169463, 28813183, 16658753, 25116432, -5630466, -25173957, -12636138, -25014757, 1950504),\n                array(-26180358, 9489187, 11053416, -14746161, -31053720, 5825630, -8384306, -8767532, 15341279, 8373727),\n                array(28685821, 7759505, -14378516, -12002860, -31971820, 4079242, 298136, -10232602, -2878207, 15190420),\n            ),\n            array(\n                array(-32932876, 13806336, -14337485, -15794431, -24004620, 10940928, 8669718, 2742393, -26033313, -6875003),\n                array(-1580388, -11729417, -25979658, -11445023, -17411874, -10912854, 9291594, -16247779, -12154742, 6048605),\n                array(-30305315, 14843444, 1539301, 11864366, 20201677, 1900163, 13934231, 5128323, 11213262, 9168384),\n            ),\n            array(\n                array(-26280513, 11007847, 19408960, -940758, -18592965, -4328580, -5088060, -11105150, 20470157, -16398701),\n                array(-23136053, 9282192, 14855179, -15390078, -7362815, -14408560, -22783952, 14461608, 14042978, 5230683),\n                array(29969567, -2741594, -16711867, -8552442, 9175486, -2468974, 21556951, 3506042, -5933891, -12449708),\n            ),\n            array(\n                array(-3144746, 8744661, 19704003, 4581278, -20430686, 6830683, -21284170, 8971513, -28539189, 15326563),\n                array(-19464629, 10110288, -17262528, -3503892, -23500387, 1355669, -15523050, 15300988, -20514118, 9168260),\n                array(-5353335, 4488613, -23803248, 16314347, 7780487, -15638939, -28948358, 9601605, 33087103, -9011387),\n            ),\n            array(\n                array(-19443170, -15512900, -20797467, -12445323, -29824447, 10229461, -27444329, -15000531, -5996870, 15664672),\n                array(23294591, -16632613, -22650781, -8470978, 27844204, 11461195, 13099750, -2460356, 18151676, 13417686),\n                array(-24722913, -4176517, -31150679, 5988919, -26858785, 6685065, 1661597, -12551441, 15271676, -15452665),\n            ),\n        ),\n        array(\n            array(\n                array(11433042, -13228665, 8239631, -5279517, -1985436, -725718, -18698764, 2167544, -6921301, -13440182),\n                array(-31436171, 15575146, 30436815, 12192228, -22463353, 9395379, -9917708, -8638997, 12215110, 12028277),\n                array(14098400, 6555944, 23007258, 5757252, -15427832, -12950502, 30123440, 4617780, -16900089, -655628),\n            ),\n            array(\n                array(-4026201, -15240835, 11893168, 13718664, -14809462, 1847385, -15819999, 10154009, 23973261, -12684474),\n                array(-26531820, -3695990, -1908898, 2534301, -31870557, -16550355, 18341390, -11419951, 32013174, -10103539),\n                array(-25479301, 10876443, -11771086, -14625140, -12369567, 1838104, 21911214, 6354752, 4425632, -837822),\n            ),\n            array(\n                array(-10433389, -14612966, 22229858, -3091047, -13191166, 776729, -17415375, -12020462, 4725005, 14044970),\n                array(19268650, -7304421, 1555349, 8692754, -21474059, -9910664, 6347390, -1411784, -19522291, -16109756),\n                array(-24864089, 12986008, -10898878, -5558584, -11312371, -148526, 19541418, 8180106, 9282262, 10282508),\n            ),\n            array(\n                array(-26205082, 4428547, -8661196, -13194263, 4098402, -14165257, 15522535, 8372215, 5542595, -10702683),\n                array(-10562541, 14895633, 26814552, -16673850, -17480754, -2489360, -2781891, 6993761, -18093885, 10114655),\n                array(-20107055, -929418, 31422704, 10427861, -7110749, 6150669, -29091755, -11529146, 25953725, -106158),\n            ),\n            array(\n                array(-4234397, -8039292, -9119125, 3046000, 2101609, -12607294, 19390020, 6094296, -3315279, 12831125),\n                array(-15998678, 7578152, 5310217, 14408357, -33548620, -224739, 31575954, 6326196, 7381791, -2421839),\n                array(-20902779, 3296811, 24736065, -16328389, 18374254, 7318640, 6295303, 8082724, -15362489, 12339664),\n            ),\n            array(\n                array(27724736, 2291157, 6088201, -14184798, 1792727, 5857634, 13848414, 15768922, 25091167, 14856294),\n                array(-18866652, 8331043, 24373479, 8541013, -701998, -9269457, 12927300, -12695493, -22182473, -9012899),\n                array(-11423429, -5421590, 11632845, 3405020, 30536730, -11674039, -27260765, 13866390, 30146206, 9142070),\n            ),\n            array(\n                array(3924129, -15307516, -13817122, -10054960, 12291820, -668366, -27702774, 9326384, -8237858, 4171294),\n                array(-15921940, 16037937, 6713787, 16606682, -21612135, 2790944, 26396185, 3731949, 345228, -5462949),\n                array(-21327538, 13448259, 25284571, 1143661, 20614966, -8849387, 2031539, -12391231, -16253183, -13582083),\n            ),\n            array(\n                array(31016211, -16722429, 26371392, -14451233, -5027349, 14854137, 17477601, 3842657, 28012650, -16405420),\n                array(-5075835, 9368966, -8562079, -4600902, -15249953, 6970560, -9189873, 16292057, -8867157, 3507940),\n                array(29439664, 3537914, 23333589, 6997794, -17555561, -11018068, -15209202, -15051267, -9164929, 6580396),\n            ),\n        ),\n        array(\n            array(\n                array(-12185861, -7679788, 16438269, 10826160, -8696817, -6235611, 17860444, -9273846, -2095802, 9304567),\n                array(20714564, -4336911, 29088195, 7406487, 11426967, -5095705, 14792667, -14608617, 5289421, -477127),\n                array(-16665533, -10650790, -6160345, -13305760, 9192020, -1802462, 17271490, 12349094, 26939669, -3752294),\n            ),\n            array(\n                array(-12889898, 9373458, 31595848, 16374215, 21471720, 13221525, -27283495, -12348559, -3698806, 117887),\n                array(22263325, -6560050, 3984570, -11174646, -15114008, -566785, 28311253, 5358056, -23319780, 541964),\n                array(16259219, 3261970, 2309254, -15534474, -16885711, -4581916, 24134070, -16705829, -13337066, -13552195),\n            ),\n            array(\n                array(9378160, -13140186, -22845982, -12745264, 28198281, -7244098, -2399684, -717351, 690426, 14876244),\n                array(24977353, -314384, -8223969, -13465086, 28432343, -1176353, -13068804, -12297348, -22380984, 6618999),\n                array(-1538174, 11685646, 12944378, 13682314, -24389511, -14413193, 8044829, -13817328, 32239829, -5652762),\n            ),\n            array(\n                array(-18603066, 4762990, -926250, 8885304, -28412480, -3187315, 9781647, -10350059, 32779359, 5095274),\n                array(-33008130, -5214506, -32264887, -3685216, 9460461, -9327423, -24601656, 14506724, 21639561, -2630236),\n                array(-16400943, -13112215, 25239338, 15531969, 3987758, -4499318, -1289502, -6863535, 17874574, 558605),\n            ),\n            array(\n                array(-13600129, 10240081, 9171883, 16131053, -20869254, 9599700, 33499487, 5080151, 2085892, 5119761),\n                array(-22205145, -2519528, -16381601, 414691, -25019550, 2170430, 30634760, -8363614, -31999993, -5759884),\n                array(-6845704, 15791202, 8550074, -1312654, 29928809, -12092256, 27534430, -7192145, -22351378, 12961482),\n            ),\n            array(\n                array(-24492060, -9570771, 10368194, 11582341, -23397293, -2245287, 16533930, 8206996, -30194652, -5159638),\n                array(-11121496, -3382234, 2307366, 6362031, -135455, 8868177, -16835630, 7031275, 7589640, 8945490),\n                array(-32152748, 8917967, 6661220, -11677616, -1192060, -15793393, 7251489, -11182180, 24099109, -14456170),\n            ),\n            array(\n                array(5019558, -7907470, 4244127, -14714356, -26933272, 6453165, -19118182, -13289025, -6231896, -10280736),\n                array(10853594, 10721687, 26480089, 5861829, -22995819, 1972175, -1866647, -10557898, -3363451, -6441124),\n                array(-17002408, 5906790, 221599, -6563147, 7828208, -13248918, 24362661, -2008168, -13866408, 7421392),\n            ),\n            array(\n                array(8139927, -6546497, 32257646, -5890546, 30375719, 1886181, -21175108, 15441252, 28826358, -4123029),\n                array(6267086, 9695052, 7709135, -16603597, -32869068, -1886135, 14795160, -7840124, 13746021, -1742048),\n                array(28584902, 7787108, -6732942, -15050729, 22846041, -7571236, -3181936, -363524, 4771362, -8419958),\n            ),\n        ),\n        array(\n            array(\n                array(24949256, 6376279, -27466481, -8174608, -18646154, -9930606, 33543569, -12141695, 3569627, 11342593),\n                array(26514989, 4740088, 27912651, 3697550, 19331575, -11472339, 6809886, 4608608, 7325975, -14801071),\n                array(-11618399, -14554430, -24321212, 7655128, -1369274, 5214312, -27400540, 10258390, -17646694, -8186692),\n            ),\n            array(\n                array(11431204, 15823007, 26570245, 14329124, 18029990, 4796082, -31446179, 15580664, 9280358, -3973687),\n                array(-160783, -10326257, -22855316, -4304997, -20861367, -13621002, -32810901, -11181622, -15545091, 4387441),\n                array(-20799378, 12194512, 3937617, -5805892, -27154820, 9340370, -24513992, 8548137, 20617071, -7482001),\n            ),\n            array(\n                array(-938825, -3930586, -8714311, 16124718, 24603125, -6225393, -13775352, -11875822, 24345683, 10325460),\n                array(-19855277, -1568885, -22202708, 8714034, 14007766, 6928528, 16318175, -1010689, 4766743, 3552007),\n                array(-21751364, -16730916, 1351763, -803421, -4009670, 3950935, 3217514, 14481909, 10988822, -3994762),\n            ),\n            array(\n                array(15564307, -14311570, 3101243, 5684148, 30446780, -8051356, 12677127, -6505343, -8295852, 13296005),\n                array(-9442290, 6624296, -30298964, -11913677, -4670981, -2057379, 31521204, 9614054, -30000824, 12074674),\n                array(4771191, -135239, 14290749, -13089852, 27992298, 14998318, -1413936, -1556716, 29832613, -16391035),\n            ),\n            array(\n                array(7064884, -7541174, -19161962, -5067537, -18891269, -2912736, 25825242, 5293297, -27122660, 13101590),\n                array(-2298563, 2439670, -7466610, 1719965, -27267541, -16328445, 32512469, -5317593, -30356070, -4190957),\n                array(-30006540, 10162316, -33180176, 3981723, -16482138, -13070044, 14413974, 9515896, 19568978, 9628812),\n            ),\n            array(\n                array(33053803, 199357, 15894591, 1583059, 27380243, -4580435, -17838894, -6106839, -6291786, 3437740),\n                array(-18978877, 3884493, 19469877, 12726490, 15913552, 13614290, -22961733, 70104, 7463304, 4176122),\n                array(-27124001, 10659917, 11482427, -16070381, 12771467, -6635117, -32719404, -5322751, 24216882, 5944158),\n            ),\n            array(\n                array(8894125, 7450974, -2664149, -9765752, -28080517, -12389115, 19345746, 14680796, 11632993, 5847885),\n                array(26942781, -2315317, 9129564, -4906607, 26024105, 11769399, -11518837, 6367194, -9727230, 4782140),\n                array(19916461, -4828410, -22910704, -11414391, 25606324, -5972441, 33253853, 8220911, 6358847, -1873857),\n            ),\n            array(\n                array(801428, -2081702, 16569428, 11065167, 29875704, 96627, 7908388, -4480480, -13538503, 1387155),\n                array(19646058, 5720633, -11416706, 12814209, 11607948, 12749789, 14147075, 15156355, -21866831, 11835260),\n                array(19299512, 1155910, 28703737, 14890794, 2925026, 7269399, 26121523, 15467869, -26560550, 5052483),\n            ),\n        ),\n        array(\n            array(\n                array(-3017432, 10058206, 1980837, 3964243, 22160966, 12322533, -6431123, -12618185, 12228557, -7003677),\n                array(32944382, 14922211, -22844894, 5188528, 21913450, -8719943, 4001465, 13238564, -6114803, 8653815),\n                array(22865569, -4652735, 27603668, -12545395, 14348958, 8234005, 24808405, 5719875, 28483275, 2841751),\n            ),\n            array(\n                array(-16420968, -1113305, -327719, -12107856, 21886282, -15552774, -1887966, -315658, 19932058, -12739203),\n                array(-11656086, 10087521, -8864888, -5536143, -19278573, -3055912, 3999228, 13239134, -4777469, -13910208),\n                array(1382174, -11694719, 17266790, 9194690, -13324356, 9720081, 20403944, 11284705, -14013818, 3093230),\n            ),\n            array(\n                array(16650921, -11037932, -1064178, 1570629, -8329746, 7352753, -302424, 16271225, -24049421, -6691850),\n                array(-21911077, -5927941, -4611316, -5560156, -31744103, -10785293, 24123614, 15193618, -21652117, -16739389),\n                array(-9935934, -4289447, -25279823, 4372842, 2087473, 10399484, 31870908, 14690798, 17361620, 11864968),\n            ),\n            array(\n                array(-11307610, 6210372, 13206574, 5806320, -29017692, -13967200, -12331205, -7486601, -25578460, -16240689),\n                array(14668462, -12270235, 26039039, 15305210, 25515617, 4542480, 10453892, 6577524, 9145645, -6443880),\n                array(5974874, 3053895, -9433049, -10385191, -31865124, 3225009, -7972642, 3936128, -5652273, -3050304),\n            ),\n            array(\n                array(30625386, -4729400, -25555961, -12792866, -20484575, 7695099, 17097188, -16303496, -27999779, 1803632),\n                array(-3553091, 9865099, -5228566, 4272701, -5673832, -16689700, 14911344, 12196514, -21405489, 7047412),\n                array(20093277, 9920966, -11138194, -5343857, 13161587, 12044805, -32856851, 4124601, -32343828, -10257566),\n            ),\n            array(\n                array(-20788824, 14084654, -13531713, 7842147, 19119038, -13822605, 4752377, -8714640, -21679658, 2288038),\n                array(-26819236, -3283715, 29965059, 3039786, -14473765, 2540457, 29457502, 14625692, -24819617, 12570232),\n                array(-1063558, -11551823, 16920318, 12494842, 1278292, -5869109, -21159943, -3498680, -11974704, 4724943),\n            ),\n            array(\n                array(17960970, -11775534, -4140968, -9702530, -8876562, -1410617, -12907383, -8659932, -29576300, 1903856),\n                array(23134274, -14279132, -10681997, -1611936, 20684485, 15770816, -12989750, 3190296, 26955097, 14109738),\n                array(15308788, 5320727, -30113809, -14318877, 22902008, 7767164, 29425325, -11277562, 31960942, 11934971),\n            ),\n            array(\n                array(-27395711, 8435796, 4109644, 12222639, -24627868, 14818669, 20638173, 4875028, 10491392, 1379718),\n                array(-13159415, 9197841, 3875503, -8936108, -1383712, -5879801, 33518459, 16176658, 21432314, 12180697),\n                array(-11787308, 11500838, 13787581, -13832590, -22430679, 10140205, 1465425, 12689540, -10301319, -13872883),\n            ),\n        ),\n        array(\n            array(\n                array(5414091, -15386041, -21007664, 9643570, 12834970, 1186149, -2622916, -1342231, 26128231, 6032912),\n                array(-26337395, -13766162, 32496025, -13653919, 17847801, -12669156, 3604025, 8316894, -25875034, -10437358),\n                array(3296484, 6223048, 24680646, -12246460, -23052020, 5903205, -8862297, -4639164, 12376617, 3188849),\n            ),\n            array(\n                array(29190488, -14659046, 27549113, -1183516, 3520066, -10697301, 32049515, -7309113, -16109234, -9852307),\n                array(-14744486, -9309156, 735818, -598978, -20407687, -5057904, 25246078, -15795669, 18640741, -960977),\n                array(-6928835, -16430795, 10361374, 5642961, 4910474, 12345252, -31638386, -494430, 10530747, 1053335),\n            ),\n            array(\n                array(-29265967, -14186805, -13538216, -12117373, -19457059, -10655384, -31462369, -2948985, 24018831, 15026644),\n                array(-22592535, -3145277, -2289276, 5953843, -13440189, 9425631, 25310643, 13003497, -2314791, -15145616),\n                array(-27419985, -603321, -8043984, -1669117, -26092265, 13987819, -27297622, 187899, -23166419, -2531735),\n            ),\n            array(\n                array(-21744398, -13810475, 1844840, 5021428, -10434399, -15911473, 9716667, 16266922, -5070217, 726099),\n                array(29370922, -6053998, 7334071, -15342259, 9385287, 2247707, -13661962, -4839461, 30007388, -15823341),\n                array(-936379, 16086691, 23751945, -543318, -1167538, -5189036, 9137109, 730663, 9835848, 4555336),\n            ),\n            array(\n                array(-23376435, 1410446, -22253753, -12899614, 30867635, 15826977, 17693930, 544696, -11985298, 12422646),\n                array(31117226, -12215734, -13502838, 6561947, -9876867, -12757670, -5118685, -4096706, 29120153, 13924425),\n                array(-17400879, -14233209, 19675799, -2734756, -11006962, -5858820, -9383939, -11317700, 7240931, -237388),\n            ),\n            array(\n                array(-31361739, -11346780, -15007447, -5856218, -22453340, -12152771, 1222336, 4389483, 3293637, -15551743),\n                array(-16684801, -14444245, 11038544, 11054958, -13801175, -3338533, -24319580, 7733547, 12796905, -6335822),\n                array(-8759414, -10817836, -25418864, 10783769, -30615557, -9746811, -28253339, 3647836, 3222231, -11160462),\n            ),\n            array(\n                array(18606113, 1693100, -25448386, -15170272, 4112353, 10045021, 23603893, -2048234, -7550776, 2484985),\n                array(9255317, -3131197, -12156162, -1004256, 13098013, -9214866, 16377220, -2102812, -19802075, -3034702),\n                array(-22729289, 7496160, -5742199, 11329249, 19991973, -3347502, -31718148, 9936966, -30097688, -10618797),\n            ),\n            array(\n                array(21878590, -5001297, 4338336, 13643897, -3036865, 13160960, 19708896, 5415497, -7360503, -4109293),\n                array(27736861, 10103576, 12500508, 8502413, -3413016, -9633558, 10436918, -1550276, -23659143, -8132100),\n                array(19492550, -12104365, -29681976, -852630, -3208171, 12403437, 30066266, 8367329, 13243957, 8709688),\n            ),\n        ),\n        array(\n            array(\n                array(12015105, 2801261, 28198131, 10151021, 24818120, -4743133, -11194191, -5645734, 5150968, 7274186),\n                array(2831366, -12492146, 1478975, 6122054, 23825128, -12733586, 31097299, 6083058, 31021603, -9793610),\n                array(-2529932, -2229646, 445613, 10720828, -13849527, -11505937, -23507731, 16354465, 15067285, -14147707),\n            ),\n            array(\n                array(7840942, 14037873, -33364863, 15934016, -728213, -3642706, 21403988, 1057586, -19379462, -12403220),\n                array(915865, -16469274, 15608285, -8789130, -24357026, 6060030, -17371319, 8410997, -7220461, 16527025),\n                array(32922597, -556987, 20336074, -16184568, 10903705, -5384487, 16957574, 52992, 23834301, 6588044),\n            ),\n            array(\n                array(32752030, 11232950, 3381995, -8714866, 22652988, -10744103, 17159699, 16689107, -20314580, -1305992),\n                array(-4689649, 9166776, -25710296, -10847306, 11576752, 12733943, 7924251, -2752281, 1976123, -7249027),\n                array(21251222, 16309901, -2983015, -6783122, 30810597, 12967303, 156041, -3371252, 12331345, -8237197),\n            ),\n            array(\n                array(8651614, -4477032, -16085636, -4996994, 13002507, 2950805, 29054427, -5106970, 10008136, -4667901),\n                array(31486080, 15114593, -14261250, 12951354, 14369431, -7387845, 16347321, -13662089, 8684155, -10532952),\n                array(19443825, 11385320, 24468943, -9659068, -23919258, 2187569, -26263207, -6086921, 31316348, 14219878),\n            ),\n            array(\n                array(-28594490, 1193785, 32245219, 11392485, 31092169, 15722801, 27146014, 6992409, 29126555, 9207390),\n                array(32382935, 1110093, 18477781, 11028262, -27411763, -7548111, -4980517, 10843782, -7957600, -14435730),\n                array(2814918, 7836403, 27519878, -7868156, -20894015, -11553689, -21494559, 8550130, 28346258, 1994730),\n            ),\n            array(\n                array(-19578299, 8085545, -14000519, -3948622, 2785838, -16231307, -19516951, 7174894, 22628102, 8115180),\n                array(-30405132, 955511, -11133838, -15078069, -32447087, -13278079, -25651578, 3317160, -9943017, 930272),\n                array(-15303681, -6833769, 28856490, 1357446, 23421993, 1057177, 24091212, -1388970, -22765376, -10650715),\n            ),\n            array(\n                array(-22751231, -5303997, -12907607, -12768866, -15811511, -7797053, -14839018, -16554220, -1867018, 8398970),\n                array(-31969310, 2106403, -4736360, 1362501, 12813763, 16200670, 22981545, -6291273, 18009408, -15772772),\n                array(-17220923, -9545221, -27784654, 14166835, 29815394, 7444469, 29551787, -3727419, 19288549, 1325865),\n            ),\n            array(\n                array(15100157, -15835752, -23923978, -1005098, -26450192, 15509408, 12376730, -3479146, 33166107, -8042750),\n                array(20909231, 13023121, -9209752, 16251778, -5778415, -8094914, 12412151, 10018715, 2213263, -13878373),\n                array(32529814, -11074689, 30361439, -16689753, -9135940, 1513226, 22922121, 6382134, -5766928, 8371348),\n            ),\n        ),\n        array(\n            array(\n                array(9923462, 11271500, 12616794, 3544722, -29998368, -1721626, 12891687, -8193132, -26442943, 10486144),\n                array(-22597207, -7012665, 8587003, -8257861, 4084309, -12970062, 361726, 2610596, -23921530, -11455195),\n                array(5408411, -1136691, -4969122, 10561668, 24145918, 14240566, 31319731, -4235541, 19985175, -3436086),\n            ),\n            array(\n                array(-13994457, 16616821, 14549246, 3341099, 32155958, 13648976, -17577068, 8849297, 65030, 8370684),\n                array(-8320926, -12049626, 31204563, 5839400, -20627288, -1057277, -19442942, 6922164, 12743482, -9800518),\n                array(-2361371, 12678785, 28815050, 4759974, -23893047, 4884717, 23783145, 11038569, 18800704, 255233),\n            ),\n            array(\n                array(-5269658, -1773886, 13957886, 7990715, 23132995, 728773, 13393847, 9066957, 19258688, -14753793),\n                array(-2936654, -10827535, -10432089, 14516793, -3640786, 4372541, -31934921, 2209390, -1524053, 2055794),\n                array(580882, 16705327, 5468415, -2683018, -30926419, -14696000, -7203346, -8994389, -30021019, 7394435),\n            ),\n            array(\n                array(23838809, 1822728, -15738443, 15242727, 8318092, -3733104, -21672180, -3492205, -4821741, 14799921),\n                array(13345610, 9759151, 3371034, -16137791, 16353039, 8577942, 31129804, 13496856, -9056018, 7402518),\n                array(2286874, -4435931, -20042458, -2008336, -13696227, 5038122, 11006906, -15760352, 8205061, 1607563),\n            ),\n            array(\n                array(14414086, -8002132, 3331830, -3208217, 22249151, -5594188, 18364661, -2906958, 30019587, -9029278),\n                array(-27688051, 1585953, -10775053, 931069, -29120221, -11002319, -14410829, 12029093, 9944378, 8024),\n                array(4368715, -3709630, 29874200, -15022983, -20230386, -11410704, -16114594, -999085, -8142388, 5640030),\n            ),\n            array(\n                array(10299610, 13746483, 11661824, 16234854, 7630238, 5998374, 9809887, -16694564, 15219798, -14327783),\n                array(27425505, -5719081, 3055006, 10660664, 23458024, 595578, -15398605, -1173195, -18342183, 9742717),\n                array(6744077, 2427284, 26042789, 2720740, -847906, 1118974, 32324614, 7406442, 12420155, 1994844),\n            ),\n            array(\n                array(14012521, -5024720, -18384453, -9578469, -26485342, -3936439, -13033478, -10909803, 24319929, -6446333),\n                array(16412690, -4507367, 10772641, 15929391, -17068788, -4658621, 10555945, -10484049, -30102368, -4739048),\n                array(22397382, -7767684, -9293161, -12792868, 17166287, -9755136, -27333065, 6199366, 21880021, -12250760),\n            ),\n            array(\n                array(-4283307, 5368523, -31117018, 8163389, -30323063, 3209128, 16557151, 8890729, 8840445, 4957760),\n                array(-15447727, 709327, -6919446, -10870178, -29777922, 6522332, -21720181, 12130072, -14796503, 5005757),\n                array(-2114751, -14308128, 23019042, 15765735, -25269683, 6002752, 10183197, -13239326, -16395286, -2176112),\n            ),\n        ),\n        array(\n            array(\n                array(-19025756, 1632005, 13466291, -7995100, -23640451, 16573537, -32013908, -3057104, 22208662, 2000468),\n                array(3065073, -1412761, -25598674, -361432, -17683065, -5703415, -8164212, 11248527, -3691214, -7414184),\n                array(10379208, -6045554, 8877319, 1473647, -29291284, -12507580, 16690915, 2553332, -3132688, 16400289),\n            ),\n            array(\n                array(15716668, 1254266, -18472690, 7446274, -8448918, 6344164, -22097271, -7285580, 26894937, 9132066),\n                array(24158887, 12938817, 11085297, -8177598, -28063478, -4457083, -30576463, 64452, -6817084, -2692882),\n                array(13488534, 7794716, 22236231, 5989356, 25426474, -12578208, 2350710, -3418511, -4688006, 2364226),\n            ),\n            array(\n                array(16335052, 9132434, 25640582, 6678888, 1725628, 8517937, -11807024, -11697457, 15445875, -7798101),\n                array(29004207, -7867081, 28661402, -640412, -12794003, -7943086, 31863255, -4135540, -278050, -15759279),\n                array(-6122061, -14866665, -28614905, 14569919, -10857999, -3591829, 10343412, -6976290, -29828287, -10815811),\n            ),\n            array(\n                array(27081650, 3463984, 14099042, -4517604, 1616303, -6205604, 29542636, 15372179, 17293797, 960709),\n                array(20263915, 11434237, -5765435, 11236810, 13505955, -10857102, -16111345, 6493122, -19384511, 7639714),\n                array(-2830798, -14839232, 25403038, -8215196, -8317012, -16173699, 18006287, -16043750, 29994677, -15808121),\n            ),\n            array(\n                array(9769828, 5202651, -24157398, -13631392, -28051003, -11561624, -24613141, -13860782, -31184575, 709464),\n                array(12286395, 13076066, -21775189, -1176622, -25003198, 4057652, -32018128, -8890874, 16102007, 13205847),\n                array(13733362, 5599946, 10557076, 3195751, -5557991, 8536970, -25540170, 8525972, 10151379, 10394400),\n            ),\n            array(\n                array(4024660, -16137551, 22436262, 12276534, -9099015, -2686099, 19698229, 11743039, -33302334, 8934414),\n                array(-15879800, -4525240, -8580747, -2934061, 14634845, -698278, -9449077, 3137094, -11536886, 11721158),\n                array(17555939, -5013938, 8268606, 2331751, -22738815, 9761013, 9319229, 8835153, -9205489, -1280045),\n            ),\n            array(\n                array(-461409, -7830014, 20614118, 16688288, -7514766, -4807119, 22300304, 505429, 6108462, -6183415),\n                array(-5070281, 12367917, -30663534, 3234473, 32617080, -8422642, 29880583, -13483331, -26898490, -7867459),\n                array(-31975283, 5726539, 26934134, 10237677, -3173717, -605053, 24199304, 3795095, 7592688, -14992079),\n            ),\n            array(\n                array(21594432, -14964228, 17466408, -4077222, 32537084, 2739898, 6407723, 12018833, -28256052, 4298412),\n                array(-20650503, -11961496, -27236275, 570498, 3767144, -1717540, 13891942, -1569194, 13717174, 10805743),\n                array(-14676630, -15644296, 15287174, 11927123, 24177847, -8175568, -796431, 14860609, -26938930, -5863836),\n            ),\n        ),\n        array(\n            array(\n                array(12962541, 5311799, -10060768, 11658280, 18855286, -7954201, 13286263, -12808704, -4381056, 9882022),\n                array(18512079, 11319350, -20123124, 15090309, 18818594, 5271736, -22727904, 3666879, -23967430, -3299429),\n                array(-6789020, -3146043, 16192429, 13241070, 15898607, -14206114, -10084880, -6661110, -2403099, 5276065),\n            ),\n            array(\n                array(30169808, -5317648, 26306206, -11750859, 27814964, 7069267, 7152851, 3684982, 1449224, 13082861),\n                array(10342826, 3098505, 2119311, 193222, 25702612, 12233820, 23697382, 15056736, -21016438, -8202000),\n                array(-33150110, 3261608, 22745853, 7948688, 19370557, -15177665, -26171976, 6482814, -10300080, -11060101),\n            ),\n            array(\n                array(32869458, -5408545, 25609743, 15678670, -10687769, -15471071, 26112421, 2521008, -22664288, 6904815),\n                array(29506923, 4457497, 3377935, -9796444, -30510046, 12935080, 1561737, 3841096, -29003639, -6657642),\n                array(10340844, -6630377, -18656632, -2278430, 12621151, -13339055, 30878497, -11824370, -25584551, 5181966),\n            ),\n            array(\n                array(25940115, -12658025, 17324188, -10307374, -8671468, 15029094, 24396252, -16450922, -2322852, -12388574),\n                array(-21765684, 9916823, -1300409, 4079498, -1028346, 11909559, 1782390, 12641087, 20603771, -6561742),\n                array(-18882287, -11673380, 24849422, 11501709, 13161720, -4768874, 1925523, 11914390, 4662781, 7820689),\n            ),\n            array(\n                array(12241050, -425982, 8132691, 9393934, 32846760, -1599620, 29749456, 12172924, 16136752, 15264020),\n                array(-10349955, -14680563, -8211979, 2330220, -17662549, -14545780, 10658213, 6671822, 19012087, 3772772),\n                array(3753511, -3421066, 10617074, 2028709, 14841030, -6721664, 28718732, -15762884, 20527771, 12988982),\n            ),\n            array(\n                array(-14822485, -5797269, -3707987, 12689773, -898983, -10914866, -24183046, -10564943, 3299665, -12424953),\n                array(-16777703, -15253301, -9642417, 4978983, 3308785, 8755439, 6943197, 6461331, -25583147, 8991218),\n                array(-17226263, 1816362, -1673288, -6086439, 31783888, -8175991, -32948145, 7417950, -30242287, 1507265),\n            ),\n            array(\n                array(29692663, 6829891, -10498800, 4334896, 20945975, -11906496, -28887608, 8209391, 14606362, -10647073),\n                array(-3481570, 8707081, 32188102, 5672294, 22096700, 1711240, -33020695, 9761487, 4170404, -2085325),\n                array(-11587470, 14855945, -4127778, -1531857, -26649089, 15084046, 22186522, 16002000, -14276837, -8400798),\n            ),\n            array(\n                array(-4811456, 13761029, -31703877, -2483919, -3312471, 7869047, -7113572, -9620092, 13240845, 10965870),\n                array(-7742563, -8256762, -14768334, -13656260, -23232383, 12387166, 4498947, 14147411, 29514390, 4302863),\n                array(-13413405, -12407859, 20757302, -13801832, 14785143, 8976368, -5061276, -2144373, 17846988, -13971927),\n            ),\n        ),\n        array(\n            array(\n                array(-2244452, -754728, -4597030, -1066309, -6247172, 1455299, -21647728, -9214789, -5222701, 12650267),\n                array(-9906797, -16070310, 21134160, 12198166, -27064575, 708126, 387813, 13770293, -19134326, 10958663),\n                array(22470984, 12369526, 23446014, -5441109, -21520802, -9698723, -11772496, -11574455, -25083830, 4271862),\n            ),\n            array(\n                array(-25169565, -10053642, -19909332, 15361595, -5984358, 2159192, 75375, -4278529, -32526221, 8469673),\n                array(15854970, 4148314, -8893890, 7259002, 11666551, 13824734, -30531198, 2697372, 24154791, -9460943),\n                array(15446137, -15806644, 29759747, 14019369, 30811221, -9610191, -31582008, 12840104, 24913809, 9815020),\n            ),\n            array(\n                array(-4709286, -5614269, -31841498, -12288893, -14443537, 10799414, -9103676, 13438769, 18735128, 9466238),\n                array(11933045, 9281483, 5081055, -5183824, -2628162, -4905629, -7727821, -10896103, -22728655, 16199064),\n                array(14576810, 379472, -26786533, -8317236, -29426508, -10812974, -102766, 1876699, 30801119, 2164795),\n            ),\n            array(\n                array(15995086, 3199873, 13672555, 13712240, -19378835, -4647646, -13081610, -15496269, -13492807, 1268052),\n                array(-10290614, -3659039, -3286592, 10948818, 23037027, 3794475, -3470338, -12600221, -17055369, 3565904),\n                array(29210088, -9419337, -5919792, -4952785, 10834811, -13327726, -16512102, -10820713, -27162222, -14030531),\n            ),\n            array(\n                array(-13161890, 15508588, 16663704, -8156150, -28349942, 9019123, -29183421, -3769423, 2244111, -14001979),\n                array(-5152875, -3800936, -9306475, -6071583, 16243069, 14684434, -25673088, -16180800, 13491506, 4641841),\n                array(10813417, 643330, -19188515, -728916, 30292062, -16600078, 27548447, -7721242, 14476989, -12767431),\n            ),\n            array(\n                array(10292079, 9984945, 6481436, 8279905, -7251514, 7032743, 27282937, -1644259, -27912810, 12651324),\n                array(-31185513, -813383, 22271204, 11835308, 10201545, 15351028, 17099662, 3988035, 21721536, -3148940),\n                array(10202177, -6545839, -31373232, -9574638, -32150642, -8119683, -12906320, 3852694, 13216206, 14842320),\n            ),\n            array(\n                array(-15815640, -10601066, -6538952, -7258995, -6984659, -6581778, -31500847, 13765824, -27434397, 9900184),\n                array(14465505, -13833331, -32133984, -14738873, -27443187, 12990492, 33046193, 15796406, -7051866, -8040114),\n                array(30924417, -8279620, 6359016, -12816335, 16508377, 9071735, -25488601, 15413635, 9524356, -7018878),\n            ),\n            array(\n                array(12274201, -13175547, 32627641, -1785326, 6736625, 13267305, 5237659, -5109483, 15663516, 4035784),\n                array(-2951309, 8903985, 17349946, 601635, -16432815, -4612556, -13732739, -15889334, -22258478, 4659091),\n                array(-16916263, -4952973, -30393711, -15158821, 20774812, 15897498, 5736189, 15026997, -2178256, -13455585),\n            ),\n        ),\n        array(\n            array(\n                array(-8858980, -2219056, 28571666, -10155518, -474467, -10105698, -3801496, 278095, 23440562, -290208),\n                array(10226241, -5928702, 15139956, 120818, -14867693, 5218603, 32937275, 11551483, -16571960, -7442864),\n                array(17932739, -12437276, -24039557, 10749060, 11316803, 7535897, 22503767, 5561594, -3646624, 3898661),\n            ),\n            array(\n                array(7749907, -969567, -16339731, -16464, -25018111, 15122143, -1573531, 7152530, 21831162, 1245233),\n                array(26958459, -14658026, 4314586, 8346991, -5677764, 11960072, -32589295, -620035, -30402091, -16716212),\n                array(-12165896, 9166947, 33491384, 13673479, 29787085, 13096535, 6280834, 14587357, -22338025, 13987525),\n            ),\n            array(\n                array(-24349909, 7778775, 21116000, 15572597, -4833266, -5357778, -4300898, -5124639, -7469781, -2858068),\n                array(9681908, -6737123, -31951644, 13591838, -6883821, 386950, 31622781, 6439245, -14581012, 4091397),\n                array(-8426427, 1470727, -28109679, -1596990, 3978627, -5123623, -19622683, 12092163, 29077877, -14741988),\n            ),\n            array(\n                array(5269168, -6859726, -13230211, -8020715, 25932563, 1763552, -5606110, -5505881, -20017847, 2357889),\n                array(32264008, -15407652, -5387735, -1160093, -2091322, -3946900, 23104804, -12869908, 5727338, 189038),\n                array(14609123, -8954470, -6000566, -16622781, -14577387, -7743898, -26745169, 10942115, -25888931, -14884697),\n            ),\n            array(\n                array(20513500, 5557931, -15604613, 7829531, 26413943, -2019404, -21378968, 7471781, 13913677, -5137875),\n                array(-25574376, 11967826, 29233242, 12948236, -6754465, 4713227, -8940970, 14059180, 12878652, 8511905),\n                array(-25656801, 3393631, -2955415, -7075526, -2250709, 9366908, -30223418, 6812974, 5568676, -3127656),\n            ),\n            array(\n                array(11630004, 12144454, 2116339, 13606037, 27378885, 15676917, -17408753, -13504373, -14395196, 8070818),\n                array(27117696, -10007378, -31282771, -5570088, 1127282, 12772488, -29845906, 10483306, -11552749, -1028714),\n                array(10637467, -5688064, 5674781, 1072708, -26343588, -6982302, -1683975, 9177853, -27493162, 15431203),\n            ),\n            array(\n                array(20525145, 10892566, -12742472, 12779443, -29493034, 16150075, -28240519, 14943142, -15056790, -7935931),\n                array(-30024462, 5626926, -551567, -9981087, 753598, 11981191, 25244767, -3239766, -3356550, 9594024),\n                array(-23752644, 2636870, -5163910, -10103818, 585134, 7877383, 11345683, -6492290, 13352335, -10977084),\n            ),\n            array(\n                array(-1931799, -5407458, 3304649, -12884869, 17015806, -4877091, -29783850, -7752482, -13215537, -319204),\n                array(20239939, 6607058, 6203985, 3483793, -18386976, -779229, -20723742, 15077870, -22750759, 14523817),\n                array(27406042, -6041657, 27423596, -4497394, 4996214, 10002360, -28842031, -4545494, -30172742, -4805667),\n            ),\n        ),\n        array(\n            array(\n                array(11374242, 12660715, 17861383, -12540833, 10935568, 1099227, -13886076, -9091740, -27727044, 11358504),\n                array(-12730809, 10311867, 1510375, 10778093, -2119455, -9145702, 32676003, 11149336, -26123651, 4985768),\n                array(-19096303, 341147, -6197485, -239033, 15756973, -8796662, -983043, 13794114, -19414307, -15621255),\n            ),\n            array(\n                array(6490081, 11940286, 25495923, -7726360, 8668373, -8751316, 3367603, 6970005, -1691065, -9004790),\n                array(1656497, 13457317, 15370807, 6364910, 13605745, 8362338, -19174622, -5475723, -16796596, -5031438),\n                array(-22273315, -13524424, -64685, -4334223, -18605636, -10921968, -20571065, -7007978, -99853, -10237333),\n            ),\n            array(\n                array(17747465, 10039260, 19368299, -4050591, -20630635, -16041286, 31992683, -15857976, -29260363, -5511971),\n                array(31932027, -4986141, -19612382, 16366580, 22023614, 88450, 11371999, -3744247, 4882242, -10626905),\n                array(29796507, 37186, 19818052, 10115756, -11829032, 3352736, 18551198, 3272828, -5190932, -4162409),\n            ),\n            array(\n                array(12501286, 4044383, -8612957, -13392385, -32430052, 5136599, -19230378, -3529697, 330070, -3659409),\n                array(6384877, 2899513, 17807477, 7663917, -2358888, 12363165, 25366522, -8573892, -271295, 12071499),\n                array(-8365515, -4042521, 25133448, -4517355, -6211027, 2265927, -32769618, 1936675, -5159697, 3829363),\n            ),\n            array(\n                array(28425966, -5835433, -577090, -4697198, -14217555, 6870930, 7921550, -6567787, 26333140, 14267664),\n                array(-11067219, 11871231, 27385719, -10559544, -4585914, -11189312, 10004786, -8709488, -21761224, 8930324),\n                array(-21197785, -16396035, 25654216, -1725397, 12282012, 11008919, 1541940, 4757911, -26491501, -16408940),\n            ),\n            array(\n                array(13537262, -7759490, -20604840, 10961927, -5922820, -13218065, -13156584, 6217254, -15943699, 13814990),\n                array(-17422573, 15157790, 18705543, 29619, 24409717, -260476, 27361681, 9257833, -1956526, -1776914),\n                array(-25045300, -10191966, 15366585, 15166509, -13105086, 8423556, -29171540, 12361135, -18685978, 4578290),\n            ),\n            array(\n                array(24579768, 3711570, 1342322, -11180126, -27005135, 14124956, -22544529, 14074919, 21964432, 8235257),\n                array(-6528613, -2411497, 9442966, -5925588, 12025640, -1487420, -2981514, -1669206, 13006806, 2355433),\n                array(-16304899, -13605259, -6632427, -5142349, 16974359, -10911083, 27202044, 1719366, 1141648, -12796236),\n            ),\n            array(\n                array(-12863944, -13219986, -8318266, -11018091, -6810145, -4843894, 13475066, -3133972, 32674895, 13715045),\n                array(11423335, -5468059, 32344216, 8962751, 24989809, 9241752, -13265253, 16086212, -28740881, -15642093),\n                array(-1409668, 12530728, -6368726, 10847387, 19531186, -14132160, -11709148, 7791794, -27245943, 4383347),\n            ),\n        ),\n        array(\n            array(\n                array(-28970898, 5271447, -1266009, -9736989, -12455236, 16732599, -4862407, -4906449, 27193557, 6245191),\n                array(-15193956, 5362278, -1783893, 2695834, 4960227, 12840725, 23061898, 3260492, 22510453, 8577507),\n                array(-12632451, 11257346, -32692994, 13548177, -721004, 10879011, 31168030, 13952092, -29571492, -3635906),\n            ),\n            array(\n                array(3877321, -9572739, 32416692, 5405324, -11004407, -13656635, 3759769, 11935320, 5611860, 8164018),\n                array(-16275802, 14667797, 15906460, 12155291, -22111149, -9039718, 32003002, -8832289, 5773085, -8422109),\n                array(-23788118, -8254300, 1950875, 8937633, 18686727, 16459170, -905725, 12376320, 31632953, 190926),\n            ),\n            array(\n                array(-24593607, -16138885, -8423991, 13378746, 14162407, 6901328, -8288749, 4508564, -25341555, -3627528),\n                array(8884438, -5884009, 6023974, 10104341, -6881569, -4941533, 18722941, -14786005, -1672488, 827625),\n                array(-32720583, -16289296, -32503547, 7101210, 13354605, 2659080, -1800575, -14108036, -24878478, 1541286),\n            ),\n            array(\n                array(2901347, -1117687, 3880376, -10059388, -17620940, -3612781, -21802117, -3567481, 20456845, -1885033),\n                array(27019610, 12299467, -13658288, -1603234, -12861660, -4861471, -19540150, -5016058, 29439641, 15138866),\n                array(21536104, -6626420, -32447818, -10690208, -22408077, 5175814, -5420040, -16361163, 7779328, 109896),\n            ),\n            array(\n                array(30279744, 14648750, -8044871, 6425558, 13639621, -743509, 28698390, 12180118, 23177719, -554075),\n                array(26572847, 3405927, -31701700, 12890905, -19265668, 5335866, -6493768, 2378492, 4439158, -13279347),\n                array(-22716706, 3489070, -9225266, -332753, 18875722, -1140095, 14819434, -12731527, -17717757, -5461437),\n            ),\n            array(\n                array(-5056483, 16566551, 15953661, 3767752, -10436499, 15627060, -820954, 2177225, 8550082, -15114165),\n                array(-18473302, 16596775, -381660, 15663611, 22860960, 15585581, -27844109, -3582739, -23260460, -8428588),\n                array(-32480551, 15707275, -8205912, -5652081, 29464558, 2713815, -22725137, 15860482, -21902570, 1494193),\n            ),\n            array(\n                array(-19562091, -14087393, -25583872, -9299552, 13127842, 759709, 21923482, 16529112, 8742704, 12967017),\n                array(-28464899, 1553205, 32536856, -10473729, -24691605, -406174, -8914625, -2933896, -29903758, 15553883),\n                array(21877909, 3230008, 9881174, 10539357, -4797115, 2841332, 11543572, 14513274, 19375923, -12647961),\n            ),\n            array(\n                array(8832269, -14495485, 13253511, 5137575, 5037871, 4078777, 24880818, -6222716, 2862653, 9455043),\n                array(29306751, 5123106, 20245049, -14149889, 9592566, 8447059, -2077124, -2990080, 15511449, 4789663),\n                array(-20679756, 7004547, 8824831, -9434977, -4045704, -3750736, -5754762, 108893, 23513200, 16652362),\n            ),\n        ),\n        array(\n            array(\n                array(-33256173, 4144782, -4476029, -6579123, 10770039, -7155542, -6650416, -12936300, -18319198, 10212860),\n                array(2756081, 8598110, 7383731, -6859892, 22312759, -1105012, 21179801, 2600940, -9988298, -12506466),\n                array(-24645692, 13317462, -30449259, -15653928, 21365574, -10869657, 11344424, 864440, -2499677, -16710063),\n            ),\n            array(\n                array(-26432803, 6148329, -17184412, -14474154, 18782929, -275997, -22561534, 211300, 2719757, 4940997),\n                array(-1323882, 3911313, -6948744, 14759765, -30027150, 7851207, 21690126, 8518463, 26699843, 5276295),\n                array(-13149873, -6429067, 9396249, 365013, 24703301, -10488939, 1321586, 149635, -15452774, 7159369),\n            ),\n            array(\n                array(9987780, -3404759, 17507962, 9505530, 9731535, -2165514, 22356009, 8312176, 22477218, -8403385),\n                array(18155857, -16504990, 19744716, 9006923, 15154154, -10538976, 24256460, -4864995, -22548173, 9334109),\n                array(2986088, -4911893, 10776628, -3473844, 10620590, -7083203, -21413845, 14253545, -22587149, 536906),\n            ),\n            array(\n                array(4377756, 8115836, 24567078, 15495314, 11625074, 13064599, 7390551, 10589625, 10838060, -15420424),\n                array(-19342404, 867880, 9277171, -3218459, -14431572, -1986443, 19295826, -15796950, 6378260, 699185),\n                array(7895026, 4057113, -7081772, -13077756, -17886831, -323126, -716039, 15693155, -5045064, -13373962),\n            ),\n            array(\n                array(-7737563, -5869402, -14566319, -7406919, 11385654, 13201616, 31730678, -10962840, -3918636, -9669325),\n                array(10188286, -15770834, -7336361, 13427543, 22223443, 14896287, 30743455, 7116568, -21786507, 5427593),\n                array(696102, 13206899, 27047647, -10632082, 15285305, -9853179, 10798490, -4578720, 19236243, 12477404),\n            ),\n            array(\n                array(-11229439, 11243796, -17054270, -8040865, -788228, -8167967, -3897669, 11180504, -23169516, 7733644),\n                array(17800790, -14036179, -27000429, -11766671, 23887827, 3149671, 23466177, -10538171, 10322027, 15313801),\n                array(26246234, 11968874, 32263343, -5468728, 6830755, -13323031, -15794704, -101982, -24449242, 10890804),\n            ),\n            array(\n                array(-31365647, 10271363, -12660625, -6267268, 16690207, -13062544, -14982212, 16484931, 25180797, -5334884),\n                array(-586574, 10376444, -32586414, -11286356, 19801893, 10997610, 2276632, 9482883, 316878, 13820577),\n                array(-9882808, -4510367, -2115506, 16457136, -11100081, 11674996, 30756178, -7515054, 30696930, -3712849),\n            ),\n            array(\n                array(32988917, -9603412, 12499366, 7910787, -10617257, -11931514, -7342816, -9985397, -32349517, 7392473),\n                array(-8855661, 15927861, 9866406, -3649411, -2396914, -16655781, -30409476, -9134995, 25112947, -2926644),\n                array(-2504044, -436966, 25621774, -5678772, 15085042, -5479877, -24884878, -13526194, 5537438, -13914319),\n            ),\n        ),\n        array(\n            array(\n                array(-11225584, 2320285, -9584280, 10149187, -33444663, 5808648, -14876251, -1729667, 31234590, 6090599),\n                array(-9633316, 116426, 26083934, 2897444, -6364437, -2688086, 609721, 15878753, -6970405, -9034768),\n                array(-27757857, 247744, -15194774, -9002551, 23288161, -10011936, -23869595, 6503646, 20650474, 1804084),\n            ),\n            array(\n                array(-27589786, 15456424, 8972517, 8469608, 15640622, 4439847, 3121995, -10329713, 27842616, -202328),\n                array(-15306973, 2839644, 22530074, 10026331, 4602058, 5048462, 28248656, 5031932, -11375082, 12714369),\n                array(20807691, -7270825, 29286141, 11421711, -27876523, -13868230, -21227475, 1035546, -19733229, 12796920),\n            ),\n            array(\n                array(12076899, -14301286, -8785001, -11848922, -25012791, 16400684, -17591495, -12899438, 3480665, -15182815),\n                array(-32361549, 5457597, 28548107, 7833186, 7303070, -11953545, -24363064, -15921875, -33374054, 2771025),\n                array(-21389266, 421932, 26597266, 6860826, 22486084, -6737172, -17137485, -4210226, -24552282, 15673397),\n            ),\n            array(\n                array(-20184622, 2338216, 19788685, -9620956, -4001265, -8740893, -20271184, 4733254, 3727144, -12934448),\n                array(6120119, 814863, -11794402, -622716, 6812205, -15747771, 2019594, 7975683, 31123697, -10958981),\n                array(30069250, -11435332, 30434654, 2958439, 18399564, -976289, 12296869, 9204260, -16432438, 9648165),\n            ),\n            array(\n                array(32705432, -1550977, 30705658, 7451065, -11805606, 9631813, 3305266, 5248604, -26008332, -11377501),\n                array(17219865, 2375039, -31570947, -5575615, -19459679, 9219903, 294711, 15298639, 2662509, -16297073),\n                array(-1172927, -7558695, -4366770, -4287744, -21346413, -8434326, 32087529, -1222777, 32247248, -14389861),\n            ),\n            array(\n                array(14312628, 1221556, 17395390, -8700143, -4945741, -8684635, -28197744, -9637817, -16027623, -13378845),\n                array(-1428825, -9678990, -9235681, 6549687, -7383069, -468664, 23046502, 9803137, 17597934, 2346211),\n                array(18510800, 15337574, 26171504, 981392, -22241552, 7827556, -23491134, -11323352, 3059833, -11782870),\n            ),\n            array(\n                array(10141598, 6082907, 17829293, -1947643, 9830092, 13613136, -25556636, -5544586, -33502212, 3592096),\n                array(33114168, -15889352, -26525686, -13343397, 33076705, 8716171, 1151462, 1521897, -982665, -6837803),\n                array(-32939165, -4255815, 23947181, -324178, -33072974, -12305637, -16637686, 3891704, 26353178, 693168),\n            ),\n            array(\n                array(30374239, 1595580, -16884039, 13186931, 4600344, 406904, 9585294, -400668, 31375464, 14369965),\n                array(-14370654, -7772529, 1510301, 6434173, -18784789, -6262728, 32732230, -13108839, 17901441, 16011505),\n                array(18171223, -11934626, -12500402, 15197122, -11038147, -15230035, -19172240, -16046376, 8764035, 12309598),\n            ),\n        ),\n        array(\n            array(\n                array(5975908, -5243188, -19459362, -9681747, -11541277, 14015782, -23665757, 1228319, 17544096, -10593782),\n                array(5811932, -1715293, 3442887, -2269310, -18367348, -8359541, -18044043, -15410127, -5565381, 12348900),\n                array(-31399660, 11407555, 25755363, 6891399, -3256938, 14872274, -24849353, 8141295, -10632534, -585479),\n            ),\n            array(\n                array(-12675304, 694026, -5076145, 13300344, 14015258, -14451394, -9698672, -11329050, 30944593, 1130208),\n                array(8247766, -6710942, -26562381, -7709309, -14401939, -14648910, 4652152, 2488540, 23550156, -271232),\n                array(17294316, -3788438, 7026748, 15626851, 22990044, 113481, 2267737, -5908146, -408818, -137719),\n            ),\n            array(\n                array(16091085, -16253926, 18599252, 7340678, 2137637, -1221657, -3364161, 14550936, 3260525, -7166271),\n                array(-4910104, -13332887, 18550887, 10864893, -16459325, -7291596, -23028869, -13204905, -12748722, 2701326),\n                array(-8574695, 16099415, 4629974, -16340524, -20786213, -6005432, -10018363, 9276971, 11329923, 1862132),\n            ),\n            array(\n                array(14763076, -15903608, -30918270, 3689867, 3511892, 10313526, -21951088, 12219231, -9037963, -940300),\n                array(8894987, -3446094, 6150753, 3013931, 301220, 15693451, -31981216, -2909717, -15438168, 11595570),\n                array(15214962, 3537601, -26238722, -14058872, 4418657, -15230761, 13947276, 10730794, -13489462, -4363670),\n            ),\n            array(\n                array(-2538306, 7682793, 32759013, 263109, -29984731, -7955452, -22332124, -10188635, 977108, 699994),\n                array(-12466472, 4195084, -9211532, 550904, -15565337, 12917920, 19118110, -439841, -30534533, -14337913),\n                array(31788461, -14507657, 4799989, 7372237, 8808585, -14747943, 9408237, -10051775, 12493932, -5409317),\n            ),\n            array(\n                array(-25680606, 5260744, -19235809, -6284470, -3695942, 16566087, 27218280, 2607121, 29375955, 6024730),\n                array(842132, -2794693, -4763381, -8722815, 26332018, -12405641, 11831880, 6985184, -9940361, 2854096),\n                array(-4847262, -7969331, 2516242, -5847713, 9695691, -7221186, 16512645, 960770, 12121869, 16648078),\n            ),\n            array(\n                array(-15218652, 14667096, -13336229, 2013717, 30598287, -464137, -31504922, -7882064, 20237806, 2838411),\n                array(-19288047, 4453152, 15298546, -16178388, 22115043, -15972604, 12544294, -13470457, 1068881, -12499905),\n                array(-9558883, -16518835, 33238498, 13506958, 30505848, -1114596, -8486907, -2630053, 12521378, 4845654),\n            ),\n            array(\n                array(-28198521, 10744108, -2958380, 10199664, 7759311, -13088600, 3409348, -873400, -6482306, -12885870),\n                array(-23561822, 6230156, -20382013, 10655314, -24040585, -11621172, 10477734, -1240216, -3113227, 13974498),\n                array(12966261, 15550616, -32038948, -1615346, 21025980, -629444, 5642325, 7188737, 18895762, 12629579),\n            ),\n        ),\n        array(\n            array(\n                array(14741879, -14946887, 22177208, -11721237, 1279741, 8058600, 11758140, 789443, 32195181, 3895677),\n                array(10758205, 15755439, -4509950, 9243698, -4879422, 6879879, -2204575, -3566119, -8982069, 4429647),\n                array(-2453894, 15725973, -20436342, -10410672, -5803908, -11040220, -7135870, -11642895, 18047436, -15281743),\n            ),\n            array(\n                array(-25173001, -11307165, 29759956, 11776784, -22262383, -15820455, 10993114, -12850837, -17620701, -9408468),\n                array(21987233, 700364, -24505048, 14972008, -7774265, -5718395, 32155026, 2581431, -29958985, 8773375),\n                array(-25568350, 454463, -13211935, 16126715, 25240068, 8594567, 20656846, 12017935, -7874389, -13920155),\n            ),\n            array(\n                array(6028182, 6263078, -31011806, -11301710, -818919, 2461772, -31841174, -5468042, -1721788, -2776725),\n                array(-12278994, 16624277, 987579, -5922598, 32908203, 1248608, 7719845, -4166698, 28408820, 6816612),\n                array(-10358094, -8237829, 19549651, -12169222, 22082623, 16147817, 20613181, 13982702, -10339570, 5067943),\n            ),\n            array(\n                array(-30505967, -3821767, 12074681, 13582412, -19877972, 2443951, -19719286, 12746132, 5331210, -10105944),\n                array(30528811, 3601899, -1957090, 4619785, -27361822, -15436388, 24180793, -12570394, 27679908, -1648928),\n                array(9402404, -13957065, 32834043, 10838634, -26580150, -13237195, 26653274, -8685565, 22611444, -12715406),\n            ),\n            array(\n                array(22190590, 1118029, 22736441, 15130463, -30460692, -5991321, 19189625, -4648942, 4854859, 6622139),\n                array(-8310738, -2953450, -8262579, -3388049, -10401731, -271929, 13424426, -3567227, 26404409, 13001963),\n                array(-31241838, -15415700, -2994250, 8939346, 11562230, -12840670, -26064365, -11621720, -15405155, 11020693),\n            ),\n            array(\n                array(1866042, -7949489, -7898649, -10301010, 12483315, 13477547, 3175636, -12424163, 28761762, 1406734),\n                array(-448555, -1777666, 13018551, 3194501, -9580420, -11161737, 24760585, -4347088, 25577411, -13378680),\n                array(-24290378, 4759345, -690653, -1852816, 2066747, 10693769, -29595790, 9884936, -9368926, 4745410),\n            ),\n            array(\n                array(-9141284, 6049714, -19531061, -4341411, -31260798, 9944276, -15462008, -11311852, 10931924, -11931931),\n                array(-16561513, 14112680, -8012645, 4817318, -8040464, -11414606, -22853429, 10856641, -20470770, 13434654),\n                array(22759489, -10073434, -16766264, -1871422, 13637442, -10168091, 1765144, -12654326, 28445307, -5364710),\n            ),\n            array(\n                array(29875063, 12493613, 2795536, -3786330, 1710620, 15181182, -10195717, -8788675, 9074234, 1167180),\n                array(-26205683, 11014233, -9842651, -2635485, -26908120, 7532294, -18716888, -9535498, 3843903, 9367684),\n                array(-10969595, -6403711, 9591134, 9582310, 11349256, 108879, 16235123, 8601684, -139197, 4242895),\n            ),\n        ),\n        array(\n            array(\n                array(22092954, -13191123, -2042793, -11968512, 32186753, -11517388, -6574341, 2470660, -27417366, 16625501),\n                array(-11057722, 3042016, 13770083, -9257922, 584236, -544855, -7770857, 2602725, -27351616, 14247413),\n                array(6314175, -10264892, -32772502, 15957557, -10157730, 168750, -8618807, 14290061, 27108877, -1180880),\n            ),\n            array(\n                array(-8586597, -7170966, 13241782, 10960156, -32991015, -13794596, 33547976, -11058889, -27148451, 981874),\n                array(22833440, 9293594, -32649448, -13618667, -9136966, 14756819, -22928859, -13970780, -10479804, -16197962),\n                array(-7768587, 3326786, -28111797, 10783824, 19178761, 14905060, 22680049, 13906969, -15933690, 3797899),\n            ),\n            array(\n                array(21721356, -4212746, -12206123, 9310182, -3882239, -13653110, 23740224, -2709232, 20491983, -8042152),\n                array(9209270, -15135055, -13256557, -6167798, -731016, 15289673, 25947805, 15286587, 30997318, -6703063),\n                array(7392032, 16618386, 23946583, -8039892, -13265164, -1533858, -14197445, -2321576, 17649998, -250080),\n            ),\n            array(\n                array(-9301088, -14193827, 30609526, -3049543, -25175069, -1283752, -15241566, -9525724, -2233253, 7662146),\n                array(-17558673, 1763594, -33114336, 15908610, -30040870, -12174295, 7335080, -8472199, -3174674, 3440183),\n                array(-19889700, -5977008, -24111293, -9688870, 10799743, -16571957, 40450, -4431835, 4862400, 1133),\n            ),\n            array(\n                array(-32856209, -7873957, -5422389, 14860950, -16319031, 7956142, 7258061, 311861, -30594991, -7379421),\n                array(-3773428, -1565936, 28985340, 7499440, 24445838, 9325937, 29727763, 16527196, 18278453, 15405622),\n                array(-4381906, 8508652, -19898366, -3674424, -5984453, 15149970, -13313598, 843523, -21875062, 13626197),\n            ),\n            array(\n                array(2281448, -13487055, -10915418, -2609910, 1879358, 16164207, -10783882, 3953792, 13340839, 15928663),\n                array(31727126, -7179855, -18437503, -8283652, 2875793, -16390330, -25269894, -7014826, -23452306, 5964753),\n                array(4100420, -5959452, -17179337, 6017714, -18705837, 12227141, -26684835, 11344144, 2538215, -7570755),\n            ),\n            array(\n                array(-9433605, 6123113, 11159803, -2156608, 30016280, 14966241, -20474983, 1485421, -629256, -15958862),\n                array(-26804558, 4260919, 11851389, 9658551, -32017107, 16367492, -20205425, -13191288, 11659922, -11115118),\n                array(26180396, 10015009, -30844224, -8581293, 5418197, 9480663, 2231568, -10170080, 33100372, -1306171),\n            ),\n            array(\n                array(15121113, -5201871, -10389905, 15427821, -27509937, -15992507, 21670947, 4486675, -5931810, -14466380),\n                array(16166486, -9483733, -11104130, 6023908, -31926798, -1364923, 2340060, -16254968, -10735770, -10039824),\n                array(28042865, -3557089, -12126526, 12259706, -3717498, -6945899, 6766453, -8689599, 18036436, 5803270),\n            ),\n        ),\n        array(\n            array(\n                array(-817581, 6763912, 11803561, 1585585, 10958447, -2671165, 23855391, 4598332, -6159431, -14117438),\n                array(-31031306, -14256194, 17332029, -2383520, 31312682, -5967183, 696309, 50292, -20095739, 11763584),\n                array(-594563, -2514283, -32234153, 12643980, 12650761, 14811489, 665117, -12613632, -19773211, -10713562),\n            ),\n            array(\n                array(30464590, -11262872, -4127476, -12734478, 19835327, -7105613, -24396175, 2075773, -17020157, 992471),\n                array(18357185, -6994433, 7766382, 16342475, -29324918, 411174, 14578841, 8080033, -11574335, -10601610),\n                array(19598397, 10334610, 12555054, 2555664, 18821899, -10339780, 21873263, 16014234, 26224780, 16452269),\n            ),\n            array(\n                array(-30223925, 5145196, 5944548, 16385966, 3976735, 2009897, -11377804, -7618186, -20533829, 3698650),\n                array(14187449, 3448569, -10636236, -10810935, -22663880, -3433596, 7268410, -10890444, 27394301, 12015369),\n                array(19695761, 16087646, 28032085, 12999827, 6817792, 11427614, 20244189, -1312777, -13259127, -3402461),\n            ),\n            array(\n                array(30860103, 12735208, -1888245, -4699734, -16974906, 2256940, -8166013, 12298312, -8550524, -10393462),\n                array(-5719826, -11245325, -1910649, 15569035, 26642876, -7587760, -5789354, -15118654, -4976164, 12651793),\n                array(-2848395, 9953421, 11531313, -5282879, 26895123, -12697089, -13118820, -16517902, 9768698, -2533218),\n            ),\n            array(\n                array(-24719459, 1894651, -287698, -4704085, 15348719, -8156530, 32767513, 12765450, 4940095, 10678226),\n                array(18860224, 15980149, -18987240, -1562570, -26233012, -11071856, -7843882, 13944024, -24372348, 16582019),\n                array(-15504260, 4970268, -29893044, 4175593, -20993212, -2199756, -11704054, 15444560, -11003761, 7989037),\n            ),\n            array(\n                array(31490452, 5568061, -2412803, 2182383, -32336847, 4531686, -32078269, 6200206, -19686113, -14800171),\n                array(-17308668, -15879940, -31522777, -2831, -32887382, 16375549, 8680158, -16371713, 28550068, -6857132),\n                array(-28126887, -5688091, 16837845, -1820458, -6850681, 12700016, -30039981, 4364038, 1155602, 5988841),\n            ),\n            array(\n                array(21890435, -13272907, -12624011, 12154349, -7831873, 15300496, 23148983, -4470481, 24618407, 8283181),\n                array(-33136107, -10512751, 9975416, 6841041, -31559793, 16356536, 3070187, -7025928, 1466169, 10740210),\n                array(-1509399, -15488185, -13503385, -10655916, 32799044, 909394, -13938903, -5779719, -32164649, -15327040),\n            ),\n            array(\n                array(3960823, -14267803, -28026090, -15918051, -19404858, 13146868, 15567327, 951507, -3260321, -573935),\n                array(24740841, 5052253, -30094131, 8961361, 25877428, 6165135, -24368180, 14397372, -7380369, -6144105),\n                array(-28888365, 3510803, -28103278, -1158478, -11238128, -10631454, -15441463, -14453128, -1625486, -6494814),\n            ),\n        ),\n        array(\n            array(\n                array(793299, -9230478, 8836302, -6235707, -27360908, -2369593, 33152843, -4885251, -9906200, -621852),\n                array(5666233, 525582, 20782575, -8038419, -24538499, 14657740, 16099374, 1468826, -6171428, -15186581),\n                array(-4859255, -3779343, -2917758, -6748019, 7778750, 11688288, -30404353, -9871238, -1558923, -9863646),\n            ),\n            array(\n                array(10896332, -7719704, 824275, 472601, -19460308, 3009587, 25248958, 14783338, -30581476, -15757844),\n                array(10566929, 12612572, -31944212, 11118703, -12633376, 12362879, 21752402, 8822496, 24003793, 14264025),\n                array(27713862, -7355973, -11008240, 9227530, 27050101, 2504721, 23886875, -13117525, 13958495, -5732453),\n            ),\n            array(\n                array(-23481610, 4867226, -27247128, 3900521, 29838369, -8212291, -31889399, -10041781, 7340521, -15410068),\n                array(4646514, -8011124, -22766023, -11532654, 23184553, 8566613, 31366726, -1381061, -15066784, -10375192),\n                array(-17270517, 12723032, -16993061, 14878794, 21619651, -6197576, 27584817, 3093888, -8843694, 3849921),\n            ),\n            array(\n                array(-9064912, 2103172, 25561640, -15125738, -5239824, 9582958, 32477045, -9017955, 5002294, -15550259),\n                array(-12057553, -11177906, 21115585, -13365155, 8808712, -12030708, 16489530, 13378448, -25845716, 12741426),\n                array(-5946367, 10645103, -30911586, 15390284, -3286982, -7118677, 24306472, 15852464, 28834118, -7646072),\n            ),\n            array(\n                array(-17335748, -9107057, -24531279, 9434953, -8472084, -583362, -13090771, 455841, 20461858, 5491305),\n                array(13669248, -16095482, -12481974, -10203039, -14569770, -11893198, -24995986, 11293807, -28588204, -9421832),\n                array(28497928, 6272777, -33022994, 14470570, 8906179, -1225630, 18504674, -14165166, 29867745, -8795943),\n            ),\n            array(\n                array(-16207023, 13517196, -27799630, -13697798, 24009064, -6373891, -6367600, -13175392, 22853429, -4012011),\n                array(24191378, 16712145, -13931797, 15217831, 14542237, 1646131, 18603514, -11037887, 12876623, -2112447),\n                array(17902668, 4518229, -411702, -2829247, 26878217, 5258055, -12860753, 608397, 16031844, 3723494),\n            ),\n            array(\n                array(-28632773, 12763728, -20446446, 7577504, 33001348, -13017745, 17558842, -7872890, 23896954, -4314245),\n                array(-20005381, -12011952, 31520464, 605201, 2543521, 5991821, -2945064, 7229064, -9919646, -8826859),\n                array(28816045, 298879, -28165016, -15920938, 19000928, -1665890, -12680833, -2949325, -18051778, -2082915),\n            ),\n            array(\n                array(16000882, -344896, 3493092, -11447198, -29504595, -13159789, 12577740, 16041268, -19715240, 7847707),\n                array(10151868, 10572098, 27312476, 7922682, 14825339, 4723128, -32855931, -6519018, -10020567, 3852848),\n                array(-11430470, 15697596, -21121557, -4420647, 5386314, 15063598, 16514493, -15932110, 29330899, -15076224),\n            ),\n        ),\n        array(\n            array(\n                array(-25499735, -4378794, -15222908, -6901211, 16615731, 2051784, 3303702, 15490, -27548796, 12314391),\n                array(15683520, -6003043, 18109120, -9980648, 15337968, -5997823, -16717435, 15921866, 16103996, -3731215),\n                array(-23169824, -10781249, 13588192, -1628807, -3798557, -1074929, -19273607, 5402699, -29815713, -9841101),\n            ),\n            array(\n                array(23190676, 2384583, -32714340, 3462154, -29903655, -1529132, -11266856, 8911517, -25205859, 2739713),\n                array(21374101, -3554250, -33524649, 9874411, 15377179, 11831242, -33529904, 6134907, 4931255, 11987849),\n                array(-7732, -2978858, -16223486, 7277597, 105524, -322051, -31480539, 13861388, -30076310, 10117930),\n            ),\n            array(\n                array(-29501170, -10744872, -26163768, 13051539, -25625564, 5089643, -6325503, 6704079, 12890019, 15728940),\n                array(-21972360, -11771379, -951059, -4418840, 14704840, 2695116, 903376, -10428139, 12885167, 8311031),\n                array(-17516482, 5352194, 10384213, -13811658, 7506451, 13453191, 26423267, 4384730, 1888765, -5435404),\n            ),\n            array(\n                array(-25817338, -3107312, -13494599, -3182506, 30896459, -13921729, -32251644, -12707869, -19464434, -3340243),\n                array(-23607977, -2665774, -526091, 4651136, 5765089, 4618330, 6092245, 14845197, 17151279, -9854116),\n                array(-24830458, -12733720, -15165978, 10367250, -29530908, -265356, 22825805, -7087279, -16866484, 16176525),\n            ),\n            array(\n                array(-23583256, 6564961, 20063689, 3798228, -4740178, 7359225, 2006182, -10363426, -28746253, -10197509),\n                array(-10626600, -4486402, -13320562, -5125317, 3432136, -6393229, 23632037, -1940610, 32808310, 1099883),\n                array(15030977, 5768825, -27451236, -2887299, -6427378, -15361371, -15277896, -6809350, 2051441, -15225865),\n            ),\n            array(\n                array(-3362323, -7239372, 7517890, 9824992, 23555850, 295369, 5148398, -14154188, -22686354, 16633660),\n                array(4577086, -16752288, 13249841, -15304328, 19958763, -14537274, 18559670, -10759549, 8402478, -9864273),\n                array(-28406330, -1051581, -26790155, -907698, -17212414, -11030789, 9453451, -14980072, 17983010, 9967138),\n            ),\n            array(\n                array(-25762494, 6524722, 26585488, 9969270, 24709298, 1220360, -1677990, 7806337, 17507396, 3651560),\n                array(-10420457, -4118111, 14584639, 15971087, -15768321, 8861010, 26556809, -5574557, -18553322, -11357135),\n                array(2839101, 14284142, 4029895, 3472686, 14402957, 12689363, -26642121, 8459447, -5605463, -7621941),\n            ),\n            array(\n                array(-4839289, -3535444, 9744961, 2871048, 25113978, 3187018, -25110813, -849066, 17258084, -7977739),\n                array(18164541, -10595176, -17154882, -1542417, 19237078, -9745295, 23357533, -15217008, 26908270, 12150756),\n                array(-30264870, -7647865, 5112249, -7036672, -1499807, -6974257, 43168, -5537701, -32302074, 16215819),\n            ),\n        ),\n        array(\n            array(\n                array(-6898905, 9824394, -12304779, -4401089, -31397141, -6276835, 32574489, 12532905, -7503072, -8675347),\n                array(-27343522, -16515468, -27151524, -10722951, 946346, 16291093, 254968, 7168080, 21676107, -1943028),\n                array(21260961, -8424752, -16831886, -11920822, -23677961, 3968121, -3651949, -6215466, -3556191, -7913075),\n            ),\n            array(\n                array(16544754, 13250366, -16804428, 15546242, -4583003, 12757258, -2462308, -8680336, -18907032, -9662799),\n                array(-2415239, -15577728, 18312303, 4964443, -15272530, -12653564, 26820651, 16690659, 25459437, -4564609),\n                array(-25144690, 11425020, 28423002, -11020557, -6144921, -15826224, 9142795, -2391602, -6432418, -1644817),\n            ),\n            array(\n                array(-23104652, 6253476, 16964147, -3768872, -25113972, -12296437, -27457225, -16344658, 6335692, 7249989),\n                array(-30333227, 13979675, 7503222, -12368314, -11956721, -4621693, -30272269, 2682242, 25993170, -12478523),\n                array(4364628, 5930691, 32304656, -10044554, -8054781, 15091131, 22857016, -10598955, 31820368, 15075278),\n            ),\n            array(\n                array(31879134, -8918693, 17258761, 90626, -8041836, -4917709, 24162788, -9650886, -17970238, 12833045),\n                array(19073683, 14851414, -24403169, -11860168, 7625278, 11091125, -19619190, 2074449, -9413939, 14905377),\n                array(24483667, -11935567, -2518866, -11547418, -1553130, 15355506, -25282080, 9253129, 27628530, -7555480),\n            ),\n            array(\n                array(17597607, 8340603, 19355617, 552187, 26198470, -3176583, 4593324, -9157582, -14110875, 15297016),\n                array(510886, 14337390, -31785257, 16638632, 6328095, 2713355, -20217417, -11864220, 8683221, 2921426),\n                array(18606791, 11874196, 27155355, -5281482, -24031742, 6265446, -25178240, -1278924, 4674690, 13890525),\n            ),\n            array(\n                array(13609624, 13069022, -27372361, -13055908, 24360586, 9592974, 14977157, 9835105, 4389687, 288396),\n                array(9922506, -519394, 13613107, 5883594, -18758345, -434263, -12304062, 8317628, 23388070, 16052080),\n                array(12720016, 11937594, -31970060, -5028689, 26900120, 8561328, -20155687, -11632979, -14754271, -10812892),\n            ),\n            array(\n                array(15961858, 14150409, 26716931, -665832, -22794328, 13603569, 11829573, 7467844, -28822128, 929275),\n                array(11038231, -11582396, -27310482, -7316562, -10498527, -16307831, -23479533, -9371869, -21393143, 2465074),\n                array(20017163, -4323226, 27915242, 1529148, 12396362, 15675764, 13817261, -9658066, 2463391, -4622140),\n            ),\n            array(\n                array(-16358878, -12663911, -12065183, 4996454, -1256422, 1073572, 9583558, 12851107, 4003896, 12673717),\n                array(-1731589, -15155870, -3262930, 16143082, 19294135, 13385325, 14741514, -9103726, 7903886, 2348101),\n                array(24536016, -16515207, 12715592, -3862155, 1511293, 10047386, -3842346, -7129159, -28377538, 10048127),\n            ),\n        ),\n        array(\n            array(\n                array(-12622226, -6204820, 30718825, 2591312, -10617028, 12192840, 18873298, -7297090, -32297756, 15221632),\n                array(-26478122, -11103864, 11546244, -1852483, 9180880, 7656409, -21343950, 2095755, 29769758, 6593415),\n                array(-31994208, -2907461, 4176912, 3264766, 12538965, -868111, 26312345, -6118678, 30958054, 8292160),\n            ),\n            array(\n                array(31429822, -13959116, 29173532, 15632448, 12174511, -2760094, 32808831, 3977186, 26143136, -3148876),\n                array(22648901, 1402143, -22799984, 13746059, 7936347, 365344, -8668633, -1674433, -3758243, -2304625),\n                array(-15491917, 8012313, -2514730, -12702462, -23965846, -10254029, -1612713, -1535569, -16664475, 8194478),\n            ),\n            array(\n                array(27338066, -7507420, -7414224, 10140405, -19026427, -6589889, 27277191, 8855376, 28572286, 3005164),\n                array(26287124, 4821776, 25476601, -4145903, -3764513, -15788984, -18008582, 1182479, -26094821, -13079595),\n                array(-7171154, 3178080, 23970071, 6201893, -17195577, -4489192, -21876275, -13982627, 32208683, -1198248),\n            ),\n            array(\n                array(-16657702, 2817643, -10286362, 14811298, 6024667, 13349505, -27315504, -10497842, -27672585, -11539858),\n                array(15941029, -9405932, -21367050, 8062055, 31876073, -238629, -15278393, -1444429, 15397331, -4130193),\n                array(8934485, -13485467, -23286397, -13423241, -32446090, 14047986, 31170398, -1441021, -27505566, 15087184),\n            ),\n            array(\n                array(-18357243, -2156491, 24524913, -16677868, 15520427, -6360776, -15502406, 11461896, 16788528, -5868942),\n                array(-1947386, 16013773, 21750665, 3714552, -17401782, -16055433, -3770287, -10323320, 31322514, -11615635),\n                array(21426655, -5650218, -13648287, -5347537, -28812189, -4920970, -18275391, -14621414, 13040862, -12112948),\n            ),\n            array(\n                array(11293895, 12478086, -27136401, 15083750, -29307421, 14748872, 14555558, -13417103, 1613711, 4896935),\n                array(-25894883, 15323294, -8489791, -8057900, 25967126, -13425460, 2825960, -4897045, -23971776, -11267415),\n                array(-15924766, -5229880, -17443532, 6410664, 3622847, 10243618, 20615400, 12405433, -23753030, -8436416),\n            ),\n            array(\n                array(-7091295, 12556208, -20191352, 9025187, -17072479, 4333801, 4378436, 2432030, 23097949, -566018),\n                array(4565804, -16025654, 20084412, -7842817, 1724999, 189254, 24767264, 10103221, -18512313, 2424778),\n                array(366633, -11976806, 8173090, -6890119, 30788634, 5745705, -7168678, 1344109, -3642553, 12412659),\n            ),\n            array(\n                array(-24001791, 7690286, 14929416, -168257, -32210835, -13412986, 24162697, -15326504, -3141501, 11179385),\n                array(18289522, -14724954, 8056945, 16430056, -21729724, 7842514, -6001441, -1486897, -18684645, -11443503),\n                array(476239, 6601091, -6152790, -9723375, 17503545, -4863900, 27672959, 13403813, 11052904, 5219329),\n            ),\n        ),\n        array(\n            array(\n                array(20678546, -8375738, -32671898, 8849123, -5009758, 14574752, 31186971, -3973730, 9014762, -8579056),\n                array(-13644050, -10350239, -15962508, 5075808, -1514661, -11534600, -33102500, 9160280, 8473550, -3256838),\n                array(24900749, 14435722, 17209120, -15292541, -22592275, 9878983, -7689309, -16335821, -24568481, 11788948),\n            ),\n            array(\n                array(-3118155, -11395194, -13802089, 14797441, 9652448, -6845904, -20037437, 10410733, -24568470, -1458691),\n                array(-15659161, 16736706, -22467150, 10215878, -9097177, 7563911, 11871841, -12505194, -18513325, 8464118),\n                array(-23400612, 8348507, -14585951, -861714, -3950205, -6373419, 14325289, 8628612, 33313881, -8370517),\n            ),\n            array(\n                array(-20186973, -4967935, 22367356, 5271547, -1097117, -4788838, -24805667, -10236854, -8940735, -5818269),\n                array(-6948785, -1795212, -32625683, -16021179, 32635414, -7374245, 15989197, -12838188, 28358192, -4253904),\n                array(-23561781, -2799059, -32351682, -1661963, -9147719, 10429267, -16637684, 4072016, -5351664, 5596589),\n            ),\n            array(\n                array(-28236598, -3390048, 12312896, 6213178, 3117142, 16078565, 29266239, 2557221, 1768301, 15373193),\n                array(-7243358, -3246960, -4593467, -7553353, -127927, -912245, -1090902, -4504991, -24660491, 3442910),\n                array(-30210571, 5124043, 14181784, 8197961, 18964734, -11939093, 22597931, 7176455, -18585478, 13365930),\n            ),\n            array(\n                array(-7877390, -1499958, 8324673, 4690079, 6261860, 890446, 24538107, -8570186, -9689599, -3031667),\n                array(25008904, -10771599, -4305031, -9638010, 16265036, 15721635, 683793, -11823784, 15723479, -15163481),\n                array(-9660625, 12374379, -27006999, -7026148, -7724114, -12314514, 11879682, 5400171, 519526, -1235876),\n            ),\n            array(\n                array(22258397, -16332233, -7869817, 14613016, -22520255, -2950923, -20353881, 7315967, 16648397, 7605640),\n                array(-8081308, -8464597, -8223311, 9719710, 19259459, -15348212, 23994942, -5281555, -9468848, 4763278),\n                array(-21699244, 9220969, -15730624, 1084137, -25476107, -2852390, 31088447, -7764523, -11356529, 728112),\n            ),\n            array(\n                array(26047220, -11751471, -6900323, -16521798, 24092068, 9158119, -4273545, -12555558, -29365436, -5498272),\n                array(17510331, -322857, 5854289, 8403524, 17133918, -3112612, -28111007, 12327945, 10750447, 10014012),\n                array(-10312768, 3936952, 9156313, -8897683, 16498692, -994647, -27481051, -666732, 3424691, 7540221),\n            ),\n            array(\n                array(30322361, -6964110, 11361005, -4143317, 7433304, 4989748, -7071422, -16317219, -9244265, 15258046),\n                array(13054562, -2779497, 19155474, 469045, -12482797, 4566042, 5631406, 2711395, 1062915, -5136345),\n                array(-19240248, -11254599, -29509029, -7499965, -5835763, 13005411, -6066489, 12194497, 32960380, 1459310),\n            ),\n        ),\n        array(\n            array(\n                array(19852034, 7027924, 23669353, 10020366, 8586503, -6657907, 394197, -6101885, 18638003, -11174937),\n                array(31395534, 15098109, 26581030, 8030562, -16527914, -5007134, 9012486, -7584354, -6643087, -5442636),\n                array(-9192165, -2347377, -1997099, 4529534, 25766844, 607986, -13222, 9677543, -32294889, -6456008),\n            ),\n            array(\n                array(-2444496, -149937, 29348902, 8186665, 1873760, 12489863, -30934579, -7839692, -7852844, -8138429),\n                array(-15236356, -15433509, 7766470, 746860, 26346930, -10221762, -27333451, 10754588, -9431476, 5203576),\n                array(31834314, 14135496, -770007, 5159118, 20917671, -16768096, -7467973, -7337524, 31809243, 7347066),\n            ),\n            array(\n                array(-9606723, -11874240, 20414459, 13033986, 13716524, -11691881, 19797970, -12211255, 15192876, -2087490),\n                array(-12663563, -2181719, 1168162, -3804809, 26747877, -14138091, 10609330, 12694420, 33473243, -13382104),\n                array(33184999, 11180355, 15832085, -11385430, -1633671, 225884, 15089336, -11023903, -6135662, 14480053),\n            ),\n            array(\n                array(31308717, -5619998, 31030840, -1897099, 15674547, -6582883, 5496208, 13685227, 27595050, 8737275),\n                array(-20318852, -15150239, 10933843, -16178022, 8335352, -7546022, -31008351, -12610604, 26498114, 66511),\n                array(22644454, -8761729, -16671776, 4884562, -3105614, -13559366, 30540766, -4286747, -13327787, -7515095),\n            ),\n            array(\n                array(-28017847, 9834845, 18617207, -2681312, -3401956, -13307506, 8205540, 13585437, -17127465, 15115439),\n                array(23711543, -672915, 31206561, -8362711, 6164647, -9709987, -33535882, -1426096, 8236921, 16492939),\n                array(-23910559, -13515526, -26299483, -4503841, 25005590, -7687270, 19574902, 10071562, 6708380, -6222424),\n            ),\n            array(\n                array(2101391, -4930054, 19702731, 2367575, -15427167, 1047675, 5301017, 9328700, 29955601, -11678310),\n                array(3096359, 9271816, -21620864, -15521844, -14847996, -7592937, -25892142, -12635595, -9917575, 6216608),\n                array(-32615849, 338663, -25195611, 2510422, -29213566, -13820213, 24822830, -6146567, -26767480, 7525079),\n            ),\n            array(\n                array(-23066649, -13985623, 16133487, -7896178, -3389565, 778788, -910336, -2782495, -19386633, 11994101),\n                array(21691500, -13624626, -641331, -14367021, 3285881, -3483596, -25064666, 9718258, -7477437, 13381418),\n                array(18445390, -4202236, 14979846, 11622458, -1727110, -3582980, 23111648, -6375247, 28535282, 15779576),\n            ),\n            array(\n                array(30098053, 3089662, -9234387, 16662135, -21306940, 11308411, -14068454, 12021730, 9955285, -16303356),\n                array(9734894, -14576830, -7473633, -9138735, 2060392, 11313496, -18426029, 9924399, 20194861, 13380996),\n                array(-26378102, -7965207, -22167821, 15789297, -18055342, -6168792, -1984914, 15707771, 26342023, 10146099),\n            ),\n        ),\n        array(\n            array(\n                array(-26016874, -219943, 21339191, -41388, 19745256, -2878700, -29637280, 2227040, 21612326, -545728),\n                array(-13077387, 1184228, 23562814, -5970442, -20351244, -6348714, 25764461, 12243797, -20856566, 11649658),\n                array(-10031494, 11262626, 27384172, 2271902, 26947504, -15997771, 39944, 6114064, 33514190, 2333242),\n            ),\n            array(\n                array(-21433588, -12421821, 8119782, 7219913, -21830522, -9016134, -6679750, -12670638, 24350578, -13450001),\n                array(-4116307, -11271533, -23886186, 4843615, -30088339, 690623, -31536088, -10406836, 8317860, 12352766),\n                array(18200138, -14475911, -33087759, -2696619, -23702521, -9102511, -23552096, -2287550, 20712163, 6719373),\n            ),\n            array(\n                array(26656208, 6075253, -7858556, 1886072, -28344043, 4262326, 11117530, -3763210, 26224235, -3297458),\n                array(-17168938, -14854097, -3395676, -16369877, -19954045, 14050420, 21728352, 9493610, 18620611, -16428628),\n                array(-13323321, 13325349, 11432106, 5964811, 18609221, 6062965, -5269471, -9725556, -30701573, -16479657),\n            ),\n            array(\n                array(-23860538, -11233159, 26961357, 1640861, -32413112, -16737940, 12248509, -5240639, 13735342, 1934062),\n                array(25089769, 6742589, 17081145, -13406266, 21909293, -16067981, -15136294, -3765346, -21277997, 5473616),\n                array(31883677, -7961101, 1083432, -11572403, 22828471, 13290673, -7125085, 12469656, 29111212, -5451014),\n            ),\n            array(\n                array(24244947, -15050407, -26262976, 2791540, -14997599, 16666678, 24367466, 6388839, -10295587, 452383),\n                array(-25640782, -3417841, 5217916, 16224624, 19987036, -4082269, -24236251, -5915248, 15766062, 8407814),\n                array(-20406999, 13990231, 15495425, 16395525, 5377168, 15166495, -8917023, -4388953, -8067909, 2276718),\n            ),\n            array(\n                array(30157918, 12924066, -17712050, 9245753, 19895028, 3368142, -23827587, 5096219, 22740376, -7303417),\n                array(2041139, -14256350, 7783687, 13876377, -25946985, -13352459, 24051124, 13742383, -15637599, 13295222),\n                array(33338237, -8505733, 12532113, 7977527, 9106186, -1715251, -17720195, -4612972, -4451357, -14669444),\n            ),\n            array(\n                array(-20045281, 5454097, -14346548, 6447146, 28862071, 1883651, -2469266, -4141880, 7770569, 9620597),\n                array(23208068, 7979712, 33071466, 8149229, 1758231, -10834995, 30945528, -1694323, -33502340, -14767970),\n                array(1439958, -16270480, -1079989, -793782, 4625402, 10647766, -5043801, 1220118, 30494170, -11440799),\n            ),\n            array(\n                array(-5037580, -13028295, -2970559, -3061767, 15640974, -6701666, -26739026, 926050, -1684339, -13333647),\n                array(13908495, -3549272, 30919928, -6273825, -21521863, 7989039, 9021034, 9078865, 3353509, 4033511),\n                array(-29663431, -15113610, 32259991, -344482, 24295849, -12912123, 23161163, 8839127, 27485041, 7356032),\n            ),\n        ),\n        array(\n            array(\n                array(9661027, 705443, 11980065, -5370154, -1628543, 14661173, -6346142, 2625015, 28431036, -16771834),\n                array(-23839233, -8311415, -25945511, 7480958, -17681669, -8354183, -22545972, 14150565, 15970762, 4099461),\n                array(29262576, 16756590, 26350592, -8793563, 8529671, -11208050, 13617293, -9937143, 11465739, 8317062),\n            ),\n            array(\n                array(-25493081, -6962928, 32500200, -9419051, -23038724, -2302222, 14898637, 3848455, 20969334, -5157516),\n                array(-20384450, -14347713, -18336405, 13884722, -33039454, 2842114, -21610826, -3649888, 11177095, 14989547),\n                array(-24496721, -11716016, 16959896, 2278463, 12066309, 10137771, 13515641, 2581286, -28487508, 9930240),\n            ),\n            array(\n                array(-17751622, -2097826, 16544300, -13009300, -15914807, -14949081, 18345767, -13403753, 16291481, -5314038),\n                array(-33229194, 2553288, 32678213, 9875984, 8534129, 6889387, -9676774, 6957617, 4368891, 9788741),\n                array(16660756, 7281060, -10830758, 12911820, 20108584, -8101676, -21722536, -8613148, 16250552, -11111103),\n            ),\n            array(\n                array(-19765507, 2390526, -16551031, 14161980, 1905286, 6414907, 4689584, 10604807, -30190403, 4782747),\n                array(-1354539, 14736941, -7367442, -13292886, 7710542, -14155590, -9981571, 4383045, 22546403, 437323),\n                array(31665577, -12180464, -16186830, 1491339, -18368625, 3294682, 27343084, 2786261, -30633590, -14097016),\n            ),\n            array(\n                array(-14467279, -683715, -33374107, 7448552, 19294360, 14334329, -19690631, 2355319, -19284671, -6114373),\n                array(15121312, -15796162, 6377020, -6031361, -10798111, -12957845, 18952177, 15496498, -29380133, 11754228),\n                array(-2637277, -13483075, 8488727, -14303896, 12728761, -1622493, 7141596, 11724556, 22761615, -10134141),\n            ),\n            array(\n                array(16918416, 11729663, -18083579, 3022987, -31015732, -13339659, -28741185, -12227393, 32851222, 11717399),\n                array(11166634, 7338049, -6722523, 4531520, -29468672, -7302055, 31474879, 3483633, -1193175, -4030831),\n                array(-185635, 9921305, 31456609, -13536438, -12013818, 13348923, 33142652, 6546660, -19985279, -3948376),\n            ),\n            array(\n                array(-32460596, 11266712, -11197107, -7899103, 31703694, 3855903, -8537131, -12833048, -30772034, -15486313),\n                array(-18006477, 12709068, 3991746, -6479188, -21491523, -10550425, -31135347, -16049879, 10928917, 3011958),\n                array(-6957757, -15594337, 31696059, 334240, 29576716, 14796075, -30831056, -12805180, 18008031, 10258577),\n            ),\n            array(\n                array(-22448644, 15655569, 7018479, -4410003, -30314266, -1201591, -1853465, 1367120, 25127874, 6671743),\n                array(29701166, -14373934, -10878120, 9279288, -17568, 13127210, 21382910, 11042292, 25838796, 4642684),\n                array(-20430234, 14955537, -24126347, 8124619, -5369288, -5990470, 30468147, -13900640, 18423289, 4177476),\n            ),\n        )\n    );\n\n    /**\n     * See: libsodium's crypto_core/curve25519/ref10/base2.h\n     *\n     * @var array<int, array<int, array<int, int>>> basically int[8][3]\n     */\n    protected static $base2 = array(\n        array(\n            array(25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605),\n            array(-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378),\n            array(-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546),\n        ),\n        array(\n            array(15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024),\n            array(16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574),\n            array(30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357),\n        ),\n        array(\n            array(10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380),\n            array(4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306),\n            array(19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942),\n        ),\n        array(\n            array(5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766),\n            array(-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701),\n            array(28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300),\n        ),\n        array(\n            array(-22518993, -6692182, 14201702, -8745502, -23510406, 8844726, 18474211, -1361450, -13062696, 13821877),\n            array(-6455177, -7839871, 3374702, -4740862, -27098617, -10571707, 31655028, -7212327, 18853322, -14220951),\n            array(4566830, -12963868, -28974889, -12240689, -7602672, -2830569, -8514358, -10431137, 2207753, -3209784),\n        ),\n        array(\n            array(-25154831, -4185821, 29681144, 7868801, -6854661, -9423865, -12437364, -663000, -31111463, -16132436),\n            array(25576264, -2703214, 7349804, -11814844, 16472782, 9300885, 3844789, 15725684, 171356, 6466918),\n            array(23103977, 13316479, 9739013, -16149481, 817875, -15038942, 8965339, -14088058, -30714912, 16193877),\n        ),\n        array(\n            array(-33521811, 3180713, -2394130, 14003687, -16903474, -16270840, 17238398, 4729455, -18074513, 9256800),\n            array(-25182317, -4174131, 32336398, 5036987, -21236817, 11360617, 22616405, 9761698, -19827198, 630305),\n            array(-13720693, 2639453, -24237460, -7406481, 9494427, -5774029, -6554551, -15960994, -2449256, -14291300),\n        ),\n        array(\n            array(-3151181, -5046075, 9282714, 6866145, -31907062, -863023, -18940575, 15033784, 25105118, -7894876),\n            array(-24326370, 15950226, -31801215, -14592823, -11662737, -5090925, 1573892, -2625887, 2198790, -15804619),\n            array(-3099351, 10324967, -2241613, 7453183, -5446979, -2735503, -13812022, -16236442, -32461234, -12290683),\n        )\n    );\n\n    /**\n     * 37095705934669439343138083508754565189542113879843219016388785533085940283555\n     *\n     * @var array<int, int>\n     */\n    protected static $d = array(\n        -10913610,\n        13857413,\n        -15372611,\n        6949391,\n        114729,\n        -8787816,\n        -6275908,\n        -3247719,\n        -18696448,\n        -12055116\n    );\n\n    /**\n     * 2 * d = 16295367250680780974490674513165176452449235426866156013048779062215315747161\n     *\n     * @var array<int, int>\n     */\n    protected static $d2 = array(\n        -21827239,\n        -5839606,\n        -30745221,\n        13898782,\n        229458,\n        15978800,\n        -12551817,\n        -6495438,\n        29715968,\n        9444199\n    );\n\n    /**\n     * sqrt(-1)\n     *\n     * @var array<int, int>\n     */\n    protected static $sqrtm1 = array(\n        -32595792,\n        -7943725,\n        9377950,\n        3500415,\n        12389472,\n        -272473,\n        -25146209,\n        -2005654,\n        326686,\n        11406482\n    );\n}\n", "num_lines": 1468}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n\nif (class_exists('ParagonIE_Sodium_Core32_Curve25519_Ge_Cached', false)) {\n    return;\n}\n/**\n * Class ParagonIE_Sodium_Core32_Curve25519_Ge_Cached\n */\nclass ParagonIE_Sodium_Core32_Curve25519_Ge_Cached\n{\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $YplusX;\n\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $YminusX;\n\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $Z;\n\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $T2d;\n\n    /**\n     * ParagonIE_Sodium_Core32_Curve25519_Ge_Cached constructor.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe|null $YplusX\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe|null $YminusX\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe|null $Z\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe|null $T2d\n     */\n    public function __construct(\n        ParagonIE_Sodium_Core32_Curve25519_Fe $YplusX = null,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $YminusX = null,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $Z = null,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $T2d = null\n    ) {\n        if ($YplusX === null) {\n            $YplusX = new ParagonIE_Sodium_Core32_Curve25519_Fe();\n        }\n        $this->YplusX = $YplusX;\n        if ($YminusX === null) {\n            $YminusX = new ParagonIE_Sodium_Core32_Curve25519_Fe();\n        }\n        $this->YminusX = $YminusX;\n        if ($Z === null) {\n            $Z = new ParagonIE_Sodium_Core32_Curve25519_Fe();\n        }\n        $this->Z = $Z;\n        if ($T2d === null) {\n            $T2d = new ParagonIE_Sodium_Core32_Curve25519_Fe();\n        }\n        $this->T2d = $T2d;\n    }\n}\n", "num_lines": 66}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1', false)) {\n    return;\n}\n/**\n * Class ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1\n */\nclass ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1\n{\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $X;\n\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $Y;\n\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $Z;\n\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $T;\n\n    /**\n     * ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 constructor.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe|null $x\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe|null $y\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe|null $z\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe|null $t\n     *\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function __construct(\n        ParagonIE_Sodium_Core32_Curve25519_Fe $x = null,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $y = null,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $z = null,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $t = null\n    ) {\n        if ($x === null) {\n            $x = ParagonIE_Sodium_Core32_Curve25519::fe_0();\n        }\n        $this->X = $x;\n        if ($y === null) {\n            $y = ParagonIE_Sodium_Core32_Curve25519::fe_0();\n        }\n        $this->Y = $y;\n        if ($z === null) {\n            $z = ParagonIE_Sodium_Core32_Curve25519::fe_0();\n        }\n        $this->Z = $z;\n        if ($t === null) {\n            $t = ParagonIE_Sodium_Core32_Curve25519::fe_0();\n        }\n        $this->T = $t;\n    }\n}\n", "num_lines": 68}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_Curve25519_Ge_P2', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_Curve25519_Ge_P2\n */\nclass ParagonIE_Sodium_Core32_Curve25519_Ge_P2\n{\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $X;\n\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $Y;\n\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $Z;\n\n    /**\n     * ParagonIE_Sodium_Core32_Curve25519_Ge_P2 constructor.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe|null $x\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe|null $y\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe|null $z\n     */\n    public function __construct(\n        ParagonIE_Sodium_Core32_Curve25519_Fe $x = null,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $y = null,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $z = null\n    ) {\n        if ($x === null) {\n            $x = new ParagonIE_Sodium_Core32_Curve25519_Fe();\n        }\n        $this->X = $x;\n        if ($y === null) {\n            $y = new ParagonIE_Sodium_Core32_Curve25519_Fe();\n        }\n        $this->Y = $y;\n        if ($z === null) {\n            $z = new ParagonIE_Sodium_Core32_Curve25519_Fe();\n        }\n        $this->Z = $z;\n    }\n}\n", "num_lines": 55}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_Curve25519_Ge_P3', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_Curve25519_Ge_P3\n */\nclass ParagonIE_Sodium_Core32_Curve25519_Ge_P3\n{\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $X;\n\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $Y;\n\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $Z;\n\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $T;\n\n    /**\n     * ParagonIE_Sodium_Core32_Curve25519_Ge_P3 constructor.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe|null $x\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe|null $y\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe|null $z\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe|null $t\n     */\n    public function __construct(\n        ParagonIE_Sodium_Core32_Curve25519_Fe $x = null,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $y = null,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $z = null,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $t = null\n    ) {\n        if ($x === null) {\n            $x = new ParagonIE_Sodium_Core32_Curve25519_Fe();\n        }\n        $this->X = $x;\n        if ($y === null) {\n            $y = new ParagonIE_Sodium_Core32_Curve25519_Fe();\n        }\n        $this->Y = $y;\n        if ($z === null) {\n            $z = new ParagonIE_Sodium_Core32_Curve25519_Fe();\n        }\n        $this->Z = $z;\n        if ($t === null) {\n            $t = new ParagonIE_Sodium_Core32_Curve25519_Fe();\n        }\n        $this->T = $t;\n    }\n}\n", "num_lines": 66}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp\n */\nclass ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp\n{\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $yplusx;\n\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $yminusx;\n\n    /**\n     * @var ParagonIE_Sodium_Core32_Curve25519_Fe\n     */\n    public $xy2d;\n\n    /**\n     * ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp constructor.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $yplusx\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $yminusx\n     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $xy2d\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function __construct(\n        ParagonIE_Sodium_Core32_Curve25519_Fe $yplusx = null,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $yminusx = null,\n        ParagonIE_Sodium_Core32_Curve25519_Fe $xy2d = null\n    ) {\n        if ($yplusx === null) {\n            $yplusx = ParagonIE_Sodium_Core32_Curve25519::fe_0();\n        }\n        $this->yplusx = $yplusx;\n        if ($yminusx === null) {\n            $yminusx = ParagonIE_Sodium_Core32_Curve25519::fe_0();\n        }\n        $this->yminusx = $yminusx;\n        if ($xy2d === null) {\n            $xy2d = ParagonIE_Sodium_Core32_Curve25519::fe_0();\n        }\n        $this->xy2d = $xy2d;\n    }\n}\n", "num_lines": 57}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('ParagonIE_Sodium_Core32_Poly1305_State', false)) {\n    return;\n}\n\n/**\n * Class ParagonIE_Sodium_Core32_Poly1305_State\n */\nclass ParagonIE_Sodium_Core32_Poly1305_State extends ParagonIE_Sodium_Core32_Util\n{\n    /**\n     * @var array<int, int>\n     */\n    protected $buffer = array();\n\n    /**\n     * @var bool\n     */\n    protected $final = false;\n\n    /**\n     * @var array<int, ParagonIE_Sodium_Core32_Int32>\n     */\n    public $h;\n\n    /**\n     * @var int\n     */\n    protected $leftover = 0;\n\n    /**\n     * @var array<int, ParagonIE_Sodium_Core32_Int32>\n     */\n    public $r;\n\n    /**\n     * @var array<int, ParagonIE_Sodium_Core32_Int64>\n     */\n    public $pad;\n\n    /**\n     * ParagonIE_Sodium_Core32_Poly1305_State constructor.\n     *\n     * @internal You should not use this directly from another application\n     *\n     * @param string $key\n     * @throws InvalidArgumentException\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function __construct($key = '')\n    {\n        if (self::strlen($key) < 32) {\n            throw new InvalidArgumentException(\n                'Poly1305 requires a 32-byte key'\n            );\n        }\n        /* r &= 0xffffffc0ffffffc0ffffffc0fffffff */\n        $this->r = array(\n            // st->r[0] = ...\n            ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 0, 4))\n                ->setUnsignedInt(true)\n                ->mask(0x3ffffff),\n            // st->r[1] = ...\n            ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 3, 4))\n                ->setUnsignedInt(true)\n                ->shiftRight(2)\n                ->mask(0x3ffff03),\n            // st->r[2] = ...\n            ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 6, 4))\n                ->setUnsignedInt(true)\n                ->shiftRight(4)\n                ->mask(0x3ffc0ff),\n            // st->r[3] = ...\n            ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 9, 4))\n                ->setUnsignedInt(true)\n                ->shiftRight(6)\n                ->mask(0x3f03fff),\n            // st->r[4] = ...\n            ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 12, 4))\n                ->setUnsignedInt(true)\n                ->shiftRight(8)\n                ->mask(0x00fffff)\n        );\n\n        /* h = 0 */\n        $this->h = array(\n            new ParagonIE_Sodium_Core32_Int32(array(0, 0), true),\n            new ParagonIE_Sodium_Core32_Int32(array(0, 0), true),\n            new ParagonIE_Sodium_Core32_Int32(array(0, 0), true),\n            new ParagonIE_Sodium_Core32_Int32(array(0, 0), true),\n            new ParagonIE_Sodium_Core32_Int32(array(0, 0), true)\n        );\n\n        /* save pad for later */\n        $this->pad = array(\n            ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 16, 4))\n                ->setUnsignedInt(true)->toInt64(),\n            ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 20, 4))\n                ->setUnsignedInt(true)->toInt64(),\n            ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 24, 4))\n                ->setUnsignedInt(true)->toInt64(),\n            ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 28, 4))\n                ->setUnsignedInt(true)->toInt64(),\n        );\n\n        $this->leftover = 0;\n        $this->final = false;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @return self\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function update($message = '')\n    {\n        $bytes = self::strlen($message);\n\n        /* handle leftover */\n        if ($this->leftover) {\n            /** @var int $want */\n            $want = ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE - $this->leftover;\n            if ($want > $bytes) {\n                $want = $bytes;\n            }\n            for ($i = 0; $i < $want; ++$i) {\n                $mi = self::chrToInt($message[$i]);\n                $this->buffer[$this->leftover + $i] = $mi;\n            }\n            // We snip off the leftmost bytes.\n            $message = self::substr($message, $want);\n            $bytes = self::strlen($message);\n            $this->leftover += $want;\n            if ($this->leftover < ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE) {\n                // We still don't have enough to run $this->blocks()\n                return $this;\n            }\n\n            $this->blocks(\n                self::intArrayToString($this->buffer),\n                ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE\n            );\n            $this->leftover = 0;\n        }\n\n        /* process full blocks */\n        if ($bytes >= ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE) {\n            /** @var int $want */\n            $want = $bytes & ~(ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE - 1);\n            if ($want >= ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE) {\n                /** @var string $block */\n                $block = self::substr($message, 0, $want);\n                if (self::strlen($block) >= ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE) {\n                    $this->blocks($block, $want);\n                    $message = self::substr($message, $want);\n                    $bytes = self::strlen($message);\n                }\n            }\n        }\n\n        /* store leftover */\n        if ($bytes) {\n            for ($i = 0; $i < $bytes; ++$i) {\n                $mi = self::chrToInt($message[$i]);\n                $this->buffer[$this->leftover + $i] = $mi;\n            }\n            $this->leftover = (int) $this->leftover + $bytes;\n        }\n        return $this;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @param string $message\n     * @param int $bytes\n     * @return self\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function blocks($message, $bytes)\n    {\n        if (self::strlen($message) < 16) {\n            $message = str_pad($message, 16, \"\\x00\", STR_PAD_RIGHT);\n        }\n        $hibit = ParagonIE_Sodium_Core32_Int32::fromInt((int) ($this->final ? 0 : 1 << 24)); /* 1 << 128 */\n        $hibit->setUnsignedInt(true);\n        $zero = new ParagonIE_Sodium_Core32_Int64(array(0, 0, 0, 0), true);\n        /**\n         * @var ParagonIE_Sodium_Core32_Int64 $d0\n         * @var ParagonIE_Sodium_Core32_Int64 $d1\n         * @var ParagonIE_Sodium_Core32_Int64 $d2\n         * @var ParagonIE_Sodium_Core32_Int64 $d3\n         * @var ParagonIE_Sodium_Core32_Int64 $d4\n         * @var ParagonIE_Sodium_Core32_Int64 $r0\n         * @var ParagonIE_Sodium_Core32_Int64 $r1\n         * @var ParagonIE_Sodium_Core32_Int64 $r2\n         * @var ParagonIE_Sodium_Core32_Int64 $r3\n         * @var ParagonIE_Sodium_Core32_Int64 $r4\n         *\n         * @var ParagonIE_Sodium_Core32_Int32 $h0\n         * @var ParagonIE_Sodium_Core32_Int32 $h1\n         * @var ParagonIE_Sodium_Core32_Int32 $h2\n         * @var ParagonIE_Sodium_Core32_Int32 $h3\n         * @var ParagonIE_Sodium_Core32_Int32 $h4\n         */\n        $r0 = $this->r[0]->toInt64();\n        $r1 = $this->r[1]->toInt64();\n        $r2 = $this->r[2]->toInt64();\n        $r3 = $this->r[3]->toInt64();\n        $r4 = $this->r[4]->toInt64();\n\n        $s1 = $r1->toInt64()->mulInt(5, 3);\n        $s2 = $r2->toInt64()->mulInt(5, 3);\n        $s3 = $r3->toInt64()->mulInt(5, 3);\n        $s4 = $r4->toInt64()->mulInt(5, 3);\n\n        $h0 = $this->h[0];\n        $h1 = $this->h[1];\n        $h2 = $this->h[2];\n        $h3 = $this->h[3];\n        $h4 = $this->h[4];\n\n        while ($bytes >= ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE) {\n            /* h += m[i] */\n            $h0 = $h0->addInt32(\n                ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 0, 4))\n                    ->mask(0x3ffffff)\n            )->toInt64();\n            $h1 = $h1->addInt32(\n                ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 3, 4))\n                    ->shiftRight(2)\n                    ->mask(0x3ffffff)\n            )->toInt64();\n            $h2 = $h2->addInt32(\n                ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 6, 4))\n                    ->shiftRight(4)\n                    ->mask(0x3ffffff)\n            )->toInt64();\n            $h3 = $h3->addInt32(\n                ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 9, 4))\n                    ->shiftRight(6)\n                    ->mask(0x3ffffff)\n            )->toInt64();\n            $h4 = $h4->addInt32(\n                ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 12, 4))\n                    ->shiftRight(8)\n                    ->orInt32($hibit)\n            )->toInt64();\n\n            /* h *= r */\n            $d0 = $zero\n                ->addInt64($h0->mulInt64($r0, 25))\n                ->addInt64($s4->mulInt64($h1, 26))\n                ->addInt64($s3->mulInt64($h2, 26))\n                ->addInt64($s2->mulInt64($h3, 26))\n                ->addInt64($s1->mulInt64($h4, 26));\n\n            $d1 = $zero\n                ->addInt64($h0->mulInt64($r1, 25))\n                ->addInt64($h1->mulInt64($r0, 25))\n                ->addInt64($s4->mulInt64($h2, 26))\n                ->addInt64($s3->mulInt64($h3, 26))\n                ->addInt64($s2->mulInt64($h4, 26));\n\n            $d2 = $zero\n                ->addInt64($h0->mulInt64($r2, 25))\n                ->addInt64($h1->mulInt64($r1, 25))\n                ->addInt64($h2->mulInt64($r0, 25))\n                ->addInt64($s4->mulInt64($h3, 26))\n                ->addInt64($s3->mulInt64($h4, 26));\n\n            $d3 = $zero\n                ->addInt64($h0->mulInt64($r3, 25))\n                ->addInt64($h1->mulInt64($r2, 25))\n                ->addInt64($h2->mulInt64($r1, 25))\n                ->addInt64($h3->mulInt64($r0, 25))\n                ->addInt64($s4->mulInt64($h4, 26));\n\n            $d4 = $zero\n                ->addInt64($h0->mulInt64($r4, 25))\n                ->addInt64($h1->mulInt64($r3, 25))\n                ->addInt64($h2->mulInt64($r2, 25))\n                ->addInt64($h3->mulInt64($r1, 25))\n                ->addInt64($h4->mulInt64($r0, 25));\n\n            /* (partial) h %= p */\n            $c = $d0->shiftRight(26);\n            $h0 = $d0->toInt32()->mask(0x3ffffff);\n            $d1 = $d1->addInt64($c);\n\n            $c = $d1->shiftRight(26);\n            $h1 = $d1->toInt32()->mask(0x3ffffff);\n            $d2 = $d2->addInt64($c);\n\n            $c = $d2->shiftRight(26);\n            $h2 = $d2->toInt32()->mask(0x3ffffff);\n            $d3 = $d3->addInt64($c);\n\n            $c = $d3->shiftRight(26);\n            $h3 = $d3->toInt32()->mask(0x3ffffff);\n            $d4 = $d4->addInt64($c);\n\n            $c = $d4->shiftRight(26);\n            $h4 = $d4->toInt32()->mask(0x3ffffff);\n            $h0 = $h0->addInt32($c->toInt32()->mulInt(5, 3));\n\n            $c = $h0->shiftRight(26);\n            $h0 = $h0->mask(0x3ffffff);\n            $h1 = $h1->addInt32($c);\n\n            // Chop off the left 32 bytes.\n            $message = self::substr(\n                $message,\n                ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE\n            );\n            $bytes -= ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE;\n        }\n\n        /** @var array<int, ParagonIE_Sodium_Core32_Int32> $h */\n        $this->h = array($h0, $h1, $h2, $h3, $h4);\n        return $this;\n    }\n\n    /**\n     * @internal You should not use this directly from another application\n     *\n     * @return string\n     * @throws SodiumException\n     * @throws TypeError\n     */\n    public function finish()\n    {\n        /* process the remaining block */\n        if ($this->leftover) {\n            $i = $this->leftover;\n            $this->buffer[$i++] = 1;\n            for (; $i < ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE; ++$i) {\n                $this->buffer[$i] = 0;\n            }\n            $this->final = true;\n            $this->blocks(\n                self::substr(\n                    self::intArrayToString($this->buffer),\n                    0,\n                    ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE\n                ),\n                $b = ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE\n            );\n        }\n\n        /**\n         * @var ParagonIE_Sodium_Core32_Int32 $f\n         * @var ParagonIE_Sodium_Core32_Int32 $g0\n         * @var ParagonIE_Sodium_Core32_Int32 $g1\n         * @var ParagonIE_Sodium_Core32_Int32 $g2\n         * @var ParagonIE_Sodium_Core32_Int32 $g3\n         * @var ParagonIE_Sodium_Core32_Int32 $g4\n         * @var ParagonIE_Sodium_Core32_Int32 $h0\n         * @var ParagonIE_Sodium_Core32_Int32 $h1\n         * @var ParagonIE_Sodium_Core32_Int32 $h2\n         * @var ParagonIE_Sodium_Core32_Int32 $h3\n         * @var ParagonIE_Sodium_Core32_Int32 $h4\n         */\n        $h0 = $this->h[0];\n        $h1 = $this->h[1];\n        $h2 = $this->h[2];\n        $h3 = $this->h[3];\n        $h4 = $this->h[4];\n\n        $c = $h1->shiftRight(26);           # $c = $h1 >> 26;\n        $h1 = $h1->mask(0x3ffffff);         # $h1 &= 0x3ffffff;\n\n        $h2 = $h2->addInt32($c);            # $h2 += $c;\n        $c = $h2->shiftRight(26);           # $c = $h2 >> 26;\n        $h2 = $h2->mask(0x3ffffff);         # $h2 &= 0x3ffffff;\n\n        $h3 = $h3->addInt32($c);            # $h3 += $c;\n        $c = $h3->shiftRight(26);           # $c = $h3 >> 26;\n        $h3 = $h3->mask(0x3ffffff);         # $h3 &= 0x3ffffff;\n\n        $h4 = $h4->addInt32($c);            # $h4 += $c;\n        $c = $h4->shiftRight(26);           # $c = $h4 >> 26;\n        $h4 = $h4->mask(0x3ffffff);         # $h4 &= 0x3ffffff;\n\n        $h0 = $h0->addInt32($c->mulInt(5, 3)); # $h0 += self::mul($c, 5);\n        $c = $h0->shiftRight(26);           # $c = $h0 >> 26;\n        $h0 = $h0->mask(0x3ffffff);         # $h0 &= 0x3ffffff;\n        $h1 = $h1->addInt32($c);            # $h1 += $c;\n\n        /* compute h + -p */\n        $g0 = $h0->addInt(5);\n        $c  = $g0->shiftRight(26);\n        $g0 = $g0->mask(0x3ffffff);\n        $g1 = $h1->addInt32($c);\n        $c  = $g1->shiftRight(26);\n        $g1 = $g1->mask(0x3ffffff);\n        $g2 = $h2->addInt32($c);\n        $c  = $g2->shiftRight(26);\n        $g2 = $g2->mask(0x3ffffff);\n        $g3 = $h3->addInt32($c);\n        $c  = $g3->shiftRight(26);\n        $g3 = $g3->mask(0x3ffffff);\n        $g4 = $h4->addInt32($c)->subInt(1 << 26);\n\n        # $mask = ($g4 >> 31) - 1;\n        /* select h if h < p, or h + -p if h >= p */\n        $mask = (int) (($g4->toInt() >> 31) + 1);\n\n        $g0 = $g0->mask($mask);\n        $g1 = $g1->mask($mask);\n        $g2 = $g2->mask($mask);\n        $g3 = $g3->mask($mask);\n        $g4 = $g4->mask($mask);\n\n        /** @var int $mask */\n        $mask = (~$mask) & 0xffffffff;\n\n        $h0 = $h0->mask($mask)->orInt32($g0);\n        $h1 = $h1->mask($mask)->orInt32($g1);\n        $h2 = $h2->mask($mask)->orInt32($g2);\n        $h3 = $h3->mask($mask)->orInt32($g3);\n        $h4 = $h4->mask($mask)->orInt32($g4);\n\n        /* h = h % (2^128) */\n        $h0 = $h0->orInt32($h1->shiftLeft(26));\n        $h1 = $h1->shiftRight(6)->orInt32($h2->shiftLeft(20));\n        $h2 = $h2->shiftRight(12)->orInt32($h3->shiftLeft(14));\n        $h3 = $h3->shiftRight(18)->orInt32($h4->shiftLeft(8));\n\n        /* mac = (h + pad) % (2^128) */\n        $f = $h0->toInt64()->addInt64($this->pad[0]);\n        $h0 = $f->toInt32();\n        $f = $h1->toInt64()->addInt64($this->pad[1])->addInt($h0->overflow);\n        $h1 = $f->toInt32();\n        $f = $h2->toInt64()->addInt64($this->pad[2])->addInt($h1->overflow);\n        $h2 = $f->toInt32();\n        $f = $h3->toInt64()->addInt64($this->pad[3])->addInt($h2->overflow);\n        $h3 = $f->toInt32();\n\n        return $h0->toReverseString() .\n            $h1->toReverseString() .\n            $h2->toReverseString() .\n            $h3->toReverseString();\n    }\n}\n", "num_lines": 452}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * Class ParagonIE_Sodium_Core32_SecretStream_State\n */\nclass ParagonIE_Sodium_Core32_SecretStream_State\n{\n    /** @var string $key */\n    protected $key;\n\n    /** @var int $counter */\n    protected $counter;\n\n    /** @var string $nonce */\n    protected $nonce;\n\n    /** @var string $_pad */\n    protected $_pad;\n\n    /**\n     * ParagonIE_Sodium_Core32_SecretStream_State constructor.\n     * @param string $key\n     * @param string|null $nonce\n     */\n    public function __construct($key, $nonce = null)\n    {\n        $this->key = $key;\n        $this->counter = 1;\n        if (is_null($nonce)) {\n            $nonce = str_repeat(\"\\0\", 12);\n        }\n        $this->nonce = str_pad($nonce, 12, \"\\0\", STR_PAD_RIGHT);;\n        $this->_pad = str_repeat(\"\\0\", 4);\n    }\n\n    /**\n     * @return self\n     */\n    public function counterReset()\n    {\n        $this->counter = 1;\n        $this->_pad = str_repeat(\"\\0\", 4);\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getKey()\n    {\n        return $this->key;\n    }\n\n    /**\n     * @return string\n     */\n    public function getCounter()\n    {\n        return ParagonIE_Sodium_Core32_Util::store32_le($this->counter);\n    }\n\n    /**\n     * @return string\n     */\n    public function getNonce()\n    {\n        if (!is_string($this->nonce)) {\n            $this->nonce = str_repeat(\"\\0\", 12);\n        }\n        if (ParagonIE_Sodium_Core32_Util::strlen($this->nonce) !== 12) {\n            $this->nonce = str_pad($this->nonce, 12, \"\\0\", STR_PAD_RIGHT);\n        }\n        return $this->nonce;\n    }\n\n    /**\n     * @return string\n     */\n    public function getCombinedNonce()\n    {\n        return $this->getCounter() .\n            ParagonIE_Sodium_Core32_Util::substr($this->getNonce(), 0, 8);\n    }\n\n    /**\n     * @return self\n     */\n    public function incrementCounter()\n    {\n        ++$this->counter;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function needsRekey()\n    {\n        return ($this->counter & 0xffff) === 0;\n    }\n\n    /**\n     * @param string $newKeyAndNonce\n     * @return self\n     */\n    public function rekey($newKeyAndNonce)\n    {\n        $this->key = ParagonIE_Sodium_Core32_Util::substr($newKeyAndNonce, 0, 32);\n        $this->nonce = str_pad(\n            ParagonIE_Sodium_Core32_Util::substr($newKeyAndNonce, 32),\n            12,\n            \"\\0\",\n            STR_PAD_RIGHT\n        );\n        return $this;\n    }\n\n    /**\n     * @param string $str\n     * @return self\n     */\n    public function xorNonce($str)\n    {\n        $this->nonce = ParagonIE_Sodium_Core32_Util::xorStrings(\n            $this->getNonce(),\n            str_pad(\n                ParagonIE_Sodium_Core32_Util::substr($str, 0, 8),\n                12,\n                \"\\0\",\n                STR_PAD_RIGHT\n            )\n        );\n        return $this;\n    }\n\n    /**\n     * @param string $string\n     * @return self\n     */\n    public static function fromString($string)\n    {\n        $state = new ParagonIE_Sodium_Core32_SecretStream_State(\n            ParagonIE_Sodium_Core32_Util::substr($string, 0, 32)\n        );\n        $state->counter = ParagonIE_Sodium_Core32_Util::load_4(\n            ParagonIE_Sodium_Core32_Util::substr($string, 32, 4)\n        );\n        $state->nonce = ParagonIE_Sodium_Core32_Util::substr($string, 36, 12);\n        $state->_pad = ParagonIE_Sodium_Core32_Util::substr($string, 48, 8);\n        return $state;\n    }\n\n    /**\n     * @return string\n     */\n    public function toString()\n    {\n        return $this->key .\n            $this->getCounter() .\n            $this->nonce .\n            $this->_pad;\n    }\n}\n", "num_lines": 164}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nif (class_exists('SplFixedArray')) {\n    return;\n}\n\n/**\n * The SplFixedArray class provides the main functionalities of array. The\n * main differences between a SplFixedArray and a normal PHP array is that\n * the SplFixedArray is of fixed length and allows only integers within\n * the range as indexes. The advantage is that it allows a faster array\n * implementation.\n */\nclass SplFixedArray implements Iterator, ArrayAccess, Countable\n{\n    /** @var array<int, mixed> */\n    private $internalArray = array();\n\n    /** @var int $size */\n    private $size = 0;\n\n    /**\n     * SplFixedArray constructor.\n     * @param int $size\n     */\n    public function __construct($size = 0)\n    {\n        $this->size = $size;\n        $this->internalArray = array();\n    }\n\n    /**\n     * @return int\n     */\n    public function count()\n    {\n        return count($this->internalArray);\n    }\n\n    /**\n     * @return array\n     */\n    public function toArray()\n    {\n        ksort($this->internalArray);\n        return (array) $this->internalArray;\n    }\n\n    /**\n     * @param array $array\n     * @param bool $save_indexes\n     * @return SplFixedArray\n     * @psalm-suppress MixedAssignment\n     */\n    public static function fromArray(array $array, $save_indexes = true)\n    {\n        $self = new SplFixedArray(count($array));\n        if($save_indexes) {\n            foreach($array as $key => $value) {\n                $self[(int) $key] = $value;\n            }\n        } else {\n            $i = 0;\n            foreach (array_values($array) as $value) {\n                $self[$i] = $value;\n                $i++;\n            }\n        }\n        return $self;\n    }\n\n    /**\n     * @return int\n     */\n    public function getSize()\n    {\n        return $this->size;\n    }\n\n    /**\n     * @param int $size\n     * @return bool\n     */\n    public function setSize($size)\n    {\n        $this->size = $size;\n        return true;\n    }\n\n    /**\n     * @param string|int $index\n     * @return bool\n     */\n    public function offsetExists($index)\n    {\n        return array_key_exists((int) $index, $this->internalArray);\n    }\n\n    /**\n     * @param string|int $index\n     * @return mixed\n     */\n    public function offsetGet($index)\n    {\n        return $this->internalArray[(int) $index];\n    }\n\n    /**\n     * @param string|int $index\n     * @param mixed $newval\n     * @psalm-suppress MixedAssignment\n     */\n    public function offsetSet($index, $newval)\n    {\n        $this->internalArray[(int) $index] = $newval;\n    }\n\n    /**\n     * @param string|int $index\n     */\n    public function offsetUnset($index)\n    {\n        unset($this->internalArray[(int) $index]);\n    }\n\n    /**\n     * Rewind iterator back to the start\n     * @link https://php.net/manual/en/splfixedarray.rewind.php\n     * @return void\n     * @since 5.3.0\n     */\n    public function rewind()\n    {\n        reset($this->internalArray);\n    }\n\n    /**\n     * Return current array entry\n     * @link https://php.net/manual/en/splfixedarray.current.php\n     * @return mixed The current element value.\n     * @since 5.3.0\n     */\n    public function current()\n    {\n        return current($this->internalArray);\n    }\n\n    /**\n     * Return current array index\n     * @return int The current array index.\n     */\n    public function key()\n    {\n        return key($this->internalArray);\n    }\n\n    /**\n     * @return void\n     */\n    public function next()\n    {\n        next($this->internalArray);\n    }\n\n    /**\n     * Check whether the array contains more elements\n     * @link https://php.net/manual/en/splfixedarray.valid.php\n     * @return bool true if the array contains any more elements, false otherwise.\n     */\n    public function valid()\n    {\n        if (empty($this->internalArray)) {\n            return false;\n        }\n        $result = next($this->internalArray) !== false;\n        prev($this->internalArray);\n        return $result;\n    }\n\n    /**\n     * Do nothing.\n     */\n    public function __wakeup()\n    {\n        // NOP\n    }\n}", "num_lines": 187}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * General API for generating and formatting diffs - the differences between\n * two sequences of strings.\n *\n * The original PHP version of this code was written by Geoffrey T. Dairiki\n * <dairiki@dairiki.org>, and is used/adapted with his permission.\n *\n * Copyright 2004 Geoffrey T. Dairiki <dairiki@dairiki.org>\n * Copyright 2004-2010 The Horde Project (http://www.horde.org/)\n *\n * See the enclosed file COPYING for license information (LGPL). If you did\n * not receive this file, see http://opensource.org/licenses/lgpl-license.php.\n *\n * @package Text_Diff\n * @author  Geoffrey T. Dairiki <dairiki@dairiki.org>\n */\nclass Text_Diff {\n\n    /**\n     * Array of changes.\n     *\n     * @var array\n     */\n    var $_edits;\n\n    /**\n     * Computes diffs between sequences of strings.\n     *\n     * @param string $engine     Name of the diffing engine to use.  'auto'\n     *                           will automatically select the best.\n     * @param array $params      Parameters to pass to the diffing engine.\n     *                           Normally an array of two arrays, each\n     *                           containing the lines from a file.\n     */\n    function __construct( $engine, $params )\n    {\n        // Backward compatibility workaround.\n        if (!is_string($engine)) {\n            $params = array($engine, $params);\n            $engine = 'auto';\n        }\n\n        if ($engine == 'auto') {\n            $engine = extension_loaded('xdiff') ? 'xdiff' : 'native';\n        } else {\n            $engine = basename($engine);\n        }\n\n        // WP #7391\n        require_once dirname(__FILE__).'/Diff/Engine/' . $engine . '.php';\n        $class = 'Text_Diff_Engine_' . $engine;\n        $diff_engine = new $class();\n\n        $this->_edits = call_user_func_array(array($diff_engine, 'diff'), $params);\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function Text_Diff( $engine, $params ) {\n\t\tself::__construct( $engine, $params );\n\t}\n\n    /**\n     * Returns the array of differences.\n     */\n    function getDiff()\n    {\n        return $this->_edits;\n    }\n\n    /**\n     * returns the number of new (added) lines in a given diff.\n     *\n     * @since Text_Diff 1.1.0\n     *\n     * @return integer The number of new lines\n     */\n    function countAddedLines()\n    {\n        $count = 0;\n        foreach ($this->_edits as $edit) {\n            if (is_a($edit, 'Text_Diff_Op_add') ||\n                is_a($edit, 'Text_Diff_Op_change')) {\n                $count += $edit->nfinal();\n            }\n        }\n        return $count;\n    }\n\n    /**\n     * Returns the number of deleted (removed) lines in a given diff.\n     *\n     * @since Text_Diff 1.1.0\n     *\n     * @return integer The number of deleted lines\n     */\n    function countDeletedLines()\n    {\n        $count = 0;\n        foreach ($this->_edits as $edit) {\n            if (is_a($edit, 'Text_Diff_Op_delete') ||\n                is_a($edit, 'Text_Diff_Op_change')) {\n                $count += $edit->norig();\n            }\n        }\n        return $count;\n    }\n\n    /**\n     * Computes a reversed diff.\n     *\n     * Example:\n     * <code>\n     * $diff = new Text_Diff($lines1, $lines2);\n     * $rev = $diff->reverse();\n     * </code>\n     *\n     * @return Text_Diff  A Diff object representing the inverse of the\n     *                    original diff.  Note that we purposely don't return a\n     *                    reference here, since this essentially is a clone()\n     *                    method.\n     */\n    function reverse()\n    {\n        if (version_compare(zend_version(), '2', '>')) {\n            $rev = clone($this);\n        } else {\n            $rev = $this;\n        }\n        $rev->_edits = array();\n        foreach ($this->_edits as $edit) {\n            $rev->_edits[] = $edit->reverse();\n        }\n        return $rev;\n    }\n\n    /**\n     * Checks for an empty diff.\n     *\n     * @return boolean  True if two sequences were identical.\n     */\n    function isEmpty()\n    {\n        foreach ($this->_edits as $edit) {\n            if (!is_a($edit, 'Text_Diff_Op_copy')) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    /**\n     * Computes the length of the Longest Common Subsequence (LCS).\n     *\n     * This is mostly for diagnostic purposes.\n     *\n     * @return integer  The length of the LCS.\n     */\n    function lcs()\n    {\n        $lcs = 0;\n        foreach ($this->_edits as $edit) {\n            if (is_a($edit, 'Text_Diff_Op_copy')) {\n                $lcs += count($edit->orig);\n            }\n        }\n        return $lcs;\n    }\n\n    /**\n     * Gets the original set of lines.\n     *\n     * This reconstructs the $from_lines parameter passed to the constructor.\n     *\n     * @return array  The original sequence of strings.\n     */\n    function getOriginal()\n    {\n        $lines = array();\n        foreach ($this->_edits as $edit) {\n            if ($edit->orig) {\n                array_splice($lines, count($lines), 0, $edit->orig);\n            }\n        }\n        return $lines;\n    }\n\n    /**\n     * Gets the final set of lines.\n     *\n     * This reconstructs the $to_lines parameter passed to the constructor.\n     *\n     * @return array  The sequence of strings.\n     */\n    function getFinal()\n    {\n        $lines = array();\n        foreach ($this->_edits as $edit) {\n            if ($edit->final) {\n                array_splice($lines, count($lines), 0, $edit->final);\n            }\n        }\n        return $lines;\n    }\n\n    /**\n     * Removes trailing newlines from a line of text. This is meant to be used\n     * with array_walk().\n     *\n     * @param string $line  The line to trim.\n     * @param integer $key  The index of the line in the array. Not used.\n     */\n    static function trimNewlines(&$line, $key)\n    {\n        $line = str_replace(array(\"\\n\", \"\\r\"), '', $line);\n    }\n\n    /**\n     * Determines the location of the system temporary directory.\n     *\n     * @static\n     *\n     * @access protected\n     *\n     * @return string  A directory name which can be used for temp files.\n     *                 Returns false if one could not be found.\n     */\n    function _getTempDir()\n    {\n        $tmp_locations = array('/tmp', '/var/tmp', 'c:\\WUTemp', 'c:\\temp',\n                               'c:\\windows\\temp', 'c:\\winnt\\temp');\n\n        /* Try PHP's upload_tmp_dir directive. */\n        $tmp = ini_get('upload_tmp_dir');\n\n        /* Otherwise, try to determine the TMPDIR environment variable. */\n        if (!strlen($tmp)) {\n            $tmp = getenv('TMPDIR');\n        }\n\n        /* If we still cannot determine a value, then cycle through a list of\n         * preset possibilities. */\n        while (!strlen($tmp) && count($tmp_locations)) {\n            $tmp_check = array_shift($tmp_locations);\n            if (@is_dir($tmp_check)) {\n                $tmp = $tmp_check;\n            }\n        }\n\n        /* If it is still empty, we have failed, so return false; otherwise\n         * return the directory determined. */\n        return strlen($tmp) ? $tmp : false;\n    }\n\n    /**\n     * Checks a diff for validity.\n     *\n     * This is here only for debugging purposes.\n     */\n    function _check($from_lines, $to_lines)\n    {\n        if (serialize($from_lines) != serialize($this->getOriginal())) {\n            trigger_error(\"Reconstructed original doesn't match\", E_USER_ERROR);\n        }\n        if (serialize($to_lines) != serialize($this->getFinal())) {\n            trigger_error(\"Reconstructed final doesn't match\", E_USER_ERROR);\n        }\n\n        $rev = $this->reverse();\n        if (serialize($to_lines) != serialize($rev->getOriginal())) {\n            trigger_error(\"Reversed original doesn't match\", E_USER_ERROR);\n        }\n        if (serialize($from_lines) != serialize($rev->getFinal())) {\n            trigger_error(\"Reversed final doesn't match\", E_USER_ERROR);\n        }\n\n        $prevtype = null;\n        foreach ($this->_edits as $edit) {\n            if ($prevtype == get_class($edit)) {\n                trigger_error(\"Edit sequence is non-optimal\", E_USER_ERROR);\n            }\n            $prevtype = get_class($edit);\n        }\n\n        return true;\n    }\n\n}\n\n/**\n * @package Text_Diff\n * @author  Geoffrey T. Dairiki <dairiki@dairiki.org>\n */\nclass Text_MappedDiff extends Text_Diff {\n\n    /**\n     * Computes a diff between sequences of strings.\n     *\n     * This can be used to compute things like case-insensitve diffs, or diffs\n     * which ignore changes in white-space.\n     *\n     * @param array $from_lines         An array of strings.\n     * @param array $to_lines           An array of strings.\n     * @param array $mapped_from_lines  This array should have the same size\n     *                                  number of elements as $from_lines.  The\n     *                                  elements in $mapped_from_lines and\n     *                                  $mapped_to_lines are what is actually\n     *                                  compared when computing the diff.\n     * @param array $mapped_to_lines    This array should have the same number\n     *                                  of elements as $to_lines.\n     */\n    function __construct($from_lines, $to_lines,\n                             $mapped_from_lines, $mapped_to_lines)\n    {\n        assert(count($from_lines) == count($mapped_from_lines));\n        assert(count($to_lines) == count($mapped_to_lines));\n\n        parent::Text_Diff($mapped_from_lines, $mapped_to_lines);\n\n        $xi = $yi = 0;\n        for ($i = 0; $i < count($this->_edits); $i++) {\n            $orig = &$this->_edits[$i]->orig;\n            if (is_array($orig)) {\n                $orig = array_slice($from_lines, $xi, count($orig));\n                $xi += count($orig);\n            }\n\n            $final = &$this->_edits[$i]->final;\n            if (is_array($final)) {\n                $final = array_slice($to_lines, $yi, count($final));\n                $yi += count($final);\n            }\n        }\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function Text_MappedDiff( $from_lines, $to_lines,\n                             $mapped_from_lines, $mapped_to_lines ) {\n\t\tself::__construct( $from_lines, $to_lines,\n                             $mapped_from_lines, $mapped_to_lines );\n\t}\n\n}\n\n/**\n * @package Text_Diff\n * @author  Geoffrey T. Dairiki <dairiki@dairiki.org>\n *\n * @access private\n */\nclass Text_Diff_Op {\n\n    var $orig;\n    var $final;\n\n    function &reverse()\n    {\n        trigger_error('Abstract method', E_USER_ERROR);\n    }\n\n    function norig()\n    {\n        return $this->orig ? count($this->orig) : 0;\n    }\n\n    function nfinal()\n    {\n        return $this->final ? count($this->final) : 0;\n    }\n\n}\n\n/**\n * @package Text_Diff\n * @author  Geoffrey T. Dairiki <dairiki@dairiki.org>\n *\n * @access private\n */\nclass Text_Diff_Op_copy extends Text_Diff_Op {\n\n\t/**\n\t * PHP5 constructor.\n\t */\n    function __construct( $orig, $final = false )\n    {\n        if (!is_array($final)) {\n            $final = $orig;\n        }\n        $this->orig = $orig;\n        $this->final = $final;\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function Text_Diff_Op_copy( $orig, $final = false ) {\n\t\tself::__construct( $orig, $final );\n\t}\n\n    function &reverse()\n    {\n        $reverse = new Text_Diff_Op_copy($this->final, $this->orig);\n        return $reverse;\n    }\n\n}\n\n/**\n * @package Text_Diff\n * @author  Geoffrey T. Dairiki <dairiki@dairiki.org>\n *\n * @access private\n */\nclass Text_Diff_Op_delete extends Text_Diff_Op {\n\n\t/**\n\t * PHP5 constructor.\n\t */\n\tfunction __construct( $lines )\n    {\n        $this->orig = $lines;\n        $this->final = false;\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function Text_Diff_Op_delete( $lines ) {\n\t\tself::__construct( $lines );\n\t}\n\n    function &reverse()\n    {\n        $reverse = new Text_Diff_Op_add($this->orig);\n        return $reverse;\n    }\n\n}\n\n/**\n * @package Text_Diff\n * @author  Geoffrey T. Dairiki <dairiki@dairiki.org>\n *\n * @access private\n */\nclass Text_Diff_Op_add extends Text_Diff_Op {\n\n\t/**\n\t * PHP5 constructor.\n\t */\n    function __construct( $lines )\n    {\n        $this->final = $lines;\n        $this->orig = false;\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function Text_Diff_Op_add( $lines ) {\n\t\tself::__construct( $lines );\n\t}\n\n    function &reverse()\n    {\n        $reverse = new Text_Diff_Op_delete($this->final);\n        return $reverse;\n    }\n\n}\n\n/**\n * @package Text_Diff\n * @author  Geoffrey T. Dairiki <dairiki@dairiki.org>\n *\n * @access private\n */\nclass Text_Diff_Op_change extends Text_Diff_Op {\n\n\t/**\n\t * PHP5 constructor.\n\t */\n    function __construct( $orig, $final )\n    {\n        $this->orig = $orig;\n        $this->final = $final;\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function Text_Diff_Op_change( $orig, $final ) {\n\t\tself::__construct( $orig, $final );\n\t}\n\n    function &reverse()\n    {\n        $reverse = new Text_Diff_Op_change($this->final, $this->orig);\n        return $reverse;\n    }\n\n}\n", "num_lines": 507}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * A class to render Diffs in different formats.\n *\n * This class renders the diff in classic diff format. It is intended that\n * this class be customized via inheritance, to obtain fancier outputs.\n *\n * Copyright 2004-2010 The Horde Project (http://www.horde.org/)\n *\n * See the enclosed file COPYING for license information (LGPL). If you did\n * not receive this file, see http://opensource.org/licenses/lgpl-license.php.\n *\n * @package Text_Diff\n */\nclass Text_Diff_Renderer {\n\n    /**\n     * Number of leading context \"lines\" to preserve.\n     *\n     * This should be left at zero for this class, but subclasses may want to\n     * set this to other values.\n     */\n    var $_leading_context_lines = 0;\n\n    /**\n     * Number of trailing context \"lines\" to preserve.\n     *\n     * This should be left at zero for this class, but subclasses may want to\n     * set this to other values.\n     */\n    var $_trailing_context_lines = 0;\n\n    /**\n     * Constructor.\n     */\n    function __construct( $params = array() )\n    {\n        foreach ($params as $param => $value) {\n            $v = '_' . $param;\n            if (isset($this->$v)) {\n                $this->$v = $value;\n            }\n        }\n    }\n\n\t/**\n\t * PHP4 constructor.\n\t */\n\tpublic function Text_Diff_Renderer( $params = array() ) {\n\t\tself::__construct( $params );\n\t}\n\n    /**\n     * Get any renderer parameters.\n     *\n     * @return array  All parameters of this renderer object.\n     */\n    function getParams()\n    {\n        $params = array();\n        foreach (get_object_vars($this) as $k => $v) {\n            if ($k[0] == '_') {\n                $params[substr($k, 1)] = $v;\n            }\n        }\n\n        return $params;\n    }\n\n    /**\n     * Renders a diff.\n     *\n     * @param Text_Diff $diff  A Text_Diff object.\n     *\n     * @return string  The formatted output.\n     */\n    function render($diff)\n    {\n        $xi = $yi = 1;\n        $block = false;\n        $context = array();\n\n        $nlead = $this->_leading_context_lines;\n        $ntrail = $this->_trailing_context_lines;\n\n        $output = $this->_startDiff();\n\n        $diffs = $diff->getDiff();\n        foreach ($diffs as $i => $edit) {\n            /* If these are unchanged (copied) lines, and we want to keep\n             * leading or trailing context lines, extract them from the copy\n             * block. */\n            if (is_a($edit, 'Text_Diff_Op_copy')) {\n                /* Do we have any diff blocks yet? */\n                if (is_array($block)) {\n                    /* How many lines to keep as context from the copy\n                     * block. */\n                    $keep = $i == count($diffs) - 1 ? $ntrail : $nlead + $ntrail;\n                    if (count($edit->orig) <= $keep) {\n                        /* We have less lines in the block than we want for\n                         * context => keep the whole block. */\n                        $block[] = $edit;\n                    } else {\n                        if ($ntrail) {\n                            /* Create a new block with as many lines as we need\n                             * for the trailing context. */\n                            $context = array_slice($edit->orig, 0, $ntrail);\n                            $block[] = new Text_Diff_Op_copy($context);\n                        }\n                        /* @todo */\n                        $output .= $this->_block($x0, $ntrail + $xi - $x0,\n                                                 $y0, $ntrail + $yi - $y0,\n                                                 $block);\n                        $block = false;\n                    }\n                }\n                /* Keep the copy block as the context for the next block. */\n                $context = $edit->orig;\n            } else {\n                /* Don't we have any diff blocks yet? */\n                if (!is_array($block)) {\n                    /* Extract context lines from the preceding copy block. */\n                    $context = array_slice($context, count($context) - $nlead);\n                    $x0 = $xi - count($context);\n                    $y0 = $yi - count($context);\n                    $block = array();\n                    if ($context) {\n                        $block[] = new Text_Diff_Op_copy($context);\n                    }\n                }\n                $block[] = $edit;\n            }\n\n            if ($edit->orig) {\n                $xi += count($edit->orig);\n            }\n            if ($edit->final) {\n                $yi += count($edit->final);\n            }\n        }\n\n        if (is_array($block)) {\n            $output .= $this->_block($x0, $xi - $x0,\n                                     $y0, $yi - $y0,\n                                     $block);\n        }\n\n        return $output . $this->_endDiff();\n    }\n\n    function _block($xbeg, $xlen, $ybeg, $ylen, &$edits)\n    {\n        $output = $this->_startBlock($this->_blockHeader($xbeg, $xlen, $ybeg, $ylen));\n\n        foreach ($edits as $edit) {\n            switch (strtolower(get_class($edit))) {\n            case 'text_diff_op_copy':\n                $output .= $this->_context($edit->orig);\n                break;\n\n            case 'text_diff_op_add':\n                $output .= $this->_added($edit->final);\n                break;\n\n            case 'text_diff_op_delete':\n                $output .= $this->_deleted($edit->orig);\n                break;\n\n            case 'text_diff_op_change':\n                $output .= $this->_changed($edit->orig, $edit->final);\n                break;\n            }\n        }\n\n        return $output . $this->_endBlock();\n    }\n\n    function _startDiff()\n    {\n        return '';\n    }\n\n    function _endDiff()\n    {\n        return '';\n    }\n\n    function _blockHeader($xbeg, $xlen, $ybeg, $ylen)\n    {\n        if ($xlen > 1) {\n            $xbeg .= ',' . ($xbeg + $xlen - 1);\n        }\n        if ($ylen > 1) {\n            $ybeg .= ',' . ($ybeg + $ylen - 1);\n        }\n\n        // this matches the GNU Diff behaviour\n        if ($xlen && !$ylen) {\n            $ybeg--;\n        } elseif (!$xlen) {\n            $xbeg--;\n        }\n\n        return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg;\n    }\n\n    function _startBlock($header)\n    {\n        return $header . \"\\n\";\n    }\n\n    function _endBlock()\n    {\n        return '';\n    }\n\n    function _lines($lines, $prefix = ' ')\n    {\n        return $prefix . implode(\"\\n$prefix\", $lines) . \"\\n\";\n    }\n\n    function _context($lines)\n    {\n        return $this->_lines($lines, '  ');\n    }\n\n    function _added($lines)\n    {\n        return $this->_lines($lines, '> ');\n    }\n\n    function _deleted($lines)\n    {\n        return $this->_lines($lines, '< ');\n    }\n\n    function _changed($orig, $final)\n    {\n        return $this->_deleted($orig) . \"---\\n\" . $this->_added($final);\n    }\n\n}\n", "num_lines": 243}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Class used internally by Text_Diff to actually compute the diffs.\n *\n * This class is implemented using native PHP code.\n *\n * The algorithm used here is mostly lifted from the perl module\n * Algorithm::Diff (version 1.06) by Ned Konz, which is available at:\n * http://www.perl.com/CPAN/authors/id/N/NE/NEDKONZ/Algorithm-Diff-1.06.zip\n *\n * More ideas are taken from: http://www.ics.uci.edu/~eppstein/161/960229.html\n *\n * Some ideas (and a bit of code) are taken from analyze.c, of GNU\n * diffutils-2.7, which can be found at:\n * ftp://gnudist.gnu.org/pub/gnu/diffutils/diffutils-2.7.tar.gz\n *\n * Some ideas (subdivision by NCHUNKS > 2, and some optimizations) are from\n * Geoffrey T. Dairiki <dairiki@dairiki.org>. The original PHP version of this\n * code was written by him, and is used/adapted with his permission.\n *\n * Copyright 2004-2010 The Horde Project (http://www.horde.org/)\n *\n * See the enclosed file COPYING for license information (LGPL). If you did\n * not receive this file, see http://opensource.org/licenses/lgpl-license.php.\n *\n * @author  Geoffrey T. Dairiki <dairiki@dairiki.org>\n * @package Text_Diff\n */\nclass Text_Diff_Engine_native {\n\n    function diff($from_lines, $to_lines)\n    {\n        array_walk($from_lines, array('Text_Diff', 'trimNewlines'));\n        array_walk($to_lines, array('Text_Diff', 'trimNewlines'));\n\n        $n_from = count($from_lines);\n        $n_to = count($to_lines);\n\n        $this->xchanged = $this->ychanged = array();\n        $this->xv = $this->yv = array();\n        $this->xind = $this->yind = array();\n        unset($this->seq);\n        unset($this->in_seq);\n        unset($this->lcs);\n\n        // Skip leading common lines.\n        for ($skip = 0; $skip < $n_from && $skip < $n_to; $skip++) {\n            if ($from_lines[$skip] !== $to_lines[$skip]) {\n                break;\n            }\n            $this->xchanged[$skip] = $this->ychanged[$skip] = false;\n        }\n\n        // Skip trailing common lines.\n        $xi = $n_from; $yi = $n_to;\n        for ($endskip = 0; --$xi > $skip && --$yi > $skip; $endskip++) {\n            if ($from_lines[$xi] !== $to_lines[$yi]) {\n                break;\n            }\n            $this->xchanged[$xi] = $this->ychanged[$yi] = false;\n        }\n\n        // Ignore lines which do not exist in both files.\n        for ($xi = $skip; $xi < $n_from - $endskip; $xi++) {\n            $xhash[$from_lines[$xi]] = 1;\n        }\n        for ($yi = $skip; $yi < $n_to - $endskip; $yi++) {\n            $line = $to_lines[$yi];\n            if (($this->ychanged[$yi] = empty($xhash[$line]))) {\n                continue;\n            }\n            $yhash[$line] = 1;\n            $this->yv[] = $line;\n            $this->yind[] = $yi;\n        }\n        for ($xi = $skip; $xi < $n_from - $endskip; $xi++) {\n            $line = $from_lines[$xi];\n            if (($this->xchanged[$xi] = empty($yhash[$line]))) {\n                continue;\n            }\n            $this->xv[] = $line;\n            $this->xind[] = $xi;\n        }\n\n        // Find the LCS.\n        $this->_compareseq(0, count($this->xv), 0, count($this->yv));\n\n        // Merge edits when possible.\n        $this->_shiftBoundaries($from_lines, $this->xchanged, $this->ychanged);\n        $this->_shiftBoundaries($to_lines, $this->ychanged, $this->xchanged);\n\n        // Compute the edit operations.\n        $edits = array();\n        $xi = $yi = 0;\n        while ($xi < $n_from || $yi < $n_to) {\n            assert($yi < $n_to || $this->xchanged[$xi]);\n            assert($xi < $n_from || $this->ychanged[$yi]);\n\n            // Skip matching \"snake\".\n            $copy = array();\n            while ($xi < $n_from && $yi < $n_to\n                   && !$this->xchanged[$xi] && !$this->ychanged[$yi]) {\n                $copy[] = $from_lines[$xi++];\n                ++$yi;\n            }\n            if ($copy) {\n                $edits[] = new Text_Diff_Op_copy($copy);\n            }\n\n            // Find deletes & adds.\n            $delete = array();\n            while ($xi < $n_from && $this->xchanged[$xi]) {\n                $delete[] = $from_lines[$xi++];\n            }\n\n            $add = array();\n            while ($yi < $n_to && $this->ychanged[$yi]) {\n                $add[] = $to_lines[$yi++];\n            }\n\n            if ($delete && $add) {\n                $edits[] = new Text_Diff_Op_change($delete, $add);\n            } elseif ($delete) {\n                $edits[] = new Text_Diff_Op_delete($delete);\n            } elseif ($add) {\n                $edits[] = new Text_Diff_Op_add($add);\n            }\n        }\n\n        return $edits;\n    }\n\n    /**\n     * Divides the Largest Common Subsequence (LCS) of the sequences (XOFF,\n     * XLIM) and (YOFF, YLIM) into NCHUNKS approximately equally sized\n     * segments.\n     *\n     * Returns (LCS, PTS).  LCS is the length of the LCS. PTS is an array of\n     * NCHUNKS+1 (X, Y) indexes giving the diving points between sub\n     * sequences.  The first sub-sequence is contained in (X0, X1), (Y0, Y1),\n     * the second in (X1, X2), (Y1, Y2) and so on.  Note that (X0, Y0) ==\n     * (XOFF, YOFF) and (X[NCHUNKS], Y[NCHUNKS]) == (XLIM, YLIM).\n     *\n     * This function assumes that the first lines of the specified portions of\n     * the two files do not match, and likewise that the last lines do not\n     * match.  The caller must trim matching lines from the beginning and end\n     * of the portions it is going to specify.\n     */\n    function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks)\n    {\n        $flip = false;\n\n        if ($xlim - $xoff > $ylim - $yoff) {\n            /* Things seems faster (I'm not sure I understand why) when the\n             * shortest sequence is in X. */\n            $flip = true;\n            list ($xoff, $xlim, $yoff, $ylim)\n                = array($yoff, $ylim, $xoff, $xlim);\n        }\n\n        if ($flip) {\n            for ($i = $ylim - 1; $i >= $yoff; $i--) {\n                $ymatches[$this->xv[$i]][] = $i;\n            }\n        } else {\n            for ($i = $ylim - 1; $i >= $yoff; $i--) {\n                $ymatches[$this->yv[$i]][] = $i;\n            }\n        }\n\n        $this->lcs = 0;\n        $this->seq[0]= $yoff - 1;\n        $this->in_seq = array();\n        $ymids[0] = array();\n\n        $numer = $xlim - $xoff + $nchunks - 1;\n        $x = $xoff;\n        for ($chunk = 0; $chunk < $nchunks; $chunk++) {\n            if ($chunk > 0) {\n                for ($i = 0; $i <= $this->lcs; $i++) {\n                    $ymids[$i][$chunk - 1] = $this->seq[$i];\n                }\n            }\n\n            $x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $chunk) / $nchunks);\n            for (; $x < $x1; $x++) {\n                $line = $flip ? $this->yv[$x] : $this->xv[$x];\n                if (empty($ymatches[$line])) {\n                    continue;\n                }\n                $matches = $ymatches[$line];\n                reset($matches);\n                while ($y = current($matches)) {\n                    if (empty($this->in_seq[$y])) {\n                        $k = $this->_lcsPos($y);\n                        assert($k > 0);\n                        $ymids[$k] = $ymids[$k - 1];\n                        break;\n                    }\n                    next($matches);\n                }\n                while ($y = current($matches)) {\n                    if ($y > $this->seq[$k - 1]) {\n                        assert($y <= $this->seq[$k]);\n                        /* Optimization: this is a common case: next match is\n                         * just replacing previous match. */\n                        $this->in_seq[$this->seq[$k]] = false;\n                        $this->seq[$k] = $y;\n                        $this->in_seq[$y] = 1;\n                    } elseif (empty($this->in_seq[$y])) {\n                        $k = $this->_lcsPos($y);\n                        assert($k > 0);\n                        $ymids[$k] = $ymids[$k - 1];\n                    }\n                    next($matches);\n                }\n            }\n        }\n\n        $seps[] = $flip ? array($yoff, $xoff) : array($xoff, $yoff);\n        $ymid = $ymids[$this->lcs];\n        for ($n = 0; $n < $nchunks - 1; $n++) {\n            $x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $n) / $nchunks);\n            $y1 = $ymid[$n] + 1;\n            $seps[] = $flip ? array($y1, $x1) : array($x1, $y1);\n        }\n        $seps[] = $flip ? array($ylim, $xlim) : array($xlim, $ylim);\n\n        return array($this->lcs, $seps);\n    }\n\n    function _lcsPos($ypos)\n    {\n        $end = $this->lcs;\n        if ($end == 0 || $ypos > $this->seq[$end]) {\n            $this->seq[++$this->lcs] = $ypos;\n            $this->in_seq[$ypos] = 1;\n            return $this->lcs;\n        }\n\n        $beg = 1;\n        while ($beg < $end) {\n            $mid = (int)(($beg + $end) / 2);\n            if ($ypos > $this->seq[$mid]) {\n                $beg = $mid + 1;\n            } else {\n                $end = $mid;\n            }\n        }\n\n        assert($ypos != $this->seq[$end]);\n\n        $this->in_seq[$this->seq[$end]] = false;\n        $this->seq[$end] = $ypos;\n        $this->in_seq[$ypos] = 1;\n        return $end;\n    }\n\n    /**\n     * Finds LCS of two sequences.\n     *\n     * The results are recorded in the vectors $this->{x,y}changed[], by\n     * storing a 1 in the element for each line that is an insertion or\n     * deletion (ie. is not in the LCS).\n     *\n     * The subsequence of file 0 is (XOFF, XLIM) and likewise for file 1.\n     *\n     * Note that XLIM, YLIM are exclusive bounds.  All line numbers are\n     * origin-0 and discarded lines are not counted.\n     */\n    function _compareseq ($xoff, $xlim, $yoff, $ylim)\n    {\n        /* Slide down the bottom initial diagonal. */\n        while ($xoff < $xlim && $yoff < $ylim\n               && $this->xv[$xoff] == $this->yv[$yoff]) {\n            ++$xoff;\n            ++$yoff;\n        }\n\n        /* Slide up the top initial diagonal. */\n        while ($xlim > $xoff && $ylim > $yoff\n               && $this->xv[$xlim - 1] == $this->yv[$ylim - 1]) {\n            --$xlim;\n            --$ylim;\n        }\n\n        if ($xoff == $xlim || $yoff == $ylim) {\n            $lcs = 0;\n        } else {\n            /* This is ad hoc but seems to work well.  $nchunks =\n             * sqrt(min($xlim - $xoff, $ylim - $yoff) / 2.5); $nchunks =\n             * max(2,min(8,(int)$nchunks)); */\n            $nchunks = min(7, $xlim - $xoff, $ylim - $yoff) + 1;\n            list($lcs, $seps)\n                = $this->_diag($xoff, $xlim, $yoff, $ylim, $nchunks);\n        }\n\n        if ($lcs == 0) {\n            /* X and Y sequences have no common subsequence: mark all\n             * changed. */\n            while ($yoff < $ylim) {\n                $this->ychanged[$this->yind[$yoff++]] = 1;\n            }\n            while ($xoff < $xlim) {\n                $this->xchanged[$this->xind[$xoff++]] = 1;\n            }\n        } else {\n            /* Use the partitions to split this problem into subproblems. */\n            reset($seps);\n            $pt1 = $seps[0];\n            while ($pt2 = next($seps)) {\n                $this->_compareseq ($pt1[0], $pt2[0], $pt1[1], $pt2[1]);\n                $pt1 = $pt2;\n            }\n        }\n    }\n\n    /**\n     * Adjusts inserts/deletes of identical lines to join changes as much as\n     * possible.\n     *\n     * We do something when a run of changed lines include a line at one end\n     * and has an excluded, identical line at the other.  We are free to\n     * choose which identical line is included.  `compareseq' usually chooses\n     * the one at the beginning, but usually it is cleaner to consider the\n     * following identical line to be the \"change\".\n     *\n     * This is extracted verbatim from analyze.c (GNU diffutils-2.7).\n     */\n    function _shiftBoundaries($lines, &$changed, $other_changed)\n    {\n        $i = 0;\n        $j = 0;\n\n        assert(count($lines) == count($changed));\n        $len = count($lines);\n        $other_len = count($other_changed);\n\n        while (1) {\n            /* Scan forward to find the beginning of another run of\n             * changes. Also keep track of the corresponding point in the\n             * other file.\n             *\n             * Throughout this code, $i and $j are adjusted together so that\n             * the first $i elements of $changed and the first $j elements of\n             * $other_changed both contain the same number of zeros (unchanged\n             * lines).\n             *\n             * Furthermore, $j is always kept so that $j == $other_len or\n             * $other_changed[$j] == false. */\n            while ($j < $other_len && $other_changed[$j]) {\n                $j++;\n            }\n\n            while ($i < $len && ! $changed[$i]) {\n                assert($j < $other_len && ! $other_changed[$j]);\n                $i++; $j++;\n                while ($j < $other_len && $other_changed[$j]) {\n                    $j++;\n                }\n            }\n\n            if ($i == $len) {\n                break;\n            }\n\n            $start = $i;\n\n            /* Find the end of this run of changes. */\n            while (++$i < $len && $changed[$i]) {\n                continue;\n            }\n\n            do {\n                /* Record the length of this run of changes, so that we can\n                 * later determine whether the run has grown. */\n                $runlength = $i - $start;\n\n                /* Move the changed region back, so long as the previous\n                 * unchanged line matches the last changed one.  This merges\n                 * with previous changed regions. */\n                while ($start > 0 && $lines[$start - 1] == $lines[$i - 1]) {\n                    $changed[--$start] = 1;\n                    $changed[--$i] = false;\n                    while ($start > 0 && $changed[$start - 1]) {\n                        $start--;\n                    }\n                    assert($j > 0);\n                    while ($other_changed[--$j]) {\n                        continue;\n                    }\n                    assert($j >= 0 && !$other_changed[$j]);\n                }\n\n                /* Set CORRESPONDING to the end of the changed run, at the\n                 * last point where it corresponds to a changed run in the\n                 * other file. CORRESPONDING == LEN means no such point has\n                 * been found. */\n                $corresponding = $j < $other_len ? $i : $len;\n\n                /* Move the changed region forward, so long as the first\n                 * changed line matches the following unchanged one.  This\n                 * merges with following changed regions.  Do this second, so\n                 * that if there are no merges, the changed region is moved\n                 * forward as far as possible. */\n                while ($i < $len && $lines[$start] == $lines[$i]) {\n                    $changed[$start++] = false;\n                    $changed[$i++] = 1;\n                    while ($i < $len && $changed[$i]) {\n                        $i++;\n                    }\n\n                    assert($j < $other_len && ! $other_changed[$j]);\n                    $j++;\n                    if ($j < $other_len && $other_changed[$j]) {\n                        $corresponding = $i;\n                        while ($j < $other_len && $other_changed[$j]) {\n                            $j++;\n                        }\n                    }\n                }\n            } while ($runlength != $i - $start);\n\n            /* If possible, move the fully-merged run of changes back to a\n             * corresponding run in the other file. */\n            while ($corresponding < $i) {\n                $changed[--$start] = 1;\n                $changed[--$i] = 0;\n                assert($j > 0);\n                while ($other_changed[--$j]) {\n                    continue;\n                }\n                assert($j >= 0 && !$other_changed[$j]);\n            }\n        }\n    }\n\n}\n", "num_lines": 439}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Class used internally by Diff to actually compute the diffs.\n *\n * This class uses the Unix `diff` program via shell_exec to compute the\n * differences between the two input arrays.\n *\n * Copyright 2007-2010 The Horde Project (http://www.horde.org/)\n *\n * See the enclosed file COPYING for license information (LGPL). If you did\n * not receive this file, see http://opensource.org/licenses/lgpl-license.php.\n *\n * @author  Milian Wolff <mail@milianw.de>\n * @package Text_Diff\n * @since   0.3.0\n */\nclass Text_Diff_Engine_shell {\n\n    /**\n     * Path to the diff executable\n     *\n     * @var string\n     */\n    var $_diffCommand = 'diff';\n\n    /**\n     * Returns the array of differences.\n     *\n     * @param array $from_lines lines of text from old file\n     * @param array $to_lines   lines of text from new file\n     *\n     * @return array all changes made (array with Text_Diff_Op_* objects)\n     */\n    function diff($from_lines, $to_lines)\n    {\n        array_walk($from_lines, array('Text_Diff', 'trimNewlines'));\n        array_walk($to_lines, array('Text_Diff', 'trimNewlines'));\n\n        $temp_dir = Text_Diff::_getTempDir();\n\n        // Execute gnu diff or similar to get a standard diff file.\n        $from_file = tempnam($temp_dir, 'Text_Diff');\n        $to_file = tempnam($temp_dir, 'Text_Diff');\n        $fp = fopen($from_file, 'w');\n        fwrite($fp, implode(\"\\n\", $from_lines));\n        fclose($fp);\n        $fp = fopen($to_file, 'w');\n        fwrite($fp, implode(\"\\n\", $to_lines));\n        fclose($fp);\n        $diff = shell_exec($this->_diffCommand . ' ' . $from_file . ' ' . $to_file);\n        unlink($from_file);\n        unlink($to_file);\n\n        if (is_null($diff)) {\n            // No changes were made\n            return array(new Text_Diff_Op_copy($from_lines));\n        }\n\n        $from_line_no = 1;\n        $to_line_no = 1;\n        $edits = array();\n\n        // Get changed lines by parsing something like:\n        // 0a1,2\n        // 1,2c4,6\n        // 1,5d6\n        preg_match_all('#^(\\d+)(?:,(\\d+))?([adc])(\\d+)(?:,(\\d+))?$#m', $diff,\n            $matches, PREG_SET_ORDER);\n\n        foreach ($matches as $match) {\n            if (!isset($match[5])) {\n                // This paren is not set every time (see regex).\n                $match[5] = false;\n            }\n\n            if ($match[3] == 'a') {\n                $from_line_no--;\n            }\n\n            if ($match[3] == 'd') {\n                $to_line_no--;\n            }\n\n            if ($from_line_no < $match[1] || $to_line_no < $match[4]) {\n                // copied lines\n                assert($match[1] - $from_line_no == $match[4] - $to_line_no);\n                array_push($edits,\n                    new Text_Diff_Op_copy(\n                        $this->_getLines($from_lines, $from_line_no, $match[1] - 1),\n                        $this->_getLines($to_lines, $to_line_no, $match[4] - 1)));\n            }\n\n            switch ($match[3]) {\n            case 'd':\n                // deleted lines\n                array_push($edits,\n                    new Text_Diff_Op_delete(\n                        $this->_getLines($from_lines, $from_line_no, $match[2])));\n                $to_line_no++;\n                break;\n\n            case 'c':\n                // changed lines\n                array_push($edits,\n                    new Text_Diff_Op_change(\n                        $this->_getLines($from_lines, $from_line_no, $match[2]),\n                        $this->_getLines($to_lines, $to_line_no, $match[5])));\n                break;\n\n            case 'a':\n                // added lines\n                array_push($edits,\n                    new Text_Diff_Op_add(\n                        $this->_getLines($to_lines, $to_line_no, $match[5])));\n                $from_line_no++;\n                break;\n            }\n        }\n\n        if (!empty($from_lines)) {\n            // Some lines might still be pending. Add them as copied\n            array_push($edits,\n                new Text_Diff_Op_copy(\n                    $this->_getLines($from_lines, $from_line_no,\n                                     $from_line_no + count($from_lines) - 1),\n                    $this->_getLines($to_lines, $to_line_no,\n                                     $to_line_no + count($to_lines) - 1)));\n        }\n\n        return $edits;\n    }\n\n    /**\n     * Get lines from either the old or new text\n     *\n     * @access private\n     *\n     * @param array $text_lines Either $from_lines or $to_lines (passed by reference).\n     * @param int   $line_no    Current line number (passed by reference).\n     * @param int   $end        Optional end line, when we want to chop more\n     *                          than one line.\n     *\n     * @return array The chopped lines\n     */\n    function _getLines(&$text_lines, &$line_no, $end = false)\n    {\n        if (!empty($end)) {\n            $lines = array();\n            // We can shift even more\n            while ($line_no <= $end) {\n                array_push($lines, array_shift($text_lines));\n                $line_no++;\n            }\n        } else {\n            $lines = array(array_shift($text_lines));\n            $line_no++;\n        }\n\n        return $lines;\n    }\n\n}\n", "num_lines": 163}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Parses unified or context diffs output from eg. the diff utility.\n *\n * Example:\n * <code>\n * $patch = file_get_contents('example.patch');\n * $diff = new Text_Diff('string', array($patch));\n * $renderer = new Text_Diff_Renderer_inline();\n * echo $renderer->render($diff);\n * </code>\n *\n * Copyright 2005 \u00c3\u2013rjan Persson <o@42mm.org>\n * Copyright 2005-2010 The Horde Project (http://www.horde.org/)\n *\n * See the enclosed file COPYING for license information (LGPL). If you did\n * not receive this file, see http://opensource.org/licenses/lgpl-license.php.\n *\n * @author  \u00c3\u2013rjan Persson <o@42mm.org>\n * @package Text_Diff\n * @since   0.2.0\n */\nclass Text_Diff_Engine_string {\n\n    /**\n     * Parses a unified or context diff.\n     *\n     * First param contains the whole diff and the second can be used to force\n     * a specific diff type. If the second parameter is 'autodetect', the\n     * diff will be examined to find out which type of diff this is.\n     *\n     * @param string $diff  The diff content.\n     * @param string $mode  The diff mode of the content in $diff. One of\n     *                      'context', 'unified', or 'autodetect'.\n     *\n     * @return array  List of all diff operations.\n     */\n    function diff($diff, $mode = 'autodetect')\n    {\n        // Detect line breaks.\n        $lnbr = \"\\n\";\n        if (strpos($diff, \"\\r\\n\") !== false) {\n            $lnbr = \"\\r\\n\";\n        } elseif (strpos($diff, \"\\r\") !== false) {\n            $lnbr = \"\\r\";\n        }\n\n        // Make sure we have a line break at the EOF.\n        if (substr($diff, -strlen($lnbr)) != $lnbr) {\n            $diff .= $lnbr;\n        }\n\n        if ($mode != 'autodetect' && $mode != 'context' && $mode != 'unified') {\n            return PEAR::raiseError('Type of diff is unsupported');\n        }\n\n        if ($mode == 'autodetect') {\n            $context = strpos($diff, '***');\n            $unified = strpos($diff, '---');\n            if ($context === $unified) {\n                return PEAR::raiseError('Type of diff could not be detected');\n            } elseif ($context === false || $unified === false) {\n                $mode = $context !== false ? 'context' : 'unified';\n            } else {\n                $mode = $context < $unified ? 'context' : 'unified';\n            }\n        }\n\n        // Split by new line and remove the diff header, if there is one.\n        $diff = explode($lnbr, $diff);\n        if (($mode == 'context' && strpos($diff[0], '***') === 0) ||\n            ($mode == 'unified' && strpos($diff[0], '---') === 0)) {\n            array_shift($diff);\n            array_shift($diff);\n        }\n\n        if ($mode == 'context') {\n            return $this->parseContextDiff($diff);\n        } else {\n            return $this->parseUnifiedDiff($diff);\n        }\n    }\n\n    /**\n     * Parses an array containing the unified diff.\n     *\n     * @param array $diff  Array of lines.\n     *\n     * @return array  List of all diff operations.\n     */\n    function parseUnifiedDiff($diff)\n    {\n        $edits = array();\n        $end = count($diff) - 1;\n        for ($i = 0; $i < $end;) {\n            $diff1 = array();\n            switch (substr($diff[$i], 0, 1)) {\n            case ' ':\n                do {\n                    $diff1[] = substr($diff[$i], 1);\n                } while (++$i < $end && substr($diff[$i], 0, 1) == ' ');\n                $edits[] = new Text_Diff_Op_copy($diff1);\n                break;\n\n            case '+':\n                // get all new lines\n                do {\n                    $diff1[] = substr($diff[$i], 1);\n                } while (++$i < $end && substr($diff[$i], 0, 1) == '+');\n                $edits[] = new Text_Diff_Op_add($diff1);\n                break;\n\n            case '-':\n                // get changed or removed lines\n                $diff2 = array();\n                do {\n                    $diff1[] = substr($diff[$i], 1);\n                } while (++$i < $end && substr($diff[$i], 0, 1) == '-');\n\n                while ($i < $end && substr($diff[$i], 0, 1) == '+') {\n                    $diff2[] = substr($diff[$i++], 1);\n                }\n                if (count($diff2) == 0) {\n                    $edits[] = new Text_Diff_Op_delete($diff1);\n                } else {\n                    $edits[] = new Text_Diff_Op_change($diff1, $diff2);\n                }\n                break;\n\n            default:\n                $i++;\n                break;\n            }\n        }\n\n        return $edits;\n    }\n\n    /**\n     * Parses an array containing the context diff.\n     *\n     * @param array $diff  Array of lines.\n     *\n     * @return array  List of all diff operations.\n     */\n    function parseContextDiff(&$diff)\n    {\n        $edits = array();\n        $i = $max_i = $j = $max_j = 0;\n        $end = count($diff) - 1;\n        while ($i < $end && $j < $end) {\n            while ($i >= $max_i && $j >= $max_j) {\n                // Find the boundaries of the diff output of the two files\n                for ($i = $j;\n                     $i < $end && substr($diff[$i], 0, 3) == '***';\n                     $i++);\n                for ($max_i = $i;\n                     $max_i < $end && substr($diff[$max_i], 0, 3) != '---';\n                     $max_i++);\n                for ($j = $max_i;\n                     $j < $end && substr($diff[$j], 0, 3) == '---';\n                     $j++);\n                for ($max_j = $j;\n                     $max_j < $end && substr($diff[$max_j], 0, 3) != '***';\n                     $max_j++);\n            }\n\n            // find what hasn't been changed\n            $array = array();\n            while ($i < $max_i &&\n                   $j < $max_j &&\n                   strcmp($diff[$i], $diff[$j]) == 0) {\n                $array[] = substr($diff[$i], 2);\n                $i++;\n                $j++;\n            }\n\n            while ($i < $max_i && ($max_j-$j) <= 1) {\n                if ($diff[$i] != '' && substr($diff[$i], 0, 1) != ' ') {\n                    break;\n                }\n                $array[] = substr($diff[$i++], 2);\n            }\n\n            while ($j < $max_j && ($max_i-$i) <= 1) {\n                if ($diff[$j] != '' && substr($diff[$j], 0, 1) != ' ') {\n                    break;\n                }\n                $array[] = substr($diff[$j++], 2);\n            }\n            if (count($array) > 0) {\n                $edits[] = new Text_Diff_Op_copy($array);\n            }\n\n            if ($i < $max_i) {\n                $diff1 = array();\n                switch (substr($diff[$i], 0, 1)) {\n                case '!':\n                    $diff2 = array();\n                    do {\n                        $diff1[] = substr($diff[$i], 2);\n                        if ($j < $max_j && substr($diff[$j], 0, 1) == '!') {\n                            $diff2[] = substr($diff[$j++], 2);\n                        }\n                    } while (++$i < $max_i && substr($diff[$i], 0, 1) == '!');\n                    $edits[] = new Text_Diff_Op_change($diff1, $diff2);\n                    break;\n\n                case '+':\n                    do {\n                        $diff1[] = substr($diff[$i], 2);\n                    } while (++$i < $max_i && substr($diff[$i], 0, 1) == '+');\n                    $edits[] = new Text_Diff_Op_add($diff1);\n                    break;\n\n                case '-':\n                    do {\n                        $diff1[] = substr($diff[$i], 2);\n                    } while (++$i < $max_i && substr($diff[$i], 0, 1) == '-');\n                    $edits[] = new Text_Diff_Op_delete($diff1);\n                    break;\n                }\n            }\n\n            if ($j < $max_j) {\n                $diff2 = array();\n                switch (substr($diff[$j], 0, 1)) {\n                case '+':\n                    do {\n                        $diff2[] = substr($diff[$j++], 2);\n                    } while ($j < $max_j && substr($diff[$j], 0, 1) == '+');\n                    $edits[] = new Text_Diff_Op_add($diff2);\n                    break;\n\n                case '-':\n                    do {\n                        $diff2[] = substr($diff[$j++], 2);\n                    } while ($j < $max_j && substr($diff[$j], 0, 1) == '-');\n                    $edits[] = new Text_Diff_Op_delete($diff2);\n                    break;\n                }\n            }\n        }\n\n        return $edits;\n    }\n\n}\n", "num_lines": 249}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Class used internally by Diff to actually compute the diffs.\n *\n * This class uses the xdiff PECL package (http://pecl.php.net/package/xdiff)\n * to compute the differences between the two input arrays.\n *\n * Copyright 2004-2010 The Horde Project (http://www.horde.org/)\n *\n * See the enclosed file COPYING for license information (LGPL). If you did\n * not receive this file, see http://opensource.org/licenses/lgpl-license.php.\n *\n * @author  Jon Parise <jon@horde.org>\n * @package Text_Diff\n */\nclass Text_Diff_Engine_xdiff {\n\n    /**\n     */\n    function diff($from_lines, $to_lines)\n    {\n        array_walk($from_lines, array('Text_Diff', 'trimNewlines'));\n        array_walk($to_lines, array('Text_Diff', 'trimNewlines'));\n\n        /* Convert the two input arrays into strings for xdiff processing. */\n        $from_string = implode(\"\\n\", $from_lines);\n        $to_string = implode(\"\\n\", $to_lines);\n\n        /* Diff the two strings and convert the result to an array. */\n        $diff = xdiff_string_diff($from_string, $to_string, count($to_lines));\n        $diff = explode(\"\\n\", $diff);\n\n        /* Walk through the diff one line at a time.  We build the $edits\n         * array of diff operations by reading the first character of the\n         * xdiff output (which is in the \"unified diff\" format).\n         *\n         * Note that we don't have enough information to detect \"changed\"\n         * lines using this approach, so we can't add Text_Diff_Op_changed\n         * instances to the $edits array.  The result is still perfectly\n         * valid, albeit a little less descriptive and efficient. */\n        $edits = array();\n        foreach ($diff as $line) {\n            if (!strlen($line)) {\n                continue;\n            }\n            switch ($line[0]) {\n            case ' ':\n                $edits[] = new Text_Diff_Op_copy(array(substr($line, 1)));\n                break;\n\n            case '+':\n                $edits[] = new Text_Diff_Op_add(array(substr($line, 1)));\n                break;\n\n            case '-':\n                $edits[] = new Text_Diff_Op_delete(array(substr($line, 1)));\n                break;\n            }\n        }\n\n        return $edits;\n    }\n\n}\n", "num_lines": 65}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * \"Inline\" diff renderer.\n *\n * Copyright 2004-2010 The Horde Project (http://www.horde.org/)\n *\n * See the enclosed file COPYING for license information (LGPL). If you did\n * not receive this file, see http://opensource.org/licenses/lgpl-license.php.\n *\n * @author  Ciprian Popovici\n * @package Text_Diff\n */\n\n/** Text_Diff_Renderer */\n\n// WP #7391\nrequire_once dirname(dirname(__FILE__)) . '/Renderer.php';\n\n/**\n * \"Inline\" diff renderer.\n *\n * This class renders diffs in the Wiki-style \"inline\" format.\n *\n * @author  Ciprian Popovici\n * @package Text_Diff\n */\nclass Text_Diff_Renderer_inline extends Text_Diff_Renderer {\n\n    /**\n     * Number of leading context \"lines\" to preserve.\n     *\n     * @var integer\n     */\n    var $_leading_context_lines = 10000;\n\n    /**\n     * Number of trailing context \"lines\" to preserve.\n     *\n     * @var integer\n     */\n    var $_trailing_context_lines = 10000;\n\n    /**\n     * Prefix for inserted text.\n     *\n     * @var string\n     */\n    var $_ins_prefix = '<ins>';\n\n    /**\n     * Suffix for inserted text.\n     *\n     * @var string\n     */\n    var $_ins_suffix = '</ins>';\n\n    /**\n     * Prefix for deleted text.\n     *\n     * @var string\n     */\n    var $_del_prefix = '<del>';\n\n    /**\n     * Suffix for deleted text.\n     *\n     * @var string\n     */\n    var $_del_suffix = '</del>';\n\n    /**\n     * Header for each change block.\n     *\n     * @var string\n     */\n    var $_block_header = '';\n\n    /**\n     * Whether to split down to character-level.\n     *\n     * @var boolean\n     */\n    var $_split_characters = false;\n\n    /**\n     * What are we currently splitting on? Used to recurse to show word-level\n     * or character-level changes.\n     *\n     * @var string\n     */\n    var $_split_level = 'lines';\n\n    function _blockHeader($xbeg, $xlen, $ybeg, $ylen)\n    {\n        return $this->_block_header;\n    }\n\n    function _startBlock($header)\n    {\n        return $header;\n    }\n\n    function _lines($lines, $prefix = ' ', $encode = true)\n    {\n        if ($encode) {\n            array_walk($lines, array(&$this, '_encode'));\n        }\n\n        if ($this->_split_level == 'lines') {\n            return implode(\"\\n\", $lines) . \"\\n\";\n        } else {\n            return implode('', $lines);\n        }\n    }\n\n    function _added($lines)\n    {\n        array_walk($lines, array(&$this, '_encode'));\n        $lines[0] = $this->_ins_prefix . $lines[0];\n        $lines[count($lines) - 1] .= $this->_ins_suffix;\n        return $this->_lines($lines, ' ', false);\n    }\n\n    function _deleted($lines, $words = false)\n    {\n        array_walk($lines, array(&$this, '_encode'));\n        $lines[0] = $this->_del_prefix . $lines[0];\n        $lines[count($lines) - 1] .= $this->_del_suffix;\n        return $this->_lines($lines, ' ', false);\n    }\n\n    function _changed($orig, $final)\n    {\n        /* If we've already split on characters, just display. */\n        if ($this->_split_level == 'characters') {\n            return $this->_deleted($orig)\n                . $this->_added($final);\n        }\n\n        /* If we've already split on words, just display. */\n        if ($this->_split_level == 'words') {\n            $prefix = '';\n            while ($orig[0] !== false && $final[0] !== false &&\n                   substr($orig[0], 0, 1) == ' ' &&\n                   substr($final[0], 0, 1) == ' ') {\n                $prefix .= substr($orig[0], 0, 1);\n                $orig[0] = substr($orig[0], 1);\n                $final[0] = substr($final[0], 1);\n            }\n            return $prefix . $this->_deleted($orig) . $this->_added($final);\n        }\n\n        $text1 = implode(\"\\n\", $orig);\n        $text2 = implode(\"\\n\", $final);\n\n        /* Non-printing newline marker. */\n        $nl = \"\\0\";\n\n        if ($this->_split_characters) {\n            $diff = new Text_Diff('native',\n                                  array(preg_split('//', $text1),\n                                        preg_split('//', $text2)));\n        } else {\n            /* We want to split on word boundaries, but we need to preserve\n             * whitespace as well. Therefore we split on words, but include\n             * all blocks of whitespace in the wordlist. */\n            $diff = new Text_Diff('native',\n                                  array($this->_splitOnWords($text1, $nl),\n                                        $this->_splitOnWords($text2, $nl)));\n        }\n\n        /* Get the diff in inline format. */\n        $renderer = new Text_Diff_Renderer_inline\n            (array_merge($this->getParams(),\n                         array('split_level' => $this->_split_characters ? 'characters' : 'words')));\n\n        /* Run the diff and get the output. */\n        return str_replace($nl, \"\\n\", $renderer->render($diff)) . \"\\n\";\n    }\n\n    function _splitOnWords($string, $newlineEscape = \"\\n\")\n    {\n        // Ignore \\0; otherwise the while loop will never finish.\n        $string = str_replace(\"\\0\", '', $string);\n\n        $words = array();\n        $length = strlen($string);\n        $pos = 0;\n\n        while ($pos < $length) {\n            // Eat a word with any preceding whitespace.\n            $spaces = strspn(substr($string, $pos), \" \\n\");\n            $nextpos = strcspn(substr($string, $pos + $spaces), \" \\n\");\n            $words[] = str_replace(\"\\n\", $newlineEscape, substr($string, $pos, $spaces + $nextpos));\n            $pos += $spaces + $nextpos;\n        }\n\n        return $words;\n    }\n\n    function _encode(&$string)\n    {\n        $string = htmlspecialchars($string);\n    }\n\n}\n", "num_lines": 207}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * @package WordPress\n * @subpackage Theme_Compat\n * @deprecated 3.0.0\n *\n * This file is here for backward compatibility with old themes and will be removed in a future version\n */\n_deprecated_file(\n\t/* translators: %s: Template name. */\n\tsprintf( __( 'Theme without %s' ), basename( __FILE__ ) ),\n\t'3.0.0',\n\tnull,\n\t/* translators: %s: Template name. */\n\tsprintf( __( 'Please include a %s template in your theme.' ), basename( __FILE__ ) )\n);\n\n// Do not delete these lines.\nif ( ! empty( $_SERVER['SCRIPT_FILENAME'] ) && 'comments.php' === basename( $_SERVER['SCRIPT_FILENAME'] ) ) {\n\tdie( 'Please do not load this page directly. Thanks!' );\n}\n\nif ( post_password_required() ) { ?>\n\t\t<p class=\"nocomments\"><?php _e( 'This post is password protected. Enter the password to view comments.' ); ?></p>\n\t<?php\n\treturn;\n}\n?>\n\n<!-- You can start editing here. -->\n\n<?php if ( have_comments() ) : ?>\n\t<h3 id=\"comments\">\n\t\t<?php\n\t\tif ( 1 == get_comments_number() ) {\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t__( 'One response to %s' ),\n\t\t\t\t'&#8220;' . get_the_title() . '&#8221;'\n\t\t\t);\n\t\t} else {\n\t\t\tprintf(\n\t\t\t\t/* translators: 1: Number of comments, 2: Post title. */\n\t\t\t\t_n( '%1$s response to %2$s', '%1$s responses to %2$s', get_comments_number() ),\n\t\t\t\tnumber_format_i18n( get_comments_number() ),\n\t\t\t\t'&#8220;' . get_the_title() . '&#8221;'\n\t\t\t);\n\t\t}\n\t\t?>\n\t</h3>\n\n\t<div class=\"navigation\">\n\t\t<div class=\"alignleft\"><?php previous_comments_link(); ?></div>\n\t\t<div class=\"alignright\"><?php next_comments_link(); ?></div>\n\t</div>\n\n\t<ol class=\"commentlist\">\n\t<?php wp_list_comments(); ?>\n\t</ol>\n\n\t<div class=\"navigation\">\n\t\t<div class=\"alignleft\"><?php previous_comments_link(); ?></div>\n\t\t<div class=\"alignright\"><?php next_comments_link(); ?></div>\n\t</div>\n<?php else : // This is displayed if there are no comments so far. ?>\n\n\t<?php if ( comments_open() ) : ?>\n\t\t<!-- If comments are open, but there are no comments. -->\n\n\t<?php else : // Comments are closed. ?>\n\t\t<!-- If comments are closed. -->\n\t\t<p class=\"nocomments\"><?php _e( 'Comments are closed.' ); ?></p>\n\n\t<?php endif; ?>\n<?php endif; ?>\n\n<?php comment_form(); ?>\n", "num_lines": 78}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Contains the post embed content template part\n *\n * When a post is embedded in an iframe, this file is used to create the content template part\n * output if the active theme does not include an embed-404.php template.\n *\n * @package WordPress\n * @subpackage Theme_Compat\n * @since 4.5.0\n */\n?>\n<div class=\"wp-embed\">\n\t<p class=\"wp-embed-heading\"><?php _e( 'Oops! That embed can&#8217;t be found.' ); ?></p>\n\n\t<div class=\"wp-embed-excerpt\">\n\t\t<p>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: A link to the embedded site. */\n\t\t\t\t__( 'It looks like nothing was found at this location. Maybe try visiting %s directly?' ),\n\t\t\t\t'<strong><a href=\"' . esc_url( home_url() ) . '\">' . esc_html( get_bloginfo( 'name' ) ) . '</a></strong>'\n\t\t\t);\n\t\t\t?>\n\t\t</p>\n\t</div>\n\n\t<?php\n\t/** This filter is documented in wp-includes/theme-compat/embed-content.php */\n\tdo_action( 'embed_content' );\n\t?>\n\n\t<div class=\"wp-embed-footer\">\n\t\t<?php the_embed_site_title(); ?>\n\t</div>\n</div>\n", "num_lines": 37}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Contains the post embed content template part\n *\n * When a post is embedded in an iframe, this file is used to create the content template part\n * output if the active theme does not include an embed-content.php template.\n *\n * @package WordPress\n * @subpackage Theme_Compat\n * @since 4.5.0\n */\n?>\n\t<div <?php post_class( 'wp-embed' ); ?>>\n\t\t<?php\n\t\t$thumbnail_id = 0;\n\n\t\tif ( has_post_thumbnail() ) {\n\t\t\t$thumbnail_id = get_post_thumbnail_id();\n\t\t}\n\n\t\tif ( 'attachment' === get_post_type() && wp_attachment_is_image() ) {\n\t\t\t$thumbnail_id = get_the_ID();\n\t\t}\n\n\t\t/**\n\t\t * Filters the thumbnail image ID for use in the embed template.\n\t\t *\n\t\t * @since 4.9.0\n\t\t *\n\t\t * @param int $thumbnail_id Attachment ID.\n\t\t */\n\t\t$thumbnail_id = apply_filters( 'embed_thumbnail_id', $thumbnail_id );\n\n\t\tif ( $thumbnail_id ) {\n\t\t\t$aspect_ratio = 1;\n\t\t\t$measurements = array( 1, 1 );\n\t\t\t$image_size   = 'full'; // Fallback.\n\n\t\t\t$meta = wp_get_attachment_metadata( $thumbnail_id );\n\t\t\tif ( ! empty( $meta['sizes'] ) ) {\n\t\t\t\tforeach ( $meta['sizes'] as $size => $data ) {\n\t\t\t\t\tif ( $data['height'] > 0 && $data['width'] / $data['height'] > $aspect_ratio ) {\n\t\t\t\t\t\t$aspect_ratio = $data['width'] / $data['height'];\n\t\t\t\t\t\t$measurements = array( $data['width'], $data['height'] );\n\t\t\t\t\t\t$image_size   = $size;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the thumbnail image size for use in the embed template.\n\t\t\t *\n\t\t\t * @since 4.4.0\n\t\t\t * @since 4.5.0 Added `$thumbnail_id` parameter.\n\t\t\t *\n\t\t\t * @param string $image_size   Thumbnail image size.\n\t\t\t * @param int    $thumbnail_id Attachment ID.\n\t\t\t */\n\t\t\t$image_size = apply_filters( 'embed_thumbnail_image_size', $image_size, $thumbnail_id );\n\n\t\t\t$shape = $measurements[0] / $measurements[1] >= 1.75 ? 'rectangular' : 'square';\n\n\t\t\t/**\n\t\t\t * Filters the thumbnail shape for use in the embed template.\n\t\t\t *\n\t\t\t * Rectangular images are shown above the title while square images\n\t\t\t * are shown next to the content.\n\t\t\t *\n\t\t\t * @since 4.4.0\n\t\t\t * @since 4.5.0 Added `$thumbnail_id` parameter.\n\t\t\t *\n\t\t\t * @param string $shape        Thumbnail image shape. Either 'rectangular' or 'square'.\n\t\t\t * @param int    $thumbnail_id Attachment ID.\n\t\t\t */\n\t\t\t$shape = apply_filters( 'embed_thumbnail_image_shape', $shape, $thumbnail_id );\n\t\t}\n\n\t\tif ( $thumbnail_id && 'rectangular' === $shape ) :\n\t\t\t?>\n\t\t\t<div class=\"wp-embed-featured-image rectangular\">\n\t\t\t\t<a href=\"<?php the_permalink(); ?>\" target=\"_top\">\n\t\t\t\t\t<?php echo wp_get_attachment_image( $thumbnail_id, $image_size ); ?>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t<?php endif; ?>\n\n\t\t<p class=\"wp-embed-heading\">\n\t\t\t<a href=\"<?php the_permalink(); ?>\" target=\"_top\">\n\t\t\t\t<?php the_title(); ?>\n\t\t\t</a>\n\t\t</p>\n\n\t\t<?php if ( $thumbnail_id && 'square' === $shape ) : ?>\n\t\t\t<div class=\"wp-embed-featured-image square\">\n\t\t\t\t<a href=\"<?php the_permalink(); ?>\" target=\"_top\">\n\t\t\t\t\t<?php echo wp_get_attachment_image( $thumbnail_id, $image_size ); ?>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t<?php endif; ?>\n\n\t\t<div class=\"wp-embed-excerpt\"><?php the_excerpt_embed(); ?></div>\n\n\t\t<?php\n\t\t/**\n\t\t * Prints additional content after the embed excerpt.\n\t\t *\n\t\t * @since 4.4.0\n\t\t */\n\t\tdo_action( 'embed_content' );\n\t\t?>\n\n\t\t<div class=\"wp-embed-footer\">\n\t\t\t<?php the_embed_site_title(); ?>\n\n\t\t\t<div class=\"wp-embed-meta\">\n\t\t\t\t<?php\n\t\t\t\t/**\n\t\t\t\t * Prints additional meta content in the embed template.\n\t\t\t\t *\n\t\t\t\t * @since 4.4.0\n\t\t\t\t */\n\t\t\t\tdo_action( 'embed_content_meta' );\n\t\t\t\t?>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n<?php\n", "num_lines": 128}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Contains the post embed base template\n *\n * When a post is embedded in an iframe, this file is used to create the output\n * if the active theme does not include an embed.php template.\n *\n * @package WordPress\n * @subpackage oEmbed\n * @since 4.4.0\n */\n\nget_header( 'embed' );\n\nif ( have_posts() ) :\n\twhile ( have_posts() ) :\n\t\tthe_post();\n\t\tget_template_part( 'embed', 'content' );\n\tendwhile;\nelse :\n\tget_template_part( 'embed', '404' );\nendif;\n\nget_footer( 'embed' );\n", "num_lines": 25}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Contains the post embed footer template\n *\n * When a post is embedded in an iframe, this file is used to create the footer output\n * if the active theme does not include a footer-embed.php template.\n *\n * @package WordPress\n * @subpackage Theme_Compat\n * @since 4.5.0\n */\n\n/**\n * Prints scripts or data before the closing body tag in the embed template.\n *\n * @since 4.4.0\n */\ndo_action( 'embed_footer' );\n?>\n</body>\n</html>\n", "num_lines": 22}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * @package WordPress\n * @subpackage Theme_Compat\n * @deprecated 3.0.0\n *\n * This file is here for backward compatibility with old themes and will be removed in a future version\n */\n_deprecated_file(\n\t/* translators: %s: Template name. */\n\tsprintf( __( 'Theme without %s' ), basename( __FILE__ ) ),\n\t'3.0.0',\n\tnull,\n\t/* translators: %s: Template name. */\n\tsprintf( __( 'Please include a %s template in your theme.' ), basename( __FILE__ ) )\n);\n?>\n\n<hr />\n<div id=\"footer\" role=\"contentinfo\">\n<!-- If you'd like to support WordPress, having the \"powered by\" link somewhere on your blog is the best way; it's our only promotion or advertising. -->\n\t<p>\n\t\t<?php\n\t\tprintf(\n\t\t\t/* translators: 1: Blog name, 2: WordPress */\n\t\t\t__( '%1$s is proudly powered by %2$s' ),\n\t\t\tget_bloginfo( 'name' ),\n\t\t\t'<a href=\"https://wordpress.org/\">WordPress</a>'\n\t\t);\n\t\t?>\n\t</p>\n</div>\n</div>\n\n<!-- Gorgeous design by Michael Heilemann - http://binarybonsai.com/ -->\n<?php /* \"Just what do you think you're doing Dave?\" */ ?>\n\n\t\t<?php wp_footer(); ?>\n</body>\n</html>\n", "num_lines": 41}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Contains the post embed header template\n *\n * When a post is embedded in an iframe, this file is used to create the header output\n * if the active theme does not include a header-embed.php template.\n *\n * @package WordPress\n * @subpackage Theme_Compat\n * @since 4.5.0\n */\n\nif ( ! headers_sent() ) {\n\theader( 'X-WP-embed: true' );\n}\n\n?>\n<!DOCTYPE html>\n<html <?php language_attributes(); ?> class=\"no-js\">\n<head>\n\t<title><?php echo wp_get_document_title(); ?></title>\n\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n\t<?php\n\t/**\n\t * Prints scripts or data in the embed template head tag.\n\t *\n\t * @since 4.4.0\n\t */\n\tdo_action( 'embed_head' );\n\t?>\n</head>\n<body <?php body_class(); ?>>\n", "num_lines": 33}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * @package WordPress\n * @subpackage Theme_Compat\n * @deprecated 3.0.0\n *\n * This file is here for backward compatibility with old themes and will be removed in a future version.\n */\n_deprecated_file(\n\t/* translators: %s: Template name. */\n\tsprintf( __( 'Theme without %s' ), basename( __FILE__ ) ),\n\t'3.0.0',\n\tnull,\n\t/* translators: %s: Template name. */\n\tsprintf( __( 'Please include a %s template in your theme.' ), basename( __FILE__ ) )\n);\n?>\n<!DOCTYPE html>\n<html <?php language_attributes(); ?>>\n<head>\n<link rel=\"profile\" href=\"https://gmpg.org/xfn/11\" />\n<meta http-equiv=\"Content-Type\" content=\"<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>\" />\n\n<title><?php echo wp_get_document_title(); ?></title>\n\n<link rel=\"stylesheet\" href=\"<?php bloginfo( 'stylesheet_url' ); ?>\" type=\"text/css\" media=\"screen\" />\n<link rel=\"pingback\" href=\"<?php bloginfo( 'pingback_url' ); ?>\" />\n\n<?php if ( file_exists( get_stylesheet_directory() . '/images/kubrickbgwide.jpg' ) ) { ?>\n<style type=\"text/css\" media=\"screen\">\n\n\t<?php\n\t// Checks to see whether it needs a sidebar.\n\tif ( empty( $withcomments ) && ! is_single() ) {\n\t\t?>\n\t#page { background: url(\"<?php bloginfo( 'stylesheet_directory' ); ?>/images/kubrickbg-<?php bloginfo( 'text_direction' ); ?>.jpg\") repeat-y top; border: none; }\n<?php } else { // No sidebar. ?>\n\t#page { background: url(\"<?php bloginfo( 'stylesheet_directory' ); ?>/images/kubrickbgwide.jpg\") repeat-y top; border: none; }\n<?php } ?>\n\n</style>\n<?php } ?>\n\n<?php\nif ( is_singular() ) {\n\twp_enqueue_script( 'comment-reply' );}\n?>\n\n<?php wp_head(); ?>\n</head>\n<body <?php body_class(); ?>>\n<div id=\"page\">\n\n<div id=\"header\" role=\"banner\">\n\t<div id=\"headerimg\">\n\t\t<h1><a href=\"<?php echo home_url(); ?>/\"><?php bloginfo( 'name' ); ?></a></h1>\n\t\t<div class=\"description\"><?php bloginfo( 'description' ); ?></div>\n\t</div>\n</div>\n<hr />\n", "num_lines": 61}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * @package WordPress\n * @subpackage Theme_Compat\n * @deprecated 3.0.0\n *\n * This file is here for backward compatibility with old themes and will be removed in a future version.\n */\n_deprecated_file(\n\t/* translators: %s: Template name. */\n\tsprintf( __( 'Theme without %s' ), basename( __FILE__ ) ),\n\t'3.0.0',\n\tnull,\n\t/* translators: %s: Template name. */\n\tsprintf( __( 'Please include a %s template in your theme.' ), basename( __FILE__ ) )\n);\n?>\n\t<div id=\"sidebar\" role=\"complementary\">\n\t\t<ul>\n\t\t\t<?php\n\t\t\t/* Widgetized sidebar, if you have the plugin installed. */\n\t\t\tif ( ! function_exists( 'dynamic_sidebar' ) || ! dynamic_sidebar() ) :\n\t\t\t\t?>\n\t\t\t<li>\n\t\t\t\t<?php get_search_form(); ?>\n\t\t\t</li>\n\n\t\t\t<!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it.\n\t\t\t<li><h2><?php _e( 'Author' ); ?></h2>\n\t\t\t<p>A little something about you, the author. Nothing lengthy, just an overview.</p>\n\t\t\t</li>\n\t\t\t-->\n\n\t\t\t\t<?php\n\t\t\t\tif ( is_404() || is_category() || is_day() || is_month() ||\n\t\t\t\tis_year() || is_search() || is_paged() ) :\n\t\t\t\t\t?>\n\t\t\t<li>\n\n\t\t\t\t\t<?php if ( is_404() ) : /* If this is a 404 page */ ?>\n\t\t\t<?php elseif ( is_category() ) : /* If this is a category archive */ ?>\n\t\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Category name. */\n\t\t\t\t\t\t__( 'You are currently browsing the archives for the %s category.' ),\n\t\t\t\t\t\tsingle_cat_title( '', false )\n\t\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t</p>\n\n\t\t\t<?php elseif ( is_day() ) : /* If this is a daily archive */ ?>\n\t\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: Site link, 2: Archive date. */\n\t\t\t\t\t\t__( 'You are currently browsing the %1$s blog archives for the day %2$s.' ),\n\t\t\t\t\t\tsprintf( '<a href=\"%1$s/\">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),\n\t\t\t\t\t\tget_the_time( __( 'l, F jS, Y' ) )\n\t\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t</p>\n\n\t\t\t<?php elseif ( is_month() ) : /* If this is a monthly archive */ ?>\n\t\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: Site link, 2: Archive month. */\n\t\t\t\t\t\t__( 'You are currently browsing the %1$s blog archives for %2$s.' ),\n\t\t\t\t\t\tsprintf( '<a href=\"%1$s/\">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),\n\t\t\t\t\t\tget_the_time( __( 'F, Y' ) )\n\t\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t</p>\n\n\t\t\t<?php elseif ( is_year() ) : /* If this is a yearly archive */ ?>\n\t\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: Site link, 2: Archive year. */\n\t\t\t\t\t\t__( 'You are currently browsing the %1$s blog archives for the year %2$s.' ),\n\t\t\t\t\t\tsprintf( '<a href=\"%1$s/\">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),\n\t\t\t\t\t\tget_the_time( 'Y' )\n\t\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t</p>\n\n\t\t\t<?php elseif ( is_search() ) : /* If this is a search result */ ?>\n\t\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: 1: Site link, 2: Search query. */\n\t\t\t\t\t\t__( 'You have searched the %1$s blog archives for <strong>&#8216;%2$s&#8217;</strong>. If you are unable to find anything in these search results, you can try one of these links.' ),\n\t\t\t\t\t\tsprintf( '<a href=\"%1$s/\">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),\n\t\t\t\t\t\tesc_html( get_search_query() )\n\t\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t</p>\n\n\t\t\t<?php elseif ( isset( $_GET['paged'] ) && ! empty( $_GET['paged'] ) ) : /* If this set is paginated */ ?>\n\t\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\t\tprintf(\n\t\t\t\t\t\t/* translators: %s: Site link. */\n\t\t\t\t\t\t__( 'You are currently browsing the %s blog archives.' ),\n\t\t\t\t\t\tsprintf( '<a href=\"%1$s/\">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) )\n\t\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t</p>\n\n\t\t\t<?php endif; ?>\n\n\t\t\t</li>\n\t\t\t<?php endif; ?>\n\t\t</ul>\n\t\t<ul role=\"navigation\">\n\t\t\t\t<?php wp_list_pages( 'title_li=<h2>' . __( 'Pages' ) . '</h2>' ); ?>\n\n\t\t\t<li><h2><?php _e( 'Archives' ); ?></h2>\n\t\t\t\t<ul>\n\t\t\t\t<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>\n\t\t\t\t</ul>\n\t\t\t</li>\n\n\t\t\t\t<?php\n\t\t\t\twp_list_categories(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'show_count' => 1,\n\t\t\t\t\t\t'title_li'   => '<h2>' . __( 'Categories' ) . '</h2>',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t?>\n\t\t</ul>\n\t\t<ul>\n\t\t\t\t<?php if ( is_home() || is_page() ) { /* If this is the frontpage */ ?>\n\t\t\t\t\t<?php wp_list_bookmarks(); ?>\n\n\t\t\t\t<li><h2><?php _e( 'Meta' ); ?></h2>\n\t\t\t\t<ul>\n\t\t\t\t\t<?php wp_register(); ?>\n\t\t\t\t\t<li><?php wp_loginout(); ?></li>\n\t\t\t\t\t<?php wp_meta(); ?>\n\t\t\t\t</ul>\n\t\t\t\t</li>\n\t\t\t<?php } ?>\n\n\t\t\t<?php endif; /* ! dynamic_sidebar() */ ?>\n\t\t</ul>\n\t</div>\n", "num_lines": 150}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Nav_Menu_Widget class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement the Navigation Menu widget.\n *\n * @since 3.0.0\n *\n * @see WP_Widget\n */\nclass WP_Nav_Menu_Widget extends WP_Widget {\n\n\t/**\n\t * Sets up a new Navigation Menu widget instance.\n\t *\n\t * @since 3.0.0\n\t */\n\tpublic function __construct() {\n\t\t$widget_ops = array(\n\t\t\t'description'                 => __( 'Add a navigation menu to your sidebar.' ),\n\t\t\t'customize_selective_refresh' => true,\n\t\t);\n\t\tparent::__construct( 'nav_menu', __( 'Navigation Menu' ), $widget_ops );\n\t}\n\n\t/**\n\t * Outputs the content for the current Navigation Menu widget instance.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param array $args     Display arguments including 'before_title', 'after_title',\n\t *                        'before_widget', and 'after_widget'.\n\t * @param array $instance Settings for the current Navigation Menu widget instance.\n\t */\n\tpublic function widget( $args, $instance ) {\n\t\t// Get menu.\n\t\t$nav_menu = ! empty( $instance['nav_menu'] ) ? wp_get_nav_menu_object( $instance['nav_menu'] ) : false;\n\n\t\tif ( ! $nav_menu ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$default_title = __( 'Menu' );\n\t\t$title         = ! empty( $instance['title'] ) ? $instance['title'] : '';\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */\n\t\t$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );\n\n\t\techo $args['before_widget'];\n\n\t\tif ( $title ) {\n\t\t\techo $args['before_title'] . $title . $args['after_title'];\n\t\t}\n\n\t\t$format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';\n\n\t\t/**\n\t\t * Filters the HTML format of widgets with navigation links.\n\t\t *\n\t\t * @since 5.5.0\n\t\t *\n\t\t * @param string $format The type of markup to use in widgets with navigation links.\n\t\t *                       Accepts 'html5', 'xhtml'.\n\t\t */\n\t\t$format = apply_filters( 'navigation_widgets_format', $format );\n\n\t\tif ( 'html5' === $format ) {\n\t\t\t// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.\n\t\t\t$title      = trim( strip_tags( $title ) );\n\t\t\t$aria_label = $title ? $title : $default_title;\n\n\t\t\t$nav_menu_args = array(\n\t\t\t\t'fallback_cb'          => '',\n\t\t\t\t'menu'                 => $nav_menu,\n\t\t\t\t'container'            => 'nav',\n\t\t\t\t'container_aria_label' => $aria_label,\n\t\t\t\t'items_wrap'           => '<ul id=\"%1$s\" class=\"%2$s\">%3$s</ul>',\n\t\t\t);\n\t\t} else {\n\t\t\t$nav_menu_args = array(\n\t\t\t\t'fallback_cb' => '',\n\t\t\t\t'menu'        => $nav_menu,\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Filters the arguments for the Navigation Menu widget.\n\t\t *\n\t\t * @since 4.2.0\n\t\t * @since 4.4.0 Added the `$instance` parameter.\n\t\t *\n\t\t * @param array   $nav_menu_args {\n\t\t *     An array of arguments passed to wp_nav_menu() to retrieve a navigation menu.\n\t\t *\n\t\t *     @type callable|bool $fallback_cb Callback to fire if the menu doesn't exist. Default empty.\n\t\t *     @type mixed         $menu        Menu ID, slug, or name.\n\t\t * }\n\t\t * @param WP_Term $nav_menu      Nav menu object for the current menu.\n\t\t * @param array   $args          Display arguments for the current widget.\n\t\t * @param array   $instance      Array of settings for the current widget.\n\t\t */\n\t\twp_nav_menu( apply_filters( 'widget_nav_menu_args', $nav_menu_args, $nav_menu, $args, $instance ) );\n\n\t\techo $args['after_widget'];\n\t}\n\n\t/**\n\t * Handles updating settings for the current Navigation Menu widget instance.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param array $new_instance New settings for this instance as input by the user via\n\t *                            WP_Widget::form().\n\t * @param array $old_instance Old settings for this instance.\n\t * @return array Updated settings to save.\n\t */\n\tpublic function update( $new_instance, $old_instance ) {\n\t\t$instance = array();\n\t\tif ( ! empty( $new_instance['title'] ) ) {\n\t\t\t$instance['title'] = sanitize_text_field( $new_instance['title'] );\n\t\t}\n\t\tif ( ! empty( $new_instance['nav_menu'] ) ) {\n\t\t\t$instance['nav_menu'] = (int) $new_instance['nav_menu'];\n\t\t}\n\t\treturn $instance;\n\t}\n\n\t/**\n\t * Outputs the settings form for the Navigation Menu widget.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param array $instance Current settings.\n\t * @global WP_Customize_Manager $wp_customize\n\t */\n\tpublic function form( $instance ) {\n\t\tglobal $wp_customize;\n\t\t$title    = isset( $instance['title'] ) ? $instance['title'] : '';\n\t\t$nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : '';\n\n\t\t// Get menus.\n\t\t$menus = wp_get_nav_menus();\n\n\t\t$empty_menus_style     = '';\n\t\t$not_empty_menus_style = '';\n\t\tif ( empty( $menus ) ) {\n\t\t\t$empty_menus_style = ' style=\"display:none\" ';\n\t\t} else {\n\t\t\t$not_empty_menus_style = ' style=\"display:none\" ';\n\t\t}\n\n\t\t$nav_menu_style = '';\n\t\tif ( ! $nav_menu ) {\n\t\t\t$nav_menu_style = 'display: none;';\n\t\t}\n\n\t\t// If no menus exists, direct the user to go and create some.\n\t\t?>\n\t\t<p class=\"nav-menu-widget-no-menus-message\" <?php echo $not_empty_menus_style; ?>>\n\t\t\t<?php\n\t\t\tif ( $wp_customize instanceof WP_Customize_Manager ) {\n\t\t\t\t$url = 'javascript: wp.customize.panel( \"nav_menus\" ).focus();';\n\t\t\t} else {\n\t\t\t\t$url = admin_url( 'nav-menus.php' );\n\t\t\t}\n\n\t\t\t/* translators: %s: URL to create a new menu. */\n\t\t\tprintf( __( 'No menus have been created yet. <a href=\"%s\">Create some</a>.' ), esc_attr( $url ) );\n\t\t\t?>\n\t\t</p>\n\t\t<div class=\"nav-menu-widget-form-controls\" <?php echo $empty_menus_style; ?>>\n\t\t\t<p>\n\t\t\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e( 'Title:' ); ?></label>\n\t\t\t\t<input type=\"text\" class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" value=\"<?php echo esc_attr( $title ); ?>\"/>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<label for=\"<?php echo $this->get_field_id( 'nav_menu' ); ?>\"><?php _e( 'Select Menu:' ); ?></label>\n\t\t\t\t<select id=\"<?php echo $this->get_field_id( 'nav_menu' ); ?>\" name=\"<?php echo $this->get_field_name( 'nav_menu' ); ?>\">\n\t\t\t\t\t<option value=\"0\"><?php _e( '&mdash; Select &mdash;' ); ?></option>\n\t\t\t\t\t<?php foreach ( $menus as $menu ) : ?>\n\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $menu->term_id ); ?>\" <?php selected( $nav_menu, $menu->term_id ); ?>>\n\t\t\t\t\t\t\t<?php echo esc_html( $menu->name ); ?>\n\t\t\t\t\t\t</option>\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t</select>\n\t\t\t</p>\n\t\t\t<?php if ( $wp_customize instanceof WP_Customize_Manager ) : ?>\n\t\t\t\t<p class=\"edit-selected-nav-menu\" style=\"<?php echo $nav_menu_style; ?>\">\n\t\t\t\t\t<button type=\"button\" class=\"button\"><?php _e( 'Edit Menu' ); ?></button>\n\t\t\t\t</p>\n\t\t\t<?php endif; ?>\n\t\t</div>\n\t\t<?php\n\t}\n}\n", "num_lines": 202}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Archives class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement the Archives widget.\n *\n * @since 2.8.0\n *\n * @see WP_Widget\n */\nclass WP_Widget_Archives extends WP_Widget {\n\n\t/**\n\t * Sets up a new Archives widget instance.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'                   => 'widget_archive',\n\t\t\t'description'                 => __( 'A monthly archive of your site&#8217;s Posts.' ),\n\t\t\t'customize_selective_refresh' => true,\n\t\t);\n\t\tparent::__construct( 'archives', __( 'Archives' ), $widget_ops );\n\t}\n\n\t/**\n\t * Outputs the content for the current Archives widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $args     Display arguments including 'before_title', 'after_title',\n\t *                        'before_widget', and 'after_widget'.\n\t * @param array $instance Settings for the current Archives widget instance.\n\t */\n\tpublic function widget( $args, $instance ) {\n\t\t$default_title = __( 'Archives' );\n\t\t$title         = ! empty( $instance['title'] ) ? $instance['title'] : $default_title;\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */\n\t\t$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );\n\n\t\t$count    = ! empty( $instance['count'] ) ? '1' : '0';\n\t\t$dropdown = ! empty( $instance['dropdown'] ) ? '1' : '0';\n\n\t\techo $args['before_widget'];\n\n\t\tif ( $title ) {\n\t\t\techo $args['before_title'] . $title . $args['after_title'];\n\t\t}\n\n\t\tif ( $dropdown ) {\n\t\t\t$dropdown_id = \"{$this->id_base}-dropdown-{$this->number}\";\n\t\t\t?>\n\t\t<label class=\"screen-reader-text\" for=\"<?php echo esc_attr( $dropdown_id ); ?>\"><?php echo $title; ?></label>\n\t\t<select id=\"<?php echo esc_attr( $dropdown_id ); ?>\" name=\"archive-dropdown\">\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * Filters the arguments for the Archives widget drop-down.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t * @since 4.9.0 Added the `$instance` parameter.\n\t\t\t *\n\t\t\t * @see wp_get_archives()\n\t\t\t *\n\t\t\t * @param array $args     An array of Archives widget drop-down arguments.\n\t\t\t * @param array $instance Settings for the current Archives widget instance.\n\t\t\t */\n\t\t\t$dropdown_args = apply_filters(\n\t\t\t\t'widget_archives_dropdown_args',\n\t\t\t\tarray(\n\t\t\t\t\t'type'            => 'monthly',\n\t\t\t\t\t'format'          => 'option',\n\t\t\t\t\t'show_post_count' => $count,\n\t\t\t\t),\n\t\t\t\t$instance\n\t\t\t);\n\n\t\t\tswitch ( $dropdown_args['type'] ) {\n\t\t\t\tcase 'yearly':\n\t\t\t\t\t$label = __( 'Select Year' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'monthly':\n\t\t\t\t\t$label = __( 'Select Month' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'daily':\n\t\t\t\t\t$label = __( 'Select Day' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'weekly':\n\t\t\t\t\t$label = __( 'Select Week' );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$label = __( 'Select Post' );\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$type_attr = current_theme_supports( 'html5', 'script' ) ? '' : ' type=\"text/javascript\"';\n\t\t\t?>\n\n\t\t\t<option value=\"\"><?php echo esc_attr( $label ); ?></option>\n\t\t\t<?php wp_get_archives( $dropdown_args ); ?>\n\n\t\t</select>\n\n<script<?php echo $type_attr; ?>>\n/* <![CDATA[ */\n(function() {\n\tvar dropdown = document.getElementById( \"<?php echo esc_js( $dropdown_id ); ?>\" );\n\tfunction onSelectChange() {\n\t\tif ( dropdown.options[ dropdown.selectedIndex ].value !== '' ) {\n\t\t\tdocument.location.href = this.options[ this.selectedIndex ].value;\n\t\t}\n\t}\n\tdropdown.onchange = onSelectChange;\n})();\n/* ]]> */\n</script>\n\t\t\t<?php\n\t\t} else {\n\t\t\t$format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';\n\n\t\t\t/** This filter is documented in wp-includes/widgets/class-wp-nav-menu-widget.php */\n\t\t\t$format = apply_filters( 'navigation_widgets_format', $format );\n\n\t\t\tif ( 'html5' === $format ) {\n\t\t\t\t// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.\n\t\t\t\t$title      = trim( strip_tags( $title ) );\n\t\t\t\t$aria_label = $title ? $title : $default_title;\n\t\t\t\techo '<nav role=\"navigation\" aria-label=\"' . esc_attr( $aria_label ) . '\">';\n\t\t\t}\n\t\t\t?>\n\n\t\t\t<ul>\n\t\t\t\t<?php\n\t\t\t\twp_get_archives(\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters the arguments for the Archives widget.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 2.8.0\n\t\t\t\t\t * @since 4.9.0 Added the `$instance` parameter.\n\t\t\t\t\t *\n\t\t\t\t\t * @see wp_get_archives()\n\t\t\t\t\t *\n\t\t\t\t\t * @param array $args     An array of Archives option arguments.\n\t\t\t\t\t * @param array $instance Array of settings for the current widget.\n\t\t\t\t\t */\n\t\t\t\t\tapply_filters(\n\t\t\t\t\t\t'widget_archives_args',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'type'            => 'monthly',\n\t\t\t\t\t\t\t'show_post_count' => $count,\n\t\t\t\t\t\t),\n\t\t\t\t\t\t$instance\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</ul>\n\n\t\t\t<?php\n\t\t\tif ( 'html5' === $format ) {\n\t\t\t\techo '</nav>';\n\t\t\t}\n\t\t}\n\n\t\techo $args['after_widget'];\n\t}\n\n\t/**\n\t * Handles updating settings for the current Archives widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $new_instance New settings for this instance as input by the user via\n\t *                            WP_Widget_Archives::form().\n\t * @param array $old_instance Old settings for this instance.\n\t * @return array Updated settings to save.\n\t */\n\tpublic function update( $new_instance, $old_instance ) {\n\t\t$instance             = $old_instance;\n\t\t$new_instance         = wp_parse_args(\n\t\t\t(array) $new_instance,\n\t\t\tarray(\n\t\t\t\t'title'    => '',\n\t\t\t\t'count'    => 0,\n\t\t\t\t'dropdown' => '',\n\t\t\t)\n\t\t);\n\t\t$instance['title']    = sanitize_text_field( $new_instance['title'] );\n\t\t$instance['count']    = $new_instance['count'] ? 1 : 0;\n\t\t$instance['dropdown'] = $new_instance['dropdown'] ? 1 : 0;\n\n\t\treturn $instance;\n\t}\n\n\t/**\n\t * Outputs the settings form for the Archives widget.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $instance Current settings.\n\t */\n\tpublic function form( $instance ) {\n\t\t$instance = wp_parse_args(\n\t\t\t(array) $instance,\n\t\t\tarray(\n\t\t\t\t'title'    => '',\n\t\t\t\t'count'    => 0,\n\t\t\t\t'dropdown' => '',\n\t\t\t)\n\t\t);\n\t\t?>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e( 'Title:' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $instance['title'] ); ?>\" />\n\t\t</p>\n\t\t<p>\n\t\t\t<input class=\"checkbox\" type=\"checkbox\"<?php checked( $instance['dropdown'] ); ?> id=\"<?php echo $this->get_field_id( 'dropdown' ); ?>\" name=\"<?php echo $this->get_field_name( 'dropdown' ); ?>\" />\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'dropdown' ); ?>\"><?php _e( 'Display as dropdown' ); ?></label>\n\t\t\t<br/>\n\t\t\t<input class=\"checkbox\" type=\"checkbox\"<?php checked( $instance['count'] ); ?> id=\"<?php echo $this->get_field_id( 'count' ); ?>\" name=\"<?php echo $this->get_field_name( 'count' ); ?>\" />\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'count' ); ?>\"><?php _e( 'Show post counts' ); ?></label>\n\t\t</p>\n\t\t<?php\n\t}\n}\n", "num_lines": 232}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Calendar class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement the Calendar widget.\n *\n * @since 2.8.0\n *\n * @see WP_Widget\n */\nclass WP_Widget_Calendar extends WP_Widget {\n\t/**\n\t * Ensure that the ID attribute only appears in the markup once\n\t *\n\t * @since 4.4.0\n\t * @var int\n\t */\n\tprivate static $instance = 0;\n\n\t/**\n\t * Sets up a new Calendar widget instance.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'                   => 'widget_calendar',\n\t\t\t'description'                 => __( 'A calendar of your site\u00e2\u20ac\u2122s posts.' ),\n\t\t\t'customize_selective_refresh' => true,\n\t\t);\n\t\tparent::__construct( 'calendar', __( 'Calendar' ), $widget_ops );\n\t}\n\n\t/**\n\t * Outputs the content for the current Calendar widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $args     Display arguments including 'before_title', 'after_title',\n\t *                        'before_widget', and 'after_widget'.\n\t * @param array $instance The settings for the particular instance of the widget.\n\t */\n\tpublic function widget( $args, $instance ) {\n\t\t$title = ! empty( $instance['title'] ) ? $instance['title'] : '';\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */\n\t\t$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );\n\n\t\techo $args['before_widget'];\n\t\tif ( $title ) {\n\t\t\techo $args['before_title'] . $title . $args['after_title'];\n\t\t}\n\t\tif ( 0 === self::$instance ) {\n\t\t\techo '<div id=\"calendar_wrap\" class=\"calendar_wrap\">';\n\t\t} else {\n\t\t\techo '<div class=\"calendar_wrap\">';\n\t\t}\n\t\tget_calendar();\n\t\techo '</div>';\n\t\techo $args['after_widget'];\n\n\t\tself::$instance++;\n\t}\n\n\t/**\n\t * Handles updating settings for the current Calendar widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $new_instance New settings for this instance as input by the user via\n\t *                            WP_Widget::form().\n\t * @param array $old_instance Old settings for this instance.\n\t * @return array Updated settings to save.\n\t */\n\tpublic function update( $new_instance, $old_instance ) {\n\t\t$instance          = $old_instance;\n\t\t$instance['title'] = sanitize_text_field( $new_instance['title'] );\n\n\t\treturn $instance;\n\t}\n\n\t/**\n\t * Outputs the settings form for the Calendar widget.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $instance Current settings.\n\t */\n\tpublic function form( $instance ) {\n\t\t$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );\n\t\t?>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e( 'Title:' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $instance['title'] ); ?>\" />\n\t\t</p>\n\t\t<?php\n\t}\n}\n", "num_lines": 105}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Categories class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement a Categories widget.\n *\n * @since 2.8.0\n *\n * @see WP_Widget\n */\nclass WP_Widget_Categories extends WP_Widget {\n\n\t/**\n\t * Sets up a new Categories widget instance.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'                   => 'widget_categories',\n\t\t\t'description'                 => __( 'A list or dropdown of categories.' ),\n\t\t\t'customize_selective_refresh' => true,\n\t\t);\n\t\tparent::__construct( 'categories', __( 'Categories' ), $widget_ops );\n\t}\n\n\t/**\n\t * Outputs the content for the current Categories widget instance.\n\t *\n\t * @since 2.8.0\n\t * @since 4.2.0 Creates a unique HTML ID for the `<select>` element\n\t *              if more than one instance is displayed on the page.\n\t *\n\t * @param array $args     Display arguments including 'before_title', 'after_title',\n\t *                        'before_widget', and 'after_widget'.\n\t * @param array $instance Settings for the current Categories widget instance.\n\t */\n\tpublic function widget( $args, $instance ) {\n\t\tstatic $first_dropdown = true;\n\n\t\t$default_title = __( 'Categories' );\n\t\t$title         = ! empty( $instance['title'] ) ? $instance['title'] : $default_title;\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */\n\t\t$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );\n\n\t\t$count        = ! empty( $instance['count'] ) ? '1' : '0';\n\t\t$hierarchical = ! empty( $instance['hierarchical'] ) ? '1' : '0';\n\t\t$dropdown     = ! empty( $instance['dropdown'] ) ? '1' : '0';\n\n\t\techo $args['before_widget'];\n\n\t\tif ( $title ) {\n\t\t\techo $args['before_title'] . $title . $args['after_title'];\n\t\t}\n\n\t\t$cat_args = array(\n\t\t\t'orderby'      => 'name',\n\t\t\t'show_count'   => $count,\n\t\t\t'hierarchical' => $hierarchical,\n\t\t);\n\n\t\tif ( $dropdown ) {\n\t\t\tprintf( '<form action=\"%s\" method=\"get\">', esc_url( home_url() ) );\n\t\t\t$dropdown_id    = ( $first_dropdown ) ? 'cat' : \"{$this->id_base}-dropdown-{$this->number}\";\n\t\t\t$first_dropdown = false;\n\n\t\t\techo '<label class=\"screen-reader-text\" for=\"' . esc_attr( $dropdown_id ) . '\">' . $title . '</label>';\n\n\t\t\t$cat_args['show_option_none'] = __( 'Select Category' );\n\t\t\t$cat_args['id']               = $dropdown_id;\n\n\t\t\t/**\n\t\t\t * Filters the arguments for the Categories widget drop-down.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t * @since 4.9.0 Added the `$instance` parameter.\n\t\t\t *\n\t\t\t * @see wp_dropdown_categories()\n\t\t\t *\n\t\t\t * @param array $cat_args An array of Categories widget drop-down arguments.\n\t\t\t * @param array $instance Array of settings for the current widget.\n\t\t\t */\n\t\t\twp_dropdown_categories( apply_filters( 'widget_categories_dropdown_args', $cat_args, $instance ) );\n\n\t\t\techo '</form>';\n\n\t\t\t$type_attr = current_theme_supports( 'html5', 'script' ) ? '' : ' type=\"text/javascript\"';\n\t\t\t?>\n\n<script<?php echo $type_attr; ?>>\n/* <![CDATA[ */\n(function() {\n\tvar dropdown = document.getElementById( \"<?php echo esc_js( $dropdown_id ); ?>\" );\n\tfunction onCatChange() {\n\t\tif ( dropdown.options[ dropdown.selectedIndex ].value > 0 ) {\n\t\t\tdropdown.parentNode.submit();\n\t\t}\n\t}\n\tdropdown.onchange = onCatChange;\n})();\n/* ]]> */\n</script>\n\n\t\t\t<?php\n\t\t} else {\n\t\t\t$format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';\n\n\t\t\t/** This filter is documented in wp-includes/widgets/class-wp-nav-menu-widget.php */\n\t\t\t$format = apply_filters( 'navigation_widgets_format', $format );\n\n\t\t\tif ( 'html5' === $format ) {\n\t\t\t\t// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.\n\t\t\t\t$title      = trim( strip_tags( $title ) );\n\t\t\t\t$aria_label = $title ? $title : $default_title;\n\t\t\t\techo '<nav role=\"navigation\" aria-label=\"' . esc_attr( $aria_label ) . '\">';\n\t\t\t}\n\t\t\t?>\n\n\t\t\t<ul>\n\t\t\t\t<?php\n\t\t\t\t$cat_args['title_li'] = '';\n\n\t\t\t\t/**\n\t\t\t\t * Filters the arguments for the Categories widget.\n\t\t\t\t *\n\t\t\t\t * @since 2.8.0\n\t\t\t\t * @since 4.9.0 Added the `$instance` parameter.\n\t\t\t\t *\n\t\t\t\t * @param array $cat_args An array of Categories widget options.\n\t\t\t\t * @param array $instance Array of settings for the current widget.\n\t\t\t\t */\n\t\t\t\twp_list_categories( apply_filters( 'widget_categories_args', $cat_args, $instance ) );\n\t\t\t\t?>\n\t\t\t</ul>\n\n\t\t\t<?php\n\t\t\tif ( 'html5' === $format ) {\n\t\t\t\techo '</nav>';\n\t\t\t}\n\t\t}\n\n\t\techo $args['after_widget'];\n\t}\n\n\t/**\n\t * Handles updating settings for the current Categories widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $new_instance New settings for this instance as input by the user via\n\t *                            WP_Widget::form().\n\t * @param array $old_instance Old settings for this instance.\n\t * @return array Updated settings to save.\n\t */\n\tpublic function update( $new_instance, $old_instance ) {\n\t\t$instance                 = $old_instance;\n\t\t$instance['title']        = sanitize_text_field( $new_instance['title'] );\n\t\t$instance['count']        = ! empty( $new_instance['count'] ) ? 1 : 0;\n\t\t$instance['hierarchical'] = ! empty( $new_instance['hierarchical'] ) ? 1 : 0;\n\t\t$instance['dropdown']     = ! empty( $new_instance['dropdown'] ) ? 1 : 0;\n\n\t\treturn $instance;\n\t}\n\n\t/**\n\t * Outputs the settings form for the Categories widget.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $instance Current settings.\n\t */\n\tpublic function form( $instance ) {\n\t\t// Defaults.\n\t\t$instance     = wp_parse_args( (array) $instance, array( 'title' => '' ) );\n\t\t$count        = isset( $instance['count'] ) ? (bool) $instance['count'] : false;\n\t\t$hierarchical = isset( $instance['hierarchical'] ) ? (bool) $instance['hierarchical'] : false;\n\t\t$dropdown     = isset( $instance['dropdown'] ) ? (bool) $instance['dropdown'] : false;\n\t\t?>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e( 'Title:' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $instance['title'] ); ?>\" />\n\t\t</p>\n\n\t\t<p>\n\t\t\t<input type=\"checkbox\" class=\"checkbox\" id=\"<?php echo $this->get_field_id( 'dropdown' ); ?>\" name=\"<?php echo $this->get_field_name( 'dropdown' ); ?>\"<?php checked( $dropdown ); ?> />\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'dropdown' ); ?>\"><?php _e( 'Display as dropdown' ); ?></label>\n\t\t\t<br />\n\n\t\t\t<input type=\"checkbox\" class=\"checkbox\" id=\"<?php echo $this->get_field_id( 'count' ); ?>\" name=\"<?php echo $this->get_field_name( 'count' ); ?>\"<?php checked( $count ); ?> />\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'count' ); ?>\"><?php _e( 'Show post counts' ); ?></label>\n\t\t\t<br />\n\n\t\t\t<input type=\"checkbox\" class=\"checkbox\" id=\"<?php echo $this->get_field_id( 'hierarchical' ); ?>\" name=\"<?php echo $this->get_field_name( 'hierarchical' ); ?>\"<?php checked( $hierarchical ); ?> />\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'hierarchical' ); ?>\"><?php _e( 'Show hierarchy' ); ?></label>\n\t\t</p>\n\t\t<?php\n\t}\n\n}\n", "num_lines": 207}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Custom_HTML class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.8.1\n */\n\n/**\n * Core class used to implement a Custom HTML widget.\n *\n * @since 4.8.1\n *\n * @see WP_Widget\n */\nclass WP_Widget_Custom_HTML extends WP_Widget {\n\n\t/**\n\t * Whether or not the widget has been registered yet.\n\t *\n\t * @since 4.9.0\n\t * @var bool\n\t */\n\tprotected $registered = false;\n\n\t/**\n\t * Default instance.\n\t *\n\t * @since 4.8.1\n\t * @var array\n\t */\n\tprotected $default_instance = array(\n\t\t'title'   => '',\n\t\t'content' => '',\n\t);\n\n\t/**\n\t * Sets up a new Custom HTML widget instance.\n\t *\n\t * @since 4.8.1\n\t */\n\tpublic function __construct() {\n\t\t$widget_ops  = array(\n\t\t\t'classname'                   => 'widget_custom_html',\n\t\t\t'description'                 => __( 'Arbitrary HTML code.' ),\n\t\t\t'customize_selective_refresh' => true,\n\t\t);\n\t\t$control_ops = array(\n\t\t\t'width'  => 400,\n\t\t\t'height' => 350,\n\t\t);\n\t\tparent::__construct( 'custom_html', __( 'Custom HTML' ), $widget_ops, $control_ops );\n\t}\n\n\t/**\n\t * Add hooks for enqueueing assets when registering all widget instances of this widget class.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param integer $number Optional. The unique order number of this widget instance\n\t *                        compared to other instances of the same class. Default -1.\n\t */\n\tpublic function _register_one( $number = -1 ) {\n\t\tparent::_register_one( $number );\n\t\tif ( $this->registered ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->registered = true;\n\n\t\twp_add_inline_script( 'custom-html-widgets', sprintf( 'wp.customHtmlWidgets.idBases.push( %s );', wp_json_encode( $this->id_base ) ) );\n\n\t\t// Note that the widgets component in the customizer will also do\n\t\t// the 'admin_print_scripts-widgets.php' action in WP_Customize_Widgets::print_scripts().\n\t\tadd_action( 'admin_print_scripts-widgets.php', array( $this, 'enqueue_admin_scripts' ) );\n\n\t\t// Note that the widgets component in the customizer will also do\n\t\t// the 'admin_footer-widgets.php' action in WP_Customize_Widgets::print_footer_scripts().\n\t\tadd_action( 'admin_footer-widgets.php', array( 'WP_Widget_Custom_HTML', 'render_control_template_scripts' ) );\n\n\t\t// Note this action is used to ensure the help text is added to the end.\n\t\tadd_action( 'admin_head-widgets.php', array( 'WP_Widget_Custom_HTML', 'add_help_text' ) );\n\t}\n\n\t/**\n\t * Filter gallery shortcode attributes.\n\t *\n\t * Prevents all of a site's attachments from being shown in a gallery displayed on a\n\t * non-singular template where a $post context is not available.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param array $attrs Attributes.\n\t * @return array Attributes.\n\t */\n\tpublic function _filter_gallery_shortcode_attrs( $attrs ) {\n\t\tif ( ! is_singular() && empty( $attrs['id'] ) && empty( $attrs['include'] ) ) {\n\t\t\t$attrs['id'] = -1;\n\t\t}\n\t\treturn $attrs;\n\t}\n\n\t/**\n\t * Outputs the content for the current Custom HTML widget instance.\n\t *\n\t * @since 4.8.1\n\t *\n\t * @global WP_Post $post Global post object.\n\t *\n\t * @param array $args     Display arguments including 'before_title', 'after_title',\n\t *                        'before_widget', and 'after_widget'.\n\t * @param array $instance Settings for the current Custom HTML widget instance.\n\t */\n\tpublic function widget( $args, $instance ) {\n\t\tglobal $post;\n\n\t\t// Override global $post so filters (and shortcodes) apply in a consistent context.\n\t\t$original_post = $post;\n\t\tif ( is_singular() ) {\n\t\t\t// Make sure post is always the queried object on singular queries (not from another sub-query that failed to clean up the global $post).\n\t\t\t$post = get_queried_object();\n\t\t} else {\n\t\t\t// Nullify the $post global during widget rendering to prevent shortcodes from running with the unexpected context on archive queries.\n\t\t\t$post = null;\n\t\t}\n\n\t\t// Prevent dumping out all attachments from the media library.\n\t\tadd_filter( 'shortcode_atts_gallery', array( $this, '_filter_gallery_shortcode_attrs' ) );\n\n\t\t$instance = array_merge( $this->default_instance, $instance );\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */\n\t\t$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );\n\n\t\t// Prepare instance data that looks like a normal Text widget.\n\t\t$simulated_text_widget_instance = array_merge(\n\t\t\t$instance,\n\t\t\tarray(\n\t\t\t\t'text'   => isset( $instance['content'] ) ? $instance['content'] : '',\n\t\t\t\t'filter' => false, // Because wpautop is not applied.\n\t\t\t\t'visual' => false, // Because it wasn't created in TinyMCE.\n\t\t\t)\n\t\t);\n\t\tunset( $simulated_text_widget_instance['content'] ); // Was moved to 'text' prop.\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-widget-text.php */\n\t\t$content = apply_filters( 'widget_text', $instance['content'], $simulated_text_widget_instance, $this );\n\n\t\t// Adds noreferrer and noopener relationships, without duplicating values, to all HTML A elements that have a target.\n\t\t$content = wp_targeted_link_rel( $content );\n\n\t\t/**\n\t\t * Filters the content of the Custom HTML widget.\n\t\t *\n\t\t * @since 4.8.1\n\t\t *\n\t\t * @param string                $content  The widget content.\n\t\t * @param array                 $instance Array of settings for the current widget.\n\t\t * @param WP_Widget_Custom_HTML $this     Current Custom HTML widget instance.\n\t\t */\n\t\t$content = apply_filters( 'widget_custom_html_content', $content, $instance, $this );\n\n\t\t// Restore post global.\n\t\t$post = $original_post;\n\t\tremove_filter( 'shortcode_atts_gallery', array( $this, '_filter_gallery_shortcode_attrs' ) );\n\n\t\t// Inject the Text widget's container class name alongside this widget's class name for theme styling compatibility.\n\t\t$args['before_widget'] = preg_replace( '/(?<=\\sclass=[\"\\'])/', 'widget_text ', $args['before_widget'] );\n\n\t\techo $args['before_widget'];\n\t\tif ( ! empty( $title ) ) {\n\t\t\techo $args['before_title'] . $title . $args['after_title'];\n\t\t}\n\t\techo '<div class=\"textwidget custom-html-widget\">'; // The textwidget class is for theme styling compatibility.\n\t\techo $content;\n\t\techo '</div>';\n\t\techo $args['after_widget'];\n\t}\n\n\t/**\n\t * Handles updating settings for the current Custom HTML widget instance.\n\t *\n\t * @since 4.8.1\n\t *\n\t * @param array $new_instance New settings for this instance as input by the user via\n\t *                            WP_Widget::form().\n\t * @param array $old_instance Old settings for this instance.\n\t * @return array Settings to save or bool false to cancel saving.\n\t */\n\tpublic function update( $new_instance, $old_instance ) {\n\t\t$instance          = array_merge( $this->default_instance, $old_instance );\n\t\t$instance['title'] = sanitize_text_field( $new_instance['title'] );\n\t\tif ( current_user_can( 'unfiltered_html' ) ) {\n\t\t\t$instance['content'] = $new_instance['content'];\n\t\t} else {\n\t\t\t$instance['content'] = wp_kses_post( $new_instance['content'] );\n\t\t}\n\t\treturn $instance;\n\t}\n\n\t/**\n\t * Loads the required scripts and styles for the widget control.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic function enqueue_admin_scripts() {\n\t\t$settings = wp_enqueue_code_editor(\n\t\t\tarray(\n\t\t\t\t'type'       => 'text/html',\n\t\t\t\t'codemirror' => array(\n\t\t\t\t\t'indentUnit' => 2,\n\t\t\t\t\t'tabSize'    => 2,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\twp_enqueue_script( 'custom-html-widgets' );\n\t\tif ( empty( $settings ) ) {\n\t\t\t$settings = array(\n\t\t\t\t'disabled' => true,\n\t\t\t);\n\t\t}\n\t\twp_add_inline_script( 'custom-html-widgets', sprintf( 'wp.customHtmlWidgets.init( %s );', wp_json_encode( $settings ) ), 'after' );\n\n\t\t$l10n = array(\n\t\t\t'errorNotice' => array(\n\t\t\t\t/* translators: %d: Error count. */\n\t\t\t\t'singular' => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 1 ),\n\t\t\t\t/* translators: %d: Error count. */\n\t\t\t\t'plural'   => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 2 ),\n\t\t\t\t// @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.\n\t\t\t),\n\t\t);\n\t\twp_add_inline_script( 'custom-html-widgets', sprintf( 'jQuery.extend( wp.customHtmlWidgets.l10n, %s );', wp_json_encode( $l10n ) ), 'after' );\n\t}\n\n\t/**\n\t * Outputs the Custom HTML widget settings form.\n\t *\n\t * @since 4.8.1\n\t * @since 4.9.0 The form contains only hidden sync inputs. For the control UI, see `WP_Widget_Custom_HTML::render_control_template_scripts()`.\n\t *\n\t * @see WP_Widget_Custom_HTML::render_control_template_scripts()\n\t *\n\t * @param array $instance Current instance.\n\t */\n\tpublic function form( $instance ) {\n\t\t$instance = wp_parse_args( (array) $instance, $this->default_instance );\n\t\t?>\n\t\t<input id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" class=\"title sync-input\" type=\"hidden\" value=\"<?php echo esc_attr( $instance['title'] ); ?>\"/>\n\t\t<textarea id=\"<?php echo $this->get_field_id( 'content' ); ?>\" name=\"<?php echo $this->get_field_name( 'content' ); ?>\" class=\"content sync-input\" hidden><?php echo esc_textarea( $instance['content'] ); ?></textarea>\n\t\t<?php\n\t}\n\n\t/**\n\t * Render form template scripts.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic static function render_control_template_scripts() {\n\t\t?>\n\t\t<script type=\"text/html\" id=\"tmpl-widget-custom-html-control-fields\">\n\t\t\t<# var elementIdPrefix = 'el' + String( Math.random() ).replace( /\\D/g, '' ) + '_' #>\n\t\t\t<p>\n\t\t\t\t<label for=\"{{ elementIdPrefix }}title\"><?php esc_html_e( 'Title:' ); ?></label>\n\t\t\t\t<input id=\"{{ elementIdPrefix }}title\" type=\"text\" class=\"widefat title\">\n\t\t\t</p>\n\n\t\t\t<p>\n\t\t\t\t<label for=\"{{ elementIdPrefix }}content\" id=\"{{ elementIdPrefix }}content-label\"><?php esc_html_e( 'Content:' ); ?></label>\n\t\t\t\t<textarea id=\"{{ elementIdPrefix }}content\" class=\"widefat code content\" rows=\"16\" cols=\"20\"></textarea>\n\t\t\t</p>\n\n\t\t\t<?php if ( ! current_user_can( 'unfiltered_html' ) ) : ?>\n\t\t\t\t<?php\n\t\t\t\t$probably_unsafe_html = array( 'script', 'iframe', 'form', 'input', 'style' );\n\t\t\t\t$allowed_html         = wp_kses_allowed_html( 'post' );\n\t\t\t\t$disallowed_html      = array_diff( $probably_unsafe_html, array_keys( $allowed_html ) );\n\t\t\t\t?>\n\t\t\t\t<?php if ( ! empty( $disallowed_html ) ) : ?>\n\t\t\t\t\t<# if ( data.codeEditorDisabled ) { #>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<?php _e( 'Some HTML tags are not permitted, including:' ); ?>\n\t\t\t\t\t\t\t<code><?php echo join( '</code>, <code>', $disallowed_html ); ?></code>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t<# } #>\n\t\t\t\t<?php endif; ?>\n\t\t\t<?php endif; ?>\n\n\t\t\t<div class=\"code-editor-error-container\"></div>\n\t\t</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * Add help text to widgets admin screen.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic static function add_help_text() {\n\t\t$screen = get_current_screen();\n\n\t\t$content  = '<p>';\n\t\t$content .= __( 'Use the Custom HTML widget to add arbitrary HTML code to your widget areas.' );\n\t\t$content .= '</p>';\n\n\t\tif ( 'false' !== wp_get_current_user()->syntax_highlighting ) {\n\t\t\t$content .= '<p>';\n\t\t\t$content .= sprintf(\n\t\t\t\t/* translators: 1: Link to user profile, 2: Additional link attributes, 3: Accessibility text. */\n\t\t\t\t__( 'The edit field automatically highlights code syntax. You can disable this in your <a href=\"%1$s\" %2$s>user profile%3$s</a> to work in plain text mode.' ),\n\t\t\t\tesc_url( get_edit_profile_url() ),\n\t\t\t\t'class=\"external-link\" target=\"_blank\"',\n\t\t\t\tsprintf(\n\t\t\t\t\t'<span class=\"screen-reader-text\"> %s</span>',\n\t\t\t\t\t/* translators: Accessibility text. */\n\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t)\n\t\t\t);\n\t\t\t$content .= '</p>';\n\n\t\t\t$content .= '<p id=\"editor-keyboard-trap-help-1\">' . __( 'When using a keyboard to navigate:' ) . '</p>';\n\t\t\t$content .= '<ul>';\n\t\t\t$content .= '<li id=\"editor-keyboard-trap-help-2\">' . __( 'In the editing area, the Tab key enters a tab character.' ) . '</li>';\n\t\t\t$content .= '<li id=\"editor-keyboard-trap-help-3\">' . __( 'To move away from this area, press the Esc key followed by the Tab key.' ) . '</li>';\n\t\t\t$content .= '<li id=\"editor-keyboard-trap-help-4\">' . __( 'Screen reader users: when in forms mode, you may need to press the Esc key twice.' ) . '</li>';\n\t\t\t$content .= '</ul>';\n\t\t}\n\n\t\t$screen->add_help_tab(\n\t\t\tarray(\n\t\t\t\t'id'      => 'custom_html_widget',\n\t\t\t\t'title'   => __( 'Custom HTML Widget' ),\n\t\t\t\t'content' => $content,\n\t\t\t)\n\t\t);\n\t}\n}\n", "num_lines": 339}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Links class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement a Links widget.\n *\n * @since 2.8.0\n *\n * @see WP_Widget\n */\nclass WP_Widget_Links extends WP_Widget {\n\n\t/**\n\t * Sets up a new Links widget instance.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function __construct() {\n\t\t$widget_ops = array(\n\t\t\t'description'                 => __( 'Your blogroll' ),\n\t\t\t'customize_selective_refresh' => true,\n\t\t);\n\t\tparent::__construct( 'links', __( 'Links' ), $widget_ops );\n\t}\n\n\t/**\n\t * Outputs the content for the current Links widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $args     Display arguments including 'before_title', 'after_title',\n\t *                        'before_widget', and 'after_widget'.\n\t * @param array $instance Settings for the current Links widget instance.\n\t */\n\tpublic function widget( $args, $instance ) {\n\t\t$show_description = isset( $instance['description'] ) ? $instance['description'] : false;\n\t\t$show_name        = isset( $instance['name'] ) ? $instance['name'] : false;\n\t\t$show_rating      = isset( $instance['rating'] ) ? $instance['rating'] : false;\n\t\t$show_images      = isset( $instance['images'] ) ? $instance['images'] : true;\n\t\t$category         = isset( $instance['category'] ) ? $instance['category'] : false;\n\t\t$orderby          = isset( $instance['orderby'] ) ? $instance['orderby'] : 'name';\n\t\t$order            = 'rating' === $orderby ? 'DESC' : 'ASC';\n\t\t$limit            = isset( $instance['limit'] ) ? $instance['limit'] : -1;\n\n\t\t$before_widget = preg_replace( '/id=\"[^\"]*\"/', 'id=\"%id\"', $args['before_widget'] );\n\n\t\t$widget_links_args = array(\n\t\t\t'title_before'     => $args['before_title'],\n\t\t\t'title_after'      => $args['after_title'],\n\t\t\t'category_before'  => $before_widget,\n\t\t\t'category_after'   => $args['after_widget'],\n\t\t\t'show_images'      => $show_images,\n\t\t\t'show_description' => $show_description,\n\t\t\t'show_name'        => $show_name,\n\t\t\t'show_rating'      => $show_rating,\n\t\t\t'category'         => $category,\n\t\t\t'class'            => 'linkcat widget',\n\t\t\t'orderby'          => $orderby,\n\t\t\t'order'            => $order,\n\t\t\t'limit'            => $limit,\n\t\t);\n\n\t\t/**\n\t\t * Filters the arguments for the Links widget.\n\t\t *\n\t\t * @since 2.6.0\n\t\t * @since 4.4.0 Added the `$instance` parameter.\n\t\t *\n\t\t * @see wp_list_bookmarks()\n\t\t *\n\t\t * @param array $widget_links_args An array of arguments to retrieve the links list.\n\t\t * @param array $instance          The settings for the particular instance of the widget.\n\t\t */\n\t\twp_list_bookmarks( apply_filters( 'widget_links_args', $widget_links_args, $instance ) );\n\t}\n\n\t/**\n\t * Handles updating settings for the current Links widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $new_instance New settings for this instance as input by the user via\n\t *                            WP_Widget::form().\n\t * @param array $old_instance Old settings for this instance.\n\t * @return array Updated settings to save.\n\t */\n\tpublic function update( $new_instance, $old_instance ) {\n\t\t$new_instance = (array) $new_instance;\n\t\t$instance     = array(\n\t\t\t'images'      => 0,\n\t\t\t'name'        => 0,\n\t\t\t'description' => 0,\n\t\t\t'rating'      => 0,\n\t\t);\n\t\tforeach ( $instance as $field => $val ) {\n\t\t\tif ( isset( $new_instance[ $field ] ) ) {\n\t\t\t\t$instance[ $field ] = 1;\n\t\t\t}\n\t\t}\n\n\t\t$instance['orderby'] = 'name';\n\t\tif ( in_array( $new_instance['orderby'], array( 'name', 'rating', 'id', 'rand' ), true ) ) {\n\t\t\t$instance['orderby'] = $new_instance['orderby'];\n\t\t}\n\n\t\t$instance['category'] = intval( $new_instance['category'] );\n\t\t$instance['limit']    = ! empty( $new_instance['limit'] ) ? intval( $new_instance['limit'] ) : -1;\n\n\t\treturn $instance;\n\t}\n\n\t/**\n\t * Outputs the settings form for the Links widget.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $instance Current settings.\n\t */\n\tpublic function form( $instance ) {\n\n\t\t// Defaults.\n\t\t$instance  = wp_parse_args(\n\t\t\t(array) $instance,\n\t\t\tarray(\n\t\t\t\t'images'      => true,\n\t\t\t\t'name'        => true,\n\t\t\t\t'description' => false,\n\t\t\t\t'rating'      => false,\n\t\t\t\t'category'    => false,\n\t\t\t\t'orderby'     => 'name',\n\t\t\t\t'limit'       => -1,\n\t\t\t)\n\t\t);\n\t\t$link_cats = get_terms( array( 'taxonomy' => 'link_category' ) );\n\t\t$limit     = intval( $instance['limit'] );\n\t\tif ( ! $limit ) {\n\t\t\t$limit = -1;\n\t\t}\n\t\t?>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'category' ); ?>\"><?php _e( 'Select Link Category:' ); ?></label>\n\t\t\t<select class=\"widefat\" id=\"<?php echo $this->get_field_id( 'category' ); ?>\" name=\"<?php echo $this->get_field_name( 'category' ); ?>\">\n\t\t\t\t<option value=\"\"><?php _ex( 'All Links', 'links widget' ); ?></option>\n\t\t\t\t<?php foreach ( $link_cats as $link_cat ) : ?>\n\t\t\t\t\t<option value=\"<?php echo intval( $link_cat->term_id ); ?>\" <?php selected( $instance['category'], $link_cat->term_id ); ?>>\n\t\t\t\t\t\t<?php echo esc_html( $link_cat->name ); ?>\n\t\t\t\t\t</option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</select>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'orderby' ); ?>\"><?php _e( 'Sort by:' ); ?></label>\n\t\t\t<select name=\"<?php echo $this->get_field_name( 'orderby' ); ?>\" id=\"<?php echo $this->get_field_id( 'orderby' ); ?>\" class=\"widefat\">\n\t\t\t\t<option value=\"name\"<?php selected( $instance['orderby'], 'name' ); ?>><?php _e( 'Link title' ); ?></option>\n\t\t\t\t<option value=\"rating\"<?php selected( $instance['orderby'], 'rating' ); ?>><?php _e( 'Link rating' ); ?></option>\n\t\t\t\t<option value=\"id\"<?php selected( $instance['orderby'], 'id' ); ?>><?php _e( 'Link ID' ); ?></option>\n\t\t\t\t<option value=\"rand\"<?php selected( $instance['orderby'], 'rand' ); ?>><?php _ex( 'Random', 'Links widget' ); ?></option>\n\t\t\t</select>\n\t\t</p>\n\n\t\t<p>\n\t\t\t<input class=\"checkbox\" type=\"checkbox\"<?php checked( $instance['images'], true ); ?> id=\"<?php echo $this->get_field_id( 'images' ); ?>\" name=\"<?php echo $this->get_field_name( 'images' ); ?>\" />\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'images' ); ?>\"><?php _e( 'Show Link Image' ); ?></label>\n\t\t\t<br />\n\n\t\t\t<input class=\"checkbox\" type=\"checkbox\"<?php checked( $instance['name'], true ); ?> id=\"<?php echo $this->get_field_id( 'name' ); ?>\" name=\"<?php echo $this->get_field_name( 'name' ); ?>\" />\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'name' ); ?>\"><?php _e( 'Show Link Name' ); ?></label>\n\t\t\t<br />\n\n\t\t\t<input class=\"checkbox\" type=\"checkbox\"<?php checked( $instance['description'], true ); ?> id=\"<?php echo $this->get_field_id( 'description' ); ?>\" name=\"<?php echo $this->get_field_name( 'description' ); ?>\" />\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'description' ); ?>\"><?php _e( 'Show Link Description' ); ?></label>\n\t\t\t<br />\n\n\t\t\t<input class=\"checkbox\" type=\"checkbox\"<?php checked( $instance['rating'], true ); ?> id=\"<?php echo $this->get_field_id( 'rating' ); ?>\" name=\"<?php echo $this->get_field_name( 'rating' ); ?>\" />\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'rating' ); ?>\"><?php _e( 'Show Link Rating' ); ?></label>\n\t\t</p>\n\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'limit' ); ?>\"><?php _e( 'Number of links to show:' ); ?></label>\n\t\t\t<input id=\"<?php echo $this->get_field_id( 'limit' ); ?>\" name=\"<?php echo $this->get_field_name( 'limit' ); ?>\" type=\"text\" value=\"<?php echo ( -1 !== $limit ) ? intval( $limit ) : ''; ?>\" size=\"3\" />\n\t\t</p>\n\t\t<?php\n\t}\n}\n", "num_lines": 189}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Media_Audio class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.8.0\n */\n\n/**\n * Core class that implements an audio widget.\n *\n * @since 4.8.0\n *\n * @see WP_Widget_Media\n * @see WP_Widget\n */\nclass WP_Widget_Media_Audio extends WP_Widget_Media {\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic function __construct() {\n\t\tparent::__construct(\n\t\t\t'media_audio',\n\t\t\t__( 'Audio' ),\n\t\t\tarray(\n\t\t\t\t'description' => __( 'Displays an audio player.' ),\n\t\t\t\t'mime_type'   => 'audio',\n\t\t\t)\n\t\t);\n\n\t\t$this->l10n = array_merge(\n\t\t\t$this->l10n,\n\t\t\tarray(\n\t\t\t\t'no_media_selected'          => __( 'No audio selected' ),\n\t\t\t\t'add_media'                  => _x( 'Add Audio', 'label for button in the audio widget' ),\n\t\t\t\t'replace_media'              => _x( 'Replace Audio', 'label for button in the audio widget; should preferably not be longer than ~13 characters long' ),\n\t\t\t\t'edit_media'                 => _x( 'Edit Audio', 'label for button in the audio widget; should preferably not be longer than ~13 characters long' ),\n\t\t\t\t'missing_attachment'         => sprintf(\n\t\t\t\t\t/* translators: %s: URL to media library. */\n\t\t\t\t\t__( 'We can&#8217;t find that audio file. Check your <a href=\"%s\">media library</a> and make sure it wasn&#8217;t deleted.' ),\n\t\t\t\t\tesc_url( admin_url( 'upload.php' ) )\n\t\t\t\t),\n\t\t\t\t/* translators: %d: Widget count. */\n\t\t\t\t'media_library_state_multi'  => _n_noop( 'Audio Widget (%d)', 'Audio Widget (%d)' ),\n\t\t\t\t'media_library_state_single' => __( 'Audio Widget' ),\n\t\t\t\t'unsupported_file_type'      => __( 'Looks like this isn&#8217;t the correct kind of file. Please link to an audio file instead.' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Get schema for properties of a widget instance (item).\n\t *\n\t * @since 4.8.0\n\t *\n\t * @see WP_REST_Controller::get_item_schema()\n\t * @see WP_REST_Controller::get_additional_fields()\n\t * @link https://core.trac.wordpress.org/ticket/35574\n\t *\n\t * @return array Schema for properties.\n\t */\n\tpublic function get_instance_schema() {\n\t\t$schema = array(\n\t\t\t'preload' => array(\n\t\t\t\t'type'        => 'string',\n\t\t\t\t'enum'        => array( 'none', 'auto', 'metadata' ),\n\t\t\t\t'default'     => 'none',\n\t\t\t\t'description' => __( 'Preload' ),\n\t\t\t),\n\t\t\t'loop'    => array(\n\t\t\t\t'type'        => 'boolean',\n\t\t\t\t'default'     => false,\n\t\t\t\t'description' => __( 'Loop' ),\n\t\t\t),\n\t\t);\n\n\t\tforeach ( wp_get_audio_extensions() as $audio_extension ) {\n\t\t\t$schema[ $audio_extension ] = array(\n\t\t\t\t'type'        => 'string',\n\t\t\t\t'default'     => '',\n\t\t\t\t'format'      => 'uri',\n\t\t\t\t/* translators: %s: Audio extension. */\n\t\t\t\t'description' => sprintf( __( 'URL to the %s audio source file' ), $audio_extension ),\n\t\t\t);\n\t\t}\n\n\t\treturn array_merge( $schema, parent::get_instance_schema() );\n\t}\n\n\t/**\n\t * Render the media on the frontend.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param array $instance Widget instance props.\n\t */\n\tpublic function render_media( $instance ) {\n\t\t$instance   = array_merge( wp_list_pluck( $this->get_instance_schema(), 'default' ), $instance );\n\t\t$attachment = null;\n\n\t\tif ( $this->is_attachment_with_mime_type( $instance['attachment_id'], $this->widget_options['mime_type'] ) ) {\n\t\t\t$attachment = get_post( $instance['attachment_id'] );\n\t\t}\n\n\t\tif ( $attachment ) {\n\t\t\t$src = wp_get_attachment_url( $attachment->ID );\n\t\t} else {\n\t\t\t$src = $instance['url'];\n\t\t}\n\n\t\techo wp_audio_shortcode(\n\t\t\tarray_merge(\n\t\t\t\t$instance,\n\t\t\t\tcompact( 'src' )\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Enqueue preview scripts.\n\t *\n\t * These scripts normally are enqueued just-in-time when an audio shortcode is used.\n\t * In the customizer, however, widgets can be dynamically added and rendered via\n\t * selective refresh, and so it is important to unconditionally enqueue them in\n\t * case a widget does get added.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic function enqueue_preview_scripts() {\n\t\t/** This filter is documented in wp-includes/media.php */\n\t\tif ( 'mediaelement' === apply_filters( 'wp_audio_shortcode_library', 'mediaelement' ) ) {\n\t\t\twp_enqueue_style( 'wp-mediaelement' );\n\t\t\twp_enqueue_script( 'wp-mediaelement' );\n\t\t}\n\t}\n\n\t/**\n\t * Loads the required media files for the media manager and scripts for media widgets.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic function enqueue_admin_scripts() {\n\t\tparent::enqueue_admin_scripts();\n\n\t\twp_enqueue_style( 'wp-mediaelement' );\n\t\twp_enqueue_script( 'wp-mediaelement' );\n\n\t\t$handle = 'media-audio-widget';\n\t\twp_enqueue_script( $handle );\n\n\t\t$exported_schema = array();\n\t\tforeach ( $this->get_instance_schema() as $field => $field_schema ) {\n\t\t\t$exported_schema[ $field ] = wp_array_slice_assoc( $field_schema, array( 'type', 'default', 'enum', 'minimum', 'format', 'media_prop', 'should_preview_update' ) );\n\t\t}\n\t\twp_add_inline_script(\n\t\t\t$handle,\n\t\t\tsprintf(\n\t\t\t\t'wp.mediaWidgets.modelConstructors[ %s ].prototype.schema = %s;',\n\t\t\t\twp_json_encode( $this->id_base ),\n\t\t\t\twp_json_encode( $exported_schema )\n\t\t\t)\n\t\t);\n\n\t\twp_add_inline_script(\n\t\t\t$handle,\n\t\t\tsprintf(\n\t\t\t\t'\n\t\t\t\t\twp.mediaWidgets.controlConstructors[ %1$s ].prototype.mime_type = %2$s;\n\t\t\t\t\twp.mediaWidgets.controlConstructors[ %1$s ].prototype.l10n = _.extend( {}, wp.mediaWidgets.controlConstructors[ %1$s ].prototype.l10n, %3$s );\n\t\t\t\t',\n\t\t\t\twp_json_encode( $this->id_base ),\n\t\t\t\twp_json_encode( $this->widget_options['mime_type'] ),\n\t\t\t\twp_json_encode( $this->l10n )\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Render form template scripts.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic function render_control_template_scripts() {\n\t\tparent::render_control_template_scripts()\n\t\t?>\n\t\t<script type=\"text/html\" id=\"tmpl-wp-media-widget-audio-preview\">\n\t\t\t<# if ( data.error && 'missing_attachment' === data.error ) { #>\n\t\t\t\t<div class=\"notice notice-error notice-alt notice-missing-attachment\">\n\t\t\t\t\t<p><?php echo $this->l10n['missing_attachment']; ?></p>\n\t\t\t\t</div>\n\t\t\t<# } else if ( data.error ) { #>\n\t\t\t\t<div class=\"notice notice-error notice-alt\">\n\t\t\t\t\t<p><?php _e( 'Unable to preview media due to an unknown error.' ); ?></p>\n\t\t\t\t</div>\n\t\t\t<# } else if ( data.model && data.model.src ) { #>\n\t\t\t\t<?php wp_underscore_audio_template(); ?>\n\t\t\t<# } #>\n\t\t</script>\n\t\t<?php\n\t}\n}\n", "num_lines": 206}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Media_Gallery class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.9.0\n */\n\n/**\n * Core class that implements a gallery widget.\n *\n * @since 4.9.0\n *\n * @see WP_Widget_Media\n * @see WP_Widget\n */\nclass WP_Widget_Media_Gallery extends WP_Widget_Media {\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic function __construct() {\n\t\tparent::__construct(\n\t\t\t'media_gallery',\n\t\t\t__( 'Gallery' ),\n\t\t\tarray(\n\t\t\t\t'description' => __( 'Displays an image gallery.' ),\n\t\t\t\t'mime_type'   => 'image',\n\t\t\t)\n\t\t);\n\n\t\t$this->l10n = array_merge(\n\t\t\t$this->l10n,\n\t\t\tarray(\n\t\t\t\t'no_media_selected' => __( 'No images selected' ),\n\t\t\t\t'add_media'         => _x( 'Add Images', 'label for button in the gallery widget; should not be longer than ~13 characters long' ),\n\t\t\t\t'replace_media'     => '',\n\t\t\t\t'edit_media'        => _x( 'Edit Gallery', 'label for button in the gallery widget; should not be longer than ~13 characters long' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Get schema for properties of a widget instance (item).\n\t *\n\t * @since 4.9.0\n\t *\n\t * @see WP_REST_Controller::get_item_schema()\n\t * @see WP_REST_Controller::get_additional_fields()\n\t * @link https://core.trac.wordpress.org/ticket/35574\n\t *\n\t * @return array Schema for properties.\n\t */\n\tpublic function get_instance_schema() {\n\t\t$schema = array(\n\t\t\t'title'          => array(\n\t\t\t\t'type'                  => 'string',\n\t\t\t\t'default'               => '',\n\t\t\t\t'sanitize_callback'     => 'sanitize_text_field',\n\t\t\t\t'description'           => __( 'Title for the widget' ),\n\t\t\t\t'should_preview_update' => false,\n\t\t\t),\n\t\t\t'ids'            => array(\n\t\t\t\t'type'              => 'array',\n\t\t\t\t'items'             => array(\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t),\n\t\t\t\t'default'           => array(),\n\t\t\t\t'sanitize_callback' => 'wp_parse_id_list',\n\t\t\t),\n\t\t\t'columns'        => array(\n\t\t\t\t'type'    => 'integer',\n\t\t\t\t'default' => 3,\n\t\t\t\t'minimum' => 1,\n\t\t\t\t'maximum' => 9,\n\t\t\t),\n\t\t\t'size'           => array(\n\t\t\t\t'type'    => 'string',\n\t\t\t\t'enum'    => array_merge( get_intermediate_image_sizes(), array( 'full', 'custom' ) ),\n\t\t\t\t'default' => 'thumbnail',\n\t\t\t),\n\t\t\t'link_type'      => array(\n\t\t\t\t'type'                  => 'string',\n\t\t\t\t'enum'                  => array( 'post', 'file', 'none' ),\n\t\t\t\t'default'               => 'post',\n\t\t\t\t'media_prop'            => 'link',\n\t\t\t\t'should_preview_update' => false,\n\t\t\t),\n\t\t\t'orderby_random' => array(\n\t\t\t\t'type'                  => 'boolean',\n\t\t\t\t'default'               => false,\n\t\t\t\t'media_prop'            => '_orderbyRandom',\n\t\t\t\t'should_preview_update' => false,\n\t\t\t),\n\t\t);\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-widget-media.php */\n\t\t$schema = apply_filters( \"widget_{$this->id_base}_instance_schema\", $schema, $this );\n\n\t\treturn $schema;\n\t}\n\n\t/**\n\t * Render the media on the frontend.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param array $instance Widget instance props.\n\t */\n\tpublic function render_media( $instance ) {\n\t\t$instance = array_merge( wp_list_pluck( $this->get_instance_schema(), 'default' ), $instance );\n\n\t\t$shortcode_atts = array_merge(\n\t\t\t$instance,\n\t\t\tarray(\n\t\t\t\t'link' => $instance['link_type'],\n\t\t\t)\n\t\t);\n\n\t\t// @codeCoverageIgnoreStart\n\t\tif ( $instance['orderby_random'] ) {\n\t\t\t$shortcode_atts['orderby'] = 'rand';\n\t\t}\n\n\t\t// @codeCoverageIgnoreEnd\n\t\techo gallery_shortcode( $shortcode_atts );\n\t}\n\n\t/**\n\t * Loads the required media files for the media manager and scripts for media widgets.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic function enqueue_admin_scripts() {\n\t\tparent::enqueue_admin_scripts();\n\n\t\t$handle = 'media-gallery-widget';\n\t\twp_enqueue_script( $handle );\n\n\t\t$exported_schema = array();\n\t\tforeach ( $this->get_instance_schema() as $field => $field_schema ) {\n\t\t\t$exported_schema[ $field ] = wp_array_slice_assoc( $field_schema, array( 'type', 'default', 'enum', 'minimum', 'format', 'media_prop', 'should_preview_update', 'items' ) );\n\t\t}\n\t\twp_add_inline_script(\n\t\t\t$handle,\n\t\t\tsprintf(\n\t\t\t\t'wp.mediaWidgets.modelConstructors[ %s ].prototype.schema = %s;',\n\t\t\t\twp_json_encode( $this->id_base ),\n\t\t\t\twp_json_encode( $exported_schema )\n\t\t\t)\n\t\t);\n\n\t\twp_add_inline_script(\n\t\t\t$handle,\n\t\t\tsprintf(\n\t\t\t\t'\n\t\t\t\t\twp.mediaWidgets.controlConstructors[ %1$s ].prototype.mime_type = %2$s;\n\t\t\t\t\t_.extend( wp.mediaWidgets.controlConstructors[ %1$s ].prototype.l10n, %3$s );\n\t\t\t\t',\n\t\t\t\twp_json_encode( $this->id_base ),\n\t\t\t\twp_json_encode( $this->widget_options['mime_type'] ),\n\t\t\t\twp_json_encode( $this->l10n )\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Render form template scripts.\n\t *\n\t * @since 4.9.0\n\t */\n\tpublic function render_control_template_scripts() {\n\t\tparent::render_control_template_scripts();\n\t\t?>\n\t\t<script type=\"text/html\" id=\"tmpl-wp-media-widget-gallery-preview\">\n\t\t\t<#\n\t\t\tvar ids = _.filter( data.ids, function( id ) {\n\t\t\t\treturn ( id in data.attachments );\n\t\t\t} );\n\t\t\t#>\n\t\t\t<# if ( ids.length ) { #>\n\t\t\t\t<ul class=\"gallery media-widget-gallery-preview\" role=\"list\">\n\t\t\t\t\t<# _.each( ids, function( id, index ) { #>\n\t\t\t\t\t\t<# var attachment = data.attachments[ id ]; #>\n\t\t\t\t\t\t<# if ( index < 6 ) { #>\n\t\t\t\t\t\t\t<li class=\"gallery-item\">\n\t\t\t\t\t\t\t\t<div class=\"gallery-icon\">\n\t\t\t\t\t\t\t\t\t<img alt=\"{{ attachment.alt }}\"\n\t\t\t\t\t\t\t\t\t\t<# if ( index === 5 && data.ids.length > 6 ) { #> aria-hidden=\"true\" <# } #>\n\t\t\t\t\t\t\t\t\t\t<# if ( attachment.sizes.thumbnail ) { #>\n\t\t\t\t\t\t\t\t\t\t\tsrc=\"{{ attachment.sizes.thumbnail.url }}\" width=\"{{ attachment.sizes.thumbnail.width }}\" height=\"{{ attachment.sizes.thumbnail.height }}\"\n\t\t\t\t\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t\t\t\t\tsrc=\"{{ attachment.url }}\"\n\t\t\t\t\t\t\t\t\t\t<# } #>\n\t\t\t\t\t\t\t\t\t\t<# if ( ! attachment.alt && attachment.filename ) { #>\n\t\t\t\t\t\t\t\t\t\t\taria-label=\"\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\techo esc_attr(\n\t\t\t\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: The image file name. */\n\t\t\t\t\t\t\t\t\t\t\t\t\t__( 'The current image has no alternative text. The file name is: %s' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'{{ attachment.filename }}'\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\"\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<# if ( index === 5 && data.ids.length > 6 ) { #>\n\t\t\t\t\t\t\t\t\t<div class=\"gallery-icon-placeholder\">\n\t\t\t\t\t\t\t\t\t\t<p class=\"gallery-icon-placeholder-text\" aria-label=\"\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: The amount of additional, not visible images in the gallery widget preview. */\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'Additional images added to this gallery: %s' ),\n\t\t\t\t\t\t\t\t\t\t\t\t'{{ data.ids.length - 5 }}'\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\">+{{ data.ids.length - 5 }}</p>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<# } #>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t<# } ); #>\n\t\t\t\t</ul>\n\t\t\t<# } else { #>\n\t\t\t\t<div class=\"attachment-media-view\">\n\t\t\t\t\t<button type=\"button\" class=\"placeholder button-add-media\"><?php echo esc_html( $this->l10n['add_media'] ); ?></button>\n\t\t\t\t</div>\n\t\t\t<# } #>\n\t\t</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * Whether the widget has content to show.\n\t *\n\t * @since 4.9.0\n\t * @access protected\n\t *\n\t * @param array $instance Widget instance props.\n\t * @return bool Whether widget has content.\n\t */\n\tprotected function has_content( $instance ) {\n\t\tif ( ! empty( $instance['ids'] ) ) {\n\t\t\t$attachments = wp_parse_id_list( $instance['ids'] );\n\t\t\tforeach ( $attachments as $attachment ) {\n\t\t\t\tif ( 'attachment' !== get_post_type( $attachment ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}\n", "num_lines": 261}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Media_Image class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.8.0\n */\n\n/**\n * Core class that implements an image widget.\n *\n * @since 4.8.0\n *\n * @see WP_Widget_Media\n * @see WP_Widget\n */\nclass WP_Widget_Media_Image extends WP_Widget_Media {\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic function __construct() {\n\t\tparent::__construct(\n\t\t\t'media_image',\n\t\t\t__( 'Image' ),\n\t\t\tarray(\n\t\t\t\t'description' => __( 'Displays an image.' ),\n\t\t\t\t'mime_type'   => 'image',\n\t\t\t)\n\t\t);\n\n\t\t$this->l10n = array_merge(\n\t\t\t$this->l10n,\n\t\t\tarray(\n\t\t\t\t'no_media_selected'          => __( 'No image selected' ),\n\t\t\t\t'add_media'                  => _x( 'Add Image', 'label for button in the image widget' ),\n\t\t\t\t'replace_media'              => _x( 'Replace Image', 'label for button in the image widget; should preferably not be longer than ~13 characters long' ),\n\t\t\t\t'edit_media'                 => _x( 'Edit Image', 'label for button in the image widget; should preferably not be longer than ~13 characters long' ),\n\t\t\t\t'missing_attachment'         => sprintf(\n\t\t\t\t\t/* translators: %s: URL to media library. */\n\t\t\t\t\t__( 'We can&#8217;t find that image. Check your <a href=\"%s\">media library</a> and make sure it wasn&#8217;t deleted.' ),\n\t\t\t\t\tesc_url( admin_url( 'upload.php' ) )\n\t\t\t\t),\n\t\t\t\t/* translators: %d: Widget count. */\n\t\t\t\t'media_library_state_multi'  => _n_noop( 'Image Widget (%d)', 'Image Widget (%d)' ),\n\t\t\t\t'media_library_state_single' => __( 'Image Widget' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Get schema for properties of a widget instance (item).\n\t *\n\t * @since 4.8.0\n\t *\n\t * @see WP_REST_Controller::get_item_schema()\n\t * @see WP_REST_Controller::get_additional_fields()\n\t * @link https://core.trac.wordpress.org/ticket/35574\n\t *\n\t * @return array Schema for properties.\n\t */\n\tpublic function get_instance_schema() {\n\t\treturn array_merge(\n\t\t\tarray(\n\t\t\t\t'size'              => array(\n\t\t\t\t\t'type'        => 'string',\n\t\t\t\t\t'enum'        => array_merge( get_intermediate_image_sizes(), array( 'full', 'custom' ) ),\n\t\t\t\t\t'default'     => 'medium',\n\t\t\t\t\t'description' => __( 'Size' ),\n\t\t\t\t),\n\t\t\t\t'width'             => array( // Via 'customWidth', only when size=custom; otherwise via 'width'.\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'minimum'     => 0,\n\t\t\t\t\t'default'     => 0,\n\t\t\t\t\t'description' => __( 'Width' ),\n\t\t\t\t),\n\t\t\t\t'height'            => array( // Via 'customHeight', only when size=custom; otherwise via 'height'.\n\t\t\t\t\t'type'        => 'integer',\n\t\t\t\t\t'minimum'     => 0,\n\t\t\t\t\t'default'     => 0,\n\t\t\t\t\t'description' => __( 'Height' ),\n\t\t\t\t),\n\n\t\t\t\t'caption'           => array(\n\t\t\t\t\t'type'                  => 'string',\n\t\t\t\t\t'default'               => '',\n\t\t\t\t\t'sanitize_callback'     => 'wp_kses_post',\n\t\t\t\t\t'description'           => __( 'Caption' ),\n\t\t\t\t\t'should_preview_update' => false,\n\t\t\t\t),\n\t\t\t\t'alt'               => array(\n\t\t\t\t\t'type'              => 'string',\n\t\t\t\t\t'default'           => '',\n\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t'description'       => __( 'Alternative Text' ),\n\t\t\t\t),\n\t\t\t\t'link_type'         => array(\n\t\t\t\t\t'type'                  => 'string',\n\t\t\t\t\t'enum'                  => array( 'none', 'file', 'post', 'custom' ),\n\t\t\t\t\t'default'               => 'custom',\n\t\t\t\t\t'media_prop'            => 'link',\n\t\t\t\t\t'description'           => __( 'Link To' ),\n\t\t\t\t\t'should_preview_update' => true,\n\t\t\t\t),\n\t\t\t\t'link_url'          => array(\n\t\t\t\t\t'type'                  => 'string',\n\t\t\t\t\t'default'               => '',\n\t\t\t\t\t'format'                => 'uri',\n\t\t\t\t\t'media_prop'            => 'linkUrl',\n\t\t\t\t\t'description'           => __( 'URL' ),\n\t\t\t\t\t'should_preview_update' => true,\n\t\t\t\t),\n\t\t\t\t'image_classes'     => array(\n\t\t\t\t\t'type'                  => 'string',\n\t\t\t\t\t'default'               => '',\n\t\t\t\t\t'sanitize_callback'     => array( $this, 'sanitize_token_list' ),\n\t\t\t\t\t'media_prop'            => 'extraClasses',\n\t\t\t\t\t'description'           => __( 'Image CSS Class' ),\n\t\t\t\t\t'should_preview_update' => false,\n\t\t\t\t),\n\t\t\t\t'link_classes'      => array(\n\t\t\t\t\t'type'                  => 'string',\n\t\t\t\t\t'default'               => '',\n\t\t\t\t\t'sanitize_callback'     => array( $this, 'sanitize_token_list' ),\n\t\t\t\t\t'media_prop'            => 'linkClassName',\n\t\t\t\t\t'should_preview_update' => false,\n\t\t\t\t\t'description'           => __( 'Link CSS Class' ),\n\t\t\t\t),\n\t\t\t\t'link_rel'          => array(\n\t\t\t\t\t'type'                  => 'string',\n\t\t\t\t\t'default'               => '',\n\t\t\t\t\t'sanitize_callback'     => array( $this, 'sanitize_token_list' ),\n\t\t\t\t\t'media_prop'            => 'linkRel',\n\t\t\t\t\t'description'           => __( 'Link Rel' ),\n\t\t\t\t\t'should_preview_update' => false,\n\t\t\t\t),\n\t\t\t\t'link_target_blank' => array(\n\t\t\t\t\t'type'                  => 'boolean',\n\t\t\t\t\t'default'               => false,\n\t\t\t\t\t'media_prop'            => 'linkTargetBlank',\n\t\t\t\t\t'description'           => __( 'Open link in a new tab' ),\n\t\t\t\t\t'should_preview_update' => false,\n\t\t\t\t),\n\t\t\t\t'image_title'       => array(\n\t\t\t\t\t'type'                  => 'string',\n\t\t\t\t\t'default'               => '',\n\t\t\t\t\t'sanitize_callback'     => 'sanitize_text_field',\n\t\t\t\t\t'media_prop'            => 'title',\n\t\t\t\t\t'description'           => __( 'Image Title Attribute' ),\n\t\t\t\t\t'should_preview_update' => false,\n\t\t\t\t),\n\n\t\t\t\t/*\n\t\t\t\t * There are two additional properties exposed by the PostImage modal\n\t\t\t\t * that don't seem to be relevant, as they may only be derived read-only\n\t\t\t\t * values:\n\t\t\t\t * - originalUrl\n\t\t\t\t * - aspectRatio\n\t\t\t\t * - height (redundant when size is not custom)\n\t\t\t\t * - width (redundant when size is not custom)\n\t\t\t\t */\n\t\t\t),\n\t\t\tparent::get_instance_schema()\n\t\t);\n\t}\n\n\t/**\n\t * Render the media on the frontend.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param array $instance Widget instance props.\n\t */\n\tpublic function render_media( $instance ) {\n\t\t$instance = array_merge( wp_list_pluck( $this->get_instance_schema(), 'default' ), $instance );\n\t\t$instance = wp_parse_args(\n\t\t\t$instance,\n\t\t\tarray(\n\t\t\t\t'size' => 'thumbnail',\n\t\t\t)\n\t\t);\n\n\t\t$attachment = null;\n\n\t\tif ( $this->is_attachment_with_mime_type( $instance['attachment_id'], $this->widget_options['mime_type'] ) ) {\n\t\t\t$attachment = get_post( $instance['attachment_id'] );\n\t\t}\n\n\t\tif ( $attachment ) {\n\t\t\t$caption = '';\n\t\t\tif ( ! isset( $instance['caption'] ) ) {\n\t\t\t\t$caption = $attachment->post_excerpt;\n\t\t\t} elseif ( trim( $instance['caption'] ) ) {\n\t\t\t\t$caption = $instance['caption'];\n\t\t\t}\n\n\t\t\t$image_attributes = array(\n\t\t\t\t'class' => sprintf( 'image wp-image-%d %s', $attachment->ID, $instance['image_classes'] ),\n\t\t\t\t'style' => 'max-width: 100%; height: auto;',\n\t\t\t);\n\t\t\tif ( ! empty( $instance['image_title'] ) ) {\n\t\t\t\t$image_attributes['title'] = $instance['image_title'];\n\t\t\t}\n\n\t\t\tif ( $instance['alt'] ) {\n\t\t\t\t$image_attributes['alt'] = $instance['alt'];\n\t\t\t}\n\n\t\t\t$size = $instance['size'];\n\n\t\t\tif ( 'custom' === $size || ! in_array( $size, array_merge( get_intermediate_image_sizes(), array( 'full' ) ), true ) ) {\n\t\t\t\t$size  = array( $instance['width'], $instance['height'] );\n\t\t\t\t$width = $instance['width'];\n\t\t\t} else {\n\t\t\t\t$caption_size = _wp_get_image_size_from_meta( $instance['size'], wp_get_attachment_metadata( $attachment->ID ) );\n\t\t\t\t$width        = empty( $caption_size[0] ) ? 0 : $caption_size[0];\n\t\t\t}\n\n\t\t\t$image_attributes['class'] .= sprintf( ' attachment-%1$s size-%1$s', is_array( $size ) ? join( 'x', $size ) : $size );\n\n\t\t\t$image = wp_get_attachment_image( $attachment->ID, $size, false, $image_attributes );\n\n\t\t} else {\n\t\t\tif ( empty( $instance['url'] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$instance['size'] = 'custom';\n\t\t\t$caption          = $instance['caption'];\n\t\t\t$width            = $instance['width'];\n\t\t\t$classes          = 'image ' . $instance['image_classes'];\n\t\t\tif ( 0 === $instance['width'] ) {\n\t\t\t\t$instance['width'] = '';\n\t\t\t}\n\t\t\tif ( 0 === $instance['height'] ) {\n\t\t\t\t$instance['height'] = '';\n\t\t\t}\n\n\t\t\t$image = sprintf(\n\t\t\t\t'<img class=\"%1$s\" src=\"%2$s\" alt=\"%3$s\" width=\"%4$s\" height=\"%5$s\" />',\n\t\t\t\tesc_attr( $classes ),\n\t\t\t\tesc_url( $instance['url'] ),\n\t\t\t\tesc_attr( $instance['alt'] ),\n\t\t\t\tesc_attr( $instance['width'] ),\n\t\t\t\tesc_attr( $instance['height'] )\n\t\t\t);\n\t\t} // End if().\n\n\t\t$url = '';\n\t\tif ( 'file' === $instance['link_type'] ) {\n\t\t\t$url = $attachment ? wp_get_attachment_url( $attachment->ID ) : $instance['url'];\n\t\t} elseif ( $attachment && 'post' === $instance['link_type'] ) {\n\t\t\t$url = get_attachment_link( $attachment->ID );\n\t\t} elseif ( 'custom' === $instance['link_type'] && ! empty( $instance['link_url'] ) ) {\n\t\t\t$url = $instance['link_url'];\n\t\t}\n\n\t\tif ( $url ) {\n\t\t\t$link = sprintf( '<a href=\"%s\"', esc_url( $url ) );\n\t\t\tif ( ! empty( $instance['link_classes'] ) ) {\n\t\t\t\t$link .= sprintf( ' class=\"%s\"', esc_attr( $instance['link_classes'] ) );\n\t\t\t}\n\t\t\tif ( ! empty( $instance['link_rel'] ) ) {\n\t\t\t\t$link .= sprintf( ' rel=\"%s\"', esc_attr( $instance['link_rel'] ) );\n\t\t\t}\n\t\t\tif ( ! empty( $instance['link_target_blank'] ) ) {\n\t\t\t\t$link .= ' target=\"_blank\"';\n\t\t\t}\n\t\t\t$link .= '>';\n\t\t\t$link .= $image;\n\t\t\t$link .= '</a>';\n\t\t\t$image = wp_targeted_link_rel( $link );\n\t\t}\n\n\t\tif ( $caption ) {\n\t\t\t$image = img_caption_shortcode(\n\t\t\t\tarray(\n\t\t\t\t\t'width'   => $width,\n\t\t\t\t\t'caption' => $caption,\n\t\t\t\t),\n\t\t\t\t$image\n\t\t\t);\n\t\t}\n\n\t\techo $image;\n\t}\n\n\t/**\n\t * Loads the required media files for the media manager and scripts for media widgets.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic function enqueue_admin_scripts() {\n\t\tparent::enqueue_admin_scripts();\n\n\t\t$handle = 'media-image-widget';\n\t\twp_enqueue_script( $handle );\n\n\t\t$exported_schema = array();\n\t\tforeach ( $this->get_instance_schema() as $field => $field_schema ) {\n\t\t\t$exported_schema[ $field ] = wp_array_slice_assoc( $field_schema, array( 'type', 'default', 'enum', 'minimum', 'format', 'media_prop', 'should_preview_update' ) );\n\t\t}\n\t\twp_add_inline_script(\n\t\t\t$handle,\n\t\t\tsprintf(\n\t\t\t\t'wp.mediaWidgets.modelConstructors[ %s ].prototype.schema = %s;',\n\t\t\t\twp_json_encode( $this->id_base ),\n\t\t\t\twp_json_encode( $exported_schema )\n\t\t\t)\n\t\t);\n\n\t\twp_add_inline_script(\n\t\t\t$handle,\n\t\t\tsprintf(\n\t\t\t\t'\n\t\t\t\t\twp.mediaWidgets.controlConstructors[ %1$s ].prototype.mime_type = %2$s;\n\t\t\t\t\twp.mediaWidgets.controlConstructors[ %1$s ].prototype.l10n = _.extend( {}, wp.mediaWidgets.controlConstructors[ %1$s ].prototype.l10n, %3$s );\n\t\t\t\t',\n\t\t\t\twp_json_encode( $this->id_base ),\n\t\t\t\twp_json_encode( $this->widget_options['mime_type'] ),\n\t\t\t\twp_json_encode( $this->l10n )\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Render form template scripts.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic function render_control_template_scripts() {\n\t\tparent::render_control_template_scripts();\n\n\t\t?>\n\t\t<script type=\"text/html\" id=\"tmpl-wp-media-widget-image-fields\">\n\t\t\t<# var elementIdPrefix = 'el' + String( Math.random() ) + '_'; #>\n\t\t\t<# if ( data.url ) { #>\n\t\t\t<p class=\"media-widget-image-link\">\n\t\t\t\t<label for=\"{{ elementIdPrefix }}linkUrl\"><?php esc_html_e( 'Link to:' ); ?></label>\n\t\t\t\t<input id=\"{{ elementIdPrefix }}linkUrl\" type=\"text\" class=\"widefat link\" value=\"{{ data.link_url }}\" placeholder=\"https://\" pattern=\"((\\w+:)?\\/\\/\\w.*|\\w+:(?!\\/\\/$)|\\/|\\?|#).*\">\n\t\t\t</p>\n\t\t\t<# } #>\n\t\t</script>\n\t\t<script type=\"text/html\" id=\"tmpl-wp-media-widget-image-preview\">\n\t\t\t<# if ( data.error && 'missing_attachment' === data.error ) { #>\n\t\t\t\t<div class=\"notice notice-error notice-alt notice-missing-attachment\">\n\t\t\t\t\t<p><?php echo $this->l10n['missing_attachment']; ?></p>\n\t\t\t\t</div>\n\t\t\t<# } else if ( data.error ) { #>\n\t\t\t\t<div class=\"notice notice-error notice-alt\">\n\t\t\t\t\t<p><?php _e( 'Unable to preview media due to an unknown error.' ); ?></p>\n\t\t\t\t</div>\n\t\t\t<# } else if ( data.url ) { #>\n\t\t\t\t<img class=\"attachment-thumb\" src=\"{{ data.url }}\" draggable=\"false\" alt=\"{{ data.alt }}\"\n\t\t\t\t\t<# if ( ! data.alt && data.currentFilename ) { #>\n\t\t\t\t\t\taria-label=\"\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\techo esc_attr(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: The image file name. */\n\t\t\t\t\t\t\t\t__( 'The current image has no alternative text. The file name is: %s' ),\n\t\t\t\t\t\t\t\t'{{ data.currentFilename }}'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\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/>\n\t\t\t<# } #>\n\t\t</script>\n\t\t<?php\n\t}\n}\n", "num_lines": 377}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Media_Video class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.8.0\n */\n\n/**\n * Core class that implements a video widget.\n *\n * @since 4.8.0\n *\n * @see WP_Widget_Media\n * @see WP_Widget\n */\nclass WP_Widget_Media_Video extends WP_Widget_Media {\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic function __construct() {\n\t\tparent::__construct(\n\t\t\t'media_video',\n\t\t\t__( 'Video' ),\n\t\t\tarray(\n\t\t\t\t'description' => __( 'Displays a video from the media library or from YouTube, Vimeo, or another provider.' ),\n\t\t\t\t'mime_type'   => 'video',\n\t\t\t)\n\t\t);\n\n\t\t$this->l10n = array_merge(\n\t\t\t$this->l10n,\n\t\t\tarray(\n\t\t\t\t'no_media_selected'          => __( 'No video selected' ),\n\t\t\t\t'add_media'                  => _x( 'Add Video', 'label for button in the video widget' ),\n\t\t\t\t'replace_media'              => _x( 'Replace Video', 'label for button in the video widget; should preferably not be longer than ~13 characters long' ),\n\t\t\t\t'edit_media'                 => _x( 'Edit Video', 'label for button in the video widget; should preferably not be longer than ~13 characters long' ),\n\t\t\t\t'missing_attachment'         => sprintf(\n\t\t\t\t\t/* translators: %s: URL to media library. */\n\t\t\t\t\t__( 'We can&#8217;t find that video. Check your <a href=\"%s\">media library</a> and make sure it wasn&#8217;t deleted.' ),\n\t\t\t\t\tesc_url( admin_url( 'upload.php' ) )\n\t\t\t\t),\n\t\t\t\t/* translators: %d: Widget count. */\n\t\t\t\t'media_library_state_multi'  => _n_noop( 'Video Widget (%d)', 'Video Widget (%d)' ),\n\t\t\t\t'media_library_state_single' => __( 'Video Widget' ),\n\t\t\t\t/* translators: %s: A list of valid video file extensions. */\n\t\t\t\t'unsupported_file_type'      => sprintf( __( 'Sorry, we can&#8217;t load the video at the supplied URL. Please check that the URL is for a supported video file (%s) or stream (e.g. YouTube and Vimeo).' ), '<code>.' . implode( '</code>, <code>.', wp_get_video_extensions() ) . '</code>' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Get schema for properties of a widget instance (item).\n\t *\n\t * @since 4.8.0\n\t *\n\t * @see WP_REST_Controller::get_item_schema()\n\t * @see WP_REST_Controller::get_additional_fields()\n\t * @link https://core.trac.wordpress.org/ticket/35574\n\t *\n\t * @return array Schema for properties.\n\t */\n\tpublic function get_instance_schema() {\n\n\t\t$schema = array(\n\t\t\t'preload' => array(\n\t\t\t\t'type'                  => 'string',\n\t\t\t\t'enum'                  => array( 'none', 'auto', 'metadata' ),\n\t\t\t\t'default'               => 'metadata',\n\t\t\t\t'description'           => __( 'Preload' ),\n\t\t\t\t'should_preview_update' => false,\n\t\t\t),\n\t\t\t'loop'    => array(\n\t\t\t\t'type'                  => 'boolean',\n\t\t\t\t'default'               => false,\n\t\t\t\t'description'           => __( 'Loop' ),\n\t\t\t\t'should_preview_update' => false,\n\t\t\t),\n\t\t\t'content' => array(\n\t\t\t\t'type'                  => 'string',\n\t\t\t\t'default'               => '',\n\t\t\t\t'sanitize_callback'     => 'wp_kses_post',\n\t\t\t\t'description'           => __( 'Tracks (subtitles, captions, descriptions, chapters, or metadata)' ),\n\t\t\t\t'should_preview_update' => false,\n\t\t\t),\n\t\t);\n\n\t\tforeach ( wp_get_video_extensions() as $video_extension ) {\n\t\t\t$schema[ $video_extension ] = array(\n\t\t\t\t'type'        => 'string',\n\t\t\t\t'default'     => '',\n\t\t\t\t'format'      => 'uri',\n\t\t\t\t/* translators: %s: Video extension. */\n\t\t\t\t'description' => sprintf( __( 'URL to the %s video source file' ), $video_extension ),\n\t\t\t);\n\t\t}\n\n\t\treturn array_merge( $schema, parent::get_instance_schema() );\n\t}\n\n\t/**\n\t * Render the media on the frontend.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param array $instance Widget instance props.\n\t */\n\tpublic function render_media( $instance ) {\n\t\t$instance   = array_merge( wp_list_pluck( $this->get_instance_schema(), 'default' ), $instance );\n\t\t$attachment = null;\n\n\t\tif ( $this->is_attachment_with_mime_type( $instance['attachment_id'], $this->widget_options['mime_type'] ) ) {\n\t\t\t$attachment = get_post( $instance['attachment_id'] );\n\t\t}\n\n\t\t$src = $instance['url'];\n\t\tif ( $attachment ) {\n\t\t\t$src = wp_get_attachment_url( $attachment->ID );\n\t\t}\n\n\t\tif ( empty( $src ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$youtube_pattern = '#^https?://(?:www\\.)?(?:youtube\\.com/watch|youtu\\.be/)#';\n\t\t$vimeo_pattern   = '#^https?://(.+\\.)?vimeo\\.com/.*#';\n\n\t\tif ( $attachment || preg_match( $youtube_pattern, $src ) || preg_match( $vimeo_pattern, $src ) ) {\n\t\t\tadd_filter( 'wp_video_shortcode', array( $this, 'inject_video_max_width_style' ) );\n\n\t\t\techo wp_video_shortcode(\n\t\t\t\tarray_merge(\n\t\t\t\t\t$instance,\n\t\t\t\t\tcompact( 'src' )\n\t\t\t\t),\n\t\t\t\t$instance['content']\n\t\t\t);\n\n\t\t\tremove_filter( 'wp_video_shortcode', array( $this, 'inject_video_max_width_style' ) );\n\t\t} else {\n\t\t\techo $this->inject_video_max_width_style( wp_oembed_get( $src ) );\n\t\t}\n\t}\n\n\t/**\n\t * Inject max-width and remove height for videos too constrained to fit inside sidebars on frontend.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param string $html Video shortcode HTML output.\n\t * @return string HTML Output.\n\t */\n\tpublic function inject_video_max_width_style( $html ) {\n\t\t$html = preg_replace( '/\\sheight=\"\\d+\"/', '', $html );\n\t\t$html = preg_replace( '/\\swidth=\"\\d+\"/', '', $html );\n\t\t$html = preg_replace( '/(?<=width:)\\s*\\d+px(?=;?)/', '100%', $html );\n\t\treturn $html;\n\t}\n\n\t/**\n\t * Enqueue preview scripts.\n\t *\n\t * These scripts normally are enqueued just-in-time when a video shortcode is used.\n\t * In the customizer, however, widgets can be dynamically added and rendered via\n\t * selective refresh, and so it is important to unconditionally enqueue them in\n\t * case a widget does get added.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic function enqueue_preview_scripts() {\n\t\t/** This filter is documented in wp-includes/media.php */\n\t\tif ( 'mediaelement' === apply_filters( 'wp_video_shortcode_library', 'mediaelement' ) ) {\n\t\t\twp_enqueue_style( 'wp-mediaelement' );\n\t\t\twp_enqueue_script( 'mediaelement-vimeo' );\n\t\t\twp_enqueue_script( 'wp-mediaelement' );\n\t\t}\n\t}\n\n\t/**\n\t * Loads the required scripts and styles for the widget control.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic function enqueue_admin_scripts() {\n\t\tparent::enqueue_admin_scripts();\n\n\t\t$handle = 'media-video-widget';\n\t\twp_enqueue_script( $handle );\n\n\t\t$exported_schema = array();\n\t\tforeach ( $this->get_instance_schema() as $field => $field_schema ) {\n\t\t\t$exported_schema[ $field ] = wp_array_slice_assoc( $field_schema, array( 'type', 'default', 'enum', 'minimum', 'format', 'media_prop', 'should_preview_update' ) );\n\t\t}\n\t\twp_add_inline_script(\n\t\t\t$handle,\n\t\t\tsprintf(\n\t\t\t\t'wp.mediaWidgets.modelConstructors[ %s ].prototype.schema = %s;',\n\t\t\t\twp_json_encode( $this->id_base ),\n\t\t\t\twp_json_encode( $exported_schema )\n\t\t\t)\n\t\t);\n\n\t\twp_add_inline_script(\n\t\t\t$handle,\n\t\t\tsprintf(\n\t\t\t\t'\n\t\t\t\t\twp.mediaWidgets.controlConstructors[ %1$s ].prototype.mime_type = %2$s;\n\t\t\t\t\twp.mediaWidgets.controlConstructors[ %1$s ].prototype.l10n = _.extend( {}, wp.mediaWidgets.controlConstructors[ %1$s ].prototype.l10n, %3$s );\n\t\t\t\t',\n\t\t\t\twp_json_encode( $this->id_base ),\n\t\t\t\twp_json_encode( $this->widget_options['mime_type'] ),\n\t\t\t\twp_json_encode( $this->l10n )\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Render form template scripts.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic function render_control_template_scripts() {\n\t\tparent::render_control_template_scripts()\n\t\t?>\n\t\t<script type=\"text/html\" id=\"tmpl-wp-media-widget-video-preview\">\n\t\t\t<# if ( data.error && 'missing_attachment' === data.error ) { #>\n\t\t\t\t<div class=\"notice notice-error notice-alt notice-missing-attachment\">\n\t\t\t\t\t<p><?php echo $this->l10n['missing_attachment']; ?></p>\n\t\t\t\t</div>\n\t\t\t<# } else if ( data.error && 'unsupported_file_type' === data.error ) { #>\n\t\t\t\t<div class=\"notice notice-error notice-alt notice-missing-attachment\">\n\t\t\t\t\t<p><?php echo $this->l10n['unsupported_file_type']; ?></p>\n\t\t\t\t</div>\n\t\t\t<# } else if ( data.error ) { #>\n\t\t\t\t<div class=\"notice notice-error notice-alt\">\n\t\t\t\t\t<p><?php _e( 'Unable to preview media due to an unknown error.' ); ?></p>\n\t\t\t\t</div>\n\t\t\t<# } else if ( data.is_oembed && data.model.poster ) { #>\n\t\t\t\t<a href=\"{{ data.model.src }}\" target=\"_blank\" class=\"media-widget-video-link\">\n\t\t\t\t\t<img src=\"{{ data.model.poster }}\" />\n\t\t\t\t</a>\n\t\t\t<# } else if ( data.is_oembed ) { #>\n\t\t\t\t<a href=\"{{ data.model.src }}\" target=\"_blank\" class=\"media-widget-video-link no-poster\">\n\t\t\t\t\t<span class=\"dashicons dashicons-format-video\"></span>\n\t\t\t\t</a>\n\t\t\t<# } else if ( data.model.src ) { #>\n\t\t\t\t<?php wp_underscore_video_template(); ?>\n\t\t\t<# } #>\n\t\t</script>\n\t\t<?php\n\t}\n}\n", "num_lines": 257}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Media_Widget class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.8.0\n */\n\n/**\n * Core class that implements a media widget.\n *\n * @since 4.8.0\n *\n * @see WP_Widget\n */\nabstract class WP_Widget_Media extends WP_Widget {\n\n\t/**\n\t * Translation labels.\n\t *\n\t * @since 4.8.0\n\t * @var array\n\t */\n\tpublic $l10n = array(\n\t\t'add_to_widget'              => '',\n\t\t'replace_media'              => '',\n\t\t'edit_media'                 => '',\n\t\t'media_library_state_multi'  => '',\n\t\t'media_library_state_single' => '',\n\t\t'missing_attachment'         => '',\n\t\t'no_media_selected'          => '',\n\t\t'add_media'                  => '',\n\t);\n\n\t/**\n\t * Whether or not the widget has been registered yet.\n\t *\n\t * @since 4.8.1\n\t * @var bool\n\t */\n\tprotected $registered = false;\n\n\t/**\n\t * Constructor.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param string $id_base         Base ID for the widget, lowercase and unique.\n\t * @param string $name            Name for the widget displayed on the configuration page.\n\t * @param array  $widget_options  Optional. Widget options. See wp_register_sidebar_widget() for\n\t *                                information on accepted arguments. Default empty array.\n\t * @param array  $control_options Optional. Widget control options. See wp_register_widget_control()\n\t *                                for information on accepted arguments. Default empty array.\n\t */\n\tpublic function __construct( $id_base, $name, $widget_options = array(), $control_options = array() ) {\n\t\t$widget_opts = wp_parse_args(\n\t\t\t$widget_options,\n\t\t\tarray(\n\t\t\t\t'description'                 => __( 'A media item.' ),\n\t\t\t\t'customize_selective_refresh' => true,\n\t\t\t\t'mime_type'                   => '',\n\t\t\t)\n\t\t);\n\n\t\t$control_opts = wp_parse_args( $control_options, array() );\n\n\t\t$l10n_defaults = array(\n\t\t\t'no_media_selected'          => __( 'No media selected' ),\n\t\t\t'add_media'                  => _x( 'Add Media', 'label for button in the media widget' ),\n\t\t\t'replace_media'              => _x( 'Replace Media', 'label for button in the media widget; should preferably not be longer than ~13 characters long' ),\n\t\t\t'edit_media'                 => _x( 'Edit Media', 'label for button in the media widget; should preferably not be longer than ~13 characters long' ),\n\t\t\t'add_to_widget'              => __( 'Add to Widget' ),\n\t\t\t'missing_attachment'         => sprintf(\n\t\t\t\t/* translators: %s: URL to media library. */\n\t\t\t\t__( 'We can&#8217;t find that file. Check your <a href=\"%s\">media library</a> and make sure it wasn&#8217;t deleted.' ),\n\t\t\t\tesc_url( admin_url( 'upload.php' ) )\n\t\t\t),\n\t\t\t/* translators: %d: Widget count. */\n\t\t\t'media_library_state_multi'  => _n_noop( 'Media Widget (%d)', 'Media Widget (%d)' ),\n\t\t\t'media_library_state_single' => __( 'Media Widget' ),\n\t\t\t'unsupported_file_type'      => __( 'Looks like this isn&#8217;t the correct kind of file. Please link to an appropriate file instead.' ),\n\t\t);\n\t\t$this->l10n    = array_merge( $l10n_defaults, array_filter( $this->l10n ) );\n\n\t\tparent::__construct(\n\t\t\t$id_base,\n\t\t\t$name,\n\t\t\t$widget_opts,\n\t\t\t$control_opts\n\t\t);\n\t}\n\n\t/**\n\t * Add hooks while registering all widget instances of this widget class.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param integer $number Optional. The unique order number of this widget instance\n\t *                        compared to other instances of the same class. Default -1.\n\t */\n\tpublic function _register_one( $number = -1 ) {\n\t\tparent::_register_one( $number );\n\t\tif ( $this->registered ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->registered = true;\n\n\t\t// Note that the widgets component in the customizer will also do\n\t\t// the 'admin_print_scripts-widgets.php' action in WP_Customize_Widgets::print_scripts().\n\t\tadd_action( 'admin_print_scripts-widgets.php', array( $this, 'enqueue_admin_scripts' ) );\n\n\t\tif ( $this->is_preview() ) {\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_preview_scripts' ) );\n\t\t}\n\n\t\t// Note that the widgets component in the customizer will also do\n\t\t// the 'admin_footer-widgets.php' action in WP_Customize_Widgets::print_footer_scripts().\n\t\tadd_action( 'admin_footer-widgets.php', array( $this, 'render_control_template_scripts' ) );\n\n\t\tadd_filter( 'display_media_states', array( $this, 'display_media_state' ), 10, 2 );\n\t}\n\n\t/**\n\t * Get schema for properties of a widget instance (item).\n\t *\n\t * @since 4.8.0\n\t *\n\t * @see WP_REST_Controller::get_item_schema()\n\t * @see WP_REST_Controller::get_additional_fields()\n\t * @link https://core.trac.wordpress.org/ticket/35574\n\t *\n\t * @return array Schema for properties.\n\t */\n\tpublic function get_instance_schema() {\n\t\t$schema = array(\n\t\t\t'attachment_id' => array(\n\t\t\t\t'type'        => 'integer',\n\t\t\t\t'default'     => 0,\n\t\t\t\t'minimum'     => 0,\n\t\t\t\t'description' => __( 'Attachment post ID' ),\n\t\t\t\t'media_prop'  => 'id',\n\t\t\t),\n\t\t\t'url'           => array(\n\t\t\t\t'type'        => 'string',\n\t\t\t\t'default'     => '',\n\t\t\t\t'format'      => 'uri',\n\t\t\t\t'description' => __( 'URL to the media file' ),\n\t\t\t),\n\t\t\t'title'         => array(\n\t\t\t\t'type'                  => 'string',\n\t\t\t\t'default'               => '',\n\t\t\t\t'sanitize_callback'     => 'sanitize_text_field',\n\t\t\t\t'description'           => __( 'Title for the widget' ),\n\t\t\t\t'should_preview_update' => false,\n\t\t\t),\n\t\t);\n\n\t\t/**\n\t\t * Filters the media widget instance schema to add additional properties.\n\t\t *\n\t\t * @since 4.9.0\n\t\t *\n\t\t * @param array           $schema Instance schema.\n\t\t * @param WP_Widget_Media $this   Widget object.\n\t\t */\n\t\t$schema = apply_filters( \"widget_{$this->id_base}_instance_schema\", $schema, $this );\n\n\t\treturn $schema;\n\t}\n\n\t/**\n\t * Determine if the supplied attachment is for a valid attachment post with the specified MIME type.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param int|WP_Post $attachment Attachment post ID or object.\n\t * @param string      $mime_type  MIME type.\n\t * @return bool Is matching MIME type.\n\t */\n\tpublic function is_attachment_with_mime_type( $attachment, $mime_type ) {\n\t\tif ( empty( $attachment ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t$attachment = get_post( $attachment );\n\t\tif ( ! $attachment ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( 'attachment' !== $attachment->post_type ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn wp_attachment_is( $mime_type, $attachment );\n\t}\n\n\t/**\n\t * Sanitize a token list string, such as used in HTML rel and class attributes.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @link http://w3c.github.io/html/infrastructure.html#space-separated-tokens\n\t * @link https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList\n\t * @param string|array $tokens List of tokens separated by spaces, or an array of tokens.\n\t * @return string Sanitized token string list.\n\t */\n\tpublic function sanitize_token_list( $tokens ) {\n\t\tif ( is_string( $tokens ) ) {\n\t\t\t$tokens = preg_split( '/\\s+/', trim( $tokens ) );\n\t\t}\n\t\t$tokens = array_map( 'sanitize_html_class', $tokens );\n\t\t$tokens = array_filter( $tokens );\n\t\treturn join( ' ', $tokens );\n\t}\n\n\t/**\n\t * Displays the widget on the front-end.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @see WP_Widget::widget()\n\t *\n\t * @param array $args     Display arguments including before_title, after_title, before_widget, and after_widget.\n\t * @param array $instance Saved setting from the database.\n\t */\n\tpublic function widget( $args, $instance ) {\n\t\t$instance = wp_parse_args( $instance, wp_list_pluck( $this->get_instance_schema(), 'default' ) );\n\n\t\t// Short-circuit if no media is selected.\n\t\tif ( ! $this->has_content( $instance ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo $args['before_widget'];\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */\n\t\t$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );\n\n\t\tif ( $title ) {\n\t\t\techo $args['before_title'] . $title . $args['after_title'];\n\t\t}\n\n\t\t/**\n\t\t * Filters the media widget instance prior to rendering the media.\n\t\t *\n\t\t * @since 4.8.0\n\t\t *\n\t\t * @param array           $instance Instance data.\n\t\t * @param array           $args     Widget args.\n\t\t * @param WP_Widget_Media $this     Widget object.\n\t\t */\n\t\t$instance = apply_filters( \"widget_{$this->id_base}_instance\", $instance, $args, $this );\n\n\t\t$this->render_media( $instance );\n\n\t\techo $args['after_widget'];\n\t}\n\n\t/**\n\t * Sanitizes the widget form values as they are saved.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @see WP_Widget::update()\n\t * @see WP_REST_Request::has_valid_params()\n\t * @see WP_REST_Request::sanitize_params()\n\t *\n\t * @param array $new_instance Values just sent to be saved.\n\t * @param array $instance     Previously saved values from database.\n\t * @return array Updated safe values to be saved.\n\t */\n\tpublic function update( $new_instance, $instance ) {\n\n\t\t$schema = $this->get_instance_schema();\n\t\tforeach ( $schema as $field => $field_schema ) {\n\t\t\tif ( ! array_key_exists( $field, $new_instance ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$value = $new_instance[ $field ];\n\n\t\t\t/*\n\t\t\t * Workaround for rest_validate_value_from_schema() due to the fact that\n\t\t\t * rest_is_boolean( '' ) === false, while rest_is_boolean( '1' ) is true.\n\t\t\t */\n\t\t\tif ( 'boolean' === $field_schema['type'] && '' === $value ) {\n\t\t\t\t$value = false;\n\t\t\t}\n\n\t\t\tif ( true !== rest_validate_value_from_schema( $value, $field_schema, $field ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$value = rest_sanitize_value_from_schema( $value, $field_schema );\n\n\t\t\t// @codeCoverageIgnoreStart\n\t\t\tif ( is_wp_error( $value ) ) {\n\t\t\t\tcontinue; // Handle case when rest_sanitize_value_from_schema() ever returns WP_Error as its phpdoc @return tag indicates.\n\t\t\t}\n\n\t\t\t// @codeCoverageIgnoreEnd\n\t\t\tif ( isset( $field_schema['sanitize_callback'] ) ) {\n\t\t\t\t$value = call_user_func( $field_schema['sanitize_callback'], $value );\n\t\t\t}\n\t\t\tif ( is_wp_error( $value ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$instance[ $field ] = $value;\n\t\t}\n\n\t\treturn $instance;\n\t}\n\n\t/**\n\t * Render the media on the frontend.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param array $instance Widget instance props.\n\t * @return string\n\t */\n\tabstract public function render_media( $instance );\n\n\t/**\n\t * Outputs the settings update form.\n\t *\n\t * Note that the widget UI itself is rendered with JavaScript via `MediaWidgetControl#render()`.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @see \\WP_Widget_Media::render_control_template_scripts() Where the JS template is located.\n\t *\n\t * @param array $instance Current settings.\n\t */\n\tfinal public function form( $instance ) {\n\t\t$instance_schema = $this->get_instance_schema();\n\t\t$instance        = wp_array_slice_assoc(\n\t\t\twp_parse_args( (array) $instance, wp_list_pluck( $instance_schema, 'default' ) ),\n\t\t\tarray_keys( $instance_schema )\n\t\t);\n\n\t\tforeach ( $instance as $name => $value ) : ?>\n\t\t\t<input\n\t\t\t\ttype=\"hidden\"\n\t\t\t\tdata-property=\"<?php echo esc_attr( $name ); ?>\"\n\t\t\t\tclass=\"media-widget-instance-property\"\n\t\t\t\tname=\"<?php echo esc_attr( $this->get_field_name( $name ) ); ?>\"\n\t\t\t\tid=\"<?php echo esc_attr( $this->get_field_id( $name ) ); // Needed specifically by wpWidgets.appendTitle(). ?>\"\n\t\t\t\tvalue=\"<?php echo esc_attr( is_array( $value ) ? join( ',', $value ) : strval( $value ) ); ?>\"\n\t\t\t/>\n\t\t\t<?php\n\t\tendforeach;\n\t}\n\n\t/**\n\t * Filters the default media display states for items in the Media list table.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param array   $states An array of media states.\n\t * @param WP_Post $post   The current attachment object.\n\t * @return array\n\t */\n\tpublic function display_media_state( $states, $post = null ) {\n\t\tif ( ! $post ) {\n\t\t\t$post = get_post();\n\t\t}\n\n\t\t// Count how many times this attachment is used in widgets.\n\t\t$use_count = 0;\n\t\tforeach ( $this->get_settings() as $instance ) {\n\t\t\tif ( isset( $instance['attachment_id'] ) && $instance['attachment_id'] === $post->ID ) {\n\t\t\t\t$use_count++;\n\t\t\t}\n\t\t}\n\n\t\tif ( 1 === $use_count ) {\n\t\t\t$states[] = $this->l10n['media_library_state_single'];\n\t\t} elseif ( $use_count > 0 ) {\n\t\t\t$states[] = sprintf( translate_nooped_plural( $this->l10n['media_library_state_multi'], $use_count ), number_format_i18n( $use_count ) );\n\t\t}\n\n\t\treturn $states;\n\t}\n\n\t/**\n\t * Enqueue preview scripts.\n\t *\n\t * These scripts normally are enqueued just-in-time when a widget is rendered.\n\t * In the customizer, however, widgets can be dynamically added and rendered via\n\t * selective refresh, and so it is important to unconditionally enqueue them in\n\t * case a widget does get added.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic function enqueue_preview_scripts() {}\n\n\t/**\n\t * Loads the required scripts and styles for the widget control.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic function enqueue_admin_scripts() {\n\t\twp_enqueue_media();\n\t\twp_enqueue_script( 'media-widgets' );\n\t}\n\n\t/**\n\t * Render form template scripts.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic function render_control_template_scripts() {\n\t\t?>\n\t\t<script type=\"text/html\" id=\"tmpl-widget-media-<?php echo esc_attr( $this->id_base ); ?>-control\">\n\t\t\t<# var elementIdPrefix = 'el' + String( Math.random() ) + '_' #>\n\t\t\t<p>\n\t\t\t\t<label for=\"{{ elementIdPrefix }}title\"><?php esc_html_e( 'Title:' ); ?></label>\n\t\t\t\t<input id=\"{{ elementIdPrefix }}title\" type=\"text\" class=\"widefat title\">\n\t\t\t</p>\n\t\t\t<div class=\"media-widget-preview <?php echo esc_attr( $this->id_base ); ?>\">\n\t\t\t\t<div class=\"attachment-media-view\">\n\t\t\t\t\t<button type=\"button\" class=\"select-media button-add-media not-selected\">\n\t\t\t\t\t\t<?php echo esc_html( $this->l10n['add_media'] ); ?>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<p class=\"media-widget-buttons\">\n\t\t\t\t<button type=\"button\" class=\"button edit-media selected\">\n\t\t\t\t\t<?php echo esc_html( $this->l10n['edit_media'] ); ?>\n\t\t\t\t</button>\n\t\t\t<?php if ( ! empty( $this->l10n['replace_media'] ) ) : ?>\n\t\t\t\t<button type=\"button\" class=\"button change-media select-media selected\">\n\t\t\t\t\t<?php echo esc_html( $this->l10n['replace_media'] ); ?>\n\t\t\t\t</button>\n\t\t\t<?php endif; ?>\n\t\t\t</p>\n\t\t\t<div class=\"media-widget-fields\">\n\t\t\t</div>\n\t\t</script>\n\t\t<?php\n\t}\n\n\t/**\n\t * Whether the widget has content to show.\n\t *\n\t * @since 4.8.0\n\t *\n\t * @param array $instance Widget instance props.\n\t * @return bool Whether widget has content.\n\t */\n\tprotected function has_content( $instance ) {\n\t\treturn ( $instance['attachment_id'] && 'attachment' === get_post_type( $instance['attachment_id'] ) ) || $instance['url'];\n\t}\n}\n", "num_lines": 453}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Meta class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement a Meta widget.\n *\n * Displays log in/out, RSS feed links, etc.\n *\n * @since 2.8.0\n *\n * @see WP_Widget\n */\nclass WP_Widget_Meta extends WP_Widget {\n\n\t/**\n\t * Sets up a new Meta widget instance.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'                   => 'widget_meta',\n\t\t\t'description'                 => __( 'Login, RSS, &amp; WordPress.org links.' ),\n\t\t\t'customize_selective_refresh' => true,\n\t\t);\n\t\tparent::__construct( 'meta', __( 'Meta' ), $widget_ops );\n\t}\n\n\t/**\n\t * Outputs the content for the current Meta widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $args     Display arguments including 'before_title', 'after_title',\n\t *                        'before_widget', and 'after_widget'.\n\t * @param array $instance Settings for the current Meta widget instance.\n\t */\n\tpublic function widget( $args, $instance ) {\n\t\t$default_title = __( 'Meta' );\n\t\t$title         = ! empty( $instance['title'] ) ? $instance['title'] : $default_title;\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */\n\t\t$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );\n\n\t\techo $args['before_widget'];\n\n\t\tif ( $title ) {\n\t\t\techo $args['before_title'] . $title . $args['after_title'];\n\t\t}\n\n\t\t$format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-nav-menu-widget.php */\n\t\t$format = apply_filters( 'navigation_widgets_format', $format );\n\n\t\tif ( 'html5' === $format ) {\n\t\t\t// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.\n\t\t\t$title      = trim( strip_tags( $title ) );\n\t\t\t$aria_label = $title ? $title : $default_title;\n\t\t\techo '<nav role=\"navigation\" aria-label=\"' . esc_attr( $aria_label ) . '\">';\n\t\t}\n\t\t?>\n\n\t\t<ul>\n\t\t\t<?php wp_register(); ?>\n\t\t\t<li><?php wp_loginout(); ?></li>\n\t\t\t<li><a href=\"<?php echo esc_url( get_bloginfo( 'rss2_url' ) ); ?>\"><?php _e( 'Entries feed' ); ?></a></li>\n\t\t\t<li><a href=\"<?php echo esc_url( get_bloginfo( 'comments_rss2_url' ) ); ?>\"><?php _e( 'Comments feed' ); ?></a></li>\n\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * Filters the \"WordPress.org\" list item HTML in the Meta widget.\n\t\t\t *\n\t\t\t * @since 3.6.0\n\t\t\t * @since 4.9.0 Added the `$instance` parameter.\n\t\t\t *\n\t\t\t * @param string $html     Default HTML for the WordPress.org list item.\n\t\t\t * @param array  $instance Array of settings for the current widget.\n\t\t\t */\n\t\t\techo apply_filters(\n\t\t\t\t'widget_meta_poweredby',\n\t\t\t\tsprintf(\n\t\t\t\t\t'<li><a href=\"%1$s\">%2$s</a></li>',\n\t\t\t\t\tesc_url( __( 'https://wordpress.org/' ) ),\n\t\t\t\t\t__( 'WordPress.org' )\n\t\t\t\t),\n\t\t\t\t$instance\n\t\t\t);\n\n\t\t\twp_meta();\n\t\t\t?>\n\n\t\t</ul>\n\n\t\t<?php\n\t\tif ( 'html5' === $format ) {\n\t\t\techo '</nav>';\n\t\t}\n\n\t\techo $args['after_widget'];\n\t}\n\n\t/**\n\t * Handles updating settings for the current Meta widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $new_instance New settings for this instance as input by the user via\n\t *                            WP_Widget::form().\n\t * @param array $old_instance Old settings for this instance.\n\t * @return array Updated settings to save.\n\t */\n\tpublic function update( $new_instance, $old_instance ) {\n\t\t$instance          = $old_instance;\n\t\t$instance['title'] = sanitize_text_field( $new_instance['title'] );\n\n\t\treturn $instance;\n\t}\n\n\t/**\n\t * Outputs the settings form for the Meta widget.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $instance Current settings.\n\t */\n\tpublic function form( $instance ) {\n\t\t$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );\n\t\t?>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e( 'Title:' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $instance['title'] ); ?>\" />\n\t\t</p>\n\t\t<?php\n\t}\n}\n", "num_lines": 143}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Pages class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement a Pages widget.\n *\n * @since 2.8.0\n *\n * @see WP_Widget\n */\nclass WP_Widget_Pages extends WP_Widget {\n\n\t/**\n\t * Sets up a new Pages widget instance.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'                   => 'widget_pages',\n\t\t\t'description'                 => __( 'A list of your site&#8217;s Pages.' ),\n\t\t\t'customize_selective_refresh' => true,\n\t\t);\n\t\tparent::__construct( 'pages', __( 'Pages' ), $widget_ops );\n\t}\n\n\t/**\n\t * Outputs the content for the current Pages widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $args     Display arguments including 'before_title', 'after_title',\n\t *                        'before_widget', and 'after_widget'.\n\t * @param array $instance Settings for the current Pages widget instance.\n\t */\n\tpublic function widget( $args, $instance ) {\n\t\t$default_title = __( 'Pages' );\n\t\t$title         = ! empty( $instance['title'] ) ? $instance['title'] : $default_title;\n\n\t\t/**\n\t\t * Filters the widget title.\n\t\t *\n\t\t * @since 2.6.0\n\t\t *\n\t\t * @param string $title    The widget title. Default 'Pages'.\n\t\t * @param array  $instance Array of settings for the current widget.\n\t\t * @param mixed  $id_base  The widget ID.\n\t\t */\n\t\t$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );\n\n\t\t$sortby  = empty( $instance['sortby'] ) ? 'menu_order' : $instance['sortby'];\n\t\t$exclude = empty( $instance['exclude'] ) ? '' : $instance['exclude'];\n\n\t\tif ( 'menu_order' === $sortby ) {\n\t\t\t$sortby = 'menu_order, post_title';\n\t\t}\n\n\t\t$out = wp_list_pages(\n\t\t\t/**\n\t\t\t * Filters the arguments for the Pages widget.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t * @since 4.9.0 Added the `$instance` parameter.\n\t\t\t *\n\t\t\t * @see wp_list_pages()\n\t\t\t *\n\t\t\t * @param array $args     An array of arguments to retrieve the pages list.\n\t\t\t * @param array $instance Array of settings for the current widget.\n\t\t\t */\n\t\t\tapply_filters(\n\t\t\t\t'widget_pages_args',\n\t\t\t\tarray(\n\t\t\t\t\t'title_li'    => '',\n\t\t\t\t\t'echo'        => 0,\n\t\t\t\t\t'sort_column' => $sortby,\n\t\t\t\t\t'exclude'     => $exclude,\n\t\t\t\t),\n\t\t\t\t$instance\n\t\t\t)\n\t\t);\n\n\t\tif ( ! empty( $out ) ) {\n\t\t\techo $args['before_widget'];\n\t\t\tif ( $title ) {\n\t\t\t\techo $args['before_title'] . $title . $args['after_title'];\n\t\t\t}\n\n\t\t\t$format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';\n\n\t\t\t/** This filter is documented in wp-includes/widgets/class-wp-nav-menu-widget.php */\n\t\t\t$format = apply_filters( 'navigation_widgets_format', $format );\n\n\t\t\tif ( 'html5' === $format ) {\n\t\t\t\t// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.\n\t\t\t\t$title      = trim( strip_tags( $title ) );\n\t\t\t\t$aria_label = $title ? $title : $default_title;\n\t\t\t\techo '<nav role=\"navigation\" aria-label=\"' . esc_attr( $aria_label ) . '\">';\n\t\t\t}\n\t\t\t?>\n\n\t\t\t<ul>\n\t\t\t\t<?php echo $out; ?>\n\t\t\t</ul>\n\n\t\t\t<?php\n\t\t\tif ( 'html5' === $format ) {\n\t\t\t\techo '</nav>';\n\t\t\t}\n\n\t\t\techo $args['after_widget'];\n\t\t}\n\t}\n\n\t/**\n\t * Handles updating settings for the current Pages widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $new_instance New settings for this instance as input by the user via\n\t *                            WP_Widget::form().\n\t * @param array $old_instance Old settings for this instance.\n\t * @return array Updated settings to save.\n\t */\n\tpublic function update( $new_instance, $old_instance ) {\n\t\t$instance          = $old_instance;\n\t\t$instance['title'] = sanitize_text_field( $new_instance['title'] );\n\t\tif ( in_array( $new_instance['sortby'], array( 'post_title', 'menu_order', 'ID' ), true ) ) {\n\t\t\t$instance['sortby'] = $new_instance['sortby'];\n\t\t} else {\n\t\t\t$instance['sortby'] = 'menu_order';\n\t\t}\n\n\t\t$instance['exclude'] = sanitize_text_field( $new_instance['exclude'] );\n\n\t\treturn $instance;\n\t}\n\n\t/**\n\t * Outputs the settings form for the Pages widget.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $instance Current settings.\n\t */\n\tpublic function form( $instance ) {\n\t\t// Defaults.\n\t\t$instance = wp_parse_args(\n\t\t\t(array) $instance,\n\t\t\tarray(\n\t\t\t\t'sortby'  => 'post_title',\n\t\t\t\t'title'   => '',\n\t\t\t\t'exclude' => '',\n\t\t\t)\n\t\t);\n\t\t?>\n\t\t<p>\n\t\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\"><?php _e( 'Title:' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $instance['title'] ); ?>\" />\n\t\t</p>\n\n\t\t<p>\n\t\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'sortby' ) ); ?>\"><?php _e( 'Sort by:' ); ?></label>\n\t\t\t<select name=\"<?php echo esc_attr( $this->get_field_name( 'sortby' ) ); ?>\" id=\"<?php echo esc_attr( $this->get_field_id( 'sortby' ) ); ?>\" class=\"widefat\">\n\t\t\t\t<option value=\"post_title\"<?php selected( $instance['sortby'], 'post_title' ); ?>><?php _e( 'Page title' ); ?></option>\n\t\t\t\t<option value=\"menu_order\"<?php selected( $instance['sortby'], 'menu_order' ); ?>><?php _e( 'Page order' ); ?></option>\n\t\t\t\t<option value=\"ID\"<?php selected( $instance['sortby'], 'ID' ); ?>><?php _e( 'Page ID' ); ?></option>\n\t\t\t</select>\n\t\t</p>\n\n\t\t<p>\n\t\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'exclude' ) ); ?>\"><?php _e( 'Exclude:' ); ?></label>\n\t\t\t<input type=\"text\" value=\"<?php echo esc_attr( $instance['exclude'] ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'exclude' ) ); ?>\" id=\"<?php echo esc_attr( $this->get_field_id( 'exclude' ) ); ?>\" class=\"widefat\" />\n\t\t\t<br />\n\t\t\t<small><?php _e( 'Page IDs, separated by commas.' ); ?></small>\n\t\t</p>\n\t\t<?php\n\t}\n\n}\n", "num_lines": 186}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Recent_Comments class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement a Recent Comments widget.\n *\n * @since 2.8.0\n *\n * @see WP_Widget\n */\nclass WP_Widget_Recent_Comments extends WP_Widget {\n\n\t/**\n\t * Sets up a new Recent Comments widget instance.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'                   => 'widget_recent_comments',\n\t\t\t'description'                 => __( 'Your site&#8217;s most recent comments.' ),\n\t\t\t'customize_selective_refresh' => true,\n\t\t);\n\t\tparent::__construct( 'recent-comments', __( 'Recent Comments' ), $widget_ops );\n\t\t$this->alt_option_name = 'widget_recent_comments';\n\n\t\tif ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() ) {\n\t\t\tadd_action( 'wp_head', array( $this, 'recent_comments_style' ) );\n\t\t}\n\t}\n\n\t/**\n\t * Outputs the default styles for the Recent Comments widget.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function recent_comments_style() {\n\t\t/**\n\t\t * Filters the Recent Comments default widget styles.\n\t\t *\n\t\t * @since 3.1.0\n\t\t *\n\t\t * @param bool   $active  Whether the widget is active. Default true.\n\t\t * @param string $id_base The widget ID.\n\t\t */\n\t\tif ( ! current_theme_supports( 'widgets' ) // Temp hack #14876.\n\t\t\t|| ! apply_filters( 'show_recent_comments_widget_style', true, $this->id_base ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type=\"text/css\"';\n\n\t\tprintf(\n\t\t\t'<style%s>.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>',\n\t\t\t$type_attr\n\t\t);\n\t}\n\n\t/**\n\t * Outputs the content for the current Recent Comments widget instance.\n\t *\n\t * @since 2.8.0\n\t * @since 5.4.0 Creates a unique HTML ID for the `<ul>` element\n\t *              if more than one instance is displayed on the page.\n\t *\n\t * @param array $args     Display arguments including 'before_title', 'after_title',\n\t *                        'before_widget', and 'after_widget'.\n\t * @param array $instance Settings for the current Recent Comments widget instance.\n\t */\n\tpublic function widget( $args, $instance ) {\n\t\tstatic $first_instance = true;\n\n\t\tif ( ! isset( $args['widget_id'] ) ) {\n\t\t\t$args['widget_id'] = $this->id;\n\t\t}\n\n\t\t$output = '';\n\n\t\t$default_title = __( 'Recent Comments' );\n\t\t$title         = ( ! empty( $instance['title'] ) ) ? $instance['title'] : $default_title;\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */\n\t\t$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );\n\n\t\t$number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5;\n\t\tif ( ! $number ) {\n\t\t\t$number = 5;\n\t\t}\n\n\t\t$comments = get_comments(\n\t\t\t/**\n\t\t\t * Filters the arguments for the Recent Comments widget.\n\t\t\t *\n\t\t\t * @since 3.4.0\n\t\t\t * @since 4.9.0 Added the `$instance` parameter.\n\t\t\t *\n\t\t\t * @see WP_Comment_Query::query() for information on accepted arguments.\n\t\t\t *\n\t\t\t * @param array $comment_args An array of arguments used to retrieve the recent comments.\n\t\t\t * @param array $instance     Array of settings for the current widget.\n\t\t\t */\n\t\t\tapply_filters(\n\t\t\t\t'widget_comments_args',\n\t\t\t\tarray(\n\t\t\t\t\t'number'      => $number,\n\t\t\t\t\t'status'      => 'approve',\n\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t),\n\t\t\t\t$instance\n\t\t\t)\n\t\t);\n\n\t\t$output .= $args['before_widget'];\n\t\tif ( $title ) {\n\t\t\t$output .= $args['before_title'] . $title . $args['after_title'];\n\t\t}\n\n\t\t$recent_comments_id = ( $first_instance ) ? 'recentcomments' : \"recentcomments-{$this->number}\";\n\t\t$first_instance     = false;\n\n\t\t$format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-nav-menu-widget.php */\n\t\t$format = apply_filters( 'navigation_widgets_format', $format );\n\n\t\tif ( 'html5' === $format ) {\n\t\t\t// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.\n\t\t\t$title      = trim( strip_tags( $title ) );\n\t\t\t$aria_label = $title ? $title : $default_title;\n\t\t\t$output    .= '<nav role=\"navigation\" aria-label=\"' . esc_attr( $aria_label ) . '\">';\n\t\t}\n\n\t\t$output .= '<ul id=\"' . esc_attr( $recent_comments_id ) . '\">';\n\t\tif ( is_array( $comments ) && $comments ) {\n\t\t\t// Prime cache for associated posts. (Prime post term cache if we need it for permalinks.)\n\t\t\t$post_ids = array_unique( wp_list_pluck( $comments, 'comment_post_ID' ) );\n\t\t\t_prime_post_caches( $post_ids, strpos( get_option( 'permalink_structure' ), '%category%' ), false );\n\n\t\t\tforeach ( (array) $comments as $comment ) {\n\t\t\t\t$output .= '<li class=\"recentcomments\">';\n\t\t\t\t$output .= sprintf(\n\t\t\t\t\t/* translators: Comments widget. 1: Comment author, 2: Post link. */\n\t\t\t\t\t_x( '%1$s on %2$s', 'widgets' ),\n\t\t\t\t\t'<span class=\"comment-author-link\">' . get_comment_author_link( $comment ) . '</span>',\n\t\t\t\t\t'<a href=\"' . esc_url( get_comment_link( $comment ) ) . '\">' . get_the_title( $comment->comment_post_ID ) . '</a>'\n\t\t\t\t);\n\t\t\t\t$output .= '</li>';\n\t\t\t}\n\t\t}\n\t\t$output .= '</ul>';\n\n\t\tif ( 'html5' === $format ) {\n\t\t\t$output .= '</nav>';\n\t\t}\n\n\t\t$output .= $args['after_widget'];\n\n\t\techo $output;\n\t}\n\n\t/**\n\t * Handles updating settings for the current Recent Comments widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $new_instance New settings for this instance as input by the user via\n\t *                            WP_Widget::form().\n\t * @param array $old_instance Old settings for this instance.\n\t * @return array Updated settings to save.\n\t */\n\tpublic function update( $new_instance, $old_instance ) {\n\t\t$instance           = $old_instance;\n\t\t$instance['title']  = sanitize_text_field( $new_instance['title'] );\n\t\t$instance['number'] = absint( $new_instance['number'] );\n\t\treturn $instance;\n\t}\n\n\t/**\n\t * Outputs the settings form for the Recent Comments widget.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $instance Current settings.\n\t */\n\tpublic function form( $instance ) {\n\t\t$title  = isset( $instance['title'] ) ? $instance['title'] : '';\n\t\t$number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5;\n\t\t?>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e( 'Title:' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" />\n\t\t</p>\n\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'number' ); ?>\"><?php _e( 'Number of comments to show:' ); ?></label>\n\t\t\t<input class=\"tiny-text\" id=\"<?php echo $this->get_field_id( 'number' ); ?>\" name=\"<?php echo $this->get_field_name( 'number' ); ?>\" type=\"number\" step=\"1\" min=\"1\" value=\"<?php echo $number; ?>\" size=\"3\" />\n\t\t</p>\n\t\t<?php\n\t}\n\n\t/**\n\t * Flushes the Recent Comments widget cache.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @deprecated 4.4.0 Fragment caching was removed in favor of split queries.\n\t */\n\tpublic function flush_widget_cache() {\n\t\t_deprecated_function( __METHOD__, '4.4.0' );\n\t}\n}\n", "num_lines": 218}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Recent_Posts class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement a Recent Posts widget.\n *\n * @since 2.8.0\n *\n * @see WP_Widget\n */\nclass WP_Widget_Recent_Posts extends WP_Widget {\n\n\t/**\n\t * Sets up a new Recent Posts widget instance.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'                   => 'widget_recent_entries',\n\t\t\t'description'                 => __( 'Your site&#8217;s most recent Posts.' ),\n\t\t\t'customize_selective_refresh' => true,\n\t\t);\n\t\tparent::__construct( 'recent-posts', __( 'Recent Posts' ), $widget_ops );\n\t\t$this->alt_option_name = 'widget_recent_entries';\n\t}\n\n\t/**\n\t * Outputs the content for the current Recent Posts widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $args     Display arguments including 'before_title', 'after_title',\n\t *                        'before_widget', and 'after_widget'.\n\t * @param array $instance Settings for the current Recent Posts widget instance.\n\t */\n\tpublic function widget( $args, $instance ) {\n\t\tif ( ! isset( $args['widget_id'] ) ) {\n\t\t\t$args['widget_id'] = $this->id;\n\t\t}\n\n\t\t$default_title = __( 'Recent Posts' );\n\t\t$title         = ( ! empty( $instance['title'] ) ) ? $instance['title'] : $default_title;\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */\n\t\t$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );\n\n\t\t$number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5;\n\t\tif ( ! $number ) {\n\t\t\t$number = 5;\n\t\t}\n\t\t$show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false;\n\n\t\t$r = new WP_Query(\n\t\t\t/**\n\t\t\t * Filters the arguments for the Recent Posts widget.\n\t\t\t *\n\t\t\t * @since 3.4.0\n\t\t\t * @since 4.9.0 Added the `$instance` parameter.\n\t\t\t *\n\t\t\t * @see WP_Query::get_posts()\n\t\t\t *\n\t\t\t * @param array $args     An array of arguments used to retrieve the recent posts.\n\t\t\t * @param array $instance Array of settings for the current widget.\n\t\t\t */\n\t\t\tapply_filters(\n\t\t\t\t'widget_posts_args',\n\t\t\t\tarray(\n\t\t\t\t\t'posts_per_page'      => $number,\n\t\t\t\t\t'no_found_rows'       => true,\n\t\t\t\t\t'post_status'         => 'publish',\n\t\t\t\t\t'ignore_sticky_posts' => true,\n\t\t\t\t),\n\t\t\t\t$instance\n\t\t\t)\n\t\t);\n\n\t\tif ( ! $r->have_posts() ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\n\t\t<?php echo $args['before_widget']; ?>\n\n\t\t<?php\n\t\tif ( $title ) {\n\t\t\techo $args['before_title'] . $title . $args['after_title'];\n\t\t}\n\n\t\t$format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-nav-menu-widget.php */\n\t\t$format = apply_filters( 'navigation_widgets_format', $format );\n\n\t\tif ( 'html5' === $format ) {\n\t\t\t// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.\n\t\t\t$title      = trim( strip_tags( $title ) );\n\t\t\t$aria_label = $title ? $title : $default_title;\n\t\t\techo '<nav role=\"navigation\" aria-label=\"' . esc_attr( $aria_label ) . '\">';\n\t\t}\n\t\t?>\n\n\t\t<ul>\n\t\t\t<?php foreach ( $r->posts as $recent_post ) : ?>\n\t\t\t\t<?php\n\t\t\t\t$post_title   = get_the_title( $recent_post->ID );\n\t\t\t\t$title        = ( ! empty( $post_title ) ) ? $post_title : __( '(no title)' );\n\t\t\t\t$aria_current = '';\n\n\t\t\t\tif ( get_queried_object_id() === $recent_post->ID ) {\n\t\t\t\t\t$aria_current = ' aria-current=\"page\"';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<li>\n\t\t\t\t\t<a href=\"<?php the_permalink( $recent_post->ID ); ?>\"<?php echo $aria_current; ?>><?php echo $title; ?></a>\n\t\t\t\t\t<?php if ( $show_date ) : ?>\n\t\t\t\t\t\t<span class=\"post-date\"><?php echo get_the_date( '', $recent_post->ID ); ?></span>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t</li>\n\t\t\t<?php endforeach; ?>\n\t\t</ul>\n\n\t\t<?php\n\t\tif ( 'html5' === $format ) {\n\t\t\techo '</nav>';\n\t\t}\n\n\t\techo $args['after_widget'];\n\t}\n\n\t/**\n\t * Handles updating the settings for the current Recent Posts widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $new_instance New settings for this instance as input by the user via\n\t *                            WP_Widget::form().\n\t * @param array $old_instance Old settings for this instance.\n\t * @return array Updated settings to save.\n\t */\n\tpublic function update( $new_instance, $old_instance ) {\n\t\t$instance              = $old_instance;\n\t\t$instance['title']     = sanitize_text_field( $new_instance['title'] );\n\t\t$instance['number']    = (int) $new_instance['number'];\n\t\t$instance['show_date'] = isset( $new_instance['show_date'] ) ? (bool) $new_instance['show_date'] : false;\n\t\treturn $instance;\n\t}\n\n\t/**\n\t * Outputs the settings form for the Recent Posts widget.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $instance Current settings.\n\t */\n\tpublic function form( $instance ) {\n\t\t$title     = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';\n\t\t$number    = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5;\n\t\t$show_date = isset( $instance['show_date'] ) ? (bool) $instance['show_date'] : false;\n\t\t?>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e( 'Title:' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" type=\"text\" value=\"<?php echo $title; ?>\" />\n\t\t</p>\n\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'number' ); ?>\"><?php _e( 'Number of posts to show:' ); ?></label>\n\t\t\t<input class=\"tiny-text\" id=\"<?php echo $this->get_field_id( 'number' ); ?>\" name=\"<?php echo $this->get_field_name( 'number' ); ?>\" type=\"number\" step=\"1\" min=\"1\" value=\"<?php echo $number; ?>\" size=\"3\" />\n\t\t</p>\n\n\t\t<p>\n\t\t\t<input class=\"checkbox\" type=\"checkbox\"<?php checked( $show_date ); ?> id=\"<?php echo $this->get_field_id( 'show_date' ); ?>\" name=\"<?php echo $this->get_field_name( 'show_date' ); ?>\" />\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'show_date' ); ?>\"><?php _e( 'Display post date?' ); ?></label>\n\t\t</p>\n\t\t<?php\n\t}\n}\n", "num_lines": 184}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_RSS class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement a RSS widget.\n *\n * @since 2.8.0\n *\n * @see WP_Widget\n */\nclass WP_Widget_RSS extends WP_Widget {\n\n\t/**\n\t * Sets up a new RSS widget instance.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function __construct() {\n\t\t$widget_ops  = array(\n\t\t\t'description'                 => __( 'Entries from any RSS or Atom feed.' ),\n\t\t\t'customize_selective_refresh' => true,\n\t\t);\n\t\t$control_ops = array(\n\t\t\t'width'  => 400,\n\t\t\t'height' => 200,\n\t\t);\n\t\tparent::__construct( 'rss', __( 'RSS' ), $widget_ops, $control_ops );\n\t}\n\n\t/**\n\t * Outputs the content for the current RSS widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $args     Display arguments including 'before_title', 'after_title',\n\t *                        'before_widget', and 'after_widget'.\n\t * @param array $instance Settings for the current RSS widget instance.\n\t */\n\tpublic function widget( $args, $instance ) {\n\t\tif ( isset( $instance['error'] ) && $instance['error'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$url = ! empty( $instance['url'] ) ? $instance['url'] : '';\n\t\twhile ( stristr( $url, 'http' ) !== $url ) {\n\t\t\t$url = substr( $url, 1 );\n\t\t}\n\n\t\tif ( empty( $url ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Self-URL destruction sequence.\n\t\tif ( in_array( untrailingslashit( $url ), array( site_url(), home_url() ), true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$rss   = fetch_feed( $url );\n\t\t$title = $instance['title'];\n\t\t$desc  = '';\n\t\t$link  = '';\n\n\t\tif ( ! is_wp_error( $rss ) ) {\n\t\t\t$desc = esc_attr( strip_tags( html_entity_decode( $rss->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) ) ) );\n\t\t\tif ( empty( $title ) ) {\n\t\t\t\t$title = strip_tags( $rss->get_title() );\n\t\t\t}\n\t\t\t$link = strip_tags( $rss->get_permalink() );\n\t\t\twhile ( stristr( $link, 'http' ) !== $link ) {\n\t\t\t\t$link = substr( $link, 1 );\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $title ) ) {\n\t\t\t$title = ! empty( $desc ) ? $desc : __( 'Unknown Feed' );\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */\n\t\t$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );\n\n\t\t$url  = strip_tags( $url );\n\t\t$icon = includes_url( 'images/rss.png' );\n\t\tif ( $title ) {\n\t\t\t$title = '<a class=\"rsswidget\" href=\"' . esc_url( $url ) . '\"><img class=\"rss-widget-icon\" style=\"border:0\" width=\"14\" height=\"14\" src=\"' . esc_url( $icon ) . '\" alt=\"RSS\" /></a> <a class=\"rsswidget\" href=\"' . esc_url( $link ) . '\">' . esc_html( $title ) . '</a>';\n\t\t}\n\n\t\techo $args['before_widget'];\n\t\tif ( $title ) {\n\t\t\techo $args['before_title'] . $title . $args['after_title'];\n\t\t}\n\n\t\t$format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-nav-menu-widget.php */\n\t\t$format = apply_filters( 'navigation_widgets_format', $format );\n\n\t\tif ( 'html5' === $format ) {\n\t\t\t// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.\n\t\t\t$title      = trim( strip_tags( $title ) );\n\t\t\t$aria_label = $title ? $title : __( 'RSS Feed' );\n\t\t\techo '<nav role=\"navigation\" aria-label=\"' . esc_attr( $aria_label ) . '\">';\n\t\t}\n\n\t\twp_widget_rss_output( $rss, $instance );\n\n\t\tif ( 'html5' === $format ) {\n\t\t\techo '</nav>';\n\t\t}\n\n\t\techo $args['after_widget'];\n\n\t\tif ( ! is_wp_error( $rss ) ) {\n\t\t\t$rss->__destruct();\n\t\t}\n\t\tunset( $rss );\n\t}\n\n\t/**\n\t * Handles updating settings for the current RSS widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $new_instance New settings for this instance as input by the user via\n\t *                            WP_Widget::form().\n\t * @param array $old_instance Old settings for this instance.\n\t * @return array Updated settings to save.\n\t */\n\tpublic function update( $new_instance, $old_instance ) {\n\t\t$testurl = ( isset( $new_instance['url'] ) && ( ! isset( $old_instance['url'] ) || ( $new_instance['url'] !== $old_instance['url'] ) ) );\n\t\treturn wp_widget_rss_process( $new_instance, $testurl );\n\t}\n\n\t/**\n\t * Outputs the settings form for the RSS widget.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $instance Current settings.\n\t */\n\tpublic function form( $instance ) {\n\t\tif ( empty( $instance ) ) {\n\t\t\t$instance = array(\n\t\t\t\t'title'        => '',\n\t\t\t\t'url'          => '',\n\t\t\t\t'items'        => 10,\n\t\t\t\t'error'        => false,\n\t\t\t\t'show_summary' => 0,\n\t\t\t\t'show_author'  => 0,\n\t\t\t\t'show_date'    => 0,\n\t\t\t);\n\t\t}\n\t\t$instance['number'] = $this->number;\n\n\t\twp_widget_rss_form( $instance );\n\t}\n}\n", "num_lines": 163}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Search class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement a Search widget.\n *\n * @since 2.8.0\n *\n * @see WP_Widget\n */\nclass WP_Widget_Search extends WP_Widget {\n\n\t/**\n\t * Sets up a new Search widget instance.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function __construct() {\n\t\t$widget_ops = array(\n\t\t\t'classname'                   => 'widget_search',\n\t\t\t'description'                 => __( 'A search form for your site.' ),\n\t\t\t'customize_selective_refresh' => true,\n\t\t);\n\t\tparent::__construct( 'search', _x( 'Search', 'Search widget' ), $widget_ops );\n\t}\n\n\t/**\n\t * Outputs the content for the current Search widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $args     Display arguments including 'before_title', 'after_title',\n\t *                        'before_widget', and 'after_widget'.\n\t * @param array $instance Settings for the current Search widget instance.\n\t */\n\tpublic function widget( $args, $instance ) {\n\t\t$title = ! empty( $instance['title'] ) ? $instance['title'] : '';\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */\n\t\t$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );\n\n\t\techo $args['before_widget'];\n\t\tif ( $title ) {\n\t\t\techo $args['before_title'] . $title . $args['after_title'];\n\t\t}\n\n\t\t// Use current theme search form if it exists.\n\t\tget_search_form();\n\n\t\techo $args['after_widget'];\n\t}\n\n\t/**\n\t * Outputs the settings form for the Search widget.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $instance Current settings.\n\t */\n\tpublic function form( $instance ) {\n\t\t$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );\n\t\t$title    = $instance['title'];\n\t\t?>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e( 'Title:' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" />\n\t\t</p>\n\t\t<?php\n\t}\n\n\t/**\n\t * Handles updating settings for the current Search widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $new_instance New settings for this instance as input by the user via\n\t *                            WP_Widget::form().\n\t * @param array $old_instance Old settings for this instance.\n\t * @return array Updated settings.\n\t */\n\tpublic function update( $new_instance, $old_instance ) {\n\t\t$instance          = $old_instance;\n\t\t$new_instance      = wp_parse_args( (array) $new_instance, array( 'title' => '' ) );\n\t\t$instance['title'] = sanitize_text_field( $new_instance['title'] );\n\t\treturn $instance;\n\t}\n\n}\n", "num_lines": 95}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Tag_Cloud class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement a Tag cloud widget.\n *\n * @since 2.8.0\n *\n * @see WP_Widget\n */\nclass WP_Widget_Tag_Cloud extends WP_Widget {\n\n\t/**\n\t * Sets up a new Tag Cloud widget instance.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function __construct() {\n\t\t$widget_ops = array(\n\t\t\t'description'                 => __( 'A cloud of your most used tags.' ),\n\t\t\t'customize_selective_refresh' => true,\n\t\t);\n\t\tparent::__construct( 'tag_cloud', __( 'Tag Cloud' ), $widget_ops );\n\t}\n\n\t/**\n\t * Outputs the content for the current Tag Cloud widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $args     Display arguments including 'before_title', 'after_title',\n\t *                        'before_widget', and 'after_widget'.\n\t * @param array $instance Settings for the current Tag Cloud widget instance.\n\t */\n\tpublic function widget( $args, $instance ) {\n\t\t$current_taxonomy = $this->_get_current_taxonomy( $instance );\n\n\t\tif ( ! empty( $instance['title'] ) ) {\n\t\t\t$title = $instance['title'];\n\t\t} else {\n\t\t\tif ( 'post_tag' === $current_taxonomy ) {\n\t\t\t\t$title = __( 'Tags' );\n\t\t\t} else {\n\t\t\t\t$tax   = get_taxonomy( $current_taxonomy );\n\t\t\t\t$title = $tax->labels->name;\n\t\t\t}\n\t\t}\n\n\t\t$show_count = ! empty( $instance['count'] );\n\n\t\t$tag_cloud = wp_tag_cloud(\n\t\t\t/**\n\t\t\t * Filters the taxonomy used in the Tag Cloud widget.\n\t\t\t *\n\t\t\t * @since 2.8.0\n\t\t\t * @since 3.0.0 Added taxonomy drop-down.\n\t\t\t * @since 4.9.0 Added the `$instance` parameter.\n\t\t\t *\n\t\t\t * @see wp_tag_cloud()\n\t\t\t *\n\t\t\t * @param array $args     Args used for the tag cloud widget.\n\t\t\t * @param array $instance Array of settings for the current widget.\n\t\t\t */\n\t\t\tapply_filters(\n\t\t\t\t'widget_tag_cloud_args',\n\t\t\t\tarray(\n\t\t\t\t\t'taxonomy'   => $current_taxonomy,\n\t\t\t\t\t'echo'       => false,\n\t\t\t\t\t'show_count' => $show_count,\n\t\t\t\t),\n\t\t\t\t$instance\n\t\t\t)\n\t\t);\n\n\t\tif ( empty( $tag_cloud ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */\n\t\t$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );\n\n\t\techo $args['before_widget'];\n\t\tif ( $title ) {\n\t\t\techo $args['before_title'] . $title . $args['after_title'];\n\t\t}\n\n\t\techo '<div class=\"tagcloud\">';\n\n\t\techo $tag_cloud;\n\n\t\techo \"</div>\\n\";\n\t\techo $args['after_widget'];\n\t}\n\n\t/**\n\t * Handles updating settings for the current Tag Cloud widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $new_instance New settings for this instance as input by the user via\n\t *                            WP_Widget::form().\n\t * @param array $old_instance Old settings for this instance.\n\t * @return array Settings to save or bool false to cancel saving.\n\t */\n\tpublic function update( $new_instance, $old_instance ) {\n\t\t$instance             = array();\n\t\t$instance['title']    = sanitize_text_field( $new_instance['title'] );\n\t\t$instance['count']    = ! empty( $new_instance['count'] ) ? 1 : 0;\n\t\t$instance['taxonomy'] = stripslashes( $new_instance['taxonomy'] );\n\t\treturn $instance;\n\t}\n\n\t/**\n\t * Outputs the Tag Cloud widget settings form.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $instance Current settings.\n\t */\n\tpublic function form( $instance ) {\n\t\t$title = ! empty( $instance['title'] ) ? $instance['title'] : '';\n\t\t$count = isset( $instance['count'] ) ? (bool) $instance['count'] : false;\n\t\t?>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e( 'Title:' ); ?></label>\n\t\t\t<input type=\"text\" class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" value=\"<?php echo esc_attr( $title ); ?>\" />\n\t\t</p>\n\t\t<?php\n\t\t$taxonomies       = get_taxonomies( array( 'show_tagcloud' => true ), 'object' );\n\t\t$current_taxonomy = $this->_get_current_taxonomy( $instance );\n\n\t\tswitch ( count( $taxonomies ) ) {\n\n\t\t\t// No tag cloud supporting taxonomies found, display error message.\n\t\t\tcase 0:\n\t\t\t\t?>\n\t\t\t\t<input type=\"hidden\" id=\"<?php echo $this->get_field_id( 'taxonomy' ); ?>\" name=\"<?php echo $this->get_field_name( 'taxonomy' ); ?>\" value=\"\" />\n\t\t\t\t<p>\n\t\t\t\t\t<?php _e( 'The tag cloud will not be displayed since there are no taxonomies that support the tag cloud widget.' ); ?>\n\t\t\t\t</p>\n\t\t\t\t<?php\n\t\t\t\tbreak;\n\n\t\t\t// Just a single tag cloud supporting taxonomy found, no need to display a select.\n\t\t\tcase 1:\n\t\t\t\t$keys     = array_keys( $taxonomies );\n\t\t\t\t$taxonomy = reset( $keys );\n\t\t\t\t?>\n\t\t\t\t<input type=\"hidden\" id=\"<?php echo $this->get_field_id( 'taxonomy' ); ?>\" name=\"<?php echo $this->get_field_name( 'taxonomy' ); ?>\" value=\"<?php echo esc_attr( $taxonomy ); ?>\" />\n\t\t\t\t<?php\n\t\t\t\tbreak;\n\n\t\t\t// More than one tag cloud supporting taxonomy found, display a select.\n\t\t\tdefault:\n\t\t\t\t?>\n\t\t\t\t<p>\n\t\t\t\t\t<label for=\"<?php echo $this->get_field_id( 'taxonomy' ); ?>\"><?php _e( 'Taxonomy:' ); ?></label>\n\t\t\t\t\t<select class=\"widefat\" id=\"<?php echo $this->get_field_id( 'taxonomy' ); ?>\" name=\"<?php echo $this->get_field_name( 'taxonomy' ); ?>\">\n\t\t\t\t\t<?php foreach ( $taxonomies as $taxonomy => $tax ) : ?>\n\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $taxonomy ); ?>\" <?php selected( $taxonomy, $current_taxonomy ); ?>>\n\t\t\t\t\t\t\t<?php echo esc_html( $tax->labels->name ); ?>\n\t\t\t\t\t\t</option>\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t</select>\n\t\t\t\t</p>\n\t\t\t\t<?php\n\t\t}\n\n\t\tif ( count( $taxonomies ) > 0 ) {\n\t\t\t?>\n\t\t\t<p>\n\t\t\t\t<input type=\"checkbox\" class=\"checkbox\" id=\"<?php echo $this->get_field_id( 'count' ); ?>\" name=\"<?php echo $this->get_field_name( 'count' ); ?>\" <?php checked( $count, true ); ?> />\n\t\t\t\t<label for=\"<?php echo $this->get_field_id( 'count' ); ?>\"><?php _e( 'Show tag counts' ); ?></label>\n\t\t\t</p>\n\t\t\t<?php\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the taxonomy for the current Tag cloud widget instance.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param array $instance Current settings.\n\t * @return string Name of the current taxonomy if set, otherwise 'post_tag'.\n\t */\n\tpublic function _get_current_taxonomy( $instance ) {\n\t\tif ( ! empty( $instance['taxonomy'] ) && taxonomy_exists( $instance['taxonomy'] ) ) {\n\t\t\treturn $instance['taxonomy'];\n\t\t}\n\n\t\treturn 'post_tag';\n\t}\n}\n", "num_lines": 201}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n/**\n * Widget API: WP_Widget_Text class\n *\n * @package WordPress\n * @subpackage Widgets\n * @since 4.4.0\n */\n\n/**\n * Core class used to implement a Text widget.\n *\n * @since 2.8.0\n *\n * @see WP_Widget\n */\nclass WP_Widget_Text extends WP_Widget {\n\n\t/**\n\t * Whether or not the widget has been registered yet.\n\t *\n\t * @since 4.8.1\n\t * @var bool\n\t */\n\tprotected $registered = false;\n\n\t/**\n\t * Sets up a new Text widget instance.\n\t *\n\t * @since 2.8.0\n\t */\n\tpublic function __construct() {\n\t\t$widget_ops  = array(\n\t\t\t'classname'                   => 'widget_text',\n\t\t\t'description'                 => __( 'Arbitrary text.' ),\n\t\t\t'customize_selective_refresh' => true,\n\t\t);\n\t\t$control_ops = array(\n\t\t\t'width'  => 400,\n\t\t\t'height' => 350,\n\t\t);\n\t\tparent::__construct( 'text', __( 'Text' ), $widget_ops, $control_ops );\n\t}\n\n\t/**\n\t * Add hooks for enqueueing assets when registering all widget instances of this widget class.\n\t *\n\t * @param integer $number Optional. The unique order number of this widget instance\n\t *                        compared to other instances of the same class. Default -1.\n\t */\n\tpublic function _register_one( $number = -1 ) {\n\t\tparent::_register_one( $number );\n\t\tif ( $this->registered ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->registered = true;\n\n\t\twp_add_inline_script( 'text-widgets', sprintf( 'wp.textWidgets.idBases.push( %s );', wp_json_encode( $this->id_base ) ) );\n\n\t\tif ( $this->is_preview() ) {\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_preview_scripts' ) );\n\t\t}\n\n\t\t// Note that the widgets component in the customizer will also do\n\t\t// the 'admin_print_scripts-widgets.php' action in WP_Customize_Widgets::print_scripts().\n\t\tadd_action( 'admin_print_scripts-widgets.php', array( $this, 'enqueue_admin_scripts' ) );\n\n\t\t// Note that the widgets component in the customizer will also do\n\t\t// the 'admin_footer-widgets.php' action in WP_Customize_Widgets::print_footer_scripts().\n\t\tadd_action( 'admin_footer-widgets.php', array( 'WP_Widget_Text', 'render_control_template_scripts' ) );\n\t}\n\n\t/**\n\t * Determines whether a given instance is legacy and should bypass using TinyMCE.\n\t *\n\t * @since 4.8.1\n\t *\n\t * @param array $instance {\n\t *     Instance data.\n\t *\n\t *     @type string      $text   Content.\n\t *     @type bool|string $filter Whether autop or content filters should apply.\n\t *     @type bool        $legacy Whether widget is in legacy mode.\n\t * }\n\t * @return bool Whether Text widget instance contains legacy data.\n\t */\n\tpublic function is_legacy_instance( $instance ) {\n\n\t\t// Legacy mode when not in visual mode.\n\t\tif ( isset( $instance['visual'] ) ) {\n\t\t\treturn ! $instance['visual'];\n\t\t}\n\n\t\t// Or, the widget has been added/updated in 4.8.0 then filter prop is 'content' and it is no longer legacy.\n\t\tif ( isset( $instance['filter'] ) && 'content' === $instance['filter'] ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If the text is empty, then nothing is preventing migration to TinyMCE.\n\t\tif ( empty( $instance['text'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$wpautop         = ! empty( $instance['filter'] );\n\t\t$has_line_breaks = ( false !== strpos( trim( $instance['text'] ), \"\\n\" ) );\n\n\t\t// If auto-paragraphs are not enabled and there are line breaks, then ensure legacy mode.\n\t\tif ( ! $wpautop && $has_line_breaks ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// If an HTML comment is present, assume legacy mode.\n\t\tif ( false !== strpos( $instance['text'], '<!--' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// In the rare case that DOMDocument is not available we cannot reliably sniff content and so we assume legacy.\n\t\tif ( ! class_exists( 'DOMDocument' ) ) {\n\t\t\t// @codeCoverageIgnoreStart\n\t\t\treturn true;\n\t\t\t// @codeCoverageIgnoreEnd\n\t\t}\n\n\t\t$doc = new DOMDocument();\n\n\t\t// Suppress warnings generated by loadHTML.\n\t\t$errors = libxml_use_internal_errors( true );\n\t\t// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged\n\t\t@$doc->loadHTML(\n\t\t\tsprintf(\n\t\t\t\t'<!DOCTYPE html><html><head><meta charset=\"%s\"></head><body>%s</body></html>',\n\t\t\t\tesc_attr( get_bloginfo( 'charset' ) ),\n\t\t\t\t$instance['text']\n\t\t\t)\n\t\t);\n\t\tlibxml_use_internal_errors( $errors );\n\n\t\t$body = $doc->getElementsByTagName( 'body' )->item( 0 );\n\n\t\t// See $allowedposttags.\n\t\t$safe_elements_attributes = array(\n\t\t\t'strong'  => array(),\n\t\t\t'em'      => array(),\n\t\t\t'b'       => array(),\n\t\t\t'i'       => array(),\n\t\t\t'u'       => array(),\n\t\t\t's'       => array(),\n\t\t\t'ul'      => array(),\n\t\t\t'ol'      => array(),\n\t\t\t'li'      => array(),\n\t\t\t'hr'      => array(),\n\t\t\t'abbr'    => array(),\n\t\t\t'acronym' => array(),\n\t\t\t'code'    => array(),\n\t\t\t'dfn'     => array(),\n\t\t\t'a'       => array(\n\t\t\t\t'href' => true,\n\t\t\t),\n\t\t\t'img'     => array(\n\t\t\t\t'src' => true,\n\t\t\t\t'alt' => true,\n\t\t\t),\n\t\t);\n\t\t$safe_empty_elements      = array( 'img', 'hr', 'iframe' );\n\n\t\tforeach ( $body->getElementsByTagName( '*' ) as $element ) {\n\t\t\t/** @var DOMElement $element */\n\t\t\t$tag_name = strtolower( $element->nodeName );\n\n\t\t\t// If the element is not safe, then the instance is legacy.\n\t\t\tif ( ! isset( $safe_elements_attributes[ $tag_name ] ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// If the element is not safely empty and it has empty contents, then legacy mode.\n\t\t\tif ( ! in_array( $tag_name, $safe_empty_elements, true ) && '' === trim( $element->textContent ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// If an attribute is not recognized as safe, then the instance is legacy.\n\t\t\tforeach ( $element->attributes as $attribute ) {\n\t\t\t\t/** @var DOMAttr $attribute */\n\t\t\t\t$attribute_name = strtolower( $attribute->nodeName );\n\n\t\t\t\tif ( ! isset( $safe_elements_attributes[ $tag_name ][ $attribute_name ] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Otherwise, the text contains no elements/attributes that TinyMCE could drop, and therefore the widget does not need legacy mode.\n\t\treturn false;\n\t}\n\n\t/**\n\t * Filter gallery shortcode attributes.\n\t *\n\t * Prevents all of a site's attachments from being shown in a gallery displayed on a\n\t * non-singular template where a $post context is not available.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @param array $attrs Attributes.\n\t * @return array Attributes.\n\t */\n\tpublic function _filter_gallery_shortcode_attrs( $attrs ) {\n\t\tif ( ! is_singular() && empty( $attrs['id'] ) && empty( $attrs['include'] ) ) {\n\t\t\t$attrs['id'] = -1;\n\t\t}\n\t\treturn $attrs;\n\t}\n\n\t/**\n\t * Outputs the content for the current Text widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @global WP_Post $post Global post object.\n\t *\n\t * @param array $args     Display arguments including 'before_title', 'after_title',\n\t *                        'before_widget', and 'after_widget'.\n\t * @param array $instance Settings for the current Text widget instance.\n\t */\n\tpublic function widget( $args, $instance ) {\n\t\tglobal $post;\n\n\t\t$title = ! empty( $instance['title'] ) ? $instance['title'] : '';\n\n\t\t/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */\n\t\t$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );\n\n\t\t$text                  = ! empty( $instance['text'] ) ? $instance['text'] : '';\n\t\t$is_visual_text_widget = ( ! empty( $instance['visual'] ) && ! empty( $instance['filter'] ) );\n\n\t\t// In 4.8.0 only, visual Text widgets get filter=content, without visual prop; upgrade instance props just-in-time.\n\t\tif ( ! $is_visual_text_widget ) {\n\t\t\t$is_visual_text_widget = ( isset( $instance['filter'] ) && 'content' === $instance['filter'] );\n\t\t}\n\t\tif ( $is_visual_text_widget ) {\n\t\t\t$instance['filter'] = true;\n\t\t\t$instance['visual'] = true;\n\t\t}\n\n\t\t/*\n\t\t * Suspend legacy plugin-supplied do_shortcode() for 'widget_text' filter for the visual Text widget to prevent\n\t\t * shortcodes being processed twice. Now do_shortcode() is added to the 'widget_text_content' filter in core itself\n\t\t * and it applies after wpautop() to prevent corrupting HTML output added by the shortcode. When do_shortcode() is\n\t\t * added to 'widget_text_content' then do_shortcode() will be manually called when in legacy mode as well.\n\t\t */\n\t\t$widget_text_do_shortcode_priority       = has_filter( 'widget_text', 'do_shortcode' );\n\t\t$should_suspend_legacy_shortcode_support = ( $is_visual_text_widget && false !== $widget_text_do_shortcode_priority );\n\t\tif ( $should_suspend_legacy_shortcode_support ) {\n\t\t\tremove_filter( 'widget_text', 'do_shortcode', $widget_text_do_shortcode_priority );\n\t\t}\n\n\t\t// Override global $post so filters (and shortcodes) apply in a consistent context.\n\t\t$original_post = $post;\n\t\tif ( is_singular() ) {\n\t\t\t// Make sure post is always the queried object on singular queries (not from another sub-query that failed to clean up the global $post).\n\t\t\t$post = get_queried_object();\n\t\t} else {\n\t\t\t// Nullify the $post global during widget rendering to prevent shortcodes from running with the unexpected context on archive queries.\n\t\t\t$post = null;\n\t\t}\n\n\t\t// Prevent dumping out all attachments from the media library.\n\t\tadd_filter( 'shortcode_atts_gallery', array( $this, '_filter_gallery_shortcode_attrs' ) );\n\n\t\t/**\n\t\t * Filters the content of the Text widget.\n\t\t *\n\t\t * @since 2.3.0\n\t\t * @since 4.4.0 Added the `$this` parameter.\n\t\t * @since 4.8.1 The `$this` param may now be a `WP_Widget_Custom_HTML` object in addition to a `WP_Widget_Text` object.\n\t\t *\n\t\t * @param string                               $text     The widget content.\n\t\t * @param array                                $instance Array of settings for the current widget.\n\t\t * @param WP_Widget_Text|WP_Widget_Custom_HTML $this     Current Text widget instance.\n\t\t */\n\t\t$text = apply_filters( 'widget_text', $text, $instance, $this );\n\n\t\tif ( $is_visual_text_widget ) {\n\n\t\t\t/**\n\t\t\t * Filters the content of the Text widget to apply changes expected from the visual (TinyMCE) editor.\n\t\t\t *\n\t\t\t * By default a subset of the_content filters are applied, including wpautop and wptexturize.\n\t\t\t *\n\t\t\t * @since 4.8.0\n\t\t\t *\n\t\t\t * @param string         $text     The widget content.\n\t\t\t * @param array          $instance Array of settings for the current widget.\n\t\t\t * @param WP_Widget_Text $this     Current Text widget instance.\n\t\t\t */\n\t\t\t$text = apply_filters( 'widget_text_content', $text, $instance, $this );\n\t\t} else {\n\t\t\t// Now in legacy mode, add paragraphs and line breaks when checkbox is checked.\n\t\t\tif ( ! empty( $instance['filter'] ) ) {\n\t\t\t\t$text = wpautop( $text );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Manually do shortcodes on the content when the core-added filter is present. It is added by default\n\t\t\t * in core by adding do_shortcode() to the 'widget_text_content' filter to apply after wpautop().\n\t\t\t * Since the legacy Text widget runs wpautop() after 'widget_text' filters are applied, the widget in\n\t\t\t * legacy mode here manually applies do_shortcode() on the content unless the default\n\t\t\t * core filter for 'widget_text_content' has been removed, or if do_shortcode() has already\n\t\t\t * been applied via a plugin adding do_shortcode() to 'widget_text' filters.\n\t\t\t */\n\t\t\tif ( has_filter( 'widget_text_content', 'do_shortcode' ) && ! $widget_text_do_shortcode_priority ) {\n\t\t\t\tif ( ! empty( $instance['filter'] ) ) {\n\t\t\t\t\t$text = shortcode_unautop( $text );\n\t\t\t\t}\n\t\t\t\t$text = do_shortcode( $text );\n\t\t\t}\n\t\t}\n\n\t\t// Restore post global.\n\t\t$post = $original_post;\n\t\tremove_filter( 'shortcode_atts_gallery', array( $this, '_filter_gallery_shortcode_attrs' ) );\n\n\t\t// Undo suspension of legacy plugin-supplied shortcode handling.\n\t\tif ( $should_suspend_legacy_shortcode_support ) {\n\t\t\tadd_filter( 'widget_text', 'do_shortcode', $widget_text_do_shortcode_priority );\n\t\t}\n\n\t\techo $args['before_widget'];\n\t\tif ( ! empty( $title ) ) {\n\t\t\techo $args['before_title'] . $title . $args['after_title'];\n\t\t}\n\n\t\t$text = preg_replace_callback( '#<(video|iframe|object|embed)\\s[^>]*>#i', array( $this, 'inject_video_max_width_style' ), $text );\n\n\t\t// Adds noreferrer and noopener relationships, without duplicating values, to all HTML A elements that have a target.\n\t\t$text = wp_targeted_link_rel( $text );\n\n\t\t?>\n\t\t\t<div class=\"textwidget\"><?php echo $text; ?></div>\n\t\t<?php\n\t\techo $args['after_widget'];\n\t}\n\n\t/**\n\t * Inject max-width and remove height for videos too constrained to fit inside sidebars on frontend.\n\t *\n\t * @since 4.9.0\n\t *\n\t * @see WP_Widget_Media_Video::inject_video_max_width_style()\n\t *\n\t * @param array $matches Pattern matches from preg_replace_callback.\n\t * @return string HTML Output.\n\t */\n\tpublic function inject_video_max_width_style( $matches ) {\n\t\t$html = $matches[0];\n\t\t$html = preg_replace( '/\\sheight=\"\\d+\"/', '', $html );\n\t\t$html = preg_replace( '/\\swidth=\"\\d+\"/', '', $html );\n\t\t$html = preg_replace( '/(?<=width:)\\s*\\d+px(?=;?)/', '100%', $html );\n\t\treturn $html;\n\t}\n\n\t/**\n\t * Handles updating settings for the current Text widget instance.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param array $new_instance New settings for this instance as input by the user via\n\t *                            WP_Widget::form().\n\t * @param array $old_instance Old settings for this instance.\n\t * @return array Settings to save or bool false to cancel saving.\n\t */\n\tpublic function update( $new_instance, $old_instance ) {\n\t\t$new_instance = wp_parse_args(\n\t\t\t$new_instance,\n\t\t\tarray(\n\t\t\t\t'title'  => '',\n\t\t\t\t'text'   => '',\n\t\t\t\t'filter' => false, // For back-compat.\n\t\t\t\t'visual' => null,  // Must be explicitly defined.\n\t\t\t)\n\t\t);\n\n\t\t$instance = $old_instance;\n\n\t\t$instance['title'] = sanitize_text_field( $new_instance['title'] );\n\t\tif ( current_user_can( 'unfiltered_html' ) ) {\n\t\t\t$instance['text'] = $new_instance['text'];\n\t\t} else {\n\t\t\t$instance['text'] = wp_kses_post( $new_instance['text'] );\n\t\t}\n\n\t\t$instance['filter'] = ! empty( $new_instance['filter'] );\n\n\t\t// Upgrade 4.8.0 format.\n\t\tif ( isset( $old_instance['filter'] ) && 'content' === $old_instance['filter'] ) {\n\t\t\t$instance['visual'] = true;\n\t\t}\n\t\tif ( 'content' === $new_instance['filter'] ) {\n\t\t\t$instance['visual'] = true;\n\t\t}\n\n\t\tif ( isset( $new_instance['visual'] ) ) {\n\t\t\t$instance['visual'] = ! empty( $new_instance['visual'] );\n\t\t}\n\n\t\t// Filter is always true in visual mode.\n\t\tif ( ! empty( $instance['visual'] ) ) {\n\t\t\t$instance['filter'] = true;\n\t\t}\n\n\t\treturn $instance;\n\t}\n\n\t/**\n\t * Enqueue preview scripts.\n\t *\n\t * These scripts normally are enqueued just-in-time when a playlist shortcode is used.\n\t * However, in the customizer, a playlist shortcode may be used in a text widget and\n\t * dynamically added via selective refresh, so it is important to unconditionally enqueue them.\n\t *\n\t * @since 4.9.3\n\t */\n\tpublic function enqueue_preview_scripts() {\n\t\trequire_once dirname( __DIR__ ) . '/media.php';\n\n\t\twp_playlist_scripts( 'audio' );\n\t\twp_playlist_scripts( 'video' );\n\t}\n\n\t/**\n\t * Loads the required scripts and styles for the widget control.\n\t *\n\t * @since 4.8.0\n\t */\n\tpublic function enqueue_admin_scripts() {\n\t\twp_enqueue_editor();\n\t\twp_enqueue_media();\n\t\twp_enqueue_script( 'text-widgets' );\n\t\twp_add_inline_script( 'text-widgets', 'wp.textWidgets.init();', 'after' );\n\t}\n\n\t/**\n\t * Outputs the Text widget settings form.\n\t *\n\t * @since 2.8.0\n\t * @since 4.8.0 Form only contains hidden inputs which are synced with JS template.\n\t * @since 4.8.1 Restored original form to be displayed when in legacy mode.\n\t *\n\t * @see WP_Widget_Text::render_control_template_scripts()\n\t * @see _WP_Editors::editor()\n\t *\n\t * @param array $instance Current settings.\n\t */\n\tpublic function form( $instance ) {\n\t\t$instance = wp_parse_args(\n\t\t\t(array) $instance,\n\t\t\tarray(\n\t\t\t\t'title' => '',\n\t\t\t\t'text'  => '',\n\t\t\t)\n\t\t);\n\t\t?>\n\t\t<?php if ( ! $this->is_legacy_instance( $instance ) ) : ?>\n\t\t\t<?php\n\n\t\t\tif ( user_can_richedit() ) {\n\t\t\t\tadd_filter( 'the_editor_content', 'format_for_editor', 10, 2 );\n\t\t\t\t$default_editor = 'tinymce';\n\t\t\t} else {\n\t\t\t\t$default_editor = 'html';\n\t\t\t}\n\n\t\t\t/** This filter is documented in wp-includes/class-wp-editor.php */\n\t\t\t$text = apply_filters( 'the_editor_content', $instance['text'], $default_editor );\n\n\t\t\t// Reset filter addition.\n\t\t\tif ( user_can_richedit() ) {\n\t\t\t\tremove_filter( 'the_editor_content', 'format_for_editor' );\n\t\t\t}\n\n\t\t\t// Prevent premature closing of textarea in case format_for_editor() didn't apply or the_editor_content filter did a wrong thing.\n\t\t\t$escaped_text = preg_replace( '#</textarea#i', '&lt;/textarea', $text );\n\n\t\t\t?>\n\t\t\t<input id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" class=\"title sync-input\" type=\"hidden\" value=\"<?php echo esc_attr( $instance['title'] ); ?>\">\n\t\t\t<textarea id=\"<?php echo $this->get_field_id( 'text' ); ?>\" name=\"<?php echo $this->get_field_name( 'text' ); ?>\" class=\"text sync-input\" hidden><?php echo $escaped_text; ?></textarea>\n\t\t\t<input id=\"<?php echo $this->get_field_id( 'filter' ); ?>\" name=\"<?php echo $this->get_field_name( 'filter' ); ?>\" class=\"filter sync-input\" type=\"hidden\" value=\"on\">\n\t\t\t<input id=\"<?php echo $this->get_field_id( 'visual' ); ?>\" name=\"<?php echo $this->get_field_name( 'visual' ); ?>\" class=\"visual sync-input\" type=\"hidden\" value=\"on\">\n\t\t<?php else : ?>\n\t\t\t<input id=\"<?php echo $this->get_field_id( 'visual' ); ?>\" name=\"<?php echo $this->get_field_name( 'visual' ); ?>\" class=\"visual\" type=\"hidden\" value=\"\">\n\t\t\t<p>\n\t\t\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e( 'Title:' ); ?></label>\n\t\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $instance['title'] ); ?>\"/>\n\t\t\t</p>\n\t\t\t<div class=\"notice inline notice-info notice-alt\">\n\t\t\t\t<?php if ( ! isset( $instance['visual'] ) ) : ?>\n\t\t\t\t\t<p><?php _e( 'This widget may contain code that may work better in the &#8220;Custom HTML&#8221; widget. How about trying that widget instead?' ); ?></p>\n\t\t\t\t<?php else : ?>\n\t\t\t\t\t<p><?php _e( 'This widget may have contained code that may work better in the &#8220;Custom HTML&#8221; widget. If you haven&#8217;t yet, how about trying that widget instead?' ); ?></p>\n\t\t\t\t<?php endif; ?>\n\t\t\t</div>\n\t\t\t<p>\n\t\t\t\t<label for=\"<?php echo $this->get_field_id( 'text' ); ?>\"><?php _e( 'Content:' ); ?></label>\n\t\t\t\t<textarea class=\"widefat\" rows=\"16\" cols=\"20\" id=\"<?php echo $this->get_field_id( 'text' ); ?>\" name=\"<?php echo $this->get_field_name( 'text' ); ?>\"><?php echo esc_textarea( $instance['text'] ); ?></textarea>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<input id=\"<?php echo $this->get_field_id( 'filter' ); ?>\" name=\"<?php echo $this->get_field_name( 'filter' ); ?>\" type=\"checkbox\"<?php checked( ! empty( $instance['filter'] ) ); ?> />&nbsp;<label for=\"<?php echo $this->get_field_id( 'filter' ); ?>\"><?php _e( 'Automatically add paragraphs' ); ?></label>\n\t\t\t</p>\n\t\t\t<?php\n\t\tendif;\n\t}\n\n\t/**\n\t * Render form template scripts.\n\t *\n\t * @since 4.8.0\n\t * @since 4.9.0 The method is now static.\n\t */\n\tpublic static function render_control_template_scripts() {\n\t\t$dismissed_pointers = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );\n\t\t?>\n\t\t<script type=\"text/html\" id=\"tmpl-widget-text-control-fields\">\n\t\t\t<# var elementIdPrefix = 'el' + String( Math.random() ).replace( /\\D/g, '' ) + '_' #>\n\t\t\t<p>\n\t\t\t\t<label for=\"{{ elementIdPrefix }}title\"><?php esc_html_e( 'Title:' ); ?></label>\n\t\t\t\t<input id=\"{{ elementIdPrefix }}title\" type=\"text\" class=\"widefat title\">\n\t\t\t</p>\n\n\t\t\t<?php if ( ! in_array( 'text_widget_custom_html', $dismissed_pointers, true ) ) : ?>\n\t\t\t\t<div hidden class=\"wp-pointer custom-html-widget-pointer wp-pointer-top\">\n\t\t\t\t\t<div class=\"wp-pointer-content\">\n\t\t\t\t\t\t<h3><?php _e( 'New Custom HTML Widget' ); ?></h3>\n\t\t\t\t\t\t<?php if ( is_customize_preview() ) : ?>\n\t\t\t\t\t\t\t<p><?php _e( 'Did you know there is a &#8220;Custom HTML&#8221; widget now? You can find it by pressing the &#8220;<a class=\"add-widget\" href=\"#\">Add a Widget</a>&#8221; button and searching for &#8220;HTML&#8221;. Check it out to add some custom code to your site!' ); ?></p>\n\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t<p><?php _e( 'Did you know there is a &#8220;Custom HTML&#8221; widget now? You can find it by scanning the list of available widgets on this screen. Check it out to add some custom code to your site!' ); ?></p>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t<div class=\"wp-pointer-buttons\">\n\t\t\t\t\t\t\t<a class=\"close\" href=\"#\"><?php _e( 'Dismiss' ); ?></a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"wp-pointer-arrow\">\n\t\t\t\t\t\t<div class=\"wp-pointer-arrow-inner\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t<?php endif; ?>\n\n\t\t\t<?php if ( ! in_array( 'text_widget_paste_html', $dismissed_pointers, true ) ) : ?>\n\t\t\t\t<div hidden class=\"wp-pointer paste-html-pointer wp-pointer-top\">\n\t\t\t\t\t<div class=\"wp-pointer-content\">\n\t\t\t\t\t\t<h3><?php _e( 'Did you just paste HTML?' ); ?></h3>\n\t\t\t\t\t\t<p><?php _e( 'Hey there, looks like you just pasted HTML into the &#8220;Visual&#8221; tab of the Text widget. You may want to paste your code into the &#8220;Text&#8221; tab instead. Alternately, try out the new &#8220;Custom HTML&#8221; widget!' ); ?></p>\n\t\t\t\t\t\t<div class=\"wp-pointer-buttons\">\n\t\t\t\t\t\t\t<a class=\"close\" href=\"#\"><?php _e( 'Dismiss' ); ?></a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"wp-pointer-arrow\">\n\t\t\t\t\t\t<div class=\"wp-pointer-arrow-inner\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t<?php endif; ?>\n\n\t\t\t<p>\n\t\t\t\t<label for=\"{{ elementIdPrefix }}text\" class=\"screen-reader-text\"><?php esc_html_e( 'Content:' ); ?></label>\n\t\t\t\t<textarea id=\"{{ elementIdPrefix }}text\" class=\"widefat text wp-editor-area\" style=\"height: 200px\" rows=\"16\" cols=\"20\"></textarea>\n\t\t\t</p>\n\t\t</script>\n\t\t<?php\n\t}\n}\n", "num_lines": 570}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * Laravel - A PHP Framework For Web Artisans\n *\n * @package  Laravel\n * @author   Taylor Otwell <taylor@laravel.com>\n */\n\n$uri = urldecode(\n    parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)\n);\n\n// This file allows us to emulate Apache's \"mod_rewrite\" functionality from the\n// built-in PHP web server. This provides a convenient way to test a Laravel\n// application without having installed a \"real\" web server software here.\nif ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {\n    return false;\n}\n\nrequire_once __DIR__.'/public/index.php';\n", "num_lines": 22}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Console;\n\nuse Illuminate\\Console\\Scheduling\\Schedule;\nuse Illuminate\\Foundation\\Console\\Kernel as ConsoleKernel;\n\nclass Kernel extends ConsoleKernel\n{\n    /**\n     * Define the application's command schedule.\n     *\n     * @param  \\Illuminate\\Console\\Scheduling\\Schedule  $schedule\n     * @return void\n     */\n    protected function schedule(Schedule $schedule)\n    {\n        // $schedule->command('inspire')->hourly();\n    }\n\n    /**\n     * Register the commands for the application.\n     *\n     * @return void\n     */\n    protected function commands()\n    {\n        $this->load(__DIR__.'/Commands');\n\n        require base_path('routes/console.php');\n    }\n}\n", "num_lines": 33}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Exceptions;\n\nuse Illuminate\\Foundation\\Exceptions\\Handler as ExceptionHandler;\nuse Throwable;\n\nclass Handler extends ExceptionHandler\n{\n    /**\n     * A list of the exception types that are not reported.\n     *\n     * @var string[]\n     */\n    protected $dontReport = [\n        //\n    ];\n\n    /**\n     * A list of the inputs that are never flashed for validation exceptions.\n     *\n     * @var string[]\n     */\n    protected $dontFlash = [\n        'current_password',\n        'password',\n        'password_confirmation',\n    ];\n\n    /**\n     * Register the exception handling callbacks for the application.\n     *\n     * @return void\n     */\n    public function register()\n    {\n        $this->reportable(function (Throwable $e) {\n            //\n        });\n    }\n}\n", "num_lines": 42}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Helpers;\n\nuse Illuminate\\Support\\Facades\\DB;\nuse Illuminate\\Support\\Facades\\Schema;\n\nuse App\\Models\\User;\n\nclass AppHelper\n{\n\n\tpublic static function instance()\n\t{\n\t\treturn new AppHelper();\n\t}\n\n\n\t// get user from session or generate a random user\n\tpublic function randomUser() {\n\t\t$user = session('user');\n\t\tif (!$user) {\n\t\t\t// session died, so we need to get a new user\n\t\t\tif ($this->checkDB() && Schema::hasTable('users')) {\n\t\t\t\t// if there's no database connection, use JSON data\n\t\t\t\t$user = User::inRandomOrder()->first();\n\t\t\t} else {\n\t\t\t\t$user = AppHelper::instance()->userJson('rand');\n\t\t\t\t$user->fromJson = 1;\n\t\t\t}\n\t\t}\n\t\tsession([ 'user' => $user ]);\n\t\treturn $user;\n\t}\n\n\n\t// display a cart icon and a floating list of items in the cart\n\tpublic function globalCart($show=null) {\n\t\t$cart = session('cart');\n\t\t$cart_total = 0;\n\t\t$cart_data = [];\n\t\tif ($cart) {\n\t\t\t$item = AppHelper::instance()->itemJson('items',array_keys($cart));\n\t\t\tforeach($item as $i) {\n\t\t\t\t$qty = $cart[$i->id];\n\t\t\t\t$cart_total += $qty;\n\t\t\t\t$i->qty = $qty;\n\t\t\t\t$price = is_numeric($i->price) ? $i->price : '0';\n\t\t\t\t$i->sub = $qty * number_format($price, 2);\n\t\t\t\t$cart_data[$i->id] = $i;\n\t\t\t}\n\t\t}\n\t\t$html = view('includes/floating-cart')->with('cart_total',$cart_total)->with('cart_data',($cart_data ?? null))->with('show',$show)->render();\n\t\treturn ['html'=>$html, 'cart_total'=>$cart_total];\n\t}\n\n\n\t// use these functions to get json data when there's no database:\n\t// (don't worry about this section, it's just here to keep the app working if there's no database)\n\n\t// checks to see if database is connecting\n\tpublic function checkDB()\n\t{\n\t\ttry {\n\t\t\tDB::getPdo();\n\t\t} catch (\\Exception $e) {\n\t\t\t// print($e->getMessage());\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t// returns a user (if ID is provided) or a list of users\n\tpublic function userJson($id=null)\n\t{\n\t\t$json = '[ \n\t\t\t{\"id\":1,\"name\":\"Jon Yang\",\"address\":\"3761 N. 14th St\",\"email\":\"jon24@adventure-works.com\",\"password\":\"$2y$10$7LnWpy7R7hXgbMnn.IHaSu8i.9E0dTB4tuMVHFm77OwSV46qbIvWa\"},\n\t\t\t{\"id\":2,\"name\":\"Eugene Huang\",\"address\":\"2243 W St.\",\"email\":\"eugene10@adventure-works.com\",\"password\":\"$2y$10$XuvN1ti/OL5mdiPtdd0z6O5b1m0Yft3WHhk3zJphZhr4GrH0OhOzK\"},\n\t\t\t{\"id\":3,\"name\":\"Ruben Torres\",\"address\":\"5844 Linden Land\",\"email\":\"ruben35@adventure-works.com\",\"password\":\"$2y$10$ElCTjmvfndxWb/Z8EpDQkeKFCr0v1N8QSokKzEeXXwwHpPJhPv4EC\"},\n\t\t\t{\"id\":4,\"name\":\"Christy Zhu\",\"address\":\"1825 Village Pl.\",\"email\":\"christy12@adventure-works.com\",\"password\":\"$2y$10$GnIyO51JnABQ2yt/6NCzKOkubSPxq49PST5jWOpfGOhu0emBkNR9e\"},\n\t\t\t{\"id\":5,\"name\":\"Elizabeth Johnson\",\"address\":\"7553 Harness Circle\",\"email\":\"elizabeth5@adventure-works.com\",\"password\":\"$2y$10$ynxB0d5QI/x/s0H.Ks5zIOSlPCT5/LvT2s1EJPsvs1E9SckW3lk8C\"},\n\t\t\t{\"id\":6,\"name\":\"Julio Ruiz\",\"address\":\"7305 Humphrey Drive\",\"email\":\"julio1@adventure-works.com\",\"password\":\"$2y$10$ZeMIoZ9DPVx1Mmb6UldmQOBdpinovkCLtObAvJJr/aoC4ZV9X6RN.\"},\n\t\t\t{\"id\":7,\"name\":\"Janet Alvarez\",\"address\":\"2612 Berry Dr\",\"email\":\"janet9@adventure-works.com\",\"password\":\"$2y$10$uyeh/gADnu0PRxhBwfyLT.8sGEL4ndbS0oX8SLg6Ei.eyjE/fffoG\"},\n\t\t\t{\"id\":8,\"name\":\"Marco Mehta\",\"address\":\"942 Brook Street\",\"email\":\"marco14@adventure-works.com\",\"password\":\"$2y$10$CuTmay8q.38uCx67aHmTmu6WCDii0yXq4sP8bEcvilRS2e0puuYRK\"},\n\t\t\t{\"id\":9,\"name\":\"Rob Verhoff\",\"address\":\"624 Peabody Road\",\"email\":\"rob4@adventure-works.com\",\"password\":\"$2y$10$e9/t.fCkYLnzRDDg21tKHef6KWph6Is.NDBcbR8BsN2aeaBQhZ/GK\"},\n\t\t\t{\"id\":10,\"name\":\"Shannon Carlson\",\"address\":\"3839 Northgate Road\",\"email\":\"shannon38@adventure-works.com\",\"password\":\"$2y$10$nEaJMT8ZcuFl5BitQouXXOMyiBVs2OX0MPuHB.wtRyzvpr/64e7J6\"}\n\t\t]';\n\t\t$users = collect(json_decode($json))->sortBy('name')->all();\n\t\tif ($id=='rand') {\n\t\t\t$id = rand(1,count($users));\n\t\t}\n\t\tif ($id) {\n\t\t\t$user = collect(json_decode($json))->where('id', $id)->first();\n\t\t\treturn $user;\n\t\t} else {\n\t\t\treturn $users;\n\t\t}\n\t}\n\n\t// returns the list of categories\n\tpublic function categoryJson()\n\t{\n\t\t$json = '[ \n\t\t\t{\"id\":1,\"name\":\"Breakfast\",\"url\":\"breakfast\",\"img\":\"potatoes-g792cf4128_1920.jpg\"}, \n\t\t\t{\"id\":2,\"name\":\"Steak\",\"url\":\"steak\",\"img\":\"tomahawk-ge5ea2413d_1920.jpg\"}, \n\t\t\t{\"id\":3,\"name\":\"Pizza\",\"url\":\"pizza\",\"img\":\"pizza-g204a8b3d6_1920.jpg\"},\n\t\t\t{\"id\":4,\"name\":\"Burgers\",\"url\":\"burgers\",\"img\":\"hamburger-g685f013b8_1920.jpg\"},\n\t\t\t{\"id\":5,\"name\":\"Sushi\",\"url\":\"sushi\",\"img\":\"food-g3eb975adc_1920.jpg\"},\n\t\t\t{\"id\":6,\"name\":\"Salads\",\"url\":\"salads\",\"img\":\"salad-g3f02f56a0_1920.jpg\"}\n\t\t]';\n\t\t$category = collect(json_decode($json))->sortBy('name')->all();\n\t\treturn $category;\n\t}\n\n\t// returns a list of items\n\tpublic function itemJson($type=null,$id=null,$sort='name')\n\t{\n\t\t$json = '[ \n\t\t\t{\"id\":1,\"category_id\":1,\"name\":\"Cinnamon Roll\",\"img\":\"cinnamon-rolls-gb12ce8577_1920.jpg\",\"price\":\"1.19\",\"cooktime\":\"13\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":2,\"category_id\":1,\"name\":\"Toast & Eggs\",\"img\":\"breakfast-g7a2675ee6_1920.jpg\",\"price\":\"2.19\",\"cooktime\":\"7\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":3,\"category_id\":1,\"name\":\"Croissant\",\"img\":\"croissant-ga61b1fb0e_1920.jpg\",\"price\":\"3.19\",\"cooktime\":\"2\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":4,\"category_id\":1,\"name\":\"Bacon & Eggs\",\"img\":\"eggs-g9c07e92b1_1920.jpg\",\"price\":\"4.19\",\"cooktime\":\"14\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":5,\"category_id\":1,\"name\":\"Pancakes\",\"img\":\"pancakes-g9d341228a_1920.jpg\",\"price\":\"5.19\",\"cooktime\":\"12\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":6,\"category_id\":1,\"name\":\"Biscuits & Gravy\",\"img\":\"biscuits-g07bd069f8_1920.jpg\",\"price\":\"6.19\",\"cooktime\":\"6\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\n\t\t\t{\"id\":7,\"category_id\":2,\"name\":\"Tomahawk\",\"img\":\"steak-4342500_1920.jpg\",\"price\":\"1.29\",\"cooktime\":\"27\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":8,\"category_id\":2,\"name\":\"Sirloin\",\"img\":\"steak-1076665_1920.jpg\",\"price\":\"2.29\",\"cooktime\":\"22\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":9,\"category_id\":2,\"name\":\"T-Bone\",\"img\":\"steak-978654_1920.jpg\",\"price\":\"3.29\",\"cooktime\":\"23\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\n\t\t\t{\"id\":10,\"category_id\":3,\"name\":\"Pepperoni\",\"img\":\"pizza-1344720_1920.jpg\",\"price\":\"\",\"cooktime\":\"12\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":11,\"category_id\":3,\"name\":\"Margherita\",\"img\":\"pizza-3000274_1920.jpg\",\"price\":\"3\",\"cooktime\":\"6\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\n\t\t\t{\"id\":12,\"category_id\":4,\"name\":\"Sliders\",\"img\":\"hamburger-494706_1920.jpg\",\"price\":\"1.49\",\"cooktime\":\"9\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":13,\"category_id\":4,\"name\":\"Charbroiled\",\"img\":\"hamburger-1238246_1920.jpg\",\"price\":\"2.49\",\"cooktime\":\"17\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":14,\"category_id\":4,\"name\":\"Diner Burger\",\"img\":\"burger-3442227_1920.jpg\",\"price\":\"3.49\",\"cooktime\":\"12\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\n\t\t\t{\"id\":15,\"category_id\":5,\"name\":\"Sashimi Fresh Roll\",\"img\":\"sushi-354628_1920.jpg\",\"price\":\"1.59\",\"cooktime\":\"3\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":16,\"category_id\":5,\"name\":\"Power Fish\",\"img\":\"sushi-2853382_1920.jpg\",\"price\":\"2.59\",\"cooktime\":\"5\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":17,\"category_id\":5,\"name\":\"Spicy Tuna\",\"img\":\"sushi-599721_1920.jpg\",\"price\":\"3.59\",\"cooktime\":\"7\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":18,\"category_id\":5,\"name\":\"Avocado Roll\",\"img\":\"maki-716432_1920.jpg\",\"price\":\"4.59\",\"cooktime\":\"2\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":19,\"category_id\":5,\"name\":\"Sampler Plate\",\"img\":\"sushi-2856545_1920.jpg\",\"price\":\"5.59\",\"cooktime\":\"4\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":20,\"category_id\":5,\"name\":\"Veggie Roll\",\"img\":\"sushi-2020287_1920.jpg\",\"price\":\"6.59\",\"cooktime\":\"2\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":21,\"category_id\":5,\"name\":\"Maki\",\"img\":\"sushi-748139_1920.jpg\",\"price\":\"7.59\",\"cooktime\":\"5\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\n\t\t\t{\"id\":22,\"category_id\":6,\"name\":\"Bowl of Lettuce\",\"img\":\"food-1834645_1920.jpg\",\"price\":\"1.69\",\"cooktime\":\"1\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":23,\"category_id\":6,\"name\":\"Plate of Lettuce\",\"img\":\"salad-2150548_1920.jpg\",\"price\":\"2.69\",\"cooktime\":\"1\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"}\n\t\t]';\n\n\t\t// need this to search json by category\n\t\t$category_to_id = [];\n\t\t$category_list = collect($this->categoryJson());\n\t\tforeach($category_list as $c) {\n\t\t\t$category_to_id[ $c->url ] = $c->id;\n\t\t}\n\n\t\tif ($type=='byCategory') {\n\t\t\t$item = collect(json_decode($json))->where('category_id', $category_to_id[$id])->sortBy('name')->all();\n\t\t} elseif ($type=='item') {\n\t\t\t$item = collect(json_decode($json))->where('id', $id)->first();\n\t\t} elseif ($type=='items') {\n\t\t\t$item = collect(json_decode($json))->whereIn('id', $id)->sortBy($sort)->all();\n\t\t} else {\n\t\t\t$item = collect(json_decode($json))->sortBy('name')->all();\n\t\t}\n\n\t\treturn $item;\n\t}\n\n\n}\n", "num_lines": 171}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http;\n\nuse Illuminate\\Foundation\\Http\\Kernel as HttpKernel;\n\nclass Kernel extends HttpKernel\n{\n    /**\n     * The application's global HTTP middleware stack.\n     *\n     * These middleware are run during every request to your application.\n     *\n     * @var array\n     */\n    protected $middleware = [\n        // \\App\\Http\\Middleware\\TrustHosts::class,\n        \\App\\Http\\Middleware\\TrustProxies::class,\n        \\Fruitcake\\Cors\\HandleCors::class,\n        \\App\\Http\\Middleware\\PreventRequestsDuringMaintenance::class,\n        \\Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize::class,\n        \\App\\Http\\Middleware\\TrimStrings::class,\n        \\Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull::class,\n    ];\n\n    /**\n     * The application's route middleware groups.\n     *\n     * @var array\n     */\n    protected $middlewareGroups = [\n        'web' => [\n            \\App\\Http\\Middleware\\EncryptCookies::class,\n            \\Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse::class,\n            \\Illuminate\\Session\\Middleware\\StartSession::class,\n            // \\Illuminate\\Session\\Middleware\\AuthenticateSession::class,\n            \\Illuminate\\View\\Middleware\\ShareErrorsFromSession::class,\n            \\App\\Http\\Middleware\\VerifyCsrfToken::class,\n            \\Illuminate\\Routing\\Middleware\\SubstituteBindings::class,\n        ],\n\n        'api' => [\n            // \\Laravel\\Sanctum\\Http\\Middleware\\EnsureFrontendRequestsAreStateful::class,\n            'throttle:api',\n            \\Illuminate\\Routing\\Middleware\\SubstituteBindings::class,\n        ],\n    ];\n\n    /**\n     * The application's route middleware.\n     *\n     * These middleware may be assigned to groups or used individually.\n     *\n     * @var array\n     */\n    protected $routeMiddleware = [\n        'auth' => \\App\\Http\\Middleware\\Authenticate::class,\n        'auth.basic' => \\Illuminate\\Auth\\Middleware\\AuthenticateWithBasicAuth::class,\n        'cache.headers' => \\Illuminate\\Http\\Middleware\\SetCacheHeaders::class,\n        'can' => \\Illuminate\\Auth\\Middleware\\Authorize::class,\n        'guest' => \\App\\Http\\Middleware\\RedirectIfAuthenticated::class,\n        'password.confirm' => \\Illuminate\\Auth\\Middleware\\RequirePassword::class,\n        'signed' => \\Illuminate\\Routing\\Middleware\\ValidateSignature::class,\n        'throttle' => \\Illuminate\\Routing\\Middleware\\ThrottleRequests::class,\n        'verified' => \\Illuminate\\Auth\\Middleware\\EnsureEmailIsVerified::class,\n    ];\n}\n", "num_lines": 68}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Schema;\n\nuse App\\Helpers\\AppHelper;\nuse App\\Models\\Cart;\nuse App\\Models\\CartItem;\nuse App\\Models\\Order;\nuse App\\Models\\Item;\n\nclass CartController extends Controller\n{\n\n\t// pages:\n\n\tpublic function checkout()\n\t{\n\t\t$user = session('user');\n\t\t$cart = session('cart');\n\t\t$item_list = [];\n\t\tif ($cart) $item_list = array_keys($cart);\n\t\tif (AppHelper::instance()->checkDB() && Schema::hasTable('items') && Schema::hasTable('carts')) {\n\t\t\t$items = Item::whereIn('id',$item_list)->orderBy('name')->get();\n\t\t} else {\n\t\t\t// if there's no database connection, use a helper and JSON data\n\t\t\t$items = AppHelper::instance()->itemJson('items',$item_list);\n\t\t\t// set a flag so we can display a warning if JSON data is used\n\t\t\t$json_warning = 1;\n\t\t}\n\t\t$cart_total = 0;\n\t\t$cart_data = [];\n\t\tforeach($items as $item) {\n\t\t\t$qty = $cart[$item->id];\n\t\t\t$item->qty = $qty;\n\t\t\t// set price to 0 in the event there is bad data\n\t\t\t$price = is_numeric($item->price) ? $item->price : 0;\n\t\t\t// set item subtotal\n\t\t\t$item->sub = $qty * number_format($price, 2);\n\t\t\t// increment cart total\n\t\t\t$cart_total += $item->sub;\n\t\t\t// add item to cart array\n\t\t\t$cart_data[$item->id] = $item;\n\t\t}\n\n\t\tif (AppHelper::instance()->checkDB() && Schema::hasTable('carts')) {\n\t\t\t$full_cart = Cart::updateOrCreate(\n\t\t\t\t['user_id' => $user->id, 'status' => 'open'],\n\t\t\t);\n\t\t\t$full_cart->save();\n\t\t\tforeach($cart_data as $id => $item) {\n\t\t\t\t$cart_insert = CartItem::updateOrCreate(\n\t\t\t\t\t['cart_id' => $full_cart->id, 'item_id' => $id],\n\t\t\t\t\t['qty' => $item->qty]\n\t\t\t\t);\n\t\t\t\t$full_cart->cart_items()->save($cart_insert);\n\t\t\t}\n\t\t\tsession(['cart_id' => $full_cart->id]);\n\t\t} else {\n\t\t\t// if there's no database connection, fake it with sessions\n\t\t\tsession(['cart_id' => 'session']);\n\t\t\t$json_warning = 1;\n\t\t}\n\n\t\treturn view('checkout', ['header'=>1, 'user'=>$user, 'cart_data'=>$cart_data, 'cart_total'=>$cart_total, 'json_warning'=>($json_warning ?? 0)]);\n\t}\n\n\n\tpublic function processOrder(Request $request)\n\t{\n\t\t$user = session('user');\n\t\t$cart = session('cart');\n\t\t$cart_id = session('cart_id');\n\n\t\tif (!$user || !$cart || !$cart_id) {\n\t\t\t// something is missing, bounce back to the checkout page\n\t\t\treturn redirect()->route('checkout');\n\t\t}\n\n\t\tif ($cart) {\n\t\t\t$item_list = array_keys($cart);\n\t\t\tif (AppHelper::instance()->checkDB() && Schema::hasTable('items') && Schema::hasTable('carts')) {\n\t\t\t\t$item = Item::whereIn('id',$item_list)->orderBy('name')->get();\n\t\t\t} else {\n\t\t\t\t// if there's no database connection, use a helper and JSON data\n\t\t\t\t$item = AppHelper::instance()->itemJson('items',$item_list,'cooktime');\n\t\t\t}\n\n\t\t\t// show a semi-random delivery time to make it more fun\n\t\t\t$cooktime = 0;\n\t\t\t// start with a random prep/drive time\n\t\t\t$time = rand(5,20);\n\t\t\tforeach($item as $i) {\n\t\t\t\t// get the longest cooktime of all items in the cart\n\t\t\t\tif ($cooktime < $i->cooktime) { \n\t\t\t\t\t$cooktime = $i->cooktime; \n\t\t\t\t}\n\t\t\t}\n\t\t\t// add the cooktime to the random prep/drive time\n\t\t\t$time+=$cooktime;\n\t\t\t// turn it into minutes from *right now*\n\t\t\t$delivery = strtotime(now())+($time*60);\n\n\t\t\t$name = $request->name ?? $user->name;\n\t\t\t$address = $request->address ?? $user->address;\n\n\t\t\tif (AppHelper::instance()->checkDB() && Schema::hasTable('carts') && $cart_id!='session') {\n\t\t\t\t// update cart to 'closed'\n\t\t\t\tCart::where('id', $cart_id)->update(['status' => 'closed']);\n\t\t\t\t// save to order table\n\t\t\t\t$order = new Order([\n\t\t\t\t\t'user_id' => $user->id,\n\t\t\t\t\t'cart_id' => $cart_id,\n\t\t\t\t\t'name' => $name,\n\t\t\t\t\t'address' => $address,\n\t\t\t\t\t'special_instructions' => $request->special_instructions,\n\t\t\t\t\t'cooktime' => $time\n\t\t\t\t]);\n\t\t\t\t$order->save();\n\t\t\t}\n\n\t\t\t// clear all the sessions\n\t\t\tsession()->forget('cart');\n\t\t\tsession()->forget('cart_id');\n\t\t\tsession()->forget('receipt');\n\n\t\t\tsession([ 'receipt' => ['created_at'=>strtotime(now()), 'delivery'=>$delivery] ]);\n\t\t}\t\t\n\t\t// redirect to the receipt page\n\t\treturn redirect()->route('receipt');\n\t}\n\n\n\tpublic function receipt()\n\t{\n\t\t$time_left = 0;\n\n\t\t// use the receipt session or display a generic message\n\t\t$receipt = session('receipt');\n\t\tif ($receipt) {\n\t\t\t// figure out how many minutes are left before food arrives\n\t\t\t$time_left = floor( ($receipt['delivery'] - strtotime(now()) )/60 );\n\t\t}\n\n\t\treturn view('receipt', ['header'=>1, 'receipt'=>$receipt, 'time_left'=>$time_left]);\n\t}\n\n\n\n\t// ajax:\n\n\tpublic function addToCart(Request $request)\n\t{\n\t\t$id = $request->item;\n\t\tif (!session('cart')) {\n\t\t\tsession([ 'cart' => [] ]);\n\t\t}\n\t\t$cart = session('cart');\n\t\tif (isset($cart[$id])) {\n\t\t\t$cart[$id]++;\n\t\t} else {\n\t\t\t$cart[$id] = 1;\n\t\t}\n\t\tsession(['cart' => $cart]);\n\n\t\t// update the floating cart\n\t\t$global_cart = AppHelper::instance()->globalCart();\n\n\t\treturn $global_cart;\n\t}\n\n\tpublic function updateCart(Request $request)\n\t{\n\t\t$item = $request->cart_items;\n\t\t$cart = session('cart');\n\t\tforeach ($item as $id => $qty) {\n\t\t\tif (isset($cart[$id]) && $qty<1) {\n\t\t\t\tunset($cart[$id]);\n\t\t\t} else {\n\t\t\t\t$cart[$id] = $qty;\n\t\t\t}\n\t\t}\n\t\tsession(['cart' => $cart]);\n\n\t\t// update the floating cart\n\t\t$global_cart = AppHelper::instance()->globalCart('show');\n\n\t\treturn $global_cart;\n\t}\n\n}\n", "num_lines": 194}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse Illuminate\\Foundation\\Auth\\Access\\AuthorizesRequests;\nuse Illuminate\\Foundation\\Bus\\DispatchesJobs;\nuse Illuminate\\Foundation\\Validation\\ValidatesRequests;\nuse Illuminate\\Routing\\Controller as BaseController;\n\nclass Controller extends BaseController\n{\n    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;\n}\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Schema;\n\nuse App\\Helpers\\AppHelper;\nuse App\\Models\\User;\n\nclass HomeController extends Controller\n{\n\n\t/*\n\t\tUsing the default Laravel 8 installation, this app example attempts to cover the very basic \n\t\tessentials without getting too complex. We've provided sample JSON data so the app can function \n\t\teven if there is no database connection. (JSON data can be found in /app/Helpers/AppHelper.php)\n\t*/\n\n\t// pages:\n\t\n\tpublic function index()\n\t{\n\t\t// forget the user session so we can get a new user on reload\n\t\tsession()->forget('user');\n\n\t\t// pretend the user logged in\n\t\t$user = AppHelper::instance()->randomUser();\n\t\t$json_warning = $user->fromJson;\n\n\t\t// display the floating cart\n\t\t$global_cart = AppHelper::instance()->globalCart();\n\n\t\treturn view('index', ['global_cart'=>$global_cart, 'user'=>$user, 'json_warning'=>($json_warning ?? 0)]);\n\t}\n\n}\n", "num_lines": 38}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Schema;\n\nuse App\\Helpers\\AppHelper;\nuse App\\Models\\User;\nuse App\\Models\\Category;\n\nclass ProductController extends Controller\n{\n\n\t// pages:\n\n\tpublic function categoryList()\n\t{\n\t\t// pretend the user logged in\n\t\t$user = AppHelper::instance()->randomUser();\n\n\t\tif (AppHelper::instance()->checkDB() && Schema::hasTable('categories')) {\n\t\t\t$data = Category::orderBy('name')->get();\n\t\t} else {\n\t\t\t// if there's no database connection, use a helper and JSON data\n\t\t\t$data = AppHelper::instance()->categoryJson();\n\t\t\t// set a flag so we can display a warning if JSON data is used\n\t\t\t$json_warning = 1;\n\t\t}\n\n\t\t// display the floating cart\n\t\t$global_cart = AppHelper::instance()->globalCart();\n\n\t\treturn view('category-list', ['header'=>1, 'global_cart'=>$global_cart, 'category'=>$data, 'json_warning'=>($json_warning ?? 0)]);\n\t}\n\n\t\n\tpublic function itemList($category)\n\t{\n\t\t// pretend the user logged in\n\t\t$user = AppHelper::instance()->randomUser();\n\n\t\tif (AppHelper::instance()->checkDB() && Schema::hasTable('categories') && Schema::hasTable('items')) {\n\t\t\t$data = Category::where('url',$category)->with('items')->first();\n\t\t\t$data = $data->items;\n\t\t} else {\n\t\t\t// if there's no database connection, use a helper and JSON data\n\t\t\t$data = AppHelper::instance()->itemJson('byCategory',$category);\n\t\t\t// set a flag so we can display a warning if JSON data is used\n\t\t\t$json_warning = 1;\n\t\t}\n\n\t\t// display the floating cart\n\t\t$global_cart = AppHelper::instance()->globalCart();\n\n\t\treturn view('item-list', ['header'=>1, 'global_cart'=>$global_cart, 'item'=>$data, 'json_warning'=>($json_warning ?? 0)]);\n\t}\n\n}\n", "num_lines": 60}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Auth\\Middleware\\Authenticate as Middleware;\n\nclass Authenticate extends Middleware\n{\n    /**\n     * Get the path the user should be redirected to when they are not authenticated.\n     *\n     * @param  \\Illuminate\\Http\\Request  $request\n     * @return string|null\n     */\n    protected function redirectTo($request)\n    {\n        if (! $request->expectsJson()) {\n            return route('login');\n        }\n    }\n}\n", "num_lines": 22}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Cookie\\Middleware\\EncryptCookies as Middleware;\n\nclass EncryptCookies extends Middleware\n{\n    /**\n     * The names of the cookies that should not be encrypted.\n     *\n     * @var array\n     */\n    protected $except = [\n        //\n    ];\n}\n", "num_lines": 18}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance as Middleware;\n\nclass PreventRequestsDuringMaintenance extends Middleware\n{\n    /**\n     * The URIs that should be reachable while maintenance mode is enabled.\n     *\n     * @var array\n     */\n    protected $except = [\n        //\n    ];\n}\n", "num_lines": 18}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse App\\Providers\\RouteServiceProvider;\nuse Closure;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Auth;\n\nclass RedirectIfAuthenticated\n{\n    /**\n     * Handle an incoming request.\n     *\n     * @param  \\Illuminate\\Http\\Request  $request\n     * @param  \\Closure  $next\n     * @param  string|null  ...$guards\n     * @return mixed\n     */\n    public function handle(Request $request, Closure $next, ...$guards)\n    {\n        $guards = empty($guards) ? [null] : $guards;\n\n        foreach ($guards as $guard) {\n            if (Auth::guard($guard)->check()) {\n                return redirect(RouteServiceProvider::HOME);\n            }\n        }\n\n        return $next($request);\n    }\n}\n", "num_lines": 33}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Foundation\\Http\\Middleware\\TrimStrings as Middleware;\n\nclass TrimStrings extends Middleware\n{\n    /**\n     * The names of the attributes that should not be trimmed.\n     *\n     * @var array\n     */\n    protected $except = [\n        'current_password',\n        'password',\n        'password_confirmation',\n    ];\n}\n", "num_lines": 20}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Http\\Middleware\\TrustHosts as Middleware;\n\nclass TrustHosts extends Middleware\n{\n    /**\n     * Get the host patterns that should be trusted.\n     *\n     * @return array\n     */\n    public function hosts()\n    {\n        return [\n            $this->allSubdomainsOfApplicationUrl(),\n        ];\n    }\n}\n", "num_lines": 21}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Http\\Middleware\\TrustProxies as Middleware;\nuse Illuminate\\Http\\Request;\n\nclass TrustProxies extends Middleware\n{\n    /**\n     * The trusted proxies for this application.\n     *\n     * @var array|string|null\n     */\n    protected $proxies;\n\n    /**\n     * The headers that should be used to detect proxies.\n     *\n     * @var int\n     */\n    protected $headers =\n        Request::HEADER_X_FORWARDED_FOR |\n        Request::HEADER_X_FORWARDED_HOST |\n        Request::HEADER_X_FORWARDED_PORT |\n        Request::HEADER_X_FORWARDED_PROTO |\n        Request::HEADER_X_FORWARDED_AWS_ELB;\n}\n", "num_lines": 29}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken as Middleware;\n\nclass VerifyCsrfToken extends Middleware\n{\n    /**\n     * The URIs that should be excluded from CSRF verification.\n     *\n     * @var array\n     */\n    protected $except = [\n        //\n    ];\n}\n", "num_lines": 18}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Cart extends Model\n{\n\tuse HasFactory;\n\n\tpublic $timestamps = false;\n\n\tprotected $fillable = [\n\t\t'user_id',\n\t\t'status',\n\t];\n\n\tprotected $with = [\n\t\t'cart_items',\n\t];\n\n\tpublic function cart_items()\n\t{\n\t\treturn $this->hasMany(CartItem::class, 'cart_id', 'id');\n\t}\n\n}\n", "num_lines": 29}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass CartItem extends Model\n{\n\tuse HasFactory;\n\n\tpublic $timestamps = false;\n\n\tprotected $fillable = [\n\t\t'cart_id',\n\t\t'item_id',\n\t\t'qty',\n\t];\n\n\tprotected $with = [\n\t\t'item',\n\t];\n\n\tpublic function cart()\n\t{\n\t\treturn $this->belongsTo(Cart::class, 'cart_id', 'id');\n\t}\n\n\tpublic function item()\n\t{\n\t\treturn $this->hasOne(Item::class, 'id', 'item_id')->orderBy('name');\n\t}\n\n}\n", "num_lines": 35}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Category extends Model\n{\n\tuse HasFactory;\n\n\tpublic $timestamps = false;\n\n\tprotected $fillable = [\n\t\t'name',\n\t\t'url',\n\t\t'img',\n\t];\n\n\tpublic function items()\n\t{\n\t\treturn $this->hasMany(Item::class, 'category_id', 'id')->orderBy('name');\n\t}\n\n}\n", "num_lines": 26}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Item extends Model\n{\n\tuse HasFactory;\n\n\tpublic $timestamps = false;\n\n\tprotected $fillable = [\n\t\t'category_id',\n\t\t'name',\n\t\t'img',\n\t\t'price',\n\t\t'cooktime',\n\t\t'desc',\n\t];\n\n\tpublic function category()\n\t{\n\t\treturn $this->belongsTo(Category::class, 'category_id', 'id');\n\t}\n\n}\n", "num_lines": 29}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Order extends Model\n{\n\tuse HasFactory;\n\n\tprotected $fillable = [\n\t\t'user_id',\n\t\t'cart_id',\n\t\t'name',\n\t\t'address',\n\t\t'special_instructions',\n\t\t'cooktime',\n\t];\n\n\tprotected $with = [\n\t\t'cart',\n\t];\n\n\tpublic function cart()\n\t{\n\t\treturn $this->hasOne(Cart::class, 'cart_id', 'id');\n\t}\n\n}\n", "num_lines": 31}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass User extends Model\n{\n\tuse HasFactory;\n\n\tpublic $timestamps = false;\n\n\tprotected $fillable = [\n\t\t'name',\n\t\t'address',\n\t\t'email',\n\t\t'password',\n\t];\n\n}\n", "num_lines": 22}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Support\\ServiceProvider;\nuse Illuminate\\Support\\Facades\\URL;\n\nclass AppServiceProvider extends ServiceProvider\n{\n    /**\n     * Register any application services.\n     *\n     * @return void\n     */\n    public function register()\n    {\n        //\n    }\n\n    /**\n     * Bootstrap any application services.\n     *\n     * @return void\n     */\n    public function boot()\n    {\n        //\n        // URL::forceScheme('https');\n    }\n}\n", "num_lines": 31}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Foundation\\Support\\Providers\\AuthServiceProvider as ServiceProvider;\nuse Illuminate\\Support\\Facades\\Gate;\n\nclass AuthServiceProvider extends ServiceProvider\n{\n    /**\n     * The policy mappings for the application.\n     *\n     * @var array\n     */\n    protected $policies = [\n        // 'App\\Models\\Model' => 'App\\Policies\\ModelPolicy',\n    ];\n\n    /**\n     * Register any authentication / authorization services.\n     *\n     * @return void\n     */\n    public function boot()\n    {\n        $this->registerPolicies();\n\n        //\n    }\n}\n", "num_lines": 31}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Support\\Facades\\Broadcast;\nuse Illuminate\\Support\\ServiceProvider;\n\nclass BroadcastServiceProvider extends ServiceProvider\n{\n    /**\n     * Bootstrap any application services.\n     *\n     * @return void\n     */\n    public function boot()\n    {\n        Broadcast::routes();\n\n        require base_path('routes/channels.php');\n    }\n}\n", "num_lines": 22}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Auth\\Events\\Registered;\nuse Illuminate\\Auth\\Listeners\\SendEmailVerificationNotification;\nuse Illuminate\\Foundation\\Support\\Providers\\EventServiceProvider as ServiceProvider;\nuse Illuminate\\Support\\Facades\\Event;\n\nclass EventServiceProvider extends ServiceProvider\n{\n    /**\n     * The event listener mappings for the application.\n     *\n     * @var array\n     */\n    protected $listen = [\n        Registered::class => [\n            SendEmailVerificationNotification::class,\n        ],\n    ];\n\n    /**\n     * Register any events for your application.\n     *\n     * @return void\n     */\n    public function boot()\n    {\n        //\n    }\n}\n", "num_lines": 33}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Cache\\RateLimiting\\Limit;\nuse Illuminate\\Foundation\\Support\\Providers\\RouteServiceProvider as ServiceProvider;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\RateLimiter;\nuse Illuminate\\Support\\Facades\\Route;\n\nclass RouteServiceProvider extends ServiceProvider\n{\n    /**\n     * The path to the \"home\" route for your application.\n     *\n     * This is used by Laravel authentication to redirect users after login.\n     *\n     * @var string\n     */\n    public const HOME = '/home';\n\n    /**\n     * The controller namespace for the application.\n     *\n     * When present, controller route declarations will automatically be prefixed with this namespace.\n     *\n     * @var string|null\n     */\n    protected $namespace = 'App\\\\Http\\\\Controllers';\n\n    /**\n     * Define your route model bindings, pattern filters, etc.\n     *\n     * @return void\n     */\n    public function boot()\n    {\n        $this->configureRateLimiting();\n\n        $this->routes(function () {\n            Route::prefix('api')\n                ->middleware('api')\n                ->namespace($this->namespace)\n                ->group(base_path('routes/api.php'));\n\n            Route::middleware('web')\n                ->namespace($this->namespace)\n                ->group(base_path('routes/web.php'));\n        });\n    }\n\n    /**\n     * Configure the rate limiters for the application.\n     *\n     * @return void\n     */\n    protected function configureRateLimiting()\n    {\n        RateLimiter::for('api', function (Request $request) {\n            return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n        });\n    }\n}\n", "num_lines": 64}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/*\n|--------------------------------------------------------------------------\n| Create The Application\n|--------------------------------------------------------------------------\n|\n| The first thing we will do is create a new Laravel application instance\n| which serves as the \"glue\" for all the components of Laravel, and is\n| the IoC container for the system binding all of the various parts.\n|\n*/\n\n$app = new Illuminate\\Foundation\\Application(\n    $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)\n);\n\n/*\n|--------------------------------------------------------------------------\n| Bind Important Interfaces\n|--------------------------------------------------------------------------\n|\n| Next, we need to bind some important interfaces into the container so\n| we will be able to resolve them when needed. The kernels serve the\n| incoming requests to this application from both the web and CLI.\n|\n*/\n\n$app->singleton(\n    Illuminate\\Contracts\\Http\\Kernel::class,\n    App\\Http\\Kernel::class\n);\n\n$app->singleton(\n    Illuminate\\Contracts\\Console\\Kernel::class,\n    App\\Console\\Kernel::class\n);\n\n$app->singleton(\n    Illuminate\\Contracts\\Debug\\ExceptionHandler::class,\n    App\\Exceptions\\Handler::class\n);\n\n/*\n|--------------------------------------------------------------------------\n| Return The Application\n|--------------------------------------------------------------------------\n|\n| This script returns the application instance. The instance is given to\n| the calling script so we can separate the building of the instances\n| from the actual running of the application and sending responses.\n|\n*/\n\nreturn $app;\n", "num_lines": 56}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Application Name\n    |--------------------------------------------------------------------------\n    |\n    | This value is the name of your application. This value is used when the\n    | framework needs to place the application's name in a notification or\n    | any other location as required by the application or its packages.\n    |\n    */\n\n    'name' => env('APP_NAME', 'Laravel'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Application Environment\n    |--------------------------------------------------------------------------\n    |\n    | This value determines the \"environment\" your application is currently\n    | running in. This may determine how you prefer to configure various\n    | services the application utilizes. Set this in your \".env\" file.\n    |\n    */\n\n    'env' => env('APP_ENV', 'production'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Application Debug Mode\n    |--------------------------------------------------------------------------\n    |\n    | When your application is in debug mode, detailed error messages with\n    | stack traces will be shown on every error that occurs within your\n    | application. If disabled, a simple generic error page is shown.\n    |\n    */\n\n    'debug' => (bool) env('APP_DEBUG', false),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Application URL\n    |--------------------------------------------------------------------------\n    |\n    | This URL is used by the console to properly generate URLs when using\n    | the Artisan command line tool. You should set this to the root of\n    | your application so that it is used when running Artisan tasks.\n    |\n    */\n\n    'url' => env('APP_URL', 'http://localhost'),\n\n    'asset_url' => env('ASSET_URL', null),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Application Timezone\n    |--------------------------------------------------------------------------\n    |\n    | Here you may specify the default timezone for your application, which\n    | will be used by the PHP date and date-time functions. We have gone\n    | ahead and set this to a sensible default for you out of the box.\n    |\n    */\n\n    'timezone' => 'UTC',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Application Locale Configuration\n    |--------------------------------------------------------------------------\n    |\n    | The application locale determines the default locale that will be used\n    | by the translation service provider. You are free to set this value\n    | to any of the locales which will be supported by the application.\n    |\n    */\n\n    'locale' => 'en',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Application Fallback Locale\n    |--------------------------------------------------------------------------\n    |\n    | The fallback locale determines the locale to use when the current one\n    | is not available. You may change the value to correspond to any of\n    | the language folders that are provided through your application.\n    |\n    */\n\n    'fallback_locale' => 'en',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Faker Locale\n    |--------------------------------------------------------------------------\n    |\n    | This locale will be used by the Faker PHP library when generating fake\n    | data for your database seeds. For example, this will be used to get\n    | localized telephone numbers, street address information and more.\n    |\n    */\n\n    'faker_locale' => 'en_US',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Encryption Key\n    |--------------------------------------------------------------------------\n    |\n    | This key is used by the Illuminate encrypter service and should be set\n    | to a random, 32 character string, otherwise these encrypted strings\n    | will not be safe. Please do this before deploying an application!\n    |\n    */\n\n    'key' => env('APP_KEY'),\n\n    'cipher' => 'AES-256-CBC',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Autoloaded Service Providers\n    |--------------------------------------------------------------------------\n    |\n    | The service providers listed here will be automatically loaded on the\n    | request to your application. Feel free to add your own services to\n    | this array to grant expanded functionality to your applications.\n    |\n    */\n\n    'providers' => [\n\n        /*\n         * Laravel Framework Service Providers...\n         */\n        Illuminate\\Auth\\AuthServiceProvider::class,\n        Illuminate\\Broadcasting\\BroadcastServiceProvider::class,\n        Illuminate\\Bus\\BusServiceProvider::class,\n        Illuminate\\Cache\\CacheServiceProvider::class,\n        Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider::class,\n        Illuminate\\Cookie\\CookieServiceProvider::class,\n        Illuminate\\Database\\DatabaseServiceProvider::class,\n        Illuminate\\Encryption\\EncryptionServiceProvider::class,\n        Illuminate\\Filesystem\\FilesystemServiceProvider::class,\n        Illuminate\\Foundation\\Providers\\FoundationServiceProvider::class,\n        Illuminate\\Hashing\\HashServiceProvider::class,\n        Illuminate\\Mail\\MailServiceProvider::class,\n        Illuminate\\Notifications\\NotificationServiceProvider::class,\n        Illuminate\\Pagination\\PaginationServiceProvider::class,\n        Illuminate\\Pipeline\\PipelineServiceProvider::class,\n        Illuminate\\Queue\\QueueServiceProvider::class,\n        Illuminate\\Redis\\RedisServiceProvider::class,\n        Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider::class,\n        Illuminate\\Session\\SessionServiceProvider::class,\n        Illuminate\\Translation\\TranslationServiceProvider::class,\n        Illuminate\\Validation\\ValidationServiceProvider::class,\n        Illuminate\\View\\ViewServiceProvider::class,\n\n        /*\n         * Package Service Providers...\n         */\n\n        /*\n         * Application Service Providers...\n         */\n        App\\Providers\\AppServiceProvider::class,\n        App\\Providers\\AuthServiceProvider::class,\n        // App\\Providers\\BroadcastServiceProvider::class,\n        App\\Providers\\EventServiceProvider::class,\n        App\\Providers\\RouteServiceProvider::class,\n\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Class Aliases\n    |--------------------------------------------------------------------------\n    |\n    | This array of class aliases will be registered when this application\n    | is started. However, feel free to register as many as you wish as\n    | the aliases are \"lazy\" loaded so they don't hinder performance.\n    |\n    */\n\n    'aliases' => [\n\n        'App' => Illuminate\\Support\\Facades\\App::class,\n        'Arr' => Illuminate\\Support\\Arr::class,\n        'Artisan' => Illuminate\\Support\\Facades\\Artisan::class,\n        'Auth' => Illuminate\\Support\\Facades\\Auth::class,\n        'Blade' => Illuminate\\Support\\Facades\\Blade::class,\n        'Broadcast' => Illuminate\\Support\\Facades\\Broadcast::class,\n        'Bus' => Illuminate\\Support\\Facades\\Bus::class,\n        'Cache' => Illuminate\\Support\\Facades\\Cache::class,\n        'Config' => Illuminate\\Support\\Facades\\Config::class,\n        'Cookie' => Illuminate\\Support\\Facades\\Cookie::class,\n        'Crypt' => Illuminate\\Support\\Facades\\Crypt::class,\n        'Date' => Illuminate\\Support\\Facades\\Date::class,\n        'DB' => Illuminate\\Support\\Facades\\DB::class,\n        'Eloquent' => Illuminate\\Database\\Eloquent\\Model::class,\n        'Event' => Illuminate\\Support\\Facades\\Event::class,\n        'File' => Illuminate\\Support\\Facades\\File::class,\n        'Gate' => Illuminate\\Support\\Facades\\Gate::class,\n        'Hash' => Illuminate\\Support\\Facades\\Hash::class,\n        'Http' => Illuminate\\Support\\Facades\\Http::class,\n        'Js' => Illuminate\\Support\\Js::class,\n        'Lang' => Illuminate\\Support\\Facades\\Lang::class,\n        'Log' => Illuminate\\Support\\Facades\\Log::class,\n        'Mail' => Illuminate\\Support\\Facades\\Mail::class,\n        'Notification' => Illuminate\\Support\\Facades\\Notification::class,\n        'Password' => Illuminate\\Support\\Facades\\Password::class,\n        'Queue' => Illuminate\\Support\\Facades\\Queue::class,\n        'RateLimiter' => Illuminate\\Support\\Facades\\RateLimiter::class,\n        'Redirect' => Illuminate\\Support\\Facades\\Redirect::class,\n        // 'Redis' => Illuminate\\Support\\Facades\\Redis::class,\n        'Request' => Illuminate\\Support\\Facades\\Request::class,\n        'Response' => Illuminate\\Support\\Facades\\Response::class,\n        'Route' => Illuminate\\Support\\Facades\\Route::class,\n        'Schema' => Illuminate\\Support\\Facades\\Schema::class,\n        'Session' => Illuminate\\Support\\Facades\\Session::class,\n        'Storage' => Illuminate\\Support\\Facades\\Storage::class,\n        'Str' => Illuminate\\Support\\Str::class,\n        'URL' => Illuminate\\Support\\Facades\\URL::class,\n        'Validator' => Illuminate\\Support\\Facades\\Validator::class,\n        'View' => Illuminate\\Support\\Facades\\View::class,\n\n    ],\n\n];\n", "num_lines": 236}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Authentication Defaults\n    |--------------------------------------------------------------------------\n    |\n    | This option controls the default authentication \"guard\" and password\n    | reset options for your application. You may change these defaults\n    | as required, but they're a perfect start for most applications.\n    |\n    */\n\n    'defaults' => [\n        'guard' => 'web',\n        'passwords' => 'users',\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Authentication Guards\n    |--------------------------------------------------------------------------\n    |\n    | Next, you may define every authentication guard for your application.\n    | Of course, a great default configuration has been defined for you\n    | here which uses session storage and the Eloquent user provider.\n    |\n    | All authentication drivers have a user provider. This defines how the\n    | users are actually retrieved out of your database or other storage\n    | mechanisms used by this application to persist your user's data.\n    |\n    | Supported: \"session\"\n    |\n    */\n\n    'guards' => [\n        'web' => [\n            'driver' => 'session',\n            'provider' => 'users',\n        ],\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | User Providers\n    |--------------------------------------------------------------------------\n    |\n    | All authentication drivers have a user provider. This defines how the\n    | users are actually retrieved out of your database or other storage\n    | mechanisms used by this application to persist your user's data.\n    |\n    | If you have multiple user tables or models you may configure multiple\n    | sources which represent each model / table. These sources may then\n    | be assigned to any extra authentication guards you have defined.\n    |\n    | Supported: \"database\", \"eloquent\"\n    |\n    */\n\n    'providers' => [\n        'users' => [\n            'driver' => 'eloquent',\n            'model' => App\\Models\\User::class,\n        ],\n\n        // 'users' => [\n        //     'driver' => 'database',\n        //     'table' => 'users',\n        // ],\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Resetting Passwords\n    |--------------------------------------------------------------------------\n    |\n    | You may specify multiple password reset configurations if you have more\n    | than one user table or model in the application and you want to have\n    | separate password reset settings based on the specific user types.\n    |\n    | The expire time is the number of minutes that the reset token should be\n    | considered valid. This security feature keeps tokens short-lived so\n    | they have less time to be guessed. You may change this as needed.\n    |\n    */\n\n    'passwords' => [\n        'users' => [\n            'provider' => 'users',\n            'table' => 'password_resets',\n            'expire' => 60,\n            'throttle' => 60,\n        ],\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Password Confirmation Timeout\n    |--------------------------------------------------------------------------\n    |\n    | Here you may define the amount of seconds before a password confirmation\n    | times out and the user is prompted to re-enter their password via the\n    | confirmation screen. By default, the timeout lasts for three hours.\n    |\n    */\n\n    'password_timeout' => 10800,\n\n];\n", "num_lines": 112}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Broadcaster\n    |--------------------------------------------------------------------------\n    |\n    | This option controls the default broadcaster that will be used by the\n    | framework when an event needs to be broadcast. You may set this to\n    | any of the connections defined in the \"connections\" array below.\n    |\n    | Supported: \"pusher\", \"ably\", \"redis\", \"log\", \"null\"\n    |\n    */\n\n    'default' => env('BROADCAST_DRIVER', 'null'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Broadcast Connections\n    |--------------------------------------------------------------------------\n    |\n    | Here you may define all of the broadcast connections that will be used\n    | to broadcast events to other systems or over websockets. Samples of\n    | each available type of connection are provided inside this array.\n    |\n    */\n\n    'connections' => [\n\n        'pusher' => [\n            'driver' => 'pusher',\n            'key' => env('PUSHER_APP_KEY'),\n            'secret' => env('PUSHER_APP_SECRET'),\n            'app_id' => env('PUSHER_APP_ID'),\n            'options' => [\n                'cluster' => env('PUSHER_APP_CLUSTER'),\n                'useTLS' => true,\n            ],\n        ],\n\n        'ably' => [\n            'driver' => 'ably',\n            'key' => env('ABLY_KEY'),\n        ],\n\n        'redis' => [\n            'driver' => 'redis',\n            'connection' => 'default',\n        ],\n\n        'log' => [\n            'driver' => 'log',\n        ],\n\n        'null' => [\n            'driver' => 'null',\n        ],\n\n    ],\n\n];\n", "num_lines": 65}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Support\\Str;\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Cache Store\n    |--------------------------------------------------------------------------\n    |\n    | This option controls the default cache connection that gets used while\n    | using this caching library. This connection is used when another is\n    | not explicitly specified when executing a given caching function.\n    |\n    */\n\n    'default' => env('CACHE_DRIVER', 'file'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Cache Stores\n    |--------------------------------------------------------------------------\n    |\n    | Here you may define all of the cache \"stores\" for your application as\n    | well as their drivers. You may even define multiple stores for the\n    | same cache driver to group types of items stored in your caches.\n    |\n    | Supported drivers: \"apc\", \"array\", \"database\", \"file\",\n    |         \"memcached\", \"redis\", \"dynamodb\", \"octane\", \"null\"\n    |\n    */\n\n    'stores' => [\n\n        'apc' => [\n            'driver' => 'apc',\n        ],\n\n        'array' => [\n            'driver' => 'array',\n            'serialize' => false,\n        ],\n\n        'database' => [\n            'driver' => 'database',\n            'table' => 'cache',\n            'connection' => null,\n            'lock_connection' => null,\n        ],\n\n        'file' => [\n            'driver' => 'file',\n            'path' => storage_path('framework/cache/data'),\n        ],\n\n        'memcached' => [\n            'driver' => 'memcached',\n            'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),\n            'sasl' => [\n                env('MEMCACHED_USERNAME'),\n                env('MEMCACHED_PASSWORD'),\n            ],\n            'options' => [\n                // Memcached::OPT_CONNECT_TIMEOUT => 2000,\n            ],\n            'servers' => [\n                [\n                    'host' => env('MEMCACHED_HOST', '127.0.0.1'),\n                    'port' => env('MEMCACHED_PORT', 11211),\n                    'weight' => 100,\n                ],\n            ],\n        ],\n\n        'redis' => [\n            'driver' => 'redis',\n            'connection' => 'cache',\n            'lock_connection' => 'default',\n        ],\n\n        'dynamodb' => [\n            'driver' => 'dynamodb',\n            'key' => env('AWS_ACCESS_KEY_ID'),\n            'secret' => env('AWS_SECRET_ACCESS_KEY'),\n            'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),\n            'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),\n            'endpoint' => env('DYNAMODB_ENDPOINT'),\n        ],\n\n        'octane' => [\n            'driver' => 'octane',\n        ],\n\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Cache Key Prefix\n    |--------------------------------------------------------------------------\n    |\n    | When utilizing a RAM based store such as APC or Memcached, there might\n    | be other applications utilizing the same cache. So, we'll specify a\n    | value to get prefixed to all our keys so we can avoid collisions.\n    |\n    */\n\n    'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),\n\n];\n", "num_lines": 111}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Cross-Origin Resource Sharing (CORS) Configuration\n    |--------------------------------------------------------------------------\n    |\n    | Here you may configure your settings for cross-origin resource sharing\n    | or \"CORS\". This determines what cross-origin operations may execute\n    | in web browsers. You are free to adjust these settings as needed.\n    |\n    | To learn more: https://developer.mozilla.org/docs/Web/HTTP/CORS\n    |\n    */\n\n    'paths' => ['api/*', 'sanctum/csrf-cookie'],\n\n    'allowed_methods' => ['*'],\n\n    'allowed_origins' => ['*'],\n\n    'allowed_origins_patterns' => [],\n\n    'allowed_headers' => ['*'],\n\n    'exposed_headers' => [],\n\n    'max_age' => 0,\n\n    'supports_credentials' => false,\n\n];\n", "num_lines": 35}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Support\\Str;\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Database Connection Name\n    |--------------------------------------------------------------------------\n    |\n    | Here you may specify which of the database connections below you wish\n    | to use as your default connection for all database work. Of course\n    | you may use many connections at once using the Database library.\n    |\n    */\n\n    'default' => env('DB_CONNECTION', 'mysql'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Database Connections\n    |--------------------------------------------------------------------------\n    |\n    | Here are each of the database connections setup for your application.\n    | Of course, examples of configuring each database platform that is\n    | supported by Laravel is shown below to make development simple.\n    |\n    |\n    | All database work in Laravel is done through the PHP PDO facilities\n    | so make sure you have the driver for your particular database of\n    | choice installed on your machine before you begin development.\n    |\n    */\n\n    'connections' => [\n\n        'sqlite' => [\n            'driver' => 'sqlite',\n            'url' => env('DATABASE_URL'),\n            'database' => env('DB_DATABASE', database_path('database.sqlite')),\n            'prefix' => '',\n            'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),\n        ],\n\n        'mysql' => [\n            'driver' => 'mysql',\n            'url' => env('DATABASE_URL'),\n            'host' => env('DB_HOST', '127.0.0.1'),\n            'port' => env('DB_PORT', '3306'),\n            'database' => env('DB_DATABASE', 'forge'),\n            'username' => env('DB_USERNAME', 'forge'),\n            'password' => env('DB_PASSWORD', ''),\n            'unix_socket' => env('DB_SOCKET', ''),\n            'charset' => 'utf8mb4',\n            'collation' => 'utf8mb4_unicode_ci',\n            'prefix' => '',\n            'prefix_indexes' => true,\n            'strict' => true,\n            'engine' => null,\n            'options' => extension_loaded('pdo_mysql') ? array_filter([\n                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),\n            ]) : [],\n        ],\n\n        'pgsql' => [\n            'driver' => 'pgsql',\n            'url' => env('DATABASE_URL'),\n            'host' => env('DB_HOST', '127.0.0.1'),\n            'port' => env('DB_PORT', '5432'),\n            'database' => env('DB_DATABASE', 'forge'),\n            'username' => env('DB_USERNAME', 'forge'),\n            'password' => env('DB_PASSWORD', ''),\n            'charset' => 'utf8',\n            'prefix' => '',\n            'prefix_indexes' => true,\n            'schema' => 'public',\n            'sslmode' => 'prefer',\n        ],\n\n        'sqlsrv' => [\n            'driver' => 'sqlsrv',\n            'url' => env('DATABASE_URL'),\n            'host' => env('DB_HOST', 'localhost'),\n            'port' => env('DB_PORT', '1433'),\n            'database' => env('DB_DATABASE', 'forge'),\n            'username' => env('DB_USERNAME', 'forge'),\n            'password' => env('DB_PASSWORD', ''),\n            'charset' => 'utf8',\n            'prefix' => '',\n            'prefix_indexes' => true,\n        ],\n\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Migration Repository Table\n    |--------------------------------------------------------------------------\n    |\n    | This table keeps track of all the migrations that have already run for\n    | your application. Using this information, we can determine which of\n    | the migrations on disk haven't actually been run in the database.\n    |\n    */\n\n    'migrations' => 'migrations',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Redis Databases\n    |--------------------------------------------------------------------------\n    |\n    | Redis is an open source, fast, and advanced key-value store that also\n    | provides a richer body of commands than a typical key-value system\n    | such as APC or Memcached. Laravel makes it easy to dig right in.\n    |\n    */\n\n    'redis' => [\n\n        'client' => env('REDIS_CLIENT', 'phpredis'),\n\n        'options' => [\n            'cluster' => env('REDIS_CLUSTER', 'redis'),\n            'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),\n        ],\n\n        'default' => [\n            'url' => env('REDIS_URL'),\n            'host' => env('REDIS_HOST', '127.0.0.1'),\n            'password' => env('REDIS_PASSWORD', null),\n            'port' => env('REDIS_PORT', '6379'),\n            'database' => env('REDIS_DB', '0'),\n        ],\n\n        'cache' => [\n            'url' => env('REDIS_URL'),\n            'host' => env('REDIS_HOST', '127.0.0.1'),\n            'password' => env('REDIS_PASSWORD', null),\n            'port' => env('REDIS_PORT', '6379'),\n            'database' => env('REDIS_CACHE_DB', '1'),\n        ],\n\n    ],\n\n];\n", "num_lines": 148}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Filesystem Disk\n    |--------------------------------------------------------------------------\n    |\n    | Here you may specify the default filesystem disk that should be used\n    | by the framework. The \"local\" disk, as well as a variety of cloud\n    | based disks are available to your application. Just store away!\n    |\n    */\n\n    'default' => env('FILESYSTEM_DRIVER', 'local'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Filesystem Disks\n    |--------------------------------------------------------------------------\n    |\n    | Here you may configure as many filesystem \"disks\" as you wish, and you\n    | may even configure multiple disks of the same driver. Defaults have\n    | been setup for each driver as an example of the required options.\n    |\n    | Supported Drivers: \"local\", \"ftp\", \"sftp\", \"s3\"\n    |\n    */\n\n    'disks' => [\n\n        'local' => [\n            'driver' => 'local',\n            'root' => storage_path('app'),\n        ],\n\n        'public' => [\n            'driver' => 'local',\n            'root' => storage_path('app/public'),\n            'url' => env('APP_URL').'/storage',\n            'visibility' => 'public',\n        ],\n\n        's3' => [\n            'driver' => 's3',\n            'key' => env('AWS_ACCESS_KEY_ID'),\n            'secret' => env('AWS_SECRET_ACCESS_KEY'),\n            'region' => env('AWS_DEFAULT_REGION'),\n            'bucket' => env('AWS_BUCKET'),\n            'url' => env('AWS_URL'),\n            'endpoint' => env('AWS_ENDPOINT'),\n            'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),\n        ],\n\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Symbolic Links\n    |--------------------------------------------------------------------------\n    |\n    | Here you may configure the symbolic links that will be created when the\n    | `storage:link` Artisan command is executed. The array keys should be\n    | the locations of the links and the values should be their targets.\n    |\n    */\n\n    'links' => [\n        public_path('storage') => storage_path('app/public'),\n    ],\n\n];\n", "num_lines": 74}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Hash Driver\n    |--------------------------------------------------------------------------\n    |\n    | This option controls the default hash driver that will be used to hash\n    | passwords for your application. By default, the bcrypt algorithm is\n    | used; however, you remain free to modify this option if you wish.\n    |\n    | Supported: \"bcrypt\", \"argon\", \"argon2id\"\n    |\n    */\n\n    'driver' => 'bcrypt',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Bcrypt Options\n    |--------------------------------------------------------------------------\n    |\n    | Here you may specify the configuration options that should be used when\n    | passwords are hashed using the Bcrypt algorithm. This will allow you\n    | to control the amount of time it takes to hash the given password.\n    |\n    */\n\n    'bcrypt' => [\n        'rounds' => env('BCRYPT_ROUNDS', 10),\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Argon Options\n    |--------------------------------------------------------------------------\n    |\n    | Here you may specify the configuration options that should be used when\n    | passwords are hashed using the Argon algorithm. These will allow you\n    | to control the amount of time it takes to hash the given password.\n    |\n    */\n\n    'argon' => [\n        'memory' => 1024,\n        'threads' => 2,\n        'time' => 2,\n    ],\n\n];\n", "num_lines": 53}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Monolog\\Handler\\NullHandler;\nuse Monolog\\Handler\\StreamHandler;\nuse Monolog\\Handler\\SyslogUdpHandler;\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Log Channel\n    |--------------------------------------------------------------------------\n    |\n    | This option defines the default log channel that gets used when writing\n    | messages to the logs. The name specified in this option should match\n    | one of the channels defined in the \"channels\" configuration array.\n    |\n    */\n\n    'default' => env('LOG_CHANNEL', 'stack'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Deprecations Log Channel\n    |--------------------------------------------------------------------------\n    |\n    | This option controls the log channel that should be used to log warnings\n    | regarding deprecated PHP and library features. This allows you to get\n    | your application ready for upcoming major versions of dependencies.\n    |\n    */\n\n    'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Log Channels\n    |--------------------------------------------------------------------------\n    |\n    | Here you may configure the log channels for your application. Out of\n    | the box, Laravel uses the Monolog PHP logging library. This gives\n    | you a variety of powerful log handlers / formatters to utilize.\n    |\n    | Available Drivers: \"single\", \"daily\", \"slack\", \"syslog\",\n    |                    \"errorlog\", \"monolog\",\n    |                    \"custom\", \"stack\"\n    |\n    */\n\n    'channels' => [\n        'stack' => [\n            'driver' => 'stack',\n            'channels' => ['single'],\n            'ignore_exceptions' => false,\n        ],\n\n        'single' => [\n            'driver' => 'single',\n            'path' => storage_path('logs/laravel.log'),\n            'level' => env('LOG_LEVEL', 'debug'),\n        ],\n\n        'daily' => [\n            'driver' => 'daily',\n            'path' => storage_path('logs/laravel.log'),\n            'level' => env('LOG_LEVEL', 'debug'),\n            'days' => 14,\n        ],\n\n        'slack' => [\n            'driver' => 'slack',\n            'url' => env('LOG_SLACK_WEBHOOK_URL'),\n            'username' => 'Laravel Log',\n            'emoji' => ':boom:',\n            'level' => env('LOG_LEVEL', 'critical'),\n        ],\n\n        'papertrail' => [\n            'driver' => 'monolog',\n            'level' => env('LOG_LEVEL', 'debug'),\n            'handler' => SyslogUdpHandler::class,\n            'handler_with' => [\n                'host' => env('PAPERTRAIL_URL'),\n                'port' => env('PAPERTRAIL_PORT'),\n            ],\n        ],\n\n        'stderr' => [\n            'driver' => 'monolog',\n            'level' => env('LOG_LEVEL', 'debug'),\n            'handler' => StreamHandler::class,\n            'formatter' => env('LOG_STDERR_FORMATTER'),\n            'with' => [\n                'stream' => 'php://stderr',\n            ],\n        ],\n\n        'syslog' => [\n            'driver' => 'syslog',\n            'level' => env('LOG_LEVEL', 'debug'),\n        ],\n\n        'errorlog' => [\n            'driver' => 'errorlog',\n            'level' => env('LOG_LEVEL', 'debug'),\n        ],\n\n        'null' => [\n            'driver' => 'monolog',\n            'handler' => NullHandler::class,\n        ],\n\n        'emergency' => [\n            'path' => storage_path('logs/laravel.log'),\n        ],\n    ],\n\n];\n", "num_lines": 119}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Mailer\n    |--------------------------------------------------------------------------\n    |\n    | This option controls the default mailer that is used to send any email\n    | messages sent by your application. Alternative mailers may be setup\n    | and used as needed; however, this mailer will be used by default.\n    |\n    */\n\n    'default' => env('MAIL_MAILER', 'smtp'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Mailer Configurations\n    |--------------------------------------------------------------------------\n    |\n    | Here you may configure all of the mailers used by your application plus\n    | their respective settings. Several examples have been configured for\n    | you and you are free to add your own as your application requires.\n    |\n    | Laravel supports a variety of mail \"transport\" drivers to be used while\n    | sending an e-mail. You will specify which one you are using for your\n    | mailers below. You are free to add additional mailers as required.\n    |\n    | Supported: \"smtp\", \"sendmail\", \"mailgun\", \"ses\",\n    |            \"postmark\", \"log\", \"array\", \"failover\"\n    |\n    */\n\n    'mailers' => [\n        'smtp' => [\n            'transport' => 'smtp',\n            'host' => env('MAIL_HOST', 'smtp.mailgun.org'),\n            'port' => env('MAIL_PORT', 587),\n            'encryption' => env('MAIL_ENCRYPTION', 'tls'),\n            'username' => env('MAIL_USERNAME'),\n            'password' => env('MAIL_PASSWORD'),\n            'timeout' => null,\n            'auth_mode' => null,\n        ],\n\n        'ses' => [\n            'transport' => 'ses',\n        ],\n\n        'mailgun' => [\n            'transport' => 'mailgun',\n        ],\n\n        'postmark' => [\n            'transport' => 'postmark',\n        ],\n\n        'sendmail' => [\n            'transport' => 'sendmail',\n            'path' => '/usr/sbin/sendmail -bs',\n        ],\n\n        'log' => [\n            'transport' => 'log',\n            'channel' => env('MAIL_LOG_CHANNEL'),\n        ],\n\n        'array' => [\n            'transport' => 'array',\n        ],\n\n        'failover' => [\n            'transport' => 'failover',\n            'mailers' => [\n                'smtp',\n                'log',\n            ],\n        ],\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Global \"From\" Address\n    |--------------------------------------------------------------------------\n    |\n    | You may wish for all e-mails sent by your application to be sent from\n    | the same address. Here, you may specify a name and address that is\n    | used globally for all e-mails that are sent by your application.\n    |\n    */\n\n    'from' => [\n        'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),\n        'name' => env('MAIL_FROM_NAME', 'Example'),\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Markdown Mail Settings\n    |--------------------------------------------------------------------------\n    |\n    | If you are using Markdown based email rendering, you may configure your\n    | theme and component paths here, allowing you to customize the design\n    | of the emails. Or, you may simply stick with the Laravel defaults!\n    |\n    */\n\n    'markdown' => [\n        'theme' => 'default',\n\n        'paths' => [\n            resource_path('views/vendor/mail'),\n        ],\n    ],\n\n];\n", "num_lines": 119}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Queue Connection Name\n    |--------------------------------------------------------------------------\n    |\n    | Laravel's queue API supports an assortment of back-ends via a single\n    | API, giving you convenient access to each back-end using the same\n    | syntax for every one. Here you may define a default connection.\n    |\n    */\n\n    'default' => env('QUEUE_CONNECTION', 'sync'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Queue Connections\n    |--------------------------------------------------------------------------\n    |\n    | Here you may configure the connection information for each server that\n    | is used by your application. A default configuration has been added\n    | for each back-end shipped with Laravel. You are free to add more.\n    |\n    | Drivers: \"sync\", \"database\", \"beanstalkd\", \"sqs\", \"redis\", \"null\"\n    |\n    */\n\n    'connections' => [\n\n        'sync' => [\n            'driver' => 'sync',\n        ],\n\n        'database' => [\n            'driver' => 'database',\n            'table' => 'jobs',\n            'queue' => 'default',\n            'retry_after' => 90,\n            'after_commit' => false,\n        ],\n\n        'beanstalkd' => [\n            'driver' => 'beanstalkd',\n            'host' => 'localhost',\n            'queue' => 'default',\n            'retry_after' => 90,\n            'block_for' => 0,\n            'after_commit' => false,\n        ],\n\n        'sqs' => [\n            'driver' => 'sqs',\n            'key' => env('AWS_ACCESS_KEY_ID'),\n            'secret' => env('AWS_SECRET_ACCESS_KEY'),\n            'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),\n            'queue' => env('SQS_QUEUE', 'default'),\n            'suffix' => env('SQS_SUFFIX'),\n            'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),\n            'after_commit' => false,\n        ],\n\n        'redis' => [\n            'driver' => 'redis',\n            'connection' => 'default',\n            'queue' => env('REDIS_QUEUE', 'default'),\n            'retry_after' => 90,\n            'block_for' => null,\n            'after_commit' => false,\n        ],\n\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Failed Queue Jobs\n    |--------------------------------------------------------------------------\n    |\n    | These options configure the behavior of failed queue job logging so you\n    | can control which database and table are used to store the jobs that\n    | have failed. You may change them to any database / table you wish.\n    |\n    */\n\n    'failed' => [\n        'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),\n        'database' => env('DB_CONNECTION', 'mysql'),\n        'table' => 'failed_jobs',\n    ],\n\n];\n", "num_lines": 94}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Stateful Domains\n    |--------------------------------------------------------------------------\n    |\n    | Requests from the following domains / hosts will receive stateful API\n    | authentication cookies. Typically, these should include your local\n    | and production domains which access your API via a frontend SPA.\n    |\n    */\n\n    'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(\n        '%s%s',\n        'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',\n        env('APP_URL') ? ','.parse_url(env('APP_URL'), PHP_URL_HOST) : ''\n    ))),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Sanctum Guards\n    |--------------------------------------------------------------------------\n    |\n    | This array contains the authentication guards that will be checked when\n    | Sanctum is trying to authenticate a request. If none of these guards\n    | are able to authenticate the request, Sanctum will use the bearer\n    | token that's present on an incoming request for authentication.\n    |\n    */\n\n    'guard' => ['web'],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Expiration Minutes\n    |--------------------------------------------------------------------------\n    |\n    | This value controls the number of minutes until an issued token will be\n    | considered expired. If this value is null, personal access tokens do\n    | not expire. This won't tweak the lifetime of first-party sessions.\n    |\n    */\n\n    'expiration' => null,\n\n    /*\n    |--------------------------------------------------------------------------\n    | Sanctum Middleware\n    |--------------------------------------------------------------------------\n    |\n    | When authenticating your first-party SPA with Sanctum you may need to\n    | customize some of the middleware Sanctum uses while processing the\n    | request. You may change the middleware listed below as required.\n    |\n    */\n\n    'middleware' => [\n        'verify_csrf_token' => App\\Http\\Middleware\\VerifyCsrfToken::class,\n        'encrypt_cookies' => App\\Http\\Middleware\\EncryptCookies::class,\n    ],\n\n];\n", "num_lines": 66}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Third Party Services\n    |--------------------------------------------------------------------------\n    |\n    | This file is for storing the credentials for third party services such\n    | as Mailgun, Postmark, AWS and more. This file provides the de facto\n    | location for this type of information, allowing packages to have\n    | a conventional file to locate the various service credentials.\n    |\n    */\n\n    'mailgun' => [\n        'domain' => env('MAILGUN_DOMAIN'),\n        'secret' => env('MAILGUN_SECRET'),\n        'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),\n    ],\n\n    'postmark' => [\n        'token' => env('POSTMARK_TOKEN'),\n    ],\n\n    'ses' => [\n        'key' => env('AWS_ACCESS_KEY_ID'),\n        'secret' => env('AWS_SECRET_ACCESS_KEY'),\n        'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),\n    ],\n\n];\n", "num_lines": 34}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Support\\Str;\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Session Driver\n    |--------------------------------------------------------------------------\n    |\n    | This option controls the default session \"driver\" that will be used on\n    | requests. By default, we will use the lightweight native driver but\n    | you may specify any of the other wonderful drivers provided here.\n    |\n    | Supported: \"file\", \"cookie\", \"database\", \"apc\",\n    |            \"memcached\", \"redis\", \"dynamodb\", \"array\"\n    |\n    */\n\n    'driver' => env('SESSION_DRIVER', 'cookie'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Lifetime\n    |--------------------------------------------------------------------------\n    |\n    | Here you may specify the number of minutes that you wish the session\n    | to be allowed to remain idle before it expires. If you want them\n    | to immediately expire on the browser closing, set that option.\n    |\n    */\n\n    'lifetime' => env('SESSION_LIFETIME', 120),\n\n    'expire_on_close' => false,\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Encryption\n    |--------------------------------------------------------------------------\n    |\n    | This option allows you to easily specify that all of your session data\n    | should be encrypted before it is stored. All encryption will be run\n    | automatically by Laravel and you can use the Session like normal.\n    |\n    */\n\n    'encrypt' => false,\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session File Location\n    |--------------------------------------------------------------------------\n    |\n    | When using the native session driver, we need a location where session\n    | files may be stored. A default has been set for you but a different\n    | location may be specified. This is only needed for file sessions.\n    |\n    */\n\n    'files' => storage_path('framework/sessions'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Database Connection\n    |--------------------------------------------------------------------------\n    |\n    | When using the \"database\" or \"redis\" session drivers, you may specify a\n    | connection that should be used to manage these sessions. This should\n    | correspond to a connection in your database configuration options.\n    |\n    */\n\n    'connection' => env('SESSION_CONNECTION', null),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Database Table\n    |--------------------------------------------------------------------------\n    |\n    | When using the \"database\" session driver, you may specify the table we\n    | should use to manage the sessions. Of course, a sensible default is\n    | provided for you; however, you are free to change this as needed.\n    |\n    */\n\n    'table' => 'sessions',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Cache Store\n    |--------------------------------------------------------------------------\n    |\n    | While using one of the framework's cache driven session backends you may\n    | list a cache store that should be used for these sessions. This value\n    | must match with one of the application's configured cache \"stores\".\n    |\n    | Affects: \"apc\", \"dynamodb\", \"memcached\", \"redis\"\n    |\n    */\n\n    'store' => env('SESSION_STORE', null),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Sweeping Lottery\n    |--------------------------------------------------------------------------\n    |\n    | Some session drivers must manually sweep their storage location to get\n    | rid of old sessions from storage. Here are the chances that it will\n    | happen on a given request. By default, the odds are 2 out of 100.\n    |\n    */\n\n    'lottery' => [2, 100],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Cookie Name\n    |--------------------------------------------------------------------------\n    |\n    | Here you may change the name of the cookie used to identify a session\n    | instance by ID. The name specified here will get used every time a\n    | new session cookie is created by the framework for every driver.\n    |\n    */\n\n    'cookie' => env(\n        'SESSION_COOKIE',\n        Str::slug(env('APP_NAME', 'laravel'), '_').'_session'\n    ),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Cookie Path\n    |--------------------------------------------------------------------------\n    |\n    | The session cookie path determines the path for which the cookie will\n    | be regarded as available. Typically, this will be the root path of\n    | your application but you are free to change this when necessary.\n    |\n    */\n\n    'path' => '/',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Cookie Domain\n    |--------------------------------------------------------------------------\n    |\n    | Here you may change the domain of the cookie used to identify a session\n    | in your application. This will determine which domains the cookie is\n    | available to in your application. A sensible default has been set.\n    |\n    */\n\n    'domain' => env('SESSION_DOMAIN', null),\n\n    /*\n    |--------------------------------------------------------------------------\n    | HTTPS Only Cookies\n    |--------------------------------------------------------------------------\n    |\n    | By setting this option to true, session cookies will only be sent back\n    | to the server if the browser has a HTTPS connection. This will keep\n    | the cookie from being sent to you when it can't be done securely.\n    |\n    */\n\n    'secure' => env('SESSION_SECURE_COOKIE'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | HTTP Access Only\n    |--------------------------------------------------------------------------\n    |\n    | Setting this value to true will prevent JavaScript from accessing the\n    | value of the cookie and the cookie will only be accessible through\n    | the HTTP protocol. You are free to modify this option if needed.\n    |\n    */\n\n    'http_only' => true,\n\n    /*\n    |--------------------------------------------------------------------------\n    | Same-Site Cookies\n    |--------------------------------------------------------------------------\n    |\n    | This option determines how your cookies behave when cross-site requests\n    | take place, and can be used to mitigate CSRF attacks. By default, we\n    | will set this value to \"lax\" since this is a secure default value.\n    |\n    | Supported: \"lax\", \"strict\", \"none\", null\n    |\n    */\n\n    'same_site' => 'lax',\n\n];\n", "num_lines": 202}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | View Storage Paths\n    |--------------------------------------------------------------------------\n    |\n    | Most templating systems load templates from disk. Here you may specify\n    | an array of paths that should be checked for your views. Of course\n    | the usual Laravel view path has already been registered for you.\n    |\n    */\n\n    'paths' => [\n        resource_path('views'),\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Compiled View Path\n    |--------------------------------------------------------------------------\n    |\n    | This option determines where all the compiled Blade templates will be\n    | stored for your application. Typically, this is within the storage\n    | directory. However, as usual, you are free to change this value.\n    |\n    */\n\n    'compiled' => env(\n        'VIEW_COMPILED_PATH',\n        realpath(storage_path('framework/views'))\n    ),\n\n];\n", "num_lines": 37}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Database\\Factories;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\Factory;\nuse Illuminate\\Support\\Str;\n\nclass UserFactory extends Factory\n{\n    /**\n     * Define the model's default state.\n     *\n     * @return array\n     */\n    public function definition()\n    {\n        return [\n            'name' => $this->faker->name(),\n            'email' => $this->faker->unique()->safeEmail(),\n            'email_verified_at' => now(),\n            'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password\n            'remember_token' => Str::random(10),\n        ];\n    }\n\n    /**\n     * Indicate that the model's email address should be unverified.\n     *\n     * @return \\Illuminate\\Database\\Eloquent\\Factories\\Factory\n     */\n    public function unverified()\n    {\n        return $this->state(function (array $attributes) {\n            return [\n                'email_verified_at' => null,\n            ];\n        });\n    }\n}\n", "num_lines": 40}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreateUserTable extends Migration\n{\n\t/**\n\t * Run the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function up()\n\t{\n\t\tSchema::create('users', function (Blueprint $table) {\n\t\t\t$table->id();\n\t\t\t$table->string('name', 64);\n\t\t\t$table->string('address', 256);\n\t\t\t$table->string('email', 128);\n\t\t\t$table->string('password', 128);\n\t\t\t$table->timestamps();\n\t\t\t$table->engine = 'InnoDB';\n\t\t\t$table->charset = 'utf8';\n\t\t\t$table->collation = 'utf8_general_ci';\n\t\t});\n\t}\n\n\t/**\n\t * Reverse the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function down()\n\t{\n\t\tSchema::dropIfExists('users');\n\t}\n}\n", "num_lines": 39}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreateCategoryTable extends Migration\n{\n\t/**\n\t * Run the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function up()\n\t{\n\t\tSchema::create('categories', function (Blueprint $table) {\n\t\t\t$table->id();\n\t\t\t$table->string('name', 32);\n\t\t\t$table->string('url', 32);\n\t\t\t$table->string('img', 128);\n\t\t\t$table->timestamps();\n\t\t\t$table->engine = 'InnoDB';\n\t\t\t$table->charset = 'utf8';\n\t\t\t$table->collation = 'utf8_general_ci';\n\t\t});\n\t}\n\n\t/**\n\t * Reverse the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function down()\n\t{\n\t\tSchema::dropIfExists('categories');\n\t}\n}\n", "num_lines": 38}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreateItemTable extends Migration\n{\n\t/**\n\t * Run the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function up()\n\t{\n\t\tSchema::create('items', function (Blueprint $table) {\n\t\t\t$table->id();\n\t\t\t$table->bigInteger('category_id')->unsigned();\n\t\t\t$table->string('name', 32);\n\t\t\t$table->string('img', 128);\n\t\t\t$table->decimal('price', $precision = 6, $scale = 2);\n\t\t\t$table->unsignedSmallInteger('cooktime');\n\t\t\t$table->text('desc');\n\t\t\t$table->timestamps();\n\t\t\t$table->engine = 'InnoDB';\n\t\t\t$table->charset = 'utf8';\n\t\t\t$table->collation = 'utf8_general_ci';\n\t\t});\n\t\tSchema::table('items', function (Blueprint $table) {\n\t\t\t$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');\n\t\t});\n\t}\n\n\t/**\n\t * Reverse the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function down()\n\t{\n\t\tSchema::dropIfExists('items');\n\t}\n}\n", "num_lines": 44}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreateCartTable extends Migration\n{\n\t/**\n\t * Run the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function up()\n\t{\n\t\tSchema::create('carts', function (Blueprint $table) {\n\t\t\t$table->id();\n\t\t\t$table->bigInteger('user_id')->unsigned();\n\t\t\t$table->string('status', 16);\n\t\t\t$table->timestamps();\n\t\t\t$table->engine = 'InnoDB';\n\t\t\t$table->charset = 'utf8';\n\t\t\t$table->collation = 'utf8_general_ci';\n\t\t});\n\t\tSchema::table('carts', function (Blueprint $table) {\n\t\t\t$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');\n\t\t});\n\t}\n\n\t/**\n\t * Reverse the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function down()\n\t{\n\t\tSchema::dropIfExists('carts');\n\t}\n}\n", "num_lines": 40}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreateOrderTable extends Migration\n{\n\t/**\n\t * Run the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function up()\n\t{\n\t\tSchema::create('orders', function (Blueprint $table) {\n\t\t\t$table->id();\n\t\t\t$table->bigInteger('user_id')->unsigned();\n\t\t\t$table->bigInteger('cart_id')->unsigned();\n\t\t\t$table->string('name', 64);\n\t\t\t$table->string('address', 256);\n\t\t\t$table->text('special_instructions')->nullable();\n\t\t\t$table->unsignedSmallInteger('cooktime');\n\t\t\t$table->timestamps();\n\t\t\t$table->engine = 'InnoDB';\n\t\t\t$table->charset = 'utf8';\n\t\t\t$table->collation = 'utf8_general_ci';\n\t\t});\n\t\tSchema::table('orders', function (Blueprint $table) {\n\t\t\t$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');\n\t\t\t$table->foreign('cart_id')->references('id')->on('carts')->onDelete('cascade');\n\t\t});\n\t}\n\n\t/**\n\t * Reverse the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function down()\n\t{\n\t\tSchema::dropIfExists('orders');\n\t}\n}\n", "num_lines": 45}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreateCartItemsTable extends Migration\n{\n\t/**\n\t * Run the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function up()\n\t{\n\t\tSchema::create('cart_items', function (Blueprint $table) {\n\t\t\t$table->id();\n\t\t\t$table->bigInteger('cart_id')->unsigned();\n\t\t\t$table->bigInteger('item_id')->unsigned();\n\t\t\t$table->unsignedSmallInteger('qty');\n\t\t\t$table->timestamps();\n\t\t\t$table->engine = 'InnoDB';\n\t\t\t$table->charset = 'utf8';\n\t\t\t$table->collation = 'utf8_general_ci';\n\t\t});\n\t\tSchema::table('cart_items', function (Blueprint $table) {\n\t\t\t$table->foreign('cart_id')->references('id')->on('carts')->onDelete('cascade');\n\t\t\t$table->foreign('item_id')->references('id')->on('items')->onDelete('cascade');\n\t\t});\n\t}\n\n\t/**\n\t * Reverse the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function down()\n\t{\n\t\tSchema::dropIfExists('cart_items');\n\t}\n}\n", "num_lines": 42}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Database\\Seeders;\n\nuse Illuminate\\Database\\Seeder;\nuse Illuminate\\Support\\Facades\\DB;\n\nuse App\\Models\\Category;\n\nclass CategorySeeder extends Seeder\n{\n\t/**\n\t * Run the database seeds.\n\t *\n\t * @return void\n\t */\n\tpublic function run()\n\t{\n\t\t// DB::table('categories')->truncate();\n\t\tCategory::query()->delete();\n\t\tDB::statement(\"ALTER TABLE `categories` AUTO_INCREMENT = 1\");\n\n\t\t$categories = [\n\t\t\t[\n\t\t\t\t'name' => 'Breakfast',\n\t\t\t\t'url' => 'breakfast',\n\t\t\t\t'img' => 'potatoes-g792cf4128_1920.jpg',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Steak',\n\t\t\t\t'url' => 'steak',\n\t\t\t\t'img' => 'tomahawk-ge5ea2413d_1920.jpg',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Pizza',\n\t\t\t\t'url' => 'pizza',\n\t\t\t\t'img' => 'pizza-g204a8b3d6_1920.jpg',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Burgers',\n\t\t\t\t'url' => 'burgers',\n\t\t\t\t'img' => 'hamburger-g685f013b8_1920.jpg',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Sushi',\n\t\t\t\t'url' => 'sushi',\n\t\t\t\t'img' => 'food-g3eb975adc_1920.jpg',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Salads',\n\t\t\t\t'url' => 'salads',\n\t\t\t\t'img' => 'salad-g3f02f56a0_1920.jpg',\n\t\t\t],\n\t\t];\n\t\tCategory::insert($categories);\n\t}\n}\n", "num_lines": 58}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Database\\Seeders;\n\nuse Illuminate\\Database\\Seeder;\n\nclass DatabaseSeeder extends Seeder\n{\n\t/**\n\t * Seed the application's database.\n\t *\n\t * @return void\n\t */\n\tpublic function run()\n\t{\n\t\t// \\App\\Models\\User::factory(10)->create();\n\t\t$this->call([\n\t\t\tCategorySeeder::class,\n\t\t\tItemSeeder::class,\n\t\t\tUserSeeder::class,\n\t\t]);\n\t}\n}\n", "num_lines": 24}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Database\\Seeders;\n\nuse Illuminate\\Database\\Seeder;\nuse Illuminate\\Support\\Facades\\DB;\n\nuse App\\Models\\Item;\n\nclass ItemSeeder extends Seeder\n{\n\t/**\n\t * Run the database seeds.\n\t *\n\t * @return void\n\t */\n\tpublic function run()\n\t{\n\t\t// DB::table('items')->truncate();\n\t\tItem::query()->delete();\n\t\tDB::statement(\"ALTER TABLE `items` AUTO_INCREMENT = 1\");\n\n\t\t$items = [\n\t\t\t// breakfast\n\t\t\t[\n\t\t\t\t'category_id' => 1,\n\t\t\t\t'name' => 'Cinnamon Roll',\n\t\t\t\t'img' => 'cinnamon-rolls-gb12ce8577_1920.jpg',\n\t\t\t\t'price' => '1.19',\n\t\t\t\t'cooktime' => 13,\n\t\t\t\t'desc' => 'Cupcake ipsum dolor sit amet drag\u00c3\u00a9e topping topping. Powder cheesecake cake shortbread gummies lollipop jelly carrot cake. Pudding sugar plum carrot cake I love muffin. Dessert topping croissant I love tart souffl\u00c3\u00a9 cheesecake sweet sweet. Liquorice pie marshmallow icing topping muffin. Topping brownie oat cake carrot cake donut chocolate bar cake. Bear claw jelly-o ice cream lollipop shortbread dessert jujubes macaroon. I love danish tootsie roll powder candy canes marzipan icing gingerbread chocolate bar.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 1,\n\t\t\t\t'name' => 'Toast & Eggs',\n\t\t\t\t'img' => 'breakfast-g7a2675ee6_1920.jpg',\n\t\t\t\t'price' => '2.19',\n\t\t\t\t'cooktime' => 7,\n\t\t\t\t'desc' => 'Tiramisu muffin sweet roll cotton candy icing bonbon jelly. Tiramisu oat cake shortbread toffee bonbon shortbread candy canes toffee. Sweet roll biscuit I love oat cake gummies bonbon biscuit danish lemon drops. Toffee ice cream jelly beans caramels muffin. Tart jujubes chocolate bar marshmallow gingerbread I love pie. Chocolate I love chocolate cake cake liquorice lollipop. Tiramisu chocolate jelly-o muffin halvah. Shortbread souffl\u00c3\u00a9 ice cream oat cake cotton candy sesame snaps liquorice. Danish marzipan I love jelly brownie muffin halvah candy canes.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 1,\n\t\t\t\t'name' => 'Croissant',\n\t\t\t\t'img' => 'croissant-ga61b1fb0e_1920.jpg',\n\t\t\t\t'price' => '3.19',\n\t\t\t\t'cooktime' => 2,\n\t\t\t\t'desc' => 'I love chocolate cake I love I love jelly beans cotton candy jelly-o ice cream. Icing cotton candy sweet roll fruitcake biscuit apple pie. Gummies chocolate caramels biscuit I love I love I love cookie croissant. Topping apple pie wafer sesame snaps tootsie roll gummies. Apple pie I love wafer sweet roll tootsie roll. Cheesecake I love apple pie muffin tiramisu lemon drops cake. Macaroon caramels chocolate cotton candy souffl\u00c3\u00a9 tart. Chupa chups lemon drops cupcake topping pastry.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 1,\n\t\t\t\t'name' => 'Bacon & Eggs',\n\t\t\t\t'img' => 'eggs-g9c07e92b1_1920.jpg',\n\t\t\t\t'price' => '4.19',\n\t\t\t\t'cooktime' => 14,\n\t\t\t\t'desc' => 'Toffee sesame snaps chupa chups pie pastry marshmallow I love tootsie roll souffl\u00c3\u00a9. Marshmallow fruitcake cheesecake I love icing cake. Liquorice toffee chocolate bar marzipan cotton candy croissant powder. Bonbon I love danish bear claw tootsie roll. Candy canes wafer fruitcake caramels lollipop tart. Oat cake croissant tart gummi bears cookie muffin. Icing sweet roll chupa chups chupa chups jelly-o brownie. Jelly-o cotton candy liquorice tiramisu halvah jujubes.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 1,\n\t\t\t\t'name' => 'Pancakes',\n\t\t\t\t'img' => 'pancakes-g9d341228a_1920.jpg',\n\t\t\t\t'price' => '5.19',\n\t\t\t\t'cooktime' => 12,\n\t\t\t\t'desc' => 'Chocolate caramels gingerbread drag\u00c3\u00a9e gingerbread brownie powder gummi bears pastry. Sugar plum sugar plum tootsie roll shortbread I love cotton candy. Chocolate cake chocolate bonbon cake biscuit. Toffee cheesecake I love cookie cake marzipan I love chocolate cake liquorice. Biscuit biscuit caramels macaroon lollipop powder tootsie roll. Shortbread jelly-o jujubes jelly-o chocolate carrot cake danish croissant. Biscuit jelly-o donut bonbon muffin carrot cake sesame snaps wafer chupa chups. Chupa chups chocolate bar bonbon I love jelly beans lemon drops macaroon muffin. Chocolate cake cookie jelly-o cake cake croissant muffin halvah candy. Apple pie icing pudding chupa chups macaroon I love biscuit fruitcake I love.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 1,\n\t\t\t\t'name' => 'Biscuits & Gravy',\n\t\t\t\t'img' => 'biscuits-g07bd069f8_1920.jpg',\n\t\t\t\t'price' => '6.19',\n\t\t\t\t'cooktime' => 6,\n\t\t\t\t'desc' => 'Souffl\u00c3\u00a9 marshmallow I love candy canes I love apple pie. Icing wafer I love toffee carrot cake cookie candy canes bear claw pastry. Lollipop topping pudding dessert powder jujubes sesame snaps bonbon apple pie. Macaroon tootsie roll dessert cake I love wafer macaroon sweet roll sesame snaps. Wafer cupcake bear claw sweet brownie I love. Pastry I love muffin marzipan I love topping. Pie candy muffin jelly-o croissant cake sweet. Wafer chocolate lemon drops jujubes lollipop drag\u00c3\u00a9e I love jelly. I love macaroon I love powder tootsie roll jelly muffin wafer.',\n\t\t\t],\n\t\t\t// steak\n\t\t\t[\n\t\t\t\t'category_id' => 2,\n\t\t\t\t'name' => 'Tomahawk',\n\t\t\t\t'img' => 'steak-4342500_1920.jpg',\n\t\t\t\t'price' => '1.29',\n\t\t\t\t'cooktime' => 27,\n\t\t\t\t'desc' => 'Bacon ipsum dolor amet shank picanha landjaeger kevin, ham hock spare ribs sausage capicola buffalo alcatra. Short loin spare ribs alcatra bresaola. Salami tongue drumstick tenderloin flank alcatra shank sirloin biltong landjaeger short ribs jerky. Porchetta meatloaf fatback frankfurter bacon tail, ham biltong kielbasa short ribs pork capicola leberkas jowl. Chicken tenderloin kielbasa pork belly, ham hock jowl bacon salami chuck burgdoggen hamburger tongue short loin biltong. Frankfurter sirloin meatloaf ribeye.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 2,\n\t\t\t\t'name' => 'Sirloin',\n\t\t\t\t'img' => 'steak-1076665_1920.jpg',\n\t\t\t\t'price' => '2.29',\n\t\t\t\t'cooktime' => 22,\n\t\t\t\t'desc' => 'Meatball fatback pastrami, porchetta doner chicken burgdoggen pancetta jerky beef ribs salami. Buffalo ball tip tenderloin chuck, frankfurter alcatra ribeye t-bone spare ribs. Hamburger pork chop swine, picanha flank corned beef burgdoggen shoulder frankfurter ham ball tip. Chicken biltong short ribs short loin spare ribs. Pork loin jerky pork chop, fatback frankfurter filet mignon turducken kevin swine. Prosciutto kielbasa short ribs shoulder frankfurter hamburger. Swine leberkas alcatra jerky, ball tip pastrami meatloaf pork belly doner venison turkey buffalo ham hock pig.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 2,\n\t\t\t\t'name' => 'T-Bone',\n\t\t\t\t'img' => 'steak-978654_1920.jpg',\n\t\t\t\t'price' => '3.29',\n\t\t\t\t'cooktime' => 23,\n\t\t\t\t'desc' => 'Swine doner leberkas tri-tip pork loin hamburger cupim alcatra spare ribs kielbasa bacon. Shoulder tail alcatra meatloaf beef hamburger, short loin tri-tip cupim ham pork chop. Corned beef kevin strip steak tri-tip. Landjaeger meatball chuck biltong salami fatback jerky pastrami shank beef. Frankfurter ground round strip steak pork chop shoulder, picanha pig doner prosciutto chislic ham. Ham hock alcatra shankle chislic rump landjaeger brisket pork leberkas t-bone meatloaf pancetta pork loin.',\n\t\t\t],\n\t\t\t// pizza\n\t\t\t[\n\t\t\t\t'category_id' => 3,\n\t\t\t\t'name' => 'Pepperoni',\n\t\t\t\t'img' => 'pizza-1344720_1920.jpg',\n\t\t\t\t'price' => '1.39',\n\t\t\t\t'cooktime' => 12,\n\t\t\t\t'desc' => 'Gouda mozzarella babybel. Jarlsberg emmental who moved my cheese cauliflower cheese brie cheesy feet airedale swiss. Port-salut bocconcini monterey jack squirty cheese cut the cheese say cheese cauliflower cheese lancashire. Who moved my cheese who moved my cheese taleggio cheesy feet cheeseburger hard cheese emmental.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 3,\n\t\t\t\t'name' => 'Margherita',\n\t\t\t\t'img' => 'pizza-3000274_1920.jpg',\n\t\t\t\t'price' => '2.39',\n\t\t\t\t'cooktime' => 6,\n\t\t\t\t'desc' => 'I love cheese, especially who moved my cheese fondue. Parmesan cheese slices the big cheese cheese strings jarlsberg fromage ricotta red leicester. Queso everyone loves cheesecake everyone loves who moved my cheese red leicester fondue smelly cheese. Mozzarella goat blue castello swiss cheese slices hard cheese swiss cow. Cream cheese swiss.',\n\t\t\t],\n\t\t\t// burgers\n\t\t\t[\n\t\t\t\t'category_id' => 4,\n\t\t\t\t'name' => 'Sliders',\n\t\t\t\t'img' => 'hamburger-494706_1920.jpg',\n\t\t\t\t'price' => '1.49',\n\t\t\t\t'cooktime' => 9,\n\t\t\t\t'desc' => 'Ribeye ball tip kevin tri-tip beef biltong. Pastrami pork belly burgdoggen, sirloin bresaola andouille flank fatback short ribs chuck shoulder tongue boudin strip steak. Bacon pancetta biltong kielbasa, cow shank sausage rump chuck spare ribs alcatra ground round meatball chicken strip steak. Sirloin andouille pig ham hock swine kielbasa salami tongue meatball cupim jowl. Cow fatback drumstick picanha ball tip. Meatloaf venison shankle rump, tail tenderloin short ribs.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 4,\n\t\t\t\t'name' => 'Charbroiled',\n\t\t\t\t'img' => 'hamburger-1238246_1920.jpg',\n\t\t\t\t'price' => '2.49',\n\t\t\t\t'cooktime' => 17,\n\t\t\t\t'desc' => 'Kielbasa boudin alcatra, beef ribs spare ribs rump pork belly pork chop salami ribeye pancetta. Alcatra picanha ground round, frankfurter short loin porchetta leberkas venison cow fatback landjaeger rump boudin. Flank t-bone kielbasa burgdoggen short ribs landjaeger tenderloin ham hock pastrami. Burgdoggen turducken landjaeger, short ribs frankfurter tail brisket chuck shoulder buffalo sausage doner rump. Swine ground round ribeye ham hock tongue turducken sirloin, burgdoggen sausage shank t-bone cupim.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 4,\n\t\t\t\t'name' => 'Diner Burger',\n\t\t\t\t'img' => 'burger-3442227_1920.jpg',\n\t\t\t\t'price' => '3.49',\n\t\t\t\t'cooktime' => 12,\n\t\t\t\t'desc' => 'Fatback drumstick filet mignon, frankfurter chicken pork meatloaf pork belly venison jerky beef pork loin ham hock biltong. Pork chop ham andouille ground round hamburger. Beef ribs ground round cow pig biltong short ribs sirloin spare ribs. Fatback pork chop cow filet mignon burgdoggen doner picanha swine tongue, tail corned beef meatball pancetta pork.',\n\t\t\t],\n\t\t\t// sushi\n\t\t\t[\n\t\t\t\t'category_id' => 5,\n\t\t\t\t'name' => 'Sashimi Fresh Roll',\n\t\t\t\t'img' => 'sushi-354628_1920.jpg',\n\t\t\t\t'price' => '1.59',\n\t\t\t\t'cooktime' => 3,\n\t\t\t\t'desc' => 'Barbelless catfish eel-goby spiny eel yellowtail snapper mullet minnow white marlin northern pike bigeye? Sauger sandroller; hoki sixgill ray squawfish sailfin silverside. Olive flounder giant danio herring smelt tailor Australasian salmon barbeled houndshark southern grayling porbeagle shark roundhead.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 5,\n\t\t\t\t'name' => 'Power Fish',\n\t\t\t\t'img' => 'sushi-2853382_1920.jpg',\n\t\t\t\t'price' => '2.59',\n\t\t\t\t'cooktime' => 5,\n\t\t\t\t'desc' => 'Atlantic silverside jewfish shovelnose sturgeon huchen temperate ocean-bass mullet menhaden stargazer yellowtail orangestriped triggerfish bluefin tuna. Arapaima plunderfish arapaima, mudskipper, earthworm eel snubnose eel Pacific viperfish tripletail.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 5,\n\t\t\t\t'name' => 'Spicy Tuna',\n\t\t\t\t'img' => 'sushi-599721_1920.jpg',\n\t\t\t\t'price' => '3.59',\n\t\t\t\t'cooktime' => 7,\n\t\t\t\t'desc' => 'Elephantnose fish bango longjaw mudsucker; sand stargazer? Dragonet: kissing gourami tench demoiselle; bullhead shark lookdown catfish halibut tubeblenny southern flounder, hairtail gray reef shark. Long-whiskered catfish lake whitefish, worm eel Ratfish European minnow! Javelin temperate perch sandroller waryfish pikehead gouramie longnose dace starry flounder medusafish cusk-eel.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 5,\n\t\t\t\t'name' => 'Avocado Roll',\n\t\t\t\t'img' => 'maki-716432_1920.jpg',\n\t\t\t\t'price' => '4.59',\n\t\t\t\t'cooktime' => 2,\n\t\t\t\t'desc' => 'Wormfish, glowlight danio Atlantic cod ide flagblenny, ribbon sawtail fish Kafue pike southern grayling. Speckled trout grayling ling nurseryfish threadfin. Snake eel char sturgeon scissor-tail rasbora blue eye worm eel southern smelt. Salmon jellynose fish, buffalofish lanternfish kaluga duckbill eel. Swampfish halosaur flashlight fish wahoo popeye catafula pirarucu; torpedo; rock beauty longnose chimaera elver thornfish, rough scad! Pipefish tompot blenny Kafue pike large-eye bream elasmobranch northern lampfish soapfish rocket danio mudskipper smalltooth sawfish.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 5,\n\t\t\t\t'name' => 'Sampler Plate',\n\t\t\t\t'img' => 'sushi-2856545_1920.jpg',\n\t\t\t\t'price' => '5.59',\n\t\t\t\t'cooktime' => 4,\n\t\t\t\t'desc' => 'Poolfish waryfish frilled shark louvar, wasp fish blue catfish Molly Miller Black scalyfin gizzard shad, platyfish, common carp. Tiger shark roanoke bass milkfish yellowhead jawfish, round stingray sea bass surfperch treefish Asiatic glassfish. Silver carp scissor-tail rasbora pompano dolphinfish: frogmouth catfish mackerel shark. Perch hardhead catfish sand stargazer: goosefish wolf-herring.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 5,\n\t\t\t\t'name' => 'Veggie Roll',\n\t\t\t\t'img' => 'sushi-2020287_1920.jpg',\n\t\t\t\t'price' => '6.59',\n\t\t\t\t'cooktime' => 2,\n\t\t\t\t'desc' => 'Stingray, tarpon; clown triggerfish plaice pleco wrasse Pacific herring kuhli loach rough scad, burma danio. River stingray weasel shark popeye catafula Australian grayling remora flying gurnard smalltooth sawfish, dwarf loach pike conger. Thornyhead megamouth shark pencilfish blacktip reef shark Atlantic silverside Black pickerel, electric eel spiderfish bass electric catfish? Peamouth tetra lightfish midshipman monkfish spearfish burrowing goby trahira, collared dogfish yellow weaver driftfish, dorab roosterfish, sea bream.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 5,\n\t\t\t\t'name' => 'Maki',\n\t\t\t\t'img' => 'sushi-748139_1920.jpg',\n\t\t\t\t'price' => '7.59',\n\t\t\t\t'cooktime' => 5,\n\t\t\t\t'desc' => 'Angler, swampfish orangestriped triggerfish oceanic flyingfish northern anchovy smooth dogfish. Bigscale pomfret stonefish pollyfish warmouth; round herring banded killifish. Walking catfish, weever cod: Antarctic icefish slimy sculpin.',\n\t\t\t],\n\t\t\t// salads\n\t\t\t[\n\t\t\t\t'category_id' => 6,\n\t\t\t\t'name' => 'Bowl of Lettuce',\n\t\t\t\t'img' => 'food-1834645_1920.jpg',\n\t\t\t\t'price' => '1.69',\n\t\t\t\t'cooktime' => 1,\n\t\t\t\t'desc' => 'Carrot grape soko wakame plantain pea broccoli rabe desert raisin. Chard cabbage cress gumbo spinach mung bean turnip greens rock melon chicory collard greens bok choy. Wattle seed wakame eggplant soybean quandong garlic prairie turnip swiss chard radish okra.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 6,\n\t\t\t\t'name' => 'Plate of Lettuce',\n\t\t\t\t'img' => 'salad-2150548_1920.jpg',\n\t\t\t\t'price' => '2.69',\n\t\t\t\t'cooktime' => 1,\n\t\t\t\t'desc' => 'Nori grape silver beet broccoli kombu beet greens fava bean potato quandong celery. Bunya nuts black-eyed pea prairie turnip leek lentil turnip greens parsnip. Sea lettuce lettuce water chestnut eggplant winter purslane fennel azuki bean earthnut pea sierra leone bologi leek soko chicory celtuce parsley j\u00c3\u00adcama salsify.',\n\t\t\t],\n\t\t];\n\t\tItem::insert($items);\n\t}\n}\n", "num_lines": 218}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Database\\Seeders;\n\nuse Illuminate\\Database\\Seeder;\nuse Illuminate\\Support\\Facades\\DB;\nuse Illuminate\\Support\\Facades\\Hash;\n\nuse App\\Models\\User;\n\nclass UserSeeder extends Seeder\n{\n\t/**\n\t * Run the database seeds.\n\t *\n\t * @return void\n\t */\n\tpublic function run()\n\t{\n\t\t// DB::table('users')->truncate();\n\t\tUser::query()->delete();\n\t\tDB::statement(\"ALTER TABLE `users` AUTO_INCREMENT = 1\");\n\n\t\t$users = [\n\t\t\t[\n\t\t\t\t'name' => 'Jon Yang',\n\t\t\t\t'address' => '3761 N. 14th St',\n\t\t\t\t'email' => 'jon24@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Eugene Huang',\n\t\t\t\t'address' => '2243 W St.',\n\t\t\t\t'email' => 'eugene10@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ruben Torres',\n\t\t\t\t'address' => '5844 Linden Land',\n\t\t\t\t'email' => 'ruben35@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Christy Zhu',\n\t\t\t\t'address' => '1825 Village Pl.',\n\t\t\t\t'email' => 'christy12@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Elizabeth Johnson',\n\t\t\t\t'address' => '7553 Harness Circle',\n\t\t\t\t'email' => 'elizabeth5@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Julio Ruiz',\n\t\t\t\t'address' => '7305 Humphrey Drive',\n\t\t\t\t'email' => 'julio1@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Janet Alvarez',\n\t\t\t\t'address' => '2612 Berry Dr',\n\t\t\t\t'email' => 'janet9@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Marco Mehta',\n\t\t\t\t'address' => '942 Brook Street',\n\t\t\t\t'email' => 'marco14@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Rob Verhoff',\n\t\t\t\t'address' => '624 Peabody Road',\n\t\t\t\t'email' => 'rob4@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Shannon Carlson',\n\t\t\t\t'address' => '3839 Northgate Road',\n\t\t\t\t'email' => 'shannon38@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jacquelyn Suarez',\n\t\t\t\t'address' => '7800 Corrinne Court',\n\t\t\t\t'email' => 'jacquelyn20@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Curtis Lu',\n\t\t\t\t'address' => '1224 Shoenic',\n\t\t\t\t'email' => 'curtis9@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Lauren Walker',\n\t\t\t\t'address' => '4785 Scott Street',\n\t\t\t\t'email' => 'lauren41@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ian Jenkins',\n\t\t\t\t'address' => '7902 Hudson Ave.',\n\t\t\t\t'email' => 'ian47@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Sydney Bennett',\n\t\t\t\t'address' => '9011 Tank Drive',\n\t\t\t\t'email' => 'sydney23@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Chloe Young',\n\t\t\t\t'address' => '244 Willow Pass Road',\n\t\t\t\t'email' => 'chloe23@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Wyatt Hill',\n\t\t\t\t'address' => '9666 Northridge Ct.',\n\t\t\t\t'email' => 'wyatt32@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Shannon Wang',\n\t\t\t\t'address' => '7330 Saddlehill Lane',\n\t\t\t\t'email' => 'shannon1@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Clarence Rai',\n\t\t\t\t'address' => '244 Rivewview',\n\t\t\t\t'email' => 'clarence32@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Luke Lal',\n\t\t\t\t'address' => '7832 Landing Dr',\n\t\t\t\t'email' => 'luke18@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jordan King',\n\t\t\t\t'address' => '7156 Rose Dr.',\n\t\t\t\t'email' => 'jordan73@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Destiny Wilson',\n\t\t\t\t'address' => '8148 W. Lake Dr.',\n\t\t\t\t'email' => 'destiny7@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ethan Zhang',\n\t\t\t\t'address' => '1769 Nicholas Drive',\n\t\t\t\t'email' => 'ethan20@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Seth Edwards',\n\t\t\t\t'address' => '4499 Valley Crest',\n\t\t\t\t'email' => 'seth46@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Russell Xie',\n\t\t\t\t'address' => '8734 Oxford Place',\n\t\t\t\t'email' => 'russell7@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Alejandro Beck',\n\t\t\t\t'address' => '2596 Franklin Canyon Road',\n\t\t\t\t'email' => 'alejandro45@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Harold Sai',\n\t\t\t\t'address' => '8211 Leeds Ct.',\n\t\t\t\t'email' => 'harold3@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jessie Zhao',\n\t\t\t\t'address' => '213 Valencia Place',\n\t\t\t\t'email' => 'jessie16@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jill Jimenez',\n\t\t\t\t'address' => '9111 Rose Ann Ave',\n\t\t\t\t'email' => 'jill13@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jimmy Moreno',\n\t\t\t\t'address' => '6385 Mark Twain',\n\t\t\t\t'email' => 'jimmy9@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Bethany Yuan',\n\t\t\t\t'address' => '636 Vine Hill Way',\n\t\t\t\t'email' => 'bethany10@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Theresa Ramos',\n\t\t\t\t'address' => '6465 Detroit Ave.',\n\t\t\t\t'email' => 'theresa13@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Denise Stone',\n\t\t\t\t'address' => '626 Bentley Street',\n\t\t\t\t'email' => 'denise10@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jaime Nath',\n\t\t\t\t'address' => '5927 Rainbow Dr',\n\t\t\t\t'email' => 'jaime41@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ebony Gonzalez',\n\t\t\t\t'address' => '5167 Condor Place',\n\t\t\t\t'email' => 'ebony19@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Wendy Dominguez',\n\t\t\t\t'address' => '1873 Mt. Whitney Dr',\n\t\t\t\t'email' => 'wendy12@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jennifer Russell',\n\t\t\t\t'address' => '3981 Augustine Drive',\n\t\t\t\t'email' => 'jennifer93@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Chloe Garcia',\n\t\t\t\t'address' => '8915 Woodside Way',\n\t\t\t\t'email' => 'chloe27@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Diana Hernandez',\n\t\t\t\t'address' => '8357 Sandy Cove Lane',\n\t\t\t\t'email' => 'diana2@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Marc Martin',\n\t\t\t\t'address' => '9353 Creekside Dr.',\n\t\t\t\t'email' => 'marc3@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jesse Murphy',\n\t\t\t\t'address' => '3350 Kingswood Circle',\n\t\t\t\t'email' => 'jesse15@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Amanda Carter',\n\t\t\t\t'address' => '5826 Escobar',\n\t\t\t\t'email' => 'amanda53@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Megan Sanchez',\n\t\t\t\t'address' => '1397 Paraiso Ct.',\n\t\t\t\t'email' => 'megan28@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Nathan Simmons',\n\t\t\t\t'address' => '1170 Shaw Rd',\n\t\t\t\t'email' => 'nathan11@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Adam Flores',\n\t\t\t\t'address' => '6935 Candle Dr',\n\t\t\t\t'email' => 'adam10@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Leonard Nara',\n\t\t\t\t'address' => '7466 La Vista Ave.',\n\t\t\t\t'email' => 'leonard18@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Christine Yuan',\n\t\t\t\t'address' => '2356 Orange St',\n\t\t\t\t'email' => 'christine4@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jaclyn Lu',\n\t\t\t\t'address' => '2812 Mazatlan',\n\t\t\t\t'email' => 'jaclyn12@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jeremy Powell',\n\t\t\t\t'address' => '1803 Potomac Dr.',\n\t\t\t\t'email' => 'jeremy26@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Carol Rai',\n\t\t\t\t'address' => '6064 Madrid',\n\t\t\t\t'email' => 'carol8@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Alan Zheng',\n\t\t\t\t'address' => '2741 Gainborough Dr.',\n\t\t\t\t'email' => 'alan23@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Daniel Johnson',\n\t\t\t\t'address' => '8085 Sunnyvale Avenue',\n\t\t\t\t'email' => 'daniel18@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Heidi Lopez',\n\t\t\t\t'address' => '2514 Via Cordona',\n\t\t\t\t'email' => 'heidi19@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ana Price',\n\t\t\t\t'address' => '1660 Stonyhill Circle',\n\t\t\t\t'email' => 'ana0@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Deanna Munoz',\n\t\t\t\t'address' => '5825 B Way',\n\t\t\t\t'email' => 'deanna33@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Gilbert Raje',\n\t\t\t\t'address' => '8811 The Trees Dr.',\n\t\t\t\t'email' => 'gilbert35@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Michele Nath',\n\t\t\t\t'address' => '5464 Janin Pl.',\n\t\t\t\t'email' => 'michele19@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Carl Andersen',\n\t\t\t\t'address' => '6930 Lake Nadine Place',\n\t\t\t\t'email' => 'carl12@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Marc Diaz',\n\t\t\t\t'address' => '6645 Sinaloa',\n\t\t\t\t'email' => 'marc6@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ashlee Andersen',\n\t\t\t\t'address' => '8255 Highland Road',\n\t\t\t\t'email' => 'ashlee19@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jon Zhou',\n\t\t\t\t'address' => '6574 Hemlock Ave.',\n\t\t\t\t'email' => 'jon28@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Todd Gao',\n\t\t\t\t'address' => '8808 Geneva Ave',\n\t\t\t\t'email' => 'todd14@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Noah Powell',\n\t\t\t\t'address' => '9794 Marion Ct',\n\t\t\t\t'email' => 'noah5@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Angela Murphy',\n\t\t\t\t'address' => '4927 Virgil Street',\n\t\t\t\t'email' => 'angela41@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Chase Reed',\n\t\t\t\t'address' => '2721 Alexander Pl.',\n\t\t\t\t'email' => 'chase21@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jessica Henderson',\n\t\t\t\t'address' => '9343 Ironwood Way',\n\t\t\t\t'email' => 'jessica29@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Grace Butler',\n\t\t\t\t'address' => '4739 Garden Ave.',\n\t\t\t\t'email' => 'grace62@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Caleb Carter',\n\t\t\t\t'address' => '9563 Pennsylvania Blvd.',\n\t\t\t\t'email' => 'caleb40@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Tiffany Liang',\n\t\t\t\t'address' => '3608 Sinclair Avenue',\n\t\t\t\t'email' => 'tiffany17@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Carolyn Navarro',\n\t\t\t\t'address' => '4606 Springwood Court',\n\t\t\t\t'email' => 'carolyn30@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Willie Raji',\n\t\t\t\t'address' => '6260 Vernal Drive',\n\t\t\t\t'email' => 'willie40@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Linda Serrano',\n\t\t\t\t'address' => '9808 Shaw Rd.',\n\t\t\t\t'email' => 'linda31@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Casey Luo',\n\t\t\t\t'address' => '9513 Roslyn Drive',\n\t\t\t\t'email' => 'casey6@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Amy Ye',\n\t\t\t\t'address' => '2262 Kirkwood Ct.',\n\t\t\t\t'email' => 'amy16@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Levi Arun',\n\t\t\t\t'address' => '4661 Bluetail',\n\t\t\t\t'email' => 'levi6@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Felicia Jimenez',\n\t\t\t\t'address' => '786 Eastgate Ave',\n\t\t\t\t'email' => 'felicia4@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Blake Anderson',\n\t\t\t\t'address' => '5436 Clear',\n\t\t\t\t'email' => 'blake9@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Leah Ye',\n\t\t\t\t'address' => '1291 Arguello Blvd.',\n\t\t\t\t'email' => 'leah7@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Gina Martin',\n\t\t\t\t'address' => '1349 Sol St.',\n\t\t\t\t'email' => 'gina1@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Donald Gonzalez',\n\t\t\t\t'address' => '4236 Malibu Place',\n\t\t\t\t'email' => 'donald20@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Damien Chander',\n\t\t\t\t'address' => '9941 Stonehedge Dr.',\n\t\t\t\t'email' => 'damien32@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Savannah Baker',\n\t\t\t\t'address' => '1210 Trafalgar Circle',\n\t\t\t\t'email' => 'savannah39@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Angela Butler',\n\t\t\t\t'address' => '6040 Listing Ct',\n\t\t\t\t'email' => 'angela17@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Alyssa Cox',\n\t\t\t\t'address' => '867 La Orinda Place',\n\t\t\t\t'email' => 'alyssa37@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Lucas Phillips',\n\t\t\t\t'address' => '8668 St. Celestine Court',\n\t\t\t\t'email' => 'lucas7@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Emily Johnson',\n\t\t\t\t'address' => '7926 Stephanie Way',\n\t\t\t\t'email' => 'emily1@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ryan Brown',\n\t\t\t\t'address' => '2939 Wesley Ct.',\n\t\t\t\t'email' => 'ryan43@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Tamara Liang',\n\t\t\t\t'address' => '3791 Rossmor Parkway',\n\t\t\t\t'email' => 'tamara6@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Hunter Davis',\n\t\t\t\t'address' => '4308 Sand Pointe Lane',\n\t\t\t\t'email' => 'hunter64@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Abigail Price',\n\t\t\t\t'address' => '2685 Blackburn Ct',\n\t\t\t\t'email' => 'abigail25@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Trevor Bryant',\n\t\t\t\t'address' => '5781 Sharon Dr.',\n\t\t\t\t'email' => 'trevor18@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Dalton Perez',\n\t\t\t\t'address' => '6083 San Jose',\n\t\t\t\t'email' => 'dalton37@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Cheryl Diaz',\n\t\t\t\t'address' => '7297 Kaywood Drive',\n\t\t\t\t'email' => 'cheryl4@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Aimee He',\n\t\t\t\t'address' => '1833 Olympic Drive',\n\t\t\t\t'email' => 'aimee13@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Cedric Ma',\n\t\t\t\t'address' => '3407 Oak Brook Place',\n\t\t\t\t'email' => 'cedric15@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Chad Kumar',\n\t\t\t\t'address' => '1681 Lighthouse Way',\n\t\t\t\t'email' => 'chad9@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Andr\u00c3\u00a9s Anand',\n\t\t\t\t'address' => '5423 Los Gatos Ct.',\n\t\t\t\t'email' => 'andr\u00c3\u00a9s18@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Edwin Nara',\n\t\t\t\t'address' => '719 William Way',\n\t\t\t\t'email' => 'edwin39@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Mallory Rubio',\n\t\t\t\t'address' => '6452 Harris Circle',\n\t\t\t\t'email' => 'mallory7@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Adam Ross',\n\t\t\t\t'address' => '4378 Westminster Place',\n\t\t\t\t'email' => 'adam2@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t];\n\t\tUser::insert($users);\n\t}\n}\n", "num_lines": 629}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n$servername = \"localhost\";\n$username = \"root\";\n$password = \"\";\n$dbname = \"ContosoStore\";\n\n$conn = mysqli_init();\n\n//mysqli_ssl_set($conn,NULL,NULL, \"DigiCertGlobalRootCA.crt.pem\", NULL, NULL);\n\nmysqli_real_connect($conn, $servername, $username, $password, $dbname);\n\n// Check connection\nif ($conn->connect_error) {\n  die(\"Connection failed: \" . $conn->connect_error);\n}\n\n$sql = \"SELECT count(*) FROM contosostore.users\";\n\n$result = $conn->query($sql);\n\nif ($result !== false && $result->num_rows > 0) {\n  \n  echo $result->num_rows . \" results\";\n  \n} else {\n  echo \"0 results\";\n}\n\n$conn->close();\n\n?> ", "num_lines": 33}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Contracts\\Http\\Kernel;\nuse Illuminate\\Http\\Request;\n\ndefine('LARAVEL_START', microtime(true));\n\n/*\n|--------------------------------------------------------------------------\n| Check If The Application Is Under Maintenance\n|--------------------------------------------------------------------------\n|\n| If the application is in maintenance / demo mode via the \"down\" command\n| we will load this file so that any pre-rendered content can be shown\n| instead of starting the framework, which could cause an exception.\n|\n*/\n\nif (file_exists(__DIR__.'/../storage/framework/maintenance.php')) {\n    require __DIR__.'/../storage/framework/maintenance.php';\n}\n\n/*\n|--------------------------------------------------------------------------\n| Register The Auto Loader\n|--------------------------------------------------------------------------\n|\n| Composer provides a convenient, automatically generated class loader for\n| this application. We just need to utilize it! We'll simply require it\n| into the script here so we don't need to manually load our classes.\n|\n*/\n\nrequire __DIR__.'/../vendor/autoload.php';\n\n/*\n|--------------------------------------------------------------------------\n| Run The Application\n|--------------------------------------------------------------------------\n|\n| Once we have the application, we can handle the incoming request using\n| the application's HTTP kernel. Then, we will send the response back\n| to this client's browser, allowing them to enjoy our application.\n|\n*/\n\n$app = require_once __DIR__.'/../bootstrap/app.php';\n\n$kernel = $app->make(Kernel::class);\n\n$response = $kernel->handle(\n    $request = Request::capture()\n)->send();\n\n$kernel->terminate($request, $response);\n", "num_lines": 56}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n    phpinfo();\n?>", "num_lines": 3}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Authentication Language Lines\n    |--------------------------------------------------------------------------\n    |\n    | The following language lines are used during authentication for various\n    | messages that we need to display to the user. You are free to modify\n    | these language lines according to your application's requirements.\n    |\n    */\n\n    'failed' => 'These credentials do not match our records.',\n    'password' => 'The provided password is incorrect.',\n    'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',\n\n];\n", "num_lines": 21}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Pagination Language Lines\n    |--------------------------------------------------------------------------\n    |\n    | The following language lines are used by the paginator library to build\n    | the simple pagination links. You are free to change them to anything\n    | you want to customize your views to better match your application.\n    |\n    */\n\n    'previous' => '&laquo; Previous',\n    'next' => 'Next &raquo;',\n\n];\n", "num_lines": 20}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Password Reset Language Lines\n    |--------------------------------------------------------------------------\n    |\n    | The following language lines are the default lines which match reasons\n    | that are given by the password broker for a password update attempt\n    | has failed, such as for an invalid token or invalid new password.\n    |\n    */\n\n    'reset' => 'Your password has been reset!',\n    'sent' => 'We have emailed your password reset link!',\n    'throttled' => 'Please wait before retrying.',\n    'token' => 'This password reset token is invalid.',\n    'user' => \"We can't find a user with that email address.\",\n\n];\n", "num_lines": 23}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Validation Language Lines\n    |--------------------------------------------------------------------------\n    |\n    | The following language lines contain the default error messages used by\n    | the validator class. Some of these rules have multiple versions such\n    | as the size rules. Feel free to tweak each of these messages here.\n    |\n    */\n\n    'accepted' => 'The :attribute must be accepted.',\n    'accepted_if' => 'The :attribute must be accepted when :other is :value.',\n    'active_url' => 'The :attribute is not a valid URL.',\n    'after' => 'The :attribute must be a date after :date.',\n    'after_or_equal' => 'The :attribute must be a date after or equal to :date.',\n    'alpha' => 'The :attribute must only contain letters.',\n    'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.',\n    'alpha_num' => 'The :attribute must only contain letters and numbers.',\n    'array' => 'The :attribute must be an array.',\n    'before' => 'The :attribute must be a date before :date.',\n    'before_or_equal' => 'The :attribute must be a date before or equal to :date.',\n    'between' => [\n        'numeric' => 'The :attribute must be between :min and :max.',\n        'file' => 'The :attribute must be between :min and :max kilobytes.',\n        'string' => 'The :attribute must be between :min and :max characters.',\n        'array' => 'The :attribute must have between :min and :max items.',\n    ],\n    'boolean' => 'The :attribute field must be true or false.',\n    'confirmed' => 'The :attribute confirmation does not match.',\n    'current_password' => 'The password is incorrect.',\n    'date' => 'The :attribute is not a valid date.',\n    'date_equals' => 'The :attribute must be a date equal to :date.',\n    'date_format' => 'The :attribute does not match the format :format.',\n    'declined' => 'The :attribute must be declined.',\n    'declined_if' => 'The :attribute must be declined when :other is :value.',\n    'different' => 'The :attribute and :other must be different.',\n    'digits' => 'The :attribute must be :digits digits.',\n    'digits_between' => 'The :attribute must be between :min and :max digits.',\n    'dimensions' => 'The :attribute has invalid image dimensions.',\n    'distinct' => 'The :attribute field has a duplicate value.',\n    'email' => 'The :attribute must be a valid email address.',\n    'ends_with' => 'The :attribute must end with one of the following: :values.',\n    'exists' => 'The selected :attribute is invalid.',\n    'file' => 'The :attribute must be a file.',\n    'filled' => 'The :attribute field must have a value.',\n    'gt' => [\n        'numeric' => 'The :attribute must be greater than :value.',\n        'file' => 'The :attribute must be greater than :value kilobytes.',\n        'string' => 'The :attribute must be greater than :value characters.',\n        'array' => 'The :attribute must have more than :value items.',\n    ],\n    'gte' => [\n        'numeric' => 'The :attribute must be greater than or equal to :value.',\n        'file' => 'The :attribute must be greater than or equal to :value kilobytes.',\n        'string' => 'The :attribute must be greater than or equal to :value characters.',\n        'array' => 'The :attribute must have :value items or more.',\n    ],\n    'image' => 'The :attribute must be an image.',\n    'in' => 'The selected :attribute is invalid.',\n    'in_array' => 'The :attribute field does not exist in :other.',\n    'integer' => 'The :attribute must be an integer.',\n    'ip' => 'The :attribute must be a valid IP address.',\n    'ipv4' => 'The :attribute must be a valid IPv4 address.',\n    'ipv6' => 'The :attribute must be a valid IPv6 address.',\n    'json' => 'The :attribute must be a valid JSON string.',\n    'lt' => [\n        'numeric' => 'The :attribute must be less than :value.',\n        'file' => 'The :attribute must be less than :value kilobytes.',\n        'string' => 'The :attribute must be less than :value characters.',\n        'array' => 'The :attribute must have less than :value items.',\n    ],\n    'lte' => [\n        'numeric' => 'The :attribute must be less than or equal to :value.',\n        'file' => 'The :attribute must be less than or equal to :value kilobytes.',\n        'string' => 'The :attribute must be less than or equal to :value characters.',\n        'array' => 'The :attribute must not have more than :value items.',\n    ],\n    'max' => [\n        'numeric' => 'The :attribute must not be greater than :max.',\n        'file' => 'The :attribute must not be greater than :max kilobytes.',\n        'string' => 'The :attribute must not be greater than :max characters.',\n        'array' => 'The :attribute must not have more than :max items.',\n    ],\n    'mimes' => 'The :attribute must be a file of type: :values.',\n    'mimetypes' => 'The :attribute must be a file of type: :values.',\n    'min' => [\n        'numeric' => 'The :attribute must be at least :min.',\n        'file' => 'The :attribute must be at least :min kilobytes.',\n        'string' => 'The :attribute must be at least :min characters.',\n        'array' => 'The :attribute must have at least :min items.',\n    ],\n    'multiple_of' => 'The :attribute must be a multiple of :value.',\n    'not_in' => 'The selected :attribute is invalid.',\n    'not_regex' => 'The :attribute format is invalid.',\n    'numeric' => 'The :attribute must be a number.',\n    'password' => 'The password is incorrect.',\n    'present' => 'The :attribute field must be present.',\n    'prohibited' => 'The :attribute field is prohibited.',\n    'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',\n    'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.',\n    'prohibits' => 'The :attribute field prohibits :other from being present.',\n    'regex' => 'The :attribute format is invalid.',\n    'required' => 'The :attribute field is required.',\n    'required_if' => 'The :attribute field is required when :other is :value.',\n    'required_unless' => 'The :attribute field is required unless :other is in :values.',\n    'required_with' => 'The :attribute field is required when :values is present.',\n    'required_with_all' => 'The :attribute field is required when :values are present.',\n    'required_without' => 'The :attribute field is required when :values is not present.',\n    'required_without_all' => 'The :attribute field is required when none of :values are present.',\n    'same' => 'The :attribute and :other must match.',\n    'size' => [\n        'numeric' => 'The :attribute must be :size.',\n        'file' => 'The :attribute must be :size kilobytes.',\n        'string' => 'The :attribute must be :size characters.',\n        'array' => 'The :attribute must contain :size items.',\n    ],\n    'starts_with' => 'The :attribute must start with one of the following: :values.',\n    'string' => 'The :attribute must be a string.',\n    'timezone' => 'The :attribute must be a valid timezone.',\n    'unique' => 'The :attribute has already been taken.',\n    'uploaded' => 'The :attribute failed to upload.',\n    'url' => 'The :attribute must be a valid URL.',\n    'uuid' => 'The :attribute must be a valid UUID.',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Custom Validation Language Lines\n    |--------------------------------------------------------------------------\n    |\n    | Here you may specify custom validation messages for attributes using the\n    | convention \"attribute.rule\" to name the lines. This makes it quick to\n    | specify a specific custom language line for a given attribute rule.\n    |\n    */\n\n    'custom' => [\n        'attribute-name' => [\n            'rule-name' => 'custom-message',\n        ],\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Custom Validation Attributes\n    |--------------------------------------------------------------------------\n    |\n    | The following language lines are used to swap our attribute placeholder\n    | with something more reader friendly such as \"E-Mail Address\" instead\n    | of \"email\". This simply helps us make our message more expressive.\n    |\n    */\n\n    'attributes' => [],\n\n];\n", "num_lines": 161}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "@extends('layouts.app')\n@section('content')\n\n\t<h3>Choose a category</h3>\n\n\t<div class=\"center-block category-list\">\n\t\t<div class=\"two-thirds column\">\n\t\t\t<div class=\"row\">\n\t\t\t@foreach($category as $c)\n\t\t\t\t<div class=\"category one-third column\" data-url=\"{{ $c->url }}\">\n\t\t\t\t\t<div class=\"image\" style=\"background-image:url(/img/{{ $c->img }});\"></div>\n\t\t\t\t\t<span>{{ $c->name }}</span>\n\t\t\t\t</div>\n\t\t\t@endforeach\n\t\t\t</div>\n\t\t</div>\n\t\t<button class=\"select-category button\" disabled>Continue</button>\n\t</div>\n\n@endsection\n@push('scripts')\n<script>\n</script>\n@endpush\n", "num_lines": 25}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "@extends('layouts.app')\n@section('content')\n\n\t<h3>Checkout</h3>\n\n\t<div class=\"center-block item-list\">\n\t\t<div class=\"two-thirds column\">\n\t\t\t@if ($cart_data)\n\t\t\t<table class=\"u-full-width m-b-0 checkout-cart\">\n\t\t\t\t<tbody>\n\t\t\t\t@foreach($cart_data as $c)\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><div class=\"image\" style=\"background-image:url(/img/{{ $c->img }});\"></div></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<span>{{ $c->name }}</span>\n\t\t\t\t\t\t\t<span>{{ $c->qty }} @ {{ is_numeric($c->price) ? number_format($c->price, 2) : '0.00' }}</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>{{ number_format($c->sub, 2) }}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t@endforeach\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan=\"2\">Total:</td>\n\t\t\t\t\t\t<td>$ {{ number_format($cart_total, 2) }}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\t<div class=\"one-half column\">\n\t\t\t<form method=\"post\" action=\"{{ route('process-order') }}\">\n\t\t\t\t{{ csrf_field() }}\n\n\t\t\t\t<!-- keeping it simple for demo purposes, only displaying a few fields -->\n\t\t\t\t<label for=\"name\" class=\"text-left\">Name</label>\n\t\t\t\t<input id=\"name\" name=\"name\" type=\"text\" class=\"u-full-width\" value=\"{{ $user ?? '' ? $user->name : '' }}\">\n\t\t\t\t<label for=\"address\" class=\"text-left\">Address</label>\n\t\t\t\t<input id=\"address\" name=\"address\" type=\"text\" class=\"u-full-width\" value=\"{{ $user ?? '' ? $user->address : '' }}\">\n\t\t\t\t<label for=\"special_instruction\" class=\"text-left\">Special Instructions</label>\n\t\t\t\t<textarea id=\"special_instruction\" name=\"special_instructions\" class=\"u-full-width\"></textarea>\n\n\t\t\t\t<a href=\"{{ route('category-list') }}\" class=\"button\">Add to Order</a>\n\t\t\t\t<button class=\"button button-primary complete-order\">Complete Order</button>\n\t\t\t</form>\n\t\t\t@else\n\t\t\t<p>You have no food in your cart.</p>\n\t\t\t<a href=\"{{ route('category-list') }}\" class=\"button\">Start a New Order</a>\n\t\t\t@endif\n\t\t</div>\n\t</div>\n\n@endsection\n@push('scripts')\n<script>\n</script>\n@endpush\n", "num_lines": 55}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "@extends('layouts.app')\n@section('content')\n\n\t<div class=\"hero\">\n\t\t<div class=\"logo\">{{ config('app.name', 'Contoso NoshNow') }}</div>\n\t</div>\n\n\t<div class=\"center-block order-form\">\n\t\t<div class=\"one-half column\">\n\t\t\t<form>\n\t\t\t\t<label for=\"delivery_address\">Welcome back, <span class=\"blue\">{{ $user->name }}</span>! Where should we deliver your meal?</label>\n\t\t\t\t<!-- \n\t\t\t\t\tKeeping it simple for demo purposes, only displaying a single street address field. We don't\n\t\t\t\t\tactually use this field for anything though. It's just for show!\n\t\t\t\t -->\n\t\t\t\t<input id=\"delivery_address\" class=\"u-full-width\" type=\"text\" placeholder=\"Enter your street address\" value=\"{{ $user->address }}\">\n\t\t\t\t<a href=\"{{ route('category-list') }}\" class=\"start-order button button-primary\">Start Order</a>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\n@endsection\n@push('scripts')\n<script>\n</script>\n@endpush\n", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "@extends('layouts.app')\n@section('content')\n\n\t<h3>Select a meal</h3>\n\n\t<div class=\"center-block item-list\">\n\t\t<div class=\"two-thirds column\">\n\t\t\t<div class=\"row\">\n\t\t\t@foreach($item as $i)\n\t\t\t\t<div class=\"item one-third column\">\n\t\t\t\t\t<div class=\"image\" style=\"background-image:url(/img/{{ $i->img }});\"></div>\n\t\t\t\t\t<div class=\"name\">{{ $i->name }}</div>\n\t\t\t\t\t<div class=\"price\"><sup>$</sup>{{ is_numeric($i->price) ? number_format($i->price, 2) : '0.00' }}</div>\n\t\t\t\t\t<div class=\"desc\">\n\t\t\t\t\t\t<div class=\"overflow\">{{ $i->desc }}</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<button class=\"add-to-cart button-small button-primary\" data-item=\"{{ $i->id }}\">Add</button>\n\t\t\t\t</div>\n\t\t\t@endforeach\n\t\t\t</div>\n\t\t</div>\n\t\t<a href=\"{{ route('category-list') }}\" class=\"button\">Back</a>\n\t\t<button class=\"button {{ $global_cart['cart_total'] ? 'button-primary' : '' }} checkout-button\" {{ $global_cart['cart_total'] ? '' : 'disabled' }}>Continue</button>\n\t</div>\n\n@endsection\n@push('scripts')\n<script>\n// to keep the layout and design simple, only show 6 lines of text from the item description\nvar ellipsis_lines = 6;\n$(document).ready( function() {\n\tellipsis();\n\n\t$('.checkout-button').on('click', function() {\n\t\tvar url = \"{{ route('checkout') }}\";\n\t\t// fun little trick to allow ctrl-click on a javascript click event just like regular links\n\t\tif (event.metaKey || event.ctrlKey) {\n\t\t\twindow.open(url,'_blank');\n\t\t} else {\n\t\t\tlocation.href = url;\n\t\t}\n\t});\n\n});\n$(window).resize( function() {\n\tellipsis();\n});\n\n// function to add ellipsis after (N) lines of text\nfunction ellipsis() {\n\tvar lines = ellipsis_lines;\n\t$('.overflow').each(function( index ) {\n\t\tvar inner = $(this);\n\t\tvar outer = inner.parent();\n\t\tif (inner.attr('data-text')) {\n\t\t\tvar innertext = inner.attr('data-text');\n\t\t} else {\n\t\t\tvar innertext = inner.text();\n\t\t}\n\t\tvar lineheight = inner.css('line-height');\n\t\tvar height = (lineheight.replace('px','')-0)*(lines-0);\n\t\touter.css({'height':height});\n\t\tinner.attr('data-text',innertext);\n\t\tinner.text(innertext);\n\t\twhile (inner.outerHeight() > height) {\n\t\t\tinner.text(function (index, text) {\n\t\t\t\treturn text.replace(/\\W*\\s(\\S)*$/, '...');\n\t\t\t});\n\t\t}\n\t});\n}\n</script>\n@endpush\n", "num_lines": 74}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "@extends('layouts.app')\n@section('content')\n\n\t<h3>Receipt</h3>\n\n\t<div class=\"center-block item-list\">\n\t<p>Thank you for placing your food order with {{ config('app.name', '') }}!</p>\n\t<p id=\"remaining_text\"></p>\n\n\t<a href=\"{{ route('category-list') }}\" class=\"button\">Start a New Order</a>\n\t</div>\n\n@endsection\n@push('scripts')\n<script>\n$(document).ready( function() {\n\tset_receipt_text('{{ $time_left ?? '0' }}');\n});\n</script>\n@endpush\n", "num_lines": 21}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "\t\t\t<!-- display a cart icon and number of items in the cart (click to display items in cart) -->\n\t\t\t<div class=\"cart-icon {{ $cart_total ? '' : 'disabled' }}\">\n\t\t\t\t<span class=\"count\" id=\"cart_total\">{{ $cart_total ? $cart_total : '0' }}</span>\n\t\t\t\t<span class=\"icon-cart\"></span>\n\t\t\t</div>\n\n\t\t\t<div class=\"cart-block {{ $show && $cart_total ? '' : 'initially-hidden' }}\">\n\t\t\t\t<div class=\"cart-items\">\n\t\t\t\t@if (!$cart_total)\n\t\t\t\t\t<!-- this should never appear, but just in case the user pulls some shenanigans with the browser's inspector -->\n\t\t\t\t\t<table class=\"u-full-width m-b-0\"><tbody><tr><td>&nbsp; Uh oh! Your cart is empty.</td></tr></tbody></table>\n\t\t\t\t@else\n\t\t\t\t\t<!-- show a table of items in cart -->\n\t\t\t\t\t<table class=\"u-full-width m-b-0 full-cart\">\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t@foreach($cart_data as $c)\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td><span>{{ $c->name }}</span></td>\n\t\t\t\t\t\t\t\t<td><input type=\"text\" value=\"{{ $c->qty }}\" class=\"item-qty\" data-item=\"{{ $c->id }}\"></td>\n\t\t\t\t\t\t\t\t<td>@ {{ is_numeric($c->price) ? number_format($c->price, 2) : '0.00' }}</td>\n\t\t\t\t\t\t\t\t<td>{{ number_format($c->sub, 2) }}</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t@endforeach\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t@endif\n\t\t\t\t</div>\n\t\t\t\t<!-- cart action buttons -->\n\t\t\t\t<div class=\"cart-footer\">\n\t\t\t\t\t<table class=\"u-full-width m-b-0 b-b-0\">\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t@if ($cart_total)\n\t\t\t\t\t\t\t\t<!-- if there's something in the cart, show an update button and checkout button -->\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<a href=\"{{ route('checkout') }}\" class=\"button button-tiny btn-success cart-checkout\">Checkout</a>\n\t\t\t\t\t\t\t\t\t<button class=\"button-tiny cart-update\">Update</button>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t@endif\n\t\t\t\t\t\t\t\t<!-- show a button to hide the cart -->\n\t\t\t\t\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t\t\t\t\t<button class=\"button-tiny closer\">&#9650;</button>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t</div>", "num_lines": 48}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<!DOCTYPE html>\n<html lang=\"{{ str_replace('_', '-', app()->getLocale()) }}\">\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n\t\t<!-- CSRF Token -->\n\t\t<meta name=\"csrf-token\" content=\"{{ csrf_token() }}\">\n\n\t\t<title>{{ config('app.name', 'Contoso NoshNow') }}</title>\n\n\t\t<!-- Scripts -->\n\t\t<script src=\"{{ asset('js/app.js') }}\"></script>\n\t\t<script src=\"{{ asset('js/custom.js') }}\"></script>\n\n\t\t<!-- Fonts -->\n\t\t<link href=\"https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap\" rel=\"stylesheet\">\n\n\t\t<!-- Styles -->\n\t\t<style>\n\t\t\t/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}a{background-color:transparent}[hidden]{display:none}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}*,:after,:before{box-sizing:border-box;border:0 solid #e2e8f0}a{color:inherit;text-decoration:inherit}svg,video{display:block;vertical-align:middle}video{max-width:100%;height:auto}body{font-family: 'Nunito', sans-serif}\n\t\t</style>\n\t\t<link href=\"{{ asset('css/normalize.css') }}\" rel=\"stylesheet\">\n\t\t<link href=\"{{ asset('css/skeleton.css') }}\" rel=\"stylesheet\">\n\t\t<link href=\"{{ asset('css/icomoon.css') }}\" rel=\"stylesheet\">\n\t\t<link href=\"{{ asset('css/custom.css') }}\" rel=\"stylesheet\">\n\t\t<link href=\"{{ asset('css/app.css') }}\" rel=\"stylesheet\">\n@stack('styles')\n\t</head>\n\t<body class=\"antialiased\">\n\n@if(isset($header))\n\t\t<div class=\"header\">\n\t\t\t<a href=\"{{ route('home') }}\">\n\t\t\t\t<img src=\"/img/white-gd422548d7_640.png\">\n\t\t\t\t{{ config('app.name', '') }}\n\t\t\t</a>\n\t\t</div>\n@endif\n\n\t\t<div id=\"global_cart\" class=\"global-cart\">\n{!! $global_cart['html'] ?? '' !!}\n\t\t</div>\n\n@yield('content')\n\n\t\t<!-- show a little warning message if the data is coming from JSON and not the database -->\n\t\t<div class=\"json-warning {{ $json_warning ?? '' ? '' : 'initially-hidden' }}\">Site is unable to pull from database. Using JSON data instead.</div>\n\n@stack('scripts')\n\t</body>\n</html>\n", "num_lines": 53}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Route;\n\n/*\n|--------------------------------------------------------------------------\n| API Routes\n|--------------------------------------------------------------------------\n|\n| Here is where you can register API routes for your application. These\n| routes are loaded by the RouteServiceProvider within a group which\n| is assigned the \"api\" middleware group. Enjoy building your API!\n|\n*/\n\nRoute::middleware('auth:sanctum')->get('/user', function (Request $request) {\n    return $request->user();\n});\n", "num_lines": 20}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Support\\Facades\\Broadcast;\n\n/*\n|--------------------------------------------------------------------------\n| Broadcast Channels\n|--------------------------------------------------------------------------\n|\n| Here you may register all of the event broadcasting channels that your\n| application supports. The given channel authorization callbacks are\n| used to check if an authenticated user can listen to the channel.\n|\n*/\n\nBroadcast::channel('App.Models.User.{id}', function ($user, $id) {\n    return (int) $user->id === (int) $id;\n});\n", "num_lines": 19}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Foundation\\Inspiring;\nuse Illuminate\\Support\\Facades\\Artisan;\n\n/*\n|--------------------------------------------------------------------------\n| Console Routes\n|--------------------------------------------------------------------------\n|\n| This file is where you may define all of your Closure based console\n| commands. Each Closure is bound to a command instance allowing a\n| simple approach to interacting with each command's IO methods.\n|\n*/\n\nArtisan::command('inspire', function () {\n    $this->comment(Inspiring::quote());\n})->purpose('Display an inspiring quote');\n", "num_lines": 20}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Support\\Facades\\Route;\n\n/*\n|--------------------------------------------------------------------------\n| Web Routes\n|--------------------------------------------------------------------------\n|\n| Here is where you can register web routes for your application. These\n| routes are loaded by the RouteServiceProvider within a group which\n| contains the \"web\" middleware group. Now create something great!\n|\n*/\n\n\n// pages:\n\nRoute::get('/', 'HomeController@index')->name('home');\n\nRoute::get('/category-list', 'ProductController@categoryList')->name('category-list');\nRoute::get('/item-list/{category}', 'ProductController@itemList')->name('item-list');\n\nRoute::get('/checkout', 'CartController@checkout')->name('checkout');\nRoute::post('/process-order', 'CartController@processOrder')->name('process-order');\nRoute::get('/receipt', 'CartController@receipt')->name('receipt');\n\n\n// ajax:\n\nRoute::post('/add-to-cart', 'CartController@addToCart');\nRoute::post('/update-cart', 'CartController@updateCart');\n", "num_lines": 33}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Tests;\n\nuse Illuminate\\Contracts\\Console\\Kernel;\n\ntrait CreatesApplication\n{\n    /**\n     * Creates the application.\n     *\n     * @return \\Illuminate\\Foundation\\Application\n     */\n    public function createApplication()\n    {\n        $app = require __DIR__.'/../bootstrap/app.php';\n\n        $app->make(Kernel::class)->bootstrap();\n\n        return $app;\n    }\n}\n", "num_lines": 23}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Tests;\n\nuse Illuminate\\Foundation\\Testing\\TestCase as BaseTestCase;\n\nabstract class TestCase extends BaseTestCase\n{\n    use CreatesApplication;\n}\n", "num_lines": 11}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Tests\\Feature;\n\nuse Illuminate\\Foundation\\Testing\\RefreshDatabase;\nuse Tests\\TestCase;\n\nclass ExampleTest extends TestCase\n{\n    /**\n     * A basic test example.\n     *\n     * @return void\n     */\n    public function test_example()\n    {\n        $response = $this->get('/');\n\n        $response->assertStatus(200);\n    }\n}\n", "num_lines": 22}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Tests\\Unit;\n\nuse PHPUnit\\Framework\\TestCase;\n\nclass ExampleTest extends TestCase\n{\n    /**\n     * A basic test example.\n     *\n     * @return void\n     */\n    public function test_example()\n    {\n        $this->assertTrue(true);\n    }\n}\n", "num_lines": 19}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/**\n * Laravel - A PHP Framework For Web Artisans\n *\n * @package  Laravel\n * @author   Taylor Otwell <taylor@laravel.com>\n */\n\n$uri = urldecode(\n    parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)\n);\n\n// This file allows us to emulate Apache's \"mod_rewrite\" functionality from the\n// built-in PHP web server. This provides a convenient way to test a Laravel\n// application without having installed a \"real\" web server software here.\nif ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {\n    return false;\n}\n\nrequire_once __DIR__.'/public/index.php';\n", "num_lines": 22}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Console;\n\nuse Illuminate\\Console\\Scheduling\\Schedule;\nuse Illuminate\\Foundation\\Console\\Kernel as ConsoleKernel;\n\nclass Kernel extends ConsoleKernel\n{\n    /**\n     * Define the application's command schedule.\n     *\n     * @param  \\Illuminate\\Console\\Scheduling\\Schedule  $schedule\n     * @return void\n     */\n    protected function schedule(Schedule $schedule)\n    {\n        // $schedule->command('inspire')->hourly();\n    }\n\n    /**\n     * Register the commands for the application.\n     *\n     * @return void\n     */\n    protected function commands()\n    {\n        $this->load(__DIR__.'/Commands');\n\n        require base_path('routes/console.php');\n    }\n}\n", "num_lines": 33}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Exceptions;\n\nuse Illuminate\\Foundation\\Exceptions\\Handler as ExceptionHandler;\nuse Throwable;\n\nclass Handler extends ExceptionHandler\n{\n    /**\n     * A list of the exception types that are not reported.\n     *\n     * @var string[]\n     */\n    protected $dontReport = [\n        //\n    ];\n\n    /**\n     * A list of the inputs that are never flashed for validation exceptions.\n     *\n     * @var string[]\n     */\n    protected $dontFlash = [\n        'current_password',\n        'password',\n        'password_confirmation',\n    ];\n\n    /**\n     * Register the exception handling callbacks for the application.\n     *\n     * @return void\n     */\n    public function register()\n    {\n        $this->reportable(function (Throwable $e) {\n            //\n        });\n    }\n}\n", "num_lines": 42}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Helpers;\n\nuse Illuminate\\Support\\Facades\\DB;\nuse GuzzleHttp\\Exception\\RequestException;\n\nclass AppHelper\n{\n\n\tprivate UserApiService $userApiService;\n\n\tpublic static function instance()\n\t{\n\t\treturn new AppHelper();\n\t}\n\n\tpublic function __construct()\n\t{\n\t\t$this->userApiService = UserApiService::instance();\n\t}\n\n\t// get user from session or generate a random user\n\tpublic function randomUser() {\n\t\t$user = session('user');\n\t\tif (!$user) {\n\t\t\ttry {\n\t\t\t\t$user = $this->userApiService->getRandomUser();\n\t\t\t\t$user->fromJson = 0;\n\t\t\t}\n\t\t\tcatch (RequestException $r) {\n\t\t\t\t$user = AppHelper::instance()->userJson('rand');\n\t\t\t\t$user->fromJson = 1;\n\t\t\t}\n\t\t\tsession([ 'user' => $user ]);\n\t\t}\n\t\treturn $user;\n\t}\n\n\n\t// display a cart icon and a floating list of items in the cart\n\tpublic function globalCart($show=null) {\n\t\t$cart = session('cart');\n\t\t$cart_total = 0;\n\t\t$cart_data = [];\n\t\tif ($cart) {\n\t\t\t$item = AppHelper::instance()->itemJson('items',array_keys($cart));\n\t\t\tforeach($item as $i) {\n\t\t\t\t$qty = $cart[$i->id];\n\t\t\t\t$cart_total += $qty;\n\t\t\t\t$i->qty = $qty;\n\t\t\t\t$price = is_numeric($i->price) ? $i->price : '0';\n\t\t\t\t$i->sub = $qty * number_format($price, 2);\n\t\t\t\t$cart_data[$i->id] = $i;\n\t\t\t}\n\t\t}\n\t\t$html = view('includes/floating-cart')->with('cart_total',$cart_total)->with('cart_data',($cart_data ?? null))->with('show',$show)->render();\n\t\treturn ['html'=>$html, 'cart_total'=>$cart_total];\n\t}\n\n\n\t// use these functions to get json data when there's no database:\n\t// (don't worry about this section, it's just here to keep the app working if there's no database)\n\n\t// checks to see if database is connecting\n\tpublic function checkDB()\n\t{\n\t\ttry {\n\t\t\tDB::getPdo();\n\t\t} catch (\\Exception $e) {\n\t\t\t// print($e->getMessage());\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t// returns a user (if ID is provided) or a list of users\n\tpublic function userJson($id=null)\n\t{\n\t\t$json = '[ \n\t\t\t{\"id\":1,\"name\":\"Jon Yang\",\"address\":\"3761 N. 14th St\",\"email\":\"jon24@adventure-works.com\",\"password\":\"$2y$10$7LnWpy7R7hXgbMnn.IHaSu8i.9E0dTB4tuMVHFm77OwSV46qbIvWa\"},\n\t\t\t{\"id\":2,\"name\":\"Eugene Huang\",\"address\":\"2243 W St.\",\"email\":\"eugene10@adventure-works.com\",\"password\":\"$2y$10$XuvN1ti/OL5mdiPtdd0z6O5b1m0Yft3WHhk3zJphZhr4GrH0OhOzK\"},\n\t\t\t{\"id\":3,\"name\":\"Ruben Torres\",\"address\":\"5844 Linden Land\",\"email\":\"ruben35@adventure-works.com\",\"password\":\"$2y$10$ElCTjmvfndxWb/Z8EpDQkeKFCr0v1N8QSokKzEeXXwwHpPJhPv4EC\"},\n\t\t\t{\"id\":4,\"name\":\"Christy Zhu\",\"address\":\"1825 Village Pl.\",\"email\":\"christy12@adventure-works.com\",\"password\":\"$2y$10$GnIyO51JnABQ2yt/6NCzKOkubSPxq49PST5jWOpfGOhu0emBkNR9e\"},\n\t\t\t{\"id\":5,\"name\":\"Elizabeth Johnson\",\"address\":\"7553 Harness Circle\",\"email\":\"elizabeth5@adventure-works.com\",\"password\":\"$2y$10$ynxB0d5QI/x/s0H.Ks5zIOSlPCT5/LvT2s1EJPsvs1E9SckW3lk8C\"},\n\t\t\t{\"id\":6,\"name\":\"Julio Ruiz\",\"address\":\"7305 Humphrey Drive\",\"email\":\"julio1@adventure-works.com\",\"password\":\"$2y$10$ZeMIoZ9DPVx1Mmb6UldmQOBdpinovkCLtObAvJJr/aoC4ZV9X6RN.\"},\n\t\t\t{\"id\":7,\"name\":\"Janet Alvarez\",\"address\":\"2612 Berry Dr\",\"email\":\"janet9@adventure-works.com\",\"password\":\"$2y$10$uyeh/gADnu0PRxhBwfyLT.8sGEL4ndbS0oX8SLg6Ei.eyjE/fffoG\"},\n\t\t\t{\"id\":8,\"name\":\"Marco Mehta\",\"address\":\"942 Brook Street\",\"email\":\"marco14@adventure-works.com\",\"password\":\"$2y$10$CuTmay8q.38uCx67aHmTmu6WCDii0yXq4sP8bEcvilRS2e0puuYRK\"},\n\t\t\t{\"id\":9,\"name\":\"Rob Verhoff\",\"address\":\"624 Peabody Road\",\"email\":\"rob4@adventure-works.com\",\"password\":\"$2y$10$e9/t.fCkYLnzRDDg21tKHef6KWph6Is.NDBcbR8BsN2aeaBQhZ/GK\"},\n\t\t\t{\"id\":10,\"name\":\"Shannon Carlson\",\"address\":\"3839 Northgate Road\",\"email\":\"shannon38@adventure-works.com\",\"password\":\"$2y$10$nEaJMT8ZcuFl5BitQouXXOMyiBVs2OX0MPuHB.wtRyzvpr/64e7J6\"}\n\t\t]';\n\t\t$users = collect(json_decode($json))->sortBy('name')->all();\n\t\tif ($id=='rand') {\n\t\t\t$id = rand(1,count($users));\n\t\t}\n\t\tif ($id) {\n\t\t\t$user = collect(json_decode($json))->where('id', $id)->first();\n\t\t\treturn $user;\n\t\t} else {\n\t\t\treturn $users;\n\t\t}\n\t}\n\n\t// returns the list of categories\n\tpublic function categoryJson()\n\t{\n\t\t$json = '[ \n\t\t\t{\"id\":1,\"name\":\"Breakfast\",\"url\":\"breakfast\",\"img\":\"potatoes-g792cf4128_1920.jpg\"}, \n\t\t\t{\"id\":2,\"name\":\"Steak\",\"url\":\"steak\",\"img\":\"tomahawk-ge5ea2413d_1920.jpg\"}, \n\t\t\t{\"id\":3,\"name\":\"Pizza\",\"url\":\"pizza\",\"img\":\"pizza-g204a8b3d6_1920.jpg\"},\n\t\t\t{\"id\":4,\"name\":\"Burgers\",\"url\":\"burgers\",\"img\":\"hamburger-g685f013b8_1920.jpg\"},\n\t\t\t{\"id\":5,\"name\":\"Sushi\",\"url\":\"sushi\",\"img\":\"food-g3eb975adc_1920.jpg\"},\n\t\t\t{\"id\":6,\"name\":\"Salads\",\"url\":\"salads\",\"img\":\"salad-g3f02f56a0_1920.jpg\"}\n\t\t]';\n\t\t$category = collect(json_decode($json))->sortBy('name')->all();\n\t\treturn $category;\n\t}\n\n\t// returns a list of items\n\tpublic function itemJson($type=null,$id=null,$sort='name')\n\t{\n\t\t$json = '[ \n\t\t\t{\"id\":1,\"category_id\":1,\"name\":\"Cinnamon Roll\",\"img\":\"cinnamon-rolls-gb12ce8577_1920.jpg\",\"price\":\"1.19\",\"cooktime\":\"13\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":2,\"category_id\":1,\"name\":\"Toast & Eggs\",\"img\":\"breakfast-g7a2675ee6_1920.jpg\",\"price\":\"2.19\",\"cooktime\":\"7\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":3,\"category_id\":1,\"name\":\"Croissant\",\"img\":\"croissant-ga61b1fb0e_1920.jpg\",\"price\":\"3.19\",\"cooktime\":\"2\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":4,\"category_id\":1,\"name\":\"Bacon & Eggs\",\"img\":\"eggs-g9c07e92b1_1920.jpg\",\"price\":\"4.19\",\"cooktime\":\"14\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":5,\"category_id\":1,\"name\":\"Pancakes\",\"img\":\"pancakes-g9d341228a_1920.jpg\",\"price\":\"5.19\",\"cooktime\":\"12\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":6,\"category_id\":1,\"name\":\"Biscuits & Gravy\",\"img\":\"biscuits-g07bd069f8_1920.jpg\",\"price\":\"6.19\",\"cooktime\":\"6\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\n\t\t\t{\"id\":7,\"category_id\":2,\"name\":\"Tomahawk\",\"img\":\"steak-4342500_1920.jpg\",\"price\":\"1.29\",\"cooktime\":\"27\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":8,\"category_id\":2,\"name\":\"Sirloin\",\"img\":\"steak-1076665_1920.jpg\",\"price\":\"2.29\",\"cooktime\":\"22\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":9,\"category_id\":2,\"name\":\"T-Bone\",\"img\":\"steak-978654_1920.jpg\",\"price\":\"3.29\",\"cooktime\":\"23\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\n\t\t\t{\"id\":10,\"category_id\":3,\"name\":\"Pepperoni\",\"img\":\"pizza-1344720_1920.jpg\",\"price\":\"\",\"cooktime\":\"12\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":11,\"category_id\":3,\"name\":\"Margherita\",\"img\":\"pizza-3000274_1920.jpg\",\"price\":\"3\",\"cooktime\":\"6\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\n\t\t\t{\"id\":12,\"category_id\":4,\"name\":\"Sliders\",\"img\":\"hamburger-494706_1920.jpg\",\"price\":\"1.49\",\"cooktime\":\"9\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":13,\"category_id\":4,\"name\":\"Charbroiled\",\"img\":\"hamburger-1238246_1920.jpg\",\"price\":\"2.49\",\"cooktime\":\"17\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":14,\"category_id\":4,\"name\":\"Diner Burger\",\"img\":\"burger-3442227_1920.jpg\",\"price\":\"3.49\",\"cooktime\":\"12\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\n\t\t\t{\"id\":15,\"category_id\":5,\"name\":\"Sashimi Fresh Roll\",\"img\":\"sushi-354628_1920.jpg\",\"price\":\"1.59\",\"cooktime\":\"3\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":16,\"category_id\":5,\"name\":\"Power Fish\",\"img\":\"sushi-2853382_1920.jpg\",\"price\":\"2.59\",\"cooktime\":\"5\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":17,\"category_id\":5,\"name\":\"Spicy Tuna\",\"img\":\"sushi-599721_1920.jpg\",\"price\":\"3.59\",\"cooktime\":\"7\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":18,\"category_id\":5,\"name\":\"Avocado Roll\",\"img\":\"maki-716432_1920.jpg\",\"price\":\"4.59\",\"cooktime\":\"2\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":19,\"category_id\":5,\"name\":\"Sampler Plate\",\"img\":\"sushi-2856545_1920.jpg\",\"price\":\"5.59\",\"cooktime\":\"4\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":20,\"category_id\":5,\"name\":\"Veggie Roll\",\"img\":\"sushi-2020287_1920.jpg\",\"price\":\"6.59\",\"cooktime\":\"2\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":21,\"category_id\":5,\"name\":\"Maki\",\"img\":\"sushi-748139_1920.jpg\",\"price\":\"7.59\",\"cooktime\":\"5\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\n\t\t\t{\"id\":22,\"category_id\":6,\"name\":\"Bowl of Lettuce\",\"img\":\"food-1834645_1920.jpg\",\"price\":\"1.69\",\"cooktime\":\"1\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"},\n\t\t\t{\"id\":23,\"category_id\":6,\"name\":\"Plate of Lettuce\",\"img\":\"salad-2150548_1920.jpg\",\"price\":\"2.69\",\"cooktime\":\"1\",\"desc\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim lacus vel odio sagittis, ut faucibus felis vulputate. Duis nisi quam, luctus eget augue vel, ullamcorper commodo ipsum. Nunc quam turpis, facilisis interdum vestibulum et, volutpat congue arcu.\"}\n\t\t]';\n\n\t\t// need this to search json by category\n\t\t$category_to_id = [];\n\t\t$category_list = collect($this->categoryJson());\n\t\tforeach($category_list as $c) {\n\t\t\t$category_to_id[ $c->url ] = $c->id;\n\t\t}\n\n\t\tif ($type=='byCategory') {\n\t\t\t$item = collect(json_decode($json))->where('category_id', $category_to_id[$id])->sortBy('name')->all();\n\t\t} elseif ($type=='item') {\n\t\t\t$item = collect(json_decode($json))->where('id', $id)->first();\n\t\t} elseif ($type=='items') {\n\t\t\t$item = collect(json_decode($json))->whereIn('id', $id)->sortBy($sort)->all();\n\t\t} else {\n\t\t\t$item = collect(json_decode($json))->sortBy('name')->all();\n\t\t}\n\n\t\treturn $item;\n\t}\n\n\n}\n", "num_lines": 175}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Helpers;\n\nuse GuzzleHttp\\Client;\n\nclass CartApiService {\n    private Client $client;\n\n    public function __construct()\n    {\n        $this->client = new Client();\n    }\n\n    public static function instance() {\n        return new CartApiService();\n    }\n\n    public function openCart($userId) {\n        $body = array(\"userId\" => $userId);\n        $cart = $this->client->request('POST', config('api.cart_service_path'), [ 'json' => $body ]);\n        return json_decode($cart->getBody());\n    }\n\n    public function closeCart($cartId) {\n        $cart = $this->client->request('PUT', config('api.cart_service_path') . '/' . strval($cartId));\n        return json_decode($cart->getBody());\n    }\n\n}", "num_lines": 30}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Helpers;\n\nuse GuzzleHttp\\Client;\n\nclass CartItemApiService {\n    private Client $client;\n\n    public function __construct()\n    {\n        $this->client = new Client();\n    }\n\n    public static function instance() {\n        return new CartItemApiService();\n    }\n\n    public function addCartItems($cartItems)\n    {\n        $this->client->request('POST', config('api.cart_item_service_path'), ['json' => $cartItems]);\n    }\n}", "num_lines": 23}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Helpers;\n\nuse GuzzleHttp\\Client;\n\nclass CategoryApiService {\n    private Client $client;\n\n    public function __construct()\n    {\n        $this->client = new Client();\n    }\n\n    public static function instance() {\n        return new CategoryApiService();\n    }\n\n    public function getCategoriesAsc()\n    {\n        $categoryList = $this->client->request('GET', config('api.category_service_path'));\n        return json_decode($categoryList->getBody());\n    }\n}", "num_lines": 24}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Helpers;\n\nuse GuzzleHttp\\Client;\n\nclass ItemApiService {\n    private Client $client;\n\n    public function __construct()\n    {\n        $this->client = new Client();\n    }\n\n    public static function instance() {\n        return new ItemApiService();\n    }\n\n    public function getItemsAsc($url)\n    {\n        $categoryList = $this->client->request('GET', config('api.item_service_path') . '/categories/' . $url);\n        return json_decode($categoryList->getBody());\n    }\n\n    public function getItemsInCart($cartItems)\n    {\n        $body = array(\"itemKeys\" => $cartItems);\n        $itemList = $this->client->request('GET', config('api.item_service_path'), ['json' => $body]);\n        return json_decode($itemList->getBody());\n    }\n}", "num_lines": 31}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Helpers;\n\nuse GuzzleHttp\\Client;\n\nclass OrderApiService {\n    private Client $client;\n\n    public function __construct()\n    {\n        $this->client = new Client();\n    }\n\n    public static function instance() {\n        return new OrderApiService();\n    }\n\n    public function createOrder($userId, $cartId, $name, $address, $specialInstructions, $cookTime) {\n        $body = array(\n            'userId' => $userId,\n            'cartId' => $cartId,\n            'name' => $name,\n            'address' => $address,\n            'specialInstructions' => $specialInstructions,\n            'cooktime' => $cookTime\n        );\n        $order = $this->client->request('POST', config('api.order_service_path'), ['json' => $body]);\n        return json_decode($order->getBody());\n    }\n\n}", "num_lines": 32}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Helpers;\n\nuse GuzzleHttp\\Client;\n\nclass UserApiService {\n    private Client $client;\n\n    public function __construct()\n    {\n        $this->client = new Client();\n    }\n    \n    public static function instance()\n    {\n        return new UserApiService();\n    }\n\n    public function getRandomUser()\n    {\n        $res = $this->client->request('GET', config('api.user_service_path') . '/randomUser');\n        return json_decode($res->getBody());\n    }\n}\n", "num_lines": 26}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http;\n\nuse Illuminate\\Foundation\\Http\\Kernel as HttpKernel;\n\nclass Kernel extends HttpKernel\n{\n    /**\n     * The application's global HTTP middleware stack.\n     *\n     * These middleware are run during every request to your application.\n     *\n     * @var array\n     */\n    protected $middleware = [\n        // \\App\\Http\\Middleware\\TrustHosts::class,\n        \\App\\Http\\Middleware\\TrustProxies::class,\n        \\Fruitcake\\Cors\\HandleCors::class,\n        \\App\\Http\\Middleware\\PreventRequestsDuringMaintenance::class,\n        \\Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize::class,\n        \\App\\Http\\Middleware\\TrimStrings::class,\n        \\Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull::class,\n    ];\n\n    /**\n     * The application's route middleware groups.\n     *\n     * @var array\n     */\n    protected $middlewareGroups = [\n        'web' => [\n            \\App\\Http\\Middleware\\EncryptCookies::class,\n            \\Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse::class,\n            \\Illuminate\\Session\\Middleware\\StartSession::class,\n            // \\Illuminate\\Session\\Middleware\\AuthenticateSession::class,\n            \\Illuminate\\View\\Middleware\\ShareErrorsFromSession::class,\n            \\App\\Http\\Middleware\\VerifyCsrfToken::class,\n            \\Illuminate\\Routing\\Middleware\\SubstituteBindings::class,\n        ],\n\n        'api' => [\n            // \\Laravel\\Sanctum\\Http\\Middleware\\EnsureFrontendRequestsAreStateful::class,\n            'throttle:api',\n            \\Illuminate\\Routing\\Middleware\\SubstituteBindings::class,\n        ],\n    ];\n\n    /**\n     * The application's route middleware.\n     *\n     * These middleware may be assigned to groups or used individually.\n     *\n     * @var array\n     */\n    protected $routeMiddleware = [\n        'auth' => \\App\\Http\\Middleware\\Authenticate::class,\n        'auth.basic' => \\Illuminate\\Auth\\Middleware\\AuthenticateWithBasicAuth::class,\n        'cache.headers' => \\Illuminate\\Http\\Middleware\\SetCacheHeaders::class,\n        'can' => \\Illuminate\\Auth\\Middleware\\Authorize::class,\n        'guest' => \\App\\Http\\Middleware\\RedirectIfAuthenticated::class,\n        'password.confirm' => \\Illuminate\\Auth\\Middleware\\RequirePassword::class,\n        'signed' => \\Illuminate\\Routing\\Middleware\\ValidateSignature::class,\n        'throttle' => \\Illuminate\\Routing\\Middleware\\ThrottleRequests::class,\n        'verified' => \\Illuminate\\Auth\\Middleware\\EnsureEmailIsVerified::class,\n    ];\n}\n", "num_lines": 68}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Schema;\n\nuse App\\Helpers\\AppHelper;\nuse App\\Helpers\\ItemApiService;\nuse App\\Helpers\\CartApiService;\nuse App\\Helpers\\CartItemApiService;\nuse App\\Helpers\\OrderApiService;\nuse App\\Models\\Cart;\nuse App\\Models\\CartItem;\nuse App\\Models\\Order;\nuse App\\Models\\Item;\nuse GuzzleHttp\\Exception\\RequestException;\n\nclass CartController extends Controller\n{\n\n\t// pages:\n\n\tpublic function checkout()\n\t{\n\t\t$user = session('user');\n\t\t$cart = session('cart');\n\t\t$item_list = [];\n\t\tif ($cart) $item_list = array_keys($cart);\n\t\ttry\n\t\t{\n\t\t\t$items = ItemApiService::instance()->getItemsInCart($item_list);\n\t\t}\n\t\tcatch (RequestException $e)\n\t\t{\n\t\t\t// if there's no database connection, use a helper and JSON data\n\t\t\t$items = AppHelper::instance()->itemJson('items',$item_list);\n\t\t\t// set a flag so we can display a warning if JSON data is used\n\t\t\t$json_warning = 1;\n\t\t}\n\t\t$cart_total = 0;\n\t\t$cart_data = [];\n\t\tforeach($items as $item) {\n\t\t\t$qty = $cart[$item->id];\n\t\t\t$item->qty = $qty;\n\t\t\t// set price to 0 in the event there is bad data\n\t\t\t$price = is_numeric($item->price) ? $item->price : 0;\n\t\t\t// set item subtotal\n\t\t\t$item->sub = $qty * number_format($price, 2);\n\t\t\t// increment cart total\n\t\t\t$cart_total += $item->sub;\n\t\t\t// add item to cart array\n\t\t\t$cart_data[$item->id] = $item;\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$cart = CartApiService::instance()->openCart($user->id);\n\n\t\t\t// Batch cart items and then save them using the API\n\t\t\t$cartItems = [];\n\t\t\tforeach($cart_data as $id => $item) {\n\t\t\t\tarray_push($cartItems, array('cartId' => $cart->id, 'itemId' => $id, 'qty' => $item->qty));\n\t\t\t}\n\t\t\tCartItemApiService::instance()->addCartItems($cartItems);\n\n\t\t\tsession(['cart_id' => $cart->id]);\n\t\t}\n\t\tcatch (RequestException $e)\n\t\t{\n\t\t\tsession(['cart_id' => 'session']);\n\t\t\t$json_warning = 1;\n\t\t}\n\n\t\treturn view('checkout', ['header'=>1, 'user'=>$user, 'cart_data'=>$cart_data, 'cart_total'=>$cart_total, 'json_warning'=>($json_warning ?? 0)]);\n\t}\n\n\n\tpublic function processOrder(Request $request)\n\t{\n\t\t$user = session('user');\n\t\t$cart = session('cart');\n\t\t$cart_id = session('cart_id');\n\n\t\tif (!$user || !$cart || !$cart_id) {\n\t\t\t// something is missing, bounce back to the checkout page\n\t\t\treturn redirect()->route('checkout');\n\t\t}\n\n\t\tif ($cart) {\n\t\t\t$item_list = array_keys($cart);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$item = ItemApiService::instance()->getItemsInCart($item_list);\n\t\t\t}\n\t\t\tcatch (RequestException $e)\n\t\t\t{\n\t\t\t\t$item = AppHelper::instance()->itemJson('items',$item_list,'cooktime');\n\t\t\t}\n\n\t\t\t// show a semi-random delivery time to make it more fun\n\t\t\t$cooktime = 0;\n\t\t\t// start with a random prep/drive time\n\t\t\t$time = rand(5,20);\n\t\t\tforeach($item as $i) {\n\t\t\t\t// get the longest cooktime of all items in the cart\n\t\t\t\tif ($cooktime < $i->cooktime) { \n\t\t\t\t\t$cooktime = $i->cooktime; \n\t\t\t\t}\n\t\t\t}\n\t\t\t// add the cooktime to the random prep/drive time\n\t\t\t$time+=$cooktime;\n\t\t\t// turn it into minutes from *right now*\n\t\t\t$delivery = strtotime(now())+($time*60);\n\n\t\t\t$name = $request->name ?? $user->name;\n\t\t\t$address = $request->address ?? $user->address;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tCartApiService::instance()->closeCart($cart_id);\n\t\t\t\tOrderApiService::instance()->createOrder($user->id, $cart_id, $name, $address, $request->special_instructions, $time);\n\t\t\t}\n\t\t\tcatch (RequestException $e) {}\n\n\t\t\t// clear all the sessions\n\t\t\tsession()->forget('cart');\n\t\t\tsession()->forget('cart_id');\n\t\t\tsession()->forget('receipt');\n\n\t\t\tsession([ 'receipt' => ['created_at'=>strtotime(now()), 'delivery'=>$delivery] ]);\n\t\t}\t\t\n\t\t// redirect to the receipt page\n\t\treturn redirect()->route('receipt');\n\t}\n\n\n\tpublic function receipt()\n\t{\n\t\t$time_left = 0;\n\n\t\t// use the receipt session or display a generic message\n\t\t$receipt = session('receipt');\n\t\tif ($receipt) {\n\t\t\t// figure out how many minutes are left before food arrives\n\t\t\t$time_left = floor( ($receipt['delivery'] - strtotime(now()) )/60 );\n\t\t}\n\n\t\treturn view('receipt', ['header'=>1, 'receipt'=>$receipt, 'time_left'=>$time_left]);\n\t}\n\n\n\n\t// ajax:\n\n\tpublic function addToCart(Request $request)\n\t{\n\t\t// Item ID\n\t\t$id = $request->item;\n\t\tif (!session('cart')) {\n\t\t\tsession([ 'cart' => [] ]);\n\t\t}\n\t\t$cart = session('cart');\n\t\tif (isset($cart[$id])) {\n\t\t\t$cart[$id]++;\n\t\t} else {\n\t\t\t$cart[$id] = 1;\n\t\t}\n\t\tsession(['cart' => $cart]);\n\n\t\t// update the floating cart\n\t\t$global_cart = AppHelper::instance()->globalCart();\n\n\t\treturn $global_cart;\n\t}\n\n\tpublic function updateCart(Request $request)\n\t{\n\t\t$item = $request->cart_items;\n\t\t$cart = session('cart');\n\t\tforeach ($item as $id => $qty) {\n\t\t\tif (isset($cart[$id]) && $qty<1) {\n\t\t\t\tunset($cart[$id]);\n\t\t\t} else {\n\t\t\t\t$cart[$id] = $qty;\n\t\t\t}\n\t\t}\n\t\tsession(['cart' => $cart]);\n\n\t\t// update the floating cart\n\t\t$global_cart = AppHelper::instance()->globalCart('show');\n\n\t\treturn $global_cart;\n\t}\n\n}\n", "num_lines": 198}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse Illuminate\\Foundation\\Auth\\Access\\AuthorizesRequests;\nuse Illuminate\\Foundation\\Bus\\DispatchesJobs;\nuse Illuminate\\Foundation\\Validation\\ValidatesRequests;\nuse Illuminate\\Routing\\Controller as BaseController;\n\nclass Controller extends BaseController\n{\n    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;\n}\n", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Schema;\n\nuse App\\Helpers\\AppHelper;\nuse App\\Models\\User;\n\nclass HomeController extends Controller\n{\n\n\t/*\n\t\tUsing the default Laravel 8 installation, this app example attempts to cover the very basic \n\t\tessentials without getting too complex. We've provided sample JSON data so the app can function \n\t\teven if there is no database connection. (JSON data can be found in /app/Helpers/AppHelper.php)\n\t*/\n\n\t// pages:\n\t\n\tpublic function index()\n\t{\n\t\t// forget the user session so we can get a new user on reload\n\t\tsession()->forget('user');\n\n\t\t// pretend the user logged in\n\t\t$user = AppHelper::instance()->randomUser();\n\t\t$json_warning = $user->fromJson;\n\n\t\t// display the floating cart\n\t\t$global_cart = AppHelper::instance()->globalCart();\n\n\t\treturn view('index', ['global_cart'=>$global_cart, 'user'=>$user, 'json_warning'=>($json_warning ?? 0)]);\n\t}\n\n}\n", "num_lines": 38}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Schema;\n\nuse App\\Helpers\\AppHelper;\nuse App\\Helpers\\CategoryApiService;\nuse App\\Models\\User;\nuse App\\Models\\Category;\nuse GuzzleHttp\\Exception\\RequestException;\n\nuse App\\Helpers\\ItemApiService;\n\nclass ProductController extends Controller\n{\n\n\t// pages:\n\n\tpublic function categoryList()\n\t{\n\t\t// pretend the user logged in\n\t\t$user = AppHelper::instance()->randomUser();\n\n\t\ttry\n\t\t{\n\t\t\t$data = CategoryApiService::instance()->getCategoriesAsc();\n\t\t}\n\t\tcatch (RequestException $e)\n\t\t{\n\t\t\t// if there's no database connection, use a helper and JSON data\n\t\t\t$data = AppHelper::instance()->categoryJson();\n\t\t\t// set a flag so we can display a warning if JSON data is used\n\t\t\t$json_warning = 1;\n\t\t}\n\n\t\t// display the floating cart\n\t\t$global_cart = AppHelper::instance()->globalCart();\n\n\t\treturn view('category-list', ['header'=>1, 'global_cart'=>$global_cart, 'category'=>$data, 'json_warning'=>($json_warning ?? 0)]);\n\t}\n\n\t\n\tpublic function itemList($category)\n\t{\n\t\t// pretend the user logged in\n\t\t$user = AppHelper::instance()->randomUser();\n\n\t\ttry\n\t\t{\n\t\t\t$data = ItemApiService::instance()->getItemsAsc($category);\n\t\t}\n\t\tcatch (RequestException $e)\n\t\t{\n\t\t\t// if there's no database connection, use a helper and JSON data\n\t\t\t$data = AppHelper::instance()->itemJson('byCategory',$category);\n\t\t\t// set a flag so we can display a warning if JSON data is used\n\t\t\t$json_warning = 1;\n\t\t}\n\n\t\t// display the floating cart\n\t\t$global_cart = AppHelper::instance()->globalCart();\n\n\t\treturn view('item-list', ['header'=>1, 'global_cart'=>$global_cart, 'item'=>$data, 'json_warning'=>($json_warning ?? 0)]);\n\t}\n\n}\n", "num_lines": 69}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Auth\\Middleware\\Authenticate as Middleware;\n\nclass Authenticate extends Middleware\n{\n    /**\n     * Get the path the user should be redirected to when they are not authenticated.\n     *\n     * @param  \\Illuminate\\Http\\Request  $request\n     * @return string|null\n     */\n    protected function redirectTo($request)\n    {\n        if (! $request->expectsJson()) {\n            return route('login');\n        }\n    }\n}\n", "num_lines": 22}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Cookie\\Middleware\\EncryptCookies as Middleware;\n\nclass EncryptCookies extends Middleware\n{\n    /**\n     * The names of the cookies that should not be encrypted.\n     *\n     * @var array\n     */\n    protected $except = [\n        //\n    ];\n}\n", "num_lines": 18}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance as Middleware;\n\nclass PreventRequestsDuringMaintenance extends Middleware\n{\n    /**\n     * The URIs that should be reachable while maintenance mode is enabled.\n     *\n     * @var array\n     */\n    protected $except = [\n        //\n    ];\n}\n", "num_lines": 18}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse App\\Providers\\RouteServiceProvider;\nuse Closure;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Auth;\n\nclass RedirectIfAuthenticated\n{\n    /**\n     * Handle an incoming request.\n     *\n     * @param  \\Illuminate\\Http\\Request  $request\n     * @param  \\Closure  $next\n     * @param  string|null  ...$guards\n     * @return mixed\n     */\n    public function handle(Request $request, Closure $next, ...$guards)\n    {\n        $guards = empty($guards) ? [null] : $guards;\n\n        foreach ($guards as $guard) {\n            if (Auth::guard($guard)->check()) {\n                return redirect(RouteServiceProvider::HOME);\n            }\n        }\n\n        return $next($request);\n    }\n}\n", "num_lines": 33}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Foundation\\Http\\Middleware\\TrimStrings as Middleware;\n\nclass TrimStrings extends Middleware\n{\n    /**\n     * The names of the attributes that should not be trimmed.\n     *\n     * @var array\n     */\n    protected $except = [\n        'current_password',\n        'password',\n        'password_confirmation',\n    ];\n}\n", "num_lines": 20}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Http\\Middleware\\TrustHosts as Middleware;\n\nclass TrustHosts extends Middleware\n{\n    /**\n     * Get the host patterns that should be trusted.\n     *\n     * @return array\n     */\n    public function hosts()\n    {\n        return [\n            $this->allSubdomainsOfApplicationUrl(),\n        ];\n    }\n}\n", "num_lines": 21}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Http\\Middleware\\TrustProxies as Middleware;\nuse Illuminate\\Http\\Request;\n\nclass TrustProxies extends Middleware\n{\n    /**\n     * The trusted proxies for this application.\n     *\n     * @var array|string|null\n     */\n    protected $proxies;\n\n    /**\n     * The headers that should be used to detect proxies.\n     *\n     * @var int\n     */\n    protected $headers =\n        Request::HEADER_X_FORWARDED_FOR |\n        Request::HEADER_X_FORWARDED_HOST |\n        Request::HEADER_X_FORWARDED_PORT |\n        Request::HEADER_X_FORWARDED_PROTO |\n        Request::HEADER_X_FORWARDED_AWS_ELB;\n}\n", "num_lines": 29}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken as Middleware;\n\nclass VerifyCsrfToken extends Middleware\n{\n    /**\n     * The URIs that should be excluded from CSRF verification.\n     *\n     * @var array\n     */\n    protected $except = [\n        //\n    ];\n}\n", "num_lines": 18}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Cart extends Model\n{\n\tuse HasFactory;\n\n\tpublic $timestamps = false;\n\n\tprotected $fillable = [\n\t\t'user_id',\n\t\t'status',\n\t];\n\n\tprotected $with = [\n\t\t'cart_items',\n\t];\n\n\tpublic function cart_items()\n\t{\n\t\treturn $this->hasMany(CartItem::class, 'cart_id', 'id');\n\t}\n\n}\n", "num_lines": 29}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass CartItem extends Model\n{\n\tuse HasFactory;\n\n\tpublic $timestamps = false;\n\n\tprotected $fillable = [\n\t\t'cart_id',\n\t\t'item_id',\n\t\t'qty',\n\t];\n\n\tprotected $with = [\n\t\t'item',\n\t];\n\n\tpublic function cart()\n\t{\n\t\treturn $this->belongsTo(Cart::class, 'cart_id', 'id');\n\t}\n\n\tpublic function item()\n\t{\n\t\treturn $this->hasOne(Item::class, 'id', 'item_id')->orderBy('name');\n\t}\n\n}\n", "num_lines": 35}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Category extends Model\n{\n\tuse HasFactory;\n\n\tpublic $timestamps = false;\n\n\tprotected $fillable = [\n\t\t'name',\n\t\t'url',\n\t\t'img',\n\t];\n\n\tpublic function items()\n\t{\n\t\treturn $this->hasMany(Item::class, 'category_id', 'id')->orderBy('name');\n\t}\n\n}\n", "num_lines": 26}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Item extends Model\n{\n\tuse HasFactory;\n\n\tpublic $timestamps = false;\n\n\tprotected $fillable = [\n\t\t'category_id',\n\t\t'name',\n\t\t'img',\n\t\t'price',\n\t\t'cooktime',\n\t\t'desc',\n\t];\n\n\tpublic function category()\n\t{\n\t\treturn $this->belongsTo(Category::class, 'category_id', 'id');\n\t}\n\n}\n", "num_lines": 29}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Order extends Model\n{\n\tuse HasFactory;\n\n\tprotected $fillable = [\n\t\t'user_id',\n\t\t'cart_id',\n\t\t'name',\n\t\t'address',\n\t\t'special_instructions',\n\t\t'cooktime',\n\t];\n\n\tprotected $with = [\n\t\t'cart',\n\t];\n\n\tpublic function cart()\n\t{\n\t\treturn $this->hasOne(Cart::class, 'cart_id', 'id');\n\t}\n\n}\n", "num_lines": 31}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass User extends Model\n{\n\tuse HasFactory;\n\n\tpublic $timestamps = false;\n\n\tprotected $fillable = [\n\t\t'name',\n\t\t'address',\n\t\t'email',\n\t\t'password',\n\t];\n\n}\n", "num_lines": 22}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Support\\ServiceProvider;\n\nclass AppServiceProvider extends ServiceProvider\n{\n    /**\n     * Register any application services.\n     *\n     * @return void\n     */\n    public function register()\n    {\n        //\n    }\n\n    /**\n     * Bootstrap any application services.\n     *\n     * @return void\n     */\n    public function boot()\n    {\n        //\n    }\n}\n", "num_lines": 29}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Foundation\\Support\\Providers\\AuthServiceProvider as ServiceProvider;\nuse Illuminate\\Support\\Facades\\Gate;\n\nclass AuthServiceProvider extends ServiceProvider\n{\n    /**\n     * The policy mappings for the application.\n     *\n     * @var array\n     */\n    protected $policies = [\n        // 'App\\Models\\Model' => 'App\\Policies\\ModelPolicy',\n    ];\n\n    /**\n     * Register any authentication / authorization services.\n     *\n     * @return void\n     */\n    public function boot()\n    {\n        $this->registerPolicies();\n\n        //\n    }\n}\n", "num_lines": 31}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Support\\Facades\\Broadcast;\nuse Illuminate\\Support\\ServiceProvider;\n\nclass BroadcastServiceProvider extends ServiceProvider\n{\n    /**\n     * Bootstrap any application services.\n     *\n     * @return void\n     */\n    public function boot()\n    {\n        Broadcast::routes();\n\n        require base_path('routes/channels.php');\n    }\n}\n", "num_lines": 22}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Auth\\Events\\Registered;\nuse Illuminate\\Auth\\Listeners\\SendEmailVerificationNotification;\nuse Illuminate\\Foundation\\Support\\Providers\\EventServiceProvider as ServiceProvider;\nuse Illuminate\\Support\\Facades\\Event;\n\nclass EventServiceProvider extends ServiceProvider\n{\n    /**\n     * The event listener mappings for the application.\n     *\n     * @var array\n     */\n    protected $listen = [\n        Registered::class => [\n            SendEmailVerificationNotification::class,\n        ],\n    ];\n\n    /**\n     * Register any events for your application.\n     *\n     * @return void\n     */\n    public function boot()\n    {\n        //\n    }\n}\n", "num_lines": 33}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Cache\\RateLimiting\\Limit;\nuse Illuminate\\Foundation\\Support\\Providers\\RouteServiceProvider as ServiceProvider;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\RateLimiter;\nuse Illuminate\\Support\\Facades\\Route;\n\nclass RouteServiceProvider extends ServiceProvider\n{\n    /**\n     * The path to the \"home\" route for your application.\n     *\n     * This is used by Laravel authentication to redirect users after login.\n     *\n     * @var string\n     */\n    public const HOME = '/home';\n\n    /**\n     * The controller namespace for the application.\n     *\n     * When present, controller route declarations will automatically be prefixed with this namespace.\n     *\n     * @var string|null\n     */\n    protected $namespace = 'App\\\\Http\\\\Controllers';\n\n    /**\n     * Define your route model bindings, pattern filters, etc.\n     *\n     * @return void\n     */\n    public function boot()\n    {\n        $this->configureRateLimiting();\n\n        $this->routes(function () {\n            Route::prefix('api')\n                ->middleware('api')\n                ->namespace($this->namespace)\n                ->group(base_path('routes/api.php'));\n\n            Route::middleware('web')\n                ->namespace($this->namespace)\n                ->group(base_path('routes/web.php'));\n        });\n    }\n\n    /**\n     * Configure the rate limiters for the application.\n     *\n     * @return void\n     */\n    protected function configureRateLimiting()\n    {\n        RateLimiter::for('api', function (Request $request) {\n            return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n        });\n    }\n}\n", "num_lines": 64}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n/*\n|--------------------------------------------------------------------------\n| Create The Application\n|--------------------------------------------------------------------------\n|\n| The first thing we will do is create a new Laravel application instance\n| which serves as the \"glue\" for all the components of Laravel, and is\n| the IoC container for the system binding all of the various parts.\n|\n*/\n\n$app = new Illuminate\\Foundation\\Application(\n    $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)\n);\n\n/*\n|--------------------------------------------------------------------------\n| Bind Important Interfaces\n|--------------------------------------------------------------------------\n|\n| Next, we need to bind some important interfaces into the container so\n| we will be able to resolve them when needed. The kernels serve the\n| incoming requests to this application from both the web and CLI.\n|\n*/\n\n$app->singleton(\n    Illuminate\\Contracts\\Http\\Kernel::class,\n    App\\Http\\Kernel::class\n);\n\n$app->singleton(\n    Illuminate\\Contracts\\Console\\Kernel::class,\n    App\\Console\\Kernel::class\n);\n\n$app->singleton(\n    Illuminate\\Contracts\\Debug\\ExceptionHandler::class,\n    App\\Exceptions\\Handler::class\n);\n\n/*\n|--------------------------------------------------------------------------\n| Return The Application\n|--------------------------------------------------------------------------\n|\n| This script returns the application instance. The instance is given to\n| the calling script so we can separate the building of the instances\n| from the actual running of the application and sending responses.\n|\n*/\n\nreturn $app;\n", "num_lines": 56}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n    'cart_service_path' => getenv('REST_API_BASE_PATH') . '/carts',\n    'user_service_path' => getenv('REST_API_BASE_PATH') . '/users',\n    'cart_item_service_path' => getenv('REST_API_BASE_PATH') . '/cartitems',\n    'category_service_path' => getenv('REST_API_BASE_PATH') . '/categories',\n    'item_service_path' => getenv('REST_API_BASE_PATH') . '/items',\n    'order_service_path' => getenv('REST_API_BASE_PATH') . '/orders'\n];\n", "num_lines": 11}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Application Name\n    |--------------------------------------------------------------------------\n    |\n    | This value is the name of your application. This value is used when the\n    | framework needs to place the application's name in a notification or\n    | any other location as required by the application or its packages.\n    |\n    */\n\n    'name' => env('APP_NAME', 'Laravel'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Application Environment\n    |--------------------------------------------------------------------------\n    |\n    | This value determines the \"environment\" your application is currently\n    | running in. This may determine how you prefer to configure various\n    | services the application utilizes. Set this in your \".env\" file.\n    |\n    */\n\n    'env' => env('APP_ENV', 'production'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Application Debug Mode\n    |--------------------------------------------------------------------------\n    |\n    | When your application is in debug mode, detailed error messages with\n    | stack traces will be shown on every error that occurs within your\n    | application. If disabled, a simple generic error page is shown.\n    |\n    */\n\n    'debug' => (bool) env('APP_DEBUG', false),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Application URL\n    |--------------------------------------------------------------------------\n    |\n    | This URL is used by the console to properly generate URLs when using\n    | the Artisan command line tool. You should set this to the root of\n    | your application so that it is used when running Artisan tasks.\n    |\n    */\n\n    'url' => env('APP_URL', 'http://localhost'),\n\n    'asset_url' => env('ASSET_URL', null),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Application Timezone\n    |--------------------------------------------------------------------------\n    |\n    | Here you may specify the default timezone for your application, which\n    | will be used by the PHP date and date-time functions. We have gone\n    | ahead and set this to a sensible default for you out of the box.\n    |\n    */\n\n    'timezone' => 'UTC',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Application Locale Configuration\n    |--------------------------------------------------------------------------\n    |\n    | The application locale determines the default locale that will be used\n    | by the translation service provider. You are free to set this value\n    | to any of the locales which will be supported by the application.\n    |\n    */\n\n    'locale' => 'en',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Application Fallback Locale\n    |--------------------------------------------------------------------------\n    |\n    | The fallback locale determines the locale to use when the current one\n    | is not available. You may change the value to correspond to any of\n    | the language folders that are provided through your application.\n    |\n    */\n\n    'fallback_locale' => 'en',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Faker Locale\n    |--------------------------------------------------------------------------\n    |\n    | This locale will be used by the Faker PHP library when generating fake\n    | data for your database seeds. For example, this will be used to get\n    | localized telephone numbers, street address information and more.\n    |\n    */\n\n    'faker_locale' => 'en_US',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Encryption Key\n    |--------------------------------------------------------------------------\n    |\n    | This key is used by the Illuminate encrypter service and should be set\n    | to a random, 32 character string, otherwise these encrypted strings\n    | will not be safe. Please do this before deploying an application!\n    |\n    */\n\n    'key' => env('APP_KEY'),\n\n    'cipher' => 'AES-256-CBC',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Autoloaded Service Providers\n    |--------------------------------------------------------------------------\n    |\n    | The service providers listed here will be automatically loaded on the\n    | request to your application. Feel free to add your own services to\n    | this array to grant expanded functionality to your applications.\n    |\n    */\n\n    'providers' => [\n\n        /*\n         * Laravel Framework Service Providers...\n         */\n        Illuminate\\Auth\\AuthServiceProvider::class,\n        Illuminate\\Broadcasting\\BroadcastServiceProvider::class,\n        Illuminate\\Bus\\BusServiceProvider::class,\n        Illuminate\\Cache\\CacheServiceProvider::class,\n        Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider::class,\n        Illuminate\\Cookie\\CookieServiceProvider::class,\n        Illuminate\\Database\\DatabaseServiceProvider::class,\n        Illuminate\\Encryption\\EncryptionServiceProvider::class,\n        Illuminate\\Filesystem\\FilesystemServiceProvider::class,\n        Illuminate\\Foundation\\Providers\\FoundationServiceProvider::class,\n        Illuminate\\Hashing\\HashServiceProvider::class,\n        Illuminate\\Mail\\MailServiceProvider::class,\n        Illuminate\\Notifications\\NotificationServiceProvider::class,\n        Illuminate\\Pagination\\PaginationServiceProvider::class,\n        Illuminate\\Pipeline\\PipelineServiceProvider::class,\n        Illuminate\\Queue\\QueueServiceProvider::class,\n        Illuminate\\Redis\\RedisServiceProvider::class,\n        Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider::class,\n        Illuminate\\Session\\SessionServiceProvider::class,\n        Illuminate\\Translation\\TranslationServiceProvider::class,\n        Illuminate\\Validation\\ValidationServiceProvider::class,\n        Illuminate\\View\\ViewServiceProvider::class,\n\n        /*\n         * Package Service Providers...\n         */\n\n        /*\n         * Application Service Providers...\n         */\n        App\\Providers\\AppServiceProvider::class,\n        App\\Providers\\AuthServiceProvider::class,\n        // App\\Providers\\BroadcastServiceProvider::class,\n        App\\Providers\\EventServiceProvider::class,\n        App\\Providers\\RouteServiceProvider::class,\n\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Class Aliases\n    |--------------------------------------------------------------------------\n    |\n    | This array of class aliases will be registered when this application\n    | is started. However, feel free to register as many as you wish as\n    | the aliases are \"lazy\" loaded so they don't hinder performance.\n    |\n    */\n\n    'aliases' => [\n\n        'App' => Illuminate\\Support\\Facades\\App::class,\n        'Arr' => Illuminate\\Support\\Arr::class,\n        'Artisan' => Illuminate\\Support\\Facades\\Artisan::class,\n        'Auth' => Illuminate\\Support\\Facades\\Auth::class,\n        'Blade' => Illuminate\\Support\\Facades\\Blade::class,\n        'Broadcast' => Illuminate\\Support\\Facades\\Broadcast::class,\n        'Bus' => Illuminate\\Support\\Facades\\Bus::class,\n        'Cache' => Illuminate\\Support\\Facades\\Cache::class,\n        'Config' => Illuminate\\Support\\Facades\\Config::class,\n        'Cookie' => Illuminate\\Support\\Facades\\Cookie::class,\n        'Crypt' => Illuminate\\Support\\Facades\\Crypt::class,\n        'Date' => Illuminate\\Support\\Facades\\Date::class,\n        'DB' => Illuminate\\Support\\Facades\\DB::class,\n        'Eloquent' => Illuminate\\Database\\Eloquent\\Model::class,\n        'Event' => Illuminate\\Support\\Facades\\Event::class,\n        'File' => Illuminate\\Support\\Facades\\File::class,\n        'Gate' => Illuminate\\Support\\Facades\\Gate::class,\n        'Hash' => Illuminate\\Support\\Facades\\Hash::class,\n        'Http' => Illuminate\\Support\\Facades\\Http::class,\n        'Js' => Illuminate\\Support\\Js::class,\n        'Lang' => Illuminate\\Support\\Facades\\Lang::class,\n        'Log' => Illuminate\\Support\\Facades\\Log::class,\n        'Mail' => Illuminate\\Support\\Facades\\Mail::class,\n        'Notification' => Illuminate\\Support\\Facades\\Notification::class,\n        'Password' => Illuminate\\Support\\Facades\\Password::class,\n        'Queue' => Illuminate\\Support\\Facades\\Queue::class,\n        'RateLimiter' => Illuminate\\Support\\Facades\\RateLimiter::class,\n        'Redirect' => Illuminate\\Support\\Facades\\Redirect::class,\n        // 'Redis' => Illuminate\\Support\\Facades\\Redis::class,\n        'Request' => Illuminate\\Support\\Facades\\Request::class,\n        'Response' => Illuminate\\Support\\Facades\\Response::class,\n        'Route' => Illuminate\\Support\\Facades\\Route::class,\n        'Schema' => Illuminate\\Support\\Facades\\Schema::class,\n        'Session' => Illuminate\\Support\\Facades\\Session::class,\n        'Storage' => Illuminate\\Support\\Facades\\Storage::class,\n        'Str' => Illuminate\\Support\\Str::class,\n        'URL' => Illuminate\\Support\\Facades\\URL::class,\n        'Validator' => Illuminate\\Support\\Facades\\Validator::class,\n        'View' => Illuminate\\Support\\Facades\\View::class,\n\n    ],\n\n];\n", "num_lines": 236}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Authentication Defaults\n    |--------------------------------------------------------------------------\n    |\n    | This option controls the default authentication \"guard\" and password\n    | reset options for your application. You may change these defaults\n    | as required, but they're a perfect start for most applications.\n    |\n    */\n\n    'defaults' => [\n        'guard' => 'web',\n        'passwords' => 'users',\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Authentication Guards\n    |--------------------------------------------------------------------------\n    |\n    | Next, you may define every authentication guard for your application.\n    | Of course, a great default configuration has been defined for you\n    | here which uses session storage and the Eloquent user provider.\n    |\n    | All authentication drivers have a user provider. This defines how the\n    | users are actually retrieved out of your database or other storage\n    | mechanisms used by this application to persist your user's data.\n    |\n    | Supported: \"session\"\n    |\n    */\n\n    'guards' => [\n        'web' => [\n            'driver' => 'session',\n            'provider' => 'users',\n        ],\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | User Providers\n    |--------------------------------------------------------------------------\n    |\n    | All authentication drivers have a user provider. This defines how the\n    | users are actually retrieved out of your database or other storage\n    | mechanisms used by this application to persist your user's data.\n    |\n    | If you have multiple user tables or models you may configure multiple\n    | sources which represent each model / table. These sources may then\n    | be assigned to any extra authentication guards you have defined.\n    |\n    | Supported: \"database\", \"eloquent\"\n    |\n    */\n\n    'providers' => [\n        'users' => [\n            'driver' => 'eloquent',\n            'model' => App\\Models\\User::class,\n        ],\n\n        // 'users' => [\n        //     'driver' => 'database',\n        //     'table' => 'users',\n        // ],\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Resetting Passwords\n    |--------------------------------------------------------------------------\n    |\n    | You may specify multiple password reset configurations if you have more\n    | than one user table or model in the application and you want to have\n    | separate password reset settings based on the specific user types.\n    |\n    | The expire time is the number of minutes that the reset token should be\n    | considered valid. This security feature keeps tokens short-lived so\n    | they have less time to be guessed. You may change this as needed.\n    |\n    */\n\n    'passwords' => [\n        'users' => [\n            'provider' => 'users',\n            'table' => 'password_resets',\n            'expire' => 60,\n            'throttle' => 60,\n        ],\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Password Confirmation Timeout\n    |--------------------------------------------------------------------------\n    |\n    | Here you may define the amount of seconds before a password confirmation\n    | times out and the user is prompted to re-enter their password via the\n    | confirmation screen. By default, the timeout lasts for three hours.\n    |\n    */\n\n    'password_timeout' => 10800,\n\n];\n", "num_lines": 112}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Broadcaster\n    |--------------------------------------------------------------------------\n    |\n    | This option controls the default broadcaster that will be used by the\n    | framework when an event needs to be broadcast. You may set this to\n    | any of the connections defined in the \"connections\" array below.\n    |\n    | Supported: \"pusher\", \"ably\", \"redis\", \"log\", \"null\"\n    |\n    */\n\n    'default' => env('BROADCAST_DRIVER', 'null'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Broadcast Connections\n    |--------------------------------------------------------------------------\n    |\n    | Here you may define all of the broadcast connections that will be used\n    | to broadcast events to other systems or over websockets. Samples of\n    | each available type of connection are provided inside this array.\n    |\n    */\n\n    'connections' => [\n\n        'pusher' => [\n            'driver' => 'pusher',\n            'key' => env('PUSHER_APP_KEY'),\n            'secret' => env('PUSHER_APP_SECRET'),\n            'app_id' => env('PUSHER_APP_ID'),\n            'options' => [\n                'cluster' => env('PUSHER_APP_CLUSTER'),\n                'useTLS' => true,\n            ],\n        ],\n\n        'ably' => [\n            'driver' => 'ably',\n            'key' => env('ABLY_KEY'),\n        ],\n\n        'redis' => [\n            'driver' => 'redis',\n            'connection' => 'default',\n        ],\n\n        'log' => [\n            'driver' => 'log',\n        ],\n\n        'null' => [\n            'driver' => 'null',\n        ],\n\n    ],\n\n];\n", "num_lines": 65}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Support\\Str;\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Cache Store\n    |--------------------------------------------------------------------------\n    |\n    | This option controls the default cache connection that gets used while\n    | using this caching library. This connection is used when another is\n    | not explicitly specified when executing a given caching function.\n    |\n    */\n\n    'default' => env('CACHE_DRIVER', 'file'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Cache Stores\n    |--------------------------------------------------------------------------\n    |\n    | Here you may define all of the cache \"stores\" for your application as\n    | well as their drivers. You may even define multiple stores for the\n    | same cache driver to group types of items stored in your caches.\n    |\n    | Supported drivers: \"apc\", \"array\", \"database\", \"file\",\n    |         \"memcached\", \"redis\", \"dynamodb\", \"octane\", \"null\"\n    |\n    */\n\n    'stores' => [\n\n        'apc' => [\n            'driver' => 'apc',\n        ],\n\n        'array' => [\n            'driver' => 'array',\n            'serialize' => false,\n        ],\n\n        'database' => [\n            'driver' => 'database',\n            'table' => 'cache',\n            'connection' => null,\n            'lock_connection' => null,\n        ],\n\n        'file' => [\n            'driver' => 'file',\n            'path' => storage_path('framework/cache/data'),\n        ],\n\n        'memcached' => [\n            'driver' => 'memcached',\n            'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),\n            'sasl' => [\n                env('MEMCACHED_USERNAME'),\n                env('MEMCACHED_PASSWORD'),\n            ],\n            'options' => [\n                // Memcached::OPT_CONNECT_TIMEOUT => 2000,\n            ],\n            'servers' => [\n                [\n                    'host' => env('MEMCACHED_HOST', '127.0.0.1'),\n                    'port' => env('MEMCACHED_PORT', 11211),\n                    'weight' => 100,\n                ],\n            ],\n        ],\n\n        'redis' => [\n            'driver' => 'redis',\n            'connection' => 'cache',\n            'lock_connection' => 'default',\n        ],\n\n        'dynamodb' => [\n            'driver' => 'dynamodb',\n            'key' => env('AWS_ACCESS_KEY_ID'),\n            'secret' => env('AWS_SECRET_ACCESS_KEY'),\n            'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),\n            'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),\n            'endpoint' => env('DYNAMODB_ENDPOINT'),\n        ],\n\n        'octane' => [\n            'driver' => 'octane',\n        ],\n\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Cache Key Prefix\n    |--------------------------------------------------------------------------\n    |\n    | When utilizing a RAM based store such as APC or Memcached, there might\n    | be other applications utilizing the same cache. So, we'll specify a\n    | value to get prefixed to all our keys so we can avoid collisions.\n    |\n    */\n\n    'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),\n\n];\n", "num_lines": 111}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Cross-Origin Resource Sharing (CORS) Configuration\n    |--------------------------------------------------------------------------\n    |\n    | Here you may configure your settings for cross-origin resource sharing\n    | or \"CORS\". This determines what cross-origin operations may execute\n    | in web browsers. You are free to adjust these settings as needed.\n    |\n    | To learn more: https://developer.mozilla.org/docs/Web/HTTP/CORS\n    |\n    */\n\n    'paths' => ['api/*', 'sanctum/csrf-cookie'],\n\n    'allowed_methods' => ['*'],\n\n    'allowed_origins' => ['*'],\n\n    'allowed_origins_patterns' => [],\n\n    'allowed_headers' => ['*'],\n\n    'exposed_headers' => [],\n\n    'max_age' => 0,\n\n    'supports_credentials' => false,\n\n];\n", "num_lines": 35}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Support\\Str;\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Database Connection Name\n    |--------------------------------------------------------------------------\n    |\n    | Here you may specify which of the database connections below you wish\n    | to use as your default connection for all database work. Of course\n    | you may use many connections at once using the Database library.\n    |\n    */\n\n    'default' => env('DB_CONNECTION', 'mysql'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Database Connections\n    |--------------------------------------------------------------------------\n    |\n    | Here are each of the database connections setup for your application.\n    | Of course, examples of configuring each database platform that is\n    | supported by Laravel is shown below to make development simple.\n    |\n    |\n    | All database work in Laravel is done through the PHP PDO facilities\n    | so make sure you have the driver for your particular database of\n    | choice installed on your machine before you begin development.\n    |\n    */\n\n    'connections' => [\n\n        'sqlite' => [\n            'driver' => 'sqlite',\n            'url' => env('DATABASE_URL'),\n            'database' => env('DB_DATABASE', database_path('database.sqlite')),\n            'prefix' => '',\n            'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),\n        ],\n\n        'mysql' => [\n            'driver' => 'mysql',\n            'url' => env('DATABASE_URL'),\n            'host' => env('DB_HOST', '127.0.0.1'),\n            'port' => env('DB_PORT', '3306'),\n            'database' => env('DB_DATABASE', 'forge'),\n            'username' => env('DB_USERNAME', 'forge'),\n            'password' => env('DB_PASSWORD', ''),\n            'unix_socket' => env('DB_SOCKET', ''),\n            'charset' => 'utf8mb4',\n            'collation' => 'utf8mb4_unicode_ci',\n            'prefix' => '',\n            'prefix_indexes' => true,\n            'strict' => true,\n            'engine' => null,\n            'options' => extension_loaded('pdo_mysql') ? array_filter([\n                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),\n            ]) : [],\n        ],\n\n        'pgsql' => [\n            'driver' => 'pgsql',\n            'url' => env('DATABASE_URL'),\n            'host' => env('DB_HOST', '127.0.0.1'),\n            'port' => env('DB_PORT', '5432'),\n            'database' => env('DB_DATABASE', 'forge'),\n            'username' => env('DB_USERNAME', 'forge'),\n            'password' => env('DB_PASSWORD', ''),\n            'charset' => 'utf8',\n            'prefix' => '',\n            'prefix_indexes' => true,\n            'schema' => 'public',\n            'sslmode' => 'prefer',\n        ],\n\n        'sqlsrv' => [\n            'driver' => 'sqlsrv',\n            'url' => env('DATABASE_URL'),\n            'host' => env('DB_HOST', 'localhost'),\n            'port' => env('DB_PORT', '1433'),\n            'database' => env('DB_DATABASE', 'forge'),\n            'username' => env('DB_USERNAME', 'forge'),\n            'password' => env('DB_PASSWORD', ''),\n            'charset' => 'utf8',\n            'prefix' => '',\n            'prefix_indexes' => true,\n        ],\n\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Migration Repository Table\n    |--------------------------------------------------------------------------\n    |\n    | This table keeps track of all the migrations that have already run for\n    | your application. Using this information, we can determine which of\n    | the migrations on disk haven't actually been run in the database.\n    |\n    */\n\n    'migrations' => 'migrations',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Redis Databases\n    |--------------------------------------------------------------------------\n    |\n    | Redis is an open source, fast, and advanced key-value store that also\n    | provides a richer body of commands than a typical key-value system\n    | such as APC or Memcached. Laravel makes it easy to dig right in.\n    |\n    */\n\n    'redis' => [\n\n        'client' => env('REDIS_CLIENT', 'phpredis'),\n\n        'options' => [\n            'cluster' => env('REDIS_CLUSTER', 'redis'),\n            'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),\n        ],\n\n        'default' => [\n            'url' => env('REDIS_URL'),\n            'host' => env('REDIS_HOST', '127.0.0.1'),\n            'password' => env('REDIS_PASSWORD', null),\n            'port' => env('REDIS_PORT', '6379'),\n            'database' => env('REDIS_DB', '0'),\n        ],\n\n        'cache' => [\n            'url' => env('REDIS_URL'),\n            'host' => env('REDIS_HOST', '127.0.0.1'),\n            'password' => env('REDIS_PASSWORD', null),\n            'port' => env('REDIS_PORT', '6379'),\n            'database' => env('REDIS_CACHE_DB', '1'),\n        ],\n\n    ],\n\n];\n", "num_lines": 148}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Filesystem Disk\n    |--------------------------------------------------------------------------\n    |\n    | Here you may specify the default filesystem disk that should be used\n    | by the framework. The \"local\" disk, as well as a variety of cloud\n    | based disks are available to your application. Just store away!\n    |\n    */\n\n    'default' => env('FILESYSTEM_DRIVER', 'local'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Filesystem Disks\n    |--------------------------------------------------------------------------\n    |\n    | Here you may configure as many filesystem \"disks\" as you wish, and you\n    | may even configure multiple disks of the same driver. Defaults have\n    | been setup for each driver as an example of the required options.\n    |\n    | Supported Drivers: \"local\", \"ftp\", \"sftp\", \"s3\"\n    |\n    */\n\n    'disks' => [\n\n        'local' => [\n            'driver' => 'local',\n            'root' => storage_path('app'),\n        ],\n\n        'public' => [\n            'driver' => 'local',\n            'root' => storage_path('app/public'),\n            'url' => env('APP_URL').'/storage',\n            'visibility' => 'public',\n        ],\n\n        's3' => [\n            'driver' => 's3',\n            'key' => env('AWS_ACCESS_KEY_ID'),\n            'secret' => env('AWS_SECRET_ACCESS_KEY'),\n            'region' => env('AWS_DEFAULT_REGION'),\n            'bucket' => env('AWS_BUCKET'),\n            'url' => env('AWS_URL'),\n            'endpoint' => env('AWS_ENDPOINT'),\n            'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),\n        ],\n\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Symbolic Links\n    |--------------------------------------------------------------------------\n    |\n    | Here you may configure the symbolic links that will be created when the\n    | `storage:link` Artisan command is executed. The array keys should be\n    | the locations of the links and the values should be their targets.\n    |\n    */\n\n    'links' => [\n        public_path('storage') => storage_path('app/public'),\n    ],\n\n];\n", "num_lines": 74}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Hash Driver\n    |--------------------------------------------------------------------------\n    |\n    | This option controls the default hash driver that will be used to hash\n    | passwords for your application. By default, the bcrypt algorithm is\n    | used; however, you remain free to modify this option if you wish.\n    |\n    | Supported: \"bcrypt\", \"argon\", \"argon2id\"\n    |\n    */\n\n    'driver' => 'bcrypt',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Bcrypt Options\n    |--------------------------------------------------------------------------\n    |\n    | Here you may specify the configuration options that should be used when\n    | passwords are hashed using the Bcrypt algorithm. This will allow you\n    | to control the amount of time it takes to hash the given password.\n    |\n    */\n\n    'bcrypt' => [\n        'rounds' => env('BCRYPT_ROUNDS', 10),\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Argon Options\n    |--------------------------------------------------------------------------\n    |\n    | Here you may specify the configuration options that should be used when\n    | passwords are hashed using the Argon algorithm. These will allow you\n    | to control the amount of time it takes to hash the given password.\n    |\n    */\n\n    'argon' => [\n        'memory' => 1024,\n        'threads' => 2,\n        'time' => 2,\n    ],\n\n];\n", "num_lines": 53}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Monolog\\Handler\\NullHandler;\nuse Monolog\\Handler\\StreamHandler;\nuse Monolog\\Handler\\SyslogUdpHandler;\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Log Channel\n    |--------------------------------------------------------------------------\n    |\n    | This option defines the default log channel that gets used when writing\n    | messages to the logs. The name specified in this option should match\n    | one of the channels defined in the \"channels\" configuration array.\n    |\n    */\n\n    'default' => env('LOG_CHANNEL', 'stack'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Deprecations Log Channel\n    |--------------------------------------------------------------------------\n    |\n    | This option controls the log channel that should be used to log warnings\n    | regarding deprecated PHP and library features. This allows you to get\n    | your application ready for upcoming major versions of dependencies.\n    |\n    */\n\n    'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Log Channels\n    |--------------------------------------------------------------------------\n    |\n    | Here you may configure the log channels for your application. Out of\n    | the box, Laravel uses the Monolog PHP logging library. This gives\n    | you a variety of powerful log handlers / formatters to utilize.\n    |\n    | Available Drivers: \"single\", \"daily\", \"slack\", \"syslog\",\n    |                    \"errorlog\", \"monolog\",\n    |                    \"custom\", \"stack\"\n    |\n    */\n\n    'channels' => [\n        'stack' => [\n            'driver' => 'stack',\n            'channels' => ['single'],\n            'ignore_exceptions' => false,\n        ],\n\n        'single' => [\n            'driver' => 'single',\n            'path' => storage_path('logs/laravel.log'),\n            'level' => env('LOG_LEVEL', 'debug'),\n        ],\n\n        'daily' => [\n            'driver' => 'daily',\n            'path' => storage_path('logs/laravel.log'),\n            'level' => env('LOG_LEVEL', 'debug'),\n            'days' => 14,\n        ],\n\n        'slack' => [\n            'driver' => 'slack',\n            'url' => env('LOG_SLACK_WEBHOOK_URL'),\n            'username' => 'Laravel Log',\n            'emoji' => ':boom:',\n            'level' => env('LOG_LEVEL', 'critical'),\n        ],\n\n        'papertrail' => [\n            'driver' => 'monolog',\n            'level' => env('LOG_LEVEL', 'debug'),\n            'handler' => SyslogUdpHandler::class,\n            'handler_with' => [\n                'host' => env('PAPERTRAIL_URL'),\n                'port' => env('PAPERTRAIL_PORT'),\n            ],\n        ],\n\n        'stderr' => [\n            'driver' => 'monolog',\n            'level' => env('LOG_LEVEL', 'debug'),\n            'handler' => StreamHandler::class,\n            'formatter' => env('LOG_STDERR_FORMATTER'),\n            'with' => [\n                'stream' => 'php://stderr',\n            ],\n        ],\n\n        'syslog' => [\n            'driver' => 'syslog',\n            'level' => env('LOG_LEVEL', 'debug'),\n        ],\n\n        'errorlog' => [\n            'driver' => 'errorlog',\n            'level' => env('LOG_LEVEL', 'debug'),\n        ],\n\n        'null' => [\n            'driver' => 'monolog',\n            'handler' => NullHandler::class,\n        ],\n\n        'emergency' => [\n            'path' => storage_path('logs/laravel.log'),\n        ],\n    ],\n\n];\n", "num_lines": 119}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Mailer\n    |--------------------------------------------------------------------------\n    |\n    | This option controls the default mailer that is used to send any email\n    | messages sent by your application. Alternative mailers may be setup\n    | and used as needed; however, this mailer will be used by default.\n    |\n    */\n\n    'default' => env('MAIL_MAILER', 'smtp'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Mailer Configurations\n    |--------------------------------------------------------------------------\n    |\n    | Here you may configure all of the mailers used by your application plus\n    | their respective settings. Several examples have been configured for\n    | you and you are free to add your own as your application requires.\n    |\n    | Laravel supports a variety of mail \"transport\" drivers to be used while\n    | sending an e-mail. You will specify which one you are using for your\n    | mailers below. You are free to add additional mailers as required.\n    |\n    | Supported: \"smtp\", \"sendmail\", \"mailgun\", \"ses\",\n    |            \"postmark\", \"log\", \"array\", \"failover\"\n    |\n    */\n\n    'mailers' => [\n        'smtp' => [\n            'transport' => 'smtp',\n            'host' => env('MAIL_HOST', 'smtp.mailgun.org'),\n            'port' => env('MAIL_PORT', 587),\n            'encryption' => env('MAIL_ENCRYPTION', 'tls'),\n            'username' => env('MAIL_USERNAME'),\n            'password' => env('MAIL_PASSWORD'),\n            'timeout' => null,\n            'auth_mode' => null,\n        ],\n\n        'ses' => [\n            'transport' => 'ses',\n        ],\n\n        'mailgun' => [\n            'transport' => 'mailgun',\n        ],\n\n        'postmark' => [\n            'transport' => 'postmark',\n        ],\n\n        'sendmail' => [\n            'transport' => 'sendmail',\n            'path' => '/usr/sbin/sendmail -bs',\n        ],\n\n        'log' => [\n            'transport' => 'log',\n            'channel' => env('MAIL_LOG_CHANNEL'),\n        ],\n\n        'array' => [\n            'transport' => 'array',\n        ],\n\n        'failover' => [\n            'transport' => 'failover',\n            'mailers' => [\n                'smtp',\n                'log',\n            ],\n        ],\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Global \"From\" Address\n    |--------------------------------------------------------------------------\n    |\n    | You may wish for all e-mails sent by your application to be sent from\n    | the same address. Here, you may specify a name and address that is\n    | used globally for all e-mails that are sent by your application.\n    |\n    */\n\n    'from' => [\n        'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),\n        'name' => env('MAIL_FROM_NAME', 'Example'),\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Markdown Mail Settings\n    |--------------------------------------------------------------------------\n    |\n    | If you are using Markdown based email rendering, you may configure your\n    | theme and component paths here, allowing you to customize the design\n    | of the emails. Or, you may simply stick with the Laravel defaults!\n    |\n    */\n\n    'markdown' => [\n        'theme' => 'default',\n\n        'paths' => [\n            resource_path('views/vendor/mail'),\n        ],\n    ],\n\n];\n", "num_lines": 119}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Queue Connection Name\n    |--------------------------------------------------------------------------\n    |\n    | Laravel's queue API supports an assortment of back-ends via a single\n    | API, giving you convenient access to each back-end using the same\n    | syntax for every one. Here you may define a default connection.\n    |\n    */\n\n    'default' => env('QUEUE_CONNECTION', 'sync'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Queue Connections\n    |--------------------------------------------------------------------------\n    |\n    | Here you may configure the connection information for each server that\n    | is used by your application. A default configuration has been added\n    | for each back-end shipped with Laravel. You are free to add more.\n    |\n    | Drivers: \"sync\", \"database\", \"beanstalkd\", \"sqs\", \"redis\", \"null\"\n    |\n    */\n\n    'connections' => [\n\n        'sync' => [\n            'driver' => 'sync',\n        ],\n\n        'database' => [\n            'driver' => 'database',\n            'table' => 'jobs',\n            'queue' => 'default',\n            'retry_after' => 90,\n            'after_commit' => false,\n        ],\n\n        'beanstalkd' => [\n            'driver' => 'beanstalkd',\n            'host' => 'localhost',\n            'queue' => 'default',\n            'retry_after' => 90,\n            'block_for' => 0,\n            'after_commit' => false,\n        ],\n\n        'sqs' => [\n            'driver' => 'sqs',\n            'key' => env('AWS_ACCESS_KEY_ID'),\n            'secret' => env('AWS_SECRET_ACCESS_KEY'),\n            'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),\n            'queue' => env('SQS_QUEUE', 'default'),\n            'suffix' => env('SQS_SUFFIX'),\n            'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),\n            'after_commit' => false,\n        ],\n\n        'redis' => [\n            'driver' => 'redis',\n            'connection' => 'default',\n            'queue' => env('REDIS_QUEUE', 'default'),\n            'retry_after' => 90,\n            'block_for' => null,\n            'after_commit' => false,\n        ],\n\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Failed Queue Jobs\n    |--------------------------------------------------------------------------\n    |\n    | These options configure the behavior of failed queue job logging so you\n    | can control which database and table are used to store the jobs that\n    | have failed. You may change them to any database / table you wish.\n    |\n    */\n\n    'failed' => [\n        'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),\n        'database' => env('DB_CONNECTION', 'mysql'),\n        'table' => 'failed_jobs',\n    ],\n\n];\n", "num_lines": 94}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Stateful Domains\n    |--------------------------------------------------------------------------\n    |\n    | Requests from the following domains / hosts will receive stateful API\n    | authentication cookies. Typically, these should include your local\n    | and production domains which access your API via a frontend SPA.\n    |\n    */\n\n    'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(\n        '%s%s',\n        'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',\n        env('APP_URL') ? ','.parse_url(env('APP_URL'), PHP_URL_HOST) : ''\n    ))),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Sanctum Guards\n    |--------------------------------------------------------------------------\n    |\n    | This array contains the authentication guards that will be checked when\n    | Sanctum is trying to authenticate a request. If none of these guards\n    | are able to authenticate the request, Sanctum will use the bearer\n    | token that's present on an incoming request for authentication.\n    |\n    */\n\n    'guard' => ['web'],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Expiration Minutes\n    |--------------------------------------------------------------------------\n    |\n    | This value controls the number of minutes until an issued token will be\n    | considered expired. If this value is null, personal access tokens do\n    | not expire. This won't tweak the lifetime of first-party sessions.\n    |\n    */\n\n    'expiration' => null,\n\n    /*\n    |--------------------------------------------------------------------------\n    | Sanctum Middleware\n    |--------------------------------------------------------------------------\n    |\n    | When authenticating your first-party SPA with Sanctum you may need to\n    | customize some of the middleware Sanctum uses while processing the\n    | request. You may change the middleware listed below as required.\n    |\n    */\n\n    'middleware' => [\n        'verify_csrf_token' => App\\Http\\Middleware\\VerifyCsrfToken::class,\n        'encrypt_cookies' => App\\Http\\Middleware\\EncryptCookies::class,\n    ],\n\n];\n", "num_lines": 66}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Third Party Services\n    |--------------------------------------------------------------------------\n    |\n    | This file is for storing the credentials for third party services such\n    | as Mailgun, Postmark, AWS and more. This file provides the de facto\n    | location for this type of information, allowing packages to have\n    | a conventional file to locate the various service credentials.\n    |\n    */\n\n    'mailgun' => [\n        'domain' => env('MAILGUN_DOMAIN'),\n        'secret' => env('MAILGUN_SECRET'),\n        'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),\n    ],\n\n    'postmark' => [\n        'token' => env('POSTMARK_TOKEN'),\n    ],\n\n    'ses' => [\n        'key' => env('AWS_ACCESS_KEY_ID'),\n        'secret' => env('AWS_SECRET_ACCESS_KEY'),\n        'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),\n    ],\n\n];\n", "num_lines": 34}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Support\\Str;\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Session Driver\n    |--------------------------------------------------------------------------\n    |\n    | This option controls the default session \"driver\" that will be used on\n    | requests. By default, we will use the lightweight native driver but\n    | you may specify any of the other wonderful drivers provided here.\n    |\n    | Supported: \"file\", \"cookie\", \"database\", \"apc\",\n    |            \"memcached\", \"redis\", \"dynamodb\", \"array\"\n    |\n    */\n\n    'driver' => env('SESSION_DRIVER', 'cookie'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Lifetime\n    |--------------------------------------------------------------------------\n    |\n    | Here you may specify the number of minutes that you wish the session\n    | to be allowed to remain idle before it expires. If you want them\n    | to immediately expire on the browser closing, set that option.\n    |\n    */\n\n    'lifetime' => env('SESSION_LIFETIME', 120),\n\n    'expire_on_close' => false,\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Encryption\n    |--------------------------------------------------------------------------\n    |\n    | This option allows you to easily specify that all of your session data\n    | should be encrypted before it is stored. All encryption will be run\n    | automatically by Laravel and you can use the Session like normal.\n    |\n    */\n\n    'encrypt' => false,\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session File Location\n    |--------------------------------------------------------------------------\n    |\n    | When using the native session driver, we need a location where session\n    | files may be stored. A default has been set for you but a different\n    | location may be specified. This is only needed for file sessions.\n    |\n    */\n\n    'files' => storage_path('framework/sessions'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Database Connection\n    |--------------------------------------------------------------------------\n    |\n    | When using the \"database\" or \"redis\" session drivers, you may specify a\n    | connection that should be used to manage these sessions. This should\n    | correspond to a connection in your database configuration options.\n    |\n    */\n\n    'connection' => env('SESSION_CONNECTION', null),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Database Table\n    |--------------------------------------------------------------------------\n    |\n    | When using the \"database\" session driver, you may specify the table we\n    | should use to manage the sessions. Of course, a sensible default is\n    | provided for you; however, you are free to change this as needed.\n    |\n    */\n\n    'table' => 'sessions',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Cache Store\n    |--------------------------------------------------------------------------\n    |\n    | While using one of the framework's cache driven session backends you may\n    | list a cache store that should be used for these sessions. This value\n    | must match with one of the application's configured cache \"stores\".\n    |\n    | Affects: \"apc\", \"dynamodb\", \"memcached\", \"redis\"\n    |\n    */\n\n    'store' => env('SESSION_STORE', null),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Sweeping Lottery\n    |--------------------------------------------------------------------------\n    |\n    | Some session drivers must manually sweep their storage location to get\n    | rid of old sessions from storage. Here are the chances that it will\n    | happen on a given request. By default, the odds are 2 out of 100.\n    |\n    */\n\n    'lottery' => [2, 100],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Cookie Name\n    |--------------------------------------------------------------------------\n    |\n    | Here you may change the name of the cookie used to identify a session\n    | instance by ID. The name specified here will get used every time a\n    | new session cookie is created by the framework for every driver.\n    |\n    */\n\n    'cookie' => env(\n        'SESSION_COOKIE',\n        Str::slug(env('APP_NAME', 'laravel'), '_').'_session'\n    ),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Cookie Path\n    |--------------------------------------------------------------------------\n    |\n    | The session cookie path determines the path for which the cookie will\n    | be regarded as available. Typically, this will be the root path of\n    | your application but you are free to change this when necessary.\n    |\n    */\n\n    'path' => '/',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Session Cookie Domain\n    |--------------------------------------------------------------------------\n    |\n    | Here you may change the domain of the cookie used to identify a session\n    | in your application. This will determine which domains the cookie is\n    | available to in your application. A sensible default has been set.\n    |\n    */\n\n    'domain' => env('SESSION_DOMAIN', null),\n\n    /*\n    |--------------------------------------------------------------------------\n    | HTTPS Only Cookies\n    |--------------------------------------------------------------------------\n    |\n    | By setting this option to true, session cookies will only be sent back\n    | to the server if the browser has a HTTPS connection. This will keep\n    | the cookie from being sent to you when it can't be done securely.\n    |\n    */\n\n    'secure' => env('SESSION_SECURE_COOKIE', false),\n\n    /*\n    |--------------------------------------------------------------------------\n    | HTTP Access Only\n    |--------------------------------------------------------------------------\n    |\n    | Setting this value to true will prevent JavaScript from accessing the\n    | value of the cookie and the cookie will only be accessible through\n    | the HTTP protocol. You are free to modify this option if needed.\n    |\n    */\n\n    'http_only' => true,\n\n    /*\n    |--------------------------------------------------------------------------\n    | Same-Site Cookies\n    |--------------------------------------------------------------------------\n    |\n    | This option determines how your cookies behave when cross-site requests\n    | take place, and can be used to mitigate CSRF attacks. By default, we\n    | will set this value to \"lax\" since this is a secure default value.\n    |\n    | Supported: \"lax\", \"strict\", \"none\", null\n    |\n    */\n\n    'same_site' => 'lax',\n\n];\n", "num_lines": 202}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | View Storage Paths\n    |--------------------------------------------------------------------------\n    |\n    | Most templating systems load templates from disk. Here you may specify\n    | an array of paths that should be checked for your views. Of course\n    | the usual Laravel view path has already been registered for you.\n    |\n    */\n\n    'paths' => [\n        resource_path('views'),\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Compiled View Path\n    |--------------------------------------------------------------------------\n    |\n    | This option determines where all the compiled Blade templates will be\n    | stored for your application. Typically, this is within the storage\n    | directory. However, as usual, you are free to change this value.\n    |\n    */\n\n    'compiled' => env(\n        'VIEW_COMPILED_PATH',\n        realpath(storage_path('framework/views'))\n    ),\n\n];\n", "num_lines": 37}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Database\\Factories;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\Factory;\nuse Illuminate\\Support\\Str;\n\nclass UserFactory extends Factory\n{\n    /**\n     * Define the model's default state.\n     *\n     * @return array\n     */\n    public function definition()\n    {\n        return [\n            'name' => $this->faker->name(),\n            'email' => $this->faker->unique()->safeEmail(),\n            'email_verified_at' => now(),\n            'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password\n            'remember_token' => Str::random(10),\n        ];\n    }\n\n    /**\n     * Indicate that the model's email address should be unverified.\n     *\n     * @return \\Illuminate\\Database\\Eloquent\\Factories\\Factory\n     */\n    public function unverified()\n    {\n        return $this->state(function (array $attributes) {\n            return [\n                'email_verified_at' => null,\n            ];\n        });\n    }\n}\n", "num_lines": 40}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreateUserTable extends Migration\n{\n\t/**\n\t * Run the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function up()\n\t{\n\t\tSchema::create('users', function (Blueprint $table) {\n\t\t\t$table->id();\n\t\t\t$table->string('name', 64);\n\t\t\t$table->string('address', 256);\n\t\t\t$table->string('email', 128);\n\t\t\t$table->string('password', 128);\n\t\t\t$table->engine = 'InnoDB';\n\t\t\t$table->charset = 'utf8';\n\t\t\t$table->collation = 'utf8_general_ci';\n\t\t});\n\t}\n\n\t/**\n\t * Reverse the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function down()\n\t{\n\t\tSchema::dropIfExists('users');\n\t}\n}\n", "num_lines": 38}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreateCategoryTable extends Migration\n{\n\t/**\n\t * Run the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function up()\n\t{\n\t\tSchema::create('categories', function (Blueprint $table) {\n\t\t\t$table->id();\n\t\t\t$table->string('name', 32);\n\t\t\t$table->string('url', 32);\n\t\t\t$table->string('img', 128);\n\t\t\t$table->engine = 'InnoDB';\n\t\t\t$table->charset = 'utf8';\n\t\t\t$table->collation = 'utf8_general_ci';\n\t\t});\n\t}\n\n\t/**\n\t * Reverse the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function down()\n\t{\n\t\tSchema::dropIfExists('categories');\n\t}\n}\n", "num_lines": 37}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreateItemTable extends Migration\n{\n\t/**\n\t * Run the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function up()\n\t{\n\t\tSchema::create('items', function (Blueprint $table) {\n\t\t\t$table->id();\n\t\t\t$table->bigInteger('category_id')->unsigned();\n\t\t\t$table->string('name', 32);\n\t\t\t$table->string('img', 128);\n\t\t\t$table->decimal('price', $precision = 6, $scale = 2);\n\t\t\t$table->unsignedSmallInteger('cooktime');\n\t\t\t$table->text('desc');\n\t\t\t$table->engine = 'InnoDB';\n\t\t\t$table->charset = 'utf8';\n\t\t\t$table->collation = 'utf8_general_ci';\n\t\t});\n\t\tSchema::table('items', function (Blueprint $table) {\n\t\t\t$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');\n\t\t});\n\t}\n\n\t/**\n\t * Reverse the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function down()\n\t{\n\t\tSchema::dropIfExists('items');\n\t}\n}\n", "num_lines": 43}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreateCartTable extends Migration\n{\n\t/**\n\t * Run the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function up()\n\t{\n\t\tSchema::create('carts', function (Blueprint $table) {\n\t\t\t$table->id();\n\t\t\t$table->bigInteger('user_id')->unsigned();\n\t\t\t$table->string('status', 16);\n\t\t\t$table->engine = 'InnoDB';\n\t\t\t$table->charset = 'utf8';\n\t\t\t$table->collation = 'utf8_general_ci';\n\t\t});\n\t\tSchema::table('carts', function (Blueprint $table) {\n\t\t\t$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');\n\t\t});\n\t}\n\n\t/**\n\t * Reverse the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function down()\n\t{\n\t\tSchema::dropIfExists('carts');\n\t}\n}\n", "num_lines": 39}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreateOrderTable extends Migration\n{\n\t/**\n\t * Run the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function up()\n\t{\n\t\tSchema::create('orders', function (Blueprint $table) {\n\t\t\t$table->id();\n\t\t\t$table->bigInteger('user_id')->unsigned();\n\t\t\t$table->bigInteger('cart_id')->unsigned();\n\t\t\t$table->string('name', 64);\n\t\t\t$table->string('address', 256);\n\t\t\t$table->text('special_instructions')->nullable();\n\t\t\t$table->unsignedSmallInteger('cooktime');\n\t\t\t$table->timestamps();\n\t\t\t$table->engine = 'InnoDB';\n\t\t\t$table->charset = 'utf8';\n\t\t\t$table->collation = 'utf8_general_ci';\n\t\t});\n\t\tSchema::table('orders', function (Blueprint $table) {\n\t\t\t$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');\n\t\t\t$table->foreign('cart_id')->references('id')->on('carts')->onDelete('cascade');\n\t\t});\n\t}\n\n\t/**\n\t * Reverse the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function down()\n\t{\n\t\tSchema::dropIfExists('orders');\n\t}\n}\n", "num_lines": 45}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreateCartItemsTable extends Migration\n{\n\t/**\n\t * Run the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function up()\n\t{\n\t\tSchema::create('cart_items', function (Blueprint $table) {\n\t\t\t$table->id();\n\t\t\t$table->bigInteger('cart_id')->unsigned();\n\t\t\t$table->bigInteger('item_id')->unsigned();\n\t\t\t$table->unsignedSmallInteger('qty');\n\t\t\t$table->engine = 'InnoDB';\n\t\t\t$table->charset = 'utf8';\n\t\t\t$table->collation = 'utf8_general_ci';\n\t\t});\n\t\tSchema::table('cart_items', function (Blueprint $table) {\n\t\t\t$table->foreign('cart_id')->references('id')->on('carts')->onDelete('cascade');\n\t\t\t$table->foreign('item_id')->references('id')->on('items')->onDelete('cascade');\n\t\t});\n\t}\n\n\t/**\n\t * Reverse the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function down()\n\t{\n\t\tSchema::dropIfExists('cart_items');\n\t}\n}\n", "num_lines": 41}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Database\\Seeders;\n\nuse Illuminate\\Database\\Seeder;\nuse Illuminate\\Support\\Facades\\DB;\n\nuse App\\Models\\Category;\n\nclass CategorySeeder extends Seeder\n{\n\t/**\n\t * Run the database seeds.\n\t *\n\t * @return void\n\t */\n\tpublic function run()\n\t{\n\t\t// DB::table('categories')->truncate();\n\t\tCategory::query()->delete();\n\t\tDB::statement(\"ALTER TABLE `categories` AUTO_INCREMENT = 1\");\n\n\t\t$categories = [\n\t\t\t[\n\t\t\t\t'name' => 'Breakfast',\n\t\t\t\t'url' => 'breakfast',\n\t\t\t\t'img' => 'potatoes-g792cf4128_1920.jpg',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Steak',\n\t\t\t\t'url' => 'steak',\n\t\t\t\t'img' => 'tomahawk-ge5ea2413d_1920.jpg',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Pizza',\n\t\t\t\t'url' => 'pizza',\n\t\t\t\t'img' => 'pizza-g204a8b3d6_1920.jpg',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Burgers',\n\t\t\t\t'url' => 'burgers',\n\t\t\t\t'img' => 'hamburger-g685f013b8_1920.jpg',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Sushi',\n\t\t\t\t'url' => 'sushi',\n\t\t\t\t'img' => 'food-g3eb975adc_1920.jpg',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Salads',\n\t\t\t\t'url' => 'salads',\n\t\t\t\t'img' => 'salad-g3f02f56a0_1920.jpg',\n\t\t\t],\n\t\t];\n\t\tCategory::insert($categories);\n\t}\n}\n", "num_lines": 58}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Database\\Seeders;\n\nuse Illuminate\\Database\\Seeder;\n\nclass DatabaseSeeder extends Seeder\n{\n\t/**\n\t * Seed the application's database.\n\t *\n\t * @return void\n\t */\n\tpublic function run()\n\t{\n\t\t// \\App\\Models\\User::factory(10)->create();\n\t\t$this->call([\n\t\t\tCategorySeeder::class,\n\t\t\tItemSeeder::class,\n\t\t\tUserSeeder::class,\n\t\t]);\n\t}\n}\n", "num_lines": 24}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Database\\Seeders;\n\nuse Illuminate\\Database\\Seeder;\nuse Illuminate\\Support\\Facades\\DB;\n\nuse App\\Models\\Item;\n\nclass ItemSeeder extends Seeder\n{\n\t/**\n\t * Run the database seeds.\n\t *\n\t * @return void\n\t */\n\tpublic function run()\n\t{\n\t\t// DB::table('items')->truncate();\n\t\tItem::query()->delete();\n\t\tDB::statement(\"ALTER TABLE `items` AUTO_INCREMENT = 1\");\n\n\t\t$items = [\n\t\t\t// breakfast\n\t\t\t[\n\t\t\t\t'category_id' => 1,\n\t\t\t\t'name' => 'Cinnamon Roll',\n\t\t\t\t'img' => 'cinnamon-rolls-gb12ce8577_1920.jpg',\n\t\t\t\t'price' => '1.19',\n\t\t\t\t'cooktime' => 13,\n\t\t\t\t'desc' => 'Cupcake ipsum dolor sit amet drag\u00c3\u00a9e topping topping. Powder cheesecake cake shortbread gummies lollipop jelly carrot cake. Pudding sugar plum carrot cake I love muffin. Dessert topping croissant I love tart souffl\u00c3\u00a9 cheesecake sweet sweet. Liquorice pie marshmallow icing topping muffin. Topping brownie oat cake carrot cake donut chocolate bar cake. Bear claw jelly-o ice cream lollipop shortbread dessert jujubes macaroon. I love danish tootsie roll powder candy canes marzipan icing gingerbread chocolate bar.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 1,\n\t\t\t\t'name' => 'Toast & Eggs',\n\t\t\t\t'img' => 'breakfast-g7a2675ee6_1920.jpg',\n\t\t\t\t'price' => '2.19',\n\t\t\t\t'cooktime' => 7,\n\t\t\t\t'desc' => 'Tiramisu muffin sweet roll cotton candy icing bonbon jelly. Tiramisu oat cake shortbread toffee bonbon shortbread candy canes toffee. Sweet roll biscuit I love oat cake gummies bonbon biscuit danish lemon drops. Toffee ice cream jelly beans caramels muffin. Tart jujubes chocolate bar marshmallow gingerbread I love pie. Chocolate I love chocolate cake cake liquorice lollipop. Tiramisu chocolate jelly-o muffin halvah. Shortbread souffl\u00c3\u00a9 ice cream oat cake cotton candy sesame snaps liquorice. Danish marzipan I love jelly brownie muffin halvah candy canes.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 1,\n\t\t\t\t'name' => 'Croissant',\n\t\t\t\t'img' => 'croissant-ga61b1fb0e_1920.jpg',\n\t\t\t\t'price' => '3.19',\n\t\t\t\t'cooktime' => 2,\n\t\t\t\t'desc' => 'I love chocolate cake I love I love jelly beans cotton candy jelly-o ice cream. Icing cotton candy sweet roll fruitcake biscuit apple pie. Gummies chocolate caramels biscuit I love I love I love cookie croissant. Topping apple pie wafer sesame snaps tootsie roll gummies. Apple pie I love wafer sweet roll tootsie roll. Cheesecake I love apple pie muffin tiramisu lemon drops cake. Macaroon caramels chocolate cotton candy souffl\u00c3\u00a9 tart. Chupa chups lemon drops cupcake topping pastry.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 1,\n\t\t\t\t'name' => 'Bacon & Eggs',\n\t\t\t\t'img' => 'eggs-g9c07e92b1_1920.jpg',\n\t\t\t\t'price' => '4.19',\n\t\t\t\t'cooktime' => 14,\n\t\t\t\t'desc' => 'Toffee sesame snaps chupa chups pie pastry marshmallow I love tootsie roll souffl\u00c3\u00a9. Marshmallow fruitcake cheesecake I love icing cake. Liquorice toffee chocolate bar marzipan cotton candy croissant powder. Bonbon I love danish bear claw tootsie roll. Candy canes wafer fruitcake caramels lollipop tart. Oat cake croissant tart gummi bears cookie muffin. Icing sweet roll chupa chups chupa chups jelly-o brownie. Jelly-o cotton candy liquorice tiramisu halvah jujubes.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 1,\n\t\t\t\t'name' => 'Pancakes',\n\t\t\t\t'img' => 'pancakes-g9d341228a_1920.jpg',\n\t\t\t\t'price' => '5.19',\n\t\t\t\t'cooktime' => 12,\n\t\t\t\t'desc' => 'Chocolate caramels gingerbread drag\u00c3\u00a9e gingerbread brownie powder gummi bears pastry. Sugar plum sugar plum tootsie roll shortbread I love cotton candy. Chocolate cake chocolate bonbon cake biscuit. Toffee cheesecake I love cookie cake marzipan I love chocolate cake liquorice. Biscuit biscuit caramels macaroon lollipop powder tootsie roll. Shortbread jelly-o jujubes jelly-o chocolate carrot cake danish croissant. Biscuit jelly-o donut bonbon muffin carrot cake sesame snaps wafer chupa chups. Chupa chups chocolate bar bonbon I love jelly beans lemon drops macaroon muffin. Chocolate cake cookie jelly-o cake cake croissant muffin halvah candy. Apple pie icing pudding chupa chups macaroon I love biscuit fruitcake I love.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 1,\n\t\t\t\t'name' => 'Biscuits & Gravy',\n\t\t\t\t'img' => 'biscuits-g07bd069f8_1920.jpg',\n\t\t\t\t'price' => '6.19',\n\t\t\t\t'cooktime' => 6,\n\t\t\t\t'desc' => 'Souffl\u00c3\u00a9 marshmallow I love candy canes I love apple pie. Icing wafer I love toffee carrot cake cookie candy canes bear claw pastry. Lollipop topping pudding dessert powder jujubes sesame snaps bonbon apple pie. Macaroon tootsie roll dessert cake I love wafer macaroon sweet roll sesame snaps. Wafer cupcake bear claw sweet brownie I love. Pastry I love muffin marzipan I love topping. Pie candy muffin jelly-o croissant cake sweet. Wafer chocolate lemon drops jujubes lollipop drag\u00c3\u00a9e I love jelly. I love macaroon I love powder tootsie roll jelly muffin wafer.',\n\t\t\t],\n\t\t\t// steak\n\t\t\t[\n\t\t\t\t'category_id' => 2,\n\t\t\t\t'name' => 'Tomahawk',\n\t\t\t\t'img' => 'steak-4342500_1920.jpg',\n\t\t\t\t'price' => '1.29',\n\t\t\t\t'cooktime' => 27,\n\t\t\t\t'desc' => 'Bacon ipsum dolor amet shank picanha landjaeger kevin, ham hock spare ribs sausage capicola buffalo alcatra. Short loin spare ribs alcatra bresaola. Salami tongue drumstick tenderloin flank alcatra shank sirloin biltong landjaeger short ribs jerky. Porchetta meatloaf fatback frankfurter bacon tail, ham biltong kielbasa short ribs pork capicola leberkas jowl. Chicken tenderloin kielbasa pork belly, ham hock jowl bacon salami chuck burgdoggen hamburger tongue short loin biltong. Frankfurter sirloin meatloaf ribeye.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 2,\n\t\t\t\t'name' => 'Sirloin',\n\t\t\t\t'img' => 'steak-1076665_1920.jpg',\n\t\t\t\t'price' => '2.29',\n\t\t\t\t'cooktime' => 22,\n\t\t\t\t'desc' => 'Meatball fatback pastrami, porchetta doner chicken burgdoggen pancetta jerky beef ribs salami. Buffalo ball tip tenderloin chuck, frankfurter alcatra ribeye t-bone spare ribs. Hamburger pork chop swine, picanha flank corned beef burgdoggen shoulder frankfurter ham ball tip. Chicken biltong short ribs short loin spare ribs. Pork loin jerky pork chop, fatback frankfurter filet mignon turducken kevin swine. Prosciutto kielbasa short ribs shoulder frankfurter hamburger. Swine leberkas alcatra jerky, ball tip pastrami meatloaf pork belly doner venison turkey buffalo ham hock pig.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 2,\n\t\t\t\t'name' => 'T-Bone',\n\t\t\t\t'img' => 'steak-978654_1920.jpg',\n\t\t\t\t'price' => '3.29',\n\t\t\t\t'cooktime' => 23,\n\t\t\t\t'desc' => 'Swine doner leberkas tri-tip pork loin hamburger cupim alcatra spare ribs kielbasa bacon. Shoulder tail alcatra meatloaf beef hamburger, short loin tri-tip cupim ham pork chop. Corned beef kevin strip steak tri-tip. Landjaeger meatball chuck biltong salami fatback jerky pastrami shank beef. Frankfurter ground round strip steak pork chop shoulder, picanha pig doner prosciutto chislic ham. Ham hock alcatra shankle chislic rump landjaeger brisket pork leberkas t-bone meatloaf pancetta pork loin.',\n\t\t\t],\n\t\t\t// pizza\n\t\t\t[\n\t\t\t\t'category_id' => 3,\n\t\t\t\t'name' => 'Pepperoni',\n\t\t\t\t'img' => 'pizza-1344720_1920.jpg',\n\t\t\t\t'price' => '1.39',\n\t\t\t\t'cooktime' => 12,\n\t\t\t\t'desc' => 'Gouda mozzarella babybel. Jarlsberg emmental who moved my cheese cauliflower cheese brie cheesy feet airedale swiss. Port-salut bocconcini monterey jack squirty cheese cut the cheese say cheese cauliflower cheese lancashire. Who moved my cheese who moved my cheese taleggio cheesy feet cheeseburger hard cheese emmental.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 3,\n\t\t\t\t'name' => 'Margherita',\n\t\t\t\t'img' => 'pizza-3000274_1920.jpg',\n\t\t\t\t'price' => '2.39',\n\t\t\t\t'cooktime' => 6,\n\t\t\t\t'desc' => 'I love cheese, especially who moved my cheese fondue. Parmesan cheese slices the big cheese cheese strings jarlsberg fromage ricotta red leicester. Queso everyone loves cheesecake everyone loves who moved my cheese red leicester fondue smelly cheese. Mozzarella goat blue castello swiss cheese slices hard cheese swiss cow. Cream cheese swiss.',\n\t\t\t],\n\t\t\t// burgers\n\t\t\t[\n\t\t\t\t'category_id' => 4,\n\t\t\t\t'name' => 'Sliders',\n\t\t\t\t'img' => 'hamburger-494706_1920.jpg',\n\t\t\t\t'price' => '1.49',\n\t\t\t\t'cooktime' => 9,\n\t\t\t\t'desc' => 'Ribeye ball tip kevin tri-tip beef biltong. Pastrami pork belly burgdoggen, sirloin bresaola andouille flank fatback short ribs chuck shoulder tongue boudin strip steak. Bacon pancetta biltong kielbasa, cow shank sausage rump chuck spare ribs alcatra ground round meatball chicken strip steak. Sirloin andouille pig ham hock swine kielbasa salami tongue meatball cupim jowl. Cow fatback drumstick picanha ball tip. Meatloaf venison shankle rump, tail tenderloin short ribs.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 4,\n\t\t\t\t'name' => 'Charbroiled',\n\t\t\t\t'img' => 'hamburger-1238246_1920.jpg',\n\t\t\t\t'price' => '2.49',\n\t\t\t\t'cooktime' => 17,\n\t\t\t\t'desc' => 'Kielbasa boudin alcatra, beef ribs spare ribs rump pork belly pork chop salami ribeye pancetta. Alcatra picanha ground round, frankfurter short loin porchetta leberkas venison cow fatback landjaeger rump boudin. Flank t-bone kielbasa burgdoggen short ribs landjaeger tenderloin ham hock pastrami. Burgdoggen turducken landjaeger, short ribs frankfurter tail brisket chuck shoulder buffalo sausage doner rump. Swine ground round ribeye ham hock tongue turducken sirloin, burgdoggen sausage shank t-bone cupim.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 4,\n\t\t\t\t'name' => 'Diner Burger',\n\t\t\t\t'img' => 'burger-3442227_1920.jpg',\n\t\t\t\t'price' => '3.49',\n\t\t\t\t'cooktime' => 12,\n\t\t\t\t'desc' => 'Fatback drumstick filet mignon, frankfurter chicken pork meatloaf pork belly venison jerky beef pork loin ham hock biltong. Pork chop ham andouille ground round hamburger. Beef ribs ground round cow pig biltong short ribs sirloin spare ribs. Fatback pork chop cow filet mignon burgdoggen doner picanha swine tongue, tail corned beef meatball pancetta pork.',\n\t\t\t],\n\t\t\t// sushi\n\t\t\t[\n\t\t\t\t'category_id' => 5,\n\t\t\t\t'name' => 'Sashimi Fresh Roll',\n\t\t\t\t'img' => 'sushi-354628_1920.jpg',\n\t\t\t\t'price' => '1.59',\n\t\t\t\t'cooktime' => 3,\n\t\t\t\t'desc' => 'Barbelless catfish eel-goby spiny eel yellowtail snapper mullet minnow white marlin northern pike bigeye? Sauger sandroller; hoki sixgill ray squawfish sailfin silverside. Olive flounder giant danio herring smelt tailor Australasian salmon barbeled houndshark southern grayling porbeagle shark roundhead.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 5,\n\t\t\t\t'name' => 'Power Fish',\n\t\t\t\t'img' => 'sushi-2853382_1920.jpg',\n\t\t\t\t'price' => '2.59',\n\t\t\t\t'cooktime' => 5,\n\t\t\t\t'desc' => 'Atlantic silverside jewfish shovelnose sturgeon huchen temperate ocean-bass mullet menhaden stargazer yellowtail orangestriped triggerfish bluefin tuna. Arapaima plunderfish arapaima, mudskipper, earthworm eel snubnose eel Pacific viperfish tripletail.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 5,\n\t\t\t\t'name' => 'Spicy Tuna',\n\t\t\t\t'img' => 'sushi-599721_1920.jpg',\n\t\t\t\t'price' => '3.59',\n\t\t\t\t'cooktime' => 7,\n\t\t\t\t'desc' => 'Elephantnose fish bango longjaw mudsucker; sand stargazer? Dragonet: kissing gourami tench demoiselle; bullhead shark lookdown catfish halibut tubeblenny southern flounder, hairtail gray reef shark. Long-whiskered catfish lake whitefish, worm eel Ratfish European minnow! Javelin temperate perch sandroller waryfish pikehead gouramie longnose dace starry flounder medusafish cusk-eel.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 5,\n\t\t\t\t'name' => 'Avocado Roll',\n\t\t\t\t'img' => 'maki-716432_1920.jpg',\n\t\t\t\t'price' => '4.59',\n\t\t\t\t'cooktime' => 2,\n\t\t\t\t'desc' => 'Wormfish, glowlight danio Atlantic cod ide flagblenny, ribbon sawtail fish Kafue pike southern grayling. Speckled trout grayling ling nurseryfish threadfin. Snake eel char sturgeon scissor-tail rasbora blue eye worm eel southern smelt. Salmon jellynose fish, buffalofish lanternfish kaluga duckbill eel. Swampfish halosaur flashlight fish wahoo popeye catafula pirarucu; torpedo; rock beauty longnose chimaera elver thornfish, rough scad! Pipefish tompot blenny Kafue pike large-eye bream elasmobranch northern lampfish soapfish rocket danio mudskipper smalltooth sawfish.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 5,\n\t\t\t\t'name' => 'Sampler Plate',\n\t\t\t\t'img' => 'sushi-2856545_1920.jpg',\n\t\t\t\t'price' => '5.59',\n\t\t\t\t'cooktime' => 4,\n\t\t\t\t'desc' => 'Poolfish waryfish frilled shark louvar, wasp fish blue catfish Molly Miller Black scalyfin gizzard shad, platyfish, common carp. Tiger shark roanoke bass milkfish yellowhead jawfish, round stingray sea bass surfperch treefish Asiatic glassfish. Silver carp scissor-tail rasbora pompano dolphinfish: frogmouth catfish mackerel shark. Perch hardhead catfish sand stargazer: goosefish wolf-herring.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 5,\n\t\t\t\t'name' => 'Veggie Roll',\n\t\t\t\t'img' => 'sushi-2020287_1920.jpg',\n\t\t\t\t'price' => '6.59',\n\t\t\t\t'cooktime' => 2,\n\t\t\t\t'desc' => 'Stingray, tarpon; clown triggerfish plaice pleco wrasse Pacific herring kuhli loach rough scad, burma danio. River stingray weasel shark popeye catafula Australian grayling remora flying gurnard smalltooth sawfish, dwarf loach pike conger. Thornyhead megamouth shark pencilfish blacktip reef shark Atlantic silverside Black pickerel, electric eel spiderfish bass electric catfish? Peamouth tetra lightfish midshipman monkfish spearfish burrowing goby trahira, collared dogfish yellow weaver driftfish, dorab roosterfish, sea bream.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 5,\n\t\t\t\t'name' => 'Maki',\n\t\t\t\t'img' => 'sushi-748139_1920.jpg',\n\t\t\t\t'price' => '7.59',\n\t\t\t\t'cooktime' => 5,\n\t\t\t\t'desc' => 'Angler, swampfish orangestriped triggerfish oceanic flyingfish northern anchovy smooth dogfish. Bigscale pomfret stonefish pollyfish warmouth; round herring banded killifish. Walking catfish, weever cod: Antarctic icefish slimy sculpin.',\n\t\t\t],\n\t\t\t// salads\n\t\t\t[\n\t\t\t\t'category_id' => 6,\n\t\t\t\t'name' => 'Bowl of Lettuce',\n\t\t\t\t'img' => 'food-1834645_1920.jpg',\n\t\t\t\t'price' => '1.69',\n\t\t\t\t'cooktime' => 1,\n\t\t\t\t'desc' => 'Carrot grape soko wakame plantain pea broccoli rabe desert raisin. Chard cabbage cress gumbo spinach mung bean turnip greens rock melon chicory collard greens bok choy. Wattle seed wakame eggplant soybean quandong garlic prairie turnip swiss chard radish okra.',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'category_id' => 6,\n\t\t\t\t'name' => 'Plate of Lettuce',\n\t\t\t\t'img' => 'salad-2150548_1920.jpg',\n\t\t\t\t'price' => '2.69',\n\t\t\t\t'cooktime' => 1,\n\t\t\t\t'desc' => 'Nori grape silver beet broccoli kombu beet greens fava bean potato quandong celery. Bunya nuts black-eyed pea prairie turnip leek lentil turnip greens parsnip. Sea lettuce lettuce water chestnut eggplant winter purslane fennel azuki bean earthnut pea sierra leone bologi leek soko chicory celtuce parsley j\u00c3\u00adcama salsify.',\n\t\t\t],\n\t\t];\n\t\tItem::insert($items);\n\t}\n}\n", "num_lines": 218}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Database\\Seeders;\n\nuse Illuminate\\Database\\Seeder;\nuse Illuminate\\Support\\Facades\\DB;\nuse Illuminate\\Support\\Facades\\Hash;\n\nuse App\\Models\\User;\n\nclass UserSeeder extends Seeder\n{\n\t/**\n\t * Run the database seeds.\n\t *\n\t * @return void\n\t */\n\tpublic function run()\n\t{\n\t\t// DB::table('users')->truncate();\n\t\tUser::query()->delete();\n\t\tDB::statement(\"ALTER TABLE `users` AUTO_INCREMENT = 1\");\n\n\t\t$users = [\n\t\t\t[\n\t\t\t\t'name' => 'Jon Yang',\n\t\t\t\t'address' => '3761 N. 14th St',\n\t\t\t\t'email' => 'jon24@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Eugene Huang',\n\t\t\t\t'address' => '2243 W St.',\n\t\t\t\t'email' => 'eugene10@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ruben Torres',\n\t\t\t\t'address' => '5844 Linden Land',\n\t\t\t\t'email' => 'ruben35@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Christy Zhu',\n\t\t\t\t'address' => '1825 Village Pl.',\n\t\t\t\t'email' => 'christy12@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Elizabeth Johnson',\n\t\t\t\t'address' => '7553 Harness Circle',\n\t\t\t\t'email' => 'elizabeth5@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Julio Ruiz',\n\t\t\t\t'address' => '7305 Humphrey Drive',\n\t\t\t\t'email' => 'julio1@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Janet Alvarez',\n\t\t\t\t'address' => '2612 Berry Dr',\n\t\t\t\t'email' => 'janet9@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Marco Mehta',\n\t\t\t\t'address' => '942 Brook Street',\n\t\t\t\t'email' => 'marco14@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Rob Verhoff',\n\t\t\t\t'address' => '624 Peabody Road',\n\t\t\t\t'email' => 'rob4@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Shannon Carlson',\n\t\t\t\t'address' => '3839 Northgate Road',\n\t\t\t\t'email' => 'shannon38@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jacquelyn Suarez',\n\t\t\t\t'address' => '7800 Corrinne Court',\n\t\t\t\t'email' => 'jacquelyn20@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Curtis Lu',\n\t\t\t\t'address' => '1224 Shoenic',\n\t\t\t\t'email' => 'curtis9@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Lauren Walker',\n\t\t\t\t'address' => '4785 Scott Street',\n\t\t\t\t'email' => 'lauren41@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ian Jenkins',\n\t\t\t\t'address' => '7902 Hudson Ave.',\n\t\t\t\t'email' => 'ian47@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Sydney Bennett',\n\t\t\t\t'address' => '9011 Tank Drive',\n\t\t\t\t'email' => 'sydney23@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Chloe Young',\n\t\t\t\t'address' => '244 Willow Pass Road',\n\t\t\t\t'email' => 'chloe23@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Wyatt Hill',\n\t\t\t\t'address' => '9666 Northridge Ct.',\n\t\t\t\t'email' => 'wyatt32@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Shannon Wang',\n\t\t\t\t'address' => '7330 Saddlehill Lane',\n\t\t\t\t'email' => 'shannon1@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Clarence Rai',\n\t\t\t\t'address' => '244 Rivewview',\n\t\t\t\t'email' => 'clarence32@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Luke Lal',\n\t\t\t\t'address' => '7832 Landing Dr',\n\t\t\t\t'email' => 'luke18@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jordan King',\n\t\t\t\t'address' => '7156 Rose Dr.',\n\t\t\t\t'email' => 'jordan73@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Destiny Wilson',\n\t\t\t\t'address' => '8148 W. Lake Dr.',\n\t\t\t\t'email' => 'destiny7@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ethan Zhang',\n\t\t\t\t'address' => '1769 Nicholas Drive',\n\t\t\t\t'email' => 'ethan20@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Seth Edwards',\n\t\t\t\t'address' => '4499 Valley Crest',\n\t\t\t\t'email' => 'seth46@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Russell Xie',\n\t\t\t\t'address' => '8734 Oxford Place',\n\t\t\t\t'email' => 'russell7@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Alejandro Beck',\n\t\t\t\t'address' => '2596 Franklin Canyon Road',\n\t\t\t\t'email' => 'alejandro45@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Harold Sai',\n\t\t\t\t'address' => '8211 Leeds Ct.',\n\t\t\t\t'email' => 'harold3@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jessie Zhao',\n\t\t\t\t'address' => '213 Valencia Place',\n\t\t\t\t'email' => 'jessie16@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jill Jimenez',\n\t\t\t\t'address' => '9111 Rose Ann Ave',\n\t\t\t\t'email' => 'jill13@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jimmy Moreno',\n\t\t\t\t'address' => '6385 Mark Twain',\n\t\t\t\t'email' => 'jimmy9@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Bethany Yuan',\n\t\t\t\t'address' => '636 Vine Hill Way',\n\t\t\t\t'email' => 'bethany10@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Theresa Ramos',\n\t\t\t\t'address' => '6465 Detroit Ave.',\n\t\t\t\t'email' => 'theresa13@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Denise Stone',\n\t\t\t\t'address' => '626 Bentley Street',\n\t\t\t\t'email' => 'denise10@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jaime Nath',\n\t\t\t\t'address' => '5927 Rainbow Dr',\n\t\t\t\t'email' => 'jaime41@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ebony Gonzalez',\n\t\t\t\t'address' => '5167 Condor Place',\n\t\t\t\t'email' => 'ebony19@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Wendy Dominguez',\n\t\t\t\t'address' => '1873 Mt. Whitney Dr',\n\t\t\t\t'email' => 'wendy12@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jennifer Russell',\n\t\t\t\t'address' => '3981 Augustine Drive',\n\t\t\t\t'email' => 'jennifer93@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Chloe Garcia',\n\t\t\t\t'address' => '8915 Woodside Way',\n\t\t\t\t'email' => 'chloe27@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Diana Hernandez',\n\t\t\t\t'address' => '8357 Sandy Cove Lane',\n\t\t\t\t'email' => 'diana2@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Marc Martin',\n\t\t\t\t'address' => '9353 Creekside Dr.',\n\t\t\t\t'email' => 'marc3@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jesse Murphy',\n\t\t\t\t'address' => '3350 Kingswood Circle',\n\t\t\t\t'email' => 'jesse15@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Amanda Carter',\n\t\t\t\t'address' => '5826 Escobar',\n\t\t\t\t'email' => 'amanda53@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Megan Sanchez',\n\t\t\t\t'address' => '1397 Paraiso Ct.',\n\t\t\t\t'email' => 'megan28@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Nathan Simmons',\n\t\t\t\t'address' => '1170 Shaw Rd',\n\t\t\t\t'email' => 'nathan11@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Adam Flores',\n\t\t\t\t'address' => '6935 Candle Dr',\n\t\t\t\t'email' => 'adam10@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Leonard Nara',\n\t\t\t\t'address' => '7466 La Vista Ave.',\n\t\t\t\t'email' => 'leonard18@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Christine Yuan',\n\t\t\t\t'address' => '2356 Orange St',\n\t\t\t\t'email' => 'christine4@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jaclyn Lu',\n\t\t\t\t'address' => '2812 Mazatlan',\n\t\t\t\t'email' => 'jaclyn12@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jeremy Powell',\n\t\t\t\t'address' => '1803 Potomac Dr.',\n\t\t\t\t'email' => 'jeremy26@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Carol Rai',\n\t\t\t\t'address' => '6064 Madrid',\n\t\t\t\t'email' => 'carol8@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Alan Zheng',\n\t\t\t\t'address' => '2741 Gainborough Dr.',\n\t\t\t\t'email' => 'alan23@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Daniel Johnson',\n\t\t\t\t'address' => '8085 Sunnyvale Avenue',\n\t\t\t\t'email' => 'daniel18@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Heidi Lopez',\n\t\t\t\t'address' => '2514 Via Cordona',\n\t\t\t\t'email' => 'heidi19@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ana Price',\n\t\t\t\t'address' => '1660 Stonyhill Circle',\n\t\t\t\t'email' => 'ana0@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Deanna Munoz',\n\t\t\t\t'address' => '5825 B Way',\n\t\t\t\t'email' => 'deanna33@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Gilbert Raje',\n\t\t\t\t'address' => '8811 The Trees Dr.',\n\t\t\t\t'email' => 'gilbert35@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Michele Nath',\n\t\t\t\t'address' => '5464 Janin Pl.',\n\t\t\t\t'email' => 'michele19@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Carl Andersen',\n\t\t\t\t'address' => '6930 Lake Nadine Place',\n\t\t\t\t'email' => 'carl12@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Marc Diaz',\n\t\t\t\t'address' => '6645 Sinaloa',\n\t\t\t\t'email' => 'marc6@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ashlee Andersen',\n\t\t\t\t'address' => '8255 Highland Road',\n\t\t\t\t'email' => 'ashlee19@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jon Zhou',\n\t\t\t\t'address' => '6574 Hemlock Ave.',\n\t\t\t\t'email' => 'jon28@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Todd Gao',\n\t\t\t\t'address' => '8808 Geneva Ave',\n\t\t\t\t'email' => 'todd14@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Noah Powell',\n\t\t\t\t'address' => '9794 Marion Ct',\n\t\t\t\t'email' => 'noah5@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Angela Murphy',\n\t\t\t\t'address' => '4927 Virgil Street',\n\t\t\t\t'email' => 'angela41@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Chase Reed',\n\t\t\t\t'address' => '2721 Alexander Pl.',\n\t\t\t\t'email' => 'chase21@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Jessica Henderson',\n\t\t\t\t'address' => '9343 Ironwood Way',\n\t\t\t\t'email' => 'jessica29@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Grace Butler',\n\t\t\t\t'address' => '4739 Garden Ave.',\n\t\t\t\t'email' => 'grace62@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Caleb Carter',\n\t\t\t\t'address' => '9563 Pennsylvania Blvd.',\n\t\t\t\t'email' => 'caleb40@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Tiffany Liang',\n\t\t\t\t'address' => '3608 Sinclair Avenue',\n\t\t\t\t'email' => 'tiffany17@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Carolyn Navarro',\n\t\t\t\t'address' => '4606 Springwood Court',\n\t\t\t\t'email' => 'carolyn30@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Willie Raji',\n\t\t\t\t'address' => '6260 Vernal Drive',\n\t\t\t\t'email' => 'willie40@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Linda Serrano',\n\t\t\t\t'address' => '9808 Shaw Rd.',\n\t\t\t\t'email' => 'linda31@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Casey Luo',\n\t\t\t\t'address' => '9513 Roslyn Drive',\n\t\t\t\t'email' => 'casey6@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Amy Ye',\n\t\t\t\t'address' => '2262 Kirkwood Ct.',\n\t\t\t\t'email' => 'amy16@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Levi Arun',\n\t\t\t\t'address' => '4661 Bluetail',\n\t\t\t\t'email' => 'levi6@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Felicia Jimenez',\n\t\t\t\t'address' => '786 Eastgate Ave',\n\t\t\t\t'email' => 'felicia4@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Blake Anderson',\n\t\t\t\t'address' => '5436 Clear',\n\t\t\t\t'email' => 'blake9@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Leah Ye',\n\t\t\t\t'address' => '1291 Arguello Blvd.',\n\t\t\t\t'email' => 'leah7@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Gina Martin',\n\t\t\t\t'address' => '1349 Sol St.',\n\t\t\t\t'email' => 'gina1@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Donald Gonzalez',\n\t\t\t\t'address' => '4236 Malibu Place',\n\t\t\t\t'email' => 'donald20@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Damien Chander',\n\t\t\t\t'address' => '9941 Stonehedge Dr.',\n\t\t\t\t'email' => 'damien32@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Savannah Baker',\n\t\t\t\t'address' => '1210 Trafalgar Circle',\n\t\t\t\t'email' => 'savannah39@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Angela Butler',\n\t\t\t\t'address' => '6040 Listing Ct',\n\t\t\t\t'email' => 'angela17@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Alyssa Cox',\n\t\t\t\t'address' => '867 La Orinda Place',\n\t\t\t\t'email' => 'alyssa37@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Lucas Phillips',\n\t\t\t\t'address' => '8668 St. Celestine Court',\n\t\t\t\t'email' => 'lucas7@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Emily Johnson',\n\t\t\t\t'address' => '7926 Stephanie Way',\n\t\t\t\t'email' => 'emily1@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ryan Brown',\n\t\t\t\t'address' => '2939 Wesley Ct.',\n\t\t\t\t'email' => 'ryan43@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Tamara Liang',\n\t\t\t\t'address' => '3791 Rossmor Parkway',\n\t\t\t\t'email' => 'tamara6@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Hunter Davis',\n\t\t\t\t'address' => '4308 Sand Pointe Lane',\n\t\t\t\t'email' => 'hunter64@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Abigail Price',\n\t\t\t\t'address' => '2685 Blackburn Ct',\n\t\t\t\t'email' => 'abigail25@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Trevor Bryant',\n\t\t\t\t'address' => '5781 Sharon Dr.',\n\t\t\t\t'email' => 'trevor18@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Dalton Perez',\n\t\t\t\t'address' => '6083 San Jose',\n\t\t\t\t'email' => 'dalton37@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Cheryl Diaz',\n\t\t\t\t'address' => '7297 Kaywood Drive',\n\t\t\t\t'email' => 'cheryl4@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Aimee He',\n\t\t\t\t'address' => '1833 Olympic Drive',\n\t\t\t\t'email' => 'aimee13@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Cedric Ma',\n\t\t\t\t'address' => '3407 Oak Brook Place',\n\t\t\t\t'email' => 'cedric15@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Chad Kumar',\n\t\t\t\t'address' => '1681 Lighthouse Way',\n\t\t\t\t'email' => 'chad9@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Andr\u00c3\u00a9s Anand',\n\t\t\t\t'address' => '5423 Los Gatos Ct.',\n\t\t\t\t'email' => 'andr\u00c3\u00a9s18@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Edwin Nara',\n\t\t\t\t'address' => '719 William Way',\n\t\t\t\t'email' => 'edwin39@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Mallory Rubio',\n\t\t\t\t'address' => '6452 Harris Circle',\n\t\t\t\t'email' => 'mallory7@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Adam Ross',\n\t\t\t\t'address' => '4378 Westminster Place',\n\t\t\t\t'email' => 'adam2@adventure-works.com',\n\t\t\t\t'password' => Hash::make('password'),\n\t\t\t],\n\t\t];\n\t\tUser::insert($users);\n\t}\n}\n", "num_lines": 629}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n$servername = \"localhost\";\n$username = \"root\";\n$password = \"\";\n$dbname = \"contosostore\";\n\n$conn = mysqli_init();\n\n//mysqli_ssl_set($conn,NULL,NULL, \"DigiCertGlobalRootCA.crt.pem\", NULL, NULL);\n\nmysqli_real_connect($conn, $servername, $username, $password, $dbname);\n\n// Check connection\nif ($conn->connect_error) {\n  die(\"Connection failed: \" . $conn->connect_error);\n}\n\n$sql = \"SELECT id, firstname, lastname FROM user\";\n\n$result = $conn->query($sql);\n\nif ($result->num_rows > 0) {\n  // output data of each row\n  while($row = $result->fetch_assoc()) {\n    echo \"id: \" . $row[\"id\"]. \" - Name: \" . $row[\"firstname\"]. \" \" . $row[\"lastname\"]. \"<br>\";\n  }\n} else {\n  echo \"0 results\";\n}\n\n$conn->close();\n\n?> ", "num_lines": 34}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n$servername = getenv(\"DB_SERVERNAME\");\n$username = getenv(\"DB_USERNAME\");\n$password = getenv(\"DB_PASSWORD\");\n$dbname = getenv(\"DB_DATABASE\");\n\necho $servername;\necho $username;\necho $password;\necho $dbname;\n\n\n?> ", "num_lines": 14}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Contracts\\Http\\Kernel;\nuse Illuminate\\Http\\Request;\n\ndefine('LARAVEL_START', microtime(true));\n\n/*\n|--------------------------------------------------------------------------\n| Check If The Application Is Under Maintenance\n|--------------------------------------------------------------------------\n|\n| If the application is in maintenance / demo mode via the \"down\" command\n| we will load this file so that any pre-rendered content can be shown\n| instead of starting the framework, which could cause an exception.\n|\n*/\n\nif (file_exists(__DIR__.'/../storage/framework/maintenance.php')) {\n    require __DIR__.'/../storage/framework/maintenance.php';\n}\n\n/*\n|--------------------------------------------------------------------------\n| Register The Auto Loader\n|--------------------------------------------------------------------------\n|\n| Composer provides a convenient, automatically generated class loader for\n| this application. We just need to utilize it! We'll simply require it\n| into the script here so we don't need to manually load our classes.\n|\n*/\n\nrequire __DIR__.'/../vendor/autoload.php';\n\n/*\n|--------------------------------------------------------------------------\n| Run The Application\n|--------------------------------------------------------------------------\n|\n| Once we have the application, we can handle the incoming request using\n| the application's HTTP kernel. Then, we will send the response back\n| to this client's browser, allowing them to enjoy our application.\n|\n*/\n\n$app = require_once __DIR__.'/../bootstrap/app.php';\n\n$kernel = $app->make(Kernel::class);\n\n$response = $kernel->handle(\n    $request = Request::capture()\n)->send();\n\n$kernel->terminate($request, $response);\n", "num_lines": 56}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n    phpinfo();\n?>", "num_lines": 3}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Authentication Language Lines\n    |--------------------------------------------------------------------------\n    |\n    | The following language lines are used during authentication for various\n    | messages that we need to display to the user. You are free to modify\n    | these language lines according to your application's requirements.\n    |\n    */\n\n    'failed' => 'These credentials do not match our records.',\n    'password' => 'The provided password is incorrect.',\n    'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',\n\n];\n", "num_lines": 21}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Pagination Language Lines\n    |--------------------------------------------------------------------------\n    |\n    | The following language lines are used by the paginator library to build\n    | the simple pagination links. You are free to change them to anything\n    | you want to customize your views to better match your application.\n    |\n    */\n\n    'previous' => '&laquo; Previous',\n    'next' => 'Next &raquo;',\n\n];\n", "num_lines": 20}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Password Reset Language Lines\n    |--------------------------------------------------------------------------\n    |\n    | The following language lines are the default lines which match reasons\n    | that are given by the password broker for a password update attempt\n    | has failed, such as for an invalid token or invalid new password.\n    |\n    */\n\n    'reset' => 'Your password has been reset!',\n    'sent' => 'We have emailed your password reset link!',\n    'throttled' => 'Please wait before retrying.',\n    'token' => 'This password reset token is invalid.',\n    'user' => \"We can't find a user with that email address.\",\n\n];\n", "num_lines": 23}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Validation Language Lines\n    |--------------------------------------------------------------------------\n    |\n    | The following language lines contain the default error messages used by\n    | the validator class. Some of these rules have multiple versions such\n    | as the size rules. Feel free to tweak each of these messages here.\n    |\n    */\n\n    'accepted' => 'The :attribute must be accepted.',\n    'accepted_if' => 'The :attribute must be accepted when :other is :value.',\n    'active_url' => 'The :attribute is not a valid URL.',\n    'after' => 'The :attribute must be a date after :date.',\n    'after_or_equal' => 'The :attribute must be a date after or equal to :date.',\n    'alpha' => 'The :attribute must only contain letters.',\n    'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.',\n    'alpha_num' => 'The :attribute must only contain letters and numbers.',\n    'array' => 'The :attribute must be an array.',\n    'before' => 'The :attribute must be a date before :date.',\n    'before_or_equal' => 'The :attribute must be a date before or equal to :date.',\n    'between' => [\n        'numeric' => 'The :attribute must be between :min and :max.',\n        'file' => 'The :attribute must be between :min and :max kilobytes.',\n        'string' => 'The :attribute must be between :min and :max characters.',\n        'array' => 'The :attribute must have between :min and :max items.',\n    ],\n    'boolean' => 'The :attribute field must be true or false.',\n    'confirmed' => 'The :attribute confirmation does not match.',\n    'current_password' => 'The password is incorrect.',\n    'date' => 'The :attribute is not a valid date.',\n    'date_equals' => 'The :attribute must be a date equal to :date.',\n    'date_format' => 'The :attribute does not match the format :format.',\n    'declined' => 'The :attribute must be declined.',\n    'declined_if' => 'The :attribute must be declined when :other is :value.',\n    'different' => 'The :attribute and :other must be different.',\n    'digits' => 'The :attribute must be :digits digits.',\n    'digits_between' => 'The :attribute must be between :min and :max digits.',\n    'dimensions' => 'The :attribute has invalid image dimensions.',\n    'distinct' => 'The :attribute field has a duplicate value.',\n    'email' => 'The :attribute must be a valid email address.',\n    'ends_with' => 'The :attribute must end with one of the following: :values.',\n    'exists' => 'The selected :attribute is invalid.',\n    'file' => 'The :attribute must be a file.',\n    'filled' => 'The :attribute field must have a value.',\n    'gt' => [\n        'numeric' => 'The :attribute must be greater than :value.',\n        'file' => 'The :attribute must be greater than :value kilobytes.',\n        'string' => 'The :attribute must be greater than :value characters.',\n        'array' => 'The :attribute must have more than :value items.',\n    ],\n    'gte' => [\n        'numeric' => 'The :attribute must be greater than or equal to :value.',\n        'file' => 'The :attribute must be greater than or equal to :value kilobytes.',\n        'string' => 'The :attribute must be greater than or equal to :value characters.',\n        'array' => 'The :attribute must have :value items or more.',\n    ],\n    'image' => 'The :attribute must be an image.',\n    'in' => 'The selected :attribute is invalid.',\n    'in_array' => 'The :attribute field does not exist in :other.',\n    'integer' => 'The :attribute must be an integer.',\n    'ip' => 'The :attribute must be a valid IP address.',\n    'ipv4' => 'The :attribute must be a valid IPv4 address.',\n    'ipv6' => 'The :attribute must be a valid IPv6 address.',\n    'json' => 'The :attribute must be a valid JSON string.',\n    'lt' => [\n        'numeric' => 'The :attribute must be less than :value.',\n        'file' => 'The :attribute must be less than :value kilobytes.',\n        'string' => 'The :attribute must be less than :value characters.',\n        'array' => 'The :attribute must have less than :value items.',\n    ],\n    'lte' => [\n        'numeric' => 'The :attribute must be less than or equal to :value.',\n        'file' => 'The :attribute must be less than or equal to :value kilobytes.',\n        'string' => 'The :attribute must be less than or equal to :value characters.',\n        'array' => 'The :attribute must not have more than :value items.',\n    ],\n    'max' => [\n        'numeric' => 'The :attribute must not be greater than :max.',\n        'file' => 'The :attribute must not be greater than :max kilobytes.',\n        'string' => 'The :attribute must not be greater than :max characters.',\n        'array' => 'The :attribute must not have more than :max items.',\n    ],\n    'mimes' => 'The :attribute must be a file of type: :values.',\n    'mimetypes' => 'The :attribute must be a file of type: :values.',\n    'min' => [\n        'numeric' => 'The :attribute must be at least :min.',\n        'file' => 'The :attribute must be at least :min kilobytes.',\n        'string' => 'The :attribute must be at least :min characters.',\n        'array' => 'The :attribute must have at least :min items.',\n    ],\n    'multiple_of' => 'The :attribute must be a multiple of :value.',\n    'not_in' => 'The selected :attribute is invalid.',\n    'not_regex' => 'The :attribute format is invalid.',\n    'numeric' => 'The :attribute must be a number.',\n    'password' => 'The password is incorrect.',\n    'present' => 'The :attribute field must be present.',\n    'prohibited' => 'The :attribute field is prohibited.',\n    'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',\n    'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.',\n    'prohibits' => 'The :attribute field prohibits :other from being present.',\n    'regex' => 'The :attribute format is invalid.',\n    'required' => 'The :attribute field is required.',\n    'required_if' => 'The :attribute field is required when :other is :value.',\n    'required_unless' => 'The :attribute field is required unless :other is in :values.',\n    'required_with' => 'The :attribute field is required when :values is present.',\n    'required_with_all' => 'The :attribute field is required when :values are present.',\n    'required_without' => 'The :attribute field is required when :values is not present.',\n    'required_without_all' => 'The :attribute field is required when none of :values are present.',\n    'same' => 'The :attribute and :other must match.',\n    'size' => [\n        'numeric' => 'The :attribute must be :size.',\n        'file' => 'The :attribute must be :size kilobytes.',\n        'string' => 'The :attribute must be :size characters.',\n        'array' => 'The :attribute must contain :size items.',\n    ],\n    'starts_with' => 'The :attribute must start with one of the following: :values.',\n    'string' => 'The :attribute must be a string.',\n    'timezone' => 'The :attribute must be a valid timezone.',\n    'unique' => 'The :attribute has already been taken.',\n    'uploaded' => 'The :attribute failed to upload.',\n    'url' => 'The :attribute must be a valid URL.',\n    'uuid' => 'The :attribute must be a valid UUID.',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Custom Validation Language Lines\n    |--------------------------------------------------------------------------\n    |\n    | Here you may specify custom validation messages for attributes using the\n    | convention \"attribute.rule\" to name the lines. This makes it quick to\n    | specify a specific custom language line for a given attribute rule.\n    |\n    */\n\n    'custom' => [\n        'attribute-name' => [\n            'rule-name' => 'custom-message',\n        ],\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Custom Validation Attributes\n    |--------------------------------------------------------------------------\n    |\n    | The following language lines are used to swap our attribute placeholder\n    | with something more reader friendly such as \"E-Mail Address\" instead\n    | of \"email\". This simply helps us make our message more expressive.\n    |\n    */\n\n    'attributes' => [],\n\n];\n", "num_lines": 161}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "@extends('layouts.app')\n@section('content')\n\n\t<h3>Choose a category</h3>\n\n\t<div class=\"center-block category-list\">\n\t\t<div class=\"two-thirds column\">\n\t\t\t<div class=\"row\">\n\t\t\t@foreach($category as $c)\n\t\t\t\t<div class=\"category one-third column\" data-url=\"{{ $c->url }}\">\n\t\t\t\t\t<div class=\"image\" style=\"background-image:url(/img/{{ $c->img }});\"></div>\n\t\t\t\t\t<span>{{ $c->name }}</span>\n\t\t\t\t</div>\n\t\t\t@endforeach\n\t\t\t</div>\n\t\t</div>\n\t\t<button class=\"select-category button\" disabled>Continue</button>\n\t</div>\n\n@endsection\n@push('scripts')\n<script>\n</script>\n@endpush\n", "num_lines": 25}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "@extends('layouts.app')\n@section('content')\n\n\t<h3>Checkout</h3>\n\n\t<div class=\"center-block item-list\">\n\t\t<div class=\"two-thirds column\">\n\t\t\t@if ($cart_data)\n\t\t\t<table class=\"u-full-width m-b-0 checkout-cart\">\n\t\t\t\t<tbody>\n\t\t\t\t@foreach($cart_data as $c)\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><div class=\"image\" style=\"background-image:url(/img/{{ $c->img }});\"></div></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<span>{{ $c->name }}</span>\n\t\t\t\t\t\t\t<span>{{ $c->qty }} @ {{ is_numeric($c->price) ? number_format($c->price, 2) : '0.00' }}</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>{{ number_format($c->sub, 2) }}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t@endforeach\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan=\"2\">Total:</td>\n\t\t\t\t\t\t<td>$ {{ number_format($cart_total, 2) }}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\t<div class=\"one-half column\">\n\t\t\t<form method=\"post\" action=\"{{ route('process-order') }}\">\n\t\t\t\t{{ csrf_field() }}\n\n\t\t\t\t<!-- keeping it simple for demo purposes, only displaying a few fields -->\n\t\t\t\t<label for=\"name\" class=\"text-left\">Name</label>\n\t\t\t\t<input id=\"name\" name=\"name\" type=\"text\" class=\"u-full-width\" value=\"{{ $user ?? '' ? $user->name : '' }}\">\n\t\t\t\t<label for=\"address\" class=\"text-left\">Address</label>\n\t\t\t\t<input id=\"address\" name=\"address\" type=\"text\" class=\"u-full-width\" value=\"{{ $user ?? '' ? $user->address : '' }}\">\n\t\t\t\t<label for=\"special_instruction\" class=\"text-left\">Special Instructions</label>\n\t\t\t\t<textarea id=\"special_instruction\" name=\"special_instructions\" class=\"u-full-width\"></textarea>\n\n\t\t\t\t<a href=\"{{ route('category-list') }}\" class=\"button\">Add to Order</a>\n\t\t\t\t<button class=\"button button-primary complete-order\">Complete Order</button>\n\t\t\t</form>\n\t\t\t@else\n\t\t\t<p>You have no food in your cart.</p>\n\t\t\t<a href=\"{{ route('category-list') }}\" class=\"button\">Start a New Order</a>\n\t\t\t@endif\n\t\t</div>\n\t</div>\n\n@endsection\n@push('scripts')\n<script>\n</script>\n@endpush\n", "num_lines": 55}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "@extends('layouts.app')\n@section('content')\n\n\t<div class=\"hero\">\n\t\t<div class=\"logo\">{{ config('app.name', 'Contoso NoshNow') }}</div>\n\t</div>\n\n\t<div class=\"center-block order-form\">\n\t\t<div class=\"one-half column\">\n\t\t\t<form>\n\t\t\t\t<label for=\"delivery_address\">Welcome back, <span class=\"blue\">{{ $user->name }}</span>! Where should we deliver your meal?</label>\n\t\t\t\t<!-- \n\t\t\t\t\tKeeping it simple for demo purposes, only displaying a single street address field. We don't\n\t\t\t\t\tactually use this field for anything though. It's just for show!\n\t\t\t\t -->\n\t\t\t\t<input id=\"delivery_address\" class=\"u-full-width\" type=\"text\" placeholder=\"Enter your street address\" value=\"{{ $user->address }}\">\n\t\t\t\t<a href=\"{{ route('category-list') }}\" class=\"start-order button button-primary\">Start Order</a>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\n@endsection\n@push('scripts')\n<script>\n</script>\n@endpush\n", "num_lines": 27}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "@extends('layouts.app')\n@section('content')\n\n\t<h3>Select a meal</h3>\n\n\t<div class=\"center-block item-list\">\n\t\t<div class=\"two-thirds column\">\n\t\t\t<div class=\"row\">\n\t\t\t@foreach($item as $i)\n\t\t\t\t<div class=\"item one-third column\">\n\t\t\t\t\t<div class=\"image\" style=\"background-image:url(/img/{{ $i->img }});\"></div>\n\t\t\t\t\t<div class=\"name\">{{ $i->name }}</div>\n\t\t\t\t\t<div class=\"price\"><sup>$</sup>{{ is_numeric($i->price) ? number_format($i->price, 2) : '0.00' }}</div>\n\t\t\t\t\t<div class=\"desc\">\n\t\t\t\t\t\t<div class=\"overflow\">{{ $i->desc }}</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<button class=\"add-to-cart button-small button-primary\" data-item=\"{{ $i->id }}\">Add</button>\n\t\t\t\t</div>\n\t\t\t@endforeach\n\t\t\t</div>\n\t\t</div>\n\t\t<a href=\"{{ route('category-list') }}\" class=\"button\">Back</a>\n\t\t<button class=\"button {{ $global_cart['cart_total'] ? 'button-primary' : '' }} checkout-button\" {{ $global_cart['cart_total'] ? '' : 'disabled' }}>Continue</button>\n\t</div>\n\n@endsection\n@push('scripts')\n<script>\n// to keep the layout and design simple, only show 6 lines of text from the item description\nvar ellipsis_lines = 6;\n$(document).ready( function() {\n\tellipsis();\n\n\t$('.checkout-button').on('click', function() {\n\t\tvar url = \"{{ route('checkout') }}\";\n\t\t// fun little trick to allow ctrl-click on a javascript click event just like regular links\n\t\tif (event.metaKey || event.ctrlKey) {\n\t\t\twindow.open(url,'_blank');\n\t\t} else {\n\t\t\tlocation.href = url;\n\t\t}\n\t});\n\n});\n$(window).resize( function() {\n\tellipsis();\n});\n\n// function to add ellipsis after (N) lines of text\nfunction ellipsis() {\n\tvar lines = ellipsis_lines;\n\t$('.overflow').each(function( index ) {\n\t\tvar inner = $(this);\n\t\tvar outer = inner.parent();\n\t\tif (inner.attr('data-text')) {\n\t\t\tvar innertext = inner.attr('data-text');\n\t\t} else {\n\t\t\tvar innertext = inner.text();\n\t\t}\n\t\tvar lineheight = inner.css('line-height');\n\t\tvar height = (lineheight.replace('px','')-0)*(lines-0);\n\t\touter.css({'height':height});\n\t\tinner.attr('data-text',innertext);\n\t\tinner.text(innertext);\n\t\twhile (inner.outerHeight() > height) {\n\t\t\tinner.text(function (index, text) {\n\t\t\t\treturn text.replace(/\\W*\\s(\\S)*$/, '...');\n\t\t\t});\n\t\t}\n\t});\n}\n</script>\n@endpush\n", "num_lines": 74}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "@extends('layouts.app')\n@section('content')\n\n\t<h3>Receipt</h3>\n\n\t<div class=\"center-block item-list\">\n\t<p>Thank you for placing your food order with {{ config('app.name', '') }}!</p>\n\t<p id=\"remaining_text\"></p>\n\n\t<a href=\"{{ route('category-list') }}\" class=\"button\">Start a New Order</a>\n\t</div>\n\n@endsection\n@push('scripts')\n<script>\n$(document).ready( function() {\n\tset_receipt_text('{{ $time_left ?? '0' }}');\n});\n</script>\n@endpush\n", "num_lines": 21}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "\t\t\t<!-- display a cart icon and number of items in the cart (click to display items in cart) -->\n\t\t\t<div class=\"cart-icon {{ $cart_total ? '' : 'disabled' }}\">\n\t\t\t\t<span class=\"count\" id=\"cart_total\">{{ $cart_total ? $cart_total : '0' }}</span>\n\t\t\t\t<span class=\"icon-cart\"></span>\n\t\t\t</div>\n\n\t\t\t<div class=\"cart-block {{ $show && $cart_total ? '' : 'initially-hidden' }}\">\n\t\t\t\t<div class=\"cart-items\">\n\t\t\t\t@if (!$cart_total)\n\t\t\t\t\t<!-- this should never appear, but just in case the user pulls some shenanigans with the browser's inspector -->\n\t\t\t\t\t<table class=\"u-full-width m-b-0\"><tbody><tr><td>&nbsp; Uh oh! Your cart is empty.</td></tr></tbody></table>\n\t\t\t\t@else\n\t\t\t\t\t<!-- show a table of items in cart -->\n\t\t\t\t\t<table class=\"u-full-width m-b-0 full-cart\">\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t@foreach($cart_data as $c)\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td><span>{{ $c->name }}</span></td>\n\t\t\t\t\t\t\t\t<td><input type=\"text\" value=\"{{ $c->qty }}\" class=\"item-qty\" data-item=\"{{ $c->id }}\"></td>\n\t\t\t\t\t\t\t\t<td>@ {{ is_numeric($c->price) ? number_format($c->price, 2) : '0.00' }}</td>\n\t\t\t\t\t\t\t\t<td>{{ number_format($c->sub, 2) }}</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t@endforeach\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t@endif\n\t\t\t\t</div>\n\t\t\t\t<!-- cart action buttons -->\n\t\t\t\t<div class=\"cart-footer\">\n\t\t\t\t\t<table class=\"u-full-width m-b-0 b-b-0\">\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t@if ($cart_total)\n\t\t\t\t\t\t\t\t<!-- if there's something in the cart, show an update button and checkout button -->\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<a href=\"{{ route('checkout') }}\" class=\"button button-tiny btn-success cart-checkout\">Checkout</a>\n\t\t\t\t\t\t\t\t\t<button class=\"button-tiny cart-update\">Update</button>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t@endif\n\t\t\t\t\t\t\t\t<!-- show a button to hide the cart -->\n\t\t\t\t\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t\t\t\t\t<button class=\"button-tiny closer\">&#9650;</button>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t</div>", "num_lines": 48}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<!DOCTYPE html>\n<html lang=\"{{ str_replace('_', '-', app()->getLocale()) }}\">\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n\t\t<!-- CSRF Token -->\n\t\t<meta name=\"csrf-token\" content=\"{{ csrf_token() }}\">\n\n\t\t<title>{{ config('app.name', 'Contoso NoshNow') }}</title>\n\n\t\t<!-- Scripts -->\n\t\t<script src=\"{{ asset('js/app.js') }}\"></script>\n\t\t<script src=\"{{ asset('js/custom.js') }}\"></script>\n\n\t\t<!-- Fonts -->\n\t\t<link href=\"https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap\" rel=\"stylesheet\">\n\n\t\t<!-- Styles -->\n\t\t<style>\n\t\t\t/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}a{background-color:transparent}[hidden]{display:none}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}*,:after,:before{box-sizing:border-box;border:0 solid #e2e8f0}a{color:inherit;text-decoration:inherit}svg,video{display:block;vertical-align:middle}video{max-width:100%;height:auto}body{font-family: 'Nunito', sans-serif}\n\t\t</style>\n\t\t<link href=\"{{ asset('css/normalize.css') }}\" rel=\"stylesheet\">\n\t\t<link href=\"{{ asset('css/skeleton.css') }}\" rel=\"stylesheet\">\n\t\t<link href=\"{{ asset('css/icomoon.css') }}\" rel=\"stylesheet\">\n\t\t<link href=\"{{ asset('css/custom.css') }}\" rel=\"stylesheet\">\n\t\t<link href=\"{{ asset('css/app.css') }}\" rel=\"stylesheet\">\n@stack('styles')\n\t</head>\n\t<body class=\"antialiased\">\n\n@if(isset($header))\n\t\t<div class=\"header\">\n\t\t\t<a href=\"{{ route('home') }}\">\n\t\t\t\t<img src=\"/img/white-gd422548d7_640.png\">\n\t\t\t\t{{ config('app.name', '') }}\n\t\t\t</a>\n\t\t</div>\n@endif\n\n\t\t<div id=\"global_cart\" class=\"global-cart\">\n{!! $global_cart['html'] ?? '' !!}\n\t\t</div>\n\n@yield('content')\n\n\t\t<!-- show a little warning message if the data is coming from JSON and not the database -->\n\t\t<div class=\"json-warning {{ $json_warning ?? '' ? '' : 'initially-hidden' }}\">Site is unable to pull from database. Using JSON data instead.</div>\n\n@stack('scripts')\n\t</body>\n</html>\n", "num_lines": 53}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Route;\n\n/*\n|--------------------------------------------------------------------------\n| API Routes\n|--------------------------------------------------------------------------\n|\n| Here is where you can register API routes for your application. These\n| routes are loaded by the RouteServiceProvider within a group which\n| is assigned the \"api\" middleware group. Enjoy building your API!\n|\n*/\n\nRoute::middleware('auth:sanctum')->get('/user', function (Request $request) {\n    return $request->user();\n});\n", "num_lines": 20}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Support\\Facades\\Broadcast;\n\n/*\n|--------------------------------------------------------------------------\n| Broadcast Channels\n|--------------------------------------------------------------------------\n|\n| Here you may register all of the event broadcasting channels that your\n| application supports. The given channel authorization callbacks are\n| used to check if an authenticated user can listen to the channel.\n|\n*/\n\nBroadcast::channel('App.Models.User.{id}', function ($user, $id) {\n    return (int) $user->id === (int) $id;\n});\n", "num_lines": 19}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Foundation\\Inspiring;\nuse Illuminate\\Support\\Facades\\Artisan;\n\n/*\n|--------------------------------------------------------------------------\n| Console Routes\n|--------------------------------------------------------------------------\n|\n| This file is where you may define all of your Closure based console\n| commands. Each Closure is bound to a command instance allowing a\n| simple approach to interacting with each command's IO methods.\n|\n*/\n\nArtisan::command('inspire', function () {\n    $this->comment(Inspiring::quote());\n})->purpose('Display an inspiring quote');\n", "num_lines": 20}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nuse Illuminate\\Support\\Facades\\Route;\n\n/*\n|--------------------------------------------------------------------------\n| Web Routes\n|--------------------------------------------------------------------------\n|\n| Here is where you can register web routes for your application. These\n| routes are loaded by the RouteServiceProvider within a group which\n| contains the \"web\" middleware group. Now create something great!\n|\n*/\n\n\n// pages:\n\nRoute::get('/', 'HomeController@index')->name('home');\n\nRoute::get('/category-list', 'ProductController@categoryList')->name('category-list');\nRoute::get('/item-list/{category}', 'ProductController@itemList')->name('item-list');\n\nRoute::get('/checkout', 'CartController@checkout')->name('checkout');\nRoute::post('/process-order', 'CartController@processOrder')->name('process-order');\nRoute::get('/receipt', 'CartController@receipt')->name('receipt');\n\n\n// ajax:\n\nRoute::post('/add-to-cart', 'CartController@addToCart');\nRoute::post('/update-cart', 'CartController@updateCart');\n", "num_lines": 33}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Tests;\n\nuse Illuminate\\Contracts\\Console\\Kernel;\n\ntrait CreatesApplication\n{\n    /**\n     * Creates the application.\n     *\n     * @return \\Illuminate\\Foundation\\Application\n     */\n    public function createApplication()\n    {\n        $app = require __DIR__.'/../bootstrap/app.php';\n\n        $app->make(Kernel::class)->bootstrap();\n\n        return $app;\n    }\n}\n", "num_lines": 23}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Tests;\n\nuse Illuminate\\Foundation\\Testing\\TestCase as BaseTestCase;\n\nabstract class TestCase extends BaseTestCase\n{\n    use CreatesApplication;\n}\n", "num_lines": 11}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Tests\\Feature;\n\nuse Illuminate\\Foundation\\Testing\\RefreshDatabase;\nuse Tests\\TestCase;\n\nclass ExampleTest extends TestCase\n{\n    /**\n     * A basic test example.\n     *\n     * @return void\n     */\n    public function test_example()\n    {\n        $response = $this->get('/');\n\n        $response->assertStatus(200);\n    }\n}\n", "num_lines": 22}
{"repo_name": "azure-mysql", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nnamespace Tests\\Unit;\n\nuse PHPUnit\\Framework\\TestCase;\n\nclass ExampleTest extends TestCase\n{\n    /**\n     * A basic test example.\n     *\n     * @return void\n     */\n    public function test_example()\n    {\n        $this->assertTrue(true);\n    }\n}\n", "num_lines": 19}
{"repo_name": "Azure-Network-Security", "repo_creator": "Azure", "programming_language": "PHP", "code": "<!DOCTYPE html>\n<html>\n\n<head>\n  <link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css\" integrity=\"sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS\" crossorigin=\"anonymous\">\n</head>\n\n<body>\n  <?php\n  session_start();\n  require_once('lib/helpers.php');\n  $filter = array_key_exists('blend', $_GET) ? $_GET['blend'] : '';\n  ?>\n  <nav class=\"navbar navbar-dark bg-dark justify-content-end\">\n    <?php\n    if (isset($_SESSION['cart_items'])) {\n      ?>\n      <form class=\"form-inline mr-3\" action=\"\" method=\"get\">\n        <button class=\"btn btn-primary btn-sm\"><?php echo (count($_SESSION['cart_items'])); ?>\u00f0\u0178\u203a\u2019</button>\n      </form>\n    <?php\n  }\n  if (logged_in()) {\n    $user = current_user();\n    ?>\n      <form class=\"form-inline mr-0\" action=\"lib/logout.php\" method=\"post\">\n        <h5 class=\"mr-2 mt-1\"><span class=\"badge badge-primary\"><?php echo ($user['name']); ?></span></h5>\n        <button class=\"btn btn-outline-success my-2 btn-sm my-sm-0\" type=\"submit\">Logout</button>\n      </form>\n    <?php\n  } else {\n    ?>\n      <form class=\"form-inline\" action=\"lib/login.php\" method=\"post\">\n        <input class=\"form-control mr-sm-2\" type=\"text\" placeholder=\"Username\" name=\"username\">\n        <input class=\"form-control mr-sm-2\" type=\"password\" placeholder=\"Password\" name=\"password\">\n        <button class=\"btn btn-outline-success my-2 my-sm-0\" type=\"submit\">Login</button>\n      </form>\n    <?php\n  }\n  ?>\n  </nav>\n  <?php\n  if (isset($_SESSION['login_error'])) {\n    unset($_SESSION['login_error']);\n    ?>\n    <div class=\"alert alert-danger\" role=\"alert\">\n      Login Failed. Your Username or Password may be wrong.\n    </div>\n  <?php\n}\n?>\n  <h1>Onlineshop CoffeeShop</h1>\n  <form action=\"index.php\" method=\"get\">\n    <div class=\"form-group\">\n      <label for=\"blendFilter\">Blend Name</label>\n      <input type=\"text\" class=\"form-control\" id=\"blendFilter\" name=\"blend\" placeholder=\"Filter Blend Names\" value=<?php echo ('\"' . $filter . '\"'); ?>>\n    </div>\n    <button type=\"submit\" class=\"btn btn-primary\">Filter</button>\n  </form>\n  <?php\n  require_once('lib/show_table.php');\n  show_table($filter);\n  ?>\n  <form action=\"lib/recreate_and_seed_db.php\" method=\"post\">\n    <button type=\"submit\" class=\"btn btn-danger btn-sm\">Recreate Table</button>\n  </form>\n</body>\n\n</html>\n", "num_lines": 70}
{"repo_name": "Azure-Network-Security", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php  \n  session_start();\n  require_once('helpers.php');\n  if (!logged_in()) {\n    header('Location: ../index.php');\n    exit;\n  }\n  $id = $_POST['id'];\n  if (!isset($_SESSION['cart_items'])) {\n    $_SESSION['cart_items'] = array();\n  }\n  array_push($_SESSION['cart_items'], $id);\n  header('Location: ../index.php');\n?>", "num_lines": 14}
{"repo_name": "Azure-Network-Security", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nfunction connectdb($database = \"inject_demodb\")\n{\n  if ($database == '') {\n    $database = NULL;\n  }\n  if (isset($_ENV['DATABASE_URL'])) {\n    //  http://username:password@hostname:9090/path\n    $db_props = parse_url($_ENV['DATABASE_URL']);\n    $host = $db_props['host'];\n    $port = $db_props['port'];\n    $username = $db_props['user'];\n    $password = $db_props['pass'];\n    //$database = substr($db_props['path'], 1); // remove the slash from '/path'\n  } else {\n    //$host = isset($_ENV['SQL_INJECTION_DB_HOST']) ? $_ENV['SQL_INJECTION_DB_HOST'] : 'localhost';\n    $port = isset($_ENV['SQL_INJECTION_DB_PORT']) ? $_ENV['SQL_INJECTION_DB_PORT'] : 3306;\n    $username = isset($_ENV['SQL_INJECTION_DB_USERNAME']) ? $_ENV['SQL_INJECTION_DB_USERNAME'] : 'sql_injection';\n    $password = isset($_ENV['SQL_INJECTION_DB_PASSWORD']) ? $_ENV['SQL_INJECTION_DB_PASSWORD'] : 'foobar';\n  }\n  $db = mysqli_connect(null, $username, $password, $database, null,\"/cloudsql/sampleappgcp:us-west2:coffeeshop\");\n  if (!$db) {\n    echo (\"Connection failed: \" . mysqli_connect_error());\n  }\n  return $db;\n}\n", "num_lines": 27}
{"repo_name": "Azure-Network-Security", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n  require_once('connectdb.php');\n  if (isset($_POST['id'])) {\n    $id = $_POST['id'];\n    // vulnerable...\n    $query = \"DELETE FROM coffee WHERE id=$id\";\n    $db = connectdb();\n    mysqli_multi_query($db, $query);\n    mysqli_close($db);\n  }\n  header('Location: ../index.php');\n?>", "num_lines": 12}
{"repo_name": "Azure-Network-Security", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nfunction setup()\n{\n  if (session_status() == PHP_SESSION_NONE) {\n    session_start();\n  }\n  if (!isset($_SESSION['user_id'])) return false;\n  require_once('connectdb.php');\n  return true;\n}\n\nfunction current_user()\n{\n  if (!setup()) return false;\n  $user_id = $_SESSION['user_id'];\n  // don't do it like that in productive systems\n  // session variables can be changed and thus sql\n  // injection is possible here aswell!\n  $query = \"SELECT * from users WHERE id=$user_id\";\n  $db = connectdb();\n  $result = mysqli_multi_query($db, $query);\n  if ($result) {\n    $result = mysqli_use_result($db);\n  }\n  if ($result) {\n    $user = mysqli_fetch_array($result, MYSQLI_ASSOC);\n    mysqli_close($db);\n    return $user;\n  }\n  mysqli_close($db);\n  return false;\n}\n\nfunction logged_in()\n{\n  return setup();\n}\n\nfunction is_admin()\n{\n  if (!setup()) return false;\n  $user_id = $_SESSION['user_id'];\n  // don't do it like that in productive systems\n  // session variables can be changed and thus sql\n  // injection is possible here aswell!\n  $query = \"SELECT * from users WHERE id=$user_id\";\n  $db = connectdb();\n  $result = mysqli_multi_query($db, $query);\n  if ($result) {\n    $result = mysqli_use_result($db);\n  }\n  if ($result) {\n    $user = mysqli_fetch_array($result, MYSQLI_ASSOC);\n    mysqli_close($db);\n    return $user['role'] == 'admin';\n  }\n  mysqli_close($db);\n  return false;\n}\n", "num_lines": 61}
{"repo_name": "Azure-Network-Security", "repo_creator": "Azure", "programming_language": "PHP", "code": "\n  <?php\n  session_start();\n  require_once('helpers.php');\n  \n  if (logged_in()) {\n    header('Location: ../index.php');\n    exit;    \n  }\n  \n  $name = $_POST['username'];\n  $password = $_POST['password'];\n  $query = \"SELECT * FROM users WHERE name='$name' AND password='$password';\";\n  \n  require_once('connectdb.php');\n  $db = connectdb();\n  $result = mysqli_multi_query($db, $query);\n  if ($result) {\n    $result = mysqli_use_result($db);\n  }\n  if ($result) {\n    $user = mysqli_fetch_array($result, MYSQLI_ASSOC);\n    if (isset($user['id'])) {\n      $_SESSION['user_id'] = $user['id'];\n    }\n  }\n  if (!isset($_SESSION['user_id'])) {\n    $_SESSION['login_error'] = true;\n  }\n  mysqli_close($db);\n\n\n  header('Location: ../index.php');\n  ?>", "num_lines": 34}
{"repo_name": "Azure-Network-Security", "repo_creator": "Azure", "programming_language": "PHP", "code": "\n  <?php\n  session_start();\n\n  $_SESSION = array();\n\n  // also force session in cookie to expire\n  if (isset($_COOKIE[session_name()]))\n  {\n    $cookie_expires  = time() - date('Z') - 3600;\n    setcookie(session_name(), '', $cookie_expires, '/');\n  }\n  session_destroy();\n  header('Location: ../index.php');  \n  ?>\n", "num_lines": 16}
{"repo_name": "Azure-Network-Security", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n  require_once('connectdb.php');\n  $db = connectdb('');\n  mysqli_query($db, \"CREATE DATABASE IF NOT EXISTS inject_demodb;\");\n  // coffee table\n  $drop_sql = 'DROP TABLE IF EXISTS coffee;';\n  $create_sql = file_get_contents('../sql/create_db.sql');\n  $data_sql = file_get_contents('../sql/coffee_data.sql');\n\n\n\n  $db = connectdb();\n  $result = mysqli_query($db, $drop_sql);\n  if (!$result) {\n    die(\"ERROR: \" . mysqli_error($db));\n  }\n  $result = mysqli_query($db, $create_sql);\n  if (!$result) {\n    die(\"ERROR: \" . mysqli_error($db));\n  }\n  $result = mysqli_query($db, $data_sql);\n  if (!$result) {\n    die(\"ERROR: \" . mysqli_error($db));\n  }\n\n  // user table\n  $recreate_users = file_get_contents('../sql/users.sql');\n  $result = mysqli_multi_query($db, $recreate_users);\n  if (!$result) {\n    die(\"ERROR: \" . mysqli_error($db));\n  }\n  mysqli_close($db);\n  header('Location: ../index.php');\n?>", "num_lines": 34}
{"repo_name": "Azure-Network-Security", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\nfunction show_table($blend_name)\n{\n  if (session_status() == PHP_SESSION_NONE) {\n    session_start();\n  }\n  require_once('helpers.php');\n  $logged_in = logged_in();\n  $admin = is_admin();\n  ?>\n  <table class=\"table border\">\n    <tr>\n      <th>ID</th>\n      <th>BlendName</th>\n      <th>Origin</th>\n      <th>Variety</th>\n      <th>Notes</th>\n      <th>Intensifier</th>\n      <th>Price</th>\n      <?php\n      if ($logged_in) {\n        echo (\"<th>Shop</th>\");\n      }\n      if ($admin) {\n        echo (\"<th>L\u00c3\u00b6schen</th>\");\n      }\n      ?>\n    </tr>\n    <?php\n    require_once('connectdb.php');\n    // vulnerability to sql injection\n    $query = \"SELECT * FROM coffee WHERE blend_name LIKE '%$blend_name%';\";\n    ?>\n    <br>\n    <div class=\"card\">\n      <div class=\"card-body\">\n        Query: <code>\n          <?php\n          echo ($query);\n          ?>\n        </code>\n      </div>\n    </div>\n    <br>\n    <h3>Kaffee</h3>\n    <?php\n    $db = connectdb();\n    // mysqli_multi_query is required to demonstrate all possible\n    // sql-injection variants. With mysqli_query only the first\n    // query statement is performed to prevent sql injection...\n    $result = mysqli_multi_query($db, $query);\n    if ($result) {\n      $result = mysqli_use_result($db);\n    }\n    if ($result) {\n      while ($coffee = mysqli_fetch_array($result, MYSQLI_ASSOC)) {\n        echo ('<tr>');\n        foreach ($coffee as $attr) {\n          echo ('<td>' . $attr . '</td>');\n        }\n        if ($logged_in) {\n          $id = $coffee['id'];\n          echo (\"\n            <td>\n              <form action=\\\"lib/add_to_cart.php\\\" method=\\\"post\\\">\n                <button name=\\\"item\\\" value=\\\"$id\\\" type=\\\"submit\\\" class=\\\"btn px-1 py-0\\\">\n                  \u00f0\u0178\u203a\u2019\n                </button>\n              </form>\n            </td>\n          \");\n        }\n        if ($admin) {\n          $id = $coffee['id'];\n          echo (\"\n            <th>\n              <form class=\\\"form-inline mr-3\\\" action=\\\"lib/delete_item.php\\\" method=\\\"post\\\">\n                <button name=\\\"id\\\" value=\\\"$id\\\" type=\\\"submit\\\" class=\\\"btn btn-danger px-1 py-0\\\">\n                  &times;\n                </button>\n              </form>\n            </th>\n          \");\n        }\n        echo ('</tr>');\n      }\n    } else {\n      echo ('ERROR: ' . mysqli_error($db));\n    }\n    mysqli_close($db);\n    ?>\n  </table>\n<?php\n}\n?>", "num_lines": 95}
{"repo_name": "azure-notificationhubs-samples", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\nclass Notification {\n\tpublic $format;\n\tpublic $payload;\n\n\t# array with keynames for headers\n\t# Note: Some headers are mandatory: Windows: X-WNS-Type, WindowsPhone: X-NotificationType\n\t# Note: For Apple you can set Expiry with header: ServiceBusNotification-ApnsExpiry in W3C DTF, YYYY-MM-DDThh:mmTZD (for example, 1997-07-16T19:20+01:00).\n\tpublic $headers;\n\n\tfunction __construct($format, $payload) {\n\t\tif (!in_array($format, [\"template\", \"apple\", \"windows\", \"gcm\", \"windowsphone\"])) {\n\t\t\tthrow new Exception('Invalid format: ' . $format);\n\t\t}\n\n\t\t$this->format = $format;\n\t\t$this->payload = $payload;\n\t}\n}\n\n?>", "num_lines": 22}
{"repo_name": "azure-notificationhubs-samples", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\ninclude 'Notification.php';\n\nclass NotificationHub {\n\n\tconst API_VERSION = \"?api-version=2013-10\";\n\n\tprivate $endpoint;\n\tprivate $hubPath;\n\tprivate $sasKeyName;\n\tprivate $sasKeyValue;\n\n\tfunction __construct($connectionString, $hubPath) {\n\t\t$this->hubPath = $hubPath;\n\n\t\t$this->parseConnectionString($connectionString);\n\t}\n\n\tprivate function parseConnectionString($connectionString) {\n\t\t$parts = explode(\";\", $connectionString);\n\t\tif (sizeof($parts) != 3) {\n\t\t\tthrow new Exception(\"Error parsing connection string: \" . $connectionString);\n\t\t}\n\n\t\tforeach ($parts as $part) {\n\t\t\tif (strpos($part, \"Endpoint\") === 0) {\n\t\t\t\t$this->endpoint = \"https\" . substr($part, 11);\n\t\t\t} else if (strpos($part, \"SharedAccessKeyName\") === 0) {\n\t\t\t\t$this->sasKeyName = substr($part, 20);\n\t\t\t} else if (strpos($part, \"SharedAccessKey\") === 0) {\n\t\t\t\t$this->sasKeyValue = substr($part, 16);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate function generateSasToken($uri) {\n\t\t$targetUri = strtolower(rawurlencode(strtolower($uri)));\n\n\t\t$expires = time();\n\t\t$expiresInMins = 60;\n\t\t$expires = $expires + $expiresInMins * 60;\n\t\t$toSign = $targetUri . \"\\n\" . $expires;\n\n\t\t$signature = rawurlencode(base64_encode(hash_hmac('sha256', $toSign, $this->sasKeyValue, TRUE)));\n\n\t\t$token = \"SharedAccessSignature sr=\" . $targetUri . \"&sig=\"\n\t\t\t\t\t. $signature . \"&se=\" . $expires . \"&skn=\" . $this->sasKeyName;\n\n\t\treturn $token;\n\t}\n\n\tpublic function broadcastNotification($notification) {\n\t\t$this->sendNotification($notification, \"\");\n\t}\n\n\tpublic function sendNotification($notification, $tagsOrTagExpression) {\n\t\techo $tagsOrTagExpression.\"<p>\";\n\n\t\tif (is_array($tagsOrTagExpression)) {\n\t\t\t$tagExpression = implode(\" || \", $tagsOrTagExpression);\n\t\t} else {\n\t\t\t$tagExpression = $tagsOrTagExpression;\n\t\t}\n\n\t\t# build uri\n\t\t$uri = $this->endpoint . $this->hubPath . \"/messages\" . NotificationHub::API_VERSION;\n\n\t\techo $uri.\"<p>\";\n\n\t\t$ch = curl_init($uri);\n\n\t\tif (in_array($notification->format, [\"template\", \"apple\", \"gcm\"])) {\n\t\t\t$contentType = \"application/json\";\n\t\t} else {\n\t\t\t$contentType = \"application/xml\";\n\t\t}\n\n\t\t$token = $this->generateSasToken($uri);\n\n\t\t$headers = [\n\t\t    'Authorization: '.$token,\n\t\t    'Content-Type: '.$contentType,\n\t\t    'ServiceBusNotification-Format: '.$notification->format\n\t\t];\n\n\t\tif (\"\" !== $tagExpression) {\n\t\t\t$headers[] = 'ServiceBusNotification-Tags: '.$tagExpression;\n\t\t}\n\n\t\t# add headers for other platforms\n\t\tif (is_array($notification->headers)) {\n\t\t\t$headers = array_merge($headers, $notification->headers);\n\t\t}\n\t\t\n\t\tcurl_setopt_array($ch, array(\n\t\t    CURLOPT_POST => TRUE,\n\t\t    CURLOPT_RETURNTRANSFER => TRUE,\n\t\t    CURLOPT_SSL_VERIFYPEER => FALSE,\n\t\t    CURLOPT_HTTPHEADER => $headers,\n\t\t    CURLOPT_POSTFIELDS => $notification->payload\n\t\t));\n\n\t\t// Send the request\n\t\t$response = curl_exec($ch);\n\n\t\t// Check for errors\n\t\tif($response === FALSE){\n\t\t    throw new Exception(curl_error($ch));\n\t\t}\n\n\t\t$info = curl_getinfo($ch);\n\n\t\tif ($info['http_code'] <> 201) {\n\t\t\tthrow new Exception('Error sending notificaiton: '. $info['http_code'] . ' msg: ' . $response);\n\t\t}\n\n\t\t//print_r($info);\n\n\t\t//echo $response;\n\t} \n}\n\n?>", "num_lines": 124}
{"repo_name": "azure-notificationhubs-samples", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n\n// This script creates a valid push package.\n// This script assumes that the website.json file and iconset already exist. \n// This script creates a manifest and signature, zips the folder, and returns the push package. \n\n// Use this script as an example to generate a push package dynamically.\n\n\n$certificate_path = \"website_aps_production.p12\";     // Change this to the path where your certificate is located\n$certificate_password = \"Two1Eighty2\"; // Change this to the certificate's import password\n\n// Convenience function that returns an array of raw files needed to construct the package.\nfunction raw_files() {\n    return array(\n        'icon.iconset/icon_16x16.png',\n        'icon.iconset/icon_16x16@2x.png',\n        'icon.iconset/icon_32x32.png',\n        'icon.iconset/icon_32x32@2x.png',\n        'icon.iconset/icon_128x128.png',\n        'icon.iconset/icon_128x128@2x.png',\n        'website.json'\n    );\n}\n\n// Copies the raw push package files to $package_dir.\nfunction copy_raw_push_package_files($package_dir) {\n    mkdir($package_dir . '/icon.iconset');\n    foreach (raw_files() as $raw_file) {\n        copy(\"pushPackage.raw/$raw_file\", \"$package_dir/$raw_file\");\n    }\n}\n\n// Creates the manifest by calculating the SHA1 hashes for all of the raw files in the package.\nfunction create_manifest($package_dir) {\n    // Obtain SHA1 hashes of all the files in the push package\n    $manifest_data = array();\n    foreach (raw_files() as $raw_file) {\n        $manifest_data[$raw_file] = sha1(file_get_contents(\"$package_dir/$raw_file\"));\n    }\n    file_put_contents(\"$package_dir/manifest.json\", json_encode((object)$manifest_data));\n}\n\n// Creates a signature of the manifest using the push notification certificate.\nfunction create_signature($package_dir, $cert_path, $cert_password) {\n    // Load the push notification certificate\n    $pkcs12 = file_get_contents($cert_path);\n    $certs = array();\n    if(!openssl_pkcs12_read($pkcs12, $certs, $cert_password)) {\n        return;\n    }\n\n    $signature_path = \"$package_dir/signature\";\n\n    // Sign the manifest.json file with the private key from the certificate\n    $cert_data = openssl_x509_read($certs['cert']);\n    $private_key = openssl_pkey_get_private($certs['pkey'], $cert_password);\n    openssl_pkcs7_sign(\"$package_dir/manifest.json\", $signature_path, $cert_data, $private_key, array(), PKCS7_BINARY | PKCS7_DETACHED);\n\n    // Convert the signature from PEM to DER\n    $signature_pem = file_get_contents($signature_path);\n    $matches = array();\n    if (!preg_match('~Content-Disposition:[^\\n]+\\s*?([A-Za-z0-9+=/\\r\\n]+)\\s*?-----~', $signature_pem, $matches)) {\n        return;\n    }\n    $signature_der = base64_decode($matches[1]);\n    file_put_contents($signature_path, $signature_der);\n}\n\n// Zips the directory structure into a push package, and returns the path to the archive.\nfunction package_raw_data($package_dir) {\n    $zip_path = \"$package_dir.zip\";\n\n    // Package files as a zip file\n    $zip = new ZipArchive();\n    if (!$zip->open(\"$package_dir.zip\", ZIPARCHIVE::CREATE)) {\n        error_log('Could not create ' . $zip_path);\n        return;\n    }\n\n    $raw_files = raw_files();\n    $raw_files[] = 'manifest.json';\n    $raw_files[] = 'signature';\n    foreach ($raw_files as $raw_file) {\n        $zip->addFile(\"$package_dir/$raw_file\", $raw_file);\n    }\n\n    $zip->close();\n    return $zip_path;\n}\n\n// Creates the push package, and returns the path to the archive.\nfunction create_push_package() {\n    global $certificate_path, $certificate_password;\n\n    // Create a temporary directory in which to assemble the push package\n    $package_dir = 'pushPackage' . time();\n    if (!mkdir($package_dir)) {\n        unlink($package_dir);\n        die;\n    }\n\n    copy_raw_push_package_files($package_dir);\n    create_manifest($package_dir);\n    create_signature($package_dir, $certificate_path, $certificate_password);\n    $package_path = package_raw_data($package_dir);\n\n    return $package_path;\n}\n\n\n// MAIN\n$package_path = create_push_package();\nif (empty($package_path)) {\n    http_response_code(500);\n    die;\n}\n\nheader(\"Content-type: application/zip\");\necho file_get_contents($package_path);\ndie;", "num_lines": 121}
{"repo_name": "azure-quickstart-templates", "repo_creator": "Azure", "programming_language": "PHP", "code": "<?php\n$servers = \"{COMMA_DELIMITED_SERVERS_LIST}\";\n$serversArray = explode(\",\",$servers);\n\nprint(\"Memcached servers: \".implode(\", \",$serversArray).\"<br>\");\n\n$mem = new Memcached();\n\nfor ($i=0; $i<sizeof($serversArray); $i++)\n{\n\t$mem->addServer($serversArray[$i], 11211);\n}\n\n$result = $mem->get(\"key1\");\n\n$date = date(\"Y-m-d G:i\");\nprint(\"Today's date \".$date.\"<br>\");\n\nif ($result) {\n\techo $result;\n} else {\n\techo \"No matching key found. It will be added now.\";\n\t$mem->set(\"key1\",\"This is the data in the key added on \".$date) or die(\"Could not save\");\n}\n\nprint(\"<div><b>memcached stats</b><br>\");\nprint_r($mem->getStats());\nprint(\"</div>\");\n\n?>", "num_lines": 30}
